From: support Date: Fri, 10 Jun 2022 09:41:51 +0000 (+0000) Subject: Built motion from commit 3d3f8903.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=a2e77877a2652d7245589aeeed900b51f4d577c8;p=motion2.git Built motion from commit 3d3f8903.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 71a8f9e..c5cc402 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-09T15:25:29.393Z", + "time": "2022-06-10T09:29:09.194Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a5237ca..f327daa 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-09T15:25:29.393Z", + "time": "2022-06-10T09:29:09.194Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index e3dcfbd..b4fc20a 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 _0xbb29=['TEXT','sequelize','getDataValue','STRING','contactManager','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x1b63e0,_0x40a5bc){var _0x5a4c6f=function(_0x5d223c){while(--_0x5d223c){_0x1b63e0['push'](_0x1b63e0['shift']());}};_0x5a4c6f(++_0x40a5bc);}(_0xbb29,0x15a));var _0x9bb2=function(_0x2736e8,_0x18423b){_0x2736e8=_0x2736e8-0x0;var _0x57d914=_0xbb29[_0x2736e8];return _0x57d914;};'use strict';var Sequelize=require(_0x9bb2('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x128638){return this[_0x9bb2('0x1')]('action');}},'action':{'type':Sequelize[_0x9bb2('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9bb2('0x3'),'integration','motionbar',_0x9bb2('0x4'),_0x9bb2('0x5'),_0x9bb2('0x6'),_0x9bb2('0x7'),_0x9bb2('0x8')]],'msg':_0x9bb2('0x9')}},'comment':_0x9bb2('0x9')},'data1':{'type':Sequelize[_0x9bb2('0x2')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x9bb2('0xa')},'data3':{'type':Sequelize[_0x9bb2('0x2')](0x1000),'comment':_0x9bb2('0xb')},'data4':{'type':Sequelize[_0x9bb2('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x9bb2('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x9bb2('0xd')},'data7':{'type':Sequelize[_0x9bb2('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x66dd=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x247508,_0x3fb78a){var _0x401cf8=function(_0x489eda){while(--_0x489eda){_0x247508['push'](_0x247508['shift']());}};_0x401cf8(++_0x3fb78a);}(_0x66dd,0xb8));var _0xd66d=function(_0x44966f,_0x4758ed){_0x44966f=_0x44966f-0x0;var _0x5538a0=_0x66dd[_0x44966f];return _0x5538a0;};'use strict';var Sequelize=require('sequelize');module[_0xd66d('0x0')]={'name':{'type':Sequelize[_0xd66d('0x1')],'get':function(_0xe0e113){return this[_0xd66d('0x2')](_0xd66d('0x3'));}},'action':{'type':Sequelize[_0xd66d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd66d('0x5'),'integration',_0xd66d('0x6'),_0xd66d('0x7'),'urlForward',_0xd66d('0x8'),_0xd66d('0x9'),_0xd66d('0xa')]],'msg':_0xd66d('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xd66d('0xc')},'data2':{'type':Sequelize[_0xd66d('0x4')](0x1000),'comment':_0xd66d('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xd66d('0xe')},'data4':{'type':Sequelize[_0xd66d('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xd66d('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xd66d('0x4')],'comments':_0xd66d('0xf')},'data7':{'type':Sequelize[_0xd66d('0x10')],'comments':_0xd66d('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index ca7674b..10313ab 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 _0x9a12=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','sendStatus','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x21e79a,_0x5a7990){var _0x506c02=function(_0x566c95){while(--_0x566c95){_0x21e79a['push'](_0x21e79a['shift']());}};_0x506c02(++_0x5a7990);}(_0x9a12,0x10b));var _0x29a1=function(_0x1c9120,_0x4e2335){_0x1c9120=_0x1c9120-0x0;var _0x279a6b=_0x9a12[_0x1c9120];return _0x279a6b;};'use strict';var emlformat=require(_0x29a1('0x0'));var rimraf=require(_0x29a1('0x1'));var zipdir=require(_0x29a1('0x2'));var jsonpatch=require(_0x29a1('0x3'));var rp=require(_0x29a1('0x4'));var moment=require('moment');var BPromise=require(_0x29a1('0x5'));var Mustache=require(_0x29a1('0x6'));var util=require(_0x29a1('0x7'));var path=require(_0x29a1('0x8'));var sox=require(_0x29a1('0x9'));var csv=require(_0x29a1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29a1('0xb'));var _=require(_0x29a1('0xc'));var squel=require(_0x29a1('0xd'));var crypto=require(_0x29a1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x29a1('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x29a1('0x10'));var Redis=require(_0x29a1('0x11'));var authService=require(_0x29a1('0x12'));var qs=require(_0x29a1('0x13'));var as=require(_0x29a1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x29a1('0x15'));var utils=require('../../config/utils');var config=require(_0x29a1('0x16'));var licenseUtil=require(_0x29a1('0x17'));var db=require(_0x29a1('0x18'))['db'];function respondWithStatusCode(_0x4c8a40,_0x4ed60b){_0x4ed60b=_0x4ed60b||0xcc;return function(_0xa5e51e){if(_0xa5e51e){return _0x4c8a40['sendStatus'](_0x4ed60b);}return _0x4c8a40[_0x29a1('0x19')](_0x4ed60b)[_0x29a1('0x1a')]();};}function respondWithResult(_0x4b20f1,_0x4045bf){_0x4045bf=_0x4045bf||0xc8;return function(_0x55c8a2){if(_0x55c8a2){return _0x4b20f1[_0x29a1('0x19')](_0x4045bf)[_0x29a1('0x1b')](_0x55c8a2);}};}function respondWithFilteredResult(_0x122166,_0x275ff7){return function(_0x2e756a){if(_0x2e756a){var _0x4f2c15=typeof _0x275ff7[_0x29a1('0x1c')]==='undefined'&&typeof _0x275ff7[_0x29a1('0x1d')]===_0x29a1('0x1e');var _0x16cd93=_0x2e756a['count'];var _0x41644f=_0x4f2c15?0x0:_0x275ff7[_0x29a1('0x1c')];var _0x4a1031=_0x4f2c15?_0x2e756a[_0x29a1('0x1f')]:_0x275ff7['offset']+_0x275ff7[_0x29a1('0x1d')];var _0x2a3ab3;if(_0x4a1031>=_0x16cd93){_0x4a1031=_0x16cd93;_0x2a3ab3=0xc8;}else{_0x2a3ab3=0xce;}_0x122166[_0x29a1('0x19')](_0x2a3ab3);return _0x122166[_0x29a1('0x20')]('Content-Range',_0x41644f+'-'+_0x4a1031+'/'+_0x16cd93)[_0x29a1('0x1b')](_0x2e756a);}return null;};}function patchUpdates(_0x9204a8){return function(_0x579dee){try{jsonpatch[_0x29a1('0x21')](_0x579dee,_0x9204a8,!![]);}catch(_0x306550){return BPromise[_0x29a1('0x22')](_0x306550);}return _0x579dee['save']();};}function saveUpdates(_0x24434e,_0x500c15){return function(_0x9f9cad){if(_0x9f9cad){return _0x9f9cad[_0x29a1('0x23')](_0x24434e)['then'](function(_0x36f1fb){return _0x36f1fb;});}return null;};}function removeEntity(_0xc7e4bf,_0x481688){return function(_0x34efbb){if(_0x34efbb){return _0x34efbb[_0x29a1('0x24')]()[_0x29a1('0x25')](function(){_0xc7e4bf[_0x29a1('0x19')](0xcc)[_0x29a1('0x1a')]();});}};}function handleEntityNotFound(_0x3bef7d,_0x38aeaa){return function(_0x35d40){if(!_0x35d40){_0x3bef7d[_0x29a1('0x26')](0x194);}return _0x35d40;};}function handleError(_0x5d5b75,_0xbd09a0){_0xbd09a0=_0xbd09a0||0x1f4;return function(_0x2a680c){logger['error'](_0x2a680c[_0x29a1('0x27')]);if(_0x2a680c[_0x29a1('0x28')]){delete _0x2a680c['name'];}_0x5d5b75[_0x29a1('0x19')](_0xbd09a0)[_0x29a1('0x29')](_0x2a680c);};}exports[_0x29a1('0x23')]=function(_0x19511b,_0x1c75b5){if(_0x19511b[_0x29a1('0x2a')]['id']){delete _0x19511b[_0x29a1('0x2a')]['id'];}return db[_0x29a1('0x2b')][_0x29a1('0x2c')]({'where':{'id':_0x19511b['params']['id']}})[_0x29a1('0x25')](handleEntityNotFound(_0x1c75b5,null))[_0x29a1('0x25')](saveUpdates(_0x19511b[_0x29a1('0x2a')],null))[_0x29a1('0x25')](respondWithResult(_0x1c75b5,null))[_0x29a1('0x2d')](handleError(_0x1c75b5,null));};exports['destroy']=function(_0x3d985f,_0x254053){return db['Action'][_0x29a1('0x2c')]({'where':{'id':_0x3d985f[_0x29a1('0x2e')]['id']}})[_0x29a1('0x25')](handleEntityNotFound(_0x254053,null))[_0x29a1('0x25')](removeEntity(_0x254053,null))[_0x29a1('0x2d')](handleError(_0x254053,null));}; \ No newline at end of file +var _0xbac0=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','error','name','send','body','then','destroy','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0xbac0,0x18b));var _0x0bac=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0xbac0[_0x4bd67a];return _0x2be5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bac('0x0'));var zipdir=require(_0x0bac('0x1'));var jsonpatch=require(_0x0bac('0x2'));var rp=require(_0x0bac('0x3'));var moment=require(_0x0bac('0x4'));var BPromise=require(_0x0bac('0x5'));var Mustache=require(_0x0bac('0x6'));var util=require(_0x0bac('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0bac('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bac('0x9'));var _=require('lodash');var squel=require(_0x0bac('0xa'));var crypto=require(_0x0bac('0xb'));var jsforce=require(_0x0bac('0xc'));var deskjs=require(_0x0bac('0xd'));var toCsv=require(_0x0bac('0x8'));var querystring=require('querystring');var Papa=require(_0x0bac('0xe'));var Redis=require(_0x0bac('0xf'));var authService=require(_0x0bac('0x10'));var qs=require(_0x0bac('0x11'));var as=require(_0x0bac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bac('0x13'))(_0x0bac('0x14'));var utils=require('../../config/utils');var config=require(_0x0bac('0x15'));var licenseUtil=require(_0x0bac('0x16'));var db=require(_0x0bac('0x17'))['db'];function respondWithStatusCode(_0x4dd5db,_0x1019e9){_0x1019e9=_0x1019e9||0xcc;return function(_0x534d65){if(_0x534d65){return _0x4dd5db[_0x0bac('0x18')](_0x1019e9);}return _0x4dd5db[_0x0bac('0x19')](_0x1019e9)[_0x0bac('0x1a')]();};}function respondWithResult(_0x547665,_0x20ab2d){_0x20ab2d=_0x20ab2d||0xc8;return function(_0x41df10){if(_0x41df10){return _0x547665[_0x0bac('0x19')](_0x20ab2d)['json'](_0x41df10);}};}function respondWithFilteredResult(_0x27452b,_0x58e8de){return function(_0x2efda7){if(_0x2efda7){var _0x3390bb=typeof _0x58e8de[_0x0bac('0x1b')]===_0x0bac('0x1c')&&typeof _0x58e8de['limit']===_0x0bac('0x1c');var _0x4b7252=_0x2efda7['count'];var _0x2a3857=_0x3390bb?0x0:_0x58e8de['offset'];var _0x52dfdd=_0x3390bb?_0x2efda7['count']:_0x58e8de[_0x0bac('0x1b')]+_0x58e8de[_0x0bac('0x1d')];var _0x3b218a;if(_0x52dfdd>=_0x4b7252){_0x52dfdd=_0x4b7252;_0x3b218a=0xc8;}else{_0x3b218a=0xce;}_0x27452b[_0x0bac('0x19')](_0x3b218a);return _0x27452b[_0x0bac('0x1e')](_0x0bac('0x1f'),_0x2a3857+'-'+_0x52dfdd+'/'+_0x4b7252)[_0x0bac('0x20')](_0x2efda7);}return null;};}function patchUpdates(_0x46dd41){return function(_0x10a455){try{jsonpatch[_0x0bac('0x21')](_0x10a455,_0x46dd41,!![]);}catch(_0x1468e2){return BPromise['reject'](_0x1468e2);}return _0x10a455[_0x0bac('0x22')]();};}function saveUpdates(_0x1913ba,_0xdbf182){return function(_0x5c5a17){if(_0x5c5a17){return _0x5c5a17[_0x0bac('0x23')](_0x1913ba)['then'](function(_0x424b8c){return _0x424b8c;});}return null;};}function removeEntity(_0x18b584,_0x478631){return function(_0x390dc9){if(_0x390dc9){return _0x390dc9['destroy']()['then'](function(){_0x18b584[_0x0bac('0x19')](0xcc)[_0x0bac('0x1a')]();});}};}function handleEntityNotFound(_0xe13735,_0x4d16db){return function(_0x54d040){if(!_0x54d040){_0xe13735[_0x0bac('0x18')](0x194);}return _0x54d040;};}function handleError(_0x3d8d2a,_0x3f167b){_0x3f167b=_0x3f167b||0x1f4;return function(_0x2f7bce){logger[_0x0bac('0x24')](_0x2f7bce['stack']);if(_0x2f7bce[_0x0bac('0x25')]){delete _0x2f7bce['name'];}_0x3d8d2a[_0x0bac('0x19')](_0x3f167b)[_0x0bac('0x26')](_0x2f7bce);};}exports[_0x0bac('0x23')]=function(_0x2480b4,_0x1bd6d0){if(_0x2480b4[_0x0bac('0x27')]['id']){delete _0x2480b4[_0x0bac('0x27')]['id'];}return db['Action']['find']({'where':{'id':_0x2480b4['params']['id']}})['then'](handleEntityNotFound(_0x1bd6d0,null))[_0x0bac('0x28')](saveUpdates(_0x2480b4[_0x0bac('0x27')],null))['then'](respondWithResult(_0x1bd6d0,null))['catch'](handleError(_0x1bd6d0,null));};exports[_0x0bac('0x29')]=function(_0x7970f6,_0x1ba317){return db['Action'][_0x0bac('0x2a')]({'where':{'id':_0x7970f6[_0x0bac('0x2b')]['id']}})[_0x0bac('0x28')](handleEntityNotFound(_0x1ba317,null))[_0x0bac('0x28')](removeEntity(_0x1ba317,null))[_0x0bac('0x2c')](handleError(_0x1ba317,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 96325aa..46f54bc 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 _0x6ced=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_actions','lodash'];(function(_0x6d27cc,_0x26721c){var _0x3471dc=function(_0x33f283){while(--_0x33f283){_0x6d27cc['push'](_0x6d27cc['shift']());}};_0x3471dc(++_0x26721c);}(_0x6ced,0x6d));var _0xd6ce=function(_0x46b1ea,_0x2084cf){_0x46b1ea=_0x46b1ea-0x0;var _0x4b31c1=_0x6ced[_0x46b1ea];return _0x4b31c1;};'use strict';var _=require(_0xd6ce('0x0'));var util=require(_0xd6ce('0x1'));var logger=require('../../config/logger')(_0xd6ce('0x2'));var moment=require(_0xd6ce('0x3'));var BPromise=require(_0xd6ce('0x4'));var rp=require(_0xd6ce('0x5'));var fs=require('fs');var path=require(_0xd6ce('0x6'));var rimraf=require(_0xd6ce('0x7'));var config=require(_0xd6ce('0x8'));var attributes=require('./action.attributes');module['exports']=function(_0x45d4e2,_0x200187){return _0x45d4e2[_0xd6ce('0x9')]('Action',attributes,{'tableName':_0xd6ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffc8=['../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5610cb,_0x478cdf){var _0xcd207=function(_0x499667){while(--_0x499667){_0x5610cb['push'](_0x5610cb['shift']());}};_0xcd207(++_0x478cdf);}(_0xffc8,0x123));var _0x8ffc=function(_0x2b4048,_0x579711){_0x2b4048=_0x2b4048-0x0;var _0x22783f=_0xffc8[_0x2b4048];return _0x22783f;};'use strict';var _=require(_0x8ffc('0x0'));var util=require(_0x8ffc('0x1'));var logger=require(_0x8ffc('0x2'))(_0x8ffc('0x3'));var moment=require(_0x8ffc('0x4'));var BPromise=require(_0x8ffc('0x5'));var rp=require(_0x8ffc('0x6'));var fs=require('fs');var path=require(_0x8ffc('0x7'));var rimraf=require('rimraf');var config=require(_0x8ffc('0x8'));var attributes=require(_0x8ffc('0x9'));module[_0x8ffc('0xa')]=function(_0x4db906,_0x3363c4){return _0x4db906['define'](_0x8ffc('0xb'),attributes,{'tableName':_0x8ffc('0xc'),'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 ed3163d..58f2f41 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x350d22,_0x298c1f){var _0x5200f1=function(_0x15edc5){while(--_0x15edc5){_0x350d22['push'](_0x350d22['shift']());}};_0x5200f1(++_0x298c1f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x141a2f,_0x58d944){_0x141a2f=_0x141a2f-0x0;var _0x1e84d3=_0x7fbe[_0x141a2f];return _0x1e84d3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x569393,_0x3525c3){var _0x23f9ed=function(_0x30fd91){while(--_0x30fd91){_0x569393['push'](_0x569393['shift']());}};_0x23f9ed(++_0x3525c3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0x5fc3[_0x5d3903];return _0x4b8bc9;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 0adfc5f..d4cc462 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 _0x8987=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x57dcca,_0x8f782e){var _0x1798b2=function(_0x22394c){while(--_0x22394c){_0x57dcca['push'](_0x57dcca['shift']());}};_0x1798b2(++_0x8f782e);}(_0x8987,0x15c));var _0x7898=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x8987[_0x124f88];return _0xed0e3b;};'use strict';var multer=require('multer');var util=require(_0x7898('0x0'));var path=require(_0x7898('0x1'));var timeout=require('connect-timeout');var express=require(_0x7898('0x2'));var router=express[_0x7898('0x3')]();var fs_extra=require(_0x7898('0x4'));var auth=require(_0x7898('0x5'));var interaction=require(_0x7898('0x6'));var config=require(_0x7898('0x7'));var controller=require(_0x7898('0x8'));router[_0x7898('0x9')]('/:id',auth[_0x7898('0xa')](),controller[_0x7898('0xb')]);router[_0x7898('0xc')](_0x7898('0xd'),auth[_0x7898('0xa')](),controller['destroy']);module[_0x7898('0xe')]=router; \ No newline at end of file +var _0x1c82=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','destroy','path'];(function(_0x408560,_0x413b7f){var _0x3d8b31=function(_0x471c40){while(--_0x471c40){_0x408560['push'](_0x408560['shift']());}};_0x3d8b31(++_0x413b7f);}(_0x1c82,0x13e));var _0x21c8=function(_0x221751,_0x482620){_0x221751=_0x221751-0x0;var _0x537952=_0x1c82[_0x221751];return _0x537952;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x21c8('0x0'));var timeout=require('connect-timeout');var express=require(_0x21c8('0x1'));var router=express[_0x21c8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x21c8('0x3'));var interaction=require(_0x21c8('0x4'));var config=require(_0x21c8('0x5'));var controller=require('./action.controller');router[_0x21c8('0x6')]('/:id',auth[_0x21c8('0x7')](),controller[_0x21c8('0x8')]);router[_0x21c8('0x9')]('/:id',auth[_0x21c8('0x7')](),controller[_0x21c8('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index cf90717..141c0f0 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xafc4,0x69));var _0x4afc=function(_0x4f4afb,_0x3d31d3){_0x4f4afb=_0x4f4afb-0x0;var _0x467286=_0xafc4[_0x4f4afb];return _0x467286;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file +var _0xae24=['sequelize','STRING'];(function(_0x29098f,_0x4ae3b6){var _0x576eb5=function(_0x1692b7){while(--_0x1692b7){_0x29098f['push'](_0x29098f['shift']());}};_0x576eb5(++_0x4ae3b6);}(_0xae24,0x182));var _0x4ae2=function(_0x3d96b5,_0x38f43d){_0x3d96b5=_0x3d96b5-0x0;var _0x29e009=_0xae24[_0x3d96b5];return _0x29e009;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2c3eb6b..2d9a10d 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 _0x672d=['countTable','COUNT(*)','SELECT','runReport','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','filter','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','CustomReports','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','table','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','DATE(%s)','AnalyticMetric','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x672d,0x154));var _0xd672=function(_0x3daeba,_0x130354){_0x3daeba=_0x3daeba-0x0;var _0x34500d=_0x672d[_0x3daeba];return _0x34500d;};'use strict';var emlformat=require(_0xd672('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd672('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd672('0x2'));var moment=require(_0xd672('0x3'));var BPromise=require(_0xd672('0x4'));var Mustache=require(_0xd672('0x5'));var util=require('util');var path=require(_0xd672('0x6'));var sox=require(_0xd672('0x7'));var csv=require(_0xd672('0x8'));var ejs=require(_0xd672('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd672('0xa'));var squel=require(_0xd672('0xb'));var crypto=require(_0xd672('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd672('0xd'));var toCsv=require(_0xd672('0x8'));var querystring=require(_0xd672('0xe'));var Papa=require('papaparse');var Redis=require(_0xd672('0xf'));var authService=require(_0xd672('0x10'));var qs=require(_0xd672('0x11'));var as=require(_0xd672('0x12'));var hardwareService=require(_0xd672('0x13'));var logger=require(_0xd672('0x14'))(_0xd672('0x15'));var utils=require(_0xd672('0x16'));var config=require(_0xd672('0x17'));var licenseUtil=require(_0xd672('0x18'));var db=require(_0xd672('0x19'))['db'];var dbH=require(_0xd672('0x19'))[_0xd672('0x1a')];function respondWithStatusCode(_0x4ff02b,_0xa99b58){_0xa99b58=_0xa99b58||0xcc;return function(_0xfd2e4a){if(_0xfd2e4a){return _0x4ff02b[_0xd672('0x1b')](_0xa99b58);}return _0x4ff02b[_0xd672('0x1c')](_0xa99b58)['end']();};}function respondWithResult(_0x2f3d7a,_0x15307c){_0x15307c=_0x15307c||0xc8;return function(_0x56496e){if(_0x56496e){return _0x2f3d7a[_0xd672('0x1c')](_0x15307c)[_0xd672('0x1d')](_0x56496e);}};}function respondWithFilteredResult(_0x31c01a,_0x4ad65f){return function(_0x265360){if(_0x265360){var _0x10e270=typeof _0x4ad65f[_0xd672('0x1e')]==='undefined'&&typeof _0x4ad65f['limit']===_0xd672('0x1f');var _0x27b499=_0x265360[_0xd672('0x20')];var _0xc274d5=_0x10e270?0x0:_0x4ad65f['offset'];var _0x3d59e7=_0x10e270?_0x265360['count']:_0x4ad65f[_0xd672('0x1e')]+_0x4ad65f['limit'];var _0xd57781;if(_0x3d59e7>=_0x27b499){_0x3d59e7=_0x27b499;_0xd57781=0xc8;}else{_0xd57781=0xce;}_0x31c01a[_0xd672('0x1c')](_0xd57781);return _0x31c01a[_0xd672('0x21')](_0xd672('0x22'),_0xc274d5+'-'+_0x3d59e7+'/'+_0x27b499)[_0xd672('0x1d')](_0x265360);}return null;};}function patchUpdates(_0x5111f1){return function(_0x1cb862){try{jsonpatch[_0xd672('0x23')](_0x1cb862,_0x5111f1,!![]);}catch(_0x2c00ca){return BPromise[_0xd672('0x24')](_0x2c00ca);}return _0x1cb862['save']();};}function saveUpdates(_0x30449d,_0x33636b){return function(_0x48737e){if(_0x48737e){return _0x48737e[_0xd672('0x25')](_0x30449d)[_0xd672('0x26')](function(_0x2171af){return _0x2171af;});}return null;};}function removeEntity(_0x537e93,_0x54cec8){return function(_0x3d32c2){if(_0x3d32c2){return _0x3d32c2[_0xd672('0x27')]()['then'](function(){var _0x171824=_0x3d32c2['get']({'plain':!![]});var _0x29c80d='CustomReports';return db[_0xd672('0x28')][_0xd672('0x27')]({'where':{'type':_0x29c80d,'resourceId':_0x171824['id']}})[_0xd672('0x26')](function(){return _0x3d32c2;});})[_0xd672('0x26')](function(){_0x537e93[_0xd672('0x1c')](0xcc)[_0xd672('0x29')]();});}};}function handleEntityNotFound(_0x5b1858,_0x1ed060){return function(_0x5a2b1e){if(!_0x5a2b1e){_0x5b1858[_0xd672('0x1b')](0x194);}return _0x5a2b1e;};}function handleError(_0x48b5af,_0xcbe367){_0xcbe367=_0xcbe367||0x1f4;return function(_0x54f0fd){logger[_0xd672('0x2a')](_0x54f0fd['stack']);if(_0x54f0fd['name']){delete _0x54f0fd[_0xd672('0x2b')];}_0x48b5af[_0xd672('0x1c')](_0xcbe367)[_0xd672('0x2c')](_0x54f0fd);};}exports[_0xd672('0x2d')]=function(_0x2fe4ab,_0x3dd972){var _0x282fb3={},_0xc65055={},_0xf4cf09={'count':0x0,'rows':[]};var _0x471d4c=_[_0xd672('0x2e')](db[_0xd672('0x2f')][_0xd672('0x30')],function(_0x53f3c6){return{'name':_0x53f3c6['fieldName'],'type':_0x53f3c6['type'][_0xd672('0x31')]};});_0xc65055['model']=_[_0xd672('0x2e')](_0x471d4c,_0xd672('0x2b'));_0xc65055[_0xd672('0x32')]=_[_0xd672('0x33')](_0x2fe4ab['query']);_0xc65055[_0xd672('0x34')]=_[_0xd672('0x35')](_0xc65055[_0xd672('0x36')],_0xc65055[_0xd672('0x32')]);_0x282fb3[_0xd672('0x37')]=_['intersection'](_0xc65055[_0xd672('0x36')],qs[_0xd672('0x38')](_0x2fe4ab['query'][_0xd672('0x38')]));_0x282fb3[_0xd672('0x37')]=_0x282fb3[_0xd672('0x37')][_0xd672('0x39')]?_0x282fb3['attributes']:_0xc65055['model'];if(!_0x2fe4ab[_0xd672('0x32')][_0xd672('0x3a')](_0xd672('0x3b'))){_0x282fb3[_0xd672('0x3c')]=qs['limit'](_0x2fe4ab[_0xd672('0x32')][_0xd672('0x3c')]);_0x282fb3[_0xd672('0x1e')]=qs[_0xd672('0x1e')](_0x2fe4ab['query'][_0xd672('0x1e')]);}_0x282fb3[_0xd672('0x3d')]=qs[_0xd672('0x3e')](_0x2fe4ab[_0xd672('0x32')][_0xd672('0x3e')]);_0x282fb3['where']=qs[_0xd672('0x34')](_[_0xd672('0x3f')](_0x2fe4ab['query'],_0xc65055[_0xd672('0x34')]),_0x471d4c);if(_0x2fe4ab[_0xd672('0x32')]['filter']){_0x282fb3[_0xd672('0x40')]=_[_0xd672('0x41')](_0x282fb3[_0xd672('0x40')],{'$or':_[_0xd672('0x2e')](_0x471d4c,function(_0x39277c){if(_0x39277c[_0xd672('0x42')]!=='VIRTUAL'){var _0x29b372={};_0x29b372[_0x39277c[_0xd672('0x2b')]]={'$like':'%'+_0x2fe4ab[_0xd672('0x32')][_0xd672('0x43')]+'%'};return _0x29b372;}})});}_0x282fb3=_[_0xd672('0x41')]({},_0x282fb3,_0x2fe4ab['options']);var _0x240537={'where':_0x282fb3[_0xd672('0x40')]};return db['AnalyticCustomReport'][_0xd672('0x20')](_0x240537)[_0xd672('0x26')](function(_0x56d03d){_0xf4cf09[_0xd672('0x20')]=_0x56d03d;if(_0x2fe4ab['query']['includeAll']){_0x282fb3['include']=[{'all':!![]}];}return db[_0xd672('0x2f')][_0xd672('0x44')](_0x282fb3);})[_0xd672('0x26')](function(_0xd0f09f){_0xf4cf09[_0xd672('0x45')]=_0xd0f09f;return _0xf4cf09;})[_0xd672('0x26')](respondWithFilteredResult(_0x3dd972,_0x282fb3))[_0xd672('0x46')](handleError(_0x3dd972,null));};exports[_0xd672('0x47')]=function(_0x5e15fe,_0xa61968){var _0x54ffe0={'raw':![],'where':{'id':_0x5e15fe[_0xd672('0x48')]['id']}},_0x36db6e={};_0x36db6e[_0xd672('0x36')]=_[_0xd672('0x33')](db['AnalyticCustomReport'][_0xd672('0x30')]);_0x36db6e[_0xd672('0x32')]=_['keys'](_0x5e15fe[_0xd672('0x32')]);_0x36db6e[_0xd672('0x34')]=_['intersection'](_0x36db6e[_0xd672('0x36')],_0x36db6e[_0xd672('0x32')]);_0x54ffe0['attributes']=_[_0xd672('0x35')](_0x36db6e[_0xd672('0x36')],qs[_0xd672('0x38')](_0x5e15fe['query'][_0xd672('0x38')]));_0x54ffe0[_0xd672('0x37')]=_0x54ffe0['attributes'][_0xd672('0x39')]?_0x54ffe0[_0xd672('0x37')]:_0x36db6e[_0xd672('0x36')];if(_0x5e15fe[_0xd672('0x32')][_0xd672('0x49')]){_0x54ffe0[_0xd672('0x4a')]=[{'all':!![]}];}_0x54ffe0=_[_0xd672('0x41')]({},_0x54ffe0,_0x5e15fe[_0xd672('0x4b')]);return db['AnalyticCustomReport'][_0xd672('0x4c')](_0x54ffe0)[_0xd672('0x26')](handleEntityNotFound(_0xa61968,null))[_0xd672('0x26')](respondWithResult(_0xa61968,null))['catch'](handleError(_0xa61968,null));};exports[_0xd672('0x4d')]=function(_0x15e53c,_0x4ce57e){return db[_0xd672('0x2f')][_0xd672('0x4d')](_0x15e53c[_0xd672('0x4e')],{})['then'](function(_0x231cf7){var _0x3b8720=_0x15e53c['user']['get']({'plain':!![]});if(!_0x3b8720)throw new Error(_0xd672('0x4f'));if(_0x3b8720[_0xd672('0x50')]===_0xd672('0x51')){var _0x188ad5=_0x231cf7['get']({'plain':!![]});var _0x547c8e=_0xd672('0x52');return db['UserProfileSection']['find']({'where':{'name':_0x547c8e,'userProfileId':_0x3b8720[_0xd672('0x53')]},'raw':!![]})[_0xd672('0x26')](function(_0x50d59c){if(_0x50d59c&&_0x50d59c[_0xd672('0x54')]===0x0){return db[_0xd672('0x28')][_0xd672('0x4d')]({'name':_0x188ad5[_0xd672('0x2b')],'resourceId':_0x188ad5['id'],'type':_0xd672('0x55'),'sectionId':_0x50d59c['id']},{})[_0xd672('0x26')](function(){return _0x231cf7;});}else{return _0x231cf7;}})['catch'](function(_0x477277){logger[_0xd672('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x477277);throw _0x477277;});}return _0x231cf7;})[_0xd672('0x26')](respondWithResult(_0x4ce57e,0xc9))[_0xd672('0x46')](handleError(_0x4ce57e,null));};exports['update']=function(_0x19e328,_0x1f5ca9){if(_0x19e328['body']['id']){delete _0x19e328[_0xd672('0x4e')]['id'];}return db[_0xd672('0x2f')][_0xd672('0x4c')]({'where':{'id':_0x19e328[_0xd672('0x48')]['id']}})[_0xd672('0x26')](handleEntityNotFound(_0x1f5ca9,null))[_0xd672('0x26')](saveUpdates(_0x19e328[_0xd672('0x4e')],null))[_0xd672('0x26')](respondWithResult(_0x1f5ca9,null))[_0xd672('0x46')](handleError(_0x1f5ca9,null));};exports[_0xd672('0x27')]=function(_0x30f90b,_0x24a6c9){return db['AnalyticCustomReport']['find']({'where':{'id':_0x30f90b[_0xd672('0x48')]['id']}})['then'](handleEntityNotFound(_0x24a6c9,null))[_0xd672('0x26')](removeEntity(_0x24a6c9,null))['catch'](handleError(_0x24a6c9,null));};exports['preview']=function(_0x4d3bd4,_0x543b2b){var _0x22c698=0xa;var _0x1f11c5=[_0xd672('0x56'),_0xd672('0x57'),'right_join',_0xd672('0x58')];var _0x152d22={'SUM':_0xd672('0x59'),'COUNT':_0xd672('0x5a'),'COUNT DISTINCT':_0xd672('0x5b'),'MAX':_0xd672('0x5c'),'MIN':_0xd672('0x5d'),'AVG':_0xd672('0x5e'),'GROUP_CONCAT':_0xd672('0x5f'),'GROUP_CONCAT ASC':_0xd672('0x60'),'GROUP_CONCAT DESC':_0xd672('0x61')};var _0x438f82={'SEC_TO_TIME':_0xd672('0x62'),'DATE':'DATE(%s)','HOUR':_0xd672('0x63'),'ROUND':_0xd672('0x64'),'UNIX_TIMESTAMP':_0xd672('0x65')};var _0x361c37=function(_0x29f359){return!_[_0xd672('0x66')]([_0xd672('0x67'),_0xd672('0x68'),_0xd672('0x69'),'IS\x20NOT\x20EMPTY'],_0x29f359);};var _0x19121d=function(_0x3cb7eb){if(!_0x3cb7eb||!_0x3cb7eb[_0xd672('0x6a')]['length']){return'';}for(var _0x40742a='(',_0x57df7a=0x0;_0x57df7a<_0x3cb7eb['rules']['length'];_0x57df7a+=0x1){_0x57df7a>0x0&&(_0x40742a+='\x20'+_0x3cb7eb[_0xd672('0x6b')]+'\x20');_0x40742a+=_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6c')]?_0x19121d(_0x3cb7eb[_0xd672('0x6a')][_0x57df7a]['group']):_0x3cb7eb['rules'][_0x57df7a][_0xd672('0x6d')]+'\x20'+_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6e')]+(_0x361c37(_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6e')])?'\x20'+_0x3cb7eb[_0xd672('0x6a')][_0x57df7a][_0xd672('0x6f')]:'');}return _0x40742a+')';};var _0x13495e={'where':{'id':_0x4d3bd4['params']['id']}},_0x50db6d,_0x324ae7,_0x1fbcb2,_0x27da97,_0x1e14e1;_0x13495e=_['merge']({},_0x13495e,_0x4d3bd4[_0xd672('0x4b')]);return db[_0xd672('0x2f')][_0xd672('0x4c')](_0x13495e)[_0xd672('0x26')](function(_0x11f721){if(_0x11f721){_0x50db6d=_0x11f721;return _0x11f721[_0xd672('0x70')]();}return null;})[_0xd672('0x26')](function(_0x19b369){if(_0x19b369){if(!_0x19b369['length']){throw new db[(_0xd672('0x71'))][(_0xd672('0x72'))](_0xd672('0x73'),0x193);}_0x324ae7=_0x19b369;return db['AnalyticMetric'][_0xd672('0x44')]({'raw':!![]});}return null;})[_0xd672('0x26')](function(_0x39ced0){if(_0x39ced0){_0x1fbcb2=_[_0xd672('0x74')](_0x39ced0,'id');var _0xcc9889;var _0x3b76b2=squel[_0xd672('0x75')]();_0x3b76b2[_0xd672('0x76')](_0x50db6d['table']);for(var _0x539b30=0x0;_0x539b30<_0x324ae7['length'];_0x539b30+=0x1){_0xcc9889=_0x324ae7[_0x539b30][_0xd672('0x77')]?_0x1fbcb2[_0x324ae7[_0x539b30]['MetricId']][_0xd672('0x78')]:_0x324ae7[_0x539b30][_0xd672('0x6d')];_0xcc9889=_0x324ae7[_0x539b30][_0xd672('0x79')]?_[_0xd672('0x7a')](_0x152d22[_0x324ae7[_0x539b30][_0xd672('0x79')]],'%s',_0xcc9889):_0xcc9889;_0xcc9889=_0x324ae7[_0x539b30][_0xd672('0x7b')]?_['replace'](_0x438f82[_0x324ae7[_0x539b30][_0xd672('0x7b')]],'%s',_0xcc9889):_0xcc9889;if(_0x324ae7[_0x539b30][_0xd672('0x7c')]){_0x3b76b2[_0xd672('0x6c')](_0xcc9889);}_0x324ae7[_0x539b30][_0xd672('0x7d')]&&_0x3b76b2[_0xd672('0x3d')](_0xcc9889,_0x324ae7[_0x539b30]['orderBy']===_0xd672('0x7e')?![]:!![]);_0x3b76b2[_0xd672('0x6d')](_0xcc9889,_0x324ae7[_0x539b30]['alias']||_0xcc9889);}if(_0x50db6d['joins']){_0x50db6d[_0xd672('0x7f')]=JSON[_0xd672('0x80')](_0x50db6d[_0xd672('0x7f')]);for(var _0x4172b9=0x0;_0x4172b9<_0x50db6d[_0xd672('0x7f')][_0xd672('0x39')];_0x4172b9+=0x1){if(_0x50db6d['joins'][_0x4172b9][_0xd672('0x42')]&&_[_0xd672('0x66')](_0x1f11c5,_0x50db6d['joins'][_0x4172b9][_0xd672('0x42')])&&_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x81')]&&_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x82')]&&_0x50db6d['joins'][_0x4172b9]['foreignKey']){_0x3b76b2[_0x50db6d[_0xd672('0x7f')][_0x4172b9]['type']](_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x82')],null,util[_0xd672('0x7b')]('%s.%s\x20=\x20%s.%s',_0x50db6d[_0xd672('0x83')],_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x81')],_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x82')],_0x50db6d[_0xd672('0x7f')][_0x4172b9][_0xd672('0x84')]));}}}if(_0x50db6d[_0xd672('0x85')]){_0x50db6d[_0xd672('0x85')]=JSON[_0xd672('0x80')](_0x50db6d[_0xd672('0x85')]);_0x3b76b2[_0xd672('0x40')](_0x19121d(_0x50db6d[_0xd672('0x85')][_0xd672('0x6c')]));}_0x1e14e1=_0x3b76b2['clone']();_0x3b76b2[_0xd672('0x3c')](_0x22c698);_0x3b76b2[_0xd672('0x1e')](0x0);logger[_0xd672('0x86')](_0xd672('0x87'),_0x3b76b2[_0xd672('0x88')]());return dbH[_0xd672('0x89')]['query'](_0x3b76b2[_0xd672('0x88')](),{'type':dbH['sequelize'][_0xd672('0x8a')]['SELECT']});}})[_0xd672('0x26')](respondWithResult(_0x543b2b,null))[_0xd672('0x46')](handleError(_0x543b2b,null));};function runReport(_0x3c380b,_0xc56793,_0x542049){var _0xa747ea=_0xc56793[_0xd672('0x2b')];var _0x3671ce=0xa;var _0x353bce=[_0xd672('0x56'),'left_join',_0xd672('0x8b'),_0xd672('0x58')];var _0x72d48f={'SUM':_0xd672('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd672('0x5b'),'MAX':_0xd672('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd672('0x5f'),'GROUP_CONCAT ASC':_0xd672('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xfc714={'SEC_TO_TIME':_0xd672('0x62'),'DATE':_0xd672('0x8c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x387434=function(_0x49bfd3){return!_['includes']([_0xd672('0x67'),'IS\x20NOT\x20NULL',_0xd672('0x69'),'IS\x20NOT\x20EMPTY'],_0x49bfd3);};var _0x58c8ed=function(_0xa36803){if(!_0xa36803||!_0xa36803[_0xd672('0x6a')][_0xd672('0x39')]){return'';}for(var _0x5c5a55='(',_0x1ba997=0x0;_0x1ba997<_0xa36803[_0xd672('0x6a')][_0xd672('0x39')];_0x1ba997+=0x1){_0x1ba997>0x0&&(_0x5c5a55+='\x20'+_0xa36803[_0xd672('0x6b')]+'\x20');_0x5c5a55+=_0xa36803[_0xd672('0x6a')][_0x1ba997][_0xd672('0x6c')]?_0x58c8ed(_0xa36803[_0xd672('0x6a')][_0x1ba997]['group']):_0xa36803['rules'][_0x1ba997][_0xd672('0x6d')]+'\x20'+_0xa36803[_0xd672('0x6a')][_0x1ba997][_0xd672('0x6e')]+(_0x387434(_0xa36803['rules'][_0x1ba997]['condition'])?'\x20'+_0xa36803[_0xd672('0x6a')][_0x1ba997][_0xd672('0x6f')]:'');}return _0x5c5a55+')';};var _0x51f019={'where':{'id':_0x3c380b['id']}},_0x4f26bb,_0x67ee3a,_0x15e111,_0x119460,_0x1e95e8;_0x51f019=_[_0xd672('0x41')]({},_0x51f019,_0x542049);return db[_0xd672('0x2f')][_0xd672('0x4c')](_0x51f019)[_0xd672('0x26')](function(_0x282e8a){if(_0x282e8a){_0x4f26bb=_0x282e8a;return _0x282e8a[_0xd672('0x70')]();}return null;})[_0xd672('0x26')](function(_0xb63cb9){if(_0xb63cb9){if(!_0xb63cb9[_0xd672('0x39')]){throw new db[(_0xd672('0x71'))][(_0xd672('0x72'))](_0xd672('0x73'),0x193);}_0x67ee3a=_0xb63cb9;return db[_0xd672('0x8d')][_0xd672('0x44')]({'raw':!![]});}return null;})[_0xd672('0x26')](function(_0xf40871){if(_0xf40871){_0x15e111=_[_0xd672('0x74')](_0xf40871,'id');var _0x1f9550;var _0x58d0a0=squel[_0xd672('0x75')]();_0x58d0a0[_0xd672('0x76')](_0x4f26bb['table']);for(var _0x20bedc=0x0;_0x20bedc<_0x67ee3a[_0xd672('0x39')];_0x20bedc+=0x1){_0x1f9550=_0x67ee3a[_0x20bedc][_0xd672('0x77')]?_0x15e111[_0x67ee3a[_0x20bedc][_0xd672('0x77')]]['metric']:_0x67ee3a[_0x20bedc][_0xd672('0x6d')];_0x1f9550=_0x67ee3a[_0x20bedc]['function']?_[_0xd672('0x7a')](_0x72d48f[_0x67ee3a[_0x20bedc][_0xd672('0x79')]],'%s',_0x1f9550):_0x1f9550;_0x1f9550=_0x67ee3a[_0x20bedc][_0xd672('0x7b')]?_[_0xd672('0x7a')](_0xfc714[_0x67ee3a[_0x20bedc]['format']],'%s',_0x1f9550):_0x1f9550;if(_0x67ee3a[_0x20bedc][_0xd672('0x7c')]){_0x58d0a0[_0xd672('0x6c')](_0x1f9550);}_0x67ee3a[_0x20bedc][_0xd672('0x7d')]&&_0x58d0a0[_0xd672('0x3d')](_0x1f9550,_0x67ee3a[_0x20bedc][_0xd672('0x7d')]===_0xd672('0x7e')?![]:!![]);_0x58d0a0['field'](_0x1f9550,_0x67ee3a[_0x20bedc][_0xd672('0x8e')]||_0x1f9550);}if(_0x4f26bb[_0xd672('0x7f')]){_0x4f26bb[_0xd672('0x7f')]=JSON[_0xd672('0x80')](_0x4f26bb[_0xd672('0x7f')]);for(var _0xd6db57=0x0;_0xd6db57<_0x4f26bb['joins']['length'];_0xd6db57+=0x1){if(_0x4f26bb['joins'][_0xd6db57][_0xd672('0x42')]&&_[_0xd672('0x66')](_0x353bce,_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x42')])&&_0x4f26bb['joins'][_0xd6db57][_0xd672('0x81')]&&_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x82')]&&_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x84')]){_0x58d0a0[_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x42')]](_0x4f26bb['joins'][_0xd6db57][_0xd672('0x82')],null,util[_0xd672('0x7b')](_0xd672('0x8f'),_0x4f26bb[_0xd672('0x83')],_0x4f26bb[_0xd672('0x7f')][_0xd6db57]['parentKey'],_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x82')],_0x4f26bb[_0xd672('0x7f')][_0xd6db57][_0xd672('0x84')]));}}}if(_0x4f26bb['conditions']){_0x4f26bb[_0xd672('0x85')]=JSON[_0xd672('0x80')](_0x4f26bb[_0xd672('0x85')]);_0x58d0a0['where'](_0x58c8ed(_0x4f26bb[_0xd672('0x85')][_0xd672('0x6c')]));}_0x1e95e8=_0x58d0a0['clone']();_0x58d0a0[_0xd672('0x3c')](_0x3671ce);_0x58d0a0[_0xd672('0x1e')](0x0);return;}})[_0xd672('0x26')](function(){if(_0xc56793[_0xd672('0x90')]===_0xd672('0x91')){return null;}var _0x142a17=_[_0xd672('0x41')](_0xc56793,{'name':_0xc56793[_0xd672('0x92')]||_0xc56793[_0xd672('0x2b')]||_0x4f26bb[_0xd672('0x2b')],'basename':_0xa747ea,'savename':util['format'](_0xd672('0x93'),_0xc56793[_0xd672('0x2b')]||_0x4f26bb['name'],require(_0xd672('0x94'))[_0xd672('0x95')](0x4),_0xc56793[_0xd672('0x90')]||_0xd672('0x96')),'reportId':_0x4f26bb['id'],'reportType':_0xd672('0x97')});return db[_0xd672('0x98')][_0xd672('0x4d')](_0x142a17,{'raw':!![]});})[_0xd672('0x26')](function(_0x57dfac){if(_0x4f26bb[_0xd672('0x83')]===_0xd672('0x99')){_0x1e95e8[_0xd672('0x40')](_0x4f26bb[_0xd672('0x83')]+_0xd672('0x9a'),_0xc56793[_0xd672('0x9b')],_0xc56793[_0xd672('0x9c')]);}else{_0x1e95e8[_0xd672('0x40')](_0x4f26bb[_0xd672('0x83')]+_0xd672('0x9d'),_0xc56793[_0xd672('0x9b')],_0xc56793[_0xd672('0x9c')]);}if(_0x57dfac){logger[_0xd672('0x9e')](_0xd672('0x9f'),_0x1e95e8[_0xd672('0x88')]());require(_0xd672('0xa0'))[_0xd672('0xa1')](path[_0xd672('0x56')](__dirname,'../../components/export/',_0x57dfac[_0xd672('0x90')]),[_0x57dfac['id'],_0x1e95e8[_0xd672('0x88')](),path['join'](__dirname,_0xd672('0xa2'),_0x57dfac[_0xd672('0xa3')]),_0xa747ea]);return _0x57dfac;}else{var _0x1f7115=squel['select']();_0x1f7115[_0xd672('0x76')]('('+_0x1e95e8['toString']()+')',_0xd672('0xa4'));_0x1f7115[_0xd672('0x6d')](_0xd672('0xa5'),_0xd672('0x20'));_0x1e95e8[_0xd672('0x3c')](_0xc56793[_0xd672('0x3c')]||_0x3671ce);_0x1e95e8[_0xd672('0x1e')](_0xc56793[_0xd672('0x1e')]||0x0);return dbH['sequelize'][_0xd672('0x32')](_0x1f7115[_0xd672('0x88')](),{'type':dbH[_0xd672('0x89')][_0xd672('0x8a')][_0xd672('0xa6')]})[_0xd672('0x26')](function(_0x188668){if(!_0x188668[_0xd672('0x39')]){_0x119460=0x0;}else{_0x119460=_0x188668[0x0]['count']||0x0;}return dbH[_0xd672('0x89')][_0xd672('0x32')](_0x1e95e8[_0xd672('0x88')](),{'type':dbH[_0xd672('0x89')][_0xd672('0x8a')][_0xd672('0xa6')]});})[_0xd672('0x26')](function(_0x19f219){return{'rows':_0x19f219||[],'count':_0x119460};});}});}exports['run']=function(_0x596792,_0x5ad502){return runReport(_0x596792['params'],_0x596792[_0xd672('0x32')],_0x596792[_0xd672('0x4b')])[_0xd672('0x26')](respondWithResult(_0x5ad502,null))[_0xd672('0x46')](handleError(_0x5ad502,null));};exports[_0xd672('0xa7')]=runReport;exports[_0xd672('0x32')]=function(_0x28a67c,_0x3f9029){var _0x4a0148=0xa;var _0x4f5066=['join',_0xd672('0x57'),_0xd672('0x8b'),_0xd672('0x58')];var _0x20290b={'SUM':_0xd672('0x59'),'COUNT':_0xd672('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd672('0x5c'),'MIN':_0xd672('0x5d'),'AVG':_0xd672('0x5e'),'GROUP_CONCAT':_0xd672('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd672('0x61')};var _0x379375={'SEC_TO_TIME':_0xd672('0x62'),'DATE':_0xd672('0x8c'),'HOUR':_0xd672('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd672('0x65')};var _0x2aae63=function(_0xaa0742){return!_[_0xd672('0x66')]([_0xd672('0x67'),'IS\x20NOT\x20NULL',_0xd672('0x69'),'IS\x20NOT\x20EMPTY'],_0xaa0742);};var _0x75c62e=function(_0x3103b2){if(!_0x3103b2||!_0x3103b2['rules'][_0xd672('0x39')]){return'';}for(var _0x525f2c='(',_0x468df8=0x0;_0x468df8<_0x3103b2[_0xd672('0x6a')][_0xd672('0x39')];_0x468df8+=0x1){_0x468df8>0x0&&(_0x525f2c+='\x20'+_0x3103b2[_0xd672('0x6b')]+'\x20');_0x525f2c+=_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6c')]?_0x75c62e(_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6c')]):_0x3103b2['rules'][_0x468df8][_0xd672('0x6d')]+'\x20'+_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6e')]+(_0x2aae63(_0x3103b2[_0xd672('0x6a')][_0x468df8][_0xd672('0x6e')])?'\x20'+_0x3103b2[_0xd672('0x6a')][_0x468df8]['value']:'');}return _0x525f2c+')';};var _0x4e7aa8={'where':{'id':_0x28a67c[_0xd672('0x48')]['id']}},_0x828afc,_0x35ecae,_0x251dd9,_0x304c2b,_0x54db84;_0x4e7aa8=_[_0xd672('0x41')]({},_0x4e7aa8,_0x28a67c[_0xd672('0x4b')]);return db[_0xd672('0x2f')]['find'](_0x4e7aa8)[_0xd672('0x26')](function(_0x8c8e00){if(_0x8c8e00){_0x828afc=_0x8c8e00;return _0x8c8e00['getFields']();}return null;})[_0xd672('0x26')](function(_0x4abc86){if(_0x4abc86){if(!_0x4abc86[_0xd672('0x39')]){throw new db[(_0xd672('0x71'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35ecae=_0x4abc86;return db[_0xd672('0x8d')]['findAll']({'raw':!![]});}return null;})[_0xd672('0x26')](function(_0x177d35){if(_0x177d35){_0x251dd9=_[_0xd672('0x74')](_0x177d35,'id');var _0x55ecb4;var _0x3fbe67=squel[_0xd672('0x75')]();_0x3fbe67['from'](_0x828afc[_0xd672('0x83')]);for(var _0x588855=0x0;_0x588855<_0x35ecae['length'];_0x588855+=0x1){_0x55ecb4=_0x35ecae[_0x588855][_0xd672('0x77')]?_0x251dd9[_0x35ecae[_0x588855][_0xd672('0x77')]][_0xd672('0x78')]:_0x35ecae[_0x588855][_0xd672('0x6d')];_0x55ecb4=_0x35ecae[_0x588855][_0xd672('0x79')]?_[_0xd672('0x7a')](_0x20290b[_0x35ecae[_0x588855][_0xd672('0x79')]],'%s',_0x55ecb4):_0x55ecb4;_0x55ecb4=_0x35ecae[_0x588855][_0xd672('0x7b')]?_[_0xd672('0x7a')](_0x379375[_0x35ecae[_0x588855][_0xd672('0x7b')]],'%s',_0x55ecb4):_0x55ecb4;if(_0x35ecae[_0x588855][_0xd672('0x7c')]){_0x3fbe67[_0xd672('0x6c')](_0x55ecb4);}_0x35ecae[_0x588855][_0xd672('0x7d')]&&_0x3fbe67[_0xd672('0x3d')](_0x55ecb4,_0x35ecae[_0x588855][_0xd672('0x7d')]==='DESC'?![]:!![]);_0x3fbe67[_0xd672('0x6d')](_0x55ecb4,_0x35ecae[_0x588855]['alias']||_0x55ecb4);}if(_0x828afc['joins']){_0x828afc['joins']=JSON[_0xd672('0x80')](_0x828afc['joins']);for(var _0x3e24ef=0x0;_0x3e24ef<_0x828afc[_0xd672('0x7f')]['length'];_0x3e24ef+=0x1){if(_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x42')]&&_[_0xd672('0x66')](_0x4f5066,_0x828afc[_0xd672('0x7f')][_0x3e24ef]['type'])&&_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x81')]&&_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x82')]&&_0x828afc['joins'][_0x3e24ef][_0xd672('0x84')]){_0x3fbe67[_0x828afc[_0xd672('0x7f')][_0x3e24ef]['type']](_0x828afc[_0xd672('0x7f')][_0x3e24ef]['foreignTable'],null,util[_0xd672('0x7b')](_0xd672('0x8f'),_0x828afc['table'],_0x828afc['joins'][_0x3e24ef]['parentKey'],_0x828afc[_0xd672('0x7f')][_0x3e24ef][_0xd672('0x82')],_0x828afc[_0xd672('0x7f')][_0x3e24ef]['foreignKey']));}}}if(_0x828afc['conditions']){_0x828afc[_0xd672('0x85')]=JSON['parse'](_0x828afc['conditions']);_0x3fbe67[_0xd672('0x40')](_0x75c62e(_0x828afc['conditions'][_0xd672('0x6c')]));}_0x54db84=_0x3fbe67['clone']();_0x3fbe67['limit'](_0x4a0148);_0x3fbe67[_0xd672('0x1e')](0x0);logger[_0xd672('0x86')](_0xd672('0x87'),_0x3fbe67['toString']());return dbH[_0xd672('0x89')]['query'](_0x3fbe67[_0xd672('0x88')](),{'type':dbH['sequelize']['QueryTypes'][_0xd672('0xa6')]});}})[_0xd672('0x26')](function(){return{'sql':_0x54db84[_0xd672('0x88')]()};})[_0xd672('0x26')](respondWithResult(_0x3f9029,null))[_0xd672('0x46')](handleError(_0x3f9029,null));}; \ No newline at end of file +var _0xe5e6=['group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','MetricId','metric','function','groupBy','orderBy','order','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20EMPTY','operator','getFields','AnalyticMetric','select','replace','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','QueryTypes','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','Sequelize','DESC','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','destroy','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','intersection','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules'];(function(_0x1f744b,_0x53213b){var _0x15ef46=function(_0x192264){while(--_0x192264){_0x1f744b['push'](_0x1f744b['shift']());}};_0x15ef46(++_0x53213b);}(_0xe5e6,0x193));var _0x6e5e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe5e6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x6e5e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e5e('0x1'));var jsonpatch=require(_0x6e5e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6e5e('0x3'));var Mustache=require(_0x6e5e('0x4'));var util=require(_0x6e5e('0x5'));var path=require(_0x6e5e('0x6'));var sox=require(_0x6e5e('0x7'));var csv=require(_0x6e5e('0x8'));var ejs=require(_0x6e5e('0x9'));var fs=require('fs');var fs_extra=require(_0x6e5e('0xa'));var _=require(_0x6e5e('0xb'));var squel=require(_0x6e5e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6e5e('0xd'));var toCsv=require(_0x6e5e('0x8'));var querystring=require('querystring');var Papa=require(_0x6e5e('0xe'));var Redis=require(_0x6e5e('0xf'));var authService=require(_0x6e5e('0x10'));var qs=require(_0x6e5e('0x11'));var as=require(_0x6e5e('0x12'));var hardwareService=require(_0x6e5e('0x13'));var logger=require(_0x6e5e('0x14'))(_0x6e5e('0x15'));var utils=require(_0x6e5e('0x16'));var config=require(_0x6e5e('0x17'));var licenseUtil=require(_0x6e5e('0x18'));var db=require(_0x6e5e('0x19'))['db'];var dbH=require(_0x6e5e('0x19'))[_0x6e5e('0x1a')];function respondWithStatusCode(_0x51122c,_0x1f3b47){_0x1f3b47=_0x1f3b47||0xcc;return function(_0x5638ec){if(_0x5638ec){return _0x51122c[_0x6e5e('0x1b')](_0x1f3b47);}return _0x51122c[_0x6e5e('0x1c')](_0x1f3b47)[_0x6e5e('0x1d')]();};}function respondWithResult(_0x52a45d,_0x2859ca){_0x2859ca=_0x2859ca||0xc8;return function(_0x230c3f){if(_0x230c3f){return _0x52a45d[_0x6e5e('0x1c')](_0x2859ca)[_0x6e5e('0x1e')](_0x230c3f);}};}function respondWithFilteredResult(_0x43fdab,_0x23087e){return function(_0x12358e){if(_0x12358e){var _0x5a800a=typeof _0x23087e[_0x6e5e('0x1f')]===_0x6e5e('0x20')&&typeof _0x23087e[_0x6e5e('0x21')]===_0x6e5e('0x20');var _0x516830=_0x12358e[_0x6e5e('0x22')];var _0x2ec6c5=_0x5a800a?0x0:_0x23087e['offset'];var _0x35bddb=_0x5a800a?_0x12358e['count']:_0x23087e[_0x6e5e('0x1f')]+_0x23087e[_0x6e5e('0x21')];var _0x5e5b54;if(_0x35bddb>=_0x516830){_0x35bddb=_0x516830;_0x5e5b54=0xc8;}else{_0x5e5b54=0xce;}_0x43fdab[_0x6e5e('0x1c')](_0x5e5b54);return _0x43fdab[_0x6e5e('0x23')]('Content-Range',_0x2ec6c5+'-'+_0x35bddb+'/'+_0x516830)[_0x6e5e('0x1e')](_0x12358e);}return null;};}function patchUpdates(_0x25686d){return function(_0x1799bd){try{jsonpatch[_0x6e5e('0x24')](_0x1799bd,_0x25686d,!![]);}catch(_0x348c10){return BPromise[_0x6e5e('0x25')](_0x348c10);}return _0x1799bd[_0x6e5e('0x26')]();};}function saveUpdates(_0x529169,_0x2d6b4f){return function(_0x10882e){if(_0x10882e){return _0x10882e[_0x6e5e('0x27')](_0x529169)[_0x6e5e('0x28')](function(_0x12bcaf){return _0x12bcaf;});}return null;};}function removeEntity(_0xa4e71d,_0x523a4d){return function(_0x4a3cd7){if(_0x4a3cd7){return _0x4a3cd7['destroy']()[_0x6e5e('0x28')](function(){var _0x1c9af0=_0x4a3cd7[_0x6e5e('0x29')]({'plain':!![]});var _0x55a2b5='CustomReports';return db['UserProfileResource'][_0x6e5e('0x2a')]({'where':{'type':_0x55a2b5,'resourceId':_0x1c9af0['id']}})[_0x6e5e('0x28')](function(){return _0x4a3cd7;});})[_0x6e5e('0x28')](function(){_0xa4e71d[_0x6e5e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d68a2,_0x475ed2){return function(_0x548dac){if(!_0x548dac){_0x5d68a2[_0x6e5e('0x1b')](0x194);}return _0x548dac;};}function handleError(_0x1e2a0b,_0x45e38b){_0x45e38b=_0x45e38b||0x1f4;return function(_0x16d21e){logger[_0x6e5e('0x2b')](_0x16d21e['stack']);if(_0x16d21e[_0x6e5e('0x2c')]){delete _0x16d21e[_0x6e5e('0x2c')];}_0x1e2a0b[_0x6e5e('0x1c')](_0x45e38b)['send'](_0x16d21e);};}exports['index']=function(_0x1c0a4e,_0x188d92){var _0x43ad39={},_0x1fa1a4={},_0x1958cc={'count':0x0,'rows':[]};var _0x4adac2=_[_0x6e5e('0x2d')](db[_0x6e5e('0x2e')][_0x6e5e('0x2f')],function(_0x1dd609){return{'name':_0x1dd609[_0x6e5e('0x30')],'type':_0x1dd609[_0x6e5e('0x31')][_0x6e5e('0x32')]};});_0x1fa1a4['model']=_[_0x6e5e('0x2d')](_0x4adac2,_0x6e5e('0x2c'));_0x1fa1a4[_0x6e5e('0x33')]=_[_0x6e5e('0x34')](_0x1c0a4e[_0x6e5e('0x33')]);_0x1fa1a4['filters']=_['intersection'](_0x1fa1a4[_0x6e5e('0x35')],_0x1fa1a4['query']);_0x43ad39[_0x6e5e('0x36')]=_['intersection'](_0x1fa1a4[_0x6e5e('0x35')],qs[_0x6e5e('0x37')](_0x1c0a4e[_0x6e5e('0x33')][_0x6e5e('0x37')]));_0x43ad39[_0x6e5e('0x36')]=_0x43ad39[_0x6e5e('0x36')][_0x6e5e('0x38')]?_0x43ad39[_0x6e5e('0x36')]:_0x1fa1a4[_0x6e5e('0x35')];if(!_0x1c0a4e[_0x6e5e('0x33')][_0x6e5e('0x39')](_0x6e5e('0x3a'))){_0x43ad39['limit']=qs[_0x6e5e('0x21')](_0x1c0a4e[_0x6e5e('0x33')][_0x6e5e('0x21')]);_0x43ad39[_0x6e5e('0x1f')]=qs[_0x6e5e('0x1f')](_0x1c0a4e[_0x6e5e('0x33')][_0x6e5e('0x1f')]);}_0x43ad39['order']=qs[_0x6e5e('0x3b')](_0x1c0a4e['query'][_0x6e5e('0x3b')]);_0x43ad39[_0x6e5e('0x3c')]=qs[_0x6e5e('0x3d')](_[_0x6e5e('0x3e')](_0x1c0a4e['query'],_0x1fa1a4[_0x6e5e('0x3d')]),_0x4adac2);if(_0x1c0a4e['query']['filter']){_0x43ad39[_0x6e5e('0x3c')]=_[_0x6e5e('0x3f')](_0x43ad39[_0x6e5e('0x3c')],{'$or':_['map'](_0x4adac2,function(_0x5d6922){if(_0x5d6922['type']!==_0x6e5e('0x40')){var _0x245b6b={};_0x245b6b[_0x5d6922[_0x6e5e('0x2c')]]={'$like':'%'+_0x1c0a4e['query'][_0x6e5e('0x41')]+'%'};return _0x245b6b;}})});}_0x43ad39=_[_0x6e5e('0x3f')]({},_0x43ad39,_0x1c0a4e[_0x6e5e('0x42')]);var _0x4b44ab={'where':_0x43ad39[_0x6e5e('0x3c')]};return db[_0x6e5e('0x2e')][_0x6e5e('0x22')](_0x4b44ab)[_0x6e5e('0x28')](function(_0x1cfc3b){_0x1958cc[_0x6e5e('0x22')]=_0x1cfc3b;if(_0x1c0a4e['query'][_0x6e5e('0x43')]){_0x43ad39['include']=[{'all':!![]}];}return db[_0x6e5e('0x2e')]['findAll'](_0x43ad39);})[_0x6e5e('0x28')](function(_0x448e90){_0x1958cc[_0x6e5e('0x44')]=_0x448e90;return _0x1958cc;})['then'](respondWithFilteredResult(_0x188d92,_0x43ad39))[_0x6e5e('0x45')](handleError(_0x188d92,null));};exports[_0x6e5e('0x46')]=function(_0x304cd3,_0x556471){var _0x53428d={'raw':![],'where':{'id':_0x304cd3[_0x6e5e('0x47')]['id']}},_0x3cc245={};_0x3cc245['model']=_[_0x6e5e('0x34')](db[_0x6e5e('0x2e')][_0x6e5e('0x2f')]);_0x3cc245[_0x6e5e('0x33')]=_[_0x6e5e('0x34')](_0x304cd3[_0x6e5e('0x33')]);_0x3cc245[_0x6e5e('0x3d')]=_[_0x6e5e('0x48')](_0x3cc245[_0x6e5e('0x35')],_0x3cc245[_0x6e5e('0x33')]);_0x53428d[_0x6e5e('0x36')]=_['intersection'](_0x3cc245['model'],qs[_0x6e5e('0x37')](_0x304cd3[_0x6e5e('0x33')]['fields']));_0x53428d[_0x6e5e('0x36')]=_0x53428d[_0x6e5e('0x36')][_0x6e5e('0x38')]?_0x53428d[_0x6e5e('0x36')]:_0x3cc245[_0x6e5e('0x35')];if(_0x304cd3[_0x6e5e('0x33')][_0x6e5e('0x43')]){_0x53428d[_0x6e5e('0x49')]=[{'all':!![]}];}_0x53428d=_[_0x6e5e('0x3f')]({},_0x53428d,_0x304cd3[_0x6e5e('0x42')]);return db['AnalyticCustomReport'][_0x6e5e('0x4a')](_0x53428d)['then'](handleEntityNotFound(_0x556471,null))[_0x6e5e('0x28')](respondWithResult(_0x556471,null))[_0x6e5e('0x45')](handleError(_0x556471,null));};exports[_0x6e5e('0x4b')]=function(_0x3cd123,_0x1ab447){return db[_0x6e5e('0x2e')][_0x6e5e('0x4b')](_0x3cd123['body'],{})[_0x6e5e('0x28')](function(_0x15d4fb){var _0x5326ea=_0x3cd123['user'][_0x6e5e('0x29')]({'plain':!![]});if(!_0x5326ea)throw new Error(_0x6e5e('0x4c'));if(_0x5326ea[_0x6e5e('0x4d')]===_0x6e5e('0x4e')){var _0x5968b1=_0x15d4fb[_0x6e5e('0x29')]({'plain':!![]});var _0x625833='Reports';return db['UserProfileSection'][_0x6e5e('0x4a')]({'where':{'name':_0x625833,'userProfileId':_0x5326ea[_0x6e5e('0x4f')]},'raw':!![]})[_0x6e5e('0x28')](function(_0x1af8ce){if(_0x1af8ce&&_0x1af8ce['autoAssociation']===0x0){return db[_0x6e5e('0x50')]['create']({'name':_0x5968b1['name'],'resourceId':_0x5968b1['id'],'type':_0x6e5e('0x51'),'sectionId':_0x1af8ce['id']},{})[_0x6e5e('0x28')](function(){return _0x15d4fb;});}else{return _0x15d4fb;}})[_0x6e5e('0x45')](function(_0xd30342){logger[_0x6e5e('0x2b')](_0x6e5e('0x52'),_0xd30342);throw _0xd30342;});}return _0x15d4fb;})['then'](respondWithResult(_0x1ab447,0xc9))['catch'](handleError(_0x1ab447,null));};exports[_0x6e5e('0x27')]=function(_0x595d75,_0x2b3718){if(_0x595d75['body']['id']){delete _0x595d75[_0x6e5e('0x53')]['id'];}return db[_0x6e5e('0x2e')]['find']({'where':{'id':_0x595d75[_0x6e5e('0x47')]['id']}})[_0x6e5e('0x28')](handleEntityNotFound(_0x2b3718,null))['then'](saveUpdates(_0x595d75[_0x6e5e('0x53')],null))['then'](respondWithResult(_0x2b3718,null))['catch'](handleError(_0x2b3718,null));};exports[_0x6e5e('0x2a')]=function(_0x2812ca,_0x3a93d2){return db['AnalyticCustomReport'][_0x6e5e('0x4a')]({'where':{'id':_0x2812ca[_0x6e5e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a93d2,null))[_0x6e5e('0x28')](removeEntity(_0x3a93d2,null))[_0x6e5e('0x45')](handleError(_0x3a93d2,null));};exports[_0x6e5e('0x54')]=function(_0x1992c8,_0x22eb62){var _0x204dc5=0xa;var _0x5179bf=[_0x6e5e('0x55'),_0x6e5e('0x56'),_0x6e5e('0x57'),_0x6e5e('0x58')];var _0x4d8f54={'SUM':_0x6e5e('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6e5e('0x5a'),'MAX':_0x6e5e('0x5b'),'MIN':_0x6e5e('0x5c'),'AVG':_0x6e5e('0x5d'),'GROUP_CONCAT':_0x6e5e('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x24c4aa={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x6e5e('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6e5e('0x60')};var _0x2f2563=function(_0x2000e9){return!_[_0x6e5e('0x61')]([_0x6e5e('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x6e5e('0x63')],_0x2000e9);};var _0x574c9d=function(_0x2fe387){if(!_0x2fe387||!_0x2fe387[_0x6e5e('0x64')][_0x6e5e('0x38')]){return'';}for(var _0x240e0f='(',_0x55314b=0x0;_0x55314b<_0x2fe387['rules'][_0x6e5e('0x38')];_0x55314b+=0x1){_0x55314b>0x0&&(_0x240e0f+='\x20'+_0x2fe387['operator']+'\x20');_0x240e0f+=_0x2fe387['rules'][_0x55314b]['group']?_0x574c9d(_0x2fe387[_0x6e5e('0x64')][_0x55314b][_0x6e5e('0x65')]):_0x2fe387[_0x6e5e('0x64')][_0x55314b][_0x6e5e('0x66')]+'\x20'+_0x2fe387[_0x6e5e('0x64')][_0x55314b][_0x6e5e('0x67')]+(_0x2f2563(_0x2fe387['rules'][_0x55314b][_0x6e5e('0x67')])?'\x20'+_0x2fe387[_0x6e5e('0x64')][_0x55314b][_0x6e5e('0x68')]:'');}return _0x240e0f+')';};var _0x3dd197={'where':{'id':_0x1992c8[_0x6e5e('0x47')]['id']}},_0x34c463,_0x4e53d3,_0x245e4e,_0x51a482,_0x3736f0;_0x3dd197=_[_0x6e5e('0x3f')]({},_0x3dd197,_0x1992c8[_0x6e5e('0x42')]);return db[_0x6e5e('0x2e')][_0x6e5e('0x4a')](_0x3dd197)[_0x6e5e('0x28')](function(_0x2809c2){if(_0x2809c2){_0x34c463=_0x2809c2;return _0x2809c2['getFields']();}return null;})[_0x6e5e('0x28')](function(_0x1171a1){if(_0x1171a1){if(!_0x1171a1[_0x6e5e('0x38')]){throw new db['Sequelize'][(_0x6e5e('0x69'))](_0x6e5e('0x6a'),0x193);}_0x4e53d3=_0x1171a1;return db['AnalyticMetric'][_0x6e5e('0x6b')]({'raw':!![]});}return null;})[_0x6e5e('0x28')](function(_0x48d2a3){if(_0x48d2a3){_0x245e4e=_[_0x6e5e('0x6c')](_0x48d2a3,'id');var _0x40ce72;var _0x3ba62b=squel['select']();_0x3ba62b['from'](_0x34c463['table']);for(var _0x22b49b=0x0;_0x22b49b<_0x4e53d3[_0x6e5e('0x38')];_0x22b49b+=0x1){_0x40ce72=_0x4e53d3[_0x22b49b][_0x6e5e('0x6d')]?_0x245e4e[_0x4e53d3[_0x22b49b][_0x6e5e('0x6d')]][_0x6e5e('0x6e')]:_0x4e53d3[_0x22b49b][_0x6e5e('0x66')];_0x40ce72=_0x4e53d3[_0x22b49b][_0x6e5e('0x6f')]?_['replace'](_0x4d8f54[_0x4e53d3[_0x22b49b][_0x6e5e('0x6f')]],'%s',_0x40ce72):_0x40ce72;_0x40ce72=_0x4e53d3[_0x22b49b]['format']?_['replace'](_0x24c4aa[_0x4e53d3[_0x22b49b]['format']],'%s',_0x40ce72):_0x40ce72;if(_0x4e53d3[_0x22b49b][_0x6e5e('0x70')]){_0x3ba62b[_0x6e5e('0x65')](_0x40ce72);}_0x4e53d3[_0x22b49b][_0x6e5e('0x71')]&&_0x3ba62b[_0x6e5e('0x72')](_0x40ce72,_0x4e53d3[_0x22b49b][_0x6e5e('0x71')]==='DESC'?![]:!![]);_0x3ba62b[_0x6e5e('0x66')](_0x40ce72,_0x4e53d3[_0x22b49b][_0x6e5e('0x73')]||_0x40ce72);}if(_0x34c463['joins']){_0x34c463[_0x6e5e('0x74')]=JSON[_0x6e5e('0x75')](_0x34c463['joins']);for(var _0x45d74f=0x0;_0x45d74f<_0x34c463[_0x6e5e('0x74')][_0x6e5e('0x38')];_0x45d74f+=0x1){if(_0x34c463['joins'][_0x45d74f]['type']&&_['includes'](_0x5179bf,_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x31')])&&_0x34c463['joins'][_0x45d74f][_0x6e5e('0x76')]&&_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x77')]&&_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x78')]){_0x3ba62b[_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x31')]](_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x77')],null,util[_0x6e5e('0x79')](_0x6e5e('0x7a'),_0x34c463[_0x6e5e('0x7b')],_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x76')],_0x34c463[_0x6e5e('0x74')][_0x45d74f]['foreignTable'],_0x34c463[_0x6e5e('0x74')][_0x45d74f][_0x6e5e('0x78')]));}}}if(_0x34c463['conditions']){_0x34c463[_0x6e5e('0x7c')]=JSON[_0x6e5e('0x75')](_0x34c463[_0x6e5e('0x7c')]);_0x3ba62b[_0x6e5e('0x3c')](_0x574c9d(_0x34c463['conditions'][_0x6e5e('0x65')]));}_0x3736f0=_0x3ba62b[_0x6e5e('0x7d')]();_0x3ba62b['limit'](_0x204dc5);_0x3ba62b[_0x6e5e('0x1f')](0x0);logger[_0x6e5e('0x7e')](_0x6e5e('0x7f'),_0x3ba62b[_0x6e5e('0x80')]());return dbH[_0x6e5e('0x81')][_0x6e5e('0x33')](_0x3ba62b[_0x6e5e('0x80')](),{'type':dbH[_0x6e5e('0x81')]['QueryTypes'][_0x6e5e('0x82')]});}})['then'](respondWithResult(_0x22eb62,null))[_0x6e5e('0x45')](handleError(_0x22eb62,null));};function runReport(_0x40082a,_0x21acb3,_0x112cbd){var _0x329e89=_0x21acb3[_0x6e5e('0x2c')];var _0x1bf785=0xa;var _0x57adb5=['join',_0x6e5e('0x56'),'right_join',_0x6e5e('0x58')];var _0x548b8b={'SUM':_0x6e5e('0x59'),'COUNT':_0x6e5e('0x83'),'COUNT DISTINCT':_0x6e5e('0x5a'),'MAX':_0x6e5e('0x5b'),'MIN':_0x6e5e('0x5c'),'AVG':_0x6e5e('0x5d'),'GROUP_CONCAT':_0x6e5e('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4474ba={'SEC_TO_TIME':_0x6e5e('0x84'),'DATE':_0x6e5e('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x6e5e('0x86'),'UNIX_TIMESTAMP':_0x6e5e('0x60')};var _0x4f0e23=function(_0x310669){return!_[_0x6e5e('0x61')]([_0x6e5e('0x62'),'IS\x20NOT\x20NULL',_0x6e5e('0x87'),_0x6e5e('0x63')],_0x310669);};var _0x1575b7=function(_0x151385){if(!_0x151385||!_0x151385[_0x6e5e('0x64')][_0x6e5e('0x38')]){return'';}for(var _0x5aaeb1='(',_0xea92c1=0x0;_0xea92c1<_0x151385[_0x6e5e('0x64')][_0x6e5e('0x38')];_0xea92c1+=0x1){_0xea92c1>0x0&&(_0x5aaeb1+='\x20'+_0x151385[_0x6e5e('0x88')]+'\x20');_0x5aaeb1+=_0x151385[_0x6e5e('0x64')][_0xea92c1][_0x6e5e('0x65')]?_0x1575b7(_0x151385[_0x6e5e('0x64')][_0xea92c1][_0x6e5e('0x65')]):_0x151385[_0x6e5e('0x64')][_0xea92c1][_0x6e5e('0x66')]+'\x20'+_0x151385[_0x6e5e('0x64')][_0xea92c1][_0x6e5e('0x67')]+(_0x4f0e23(_0x151385['rules'][_0xea92c1][_0x6e5e('0x67')])?'\x20'+_0x151385[_0x6e5e('0x64')][_0xea92c1]['value']:'');}return _0x5aaeb1+')';};var _0x467b24={'where':{'id':_0x40082a['id']}},_0x76e796,_0x400a2a,_0x335410,_0x12e15b,_0x2548f;_0x467b24=_[_0x6e5e('0x3f')]({},_0x467b24,_0x112cbd);return db[_0x6e5e('0x2e')][_0x6e5e('0x4a')](_0x467b24)[_0x6e5e('0x28')](function(_0x259a5c){if(_0x259a5c){_0x76e796=_0x259a5c;return _0x259a5c[_0x6e5e('0x89')]();}return null;})[_0x6e5e('0x28')](function(_0x543d34){if(_0x543d34){if(!_0x543d34[_0x6e5e('0x38')]){throw new db['Sequelize'][(_0x6e5e('0x69'))](_0x6e5e('0x6a'),0x193);}_0x400a2a=_0x543d34;return db[_0x6e5e('0x8a')][_0x6e5e('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x3f4023){if(_0x3f4023){_0x335410=_[_0x6e5e('0x6c')](_0x3f4023,'id');var _0x1fa7e0;var _0x18790e=squel[_0x6e5e('0x8b')]();_0x18790e['from'](_0x76e796[_0x6e5e('0x7b')]);for(var _0x409440=0x0;_0x409440<_0x400a2a[_0x6e5e('0x38')];_0x409440+=0x1){_0x1fa7e0=_0x400a2a[_0x409440]['MetricId']?_0x335410[_0x400a2a[_0x409440]['MetricId']][_0x6e5e('0x6e')]:_0x400a2a[_0x409440][_0x6e5e('0x66')];_0x1fa7e0=_0x400a2a[_0x409440]['function']?_[_0x6e5e('0x8c')](_0x548b8b[_0x400a2a[_0x409440][_0x6e5e('0x6f')]],'%s',_0x1fa7e0):_0x1fa7e0;_0x1fa7e0=_0x400a2a[_0x409440][_0x6e5e('0x79')]?_[_0x6e5e('0x8c')](_0x4474ba[_0x400a2a[_0x409440][_0x6e5e('0x79')]],'%s',_0x1fa7e0):_0x1fa7e0;if(_0x400a2a[_0x409440]['groupBy']){_0x18790e[_0x6e5e('0x65')](_0x1fa7e0);}_0x400a2a[_0x409440][_0x6e5e('0x71')]&&_0x18790e[_0x6e5e('0x72')](_0x1fa7e0,_0x400a2a[_0x409440][_0x6e5e('0x71')]==='DESC'?![]:!![]);_0x18790e[_0x6e5e('0x66')](_0x1fa7e0,_0x400a2a[_0x409440][_0x6e5e('0x73')]||_0x1fa7e0);}if(_0x76e796['joins']){_0x76e796[_0x6e5e('0x74')]=JSON[_0x6e5e('0x75')](_0x76e796[_0x6e5e('0x74')]);for(var _0x317307=0x0;_0x317307<_0x76e796['joins'][_0x6e5e('0x38')];_0x317307+=0x1){if(_0x76e796[_0x6e5e('0x74')][_0x317307][_0x6e5e('0x31')]&&_['includes'](_0x57adb5,_0x76e796[_0x6e5e('0x74')][_0x317307][_0x6e5e('0x31')])&&_0x76e796[_0x6e5e('0x74')][_0x317307][_0x6e5e('0x76')]&&_0x76e796['joins'][_0x317307][_0x6e5e('0x77')]&&_0x76e796[_0x6e5e('0x74')][_0x317307][_0x6e5e('0x78')]){_0x18790e[_0x76e796[_0x6e5e('0x74')][_0x317307][_0x6e5e('0x31')]](_0x76e796[_0x6e5e('0x74')][_0x317307]['foreignTable'],null,util[_0x6e5e('0x79')](_0x6e5e('0x7a'),_0x76e796[_0x6e5e('0x7b')],_0x76e796['joins'][_0x317307]['parentKey'],_0x76e796[_0x6e5e('0x74')][_0x317307][_0x6e5e('0x77')],_0x76e796['joins'][_0x317307][_0x6e5e('0x78')]));}}}if(_0x76e796[_0x6e5e('0x7c')]){_0x76e796[_0x6e5e('0x7c')]=JSON['parse'](_0x76e796['conditions']);_0x18790e[_0x6e5e('0x3c')](_0x1575b7(_0x76e796[_0x6e5e('0x7c')][_0x6e5e('0x65')]));}_0x2548f=_0x18790e[_0x6e5e('0x7d')]();_0x18790e[_0x6e5e('0x21')](_0x1bf785);_0x18790e[_0x6e5e('0x1f')](0x0);return;}})[_0x6e5e('0x28')](function(){if(_0x21acb3[_0x6e5e('0x8d')]===_0x6e5e('0x8e')){return null;}var _0x48a37a=_[_0x6e5e('0x3f')](_0x21acb3,{'name':_0x21acb3[_0x6e5e('0x8f')]||_0x21acb3['name']||_0x76e796['name'],'basename':_0x329e89,'savename':util[_0x6e5e('0x79')](_0x6e5e('0x90'),_0x21acb3[_0x6e5e('0x2c')]||_0x76e796[_0x6e5e('0x2c')],require(_0x6e5e('0x91'))[_0x6e5e('0x92')](0x4),_0x21acb3[_0x6e5e('0x8d')]||'csv'),'reportId':_0x76e796['id'],'reportType':_0x6e5e('0x93')});return db[_0x6e5e('0x94')][_0x6e5e('0x4b')](_0x48a37a,{'raw':!![]});})[_0x6e5e('0x28')](function(_0x113ad7){if(_0x76e796[_0x6e5e('0x7b')]==='cdr'){_0x2548f[_0x6e5e('0x3c')](_0x76e796[_0x6e5e('0x7b')]+_0x6e5e('0x95'),_0x21acb3[_0x6e5e('0x96')],_0x21acb3[_0x6e5e('0x97')]);}else{_0x2548f['where'](_0x76e796[_0x6e5e('0x7b')]+_0x6e5e('0x98'),_0x21acb3[_0x6e5e('0x96')],_0x21acb3[_0x6e5e('0x97')]);}if(_0x113ad7){logger[_0x6e5e('0x99')](_0x6e5e('0x9a'),_0x2548f[_0x6e5e('0x80')]());require(_0x6e5e('0x9b'))['fork'](path['join'](__dirname,_0x6e5e('0x9c'),_0x113ad7[_0x6e5e('0x8d')]),[_0x113ad7['id'],_0x2548f[_0x6e5e('0x80')](),path[_0x6e5e('0x55')](__dirname,_0x6e5e('0x9d'),_0x113ad7[_0x6e5e('0x9e')]),_0x329e89]);return _0x113ad7;}else{var _0x4c4756=squel[_0x6e5e('0x8b')]();_0x4c4756[_0x6e5e('0x9f')]('('+_0x2548f[_0x6e5e('0x80')]()+')',_0x6e5e('0xa0'));_0x4c4756[_0x6e5e('0x66')](_0x6e5e('0xa1'),'count');_0x2548f[_0x6e5e('0x21')](_0x21acb3[_0x6e5e('0x21')]||_0x1bf785);_0x2548f['offset'](_0x21acb3[_0x6e5e('0x1f')]||0x0);return dbH[_0x6e5e('0x81')][_0x6e5e('0x33')](_0x4c4756[_0x6e5e('0x80')](),{'type':dbH[_0x6e5e('0x81')][_0x6e5e('0xa2')][_0x6e5e('0x82')]})[_0x6e5e('0x28')](function(_0x214b50){if(!_0x214b50[_0x6e5e('0x38')]){_0x12e15b=0x0;}else{_0x12e15b=_0x214b50[0x0]['count']||0x0;}return dbH[_0x6e5e('0x81')][_0x6e5e('0x33')](_0x2548f[_0x6e5e('0x80')](),{'type':dbH['sequelize'][_0x6e5e('0xa2')][_0x6e5e('0x82')]});})[_0x6e5e('0x28')](function(_0x56a0cf){return{'rows':_0x56a0cf||[],'count':_0x12e15b};});}});}exports[_0x6e5e('0xa3')]=function(_0x321523,_0x50a023){return runReport(_0x321523[_0x6e5e('0x47')],_0x321523[_0x6e5e('0x33')],_0x321523['options'])['then'](respondWithResult(_0x50a023,null))[_0x6e5e('0x45')](handleError(_0x50a023,null));};exports['runReport']=runReport;exports[_0x6e5e('0x33')]=function(_0x571e05,_0x593b54){var _0x217671=0xa;var _0x4120bc=[_0x6e5e('0x55'),_0x6e5e('0x56'),_0x6e5e('0x57'),_0x6e5e('0x58')];var _0x42fe95={'SUM':_0x6e5e('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6e5e('0x5a'),'MAX':_0x6e5e('0x5b'),'MIN':_0x6e5e('0x5c'),'AVG':_0x6e5e('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6e5e('0xa4'),'GROUP_CONCAT DESC':_0x6e5e('0xa5')};var _0x53c4c4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6e5e('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x6e5e('0x86'),'UNIX_TIMESTAMP':_0x6e5e('0x60')};var _0x18db76=function(_0x2d7732){return!_['includes']([_0x6e5e('0x62'),'IS\x20NOT\x20NULL',_0x6e5e('0x87'),_0x6e5e('0x63')],_0x2d7732);};var _0x4e3d09=function(_0x5b5cd0){if(!_0x5b5cd0||!_0x5b5cd0['rules']['length']){return'';}for(var _0x6985b5='(',_0x3ee0a6=0x0;_0x3ee0a6<_0x5b5cd0['rules'][_0x6e5e('0x38')];_0x3ee0a6+=0x1){_0x3ee0a6>0x0&&(_0x6985b5+='\x20'+_0x5b5cd0['operator']+'\x20');_0x6985b5+=_0x5b5cd0[_0x6e5e('0x64')][_0x3ee0a6]['group']?_0x4e3d09(_0x5b5cd0['rules'][_0x3ee0a6][_0x6e5e('0x65')]):_0x5b5cd0[_0x6e5e('0x64')][_0x3ee0a6]['field']+'\x20'+_0x5b5cd0['rules'][_0x3ee0a6][_0x6e5e('0x67')]+(_0x18db76(_0x5b5cd0[_0x6e5e('0x64')][_0x3ee0a6][_0x6e5e('0x67')])?'\x20'+_0x5b5cd0['rules'][_0x3ee0a6][_0x6e5e('0x68')]:'');}return _0x6985b5+')';};var _0x5a0c43={'where':{'id':_0x571e05[_0x6e5e('0x47')]['id']}},_0x23dd76,_0x4d212d,_0x11f362,_0x3fcf78,_0x560660;_0x5a0c43=_[_0x6e5e('0x3f')]({},_0x5a0c43,_0x571e05[_0x6e5e('0x42')]);return db[_0x6e5e('0x2e')]['find'](_0x5a0c43)[_0x6e5e('0x28')](function(_0x3252e0){if(_0x3252e0){_0x23dd76=_0x3252e0;return _0x3252e0[_0x6e5e('0x89')]();}return null;})[_0x6e5e('0x28')](function(_0x27ad82){if(_0x27ad82){if(!_0x27ad82[_0x6e5e('0x38')]){throw new db[(_0x6e5e('0xa6'))][(_0x6e5e('0x69'))](_0x6e5e('0x6a'),0x193);}_0x4d212d=_0x27ad82;return db[_0x6e5e('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4b3171){if(_0x4b3171){_0x11f362=_[_0x6e5e('0x6c')](_0x4b3171,'id');var _0x36556c;var _0x2542c5=squel[_0x6e5e('0x8b')]();_0x2542c5[_0x6e5e('0x9f')](_0x23dd76[_0x6e5e('0x7b')]);for(var _0x56d79a=0x0;_0x56d79a<_0x4d212d[_0x6e5e('0x38')];_0x56d79a+=0x1){_0x36556c=_0x4d212d[_0x56d79a][_0x6e5e('0x6d')]?_0x11f362[_0x4d212d[_0x56d79a][_0x6e5e('0x6d')]][_0x6e5e('0x6e')]:_0x4d212d[_0x56d79a]['field'];_0x36556c=_0x4d212d[_0x56d79a]['function']?_[_0x6e5e('0x8c')](_0x42fe95[_0x4d212d[_0x56d79a][_0x6e5e('0x6f')]],'%s',_0x36556c):_0x36556c;_0x36556c=_0x4d212d[_0x56d79a]['format']?_['replace'](_0x53c4c4[_0x4d212d[_0x56d79a][_0x6e5e('0x79')]],'%s',_0x36556c):_0x36556c;if(_0x4d212d[_0x56d79a]['groupBy']){_0x2542c5[_0x6e5e('0x65')](_0x36556c);}_0x4d212d[_0x56d79a]['orderBy']&&_0x2542c5[_0x6e5e('0x72')](_0x36556c,_0x4d212d[_0x56d79a][_0x6e5e('0x71')]===_0x6e5e('0xa7')?![]:!![]);_0x2542c5[_0x6e5e('0x66')](_0x36556c,_0x4d212d[_0x56d79a][_0x6e5e('0x73')]||_0x36556c);}if(_0x23dd76['joins']){_0x23dd76['joins']=JSON[_0x6e5e('0x75')](_0x23dd76[_0x6e5e('0x74')]);for(var _0x1d9c90=0x0;_0x1d9c90<_0x23dd76[_0x6e5e('0x74')]['length'];_0x1d9c90+=0x1){if(_0x23dd76[_0x6e5e('0x74')][_0x1d9c90]['type']&&_[_0x6e5e('0x61')](_0x4120bc,_0x23dd76['joins'][_0x1d9c90][_0x6e5e('0x31')])&&_0x23dd76[_0x6e5e('0x74')][_0x1d9c90]['parentKey']&&_0x23dd76[_0x6e5e('0x74')][_0x1d9c90][_0x6e5e('0x77')]&&_0x23dd76[_0x6e5e('0x74')][_0x1d9c90][_0x6e5e('0x78')]){_0x2542c5[_0x23dd76[_0x6e5e('0x74')][_0x1d9c90][_0x6e5e('0x31')]](_0x23dd76['joins'][_0x1d9c90][_0x6e5e('0x77')],null,util[_0x6e5e('0x79')]('%s.%s\x20=\x20%s.%s',_0x23dd76[_0x6e5e('0x7b')],_0x23dd76['joins'][_0x1d9c90][_0x6e5e('0x76')],_0x23dd76[_0x6e5e('0x74')][_0x1d9c90]['foreignTable'],_0x23dd76[_0x6e5e('0x74')][_0x1d9c90][_0x6e5e('0x78')]));}}}if(_0x23dd76[_0x6e5e('0x7c')]){_0x23dd76[_0x6e5e('0x7c')]=JSON[_0x6e5e('0x75')](_0x23dd76[_0x6e5e('0x7c')]);_0x2542c5[_0x6e5e('0x3c')](_0x4e3d09(_0x23dd76[_0x6e5e('0x7c')][_0x6e5e('0x65')]));}_0x560660=_0x2542c5[_0x6e5e('0x7d')]();_0x2542c5[_0x6e5e('0x21')](_0x217671);_0x2542c5[_0x6e5e('0x1f')](0x0);logger[_0x6e5e('0x7e')](_0x6e5e('0x7f'),_0x2542c5['toString']());return dbH[_0x6e5e('0x81')]['query'](_0x2542c5[_0x6e5e('0x80')](),{'type':dbH[_0x6e5e('0x81')][_0x6e5e('0xa2')][_0x6e5e('0x82')]});}})[_0x6e5e('0x28')](function(){return{'sql':_0x560660['toString']()};})['then'](respondWithResult(_0x593b54,null))[_0x6e5e('0x45')](handleError(_0x593b54,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7db4837..70fa997 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 _0xd840=['analytics_custom_reports','../../config/logger','api','request-promise','path','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x17f7e0,_0x37d9e1){var _0x98c5f4=function(_0x51e278){while(--_0x51e278){_0x17f7e0['push'](_0x17f7e0['shift']());}};_0x98c5f4(++_0x37d9e1);}(_0xd840,0x1d5));var _0x0d84=function(_0x234e94,_0x947518){_0x234e94=_0x234e94-0x0;var _0x15f65b=_0xd840[_0x234e94];return _0x15f65b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d84('0x0'))(_0x0d84('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d84('0x2'));var fs=require('fs');var path=require(_0x0d84('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0d84('0x4'));module[_0x0d84('0x5')]=function(_0x2bd512,_0x2c6861){return _0x2bd512[_0x0d84('0x6')](_0x0d84('0x7'),attributes,{'tableName':_0x0d84('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ebf=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x6da129,_0x40948d){var _0x1349d6=function(_0x3b1bc){while(--_0x3b1bc){_0x6da129['push'](_0x6da129['shift']());}};_0x1349d6(++_0x40948d);}(_0x5ebf,0x166));var _0xf5eb=function(_0x437bc6,_0x1e3cf3){_0x437bc6=_0x437bc6-0x0;var _0x11fa5a=_0x5ebf[_0x437bc6];return _0x11fa5a;};'use strict';var _=require(_0xf5eb('0x0'));var util=require(_0xf5eb('0x1'));var logger=require(_0xf5eb('0x2'))(_0xf5eb('0x3'));var moment=require(_0xf5eb('0x4'));var BPromise=require(_0xf5eb('0x5'));var rp=require(_0xf5eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5eb('0x7'));var config=require(_0xf5eb('0x8'));var attributes=require(_0xf5eb('0x9'));module[_0xf5eb('0xa')]=function(_0x2a37dd,_0x9f1977){return _0x2a37dd[_0xf5eb('0xb')](_0xf5eb('0xc'),attributes,{'tableName':'analytics_custom_reports','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 4fe3afe..c346684 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 _0x2b11=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','stringify'];(function(_0x169585,_0x476cc6){var _0x5cf666=function(_0x4f7106){while(--_0x4f7106){_0x169585['push'](_0x169585['shift']());}};_0x5cf666(++_0x476cc6);}(_0x2b11,0x140));var _0x12b1=function(_0x4d230c,_0x3862fd){_0x4d230c=_0x4d230c-0x0;var _0x16b044=_0x2b11[_0x4d230c];return _0x16b044;};'use strict';var _=require(_0x12b1('0x0'));var util=require('util');var moment=require(_0x12b1('0x1'));var BPromise=require(_0x12b1('0x2'));var rs=require(_0x12b1('0x3'));var fs=require('fs');var Redis=require(_0x12b1('0x4'));var db=require(_0x12b1('0x5'))['db'];var utils=require(_0x12b1('0x6'));var logger=require(_0x12b1('0x7'))(_0x12b1('0x8'));var config=require(_0x12b1('0x9'));var jayson=require(_0x12b1('0xa'));var client=jayson['client'][_0x12b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cc428,_0x3cc2af,_0x267a13){return new BPromise(function(_0x6c1f8f,_0x40a336){return client[_0x12b1('0xc')](_0x4cc428,_0x267a13)[_0x12b1('0xd')](function(_0x49d673){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x3cc2af,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3cc2af,_0x12b1('0xe'),JSON[_0x12b1('0xf')](_0x49d673));if(_0x49d673[_0x12b1('0x10')]){if(_0x49d673['error'][_0x12b1('0x11')]===0x1f4){logger[_0x12b1('0x10')](_0x12b1('0x12'),_0x3cc2af,_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);return _0x40a336(_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);}logger[_0x12b1('0x10')](_0x12b1('0x12'),_0x3cc2af,_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);return _0x6c1f8f(_0x49d673[_0x12b1('0x10')][_0x12b1('0x13')]);}else{logger[_0x12b1('0x14')](_0x12b1('0x12'),_0x3cc2af,_0x12b1('0xe'));_0x6c1f8f(_0x49d673['result']['message']);}})['catch'](function(_0x4b90f2){logger[_0x12b1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3cc2af,_0x4b90f2);_0x40a336(_0x4b90f2);});});} \ No newline at end of file +var _0x6ae0=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x357675,_0x1c6992){var _0x2d12cc=function(_0x2deb4e){while(--_0x2deb4e){_0x357675['push'](_0x357675['shift']());}};_0x2d12cc(++_0x1c6992);}(_0x6ae0,0x112));var _0x06ae=function(_0x923f9b,_0x911264){_0x923f9b=_0x923f9b-0x0;var _0xfdf48e=_0x6ae0[_0x923f9b];return _0xfdf48e;};'use strict';var _=require('lodash');var util=require(_0x06ae('0x0'));var moment=require(_0x06ae('0x1'));var BPromise=require(_0x06ae('0x2'));var rs=require(_0x06ae('0x3'));var fs=require('fs');var Redis=require(_0x06ae('0x4'));var db=require(_0x06ae('0x5'))['db'];var utils=require(_0x06ae('0x6'));var logger=require('../../config/logger')(_0x06ae('0x7'));var config=require(_0x06ae('0x8'));var jayson=require(_0x06ae('0x9'));var client=jayson['client'][_0x06ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4378,_0x45c980,_0x474606){return new BPromise(function(_0x44bdd8,_0x2bea44){return client['request'](_0x5e4378,_0x474606)[_0x06ae('0xb')](function(_0x414d4d){logger['info'](_0x06ae('0xc'),_0x45c980,_0x06ae('0xd'));logger[_0x06ae('0xe')](_0x06ae('0xf'),_0x45c980,_0x06ae('0xd'),JSON['stringify'](_0x414d4d));if(_0x414d4d['error']){if(_0x414d4d['error'][_0x06ae('0x10')]===0x1f4){logger[_0x06ae('0x11')](_0x06ae('0xc'),_0x45c980,_0x414d4d[_0x06ae('0x11')][_0x06ae('0x12')]);return _0x2bea44(_0x414d4d[_0x06ae('0x11')][_0x06ae('0x12')]);}logger[_0x06ae('0x11')](_0x06ae('0xc'),_0x45c980,_0x414d4d['error'][_0x06ae('0x12')]);return _0x44bdd8(_0x414d4d[_0x06ae('0x11')][_0x06ae('0x12')]);}else{logger[_0x06ae('0x13')](_0x06ae('0xc'),_0x45c980,_0x06ae('0xd'));_0x44bdd8(_0x414d4d[_0x06ae('0x14')]['message']);}})[_0x06ae('0x15')](function(_0x438bdc){logger[_0x06ae('0x11')](_0x06ae('0xc'),_0x45c980,_0x438bdc);_0x2bea44(_0x438bdc);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b23538c..faff8b8 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 _0x3e33=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/query','post','create','put','/:id','update','delete','destroy'];(function(_0xbcd3f3,_0x404ec1){var _0xdf86f3=function(_0x442550){while(--_0x442550){_0xbcd3f3['push'](_0xbcd3f3['shift']());}};_0xdf86f3(++_0x404ec1);}(_0x3e33,0xfa));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x33e3('0x0'));var util=require(_0x33e3('0x1'));var path=require(_0x33e3('0x2'));var timeout=require(_0x33e3('0x3'));var express=require(_0x33e3('0x4'));var router=express[_0x33e3('0x5')]();var fs_extra=require(_0x33e3('0x6'));var auth=require(_0x33e3('0x7'));var interaction=require(_0x33e3('0x8'));var config=require(_0x33e3('0x9'));var controller=require(_0x33e3('0xa'));router[_0x33e3('0xb')]('/',auth[_0x33e3('0xc')](),controller[_0x33e3('0xd')]);router[_0x33e3('0xb')]('/:id',auth[_0x33e3('0xc')](),controller[_0x33e3('0xe')]);router[_0x33e3('0xb')](_0x33e3('0xf'),auth['isAuthenticated'](),controller[_0x33e3('0x10')]);router[_0x33e3('0xb')]('/:id/run',auth[_0x33e3('0xc')](),controller['run']);router['get'](_0x33e3('0x11'),auth[_0x33e3('0xc')](),controller['query']);router[_0x33e3('0x12')]('/',auth[_0x33e3('0xc')](),controller[_0x33e3('0x13')]);router[_0x33e3('0x14')](_0x33e3('0x15'),auth[_0x33e3('0xc')](),controller[_0x33e3('0x16')]);router[_0x33e3('0x17')](_0x33e3('0x15'),auth[_0x33e3('0xc')](),controller[_0x33e3('0x18')]);module['exports']=router; \ No newline at end of file +var _0xe6bf=['../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','run','post','create','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a7711,_0x39ee14){var _0x23f443=function(_0x3fd9a1){while(--_0x3fd9a1){_0x5a7711['push'](_0x5a7711['shift']());}};_0x23f443(++_0x39ee14);}(_0xe6bf,0x19d));var _0xfe6b=function(_0x233eab,_0x5c910f){_0x233eab=_0x233eab-0x0;var _0x288cc3=_0xe6bf[_0x233eab];return _0x288cc3;};'use strict';var multer=require(_0xfe6b('0x0'));var util=require('util');var path=require(_0xfe6b('0x1'));var timeout=require(_0xfe6b('0x2'));var express=require('express');var router=express[_0xfe6b('0x3')]();var fs_extra=require(_0xfe6b('0x4'));var auth=require(_0xfe6b('0x5'));var interaction=require(_0xfe6b('0x6'));var config=require(_0xfe6b('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xfe6b('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe6b('0x9')]);router['get'](_0xfe6b('0xa'),auth[_0xfe6b('0xb')](),controller[_0xfe6b('0xc')]);router[_0xfe6b('0x8')](_0xfe6b('0xd'),auth[_0xfe6b('0xb')](),controller[_0xfe6b('0xe')]);router[_0xfe6b('0x8')]('/:id/run',auth[_0xfe6b('0xb')](),controller[_0xfe6b('0xf')]);router[_0xfe6b('0x8')]('/:id/query',auth[_0xfe6b('0xb')](),controller['query']);router[_0xfe6b('0x10')]('/',auth[_0xfe6b('0xb')](),controller[_0xfe6b('0x11')]);router['put'](_0xfe6b('0xa'),auth['isAuthenticated'](),controller[_0xfe6b('0x12')]);router['delete'](_0xfe6b('0xa'),auth[_0xfe6b('0xb')](),controller[_0xfe6b('0x13')]);module[_0xfe6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 168a075..c36f9be 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x39f52d,_0x487474){var _0x4feded=function(_0x2de468){while(--_0x2de468){_0x39f52d['push'](_0x39f52d['shift']());}};_0x4feded(++_0x487474);}(_0xeff8,0x186));var _0x8eff=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xeff8[_0x49c057];return _0xd8f0e6;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file +var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0xafc4,0x69));var _0x4afc=function(_0x42df9f,_0x52aedd){_0x42df9f=_0x42df9f-0x0;var _0x89712b=_0xafc4[_0x42df9f];return _0x89712b;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 25f8de8..15493a0 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%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','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x1b73b1,_0x4aebdc){var _0x337e75=function(_0x5038f8){while(--_0x5038f8){_0x1b73b1['push'](_0x1b73b1['shift']());}};_0x337e75(++_0x4aebdc);}(_0x814b,0x1a2));var _0xb814=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x814b[_0x55754e];return _0x2e9948;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file +var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x290e14,_0x53d210){var _0x2533ec=function(_0x152df1){while(--_0x152df1){_0x290e14['push'](_0x290e14['shift']());}};_0x2533ec(++_0x53d210);}(_0x2675,0x75));var _0x5267=function(_0x28cda5,_0x139108){_0x28cda5=_0x28cda5-0x0;var _0x55e376=_0x2675[_0x28cda5];return _0x55e376;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index eb8981c..3d42dd6 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 _0x9a0d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x2e349f,_0x313c79){var _0x4a41dd=function(_0x545a71){while(--_0x545a71){_0x2e349f['push'](_0x2e349f['shift']());}};_0x4a41dd(++_0x313c79);}(_0x9a0d,0x1ee));var _0xd9a0=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x9a0d[_0x561f25];return _0x150e4c;};'use strict';var _=require(_0xd9a0('0x0'));var util=require('util');var logger=require(_0xd9a0('0x1'))(_0xd9a0('0x2'));var moment=require(_0xd9a0('0x3'));var BPromise=require(_0xd9a0('0x4'));var rp=require(_0xd9a0('0x5'));var fs=require('fs');var path=require(_0xd9a0('0x6'));var rimraf=require(_0xd9a0('0x7'));var config=require('../../config/environment');var attributes=require(_0xd9a0('0x8'));module[_0xd9a0('0x9')]=function(_0x5d2a9a,_0x1edea1){return _0x5d2a9a[_0xd9a0('0xa')](_0xd9a0('0xb'),attributes,{'tableName':_0xd9a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c33=['exports','define','analytics_default_reports','lodash','util','moment','request-promise','path','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x15402e,_0x35b1f3){var _0x8d44f5=function(_0x3cb3a7){while(--_0x3cb3a7){_0x15402e['push'](_0x15402e['shift']());}};_0x8d44f5(++_0x35b1f3);}(_0x4c33,0x85));var _0x34c3=function(_0x20daac,_0x3250ac){_0x20daac=_0x20daac-0x0;var _0x278491=_0x4c33[_0x20daac];return _0x278491;};'use strict';var _=require(_0x34c3('0x0'));var util=require(_0x34c3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x34c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x34c3('0x3'));var fs=require('fs');var path=require(_0x34c3('0x4'));var rimraf=require('rimraf');var config=require(_0x34c3('0x5'));var attributes=require(_0x34c3('0x6'));module[_0x34c3('0x7')]=function(_0x5a521b,_0x4e8803){return _0x5a521b[_0x34c3('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x34c3('0x9'),'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 8c853f6..2c5cf3a 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 _0x11e1=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x11e1,0x126));var _0x111e=function(_0x143c16,_0x4ea500){_0x143c16=_0x143c16-0x0;var _0x14666b=_0x11e1[_0x143c16];return _0x14666b;};'use strict';var _=require(_0x111e('0x0'));var util=require(_0x111e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x111e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x111e('0x3'))['db'];var utils=require(_0x111e('0x4'));var logger=require(_0x111e('0x5'))(_0x111e('0x6'));var config=require(_0x111e('0x7'));var jayson=require(_0x111e('0x8'));var client=jayson[_0x111e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf2960b,_0x569803,_0x1d2bf6){return new BPromise(function(_0x31d6c0,_0x3ccb19){return client[_0x111e('0xa')](_0xf2960b,_0x1d2bf6)[_0x111e('0xb')](function(_0x11a28e){logger['info'](_0x111e('0xc'),_0x569803,'request\x20sent');logger[_0x111e('0xd')](_0x111e('0xe'),_0x569803,_0x111e('0xf'),JSON[_0x111e('0x10')](_0x11a28e));if(_0x11a28e[_0x111e('0x11')]){if(_0x11a28e[_0x111e('0x11')][_0x111e('0x12')]===0x1f4){logger[_0x111e('0x11')](_0x111e('0xc'),_0x569803,_0x11a28e['error'][_0x111e('0x13')]);return _0x3ccb19(_0x11a28e['error'][_0x111e('0x13')]);}logger[_0x111e('0x11')](_0x111e('0xc'),_0x569803,_0x11a28e[_0x111e('0x11')][_0x111e('0x13')]);return _0x31d6c0(_0x11a28e[_0x111e('0x11')][_0x111e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x569803,_0x111e('0xf'));_0x31d6c0(_0x11a28e[_0x111e('0x14')]['message']);}})[_0x111e('0x15')](function(_0xd3989b){logger[_0x111e('0x11')](_0x111e('0xc'),_0x569803,_0xd3989b);_0x3ccb19(_0xd3989b);});});} \ No newline at end of file +var _0x5aeb=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x3f0b2a,_0x52f963){var _0x23bd63=function(_0x238936){while(--_0x238936){_0x3f0b2a['push'](_0x3f0b2a['shift']());}};_0x23bd63(++_0x52f963);}(_0x5aeb,0x1eb));var _0xb5ae=function(_0x1f3bc1,_0x250cf0){_0x1f3bc1=_0x1f3bc1-0x0;var _0x106d9d=_0x5aeb[_0x1f3bc1];return _0x106d9d;};'use strict';var _=require('lodash');var util=require(_0xb5ae('0x0'));var moment=require(_0xb5ae('0x1'));var BPromise=require(_0xb5ae('0x2'));var rs=require(_0xb5ae('0x3'));var fs=require('fs');var Redis=require(_0xb5ae('0x4'));var db=require(_0xb5ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5ae('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5ae('0x7')][_0xb5ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1dca7,_0x15c19f,_0x27a1a7){return new BPromise(function(_0x4945fd,_0x3d55ae){return client[_0xb5ae('0x9')](_0xe1dca7,_0x27a1a7)[_0xb5ae('0xa')](function(_0x526684){logger[_0xb5ae('0xb')](_0xb5ae('0xc'),_0x15c19f,_0xb5ae('0xd'));logger[_0xb5ae('0xe')](_0xb5ae('0xf'),_0x15c19f,_0xb5ae('0xd'),JSON[_0xb5ae('0x10')](_0x526684));if(_0x526684[_0xb5ae('0x11')]){if(_0x526684[_0xb5ae('0x11')][_0xb5ae('0x12')]===0x1f4){logger['error'](_0xb5ae('0xc'),_0x15c19f,_0x526684[_0xb5ae('0x11')]['message']);return _0x3d55ae(_0x526684[_0xb5ae('0x11')][_0xb5ae('0x13')]);}logger[_0xb5ae('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x15c19f,_0x526684[_0xb5ae('0x11')][_0xb5ae('0x13')]);return _0x4945fd(_0x526684[_0xb5ae('0x11')][_0xb5ae('0x13')]);}else{logger[_0xb5ae('0xb')](_0xb5ae('0xc'),_0x15c19f,_0xb5ae('0xd'));_0x4945fd(_0x526684[_0xb5ae('0x14')][_0xb5ae('0x13')]);}})['catch'](function(_0xbce1e3){logger[_0xb5ae('0x11')](_0xb5ae('0xc'),_0x15c19f,_0xbce1e3);_0x3d55ae(_0xbce1e3);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index d9c32f0..029a72c 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 _0x3432=['/:id/preview','/:id/run','run','/:id/query','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show'];(function(_0x185754,_0x54e1e3){var _0x29ee6f=function(_0x320165){while(--_0x320165){_0x185754['push'](_0x185754['shift']());}};_0x29ee6f(++_0x54e1e3);}(_0x3432,0x199));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2343('0x0'));var path=require('path');var timeout=require(_0x2343('0x1'));var express=require(_0x2343('0x2'));var router=express[_0x2343('0x3')]();var fs_extra=require(_0x2343('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2343('0x5'));var config=require('../../config/environment');var controller=require(_0x2343('0x6'));router['get']('/',auth[_0x2343('0x7')](),controller['index']);router[_0x2343('0x8')](_0x2343('0x9'),auth['isAuthenticated'](),controller[_0x2343('0xa')]);router[_0x2343('0x8')](_0x2343('0xb'),auth[_0x2343('0x7')](),controller['preview']);router[_0x2343('0x8')](_0x2343('0xc'),auth[_0x2343('0x7')](),controller[_0x2343('0xd')]);router[_0x2343('0x8')](_0x2343('0xe'),auth['isAuthenticated'](),controller['query']);router[_0x2343('0xf')]('/',auth[_0x2343('0x7')](),controller[_0x2343('0x10')]);router[_0x2343('0x11')](_0x2343('0x9'),auth[_0x2343('0x7')](),controller['update']);router[_0x2343('0x12')]('/:id',auth[_0x2343('0x7')](),controller[_0x2343('0x13')]);module[_0x2343('0x14')]=router; \ No newline at end of file +var _0x4c85=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','index','get','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3b82d0,_0x224b6a){var _0x4d0cb7=function(_0x562841){while(--_0x562841){_0x3b82d0['push'](_0x3b82d0['shift']());}};_0x4d0cb7(++_0x224b6a);}(_0x4c85,0xec));var _0x54c8=function(_0x2536bc,_0x12e82e){_0x2536bc=_0x2536bc-0x0;var _0x273c83=_0x4c85[_0x2536bc];return _0x273c83;};'use strict';var multer=require(_0x54c8('0x0'));var util=require(_0x54c8('0x1'));var path=require('path');var timeout=require(_0x54c8('0x2'));var express=require(_0x54c8('0x3'));var router=express[_0x54c8('0x4')]();var fs_extra=require(_0x54c8('0x5'));var auth=require(_0x54c8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x54c8('0x7'));var controller=require(_0x54c8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x54c8('0x9')]);router[_0x54c8('0xa')]('/:id',auth[_0x54c8('0xb')](),controller[_0x54c8('0xc')]);router[_0x54c8('0xa')]('/:id/preview',auth[_0x54c8('0xb')](),controller[_0x54c8('0xd')]);router[_0x54c8('0xa')](_0x54c8('0xe'),auth[_0x54c8('0xb')](),controller[_0x54c8('0xf')]);router[_0x54c8('0xa')](_0x54c8('0x10'),auth[_0x54c8('0xb')](),controller[_0x54c8('0x11')]);router[_0x54c8('0x12')]('/',auth[_0x54c8('0xb')](),controller[_0x54c8('0x13')]);router['put'](_0x54c8('0x14'),auth[_0x54c8('0xb')](),controller[_0x54c8('0x15')]);router['delete']('/:id',auth[_0x54c8('0xb')](),controller[_0x54c8('0x16')]);module[_0x54c8('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 23a3bb4..60d038b 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 _0xb767=['xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf'];(function(_0x38b79c,_0x1801c8){var _0x4e32ad=function(_0x56329c){while(--_0x56329c){_0x38b79c['push'](_0x38b79c['shift']());}};_0x4e32ad(++_0x1801c8);}(_0xb767,0x162));var _0x7b76=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb767[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7b76('0x0'));var moment=require(_0x7b76('0x1'));module[_0x7b76('0x2')]={'name':{'type':Sequelize[_0x7b76('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x7b76('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7b76('0x4')]('csv',_0x7b76('0x5'),_0x7b76('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x7b76('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x7b76('0x7')]},'endDate':{'type':Sequelize[_0x7b76('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x7b76('0x8')},'type':{'type':Sequelize[_0x7b76('0x4')](_0x7b76('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x7b76('0x9')},'reportId':{'type':Sequelize[_0x7b76('0xa')](0xb)[_0x7b76('0xb')]},'reportType':{'type':Sequelize[_0x7b76('0x3')]}}; \ No newline at end of file +var _0xe7de=['xlsx','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','exports','STRING','csv'];(function(_0x44cc42,_0xd240e5){var _0x1bca34=function(_0x1dc469){while(--_0x1dc469){_0x44cc42['push'](_0x44cc42['shift']());}};_0x1bca34(++_0xd240e5);}(_0xe7de,0xc5));var _0xee7d=function(_0x8ede60,_0x2b513d){_0x8ede60=_0x8ede60-0x0;var _0x1a5342=_0xe7de[_0x8ede60];return _0x1a5342;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xee7d('0x0')]={'name':{'type':Sequelize[_0xee7d('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xee7d('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xee7d('0x2'),'pdf',_0xee7d('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xee7d('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xee7d('0x1')],'defaultValue':_0xee7d('0x4')},'type':{'type':Sequelize[_0xee7d('0x5')](_0xee7d('0x6'),_0xee7d('0x7')),'allowNull':![],'defaultValue':_0xee7d('0x6')},'reportId':{'type':Sequelize[_0xee7d('0x8')](0xb)[_0xee7d('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index d4c69db..5d5ac15 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 _0xd03b=['query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','intersection','find','create','body','user','get','role','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','basename','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0xd03b,0xe1));var _0xbd03=function(_0x3db5d4,_0x5cd874){_0x3db5d4=_0x3db5d4-0x0;var _0x213132=_0xd03b[_0x3db5d4];return _0x213132;};'use strict';var emlformat=require(_0xbd03('0x0'));var rimraf=require(_0xbd03('0x1'));var zipdir=require(_0xbd03('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd03('0x3'));var moment=require(_0xbd03('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbd03('0x5'));var sox=require(_0xbd03('0x6'));var csv=require(_0xbd03('0x7'));var ejs=require(_0xbd03('0x8'));var fs=require('fs');var fs_extra=require(_0xbd03('0x9'));var _=require(_0xbd03('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbd03('0xb'));var deskjs=require(_0xbd03('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbd03('0xd'));var Papa=require(_0xbd03('0xe'));var Redis=require(_0xbd03('0xf'));var authService=require(_0xbd03('0x10'));var qs=require(_0xbd03('0x11'));var as=require(_0xbd03('0x12'));var hardwareService=require(_0xbd03('0x13'));var logger=require('../../config/logger')(_0xbd03('0x14'));var utils=require(_0xbd03('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e49b5,_0x20d6fc){_0x20d6fc=_0x20d6fc||0xcc;return function(_0x242e81){if(_0x242e81){return _0x3e49b5['sendStatus'](_0x20d6fc);}return _0x3e49b5['status'](_0x20d6fc)['end']();};}function respondWithResult(_0x122e39,_0x34fdc9){_0x34fdc9=_0x34fdc9||0xc8;return function(_0x29a43d){if(_0x29a43d){return _0x122e39[_0xbd03('0x16')](_0x34fdc9)[_0xbd03('0x17')](_0x29a43d);}};}function respondWithFilteredResult(_0x1459d8,_0x8b4a1a){return function(_0x491529){if(_0x491529){var _0x3f09cc=typeof _0x8b4a1a['offset']===_0xbd03('0x18')&&typeof _0x8b4a1a[_0xbd03('0x19')]==='undefined';var _0x1a2f19=_0x491529[_0xbd03('0x1a')];var _0x24f2f8=_0x3f09cc?0x0:_0x8b4a1a[_0xbd03('0x1b')];var _0x3f8731=_0x3f09cc?_0x491529[_0xbd03('0x1a')]:_0x8b4a1a[_0xbd03('0x1b')]+_0x8b4a1a[_0xbd03('0x19')];var _0x4d22ea;if(_0x3f8731>=_0x1a2f19){_0x3f8731=_0x1a2f19;_0x4d22ea=0xc8;}else{_0x4d22ea=0xce;}_0x1459d8[_0xbd03('0x16')](_0x4d22ea);return _0x1459d8[_0xbd03('0x1c')]('Content-Range',_0x24f2f8+'-'+_0x3f8731+'/'+_0x1a2f19)[_0xbd03('0x17')](_0x491529);}return null;};}function patchUpdates(_0x300e44){return function(_0x57e3e2){try{jsonpatch[_0xbd03('0x1d')](_0x57e3e2,_0x300e44,!![]);}catch(_0x209f2d){return BPromise['reject'](_0x209f2d);}return _0x57e3e2[_0xbd03('0x1e')]();};}function saveUpdates(_0x453050,_0x31be7a){return function(_0x2f3835){if(_0x2f3835){return _0x2f3835[_0xbd03('0x1f')](_0x453050)[_0xbd03('0x20')](function(_0x505db1){return _0x505db1;});}return null;};}function removeEntity(_0x581cde,_0x178817){return function(_0x368382){if(_0x368382){return _0x368382[_0xbd03('0x21')]()[_0xbd03('0x20')](function(){var _0x59f3d6=_0x368382['get']({'plain':!![]});var _0x2cf24b=_0xbd03('0x22');return db[_0xbd03('0x23')][_0xbd03('0x21')]({'where':{'type':_0x2cf24b,'resourceId':_0x59f3d6['id']}})['then'](function(){return _0x368382;});})[_0xbd03('0x20')](function(){_0x581cde[_0xbd03('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15c75e,_0x47bc16){return function(_0x378d96){if(!_0x378d96){_0x15c75e[_0xbd03('0x24')](0x194);}return _0x378d96;};}function handleError(_0xdf7fac,_0x666e92){_0x666e92=_0x666e92||0x1f4;return function(_0x49cc98){logger[_0xbd03('0x25')](_0x49cc98[_0xbd03('0x26')]);if(_0x49cc98['name']){delete _0x49cc98[_0xbd03('0x27')];}_0xdf7fac['status'](_0x666e92)[_0xbd03('0x28')](_0x49cc98);};}exports[_0xbd03('0x29')]=function(_0x3c4ffc,_0x544e92){var _0x593d03={},_0x222beb={},_0x2a75e5={'count':0x0,'rows':[]};var _0x1476f7=_[_0xbd03('0x2a')](db[_0xbd03('0x2b')][_0xbd03('0x2c')],function(_0x34957c){return{'name':_0x34957c[_0xbd03('0x2d')],'type':_0x34957c[_0xbd03('0x2e')]['key']};});_0x222beb[_0xbd03('0x2f')]=_[_0xbd03('0x2a')](_0x1476f7,_0xbd03('0x27'));_0x222beb[_0xbd03('0x30')]=_['keys'](_0x3c4ffc['query']);_0x222beb[_0xbd03('0x31')]=_['intersection'](_0x222beb[_0xbd03('0x2f')],_0x222beb[_0xbd03('0x30')]);_0x593d03[_0xbd03('0x32')]=_['intersection'](_0x222beb[_0xbd03('0x2f')],qs[_0xbd03('0x33')](_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x33')]));_0x593d03[_0xbd03('0x32')]=_0x593d03[_0xbd03('0x32')][_0xbd03('0x34')]?_0x593d03[_0xbd03('0x32')]:_0x222beb[_0xbd03('0x2f')];if(!_0x3c4ffc[_0xbd03('0x30')]['hasOwnProperty'](_0xbd03('0x35'))){_0x593d03[_0xbd03('0x19')]=qs[_0xbd03('0x19')](_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x19')]);_0x593d03['offset']=qs[_0xbd03('0x1b')](_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x1b')]);}_0x593d03[_0xbd03('0x36')]=qs[_0xbd03('0x37')](_0x3c4ffc[_0xbd03('0x30')]['sort']);_0x593d03[_0xbd03('0x38')]=qs['filters'](_[_0xbd03('0x39')](_0x3c4ffc[_0xbd03('0x30')],_0x222beb[_0xbd03('0x31')]),_0x1476f7);if(_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x3a')]){_0x593d03[_0xbd03('0x38')]=_['merge'](_0x593d03['where'],{'$or':_[_0xbd03('0x2a')](_0x1476f7,function(_0x563a26){if(_0x563a26['type']!==_0xbd03('0x3b')){var _0xc1015c={};_0xc1015c[_0x563a26['name']]={'$like':'%'+_0x3c4ffc[_0xbd03('0x30')][_0xbd03('0x3a')]+'%'};return _0xc1015c;}})});}_0x593d03=_[_0xbd03('0x3c')]({},_0x593d03,_0x3c4ffc[_0xbd03('0x3d')]);var _0x3c0c01={'where':_0x593d03[_0xbd03('0x38')]};return db[_0xbd03('0x2b')][_0xbd03('0x1a')](_0x3c0c01)[_0xbd03('0x20')](function(_0x582679){_0x2a75e5[_0xbd03('0x1a')]=_0x582679;if(_0x3c4ffc[_0xbd03('0x30')]['includeAll']){_0x593d03[_0xbd03('0x3e')]=[{'all':!![]}];}return db[_0xbd03('0x2b')][_0xbd03('0x3f')](_0x593d03);})[_0xbd03('0x20')](function(_0x7525f2){_0x2a75e5[_0xbd03('0x40')]=_0x7525f2;return _0x2a75e5;})[_0xbd03('0x20')](respondWithFilteredResult(_0x544e92,_0x593d03))['catch'](handleError(_0x544e92,null));};exports[_0xbd03('0x41')]=function(_0x4319bb,_0x4c5485){var _0x4448d2={'raw':!![],'where':{'id':_0x4319bb[_0xbd03('0x42')]['id']}},_0x2d8ca7={};_0x2d8ca7['model']=_[_0xbd03('0x43')](db[_0xbd03('0x2b')][_0xbd03('0x2c')]);_0x2d8ca7['query']=_[_0xbd03('0x43')](_0x4319bb[_0xbd03('0x30')]);_0x2d8ca7[_0xbd03('0x31')]=_['intersection'](_0x2d8ca7[_0xbd03('0x2f')],_0x2d8ca7[_0xbd03('0x30')]);_0x4448d2[_0xbd03('0x32')]=_[_0xbd03('0x44')](_0x2d8ca7['model'],qs['fields'](_0x4319bb[_0xbd03('0x30')][_0xbd03('0x33')]));_0x4448d2[_0xbd03('0x32')]=_0x4448d2['attributes'][_0xbd03('0x34')]?_0x4448d2['attributes']:_0x2d8ca7[_0xbd03('0x2f')];if(_0x4319bb[_0xbd03('0x30')]['includeAll']){_0x4448d2[_0xbd03('0x3e')]=[{'all':!![]}];}_0x4448d2=_['merge']({},_0x4448d2,_0x4319bb[_0xbd03('0x3d')]);return db[_0xbd03('0x2b')][_0xbd03('0x45')](_0x4448d2)[_0xbd03('0x20')](handleEntityNotFound(_0x4c5485,null))[_0xbd03('0x20')](respondWithResult(_0x4c5485,null))['catch'](handleError(_0x4c5485,null));};exports['create']=function(_0x102d65,_0x3ae040){return db[_0xbd03('0x2b')][_0xbd03('0x46')](_0x102d65[_0xbd03('0x47')],{})[_0xbd03('0x20')](function(_0x474481){var _0x3a6662=_0x102d65[_0xbd03('0x48')][_0xbd03('0x49')]({'plain':!![]});if(!_0x3a6662)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a6662[_0xbd03('0x4a')]===_0xbd03('0x48')){var _0x28f598=_0x474481[_0xbd03('0x49')]({'plain':!![]});var _0x57c1f3=_0xbd03('0x22');return db[_0xbd03('0x4b')][_0xbd03('0x45')]({'where':{'name':_0x57c1f3,'userProfileId':_0x3a6662['userProfileId']},'raw':!![]})['then'](function(_0x12d3fe){if(_0x12d3fe&&_0x12d3fe['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x28f598[_0xbd03('0x27')],'resourceId':_0x28f598['id'],'type':_0x12d3fe[_0xbd03('0x27')],'sectionId':_0x12d3fe['id']},{})[_0xbd03('0x20')](function(){return _0x474481;});}else{return _0x474481;}})[_0xbd03('0x4c')](function(_0x141973){logger['error'](_0xbd03('0x4d'),_0x141973);throw _0x141973;});}return _0x474481;})['then'](respondWithResult(_0x3ae040,0xc9))[_0xbd03('0x4c')](handleError(_0x3ae040,null));};exports['update']=function(_0x2ef058,_0x46def6){if(_0x2ef058['body']['id']){delete _0x2ef058['body']['id'];}return db[_0xbd03('0x2b')][_0xbd03('0x45')]({'where':{'id':_0x2ef058['params']['id']}})[_0xbd03('0x20')](handleEntityNotFound(_0x46def6,null))[_0xbd03('0x20')](saveUpdates(_0x2ef058[_0xbd03('0x47')],null))['then'](respondWithResult(_0x46def6,null))[_0xbd03('0x4c')](handleError(_0x46def6,null));};exports['destroy']=function(_0x5d2cea,_0x263123){return db[_0xbd03('0x2b')][_0xbd03('0x45')]({'where':{'id':_0x5d2cea[_0xbd03('0x42')]['id']}})[_0xbd03('0x20')](handleEntityNotFound(_0x263123,null))[_0xbd03('0x20')](removeEntity(_0x263123,null))[_0xbd03('0x4c')](handleError(_0x263123,null));};exports['download']=function(_0x4a1611,_0x30c447,_0x5e953d){return db[_0xbd03('0x2b')][_0xbd03('0x45')]({'where':{'id':_0x4a1611[_0xbd03('0x42')]['id']},'attributes':[_0xbd03('0x27'),'basename','savename',_0xbd03('0x4e')],'raw':!![]})[_0xbd03('0x20')](handleEntityNotFound(_0x30c447,null))[_0xbd03('0x20')](function(_0x4a603e){if(_0x4a603e){if(!fs['existsSync'](path[_0xbd03('0x4f')](config[_0xbd03('0x50')],_0xbd03('0x51'),_0x4a603e[_0xbd03('0x52')]))){throw new db[(_0xbd03('0x53'))][(_0xbd03('0x54'))](_0xbd03('0x55'));}if(_0x4a1611['query'][_0xbd03('0x56')]){return _0x30c447[_0xbd03('0x24')](0xc8);}return _0x30c447[_0xbd03('0x57')](path[_0xbd03('0x4f')](config['root'],'server/files/reports',_0x4a603e[_0xbd03('0x52')]),util[_0xbd03('0x58')]('%s.%s',_0x4a603e[_0xbd03('0x59')]||_0x4a603e['name'],_0x4a603e[_0xbd03('0x4e')][_0xbd03('0x5a')]()));}})[_0xbd03('0x4c')](handleError(_0x30c447,null));}; \ No newline at end of file +var _0x34a0=['toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','AnalyticExtractedReport','include','findAll','rows','catch','show','params','includeAll','options','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','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s'];(function(_0x4197f6,_0x154a2b){var _0x574a38=function(_0x2897ec){while(--_0x2897ec){_0x4197f6['push'](_0x4197f6['shift']());}};_0x574a38(++_0x154a2b);}(_0x34a0,0x127));var _0x034a=function(_0x40e19a,_0x4168eb){_0x40e19a=_0x40e19a-0x0;var _0x18ff6d=_0x34a0[_0x40e19a];return _0x18ff6d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x034a('0x0'));var jsonpatch=require(_0x034a('0x1'));var rp=require(_0x034a('0x2'));var moment=require(_0x034a('0x3'));var BPromise=require(_0x034a('0x4'));var Mustache=require(_0x034a('0x5'));var util=require('util');var path=require(_0x034a('0x6'));var sox=require(_0x034a('0x7'));var csv=require(_0x034a('0x8'));var ejs=require(_0x034a('0x9'));var fs=require('fs');var fs_extra=require(_0x034a('0xa'));var _=require(_0x034a('0xb'));var squel=require(_0x034a('0xc'));var crypto=require('crypto');var jsforce=require(_0x034a('0xd'));var deskjs=require(_0x034a('0xe'));var toCsv=require(_0x034a('0x8'));var querystring=require('querystring');var Papa=require(_0x034a('0xf'));var Redis=require(_0x034a('0x10'));var authService=require(_0x034a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x034a('0x12'));var hardwareService=require(_0x034a('0x13'));var logger=require(_0x034a('0x14'))(_0x034a('0x15'));var utils=require(_0x034a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x034a('0x17'))['db'];function respondWithStatusCode(_0x3ef873,_0x48b2f4){_0x48b2f4=_0x48b2f4||0xcc;return function(_0x52095e){if(_0x52095e){return _0x3ef873[_0x034a('0x18')](_0x48b2f4);}return _0x3ef873[_0x034a('0x19')](_0x48b2f4)[_0x034a('0x1a')]();};}function respondWithResult(_0x554348,_0x10a6d0){_0x10a6d0=_0x10a6d0||0xc8;return function(_0xf13939){if(_0xf13939){return _0x554348[_0x034a('0x19')](_0x10a6d0)['json'](_0xf13939);}};}function respondWithFilteredResult(_0x1c55f2,_0x5ac27e){return function(_0x1d9fa3){if(_0x1d9fa3){var _0x38ad68=typeof _0x5ac27e['offset']===_0x034a('0x1b')&&typeof _0x5ac27e[_0x034a('0x1c')]==='undefined';var _0x31b4f1=_0x1d9fa3[_0x034a('0x1d')];var _0x2a00e6=_0x38ad68?0x0:_0x5ac27e[_0x034a('0x1e')];var _0x14b407=_0x38ad68?_0x1d9fa3[_0x034a('0x1d')]:_0x5ac27e['offset']+_0x5ac27e[_0x034a('0x1c')];var _0x373e2d;if(_0x14b407>=_0x31b4f1){_0x14b407=_0x31b4f1;_0x373e2d=0xc8;}else{_0x373e2d=0xce;}_0x1c55f2[_0x034a('0x19')](_0x373e2d);return _0x1c55f2[_0x034a('0x1f')](_0x034a('0x20'),_0x2a00e6+'-'+_0x14b407+'/'+_0x31b4f1)['json'](_0x1d9fa3);}return null;};}function patchUpdates(_0x2a1c6d){return function(_0xb12908){try{jsonpatch['apply'](_0xb12908,_0x2a1c6d,!![]);}catch(_0x495119){return BPromise[_0x034a('0x21')](_0x495119);}return _0xb12908['save']();};}function saveUpdates(_0x55309d,_0x4fa9db){return function(_0x2a4513){if(_0x2a4513){return _0x2a4513[_0x034a('0x22')](_0x55309d)[_0x034a('0x23')](function(_0x5ce5e8){return _0x5ce5e8;});}return null;};}function removeEntity(_0x58b21f,_0x4a5bf5){return function(_0x1f29dc){if(_0x1f29dc){return _0x1f29dc[_0x034a('0x24')]()[_0x034a('0x23')](function(){var _0x2d5f9a=_0x1f29dc[_0x034a('0x25')]({'plain':!![]});var _0x5eadda=_0x034a('0x26');return db[_0x034a('0x27')][_0x034a('0x24')]({'where':{'type':_0x5eadda,'resourceId':_0x2d5f9a['id']}})['then'](function(){return _0x1f29dc;});})[_0x034a('0x23')](function(){_0x58b21f[_0x034a('0x19')](0xcc)[_0x034a('0x1a')]();});}};}function handleEntityNotFound(_0x25cdce,_0x1aeb86){return function(_0x5827dc){if(!_0x5827dc){_0x25cdce[_0x034a('0x18')](0x194);}return _0x5827dc;};}function handleError(_0x46fde1,_0x4f6404){_0x4f6404=_0x4f6404||0x1f4;return function(_0x53e641){logger['error'](_0x53e641[_0x034a('0x28')]);if(_0x53e641['name']){delete _0x53e641[_0x034a('0x29')];}_0x46fde1[_0x034a('0x19')](_0x4f6404)[_0x034a('0x2a')](_0x53e641);};}exports['index']=function(_0x146c40,_0x2a5c87){var _0x330adc={},_0x2ef705={},_0x237c3a={'count':0x0,'rows':[]};var _0x4b6000=_['map'](db['AnalyticExtractedReport'][_0x034a('0x2b')],function(_0x16db0f){return{'name':_0x16db0f[_0x034a('0x2c')],'type':_0x16db0f[_0x034a('0x2d')][_0x034a('0x2e')]};});_0x2ef705[_0x034a('0x2f')]=_[_0x034a('0x30')](_0x4b6000,_0x034a('0x29'));_0x2ef705[_0x034a('0x31')]=_[_0x034a('0x32')](_0x146c40[_0x034a('0x31')]);_0x2ef705[_0x034a('0x33')]=_[_0x034a('0x34')](_0x2ef705[_0x034a('0x2f')],_0x2ef705[_0x034a('0x31')]);_0x330adc[_0x034a('0x35')]=_[_0x034a('0x34')](_0x2ef705['model'],qs['fields'](_0x146c40[_0x034a('0x31')][_0x034a('0x36')]));_0x330adc[_0x034a('0x35')]=_0x330adc[_0x034a('0x35')][_0x034a('0x37')]?_0x330adc[_0x034a('0x35')]:_0x2ef705[_0x034a('0x2f')];if(!_0x146c40['query'][_0x034a('0x38')]('nolimit')){_0x330adc[_0x034a('0x1c')]=qs['limit'](_0x146c40[_0x034a('0x31')]['limit']);_0x330adc['offset']=qs[_0x034a('0x1e')](_0x146c40[_0x034a('0x31')][_0x034a('0x1e')]);}_0x330adc['order']=qs[_0x034a('0x39')](_0x146c40[_0x034a('0x31')]['sort']);_0x330adc[_0x034a('0x3a')]=qs[_0x034a('0x33')](_[_0x034a('0x3b')](_0x146c40[_0x034a('0x31')],_0x2ef705[_0x034a('0x33')]),_0x4b6000);if(_0x146c40[_0x034a('0x31')][_0x034a('0x3c')]){_0x330adc[_0x034a('0x3a')]=_[_0x034a('0x3d')](_0x330adc['where'],{'$or':_['map'](_0x4b6000,function(_0xaa7ef9){if(_0xaa7ef9[_0x034a('0x2d')]!==_0x034a('0x3e')){var _0x22272a={};_0x22272a[_0xaa7ef9[_0x034a('0x29')]]={'$like':'%'+_0x146c40['query'][_0x034a('0x3c')]+'%'};return _0x22272a;}})});}_0x330adc=_[_0x034a('0x3d')]({},_0x330adc,_0x146c40['options']);var _0x5d0fc5={'where':_0x330adc[_0x034a('0x3a')]};return db[_0x034a('0x3f')][_0x034a('0x1d')](_0x5d0fc5)[_0x034a('0x23')](function(_0x492b6e){_0x237c3a[_0x034a('0x1d')]=_0x492b6e;if(_0x146c40[_0x034a('0x31')]['includeAll']){_0x330adc[_0x034a('0x40')]=[{'all':!![]}];}return db[_0x034a('0x3f')][_0x034a('0x41')](_0x330adc);})[_0x034a('0x23')](function(_0x231326){_0x237c3a[_0x034a('0x42')]=_0x231326;return _0x237c3a;})[_0x034a('0x23')](respondWithFilteredResult(_0x2a5c87,_0x330adc))[_0x034a('0x43')](handleError(_0x2a5c87,null));};exports[_0x034a('0x44')]=function(_0x3025bd,_0x7edd7){var _0x1abd6b={'raw':!![],'where':{'id':_0x3025bd[_0x034a('0x45')]['id']}},_0x36af9f={};_0x36af9f['model']=_[_0x034a('0x32')](db[_0x034a('0x3f')][_0x034a('0x2b')]);_0x36af9f['query']=_[_0x034a('0x32')](_0x3025bd[_0x034a('0x31')]);_0x36af9f[_0x034a('0x33')]=_['intersection'](_0x36af9f[_0x034a('0x2f')],_0x36af9f[_0x034a('0x31')]);_0x1abd6b[_0x034a('0x35')]=_[_0x034a('0x34')](_0x36af9f['model'],qs[_0x034a('0x36')](_0x3025bd[_0x034a('0x31')][_0x034a('0x36')]));_0x1abd6b[_0x034a('0x35')]=_0x1abd6b[_0x034a('0x35')][_0x034a('0x37')]?_0x1abd6b['attributes']:_0x36af9f['model'];if(_0x3025bd[_0x034a('0x31')][_0x034a('0x46')]){_0x1abd6b[_0x034a('0x40')]=[{'all':!![]}];}_0x1abd6b=_[_0x034a('0x3d')]({},_0x1abd6b,_0x3025bd[_0x034a('0x47')]);return db[_0x034a('0x3f')][_0x034a('0x48')](_0x1abd6b)[_0x034a('0x23')](handleEntityNotFound(_0x7edd7,null))[_0x034a('0x23')](respondWithResult(_0x7edd7,null))[_0x034a('0x43')](handleError(_0x7edd7,null));};exports[_0x034a('0x49')]=function(_0x597891,_0x1cf59c){return db[_0x034a('0x3f')][_0x034a('0x49')](_0x597891[_0x034a('0x4a')],{})[_0x034a('0x23')](function(_0x5ebc94){var _0x306e65=_0x597891[_0x034a('0x4b')]['get']({'plain':!![]});if(!_0x306e65)throw new Error(_0x034a('0x4c'));if(_0x306e65[_0x034a('0x4d')]===_0x034a('0x4b')){var _0x312b89=_0x5ebc94[_0x034a('0x25')]({'plain':!![]});var _0x38fff5=_0x034a('0x26');return db[_0x034a('0x4e')][_0x034a('0x48')]({'where':{'name':_0x38fff5,'userProfileId':_0x306e65[_0x034a('0x4f')]},'raw':!![]})[_0x034a('0x23')](function(_0x469edd){if(_0x469edd&&_0x469edd[_0x034a('0x50')]===0x0){return db['UserProfileResource'][_0x034a('0x49')]({'name':_0x312b89[_0x034a('0x29')],'resourceId':_0x312b89['id'],'type':_0x469edd[_0x034a('0x29')],'sectionId':_0x469edd['id']},{})[_0x034a('0x23')](function(){return _0x5ebc94;});}else{return _0x5ebc94;}})[_0x034a('0x43')](function(_0xc89c43){logger[_0x034a('0x51')](_0x034a('0x52'),_0xc89c43);throw _0xc89c43;});}return _0x5ebc94;})[_0x034a('0x23')](respondWithResult(_0x1cf59c,0xc9))['catch'](handleError(_0x1cf59c,null));};exports[_0x034a('0x22')]=function(_0x467bfc,_0x36b359){if(_0x467bfc[_0x034a('0x4a')]['id']){delete _0x467bfc['body']['id'];}return db['AnalyticExtractedReport'][_0x034a('0x48')]({'where':{'id':_0x467bfc[_0x034a('0x45')]['id']}})[_0x034a('0x23')](handleEntityNotFound(_0x36b359,null))[_0x034a('0x23')](saveUpdates(_0x467bfc['body'],null))['then'](respondWithResult(_0x36b359,null))['catch'](handleError(_0x36b359,null));};exports['destroy']=function(_0x4b791c,_0x1ffdb2){return db[_0x034a('0x3f')][_0x034a('0x48')]({'where':{'id':_0x4b791c[_0x034a('0x45')]['id']}})[_0x034a('0x23')](handleEntityNotFound(_0x1ffdb2,null))[_0x034a('0x23')](removeEntity(_0x1ffdb2,null))[_0x034a('0x43')](handleError(_0x1ffdb2,null));};exports[_0x034a('0x53')]=function(_0x54a94a,_0x36886a,_0x3622cc){return db[_0x034a('0x3f')][_0x034a('0x48')]({'where':{'id':_0x54a94a[_0x034a('0x45')]['id']},'attributes':[_0x034a('0x29'),_0x034a('0x54'),'savename',_0x034a('0x55')],'raw':!![]})[_0x034a('0x23')](handleEntityNotFound(_0x36886a,null))[_0x034a('0x23')](function(_0xc3fcb5){if(_0xc3fcb5){if(!fs[_0x034a('0x56')](path[_0x034a('0x57')](config[_0x034a('0x58')],_0x034a('0x59'),_0xc3fcb5[_0x034a('0x5a')]))){throw new db[(_0x034a('0x5b'))][(_0x034a('0x5c'))](_0x034a('0x5d'));}if(_0x54a94a[_0x034a('0x31')][_0x034a('0x5e')]){return _0x36886a[_0x034a('0x18')](0xc8);}return _0x36886a[_0x034a('0x53')](path[_0x034a('0x57')](config[_0x034a('0x58')],'server/files/reports',_0xc3fcb5[_0x034a('0x5a')]),util[_0x034a('0x5f')](_0x034a('0x60'),_0xc3fcb5[_0x034a('0x54')]||_0xc3fcb5[_0x034a('0x29')],_0xc3fcb5['output'][_0x034a('0x61')]()));}})[_0x034a('0x43')](handleError(_0x36886a,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2fec428..94c84f7 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 _0x8941=['define','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x2d06c4,_0x42e058){var _0x114856=function(_0x13c03b){while(--_0x13c03b){_0x2d06c4['push'](_0x2d06c4['shift']());}};_0x114856(++_0x42e058);}(_0x8941,0x1be));var _0x1894=function(_0x5c62b2,_0x92040c){_0x5c62b2=_0x5c62b2-0x0;var _0x26a129=_0x8941[_0x5c62b2];return _0x26a129;};'use strict';var _=require(_0x1894('0x0'));var util=require(_0x1894('0x1'));var logger=require(_0x1894('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1894('0x3'));var rp=require(_0x1894('0x4'));var fs=require('fs');var path=require(_0x1894('0x5'));var rimraf=require(_0x1894('0x6'));var config=require(_0x1894('0x7'));var attributes=require(_0x1894('0x8'));module[_0x1894('0x9')]=function(_0x388204,_0x2baa05){return _0x388204[_0x1894('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x1894('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e68=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2e68,0x12b));var _0x82e6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2e68[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x82e6('0x0'));var logger=require('../../config/logger')(_0x82e6('0x1'));var moment=require(_0x82e6('0x2'));var BPromise=require(_0x82e6('0x3'));var rp=require(_0x82e6('0x4'));var fs=require('fs');var path=require(_0x82e6('0x5'));var rimraf=require(_0x82e6('0x6'));var config=require(_0x82e6('0x7'));var attributes=require(_0x82e6('0x8'));module[_0x82e6('0x9')]=function(_0x587f09,_0x33ca56){return _0x587f09[_0x82e6('0xa')](_0x82e6('0xb'),attributes,{'tableName':_0x82e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 34d9203..0b0bf81 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 _0xd150=['client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27e481,_0x3d3268){var _0x233ca8=function(_0x2101cf){while(--_0x2101cf){_0x27e481['push'](_0x27e481['shift']());}};_0x233ca8(++_0x3d3268);}(_0xd150,0x114));var _0x0d15=function(_0x25ce73,_0x51c91c){_0x25ce73=_0x25ce73-0x0;var _0x151080=_0xd150[_0x25ce73];return _0x151080;};'use strict';var _=require(_0x0d15('0x0'));var util=require(_0x0d15('0x1'));var moment=require(_0x0d15('0x2'));var BPromise=require(_0x0d15('0x3'));var rs=require(_0x0d15('0x4'));var fs=require('fs');var Redis=require(_0x0d15('0x5'));var db=require(_0x0d15('0x6'))['db'];var utils=require(_0x0d15('0x7'));var logger=require(_0x0d15('0x8'))(_0x0d15('0x9'));var config=require(_0x0d15('0xa'));var jayson=require(_0x0d15('0xb'));var client=jayson[_0x0d15('0xc')][_0x0d15('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x995842,_0x4784cb,_0xa17e7b){return new BPromise(function(_0x36ddc9,_0x413863){return client[_0x0d15('0xe')](_0x995842,_0xa17e7b)['then'](function(_0xc5fbb4){logger[_0x0d15('0xf')](_0x0d15('0x10'),_0x4784cb,'request\x20sent');logger[_0x0d15('0x11')](_0x0d15('0x12'),_0x4784cb,_0x0d15('0x13'),JSON['stringify'](_0xc5fbb4));if(_0xc5fbb4[_0x0d15('0x14')]){if(_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x15')]===0x1f4){logger[_0x0d15('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4784cb,_0xc5fbb4['error']['message']);return _0x413863(_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x16')]);}logger[_0x0d15('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4784cb,_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x16')]);return _0x36ddc9(_0xc5fbb4[_0x0d15('0x14')][_0x0d15('0x16')]);}else{logger[_0x0d15('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4784cb,'request\x20sent');_0x36ddc9(_0xc5fbb4[_0x0d15('0x17')][_0x0d15('0x16')]);}})['catch'](function(_0x37afda){logger[_0x0d15('0x14')](_0x0d15('0x10'),_0x4784cb,_0x37afda);_0x413863(_0x37afda);});});} \ No newline at end of file +var _0x1aac=['info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x454df6,_0x43684b){var _0x5e389e=function(_0x2b14de){while(--_0x2b14de){_0x454df6['push'](_0x454df6['shift']());}};_0x5e389e(++_0x43684b);}(_0x1aac,0x6b));var _0xc1aa=function(_0x637a8d,_0x3e7e6d){_0x637a8d=_0x637a8d-0x0;var _0x1a94bd=_0x1aac[_0x637a8d];return _0x1a94bd;};'use strict';var _=require(_0xc1aa('0x0'));var util=require(_0xc1aa('0x1'));var moment=require(_0xc1aa('0x2'));var BPromise=require(_0xc1aa('0x3'));var rs=require(_0xc1aa('0x4'));var fs=require('fs');var Redis=require(_0xc1aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1aa('0x6'));var logger=require('../../config/logger')(_0xc1aa('0x7'));var config=require(_0xc1aa('0x8'));var jayson=require(_0xc1aa('0x9'));var client=jayson[_0xc1aa('0xa')][_0xc1aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4de411,_0x19f8d6,_0x1e945e){return new BPromise(function(_0x1c3d32,_0x222c95){return client[_0xc1aa('0xc')](_0x4de411,_0x1e945e)['then'](function(_0x4de6a9){logger[_0xc1aa('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19f8d6,_0xc1aa('0xe'));logger['debug'](_0xc1aa('0xf'),_0x19f8d6,_0xc1aa('0xe'),JSON['stringify'](_0x4de6a9));if(_0x4de6a9[_0xc1aa('0x10')]){if(_0x4de6a9['error']['code']===0x1f4){logger[_0xc1aa('0x10')](_0xc1aa('0x11'),_0x19f8d6,_0x4de6a9[_0xc1aa('0x10')]['message']);return _0x222c95(_0x4de6a9[_0xc1aa('0x10')]['message']);}logger[_0xc1aa('0x10')](_0xc1aa('0x11'),_0x19f8d6,_0x4de6a9[_0xc1aa('0x10')][_0xc1aa('0x12')]);return _0x1c3d32(_0x4de6a9[_0xc1aa('0x10')]['message']);}else{logger[_0xc1aa('0xd')](_0xc1aa('0x11'),_0x19f8d6,_0xc1aa('0xe'));_0x1c3d32(_0x4de6a9[_0xc1aa('0x13')][_0xc1aa('0x12')]);}})['catch'](function(_0x1035ab){logger['error'](_0xc1aa('0x11'),_0x19f8d6,_0x1035ab);_0x222c95(_0x1035ab);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index bd059db..2f288ab 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 _0xc619=['show','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5f3f60,_0x5623b3){var _0x3f0e96=function(_0x2cd826){while(--_0x2cd826){_0x5f3f60['push'](_0x5f3f60['shift']());}};_0x3f0e96(++_0x5623b3);}(_0xc619,0x1d6));var _0x9c61=function(_0x4d7e5d,_0xa3ddfc){_0x4d7e5d=_0x4d7e5d-0x0;var _0x44414d=_0xc619[_0x4d7e5d];return _0x44414d;};'use strict';var multer=require(_0x9c61('0x0'));var util=require(_0x9c61('0x1'));var path=require(_0x9c61('0x2'));var timeout=require(_0x9c61('0x3'));var express=require(_0x9c61('0x4'));var router=express[_0x9c61('0x5')]();var fs_extra=require(_0x9c61('0x6'));var auth=require(_0x9c61('0x7'));var interaction=require(_0x9c61('0x8'));var config=require(_0x9c61('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0x9c61('0xa')]('/',auth[_0x9c61('0xb')](),controller[_0x9c61('0xc')]);router[_0x9c61('0xa')](_0x9c61('0xd'),auth[_0x9c61('0xb')](),controller[_0x9c61('0xe')]);router[_0x9c61('0xa')]('/:id/download',auth[_0x9c61('0xb')](),controller[_0x9c61('0xf')]);router[_0x9c61('0x10')]('/',auth['isAuthenticated'](),controller[_0x9c61('0x11')]);router[_0x9c61('0x12')](_0x9c61('0xd'),auth[_0x9c61('0xb')](),controller['update']);router[_0x9c61('0x13')](_0x9c61('0xd'),auth[_0x9c61('0xb')](),controller[_0x9c61('0x14')]);module[_0x9c61('0x15')]=router; \ No newline at end of file +var _0x1515=['/:id','show','download','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1515,0x103));var _0x5151=function(_0x5d492a,_0x3c5195){_0x5d492a=_0x5d492a-0x0;var _0x4d8cc7=_0x1515[_0x5d492a];return _0x4d8cc7;};'use strict';var multer=require(_0x5151('0x0'));var util=require(_0x5151('0x1'));var path=require('path');var timeout=require(_0x5151('0x2'));var express=require(_0x5151('0x3'));var router=express[_0x5151('0x4')]();var fs_extra=require(_0x5151('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5151('0x6'));var config=require(_0x5151('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x5151('0x8')]('/',auth[_0x5151('0x9')](),controller[_0x5151('0xa')]);router[_0x5151('0x8')](_0x5151('0xb'),auth['isAuthenticated'](),controller[_0x5151('0xc')]);router[_0x5151('0x8')]('/:id/download',auth[_0x5151('0x9')](),controller[_0x5151('0xd')]);router['post']('/',auth[_0x5151('0x9')](),controller['create']);router[_0x5151('0xe')](_0x5151('0xb'),auth[_0x5151('0x9')](),controller[_0x5151('0xf')]);router[_0x5151('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5151('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index f5b9384..888dc4d 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 _0x449e=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0xd19cc9,_0x2a7558){var _0x3c0395=function(_0xc05178){while(--_0xc05178){_0xd19cc9['push'](_0xd19cc9['shift']());}};_0x3c0395(++_0x2a7558);}(_0x449e,0x184));var _0xe449=function(_0x46910c,_0x3bb530){_0x46910c=_0x46910c-0x0;var _0x1dfcd4=_0x449e[_0x46910c];return _0x1dfcd4;};'use strict';var Sequelize=require(_0xe449('0x0'));module[_0xe449('0x1')]={'field':{'type':Sequelize[_0xe449('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe449('0x3')]},'format':{'type':Sequelize[_0xe449('0x3')]},'groupBy':{'type':Sequelize[_0xe449('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe449('0x3')]},'custom':{'type':Sequelize[_0xe449('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x17f9=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1ed99c,_0x52bb43){var _0x19c308=function(_0x57fe15){while(--_0x57fe15){_0x1ed99c['push'](_0x1ed99c['shift']());}};_0x19c308(++_0x52bb43);}(_0x17f9,0x1b8));var _0x917f=function(_0x18e9a3,_0x276495){_0x18e9a3=_0x18e9a3-0x0;var _0x214569=_0x17f9[_0x18e9a3];return _0x214569;};'use strict';var Sequelize=require(_0x917f('0x0'));module[_0x917f('0x1')]={'field':{'type':Sequelize[_0x917f('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x917f('0x3')]},'format':{'type':Sequelize[_0x917f('0x3')]},'groupBy':{'type':Sequelize[_0x917f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x917f('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 561d428..9b78642 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 _0x466c=['ids','AnalyticCustomReport','findOne','CustomReportId','findAll','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','model','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','bulkCreate','update','bulkDestroy'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x466c,0xef));var _0xc466=function(_0x435332,_0x30e9b4){_0x435332=_0x435332-0x0;var _0x4be29f=_0x466c[_0x435332];return _0x4be29f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc466('0x0'));var moment=require(_0xc466('0x1'));var BPromise=require(_0xc466('0x2'));var Mustache=require(_0xc466('0x3'));var util=require(_0xc466('0x4'));var path=require(_0xc466('0x5'));var sox=require('sox');var csv=require(_0xc466('0x6'));var ejs=require(_0xc466('0x7'));var fs=require('fs');var fs_extra=require(_0xc466('0x8'));var _=require(_0xc466('0x9'));var squel=require('squel');var crypto=require(_0xc466('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc466('0xb'));var toCsv=require(_0xc466('0x6'));var querystring=require(_0xc466('0xc'));var Papa=require(_0xc466('0xd'));var Redis=require(_0xc466('0xe'));var authService=require(_0xc466('0xf'));var qs=require(_0xc466('0x10'));var as=require(_0xc466('0x11'));var hardwareService=require(_0xc466('0x12'));var logger=require(_0xc466('0x13'))(_0xc466('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc466('0x15'));var db=require(_0xc466('0x16'))['db'];function respondWithStatusCode(_0xad4c6b,_0x421512){_0x421512=_0x421512||0xcc;return function(_0x5e3467){if(_0x5e3467){return _0xad4c6b[_0xc466('0x17')](_0x421512);}return _0xad4c6b[_0xc466('0x18')](_0x421512)[_0xc466('0x19')]();};}function respondWithResult(_0x448869,_0x336f8c){_0x336f8c=_0x336f8c||0xc8;return function(_0x2ec1d8){if(_0x2ec1d8){return _0x448869['status'](_0x336f8c)[_0xc466('0x1a')](_0x2ec1d8);}};}function respondWithFilteredResult(_0x4e6ddb,_0xdac28f){return function(_0x40f22d){if(_0x40f22d){var _0x1d31c2=typeof _0xdac28f['offset']===_0xc466('0x1b')&&typeof _0xdac28f[_0xc466('0x1c')]===_0xc466('0x1b');var _0x502265=_0x40f22d[_0xc466('0x1d')];var _0x52ec81=_0x1d31c2?0x0:_0xdac28f['offset'];var _0x40f322=_0x1d31c2?_0x40f22d['count']:_0xdac28f[_0xc466('0x1e')]+_0xdac28f[_0xc466('0x1c')];var _0x372a13;if(_0x40f322>=_0x502265){_0x40f322=_0x502265;_0x372a13=0xc8;}else{_0x372a13=0xce;}_0x4e6ddb[_0xc466('0x18')](_0x372a13);return _0x4e6ddb[_0xc466('0x1f')](_0xc466('0x20'),_0x52ec81+'-'+_0x40f322+'/'+_0x502265)[_0xc466('0x1a')](_0x40f22d);}return null;};}function patchUpdates(_0x26724a){return function(_0x1732e6){try{jsonpatch['apply'](_0x1732e6,_0x26724a,!![]);}catch(_0x29285f){return BPromise[_0xc466('0x21')](_0x29285f);}return _0x1732e6['save']();};}function saveUpdates(_0x3d3bff,_0x3c2815){return function(_0x423407){if(_0x423407){return _0x423407['update'](_0x3d3bff)[_0xc466('0x22')](function(_0x20319b){return _0x20319b;});}return null;};}function removeEntity(_0x198ed8,_0x3c33ed){return function(_0x1ebcdd){if(_0x1ebcdd){return _0x1ebcdd[_0xc466('0x23')]()['then'](function(){_0x198ed8[_0xc466('0x18')](0xcc)[_0xc466('0x19')]();});}};}function handleEntityNotFound(_0x63432e,_0x338f85){return function(_0x4e6767){if(!_0x4e6767){_0x63432e['sendStatus'](0x194);}return _0x4e6767;};}function handleError(_0x1cd404,_0x19f3c8){_0x19f3c8=_0x19f3c8||0x1f4;return function(_0x4579b8){logger[_0xc466('0x24')](_0x4579b8[_0xc466('0x25')]);if(_0x4579b8[_0xc466('0x26')]){delete _0x4579b8['name'];}_0x1cd404[_0xc466('0x18')](_0x19f3c8)[_0xc466('0x27')](_0x4579b8);};}exports[_0xc466('0x28')]=function(_0x5b56dc,_0x4db771){var _0x214831={},_0x5e4708={},_0x407f93={'count':0x0,'rows':[]};var _0x372071=_[_0xc466('0x29')](db[_0xc466('0x2a')]['rawAttributes'],function(_0x5d048b){return{'name':_0x5d048b[_0xc466('0x2b')],'type':_0x5d048b[_0xc466('0x2c')]['key']};});_0x5e4708[_0xc466('0x2d')]=_['map'](_0x372071,'name');_0x5e4708['query']=_[_0xc466('0x2e')](_0x5b56dc['query']);_0x5e4708['filters']=_[_0xc466('0x2f')](_0x5e4708[_0xc466('0x2d')],_0x5e4708[_0xc466('0x30')]);_0x214831[_0xc466('0x31')]=_['intersection'](_0x5e4708[_0xc466('0x2d')],qs[_0xc466('0x32')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x32')]));_0x214831[_0xc466('0x31')]=_0x214831[_0xc466('0x31')][_0xc466('0x33')]?_0x214831[_0xc466('0x31')]:_0x5e4708['model'];if(!_0x5b56dc[_0xc466('0x30')]['hasOwnProperty'](_0xc466('0x34'))){_0x214831[_0xc466('0x1c')]=qs[_0xc466('0x1c')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x1c')]);_0x214831[_0xc466('0x1e')]=qs[_0xc466('0x1e')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x1e')]);}_0x214831[_0xc466('0x35')]=qs[_0xc466('0x36')](_0x5b56dc[_0xc466('0x30')][_0xc466('0x36')]);_0x214831[_0xc466('0x37')]=qs['filters'](_[_0xc466('0x38')](_0x5b56dc[_0xc466('0x30')],_0x5e4708[_0xc466('0x39')]),_0x372071);if(_0x5b56dc[_0xc466('0x30')][_0xc466('0x3a')]){_0x214831[_0xc466('0x37')]=_[_0xc466('0x3b')](_0x214831['where'],{'$or':_[_0xc466('0x29')](_0x372071,function(_0x294355){if(_0x294355[_0xc466('0x2c')]!==_0xc466('0x3c')){var _0x5611dd={};_0x5611dd[_0x294355[_0xc466('0x26')]]={'$like':'%'+_0x5b56dc[_0xc466('0x30')][_0xc466('0x3a')]+'%'};return _0x5611dd;}})});}_0x214831=_[_0xc466('0x3b')]({},_0x214831,_0x5b56dc[_0xc466('0x3d')]);var _0x285f5c={'where':_0x214831[_0xc466('0x37')]};return db['AnalyticFieldReport'][_0xc466('0x1d')](_0x285f5c)['then'](function(_0x12a308){_0x407f93[_0xc466('0x1d')]=_0x12a308;if(_0x5b56dc[_0xc466('0x30')][_0xc466('0x3e')]){_0x214831[_0xc466('0x3f')]=[{'all':!![]}];}return db[_0xc466('0x2a')]['findAll'](_0x214831);})['then'](function(_0x301382){_0x407f93[_0xc466('0x40')]=_0x301382;return _0x407f93;})[_0xc466('0x22')](respondWithFilteredResult(_0x4db771,_0x214831))[_0xc466('0x41')](handleError(_0x4db771,null));};exports['show']=function(_0x1174d7,_0x531cce){var _0x2e04dd={'raw':![],'where':{'id':_0x1174d7[_0xc466('0x42')]['id']}},_0xa528d4={};_0xa528d4[_0xc466('0x2d')]=_[_0xc466('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0xa528d4[_0xc466('0x30')]=_[_0xc466('0x2e')](_0x1174d7[_0xc466('0x30')]);_0xa528d4[_0xc466('0x39')]=_[_0xc466('0x2f')](_0xa528d4['model'],_0xa528d4[_0xc466('0x30')]);_0x2e04dd[_0xc466('0x31')]=_[_0xc466('0x2f')](_0xa528d4[_0xc466('0x2d')],qs[_0xc466('0x32')](_0x1174d7[_0xc466('0x30')][_0xc466('0x32')]));_0x2e04dd[_0xc466('0x31')]=_0x2e04dd['attributes'][_0xc466('0x33')]?_0x2e04dd['attributes']:_0xa528d4[_0xc466('0x2d')];if(_0x1174d7[_0xc466('0x30')]['includeAll']){_0x2e04dd['include']=[{'all':!![]}];}_0x2e04dd=_[_0xc466('0x3b')]({},_0x2e04dd,_0x1174d7[_0xc466('0x3d')]);return db[_0xc466('0x2a')][_0xc466('0x43')](_0x2e04dd)[_0xc466('0x22')](handleEntityNotFound(_0x531cce,null))[_0xc466('0x22')](respondWithResult(_0x531cce,null))['catch'](handleError(_0x531cce,null));};exports['create']=function(_0x289b24,_0x4c5abb){return db[_0xc466('0x2a')][_0xc466('0x44')](_0x289b24[_0xc466('0x45')],{})[_0xc466('0x22')](respondWithResult(_0x4c5abb,0xc9))[_0xc466('0x41')](handleError(_0x4c5abb,null));};exports[_0xc466('0x46')]=function(_0x4a07ff,_0xd6148b){return db[_0xc466('0x2a')][_0xc466('0x46')](_0x4a07ff[_0xc466('0x45')],{'raw':![],'individualHooks':!![]})[_0xc466('0x22')](respondWithResult(_0xd6148b,0xc9))[_0xc466('0x41')](handleError(_0xd6148b,null));};exports[_0xc466('0x47')]=function(_0x3b2bb5,_0x28e4d7){if(_0x3b2bb5[_0xc466('0x45')]['id']){delete _0x3b2bb5[_0xc466('0x45')]['id'];}return db[_0xc466('0x2a')]['find']({'where':{'id':_0x3b2bb5[_0xc466('0x42')]['id']}})['then'](handleEntityNotFound(_0x28e4d7,null))[_0xc466('0x22')](saveUpdates(_0x3b2bb5[_0xc466('0x45')],null))[_0xc466('0x22')](respondWithResult(_0x28e4d7,null))[_0xc466('0x41')](handleError(_0x28e4d7,null));};exports[_0xc466('0x23')]=function(_0x475f57,_0x45d925){return db['AnalyticFieldReport'][_0xc466('0x43')]({'where':{'id':_0x475f57[_0xc466('0x42')]['id']}})[_0xc466('0x22')](handleEntityNotFound(_0x45d925,null))[_0xc466('0x22')](removeEntity(_0x45d925,null))[_0xc466('0x41')](handleError(_0x45d925,null));};exports[_0xc466('0x48')]=function(_0x1be587,_0x176014){return db[_0xc466('0x2a')][_0xc466('0x23')]({'where':{'id':_0x1be587[_0xc466('0x30')][_0xc466('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xc466('0x22')](respondWithResult(_0x176014,0xcc))[_0xc466('0x41')](handleError(_0x176014,null));};exports['addFields']=function(_0x46e5ba,_0x32a729,_0x124015){return db[_0xc466('0x4a')][_0xc466('0x4b')]({'where':{'id':_0x46e5ba[_0xc466('0x42')]['id']}})[_0xc466('0x22')](handleEntityNotFound(_0x32a729,null))[_0xc466('0x22')](function(_0x2b9b82){if(_0x2b9b82){return db['sequelize']['transaction'](function(_0x81cb18){return db[_0xc466('0x2a')][_0xc466('0x23')]({'where':{'CustomReportId':_0x46e5ba[_0xc466('0x42')]['id']},'transaction':_0x81cb18})['then'](function(_0xabee22){var _0x10797e=_[_0xc466('0x29')](_0x46e5ba[_0xc466('0x45')],function(_0x50dbab){delete _0x50dbab['id'];_0x50dbab[_0xc466('0x4c')]=_0x46e5ba[_0xc466('0x42')]['id'];return _0x50dbab;});return db[_0xc466('0x2a')]['bulkCreate'](_0x10797e,{'transaction':_0x81cb18});});})[_0xc466('0x22')](function(){return db[_0xc466('0x2a')][_0xc466('0x4d')]({'where':{'CustomReportId':_0x46e5ba[_0xc466('0x42')]['id']}});});}})[_0xc466('0x22')](respondWithResult(_0x32a729,null))['catch'](handleError(_0x32a729,null));}; \ No newline at end of file +var _0x0315=['keys','filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','body','bulkCreate','find','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query'];(function(_0x3e6141,_0x4e159d){var _0x3d207=function(_0x2dee64){while(--_0x2dee64){_0x3e6141['push'](_0x3e6141['shift']());}};_0x3d207(++_0x4e159d);}(_0x0315,0x171));var _0x5031=function(_0x55291a,_0x814018){_0x55291a=_0x55291a-0x0;var _0x3c870c=_0x0315[_0x55291a];return _0x3c870c;};'use strict';var emlformat=require(_0x5031('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5031('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5031('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5031('0x3'));var path=require(_0x5031('0x4'));var sox=require(_0x5031('0x5'));var csv=require(_0x5031('0x6'));var ejs=require(_0x5031('0x7'));var fs=require('fs');var fs_extra=require(_0x5031('0x8'));var _=require(_0x5031('0x9'));var squel=require(_0x5031('0xa'));var crypto=require(_0x5031('0xb'));var jsforce=require(_0x5031('0xc'));var deskjs=require(_0x5031('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5031('0xe'));var Papa=require(_0x5031('0xf'));var Redis=require(_0x5031('0x10'));var authService=require(_0x5031('0x11'));var qs=require(_0x5031('0x12'));var as=require(_0x5031('0x13'));var hardwareService=require(_0x5031('0x14'));var logger=require(_0x5031('0x15'))(_0x5031('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5031('0x17'));var db=require(_0x5031('0x18'))['db'];function respondWithStatusCode(_0x2855f0,_0x3a4ba8){_0x3a4ba8=_0x3a4ba8||0xcc;return function(_0x482bc5){if(_0x482bc5){return _0x2855f0['sendStatus'](_0x3a4ba8);}return _0x2855f0[_0x5031('0x19')](_0x3a4ba8)[_0x5031('0x1a')]();};}function respondWithResult(_0x278113,_0x3a3177){_0x3a3177=_0x3a3177||0xc8;return function(_0x50c921){if(_0x50c921){return _0x278113[_0x5031('0x19')](_0x3a3177)['json'](_0x50c921);}};}function respondWithFilteredResult(_0x1c3b68,_0x28b9f7){return function(_0x1b3c28){if(_0x1b3c28){var _0x496f29=typeof _0x28b9f7[_0x5031('0x1b')]===_0x5031('0x1c')&&typeof _0x28b9f7[_0x5031('0x1d')]===_0x5031('0x1c');var _0xe60d94=_0x1b3c28[_0x5031('0x1e')];var _0x400a3c=_0x496f29?0x0:_0x28b9f7[_0x5031('0x1b')];var _0x3b2d00=_0x496f29?_0x1b3c28[_0x5031('0x1e')]:_0x28b9f7['offset']+_0x28b9f7[_0x5031('0x1d')];var _0x20da62;if(_0x3b2d00>=_0xe60d94){_0x3b2d00=_0xe60d94;_0x20da62=0xc8;}else{_0x20da62=0xce;}_0x1c3b68['status'](_0x20da62);return _0x1c3b68[_0x5031('0x1f')](_0x5031('0x20'),_0x400a3c+'-'+_0x3b2d00+'/'+_0xe60d94)[_0x5031('0x21')](_0x1b3c28);}return null;};}function patchUpdates(_0x13b2db){return function(_0x67ded4){try{jsonpatch['apply'](_0x67ded4,_0x13b2db,!![]);}catch(_0x18bfff){return BPromise[_0x5031('0x22')](_0x18bfff);}return _0x67ded4[_0x5031('0x23')]();};}function saveUpdates(_0x35e5dd,_0xbd9272){return function(_0x3a6e6d){if(_0x3a6e6d){return _0x3a6e6d[_0x5031('0x24')](_0x35e5dd)[_0x5031('0x25')](function(_0x158e7f){return _0x158e7f;});}return null;};}function removeEntity(_0x428902,_0x2f1070){return function(_0x55fd93){if(_0x55fd93){return _0x55fd93[_0x5031('0x26')]()['then'](function(){_0x428902[_0x5031('0x19')](0xcc)[_0x5031('0x1a')]();});}};}function handleEntityNotFound(_0x4e1d8a,_0x5e5e32){return function(_0x16b108){if(!_0x16b108){_0x4e1d8a[_0x5031('0x27')](0x194);}return _0x16b108;};}function handleError(_0x2326ae,_0x446d23){_0x446d23=_0x446d23||0x1f4;return function(_0x56e756){logger[_0x5031('0x28')](_0x56e756['stack']);if(_0x56e756[_0x5031('0x29')]){delete _0x56e756['name'];}_0x2326ae['status'](_0x446d23)[_0x5031('0x2a')](_0x56e756);};}exports[_0x5031('0x2b')]=function(_0x331d2c,_0x10d971){var _0x36c235={},_0x35e690={},_0x409eac={'count':0x0,'rows':[]};var _0x24c6cc=_[_0x5031('0x2c')](db[_0x5031('0x2d')][_0x5031('0x2e')],function(_0x544fa1){return{'name':_0x544fa1[_0x5031('0x2f')],'type':_0x544fa1[_0x5031('0x30')][_0x5031('0x31')]};});_0x35e690['model']=_[_0x5031('0x2c')](_0x24c6cc,_0x5031('0x29'));_0x35e690[_0x5031('0x32')]=_[_0x5031('0x33')](_0x331d2c[_0x5031('0x32')]);_0x35e690[_0x5031('0x34')]=_['intersection'](_0x35e690[_0x5031('0x35')],_0x35e690[_0x5031('0x32')]);_0x36c235[_0x5031('0x36')]=_['intersection'](_0x35e690[_0x5031('0x35')],qs[_0x5031('0x37')](_0x331d2c['query'][_0x5031('0x37')]));_0x36c235['attributes']=_0x36c235['attributes']['length']?_0x36c235['attributes']:_0x35e690[_0x5031('0x35')];if(!_0x331d2c[_0x5031('0x32')][_0x5031('0x38')]('nolimit')){_0x36c235[_0x5031('0x1d')]=qs[_0x5031('0x1d')](_0x331d2c[_0x5031('0x32')][_0x5031('0x1d')]);_0x36c235['offset']=qs['offset'](_0x331d2c['query'][_0x5031('0x1b')]);}_0x36c235[_0x5031('0x39')]=qs[_0x5031('0x3a')](_0x331d2c['query'][_0x5031('0x3a')]);_0x36c235[_0x5031('0x3b')]=qs[_0x5031('0x34')](_[_0x5031('0x3c')](_0x331d2c[_0x5031('0x32')],_0x35e690['filters']),_0x24c6cc);if(_0x331d2c[_0x5031('0x32')][_0x5031('0x3d')]){_0x36c235[_0x5031('0x3b')]=_['merge'](_0x36c235['where'],{'$or':_[_0x5031('0x2c')](_0x24c6cc,function(_0x16d9b6){if(_0x16d9b6['type']!=='VIRTUAL'){var _0x9a966a={};_0x9a966a[_0x16d9b6[_0x5031('0x29')]]={'$like':'%'+_0x331d2c[_0x5031('0x32')][_0x5031('0x3d')]+'%'};return _0x9a966a;}})});}_0x36c235=_[_0x5031('0x3e')]({},_0x36c235,_0x331d2c[_0x5031('0x3f')]);var _0x19d2a4={'where':_0x36c235[_0x5031('0x3b')]};return db[_0x5031('0x2d')]['count'](_0x19d2a4)[_0x5031('0x25')](function(_0xdc4474){_0x409eac['count']=_0xdc4474;if(_0x331d2c['query'][_0x5031('0x40')]){_0x36c235[_0x5031('0x41')]=[{'all':!![]}];}return db[_0x5031('0x2d')][_0x5031('0x42')](_0x36c235);})[_0x5031('0x25')](function(_0x528a22){_0x409eac[_0x5031('0x43')]=_0x528a22;return _0x409eac;})[_0x5031('0x25')](respondWithFilteredResult(_0x10d971,_0x36c235))[_0x5031('0x44')](handleError(_0x10d971,null));};exports[_0x5031('0x45')]=function(_0x5c3c4b,_0x31f385){var _0x5b0b55={'raw':![],'where':{'id':_0x5c3c4b[_0x5031('0x46')]['id']}},_0x1953b8={};_0x1953b8['model']=_['keys'](db[_0x5031('0x2d')][_0x5031('0x2e')]);_0x1953b8['query']=_['keys'](_0x5c3c4b[_0x5031('0x32')]);_0x1953b8['filters']=_['intersection'](_0x1953b8[_0x5031('0x35')],_0x1953b8['query']);_0x5b0b55[_0x5031('0x36')]=_[_0x5031('0x47')](_0x1953b8[_0x5031('0x35')],qs[_0x5031('0x37')](_0x5c3c4b[_0x5031('0x32')][_0x5031('0x37')]));_0x5b0b55[_0x5031('0x36')]=_0x5b0b55['attributes'][_0x5031('0x48')]?_0x5b0b55[_0x5031('0x36')]:_0x1953b8[_0x5031('0x35')];if(_0x5c3c4b['query'][_0x5031('0x40')]){_0x5b0b55[_0x5031('0x41')]=[{'all':!![]}];}_0x5b0b55=_[_0x5031('0x3e')]({},_0x5b0b55,_0x5c3c4b['options']);return db['AnalyticFieldReport']['find'](_0x5b0b55)['then'](handleEntityNotFound(_0x31f385,null))[_0x5031('0x25')](respondWithResult(_0x31f385,null))[_0x5031('0x44')](handleError(_0x31f385,null));};exports[_0x5031('0x49')]=function(_0x1b5aba,_0x218f2e){return db[_0x5031('0x2d')][_0x5031('0x49')](_0x1b5aba[_0x5031('0x4a')],{})[_0x5031('0x25')](respondWithResult(_0x218f2e,0xc9))[_0x5031('0x44')](handleError(_0x218f2e,null));};exports['bulkCreate']=function(_0x13ecc2,_0x21c278){return db[_0x5031('0x2d')][_0x5031('0x4b')](_0x13ecc2[_0x5031('0x4a')],{'raw':![],'individualHooks':!![]})[_0x5031('0x25')](respondWithResult(_0x21c278,0xc9))[_0x5031('0x44')](handleError(_0x21c278,null));};exports[_0x5031('0x24')]=function(_0x3aa5dd,_0x10f625){if(_0x3aa5dd[_0x5031('0x4a')]['id']){delete _0x3aa5dd['body']['id'];}return db[_0x5031('0x2d')][_0x5031('0x4c')]({'where':{'id':_0x3aa5dd[_0x5031('0x46')]['id']}})[_0x5031('0x25')](handleEntityNotFound(_0x10f625,null))['then'](saveUpdates(_0x3aa5dd[_0x5031('0x4a')],null))[_0x5031('0x25')](respondWithResult(_0x10f625,null))[_0x5031('0x44')](handleError(_0x10f625,null));};exports[_0x5031('0x26')]=function(_0x1a87d5,_0x2b46ff){return db[_0x5031('0x2d')][_0x5031('0x4c')]({'where':{'id':_0x1a87d5[_0x5031('0x46')]['id']}})[_0x5031('0x25')](handleEntityNotFound(_0x2b46ff,null))[_0x5031('0x25')](removeEntity(_0x2b46ff,null))['catch'](handleError(_0x2b46ff,null));};exports['bulkDestroy']=function(_0x2531e1,_0x464b09){return db[_0x5031('0x2d')][_0x5031('0x26')]({'where':{'id':_0x2531e1[_0x5031('0x32')][_0x5031('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x5031('0x25')](respondWithResult(_0x464b09,0xcc))[_0x5031('0x44')](handleError(_0x464b09,null));};exports[_0x5031('0x4e')]=function(_0x41e84a,_0xb99ffc,_0x16097c){return db[_0x5031('0x4f')][_0x5031('0x50')]({'where':{'id':_0x41e84a[_0x5031('0x46')]['id']}})[_0x5031('0x25')](handleEntityNotFound(_0xb99ffc,null))[_0x5031('0x25')](function(_0x2268a5){if(_0x2268a5){return db[_0x5031('0x51')][_0x5031('0x52')](function(_0x3a9a4a){return db[_0x5031('0x2d')][_0x5031('0x26')]({'where':{'CustomReportId':_0x41e84a[_0x5031('0x46')]['id']},'transaction':_0x3a9a4a})[_0x5031('0x25')](function(_0x14f561){var _0x3645e3=_[_0x5031('0x2c')](_0x41e84a[_0x5031('0x4a')],function(_0x334703){delete _0x334703['id'];_0x334703[_0x5031('0x53')]=_0x41e84a[_0x5031('0x46')]['id'];return _0x334703;});return db[_0x5031('0x2d')][_0x5031('0x4b')](_0x3645e3,{'transaction':_0x3a9a4a});});})[_0x5031('0x25')](function(){return db[_0x5031('0x2d')][_0x5031('0x42')]({'where':{'CustomReportId':_0x41e84a[_0x5031('0x46')]['id']}});});}})[_0x5031('0x25')](respondWithResult(_0xb99ffc,null))[_0x5031('0x44')](handleError(_0xb99ffc,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 4ce92ae..0e030a1 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 _0xea7b=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','util','api'];(function(_0x33f0f1,_0x1cea77){var _0x398dee=function(_0x26a7e4){while(--_0x26a7e4){_0x33f0f1['push'](_0x33f0f1['shift']());}};_0x398dee(++_0x1cea77);}(_0xea7b,0x183));var _0xbea7=function(_0x9a0c2,_0x48a029){_0x9a0c2=_0x9a0c2-0x0;var _0x5d0fad=_0xea7b[_0x9a0c2];return _0x5d0fad;};'use strict';var _=require(_0xbea7('0x0'));var util=require(_0xbea7('0x1'));var logger=require('../../config/logger')(_0xbea7('0x2'));var moment=require(_0xbea7('0x3'));var BPromise=require(_0xbea7('0x4'));var rp=require(_0xbea7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbea7('0x6'));var config=require(_0xbea7('0x7'));var attributes=require(_0xbea7('0x8'));module['exports']=function(_0x3deb04,_0x242980){return _0x3deb04['define'](_0xbea7('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4477=['AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x4477,0x1e3));var _0x7447=function(_0x754810,_0x338993){_0x754810=_0x754810-0x0;var _0x35af00=_0x4477[_0x754810];return _0x35af00;};'use strict';var _=require('lodash');var util=require(_0x7447('0x0'));var logger=require(_0x7447('0x1'))(_0x7447('0x2'));var moment=require(_0x7447('0x3'));var BPromise=require(_0x7447('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7447('0x5'));var rimraf=require(_0x7447('0x6'));var config=require(_0x7447('0x7'));var attributes=require(_0x7447('0x8'));module[_0x7447('0x9')]=function(_0x5ca38c,_0x3e6f6b){return _0x5ca38c[_0x7447('0xa')](_0x7447('0xb'),attributes,{'tableName':_0x7447('0xc'),'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 a69c34f..ce20261 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 _0x76e4=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x76e4,0x1dd));var _0x476e=function(_0x585a77,_0x587b08){_0x585a77=_0x585a77-0x0;var _0x89feef=_0x76e4[_0x585a77];return _0x89feef;};'use strict';var _=require(_0x476e('0x0'));var util=require(_0x476e('0x1'));var moment=require(_0x476e('0x2'));var BPromise=require('bluebird');var rs=require(_0x476e('0x3'));var fs=require('fs');var Redis=require(_0x476e('0x4'));var db=require(_0x476e('0x5'))['db'];var utils=require(_0x476e('0x6'));var logger=require(_0x476e('0x7'))(_0x476e('0x8'));var config=require('../../config/environment');var jayson=require(_0x476e('0x9'));var client=jayson[_0x476e('0xa')][_0x476e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52d21e,_0x14bcb1,_0x1da3d1){return new BPromise(function(_0x4a60b8,_0x280a97){return client['request'](_0x52d21e,_0x1da3d1)[_0x476e('0xc')](function(_0x30f3be){logger[_0x476e('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14bcb1,_0x476e('0xe'));logger[_0x476e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x14bcb1,_0x476e('0xe'),JSON[_0x476e('0x10')](_0x30f3be));if(_0x30f3be[_0x476e('0x11')]){if(_0x30f3be[_0x476e('0x11')][_0x476e('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x14bcb1,_0x30f3be[_0x476e('0x11')][_0x476e('0x13')]);return _0x280a97(_0x30f3be['error'][_0x476e('0x13')]);}logger[_0x476e('0x11')](_0x476e('0x14'),_0x14bcb1,_0x30f3be[_0x476e('0x11')][_0x476e('0x13')]);return _0x4a60b8(_0x30f3be[_0x476e('0x11')][_0x476e('0x13')]);}else{logger['info'](_0x476e('0x14'),_0x14bcb1,_0x476e('0xe'));_0x4a60b8(_0x30f3be[_0x476e('0x15')][_0x476e('0x13')]);}})[_0x476e('0x16')](function(_0x24d3fc){logger[_0x476e('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14bcb1,_0x24d3fc);_0x280a97(_0x24d3fc);});});} \ No newline at end of file +var _0x49d7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49d7,0xe7));var _0x749d=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x49d7[_0x338f73];return _0x163fdf;};'use strict';var _=require(_0x749d('0x0'));var util=require('util');var moment=require(_0x749d('0x1'));var BPromise=require(_0x749d('0x2'));var rs=require(_0x749d('0x3'));var fs=require('fs');var Redis=require(_0x749d('0x4'));var db=require(_0x749d('0x5'))['db'];var utils=require(_0x749d('0x6'));var logger=require(_0x749d('0x7'))(_0x749d('0x8'));var config=require('../../config/environment');var jayson=require(_0x749d('0x9'));var client=jayson['client'][_0x749d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dbeb1,_0x4ba56b,_0x226e3f){return new BPromise(function(_0x491703,_0x16682a){return client[_0x749d('0xb')](_0x5dbeb1,_0x226e3f)['then'](function(_0x8047ef){logger[_0x749d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ba56b,_0x749d('0xd'));logger[_0x749d('0xe')](_0x749d('0xf'),_0x4ba56b,_0x749d('0xd'),JSON[_0x749d('0x10')](_0x8047ef));if(_0x8047ef[_0x749d('0x11')]){if(_0x8047ef[_0x749d('0x11')][_0x749d('0x12')]===0x1f4){logger[_0x749d('0x11')](_0x749d('0x13'),_0x4ba56b,_0x8047ef[_0x749d('0x11')][_0x749d('0x14')]);return _0x16682a(_0x8047ef['error'][_0x749d('0x14')]);}logger[_0x749d('0x11')](_0x749d('0x13'),_0x4ba56b,_0x8047ef[_0x749d('0x11')][_0x749d('0x14')]);return _0x491703(_0x8047ef[_0x749d('0x11')]['message']);}else{logger[_0x749d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ba56b,_0x749d('0xd'));_0x491703(_0x8047ef[_0x749d('0x15')][_0x749d('0x14')]);}})[_0x749d('0x16')](function(_0x3528fd){logger['error'](_0x749d('0x13'),_0x4ba56b,_0x3528fd);_0x16682a(_0x3528fd);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 33ce5d2..19e6480 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x1a3cdd,_0x4c5f4f){var _0x1514e5=function(_0x38487f){while(--_0x38487f){_0x1a3cdd['push'](_0x1a3cdd['shift']());}};_0x1514e5(++_0x4c5f4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x355fb0,_0x491add){var _0x207bcf=function(_0x41ff06){while(--_0x41ff06){_0x355fb0['push'](_0x355fb0['shift']());}};_0x207bcf(++_0x491add);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 853dcfd..484d254 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 _0x9ffd=['STRING','TEXT','sequelize','exports'];(function(_0x5bf9ea,_0x4668d8){var _0xdccf57=function(_0x454040){while(--_0x454040){_0x5bf9ea['push'](_0x5bf9ea['shift']());}};_0xdccf57(++_0x4668d8);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3f13e9,_0x362482){_0x3f13e9=_0x3f13e9-0x0;var _0x3bf38c=_0x9ffd[_0x3f13e9];return _0x3bf38c;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xd9ff('0x2')]},'metric':{'type':Sequelize[_0xd9ff('0x3')]},'description':{'type':Sequelize[_0xd9ff('0x2')]}}; \ No newline at end of file +var _0x2e16=['sequelize','STRING','TEXT'];(function(_0x2a378f,_0x37d5cb){var _0x4b43f5=function(_0x24a2db){while(--_0x24a2db){_0x2a378f['push'](_0x2a378f['shift']());}};_0x4b43f5(++_0x37d5cb);}(_0x2e16,0x8d));var _0x62e1=function(_0x52bed8,_0x28fae3){_0x52bed8=_0x52bed8-0x0;var _0x2ea74e=_0x2e16[_0x52bed8];return _0x2ea74e;};'use strict';var Sequelize=require(_0x62e1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x62e1('0x1')]},'metric':{'type':Sequelize[_0x62e1('0x2')]},'description':{'type':Sequelize[_0x62e1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0b12743..931975a 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','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','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x122751,_0x48aa61){var _0xc1ac24=function(_0x307a3f){while(--_0x307a3f){_0x122751['push'](_0x122751['shift']());}};_0xc1ac24(++_0x48aa61);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x4b84[_0x5c2e5e];return _0x46a5da;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file +var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x38a2e7,_0x6ab215){var _0x1b709f=function(_0x4eb3c2){while(--_0x4eb3c2){_0x38a2e7['push'](_0x38a2e7['shift']());}};_0x1b709f(++_0x6ab215);}(_0x81bd,0x7c));var _0xd81b=function(_0x23b3e0,_0x802d57){_0x23b3e0=_0x23b3e0-0x0;var _0x122558=_0x81bd[_0x23b3e0];return _0x122558;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 37ed403..ebc0975 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 _0x56da=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x48083e,_0x5edb05){var _0x1afbdd=function(_0x28289c){while(--_0x28289c){_0x48083e['push'](_0x48083e['shift']());}};_0x1afbdd(++_0x5edb05);}(_0x56da,0x119));var _0xa56d=function(_0x1b8524,_0x1bb669){_0x1b8524=_0x1b8524-0x0;var _0x81418d=_0x56da[_0x1b8524];return _0x81418d;};'use strict';var _=require(_0xa56d('0x0'));var util=require('util');var logger=require(_0xa56d('0x1'))(_0xa56d('0x2'));var moment=require('moment');var BPromise=require(_0xa56d('0x3'));var rp=require(_0xa56d('0x4'));var fs=require('fs');var path=require(_0xa56d('0x5'));var rimraf=require(_0xa56d('0x6'));var config=require(_0xa56d('0x7'));var attributes=require(_0xa56d('0x8'));module[_0xa56d('0x9')]=function(_0x14a16e,_0x4751ee){return _0x14a16e[_0xa56d('0xa')](_0xa56d('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e54=['lodash','util','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','AnalyticMetric'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9e54,0x88));var _0x49e5=function(_0x10a4db,_0x1b1dbb){_0x10a4db=_0x10a4db-0x0;var _0x332573=_0x9e54[_0x10a4db];return _0x332573;};'use strict';var _=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x49e5('0x2'));var rp=require(_0x49e5('0x3'));var fs=require('fs');var path=require(_0x49e5('0x4'));var rimraf=require('rimraf');var config=require(_0x49e5('0x5'));var attributes=require(_0x49e5('0x6'));module['exports']=function(_0xa16cfa,_0x57486f){return _0xa16cfa['define'](_0x49e5('0x7'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 09fdf9f..063fd37 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 _0xed5f=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4a9dc0,_0x1a8db5){var _0x5da5c2=function(_0x1e2166){while(--_0x1e2166){_0x4a9dc0['push'](_0x4a9dc0['shift']());}};_0x5da5c2(++_0x1a8db5);}(_0xed5f,0x1b6));var _0xfed5=function(_0x12583b,_0x18e3d6){_0x12583b=_0x12583b-0x0;var _0x4c5254=_0xed5f[_0x12583b];return _0x4c5254;};'use strict';var _=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var moment=require(_0xfed5('0x2'));var BPromise=require(_0xfed5('0x3'));var rs=require(_0xfed5('0x4'));var fs=require('fs');var Redis=require(_0xfed5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfed5('0x6'));var logger=require(_0xfed5('0x7'))(_0xfed5('0x8'));var config=require(_0xfed5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfed5('0xa')][_0xfed5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10fe81,_0x106f84,_0x4105ed){return new BPromise(function(_0x52cdc3,_0x2af890){return client[_0xfed5('0xc')](_0x10fe81,_0x4105ed)[_0xfed5('0xd')](function(_0x1fbc61){logger[_0xfed5('0xe')](_0xfed5('0xf'),_0x106f84,'request\x20sent');logger[_0xfed5('0x10')](_0xfed5('0x11'),_0x106f84,_0xfed5('0x12'),JSON[_0xfed5('0x13')](_0x1fbc61));if(_0x1fbc61[_0xfed5('0x14')]){if(_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x15')]===0x1f4){logger['error'](_0xfed5('0xf'),_0x106f84,_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x16')]);return _0x2af890(_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x16')]);}logger[_0xfed5('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x106f84,_0x1fbc61[_0xfed5('0x14')]['message']);return _0x52cdc3(_0x1fbc61[_0xfed5('0x14')][_0xfed5('0x16')]);}else{logger[_0xfed5('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x106f84,_0xfed5('0x12'));_0x52cdc3(_0x1fbc61[_0xfed5('0x17')][_0xfed5('0x16')]);}})[_0xfed5('0x18')](function(_0x2fc432){logger[_0xfed5('0x14')](_0xfed5('0xf'),_0x106f84,_0x2fc432);_0x2af890(_0x2fc432);});});} \ No newline at end of file +var _0x9cd2=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message'];(function(_0x98c519,_0x541919){var _0x3aa2d8=function(_0x1c2e86){while(--_0x1c2e86){_0x98c519['push'](_0x98c519['shift']());}};_0x3aa2d8(++_0x541919);}(_0x9cd2,0x1e5));var _0x29cd=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9cd2[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x29cd('0x0'));var moment=require('moment');var BPromise=require(_0x29cd('0x1'));var rs=require(_0x29cd('0x2'));var fs=require('fs');var Redis=require(_0x29cd('0x3'));var db=require(_0x29cd('0x4'))['db'];var utils=require(_0x29cd('0x5'));var logger=require(_0x29cd('0x6'))(_0x29cd('0x7'));var config=require(_0x29cd('0x8'));var jayson=require(_0x29cd('0x9'));var client=jayson[_0x29cd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b10e4,_0x4a13ca,_0x221bb0){return new BPromise(function(_0xdc005d,_0x595287){return client[_0x29cd('0xb')](_0x5b10e4,_0x221bb0)[_0x29cd('0xc')](function(_0x3a1122){logger[_0x29cd('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x4a13ca,_0x29cd('0xe'));logger['debug'](_0x29cd('0xf'),_0x4a13ca,'request\x20sent',JSON[_0x29cd('0x10')](_0x3a1122));if(_0x3a1122[_0x29cd('0x11')]){if(_0x3a1122[_0x29cd('0x11')][_0x29cd('0x12')]===0x1f4){logger[_0x29cd('0x11')](_0x29cd('0x13'),_0x4a13ca,_0x3a1122[_0x29cd('0x11')][_0x29cd('0x14')]);return _0x595287(_0x3a1122[_0x29cd('0x11')][_0x29cd('0x14')]);}logger[_0x29cd('0x11')](_0x29cd('0x13'),_0x4a13ca,_0x3a1122['error']['message']);return _0xdc005d(_0x3a1122[_0x29cd('0x11')][_0x29cd('0x14')]);}else{logger[_0x29cd('0xd')](_0x29cd('0x13'),_0x4a13ca,_0x29cd('0xe'));_0xdc005d(_0x3a1122[_0x29cd('0x15')][_0x29cd('0x14')]);}})[_0x29cd('0x16')](function(_0x3f0787){logger[_0x29cd('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x4a13ca,_0x3f0787);_0x595287(_0x3f0787);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c786c4f..8db0567 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 _0x885a=['put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0xd')]('/',auth[_0xa885('0xe')](),controller['create']);router[_0xa885('0xf')](_0xa885('0xb'),auth[_0xa885('0xe')](),controller[_0xa885('0x10')]);router[_0xa885('0x11')](_0xa885('0xb'),auth[_0xa885('0xe')](),controller['destroy']);module[_0xa885('0x12')]=router; \ No newline at end of file +var _0x92bc=['/:id','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x487329,_0x28b0a0){var _0xc23b77=function(_0x6f7948){while(--_0x6f7948){_0x487329['push'](_0x487329['shift']());}};_0xc23b77(++_0x28b0a0);}(_0x92bc,0x106));var _0xc92b=function(_0x21f106,_0x22fcb7){_0x21f106=_0x21f106-0x0;var _0x53bc1f=_0x92bc[_0x21f106];return _0x53bc1f;};'use strict';var multer=require(_0xc92b('0x0'));var util=require(_0xc92b('0x1'));var path=require(_0xc92b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc92b('0x3')]();var fs_extra=require(_0xc92b('0x4'));var auth=require(_0xc92b('0x5'));var interaction=require(_0xc92b('0x6'));var config=require('../../config/environment');var controller=require(_0xc92b('0x7'));router[_0xc92b('0x8')]('/',auth[_0xc92b('0x9')](),controller['index']);router['get'](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller['show']);router[_0xc92b('0xb')]('/',auth[_0xc92b('0x9')](),controller[_0xc92b('0xc')]);router['put'](_0xc92b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc92b('0xd')]('/:id',auth[_0xc92b('0x9')](),controller[_0xc92b('0xe')]);module[_0xc92b('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index eef218b..3e28e02 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 _0x932f=['exports','TEXT'];(function(_0xefb968,_0x190d8d){var _0x393f43=function(_0x2567f9){while(--_0x2567f9){_0xefb968['push'](_0xefb968['shift']());}};_0x393f43(++_0x190d8d);}(_0x932f,0x9e));var _0xf932=function(_0x4b20bc,_0x2febc4){_0x4b20bc=_0x4b20bc-0x0;var _0x20ff77=_0x932f[_0x4b20bc];return _0x20ff77;};'use strict';var Sequelize=require('sequelize');module[_0xf932('0x0')]={'tree':{'type':Sequelize[_0xf932('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7f2b=['exports','TEXT'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7f2b,0x142));var _0xb7f2=function(_0x38e84d,_0x446122){_0x38e84d=_0x38e84d-0x0;var _0x348454=_0x7f2b[_0x38e84d];return _0x348454;};'use strict';var Sequelize=require('sequelize');module[_0xb7f2('0x0')]={'tree':{'type':Sequelize[_0xb7f2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a921712..327526d 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 _0x9afa=['model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','params','fields','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9afa,0x191));var _0xa9af=function(_0x3ee007,_0x4d1cf6){_0x3ee007=_0x3ee007-0x0;var _0x26cf0a=_0x9afa[_0x3ee007];return _0x26cf0a;};'use strict';var emlformat=require(_0xa9af('0x0'));var rimraf=require(_0xa9af('0x1'));var zipdir=require(_0xa9af('0x2'));var jsonpatch=require(_0xa9af('0x3'));var rp=require(_0xa9af('0x4'));var moment=require(_0xa9af('0x5'));var BPromise=require(_0xa9af('0x6'));var Mustache=require(_0xa9af('0x7'));var util=require(_0xa9af('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa9af('0x9'));var ejs=require(_0xa9af('0xa'));var fs=require('fs');var fs_extra=require(_0xa9af('0xb'));var _=require(_0xa9af('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9af('0xd'));var deskjs=require(_0xa9af('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa9af('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9af('0x10'));var logger=require(_0xa9af('0x11'))(_0xa9af('0x12'));var utils=require(_0xa9af('0x13'));var config=require(_0xa9af('0x14'));var licenseUtil=require(_0xa9af('0x15'));var db=require(_0xa9af('0x16'))['db'];function respondWithStatusCode(_0x21fa41,_0x55aab8){_0x55aab8=_0x55aab8||0xcc;return function(_0x3b4233){if(_0x3b4233){return _0x21fa41['sendStatus'](_0x55aab8);}return _0x21fa41[_0xa9af('0x17')](_0x55aab8)[_0xa9af('0x18')]();};}function respondWithResult(_0x29f27f,_0x49ddb2){_0x49ddb2=_0x49ddb2||0xc8;return function(_0x2128f2){if(_0x2128f2){return _0x29f27f[_0xa9af('0x17')](_0x49ddb2)[_0xa9af('0x19')](_0x2128f2);}};}function respondWithFilteredResult(_0x2fd8c9,_0x18748a){return function(_0x542d6e){if(_0x542d6e){var _0x4538a6=typeof _0x18748a[_0xa9af('0x1a')]===_0xa9af('0x1b')&&typeof _0x18748a[_0xa9af('0x1c')]===_0xa9af('0x1b');var _0x51e160=_0x542d6e[_0xa9af('0x1d')];var _0x276e33=_0x4538a6?0x0:_0x18748a['offset'];var _0x1b1030=_0x4538a6?_0x542d6e['count']:_0x18748a[_0xa9af('0x1a')]+_0x18748a[_0xa9af('0x1c')];var _0x207e24;if(_0x1b1030>=_0x51e160){_0x1b1030=_0x51e160;_0x207e24=0xc8;}else{_0x207e24=0xce;}_0x2fd8c9[_0xa9af('0x17')](_0x207e24);return _0x2fd8c9[_0xa9af('0x1e')](_0xa9af('0x1f'),_0x276e33+'-'+_0x1b1030+'/'+_0x51e160)[_0xa9af('0x19')](_0x542d6e);}return null;};}function patchUpdates(_0x3bc223){return function(_0x402820){try{jsonpatch[_0xa9af('0x20')](_0x402820,_0x3bc223,!![]);}catch(_0x207c44){return BPromise[_0xa9af('0x21')](_0x207c44);}return _0x402820[_0xa9af('0x22')]();};}function saveUpdates(_0x1146d4,_0x2e1d11){return function(_0x3b2cf1){if(_0x3b2cf1){return _0x3b2cf1[_0xa9af('0x23')](_0x1146d4)[_0xa9af('0x24')](function(_0x9bd70c){return _0x9bd70c;});}return null;};}function removeEntity(_0x43bd41,_0x1c4e55){return function(_0xc2d706){if(_0xc2d706){return _0xc2d706[_0xa9af('0x25')]()[_0xa9af('0x24')](function(){_0x43bd41[_0xa9af('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x219f15,_0x15a9bf){return function(_0x537321){if(!_0x537321){_0x219f15['sendStatus'](0x194);}return _0x537321;};}function handleError(_0x18b088,_0x320879){_0x320879=_0x320879||0x1f4;return function(_0x515c07){logger[_0xa9af('0x26')](_0x515c07[_0xa9af('0x27')]);if(_0x515c07[_0xa9af('0x28')]){delete _0x515c07['name'];}_0x18b088['status'](_0x320879)[_0xa9af('0x29')](_0x515c07);};}exports[_0xa9af('0x2a')]=function(_0xfe99d,_0xf57176){var _0x47e8b3={},_0x369e00={},_0x4480d1={'count':0x0,'rows':[]};var _0x31d349=_[_0xa9af('0x2b')](db[_0xa9af('0x2c')][_0xa9af('0x2d')],function(_0x4cba5b){return{'name':_0x4cba5b[_0xa9af('0x2e')],'type':_0x4cba5b[_0xa9af('0x2f')][_0xa9af('0x30')]};});_0x369e00[_0xa9af('0x31')]=_[_0xa9af('0x2b')](_0x31d349,'name');_0x369e00[_0xa9af('0x32')]=_[_0xa9af('0x33')](_0xfe99d[_0xa9af('0x32')]);_0x369e00['filters']=_[_0xa9af('0x34')](_0x369e00['model'],_0x369e00['query']);_0x47e8b3['attributes']=_[_0xa9af('0x34')](_0x369e00[_0xa9af('0x31')],qs['fields'](_0xfe99d[_0xa9af('0x32')]['fields']));_0x47e8b3['attributes']=_0x47e8b3[_0xa9af('0x35')][_0xa9af('0x36')]?_0x47e8b3['attributes']:_0x369e00[_0xa9af('0x31')];if(!_0xfe99d[_0xa9af('0x32')][_0xa9af('0x37')](_0xa9af('0x38'))){_0x47e8b3[_0xa9af('0x1c')]=qs[_0xa9af('0x1c')](_0xfe99d['query']['limit']);_0x47e8b3[_0xa9af('0x1a')]=qs[_0xa9af('0x1a')](_0xfe99d[_0xa9af('0x32')][_0xa9af('0x1a')]);}_0x47e8b3[_0xa9af('0x39')]=qs['sort'](_0xfe99d[_0xa9af('0x32')][_0xa9af('0x3a')]);_0x47e8b3[_0xa9af('0x3b')]=qs[_0xa9af('0x3c')](_[_0xa9af('0x3d')](_0xfe99d[_0xa9af('0x32')],_0x369e00[_0xa9af('0x3c')]),_0x31d349);if(_0xfe99d[_0xa9af('0x32')][_0xa9af('0x3e')]){_0x47e8b3['where']=_[_0xa9af('0x3f')](_0x47e8b3[_0xa9af('0x3b')],{'$or':_[_0xa9af('0x2b')](_0x31d349,function(_0x30efc7){if(_0x30efc7[_0xa9af('0x2f')]!==_0xa9af('0x40')){var _0x1869df={};_0x1869df[_0x30efc7['name']]={'$like':'%'+_0xfe99d[_0xa9af('0x32')][_0xa9af('0x3e')]+'%'};return _0x1869df;}})});}_0x47e8b3=_[_0xa9af('0x3f')]({},_0x47e8b3,_0xfe99d['options']);var _0x537116={'where':_0x47e8b3['where']};return db[_0xa9af('0x2c')]['count'](_0x537116)['then'](function(_0x51c562){_0x4480d1[_0xa9af('0x1d')]=_0x51c562;if(_0xfe99d[_0xa9af('0x32')]['includeAll']){_0x47e8b3['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x47e8b3);})['then'](function(_0x43320c){_0x4480d1[_0xa9af('0x41')]=_0x43320c;return _0x4480d1;})['then'](respondWithFilteredResult(_0xf57176,_0x47e8b3))[_0xa9af('0x42')](handleError(_0xf57176,null));};exports['show']=function(_0x5d9a84,_0xd5cc9e){var _0x2fb3e4={'raw':!![],'where':{'id':_0x5d9a84[_0xa9af('0x43')]['id']}},_0x524965={};_0x524965[_0xa9af('0x31')]=_[_0xa9af('0x33')](db[_0xa9af('0x2c')][_0xa9af('0x2d')]);_0x524965[_0xa9af('0x32')]=_[_0xa9af('0x33')](_0x5d9a84[_0xa9af('0x32')]);_0x524965['filters']=_[_0xa9af('0x34')](_0x524965[_0xa9af('0x31')],_0x524965[_0xa9af('0x32')]);_0x2fb3e4[_0xa9af('0x35')]=_['intersection'](_0x524965[_0xa9af('0x31')],qs[_0xa9af('0x44')](_0x5d9a84[_0xa9af('0x32')][_0xa9af('0x44')]));_0x2fb3e4['attributes']=_0x2fb3e4[_0xa9af('0x35')][_0xa9af('0x36')]?_0x2fb3e4[_0xa9af('0x35')]:_0x524965['model'];if(_0x5d9a84[_0xa9af('0x32')][_0xa9af('0x45')]){_0x2fb3e4[_0xa9af('0x46')]=[{'all':!![]}];}_0x2fb3e4=_[_0xa9af('0x3f')]({},_0x2fb3e4,_0x5d9a84[_0xa9af('0x47')]);return db[_0xa9af('0x2c')][_0xa9af('0x48')](_0x2fb3e4)[_0xa9af('0x24')](handleEntityNotFound(_0xd5cc9e,null))['then'](respondWithResult(_0xd5cc9e,null))[_0xa9af('0x42')](handleError(_0xd5cc9e,null));};exports[_0xa9af('0x49')]=function(_0x363137,_0x1ddc3e){return db['AnalyticTreeReport'][_0xa9af('0x49')](_0x363137[_0xa9af('0x4a')],{})[_0xa9af('0x24')](respondWithResult(_0x1ddc3e,0xc9))[_0xa9af('0x42')](handleError(_0x1ddc3e,null));};exports['update']=function(_0x14fa87,_0x2231a4){if(_0x14fa87[_0xa9af('0x4a')]['id']){delete _0x14fa87[_0xa9af('0x4a')]['id'];}return db[_0xa9af('0x2c')]['find']({'where':{'id':_0x14fa87[_0xa9af('0x43')]['id']}})[_0xa9af('0x24')](handleEntityNotFound(_0x2231a4,null))['then'](saveUpdates(_0x14fa87[_0xa9af('0x4a')],null))[_0xa9af('0x24')](respondWithResult(_0x2231a4,null))[_0xa9af('0x42')](handleError(_0x2231a4,null));};exports[_0xa9af('0x25')]=function(_0x58eed9,_0x1e5bcd){return db[_0xa9af('0x2c')][_0xa9af('0x48')]({'where':{'id':_0x58eed9['params']['id']}})[_0xa9af('0x24')](handleEntityNotFound(_0x1e5bcd,null))['then'](removeEntity(_0x1e5bcd,null))[_0xa9af('0x42')](handleError(_0x1e5bcd,null));}; \ No newline at end of file +var _0x645f=['limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','merge','filter','options','includeAll','include','AnalyticTreeReport','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x289842,_0x2d9db4){var _0x16155a=function(_0x1d0510){while(--_0x1d0510){_0x289842['push'](_0x289842['shift']());}};_0x16155a(++_0x2d9db4);}(_0x645f,0x1e5));var _0xf645=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x645f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf645('0x0'));var rimraf=require(_0xf645('0x1'));var zipdir=require(_0xf645('0x2'));var jsonpatch=require(_0xf645('0x3'));var rp=require(_0xf645('0x4'));var moment=require(_0xf645('0x5'));var BPromise=require(_0xf645('0x6'));var Mustache=require('mustache');var util=require(_0xf645('0x7'));var path=require(_0xf645('0x8'));var sox=require(_0xf645('0x9'));var csv=require(_0xf645('0xa'));var ejs=require(_0xf645('0xb'));var fs=require('fs');var fs_extra=require(_0xf645('0xc'));var _=require(_0xf645('0xd'));var squel=require(_0xf645('0xe'));var crypto=require(_0xf645('0xf'));var jsforce=require(_0xf645('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf645('0xa'));var querystring=require(_0xf645('0x11'));var Papa=require('papaparse');var Redis=require(_0xf645('0x12'));var authService=require(_0xf645('0x13'));var qs=require(_0xf645('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf645('0x15'));var logger=require(_0xf645('0x16'))('api');var utils=require(_0xf645('0x17'));var config=require(_0xf645('0x18'));var licenseUtil=require(_0xf645('0x19'));var db=require(_0xf645('0x1a'))['db'];function respondWithStatusCode(_0x1f5540,_0x498d4a){_0x498d4a=_0x498d4a||0xcc;return function(_0x37b26f){if(_0x37b26f){return _0x1f5540[_0xf645('0x1b')](_0x498d4a);}return _0x1f5540[_0xf645('0x1c')](_0x498d4a)[_0xf645('0x1d')]();};}function respondWithResult(_0x120ed0,_0x8fb201){_0x8fb201=_0x8fb201||0xc8;return function(_0x55461c){if(_0x55461c){return _0x120ed0[_0xf645('0x1c')](_0x8fb201)[_0xf645('0x1e')](_0x55461c);}};}function respondWithFilteredResult(_0x6745c2,_0xd7cbbf){return function(_0x473935){if(_0x473935){var _0x4edbf3=typeof _0xd7cbbf[_0xf645('0x1f')]===_0xf645('0x20')&&typeof _0xd7cbbf[_0xf645('0x21')]===_0xf645('0x20');var _0x25e49f=_0x473935[_0xf645('0x22')];var _0x28617e=_0x4edbf3?0x0:_0xd7cbbf[_0xf645('0x1f')];var _0x113fd9=_0x4edbf3?_0x473935[_0xf645('0x22')]:_0xd7cbbf[_0xf645('0x1f')]+_0xd7cbbf[_0xf645('0x21')];var _0x12f1e9;if(_0x113fd9>=_0x25e49f){_0x113fd9=_0x25e49f;_0x12f1e9=0xc8;}else{_0x12f1e9=0xce;}_0x6745c2[_0xf645('0x1c')](_0x12f1e9);return _0x6745c2[_0xf645('0x23')]('Content-Range',_0x28617e+'-'+_0x113fd9+'/'+_0x25e49f)['json'](_0x473935);}return null;};}function patchUpdates(_0x23dbda){return function(_0x44a8fe){try{jsonpatch[_0xf645('0x24')](_0x44a8fe,_0x23dbda,!![]);}catch(_0x357ace){return BPromise[_0xf645('0x25')](_0x357ace);}return _0x44a8fe[_0xf645('0x26')]();};}function saveUpdates(_0xc5c993,_0x2e5510){return function(_0x4cc71a){if(_0x4cc71a){return _0x4cc71a[_0xf645('0x27')](_0xc5c993)[_0xf645('0x28')](function(_0x52f745){return _0x52f745;});}return null;};}function removeEntity(_0xee864c,_0x2c76ca){return function(_0x5b8902){if(_0x5b8902){return _0x5b8902[_0xf645('0x29')]()[_0xf645('0x28')](function(){_0xee864c['status'](0xcc)[_0xf645('0x1d')]();});}};}function handleEntityNotFound(_0x42f48a,_0x33113c){return function(_0x36be1d){if(!_0x36be1d){_0x42f48a[_0xf645('0x1b')](0x194);}return _0x36be1d;};}function handleError(_0x38e400,_0x4fc429){_0x4fc429=_0x4fc429||0x1f4;return function(_0x2d9eb3){logger['error'](_0x2d9eb3[_0xf645('0x2a')]);if(_0x2d9eb3[_0xf645('0x2b')]){delete _0x2d9eb3[_0xf645('0x2b')];}_0x38e400['status'](_0x4fc429)[_0xf645('0x2c')](_0x2d9eb3);};}exports[_0xf645('0x2d')]=function(_0x4b7bb2,_0xc7d9a7){var _0x5d6e71={},_0x229102={},_0x36f0ad={'count':0x0,'rows':[]};var _0x5423a2=_[_0xf645('0x2e')](db['AnalyticTreeReport'][_0xf645('0x2f')],function(_0x557b44){return{'name':_0x557b44[_0xf645('0x30')],'type':_0x557b44[_0xf645('0x31')][_0xf645('0x32')]};});_0x229102['model']=_[_0xf645('0x2e')](_0x5423a2,_0xf645('0x2b'));_0x229102[_0xf645('0x33')]=_[_0xf645('0x34')](_0x4b7bb2[_0xf645('0x33')]);_0x229102['filters']=_[_0xf645('0x35')](_0x229102[_0xf645('0x36')],_0x229102[_0xf645('0x33')]);_0x5d6e71[_0xf645('0x37')]=_[_0xf645('0x35')](_0x229102[_0xf645('0x36')],qs['fields'](_0x4b7bb2[_0xf645('0x33')][_0xf645('0x38')]));_0x5d6e71[_0xf645('0x37')]=_0x5d6e71[_0xf645('0x37')]['length']?_0x5d6e71['attributes']:_0x229102['model'];if(!_0x4b7bb2[_0xf645('0x33')]['hasOwnProperty'](_0xf645('0x39'))){_0x5d6e71[_0xf645('0x21')]=qs['limit'](_0x4b7bb2[_0xf645('0x33')][_0xf645('0x21')]);_0x5d6e71[_0xf645('0x1f')]=qs[_0xf645('0x1f')](_0x4b7bb2['query'][_0xf645('0x1f')]);}_0x5d6e71['order']=qs[_0xf645('0x3a')](_0x4b7bb2[_0xf645('0x33')][_0xf645('0x3a')]);_0x5d6e71[_0xf645('0x3b')]=qs[_0xf645('0x3c')](_['pick'](_0x4b7bb2['query'],_0x229102[_0xf645('0x3c')]),_0x5423a2);if(_0x4b7bb2[_0xf645('0x33')]['filter']){_0x5d6e71[_0xf645('0x3b')]=_[_0xf645('0x3d')](_0x5d6e71[_0xf645('0x3b')],{'$or':_[_0xf645('0x2e')](_0x5423a2,function(_0x4337df){if(_0x4337df['type']!=='VIRTUAL'){var _0x2524bb={};_0x2524bb[_0x4337df['name']]={'$like':'%'+_0x4b7bb2[_0xf645('0x33')][_0xf645('0x3e')]+'%'};return _0x2524bb;}})});}_0x5d6e71=_[_0xf645('0x3d')]({},_0x5d6e71,_0x4b7bb2[_0xf645('0x3f')]);var _0x24b154={'where':_0x5d6e71[_0xf645('0x3b')]};return db['AnalyticTreeReport'][_0xf645('0x22')](_0x24b154)[_0xf645('0x28')](function(_0xd20e49){_0x36f0ad[_0xf645('0x22')]=_0xd20e49;if(_0x4b7bb2[_0xf645('0x33')][_0xf645('0x40')]){_0x5d6e71[_0xf645('0x41')]=[{'all':!![]}];}return db[_0xf645('0x42')]['findAll'](_0x5d6e71);})[_0xf645('0x28')](function(_0x381e2c){_0x36f0ad[_0xf645('0x43')]=_0x381e2c;return _0x36f0ad;})[_0xf645('0x28')](respondWithFilteredResult(_0xc7d9a7,_0x5d6e71))[_0xf645('0x44')](handleError(_0xc7d9a7,null));};exports[_0xf645('0x45')]=function(_0x166df4,_0x2aec2a){var _0x2989b5={'raw':!![],'where':{'id':_0x166df4[_0xf645('0x46')]['id']}},_0x4569c8={};_0x4569c8['model']=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x4569c8[_0xf645('0x33')]=_[_0xf645('0x34')](_0x166df4['query']);_0x4569c8[_0xf645('0x3c')]=_['intersection'](_0x4569c8[_0xf645('0x36')],_0x4569c8[_0xf645('0x33')]);_0x2989b5['attributes']=_[_0xf645('0x35')](_0x4569c8[_0xf645('0x36')],qs[_0xf645('0x38')](_0x166df4['query'][_0xf645('0x38')]));_0x2989b5[_0xf645('0x37')]=_0x2989b5[_0xf645('0x37')]['length']?_0x2989b5[_0xf645('0x37')]:_0x4569c8[_0xf645('0x36')];if(_0x166df4[_0xf645('0x33')][_0xf645('0x40')]){_0x2989b5[_0xf645('0x41')]=[{'all':!![]}];}_0x2989b5=_['merge']({},_0x2989b5,_0x166df4[_0xf645('0x3f')]);return db[_0xf645('0x42')][_0xf645('0x47')](_0x2989b5)[_0xf645('0x28')](handleEntityNotFound(_0x2aec2a,null))['then'](respondWithResult(_0x2aec2a,null))[_0xf645('0x44')](handleError(_0x2aec2a,null));};exports[_0xf645('0x48')]=function(_0x987041,_0x2a1c56){return db[_0xf645('0x42')][_0xf645('0x48')](_0x987041[_0xf645('0x49')],{})[_0xf645('0x28')](respondWithResult(_0x2a1c56,0xc9))[_0xf645('0x44')](handleError(_0x2a1c56,null));};exports[_0xf645('0x27')]=function(_0x2db1a8,_0x3285e9){if(_0x2db1a8['body']['id']){delete _0x2db1a8[_0xf645('0x49')]['id'];}return db['AnalyticTreeReport'][_0xf645('0x47')]({'where':{'id':_0x2db1a8[_0xf645('0x46')]['id']}})[_0xf645('0x28')](handleEntityNotFound(_0x3285e9,null))[_0xf645('0x28')](saveUpdates(_0x2db1a8[_0xf645('0x49')],null))[_0xf645('0x28')](respondWithResult(_0x3285e9,null))[_0xf645('0x44')](handleError(_0x3285e9,null));};exports[_0xf645('0x29')]=function(_0x53d5f4,_0x52b67e){return db[_0xf645('0x42')][_0xf645('0x47')]({'where':{'id':_0x53d5f4[_0xf645('0x46')]['id']}})[_0xf645('0x28')](handleEntityNotFound(_0x52b67e,null))['then'](removeEntity(_0x52b67e,null))[_0xf645('0x44')](handleError(_0x52b67e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f264729..cec3c9b 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 _0x4060=['moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x565969,_0x41ddac){var _0x4c7cd0=function(_0x37decd){while(--_0x37decd){_0x565969['push'](_0x565969['shift']());}};_0x4c7cd0(++_0x41ddac);}(_0x4060,0x175));var _0x0406=function(_0x45dc6f,_0x4b963b){_0x45dc6f=_0x45dc6f-0x0;var _0x543f58=_0x4060[_0x45dc6f];return _0x543f58;};'use strict';var _=require(_0x0406('0x0'));var util=require(_0x0406('0x1'));var logger=require(_0x0406('0x2'))(_0x0406('0x3'));var moment=require(_0x0406('0x4'));var BPromise=require(_0x0406('0x5'));var rp=require(_0x0406('0x6'));var fs=require('fs');var path=require(_0x0406('0x7'));var rimraf=require(_0x0406('0x8'));var config=require('../../config/environment');var attributes=require(_0x0406('0x9'));module[_0x0406('0xa')]=function(_0x590e60,_0x434d4d){return _0x590e60['define'](_0x0406('0xb'),attributes,{'tableName':_0x0406('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97e3=['request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','api','moment'];(function(_0x1efd95,_0x13ae1e){var _0x5158a7=function(_0x91aa53){while(--_0x91aa53){_0x1efd95['push'](_0x1efd95['shift']());}};_0x5158a7(++_0x13ae1e);}(_0x97e3,0x129));var _0x397e=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x97e3[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x397e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x397e('0x1'));var moment=require(_0x397e('0x2'));var BPromise=require('bluebird');var rp=require(_0x397e('0x3'));var fs=require('fs');var path=require(_0x397e('0x4'));var rimraf=require(_0x397e('0x5'));var config=require('../../config/environment');var attributes=require(_0x397e('0x6'));module[_0x397e('0x7')]=function(_0x56f19e,_0x4aa95a){return _0x56f19e[_0x397e('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0x397e('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 fc35dae..9fe9a81 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x55ddb7,_0x3ccea0){var _0x2ab499=function(_0xc0edce){while(--_0xc0edce){_0x55ddb7['push'](_0x55ddb7['shift']());}};_0x2ab499(++_0x3ccea0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'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')]('AnalyticTreeReport,\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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xadb5,0xad));var _0x5adb=function(_0x32c227,_0x58d7b4){_0x32c227=_0x32c227-0x0;var _0x1ce0c3=_0xadb5[_0x32c227];return _0x1ce0c3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b950594..8193d92 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 _0xa4d7=['/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xa4d7,0x106));var _0x7a4d=function(_0x556e63,_0x16abaf){_0x556e63=_0x556e63-0x0;var _0x1f18a9=_0xa4d7[_0x556e63];return _0x1f18a9;};'use strict';var multer=require('multer');var util=require(_0x7a4d('0x0'));var path=require(_0x7a4d('0x1'));var timeout=require(_0x7a4d('0x2'));var express=require(_0x7a4d('0x3'));var router=express[_0x7a4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7a4d('0x5'));var interaction=require(_0x7a4d('0x6'));var config=require(_0x7a4d('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x7a4d('0x8')]('/',auth[_0x7a4d('0x9')](),controller['index']);router[_0x7a4d('0x8')](_0x7a4d('0xa'),auth[_0x7a4d('0x9')](),controller[_0x7a4d('0xb')]);router[_0x7a4d('0xc')]('/',auth[_0x7a4d('0x9')](),controller['create']);router[_0x7a4d('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7a4d('0xe')](_0x7a4d('0xa'),auth[_0x7a4d('0x9')](),controller[_0x7a4d('0xf')]);module[_0x7a4d('0x10')]=router; \ No newline at end of file +var _0x80dc=['get','isAuthenticated','/:id','post','put','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticTreeReport.controller'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x80dc,0x88));var _0xc80d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x80dc[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require('multer');var util=require(_0xc80d('0x0'));var path=require(_0xc80d('0x1'));var timeout=require(_0xc80d('0x2'));var express=require(_0xc80d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc80d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc80d('0x5'));var controller=require(_0xc80d('0x6'));router[_0xc80d('0x7')]('/',auth[_0xc80d('0x8')](),controller['index']);router[_0xc80d('0x7')](_0xc80d('0x9'),auth[_0xc80d('0x8')](),controller['show']);router[_0xc80d('0xa')]('/',auth[_0xc80d('0x8')](),controller['create']);router[_0xc80d('0xb')](_0xc80d('0x9'),auth[_0xc80d('0x8')](),controller['update']);router['delete'](_0xc80d('0x9'),auth[_0xc80d('0x8')](),controller['destroy']);module[_0xc80d('0xc')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index a380e9d..e22c871 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 _0x340c=['STRING','sequelize','exports'];(function(_0x430239,_0x16c552){var _0x553c34=function(_0x2676c2){while(--_0x2676c2){_0x430239['push'](_0x430239['shift']());}};_0x553c34(++_0x16c552);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'name':{'type':Sequelize[_0xc340('0x2')]},'basename':{'type':Sequelize[_0xc340('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa4ba=['STRING','exports'];(function(_0x422652,_0x76af33){var _0x2df88e=function(_0x4b7bae){while(--_0x4b7bae){_0x422652['push'](_0x422652['shift']());}};_0x2df88e(++_0x76af33);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xa4ba[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0xaa4b('0x0')]={'name':{'type':Sequelize[_0xaa4b('0x1')]},'basename':{'type':Sequelize[_0xaa4b('0x1')]},'type':{'type':Sequelize[_0xaa4b('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f4c5044..3526d63 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 _0xe05b=['keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Attachment','findAll','rows','catch','show','params','length','find','clone','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query'];(function(_0x1455f9,_0x282ccd){var _0x33b733=function(_0x2396a3){while(--_0x2396a3){_0x1455f9['push'](_0x1455f9['shift']());}};_0x33b733(++_0x282ccd);}(_0xe05b,0x134));var _0xbe05=function(_0x14828d,_0x23a8fe){_0x14828d=_0x14828d-0x0;var _0x24b214=_0xe05b[_0x14828d];return _0x24b214;};'use strict';var emlformat=require(_0xbe05('0x0'));var rimraf=require(_0xbe05('0x1'));var zipdir=require(_0xbe05('0x2'));var jsonpatch=require(_0xbe05('0x3'));var rp=require(_0xbe05('0x4'));var moment=require('moment');var BPromise=require(_0xbe05('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbe05('0x6'));var csv=require(_0xbe05('0x7'));var ejs=require(_0xbe05('0x8'));var fs=require('fs');var fs_extra=require(_0xbe05('0x9'));var _=require(_0xbe05('0xa'));var squel=require(_0xbe05('0xb'));var crypto=require('crypto');var jsforce=require(_0xbe05('0xc'));var deskjs=require(_0xbe05('0xd'));var toCsv=require(_0xbe05('0x7'));var querystring=require('querystring');var Papa=require(_0xbe05('0xe'));var Redis=require(_0xbe05('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbe05('0x10'));var as=require(_0xbe05('0x11'));var hardwareService=require(_0xbe05('0x12'));var logger=require(_0xbe05('0x13'))(_0xbe05('0x14'));var utils=require('../../config/utils');var config=require(_0xbe05('0x15'));var licenseUtil=require(_0xbe05('0x16'));var db=require(_0xbe05('0x17'))['db'];function respondWithStatusCode(_0x560715,_0x4a2208){_0x4a2208=_0x4a2208||0xcc;return function(_0x1ae855){if(_0x1ae855){return _0x560715['sendStatus'](_0x4a2208);}return _0x560715[_0xbe05('0x18')](_0x4a2208)[_0xbe05('0x19')]();};}function respondWithResult(_0x35c216,_0x484c15){_0x484c15=_0x484c15||0xc8;return function(_0x2cf924){if(_0x2cf924){return _0x35c216['status'](_0x484c15)[_0xbe05('0x1a')](_0x2cf924);}};}function respondWithFilteredResult(_0x149c7e,_0x3471f1){return function(_0xb4650b){if(_0xb4650b){var _0x58d883=typeof _0x3471f1[_0xbe05('0x1b')]===_0xbe05('0x1c')&&typeof _0x3471f1[_0xbe05('0x1d')]===_0xbe05('0x1c');var _0x1b4a93=_0xb4650b[_0xbe05('0x1e')];var _0x7c8c06=_0x58d883?0x0:_0x3471f1[_0xbe05('0x1b')];var _0x188d91=_0x58d883?_0xb4650b[_0xbe05('0x1e')]:_0x3471f1[_0xbe05('0x1b')]+_0x3471f1[_0xbe05('0x1d')];var _0x45f704;if(_0x188d91>=_0x1b4a93){_0x188d91=_0x1b4a93;_0x45f704=0xc8;}else{_0x45f704=0xce;}_0x149c7e[_0xbe05('0x18')](_0x45f704);return _0x149c7e['set'](_0xbe05('0x1f'),_0x7c8c06+'-'+_0x188d91+'/'+_0x1b4a93)[_0xbe05('0x1a')](_0xb4650b);}return null;};}function patchUpdates(_0x4fd2a1){return function(_0xa260b9){try{jsonpatch[_0xbe05('0x20')](_0xa260b9,_0x4fd2a1,!![]);}catch(_0x57f278){return BPromise[_0xbe05('0x21')](_0x57f278);}return _0xa260b9['save']();};}function saveUpdates(_0x7c042b,_0x1c3dd0){return function(_0x46f6ed){if(_0x46f6ed){return _0x46f6ed[_0xbe05('0x22')](_0x7c042b)[_0xbe05('0x23')](function(_0x20fd60){return _0x20fd60;});}return null;};}function removeEntity(_0x5149ca,_0x13bbd2){return function(_0x2fba80){if(_0x2fba80){return _0x2fba80[_0xbe05('0x24')]()[_0xbe05('0x23')](function(){_0x5149ca[_0xbe05('0x18')](0xcc)[_0xbe05('0x19')]();});}};}function handleEntityNotFound(_0xc60542,_0x1ee0fe){return function(_0x1b3707){if(!_0x1b3707){_0xc60542[_0xbe05('0x25')](0x194);}return _0x1b3707;};}function handleError(_0x4915b7,_0xfcc9ff){_0xfcc9ff=_0xfcc9ff||0x1f4;return function(_0x25d757){logger[_0xbe05('0x26')](_0x25d757[_0xbe05('0x27')]);if(_0x25d757['name']){delete _0x25d757[_0xbe05('0x28')];}_0x4915b7[_0xbe05('0x18')](_0xfcc9ff)[_0xbe05('0x29')](_0x25d757);};}exports[_0xbe05('0x2a')]=function(_0x4559c5,_0x1d382a){var _0x1d5187={},_0x162527={},_0x36de8d={'count':0x0,'rows':[]};var _0x121e7c=_[_0xbe05('0x2b')](db['Attachment'][_0xbe05('0x2c')],function(_0xa1cca3){return{'name':_0xa1cca3[_0xbe05('0x2d')],'type':_0xa1cca3[_0xbe05('0x2e')]['key']};});_0x162527['model']=_[_0xbe05('0x2b')](_0x121e7c,_0xbe05('0x28'));_0x162527[_0xbe05('0x2f')]=_[_0xbe05('0x30')](_0x4559c5[_0xbe05('0x2f')]);_0x162527[_0xbe05('0x31')]=_[_0xbe05('0x32')](_0x162527['model'],_0x162527[_0xbe05('0x2f')]);_0x1d5187[_0xbe05('0x33')]=_[_0xbe05('0x32')](_0x162527[_0xbe05('0x34')],qs[_0xbe05('0x35')](_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x35')]));_0x1d5187[_0xbe05('0x33')]=_0x1d5187[_0xbe05('0x33')]['length']?_0x1d5187[_0xbe05('0x33')]:_0x162527[_0xbe05('0x34')];if(!_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x36')](_0xbe05('0x37'))){_0x1d5187['limit']=qs['limit'](_0x4559c5['query']['limit']);_0x1d5187[_0xbe05('0x1b')]=qs[_0xbe05('0x1b')](_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x1b')]);}_0x1d5187['order']=qs[_0xbe05('0x38')](_0x4559c5['query'][_0xbe05('0x38')]);_0x1d5187[_0xbe05('0x39')]=qs[_0xbe05('0x31')](_['pick'](_0x4559c5[_0xbe05('0x2f')],_0x162527[_0xbe05('0x31')]),_0x121e7c);if(_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x3a')]){_0x1d5187[_0xbe05('0x39')]=_[_0xbe05('0x3b')](_0x1d5187[_0xbe05('0x39')],{'$or':_[_0xbe05('0x2b')](_0x121e7c,function(_0x443034){if(_0x443034[_0xbe05('0x2e')]!==_0xbe05('0x3c')){var _0x122d86={};_0x122d86[_0x443034[_0xbe05('0x28')]]={'$like':'%'+_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x3a')]+'%'};return _0x122d86;}})});}_0x1d5187=_[_0xbe05('0x3b')]({},_0x1d5187,_0x4559c5[_0xbe05('0x3d')]);var _0x52a936={'where':_0x1d5187[_0xbe05('0x39')]};return db['Attachment'][_0xbe05('0x1e')](_0x52a936)['then'](function(_0x2dbf29){_0x36de8d['count']=_0x2dbf29;if(_0x4559c5[_0xbe05('0x2f')][_0xbe05('0x3e')]){_0x1d5187[_0xbe05('0x3f')]=[{'all':!![]}];}return db[_0xbe05('0x40')][_0xbe05('0x41')](_0x1d5187);})[_0xbe05('0x23')](function(_0x5baf08){_0x36de8d[_0xbe05('0x42')]=_0x5baf08;return _0x36de8d;})[_0xbe05('0x23')](respondWithFilteredResult(_0x1d382a,_0x1d5187))[_0xbe05('0x43')](handleError(_0x1d382a,null));};exports[_0xbe05('0x44')]=function(_0x107df6,_0x33de19){var _0x114a94={'raw':!![],'where':{'id':_0x107df6[_0xbe05('0x45')]['id']}},_0x3f065b={};_0x3f065b[_0xbe05('0x34')]=_[_0xbe05('0x30')](db['Attachment'][_0xbe05('0x2c')]);_0x3f065b[_0xbe05('0x2f')]=_[_0xbe05('0x30')](_0x107df6[_0xbe05('0x2f')]);_0x3f065b[_0xbe05('0x31')]=_[_0xbe05('0x32')](_0x3f065b[_0xbe05('0x34')],_0x3f065b[_0xbe05('0x2f')]);_0x114a94[_0xbe05('0x33')]=_[_0xbe05('0x32')](_0x3f065b[_0xbe05('0x34')],qs[_0xbe05('0x35')](_0x107df6[_0xbe05('0x2f')]['fields']));_0x114a94[_0xbe05('0x33')]=_0x114a94[_0xbe05('0x33')][_0xbe05('0x46')]?_0x114a94[_0xbe05('0x33')]:_0x3f065b[_0xbe05('0x34')];if(_0x107df6[_0xbe05('0x2f')]['includeAll']){_0x114a94[_0xbe05('0x3f')]=[{'all':!![]}];}_0x114a94=_['merge']({},_0x114a94,_0x107df6[_0xbe05('0x3d')]);return db[_0xbe05('0x40')][_0xbe05('0x47')](_0x114a94)['then'](handleEntityNotFound(_0x33de19,null))[_0xbe05('0x23')](respondWithResult(_0x33de19,null))['catch'](handleError(_0x33de19,null));};exports[_0xbe05('0x48')]=function(_0x2e29f6,_0x231c0f){var _0x398e71={'where':{'id':_0x2e29f6[_0xbe05('0x45')]['id']}},_0x3ecc7b={};_0x3ecc7b['model']=_[_0xbe05('0x30')](db[_0xbe05('0x40')][_0xbe05('0x2c')]);_0x398e71[_0xbe05('0x33')]=_[_0xbe05('0x32')](_0x3ecc7b[_0xbe05('0x34')],qs['fields'](_0x2e29f6[_0xbe05('0x2f')]['fields']));_0x398e71[_0xbe05('0x33')]=_0x398e71[_0xbe05('0x33')][_0xbe05('0x46')]?_0x398e71[_0xbe05('0x33')]:_0x3ecc7b[_0xbe05('0x34')];if(_0x2e29f6[_0xbe05('0x2f')][_0xbe05('0x3e')]){_0x398e71[_0xbe05('0x3f')]=[{'all':!![]}];}_0x398e71=_[_0xbe05('0x3b')]({},_0x398e71,_0x2e29f6[_0xbe05('0x3d')]);return db['Attachment']['find'](_0x398e71)[_0xbe05('0x23')](handleEntityNotFound(_0x231c0f,null))[_0xbe05('0x23')](function(_0x5b86e9){if(_0x5b86e9){var _0x43d152=_0x5b86e9[_0xbe05('0x49')]({'plain':!![]});_0x43d152=qs['omit'](_0x43d152,['id',_0xbe05('0x4a'),_0xbe05('0x4b')]);_0x2e29f6[_0xbe05('0x4c')]=_[_0xbe05('0x4d')](_0x2e29f6['body'],['id','createdAt','updatedAt']);return db[_0xbe05('0x40')][_0xbe05('0x4e')](_['merge'](_0x43d152,_0x2e29f6['body']),{'include':_0x2e29f6[_0xbe05('0x2f')][_0xbe05('0x3e')]?[{'all':!![]}]:undefined});}})[_0xbe05('0x23')](respondWithResult(_0x231c0f,0xc9))['catch'](handleError(_0x231c0f,null));};exports[_0xbe05('0x22')]=function(_0x5976ed,_0x241393){if(_0x5976ed[_0xbe05('0x4c')]['id']){delete _0x5976ed[_0xbe05('0x4c')]['id'];}return db['Attachment'][_0xbe05('0x47')]({'where':{'id':_0x5976ed[_0xbe05('0x45')]['id']}})['then'](handleEntityNotFound(_0x241393,null))['then'](saveUpdates(_0x5976ed[_0xbe05('0x4c')],null))['then'](respondWithResult(_0x241393,null))['catch'](handleError(_0x241393,null));};exports[_0xbe05('0x24')]=function(_0x6941f9,_0xf95a18){return db['Attachment']['find']({'where':{'id':_0x6941f9[_0xbe05('0x45')]['id']}})['then'](handleEntityNotFound(_0xf95a18,null))[_0xbe05('0x23')](removeEntity(_0xf95a18,null))[_0xbe05('0x43')](handleError(_0xf95a18,null));};exports[_0xbe05('0x4e')]=function(_0x12b803,_0xa65c07,_0x273b0e){_0x12b803[_0xbe05('0x4c')]['name']=_0x12b803[_0xbe05('0x4f')][_0xbe05('0x50')];_0x12b803[_0xbe05('0x4c')][_0xbe05('0x51')]=_0x12b803[_0xbe05('0x4f')][_0xbe05('0x52')];_0x12b803[_0xbe05('0x4c')][_0xbe05('0x2e')]=_0x12b803[_0xbe05('0x4f')][_0xbe05('0x53')];return db[_0xbe05('0x40')][_0xbe05('0x4e')](_0x12b803['body'])[_0xbe05('0x23')](respondWithResult(_0xa65c07,0xc9))[_0xbe05('0x43')](handleError(_0xa65c07,null));};exports['download']=function(_0x51721e,_0x880f76,_0x3c19d0){return db[_0xbe05('0x40')][_0xbe05('0x54')]({'where':{'id':_0x51721e[_0xbe05('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x880f76,null))[_0xbe05('0x23')](function(_0x439fda){if(_0x439fda){var _0x103d66=_0x439fda[_0xbe05('0x55')]!==null;var _0x2e7427=path[_0xbe05('0x56')](config[_0xbe05('0x57')],'server/files/attachments/');if(_0x103d66){_0x2e7427=path[_0xbe05('0x56')](_0x2e7427,_0xbe05('0x58'));}var _0x3cbe98=path[_0xbe05('0x56')](_0x2e7427,_0x439fda[_0xbe05('0x51')]);return _0x880f76['download'](_0x3cbe98);}})['catch'](handleError(_0x880f76,null));}; \ No newline at end of file +var _0x7b94=['sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply','save','update','then','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','Attachment','includeAll','include','findAll','catch','show','rawAttributes','intersection','fields','options','find','clone','omit','createdAt','updatedAt','body','create','destroy','file','originalname','filename','download','findOne','params','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b94,0x1a5));var _0x47b9=function(_0x3299dd,_0x1a0d3a){_0x3299dd=_0x3299dd-0x0;var _0x389d09=_0x7b94[_0x3299dd];return _0x389d09;};'use strict';var emlformat=require(_0x47b9('0x0'));var rimraf=require(_0x47b9('0x1'));var zipdir=require(_0x47b9('0x2'));var jsonpatch=require(_0x47b9('0x3'));var rp=require(_0x47b9('0x4'));var moment=require(_0x47b9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x47b9('0x6'));var util=require(_0x47b9('0x7'));var path=require(_0x47b9('0x8'));var sox=require(_0x47b9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x47b9('0xa'));var squel=require(_0x47b9('0xb'));var crypto=require('crypto');var jsforce=require(_0x47b9('0xc'));var deskjs=require(_0x47b9('0xd'));var toCsv=require(_0x47b9('0xe'));var querystring=require('querystring');var Papa=require(_0x47b9('0xf'));var Redis=require(_0x47b9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x47b9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47b9('0x12'));var logger=require(_0x47b9('0x13'))(_0x47b9('0x14'));var utils=require(_0x47b9('0x15'));var config=require(_0x47b9('0x16'));var licenseUtil=require(_0x47b9('0x17'));var db=require(_0x47b9('0x18'))['db'];function respondWithStatusCode(_0x3b7fc7,_0x1a1de9){_0x1a1de9=_0x1a1de9||0xcc;return function(_0x1af2b0){if(_0x1af2b0){return _0x3b7fc7[_0x47b9('0x19')](_0x1a1de9);}return _0x3b7fc7[_0x47b9('0x1a')](_0x1a1de9)[_0x47b9('0x1b')]();};}function respondWithResult(_0x422d89,_0x7e0413){_0x7e0413=_0x7e0413||0xc8;return function(_0x23bb87){if(_0x23bb87){return _0x422d89[_0x47b9('0x1a')](_0x7e0413)[_0x47b9('0x1c')](_0x23bb87);}};}function respondWithFilteredResult(_0x40e9f8,_0x1d4224){return function(_0x3a6ead){if(_0x3a6ead){var _0x27a741=typeof _0x1d4224[_0x47b9('0x1d')]===_0x47b9('0x1e')&&typeof _0x1d4224['limit']===_0x47b9('0x1e');var _0x5639fb=_0x3a6ead['count'];var _0x5db16a=_0x27a741?0x0:_0x1d4224[_0x47b9('0x1d')];var _0x3ad202=_0x27a741?_0x3a6ead[_0x47b9('0x1f')]:_0x1d4224[_0x47b9('0x1d')]+_0x1d4224['limit'];var _0x40f4aa;if(_0x3ad202>=_0x5639fb){_0x3ad202=_0x5639fb;_0x40f4aa=0xc8;}else{_0x40f4aa=0xce;}_0x40e9f8[_0x47b9('0x1a')](_0x40f4aa);return _0x40e9f8['set']('Content-Range',_0x5db16a+'-'+_0x3ad202+'/'+_0x5639fb)[_0x47b9('0x1c')](_0x3a6ead);}return null;};}function patchUpdates(_0x326be3){return function(_0x54805a){try{jsonpatch[_0x47b9('0x20')](_0x54805a,_0x326be3,!![]);}catch(_0x30ebde){return BPromise['reject'](_0x30ebde);}return _0x54805a[_0x47b9('0x21')]();};}function saveUpdates(_0x5aca41,_0x54f707){return function(_0x2cff50){if(_0x2cff50){return _0x2cff50[_0x47b9('0x22')](_0x5aca41)[_0x47b9('0x23')](function(_0x1ce580){return _0x1ce580;});}return null;};}function removeEntity(_0x390e5d,_0x14767e){return function(_0x208bdd){if(_0x208bdd){return _0x208bdd['destroy']()[_0x47b9('0x23')](function(){_0x390e5d[_0x47b9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1396b6,_0x2b76e3){return function(_0x4a7176){if(!_0x4a7176){_0x1396b6[_0x47b9('0x19')](0x194);}return _0x4a7176;};}function handleError(_0x5415e7,_0x1b1fce){_0x1b1fce=_0x1b1fce||0x1f4;return function(_0x175e15){logger[_0x47b9('0x24')](_0x175e15[_0x47b9('0x25')]);if(_0x175e15[_0x47b9('0x26')]){delete _0x175e15[_0x47b9('0x26')];}_0x5415e7[_0x47b9('0x1a')](_0x1b1fce)[_0x47b9('0x27')](_0x175e15);};}exports['index']=function(_0x55cfc1,_0x3e6bd1){var _0x35376e={},_0x2c01d3={},_0xb1eeb2={'count':0x0,'rows':[]};var _0x4cfc60=_[_0x47b9('0x28')](db['Attachment']['rawAttributes'],function(_0x6d446a){return{'name':_0x6d446a[_0x47b9('0x29')],'type':_0x6d446a[_0x47b9('0x2a')][_0x47b9('0x2b')]};});_0x2c01d3[_0x47b9('0x2c')]=_[_0x47b9('0x28')](_0x4cfc60,_0x47b9('0x26'));_0x2c01d3[_0x47b9('0x2d')]=_[_0x47b9('0x2e')](_0x55cfc1[_0x47b9('0x2d')]);_0x2c01d3[_0x47b9('0x2f')]=_['intersection'](_0x2c01d3[_0x47b9('0x2c')],_0x2c01d3['query']);_0x35376e['attributes']=_['intersection'](_0x2c01d3['model'],qs['fields'](_0x55cfc1['query']['fields']));_0x35376e[_0x47b9('0x30')]=_0x35376e[_0x47b9('0x30')][_0x47b9('0x31')]?_0x35376e[_0x47b9('0x30')]:_0x2c01d3[_0x47b9('0x2c')];if(!_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x32')]('nolimit')){_0x35376e[_0x47b9('0x33')]=qs['limit'](_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x33')]);_0x35376e[_0x47b9('0x1d')]=qs[_0x47b9('0x1d')](_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x1d')]);}_0x35376e[_0x47b9('0x34')]=qs[_0x47b9('0x35')](_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x35')]);_0x35376e[_0x47b9('0x36')]=qs[_0x47b9('0x2f')](_[_0x47b9('0x37')](_0x55cfc1[_0x47b9('0x2d')],_0x2c01d3['filters']),_0x4cfc60);if(_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x38')]){_0x35376e[_0x47b9('0x36')]=_[_0x47b9('0x39')](_0x35376e[_0x47b9('0x36')],{'$or':_[_0x47b9('0x28')](_0x4cfc60,function(_0x38bb45){if(_0x38bb45[_0x47b9('0x2a')]!=='VIRTUAL'){var _0xd64e9f={};_0xd64e9f[_0x38bb45[_0x47b9('0x26')]]={'$like':'%'+_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x38')]+'%'};return _0xd64e9f;}})});}_0x35376e=_['merge']({},_0x35376e,_0x55cfc1['options']);var _0xe25974={'where':_0x35376e[_0x47b9('0x36')]};return db[_0x47b9('0x3a')][_0x47b9('0x1f')](_0xe25974)['then'](function(_0x2ad1c9){_0xb1eeb2['count']=_0x2ad1c9;if(_0x55cfc1[_0x47b9('0x2d')][_0x47b9('0x3b')]){_0x35376e[_0x47b9('0x3c')]=[{'all':!![]}];}return db[_0x47b9('0x3a')][_0x47b9('0x3d')](_0x35376e);})[_0x47b9('0x23')](function(_0x28aed6){_0xb1eeb2['rows']=_0x28aed6;return _0xb1eeb2;})['then'](respondWithFilteredResult(_0x3e6bd1,_0x35376e))[_0x47b9('0x3e')](handleError(_0x3e6bd1,null));};exports[_0x47b9('0x3f')]=function(_0x5f53ce,_0x51ee44){var _0x12ce5e={'raw':!![],'where':{'id':_0x5f53ce['params']['id']}},_0x22eaf7={};_0x22eaf7['model']=_['keys'](db[_0x47b9('0x3a')][_0x47b9('0x40')]);_0x22eaf7[_0x47b9('0x2d')]=_[_0x47b9('0x2e')](_0x5f53ce[_0x47b9('0x2d')]);_0x22eaf7[_0x47b9('0x2f')]=_[_0x47b9('0x41')](_0x22eaf7[_0x47b9('0x2c')],_0x22eaf7[_0x47b9('0x2d')]);_0x12ce5e[_0x47b9('0x30')]=_[_0x47b9('0x41')](_0x22eaf7[_0x47b9('0x2c')],qs[_0x47b9('0x42')](_0x5f53ce['query'][_0x47b9('0x42')]));_0x12ce5e[_0x47b9('0x30')]=_0x12ce5e[_0x47b9('0x30')]['length']?_0x12ce5e['attributes']:_0x22eaf7['model'];if(_0x5f53ce[_0x47b9('0x2d')][_0x47b9('0x3b')]){_0x12ce5e['include']=[{'all':!![]}];}_0x12ce5e=_[_0x47b9('0x39')]({},_0x12ce5e,_0x5f53ce[_0x47b9('0x43')]);return db[_0x47b9('0x3a')][_0x47b9('0x44')](_0x12ce5e)['then'](handleEntityNotFound(_0x51ee44,null))[_0x47b9('0x23')](respondWithResult(_0x51ee44,null))[_0x47b9('0x3e')](handleError(_0x51ee44,null));};exports[_0x47b9('0x45')]=function(_0x30ba6c,_0x260bae){var _0x1b98de={'where':{'id':_0x30ba6c['params']['id']}},_0x5d4e9f={};_0x5d4e9f[_0x47b9('0x2c')]=_[_0x47b9('0x2e')](db['Attachment'][_0x47b9('0x40')]);_0x1b98de[_0x47b9('0x30')]=_[_0x47b9('0x41')](_0x5d4e9f[_0x47b9('0x2c')],qs[_0x47b9('0x42')](_0x30ba6c['query']['fields']));_0x1b98de[_0x47b9('0x30')]=_0x1b98de[_0x47b9('0x30')]['length']?_0x1b98de[_0x47b9('0x30')]:_0x5d4e9f['model'];if(_0x30ba6c['query'][_0x47b9('0x3b')]){_0x1b98de['include']=[{'all':!![]}];}_0x1b98de=_[_0x47b9('0x39')]({},_0x1b98de,_0x30ba6c[_0x47b9('0x43')]);return db[_0x47b9('0x3a')]['find'](_0x1b98de)[_0x47b9('0x23')](handleEntityNotFound(_0x260bae,null))[_0x47b9('0x23')](function(_0x373303){if(_0x373303){var _0x376cdf=_0x373303['get']({'plain':!![]});_0x376cdf=qs[_0x47b9('0x46')](_0x376cdf,['id',_0x47b9('0x47'),_0x47b9('0x48')]);_0x30ba6c['body']=_[_0x47b9('0x46')](_0x30ba6c[_0x47b9('0x49')],['id',_0x47b9('0x47'),'updatedAt']);return db[_0x47b9('0x3a')][_0x47b9('0x4a')](_['merge'](_0x376cdf,_0x30ba6c['body']),{'include':_0x30ba6c[_0x47b9('0x2d')][_0x47b9('0x3b')]?[{'all':!![]}]:undefined});}})[_0x47b9('0x23')](respondWithResult(_0x260bae,0xc9))[_0x47b9('0x3e')](handleError(_0x260bae,null));};exports[_0x47b9('0x22')]=function(_0x9c489,_0x14eba3){if(_0x9c489[_0x47b9('0x49')]['id']){delete _0x9c489[_0x47b9('0x49')]['id'];}return db[_0x47b9('0x3a')][_0x47b9('0x44')]({'where':{'id':_0x9c489['params']['id']}})[_0x47b9('0x23')](handleEntityNotFound(_0x14eba3,null))[_0x47b9('0x23')](saveUpdates(_0x9c489[_0x47b9('0x49')],null))[_0x47b9('0x23')](respondWithResult(_0x14eba3,null))['catch'](handleError(_0x14eba3,null));};exports[_0x47b9('0x4b')]=function(_0x1dd72d,_0x10cab3){return db['Attachment']['find']({'where':{'id':_0x1dd72d['params']['id']}})[_0x47b9('0x23')](handleEntityNotFound(_0x10cab3,null))[_0x47b9('0x23')](removeEntity(_0x10cab3,null))[_0x47b9('0x3e')](handleError(_0x10cab3,null));};exports[_0x47b9('0x4a')]=function(_0x252297,_0x1d4680,_0x475bff){_0x252297[_0x47b9('0x49')]['name']=_0x252297[_0x47b9('0x4c')][_0x47b9('0x4d')];_0x252297['body']['basename']=_0x252297[_0x47b9('0x4c')][_0x47b9('0x4e')];_0x252297[_0x47b9('0x49')][_0x47b9('0x2a')]=_0x252297['file']['mimetype'];return db[_0x47b9('0x3a')]['create'](_0x252297[_0x47b9('0x49')])[_0x47b9('0x23')](respondWithResult(_0x1d4680,0xc9))[_0x47b9('0x3e')](handleError(_0x1d4680,null));};exports[_0x47b9('0x4f')]=function(_0xa1c4ca,_0x1207ee,_0x431a0f){return db[_0x47b9('0x3a')][_0x47b9('0x50')]({'where':{'id':_0xa1c4ca[_0x47b9('0x51')]['id']},'raw':!![]})[_0x47b9('0x23')](handleEntityNotFound(_0x1207ee,null))[_0x47b9('0x23')](function(_0x5116cb){if(_0x5116cb){var _0x29e919=_0x5116cb[_0x47b9('0x52')]!==null;var _0x2d2d92=path['join'](config[_0x47b9('0x53')],'server/files/attachments/');if(_0x29e919){_0x2d2d92=path[_0x47b9('0x54')](_0x2d2d92,_0x47b9('0x55'));}var _0x458965=path[_0x47b9('0x54')](_0x2d2d92,_0x5116cb['basename']);return _0x1207ee['download'](_0x458965);}})['catch'](handleError(_0x1207ee,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6b1adb9..76686bf 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 _0xee1e=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0xb52a30,_0x9b4336){var _0x160875=function(_0xd23d7a){while(--_0xd23d7a){_0xb52a30['push'](_0xb52a30['shift']());}};_0x160875(++_0x9b4336);}(_0xee1e,0x82));var _0xeee1=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xee1e[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xeee1('0x0'));var util=require(_0xeee1('0x1'));var logger=require(_0xeee1('0x2'))(_0xeee1('0x3'));var moment=require('moment');var BPromise=require(_0xeee1('0x4'));var rp=require(_0xeee1('0x5'));var fs=require('fs');var path=require(_0xeee1('0x6'));var rimraf=require(_0xeee1('0x7'));var config=require(_0xeee1('0x8'));var attributes=require(_0xeee1('0x9'));module[_0xeee1('0xa')]=function(_0x11bc5b,_0x494240){return _0x11bc5b[_0xeee1('0xb')](_0xeee1('0xc'),attributes,{'tableName':_0xeee1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb06=['../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x577670,_0x32bfb4){var _0x1cd6b3=function(_0x340834){while(--_0x340834){_0x577670['push'](_0x577670['shift']());}};_0x1cd6b3(++_0x32bfb4);}(_0xeb06,0x161));var _0x6eb0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xeb06[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6eb0('0x0'));var util=require(_0x6eb0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6eb0('0x2'));var BPromise=require(_0x6eb0('0x3'));var rp=require(_0x6eb0('0x4'));var fs=require('fs');var path=require(_0x6eb0('0x5'));var rimraf=require(_0x6eb0('0x6'));var config=require(_0x6eb0('0x7'));var attributes=require(_0x6eb0('0x8'));module['exports']=function(_0x3a6448,_0x36df2e){return _0x3a6448[_0x6eb0('0x9')](_0x6eb0('0xa'),attributes,{'tableName':_0x6eb0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 6483f02..b5c0479 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 _0x9224=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','create','body','options','raw'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x9224,0xa3));var _0x4922=function(_0x2539db,_0x5383f0){_0x2539db=_0x2539db-0x0;var _0xb29369=_0x9224[_0x2539db];return _0xb29369;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var moment=require(_0x4922('0x1'));var BPromise=require(_0x4922('0x2'));var rs=require(_0x4922('0x3'));var fs=require('fs');var Redis=require(_0x4922('0x4'));var db=require(_0x4922('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4922('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4922('0x7')][_0x4922('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4216c0,_0x251048,_0x7a8bd1){return new BPromise(function(_0x245562,_0x5c65dd){return client[_0x4922('0x9')](_0x4216c0,_0x7a8bd1)[_0x4922('0xa')](function(_0x50db40){logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));logger[_0x4922('0xe')](_0x4922('0xf'),_0x251048,_0x4922('0xd'),JSON[_0x4922('0x10')](_0x50db40));if(_0x50db40[_0x4922('0x11')]){if(_0x50db40['error'][_0x4922('0x12')]===0x1f4){logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);return _0x5c65dd(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')]['message']);return _0x245562(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}else{logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));_0x245562(_0x50db40[_0x4922('0x14')][_0x4922('0x13')]);}})['catch'](function(_0x2ae924){logger['error'](_0x4922('0xc'),_0x251048,_0x2ae924);_0x5c65dd(_0x2ae924);});});}exports[_0x4922('0x15')]=function(_0x1d7fc2){var _0x15cdc9=this;return new Promise(function(_0x2ef410,_0x435e7b){return db['Attachment'][_0x4922('0x16')](_0x1d7fc2[_0x4922('0x17')],{'raw':_0x1d7fc2[_0x4922('0x18')]?_0x1d7fc2[_0x4922('0x18')][_0x4922('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2b6a2d){logger[_0x4922('0xb')](_0x4922('0x15'),_0x1d7fc2);logger[_0x4922('0xe')](_0x4922('0x15'),_0x1d7fc2,JSON[_0x4922('0x10')](_0x2b6a2d));_0x2ef410(_0x2b6a2d);})[_0x4922('0x1a')](function(_0x3b182b){logger['error'](_0x4922('0x15'),_0x3b182b[_0x4922('0x13')],_0x1d7fc2);_0x435e7b(_0x15cdc9['error'](0x1f4,_0x3b182b[_0x4922('0x13')]));});});}; \ No newline at end of file +var _0x3ee5=['body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create'];(function(_0xe4c144,_0x492eaa){var _0x2360c0=function(_0x5d54c4){while(--_0x5d54c4){_0xe4c144['push'](_0xe4c144['shift']());}};_0x2360c0(++_0x492eaa);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x55a215,_0x5a9a5e){_0x55a215=_0x55a215-0x0;var _0x5464ca=_0x3ee5[_0x55a215];return _0x5464ca;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Attachment,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')](_0x3d788e[_0x53ee('0x1b')],{'raw':_0x3d788e[_0x53ee('0x1c')]?_0x3d788e[_0x53ee('0x1c')][_0x53ee('0x1d')]===undefined?!![]:![]:!![]})[_0x53ee('0xd')](function(_0x2cbd98){logger['info'](_0x53ee('0x18'),_0x3d788e);logger['debug']('CreateAttachment',_0x3d788e,JSON[_0x53ee('0x1e')](_0x2cbd98));_0x708604(_0x2cbd98);})[_0x53ee('0x17')](function(_0x4105d6){logger['error'](_0x53ee('0x18'),_0x4105d6[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb[_0x53ee('0x13')](0x1f4,_0x4105d6[_0x53ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b2d6498..bdc434d 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x4af424,_0x224dde){_0x4af424=_0x4af424-0x0;var _0x4ceca5=_0xdb28[_0x4af424];return _0x4ceca5;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x1c9914,_0x3578db){_0x1c9914=_0x1c9914-0x0;var _0x483451=_0xdb28[_0x1c9914];return _0x483451;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index f380e65..5be9ab7 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d2=['../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','agent','blocked','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport-local','moment','activedirectory2','bluebird','util','../../config/utils','../../config/environment'];(function(_0x416d82,_0xcfd3be){var _0x45096e=function(_0x5e628c){while(--_0x5e628c){_0x416d82['push'](_0x416d82['shift']());}};_0x45096e(++_0xcfd3be);}(_0x01d2,0x86));var _0x201d=function(_0x32ce76,_0x1dc4ee){_0x32ce76=_0x32ce76-0x0;var _0x35d428=_0x01d2[_0x32ce76];return _0x35d428;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x201d('0x0'))['Strategy'];var moment=require(_0x201d('0x1'));var ActiveDirectory=require(_0x201d('0x2'));var BPromise=require(_0x201d('0x3'));var util=require(_0x201d('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x201d('0x5'));var config=require(_0x201d('0x6'));var logger=require(_0x201d('0x7'))(_0x201d('0x8'));function isActiveDirectoryConfigured(_0x32002f){var _0x278c49=![];if(typeof _0x32002f[_0x201d('0x9')]!==_0x201d('0xa')){_0x278c49=_0x32002f[_0x201d('0x9')][_0x201d('0xb')]&&_0x32002f[_0x201d('0x9')]['url']&&_0x32002f['activedirectory'][_0x201d('0xc')];}return _0x278c49;}function adAuthenticate(_0x422774,_0x47ece5,_0x14267b){return new BPromise(function(_0x416328,_0x17b78c){try{var _0x3d1aa1=new ActiveDirectory(_0x422774);_0x3d1aa1[_0x201d('0xd')](_0x47ece5,_0x14267b,function(_0xb0f6b0,_0x28baff){if(_0xb0f6b0){logger['error'](_0x201d('0xe'),_0x47ece5,util[_0x201d('0xf')](_0xb0f6b0,{'showHidden':![],'depth':null}));_0x17b78c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x28baff){logger[_0x201d('0x10')](_0x201d('0x11'),_0x47ece5);_0x17b78c(_0x201d('0x12'));}else{_0x416328(_0x28baff);}});}catch(_0x20de31){_0x17b78c(_0x20de31);}});}function ActiveDirectoryAuthenticate(_0x45ce2a,_0x5174ed,_0x1c82ba,_0x56d70f){var _0x25385c,_0x4e02ea;if(!isActiveDirectoryConfigured(config)){logger[_0x201d('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x5174ed);return _0x56d70f(null,![],{'message':_0x201d('0x12')});}return db['Setting'][_0x201d('0x13')]({'where':{'id':0x1},'attributes':[_0x201d('0x14'),_0x201d('0x15')],'raw':!![]})[_0x201d('0x16')](function(_0x199213){_0x25385c=_0x199213;if(!_0x25385c[_0x201d('0x14')]){logger[_0x201d('0x10')](_0x201d('0x17'),_0x5174ed);throw new Error(_0x201d('0x12'));}return _0x45ce2a[_0x201d('0x13')]({'attributes':['id',_0x201d('0x18'),_0x201d('0x19'),_0x201d('0x1a'),_0x201d('0x1b'),_0x201d('0x1c'),'blocked',_0x201d('0x1d'),_0x201d('0x1e')],'where':{'name':_0x5174ed,'role':{'$or':['admin','user',_0x201d('0x1f')]},'adSsoEnabled':!![]}});})[_0x201d('0x16')](function(_0xea7166){if(!_0xea7166||_0xea7166&&_0xea7166[_0x201d('0x18')]!==_0x5174ed){throw new Error(_0x201d('0x12'));}_0x4e02ea=_0xea7166;var _0x49d6d8=_0x4e02ea[_0x201d('0x18')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x201d('0x9')],_0x49d6d8,_0x1c82ba);})[_0x201d('0x16')](function(_0x1ec11f){if(_0x4e02ea[_0x201d('0x1c')]){throw new Error(_0x201d('0x12'));}if(_0x25385c[_0x201d('0x15')]>0x0){if(_0x4e02ea[_0x201d('0x20')]){if(moment(_0x4e02ea[_0x201d('0x1d')])[_0x201d('0x21')](_0x25385c[_0x201d('0x15')],_0x201d('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x201d('0x23')](_0x4e02ea,0x0,![],null)['then'](function(){return utils[_0x201d('0x24')](_0x4e02ea);})[_0x201d('0x16')](function(){return _0x56d70f(null,_0x4e02ea);});}else{return utils[_0x201d('0x24')](_0x4e02ea)[_0x201d('0x16')](function(){return _0x56d70f(null,_0x4e02ea);});}}else{return utils[_0x201d('0x24')](_0x4e02ea)[_0x201d('0x16')](function(){return _0x56d70f(null,_0x4e02ea);});}})[_0x201d('0x25')](function(_0x2dca4a){return _0x56d70f(null,![],_0x2dca4a);});}function handleError(_0x22e1fc,_0x56930c,_0x4ee995){return _0x22e1fc[_0x201d('0x26')](_0x56930c||0x1f4)[_0x201d('0x27')]({'message':_0x4ee995?_0x4ee995[_0x201d('0x28')]||_0x4ee995:''});}exports[_0x201d('0x29')]=function(_0x4cd6bd,_0x3c5ee5,_0x2bb7e2){passport[_0x201d('0xd')](_0x201d('0x2a'),function(_0x43c47d,_0x432d2e,_0x45b2fd){var _0x30c980=_0x43c47d||_0x45b2fd;if(_0x30c980){return handleError(_0x3c5ee5,0x191,_0x30c980);}if(!_0x432d2e){return handleError(_0x3c5ee5,0x194,{'message':_0x201d('0x2b')});}else{var _0x5c8e74={'payload':{'id':_0x432d2e['id'],'role':_0x432d2e[_0x201d('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x201d('0x2c')](_0x5c8e74)['then'](function(_0x37a5f4){_0x3c5ee5[_0x201d('0x2d')]({'id':_0x432d2e['id'],'token':_0x37a5f4,'statusCall':'','isAlreadyLogged':_0x432d2e[_0x201d('0x1e')]});});}})(_0x4cd6bd,_0x3c5ee5,_0x2bb7e2);};passport[_0x201d('0x2e')](_0x201d('0x2a'),new LocalStrategy({'usernameField':_0x201d('0x18'),'passwordField':'password'},function(_0x5edd4b,_0x1b1ce0,_0xa314a1){return ActiveDirectoryAuthenticate(db['User'],_0x5edd4b,_0x1b1ce0,_0xa314a1);})); \ No newline at end of file +var _0x8e76=['then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','user','agent','disabled','add','clearBlockUser','getLicense','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','blockDuration'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0x8e76,0x78));var _0x68e7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8e76[_0x501510];return _0x1e6ee5;};'use strict';var passport=require(_0x68e7('0x0'));var LocalStrategy=require(_0x68e7('0x1'))[_0x68e7('0x2')];var moment=require(_0x68e7('0x3'));var ActiveDirectory=require(_0x68e7('0x4'));var BPromise=require(_0x68e7('0x5'));var util=require(_0x68e7('0x6'));var db=require(_0x68e7('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x68e7('0x8'));var config=require(_0x68e7('0x9'));var logger=require(_0x68e7('0xa'))(_0x68e7('0xb'));function isActiveDirectoryConfigured(_0x1a8fe1){var _0x534a9c=![];if(typeof _0x1a8fe1[_0x68e7('0xc')]!==_0x68e7('0xd')){_0x534a9c=_0x1a8fe1['activedirectory'][_0x68e7('0xe')]&&_0x1a8fe1[_0x68e7('0xc')]['url']&&_0x1a8fe1[_0x68e7('0xc')][_0x68e7('0xf')];}return _0x534a9c;}function adAuthenticate(_0x397fa0,_0x471205,_0x23cd0f){return new BPromise(function(_0x2ca776,_0xdef1c9){try{var _0x17f0da=new ActiveDirectory(_0x397fa0);_0x17f0da[_0x68e7('0x10')](_0x471205,_0x23cd0f,function(_0x4fa425,_0x37c456){if(_0x4fa425){logger[_0x68e7('0x11')](_0x68e7('0x12'),_0x471205,util['inspect'](_0x4fa425,{'showHidden':![],'depth':null}));_0xdef1c9(_0x68e7('0x13'));}else if(!_0x37c456){logger['error'](_0x68e7('0x14'),_0x471205);_0xdef1c9(_0x68e7('0x13'));}else{_0x2ca776(_0x37c456);}});}catch(_0xe61194){_0xdef1c9(_0xe61194);}});}function ActiveDirectoryAuthenticate(_0xf4809e,_0x58a1f7,_0x1e3687,_0xd76bf3){var _0x122edf,_0x2e5800;if(!isActiveDirectoryConfigured(config)){logger[_0x68e7('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x58a1f7);return _0xd76bf3(null,![],{'message':_0x68e7('0x13')});}return db[_0x68e7('0x15')][_0x68e7('0x16')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x68e7('0x17')],'raw':!![]})[_0x68e7('0x18')](function(_0x2b924e){_0x122edf=_0x2b924e;if(!_0x122edf[_0x68e7('0x19')]){logger[_0x68e7('0x11')](_0x68e7('0x1a'),_0x58a1f7);throw new Error(_0x68e7('0x13'));}return _0xf4809e['findOne']({'attributes':['id',_0x68e7('0x1b'),_0x68e7('0x1c'),_0x68e7('0x1d'),_0x68e7('0x1e'),'disabled',_0x68e7('0x1f'),_0x68e7('0x20'),_0x68e7('0x21')],'where':{'name':_0x58a1f7,'role':{'$or':['admin',_0x68e7('0x22'),_0x68e7('0x23')]},'adSsoEnabled':!![]}});})[_0x68e7('0x18')](function(_0xbdf13c){if(!_0xbdf13c||_0xbdf13c&&_0xbdf13c[_0x68e7('0x1b')]!==_0x58a1f7){throw new Error(_0x68e7('0x13'));}_0x2e5800=_0xbdf13c;var _0x144a39=_0x2e5800[_0x68e7('0x1b')]+'@'+config[_0x68e7('0xc')]['domain'];return adAuthenticate(config[_0x68e7('0xc')],_0x144a39,_0x1e3687);})[_0x68e7('0x18')](function(_0xa8fd7f){if(_0x2e5800[_0x68e7('0x24')]){throw new Error(_0x68e7('0x13'));}if(_0x122edf['blockDuration']>0x0){if(_0x2e5800[_0x68e7('0x1f')]){if(moment(_0x2e5800[_0x68e7('0x20')])[_0x68e7('0x25')](_0x122edf[_0x68e7('0x17')],'minutes')>moment()){throw new Error(_0x68e7('0x13'));}return utils[_0x68e7('0x26')](_0x2e5800,0x0,![],null)['then'](function(){return utils[_0x68e7('0x27')](_0x2e5800);})[_0x68e7('0x18')](function(){return _0xd76bf3(null,_0x2e5800);});}else{return utils['getLicense'](_0x2e5800)['then'](function(){return _0xd76bf3(null,_0x2e5800);});}}else{return utils[_0x68e7('0x27')](_0x2e5800)[_0x68e7('0x18')](function(){return _0xd76bf3(null,_0x2e5800);});}})['catch'](function(_0x3b331a){return _0xd76bf3(null,![],_0x3b331a);});}function handleError(_0x3ee031,_0x3e43dc,_0x10e81){return _0x3ee031[_0x68e7('0x28')](_0x3e43dc||0x1f4)[_0x68e7('0x29')]({'message':_0x10e81?_0x10e81['message']||_0x10e81:''});}exports[_0x68e7('0x2a')]=function(_0x69a8f9,_0x1a1cad,_0x39508b){passport[_0x68e7('0x10')](_0x68e7('0x2b'),function(_0x4e0e25,_0x3ddaaf,_0x5e02cb){var _0x30e13c=_0x4e0e25||_0x5e02cb;if(_0x30e13c){return handleError(_0x1a1cad,0x191,_0x30e13c);}if(!_0x3ddaaf){return handleError(_0x1a1cad,0x194,{'message':_0x68e7('0x2c')});}else{var _0x25c053={'payload':{'id':_0x3ddaaf['id'],'role':_0x3ddaaf[_0x68e7('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x68e7('0x2d')](_0x25c053)[_0x68e7('0x18')](function(_0x110796){_0x1a1cad['json']({'id':_0x3ddaaf['id'],'token':_0x110796,'statusCall':'','isAlreadyLogged':_0x3ddaaf['online']});});}})(_0x69a8f9,_0x1a1cad,_0x39508b);};passport[_0x68e7('0x2e')](_0x68e7('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':_0x68e7('0x1c')},function(_0x50b943,_0xce2a35,_0x381979){return ActiveDirectoryAuthenticate(db[_0x68e7('0x2f')],_0x50b943,_0xce2a35,_0x381979);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 71d7529..3662c71 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e94=['exports','express','Router','post','login'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9e94,0xc4));var _0x49e9=function(_0x4bc40b,_0x4e80e4){_0x4bc40b=_0x4bc40b-0x0;var _0x1f64e7=_0x9e94[_0x4bc40b];return _0x1f64e7;};'use strict';var express=require(_0x49e9('0x0'));var router=express[_0x49e9('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x49e9('0x2')]('/',controller[_0x49e9('0x3')]);module[_0x49e9('0x4')]=router; \ No newline at end of file +var _0x52f3=['login','Router','./authActiveDirectory.controller','post'];(function(_0x296e50,_0x323699){var _0x1350f4=function(_0x23a0a8){while(--_0x23a0a8){_0x296e50['push'](_0x296e50['shift']());}};_0x1350f4(++_0x323699);}(_0x52f3,0x1d5));var _0x352f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x52f3[_0x432682];return _0x463d05;};'use strict';var express=require('express');var router=express[_0x352f('0x0')]();var controller=require(_0x352f('0x1'));router[_0x352f('0x2')]('/',controller[_0x352f('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index cf9e180..c646e5a 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x2dc3c2,_0x48e3da){_0x2dc3c2=_0x2dc3c2-0x0;var _0x25e4c1=_0x7a54[_0x2dc3c2];return _0x25e4c1;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4835d0,_0x44029c){var _0x46e62f=function(_0x196662){while(--_0x196662){_0x4835d0['push'](_0x4835d0['shift']());}};_0x46e62f(++_0x44029c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 865801a..f63e495 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 _0xc59c=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback'];(function(_0x5027ee,_0x3b5b7e){var _0x2edca6=function(_0x5214ed){while(--_0x5214ed){_0x5027ee['push'](_0x5027ee['shift']());}};_0x2edca6(++_0x3b5b7e);}(_0xc59c,0x72));var _0xcc59=function(_0x3cb6d8,_0x19ff85){_0x3cb6d8=_0x3cb6d8-0x0;var _0x5c7088=_0xc59c[_0x3cb6d8];return _0x5c7088;};'use strict';var express=require(_0xcc59('0x0'));var passport=require(_0xcc59('0x1'));var router=express[_0xcc59('0x2')]();var controller=require(_0xcc59('0x3'));var userController=require(_0xcc59('0x4'));var authService=require('../../components/auth/service');router[_0xcc59('0x5')]('/',controller['login']);router[_0xcc59('0x5')](_0xcc59('0x6'),controller[_0xcc59('0x7')],authService[_0xcc59('0x8')],userController['login'],authService[_0xcc59('0x9')]);module[_0xcc59('0xa')]=router; \ No newline at end of file +var _0x16dc=['../../components/auth/service','get','/callback','callback','login','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x2d17b5,_0x212434){var _0x34ce54=function(_0x3397da){while(--_0x3397da){_0x2d17b5['push'](_0x2d17b5['shift']());}};_0x34ce54(++_0x212434);}(_0x16dc,0xe3));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var passport=require(_0xc16d('0x0'));var router=express['Router']();var controller=require(_0xc16d('0x1'));var userController=require(_0xc16d('0x2'));var authService=require(_0xc16d('0x3'));router[_0xc16d('0x4')]('/',controller['login']);router[_0xc16d('0x4')](_0xc16d('0x5'),controller[_0xc16d('0x6')],authService['isMiddleware'],userController[_0xc16d('0x7')],authService[_0xc16d('0x8')]);module[_0xc16d('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f28bbb7..eefafc7 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 _0xa809=['salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','signToken','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','/reset/','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','passport','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','then','name','password'];(function(_0x57de4f,_0x41d9b1){var _0xf5df85=function(_0x57bffb){while(--_0x57bffb){_0x57de4f['push'](_0x57de4f['shift']());}};_0xf5df85(++_0x41d9b1);}(_0xa809,0x1f3));var _0x9a80=function(_0x13944e,_0x28c7ae){_0x13944e=_0x13944e-0x0;var _0x357a91=_0xa809[_0x13944e];return _0x357a91;};'use strict';var util=require('util');var passport=require(_0x9a80('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x9a80('0x1'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x9a80('0x2'))['db'];var authService=require(_0x9a80('0x3'));var utils=require(_0x9a80('0x4'));var client=jayson[_0x9a80('0x5')]['http']({'port':0x232b});function localAuthenticate(_0x295910,_0x504ba8,_0x17b704,_0x286ac5){var _0x4ea507,_0x1ef67a;return db[_0x9a80('0x6')][_0x9a80('0x7')]({'where':{'id':0x1},'attributes':[_0x9a80('0x8'),'blockDuration'],'raw':!![]})[_0x9a80('0x9')](function(_0x1e0017){_0x4ea507=_0x1e0017;return _0x295910[_0x9a80('0x7')]({'attributes':['id',_0x9a80('0xa'),_0x9a80('0xb'),_0x9a80('0xc'),_0x9a80('0xd'),_0x9a80('0xe'),'blocked',_0x9a80('0xf'),_0x9a80('0x10')],'where':{'name':_0x504ba8,'role':{'$or':[_0x9a80('0x11'),_0x9a80('0x12'),_0x9a80('0x13')]}}});})[_0x9a80('0x9')](function(_0x25f667){if(!_0x25f667||_0x25f667&&_0x25f667[_0x9a80('0xa')]!==_0x504ba8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1ef67a=_0x25f667;return _0x1ef67a;}})[_0x9a80('0x9')](function(){_0x1ef67a['authenticate'](_0x17b704,function(_0x384be7,_0x109066){var _0x3625b0=_0x1ef67a['loginAttempts']+0x1;if(_0x384be7){return _0x286ac5(_0x384be7);}else if(!_0x109066){if(_0x1ef67a[_0x9a80('0xe')]){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else if(_0x4ea507[_0x9a80('0x8')]>0x0){if(_0x1ef67a[_0x9a80('0x15')]){if(_0x4ea507[_0x9a80('0x16')]>0x0){if(moment(_0x1ef67a['blockedAt'])[_0x9a80('0x17')](_0x4ea507['blockDuration'],_0x9a80('0x18'))>moment()){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else{return utils[_0x9a80('0x19')](_0x1ef67a,_0x3625b0,![],null)[_0x9a80('0x9')](function(){return _0x286ac5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x286ac5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3625b0>=_0x4ea507[_0x9a80('0x8')]){return utils[_0x9a80('0x19')](_0x1ef67a,0x0,!![],moment())[_0x9a80('0x9')](function(){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});});}else{return utils[_0x9a80('0x19')](_0x1ef67a,_0x3625b0,![],null)['then'](function(){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});});}}}else{return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}}else{if(_0x1ef67a[_0x9a80('0xe')]){return _0x286ac5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ea507['allowedLoginAttempts']>0x0){if(_0x1ef67a[_0x9a80('0x15')]){if(_0x4ea507['blockDuration']>0x0){if(moment(_0x1ef67a[_0x9a80('0xf')])['add'](_0x4ea507[_0x9a80('0x16')],'minutes')>moment()){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else{return utils[_0x9a80('0x19')](_0x1ef67a,0x0,![],null)[_0x9a80('0x9')](function(){return utils[_0x9a80('0x1a')](_0x1ef67a);})[_0x9a80('0x9')](function(){return _0x286ac5(null,_0x1ef67a);});}}else{return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}}else{return utils[_0x9a80('0x19')](_0x1ef67a,0x0,![],null)[_0x9a80('0x9')](function(){return utils['getLicense'](_0x1ef67a);})[_0x9a80('0x9')](function(){return _0x286ac5(null,_0x1ef67a);})[_0x9a80('0x1b')](function(_0x5b7f91){return _0x286ac5(null,![],_0x5b7f91);});}}else{if(_0x1ef67a[_0x9a80('0x15')]){return _0x286ac5(null,![],{'message':_0x9a80('0x14')});}else{return utils['getLicense'](_0x1ef67a)[_0x9a80('0x9')](function(){return _0x286ac5(null,_0x1ef67a);});}}}});})[_0x9a80('0x1b')](function(_0x28ce35){return _0x286ac5(null,![],_0x28ce35);});}function sendServiceMail(_0x2ef801){return db[_0x9a80('0x1c')][_0x9a80('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x9a80('0x1e')],'include':[{'model':db[_0x9a80('0x1f')],'as':_0x9a80('0x20'),'include':[{'model':db[_0x9a80('0x21')],'as':_0x9a80('0x21')}]}]})['then'](function(_0x3c0975){if(!_0x3c0975){throw new Error(_0x9a80('0x22'));}var _0x2ccd6b=_0x3c0975[_0x9a80('0x23')]();var _0x4a9786={'account':_0x2ccd6b,'message':_[_0x9a80('0x24')]({'from':util[_0x9a80('0x25')](_0x9a80('0x26'),_0x3c0975[_0x9a80('0xa')],_0x3c0975['email']||_0x3c0975[_0x9a80('0x20')][_0x9a80('0x12')])},_0x2ef801)};return client['request'](_0x9a80('0x27'),_0x4a9786);})[_0x9a80('0x9')](function(_0x9b4d1b){if(_0x9b4d1b[_0x9a80('0x28')]){throw new Error(util['format'](_0x9a80('0x29'),_0x9b4d1b[_0x9a80('0x28')][_0x9a80('0x2a')]||JSON[_0x9a80('0x2b')](_0x9b4d1b[_0x9a80('0x28')])));}return!![];});}function handleError(_0x435f33,_0x302edd,_0x2e6701){return _0x435f33[_0x9a80('0x2c')](_0x302edd||0x1f4)[_0x9a80('0x2d')]({'message':_0x2e6701?_0x2e6701[_0x9a80('0x2a')]||_0x2e6701:''});}exports[_0x9a80('0x2e')]=function(_0xc26f66,_0x3da968,_0x1d58df){passport['authenticate']('local-login',function(_0x480800,_0x4139a0,_0xf7d39f){var _0xcb098e=_0x480800||_0xf7d39f;if(_0xcb098e){return handleError(_0x3da968,0x191,_0xcb098e);}if(!_0x4139a0){return handleError(_0x3da968,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x16b0f0={'payload':{'id':_0x4139a0['id'],'role':_0x4139a0[_0x9a80('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x9a80('0x2f')](_0x16b0f0)[_0x9a80('0x9')](function(_0x4dee01){_0x3da968['json']({'id':_0x4139a0['id'],'token':_0x4dee01,'statusCall':'','isAlreadyLogged':_0x4139a0['online']});});}})(_0xc26f66,_0x3da968,_0x1d58df);};exports['forgot']=function(_0x377c2a,_0x5b3bc7){if(!_0x377c2a[_0x9a80('0x30')]['email']){return handleError(_0x5b3bc7,0x1f4,{'message':_0x9a80('0x31')});}var _0x594a9b=rs[_0x9a80('0x32')]();_0x377c2a[_0x9a80('0x30')][_0x9a80('0x1e')]=_0x377c2a[_0x9a80('0x30')]['email'][_0x9a80('0x33')]()['toLowerCase']();var _0x44da37;return db[_0x9a80('0x6')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x9a80('0x9')](function(_0x510722){_0x44da37=_0x510722;return db[_0x9a80('0x34')][_0x9a80('0x1d')]({'where':{'email':_0x377c2a[_0x9a80('0x30')][_0x9a80('0x1e')]}});})[_0x9a80('0x9')](function(_0x206301){if(!_0x206301){throw new Error(_0x9a80('0x35'));}if(_0x206301[_0x9a80('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x206301[_0x9a80('0x15')]){if(moment(_0x206301[_0x9a80('0xf')])[_0x9a80('0x17')](_0x44da37[_0x9a80('0x16')],_0x9a80('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x206301['blocked']=![];_0x206301[_0x9a80('0xf')]=null;}}_0x206301[_0x9a80('0x36')]=_0x594a9b;_0x206301[_0x9a80('0x37')]=Date[_0x9a80('0x38')]()+0x36ee80;return _0x206301[_0x9a80('0x39')]();})[_0x9a80('0x9')](function(){return sendServiceMail({'to':_0x377c2a[_0x9a80('0x30')][_0x9a80('0x1e')],'subject':_0x9a80('0x3a'),'text':_0x9a80('0x3b')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9a80('0x3c')+_0x377c2a['headers'][_0x9a80('0x3d')]+_0x9a80('0x3e')+_0x594a9b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x9a80('0x9')](function(){_0x5b3bc7[_0x9a80('0x2c')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x9a80('0x1b')](function(_0x126f29){return handleError(_0x5b3bc7,0x1f4,_0x126f29);});};exports[_0x9a80('0x3f')]=function(_0x1aeeca,_0x548472){return db['User'][_0x9a80('0x1d')]({'where':{'resetPasswordToken':_0x1aeeca[_0x9a80('0x40')][_0x9a80('0x41')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x9a80('0x9')](function(_0x52f478){if(!_0x52f478){throw new Error(_0x9a80('0x42'));}return db[_0x9a80('0x6')]['findOne']({'attributes':['id',_0x9a80('0x43'),_0x9a80('0x44'),_0x9a80('0x45')]})[_0x9a80('0x9')](function(_0x39e36b){if(_0x39e36b['securePassword'])authService['validatePasswordPattern'](_0x1aeeca['body']['password']);if(!_0x39e36b[_0x9a80('0x44')]||!_0x52f478[_0x9a80('0x46')])return _0x52f478;authService[_0x9a80('0x47')](_0x1aeeca[_0x9a80('0x30')][_0x9a80('0xb')],_0x52f478['previousPasswords'],_0x39e36b[_0x9a80('0x45')]);return _0x52f478;})[_0x9a80('0x9')](function(){_0x52f478[_0x9a80('0xb')]=_0x1aeeca[_0x9a80('0x30')][_0x9a80('0xb')];_0x52f478['resetPasswordToken']=null;_0x52f478['resetPasswordExpires']=null;return _0x52f478[_0x9a80('0x39')]();});})[_0x9a80('0x9')](function(){_0x548472[_0x9a80('0x2c')](0xc8)[_0x9a80('0x2d')]({'message':_0x9a80('0x48')});})[_0x9a80('0x1b')](function(_0x4735bd){return handleError(_0x548472,0x1f4,_0x4735bd);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x9a80('0xa'),'passwordField':_0x9a80('0xb')},function(_0x47eb9d,_0x55a4e2,_0x371fc1){return localAuthenticate(db[_0x9a80('0x34')],_0x47eb9d,_0x55a4e2,_0x371fc1);})); \ No newline at end of file +var _0x8727=['add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','request','SendMail','error','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','toLowerCase','Setting','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','status','use','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8727,0x8c));var _0x7872=function(_0x2b18ba,_0x5bbe72){_0x2b18ba=_0x2b18ba-0x0;var _0x5db9a2=_0x8727[_0x2b18ba];return _0x5db9a2;};'use strict';var util=require('util');var passport=require(_0x7872('0x0'));var LocalStrategy=require(_0x7872('0x1'))[_0x7872('0x2')];var jayson=require(_0x7872('0x3'));var _=require('lodash');var rs=require(_0x7872('0x4'));var moment=require('moment');var db=require(_0x7872('0x5'))['db'];var authService=require(_0x7872('0x6'));var utils=require(_0x7872('0x7'));var client=jayson[_0x7872('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x3a7c04,_0x130bbf,_0xba7c24,_0x47b40e){var _0x12f9bb,_0x2e42e4;return db['Setting'][_0x7872('0x9')]({'where':{'id':0x1},'attributes':[_0x7872('0xa'),_0x7872('0xb')],'raw':!![]})[_0x7872('0xc')](function(_0x220714){_0x12f9bb=_0x220714;return _0x3a7c04[_0x7872('0x9')]({'attributes':['id',_0x7872('0xd'),_0x7872('0xe'),'salt',_0x7872('0xf'),_0x7872('0x10'),_0x7872('0x11'),'blockedAt',_0x7872('0x12')],'where':{'name':_0x130bbf,'role':{'$or':[_0x7872('0x13'),_0x7872('0x14'),_0x7872('0x15')]}}});})[_0x7872('0xc')](function(_0x521a1f){if(!_0x521a1f||_0x521a1f&&_0x521a1f['name']!==_0x130bbf){throw new Error(_0x7872('0x16'));}else{_0x2e42e4=_0x521a1f;return _0x2e42e4;}})[_0x7872('0xc')](function(){_0x2e42e4['authenticate'](_0xba7c24,function(_0x39cf0f,_0x28dd8a){var _0x502ea4=_0x2e42e4[_0x7872('0x12')]+0x1;if(_0x39cf0f){return _0x47b40e(_0x39cf0f);}else if(!_0x28dd8a){if(_0x2e42e4[_0x7872('0x10')]){return _0x47b40e(null,![],{'message':_0x7872('0x16')});}else if(_0x12f9bb['allowedLoginAttempts']>0x0){if(_0x2e42e4[_0x7872('0x11')]){if(_0x12f9bb['blockDuration']>0x0){if(moment(_0x2e42e4[_0x7872('0x17')])[_0x7872('0x18')](_0x12f9bb[_0x7872('0xb')],'minutes')>moment()){return _0x47b40e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2e42e4,_0x502ea4,![],null)[_0x7872('0xc')](function(){return _0x47b40e(null,![],{'message':_0x7872('0x16')});});}}else{return _0x47b40e(null,![],{'message':_0x7872('0x16')});}}else{if(_0x502ea4>=_0x12f9bb[_0x7872('0xa')]){return utils[_0x7872('0x19')](_0x2e42e4,0x0,!![],moment())[_0x7872('0xc')](function(){return _0x47b40e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7872('0x19')](_0x2e42e4,_0x502ea4,![],null)[_0x7872('0xc')](function(){return _0x47b40e(null,![],{'message':_0x7872('0x16')});});}}}else{return _0x47b40e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2e42e4[_0x7872('0x10')]){return _0x47b40e(null,![],{'message':_0x7872('0x16')});}else if(_0x12f9bb[_0x7872('0xa')]>0x0){if(_0x2e42e4[_0x7872('0x11')]){if(_0x12f9bb[_0x7872('0xb')]>0x0){if(moment(_0x2e42e4['blockedAt'])['add'](_0x12f9bb['blockDuration'],_0x7872('0x1a'))>moment()){return _0x47b40e(null,![],{'message':_0x7872('0x16')});}else{return utils['clearBlockUser'](_0x2e42e4,0x0,![],null)[_0x7872('0xc')](function(){return utils['getLicense'](_0x2e42e4);})[_0x7872('0xc')](function(){return _0x47b40e(null,_0x2e42e4);});}}else{return _0x47b40e(null,![],{'message':_0x7872('0x16')});}}else{return utils[_0x7872('0x19')](_0x2e42e4,0x0,![],null)[_0x7872('0xc')](function(){return utils[_0x7872('0x1b')](_0x2e42e4);})[_0x7872('0xc')](function(){return _0x47b40e(null,_0x2e42e4);})[_0x7872('0x1c')](function(_0x34e7f7){return _0x47b40e(null,![],_0x34e7f7);});}}else{if(_0x2e42e4[_0x7872('0x11')]){return _0x47b40e(null,![],{'message':_0x7872('0x16')});}else{return utils[_0x7872('0x1b')](_0x2e42e4)[_0x7872('0xc')](function(){return _0x47b40e(null,_0x2e42e4);});}}}});})['catch'](function(_0x318d1f){return _0x47b40e(null,![],_0x318d1f);});}function sendServiceMail(_0x5718ee){return db[_0x7872('0x1d')][_0x7872('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x7872('0x1f')],'include':[{'model':db[_0x7872('0x20')],'as':_0x7872('0x21'),'include':[{'model':db[_0x7872('0x22')],'as':_0x7872('0x22')}]}]})['then'](function(_0xcf13f8){if(!_0xcf13f8){throw new Error(_0x7872('0x23'));}var _0x48fea5=_0xcf13f8[_0x7872('0x24')]();var _0x57e5e8={'account':_0x48fea5,'message':_['merge']({'from':util[_0x7872('0x25')]('\x22%s\x22\x20<%s>',_0xcf13f8[_0x7872('0xd')],_0xcf13f8[_0x7872('0x1f')]||_0xcf13f8[_0x7872('0x21')][_0x7872('0x14')])},_0x5718ee)};return client[_0x7872('0x26')](_0x7872('0x27'),_0x57e5e8);})['then'](function(_0x2034f4){if(_0x2034f4['error']){throw new Error(util[_0x7872('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2034f4[_0x7872('0x28')]['message']||JSON[_0x7872('0x29')](_0x2034f4[_0x7872('0x28')])));}return!![];});}function handleError(_0x39176c,_0x148bb0,_0x1a7bc6){return _0x39176c['status'](_0x148bb0||0x1f4)[_0x7872('0x2a')]({'message':_0x1a7bc6?_0x1a7bc6[_0x7872('0x2b')]||_0x1a7bc6:''});}exports[_0x7872('0x2c')]=function(_0x13ab45,_0x23b0a9,_0x211d3b){passport['authenticate'](_0x7872('0x2d'),function(_0x395bd0,_0xf67325,_0x3e9637){var _0x2f6cda=_0x395bd0||_0x3e9637;if(_0x2f6cda){return handleError(_0x23b0a9,0x191,_0x2f6cda);}if(!_0xf67325){return handleError(_0x23b0a9,0x194,{'message':_0x7872('0x2e')});}else{var _0x34f531={'payload':{'id':_0xf67325['id'],'role':_0xf67325[_0x7872('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x7872('0x2f')](_0x34f531)['then'](function(_0x10dca1){_0x23b0a9[_0x7872('0x30')]({'id':_0xf67325['id'],'token':_0x10dca1,'statusCall':'','isAlreadyLogged':_0xf67325[_0x7872('0x31')]});});}})(_0x13ab45,_0x23b0a9,_0x211d3b);};exports[_0x7872('0x32')]=function(_0x3446a4,_0x5c7383){if(!_0x3446a4[_0x7872('0x33')][_0x7872('0x1f')]){return handleError(_0x5c7383,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x47a869=rs[_0x7872('0x34')]();_0x3446a4[_0x7872('0x33')][_0x7872('0x1f')]=_0x3446a4[_0x7872('0x33')][_0x7872('0x1f')]['trim']()[_0x7872('0x35')]();var _0x4df299;return db[_0x7872('0x36')][_0x7872('0x9')]({'where':{'id':0x1},'attributes':[_0x7872('0xa'),_0x7872('0xb')],'raw':!![]})[_0x7872('0xc')](function(_0x559ed9){_0x4df299=_0x559ed9;return db[_0x7872('0x37')][_0x7872('0x1e')]({'where':{'email':_0x3446a4[_0x7872('0x33')]['email']}});})[_0x7872('0xc')](function(_0x31cf9b){if(!_0x31cf9b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x31cf9b['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x31cf9b[_0x7872('0x11')]){if(moment(_0x31cf9b[_0x7872('0x17')])['add'](_0x4df299[_0x7872('0xb')],_0x7872('0x1a'))>moment()){throw new Error(_0x7872('0x38'));}else{_0x31cf9b[_0x7872('0x11')]=![];_0x31cf9b[_0x7872('0x17')]=null;}}_0x31cf9b[_0x7872('0x39')]=_0x47a869;_0x31cf9b[_0x7872('0x3a')]=Date[_0x7872('0x3b')]()+0x36ee80;return _0x31cf9b[_0x7872('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x3446a4['body'][_0x7872('0x1f')],'subject':_0x7872('0x3d'),'text':_0x7872('0x3e')+_0x7872('0x3f')+_0x7872('0x40')+_0x3446a4[_0x7872('0x41')][_0x7872('0x42')]+_0x7872('0x43')+_0x47a869+'\x0a\x0a'+_0x7872('0x44')});})[_0x7872('0xc')](function(){_0x5c7383['status'](0xc8)['send']({'message':_0x7872('0x45')});})['catch'](function(_0x2ec122){return handleError(_0x5c7383,0x1f4,_0x2ec122);});};exports[_0x7872('0x46')]=function(_0x243ee3,_0x281590){return db[_0x7872('0x37')][_0x7872('0x1e')]({'where':{'resetPasswordToken':_0x243ee3[_0x7872('0x47')][_0x7872('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x5099dc){if(!_0x5099dc){throw new Error(_0x7872('0x49'));}return db[_0x7872('0x36')][_0x7872('0x9')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x220aaa){if(_0x220aaa[_0x7872('0x4a')])authService[_0x7872('0x4b')](_0x243ee3[_0x7872('0x33')]['password']);if(!_0x220aaa[_0x7872('0x4c')]||!_0x5099dc[_0x7872('0x4d')])return _0x5099dc;authService[_0x7872('0x4e')](_0x243ee3[_0x7872('0x33')][_0x7872('0xe')],_0x5099dc['previousPasswords'],_0x220aaa[_0x7872('0x4f')]);return _0x5099dc;})[_0x7872('0xc')](function(){_0x5099dc[_0x7872('0xe')]=_0x243ee3[_0x7872('0x33')][_0x7872('0xe')];_0x5099dc[_0x7872('0x39')]=null;_0x5099dc['resetPasswordExpires']=null;return _0x5099dc[_0x7872('0x3c')]();});})[_0x7872('0xc')](function(){_0x281590[_0x7872('0x50')](0xc8)[_0x7872('0x2a')]({'message':'Password\x20reset!'});})[_0x7872('0x1c')](function(_0xa8f268){return handleError(_0x281590,0x1f4,_0xa8f268);});};passport[_0x7872('0x51')]('local-login',new LocalStrategy({'usernameField':_0x7872('0xd'),'passwordField':_0x7872('0xe')},function(_0x21b58c,_0x4102e1,_0x54d1e9){return localAuthenticate(db[_0x7872('0x37')],_0x21b58c,_0x4102e1,_0x54d1e9);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c9aca3a..0c1fd0e 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 _0x9367=['exports','express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset'];(function(_0x1872c8,_0x35bfe7){var _0x3bdf54=function(_0x1db9a2){while(--_0x1db9a2){_0x1872c8['push'](_0x1872c8['shift']());}};_0x3bdf54(++_0x35bfe7);}(_0x9367,0x1a8));var _0x7936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9367[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x7936('0x0'));var router=express[_0x7936('0x1')]();var controller=require(_0x7936('0x2'));router[_0x7936('0x3')]('/',controller['login']);router[_0x7936('0x3')](_0x7936('0x4'),controller[_0x7936('0x5')]);router[_0x7936('0x3')](_0x7936('0x6'),controller[_0x7936('0x7')]);module[_0x7936('0x8')]=router; \ No newline at end of file +var _0x46a9=['Router','./authLocal.controller','login','/forgot','forgot','/reset/:token','reset','express'];(function(_0x1d9160,_0x30dfb6){var _0x30881e=function(_0x3f57e6){while(--_0x3f57e6){_0x1d9160['push'](_0x1d9160['shift']());}};_0x30881e(++_0x30dfb6);}(_0x46a9,0xc7));var _0x946a=function(_0x2834c7,_0xf21164){_0x2834c7=_0x2834c7-0x0;var _0x5538b1=_0x46a9[_0x2834c7];return _0x5538b1;};'use strict';var express=require(_0x946a('0x0'));var router=express[_0x946a('0x1')]();var controller=require(_0x946a('0x2'));router['post']('/',controller[_0x946a('0x3')]);router['post'](_0x946a('0x4'),controller[_0x946a('0x5')]);router['post'](_0x946a('0x6'),controller[_0x946a('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 7d37510..39ef430 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 _0xdcfd=['sequelize','exports','STRING','INTEGER'];(function(_0x30063a,_0x4a55c8){var _0x2024d2=function(_0x54df95){while(--_0x54df95){_0x30063a['push'](_0x30063a['shift']());}};_0x2024d2(++_0x4a55c8);}(_0xdcfd,0x16c));var _0xddcf=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0xdcfd[_0x2b2c53];return _0x311ec2;};'use strict';var Sequelize=require(_0xddcf('0x0'));module[_0xddcf('0x1')]={'name':{'type':Sequelize[_0xddcf('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xddcf('0x2')]},'description':{'type':Sequelize[_0xddcf('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xddcf('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xbaa2=['INTEGER','sequelize','exports','STRING'];(function(_0x64ba2e,_0x2d672e){var _0x3914ba=function(_0x474ab8){while(--_0x474ab8){_0x64ba2e['push'](_0x64ba2e['shift']());}};_0x3914ba(++_0x2d672e);}(_0xbaa2,0x13d));var _0x2baa=function(_0xcff1b8,_0x4ce33e){_0xcff1b8=_0xcff1b8-0x0;var _0x480f0e=_0xbaa2[_0xcff1b8];return _0x480f0e;};'use strict';var Sequelize=require(_0x2baa('0x0'));module[_0x2baa('0x1')]={'name':{'type':Sequelize[_0x2baa('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2baa('0x2')]},'description':{'type':Sequelize[_0x2baa('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2baa('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 512ec5e..a229f24 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 _0x5786=['includeAll','include','findAll','rawAttributes','find','catch','create','body','params','addConditions','ids','omit','findOne','pick','hasOwnProperty','getConditions','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','index','map','Automation','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','then'];(function(_0x1921c8,_0x5f4cc4){var _0x18ca16=function(_0x16df03){while(--_0x16df03){_0x1921c8['push'](_0x1921c8['shift']());}};_0x18ca16(++_0x5f4cc4);}(_0x5786,0x1ac));var _0x6578=function(_0x5a158c,_0x56ac5c){_0x5a158c=_0x5a158c-0x0;var _0x598a1a=_0x5786[_0x5a158c];return _0x598a1a;};'use strict';var emlformat=require(_0x6578('0x0'));var rimraf=require(_0x6578('0x1'));var zipdir=require(_0x6578('0x2'));var jsonpatch=require(_0x6578('0x3'));var rp=require(_0x6578('0x4'));var moment=require(_0x6578('0x5'));var BPromise=require(_0x6578('0x6'));var Mustache=require(_0x6578('0x7'));var util=require(_0x6578('0x8'));var path=require(_0x6578('0x9'));var sox=require(_0x6578('0xa'));var csv=require(_0x6578('0xb'));var ejs=require(_0x6578('0xc'));var fs=require('fs');var fs_extra=require(_0x6578('0xd'));var _=require(_0x6578('0xe'));var squel=require(_0x6578('0xf'));var crypto=require(_0x6578('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6578('0x11'));var Redis=require('ioredis');var authService=require(_0x6578('0x12'));var qs=require(_0x6578('0x13'));var as=require(_0x6578('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6578('0x15'))(_0x6578('0x16'));var utils=require(_0x6578('0x17'));var config=require(_0x6578('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6578('0x19'))['db'];function respondWithStatusCode(_0x2ebce1,_0xa39469){_0xa39469=_0xa39469||0xcc;return function(_0x16da82){if(_0x16da82){return _0x2ebce1[_0x6578('0x1a')](_0xa39469);}return _0x2ebce1[_0x6578('0x1b')](_0xa39469)[_0x6578('0x1c')]();};}function respondWithResult(_0x4f3b1f,_0x616640){_0x616640=_0x616640||0xc8;return function(_0x2b8337){if(_0x2b8337){return _0x4f3b1f[_0x6578('0x1b')](_0x616640)[_0x6578('0x1d')](_0x2b8337);}};}function respondWithFilteredResult(_0x470763,_0x3a8f2f){return function(_0x41ba86){if(_0x41ba86){var _0x1f24f4=typeof _0x3a8f2f[_0x6578('0x1e')]===_0x6578('0x1f')&&typeof _0x3a8f2f[_0x6578('0x20')]===_0x6578('0x1f');var _0xe6c3c=_0x41ba86['count'];var _0x2428d4=_0x1f24f4?0x0:_0x3a8f2f[_0x6578('0x1e')];var _0x504b08=_0x1f24f4?_0x41ba86[_0x6578('0x21')]:_0x3a8f2f[_0x6578('0x1e')]+_0x3a8f2f[_0x6578('0x20')];var _0x4c88a5;if(_0x504b08>=_0xe6c3c){_0x504b08=_0xe6c3c;_0x4c88a5=0xc8;}else{_0x4c88a5=0xce;}_0x470763[_0x6578('0x1b')](_0x4c88a5);return _0x470763[_0x6578('0x22')](_0x6578('0x23'),_0x2428d4+'-'+_0x504b08+'/'+_0xe6c3c)['json'](_0x41ba86);}return null;};}function patchUpdates(_0x10f3e6){return function(_0x34452c){try{jsonpatch['apply'](_0x34452c,_0x10f3e6,!![]);}catch(_0x598653){return BPromise[_0x6578('0x24')](_0x598653);}return _0x34452c[_0x6578('0x25')]();};}function saveUpdates(_0xeb9d52,_0x358203){return function(_0x2700fb){if(_0x2700fb){return _0x2700fb[_0x6578('0x26')](_0xeb9d52)['then'](function(_0x5b9f95){return _0x5b9f95;});}return null;};}function removeEntity(_0x451b30,_0x3f5a45){return function(_0x4df8b9){if(_0x4df8b9){return _0x4df8b9[_0x6578('0x27')]()['then'](function(){_0x451b30[_0x6578('0x1b')](0xcc)[_0x6578('0x1c')]();});}};}function handleEntityNotFound(_0x54068a,_0x26f8f1){return function(_0x3b52bd){if(!_0x3b52bd){_0x54068a[_0x6578('0x1a')](0x194);}return _0x3b52bd;};}function handleError(_0x286df6,_0x3e51ed){_0x3e51ed=_0x3e51ed||0x1f4;return function(_0x50987e){logger['error'](_0x50987e[_0x6578('0x28')]);if(_0x50987e['name']){delete _0x50987e['name'];}_0x286df6[_0x6578('0x1b')](_0x3e51ed)['send'](_0x50987e);};}exports[_0x6578('0x29')]=function(_0x19476d,_0x39ba27){var _0x5d01f6={},_0x171bbe={},_0x578f72={'count':0x0,'rows':[]};var _0x391a79=_[_0x6578('0x2a')](db[_0x6578('0x2b')]['rawAttributes'],function(_0x3923e7){return{'name':_0x3923e7['fieldName'],'type':_0x3923e7['type'][_0x6578('0x2c')]};});_0x171bbe[_0x6578('0x2d')]=_['map'](_0x391a79,_0x6578('0x2e'));_0x171bbe[_0x6578('0x2f')]=_[_0x6578('0x30')](_0x19476d[_0x6578('0x2f')]);_0x171bbe[_0x6578('0x31')]=_[_0x6578('0x32')](_0x171bbe[_0x6578('0x2d')],_0x171bbe['query']);_0x5d01f6[_0x6578('0x33')]=_[_0x6578('0x32')](_0x171bbe[_0x6578('0x2d')],qs['fields'](_0x19476d['query'][_0x6578('0x34')]));_0x5d01f6[_0x6578('0x33')]=_0x5d01f6['attributes'][_0x6578('0x35')]?_0x5d01f6['attributes']:_0x171bbe['model'];if(!_0x19476d['query']['hasOwnProperty'](_0x6578('0x36'))){_0x5d01f6[_0x6578('0x20')]=qs[_0x6578('0x20')](_0x19476d[_0x6578('0x2f')][_0x6578('0x20')]);_0x5d01f6[_0x6578('0x1e')]=qs['offset'](_0x19476d['query']['offset']);}_0x5d01f6[_0x6578('0x37')]=qs[_0x6578('0x38')](_0x19476d[_0x6578('0x2f')][_0x6578('0x38')]);_0x5d01f6[_0x6578('0x39')]=qs[_0x6578('0x31')](_['pick'](_0x19476d[_0x6578('0x2f')],_0x171bbe[_0x6578('0x31')]),_0x391a79);if(_0x19476d[_0x6578('0x2f')]['filter']){_0x5d01f6[_0x6578('0x39')]=_[_0x6578('0x3a')](_0x5d01f6[_0x6578('0x39')],{'$or':_[_0x6578('0x2a')](_0x391a79,function(_0x1bda81){if(_0x1bda81[_0x6578('0x3b')]!==_0x6578('0x3c')){var _0x2e33ce={};_0x2e33ce[_0x1bda81['name']]={'$like':'%'+_0x19476d[_0x6578('0x2f')][_0x6578('0x3d')]+'%'};return _0x2e33ce;}})});}_0x5d01f6=_[_0x6578('0x3a')]({},_0x5d01f6,_0x19476d[_0x6578('0x3e')]);var _0x57f503={'where':_0x5d01f6['where']};return db[_0x6578('0x2b')][_0x6578('0x21')](_0x57f503)[_0x6578('0x3f')](function(_0x275475){_0x578f72[_0x6578('0x21')]=_0x275475;if(_0x19476d[_0x6578('0x2f')][_0x6578('0x40')]){_0x5d01f6[_0x6578('0x41')]=[{'all':!![]}];}return db['Automation'][_0x6578('0x42')](_0x5d01f6);})[_0x6578('0x3f')](function(_0x115cfe){_0x578f72['rows']=_0x115cfe;return _0x578f72;})[_0x6578('0x3f')](respondWithFilteredResult(_0x39ba27,_0x5d01f6))['catch'](handleError(_0x39ba27,null));};exports['show']=function(_0x32b047,_0xb01367){var _0x205cb7={'raw':![],'where':{'id':_0x32b047['params']['id']}},_0x51ab7f={};_0x51ab7f['model']=_[_0x6578('0x30')](db[_0x6578('0x2b')][_0x6578('0x43')]);_0x51ab7f[_0x6578('0x2f')]=_['keys'](_0x32b047[_0x6578('0x2f')]);_0x51ab7f[_0x6578('0x31')]=_['intersection'](_0x51ab7f[_0x6578('0x2d')],_0x51ab7f['query']);_0x205cb7[_0x6578('0x33')]=_[_0x6578('0x32')](_0x51ab7f['model'],qs[_0x6578('0x34')](_0x32b047['query'][_0x6578('0x34')]));_0x205cb7[_0x6578('0x33')]=_0x205cb7[_0x6578('0x33')][_0x6578('0x35')]?_0x205cb7[_0x6578('0x33')]:_0x51ab7f[_0x6578('0x2d')];if(_0x32b047[_0x6578('0x2f')]['includeAll']){_0x205cb7[_0x6578('0x41')]=[{'all':!![]}];}_0x205cb7=_['merge']({},_0x205cb7,_0x32b047[_0x6578('0x3e')]);return db['Automation'][_0x6578('0x44')](_0x205cb7)[_0x6578('0x3f')](handleEntityNotFound(_0xb01367,null))[_0x6578('0x3f')](respondWithResult(_0xb01367,null))[_0x6578('0x45')](handleError(_0xb01367,null));};exports['create']=function(_0x5a1880,_0x91f894){return db[_0x6578('0x2b')][_0x6578('0x46')](_0x5a1880[_0x6578('0x47')],{})[_0x6578('0x3f')](respondWithResult(_0x91f894,0xc9))['catch'](handleError(_0x91f894,null));};exports['update']=function(_0xac7011,_0x563aec){if(_0xac7011[_0x6578('0x47')]['id']){delete _0xac7011[_0x6578('0x47')]['id'];}return db[_0x6578('0x2b')]['find']({'where':{'id':_0xac7011[_0x6578('0x48')]['id']}})['then'](handleEntityNotFound(_0x563aec,null))[_0x6578('0x3f')](saveUpdates(_0xac7011['body'],null))[_0x6578('0x3f')](respondWithResult(_0x563aec,null))['catch'](handleError(_0x563aec,null));};exports[_0x6578('0x27')]=function(_0x4f7c53,_0x37366b){return db[_0x6578('0x2b')][_0x6578('0x44')]({'where':{'id':_0x4f7c53[_0x6578('0x48')]['id']}})[_0x6578('0x3f')](handleEntityNotFound(_0x37366b,null))[_0x6578('0x3f')](removeEntity(_0x37366b,null))['catch'](handleError(_0x37366b,null));};exports[_0x6578('0x49')]=function(_0x282d89,_0x489a5b,_0x13464b){return db['Condition'][_0x6578('0x44')]({'where':{'id':_0x282d89[_0x6578('0x48')]['id']}})['then'](handleEntityNotFound(_0x489a5b,null))[_0x6578('0x3f')](function(_0x3bc2c0){if(_0x3bc2c0){return _0x3bc2c0[_0x6578('0x49')](_0x282d89[_0x6578('0x47')][_0x6578('0x4a')],_[_0x6578('0x4b')](_0x282d89[_0x6578('0x47')],[_0x6578('0x4a'),'id'])||{});}})[_0x6578('0x3f')](respondWithResult(_0x489a5b,null))[_0x6578('0x45')](handleError(_0x489a5b,null));};exports['getConditions']=function(_0x15bc20,_0x45a54d,_0x38fe81){var _0xd534ea={};var _0xfa66ca={};var _0x1e2858;var _0x1e5407;return db[_0x6578('0x2b')][_0x6578('0x4c')]({'where':{'id':_0x15bc20['params']['id']}})['then'](handleEntityNotFound(_0x45a54d,null))[_0x6578('0x3f')](function(_0x44c4db){if(_0x44c4db){_0x1e2858=_0x44c4db;_0xfa66ca[_0x6578('0x2d')]=_['keys'](db['Condition']['rawAttributes']);_0xfa66ca['query']=_[_0x6578('0x30')](_0x15bc20[_0x6578('0x2f')]);_0xfa66ca['filters']=_[_0x6578('0x32')](_0xfa66ca[_0x6578('0x2d')],_0xfa66ca[_0x6578('0x2f')]);_0xd534ea[_0x6578('0x33')]=_[_0x6578('0x32')](_0xfa66ca[_0x6578('0x2d')],qs[_0x6578('0x34')](_0x15bc20[_0x6578('0x2f')]['fields']));_0xd534ea[_0x6578('0x33')]=_0xd534ea[_0x6578('0x33')][_0x6578('0x35')]?_0xd534ea[_0x6578('0x33')]:_0xfa66ca[_0x6578('0x2d')];_0xd534ea[_0x6578('0x37')]=qs[_0x6578('0x38')](_0x15bc20[_0x6578('0x2f')][_0x6578('0x38')]);_0xd534ea[_0x6578('0x39')]=qs['filters'](_[_0x6578('0x4d')](_0x15bc20['query'],_0xfa66ca[_0x6578('0x31')]));if(_0x15bc20[_0x6578('0x2f')][_0x6578('0x3d')]){_0xd534ea[_0x6578('0x39')]=_['merge'](_0xd534ea[_0x6578('0x39')],{'$or':_['map'](_0xd534ea['attributes'],function(_0x28fae5){var _0x4f24ee={};_0x4f24ee[_0x28fae5]={'$like':'%'+_0x15bc20[_0x6578('0x2f')][_0x6578('0x3d')]+'%'};return _0x4f24ee;})});}_0xd534ea=_[_0x6578('0x3a')]({},_0xd534ea,_0x15bc20[_0x6578('0x3e')]);return _0x1e2858['getConditions'](_0xd534ea);}})[_0x6578('0x3f')](function(_0x1d5e86){if(_0x1d5e86){_0x1e5407=_0x1d5e86[_0x6578('0x35')];if(!_0x15bc20['query'][_0x6578('0x4e')](_0x6578('0x36'))){_0xd534ea[_0x6578('0x20')]=qs['limit'](_0x15bc20[_0x6578('0x2f')][_0x6578('0x20')]);_0xd534ea[_0x6578('0x1e')]=qs[_0x6578('0x1e')](_0x15bc20[_0x6578('0x2f')]['offset']);}return _0x1e2858[_0x6578('0x4f')](_0xd534ea);}})[_0x6578('0x3f')](function(_0x3531a7){if(_0x3531a7){return _0x3531a7?{'count':_0x1e5407,'rows':_0x3531a7}:null;}})[_0x6578('0x3f')](respondWithResult(_0x45a54d,null))['catch'](handleError(_0x45a54d,null));};exports[_0x6578('0x50')]=function(_0x214912,_0x2fcf3a,_0x22f377){return db['Action'][_0x6578('0x44')]({'where':{'id':_0x214912[_0x6578('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fcf3a,null))['then'](function(_0xe28d21){if(_0xe28d21){return _0xe28d21[_0x6578('0x50')](_0x214912[_0x6578('0x47')]['ids'],_[_0x6578('0x4b')](_0x214912[_0x6578('0x47')],[_0x6578('0x4a'),'id'])||{});}})[_0x6578('0x3f')](respondWithResult(_0x2fcf3a,null))['catch'](handleError(_0x2fcf3a,null));};exports['getActions']=function(_0x48de29,_0x3e62ae,_0xdc752b){var _0x3ae8d1={};var _0x5aa73a={};var _0x4c6e08;var _0x860c05;return db[_0x6578('0x2b')][_0x6578('0x4c')]({'where':{'id':_0x48de29[_0x6578('0x48')]['id']}})[_0x6578('0x3f')](handleEntityNotFound(_0x3e62ae,null))[_0x6578('0x3f')](function(_0x13578b){if(_0x13578b){_0x4c6e08=_0x13578b;_0x5aa73a[_0x6578('0x2d')]=_['keys'](db['Action'][_0x6578('0x43')]);_0x5aa73a[_0x6578('0x2f')]=_[_0x6578('0x30')](_0x48de29[_0x6578('0x2f')]);_0x5aa73a[_0x6578('0x31')]=_[_0x6578('0x32')](_0x5aa73a['model'],_0x5aa73a[_0x6578('0x2f')]);_0x3ae8d1[_0x6578('0x33')]=_[_0x6578('0x32')](_0x5aa73a['model'],qs[_0x6578('0x34')](_0x48de29[_0x6578('0x2f')][_0x6578('0x34')]));_0x3ae8d1['attributes']=_0x3ae8d1[_0x6578('0x33')][_0x6578('0x35')]?_0x3ae8d1[_0x6578('0x33')]:_0x5aa73a[_0x6578('0x2d')];_0x3ae8d1[_0x6578('0x37')]=qs['sort'](_0x48de29[_0x6578('0x2f')]['sort']);_0x3ae8d1['where']=qs[_0x6578('0x31')](_[_0x6578('0x4d')](_0x48de29[_0x6578('0x2f')],_0x5aa73a[_0x6578('0x31')]));if(_0x48de29['query'][_0x6578('0x3d')]){_0x3ae8d1[_0x6578('0x39')]=_[_0x6578('0x3a')](_0x3ae8d1['where'],{'$or':_[_0x6578('0x2a')](_0x3ae8d1[_0x6578('0x33')],function(_0x39e4b0){var _0x4b17e2={};_0x4b17e2[_0x39e4b0]={'$like':'%'+_0x48de29[_0x6578('0x2f')][_0x6578('0x3d')]+'%'};return _0x4b17e2;})});}_0x3ae8d1=_[_0x6578('0x3a')]({},_0x3ae8d1,_0x48de29[_0x6578('0x3e')]);return _0x4c6e08['getActions'](_0x3ae8d1);}})[_0x6578('0x3f')](function(_0x47b902){if(_0x47b902){_0x860c05=_0x47b902[_0x6578('0x35')];if(!_0x48de29['query']['hasOwnProperty'](_0x6578('0x36'))){_0x3ae8d1[_0x6578('0x20')]=qs[_0x6578('0x20')](_0x48de29[_0x6578('0x2f')]['limit']);_0x3ae8d1[_0x6578('0x1e')]=qs[_0x6578('0x1e')](_0x48de29['query']['offset']);}return _0x4c6e08[_0x6578('0x51')](_0x3ae8d1);}})[_0x6578('0x3f')](function(_0xc68ad1){if(_0xc68ad1){return _0xc68ad1?{'count':_0x860c05,'rows':_0xc68ad1}:null;}})['then'](respondWithResult(_0x3e62ae,null))[_0x6578('0x45')](handleError(_0x3e62ae,null));}; \ No newline at end of file +var _0x22b1=['keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','Automation','includeAll','include','findAll','rows','catch','show','find','create','body','params','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','error','name','index','rawAttributes','fieldName','model','map'];(function(_0x564523,_0x5db1c8){var _0x404d2a=function(_0x346236){while(--_0x346236){_0x564523['push'](_0x564523['shift']());}};_0x404d2a(++_0x5db1c8);}(_0x22b1,0x124));var _0x122b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x22b1[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x122b('0x0'));var rimraf=require(_0x122b('0x1'));var zipdir=require(_0x122b('0x2'));var jsonpatch=require(_0x122b('0x3'));var rp=require(_0x122b('0x4'));var moment=require(_0x122b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x122b('0x6'));var util=require(_0x122b('0x7'));var path=require(_0x122b('0x8'));var sox=require(_0x122b('0x9'));var csv=require(_0x122b('0xa'));var ejs=require(_0x122b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x122b('0xc'));var squel=require(_0x122b('0xd'));var crypto=require(_0x122b('0xe'));var jsforce=require(_0x122b('0xf'));var deskjs=require(_0x122b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x122b('0x11'));var Papa=require(_0x122b('0x12'));var Redis=require(_0x122b('0x13'));var authService=require(_0x122b('0x14'));var qs=require(_0x122b('0x15'));var as=require(_0x122b('0x16'));var hardwareService=require(_0x122b('0x17'));var logger=require(_0x122b('0x18'))(_0x122b('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x122b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dc3f5,_0x18d7bc){_0x18d7bc=_0x18d7bc||0xcc;return function(_0x3d3e01){if(_0x3d3e01){return _0x4dc3f5[_0x122b('0x1b')](_0x18d7bc);}return _0x4dc3f5['status'](_0x18d7bc)[_0x122b('0x1c')]();};}function respondWithResult(_0x4811dd,_0x36b6ba){_0x36b6ba=_0x36b6ba||0xc8;return function(_0x3eecda){if(_0x3eecda){return _0x4811dd[_0x122b('0x1d')](_0x36b6ba)[_0x122b('0x1e')](_0x3eecda);}};}function respondWithFilteredResult(_0xee2b16,_0x13be45){return function(_0x38371c){if(_0x38371c){var _0x2ad3aa=typeof _0x13be45[_0x122b('0x1f')]==='undefined'&&typeof _0x13be45['limit']===_0x122b('0x20');var _0x3ee3fc=_0x38371c[_0x122b('0x21')];var _0x4ffce6=_0x2ad3aa?0x0:_0x13be45[_0x122b('0x1f')];var _0x2b0edc=_0x2ad3aa?_0x38371c[_0x122b('0x21')]:_0x13be45[_0x122b('0x1f')]+_0x13be45[_0x122b('0x22')];var _0x29d805;if(_0x2b0edc>=_0x3ee3fc){_0x2b0edc=_0x3ee3fc;_0x29d805=0xc8;}else{_0x29d805=0xce;}_0xee2b16[_0x122b('0x1d')](_0x29d805);return _0xee2b16[_0x122b('0x23')](_0x122b('0x24'),_0x4ffce6+'-'+_0x2b0edc+'/'+_0x3ee3fc)[_0x122b('0x1e')](_0x38371c);}return null;};}function patchUpdates(_0x556a29){return function(_0x39ddf4){try{jsonpatch['apply'](_0x39ddf4,_0x556a29,!![]);}catch(_0x4e1588){return BPromise['reject'](_0x4e1588);}return _0x39ddf4[_0x122b('0x25')]();};}function saveUpdates(_0x43d65f,_0x5a400f){return function(_0x35b08d){if(_0x35b08d){return _0x35b08d[_0x122b('0x26')](_0x43d65f)['then'](function(_0x2b3c53){return _0x2b3c53;});}return null;};}function removeEntity(_0x3cc01c,_0x5890fa){return function(_0x3c75cd){if(_0x3c75cd){return _0x3c75cd[_0x122b('0x27')]()[_0x122b('0x28')](function(){_0x3cc01c[_0x122b('0x1d')](0xcc)[_0x122b('0x1c')]();});}};}function handleEntityNotFound(_0x3e1702,_0x4166f1){return function(_0x414512){if(!_0x414512){_0x3e1702[_0x122b('0x1b')](0x194);}return _0x414512;};}function handleError(_0x12f531,_0x15fb92){_0x15fb92=_0x15fb92||0x1f4;return function(_0x345f5a){logger[_0x122b('0x29')](_0x345f5a['stack']);if(_0x345f5a[_0x122b('0x2a')]){delete _0x345f5a[_0x122b('0x2a')];}_0x12f531[_0x122b('0x1d')](_0x15fb92)['send'](_0x345f5a);};}exports[_0x122b('0x2b')]=function(_0x1f7ad7,_0x427688){var _0x2ebe6f={},_0x205c83={},_0x231f92={'count':0x0,'rows':[]};var _0x1cf3ea=_['map'](db['Automation'][_0x122b('0x2c')],function(_0x119d33){return{'name':_0x119d33[_0x122b('0x2d')],'type':_0x119d33['type']['key']};});_0x205c83[_0x122b('0x2e')]=_[_0x122b('0x2f')](_0x1cf3ea,'name');_0x205c83['query']=_[_0x122b('0x30')](_0x1f7ad7[_0x122b('0x31')]);_0x205c83['filters']=_['intersection'](_0x205c83['model'],_0x205c83[_0x122b('0x31')]);_0x2ebe6f[_0x122b('0x32')]=_[_0x122b('0x33')](_0x205c83['model'],qs[_0x122b('0x34')](_0x1f7ad7[_0x122b('0x31')][_0x122b('0x34')]));_0x2ebe6f[_0x122b('0x32')]=_0x2ebe6f[_0x122b('0x32')][_0x122b('0x35')]?_0x2ebe6f[_0x122b('0x32')]:_0x205c83[_0x122b('0x2e')];if(!_0x1f7ad7[_0x122b('0x31')][_0x122b('0x36')](_0x122b('0x37'))){_0x2ebe6f['limit']=qs[_0x122b('0x22')](_0x1f7ad7['query']['limit']);_0x2ebe6f[_0x122b('0x1f')]=qs[_0x122b('0x1f')](_0x1f7ad7[_0x122b('0x31')][_0x122b('0x1f')]);}_0x2ebe6f[_0x122b('0x38')]=qs[_0x122b('0x39')](_0x1f7ad7['query'][_0x122b('0x39')]);_0x2ebe6f[_0x122b('0x3a')]=qs[_0x122b('0x3b')](_[_0x122b('0x3c')](_0x1f7ad7['query'],_0x205c83[_0x122b('0x3b')]),_0x1cf3ea);if(_0x1f7ad7['query'][_0x122b('0x3d')]){_0x2ebe6f[_0x122b('0x3a')]=_[_0x122b('0x3e')](_0x2ebe6f[_0x122b('0x3a')],{'$or':_[_0x122b('0x2f')](_0x1cf3ea,function(_0x19a7fe){if(_0x19a7fe[_0x122b('0x3f')]!=='VIRTUAL'){var _0x3f3e92={};_0x3f3e92[_0x19a7fe[_0x122b('0x2a')]]={'$like':'%'+_0x1f7ad7[_0x122b('0x31')][_0x122b('0x3d')]+'%'};return _0x3f3e92;}})});}_0x2ebe6f=_[_0x122b('0x3e')]({},_0x2ebe6f,_0x1f7ad7[_0x122b('0x40')]);var _0x5b2be3={'where':_0x2ebe6f['where']};return db[_0x122b('0x41')]['count'](_0x5b2be3)[_0x122b('0x28')](function(_0x3e7ad5){_0x231f92['count']=_0x3e7ad5;if(_0x1f7ad7['query'][_0x122b('0x42')]){_0x2ebe6f[_0x122b('0x43')]=[{'all':!![]}];}return db[_0x122b('0x41')][_0x122b('0x44')](_0x2ebe6f);})[_0x122b('0x28')](function(_0x21fe29){_0x231f92[_0x122b('0x45')]=_0x21fe29;return _0x231f92;})[_0x122b('0x28')](respondWithFilteredResult(_0x427688,_0x2ebe6f))[_0x122b('0x46')](handleError(_0x427688,null));};exports[_0x122b('0x47')]=function(_0x5774e1,_0x7729bd){var _0x24e6f5={'raw':![],'where':{'id':_0x5774e1['params']['id']}},_0xcabbc4={};_0xcabbc4[_0x122b('0x2e')]=_[_0x122b('0x30')](db[_0x122b('0x41')]['rawAttributes']);_0xcabbc4[_0x122b('0x31')]=_[_0x122b('0x30')](_0x5774e1[_0x122b('0x31')]);_0xcabbc4[_0x122b('0x3b')]=_[_0x122b('0x33')](_0xcabbc4[_0x122b('0x2e')],_0xcabbc4[_0x122b('0x31')]);_0x24e6f5[_0x122b('0x32')]=_[_0x122b('0x33')](_0xcabbc4[_0x122b('0x2e')],qs[_0x122b('0x34')](_0x5774e1[_0x122b('0x31')][_0x122b('0x34')]));_0x24e6f5['attributes']=_0x24e6f5[_0x122b('0x32')][_0x122b('0x35')]?_0x24e6f5[_0x122b('0x32')]:_0xcabbc4[_0x122b('0x2e')];if(_0x5774e1[_0x122b('0x31')][_0x122b('0x42')]){_0x24e6f5[_0x122b('0x43')]=[{'all':!![]}];}_0x24e6f5=_[_0x122b('0x3e')]({},_0x24e6f5,_0x5774e1['options']);return db[_0x122b('0x41')][_0x122b('0x48')](_0x24e6f5)[_0x122b('0x28')](handleEntityNotFound(_0x7729bd,null))[_0x122b('0x28')](respondWithResult(_0x7729bd,null))[_0x122b('0x46')](handleError(_0x7729bd,null));};exports[_0x122b('0x49')]=function(_0xcc7cae,_0x3c0984){return db[_0x122b('0x41')][_0x122b('0x49')](_0xcc7cae[_0x122b('0x4a')],{})[_0x122b('0x28')](respondWithResult(_0x3c0984,0xc9))[_0x122b('0x46')](handleError(_0x3c0984,null));};exports[_0x122b('0x26')]=function(_0x151e75,_0x228cac){if(_0x151e75[_0x122b('0x4a')]['id']){delete _0x151e75[_0x122b('0x4a')]['id'];}return db[_0x122b('0x41')][_0x122b('0x48')]({'where':{'id':_0x151e75[_0x122b('0x4b')]['id']}})[_0x122b('0x28')](handleEntityNotFound(_0x228cac,null))['then'](saveUpdates(_0x151e75['body'],null))[_0x122b('0x28')](respondWithResult(_0x228cac,null))['catch'](handleError(_0x228cac,null));};exports[_0x122b('0x27')]=function(_0x14c53f,_0x4835d2){return db[_0x122b('0x41')][_0x122b('0x48')]({'where':{'id':_0x14c53f[_0x122b('0x4b')]['id']}})[_0x122b('0x28')](handleEntityNotFound(_0x4835d2,null))['then'](removeEntity(_0x4835d2,null))['catch'](handleError(_0x4835d2,null));};exports[_0x122b('0x4c')]=function(_0x353cf4,_0x2a5b7f,_0x232c1d){return db[_0x122b('0x4d')][_0x122b('0x48')]({'where':{'id':_0x353cf4[_0x122b('0x4b')]['id']}})[_0x122b('0x28')](handleEntityNotFound(_0x2a5b7f,null))['then'](function(_0x1781e2){if(_0x1781e2){return _0x1781e2[_0x122b('0x4c')](_0x353cf4[_0x122b('0x4a')][_0x122b('0x4e')],_['omit'](_0x353cf4['body'],['ids','id'])||{});}})[_0x122b('0x28')](respondWithResult(_0x2a5b7f,null))[_0x122b('0x46')](handleError(_0x2a5b7f,null));};exports[_0x122b('0x4f')]=function(_0x1e0a7f,_0x39d28f,_0x18aa23){var _0x2027e1={};var _0x3ce116={};var _0x1e8ba4;var _0x15017c;return db[_0x122b('0x41')][_0x122b('0x50')]({'where':{'id':_0x1e0a7f[_0x122b('0x4b')]['id']}})[_0x122b('0x28')](handleEntityNotFound(_0x39d28f,null))['then'](function(_0x516350){if(_0x516350){_0x1e8ba4=_0x516350;_0x3ce116['model']=_['keys'](db['Condition'][_0x122b('0x2c')]);_0x3ce116['query']=_[_0x122b('0x30')](_0x1e0a7f['query']);_0x3ce116[_0x122b('0x3b')]=_[_0x122b('0x33')](_0x3ce116[_0x122b('0x2e')],_0x3ce116[_0x122b('0x31')]);_0x2027e1['attributes']=_[_0x122b('0x33')](_0x3ce116['model'],qs[_0x122b('0x34')](_0x1e0a7f[_0x122b('0x31')]['fields']));_0x2027e1[_0x122b('0x32')]=_0x2027e1[_0x122b('0x32')][_0x122b('0x35')]?_0x2027e1[_0x122b('0x32')]:_0x3ce116[_0x122b('0x2e')];_0x2027e1[_0x122b('0x38')]=qs['sort'](_0x1e0a7f[_0x122b('0x31')][_0x122b('0x39')]);_0x2027e1['where']=qs[_0x122b('0x3b')](_[_0x122b('0x3c')](_0x1e0a7f[_0x122b('0x31')],_0x3ce116[_0x122b('0x3b')]));if(_0x1e0a7f[_0x122b('0x31')][_0x122b('0x3d')]){_0x2027e1[_0x122b('0x3a')]=_[_0x122b('0x3e')](_0x2027e1[_0x122b('0x3a')],{'$or':_[_0x122b('0x2f')](_0x2027e1['attributes'],function(_0x3b7b38){var _0x2c9919={};_0x2c9919[_0x3b7b38]={'$like':'%'+_0x1e0a7f[_0x122b('0x31')][_0x122b('0x3d')]+'%'};return _0x2c9919;})});}_0x2027e1=_[_0x122b('0x3e')]({},_0x2027e1,_0x1e0a7f[_0x122b('0x40')]);return _0x1e8ba4['getConditions'](_0x2027e1);}})[_0x122b('0x28')](function(_0x2c8b34){if(_0x2c8b34){_0x15017c=_0x2c8b34[_0x122b('0x35')];if(!_0x1e0a7f[_0x122b('0x31')][_0x122b('0x36')](_0x122b('0x37'))){_0x2027e1['limit']=qs['limit'](_0x1e0a7f[_0x122b('0x31')][_0x122b('0x22')]);_0x2027e1['offset']=qs['offset'](_0x1e0a7f[_0x122b('0x31')]['offset']);}return _0x1e8ba4[_0x122b('0x4f')](_0x2027e1);}})['then'](function(_0x17ccaf){if(_0x17ccaf){return _0x17ccaf?{'count':_0x15017c,'rows':_0x17ccaf}:null;}})[_0x122b('0x28')](respondWithResult(_0x39d28f,null))[_0x122b('0x46')](handleError(_0x39d28f,null));};exports[_0x122b('0x51')]=function(_0x58b123,_0x2fa9a1,_0x2ee04c){return db[_0x122b('0x52')][_0x122b('0x48')]({'where':{'id':_0x58b123[_0x122b('0x4b')]['id']}})[_0x122b('0x28')](handleEntityNotFound(_0x2fa9a1,null))['then'](function(_0x39d760){if(_0x39d760){return _0x39d760[_0x122b('0x51')](_0x58b123[_0x122b('0x4a')][_0x122b('0x4e')],_[_0x122b('0x53')](_0x58b123[_0x122b('0x4a')],[_0x122b('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x2fa9a1,null))[_0x122b('0x46')](handleError(_0x2fa9a1,null));};exports[_0x122b('0x54')]=function(_0x3ad540,_0x3269e8,_0x207e84){var _0x2b2e57={};var _0x5e4e66={};var _0x2a62b0;var _0x194131;return db[_0x122b('0x41')][_0x122b('0x50')]({'where':{'id':_0x3ad540[_0x122b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3269e8,null))['then'](function(_0x35b520){if(_0x35b520){_0x2a62b0=_0x35b520;_0x5e4e66[_0x122b('0x2e')]=_[_0x122b('0x30')](db[_0x122b('0x52')][_0x122b('0x2c')]);_0x5e4e66[_0x122b('0x31')]=_[_0x122b('0x30')](_0x3ad540['query']);_0x5e4e66[_0x122b('0x3b')]=_['intersection'](_0x5e4e66[_0x122b('0x2e')],_0x5e4e66['query']);_0x2b2e57[_0x122b('0x32')]=_[_0x122b('0x33')](_0x5e4e66[_0x122b('0x2e')],qs['fields'](_0x3ad540[_0x122b('0x31')][_0x122b('0x34')]));_0x2b2e57[_0x122b('0x32')]=_0x2b2e57[_0x122b('0x32')][_0x122b('0x35')]?_0x2b2e57[_0x122b('0x32')]:_0x5e4e66[_0x122b('0x2e')];_0x2b2e57[_0x122b('0x38')]=qs['sort'](_0x3ad540[_0x122b('0x31')][_0x122b('0x39')]);_0x2b2e57[_0x122b('0x3a')]=qs['filters'](_[_0x122b('0x3c')](_0x3ad540[_0x122b('0x31')],_0x5e4e66[_0x122b('0x3b')]));if(_0x3ad540[_0x122b('0x31')][_0x122b('0x3d')]){_0x2b2e57[_0x122b('0x3a')]=_[_0x122b('0x3e')](_0x2b2e57['where'],{'$or':_[_0x122b('0x2f')](_0x2b2e57[_0x122b('0x32')],function(_0x30a87d){var _0x2e2a88={};_0x2e2a88[_0x30a87d]={'$like':'%'+_0x3ad540[_0x122b('0x31')][_0x122b('0x3d')]+'%'};return _0x2e2a88;})});}_0x2b2e57=_['merge']({},_0x2b2e57,_0x3ad540['options']);return _0x2a62b0[_0x122b('0x54')](_0x2b2e57);}})[_0x122b('0x28')](function(_0x3f9b3f){if(_0x3f9b3f){_0x194131=_0x3f9b3f['length'];if(!_0x3ad540['query'][_0x122b('0x36')]('nolimit')){_0x2b2e57[_0x122b('0x22')]=qs[_0x122b('0x22')](_0x3ad540[_0x122b('0x31')][_0x122b('0x22')]);_0x2b2e57[_0x122b('0x1f')]=qs['offset'](_0x3ad540[_0x122b('0x31')][_0x122b('0x1f')]);}return _0x2a62b0['getActions'](_0x2b2e57);}})[_0x122b('0x28')](function(_0x35ec86){if(_0x35ec86){return _0x35ec86?{'count':_0x194131,'rows':_0x35ec86}:null;}})['then'](respondWithResult(_0x3269e8,null))['catch'](handleError(_0x3269e8,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 16bfc34..d59c062 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 _0xcb97=['exports','define','Automation','tools_automations','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x1d9dfa,_0x30598d){var _0x252661=function(_0x4bcc24){while(--_0x4bcc24){_0x1d9dfa['push'](_0x1d9dfa['shift']());}};_0x252661(++_0x30598d);}(_0xcb97,0x70));var _0x7cb9=function(_0x2dfb29,_0x388079){_0x2dfb29=_0x2dfb29-0x0;var _0x224c04=_0xcb97[_0x2dfb29];return _0x224c04;};'use strict';var _=require('lodash');var util=require(_0x7cb9('0x0'));var logger=require('../../config/logger')(_0x7cb9('0x1'));var moment=require('moment');var BPromise=require(_0x7cb9('0x2'));var rp=require(_0x7cb9('0x3'));var fs=require('fs');var path=require(_0x7cb9('0x4'));var rimraf=require(_0x7cb9('0x5'));var config=require(_0x7cb9('0x6'));var attributes=require(_0x7cb9('0x7'));module[_0x7cb9('0x8')]=function(_0x1d0a85,_0x3d6611){return _0x1d0a85[_0x7cb9('0x9')](_0x7cb9('0xa'),attributes,{'tableName':_0x7cb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb63d=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x61151d,_0x1eaadf){var _0x57752d=function(_0x1ac48a){while(--_0x1ac48a){_0x61151d['push'](_0x61151d['shift']());}};_0x57752d(++_0x1eaadf);}(_0xb63d,0x1cd));var _0xdb63=function(_0x368cc7,_0x259e9d){_0x368cc7=_0x368cc7-0x0;var _0x5b077a=_0xb63d[_0x368cc7];return _0x5b077a;};'use strict';var _=require(_0xdb63('0x0'));var util=require(_0xdb63('0x1'));var logger=require(_0xdb63('0x2'))(_0xdb63('0x3'));var moment=require(_0xdb63('0x4'));var BPromise=require(_0xdb63('0x5'));var rp=require(_0xdb63('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb63('0x7'));var config=require(_0xdb63('0x8'));var attributes=require(_0xdb63('0x9'));module[_0xdb63('0xa')]=function(_0x2eda4f,_0x19a051){return _0x2eda4f[_0xdb63('0xb')](_0xdb63('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d46d7aa..7aa3aff 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 _0xad9f=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x9e113b,_0x58c6f0){var _0xeee1b0=function(_0x278990){while(--_0x278990){_0x9e113b['push'](_0x9e113b['shift']());}};_0xeee1b0(++_0x58c6f0);}(_0xad9f,0x1be));var _0xfad9=function(_0x37cbe4,_0x5a8821){_0x37cbe4=_0x37cbe4-0x0;var _0x4ec353=_0xad9f[_0x37cbe4];return _0x4ec353;};'use strict';var _=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var moment=require(_0xfad9('0x2'));var BPromise=require('bluebird');var rs=require(_0xfad9('0x3'));var fs=require('fs');var Redis=require(_0xfad9('0x4'));var db=require(_0xfad9('0x5'))['db'];var utils=require(_0xfad9('0x6'));var logger=require('../../config/logger')(_0xfad9('0x7'));var config=require('../../config/environment');var jayson=require(_0xfad9('0x8'));var client=jayson[_0xfad9('0x9')][_0xfad9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaea9ba,_0xbbc4a6,_0x19b6cc){return new BPromise(function(_0x4d46a7,_0x5580be){return client[_0xfad9('0xb')](_0xaea9ba,_0x19b6cc)[_0xfad9('0xc')](function(_0x362047){logger[_0xfad9('0xd')](_0xfad9('0xe'),_0xbbc4a6,_0xfad9('0xf'));logger[_0xfad9('0x10')](_0xfad9('0x11'),_0xbbc4a6,'request\x20sent',JSON[_0xfad9('0x12')](_0x362047));if(_0x362047[_0xfad9('0x13')]){if(_0x362047[_0xfad9('0x13')][_0xfad9('0x14')]===0x1f4){logger[_0xfad9('0x13')](_0xfad9('0xe'),_0xbbc4a6,_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);return _0x5580be(_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);}logger[_0xfad9('0x13')]('Automation,\x20%s,\x20%s',_0xbbc4a6,_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);return _0x4d46a7(_0x362047[_0xfad9('0x13')][_0xfad9('0x15')]);}else{logger[_0xfad9('0xd')](_0xfad9('0xe'),_0xbbc4a6,'request\x20sent');_0x4d46a7(_0x362047[_0xfad9('0x16')]['message']);}})[_0xfad9('0x17')](function(_0x43d2ef){logger['error']('Automation,\x20%s,\x20%s',_0xbbc4a6,_0x43d2ef);_0x5580be(_0x43d2ef);});});} \ No newline at end of file +var _0xd844=['../../config/logger','rpc','../../config/environment','client','request','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd844,0x6d));var _0x4d84=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd844[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4d84('0x0'));var util=require(_0x4d84('0x1'));var moment=require('moment');var BPromise=require(_0x4d84('0x2'));var rs=require(_0x4d84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d84('0x4'));var logger=require(_0x4d84('0x5'))(_0x4d84('0x6'));var config=require(_0x4d84('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4d84('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x591203,_0x423d11,_0x4f777a){return new BPromise(function(_0x49c1b0,_0xbdf246){return client[_0x4d84('0x9')](_0x591203,_0x4f777a)['then'](function(_0x42a874){logger['info'](_0x4d84('0xa'),_0x423d11,_0x4d84('0xb'));logger[_0x4d84('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x423d11,_0x4d84('0xb'),JSON[_0x4d84('0xd')](_0x42a874));if(_0x42a874[_0x4d84('0xe')]){if(_0x42a874[_0x4d84('0xe')][_0x4d84('0xf')]===0x1f4){logger[_0x4d84('0xe')](_0x4d84('0xa'),_0x423d11,_0x42a874[_0x4d84('0xe')][_0x4d84('0x10')]);return _0xbdf246(_0x42a874[_0x4d84('0xe')][_0x4d84('0x10')]);}logger['error'](_0x4d84('0xa'),_0x423d11,_0x42a874['error'][_0x4d84('0x10')]);return _0x49c1b0(_0x42a874[_0x4d84('0xe')][_0x4d84('0x10')]);}else{logger[_0x4d84('0x11')]('Automation,\x20%s,\x20%s',_0x423d11,_0x4d84('0xb'));_0x49c1b0(_0x42a874['result'][_0x4d84('0x10')]);}})[_0x4d84('0x12')](function(_0x501525){logger['error'](_0x4d84('0xa'),_0x423d11,_0x501525);_0xbdf246(_0x501525);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 4fafff1..fc0fd79 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 _0xd58c=['/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd58c,0xb6));var _0xcd58=function(_0x2a575c,_0x4282a8){_0x2a575c=_0x2a575c-0x0;var _0x499c9e=_0xd58c[_0x2a575c];return _0x499c9e;};'use strict';var multer=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var path=require(_0xcd58('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd58('0x3'));var router=express['Router']();var fs_extra=require(_0xcd58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd58('0x5'));var config=require(_0xcd58('0x6'));var controller=require(_0xcd58('0x7'));router[_0xcd58('0x8')]('/',auth[_0xcd58('0x9')](),controller['index']);router['get'](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0xb')]);router[_0xcd58('0x8')](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0xd')]);router[_0xcd58('0x8')]('/:id/actions',auth[_0xcd58('0x9')](),controller['getActions']);router[_0xcd58('0xe')]('/',auth[_0xcd58('0x9')](),controller[_0xcd58('0xf')]);router['post'](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0x10')]);router['post'](_0xcd58('0x11'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x12')]);router[_0xcd58('0x13')](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x14')]);router[_0xcd58('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xcd58('0x16')]);module[_0xcd58('0x17')]=router; \ No newline at end of file +var _0x3663=['show','getConditions','getActions','post','create','/:id/conditions','/:id/actions','addActions','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated'];(function(_0x19ccda,_0x51a3e9){var _0x55aedb=function(_0x5b8be3){while(--_0x5b8be3){_0x19ccda['push'](_0x19ccda['shift']());}};_0x55aedb(++_0x51a3e9);}(_0x3663,0x1cf));var _0x3366=function(_0x4c9a56,_0x1f060a){_0x4c9a56=_0x4c9a56-0x0;var _0xfef63f=_0x3663[_0x4c9a56];return _0xfef63f;};'use strict';var multer=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var path=require(_0x3366('0x2'));var timeout=require('connect-timeout');var express=require(_0x3366('0x3'));var router=express[_0x3366('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3366('0x5'));var interaction=require(_0x3366('0x6'));var config=require(_0x3366('0x7'));var controller=require(_0x3366('0x8'));router[_0x3366('0x9')]('/',auth['isAuthenticated'](),controller[_0x3366('0xa')]);router[_0x3366('0x9')]('/:id',auth[_0x3366('0xb')](),controller[_0x3366('0xc')]);router[_0x3366('0x9')]('/:id/conditions',auth[_0x3366('0xb')](),controller[_0x3366('0xd')]);router[_0x3366('0x9')]('/:id/actions',auth[_0x3366('0xb')](),controller[_0x3366('0xe')]);router[_0x3366('0xf')]('/',auth[_0x3366('0xb')](),controller[_0x3366('0x10')]);router[_0x3366('0xf')](_0x3366('0x11'),auth['isAuthenticated'](),controller['addConditions']);router[_0x3366('0xf')](_0x3366('0x12'),auth[_0x3366('0xb')](),controller[_0x3366('0x13')]);router[_0x3366('0x14')](_0x3366('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x3366('0x16')]('/:id',auth[_0x3366('0xb')](),controller[_0x3366('0x17')]);module[_0x3366('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 922ccae..a172332 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 _0x1278=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0x1278,0xbe));var _0x8127=function(_0x561098,_0xdd1933){_0x561098=_0x561098-0x0;var _0x42701a=_0x1278[_0x561098];return _0x42701a;};'use strict';var Sequelize=require(_0x8127('0x0'));module[_0x8127('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8127('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8127('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x8127('0x4')},'description':{'type':Sequelize[_0x8127('0x5')]},'active':{'type':Sequelize[_0x8127('0x6')],'defaultValue':0x0,'comment':_0x8127('0x7')},'limitCalls':{'type':Sequelize[_0x8127('0x8')](0x4)[_0x8127('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8127('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'comment':_0x8127('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8127('0x11')},'dialTimezone':{'type':Sequelize[_0x8127('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8127('0x5')],'defaultValue':_0x8127('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x8127('0x3')](_0x8127('0x13'),_0x8127('0x14'),_0x8127('0x15')),'defaultValue':_0x8127('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8127('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0x8127('0x8')](0x9)[_0x8127('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x8127('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8127('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8127('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8127('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8127('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8127('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x8127('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8127('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8127('0x8')](0x9)[_0x8127('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8127('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8127('0x8')](0x9)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8127('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8127('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8127('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x8127('0x3')](_0x8127('0x1e'),_0x8127('0x1f')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x8127('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8127('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)[_0x8127('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8127('0x8')](0x5)[_0x8127('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8127('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8127('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8127('0x28')}}; \ No newline at end of file +var _0xf93d=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','ivr'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xf93d,0x1b8));var _0xdf93=function(_0x537b43,_0xa7141){_0x537b43=_0x537b43-0x0;var _0x41a8d6=_0xf93d[_0x537b43];return _0x41a8d6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdf93('0x0')],'unique':_0xdf93('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xdf93('0x2')](_0xdf93('0x3')),'allowNull':![],'defaultValue':_0xdf93('0x3')},'description':{'type':Sequelize[_0xdf93('0x0')]},'active':{'type':Sequelize[_0xdf93('0x4')],'defaultValue':0x0,'comment':_0xdf93('0x5')},'limitCalls':{'type':Sequelize[_0xdf93('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdf93('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdf93('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdf93('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf93('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf93('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf93('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf93('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'comment':_0xdf93('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf93('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdf93('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdf93('0x0')],'defaultValue':_0xdf93('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xdf93('0x2')]('always',_0xdf93('0x11'),_0xdf93('0x12')),'defaultValue':_0xdf93('0x13')},'dialAMDActive':{'type':Sequelize[_0xdf93('0x4')],'defaultValue':0x0,'comment':_0xdf93('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xdf93('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdf93('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xdf93('0x6')](0x9)[_0xdf93('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdf93('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdf93('0x6')](0x9)[_0xdf93('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdf93('0x6')](0x9)[_0xdf93('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdf93('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdf93('0x6')](0x9)[_0xdf93('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdf93('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdf93('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdf93('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdf93('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdf93('0x2')](_0xdf93('0x1c'),_0xdf93('0x1d')),'defaultValue':_0xdf93('0x1c')},'dialPrefix':{'type':Sequelize[_0xdf93('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdf93('0x1e')},'dialCutDigit':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf93('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf93('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf93('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf93('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf93('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf93('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdf93('0x6')](0x3)[_0xdf93('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdf93('0x6')](0x5)[_0xdf93('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index c9692b5..a395e15 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 _0x23a3=['ci.OrderBY','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','send','Campaign','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','pick','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','h.id'];(function(_0x34b48c,_0xe97afa){var _0x3b9957=function(_0x33095d){while(--_0x33095d){_0x34b48c['push'](_0x34b48c['shift']());}};_0x3b9957(++_0xe97afa);}(_0x23a3,0x131));var _0x323a=function(_0x825ea9,_0x56c3ea){_0x825ea9=_0x825ea9-0x0;var _0x4282a8=_0x23a3[_0x825ea9];return _0x4282a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x323a('0x0'));var rp=require('request-promise');var moment=require(_0x323a('0x1'));var BPromise=require(_0x323a('0x2'));var Mustache=require(_0x323a('0x3'));var util=require(_0x323a('0x4'));var path=require(_0x323a('0x5'));var sox=require(_0x323a('0x6'));var csv=require(_0x323a('0x7'));var ejs=require(_0x323a('0x8'));var fs=require('fs');var fs_extra=require(_0x323a('0x9'));var _=require('lodash');var squel=require(_0x323a('0xa'));var crypto=require(_0x323a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x323a('0xc'));var toCsv=require(_0x323a('0x7'));var querystring=require(_0x323a('0xd'));var Papa=require('papaparse');var Redis=require(_0x323a('0xe'));var authService=require(_0x323a('0xf'));var qs=require(_0x323a('0x10'));var as=require(_0x323a('0x11'));var hardwareService=require(_0x323a('0x12'));var logger=require(_0x323a('0x13'))(_0x323a('0x14'));var utils=require(_0x323a('0x15'));var config=require(_0x323a('0x16'));var licenseUtil=require(_0x323a('0x17'));var db=require(_0x323a('0x18'))['db'];function respondWithStatusCode(_0x33d226,_0x460fd8){_0x460fd8=_0x460fd8||0xcc;return function(_0x1ae315){if(_0x1ae315){return _0x33d226['sendStatus'](_0x460fd8);}return _0x33d226[_0x323a('0x19')](_0x460fd8)['end']();};}function respondWithResult(_0x16b92e,_0x4ccd19){_0x4ccd19=_0x4ccd19||0xc8;return function(_0x5f3922){if(_0x5f3922){return _0x16b92e[_0x323a('0x19')](_0x4ccd19)['json'](_0x5f3922);}};}function respondWithFilteredResult(_0x46c247,_0x582631){return function(_0x1cc64d){if(_0x1cc64d){var _0x64003=typeof _0x582631['offset']===_0x323a('0x1a')&&typeof _0x582631[_0x323a('0x1b')]==='undefined';var _0x5c1947=_0x1cc64d[_0x323a('0x1c')];var _0x221ae4=_0x64003?0x0:_0x582631[_0x323a('0x1d')];var _0x29dd21=_0x64003?_0x1cc64d[_0x323a('0x1c')]:_0x582631[_0x323a('0x1d')]+_0x582631['limit'];var _0x5bf1c9;if(_0x29dd21>=_0x5c1947){_0x29dd21=_0x5c1947;_0x5bf1c9=0xc8;}else{_0x5bf1c9=0xce;}_0x46c247['status'](_0x5bf1c9);return _0x46c247['set'](_0x323a('0x1e'),_0x221ae4+'-'+_0x29dd21+'/'+_0x5c1947)['json'](_0x1cc64d);}return null;};}function patchUpdates(_0xc0f3e4){return function(_0x38bc95){try{jsonpatch[_0x323a('0x1f')](_0x38bc95,_0xc0f3e4,!![]);}catch(_0xd35d83){return BPromise['reject'](_0xd35d83);}return _0x38bc95[_0x323a('0x20')]();};}function saveUpdates(_0x549e64,_0x12c8d7){return function(_0x323517){if(_0x323517){return _0x323517[_0x323a('0x21')](_0x549e64)['then'](function(_0x41ea3d){return _0x41ea3d;});}return null;};}function removeEntity(_0x358bcb,_0x36d4d9){return function(_0x2960e0){if(_0x2960e0){return _0x2960e0[_0x323a('0x22')]()[_0x323a('0x23')](function(){var _0x5ba015=_0x2960e0[_0x323a('0x24')]({'plain':!![]});var _0x5d82c2=_0x323a('0x25');return db[_0x323a('0x26')][_0x323a('0x22')]({'where':{'type':_0x5d82c2,'resourceId':_0x5ba015['id']}})[_0x323a('0x23')](function(){return _0x2960e0;});})[_0x323a('0x23')](function(){_0x358bcb['status'](0xcc)[_0x323a('0x27')]();});}};}function handleEntityNotFound(_0x384c93,_0x30dbe6){return function(_0x17907c){if(!_0x17907c){_0x384c93[_0x323a('0x28')](0x194);}return _0x17907c;};}function handleError(_0x4ba792,_0x23a989){_0x23a989=_0x23a989||0x1f4;return function(_0x571264){logger[_0x323a('0x29')](_0x571264[_0x323a('0x2a')]);if(_0x571264[_0x323a('0x2b')]){delete _0x571264[_0x323a('0x2b')];}_0x4ba792[_0x323a('0x19')](_0x23a989)[_0x323a('0x2c')](_0x571264);};}exports['index']=function(_0x2a1a85,_0x3f6809){var _0x580c2b={},_0x32c05b={},_0x4abf8d={'count':0x0,'rows':[]};var _0x4a70dd=_['map'](db[_0x323a('0x2d')]['rawAttributes'],function(_0x2a8da8){return{'name':_0x2a8da8[_0x323a('0x2e')],'type':_0x2a8da8[_0x323a('0x2f')][_0x323a('0x30')]};});_0x32c05b[_0x323a('0x31')]=_['map'](_0x4a70dd,_0x323a('0x2b'));_0x32c05b['query']=_[_0x323a('0x32')](_0x2a1a85['query']);_0x32c05b[_0x323a('0x33')]=_[_0x323a('0x34')](_0x32c05b['model'],_0x32c05b[_0x323a('0x35')]);_0x580c2b[_0x323a('0x36')]=_[_0x323a('0x34')](_0x32c05b[_0x323a('0x31')],qs[_0x323a('0x37')](_0x2a1a85[_0x323a('0x35')][_0x323a('0x37')]));_0x580c2b[_0x323a('0x36')]=_0x580c2b['attributes'][_0x323a('0x38')]?_0x580c2b[_0x323a('0x36')]:_0x32c05b[_0x323a('0x31')];if(!_0x2a1a85[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x580c2b[_0x323a('0x1b')]=qs['limit'](_0x2a1a85['query'][_0x323a('0x1b')]);_0x580c2b[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0x2a1a85['query'][_0x323a('0x1d')]);}_0x580c2b[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x2a1a85[_0x323a('0x35')]['sort']);_0x580c2b[_0x323a('0x3d')]=qs[_0x323a('0x33')](_['pick'](_0x2a1a85['query'],_0x32c05b[_0x323a('0x33')]),_0x4a70dd);if(_0x2a1a85['query'][_0x323a('0x3e')]){_0x580c2b[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x580c2b['where'],{'$or':_[_0x323a('0x40')](_0x4a70dd,function(_0x52f80f){if(_0x52f80f[_0x323a('0x2f')]!==_0x323a('0x41')){var _0x2d6c6f={};_0x2d6c6f[_0x52f80f[_0x323a('0x2b')]]={'$like':'%'+_0x2a1a85[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x2d6c6f;}})});}_0x580c2b=_['merge']({},_0x580c2b,_0x2a1a85[_0x323a('0x42')]);var _0xcff0c6={'where':_0x580c2b[_0x323a('0x3d')]};return db[_0x323a('0x2d')][_0x323a('0x1c')](_0xcff0c6)['then'](function(_0x1482d2){_0x4abf8d[_0x323a('0x1c')]=_0x1482d2;if(_0x2a1a85['query'][_0x323a('0x43')]){_0x580c2b[_0x323a('0x44')]=[{'all':!![]}];}return db[_0x323a('0x2d')][_0x323a('0x45')](_0x580c2b);})[_0x323a('0x23')](function(_0x599b28){_0x4abf8d[_0x323a('0x46')]=_0x599b28;return _0x4abf8d;})['then'](respondWithFilteredResult(_0x3f6809,_0x580c2b))['catch'](handleError(_0x3f6809,null));};exports[_0x323a('0x47')]=function(_0x3543a7,_0x3d98ce){var _0x357a22={'raw':![],'where':{'id':_0x3543a7[_0x323a('0x48')]['id']}},_0x5284dd={};_0x5284dd[_0x323a('0x31')]=_[_0x323a('0x32')](db[_0x323a('0x2d')][_0x323a('0x49')]);_0x5284dd['query']=_[_0x323a('0x32')](_0x3543a7[_0x323a('0x35')]);_0x5284dd['filters']=_['intersection'](_0x5284dd[_0x323a('0x31')],_0x5284dd[_0x323a('0x35')]);_0x357a22[_0x323a('0x36')]=_['intersection'](_0x5284dd[_0x323a('0x31')],qs[_0x323a('0x37')](_0x3543a7[_0x323a('0x35')]['fields']));_0x357a22[_0x323a('0x36')]=_0x357a22[_0x323a('0x36')][_0x323a('0x38')]?_0x357a22[_0x323a('0x36')]:_0x5284dd[_0x323a('0x31')];if(_0x3543a7[_0x323a('0x35')][_0x323a('0x43')]){_0x357a22[_0x323a('0x44')]=[{'all':!![]}];}_0x357a22=_[_0x323a('0x3f')]({},_0x357a22,_0x3543a7[_0x323a('0x42')]);return db[_0x323a('0x2d')][_0x323a('0x4a')](_0x357a22)['then'](handleEntityNotFound(_0x3d98ce,null))[_0x323a('0x23')](respondWithResult(_0x3d98ce,null))[_0x323a('0x4b')](handleError(_0x3d98ce,null));};exports[_0x323a('0x4c')]=function(_0x4dc7da,_0x481f08){return db[_0x323a('0x2d')][_0x323a('0x4c')](_0x4dc7da[_0x323a('0x4d')],{})[_0x323a('0x23')](function(_0x5686f0){var _0x2616bd=_0x4dc7da['user'][_0x323a('0x24')]({'plain':!![]});if(!_0x2616bd)throw new Error(_0x323a('0x4e'));if(_0x2616bd[_0x323a('0x4f')]===_0x323a('0x50')){var _0x2cb64b=_0x5686f0['get']({'plain':!![]});var _0x2f1a14=_0x323a('0x25');return db[_0x323a('0x51')][_0x323a('0x4a')]({'where':{'name':_0x2f1a14,'userProfileId':_0x2616bd['userProfileId']},'raw':!![]})[_0x323a('0x23')](function(_0x5c590e){if(_0x5c590e&&_0x5c590e[_0x323a('0x52')]===0x0){return db[_0x323a('0x26')][_0x323a('0x4c')]({'name':_0x2cb64b[_0x323a('0x2b')],'resourceId':_0x2cb64b['id'],'type':_0x5c590e[_0x323a('0x2b')],'sectionId':_0x5c590e['id']},{})[_0x323a('0x23')](function(){return _0x5686f0;});}else{return _0x5686f0;}})[_0x323a('0x4b')](function(_0x101357){logger[_0x323a('0x29')](_0x323a('0x53'),_0x101357);throw _0x101357;});}return _0x5686f0;})['then'](respondWithResult(_0x481f08,0xc9))['catch'](handleError(_0x481f08,null));};exports[_0x323a('0x54')]=function(_0x14502c,_0x2d86dc){var _0x45ced7={'where':{'id':_0x14502c[_0x323a('0x48')]['id']}},_0x2875ce={};_0x2875ce['model']=_[_0x323a('0x32')](db[_0x323a('0x2d')][_0x323a('0x49')]);_0x45ced7['attributes']=_[_0x323a('0x34')](_0x2875ce[_0x323a('0x31')],qs['fields'](_0x14502c[_0x323a('0x35')]['fields']));_0x45ced7[_0x323a('0x36')]=_0x45ced7[_0x323a('0x36')][_0x323a('0x38')]?_0x45ced7[_0x323a('0x36')]:_0x2875ce['model'];if(_0x14502c[_0x323a('0x35')]['includeAll']){_0x45ced7[_0x323a('0x44')]=[{'all':!![]}];}_0x45ced7=_['merge']({},_0x45ced7,_0x14502c[_0x323a('0x42')]);return db[_0x323a('0x2d')]['find'](_0x45ced7)[_0x323a('0x23')](handleEntityNotFound(_0x2d86dc,null))['then'](function(_0x1aa6dd){if(_0x1aa6dd){var _0x387b40=_0x1aa6dd['get']({'plain':!![]});_0x387b40=qs[_0x323a('0x55')](_0x387b40,['id',_0x323a('0x56'),_0x323a('0x57')]);_0x14502c['body']=_[_0x323a('0x55')](_0x14502c[_0x323a('0x4d')],['id',_0x323a('0x56'),_0x323a('0x57')]);return db[_0x323a('0x2d')][_0x323a('0x4c')](_[_0x323a('0x3f')](_0x387b40,_0x14502c[_0x323a('0x4d')]),{'include':_0x14502c[_0x323a('0x35')][_0x323a('0x43')]?[{'all':!![]}]:undefined})[_0x323a('0x23')](function(_0x1e540e){var _0x181072=_0x14502c[_0x323a('0x50')][_0x323a('0x24')]({'plain':!![]});if(!_0x181072)throw new Error(_0x323a('0x4e'));if(_0x181072['role']===_0x323a('0x50')){var _0x188777=_0x1e540e[_0x323a('0x24')]({'plain':!![]});var _0x40df26='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x40df26,'userProfileId':_0x181072[_0x323a('0x58')]},'raw':!![]})[_0x323a('0x23')](function(_0x17a608){if(_0x17a608&&_0x17a608[_0x323a('0x52')]===0x0){return db[_0x323a('0x26')][_0x323a('0x4c')]({'name':_0x188777[_0x323a('0x2b')],'resourceId':_0x188777['id'],'type':_0x17a608[_0x323a('0x2b')],'sectionId':_0x17a608['id']},{})[_0x323a('0x23')](function(){return _0x1e540e;});}else{return _0x1e540e;}})[_0x323a('0x4b')](function(_0x1291aa){logger[_0x323a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1291aa);throw _0x1291aa;});}return _0x1e540e;});}})[_0x323a('0x23')](respondWithResult(_0x2d86dc,0xc9))[_0x323a('0x4b')](handleError(_0x2d86dc,null));};exports[_0x323a('0x21')]=function(_0x5e4fb3,_0x3744f9){if(_0x5e4fb3[_0x323a('0x4d')]['id']){delete _0x5e4fb3[_0x323a('0x4d')]['id'];}return db['Campaign']['find']({'where':{'id':_0x5e4fb3['params']['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x3744f9,null))[_0x323a('0x23')](saveUpdates(_0x5e4fb3[_0x323a('0x4d')],null))[_0x323a('0x23')](respondWithResult(_0x3744f9,null))[_0x323a('0x4b')](handleError(_0x3744f9,null));};exports[_0x323a('0x22')]=function(_0x205d9f,_0x484f2a){return db['Campaign']['find']({'where':{'id':_0x205d9f['params']['id']}})['then'](handleEntityNotFound(_0x484f2a,null))[_0x323a('0x23')](removeEntity(_0x484f2a,null))[_0x323a('0x4b')](handleError(_0x484f2a,null));};exports[_0x323a('0x59')]=function(_0x605792,_0x1ee247,_0xed1022){var _0x11e7c8={'raw':!![],'where':{}};var _0x540b8c={};var _0x39e692={'count':0x0,'rows':[]};return db['Campaign'][_0x323a('0x5a')]({'where':{'id':_0x605792['params']['id']}})['then'](handleEntityNotFound(_0x1ee247,null))['then'](function(_0x4916e0){if(_0x4916e0){_0x540b8c[_0x323a('0x31')]=_['keys'](db[_0x323a('0x5b')]['rawAttributes']);_0x540b8c[_0x323a('0x35')]=_[_0x323a('0x32')](_0x605792[_0x323a('0x35')]);_0x540b8c['filters']=_['intersection'](_0x540b8c[_0x323a('0x31')],_0x540b8c[_0x323a('0x35')]);_0x11e7c8[_0x323a('0x36')]=_[_0x323a('0x34')](_0x540b8c['model'],qs[_0x323a('0x37')](_0x605792[_0x323a('0x35')][_0x323a('0x37')]));_0x11e7c8[_0x323a('0x36')]=_0x11e7c8[_0x323a('0x36')]['length']?_0x11e7c8[_0x323a('0x36')]:_0x540b8c[_0x323a('0x31')];if(!_0x605792[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x11e7c8[_0x323a('0x1b')]=qs[_0x323a('0x1b')](_0x605792['query']['limit']);_0x11e7c8[_0x323a('0x1d')]=qs['offset'](_0x605792[_0x323a('0x35')]['offset']);}_0x11e7c8[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x605792['query'][_0x323a('0x3c')]);_0x11e7c8[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x605792['query'],_0x540b8c[_0x323a('0x33')]));_0x11e7c8[_0x323a('0x3d')]['CampaignId']=_0x4916e0['id'];if(_0x605792['query'][_0x323a('0x3e')]){_0x11e7c8['where']=_['merge'](_0x11e7c8[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x11e7c8[_0x323a('0x36')],function(_0x1ec023){var _0x26e50d={};_0x26e50d[_0x1ec023]={'$like':'%'+_0x605792[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x26e50d;})});}_0x11e7c8=_[_0x323a('0x3f')]({},_0x11e7c8,_0x605792['options']);return db[_0x323a('0x5b')]['count']({'where':_0x11e7c8[_0x323a('0x3d')]})['then'](function(_0x540997){_0x39e692[_0x323a('0x1c')]=_0x540997;if(_0x605792[_0x323a('0x35')][_0x323a('0x43')]){_0x11e7c8[_0x323a('0x44')]=[{'all':!![]}];}return db[_0x323a('0x5b')][_0x323a('0x45')](_0x11e7c8);})[_0x323a('0x23')](function(_0xac7a0a){_0x39e692['rows']=_0xac7a0a;return _0x39e692;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1ee247,_0x11e7c8))[_0x323a('0x4b')](handleError(_0x1ee247,null));};exports[_0x323a('0x5d')]=function(_0x36db83,_0x1caf86,_0x3ab588){var _0x10dced={'raw':!![],'where':{}};var _0x390bed={};var _0x4ba690={'count':0x0,'rows':[]};return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x36db83[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x1caf86,null))[_0x323a('0x23')](function(_0x2c61b8){if(_0x2c61b8){_0x390bed[_0x323a('0x31')]=_['keys'](db[_0x323a('0x5e')]['rawAttributes']);_0x390bed[_0x323a('0x35')]=_[_0x323a('0x32')](_0x36db83[_0x323a('0x35')]);_0x390bed[_0x323a('0x33')]=_[_0x323a('0x34')](_0x390bed[_0x323a('0x31')],_0x390bed[_0x323a('0x35')]);_0x10dced['attributes']=_[_0x323a('0x34')](_0x390bed[_0x323a('0x31')],qs[_0x323a('0x37')](_0x36db83['query'][_0x323a('0x37')]));_0x10dced[_0x323a('0x36')]=_0x10dced[_0x323a('0x36')][_0x323a('0x38')]?_0x10dced['attributes']:_0x390bed['model'];if(!_0x36db83[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x10dced[_0x323a('0x1b')]=qs[_0x323a('0x1b')](_0x36db83[_0x323a('0x35')][_0x323a('0x1b')]);_0x10dced['offset']=qs[_0x323a('0x1d')](_0x36db83[_0x323a('0x35')][_0x323a('0x1d')]);}_0x10dced['order']=qs[_0x323a('0x3c')](_0x36db83[_0x323a('0x35')][_0x323a('0x3c')]);_0x10dced[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x36db83[_0x323a('0x35')],_0x390bed[_0x323a('0x33')]));_0x10dced[_0x323a('0x3d')][_0x323a('0x5f')]=_0x2c61b8['id'];if(_0x36db83[_0x323a('0x35')][_0x323a('0x3e')]){_0x10dced[_0x323a('0x3d')]=_['merge'](_0x10dced['where'],{'$or':_[_0x323a('0x40')](_0x10dced['attributes'],function(_0x3116ff){var _0x523b3a={};_0x523b3a[_0x3116ff]={'$like':'%'+_0x36db83[_0x323a('0x35')]['filter']+'%'};return _0x523b3a;})});}_0x10dced=_[_0x323a('0x3f')]({},_0x10dced,_0x36db83['options']);return db[_0x323a('0x5e')][_0x323a('0x1c')]({'where':_0x10dced[_0x323a('0x3d')]})[_0x323a('0x23')](function(_0x8e860f){_0x4ba690['count']=_0x8e860f;if(_0x36db83[_0x323a('0x35')][_0x323a('0x43')]){_0x10dced['include']=[{'all':!![]}];}return db[_0x323a('0x5e')][_0x323a('0x45')](_0x10dced);})[_0x323a('0x23')](function(_0x3a6183){_0x4ba690[_0x323a('0x46')]=_0x3a6183;return _0x4ba690;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1caf86,_0x10dced))[_0x323a('0x4b')](handleError(_0x1caf86,null));};exports[_0x323a('0x60')]=function(_0x558669,_0x1d7434,_0x3681ee){var _0x255a0a={'raw':!![],'where':{}};var _0x3bbcf3={};var _0x23ea9b={'count':0x0,'rows':[]};return db[_0x323a('0x2d')]['findOne']({'where':{'id':_0x558669[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d7434,null))[_0x323a('0x23')](function(_0x31c21d){if(_0x31c21d){_0x3bbcf3['model']=_[_0x323a('0x32')](db['CmHopperFinal']['rawAttributes']);_0x3bbcf3[_0x323a('0x35')]=_['keys'](_0x558669[_0x323a('0x35')]);_0x3bbcf3[_0x323a('0x33')]=_[_0x323a('0x34')](_0x3bbcf3[_0x323a('0x31')],_0x3bbcf3[_0x323a('0x35')]);_0x255a0a[_0x323a('0x36')]=_[_0x323a('0x34')](_0x3bbcf3[_0x323a('0x31')],qs['fields'](_0x558669['query'][_0x323a('0x37')]));_0x255a0a[_0x323a('0x36')]=_0x255a0a[_0x323a('0x36')][_0x323a('0x38')]?_0x255a0a[_0x323a('0x36')]:_0x3bbcf3['model'];if(!_0x558669[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x255a0a[_0x323a('0x1b')]=qs['limit'](_0x558669[_0x323a('0x35')][_0x323a('0x1b')]);_0x255a0a['offset']=qs[_0x323a('0x1d')](_0x558669['query'][_0x323a('0x1d')]);}_0x255a0a[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x558669[_0x323a('0x35')]['sort']);_0x255a0a[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x558669['query'],_0x3bbcf3['filters']));_0x255a0a[_0x323a('0x3d')][_0x323a('0x5f')]=_0x31c21d['id'];if(_0x558669[_0x323a('0x35')]['filter']){_0x255a0a[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x255a0a[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x255a0a[_0x323a('0x36')],function(_0x349e63){var _0x1aa0cc={};_0x1aa0cc[_0x349e63]={'$like':'%'+_0x558669[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x1aa0cc;})});}_0x255a0a=_['merge']({},_0x255a0a,_0x558669[_0x323a('0x42')]);return db['CmHopperFinal']['count']({'where':_0x255a0a['where']})['then'](function(_0x29d978){_0x23ea9b[_0x323a('0x1c')]=_0x29d978;if(_0x558669[_0x323a('0x35')][_0x323a('0x43')]){_0x255a0a[_0x323a('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x323a('0x45')](_0x255a0a);})[_0x323a('0x23')](function(_0x470ed9){_0x23ea9b[_0x323a('0x46')]=_0x470ed9;return _0x23ea9b;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1d7434,_0x255a0a))[_0x323a('0x4b')](handleError(_0x1d7434,null));};exports[_0x323a('0x61')]=function(_0x37a110,_0x521ddb,_0x38d0ce){var _0x56b943={'raw':!![],'where':{}};var _0x3b205c={};var _0x15cc44={'count':0x0,'rows':[]};return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x37a110[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x521ddb,null))[_0x323a('0x23')](function(_0x323746){if(_0x323746){_0x3b205c['model']=_[_0x323a('0x32')](db['CmHopperBlack'][_0x323a('0x49')]);_0x3b205c[_0x323a('0x35')]=_[_0x323a('0x32')](_0x37a110['query']);_0x3b205c[_0x323a('0x33')]=_['intersection'](_0x3b205c[_0x323a('0x31')],_0x3b205c[_0x323a('0x35')]);_0x56b943[_0x323a('0x36')]=_[_0x323a('0x34')](_0x3b205c[_0x323a('0x31')],qs[_0x323a('0x37')](_0x37a110['query'][_0x323a('0x37')]));_0x56b943[_0x323a('0x36')]=_0x56b943[_0x323a('0x36')][_0x323a('0x38')]?_0x56b943[_0x323a('0x36')]:_0x3b205c[_0x323a('0x31')];if(!_0x37a110['query'][_0x323a('0x39')](_0x323a('0x3a'))){_0x56b943['limit']=qs[_0x323a('0x1b')](_0x37a110['query'][_0x323a('0x1b')]);_0x56b943[_0x323a('0x1d')]=qs['offset'](_0x37a110[_0x323a('0x35')][_0x323a('0x1d')]);}_0x56b943[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x37a110[_0x323a('0x35')][_0x323a('0x3c')]);_0x56b943['where']=qs['filters'](_[_0x323a('0x5c')](_0x37a110[_0x323a('0x35')],_0x3b205c[_0x323a('0x33')]));_0x56b943['where'][_0x323a('0x5f')]=_0x323746['id'];if(_0x37a110[_0x323a('0x35')]['filter']){_0x56b943['where']=_['merge'](_0x56b943['where'],{'$or':_[_0x323a('0x40')](_0x56b943[_0x323a('0x36')],function(_0x1c36c7){var _0x1478ec={};_0x1478ec[_0x1c36c7]={'$like':'%'+_0x37a110[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x1478ec;})});}_0x56b943=_[_0x323a('0x3f')]({},_0x56b943,_0x37a110[_0x323a('0x42')]);return db[_0x323a('0x62')]['count']({'where':_0x56b943['where']})[_0x323a('0x23')](function(_0x4f2dc2){_0x15cc44[_0x323a('0x1c')]=_0x4f2dc2;if(_0x37a110[_0x323a('0x35')]['includeAll']){_0x56b943[_0x323a('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x323a('0x45')](_0x56b943);})[_0x323a('0x23')](function(_0x48fc68){_0x15cc44['rows']=_0x48fc68;return _0x15cc44;});}})['then'](respondWithFilteredResult(_0x521ddb,_0x56b943))[_0x323a('0x4b')](handleError(_0x521ddb,null));};exports[_0x323a('0x63')]=function(_0x1aa3db,_0x493d73,_0x5cb5dd){var _0x2683b0={};var _0x1ff56f={};var _0x588487;var _0x12ca9e;return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x1aa3db[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x493d73,null))[_0x323a('0x23')](function(_0x347711){if(_0x347711){_0x588487=_0x347711;_0x1ff56f['model']=_[_0x323a('0x32')](db[_0x323a('0x64')][_0x323a('0x49')]);_0x1ff56f[_0x323a('0x35')]=_['keys'](_0x1aa3db[_0x323a('0x35')]);_0x1ff56f['filters']=_['intersection'](_0x1ff56f['model'],_0x1ff56f[_0x323a('0x35')]);_0x2683b0[_0x323a('0x36')]=_['intersection'](_0x1ff56f[_0x323a('0x31')],qs[_0x323a('0x37')](_0x1aa3db[_0x323a('0x35')][_0x323a('0x37')]));_0x2683b0['attributes']=_0x2683b0['attributes'][_0x323a('0x38')]?_0x2683b0[_0x323a('0x36')]:_0x1ff56f[_0x323a('0x31')];_0x2683b0[_0x323a('0x3b')]=qs['sort'](_0x1aa3db[_0x323a('0x35')]['sort']);_0x2683b0['where']=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x1aa3db[_0x323a('0x35')],_0x1ff56f[_0x323a('0x33')]));if(_0x1aa3db[_0x323a('0x35')][_0x323a('0x3e')]){_0x2683b0[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x2683b0[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x2683b0[_0x323a('0x36')],function(_0x1b6c24){var _0x20536e={};_0x20536e[_0x1b6c24]={'$like':'%'+_0x1aa3db[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x20536e;})});}_0x2683b0=_[_0x323a('0x3f')]({},_0x2683b0,_0x1aa3db['options']);return _0x588487[_0x323a('0x63')](_0x2683b0);}})['then'](function(_0x560edb){if(_0x560edb){_0x12ca9e=_0x560edb[_0x323a('0x38')];if(!_0x1aa3db[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x2683b0['limit']=qs[_0x323a('0x1b')](_0x1aa3db[_0x323a('0x35')][_0x323a('0x1b')]);_0x2683b0[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0x1aa3db[_0x323a('0x35')]['offset']);}return _0x588487[_0x323a('0x63')](_0x2683b0);}})[_0x323a('0x23')](function(_0x47199d){if(_0x47199d){return _0x47199d?{'count':_0x12ca9e,'rows':_0x47199d}:null;}})[_0x323a('0x23')](respondWithResult(_0x493d73,null))['catch'](handleError(_0x493d73,null));};exports['addLists']=function(_0x1a9eed,_0x492b8a,_0x4a6e1d){var _0x29f535,_0x3d09e6;var _0x33cc63=[];var _0x16929e=moment()[_0x323a('0x65')](_0x323a('0x66'));return db[_0x323a('0x2d')]['find']({'where':{'id':_0x1a9eed[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x492b8a,null))[_0x323a('0x23')](function(_0x2be4bc){if(_0x2be4bc){_0x3d09e6=_0x2be4bc;return _0x2be4bc[_0x323a('0x67')](_0x1a9eed[_0x323a('0x4d')][_0x323a('0x68')],_['omit'](_0x1a9eed[_0x323a('0x4d')],[_0x323a('0x68'),'id'])||{});}return null;})[_0x323a('0x69')](function(_0x2abb88){var _0x129240;var _0x2ab78e;_0x29f535=_0x2abb88||[];var _0x4e64e3=[];if(_0x2abb88){for(var _0x597e98=0x0;_0x597e98<_0x2abb88[_0x323a('0x38')];_0x597e98+=0x1){var _0x29f2db=_0x2abb88[_0x597e98][_0x323a('0x24')]({'plain':!![]});_0x3d09e6[_0x323a('0x6a')]=_0x1a9eed[_0x323a('0x4d')][_0x323a('0x6a')]?_0x1a9eed[_0x323a('0x4d')][_0x323a('0x6a')]:_0x3d09e6['dialCheckDuplicateType'];switch(_0x3d09e6[_0x323a('0x6a')]){case _0x323a('0x6b'):_0x129240=squel[_0x323a('0x6c')]()['into'](_0x323a('0x6d'))[_0x323a('0x6e')](['phone',_0x323a('0x6f'),_0x323a('0x70'),_0x323a('0x71'),'CampaignId',_0x323a('0x56'),'updatedAt'],squel[_0x323a('0x72')]()[_0x323a('0x73')](_0x323a('0x74'),_0x323a('0x74'))[_0x323a('0x73')](_0x323a('0x75'),_0x323a('0x6f'))[_0x323a('0x73')]('id','ContactId')[_0x323a('0x73')](_0x29f2db[_0x323a('0x76')][_0x323a('0x77')](),_0x323a('0x71'))[_0x323a('0x73')](_0x1a9eed['params']['id'][_0x323a('0x77')](),'CampaignId')['field']('\x27'+_0x16929e+'\x27',_0x323a('0x56'))['field']('\x27'+_0x16929e+'\x27',_0x323a('0x57'))[_0x323a('0x78')](_0x323a('0x79'))[_0x323a('0x3d')]('deletedAt\x20IS\x20NULL')[_0x323a('0x3d')](_0x323a('0x7a'),_0x29f2db[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x7b'))[_0x323a('0x3d')](_0x323a('0x7c'),squel[_0x323a('0x72')]()[_0x323a('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x323a('0x7d'))[_0x323a('0x3d')](_0x323a('0x7e'),_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')]()))[_0x323a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x323a('0x7f'))[_0x323a('0x78')](_0x323a('0x6d'))['where'](_0x323a('0x7e'),_0x1a9eed[_0x323a('0x48')]['id']['toString']())))[_0x323a('0x77')]();break;case'onlyIfOpen':_0x129240=squel[_0x323a('0x6c')]()[_0x323a('0x80')](_0x323a('0x6d'))['fromQuery']([_0x323a('0x74'),_0x323a('0x6f'),'ContactId','ListId','CampaignId',_0x323a('0x56'),_0x323a('0x57')],squel[_0x323a('0x72')]()[_0x323a('0x73')](_0x323a('0x74'),_0x323a('0x74'))['field']('NOW()',_0x323a('0x6f'))['field']('id',_0x323a('0x70'))[_0x323a('0x73')](_0x29f2db[_0x323a('0x76')][_0x323a('0x77')](),_0x323a('0x71'))[_0x323a('0x73')](_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')](),_0x323a('0x5f'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27','createdAt')[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x57'))['from'](_0x323a('0x79'))[_0x323a('0x3d')](_0x323a('0x81'))[_0x323a('0x3d')](_0x323a('0x7a'),_0x29f2db[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x7b'))[_0x323a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x323a('0x72')]()[_0x323a('0x73')]('COALESCE(phone,\x27\x27)')[_0x323a('0x78')](_0x323a('0x6d'))['where'](_0x323a('0x7e'),_0x1a9eed[_0x323a('0x48')]['id']['toString']())))[_0x323a('0x77')]();break;default:_0x129240=squel[_0x323a('0x6c')]()['into'](_0x323a('0x6d'))['fromQuery'](['phone','scheduledAt','ContactId','ListId','CampaignId','createdAt',_0x323a('0x57')],squel[_0x323a('0x72')]()[_0x323a('0x73')]('phone','phone')[_0x323a('0x73')]('NOW()',_0x323a('0x6f'))[_0x323a('0x73')]('id',_0x323a('0x70'))['field'](_0x29f2db[_0x323a('0x76')][_0x323a('0x77')](),'ListId')['field'](_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')](),_0x323a('0x5f'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x56'))['field']('\x27'+_0x16929e+'\x27','updatedAt')[_0x323a('0x78')](_0x323a('0x79'))[_0x323a('0x3d')](_0x323a('0x81'))[_0x323a('0x3d')](_0x323a('0x7a'),_0x29f2db['CmListId'][_0x323a('0x77')]())[_0x323a('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x323a('0x77')]();}_0x2ab78e=squel[_0x323a('0x6c')]()[_0x323a('0x80')](_0x323a('0x82'))['fromQuery'](['cmHopperId',_0x323a('0x6f'),_0x323a('0x74'),_0x323a('0x83'),'createdAt','updatedAt'],squel['select']()[_0x323a('0x73')](_0x323a('0x84'),'id')['field'](_0x323a('0x75'),'scheduledAt')[_0x323a('0x73')]('ci.item','phone')['field'](_0x323a('0x85'),_0x323a('0x83'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x56'))[_0x323a('0x73')]('\x27'+_0x16929e+'\x27',_0x323a('0x57'))[_0x323a('0x78')]('cm_contact_has_items','ci')[_0x323a('0x86')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x323a('0x3d')](_0x323a('0x87'),_0x29f2db[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x88'),_0x1a9eed[_0x323a('0x48')]['id'][_0x323a('0x77')]())['where'](_0x323a('0x89'),_0x16929e))[_0x323a('0x77')]();_0x4e64e3[_0x323a('0x8a')](db[_0x323a('0x8b')][_0x323a('0x35')](_0x129240));_0x33cc63[_0x323a('0x8a')](db['sequelize']['query'](_0x2ab78e));}return BPromise[_0x323a('0x8c')](_0x4e64e3);}})[_0x323a('0x23')](function(){return BPromise[_0x323a('0x8c')](_0x33cc63);})[_0x323a('0x23')](function(){return _0x29f535;})[_0x323a('0x23')](respondWithResult(_0x492b8a,null))[_0x323a('0x4b')](handleError(_0x492b8a,null));};exports[_0x323a('0x8d')]=function(_0x6b45a,_0x5bf9dc,_0x569182){return db[_0x323a('0x2d')][_0x323a('0x4a')]({'where':{'id':_0x6b45a[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bf9dc,null))[_0x323a('0x23')](function(_0x53bf3f){if(_0x53bf3f){return _0x53bf3f[_0x323a('0x8d')](_0x6b45a[_0x323a('0x35')]['ids']);}})[_0x323a('0x23')](function(_0x7071a){if(_0x7071a){return db['CmHopper'][_0x323a('0x22')]({'where':{'ListId':_0x6b45a[_0x323a('0x35')]['ids'],'CampaignId':_0x6b45a['params']['id']}})[_0x323a('0x23')](function(){return _0x7071a;});}})[_0x323a('0x23')](respondWithStatusCode(_0x5bf9dc,null))[_0x323a('0x4b')](handleError(_0x5bf9dc,null));};exports['getBlackLists']=function(_0x527f76,_0xb02c4,_0x536a33){var _0x3e43dd={};var _0x271c45={};var _0x53de48;var _0xdef9ba;return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x527f76[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0xb02c4,null))[_0x323a('0x23')](function(_0x1e1b2a){if(_0x1e1b2a){_0x53de48=_0x1e1b2a;_0x271c45[_0x323a('0x31')]=_[_0x323a('0x32')](db[_0x323a('0x64')][_0x323a('0x49')]);_0x271c45[_0x323a('0x35')]=_[_0x323a('0x32')](_0x527f76[_0x323a('0x35')]);_0x271c45['filters']=_[_0x323a('0x34')](_0x271c45[_0x323a('0x31')],_0x271c45[_0x323a('0x35')]);_0x3e43dd[_0x323a('0x36')]=_[_0x323a('0x34')](_0x271c45[_0x323a('0x31')],qs['fields'](_0x527f76['query'][_0x323a('0x37')]));_0x3e43dd[_0x323a('0x36')]=_0x3e43dd[_0x323a('0x36')]['length']?_0x3e43dd[_0x323a('0x36')]:_0x271c45[_0x323a('0x31')];_0x3e43dd[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x527f76[_0x323a('0x35')][_0x323a('0x3c')]);_0x3e43dd['where']=qs['filters'](_[_0x323a('0x5c')](_0x527f76[_0x323a('0x35')],_0x271c45['filters']));if(_0x527f76[_0x323a('0x35')][_0x323a('0x3e')]){_0x3e43dd['where']=_['merge'](_0x3e43dd[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x3e43dd[_0x323a('0x36')],function(_0x4d2b90){var _0xd16304={};_0xd16304[_0x4d2b90]={'$like':'%'+_0x527f76['query'][_0x323a('0x3e')]+'%'};return _0xd16304;})});}_0x3e43dd=_[_0x323a('0x3f')]({},_0x3e43dd,_0x527f76['options']);return _0x53de48[_0x323a('0x8e')](_0x3e43dd);}})[_0x323a('0x23')](function(_0x117890){if(_0x117890){_0xdef9ba=_0x117890['length'];if(!_0x527f76[_0x323a('0x35')][_0x323a('0x39')]('nolimit')){_0x3e43dd[_0x323a('0x1b')]=qs['limit'](_0x527f76[_0x323a('0x35')][_0x323a('0x1b')]);_0x3e43dd[_0x323a('0x1d')]=qs['offset'](_0x527f76['query']['offset']);}return _0x53de48[_0x323a('0x8e')](_0x3e43dd);}})[_0x323a('0x23')](function(_0x2ad176){if(_0x2ad176){return _0x2ad176?{'count':_0xdef9ba,'rows':_0x2ad176}:null;}})[_0x323a('0x23')](respondWithResult(_0xb02c4,null))['catch'](handleError(_0xb02c4,null));};exports[_0x323a('0x8f')]=function(_0x5a19c6,_0x160ede,_0x14d9a0){var _0x4101aa,_0x5d5645;var _0x1a459a=[];var _0x5bdf97=moment()[_0x323a('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x323a('0x2d')][_0x323a('0x4a')]({'where':{'id':_0x5a19c6[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x160ede,null))['then'](function(_0x5c5d24){if(_0x5c5d24){_0x5d5645=_0x5c5d24;return _0x5c5d24[_0x323a('0x8f')](_0x5a19c6['body']['ids'],_[_0x323a('0x55')](_0x5a19c6[_0x323a('0x4d')],[_0x323a('0x68'),'id'])||{});}return null;})['spread'](function(_0x12479a){var _0x2b5aa0;var _0x113e4b;_0x4101aa=_0x12479a||[];var _0x4e65aa=[];if(_0x12479a){for(var _0x56c61e=0x0;_0x56c61e<_0x12479a[_0x323a('0x38')];_0x56c61e+=0x1){var _0xc0ede7=_0x12479a[_0x56c61e][_0x323a('0x24')]({'plain':!![]});_0x2b5aa0=squel[_0x323a('0x6c')]()[_0x323a('0x80')](_0x323a('0x90'))[_0x323a('0x6e')]([_0x323a('0x74'),_0x323a('0x70'),_0x323a('0x71'),_0x323a('0x5f'),'createdAt','updatedAt'],squel[_0x323a('0x72')]()[_0x323a('0x73')]('phone','phone')[_0x323a('0x73')]('id',_0x323a('0x70'))['field'](_0xc0ede7['CmListId'][_0x323a('0x77')](),_0x323a('0x71'))[_0x323a('0x73')](_0x5a19c6['params']['id'][_0x323a('0x77')](),_0x323a('0x5f'))[_0x323a('0x73')](_0x323a('0x75'),_0x323a('0x56'))[_0x323a('0x73')]('NOW()',_0x323a('0x57'))[_0x323a('0x78')](_0x323a('0x79'))[_0x323a('0x3d')](_0x323a('0x81'))['where'](_0x323a('0x7a'),_0xc0ede7[_0x323a('0x76')][_0x323a('0x77')]())[_0x323a('0x3d')](_0x323a('0x7b')))[_0x323a('0x77')]();_0x4e65aa[_0x323a('0x8a')](db[_0x323a('0x8b')]['query'](_0x2b5aa0));}return BPromise[_0x323a('0x8c')](_0x4e65aa);}})[_0x323a('0x23')](function(){return _0x4101aa;})[_0x323a('0x23')](respondWithResult(_0x160ede,null))[_0x323a('0x4b')](handleError(_0x160ede,null));};exports[_0x323a('0x91')]=function(_0xbdb1e8,_0x213094,_0x21fea6){return db[_0x323a('0x2d')]['find']({'where':{'id':_0xbdb1e8[_0x323a('0x48')]['id']}})['then'](handleEntityNotFound(_0x213094,null))[_0x323a('0x23')](function(_0x39e4f2){if(_0x39e4f2){return _0x39e4f2[_0x323a('0x91')](_0xbdb1e8['query'][_0x323a('0x68')]);}})['then'](function(_0x21e4cd){if(_0x21e4cd){return db[_0x323a('0x62')][_0x323a('0x22')]({'where':{'ListId':_0xbdb1e8[_0x323a('0x35')][_0x323a('0x68')],'CampaignId':_0xbdb1e8[_0x323a('0x48')]['id']}})['then'](function(){return _0x21e4cd;});}})['then'](respondWithStatusCode(_0x213094,null))[_0x323a('0x4b')](handleError(_0x213094,null));}; \ No newline at end of file +var _0x8164=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','params','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','nolimit','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','stack','name','send','index','Campaign','rawAttributes','type','key','model','map','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','includeAll','create','body'];(function(_0x5b360e,_0x494136){var _0x1bf752=function(_0x6df32e){while(--_0x6df32e){_0x5b360e['push'](_0x5b360e['shift']());}};_0x1bf752(++_0x494136);}(_0x8164,0x170));var _0x4816=function(_0x36f102,_0x212728){_0x36f102=_0x36f102-0x0;var _0x3d860c=_0x8164[_0x36f102];return _0x3d860c;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c173b,_0x51a5f8){_0x51a5f8=_0x51a5f8||0xcc;return function(_0x5c4d42){if(_0x5c4d42){return _0x3c173b[_0x4816('0x15')](_0x51a5f8);}return _0x3c173b['status'](_0x51a5f8)[_0x4816('0x16')]();};}function respondWithResult(_0x2554b4,_0x13a685){_0x13a685=_0x13a685||0xc8;return function(_0x316f36){if(_0x316f36){return _0x2554b4[_0x4816('0x17')](_0x13a685)[_0x4816('0x18')](_0x316f36);}};}function respondWithFilteredResult(_0x1eb683,_0x2a58b7){return function(_0x45c006){if(_0x45c006){var _0x21354c=typeof _0x2a58b7[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x2a58b7[_0x4816('0x1b')]===_0x4816('0x1a');var _0x1961a5=_0x45c006[_0x4816('0x1c')];var _0x4803d0=_0x21354c?0x0:_0x2a58b7['offset'];var _0x8d4393=_0x21354c?_0x45c006[_0x4816('0x1c')]:_0x2a58b7[_0x4816('0x19')]+_0x2a58b7[_0x4816('0x1b')];var _0xc8ffd5;if(_0x8d4393>=_0x1961a5){_0x8d4393=_0x1961a5;_0xc8ffd5=0xc8;}else{_0xc8ffd5=0xce;}_0x1eb683[_0x4816('0x17')](_0xc8ffd5);return _0x1eb683[_0x4816('0x1d')](_0x4816('0x1e'),_0x4803d0+'-'+_0x8d4393+'/'+_0x1961a5)[_0x4816('0x18')](_0x45c006);}return null;};}function patchUpdates(_0x53189e){return function(_0x1ab50d){try{jsonpatch['apply'](_0x1ab50d,_0x53189e,!![]);}catch(_0x521472){return BPromise[_0x4816('0x1f')](_0x521472);}return _0x1ab50d[_0x4816('0x20')]();};}function saveUpdates(_0x5de184,_0x2bbaf4){return function(_0x576221){if(_0x576221){return _0x576221[_0x4816('0x21')](_0x5de184)[_0x4816('0x22')](function(_0x571c81){return _0x571c81;});}return null;};}function removeEntity(_0x504851,_0xe484b2){return function(_0x2c8dc4){if(_0x2c8dc4){return _0x2c8dc4[_0x4816('0x23')]()['then'](function(){var _0x9b1a4c=_0x2c8dc4[_0x4816('0x24')]({'plain':!![]});var _0x126c60=_0x4816('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x126c60,'resourceId':_0x9b1a4c['id']}})[_0x4816('0x22')](function(){return _0x2c8dc4;});})[_0x4816('0x22')](function(){_0x504851['status'](0xcc)[_0x4816('0x16')]();});}};}function handleEntityNotFound(_0x4f9386,_0x551d15){return function(_0x386a16){if(!_0x386a16){_0x4f9386[_0x4816('0x15')](0x194);}return _0x386a16;};}function handleError(_0x2d8514,_0x5a1e61){_0x5a1e61=_0x5a1e61||0x1f4;return function(_0xbeb8fb){logger['error'](_0xbeb8fb[_0x4816('0x26')]);if(_0xbeb8fb[_0x4816('0x27')]){delete _0xbeb8fb['name'];}_0x2d8514[_0x4816('0x17')](_0x5a1e61)[_0x4816('0x28')](_0xbeb8fb);};}exports[_0x4816('0x29')]=function(_0x17037a,_0x1ba256){var _0x332af7={},_0x2e9a77={},_0x327a07={'count':0x0,'rows':[]};var _0x11ba1a=_['map'](db[_0x4816('0x2a')][_0x4816('0x2b')],function(_0x56ed76){return{'name':_0x56ed76['fieldName'],'type':_0x56ed76[_0x4816('0x2c')][_0x4816('0x2d')]};});_0x2e9a77[_0x4816('0x2e')]=_[_0x4816('0x2f')](_0x11ba1a,_0x4816('0x27'));_0x2e9a77['query']=_['keys'](_0x17037a['query']);_0x2e9a77[_0x4816('0x30')]=_[_0x4816('0x31')](_0x2e9a77[_0x4816('0x2e')],_0x2e9a77[_0x4816('0x32')]);_0x332af7[_0x4816('0x33')]=_[_0x4816('0x31')](_0x2e9a77['model'],qs[_0x4816('0x34')](_0x17037a['query'][_0x4816('0x34')]));_0x332af7[_0x4816('0x33')]=_0x332af7[_0x4816('0x33')][_0x4816('0x35')]?_0x332af7[_0x4816('0x33')]:_0x2e9a77['model'];if(!_0x17037a[_0x4816('0x32')]['hasOwnProperty']('nolimit')){_0x332af7[_0x4816('0x1b')]=qs['limit'](_0x17037a['query']['limit']);_0x332af7['offset']=qs[_0x4816('0x19')](_0x17037a[_0x4816('0x32')]['offset']);}_0x332af7[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x17037a['query'][_0x4816('0x37')]);_0x332af7[_0x4816('0x38')]=qs[_0x4816('0x30')](_[_0x4816('0x39')](_0x17037a['query'],_0x2e9a77[_0x4816('0x30')]),_0x11ba1a);if(_0x17037a[_0x4816('0x32')][_0x4816('0x3a')]){_0x332af7[_0x4816('0x38')]=_[_0x4816('0x3b')](_0x332af7[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x11ba1a,function(_0x1ef378){if(_0x1ef378[_0x4816('0x2c')]!==_0x4816('0x3c')){var _0xcbded0={};_0xcbded0[_0x1ef378[_0x4816('0x27')]]={'$like':'%'+_0x17037a[_0x4816('0x32')]['filter']+'%'};return _0xcbded0;}})});}_0x332af7=_[_0x4816('0x3b')]({},_0x332af7,_0x17037a[_0x4816('0x3d')]);var _0x4cbb05={'where':_0x332af7[_0x4816('0x38')]};return db[_0x4816('0x2a')][_0x4816('0x1c')](_0x4cbb05)[_0x4816('0x22')](function(_0x5d441a){_0x327a07[_0x4816('0x1c')]=_0x5d441a;if(_0x17037a['query']['includeAll']){_0x332af7[_0x4816('0x3e')]=[{'all':!![]}];}return db[_0x4816('0x2a')]['findAll'](_0x332af7);})[_0x4816('0x22')](function(_0x432bce){_0x327a07[_0x4816('0x3f')]=_0x432bce;return _0x327a07;})['then'](respondWithFilteredResult(_0x1ba256,_0x332af7))[_0x4816('0x40')](handleError(_0x1ba256,null));};exports[_0x4816('0x41')]=function(_0x178e62,_0xdec91c){var _0x40115d={'raw':![],'where':{'id':_0x178e62['params']['id']}},_0x39c713={};_0x39c713[_0x4816('0x2e')]=_['keys'](db['Campaign']['rawAttributes']);_0x39c713[_0x4816('0x32')]=_[_0x4816('0x42')](_0x178e62[_0x4816('0x32')]);_0x39c713[_0x4816('0x30')]=_[_0x4816('0x31')](_0x39c713[_0x4816('0x2e')],_0x39c713[_0x4816('0x32')]);_0x40115d[_0x4816('0x33')]=_[_0x4816('0x31')](_0x39c713[_0x4816('0x2e')],qs['fields'](_0x178e62['query'][_0x4816('0x34')]));_0x40115d[_0x4816('0x33')]=_0x40115d[_0x4816('0x33')][_0x4816('0x35')]?_0x40115d[_0x4816('0x33')]:_0x39c713[_0x4816('0x2e')];if(_0x178e62[_0x4816('0x32')][_0x4816('0x43')]){_0x40115d['include']=[{'all':!![]}];}_0x40115d=_[_0x4816('0x3b')]({},_0x40115d,_0x178e62[_0x4816('0x3d')]);return db[_0x4816('0x2a')]['find'](_0x40115d)['then'](handleEntityNotFound(_0xdec91c,null))[_0x4816('0x22')](respondWithResult(_0xdec91c,null))[_0x4816('0x40')](handleError(_0xdec91c,null));};exports[_0x4816('0x44')]=function(_0x5d8b92,_0x247adb){return db[_0x4816('0x2a')][_0x4816('0x44')](_0x5d8b92[_0x4816('0x45')],{})[_0x4816('0x22')](function(_0x4401c6){var _0xbc898a=_0x5d8b92['user'][_0x4816('0x24')]({'plain':!![]});if(!_0xbc898a)throw new Error(_0x4816('0x46'));if(_0xbc898a[_0x4816('0x47')]===_0x4816('0x48')){var _0x158127=_0x4401c6[_0x4816('0x24')]({'plain':!![]});var _0x309778=_0x4816('0x25');return db[_0x4816('0x49')][_0x4816('0x4a')]({'where':{'name':_0x309778,'userProfileId':_0xbc898a[_0x4816('0x4b')]},'raw':!![]})[_0x4816('0x22')](function(_0x2b2f24){if(_0x2b2f24&&_0x2b2f24[_0x4816('0x4c')]===0x0){return db[_0x4816('0x4d')][_0x4816('0x44')]({'name':_0x158127[_0x4816('0x27')],'resourceId':_0x158127['id'],'type':_0x2b2f24[_0x4816('0x27')],'sectionId':_0x2b2f24['id']},{})[_0x4816('0x22')](function(){return _0x4401c6;});}else{return _0x4401c6;}})[_0x4816('0x40')](function(_0x1702bf){logger[_0x4816('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1702bf);throw _0x1702bf;});}return _0x4401c6;})[_0x4816('0x22')](respondWithResult(_0x247adb,0xc9))[_0x4816('0x40')](handleError(_0x247adb,null));};exports['clone']=function(_0x3604e6,_0xa2a654){var _0x2c56a8={'where':{'id':_0x3604e6[_0x4816('0x4f')]['id']}},_0x46a8ad={};_0x46a8ad[_0x4816('0x2e')]=_[_0x4816('0x42')](db[_0x4816('0x2a')][_0x4816('0x2b')]);_0x2c56a8[_0x4816('0x33')]=_['intersection'](_0x46a8ad[_0x4816('0x2e')],qs['fields'](_0x3604e6[_0x4816('0x32')][_0x4816('0x34')]));_0x2c56a8['attributes']=_0x2c56a8[_0x4816('0x33')][_0x4816('0x35')]?_0x2c56a8[_0x4816('0x33')]:_0x46a8ad[_0x4816('0x2e')];if(_0x3604e6[_0x4816('0x32')]['includeAll']){_0x2c56a8[_0x4816('0x3e')]=[{'all':!![]}];}_0x2c56a8=_[_0x4816('0x3b')]({},_0x2c56a8,_0x3604e6[_0x4816('0x3d')]);return db[_0x4816('0x2a')][_0x4816('0x4a')](_0x2c56a8)[_0x4816('0x22')](handleEntityNotFound(_0xa2a654,null))['then'](function(_0x10cb2c){if(_0x10cb2c){var _0x43c287=_0x10cb2c[_0x4816('0x24')]({'plain':!![]});_0x43c287=qs['omit'](_0x43c287,['id',_0x4816('0x50'),_0x4816('0x51')]);_0x3604e6[_0x4816('0x45')]=_['omit'](_0x3604e6[_0x4816('0x45')],['id',_0x4816('0x50'),_0x4816('0x51')]);return db[_0x4816('0x2a')]['create'](_[_0x4816('0x3b')](_0x43c287,_0x3604e6[_0x4816('0x45')]),{'include':_0x3604e6[_0x4816('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2a9d8b){var _0x4262ba=_0x3604e6[_0x4816('0x48')][_0x4816('0x24')]({'plain':!![]});if(!_0x4262ba)throw new Error(_0x4816('0x46'));if(_0x4262ba[_0x4816('0x47')]===_0x4816('0x48')){var _0x5806a2=_0x2a9d8b[_0x4816('0x24')]({'plain':!![]});var _0x3e2910=_0x4816('0x25');return db['UserProfileSection'][_0x4816('0x4a')]({'where':{'name':_0x3e2910,'userProfileId':_0x4262ba[_0x4816('0x4b')]},'raw':!![]})[_0x4816('0x22')](function(_0x2c2a8c){if(_0x2c2a8c&&_0x2c2a8c[_0x4816('0x4c')]===0x0){return db[_0x4816('0x4d')][_0x4816('0x44')]({'name':_0x5806a2['name'],'resourceId':_0x5806a2['id'],'type':_0x2c2a8c[_0x4816('0x27')],'sectionId':_0x2c2a8c['id']},{})[_0x4816('0x22')](function(){return _0x2a9d8b;});}else{return _0x2a9d8b;}})[_0x4816('0x40')](function(_0x4a3cf9){logger[_0x4816('0x4e')](_0x4816('0x52'),_0x4a3cf9);throw _0x4a3cf9;});}return _0x2a9d8b;});}})['then'](respondWithResult(_0xa2a654,0xc9))[_0x4816('0x40')](handleError(_0xa2a654,null));};exports[_0x4816('0x21')]=function(_0x211a2b,_0x2effd6){if(_0x211a2b[_0x4816('0x45')]['id']){delete _0x211a2b[_0x4816('0x45')]['id'];}return db[_0x4816('0x2a')]['find']({'where':{'id':_0x211a2b[_0x4816('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2effd6,null))['then'](saveUpdates(_0x211a2b['body'],null))['then'](respondWithResult(_0x2effd6,null))['catch'](handleError(_0x2effd6,null));};exports[_0x4816('0x23')]=function(_0xa12b46,_0x21cd81){return db['Campaign'][_0x4816('0x4a')]({'where':{'id':_0xa12b46[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x21cd81,null))[_0x4816('0x22')](removeEntity(_0x21cd81,null))[_0x4816('0x40')](handleError(_0x21cd81,null));};exports[_0x4816('0x53')]=function(_0x797807,_0x4a54e8,_0x2997c1){var _0x5731a8={'raw':!![],'where':{}};var _0x44c2ec={};var _0x2cbc59={'count':0x0,'rows':[]};return db[_0x4816('0x2a')][_0x4816('0x54')]({'where':{'id':_0x797807[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x4a54e8,null))['then'](function(_0x3201d2){if(_0x3201d2){_0x44c2ec[_0x4816('0x2e')]=_[_0x4816('0x42')](db['CmHopper'][_0x4816('0x2b')]);_0x44c2ec[_0x4816('0x32')]=_[_0x4816('0x42')](_0x797807['query']);_0x44c2ec[_0x4816('0x30')]=_[_0x4816('0x31')](_0x44c2ec[_0x4816('0x2e')],_0x44c2ec[_0x4816('0x32')]);_0x5731a8[_0x4816('0x33')]=_[_0x4816('0x31')](_0x44c2ec[_0x4816('0x2e')],qs['fields'](_0x797807[_0x4816('0x32')][_0x4816('0x34')]));_0x5731a8[_0x4816('0x33')]=_0x5731a8[_0x4816('0x33')][_0x4816('0x35')]?_0x5731a8[_0x4816('0x33')]:_0x44c2ec[_0x4816('0x2e')];if(!_0x797807['query'][_0x4816('0x55')](_0x4816('0x56'))){_0x5731a8[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x797807['query'][_0x4816('0x1b')]);_0x5731a8[_0x4816('0x19')]=qs[_0x4816('0x19')](_0x797807[_0x4816('0x32')][_0x4816('0x19')]);}_0x5731a8[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x797807[_0x4816('0x32')][_0x4816('0x37')]);_0x5731a8[_0x4816('0x38')]=qs[_0x4816('0x30')](_[_0x4816('0x39')](_0x797807[_0x4816('0x32')],_0x44c2ec['filters']));_0x5731a8[_0x4816('0x38')][_0x4816('0x57')]=_0x3201d2['id'];if(_0x797807[_0x4816('0x32')][_0x4816('0x3a')]){_0x5731a8[_0x4816('0x38')]=_[_0x4816('0x3b')](_0x5731a8[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x5731a8[_0x4816('0x33')],function(_0x201c1a){var _0x359a0d={};_0x359a0d[_0x201c1a]={'$like':'%'+_0x797807[_0x4816('0x32')][_0x4816('0x3a')]+'%'};return _0x359a0d;})});}_0x5731a8=_['merge']({},_0x5731a8,_0x797807[_0x4816('0x3d')]);return db[_0x4816('0x58')][_0x4816('0x1c')]({'where':_0x5731a8['where']})['then'](function(_0x34312f){_0x2cbc59[_0x4816('0x1c')]=_0x34312f;if(_0x797807['query'][_0x4816('0x43')]){_0x5731a8[_0x4816('0x3e')]=[{'all':!![]}];}return db[_0x4816('0x58')][_0x4816('0x59')](_0x5731a8);})['then'](function(_0x231eea){_0x2cbc59[_0x4816('0x3f')]=_0x231eea;return _0x2cbc59;});}})['then'](respondWithFilteredResult(_0x4a54e8,_0x5731a8))[_0x4816('0x40')](handleError(_0x4a54e8,null));};exports[_0x4816('0x5a')]=function(_0x4957e6,_0x18775b,_0x4ab26f){var _0xe7057={'raw':!![],'where':{}};var _0x485505={};var _0x27ff4f={'count':0x0,'rows':[]};return db[_0x4816('0x2a')][_0x4816('0x54')]({'where':{'id':_0x4957e6[_0x4816('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18775b,null))[_0x4816('0x22')](function(_0x4194f6){if(_0x4194f6){_0x485505[_0x4816('0x2e')]=_[_0x4816('0x42')](db['CmHopperHistory'][_0x4816('0x2b')]);_0x485505[_0x4816('0x32')]=_[_0x4816('0x42')](_0x4957e6[_0x4816('0x32')]);_0x485505['filters']=_[_0x4816('0x31')](_0x485505[_0x4816('0x2e')],_0x485505[_0x4816('0x32')]);_0xe7057[_0x4816('0x33')]=_[_0x4816('0x31')](_0x485505['model'],qs[_0x4816('0x34')](_0x4957e6['query'][_0x4816('0x34')]));_0xe7057[_0x4816('0x33')]=_0xe7057['attributes'][_0x4816('0x35')]?_0xe7057[_0x4816('0x33')]:_0x485505[_0x4816('0x2e')];if(!_0x4957e6['query'][_0x4816('0x55')](_0x4816('0x56'))){_0xe7057['limit']=qs[_0x4816('0x1b')](_0x4957e6[_0x4816('0x32')]['limit']);_0xe7057[_0x4816('0x19')]=qs['offset'](_0x4957e6['query']['offset']);}_0xe7057[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x4957e6[_0x4816('0x32')][_0x4816('0x37')]);_0xe7057['where']=qs[_0x4816('0x30')](_[_0x4816('0x39')](_0x4957e6[_0x4816('0x32')],_0x485505['filters']));_0xe7057[_0x4816('0x38')]['CampaignId']=_0x4194f6['id'];if(_0x4957e6['query'][_0x4816('0x3a')]){_0xe7057['where']=_['merge'](_0xe7057[_0x4816('0x38')],{'$or':_['map'](_0xe7057['attributes'],function(_0xc6b2c4){var _0x4b1f5b={};_0x4b1f5b[_0xc6b2c4]={'$like':'%'+_0x4957e6[_0x4816('0x32')][_0x4816('0x3a')]+'%'};return _0x4b1f5b;})});}_0xe7057=_[_0x4816('0x3b')]({},_0xe7057,_0x4957e6[_0x4816('0x3d')]);return db[_0x4816('0x5b')]['count']({'where':_0xe7057[_0x4816('0x38')]})[_0x4816('0x22')](function(_0x49e960){_0x27ff4f[_0x4816('0x1c')]=_0x49e960;if(_0x4957e6[_0x4816('0x32')][_0x4816('0x43')]){_0xe7057['include']=[{'all':!![]}];}return db[_0x4816('0x5b')][_0x4816('0x59')](_0xe7057);})[_0x4816('0x22')](function(_0x38190e){_0x27ff4f['rows']=_0x38190e;return _0x27ff4f;});}})[_0x4816('0x22')](respondWithFilteredResult(_0x18775b,_0xe7057))['catch'](handleError(_0x18775b,null));};exports[_0x4816('0x5c')]=function(_0x57ae99,_0x4d64ec,_0x3be6c6){var _0x4368ab={'raw':!![],'where':{}};var _0x13ae2e={};var _0x28f9b6={'count':0x0,'rows':[]};return db['Campaign'][_0x4816('0x54')]({'where':{'id':_0x57ae99[_0x4816('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d64ec,null))[_0x4816('0x22')](function(_0x3ff8db){if(_0x3ff8db){_0x13ae2e[_0x4816('0x2e')]=_[_0x4816('0x42')](db[_0x4816('0x5d')][_0x4816('0x2b')]);_0x13ae2e[_0x4816('0x32')]=_[_0x4816('0x42')](_0x57ae99[_0x4816('0x32')]);_0x13ae2e[_0x4816('0x30')]=_[_0x4816('0x31')](_0x13ae2e['model'],_0x13ae2e[_0x4816('0x32')]);_0x4368ab[_0x4816('0x33')]=_[_0x4816('0x31')](_0x13ae2e[_0x4816('0x2e')],qs['fields'](_0x57ae99['query'][_0x4816('0x34')]));_0x4368ab[_0x4816('0x33')]=_0x4368ab[_0x4816('0x33')]['length']?_0x4368ab[_0x4816('0x33')]:_0x13ae2e[_0x4816('0x2e')];if(!_0x57ae99['query'][_0x4816('0x55')](_0x4816('0x56'))){_0x4368ab[_0x4816('0x1b')]=qs['limit'](_0x57ae99[_0x4816('0x32')][_0x4816('0x1b')]);_0x4368ab[_0x4816('0x19')]=qs[_0x4816('0x19')](_0x57ae99[_0x4816('0x32')][_0x4816('0x19')]);}_0x4368ab[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x57ae99['query'][_0x4816('0x37')]);_0x4368ab['where']=qs[_0x4816('0x30')](_[_0x4816('0x39')](_0x57ae99['query'],_0x13ae2e['filters']));_0x4368ab[_0x4816('0x38')][_0x4816('0x57')]=_0x3ff8db['id'];if(_0x57ae99['query']['filter']){_0x4368ab[_0x4816('0x38')]=_[_0x4816('0x3b')](_0x4368ab[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x4368ab[_0x4816('0x33')],function(_0x32f72b){var _0x3b4d00={};_0x3b4d00[_0x32f72b]={'$like':'%'+_0x57ae99[_0x4816('0x32')][_0x4816('0x3a')]+'%'};return _0x3b4d00;})});}_0x4368ab=_[_0x4816('0x3b')]({},_0x4368ab,_0x57ae99[_0x4816('0x3d')]);return db[_0x4816('0x5d')][_0x4816('0x1c')]({'where':_0x4368ab['where']})[_0x4816('0x22')](function(_0x50232d){_0x28f9b6[_0x4816('0x1c')]=_0x50232d;if(_0x57ae99[_0x4816('0x32')][_0x4816('0x43')]){_0x4368ab[_0x4816('0x3e')]=[{'all':!![]}];}return db[_0x4816('0x5d')][_0x4816('0x59')](_0x4368ab);})[_0x4816('0x22')](function(_0x3aa6d5){_0x28f9b6[_0x4816('0x3f')]=_0x3aa6d5;return _0x28f9b6;});}})[_0x4816('0x22')](respondWithFilteredResult(_0x4d64ec,_0x4368ab))[_0x4816('0x40')](handleError(_0x4d64ec,null));};exports['getHopperBlacks']=function(_0x56c676,_0x2429c7,_0x4272c6){var _0x28cffe={'raw':!![],'where':{}};var _0x3d492d={};var _0x245a68={'count':0x0,'rows':[]};return db[_0x4816('0x2a')][_0x4816('0x54')]({'where':{'id':_0x56c676[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x2429c7,null))[_0x4816('0x22')](function(_0x1e49f7){if(_0x1e49f7){_0x3d492d[_0x4816('0x2e')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x3d492d['query']=_[_0x4816('0x42')](_0x56c676[_0x4816('0x32')]);_0x3d492d[_0x4816('0x30')]=_[_0x4816('0x31')](_0x3d492d[_0x4816('0x2e')],_0x3d492d[_0x4816('0x32')]);_0x28cffe['attributes']=_['intersection'](_0x3d492d[_0x4816('0x2e')],qs[_0x4816('0x34')](_0x56c676[_0x4816('0x32')][_0x4816('0x34')]));_0x28cffe['attributes']=_0x28cffe[_0x4816('0x33')][_0x4816('0x35')]?_0x28cffe[_0x4816('0x33')]:_0x3d492d[_0x4816('0x2e')];if(!_0x56c676['query'][_0x4816('0x55')](_0x4816('0x56'))){_0x28cffe[_0x4816('0x1b')]=qs['limit'](_0x56c676[_0x4816('0x32')]['limit']);_0x28cffe[_0x4816('0x19')]=qs['offset'](_0x56c676['query'][_0x4816('0x19')]);}_0x28cffe[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x56c676[_0x4816('0x32')][_0x4816('0x37')]);_0x28cffe['where']=qs['filters'](_[_0x4816('0x39')](_0x56c676['query'],_0x3d492d[_0x4816('0x30')]));_0x28cffe[_0x4816('0x38')]['CampaignId']=_0x1e49f7['id'];if(_0x56c676['query'][_0x4816('0x3a')]){_0x28cffe['where']=_['merge'](_0x28cffe[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x28cffe[_0x4816('0x33')],function(_0x55d4d9){var _0x3f57cc={};_0x3f57cc[_0x55d4d9]={'$like':'%'+_0x56c676[_0x4816('0x32')][_0x4816('0x3a')]+'%'};return _0x3f57cc;})});}_0x28cffe=_[_0x4816('0x3b')]({},_0x28cffe,_0x56c676[_0x4816('0x3d')]);return db[_0x4816('0x5e')][_0x4816('0x1c')]({'where':_0x28cffe[_0x4816('0x38')]})[_0x4816('0x22')](function(_0x5403ef){_0x245a68['count']=_0x5403ef;if(_0x56c676[_0x4816('0x32')]['includeAll']){_0x28cffe['include']=[{'all':!![]}];}return db[_0x4816('0x5e')][_0x4816('0x59')](_0x28cffe);})['then'](function(_0x3e978a){_0x245a68[_0x4816('0x3f')]=_0x3e978a;return _0x245a68;});}})['then'](respondWithFilteredResult(_0x2429c7,_0x28cffe))['catch'](handleError(_0x2429c7,null));};exports[_0x4816('0x5f')]=function(_0x3d1840,_0xbfc98d,_0x5784f6){var _0x162155={};var _0x4bbc68={};var _0xf61fb6;var _0x2733bd;return db[_0x4816('0x2a')][_0x4816('0x54')]({'where':{'id':_0x3d1840['params']['id']}})['then'](handleEntityNotFound(_0xbfc98d,null))[_0x4816('0x22')](function(_0x2e7131){if(_0x2e7131){_0xf61fb6=_0x2e7131;_0x4bbc68[_0x4816('0x2e')]=_['keys'](db[_0x4816('0x60')][_0x4816('0x2b')]);_0x4bbc68[_0x4816('0x32')]=_[_0x4816('0x42')](_0x3d1840[_0x4816('0x32')]);_0x4bbc68['filters']=_['intersection'](_0x4bbc68['model'],_0x4bbc68[_0x4816('0x32')]);_0x162155[_0x4816('0x33')]=_[_0x4816('0x31')](_0x4bbc68[_0x4816('0x2e')],qs[_0x4816('0x34')](_0x3d1840[_0x4816('0x32')]['fields']));_0x162155['attributes']=_0x162155[_0x4816('0x33')]['length']?_0x162155[_0x4816('0x33')]:_0x4bbc68['model'];_0x162155[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x3d1840['query'][_0x4816('0x37')]);_0x162155['where']=qs[_0x4816('0x30')](_[_0x4816('0x39')](_0x3d1840[_0x4816('0x32')],_0x4bbc68[_0x4816('0x30')]));if(_0x3d1840[_0x4816('0x32')]['filter']){_0x162155[_0x4816('0x38')]=_[_0x4816('0x3b')](_0x162155[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x162155[_0x4816('0x33')],function(_0x58a6de){var _0x57f0d2={};_0x57f0d2[_0x58a6de]={'$like':'%'+_0x3d1840[_0x4816('0x32')]['filter']+'%'};return _0x57f0d2;})});}_0x162155=_['merge']({},_0x162155,_0x3d1840['options']);return _0xf61fb6[_0x4816('0x5f')](_0x162155);}})['then'](function(_0x274d58){if(_0x274d58){_0x2733bd=_0x274d58['length'];if(!_0x3d1840['query'][_0x4816('0x55')](_0x4816('0x56'))){_0x162155['limit']=qs[_0x4816('0x1b')](_0x3d1840[_0x4816('0x32')][_0x4816('0x1b')]);_0x162155[_0x4816('0x19')]=qs[_0x4816('0x19')](_0x3d1840[_0x4816('0x32')]['offset']);}return _0xf61fb6[_0x4816('0x5f')](_0x162155);}})['then'](function(_0x71655a){if(_0x71655a){return _0x71655a?{'count':_0x2733bd,'rows':_0x71655a}:null;}})['then'](respondWithResult(_0xbfc98d,null))['catch'](handleError(_0xbfc98d,null));};exports[_0x4816('0x61')]=function(_0x421bb9,_0x263f4e,_0xa4bca5){var _0x59a7d6,_0x247c22;var _0x2f9c40=[];var _0x122b32=moment()[_0x4816('0x62')](_0x4816('0x63'));return db['Campaign'][_0x4816('0x4a')]({'where':{'id':_0x421bb9[_0x4816('0x4f')]['id']}})['then'](handleEntityNotFound(_0x263f4e,null))[_0x4816('0x22')](function(_0x4b7d50){if(_0x4b7d50){_0x247c22=_0x4b7d50;return _0x4b7d50[_0x4816('0x61')](_0x421bb9[_0x4816('0x45')][_0x4816('0x64')],_[_0x4816('0x65')](_0x421bb9['body'],[_0x4816('0x64'),'id'])||{});}return null;})[_0x4816('0x66')](function(_0x128fa1){var _0x54d6e2;var _0x3ac47c;_0x59a7d6=_0x128fa1||[];var _0x14f31a=[];if(_0x128fa1){for(var _0x7ad0c0=0x0;_0x7ad0c0<_0x128fa1[_0x4816('0x35')];_0x7ad0c0+=0x1){var _0x172b58=_0x128fa1[_0x7ad0c0][_0x4816('0x24')]({'plain':!![]});_0x247c22[_0x4816('0x67')]=_0x421bb9[_0x4816('0x45')][_0x4816('0x67')]?_0x421bb9['body'][_0x4816('0x67')]:_0x247c22[_0x4816('0x67')];switch(_0x247c22['dialCheckDuplicateType']){case _0x4816('0x68'):_0x54d6e2=squel[_0x4816('0x69')]()['into']('cm_hopper')[_0x4816('0x6a')]([_0x4816('0x6b'),_0x4816('0x6c'),_0x4816('0x6d'),_0x4816('0x6e'),_0x4816('0x57'),_0x4816('0x50'),_0x4816('0x51')],squel[_0x4816('0x6f')]()[_0x4816('0x70')]('phone',_0x4816('0x6b'))[_0x4816('0x70')](_0x4816('0x71'),'scheduledAt')['field']('id','ContactId')[_0x4816('0x70')](_0x172b58[_0x4816('0x72')][_0x4816('0x73')](),'ListId')['field'](_0x421bb9[_0x4816('0x4f')]['id']['toString'](),_0x4816('0x57'))[_0x4816('0x70')]('\x27'+_0x122b32+'\x27','createdAt')[_0x4816('0x70')]('\x27'+_0x122b32+'\x27',_0x4816('0x51'))[_0x4816('0x74')]('cm_contacts')[_0x4816('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x4816('0x75'),_0x172b58[_0x4816('0x72')][_0x4816('0x73')]())[_0x4816('0x38')](_0x4816('0x76'))[_0x4816('0x38')](_0x4816('0x77'),squel['select']()['field'](_0x4816('0x78'))[_0x4816('0x74')](_0x4816('0x79'))[_0x4816('0x38')](_0x4816('0x7a'),_0x421bb9[_0x4816('0x4f')]['id'][_0x4816('0x73')]()))[_0x4816('0x38')](_0x4816('0x77'),squel[_0x4816('0x6f')]()['field'](_0x4816('0x7b'))['from'](_0x4816('0x7c'))[_0x4816('0x38')](_0x4816('0x7a'),_0x421bb9[_0x4816('0x4f')]['id'][_0x4816('0x73')]())))[_0x4816('0x73')]();break;case _0x4816('0x7d'):_0x54d6e2=squel['insert']()[_0x4816('0x7e')](_0x4816('0x7c'))[_0x4816('0x6a')]([_0x4816('0x6b'),_0x4816('0x6c'),_0x4816('0x6d'),_0x4816('0x6e'),_0x4816('0x57'),_0x4816('0x50'),_0x4816('0x51')],squel['select']()['field']('phone',_0x4816('0x6b'))[_0x4816('0x70')](_0x4816('0x71'),'scheduledAt')['field']('id',_0x4816('0x6d'))['field'](_0x172b58[_0x4816('0x72')][_0x4816('0x73')](),_0x4816('0x6e'))[_0x4816('0x70')](_0x421bb9[_0x4816('0x4f')]['id'][_0x4816('0x73')](),_0x4816('0x57'))[_0x4816('0x70')]('\x27'+_0x122b32+'\x27','createdAt')[_0x4816('0x70')]('\x27'+_0x122b32+'\x27',_0x4816('0x51'))[_0x4816('0x74')](_0x4816('0x7f'))['where']('deletedAt\x20IS\x20NULL')[_0x4816('0x38')](_0x4816('0x75'),_0x172b58[_0x4816('0x72')][_0x4816('0x73')]())[_0x4816('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x4816('0x38')](_0x4816('0x77'),squel[_0x4816('0x6f')]()[_0x4816('0x70')](_0x4816('0x7b'))[_0x4816('0x74')]('cm_hopper')[_0x4816('0x38')](_0x4816('0x7a'),_0x421bb9[_0x4816('0x4f')]['id'][_0x4816('0x73')]())))[_0x4816('0x73')]();break;default:_0x54d6e2=squel['insert']()[_0x4816('0x7e')](_0x4816('0x7c'))['fromQuery']([_0x4816('0x6b'),_0x4816('0x6c'),_0x4816('0x6d'),_0x4816('0x6e'),_0x4816('0x57'),_0x4816('0x50'),_0x4816('0x51')],squel[_0x4816('0x6f')]()[_0x4816('0x70')](_0x4816('0x6b'),_0x4816('0x6b'))[_0x4816('0x70')](_0x4816('0x71'),_0x4816('0x6c'))[_0x4816('0x70')]('id',_0x4816('0x6d'))[_0x4816('0x70')](_0x172b58['CmListId'][_0x4816('0x73')](),_0x4816('0x6e'))['field'](_0x421bb9[_0x4816('0x4f')]['id'][_0x4816('0x73')](),_0x4816('0x57'))[_0x4816('0x70')]('\x27'+_0x122b32+'\x27','createdAt')['field']('\x27'+_0x122b32+'\x27',_0x4816('0x51'))[_0x4816('0x74')](_0x4816('0x7f'))[_0x4816('0x38')](_0x4816('0x80'))[_0x4816('0x38')]('ListId\x20=\x20?',_0x172b58[_0x4816('0x72')][_0x4816('0x73')]())[_0x4816('0x38')](_0x4816('0x76')))['toString']();}_0x3ac47c=squel[_0x4816('0x69')]()['into'](_0x4816('0x81'))['fromQuery']([_0x4816('0x82'),_0x4816('0x6c'),_0x4816('0x6b'),_0x4816('0x83'),_0x4816('0x50'),'updatedAt'],squel[_0x4816('0x6f')]()['field'](_0x4816('0x84'),'id')[_0x4816('0x70')](_0x4816('0x71'),_0x4816('0x6c'))[_0x4816('0x70')](_0x4816('0x85'),_0x4816('0x6b'))[_0x4816('0x70')](_0x4816('0x86'),'OrderBy')[_0x4816('0x70')]('\x27'+_0x122b32+'\x27',_0x4816('0x50'))[_0x4816('0x70')]('\x27'+_0x122b32+'\x27',_0x4816('0x51'))['from']('cm_contact_has_items','ci')[_0x4816('0x87')](_0x4816('0x7c'),'h',_0x4816('0x88'))[_0x4816('0x38')](_0x4816('0x89'),_0x172b58[_0x4816('0x72')][_0x4816('0x73')]())[_0x4816('0x38')]('h.CampaignId=?',_0x421bb9[_0x4816('0x4f')]['id'][_0x4816('0x73')]())[_0x4816('0x38')]('h.createdAt\x20=\x20?',_0x122b32))['toString']();_0x14f31a[_0x4816('0x8a')](db[_0x4816('0x8b')][_0x4816('0x32')](_0x54d6e2));_0x2f9c40[_0x4816('0x8a')](db[_0x4816('0x8b')][_0x4816('0x32')](_0x3ac47c));}return BPromise[_0x4816('0x8c')](_0x14f31a);}})[_0x4816('0x22')](function(){return BPromise[_0x4816('0x8c')](_0x2f9c40);})['then'](function(){return _0x59a7d6;})[_0x4816('0x22')](respondWithResult(_0x263f4e,null))['catch'](handleError(_0x263f4e,null));};exports[_0x4816('0x8d')]=function(_0x2a9a3c,_0x171fbb,_0x1d2b0f){return db[_0x4816('0x2a')]['find']({'where':{'id':_0x2a9a3c[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x171fbb,null))[_0x4816('0x22')](function(_0x16a930){if(_0x16a930){return _0x16a930[_0x4816('0x8d')](_0x2a9a3c[_0x4816('0x32')][_0x4816('0x64')]);}})['then'](function(_0x5a7284){if(_0x5a7284){return db[_0x4816('0x58')][_0x4816('0x23')]({'where':{'ListId':_0x2a9a3c['query'][_0x4816('0x64')],'CampaignId':_0x2a9a3c['params']['id']}})[_0x4816('0x22')](function(){return _0x5a7284;});}})['then'](respondWithStatusCode(_0x171fbb,null))[_0x4816('0x40')](handleError(_0x171fbb,null));};exports[_0x4816('0x8e')]=function(_0x4ff42d,_0xf088f0,_0x538dec){var _0x302869={};var _0x142e59={};var _0x569c68;var _0x39abca;return db[_0x4816('0x2a')][_0x4816('0x54')]({'where':{'id':_0x4ff42d[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0xf088f0,null))[_0x4816('0x22')](function(_0x18ea8a){if(_0x18ea8a){_0x569c68=_0x18ea8a;_0x142e59[_0x4816('0x2e')]=_[_0x4816('0x42')](db[_0x4816('0x60')][_0x4816('0x2b')]);_0x142e59['query']=_[_0x4816('0x42')](_0x4ff42d[_0x4816('0x32')]);_0x142e59[_0x4816('0x30')]=_[_0x4816('0x31')](_0x142e59[_0x4816('0x2e')],_0x142e59[_0x4816('0x32')]);_0x302869[_0x4816('0x33')]=_[_0x4816('0x31')](_0x142e59[_0x4816('0x2e')],qs[_0x4816('0x34')](_0x4ff42d[_0x4816('0x32')][_0x4816('0x34')]));_0x302869['attributes']=_0x302869[_0x4816('0x33')]['length']?_0x302869[_0x4816('0x33')]:_0x142e59[_0x4816('0x2e')];_0x302869[_0x4816('0x36')]=qs['sort'](_0x4ff42d['query'][_0x4816('0x37')]);_0x302869[_0x4816('0x38')]=qs['filters'](_[_0x4816('0x39')](_0x4ff42d[_0x4816('0x32')],_0x142e59[_0x4816('0x30')]));if(_0x4ff42d[_0x4816('0x32')]['filter']){_0x302869[_0x4816('0x38')]=_[_0x4816('0x3b')](_0x302869[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x302869['attributes'],function(_0x1380cb){var _0x43f064={};_0x43f064[_0x1380cb]={'$like':'%'+_0x4ff42d[_0x4816('0x32')][_0x4816('0x3a')]+'%'};return _0x43f064;})});}_0x302869=_[_0x4816('0x3b')]({},_0x302869,_0x4ff42d[_0x4816('0x3d')]);return _0x569c68[_0x4816('0x8e')](_0x302869);}})[_0x4816('0x22')](function(_0x42927b){if(_0x42927b){_0x39abca=_0x42927b['length'];if(!_0x4ff42d[_0x4816('0x32')]['hasOwnProperty'](_0x4816('0x56'))){_0x302869[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x4ff42d['query']['limit']);_0x302869[_0x4816('0x19')]=qs['offset'](_0x4ff42d[_0x4816('0x32')][_0x4816('0x19')]);}return _0x569c68['getBlackLists'](_0x302869);}})['then'](function(_0xc5da07){if(_0xc5da07){return _0xc5da07?{'count':_0x39abca,'rows':_0xc5da07}:null;}})[_0x4816('0x22')](respondWithResult(_0xf088f0,null))['catch'](handleError(_0xf088f0,null));};exports[_0x4816('0x8f')]=function(_0x459651,_0x4dea4a,_0x41edc0){var _0x245529,_0x2b3064;var _0x5868c2=[];var _0xe60317=moment()[_0x4816('0x62')](_0x4816('0x63'));return db['Campaign']['find']({'where':{'id':_0x459651[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x4dea4a,null))['then'](function(_0x37f7b1){if(_0x37f7b1){_0x2b3064=_0x37f7b1;return _0x37f7b1[_0x4816('0x8f')](_0x459651[_0x4816('0x45')][_0x4816('0x64')],_[_0x4816('0x65')](_0x459651['body'],['ids','id'])||{});}return null;})[_0x4816('0x66')](function(_0xbe4094){var _0xc84077;var _0x38caa3;_0x245529=_0xbe4094||[];var _0x2493fc=[];if(_0xbe4094){for(var _0x4529b9=0x0;_0x4529b9<_0xbe4094[_0x4816('0x35')];_0x4529b9+=0x1){var _0x2c1878=_0xbe4094[_0x4529b9][_0x4816('0x24')]({'plain':!![]});_0xc84077=squel[_0x4816('0x69')]()[_0x4816('0x7e')](_0x4816('0x90'))[_0x4816('0x6a')](['phone',_0x4816('0x6d'),_0x4816('0x6e'),_0x4816('0x57'),_0x4816('0x50'),_0x4816('0x51')],squel[_0x4816('0x6f')]()[_0x4816('0x70')](_0x4816('0x6b'),_0x4816('0x6b'))[_0x4816('0x70')]('id',_0x4816('0x6d'))[_0x4816('0x70')](_0x2c1878[_0x4816('0x72')][_0x4816('0x73')](),_0x4816('0x6e'))[_0x4816('0x70')](_0x459651[_0x4816('0x4f')]['id']['toString'](),_0x4816('0x57'))[_0x4816('0x70')](_0x4816('0x71'),_0x4816('0x50'))[_0x4816('0x70')](_0x4816('0x71'),_0x4816('0x51'))[_0x4816('0x74')](_0x4816('0x7f'))[_0x4816('0x38')](_0x4816('0x80'))[_0x4816('0x38')](_0x4816('0x75'),_0x2c1878[_0x4816('0x72')][_0x4816('0x73')]())[_0x4816('0x38')](_0x4816('0x76')))[_0x4816('0x73')]();_0x2493fc[_0x4816('0x8a')](db[_0x4816('0x8b')][_0x4816('0x32')](_0xc84077));}return BPromise[_0x4816('0x8c')](_0x2493fc);}})[_0x4816('0x22')](function(){return _0x245529;})[_0x4816('0x22')](respondWithResult(_0x4dea4a,null))[_0x4816('0x40')](handleError(_0x4dea4a,null));};exports['removeBlackLists']=function(_0x1993fc,_0x1e9a33,_0x39f84b){return db[_0x4816('0x2a')][_0x4816('0x4a')]({'where':{'id':_0x1993fc['params']['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x1e9a33,null))[_0x4816('0x22')](function(_0x10af49){if(_0x10af49){return _0x10af49[_0x4816('0x91')](_0x1993fc[_0x4816('0x32')]['ids']);}})[_0x4816('0x22')](function(_0x22bbf9){if(_0x22bbf9){return db[_0x4816('0x5e')][_0x4816('0x23')]({'where':{'ListId':_0x1993fc[_0x4816('0x32')][_0x4816('0x64')],'CampaignId':_0x1993fc['params']['id']}})[_0x4816('0x22')](function(){return _0x22bbf9;});}})[_0x4816('0x22')](respondWithStatusCode(_0x1e9a33,null))[_0x4816('0x40')](handleError(_0x1e9a33,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 6c120cf..0fdeaaf 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x10abf1,_0x5e3238){var _0xab622a=function(_0x3b7eed){while(--_0x3b7eed){_0x10abf1['push'](_0x10abf1['shift']());}};_0xab622a(++_0x5e3238);}(_0x7a54,0x106));var _0x47a5=function(_0x508de5,_0x4f7b81){_0x508de5=_0x508de5-0x0;var _0x11faa3=_0x7a54[_0x508de5];return _0x11faa3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x56996b,_0x4e2176){var _0x22327d=function(_0x276698){while(--_0x276698){_0x56996b['push'](_0x56996b['shift']());}};_0x22327d(++_0x4e2176);}(_0x7a54,0x106));var _0x47a5=function(_0x1f0433,_0x84fe75){_0x1f0433=_0x1f0433-0x0;var _0x11b469=_0x7a54[_0x1f0433];return _0x11b469;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index d5de3b6..ffc6ad3 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 _0x76dc=['error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x76dc,0x1f2));var _0xc76d=function(_0x386db2,_0x4992c2){_0x386db2=_0x386db2-0x0;var _0x15c61f=_0x76dc[_0x386db2];return _0x15c61f;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Campaign,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});}exports[_0xc76d('0x14')]=function(_0x339623){var _0x23f3ca=this;return new Promise(function(_0xd1d16f,_0x4b0402){return db[_0xc76d('0x15')][_0xc76d('0x16')]({'raw':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x18')]===undefined?!![]:![]:!![],'where':_0x339623['options']?_0x339623[_0xc76d('0x17')][_0xc76d('0x19')]||null:null,'attributes':_0x339623['options']?_0x339623[_0xc76d('0x17')][_0xc76d('0x1a')]||null:null,'limit':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x1b')]||null:null,'include':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x339623[_0xc76d('0x17')][_0xc76d('0x1c')],function(_0x5de11f){return{'model':db[_0x5de11f[_0xc76d('0x1e')]],'as':_0x5de11f['as'],'attributes':_0x5de11f[_0xc76d('0x1a')],'include':_0x5de11f['include']?_[_0xc76d('0x1d')](_0x5de11f[_0xc76d('0x1c')],function(_0x55ca79){return{'model':db[_0x55ca79[_0xc76d('0x1e')]],'as':_0x55ca79['as'],'attributes':_0x55ca79[_0xc76d('0x1a')],'include':_0x55ca79[_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x55ca79[_0xc76d('0x1c')],function(_0x1949c4){return{'model':db[_0x1949c4[_0xc76d('0x1e')]],'as':_0x1949c4['as'],'attributes':_0x1949c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x285430){logger[_0xc76d('0xa')]('GetCampaign',_0x339623);logger[_0xc76d('0x1f')](_0xc76d('0x14'),_0x339623,JSON[_0xc76d('0xd')](_0x285430));_0xd1d16f(_0x285430);})['catch'](function(_0x2039f4){logger['error'](_0xc76d('0x14'),_0x2039f4[_0xc76d('0x11')],_0x339623);_0x4b0402(_0x23f3ca['error'](0x1f4,_0x2039f4[_0xc76d('0x11')]));});});}; \ No newline at end of file +var _0xbb95=['catch','Campaign','options','raw','where','attributes','map','include','model','GetCampaign','stringify','lodash','util','randomstring','ioredis','../../config/utils','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x9f9201,_0x5dd1bb){var _0x3535ae=function(_0x1d1b50){while(--_0x1d1b50){_0x9f9201['push'](_0x9f9201['shift']());}};_0x3535ae(++_0x5dd1bb);}(_0xbb95,0x7f));var _0x5bb9=function(_0x165c96,_0x5069d0){_0x165c96=_0x165c96-0x0;var _0x588015=_0xbb95[_0x165c96];return _0x588015;};'use strict';var _=require(_0x5bb9('0x0'));var util=require(_0x5bb9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5bb9('0x2'));var fs=require('fs');var Redis=require(_0x5bb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb9('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5bb9('0x5'));var client=jayson[_0x5bb9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x180e69,_0x123a6a,_0x39f347){return new BPromise(function(_0x5e8b1c,_0x95777c){return client[_0x5bb9('0x7')](_0x180e69,_0x39f347)[_0x5bb9('0x8')](function(_0x267319){logger[_0x5bb9('0x9')](_0x5bb9('0xa'),_0x123a6a,_0x5bb9('0xb'));logger[_0x5bb9('0xc')](_0x5bb9('0xd'),_0x123a6a,_0x5bb9('0xb'),JSON['stringify'](_0x267319));if(_0x267319['error']){if(_0x267319[_0x5bb9('0xe')][_0x5bb9('0xf')]===0x1f4){logger[_0x5bb9('0xe')](_0x5bb9('0xa'),_0x123a6a,_0x267319[_0x5bb9('0xe')][_0x5bb9('0x10')]);return _0x95777c(_0x267319[_0x5bb9('0xe')]['message']);}logger['error'](_0x5bb9('0xa'),_0x123a6a,_0x267319[_0x5bb9('0xe')][_0x5bb9('0x10')]);return _0x5e8b1c(_0x267319['error'][_0x5bb9('0x10')]);}else{logger[_0x5bb9('0x9')]('Campaign,\x20%s,\x20%s',_0x123a6a,_0x5bb9('0xb'));_0x5e8b1c(_0x267319[_0x5bb9('0x11')][_0x5bb9('0x10')]);}})[_0x5bb9('0x12')](function(_0x119092){logger[_0x5bb9('0xe')](_0x5bb9('0xa'),_0x123a6a,_0x119092);_0x95777c(_0x119092);});});}exports['GetCampaign']=function(_0x16b7ab){var _0x56c337=this;return new Promise(function(_0xecb76c,_0x54dcd4){return db[_0x5bb9('0x13')]['findAll']({'raw':_0x16b7ab[_0x5bb9('0x14')]?_0x16b7ab[_0x5bb9('0x14')][_0x5bb9('0x15')]===undefined?!![]:![]:!![],'where':_0x16b7ab[_0x5bb9('0x14')]?_0x16b7ab[_0x5bb9('0x14')][_0x5bb9('0x16')]||null:null,'attributes':_0x16b7ab[_0x5bb9('0x14')]?_0x16b7ab[_0x5bb9('0x14')][_0x5bb9('0x17')]||null:null,'limit':_0x16b7ab['options']?_0x16b7ab[_0x5bb9('0x14')]['limit']||null:null,'include':_0x16b7ab[_0x5bb9('0x14')]?_0x16b7ab[_0x5bb9('0x14')]['include']?_[_0x5bb9('0x18')](_0x16b7ab[_0x5bb9('0x14')]['include'],function(_0x1fb206){return{'model':db[_0x1fb206['model']],'as':_0x1fb206['as'],'attributes':_0x1fb206[_0x5bb9('0x17')],'include':_0x1fb206['include']?_['map'](_0x1fb206[_0x5bb9('0x19')],function(_0x13a50d){return{'model':db[_0x13a50d[_0x5bb9('0x1a')]],'as':_0x13a50d['as'],'attributes':_0x13a50d[_0x5bb9('0x17')],'include':_0x13a50d[_0x5bb9('0x19')]?_[_0x5bb9('0x18')](_0x13a50d[_0x5bb9('0x19')],function(_0x4da56f){return{'model':db[_0x4da56f[_0x5bb9('0x1a')]],'as':_0x4da56f['as'],'attributes':_0x4da56f[_0x5bb9('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e9450){logger[_0x5bb9('0x9')](_0x5bb9('0x1b'),_0x16b7ab);logger['debug']('GetCampaign',_0x16b7ab,JSON[_0x5bb9('0x1c')](_0x1e9450));_0xecb76c(_0x1e9450);})[_0x5bb9('0x12')](function(_0x5d3ada){logger[_0x5bb9('0xe')](_0x5bb9('0x1b'),_0x5d3ada[_0x5bb9('0x10')],_0x16b7ab);_0x54dcd4(_0x56c337[_0x5bb9('0xe')](0x1f4,_0x5d3ada['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1a359a4..b53477a 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 _0xa711=['post','create','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','getBlackLists'];(function(_0x1651d5,_0x41f59f){var _0x22647d=function(_0x5d7e50){while(--_0x5d7e50){_0x1651d5['push'](_0x1651d5['shift']());}};_0x22647d(++_0x41f59f);}(_0xa711,0x6e));var _0x1a71=function(_0x56ffa2,_0x539043){_0x56ffa2=_0x56ffa2-0x0;var _0x1141b2=_0xa711[_0x56ffa2];return _0x1141b2;};'use strict';var multer=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var path=require('path');var timeout=require(_0x1a71('0x2'));var express=require(_0x1a71('0x3'));var router=express[_0x1a71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a71('0x5'));var interaction=require(_0x1a71('0x6'));var config=require(_0x1a71('0x7'));var controller=require(_0x1a71('0x8'));router['get']('/',auth[_0x1a71('0x9')](),controller['index']);router[_0x1a71('0xa')](_0x1a71('0xb'),auth[_0x1a71('0x9')](),controller['show']);router['get'](_0x1a71('0xc'),auth['isAuthenticated'](),controller[_0x1a71('0xd')]);router[_0x1a71('0xa')]('/:id/hopper_histories',auth[_0x1a71('0x9')](),controller[_0x1a71('0xe')]);router[_0x1a71('0xa')](_0x1a71('0xf'),auth[_0x1a71('0x9')](),controller['getHopperFinals']);router[_0x1a71('0xa')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x1a71('0x10')]);router[_0x1a71('0xa')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x1a71('0xa')]('/:id/blacklists',auth[_0x1a71('0x9')](),controller[_0x1a71('0x11')]);router[_0x1a71('0x12')]('/',auth[_0x1a71('0x9')](),controller[_0x1a71('0x13')]);router[_0x1a71('0x12')]('/:id/clone',auth['isAuthenticated'](),controller[_0x1a71('0x14')]);router[_0x1a71('0x12')](_0x1a71('0x15'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x16')]);router['post'](_0x1a71('0x17'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x18')]);router[_0x1a71('0x19')](_0x1a71('0xb'),auth['isAuthenticated'](),controller[_0x1a71('0x1a')]);router[_0x1a71('0x1b')](_0x1a71('0xb'),auth['isAuthenticated'](),controller[_0x1a71('0x1c')]);router[_0x1a71('0x1b')](_0x1a71('0x15'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x1d')]);router['delete']('/:id/blacklists',auth[_0x1a71('0x9')](),controller[_0x1a71('0x1e')]);module[_0x1a71('0x1f')]=router; \ No newline at end of file +var _0xbfc2=['clone','addLists','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','get','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/blacklists','getBlackLists','post','/:id/clone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfc2,0xcc));var _0x2bfc=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xbfc2[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require(_0x2bfc('0x0'));var path=require(_0x2bfc('0x1'));var timeout=require('connect-timeout');var express=require(_0x2bfc('0x2'));var router=express[_0x2bfc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2bfc('0x4'));var interaction=require(_0x2bfc('0x5'));var config=require(_0x2bfc('0x6'));var controller=require(_0x2bfc('0x7'));router['get']('/',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x9')]);router['get'](_0x2bfc('0xa'),auth[_0x2bfc('0x8')](),controller['show']);router[_0x2bfc('0xb')]('/:id/hoppers',auth[_0x2bfc('0x8')](),controller['getHoppers']);router[_0x2bfc('0xb')]('/:id/hopper_histories',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0xc')]);router[_0x2bfc('0xb')](_0x2bfc('0xd'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0xe')]);router['get'](_0x2bfc('0xf'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x2bfc('0xb')]('/:id/lists',auth[_0x2bfc('0x8')](),controller['getLists']);router[_0x2bfc('0xb')](_0x2bfc('0x10'),auth['isAuthenticated'](),controller[_0x2bfc('0x11')]);router[_0x2bfc('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2bfc('0x12')](_0x2bfc('0x13'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x14')]);router[_0x2bfc('0x12')]('/:id/lists',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x15')]);router['post'](_0x2bfc('0x10'),auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x2bfc('0xa'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x16')]);router[_0x2bfc('0x17')]('/:id',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x18')]);router['delete'](_0x2bfc('0x19'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x1a')]);router[_0x2bfc('0x17')](_0x2bfc('0x10'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f5868fb..a2cbcc3 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 _0x772a=['getDataValue','key','sequelize','exports','STRING','VIRTUAL'];(function(_0x11b9b1,_0x3cfc5b){var _0x4f2aa0=function(_0x219a1e){while(--_0x219a1e){_0x11b9b1['push'](_0x11b9b1['shift']());}};_0x4f2aa0(++_0x3cfc5b);}(_0x772a,0xf2));var _0xa772=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x772a[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xa772('0x0'));module[_0xa772('0x1')]={'key':{'type':Sequelize[_0xa772('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa772('0x3')],'get':function(){return this[_0xa772('0x4')](_0xa772('0x5'));}}}; \ No newline at end of file +var _0x64d7=['sequelize','exports','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x5de157,_0x36f3a8){var _0xaaffdf=function(_0x52fb53){while(--_0x52fb53){_0x5de157['push'](_0x5de157['shift']());}};_0xaaffdf(++_0x36f3a8);}(_0x64d7,0x90));var _0x764d=function(_0x5013f2,_0x3d896b){_0x5013f2=_0x5013f2-0x0;var _0x166b9f=_0x64d7[_0x5013f2];return _0x166b9f;};'use strict';var Sequelize=require(_0x764d('0x0'));module[_0x764d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x764d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x764d('0x3')]},'name':{'type':Sequelize[_0x764d('0x4')],'get':function(){return this[_0x764d('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 b8dbf36..689999d 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 _0xa98b=['intersection','attributes','fields','nolimit','order','where','pick','filter','options','includeAll','include','rows','catch','show','params','keys','length','merge','find','update','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x48b5f5,_0x31038f){var _0x2d84b7=function(_0x283ae4){while(--_0x283ae4){_0x48b5f5['push'](_0x48b5f5['shift']());}};_0x2d84b7(++_0x31038f);}(_0xa98b,0x184));var _0xba98=function(_0xff317f,_0x3b22e6){_0xff317f=_0xff317f-0x0;var _0x2e8007=_0xa98b[_0xff317f];return _0x2e8007;};'use strict';var emlformat=require(_0xba98('0x0'));var rimraf=require(_0xba98('0x1'));var zipdir=require(_0xba98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba98('0x3'));var moment=require(_0xba98('0x4'));var BPromise=require(_0xba98('0x5'));var Mustache=require(_0xba98('0x6'));var util=require(_0xba98('0x7'));var path=require(_0xba98('0x8'));var sox=require(_0xba98('0x9'));var csv=require(_0xba98('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba98('0xb'));var squel=require(_0xba98('0xc'));var crypto=require(_0xba98('0xd'));var jsforce=require(_0xba98('0xe'));var deskjs=require(_0xba98('0xf'));var toCsv=require(_0xba98('0xa'));var querystring=require(_0xba98('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xba98('0x11'));var as=require(_0xba98('0x12'));var hardwareService=require(_0xba98('0x13'));var logger=require(_0xba98('0x14'))(_0xba98('0x15'));var utils=require('../../config/utils');var config=require(_0xba98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xba98('0x17'))['db'];function respondWithStatusCode(_0x371172,_0x2e4343){_0x2e4343=_0x2e4343||0xcc;return function(_0x458b3a){if(_0x458b3a){return _0x371172[_0xba98('0x18')](_0x2e4343);}return _0x371172[_0xba98('0x19')](_0x2e4343)[_0xba98('0x1a')]();};}function respondWithResult(_0x2f2391,_0x3b0625){_0x3b0625=_0x3b0625||0xc8;return function(_0x48f949){if(_0x48f949){return _0x2f2391[_0xba98('0x19')](_0x3b0625)['json'](_0x48f949);}};}function respondWithFilteredResult(_0x12d684,_0x437c6d){return function(_0x5f43e3){if(_0x5f43e3){var _0x2b0e0d=typeof _0x437c6d[_0xba98('0x1b')]===_0xba98('0x1c')&&typeof _0x437c6d[_0xba98('0x1d')]===_0xba98('0x1c');var _0x5688d8=_0x5f43e3['count'];var _0x3cd62e=_0x2b0e0d?0x0:_0x437c6d[_0xba98('0x1b')];var _0x5bde10=_0x2b0e0d?_0x5f43e3[_0xba98('0x1e')]:_0x437c6d[_0xba98('0x1b')]+_0x437c6d[_0xba98('0x1d')];var _0x31ceaf;if(_0x5bde10>=_0x5688d8){_0x5bde10=_0x5688d8;_0x31ceaf=0xc8;}else{_0x31ceaf=0xce;}_0x12d684[_0xba98('0x19')](_0x31ceaf);return _0x12d684[_0xba98('0x1f')](_0xba98('0x20'),_0x3cd62e+'-'+_0x5bde10+'/'+_0x5688d8)[_0xba98('0x21')](_0x5f43e3);}return null;};}function patchUpdates(_0x489960){return function(_0x734699){try{jsonpatch[_0xba98('0x22')](_0x734699,_0x489960,!![]);}catch(_0x28c0c3){return BPromise['reject'](_0x28c0c3);}return _0x734699[_0xba98('0x23')]();};}function saveUpdates(_0x4c6ec0,_0x48aac9){return function(_0x18597b){if(_0x18597b){return _0x18597b['update'](_0x4c6ec0)[_0xba98('0x24')](function(_0x543c0a){return _0x543c0a;});}return null;};}function removeEntity(_0x1e0e0c,_0x49e458){return function(_0x180411){if(_0x180411){return _0x180411['destroy']()[_0xba98('0x24')](function(){var _0x3ddfdd=_0x180411['get']({'plain':!![]});var _0x4a35fd=_0xba98('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a35fd,'resourceId':_0x3ddfdd['id']}})[_0xba98('0x24')](function(){return _0x180411;});})[_0xba98('0x24')](function(){_0x1e0e0c[_0xba98('0x19')](0xcc)[_0xba98('0x1a')]();});}};}function handleEntityNotFound(_0x1a088d,_0x12d137){return function(_0x77ff27){if(!_0x77ff27){_0x1a088d[_0xba98('0x18')](0x194);}return _0x77ff27;};}function handleError(_0x5326d4,_0x377be8){_0x377be8=_0x377be8||0x1f4;return function(_0x64f749){logger[_0xba98('0x26')](_0x64f749[_0xba98('0x27')]);if(_0x64f749['name']){delete _0x64f749[_0xba98('0x28')];}_0x5326d4[_0xba98('0x19')](_0x377be8)[_0xba98('0x29')](_0x64f749);};}exports[_0xba98('0x2a')]=function(_0x17aefa,_0x527115){var _0x5f5af5={},_0x15dfab={},_0x3dc1c5={'count':0x0,'rows':[]};var _0x300a60=_[_0xba98('0x2b')](db[_0xba98('0x2c')][_0xba98('0x2d')],function(_0x37e757){return{'name':_0x37e757[_0xba98('0x2e')],'type':_0x37e757[_0xba98('0x2f')][_0xba98('0x30')]};});_0x15dfab[_0xba98('0x31')]=_['map'](_0x300a60,'name');_0x15dfab[_0xba98('0x32')]=_['keys'](_0x17aefa[_0xba98('0x32')]);_0x15dfab[_0xba98('0x33')]=_[_0xba98('0x34')](_0x15dfab['model'],_0x15dfab[_0xba98('0x32')]);_0x5f5af5[_0xba98('0x35')]=_[_0xba98('0x34')](_0x15dfab[_0xba98('0x31')],qs[_0xba98('0x36')](_0x17aefa[_0xba98('0x32')]['fields']));_0x5f5af5[_0xba98('0x35')]=_0x5f5af5[_0xba98('0x35')]['length']?_0x5f5af5['attributes']:_0x15dfab['model'];if(!_0x17aefa['query']['hasOwnProperty'](_0xba98('0x37'))){_0x5f5af5[_0xba98('0x1d')]=qs[_0xba98('0x1d')](_0x17aefa[_0xba98('0x32')]['limit']);_0x5f5af5[_0xba98('0x1b')]=qs[_0xba98('0x1b')](_0x17aefa[_0xba98('0x32')][_0xba98('0x1b')]);}_0x5f5af5[_0xba98('0x38')]=qs['sort'](_0x17aefa[_0xba98('0x32')]['sort']);_0x5f5af5[_0xba98('0x39')]=qs['filters'](_[_0xba98('0x3a')](_0x17aefa[_0xba98('0x32')],_0x15dfab[_0xba98('0x33')]),_0x300a60);if(_0x17aefa[_0xba98('0x32')]['filter']){_0x5f5af5['where']=_['merge'](_0x5f5af5[_0xba98('0x39')],{'$or':[{'key':{'$like':'%'+_0x17aefa[_0xba98('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x17aefa['query'][_0xba98('0x3b')]+'%'}}]});}_0x5f5af5=_['merge']({},_0x5f5af5,_0x17aefa[_0xba98('0x3c')]);var _0x25a9e8={'where':_0x5f5af5[_0xba98('0x39')]};return db[_0xba98('0x2c')][_0xba98('0x1e')](_0x25a9e8)[_0xba98('0x24')](function(_0x165e5a){_0x3dc1c5[_0xba98('0x1e')]=_0x165e5a;if(_0x17aefa[_0xba98('0x32')][_0xba98('0x3d')]){_0x5f5af5[_0xba98('0x3e')]=[{'all':!![]}];}return db[_0xba98('0x2c')]['findAll'](_0x5f5af5);})['then'](function(_0x194cb7){_0x3dc1c5[_0xba98('0x3f')]=_0x194cb7;return _0x3dc1c5;})['then'](respondWithFilteredResult(_0x527115,_0x5f5af5))[_0xba98('0x40')](handleError(_0x527115,null));};exports[_0xba98('0x41')]=function(_0x5d06f3,_0x574e36){var _0x300807={'raw':!![],'where':{'id':_0x5d06f3[_0xba98('0x42')]['id']}},_0x1e4ec5={};_0x1e4ec5['model']=_[_0xba98('0x43')](db['CannedAnswer'][_0xba98('0x2d')]);_0x1e4ec5['query']=_['keys'](_0x5d06f3[_0xba98('0x32')]);_0x1e4ec5[_0xba98('0x33')]=_[_0xba98('0x34')](_0x1e4ec5[_0xba98('0x31')],_0x1e4ec5['query']);_0x300807['attributes']=_[_0xba98('0x34')](_0x1e4ec5[_0xba98('0x31')],qs[_0xba98('0x36')](_0x5d06f3[_0xba98('0x32')][_0xba98('0x36')]));_0x300807[_0xba98('0x35')]=_0x300807[_0xba98('0x35')][_0xba98('0x44')]?_0x300807[_0xba98('0x35')]:_0x1e4ec5[_0xba98('0x31')];if(_0x5d06f3[_0xba98('0x32')]['includeAll']){_0x300807[_0xba98('0x3e')]=[{'all':!![]}];}_0x300807=_[_0xba98('0x45')]({},_0x300807,_0x5d06f3[_0xba98('0x3c')]);return db[_0xba98('0x2c')][_0xba98('0x46')](_0x300807)[_0xba98('0x24')](handleEntityNotFound(_0x574e36,null))[_0xba98('0x24')](respondWithResult(_0x574e36,null))[_0xba98('0x40')](handleError(_0x574e36,null));};exports[_0xba98('0x47')]=function(_0x958458,_0x1cfecb){if(_0x958458[_0xba98('0x48')]['id']){delete _0x958458[_0xba98('0x48')]['id'];}return db[_0xba98('0x2c')][_0xba98('0x46')]({'where':{'id':_0x958458['params']['id']}})['then'](handleEntityNotFound(_0x1cfecb,null))[_0xba98('0x24')](saveUpdates(_0x958458[_0xba98('0x48')],null))['then'](respondWithResult(_0x1cfecb,null))[_0xba98('0x40')](handleError(_0x1cfecb,null));};exports[_0xba98('0x49')]=function(_0x5e4616,_0x574327){return db['CannedAnswer'][_0xba98('0x46')]({'where':{'id':_0x5e4616[_0xba98('0x42')]['id']}})[_0xba98('0x24')](handleEntityNotFound(_0x574327,null))[_0xba98('0x24')](removeEntity(_0x574327,null))[_0xba98('0x40')](handleError(_0x574327,null));};exports[_0xba98('0x4a')]=function(_0xf2ba9a,_0x1cd4bc){var _0x1792f8={'key':_0xf2ba9a[_0xba98('0x48')][_0xba98('0x30')]};if(_0xf2ba9a[_0xba98('0x48')][_0xba98('0x4b')]){_0x1792f8[_0xba98('0x4b')]=_0xf2ba9a[_0xba98('0x48')]['MailAccountId'];}else if(_0xf2ba9a['body']['SmsAccountId']){_0x1792f8[_0xba98('0x4c')]=_0xf2ba9a[_0xba98('0x48')]['SmsAccountId'];}else if(_0xf2ba9a[_0xba98('0x48')][_0xba98('0x4d')]){_0x1792f8[_0xba98('0x4d')]=_0xf2ba9a[_0xba98('0x48')][_0xba98('0x4d')];}else if(_0xf2ba9a['body'][_0xba98('0x4e')]){_0x1792f8[_0xba98('0x4e')]=_0xf2ba9a['body']['ChatWebsiteId'];}return db['CannedAnswer'][_0xba98('0x46')]({'where':_0x1792f8})[_0xba98('0x24')](function(_0x43ee7f){if(_0x43ee7f){throw new db[(_0xba98('0x4f'))][(_0xba98('0x50'))](_0xba98('0x51'));}return db['CannedAnswer'][_0xba98('0x4a')](_0xf2ba9a[_0xba98('0x48')]);})['then'](function(_0x857f0b){var _0x53afc2=_0xf2ba9a[_0xba98('0x52')][_0xba98('0x53')]({'plain':!![]});if(!_0x53afc2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53afc2['role']===_0xba98('0x52')){var _0x26df38=_0x857f0b['get']({'plain':!![]});return db[_0xba98('0x54')][_0xba98('0x46')]({'where':{'name':_0xba98('0x25'),'userProfileId':_0x53afc2[_0xba98('0x55')]},'raw':!![]})[_0xba98('0x24')](function(_0x1ac0d0){if(_0x1ac0d0&&_0x1ac0d0[_0xba98('0x56')]===0x0){return db[_0xba98('0x57')]['create']({'name':_0x26df38[_0xba98('0x28')],'resourceId':_0x26df38['id'],'type':_0x1ac0d0[_0xba98('0x28')],'sectionId':_0x1ac0d0['id']},{})[_0xba98('0x24')](function(){return _0x857f0b;});}else{return _0x857f0b;}})['catch'](function(_0x119f60){logger[_0xba98('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x119f60);throw _0x119f60;});}return _0x857f0b;})['then'](respondWithResult(_0x1cd4bc,0xc9))['catch'](handleError(_0x1cd4bc,null));}; \ No newline at end of file +var _0x385e=['eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','catch','keys','includeAll','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xa9b067,_0x2047eb){var _0x492156=function(_0x32a056){while(--_0x32a056){_0xa9b067['push'](_0xa9b067['shift']());}};_0x492156(++_0x2047eb);}(_0x385e,0xb6));var _0xe385=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x385e[_0x4de9e8];return _0x4db0de;};'use strict';var emlformat=require(_0xe385('0x0'));var rimraf=require(_0xe385('0x1'));var zipdir=require(_0xe385('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe385('0x3'));var moment=require(_0xe385('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe385('0x5'));var util=require(_0xe385('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe385('0x7'));var ejs=require(_0xe385('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe385('0x9'));var squel=require('squel');var crypto=require(_0xe385('0xa'));var jsforce=require(_0xe385('0xb'));var deskjs=require(_0xe385('0xc'));var toCsv=require(_0xe385('0x7'));var querystring=require(_0xe385('0xd'));var Papa=require(_0xe385('0xe'));var Redis=require(_0xe385('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe385('0x10'));var as=require(_0xe385('0x11'));var hardwareService=require(_0xe385('0x12'));var logger=require(_0xe385('0x13'))(_0xe385('0x14'));var utils=require(_0xe385('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe385('0x16'));var db=require(_0xe385('0x17'))['db'];function respondWithStatusCode(_0x3d7a63,_0xf60663){_0xf60663=_0xf60663||0xcc;return function(_0x2ce9b5){if(_0x2ce9b5){return _0x3d7a63[_0xe385('0x18')](_0xf60663);}return _0x3d7a63[_0xe385('0x19')](_0xf60663)['end']();};}function respondWithResult(_0xdd111b,_0x1804d5){_0x1804d5=_0x1804d5||0xc8;return function(_0x3f799f){if(_0x3f799f){return _0xdd111b['status'](_0x1804d5)[_0xe385('0x1a')](_0x3f799f);}};}function respondWithFilteredResult(_0x2baadf,_0x3be169){return function(_0x161c62){if(_0x161c62){var _0x592e60=typeof _0x3be169['offset']===_0xe385('0x1b')&&typeof _0x3be169[_0xe385('0x1c')]===_0xe385('0x1b');var _0x47df86=_0x161c62[_0xe385('0x1d')];var _0x5e43ef=_0x592e60?0x0:_0x3be169[_0xe385('0x1e')];var _0x22eeac=_0x592e60?_0x161c62[_0xe385('0x1d')]:_0x3be169[_0xe385('0x1e')]+_0x3be169['limit'];var _0x561f62;if(_0x22eeac>=_0x47df86){_0x22eeac=_0x47df86;_0x561f62=0xc8;}else{_0x561f62=0xce;}_0x2baadf[_0xe385('0x19')](_0x561f62);return _0x2baadf[_0xe385('0x1f')](_0xe385('0x20'),_0x5e43ef+'-'+_0x22eeac+'/'+_0x47df86)[_0xe385('0x1a')](_0x161c62);}return null;};}function patchUpdates(_0x295d05){return function(_0x1b3d9f){try{jsonpatch[_0xe385('0x21')](_0x1b3d9f,_0x295d05,!![]);}catch(_0x11e2a2){return BPromise[_0xe385('0x22')](_0x11e2a2);}return _0x1b3d9f[_0xe385('0x23')]();};}function saveUpdates(_0x494d62,_0x3b9e7f){return function(_0x4e7d60){if(_0x4e7d60){return _0x4e7d60['update'](_0x494d62)[_0xe385('0x24')](function(_0x45971e){return _0x45971e;});}return null;};}function removeEntity(_0x89a8d,_0x477132){return function(_0x4dbbc6){if(_0x4dbbc6){return _0x4dbbc6[_0xe385('0x25')]()[_0xe385('0x24')](function(){var _0x352449=_0x4dbbc6[_0xe385('0x26')]({'plain':!![]});var _0x397906=_0xe385('0x27');return db[_0xe385('0x28')][_0xe385('0x25')]({'where':{'type':_0x397906,'resourceId':_0x352449['id']}})[_0xe385('0x24')](function(){return _0x4dbbc6;});})['then'](function(){_0x89a8d['status'](0xcc)[_0xe385('0x29')]();});}};}function handleEntityNotFound(_0xfc595d,_0x2fba8e){return function(_0x4adbab){if(!_0x4adbab){_0xfc595d['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x2eb934,_0x16aed2){_0x16aed2=_0x16aed2||0x1f4;return function(_0x2b75e5){logger[_0xe385('0x2a')](_0x2b75e5[_0xe385('0x2b')]);if(_0x2b75e5[_0xe385('0x2c')]){delete _0x2b75e5[_0xe385('0x2c')];}_0x2eb934[_0xe385('0x19')](_0x16aed2)[_0xe385('0x2d')](_0x2b75e5);};}exports[_0xe385('0x2e')]=function(_0x51fbc7,_0x2ebb5d){var _0x1e44f9={},_0x498580={},_0x59779d={'count':0x0,'rows':[]};var _0x27c59f=_[_0xe385('0x2f')](db[_0xe385('0x30')][_0xe385('0x31')],function(_0x4a5e07){return{'name':_0x4a5e07[_0xe385('0x32')],'type':_0x4a5e07[_0xe385('0x33')]['key']};});_0x498580[_0xe385('0x34')]=_[_0xe385('0x2f')](_0x27c59f,'name');_0x498580['query']=_['keys'](_0x51fbc7[_0xe385('0x35')]);_0x498580[_0xe385('0x36')]=_[_0xe385('0x37')](_0x498580[_0xe385('0x34')],_0x498580[_0xe385('0x35')]);_0x1e44f9[_0xe385('0x38')]=_[_0xe385('0x37')](_0x498580[_0xe385('0x34')],qs[_0xe385('0x39')](_0x51fbc7[_0xe385('0x35')][_0xe385('0x39')]));_0x1e44f9[_0xe385('0x38')]=_0x1e44f9[_0xe385('0x38')][_0xe385('0x3a')]?_0x1e44f9[_0xe385('0x38')]:_0x498580[_0xe385('0x34')];if(!_0x51fbc7[_0xe385('0x35')][_0xe385('0x3b')](_0xe385('0x3c'))){_0x1e44f9[_0xe385('0x1c')]=qs[_0xe385('0x1c')](_0x51fbc7[_0xe385('0x35')][_0xe385('0x1c')]);_0x1e44f9['offset']=qs[_0xe385('0x1e')](_0x51fbc7[_0xe385('0x35')][_0xe385('0x1e')]);}_0x1e44f9[_0xe385('0x3d')]=qs[_0xe385('0x3e')](_0x51fbc7[_0xe385('0x35')][_0xe385('0x3e')]);_0x1e44f9[_0xe385('0x3f')]=qs['filters'](_[_0xe385('0x40')](_0x51fbc7[_0xe385('0x35')],_0x498580['filters']),_0x27c59f);if(_0x51fbc7[_0xe385('0x35')]['filter']){_0x1e44f9['where']=_[_0xe385('0x41')](_0x1e44f9['where'],{'$or':[{'key':{'$like':'%'+_0x51fbc7[_0xe385('0x35')][_0xe385('0x42')]+'%'}},{'value':{'$like':'%'+_0x51fbc7['query'][_0xe385('0x42')]+'%'}}]});}_0x1e44f9=_[_0xe385('0x41')]({},_0x1e44f9,_0x51fbc7[_0xe385('0x43')]);var _0x5e3954={'where':_0x1e44f9[_0xe385('0x3f')]};return db['CannedAnswer'][_0xe385('0x1d')](_0x5e3954)[_0xe385('0x24')](function(_0x22677c){_0x59779d[_0xe385('0x1d')]=_0x22677c;if(_0x51fbc7['query']['includeAll']){_0x1e44f9[_0xe385('0x44')]=[{'all':!![]}];}return db[_0xe385('0x30')][_0xe385('0x45')](_0x1e44f9);})[_0xe385('0x24')](function(_0x4957ad){_0x59779d['rows']=_0x4957ad;return _0x59779d;})[_0xe385('0x24')](respondWithFilteredResult(_0x2ebb5d,_0x1e44f9))[_0xe385('0x46')](handleError(_0x2ebb5d,null));};exports['show']=function(_0x42e840,_0x30ef29){var _0x394499={'raw':!![],'where':{'id':_0x42e840['params']['id']}},_0x95ab6e={};_0x95ab6e[_0xe385('0x34')]=_[_0xe385('0x47')](db[_0xe385('0x30')][_0xe385('0x31')]);_0x95ab6e[_0xe385('0x35')]=_[_0xe385('0x47')](_0x42e840[_0xe385('0x35')]);_0x95ab6e[_0xe385('0x36')]=_['intersection'](_0x95ab6e[_0xe385('0x34')],_0x95ab6e[_0xe385('0x35')]);_0x394499['attributes']=_['intersection'](_0x95ab6e['model'],qs[_0xe385('0x39')](_0x42e840[_0xe385('0x35')][_0xe385('0x39')]));_0x394499[_0xe385('0x38')]=_0x394499[_0xe385('0x38')]['length']?_0x394499[_0xe385('0x38')]:_0x95ab6e[_0xe385('0x34')];if(_0x42e840[_0xe385('0x35')][_0xe385('0x48')]){_0x394499[_0xe385('0x44')]=[{'all':!![]}];}_0x394499=_[_0xe385('0x41')]({},_0x394499,_0x42e840[_0xe385('0x43')]);return db[_0xe385('0x30')][_0xe385('0x49')](_0x394499)['then'](handleEntityNotFound(_0x30ef29,null))['then'](respondWithResult(_0x30ef29,null))[_0xe385('0x46')](handleError(_0x30ef29,null));};exports[_0xe385('0x4a')]=function(_0x521b05,_0x935d25){if(_0x521b05[_0xe385('0x4b')]['id']){delete _0x521b05[_0xe385('0x4b')]['id'];}return db['CannedAnswer'][_0xe385('0x49')]({'where':{'id':_0x521b05['params']['id']}})['then'](handleEntityNotFound(_0x935d25,null))[_0xe385('0x24')](saveUpdates(_0x521b05[_0xe385('0x4b')],null))[_0xe385('0x24')](respondWithResult(_0x935d25,null))[_0xe385('0x46')](handleError(_0x935d25,null));};exports['destroy']=function(_0x59a1d7,_0x23f04e){return db['CannedAnswer']['find']({'where':{'id':_0x59a1d7[_0xe385('0x4c')]['id']}})[_0xe385('0x24')](handleEntityNotFound(_0x23f04e,null))[_0xe385('0x24')](removeEntity(_0x23f04e,null))[_0xe385('0x46')](handleError(_0x23f04e,null));};exports[_0xe385('0x4d')]=function(_0x30beee,_0x119393){var _0x4d9295={'key':_0x30beee[_0xe385('0x4b')]['key']};if(_0x30beee['body']['MailAccountId']){_0x4d9295['MailAccountId']=_0x30beee['body'][_0xe385('0x4e')];}else if(_0x30beee[_0xe385('0x4b')][_0xe385('0x4f')]){_0x4d9295['SmsAccountId']=_0x30beee[_0xe385('0x4b')][_0xe385('0x4f')];}else if(_0x30beee[_0xe385('0x4b')]['OpenchannelAccountId']){_0x4d9295[_0xe385('0x50')]=_0x30beee[_0xe385('0x4b')]['OpenchannelAccountId'];}else if(_0x30beee['body']['ChatWebsiteId']){_0x4d9295[_0xe385('0x51')]=_0x30beee[_0xe385('0x4b')][_0xe385('0x51')];}return db['CannedAnswer']['find']({'where':_0x4d9295})[_0xe385('0x24')](function(_0x5d3ee9){if(_0x5d3ee9){throw new db[(_0xe385('0x52'))][(_0xe385('0x53'))](_0xe385('0x54'));}return db['CannedAnswer']['create'](_0x30beee[_0xe385('0x4b')]);})[_0xe385('0x24')](function(_0x3bbad7){var _0xcab08c=_0x30beee[_0xe385('0x55')][_0xe385('0x26')]({'plain':!![]});if(!_0xcab08c)throw new Error(_0xe385('0x56'));if(_0xcab08c[_0xe385('0x57')]==='user'){var _0x3380ae=_0x3bbad7[_0xe385('0x26')]({'plain':!![]});return db[_0xe385('0x58')][_0xe385('0x49')]({'where':{'name':_0xe385('0x27'),'userProfileId':_0xcab08c[_0xe385('0x59')]},'raw':!![]})[_0xe385('0x24')](function(_0x5a267e){if(_0x5a267e&&_0x5a267e['autoAssociation']===0x0){return db[_0xe385('0x28')]['create']({'name':_0x3380ae[_0xe385('0x2c')],'resourceId':_0x3380ae['id'],'type':_0x5a267e['name'],'sectionId':_0x5a267e['id']},{})[_0xe385('0x24')](function(){return _0x3bbad7;});}else{return _0x3bbad7;}})[_0xe385('0x46')](function(_0x5109cf){logger[_0xe385('0x2a')](_0xe385('0x5a'),_0x5109cf);throw _0x5109cf;});}return _0x3bbad7;})[_0xe385('0x24')](respondWithResult(_0x119393,0xc9))[_0xe385('0x46')](handleError(_0x119393,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 2743e7b..41b333e 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 _0x54cf=['tools_canned_answers','utf8mb4_unicode_ci','lodash','api','moment','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer'];(function(_0x1069ce,_0x15f2a8){var _0x2ce8d6=function(_0x5f5d8b){while(--_0x5f5d8b){_0x1069ce['push'](_0x1069ce['shift']());}};_0x2ce8d6(++_0x15f2a8);}(_0x54cf,0xbd));var _0xf54c=function(_0x428f54,_0x1783db){_0x428f54=_0x428f54-0x0;var _0x201622=_0x54cf[_0x428f54];return _0x201622;};'use strict';var _=require(_0xf54c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf54c('0x1'));var moment=require(_0xf54c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf54c('0x3'));var rimraf=require(_0xf54c('0x4'));var config=require(_0xf54c('0x5'));var attributes=require(_0xf54c('0x6'));module[_0xf54c('0x7')]=function(_0x15f1dc,_0x5f2803){return _0x15f1dc['define'](_0xf54c('0x8'),attributes,{'tableName':_0xf54c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf54c('0xa')});}; \ No newline at end of file +var _0xb1fa=['moment','path','../../config/environment','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xb1fa,0x134));var _0xab1f=function(_0x2c0249,_0x5dc66f){_0x2c0249=_0x2c0249-0x0;var _0x33f831=_0xb1fa[_0x2c0249];return _0x33f831;};'use strict';var _=require(_0xab1f('0x0'));var util=require(_0xab1f('0x1'));var logger=require(_0xab1f('0x2'))(_0xab1f('0x3'));var moment=require(_0xab1f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab1f('0x5'));var rimraf=require('rimraf');var config=require(_0xab1f('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xab1f('0x7')]=function(_0x44796e,_0x42c4ad){return _0x44796e[_0xab1f('0x8')]('CannedAnswer',attributes,{'tableName':_0xab1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab1f('0xa'),'collate':_0xab1f('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 71c4d5f..c4a6b11 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x326568,_0x4b4882){var _0x56dca8=function(_0x510ec8){while(--_0x510ec8){_0x326568['push'](_0x326568['shift']());}};_0x56dca8(++_0x4b4882);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x22b747,_0x279404){var _0x2f4f91=function(_0x56d095){while(--_0x56d095){_0x22b747['push'](_0x22b747['shift']());}};_0x2f4f91(++_0x279404);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 2cb0746..ca71d93 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 _0x1ef4=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x3d687a,_0x43bb29){var _0x212213=function(_0x4cad73){while(--_0x4cad73){_0x3d687a['push'](_0x3d687a['shift']());}};_0x212213(++_0x43bb29);}(_0x1ef4,0x94));var _0x41ef=function(_0x45d417,_0x5ca073){_0x45d417=_0x45d417-0x0;var _0x58b698=_0x1ef4[_0x45d417];return _0x58b698;};'use strict';var multer=require(_0x41ef('0x0'));var util=require(_0x41ef('0x1'));var path=require(_0x41ef('0x2'));var timeout=require(_0x41ef('0x3'));var express=require('express');var router=express[_0x41ef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x41ef('0x5'));var config=require(_0x41ef('0x6'));var controller=require(_0x41ef('0x7'));router['get']('/',auth[_0x41ef('0x8')](),controller[_0x41ef('0x9')]);router[_0x41ef('0xa')](_0x41ef('0xb'),auth[_0x41ef('0x8')](),controller['show']);router[_0x41ef('0xc')]('/',auth['isAuthenticated'](),controller[_0x41ef('0xd')]);router['put'](_0x41ef('0xb'),auth[_0x41ef('0x8')](),controller[_0x41ef('0xe')]);router[_0x41ef('0xf')](_0x41ef('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x41ef('0x10')]=router; \ No newline at end of file +var _0x0dea=['create','put','/:id','update','destroy','exports','fs-extra','../../components/interaction/service','get','isAuthenticated','show','post'];(function(_0xddf13f,_0x235e11){var _0x3f8118=function(_0x563bdc){while(--_0x563bdc){_0xddf13f['push'](_0xddf13f['shift']());}};_0x3f8118(++_0x235e11);}(_0x0dea,0x1b6));var _0xa0de=function(_0xc831c6,_0x542b00){_0xc831c6=_0xc831c6-0x0;var _0x5063a7=_0x0dea[_0xc831c6];return _0x5063a7;};'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 fs_extra=require(_0xa0de('0x0'));var auth=require('../../components/auth/service');var interaction=require(_0xa0de('0x1'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xa0de('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0de('0x2')]('/:id',auth[_0xa0de('0x3')](),controller[_0xa0de('0x4')]);router[_0xa0de('0x5')]('/',auth[_0xa0de('0x3')](),controller[_0xa0de('0x6')]);router[_0xa0de('0x7')](_0xa0de('0x8'),auth[_0xa0de('0x3')](),controller[_0xa0de('0x9')]);router['delete'](_0xa0de('0x8'),auth['isAuthenticated'](),controller[_0xa0de('0xa')]);module[_0xa0de('0xb')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index c8744e5..b864369 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 _0x4522=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x9808b2,_0x53d925){var _0x56bd58=function(_0x544a75){while(--_0x544a75){_0x9808b2['push'](_0x9808b2['shift']());}};_0x56bd58(++_0x53d925);}(_0x4522,0x1a0));var _0x2452=function(_0x344451,_0x2eaddf){_0x344451=_0x344451-0x0;var _0x5d38b0=_0x4522[_0x344451];return _0x5d38b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x2452('0x0')],'allowNull':![],'defaultValue':_0x2452('0x1')},'clid':{'type':Sequelize[_0x2452('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2452('0x2')]},'dcontext':{'type':Sequelize[_0x2452('0x2')]},'channel':{'type':Sequelize[_0x2452('0x2')]},'dstchannel':{'type':Sequelize[_0x2452('0x2')]},'lastapp':{'type':Sequelize[_0x2452('0x2')]},'lastdata':{'type':Sequelize[_0x2452('0x2')]},'duration':{'type':Sequelize[_0x2452('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2452('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2452('0x2')]},'amaflags':{'type':Sequelize[_0x2452('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2452('0x2')]},'userfield':{'type':Sequelize[_0x2452('0x2')]},'uniqueid':{'type':Sequelize[_0x2452('0x2')]},'linkedid':{'type':Sequelize[_0x2452('0x2')]},'sequence':{'type':Sequelize[_0x2452('0x2')]},'peeraccount':{'type':Sequelize[_0x2452('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9879=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x25dc63,_0x2d45e8){var _0x7857c8=function(_0x2f9a5){while(--_0x2f9a5){_0x25dc63['push'](_0x25dc63['shift']());}};_0x7857c8(++_0x2d45e8);}(_0x9879,0x98));var _0x9987=function(_0x512a69,_0x490d50){_0x512a69=_0x512a69-0x0;var _0x3b795e=_0x9879[_0x512a69];return _0x3b795e;};'use strict';var Sequelize=require('sequelize');module[_0x9987('0x0')]={'calldate':{'type':Sequelize[_0x9987('0x1')],'allowNull':![],'defaultValue':_0x9987('0x2')},'clid':{'type':Sequelize[_0x9987('0x3')]},'src':{'type':Sequelize[_0x9987('0x3')]},'dst':{'type':Sequelize[_0x9987('0x3')]},'dcontext':{'type':Sequelize[_0x9987('0x3')]},'channel':{'type':Sequelize[_0x9987('0x3')]},'dstchannel':{'type':Sequelize[_0x9987('0x3')]},'lastapp':{'type':Sequelize[_0x9987('0x3')]},'lastdata':{'type':Sequelize[_0x9987('0x3')]},'duration':{'type':Sequelize[_0x9987('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9987('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9987('0x3')]},'amaflags':{'type':Sequelize[_0x9987('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9987('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x9987('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9987('0x3')]},'tag':{'type':Sequelize[_0x9987('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 6fc3023..489ec2c 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 _0xf8b2=['sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','Cdr','include','findAll','then','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy'];(function(_0x580409,_0x11a6e8){var _0x126a85=function(_0x1ff8a5){while(--_0x1ff8a5){_0x580409['push'](_0x580409['shift']());}};_0x126a85(++_0x11a6e8);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x2205c5,_0x27128c){_0x2205c5=_0x2205c5-0x0;var _0x18749c=_0xf8b2[_0x2205c5];return _0x18749c;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];function respondWithStatusCode(_0x175111,_0x4cb1e0){_0x4cb1e0=_0x4cb1e0||0xcc;return function(_0x16d5a2){if(_0x16d5a2){return _0x175111['sendStatus'](_0x4cb1e0);}return _0x175111[_0x2f8b('0x1b')](_0x4cb1e0)[_0x2f8b('0x1c')]();};}function respondWithResult(_0x1b6a17,_0x15634){_0x15634=_0x15634||0xc8;return function(_0xf9cbe0){if(_0xf9cbe0){return _0x1b6a17[_0x2f8b('0x1b')](_0x15634)[_0x2f8b('0x1d')](_0xf9cbe0);}};}function respondWithFilteredResult(_0x2b6003,_0x532fe4){return function(_0x14a248){if(_0x14a248){var _0xdec711=typeof _0x532fe4[_0x2f8b('0x1e')]===_0x2f8b('0x1f')&&typeof _0x532fe4[_0x2f8b('0x20')]===_0x2f8b('0x1f');var _0x3d65ee=_0x14a248[_0x2f8b('0x21')];var _0x35ec40=_0xdec711?0x0:_0x532fe4['offset'];var _0x23dd63=_0xdec711?_0x14a248[_0x2f8b('0x21')]:_0x532fe4[_0x2f8b('0x1e')]+_0x532fe4['limit'];var _0xdc8171;if(_0x23dd63>=_0x3d65ee){_0x23dd63=_0x3d65ee;_0xdc8171=0xc8;}else{_0xdc8171=0xce;}_0x2b6003['status'](_0xdc8171);return _0x2b6003[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x35ec40+'-'+_0x23dd63+'/'+_0x3d65ee)[_0x2f8b('0x1d')](_0x14a248);}return null;};}function patchUpdates(_0x26d78f){return function(_0x3be6dc){try{jsonpatch['apply'](_0x3be6dc,_0x26d78f,!![]);}catch(_0x29c2f3){return BPromise[_0x2f8b('0x24')](_0x29c2f3);}return _0x3be6dc[_0x2f8b('0x25')]();};}function saveUpdates(_0x17b251,_0x3ad38b){return function(_0x1ffbae){if(_0x1ffbae){return _0x1ffbae[_0x2f8b('0x26')](_0x17b251)['then'](function(_0x273950){return _0x273950;});}return null;};}function removeEntity(_0x23f73c,_0x3560c4){return function(_0x41e12b){if(_0x41e12b){return _0x41e12b[_0x2f8b('0x27')]()['then'](function(){_0x23f73c[_0x2f8b('0x1b')](0xcc)[_0x2f8b('0x1c')]();});}};}function handleEntityNotFound(_0x152492,_0x46a95a){return function(_0x183e51){if(!_0x183e51){_0x152492[_0x2f8b('0x28')](0x194);}return _0x183e51;};}function handleError(_0x45e313,_0x347f5a){_0x347f5a=_0x347f5a||0x1f4;return function(_0x4145b3){logger['error'](_0x4145b3[_0x2f8b('0x29')]);if(_0x4145b3['name']){delete _0x4145b3[_0x2f8b('0x2a')];}_0x45e313[_0x2f8b('0x1b')](_0x347f5a)[_0x2f8b('0x2b')](_0x4145b3);};}exports[_0x2f8b('0x2c')]=function(_0x72b23b,_0x4adacd){var _0x2cfbea={},_0x5cc78c={},_0x5207a8={'count':0x0,'rows':[]};var _0x194e75=_[_0x2f8b('0x2d')](db['Cdr'][_0x2f8b('0x2e')],function(_0x20d80c){return{'name':_0x20d80c[_0x2f8b('0x2f')],'type':_0x20d80c[_0x2f8b('0x30')][_0x2f8b('0x31')]};});_0x5cc78c[_0x2f8b('0x32')]=_['map'](_0x194e75,_0x2f8b('0x2a'));_0x5cc78c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0x72b23b[_0x2f8b('0x33')]);_0x5cc78c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x5cc78c[_0x2f8b('0x32')],_0x5cc78c['query']);_0x2cfbea[_0x2f8b('0x37')]=_['intersection'](_0x5cc78c[_0x2f8b('0x32')],qs[_0x2f8b('0x38')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x38')]));_0x2cfbea[_0x2f8b('0x37')]=_0x2cfbea[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x2cfbea[_0x2f8b('0x37')]:_0x5cc78c[_0x2f8b('0x32')];if(!_0x72b23b['query']['hasOwnProperty'](_0x2f8b('0x3a'))){_0x2cfbea[_0x2f8b('0x20')]=qs[_0x2f8b('0x20')](_0x72b23b[_0x2f8b('0x33')]['limit']);_0x2cfbea[_0x2f8b('0x1e')]=qs[_0x2f8b('0x1e')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x1e')]);}_0x2cfbea[_0x2f8b('0x3b')]=qs['sort'](_0x72b23b['query'][_0x2f8b('0x3c')]);_0x2cfbea[_0x2f8b('0x3d')]=qs[_0x2f8b('0x35')](_[_0x2f8b('0x3e')](_0x72b23b[_0x2f8b('0x33')],_0x5cc78c[_0x2f8b('0x35')]),_0x194e75);if(_0x72b23b[_0x2f8b('0x33')]['filter']){_0x2cfbea[_0x2f8b('0x3d')]=_[_0x2f8b('0x3f')](_0x2cfbea['where'],{'$or':_[_0x2f8b('0x2d')](_0x194e75,function(_0x4594b2){if(_0x4594b2[_0x2f8b('0x30')]!=='VIRTUAL'){var _0xa1d8de={};_0xa1d8de[_0x4594b2[_0x2f8b('0x2a')]]={'$like':'%'+_0x72b23b['query'][_0x2f8b('0x40')]+'%'};return _0xa1d8de;}})});}_0x2cfbea=_[_0x2f8b('0x3f')]({},_0x2cfbea,_0x72b23b['options']);var _0x92b37a={'where':_0x2cfbea['where']};return db[_0x2f8b('0x41')][_0x2f8b('0x21')](_0x92b37a)['then'](function(_0x9030da){_0x5207a8[_0x2f8b('0x21')]=_0x9030da;if(_0x72b23b[_0x2f8b('0x33')]['includeAll']){_0x2cfbea[_0x2f8b('0x42')]=[{'all':!![]}];}return db['Cdr'][_0x2f8b('0x43')](_0x2cfbea);})[_0x2f8b('0x44')](function(_0x1ff6e7){_0x5207a8[_0x2f8b('0x45')]=_0x1ff6e7;return _0x5207a8;})[_0x2f8b('0x44')](respondWithFilteredResult(_0x4adacd,_0x2cfbea))[_0x2f8b('0x46')](handleError(_0x4adacd,null));};exports[_0x2f8b('0x47')]=function(_0xa2fc94,_0x1c0b64){var _0x40577c={'raw':!![],'where':{'id':_0xa2fc94[_0x2f8b('0x48')]['id']}},_0x45c92c={};_0x45c92c[_0x2f8b('0x32')]=_[_0x2f8b('0x34')](db[_0x2f8b('0x41')][_0x2f8b('0x2e')]);_0x45c92c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0xa2fc94[_0x2f8b('0x33')]);_0x45c92c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x45c92c[_0x2f8b('0x32')],_0x45c92c[_0x2f8b('0x33')]);_0x40577c[_0x2f8b('0x37')]=_[_0x2f8b('0x36')](_0x45c92c['model'],qs['fields'](_0xa2fc94['query'][_0x2f8b('0x38')]));_0x40577c['attributes']=_0x40577c[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x40577c[_0x2f8b('0x37')]:_0x45c92c['model'];if(_0xa2fc94[_0x2f8b('0x33')]['includeAll']){_0x40577c[_0x2f8b('0x42')]=[{'all':!![]}];}_0x40577c=_['merge']({},_0x40577c,_0xa2fc94[_0x2f8b('0x49')]);return db[_0x2f8b('0x41')]['find'](_0x40577c)[_0x2f8b('0x44')](handleEntityNotFound(_0x1c0b64,null))[_0x2f8b('0x44')](respondWithResult(_0x1c0b64,null))[_0x2f8b('0x46')](handleError(_0x1c0b64,null));};exports[_0x2f8b('0x4a')]=function(_0x1e6ac2,_0x465d59){return db[_0x2f8b('0x41')][_0x2f8b('0x4a')](_0x1e6ac2[_0x2f8b('0x4b')],{})['then'](respondWithResult(_0x465d59,0xc9))[_0x2f8b('0x46')](handleError(_0x465d59,null));};exports[_0x2f8b('0x26')]=function(_0x2d79f9,_0x1bb257){if(_0x2d79f9[_0x2f8b('0x4b')]['id']){delete _0x2d79f9['body']['id'];}return db[_0x2f8b('0x41')][_0x2f8b('0x4c')]({'where':{'id':_0x2d79f9[_0x2f8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb257,null))[_0x2f8b('0x44')](saveUpdates(_0x2d79f9['body'],null))[_0x2f8b('0x44')](respondWithResult(_0x1bb257,null))[_0x2f8b('0x46')](handleError(_0x1bb257,null));};exports[_0x2f8b('0x27')]=function(_0x3a25bb,_0x17b855){return db['Cdr']['find']({'where':{'id':_0x3a25bb['params']['id']}})[_0x2f8b('0x44')](handleEntityNotFound(_0x17b855,null))[_0x2f8b('0x44')](removeEntity(_0x17b855,null))[_0x2f8b('0x46')](handleError(_0x17b855,null));};exports[_0x2f8b('0x4d')]=function(_0x49e047,_0x5ea07d){return db[_0x2f8b('0x41')][_0x2f8b('0x4d')]()[_0x2f8b('0x44')](respondWithResult(_0x5ea07d,null))[_0x2f8b('0x46')](handleError(_0x5ea07d,null));}; \ No newline at end of file +var _0x4ab0=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x57b010,_0x256404){var _0x39f337=function(_0x5120a8){while(--_0x5120a8){_0x57b010['push'](_0x57b010['shift']());}};_0x39f337(++_0x256404);}(_0x4ab0,0xd5));var _0x04ab=function(_0x155f93,_0x1246a6){_0x155f93=_0x155f93-0x0;var _0x48e96b=_0x4ab0[_0x155f93];return _0x48e96b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['index']=function(_0x404eae,_0x30db64){var _0x2e069d={},_0x3c25fb={},_0x12385b={'count':0x0,'rows':[]};var _0x5596fc=_['map'](db[_0x04ab('0x29')][_0x04ab('0x2a')],function(_0x28e77b){return{'name':_0x28e77b[_0x04ab('0x2b')],'type':_0x28e77b[_0x04ab('0x2c')][_0x04ab('0x2d')]};});_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x5596fc,_0x04ab('0x27'));_0x3c25fb[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x404eae[_0x04ab('0x30')]);_0x3c25fb[_0x04ab('0x32')]=_['intersection'](_0x3c25fb[_0x04ab('0x2e')],_0x3c25fb[_0x04ab('0x30')]);_0x2e069d['attributes']=_[_0x04ab('0x33')](_0x3c25fb[_0x04ab('0x2e')],qs['fields'](_0x404eae[_0x04ab('0x30')][_0x04ab('0x34')]));_0x2e069d['attributes']=_0x2e069d[_0x04ab('0x35')][_0x04ab('0x36')]?_0x2e069d[_0x04ab('0x35')]:_0x3c25fb[_0x04ab('0x2e')];if(!_0x404eae[_0x04ab('0x30')][_0x04ab('0x37')]('nolimit')){_0x2e069d[_0x04ab('0x1c')]=qs[_0x04ab('0x1c')](_0x404eae[_0x04ab('0x30')]['limit']);_0x2e069d[_0x04ab('0x1a')]=qs['offset'](_0x404eae['query'][_0x04ab('0x1a')]);}_0x2e069d[_0x04ab('0x38')]=qs['sort'](_0x404eae[_0x04ab('0x30')]['sort']);_0x2e069d[_0x04ab('0x39')]=qs[_0x04ab('0x32')](_[_0x04ab('0x3a')](_0x404eae[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x32')]),_0x5596fc);if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3b')]){_0x2e069d[_0x04ab('0x39')]=_[_0x04ab('0x3c')](_0x2e069d[_0x04ab('0x39')],{'$or':_[_0x04ab('0x2f')](_0x5596fc,function(_0x3f145){if(_0x3f145['type']!==_0x04ab('0x3d')){var _0x14756a={};_0x14756a[_0x3f145['name']]={'$like':'%'+_0x404eae['query'][_0x04ab('0x3b')]+'%'};return _0x14756a;}})});}_0x2e069d=_[_0x04ab('0x3c')]({},_0x2e069d,_0x404eae[_0x04ab('0x3e')]);var _0x4327b9={'where':_0x2e069d['where']};return db[_0x04ab('0x29')][_0x04ab('0x1d')](_0x4327b9)[_0x04ab('0x23')](function(_0x244acf){_0x12385b['count']=_0x244acf;if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x2e069d[_0x04ab('0x40')]=[{'all':!![]}];}return db[_0x04ab('0x29')][_0x04ab('0x41')](_0x2e069d);})[_0x04ab('0x23')](function(_0x20b8cc){_0x12385b[_0x04ab('0x42')]=_0x20b8cc;return _0x12385b;})['then'](respondWithFilteredResult(_0x30db64,_0x2e069d))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x43')]=function(_0x4c8cb0,_0x8a93c2){var _0x46a7c5={'raw':!![],'where':{'id':_0x4c8cb0['params']['id']}},_0x3c27ee={};_0x3c27ee[_0x04ab('0x2e')]=_[_0x04ab('0x31')](db[_0x04ab('0x29')]['rawAttributes']);_0x3c27ee[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x4c8cb0[_0x04ab('0x30')]);_0x3c27ee[_0x04ab('0x32')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],_0x3c27ee[_0x04ab('0x30')]);_0x46a7c5[_0x04ab('0x35')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],qs['fields'](_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x34')]));_0x46a7c5[_0x04ab('0x35')]=_0x46a7c5[_0x04ab('0x35')][_0x04ab('0x36')]?_0x46a7c5[_0x04ab('0x35')]:_0x3c27ee['model'];if(_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x46a7c5[_0x04ab('0x40')]=[{'all':!![]}];}_0x46a7c5=_[_0x04ab('0x3c')]({},_0x46a7c5,_0x4c8cb0['options']);return db[_0x04ab('0x29')][_0x04ab('0x44')](_0x46a7c5)[_0x04ab('0x23')](handleEntityNotFound(_0x8a93c2,null))[_0x04ab('0x23')](respondWithResult(_0x8a93c2,null))[_0x04ab('0x45')](handleError(_0x8a93c2,null));};exports['create']=function(_0x326621,_0x15b995){return db['Cdr']['create'](_0x326621[_0x04ab('0x46')],{})[_0x04ab('0x23')](respondWithResult(_0x15b995,0xc9))[_0x04ab('0x45')](handleError(_0x15b995,null));};exports[_0x04ab('0x47')]=function(_0x1c4aa2,_0x3a9056){if(_0x1c4aa2[_0x04ab('0x46')]['id']){delete _0x1c4aa2['body']['id'];}return db[_0x04ab('0x29')][_0x04ab('0x44')]({'where':{'id':_0x1c4aa2[_0x04ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9056,null))[_0x04ab('0x23')](saveUpdates(_0x1c4aa2[_0x04ab('0x46')],null))['then'](respondWithResult(_0x3a9056,null))[_0x04ab('0x45')](handleError(_0x3a9056,null));};exports['destroy']=function(_0xc9db25,_0x4bc4f6){return db[_0x04ab('0x29')]['find']({'where':{'id':_0xc9db25['params']['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x4bc4f6,null))[_0x04ab('0x23')](removeEntity(_0x4bc4f6,null))[_0x04ab('0x45')](handleError(_0x4bc4f6,null));};exports['describe']=function(_0x53f63a,_0x5ed30e){return db[_0x04ab('0x29')][_0x04ab('0x49')]()['then'](respondWithResult(_0x5ed30e,null))[_0x04ab('0x45')](handleError(_0x5ed30e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index f9a923b..cfa4d75 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2afb35,_0x2ecbc5){var _0x2e17d6=function(_0xd78c03){while(--_0xd78c03){_0x2afb35['push'](_0x2afb35['shift']());}};_0x2e17d6(++_0x2ecbc5);}(_0x7a54,0x106));var _0x47a5=function(_0x5da0a4,_0x184ee1){_0x5da0a4=_0x5da0a4-0x0;var _0x4073ea=_0x7a54[_0x5da0a4];return _0x4073ea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4573b1,_0x4fca4c){var _0x2bf46c=function(_0x24b715){while(--_0x24b715){_0x4573b1['push'](_0x4573b1['shift']());}};_0x2bf46c(++_0x4fca4c);}(_0x7a54,0x106));var _0x47a5=function(_0x2a2c84,_0x38aaf8){_0x2a2c84=_0x2a2c84-0x0;var _0x3ea7bb=_0x7a54[_0x2a2c84];return _0x3ea7bb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 0674f5f..aed0d3c 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 _0x9ae8=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result'];(function(_0x4488a2,_0x5c17b1){var _0x5e616e=function(_0x13bf39){while(--_0x13bf39){_0x4488a2['push'](_0x4488a2['shift']());}};_0x5e616e(++_0x5c17b1);}(_0x9ae8,0x139));var _0x89ae=function(_0x3b67fb,_0x2bc525){_0x3b67fb=_0x3b67fb-0x0;var _0x1d0b61=_0x9ae8[_0x3b67fb];return _0x1d0b61;};'use strict';var _=require('lodash');var util=require(_0x89ae('0x0'));var moment=require(_0x89ae('0x1'));var BPromise=require(_0x89ae('0x2'));var rs=require(_0x89ae('0x3'));var fs=require('fs');var Redis=require(_0x89ae('0x4'));var db=require(_0x89ae('0x5'))['db'];var utils=require(_0x89ae('0x6'));var logger=require(_0x89ae('0x7'))(_0x89ae('0x8'));var config=require(_0x89ae('0x9'));var jayson=require(_0x89ae('0xa'));var client=jayson[_0x89ae('0xb')][_0x89ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x499ba3,_0x297b69,_0x16c210){return new BPromise(function(_0x18b5ed,_0x3029ea){return client[_0x89ae('0xd')](_0x499ba3,_0x16c210)['then'](function(_0x46996c){logger[_0x89ae('0xe')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x89ae('0xf'));logger[_0x89ae('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x297b69,_0x89ae('0xf'),JSON[_0x89ae('0x11')](_0x46996c));if(_0x46996c[_0x89ae('0x12')]){if(_0x46996c[_0x89ae('0x12')][_0x89ae('0x13')]===0x1f4){logger[_0x89ae('0x12')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x46996c[_0x89ae('0x12')]['message']);return _0x3029ea(_0x46996c[_0x89ae('0x12')][_0x89ae('0x14')]);}logger[_0x89ae('0x12')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x46996c[_0x89ae('0x12')][_0x89ae('0x14')]);return _0x18b5ed(_0x46996c[_0x89ae('0x12')][_0x89ae('0x14')]);}else{logger[_0x89ae('0xe')](_0x89ae('0x15'),_0x297b69,_0x89ae('0xf'));_0x18b5ed(_0x46996c[_0x89ae('0x16')]['message']);}})[_0x89ae('0x17')](function(_0x5c4425){logger[_0x89ae('0x12')]('Cdr,\x20%s,\x20%s',_0x297b69,_0x5c4425);_0x3029ea(_0x5c4425);});});} \ No newline at end of file +var _0x93ac=['Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x93ac,0x183));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc93a('0x0'));var moment=require(_0xc93a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc93a('0x2'));var db=require(_0xc93a('0x3'))['db'];var utils=require(_0xc93a('0x4'));var logger=require(_0xc93a('0x5'))('rpc');var config=require(_0xc93a('0x6'));var jayson=require(_0xc93a('0x7'));var client=jayson[_0xc93a('0x8')][_0xc93a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d2df5,_0x107dc2,_0x41d29e){return new BPromise(function(_0x8fe8a0,_0xf12fd8){return client[_0xc93a('0xa')](_0x1d2df5,_0x41d29e)[_0xc93a('0xb')](function(_0xaa6f8){logger['info'](_0xc93a('0xc'),_0x107dc2,_0xc93a('0xd'));logger['debug'](_0xc93a('0xe'),_0x107dc2,_0xc93a('0xd'),JSON['stringify'](_0xaa6f8));if(_0xaa6f8[_0xc93a('0xf')]){if(_0xaa6f8[_0xc93a('0xf')][_0xc93a('0x10')]===0x1f4){logger[_0xc93a('0xf')](_0xc93a('0xc'),_0x107dc2,_0xaa6f8[_0xc93a('0xf')][_0xc93a('0x11')]);return _0xf12fd8(_0xaa6f8['error']['message']);}logger[_0xc93a('0xf')](_0xc93a('0xc'),_0x107dc2,_0xaa6f8[_0xc93a('0xf')]['message']);return _0x8fe8a0(_0xaa6f8[_0xc93a('0xf')][_0xc93a('0x11')]);}else{logger[_0xc93a('0x12')](_0xc93a('0xc'),_0x107dc2,'request\x20sent');_0x8fe8a0(_0xaa6f8[_0xc93a('0x13')]['message']);}})[_0xc93a('0x14')](function(_0x509d73){logger[_0xc93a('0xf')](_0xc93a('0xc'),_0x107dc2,_0x509d73);_0xf12fd8(_0x509d73);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 51d4825..5767930 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3766ad,_0x5f2ced){var _0x1d88ef=function(_0x59b17a){while(--_0x59b17a){_0x3766ad['push'](_0x3766ad['shift']());}};_0x1d88ef(++_0x5f2ced);}(_0xb10b,0x12a));var _0xbb10=function(_0xd8e9f5,_0x29df60){_0xd8e9f5=_0xd8e9f5-0x0;var _0x4b915e=_0xb10b[_0xd8e9f5];return _0x4b915e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x43e1e6,_0x399da){var _0x58753d=function(_0x260aba){while(--_0x260aba){_0x43e1e6['push'](_0x43e1e6['shift']());}};_0x58753d(++_0x399da);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 1312d4e..2652dc1 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 _0x9461=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0xc66117,_0x51370a){var _0x32cc75=function(_0x1c3321){while(--_0x1c3321){_0xc66117['push'](_0xc66117['shift']());}};_0x32cc75(++_0x51370a);}(_0x9461,0xaa));var _0x1946=function(_0xc8b494,_0x4be399){_0xc8b494=_0xc8b494-0x0;var _0xe8e653=_0x9461[_0xc8b494];return _0xe8e653;};'use strict';var Sequelize=require(_0x1946('0x0'));module[_0x1946('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1946('0x2')],'allowNull':![],'defaultValue':_0x1946('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1946('0x2')]},'interval':{'type':Sequelize[_0x1946('0x2')],'defaultValue':_0x1946('0x4')}}; \ No newline at end of file +var _0xa148=['STRING','noop','TEXT','exports','INTEGER'];(function(_0x1c9223,_0x31b0bf){var _0x42ab45=function(_0x5194e3){while(--_0x5194e3){_0x1c9223['push'](_0x1c9223['shift']());}};_0x42ab45(++_0x31b0bf);}(_0xa148,0x8f));var _0x8a14=function(_0x34b1bc,_0x3d07b0){_0x34b1bc=_0x34b1bc-0x0;var _0x18fcf4=_0xa148[_0x34b1bc];return _0x18fcf4;};'use strict';var Sequelize=require('sequelize');module[_0x8a14('0x0')]={'priority':{'type':Sequelize[_0x8a14('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8a14('0x2')],'allowNull':![],'defaultValue':_0x8a14('0x3')},'appdata':{'type':Sequelize[_0x8a14('0x4')]()},'description':{'type':Sequelize[_0x8a14('0x2')]},'interval':{'type':Sequelize[_0x8a14('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e46aa68..b637038 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 _0xc2e8=['length','include','merge','options','find','catch','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','offset','set','apply','save','update','destroy','then','error','stack','send','show','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes'];(function(_0x456b03,_0x142feb){var _0x4eec22=function(_0x330d26){while(--_0x330d26){_0x456b03['push'](_0x456b03['shift']());}};_0x4eec22(++_0x142feb);}(_0xc2e8,0x70));var _0x8c2e=function(_0x3ce089,_0x1a4890){_0x3ce089=_0x3ce089-0x0;var _0x35b89d=_0xc2e8[_0x3ce089];return _0x35b89d;};'use strict';var emlformat=require(_0x8c2e('0x0'));var rimraf=require(_0x8c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c2e('0x2'));var moment=require('moment');var BPromise=require(_0x8c2e('0x3'));var Mustache=require(_0x8c2e('0x4'));var util=require(_0x8c2e('0x5'));var path=require('path');var sox=require(_0x8c2e('0x6'));var csv=require(_0x8c2e('0x7'));var ejs=require(_0x8c2e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c2e('0x9'));var toCsv=require(_0x8c2e('0x7'));var querystring=require(_0x8c2e('0xa'));var Papa=require(_0x8c2e('0xb'));var Redis=require(_0x8c2e('0xc'));var authService=require(_0x8c2e('0xd'));var qs=require(_0x8c2e('0xe'));var as=require(_0x8c2e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c2e('0x10'))(_0x8c2e('0x11'));var utils=require(_0x8c2e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31067c,_0x364b18){_0x364b18=_0x364b18||0xcc;return function(_0x2952f4){if(_0x2952f4){return _0x31067c[_0x8c2e('0x13')](_0x364b18);}return _0x31067c[_0x8c2e('0x14')](_0x364b18)[_0x8c2e('0x15')]();};}function respondWithResult(_0x26abe0,_0x4f9398){_0x4f9398=_0x4f9398||0xc8;return function(_0x5bedbb){if(_0x5bedbb){return _0x26abe0[_0x8c2e('0x14')](_0x4f9398)[_0x8c2e('0x16')](_0x5bedbb);}};}function respondWithFilteredResult(_0x2095d4,_0x2787af){return function(_0x203b3a){if(_0x203b3a){var _0x3e5f16=typeof _0x2787af['offset']===_0x8c2e('0x17')&&typeof _0x2787af[_0x8c2e('0x18')]===_0x8c2e('0x17');var _0x160901=_0x203b3a['count'];var _0x944b34=_0x3e5f16?0x0:_0x2787af[_0x8c2e('0x19')];var _0x2e2e46=_0x3e5f16?_0x203b3a['count']:_0x2787af['offset']+_0x2787af[_0x8c2e('0x18')];var _0x56a325;if(_0x2e2e46>=_0x160901){_0x2e2e46=_0x160901;_0x56a325=0xc8;}else{_0x56a325=0xce;}_0x2095d4[_0x8c2e('0x14')](_0x56a325);return _0x2095d4[_0x8c2e('0x1a')]('Content-Range',_0x944b34+'-'+_0x2e2e46+'/'+_0x160901)[_0x8c2e('0x16')](_0x203b3a);}return null;};}function patchUpdates(_0x3b101e){return function(_0x3f98f0){try{jsonpatch[_0x8c2e('0x1b')](_0x3f98f0,_0x3b101e,!![]);}catch(_0x107f13){return BPromise['reject'](_0x107f13);}return _0x3f98f0[_0x8c2e('0x1c')]();};}function saveUpdates(_0x5baf2e,_0x4937b0){return function(_0x308dd9){if(_0x308dd9){return _0x308dd9[_0x8c2e('0x1d')](_0x5baf2e)['then'](function(_0x556e83){return _0x556e83;});}return null;};}function removeEntity(_0xfc60d2,_0x5a389d){return function(_0x350cc5){if(_0x350cc5){return _0x350cc5[_0x8c2e('0x1e')]()[_0x8c2e('0x1f')](function(){_0xfc60d2['status'](0xcc)[_0x8c2e('0x15')]();});}};}function handleEntityNotFound(_0x15d275,_0x2dfd48){return function(_0x389297){if(!_0x389297){_0x15d275['sendStatus'](0x194);}return _0x389297;};}function handleError(_0x3c5f22,_0x50f221){_0x50f221=_0x50f221||0x1f4;return function(_0x4e823d){logger[_0x8c2e('0x20')](_0x4e823d[_0x8c2e('0x21')]);if(_0x4e823d['name']){delete _0x4e823d['name'];}_0x3c5f22[_0x8c2e('0x14')](_0x50f221)[_0x8c2e('0x22')](_0x4e823d);};}exports[_0x8c2e('0x23')]=function(_0x46a69f,_0xf9b0d4){var _0x4696e3={'raw':!![],'where':{'id':_0x46a69f['params']['id']}},_0x39a9bc={};_0x39a9bc['model']=_['keys'](db[_0x8c2e('0x24')][_0x8c2e('0x25')]);_0x39a9bc[_0x8c2e('0x26')]=_['keys'](_0x46a69f[_0x8c2e('0x26')]);_0x39a9bc[_0x8c2e('0x27')]=_[_0x8c2e('0x28')](_0x39a9bc[_0x8c2e('0x29')],_0x39a9bc[_0x8c2e('0x26')]);_0x4696e3['attributes']=_[_0x8c2e('0x28')](_0x39a9bc[_0x8c2e('0x29')],qs['fields'](_0x46a69f[_0x8c2e('0x26')][_0x8c2e('0x2a')]));_0x4696e3[_0x8c2e('0x2b')]=_0x4696e3[_0x8c2e('0x2b')][_0x8c2e('0x2c')]?_0x4696e3[_0x8c2e('0x2b')]:_0x39a9bc[_0x8c2e('0x29')];if(_0x46a69f[_0x8c2e('0x26')]['includeAll']){_0x4696e3[_0x8c2e('0x2d')]=[{'all':!![]}];}_0x4696e3=_[_0x8c2e('0x2e')]({},_0x4696e3,_0x46a69f[_0x8c2e('0x2f')]);return db[_0x8c2e('0x24')][_0x8c2e('0x30')](_0x4696e3)[_0x8c2e('0x1f')](handleEntityNotFound(_0xf9b0d4,null))[_0x8c2e('0x1f')](respondWithResult(_0xf9b0d4,null))[_0x8c2e('0x31')](handleError(_0xf9b0d4,null));};exports[_0x8c2e('0x1d')]=function(_0x570fe3,_0x252346){if(_0x570fe3[_0x8c2e('0x32')]['id']){delete _0x570fe3[_0x8c2e('0x32')]['id'];}return db[_0x8c2e('0x24')][_0x8c2e('0x30')]({'where':{'id':_0x570fe3['params']['id']}})['then'](handleEntityNotFound(_0x252346,null))[_0x8c2e('0x1f')](saveUpdates(_0x570fe3[_0x8c2e('0x32')],null))[_0x8c2e('0x1f')](respondWithResult(_0x252346,null))[_0x8c2e('0x31')](handleError(_0x252346,null));};exports[_0x8c2e('0x1e')]=function(_0x31c677,_0x3877a9){return db['ChatApplication']['find']({'where':{'id':_0x31c677[_0x8c2e('0x33')]['id']}})[_0x8c2e('0x1f')](handleEntityNotFound(_0x3877a9,null))[_0x8c2e('0x1f')](removeEntity(_0x3877a9,null))[_0x8c2e('0x31')](handleError(_0x3877a9,null));}; \ No newline at end of file +var _0x777d=['params','model','keys','ChatApplication','rawAttributes','intersection','query','attributes','fields','length','includeAll','include','merge','options','find','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','update','then','destroy','error','name','send','show'];(function(_0x27a611,_0xe00621){var _0x39c5de=function(_0x1bdcfc){while(--_0x1bdcfc){_0x27a611['push'](_0x27a611['shift']());}};_0x39c5de(++_0xe00621);}(_0x777d,0xe9));var _0xd777=function(_0x4dae00,_0x15b194){_0x4dae00=_0x4dae00-0x0;var _0x16bf42=_0x777d[_0x4dae00];return _0x16bf42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd777('0x0'));var zipdir=require(_0xd777('0x1'));var jsonpatch=require(_0xd777('0x2'));var rp=require('request-promise');var moment=require(_0xd777('0x3'));var BPromise=require(_0xd777('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd777('0x5'));var csv=require('to-csv');var ejs=require(_0xd777('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd777('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd777('0x8'));var toCsv=require(_0xd777('0x9'));var querystring=require(_0xd777('0xa'));var Papa=require(_0xd777('0xb'));var Redis=require(_0xd777('0xc'));var authService=require(_0xd777('0xd'));var qs=require(_0xd777('0xe'));var as=require(_0xd777('0xf'));var hardwareService=require(_0xd777('0x10'));var logger=require(_0xd777('0x11'))(_0xd777('0x12'));var utils=require(_0xd777('0x13'));var config=require(_0xd777('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f574,_0x560778){_0x560778=_0x560778||0xcc;return function(_0x2cc3e7){if(_0x2cc3e7){return _0x25f574[_0xd777('0x15')](_0x560778);}return _0x25f574[_0xd777('0x16')](_0x560778)[_0xd777('0x17')]();};}function respondWithResult(_0x2ac82f,_0x5d0ded){_0x5d0ded=_0x5d0ded||0xc8;return function(_0x84141c){if(_0x84141c){return _0x2ac82f['status'](_0x5d0ded)[_0xd777('0x18')](_0x84141c);}};}function respondWithFilteredResult(_0x2cd014,_0x1e5ecb){return function(_0x1ef016){if(_0x1ef016){var _0x25e3f2=typeof _0x1e5ecb['offset']===_0xd777('0x19')&&typeof _0x1e5ecb['limit']===_0xd777('0x19');var _0x4dcaed=_0x1ef016[_0xd777('0x1a')];var _0x386f1a=_0x25e3f2?0x0:_0x1e5ecb[_0xd777('0x1b')];var _0x13b63b=_0x25e3f2?_0x1ef016[_0xd777('0x1a')]:_0x1e5ecb[_0xd777('0x1b')]+_0x1e5ecb['limit'];var _0x4d6100;if(_0x13b63b>=_0x4dcaed){_0x13b63b=_0x4dcaed;_0x4d6100=0xc8;}else{_0x4d6100=0xce;}_0x2cd014[_0xd777('0x16')](_0x4d6100);return _0x2cd014['set'](_0xd777('0x1c'),_0x386f1a+'-'+_0x13b63b+'/'+_0x4dcaed)['json'](_0x1ef016);}return null;};}function patchUpdates(_0x58a079){return function(_0x5b2204){try{jsonpatch[_0xd777('0x1d')](_0x5b2204,_0x58a079,!![]);}catch(_0x4e53ed){return BPromise['reject'](_0x4e53ed);}return _0x5b2204['save']();};}function saveUpdates(_0x48d18c,_0x55b975){return function(_0x8cfb5a){if(_0x8cfb5a){return _0x8cfb5a[_0xd777('0x1e')](_0x48d18c)[_0xd777('0x1f')](function(_0x343405){return _0x343405;});}return null;};}function removeEntity(_0xfebc2f,_0x33c3d4){return function(_0x2ff8d3){if(_0x2ff8d3){return _0x2ff8d3[_0xd777('0x20')]()[_0xd777('0x1f')](function(){_0xfebc2f[_0xd777('0x16')](0xcc)[_0xd777('0x17')]();});}};}function handleEntityNotFound(_0x56af61,_0x373646){return function(_0x63e5c1){if(!_0x63e5c1){_0x56af61[_0xd777('0x15')](0x194);}return _0x63e5c1;};}function handleError(_0x15f1fd,_0x184ff6){_0x184ff6=_0x184ff6||0x1f4;return function(_0x5e32de){logger[_0xd777('0x21')](_0x5e32de['stack']);if(_0x5e32de['name']){delete _0x5e32de[_0xd777('0x22')];}_0x15f1fd[_0xd777('0x16')](_0x184ff6)[_0xd777('0x23')](_0x5e32de);};}exports[_0xd777('0x24')]=function(_0x4c941c,_0x453b45){var _0x141baa={'raw':!![],'where':{'id':_0x4c941c[_0xd777('0x25')]['id']}},_0x4f93eb={};_0x4f93eb[_0xd777('0x26')]=_[_0xd777('0x27')](db[_0xd777('0x28')][_0xd777('0x29')]);_0x4f93eb['query']=_[_0xd777('0x27')](_0x4c941c['query']);_0x4f93eb['filters']=_[_0xd777('0x2a')](_0x4f93eb[_0xd777('0x26')],_0x4f93eb[_0xd777('0x2b')]);_0x141baa[_0xd777('0x2c')]=_['intersection'](_0x4f93eb['model'],qs[_0xd777('0x2d')](_0x4c941c[_0xd777('0x2b')][_0xd777('0x2d')]));_0x141baa[_0xd777('0x2c')]=_0x141baa[_0xd777('0x2c')][_0xd777('0x2e')]?_0x141baa['attributes']:_0x4f93eb['model'];if(_0x4c941c[_0xd777('0x2b')][_0xd777('0x2f')]){_0x141baa[_0xd777('0x30')]=[{'all':!![]}];}_0x141baa=_[_0xd777('0x31')]({},_0x141baa,_0x4c941c[_0xd777('0x32')]);return db[_0xd777('0x28')][_0xd777('0x33')](_0x141baa)[_0xd777('0x1f')](handleEntityNotFound(_0x453b45,null))['then'](respondWithResult(_0x453b45,null))['catch'](handleError(_0x453b45,null));};exports[_0xd777('0x1e')]=function(_0x4e131a,_0xa286fd){if(_0x4e131a[_0xd777('0x34')]['id']){delete _0x4e131a[_0xd777('0x34')]['id'];}return db[_0xd777('0x28')]['find']({'where':{'id':_0x4e131a[_0xd777('0x25')]['id']}})['then'](handleEntityNotFound(_0xa286fd,null))[_0xd777('0x1f')](saveUpdates(_0x4e131a['body'],null))['then'](respondWithResult(_0xa286fd,null))['catch'](handleError(_0xa286fd,null));};exports['destroy']=function(_0x3503ca,_0x3cd5f3){return db[_0xd777('0x28')]['find']({'where':{'id':_0x3503ca['params']['id']}})['then'](handleEntityNotFound(_0x3cd5f3,null))[_0xd777('0x1f')](removeEntity(_0x3cd5f3,null))[_0xd777('0x35')](handleError(_0x3cd5f3,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4ec160e..113adc1 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 _0x69dd=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x38cab0,_0x1995f2){var _0x2fbf28=function(_0x53e2e3){while(--_0x53e2e3){_0x38cab0['push'](_0x38cab0['shift']());}};_0x2fbf28(++_0x1995f2);}(_0x69dd,0x117));var _0xd69d=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x69dd[_0x4c1ec2];return _0x3f6f1c;};'use strict';var _=require(_0xd69d('0x0'));var util=require('util');var logger=require(_0xd69d('0x1'))(_0xd69d('0x2'));var moment=require(_0xd69d('0x3'));var BPromise=require(_0xd69d('0x4'));var rp=require(_0xd69d('0x5'));var fs=require('fs');var path=require(_0xd69d('0x6'));var rimraf=require(_0xd69d('0x7'));var config=require(_0xd69d('0x8'));var attributes=require(_0xd69d('0x9'));module[_0xd69d('0xa')]=function(_0x59429a,_0x231e00){return _0x59429a[_0xd69d('0xb')](_0xd69d('0xc'),attributes,{'tableName':_0xd69d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd69d('0xe'),'collate':_0xd69d('0xf')});}; \ No newline at end of file +var _0xd2ce=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','./chatApplication.attributes','define','ChatApplication','utf8mb4'];(function(_0x414394,_0x58373e){var _0x2e3930=function(_0x17ea1b){while(--_0x17ea1b){_0x414394['push'](_0x414394['shift']());}};_0x2e3930(++_0x58373e);}(_0xd2ce,0x151));var _0xed2c=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xd2ce[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xed2c('0x0'));var util=require(_0xed2c('0x1'));var logger=require(_0xed2c('0x2'))(_0xed2c('0x3'));var moment=require(_0xed2c('0x4'));var BPromise=require(_0xed2c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed2c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed2c('0x7'));module['exports']=function(_0x4d7281,_0x35709e){return _0x4d7281[_0xed2c('0x8')](_0xed2c('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed2c('0xa'),'collate':_0xed2c('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index e6b2539..b9c41ac 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 _0xf4d0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0xf4d0,0x10c));var _0x0f4d=function(_0x18ca67,_0x2cf142){_0x18ca67=_0x18ca67-0x0;var _0x356779=_0xf4d0[_0x18ca67];return _0x356779;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f4d('0x0'));var BPromise=require(_0x0f4d('0x1'));var rs=require(_0x0f4d('0x2'));var fs=require('fs');var Redis=require(_0x0f4d('0x3'));var db=require(_0x0f4d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f4d('0x5'))(_0x0f4d('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f4d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x90c944,_0x6185db,_0x2ffa19){return new BPromise(function(_0x13995f,_0x192111){return client[_0x0f4d('0x8')](_0x90c944,_0x2ffa19)['then'](function(_0x2a81ff){logger[_0x0f4d('0x9')](_0x0f4d('0xa'),_0x6185db,_0x0f4d('0xb'));logger[_0x0f4d('0xc')](_0x0f4d('0xd'),_0x6185db,_0x0f4d('0xb'),JSON['stringify'](_0x2a81ff));if(_0x2a81ff[_0x0f4d('0xe')]){if(_0x2a81ff['error'][_0x0f4d('0xf')]===0x1f4){logger[_0x0f4d('0xe')](_0x0f4d('0xa'),_0x6185db,_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);return _0x192111(_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);}logger['error'](_0x0f4d('0xa'),_0x6185db,_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);return _0x13995f(_0x2a81ff[_0x0f4d('0xe')][_0x0f4d('0x10')]);}else{logger[_0x0f4d('0x9')]('ChatApplication,\x20%s,\x20%s',_0x6185db,_0x0f4d('0xb'));_0x13995f(_0x2a81ff['result']['message']);}})[_0x0f4d('0x11')](function(_0x3b7ab9){logger['error'](_0x0f4d('0xa'),_0x6185db,_0x3b7ab9);_0x192111(_0x3b7ab9);});});} \ No newline at end of file +var _0x8270=['then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','request'];(function(_0x4cf4b9,_0x555ebf){var _0x13805d=function(_0x142552){while(--_0x142552){_0x4cf4b9['push'](_0x4cf4b9['shift']());}};_0x13805d(++_0x555ebf);}(_0x8270,0xa2));var _0x0827=function(_0x4733f4,_0xc599be){_0x4733f4=_0x4733f4-0x0;var _0x4c6a68=_0x8270[_0x4733f4];return _0x4c6a68;};'use strict';var _=require(_0x0827('0x0'));var util=require(_0x0827('0x1'));var moment=require('moment');var BPromise=require(_0x0827('0x2'));var rs=require(_0x0827('0x3'));var fs=require('fs');var Redis=require(_0x0827('0x4'));var db=require(_0x0827('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0827('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0827('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54a029,_0x77f116,_0x286c7d){return new BPromise(function(_0x3befb9,_0x5933ae){return client[_0x0827('0x8')](_0x54a029,_0x286c7d)[_0x0827('0x9')](function(_0x204e94){logger['info'](_0x0827('0xa'),_0x77f116,_0x0827('0xb'));logger['debug'](_0x0827('0xc'),_0x77f116,_0x0827('0xb'),JSON[_0x0827('0xd')](_0x204e94));if(_0x204e94['error']){if(_0x204e94['error'][_0x0827('0xe')]===0x1f4){logger[_0x0827('0xf')]('ChatApplication,\x20%s,\x20%s',_0x77f116,_0x204e94[_0x0827('0xf')][_0x0827('0x10')]);return _0x5933ae(_0x204e94[_0x0827('0xf')][_0x0827('0x10')]);}logger[_0x0827('0xf')](_0x0827('0xa'),_0x77f116,_0x204e94[_0x0827('0xf')][_0x0827('0x10')]);return _0x3befb9(_0x204e94[_0x0827('0xf')][_0x0827('0x10')]);}else{logger[_0x0827('0x11')]('ChatApplication,\x20%s,\x20%s',_0x77f116,_0x0827('0xb'));_0x3befb9(_0x204e94['result'][_0x0827('0x10')]);}})[_0x0827('0x12')](function(_0x121c40){logger[_0x0827('0xf')](_0x0827('0xa'),_0x77f116,_0x121c40);_0x5933ae(_0x121c40);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 8b6dc32..7a13cf8 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 _0xc109=['/:id','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','isAuthenticated'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc109,0xeb));var _0x9c10=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xc109[_0x145b3c];return _0x1b6e36;};'use strict';var multer=require('multer');var util=require(_0x9c10('0x0'));var path=require('path');var timeout=require(_0x9c10('0x1'));var express=require(_0x9c10('0x2'));var router=express[_0x9c10('0x3')]();var fs_extra=require(_0x9c10('0x4'));var auth=require(_0x9c10('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c10('0x6'));router['get']('/:id',auth[_0x9c10('0x7')](),controller['show']);router['put'](_0x9c10('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9c10('0x8'),auth[_0x9c10('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xba78=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba78,0xc3));var _0x8ba7=function(_0x2eeaae,_0x23682c){_0x2eeaae=_0x2eeaae-0x0;var _0x316fa8=_0xba78[_0x2eeaae];return _0x316fa8;};'use strict';var multer=require(_0x8ba7('0x0'));var util=require(_0x8ba7('0x1'));var path=require(_0x8ba7('0x2'));var timeout=require(_0x8ba7('0x3'));var express=require(_0x8ba7('0x4'));var router=express[_0x8ba7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8ba7('0x6'));var config=require(_0x8ba7('0x7'));var controller=require(_0x8ba7('0x8'));router[_0x8ba7('0x9')](_0x8ba7('0xa'),auth['isAuthenticated'](),controller[_0x8ba7('0xb')]);router[_0x8ba7('0xc')]('/:id',auth[_0x8ba7('0xd')](),controller[_0x8ba7('0xe')]);router[_0x8ba7('0xf')]('/:id',auth[_0x8ba7('0xd')](),controller[_0x8ba7('0x10')]);module[_0x8ba7('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 8210d7a..36e9b00 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 _0x5707=['sequelize','exports','STRING','BOOLEAN'];(function(_0x6a0348,_0x4e52f1){var _0x319d9e=function(_0x4ce599){while(--_0x4ce599){_0x6a0348['push'](_0x6a0348['shift']());}};_0x319d9e(++_0x4e52f1);}(_0x5707,0x134));var _0x7570=function(_0x210b46,_0x52a05f){_0x210b46=_0x210b46-0x0;var _0x203df2=_0x5707[_0x210b46];return _0x203df2;};'use strict';var Sequelize=require(_0x7570('0x0'));module[_0x7570('0x1')]={'name':{'type':Sequelize[_0x7570('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7570('0x2')]},'write':{'type':Sequelize[_0x7570('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5484=['BOOLEAN','sequelize','exports','STRING'];(function(_0x55de81,_0x1ebe60){var _0x21d6e6=function(_0x426ff7){while(--_0x426ff7){_0x55de81['push'](_0x55de81['shift']());}};_0x21d6e6(++_0x1ebe60);}(_0x5484,0x145));var _0x4548=function(_0xab8fdf,_0x3c90ae){_0xab8fdf=_0xab8fdf-0x0;var _0x41573a=_0x5484[_0xab8fdf];return _0x41573a;};'use strict';var Sequelize=require(_0x4548('0x0'));module[_0x4548('0x1')]={'name':{'type':Sequelize[_0x4548('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4548('0x2')]},'write':{'type':Sequelize[_0x4548('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 cc50b5f..d3cb32b 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 _0x7b67=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','rimraf','fast-json-patch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b67,0x11d));var _0x77b6=function(_0x628cd5,_0x1082c7){_0x628cd5=_0x628cd5-0x0;var _0x309431=_0x7b67[_0x628cd5];return _0x309431;};'use strict';var emlformat=require(_0x77b6('0x0'));var rimraf=require(_0x77b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77b6('0x2'));var rp=require(_0x77b6('0x3'));var moment=require(_0x77b6('0x4'));var BPromise=require(_0x77b6('0x5'));var Mustache=require(_0x77b6('0x6'));var util=require(_0x77b6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x77b6('0x8'));var ejs=require(_0x77b6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77b6('0xa'));var squel=require(_0x77b6('0xb'));var crypto=require(_0x77b6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x77b6('0xd'));var toCsv=require(_0x77b6('0x8'));var querystring=require(_0x77b6('0xe'));var Papa=require(_0x77b6('0xf'));var Redis=require(_0x77b6('0x10'));var authService=require(_0x77b6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x77b6('0x12'));var hardwareService=require(_0x77b6('0x13'));var logger=require('../../config/logger')(_0x77b6('0x14'));var utils=require(_0x77b6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x77b6('0x16'))['db'];config[_0x77b6('0x17')]=_[_0x77b6('0x18')](config['redis'],{'host':_0x77b6('0x19'),'port':0x18eb});var socket=require(_0x77b6('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x77b6('0x1b')](socket);function respondWithStatusCode(_0x542ecb,_0x1c7530){_0x1c7530=_0x1c7530||0xcc;return function(_0x51c7e1){if(_0x51c7e1){return _0x542ecb[_0x77b6('0x1c')](_0x1c7530);}return _0x542ecb[_0x77b6('0x1d')](_0x1c7530)['end']();};}function respondWithResult(_0x5ebc68,_0x3950e0){_0x3950e0=_0x3950e0||0xc8;return function(_0x2d4635){if(_0x2d4635){return _0x5ebc68[_0x77b6('0x1d')](_0x3950e0)['json'](_0x2d4635);}};}function respondWithFilteredResult(_0x21430d,_0x5adf82){return function(_0x1b0812){if(_0x1b0812){var _0x5b9c98=typeof _0x5adf82[_0x77b6('0x1e')]===_0x77b6('0x1f')&&typeof _0x5adf82[_0x77b6('0x20')]==='undefined';var _0x255304=_0x1b0812[_0x77b6('0x21')];var _0x1db050=_0x5b9c98?0x0:_0x5adf82[_0x77b6('0x1e')];var _0x33b35b=_0x5b9c98?_0x1b0812[_0x77b6('0x21')]:_0x5adf82[_0x77b6('0x1e')]+_0x5adf82['limit'];var _0x3b1ad4;if(_0x33b35b>=_0x255304){_0x33b35b=_0x255304;_0x3b1ad4=0xc8;}else{_0x3b1ad4=0xce;}_0x21430d[_0x77b6('0x1d')](_0x3b1ad4);return _0x21430d[_0x77b6('0x22')](_0x77b6('0x23'),_0x1db050+'-'+_0x33b35b+'/'+_0x255304)[_0x77b6('0x24')](_0x1b0812);}return null;};}function patchUpdates(_0x15eec5){return function(_0x35be58){try{jsonpatch[_0x77b6('0x25')](_0x35be58,_0x15eec5,!![]);}catch(_0x5e103d){return BPromise[_0x77b6('0x26')](_0x5e103d);}return _0x35be58[_0x77b6('0x27')]();};}function saveUpdates(_0x496a73,_0x24cb9b){return function(_0xb1cce9){if(_0xb1cce9){return _0xb1cce9[_0x77b6('0x28')](_0x496a73)[_0x77b6('0x29')](function(_0x3458e6){return _0x3458e6;});}return null;};}function removeEntity(_0x667c09,_0x59c152){return function(_0x3bd795){if(_0x3bd795){return _0x3bd795['destroy']()['then'](function(){_0x667c09[_0x77b6('0x1d')](0xcc)[_0x77b6('0x2a')]();});}};}function handleEntityNotFound(_0x16e42c,_0xb7620d){return function(_0x23753f){if(!_0x23753f){_0x16e42c[_0x77b6('0x1c')](0x194);}return _0x23753f;};}function handleError(_0x41f86e,_0x119bf0){_0x119bf0=_0x119bf0||0x1f4;return function(_0x33ca0e){logger[_0x77b6('0x2b')](_0x33ca0e['stack']);if(_0x33ca0e['name']){delete _0x33ca0e['name'];}_0x41f86e[_0x77b6('0x1d')](_0x119bf0)['send'](_0x33ca0e);};}exports[_0x77b6('0x2c')]=function(_0x5cb80d,_0x5d25b7){var _0x2227b6={},_0x3b6c4f={},_0x6c5b75={'count':0x0,'rows':[]};var _0x4bc24b=_[_0x77b6('0x2d')](db[_0x77b6('0x2e')][_0x77b6('0x2f')],function(_0x3beb13){return{'name':_0x3beb13[_0x77b6('0x30')],'type':_0x3beb13[_0x77b6('0x31')][_0x77b6('0x32')]};});_0x3b6c4f[_0x77b6('0x33')]=_[_0x77b6('0x2d')](_0x4bc24b,_0x77b6('0x34'));_0x3b6c4f[_0x77b6('0x35')]=_['keys'](_0x5cb80d['query']);_0x3b6c4f['filters']=_[_0x77b6('0x36')](_0x3b6c4f[_0x77b6('0x33')],_0x3b6c4f[_0x77b6('0x35')]);_0x2227b6['attributes']=_[_0x77b6('0x36')](_0x3b6c4f[_0x77b6('0x33')],qs[_0x77b6('0x37')](_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x37')]));_0x2227b6[_0x77b6('0x38')]=_0x2227b6[_0x77b6('0x38')][_0x77b6('0x39')]?_0x2227b6['attributes']:_0x3b6c4f[_0x77b6('0x33')];if(!_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x3a')](_0x77b6('0x3b'))){_0x2227b6[_0x77b6('0x20')]=qs['limit'](_0x5cb80d['query'][_0x77b6('0x20')]);_0x2227b6[_0x77b6('0x1e')]=qs[_0x77b6('0x1e')](_0x5cb80d[_0x77b6('0x35')]['offset']);}_0x2227b6[_0x77b6('0x3c')]=qs[_0x77b6('0x3d')](_0x5cb80d[_0x77b6('0x35')]['sort']);_0x2227b6[_0x77b6('0x3e')]=qs[_0x77b6('0x3f')](_[_0x77b6('0x40')](_0x5cb80d[_0x77b6('0x35')],_0x3b6c4f[_0x77b6('0x3f')]),_0x4bc24b);if(_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x41')]){_0x2227b6[_0x77b6('0x3e')]=_[_0x77b6('0x42')](_0x2227b6['where'],{'$or':_['map'](_0x4bc24b,function(_0x3c8a1d){if(_0x3c8a1d[_0x77b6('0x31')]!==_0x77b6('0x43')){var _0x2161f0={};_0x2161f0[_0x3c8a1d[_0x77b6('0x34')]]={'$like':'%'+_0x5cb80d[_0x77b6('0x35')][_0x77b6('0x41')]+'%'};return _0x2161f0;}})});}_0x2227b6=_['merge']({},_0x2227b6,_0x5cb80d[_0x77b6('0x44')]);var _0xd579f1={'where':_0x2227b6[_0x77b6('0x3e')]};return db[_0x77b6('0x2e')]['count'](_0xd579f1)[_0x77b6('0x29')](function(_0x4575ac){_0x6c5b75[_0x77b6('0x21')]=_0x4575ac;if(_0x5cb80d['query'][_0x77b6('0x45')]){_0x2227b6[_0x77b6('0x46')]=[{'all':!![]}];}return db[_0x77b6('0x2e')][_0x77b6('0x47')](_0x2227b6);})[_0x77b6('0x29')](function(_0x11d1e5){_0x6c5b75[_0x77b6('0x48')]=_0x11d1e5;return _0x6c5b75;})['then'](respondWithFilteredResult(_0x5d25b7,_0x2227b6))[_0x77b6('0x49')](handleError(_0x5d25b7,null));};exports[_0x77b6('0x4a')]=function(_0x3c8e6a,_0x1c86ea){var _0x424c85={'raw':!![],'where':{'id':_0x3c8e6a['params']['id']}},_0x55102b={};_0x55102b[_0x77b6('0x33')]=_['keys'](db[_0x77b6('0x2e')][_0x77b6('0x2f')]);_0x55102b[_0x77b6('0x35')]=_[_0x77b6('0x4b')](_0x3c8e6a['query']);_0x55102b['filters']=_['intersection'](_0x55102b[_0x77b6('0x33')],_0x55102b[_0x77b6('0x35')]);_0x424c85['attributes']=_[_0x77b6('0x36')](_0x55102b[_0x77b6('0x33')],qs[_0x77b6('0x37')](_0x3c8e6a[_0x77b6('0x35')][_0x77b6('0x37')]));_0x424c85['attributes']=_0x424c85[_0x77b6('0x38')]['length']?_0x424c85[_0x77b6('0x38')]:_0x55102b[_0x77b6('0x33')];if(_0x3c8e6a[_0x77b6('0x35')][_0x77b6('0x45')]){_0x424c85[_0x77b6('0x46')]=[{'all':!![]}];}_0x424c85=_['merge']({},_0x424c85,_0x3c8e6a[_0x77b6('0x44')]);return db[_0x77b6('0x2e')][_0x77b6('0x4c')](_0x424c85)[_0x77b6('0x29')](handleEntityNotFound(_0x1c86ea,null))[_0x77b6('0x29')](respondWithResult(_0x1c86ea,null))[_0x77b6('0x49')](handleError(_0x1c86ea,null));};exports[_0x77b6('0x4d')]=function(_0x1526d1,_0x4262f9){return db[_0x77b6('0x2e')]['create'](_0x1526d1[_0x77b6('0x4e')],{})['then'](respondWithResult(_0x4262f9,0xc9))[_0x77b6('0x49')](handleError(_0x4262f9,null));};exports[_0x77b6('0x28')]=function(_0x648298,_0x22b864){if(_0x648298[_0x77b6('0x4e')]['id']){delete _0x648298[_0x77b6('0x4e')]['id'];}return db[_0x77b6('0x2e')]['find']({'where':{'id':_0x648298[_0x77b6('0x4f')]['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x22b864,null))[_0x77b6('0x29')](saveUpdates(_0x648298[_0x77b6('0x4e')],null))[_0x77b6('0x29')](respondWithResult(_0x22b864,null))[_0x77b6('0x49')](handleError(_0x22b864,null));};exports[_0x77b6('0x50')]=function(_0x3e4324,_0x3342cd){return db[_0x77b6('0x2e')][_0x77b6('0x4c')]({'where':{'id':_0x3e4324[_0x77b6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3342cd,null))[_0x77b6('0x29')](removeEntity(_0x3342cd,null))[_0x77b6('0x49')](handleError(_0x3342cd,null));};exports['describe']=function(_0x4b99f2,_0x3fe18a){return db[_0x77b6('0x2e')][_0x77b6('0x51')]()[_0x77b6('0x29')](respondWithResult(_0x3fe18a,null))[_0x77b6('0x49')](handleError(_0x3fe18a,null));};exports[_0x77b6('0x52')]=function(_0x35ae9f,_0x4265ec,_0x5ccc43){return db[_0x77b6('0x53')]['count']({'where':{'ChatGroupId':_0x35ae9f[_0x77b6('0x4f')]['id'],'ToId':_0x35ae9f['user']['id'],'read':![]}})[_0x77b6('0x29')](function(_0x51ddda){return{'id':_[_0x77b6('0x54')](_0x35ae9f[_0x77b6('0x4f')]['id']),'count':_0x51ddda};})[_0x77b6('0x29')](respondWithResult(_0x4265ec,null))[_0x77b6('0x49')](handleError(_0x4265ec,null));};exports[_0x77b6('0x55')]=function(_0x13b53c,_0x333087,_0x20e141){return db['ChatGroup'][_0x77b6('0x4c')]({'where':{'id':_0x13b53c['params']['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x333087,null))[_0x77b6('0x29')](function(_0x45c171){if(_0x45c171){return _0x45c171[_0x77b6('0x55')](_0x13b53c[_0x77b6('0x4e')][_0x77b6('0x56')],_['omit'](_0x13b53c['body'],[_0x77b6('0x56'),'id'])||{});}})[_0x77b6('0x29')](respondWithResult(_0x333087,null))[_0x77b6('0x49')](handleError(_0x333087,null));};exports[_0x77b6('0x57')]=function(_0x54bf66,_0x16a89c,_0x28ec28){var _0x26c247={};var _0x2ba446={};var _0x507a0f;var _0x4b638a;return db[_0x77b6('0x2e')][_0x77b6('0x58')]({'where':{'id':_0x54bf66[_0x77b6('0x4f')]['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x16a89c,null))[_0x77b6('0x29')](function(_0x3fa972){if(_0x3fa972){_0x507a0f=_0x3fa972;_0x2ba446[_0x77b6('0x33')]=_['keys'](db['User'][_0x77b6('0x2f')]);_0x2ba446[_0x77b6('0x35')]=_[_0x77b6('0x4b')](_0x54bf66[_0x77b6('0x35')]);_0x2ba446['filters']=_['intersection'](_0x2ba446[_0x77b6('0x33')],_0x2ba446[_0x77b6('0x35')]);_0x26c247[_0x77b6('0x38')]=_[_0x77b6('0x36')](_0x2ba446[_0x77b6('0x33')],qs['fields'](_0x54bf66[_0x77b6('0x35')][_0x77b6('0x37')]));_0x26c247[_0x77b6('0x38')]=_0x26c247[_0x77b6('0x38')][_0x77b6('0x39')]?_0x26c247['attributes']:_0x2ba446['model'];_0x26c247[_0x77b6('0x3c')]=qs['sort'](_0x54bf66['query']['sort']);_0x26c247[_0x77b6('0x3e')]=qs[_0x77b6('0x3f')](_[_0x77b6('0x40')](_0x54bf66['query'],_0x2ba446['filters']));if(_0x54bf66[_0x77b6('0x35')][_0x77b6('0x41')]){_0x26c247[_0x77b6('0x3e')]=_[_0x77b6('0x42')](_0x26c247[_0x77b6('0x3e')],{'$or':_[_0x77b6('0x2d')](_0x26c247[_0x77b6('0x38')],function(_0x148685){var _0x1a517a={};_0x1a517a[_0x148685]={'$like':'%'+_0x54bf66[_0x77b6('0x35')]['filter']+'%'};return _0x1a517a;})});}_0x26c247=_[_0x77b6('0x42')]({},_0x26c247,_0x54bf66[_0x77b6('0x44')]);return _0x507a0f[_0x77b6('0x57')](_0x26c247);}})[_0x77b6('0x29')](function(_0x2e5443){if(_0x2e5443){_0x4b638a=_0x2e5443[_0x77b6('0x39')];if(!_0x54bf66['query'][_0x77b6('0x3a')]('nolimit')){_0x26c247[_0x77b6('0x20')]=qs[_0x77b6('0x20')](_0x54bf66[_0x77b6('0x35')][_0x77b6('0x20')]);_0x26c247[_0x77b6('0x1e')]=qs[_0x77b6('0x1e')](_0x54bf66[_0x77b6('0x35')][_0x77b6('0x1e')]);}return _0x507a0f[_0x77b6('0x57')](_0x26c247);}})[_0x77b6('0x29')](function(_0x20dce1){if(_0x20dce1){return _0x20dce1?{'count':_0x4b638a,'rows':_0x20dce1}:null;}})['then'](respondWithResult(_0x16a89c,null))[_0x77b6('0x49')](handleError(_0x16a89c,null));};exports[_0x77b6('0x59')]=function(_0x42dfe5,_0x581747,_0x342661){return db['ChatGroup'][_0x77b6('0x4c')]({'where':{'id':_0x42dfe5[_0x77b6('0x4f')]['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x581747,null))[_0x77b6('0x29')](function(_0xcb3628){if(_0xcb3628){return _0xcb3628[_0x77b6('0x59')](_0x42dfe5[_0x77b6('0x35')][_0x77b6('0x56')]);}})[_0x77b6('0x29')](respondWithStatusCode(_0x581747,null))[_0x77b6('0x49')](handleError(_0x581747,null));};exports[_0x77b6('0x5a')]=function(_0x3cca43,_0x1d0df8,_0x4b9219){if(_0x3cca43[_0x77b6('0x4e')]['id']){delete _0x3cca43[_0x77b6('0x4e')]['id'];}return db[_0x77b6('0x2e')][_0x77b6('0x4c')]({'where':{'id':_0x3cca43['params']['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x1d0df8,null))[_0x77b6('0x29')](function(_0x111ba0){if(_0x111ba0){_0x3cca43['body'][_0x77b6('0x5b')]=_0x111ba0['id'];return db[_0x77b6('0x53')][_0x77b6('0x4d')](_0x3cca43[_0x77b6('0x4e')]);}})['then'](respondWithResult(_0x1d0df8,null))[_0x77b6('0x49')](handleError(_0x1d0df8,null));};exports['getMessages']=function(_0x4d46f2,_0x55a049,_0x1b0e0a){var _0x3cb81d={};var _0x28cf80={};var _0xb41f45;var _0x507aa5;return db[_0x77b6('0x2e')][_0x77b6('0x58')]({'where':{'id':_0x4d46f2['params']['id']}})[_0x77b6('0x29')](handleEntityNotFound(_0x55a049,null))['then'](function(_0x3f9cad){if(_0x3f9cad){_0xb41f45=_0x3f9cad;_0x28cf80['model']=_[_0x77b6('0x4b')](db[_0x77b6('0x53')]['rawAttributes']);_0x28cf80[_0x77b6('0x35')]=_[_0x77b6('0x4b')](_0x4d46f2['query']);_0x28cf80[_0x77b6('0x3f')]=_['intersection'](_0x28cf80[_0x77b6('0x33')],_0x28cf80[_0x77b6('0x35')]);_0x3cb81d[_0x77b6('0x38')]=_[_0x77b6('0x36')](_0x28cf80[_0x77b6('0x33')],qs[_0x77b6('0x37')](_0x4d46f2[_0x77b6('0x35')]['fields']));_0x3cb81d[_0x77b6('0x38')]=_0x3cb81d[_0x77b6('0x38')][_0x77b6('0x39')]?_0x3cb81d[_0x77b6('0x38')]:_0x28cf80['model'];_0x3cb81d['order']=qs[_0x77b6('0x3d')](_0x4d46f2['query'][_0x77b6('0x3d')]);_0x3cb81d[_0x77b6('0x3e')]=qs[_0x77b6('0x3f')](_['pick'](_0x4d46f2[_0x77b6('0x35')],_0x28cf80[_0x77b6('0x3f')]));if(_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x41')]){_0x3cb81d[_0x77b6('0x3e')]=_[_0x77b6('0x42')](_0x3cb81d[_0x77b6('0x3e')],{'$or':_['map'](_0x3cb81d['attributes'],function(_0x1d8d12){var _0x4db764={};_0x4db764[_0x1d8d12]={'$like':'%'+_0x4d46f2['query'][_0x77b6('0x41')]+'%'};return _0x4db764;})});}if(_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x5c')]){var _0x54a077=_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x5c')][_0x77b6('0x5d')](',');var _0x502b48={};_0x502b48[_0x54a077[0x0]]={'$gte':moment(_0x54a077[0x1])[_0x77b6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3cb81d[_0x77b6('0x3e')]=_['merge'](_0x3cb81d['where'],_0x502b48);}_0x3cb81d=_[_0x77b6('0x42')]({},_0x3cb81d,_0x4d46f2['options']);return _0xb41f45[_0x77b6('0x5f')](_0x3cb81d);}})[_0x77b6('0x29')](function(_0x55f297){if(_0x55f297){_0x507aa5=_0x55f297['length'];if(!_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x3a')](_0x77b6('0x3b'))){_0x3cb81d[_0x77b6('0x20')]=qs['limit'](_0x4d46f2[_0x77b6('0x35')][_0x77b6('0x20')]);_0x3cb81d[_0x77b6('0x1e')]=qs[_0x77b6('0x1e')](_0x4d46f2[_0x77b6('0x35')]['offset']);}return _0xb41f45[_0x77b6('0x5f')](_0x3cb81d);}})['then'](function(_0x2c84c9){if(_0x2c84c9){return _0x2c84c9?{'count':_0x507aa5,'rows':_0x2c84c9}:null;}})[_0x77b6('0x29')](respondWithResult(_0x55a049,null))['catch'](handleError(_0x55a049,null));}; \ No newline at end of file +var _0x0bf8=['getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','end','sendStatus','stack','send','map','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','include','findAll','then','rows','show','intersection','includeAll','find','catch','create','update','body','params','describe','getUnread','user','toInteger','addMembers','ids','findOne','getMembers','nolimit','removeMembers','addMessage','ChatInternalMessage','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bf8,0x11e));var _0x80bf=function(_0x34de7a,_0x57d22c){_0x34de7a=_0x34de7a-0x0;var _0xd1c14=_0x0bf8[_0x34de7a];return _0xd1c14;};'use strict';var emlformat=require(_0x80bf('0x0'));var rimraf=require(_0x80bf('0x1'));var zipdir=require(_0x80bf('0x2'));var jsonpatch=require(_0x80bf('0x3'));var rp=require(_0x80bf('0x4'));var moment=require('moment');var BPromise=require(_0x80bf('0x5'));var Mustache=require(_0x80bf('0x6'));var util=require(_0x80bf('0x7'));var path=require('path');var sox=require(_0x80bf('0x8'));var csv=require(_0x80bf('0x9'));var ejs=require(_0x80bf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x80bf('0xb'));var squel=require('squel');var crypto=require(_0x80bf('0xc'));var jsforce=require(_0x80bf('0xd'));var deskjs=require(_0x80bf('0xe'));var toCsv=require(_0x80bf('0x9'));var querystring=require('querystring');var Papa=require(_0x80bf('0xf'));var Redis=require(_0x80bf('0x10'));var authService=require(_0x80bf('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80bf('0x12'));var logger=require(_0x80bf('0x13'))('api');var utils=require(_0x80bf('0x14'));var config=require(_0x80bf('0x15'));var licenseUtil=require(_0x80bf('0x16'));var db=require(_0x80bf('0x17'))['db'];config[_0x80bf('0x18')]=_[_0x80bf('0x19')](config[_0x80bf('0x18')],{'host':_0x80bf('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0x80bf('0x1b')](socket);function respondWithStatusCode(_0x262b27,_0x140643){_0x140643=_0x140643||0xcc;return function(_0x23fff8){if(_0x23fff8){return _0x262b27['sendStatus'](_0x140643);}return _0x262b27[_0x80bf('0x1c')](_0x140643)['end']();};}function respondWithResult(_0x2c9aa3,_0x3834e1){_0x3834e1=_0x3834e1||0xc8;return function(_0x22c27c){if(_0x22c27c){return _0x2c9aa3[_0x80bf('0x1c')](_0x3834e1)[_0x80bf('0x1d')](_0x22c27c);}};}function respondWithFilteredResult(_0x276657,_0x337c4c){return function(_0x5ae584){if(_0x5ae584){var _0x32458a=typeof _0x337c4c[_0x80bf('0x1e')]===_0x80bf('0x1f')&&typeof _0x337c4c[_0x80bf('0x20')]==='undefined';var _0x372784=_0x5ae584[_0x80bf('0x21')];var _0x340732=_0x32458a?0x0:_0x337c4c[_0x80bf('0x1e')];var _0x4e951d=_0x32458a?_0x5ae584[_0x80bf('0x21')]:_0x337c4c['offset']+_0x337c4c[_0x80bf('0x20')];var _0x533a17;if(_0x4e951d>=_0x372784){_0x4e951d=_0x372784;_0x533a17=0xc8;}else{_0x533a17=0xce;}_0x276657[_0x80bf('0x1c')](_0x533a17);return _0x276657[_0x80bf('0x22')](_0x80bf('0x23'),_0x340732+'-'+_0x4e951d+'/'+_0x372784)[_0x80bf('0x1d')](_0x5ae584);}return null;};}function patchUpdates(_0x2c6669){return function(_0x35d140){try{jsonpatch['apply'](_0x35d140,_0x2c6669,!![]);}catch(_0x36280e){return BPromise[_0x80bf('0x24')](_0x36280e);}return _0x35d140[_0x80bf('0x25')]();};}function saveUpdates(_0x172026,_0x398c71){return function(_0x4dae7e){if(_0x4dae7e){return _0x4dae7e['update'](_0x172026)['then'](function(_0x5ee249){return _0x5ee249;});}return null;};}function removeEntity(_0x8809a3,_0x5ec429){return function(_0x172575){if(_0x172575){return _0x172575[_0x80bf('0x26')]()['then'](function(){_0x8809a3['status'](0xcc)[_0x80bf('0x27')]();});}};}function handleEntityNotFound(_0x58c9dc,_0x4e3828){return function(_0x4b596f){if(!_0x4b596f){_0x58c9dc[_0x80bf('0x28')](0x194);}return _0x4b596f;};}function handleError(_0xb9756,_0x571498){_0x571498=_0x571498||0x1f4;return function(_0x1b186c){logger['error'](_0x1b186c[_0x80bf('0x29')]);if(_0x1b186c['name']){delete _0x1b186c['name'];}_0xb9756[_0x80bf('0x1c')](_0x571498)[_0x80bf('0x2a')](_0x1b186c);};}exports['index']=function(_0xd84748,_0x1853fb){var _0x3f334d={},_0x38074b={},_0x201b52={'count':0x0,'rows':[]};var _0x351a56=_[_0x80bf('0x2b')](db['ChatGroup'][_0x80bf('0x2c')],function(_0x4971b2){return{'name':_0x4971b2[_0x80bf('0x2d')],'type':_0x4971b2['type'][_0x80bf('0x2e')]};});_0x38074b[_0x80bf('0x2f')]=_[_0x80bf('0x2b')](_0x351a56,_0x80bf('0x30'));_0x38074b[_0x80bf('0x31')]=_[_0x80bf('0x32')](_0xd84748['query']);_0x38074b[_0x80bf('0x33')]=_['intersection'](_0x38074b[_0x80bf('0x2f')],_0x38074b[_0x80bf('0x31')]);_0x3f334d[_0x80bf('0x34')]=_['intersection'](_0x38074b[_0x80bf('0x2f')],qs[_0x80bf('0x35')](_0xd84748['query'][_0x80bf('0x35')]));_0x3f334d['attributes']=_0x3f334d[_0x80bf('0x34')][_0x80bf('0x36')]?_0x3f334d['attributes']:_0x38074b[_0x80bf('0x2f')];if(!_0xd84748[_0x80bf('0x31')][_0x80bf('0x37')]('nolimit')){_0x3f334d[_0x80bf('0x20')]=qs[_0x80bf('0x20')](_0xd84748['query'][_0x80bf('0x20')]);_0x3f334d[_0x80bf('0x1e')]=qs['offset'](_0xd84748['query'][_0x80bf('0x1e')]);}_0x3f334d[_0x80bf('0x38')]=qs[_0x80bf('0x39')](_0xd84748[_0x80bf('0x31')][_0x80bf('0x39')]);_0x3f334d[_0x80bf('0x3a')]=qs[_0x80bf('0x33')](_[_0x80bf('0x3b')](_0xd84748[_0x80bf('0x31')],_0x38074b[_0x80bf('0x33')]),_0x351a56);if(_0xd84748['query'][_0x80bf('0x3c')]){_0x3f334d[_0x80bf('0x3a')]=_[_0x80bf('0x3d')](_0x3f334d[_0x80bf('0x3a')],{'$or':_[_0x80bf('0x2b')](_0x351a56,function(_0x2552c7){if(_0x2552c7[_0x80bf('0x3e')]!==_0x80bf('0x3f')){var _0x48fb8e={};_0x48fb8e[_0x2552c7['name']]={'$like':'%'+_0xd84748['query'][_0x80bf('0x3c')]+'%'};return _0x48fb8e;}})});}_0x3f334d=_['merge']({},_0x3f334d,_0xd84748[_0x80bf('0x40')]);var _0x16722a={'where':_0x3f334d['where']};return db[_0x80bf('0x41')][_0x80bf('0x21')](_0x16722a)['then'](function(_0xa6b2ce){_0x201b52[_0x80bf('0x21')]=_0xa6b2ce;if(_0xd84748[_0x80bf('0x31')]['includeAll']){_0x3f334d[_0x80bf('0x42')]=[{'all':!![]}];}return db[_0x80bf('0x41')][_0x80bf('0x43')](_0x3f334d);})[_0x80bf('0x44')](function(_0x1cb182){_0x201b52[_0x80bf('0x45')]=_0x1cb182;return _0x201b52;})[_0x80bf('0x44')](respondWithFilteredResult(_0x1853fb,_0x3f334d))['catch'](handleError(_0x1853fb,null));};exports[_0x80bf('0x46')]=function(_0x44d4e3,_0x380a83){var _0x1e2fac={'raw':!![],'where':{'id':_0x44d4e3['params']['id']}},_0x2d7d2c={};_0x2d7d2c[_0x80bf('0x2f')]=_[_0x80bf('0x32')](db[_0x80bf('0x41')][_0x80bf('0x2c')]);_0x2d7d2c[_0x80bf('0x31')]=_[_0x80bf('0x32')](_0x44d4e3[_0x80bf('0x31')]);_0x2d7d2c['filters']=_[_0x80bf('0x47')](_0x2d7d2c['model'],_0x2d7d2c[_0x80bf('0x31')]);_0x1e2fac['attributes']=_[_0x80bf('0x47')](_0x2d7d2c[_0x80bf('0x2f')],qs[_0x80bf('0x35')](_0x44d4e3[_0x80bf('0x31')][_0x80bf('0x35')]));_0x1e2fac[_0x80bf('0x34')]=_0x1e2fac[_0x80bf('0x34')][_0x80bf('0x36')]?_0x1e2fac[_0x80bf('0x34')]:_0x2d7d2c[_0x80bf('0x2f')];if(_0x44d4e3[_0x80bf('0x31')][_0x80bf('0x48')]){_0x1e2fac['include']=[{'all':!![]}];}_0x1e2fac=_[_0x80bf('0x3d')]({},_0x1e2fac,_0x44d4e3['options']);return db[_0x80bf('0x41')][_0x80bf('0x49')](_0x1e2fac)[_0x80bf('0x44')](handleEntityNotFound(_0x380a83,null))[_0x80bf('0x44')](respondWithResult(_0x380a83,null))[_0x80bf('0x4a')](handleError(_0x380a83,null));};exports[_0x80bf('0x4b')]=function(_0x133742,_0x87dc06){return db['ChatGroup'][_0x80bf('0x4b')](_0x133742['body'],{})[_0x80bf('0x44')](respondWithResult(_0x87dc06,0xc9))[_0x80bf('0x4a')](handleError(_0x87dc06,null));};exports[_0x80bf('0x4c')]=function(_0x13d2cf,_0x43e8b1){if(_0x13d2cf[_0x80bf('0x4d')]['id']){delete _0x13d2cf['body']['id'];}return db['ChatGroup'][_0x80bf('0x49')]({'where':{'id':_0x13d2cf[_0x80bf('0x4e')]['id']}})[_0x80bf('0x44')](handleEntityNotFound(_0x43e8b1,null))['then'](saveUpdates(_0x13d2cf['body'],null))[_0x80bf('0x44')](respondWithResult(_0x43e8b1,null))[_0x80bf('0x4a')](handleError(_0x43e8b1,null));};exports[_0x80bf('0x26')]=function(_0x235840,_0x349cfe){return db[_0x80bf('0x41')][_0x80bf('0x49')]({'where':{'id':_0x235840[_0x80bf('0x4e')]['id']}})['then'](handleEntityNotFound(_0x349cfe,null))[_0x80bf('0x44')](removeEntity(_0x349cfe,null))[_0x80bf('0x4a')](handleError(_0x349cfe,null));};exports[_0x80bf('0x4f')]=function(_0x50a402,_0x1ff4bc){return db[_0x80bf('0x41')][_0x80bf('0x4f')]()[_0x80bf('0x44')](respondWithResult(_0x1ff4bc,null))[_0x80bf('0x4a')](handleError(_0x1ff4bc,null));};exports[_0x80bf('0x50')]=function(_0x52b1ba,_0x294952,_0x53b164){return db['ChatInternalMessage'][_0x80bf('0x21')]({'where':{'ChatGroupId':_0x52b1ba[_0x80bf('0x4e')]['id'],'ToId':_0x52b1ba[_0x80bf('0x51')]['id'],'read':![]}})[_0x80bf('0x44')](function(_0x4f695b){return{'id':_[_0x80bf('0x52')](_0x52b1ba[_0x80bf('0x4e')]['id']),'count':_0x4f695b};})[_0x80bf('0x44')](respondWithResult(_0x294952,null))[_0x80bf('0x4a')](handleError(_0x294952,null));};exports[_0x80bf('0x53')]=function(_0x2d681b,_0x403d11,_0x39764d){return db[_0x80bf('0x41')]['find']({'where':{'id':_0x2d681b['params']['id']}})[_0x80bf('0x44')](handleEntityNotFound(_0x403d11,null))[_0x80bf('0x44')](function(_0x582aed){if(_0x582aed){return _0x582aed[_0x80bf('0x53')](_0x2d681b[_0x80bf('0x4d')][_0x80bf('0x54')],_['omit'](_0x2d681b[_0x80bf('0x4d')],['ids','id'])||{});}})[_0x80bf('0x44')](respondWithResult(_0x403d11,null))[_0x80bf('0x4a')](handleError(_0x403d11,null));};exports['getMembers']=function(_0x5ae8fa,_0x4a3150,_0x287373){var _0xe3039={};var _0x3ab876={};var _0x59fe94;var _0x9b5dba;return db[_0x80bf('0x41')][_0x80bf('0x55')]({'where':{'id':_0x5ae8fa[_0x80bf('0x4e')]['id']}})[_0x80bf('0x44')](handleEntityNotFound(_0x4a3150,null))['then'](function(_0x3142ee){if(_0x3142ee){_0x59fe94=_0x3142ee;_0x3ab876[_0x80bf('0x2f')]=_['keys'](db['User'][_0x80bf('0x2c')]);_0x3ab876['query']=_[_0x80bf('0x32')](_0x5ae8fa[_0x80bf('0x31')]);_0x3ab876[_0x80bf('0x33')]=_['intersection'](_0x3ab876['model'],_0x3ab876[_0x80bf('0x31')]);_0xe3039[_0x80bf('0x34')]=_[_0x80bf('0x47')](_0x3ab876[_0x80bf('0x2f')],qs[_0x80bf('0x35')](_0x5ae8fa['query'][_0x80bf('0x35')]));_0xe3039[_0x80bf('0x34')]=_0xe3039[_0x80bf('0x34')][_0x80bf('0x36')]?_0xe3039['attributes']:_0x3ab876[_0x80bf('0x2f')];_0xe3039[_0x80bf('0x38')]=qs['sort'](_0x5ae8fa['query']['sort']);_0xe3039[_0x80bf('0x3a')]=qs['filters'](_[_0x80bf('0x3b')](_0x5ae8fa['query'],_0x3ab876[_0x80bf('0x33')]));if(_0x5ae8fa['query'][_0x80bf('0x3c')]){_0xe3039[_0x80bf('0x3a')]=_[_0x80bf('0x3d')](_0xe3039[_0x80bf('0x3a')],{'$or':_[_0x80bf('0x2b')](_0xe3039[_0x80bf('0x34')],function(_0x5e5b14){var _0xa30867={};_0xa30867[_0x5e5b14]={'$like':'%'+_0x5ae8fa[_0x80bf('0x31')][_0x80bf('0x3c')]+'%'};return _0xa30867;})});}_0xe3039=_['merge']({},_0xe3039,_0x5ae8fa[_0x80bf('0x40')]);return _0x59fe94[_0x80bf('0x56')](_0xe3039);}})['then'](function(_0x329635){if(_0x329635){_0x9b5dba=_0x329635[_0x80bf('0x36')];if(!_0x5ae8fa[_0x80bf('0x31')][_0x80bf('0x37')](_0x80bf('0x57'))){_0xe3039[_0x80bf('0x20')]=qs[_0x80bf('0x20')](_0x5ae8fa[_0x80bf('0x31')][_0x80bf('0x20')]);_0xe3039[_0x80bf('0x1e')]=qs['offset'](_0x5ae8fa[_0x80bf('0x31')]['offset']);}return _0x59fe94['getMembers'](_0xe3039);}})['then'](function(_0x4f1e7d){if(_0x4f1e7d){return _0x4f1e7d?{'count':_0x9b5dba,'rows':_0x4f1e7d}:null;}})[_0x80bf('0x44')](respondWithResult(_0x4a3150,null))['catch'](handleError(_0x4a3150,null));};exports[_0x80bf('0x58')]=function(_0x349f59,_0xea5a78,_0x4a9695){return db['ChatGroup']['find']({'where':{'id':_0x349f59['params']['id']}})['then'](handleEntityNotFound(_0xea5a78,null))[_0x80bf('0x44')](function(_0x201248){if(_0x201248){return _0x201248[_0x80bf('0x58')](_0x349f59['query'][_0x80bf('0x54')]);}})[_0x80bf('0x44')](respondWithStatusCode(_0xea5a78,null))[_0x80bf('0x4a')](handleError(_0xea5a78,null));};exports[_0x80bf('0x59')]=function(_0x203e87,_0x4105cf,_0x26127c){if(_0x203e87[_0x80bf('0x4d')]['id']){delete _0x203e87[_0x80bf('0x4d')]['id'];}return db[_0x80bf('0x41')][_0x80bf('0x49')]({'where':{'id':_0x203e87['params']['id']}})[_0x80bf('0x44')](handleEntityNotFound(_0x4105cf,null))[_0x80bf('0x44')](function(_0x210076){if(_0x210076){_0x203e87[_0x80bf('0x4d')]['ChatGroupId']=_0x210076['id'];return db['ChatInternalMessage']['create'](_0x203e87[_0x80bf('0x4d')]);}})[_0x80bf('0x44')](respondWithResult(_0x4105cf,null))[_0x80bf('0x4a')](handleError(_0x4105cf,null));};exports['getMessages']=function(_0x22932e,_0x45f6fd,_0x3a8e82){var _0x3b1859={};var _0x3d5ff0={};var _0x28a394;var _0x2c71e1;return db[_0x80bf('0x41')][_0x80bf('0x55')]({'where':{'id':_0x22932e['params']['id']}})[_0x80bf('0x44')](handleEntityNotFound(_0x45f6fd,null))[_0x80bf('0x44')](function(_0x44438f){if(_0x44438f){_0x28a394=_0x44438f;_0x3d5ff0[_0x80bf('0x2f')]=_['keys'](db[_0x80bf('0x5a')][_0x80bf('0x2c')]);_0x3d5ff0[_0x80bf('0x31')]=_[_0x80bf('0x32')](_0x22932e['query']);_0x3d5ff0['filters']=_['intersection'](_0x3d5ff0[_0x80bf('0x2f')],_0x3d5ff0[_0x80bf('0x31')]);_0x3b1859[_0x80bf('0x34')]=_[_0x80bf('0x47')](_0x3d5ff0['model'],qs[_0x80bf('0x35')](_0x22932e[_0x80bf('0x31')]['fields']));_0x3b1859['attributes']=_0x3b1859[_0x80bf('0x34')][_0x80bf('0x36')]?_0x3b1859['attributes']:_0x3d5ff0['model'];_0x3b1859[_0x80bf('0x38')]=qs['sort'](_0x22932e[_0x80bf('0x31')][_0x80bf('0x39')]);_0x3b1859[_0x80bf('0x3a')]=qs['filters'](_['pick'](_0x22932e['query'],_0x3d5ff0[_0x80bf('0x33')]));if(_0x22932e[_0x80bf('0x31')][_0x80bf('0x3c')]){_0x3b1859[_0x80bf('0x3a')]=_[_0x80bf('0x3d')](_0x3b1859['where'],{'$or':_['map'](_0x3b1859[_0x80bf('0x34')],function(_0x5df1c8){var _0x191913={};_0x191913[_0x5df1c8]={'$like':'%'+_0x22932e[_0x80bf('0x31')][_0x80bf('0x3c')]+'%'};return _0x191913;})});}if(_0x22932e[_0x80bf('0x31')]['$gte']){var _0x276122=_0x22932e[_0x80bf('0x31')]['$gte'][_0x80bf('0x5b')](',');var _0xcf4e1f={};_0xcf4e1f[_0x276122[0x0]]={'$gte':moment(_0x276122[0x1])[_0x80bf('0x5c')](_0x80bf('0x5d'))};_0x3b1859['where']=_[_0x80bf('0x3d')](_0x3b1859[_0x80bf('0x3a')],_0xcf4e1f);}_0x3b1859=_[_0x80bf('0x3d')]({},_0x3b1859,_0x22932e[_0x80bf('0x40')]);return _0x28a394[_0x80bf('0x5e')](_0x3b1859);}})[_0x80bf('0x44')](function(_0x21a13f){if(_0x21a13f){_0x2c71e1=_0x21a13f[_0x80bf('0x36')];if(!_0x22932e[_0x80bf('0x31')][_0x80bf('0x37')](_0x80bf('0x57'))){_0x3b1859[_0x80bf('0x20')]=qs[_0x80bf('0x20')](_0x22932e[_0x80bf('0x31')][_0x80bf('0x20')]);_0x3b1859[_0x80bf('0x1e')]=qs['offset'](_0x22932e[_0x80bf('0x31')][_0x80bf('0x1e')]);}return _0x28a394[_0x80bf('0x5e')](_0x3b1859);}})['then'](function(_0x138dbb){if(_0x138dbb){return _0x138dbb?{'count':_0x2c71e1,'rows':_0x138dbb}:null;}})[_0x80bf('0x44')](respondWithResult(_0x45f6fd,null))['catch'](handleError(_0x45f6fd,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 13fb357..6f1d6fb 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 _0xe0c0=['events','ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x5e6475,_0x24fc6e){var _0x7d48b=function(_0x273091){while(--_0x273091){_0x5e6475['push'](_0x5e6475['shift']());}};_0x7d48b(++_0x24fc6e);}(_0xe0c0,0xe7));var _0x0e0c=function(_0x2535f1,_0x1700c2){_0x2535f1=_0x2535f1-0x0;var _0x191188=_0xe0c0[_0x2535f1];return _0x191188;};'use strict';var EventEmitter=require(_0x0e0c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0e0c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0e0c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e0c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45718b){return function(_0x4633b9,_0x2d5f26,_0x23e119){ChatGroupEvents[_0x0e0c('0x4')](_0x45718b+':'+_0x4633b9['id'],_0x4633b9);ChatGroupEvents[_0x0e0c('0x4')](_0x45718b,_0x4633b9);_0x23e119(null);};}for(var e in events){if(events[_0x0e0c('0x5')](e)){var event=events[e];ChatGroup[_0x0e0c('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x2901=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x2901,0xfe));var _0x1290=function(_0x1291ba,_0x5bc451){_0x1291ba=_0x1291ba-0x0;var _0x3d3697=_0x2901[_0x1291ba];return _0x3d3697;};'use strict';var EventEmitter=require(_0x1290('0x0'));var ChatGroup=require(_0x1290('0x1'))['db'][_0x1290('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1290('0x3')](0x0);var events={'afterCreate':_0x1290('0x4'),'afterUpdate':_0x1290('0x5'),'afterDestroy':_0x1290('0x6')};function emitEvent(_0x141d35){return function(_0x1dbf49,_0x14d427,_0x2eff3b){ChatGroupEvents[_0x1290('0x7')](_0x141d35+':'+_0x1dbf49['id'],_0x1dbf49);ChatGroupEvents['emit'](_0x141d35,_0x1dbf49);_0x2eff3b(null);};}for(var e in events){if(events[_0x1290('0x8')](e)){var event=events[e];ChatGroup[_0x1290('0x9')](e,emitEvent(event));}}module[_0x1290('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 56daab9..1148502 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 _0x7282=['rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','bluebird','request-promise','path'];(function(_0x371b8a,_0x464249){var _0x2c730f=function(_0x58dbf7){while(--_0x58dbf7){_0x371b8a['push'](_0x371b8a['shift']());}};_0x2c730f(++_0x464249);}(_0x7282,0xd8));var _0x2728=function(_0xd0e677,_0x42939d){_0xd0e677=_0xd0e677-0x0;var _0x18aeb9=_0x7282[_0xd0e677];return _0x18aeb9;};'use strict';var _=require('lodash');var util=require(_0x2728('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2728('0x1'));var rp=require(_0x2728('0x2'));var fs=require('fs');var path=require(_0x2728('0x3'));var rimraf=require(_0x2728('0x4'));var config=require('../../config/environment');var attributes=require(_0x2728('0x5'));module[_0x2728('0x6')]=function(_0xa1e123,_0x50e7e9){return _0xa1e123[_0x2728('0x7')](_0x2728('0x8'),attributes,{'tableName':_0x2728('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa055=['../../config/logger','moment','bluebird','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup','lodash'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0xa055,0x1b7));var _0x5a05=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0xa055[_0x592e40];return _0x5d4288;};'use strict';var _=require(_0x5a05('0x0'));var util=require('util');var logger=require(_0x5a05('0x1'))('api');var moment=require(_0x5a05('0x2'));var BPromise=require(_0x5a05('0x3'));var rp=require(_0x5a05('0x4'));var fs=require('fs');var path=require(_0x5a05('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5a05('0x6'));module[_0x5a05('0x7')]=function(_0x26bef2,_0x4f844b){return _0x26bef2[_0x5a05('0x8')](_0x5a05('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index cbc6dc1..1d710ca 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 _0x2e35=['stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2e35,0x101));var _0x52e3=function(_0x11bf11,_0x55bea7){_0x11bf11=_0x11bf11-0x0;var _0x10605d=_0x2e35[_0x11bf11];return _0x10605d;};'use strict';var _=require(_0x52e3('0x0'));var util=require('util');var moment=require(_0x52e3('0x1'));var BPromise=require('bluebird');var rs=require(_0x52e3('0x2'));var fs=require('fs');var Redis=require(_0x52e3('0x3'));var db=require(_0x52e3('0x4'))['db'];var utils=require(_0x52e3('0x5'));var logger=require('../../config/logger')(_0x52e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x52e3('0x7')]({'port':0x232a});config[_0x52e3('0x8')]=_[_0x52e3('0x9')](config[_0x52e3('0x8')],{'host':_0x52e3('0xa'),'port':0x18eb});var socket=require(_0x52e3('0xb'))(new Redis(config[_0x52e3('0x8')]));require(_0x52e3('0xc'))['register'](socket);function respondWithRpcPromise(_0x6090e5,_0x3b407d,_0x3c6075){return new BPromise(function(_0x33155f,_0x34d3aa){return client[_0x52e3('0xd')](_0x6090e5,_0x3c6075)[_0x52e3('0xe')](function(_0x596f70){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3b407d,_0x52e3('0xf'));logger[_0x52e3('0x10')](_0x52e3('0x11'),_0x3b407d,'request\x20sent',JSON[_0x52e3('0x12')](_0x596f70));if(_0x596f70[_0x52e3('0x13')]){if(_0x596f70['error'][_0x52e3('0x14')]===0x1f4){logger[_0x52e3('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3b407d,_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);return _0x34d3aa(_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);}logger[_0x52e3('0x13')](_0x52e3('0x16'),_0x3b407d,_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);return _0x33155f(_0x596f70[_0x52e3('0x13')][_0x52e3('0x15')]);}else{logger['info'](_0x52e3('0x16'),_0x3b407d,_0x52e3('0xf'));_0x33155f(_0x596f70[_0x52e3('0x17')][_0x52e3('0x15')]);}})[_0x52e3('0x18')](function(_0x13f26c){logger[_0x52e3('0x13')](_0x52e3('0x16'),_0x3b407d,_0x13f26c);_0x34d3aa(_0x13f26c);});});} \ No newline at end of file +var _0x7a59=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x31a418,_0x6c6e1d){var _0x29d7db=function(_0x1188cb){while(--_0x1188cb){_0x31a418['push'](_0x31a418['shift']());}};_0x29d7db(++_0x6c6e1d);}(_0x7a59,0x16e));var _0x97a5=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7a59[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97a5('0x1'));var rs=require(_0x97a5('0x2'));var fs=require('fs');var Redis=require(_0x97a5('0x3'));var db=require(_0x97a5('0x4'))['db'];var utils=require(_0x97a5('0x5'));var logger=require('../../config/logger')(_0x97a5('0x6'));var config=require(_0x97a5('0x7'));var jayson=require(_0x97a5('0x8'));var client=jayson['client'][_0x97a5('0x9')]({'port':0x232a});config[_0x97a5('0xa')]=_[_0x97a5('0xb')](config[_0x97a5('0xa')],{'host':_0x97a5('0xc'),'port':0x18eb});var socket=require(_0x97a5('0xd'))(new Redis(config[_0x97a5('0xa')]));require('./chatGroup.socket')[_0x97a5('0xe')](socket);function respondWithRpcPromise(_0x101c3f,_0xd70b51,_0x388bd7){return new BPromise(function(_0x1fc6b5,_0x4d93a5){return client['request'](_0x101c3f,_0x388bd7)[_0x97a5('0xf')](function(_0x41022d){logger[_0x97a5('0x10')]('ChatGroup,\x20%s,\x20%s',_0xd70b51,_0x97a5('0x11'));logger[_0x97a5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xd70b51,'request\x20sent',JSON[_0x97a5('0x13')](_0x41022d));if(_0x41022d[_0x97a5('0x14')]){if(_0x41022d['error']['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0xd70b51,_0x41022d[_0x97a5('0x14')][_0x97a5('0x15')]);return _0x4d93a5(_0x41022d[_0x97a5('0x14')]['message']);}logger[_0x97a5('0x14')](_0x97a5('0x16'),_0xd70b51,_0x41022d['error'][_0x97a5('0x15')]);return _0x1fc6b5(_0x41022d['error'][_0x97a5('0x15')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xd70b51,'request\x20sent');_0x1fc6b5(_0x41022d[_0x97a5('0x17')]['message']);}})[_0x97a5('0x18')](function(_0x9863ea){logger[_0x97a5('0x14')](_0x97a5('0x16'),_0xd70b51,_0x9863ea);_0x4d93a5(_0x9863ea);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b022f91..4235b10 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 _0xb024=['remove','emit','register','chatGroup:','./chatGroup.events','save'];(function(_0x241079,_0xe41011){var _0x882307=function(_0x544176){while(--_0x544176){_0x241079['push'](_0x241079['shift']());}};_0x882307(++_0xe41011);}(_0xb024,0x9a));var _0x4b02=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb024[_0x138adb];return _0x1b27f2;};'use strict';var ChatGroupEvents=require(_0x4b02('0x0'));var events=[_0x4b02('0x1'),_0x4b02('0x2'),'update'];function createListener(_0x5c8fa4,_0x3d8b8a){return function(_0x1e6e16){_0x3d8b8a[_0x4b02('0x3')](_0x5c8fa4,_0x1e6e16);};}function removeListener(_0x2017e9,_0x54dcd4){return function(){ChatGroupEvents['removeListener'](_0x2017e9,_0x54dcd4);};}exports[_0x4b02('0x4')]=function(_0x3425b6){for(var _0x35f8a6=0x0,_0x2a1fb7=events['length'];_0x35f8a6<_0x2a1fb7;_0x35f8a6++){var _0x5ab4fe=events[_0x35f8a6];var _0x3260c6=createListener(_0x4b02('0x5')+_0x5ab4fe,_0x3425b6);ChatGroupEvents['on'](_0x5ab4fe,_0x3260c6);}}; \ No newline at end of file +var _0x4027=['./chatGroup.events','remove','update','emit','removeListener','register','chatGroup:'];(function(_0x266954,_0x1f3324){var _0x234458=function(_0x438114){while(--_0x438114){_0x266954['push'](_0x266954['shift']());}};_0x234458(++_0x1f3324);}(_0x4027,0x1a4));var _0x7402=function(_0x1b5f29,_0x381c8d){_0x1b5f29=_0x1b5f29-0x0;var _0x3ff5d5=_0x4027[_0x1b5f29];return _0x3ff5d5;};'use strict';var ChatGroupEvents=require(_0x7402('0x0'));var events=['save',_0x7402('0x1'),_0x7402('0x2')];function createListener(_0x501b47,_0x5b634e){return function(_0x2c1047){_0x5b634e[_0x7402('0x3')](_0x501b47,_0x2c1047);};}function removeListener(_0x5870d9,_0x2a32e3){return function(){ChatGroupEvents[_0x7402('0x4')](_0x5870d9,_0x2a32e3);};}exports[_0x7402('0x5')]=function(_0xbe6f1d){for(var _0x57c49e=0x0,_0x307645=events['length'];_0x57c49e<_0x307645;_0x57c49e++){var _0x11ab91=events[_0x57c49e];var _0x59e8f0=createListener(_0x7402('0x6')+_0x11ab91,_0xbe6f1d);ChatGroupEvents['on'](_0x11ab91,_0x59e8f0);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0ba3584..baab954 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 _0x2439=['../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','/:id','getUnread','/:id/members','/:id/messages','post','create','addMembers','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x2439,0x169));var _0x9243=function(_0x1f76a4,_0x433129){_0x1f76a4=_0x1f76a4-0x0;var _0x1f515a=_0x2439[_0x1f76a4];return _0x1f515a;};'use strict';var multer=require(_0x9243('0x0'));var util=require('util');var path=require(_0x9243('0x1'));var timeout=require(_0x9243('0x2'));var express=require(_0x9243('0x3'));var router=express[_0x9243('0x4')]();var fs_extra=require(_0x9243('0x5'));var auth=require(_0x9243('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9243('0x7'));var controller=require(_0x9243('0x8'));router[_0x9243('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9243('0x9')](_0x9243('0xa'),auth[_0x9243('0xb')](),controller['describe']);router[_0x9243('0x9')](_0x9243('0xc'),auth[_0x9243('0xb')](),controller['show']);router[_0x9243('0x9')]('/:id/unread',auth[_0x9243('0xb')](),controller[_0x9243('0xd')]);router[_0x9243('0x9')](_0x9243('0xe'),auth[_0x9243('0xb')](),controller['getMembers']);router[_0x9243('0x9')](_0x9243('0xf'),auth[_0x9243('0xb')](),controller['getMessages']);router[_0x9243('0x10')]('/',auth[_0x9243('0xb')](),controller[_0x9243('0x11')]);router['post'](_0x9243('0xe'),auth['isAuthenticated'](),controller[_0x9243('0x12')]);router[_0x9243('0x10')](_0x9243('0xf'),auth[_0x9243('0xb')](),controller['addMessage']);router['put'](_0x9243('0xc'),auth[_0x9243('0xb')](),controller[_0x9243('0x13')]);router[_0x9243('0x14')](_0x9243('0xc'),auth['isAuthenticated'](),controller[_0x9243('0x15')]);router['delete'](_0x9243('0xe'),auth[_0x9243('0xb')](),controller['removeMembers']);module[_0x9243('0x16')]=router; \ No newline at end of file +var _0xbd3c=['getMembers','/:id/messages','getMessages','post','addMembers','addMessage','update','delete','removeMembers','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','/:id/members'];(function(_0x188130,_0x5cdfc2){var _0x4b61d8=function(_0x406a87){while(--_0x406a87){_0x188130['push'](_0x188130['shift']());}};_0x4b61d8(++_0x5cdfc2);}(_0xbd3c,0xe2));var _0xcbd3=function(_0x945da4,_0xdac38c){_0x945da4=_0x945da4-0x0;var _0x22f711=_0xbd3c[_0x945da4];return _0x22f711;};'use strict';var multer=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var path=require('path');var timeout=require(_0xcbd3('0x2'));var express=require('express');var router=express[_0xcbd3('0x3')]();var fs_extra=require(_0xcbd3('0x4'));var auth=require(_0xcbd3('0x5'));var interaction=require(_0xcbd3('0x6'));var config=require(_0xcbd3('0x7'));var controller=require(_0xcbd3('0x8'));router[_0xcbd3('0x9')]('/',auth[_0xcbd3('0xa')](),controller[_0xcbd3('0xb')]);router[_0xcbd3('0x9')](_0xcbd3('0xc'),auth[_0xcbd3('0xa')](),controller[_0xcbd3('0xd')]);router[_0xcbd3('0x9')](_0xcbd3('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xcbd3('0x9')](_0xcbd3('0xf'),auth['isAuthenticated'](),controller['getUnread']);router[_0xcbd3('0x9')](_0xcbd3('0x10'),auth['isAuthenticated'](),controller[_0xcbd3('0x11')]);router['get'](_0xcbd3('0x12'),auth[_0xcbd3('0xa')](),controller[_0xcbd3('0x13')]);router[_0xcbd3('0x14')]('/',auth[_0xcbd3('0xa')](),controller['create']);router[_0xcbd3('0x14')]('/:id/members',auth[_0xcbd3('0xa')](),controller[_0xcbd3('0x15')]);router['post'](_0xcbd3('0x12'),auth[_0xcbd3('0xa')](),controller[_0xcbd3('0x16')]);router['put'](_0xcbd3('0xe'),auth[_0xcbd3('0xa')](),controller[_0xcbd3('0x17')]);router[_0xcbd3('0x18')](_0xcbd3('0xe'),auth[_0xcbd3('0xa')](),controller['destroy']);router['delete'](_0xcbd3('0x10'),auth['isAuthenticated'](),controller[_0xcbd3('0x19')]);module[_0xcbd3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 8136d4e..65440b7 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 _0x337f=['TEXT','DATE','STRING','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x559528,_0x455857){var _0x567e33=function(_0xbc0b9f){while(--_0xbc0b9f){_0x559528['push'](_0x559528['shift']());}};_0x567e33(++_0x455857);}(_0x337f,0x11c));var _0xf337=function(_0x1eca98,_0x2621e9){_0x1eca98=_0x1eca98-0x0;var _0x1080bb=_0x337f[_0x1eca98];return _0x1080bb;};'use strict';var Sequelize=require(_0xf337('0x0'));module[_0xf337('0x1')]={'closed':{'type':Sequelize[_0xf337('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf337('0x3')](_0xf337('0x4'),_0xf337('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf337('0x6')]},'pathTranscript':{'type':Sequelize[_0xf337('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf337('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf337('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf337('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf337('0x8')]},'osVersion':{'type':Sequelize[_0xf337('0x8')]},'deviceModel':{'type':Sequelize[_0xf337('0x8')]},'deviceVendor':{'type':Sequelize[_0xf337('0x8')]},'deviceType':{'type':Sequelize[_0xf337('0x8')]},'referer':{'type':Sequelize[_0xf337('0x6')]},'customerIp':{'type':Sequelize[_0xf337('0x8')]},'formData':{'type':Sequelize[_0xf337('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xf337('0x7')]},'lastMsgAt':{'type':Sequelize[_0xf337('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xf337('0x3')]('in',_0xf337('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf337('0x8')]},'customerPort':{'type':Sequelize[_0xf337('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xf337('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf337('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x14b7=['TEXT','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0xa0778b,_0x16f4e9){var _0x409358=function(_0x411686){while(--_0x411686){_0xa0778b['push'](_0xa0778b['shift']());}};_0x409358(++_0x16f4e9);}(_0x14b7,0x144));var _0x714b=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0x14b7[_0x448ae2];return _0x4fdd34;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'closed':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x714b('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x714b('0x4'),_0x714b('0x5')),'defaultValue':_0x714b('0x4')},'ratingMessage':{'type':Sequelize[_0x714b('0x6')]},'pathTranscript':{'type':Sequelize[_0x714b('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x714b('0x7')]},'secondDisposition':{'type':Sequelize[_0x714b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x714b('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x714b('0x7')]},'browserVersion':{'type':Sequelize[_0x714b('0x7')]},'osName':{'type':Sequelize[_0x714b('0x7')]},'osVersion':{'type':Sequelize[_0x714b('0x7')]},'deviceModel':{'type':Sequelize[_0x714b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x714b('0x7')]},'referer':{'type':Sequelize[_0x714b('0x6')]},'customerIp':{'type':Sequelize[_0x714b('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x714b('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x714b('0x9')]('in',_0x714b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x714b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x714b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c9da3f0..2cb96f7 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 _0xb115=['Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','keys','hasOwnProperty','nolimit','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','pick','ChatInteractionId','includeAgent','push','alias','addTags','setTags','spread','Tag','color','emit','removeTags','unix','files','tmp','server','firstName','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','closedAt','toString','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','chat','query','user','catch','show','params','model','rawAttributes','filters','intersection','fields','attributes','include','options','create','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','%s%d','agentAlias','System','customer'];(function(_0x4436bc,_0x41d12c){var _0x5e1db5=function(_0x486824){while(--_0x486824){_0x4436bc['push'](_0x4436bc['shift']());}};_0x5e1db5(++_0x41d12c);}(_0xb115,0x128));var _0x5b11=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb115[_0x42cae2];return _0x5f256f;};'use strict';var rimraf=require(_0x5b11('0x0'));var zipdir=require(_0x5b11('0x1'));var rp=require(_0x5b11('0x2'));var moment=require('moment');var BPromise=require(_0x5b11('0x3'));var Mustache=require(_0x5b11('0x4'));var util=require(_0x5b11('0x5'));var path=require(_0x5b11('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b11('0x7'));var Redis=require(_0x5b11('0x8'));var interaction=require(_0x5b11('0x9'));var qs=require(_0x5b11('0xa'));var pdf=require(_0x5b11('0xb'));var logger=require('../../config/logger')(_0x5b11('0xc'));var config=require(_0x5b11('0xd'));var db=require(_0x5b11('0xe'))['db'];config[_0x5b11('0xf')]=_[_0x5b11('0x10')](config['redis'],{'host':_0x5b11('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5b11('0x12'))[_0x5b11('0x13')](socket);var jayson=require(_0x5b11('0x14'));var client=jayson[_0x5b11('0x15')][_0x5b11('0x16')]({'port':0x232b});var client9004=jayson[_0x5b11('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5bd839,_0x2e5c52,_0x42283b,_0x914f24){return new BPromise(function(_0x1890a4,_0x597c82){var _0x5413f3=_0x914f24||client;return _0x5413f3[_0x5b11('0x17')](_0x5bd839,_0x42283b)['then'](function(_0x4220b0){logger[_0x5b11('0x18')](_0x5b11('0x19'),_0x2e5c52,'request\x20sent');logger[_0x5b11('0x1a')](_0x5b11('0x1b'),_0x2e5c52,_0x5b11('0x1c'),JSON['stringify'](_0x4220b0));if(_0x4220b0[_0x5b11('0x1d')]){if(_0x4220b0[_0x5b11('0x1d')][_0x5b11('0x1e')]===0x1f4){logger[_0x5b11('0x1d')](_0x5b11('0x19'),_0x2e5c52,_0x4220b0['error'][_0x5b11('0x1f')]);return _0x597c82(_0x4220b0[_0x5b11('0x1d')][_0x5b11('0x1f')]);}logger['error'](_0x5b11('0x19'),_0x2e5c52,_0x4220b0[_0x5b11('0x1d')][_0x5b11('0x1f')]);return _0x1890a4(_0x4220b0['error'][_0x5b11('0x1f')]);}else{logger[_0x5b11('0x18')](_0x5b11('0x19'),_0x2e5c52,_0x5b11('0x1c'));_0x1890a4(_0x4220b0[_0x5b11('0x20')][_0x5b11('0x1f')]);}})['catch'](function(_0x3fb0d1){logger[_0x5b11('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2e5c52,_0x3fb0d1);_0x597c82(_0x3fb0d1);});});}function respondWithStatusCode(_0x4ab370,_0x113a4d){_0x113a4d=_0x113a4d||0xcc;return function(_0x49d27b){if(_0x49d27b){return _0x4ab370[_0x5b11('0x21')](_0x113a4d);}return _0x4ab370['status'](_0x113a4d)[_0x5b11('0x22')]();};}function respondWithResult(_0x1eace6,_0x3c4fd2){_0x3c4fd2=_0x3c4fd2||0xc8;return function(_0x210493){if(_0x210493){return _0x1eace6['status'](_0x3c4fd2)[_0x5b11('0x23')](_0x210493);}};}function respondWithFilteredResult(_0x4d1bc2,_0x1ef776){return function(_0x187cfc){if(_0x187cfc){var _0xa24dab=typeof _0x1ef776[_0x5b11('0x24')]===_0x5b11('0x25')&&typeof _0x1ef776[_0x5b11('0x26')]===_0x5b11('0x25');var _0x1ddf2c=_0x187cfc[_0x5b11('0x27')];var _0x439bd7=_0xa24dab?0x0:_0x1ef776[_0x5b11('0x24')];var _0xd2fba3=_0xa24dab?_0x187cfc[_0x5b11('0x27')]:_0x1ef776[_0x5b11('0x24')]+_0x1ef776[_0x5b11('0x26')];var _0x3ebb0b;if(_0xd2fba3>=_0x1ddf2c){_0xd2fba3=_0x1ddf2c;_0x3ebb0b=0xc8;}else{_0x3ebb0b=0xce;}_0x4d1bc2[_0x5b11('0x28')](_0x3ebb0b);return _0x4d1bc2[_0x5b11('0x29')](_0x5b11('0x2a'),_0x439bd7+'-'+_0xd2fba3+'/'+_0x1ddf2c)[_0x5b11('0x23')](_0x187cfc);}return null;};}function saveUpdates(_0x3e7d4b){return function(_0xec9883){if(_0xec9883){return _0xec9883[_0x5b11('0x2b')](_0x3e7d4b)[_0x5b11('0x2c')](function(_0xfb9cf8){return _0xfb9cf8;});}return null;};}function removeEntity(_0x3936dc){return function(_0x5a6a8e){if(_0x5a6a8e){return _0x5a6a8e[_0x5b11('0x2d')]()['then'](function(){_0x3936dc[_0x5b11('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x941c04){return function(_0x450b00){if(!_0x450b00){_0x941c04[_0x5b11('0x21')](0x194);}return _0x450b00;};}function handleError(_0xf94040,_0x288049){_0x288049=_0x288049||0x1f4;return function(_0x1effdb){logger[_0x5b11('0x1d')](_0x1effdb[_0x5b11('0x2e')]);if(_0x1effdb[_0x5b11('0x2f')]){delete _0x1effdb[_0x5b11('0x2f')];}_0xf94040['status'](_0x288049)[_0x5b11('0x30')](_0x1effdb);};}function getMustacheRender(_0xaa560d,_0x448ddd){return Mustache[_0x5b11('0x31')](_0xaa560d,_[_0x5b11('0x32')](_0x448ddd[_0x5b11('0x33')],{'contact':_0x448ddd[_0x5b11('0x34')],'message':_0x448ddd['message'],'agent':_0x448ddd[_0x5b11('0x35')],'interaction':_0x448ddd[_0x5b11('0x36')],'account':_0x448ddd[_0x5b11('0x37')]}))||'';}exports[_0x5b11('0x38')]=function(_0xd9b1a,_0x416e63){var _0x626f89={};var _0x5e0242=_[_0x5b11('0x39')](db[_0x5b11('0x3a')]['rawAttributes'],function(_0x2ed01f){return{'name':_0x2ed01f[_0x5b11('0x3b')],'type':_0x2ed01f[_0x5b11('0x3c')][_0x5b11('0x3d')]};});_0x626f89=qs['getOptions'](_0x5e0242,_0xd9b1a);return interaction['findAll'](_0x5b11('0x3e'),_0xd9b1a[_0x5b11('0x3f')],_0xd9b1a[_0x5b11('0x40')],_0x626f89,_0x5e0242)[_0x5b11('0x2c')](respondWithFilteredResult(_0x416e63,_0x626f89))[_0x5b11('0x41')](handleError(_0x416e63,null));};exports[_0x5b11('0x42')]=function(_0x38a599,_0x531697){var _0x418742={'raw':![],'where':{'id':_0x38a599[_0x5b11('0x43')]['id']}},_0x52aab2={};_0x52aab2[_0x5b11('0x44')]=_['keys'](db[_0x5b11('0x3a')][_0x5b11('0x45')]);_0x52aab2[_0x5b11('0x3f')]=_['keys'](_0x38a599[_0x5b11('0x3f')]);_0x52aab2[_0x5b11('0x46')]=_[_0x5b11('0x47')](_0x52aab2[_0x5b11('0x44')],_0x52aab2['query']);_0x418742['attributes']=_['intersection'](_0x52aab2[_0x5b11('0x44')],qs[_0x5b11('0x48')](_0x38a599[_0x5b11('0x3f')]['fields']));_0x418742[_0x5b11('0x49')]=_0x418742['attributes']['length']?_0x418742[_0x5b11('0x49')]:_0x52aab2[_0x5b11('0x44')];if(_0x38a599[_0x5b11('0x3f')]['includeAll']){_0x418742[_0x5b11('0x4a')]=[{'all':!![]}];}_0x418742=_['merge']({},_0x418742,_0x38a599[_0x5b11('0x4b')]);return db[_0x5b11('0x3a')]['find'](_0x418742)[_0x5b11('0x2c')](handleEntityNotFound(_0x531697,null))['then'](respondWithResult(_0x531697,null))[_0x5b11('0x41')](handleError(_0x531697,null));};exports[_0x5b11('0x4c')]=function(_0x1a4fc3,_0x4b787b){return db[_0x5b11('0x3a')][_0x5b11('0x4c')](_0x1a4fc3['body'],{})[_0x5b11('0x2c')](respondWithResult(_0x4b787b,0xc9))['catch'](handleError(_0x4b787b,null));};exports[_0x5b11('0x2b')]=function(_0x3008e5,_0x4336e6){if(_0x3008e5[_0x5b11('0x33')]['id']){delete _0x3008e5[_0x5b11('0x33')]['id'];}return db[_0x5b11('0x3a')][_0x5b11('0x4d')]({'where':{'id':_0x3008e5[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x4336e6,null))['then'](saveUpdates(_0x3008e5['body'],null))[_0x5b11('0x2c')](respondWithResult(_0x4336e6,null))[_0x5b11('0x41')](handleError(_0x4336e6,null));};exports[_0x5b11('0x2d')]=function(_0x81d03d,_0x2c5c6a){return db[_0x5b11('0x3a')]['find']({'where':{'id':_0x81d03d['params']['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x2c5c6a,null))[_0x5b11('0x2c')](removeEntity(_0x2c5c6a,null))[_0x5b11('0x41')](handleError(_0x2c5c6a,null));};exports[_0x5b11('0x4e')]=function(_0x1a892e,_0x5b5691){return db['ChatInteraction'][_0x5b11('0x4e')]()[_0x5b11('0x2c')](respondWithResult(_0x5b5691,null))[_0x5b11('0x41')](handleError(_0x5b5691,null));};exports['createVidaooSession']=function(_0x53c891,_0x212f0e){var _0x59acb3=_0x53c891[_0x5b11('0x43')]['id'];var _0x3a8b3f;var _0x2a7423;var _0x5647da;return db[_0x5b11('0x3a')][_0x5b11('0x4f')]({'where':{'id':_0x59acb3}})[_0x5b11('0x2c')](function(_0x5ad487){_0x3a8b3f=_0x5ad487;return db[_0x5b11('0x50')]['findOne']({'where':{'id':_0x5ad487[_0x5b11('0x51')]},'attributes':['id',_0x5b11('0x52'),_0x5b11('0x53'),_0x5b11('0x54'),_0x5b11('0x55'),_0x5b11('0x56')],'raw':!![]});})[_0x5b11('0x2c')](function(_0x445784){if(_0x445784&&_0x445784[_0x5b11('0x52')]&&_0x445784[_0x5b11('0x53')]){_0x2a7423=_0x445784;var _0x591cca={'interaction':{'id':_0x59acb3},'agent':{'id':_0x53c891[_0x5b11('0x40')]['id'],'name':_0x53c891['user'][_0x5b11('0x2f')],'fullname':_0x53c891['user'][_0x5b11('0x57')],'email':_0x53c891[_0x5b11('0x40')][_0x5b11('0x58')]},'contact':_0x53c891[_0x5b11('0x33')]['contact'],'account':_0x53c891[_0x5b11('0x33')][_0x5b11('0x37')]};var _0x51b6f8={'rejectUnauthorized':![],'method':_0x5b11('0x59'),'url':_0x5b11('0x5a'),'headers':{'X-APIKEY':_0x445784[_0x5b11('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53c891['user'][_0x5b11('0x58')]],'buttons':null,'topic':_0x2a7423['vidaooTopic'],'note':_['isNull'](_0x2a7423['vidaooNote'])?null:getMustacheRender(_0x2a7423[_0x5b11('0x55')],_0x591cca),'metadata':null},'redirect':_0x5b11('0x5b'),'json':!![]};try{if(!_[_0x5b11('0x5c')](_0x2a7423[_0x5b11('0x56')])){var _0xc41866=getMustacheRender(_0x2a7423[_0x5b11('0x56')],_0x591cca);var _0x14ca43=JSON[_0x5b11('0x5d')](_0xc41866);_0x51b6f8[_0x5b11('0x33')]['metadata']=_0x14ca43;}}catch(_0x39d2d5){throw new db[(_0x5b11('0x5e'))]['ValidationError'](_0x5b11('0x5f'));}return rp(_0x51b6f8);}else{throw new db[(_0x5b11('0x5e'))][(_0x5b11('0x60'))](_0x5b11('0x61'));}})[_0x5b11('0x2c')](function(_0x412904){_0x5647da=_0x412904;if(_0x5647da['id']){var _0x594b59={'body':_0x5647da[_0x5b11('0x62')],'ChatWebsiteId':_0x2a7423['id'],'ChatInteractionId':_0x3a8b3f['id'],'direction':'out','UserId':_0x53c891[_0x5b11('0x40')]['id']};return db[_0x5b11('0x63')][_0x5b11('0x4c')](_0x594b59,{});}else{throw new db[(_0x5b11('0x5e'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x5b11('0x2c')](function(){return _0x3a8b3f[_0x5b11('0x64')]({'vidaooSessionId':_0x5647da['id']});})['then'](respondWithResult(_0x212f0e,null))['catch'](handleError(_0x212f0e,null));};exports[_0x5b11('0x65')]=function(_0x500383,_0x53f5cd){if(_0x500383[_0x5b11('0x33')]['id']){delete _0x500383[_0x5b11('0x33')]['id'];}return db['ChatInteraction'][_0x5b11('0x4d')]({'where':{'id':_0x500383[_0x5b11('0x43')]['id']},'include':[{'model':db[_0x5b11('0x66')],'as':_0x5b11('0x67')}]})[_0x5b11('0x2c')](handleEntityNotFound(_0x53f5cd,null))[_0x5b11('0x2c')](saveUpdates(_0x500383[_0x5b11('0x33')],null))[_0x5b11('0x2c')](respondWithResult(_0x53f5cd,null))[_0x5b11('0x41')](handleError(_0x53f5cd,null));};exports[_0x5b11('0x68')]=function(_0x570ca2,_0x35ffc0){if(_0x570ca2[_0x5b11('0x33')]['id']){delete _0x570ca2['body']['id'];}return db[_0x5b11('0x3a')]['find']({'where':{'id':_0x570ca2[_0x5b11('0x43')]['id']}})['then'](function(_0xba8549){if(!_0xba8549){logger['error'](_0x5b11('0x69'),'abandon',0x194,_0x5b11('0x6a'));_0x35ffc0[_0x5b11('0x21')](0x194);}else{if(_0xba8549[_0x5b11('0x6b')]){throw new db[(_0x5b11('0x5e'))][(_0x5b11('0x60'))]('Interaction\x20already\x20assigned');}}return _0xba8549;})[_0x5b11('0x2c')](function(_0x510583){if(_0x510583){return _0x510583[_0x5b11('0x2b')]({'closed':_0x570ca2[_0x5b11('0x33')][_0x5b11('0x6c')],'disposition':_0x570ca2[_0x5b11('0x33')][_0x5b11('0x6d')]})[_0x5b11('0x2c')](function(_0x4333b6){return _0x4333b6;});}})[_0x5b11('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction',_0x5b11('0x68'),_0x570ca2[_0x5b11('0x33')],client9004);})[_0x5b11('0x2c')](respondWithResult(_0x35ffc0,null))['catch'](handleError(_0x35ffc0,null));};exports[_0x5b11('0x6e')]=function(_0x23d4a5,_0x3c8a60){_0x23d4a5[_0x5b11('0x33')][_0x5b11('0x2f')]=_0x23d4a5[_0x5b11('0x6f')][_0x5b11('0x70')];_0x23d4a5[_0x5b11('0x33')]['basename']=_0x23d4a5['file'][_0x5b11('0x71')];_0x23d4a5['body'][_0x5b11('0x3c')]=_0x23d4a5[_0x5b11('0x6f')][_0x5b11('0x72')];return db[_0x5b11('0x73')][_0x5b11('0x4c')](_0x23d4a5[_0x5b11('0x33')])[_0x5b11('0x2c')](respondWithResult(_0x3c8a60,0xc9))['catch'](handleError(_0x3c8a60,null));};exports[_0x5b11('0x74')]=function(_0x6c6c0f,_0x2f2946){return db[_0x5b11('0x3a')]['findOne']({'where':{'id':_0x6c6c0f[_0x5b11('0x43')]['id']},'raw':!![]})[_0x5b11('0x2c')](handleEntityNotFound(_0x2f2946,null))[_0x5b11('0x2c')](function(_0x4e6368){if(_0x4e6368){if(_0x4e6368[_0x5b11('0x6c')]){return _0x2f2946[_0x5b11('0x28')](0x193)[_0x5b11('0x23')]({'status':0x193,'message':_0x5b11('0x75')});}return db[_0x5b11('0x73')][_0x5b11('0x4f')]({'where':{'id':_0x6c6c0f[_0x5b11('0x3f')][_0x5b11('0x76')]},'raw':!![]})[_0x5b11('0x2c')](handleEntityNotFound(_0x2f2946,null));}})[_0x5b11('0x2c')](function(_0x9f39a1){if(_0x9f39a1){var _0x1180d3=_0x9f39a1['ChatOfflineMessageId']!==null;var _0x43136c=path[_0x5b11('0x77')](config[_0x5b11('0x78')],_0x5b11('0x79'));if(_0x1180d3){_0x43136c=path[_0x5b11('0x77')](_0x43136c,_0x5b11('0x7a'));}var _0x459a22=path[_0x5b11('0x77')](_0x43136c,_0x9f39a1[_0x5b11('0x7b')]);return _0x2f2946[_0x5b11('0x7c')](_0x459a22);}})['catch'](handleError(_0x2f2946,null));};exports[_0x5b11('0x7d')]=function(_0x3fd52d,_0x149ff1){var _0x459fbf=null;var _0x465030=null;var _0x30b6dd=null;if(_0x3fd52d[_0x5b11('0x33')]['id']){delete _0x3fd52d[_0x5b11('0x33')]['id'];}if(_0x3fd52d[_0x5b11('0x33')][_0x5b11('0x7e')]){_0x30b6dd=path[_0x5b11('0x77')](config['root'],'server/files/chat/upload/',util[_0x5b11('0x7f')](_0x5b11('0x80'),Date[_0x5b11('0x81')]()));_0x3fd52d['body'][_0x5b11('0x82')]=_0x30b6dd;}return db[_0x5b11('0x3a')][_0x5b11('0x4d')]({'where':{'id':_0x3fd52d['params']['id']},'include':[{'model':db[_0x5b11('0x63')],'as':'Messages','include':[{'model':db[_0x5b11('0x83')],'as':'User'}]}]})[_0x5b11('0x2c')](handleEntityNotFound(_0x149ff1,null))[_0x5b11('0x2c')](saveUpdates(_0x3fd52d[_0x5b11('0x33')],null))['then'](function(_0x3a2b24){if(_0x3a2b24){_0x459fbf=_0x3a2b24;return db[_0x5b11('0x50')][_0x5b11('0x4d')]({'where':{'id':_0x459fbf['ChatWebsiteId']}});}})['then'](function(_0x5a6c5b){if(_0x5a6c5b){_0x465030=_0x5a6c5b;return db[_0x5b11('0x66')][_0x5b11('0x4d')]({'where':{'id':_0x459fbf[_0x5b11('0x84')]}});}})[_0x5b11('0x2c')](function(_0x1f3adb){if(_0x1f3adb){if(_0x30b6dd){var _0x285ec9=null;for(var _0x433233=0x1;_0x433233<_0x459fbf[_0x5b11('0x85')]['length'];++_0x433233){_0x285ec9=_0x459fbf[_0x5b11('0x85')][_0x433233];var _0x20f084=_0x285ec9[_0x5b11('0x6b')]?util[_0x5b11('0x7f')](_0x5b11('0x86'),_0x465030[_0x5b11('0x87')],_0x285ec9['UserId']):_0x5b11('0x88');var _0x6c9e1d=_0x3fd52d[_0x5b11('0x33')][_0x5b11('0x89')]||util['format'](_0x5b11('0x86'),_0x5b11('0x8a'),_0x285ec9[_0x5b11('0x84')]);switch(_0x465030[_0x5b11('0x8b')]){case _0x5b11('0x8c'):_0x20f084=_0x285ec9['UserId']?util[_0x5b11('0x7f')](_0x5b11('0x86'),_0x465030[_0x5b11('0x87')],_0x285ec9[_0x5b11('0x6b')]):_0x5b11('0x88');break;case _0x5b11('0x8d'):_0x20f084=_0x285ec9['UserId']?_0x285ec9[_0x5b11('0x83')]['alias']||_0x285ec9['User'][_0x5b11('0x57')]:_0x5b11('0x88');break;case _0x5b11('0x8e'):_0x20f084=_0x285ec9[_0x5b11('0x6b')]?_0x285ec9['User'][_0x5b11('0x57')]:'System';break;default:_0x20f084=_0x285ec9[_0x5b11('0x6b')]?util[_0x5b11('0x7f')](_0x5b11('0x86'),_0x465030[_0x5b11('0x87')],_0x285ec9[_0x5b11('0x6b')]):_0x5b11('0x88');}var _0x5ac06c=util[_0x5b11('0x7f')](_0x5b11('0x8f'),moment(_0x285ec9[_0x5b11('0x90')])[_0x5b11('0x7f')](_0x5b11('0x91')),_0x285ec9[_0x5b11('0x92')]==='in'?_0x6c9e1d:_0x20f084,_0x285ec9['body']);if(!_0x285ec9[_0x5b11('0x93')]){fs[_0x5b11('0x94')](_0x30b6dd,_0x5ac06c);}}return db['MailAccount'][_0x5b11('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x5b11('0x95')],'as':_0x5b11('0x96'),'raw':!![],'include':[{'model':db[_0x5b11('0x97')],'as':_0x5b11('0x97'),'raw':!![]}]}]});}}})[_0x5b11('0x2c')](function(_0x255f66){if(!_0x255f66||!_0x255f66['Smtp']||!_0x3fd52d[_0x5b11('0x33')])return _0x459fbf;var _0x213c97=_0x255f66[_0x5b11('0x98')]();return respondWithRpcPromise(_0x5b11('0x99'),_0x5b11('0x9a'),{'account':_0x213c97,'message':{'from':util[_0x5b11('0x7f')](_0x5b11('0x9b'),_0x255f66[_0x5b11('0x2f')],_0x255f66[_0x5b11('0x58')]||_0x255f66['Smtp'][_0x5b11('0x40')]),'to':_0x3fd52d[_0x5b11('0x33')][_0x5b11('0x7e')],'subject':_0x5b11('0x9c'),'text':util[_0x5b11('0x7f')](_0x5b11('0x9d'),_0x3fd52d['body'][_0x5b11('0x7e')]),'attachments':[{'path':_0x30b6dd}]}})['then'](function(){return _0x459fbf;})[_0x5b11('0x41')](function(_0x30a092){logger[_0x5b11('0x1d')](_0x30a092);});})[_0x5b11('0x2c')](respondWithStatusCode(_0x149ff1,0xc8))[_0x5b11('0x41')](handleError(_0x149ff1,null));};exports['addMessage']=function(_0x5f707e,_0x5c97e0){return db['ChatMessage'][_0x5b11('0x4d')]({'where':{'id':_0x5f707e[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x5c97e0,null))['then'](function(_0x46d874){if(_0x46d874){return _0x46d874[_0x5b11('0x9e')](_0x5f707e[_0x5b11('0x33')][_0x5b11('0x9f')],_[_0x5b11('0xa0')](_0x5f707e['body'],[_0x5b11('0x9f'),'id'])||{});}})[_0x5b11('0x2c')](respondWithResult(_0x5c97e0,null))['catch'](handleError(_0x5c97e0,null));};exports[_0x5b11('0xa1')]=function(_0x51975c,_0x4f9018){var _0x553784={'raw':![],'where':{}};var _0x2fdeb6={};var _0x162f8c={'count':0x0,'rows':[]};return db[_0x5b11('0x3a')][_0x5b11('0x4f')]({'where':{'id':_0x51975c['params']['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x4f9018,null))['then'](function(_0x152b61){if(_0x152b61){_0x2fdeb6['model']=_[_0x5b11('0xa2')](db[_0x5b11('0x63')][_0x5b11('0x45')]);_0x2fdeb6['query']=_[_0x5b11('0xa2')](_0x51975c['query']);_0x2fdeb6['filters']=_[_0x5b11('0x47')](_0x2fdeb6[_0x5b11('0x44')],_0x2fdeb6[_0x5b11('0x3f')]);_0x553784['attributes']=_[_0x5b11('0x47')](_0x2fdeb6[_0x5b11('0x44')],qs[_0x5b11('0x48')](_0x51975c['query'][_0x5b11('0x48')]));_0x553784[_0x5b11('0x49')]=_0x553784[_0x5b11('0x49')]['length']?_0x553784[_0x5b11('0x49')]:_0x2fdeb6[_0x5b11('0x44')];if(!_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa3')](_0x5b11('0xa4'))){_0x553784[_0x5b11('0x26')]=qs[_0x5b11('0x26')](_0x51975c[_0x5b11('0x3f')][_0x5b11('0x26')]);_0x553784[_0x5b11('0x24')]=qs[_0x5b11('0x24')](_0x51975c[_0x5b11('0x3f')][_0x5b11('0x24')]);}_0x553784[_0x5b11('0xa5')]=qs[_0x5b11('0xa6')](_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa6')]);_0x553784[_0x5b11('0xa7')]=qs[_0x5b11('0x46')](_['pick'](_0x51975c[_0x5b11('0x3f')],_0x2fdeb6[_0x5b11('0x46')]));_0x553784['where']['ChatInteractionId']=_0x152b61['id'];if(_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa8')]){_0x553784['where']=_[_0x5b11('0x32')](_0x553784[_0x5b11('0xa7')],{'$or':_[_0x5b11('0x39')](_0x553784['attributes'],function(_0x47ca23){var _0x17d2b1={};_0x17d2b1[_0x47ca23]={'$like':'%'+_0x51975c['query'][_0x5b11('0xa8')]+'%'};return _0x17d2b1;})});}if(_0x51975c[_0x5b11('0x3f')][_0x5b11('0xa9')]){var _0xa761fd=_0x51975c[_0x5b11('0x3f')]['$gte'][_0x5b11('0xaa')](',');var _0x5207f1={};_0x5207f1[_0xa761fd[0x0]]={'$gte':moment(_0xa761fd[0x1])[_0x5b11('0x7f')](_0x5b11('0xab'))};_0x553784['where']=_[_0x5b11('0x32')](_0x553784[_0x5b11('0xa7')],_0x5207f1);}_0x553784=_[_0x5b11('0x32')]({},_0x553784,_0x51975c[_0x5b11('0x4b')]);return db[_0x5b11('0x63')]['count']({'where':_0x553784['where']})[_0x5b11('0x2c')](function(_0x370e6a){_0x162f8c[_0x5b11('0x27')]=_0x370e6a;if(_0x51975c[_0x5b11('0x3f')][_0x5b11('0xac')]){_0x553784['include']=[{'all':!![]}];}return db[_0x5b11('0x63')][_0x5b11('0xad')](_0x553784);})['then'](function(_0x562f8a){_0x162f8c['rows']=_0x562f8a;return _0x162f8c;});}})['then'](respondWithFilteredResult(_0x4f9018,_0x553784))[_0x5b11('0x41')](handleError(_0x4f9018,null));};exports['getMyMessages']=function(_0x383bfd,_0x2ec3fa){var _0x56e176={'where':{}},_0x352274={},_0x4896ab={'count':0x0,'rows':[]};return db[_0x5b11('0x3a')][_0x5b11('0x4f')]({'where':{'id':_0x383bfd[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x2ec3fa,null))['then'](function(_0xb0ba21){if(_0xb0ba21){_0x352274[_0x5b11('0x44')]=_[_0x5b11('0xa2')](db['ChatMessage'][_0x5b11('0x45')]);_0x352274[_0x5b11('0x3f')]=_['keys'](_0x383bfd[_0x5b11('0x3f')]);_0x352274[_0x5b11('0x46')]=_['intersection'](_0x352274[_0x5b11('0x44')],_0x352274['query']);_0x56e176[_0x5b11('0x49')]=_[_0x5b11('0x47')](_0x352274['model'],qs[_0x5b11('0x48')](_0x383bfd[_0x5b11('0x3f')][_0x5b11('0x48')]));_0x56e176[_0x5b11('0x49')]=_0x56e176['attributes']['length']?_0x56e176[_0x5b11('0x49')]:_0x352274[_0x5b11('0x44')];if(!_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xa3')]('nolimit')){_0x56e176[_0x5b11('0x26')]=qs[_0x5b11('0x26')](_0x383bfd[_0x5b11('0x3f')][_0x5b11('0x26')]);_0x56e176[_0x5b11('0x24')]=qs[_0x5b11('0x24')](_0x383bfd[_0x5b11('0x3f')][_0x5b11('0x24')]);}_0x56e176['order']=qs['sort'](_0x383bfd['query']['sort']);_0x56e176[_0x5b11('0xa7')]=qs['filters'](_[_0x5b11('0xae')](_0x383bfd[_0x5b11('0x3f')],_0x352274[_0x5b11('0x46')]));_0x56e176[_0x5b11('0xa7')][_0x5b11('0xaf')]=_0xb0ba21['id'];if(_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xa8')]){_0x56e176['where']=_['merge'](_0x56e176[_0x5b11('0xa7')],{'$or':_['map'](_0x56e176['attributes'],function(_0xeef9b9){var _0x163d91={};_0x163d91[_0xeef9b9]={'$like':'%'+_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xa8')]+'%'};return _0x163d91;})});}_0x56e176[_0x5b11('0xa7')]['secret']=![];if(_0x383bfd[_0x5b11('0x3f')]['id']){_0x56e176[_0x5b11('0xa7')]['id']={'$gt':_0x383bfd[_0x5b11('0x3f')]['id']};}_0x56e176=_['merge']({},_0x56e176,_0x383bfd[_0x5b11('0x4b')]);return db[_0x5b11('0x63')]['count']({'where':_0x56e176['where']})[_0x5b11('0x2c')](function(_0x44093e){_0x4896ab[_0x5b11('0x27')]=_0x44093e;_0x56e176['include']=[];if(_0x383bfd[_0x5b11('0x3f')][_0x5b11('0xb0')]){_0x56e176['include'][_0x5b11('0xb1')]({'model':db[_0x5b11('0x83')],'as':'User','attributes':['id',_0x5b11('0x57'),_0x5b11('0xb2')]});}if(_0x383bfd['query'][_0x5b11('0xac')]){_0x56e176['include']=[{'all':!![]}];}return db[_0x5b11('0x63')][_0x5b11('0xad')](_0x56e176);})[_0x5b11('0x2c')](function(_0x529f79){_0x4896ab['rows']=_0x529f79;return _0x4896ab;});}})['then'](respondWithFilteredResult(_0x2ec3fa,_0x56e176))[_0x5b11('0x41')](handleError(_0x2ec3fa,null));};exports[_0x5b11('0xb3')]=function(_0x4d70b0,_0x5dda19){return db['ChatInteraction'][_0x5b11('0x4d')]({'where':{'id':_0x4d70b0[_0x5b11('0x43')]['id']}})[_0x5b11('0x2c')](handleEntityNotFound(_0x5dda19,null))[_0x5b11('0x2c')](function(_0x11134a){if(_0x11134a){return _0x11134a[_0x5b11('0xb4')](_0x4d70b0[_0x5b11('0x33')][_0x5b11('0x9f')],_[_0x5b11('0xa0')](_0x4d70b0[_0x5b11('0x33')],[_0x5b11('0x9f'),'id'])||{})[_0x5b11('0xb5')](function(){return db[_0x5b11('0xb6')][_0x5b11('0xad')]({'attributes':['id',_0x5b11('0x2f'),_0x5b11('0xb7')],'where':{'id':_0x4d70b0[_0x5b11('0x33')][_0x5b11('0x9f')]}});})[_0x5b11('0x2c')](function(_0x2e62d3){socket[_0x5b11('0xb8')]('chatInteractionTags:save',{'id':Number(_0x4d70b0[_0x5b11('0x43')]['id']),'tags':_0x2e62d3||[]});return{'id':Number(_0x4d70b0[_0x5b11('0x43')]['id']),'tags':_0x2e62d3||[]};});}})['then'](respondWithResult(_0x5dda19,null))['catch'](handleError(_0x5dda19,null));};exports[_0x5b11('0xb9')]=function(_0x5c6015,_0x1c0c59){return db[_0x5b11('0x3a')][_0x5b11('0x4d')]({'where':{'id':_0x5c6015['params']['id']}})['then'](handleEntityNotFound(_0x1c0c59,null))[_0x5b11('0x2c')](function(_0x3a6658){if(_0x3a6658){return _0x3a6658[_0x5b11('0xb9')](_0x5c6015[_0x5b11('0x3f')][_0x5b11('0x9f')]);}})[_0x5b11('0x2c')](respondWithStatusCode(_0x1c0c59,null))[_0x5b11('0x41')](handleError(_0x1c0c59,null));};exports[_0x5b11('0x7c')]=function(_0x57339f,_0x27e8ab){var _0x31acaf=moment()[_0x5b11('0xba')]()['toString']();var _0x403a70=path[_0x5b11('0x77')](config[_0x5b11('0x78')],'server',_0x5b11('0xbb'),_0x5b11('0xbc'));var _0x92cbf3=path[_0x5b11('0x77')](config['root'],_0x5b11('0xbd'),_0x5b11('0xbb'),'attachments');var _0x4bdd1c=path[_0x5b11('0x77')](_0x403a70,_0x31acaf);var _0x4f3e69=util['format']('transcript-%d-%s.zip',_0x57339f[_0x5b11('0x43')]['id'],_0x31acaf);var _0x403ebd=path[_0x5b11('0x77')](_0x403a70,_0x4f3e69);var _0x4a6636=[];_0x4a6636[_0x5b11('0xb1')]({'model':db[_0x5b11('0x83')],'as':_0x5b11('0x83'),'attributes':['id',_0x5b11('0x57')],'raw':!![]});_0x4a6636[_0x5b11('0xb1')]({'model':db[_0x5b11('0x66')],'as':_0x5b11('0x67'),'attributes':['id',_0x5b11('0xbe'),_0x5b11('0xbf')],'raw':!![]});if(_0x57339f[_0x5b11('0x3f')][_0x5b11('0xc0')]){_0x4a6636[_0x5b11('0xb1')]({'model':db[_0x5b11('0x73')],'as':_0x5b11('0x73'),'raw':!![]});}var _0xe33f31=[{'model':db[_0x5b11('0x63')],'as':_0x5b11('0x85'),'attributes':['id',_0x5b11('0x33'),_0x5b11('0x90'),_0x5b11('0x92'),_0x5b11('0x93'),_0x5b11('0xc1')],'include':_0x4a6636}];_0xe33f31[_0x5b11('0xb1')]({'model':db['ChatWebsite'],'as':_0x5b11('0xc2'),'attributes':['id',_0x5b11('0x2f')]});_0xe33f31['push']({'model':db['User'],'as':_0x5b11('0xc3'),'attributes':['id',_0x5b11('0x57')]});return db[_0x5b11('0x3a')]['find']({'where':{'id':_0x57339f[_0x5b11('0x43')]['id']},'include':_0xe33f31})[_0x5b11('0x2c')](handleEntityNotFound(_0x27e8ab,null))[_0x5b11('0x2c')](function(_0x55d213){if(_0x55d213){var _0x2f9dff=_0x55d213[_0x5b11('0xc4')]({'plain':!![]});fs[_0x5b11('0xc5')](_0x4bdd1c);var _0x362ce1={'channel':_0x5b11('0xc6'),'account':_0x2f9dff['Account'][_0x5b11('0x2f')],'agent':_0x2f9dff[_0x5b11('0xc3')]?_0x2f9dff[_0x5b11('0xc3')]['fullname']:'N.A.','createdAt':moment(_0x2f9dff[_0x5b11('0x90')])[_0x5b11('0x7f')](_0x5b11('0xab'))['toString'](),'closedAt':_0x2f9dff[_0x5b11('0x6c')]?moment(_0x2f9dff[_0x5b11('0xc7')])[_0x5b11('0x7f')](_0x5b11('0xab'))[_0x5b11('0xc8')]():'','disposition':_0x2f9dff[_0x5b11('0x6d')],'chatInfo':{'browser':_0x2f9dff['browserName'],'os':_0x2f9dff['osName'],'referer':_0x2f9dff[_0x5b11('0xc9')],'customerIp':_0x2f9dff['customerIp'],'customerPort':_0x2f9dff['customerPort']?_0x2f9dff[_0x5b11('0xca')]:_0x5b11('0xcb')},'messages':_(_0x2f9dff[_0x5b11('0x85')])[_0x5b11('0xcc')]()[_0x5b11('0xa8')]({'secret':![]})[_0x5b11('0x39')](function(_0x4b2304){if(_0x4b2304[_0x5b11('0x73')]){var _0x5b9305=path[_0x5b11('0x77')](_0x92cbf3,_0x4b2304[_0x5b11('0x73')][_0x5b11('0x7b')]);if(fs[_0x5b11('0xcd')](_0x5b9305)){fs[_0x5b11('0xce')](_0x5b9305)[_0x5b11('0xcf')](fs['createWriteStream'](path[_0x5b11('0x77')](_0x4bdd1c,_0x4b2304[_0x5b11('0x73')][_0x5b11('0x7b')])));}}return{'date':moment(_0x4b2304[_0x5b11('0x90')])[_0x5b11('0x7f')](_0x5b11('0xab'))[_0x5b11('0xc8')](),'sender':_0x4b2304[_0x5b11('0x92')]===_0x5b11('0xd0')?_0x4b2304[_0x5b11('0x83')]?_0x4b2304[_0x5b11('0x83')][_0x5b11('0x57')]:'System':_0x4b2304[_0x5b11('0x67')][_0x5b11('0xbe')]+(_0x4b2304[_0x5b11('0x67')][_0x5b11('0xbf')]?'\x20'+_0x4b2304['Contact'][_0x5b11('0xbf')]:''),'body':_0x4b2304[_0x5b11('0x73')]?_0x4b2304[_0x5b11('0x73')]['basename']:_0x4b2304[_0x5b11('0x33')],'direction':_0x4b2304['direction']===_0x5b11('0xd0')?'A':'C','secret':_0x4b2304[_0x5b11('0x93')],'read':_0x4b2304['read'],'attachment':_0x4b2304[_0x5b11('0x73')]};})[_0x5b11('0xd1')]()};return ejs[_0x5b11('0xd2')](path[_0x5b11('0x77')](config[_0x5b11('0x78')],_0x5b11('0xbd'),_0x5b11('0xd3'),_0x5b11('0xd4')),{'interaction':_0x362ce1})['then'](function(_0x1a2b2b){var _0x42b507=path['join'](_0x4bdd1c,_0x5b11('0xd5')+_0x2f9dff['id']+'-'+_0x31acaf+_0x5b11('0xd6'));var _0x297b02={'path':_0x42b507,'channel':'Chat','interactionId':_0x2f9dff['id']};return pdf[_0x5b11('0xd7')](_0x1a2b2b,_0x297b02);})[_0x5b11('0x2c')](function(){return new Promise(function(_0x53df7e,_0x37dea2){zipdir(_0x4bdd1c,{'saveTo':_0x403ebd},function(_0x5409de,_0x4f43bf){if(_0x5409de)return _0x37dea2(_0x5409de);return _0x53df7e(_0x4f43bf);});})[_0x5b11('0x2c')](function(){return new BPromise(function(_0x4afc5c,_0x17c8e7){rimraf(_0x4bdd1c,function(_0x2e0dd1){if(_0x2e0dd1)_0x17c8e7(_0x2e0dd1);return _0x4afc5c();});});})['then'](function(){return _0x27e8ab['download'](_0x403ebd,_0x4f3e69,function(_0x168b7a){if(_0x168b7a){logger[_0x5b11('0x1d')](_0x5b11('0xd8'),_0x168b7a);}else{fs['unlinkSync'](_0x403ebd);}});});});}else{return _0x27e8ab[_0x5b11('0x21')](0xc8);}})[_0x5b11('0x41')](handleError(_0x27e8ab,null));}; \ No newline at end of file +var _0xc4f2=['error','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','stack','name','render','body','agent','account','index','map','rawAttributes','fieldName','key','getOptions','findAll','query','user','show','model','keys','filters','intersection','fields','attributes','length','includeAll','include','ChatInteraction','find','create','update','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','isNull','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','format','now','User','ChatWebsiteId','CmContact','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','Smtp','CloudProvider','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','order','sort','where','ChatInteractionId','filter','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','hasOwnProperty','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','push','firstName','lastName','attachments','createdAt','read','Owner','Chat','Account','N.A.','toString','closedAt','browserName','osName','referer','customerIp','tail','existsSync','createReadStream','createWriteStream','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30f125,_0x23c2f0){var _0x50df9a=function(_0x451a50){while(--_0x451a50){_0x30f125['push'](_0x30f125['shift']());}};_0x50df9a(++_0x23c2f0);}(_0xc4f2,0x17b));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x2c4f('0x0'));var zipdir=require(_0x2c4f('0x1'));var rp=require(_0x2c4f('0x2'));var moment=require(_0x2c4f('0x3'));var BPromise=require(_0x2c4f('0x4'));var Mustache=require('mustache');var util=require(_0x2c4f('0x5'));var path=require(_0x2c4f('0x6'));var ejs=require(_0x2c4f('0x7'));var fs=require('fs');var _=require(_0x2c4f('0x8'));var Redis=require(_0x2c4f('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0x2c4f('0xa'));var pdf=require(_0x2c4f('0xb'));var logger=require(_0x2c4f('0xc'))(_0x2c4f('0xd'));var config=require(_0x2c4f('0xe'));var db=require(_0x2c4f('0xf'))['db'];config[_0x2c4f('0x10')]=_[_0x2c4f('0x11')](config[_0x2c4f('0x10')],{'host':_0x2c4f('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c4f('0x10')]));require('./chatInteraction.socket')[_0x2c4f('0x13')](socket);var jayson=require(_0x2c4f('0x14'));var client=jayson[_0x2c4f('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x2c4f('0x15')][_0x2c4f('0x16')]({'port':0x232c});function respondWithRpcPromise(_0xa2aa23,_0x20b204,_0x3f52b2,_0x2d034c){return new BPromise(function(_0x1bede9,_0x189ef2){var _0x2a6165=_0x2d034c||client;return _0x2a6165[_0x2c4f('0x17')](_0xa2aa23,_0x3f52b2)[_0x2c4f('0x18')](function(_0xef5008){logger[_0x2c4f('0x19')](_0x2c4f('0x1a'),_0x20b204,_0x2c4f('0x1b'));logger[_0x2c4f('0x1c')](_0x2c4f('0x1d'),_0x20b204,_0x2c4f('0x1b'),JSON[_0x2c4f('0x1e')](_0xef5008));if(_0xef5008[_0x2c4f('0x1f')]){if(_0xef5008[_0x2c4f('0x1f')]['code']===0x1f4){logger[_0x2c4f('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x20b204,_0xef5008[_0x2c4f('0x1f')][_0x2c4f('0x20')]);return _0x189ef2(_0xef5008[_0x2c4f('0x1f')][_0x2c4f('0x20')]);}logger[_0x2c4f('0x1f')](_0x2c4f('0x1a'),_0x20b204,_0xef5008[_0x2c4f('0x1f')]['message']);return _0x1bede9(_0xef5008[_0x2c4f('0x1f')][_0x2c4f('0x20')]);}else{logger[_0x2c4f('0x19')](_0x2c4f('0x1a'),_0x20b204,_0x2c4f('0x1b'));_0x1bede9(_0xef5008['result'][_0x2c4f('0x20')]);}})[_0x2c4f('0x21')](function(_0x139658){logger[_0x2c4f('0x1f')](_0x2c4f('0x1a'),_0x20b204,_0x139658);_0x189ef2(_0x139658);});});}function respondWithStatusCode(_0x3835c0,_0x16dce3){_0x16dce3=_0x16dce3||0xcc;return function(_0x1700cc){if(_0x1700cc){return _0x3835c0[_0x2c4f('0x22')](_0x16dce3);}return _0x3835c0[_0x2c4f('0x23')](_0x16dce3)[_0x2c4f('0x24')]();};}function respondWithResult(_0x44f003,_0x28af3a){_0x28af3a=_0x28af3a||0xc8;return function(_0x1df74d){if(_0x1df74d){return _0x44f003[_0x2c4f('0x23')](_0x28af3a)[_0x2c4f('0x25')](_0x1df74d);}};}function respondWithFilteredResult(_0x1d85df,_0x1f7fc8){return function(_0x2472ae){if(_0x2472ae){var _0x4f7bbe=typeof _0x1f7fc8[_0x2c4f('0x26')]===_0x2c4f('0x27')&&typeof _0x1f7fc8['limit']===_0x2c4f('0x27');var _0x44e54f=_0x2472ae[_0x2c4f('0x28')];var _0x2e6331=_0x4f7bbe?0x0:_0x1f7fc8[_0x2c4f('0x26')];var _0x550ec3=_0x4f7bbe?_0x2472ae[_0x2c4f('0x28')]:_0x1f7fc8[_0x2c4f('0x26')]+_0x1f7fc8[_0x2c4f('0x29')];var _0x3d4180;if(_0x550ec3>=_0x44e54f){_0x550ec3=_0x44e54f;_0x3d4180=0xc8;}else{_0x3d4180=0xce;}_0x1d85df[_0x2c4f('0x23')](_0x3d4180);return _0x1d85df[_0x2c4f('0x2a')](_0x2c4f('0x2b'),_0x2e6331+'-'+_0x550ec3+'/'+_0x44e54f)[_0x2c4f('0x25')](_0x2472ae);}return null;};}function saveUpdates(_0xa3c51d){return function(_0x4f8fe2){if(_0x4f8fe2){return _0x4f8fe2['update'](_0xa3c51d)['then'](function(_0x3f49d4){return _0x3f49d4;});}return null;};}function removeEntity(_0x1758f7){return function(_0x418018){if(_0x418018){return _0x418018[_0x2c4f('0x2c')]()['then'](function(){_0x1758f7['status'](0xcc)[_0x2c4f('0x24')]();});}};}function handleEntityNotFound(_0x5184a9){return function(_0x36c765){if(!_0x36c765){_0x5184a9[_0x2c4f('0x22')](0x194);}return _0x36c765;};}function handleError(_0x370c39,_0x5ea1c1){_0x5ea1c1=_0x5ea1c1||0x1f4;return function(_0x47e2c8){logger[_0x2c4f('0x1f')](_0x47e2c8[_0x2c4f('0x2d')]);if(_0x47e2c8[_0x2c4f('0x2e')]){delete _0x47e2c8[_0x2c4f('0x2e')];}_0x370c39[_0x2c4f('0x23')](_0x5ea1c1)['send'](_0x47e2c8);};}function getMustacheRender(_0x41da83,_0x397580){return Mustache[_0x2c4f('0x2f')](_0x41da83,_['merge'](_0x397580[_0x2c4f('0x30')],{'contact':_0x397580['contact'],'message':_0x397580[_0x2c4f('0x20')],'agent':_0x397580[_0x2c4f('0x31')],'interaction':_0x397580['interaction'],'account':_0x397580[_0x2c4f('0x32')]}))||'';}exports[_0x2c4f('0x33')]=function(_0x18eb6e,_0x268ec6){var _0x280ed7={};var _0x22919b=_[_0x2c4f('0x34')](db['ChatInteraction'][_0x2c4f('0x35')],function(_0x2adc4e){return{'name':_0x2adc4e[_0x2c4f('0x36')],'type':_0x2adc4e['type'][_0x2c4f('0x37')]};});_0x280ed7=qs[_0x2c4f('0x38')](_0x22919b,_0x18eb6e);return interaction[_0x2c4f('0x39')]('chat',_0x18eb6e[_0x2c4f('0x3a')],_0x18eb6e[_0x2c4f('0x3b')],_0x280ed7,_0x22919b)[_0x2c4f('0x18')](respondWithFilteredResult(_0x268ec6,_0x280ed7))[_0x2c4f('0x21')](handleError(_0x268ec6,null));};exports[_0x2c4f('0x3c')]=function(_0x4070f1,_0x4c3602){var _0x22ee62={'raw':![],'where':{'id':_0x4070f1['params']['id']}},_0x24600b={};_0x24600b[_0x2c4f('0x3d')]=_[_0x2c4f('0x3e')](db['ChatInteraction'][_0x2c4f('0x35')]);_0x24600b[_0x2c4f('0x3a')]=_['keys'](_0x4070f1[_0x2c4f('0x3a')]);_0x24600b[_0x2c4f('0x3f')]=_['intersection'](_0x24600b[_0x2c4f('0x3d')],_0x24600b['query']);_0x22ee62['attributes']=_[_0x2c4f('0x40')](_0x24600b[_0x2c4f('0x3d')],qs[_0x2c4f('0x41')](_0x4070f1[_0x2c4f('0x3a')][_0x2c4f('0x41')]));_0x22ee62[_0x2c4f('0x42')]=_0x22ee62[_0x2c4f('0x42')][_0x2c4f('0x43')]?_0x22ee62['attributes']:_0x24600b['model'];if(_0x4070f1[_0x2c4f('0x3a')][_0x2c4f('0x44')]){_0x22ee62[_0x2c4f('0x45')]=[{'all':!![]}];}_0x22ee62=_['merge']({},_0x22ee62,_0x4070f1['options']);return db[_0x2c4f('0x46')][_0x2c4f('0x47')](_0x22ee62)[_0x2c4f('0x18')](handleEntityNotFound(_0x4c3602,null))[_0x2c4f('0x18')](respondWithResult(_0x4c3602,null))[_0x2c4f('0x21')](handleError(_0x4c3602,null));};exports['create']=function(_0x3cba58,_0x37881b){return db[_0x2c4f('0x46')][_0x2c4f('0x48')](_0x3cba58['body'],{})[_0x2c4f('0x18')](respondWithResult(_0x37881b,0xc9))['catch'](handleError(_0x37881b,null));};exports[_0x2c4f('0x49')]=function(_0x2e888b,_0x1d5308){if(_0x2e888b['body']['id']){delete _0x2e888b[_0x2c4f('0x30')]['id'];}return db['ChatInteraction'][_0x2c4f('0x47')]({'where':{'id':_0x2e888b[_0x2c4f('0x4a')]['id']}})[_0x2c4f('0x18')](handleEntityNotFound(_0x1d5308,null))[_0x2c4f('0x18')](saveUpdates(_0x2e888b[_0x2c4f('0x30')],null))['then'](respondWithResult(_0x1d5308,null))[_0x2c4f('0x21')](handleError(_0x1d5308,null));};exports[_0x2c4f('0x2c')]=function(_0x3ad073,_0x356bb1){return db[_0x2c4f('0x46')][_0x2c4f('0x47')]({'where':{'id':_0x3ad073[_0x2c4f('0x4a')]['id']}})[_0x2c4f('0x18')](handleEntityNotFound(_0x356bb1,null))['then'](removeEntity(_0x356bb1,null))[_0x2c4f('0x21')](handleError(_0x356bb1,null));};exports['describe']=function(_0x54f41f,_0x515968){return db[_0x2c4f('0x46')][_0x2c4f('0x4b')]()[_0x2c4f('0x18')](respondWithResult(_0x515968,null))[_0x2c4f('0x21')](handleError(_0x515968,null));};exports[_0x2c4f('0x4c')]=function(_0x21936c,_0x35f314){var _0x5751c8=_0x21936c[_0x2c4f('0x4a')]['id'];var _0x2a06d9;var _0x35c1ae;var _0x3e77e6;return db['ChatInteraction'][_0x2c4f('0x4d')]({'where':{'id':_0x5751c8}})[_0x2c4f('0x18')](function(_0x1a7664){_0x2a06d9=_0x1a7664;return db[_0x2c4f('0x4e')]['findOne']({'where':{'id':_0x1a7664['ChatWebsiteId']},'attributes':['id',_0x2c4f('0x4f'),_0x2c4f('0x50'),'vidaooTopic',_0x2c4f('0x51'),'vidaooMetadata'],'raw':!![]});})[_0x2c4f('0x18')](function(_0x1db26b){if(_0x1db26b&&_0x1db26b['vidaooApiKey']&&_0x1db26b[_0x2c4f('0x50')]){_0x35c1ae=_0x1db26b;var _0x120d89={'interaction':{'id':_0x5751c8},'agent':{'id':_0x21936c[_0x2c4f('0x3b')]['id'],'name':_0x21936c[_0x2c4f('0x3b')][_0x2c4f('0x2e')],'fullname':_0x21936c[_0x2c4f('0x3b')][_0x2c4f('0x52')],'email':_0x21936c[_0x2c4f('0x3b')]['email']},'contact':_0x21936c[_0x2c4f('0x30')][_0x2c4f('0x53')],'account':_0x21936c[_0x2c4f('0x30')][_0x2c4f('0x32')]};var _0x3c39ec={'rejectUnauthorized':![],'method':_0x2c4f('0x54'),'url':_0x2c4f('0x55'),'headers':{'X-APIKEY':_0x1db26b[_0x2c4f('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x21936c[_0x2c4f('0x3b')][_0x2c4f('0x56')]],'buttons':null,'topic':_0x35c1ae[_0x2c4f('0x57')],'note':_[_0x2c4f('0x58')](_0x35c1ae['vidaooNote'])?null:getMustacheRender(_0x35c1ae[_0x2c4f('0x51')],_0x120d89),'metadata':null},'redirect':_0x2c4f('0x59'),'json':!![]};try{if(!_[_0x2c4f('0x58')](_0x35c1ae[_0x2c4f('0x5a')])){var _0x3a8a32=getMustacheRender(_0x35c1ae['vidaooMetadata'],_0x120d89);var _0x3d6de5=JSON['parse'](_0x3a8a32);_0x3c39ec[_0x2c4f('0x30')][_0x2c4f('0x5b')]=_0x3d6de5;}}catch(_0x215395){throw new db[(_0x2c4f('0x5c'))][(_0x2c4f('0x5d'))](_0x2c4f('0x5e'));}return rp(_0x3c39ec);}else{throw new db['Sequelize'][(_0x2c4f('0x5d'))](_0x2c4f('0x5f'));}})['then'](function(_0x4d28fc){_0x3e77e6=_0x4d28fc;if(_0x3e77e6['id']){var _0x3eeb08={'body':_0x3e77e6[_0x2c4f('0x60')],'ChatWebsiteId':_0x35c1ae['id'],'ChatInteractionId':_0x2a06d9['id'],'direction':_0x2c4f('0x61'),'UserId':_0x21936c['user']['id']};return db[_0x2c4f('0x62')][_0x2c4f('0x48')](_0x3eeb08,{});}else{throw new db[(_0x2c4f('0x5c'))][(_0x2c4f('0x5d'))](_0x2c4f('0x63'));}})[_0x2c4f('0x18')](function(){return _0x2a06d9[_0x2c4f('0x64')]({'vidaooSessionId':_0x3e77e6['id']});})[_0x2c4f('0x18')](respondWithResult(_0x35f314,null))[_0x2c4f('0x21')](handleError(_0x35f314,null));};exports[_0x2c4f('0x65')]=function(_0x4bae05,_0x70688a){if(_0x4bae05[_0x2c4f('0x30')]['id']){delete _0x4bae05[_0x2c4f('0x30')]['id'];}return db[_0x2c4f('0x46')][_0x2c4f('0x47')]({'where':{'id':_0x4bae05[_0x2c4f('0x4a')]['id']},'include':[{'model':db['CmContact'],'as':_0x2c4f('0x66')}]})['then'](handleEntityNotFound(_0x70688a,null))[_0x2c4f('0x18')](saveUpdates(_0x4bae05['body'],null))[_0x2c4f('0x18')](respondWithResult(_0x70688a,null))['catch'](handleError(_0x70688a,null));};exports[_0x2c4f('0x67')]=function(_0x300b78,_0x551be5){if(_0x300b78['body']['id']){delete _0x300b78[_0x2c4f('0x30')]['id'];}return db[_0x2c4f('0x46')][_0x2c4f('0x47')]({'where':{'id':_0x300b78[_0x2c4f('0x4a')]['id']}})[_0x2c4f('0x18')](function(_0xa1db3b){if(!_0xa1db3b){logger['error'](_0x2c4f('0x68'),'abandon',0x194,_0x2c4f('0x69'));_0x551be5[_0x2c4f('0x22')](0x194);}else{if(_0xa1db3b[_0x2c4f('0x6a')]){throw new db[(_0x2c4f('0x5c'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xa1db3b;})['then'](function(_0x2b67fc){if(_0x2b67fc){return _0x2b67fc['update']({'closed':_0x300b78[_0x2c4f('0x30')][_0x2c4f('0x6b')],'disposition':_0x300b78[_0x2c4f('0x30')][_0x2c4f('0x6c')]})['then'](function(_0x47cbdd){return _0x47cbdd;});}})[_0x2c4f('0x18')](function(){return respondWithRpcPromise(_0x2c4f('0x6d'),'abandon',_0x300b78['body'],client9004);})['then'](respondWithResult(_0x551be5,null))[_0x2c4f('0x21')](handleError(_0x551be5,null));};exports['attachmentUpload']=function(_0x5d66ab,_0x106bfe){_0x5d66ab[_0x2c4f('0x30')][_0x2c4f('0x2e')]=_0x5d66ab[_0x2c4f('0x6e')][_0x2c4f('0x6f')];_0x5d66ab[_0x2c4f('0x30')][_0x2c4f('0x70')]=_0x5d66ab[_0x2c4f('0x6e')][_0x2c4f('0x71')];_0x5d66ab[_0x2c4f('0x30')][_0x2c4f('0x72')]=_0x5d66ab[_0x2c4f('0x6e')][_0x2c4f('0x73')];return db[_0x2c4f('0x74')]['create'](_0x5d66ab['body'])['then'](respondWithResult(_0x106bfe,0xc9))['catch'](handleError(_0x106bfe,null));};exports[_0x2c4f('0x75')]=function(_0x482f66,_0x2c84c5){return db['ChatInteraction']['findOne']({'where':{'id':_0x482f66[_0x2c4f('0x4a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c84c5,null))[_0x2c4f('0x18')](function(_0x4a0a0c){if(_0x4a0a0c){if(_0x4a0a0c[_0x2c4f('0x6b')]){return _0x2c84c5[_0x2c4f('0x23')](0x193)[_0x2c4f('0x25')]({'status':0x193,'message':_0x2c4f('0x76')});}return db[_0x2c4f('0x74')][_0x2c4f('0x4d')]({'where':{'id':_0x482f66[_0x2c4f('0x3a')]['attachId']},'raw':!![]})[_0x2c4f('0x18')](handleEntityNotFound(_0x2c84c5,null));}})[_0x2c4f('0x18')](function(_0x9382e1){if(_0x9382e1){var _0x529be3=_0x9382e1[_0x2c4f('0x77')]!==null;var _0x8d5b63=path[_0x2c4f('0x78')](config[_0x2c4f('0x79')],'server/files/attachments/');if(_0x529be3){_0x8d5b63=path[_0x2c4f('0x78')](_0x8d5b63,_0x2c4f('0x7a'));}var _0x469f09=path[_0x2c4f('0x78')](_0x8d5b63,_0x9382e1['basename']);return _0x2c84c5[_0x2c4f('0x7b')](_0x469f09);}})['catch'](handleError(_0x2c84c5,null));};exports[_0x2c4f('0x7c')]=function(_0x297959,_0x27baba){var _0x18a683=null;var _0x277680=null;var _0x4a1e35=null;if(_0x297959[_0x2c4f('0x30')]['id']){delete _0x297959[_0x2c4f('0x30')]['id'];}if(_0x297959[_0x2c4f('0x30')][_0x2c4f('0x7d')]){_0x4a1e35=path[_0x2c4f('0x78')](config['root'],'server/files/chat/upload/',util[_0x2c4f('0x7e')]('transcript-%s.txt',Date[_0x2c4f('0x7f')]()));_0x297959[_0x2c4f('0x30')]['pathTranscript']=_0x4a1e35;}return db['ChatInteraction'][_0x2c4f('0x47')]({'where':{'id':_0x297959['params']['id']},'include':[{'model':db[_0x2c4f('0x62')],'as':'Messages','include':[{'model':db['User'],'as':_0x2c4f('0x80')}]}]})[_0x2c4f('0x18')](handleEntityNotFound(_0x27baba,null))['then'](saveUpdates(_0x297959[_0x2c4f('0x30')],null))[_0x2c4f('0x18')](function(_0x34d509){if(_0x34d509){_0x18a683=_0x34d509;return db[_0x2c4f('0x4e')]['find']({'where':{'id':_0x18a683[_0x2c4f('0x81')]}});}})[_0x2c4f('0x18')](function(_0x132427){if(_0x132427){_0x277680=_0x132427;return db[_0x2c4f('0x82')][_0x2c4f('0x47')]({'where':{'id':_0x18a683[_0x2c4f('0x83')]}});}})[_0x2c4f('0x18')](function(_0x281678){if(_0x281678){if(_0x4a1e35){var _0x384cf8=null;for(var _0x44c782=0x1;_0x44c782<_0x18a683[_0x2c4f('0x84')]['length'];++_0x44c782){_0x384cf8=_0x18a683[_0x2c4f('0x84')][_0x44c782];var _0x3b6e3b=_0x384cf8['UserId']?util[_0x2c4f('0x7e')](_0x2c4f('0x85'),_0x277680[_0x2c4f('0x86')],_0x384cf8[_0x2c4f('0x6a')]):_0x2c4f('0x87');var _0x349f4a=_0x297959[_0x2c4f('0x30')][_0x2c4f('0x88')]||util[_0x2c4f('0x7e')](_0x2c4f('0x85'),_0x2c4f('0x89'),_0x384cf8[_0x2c4f('0x83')]);switch(_0x277680[_0x2c4f('0x8a')]){case _0x2c4f('0x8b'):_0x3b6e3b=_0x384cf8['UserId']?util[_0x2c4f('0x7e')](_0x2c4f('0x85'),_0x277680['agentAlias'],_0x384cf8[_0x2c4f('0x6a')]):_0x2c4f('0x87');break;case _0x2c4f('0x8c'):_0x3b6e3b=_0x384cf8['UserId']?_0x384cf8['User'][_0x2c4f('0x8d')]||_0x384cf8[_0x2c4f('0x80')]['fullname']:_0x2c4f('0x87');break;case _0x2c4f('0x8e'):_0x3b6e3b=_0x384cf8[_0x2c4f('0x6a')]?_0x384cf8['User'][_0x2c4f('0x52')]:_0x2c4f('0x87');break;default:_0x3b6e3b=_0x384cf8[_0x2c4f('0x6a')]?util[_0x2c4f('0x7e')]('%s%d',_0x277680['agentAlias'],_0x384cf8[_0x2c4f('0x6a')]):_0x2c4f('0x87');}var _0x293123=util[_0x2c4f('0x7e')](_0x2c4f('0x8f'),moment(_0x384cf8['createdAt'])['format'](_0x2c4f('0x90')),_0x384cf8[_0x2c4f('0x91')]==='in'?_0x349f4a:_0x3b6e3b,_0x384cf8[_0x2c4f('0x30')]);if(!_0x384cf8[_0x2c4f('0x92')]){fs[_0x2c4f('0x93')](_0x4a1e35,_0x293123);}}return db['MailAccount'][_0x2c4f('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2c4f('0x94'),'raw':!![],'include':[{'model':db[_0x2c4f('0x95')],'as':_0x2c4f('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x105d78){if(!_0x105d78||!_0x105d78['Smtp']||!_0x297959[_0x2c4f('0x30')])return _0x18a683;var _0x495427=_0x105d78['getSmtpOptions']();return respondWithRpcPromise(_0x2c4f('0x96'),_0x2c4f('0x97'),{'account':_0x495427,'message':{'from':util[_0x2c4f('0x7e')]('\x22%s\x22\x20<%s>',_0x105d78[_0x2c4f('0x2e')],_0x105d78['email']||_0x105d78[_0x2c4f('0x94')][_0x2c4f('0x3b')]),'to':_0x297959['body'][_0x2c4f('0x7d')],'subject':'Mail\x20Transcript','text':util['format'](_0x2c4f('0x98'),_0x297959[_0x2c4f('0x30')][_0x2c4f('0x7d')]),'attachments':[{'path':_0x4a1e35}]}})[_0x2c4f('0x18')](function(){return _0x18a683;})[_0x2c4f('0x21')](function(_0x5700b1){logger[_0x2c4f('0x1f')](_0x5700b1);});})['then'](respondWithStatusCode(_0x27baba,0xc8))[_0x2c4f('0x21')](handleError(_0x27baba,null));};exports[_0x2c4f('0x99')]=function(_0x1f6858,_0x487a2d){return db[_0x2c4f('0x62')]['find']({'where':{'id':_0x1f6858['params']['id']}})['then'](handleEntityNotFound(_0x487a2d,null))[_0x2c4f('0x18')](function(_0x22c5f0){if(_0x22c5f0){return _0x22c5f0[_0x2c4f('0x99')](_0x1f6858[_0x2c4f('0x30')][_0x2c4f('0x9a')],_[_0x2c4f('0x9b')](_0x1f6858[_0x2c4f('0x30')],['ids','id'])||{});}})['then'](respondWithResult(_0x487a2d,null))[_0x2c4f('0x21')](handleError(_0x487a2d,null));};exports[_0x2c4f('0x9c')]=function(_0x2c6545,_0x40c3f7){var _0x477acd={'raw':![],'where':{}};var _0x1f765f={};var _0x2960a8={'count':0x0,'rows':[]};return db[_0x2c4f('0x46')][_0x2c4f('0x4d')]({'where':{'id':_0x2c6545['params']['id']}})['then'](handleEntityNotFound(_0x40c3f7,null))[_0x2c4f('0x18')](function(_0xca48bb){if(_0xca48bb){_0x1f765f[_0x2c4f('0x3d')]=_[_0x2c4f('0x3e')](db[_0x2c4f('0x62')][_0x2c4f('0x35')]);_0x1f765f['query']=_[_0x2c4f('0x3e')](_0x2c6545[_0x2c4f('0x3a')]);_0x1f765f[_0x2c4f('0x3f')]=_[_0x2c4f('0x40')](_0x1f765f[_0x2c4f('0x3d')],_0x1f765f['query']);_0x477acd[_0x2c4f('0x42')]=_[_0x2c4f('0x40')](_0x1f765f[_0x2c4f('0x3d')],qs[_0x2c4f('0x41')](_0x2c6545[_0x2c4f('0x3a')][_0x2c4f('0x41')]));_0x477acd[_0x2c4f('0x42')]=_0x477acd[_0x2c4f('0x42')]['length']?_0x477acd[_0x2c4f('0x42')]:_0x1f765f[_0x2c4f('0x3d')];if(!_0x2c6545['query']['hasOwnProperty'](_0x2c4f('0x9d'))){_0x477acd['limit']=qs[_0x2c4f('0x29')](_0x2c6545['query'][_0x2c4f('0x29')]);_0x477acd['offset']=qs['offset'](_0x2c6545[_0x2c4f('0x3a')][_0x2c4f('0x26')]);}_0x477acd[_0x2c4f('0x9e')]=qs['sort'](_0x2c6545[_0x2c4f('0x3a')][_0x2c4f('0x9f')]);_0x477acd['where']=qs[_0x2c4f('0x3f')](_['pick'](_0x2c6545[_0x2c4f('0x3a')],_0x1f765f['filters']));_0x477acd[_0x2c4f('0xa0')][_0x2c4f('0xa1')]=_0xca48bb['id'];if(_0x2c6545['query'][_0x2c4f('0xa2')]){_0x477acd[_0x2c4f('0xa0')]=_[_0x2c4f('0xa3')](_0x477acd['where'],{'$or':_['map'](_0x477acd[_0x2c4f('0x42')],function(_0x141789){var _0x1154d5={};_0x1154d5[_0x141789]={'$like':'%'+_0x2c6545['query'][_0x2c4f('0xa2')]+'%'};return _0x1154d5;})});}if(_0x2c6545['query'][_0x2c4f('0xa4')]){var _0x251625=_0x2c6545['query'][_0x2c4f('0xa4')]['split'](',');var _0x4f1cdd={};_0x4f1cdd[_0x251625[0x0]]={'$gte':moment(_0x251625[0x1])[_0x2c4f('0x7e')](_0x2c4f('0xa5'))};_0x477acd[_0x2c4f('0xa0')]=_[_0x2c4f('0xa3')](_0x477acd[_0x2c4f('0xa0')],_0x4f1cdd);}_0x477acd=_[_0x2c4f('0xa3')]({},_0x477acd,_0x2c6545[_0x2c4f('0xa6')]);return db[_0x2c4f('0x62')][_0x2c4f('0x28')]({'where':_0x477acd[_0x2c4f('0xa0')]})[_0x2c4f('0x18')](function(_0x12e636){_0x2960a8[_0x2c4f('0x28')]=_0x12e636;if(_0x2c6545[_0x2c4f('0x3a')][_0x2c4f('0x44')]){_0x477acd[_0x2c4f('0x45')]=[{'all':!![]}];}return db[_0x2c4f('0x62')][_0x2c4f('0x39')](_0x477acd);})[_0x2c4f('0x18')](function(_0x15afb7){_0x2960a8['rows']=_0x15afb7;return _0x2960a8;});}})[_0x2c4f('0x18')](respondWithFilteredResult(_0x40c3f7,_0x477acd))['catch'](handleError(_0x40c3f7,null));};exports[_0x2c4f('0xa7')]=function(_0x1f997c,_0x2030ec){var _0x584b4c={'where':{}},_0x1a00f7={},_0x5c5c98={'count':0x0,'rows':[]};return db[_0x2c4f('0x46')][_0x2c4f('0x4d')]({'where':{'id':_0x1f997c['params']['id']}})[_0x2c4f('0x18')](handleEntityNotFound(_0x2030ec,null))[_0x2c4f('0x18')](function(_0x165b5f){if(_0x165b5f){_0x1a00f7[_0x2c4f('0x3d')]=_[_0x2c4f('0x3e')](db['ChatMessage'][_0x2c4f('0x35')]);_0x1a00f7['query']=_['keys'](_0x1f997c[_0x2c4f('0x3a')]);_0x1a00f7[_0x2c4f('0x3f')]=_[_0x2c4f('0x40')](_0x1a00f7['model'],_0x1a00f7['query']);_0x584b4c[_0x2c4f('0x42')]=_[_0x2c4f('0x40')](_0x1a00f7[_0x2c4f('0x3d')],qs[_0x2c4f('0x41')](_0x1f997c[_0x2c4f('0x3a')]['fields']));_0x584b4c[_0x2c4f('0x42')]=_0x584b4c[_0x2c4f('0x42')]['length']?_0x584b4c[_0x2c4f('0x42')]:_0x1a00f7[_0x2c4f('0x3d')];if(!_0x1f997c[_0x2c4f('0x3a')][_0x2c4f('0xa8')]('nolimit')){_0x584b4c['limit']=qs[_0x2c4f('0x29')](_0x1f997c[_0x2c4f('0x3a')][_0x2c4f('0x29')]);_0x584b4c[_0x2c4f('0x26')]=qs[_0x2c4f('0x26')](_0x1f997c[_0x2c4f('0x3a')][_0x2c4f('0x26')]);}_0x584b4c[_0x2c4f('0x9e')]=qs[_0x2c4f('0x9f')](_0x1f997c[_0x2c4f('0x3a')][_0x2c4f('0x9f')]);_0x584b4c['where']=qs[_0x2c4f('0x3f')](_['pick'](_0x1f997c['query'],_0x1a00f7[_0x2c4f('0x3f')]));_0x584b4c[_0x2c4f('0xa0')][_0x2c4f('0xa1')]=_0x165b5f['id'];if(_0x1f997c[_0x2c4f('0x3a')]['filter']){_0x584b4c['where']=_[_0x2c4f('0xa3')](_0x584b4c[_0x2c4f('0xa0')],{'$or':_[_0x2c4f('0x34')](_0x584b4c[_0x2c4f('0x42')],function(_0x2840c7){var _0x26e5a7={};_0x26e5a7[_0x2840c7]={'$like':'%'+_0x1f997c[_0x2c4f('0x3a')][_0x2c4f('0xa2')]+'%'};return _0x26e5a7;})});}_0x584b4c[_0x2c4f('0xa0')][_0x2c4f('0x92')]=![];if(_0x1f997c[_0x2c4f('0x3a')]['id']){_0x584b4c['where']['id']={'$gt':_0x1f997c[_0x2c4f('0x3a')]['id']};}_0x584b4c=_[_0x2c4f('0xa3')]({},_0x584b4c,_0x1f997c[_0x2c4f('0xa6')]);return db['ChatMessage'][_0x2c4f('0x28')]({'where':_0x584b4c[_0x2c4f('0xa0')]})[_0x2c4f('0x18')](function(_0x5a47e5){_0x5c5c98['count']=_0x5a47e5;_0x584b4c[_0x2c4f('0x45')]=[];if(_0x1f997c[_0x2c4f('0x3a')]['includeAgent']){_0x584b4c[_0x2c4f('0x45')]['push']({'model':db['User'],'as':_0x2c4f('0x80'),'attributes':['id',_0x2c4f('0x52'),_0x2c4f('0x8d')]});}if(_0x1f997c[_0x2c4f('0x3a')][_0x2c4f('0x44')]){_0x584b4c[_0x2c4f('0x45')]=[{'all':!![]}];}return db[_0x2c4f('0x62')][_0x2c4f('0x39')](_0x584b4c);})['then'](function(_0x356823){_0x5c5c98['rows']=_0x356823;return _0x5c5c98;});}})['then'](respondWithFilteredResult(_0x2030ec,_0x584b4c))[_0x2c4f('0x21')](handleError(_0x2030ec,null));};exports[_0x2c4f('0xa9')]=function(_0x4c8d12,_0x31ac57){return db[_0x2c4f('0x46')][_0x2c4f('0x47')]({'where':{'id':_0x4c8d12['params']['id']}})[_0x2c4f('0x18')](handleEntityNotFound(_0x31ac57,null))[_0x2c4f('0x18')](function(_0x63b260){if(_0x63b260){return _0x63b260[_0x2c4f('0xaa')](_0x4c8d12[_0x2c4f('0x30')][_0x2c4f('0x9a')],_[_0x2c4f('0x9b')](_0x4c8d12[_0x2c4f('0x30')],[_0x2c4f('0x9a'),'id'])||{})['spread'](function(){return db[_0x2c4f('0xab')]['findAll']({'attributes':['id',_0x2c4f('0x2e'),_0x2c4f('0xac')],'where':{'id':_0x4c8d12[_0x2c4f('0x30')]['ids']}});})['then'](function(_0x5efc0e){socket[_0x2c4f('0xad')](_0x2c4f('0xae'),{'id':Number(_0x4c8d12[_0x2c4f('0x4a')]['id']),'tags':_0x5efc0e||[]});return{'id':Number(_0x4c8d12[_0x2c4f('0x4a')]['id']),'tags':_0x5efc0e||[]};});}})['then'](respondWithResult(_0x31ac57,null))[_0x2c4f('0x21')](handleError(_0x31ac57,null));};exports[_0x2c4f('0xaf')]=function(_0x265f17,_0xf4816c){return db['ChatInteraction']['find']({'where':{'id':_0x265f17['params']['id']}})[_0x2c4f('0x18')](handleEntityNotFound(_0xf4816c,null))[_0x2c4f('0x18')](function(_0x33276d){if(_0x33276d){return _0x33276d[_0x2c4f('0xaf')](_0x265f17[_0x2c4f('0x3a')][_0x2c4f('0x9a')]);}})['then'](respondWithStatusCode(_0xf4816c,null))[_0x2c4f('0x21')](handleError(_0xf4816c,null));};exports[_0x2c4f('0x7b')]=function(_0x426b1d,_0x1c00e2){var _0x5167cc=moment()[_0x2c4f('0xb0')]()['toString']();var _0x416b2f=path['join'](config['root'],_0x2c4f('0xb1'),_0x2c4f('0xb2'),'tmp');var _0x30a5c7=path['join'](config[_0x2c4f('0x79')],_0x2c4f('0xb1'),_0x2c4f('0xb2'),'attachments');var _0x25c011=path[_0x2c4f('0x78')](_0x416b2f,_0x5167cc);var _0x56086d=util[_0x2c4f('0x7e')](_0x2c4f('0xb3'),_0x426b1d[_0x2c4f('0x4a')]['id'],_0x5167cc);var _0x5ec725=path[_0x2c4f('0x78')](_0x416b2f,_0x56086d);var _0x1c660a=[];_0x1c660a[_0x2c4f('0xb4')]({'model':db[_0x2c4f('0x80')],'as':_0x2c4f('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x1c660a[_0x2c4f('0xb4')]({'model':db[_0x2c4f('0x82')],'as':_0x2c4f('0x66'),'attributes':['id',_0x2c4f('0xb5'),_0x2c4f('0xb6')],'raw':!![]});if(_0x426b1d['query'][_0x2c4f('0xb7')]){_0x1c660a[_0x2c4f('0xb4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0xf066f2=[{'model':db[_0x2c4f('0x62')],'as':_0x2c4f('0x84'),'attributes':['id','body',_0x2c4f('0xb8'),_0x2c4f('0x91'),_0x2c4f('0x92'),_0x2c4f('0xb9')],'include':_0x1c660a}];_0xf066f2['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x2c4f('0x2e')]});_0xf066f2['push']({'model':db[_0x2c4f('0x80')],'as':_0x2c4f('0xba'),'attributes':['id',_0x2c4f('0x52')]});return db['ChatInteraction'][_0x2c4f('0x47')]({'where':{'id':_0x426b1d[_0x2c4f('0x4a')]['id']},'include':_0xf066f2})['then'](handleEntityNotFound(_0x1c00e2,null))[_0x2c4f('0x18')](function(_0x56ae8b){if(_0x56ae8b){var _0xf5ab5e=_0x56ae8b['get']({'plain':!![]});fs['mkdirSync'](_0x25c011);var _0x2f45d2={'channel':_0x2c4f('0xbb'),'account':_0xf5ab5e[_0x2c4f('0xbc')][_0x2c4f('0x2e')],'agent':_0xf5ab5e[_0x2c4f('0xba')]?_0xf5ab5e[_0x2c4f('0xba')]['fullname']:_0x2c4f('0xbd'),'createdAt':moment(_0xf5ab5e[_0x2c4f('0xb8')])[_0x2c4f('0x7e')](_0x2c4f('0xa5'))[_0x2c4f('0xbe')](),'closedAt':_0xf5ab5e['closed']?moment(_0xf5ab5e[_0x2c4f('0xbf')])[_0x2c4f('0x7e')](_0x2c4f('0xa5'))['toString']():'','disposition':_0xf5ab5e[_0x2c4f('0x6c')],'chatInfo':{'browser':_0xf5ab5e[_0x2c4f('0xc0')],'os':_0xf5ab5e[_0x2c4f('0xc1')],'referer':_0xf5ab5e[_0x2c4f('0xc2')],'customerIp':_0xf5ab5e[_0x2c4f('0xc3')],'customerPort':_0xf5ab5e['customerPort']?_0xf5ab5e['customerPort']:_0x2c4f('0xbd')},'messages':_(_0xf5ab5e['Messages'])[_0x2c4f('0xc4')]()[_0x2c4f('0xa2')]({'secret':![]})[_0x2c4f('0x34')](function(_0x2ed328){if(_0x2ed328[_0x2c4f('0x74')]){var _0x14b770=path[_0x2c4f('0x78')](_0x30a5c7,_0x2ed328[_0x2c4f('0x74')][_0x2c4f('0x70')]);if(fs[_0x2c4f('0xc5')](_0x14b770)){fs[_0x2c4f('0xc6')](_0x14b770)['pipe'](fs[_0x2c4f('0xc7')](path[_0x2c4f('0x78')](_0x25c011,_0x2ed328['Attachment'][_0x2c4f('0x70')])));}}return{'date':moment(_0x2ed328[_0x2c4f('0xb8')])['format'](_0x2c4f('0xa5'))['toString'](),'sender':_0x2ed328['direction']===_0x2c4f('0x61')?_0x2ed328['User']?_0x2ed328[_0x2c4f('0x80')][_0x2c4f('0x52')]:_0x2c4f('0x87'):_0x2ed328[_0x2c4f('0x66')][_0x2c4f('0xb5')]+(_0x2ed328[_0x2c4f('0x66')]['lastName']?'\x20'+_0x2ed328['Contact'][_0x2c4f('0xb6')]:''),'body':_0x2ed328['Attachment']?_0x2ed328[_0x2c4f('0x74')][_0x2c4f('0x70')]:_0x2ed328[_0x2c4f('0x30')],'direction':_0x2ed328[_0x2c4f('0x91')]===_0x2c4f('0x61')?'A':'C','secret':_0x2ed328[_0x2c4f('0x92')],'read':_0x2ed328['read'],'attachment':_0x2ed328['Attachment']};})[_0x2c4f('0xc8')]()};return ejs[_0x2c4f('0xc9')](path[_0x2c4f('0x78')](config[_0x2c4f('0x79')],_0x2c4f('0xb1'),_0x2c4f('0xca'),_0x2c4f('0xcb')),{'interaction':_0x2f45d2})['then'](function(_0x25657f){var _0x4dd875=path[_0x2c4f('0x78')](_0x25c011,'transcript-'+_0xf5ab5e['id']+'-'+_0x5167cc+'.pdf');var _0x254710={'path':_0x4dd875,'channel':_0x2c4f('0xbb'),'interactionId':_0xf5ab5e['id']};return pdf[_0x2c4f('0xcc')](_0x25657f,_0x254710);})['then'](function(){return new Promise(function(_0x45886f,_0xeda38c){zipdir(_0x25c011,{'saveTo':_0x5ec725},function(_0x111ab7,_0x5cb73d){if(_0x111ab7)return _0xeda38c(_0x111ab7);return _0x45886f(_0x5cb73d);});})[_0x2c4f('0x18')](function(){return new BPromise(function(_0x346e6b,_0x280fa5){rimraf(_0x25c011,function(_0x12eaec){if(_0x12eaec)_0x280fa5(_0x12eaec);return _0x346e6b();});});})[_0x2c4f('0x18')](function(){return _0x1c00e2[_0x2c4f('0x7b')](_0x5ec725,_0x56086d,function(_0x1bee8e){if(_0x1bee8e){logger['error']('err',_0x1bee8e);}else{fs['unlinkSync'](_0x5ec725);}});});});}else{return _0x1c00e2['sendStatus'](0xc8);}})[_0x2c4f('0x21')](handleError(_0x1c00e2,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index ad63792..dab82f5 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 _0x4bd7=['exports','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x1ef785,_0x1ea72d){var _0x485e64=function(_0x5d1717){while(--_0x5d1717){_0x1ef785['push'](_0x1ef785['shift']());}};_0x485e64(++_0x1ea72d);}(_0x4bd7,0x144));var _0x74bd=function(_0x767b78,_0x16270b){_0x767b78=_0x767b78-0x0;var _0x5daeed=_0x4bd7[_0x767b78];return _0x5daeed;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x74bd('0x0')];var ChatMessage=require(_0x74bd('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x74bd('0x2')](0x0);var events={'afterCreate':_0x74bd('0x3'),'afterUpdate':_0x74bd('0x4'),'afterDestroy':_0x74bd('0x5')};function emitEvent(_0x1d180f){return function(_0x3fab03,_0x561447,_0x40c17d){_0x3fab03['getUsers']({'attributes':['id'],'raw':!![]})[_0x74bd('0x6')](function(_0x39e1e0){_0x3fab03['setDataValue'](_0x74bd('0x7'),_0x39e1e0[_0x74bd('0x8')](function(_0x336499){return{'id':_0x336499['id']};}));return ChatMessage[_0x74bd('0x9')]({'where':{'ChatInteractionId':_0x3fab03['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74bd('0x6')](function(_0x11d153){_0x3fab03['setDataValue'](_0x74bd('0xa'),_0x11d153[_0x74bd('0xb')]);ChatInteractionEvents[_0x74bd('0xc')](_0x1d180f+':'+_0x3fab03['id'],_0x3fab03);ChatInteractionEvents[_0x74bd('0xc')](_0x1d180f,_0x3fab03);_0x40c17d(null);})[_0x74bd('0xd')](_0x40c17d(null));};}for(var e in events){if(events[_0x74bd('0xe')](e)){var event=events[e];ChatInteraction[_0x74bd('0xf')](e,emitEvent(event));}}module[_0x74bd('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x9ef9=['catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','setDataValue','Users','unreadMessages','length','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9ef9,0x189));var _0x99ef=function(_0x26d019,_0x13ca4a){_0x26d019=_0x26d019-0x0;var _0x275632=_0x9ef9[_0x26d019];return _0x275632;};'use strict';var EventEmitter=require(_0x99ef('0x0'));var ChatInteraction=require(_0x99ef('0x1'))['db'][_0x99ef('0x2')];var ChatMessage=require(_0x99ef('0x1'))['db'][_0x99ef('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x99ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x99ef('0x5'),'afterDestroy':_0x99ef('0x6')};function emitEvent(_0x1763b6){return function(_0x1c42e9,_0x5e048f,_0x1eab00){_0x1c42e9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2cde1a){_0x1c42e9[_0x99ef('0x7')](_0x99ef('0x8'),_0x2cde1a['map'](function(_0x233995){return{'id':_0x233995['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1c42e9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x39504f){_0x1c42e9[_0x99ef('0x7')](_0x99ef('0x9'),_0x39504f[_0x99ef('0xa')]);ChatInteractionEvents[_0x99ef('0xb')](_0x1763b6+':'+_0x1c42e9['id'],_0x1c42e9);ChatInteractionEvents[_0x99ef('0xb')](_0x1763b6,_0x1c42e9);_0x1eab00(null);})[_0x99ef('0xc')](_0x1eab00(null));};}for(var e in events){if(events[_0x99ef('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x99ef('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 5459673..141a1a1 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 _0xe801=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x5c11c7,_0x35cb51){var _0x15a255=function(_0x433662){while(--_0x433662){_0x5c11c7['push'](_0x5c11c7['shift']());}};_0x15a255(++_0x35cb51);}(_0xe801,0xff));var _0x1e80=function(_0x94eb7,_0x39af65){_0x94eb7=_0x94eb7-0x0;var _0x339e8f=_0xe801[_0x94eb7];return _0x339e8f;};'use strict';var _=require('lodash');var util=require(_0x1e80('0x0'));var logger=require(_0x1e80('0x1'))(_0x1e80('0x2'));var moment=require(_0x1e80('0x3'));var BPromise=require(_0x1e80('0x4'));var rp=require(_0x1e80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e80('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x1e80('0x7')]=function(_0x5d4a1f,_0x2831c5){return _0x5d4a1f[_0x1e80('0x8')](_0x1e80('0x9'),attributes,{'tableName':_0x1e80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30a9f8,_0x2c8131,_0x3bf6c8){if(_0x30a9f8[_0x1e80('0xb')]('closed')){_0x30a9f8[_0x1e80('0xc')]=moment()['format'](_0x1e80('0xd'));}_0x3bf6c8(null,_0x30a9f8);}},'charset':_0x1e80('0xe'),'collate':_0x1e80('0xf')});}; \ No newline at end of file +var _0xf1c6=['path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x296857,_0x4e1500){var _0x55c0e4=function(_0x4f3e51){while(--_0x4f3e51){_0x296857['push'](_0x296857['shift']());}};_0x55c0e4(++_0x4e1500);}(_0xf1c6,0x12d));var _0x6f1c=function(_0x4d3490,_0x47e4c6){_0x4d3490=_0x4d3490-0x0;var _0x34112f=_0xf1c6[_0x4d3490];return _0x34112f;};'use strict';var _=require(_0x6f1c('0x0'));var util=require(_0x6f1c('0x1'));var logger=require(_0x6f1c('0x2'))(_0x6f1c('0x3'));var moment=require('moment');var BPromise=require(_0x6f1c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f1c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f1c('0x6'));module[_0x6f1c('0x7')]=function(_0x398c47,_0x45d60f){return _0x398c47[_0x6f1c('0x8')](_0x6f1c('0x9'),attributes,{'tableName':_0x6f1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d31c8,_0x295f09,_0x446f80){if(_0x2d31c8[_0x6f1c('0xb')]('closed')){_0x2d31c8[_0x6f1c('0xc')]=moment()[_0x6f1c('0xd')](_0x6f1c('0xe'));}_0x446f80(null,_0x2d31c8);}},'charset':_0x6f1c('0xf'),'collate':_0x6f1c('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 1037ee5..1de43a2 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 _0x1815=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x550285,_0x52655b){var _0x4afa3d=function(_0x12044c){while(--_0x12044c){_0x550285['push'](_0x550285['shift']());}};_0x4afa3d(++_0x52655b);}(_0x1815,0x1d3));var _0x5181=function(_0xf0ac60,_0x4f7285){_0xf0ac60=_0xf0ac60-0x0;var _0x4be5c2=_0x1815[_0xf0ac60];return _0x4be5c2;};'use strict';var _=require(_0x5181('0x0'));var util=require(_0x5181('0x1'));var moment=require(_0x5181('0x2'));var BPromise=require('bluebird');var rs=require(_0x5181('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5181('0x4'))['db'];var utils=require(_0x5181('0x5'));var logger=require(_0x5181('0x6'))(_0x5181('0x7'));var config=require(_0x5181('0x8'));var jayson=require(_0x5181('0x9'));var client=jayson[_0x5181('0xa')][_0x5181('0xb')]({'port':0x232a});config[_0x5181('0xc')]=_[_0x5181('0xd')](config[_0x5181('0xc')],{'host':_0x5181('0xe'),'port':0x18eb});var socket=require(_0x5181('0xf'))(new Redis(config[_0x5181('0xc')]));require(_0x5181('0x10'))['register'](socket);function respondWithRpcPromise(_0x12bd0f,_0x530ad0,_0x376e41){return new BPromise(function(_0x1a605f,_0xaeaff7){return client[_0x5181('0x11')](_0x12bd0f,_0x376e41)[_0x5181('0x12')](function(_0x1f51eb){logger[_0x5181('0x13')](_0x5181('0x14'),_0x530ad0,'request\x20sent');logger[_0x5181('0x15')](_0x5181('0x16'),_0x530ad0,'request\x20sent',JSON[_0x5181('0x17')](_0x1f51eb));if(_0x1f51eb[_0x5181('0x18')]){if(_0x1f51eb['error'][_0x5181('0x19')]===0x1f4){logger[_0x5181('0x18')](_0x5181('0x14'),_0x530ad0,_0x1f51eb[_0x5181('0x18')]['message']);return _0xaeaff7(_0x1f51eb[_0x5181('0x18')]['message']);}logger[_0x5181('0x18')](_0x5181('0x14'),_0x530ad0,_0x1f51eb[_0x5181('0x18')][_0x5181('0x1a')]);return _0x1a605f(_0x1f51eb[_0x5181('0x18')][_0x5181('0x1a')]);}else{logger['info'](_0x5181('0x14'),_0x530ad0,'request\x20sent');_0x1a605f(_0x1f51eb[_0x5181('0x1b')][_0x5181('0x1a')]);}})[_0x5181('0x1c')](function(_0x3d7735){logger[_0x5181('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x530ad0,_0x3d7735);_0xaeaff7(_0x3d7735);});});}exports['UpdateChatInteraction']=function(_0x356852){var _0x2b597f=this;return new Promise(function(_0x5593de,_0x49a821){return db[_0x5181('0x1d')][_0x5181('0x1e')](_0x356852[_0x5181('0x1f')],{'raw':_0x356852[_0x5181('0x20')]?_0x356852[_0x5181('0x20')][_0x5181('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356852['options']?_0x356852[_0x5181('0x20')][_0x5181('0x22')]||null:null,'attributes':_0x356852[_0x5181('0x20')]?_0x356852[_0x5181('0x20')]['attributes']||null:null,'limit':_0x356852[_0x5181('0x20')]?_0x356852['options'][_0x5181('0x23')]||null:null})[_0x5181('0x12')](function(_0x2264f8){logger[_0x5181('0x13')](_0x5181('0x24'),_0x356852);logger[_0x5181('0x15')]('UpdateChatInteraction',_0x356852,JSON[_0x5181('0x17')](_0x2264f8));_0x5593de(_0x2264f8);})['catch'](function(_0x5735e9){logger['error'](_0x5181('0x24'),_0x5735e9['message'],_0x356852);_0x49a821(_0x2b597f[_0x5181('0x18')](0x1f4,_0x5735e9[_0x5181('0x1a')]));});});};exports[_0x5181('0x25')]=function(_0x20a9a6){return new Promise(function(_0x27505a,_0x13fe41){return db[_0x5181('0x1d')]['find']({'where':_0x20a9a6[_0x5181('0x20')]?_0x20a9a6[_0x5181('0x20')]['where']||null:null})['then'](function(_0x166b58){if(_0x166b58){return _0x166b58[_0x5181('0x26')](_0x20a9a6['body'][_0x5181('0x27')],_[_0x5181('0x28')](_0x20a9a6[_0x5181('0x1f')],[_0x5181('0x27'),'id'])||{});}})[_0x5181('0x29')](function(_0x5b9cbc){logger[_0x5181('0x13')](_0x5181('0x2a'),_0x20a9a6);logger[_0x5181('0x15')]('AddTags',_0x20a9a6,JSON['stringify'](_0x5b9cbc));_0x27505a(_0x5b9cbc);})[_0x5181('0x1c')](function(_0x404026){logger[_0x5181('0x18')](_0x5181('0x2a'),_0x404026['message'],_0x20a9a6);_0x13fe41(_this[_0x5181('0x18')](0x1f4,_0x404026[_0x5181('0x1a')]));});});}; \ No newline at end of file +var _0xc632=['debug','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit'];(function(_0x47fe52,_0x50ee83){var _0x29a772=function(_0x56e37f){while(--_0x56e37f){_0x47fe52['push'](_0x47fe52['shift']());}};_0x29a772(++_0x50ee83);}(_0xc632,0x1e0));var _0x2c63=function(_0x375d67,_0x120fee){_0x375d67=_0x375d67-0x0;var _0x37f113=_0xc632[_0x375d67];return _0x37f113;};'use strict';var _=require(_0x2c63('0x0'));var util=require('util');var moment=require(_0x2c63('0x1'));var BPromise=require(_0x2c63('0x2'));var rs=require(_0x2c63('0x3'));var fs=require('fs');var Redis=require(_0x2c63('0x4'));var db=require(_0x2c63('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c63('0x6'));var config=require(_0x2c63('0x7'));var jayson=require(_0x2c63('0x8'));var client=jayson['client'][_0x2c63('0x9')]({'port':0x232a});config['redis']=_[_0x2c63('0xa')](config['redis'],{'host':_0x2c63('0xb'),'port':0x18eb});var socket=require(_0x2c63('0xc'))(new Redis(config[_0x2c63('0xd')]));require(_0x2c63('0xe'))[_0x2c63('0xf')](socket);function respondWithRpcPromise(_0x5b0fb0,_0x3762c3,_0xcd90ad){return new BPromise(function(_0x4c12db,_0x25cca1){return client[_0x2c63('0x10')](_0x5b0fb0,_0xcd90ad)[_0x2c63('0x11')](function(_0x307fff){logger[_0x2c63('0x12')](_0x2c63('0x13'),_0x3762c3,_0x2c63('0x14'));logger['debug'](_0x2c63('0x15'),_0x3762c3,_0x2c63('0x14'),JSON[_0x2c63('0x16')](_0x307fff));if(_0x307fff[_0x2c63('0x17')]){if(_0x307fff[_0x2c63('0x17')][_0x2c63('0x18')]===0x1f4){logger[_0x2c63('0x17')](_0x2c63('0x13'),_0x3762c3,_0x307fff[_0x2c63('0x17')]['message']);return _0x25cca1(_0x307fff[_0x2c63('0x17')][_0x2c63('0x19')]);}logger[_0x2c63('0x17')](_0x2c63('0x13'),_0x3762c3,_0x307fff[_0x2c63('0x17')][_0x2c63('0x19')]);return _0x4c12db(_0x307fff['error'][_0x2c63('0x19')]);}else{logger[_0x2c63('0x12')](_0x2c63('0x13'),_0x3762c3,_0x2c63('0x14'));_0x4c12db(_0x307fff[_0x2c63('0x1a')][_0x2c63('0x19')]);}})[_0x2c63('0x1b')](function(_0x529cac){logger[_0x2c63('0x17')](_0x2c63('0x13'),_0x3762c3,_0x529cac);_0x25cca1(_0x529cac);});});}exports[_0x2c63('0x1c')]=function(_0x552740){var _0x21953d=this;return new Promise(function(_0x1c8be1,_0x2f56f2){return db[_0x2c63('0x1d')]['update'](_0x552740[_0x2c63('0x1e')],{'raw':_0x552740['options']?_0x552740[_0x2c63('0x1f')][_0x2c63('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x552740[_0x2c63('0x1f')]?_0x552740['options'][_0x2c63('0x21')]||null:null,'attributes':_0x552740[_0x2c63('0x1f')]?_0x552740[_0x2c63('0x1f')][_0x2c63('0x22')]||null:null,'limit':_0x552740[_0x2c63('0x1f')]?_0x552740[_0x2c63('0x1f')][_0x2c63('0x23')]||null:null})[_0x2c63('0x11')](function(_0x34d72f){logger[_0x2c63('0x12')](_0x2c63('0x1c'),_0x552740);logger[_0x2c63('0x24')]('UpdateChatInteraction',_0x552740,JSON[_0x2c63('0x16')](_0x34d72f));_0x1c8be1(_0x34d72f);})[_0x2c63('0x1b')](function(_0x1a3db2){logger[_0x2c63('0x17')](_0x2c63('0x1c'),_0x1a3db2[_0x2c63('0x19')],_0x552740);_0x2f56f2(_0x21953d['error'](0x1f4,_0x1a3db2['message']));});});};exports[_0x2c63('0x25')]=function(_0xe45727){return new Promise(function(_0x46c56a,_0x4a5b95){return db[_0x2c63('0x1d')][_0x2c63('0x26')]({'where':_0xe45727[_0x2c63('0x1f')]?_0xe45727[_0x2c63('0x1f')][_0x2c63('0x21')]||null:null})[_0x2c63('0x11')](function(_0x32abd2){if(_0x32abd2){return _0x32abd2[_0x2c63('0x27')](_0xe45727[_0x2c63('0x1e')][_0x2c63('0x28')],_[_0x2c63('0x29')](_0xe45727[_0x2c63('0x1e')],[_0x2c63('0x28'),'id'])||{});}})['spread'](function(_0x44d0a2){logger[_0x2c63('0x12')](_0x2c63('0x2a'),_0xe45727);logger['debug'](_0x2c63('0x2a'),_0xe45727,JSON[_0x2c63('0x16')](_0x44d0a2));_0x46c56a(_0x44d0a2);})[_0x2c63('0x1b')](function(_0x1ac8b3){logger[_0x2c63('0x17')](_0x2c63('0x2a'),_0x1ac8b3[_0x2c63('0x19')],_0xe45727);_0x4a5b95(_this[_0x2c63('0x17')](0x1f4,_0x1ac8b3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index e2d6e3d..a9e6a35 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 _0x818f=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x324520,_0x42a48d){var _0x4d6de7=function(_0x3bf39d){while(--_0x3bf39d){_0x324520['push'](_0x324520['shift']());}};_0x4d6de7(++_0x42a48d);}(_0x818f,0x1da));var _0xf818=function(_0x292b3e,_0x4faeb3){_0x292b3e=_0x292b3e-0x0;var _0x5c7e80=_0x818f[_0x292b3e];return _0x5c7e80;};'use strict';var ChatInteractionEvents=require(_0xf818('0x0'));var events=[_0xf818('0x1'),_0xf818('0x2'),_0xf818('0x3')];function createListener(_0x121db7,_0x39b430){return function(_0x58f142){_0x39b430[_0xf818('0x4')](_0x121db7,_0x58f142);};}function removeListener(_0xd6c86,_0x2c1bb0){return function(){ChatInteractionEvents[_0xf818('0x5')](_0xd6c86,_0x2c1bb0);};}exports[_0xf818('0x6')]=function(_0x41310f){for(var _0x27119b=0x0,_0x42a23e=events[_0xf818('0x7')];_0x27119b<_0x42a23e;_0x27119b++){var _0x55540d=events[_0x27119b];var _0x1dbfc8=createListener(_0xf818('0x8')+_0x55540d,_0x41310f);ChatInteractionEvents['on'](_0x55540d,_0x1dbfc8);}}; \ No newline at end of file +var _0x1f4f=['removeListener','register','./chatInteraction.events','save','remove','update','emit'];(function(_0x3cecd4,_0xb0bcf6){var _0x3d3577=function(_0x10a3fe){while(--_0x10a3fe){_0x3cecd4['push'](_0x3cecd4['shift']());}};_0x3d3577(++_0xb0bcf6);}(_0x1f4f,0x1d7));var _0xf1f4=function(_0x576b6f,_0x1861fc){_0x576b6f=_0x576b6f-0x0;var _0x125aaf=_0x1f4f[_0x576b6f];return _0x125aaf;};'use strict';var ChatInteractionEvents=require(_0xf1f4('0x0'));var events=[_0xf1f4('0x1'),_0xf1f4('0x2'),_0xf1f4('0x3')];function createListener(_0x363f62,_0x2c9b57){return function(_0x53c87d){_0x2c9b57[_0xf1f4('0x4')](_0x363f62,_0x53c87d);};}function removeListener(_0x3d8e41,_0x2bdc68){return function(){ChatInteractionEvents[_0xf1f4('0x5')](_0x3d8e41,_0x2bdc68);};}exports[_0xf1f4('0x6')]=function(_0x4b6589){for(var _0x980862=0x0,_0x189f74=events['length'];_0x980862<_0x189f74;_0x980862++){var _0x4976b2=events[_0x980862];var _0x3f3866=createListener('chatInteraction:'+_0x4976b2,_0x4b6589);ChatInteractionEvents['on'](_0x4976b2,_0x3f3866);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e6d4f5f..acbac31 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 _0x71cb=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','customUpdate','close','delete','chatinteraction:destroy','destroy','/:id/tags'];(function(_0xb67251,_0x1f6208){var _0x979d96=function(_0x41d0d0){while(--_0x41d0d0){_0xb67251['push'](_0xb67251['shift']());}};_0x979d96(++_0x1f6208);}(_0x71cb,0x109));var _0xb71c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x71cb[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0xb71c('0x0'));var util=require(_0xb71c('0x1'));var path=require(_0xb71c('0x2'));var timeout=require(_0xb71c('0x3'));var express=require(_0xb71c('0x4'));var router=express[_0xb71c('0x5')]();var fs_extra=require(_0xb71c('0x6'));var auth=require(_0xb71c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb71c('0x8'));var controller=require(_0xb71c('0x9'));router[_0xb71c('0xa')]('/',auth[_0xb71c('0xb')](),controller['index']);router[_0xb71c('0xa')](_0xb71c('0xc'),auth[_0xb71c('0xb')](),controller[_0xb71c('0xd')]);router['get'](_0xb71c('0xe'),auth[_0xb71c('0xf')](),controller[_0xb71c('0x10')]);router[_0xb71c('0xa')](_0xb71c('0x11'),auth[_0xb71c('0xf')](),controller[_0xb71c('0x12')]);router[_0xb71c('0xa')]('/:id/messages',auth[_0xb71c('0xb')](),controller[_0xb71c('0x13')]);router[_0xb71c('0xa')]('/:id/my_messages',auth[_0xb71c('0xf')](),controller[_0xb71c('0x14')]);router[_0xb71c('0xa')](_0xb71c('0x15'),auth[_0xb71c('0xb')](),controller[_0xb71c('0x16')]);router['post']('/',auth[_0xb71c('0xb')](),controller[_0xb71c('0x17')]);router[_0xb71c('0x18')](_0xb71c('0x19'),auth['isAuthenticated'](),controller[_0xb71c('0x1a')]);var upload=multer({'storage':multer[_0xb71c('0x1b')]({'destination':function(_0x11afe6,_0x251495,_0xb682f8){_0xb682f8(null,path[_0xb71c('0x1c')](config[_0xb71c('0x1d')],_0xb71c('0x1e')));},'filename':function(_0x32de37,_0x1d1078,_0x2294bd){_0x2294bd(null,util[_0xb71c('0x1f')]('%s-%s',Date[_0xb71c('0x20')](),_0x1d1078[_0xb71c('0x21')][_0xb71c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb71c('0x23'),upload['single'](_0xb71c('0x24')),controller[_0xb71c('0x25')]);router['post'](_0xb71c('0x26'),auth['isChatInteractionAuthorized'](),controller[_0xb71c('0x27')]);router['post']('/:id/tags',auth[_0xb71c('0xb')](),interaction[_0xb71c('0x28')](_0xb71c('0x29'),_0xb71c('0x2a')),controller[_0xb71c('0x2b')]);router['put'](_0xb71c('0xe'),auth[_0xb71c('0xb')](),interaction[_0xb71c('0x28')](_0xb71c('0x29'),_0xb71c('0x2c')),controller[_0xb71c('0x2d')]);router[_0xb71c('0x2e')]('/:id/custom_update',controller[_0xb71c('0x2f')]);router[_0xb71c('0x2e')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xb71c('0x2e')]('/:id/close',controller[_0xb71c('0x30')]);router[_0xb71c('0x31')](_0xb71c('0xe'),auth[_0xb71c('0xb')](),interaction[_0xb71c('0x28')](_0xb71c('0x29'),_0xb71c('0x32')),controller[_0xb71c('0x33')]);router[_0xb71c('0x31')](_0xb71c('0x34'),auth[_0xb71c('0xb')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xe4e8=['close','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','/:id/attachment_upload','file','/:id/tags','tracked','addTags','chat','update','put','/:id/custom_update','abandon','/:id/close'];(function(_0x215bb2,_0x48f2d8){var _0x4ebbaf=function(_0x1d35ab){while(--_0x1d35ab){_0x215bb2['push'](_0x215bb2['shift']());}};_0x4ebbaf(++_0x48f2d8);}(_0xe4e8,0x17d));var _0x8e4e=function(_0x52e192,_0x3d6a2c){_0x52e192=_0x52e192-0x0;var _0x4bf3e3=_0xe4e8[_0x52e192];return _0x4bf3e3;};'use strict';var multer=require(_0x8e4e('0x0'));var util=require(_0x8e4e('0x1'));var path=require(_0x8e4e('0x2'));var timeout=require(_0x8e4e('0x3'));var express=require(_0x8e4e('0x4'));var router=express[_0x8e4e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e4e('0x6'));var controller=require(_0x8e4e('0x7'));router[_0x8e4e('0x8')]('/',auth[_0x8e4e('0x9')](),controller[_0x8e4e('0xa')]);router[_0x8e4e('0x8')](_0x8e4e('0xb'),auth[_0x8e4e('0x9')](),controller['describe']);router[_0x8e4e('0x8')](_0x8e4e('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x8e4e('0xd')]);router['get'](_0x8e4e('0xe'),auth[_0x8e4e('0xf')](),controller[_0x8e4e('0x10')]);router[_0x8e4e('0x8')](_0x8e4e('0x11'),auth['isAuthenticated'](),controller[_0x8e4e('0x12')]);router[_0x8e4e('0x8')](_0x8e4e('0x13'),auth[_0x8e4e('0xf')](),controller[_0x8e4e('0x14')]);router[_0x8e4e('0x8')](_0x8e4e('0x15'),auth['isAuthenticated'](),controller[_0x8e4e('0x16')]);router[_0x8e4e('0x17')]('/',auth[_0x8e4e('0x9')](),controller[_0x8e4e('0x18')]);router['post']('/:id/vidaoo',auth[_0x8e4e('0x9')](),controller[_0x8e4e('0x19')]);var upload=multer({'storage':multer[_0x8e4e('0x1a')]({'destination':function(_0x21d9e3,_0x36df79,_0x101d0e){_0x101d0e(null,path['join'](config['root'],_0x8e4e('0x1b')));},'filename':function(_0x560a34,_0x20c152,_0x376557){_0x376557(null,util[_0x8e4e('0x1c')](_0x8e4e('0x1d'),Date[_0x8e4e('0x1e')](),_0x20c152['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8e4e('0x17')](_0x8e4e('0x1f'),upload['single'](_0x8e4e('0x20')),controller['attachmentUpload']);router[_0x8e4e('0x17')](_0x8e4e('0x11'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x8e4e('0x17')](_0x8e4e('0x21'),auth[_0x8e4e('0x9')](),interaction[_0x8e4e('0x22')]('chat','chatinteraction:addtags'),controller[_0x8e4e('0x23')]);router['put'](_0x8e4e('0xc'),auth['isAuthenticated'](),interaction[_0x8e4e('0x22')](_0x8e4e('0x24'),'chatinteraction:update'),controller[_0x8e4e('0x25')]);router[_0x8e4e('0x26')](_0x8e4e('0x27'),controller['customUpdate']);router[_0x8e4e('0x26')]('/:id/abandon',auth[_0x8e4e('0xf')](),controller[_0x8e4e('0x28')]);router['put'](_0x8e4e('0x29'),controller[_0x8e4e('0x2a')]);router[_0x8e4e('0x2b')](_0x8e4e('0xc'),auth['isAuthenticated'](),interaction[_0x8e4e('0x22')](_0x8e4e('0x24'),_0x8e4e('0x2c')),controller['destroy']);router[_0x8e4e('0x2b')](_0x8e4e('0x21'),auth[_0x8e4e('0x9')](),controller[_0x8e4e('0x2d')]);module[_0x8e4e('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index e4765bc..8d1048c 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 _0x17bb=['TEXT','INTEGER','exports'];(function(_0x51d526,_0x291bcb){var _0xddb6cc=function(_0x2fade1){while(--_0x2fade1){_0x51d526['push'](_0x51d526['shift']());}};_0xddb6cc(++_0x291bcb);}(_0x17bb,0x131));var _0xb17b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x17bb[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0xb17b('0x0')]={'body':{'type':Sequelize[_0xb17b('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb17b('0x2')]}}; \ No newline at end of file +var _0xf53e=['INTEGER','sequelize','exports','medium'];(function(_0x46c68e,_0x5c7527){var _0x3fdd41=function(_0x4d4ebd){while(--_0x4d4ebd){_0x46c68e['push'](_0x46c68e['shift']());}};_0x3fdd41(++_0x5c7527);}(_0xf53e,0x1b5));var _0xef53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf53e[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xef53('0x0'));module[_0xef53('0x1')]={'body':{'type':Sequelize['TEXT'](_0xef53('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xef53('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 2cd4eb9..a0122cb 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 _0xd059=['lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','error','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','update','find','describe','messages','lastMessageAt'];(function(_0x334763,_0x575eff){var _0x566db0=function(_0x217cc2){while(--_0x217cc2){_0x334763['push'](_0x334763['shift']());}};_0x566db0(++_0x575eff);}(_0xd059,0x172));var _0x9d05=function(_0x4a7763,_0x5e8437){_0x4a7763=_0x4a7763-0x0;var _0x682b2f=_0xd059[_0x4a7763];return _0x682b2f;};'use strict';var emlformat=require(_0x9d05('0x0'));var rimraf=require(_0x9d05('0x1'));var zipdir=require(_0x9d05('0x2'));var jsonpatch=require(_0x9d05('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d05('0x4'));var Mustache=require(_0x9d05('0x5'));var util=require(_0x9d05('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9d05('0x7'));var ejs=require(_0x9d05('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d05('0x9'));var squel=require(_0x9d05('0xa'));var crypto=require(_0x9d05('0xb'));var jsforce=require(_0x9d05('0xc'));var deskjs=require(_0x9d05('0xd'));var toCsv=require(_0x9d05('0x7'));var querystring=require(_0x9d05('0xe'));var Papa=require(_0x9d05('0xf'));var Redis=require(_0x9d05('0x10'));var authService=require(_0x9d05('0x11'));var qs=require(_0x9d05('0x12'));var as=require(_0x9d05('0x13'));var hardwareService=require(_0x9d05('0x14'));var logger=require(_0x9d05('0x15'))(_0x9d05('0x16'));var utils=require('../../config/utils');var config=require(_0x9d05('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d05('0x18'))['db'];config[_0x9d05('0x19')]=_[_0x9d05('0x1a')](config[_0x9d05('0x19')],{'host':_0x9d05('0x1b'),'port':0x18eb});var socket=require(_0x9d05('0x1c'))(new Redis(config[_0x9d05('0x19')]));require(_0x9d05('0x1d'))[_0x9d05('0x1e')](socket);function respondWithStatusCode(_0x16ea19,_0x44c8f8){_0x44c8f8=_0x44c8f8||0xcc;return function(_0x35fd2e){if(_0x35fd2e){return _0x16ea19[_0x9d05('0x1f')](_0x44c8f8);}return _0x16ea19['status'](_0x44c8f8)['end']();};}function respondWithResult(_0x545521,_0x143ed5){_0x143ed5=_0x143ed5||0xc8;return function(_0xd6dd7f){if(_0xd6dd7f){return _0x545521[_0x9d05('0x20')](_0x143ed5)[_0x9d05('0x21')](_0xd6dd7f);}};}function respondWithFilteredResult(_0x5a290e,_0x3ef6b8){return function(_0xe3f129){if(_0xe3f129){var _0x6f46db=typeof _0x3ef6b8[_0x9d05('0x22')]==='undefined'&&typeof _0x3ef6b8[_0x9d05('0x23')]===_0x9d05('0x24');var _0xe22eb6=_0xe3f129[_0x9d05('0x25')];var _0x27bda1=_0x6f46db?0x0:_0x3ef6b8[_0x9d05('0x22')];var _0x5378d3=_0x6f46db?_0xe3f129[_0x9d05('0x25')]:_0x3ef6b8[_0x9d05('0x22')]+_0x3ef6b8['limit'];var _0x14ae3c;if(_0x5378d3>=_0xe22eb6){_0x5378d3=_0xe22eb6;_0x14ae3c=0xc8;}else{_0x14ae3c=0xce;}_0x5a290e['status'](_0x14ae3c);return _0x5a290e[_0x9d05('0x26')](_0x9d05('0x27'),_0x27bda1+'-'+_0x5378d3+'/'+_0xe22eb6)[_0x9d05('0x21')](_0xe3f129);}return null;};}function patchUpdates(_0x26af89){return function(_0xff50d){try{jsonpatch[_0x9d05('0x28')](_0xff50d,_0x26af89,!![]);}catch(_0xc4dad6){return BPromise[_0x9d05('0x29')](_0xc4dad6);}return _0xff50d[_0x9d05('0x2a')]();};}function saveUpdates(_0x54c036,_0x13f981){return function(_0xa3a4){if(_0xa3a4){return _0xa3a4['update'](_0x54c036)['then'](function(_0x48f61b){return _0x48f61b;});}return null;};}function removeEntity(_0x2d3951,_0x271ded){return function(_0x57bcfa){if(_0x57bcfa){return _0x57bcfa[_0x9d05('0x2b')]()[_0x9d05('0x2c')](function(){_0x2d3951[_0x9d05('0x20')](0xcc)[_0x9d05('0x2d')]();});}};}function handleEntityNotFound(_0x149cd1,_0xac6807){return function(_0x3f1f7b){if(!_0x3f1f7b){_0x149cd1[_0x9d05('0x1f')](0x194);}return _0x3f1f7b;};}function handleError(_0x5cf4a7,_0x4f82c5){_0x4f82c5=_0x4f82c5||0x1f4;return function(_0x2f96f7){logger[_0x9d05('0x2e')](_0x2f96f7['stack']);if(_0x2f96f7[_0x9d05('0x2f')]){delete _0x2f96f7[_0x9d05('0x2f')];}_0x5cf4a7[_0x9d05('0x20')](_0x4f82c5)[_0x9d05('0x30')](_0x2f96f7);};}exports['index']=function(_0x4e82a0,_0x35e8bc){var _0xdb73ea={},_0xf248e2={},_0x329357={'count':0x0,'rows':[]};var _0x40f79c=_['map'](db[_0x9d05('0x31')][_0x9d05('0x32')],function(_0x340d73){return{'name':_0x340d73[_0x9d05('0x33')],'type':_0x340d73[_0x9d05('0x34')][_0x9d05('0x35')]};});_0xf248e2[_0x9d05('0x36')]=_[_0x9d05('0x37')](_0x40f79c,'name');_0xf248e2['query']=_['keys'](_0x4e82a0['query']);_0xf248e2[_0x9d05('0x38')]=_[_0x9d05('0x39')](_0xf248e2['model'],_0xf248e2[_0x9d05('0x3a')]);_0xdb73ea['attributes']=_[_0x9d05('0x39')](_0xf248e2[_0x9d05('0x36')],qs[_0x9d05('0x3b')](_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x3b')]));_0xdb73ea[_0x9d05('0x3c')]=_0xdb73ea['attributes'][_0x9d05('0x3d')]?_0xdb73ea['attributes']:_0xf248e2[_0x9d05('0x36')];if(!_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x3e')](_0x9d05('0x3f'))){_0xdb73ea[_0x9d05('0x23')]=qs[_0x9d05('0x23')](_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x23')]);_0xdb73ea[_0x9d05('0x22')]=qs[_0x9d05('0x22')](_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x22')]);}_0xdb73ea['order']=qs[_0x9d05('0x40')](_0x4e82a0[_0x9d05('0x3a')]['sort']);_0xdb73ea[_0x9d05('0x41')]=qs[_0x9d05('0x38')](_[_0x9d05('0x42')](_0x4e82a0[_0x9d05('0x3a')],_0xf248e2[_0x9d05('0x38')]),_0x40f79c);if(_0x4e82a0[_0x9d05('0x3a')]['filter']){_0xdb73ea['where']=_['merge'](_0xdb73ea[_0x9d05('0x41')],{'$or':_[_0x9d05('0x37')](_0x40f79c,function(_0x53877b){if(_0x53877b[_0x9d05('0x34')]!==_0x9d05('0x43')){var _0x50097b={};_0x50097b[_0x53877b['name']]={'$like':'%'+_0x4e82a0[_0x9d05('0x3a')][_0x9d05('0x44')]+'%'};return _0x50097b;}})});}_0xdb73ea=_[_0x9d05('0x45')]({},_0xdb73ea,_0x4e82a0[_0x9d05('0x46')]);var _0x2165d9={'where':_0xdb73ea[_0x9d05('0x41')]};return db[_0x9d05('0x31')][_0x9d05('0x25')](_0x2165d9)[_0x9d05('0x2c')](function(_0x4dde26){_0x329357[_0x9d05('0x25')]=_0x4dde26;if(_0x4e82a0['query'][_0x9d05('0x47')]){_0xdb73ea[_0x9d05('0x48')]=[{'all':!![]}];}return db[_0x9d05('0x31')][_0x9d05('0x49')](_0xdb73ea);})[_0x9d05('0x2c')](function(_0x34d32d){_0x329357[_0x9d05('0x4a')]=_0x34d32d;return _0x329357;})[_0x9d05('0x2c')](respondWithFilteredResult(_0x35e8bc,_0xdb73ea))['catch'](handleError(_0x35e8bc,null));};exports[_0x9d05('0x4b')]=function(_0x2f795d,_0x47cb58){var _0x1b56db={'raw':!![],'where':{'id':_0x2f795d[_0x9d05('0x4c')]['id']}},_0x386434={};_0x386434[_0x9d05('0x36')]=_[_0x9d05('0x4d')](db[_0x9d05('0x31')][_0x9d05('0x32')]);_0x386434[_0x9d05('0x3a')]=_['keys'](_0x2f795d[_0x9d05('0x3a')]);_0x386434[_0x9d05('0x38')]=_['intersection'](_0x386434[_0x9d05('0x36')],_0x386434[_0x9d05('0x3a')]);_0x1b56db[_0x9d05('0x3c')]=_[_0x9d05('0x39')](_0x386434['model'],qs[_0x9d05('0x3b')](_0x2f795d[_0x9d05('0x3a')][_0x9d05('0x3b')]));_0x1b56db['attributes']=_0x1b56db['attributes'][_0x9d05('0x3d')]?_0x1b56db['attributes']:_0x386434['model'];if(_0x2f795d['query'][_0x9d05('0x47')]){_0x1b56db[_0x9d05('0x48')]=[{'all':!![]}];}_0x1b56db=_[_0x9d05('0x45')]({},_0x1b56db,_0x2f795d[_0x9d05('0x46')]);return db[_0x9d05('0x31')]['find'](_0x1b56db)[_0x9d05('0x2c')](handleEntityNotFound(_0x47cb58,null))[_0x9d05('0x2c')](respondWithResult(_0x47cb58,null))[_0x9d05('0x4e')](handleError(_0x47cb58,null));};exports[_0x9d05('0x4f')]=function(_0x212aa8,_0x47ef9e){return db[_0x9d05('0x31')][_0x9d05('0x4f')](_0x212aa8[_0x9d05('0x50')],{})[_0x9d05('0x2c')](respondWithResult(_0x47ef9e,0xc9))[_0x9d05('0x4e')](handleError(_0x47ef9e,null));};exports[_0x9d05('0x51')]=function(_0x553556,_0x351b5f){if(_0x553556[_0x9d05('0x50')]['id']){delete _0x553556[_0x9d05('0x50')]['id'];}return db[_0x9d05('0x31')][_0x9d05('0x52')]({'where':{'id':_0x553556[_0x9d05('0x4c')]['id']}})[_0x9d05('0x2c')](handleEntityNotFound(_0x351b5f,null))['then'](saveUpdates(_0x553556['body'],null))[_0x9d05('0x2c')](respondWithResult(_0x351b5f,null))['catch'](handleError(_0x351b5f,null));};exports['destroy']=function(_0x547e73,_0x1bd8cc){return db['ChatInternalMessage'][_0x9d05('0x52')]({'where':{'id':_0x547e73[_0x9d05('0x4c')]['id']}})[_0x9d05('0x2c')](handleEntityNotFound(_0x1bd8cc,null))[_0x9d05('0x2c')](removeEntity(_0x1bd8cc,null))[_0x9d05('0x4e')](handleError(_0x1bd8cc,null));};exports[_0x9d05('0x53')]=function(_0x1ef358,_0x250a39){return db['ChatInternalMessage'][_0x9d05('0x53')]()['then'](respondWithResult(_0x250a39,null))[_0x9d05('0x4e')](handleError(_0x250a39,null));};function wrapUser(_0x52e6dd){return function(_0x37c44b){var _0x3775f3=_0x52e6dd['get']({'plain':!![]});_0x3775f3[_0x9d05('0x54')]=[];if(_0x37c44b){_0x3775f3[_0x9d05('0x55')]=_0x37c44b['createdAt'];_0x3775f3[_0x9d05('0x56')]=_0x37c44b;}else{_0x3775f3['lastMessageAt']=moment(0x0)[_0x9d05('0x57')](_0x9d05('0x58'));_0x3775f3[_0x9d05('0x56')]={};}return _0x3775f3;};}exports[_0x9d05('0x59')]=function(_0x49e7af,_0x4ad39d,_0x569597){var _0x4232b4=[];return db[_0x9d05('0x5a')]['findAll']({'where':{'role':[_0x9d05('0x5b'),'admin',_0x9d05('0x5c')]},'attributes':['id',_0x9d05('0x5d'),_0x9d05('0x2f'),_0x9d05('0x5e'),_0x9d05('0x5f'),_0x9d05('0x60'),_0x9d05('0x61'),_0x9d05('0x62'),'allowmessenger','showWebBar'],'order':qs[_0x9d05('0x40')](_0x9d05('0x63')),'include':[{'model':db[_0x9d05('0x64')],'as':_0x9d05('0x65'),'attributes':['id',_0x9d05('0x2f'),_0x9d05('0x34')],'through':{'attributes':[]}}]})[_0x9d05('0x2c')](function(_0x2a97fa){if(_0x2a97fa){var _0x5cda3a=_0x49e7af[_0x9d05('0x5c')][_0x9d05('0x66')]({'plain':!![]});if(!_0x5cda3a)throw new Error(_0x9d05('0x67'));if(_0x5cda3a['role']==='user'){return db['UserProfileSection']['find']({'where':{'name':_0x9d05('0x68'),'userProfileId':_0x5cda3a['userProfileId']},'raw':!![]})[_0x9d05('0x2c')](function(_0x1667de){if(_0x1667de){if(_0x1667de[_0x9d05('0x69')]===0x0){return db[_0x9d05('0x6a')][_0x9d05('0x49')]({'where':{'sectionId':_0x1667de['id']},'raw':!![]})[_0x9d05('0x2c')](function(_0x3aed0e){var _0x3a8c38=[];if(_[_0x9d05('0x6b')](_0x3aed0e)){_0x3a8c38=_[_0x9d05('0x44')](_0x2a97fa,function(_0x18d9fe){if(_0x18d9fe[_0x9d05('0x5e')]!==_0x9d05('0x5b')){return _0x18d9fe;}});return _0x3a8c38;}else{for(var _0x1932d2=0x0;_0x1932d2<_0x2a97fa[_0x9d05('0x3d')];_0x1932d2++){var _0x5a29d4=_0x2a97fa[_0x1932d2];if(_0x5a29d4[_0x9d05('0x5e')]===_0x9d05('0x5b')){var _0x351ee6=_[_0x9d05('0x52')](_0x3aed0e,function(_0x246248){return _0x246248[_0x9d05('0x6c')]===_0x5a29d4['id'];});if(_0x351ee6)_0x3a8c38['push'](_0x5a29d4);}else{_0x3a8c38['push'](_0x5a29d4);}}return _0x3a8c38;}});}else{return _0x2a97fa;}}else{var _0x24d2ba=_['filter'](_0x2a97fa,function(_0x54d50b){if(_0x54d50b['role']!==_0x9d05('0x5b')){return _0x54d50b;}});return _0x24d2ba;}});}else{return _0x2a97fa;}}})[_0x9d05('0x2c')](function(_0x5d3ab0){var _0x108bb1=[];if(_0x5d3ab0){_0x4232b4=_0x5d3ab0;for(var _0x228e89=0x0;_0x228e89<_0x5d3ab0['length'];_0x228e89+=0x1){_0x4232b4[_0x228e89][_0x9d05('0x54')]=[];_0x108bb1[_0x9d05('0x6d')](db['ChatInternalMessage'][_0x9d05('0x52')]({'where':{'FromId':[_0x49e7af[_0x9d05('0x5c')]['id'],_0x5d3ab0[_0x228e89]['id']],'ToId':[_0x49e7af[_0x9d05('0x5c')]['id'],_0x5d3ab0[_0x228e89]['id']],'ChatGroupId':null},'attributes':['id',_0x9d05('0x6e'),_0x9d05('0x6f'),'ToId','read',_0x9d05('0x50')],'order':qs[_0x9d05('0x40')](_0x9d05('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9d05('0x2c')](wrapUser(_0x5d3ab0[_0x228e89])));}return BPromise[_0x9d05('0x71')](_0x108bb1);}return[];})[_0x9d05('0x2c')](function(_0x4b9336){return{'rows':_0x4b9336,'count':_0x4b9336[_0x9d05('0x3d')]};})[_0x9d05('0x2c')](respondWithResult(_0x4ad39d,null))[_0x9d05('0x4e')](handleError(_0x4ad39d,null));}; \ No newline at end of file +var _0x0ba9=['read','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x0ba9,0x1c1));var _0x90ba=function(_0x1b1df0,_0x1a5570){_0x1b1df0=_0x1b1df0-0x0;var _0x442534=_0x0ba9[_0x1b1df0];return _0x442534;};'use strict';var emlformat=require(_0x90ba('0x0'));var rimraf=require(_0x90ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90ba('0x2'));var rp=require(_0x90ba('0x3'));var moment=require(_0x90ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x90ba('0x5'));var util=require(_0x90ba('0x6'));var path=require(_0x90ba('0x7'));var sox=require('sox');var csv=require(_0x90ba('0x8'));var ejs=require(_0x90ba('0x9'));var fs=require('fs');var fs_extra=require(_0x90ba('0xa'));var _=require(_0x90ba('0xb'));var squel=require('squel');var crypto=require(_0x90ba('0xc'));var jsforce=require(_0x90ba('0xd'));var deskjs=require(_0x90ba('0xe'));var toCsv=require(_0x90ba('0x8'));var querystring=require(_0x90ba('0xf'));var Papa=require('papaparse');var Redis=require(_0x90ba('0x10'));var authService=require(_0x90ba('0x11'));var qs=require(_0x90ba('0x12'));var as=require(_0x90ba('0x13'));var hardwareService=require(_0x90ba('0x14'));var logger=require(_0x90ba('0x15'))(_0x90ba('0x16'));var utils=require(_0x90ba('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x90ba('0x18'));var db=require(_0x90ba('0x19'))['db'];config[_0x90ba('0x1a')]=_[_0x90ba('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x90ba('0x1c'))(new Redis(config['redis']));require(_0x90ba('0x1d'))[_0x90ba('0x1e')](socket);function respondWithStatusCode(_0x56ab16,_0x1ef87b){_0x1ef87b=_0x1ef87b||0xcc;return function(_0x314d5e){if(_0x314d5e){return _0x56ab16[_0x90ba('0x1f')](_0x1ef87b);}return _0x56ab16['status'](_0x1ef87b)[_0x90ba('0x20')]();};}function respondWithResult(_0x3bb31d,_0x1ba098){_0x1ba098=_0x1ba098||0xc8;return function(_0x7a30a1){if(_0x7a30a1){return _0x3bb31d['status'](_0x1ba098)[_0x90ba('0x21')](_0x7a30a1);}};}function respondWithFilteredResult(_0x463c70,_0x38cf7a){return function(_0x29d527){if(_0x29d527){var _0x516be5=typeof _0x38cf7a[_0x90ba('0x22')]===_0x90ba('0x23')&&typeof _0x38cf7a[_0x90ba('0x24')]===_0x90ba('0x23');var _0x4e51d1=_0x29d527[_0x90ba('0x25')];var _0x424377=_0x516be5?0x0:_0x38cf7a[_0x90ba('0x22')];var _0xd66294=_0x516be5?_0x29d527['count']:_0x38cf7a[_0x90ba('0x22')]+_0x38cf7a[_0x90ba('0x24')];var _0x412628;if(_0xd66294>=_0x4e51d1){_0xd66294=_0x4e51d1;_0x412628=0xc8;}else{_0x412628=0xce;}_0x463c70[_0x90ba('0x26')](_0x412628);return _0x463c70[_0x90ba('0x27')](_0x90ba('0x28'),_0x424377+'-'+_0xd66294+'/'+_0x4e51d1)[_0x90ba('0x21')](_0x29d527);}return null;};}function patchUpdates(_0x3abead){return function(_0x12e1dc){try{jsonpatch[_0x90ba('0x29')](_0x12e1dc,_0x3abead,!![]);}catch(_0x27886e){return BPromise[_0x90ba('0x2a')](_0x27886e);}return _0x12e1dc[_0x90ba('0x2b')]();};}function saveUpdates(_0x3b0be5,_0x1aaaa1){return function(_0x4901f8){if(_0x4901f8){return _0x4901f8[_0x90ba('0x2c')](_0x3b0be5)[_0x90ba('0x2d')](function(_0x463002){return _0x463002;});}return null;};}function removeEntity(_0x218e11,_0x3f3c8a){return function(_0x1bbcd7){if(_0x1bbcd7){return _0x1bbcd7[_0x90ba('0x2e')]()['then'](function(){_0x218e11[_0x90ba('0x26')](0xcc)[_0x90ba('0x20')]();});}};}function handleEntityNotFound(_0x484083,_0x19b669){return function(_0x4a9a0a){if(!_0x4a9a0a){_0x484083[_0x90ba('0x1f')](0x194);}return _0x4a9a0a;};}function handleError(_0x18a6f4,_0x2f2078){_0x2f2078=_0x2f2078||0x1f4;return function(_0x2b31fb){logger[_0x90ba('0x2f')](_0x2b31fb['stack']);if(_0x2b31fb[_0x90ba('0x30')]){delete _0x2b31fb[_0x90ba('0x30')];}_0x18a6f4[_0x90ba('0x26')](_0x2f2078)[_0x90ba('0x31')](_0x2b31fb);};}exports[_0x90ba('0x32')]=function(_0x81d56a,_0x57f7d6){var _0x306831={},_0x1232a4={},_0xda176d={'count':0x0,'rows':[]};var _0x12c3d0=_[_0x90ba('0x33')](db['ChatInternalMessage'][_0x90ba('0x34')],function(_0x13ea02){return{'name':_0x13ea02['fieldName'],'type':_0x13ea02[_0x90ba('0x35')][_0x90ba('0x36')]};});_0x1232a4[_0x90ba('0x37')]=_[_0x90ba('0x33')](_0x12c3d0,_0x90ba('0x30'));_0x1232a4[_0x90ba('0x38')]=_[_0x90ba('0x39')](_0x81d56a['query']);_0x1232a4[_0x90ba('0x3a')]=_[_0x90ba('0x3b')](_0x1232a4[_0x90ba('0x37')],_0x1232a4['query']);_0x306831['attributes']=_['intersection'](_0x1232a4[_0x90ba('0x37')],qs[_0x90ba('0x3c')](_0x81d56a[_0x90ba('0x38')][_0x90ba('0x3c')]));_0x306831['attributes']=_0x306831[_0x90ba('0x3d')][_0x90ba('0x3e')]?_0x306831[_0x90ba('0x3d')]:_0x1232a4[_0x90ba('0x37')];if(!_0x81d56a['query'][_0x90ba('0x3f')](_0x90ba('0x40'))){_0x306831[_0x90ba('0x24')]=qs[_0x90ba('0x24')](_0x81d56a['query'][_0x90ba('0x24')]);_0x306831[_0x90ba('0x22')]=qs[_0x90ba('0x22')](_0x81d56a[_0x90ba('0x38')][_0x90ba('0x22')]);}_0x306831['order']=qs[_0x90ba('0x41')](_0x81d56a[_0x90ba('0x38')][_0x90ba('0x41')]);_0x306831['where']=qs[_0x90ba('0x3a')](_[_0x90ba('0x42')](_0x81d56a[_0x90ba('0x38')],_0x1232a4['filters']),_0x12c3d0);if(_0x81d56a[_0x90ba('0x38')][_0x90ba('0x43')]){_0x306831[_0x90ba('0x44')]=_[_0x90ba('0x45')](_0x306831['where'],{'$or':_['map'](_0x12c3d0,function(_0x1f0acd){if(_0x1f0acd['type']!=='VIRTUAL'){var _0x4b71f8={};_0x4b71f8[_0x1f0acd[_0x90ba('0x30')]]={'$like':'%'+_0x81d56a[_0x90ba('0x38')][_0x90ba('0x43')]+'%'};return _0x4b71f8;}})});}_0x306831=_['merge']({},_0x306831,_0x81d56a[_0x90ba('0x46')]);var _0x14c37f={'where':_0x306831[_0x90ba('0x44')]};return db[_0x90ba('0x47')][_0x90ba('0x25')](_0x14c37f)[_0x90ba('0x2d')](function(_0x39dd45){_0xda176d[_0x90ba('0x25')]=_0x39dd45;if(_0x81d56a[_0x90ba('0x38')][_0x90ba('0x48')]){_0x306831[_0x90ba('0x49')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x90ba('0x4a')](_0x306831);})[_0x90ba('0x2d')](function(_0x2462fa){_0xda176d[_0x90ba('0x4b')]=_0x2462fa;return _0xda176d;})['then'](respondWithFilteredResult(_0x57f7d6,_0x306831))[_0x90ba('0x4c')](handleError(_0x57f7d6,null));};exports[_0x90ba('0x4d')]=function(_0x2fe793,_0xc9fc86){var _0x1c523d={'raw':!![],'where':{'id':_0x2fe793['params']['id']}},_0x2b7f4c={};_0x2b7f4c[_0x90ba('0x37')]=_[_0x90ba('0x39')](db[_0x90ba('0x47')][_0x90ba('0x34')]);_0x2b7f4c[_0x90ba('0x38')]=_[_0x90ba('0x39')](_0x2fe793['query']);_0x2b7f4c[_0x90ba('0x3a')]=_[_0x90ba('0x3b')](_0x2b7f4c[_0x90ba('0x37')],_0x2b7f4c['query']);_0x1c523d['attributes']=_['intersection'](_0x2b7f4c[_0x90ba('0x37')],qs[_0x90ba('0x3c')](_0x2fe793[_0x90ba('0x38')][_0x90ba('0x3c')]));_0x1c523d[_0x90ba('0x3d')]=_0x1c523d['attributes']['length']?_0x1c523d[_0x90ba('0x3d')]:_0x2b7f4c['model'];if(_0x2fe793[_0x90ba('0x38')][_0x90ba('0x48')]){_0x1c523d[_0x90ba('0x49')]=[{'all':!![]}];}_0x1c523d=_[_0x90ba('0x45')]({},_0x1c523d,_0x2fe793['options']);return db[_0x90ba('0x47')][_0x90ba('0x4e')](_0x1c523d)[_0x90ba('0x2d')](handleEntityNotFound(_0xc9fc86,null))[_0x90ba('0x2d')](respondWithResult(_0xc9fc86,null))[_0x90ba('0x4c')](handleError(_0xc9fc86,null));};exports[_0x90ba('0x4f')]=function(_0x11d8fb,_0x200b49){return db[_0x90ba('0x47')][_0x90ba('0x4f')](_0x11d8fb[_0x90ba('0x50')],{})[_0x90ba('0x2d')](respondWithResult(_0x200b49,0xc9))[_0x90ba('0x4c')](handleError(_0x200b49,null));};exports[_0x90ba('0x2c')]=function(_0x4b9256,_0x507791){if(_0x4b9256[_0x90ba('0x50')]['id']){delete _0x4b9256[_0x90ba('0x50')]['id'];}return db[_0x90ba('0x47')][_0x90ba('0x4e')]({'where':{'id':_0x4b9256[_0x90ba('0x51')]['id']}})[_0x90ba('0x2d')](handleEntityNotFound(_0x507791,null))[_0x90ba('0x2d')](saveUpdates(_0x4b9256[_0x90ba('0x50')],null))[_0x90ba('0x2d')](respondWithResult(_0x507791,null))[_0x90ba('0x4c')](handleError(_0x507791,null));};exports[_0x90ba('0x2e')]=function(_0x8cd055,_0x449615){return db[_0x90ba('0x47')]['find']({'where':{'id':_0x8cd055[_0x90ba('0x51')]['id']}})[_0x90ba('0x2d')](handleEntityNotFound(_0x449615,null))[_0x90ba('0x2d')](removeEntity(_0x449615,null))[_0x90ba('0x4c')](handleError(_0x449615,null));};exports[_0x90ba('0x52')]=function(_0x37aae6,_0x133b1f){return db[_0x90ba('0x47')][_0x90ba('0x52')]()[_0x90ba('0x2d')](respondWithResult(_0x133b1f,null))['catch'](handleError(_0x133b1f,null));};function wrapUser(_0x180ff8){return function(_0x305509){var _0x4e404c=_0x180ff8[_0x90ba('0x53')]({'plain':!![]});_0x4e404c[_0x90ba('0x54')]=[];if(_0x305509){_0x4e404c['lastMessageAt']=_0x305509[_0x90ba('0x55')];_0x4e404c[_0x90ba('0x56')]=_0x305509;}else{_0x4e404c[_0x90ba('0x57')]=moment(0x0)[_0x90ba('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e404c['lastMessage']={};}return _0x4e404c;};}exports[_0x90ba('0x59')]=function(_0x25fe8b,_0x4131f1,_0x12d70c){var _0x43c2be=[];return db[_0x90ba('0x5a')][_0x90ba('0x4a')]({'where':{'role':[_0x90ba('0x5b'),_0x90ba('0x5c'),_0x90ba('0x5d')]},'attributes':['id',_0x90ba('0x5e'),'name',_0x90ba('0x5f'),_0x90ba('0x60'),'internal',_0x90ba('0x61'),_0x90ba('0x62'),_0x90ba('0x63'),_0x90ba('0x64')],'order':qs[_0x90ba('0x41')](_0x90ba('0x65')),'include':[{'model':db[_0x90ba('0x66')],'as':_0x90ba('0x67'),'attributes':['id','name',_0x90ba('0x35')],'through':{'attributes':[]}}]})[_0x90ba('0x2d')](function(_0x2de4cb){if(_0x2de4cb){var _0x102941=_0x25fe8b[_0x90ba('0x5d')][_0x90ba('0x53')]({'plain':!![]});if(!_0x102941)throw new Error(_0x90ba('0x68'));if(_0x102941[_0x90ba('0x5f')]===_0x90ba('0x5d')){return db['UserProfileSection']['find']({'where':{'name':_0x90ba('0x69'),'userProfileId':_0x102941['userProfileId']},'raw':!![]})[_0x90ba('0x2d')](function(_0x369edd){if(_0x369edd){if(_0x369edd[_0x90ba('0x6a')]===0x0){return db[_0x90ba('0x6b')]['findAll']({'where':{'sectionId':_0x369edd['id']},'raw':!![]})[_0x90ba('0x2d')](function(_0x372e3d){var _0x31303d=[];if(_[_0x90ba('0x6c')](_0x372e3d)){_0x31303d=_[_0x90ba('0x43')](_0x2de4cb,function(_0x32105c){if(_0x32105c[_0x90ba('0x5f')]!==_0x90ba('0x5b')){return _0x32105c;}});return _0x31303d;}else{for(var _0x2bc4c6=0x0;_0x2bc4c6<_0x2de4cb[_0x90ba('0x3e')];_0x2bc4c6++){var _0xc98b8c=_0x2de4cb[_0x2bc4c6];if(_0xc98b8c[_0x90ba('0x5f')]===_0x90ba('0x5b')){var _0x5457c3=_[_0x90ba('0x4e')](_0x372e3d,function(_0x304ebe){return _0x304ebe['resourceId']===_0xc98b8c['id'];});if(_0x5457c3)_0x31303d[_0x90ba('0x6d')](_0xc98b8c);}else{_0x31303d[_0x90ba('0x6d')](_0xc98b8c);}}return _0x31303d;}});}else{return _0x2de4cb;}}else{var _0x59c97=_[_0x90ba('0x43')](_0x2de4cb,function(_0x5c0e46){if(_0x5c0e46['role']!==_0x90ba('0x5b')){return _0x5c0e46;}});return _0x59c97;}});}else{return _0x2de4cb;}}})[_0x90ba('0x2d')](function(_0x3917b7){var _0x496ad2=[];if(_0x3917b7){_0x43c2be=_0x3917b7;for(var _0x5f39ee=0x0;_0x5f39ee<_0x3917b7[_0x90ba('0x3e')];_0x5f39ee+=0x1){_0x43c2be[_0x5f39ee]['messages']=[];_0x496ad2[_0x90ba('0x6d')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x25fe8b[_0x90ba('0x5d')]['id'],_0x3917b7[_0x5f39ee]['id']],'ToId':[_0x25fe8b['user']['id'],_0x3917b7[_0x5f39ee]['id']],'ChatGroupId':null},'attributes':['id',_0x90ba('0x55'),_0x90ba('0x6e'),'ToId',_0x90ba('0x6f'),'body'],'order':qs[_0x90ba('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x90ba('0x2d')](wrapUser(_0x3917b7[_0x5f39ee])));}return BPromise['all'](_0x496ad2);}return[];})[_0x90ba('0x2d')](function(_0x4c301f){return{'rows':_0x4c301f,'count':_0x4c301f['length']};})['then'](respondWithResult(_0x4131f1,null))[_0x90ba('0x4c')](handleError(_0x4131f1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ab744d1..5f6c675 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 _0x7a52=['save','update','emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0x3e145e,_0x44bde7){var _0x263072=function(_0x63468a){while(--_0x63468a){_0x3e145e['push'](_0x3e145e['shift']());}};_0x263072(++_0x44bde7);}(_0x7a52,0x1bd));var _0x27a5=function(_0x7077b9,_0x348873){_0x7077b9=_0x7077b9-0x0;var _0x45fe02=_0x7a52[_0x7077b9];return _0x45fe02;};'use strict';var EventEmitter=require(_0x27a5('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x27a5('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x27a5('0x2')](0x0);var events={'afterCreate':_0x27a5('0x3'),'afterUpdate':_0x27a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa9f75c){return function(_0x2ef39c,_0x43dc0d,_0x7fff17){ChatInternalMessageEvents[_0x27a5('0x5')](_0xa9f75c+':'+_0x2ef39c['id'],_0x2ef39c);ChatInternalMessageEvents[_0x27a5('0x5')](_0xa9f75c,_0x2ef39c);_0x7fff17(null);};}for(var e in events){if(events[_0x27a5('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x27a5('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x56d6=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','hasOwnProperty'];(function(_0x5a7702,_0x5886b1){var _0x149f3c=function(_0x1fb12f){while(--_0x1fb12f){_0x5a7702['push'](_0x5a7702['shift']());}};_0x149f3c(++_0x5886b1);}(_0x56d6,0x18e));var _0x656d=function(_0x260ebb,_0x2b596b){_0x260ebb=_0x260ebb-0x0;var _0x184769=_0x56d6[_0x260ebb];return _0x184769;};'use strict';var EventEmitter=require(_0x656d('0x0'));var ChatInternalMessage=require(_0x656d('0x1'))['db'][_0x656d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x656d('0x3')](0x0);var events={'afterCreate':_0x656d('0x4'),'afterUpdate':_0x656d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c05af){return function(_0x25479a,_0xc02d26,_0x11946b){ChatInternalMessageEvents['emit'](_0x1c05af+':'+_0x25479a['id'],_0x25479a);ChatInternalMessageEvents['emit'](_0x1c05af,_0x25479a);_0x11946b(null);};}for(var e in events){if(events[_0x656d('0x6')](e)){var event=events[e];ChatInternalMessage[_0x656d('0x7')](e,emitEvent(event));}}module[_0x656d('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 7ba65e8..c8a0ab6 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 _0x4fd7=['define','ChatInternalMessage','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x5a3169,_0xf62d84){var _0x3524a3=function(_0x5d7128){while(--_0x5d7128){_0x5a3169['push'](_0x5a3169['shift']());}};_0x3524a3(++_0xf62d84);}(_0x4fd7,0x81));var _0x74fd=function(_0x3133d0,_0x1d524c){_0x3133d0=_0x3133d0-0x0;var _0x1ee127=_0x4fd7[_0x3133d0];return _0x1ee127;};'use strict';var _=require('lodash');var util=require(_0x74fd('0x0'));var logger=require(_0x74fd('0x1'))(_0x74fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74fd('0x3'));var fs=require('fs');var path=require(_0x74fd('0x4'));var rimraf=require(_0x74fd('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x36acc8,_0x2adac){return _0x36acc8[_0x74fd('0x6')](_0x74fd('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x74fd('0x8')});}; \ No newline at end of file +var _0x282f=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','exports','ChatInternalMessage','chat_internal_messages'];(function(_0x5389a2,_0x3d0936){var _0x23d406=function(_0x234014){while(--_0x234014){_0x5389a2['push'](_0x5389a2['shift']());}};_0x23d406(++_0x3d0936);}(_0x282f,0x199));var _0xf282=function(_0x47dd22,_0x561228){_0x47dd22=_0x47dd22-0x0;var _0x1cddef=_0x282f[_0x47dd22];return _0x1cddef;};'use strict';var _=require(_0xf282('0x0'));var util=require('util');var logger=require(_0xf282('0x1'))(_0xf282('0x2'));var moment=require(_0xf282('0x3'));var BPromise=require(_0xf282('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf282('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xf282('0x6')]=function(_0x24c211,_0x1a520c){return _0x24c211['define'](_0xf282('0x7'),attributes,{'tableName':_0xf282('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf282('0x9'),'collate':_0xf282('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 2b34159..113c383 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 _0xf3cd=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x40bdcd,_0x56c95e){var _0x3780cf=function(_0x442918){while(--_0x442918){_0x40bdcd['push'](_0x40bdcd['shift']());}};_0x3780cf(++_0x56c95e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0xf3cd[_0xb0fe92];return _0x41787f;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});config[_0xdf3c('0xc')]=_[_0xdf3c('0xd')](config[_0xdf3c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf3c('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xdf3c('0xf')](socket);function respondWithRpcPromise(_0x981616,_0x5ef936,_0x1dba4c){return new BPromise(function(_0x205f33,_0x2d420c){return client[_0xdf3c('0x10')](_0x981616,_0x1dba4c)[_0xdf3c('0x11')](function(_0x1c456b){logger[_0xdf3c('0x12')](_0xdf3c('0x13'),_0x5ef936,'request\x20sent');logger[_0xdf3c('0x14')](_0xdf3c('0x15'),_0x5ef936,_0xdf3c('0x16'),JSON[_0xdf3c('0x17')](_0x1c456b));if(_0x1c456b['error']){if(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x19')]===0x1f4){logger[_0xdf3c('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x2d420c(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x205f33(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}else{logger['info'](_0xdf3c('0x13'),_0x5ef936,_0xdf3c('0x16'));_0x205f33(_0x1c456b[_0xdf3c('0x1b')][_0xdf3c('0x1a')]);}})[_0xdf3c('0x1c')](function(_0x113b56){logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x113b56);_0x2d420c(_0x113b56);});});} \ No newline at end of file +var _0xd60d=['register','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket'];(function(_0x37790e,_0x277029){var _0x5b1393=function(_0x2bf783){while(--_0x2bf783){_0x37790e['push'](_0x37790e['shift']());}};_0x5b1393(++_0x277029);}(_0xd60d,0xff));var _0xdd60=function(_0x511362,_0x2cd7cf){_0x511362=_0x511362-0x0;var _0x37b819=_0xd60d[_0x511362];return _0x37b819;};'use strict';var _=require(_0xdd60('0x0'));var util=require(_0xdd60('0x1'));var moment=require('moment');var BPromise=require(_0xdd60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd60('0x3'));var db=require(_0xdd60('0x4'))['db'];var utils=require(_0xdd60('0x5'));var logger=require(_0xdd60('0x6'))(_0xdd60('0x7'));var config=require('../../config/environment');var jayson=require(_0xdd60('0x8'));var client=jayson[_0xdd60('0x9')][_0xdd60('0xa')]({'port':0x232a});config[_0xdd60('0xb')]=_[_0xdd60('0xc')](config[_0xdd60('0xb')],{'host':_0xdd60('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd60('0xb')]));require(_0xdd60('0xe'))[_0xdd60('0xf')](socket);function respondWithRpcPromise(_0x40dcb4,_0x4713a0,_0x5bf4c9){return new BPromise(function(_0x34ca2a,_0x17ef0c){return client[_0xdd60('0x10')](_0x40dcb4,_0x5bf4c9)[_0xdd60('0x11')](function(_0x11b4be){logger[_0xdd60('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4713a0,_0xdd60('0x13'));logger['debug'](_0xdd60('0x14'),_0x4713a0,_0xdd60('0x13'),JSON[_0xdd60('0x15')](_0x11b4be));if(_0x11b4be[_0xdd60('0x16')]){if(_0x11b4be[_0xdd60('0x16')][_0xdd60('0x17')]===0x1f4){logger[_0xdd60('0x16')](_0xdd60('0x18'),_0x4713a0,_0x11b4be[_0xdd60('0x16')][_0xdd60('0x19')]);return _0x17ef0c(_0x11b4be[_0xdd60('0x16')][_0xdd60('0x19')]);}logger[_0xdd60('0x16')](_0xdd60('0x18'),_0x4713a0,_0x11b4be[_0xdd60('0x16')][_0xdd60('0x19')]);return _0x34ca2a(_0x11b4be[_0xdd60('0x16')][_0xdd60('0x19')]);}else{logger[_0xdd60('0x12')](_0xdd60('0x18'),_0x4713a0,'request\x20sent');_0x34ca2a(_0x11b4be['result'][_0xdd60('0x19')]);}})[_0xdd60('0x1a')](function(_0x578d90){logger[_0xdd60('0x16')](_0xdd60('0x18'),_0x4713a0,_0x578d90);_0x17ef0c(_0x578d90);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 77794a7..8dc7166 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 _0x4a7a=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x362288,_0xb4a728){var _0x96611d=function(_0x23d4bb){while(--_0x23d4bb){_0x362288['push'](_0x362288['shift']());}};_0x96611d(++_0xb4a728);}(_0x4a7a,0xf5));var _0xa4a7=function(_0xe82d5f,_0x30fa26){_0xe82d5f=_0xe82d5f-0x0;var _0x2080dc=_0x4a7a[_0xe82d5f];return _0x2080dc;};'use strict';var ChatInternalMessageEvents=require(_0xa4a7('0x0'));var events=[_0xa4a7('0x1'),_0xa4a7('0x2'),_0xa4a7('0x3')];function createListener(_0x3b2f1d,_0x23fd28){return function(_0xa7d815){_0x23fd28[_0xa4a7('0x4')](_0x3b2f1d,_0xa7d815);};}function removeListener(_0x1cf1fc,_0x373a9d){return function(){ChatInternalMessageEvents[_0xa4a7('0x5')](_0x1cf1fc,_0x373a9d);};}exports[_0xa4a7('0x6')]=function(_0x419296){for(var _0x9b4ddc=0x0,_0x19e684=events['length'];_0x9b4ddc<_0x19e684;_0x9b4ddc++){var _0x36608b=events[_0x9b4ddc];var _0x281364=createListener(_0xa4a7('0x7')+_0x36608b,_0x419296);ChatInternalMessageEvents['on'](_0x36608b,_0x281364);}}; \ No newline at end of file +var _0x8e4f=['chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x563169,_0x10d4cb){var _0x5612b8=function(_0x1b0acb){while(--_0x1b0acb){_0x563169['push'](_0x563169['shift']());}};_0x5612b8(++_0x10d4cb);}(_0x8e4f,0x6d));var _0xf8e4=function(_0x39eff9,_0x3a57a4){_0x39eff9=_0x39eff9-0x0;var _0x356d78=_0x8e4f[_0x39eff9];return _0x356d78;};'use strict';var ChatInternalMessageEvents=require(_0xf8e4('0x0'));var events=[_0xf8e4('0x1'),'remove',_0xf8e4('0x2')];function createListener(_0x503312,_0x4b453e){return function(_0x418953){_0x4b453e[_0xf8e4('0x3')](_0x503312,_0x418953);};}function removeListener(_0x8ba9a9,_0x5a42ef){return function(){ChatInternalMessageEvents[_0xf8e4('0x4')](_0x8ba9a9,_0x5a42ef);};}exports['register']=function(_0x471d40){for(var _0x2af0f0=0x0,_0xbe3232=events['length'];_0x2af0f0<_0xbe3232;_0x2af0f0++){var _0x5d68e8=events[_0x2af0f0];var _0x3fca9c=createListener(_0xf8e4('0x5')+_0x5d68e8,_0x471d40);ChatInternalMessageEvents['on'](_0x5d68e8,_0x3fca9c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f0f8b07..c316749 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 _0xc3e5=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','isAuthenticated','describe','/users','post','create','put','update','destroy'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xc3e5,0x19e));var _0x5c3e=function(_0x48fef8,_0x3bb29a){_0x48fef8=_0x48fef8-0x0;var _0x384dfe=_0xc3e5[_0x48fef8];return _0x384dfe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3e('0x0'));var timeout=require(_0x5c3e('0x1'));var express=require(_0x5c3e('0x2'));var router=express[_0x5c3e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c3e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c3e('0x5'));var controller=require(_0x5c3e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5c3e('0x7')]);router[_0x5c3e('0x8')](_0x5c3e('0x9'),auth[_0x5c3e('0xa')](),controller[_0x5c3e('0xb')]);router[_0x5c3e('0x8')](_0x5c3e('0xc'),auth[_0x5c3e('0xa')](),controller['getUsers']);router[_0x5c3e('0x8')]('/:id',auth[_0x5c3e('0xa')](),controller['show']);router[_0x5c3e('0xd')]('/',auth[_0x5c3e('0xa')](),controller[_0x5c3e('0xe')]);router[_0x5c3e('0xf')]('/:id',controller[_0x5c3e('0x10')]);router['delete']('/:id',auth[_0x5c3e('0xa')](),controller[_0x5c3e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xeb8a=['show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x4dbe20,_0x39b8ed){var _0x51160f=function(_0x4050cb){while(--_0x4050cb){_0x4dbe20['push'](_0x4dbe20['shift']());}};_0x51160f(++_0x39b8ed);}(_0xeb8a,0x15c));var _0xaeb8=function(_0x3a0660,_0x78f42){_0x3a0660=_0x3a0660-0x0;var _0x58e2d2=_0xeb8a[_0x3a0660];return _0x58e2d2;};'use strict';var multer=require(_0xaeb8('0x0'));var util=require(_0xaeb8('0x1'));var path=require('path');var timeout=require(_0xaeb8('0x2'));var express=require(_0xaeb8('0x3'));var router=express[_0xaeb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaeb8('0x5'));var interaction=require(_0xaeb8('0x6'));var config=require(_0xaeb8('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xaeb8('0x8')]('/',auth[_0xaeb8('0x9')](),controller[_0xaeb8('0xa')]);router[_0xaeb8('0x8')]('/describe',auth[_0xaeb8('0x9')](),controller[_0xaeb8('0xb')]);router[_0xaeb8('0x8')]('/users',auth[_0xaeb8('0x9')](),controller['getUsers']);router['get'](_0xaeb8('0xc'),auth[_0xaeb8('0x9')](),controller[_0xaeb8('0xd')]);router[_0xaeb8('0xe')]('/',auth[_0xaeb8('0x9')](),controller[_0xaeb8('0xf')]);router[_0xaeb8('0x10')]('/:id',controller['update']);router['delete'](_0xaeb8('0xc'),auth[_0xaeb8('0x9')](),controller[_0xaeb8('0x11')]);module[_0xaeb8('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index e7025e8..064174e 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 _0xbbdd=['out','TEXT','exports','medium','BOOLEAN'];(function(_0x25595e,_0x4a303e){var _0x11e262=function(_0x507a17){while(--_0x507a17){_0x25595e['push'](_0x25595e['shift']());}};_0x11e262(++_0x4a303e);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbbdd[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xdbbd('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdbbd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdbbd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbbd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbbd('0x4')]}}; \ No newline at end of file +var _0x56bd=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x581481,_0x190792){var _0x4dfd79=function(_0x3be3ad){while(--_0x3be3ad){_0x581481['push'](_0x581481['shift']());}};_0x4dfd79(++_0x190792);}(_0x56bd,0xe9));var _0xd56b=function(_0x1325a6,_0x20dec2){_0x1325a6=_0x1325a6-0x0;var _0x314652=_0x56bd[_0x1325a6];return _0x314652;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'body':{'type':Sequelize[_0xd56b('0x1')](_0xd56b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd56b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd56b('0x4')]('in',_0xd56b('0x5')),'defaultValue':_0xd56b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd56b('0x6')]},'providerResponse':{'type':Sequelize[_0xd56b('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 651b929..3496f86 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 _0xd6a2=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','status','limit','undefined','offset','set','json','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatMessage','count','includeAll','findAll','show','include','find','catch','create','body','update','params','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','read1stAt','format','interaction','user','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd6a2,0x176));var _0x2d6a=function(_0x5c942a,_0x2d3ae8){_0x5c942a=_0x5c942a-0x0;var _0x28080b=_0xd6a2[_0x5c942a];return _0x28080b;};'use strict';var emlformat=require(_0x2d6a('0x0'));var rimraf=require(_0x2d6a('0x1'));var zipdir=require(_0x2d6a('0x2'));var jsonpatch=require(_0x2d6a('0x3'));var rp=require(_0x2d6a('0x4'));var moment=require('moment');var BPromise=require(_0x2d6a('0x5'));var Mustache=require(_0x2d6a('0x6'));var util=require('util');var path=require(_0x2d6a('0x7'));var sox=require('sox');var csv=require(_0x2d6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d6a('0x9'));var _=require(_0x2d6a('0xa'));var squel=require(_0x2d6a('0xb'));var crypto=require(_0x2d6a('0xc'));var jsforce=require(_0x2d6a('0xd'));var deskjs=require(_0x2d6a('0xe'));var toCsv=require(_0x2d6a('0x8'));var querystring=require(_0x2d6a('0xf'));var Papa=require(_0x2d6a('0x10'));var Redis=require(_0x2d6a('0x11'));var authService=require(_0x2d6a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2d6a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d6a('0x14'))(_0x2d6a('0x15'));var utils=require(_0x2d6a('0x16'));var config=require(_0x2d6a('0x17'));var licenseUtil=require(_0x2d6a('0x18'));var db=require(_0x2d6a('0x19'))['db'];config[_0x2d6a('0x1a')]=_[_0x2d6a('0x1b')](config[_0x2d6a('0x1a')],{'host':_0x2d6a('0x1c'),'port':0x18eb});var socket=require(_0x2d6a('0x1d'))(new Redis(config[_0x2d6a('0x1a')]));require(_0x2d6a('0x1e'))[_0x2d6a('0x1f')](socket);var jayson=require(_0x2d6a('0x20'));var client=jayson['client'][_0x2d6a('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x2d6a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56afcc,_0x2f71a3,_0x4a8cbc,_0x39c511){return new BPromise(function(_0x13a470,_0x372fa5){var _0x5a7eea=_0x39c511||client;return _0x5a7eea[_0x2d6a('0x22')](_0x56afcc,_0x4a8cbc)[_0x2d6a('0x23')](function(_0xbb11ce){logger[_0x2d6a('0x24')]('ChatMessage,\x20%s,\x20%s',_0x2f71a3,_0x2d6a('0x25'));logger[_0x2d6a('0x26')](_0x2d6a('0x27'),_0x2f71a3,_0x2d6a('0x25'),JSON[_0x2d6a('0x28')](_0xbb11ce));if(_0xbb11ce[_0x2d6a('0x29')]){if(_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2a')]===0x1f4){logger[_0x2d6a('0x29')](_0x2d6a('0x2b'),_0x2f71a3,_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);return _0x372fa5(_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);}logger['error'](_0x2d6a('0x2b'),_0x2f71a3,_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);return _0x13a470(_0xbb11ce[_0x2d6a('0x29')][_0x2d6a('0x2c')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2f71a3,_0x2d6a('0x25'));_0x13a470(_0xbb11ce[_0x2d6a('0x2d')][_0x2d6a('0x2c')]);}})['catch'](function(_0x4fd971){logger[_0x2d6a('0x29')](_0x2d6a('0x2b'),_0x2f71a3,_0x4fd971);_0x372fa5(_0x4fd971);});});}function respondWithStatusCode(_0x36a8a6,_0xf9342d){_0xf9342d=_0xf9342d||0xcc;return function(_0x37a5f4){if(_0x37a5f4){return _0x36a8a6[_0x2d6a('0x2e')](_0xf9342d);}return _0x36a8a6[_0x2d6a('0x2f')](_0xf9342d)['end']();};}function respondWithResult(_0x2587e9,_0x5ec0df){_0x5ec0df=_0x5ec0df||0xc8;return function(_0x3f8e3f){if(_0x3f8e3f){return _0x2587e9[_0x2d6a('0x2f')](_0x5ec0df)['json'](_0x3f8e3f);}};}function respondWithFilteredResult(_0x413bc3,_0x2724d3){return function(_0x10d08c){if(_0x10d08c){var _0x2409c7=typeof _0x2724d3['offset']==='undefined'&&typeof _0x2724d3[_0x2d6a('0x30')]===_0x2d6a('0x31');var _0x24db55=_0x10d08c['count'];var _0x3447b7=_0x2409c7?0x0:_0x2724d3[_0x2d6a('0x32')];var _0x1291a5=_0x2409c7?_0x10d08c['count']:_0x2724d3[_0x2d6a('0x32')]+_0x2724d3['limit'];var _0x2c2da0;if(_0x1291a5>=_0x24db55){_0x1291a5=_0x24db55;_0x2c2da0=0xc8;}else{_0x2c2da0=0xce;}_0x413bc3[_0x2d6a('0x2f')](_0x2c2da0);return _0x413bc3[_0x2d6a('0x33')]('Content-Range',_0x3447b7+'-'+_0x1291a5+'/'+_0x24db55)[_0x2d6a('0x34')](_0x10d08c);}return null;};}function patchUpdates(_0x360953){return function(_0x55218c){try{jsonpatch['apply'](_0x55218c,_0x360953,!![]);}catch(_0x7dc6a8){return BPromise[_0x2d6a('0x35')](_0x7dc6a8);}return _0x55218c[_0x2d6a('0x36')]();};}function saveUpdates(_0x56b41c,_0x2235e){return function(_0x5a3cbf){if(_0x5a3cbf){return _0x5a3cbf['update'](_0x56b41c)[_0x2d6a('0x23')](function(_0x20f693){return _0x20f693;});}return null;};}function removeEntity(_0x21849c,_0x4fabf6){return function(_0x2219be){if(_0x2219be){return _0x2219be[_0x2d6a('0x37')]()[_0x2d6a('0x23')](function(){_0x21849c[_0x2d6a('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa88a,_0xe8ab23){return function(_0x332631){if(!_0x332631){_0x3aa88a[_0x2d6a('0x2e')](0x194);}return _0x332631;};}function handleError(_0x19dcac,_0x27f984){_0x27f984=_0x27f984||0x1f4;return function(_0x4b4d09){logger[_0x2d6a('0x29')](_0x4b4d09[_0x2d6a('0x38')]);if(_0x4b4d09[_0x2d6a('0x39')]){delete _0x4b4d09['name'];}_0x19dcac[_0x2d6a('0x2f')](_0x27f984)[_0x2d6a('0x3a')](_0x4b4d09);};}exports['index']=function(_0x26becd,_0x1cdaba){var _0x619f57={},_0x5696fc={},_0x2c7e34={'count':0x0,'rows':[]};var _0x465416=_[_0x2d6a('0x3b')](db['ChatMessage'][_0x2d6a('0x3c')],function(_0x38d1da){return{'name':_0x38d1da[_0x2d6a('0x3d')],'type':_0x38d1da[_0x2d6a('0x3e')][_0x2d6a('0x3f')]};});_0x5696fc[_0x2d6a('0x40')]=_[_0x2d6a('0x3b')](_0x465416,_0x2d6a('0x39'));_0x5696fc[_0x2d6a('0x41')]=_[_0x2d6a('0x42')](_0x26becd[_0x2d6a('0x41')]);_0x5696fc[_0x2d6a('0x43')]=_[_0x2d6a('0x44')](_0x5696fc['model'],_0x5696fc['query']);_0x619f57[_0x2d6a('0x45')]=_[_0x2d6a('0x44')](_0x5696fc['model'],qs['fields'](_0x26becd['query'][_0x2d6a('0x46')]));_0x619f57['attributes']=_0x619f57['attributes'][_0x2d6a('0x47')]?_0x619f57['attributes']:_0x5696fc[_0x2d6a('0x40')];if(!_0x26becd[_0x2d6a('0x41')]['hasOwnProperty'](_0x2d6a('0x48'))){_0x619f57[_0x2d6a('0x30')]=qs[_0x2d6a('0x30')](_0x26becd[_0x2d6a('0x41')]['limit']);_0x619f57[_0x2d6a('0x32')]=qs[_0x2d6a('0x32')](_0x26becd['query'][_0x2d6a('0x32')]);}_0x619f57['order']=qs[_0x2d6a('0x49')](_0x26becd[_0x2d6a('0x41')][_0x2d6a('0x49')]);_0x619f57[_0x2d6a('0x4a')]=qs['filters'](_['pick'](_0x26becd[_0x2d6a('0x41')],_0x5696fc[_0x2d6a('0x43')]),_0x465416);if(_0x26becd[_0x2d6a('0x41')][_0x2d6a('0x4b')]){_0x619f57['where']=_[_0x2d6a('0x4c')](_0x619f57['where'],{'$or':_[_0x2d6a('0x3b')](_0x465416,function(_0x2f3283){if(_0x2f3283['type']!==_0x2d6a('0x4d')){var _0x4bd331={};_0x4bd331[_0x2f3283[_0x2d6a('0x39')]]={'$like':'%'+_0x26becd[_0x2d6a('0x41')][_0x2d6a('0x4b')]+'%'};return _0x4bd331;}})});}_0x619f57=_['merge']({},_0x619f57,_0x26becd[_0x2d6a('0x4e')]);var _0x51087c={'where':_0x619f57['where']};return db[_0x2d6a('0x4f')][_0x2d6a('0x50')](_0x51087c)[_0x2d6a('0x23')](function(_0x7364f1){_0x2c7e34[_0x2d6a('0x50')]=_0x7364f1;if(_0x26becd['query'][_0x2d6a('0x51')]){_0x619f57['include']=[{'all':!![]}];}return db['ChatMessage'][_0x2d6a('0x52')](_0x619f57);})['then'](function(_0x497e49){_0x2c7e34['rows']=_0x497e49;return _0x2c7e34;})[_0x2d6a('0x23')](respondWithFilteredResult(_0x1cdaba,_0x619f57))['catch'](handleError(_0x1cdaba,null));};exports[_0x2d6a('0x53')]=function(_0x4ae732,_0x5c05d3){var _0x19abcb={'raw':!![],'where':{'id':_0x4ae732['params']['id']}},_0x8ee60e={};_0x8ee60e[_0x2d6a('0x40')]=_[_0x2d6a('0x42')](db[_0x2d6a('0x4f')]['rawAttributes']);_0x8ee60e['query']=_[_0x2d6a('0x42')](_0x4ae732[_0x2d6a('0x41')]);_0x8ee60e[_0x2d6a('0x43')]=_[_0x2d6a('0x44')](_0x8ee60e[_0x2d6a('0x40')],_0x8ee60e['query']);_0x19abcb[_0x2d6a('0x45')]=_['intersection'](_0x8ee60e['model'],qs[_0x2d6a('0x46')](_0x4ae732[_0x2d6a('0x41')]['fields']));_0x19abcb[_0x2d6a('0x45')]=_0x19abcb[_0x2d6a('0x45')][_0x2d6a('0x47')]?_0x19abcb['attributes']:_0x8ee60e[_0x2d6a('0x40')];if(_0x4ae732[_0x2d6a('0x41')][_0x2d6a('0x51')]){_0x19abcb[_0x2d6a('0x54')]=[{'all':!![]}];}_0x19abcb=_[_0x2d6a('0x4c')]({},_0x19abcb,_0x4ae732[_0x2d6a('0x4e')]);return db[_0x2d6a('0x4f')][_0x2d6a('0x55')](_0x19abcb)[_0x2d6a('0x23')](handleEntityNotFound(_0x5c05d3,null))[_0x2d6a('0x23')](respondWithResult(_0x5c05d3,null))[_0x2d6a('0x56')](handleError(_0x5c05d3,null));};exports[_0x2d6a('0x57')]=function(_0x562b0a,_0xbdb7ad){return db['ChatMessage'][_0x2d6a('0x57')](_0x562b0a[_0x2d6a('0x58')],{})[_0x2d6a('0x23')](respondWithResult(_0xbdb7ad,0xc9))['catch'](handleError(_0xbdb7ad,null));};exports[_0x2d6a('0x59')]=function(_0x2243b2,_0x41f964){if(_0x2243b2[_0x2d6a('0x58')]['id']){delete _0x2243b2['body']['id'];}return db[_0x2d6a('0x4f')][_0x2d6a('0x55')]({'where':{'id':_0x2243b2[_0x2d6a('0x5a')]['id']}})[_0x2d6a('0x23')](handleEntityNotFound(_0x41f964,null))[_0x2d6a('0x23')](saveUpdates(_0x2243b2[_0x2d6a('0x58')],null))[_0x2d6a('0x23')](respondWithResult(_0x41f964,null))[_0x2d6a('0x56')](handleError(_0x41f964,null));};exports[_0x2d6a('0x37')]=function(_0x506b49,_0x538cb7){return db['ChatMessage']['find']({'where':{'id':_0x506b49[_0x2d6a('0x5a')]['id']}})[_0x2d6a('0x23')](handleEntityNotFound(_0x538cb7,null))[_0x2d6a('0x23')](removeEntity(_0x538cb7,null))[_0x2d6a('0x56')](handleError(_0x538cb7,null));};exports[_0x2d6a('0x5b')]=function(_0x3eb829,_0x32b43c){return db[_0x2d6a('0x4f')]['describe']()[_0x2d6a('0x23')](respondWithResult(_0x32b43c,null))[_0x2d6a('0x56')](handleError(_0x32b43c,null));};var interaction_log=require(_0x2d6a('0x14'))(_0x2d6a('0x5c'));exports[_0x2d6a('0x5d')]=function(_0x29f4f3,_0x1ff37b,_0x45890b){var _0x1fb076={'agent':{},'channel':'chat'};if(_0x29f4f3[_0x2d6a('0x58')]['id']){delete _0x29f4f3[_0x2d6a('0x58')]['id'];}_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x5e')]=!![];_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x5f')]=moment()['format'](_0x2d6a('0x60'));_0x29f4f3['body'][_0x2d6a('0x61')]=_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x61')]||_0x29f4f3['user']['id'];_0x1fb076['agent']['id']=_0x29f4f3[_0x2d6a('0x58')]['UserId'];return db[_0x2d6a('0x4f')]['find']({'where':{'id':_0x29f4f3['params']['id'],'UserId':null}})[_0x2d6a('0x23')](handleEntityNotFound(_0x1ff37b,null))[_0x2d6a('0x23')](saveUpdates(_0x29f4f3[_0x2d6a('0x58')],null))[_0x2d6a('0x23')](function(_0x45fc00){if(_0x45fc00){_0x1fb076[_0x2d6a('0x2c')]=_0x45fc00[_0x2d6a('0x62')]({'plain':!![]});return db[_0x2d6a('0x63')][_0x2d6a('0x55')]({'where':{'id':_0x45fc00['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1ff37b,null))[_0x2d6a('0x23')](function(_0x29a4d1){if(_0x29a4d1){return _0x29a4d1[_0x2d6a('0x59')]({'UserId':_0x29f4f3[_0x2d6a('0x58')][_0x2d6a('0x61')],'read1stAt':_[_0x2d6a('0x64')](_0x29a4d1[_0x2d6a('0x65')])?moment()[_0x2d6a('0x66')](_0x2d6a('0x60')):undefined});}return null;})[_0x2d6a('0x23')](function(_0x182cee){if(_0x182cee){_0x1fb076[_0x2d6a('0x67')]=_0x182cee[_0x2d6a('0x62')]({'plain':!![]});interaction_log[_0x2d6a('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29f4f3[_0x2d6a('0x68')]['id'],_0x29f4f3[_0x2d6a('0x68')][_0x2d6a('0x39')],_0x29f4f3[_0x2d6a('0x68')][_0x2d6a('0x69')],_0x1fb076[_0x2d6a('0x67')]['id'],_0x29f4f3[_0x2d6a('0x58')]?JSON[_0x2d6a('0x28')](_0x29f4f3[_0x2d6a('0x58')]):_0x2d6a('0x6a'));return respondWithRpcPromise(_0x2d6a('0x6b'),_0x2d6a('0x6c'),_0x1fb076);}return null;})[_0x2d6a('0x23')](function(_0x45761b){var _0x24bb0b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45761b[_0x2d6a('0x2c')][_0x2d6a('0x6d')];return db['sequelize'][_0x2d6a('0x41')](_0x24bb0b,{'type':db[_0x2d6a('0x6e')][_0x2d6a('0x6f')][_0x2d6a('0x70')],'raw':!![]})[_0x2d6a('0x23')](function(_0x38f4be){return _0x38f4be;});})[_0x2d6a('0x23')](function(_0x4aa321){if(_0x4aa321){_0x1fb076['message']['contact']=_0x4aa321[0x0];if(!_0x29f4f3[_0x2d6a('0x58')]['UserId'])return;return db[_0x2d6a('0x71')][_0x2d6a('0x55')]({'where':{'id':_0x29f4f3[_0x2d6a('0x58')]['UserId'],'role':_0x2d6a('0x72')},'attributes':['id',_0x2d6a('0x39'),_0x2d6a('0x73'),_0x2d6a('0x74'),'internal'],'raw':!![]});}return null;})[_0x2d6a('0x23')](function(_0x47491c){if(!_0x47491c)return null;_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x72')]=_0x47491c;return _0x1fb076;})[_0x2d6a('0x23')](function(_0x441ee){if(_0x441ee){if(_0x29f4f3['body']['manual']){_0x1fb076[_0x2d6a('0x2c')]['interface']=util[_0x2d6a('0x66')](_0x2d6a('0x75'),_0x29f4f3[_0x2d6a('0x68')]['name']);_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x76')]=_0x1fb076[_0x2d6a('0x76')];_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x77')]=_0x1fb076['channel'];_0x1fb076[_0x2d6a('0x2c')][_0x2d6a('0x78')]=_0x2d6a('0x5d');return respondWithRpcPromise(_0x2d6a('0x79'),_0x2d6a('0x79'),{'event':_0x2d6a('0x7a'),'message':_[_0x2d6a('0x4c')](_0x1fb076[_0x2d6a('0x2c')],JSON['parse'](_0x1fb076[_0x2d6a('0x67')][_0x2d6a('0x7b')]))},client9002)[_0x2d6a('0x23')](function(){return _0x1fb076;});}return _0x1fb076;}return null;})[_0x2d6a('0x23')](respondWithResult(_0x1ff37b,null))[_0x2d6a('0x56')](handleError(_0x1ff37b,null));};var interaction_log=require('../../config/logger')(_0x2d6a('0x5c'));exports[_0x2d6a('0x35')]=function(_0x2489b9,_0x2c2c4c,_0x4e1619){var _0x5309a2={'agent':{},'channel':_0x2d6a('0x7c')};if(_0x2489b9[_0x2d6a('0x58')]['id']){delete _0x2489b9[_0x2d6a('0x58')]['id'];}_0x2489b9['body'][_0x2d6a('0x61')]=_0x2489b9['body'][_0x2d6a('0x61')]||_0x2489b9[_0x2d6a('0x68')]['id'];_0x5309a2[_0x2d6a('0x72')]['id']=_0x2489b9['body'][_0x2d6a('0x61')];return db[_0x2d6a('0x4f')][_0x2d6a('0x55')]({'where':{'id':_0x2489b9[_0x2d6a('0x5a')]['id'],'UserId':null}})[_0x2d6a('0x23')](handleEntityNotFound(_0x2c2c4c,null))[_0x2d6a('0x23')](function(_0x9c036a){if(_0x9c036a){_0x5309a2['message']=_0x9c036a['get']({'plain':!![]});return db['ChatInteraction'][_0x2d6a('0x55')]({'where':{'id':_0x9c036a[_0x2d6a('0x7d')]}});}return null;})[_0x2d6a('0x23')](handleEntityNotFound(_0x2c2c4c,null))[_0x2d6a('0x23')](function(_0x17595d){if(_0x17595d){_0x5309a2[_0x2d6a('0x67')]=_0x17595d[_0x2d6a('0x62')]({'plain':!![]});interaction_log[_0x2d6a('0x24')](_0x2d6a('0x7e'),_0x2489b9[_0x2d6a('0x68')]['id'],_0x2489b9[_0x2d6a('0x68')][_0x2d6a('0x39')],_0x2489b9['user'][_0x2d6a('0x69')],_0x5309a2['interaction']['id'],_0x2489b9['body']?JSON[_0x2d6a('0x28')](_0x2489b9[_0x2d6a('0x58')]):'null');return respondWithRpcPromise(_0x2d6a('0x7f'),_0x2d6a('0x80'),_0x5309a2);}return null;})[_0x2d6a('0x23')](function(_0x412d29){var _0x30516e=_0x2d6a('0x81')+_0x412d29[_0x2d6a('0x2c')][_0x2d6a('0x6d')];return db[_0x2d6a('0x82')][_0x2d6a('0x41')](_0x30516e,{'type':db[_0x2d6a('0x6e')]['QueryTypes'][_0x2d6a('0x70')],'raw':!![]})[_0x2d6a('0x23')](function(_0x3212e8){return _0x3212e8;});})[_0x2d6a('0x23')](function(_0x534b75){if(_0x534b75){_0x5309a2[_0x2d6a('0x2c')]['contact']=_0x534b75[0x0];if(!_0x2489b9[_0x2d6a('0x58')]['UserId'])return;return db[_0x2d6a('0x71')]['find']({'where':{'id':_0x2489b9[_0x2d6a('0x58')]['UserId'],'role':_0x2d6a('0x72')},'attributes':['id',_0x2d6a('0x39'),_0x2d6a('0x73'),_0x2d6a('0x74'),_0x2d6a('0x83')],'raw':!![]});}return null;})[_0x2d6a('0x23')](function(_0x1d8256){if(!_0x1d8256)return null;_0x5309a2[_0x2d6a('0x2c')]['agent']=_0x1d8256;return _0x5309a2;})['then'](function(_0x4d5816){if(_0x4d5816){_0x4d5816['message']['interface']=util[_0x2d6a('0x66')](_0x2d6a('0x75'),_0x2489b9[_0x2d6a('0x68')][_0x2d6a('0x39')]);_0x4d5816[_0x2d6a('0x2c')]['channel']=_0x5309a2['channel'];_0x4d5816[_0x2d6a('0x2c')][_0x2d6a('0x77')]=_0x5309a2[_0x2d6a('0x76')];_0x4d5816[_0x2d6a('0x2c')]['event']='reject';respondWithRpcPromise(_0x2d6a('0x79'),_0x2d6a('0x79'),{'event':_0x2d6a('0x84'),'message':_[_0x2d6a('0x4c')](_0x5309a2[_0x2d6a('0x2c')],JSON['parse'](_0x5309a2[_0x2d6a('0x67')][_0x2d6a('0x7b')]))},client9002);return _0x5309a2;}return null;})[_0x2d6a('0x23')](respondWithResult(_0x2c2c4c,null))[_0x2d6a('0x56')](handleError(_0x2c2c4c,null));}; \ No newline at end of file +var _0x1af3=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','http','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','sendStatus','name','send','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','ChatMessage','include','findAll','show','params','find','create','body','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','internal','rejectmessage','formData','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel'];(function(_0x2cdc52,_0x24a288){var _0x3f52d2=function(_0x48f309){while(--_0x48f309){_0x2cdc52['push'](_0x2cdc52['shift']());}};_0x3f52d2(++_0x24a288);}(_0x1af3,0x1ea));var _0x31af=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x1af3[_0x368e09];return _0x14b7df;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x31af('0x1'));var rp=require(_0x31af('0x2'));var moment=require(_0x31af('0x3'));var BPromise=require(_0x31af('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x31af('0x5'));var sox=require(_0x31af('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31af('0x7'));var _=require(_0x31af('0x8'));var squel=require(_0x31af('0x9'));var crypto=require(_0x31af('0xa'));var jsforce=require(_0x31af('0xb'));var deskjs=require(_0x31af('0xc'));var toCsv=require(_0x31af('0xd'));var querystring=require(_0x31af('0xe'));var Papa=require(_0x31af('0xf'));var Redis=require('ioredis');var authService=require(_0x31af('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x31af('0x11'));var hardwareService=require(_0x31af('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x31af('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x31af('0x14'));var db=require(_0x31af('0x15'))['db'];config['redis']=_[_0x31af('0x16')](config[_0x31af('0x17')],{'host':_0x31af('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31af('0x17')]));require('./chatMessage.socket')[_0x31af('0x19')](socket);var jayson=require(_0x31af('0x1a'));var client=jayson['client'][_0x31af('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x31af('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4f47f0,_0x402495,_0x9b8fcc,_0xbb7060){return new BPromise(function(_0x25dc08,_0x441d76){var _0x397153=_0xbb7060||client;return _0x397153['request'](_0x4f47f0,_0x9b8fcc)[_0x31af('0x1c')](function(_0x30749b){logger['info'](_0x31af('0x1d'),_0x402495,'request\x20sent');logger[_0x31af('0x1e')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x402495,_0x31af('0x1f'),JSON[_0x31af('0x20')](_0x30749b));if(_0x30749b[_0x31af('0x21')]){if(_0x30749b['error'][_0x31af('0x22')]===0x1f4){logger['error'](_0x31af('0x1d'),_0x402495,_0x30749b[_0x31af('0x21')][_0x31af('0x23')]);return _0x441d76(_0x30749b[_0x31af('0x21')][_0x31af('0x23')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x402495,_0x30749b[_0x31af('0x21')][_0x31af('0x23')]);return _0x25dc08(_0x30749b[_0x31af('0x21')][_0x31af('0x23')]);}else{logger['info'](_0x31af('0x1d'),_0x402495,'request\x20sent');_0x25dc08(_0x30749b[_0x31af('0x24')][_0x31af('0x23')]);}})[_0x31af('0x25')](function(_0x3e8236){logger[_0x31af('0x21')](_0x31af('0x1d'),_0x402495,_0x3e8236);_0x441d76(_0x3e8236);});});}function respondWithStatusCode(_0x6c54cf,_0x35920e){_0x35920e=_0x35920e||0xcc;return function(_0x40032f){if(_0x40032f){return _0x6c54cf['sendStatus'](_0x35920e);}return _0x6c54cf[_0x31af('0x26')](_0x35920e)[_0x31af('0x27')]();};}function respondWithResult(_0x1a8757,_0x465e14){_0x465e14=_0x465e14||0xc8;return function(_0x151a55){if(_0x151a55){return _0x1a8757[_0x31af('0x26')](_0x465e14)[_0x31af('0x28')](_0x151a55);}};}function respondWithFilteredResult(_0x2b0631,_0x485e01){return function(_0x57ea04){if(_0x57ea04){var _0x6559c5=typeof _0x485e01['offset']===_0x31af('0x29')&&typeof _0x485e01[_0x31af('0x2a')]===_0x31af('0x29');var _0x5beb73=_0x57ea04[_0x31af('0x2b')];var _0x30f951=_0x6559c5?0x0:_0x485e01[_0x31af('0x2c')];var _0x108d21=_0x6559c5?_0x57ea04['count']:_0x485e01[_0x31af('0x2c')]+_0x485e01[_0x31af('0x2a')];var _0x22d61d;if(_0x108d21>=_0x5beb73){_0x108d21=_0x5beb73;_0x22d61d=0xc8;}else{_0x22d61d=0xce;}_0x2b0631['status'](_0x22d61d);return _0x2b0631[_0x31af('0x2d')]('Content-Range',_0x30f951+'-'+_0x108d21+'/'+_0x5beb73)[_0x31af('0x28')](_0x57ea04);}return null;};}function patchUpdates(_0x75f40e){return function(_0x2ae696){try{jsonpatch[_0x31af('0x2e')](_0x2ae696,_0x75f40e,!![]);}catch(_0x2956a6){return BPromise[_0x31af('0x2f')](_0x2956a6);}return _0x2ae696[_0x31af('0x30')]();};}function saveUpdates(_0x14f100,_0x260cab){return function(_0x1d41c7){if(_0x1d41c7){return _0x1d41c7[_0x31af('0x31')](_0x14f100)[_0x31af('0x1c')](function(_0x17394a){return _0x17394a;});}return null;};}function removeEntity(_0x3b4267,_0x31430a){return function(_0x516040){if(_0x516040){return _0x516040[_0x31af('0x32')]()[_0x31af('0x1c')](function(){_0x3b4267[_0x31af('0x26')](0xcc)[_0x31af('0x27')]();});}};}function handleEntityNotFound(_0x496fe0,_0x3d2858){return function(_0xd2cb36){if(!_0xd2cb36){_0x496fe0[_0x31af('0x33')](0x194);}return _0xd2cb36;};}function handleError(_0x1d5f0b,_0x2cecb0){_0x2cecb0=_0x2cecb0||0x1f4;return function(_0x3703ca){logger[_0x31af('0x21')](_0x3703ca['stack']);if(_0x3703ca[_0x31af('0x34')]){delete _0x3703ca[_0x31af('0x34')];}_0x1d5f0b[_0x31af('0x26')](_0x2cecb0)[_0x31af('0x35')](_0x3703ca);};}exports['index']=function(_0x57c2a5,_0x1dd293){var _0x2de637={},_0x5c3926={},_0x3eeac7={'count':0x0,'rows':[]};var _0x40d565=_['map'](db['ChatMessage'][_0x31af('0x36')],function(_0x3aac39){return{'name':_0x3aac39[_0x31af('0x37')],'type':_0x3aac39[_0x31af('0x38')][_0x31af('0x39')]};});_0x5c3926['model']=_['map'](_0x40d565,'name');_0x5c3926[_0x31af('0x3a')]=_[_0x31af('0x3b')](_0x57c2a5['query']);_0x5c3926[_0x31af('0x3c')]=_[_0x31af('0x3d')](_0x5c3926[_0x31af('0x3e')],_0x5c3926[_0x31af('0x3a')]);_0x2de637[_0x31af('0x3f')]=_['intersection'](_0x5c3926[_0x31af('0x3e')],qs['fields'](_0x57c2a5[_0x31af('0x3a')][_0x31af('0x40')]));_0x2de637[_0x31af('0x3f')]=_0x2de637[_0x31af('0x3f')][_0x31af('0x41')]?_0x2de637[_0x31af('0x3f')]:_0x5c3926['model'];if(!_0x57c2a5[_0x31af('0x3a')]['hasOwnProperty'](_0x31af('0x42'))){_0x2de637[_0x31af('0x2a')]=qs[_0x31af('0x2a')](_0x57c2a5['query'][_0x31af('0x2a')]);_0x2de637['offset']=qs[_0x31af('0x2c')](_0x57c2a5[_0x31af('0x3a')][_0x31af('0x2c')]);}_0x2de637[_0x31af('0x43')]=qs[_0x31af('0x44')](_0x57c2a5[_0x31af('0x3a')]['sort']);_0x2de637['where']=qs[_0x31af('0x3c')](_[_0x31af('0x45')](_0x57c2a5['query'],_0x5c3926[_0x31af('0x3c')]),_0x40d565);if(_0x57c2a5['query']['filter']){_0x2de637[_0x31af('0x46')]=_['merge'](_0x2de637[_0x31af('0x46')],{'$or':_['map'](_0x40d565,function(_0x7e9891){if(_0x7e9891['type']!==_0x31af('0x47')){var _0x5cfc81={};_0x5cfc81[_0x7e9891[_0x31af('0x34')]]={'$like':'%'+_0x57c2a5[_0x31af('0x3a')][_0x31af('0x48')]+'%'};return _0x5cfc81;}})});}_0x2de637=_[_0x31af('0x49')]({},_0x2de637,_0x57c2a5[_0x31af('0x4a')]);var _0xf56506={'where':_0x2de637[_0x31af('0x46')]};return db[_0x31af('0x4b')][_0x31af('0x2b')](_0xf56506)[_0x31af('0x1c')](function(_0xdbca3d){_0x3eeac7[_0x31af('0x2b')]=_0xdbca3d;if(_0x57c2a5[_0x31af('0x3a')]['includeAll']){_0x2de637[_0x31af('0x4c')]=[{'all':!![]}];}return db[_0x31af('0x4b')][_0x31af('0x4d')](_0x2de637);})['then'](function(_0x2996e9){_0x3eeac7['rows']=_0x2996e9;return _0x3eeac7;})[_0x31af('0x1c')](respondWithFilteredResult(_0x1dd293,_0x2de637))[_0x31af('0x25')](handleError(_0x1dd293,null));};exports[_0x31af('0x4e')]=function(_0x59b4cc,_0x20e6f8){var _0x3ced40={'raw':!![],'where':{'id':_0x59b4cc[_0x31af('0x4f')]['id']}},_0x42f1c6={};_0x42f1c6[_0x31af('0x3e')]=_['keys'](db[_0x31af('0x4b')][_0x31af('0x36')]);_0x42f1c6[_0x31af('0x3a')]=_[_0x31af('0x3b')](_0x59b4cc['query']);_0x42f1c6[_0x31af('0x3c')]=_[_0x31af('0x3d')](_0x42f1c6['model'],_0x42f1c6[_0x31af('0x3a')]);_0x3ced40[_0x31af('0x3f')]=_[_0x31af('0x3d')](_0x42f1c6[_0x31af('0x3e')],qs['fields'](_0x59b4cc[_0x31af('0x3a')][_0x31af('0x40')]));_0x3ced40[_0x31af('0x3f')]=_0x3ced40[_0x31af('0x3f')][_0x31af('0x41')]?_0x3ced40['attributes']:_0x42f1c6[_0x31af('0x3e')];if(_0x59b4cc[_0x31af('0x3a')]['includeAll']){_0x3ced40['include']=[{'all':!![]}];}_0x3ced40=_[_0x31af('0x49')]({},_0x3ced40,_0x59b4cc[_0x31af('0x4a')]);return db[_0x31af('0x4b')][_0x31af('0x50')](_0x3ced40)[_0x31af('0x1c')](handleEntityNotFound(_0x20e6f8,null))[_0x31af('0x1c')](respondWithResult(_0x20e6f8,null))['catch'](handleError(_0x20e6f8,null));};exports[_0x31af('0x51')]=function(_0x16bb92,_0x5aeca9){return db['ChatMessage'][_0x31af('0x51')](_0x16bb92[_0x31af('0x52')],{})[_0x31af('0x1c')](respondWithResult(_0x5aeca9,0xc9))[_0x31af('0x25')](handleError(_0x5aeca9,null));};exports[_0x31af('0x31')]=function(_0x1f7baf,_0xd5cc91){if(_0x1f7baf[_0x31af('0x52')]['id']){delete _0x1f7baf[_0x31af('0x52')]['id'];}return db[_0x31af('0x4b')][_0x31af('0x50')]({'where':{'id':_0x1f7baf[_0x31af('0x4f')]['id']}})[_0x31af('0x1c')](handleEntityNotFound(_0xd5cc91,null))['then'](saveUpdates(_0x1f7baf['body'],null))[_0x31af('0x1c')](respondWithResult(_0xd5cc91,null))[_0x31af('0x25')](handleError(_0xd5cc91,null));};exports[_0x31af('0x32')]=function(_0x7814c4,_0x534d93){return db[_0x31af('0x4b')][_0x31af('0x50')]({'where':{'id':_0x7814c4[_0x31af('0x4f')]['id']}})[_0x31af('0x1c')](handleEntityNotFound(_0x534d93,null))['then'](removeEntity(_0x534d93,null))[_0x31af('0x25')](handleError(_0x534d93,null));};exports['describe']=function(_0xb2882,_0x2e41a5){return db[_0x31af('0x4b')]['describe']()[_0x31af('0x1c')](respondWithResult(_0x2e41a5,null))[_0x31af('0x25')](handleError(_0x2e41a5,null));};var interaction_log=require(_0x31af('0x53'))(_0x31af('0x54'));exports[_0x31af('0x55')]=function(_0x60833c,_0x55f4f2,_0x322c48){var _0x37f6bb={'agent':{},'channel':_0x31af('0x56')};if(_0x60833c[_0x31af('0x52')]['id']){delete _0x60833c[_0x31af('0x52')]['id'];}_0x60833c[_0x31af('0x52')]['read']=!![];_0x60833c[_0x31af('0x52')]['readAt']=moment()[_0x31af('0x57')](_0x31af('0x58'));_0x60833c['body'][_0x31af('0x59')]=_0x60833c[_0x31af('0x52')][_0x31af('0x59')]||_0x60833c[_0x31af('0x5a')]['id'];_0x37f6bb[_0x31af('0x5b')]['id']=_0x60833c['body'][_0x31af('0x59')];return db['ChatMessage']['find']({'where':{'id':_0x60833c[_0x31af('0x4f')]['id'],'UserId':null}})[_0x31af('0x1c')](handleEntityNotFound(_0x55f4f2,null))[_0x31af('0x1c')](saveUpdates(_0x60833c[_0x31af('0x52')],null))[_0x31af('0x1c')](function(_0x54d464){if(_0x54d464){_0x37f6bb[_0x31af('0x23')]=_0x54d464[_0x31af('0x5c')]({'plain':!![]});return db[_0x31af('0x5d')]['find']({'where':{'id':_0x54d464['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x55f4f2,null))[_0x31af('0x1c')](function(_0x2e9859){if(_0x2e9859){return _0x2e9859[_0x31af('0x31')]({'UserId':_0x60833c[_0x31af('0x52')][_0x31af('0x59')],'read1stAt':_[_0x31af('0x5e')](_0x2e9859[_0x31af('0x5f')])?moment()[_0x31af('0x57')](_0x31af('0x58')):undefined});}return null;})[_0x31af('0x1c')](function(_0x328d2f){if(_0x328d2f){_0x37f6bb[_0x31af('0x60')]=_0x328d2f[_0x31af('0x5c')]({'plain':!![]});interaction_log[_0x31af('0x61')](_0x31af('0x62'),_0x60833c[_0x31af('0x5a')]['id'],_0x60833c['user'][_0x31af('0x34')],_0x60833c['user'][_0x31af('0x63')],_0x37f6bb[_0x31af('0x60')]['id'],_0x60833c[_0x31af('0x52')]?JSON[_0x31af('0x20')](_0x60833c['body']):_0x31af('0x64'));return respondWithRpcPromise(_0x31af('0x65'),_0x31af('0x66'),_0x37f6bb);}return null;})[_0x31af('0x1c')](function(_0x5d99ce){var _0x50860a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d99ce[_0x31af('0x23')][_0x31af('0x67')];return db[_0x31af('0x68')][_0x31af('0x3a')](_0x50860a,{'type':db[_0x31af('0x69')][_0x31af('0x6a')][_0x31af('0x6b')],'raw':!![]})['then'](function(_0x3f270d){return _0x3f270d;});})[_0x31af('0x1c')](function(_0x3ae89d){if(_0x3ae89d){_0x37f6bb[_0x31af('0x23')][_0x31af('0x6c')]=_0x3ae89d[0x0];if(!_0x60833c[_0x31af('0x52')][_0x31af('0x59')])return;return db['User'][_0x31af('0x50')]({'where':{'id':_0x60833c['body'][_0x31af('0x59')],'role':'agent'},'attributes':['id',_0x31af('0x34'),_0x31af('0x6d'),_0x31af('0x6e'),'internal'],'raw':!![]});}return null;})[_0x31af('0x1c')](function(_0xd9661){if(!_0xd9661)return null;_0x37f6bb[_0x31af('0x23')]['agent']=_0xd9661;return _0x37f6bb;})[_0x31af('0x1c')](function(_0x17c537){if(_0x17c537){if(_0x60833c[_0x31af('0x52')][_0x31af('0x6f')]){_0x37f6bb[_0x31af('0x23')][_0x31af('0x70')]=util[_0x31af('0x57')](_0x31af('0x71'),_0x60833c['user'][_0x31af('0x34')]);_0x37f6bb[_0x31af('0x23')][_0x31af('0x72')]=_0x37f6bb[_0x31af('0x72')];_0x37f6bb[_0x31af('0x23')][_0x31af('0x73')]=_0x37f6bb[_0x31af('0x72')];_0x37f6bb[_0x31af('0x23')][_0x31af('0x74')]='accept';return respondWithRpcPromise(_0x31af('0x75'),_0x31af('0x75'),{'event':'acceptmessage','message':_[_0x31af('0x49')](_0x37f6bb['message'],JSON[_0x31af('0x76')](_0x37f6bb['interaction']['formData']))},client9002)[_0x31af('0x1c')](function(){return _0x37f6bb;});}return _0x37f6bb;}return null;})[_0x31af('0x1c')](respondWithResult(_0x55f4f2,null))[_0x31af('0x25')](handleError(_0x55f4f2,null));};var interaction_log=require(_0x31af('0x53'))('chat-interactions');exports[_0x31af('0x2f')]=function(_0x4c7e3c,_0x30ac58,_0xbe7bd3){var _0x4f7092={'agent':{},'channel':_0x31af('0x56')};if(_0x4c7e3c[_0x31af('0x52')]['id']){delete _0x4c7e3c['body']['id'];}_0x4c7e3c[_0x31af('0x52')][_0x31af('0x59')]=_0x4c7e3c['body']['UserId']||_0x4c7e3c[_0x31af('0x5a')]['id'];_0x4f7092[_0x31af('0x5b')]['id']=_0x4c7e3c[_0x31af('0x52')]['UserId'];return db[_0x31af('0x4b')][_0x31af('0x50')]({'where':{'id':_0x4c7e3c[_0x31af('0x4f')]['id'],'UserId':null}})[_0x31af('0x1c')](handleEntityNotFound(_0x30ac58,null))[_0x31af('0x1c')](function(_0x581952){if(_0x581952){_0x4f7092[_0x31af('0x23')]=_0x581952[_0x31af('0x5c')]({'plain':!![]});return db[_0x31af('0x5d')][_0x31af('0x50')]({'where':{'id':_0x581952['ChatInteractionId']}});}return null;})[_0x31af('0x1c')](handleEntityNotFound(_0x30ac58,null))[_0x31af('0x1c')](function(_0x49692e){if(_0x49692e){_0x4f7092['interaction']=_0x49692e[_0x31af('0x5c')]({'plain':!![]});interaction_log[_0x31af('0x61')](_0x31af('0x77'),_0x4c7e3c[_0x31af('0x5a')]['id'],_0x4c7e3c[_0x31af('0x5a')][_0x31af('0x34')],_0x4c7e3c[_0x31af('0x5a')][_0x31af('0x63')],_0x4f7092[_0x31af('0x60')]['id'],_0x4c7e3c[_0x31af('0x52')]?JSON[_0x31af('0x20')](_0x4c7e3c['body']):_0x31af('0x64'));return respondWithRpcPromise(_0x31af('0x78'),'rejectMessage',_0x4f7092);}return null;})[_0x31af('0x1c')](function(_0x1b8de9){var _0x56b6dc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1b8de9['message']['ContactId'];return db[_0x31af('0x68')][_0x31af('0x3a')](_0x56b6dc,{'type':db['Sequelize'][_0x31af('0x6a')][_0x31af('0x6b')],'raw':!![]})[_0x31af('0x1c')](function(_0xd0f1be){return _0xd0f1be;});})[_0x31af('0x1c')](function(_0xc802ab){if(_0xc802ab){_0x4f7092['message']['contact']=_0xc802ab[0x0];if(!_0x4c7e3c['body'][_0x31af('0x59')])return;return db[_0x31af('0x79')][_0x31af('0x50')]({'where':{'id':_0x4c7e3c[_0x31af('0x52')][_0x31af('0x59')],'role':_0x31af('0x5b')},'attributes':['id',_0x31af('0x34'),_0x31af('0x6d'),'email',_0x31af('0x7a')],'raw':!![]});}return null;})[_0x31af('0x1c')](function(_0x170f86){if(!_0x170f86)return null;_0x4f7092['message']['agent']=_0x170f86;return _0x4f7092;})[_0x31af('0x1c')](function(_0x1c1f78){if(_0x1c1f78){_0x1c1f78[_0x31af('0x23')][_0x31af('0x70')]=util['format']('SIP/%s',_0x4c7e3c['user'][_0x31af('0x34')]);_0x1c1f78['message']['channel']=_0x4f7092[_0x31af('0x72')];_0x1c1f78[_0x31af('0x23')][_0x31af('0x73')]=_0x4f7092[_0x31af('0x72')];_0x1c1f78['message'][_0x31af('0x74')]=_0x31af('0x2f');respondWithRpcPromise(_0x31af('0x75'),_0x31af('0x75'),{'event':_0x31af('0x7b'),'message':_[_0x31af('0x49')](_0x4f7092['message'],JSON[_0x31af('0x76')](_0x4f7092[_0x31af('0x60')][_0x31af('0x7c')]))},client9002);return _0x4f7092;}return null;})[_0x31af('0x1c')](respondWithResult(_0x30ac58,null))[_0x31af('0x25')](handleError(_0x30ac58,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 834bf61..6db5474 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 _0x66e5=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x66e5,0xea));var _0x566e=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x66e5[_0x562362];return _0x3a18ce;};'use strict';var EventEmitter=require(_0x566e('0x0'));var ChatMessage=require(_0x566e('0x1'))['db'][_0x566e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x566e('0x3')](0x0);var events={'afterCreate':_0x566e('0x4'),'afterUpdate':_0x566e('0x5'),'afterDestroy':_0x566e('0x6')};function emitEvent(_0x3f75e5){return function(_0x45f315,_0x3ee81f,_0x45a8d5){ChatMessageEvents[_0x566e('0x7')](_0x3f75e5+':'+_0x45f315['id'],_0x45f315);ChatMessageEvents[_0x566e('0x7')](_0x3f75e5,_0x45f315);_0x45a8d5(null);};}for(var e in events){if(events[_0x566e('0x8')](e)){var event=events[e];ChatMessage[_0x566e('0x9')](e,emitEvent(event));}}module[_0x566e('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0xdf1b=['hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x409a77,_0x5a6915){var _0x4bb145=function(_0x571941){while(--_0x571941){_0x409a77['push'](_0x409a77['shift']());}};_0x4bb145(++_0x5a6915);}(_0xdf1b,0x1ba));var _0xbdf1=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xdf1b[_0x211fef];return _0x5447bf;};'use strict';var EventEmitter=require(_0xbdf1('0x0'));var ChatMessage=require(_0xbdf1('0x1'))['db'][_0xbdf1('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbdf1('0x3')](0x0);var events={'afterCreate':_0xbdf1('0x4'),'afterUpdate':_0xbdf1('0x5'),'afterDestroy':_0xbdf1('0x6')};function emitEvent(_0xf1996a){return function(_0x3a4468,_0x2d014f,_0x5a4dad){ChatMessageEvents['emit'](_0xf1996a+':'+_0x3a4468['id'],_0x3a4468);ChatMessageEvents[_0xbdf1('0x7')](_0xf1996a,_0x3a4468);_0x5a4dad(null);};}for(var e in events){if(events[_0xbdf1('0x8')](e)){var event=events[e];ChatMessage[_0xbdf1('0x9')](e,emitEvent(event));}}module[_0xbdf1('0xa')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 5f4b7ad..8d10767 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 _0x2aaa=['../../config/logger','api','bluebird','path','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','update','error','utf8mb4','util'];(function(_0x34ec01,_0x3b2fc1){var _0x36f296=function(_0x2481d5){while(--_0x2481d5){_0x34ec01['push'](_0x34ec01['shift']());}};_0x36f296(++_0x3b2fc1);}(_0x2aaa,0x185));var _0xa2aa=function(_0x44fb19,_0x1e8074){_0x44fb19=_0x44fb19-0x0;var _0x4c6e34=_0x2aaa[_0x44fb19];return _0x4c6e34;};'use strict';var _=require('lodash');var util=require(_0xa2aa('0x0'));var logger=require(_0xa2aa('0x1'))(_0xa2aa('0x2'));var moment=require('moment');var BPromise=require(_0xa2aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2aa('0x4'));var rimraf=require('rimraf');var config=require(_0xa2aa('0x5'));var attributes=require('./chatMessage.attributes');module[_0xa2aa('0x6')]=function(_0x5b775f,_0x4b9eb0){return _0x5b775f[_0xa2aa('0x7')](_0xa2aa('0x8'),attributes,{'tableName':_0xa2aa('0x9'),'paranoid':![],'indexes':[{'name':_0xa2aa('0xa'),'fields':[_0xa2aa('0xb')],'type':_0xa2aa('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b5515,_0x29a3f9,_0x1ecde6){var _0x547fcc=_0x5b775f[_0xa2aa('0xd')];var _0x130d03=_0x3b5515[_0xa2aa('0xe')]({'plain':!![]});if(_0x130d03[_0xa2aa('0xf')][_0xa2aa('0x10')]()==='in'||_0x130d03[_0xa2aa('0xf')][_0xa2aa('0x10')]()===_0xa2aa('0x11')&&!_0x130d03[_0xa2aa('0x12')]&&!_[_0xa2aa('0x13')](_0x130d03[_0xa2aa('0x14')])){_0x547fcc['ChatInteraction'][_0xa2aa('0x15')]({'where':{'id':_0x130d03[_0xa2aa('0x16')]}})['then'](function(_0x5b2b6e){if(_0x5b2b6e){_0x5b2b6e[_0xa2aa('0x17')]({'lastMsgAt':_0x130d03['createdAt'],'lastMsgDirection':_0x130d03['direction'][_0xa2aa('0x10')]()});}})['catch'](function(_0x460060){console[_0xa2aa('0x18')](_0x460060);});}_0x1ecde6();}},'charset':_0xa2aa('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc212=['toLowerCase','out','secret','isNil','ChatInteraction','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','direction'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xc212,0x1af));var _0x2c21=function(_0x74384b,_0x27a7bb){_0x74384b=_0x74384b-0x0;var _0x2952b0=_0xc212[_0x74384b];return _0x2952b0;};'use strict';var _=require('lodash');var util=require(_0x2c21('0x0'));var logger=require(_0x2c21('0x1'))(_0x2c21('0x2'));var moment=require(_0x2c21('0x3'));var BPromise=require(_0x2c21('0x4'));var rp=require(_0x2c21('0x5'));var fs=require('fs');var path=require(_0x2c21('0x6'));var rimraf=require(_0x2c21('0x7'));var config=require(_0x2c21('0x8'));var attributes=require(_0x2c21('0x9'));module[_0x2c21('0xa')]=function(_0x3267c4,_0x2220e2){return _0x3267c4[_0x2c21('0xb')]('ChatMessage',attributes,{'tableName':_0x2c21('0xc'),'paranoid':![],'indexes':[{'name':_0x2c21('0xd'),'fields':[_0x2c21('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5988e6,_0x42deae,_0x329645){var _0x1ba920=_0x3267c4[_0x2c21('0xf')];var _0x3b59dc=_0x5988e6['get']({'plain':!![]});if(_0x3b59dc[_0x2c21('0x10')]['toLowerCase']()==='in'||_0x3b59dc[_0x2c21('0x10')][_0x2c21('0x11')]()===_0x2c21('0x12')&&!_0x3b59dc[_0x2c21('0x13')]&&!_[_0x2c21('0x14')](_0x3b59dc['UserId'])){_0x1ba920[_0x2c21('0x15')]['findOne']({'where':{'id':_0x3b59dc['ChatInteractionId']}})[_0x2c21('0x16')](function(_0x5bd765){if(_0x5bd765){_0x5bd765[_0x2c21('0x17')]({'lastMsgAt':_0x3b59dc[_0x2c21('0x18')],'lastMsgDirection':_0x3b59dc[_0x2c21('0x10')][_0x2c21('0x11')]()});}})[_0x2c21('0x19')](function(_0x4946bd){console['error'](_0x4946bd);});}_0x329645();}},'charset':_0x2c21('0x1a'),'collate':_0x2c21('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b9a7554..85ebbb9 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 _0x0b09=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x0b09,0x69));var _0x90b0=function(_0x56c1d6,_0x50e5a6){_0x56c1d6=_0x56c1d6-0x0;var _0x5cde99=_0x0b09[_0x56c1d6];return _0x5cde99;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90b0('0x0'));var BPromise=require('bluebird');var rs=require(_0x90b0('0x1'));var fs=require('fs');var Redis=require(_0x90b0('0x2'));var db=require(_0x90b0('0x3'))['db'];var utils=require(_0x90b0('0x4'));var logger=require(_0x90b0('0x5'))('rpc');var config=require(_0x90b0('0x6'));var jayson=require(_0x90b0('0x7'));var client=jayson[_0x90b0('0x8')][_0x90b0('0x9')]({'port':0x232a});config[_0x90b0('0xa')]=_['defaults'](config['redis'],{'host':_0x90b0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90b0('0xa')]));require(_0x90b0('0xc'))[_0x90b0('0xd')](socket);function respondWithRpcPromise(_0x381609,_0x8b9199,_0x4ca1cf){return new BPromise(function(_0x3c9336,_0x196b56){return client[_0x90b0('0xe')](_0x381609,_0x4ca1cf)[_0x90b0('0xf')](function(_0x4b1f5c){logger[_0x90b0('0x10')](_0x90b0('0x11'),_0x8b9199,_0x90b0('0x12'));logger[_0x90b0('0x13')](_0x90b0('0x14'),_0x8b9199,_0x90b0('0x12'),JSON[_0x90b0('0x15')](_0x4b1f5c));if(_0x4b1f5c[_0x90b0('0x16')]){if(_0x4b1f5c[_0x90b0('0x16')][_0x90b0('0x17')]===0x1f4){logger[_0x90b0('0x16')](_0x90b0('0x11'),_0x8b9199,_0x4b1f5c[_0x90b0('0x16')][_0x90b0('0x18')]);return _0x196b56(_0x4b1f5c[_0x90b0('0x16')][_0x90b0('0x18')]);}logger[_0x90b0('0x16')](_0x90b0('0x11'),_0x8b9199,_0x4b1f5c[_0x90b0('0x16')]['message']);return _0x3c9336(_0x4b1f5c[_0x90b0('0x16')]['message']);}else{logger[_0x90b0('0x10')](_0x90b0('0x11'),_0x8b9199,'request\x20sent');_0x3c9336(_0x4b1f5c[_0x90b0('0x19')][_0x90b0('0x18')]);}})[_0x90b0('0x1a')](function(_0x42eeab){logger[_0x90b0('0x16')](_0x90b0('0x11'),_0x8b9199,_0x42eeab);_0x196b56(_0x42eeab);});});}exports[_0x90b0('0x1b')]=function(_0x309b09){var _0x40a11d=this;return new Promise(function(_0x3faa7d,_0x45414c){return db[_0x90b0('0x1c')][_0x90b0('0x1d')](_0x309b09['body'],{'raw':_0x309b09['options']?_0x309b09[_0x90b0('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x90b0('0xf')](function(_0x5724d7){logger[_0x90b0('0x10')](_0x90b0('0x1b'),_0x309b09);logger[_0x90b0('0x13')](_0x90b0('0x1b'),_0x309b09,JSON[_0x90b0('0x15')](_0x5724d7));_0x3faa7d(_0x5724d7);})[_0x90b0('0x1a')](function(_0x2dea26){logger[_0x90b0('0x16')](_0x90b0('0x1b'),_0x2dea26[_0x90b0('0x18')],_0x309b09);_0x45414c(_0x40a11d[_0x90b0('0x16')](0x1f4,_0x2dea26[_0x90b0('0x18')]));});});}; \ No newline at end of file +var _0xce9d=['ChatMessage','create','body','options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x50424b,_0x38b71b){var _0x2b67e7=function(_0x17c55f){while(--_0x17c55f){_0x50424b['push'](_0x50424b['shift']());}};_0x2b67e7(++_0x38b71b);}(_0xce9d,0x1ce));var _0xdce9=function(_0x3b371c,_0x244587){_0x3b371c=_0x3b371c-0x0;var _0x390596=_0xce9d[_0x3b371c];return _0x390596;};'use strict';var _=require(_0xdce9('0x0'));var util=require(_0xdce9('0x1'));var moment=require(_0xdce9('0x2'));var BPromise=require(_0xdce9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdce9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdce9('0x5'));var logger=require(_0xdce9('0x6'))('rpc');var config=require(_0xdce9('0x7'));var jayson=require(_0xdce9('0x8'));var client=jayson[_0xdce9('0x9')][_0xdce9('0xa')]({'port':0x232a});config[_0xdce9('0xb')]=_[_0xdce9('0xc')](config[_0xdce9('0xb')],{'host':_0xdce9('0xd'),'port':0x18eb});var socket=require(_0xdce9('0xe'))(new Redis(config[_0xdce9('0xb')]));require(_0xdce9('0xf'))[_0xdce9('0x10')](socket);function respondWithRpcPromise(_0x493179,_0x93fe65,_0x2caea2){return new BPromise(function(_0x38376d,_0x39f075){return client[_0xdce9('0x11')](_0x493179,_0x2caea2)['then'](function(_0x1feea0){logger[_0xdce9('0x12')](_0xdce9('0x13'),_0x93fe65,'request\x20sent');logger[_0xdce9('0x14')](_0xdce9('0x15'),_0x93fe65,_0xdce9('0x16'),JSON['stringify'](_0x1feea0));if(_0x1feea0[_0xdce9('0x17')]){if(_0x1feea0[_0xdce9('0x17')][_0xdce9('0x18')]===0x1f4){logger[_0xdce9('0x17')](_0xdce9('0x13'),_0x93fe65,_0x1feea0['error'][_0xdce9('0x19')]);return _0x39f075(_0x1feea0[_0xdce9('0x17')]['message']);}logger[_0xdce9('0x17')](_0xdce9('0x13'),_0x93fe65,_0x1feea0['error'][_0xdce9('0x19')]);return _0x38376d(_0x1feea0[_0xdce9('0x17')][_0xdce9('0x19')]);}else{logger['info'](_0xdce9('0x13'),_0x93fe65,_0xdce9('0x16'));_0x38376d(_0x1feea0[_0xdce9('0x1a')][_0xdce9('0x19')]);}})[_0xdce9('0x1b')](function(_0x2b850c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x93fe65,_0x2b850c);_0x39f075(_0x2b850c);});});}exports['CreateChatMessage']=function(_0x255339){var _0x5e2765=this;return new Promise(function(_0x22f7a4,_0x2fb330){return db[_0xdce9('0x1c')][_0xdce9('0x1d')](_0x255339[_0xdce9('0x1e')],{'raw':_0x255339[_0xdce9('0x1f')]?_0x255339[_0xdce9('0x1f')][_0xdce9('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1da8ec){logger['info'](_0xdce9('0x21'),_0x255339);logger[_0xdce9('0x14')](_0xdce9('0x21'),_0x255339,JSON[_0xdce9('0x22')](_0x1da8ec));_0x22f7a4(_0x1da8ec);})[_0xdce9('0x1b')](function(_0x392117){logger['error'](_0xdce9('0x21'),_0x392117[_0xdce9('0x19')],_0x255339);_0x2fb330(_0x5e2765[_0xdce9('0x17')](0x1f4,_0x392117[_0xdce9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 25b8f2f..85ac9fa 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 _0x8c32=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x29c70f,_0xb99305){var _0x32bcac=function(_0x2df03a){while(--_0x2df03a){_0x29c70f['push'](_0x29c70f['shift']());}};_0x32bcac(++_0xb99305);}(_0x8c32,0x130));var _0x28c3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x8c32[_0x11005e];return _0x29338f;};'use strict';var ChatMessageEvents=require(_0x28c3('0x0'));var events=[_0x28c3('0x1'),_0x28c3('0x2'),_0x28c3('0x3')];function createListener(_0x27dd09,_0xc522d5){return function(_0x36d4ad){_0xc522d5[_0x28c3('0x4')](_0x27dd09,_0x36d4ad);};}function removeListener(_0x2f94e0,_0x40df22){return function(){ChatMessageEvents[_0x28c3('0x5')](_0x2f94e0,_0x40df22);};}exports[_0x28c3('0x6')]=function(_0x537b4f){for(var _0x2861c9=0x0,_0x4ed515=events[_0x28c3('0x7')];_0x2861c9<_0x4ed515;_0x2861c9++){var _0x482952=events[_0x2861c9];var _0xbaee6f=createListener(_0x28c3('0x8')+_0x482952,_0x537b4f);ChatMessageEvents['on'](_0x482952,_0xbaee6f);}}; \ No newline at end of file +var _0xf0ba=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x301112,_0x352b2d){var _0x429557=function(_0x188ad1){while(--_0x188ad1){_0x301112['push'](_0x301112['shift']());}};_0x429557(++_0x352b2d);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require(_0xaf0b('0x0'));var events=[_0xaf0b('0x1'),_0xaf0b('0x2'),_0xaf0b('0x3')];function createListener(_0xea88b2,_0x555620){return function(_0x277920){_0x555620[_0xaf0b('0x4')](_0xea88b2,_0x277920);};}function removeListener(_0x4cffa5,_0xcd565f){return function(){ChatMessageEvents['removeListener'](_0x4cffa5,_0xcd565f);};}exports[_0xaf0b('0x5')]=function(_0x4b3b85){for(var _0x4d1479=0x0,_0x53b32d=events[_0xaf0b('0x6')];_0x4d1479<_0x53b32d;_0x4d1479++){var _0x17b6d5=events[_0x4d1479];var _0x3439d5=createListener(_0xaf0b('0x7')+_0x17b6d5,_0x4b3b85);ChatMessageEvents['on'](_0x17b6d5,_0x3439d5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e4381c3..13b41f8 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 _0x190f=['index','/describe','isAuthenticated','/:id','show','post','create','put','update','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x190f,0x15e));var _0xf190=function(_0x58b94e,_0x48d05f){_0x58b94e=_0x58b94e-0x0;var _0x505342=_0x190f[_0x58b94e];return _0x505342;};'use strict';var multer=require(_0xf190('0x0'));var util=require(_0xf190('0x1'));var path=require(_0xf190('0x2'));var timeout=require(_0xf190('0x3'));var express=require(_0xf190('0x4'));var router=express[_0xf190('0x5')]();var fs_extra=require(_0xf190('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf190('0x7'));var config=require(_0xf190('0x8'));var controller=require(_0xf190('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf190('0xa')]);router['get'](_0xf190('0xb'),auth[_0xf190('0xc')](),controller['describe']);router['get'](_0xf190('0xd'),auth[_0xf190('0xc')](),controller[_0xf190('0xe')]);router[_0xf190('0xf')]('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0xf190('0x10')]);router[_0xf190('0x11')](_0xf190('0xd'),controller[_0xf190('0x12')]);router[_0xf190('0x11')]('/:id/accept',auth[_0xf190('0xc')](),controller['accept']);router[_0xf190('0x11')](_0xf190('0x13'),auth[_0xf190('0xc')](),controller[_0xf190('0x14')]);router[_0xf190('0x15')](_0xf190('0xd'),auth[_0xf190('0xc')](),controller[_0xf190('0x16')]);module[_0xf190('0x17')]=router; \ No newline at end of file +var _0x4541=['put','/:id','update','/:id/accept','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','describe','isAuthenticated','show','tracked','chat','chatmessage:create','create'];(function(_0x3c4f9a,_0x4762b9){var _0x44d7a3=function(_0x25bd9a){while(--_0x25bd9a){_0x3c4f9a['push'](_0x3c4f9a['shift']());}};_0x44d7a3(++_0x4762b9);}(_0x4541,0x125));var _0x1454=function(_0x144c59,_0x25f773){_0x144c59=_0x144c59-0x0;var _0x1d593=_0x4541[_0x144c59];return _0x1d593;};'use strict';var multer=require(_0x1454('0x0'));var util=require('util');var path=require(_0x1454('0x1'));var timeout=require('connect-timeout');var express=require(_0x1454('0x2'));var router=express[_0x1454('0x3')]();var fs_extra=require(_0x1454('0x4'));var auth=require(_0x1454('0x5'));var interaction=require(_0x1454('0x6'));var config=require(_0x1454('0x7'));var controller=require(_0x1454('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1454('0x9')]);router[_0x1454('0xa')](_0x1454('0xb'),auth['isAuthenticated'](),controller[_0x1454('0xc')]);router['get']('/:id',auth[_0x1454('0xd')](),controller[_0x1454('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x1454('0xf')](_0x1454('0x10'),_0x1454('0x11')),controller[_0x1454('0x12')]);router[_0x1454('0x13')](_0x1454('0x14'),controller[_0x1454('0x15')]);router[_0x1454('0x13')](_0x1454('0x16'),auth[_0x1454('0xd')](),controller['accept']);router[_0x1454('0x13')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x1454('0x17')](_0x1454('0x14'),auth[_0x1454('0xd')](),controller[_0x1454('0x18')]);module[_0x1454('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 7f20aed..534db6b 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x16803a,_0x5313d7){var _0x2dde47=function(_0x3cc2fa){while(--_0x3cc2fa){_0x16803a['push'](_0x16803a['shift']());}};_0x2dde47(++_0x5313d7);}(_0xdb28,0x106));var _0x8db2=function(_0x415cb8,_0x213075){_0x415cb8=_0x415cb8-0x0;var _0x2b89c6=_0xdb28[_0x415cb8];return _0x2b89c6;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x38c75b,_0x2a7498){var _0x128d76=function(_0x4e43ea){while(--_0x4e43ea){_0x38c75b['push'](_0x38c75b['shift']());}};_0x128d76(++_0x2a7498);}(_0xdb28,0x106));var _0x8db2=function(_0x2ecb2d,_0x1ae63c){_0x2ecb2d=_0x2ecb2d-0x0;var _0xab98c1=_0xdb28[_0x2ecb2d];return _0xab98c1;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('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 7ab5fd8..9b2536c 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x24cb63,_0x42e91f){_0x24cb63=_0x24cb63-0x0;var _0x21f029=_0x7a54[_0x24cb63];return _0x21f029;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x6d349,_0x10c72a){_0x6d349=_0x6d349-0x0;var _0x42972c=_0x7a54[_0x6d349];return _0x42972c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 02ca27e..5ac352b 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1487=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5060ab,_0x5763a1){var _0x5b9cd9=function(_0x4e47cf){while(--_0x4e47cf){_0x5060ab['push'](_0x5060ab['shift']());}};_0x5b9cd9(++_0x5763a1);}(_0x1487,0xf2));var _0x7148=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x1487[_0x5806c3];return _0x48ac77;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7148('0x0'))['db'][_0x7148('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7148('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7148('0x3'),'afterDestroy':_0x7148('0x4')};function emitEvent(_0x48f2b6){return function(_0x440aff,_0x2e82c8,_0xe5315a){ChatOfflineMessageEvents[_0x7148('0x5')](_0x48f2b6+':'+_0x440aff['id'],_0x440aff);ChatOfflineMessageEvents[_0x7148('0x5')](_0x48f2b6,_0x440aff);_0xe5315a(null);};}for(var e in events){if(events[_0x7148('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x7148('0x7')](e,emitEvent(event));}}module[_0x7148('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xe93a=['emit','hasOwnProperty','exports','events','../../mysqldb','remove'];(function(_0x220303,_0xc85d0){var _0x2cb259=function(_0x5b6b78){while(--_0x5b6b78){_0x220303['push'](_0x220303['shift']());}};_0x2cb259(++_0xc85d0);}(_0xe93a,0x1a7));var _0xae93=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xe93a[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0xae93('0x0'));var ChatOfflineMessage=require(_0xae93('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xae93('0x2')};function emitEvent(_0x4ce8a4){return function(_0x27ccf2,_0x48fef5,_0x4b2548){ChatOfflineMessageEvents[_0xae93('0x3')](_0x4ce8a4+':'+_0x27ccf2['id'],_0x27ccf2);ChatOfflineMessageEvents['emit'](_0x4ce8a4,_0x27ccf2);_0x4b2548(null);};}for(var e in events){if(events[_0xae93('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xae93('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index fc9dae6..39fc5a4 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 _0x5437=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5437,0x1e7));var _0x7543=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x5437[_0x4afac5];return _0x2404b3;};'use strict';var attributes=require(_0x7543('0x0'));module['exports']=function(_0x3250e4){return _0x3250e4[_0x7543('0x1')](_0x7543('0x2'),attributes,{'tableName':_0x7543('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7543('0x4'),'collate':_0x7543('0x5')});}; \ No newline at end of file +var _0x6825=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','exports'];(function(_0x441f56,_0x4b5596){var _0x411181=function(_0x3aa861){while(--_0x3aa861){_0x441f56['push'](_0x441f56['shift']());}};_0x411181(++_0x4b5596);}(_0x6825,0x95));var _0x5682=function(_0x5912c6,_0x471222){_0x5912c6=_0x5912c6-0x0;var _0x1d10bf=_0x6825[_0x5912c6];return _0x1d10bf;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x5682('0x0')]=function(_0x2a553b){return _0x2a553b[_0x5682('0x1')](_0x5682('0x2'),attributes,{'tableName':_0x5682('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5682('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3d76904..6dcfa41 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 _0x18c9=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1368db,_0x4b94de){var _0x45a75f=function(_0x4b17ee){while(--_0x4b17ee){_0x1368db['push'](_0x1368db['shift']());}};_0x45a75f(++_0x4b94de);}(_0x18c9,0x1bf));var _0x918c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x18c9[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x918c('0x0'));var util=require(_0x918c('0x1'));var moment=require(_0x918c('0x2'));var BPromise=require(_0x918c('0x3'));var rs=require(_0x918c('0x4'));var fs=require('fs');var Redis=require(_0x918c('0x5'));var db=require(_0x918c('0x6'))['db'];var utils=require(_0x918c('0x7'));var logger=require(_0x918c('0x8'))(_0x918c('0x9'));var config=require(_0x918c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x918c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f463b,_0x321ab8,_0x1b774e){return new BPromise(function(_0x4f5bd8,_0x5b14e5){return client[_0x918c('0xc')](_0x2f463b,_0x1b774e)[_0x918c('0xd')](function(_0x2c63e0){logger[_0x918c('0xe')](_0x918c('0xf'),_0x321ab8,_0x918c('0x10'));logger[_0x918c('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x321ab8,_0x918c('0x10'),JSON[_0x918c('0x12')](_0x2c63e0));if(_0x2c63e0['error']){if(_0x2c63e0[_0x918c('0x13')][_0x918c('0x14')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x321ab8,_0x2c63e0[_0x918c('0x13')][_0x918c('0x15')]);return _0x5b14e5(_0x2c63e0['error']['message']);}logger[_0x918c('0x13')](_0x918c('0xf'),_0x321ab8,_0x2c63e0[_0x918c('0x13')][_0x918c('0x15')]);return _0x4f5bd8(_0x2c63e0[_0x918c('0x13')][_0x918c('0x15')]);}else{logger[_0x918c('0xe')](_0x918c('0xf'),_0x321ab8,_0x918c('0x10'));_0x4f5bd8(_0x2c63e0['result'][_0x918c('0x15')]);}})[_0x918c('0x16')](function(_0x5253cb){logger[_0x918c('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x321ab8,_0x5253cb);_0x5b14e5(_0x5253cb);});});} \ No newline at end of file +var _0x46ba=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x17b37d,_0x123575){var _0x2ef872=function(_0x49bec6){while(--_0x49bec6){_0x17b37d['push'](_0x17b37d['shift']());}};_0x2ef872(++_0x123575);}(_0x46ba,0xd9));var _0xa46b=function(_0x42cbf4,_0x4fbb52){_0x42cbf4=_0x42cbf4-0x0;var _0xbdedbc=_0x46ba[_0x42cbf4];return _0xbdedbc;};'use strict';var _=require(_0xa46b('0x0'));var util=require(_0xa46b('0x1'));var moment=require(_0xa46b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa46b('0x3'));var fs=require('fs');var Redis=require(_0xa46b('0x4'));var db=require(_0xa46b('0x5'))['db'];var utils=require(_0xa46b('0x6'));var logger=require('../../config/logger')(_0xa46b('0x7'));var config=require('../../config/environment');var jayson=require(_0xa46b('0x8'));var client=jayson[_0xa46b('0x9')][_0xa46b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e9ae,_0x48fc48,_0x2ca0d7){return new BPromise(function(_0x1ff3a7,_0x37044e){return client[_0xa46b('0xb')](_0x52e9ae,_0x2ca0d7)[_0xa46b('0xc')](function(_0x380f41){logger['info'](_0xa46b('0xd'),_0x48fc48,_0xa46b('0xe'));logger[_0xa46b('0xf')](_0xa46b('0x10'),_0x48fc48,_0xa46b('0xe'),JSON['stringify'](_0x380f41));if(_0x380f41[_0xa46b('0x11')]){if(_0x380f41[_0xa46b('0x11')][_0xa46b('0x12')]===0x1f4){logger[_0xa46b('0x11')](_0xa46b('0xd'),_0x48fc48,_0x380f41[_0xa46b('0x11')][_0xa46b('0x13')]);return _0x37044e(_0x380f41[_0xa46b('0x11')][_0xa46b('0x13')]);}logger['error'](_0xa46b('0xd'),_0x48fc48,_0x380f41[_0xa46b('0x11')]['message']);return _0x1ff3a7(_0x380f41[_0xa46b('0x11')][_0xa46b('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x48fc48,'request\x20sent');_0x1ff3a7(_0x380f41[_0xa46b('0x14')][_0xa46b('0x13')]);}})[_0xa46b('0x15')](function(_0x50193e){logger[_0xa46b('0x11')](_0xa46b('0xd'),_0x48fc48,_0x50193e);_0x37044e(_0x50193e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3379723..b039f15 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 _0xfbc4=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x11e454,_0x381b52){var _0xbd4b0b=function(_0x2e09c9){while(--_0x2e09c9){_0x11e454['push'](_0x11e454['shift']());}};_0xbd4b0b(++_0x381b52);}(_0xfbc4,0x94));var _0x4fbc=function(_0x473d4a,_0x4bf1e2){_0x473d4a=_0x473d4a-0x0;var _0x2d067f=_0xfbc4[_0x473d4a];return _0x2d067f;};'use strict';var multer=require(_0x4fbc('0x0'));var util=require(_0x4fbc('0x1'));var path=require(_0x4fbc('0x2'));var timeout=require(_0x4fbc('0x3'));var express=require(_0x4fbc('0x4'));var router=express[_0x4fbc('0x5')]();var fs_extra=require(_0x4fbc('0x6'));var auth=require(_0x4fbc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4fbc('0x8'));var controller=require(_0x4fbc('0x9'));router[_0x4fbc('0xa')]('/',auth[_0x4fbc('0xb')](),controller[_0x4fbc('0xc')]);router[_0x4fbc('0xa')](_0x4fbc('0xd'),auth[_0x4fbc('0xb')](),controller[_0x4fbc('0xe')]);router['get'](_0x4fbc('0xf'),auth[_0x4fbc('0xb')](),controller['show']);router[_0x4fbc('0x10')]('/',auth[_0x4fbc('0xb')](),controller[_0x4fbc('0x11')]);router[_0x4fbc('0x12')](_0x4fbc('0xf'),auth[_0x4fbc('0xb')](),controller[_0x4fbc('0x13')]);router[_0x4fbc('0x14')](_0x4fbc('0xf'),auth[_0x4fbc('0xb')](),controller['destroy']);module[_0x4fbc('0x15')]=router; \ No newline at end of file +var _0x4fc2=['/describe','describe','/:id','show','post','update','delete','destroy','multer','util','path','express','Router','get','isAuthenticated','index'];(function(_0x269cd1,_0x3705ba){var _0x381a2c=function(_0x3ebf2e){while(--_0x3ebf2e){_0x269cd1['push'](_0x269cd1['shift']());}};_0x381a2c(++_0x3705ba);}(_0x4fc2,0x108));var _0x24fc=function(_0x2dd6b7,_0x4ccce3){_0x2dd6b7=_0x2dd6b7-0x0;var _0x9c28c1=_0x4fc2[_0x2dd6b7];return _0x9c28c1;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x24fc('0x3'));var router=express[_0x24fc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x24fc('0x5')]('/',auth[_0x24fc('0x6')](),controller[_0x24fc('0x7')]);router[_0x24fc('0x5')](_0x24fc('0x8'),auth[_0x24fc('0x6')](),controller[_0x24fc('0x9')]);router['get'](_0x24fc('0xa'),auth[_0x24fc('0x6')](),controller[_0x24fc('0xb')]);router[_0x24fc('0xc')]('/',auth[_0x24fc('0x6')](),controller['create']);router['put'](_0x24fc('0xa'),auth['isAuthenticated'](),controller[_0x24fc('0xd')]);router[_0x24fc('0xe')](_0x24fc('0xa'),auth[_0x24fc('0x6')](),controller[_0x24fc('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 7a1771d..62cc077 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 _0x0666=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x40331f,_0x508503){var _0x52cb62=function(_0x2d9ac7){while(--_0x2d9ac7){_0x40331f['push'](_0x40331f['shift']());}};_0x52cb62(++_0x508503);}(_0x0666,0x1a7));var _0x6066=function(_0x73395e,_0x4774e7){_0x73395e=_0x73395e-0x0;var _0x372fc1=_0x0666[_0x73395e];return _0x372fc1;};'use strict';var Sequelize=require('sequelize');module[_0x6066('0x0')]={'name':{'type':Sequelize[_0x6066('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6066('0x2')](_0x6066('0x3'),_0x6066('0x4')),'defaultValue':_0x6066('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x53af=['STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x45d3ad,_0x54a541){var _0x13b5e4=function(_0x1f6ee3){while(--_0x1f6ee3){_0x45d3ad['push'](_0x45d3ad['shift']());}};_0x13b5e4(++_0x54a541);}(_0x53af,0x10d));var _0xf53a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53af[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xf53a('0x0'));module['exports']={'name':{'type':Sequelize[_0xf53a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf53a('0x2')](_0xf53a('0x3'),'timeout'),'defaultValue':_0xf53a('0x3')},'selector':{'type':Sequelize[_0xf53a('0x1')]},'timeout':{'type':Sequelize[_0xf53a('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index b980de9..e8ce82d 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 _0xe002=['merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','sendStatus','error','stack','name','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe002,0xf7));var _0x2e00=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xe002[_0x15cdcb];return _0x37b069;};'use strict';var emlformat=require(_0x2e00('0x0'));var rimraf=require(_0x2e00('0x1'));var zipdir=require(_0x2e00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var Mustache=require('mustache');var util=require(_0x2e00('0x6'));var path=require(_0x2e00('0x7'));var sox=require(_0x2e00('0x8'));var csv=require(_0x2e00('0x9'));var ejs=require(_0x2e00('0xa'));var fs=require('fs');var fs_extra=require(_0x2e00('0xb'));var _=require(_0x2e00('0xc'));var squel=require(_0x2e00('0xd'));var crypto=require('crypto');var jsforce=require(_0x2e00('0xe'));var deskjs=require(_0x2e00('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2e00('0x10'));var Papa=require(_0x2e00('0x11'));var Redis=require(_0x2e00('0x12'));var authService=require(_0x2e00('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e00('0x14'));var logger=require(_0x2e00('0x15'))(_0x2e00('0x16'));var utils=require('../../config/utils');var config=require(_0x2e00('0x17'));var licenseUtil=require(_0x2e00('0x18'));var db=require(_0x2e00('0x19'))['db'];function respondWithStatusCode(_0x40e6d1,_0x34cb45){_0x34cb45=_0x34cb45||0xcc;return function(_0x4ec979){if(_0x4ec979){return _0x40e6d1['sendStatus'](_0x34cb45);}return _0x40e6d1[_0x2e00('0x1a')](_0x34cb45)[_0x2e00('0x1b')]();};}function respondWithResult(_0x23796c,_0x24c603){_0x24c603=_0x24c603||0xc8;return function(_0x13e130){if(_0x13e130){return _0x23796c['status'](_0x24c603)[_0x2e00('0x1c')](_0x13e130);}};}function respondWithFilteredResult(_0x53a6fa,_0x1d805a){return function(_0x1247f9){if(_0x1247f9){var _0x554dd4=typeof _0x1d805a[_0x2e00('0x1d')]===_0x2e00('0x1e')&&typeof _0x1d805a[_0x2e00('0x1f')]===_0x2e00('0x1e');var _0x4be341=_0x1247f9[_0x2e00('0x20')];var _0x3d5593=_0x554dd4?0x0:_0x1d805a['offset'];var _0xa19ca1=_0x554dd4?_0x1247f9[_0x2e00('0x20')]:_0x1d805a[_0x2e00('0x1d')]+_0x1d805a['limit'];var _0x280804;if(_0xa19ca1>=_0x4be341){_0xa19ca1=_0x4be341;_0x280804=0xc8;}else{_0x280804=0xce;}_0x53a6fa[_0x2e00('0x1a')](_0x280804);return _0x53a6fa['set']('Content-Range',_0x3d5593+'-'+_0xa19ca1+'/'+_0x4be341)['json'](_0x1247f9);}return null;};}function patchUpdates(_0x5c022f){return function(_0x2a2bf3){try{jsonpatch[_0x2e00('0x21')](_0x2a2bf3,_0x5c022f,!![]);}catch(_0x2a10ad){return BPromise['reject'](_0x2a10ad);}return _0x2a2bf3[_0x2e00('0x22')]();};}function saveUpdates(_0x10b55b,_0x1b0cab){return function(_0x465af0){if(_0x465af0){return _0x465af0[_0x2e00('0x23')](_0x10b55b)[_0x2e00('0x24')](function(_0x415b6f){return _0x415b6f;});}return null;};}function removeEntity(_0xac65da,_0x7c262f){return function(_0x172967){if(_0x172967){return _0x172967[_0x2e00('0x25')]()[_0x2e00('0x24')](function(){_0xac65da[_0x2e00('0x1a')](0xcc)[_0x2e00('0x1b')]();});}};}function handleEntityNotFound(_0x36d576,_0x811a65){return function(_0x550ecb){if(!_0x550ecb){_0x36d576[_0x2e00('0x26')](0x194);}return _0x550ecb;};}function handleError(_0x102faa,_0xe8ee4){_0xe8ee4=_0xe8ee4||0x1f4;return function(_0x497b2d){logger[_0x2e00('0x27')](_0x497b2d[_0x2e00('0x28')]);if(_0x497b2d[_0x2e00('0x29')]){delete _0x497b2d[_0x2e00('0x29')];}_0x102faa[_0x2e00('0x1a')](_0xe8ee4)['send'](_0x497b2d);};}exports[_0x2e00('0x2a')]=function(_0x5a75ad,_0x133967){var _0x4842c5={'raw':!![],'where':{'id':_0x5a75ad['params']['id']}},_0x388d82={};_0x388d82[_0x2e00('0x2b')]=_[_0x2e00('0x2c')](db[_0x2e00('0x2d')]['rawAttributes']);_0x388d82[_0x2e00('0x2e')]=_[_0x2e00('0x2c')](_0x5a75ad[_0x2e00('0x2e')]);_0x388d82[_0x2e00('0x2f')]=_[_0x2e00('0x30')](_0x388d82['model'],_0x388d82[_0x2e00('0x2e')]);_0x4842c5[_0x2e00('0x31')]=_[_0x2e00('0x30')](_0x388d82[_0x2e00('0x2b')],qs[_0x2e00('0x32')](_0x5a75ad[_0x2e00('0x2e')][_0x2e00('0x32')]));_0x4842c5[_0x2e00('0x31')]=_0x4842c5['attributes'][_0x2e00('0x33')]?_0x4842c5['attributes']:_0x388d82[_0x2e00('0x2b')];if(_0x5a75ad[_0x2e00('0x2e')]['includeAll']){_0x4842c5[_0x2e00('0x34')]=[{'all':!![]}];}_0x4842c5=_[_0x2e00('0x35')]({},_0x4842c5,_0x5a75ad[_0x2e00('0x36')]);return db[_0x2e00('0x2d')][_0x2e00('0x37')](_0x4842c5)['then'](handleEntityNotFound(_0x133967,null))[_0x2e00('0x24')](respondWithResult(_0x133967,null))[_0x2e00('0x38')](handleError(_0x133967,null));};exports[_0x2e00('0x39')]=function(_0x5754c9,_0x17e785){return db[_0x2e00('0x2d')][_0x2e00('0x39')](_0x5754c9[_0x2e00('0x3a')],{})[_0x2e00('0x24')](respondWithResult(_0x17e785,0xc9))[_0x2e00('0x38')](handleError(_0x17e785,null));};exports[_0x2e00('0x23')]=function(_0x59d1cc,_0x5de126){if(_0x59d1cc['body']['id']){delete _0x59d1cc['body']['id'];}return db[_0x2e00('0x2d')][_0x2e00('0x37')]({'where':{'id':_0x59d1cc[_0x2e00('0x3b')]['id']}})[_0x2e00('0x24')](handleEntityNotFound(_0x5de126,null))['then'](saveUpdates(_0x59d1cc[_0x2e00('0x3a')],null))[_0x2e00('0x24')](respondWithResult(_0x5de126,null))[_0x2e00('0x38')](handleError(_0x5de126,null));};exports[_0x2e00('0x25')]=function(_0x1269eb,_0x563517){return db[_0x2e00('0x2d')][_0x2e00('0x37')]({'where':{'id':_0x1269eb['params']['id']}})[_0x2e00('0x24')](handleEntityNotFound(_0x563517,null))['then'](removeEntity(_0x563517,null))['catch'](handleError(_0x563517,null));}; \ No newline at end of file +var _0x8ece=['apply','save','update','destroy','then','error','stack','name','send','show','params','keys','rawAttributes','query','filters','model','attributes','fields','length','includeAll','merge','options','ChatProactiveAction','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x8ece,0x195));var _0xe8ec=function(_0x280527,_0x55e080){_0x280527=_0x280527-0x0;var _0x148371=_0x8ece[_0x280527];return _0x148371;};'use strict';var emlformat=require(_0xe8ec('0x0'));var rimraf=require(_0xe8ec('0x1'));var zipdir=require(_0xe8ec('0x2'));var jsonpatch=require(_0xe8ec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe8ec('0x4'));var Mustache=require(_0xe8ec('0x5'));var util=require(_0xe8ec('0x6'));var path=require(_0xe8ec('0x7'));var sox=require(_0xe8ec('0x8'));var csv=require('to-csv');var ejs=require(_0xe8ec('0x9'));var fs=require('fs');var fs_extra=require(_0xe8ec('0xa'));var _=require(_0xe8ec('0xb'));var squel=require(_0xe8ec('0xc'));var crypto=require(_0xe8ec('0xd'));var jsforce=require(_0xe8ec('0xe'));var deskjs=require(_0xe8ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe8ec('0x10'));var Papa=require('papaparse');var Redis=require(_0xe8ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe8ec('0x12'));var as=require(_0xe8ec('0x13'));var hardwareService=require(_0xe8ec('0x14'));var logger=require(_0xe8ec('0x15'))(_0xe8ec('0x16'));var utils=require(_0xe8ec('0x17'));var config=require(_0xe8ec('0x18'));var licenseUtil=require(_0xe8ec('0x19'));var db=require(_0xe8ec('0x1a'))['db'];function respondWithStatusCode(_0x69a424,_0xf72aa7){_0xf72aa7=_0xf72aa7||0xcc;return function(_0x153203){if(_0x153203){return _0x69a424[_0xe8ec('0x1b')](_0xf72aa7);}return _0x69a424['status'](_0xf72aa7)[_0xe8ec('0x1c')]();};}function respondWithResult(_0x431723,_0x2e5a88){_0x2e5a88=_0x2e5a88||0xc8;return function(_0x167ebb){if(_0x167ebb){return _0x431723[_0xe8ec('0x1d')](_0x2e5a88)[_0xe8ec('0x1e')](_0x167ebb);}};}function respondWithFilteredResult(_0x1e76ac,_0x218a4b){return function(_0x531f69){if(_0x531f69){var _0x2e7c82=typeof _0x218a4b[_0xe8ec('0x1f')]===_0xe8ec('0x20')&&typeof _0x218a4b['limit']===_0xe8ec('0x20');var _0x20e847=_0x531f69[_0xe8ec('0x21')];var _0x34a582=_0x2e7c82?0x0:_0x218a4b[_0xe8ec('0x1f')];var _0x39e557=_0x2e7c82?_0x531f69[_0xe8ec('0x21')]:_0x218a4b[_0xe8ec('0x1f')]+_0x218a4b['limit'];var _0x11dbe0;if(_0x39e557>=_0x20e847){_0x39e557=_0x20e847;_0x11dbe0=0xc8;}else{_0x11dbe0=0xce;}_0x1e76ac[_0xe8ec('0x1d')](_0x11dbe0);return _0x1e76ac[_0xe8ec('0x22')](_0xe8ec('0x23'),_0x34a582+'-'+_0x39e557+'/'+_0x20e847)[_0xe8ec('0x1e')](_0x531f69);}return null;};}function patchUpdates(_0x3d6fbc){return function(_0xd5ccf5){try{jsonpatch[_0xe8ec('0x24')](_0xd5ccf5,_0x3d6fbc,!![]);}catch(_0x3a5d14){return BPromise['reject'](_0x3a5d14);}return _0xd5ccf5[_0xe8ec('0x25')]();};}function saveUpdates(_0x3fa53f,_0x3de125){return function(_0x31a97d){if(_0x31a97d){return _0x31a97d[_0xe8ec('0x26')](_0x3fa53f)['then'](function(_0x2e05d8){return _0x2e05d8;});}return null;};}function removeEntity(_0x78b6f4,_0x431af0){return function(_0x24260b){if(_0x24260b){return _0x24260b[_0xe8ec('0x27')]()[_0xe8ec('0x28')](function(){_0x78b6f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x457607,_0x1899d9){return function(_0x35af9b){if(!_0x35af9b){_0x457607[_0xe8ec('0x1b')](0x194);}return _0x35af9b;};}function handleError(_0xbec801,_0x3519a5){_0x3519a5=_0x3519a5||0x1f4;return function(_0x267356){logger[_0xe8ec('0x29')](_0x267356[_0xe8ec('0x2a')]);if(_0x267356[_0xe8ec('0x2b')]){delete _0x267356[_0xe8ec('0x2b')];}_0xbec801[_0xe8ec('0x1d')](_0x3519a5)[_0xe8ec('0x2c')](_0x267356);};}exports[_0xe8ec('0x2d')]=function(_0x1140d6,_0x5d6888){var _0x21badd={'raw':!![],'where':{'id':_0x1140d6[_0xe8ec('0x2e')]['id']}},_0x243904={};_0x243904['model']=_[_0xe8ec('0x2f')](db['ChatProactiveAction'][_0xe8ec('0x30')]);_0x243904[_0xe8ec('0x31')]=_[_0xe8ec('0x2f')](_0x1140d6[_0xe8ec('0x31')]);_0x243904[_0xe8ec('0x32')]=_['intersection'](_0x243904[_0xe8ec('0x33')],_0x243904[_0xe8ec('0x31')]);_0x21badd[_0xe8ec('0x34')]=_['intersection'](_0x243904[_0xe8ec('0x33')],qs['fields'](_0x1140d6[_0xe8ec('0x31')][_0xe8ec('0x35')]));_0x21badd[_0xe8ec('0x34')]=_0x21badd[_0xe8ec('0x34')][_0xe8ec('0x36')]?_0x21badd[_0xe8ec('0x34')]:_0x243904[_0xe8ec('0x33')];if(_0x1140d6[_0xe8ec('0x31')][_0xe8ec('0x37')]){_0x21badd['include']=[{'all':!![]}];}_0x21badd=_[_0xe8ec('0x38')]({},_0x21badd,_0x1140d6[_0xe8ec('0x39')]);return db[_0xe8ec('0x3a')]['find'](_0x21badd)[_0xe8ec('0x28')](handleEntityNotFound(_0x5d6888,null))[_0xe8ec('0x28')](respondWithResult(_0x5d6888,null))['catch'](handleError(_0x5d6888,null));};exports[_0xe8ec('0x3b')]=function(_0x5b638d,_0x1bd67e){return db[_0xe8ec('0x3a')]['create'](_0x5b638d[_0xe8ec('0x3c')],{})[_0xe8ec('0x28')](respondWithResult(_0x1bd67e,0xc9))[_0xe8ec('0x3d')](handleError(_0x1bd67e,null));};exports[_0xe8ec('0x26')]=function(_0x58eed6,_0x295cdb){if(_0x58eed6[_0xe8ec('0x3c')]['id']){delete _0x58eed6[_0xe8ec('0x3c')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x58eed6[_0xe8ec('0x2e')]['id']}})[_0xe8ec('0x28')](handleEntityNotFound(_0x295cdb,null))[_0xe8ec('0x28')](saveUpdates(_0x58eed6[_0xe8ec('0x3c')],null))[_0xe8ec('0x28')](respondWithResult(_0x295cdb,null))[_0xe8ec('0x3d')](handleError(_0x295cdb,null));};exports[_0xe8ec('0x27')]=function(_0x47d68b,_0x3ab84e){return db['ChatProactiveAction'][_0xe8ec('0x3e')]({'where':{'id':_0x47d68b[_0xe8ec('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3ab84e,null))['then'](removeEntity(_0x3ab84e,null))[_0xe8ec('0x3d')](handleError(_0x3ab84e,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index aee8f9f..1982fc4 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 _0xef34=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xef34,0x1d9));var _0x4ef3=function(_0xe094eb,_0x2d5eb5){_0xe094eb=_0xe094eb-0x0;var _0x6ef104=_0xef34[_0xe094eb];return _0x6ef104;};'use strict';var _=require(_0x4ef3('0x0'));var util=require(_0x4ef3('0x1'));var logger=require('../../config/logger')(_0x4ef3('0x2'));var moment=require(_0x4ef3('0x3'));var BPromise=require(_0x4ef3('0x4'));var rp=require(_0x4ef3('0x5'));var fs=require('fs');var path=require(_0x4ef3('0x6'));var rimraf=require(_0x4ef3('0x7'));var config=require(_0x4ef3('0x8'));var attributes=require(_0x4ef3('0x9'));module[_0x4ef3('0xa')]=function(_0xbafacd,_0x45ea46){return _0xbafacd[_0x4ef3('0xb')](_0x4ef3('0xc'),attributes,{'tableName':_0x4ef3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe8a=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x48b3c2,_0x315d23){var _0x1eb47b=function(_0x14de0d){while(--_0x14de0d){_0x48b3c2['push'](_0x48b3c2['shift']());}};_0x1eb47b(++_0x315d23);}(_0xfe8a,0x1ba));var _0xafe8=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xfe8a[_0x532112];return _0x23e5fb;};'use strict';var _=require(_0xafe8('0x0'));var util=require(_0xafe8('0x1'));var logger=require(_0xafe8('0x2'))(_0xafe8('0x3'));var moment=require(_0xafe8('0x4'));var BPromise=require(_0xafe8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafe8('0x6'));var rimraf=require('rimraf');var config=require(_0xafe8('0x7'));var attributes=require(_0xafe8('0x8'));module[_0xafe8('0x9')]=function(_0x5925a0,_0x1fd06c){return _0x5925a0[_0xafe8('0xa')](_0xafe8('0xb'),attributes,{'tableName':_0xafe8('0xc'),'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 9046916..c322c12 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 _0xb3cd=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x261d26,_0x21e1d7){var _0xfb6428=function(_0x213148){while(--_0x213148){_0x261d26['push'](_0x261d26['shift']());}};_0xfb6428(++_0x21e1d7);}(_0xb3cd,0xd0));var _0xdb3c=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xb3cd[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0xdb3c('0x0'));var util=require(_0xdb3c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdb3c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb3c('0x3'))['db'];var utils=require(_0xdb3c('0x4'));var logger=require(_0xdb3c('0x5'))(_0xdb3c('0x6'));var config=require(_0xdb3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdb3c('0x8')][_0xdb3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33aab2,_0x3a1280,_0x255c5c){return new BPromise(function(_0xae035a,_0x5a8092){return client[_0xdb3c('0xa')](_0x33aab2,_0x255c5c)[_0xdb3c('0xb')](function(_0x1e132c){logger['info'](_0xdb3c('0xc'),_0x3a1280,_0xdb3c('0xd'));logger[_0xdb3c('0xe')](_0xdb3c('0xf'),_0x3a1280,_0xdb3c('0xd'),JSON['stringify'](_0x1e132c));if(_0x1e132c[_0xdb3c('0x10')]){if(_0x1e132c[_0xdb3c('0x10')][_0xdb3c('0x11')]===0x1f4){logger[_0xdb3c('0x10')](_0xdb3c('0xc'),_0x3a1280,_0x1e132c['error'][_0xdb3c('0x12')]);return _0x5a8092(_0x1e132c[_0xdb3c('0x10')][_0xdb3c('0x12')]);}logger[_0xdb3c('0x10')](_0xdb3c('0xc'),_0x3a1280,_0x1e132c[_0xdb3c('0x10')][_0xdb3c('0x12')]);return _0xae035a(_0x1e132c['error'][_0xdb3c('0x12')]);}else{logger[_0xdb3c('0x13')](_0xdb3c('0xc'),_0x3a1280,'request\x20sent');_0xae035a(_0x1e132c['result'][_0xdb3c('0x12')]);}})['catch'](function(_0x1565e9){logger[_0xdb3c('0x10')](_0xdb3c('0xc'),_0x3a1280,_0x1565e9);_0x5a8092(_0x1565e9);});});} \ No newline at end of file +var _0xf8ef=['jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x41fc10,_0x39c601){var _0x2bf057=function(_0x425181){while(--_0x425181){_0x41fc10['push'](_0x41fc10['shift']());}};_0x2bf057(++_0x39c601);}(_0xf8ef,0x1da));var _0xff8e=function(_0x4595c7,_0x1dfd25){_0x4595c7=_0x4595c7-0x0;var _0x506697=_0xf8ef[_0x4595c7];return _0x506697;};'use strict';var _=require(_0xff8e('0x0'));var util=require(_0xff8e('0x1'));var moment=require(_0xff8e('0x2'));var BPromise=require('bluebird');var rs=require(_0xff8e('0x3'));var fs=require('fs');var Redis=require(_0xff8e('0x4'));var db=require(_0xff8e('0x5'))['db'];var utils=require(_0xff8e('0x6'));var logger=require(_0xff8e('0x7'))(_0xff8e('0x8'));var config=require('../../config/environment');var jayson=require(_0xff8e('0x9'));var client=jayson[_0xff8e('0xa')][_0xff8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53aa18,_0xf2df7c,_0x42cfd7){return new BPromise(function(_0x35bf43,_0x4c698f){return client['request'](_0x53aa18,_0x42cfd7)['then'](function(_0x4005de){logger[_0xff8e('0xc')](_0xff8e('0xd'),_0xf2df7c,_0xff8e('0xe'));logger['debug'](_0xff8e('0xf'),_0xf2df7c,_0xff8e('0xe'),JSON['stringify'](_0x4005de));if(_0x4005de['error']){if(_0x4005de[_0xff8e('0x10')][_0xff8e('0x11')]===0x1f4){logger[_0xff8e('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0xf2df7c,_0x4005de[_0xff8e('0x10')][_0xff8e('0x12')]);return _0x4c698f(_0x4005de['error'][_0xff8e('0x12')]);}logger[_0xff8e('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0xf2df7c,_0x4005de[_0xff8e('0x10')][_0xff8e('0x12')]);return _0x35bf43(_0x4005de[_0xff8e('0x10')]['message']);}else{logger[_0xff8e('0xc')](_0xff8e('0xd'),_0xf2df7c,'request\x20sent');_0x35bf43(_0x4005de[_0xff8e('0x13')]['message']);}})[_0xff8e('0x14')](function(_0x1583f3){logger[_0xff8e('0x10')](_0xff8e('0xd'),_0xf2df7c,_0x1583f3);_0x4c698f(_0x1583f3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index e27369c..6b83e58 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x4490e8,_0x3fd1b2){var _0x41af10=function(_0x3c1cf2){while(--_0x3c1cf2){_0x4490e8['push'](_0x4490e8['shift']());}};_0x41af10(++_0x3fd1b2);}(_0xf494,0x1c6));var _0x4f49=function(_0x4b6b39,_0x547f83){_0x4b6b39=_0x4b6b39-0x0;var _0x5145df=_0xf494[_0x4b6b39];return _0x5145df;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file +var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x51b1b2,_0x43ddf1){_0x51b1b2=_0x51b1b2-0x0;var _0x4ec0d7=_0xb4c7[_0x51b1b2];return _0x4ec0d7;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 71f7dad..f993cac 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 _0x5ade=['ENUM','rrmemory','beepall','sequelize','exports','name','STRING','INTEGER'];(function(_0x1ce7d3,_0x75e31b){var _0x1d651a=function(_0x5dd5b6){while(--_0x5dd5b6){_0x1ce7d3['push'](_0x1ce7d3['shift']());}};_0x1d651a(++_0x75e31b);}(_0x5ade,0xf3));var _0xe5ad=function(_0x33913d,_0x102307){_0x33913d=_0x33913d-0x0;var _0x439923=_0x5ade[_0x33913d];return _0x439923;};'use strict';var Sequelize=require(_0xe5ad('0x0'));module[_0xe5ad('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5ad('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe5ad('0x3')]},'timeout':{'type':Sequelize[_0xe5ad('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe5ad('0x5')](_0xe5ad('0x6'),_0xe5ad('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x9669=['rrmemory','beepall','STRING','name','INTEGER','ENUM'];(function(_0x29f413,_0x346f99){var _0x573120=function(_0x599ad1){while(--_0x599ad1){_0x29f413['push'](_0x29f413['shift']());}};_0x573120(++_0x346f99);}(_0x9669,0x122));var _0x9966=function(_0x51d2b5,_0x4a657a){_0x51d2b5=_0x51d2b5-0x0;var _0x58fbe5=_0x9669[_0x51d2b5];return _0x58fbe5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9966('0x0')],'unique':_0x9966('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9966('0x0')]},'timeout':{'type':Sequelize[_0x9966('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9966('0x3')](_0x9966('0x4'),_0x9966('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8e9746e..caa12fa 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 _0x7536=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','ids','online','voicePause','interface','sequelize','addTeams','each','findOrCreate','forEach','emit','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','get','ChatQueues','destroy','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1be5aa,_0x42fefb){var _0x8848c1=function(_0x466706){while(--_0x466706){_0x1be5aa['push'](_0x1be5aa['shift']());}};_0x8848c1(++_0x42fefb);}(_0x7536,0xdf));var _0x6753=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x7536[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6753('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6753('0x1'));var moment=require(_0x6753('0x2'));var BPromise=require(_0x6753('0x3'));var Mustache=require(_0x6753('0x4'));var util=require(_0x6753('0x5'));var path=require(_0x6753('0x6'));var sox=require(_0x6753('0x7'));var csv=require(_0x6753('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6753('0x9'));var _=require(_0x6753('0xa'));var squel=require(_0x6753('0xb'));var crypto=require(_0x6753('0xc'));var jsforce=require(_0x6753('0xd'));var deskjs=require(_0x6753('0xe'));var toCsv=require(_0x6753('0x8'));var querystring=require(_0x6753('0xf'));var Papa=require(_0x6753('0x10'));var Redis=require(_0x6753('0x11'));var authService=require(_0x6753('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6753('0x13'));var hardwareService=require(_0x6753('0x14'));var logger=require(_0x6753('0x15'))('api');var utils=require(_0x6753('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6753('0x17'))['db'];config[_0x6753('0x18')]=_[_0x6753('0x19')](config[_0x6753('0x18')],{'host':_0x6753('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6753('0x1b'))[_0x6753('0x1c')](socket);var jayson=require(_0x6753('0x1d'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2406ab,_0x5d9b82,_0x2eb20a,_0x4e16f7){return new BPromise(function(_0x488737,_0x12f50c){var _0x2830ba=_0x4e16f7||client;return _0x2830ba[_0x6753('0x1e')](_0x2406ab,_0x2eb20a)[_0x6753('0x1f')](function(_0x38cbff){logger[_0x6753('0x20')](_0x6753('0x21'),_0x5d9b82,'request\x20sent');logger[_0x6753('0x22')](_0x6753('0x23'),_0x5d9b82,_0x6753('0x24'),JSON[_0x6753('0x25')](_0x38cbff));if(_0x38cbff[_0x6753('0x26')]){if(_0x38cbff[_0x6753('0x26')][_0x6753('0x27')]===0x1f4){logger[_0x6753('0x26')](_0x6753('0x21'),_0x5d9b82,_0x38cbff['error']['message']);return _0x12f50c(_0x38cbff[_0x6753('0x26')][_0x6753('0x28')]);}logger['error'](_0x6753('0x21'),_0x5d9b82,_0x38cbff['error'][_0x6753('0x28')]);return _0x488737(_0x38cbff[_0x6753('0x26')][_0x6753('0x28')]);}else{logger[_0x6753('0x20')](_0x6753('0x21'),_0x5d9b82,_0x6753('0x24'));_0x488737(_0x38cbff[_0x6753('0x29')]['message']);}})['catch'](function(_0x40be8d){logger[_0x6753('0x26')](_0x6753('0x21'),_0x5d9b82,_0x40be8d);_0x12f50c(_0x40be8d);});});}function respondWithStatusCode(_0x5a0497,_0x401844){_0x401844=_0x401844||0xcc;return function(_0x3b08b7){if(_0x3b08b7){return _0x5a0497[_0x6753('0x2a')](_0x401844);}return _0x5a0497[_0x6753('0x2b')](_0x401844)[_0x6753('0x2c')]();};}function respondWithResult(_0x223dd9,_0x391e18){_0x391e18=_0x391e18||0xc8;return function(_0xd95ea1){if(_0xd95ea1){return _0x223dd9[_0x6753('0x2b')](_0x391e18)[_0x6753('0x2d')](_0xd95ea1);}};}function respondWithFilteredResult(_0x4e1179,_0x410552){return function(_0x4652ca){if(_0x4652ca){var _0x2af936=typeof _0x410552[_0x6753('0x2e')]===_0x6753('0x2f')&&typeof _0x410552['limit']===_0x6753('0x2f');var _0x54fe33=_0x4652ca[_0x6753('0x30')];var _0x1b74d5=_0x2af936?0x0:_0x410552[_0x6753('0x2e')];var _0x5024a4=_0x2af936?_0x4652ca['count']:_0x410552[_0x6753('0x2e')]+_0x410552[_0x6753('0x31')];var _0xc8bbf;if(_0x5024a4>=_0x54fe33){_0x5024a4=_0x54fe33;_0xc8bbf=0xc8;}else{_0xc8bbf=0xce;}_0x4e1179['status'](_0xc8bbf);return _0x4e1179['set'](_0x6753('0x32'),_0x1b74d5+'-'+_0x5024a4+'/'+_0x54fe33)[_0x6753('0x2d')](_0x4652ca);}return null;};}function patchUpdates(_0x28331c){return function(_0xdec56f){try{jsonpatch['apply'](_0xdec56f,_0x28331c,!![]);}catch(_0x44465f){return BPromise['reject'](_0x44465f);}return _0xdec56f[_0x6753('0x33')]();};}function saveUpdates(_0x349a8f,_0x8d8524){return function(_0xb98c4){if(_0xb98c4){return _0xb98c4[_0x6753('0x34')](_0x349a8f)[_0x6753('0x1f')](function(_0xf91db9){return _0xf91db9;});}return null;};}function removeEntity(_0x3b2391,_0x5ee2a7){return function(_0xe10585){if(_0xe10585){return _0xe10585['destroy']()['then'](function(){var _0x1bad76=_0xe10585[_0x6753('0x35')]({'plain':!![]});var _0x57f1d8=_0x6753('0x36');return db['UserProfileResource'][_0x6753('0x37')]({'where':{'type':_0x57f1d8,'resourceId':_0x1bad76['id']}})['then'](function(){return _0xe10585;});})[_0x6753('0x1f')](function(){_0x3b2391[_0x6753('0x2b')](0xcc)[_0x6753('0x2c')]();});}};}function handleEntityNotFound(_0x3e4581,_0x58867a){return function(_0x59840b){if(!_0x59840b){_0x3e4581['sendStatus'](0x194);}return _0x59840b;};}function handleError(_0x2e49b5,_0x268b2b){_0x268b2b=_0x268b2b||0x1f4;return function(_0x198123){logger[_0x6753('0x26')](_0x198123[_0x6753('0x38')]);if(_0x198123[_0x6753('0x39')]){delete _0x198123[_0x6753('0x39')];}_0x2e49b5[_0x6753('0x2b')](_0x268b2b)[_0x6753('0x3a')](_0x198123);};}exports[_0x6753('0x3b')]=function(_0x14d991,_0x20da21){var _0x4ccc84={},_0x1357a8={},_0x1d766b={'count':0x0,'rows':[]};var _0x23f7ca=_['map'](db[_0x6753('0x3c')][_0x6753('0x3d')],function(_0x438fe3){return{'name':_0x438fe3[_0x6753('0x3e')],'type':_0x438fe3[_0x6753('0x3f')][_0x6753('0x40')]};});_0x1357a8[_0x6753('0x41')]=_['map'](_0x23f7ca,_0x6753('0x39'));_0x1357a8[_0x6753('0x42')]=_['keys'](_0x14d991[_0x6753('0x42')]);_0x1357a8['filters']=_[_0x6753('0x43')](_0x1357a8[_0x6753('0x41')],_0x1357a8[_0x6753('0x42')]);_0x4ccc84[_0x6753('0x44')]=_[_0x6753('0x43')](_0x1357a8[_0x6753('0x41')],qs[_0x6753('0x45')](_0x14d991[_0x6753('0x42')]['fields']));_0x4ccc84[_0x6753('0x44')]=_0x4ccc84[_0x6753('0x44')][_0x6753('0x46')]?_0x4ccc84[_0x6753('0x44')]:_0x1357a8['model'];if(!_0x14d991['query'][_0x6753('0x47')](_0x6753('0x48'))){_0x4ccc84[_0x6753('0x31')]=qs['limit'](_0x14d991[_0x6753('0x42')][_0x6753('0x31')]);_0x4ccc84['offset']=qs[_0x6753('0x2e')](_0x14d991[_0x6753('0x42')]['offset']);}_0x4ccc84[_0x6753('0x49')]=qs['sort'](_0x14d991[_0x6753('0x42')][_0x6753('0x4a')]);_0x4ccc84[_0x6753('0x4b')]=qs[_0x6753('0x4c')](_['pick'](_0x14d991[_0x6753('0x42')],_0x1357a8['filters']),_0x23f7ca);if(_0x14d991[_0x6753('0x42')][_0x6753('0x4d')]){_0x4ccc84[_0x6753('0x4b')]=_[_0x6753('0x4e')](_0x4ccc84[_0x6753('0x4b')],{'$or':_[_0x6753('0x4f')](_0x23f7ca,function(_0x4c1cd8){if(_0x4c1cd8[_0x6753('0x3f')]!==_0x6753('0x50')){var _0x39927b={};_0x39927b[_0x4c1cd8[_0x6753('0x39')]]={'$like':'%'+_0x14d991[_0x6753('0x42')]['filter']+'%'};return _0x39927b;}})});}_0x4ccc84=_['merge']({},_0x4ccc84,_0x14d991[_0x6753('0x51')]);var _0x463e87={'where':_0x4ccc84[_0x6753('0x4b')]};return db[_0x6753('0x3c')][_0x6753('0x30')](_0x463e87)['then'](function(_0x354873){_0x1d766b[_0x6753('0x30')]=_0x354873;if(_0x14d991['query'][_0x6753('0x52')]){_0x4ccc84['include']=[{'all':!![]}];}return db[_0x6753('0x3c')]['findAll'](_0x4ccc84);})[_0x6753('0x1f')](function(_0x1feaab){_0x1d766b[_0x6753('0x53')]=_0x1feaab;return _0x1d766b;})['then'](respondWithFilteredResult(_0x20da21,_0x4ccc84))[_0x6753('0x54')](handleError(_0x20da21,null));};exports['show']=function(_0x41a117,_0x31e641){var _0x544026={'raw':!![],'where':{'id':_0x41a117[_0x6753('0x55')]['id']}},_0x4d1ad7={};_0x4d1ad7[_0x6753('0x41')]=_[_0x6753('0x56')](db[_0x6753('0x3c')]['rawAttributes']);_0x4d1ad7['query']=_[_0x6753('0x56')](_0x41a117['query']);_0x4d1ad7[_0x6753('0x4c')]=_[_0x6753('0x43')](_0x4d1ad7[_0x6753('0x41')],_0x4d1ad7['query']);_0x544026[_0x6753('0x44')]=_['intersection'](_0x4d1ad7['model'],qs['fields'](_0x41a117[_0x6753('0x42')][_0x6753('0x45')]));_0x544026['attributes']=_0x544026['attributes'][_0x6753('0x46')]?_0x544026[_0x6753('0x44')]:_0x4d1ad7[_0x6753('0x41')];if(_0x41a117[_0x6753('0x42')][_0x6753('0x52')]){_0x544026[_0x6753('0x57')]=[{'all':!![]}];}_0x544026=_['merge']({},_0x544026,_0x41a117[_0x6753('0x51')]);return db[_0x6753('0x3c')][_0x6753('0x58')](_0x544026)[_0x6753('0x1f')](handleEntityNotFound(_0x31e641,null))[_0x6753('0x1f')](respondWithResult(_0x31e641,null))['catch'](handleError(_0x31e641,null));};exports[_0x6753('0x59')]=function(_0x86b448,_0x17a82b){return db[_0x6753('0x3c')]['create'](_0x86b448[_0x6753('0x5a')],{})['then'](function(_0x5e2345){var _0x3b2f35=_0x86b448[_0x6753('0x5b')][_0x6753('0x35')]({'plain':!![]});if(!_0x3b2f35)throw new Error(_0x6753('0x5c'));if(_0x3b2f35[_0x6753('0x5d')]===_0x6753('0x5b')){var _0x3d0314=_0x5e2345[_0x6753('0x35')]({'plain':!![]});var _0x3c9291=_0x6753('0x36');return db[_0x6753('0x5e')][_0x6753('0x58')]({'where':{'name':_0x3c9291,'userProfileId':_0x3b2f35['userProfileId']},'raw':!![]})['then'](function(_0x2b350a){if(_0x2b350a&&_0x2b350a[_0x6753('0x5f')]===0x0){return db[_0x6753('0x60')][_0x6753('0x59')]({'name':_0x3d0314[_0x6753('0x39')],'resourceId':_0x3d0314['id'],'type':_0x2b350a[_0x6753('0x39')],'sectionId':_0x2b350a['id']},{})[_0x6753('0x1f')](function(){return _0x5e2345;});}else{return _0x5e2345;}})['catch'](function(_0x36dce6){logger[_0x6753('0x26')](_0x6753('0x61'),_0x36dce6);throw _0x36dce6;});}return _0x5e2345;})[_0x6753('0x1f')](respondWithResult(_0x17a82b,0xc9))[_0x6753('0x54')](handleError(_0x17a82b,null));};exports[_0x6753('0x34')]=function(_0xa090bf,_0x3f127a){if(_0xa090bf['body']['id']){delete _0xa090bf[_0x6753('0x5a')]['id'];}return db['ChatQueue'][_0x6753('0x58')]({'where':{'id':_0xa090bf['params']['id']}})['then'](handleEntityNotFound(_0x3f127a,null))[_0x6753('0x1f')](saveUpdates(_0xa090bf[_0x6753('0x5a')],null))[_0x6753('0x1f')](respondWithResult(_0x3f127a,null))[_0x6753('0x54')](handleError(_0x3f127a,null));};exports['destroy']=function(_0x2a7e14,_0x17dfba){return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x2a7e14[_0x6753('0x55')]['id']}})['then'](handleEntityNotFound(_0x17dfba,null))[_0x6753('0x1f')](removeEntity(_0x17dfba,null))[_0x6753('0x54')](handleError(_0x17dfba,null));};exports['describe']=function(_0x35de06,_0x2d3267){return db[_0x6753('0x3c')][_0x6753('0x62')]()[_0x6753('0x1f')](respondWithResult(_0x2d3267,null))[_0x6753('0x54')](handleError(_0x2d3267,null));};exports[_0x6753('0x63')]=function(_0x57b8ce,_0x464d7e,_0x1a3f26){var _0x3ad93d={'raw':!![],'where':{}},_0x494b91={},_0x5214a0;return db[_0x6753('0x3c')][_0x6753('0x64')]({'where':{'id':_0x57b8ce[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](handleEntityNotFound(_0x464d7e,null))['then'](function(_0x2d28a8){if(_0x2d28a8){_0x5214a0=_0x2d28a8[_0x6753('0x35')]({'plain':!![]});_0x494b91[_0x6753('0x41')]=_[_0x6753('0x56')](db[_0x6753('0x65')][_0x6753('0x3d')]);_0x494b91['query']=_[_0x6753('0x56')](_0x57b8ce[_0x6753('0x42')]);_0x494b91[_0x6753('0x4c')]=_[_0x6753('0x43')](_0x494b91['model'],_0x494b91[_0x6753('0x42')]);_0x3ad93d[_0x6753('0x44')]=_[_0x6753('0x43')](_0x494b91['model'],qs[_0x6753('0x45')](_0x57b8ce[_0x6753('0x42')][_0x6753('0x45')]));_0x3ad93d[_0x6753('0x44')]=_0x3ad93d[_0x6753('0x44')][_0x6753('0x46')]?_0x3ad93d[_0x6753('0x44')]:_0x494b91[_0x6753('0x41')];if(!_0x57b8ce[_0x6753('0x42')][_0x6753('0x47')]('nolimit')){_0x3ad93d[_0x6753('0x31')]=qs[_0x6753('0x31')](_0x57b8ce[_0x6753('0x42')][_0x6753('0x31')]);_0x3ad93d['offset']=qs[_0x6753('0x2e')](_0x57b8ce[_0x6753('0x42')][_0x6753('0x2e')]);}_0x3ad93d[_0x6753('0x49')]=qs['sort'](_0x57b8ce['query'][_0x6753('0x4a')]);_0x3ad93d[_0x6753('0x4b')]=qs['filters'](_[_0x6753('0x66')](_0x57b8ce['query'],_0x494b91[_0x6753('0x4c')]));_0x3ad93d[_0x6753('0x4b')][_0x6753('0x67')]=_0x2d28a8['id'];if(_0x57b8ce[_0x6753('0x42')][_0x6753('0x4d')]){_0x3ad93d[_0x6753('0x4b')]=_[_0x6753('0x4e')](_0x3ad93d[_0x6753('0x4b')],{'$or':_[_0x6753('0x4f')](_0x3ad93d[_0x6753('0x44')],function(_0x505461){var _0x52180c={};_0x52180c[_0x505461]={'$like':'%'+_0x57b8ce[_0x6753('0x42')]['filter']+'%'};return _0x52180c;})});}_0x3ad93d=_['merge']({},_0x3ad93d,_0x57b8ce[_0x6753('0x51')]);return db['UserChatQueue'][_0x6753('0x68')](_0x3ad93d);}})[_0x6753('0x1f')](function(_0x557a8f){if(_0x557a8f){return db[_0x6753('0x69')][_0x6753('0x6a')]({'where':{'id':_[_0x6753('0x4f')](_0x557a8f,_0x6753('0x6b')),'role':_0x6753('0x6c')},'attributes':['id',_0x6753('0x39'),_0x6753('0x6d'),_0x6753('0x6e'),'createdAt']});}})[_0x6753('0x1f')](function(_0x423b60){if(_0x423b60){return{'count':_0x423b60[_0x6753('0x30')],'rows':_[_0x6753('0x4f')](_0x423b60[_0x6753('0x53')],function(_0x1246f8){return{'membername':_0x1246f8['name'],'UserId':_0x1246f8['id'],'queue_name':_0x5214a0[_0x6753('0x39')],'ChatQueueId':_0x5214a0['id'],'interface':util[_0x6753('0x6f')](_0x6753('0x70'),_0x6753('0x71'),_0x1246f8[_0x6753('0x39')]),'penalty':0x0,'paused':_0x1246f8['chatPause'],'createdAt':_0x1246f8[_0x6753('0x72')],'updatedAt':_0x1246f8[_0x6753('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6753('0x1f')](respondWithFilteredResult(_0x464d7e,_0x3ad93d))['catch'](handleError(_0x464d7e,null));};exports[_0x6753('0x73')]=function(_0x38e38e,_0x51a46a,_0x1d56fa){var _0x1abf44={};var _0xbf35ce={};var _0x1f7582;var _0x2442ea;return db[_0x6753('0x3c')][_0x6753('0x64')]({'where':{'id':_0x38e38e[_0x6753('0x55')]['id']}})['then'](handleEntityNotFound(_0x51a46a,null))[_0x6753('0x1f')](function(_0x51395b){if(_0x51395b){_0x1f7582=_0x51395b;_0xbf35ce[_0x6753('0x41')]=_[_0x6753('0x56')](db[_0x6753('0x74')][_0x6753('0x3d')]);_0xbf35ce[_0x6753('0x42')]=_[_0x6753('0x56')](_0x38e38e[_0x6753('0x42')]);_0xbf35ce[_0x6753('0x4c')]=_['intersection'](_0xbf35ce['model'],_0xbf35ce[_0x6753('0x42')]);_0x1abf44['attributes']=_[_0x6753('0x43')](_0xbf35ce[_0x6753('0x41')],qs[_0x6753('0x45')](_0x38e38e[_0x6753('0x42')][_0x6753('0x45')]));_0x1abf44[_0x6753('0x44')]=_0x1abf44[_0x6753('0x44')][_0x6753('0x46')]?_0x1abf44[_0x6753('0x44')]:_0xbf35ce[_0x6753('0x41')];_0x1abf44[_0x6753('0x49')]=qs[_0x6753('0x4a')](_0x38e38e[_0x6753('0x42')][_0x6753('0x4a')]);_0x1abf44[_0x6753('0x4b')]=qs[_0x6753('0x4c')](_['pick'](_0x38e38e[_0x6753('0x42')],_0xbf35ce[_0x6753('0x4c')]));if(_0x38e38e[_0x6753('0x42')][_0x6753('0x4d')]){_0x1abf44[_0x6753('0x4b')]=_[_0x6753('0x4e')](_0x1abf44[_0x6753('0x4b')],{'$or':_[_0x6753('0x4f')](_0x1abf44['attributes'],function(_0x55abfd){var _0xcf6266={};_0xcf6266[_0x55abfd]={'$like':'%'+_0x38e38e[_0x6753('0x42')][_0x6753('0x4d')]+'%'};return _0xcf6266;})});}_0x1abf44=_['merge']({},_0x1abf44,_0x38e38e['options']);return _0x1f7582['getTeams'](_0x1abf44);}})['then'](function(_0xdb2ca0){if(_0xdb2ca0){_0x2442ea=_0xdb2ca0[_0x6753('0x46')];if(!_0x38e38e[_0x6753('0x42')][_0x6753('0x47')](_0x6753('0x48'))){_0x1abf44[_0x6753('0x31')]=qs['limit'](_0x38e38e['query'][_0x6753('0x31')]);_0x1abf44['offset']=qs['offset'](_0x38e38e['query'][_0x6753('0x2e')]);}return _0x1f7582[_0x6753('0x73')](_0x1abf44);}})['then'](function(_0xaed4f3){if(_0xaed4f3){return _0xaed4f3?{'count':_0x2442ea,'rows':_0xaed4f3}:null;}})[_0x6753('0x1f')](respondWithResult(_0x51a46a,null))[_0x6753('0x54')](handleError(_0x51a46a,null));};exports['addTeams']=function(_0x3f9491,_0x88e0f7,_0x35c042){var _0x2e67dc=_0x3f9491[_0x6753('0x5a')][_0x6753('0x75')];return db['Team'][_0x6753('0x68')]({'where':{'id':_0x2e67dc},'attributes':['id'],'include':[{'model':db[_0x6753('0x69')],'as':'Agents','attributes':['id',_0x6753('0x39'),_0x6753('0x76'),_0x6753('0x77'),_0x6753('0x78')],'raw':!![]}]})[_0x6753('0x1f')](function(_0x1731a7){if(_0x1731a7){var _0x5d2bc6=_['flatMap'](_0x1731a7,function(_0x13d777){var _0x452451=_0x13d777[_0x6753('0x35')]({'plain':!![]});return _0x452451['Agents'];});return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x3f9491[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](function(_0x5a5581){return db[_0x6753('0x79')]['transaction'](function(_0x30980e){return _0x5a5581[_0x6753('0x7a')](_0x2e67dc,{'transaction':_0x30980e})[_0x6753('0x1f')](function(){return BPromise[_0x6753('0x7b')](_0x5d2bc6,function(_0x20e422){return db[_0x6753('0x65')][_0x6753('0x7c')]({'where':{'UserId':_0x20e422['id'],'ChatQueueId':_0x3f9491[_0x6753('0x55')]['id']},'transaction':_0x30980e});});})[_0x6753('0x1f')](function(){_0x5d2bc6[_0x6753('0x7d')](function(_0xa89099){socket[_0x6753('0x7e')]('userChatQueue:save',{'UserId':_0xa89099['id'],'ChatQueueId':_0x5a5581['id']});});});});});}})[_0x6753('0x1f')](respondWithStatusCode(_0x88e0f7,null))[_0x6753('0x54')](handleError(_0x88e0f7,null));};exports['removeTeams']=function(_0x4ddf1c,_0x588623,_0x191a66){return db[_0x6753('0x74')]['findAll']({'where':{'id':_0x4ddf1c[_0x6753('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6753('0x69')],'as':_0x6753('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x6753('0x1f')](handleEntityNotFound(_0x588623,null))['then'](function(_0x3cbc7b){var _0x3c421d=_[_0x6753('0x4f')](_0x3cbc7b,'id');var _0x45c0d3=[];var _0x1e45a0=[];var _0x10a96c=squel[_0x6753('0x80')]();_0x10a96c[_0x6753('0x81')](_0x6753('0x82'))[_0x6753('0x83')](_0x6753('0x84'),'tq')[_0x6753('0x85')](_0x6753('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6753('0x4b')](_0x6753('0x87'),_0x4ddf1c[_0x6753('0x55')]['id']);for(var _0x45c762=0x0;_0x45c762<_0x3cbc7b[_0x6753('0x46')];_0x45c762+=0x1){let _0xf1cfac=_0x3cbc7b[_0x45c762];for(var _0x2e9f1f=0x0;_0x2e9f1f<_0xf1cfac[_0x6753('0x7f')][_0x6753('0x46')];_0x2e9f1f+=0x1){let _0x57b55a=_0xf1cfac[_0x6753('0x7f')][_0x2e9f1f];var _0x1c9ce5=_0x10a96c[_0x6753('0x88')]();_0x1c9ce5[_0x6753('0x4b')](_0x6753('0x89'),_0x57b55a['id']);_0x1e45a0['push'](db['sequelize'][_0x6753('0x42')](_0x1c9ce5[_0x6753('0x8a')](),{'type':db['sequelize'][_0x6753('0x8b')][_0x6753('0x8c')]})[_0x6753('0x1f')](function(_0x59d9c4){if(_0x59d9c4['length']===0x1){return _0x57b55a['id'];}else{var _0x135e33=_[_0x6753('0x8d')](_[_0x6753('0x4f')](_0x59d9c4,_0x6753('0x8e')),function(_0x6e7cd9){return _[_0x6753('0x8f')](_0x3c421d,_0x6e7cd9);});if(_0x135e33){return _0x57b55a['id'];}}}));}}return BPromise[_0x6753('0x90')](_0x1e45a0)['then'](function(_0x3f8d7f){_0x45c0d3=_(_0x45c0d3)[_0x6753('0x91')](_0x3f8d7f)[_0x6753('0x92')]()[_0x6753('0x93')]();return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x4ddf1c[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](function(_0x4f2a89){return db['sequelize'][_0x6753('0x94')](function(_0x23fc26){return _0x4f2a89[_0x6753('0x95')](_0x4ddf1c['query'][_0x6753('0x75')],{'transaction':_0x23fc26})['then'](function(){if(!_[_0x6753('0x96')](_0x45c0d3)){return _0x4f2a89['removeAgents'](_0x45c0d3,{'transaction':_0x23fc26});}})[_0x6753('0x1f')](function(){_0x45c0d3['forEach'](function(_0x2395a6){socket['emit'](_0x6753('0x97'),{'UserId':_0x2395a6,'ChatQueueId':_0x4f2a89['id']});});});});});});})[_0x6753('0x1f')](respondWithStatusCode(_0x588623,null))['catch'](handleError(_0x588623,null));};exports[_0x6753('0x98')]=function(_0x343b3b,_0x34527b,_0xa38831){return db[_0x6753('0x3c')][_0x6753('0x58')]({'where':{'id':_0x343b3b[_0x6753('0x55')]['id']}})[_0x6753('0x1f')](handleEntityNotFound(_0x34527b,null))[_0x6753('0x1f')](function(_0x2915f9){if(_0x2915f9){return _0x2915f9[_0x6753('0x98')](_0x343b3b[_0x6753('0x5a')][_0x6753('0x75')],_[_0x6753('0x99')](_0x343b3b[_0x6753('0x5a')],[_0x6753('0x75'),'id'])||{})[_0x6753('0x9a')](function(_0x278f05){for(var _0xd8260d=0x0;_0xd8260d<_0x343b3b['body']['ids'][_0x6753('0x46')];_0xd8260d+=0x1){socket[_0x6753('0x7e')](_0x6753('0x9b'),{'UserId':Number(_0x343b3b[_0x6753('0x5a')]['ids'][_0xd8260d]),'ChatQueueId':Number(_0x343b3b[_0x6753('0x55')]['id'])});}return _0x278f05;});}})[_0x6753('0x1f')](respondWithResult(_0x34527b,null))[_0x6753('0x54')](handleError(_0x34527b,null));};exports[_0x6753('0x9c')]=function(_0x25392d,_0x3776c5,_0x342b8d){return db['ChatQueue'][_0x6753('0x58')]({'where':{'id':_0x25392d['params']['id']}})['then'](handleEntityNotFound(_0x3776c5,null))[_0x6753('0x1f')](function(_0x4b217b){if(_0x4b217b){return _0x4b217b[_0x6753('0x9c')](_0x25392d[_0x6753('0x42')][_0x6753('0x75')])[_0x6753('0x1f')](function(){if(_[_0x6753('0x9d')](_0x25392d[_0x6753('0x42')][_0x6753('0x75')])){for(var _0xe070c9=0x0;_0xe070c9<_0x25392d[_0x6753('0x42')]['ids'][_0x6753('0x46')];_0xe070c9+=0x1){socket[_0x6753('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x25392d[_0x6753('0x42')][_0x6753('0x75')][_0xe070c9]),'ChatQueueId':Number(_0x25392d[_0x6753('0x55')]['id'])});}}else{socket[_0x6753('0x7e')](_0x6753('0x97'),{'UserId':Number(_0x25392d[_0x6753('0x42')]['ids']),'ChatQueueId':Number(_0x25392d[_0x6753('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x3776c5,null))[_0x6753('0x54')](handleError(_0x3776c5,null));};exports[_0x6753('0x9e')]=function(_0x5a4caa,_0x59c936,_0x175693){var _0x190cb8={};var _0x39f5cb={};var _0x136ae2;var _0x2b00f5;return db['ChatQueue'][_0x6753('0x64')]({'where':{'id':_0x5a4caa['params']['id']}})[_0x6753('0x1f')](handleEntityNotFound(_0x59c936,null))[_0x6753('0x1f')](function(_0x4f806f){if(_0x4f806f){_0x136ae2=_0x4f806f;_0x39f5cb[_0x6753('0x41')]=_['keys'](db[_0x6753('0x69')][_0x6753('0x3d')]);_0x39f5cb[_0x6753('0x42')]=_[_0x6753('0x56')](_0x5a4caa[_0x6753('0x42')]);_0x39f5cb[_0x6753('0x4c')]=_[_0x6753('0x43')](_0x39f5cb[_0x6753('0x41')],_0x39f5cb[_0x6753('0x42')]);_0x190cb8[_0x6753('0x44')]=_[_0x6753('0x43')](_0x39f5cb[_0x6753('0x41')],qs['fields'](_0x5a4caa['query'][_0x6753('0x45')]));_0x190cb8[_0x6753('0x44')]=_0x190cb8['attributes'][_0x6753('0x46')]?_0x190cb8[_0x6753('0x44')]:_0x39f5cb[_0x6753('0x41')];_0x190cb8[_0x6753('0x49')]=qs[_0x6753('0x4a')](_0x5a4caa[_0x6753('0x42')]['sort']);_0x190cb8[_0x6753('0x4b')]=qs[_0x6753('0x4c')](_[_0x6753('0x66')](_0x5a4caa['query'],_0x39f5cb[_0x6753('0x4c')]));if(_0x5a4caa[_0x6753('0x42')][_0x6753('0x4d')]){_0x190cb8[_0x6753('0x4b')]=_['merge'](_0x190cb8[_0x6753('0x4b')],{'$or':_['map'](_0x190cb8[_0x6753('0x44')],function(_0xed2e5b){var _0x23b015={};_0x23b015[_0xed2e5b]={'$like':'%'+_0x5a4caa[_0x6753('0x42')][_0x6753('0x4d')]+'%'};return _0x23b015;})});}_0x190cb8=_[_0x6753('0x4e')]({},_0x190cb8,_0x5a4caa['options']);return _0x136ae2[_0x6753('0x9e')](_0x190cb8);}})[_0x6753('0x1f')](function(_0x59b939){if(_0x59b939){_0x2b00f5=_0x59b939[_0x6753('0x46')];if(!_0x5a4caa[_0x6753('0x42')][_0x6753('0x47')](_0x6753('0x48'))){_0x190cb8[_0x6753('0x31')]=qs[_0x6753('0x31')](_0x5a4caa['query'][_0x6753('0x31')]);_0x190cb8[_0x6753('0x2e')]=qs[_0x6753('0x2e')](_0x5a4caa[_0x6753('0x42')][_0x6753('0x2e')]);}return _0x136ae2['getAgents'](_0x190cb8);}})[_0x6753('0x1f')](function(_0x15358e){if(_0x15358e){return _0x15358e?{'count':_0x2b00f5,'rows':_0x15358e}:null;}})[_0x6753('0x1f')](respondWithResult(_0x59c936,null))[_0x6753('0x54')](handleError(_0x59c936,null));}; \ No newline at end of file +var _0x3a79=['find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','chatPause','updatedAt','format','SIP','createdAt','Team','order','getTeams','nolimit','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit','userChatQueue:save','select','field','tq.TeamId','from','join','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','limit','count','offset','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','ChatQueue','include','findAll','rows','params','keys','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x14e379,_0x1b298c){var _0x31fbb7=function(_0x46c609){while(--_0x46c609){_0x14e379['push'](_0x14e379['shift']());}};_0x31fbb7(++_0x1b298c);}(_0x3a79,0x15e));var _0x93a7=function(_0x190990,_0x5dc226){_0x190990=_0x190990-0x0;var _0x227344=_0x3a79[_0x190990];return _0x227344;};'use strict';var emlformat=require(_0x93a7('0x0'));var rimraf=require(_0x93a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93a7('0x2'));var rp=require(_0x93a7('0x3'));var moment=require(_0x93a7('0x4'));var BPromise=require(_0x93a7('0x5'));var Mustache=require('mustache');var util=require(_0x93a7('0x6'));var path=require(_0x93a7('0x7'));var sox=require('sox');var csv=require(_0x93a7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93a7('0x9'));var _=require(_0x93a7('0xa'));var squel=require('squel');var crypto=require(_0x93a7('0xb'));var jsforce=require(_0x93a7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x93a7('0xd'));var Papa=require('papaparse');var Redis=require(_0x93a7('0xe'));var authService=require(_0x93a7('0xf'));var qs=require(_0x93a7('0x10'));var as=require(_0x93a7('0x11'));var hardwareService=require(_0x93a7('0x12'));var logger=require(_0x93a7('0x13'))(_0x93a7('0x14'));var utils=require('../../config/utils');var config=require(_0x93a7('0x15'));var licenseUtil=require(_0x93a7('0x16'));var db=require('../../mysqldb')['db'];config[_0x93a7('0x17')]=_[_0x93a7('0x18')](config[_0x93a7('0x17')],{'host':_0x93a7('0x19'),'port':0x18eb});var socket=require(_0x93a7('0x1a'))(new Redis(config[_0x93a7('0x17')]));require(_0x93a7('0x1b'))[_0x93a7('0x1c')](socket);var jayson=require(_0x93a7('0x1d'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdff32c,_0x53f93b,_0xb357b,_0x3c2a0a){return new BPromise(function(_0x45ed17,_0x41e1e6){var _0x3a7706=_0x3c2a0a||client;return _0x3a7706[_0x93a7('0x1e')](_0xdff32c,_0xb357b)[_0x93a7('0x1f')](function(_0x5418fe){logger[_0x93a7('0x20')](_0x93a7('0x21'),_0x53f93b,_0x93a7('0x22'));logger[_0x93a7('0x23')](_0x93a7('0x24'),_0x53f93b,_0x93a7('0x22'),JSON[_0x93a7('0x25')](_0x5418fe));if(_0x5418fe[_0x93a7('0x26')]){if(_0x5418fe['error'][_0x93a7('0x27')]===0x1f4){logger['error'](_0x93a7('0x21'),_0x53f93b,_0x5418fe['error'][_0x93a7('0x28')]);return _0x41e1e6(_0x5418fe[_0x93a7('0x26')][_0x93a7('0x28')]);}logger[_0x93a7('0x26')]('ChatQueue,\x20%s,\x20%s',_0x53f93b,_0x5418fe[_0x93a7('0x26')][_0x93a7('0x28')]);return _0x45ed17(_0x5418fe[_0x93a7('0x26')]['message']);}else{logger[_0x93a7('0x20')](_0x93a7('0x21'),_0x53f93b,_0x93a7('0x22'));_0x45ed17(_0x5418fe[_0x93a7('0x29')][_0x93a7('0x28')]);}})[_0x93a7('0x2a')](function(_0x4e5882){logger[_0x93a7('0x26')](_0x93a7('0x21'),_0x53f93b,_0x4e5882);_0x41e1e6(_0x4e5882);});});}function respondWithStatusCode(_0x5b4bb0,_0xad7c33){_0xad7c33=_0xad7c33||0xcc;return function(_0x771357){if(_0x771357){return _0x5b4bb0[_0x93a7('0x2b')](_0xad7c33);}return _0x5b4bb0[_0x93a7('0x2c')](_0xad7c33)['end']();};}function respondWithResult(_0x2c1bf5,_0x3dc76c){_0x3dc76c=_0x3dc76c||0xc8;return function(_0x4d050c){if(_0x4d050c){return _0x2c1bf5[_0x93a7('0x2c')](_0x3dc76c)[_0x93a7('0x2d')](_0x4d050c);}};}function respondWithFilteredResult(_0x2852ed,_0x3060c0){return function(_0x500e4c){if(_0x500e4c){var _0x49f9b3=typeof _0x3060c0['offset']==='undefined'&&typeof _0x3060c0[_0x93a7('0x2e')]==='undefined';var _0x202d0d=_0x500e4c[_0x93a7('0x2f')];var _0x18f4b6=_0x49f9b3?0x0:_0x3060c0['offset'];var _0x8648ba=_0x49f9b3?_0x500e4c['count']:_0x3060c0[_0x93a7('0x30')]+_0x3060c0['limit'];var _0x4b737c;if(_0x8648ba>=_0x202d0d){_0x8648ba=_0x202d0d;_0x4b737c=0xc8;}else{_0x4b737c=0xce;}_0x2852ed[_0x93a7('0x2c')](_0x4b737c);return _0x2852ed[_0x93a7('0x31')](_0x93a7('0x32'),_0x18f4b6+'-'+_0x8648ba+'/'+_0x202d0d)[_0x93a7('0x2d')](_0x500e4c);}return null;};}function patchUpdates(_0x1540a4){return function(_0x1b7a7a){try{jsonpatch['apply'](_0x1b7a7a,_0x1540a4,!![]);}catch(_0x2eea3f){return BPromise[_0x93a7('0x33')](_0x2eea3f);}return _0x1b7a7a[_0x93a7('0x34')]();};}function saveUpdates(_0x37279e,_0x3d56f1){return function(_0x2f5af6){if(_0x2f5af6){return _0x2f5af6[_0x93a7('0x35')](_0x37279e)[_0x93a7('0x1f')](function(_0x22dff2){return _0x22dff2;});}return null;};}function removeEntity(_0xc350fb,_0x50b448){return function(_0x4d63cd){if(_0x4d63cd){return _0x4d63cd[_0x93a7('0x36')]()[_0x93a7('0x1f')](function(){var _0xacc7ad=_0x4d63cd[_0x93a7('0x37')]({'plain':!![]});var _0x34f68b=_0x93a7('0x38');return db[_0x93a7('0x39')][_0x93a7('0x36')]({'where':{'type':_0x34f68b,'resourceId':_0xacc7ad['id']}})[_0x93a7('0x1f')](function(){return _0x4d63cd;});})[_0x93a7('0x1f')](function(){_0xc350fb[_0x93a7('0x2c')](0xcc)[_0x93a7('0x3a')]();});}};}function handleEntityNotFound(_0x13aab1,_0x2b5e18){return function(_0x455d28){if(!_0x455d28){_0x13aab1[_0x93a7('0x2b')](0x194);}return _0x455d28;};}function handleError(_0x458038,_0x3ec3b7){_0x3ec3b7=_0x3ec3b7||0x1f4;return function(_0x30ef4b){logger[_0x93a7('0x26')](_0x30ef4b['stack']);if(_0x30ef4b[_0x93a7('0x3b')]){delete _0x30ef4b['name'];}_0x458038['status'](_0x3ec3b7)[_0x93a7('0x3c')](_0x30ef4b);};}exports[_0x93a7('0x3d')]=function(_0x35302d,_0xeb1087){var _0x339e99={},_0x14d824={},_0x4aa977={'count':0x0,'rows':[]};var _0x2b8707=_[_0x93a7('0x3e')](db['ChatQueue'][_0x93a7('0x3f')],function(_0x4ee528){return{'name':_0x4ee528[_0x93a7('0x40')],'type':_0x4ee528[_0x93a7('0x41')]['key']};});_0x14d824[_0x93a7('0x42')]=_['map'](_0x2b8707,_0x93a7('0x3b'));_0x14d824['query']=_['keys'](_0x35302d[_0x93a7('0x43')]);_0x14d824[_0x93a7('0x44')]=_[_0x93a7('0x45')](_0x14d824['model'],_0x14d824[_0x93a7('0x43')]);_0x339e99[_0x93a7('0x46')]=_[_0x93a7('0x45')](_0x14d824[_0x93a7('0x42')],qs[_0x93a7('0x47')](_0x35302d[_0x93a7('0x43')][_0x93a7('0x47')]));_0x339e99[_0x93a7('0x46')]=_0x339e99[_0x93a7('0x46')][_0x93a7('0x48')]?_0x339e99[_0x93a7('0x46')]:_0x14d824[_0x93a7('0x42')];if(!_0x35302d['query'][_0x93a7('0x49')]('nolimit')){_0x339e99[_0x93a7('0x2e')]=qs['limit'](_0x35302d[_0x93a7('0x43')]['limit']);_0x339e99['offset']=qs[_0x93a7('0x30')](_0x35302d[_0x93a7('0x43')][_0x93a7('0x30')]);}_0x339e99['order']=qs[_0x93a7('0x4a')](_0x35302d['query'][_0x93a7('0x4a')]);_0x339e99['where']=qs[_0x93a7('0x44')](_[_0x93a7('0x4b')](_0x35302d[_0x93a7('0x43')],_0x14d824[_0x93a7('0x44')]),_0x2b8707);if(_0x35302d[_0x93a7('0x43')][_0x93a7('0x4c')]){_0x339e99[_0x93a7('0x4d')]=_[_0x93a7('0x4e')](_0x339e99[_0x93a7('0x4d')],{'$or':_[_0x93a7('0x3e')](_0x2b8707,function(_0xaca12b){if(_0xaca12b['type']!==_0x93a7('0x4f')){var _0x18a0d4={};_0x18a0d4[_0xaca12b[_0x93a7('0x3b')]]={'$like':'%'+_0x35302d[_0x93a7('0x43')][_0x93a7('0x4c')]+'%'};return _0x18a0d4;}})});}_0x339e99=_['merge']({},_0x339e99,_0x35302d[_0x93a7('0x50')]);var _0x3569d6={'where':_0x339e99[_0x93a7('0x4d')]};return db[_0x93a7('0x51')][_0x93a7('0x2f')](_0x3569d6)['then'](function(_0x254660){_0x4aa977['count']=_0x254660;if(_0x35302d[_0x93a7('0x43')]['includeAll']){_0x339e99[_0x93a7('0x52')]=[{'all':!![]}];}return db[_0x93a7('0x51')][_0x93a7('0x53')](_0x339e99);})[_0x93a7('0x1f')](function(_0x4eca2b){_0x4aa977[_0x93a7('0x54')]=_0x4eca2b;return _0x4aa977;})['then'](respondWithFilteredResult(_0xeb1087,_0x339e99))['catch'](handleError(_0xeb1087,null));};exports['show']=function(_0x5ccefd,_0x2a5ab4){var _0x41c45d={'raw':!![],'where':{'id':_0x5ccefd[_0x93a7('0x55')]['id']}},_0xba67c6={};_0xba67c6[_0x93a7('0x42')]=_[_0x93a7('0x56')](db[_0x93a7('0x51')][_0x93a7('0x3f')]);_0xba67c6[_0x93a7('0x43')]=_['keys'](_0x5ccefd[_0x93a7('0x43')]);_0xba67c6[_0x93a7('0x44')]=_['intersection'](_0xba67c6[_0x93a7('0x42')],_0xba67c6['query']);_0x41c45d[_0x93a7('0x46')]=_[_0x93a7('0x45')](_0xba67c6[_0x93a7('0x42')],qs[_0x93a7('0x47')](_0x5ccefd[_0x93a7('0x43')][_0x93a7('0x47')]));_0x41c45d[_0x93a7('0x46')]=_0x41c45d[_0x93a7('0x46')][_0x93a7('0x48')]?_0x41c45d['attributes']:_0xba67c6[_0x93a7('0x42')];if(_0x5ccefd[_0x93a7('0x43')][_0x93a7('0x57')]){_0x41c45d[_0x93a7('0x52')]=[{'all':!![]}];}_0x41c45d=_['merge']({},_0x41c45d,_0x5ccefd['options']);return db[_0x93a7('0x51')]['find'](_0x41c45d)['then'](handleEntityNotFound(_0x2a5ab4,null))[_0x93a7('0x1f')](respondWithResult(_0x2a5ab4,null))['catch'](handleError(_0x2a5ab4,null));};exports[_0x93a7('0x58')]=function(_0x24db1c,_0x561397){return db['ChatQueue']['create'](_0x24db1c['body'],{})['then'](function(_0x530bc3){var _0x53c41a=_0x24db1c['user'][_0x93a7('0x37')]({'plain':!![]});if(!_0x53c41a)throw new Error(_0x93a7('0x59'));if(_0x53c41a[_0x93a7('0x5a')]==='user'){var _0x4e26c2=_0x530bc3[_0x93a7('0x37')]({'plain':!![]});var _0xe6704d='ChatQueues';return db['UserProfileSection'][_0x93a7('0x5b')]({'where':{'name':_0xe6704d,'userProfileId':_0x53c41a[_0x93a7('0x5c')]},'raw':!![]})[_0x93a7('0x1f')](function(_0x51de61){if(_0x51de61&&_0x51de61[_0x93a7('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e26c2[_0x93a7('0x3b')],'resourceId':_0x4e26c2['id'],'type':_0x51de61[_0x93a7('0x3b')],'sectionId':_0x51de61['id']},{})['then'](function(){return _0x530bc3;});}else{return _0x530bc3;}})[_0x93a7('0x2a')](function(_0x2f8860){logger[_0x93a7('0x26')](_0x93a7('0x5e'),_0x2f8860);throw _0x2f8860;});}return _0x530bc3;})[_0x93a7('0x1f')](respondWithResult(_0x561397,0xc9))[_0x93a7('0x2a')](handleError(_0x561397,null));};exports[_0x93a7('0x35')]=function(_0x3def90,_0x171c20){if(_0x3def90['body']['id']){delete _0x3def90[_0x93a7('0x5f')]['id'];}return db[_0x93a7('0x51')]['find']({'where':{'id':_0x3def90['params']['id']}})['then'](handleEntityNotFound(_0x171c20,null))[_0x93a7('0x1f')](saveUpdates(_0x3def90[_0x93a7('0x5f')],null))[_0x93a7('0x1f')](respondWithResult(_0x171c20,null))[_0x93a7('0x2a')](handleError(_0x171c20,null));};exports[_0x93a7('0x36')]=function(_0x43c367,_0x10ef69){return db[_0x93a7('0x51')]['find']({'where':{'id':_0x43c367['params']['id']}})['then'](handleEntityNotFound(_0x10ef69,null))[_0x93a7('0x1f')](removeEntity(_0x10ef69,null))[_0x93a7('0x2a')](handleError(_0x10ef69,null));};exports['describe']=function(_0x2b08ab,_0x519402){return db[_0x93a7('0x51')]['describe']()[_0x93a7('0x1f')](respondWithResult(_0x519402,null))[_0x93a7('0x2a')](handleError(_0x519402,null));};exports['getMembers']=function(_0x2e7602,_0x48fe02,_0x584a6a){var _0x21410f={'raw':!![],'where':{}},_0x2dd7ba={},_0x4ecc20;return db[_0x93a7('0x51')][_0x93a7('0x60')]({'where':{'id':_0x2e7602['params']['id']}})[_0x93a7('0x1f')](handleEntityNotFound(_0x48fe02,null))[_0x93a7('0x1f')](function(_0x186df0){if(_0x186df0){_0x4ecc20=_0x186df0['get']({'plain':!![]});_0x2dd7ba[_0x93a7('0x42')]=_[_0x93a7('0x56')](db['UserChatQueue'][_0x93a7('0x3f')]);_0x2dd7ba[_0x93a7('0x43')]=_[_0x93a7('0x56')](_0x2e7602[_0x93a7('0x43')]);_0x2dd7ba[_0x93a7('0x44')]=_[_0x93a7('0x45')](_0x2dd7ba[_0x93a7('0x42')],_0x2dd7ba['query']);_0x21410f[_0x93a7('0x46')]=_[_0x93a7('0x45')](_0x2dd7ba[_0x93a7('0x42')],qs[_0x93a7('0x47')](_0x2e7602[_0x93a7('0x43')]['fields']));_0x21410f[_0x93a7('0x46')]=_0x21410f[_0x93a7('0x46')][_0x93a7('0x48')]?_0x21410f[_0x93a7('0x46')]:_0x2dd7ba['model'];if(!_0x2e7602[_0x93a7('0x43')]['hasOwnProperty']('nolimit')){_0x21410f[_0x93a7('0x2e')]=qs[_0x93a7('0x2e')](_0x2e7602[_0x93a7('0x43')]['limit']);_0x21410f[_0x93a7('0x30')]=qs[_0x93a7('0x30')](_0x2e7602['query'][_0x93a7('0x30')]);}_0x21410f['order']=qs[_0x93a7('0x4a')](_0x2e7602['query'][_0x93a7('0x4a')]);_0x21410f['where']=qs[_0x93a7('0x44')](_[_0x93a7('0x4b')](_0x2e7602[_0x93a7('0x43')],_0x2dd7ba[_0x93a7('0x44')]));_0x21410f[_0x93a7('0x4d')][_0x93a7('0x61')]=_0x186df0['id'];if(_0x2e7602[_0x93a7('0x43')][_0x93a7('0x4c')]){_0x21410f[_0x93a7('0x4d')]=_[_0x93a7('0x4e')](_0x21410f[_0x93a7('0x4d')],{'$or':_[_0x93a7('0x3e')](_0x21410f[_0x93a7('0x46')],function(_0x1cbb86){var _0x382cdb={};_0x382cdb[_0x1cbb86]={'$like':'%'+_0x2e7602[_0x93a7('0x43')][_0x93a7('0x4c')]+'%'};return _0x382cdb;})});}_0x21410f=_[_0x93a7('0x4e')]({},_0x21410f,_0x2e7602[_0x93a7('0x50')]);return db[_0x93a7('0x62')][_0x93a7('0x53')](_0x21410f);}})[_0x93a7('0x1f')](function(_0x57e43f){if(_0x57e43f){return db[_0x93a7('0x63')][_0x93a7('0x64')]({'where':{'id':_[_0x93a7('0x3e')](_0x57e43f,'UserId'),'role':'agent'},'attributes':['id','name',_0x93a7('0x65'),_0x93a7('0x66'),'createdAt']});}})[_0x93a7('0x1f')](function(_0x3cdc81){if(_0x3cdc81){return{'count':_0x3cdc81[_0x93a7('0x2f')],'rows':_['map'](_0x3cdc81[_0x93a7('0x54')],function(_0x55636e){return{'membername':_0x55636e['name'],'UserId':_0x55636e['id'],'queue_name':_0x4ecc20[_0x93a7('0x3b')],'ChatQueueId':_0x4ecc20['id'],'interface':util[_0x93a7('0x67')]('%s/%s',_0x93a7('0x68'),_0x55636e[_0x93a7('0x3b')]),'penalty':0x0,'paused':_0x55636e['chatPause'],'createdAt':_0x55636e[_0x93a7('0x69')],'updatedAt':_0x55636e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x93a7('0x1f')](respondWithFilteredResult(_0x48fe02,_0x21410f))['catch'](handleError(_0x48fe02,null));};exports['getTeams']=function(_0x1edb18,_0x18c07c,_0x1f9a45){var _0x126d4e={};var _0x5ddbeb={};var _0x279c95;var _0x5435c1;return db['ChatQueue']['findOne']({'where':{'id':_0x1edb18[_0x93a7('0x55')]['id']}})['then'](handleEntityNotFound(_0x18c07c,null))[_0x93a7('0x1f')](function(_0x442ea7){if(_0x442ea7){_0x279c95=_0x442ea7;_0x5ddbeb['model']=_[_0x93a7('0x56')](db[_0x93a7('0x6a')][_0x93a7('0x3f')]);_0x5ddbeb[_0x93a7('0x43')]=_[_0x93a7('0x56')](_0x1edb18[_0x93a7('0x43')]);_0x5ddbeb[_0x93a7('0x44')]=_[_0x93a7('0x45')](_0x5ddbeb[_0x93a7('0x42')],_0x5ddbeb[_0x93a7('0x43')]);_0x126d4e[_0x93a7('0x46')]=_[_0x93a7('0x45')](_0x5ddbeb[_0x93a7('0x42')],qs[_0x93a7('0x47')](_0x1edb18['query'][_0x93a7('0x47')]));_0x126d4e[_0x93a7('0x46')]=_0x126d4e[_0x93a7('0x46')][_0x93a7('0x48')]?_0x126d4e['attributes']:_0x5ddbeb[_0x93a7('0x42')];_0x126d4e[_0x93a7('0x6b')]=qs['sort'](_0x1edb18[_0x93a7('0x43')]['sort']);_0x126d4e['where']=qs[_0x93a7('0x44')](_[_0x93a7('0x4b')](_0x1edb18['query'],_0x5ddbeb['filters']));if(_0x1edb18['query'][_0x93a7('0x4c')]){_0x126d4e[_0x93a7('0x4d')]=_['merge'](_0x126d4e[_0x93a7('0x4d')],{'$or':_['map'](_0x126d4e[_0x93a7('0x46')],function(_0x44c333){var _0x4cec24={};_0x4cec24[_0x44c333]={'$like':'%'+_0x1edb18['query'][_0x93a7('0x4c')]+'%'};return _0x4cec24;})});}_0x126d4e=_[_0x93a7('0x4e')]({},_0x126d4e,_0x1edb18[_0x93a7('0x50')]);return _0x279c95[_0x93a7('0x6c')](_0x126d4e);}})[_0x93a7('0x1f')](function(_0x358951){if(_0x358951){_0x5435c1=_0x358951[_0x93a7('0x48')];if(!_0x1edb18[_0x93a7('0x43')][_0x93a7('0x49')](_0x93a7('0x6d'))){_0x126d4e[_0x93a7('0x2e')]=qs['limit'](_0x1edb18[_0x93a7('0x43')][_0x93a7('0x2e')]);_0x126d4e['offset']=qs['offset'](_0x1edb18[_0x93a7('0x43')][_0x93a7('0x30')]);}return _0x279c95[_0x93a7('0x6c')](_0x126d4e);}})['then'](function(_0x447c2a){if(_0x447c2a){return _0x447c2a?{'count':_0x5435c1,'rows':_0x447c2a}:null;}})[_0x93a7('0x1f')](respondWithResult(_0x18c07c,null))['catch'](handleError(_0x18c07c,null));};exports['addTeams']=function(_0x18fb69,_0x3b5bfc,_0x1728bd){var _0x36f0fa=_0x18fb69[_0x93a7('0x5f')][_0x93a7('0x6e')];return db[_0x93a7('0x6a')]['findAll']({'where':{'id':_0x36f0fa},'attributes':['id'],'include':[{'model':db['User'],'as':_0x93a7('0x6f'),'attributes':['id',_0x93a7('0x3b'),_0x93a7('0x70'),_0x93a7('0x71'),_0x93a7('0x72')],'raw':!![]}]})[_0x93a7('0x1f')](function(_0x25cc02){if(_0x25cc02){var _0x459d50=_['flatMap'](_0x25cc02,function(_0x32a28f){var _0x4466ae=_0x32a28f['get']({'plain':!![]});return _0x4466ae[_0x93a7('0x6f')];});return db[_0x93a7('0x51')][_0x93a7('0x5b')]({'where':{'id':_0x18fb69[_0x93a7('0x55')]['id']}})['then'](function(_0x29dba){return db[_0x93a7('0x73')][_0x93a7('0x74')](function(_0x117678){return _0x29dba[_0x93a7('0x75')](_0x36f0fa,{'transaction':_0x117678})['then'](function(){return BPromise[_0x93a7('0x76')](_0x459d50,function(_0x4695d4){return db[_0x93a7('0x62')]['findOrCreate']({'where':{'UserId':_0x4695d4['id'],'ChatQueueId':_0x18fb69[_0x93a7('0x55')]['id']},'transaction':_0x117678});});})[_0x93a7('0x1f')](function(){_0x459d50['forEach'](function(_0x304adf){socket[_0x93a7('0x77')](_0x93a7('0x78'),{'UserId':_0x304adf['id'],'ChatQueueId':_0x29dba['id']});});});});});}})[_0x93a7('0x1f')](respondWithStatusCode(_0x3b5bfc,null))['catch'](handleError(_0x3b5bfc,null));};exports['removeTeams']=function(_0x2a6e48,_0x191397,_0xa286d2){return db['Team'][_0x93a7('0x53')]({'where':{'id':_0x2a6e48[_0x93a7('0x43')][_0x93a7('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x93a7('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x191397,null))[_0x93a7('0x1f')](function(_0x3f0065){var _0x1fbedf=_[_0x93a7('0x3e')](_0x3f0065,'id');var _0x2fa4c9=[];var _0x2cbbcd=[];var _0x3670b4=squel[_0x93a7('0x79')]();_0x3670b4[_0x93a7('0x7a')](_0x93a7('0x7b'))[_0x93a7('0x7c')]('team_has_chat_queues','tq')[_0x93a7('0x7d')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x93a7('0x7e'),_0x2a6e48[_0x93a7('0x55')]['id']);for(var _0x390223=0x0;_0x390223<_0x3f0065[_0x93a7('0x48')];_0x390223+=0x1){let _0x42cab3=_0x3f0065[_0x390223];for(var _0x30afa2=0x0;_0x30afa2<_0x42cab3[_0x93a7('0x6f')][_0x93a7('0x48')];_0x30afa2+=0x1){let _0xd7b84e=_0x42cab3[_0x93a7('0x6f')][_0x30afa2];var _0x2abeb7=_0x3670b4[_0x93a7('0x7f')]();_0x2abeb7[_0x93a7('0x4d')]('ut.UserId\x20=\x20?',_0xd7b84e['id']);_0x2cbbcd[_0x93a7('0x80')](db[_0x93a7('0x73')][_0x93a7('0x43')](_0x2abeb7[_0x93a7('0x81')](),{'type':db[_0x93a7('0x73')][_0x93a7('0x82')][_0x93a7('0x83')]})[_0x93a7('0x1f')](function(_0x154e6b){if(_0x154e6b[_0x93a7('0x48')]===0x1){return _0xd7b84e['id'];}else{var _0x311267=_[_0x93a7('0x84')](_[_0x93a7('0x3e')](_0x154e6b,_0x93a7('0x85')),function(_0x5137fe){return _[_0x93a7('0x86')](_0x1fbedf,_0x5137fe);});if(_0x311267){return _0xd7b84e['id'];}}}));}}return BPromise[_0x93a7('0x87')](_0x2cbbcd)[_0x93a7('0x1f')](function(_0x3beef7){_0x2fa4c9=_(_0x2fa4c9)['union'](_0x3beef7)[_0x93a7('0x88')]()[_0x93a7('0x89')]();return db[_0x93a7('0x51')]['find']({'where':{'id':_0x2a6e48[_0x93a7('0x55')]['id']}})[_0x93a7('0x1f')](function(_0x26f96a){return db[_0x93a7('0x73')]['transaction'](function(_0x58a6b4){return _0x26f96a[_0x93a7('0x8a')](_0x2a6e48[_0x93a7('0x43')][_0x93a7('0x6e')],{'transaction':_0x58a6b4})[_0x93a7('0x1f')](function(){if(!_[_0x93a7('0x8b')](_0x2fa4c9)){return _0x26f96a[_0x93a7('0x8c')](_0x2fa4c9,{'transaction':_0x58a6b4});}})['then'](function(){_0x2fa4c9[_0x93a7('0x8d')](function(_0x23919e){socket[_0x93a7('0x77')](_0x93a7('0x8e'),{'UserId':_0x23919e,'ChatQueueId':_0x26f96a['id']});});});});});});})[_0x93a7('0x1f')](respondWithStatusCode(_0x191397,null))[_0x93a7('0x2a')](handleError(_0x191397,null));};exports[_0x93a7('0x8f')]=function(_0x513590,_0x7fe5f3,_0x4aa662){return db[_0x93a7('0x51')]['find']({'where':{'id':_0x513590[_0x93a7('0x55')]['id']}})[_0x93a7('0x1f')](handleEntityNotFound(_0x7fe5f3,null))[_0x93a7('0x1f')](function(_0x15e272){if(_0x15e272){return _0x15e272[_0x93a7('0x8f')](_0x513590[_0x93a7('0x5f')][_0x93a7('0x6e')],_[_0x93a7('0x90')](_0x513590['body'],['ids','id'])||{})['spread'](function(_0x562ad2){for(var _0x2cc74f=0x0;_0x2cc74f<_0x513590['body'][_0x93a7('0x6e')]['length'];_0x2cc74f+=0x1){socket['emit'](_0x93a7('0x78'),{'UserId':Number(_0x513590['body'][_0x93a7('0x6e')][_0x2cc74f]),'ChatQueueId':Number(_0x513590[_0x93a7('0x55')]['id'])});}return _0x562ad2;});}})['then'](respondWithResult(_0x7fe5f3,null))['catch'](handleError(_0x7fe5f3,null));};exports[_0x93a7('0x8c')]=function(_0x281c81,_0x5d9bd2,_0x336218){return db[_0x93a7('0x51')]['find']({'where':{'id':_0x281c81['params']['id']}})[_0x93a7('0x1f')](handleEntityNotFound(_0x5d9bd2,null))[_0x93a7('0x1f')](function(_0x5abb8e){if(_0x5abb8e){return _0x5abb8e['removeAgents'](_0x281c81['query'][_0x93a7('0x6e')])['then'](function(){if(_[_0x93a7('0x91')](_0x281c81[_0x93a7('0x43')][_0x93a7('0x6e')])){for(var _0x45c33c=0x0;_0x45c33c<_0x281c81[_0x93a7('0x43')][_0x93a7('0x6e')][_0x93a7('0x48')];_0x45c33c+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x281c81['query'][_0x93a7('0x6e')][_0x45c33c]),'ChatQueueId':Number(_0x281c81[_0x93a7('0x55')]['id'])});}}else{socket['emit'](_0x93a7('0x8e'),{'UserId':Number(_0x281c81[_0x93a7('0x43')][_0x93a7('0x6e')]),'ChatQueueId':Number(_0x281c81[_0x93a7('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d9bd2,null))[_0x93a7('0x2a')](handleError(_0x5d9bd2,null));};exports['getAgents']=function(_0x544c0b,_0x4f3bab,_0x581310){var _0x1d2b58={};var _0x157ed4={};var _0x47c500;var _0x124933;return db[_0x93a7('0x51')][_0x93a7('0x60')]({'where':{'id':_0x544c0b[_0x93a7('0x55')]['id']}})[_0x93a7('0x1f')](handleEntityNotFound(_0x4f3bab,null))['then'](function(_0x197a64){if(_0x197a64){_0x47c500=_0x197a64;_0x157ed4[_0x93a7('0x42')]=_['keys'](db[_0x93a7('0x63')]['rawAttributes']);_0x157ed4[_0x93a7('0x43')]=_[_0x93a7('0x56')](_0x544c0b[_0x93a7('0x43')]);_0x157ed4[_0x93a7('0x44')]=_[_0x93a7('0x45')](_0x157ed4[_0x93a7('0x42')],_0x157ed4[_0x93a7('0x43')]);_0x1d2b58[_0x93a7('0x46')]=_['intersection'](_0x157ed4[_0x93a7('0x42')],qs[_0x93a7('0x47')](_0x544c0b[_0x93a7('0x43')][_0x93a7('0x47')]));_0x1d2b58['attributes']=_0x1d2b58[_0x93a7('0x46')][_0x93a7('0x48')]?_0x1d2b58['attributes']:_0x157ed4[_0x93a7('0x42')];_0x1d2b58[_0x93a7('0x6b')]=qs[_0x93a7('0x4a')](_0x544c0b[_0x93a7('0x43')]['sort']);_0x1d2b58['where']=qs[_0x93a7('0x44')](_['pick'](_0x544c0b[_0x93a7('0x43')],_0x157ed4[_0x93a7('0x44')]));if(_0x544c0b['query'][_0x93a7('0x4c')]){_0x1d2b58[_0x93a7('0x4d')]=_['merge'](_0x1d2b58[_0x93a7('0x4d')],{'$or':_[_0x93a7('0x3e')](_0x1d2b58[_0x93a7('0x46')],function(_0x115e37){var _0x13b45f={};_0x13b45f[_0x115e37]={'$like':'%'+_0x544c0b[_0x93a7('0x43')][_0x93a7('0x4c')]+'%'};return _0x13b45f;})});}_0x1d2b58=_[_0x93a7('0x4e')]({},_0x1d2b58,_0x544c0b[_0x93a7('0x50')]);return _0x47c500[_0x93a7('0x92')](_0x1d2b58);}})[_0x93a7('0x1f')](function(_0x24fdd7){if(_0x24fdd7){_0x124933=_0x24fdd7[_0x93a7('0x48')];if(!_0x544c0b['query'][_0x93a7('0x49')](_0x93a7('0x6d'))){_0x1d2b58[_0x93a7('0x2e')]=qs['limit'](_0x544c0b['query'][_0x93a7('0x2e')]);_0x1d2b58['offset']=qs[_0x93a7('0x30')](_0x544c0b['query']['offset']);}return _0x47c500[_0x93a7('0x92')](_0x1d2b58);}})[_0x93a7('0x1f')](function(_0x3fdc1f){if(_0x3fdc1f){return _0x3fdc1f?{'count':_0x124933,'rows':_0x3fdc1f}:null;}})[_0x93a7('0x1f')](respondWithResult(_0x4f3bab,null))[_0x93a7('0x2a')](handleError(_0x4f3bab,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 82afc9f..3df34b9 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 _0x099f=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0x099f,0x1e2));var _0xf099=function(_0x11ba2a,_0xedb88f){_0x11ba2a=_0x11ba2a-0x0;var _0x3bd79f=_0x099f[_0x11ba2a];return _0x3bd79f;};'use strict';var EventEmitter=require(_0xf099('0x0'));var ChatQueue=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf099('0x3')](0x0);var events={'afterCreate':_0xf099('0x4'),'afterUpdate':'update','afterDestroy':_0xf099('0x5')};function emitEvent(_0x3caf0d){return function(_0x6c40aa,_0x16efc8,_0x244c9a){ChatQueueEvents[_0xf099('0x6')](_0x3caf0d+':'+_0x6c40aa['id'],_0x6c40aa);ChatQueueEvents[_0xf099('0x6')](_0x3caf0d,_0x6c40aa);_0x244c9a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];ChatQueue[_0xf099('0x8')](e,emitEvent(event));}}module[_0xf099('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xc3fc=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x18dc34,_0x205f71){var _0x4ab15b=function(_0x50572f){while(--_0x50572f){_0x18dc34['push'](_0x18dc34['shift']());}};_0x4ab15b(++_0x205f71);}(_0xc3fc,0x1cf));var _0xcc3f=function(_0x905d4b,_0x20ff42){_0x905d4b=_0x905d4b-0x0;var _0x473e92=_0xc3fc[_0x905d4b];return _0x473e92;};'use strict';var EventEmitter=require(_0xcc3f('0x0'));var ChatQueue=require(_0xcc3f('0x1'))['db'][_0xcc3f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcc3f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcc3f('0x4'),'afterDestroy':_0xcc3f('0x5')};function emitEvent(_0x3a11c8){return function(_0x251162,_0x353bbb,_0x2b6a29){ChatQueueEvents['emit'](_0x3a11c8+':'+_0x251162['id'],_0x251162);ChatQueueEvents[_0xcc3f('0x6')](_0x3a11c8,_0x251162);_0x2b6a29(null);};}for(var e in events){if(events[_0xcc3f('0x7')](e)){var event=events[e];ChatQueue[_0xcc3f('0x8')](e,emitEvent(event));}}module[_0xcc3f('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index abe81ad..a0e3145 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 _0x8ad6=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x42589f,_0x495906){var _0x3aa564=function(_0x1d0c8c){while(--_0x1d0c8c){_0x42589f['push'](_0x42589f['shift']());}};_0x3aa564(++_0x495906);}(_0x8ad6,0x106));var _0x68ad=function(_0x507aaf,_0x1a66af){_0x507aaf=_0x507aaf-0x0;var _0x5cb95c=_0x8ad6[_0x507aaf];return _0x5cb95c;};'use strict';var _=require(_0x68ad('0x0'));var util=require(_0x68ad('0x1'));var logger=require(_0x68ad('0x2'))(_0x68ad('0x3'));var moment=require(_0x68ad('0x4'));var BPromise=require(_0x68ad('0x5'));var rp=require(_0x68ad('0x6'));var fs=require('fs');var path=require(_0x68ad('0x7'));var rimraf=require(_0x68ad('0x8'));var config=require(_0x68ad('0x9'));var attributes=require(_0x68ad('0xa'));module[_0x68ad('0xb')]=function(_0x1ec236,_0x75d828){return _0x1ec236[_0x68ad('0xc')](_0x68ad('0xd'),attributes,{'tableName':_0x68ad('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5165=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x47a5cd,_0x54d6ff){var _0x13f5d5=function(_0x4d85c8){while(--_0x4d85c8){_0x47a5cd['push'](_0x47a5cd['shift']());}};_0x13f5d5(++_0x54d6ff);}(_0x5165,0x1da));var _0x5516=function(_0x3b4dc4,_0x2e12d8){_0x3b4dc4=_0x3b4dc4-0x0;var _0x3e2579=_0x5165[_0x3b4dc4];return _0x3e2579;};'use strict';var _=require('lodash');var util=require(_0x5516('0x0'));var logger=require('../../config/logger')(_0x5516('0x1'));var moment=require(_0x5516('0x2'));var BPromise=require(_0x5516('0x3'));var rp=require(_0x5516('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5516('0x5'));var config=require(_0x5516('0x6'));var attributes=require(_0x5516('0x7'));module[_0x5516('0x8')]=function(_0xa44d21,_0x11202d){return _0xa44d21[_0x5516('0x9')](_0x5516('0xa'),attributes,{'tableName':_0x5516('0xb'),'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 fd13758..ac211f0 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 _0x07a2=['stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ChatQueue','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2643d3,_0x54f179){var _0x3d697d=function(_0x25c73f){while(--_0x25c73f){_0x2643d3['push'](_0x2643d3['shift']());}};_0x3d697d(++_0x54f179);}(_0x07a2,0x12c));var _0x207a=function(_0x1c1da1,_0x4755d8){_0x1c1da1=_0x1c1da1-0x0;var _0x3c1816=_0x07a2[_0x1c1da1];return _0x3c1816;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var moment=require('moment');var BPromise=require(_0x207a('0x2'));var rs=require(_0x207a('0x3'));var fs=require('fs');var Redis=require(_0x207a('0x4'));var db=require(_0x207a('0x5'))['db'];var utils=require(_0x207a('0x6'));var logger=require(_0x207a('0x7'))(_0x207a('0x8'));var config=require(_0x207a('0x9'));var jayson=require(_0x207a('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x207a('0xb')]=_[_0x207a('0xc')](config[_0x207a('0xb')],{'host':_0x207a('0xd'),'port':0x18eb});var socket=require(_0x207a('0xe'))(new Redis(config[_0x207a('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3cca2d,_0x5614e1,_0x4eab73){return new BPromise(function(_0x3dd07d,_0x5a7d85){return client['request'](_0x3cca2d,_0x4eab73)[_0x207a('0xf')](function(_0x39950f){logger[_0x207a('0x10')]('ChatQueue,\x20%s,\x20%s',_0x5614e1,_0x207a('0x11'));logger[_0x207a('0x12')](_0x207a('0x13'),_0x5614e1,'request\x20sent',JSON[_0x207a('0x14')](_0x39950f));if(_0x39950f[_0x207a('0x15')]){if(_0x39950f[_0x207a('0x15')][_0x207a('0x16')]===0x1f4){logger[_0x207a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5614e1,_0x39950f[_0x207a('0x15')]['message']);return _0x5a7d85(_0x39950f[_0x207a('0x15')][_0x207a('0x17')]);}logger[_0x207a('0x15')](_0x207a('0x18'),_0x5614e1,_0x39950f[_0x207a('0x15')][_0x207a('0x17')]);return _0x3dd07d(_0x39950f[_0x207a('0x15')][_0x207a('0x17')]);}else{logger[_0x207a('0x10')](_0x207a('0x18'),_0x5614e1,'request\x20sent');_0x3dd07d(_0x39950f[_0x207a('0x19')]['message']);}})[_0x207a('0x1a')](function(_0x28246e){logger[_0x207a('0x15')](_0x207a('0x18'),_0x5614e1,_0x28246e);_0x5a7d85(_0x28246e);});});}exports[_0x207a('0x1b')]=function(_0x1afb14){var _0x5b20bc=this;return new Promise(function(_0x104593,_0x30ff20){return db['ChatQueue'][_0x207a('0x1c')]({'raw':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x1e')]===undefined?!![]:![]:!![],'where':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x1f')]||null:null,'attributes':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x20')]||null:null,'limit':_0x1afb14[_0x207a('0x1d')]?_0x1afb14[_0x207a('0x1d')][_0x207a('0x21')]||null:null,'include':_0x1afb14['options']?_0x1afb14[_0x207a('0x1d')][_0x207a('0x22')]?_[_0x207a('0x23')](_0x1afb14[_0x207a('0x1d')]['include'],function(_0x1bf684){return{'model':db[_0x1bf684[_0x207a('0x24')]],'as':_0x1bf684['as'],'attributes':_0x1bf684['attributes'],'include':_0x1bf684[_0x207a('0x22')]?_['map'](_0x1bf684['include'],function(_0x3c81bd){return{'model':db[_0x3c81bd['model']],'as':_0x3c81bd['as'],'attributes':_0x3c81bd[_0x207a('0x20')],'include':_0x3c81bd[_0x207a('0x22')]?_['map'](_0x3c81bd['include'],function(_0xb41124){return{'model':db[_0xb41124[_0x207a('0x24')]],'as':_0xb41124['as'],'attributes':_0xb41124['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25d852){logger[_0x207a('0x10')](_0x207a('0x1b'),_0x1afb14);logger[_0x207a('0x12')](_0x207a('0x1b'),_0x1afb14,JSON[_0x207a('0x14')](_0x25d852));_0x104593(_0x25d852);})[_0x207a('0x1a')](function(_0x507dc9){logger[_0x207a('0x15')](_0x207a('0x1b'),_0x507dc9[_0x207a('0x17')],_0x1afb14);_0x30ff20(_0x5b20bc['error'](0x1f4,_0x507dc9['message']));});});};exports['ShowChatQueue']=function(_0x4b76cd){var _0x290385=this;return new Promise(function(_0x358231,_0x3afd69){return db[_0x207a('0x25')][_0x207a('0x26')]({'raw':_0x4b76cd[_0x207a('0x1d')]?_0x4b76cd[_0x207a('0x1d')][_0x207a('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b76cd[_0x207a('0x1d')]?_0x4b76cd[_0x207a('0x1d')]['where']||null:null,'attributes':_0x4b76cd[_0x207a('0x1d')]?_0x4b76cd[_0x207a('0x1d')][_0x207a('0x20')]||null:null,'include':_0x4b76cd['options']?_0x4b76cd['options'][_0x207a('0x22')]?_[_0x207a('0x23')](_0x4b76cd['options'][_0x207a('0x22')],function(_0x1de18e){return{'model':db[_0x1de18e['model']],'as':_0x1de18e['as'],'attributes':_0x1de18e[_0x207a('0x20')],'include':_0x1de18e[_0x207a('0x22')]?_[_0x207a('0x23')](_0x1de18e['include'],function(_0x405415){return{'model':db[_0x405415['model']],'as':_0x405415['as'],'attributes':_0x405415['attributes'],'include':_0x405415[_0x207a('0x22')]?_[_0x207a('0x23')](_0x405415['include'],function(_0x2597a2){return{'model':db[_0x2597a2[_0x207a('0x24')]],'as':_0x2597a2['as'],'attributes':_0x2597a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x207a('0xf')](function(_0x1bf9c0){logger[_0x207a('0x10')](_0x207a('0x27'),_0x4b76cd);logger[_0x207a('0x12')]('ShowChatQueue',_0x4b76cd,JSON[_0x207a('0x14')](_0x1bf9c0));_0x358231(_0x1bf9c0);})[_0x207a('0x1a')](function(_0xd24dc6){logger[_0x207a('0x15')](_0x207a('0x27'),_0xd24dc6[_0x207a('0x17')],_0x4b76cd);_0x3afd69(_0x290385[_0x207a('0x15')](0x1f4,_0xd24dc6['message']));});});}; \ No newline at end of file +var _0x7cfa=['http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','message','error','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','debug','find','raw','model','then','ShowChatQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x9e3e99,_0x171884){var _0x1c4136=function(_0x5eecc6){while(--_0x5eecc6){_0x9e3e99['push'](_0x9e3e99['shift']());}};_0x1c4136(++_0x171884);}(_0x7cfa,0x137));var _0xa7cf=function(_0x466251,_0x231ae7){_0x466251=_0x466251-0x0;var _0x323fab=_0x7cfa[_0x466251];return _0x323fab;};'use strict';var _=require(_0xa7cf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa7cf('0x1'));var rs=require(_0xa7cf('0x2'));var fs=require('fs');var Redis=require(_0xa7cf('0x3'));var db=require(_0xa7cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7cf('0x5'))('rpc');var config=require(_0xa7cf('0x6'));var jayson=require(_0xa7cf('0x7'));var client=jayson[_0xa7cf('0x8')][_0xa7cf('0x9')]({'port':0x232a});config[_0xa7cf('0xa')]=_[_0xa7cf('0xb')](config[_0xa7cf('0xa')],{'host':_0xa7cf('0xc'),'port':0x18eb});var socket=require(_0xa7cf('0xd'))(new Redis(config[_0xa7cf('0xa')]));require(_0xa7cf('0xe'))['register'](socket);function respondWithRpcPromise(_0x3ba932,_0x3bbfdf,_0x588c65){return new BPromise(function(_0x2c21ed,_0x333973){return client[_0xa7cf('0xf')](_0x3ba932,_0x588c65)['then'](function(_0x4d85ca){logger[_0xa7cf('0x10')](_0xa7cf('0x11'),_0x3bbfdf,_0xa7cf('0x12'));logger['debug'](_0xa7cf('0x13'),_0x3bbfdf,'request\x20sent',JSON[_0xa7cf('0x14')](_0x4d85ca));if(_0x4d85ca['error']){if(_0x4d85ca['error']['code']===0x1f4){logger['error'](_0xa7cf('0x11'),_0x3bbfdf,_0x4d85ca['error']['message']);return _0x333973(_0x4d85ca['error'][_0xa7cf('0x15')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x3bbfdf,_0x4d85ca[_0xa7cf('0x16')][_0xa7cf('0x15')]);return _0x2c21ed(_0x4d85ca[_0xa7cf('0x16')][_0xa7cf('0x15')]);}else{logger[_0xa7cf('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3bbfdf,'request\x20sent');_0x2c21ed(_0x4d85ca[_0xa7cf('0x17')]['message']);}})[_0xa7cf('0x18')](function(_0x229abe){logger[_0xa7cf('0x16')](_0xa7cf('0x11'),_0x3bbfdf,_0x229abe);_0x333973(_0x229abe);});});}exports[_0xa7cf('0x19')]=function(_0x22035d){var _0x44a464=this;return new Promise(function(_0x44a02b,_0x2a475a){return db[_0xa7cf('0x1a')][_0xa7cf('0x1b')]({'raw':_0x22035d[_0xa7cf('0x1c')]?_0x22035d[_0xa7cf('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22035d[_0xa7cf('0x1c')]?_0x22035d[_0xa7cf('0x1c')][_0xa7cf('0x1d')]||null:null,'attributes':_0x22035d[_0xa7cf('0x1c')]?_0x22035d[_0xa7cf('0x1c')][_0xa7cf('0x1e')]||null:null,'limit':_0x22035d['options']?_0x22035d[_0xa7cf('0x1c')][_0xa7cf('0x1f')]||null:null,'include':_0x22035d[_0xa7cf('0x1c')]?_0x22035d[_0xa7cf('0x1c')][_0xa7cf('0x20')]?_['map'](_0x22035d[_0xa7cf('0x1c')][_0xa7cf('0x20')],function(_0x14b714){return{'model':db[_0x14b714['model']],'as':_0x14b714['as'],'attributes':_0x14b714[_0xa7cf('0x1e')],'include':_0x14b714[_0xa7cf('0x20')]?_[_0xa7cf('0x21')](_0x14b714[_0xa7cf('0x20')],function(_0x5a4178){return{'model':db[_0x5a4178['model']],'as':_0x5a4178['as'],'attributes':_0x5a4178['attributes'],'include':_0x5a4178[_0xa7cf('0x20')]?_[_0xa7cf('0x21')](_0x5a4178['include'],function(_0x14bc4c){return{'model':db[_0x14bc4c['model']],'as':_0x14bc4c['as'],'attributes':_0x14bc4c[_0xa7cf('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32d607){logger[_0xa7cf('0x10')](_0xa7cf('0x19'),_0x22035d);logger[_0xa7cf('0x22')]('GetChatQueue',_0x22035d,JSON[_0xa7cf('0x14')](_0x32d607));_0x44a02b(_0x32d607);})[_0xa7cf('0x18')](function(_0xf0af15){logger[_0xa7cf('0x16')]('GetChatQueue',_0xf0af15[_0xa7cf('0x15')],_0x22035d);_0x2a475a(_0x44a464['error'](0x1f4,_0xf0af15[_0xa7cf('0x15')]));});});};exports['ShowChatQueue']=function(_0x34c0e3){var _0x6e59f9=this;return new Promise(function(_0x26d32a,_0x296f33){return db[_0xa7cf('0x1a')][_0xa7cf('0x23')]({'raw':_0x34c0e3[_0xa7cf('0x1c')]?_0x34c0e3[_0xa7cf('0x1c')][_0xa7cf('0x24')]===undefined?!![]:![]:!![],'where':_0x34c0e3[_0xa7cf('0x1c')]?_0x34c0e3[_0xa7cf('0x1c')][_0xa7cf('0x1d')]||null:null,'attributes':_0x34c0e3[_0xa7cf('0x1c')]?_0x34c0e3['options'][_0xa7cf('0x1e')]||null:null,'include':_0x34c0e3['options']?_0x34c0e3[_0xa7cf('0x1c')][_0xa7cf('0x20')]?_[_0xa7cf('0x21')](_0x34c0e3[_0xa7cf('0x1c')][_0xa7cf('0x20')],function(_0x55362a){return{'model':db[_0x55362a[_0xa7cf('0x25')]],'as':_0x55362a['as'],'attributes':_0x55362a[_0xa7cf('0x1e')],'include':_0x55362a[_0xa7cf('0x20')]?_[_0xa7cf('0x21')](_0x55362a[_0xa7cf('0x20')],function(_0x5eb3ff){return{'model':db[_0x5eb3ff['model']],'as':_0x5eb3ff['as'],'attributes':_0x5eb3ff[_0xa7cf('0x1e')],'include':_0x5eb3ff[_0xa7cf('0x20')]?_[_0xa7cf('0x21')](_0x5eb3ff[_0xa7cf('0x20')],function(_0x22bd8f){return{'model':db[_0x22bd8f[_0xa7cf('0x25')]],'as':_0x22bd8f['as'],'attributes':_0x22bd8f[_0xa7cf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa7cf('0x26')](function(_0x3448a4){logger[_0xa7cf('0x10')](_0xa7cf('0x27'),_0x34c0e3);logger[_0xa7cf('0x22')]('ShowChatQueue',_0x34c0e3,JSON[_0xa7cf('0x14')](_0x3448a4));_0x26d32a(_0x3448a4);})[_0xa7cf('0x18')](function(_0xb9b5fe){logger[_0xa7cf('0x16')](_0xa7cf('0x27'),_0xb9b5fe['message'],_0x34c0e3);_0x296f33(_0x6e59f9[_0xa7cf('0x16')](0x1f4,_0xb9b5fe[_0xa7cf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 6d2202b..c05af9d 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 _0x57d4=['length','./chatQueue.events','save','update','emit','removeListener','register'];(function(_0x15d1e0,_0x2a4d69){var _0x12bd18=function(_0x117920){while(--_0x117920){_0x15d1e0['push'](_0x15d1e0['shift']());}};_0x12bd18(++_0x2a4d69);}(_0x57d4,0x78));var _0x457d=function(_0x52e288,_0x3a08d8){_0x52e288=_0x52e288-0x0;var _0x5d13ea=_0x57d4[_0x52e288];return _0x5d13ea;};'use strict';var ChatQueueEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){ChatQueueEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('chatQueue:'+_0x381e22,_0x247ec7);ChatQueueEvents['on'](_0x381e22,_0x4e32c0);}}; \ No newline at end of file +var _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x356f6a,_0xdce829){var _0x57ec8a=function(_0x58f16e){while(--_0x58f16e){_0x356f6a['push'](_0x356f6a['shift']());}};_0x57ec8a(++_0xdce829);}(_0x22fb,0x192));var _0xb22f=function(_0x4ded75,_0x47f642){_0x4ded75=_0x4ded75-0x0;var _0x2739e4=_0x22fb[_0x4ded75];return _0x2739e4;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 057b7b0..a21b1a5 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5fc3,0xa8));var _0x35fc=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0x5fc3[_0x17a32f];return _0x15a293;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0xac17a4,_0x27863d){_0xac17a4=_0xac17a4-0x0;var _0x49596c=_0x3e74[_0xac17a4];return _0x49596c;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 84420ba..20de4c2 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 _0xa007=['moment','sequelize','exports','STRING','DATE'];(function(_0x39d483,_0x331941){var _0x5afec1=function(_0x292a36){while(--_0x292a36){_0x39d483['push'](_0x39d483['shift']());}};_0x5afec1(++_0x331941);}(_0xa007,0x15e));var _0x7a00=function(_0xea4b97,_0x3c0f0f){_0xea4b97=_0xea4b97-0x0;var _0x5056d3=_0xa007[_0xea4b97];return _0x5056d3;};'use strict';var moment=require(_0x7a00('0x0'));var Sequelize=require(_0x7a00('0x1'));module[_0x7a00('0x2')]={'uniqueid':{'type':Sequelize[_0x7a00('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7a00('0x3')]},'joinAt':{'type':Sequelize[_0x7a00('0x4')]},'leaveAt':{'type':Sequelize[_0x7a00('0x4')]},'acceptAt':{'type':Sequelize[_0x7a00('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7a00('0x3')]}}; \ No newline at end of file +var _0x93a6=['STRING','DATE','moment','sequelize','exports'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x93a6,0x1ab));var _0x693a=function(_0x5502a7,_0x325618){_0x5502a7=_0x5502a7-0x0;var _0x3946fa=_0x93a6[_0x5502a7];return _0x3946fa;};'use strict';var moment=require(_0x693a('0x0'));var Sequelize=require(_0x693a('0x1'));module[_0x693a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x693a('0x3')]},'joinAt':{'type':Sequelize[_0x693a('0x4')]},'leaveAt':{'type':Sequelize[_0x693a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8e74e51..69e633d 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 _0x0755=['util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','findAll','show','params','includeAll','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x0755,0x7c));var _0x5075=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x0755[_0x47c5bf];return _0x11b779;};'use strict';var emlformat=require(_0x5075('0x0'));var rimraf=require(_0x5075('0x1'));var zipdir=require(_0x5075('0x2'));var jsonpatch=require(_0x5075('0x3'));var rp=require(_0x5075('0x4'));var moment=require(_0x5075('0x5'));var BPromise=require(_0x5075('0x6'));var Mustache=require(_0x5075('0x7'));var util=require(_0x5075('0x8'));var path=require(_0x5075('0x9'));var sox=require('sox');var csv=require(_0x5075('0xa'));var ejs=require(_0x5075('0xb'));var fs=require('fs');var fs_extra=require(_0x5075('0xc'));var _=require(_0x5075('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5075('0xe'));var toCsv=require(_0x5075('0xa'));var querystring=require('querystring');var Papa=require(_0x5075('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5075('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5075('0x11'))(_0x5075('0x12'));var utils=require(_0x5075('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5075('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c5e3,_0x1a131e){_0x1a131e=_0x1a131e||0xcc;return function(_0x413cec){if(_0x413cec){return _0x11c5e3[_0x5075('0x15')](_0x1a131e);}return _0x11c5e3[_0x5075('0x16')](_0x1a131e)[_0x5075('0x17')]();};}function respondWithResult(_0x92710a,_0x32b1a1){_0x32b1a1=_0x32b1a1||0xc8;return function(_0x339420){if(_0x339420){return _0x92710a[_0x5075('0x16')](_0x32b1a1)[_0x5075('0x18')](_0x339420);}};}function respondWithFilteredResult(_0x13e267,_0x4235cd){return function(_0x49ff22){if(_0x49ff22){var _0x128a1b=typeof _0x4235cd[_0x5075('0x19')]===_0x5075('0x1a')&&typeof _0x4235cd[_0x5075('0x1b')]===_0x5075('0x1a');var _0x57fedb=_0x49ff22[_0x5075('0x1c')];var _0xc8b69a=_0x128a1b?0x0:_0x4235cd['offset'];var _0x2159a8=_0x128a1b?_0x49ff22[_0x5075('0x1c')]:_0x4235cd[_0x5075('0x19')]+_0x4235cd[_0x5075('0x1b')];var _0x53232c;if(_0x2159a8>=_0x57fedb){_0x2159a8=_0x57fedb;_0x53232c=0xc8;}else{_0x53232c=0xce;}_0x13e267[_0x5075('0x16')](_0x53232c);return _0x13e267['set'](_0x5075('0x1d'),_0xc8b69a+'-'+_0x2159a8+'/'+_0x57fedb)['json'](_0x49ff22);}return null;};}function patchUpdates(_0x17382e){return function(_0x545364){try{jsonpatch[_0x5075('0x1e')](_0x545364,_0x17382e,!![]);}catch(_0x4c65c7){return BPromise[_0x5075('0x1f')](_0x4c65c7);}return _0x545364[_0x5075('0x20')]();};}function saveUpdates(_0x5ea539,_0x530244){return function(_0x510d4e){if(_0x510d4e){return _0x510d4e[_0x5075('0x21')](_0x5ea539)[_0x5075('0x22')](function(_0xd48fad){return _0xd48fad;});}return null;};}function removeEntity(_0x396c08,_0x1d7758){return function(_0x4e2c16){if(_0x4e2c16){return _0x4e2c16[_0x5075('0x23')]()[_0x5075('0x22')](function(){_0x396c08[_0x5075('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f16cc,_0x212438){return function(_0x57fcb5){if(!_0x57fcb5){_0x1f16cc[_0x5075('0x15')](0x194);}return _0x57fcb5;};}function handleError(_0x3b178d,_0x1340ea){_0x1340ea=_0x1340ea||0x1f4;return function(_0x38a4ea){logger['error'](_0x38a4ea['stack']);if(_0x38a4ea['name']){delete _0x38a4ea[_0x5075('0x24')];}_0x3b178d[_0x5075('0x16')](_0x1340ea)['send'](_0x38a4ea);};}exports[_0x5075('0x25')]=function(_0x36dbf7,_0x444c06){var _0x4efb14={},_0x264777={},_0x514349={'count':0x0,'rows':[]};var _0x5d3a5c=_[_0x5075('0x26')](db[_0x5075('0x27')][_0x5075('0x28')],function(_0x1102cc){return{'name':_0x1102cc['fieldName'],'type':_0x1102cc[_0x5075('0x29')][_0x5075('0x2a')]};});_0x264777[_0x5075('0x2b')]=_['map'](_0x5d3a5c,_0x5075('0x24'));_0x264777[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x36dbf7[_0x5075('0x2c')]);_0x264777['filters']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],_0x264777[_0x5075('0x2c')]);_0x4efb14['attributes']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x36dbf7[_0x5075('0x2c')][_0x5075('0x2f')]));_0x4efb14['attributes']=_0x4efb14[_0x5075('0x30')][_0x5075('0x31')]?_0x4efb14['attributes']:_0x264777[_0x5075('0x2b')];if(!_0x36dbf7['query']['hasOwnProperty']('nolimit')){_0x4efb14[_0x5075('0x1b')]=qs[_0x5075('0x1b')](_0x36dbf7[_0x5075('0x2c')]['limit']);_0x4efb14[_0x5075('0x19')]=qs['offset'](_0x36dbf7['query'][_0x5075('0x19')]);}_0x4efb14['order']=qs[_0x5075('0x32')](_0x36dbf7[_0x5075('0x2c')]['sort']);_0x4efb14[_0x5075('0x33')]=qs[_0x5075('0x34')](_[_0x5075('0x35')](_0x36dbf7['query'],_0x264777[_0x5075('0x34')]),_0x5d3a5c);if(_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]){_0x4efb14[_0x5075('0x33')]=_[_0x5075('0x37')](_0x4efb14[_0x5075('0x33')],{'$or':_[_0x5075('0x26')](_0x5d3a5c,function(_0x1f230a){if(_0x1f230a[_0x5075('0x29')]!=='VIRTUAL'){var _0x4c9568={};_0x4c9568[_0x1f230a[_0x5075('0x24')]]={'$like':'%'+_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]+'%'};return _0x4c9568;}})});}_0x4efb14=_[_0x5075('0x37')]({},_0x4efb14,_0x36dbf7['options']);var _0x63b935={'where':_0x4efb14[_0x5075('0x33')]};return db[_0x5075('0x27')][_0x5075('0x1c')](_0x63b935)[_0x5075('0x22')](function(_0xbb29e8){_0x514349[_0x5075('0x1c')]=_0xbb29e8;if(_0x36dbf7['query']['includeAll']){_0x4efb14['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x5075('0x38')](_0x4efb14);})[_0x5075('0x22')](function(_0x12f169){_0x514349['rows']=_0x12f169;return _0x514349;})[_0x5075('0x22')](respondWithFilteredResult(_0x444c06,_0x4efb14))['catch'](handleError(_0x444c06,null));};exports[_0x5075('0x39')]=function(_0x1e5a34,_0x1f9165){var _0x2afa26={'raw':!![],'where':{'id':_0x1e5a34[_0x5075('0x3a')]['id']}},_0x42d4b4={};_0x42d4b4['model']=_[_0x5075('0x2d')](db[_0x5075('0x27')][_0x5075('0x28')]);_0x42d4b4[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x1e5a34['query']);_0x42d4b4[_0x5075('0x34')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],_0x42d4b4['query']);_0x2afa26[_0x5075('0x30')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x1e5a34[_0x5075('0x2c')][_0x5075('0x2f')]));_0x2afa26[_0x5075('0x30')]=_0x2afa26[_0x5075('0x30')][_0x5075('0x31')]?_0x2afa26[_0x5075('0x30')]:_0x42d4b4[_0x5075('0x2b')];if(_0x1e5a34[_0x5075('0x2c')][_0x5075('0x3b')]){_0x2afa26['include']=[{'all':!![]}];}_0x2afa26=_['merge']({},_0x2afa26,_0x1e5a34[_0x5075('0x3c')]);return db['ChatQueueReport']['find'](_0x2afa26)[_0x5075('0x22')](handleEntityNotFound(_0x1f9165,null))[_0x5075('0x22')](respondWithResult(_0x1f9165,null))[_0x5075('0x3d')](handleError(_0x1f9165,null));};exports['create']=function(_0x49b9a0,_0x35f55d){return db['ChatQueueReport'][_0x5075('0x3e')](_0x49b9a0['body'],{})['then'](respondWithResult(_0x35f55d,0xc9))[_0x5075('0x3d')](handleError(_0x35f55d,null));};exports[_0x5075('0x21')]=function(_0x137e67,_0x3cbcf5){if(_0x137e67['body']['id']){delete _0x137e67[_0x5075('0x3f')]['id'];}return db[_0x5075('0x27')][_0x5075('0x40')]({'where':{'id':_0x137e67[_0x5075('0x3a')]['id']}})[_0x5075('0x22')](handleEntityNotFound(_0x3cbcf5,null))[_0x5075('0x22')](saveUpdates(_0x137e67[_0x5075('0x3f')],null))['then'](respondWithResult(_0x3cbcf5,null))[_0x5075('0x3d')](handleError(_0x3cbcf5,null));};exports['destroy']=function(_0x4d386c,_0x4113e7){return db['ChatQueueReport']['find']({'where':{'id':_0x4d386c['params']['id']}})['then'](handleEntityNotFound(_0x4113e7,null))[_0x5075('0x22')](removeEntity(_0x4113e7,null))[_0x5075('0x3d')](handleError(_0x4113e7,null));};exports[_0x5075('0x41')]=function(_0x207329,_0x12c3a5){return db[_0x5075('0x27')]['describe']()[_0x5075('0x22')](respondWithResult(_0x12c3a5,null))[_0x5075('0x3d')](handleError(_0x12c3a5,null));}; \ No newline at end of file +var _0x600f=['map','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key'];(function(_0x1127b6,_0x1af770){var _0x36d856=function(_0x54a28b){while(--_0x54a28b){_0x1127b6['push'](_0x1127b6['shift']());}};_0x36d856(++_0x1af770);}(_0x600f,0xb4));var _0xf600=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x600f[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xf600('0x0'));var rimraf=require(_0xf600('0x1'));var zipdir=require(_0xf600('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf600('0x3'));var moment=require('moment');var BPromise=require(_0xf600('0x4'));var Mustache=require(_0xf600('0x5'));var util=require(_0xf600('0x6'));var path=require(_0xf600('0x7'));var sox=require(_0xf600('0x8'));var csv=require(_0xf600('0x9'));var ejs=require(_0xf600('0xa'));var fs=require('fs');var fs_extra=require(_0xf600('0xb'));var _=require('lodash');var squel=require(_0xf600('0xc'));var crypto=require('crypto');var jsforce=require(_0xf600('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf600('0x9'));var querystring=require(_0xf600('0xe'));var Papa=require(_0xf600('0xf'));var Redis=require(_0xf600('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf600('0x11'));var as=require(_0xf600('0x12'));var hardwareService=require(_0xf600('0x13'));var logger=require(_0xf600('0x14'))('api');var utils=require(_0xf600('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf600('0x16'));var db=require(_0xf600('0x17'))['db'];function respondWithStatusCode(_0xe45a38,_0x436d6d){_0x436d6d=_0x436d6d||0xcc;return function(_0xc0ca75){if(_0xc0ca75){return _0xe45a38[_0xf600('0x18')](_0x436d6d);}return _0xe45a38[_0xf600('0x19')](_0x436d6d)[_0xf600('0x1a')]();};}function respondWithResult(_0x4cec23,_0x336ec5){_0x336ec5=_0x336ec5||0xc8;return function(_0x1f8f1e){if(_0x1f8f1e){return _0x4cec23[_0xf600('0x19')](_0x336ec5)['json'](_0x1f8f1e);}};}function respondWithFilteredResult(_0x265c6a,_0x5cd205){return function(_0x4ae962){if(_0x4ae962){var _0x20d9c3=typeof _0x5cd205[_0xf600('0x1b')]===_0xf600('0x1c')&&typeof _0x5cd205[_0xf600('0x1d')]===_0xf600('0x1c');var _0x506667=_0x4ae962[_0xf600('0x1e')];var _0x1e4efa=_0x20d9c3?0x0:_0x5cd205[_0xf600('0x1b')];var _0x2c9a76=_0x20d9c3?_0x4ae962[_0xf600('0x1e')]:_0x5cd205[_0xf600('0x1b')]+_0x5cd205[_0xf600('0x1d')];var _0x5f488c;if(_0x2c9a76>=_0x506667){_0x2c9a76=_0x506667;_0x5f488c=0xc8;}else{_0x5f488c=0xce;}_0x265c6a[_0xf600('0x19')](_0x5f488c);return _0x265c6a['set'](_0xf600('0x1f'),_0x1e4efa+'-'+_0x2c9a76+'/'+_0x506667)[_0xf600('0x20')](_0x4ae962);}return null;};}function patchUpdates(_0x287e86){return function(_0x2dc1ca){try{jsonpatch[_0xf600('0x21')](_0x2dc1ca,_0x287e86,!![]);}catch(_0x4968c7){return BPromise[_0xf600('0x22')](_0x4968c7);}return _0x2dc1ca[_0xf600('0x23')]();};}function saveUpdates(_0x1a5856,_0x328a9b){return function(_0x4083c5){if(_0x4083c5){return _0x4083c5[_0xf600('0x24')](_0x1a5856)[_0xf600('0x25')](function(_0x74a9de){return _0x74a9de;});}return null;};}function removeEntity(_0x2c066f,_0x259a3c){return function(_0x5ab4fe){if(_0x5ab4fe){return _0x5ab4fe['destroy']()['then'](function(){_0x2c066f[_0xf600('0x19')](0xcc)[_0xf600('0x1a')]();});}};}function handleEntityNotFound(_0xf5299c,_0x1bce6e){return function(_0x368fdc){if(!_0x368fdc){_0xf5299c[_0xf600('0x18')](0x194);}return _0x368fdc;};}function handleError(_0x201f15,_0x114c24){_0x114c24=_0x114c24||0x1f4;return function(_0x16d5bc){logger[_0xf600('0x26')](_0x16d5bc[_0xf600('0x27')]);if(_0x16d5bc[_0xf600('0x28')]){delete _0x16d5bc[_0xf600('0x28')];}_0x201f15[_0xf600('0x19')](_0x114c24)[_0xf600('0x29')](_0x16d5bc);};}exports[_0xf600('0x2a')]=function(_0xc59f05,_0x34e21e){var _0xff79a1={},_0x474e2c={},_0x59471b={'count':0x0,'rows':[]};var _0x2ae37b=_['map'](db[_0xf600('0x2b')][_0xf600('0x2c')],function(_0x2913a0){return{'name':_0x2913a0[_0xf600('0x2d')],'type':_0x2913a0[_0xf600('0x2e')][_0xf600('0x2f')]};});_0x474e2c['model']=_[_0xf600('0x30')](_0x2ae37b,_0xf600('0x28'));_0x474e2c[_0xf600('0x31')]=_[_0xf600('0x32')](_0xc59f05[_0xf600('0x31')]);_0x474e2c[_0xf600('0x33')]=_['intersection'](_0x474e2c[_0xf600('0x34')],_0x474e2c[_0xf600('0x31')]);_0xff79a1['attributes']=_['intersection'](_0x474e2c[_0xf600('0x34')],qs[_0xf600('0x35')](_0xc59f05[_0xf600('0x31')][_0xf600('0x35')]));_0xff79a1[_0xf600('0x36')]=_0xff79a1[_0xf600('0x36')]['length']?_0xff79a1[_0xf600('0x36')]:_0x474e2c[_0xf600('0x34')];if(!_0xc59f05[_0xf600('0x31')][_0xf600('0x37')](_0xf600('0x38'))){_0xff79a1[_0xf600('0x1d')]=qs[_0xf600('0x1d')](_0xc59f05['query'][_0xf600('0x1d')]);_0xff79a1[_0xf600('0x1b')]=qs[_0xf600('0x1b')](_0xc59f05[_0xf600('0x31')][_0xf600('0x1b')]);}_0xff79a1[_0xf600('0x39')]=qs[_0xf600('0x3a')](_0xc59f05[_0xf600('0x31')][_0xf600('0x3a')]);_0xff79a1['where']=qs[_0xf600('0x33')](_['pick'](_0xc59f05[_0xf600('0x31')],_0x474e2c[_0xf600('0x33')]),_0x2ae37b);if(_0xc59f05[_0xf600('0x31')]['filter']){_0xff79a1['where']=_[_0xf600('0x3b')](_0xff79a1[_0xf600('0x3c')],{'$or':_[_0xf600('0x30')](_0x2ae37b,function(_0x4cdd33){if(_0x4cdd33[_0xf600('0x2e')]!==_0xf600('0x3d')){var _0xa3991b={};_0xa3991b[_0x4cdd33['name']]={'$like':'%'+_0xc59f05[_0xf600('0x31')]['filter']+'%'};return _0xa3991b;}})});}_0xff79a1=_['merge']({},_0xff79a1,_0xc59f05[_0xf600('0x3e')]);var _0x2f15fc={'where':_0xff79a1['where']};return db[_0xf600('0x2b')]['count'](_0x2f15fc)[_0xf600('0x25')](function(_0x4e62aa){_0x59471b[_0xf600('0x1e')]=_0x4e62aa;if(_0xc59f05['query'][_0xf600('0x3f')]){_0xff79a1[_0xf600('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xf600('0x41')](_0xff79a1);})[_0xf600('0x25')](function(_0x7753ae){_0x59471b['rows']=_0x7753ae;return _0x59471b;})[_0xf600('0x25')](respondWithFilteredResult(_0x34e21e,_0xff79a1))[_0xf600('0x42')](handleError(_0x34e21e,null));};exports[_0xf600('0x43')]=function(_0x1dc952,_0xf0b240){var _0x210af4={'raw':!![],'where':{'id':_0x1dc952[_0xf600('0x44')]['id']}},_0x5420df={};_0x5420df[_0xf600('0x34')]=_[_0xf600('0x32')](db['ChatQueueReport'][_0xf600('0x2c')]);_0x5420df['query']=_[_0xf600('0x32')](_0x1dc952['query']);_0x5420df[_0xf600('0x33')]=_[_0xf600('0x45')](_0x5420df['model'],_0x5420df[_0xf600('0x31')]);_0x210af4[_0xf600('0x36')]=_['intersection'](_0x5420df['model'],qs[_0xf600('0x35')](_0x1dc952[_0xf600('0x31')][_0xf600('0x35')]));_0x210af4['attributes']=_0x210af4[_0xf600('0x36')][_0xf600('0x46')]?_0x210af4[_0xf600('0x36')]:_0x5420df['model'];if(_0x1dc952[_0xf600('0x31')][_0xf600('0x3f')]){_0x210af4['include']=[{'all':!![]}];}_0x210af4=_[_0xf600('0x3b')]({},_0x210af4,_0x1dc952[_0xf600('0x3e')]);return db[_0xf600('0x2b')]['find'](_0x210af4)[_0xf600('0x25')](handleEntityNotFound(_0xf0b240,null))[_0xf600('0x25')](respondWithResult(_0xf0b240,null))[_0xf600('0x42')](handleError(_0xf0b240,null));};exports[_0xf600('0x47')]=function(_0x4dbfe5,_0x3cff2f){return db[_0xf600('0x2b')][_0xf600('0x47')](_0x4dbfe5[_0xf600('0x48')],{})[_0xf600('0x25')](respondWithResult(_0x3cff2f,0xc9))[_0xf600('0x42')](handleError(_0x3cff2f,null));};exports[_0xf600('0x24')]=function(_0x549b09,_0xb0453e){if(_0x549b09[_0xf600('0x48')]['id']){delete _0x549b09['body']['id'];}return db['ChatQueueReport'][_0xf600('0x49')]({'where':{'id':_0x549b09[_0xf600('0x44')]['id']}})[_0xf600('0x25')](handleEntityNotFound(_0xb0453e,null))[_0xf600('0x25')](saveUpdates(_0x549b09['body'],null))[_0xf600('0x25')](respondWithResult(_0xb0453e,null))[_0xf600('0x42')](handleError(_0xb0453e,null));};exports[_0xf600('0x4a')]=function(_0x5e8c0d,_0x233b83){return db[_0xf600('0x2b')]['find']({'where':{'id':_0x5e8c0d['params']['id']}})['then'](handleEntityNotFound(_0x233b83,null))[_0xf600('0x25')](removeEntity(_0x233b83,null))[_0xf600('0x42')](handleError(_0x233b83,null));};exports[_0xf600('0x4b')]=function(_0x3c6ff3,_0x255e00){return db[_0xf600('0x2b')][_0xf600('0x4b')]()[_0xf600('0x25')](respondWithResult(_0x255e00,null))['catch'](handleError(_0x255e00,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f0b6598..5734433 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0xe706,0xa3));var _0x6e70=function(_0xf7fb0c,_0x2f198b){_0xf7fb0c=_0xf7fb0c-0x0;var _0x31545c=_0xe706[_0xf7fb0c];return _0x31545c;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 090bae9..e684864 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 _0xcea5=['update','where','attributes','limit','UpdateChatQueueReport','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','create','body','options','raw','CreateChatQueueReport','stringify','catch'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0xcea5,0x1a9));var _0x5cea=function(_0x108702,_0x14cb3d){_0x108702=_0x108702-0x0;var _0x1ee29f=_0xcea5[_0x108702];return _0x1ee29f;};'use strict';var _=require(_0x5cea('0x0'));var util=require('util');var moment=require(_0x5cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x5cea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cea('0x3'))['db'];var utils=require(_0x5cea('0x4'));var logger=require(_0x5cea('0x5'))('rpc');var config=require(_0x5cea('0x6'));var jayson=require(_0x5cea('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44b156,_0x2d8d6a,_0x19d73f){return new BPromise(function(_0x57f80e,_0x5e83ff){return client[_0x5cea('0x8')](_0x44b156,_0x19d73f)['then'](function(_0x5c3e17){logger[_0x5cea('0x9')](_0x5cea('0xa'),_0x2d8d6a,_0x5cea('0xb'));logger[_0x5cea('0xc')](_0x5cea('0xd'),_0x2d8d6a,_0x5cea('0xb'),JSON['stringify'](_0x5c3e17));if(_0x5c3e17[_0x5cea('0xe')]){if(_0x5c3e17[_0x5cea('0xe')]['code']===0x1f4){logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x5c3e17['error'][_0x5cea('0xf')]);return _0x5e83ff(_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);}logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);return _0x57f80e(_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);}else{logger[_0x5cea('0x9')](_0x5cea('0xa'),_0x2d8d6a,_0x5cea('0xb'));_0x57f80e(_0x5c3e17['result']['message']);}})['catch'](function(_0x4a0be6){logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x4a0be6);_0x5e83ff(_0x4a0be6);});});}exports['CreateChatQueueReport']=function(_0x32ac32){var _0x1575c9=this;return new Promise(function(_0x5f3bcf,_0x228a1f){return db['ChatQueueReport'][_0x5cea('0x10')](_0x32ac32[_0x5cea('0x11')],{'raw':_0x32ac32[_0x5cea('0x12')]?_0x32ac32[_0x5cea('0x12')][_0x5cea('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x203c9a){logger[_0x5cea('0x9')](_0x5cea('0x14'),_0x32ac32);logger[_0x5cea('0xc')]('CreateChatQueueReport',_0x32ac32,JSON[_0x5cea('0x15')](_0x203c9a));_0x5f3bcf(_0x203c9a);})[_0x5cea('0x16')](function(_0x545735){logger['error'](_0x5cea('0x14'),_0x545735['message'],_0x32ac32);_0x228a1f(_0x1575c9['error'](0x1f4,_0x545735[_0x5cea('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0xe3b859){var _0x313b60=this;return new Promise(function(_0x47f4f3,_0xb58feb){return db['ChatQueueReport'][_0x5cea('0x17')](_0xe3b859[_0x5cea('0x11')],{'raw':_0xe3b859[_0x5cea('0x12')]?_0xe3b859[_0x5cea('0x12')][_0x5cea('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe3b859[_0x5cea('0x12')]?_0xe3b859['options'][_0x5cea('0x18')]||null:null,'attributes':_0xe3b859['options']?_0xe3b859[_0x5cea('0x12')][_0x5cea('0x19')]||null:null,'limit':_0xe3b859[_0x5cea('0x12')]?_0xe3b859[_0x5cea('0x12')][_0x5cea('0x1a')]||null:null})['then'](function(_0x1b1e8f){logger[_0x5cea('0x9')](_0x5cea('0x1b'),_0xe3b859);logger[_0x5cea('0xc')](_0x5cea('0x1b'),_0xe3b859,JSON['stringify'](_0x1b1e8f));_0x47f4f3(_0x1b1e8f);})[_0x5cea('0x16')](function(_0x159b85){logger[_0x5cea('0xe')](_0x5cea('0x1b'),_0x159b85[_0x5cea('0xf')],_0xe3b859);_0xb58feb(_0x313b60[_0x5cea('0xe')](0x1f4,_0x159b85[_0x5cea('0xf')]));});});}; \ No newline at end of file +var _0xfcd9=['body','where','attributes','limit','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','stringify','UpdateChatQueueReport'];(function(_0x10e2c9,_0x489aab){var _0x426947=function(_0x123624){while(--_0x123624){_0x10e2c9['push'](_0x10e2c9['shift']());}};_0x426947(++_0x489aab);}(_0xfcd9,0xd6));var _0x9fcd=function(_0x2035ef,_0x3f7d39){_0x2035ef=_0x2035ef-0x0;var _0x86c909=_0xfcd9[_0x2035ef];return _0x86c909;};'use strict';var _=require('lodash');var util=require(_0x9fcd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9fcd('0x1'));var fs=require('fs');var Redis=require(_0x9fcd('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9fcd('0x3'))(_0x9fcd('0x4'));var config=require(_0x9fcd('0x5'));var jayson=require(_0x9fcd('0x6'));var client=jayson[_0x9fcd('0x7')][_0x9fcd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2887c5,_0x4bbd46,_0x16db96){return new BPromise(function(_0x366fcd,_0x207170){return client[_0x9fcd('0x9')](_0x2887c5,_0x16db96)[_0x9fcd('0xa')](function(_0x172190){logger[_0x9fcd('0xb')](_0x9fcd('0xc'),_0x4bbd46,_0x9fcd('0xd'));logger[_0x9fcd('0xe')](_0x9fcd('0xf'),_0x4bbd46,_0x9fcd('0xd'),JSON['stringify'](_0x172190));if(_0x172190[_0x9fcd('0x10')]){if(_0x172190[_0x9fcd('0x10')]['code']===0x1f4){logger[_0x9fcd('0x10')](_0x9fcd('0xc'),_0x4bbd46,_0x172190[_0x9fcd('0x10')][_0x9fcd('0x11')]);return _0x207170(_0x172190['error'][_0x9fcd('0x11')]);}logger['error'](_0x9fcd('0xc'),_0x4bbd46,_0x172190['error'][_0x9fcd('0x11')]);return _0x366fcd(_0x172190[_0x9fcd('0x10')][_0x9fcd('0x11')]);}else{logger[_0x9fcd('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x4bbd46,'request\x20sent');_0x366fcd(_0x172190['result']['message']);}})[_0x9fcd('0x12')](function(_0xdfcae){logger[_0x9fcd('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x4bbd46,_0xdfcae);_0x207170(_0xdfcae);});});}exports[_0x9fcd('0x13')]=function(_0x500c84){var _0x12e45f=this;return new Promise(function(_0x5d7342,_0x1ffb07){return db[_0x9fcd('0x14')][_0x9fcd('0x15')](_0x500c84['body'],{'raw':_0x500c84[_0x9fcd('0x16')]?_0x500c84[_0x9fcd('0x16')][_0x9fcd('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x22b477){logger[_0x9fcd('0xb')](_0x9fcd('0x13'),_0x500c84);logger[_0x9fcd('0xe')](_0x9fcd('0x13'),_0x500c84,JSON[_0x9fcd('0x18')](_0x22b477));_0x5d7342(_0x22b477);})['catch'](function(_0x46d633){logger[_0x9fcd('0x10')](_0x9fcd('0x13'),_0x46d633['message'],_0x500c84);_0x1ffb07(_0x12e45f[_0x9fcd('0x10')](0x1f4,_0x46d633[_0x9fcd('0x11')]));});});};exports[_0x9fcd('0x19')]=function(_0x598198){var _0x4d9dfb=this;return new Promise(function(_0x2e8f02,_0x4280be){return db[_0x9fcd('0x14')]['update'](_0x598198[_0x9fcd('0x1a')],{'raw':_0x598198[_0x9fcd('0x16')]?_0x598198[_0x9fcd('0x16')][_0x9fcd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x598198[_0x9fcd('0x16')]?_0x598198[_0x9fcd('0x16')][_0x9fcd('0x1b')]||null:null,'attributes':_0x598198['options']?_0x598198[_0x9fcd('0x16')][_0x9fcd('0x1c')]||null:null,'limit':_0x598198['options']?_0x598198[_0x9fcd('0x16')][_0x9fcd('0x1d')]||null:null})[_0x9fcd('0xa')](function(_0x1db79d){logger[_0x9fcd('0xb')](_0x9fcd('0x19'),_0x598198);logger[_0x9fcd('0xe')]('UpdateChatQueueReport',_0x598198,JSON['stringify'](_0x1db79d));_0x2e8f02(_0x1db79d);})['catch'](function(_0xcb1892){logger[_0x9fcd('0x10')](_0x9fcd('0x19'),_0xcb1892[_0x9fcd('0x11')],_0x598198);_0x4280be(_0x4d9dfb[_0x9fcd('0x10')](0x1f4,_0xcb1892['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8f63ede..05e9ac5 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 _0x0842=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy'];(function(_0x1296ac,_0x4882bb){var _0x5ba9f6=function(_0x3bed8c){while(--_0x3bed8c){_0x1296ac['push'](_0x1296ac['shift']());}};_0x5ba9f6(++_0x4882bb);}(_0x0842,0x18d));var _0x2084=function(_0x5017cf,_0x22e92c){_0x5017cf=_0x5017cf-0x0;var _0x4df0af=_0x0842[_0x5017cf];return _0x4df0af;};'use strict';var multer=require(_0x2084('0x0'));var util=require(_0x2084('0x1'));var path=require(_0x2084('0x2'));var timeout=require(_0x2084('0x3'));var express=require(_0x2084('0x4'));var router=express[_0x2084('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2084('0x6'));var interaction=require(_0x2084('0x7'));var config=require(_0x2084('0x8'));var controller=require(_0x2084('0x9'));router[_0x2084('0xa')]('/',auth[_0x2084('0xb')](),controller[_0x2084('0xc')]);router['get'](_0x2084('0xd'),auth['isAuthenticated'](),controller[_0x2084('0xe')]);router[_0x2084('0xa')](_0x2084('0xf'),auth[_0x2084('0xb')](),controller['show']);router['post']('/',auth[_0x2084('0xb')](),controller[_0x2084('0x10')]);router[_0x2084('0x11')](_0x2084('0xf'),auth[_0x2084('0xb')](),controller[_0x2084('0x12')]);router[_0x2084('0x13')](_0x2084('0xf'),auth[_0x2084('0xb')](),controller[_0x2084('0x14')]);module[_0x2084('0x15')]=router; \ No newline at end of file +var _0x1377=['./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37772b,_0x1e9c1d){var _0x154797=function(_0x24e9e3){while(--_0x24e9e3){_0x37772b['push'](_0x37772b['shift']());}};_0x154797(++_0x1e9c1d);}(_0x1377,0x198));var _0x7137=function(_0x49ad8b,_0xd97f58){_0x49ad8b=_0x49ad8b-0x0;var _0x54a965=_0x1377[_0x49ad8b];return _0x54a965;};'use strict';var multer=require(_0x7137('0x0'));var util=require(_0x7137('0x1'));var path=require(_0x7137('0x2'));var timeout=require(_0x7137('0x3'));var express=require(_0x7137('0x4'));var router=express[_0x7137('0x5')]();var fs_extra=require(_0x7137('0x6'));var auth=require(_0x7137('0x7'));var interaction=require(_0x7137('0x8'));var config=require(_0x7137('0x9'));var controller=require(_0x7137('0xa'));router[_0x7137('0xb')]('/',auth['isAuthenticated'](),controller[_0x7137('0xc')]);router[_0x7137('0xb')](_0x7137('0xd'),auth[_0x7137('0xe')](),controller[_0x7137('0xf')]);router[_0x7137('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7137('0x10')]('/',auth[_0x7137('0xe')](),controller['create']);router['put'](_0x7137('0x11'),auth[_0x7137('0xe')](),controller[_0x7137('0x12')]);router[_0x7137('0x13')](_0x7137('0x11'),auth[_0x7137('0xe')](),controller[_0x7137('0x14')]);module[_0x7137('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 3190726..c3c612f 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xa103cd,_0x4c7ef6){var _0x19eafc=function(_0x32d57c){while(--_0x32d57c){_0xa103cd['push'](_0xa103cd['shift']());}};_0x19eafc(++_0x4c7ef6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xcb91[_0x27c068];return _0xe5a67f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x45b170,_0x31adc7){var _0x36ee11=function(_0x2b024){while(--_0x2b024){_0x45b170['push'](_0x45b170['shift']());}};_0x36ee11(++_0x31adc7);}(_0xedd9,0xfc));var _0x9edd=function(_0x4afd61,_0x10dfd9){_0x4afd61=_0x4afd61-0x0;var _0xcb0190=_0xedd9[_0x4afd61];return _0xcb0190;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index b945bf4..dfd6727 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 _0x7081=['count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','length','catch','create','update','find','params','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x46e9f2,_0xb8c5f9){var _0x2ff437=function(_0x231e71){while(--_0x231e71){_0x46e9f2['push'](_0x46e9f2['shift']());}};_0x2ff437(++_0xb8c5f9);}(_0x7081,0x1b0));var _0x1708=function(_0x3cb41d,_0x2d7f6d){_0x3cb41d=_0x3cb41d-0x0;var _0x4dc372=_0x7081[_0x3cb41d];return _0x4dc372;};'use strict';var emlformat=require(_0x1708('0x0'));var rimraf=require(_0x1708('0x1'));var zipdir=require(_0x1708('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1708('0x3'));var moment=require(_0x1708('0x4'));var BPromise=require(_0x1708('0x5'));var Mustache=require(_0x1708('0x6'));var util=require(_0x1708('0x7'));var path=require(_0x1708('0x8'));var sox=require(_0x1708('0x9'));var csv=require(_0x1708('0xa'));var ejs=require(_0x1708('0xb'));var fs=require('fs');var fs_extra=require(_0x1708('0xc'));var _=require(_0x1708('0xd'));var squel=require(_0x1708('0xe'));var crypto=require(_0x1708('0xf'));var jsforce=require(_0x1708('0x10'));var deskjs=require(_0x1708('0x11'));var toCsv=require(_0x1708('0xa'));var querystring=require(_0x1708('0x12'));var Papa=require(_0x1708('0x13'));var Redis=require(_0x1708('0x14'));var authService=require(_0x1708('0x15'));var qs=require(_0x1708('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1708('0x17'));var logger=require(_0x1708('0x18'))(_0x1708('0x19'));var utils=require(_0x1708('0x1a'));var config=require(_0x1708('0x1b'));var licenseUtil=require(_0x1708('0x1c'));var db=require(_0x1708('0x1d'))['db'];function respondWithStatusCode(_0x2aa92b,_0x49119e){_0x49119e=_0x49119e||0xcc;return function(_0x24e49d){if(_0x24e49d){return _0x2aa92b[_0x1708('0x1e')](_0x49119e);}return _0x2aa92b[_0x1708('0x1f')](_0x49119e)[_0x1708('0x20')]();};}function respondWithResult(_0x3a3803,_0x58db99){_0x58db99=_0x58db99||0xc8;return function(_0x3e3475){if(_0x3e3475){return _0x3a3803[_0x1708('0x1f')](_0x58db99)[_0x1708('0x21')](_0x3e3475);}};}function respondWithFilteredResult(_0x4641ab,_0x4b2fdb){return function(_0x44e42c){if(_0x44e42c){var _0x3d6c49=typeof _0x4b2fdb[_0x1708('0x22')]===_0x1708('0x23')&&typeof _0x4b2fdb['limit']===_0x1708('0x23');var _0x9fe0de=_0x44e42c[_0x1708('0x24')];var _0x35ac0f=_0x3d6c49?0x0:_0x4b2fdb[_0x1708('0x22')];var _0x9a66ee=_0x3d6c49?_0x44e42c[_0x1708('0x24')]:_0x4b2fdb[_0x1708('0x22')]+_0x4b2fdb[_0x1708('0x25')];var _0x17e8bc;if(_0x9a66ee>=_0x9fe0de){_0x9a66ee=_0x9fe0de;_0x17e8bc=0xc8;}else{_0x17e8bc=0xce;}_0x4641ab[_0x1708('0x1f')](_0x17e8bc);return _0x4641ab[_0x1708('0x26')](_0x1708('0x27'),_0x35ac0f+'-'+_0x9a66ee+'/'+_0x9fe0de)[_0x1708('0x21')](_0x44e42c);}return null;};}function patchUpdates(_0x3c9290){return function(_0x5e23e4){try{jsonpatch[_0x1708('0x28')](_0x5e23e4,_0x3c9290,!![]);}catch(_0x2636d2){return BPromise[_0x1708('0x29')](_0x2636d2);}return _0x5e23e4[_0x1708('0x2a')]();};}function saveUpdates(_0x56894c,_0x31f4b4){return function(_0x4b74f0){if(_0x4b74f0){return _0x4b74f0['update'](_0x56894c)[_0x1708('0x2b')](function(_0x167105){return _0x167105;});}return null;};}function removeEntity(_0xf27153,_0x31a2d0){return function(_0x213fcf){if(_0x213fcf){return _0x213fcf[_0x1708('0x2c')]()[_0x1708('0x2b')](function(){_0xf27153[_0x1708('0x1f')](0xcc)[_0x1708('0x20')]();});}};}function handleEntityNotFound(_0x4e6a26,_0x55a2f5){return function(_0x43b557){if(!_0x43b557){_0x4e6a26[_0x1708('0x1e')](0x194);}return _0x43b557;};}function handleError(_0x2810f1,_0xff4709){_0xff4709=_0xff4709||0x1f4;return function(_0x403295){logger[_0x1708('0x2d')](_0x403295[_0x1708('0x2e')]);if(_0x403295['name']){delete _0x403295[_0x1708('0x2f')];}_0x2810f1[_0x1708('0x1f')](_0xff4709)[_0x1708('0x30')](_0x403295);};}exports['index']=function(_0x1ca7ef,_0x24527a){var _0x15b4c7={},_0x4c8c30={},_0x43be32={'count':0x0,'rows':[]};var _0x4589c3=_[_0x1708('0x31')](db[_0x1708('0x32')][_0x1708('0x33')],function(_0x3c04f0){return{'name':_0x3c04f0['fieldName'],'type':_0x3c04f0[_0x1708('0x34')][_0x1708('0x35')]};});_0x4c8c30[_0x1708('0x36')]=_[_0x1708('0x31')](_0x4589c3,_0x1708('0x2f'));_0x4c8c30['query']=_[_0x1708('0x37')](_0x1ca7ef[_0x1708('0x38')]);_0x4c8c30[_0x1708('0x39')]=_[_0x1708('0x3a')](_0x4c8c30[_0x1708('0x36')],_0x4c8c30[_0x1708('0x38')]);_0x15b4c7[_0x1708('0x3b')]=_[_0x1708('0x3a')](_0x4c8c30[_0x1708('0x36')],qs[_0x1708('0x3c')](_0x1ca7ef[_0x1708('0x38')][_0x1708('0x3c')]));_0x15b4c7[_0x1708('0x3b')]=_0x15b4c7[_0x1708('0x3b')]['length']?_0x15b4c7[_0x1708('0x3b')]:_0x4c8c30[_0x1708('0x36')];if(!_0x1ca7ef[_0x1708('0x38')]['hasOwnProperty'](_0x1708('0x3d'))){_0x15b4c7['limit']=qs['limit'](_0x1ca7ef[_0x1708('0x38')]['limit']);_0x15b4c7[_0x1708('0x22')]=qs[_0x1708('0x22')](_0x1ca7ef[_0x1708('0x38')]['offset']);}_0x15b4c7[_0x1708('0x3e')]=qs[_0x1708('0x3f')](_0x1ca7ef[_0x1708('0x38')][_0x1708('0x3f')]);_0x15b4c7[_0x1708('0x40')]=qs[_0x1708('0x39')](_['pick'](_0x1ca7ef[_0x1708('0x38')],_0x4c8c30['filters']),_0x4589c3);if(_0x1ca7ef[_0x1708('0x38')][_0x1708('0x41')]){_0x15b4c7['where']=_['merge'](_0x15b4c7[_0x1708('0x40')],{'$or':_[_0x1708('0x31')](_0x4589c3,function(_0x1f4949){if(_0x1f4949[_0x1708('0x34')]!==_0x1708('0x42')){var _0x36f09b={};_0x36f09b[_0x1f4949[_0x1708('0x2f')]]={'$like':'%'+_0x1ca7ef[_0x1708('0x38')][_0x1708('0x41')]+'%'};return _0x36f09b;}})});}_0x15b4c7=_[_0x1708('0x43')]({},_0x15b4c7,_0x1ca7ef['options']);var _0x5074cd={'where':_0x15b4c7[_0x1708('0x40')]};return db['ChatTransferReport'][_0x1708('0x24')](_0x5074cd)[_0x1708('0x2b')](function(_0x519604){_0x43be32[_0x1708('0x24')]=_0x519604;if(_0x1ca7ef[_0x1708('0x38')][_0x1708('0x44')]){_0x15b4c7[_0x1708('0x45')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x15b4c7);})[_0x1708('0x2b')](function(_0x44a306){_0x43be32['rows']=_0x44a306;return _0x43be32;})[_0x1708('0x2b')](respondWithFilteredResult(_0x24527a,_0x15b4c7))['catch'](handleError(_0x24527a,null));};exports['show']=function(_0x928f6d,_0x56e64f){var _0x2b9131={'raw':!![],'where':{'id':_0x928f6d['params']['id']}},_0x1ba296={};_0x1ba296[_0x1708('0x36')]=_[_0x1708('0x37')](db[_0x1708('0x32')][_0x1708('0x33')]);_0x1ba296[_0x1708('0x38')]=_[_0x1708('0x37')](_0x928f6d[_0x1708('0x38')]);_0x1ba296['filters']=_[_0x1708('0x3a')](_0x1ba296[_0x1708('0x36')],_0x1ba296[_0x1708('0x38')]);_0x2b9131[_0x1708('0x3b')]=_[_0x1708('0x3a')](_0x1ba296[_0x1708('0x36')],qs[_0x1708('0x3c')](_0x928f6d[_0x1708('0x38')]['fields']));_0x2b9131[_0x1708('0x3b')]=_0x2b9131[_0x1708('0x3b')][_0x1708('0x46')]?_0x2b9131[_0x1708('0x3b')]:_0x1ba296['model'];if(_0x928f6d[_0x1708('0x38')][_0x1708('0x44')]){_0x2b9131[_0x1708('0x45')]=[{'all':!![]}];}_0x2b9131=_[_0x1708('0x43')]({},_0x2b9131,_0x928f6d['options']);return db[_0x1708('0x32')]['find'](_0x2b9131)[_0x1708('0x2b')](handleEntityNotFound(_0x56e64f,null))[_0x1708('0x2b')](respondWithResult(_0x56e64f,null))[_0x1708('0x47')](handleError(_0x56e64f,null));};exports[_0x1708('0x48')]=function(_0x171eed,_0x210aae){return db[_0x1708('0x32')][_0x1708('0x48')](_0x171eed['body'],{})[_0x1708('0x2b')](respondWithResult(_0x210aae,0xc9))['catch'](handleError(_0x210aae,null));};exports[_0x1708('0x49')]=function(_0x44f60e,_0x125498){if(_0x44f60e['body']['id']){delete _0x44f60e['body']['id'];}return db[_0x1708('0x32')][_0x1708('0x4a')]({'where':{'id':_0x44f60e[_0x1708('0x4b')]['id']}})[_0x1708('0x2b')](handleEntityNotFound(_0x125498,null))[_0x1708('0x2b')](saveUpdates(_0x44f60e[_0x1708('0x4c')],null))[_0x1708('0x2b')](respondWithResult(_0x125498,null))[_0x1708('0x47')](handleError(_0x125498,null));};exports['destroy']=function(_0x4d19bc,_0x3fa49c){return db['ChatTransferReport'][_0x1708('0x4a')]({'where':{'id':_0x4d19bc[_0x1708('0x4b')]['id']}})[_0x1708('0x2b')](handleEntityNotFound(_0x3fa49c,null))[_0x1708('0x2b')](removeEntity(_0x3fa49c,null))['catch'](handleError(_0x3fa49c,null));};exports[_0x1708('0x4d')]=function(_0x225ed1,_0x199ec0){return db['ChatTransferReport']['describe']()[_0x1708('0x2b')](respondWithResult(_0x199ec0,null))[_0x1708('0x47')](handleError(_0x199ec0,null));}; \ No newline at end of file +var _0xea56=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','options','includeAll','include','catch','params','fields','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x5300d2,_0x447cd2){var _0x595ac4=function(_0x289a0b){while(--_0x289a0b){_0x5300d2['push'](_0x5300d2['shift']());}};_0x595ac4(++_0x447cd2);}(_0xea56,0xd4));var _0x6ea5=function(_0x82305a,_0x46a9fb){_0x82305a=_0x82305a-0x0;var _0x5b57e6=_0xea56[_0x82305a];return _0x5b57e6;};'use strict';var emlformat=require(_0x6ea5('0x0'));var rimraf=require(_0x6ea5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ea5('0x2'));var rp=require(_0x6ea5('0x3'));var moment=require(_0x6ea5('0x4'));var BPromise=require(_0x6ea5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ea5('0x6'));var sox=require(_0x6ea5('0x7'));var csv=require(_0x6ea5('0x8'));var ejs=require(_0x6ea5('0x9'));var fs=require('fs');var fs_extra=require(_0x6ea5('0xa'));var _=require(_0x6ea5('0xb'));var squel=require(_0x6ea5('0xc'));var crypto=require(_0x6ea5('0xd'));var jsforce=require(_0x6ea5('0xe'));var deskjs=require(_0x6ea5('0xf'));var toCsv=require(_0x6ea5('0x8'));var querystring=require('querystring');var Papa=require(_0x6ea5('0x10'));var Redis=require('ioredis');var authService=require(_0x6ea5('0x11'));var qs=require(_0x6ea5('0x12'));var as=require(_0x6ea5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ea5('0x14'))(_0x6ea5('0x15'));var utils=require(_0x6ea5('0x16'));var config=require(_0x6ea5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ea5('0x18'))['db'];function respondWithStatusCode(_0x5e2564,_0x17c8b9){_0x17c8b9=_0x17c8b9||0xcc;return function(_0x11a7c2){if(_0x11a7c2){return _0x5e2564[_0x6ea5('0x19')](_0x17c8b9);}return _0x5e2564[_0x6ea5('0x1a')](_0x17c8b9)[_0x6ea5('0x1b')]();};}function respondWithResult(_0x227de6,_0x1dd84d){_0x1dd84d=_0x1dd84d||0xc8;return function(_0x57de2d){if(_0x57de2d){return _0x227de6['status'](_0x1dd84d)['json'](_0x57de2d);}};}function respondWithFilteredResult(_0x1d794d,_0x59cfd2){return function(_0x42a6ad){if(_0x42a6ad){var _0x10bbff=typeof _0x59cfd2['offset']==='undefined'&&typeof _0x59cfd2[_0x6ea5('0x1c')]===_0x6ea5('0x1d');var _0x43ff87=_0x42a6ad[_0x6ea5('0x1e')];var _0x58d5f5=_0x10bbff?0x0:_0x59cfd2[_0x6ea5('0x1f')];var _0x2eaf8c=_0x10bbff?_0x42a6ad['count']:_0x59cfd2[_0x6ea5('0x1f')]+_0x59cfd2[_0x6ea5('0x1c')];var _0x3bce67;if(_0x2eaf8c>=_0x43ff87){_0x2eaf8c=_0x43ff87;_0x3bce67=0xc8;}else{_0x3bce67=0xce;}_0x1d794d['status'](_0x3bce67);return _0x1d794d[_0x6ea5('0x20')](_0x6ea5('0x21'),_0x58d5f5+'-'+_0x2eaf8c+'/'+_0x43ff87)[_0x6ea5('0x22')](_0x42a6ad);}return null;};}function patchUpdates(_0x1d48af){return function(_0x53fd41){try{jsonpatch[_0x6ea5('0x23')](_0x53fd41,_0x1d48af,!![]);}catch(_0x2a693f){return BPromise[_0x6ea5('0x24')](_0x2a693f);}return _0x53fd41[_0x6ea5('0x25')]();};}function saveUpdates(_0x3a327b,_0x1d1ffa){return function(_0x5a6742){if(_0x5a6742){return _0x5a6742[_0x6ea5('0x26')](_0x3a327b)[_0x6ea5('0x27')](function(_0x3a25a6){return _0x3a25a6;});}return null;};}function removeEntity(_0x487a62,_0x52e0df){return function(_0x3c56b1){if(_0x3c56b1){return _0x3c56b1[_0x6ea5('0x28')]()[_0x6ea5('0x27')](function(){_0x487a62[_0x6ea5('0x1a')](0xcc)[_0x6ea5('0x1b')]();});}};}function handleEntityNotFound(_0x1138fd,_0xd1bfc8){return function(_0x30ae01){if(!_0x30ae01){_0x1138fd[_0x6ea5('0x19')](0x194);}return _0x30ae01;};}function handleError(_0x483ec2,_0x1aa9c3){_0x1aa9c3=_0x1aa9c3||0x1f4;return function(_0x4748b1){logger[_0x6ea5('0x29')](_0x4748b1[_0x6ea5('0x2a')]);if(_0x4748b1['name']){delete _0x4748b1['name'];}_0x483ec2[_0x6ea5('0x1a')](_0x1aa9c3)[_0x6ea5('0x2b')](_0x4748b1);};}exports[_0x6ea5('0x2c')]=function(_0x1aad73,_0x1868b1){var _0x210883={},_0x33d384={},_0x4d22f5={'count':0x0,'rows':[]};var _0x259876=_[_0x6ea5('0x2d')](db[_0x6ea5('0x2e')][_0x6ea5('0x2f')],function(_0x28d288){return{'name':_0x28d288[_0x6ea5('0x30')],'type':_0x28d288[_0x6ea5('0x31')][_0x6ea5('0x32')]};});_0x33d384[_0x6ea5('0x33')]=_[_0x6ea5('0x2d')](_0x259876,_0x6ea5('0x34'));_0x33d384[_0x6ea5('0x35')]=_[_0x6ea5('0x36')](_0x1aad73['query']);_0x33d384[_0x6ea5('0x37')]=_[_0x6ea5('0x38')](_0x33d384[_0x6ea5('0x33')],_0x33d384[_0x6ea5('0x35')]);_0x210883[_0x6ea5('0x39')]=_[_0x6ea5('0x38')](_0x33d384['model'],qs['fields'](_0x1aad73['query']['fields']));_0x210883[_0x6ea5('0x39')]=_0x210883[_0x6ea5('0x39')][_0x6ea5('0x3a')]?_0x210883[_0x6ea5('0x39')]:_0x33d384[_0x6ea5('0x33')];if(!_0x1aad73['query'][_0x6ea5('0x3b')](_0x6ea5('0x3c'))){_0x210883[_0x6ea5('0x1c')]=qs['limit'](_0x1aad73[_0x6ea5('0x35')][_0x6ea5('0x1c')]);_0x210883['offset']=qs[_0x6ea5('0x1f')](_0x1aad73[_0x6ea5('0x35')][_0x6ea5('0x1f')]);}_0x210883[_0x6ea5('0x3d')]=qs['sort'](_0x1aad73[_0x6ea5('0x35')][_0x6ea5('0x3e')]);_0x210883['where']=qs['filters'](_['pick'](_0x1aad73['query'],_0x33d384[_0x6ea5('0x37')]),_0x259876);if(_0x1aad73[_0x6ea5('0x35')][_0x6ea5('0x3f')]){_0x210883[_0x6ea5('0x40')]=_['merge'](_0x210883[_0x6ea5('0x40')],{'$or':_[_0x6ea5('0x2d')](_0x259876,function(_0x4ba28e){if(_0x4ba28e[_0x6ea5('0x31')]!=='VIRTUAL'){var _0x386aa2={};_0x386aa2[_0x4ba28e['name']]={'$like':'%'+_0x1aad73[_0x6ea5('0x35')]['filter']+'%'};return _0x386aa2;}})});}_0x210883=_['merge']({},_0x210883,_0x1aad73[_0x6ea5('0x41')]);var _0x3769={'where':_0x210883[_0x6ea5('0x40')]};return db[_0x6ea5('0x2e')][_0x6ea5('0x1e')](_0x3769)[_0x6ea5('0x27')](function(_0x31fafe){_0x4d22f5[_0x6ea5('0x1e')]=_0x31fafe;if(_0x1aad73['query'][_0x6ea5('0x42')]){_0x210883[_0x6ea5('0x43')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x210883);})['then'](function(_0x2248b8){_0x4d22f5['rows']=_0x2248b8;return _0x4d22f5;})[_0x6ea5('0x27')](respondWithFilteredResult(_0x1868b1,_0x210883))[_0x6ea5('0x44')](handleError(_0x1868b1,null));};exports['show']=function(_0x1356c1,_0x434a6b){var _0x4157b8={'raw':!![],'where':{'id':_0x1356c1[_0x6ea5('0x45')]['id']}},_0x4126dc={};_0x4126dc[_0x6ea5('0x33')]=_[_0x6ea5('0x36')](db['ChatTransferReport'][_0x6ea5('0x2f')]);_0x4126dc['query']=_[_0x6ea5('0x36')](_0x1356c1['query']);_0x4126dc[_0x6ea5('0x37')]=_['intersection'](_0x4126dc[_0x6ea5('0x33')],_0x4126dc[_0x6ea5('0x35')]);_0x4157b8[_0x6ea5('0x39')]=_[_0x6ea5('0x38')](_0x4126dc[_0x6ea5('0x33')],qs['fields'](_0x1356c1[_0x6ea5('0x35')][_0x6ea5('0x46')]));_0x4157b8[_0x6ea5('0x39')]=_0x4157b8['attributes'][_0x6ea5('0x3a')]?_0x4157b8[_0x6ea5('0x39')]:_0x4126dc[_0x6ea5('0x33')];if(_0x1356c1[_0x6ea5('0x35')][_0x6ea5('0x42')]){_0x4157b8['include']=[{'all':!![]}];}_0x4157b8=_['merge']({},_0x4157b8,_0x1356c1['options']);return db[_0x6ea5('0x2e')][_0x6ea5('0x47')](_0x4157b8)[_0x6ea5('0x27')](handleEntityNotFound(_0x434a6b,null))[_0x6ea5('0x27')](respondWithResult(_0x434a6b,null))[_0x6ea5('0x44')](handleError(_0x434a6b,null));};exports['create']=function(_0x141300,_0x5dc963){return db[_0x6ea5('0x2e')][_0x6ea5('0x48')](_0x141300[_0x6ea5('0x49')],{})[_0x6ea5('0x27')](respondWithResult(_0x5dc963,0xc9))[_0x6ea5('0x44')](handleError(_0x5dc963,null));};exports[_0x6ea5('0x26')]=function(_0x5a4d47,_0x150fc1){if(_0x5a4d47[_0x6ea5('0x49')]['id']){delete _0x5a4d47[_0x6ea5('0x49')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x5a4d47[_0x6ea5('0x45')]['id']}})['then'](handleEntityNotFound(_0x150fc1,null))[_0x6ea5('0x27')](saveUpdates(_0x5a4d47[_0x6ea5('0x49')],null))['then'](respondWithResult(_0x150fc1,null))[_0x6ea5('0x44')](handleError(_0x150fc1,null));};exports[_0x6ea5('0x28')]=function(_0x39dcbc,_0x2034e6){return db[_0x6ea5('0x2e')]['find']({'where':{'id':_0x39dcbc[_0x6ea5('0x45')]['id']}})[_0x6ea5('0x27')](handleEntityNotFound(_0x2034e6,null))['then'](removeEntity(_0x2034e6,null))[_0x6ea5('0x44')](handleError(_0x2034e6,null));};exports[_0x6ea5('0x4a')]=function(_0x29efe2,_0x5a54c6){return db[_0x6ea5('0x2e')]['describe']()[_0x6ea5('0x27')](respondWithResult(_0x5a54c6,null))[_0x6ea5('0x44')](handleError(_0x5a54c6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index a414d6b..81737ea 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 _0xbdb9=['define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x181d63,_0x4c5932){var _0x2b32c3=function(_0x2b14aa){while(--_0x2b14aa){_0x181d63['push'](_0x181d63['shift']());}};_0x2b32c3(++_0x4c5932);}(_0xbdb9,0x11b));var _0x9bdb=function(_0x52b4a2,_0x1c5e9b){_0x52b4a2=_0x52b4a2-0x0;var _0x44ce7f=_0xbdb9[_0x52b4a2];return _0x44ce7f;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var logger=require(_0x9bdb('0x2'))(_0x9bdb('0x3'));var moment=require(_0x9bdb('0x4'));var BPromise=require(_0x9bdb('0x5'));var rp=require(_0x9bdb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bdb('0x7'));var config=require(_0x9bdb('0x8'));var attributes=require(_0x9bdb('0x9'));module[_0x9bdb('0xa')]=function(_0x3b3954,_0x4cdd03){return _0x3b3954[_0x9bdb('0xb')]('ChatTransferReport',attributes,{'tableName':_0x9bdb('0xc'),'paranoid':![],'indexes':[{'name':_0x9bdb('0xd'),'fields':[_0x9bdb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7050=['api','moment','request-promise','../../config/environment','exports','define','ChatTransferReport','uniqueid','lodash','util'];(function(_0x140f79,_0x3aaea2){var _0x3a9acd=function(_0x5b8e99){while(--_0x5b8e99){_0x140f79['push'](_0x140f79['shift']());}};_0x3a9acd(++_0x3aaea2);}(_0x7050,0x1de));var _0x0705=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x7050[_0xabbd2f];return _0x34a040;};'use strict';var _=require(_0x0705('0x0'));var util=require(_0x0705('0x1'));var logger=require('../../config/logger')(_0x0705('0x2'));var moment=require(_0x0705('0x3'));var BPromise=require('bluebird');var rp=require(_0x0705('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0705('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x0705('0x6')]=function(_0x2c625d,_0x1c1b20){return _0x2c625d[_0x0705('0x7')](_0x0705('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0705('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 438bbaa..4349d54 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 _0xd830=['stringify','error','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4023fd,_0x360c96){var _0x4aa334=function(_0x4593c4){while(--_0x4593c4){_0x4023fd['push'](_0x4023fd['shift']());}};_0x4aa334(++_0x360c96);}(_0xd830,0x1d0));var _0x0d83=function(_0x3bba68,_0x2dd2f0){_0x3bba68=_0x3bba68-0x0;var _0x13fa7f=_0xd830[_0x3bba68];return _0x13fa7f;};'use strict';var _=require(_0x0d83('0x0'));var util=require(_0x0d83('0x1'));var moment=require(_0x0d83('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d83('0x3'));var db=require(_0x0d83('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d83('0x5'))('rpc');var config=require(_0x0d83('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6a88f4,_0x36e14f,_0x548191){return new BPromise(function(_0x3e150c,_0x5e777a){return client[_0x0d83('0x7')](_0x6a88f4,_0x548191)[_0x0d83('0x8')](function(_0x174e8f){logger['info'](_0x0d83('0x9'),_0x36e14f,_0x0d83('0xa'));logger['debug'](_0x0d83('0xb'),_0x36e14f,_0x0d83('0xa'),JSON[_0x0d83('0xc')](_0x174e8f));if(_0x174e8f[_0x0d83('0xd')]){if(_0x174e8f[_0x0d83('0xd')]['code']===0x1f4){logger[_0x0d83('0xd')](_0x0d83('0x9'),_0x36e14f,_0x174e8f['error'][_0x0d83('0xe')]);return _0x5e777a(_0x174e8f[_0x0d83('0xd')][_0x0d83('0xe')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x36e14f,_0x174e8f['error'][_0x0d83('0xe')]);return _0x3e150c(_0x174e8f[_0x0d83('0xd')][_0x0d83('0xe')]);}else{logger[_0x0d83('0xf')](_0x0d83('0x9'),_0x36e14f,_0x0d83('0xa'));_0x3e150c(_0x174e8f[_0x0d83('0x10')]['message']);}})['catch'](function(_0x3a25b6){logger[_0x0d83('0xd')](_0x0d83('0x9'),_0x36e14f,_0x3a25b6);_0x5e777a(_0x3a25b6);});});} \ No newline at end of file +var _0xdc39=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x290f7c,_0x48ae20){var _0x1b4651=function(_0x28bb31){while(--_0x28bb31){_0x290f7c['push'](_0x290f7c['shift']());}};_0x1b4651(++_0x48ae20);}(_0xdc39,0x153));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9dc3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9dc3('0x1'));var rs=require(_0x9dc3('0x2'));var fs=require('fs');var Redis=require(_0x9dc3('0x3'));var db=require(_0x9dc3('0x4'))['db'];var utils=require(_0x9dc3('0x5'));var logger=require('../../config/logger')(_0x9dc3('0x6'));var config=require(_0x9dc3('0x7'));var jayson=require(_0x9dc3('0x8'));var client=jayson['client'][_0x9dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x309bbb,_0x544f99,_0x1c6a37){return new BPromise(function(_0x1b84ad,_0x73a9cf){return client[_0x9dc3('0xa')](_0x309bbb,_0x1c6a37)['then'](function(_0x4943db){logger[_0x9dc3('0xb')](_0x9dc3('0xc'),_0x544f99,_0x9dc3('0xd'));logger[_0x9dc3('0xe')](_0x9dc3('0xf'),_0x544f99,'request\x20sent',JSON[_0x9dc3('0x10')](_0x4943db));if(_0x4943db[_0x9dc3('0x11')]){if(_0x4943db[_0x9dc3('0x11')]['code']===0x1f4){logger[_0x9dc3('0x11')](_0x9dc3('0xc'),_0x544f99,_0x4943db[_0x9dc3('0x11')]['message']);return _0x73a9cf(_0x4943db[_0x9dc3('0x11')][_0x9dc3('0x12')]);}logger['error'](_0x9dc3('0xc'),_0x544f99,_0x4943db[_0x9dc3('0x11')][_0x9dc3('0x12')]);return _0x1b84ad(_0x4943db[_0x9dc3('0x11')][_0x9dc3('0x12')]);}else{logger[_0x9dc3('0xb')](_0x9dc3('0xc'),_0x544f99,_0x9dc3('0xd'));_0x1b84ad(_0x4943db[_0x9dc3('0x13')][_0x9dc3('0x12')]);}})[_0x9dc3('0x14')](function(_0x2ed592){logger[_0x9dc3('0x11')](_0x9dc3('0xc'),_0x544f99,_0x2ed592);_0x73a9cf(_0x2ed592);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 8cd0eb4..327dccd 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 _0xb9da=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','multer','util'];(function(_0x3627f6,_0x452fda){var _0x9521cb=function(_0x5de9e3){while(--_0x5de9e3){_0x3627f6['push'](_0x3627f6['shift']());}};_0x9521cb(++_0x452fda);}(_0xb9da,0x154));var _0xab9d=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0xb9da[_0x5b36bd];return _0x1614fe;};'use strict';var multer=require(_0xab9d('0x0'));var util=require(_0xab9d('0x1'));var path=require(_0xab9d('0x2'));var timeout=require(_0xab9d('0x3'));var express=require('express');var router=express[_0xab9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xab9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab9d('0x6'));var controller=require(_0xab9d('0x7'));router[_0xab9d('0x8')]('/',auth[_0xab9d('0x9')](),controller['index']);router[_0xab9d('0x8')](_0xab9d('0xa'),auth['isAuthenticated'](),controller[_0xab9d('0xb')]);router[_0xab9d('0x8')](_0xab9d('0xc'),auth[_0xab9d('0x9')](),controller[_0xab9d('0xd')]);router[_0xab9d('0xe')]('/',auth['isAuthenticated'](),controller[_0xab9d('0xf')]);router['put'](_0xab9d('0xc'),auth[_0xab9d('0x9')](),controller[_0xab9d('0x10')]);router[_0xab9d('0x11')](_0xab9d('0xc'),auth[_0xab9d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4d67=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ecfd5,_0x3bd8a4){var _0x136d80=function(_0x87079c){while(--_0x87079c){_0x5ecfd5['push'](_0x5ecfd5['shift']());}};_0x136d80(++_0x3bd8a4);}(_0x4d67,0x19a));var _0x74d6=function(_0x55d748,_0x3f3dfd){_0x55d748=_0x55d748-0x0;var _0x197504=_0x4d67[_0x55d748];return _0x197504;};'use strict';var multer=require(_0x74d6('0x0'));var util=require(_0x74d6('0x1'));var path=require(_0x74d6('0x2'));var timeout=require(_0x74d6('0x3'));var express=require(_0x74d6('0x4'));var router=express[_0x74d6('0x5')]();var fs_extra=require(_0x74d6('0x6'));var auth=require(_0x74d6('0x7'));var interaction=require(_0x74d6('0x8'));var config=require(_0x74d6('0x9'));var controller=require(_0x74d6('0xa'));router[_0x74d6('0xb')]('/',auth[_0x74d6('0xc')](),controller[_0x74d6('0xd')]);router['get'](_0x74d6('0xe'),auth[_0x74d6('0xc')](),controller[_0x74d6('0xf')]);router['get'](_0x74d6('0x10'),auth[_0x74d6('0xc')](),controller[_0x74d6('0x11')]);router[_0x74d6('0x12')]('/',auth[_0x74d6('0xc')](),controller[_0x74d6('0x13')]);router[_0x74d6('0x14')](_0x74d6('0x10'),auth[_0x74d6('0xc')](),controller[_0x74d6('0x15')]);router['delete'](_0x74d6('0x10'),auth[_0x74d6('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index de95b46..eba993b 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 _0xd2ea=['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','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#011F6A','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea'];(function(_0x4d13b4,_0x3fd061){var _0x92ba98=function(_0x470028){while(--_0x470028){_0x4d13b4['push'](_0x4d13b4['shift']());}};_0x92ba98(++_0x3fd061);}(_0xd2ea,0x15f));var _0xad2e=function(_0x24c57b,_0x2ab0c0){_0x24c57b=_0x24c57b-0x0;var _0x1d0146=_0xd2ea[_0x24c57b];return _0x1d0146;};'use strict';var Sequelize=require(_0xad2e('0x0'));var rs=require(_0xad2e('0x1'));module[_0xad2e('0x2')]={'name':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xad2e('0x3')]},'mapKey':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'mapKeyOffline':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'key':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xad2e('0x3')]},'animation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xad2e('0x8')]('rounded',_0xad2e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xa')},'start_chat_button':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xad2e('0xe')]},'closingQuestion':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x11')},'noteTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x12')},'placeholderMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x13')},'closingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x14')},'closingMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x16')},'ratingType':{'type':Sequelize[_0xad2e('0x8')](_0xad2e('0x17'),_0xad2e('0x18')),'defaultValue':_0xad2e('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xad2e('0xe')],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':_0xad2e('0x1a'),'variable':null,'config':{'placeholder':_0xad2e('0x1b'),'type':_0xad2e('0x1c'),'required':!![]},'props':{'title':_0xad2e('0x1b'),'helpText':''}},{'type':_0xad2e('0x1a'),'props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x1e'))?JSON[_0xad2e('0x1f')](this[_0xad2e('0x1d')](_0xad2e('0x1e'))):{};},'set':function(_0x58acc8){return this[_0xad2e('0x20')](_0xad2e('0x1e'),JSON[_0xad2e('0x19')](_0x58acc8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':'input','props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':_0xad2e('0x4')},'variable':null},{'type':_0xad2e('0x21'),'config':{'placeholder':_0xad2e('0x22')},'props':{'title':_0xad2e('0x22'),'helpText':_0xad2e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x24'))?JSON[_0xad2e('0x1f')](this['getDataValue'](_0xad2e('0x24'))):{};},'set':function(_0xfd2087){return this[_0xad2e('0x20')](_0xad2e('0x24'),JSON[_0xad2e('0x19')](_0xfd2087));}},'token':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':function(){return rs[_0xad2e('0x25')]();}},'autoclose':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xad2e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xad2e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x26')},'waitingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xad2e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xad2e('0x2b');}},'notificationSound':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xad2e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2f')},'defaultTitle':{'type':Sequelize[_0xad2e('0x3')]},'customerAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xad2e('0x7')],'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},'systemAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad2e('0x6')],'comment':_0xad2e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'comment':_0xad2e('0x32'),'set':function(_0x6f4fbc){if(!_0x6f4fbc)this[_0xad2e('0x20')](_0xad2e('0x33'),null);this['setDataValue'](_0xad2e('0x34'),_0x6f4fbc);}},'vidaooEscalation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xad2e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xad2e('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xad2e('0xe')]}}; \ No newline at end of file +var _0xe14d=['thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star'];(function(_0x303444,_0x48e416){var _0x3c73cf=function(_0x2853a0){while(--_0x2853a0){_0x303444['push'](_0x303444['shift']());}};_0x3c73cf(++_0x48e416);}(_0xe14d,0x1ee));var _0xde14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe14d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xde14('0x0'));var rs=require(_0xde14('0x1'));module[_0xde14('0x2')]={'name':{'type':Sequelize[_0xde14('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde14('0x4')},'description':{'type':Sequelize[_0xde14('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xde14('0x5')},'mapKeyOffline':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x5')},'key':{'type':Sequelize[_0xde14('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde14('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xde14('0x3')],'allowNull':![],'defaultValue':_0xde14('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xde14('0x3')],'allowNull':![],'defaultValue':_0xde14('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xde14('0x3')],'allowNull':![],'defaultValue':_0xde14('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xde14('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xde14('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xde14('0xb')](_0xde14('0xc'),_0xde14('0xd')),'defaultValue':_0xde14('0xc')},'header_online':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0xe')},'start_chat_button':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0xf')},'offline_chat_button':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x10')},'header_offline':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x11')},'download_transcript':{'type':Sequelize[_0xde14('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xde14('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xde14('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xde14('0x12')]},'closingQuestion':{'type':Sequelize[_0xde14('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x14')},'noteTitle':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x15')},'placeholderMessage':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x16')},'closingMessage':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xde14('0x10')},'skipMessageButton':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x18')},'conditionAgreement':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xde14('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xde14('0xb')](_0xde14('0x19'),_0xde14('0x1a')),'defaultValue':_0xde14('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xde14('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xde14('0x12')],'defaultValue':function(){return JSON[_0xde14('0x1b')]({'items':[{'type':_0xde14('0x1c'),'variable':null,'config':{'placeholder':_0xde14('0x1d'),'type':_0xde14('0x1e'),'required':!![]},'props':{'title':_0xde14('0x1d'),'helpText':''}},{'type':_0xde14('0x1c'),'props':{'title':_0xde14('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xde14('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xde14('0x1f')](_0xde14('0x20'))?JSON[_0xde14('0x21')](this[_0xde14('0x1f')](_0xde14('0x20'))):{};},'set':function(_0x310d75){return this[_0xde14('0x22')](_0xde14('0x20'),JSON[_0xde14('0x1b')](_0x310d75));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xde14('0x1b')]({'items':[{'type':_0xde14('0x1c'),'props':{'title':_0xde14('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xde14('0x5'),'type':'email'},'variable':null},{'type':_0xde14('0x23'),'config':{'placeholder':_0xde14('0x24')},'props':{'title':_0xde14('0x24'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xde14('0x1f')]('offlineForm')?JSON[_0xde14('0x21')](this[_0xde14('0x1f')](_0xde14('0x25'))):{};},'set':function(_0x1e7906){return this[_0xde14('0x22')](_0xde14('0x25'),JSON[_0xde14('0x1b')](_0x1e7906));}},'token':{'type':Sequelize[_0xde14('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xde14('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xde14('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xde14('0x3')]},'waitingTitle':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x26')},'waitingMessage':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xde14('0x28')},'offlineMessageBody':{'type':Sequelize[_0xde14('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xde14('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x29')},'skipUnmanaged':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x18')},'sendUnmanaged':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xde14('0x3')]},'notificationTemplate':{'type':Sequelize[_0xde14('0x12')],'defaultValue':function(){return _0xde14('0x2a');}},'notificationSound':{'type':Sequelize[_0xde14('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xde14('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xde14('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x2d')},'defaultTitle':{'type':Sequelize[_0xde14('0x3')]},'customerAvatar':{'type':Sequelize[_0xde14('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xde14('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xde14('0x3')],'allowNull':![],'defaultValue':_0xde14('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde14('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde14('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xde14('0x3')],'defaultValue':_0xde14('0x2f')},'systemAvatar':{'type':Sequelize[_0xde14('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde14('0x9')],'comment':_0xde14('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xde14('0x31'),'set':function(_0xb6b2ee){if(!_0xb6b2ee)this[_0xde14('0x22')](_0xde14('0x32'),null);this['setDataValue']('mandatoryDisposition',_0xb6b2ee);}},'vidaooEscalation':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xde14('0x3')]},'vidaooTopic':{'type':Sequelize[_0xde14('0x3')],'allowNull':![],'defaultValue':_0xde14('0x33')},'vidaooNote':{'type':Sequelize[_0xde14('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xde14('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xde14('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xde14('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 60f097d..ab6a43a 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 _0x0340=['rows','show','params','mandatoryDispositionPause','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','Disposition','getDispositions','findOne','order','pick','findAll','removeDispositions','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','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','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','addInteraction','getInteractions','Contact','User','fullname','Tags','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','custom','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','URL','3.1.0','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','omit','getProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll'];(function(_0x4f51f9,_0x5d5613){var _0x533984=function(_0x578319){while(--_0x578319){_0x4f51f9['push'](_0x4f51f9['shift']());}};_0x533984(++_0x5d5613);}(_0x0340,0xdd));var _0x0034=function(_0x325b53,_0x58e11b){_0x325b53=_0x325b53-0x0;var _0x223e32=_0x0340[_0x325b53];return _0x223e32;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0034('0x0'));var path=require(_0x0034('0x1'));var ejs=require(_0x0034('0x2'));var fs=require('fs');var fs_extra=require(_0x0034('0x3'));var _=require('lodash');var querystring=require(_0x0034('0x4'));var Redis=require(_0x0034('0x5'));var qs=require(_0x0034('0x6'));var logger=require(_0x0034('0x7'))(_0x0034('0x8'));var config=require(_0x0034('0x9'));var url=require(_0x0034('0xa'));var db=require(_0x0034('0xb'))['db'];config[_0x0034('0xc')]=_[_0x0034('0xd')](config['redis'],{'host':_0x0034('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0034('0xf'))[_0x0034('0x10')](socket);var htmlToText=require(_0x0034('0x11'));var jayson=require(_0x0034('0x12'));var client=jayson[_0x0034('0x13')][_0x0034('0x14')]({'port':0x232c});var client9002=jayson[_0x0034('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x0034('0x13')]['http']({'port':0x232b});var client9001=jayson[_0x0034('0x13')][_0x0034('0x14')]({'port':0x2329});function respondWithRpcPromise(_0xe09feb,_0x345a99,_0xd90170,_0x21078d){return new BPromise(function(_0x2fddf2,_0x2f7cb9){var _0x431f6e=_0x21078d||client;return _0x431f6e[_0x0034('0x15')](_0xe09feb,_0xd90170)[_0x0034('0x16')](function(_0x490d82){logger[_0x0034('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x345a99,_0x0034('0x18'));logger[_0x0034('0x19')](_0x0034('0x1a'),_0x345a99,_0x0034('0x18'),JSON[_0x0034('0x1b')](_0x490d82));if(_0x490d82['error']){if(_0x490d82[_0x0034('0x1c')][_0x0034('0x1d')]===0x1f4){logger[_0x0034('0x1c')](_0x0034('0x1e'),_0x345a99,_0x490d82[_0x0034('0x1c')][_0x0034('0x1f')]);return _0x2f7cb9(_0x490d82['error'][_0x0034('0x1f')]);}logger[_0x0034('0x1c')](_0x0034('0x1e'),_0x345a99,_0x490d82[_0x0034('0x1c')][_0x0034('0x1f')]);return _0x2fddf2(_0x490d82[_0x0034('0x1c')]['message']);}else{logger[_0x0034('0x17')](_0x0034('0x1e'),_0x345a99,_0x0034('0x18'));_0x2fddf2(_0x490d82['result']['message']);}})[_0x0034('0x20')](function(_0x2bf03a){logger[_0x0034('0x1c')](_0x0034('0x1e'),_0x345a99,_0x2bf03a);_0x2f7cb9(_0x2bf03a);});});}function respondWithStatusCode(_0x117b0c,_0x1e4811){_0x1e4811=_0x1e4811||0xcc;return function(_0x5d90aa){if(_0x5d90aa){return _0x117b0c[_0x0034('0x21')](_0x1e4811);}return _0x117b0c[_0x0034('0x22')](_0x1e4811)[_0x0034('0x23')]();};}function respondWithResult(_0x42ee30,_0x21a531){_0x21a531=_0x21a531||0xc8;return function(_0x3850db){if(_0x3850db){return _0x42ee30[_0x0034('0x22')](_0x21a531)[_0x0034('0x24')](_0x3850db);}};}function respondWithFilteredResult(_0x2fc9dd,_0x444ddc){return function(_0x23e6c3){if(_0x23e6c3){var _0x236f2c=typeof _0x444ddc[_0x0034('0x25')]===_0x0034('0x26')&&typeof _0x444ddc[_0x0034('0x27')]==='undefined';var _0x57ac26=_0x23e6c3[_0x0034('0x28')];var _0x4ba014=_0x236f2c?0x0:_0x444ddc[_0x0034('0x25')];var _0x26f999=_0x236f2c?_0x23e6c3[_0x0034('0x28')]:_0x444ddc[_0x0034('0x25')]+_0x444ddc[_0x0034('0x27')];var _0x1fa0d0;if(_0x26f999>=_0x57ac26){_0x26f999=_0x57ac26;_0x1fa0d0=0xc8;}else{_0x1fa0d0=0xce;}_0x2fc9dd['status'](_0x1fa0d0);return _0x2fc9dd['set']('Content-Range',_0x4ba014+'-'+_0x26f999+'/'+_0x57ac26)[_0x0034('0x24')](_0x23e6c3);}return null;};}function saveUpdates(_0x110ad5){return function(_0x30faa3){if(_0x30faa3){return _0x30faa3[_0x0034('0x29')](_0x110ad5)[_0x0034('0x16')](function(_0x2f5d88){return _0x2f5d88;});}return null;};}function removeEntity(_0x42af5f){return function(_0x4abd0e){if(_0x4abd0e){return _0x4abd0e[_0x0034('0x2a')]()[_0x0034('0x16')](function(){var _0x1e9499=_0x4abd0e[_0x0034('0x2b')]({'plain':!![]});var _0x35c55f=_0x0034('0x2c');return db[_0x0034('0x2d')][_0x0034('0x2a')]({'where':{'type':_0x35c55f,'resourceId':_0x1e9499['id']}})['then'](function(){return _0x4abd0e;});})[_0x0034('0x16')](function(){_0x42af5f[_0x0034('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b94c4){return function(_0x10d84b){if(!_0x10d84b){_0x5b94c4['sendStatus'](0x194);}return _0x10d84b;};}function handleError(_0x3b327c,_0x4713c6){_0x4713c6=_0x4713c6||0x1f4;return function(_0x26c563){logger[_0x0034('0x1c')](_0x26c563[_0x0034('0x2e')]);if(_0x26c563[_0x0034('0x2f')]){delete _0x26c563['name'];}_0x3b327c[_0x0034('0x22')](_0x4713c6)['send'](_0x26c563);};}exports[_0x0034('0x30')]=function(_0x13851d,_0x390b6a){var _0x26aba2={'include':[{'model':db[_0x0034('0x31')],'as':'mandatoryDispositionPause'}]},_0x11e2b3={},_0x2910b2={'count':0x0,'rows':[]};var _0x5b5bd0=_['map'](db[_0x0034('0x32')][_0x0034('0x33')],function(_0x248ece){return{'name':_0x248ece[_0x0034('0x34')],'type':_0x248ece[_0x0034('0x35')][_0x0034('0x36')]};});_0x11e2b3[_0x0034('0x37')]=_[_0x0034('0x38')](_0x5b5bd0,_0x0034('0x2f'));_0x11e2b3[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x13851d['query']);_0x11e2b3[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x11e2b3[_0x0034('0x37')],_0x11e2b3[_0x0034('0x39')]);_0x26aba2[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x11e2b3[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x13851d[_0x0034('0x39')]['fields']));_0x26aba2[_0x0034('0x3d')]=_0x26aba2[_0x0034('0x3d')][_0x0034('0x3f')]?_0x26aba2[_0x0034('0x3d')]:_0x11e2b3[_0x0034('0x37')];if(!_0x13851d[_0x0034('0x39')][_0x0034('0x40')](_0x0034('0x41'))){_0x26aba2[_0x0034('0x27')]=qs[_0x0034('0x27')](_0x13851d['query'][_0x0034('0x27')]);_0x26aba2['offset']=qs[_0x0034('0x25')](_0x13851d[_0x0034('0x39')][_0x0034('0x25')]);}_0x26aba2['order']=qs['sort'](_0x13851d[_0x0034('0x39')][_0x0034('0x42')]);_0x26aba2['where']=qs['filters'](_['pick'](_0x13851d[_0x0034('0x39')],_0x11e2b3[_0x0034('0x3b')]),_0x5b5bd0);if(_0x13851d['query'][_0x0034('0x43')]){_0x26aba2['where']=_[_0x0034('0x44')](_0x26aba2[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x5b5bd0,function(_0x3469f7){if(_0x3469f7[_0x0034('0x35')]!==_0x0034('0x46')){var _0x1c29bf={};_0x1c29bf[_0x3469f7[_0x0034('0x2f')]]={'$like':'%'+_0x13851d[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x1c29bf;}})});}_0x26aba2=_[_0x0034('0x44')]({},_0x26aba2,_0x13851d[_0x0034('0x47')]);var _0x3524da={'where':_0x26aba2[_0x0034('0x45')]};return db[_0x0034('0x32')][_0x0034('0x28')](_0x3524da)[_0x0034('0x16')](function(_0x33bcec){_0x2910b2[_0x0034('0x28')]=_0x33bcec;if(_0x13851d[_0x0034('0x39')][_0x0034('0x48')]){_0x26aba2['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x26aba2);})['then'](function(_0x416cc1){_0x2910b2[_0x0034('0x49')]=_0x416cc1;return _0x2910b2;})['then'](respondWithFilteredResult(_0x390b6a,_0x26aba2))[_0x0034('0x20')](handleError(_0x390b6a,null));};exports[_0x0034('0x4a')]=function(_0xf47c42,_0x53f17c){var _0x39388f={'raw':![],'where':{'id':_0xf47c42[_0x0034('0x4b')]['id']},'include':[{'model':db[_0x0034('0x31')],'as':_0x0034('0x4c')}]},_0x56e10c={};_0x56e10c[_0x0034('0x37')]=_[_0x0034('0x3a')](db['ChatWebsite'][_0x0034('0x33')]);_0x56e10c[_0x0034('0x39')]=_[_0x0034('0x3a')](_0xf47c42[_0x0034('0x39')]);_0x56e10c[_0x0034('0x3b')]=_['intersection'](_0x56e10c[_0x0034('0x37')],_0x56e10c[_0x0034('0x39')]);_0x39388f[_0x0034('0x3d')]=_['intersection'](_0x56e10c[_0x0034('0x37')],qs[_0x0034('0x3e')](_0xf47c42[_0x0034('0x39')]['fields']));_0x39388f[_0x0034('0x3d')]=_0x39388f[_0x0034('0x3d')][_0x0034('0x3f')]?_0x39388f[_0x0034('0x3d')]:_0x56e10c[_0x0034('0x37')];if(_0xf47c42[_0x0034('0x39')]['includeAll']){_0x39388f[_0x0034('0x4d')]=[{'all':!![]}];}_0x39388f=_['merge']({},_0x39388f,_0xf47c42[_0x0034('0x47')]);return db['ChatWebsite'][_0x0034('0x4e')](_0x39388f)[_0x0034('0x16')](handleEntityNotFound(_0x53f17c,null))['then'](respondWithResult(_0x53f17c,null))['catch'](handleError(_0x53f17c,null));};exports[_0x0034('0x4f')]=function(_0x387256,_0x57ce22){return db[_0x0034('0x32')]['create'](_0x387256[_0x0034('0x50')],{})[_0x0034('0x16')](function(_0x708de6){var _0x3fe4ca=_0x387256[_0x0034('0x51')]['get']({'plain':!![]});if(!_0x3fe4ca)throw new Error(_0x0034('0x52'));if(_0x3fe4ca[_0x0034('0x53')]===_0x0034('0x51')){var _0x5c58de=_0x708de6[_0x0034('0x2b')]({'plain':!![]});var _0x19483a='ChatWebsites';return db[_0x0034('0x54')][_0x0034('0x4e')]({'where':{'name':_0x19483a,'userProfileId':_0x3fe4ca['userProfileId']},'raw':!![]})[_0x0034('0x16')](function(_0x445a49){if(_0x445a49&&_0x445a49[_0x0034('0x55')]===0x0){return db[_0x0034('0x2d')][_0x0034('0x4f')]({'name':_0x5c58de['name'],'resourceId':_0x5c58de['id'],'type':_0x445a49['name'],'sectionId':_0x445a49['id']},{})[_0x0034('0x16')](function(){return _0x708de6;});}else{return _0x708de6;}})[_0x0034('0x20')](function(_0x21ca26){logger[_0x0034('0x1c')](_0x0034('0x56'),_0x21ca26);throw _0x21ca26;});}return _0x708de6;})['then'](respondWithResult(_0x57ce22,0xc9))[_0x0034('0x20')](handleError(_0x57ce22,null));};exports['update']=function(_0x371ba5,_0x33c7cf){if(_0x371ba5[_0x0034('0x50')]['id']){delete _0x371ba5[_0x0034('0x50')]['id'];}return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x371ba5['params']['id']},'include':[{'model':db[_0x0034('0x31')],'as':_0x0034('0x4c')}]})['then'](handleEntityNotFound(_0x33c7cf,null))[_0x0034('0x16')](saveUpdates(_0x371ba5['body'],null))[_0x0034('0x16')](respondWithResult(_0x33c7cf,null))[_0x0034('0x20')](handleError(_0x33c7cf,null));};exports[_0x0034('0x2a')]=function(_0x3158ee,_0xf04834){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x3158ee[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0xf04834,null))[_0x0034('0x16')](removeEntity(_0xf04834,null))[_0x0034('0x20')](handleError(_0xf04834,null));};exports['describe']=function(_0x3972d4,_0x58b06c){return db['ChatWebsite'][_0x0034('0x57')]()[_0x0034('0x16')](respondWithResult(_0x58b06c,null))[_0x0034('0x20')](handleError(_0x58b06c,null));};exports[_0x0034('0x58')]=function(_0x11d7f9,_0xefaee1){if(_0x11d7f9[_0x0034('0x50')]['id']){delete _0x11d7f9[_0x0034('0x50')]['id'];}return db[_0x0034('0x32')]['find']({'where':{'id':_0x11d7f9[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0xefaee1,null))[_0x0034('0x16')](function(_0x20e3aa){if(_0x20e3aa){_0x11d7f9['body']['ChatWebsiteId']=_0x20e3aa['id'];return db[_0x0034('0x59')][_0x0034('0x4f')](_0x11d7f9['body']);}})[_0x0034('0x16')](respondWithResult(_0xefaee1,null))[_0x0034('0x20')](handleError(_0xefaee1,null));};exports[_0x0034('0x5a')]=function(_0x51ecfe,_0x1d1a85){var _0xe59225={'raw':![],'where':{}};var _0x23d649={};var _0x109372={'count':0x0,'rows':[]};return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x51ecfe[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x1d1a85,null))[_0x0034('0x16')](function(_0x346209){if(_0x346209){_0x23d649[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0x59')]['rawAttributes']);_0x23d649[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x51ecfe[_0x0034('0x39')]);_0x23d649[_0x0034('0x3b')]=_['intersection'](_0x23d649[_0x0034('0x37')],_0x23d649[_0x0034('0x39')]);_0xe59225[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x23d649[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x51ecfe['query'][_0x0034('0x3e')]));_0xe59225[_0x0034('0x3d')]=_0xe59225[_0x0034('0x3d')][_0x0034('0x3f')]?_0xe59225[_0x0034('0x3d')]:_0x23d649[_0x0034('0x37')];if(!_0x51ecfe[_0x0034('0x39')][_0x0034('0x40')](_0x0034('0x41'))){_0xe59225[_0x0034('0x27')]=qs['limit'](_0x51ecfe[_0x0034('0x39')][_0x0034('0x27')]);_0xe59225[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x51ecfe[_0x0034('0x39')][_0x0034('0x25')]);}_0xe59225[_0x0034('0x5c')]=qs['sort'](_0x51ecfe['query'][_0x0034('0x42')]);_0xe59225[_0x0034('0x45')]=qs[_0x0034('0x3b')](_[_0x0034('0x5d')](_0x51ecfe[_0x0034('0x39')],_0x23d649[_0x0034('0x3b')]));_0xe59225[_0x0034('0x45')]['ChatWebsiteId']=_0x346209['id'];if(_0x51ecfe[_0x0034('0x39')][_0x0034('0x43')]){_0xe59225[_0x0034('0x45')]=_['merge'](_0xe59225['where'],{'$or':_['map'](_0xe59225[_0x0034('0x3d')],function(_0x499d1a){var _0x1fafc1={};_0x1fafc1[_0x499d1a]={'$like':'%'+_0x51ecfe[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x1fafc1;})});}_0xe59225=_['merge']({},_0xe59225,_0x51ecfe[_0x0034('0x47')]);return db[_0x0034('0x59')][_0x0034('0x28')]({'where':_0xe59225['where']})[_0x0034('0x16')](function(_0x47c264){_0x109372[_0x0034('0x28')]=_0x47c264;if(_0x51ecfe[_0x0034('0x39')]['includeAll']){_0xe59225[_0x0034('0x4d')]=[{'all':!![]}];}return db[_0x0034('0x59')][_0x0034('0x5e')](_0xe59225);})[_0x0034('0x16')](function(_0x49df65){_0x109372[_0x0034('0x49')]=_0x49df65;return _0x109372;});}})['then'](respondWithFilteredResult(_0x1d1a85,_0xe59225))[_0x0034('0x20')](handleError(_0x1d1a85,null));};exports[_0x0034('0x5f')]=function(_0x32d5a6,_0x5abecd){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x32d5a6[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x5abecd,null))[_0x0034('0x16')](function(_0x25ca4e){if(_0x25ca4e){return _0x25ca4e[_0x0034('0x5f')](_0x32d5a6[_0x0034('0x39')]['ids']);}})[_0x0034('0x16')](respondWithStatusCode(_0x5abecd,null))[_0x0034('0x20')](handleError(_0x5abecd,null));};exports[_0x0034('0x60')]=function(_0x5a0dd6,_0x1bd869){if(_0x5a0dd6[_0x0034('0x50')]['id']){delete _0x5a0dd6[_0x0034('0x50')]['id'];}return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x5a0dd6[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bd869,null))[_0x0034('0x16')](function(_0x406a2){if(_0x406a2){_0x5a0dd6['body'][_0x0034('0x61')]=_0x406a2['id'];return db[_0x0034('0x62')][_0x0034('0x4f')](_0x5a0dd6['body']);}})['then'](respondWithResult(_0x1bd869,null))['catch'](handleError(_0x1bd869,null));};exports[_0x0034('0x63')]=function(_0x51d1c5,_0x3dbf48){var _0x543bb3={'raw':![],'where':{}};var _0x56429e={};var _0x1673ef={'count':0x0,'rows':[]};return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x51d1c5['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x3dbf48,null))[_0x0034('0x16')](function(_0xb2993f){if(_0xb2993f){_0x56429e[_0x0034('0x37')]=_[_0x0034('0x3a')](db['CannedAnswer'][_0x0034('0x33')]);_0x56429e[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x51d1c5[_0x0034('0x39')]);_0x56429e[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x56429e[_0x0034('0x37')],_0x56429e[_0x0034('0x39')]);_0x543bb3[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x56429e[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x51d1c5['query']['fields']));_0x543bb3[_0x0034('0x3d')]=_0x543bb3[_0x0034('0x3d')][_0x0034('0x3f')]?_0x543bb3[_0x0034('0x3d')]:_0x56429e[_0x0034('0x37')];if(!_0x51d1c5[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x543bb3[_0x0034('0x27')]=qs['limit'](_0x51d1c5[_0x0034('0x39')][_0x0034('0x27')]);_0x543bb3[_0x0034('0x25')]=qs['offset'](_0x51d1c5['query'][_0x0034('0x25')]);}_0x543bb3['order']=qs[_0x0034('0x42')](_0x51d1c5[_0x0034('0x39')]['sort']);_0x543bb3[_0x0034('0x45')]=qs['filters'](_[_0x0034('0x5d')](_0x51d1c5[_0x0034('0x39')],_0x56429e[_0x0034('0x3b')]));_0x543bb3['where']['ChatWebsiteId']=_0xb2993f['id'];if(_0x51d1c5[_0x0034('0x39')][_0x0034('0x43')]){_0x543bb3['where']=_[_0x0034('0x44')](_0x543bb3[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x543bb3[_0x0034('0x3d')],function(_0x177ba1){var _0x2ba8ae={};_0x2ba8ae[_0x177ba1]={'$like':'%'+_0x51d1c5[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x2ba8ae;})});}_0x543bb3=_[_0x0034('0x44')]({},_0x543bb3,_0x51d1c5[_0x0034('0x47')]);return db[_0x0034('0x62')][_0x0034('0x28')]({'where':_0x543bb3[_0x0034('0x45')]})[_0x0034('0x16')](function(_0x4d91ae){_0x1673ef[_0x0034('0x28')]=_0x4d91ae;if(_0x51d1c5[_0x0034('0x39')]['includeAll']){_0x543bb3['include']=[{'all':!![]}];}return db[_0x0034('0x62')][_0x0034('0x5e')](_0x543bb3);})[_0x0034('0x16')](function(_0x597a1d){_0x1673ef['rows']=_0x597a1d;return _0x1673ef;});}})['then'](respondWithFilteredResult(_0x3dbf48,_0x543bb3))[_0x0034('0x20')](handleError(_0x3dbf48,null));};exports[_0x0034('0x64')]=function(_0x7a0f24,_0x2701eb){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x7a0f24[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x2701eb,null))[_0x0034('0x16')](function(_0x3888d8){if(_0x3888d8){return _0x3888d8[_0x0034('0x64')](_0x7a0f24[_0x0034('0x39')][_0x0034('0x65')]);}})['then'](respondWithStatusCode(_0x2701eb,null))[_0x0034('0x20')](handleError(_0x2701eb,null));};exports[_0x0034('0x66')]=function(_0x3c36f6,_0x1ca5d7){_0x3c36f6['body']['sitepic']=_0x3c36f6[_0x0034('0x67')][_0x0034('0x68')];return db['ChatWebsite']['find']({'where':{'id':_0x3c36f6[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x1ca5d7,null))['then'](saveUpdates(_0x3c36f6[_0x0034('0x50')],null))[_0x0034('0x16')](respondWithResult(_0x1ca5d7,null))[_0x0034('0x20')](handleError(_0x1ca5d7,null));};exports[_0x0034('0x69')]=function(_0x2de6d1,_0x218ac0){_0x2de6d1[_0x0034('0x50')]['agentAvatar']=_0x2de6d1[_0x0034('0x67')][_0x0034('0x68')];return db['ChatWebsite']['find']({'where':{'id':_0x2de6d1[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x218ac0,null))[_0x0034('0x16')](saveUpdates(_0x2de6d1['body'],null))[_0x0034('0x16')](respondWithResult(_0x218ac0,null))[_0x0034('0x20')](handleError(_0x218ac0,null));};exports[_0x0034('0x6a')]=function(_0x1997f7,_0x572748){_0x1997f7['body'][_0x0034('0x6b')]=_0x1997f7['file'][_0x0034('0x68')];return db['ChatWebsite'][_0x0034('0x4e')]({'where':{'id':_0x1997f7[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x572748,null))['then'](saveUpdates(_0x1997f7[_0x0034('0x50')],null))['then'](respondWithResult(_0x572748,null))[_0x0034('0x20')](handleError(_0x572748,null));};exports['addSystemAvatar']=function(_0x35d75c,_0x20410c){_0x35d75c[_0x0034('0x50')]['systemAvatar']=_0x35d75c[_0x0034('0x67')]['filename'];return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x35d75c[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x20410c,null))[_0x0034('0x16')](saveUpdates(_0x35d75c['body'],null))[_0x0034('0x16')](respondWithResult(_0x20410c,null))[_0x0034('0x20')](handleError(_0x20410c,null));};exports[_0x0034('0x6c')]=function(_0x1017d3,_0x2633c3){var _0x1f9497=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x6f'));var _0x47b084={'where':{'id':_0x1017d3['params']['id']},'attributes':['id',_0x0034('0x70')],'raw':!![]};var _0x3f1cef=![];return require(_0x0034('0x71'))['getLicense']()[_0x0034('0x16')](function(_0x1cf0ab){if(_0x1cf0ab){_0x3f1cef=_0x1cf0ab['custom'];}})[_0x0034('0x16')](function(){return db[_0x0034('0x32')][_0x0034('0x4e')](_0x47b084);})[_0x0034('0x16')](handleEntityNotFound(_0x2633c3,null))['then'](function(_0x1a9c99){if(_0x1a9c99){if(!_[_0x0034('0x72')](_0x1a9c99[_0x0034('0x70')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x74'),_0x1a9c99[_0x0034('0x70')]))&&_0x3f1cef){_0x1f9497=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x74'),_0x1a9c99[_0x0034('0x70')]);}}return _0x2633c3[_0x0034('0x75')](_0x1f9497);}})[_0x0034('0x20')](handleError(_0x2633c3,null));};exports[_0x0034('0x76')]=function(_0x28ec3f,_0x299367){var _0x27b621=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x77'));var _0x5c2aa2={'where':{'id':_0x28ec3f[_0x0034('0x4b')]['id']},'attributes':['id',_0x0034('0x78')],'raw':!![]};return db[_0x0034('0x32')][_0x0034('0x4e')](_0x5c2aa2)['then'](handleEntityNotFound(_0x299367,null))[_0x0034('0x16')](function(_0x14796c){if(_0x14796c){if(!_['isNil'](_0x14796c[_0x0034('0x78')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config['root'],_0x0034('0x79'),_0x14796c[_0x0034('0x78')]))){_0x27b621=path[_0x0034('0x6d')](config['root'],_0x0034('0x79'),_0x14796c[_0x0034('0x78')]);}}return _0x299367[_0x0034('0x75')](_0x27b621);}})[_0x0034('0x20')](handleError(_0x299367,null));};exports['getCustomerAvatar']=function(_0x3093fc,_0x582064){var _0x4f06bd=path[_0x0034('0x6d')](config[_0x0034('0x6e')],'server/files/images/avatars/customer_avatar.png');var _0x509047={'where':{'id':_0x3093fc['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x0034('0x32')][_0x0034('0x4e')](_0x509047)[_0x0034('0x16')](handleEntityNotFound(_0x582064,null))['then'](function(_0x342ce5){if(_0x342ce5){if(!_[_0x0034('0x72')](_0x342ce5[_0x0034('0x6b')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x79'),_0x342ce5[_0x0034('0x6b')]))&&_0x342ce5['showCustomerAvatar']){_0x4f06bd=path[_0x0034('0x6d')](config[_0x0034('0x6e')],'server/files/images/avatars/',_0x342ce5['customerAvatar']);}}return _0x582064['download'](_0x4f06bd);}})[_0x0034('0x20')](handleError(_0x582064,null));};exports[_0x0034('0x7a')]=function(_0x53f5d1,_0x568929){var _0xb141b4=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x7b'));var _0x48216b={'where':{'id':_0x53f5d1['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x0034('0x4e')](_0x48216b)[_0x0034('0x16')](handleEntityNotFound(_0x568929,null))['then'](function(_0x3e56d0){if(_0x3e56d0){if(!_[_0x0034('0x72')](_0x3e56d0[_0x0034('0x7c')])){if(fs[_0x0034('0x73')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],'server/files/images/avatars/',_0x3e56d0[_0x0034('0x7c')]))){_0xb141b4=path[_0x0034('0x6d')](config['root'],_0x0034('0x79'),_0x3e56d0[_0x0034('0x7c')]);}}return _0x568929[_0x0034('0x75')](_0xb141b4);}})[_0x0034('0x20')](handleError(_0x568929,null));};exports[_0x0034('0x7d')]=function(_0x4640d7,_0x337bbc){var _0x415cd0=require(_0x0034('0x7e'));var _0x405c34=new _0x415cd0();var _0x375894=_0x405c34['setUA'](_0x4640d7[_0x0034('0x7f')]['user-agent'])[_0x0034('0x80')]();var _0x2fcb33={'body':_0x4640d7[_0x0034('0x50')],'channel':'chat'};var _0x3df169=[];var _0xfdbdbd=[];var _0x4d367c={};var _0xbd2533=![];return db[_0x0034('0x81')][_0x0034('0x57')]()[_0x0034('0x16')](function(_0x43c730){if(!_0x43c730){throw new db['Sequelize'][(_0x0034('0x82'))](_0x0034('0x83'));}_0x3df169=_[_0x0034('0x84')](_[_0x0034('0x3a')](_0x43c730),[_0x0034('0x85'),_0x0034('0x86')]);_0xfdbdbd=_[_0x0034('0x84')](_[_0x0034('0x3a')](_0x43c730),[_0x0034('0x85'),_0x0034('0x86'),'CompanyId',_0x0034('0x87')]);if(_0x4640d7[_0x0034('0x50')]['id']){delete _0x4640d7[_0x0034('0x50')]['id'];}if(_[_0x0034('0x72')](_0x4640d7[_0x0034('0x50')][_0x0034('0x88')])){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8a'));}if(_[_0x0034('0x72')](_0x4640d7[_0x0034('0x50')][_0x0034('0x50')])||_0x4640d7[_0x0034('0x50')]['body']===''){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8b'));}if(_['isNil'](_0x4640d7[_0x0034('0x50')][_0x0034('0x8c')])){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8d')+_0xfdbdbd);}if(!_[_0x0034('0x8e')](_0xfdbdbd,_0x4640d7[_0x0034('0x50')]['mapKey'])){throw new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0x8f')+_0xfdbdbd);}_0x4d367c[_0x4640d7[_0x0034('0x50')][_0x0034('0x8c')]]=_0x4640d7[_0x0034('0x50')][_0x0034('0x88')];})[_0x0034('0x16')](function(){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x4640d7['params']['id']},'include':[{'model':db[_0x0034('0x90')],'as':_0x0034('0x91'),'include':[{'model':db[_0x0034('0x81')],'as':_0x0034('0x92'),'where':_0x4d367c,'limit':0x1,'order':[[_0x0034('0x86'),'DESC']]}]},{'model':db[_0x0034('0x93')],'as':_0x0034('0x94')}]});})[_0x0034('0x16')](handleEntityNotFound(_0x337bbc,null))[_0x0034('0x16')](function(_0xe2461){if(_0xe2461&&_0xe2461[_0x0034('0x91')]){_0x2fcb33[_0x0034('0x95')]=_0xe2461;_0x2fcb33[_0x0034('0x96')]=_0xe2461[_0x0034('0x94')];_0x2fcb33[_0x0034('0x97')]=_0xe2461[_0x0034('0x91')];_0x2fcb33[_0x0034('0x96')]=_[_0x0034('0x98')](_0x2fcb33[_0x0034('0x96')],[_0x0034('0x99')],[_0x0034('0x9a')]);if(_0x2fcb33[_0x0034('0x95')]['Applications']){delete _0x2fcb33['account'][_0x0034('0x94')];}if(_0x2fcb33[_0x0034('0x95')]['List']&&_0x2fcb33['account']['List'][_0x0034('0x92')]['length']){return _0x2fcb33[_0x0034('0x95')][_0x0034('0x91')]['Contacts'][0x0];}var _0x4d729f=_['defaults'](_0x4640d7[_0x0034('0x50')],{'firstName':_0x4640d7[_0x0034('0x50')][_0x0034('0x88')],'ListId':_0xe2461[_0x0034('0x87')]});_0x4d729f[_0x4640d7['body'][_0x0034('0x8c')]]=_0x4640d7[_0x0034('0x50')]['from'];return db[_0x0034('0x81')][_0x0034('0x4f')](_0x4d729f,{'fields':_0x3df169,'raw':!![]});}})[_0x0034('0x16')](handleEntityNotFound(_0x337bbc,null))[_0x0034('0x16')](function(_0x1ff00f){_0x2fcb33[_0x0034('0x9b')]=_0x1ff00f;var _0x42b939=_0x4640d7[_0x0034('0x50')][_0x0034('0x9c')];if(_0x4640d7[_0x0034('0x7f')][_0x0034('0x9d')]){_0x42b939=_0x4640d7['headers'][_0x0034('0x9d')];}else if(_0x4640d7[_0x0034('0x7f')][_0x0034('0x9e')]){_0x42b939=_['first'](_0x4640d7['headers'][_0x0034('0x9e')][_0x0034('0x9f')](','));}if(_0x1ff00f){var _0x23d1e1={'ContactId':_0x1ff00f['id'],'ChatWebsiteId':_0x4640d7['params']['id'],'from':(_0x1ff00f[_0x0034('0xa0')]||'')+'\x20'+(_0x1ff00f['lastName']||''),'customerIp':_0x42b939,'customerPort':_0x4640d7[_0x0034('0x7f')][_0x0034('0xa1')]?_0x4640d7[_0x0034('0x7f')][_0x0034('0xa1')]:null,'referer':_0x4640d7['body']['referer'],'browserName':_0x375894['browser'][_0x0034('0x2f')]&&_0x375894[_0x0034('0xa2')][_0x0034('0xa3')]?util[_0x0034('0xa4')](_0x0034('0xa5'),_0x375894[_0x0034('0xa2')][_0x0034('0x2f')],_0x375894['browser'][_0x0034('0xa3')]):_0x0034('0xa6'),'browserVersion':_0x375894[_0x0034('0xa2')][_0x0034('0xa3')]||'unknown','osName':util[_0x0034('0xa4')](_0x0034('0xa5'),_0x375894['os'][_0x0034('0x2f')],_0x375894['os'][_0x0034('0xa3')]),'osVersion':_0x375894['os']['version'],'deviceModel':_0x375894[_0x0034('0xa7')][_0x0034('0x37')]&&_0x375894[_0x0034('0xa7')][_0x0034('0xa8')]?util[_0x0034('0xa4')](_0x0034('0xa9'),_0x375894['device'][_0x0034('0x37')],_0x375894[_0x0034('0xa7')]['vendor'],_0x375894[_0x0034('0xa7')][_0x0034('0x35')]):null,'deviceVendor':_0x375894['device'][_0x0034('0xa8')],'deviceType':_0x375894['device'][_0x0034('0x35')],'formData':JSON[_0x0034('0x1b')](_0x4640d7[_0x0034('0x50')])};var _0x265cba={'ChatWebsiteId':_0x4640d7[_0x0034('0x4b')]['id'],'closed':![]};if(_0x4640d7['body'][_0x0034('0xaa')]){_0x265cba['threadId']=_0x4640d7[_0x0034('0x50')][_0x0034('0xaa')];return db[_0x0034('0xab')][_0x0034('0x4e')]({'where':_0x265cba})[_0x0034('0x16')](function(_0x11673f){if(_0x11673f){return[_0x11673f,![]];}_0x23d1e1[_0x0034('0xaa')]=_0x4640d7[_0x0034('0x50')][_0x0034('0xaa')];_0x23d1e1[_0x0034('0xac')]=_0x4640d7['body'][_0x0034('0xac')];return db['ChatInteraction'][_0x0034('0x4f')](_0x23d1e1)[_0x0034('0x16')](function(_0x2ac908){return[_0x2ac908,!![]];});});}_0x265cba['ContactId']=_0x1ff00f['id'];if(_0x4640d7[_0x0034('0x50')][_0x0034('0xad')]&&_0x4640d7[_0x0034('0x50')]['interaction']['id']){_0x265cba['id']=_0x4640d7[_0x0034('0x50')][_0x0034('0xad')]['id'];return db[_0x0034('0xab')][_0x0034('0x4e')]({'where':_0x265cba})[_0x0034('0x16')](function(_0x46651d){if(_0x46651d){return[_0x46651d,![]];}return db[_0x0034('0xab')][_0x0034('0x4f')](_0x23d1e1)[_0x0034('0x16')](function(_0x317507){return[_0x317507,!![]];});});}return db[_0x0034('0xab')][_0x0034('0x4f')](_0x23d1e1)['then'](function(_0x5640fa){return[_0x5640fa,!![]];});}})['spread'](function(_0x479b64,_0xc70c52){if(_0x479b64){_0xbd2533=_0xc70c52;if(!_0xc70c52){var _0x5ce37b={'from':(_0x2fcb33[_0x0034('0x9b')][_0x0034('0xa0')]||'')+'\x20'+(_0x2fcb33[_0x0034('0x9b')][_0x0034('0xae')]||'')};if(_0x4640d7['body']['threadId']&&_0x4640d7[_0x0034('0x50')]['messageId']&&_0x4640d7[_0x0034('0x50')]['threadId']!=_0x4640d7[_0x0034('0x50')][_0x0034('0xaf')]){_0x5ce37b[_0x0034('0xaa')]=_0x4640d7[_0x0034('0x50')]['messageId'];}return _0x479b64['update'](_0x5ce37b);}else{return _0x479b64;}}})[_0x0034('0x16')](function(_0x29a931){_0x2fcb33[_0x0034('0xad')]=_0x29a931['get']({'plain':!![]});_0x2fcb33[_0x0034('0xad')][_0x0034('0xb0')]=_0xbd2533;if(_0x2fcb33[_0x0034('0xad')][_0x0034('0xb0')]){if(_0x2fcb33[_0x0034('0x95')]['autoclose']){_0x2fcb33['applications'][_0x0034('0xb1')]({'id':0x0,'priority':_0x2fcb33[_0x0034('0x96')][_0x0034('0x3f')]+0x1,'app':_0x0034('0xb2'),'appdata':_0x0034('0xb3'),'interval':_0x0034('0xb4')});}}return db[_0x0034('0xb5')][_0x0034('0x4f')]({'body':_0x4640d7['body'][_0x0034('0x50')],'ChatWebsiteId':_0x4640d7[_0x0034('0x4b')]['id'],'ChatInteractionId':_0x29a931['id'],'direction':'in','ContactId':_0x2fcb33['contact']['id'],'AttachmentId':_0x4640d7['body']['AttachmentId']});})[_0x0034('0x16')](function(_0x1413a3){_0x2fcb33[_0x0034('0x1f')]=_0x1413a3;if(_0x2fcb33[_0x0034('0xad')][_0x0034('0xb6')]){return db['User']['find']({'attributes':['id',_0x0034('0x2f')],'where':{'id':_0x2fcb33[_0x0034('0xad')][_0x0034('0xb6')]}})[_0x0034('0x16')](function(_0x3b7fb0){if(_0x3b7fb0){_0x2fcb33[_0x0034('0x96')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0034('0xb7'),'appdata':_0x3b7fb0['name']+','+(_0x2fcb33[_0x0034('0x95')][_0x0034('0xb8')]||0xa),'interval':_0x0034('0xb4')});_0x2fcb33[_0x0034('0xb9')]=!![];}return respondWithRpcPromise(_0x0034('0xba'),'startRouting',_0x2fcb33);});}return respondWithRpcPromise('Start',_0x0034('0xbb'),_0x2fcb33);})['then'](function(_0x4f5540){respondWithRpcPromise(_0x0034('0xbc'),_0x0034('0xbc'),{'event':_0x0034('0x7d'),'message':_0x4f5540},client9002);return _0x4f5540;})['then'](respondWithResult(_0x337bbc,null))['catch'](handleError(_0x337bbc,null));};exports[_0x0034('0xbd')]=function(_0x335a9f,_0x3106bb){var _0x3269fb,_0x49f407,_0x6788a6;var _0x65a599=[];var _0x395102={};var _0x57e793=_0x335a9f[_0x0034('0xbe')]||[];var _0x97b2b9=[];var _0x145ad1;return db[_0x0034('0x81')][_0x0034('0x57')]()[_0x0034('0x16')](function(_0x376000){if(!_0x376000){throw new db['Sequelize'][(_0x0034('0x82'))](_0x0034('0x83'));}_0x65a599=_[_0x0034('0x84')](_['keys'](_0x376000),['createdAt',_0x0034('0x86'),'CompanyId',_0x0034('0x87')]);if(_0x335a9f[_0x0034('0x50')]['id']){delete _0x335a9f[_0x0034('0x50')]['id'];}if(_[_0x0034('0x72')](_0x335a9f[_0x0034('0x50')][_0x0034('0x88')])){throw _0x3106bb[_0x0034('0x22')](0x1f4)[_0x0034('0xbf')](new db[(_0x0034('0x89'))][(_0x0034('0x82'))]('from\x20is\x20mandatory'));}if(_[_0x0034('0x72')](_0x335a9f[_0x0034('0x50')][_0x0034('0x50')])||_0x335a9f[_0x0034('0x50')][_0x0034('0x50')]===''){throw _0x3106bb[_0x0034('0x22')](0x1f4)[_0x0034('0xbf')](new db['Sequelize']['ValidationError'](_0x0034('0x8b')));}if(_[_0x0034('0x72')](_0x335a9f['body'][_0x0034('0xc0')])){throw _0x3106bb[_0x0034('0x22')](0x1f4)[_0x0034('0xbf')](new db[(_0x0034('0x89'))][(_0x0034('0x82'))](_0x0034('0xc1')+_0x65a599));}if(!_[_0x0034('0x8e')](_0x65a599,_0x335a9f['body']['mapKeyOffline'])){throw _0x3106bb['status'](0x1f4)['send'](new db[(_0x0034('0x89'))]['ValidationError'](_0x0034('0xc2')+_0x65a599));}_0x395102[_0x335a9f[_0x0034('0x50')][_0x0034('0xc0')]]=_0x335a9f[_0x0034('0x50')]['from'];})[_0x0034('0x16')](function(){return db[_0x0034('0x32')]['find']({'where':{'id':_0x335a9f['params']['id']},'include':[{'model':db[_0x0034('0x90')],'as':'List'},{'model':db[_0x0034('0xc3')],'as':_0x0034('0xc3')}]});})[_0x0034('0x16')](handleEntityNotFound(_0x3106bb,null))['then'](function(_0xc7ab5e){if(_0xc7ab5e&&_0xc7ab5e[_0x0034('0x91')]){_0x49f407=_0xc7ab5e;var _0x597490=_[_0x0034('0xd')](_0x335a9f['body'],{'firstName':_0x335a9f[_0x0034('0x50')][_0x0034('0x88')],'phone':_0x335a9f[_0x0034('0x50')][_0x0034('0x88')],'ListId':_0xc7ab5e['ListId']});_0x597490[_0x335a9f['body'][_0x0034('0xc0')]]=_0x335a9f['body'][_0x0034('0x88')];return db[_0x0034('0x81')][_0x0034('0xc4')]({'where':_0x395102,'defaults':_0x597490});}})[_0x0034('0xc5')](function(_0xc423e6){if(_0xc423e6){_0x6788a6=_0xc423e6;var _0x4fbb74=fs['readFileSync'](path[_0x0034('0x6d')](config['root'],_0x0034('0xc6')),_0x0034('0xc7'));var _0x589a52=ejs[_0x0034('0xc8')](_0x4fbb74,{'body':_['toPairs'](_0x335a9f['body'][_0x0034('0x50')]),'bodyTitle':_0x49f407[_0x0034('0xc9')]});return db[_0x0034('0xca')][_0x0034('0x4f')]({'body':_0x589a52,'plainBody':htmlToText[_0x0034('0xcb')](_0x589a52),'ContactId':_0xc423e6['id'],'ChatWebsiteId':_0x49f407['id']});}})[_0x0034('0x16')](function(_0x31b434){_0x145ad1=_0x31b434;if(_0x57e793[_0x0034('0x3f')]){var _0x13a168=_0x57e793['map'](function(_0x1b3ae3){return{'name':_0x1b3ae3['originalname'],'basename':_0x1b3ae3[_0x0034('0x68')],'type':_0x1b3ae3[_0x0034('0xcc')],'ChatOfflineMessageId':_0x31b434['id']};});_0x97b2b9=_0x13a168[_0x0034('0x38')](_0x251f80=>{var _0xed7213={'filename':_0x251f80[_0x0034('0x2f')],'path':path['join'](config['root'],_0x0034('0xcd'),_0x0034('0xbe'),'attachments',_0x0034('0xce'),_0x251f80[_0x0034('0xcf')])};return _0xed7213;});if(!_0x49f407[_0x0034('0xd0')]){return db[_0x0034('0xd1')]['transaction'](function(_0x311d19){return db[_0x0034('0xd2')][_0x0034('0xd3')](_0x13a168,{'transaction':_0x311d19});});}}})['then'](function(){if(_0x145ad1){_0x3269fb=_0x145ad1;return db[_0x0034('0xc3')][_0x0034('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x0034('0xd4')],'as':_0x0034('0xd5'),'raw':!![],'include':[{'model':db[_0x0034('0xd6')],'as':_0x0034('0xd6'),'raw':!![]}]}]});}})[_0x0034('0x16')](function(_0x1ef6c9){if(_0x1ef6c9&&_0x1ef6c9[_0x0034('0xd5')]&&_0x49f407[_0x0034('0xd7')]&&_0x49f407['forwardOfflineAddress']){var _0x29a6cc=_0x1ef6c9[_0x0034('0xd8')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x29a6cc,'message':{'from':util[_0x0034('0xa4')](_0x0034('0xd9'),_0x1ef6c9[_0x0034('0x2f')],_0x1ef6c9[_0x0034('0xda')]||_0x1ef6c9[_0x0034('0xd5')]['user']),'to':_0x49f407[_0x0034('0xdb')],'subject':_0x49f407[_0x0034('0xdc')],'html':_0x3269fb[_0x0034('0x50')],'attachments':_0x97b2b9}},client9003)[_0x0034('0x16')](function(){return _0x3269fb;})['catch'](function(_0xaa920d){logger[_0x0034('0x1c')](_0xaa920d);});}})[_0x0034('0x16')](function(){if(_0x49f407&&_0x49f407['openNewInteraction']&&_0x49f407[_0x0034('0xdd')]){var _0x483b96=[];if(_0x57e793[_0x0034('0x3f')]){_0x483b96=_0x57e793[_0x0034('0x38')](function(_0x5da66b){return{'name':_0x5da66b[_0x0034('0xde')],'basename':_0x5da66b[_0x0034('0x68')],'type':_0x5da66b[_0x0034('0xcc')],'ChatOfflineMessageId':_0x145ad1['id']};});}var _0x3f9925;if(!_[_0x0034('0x72')](_0x49f407[_0x0034('0xdf')])){var _0x58fd3d=_[_0x0034('0x38')](_0x335a9f[_0x0034('0x50')],function(_0x8e754a){return _0x8e754a;});var _0x138367=_['toPairsIn'](_0x58fd3d)[0x0];var _0x1c299d=_[_0x0034('0xe0')](_0x138367,function(_0x59bcdb){return _0x59bcdb;});_0x3f9925=_0x1c299d[0x1][_0x49f407[_0x0034('0xdf')]];}var _0x5b8444={'from':_0x6788a6[_0x0034('0xda')],'firstName':_0x6788a6[_0x0034('0xa0')],'lastName':_0x6788a6[_0x0034('0xae')],'mapKey':'email','message':{'from':_0x6788a6['email'],'to':_0x49f407[_0x0034('0xc3')][_0x0034('0xda')],'cc':'','subject':_[_0x0034('0x72')](_0x3f9925)?_0x49f407[_0x0034('0xdc')]:_0x3f9925,'messageId':'','sentAt':new Date(),'attach':_0x483b96[_0x0034('0x3f')],'attachments':_0x483b96,'originChannel':_0x0034('0xe1'),'ChatWebsiteId':_0x49f407['id'],'ChatOfflineMessageId':_0x3269fb['id'],'originTo':_0x49f407[_0x0034('0xc3')][_0x0034('0xda')]},'body':_0x3269fb['body']};var _0x567b9f={'account':{'id':_0x49f407[_0x0034('0xdd')]},'body':_0x5b8444,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x0034('0xe2'),_0x0034('0xe3'),_0x567b9f,client9001)['then'](function(){return _0x3269fb;})[_0x0034('0x20')](function(_0xd5240a){logger[_0x0034('0x1c')](_0xd5240a);});}return;})[_0x0034('0x16')](function(){if(_0x3269fb){return _0x3269fb;}})[_0x0034('0x16')](respondWithResult(_0x3106bb,null))['catch'](function(_0x17c6d0){logger[_0x0034('0x1c')](_0x0034('0x20'),_0x17c6d0);for(var _0x1243b4 of _0x57e793){var _0x131634=path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0xcd'),_0x0034('0xbe'),_0x0034('0xe4'),_0x0034('0xce'),_0x1243b4[_0x0034('0x68')]);fs_extra[_0x0034('0xe5')](_0x131634)[_0x0034('0x20')](function(_0x1779a2){logger[_0x0034('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x131634,_0x1779a2);});}});};exports[_0x0034('0xe6')]=function(_0x4d664b,_0x58966a){return db['ChatInteraction'][_0x0034('0x4e')]({'where':{'id':_0x4d664b['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x58966a,null))[_0x0034('0x16')](function(_0x4f0442){if(_0x4f0442){return _0x4f0442[_0x0034('0xe6')](_0x4d664b[_0x0034('0x50')]['ids'],_['omit'](_0x4d664b['body'],[_0x0034('0x65'),'id'])||{});}})['then'](respondWithResult(_0x58966a,null))[_0x0034('0x20')](handleError(_0x58966a,null));};exports[_0x0034('0xe7')]=function(_0x512fab,_0x44aaf6){var _0x432b3e={'raw':![],'where':{}};var _0x4ace8a={};var _0x18c4bf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0034('0x5b')]({'where':{'id':_0x512fab['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x44aaf6,null))[_0x0034('0x16')](function(_0x100757){if(_0x100757){_0x4ace8a['model']=_[_0x0034('0x3a')](db[_0x0034('0xab')][_0x0034('0x33')]);_0x4ace8a[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x512fab[_0x0034('0x39')]);_0x4ace8a[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x4ace8a[_0x0034('0x37')],_0x4ace8a[_0x0034('0x39')]);_0x432b3e['attributes']=_[_0x0034('0x3c')](_0x4ace8a[_0x0034('0x37')],qs['fields'](_0x512fab['query'][_0x0034('0x3e')]));_0x432b3e['attributes']=_0x432b3e[_0x0034('0x3d')][_0x0034('0x3f')]?_0x432b3e['attributes']:_0x4ace8a[_0x0034('0x37')];if(!_0x512fab[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x432b3e[_0x0034('0x27')]=qs[_0x0034('0x27')](_0x512fab[_0x0034('0x39')][_0x0034('0x27')]);_0x432b3e[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x512fab[_0x0034('0x39')][_0x0034('0x25')]);}_0x432b3e[_0x0034('0x5c')]=qs['sort'](_0x512fab[_0x0034('0x39')][_0x0034('0x42')]);_0x432b3e[_0x0034('0x45')]=qs['filters'](_[_0x0034('0x5d')](_0x512fab[_0x0034('0x39')],_0x4ace8a['filters']));_0x432b3e[_0x0034('0x45')][_0x0034('0x61')]=_0x100757['id'];if(_0x512fab[_0x0034('0x39')][_0x0034('0x43')]){_0x432b3e['where']=_[_0x0034('0x44')](_0x432b3e[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x432b3e[_0x0034('0x3d')],function(_0x26715b){var _0x1279c4={};_0x1279c4[_0x26715b]={'$like':'%'+_0x512fab[_0x0034('0x39')]['filter']+'%'};return _0x1279c4;})});}_0x432b3e=_['merge']({},_0x432b3e,_0x512fab[_0x0034('0x47')]);return db['ChatInteraction']['count']({'where':_0x432b3e['where']})[_0x0034('0x16')](function(_0x255df2){_0x18c4bf[_0x0034('0x28')]=_0x255df2;if(_0x512fab['query'][_0x0034('0x48')]){_0x432b3e[_0x0034('0x4d')]=[{'model':db[_0x0034('0x81')],'as':_0x0034('0xe8'),'required':![]},{'model':db[_0x0034('0xe9')],'as':'Owner','attributes':[_0x0034('0x2f'),_0x0034('0xea'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x0034('0xeb'),'attributes':['id',_0x0034('0x2f'),'color'],'where':_0x512fab[_0x0034('0x39')]['tag']?{'id':_0x512fab[_0x0034('0x39')][_0x0034('0xec')]}:undefined,'required':_0x512fab[_0x0034('0x39')][_0x0034('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x0034('0x5e')](_0x432b3e);})[_0x0034('0x16')](function(_0x301860){_0x18c4bf[_0x0034('0x49')]=_0x301860;return _0x18c4bf;});}})[_0x0034('0x16')](respondWithFilteredResult(_0x44aaf6,_0x432b3e))['catch'](handleError(_0x44aaf6,null));};function iftimePromise(_0x2c63ea,_0x44b6ea){return respondWithRpcPromise(_0x0034('0xed'),_0x0034('0xee'),{'command':_0x44b6ea[_0x0034('0xef')]?util['format']('iftime\x20%s,%s',_0x2c63ea[_0x0034('0xf0')],_0x44b6ea['timezone']):util[_0x0034('0xa4')](_0x0034('0xf1'),_0x2c63ea[_0x0034('0xf0')])},client9002)['then'](function(_0x455c3c){var _0x1c0a04=_0x455c3c&&_0x455c3c['indexOf'](_0x0034('0xf2'))>=0x0?!![]:![];logger[_0x0034('0x17')](_0x0034('0xf3'),_0x44b6ea['id'],_0x2c63ea['id'],_0x2c63ea[_0x0034('0xf0')],_0x1c0a04?_0x0034('0xf4'):_0x0034('0xf5'),_0x44b6ea['timezone']?_0x44b6ea['timezone']:_0x0034('0xf6'));return _0x1c0a04;})['catch'](function(_0x15fb0c){logger[_0x0034('0x1c')](_0x0034('0xf3'),_0x44b6ea['id'],_0x2c63ea['id'],_0x2c63ea['interval'],util[_0x0034('0xf7')](_0x15fb0c,{'showHidden':![],'depth':null}),_0x44b6ea['timezone']?_0x44b6ea[_0x0034('0xef')]:_0x0034('0xf6'));return![];});}exports[_0x0034('0xee')]=function(_0x4972ce,_0x32cc8d){var _0x37a299=0x0;var _0x28a5dd=0x0;var _0x769dda=![];var _0x441ec9;var _0x1f660e;return db[_0x0034('0x32')]['find']({'where':{'id':_0x4972ce[_0x0034('0x4b')]['id']},'include':[{'model':db[_0x0034('0xf8')],'as':_0x0034('0xf8'),'include':[{'model':db['Interval'],'as':_0x0034('0xf9'),'attributes':['id',_0x0034('0xf0')],'raw':!![]}]}]})[_0x0034('0x16')](handleEntityNotFound(_0x32cc8d,null))[_0x0034('0x16')](function(_0x283ccc){if(_0x283ccc){_0x441ec9=_0x283ccc;return _0x283ccc['getProactiveActions']({'raw':!![]});}})[_0x0034('0x16')](function(_0xcf2ea6){if(_0x441ec9){if(_0xcf2ea6){_0x1f660e=_0xcf2ea6;}}return require(_0x0034('0x71'))[_0x0034('0xfa')]();})[_0x0034('0x16')](function(_0xa441f5){if(_0xa441f5){_0x28a5dd=_0xa441f5[_0x0034('0xfb')];_0x769dda=_0xa441f5[_0x0034('0xfc')];}})[_0x0034('0x16')](function(){return db['ChatInteraction'][_0x0034('0x28')]({'where':{'closed':![]}});})[_0x0034('0x16')](function(_0x54ee78){_0x37a299=_0x54ee78;if(_0x28a5dd&&_0x54ee78>_0x28a5dd){return db[_0x0034('0xfd')][_0x0034('0x5b')]({'where':{'id':0x1}})[_0x0034('0x16')](function(_0x75de71){if(_0x75de71){_0x75de71['increment'](_0x0034('0xfe'));}});}})[_0x0034('0x16')](function(){if(_0x441ec9[_0x0034('0xf8')]&&_0x441ec9[_0x0034('0xf8')]['Intervals']){var _0x17969d=[];for(var _0xf3a830=0x0;_0xf3a830<_0x441ec9[_0x0034('0xf8')][_0x0034('0xf9')]['length'];_0xf3a830++){var _0x143f42=_0x441ec9['Interval'][_0x0034('0xf9')][_0xf3a830][_0x0034('0x2b')]({'plain':!![]});_0x17969d[_0x0034('0xb1')](iftimePromise(_0x143f42,_0x441ec9));}return BPromise[_0x0034('0xff')](_0x17969d)[_0x0034('0x16')](function(_0x14c9f0){return _[_0x0034('0x100')](_0x14c9f0);});}else{return!![];}})['then'](function(_0x871a01){var _0xb00951=fs[_0x0034('0x101')](path[_0x0034('0x6d')](config[_0x0034('0x6e')],_0x0034('0x102')),_0x0034('0xc7'));var _0x9d58c4=new url[(_0x0034('0x103'))](_0x441ec9['address'])['origin'];var _0x43d1ee=_0x0034('0x104');var _0x11afcf=![];var _0x2b630d={'chatVersion':_0x43d1ee,'chatWebsiteAddressOrigin':_0x9d58c4,'remote':_0x441ec9[_0x0034('0x105')],'query':querystring[_0x0034('0x1b')](_[_0x0034('0x44')](_0x441ec9[_0x0034('0x2b')]({'plain':!![]}),{'customerIp':_0x4972ce[_0x0034('0x7f')][_0x0034('0x9e')]||_0x4972ce[_0x0034('0x7f')][_0x0034('0x106')]||_0x4972ce[_0x0034('0x107')][_0x0034('0x108')]||_0x4972ce['ip'],'referer':_0x4972ce['headers'][_0x0034('0x109')],'openedInteractions':_0x37a299,'maxInteractions':_0x28a5dd,'virtual':_0x769dda['virtual'],'online':_0x871a01,'custom':_0x769dda}))[_0x0034('0x10a')](/'/g,'\x5c\x27')};_0x32cc8d[_0x0034('0xbf')](ejs[_0x0034('0xc8')](Mustache[_0x0034('0xc8')](_0xb00951,_0x2b630d),{'proactiveActions':_0x1f660e,'alignment':_0x441ec9[_0x0034('0x10b')],'verticalAlignment':_0x441ec9[_0x0034('0x10c')],'div_color':_0x441ec9['color'],'labelText':_0x441ec9['labelText'],'text_color':_0x441ec9[_0x0034('0x10d')],'text_button_color':_0x441ec9['textButtonColor'],'button_color':_0x441ec9[_0x0034('0x10e')],'background_color':_0x441ec9[_0x0034('0x10f')],'hideWhenOffline':_0x441ec9['hideWhenOffline'],'intervalId':_0x441ec9['IntervalId'],'isDevelopment':_0x11afcf,'chatVersion':_0x43d1ee}));})[_0x0034('0x20')](handleError(_0x32cc8d,null));};exports[_0x0034('0x110')]=function(_0x4e191d,_0x49c424){var _0x12cdd9=_0x4e191d[_0x0034('0x4b')]['id'];var _0x33e8a5=_0x4e191d[_0x0034('0x50')];var _0x536533=0xc8;var _0x2ce73c=null;return db[_0x0034('0xd1')]['transaction']({'isolationLevel':db[_0x0034('0xd1')]['Transaction'][_0x0034('0x111')][_0x0034('0x112')]},function(_0x49e408){return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x12cdd9},'transaction':_0x49e408})[_0x0034('0x16')](function(_0x5077d0){if(_0x5077d0){return db['ChatApplication'][_0x0034('0x2a')]({'where':{'ChatWebsiteId':_0x12cdd9},'transaction':_0x49e408})['then'](function(){var _0x3af708=_[_0x0034('0x38')](_0x33e8a5,function(_0x184ca3){_0x184ca3[_0x0034('0x61')]=_0x12cdd9;return _0x184ca3;});return db[_0x0034('0x93')][_0x0034('0xd3')](_0x3af708,{'transaction':_0x49e408});});}else{_0x536533=0x194;_0x2ce73c=[];}});})['then'](function(){if(_0x536533!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x12cdd9},'order':_0x0034('0x99')})['then'](function(_0x280a73){_0x2ce73c=_0x280a73;});}})[_0x0034('0x20')](function(_0x28e423){_0x536533=0x1f4;logger['error'](_0x28e423[_0x0034('0x2e')]);if(_0x28e423[_0x0034('0x2f')]){delete _0x28e423[_0x0034('0x2f')];}_0x2ce73c=_0x28e423;})[_0x0034('0x113')](function(){if(_0x2ce73c===null){_0x49c424[_0x0034('0x21')](_0x536533);}else{if(_0x536533===0x1f4){_0x49c424['status'](_0x536533)['send'](_0x2ce73c);}else{_0x49c424[_0x0034('0x22')](_0x536533)['json'](_0x2ce73c);}}});};exports['getApplications']=function(_0x2acf2a,_0x182f48){var _0x27e7c7={};var _0x502e54={};var _0x477eab;var _0x710b77;return db['ChatWebsite'][_0x0034('0x5b')]({'where':{'id':_0x2acf2a[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x182f48,null))['then'](function(_0x214a16){if(_0x214a16){_0x477eab=_0x214a16;_0x502e54['model']=_[_0x0034('0x3a')](db[_0x0034('0x93')]['rawAttributes']);_0x502e54['query']=_[_0x0034('0x3a')](_0x2acf2a[_0x0034('0x39')]);_0x502e54[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x502e54['model'],_0x502e54[_0x0034('0x39')]);_0x27e7c7[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x502e54[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x2acf2a[_0x0034('0x39')]['fields']));_0x27e7c7[_0x0034('0x3d')]=_0x27e7c7['attributes'][_0x0034('0x3f')]?_0x27e7c7[_0x0034('0x3d')]:_0x502e54[_0x0034('0x37')];_0x27e7c7[_0x0034('0x5c')]=qs[_0x0034('0x42')](_0x2acf2a[_0x0034('0x39')][_0x0034('0x42')]);_0x27e7c7[_0x0034('0x45')]=qs[_0x0034('0x3b')](_['pick'](_0x2acf2a['query'],_0x502e54[_0x0034('0x3b')]));if(_0x2acf2a[_0x0034('0x39')][_0x0034('0x43')]){_0x27e7c7['where']=_[_0x0034('0x44')](_0x27e7c7['where'],{'$or':_[_0x0034('0x38')](_0x27e7c7[_0x0034('0x3d')],function(_0x44f562){var _0x5ecb0f={};_0x5ecb0f[_0x44f562]={'$like':'%'+_0x2acf2a['query'][_0x0034('0x43')]+'%'};return _0x5ecb0f;})});}_0x27e7c7=_[_0x0034('0x44')]({},_0x27e7c7,_0x2acf2a[_0x0034('0x47')]);return _0x477eab[_0x0034('0x114')](_0x27e7c7);}})['then'](function(_0x514ede){if(_0x514ede){_0x710b77=_0x514ede[_0x0034('0x3f')];if(!_0x2acf2a[_0x0034('0x39')][_0x0034('0x40')]('nolimit')){_0x27e7c7[_0x0034('0x27')]=qs['limit'](_0x2acf2a[_0x0034('0x39')]['limit']);_0x27e7c7[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x2acf2a['query'][_0x0034('0x25')]);}return _0x477eab['getApplications'](_0x27e7c7);}})[_0x0034('0x16')](function(_0x45eac2){if(_0x45eac2){return _0x45eac2?{'count':_0x710b77,'rows':_0x45eac2}:null;}})['then'](respondWithResult(_0x182f48,null))[_0x0034('0x20')](handleError(_0x182f48,null));};exports[_0x0034('0x115')]=function(_0x493095,_0x3c8a9f){return db['chatProactiveAction']['find']({'where':{'id':_0x493095['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x3c8a9f,null))[_0x0034('0x16')](function(_0x56bec3){if(_0x56bec3){return _0x56bec3[_0x0034('0x115')](_0x493095[_0x0034('0x50')][_0x0034('0x65')],_[_0x0034('0x116')](_0x493095[_0x0034('0x50')],['ids','id'])||{});}})[_0x0034('0x16')](respondWithResult(_0x3c8a9f,null))['catch'](handleError(_0x3c8a9f,null));};exports[_0x0034('0x117')]=function(_0xc6806e,_0x366894){var _0x1d8b4a={};var _0x42eab6={};var _0x194f94;var _0x3d1214;return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0xc6806e[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x366894,null))[_0x0034('0x16')](function(_0x31947f){if(_0x31947f){_0x194f94=_0x31947f;_0x42eab6[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0x118')][_0x0034('0x33')]);_0x42eab6[_0x0034('0x39')]=_[_0x0034('0x3a')](_0xc6806e['query']);_0x42eab6[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x42eab6[_0x0034('0x37')],_0x42eab6['query']);_0x1d8b4a[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x42eab6[_0x0034('0x37')],qs[_0x0034('0x3e')](_0xc6806e[_0x0034('0x39')][_0x0034('0x3e')]));_0x1d8b4a[_0x0034('0x3d')]=_0x1d8b4a[_0x0034('0x3d')]['length']?_0x1d8b4a[_0x0034('0x3d')]:_0x42eab6['model'];_0x1d8b4a[_0x0034('0x5c')]=qs['sort'](_0xc6806e[_0x0034('0x39')][_0x0034('0x42')]);_0x1d8b4a[_0x0034('0x45')]=qs['filters'](_['pick'](_0xc6806e[_0x0034('0x39')],_0x42eab6[_0x0034('0x3b')]));if(_0xc6806e[_0x0034('0x39')][_0x0034('0x43')]){_0x1d8b4a[_0x0034('0x45')]=_['merge'](_0x1d8b4a['where'],{'$or':_[_0x0034('0x38')](_0x1d8b4a[_0x0034('0x3d')],function(_0x3cce3d){var _0x374c27={};_0x374c27[_0x3cce3d]={'$like':'%'+_0xc6806e['query'][_0x0034('0x43')]+'%'};return _0x374c27;})});}_0x1d8b4a=_[_0x0034('0x44')]({},_0x1d8b4a,_0xc6806e['options']);return _0x194f94[_0x0034('0x117')](_0x1d8b4a);}})[_0x0034('0x16')](function(_0x10e459){if(_0x10e459){_0x3d1214=_0x10e459[_0x0034('0x3f')];if(!_0xc6806e[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x1d8b4a['limit']=qs[_0x0034('0x27')](_0xc6806e['query'][_0x0034('0x27')]);_0x1d8b4a[_0x0034('0x25')]=qs[_0x0034('0x25')](_0xc6806e[_0x0034('0x39')][_0x0034('0x25')]);}return _0x194f94[_0x0034('0x117')](_0x1d8b4a);}})[_0x0034('0x16')](function(_0x5cd42){if(_0x5cd42){return _0x5cd42?{'count':_0x3d1214,'rows':_0x5cd42}:null;}})[_0x0034('0x16')](respondWithResult(_0x366894,null))['catch'](handleError(_0x366894,null));};exports['getFields']=function(_0x1bae2c,_0x5f135f){var _0x532073=_0x1bae2c[_0x0034('0x39')][_0x0034('0x119')]===_0x0034('0x11a')?_0x0034('0x11b'):'onlineForm';return db[_0x0034('0x32')][_0x0034('0x4e')]({'attributes':['id',_0x532073],'where':{'id':_0x1bae2c['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x5f135f,null))[_0x0034('0x16')](function(_0x456011){if(_0x456011){var _0x4e4573=_0x456011[_0x532073];var _0x9cf77=_0x4e4573&&_0x4e4573[_0x0034('0x11c')]?_0x4e4573[_0x0034('0x11c')]:[];_0x5f135f['send']({'fromKey':_['isNil'](_0x4e4573['fromKey'])?undefined:_0x4e4573[_0x0034('0x11d')],'count':_0x9cf77[_0x0034('0x3f')],'rows':_0x9cf77});}})['catch'](handleError(_0x5f135f,null));};exports['getOfflineMessages']=function(_0x25b3da,_0x189b36){var _0x27e2e9={'raw':![],'where':{}};var _0x537285={};var _0x3fd1bf={'count':0x0,'rows':[]};return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x25b3da[_0x0034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x189b36,null))[_0x0034('0x16')](function(_0xa10e28){if(_0xa10e28){_0x537285[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0xca')]['rawAttributes']);_0x537285['query']=_[_0x0034('0x3a')](_0x25b3da['query']);_0x537285[_0x0034('0x3b')]=_[_0x0034('0x3c')](_0x537285[_0x0034('0x37')],_0x537285[_0x0034('0x39')]);_0x27e2e9[_0x0034('0x3d')]=_[_0x0034('0x3c')](_0x537285[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x25b3da['query'][_0x0034('0x3e')]));_0x27e2e9[_0x0034('0x3d')]=_0x27e2e9[_0x0034('0x3d')][_0x0034('0x3f')]?_0x27e2e9[_0x0034('0x3d')]:_0x537285[_0x0034('0x37')];if(!_0x25b3da[_0x0034('0x39')][_0x0034('0x40')](_0x0034('0x41'))){_0x27e2e9[_0x0034('0x27')]=qs['limit'](_0x25b3da[_0x0034('0x39')][_0x0034('0x27')]);_0x27e2e9[_0x0034('0x25')]=qs[_0x0034('0x25')](_0x25b3da['query'][_0x0034('0x25')]);}_0x27e2e9[_0x0034('0x5c')]=qs[_0x0034('0x42')](_0x25b3da[_0x0034('0x39')]['sort']);_0x27e2e9['where']=qs[_0x0034('0x3b')](_[_0x0034('0x5d')](_0x25b3da[_0x0034('0x39')],_0x537285[_0x0034('0x3b')]));_0x27e2e9[_0x0034('0x45')]['ChatWebsiteId']=_0xa10e28['id'];if(_0x25b3da[_0x0034('0x39')][_0x0034('0x43')]){_0x27e2e9['where']=_[_0x0034('0x44')](_0x27e2e9[_0x0034('0x45')],{'$or':_[_0x0034('0x38')](_0x27e2e9['attributes'],function(_0x2ed6d9){var _0x308f56={};_0x308f56[_0x2ed6d9]={'$like':'%'+_0x25b3da[_0x0034('0x39')][_0x0034('0x43')]+'%'};return _0x308f56;})});}_0x27e2e9=_[_0x0034('0x44')]({},_0x27e2e9,_0x25b3da['options']);return db[_0x0034('0xca')][_0x0034('0x28')]({'where':_0x27e2e9[_0x0034('0x45')]})[_0x0034('0x16')](function(_0xa55687){_0x3fd1bf[_0x0034('0x28')]=_0xa55687;if(_0x25b3da[_0x0034('0x39')][_0x0034('0x48')]){_0x27e2e9[_0x0034('0x4d')]=[{'all':!![]}];}else{_0x27e2e9[_0x0034('0x4d')]=[{'model':db[_0x0034('0x81')],'as':_0x0034('0xe8'),'required':![]},{'model':db[_0x0034('0xd2')],'as':_0x0034('0x11e'),'required':![]}];}return db[_0x0034('0xca')]['findAll'](_0x27e2e9);})[_0x0034('0x16')](function(_0x40fae9){_0x3fd1bf[_0x0034('0x49')]=_0x40fae9;return _0x3fd1bf;});}})[_0x0034('0x16')](respondWithFilteredResult(_0x189b36,_0x27e2e9))['catch'](handleError(_0x189b36,null));};exports[_0x0034('0x11f')]=function(_0x3ed9fc,_0x5109b1){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x3ed9fc[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x5109b1,null))[_0x0034('0x16')](function(_0x5309b3){if(_0x5309b3){return _0x5309b3['addAgents'](_0x3ed9fc['body']['ids'],_[_0x0034('0x116')](_0x3ed9fc[_0x0034('0x50')],[_0x0034('0x65'),'id'])||{})[_0x0034('0xc5')](function(_0x5ea2b2){for(var _0x22ecf5=0x0;_0x22ecf5<_0x3ed9fc[_0x0034('0x50')][_0x0034('0x65')]['length'];_0x22ecf5+=0x1){socket[_0x0034('0x120')](_0x0034('0x121'),{'UserId':Number(_0x3ed9fc[_0x0034('0x50')][_0x0034('0x65')][_0x22ecf5]),'ChatWebsiteId':Number(_0x3ed9fc['params']['id'])});}return _0x5ea2b2;});}})[_0x0034('0x16')](respondWithResult(_0x5109b1,null))['catch'](handleError(_0x5109b1,null));};exports[_0x0034('0x122')]=function(_0x177b53,_0x4da5d4){return db[_0x0034('0x32')][_0x0034('0x4e')]({'where':{'id':_0x177b53['params']['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x4da5d4,null))[_0x0034('0x16')](function(_0x45bfe0){if(_0x45bfe0){return _0x45bfe0[_0x0034('0x122')](_0x177b53['query']['ids'])[_0x0034('0x16')](function(){if(_[_0x0034('0x123')](_0x177b53[_0x0034('0x39')][_0x0034('0x65')])){for(var _0x261c99=0x0;_0x261c99<_0x177b53[_0x0034('0x39')][_0x0034('0x65')][_0x0034('0x3f')];_0x261c99+=0x1){socket[_0x0034('0x120')](_0x0034('0x124'),{'UserId':Number(_0x177b53[_0x0034('0x39')][_0x0034('0x65')][_0x261c99]),'ChatWebsiteId':Number(_0x177b53[_0x0034('0x4b')]['id'])});}}else{socket[_0x0034('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x177b53['query'][_0x0034('0x65')]),'ChatWebsiteId':Number(_0x177b53[_0x0034('0x4b')]['id'])});}});}})[_0x0034('0x16')](respondWithStatusCode(_0x4da5d4,null))[_0x0034('0x20')](handleError(_0x4da5d4,null));};exports[_0x0034('0x125')]=function(_0x3773f9,_0x4fcfc2){var _0x1e695d={};var _0x64d869={};var _0x6798e8;var _0x1110ec;return db[_0x0034('0x32')][_0x0034('0x5b')]({'where':{'id':_0x3773f9[_0x0034('0x4b')]['id']}})[_0x0034('0x16')](handleEntityNotFound(_0x4fcfc2,null))[_0x0034('0x16')](function(_0x167860){if(_0x167860){_0x6798e8=_0x167860;_0x64d869[_0x0034('0x37')]=_[_0x0034('0x3a')](db[_0x0034('0xe9')][_0x0034('0x33')]);_0x64d869[_0x0034('0x39')]=_[_0x0034('0x3a')](_0x3773f9[_0x0034('0x39')]);_0x64d869[_0x0034('0x3b')]=_['intersection'](_0x64d869['model'],_0x64d869[_0x0034('0x39')]);_0x1e695d[_0x0034('0x3d')]=_['intersection'](_0x64d869[_0x0034('0x37')],qs[_0x0034('0x3e')](_0x3773f9['query'][_0x0034('0x3e')]));_0x1e695d[_0x0034('0x3d')]=_0x1e695d['attributes']['length']?_0x1e695d[_0x0034('0x3d')]:_0x64d869[_0x0034('0x37')];_0x1e695d[_0x0034('0x5c')]=qs[_0x0034('0x42')](_0x3773f9[_0x0034('0x39')][_0x0034('0x42')]);_0x1e695d[_0x0034('0x45')]=qs[_0x0034('0x3b')](_[_0x0034('0x5d')](_0x3773f9[_0x0034('0x39')],_0x64d869['filters']));if(_0x3773f9[_0x0034('0x39')]['filter']){_0x1e695d[_0x0034('0x45')]=_[_0x0034('0x44')](_0x1e695d['where'],{'$or':_[_0x0034('0x38')](_0x1e695d[_0x0034('0x3d')],function(_0x51e4c4){var _0x5e8bcb={};_0x5e8bcb[_0x51e4c4]={'$like':'%'+_0x3773f9[_0x0034('0x39')]['filter']+'%'};return _0x5e8bcb;})});}_0x1e695d=_[_0x0034('0x44')]({},_0x1e695d,_0x3773f9[_0x0034('0x47')]);return _0x6798e8[_0x0034('0x125')](_0x1e695d);}})[_0x0034('0x16')](function(_0xb60b3b){if(_0xb60b3b){_0x1110ec=_0xb60b3b[_0x0034('0x3f')];if(!_0x3773f9[_0x0034('0x39')]['hasOwnProperty'](_0x0034('0x41'))){_0x1e695d['limit']=qs['limit'](_0x3773f9[_0x0034('0x39')][_0x0034('0x27')]);_0x1e695d['offset']=qs['offset'](_0x3773f9[_0x0034('0x39')][_0x0034('0x25')]);}return _0x6798e8[_0x0034('0x125')](_0x1e695d);}})[_0x0034('0x16')](function(_0x56b924){if(_0x56b924){return _0x56b924?{'count':_0x1110ec,'rows':_0x56b924}:null;}})[_0x0034('0x16')](respondWithResult(_0x4fcfc2,null))['catch'](handleError(_0x4fcfc2,null));}; \ No newline at end of file +var _0x3931=['include','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','ListId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','remoteAddress','replace','alignment','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x3931,0xe0));var _0x1393=function(_0x4093c5,_0x22cde8){_0x4093c5=_0x4093c5-0x0;var _0x1fc22d=_0x3931[_0x4093c5];return _0x1fc22d;};'use strict';var BPromise=require(_0x1393('0x0'));var Mustache=require(_0x1393('0x1'));var util=require(_0x1393('0x2'));var path=require(_0x1393('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1393('0x4'));var _=require(_0x1393('0x5'));var querystring=require(_0x1393('0x6'));var Redis=require(_0x1393('0x7'));var qs=require(_0x1393('0x8'));var logger=require(_0x1393('0x9'))(_0x1393('0xa'));var config=require(_0x1393('0xb'));var db=require(_0x1393('0xc'))['db'];config[_0x1393('0xd')]=_[_0x1393('0xe')](config[_0x1393('0xd')],{'host':_0x1393('0xf'),'port':0x18eb});var socket=require(_0x1393('0x10'))(new Redis(config[_0x1393('0xd')]));require(_0x1393('0x11'))['register'](socket);var htmlToText=require(_0x1393('0x12'));var jayson=require(_0x1393('0x13'));var client=jayson[_0x1393('0x14')]['http']({'port':0x232c});var client9002=jayson[_0x1393('0x14')][_0x1393('0x15')]({'port':0x232a});var client9003=jayson[_0x1393('0x14')][_0x1393('0x15')]({'port':0x232b});var client9001=jayson['client'][_0x1393('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x223c20,_0x33b535,_0x4fb990,_0x137d7d){return new BPromise(function(_0x16d06d,_0xc194d0){var _0x242d96=_0x137d7d||client;return _0x242d96[_0x1393('0x16')](_0x223c20,_0x4fb990)[_0x1393('0x17')](function(_0x44df6e){logger[_0x1393('0x18')](_0x1393('0x19'),_0x33b535,'request\x20sent');logger[_0x1393('0x1a')](_0x1393('0x1b'),_0x33b535,_0x1393('0x1c'),JSON[_0x1393('0x1d')](_0x44df6e));if(_0x44df6e['error']){if(_0x44df6e['error']['code']===0x1f4){logger[_0x1393('0x1e')](_0x1393('0x19'),_0x33b535,_0x44df6e['error']['message']);return _0xc194d0(_0x44df6e['error'][_0x1393('0x1f')]);}logger['error'](_0x1393('0x19'),_0x33b535,_0x44df6e[_0x1393('0x1e')][_0x1393('0x1f')]);return _0x16d06d(_0x44df6e[_0x1393('0x1e')][_0x1393('0x1f')]);}else{logger[_0x1393('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x33b535,_0x1393('0x1c'));_0x16d06d(_0x44df6e[_0x1393('0x20')][_0x1393('0x1f')]);}})[_0x1393('0x21')](function(_0x57a79e){logger[_0x1393('0x1e')](_0x1393('0x19'),_0x33b535,_0x57a79e);_0xc194d0(_0x57a79e);});});}function respondWithStatusCode(_0xd21fe4,_0x1e8f75){_0x1e8f75=_0x1e8f75||0xcc;return function(_0x123b4d){if(_0x123b4d){return _0xd21fe4[_0x1393('0x22')](_0x1e8f75);}return _0xd21fe4[_0x1393('0x23')](_0x1e8f75)[_0x1393('0x24')]();};}function respondWithResult(_0x11e6ec,_0x35ac05){_0x35ac05=_0x35ac05||0xc8;return function(_0xcb9b9d){if(_0xcb9b9d){return _0x11e6ec[_0x1393('0x23')](_0x35ac05)['json'](_0xcb9b9d);}};}function respondWithFilteredResult(_0x50cd4b,_0x1dd86b){return function(_0x22503a){if(_0x22503a){var _0x17111a=typeof _0x1dd86b['offset']==='undefined'&&typeof _0x1dd86b['limit']===_0x1393('0x25');var _0x28ea2d=_0x22503a[_0x1393('0x26')];var _0x264ab5=_0x17111a?0x0:_0x1dd86b[_0x1393('0x27')];var _0x610789=_0x17111a?_0x22503a[_0x1393('0x26')]:_0x1dd86b['offset']+_0x1dd86b[_0x1393('0x28')];var _0x4074db;if(_0x610789>=_0x28ea2d){_0x610789=_0x28ea2d;_0x4074db=0xc8;}else{_0x4074db=0xce;}_0x50cd4b['status'](_0x4074db);return _0x50cd4b[_0x1393('0x29')](_0x1393('0x2a'),_0x264ab5+'-'+_0x610789+'/'+_0x28ea2d)[_0x1393('0x2b')](_0x22503a);}return null;};}function saveUpdates(_0x415597){return function(_0x291bcb){if(_0x291bcb){return _0x291bcb[_0x1393('0x2c')](_0x415597)[_0x1393('0x17')](function(_0x5dd1b8){return _0x5dd1b8;});}return null;};}function removeEntity(_0x5a3384){return function(_0x374f44){if(_0x374f44){return _0x374f44[_0x1393('0x2d')]()['then'](function(){var _0x5d906b=_0x374f44[_0x1393('0x2e')]({'plain':!![]});var _0x5ad76f=_0x1393('0x2f');return db[_0x1393('0x30')][_0x1393('0x2d')]({'where':{'type':_0x5ad76f,'resourceId':_0x5d906b['id']}})[_0x1393('0x17')](function(){return _0x374f44;});})[_0x1393('0x17')](function(){_0x5a3384[_0x1393('0x23')](0xcc)[_0x1393('0x24')]();});}};}function handleEntityNotFound(_0x41733e){return function(_0x203007){if(!_0x203007){_0x41733e[_0x1393('0x22')](0x194);}return _0x203007;};}function handleError(_0x12c159,_0xf6eba){_0xf6eba=_0xf6eba||0x1f4;return function(_0x5c2841){logger[_0x1393('0x1e')](_0x5c2841[_0x1393('0x31')]);if(_0x5c2841['name']){delete _0x5c2841[_0x1393('0x32')];}_0x12c159[_0x1393('0x23')](_0xf6eba)[_0x1393('0x33')](_0x5c2841);};}exports[_0x1393('0x34')]=function(_0x29e236,_0x2f6781){var _0x3fd10e={'include':[{'model':db['Pause'],'as':_0x1393('0x35')}]},_0x30cc2b={},_0x384a3e={'count':0x0,'rows':[]};var _0x5bc6a7=_[_0x1393('0x36')](db[_0x1393('0x37')][_0x1393('0x38')],function(_0x3a00b9){return{'name':_0x3a00b9[_0x1393('0x39')],'type':_0x3a00b9[_0x1393('0x3a')][_0x1393('0x3b')]};});_0x30cc2b[_0x1393('0x3c')]=_[_0x1393('0x36')](_0x5bc6a7,'name');_0x30cc2b['query']=_[_0x1393('0x3d')](_0x29e236[_0x1393('0x3e')]);_0x30cc2b[_0x1393('0x3f')]=_[_0x1393('0x40')](_0x30cc2b[_0x1393('0x3c')],_0x30cc2b['query']);_0x3fd10e[_0x1393('0x41')]=_[_0x1393('0x40')](_0x30cc2b['model'],qs[_0x1393('0x42')](_0x29e236[_0x1393('0x3e')][_0x1393('0x42')]));_0x3fd10e[_0x1393('0x41')]=_0x3fd10e[_0x1393('0x41')][_0x1393('0x43')]?_0x3fd10e[_0x1393('0x41')]:_0x30cc2b[_0x1393('0x3c')];if(!_0x29e236[_0x1393('0x3e')]['hasOwnProperty'](_0x1393('0x44'))){_0x3fd10e[_0x1393('0x28')]=qs[_0x1393('0x28')](_0x29e236[_0x1393('0x3e')][_0x1393('0x28')]);_0x3fd10e[_0x1393('0x27')]=qs[_0x1393('0x27')](_0x29e236[_0x1393('0x3e')]['offset']);}_0x3fd10e[_0x1393('0x45')]=qs['sort'](_0x29e236[_0x1393('0x3e')][_0x1393('0x46')]);_0x3fd10e[_0x1393('0x47')]=qs[_0x1393('0x3f')](_[_0x1393('0x48')](_0x29e236[_0x1393('0x3e')],_0x30cc2b[_0x1393('0x3f')]),_0x5bc6a7);if(_0x29e236[_0x1393('0x3e')][_0x1393('0x49')]){_0x3fd10e[_0x1393('0x47')]=_['merge'](_0x3fd10e['where'],{'$or':_[_0x1393('0x36')](_0x5bc6a7,function(_0x3be48e){if(_0x3be48e[_0x1393('0x3a')]!==_0x1393('0x4a')){var _0x166f10={};_0x166f10[_0x3be48e[_0x1393('0x32')]]={'$like':'%'+_0x29e236[_0x1393('0x3e')][_0x1393('0x49')]+'%'};return _0x166f10;}})});}_0x3fd10e=_[_0x1393('0x4b')]({},_0x3fd10e,_0x29e236[_0x1393('0x4c')]);var _0x92f68e={'where':_0x3fd10e[_0x1393('0x47')]};return db[_0x1393('0x37')][_0x1393('0x26')](_0x92f68e)[_0x1393('0x17')](function(_0xb306a4){_0x384a3e[_0x1393('0x26')]=_0xb306a4;if(_0x29e236[_0x1393('0x3e')][_0x1393('0x4d')]){_0x3fd10e[_0x1393('0x4e')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x3fd10e);})[_0x1393('0x17')](function(_0x1a31b1){_0x384a3e[_0x1393('0x4f')]=_0x1a31b1;return _0x384a3e;})[_0x1393('0x17')](respondWithFilteredResult(_0x2f6781,_0x3fd10e))['catch'](handleError(_0x2f6781,null));};exports[_0x1393('0x50')]=function(_0x1be60e,_0x4265a4){var _0xff772f={'raw':![],'where':{'id':_0x1be60e[_0x1393('0x51')]['id']},'include':[{'model':db[_0x1393('0x52')],'as':_0x1393('0x35')}]},_0x5e4d21={};_0x5e4d21[_0x1393('0x3c')]=_[_0x1393('0x3d')](db[_0x1393('0x37')][_0x1393('0x38')]);_0x5e4d21[_0x1393('0x3e')]=_[_0x1393('0x3d')](_0x1be60e[_0x1393('0x3e')]);_0x5e4d21[_0x1393('0x3f')]=_[_0x1393('0x40')](_0x5e4d21[_0x1393('0x3c')],_0x5e4d21[_0x1393('0x3e')]);_0xff772f[_0x1393('0x41')]=_['intersection'](_0x5e4d21[_0x1393('0x3c')],qs[_0x1393('0x42')](_0x1be60e[_0x1393('0x3e')]['fields']));_0xff772f[_0x1393('0x41')]=_0xff772f[_0x1393('0x41')][_0x1393('0x43')]?_0xff772f[_0x1393('0x41')]:_0x5e4d21[_0x1393('0x3c')];if(_0x1be60e[_0x1393('0x3e')][_0x1393('0x4d')]){_0xff772f[_0x1393('0x4e')]=[{'all':!![]}];}_0xff772f=_['merge']({},_0xff772f,_0x1be60e['options']);return db[_0x1393('0x37')][_0x1393('0x53')](_0xff772f)[_0x1393('0x17')](handleEntityNotFound(_0x4265a4,null))[_0x1393('0x17')](respondWithResult(_0x4265a4,null))[_0x1393('0x21')](handleError(_0x4265a4,null));};exports[_0x1393('0x54')]=function(_0x44844,_0x173f0e){return db[_0x1393('0x37')][_0x1393('0x54')](_0x44844[_0x1393('0x55')],{})[_0x1393('0x17')](function(_0x21cd4e){var _0x2ed0cd=_0x44844[_0x1393('0x56')]['get']({'plain':!![]});if(!_0x2ed0cd)throw new Error(_0x1393('0x57'));if(_0x2ed0cd[_0x1393('0x58')]===_0x1393('0x56')){var _0x22adc7=_0x21cd4e[_0x1393('0x2e')]({'plain':!![]});var _0x3831e9=_0x1393('0x2f');return db[_0x1393('0x59')][_0x1393('0x53')]({'where':{'name':_0x3831e9,'userProfileId':_0x2ed0cd['userProfileId']},'raw':!![]})[_0x1393('0x17')](function(_0x2b2385){if(_0x2b2385&&_0x2b2385['autoAssociation']===0x0){return db['UserProfileResource'][_0x1393('0x54')]({'name':_0x22adc7[_0x1393('0x32')],'resourceId':_0x22adc7['id'],'type':_0x2b2385[_0x1393('0x32')],'sectionId':_0x2b2385['id']},{})[_0x1393('0x17')](function(){return _0x21cd4e;});}else{return _0x21cd4e;}})[_0x1393('0x21')](function(_0x24c38){logger[_0x1393('0x1e')](_0x1393('0x5a'),_0x24c38);throw _0x24c38;});}return _0x21cd4e;})[_0x1393('0x17')](respondWithResult(_0x173f0e,0xc9))[_0x1393('0x21')](handleError(_0x173f0e,null));};exports[_0x1393('0x2c')]=function(_0x507db3,_0x162cff){if(_0x507db3[_0x1393('0x55')]['id']){delete _0x507db3[_0x1393('0x55')]['id'];}return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x507db3[_0x1393('0x51')]['id']},'include':[{'model':db[_0x1393('0x52')],'as':_0x1393('0x35')}]})[_0x1393('0x17')](handleEntityNotFound(_0x162cff,null))['then'](saveUpdates(_0x507db3[_0x1393('0x55')],null))[_0x1393('0x17')](respondWithResult(_0x162cff,null))[_0x1393('0x21')](handleError(_0x162cff,null));};exports[_0x1393('0x2d')]=function(_0x776483,_0x57aaf0){return db[_0x1393('0x37')]['find']({'where':{'id':_0x776483['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x57aaf0,null))[_0x1393('0x17')](removeEntity(_0x57aaf0,null))[_0x1393('0x21')](handleError(_0x57aaf0,null));};exports['describe']=function(_0x1f0375,_0x2d77f5){return db[_0x1393('0x37')]['describe']()[_0x1393('0x17')](respondWithResult(_0x2d77f5,null))[_0x1393('0x21')](handleError(_0x2d77f5,null));};exports[_0x1393('0x5b')]=function(_0x16bb78,_0x2c569c){if(_0x16bb78[_0x1393('0x55')]['id']){delete _0x16bb78['body']['id'];}return db['ChatWebsite'][_0x1393('0x53')]({'where':{'id':_0x16bb78[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x2c569c,null))['then'](function(_0x1c8498){if(_0x1c8498){_0x16bb78[_0x1393('0x55')][_0x1393('0x5c')]=_0x1c8498['id'];return db[_0x1393('0x5d')][_0x1393('0x54')](_0x16bb78['body']);}})[_0x1393('0x17')](respondWithResult(_0x2c569c,null))['catch'](handleError(_0x2c569c,null));};exports['getDispositions']=function(_0x4fcbb,_0x3a7b0c){var _0x496852={'raw':![],'where':{}};var _0x3d4770={};var _0x43e427={'count':0x0,'rows':[]};return db[_0x1393('0x37')][_0x1393('0x5e')]({'where':{'id':_0x4fcbb['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x3a7b0c,null))['then'](function(_0x28103b){if(_0x28103b){_0x3d4770['model']=_['keys'](db[_0x1393('0x5d')][_0x1393('0x38')]);_0x3d4770[_0x1393('0x3e')]=_['keys'](_0x4fcbb['query']);_0x3d4770[_0x1393('0x3f')]=_[_0x1393('0x40')](_0x3d4770['model'],_0x3d4770[_0x1393('0x3e')]);_0x496852['attributes']=_['intersection'](_0x3d4770[_0x1393('0x3c')],qs['fields'](_0x4fcbb[_0x1393('0x3e')][_0x1393('0x42')]));_0x496852[_0x1393('0x41')]=_0x496852['attributes']['length']?_0x496852[_0x1393('0x41')]:_0x3d4770[_0x1393('0x3c')];if(!_0x4fcbb[_0x1393('0x3e')][_0x1393('0x5f')](_0x1393('0x44'))){_0x496852[_0x1393('0x28')]=qs[_0x1393('0x28')](_0x4fcbb['query']['limit']);_0x496852[_0x1393('0x27')]=qs[_0x1393('0x27')](_0x4fcbb[_0x1393('0x3e')]['offset']);}_0x496852['order']=qs['sort'](_0x4fcbb[_0x1393('0x3e')]['sort']);_0x496852[_0x1393('0x47')]=qs[_0x1393('0x3f')](_['pick'](_0x4fcbb[_0x1393('0x3e')],_0x3d4770[_0x1393('0x3f')]));_0x496852[_0x1393('0x47')][_0x1393('0x5c')]=_0x28103b['id'];if(_0x4fcbb[_0x1393('0x3e')][_0x1393('0x49')]){_0x496852['where']=_[_0x1393('0x4b')](_0x496852[_0x1393('0x47')],{'$or':_['map'](_0x496852[_0x1393('0x41')],function(_0x4194e3){var _0x266ed9={};_0x266ed9[_0x4194e3]={'$like':'%'+_0x4fcbb['query']['filter']+'%'};return _0x266ed9;})});}_0x496852=_['merge']({},_0x496852,_0x4fcbb['options']);return db[_0x1393('0x5d')][_0x1393('0x26')]({'where':_0x496852[_0x1393('0x47')]})[_0x1393('0x17')](function(_0x1bb4bd){_0x43e427['count']=_0x1bb4bd;if(_0x4fcbb[_0x1393('0x3e')][_0x1393('0x4d')]){_0x496852[_0x1393('0x4e')]=[{'all':!![]}];}return db[_0x1393('0x5d')]['findAll'](_0x496852);})[_0x1393('0x17')](function(_0x130b2a){_0x43e427['rows']=_0x130b2a;return _0x43e427;});}})[_0x1393('0x17')](respondWithFilteredResult(_0x3a7b0c,_0x496852))[_0x1393('0x21')](handleError(_0x3a7b0c,null));};exports['removeDispositions']=function(_0x3cad75,_0x44fd4b){return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x3cad75[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x44fd4b,null))[_0x1393('0x17')](function(_0x2321fd){if(_0x2321fd){return _0x2321fd[_0x1393('0x60')](_0x3cad75['query'][_0x1393('0x61')]);}})[_0x1393('0x17')](respondWithStatusCode(_0x44fd4b,null))[_0x1393('0x21')](handleError(_0x44fd4b,null));};exports[_0x1393('0x62')]=function(_0x4c06ce,_0x384fdc){if(_0x4c06ce[_0x1393('0x55')]['id']){delete _0x4c06ce[_0x1393('0x55')]['id'];}return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x4c06ce[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x384fdc,null))[_0x1393('0x17')](function(_0x54fd4d){if(_0x54fd4d){_0x4c06ce[_0x1393('0x55')]['ChatWebsiteId']=_0x54fd4d['id'];return db['CannedAnswer'][_0x1393('0x54')](_0x4c06ce[_0x1393('0x55')]);}})[_0x1393('0x17')](respondWithResult(_0x384fdc,null))[_0x1393('0x21')](handleError(_0x384fdc,null));};exports[_0x1393('0x63')]=function(_0x2b29ca,_0x59f409){var _0x34571d={'raw':![],'where':{}};var _0xe3f538={};var _0x42c3a7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1393('0x5e')]({'where':{'id':_0x2b29ca[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x59f409,null))[_0x1393('0x17')](function(_0x2ff468){if(_0x2ff468){_0xe3f538[_0x1393('0x3c')]=_['keys'](db[_0x1393('0x64')][_0x1393('0x38')]);_0xe3f538[_0x1393('0x3e')]=_[_0x1393('0x3d')](_0x2b29ca[_0x1393('0x3e')]);_0xe3f538[_0x1393('0x3f')]=_[_0x1393('0x40')](_0xe3f538['model'],_0xe3f538[_0x1393('0x3e')]);_0x34571d[_0x1393('0x41')]=_['intersection'](_0xe3f538[_0x1393('0x3c')],qs[_0x1393('0x42')](_0x2b29ca['query'][_0x1393('0x42')]));_0x34571d[_0x1393('0x41')]=_0x34571d[_0x1393('0x41')]['length']?_0x34571d['attributes']:_0xe3f538['model'];if(!_0x2b29ca[_0x1393('0x3e')][_0x1393('0x5f')](_0x1393('0x44'))){_0x34571d['limit']=qs[_0x1393('0x28')](_0x2b29ca[_0x1393('0x3e')][_0x1393('0x28')]);_0x34571d[_0x1393('0x27')]=qs['offset'](_0x2b29ca['query'][_0x1393('0x27')]);}_0x34571d[_0x1393('0x45')]=qs['sort'](_0x2b29ca[_0x1393('0x3e')][_0x1393('0x46')]);_0x34571d[_0x1393('0x47')]=qs['filters'](_[_0x1393('0x48')](_0x2b29ca[_0x1393('0x3e')],_0xe3f538[_0x1393('0x3f')]));_0x34571d[_0x1393('0x47')][_0x1393('0x5c')]=_0x2ff468['id'];if(_0x2b29ca[_0x1393('0x3e')][_0x1393('0x49')]){_0x34571d['where']=_['merge'](_0x34571d[_0x1393('0x47')],{'$or':_[_0x1393('0x36')](_0x34571d['attributes'],function(_0x14bc46){var _0xa68df2={};_0xa68df2[_0x14bc46]={'$like':'%'+_0x2b29ca[_0x1393('0x3e')]['filter']+'%'};return _0xa68df2;})});}_0x34571d=_['merge']({},_0x34571d,_0x2b29ca[_0x1393('0x4c')]);return db[_0x1393('0x64')]['count']({'where':_0x34571d['where']})['then'](function(_0x220f48){_0x42c3a7[_0x1393('0x26')]=_0x220f48;if(_0x2b29ca[_0x1393('0x3e')]['includeAll']){_0x34571d[_0x1393('0x4e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1393('0x65')](_0x34571d);})['then'](function(_0x186580){_0x42c3a7[_0x1393('0x4f')]=_0x186580;return _0x42c3a7;});}})[_0x1393('0x17')](respondWithFilteredResult(_0x59f409,_0x34571d))[_0x1393('0x21')](handleError(_0x59f409,null));};exports[_0x1393('0x66')]=function(_0xb2c76e,_0x3eff43){return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0xb2c76e['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x3eff43,null))['then'](function(_0xd04ad7){if(_0xd04ad7){return _0xd04ad7[_0x1393('0x66')](_0xb2c76e[_0x1393('0x3e')][_0x1393('0x61')]);}})[_0x1393('0x17')](respondWithStatusCode(_0x3eff43,null))['catch'](handleError(_0x3eff43,null));};exports[_0x1393('0x67')]=function(_0x275a78,_0x402294){_0x275a78['body'][_0x1393('0x68')]=_0x275a78[_0x1393('0x69')]['filename'];return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x275a78['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x402294,null))[_0x1393('0x17')](saveUpdates(_0x275a78[_0x1393('0x55')],null))[_0x1393('0x17')](respondWithResult(_0x402294,null))['catch'](handleError(_0x402294,null));};exports[_0x1393('0x6a')]=function(_0x18e044,_0x46590f){_0x18e044[_0x1393('0x55')][_0x1393('0x6b')]=_0x18e044['file'][_0x1393('0x6c')];return db['ChatWebsite'][_0x1393('0x53')]({'where':{'id':_0x18e044[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x46590f,null))[_0x1393('0x17')](saveUpdates(_0x18e044[_0x1393('0x55')],null))['then'](respondWithResult(_0x46590f,null))[_0x1393('0x21')](handleError(_0x46590f,null));};exports[_0x1393('0x6d')]=function(_0x3247bd,_0x5102dc){_0x3247bd[_0x1393('0x55')][_0x1393('0x6e')]=_0x3247bd['file']['filename'];return db[_0x1393('0x37')]['find']({'where':{'id':_0x3247bd[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x5102dc,null))['then'](saveUpdates(_0x3247bd[_0x1393('0x55')],null))[_0x1393('0x17')](respondWithResult(_0x5102dc,null))[_0x1393('0x21')](handleError(_0x5102dc,null));};exports[_0x1393('0x6f')]=function(_0x2197d9,_0x475684){_0x2197d9['body']['systemAvatar']=_0x2197d9['file'][_0x1393('0x6c')];return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x2197d9[_0x1393('0x51')]['id']}})['then'](handleEntityNotFound(_0x475684,null))[_0x1393('0x17')](saveUpdates(_0x2197d9['body'],null))[_0x1393('0x17')](respondWithResult(_0x475684,null))[_0x1393('0x21')](handleError(_0x475684,null));};exports[_0x1393('0x70')]=function(_0x129790,_0x194727){var _0x49f8aa=path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x73'));var _0x11fb90={'where':{'id':_0x129790[_0x1393('0x51')]['id']},'attributes':['id',_0x1393('0x68')],'raw':!![]};var _0x40400d=![];return require('../../config/license/util')[_0x1393('0x74')]()['then'](function(_0x2d9a00){if(_0x2d9a00){_0x40400d=_0x2d9a00[_0x1393('0x75')];}})['then'](function(){return db[_0x1393('0x37')][_0x1393('0x53')](_0x11fb90);})[_0x1393('0x17')](handleEntityNotFound(_0x194727,null))[_0x1393('0x17')](function(_0x352d2b){if(_0x352d2b){if(!_[_0x1393('0x76')](_0x352d2b[_0x1393('0x68')])){if(fs[_0x1393('0x77')](path[_0x1393('0x71')](config['root'],_0x1393('0x78'),_0x352d2b[_0x1393('0x68')]))&&_0x40400d){_0x49f8aa=path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x78'),_0x352d2b[_0x1393('0x68')]);}}return _0x194727['download'](_0x49f8aa);}})[_0x1393('0x21')](handleError(_0x194727,null));};exports[_0x1393('0x79')]=function(_0x5ed346,_0x5686d2){var _0x404404=path[_0x1393('0x71')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x38dce3={'where':{'id':_0x5ed346[_0x1393('0x51')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x1393('0x37')][_0x1393('0x53')](_0x38dce3)[_0x1393('0x17')](handleEntityNotFound(_0x5686d2,null))[_0x1393('0x17')](function(_0x3181b5){if(_0x3181b5){if(!_['isNil'](_0x3181b5['agentAvatar'])){if(fs[_0x1393('0x77')](path[_0x1393('0x71')](config['root'],_0x1393('0x7a'),_0x3181b5['agentAvatar']))){_0x404404=path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x7a'),_0x3181b5[_0x1393('0x6b')]);}}return _0x5686d2['download'](_0x404404);}})[_0x1393('0x21')](handleError(_0x5686d2,null));};exports[_0x1393('0x7b')]=function(_0x44c275,_0x2e8743){var _0x36095e=path[_0x1393('0x71')](config['root'],_0x1393('0x7c'));var _0x38ec33={'where':{'id':_0x44c275[_0x1393('0x51')]['id']},'attributes':['id',_0x1393('0x6e'),_0x1393('0x7d')],'raw':!![]};return db[_0x1393('0x37')][_0x1393('0x53')](_0x38ec33)[_0x1393('0x17')](handleEntityNotFound(_0x2e8743,null))['then'](function(_0xe6f314){if(_0xe6f314){if(!_[_0x1393('0x76')](_0xe6f314[_0x1393('0x6e')])){if(fs[_0x1393('0x77')](path['join'](config[_0x1393('0x72')],_0x1393('0x7a'),_0xe6f314[_0x1393('0x6e')]))&&_0xe6f314['showCustomerAvatar']){_0x36095e=path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x7a'),_0xe6f314['customerAvatar']);}}return _0x2e8743[_0x1393('0x7e')](_0x36095e);}})[_0x1393('0x21')](handleError(_0x2e8743,null));};exports[_0x1393('0x7f')]=function(_0x253cee,_0x111c54){var _0x5e5adf=path['join'](config[_0x1393('0x72')],_0x1393('0x80'));var _0x25c395={'where':{'id':_0x253cee[_0x1393('0x51')]['id']},'attributes':['id',_0x1393('0x81')],'raw':!![]};return db[_0x1393('0x37')][_0x1393('0x53')](_0x25c395)[_0x1393('0x17')](handleEntityNotFound(_0x111c54,null))[_0x1393('0x17')](function(_0x389e2e){if(_0x389e2e){if(!_[_0x1393('0x76')](_0x389e2e[_0x1393('0x81')])){if(fs[_0x1393('0x77')](path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x7a'),_0x389e2e[_0x1393('0x81')]))){_0x5e5adf=path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x7a'),_0x389e2e[_0x1393('0x81')]);}}return _0x111c54[_0x1393('0x7e')](_0x5e5adf);}})[_0x1393('0x21')](handleError(_0x111c54,null));};exports[_0x1393('0x82')]=function(_0x223f21,_0x255a47){var _0x403b30=require(_0x1393('0x83'));var _0x57ddd8=new _0x403b30();var _0x10fcc2=_0x57ddd8[_0x1393('0x84')](_0x223f21[_0x1393('0x85')][_0x1393('0x86')])['getResult']();var _0x46d0a4={'body':_0x223f21[_0x1393('0x55')],'channel':_0x1393('0x87')};var _0x5bceaa=[];var _0x485856=[];var _0x2557c2={};var _0x122e33=![];return db[_0x1393('0x88')][_0x1393('0x89')]()[_0x1393('0x17')](function(_0x497548){if(!_0x497548){throw new db[(_0x1393('0x8a'))][(_0x1393('0x8b'))](_0x1393('0x8c'));}_0x5bceaa=_[_0x1393('0x8d')](_[_0x1393('0x3d')](_0x497548),[_0x1393('0x8e'),'updatedAt']);_0x485856=_['difference'](_['keys'](_0x497548),[_0x1393('0x8e'),_0x1393('0x8f'),_0x1393('0x90'),'ListId']);if(_0x223f21[_0x1393('0x55')]['id']){delete _0x223f21['body']['id'];}if(_['isNil'](_0x223f21['body'][_0x1393('0x91')])){throw new db[(_0x1393('0x8a'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x223f21[_0x1393('0x55')][_0x1393('0x55')])||_0x223f21[_0x1393('0x55')][_0x1393('0x55')]===''){throw new db[(_0x1393('0x8a'))][(_0x1393('0x8b'))](_0x1393('0x92'));}if(_[_0x1393('0x76')](_0x223f21[_0x1393('0x55')][_0x1393('0x93')])){throw new db['Sequelize'][(_0x1393('0x8b'))](_0x1393('0x94')+_0x485856);}if(!_[_0x1393('0x95')](_0x485856,_0x223f21[_0x1393('0x55')][_0x1393('0x93')])){throw new db[(_0x1393('0x8a'))][(_0x1393('0x8b'))](_0x1393('0x96')+_0x485856);}_0x2557c2[_0x223f21[_0x1393('0x55')]['mapKey']]=_0x223f21['body'][_0x1393('0x91')];})[_0x1393('0x17')](function(){return db[_0x1393('0x37')]['find']({'where':{'id':_0x223f21[_0x1393('0x51')]['id']},'include':[{'model':db[_0x1393('0x97')],'as':_0x1393('0x98'),'include':[{'model':db[_0x1393('0x88')],'as':_0x1393('0x99'),'where':_0x2557c2,'limit':0x1,'order':[[_0x1393('0x8f'),_0x1393('0x9a')]]}]},{'model':db[_0x1393('0x9b')],'as':_0x1393('0x9c')}]});})[_0x1393('0x17')](handleEntityNotFound(_0x255a47,null))[_0x1393('0x17')](function(_0x1562b5){if(_0x1562b5&&_0x1562b5['List']){_0x46d0a4[_0x1393('0x9d')]=_0x1562b5;_0x46d0a4[_0x1393('0x9e')]=_0x1562b5[_0x1393('0x9c')];_0x46d0a4[_0x1393('0x9f')]=_0x1562b5[_0x1393('0x98')];_0x46d0a4['applications']=_['orderBy'](_0x46d0a4[_0x1393('0x9e')],[_0x1393('0xa0')],[_0x1393('0xa1')]);if(_0x46d0a4[_0x1393('0x9d')][_0x1393('0x9c')]){delete _0x46d0a4['account'][_0x1393('0x9c')];}if(_0x46d0a4[_0x1393('0x9d')][_0x1393('0x98')]&&_0x46d0a4['account'][_0x1393('0x98')][_0x1393('0x99')][_0x1393('0x43')]){return _0x46d0a4[_0x1393('0x9d')][_0x1393('0x98')]['Contacts'][0x0];}var _0x4132db=_[_0x1393('0xe')](_0x223f21['body'],{'firstName':_0x223f21[_0x1393('0x55')][_0x1393('0x91')],'ListId':_0x1562b5['ListId']});_0x4132db[_0x223f21['body']['mapKey']]=_0x223f21['body']['from'];return db[_0x1393('0x88')]['create'](_0x4132db,{'fields':_0x5bceaa,'raw':!![]});}})[_0x1393('0x17')](handleEntityNotFound(_0x255a47,null))[_0x1393('0x17')](function(_0x5cd644){_0x46d0a4[_0x1393('0xa2')]=_0x5cd644;var _0x1dfb16=_0x223f21[_0x1393('0x55')][_0x1393('0xa3')];if(_0x223f21['headers'][_0x1393('0xa4')]){_0x1dfb16=_0x223f21['headers'][_0x1393('0xa4')];}else if(_0x223f21[_0x1393('0x85')][_0x1393('0xa5')]){_0x1dfb16=_['first'](_0x223f21[_0x1393('0x85')][_0x1393('0xa5')]['split'](','));}if(_0x5cd644){var _0x21542d={'ContactId':_0x5cd644['id'],'ChatWebsiteId':_0x223f21[_0x1393('0x51')]['id'],'from':(_0x5cd644['firstName']||'')+'\x20'+(_0x5cd644[_0x1393('0xa6')]||''),'customerIp':_0x1dfb16,'customerPort':_0x223f21[_0x1393('0x85')][_0x1393('0xa7')]?_0x223f21[_0x1393('0x85')][_0x1393('0xa7')]:null,'referer':_0x223f21[_0x1393('0x55')][_0x1393('0xa8')],'browserName':_0x10fcc2[_0x1393('0xa9')]['name']&&_0x10fcc2[_0x1393('0xa9')][_0x1393('0xaa')]?util[_0x1393('0xab')](_0x1393('0xac'),_0x10fcc2[_0x1393('0xa9')][_0x1393('0x32')],_0x10fcc2[_0x1393('0xa9')][_0x1393('0xaa')]):_0x1393('0xad'),'browserVersion':_0x10fcc2['browser'][_0x1393('0xaa')]||'unknown','osName':util['format']('%s\x20%s',_0x10fcc2['os'][_0x1393('0x32')],_0x10fcc2['os'][_0x1393('0xaa')]),'osVersion':_0x10fcc2['os'][_0x1393('0xaa')],'deviceModel':_0x10fcc2[_0x1393('0xae')][_0x1393('0x3c')]&&_0x10fcc2[_0x1393('0xae')][_0x1393('0xaf')]?util['format']('%s\x20%s\x20%s',_0x10fcc2[_0x1393('0xae')][_0x1393('0x3c')],_0x10fcc2[_0x1393('0xae')][_0x1393('0xaf')],_0x10fcc2['device'][_0x1393('0x3a')]):null,'deviceVendor':_0x10fcc2[_0x1393('0xae')][_0x1393('0xaf')],'deviceType':_0x10fcc2[_0x1393('0xae')][_0x1393('0x3a')],'formData':JSON[_0x1393('0x1d')](_0x223f21[_0x1393('0x55')])};var _0x420dce={'ChatWebsiteId':_0x223f21['params']['id'],'closed':![]};if(_0x223f21[_0x1393('0x55')][_0x1393('0xb0')]){_0x420dce['threadId']=_0x223f21[_0x1393('0x55')][_0x1393('0xb0')];return db[_0x1393('0xb1')][_0x1393('0x53')]({'where':_0x420dce})[_0x1393('0x17')](function(_0x2629ea){if(_0x2629ea){return[_0x2629ea,![]];}_0x21542d[_0x1393('0xb0')]=_0x223f21['body'][_0x1393('0xb0')];_0x21542d[_0x1393('0xb2')]=_0x223f21['body'][_0x1393('0xb2')];return db[_0x1393('0xb1')][_0x1393('0x54')](_0x21542d)['then'](function(_0x32d283){return[_0x32d283,!![]];});});}_0x420dce[_0x1393('0xb3')]=_0x5cd644['id'];if(_0x223f21[_0x1393('0x55')][_0x1393('0xb4')]&&_0x223f21[_0x1393('0x55')][_0x1393('0xb4')]['id']){_0x420dce['id']=_0x223f21[_0x1393('0x55')]['interaction']['id'];return db['ChatInteraction'][_0x1393('0x53')]({'where':_0x420dce})[_0x1393('0x17')](function(_0x92019d){if(_0x92019d){return[_0x92019d,![]];}return db[_0x1393('0xb1')]['create'](_0x21542d)['then'](function(_0x38d843){return[_0x38d843,!![]];});});}return db['ChatInteraction']['create'](_0x21542d)[_0x1393('0x17')](function(_0xbcd9d0){return[_0xbcd9d0,!![]];});}})[_0x1393('0xb5')](function(_0x5c46f1,_0x307b58){if(_0x5c46f1){_0x122e33=_0x307b58;if(!_0x307b58){var _0x25b206={'from':(_0x46d0a4[_0x1393('0xa2')][_0x1393('0xb6')]||'')+'\x20'+(_0x46d0a4['contact'][_0x1393('0xa6')]||'')};if(_0x223f21[_0x1393('0x55')][_0x1393('0xb0')]&&_0x223f21['body'][_0x1393('0xb7')]&&_0x223f21['body'][_0x1393('0xb0')]!=_0x223f21['body']['messageId']){_0x25b206[_0x1393('0xb0')]=_0x223f21[_0x1393('0x55')][_0x1393('0xb7')];}return _0x5c46f1[_0x1393('0x2c')](_0x25b206);}else{return _0x5c46f1;}}})[_0x1393('0x17')](function(_0x3fc4e8){_0x46d0a4['interaction']=_0x3fc4e8['get']({'plain':!![]});_0x46d0a4[_0x1393('0xb4')][_0x1393('0xb8')]=_0x122e33;if(_0x46d0a4['interaction']['created']){if(_0x46d0a4[_0x1393('0x9d')][_0x1393('0xb9')]){_0x46d0a4['applications'][_0x1393('0xba')]({'id':0x0,'priority':_0x46d0a4[_0x1393('0x9e')][_0x1393('0x43')]+0x1,'app':_0x1393('0xbb'),'appdata':_0x1393('0xbc'),'interval':'*,*,*,*'});}}return db[_0x1393('0xbd')][_0x1393('0x54')]({'body':_0x223f21[_0x1393('0x55')][_0x1393('0x55')],'ChatWebsiteId':_0x223f21['params']['id'],'ChatInteractionId':_0x3fc4e8['id'],'direction':'in','ContactId':_0x46d0a4[_0x1393('0xa2')]['id'],'AttachmentId':_0x223f21[_0x1393('0x55')][_0x1393('0xbe')]});})['then'](function(_0x3b94a6){_0x46d0a4[_0x1393('0x1f')]=_0x3b94a6;if(_0x46d0a4[_0x1393('0xb4')][_0x1393('0xbf')]){return db['User'][_0x1393('0x53')]({'attributes':['id',_0x1393('0x32')],'where':{'id':_0x46d0a4[_0x1393('0xb4')]['UserId']}})['then'](function(_0x56e8c9){if(_0x56e8c9){_0x46d0a4[_0x1393('0x9e')][_0x1393('0xc0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x56e8c9[_0x1393('0x32')]+','+(_0x46d0a4['account'][_0x1393('0xc1')]||0xa),'interval':'*,*,*,*'});_0x46d0a4[_0x1393('0xc2')]=!![];}return respondWithRpcPromise(_0x1393('0xc3'),_0x1393('0xc4'),_0x46d0a4);});}return respondWithRpcPromise(_0x1393('0xc3'),_0x1393('0xc4'),_0x46d0a4);})[_0x1393('0x17')](function(_0x203666){respondWithRpcPromise(_0x1393('0xc5'),_0x1393('0xc5'),{'event':'notify','message':_0x203666},client9002);return _0x203666;})['then'](respondWithResult(_0x255a47,null))['catch'](handleError(_0x255a47,null));};exports[_0x1393('0xc6')]=function(_0x404d2,_0x313d24){var _0x5e73a9,_0x34f294,_0xdd77a4;var _0x93d998=[];var _0x4ae8f9={};var _0x110241=_0x404d2[_0x1393('0xc7')]||[];var _0x209837=[];var _0x3fc62b;return db['CmContact']['describe']()[_0x1393('0x17')](function(_0x35bb81){if(!_0x35bb81){throw new db[(_0x1393('0x8a'))][(_0x1393('0x8b'))](_0x1393('0x8c'));}_0x93d998=_[_0x1393('0x8d')](_[_0x1393('0x3d')](_0x35bb81),[_0x1393('0x8e'),_0x1393('0x8f'),'CompanyId',_0x1393('0xc8')]);if(_0x404d2[_0x1393('0x55')]['id']){delete _0x404d2['body']['id'];}if(_[_0x1393('0x76')](_0x404d2[_0x1393('0x55')][_0x1393('0x91')])){throw _0x313d24[_0x1393('0x23')](0x1f4)[_0x1393('0x33')](new db[(_0x1393('0x8a'))][(_0x1393('0x8b'))](_0x1393('0xc9')));}if(_[_0x1393('0x76')](_0x404d2['body'][_0x1393('0x55')])||_0x404d2['body'][_0x1393('0x55')]===''){throw _0x313d24['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x1393('0x92')));}if(_[_0x1393('0x76')](_0x404d2['body'][_0x1393('0xca')])){throw _0x313d24[_0x1393('0x23')](0x1f4)['send'](new db[(_0x1393('0x8a'))][(_0x1393('0x8b'))](_0x1393('0xcb')+_0x93d998));}if(!_[_0x1393('0x95')](_0x93d998,_0x404d2[_0x1393('0x55')][_0x1393('0xca')])){throw _0x313d24['status'](0x1f4)[_0x1393('0x33')](new db['Sequelize'][(_0x1393('0x8b'))](_0x1393('0xcc')+_0x93d998));}_0x4ae8f9[_0x404d2['body'][_0x1393('0xca')]]=_0x404d2[_0x1393('0x55')][_0x1393('0x91')];})[_0x1393('0x17')](function(){return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x404d2[_0x1393('0x51')]['id']},'include':[{'model':db[_0x1393('0x97')],'as':_0x1393('0x98')},{'model':db['MailAccount'],'as':_0x1393('0xcd')}]});})[_0x1393('0x17')](handleEntityNotFound(_0x313d24,null))['then'](function(_0x1792e4){if(_0x1792e4&&_0x1792e4[_0x1393('0x98')]){_0x34f294=_0x1792e4;var _0x5b1d44=_[_0x1393('0xe')](_0x404d2[_0x1393('0x55')],{'firstName':_0x404d2[_0x1393('0x55')][_0x1393('0x91')],'phone':_0x404d2[_0x1393('0x55')][_0x1393('0x91')],'ListId':_0x1792e4[_0x1393('0xc8')]});_0x5b1d44[_0x404d2[_0x1393('0x55')]['mapKeyOffline']]=_0x404d2['body'][_0x1393('0x91')];return db[_0x1393('0x88')][_0x1393('0xce')]({'where':_0x4ae8f9,'defaults':_0x5b1d44});}})[_0x1393('0xb5')](function(_0xb6f25){if(_0xb6f25){_0xdd77a4=_0xb6f25;var _0x5b3920=fs['readFileSync'](path['join'](config[_0x1393('0x72')],_0x1393('0xcf')),_0x1393('0xd0'));var _0x1226b8=ejs[_0x1393('0xd1')](_0x5b3920,{'body':_[_0x1393('0xd2')](_0x404d2['body'][_0x1393('0x55')]),'bodyTitle':_0x34f294['offlineMessageBody']});return db[_0x1393('0xd3')][_0x1393('0x54')]({'body':_0x1226b8,'plainBody':htmlToText[_0x1393('0xd4')](_0x1226b8),'ContactId':_0xb6f25['id'],'ChatWebsiteId':_0x34f294['id']});}})['then'](function(_0x25dfd9){_0x3fc62b=_0x25dfd9;if(_0x110241[_0x1393('0x43')]){var _0x18b679=_0x110241['map'](function(_0x50c916){return{'name':_0x50c916[_0x1393('0xd5')],'basename':_0x50c916[_0x1393('0x6c')],'type':_0x50c916[_0x1393('0xd6')],'ChatOfflineMessageId':_0x25dfd9['id']};});_0x209837=_0x18b679[_0x1393('0x36')](_0x3929be=>{var _0x5b24e4={'filename':_0x3929be[_0x1393('0x32')],'path':path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0xd7'),_0x1393('0xc7'),'attachments',_0x1393('0xd8'),_0x3929be[_0x1393('0xd9')])};return _0x5b24e4;});if(!_0x34f294[_0x1393('0xda')]){return db[_0x1393('0xdb')][_0x1393('0xdc')](function(_0x1fc487){return db[_0x1393('0xdd')][_0x1393('0xde')](_0x18b679,{'transaction':_0x1fc487});});}}})[_0x1393('0x17')](function(){if(_0x3fc62b){_0x5e73a9=_0x3fc62b;return db[_0x1393('0xcd')][_0x1393('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0x1393('0xdf')],'as':_0x1393('0xe0'),'raw':!![],'include':[{'model':db[_0x1393('0xe1')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x1393('0x17')](function(_0x160985){if(_0x160985&&_0x160985[_0x1393('0xe0')]&&_0x34f294['forwardOffline']&&_0x34f294[_0x1393('0xe2')]){var _0x48a22b=_0x160985[_0x1393('0xe3')]();return respondWithRpcPromise(_0x1393('0xe4'),_0x1393('0xe5'),{'account':_0x48a22b,'message':{'from':util[_0x1393('0xab')](_0x1393('0xe6'),_0x160985[_0x1393('0x32')],_0x160985[_0x1393('0xe7')]||_0x160985[_0x1393('0xe0')][_0x1393('0x56')]),'to':_0x34f294[_0x1393('0xe2')],'subject':_0x34f294['offlineMessageSubject'],'html':_0x5e73a9['body'],'attachments':_0x209837}},client9003)[_0x1393('0x17')](function(){return _0x5e73a9;})[_0x1393('0x21')](function(_0x4dff45){logger[_0x1393('0x1e')](_0x4dff45);});}})[_0x1393('0x17')](function(){if(_0x34f294&&_0x34f294[_0x1393('0xda')]&&_0x34f294[_0x1393('0xe8')]){var _0x5d2d33=[];if(_0x110241[_0x1393('0x43')]){_0x5d2d33=_0x110241[_0x1393('0x36')](function(_0x55e11d){return{'name':_0x55e11d[_0x1393('0xd5')],'basename':_0x55e11d[_0x1393('0x6c')],'type':_0x55e11d[_0x1393('0xd6')],'ChatOfflineMessageId':_0x3fc62b['id']};});}var _0x233e4e;if(!_[_0x1393('0x76')](_0x34f294['subjectOffline'])){var _0x429259=_[_0x1393('0x36')](_0x404d2[_0x1393('0x55')],function(_0x327ef8){return _0x327ef8;});var _0x3631a4=_[_0x1393('0xe9')](_0x429259)[0x0];var _0x1609ef=_[_0x1393('0xea')](_0x3631a4,function(_0x2239ff){return _0x2239ff;});_0x233e4e=_0x1609ef[0x1][_0x34f294[_0x1393('0xeb')]];}var _0x513e1a={'from':_0xdd77a4[_0x1393('0xe7')],'firstName':_0xdd77a4['firstName'],'lastName':_0xdd77a4[_0x1393('0xa6')],'mapKey':_0x1393('0xe7'),'message':{'from':_0xdd77a4[_0x1393('0xe7')],'to':_0x34f294[_0x1393('0xcd')][_0x1393('0xe7')],'cc':'','subject':_[_0x1393('0x76')](_0x233e4e)?_0x34f294['offlineMessageSubject']:_0x233e4e,'messageId':'','sentAt':new Date(),'attach':_0x5d2d33[_0x1393('0x43')],'attachments':_0x5d2d33,'originChannel':_0x1393('0xec'),'ChatWebsiteId':_0x34f294['id'],'ChatOfflineMessageId':_0x5e73a9['id'],'originTo':_0x34f294['MailAccount'][_0x1393('0xe7')]},'body':_0x5e73a9[_0x1393('0x55')]};var _0xd30b71={'account':{'id':_0x34f294[_0x1393('0xe8')]},'body':_0x513e1a,'log':_0x1393('0xed')};return respondWithRpcPromise(_0x1393('0xed'),_0x1393('0xee'),_0xd30b71,client9001)[_0x1393('0x17')](function(){return _0x5e73a9;})[_0x1393('0x21')](function(_0x51795e){logger['error'](_0x51795e);});}return;})[_0x1393('0x17')](function(){if(_0x5e73a9){return _0x5e73a9;}})[_0x1393('0x17')](respondWithResult(_0x313d24,null))[_0x1393('0x21')](function(_0x14de27){logger[_0x1393('0x1e')]('catch',_0x14de27);for(var _0x3c2006 of _0x110241){var _0xe3ffe0=path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0xd7'),_0x1393('0xc7'),_0x1393('0xef'),_0x1393('0xd8'),_0x3c2006[_0x1393('0x6c')]);fs_extra[_0x1393('0xf0')](_0xe3ffe0)[_0x1393('0x21')](function(_0x2c2010){logger[_0x1393('0x1e')](_0x1393('0xf1'),_0xe3ffe0,_0x2c2010);});}});};exports['addInteraction']=function(_0x46d75e,_0x561450){return db[_0x1393('0xb1')][_0x1393('0x53')]({'where':{'id':_0x46d75e[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x561450,null))[_0x1393('0x17')](function(_0x7611f4){if(_0x7611f4){return _0x7611f4[_0x1393('0xf2')](_0x46d75e[_0x1393('0x55')][_0x1393('0x61')],_[_0x1393('0xf3')](_0x46d75e[_0x1393('0x55')],['ids','id'])||{});}})[_0x1393('0x17')](respondWithResult(_0x561450,null))[_0x1393('0x21')](handleError(_0x561450,null));};exports[_0x1393('0xf4')]=function(_0x520d11,_0x1645fa){var _0x4d208a={'raw':![],'where':{}};var _0x402ef3={};var _0x2c9bfc={'count':0x0,'rows':[]};return db[_0x1393('0x37')][_0x1393('0x5e')]({'where':{'id':_0x520d11[_0x1393('0x51')]['id']}})['then'](handleEntityNotFound(_0x1645fa,null))[_0x1393('0x17')](function(_0x4c1f8f){if(_0x4c1f8f){_0x402ef3[_0x1393('0x3c')]=_[_0x1393('0x3d')](db[_0x1393('0xb1')][_0x1393('0x38')]);_0x402ef3[_0x1393('0x3e')]=_[_0x1393('0x3d')](_0x520d11['query']);_0x402ef3['filters']=_[_0x1393('0x40')](_0x402ef3['model'],_0x402ef3[_0x1393('0x3e')]);_0x4d208a[_0x1393('0x41')]=_[_0x1393('0x40')](_0x402ef3[_0x1393('0x3c')],qs[_0x1393('0x42')](_0x520d11[_0x1393('0x3e')]['fields']));_0x4d208a[_0x1393('0x41')]=_0x4d208a[_0x1393('0x41')][_0x1393('0x43')]?_0x4d208a[_0x1393('0x41')]:_0x402ef3[_0x1393('0x3c')];if(!_0x520d11[_0x1393('0x3e')]['hasOwnProperty'](_0x1393('0x44'))){_0x4d208a['limit']=qs[_0x1393('0x28')](_0x520d11[_0x1393('0x3e')][_0x1393('0x28')]);_0x4d208a[_0x1393('0x27')]=qs[_0x1393('0x27')](_0x520d11[_0x1393('0x3e')][_0x1393('0x27')]);}_0x4d208a[_0x1393('0x45')]=qs[_0x1393('0x46')](_0x520d11[_0x1393('0x3e')][_0x1393('0x46')]);_0x4d208a[_0x1393('0x47')]=qs['filters'](_[_0x1393('0x48')](_0x520d11[_0x1393('0x3e')],_0x402ef3['filters']));_0x4d208a[_0x1393('0x47')][_0x1393('0x5c')]=_0x4c1f8f['id'];if(_0x520d11[_0x1393('0x3e')][_0x1393('0x49')]){_0x4d208a['where']=_['merge'](_0x4d208a[_0x1393('0x47')],{'$or':_[_0x1393('0x36')](_0x4d208a[_0x1393('0x41')],function(_0xfaa34c){var _0x152d4f={};_0x152d4f[_0xfaa34c]={'$like':'%'+_0x520d11[_0x1393('0x3e')][_0x1393('0x49')]+'%'};return _0x152d4f;})});}_0x4d208a=_[_0x1393('0x4b')]({},_0x4d208a,_0x520d11[_0x1393('0x4c')]);return db[_0x1393('0xb1')][_0x1393('0x26')]({'where':_0x4d208a[_0x1393('0x47')]})[_0x1393('0x17')](function(_0x5106eb){_0x2c9bfc[_0x1393('0x26')]=_0x5106eb;if(_0x520d11[_0x1393('0x3e')]['includeAll']){_0x4d208a[_0x1393('0x4e')]=[{'model':db[_0x1393('0x88')],'as':_0x1393('0xf5'),'required':![]},{'model':db['User'],'as':_0x1393('0xf6'),'attributes':['name',_0x1393('0xf7'),_0x1393('0xf8')],'required':![]},{'model':db[_0x1393('0xf9')],'as':_0x1393('0xfa'),'attributes':['id',_0x1393('0x32'),_0x1393('0xfb')],'where':_0x520d11[_0x1393('0x3e')]['tag']?{'id':_0x520d11[_0x1393('0x3e')]['tag']}:undefined,'required':_0x520d11[_0x1393('0x3e')]['tag']?!![]:![]}];}return db[_0x1393('0xb1')]['findAll'](_0x4d208a);})[_0x1393('0x17')](function(_0x2f8393){_0x2c9bfc[_0x1393('0x4f')]=_0x2f8393;return _0x2c9bfc;});}})['then'](respondWithFilteredResult(_0x1645fa,_0x4d208a))[_0x1393('0x21')](handleError(_0x1645fa,null));};function iftimePromise(_0x1ff7ee,_0x36430f){return respondWithRpcPromise('Command','getSnippet',{'command':_0x36430f[_0x1393('0xfc')]?util[_0x1393('0xab')](_0x1393('0xfd'),_0x1ff7ee[_0x1393('0xfe')],_0x36430f[_0x1393('0xfc')]):util['format'](_0x1393('0xff'),_0x1ff7ee['interval'])},client9002)[_0x1393('0x17')](function(_0x3997d4){var _0x164b20=_0x3997d4&&_0x3997d4[_0x1393('0x100')](_0x1393('0x101'))>=0x0?!![]:![];logger['info'](_0x1393('0x102'),_0x36430f['id'],_0x1ff7ee['id'],_0x1ff7ee[_0x1393('0xfe')],_0x164b20?_0x1393('0x103'):'OFFLINE',_0x36430f[_0x1393('0xfc')]?_0x36430f[_0x1393('0xfc')]:_0x1393('0x104'));return _0x164b20;})[_0x1393('0x21')](function(_0x28a8ba){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x36430f['id'],_0x1ff7ee['id'],_0x1ff7ee[_0x1393('0xfe')],util['inspect'](_0x28a8ba,{'showHidden':![],'depth':null}),_0x36430f[_0x1393('0xfc')]?_0x36430f['timezone']:_0x1393('0x104'));return![];});}exports[_0x1393('0x105')]=function(_0x29ffee,_0x15914d){var _0x470f5a=0x0;var _0x80b24a=0x0;var _0x4a6872=![];var _0x2afb26;var _0x25e88e;return db[_0x1393('0x37')]['find']({'where':{'id':_0x29ffee[_0x1393('0x51')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x1393('0x106')],'as':_0x1393('0x107'),'attributes':['id',_0x1393('0xfe')],'raw':!![]}]}]})[_0x1393('0x17')](handleEntityNotFound(_0x15914d,null))['then'](function(_0xede7d2){if(_0xede7d2){_0x2afb26=_0xede7d2;return _0xede7d2[_0x1393('0x108')]({'raw':!![]});}})['then'](function(_0x327138){if(_0x2afb26){if(_0x327138){_0x25e88e=_0x327138;}}return require(_0x1393('0x109'))['getLicense']();})['then'](function(_0x1a7e14){if(_0x1a7e14){_0x80b24a=_0x1a7e14['virtual'];_0x4a6872=_0x1a7e14[_0x1393('0x75')];}})[_0x1393('0x17')](function(){return db[_0x1393('0xb1')][_0x1393('0x26')]({'where':{'closed':![]}});})['then'](function(_0x49f558){_0x470f5a=_0x49f558;if(_0x80b24a&&_0x49f558>_0x80b24a){return db[_0x1393('0x10a')][_0x1393('0x5e')]({'where':{'id':0x1}})['then'](function(_0x135a78){if(_0x135a78){_0x135a78['increment'](_0x1393('0x10b'));}});}})[_0x1393('0x17')](function(){if(_0x2afb26['Interval']&&_0x2afb26[_0x1393('0x106')]['Intervals']){var _0xf0fc0e=[];for(var _0x1a9b5e=0x0;_0x1a9b5e<_0x2afb26[_0x1393('0x106')][_0x1393('0x107')][_0x1393('0x43')];_0x1a9b5e++){var _0x497de6=_0x2afb26['Interval'][_0x1393('0x107')][_0x1a9b5e]['get']({'plain':!![]});_0xf0fc0e['push'](iftimePromise(_0x497de6,_0x2afb26));}return BPromise[_0x1393('0x10c')](_0xf0fc0e)[_0x1393('0x17')](function(_0x3bb1a7){return _[_0x1393('0x10d')](_0x3bb1a7);});}else{return!![];}})['then'](function(_0x25ce64){var _0x25d670=fs['readFileSync'](path[_0x1393('0x71')](config[_0x1393('0x72')],_0x1393('0x10e')),_0x1393('0xd0'));var _0x5583ab={'remote':_0x2afb26[_0x1393('0x10f')],'query':querystring['stringify'](_['merge'](_0x2afb26['get']({'plain':!![]}),{'customerIp':_0x29ffee['headers'][_0x1393('0xa5')]||_0x29ffee[_0x1393('0x85')]['x-real-ip']||_0x29ffee['connection'][_0x1393('0x110')]||_0x29ffee['ip'],'referer':_0x29ffee[_0x1393('0x85')][_0x1393('0xa8')],'openedInteractions':_0x470f5a,'maxInteractions':_0x80b24a,'virtual':_0x4a6872['virtual'],'online':_0x25ce64,'custom':_0x4a6872}))[_0x1393('0x111')](/'/g,'\x5c\x27')};_0x15914d[_0x1393('0x33')](ejs[_0x1393('0xd1')](Mustache['render'](_0x25d670,_0x5583ab),{'proactiveActions':_0x25e88e,'alignment':_0x2afb26[_0x1393('0x112')],'verticalAlignment':_0x2afb26['verticalAlignment'],'div_color':_0x2afb26[_0x1393('0xfb')],'labelText':_0x2afb26['labelText'],'text_color':_0x2afb26[_0x1393('0x113')],'text_button_color':_0x2afb26['textButtonColor'],'button_color':_0x2afb26[_0x1393('0x114')],'background_color':_0x2afb26[_0x1393('0x115')],'hideWhenOffline':_0x2afb26[_0x1393('0x116')],'interval':_0x2afb26[_0x1393('0x117')]}));})[_0x1393('0x21')](handleError(_0x15914d,null));};exports[_0x1393('0x118')]=function(_0x161ff0,_0x59ebdf){var _0x363790=_0x161ff0[_0x1393('0x51')]['id'];var _0x20c1eb=_0x161ff0[_0x1393('0x55')];var _0x46cea7=0xc8;var _0x2c5328=null;return db[_0x1393('0xdb')][_0x1393('0xdc')]({'isolationLevel':db['sequelize'][_0x1393('0x119')][_0x1393('0x11a')]['READ_COMMITTED']},function(_0x4dae9b){return db[_0x1393('0x37')][_0x1393('0x5e')]({'where':{'id':_0x363790},'transaction':_0x4dae9b})[_0x1393('0x17')](function(_0x19c256){if(_0x19c256){return db['ChatApplication'][_0x1393('0x2d')]({'where':{'ChatWebsiteId':_0x363790},'transaction':_0x4dae9b})[_0x1393('0x17')](function(){var _0x1fa4a5=_[_0x1393('0x36')](_0x20c1eb,function(_0x18d337){_0x18d337[_0x1393('0x5c')]=_0x363790;return _0x18d337;});return db[_0x1393('0x9b')]['bulkCreate'](_0x1fa4a5,{'transaction':_0x4dae9b});});}else{_0x46cea7=0x194;_0x2c5328=[];}});})[_0x1393('0x17')](function(){if(_0x46cea7!==0x194){return db[_0x1393('0x9b')][_0x1393('0x11b')]({'where':{'ChatWebsiteId':_0x363790},'order':_0x1393('0xa0')})[_0x1393('0x17')](function(_0x5825e4){_0x2c5328=_0x5825e4;});}})[_0x1393('0x21')](function(_0x1fa5d0){_0x46cea7=0x1f4;logger[_0x1393('0x1e')](_0x1fa5d0[_0x1393('0x31')]);if(_0x1fa5d0['name']){delete _0x1fa5d0[_0x1393('0x32')];}_0x2c5328=_0x1fa5d0;})[_0x1393('0x11c')](function(){if(_0x2c5328===null){_0x59ebdf[_0x1393('0x22')](_0x46cea7);}else{if(_0x46cea7===0x1f4){_0x59ebdf[_0x1393('0x23')](_0x46cea7)[_0x1393('0x33')](_0x2c5328);}else{_0x59ebdf['status'](_0x46cea7)[_0x1393('0x2b')](_0x2c5328);}}});};exports[_0x1393('0x11d')]=function(_0x30f9da,_0x1e1125){var _0x55912c={};var _0x271788={};var _0xb096a6;var _0x1f6766;return db[_0x1393('0x37')][_0x1393('0x5e')]({'where':{'id':_0x30f9da['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x1e1125,null))[_0x1393('0x17')](function(_0x3495b2){if(_0x3495b2){_0xb096a6=_0x3495b2;_0x271788[_0x1393('0x3c')]=_[_0x1393('0x3d')](db[_0x1393('0x9b')][_0x1393('0x38')]);_0x271788[_0x1393('0x3e')]=_['keys'](_0x30f9da['query']);_0x271788[_0x1393('0x3f')]=_[_0x1393('0x40')](_0x271788['model'],_0x271788[_0x1393('0x3e')]);_0x55912c[_0x1393('0x41')]=_['intersection'](_0x271788[_0x1393('0x3c')],qs[_0x1393('0x42')](_0x30f9da[_0x1393('0x3e')][_0x1393('0x42')]));_0x55912c[_0x1393('0x41')]=_0x55912c[_0x1393('0x41')]['length']?_0x55912c['attributes']:_0x271788['model'];_0x55912c[_0x1393('0x45')]=qs[_0x1393('0x46')](_0x30f9da['query'][_0x1393('0x46')]);_0x55912c[_0x1393('0x47')]=qs['filters'](_[_0x1393('0x48')](_0x30f9da[_0x1393('0x3e')],_0x271788[_0x1393('0x3f')]));if(_0x30f9da[_0x1393('0x3e')][_0x1393('0x49')]){_0x55912c[_0x1393('0x47')]=_[_0x1393('0x4b')](_0x55912c[_0x1393('0x47')],{'$or':_[_0x1393('0x36')](_0x55912c[_0x1393('0x41')],function(_0x26ce40){var _0x54bec0={};_0x54bec0[_0x26ce40]={'$like':'%'+_0x30f9da['query'][_0x1393('0x49')]+'%'};return _0x54bec0;})});}_0x55912c=_['merge']({},_0x55912c,_0x30f9da['options']);return _0xb096a6['getApplications'](_0x55912c);}})[_0x1393('0x17')](function(_0x2d02a1){if(_0x2d02a1){_0x1f6766=_0x2d02a1['length'];if(!_0x30f9da[_0x1393('0x3e')][_0x1393('0x5f')](_0x1393('0x44'))){_0x55912c[_0x1393('0x28')]=qs[_0x1393('0x28')](_0x30f9da[_0x1393('0x3e')][_0x1393('0x28')]);_0x55912c['offset']=qs[_0x1393('0x27')](_0x30f9da['query'][_0x1393('0x27')]);}return _0xb096a6[_0x1393('0x11d')](_0x55912c);}})[_0x1393('0x17')](function(_0x47870d){if(_0x47870d){return _0x47870d?{'count':_0x1f6766,'rows':_0x47870d}:null;}})[_0x1393('0x17')](respondWithResult(_0x1e1125,null))['catch'](handleError(_0x1e1125,null));};exports[_0x1393('0x11e')]=function(_0x3b4443,_0x355147){return db['chatProactiveAction'][_0x1393('0x53')]({'where':{'id':_0x3b4443['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x355147,null))[_0x1393('0x17')](function(_0x28b8c0){if(_0x28b8c0){return _0x28b8c0[_0x1393('0x11e')](_0x3b4443[_0x1393('0x55')][_0x1393('0x61')],_['omit'](_0x3b4443[_0x1393('0x55')],[_0x1393('0x61'),'id'])||{});}})[_0x1393('0x17')](respondWithResult(_0x355147,null))['catch'](handleError(_0x355147,null));};exports[_0x1393('0x108')]=function(_0x1171c7,_0x208b39){var _0x5e3f2f={};var _0x183fb1={};var _0x276265;var _0x4bcfaa;return db[_0x1393('0x37')][_0x1393('0x5e')]({'where':{'id':_0x1171c7[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x208b39,null))[_0x1393('0x17')](function(_0x781ad9){if(_0x781ad9){_0x276265=_0x781ad9;_0x183fb1[_0x1393('0x3c')]=_['keys'](db[_0x1393('0x11f')][_0x1393('0x38')]);_0x183fb1['query']=_[_0x1393('0x3d')](_0x1171c7[_0x1393('0x3e')]);_0x183fb1['filters']=_[_0x1393('0x40')](_0x183fb1[_0x1393('0x3c')],_0x183fb1[_0x1393('0x3e')]);_0x5e3f2f[_0x1393('0x41')]=_[_0x1393('0x40')](_0x183fb1[_0x1393('0x3c')],qs['fields'](_0x1171c7[_0x1393('0x3e')][_0x1393('0x42')]));_0x5e3f2f[_0x1393('0x41')]=_0x5e3f2f[_0x1393('0x41')][_0x1393('0x43')]?_0x5e3f2f[_0x1393('0x41')]:_0x183fb1[_0x1393('0x3c')];_0x5e3f2f[_0x1393('0x45')]=qs['sort'](_0x1171c7['query'][_0x1393('0x46')]);_0x5e3f2f['where']=qs['filters'](_[_0x1393('0x48')](_0x1171c7[_0x1393('0x3e')],_0x183fb1[_0x1393('0x3f')]));if(_0x1171c7[_0x1393('0x3e')][_0x1393('0x49')]){_0x5e3f2f['where']=_['merge'](_0x5e3f2f[_0x1393('0x47')],{'$or':_['map'](_0x5e3f2f[_0x1393('0x41')],function(_0x4c8cca){var _0x18054d={};_0x18054d[_0x4c8cca]={'$like':'%'+_0x1171c7[_0x1393('0x3e')][_0x1393('0x49')]+'%'};return _0x18054d;})});}_0x5e3f2f=_[_0x1393('0x4b')]({},_0x5e3f2f,_0x1171c7['options']);return _0x276265[_0x1393('0x108')](_0x5e3f2f);}})[_0x1393('0x17')](function(_0x250b4e){if(_0x250b4e){_0x4bcfaa=_0x250b4e[_0x1393('0x43')];if(!_0x1171c7[_0x1393('0x3e')][_0x1393('0x5f')](_0x1393('0x44'))){_0x5e3f2f[_0x1393('0x28')]=qs[_0x1393('0x28')](_0x1171c7[_0x1393('0x3e')][_0x1393('0x28')]);_0x5e3f2f[_0x1393('0x27')]=qs[_0x1393('0x27')](_0x1171c7['query'][_0x1393('0x27')]);}return _0x276265['getProactiveActions'](_0x5e3f2f);}})['then'](function(_0x52774a){if(_0x52774a){return _0x52774a?{'count':_0x4bcfaa,'rows':_0x52774a}:null;}})[_0x1393('0x17')](respondWithResult(_0x208b39,null))[_0x1393('0x21')](handleError(_0x208b39,null));};exports[_0x1393('0x120')]=function(_0x4ec1fb,_0x455a67){var _0x5ef007=_0x4ec1fb[_0x1393('0x3e')][_0x1393('0x121')]===_0x1393('0x122')?_0x1393('0x123'):'onlineForm';return db[_0x1393('0x37')][_0x1393('0x53')]({'attributes':['id',_0x5ef007],'where':{'id':_0x4ec1fb[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x455a67,null))['then'](function(_0x1dc616){if(_0x1dc616){var _0x2bbea8=_0x1dc616[_0x5ef007];var _0x275e0d=_0x2bbea8&&_0x2bbea8['items']?_0x2bbea8[_0x1393('0x124')]:[];_0x455a67[_0x1393('0x33')]({'fromKey':_['isNil'](_0x2bbea8[_0x1393('0x125')])?undefined:_0x2bbea8['fromKey'],'count':_0x275e0d['length'],'rows':_0x275e0d});}})[_0x1393('0x21')](handleError(_0x455a67,null));};exports[_0x1393('0x126')]=function(_0x13b6a8,_0x520989){var _0x1a1862={'raw':![],'where':{}};var _0x367e9b={};var _0x1014ba={'count':0x0,'rows':[]};return db[_0x1393('0x37')]['findOne']({'where':{'id':_0x13b6a8[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x520989,null))[_0x1393('0x17')](function(_0x351883){if(_0x351883){_0x367e9b[_0x1393('0x3c')]=_['keys'](db[_0x1393('0xd3')]['rawAttributes']);_0x367e9b[_0x1393('0x3e')]=_[_0x1393('0x3d')](_0x13b6a8[_0x1393('0x3e')]);_0x367e9b[_0x1393('0x3f')]=_[_0x1393('0x40')](_0x367e9b['model'],_0x367e9b['query']);_0x1a1862[_0x1393('0x41')]=_[_0x1393('0x40')](_0x367e9b['model'],qs[_0x1393('0x42')](_0x13b6a8[_0x1393('0x3e')]['fields']));_0x1a1862[_0x1393('0x41')]=_0x1a1862[_0x1393('0x41')][_0x1393('0x43')]?_0x1a1862[_0x1393('0x41')]:_0x367e9b[_0x1393('0x3c')];if(!_0x13b6a8[_0x1393('0x3e')][_0x1393('0x5f')](_0x1393('0x44'))){_0x1a1862['limit']=qs[_0x1393('0x28')](_0x13b6a8['query'][_0x1393('0x28')]);_0x1a1862[_0x1393('0x27')]=qs[_0x1393('0x27')](_0x13b6a8[_0x1393('0x3e')][_0x1393('0x27')]);}_0x1a1862[_0x1393('0x45')]=qs[_0x1393('0x46')](_0x13b6a8[_0x1393('0x3e')][_0x1393('0x46')]);_0x1a1862[_0x1393('0x47')]=qs[_0x1393('0x3f')](_[_0x1393('0x48')](_0x13b6a8[_0x1393('0x3e')],_0x367e9b['filters']));_0x1a1862[_0x1393('0x47')][_0x1393('0x5c')]=_0x351883['id'];if(_0x13b6a8['query'][_0x1393('0x49')]){_0x1a1862[_0x1393('0x47')]=_[_0x1393('0x4b')](_0x1a1862['where'],{'$or':_[_0x1393('0x36')](_0x1a1862[_0x1393('0x41')],function(_0x2584c5){var _0x11c487={};_0x11c487[_0x2584c5]={'$like':'%'+_0x13b6a8['query'][_0x1393('0x49')]+'%'};return _0x11c487;})});}_0x1a1862=_[_0x1393('0x4b')]({},_0x1a1862,_0x13b6a8[_0x1393('0x4c')]);return db[_0x1393('0xd3')][_0x1393('0x26')]({'where':_0x1a1862[_0x1393('0x47')]})[_0x1393('0x17')](function(_0xec9919){_0x1014ba['count']=_0xec9919;if(_0x13b6a8['query'][_0x1393('0x4d')]){_0x1a1862['include']=[{'all':!![]}];}else{_0x1a1862['include']=[{'model':db[_0x1393('0x88')],'as':_0x1393('0xf5'),'required':![]},{'model':db[_0x1393('0xdd')],'as':_0x1393('0x127'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x1a1862);})[_0x1393('0x17')](function(_0x1cb3d5){_0x1014ba[_0x1393('0x4f')]=_0x1cb3d5;return _0x1014ba;});}})[_0x1393('0x17')](respondWithFilteredResult(_0x520989,_0x1a1862))[_0x1393('0x21')](handleError(_0x520989,null));};exports['addAgents']=function(_0x53fa7a,_0x34d444){return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x53fa7a[_0x1393('0x51')]['id']}})['then'](handleEntityNotFound(_0x34d444,null))[_0x1393('0x17')](function(_0x3515c2){if(_0x3515c2){return _0x3515c2[_0x1393('0x128')](_0x53fa7a[_0x1393('0x55')][_0x1393('0x61')],_[_0x1393('0xf3')](_0x53fa7a[_0x1393('0x55')],[_0x1393('0x61'),'id'])||{})['spread'](function(_0x24326e){for(var _0x563c58=0x0;_0x563c58<_0x53fa7a[_0x1393('0x55')][_0x1393('0x61')][_0x1393('0x43')];_0x563c58+=0x1){socket['emit'](_0x1393('0x129'),{'UserId':Number(_0x53fa7a[_0x1393('0x55')][_0x1393('0x61')][_0x563c58]),'ChatWebsiteId':Number(_0x53fa7a[_0x1393('0x51')]['id'])});}return _0x24326e;});}})[_0x1393('0x17')](respondWithResult(_0x34d444,null))[_0x1393('0x21')](handleError(_0x34d444,null));};exports['removeAgents']=function(_0x5e6431,_0x5d9a55){return db[_0x1393('0x37')][_0x1393('0x53')]({'where':{'id':_0x5e6431[_0x1393('0x51')]['id']}})[_0x1393('0x17')](handleEntityNotFound(_0x5d9a55,null))[_0x1393('0x17')](function(_0x19c874){if(_0x19c874){return _0x19c874['removeAgents'](_0x5e6431[_0x1393('0x3e')][_0x1393('0x61')])['then'](function(){if(_['isArray'](_0x5e6431['query'][_0x1393('0x61')])){for(var _0x12abd5=0x0;_0x12abd5<_0x5e6431[_0x1393('0x3e')][_0x1393('0x61')][_0x1393('0x43')];_0x12abd5+=0x1){socket[_0x1393('0x12a')](_0x1393('0x12b'),{'UserId':Number(_0x5e6431[_0x1393('0x3e')][_0x1393('0x61')][_0x12abd5]),'ChatWebsiteId':Number(_0x5e6431[_0x1393('0x51')]['id'])});}}else{socket[_0x1393('0x12a')](_0x1393('0x12b'),{'UserId':Number(_0x5e6431[_0x1393('0x3e')][_0x1393('0x61')]),'ChatWebsiteId':Number(_0x5e6431[_0x1393('0x51')]['id'])});}});}})[_0x1393('0x17')](respondWithStatusCode(_0x5d9a55,null))[_0x1393('0x21')](handleError(_0x5d9a55,null));};exports[_0x1393('0x12c')]=function(_0x2cc35b,_0xd641ac){var _0x31d4da={};var _0x469a85={};var _0xf2319d;var _0x332103;return db['ChatWebsite'][_0x1393('0x5e')]({'where':{'id':_0x2cc35b['params']['id']}})[_0x1393('0x17')](handleEntityNotFound(_0xd641ac,null))[_0x1393('0x17')](function(_0xefa34a){if(_0xefa34a){_0xf2319d=_0xefa34a;_0x469a85[_0x1393('0x3c')]=_['keys'](db[_0x1393('0x12d')]['rawAttributes']);_0x469a85['query']=_[_0x1393('0x3d')](_0x2cc35b[_0x1393('0x3e')]);_0x469a85['filters']=_[_0x1393('0x40')](_0x469a85[_0x1393('0x3c')],_0x469a85[_0x1393('0x3e')]);_0x31d4da[_0x1393('0x41')]=_['intersection'](_0x469a85[_0x1393('0x3c')],qs[_0x1393('0x42')](_0x2cc35b[_0x1393('0x3e')][_0x1393('0x42')]));_0x31d4da[_0x1393('0x41')]=_0x31d4da[_0x1393('0x41')]['length']?_0x31d4da[_0x1393('0x41')]:_0x469a85['model'];_0x31d4da[_0x1393('0x45')]=qs['sort'](_0x2cc35b[_0x1393('0x3e')]['sort']);_0x31d4da[_0x1393('0x47')]=qs[_0x1393('0x3f')](_[_0x1393('0x48')](_0x2cc35b[_0x1393('0x3e')],_0x469a85[_0x1393('0x3f')]));if(_0x2cc35b[_0x1393('0x3e')][_0x1393('0x49')]){_0x31d4da['where']=_[_0x1393('0x4b')](_0x31d4da[_0x1393('0x47')],{'$or':_[_0x1393('0x36')](_0x31d4da[_0x1393('0x41')],function(_0x40aece){var _0x362114={};_0x362114[_0x40aece]={'$like':'%'+_0x2cc35b['query'][_0x1393('0x49')]+'%'};return _0x362114;})});}_0x31d4da=_[_0x1393('0x4b')]({},_0x31d4da,_0x2cc35b['options']);return _0xf2319d[_0x1393('0x12c')](_0x31d4da);}})[_0x1393('0x17')](function(_0x1f6f2b){if(_0x1f6f2b){_0x332103=_0x1f6f2b['length'];if(!_0x2cc35b['query'][_0x1393('0x5f')](_0x1393('0x44'))){_0x31d4da[_0x1393('0x28')]=qs[_0x1393('0x28')](_0x2cc35b[_0x1393('0x3e')][_0x1393('0x28')]);_0x31d4da[_0x1393('0x27')]=qs[_0x1393('0x27')](_0x2cc35b[_0x1393('0x3e')][_0x1393('0x27')]);}return _0xf2319d['getAgents'](_0x31d4da);}})[_0x1393('0x17')](function(_0x2fc23b){if(_0x2fc23b){return _0x2fc23b?{'count':_0x332103,'rows':_0x2fc23b}:null;}})[_0x1393('0x17')](respondWithResult(_0xd641ac,null))[_0x1393('0x21')](handleError(_0xd641ac,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index bd0da45..2835808 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 _0xdb13=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb','ChatWebsite'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdb13,0x10c));var _0x3db1=function(_0x52dc4b,_0x1166ae){_0x52dc4b=_0x52dc4b-0x0;var _0x2b83e3=_0xdb13[_0x52dc4b];return _0x2b83e3;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3db1('0x0'))['db'][_0x3db1('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3db1('0x2')](0x0);var events={'afterCreate':_0x3db1('0x3'),'afterUpdate':_0x3db1('0x4'),'afterDestroy':_0x3db1('0x5')};function emitEvent(_0x581a73){return function(_0x3352e3,_0x41fb5d,_0x1c1495){ChatWebsiteEvents[_0x3db1('0x6')](_0x581a73+':'+_0x3352e3['id'],_0x3352e3);ChatWebsiteEvents[_0x3db1('0x6')](_0x581a73,_0x3352e3);_0x1c1495(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x3db1('0x7')](e,emitEvent(event));}}module[_0x3db1('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xc92f=['setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x4880fc,_0x407738){var _0x22d8e8=function(_0x5aaf5c){while(--_0x5aaf5c){_0x4880fc['push'](_0x4880fc['shift']());}};_0x22d8e8(++_0x407738);}(_0xc92f,0xf3));var _0xfc92=function(_0x590118,_0x179265){_0x590118=_0x590118-0x0;var _0x16b3dd=_0xc92f[_0x590118];return _0x16b3dd;};'use strict';var EventEmitter=require(_0xfc92('0x0'));var ChatWebsite=require(_0xfc92('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xfc92('0x2')](0x0);var events={'afterCreate':_0xfc92('0x3'),'afterUpdate':_0xfc92('0x4'),'afterDestroy':'remove'};function emitEvent(_0x39234c){return function(_0x21f567,_0x35780b,_0x5ea9ed){ChatWebsiteEvents['emit'](_0x39234c+':'+_0x21f567['id'],_0x21f567);ChatWebsiteEvents[_0xfc92('0x5')](_0x39234c,_0x21f567);_0x5ea9ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xfc92('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index be3469a..7dc1086 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 _0xef14=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','moment','request-promise','path'];(function(_0x44b7bb,_0x460592){var _0x370e81=function(_0x1c5d02){while(--_0x1c5d02){_0x44b7bb['push'](_0x44b7bb['shift']());}};_0x370e81(++_0x460592);}(_0xef14,0x13f));var _0x4ef1=function(_0x892b46,_0x16538e){_0x892b46=_0x892b46-0x0;var _0x4a7633=_0xef14[_0x892b46];return _0x4a7633;};'use strict';var _=require('lodash');var util=require(_0x4ef1('0x0'));var logger=require(_0x4ef1('0x1'))('api');var moment=require(_0x4ef1('0x2'));var BPromise=require('bluebird');var rp=require(_0x4ef1('0x3'));var fs=require('fs');var path=require(_0x4ef1('0x4'));var rimraf=require(_0x4ef1('0x5'));var config=require(_0x4ef1('0x6'));var attributes=require(_0x4ef1('0x7'));module[_0x4ef1('0x8')]=function(_0x5986ac,_0x17fae1){return _0x5986ac[_0x4ef1('0x9')](_0x4ef1('0xa'),attributes,{'tableName':_0x4ef1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9196=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x5131a0,_0x21383d){var _0x21ff55=function(_0x5ddfef){while(--_0x5ddfef){_0x5131a0['push'](_0x5131a0['shift']());}};_0x21ff55(++_0x21383d);}(_0x9196,0x1ce));var _0x6919=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x9196[_0x267d8d];return _0x11a98f;};'use strict';var _=require(_0x6919('0x0'));var util=require(_0x6919('0x1'));var logger=require(_0x6919('0x2'))(_0x6919('0x3'));var moment=require(_0x6919('0x4'));var BPromise=require(_0x6919('0x5'));var rp=require(_0x6919('0x6'));var fs=require('fs');var path=require(_0x6919('0x7'));var rimraf=require(_0x6919('0x8'));var config=require('../../config/environment');var attributes=require(_0x6919('0x9'));module[_0x6919('0xa')]=function(_0x23f0ad,_0xe4430c){return _0x23f0ad[_0x6919('0xb')](_0x6919('0xc'),attributes,{'tableName':_0x6919('0xd'),'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 36462f6..d13abdc 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 _0xb7e4=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','info','request\x20sent','debug','error','code','message','result'];(function(_0x3f0dbd,_0x1887e6){var _0xd6e757=function(_0x112413){while(--_0x112413){_0x3f0dbd['push'](_0x3f0dbd['shift']());}};_0xd6e757(++_0x1887e6);}(_0xb7e4,0xd9));var _0x4b7e=function(_0x5e33f0,_0x2d835f){_0x5e33f0=_0x5e33f0-0x0;var _0x40ca04=_0xb7e4[_0x5e33f0];return _0x40ca04;};'use strict';var _=require(_0x4b7e('0x0'));var util=require(_0x4b7e('0x1'));var moment=require(_0x4b7e('0x2'));var BPromise=require(_0x4b7e('0x3'));var rs=require(_0x4b7e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b7e('0x5'))['db'];var utils=require(_0x4b7e('0x6'));var logger=require(_0x4b7e('0x7'))(_0x4b7e('0x8'));var config=require(_0x4b7e('0x9'));var jayson=require(_0x4b7e('0xa'));var client=jayson[_0x4b7e('0xb')][_0x4b7e('0xc')]({'port':0x232a});config[_0x4b7e('0xd')]=_[_0x4b7e('0xe')](config[_0x4b7e('0xd')],{'host':_0x4b7e('0xf'),'port':0x18eb});var socket=require(_0x4b7e('0x10'))(new Redis(config['redis']));require(_0x4b7e('0x11'))['register'](socket);function respondWithRpcPromise(_0x534461,_0x40eb18,_0x2894b4){return new BPromise(function(_0x4709f9,_0x22c525){return client[_0x4b7e('0x12')](_0x534461,_0x2894b4)['then'](function(_0x3acbdb){logger[_0x4b7e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x4b7e('0x14'));logger[_0x4b7e('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x40eb18,'request\x20sent',JSON['stringify'](_0x3acbdb));if(_0x3acbdb[_0x4b7e('0x16')]){if(_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x3acbdb[_0x4b7e('0x16')]['message']);return _0x22c525(_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x18')]);}logger[_0x4b7e('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x18')]);return _0x4709f9(_0x3acbdb[_0x4b7e('0x16')][_0x4b7e('0x18')]);}else{logger[_0x4b7e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x4b7e('0x14'));_0x4709f9(_0x3acbdb[_0x4b7e('0x19')]['message']);}})[_0x4b7e('0x1a')](function(_0x5dd8b4){logger[_0x4b7e('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x40eb18,_0x5dd8b4);_0x22c525(_0x5dd8b4);});});} \ No newline at end of file +var _0xe671=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request'];(function(_0x36ca92,_0x215a5c){var _0x801bc4=function(_0x3c5b64){while(--_0x3c5b64){_0x36ca92['push'](_0x36ca92['shift']());}};_0x801bc4(++_0x215a5c);}(_0xe671,0x7a));var _0x1e67=function(_0x491b9d,_0x1e8aaf){_0x491b9d=_0x491b9d-0x0;var _0x902239=_0xe671[_0x491b9d];return _0x902239;};'use strict';var _=require(_0x1e67('0x0'));var util=require(_0x1e67('0x1'));var moment=require('moment');var BPromise=require(_0x1e67('0x2'));var rs=require(_0x1e67('0x3'));var fs=require('fs');var Redis=require(_0x1e67('0x4'));var db=require(_0x1e67('0x5'))['db'];var utils=require(_0x1e67('0x6'));var logger=require(_0x1e67('0x7'))(_0x1e67('0x8'));var config=require(_0x1e67('0x9'));var jayson=require(_0x1e67('0xa'));var client=jayson[_0x1e67('0xb')][_0x1e67('0xc')]({'port':0x232a});config[_0x1e67('0xd')]=_[_0x1e67('0xe')](config[_0x1e67('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e67('0xf'))(new Redis(config[_0x1e67('0xd')]));require(_0x1e67('0x10'))['register'](socket);function respondWithRpcPromise(_0x3dd6aa,_0x23f7e7,_0x1ed96d){return new BPromise(function(_0x47c184,_0x2047d7){return client[_0x1e67('0x11')](_0x3dd6aa,_0x1ed96d)['then'](function(_0x1e2982){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x23f7e7,_0x1e67('0x12'));logger[_0x1e67('0x13')](_0x1e67('0x14'),_0x23f7e7,_0x1e67('0x12'),JSON[_0x1e67('0x15')](_0x1e2982));if(_0x1e2982[_0x1e67('0x16')]){if(_0x1e2982[_0x1e67('0x16')][_0x1e67('0x17')]===0x1f4){logger[_0x1e67('0x16')](_0x1e67('0x18'),_0x23f7e7,_0x1e2982[_0x1e67('0x16')]['message']);return _0x2047d7(_0x1e2982[_0x1e67('0x16')][_0x1e67('0x19')]);}logger[_0x1e67('0x16')](_0x1e67('0x18'),_0x23f7e7,_0x1e2982[_0x1e67('0x16')]['message']);return _0x47c184(_0x1e2982[_0x1e67('0x16')][_0x1e67('0x19')]);}else{logger[_0x1e67('0x1a')](_0x1e67('0x18'),_0x23f7e7,_0x1e67('0x12'));_0x47c184(_0x1e2982[_0x1e67('0x1b')][_0x1e67('0x19')]);}})['catch'](function(_0x96b3fe){logger[_0x1e67('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x23f7e7,_0x96b3fe);_0x2047d7(_0x96b3fe);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 321237c..5a5b671 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 _0x9d4d=['register','chatWebsite:','remove','update'];(function(_0x41da30,_0x650d80){var _0xe46cef=function(_0x5eabd7){while(--_0x5eabd7){_0x41da30['push'](_0x41da30['shift']());}};_0xe46cef(++_0x650d80);}(_0x9d4d,0x1e6));var _0xd9d4=function(_0x1a467c,_0x2c05ad){_0x1a467c=_0x1a467c-0x0;var _0x21c1eb=_0x9d4d[_0x1a467c];return _0x21c1eb;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xd9d4('0x0'),_0xd9d4('0x1')];function createListener(_0xd437c7,_0x36484d){return function(_0x1fbfb4){_0x36484d['emit'](_0xd437c7,_0x1fbfb4);};}function removeListener(_0x3ca428,_0x4e68f2){return function(){ChatWebsiteEvents['removeListener'](_0x3ca428,_0x4e68f2);};}exports[_0xd9d4('0x2')]=function(_0x39fc60){for(var _0x32b918=0x0,_0x19c0ce=events['length'];_0x32b918<_0x19c0ce;_0x32b918++){var _0x4aa40e=events[_0x32b918];var _0xdcee32=createListener(_0xd9d4('0x3')+_0x4aa40e,_0x39fc60);ChatWebsiteEvents['on'](_0x4aa40e,_0xdcee32);}}; \ No newline at end of file +var _0x0fd4=['register','length','./chatWebsite.events'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0x0fd4,0x1eb));var _0x40fd=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x0fd4[_0x255ac0];return _0x437bf1;};'use strict';var ChatWebsiteEvents=require(_0x40fd('0x0'));var events=['save','remove','update'];function createListener(_0x2191c4,_0x55ae54){return function(_0x51584e){_0x55ae54['emit'](_0x2191c4,_0x51584e);};}function removeListener(_0x467337,_0x5492ee){return function(){ChatWebsiteEvents['removeListener'](_0x467337,_0x5492ee);};}exports[_0x40fd('0x1')]=function(_0x13f77c){for(var _0x495ddb=0x0,_0x381177=events[_0x40fd('0x2')];_0x495ddb<_0x381177;_0x495ddb++){var _0x29130b=events[_0x495ddb];var _0x1c6e36=createListener('chatWebsite:'+_0x29130b,_0x13f77c);ChatWebsiteEvents['on'](_0x29130b,_0x1c6e36);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index eaa76b0..267c5dc 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 _0x3a9e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','addDisposition','diskStorage','root','format','%s-%s','originalname','single','file','join','server/files/images/avatars/','addCustomerAvatar','now','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout'];(function(_0x5a22fc,_0x3acd64){var _0x29fde1=function(_0x26987e){while(--_0x26987e){_0x5a22fc['push'](_0x5a22fc['shift']());}};_0x29fde1(++_0x3acd64);}(_0x3a9e,0x1d8));var _0xe3a9=function(_0x3ba0af,_0xccb8a1){_0x3ba0af=_0x3ba0af-0x0;var _0x650db7=_0x3a9e[_0x3ba0af];return _0x650db7;};'use strict';var multer=require(_0xe3a9('0x0'));var util=require(_0xe3a9('0x1'));var path=require(_0xe3a9('0x2'));var timeout=require(_0xe3a9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe3a9('0x4'));var auth=require(_0xe3a9('0x5'));var interaction=require(_0xe3a9('0x6'));var config=require(_0xe3a9('0x7'));var controller=require('./chatWebsite.controller');router[_0xe3a9('0x8')]('/',auth['isAuthenticated'](),controller[_0xe3a9('0x9')]);router[_0xe3a9('0x8')](_0xe3a9('0xa'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0xc')]);router[_0xe3a9('0x8')]('/:id',auth[_0xe3a9('0xb')](),controller[_0xe3a9('0xd')]);router[_0xe3a9('0x8')](_0xe3a9('0xe'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0xf')]);router['get'](_0xe3a9('0x10'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x11')]);router[_0xe3a9('0x8')](_0xe3a9('0x12'),controller[_0xe3a9('0x13')]);router[_0xe3a9('0x8')]('/:id/avatar',controller[_0xe3a9('0x14')]);router[_0xe3a9('0x8')](_0xe3a9('0x15'),controller['getCustomerAvatar']);router[_0xe3a9('0x8')](_0xe3a9('0x16'),controller[_0xe3a9('0x17')]);router['get'](_0xe3a9('0x18'),auth['isAuthenticated'](),controller[_0xe3a9('0x19')]);router[_0xe3a9('0x8')](_0xe3a9('0x1a'),controller[_0xe3a9('0x1b')]);router['get'](_0xe3a9('0x1c'),auth['isAuthenticated'](),controller[_0xe3a9('0x1d')]);router[_0xe3a9('0x8')](_0xe3a9('0x1e'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x1f')]);router['get'](_0xe3a9('0x20'),controller[_0xe3a9('0x21')]);router[_0xe3a9('0x8')]('/:id/offline_messages',auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x22')]);router[_0xe3a9('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xe3a9('0x23')]);router[_0xe3a9('0x24')]('/',auth[_0xe3a9('0xb')](),controller['create']);router[_0xe3a9('0x24')](_0xe3a9('0xe'),auth['isAuthenticated'](),controller[_0xe3a9('0x25')]);router['post']('/:id/canned_answers',auth[_0xe3a9('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe3a9('0x26')]({'destination':function(_0x41de7f,_0x4820d6,_0x382071){_0x382071(null,path['join'](config[_0xe3a9('0x27')],'server/files/images/logos/'));},'filename':function(_0x78f76b,_0x237b54,_0x5ce486){_0x5ce486(null,util[_0xe3a9('0x28')](_0xe3a9('0x29'),Date['now'](),_0x237b54[_0xe3a9('0x2a')]));}})});router['post'](_0xe3a9('0x12'),upload[_0xe3a9('0x2b')](_0xe3a9('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0xe3a9('0x26')]({'destination':function(_0x4f43f6,_0x4d943b,_0x1d5659){_0x1d5659(null,path[_0xe3a9('0x2d')](config[_0xe3a9('0x27')],_0xe3a9('0x2e')));},'filename':function(_0x51ab1d,_0x4c5e54,_0x4041f7){_0x4041f7(null,util[_0xe3a9('0x28')]('%s-%s',Date['now'](),_0x4c5e54[_0xe3a9('0x2a')]));}})});router[_0xe3a9('0x24')]('/:id/avatar',upload[_0xe3a9('0x2b')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xe3a9('0x26')]({'destination':function(_0x3e4fea,_0x3fc986,_0x340bcf){_0x340bcf(null,path[_0xe3a9('0x2d')](config['root'],_0xe3a9('0x2e')));},'filename':function(_0x1340e0,_0x25c1fc,_0x28efe7){_0x28efe7(null,util[_0xe3a9('0x28')](_0xe3a9('0x29'),Date['now'](),_0x25c1fc[_0xe3a9('0x2a')]));}})});router[_0xe3a9('0x24')]('/:id/customer_avatar',upload['single'](_0xe3a9('0x2c')),controller[_0xe3a9('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4be1a8,_0xa3da92,_0x3e72cf){_0x3e72cf(null,path[_0xe3a9('0x2d')](config[_0xe3a9('0x27')],_0xe3a9('0x2e')));},'filename':function(_0xfd7bcc,_0x5694c5,_0x29ec42){_0x29ec42(null,util['format'](_0xe3a9('0x29'),Date[_0xe3a9('0x30')](),_0x5694c5['originalname']));}})});router[_0xe3a9('0x24')](_0xe3a9('0x16'),upload[_0xe3a9('0x2b')](_0xe3a9('0x2c')),controller['addSystemAvatar']);router[_0xe3a9('0x24')](_0xe3a9('0x31'),controller[_0xe3a9('0x32')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x6b345e,_0x29b465,_0x5ca9e3){const _0x937c62=path[_0xe3a9('0x2d')](config[_0xe3a9('0x27')],_0xe3a9('0x33'),'attachments',_0xe3a9('0x34'));fs_extra[_0xe3a9('0x35')](_0x937c62,function(){_0x5ca9e3(null,_0x937c62);});},'filename':function(_0x178427,_0x217944,_0x1c7c29){const _0x19e037=_0x217944['originalname'][_0xe3a9('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x753e00=path[_0xe3a9('0x37')](_0x19e037);const _0x2af89b=Date[_0xe3a9('0x30')]()+'-'+_0x19e037[_0xe3a9('0x36')](_0x753e00,'')+_0x753e00;_0x1c7c29(null,_0x2af89b);}})});router[_0xe3a9('0x24')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xe3a9('0x38')]);router[_0xe3a9('0x24')](_0xe3a9('0x18'),auth[_0xe3a9('0xb')](),controller['addInteraction']);router[_0xe3a9('0x24')](_0xe3a9('0x1c'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x39')]);router['post'](_0xe3a9('0x1e'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x3a')]);router[_0xe3a9('0x24')](_0xe3a9('0x3b'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x3c')]);router[_0xe3a9('0x3d')](_0xe3a9('0x3e'),auth[_0xe3a9('0xb')](),controller['update']);router[_0xe3a9('0x3f')](_0xe3a9('0x3e'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x40')]);router['delete'](_0xe3a9('0xe'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x41')]);router[_0xe3a9('0x3f')](_0xe3a9('0x10'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x42')]);router['delete'](_0xe3a9('0x3b'),auth[_0xe3a9('0xb')](),controller[_0xe3a9('0x43')]);module['exports']=router; \ No newline at end of file +var _0xe6a4=['/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','extname','/:id/offline','any','offline','addProactiveActions','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addAvatar','join'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xe6a4,0x12d));var _0x4e6a=function(_0x147ed4,_0x1b60ec){_0x147ed4=_0x147ed4-0x0;var _0x2069e7=_0xe6a4[_0x147ed4];return _0x2069e7;};'use strict';var multer=require(_0x4e6a('0x0'));var util=require('util');var path=require(_0x4e6a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4e6a('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e6a('0x3'));var controller=require(_0x4e6a('0x4'));router[_0x4e6a('0x5')]('/',auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x7')]);router['get'](_0x4e6a('0x8'),auth[_0x4e6a('0x6')](),controller['describe']);router[_0x4e6a('0x5')]('/:id',auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x9')]);router['get']('/:id/dispositions',auth[_0x4e6a('0x6')](),controller['getDispositions']);router['get'](_0x4e6a('0xa'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0xb')]);router[_0x4e6a('0x5')](_0x4e6a('0xc'),controller[_0x4e6a('0xd')]);router[_0x4e6a('0x5')](_0x4e6a('0xe'),controller[_0x4e6a('0xf')]);router['get']('/:id/customer_avatar',controller[_0x4e6a('0x10')]);router[_0x4e6a('0x5')](_0x4e6a('0x11'),controller[_0x4e6a('0x12')]);router[_0x4e6a('0x5')](_0x4e6a('0x13'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x14')]);router[_0x4e6a('0x5')](_0x4e6a('0x15'),controller[_0x4e6a('0x16')]);router[_0x4e6a('0x5')](_0x4e6a('0x17'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x18')]);router[_0x4e6a('0x5')](_0x4e6a('0x19'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x1a')]);router[_0x4e6a('0x5')]('/:id/fields',controller[_0x4e6a('0x1b')]);router[_0x4e6a('0x5')](_0x4e6a('0x1c'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x1d')]);router[_0x4e6a('0x5')](_0x4e6a('0x1e'),auth[_0x4e6a('0x6')](),controller['getAgents']);router[_0x4e6a('0x1f')]('/',auth['isAuthenticated'](),controller[_0x4e6a('0x20')]);router[_0x4e6a('0x1f')](_0x4e6a('0x21'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x22')]);router[_0x4e6a('0x1f')]('/:id/canned_answers',auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x23')]);var upload=multer({'storage':multer[_0x4e6a('0x24')]({'destination':function(_0x180322,_0x534952,_0x2bd4ad){_0x2bd4ad(null,path['join'](config[_0x4e6a('0x25')],_0x4e6a('0x26')));},'filename':function(_0x4a8f7a,_0x587089,_0x4911bb){_0x4911bb(null,util['format'](_0x4e6a('0x27'),Date[_0x4e6a('0x28')](),_0x587089[_0x4e6a('0x29')]));}})});router[_0x4e6a('0x1f')](_0x4e6a('0xc'),upload[_0x4e6a('0x2a')](_0x4e6a('0x2b')),controller[_0x4e6a('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x282560,_0x527a24,_0x3e365e){_0x3e365e(null,path['join'](config[_0x4e6a('0x25')],_0x4e6a('0x2d')));},'filename':function(_0x154f60,_0x18a586,_0x104492){_0x104492(null,util[_0x4e6a('0x2e')](_0x4e6a('0x27'),Date[_0x4e6a('0x28')](),_0x18a586[_0x4e6a('0x29')]));}})});router['post'](_0x4e6a('0xe'),upload[_0x4e6a('0x2a')](_0x4e6a('0x2b')),controller[_0x4e6a('0x2f')]);var upload=multer({'storage':multer[_0x4e6a('0x24')]({'destination':function(_0x5b5cca,_0x1d7275,_0x2f1ec9){_0x2f1ec9(null,path[_0x4e6a('0x30')](config[_0x4e6a('0x25')],_0x4e6a('0x2d')));},'filename':function(_0x5e00a2,_0x3aa97f,_0x31aa76){_0x31aa76(null,util[_0x4e6a('0x2e')](_0x4e6a('0x27'),Date['now'](),_0x3aa97f['originalname']));}})});router[_0x4e6a('0x1f')](_0x4e6a('0x31'),upload[_0x4e6a('0x2a')]('file'),controller[_0x4e6a('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4027e0,_0x54f759,_0x348904){_0x348904(null,path[_0x4e6a('0x30')](config[_0x4e6a('0x25')],_0x4e6a('0x2d')));},'filename':function(_0x4e181b,_0x16ae98,_0x5b1f84){_0x5b1f84(null,util[_0x4e6a('0x2e')]('%s-%s',Date[_0x4e6a('0x28')](),_0x16ae98[_0x4e6a('0x29')]));}})});router[_0x4e6a('0x1f')](_0x4e6a('0x11'),upload[_0x4e6a('0x2a')](_0x4e6a('0x2b')),controller[_0x4e6a('0x33')]);router[_0x4e6a('0x1f')](_0x4e6a('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x4e6a('0x24')]({'destination':function(_0x3da1cb,_0x5dc5fe,_0x46ddf4){const _0x317644=path[_0x4e6a('0x30')](config[_0x4e6a('0x25')],_0x4e6a('0x35'),'attachments',_0x4e6a('0x36'));fs_extra[_0x4e6a('0x37')](_0x317644,function(){_0x46ddf4(null,_0x317644);});},'filename':function(_0x3365c6,_0x5dac0d,_0x5f3944){const _0x45844d=_0x5dac0d[_0x4e6a('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2f180a=path[_0x4e6a('0x38')](_0x45844d);const _0xff6e10=Date[_0x4e6a('0x28')]()+'-'+_0x45844d['replace'](_0x2f180a,'')+_0x2f180a;_0x5f3944(null,_0xff6e10);}})});router[_0x4e6a('0x1f')](_0x4e6a('0x39'),offlineUploadMulter[_0x4e6a('0x3a')](),controller[_0x4e6a('0x3b')]);router[_0x4e6a('0x1f')](_0x4e6a('0x13'),auth[_0x4e6a('0x6')](),controller['addInteraction']);router[_0x4e6a('0x1f')]('/:id/applications',auth[_0x4e6a('0x6')](),controller['addApplications']);router[_0x4e6a('0x1f')](_0x4e6a('0x19'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x3c')]);router['post'](_0x4e6a('0x1e'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x3d')]);router['put'](_0x4e6a('0x3e'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x3f')]);router[_0x4e6a('0x40')](_0x4e6a('0x3e'),auth['isAuthenticated'](),controller[_0x4e6a('0x41')]);router[_0x4e6a('0x40')](_0x4e6a('0x21'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x42')]);router[_0x4e6a('0x40')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4e6a('0x43')]);router[_0x4e6a('0x40')](_0x4e6a('0x1e'),auth[_0x4e6a('0x6')](),controller[_0x4e6a('0x44')]);module[_0x4e6a('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 597726e..4d36cf6 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb29e=['expressEndpoint','/client-logs','use','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','client-side-logger'];(function(_0x37d22f,_0x19a56b){var _0x3b06e6=function(_0xae9189){while(--_0xae9189){_0x37d22f['push'](_0x37d22f['shift']());}};_0x3b06e6(++_0x19a56b);}(_0xb29e,0x1cf));var _0xeb29=function(_0x3b5ccb,_0x3c7d78){_0x3b5ccb=_0x3b5ccb-0x0;var _0x2c6c10=_0xb29e[_0x3b5ccb];return _0x2c6c10;};var beaverLogger=require(_0xeb29('0x0'));var express=require(_0xeb29('0x1'));var auth=require(_0xeb29('0x2'));var config=require(_0xeb29('0x3'));var router=express['Router']();var isProduction=config[_0xeb29('0x4')]===_0xeb29('0x5')||![];function clientSideLogs(_0x2137b2,_0x27276b,_0x7a1880){var _0x47a970=_0x2137b2['app']['get'](_0xeb29('0x6'));if(!_0x47a970){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xeb29('0x7')]({'uri':_0xeb29('0x8'),'logger':_0x47a970,'enableCors':!isProduction})(_0x2137b2,_0x27276b,_0x7a1880);}router[_0xeb29('0x9')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x9754=['beaver-logger/server','../components/auth/service','Router','env','production','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports'];(function(_0x134345,_0x527c12){var _0x526c47=function(_0x122d09){while(--_0x122d09){_0x134345['push'](_0x134345['shift']());}};_0x526c47(++_0x527c12);}(_0x9754,0x15c));var _0x4975=function(_0x2bafdf,_0x5f1a96){_0x2bafdf=_0x2bafdf-0x0;var _0x207a70=_0x9754[_0x2bafdf];return _0x207a70;};var beaverLogger=require(_0x4975('0x0'));var express=require('express');var auth=require(_0x4975('0x1'));var config=require('../config/environment');var router=express[_0x4975('0x2')]();var isProduction=config[_0x4975('0x3')]===_0x4975('0x4')||![];function clientSideLogs(_0x4e81a9,_0x1a6e58,_0xf5444b){var _0x3326a7=_0x4e81a9['app'][_0x4975('0x5')](_0x4975('0x6'));if(!_0x3326a7){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x4975('0x7')]({'uri':_0x4975('0x8'),'logger':_0x3326a7,'enableCors':!isProduction})(_0x4e81a9,_0x1a6e58,_0xf5444b);}router[_0x4975('0x9')](auth[_0x4975('0xa')](),clientSideLogs);module[_0x4975('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index e666bd1..1b5641f 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbeb5=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','ENUM','Outlook365','Dynamics365'];(function(_0x3353f3,_0x189c73){var _0x2c268c=function(_0x478936){while(--_0x478936){_0x3353f3['push'](_0x3353f3['shift']());}};_0x2c268c(++_0x189c73);}(_0xbeb5,0x1d9));var _0x5beb=function(_0x9470af,_0x2e5f2d){_0x9470af=_0x9470af-0x0;var _0x56ee2b=_0xbeb5[_0x9470af];return _0x56ee2b;};'use strict';var Sequelize=require(_0x5beb('0x0'));module[_0x5beb('0x1')]={'name':{'type':Sequelize[_0x5beb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x5beb('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5beb('0x4')](_0x5beb('0x5'),_0x5beb('0x6'))},'data1':{'type':Sequelize[_0x5beb('0x2')],'comment':_0x5beb('0x7')},'data2':{'type':Sequelize[_0x5beb('0x2')],'comment':_0x5beb('0x8')},'data3':{'type':Sequelize[_0x5beb('0x2')],'comment':_0x5beb('0x9')},'data4':{'type':Sequelize[_0x5beb('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x5beb('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x5beb('0xa')],'comment':_0x5beb('0xb')}}; \ No newline at end of file +var _0x4952=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure'];(function(_0x2943c8,_0x2bacdc){var _0x2defac=function(_0x35a522){while(--_0x35a522){_0x2943c8['push'](_0x2943c8['shift']());}};_0x2defac(++_0x2bacdc);}(_0x4952,0xa0));var _0x2495=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x4952[_0x27a3cb];return _0x54ff38;};'use strict';var Sequelize=require(_0x2495('0x0'));module[_0x2495('0x1')]={'name':{'type':Sequelize[_0x2495('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x2495('0x3'),_0x2495('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x2495('0x5'),_0x2495('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x2495('0x2')],'comment':_0x2495('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x2495('0x2')],'comment':_0x2495('0x8')},'data5':{'type':Sequelize[_0x2495('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x2495('0x9')],'comment':_0x2495('0xa')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index c0493c7..149d7b3 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b25=['refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','stack','name','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','then','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','length','options','find','create','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','catch','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','code','data5','access_token','data6'];(function(_0x51dae4,_0xa7f367){var _0x27d0b0=function(_0x5575d1){while(--_0x5575d1){_0x51dae4['push'](_0x51dae4['shift']());}};_0x27d0b0(++_0xa7f367);}(_0x0b25,0x1cf));var _0x50b2=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x0b25[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0x50b2('0x0'));var Redis=require('ioredis');var qs=require(_0x50b2('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x50b2('0x2'));var logger=require(_0x50b2('0x3'))('api');var db=require(_0x50b2('0x4'))['db'];var oauth=require(_0x50b2('0x5'));config[_0x50b2('0x6')]=_['defaults'](config[_0x50b2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x50b2('0x7'))(new Redis(config[_0x50b2('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x34f230,_0x435d70){_0x435d70=_0x435d70||0xcc;return function(_0x212cb5){if(_0x212cb5){return _0x34f230[_0x50b2('0x8')](_0x435d70);}return _0x34f230[_0x50b2('0x9')](_0x435d70)['end']();};}function respondWithResult(_0x1be4d6,_0x597593){_0x597593=_0x597593||0xc8;return function(_0x55a439){if(_0x55a439){return _0x1be4d6[_0x50b2('0x9')](_0x597593)[_0x50b2('0xa')](_0x55a439);}};}function respondWithFilteredResult(_0x407fd3,_0x424c00){return function(_0x3962e4){if(_0x3962e4){var _0x79559a=typeof _0x424c00[_0x50b2('0xb')]===_0x50b2('0xc')&&typeof _0x424c00[_0x50b2('0xd')]===_0x50b2('0xc');var _0x1fe18a=_0x3962e4[_0x50b2('0xe')];var _0x87df19=_0x79559a?0x0:_0x424c00[_0x50b2('0xb')];var _0x4a4eef=_0x79559a?_0x3962e4[_0x50b2('0xe')]:_0x424c00[_0x50b2('0xb')]+_0x424c00[_0x50b2('0xd')];var _0x38ebf0;if(_0x4a4eef>=_0x1fe18a){_0x4a4eef=_0x1fe18a;_0x38ebf0=0xc8;}else{_0x38ebf0=0xce;}_0x407fd3['status'](_0x38ebf0);return _0x407fd3['set'](_0x50b2('0xf'),_0x87df19+'-'+_0x4a4eef+'/'+_0x1fe18a)[_0x50b2('0xa')](_0x3962e4);}return null;};}function saveUpdates(_0x2ac238){return function(_0x3199cc){if(_0x3199cc){return _0x3199cc[_0x50b2('0x10')](_0x2ac238)['then'](function(_0x2006e9){return _0x2006e9;});}return null;};}function removeEntity(_0x3e1e47){return function(_0x558174){if(_0x558174){return _0x558174[_0x50b2('0x11')]()['then'](function(){_0x3e1e47[_0x50b2('0x9')](0xcc)[_0x50b2('0x12')]();});}};}function handleEntityNotFound(_0x144e5b){return function(_0x3f64c7){if(!_0x3f64c7){_0x144e5b[_0x50b2('0x8')](0x194);}return _0x3f64c7;};}function handleError(_0x228d62,_0x34f6a0){_0x34f6a0=_0x34f6a0||0x1f4;return function(_0x4b78e1){logger['error'](_0x4b78e1[_0x50b2('0x13')]);if(_0x4b78e1[_0x50b2('0x14')]){delete _0x4b78e1[_0x50b2('0x14')];}_0x228d62[_0x50b2('0x9')](_0x34f6a0)['send'](_0x4b78e1);};}function maskClientSecret(_0x58d7e4){return _[_0x50b2('0x15')](_0x58d7e4['slice'](0x0,0x3),0x14,'*');}exports[_0x50b2('0x16')]=function(_0x34d24e,_0xfef346){var _0x5ec733={},_0x3a632c={},_0x316246={'count':0x0,'rows':[]};var _0x3968c4=_['map'](db[_0x50b2('0x17')][_0x50b2('0x18')],function(_0x287860){return{'name':_0x287860[_0x50b2('0x19')],'type':_0x287860[_0x50b2('0x1a')][_0x50b2('0x1b')]};});_0x3a632c[_0x50b2('0x1c')]=_[_0x50b2('0x1d')](_0x3968c4,'name');_0x3a632c[_0x50b2('0x1e')]=_[_0x50b2('0x1f')](_0x34d24e[_0x50b2('0x1e')]);_0x3a632c['filters']=_[_0x50b2('0x20')](_0x3a632c[_0x50b2('0x1c')],_0x3a632c[_0x50b2('0x1e')]);_0x5ec733[_0x50b2('0x21')]=_[_0x50b2('0x20')](_0x3a632c[_0x50b2('0x1c')],qs[_0x50b2('0x22')](_0x34d24e['query'][_0x50b2('0x22')]));_0x5ec733[_0x50b2('0x21')]=_0x5ec733[_0x50b2('0x21')]['length']?_0x5ec733[_0x50b2('0x21')]:_0x3a632c[_0x50b2('0x1c')];if(!_0x34d24e[_0x50b2('0x1e')]['hasOwnProperty'](_0x50b2('0x23'))){_0x5ec733[_0x50b2('0xd')]=qs['limit'](_0x34d24e['query'][_0x50b2('0xd')]);_0x5ec733[_0x50b2('0xb')]=qs[_0x50b2('0xb')](_0x34d24e['query'][_0x50b2('0xb')]);}_0x5ec733[_0x50b2('0x24')]=qs[_0x50b2('0x25')](_0x34d24e[_0x50b2('0x1e')][_0x50b2('0x25')]);_0x5ec733[_0x50b2('0x26')]=qs[_0x50b2('0x27')](_[_0x50b2('0x28')](_0x34d24e[_0x50b2('0x1e')],_0x3a632c[_0x50b2('0x27')]),_0x3968c4);if(_0x34d24e[_0x50b2('0x1e')]['filter']){_0x5ec733[_0x50b2('0x26')]=_[_0x50b2('0x29')](_0x5ec733[_0x50b2('0x26')],{'$or':_[_0x50b2('0x1d')](_0x3968c4,function(_0x17d11d){if(_0x17d11d[_0x50b2('0x1a')]!=='VIRTUAL'){var _0x3db1fe={};_0x3db1fe[_0x17d11d['name']]={'$like':'%'+_0x34d24e[_0x50b2('0x1e')][_0x50b2('0x2a')]+'%'};return _0x3db1fe;}})});}_0x5ec733=_[_0x50b2('0x29')]({},_0x5ec733,_0x34d24e['options']);var _0x2cff02={'where':_0x5ec733[_0x50b2('0x26')]};return db[_0x50b2('0x17')][_0x50b2('0xe')](_0x2cff02)[_0x50b2('0x2b')](function(_0x392204){_0x316246['count']=_0x392204;if(_0x34d24e[_0x50b2('0x1e')][_0x50b2('0x2c')]){_0x5ec733[_0x50b2('0x2d')]=[{'all':!![]}];}return db[_0x50b2('0x17')][_0x50b2('0x2e')](_0x5ec733);})[_0x50b2('0x2b')](function(_0x1384ad){_0x316246[_0x50b2('0x2f')]=_['map'](_0x1384ad,function(_0x15c0bf){if(_0x15c0bf[_0x50b2('0x30')]===_0x50b2('0x31')){var _0x5fd966=encryptor[_0x50b2('0x32')](_0x15c0bf[_0x50b2('0x33')]);_0x15c0bf[_0x50b2('0x33')]=maskClientSecret(_0x5fd966);}return _0x15c0bf;});return _0x316246;})[_0x50b2('0x2b')](respondWithFilteredResult(_0xfef346,_0x5ec733))['catch'](handleError(_0xfef346,null));};exports[_0x50b2('0x34')]=function(_0x322c7b,_0x203fa6){var _0x47165a={'raw':!![],'where':{'id':_0x322c7b['params']['id']}},_0x3e9646={};_0x3e9646[_0x50b2('0x1c')]=_[_0x50b2('0x1f')](db['CloudProvider'][_0x50b2('0x18')]);_0x3e9646[_0x50b2('0x1e')]=_['keys'](_0x322c7b[_0x50b2('0x1e')]);_0x3e9646[_0x50b2('0x27')]=_['intersection'](_0x3e9646[_0x50b2('0x1c')],_0x3e9646[_0x50b2('0x1e')]);_0x47165a['attributes']=_['intersection'](_0x3e9646[_0x50b2('0x1c')],qs['fields'](_0x322c7b['query'][_0x50b2('0x22')]));_0x47165a[_0x50b2('0x21')]=_0x47165a[_0x50b2('0x21')][_0x50b2('0x35')]?_0x47165a['attributes']:_0x3e9646[_0x50b2('0x1c')];if(_0x322c7b['query'][_0x50b2('0x2c')]){_0x47165a['include']=[{'all':!![]}];}_0x47165a=_[_0x50b2('0x29')]({},_0x47165a,_0x322c7b[_0x50b2('0x36')]);return db[_0x50b2('0x17')][_0x50b2('0x37')](_0x47165a)[_0x50b2('0x2b')](handleEntityNotFound(_0x203fa6,null))[_0x50b2('0x2b')](function(_0x2d5308){if(_0x2d5308[_0x50b2('0x30')]===_0x50b2('0x31')){var _0x5976f5=encryptor['decryptString'](_0x2d5308[_0x50b2('0x33')]);_0x2d5308[_0x50b2('0x33')]=maskClientSecret(_0x5976f5);}return _0x2d5308;})[_0x50b2('0x2b')](respondWithResult(_0x203fa6,null))['catch'](handleError(_0x203fa6,null));};exports[_0x50b2('0x38')]=function(_0x4e7a3d,_0x2e96e2){if(!_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x14')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x30')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x1112ce=db[_0x50b2('0x17')][_0x50b2('0x18')][_0x50b2('0x30')][_0x50b2('0x3a')];if(!_0x1112ce[_0x50b2('0x3b')](_0x4e7a3d['body']['service']))throw new Error(_0x50b2('0x3c')+_0x1112ce['join'](',\x20'));if(_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x30')]===_0x50b2('0x31')&&_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x33')]){_0x4e7a3d['body']['data3']=encryptor[_0x50b2('0x3d')](_0x4e7a3d[_0x50b2('0x39')][_0x50b2('0x33')]);}return db['CloudProvider']['create'](_0x4e7a3d['body'],{})[_0x50b2('0x2b')](respondWithResult(_0x2e96e2,0xc9))[_0x50b2('0x3e')](handleError(_0x2e96e2,null));};exports['update']=function(_0x48ce08,_0x4e434f){if(_0x48ce08[_0x50b2('0x39')]['id']){delete _0x48ce08[_0x50b2('0x39')]['id'];}return db['CloudProvider'][_0x50b2('0x37')]({'where':{'id':_0x48ce08['params']['id']}})['then'](handleEntityNotFound(_0x4e434f,null))[_0x50b2('0x2b')](function(_0x50581e){if(_0x50581e[_0x50b2('0x30')]==='MicrosoftAzure'&&_0x48ce08[_0x50b2('0x39')][_0x50b2('0x33')]){_0x48ce08['body'][_0x50b2('0x33')]=encryptor[_0x50b2('0x3d')](_0x48ce08[_0x50b2('0x39')][_0x50b2('0x33')]);}return _0x50581e;})[_0x50b2('0x2b')](saveUpdates(_0x48ce08['body'],null))['then'](respondWithResult(_0x4e434f,null))[_0x50b2('0x3e')](handleError(_0x4e434f,null));};exports[_0x50b2('0x11')]=function(_0x1af08d,_0x144e71){return db[_0x50b2('0x17')][_0x50b2('0x37')]({'where':{'id':_0x1af08d[_0x50b2('0x3f')]['id']}})[_0x50b2('0x2b')](handleEntityNotFound(_0x144e71,null))[_0x50b2('0x2b')](removeEntity(_0x144e71,null))['catch'](handleError(_0x144e71,null));};exports[_0x50b2('0x40')]=function(_0x58fad1,_0x13367e){return db[_0x50b2('0x17')]['findOne']({'where':{'id':_0x58fad1[_0x50b2('0x3f')]['id']},'raw':!![]})[_0x50b2('0x2b')](function(_0x393c82){if(!_0x393c82)return _0x13367e[_0x50b2('0x8')](0x194);return{'url':oauth[_0x50b2('0x41')](_0x393c82,_0x58fad1[_0x50b2('0x42')]['id'])};})[_0x50b2('0x2b')](respondWithResult(_0x13367e,null))[_0x50b2('0x3e')](handleError(_0x13367e,null));};exports[_0x50b2('0x43')]=function(_0x505ae7,_0x17d57c){var _0x3839fc=_0x505ae7[_0x50b2('0x39')];var _0x2bfc3c;var _0x1324b8;if(_0x3839fc['error'])throw _0x3839fc;redis['get'](_0x3839fc[_0x50b2('0x44')])[_0x50b2('0x2b')](function(_0x380491){if(!_0x380491)throw new Error(_0x50b2('0x45'));_0x2bfc3c=JSON[_0x50b2('0x46')](_0x380491);var _0x31d337=Buffer[_0x50b2('0x47')](_0x3839fc[_0x50b2('0x44')],_0x50b2('0x48'))[_0x50b2('0x49')](_0x50b2('0x4a'));_0x1324b8=JSON[_0x50b2('0x46')](_0x31d337);if(!oauth[_0x50b2('0x4b')](_0x3839fc[_0x50b2('0x4c')],_0x2bfc3c[_0x50b2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x50b2('0x4e')](_0x3839fc[_0x50b2('0x44')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3839fc[_0x50b2('0x4f')],_0x2bfc3c);})['then'](function(_0x4edeb8){_0x2bfc3c[_0x50b2('0x50')]=_0x4edeb8[_0x50b2('0x51')];_0x2bfc3c[_0x50b2('0x52')]=_0x4edeb8[_0x50b2('0x53')];return db[_0x50b2('0x17')][_0x50b2('0x10')]({'data5':_0x2bfc3c[_0x50b2('0x50')],'data6':_0x2bfc3c['data6']},{'where':{'id':_0x2bfc3c['id']}});})[_0x50b2('0x2b')](function(){oauth['startRefreshInterval'](_0x2bfc3c);socket[_0x50b2('0x54')](_0x50b2('0x55'),{'id':_0x1324b8['id']});return;})[_0x50b2('0x2b')](respondWithStatusCode(_0x17d57c,null))[_0x50b2('0x3e')](function(_0x490795){if(_0x1324b8){socket['emit'](_0x50b2('0x56'),{'id':_0x1324b8['id']});}if(!_0x2bfc3c){logger[_0x50b2('0x57')]('Invalid\x20authentication\x20state\x20parameter',_0x490795);return _0x17d57c[_0x50b2('0x9')](0x1f4)[_0x50b2('0x58')](_0x490795['message']);}logger[_0x50b2('0x57')](_0x50b2('0x59'),_0x2bfc3c['id'],JSON[_0x50b2('0x5a')](_0x490795));});}; \ No newline at end of file +var _0xa573=['sendStatus','error','stack','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','service','decryptString','data3','catch','show','keys','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','update','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','limit','count','Content-Range','json','then','destroy'];(function(_0x143620,_0x2738da){var _0x24fcec=function(_0x4ce62c){while(--_0x4ce62c){_0x143620['push'](_0x143620['shift']());}};_0x24fcec(++_0x2738da);}(_0xa573,0x114));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a57('0x0'));var Redis=require(_0x3a57('0x1'));var qs=require(_0x3a57('0x2'));var encryptor=require(_0x3a57('0x3'));var config=require(_0x3a57('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x3a57('0x5'))['db'];var oauth=require(_0x3a57('0x6'));config[_0x3a57('0x7')]=_[_0x3a57('0x8')](config[_0x3a57('0x7')],{'host':_0x3a57('0x9'),'port':0x18eb});var socket=require(_0x3a57('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x3a57('0x7')]);function respondWithStatusCode(_0x13fff6,_0x108af9){_0x108af9=_0x108af9||0xcc;return function(_0x48f641){if(_0x48f641){return _0x13fff6['sendStatus'](_0x108af9);}return _0x13fff6[_0x3a57('0xb')](_0x108af9)[_0x3a57('0xc')]();};}function respondWithResult(_0x1c17b1,_0x317a9f){_0x317a9f=_0x317a9f||0xc8;return function(_0x444a95){if(_0x444a95){return _0x1c17b1[_0x3a57('0xb')](_0x317a9f)['json'](_0x444a95);}};}function respondWithFilteredResult(_0x3bf6c1,_0x259149){return function(_0x512dac){if(_0x512dac){var _0x800be4=typeof _0x259149[_0x3a57('0xd')]===_0x3a57('0xe')&&typeof _0x259149[_0x3a57('0xf')]==='undefined';var _0x1fdfa6=_0x512dac['count'];var _0x4abac8=_0x800be4?0x0:_0x259149[_0x3a57('0xd')];var _0x23c588=_0x800be4?_0x512dac[_0x3a57('0x10')]:_0x259149[_0x3a57('0xd')]+_0x259149[_0x3a57('0xf')];var _0x593d46;if(_0x23c588>=_0x1fdfa6){_0x23c588=_0x1fdfa6;_0x593d46=0xc8;}else{_0x593d46=0xce;}_0x3bf6c1[_0x3a57('0xb')](_0x593d46);return _0x3bf6c1['set'](_0x3a57('0x11'),_0x4abac8+'-'+_0x23c588+'/'+_0x1fdfa6)[_0x3a57('0x12')](_0x512dac);}return null;};}function saveUpdates(_0x1b35f7){return function(_0x2db4a1){if(_0x2db4a1){return _0x2db4a1['update'](_0x1b35f7)[_0x3a57('0x13')](function(_0x4de1a3){return _0x4de1a3;});}return null;};}function removeEntity(_0x56d344){return function(_0xe104ce){if(_0xe104ce){return _0xe104ce[_0x3a57('0x14')]()[_0x3a57('0x13')](function(){_0x56d344[_0x3a57('0xb')](0xcc)[_0x3a57('0xc')]();});}};}function handleEntityNotFound(_0x813be9){return function(_0x7178){if(!_0x7178){_0x813be9[_0x3a57('0x15')](0x194);}return _0x7178;};}function handleError(_0x3253b3,_0x50f30f){_0x50f30f=_0x50f30f||0x1f4;return function(_0x16b0e5){logger[_0x3a57('0x16')](_0x16b0e5[_0x3a57('0x17')]);if(_0x16b0e5[_0x3a57('0x18')]){delete _0x16b0e5['name'];}_0x3253b3[_0x3a57('0xb')](_0x50f30f)[_0x3a57('0x19')](_0x16b0e5);};}function maskClientSecret(_0x3eb832){return _[_0x3a57('0x1a')](_0x3eb832[_0x3a57('0x1b')](0x0,0x3),0x14,'*');}exports[_0x3a57('0x1c')]=function(_0x3bc0d2,_0x5d996c){var _0x194099={},_0x374fd2={},_0x13333d={'count':0x0,'rows':[]};var _0x5a42d2=_['map'](db[_0x3a57('0x1d')][_0x3a57('0x1e')],function(_0x57acea){return{'name':_0x57acea[_0x3a57('0x1f')],'type':_0x57acea[_0x3a57('0x20')]['key']};});_0x374fd2[_0x3a57('0x21')]=_['map'](_0x5a42d2,_0x3a57('0x18'));_0x374fd2[_0x3a57('0x22')]=_['keys'](_0x3bc0d2[_0x3a57('0x22')]);_0x374fd2[_0x3a57('0x23')]=_[_0x3a57('0x24')](_0x374fd2[_0x3a57('0x21')],_0x374fd2[_0x3a57('0x22')]);_0x194099[_0x3a57('0x25')]=_[_0x3a57('0x24')](_0x374fd2['model'],qs[_0x3a57('0x26')](_0x3bc0d2[_0x3a57('0x22')][_0x3a57('0x26')]));_0x194099['attributes']=_0x194099[_0x3a57('0x25')][_0x3a57('0x27')]?_0x194099[_0x3a57('0x25')]:_0x374fd2[_0x3a57('0x21')];if(!_0x3bc0d2[_0x3a57('0x22')][_0x3a57('0x28')](_0x3a57('0x29'))){_0x194099[_0x3a57('0xf')]=qs['limit'](_0x3bc0d2[_0x3a57('0x22')][_0x3a57('0xf')]);_0x194099[_0x3a57('0xd')]=qs['offset'](_0x3bc0d2[_0x3a57('0x22')]['offset']);}_0x194099[_0x3a57('0x2a')]=qs[_0x3a57('0x2b')](_0x3bc0d2['query'][_0x3a57('0x2b')]);_0x194099[_0x3a57('0x2c')]=qs[_0x3a57('0x23')](_[_0x3a57('0x2d')](_0x3bc0d2[_0x3a57('0x22')],_0x374fd2[_0x3a57('0x23')]),_0x5a42d2);if(_0x3bc0d2['query'][_0x3a57('0x2e')]){_0x194099[_0x3a57('0x2c')]=_[_0x3a57('0x2f')](_0x194099[_0x3a57('0x2c')],{'$or':_[_0x3a57('0x30')](_0x5a42d2,function(_0x1fdfb0){if(_0x1fdfb0[_0x3a57('0x20')]!==_0x3a57('0x31')){var _0x5b1bb6={};_0x5b1bb6[_0x1fdfb0[_0x3a57('0x18')]]={'$like':'%'+_0x3bc0d2['query'][_0x3a57('0x2e')]+'%'};return _0x5b1bb6;}})});}_0x194099=_[_0x3a57('0x2f')]({},_0x194099,_0x3bc0d2[_0x3a57('0x32')]);var _0x1bc78f={'where':_0x194099[_0x3a57('0x2c')]};return db[_0x3a57('0x1d')]['count'](_0x1bc78f)[_0x3a57('0x13')](function(_0x362696){_0x13333d[_0x3a57('0x10')]=_0x362696;if(_0x3bc0d2['query'][_0x3a57('0x33')]){_0x194099[_0x3a57('0x34')]=[{'all':!![]}];}return db[_0x3a57('0x1d')]['findAll'](_0x194099);})['then'](function(_0x344603){_0x13333d[_0x3a57('0x35')]=_[_0x3a57('0x30')](_0x344603,function(_0x39280e){if(_0x39280e[_0x3a57('0x36')]==='MicrosoftAzure'){var _0x72c278=encryptor[_0x3a57('0x37')](_0x39280e[_0x3a57('0x38')]);_0x39280e['data3']=maskClientSecret(_0x72c278);}return _0x39280e;});return _0x13333d;})[_0x3a57('0x13')](respondWithFilteredResult(_0x5d996c,_0x194099))[_0x3a57('0x39')](handleError(_0x5d996c,null));};exports[_0x3a57('0x3a')]=function(_0x4bc048,_0x5bd28e){var _0x267263={'raw':!![],'where':{'id':_0x4bc048['params']['id']}},_0xf6785d={};_0xf6785d[_0x3a57('0x21')]=_['keys'](db[_0x3a57('0x1d')]['rawAttributes']);_0xf6785d[_0x3a57('0x22')]=_[_0x3a57('0x3b')](_0x4bc048[_0x3a57('0x22')]);_0xf6785d[_0x3a57('0x23')]=_[_0x3a57('0x24')](_0xf6785d[_0x3a57('0x21')],_0xf6785d[_0x3a57('0x22')]);_0x267263[_0x3a57('0x25')]=_['intersection'](_0xf6785d['model'],qs['fields'](_0x4bc048[_0x3a57('0x22')][_0x3a57('0x26')]));_0x267263['attributes']=_0x267263[_0x3a57('0x25')][_0x3a57('0x27')]?_0x267263['attributes']:_0xf6785d['model'];if(_0x4bc048[_0x3a57('0x22')][_0x3a57('0x33')]){_0x267263[_0x3a57('0x34')]=[{'all':!![]}];}_0x267263=_[_0x3a57('0x2f')]({},_0x267263,_0x4bc048[_0x3a57('0x32')]);return db[_0x3a57('0x1d')][_0x3a57('0x3c')](_0x267263)[_0x3a57('0x13')](handleEntityNotFound(_0x5bd28e,null))['then'](function(_0x1dc057){if(_0x1dc057[_0x3a57('0x36')]===_0x3a57('0x3d')){var _0x2352aa=encryptor[_0x3a57('0x37')](_0x1dc057[_0x3a57('0x38')]);_0x1dc057['data3']=maskClientSecret(_0x2352aa);}return _0x1dc057;})[_0x3a57('0x13')](respondWithResult(_0x5bd28e,null))[_0x3a57('0x39')](handleError(_0x5bd28e,null));};exports[_0x3a57('0x3e')]=function(_0x6800e7,_0x1ae444){if(!_0x6800e7[_0x3a57('0x3f')][_0x3a57('0x18')])throw new Error(_0x3a57('0x40'));if(!_0x6800e7['body'][_0x3a57('0x36')])throw new Error(_0x3a57('0x41'));var _0x5b0005=db[_0x3a57('0x1d')][_0x3a57('0x1e')][_0x3a57('0x36')][_0x3a57('0x42')];if(!_0x5b0005['includes'](_0x6800e7[_0x3a57('0x3f')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5b0005[_0x3a57('0x43')](',\x20'));if(_0x6800e7['body'][_0x3a57('0x36')]===_0x3a57('0x3d')&&_0x6800e7[_0x3a57('0x3f')][_0x3a57('0x38')]){_0x6800e7[_0x3a57('0x3f')][_0x3a57('0x38')]=encryptor[_0x3a57('0x44')](_0x6800e7[_0x3a57('0x3f')][_0x3a57('0x38')]);}return db[_0x3a57('0x1d')][_0x3a57('0x3e')](_0x6800e7[_0x3a57('0x3f')],{})[_0x3a57('0x13')](respondWithResult(_0x1ae444,0xc9))[_0x3a57('0x39')](handleError(_0x1ae444,null));};exports['update']=function(_0x3a2eb1,_0x446eb2){if(_0x3a2eb1[_0x3a57('0x3f')]['id']){delete _0x3a2eb1[_0x3a57('0x3f')]['id'];}return db[_0x3a57('0x1d')][_0x3a57('0x3c')]({'where':{'id':_0x3a2eb1[_0x3a57('0x45')]['id']}})[_0x3a57('0x13')](handleEntityNotFound(_0x446eb2,null))['then'](function(_0x49b3a8){if(_0x49b3a8[_0x3a57('0x36')]===_0x3a57('0x3d')&&_0x3a2eb1[_0x3a57('0x3f')][_0x3a57('0x38')]){_0x3a2eb1['body'][_0x3a57('0x38')]=encryptor[_0x3a57('0x44')](_0x3a2eb1[_0x3a57('0x3f')][_0x3a57('0x38')]);}return _0x49b3a8;})[_0x3a57('0x13')](saveUpdates(_0x3a2eb1[_0x3a57('0x3f')],null))['then'](respondWithResult(_0x446eb2,null))[_0x3a57('0x39')](handleError(_0x446eb2,null));};exports[_0x3a57('0x14')]=function(_0x5c2ee8,_0x5acb2c){return db['CloudProvider'][_0x3a57('0x3c')]({'where':{'id':_0x5c2ee8[_0x3a57('0x45')]['id']}})[_0x3a57('0x13')](handleEntityNotFound(_0x5acb2c,null))[_0x3a57('0x13')](removeEntity(_0x5acb2c,null))[_0x3a57('0x39')](handleError(_0x5acb2c,null));};exports[_0x3a57('0x46')]=function(_0x1791a4,_0xae44b7){return db[_0x3a57('0x1d')][_0x3a57('0x47')]({'where':{'id':_0x1791a4['params']['id']},'raw':!![]})[_0x3a57('0x13')](function(_0x155f99){if(!_0x155f99)return _0xae44b7[_0x3a57('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x155f99,_0x1791a4[_0x3a57('0x48')]['id'])};})[_0x3a57('0x13')](respondWithResult(_0xae44b7,null))['catch'](handleError(_0xae44b7,null));};exports[_0x3a57('0x49')]=function(_0x2190ea,_0x266dfd){var _0x471eac=_0x2190ea[_0x3a57('0x3f')];var _0x4ac996;var _0x26e043;if(_0x471eac[_0x3a57('0x16')])throw _0x471eac;redis[_0x3a57('0x4a')](_0x471eac['state'])[_0x3a57('0x13')](function(_0xe7d6a9){if(!_0xe7d6a9)throw new Error(_0x3a57('0x4b'));_0x4ac996=JSON[_0x3a57('0x4c')](_0xe7d6a9);var _0xfaae42=Buffer[_0x3a57('0x4d')](_0x471eac['state'],_0x3a57('0x4e'))[_0x3a57('0x4f')](_0x3a57('0x50'));_0x26e043=JSON[_0x3a57('0x4c')](_0xfaae42);if(!oauth[_0x3a57('0x51')](_0x471eac[_0x3a57('0x52')],_0x4ac996[_0x3a57('0x53')]))throw new Error(_0x3a57('0x54'));redis[_0x3a57('0x55')](_0x471eac[_0x3a57('0x56')]);return oauth[_0x3a57('0x57')](_0x471eac[_0x3a57('0x58')],_0x4ac996);})[_0x3a57('0x13')](function(_0x2f5179){_0x4ac996[_0x3a57('0x59')]=_0x2f5179[_0x3a57('0x5a')];_0x4ac996[_0x3a57('0x5b')]=_0x2f5179[_0x3a57('0x5c')];return db[_0x3a57('0x1d')][_0x3a57('0x5d')]({'data5':_0x4ac996[_0x3a57('0x59')],'data6':_0x4ac996['data6']},{'where':{'id':_0x4ac996['id']}});})[_0x3a57('0x13')](function(){oauth[_0x3a57('0x5e')](_0x4ac996);socket['emit'](_0x3a57('0x5f'),{'id':_0x26e043['id']});return;})['then'](respondWithStatusCode(_0x266dfd,null))['catch'](function(_0x25862a){if(_0x26e043){socket['emit'](_0x3a57('0x60'),{'id':_0x26e043['id']});}if(!_0x4ac996){logger[_0x3a57('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x25862a);return _0x266dfd[_0x3a57('0xb')](0x1f4)[_0x3a57('0x19')](_0x25862a[_0x3a57('0x61')]);}logger[_0x3a57('0x16')](_0x3a57('0x62'),_0x4ac996['id'],JSON['stringify'](_0x25862a));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 07d4813..8a4dac7 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0976=['rimraf','./cloudProvider.attributes','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x0976,0x1e8));var _0x6097=function(_0x5d520f,_0x8422d1){_0x5d520f=_0x5d520f-0x0;var _0x16e308=_0x0976[_0x5d520f];return _0x16e308;};'use strict';var _=require(_0x6097('0x0'));var util=require(_0x6097('0x1'));var logger=require(_0x6097('0x2'))('api');var moment=require(_0x6097('0x3'));var BPromise=require(_0x6097('0x4'));var rp=require(_0x6097('0x5'));var fs=require('fs');var path=require(_0x6097('0x6'));var rimraf=require(_0x6097('0x7'));var config=require('../../config/environment');var attributes=require(_0x6097('0x8'));module['exports']=function(_0x4c832a,_0x329972){return _0x4c832a['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xada8=['cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x19758f,_0x4b3c34){var _0x26c5db=function(_0x2cf8f1){while(--_0x2cf8f1){_0x19758f['push'](_0x19758f['shift']());}};_0x26c5db(++_0x4b3c34);}(_0xada8,0x1d5));var _0x8ada=function(_0x383e8d,_0x46a4ee){_0x383e8d=_0x383e8d-0x0;var _0xbbd864=_0xada8[_0x383e8d];return _0xbbd864;};'use strict';var _=require(_0x8ada('0x0'));var util=require('util');var logger=require(_0x8ada('0x1'))(_0x8ada('0x2'));var moment=require(_0x8ada('0x3'));var BPromise=require(_0x8ada('0x4'));var rp=require(_0x8ada('0x5'));var fs=require('fs');var path=require(_0x8ada('0x6'));var rimraf=require(_0x8ada('0x7'));var config=require(_0x8ada('0x8'));var attributes=require(_0x8ada('0x9'));module[_0x8ada('0xa')]=function(_0x8fa05f,_0x3de2cf){return _0x8fa05f['define'](_0x8ada('0xb'),attributes,{'tableName':_0x8ada('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 30c8f9f..7182114 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7837=['data3','CloudProvider','findOne','refresh_token','data6','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','{TENANT_ID}','intervals','bind','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/token','map','type','Dynamics365','data7','/.default','Outlook365','replace','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','value','oauth2Claims','oauth2/','payload','aud','audience','isAfter','unix','exp','resolve','then'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x7837,0x104));var _0x7783=function(_0x1a15f7,_0x4b1474){_0x1a15f7=_0x1a15f7-0x0;var _0x1dd560=_0x7837[_0x1a15f7];return _0x1dd560;};'use strict';var _=require(_0x7783('0x0'));var crypto=require(_0x7783('0x1'));var jwt=require(_0x7783('0x2'));var moment=require(_0x7783('0x3'));var Redis=require(_0x7783('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x7783('0x5'));var config=require(_0x7783('0x6'));var logger=require(_0x7783('0x7'))('api');var schedule=require(_0x7783('0x8'));var db=require(_0x7783('0x9'))['db'];config['redis']=_[_0x7783('0xa')](config['redis'],{'host':_0x7783('0xb'),'port':0x18eb});var redis=new Redis(config[_0x7783('0xc')]);var MICROSOFT_AUTH_URL=_0x7783('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x7783('0xe'),'offline_access',_0x7783('0xf'),_0x7783('0x10'),_0x7783('0x11')],'Dynamics365':[_0x7783('0x12'),_0x7783('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x7783('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x324d50){var _0x5a777b=_[_0x7783('0x15')](AZURE_AUTH_SCOPES[_0x324d50[_0x7783('0x16')]]);if(_0x324d50[_0x7783('0x16')]===_0x7783('0x17'))_0x5a777b['push'](_0x324d50[_0x7783('0x18')]+_0x7783('0x19'));return _0x5a777b['join']('\x20');}function getAccessTokenScope(_0x42fbf2){if(_0x42fbf2['type']===_0x7783('0x1a'))return _0x7783('0xf');if(_0x42fbf2[_0x7783('0x16')]===_0x7783('0x17'))return _0x42fbf2['data7']+_0x7783('0x19');}function generateMicrosoftAuthorizationUrl(_0xc45502,_0x42e23f){var _0x3169ce=MICROSOFT_AUTH_URL[_0x7783('0x1b')]('{TENANT_ID}',_0xc45502[_0x7783('0x1c')]);var _0x2a97bb=[_0x7783('0x1d'),_0x7783('0x1e')];var _0x57a99b=Buffer[_0x7783('0x1f')](JSON[_0x7783('0x20')]({'id':_0x42e23f}))['toString'](_0x7783('0x21'));var _0x474bf0=crypto[_0x7783('0x22')](0x10)[_0x7783('0x23')](_0x7783('0x24'));var _0x48c979=getAuthorizationScopes(_0xc45502);var _0x1a3ca5=[{'key':_0x7783('0x25'),'value':_0xc45502[_0x7783('0x26')]},{'key':_0x7783('0x27'),'value':encodeURIComponent(_0x2a97bb[_0x7783('0x28')]('\x20'))},{'key':_0x7783('0x29'),'value':_0xc45502[_0x7783('0x2a')]},{'key':_0x7783('0x2b'),'value':_0x7783('0x2c')},{'key':'scope','value':encodeURIComponent(_0x48c979)},{'key':_0x7783('0x2d'),'value':_0x57a99b},{'key':_0x7783('0x2e'),'value':_0x474bf0},{'key':_0x7783('0x2f'),'value':_0x7783('0x30')}];var _0x6a23cd=_0x3169ce+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7783('0x15')](_0x1a3ca5,function(_0x12f197){return _0x12f197['key']+'='+_0x12f197[_0x7783('0x31')];})[_0x7783('0x28')]('&');_0xc45502[_0x7783('0x32')]={'issuer':_0x3169ce['replace'](_0x7783('0x33'),''),'audience':_0xc45502['data1'],'state':_0x57a99b,'nonce':_0x474bf0};redis['set'](_0x57a99b,JSON[_0x7783('0x20')](_0xc45502));return _0x6a23cd;}function isValidIdToken(_0x5134a4,_0xc2668e){try{var _0x3193a8=jwt['decode'](_0x5134a4,{'complete':!![]});var _0x3ed03c=_0x3193a8[_0x7783('0x34')];if(_0x3ed03c['iss']!==_0xc2668e['issuer'])return![];if(_0x3ed03c[_0x7783('0x35')]!==_0xc2668e[_0x7783('0x36')])return![];if(_0x3ed03c[_0x7783('0x2e')]!==_0xc2668e['nonce'])return![];if(moment()[_0x7783('0x37')](moment[_0x7783('0x38')](_0x3ed03c[_0x7783('0x39')])))return![];return!![];}catch(_0x2d672d){throw _0x2d672d;}}function refreshOauth2MicrosoftAccessToken(_0x9feabf){return Promise[_0x7783('0x3a')]()[_0x7783('0x3b')](function(){if(_0x9feabf[_0x7783('0x3c')])return _0x9feabf;return db[_0x7783('0x3d')][_0x7783('0x3e')]({'where':{'id':_0x9feabf['id']},'raw':!![]});})[_0x7783('0x3b')](function(_0x56791e){var _0x466309={'grant_type':_0x7783('0x3f'),'refresh_token':_0x56791e[_0x7783('0x40')],'scope':getAccessTokenScope(_0x56791e),'redirect_uri':_0x56791e[_0x7783('0x2a')],'client_id':_0x56791e['data1'],'client_secret':encryptor['decryptString'](_0x56791e[_0x7783('0x3c')])};var _0x1b49c1={'method':_0x7783('0x41'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x56791e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x466309,'json':!![]};return rp(_0x1b49c1);})[_0x7783('0x3b')](function(_0x526931){_0x9feabf[_0x7783('0x42')]=_0x526931[_0x7783('0x43')];_0x9feabf[_0x7783('0x40')]=_0x526931[_0x7783('0x3f')];return db[_0x7783('0x3d')][_0x7783('0x44')]({'data5':_0x9feabf[_0x7783('0x42')],'data6':_0x9feabf[_0x7783('0x40')]},{'where':{'id':_0x9feabf['id']}});})[_0x7783('0x3b')](function(){return _0x9feabf;})[_0x7783('0x45')](function(_0x1fbeb2){logger[_0x7783('0x46')](_0x7783('0x47'),_0x9feabf['id'],_0x1fbeb2);});}function getOauth2MicrosoftAccessToken(_0x134988,_0xc23b77){var _0x486084={'grant_type':_0x7783('0x48'),'code':_0x134988,'scope':getAccessTokenScope(_0xc23b77),'redirect_uri':_0xc23b77[_0x7783('0x2a')],'client_id':_0xc23b77['data1'],'client_secret':encryptor[_0x7783('0x49')](_0xc23b77['data3'])};var _0x4b4743={'method':_0x7783('0x41'),'uri':MICROSOFT_AUTH_URL[_0x7783('0x1b')](_0x7783('0x4a'),_0xc23b77[_0x7783('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x486084,'json':!![]};return rp(_0x4b4743);}function startRefreshInterval(_0x54b4b9){var _0x2a9f39=schedule[_0x7783('0x4b')];if(_0x2a9f39[_0x54b4b9['id']])clearInterval(_0x2a9f39[_0x54b4b9['id']]);_0x2a9f39[_0x54b4b9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7783('0x4c')](this,{'id':_0x54b4b9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2a9f39;}function startAllRefreshIntervals(){return db[_0x7783('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7783('0x3b')](function(_0x1082bb){var _0x2ba5a6=_0x1082bb['map'](function(_0x390e5b){return refreshOauth2MicrosoftAccessToken(_0x390e5b)['then'](function(_0x8c9f5){startRefreshInterval(_0x8c9f5);});});return Promise[_0x7783('0x4d')](_0x2ba5a6);})[_0x7783('0x45')](function(_0x5615bf){var _0x59b954=_0x5615bf?util[_0x7783('0x4e')](_0x5615bf,{'showHidden':![],'depth':null}):'';logger[_0x7783('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x59b954);});}module[_0x7783('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x0879=['offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','type','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','base64','randomBytes','toString','hex','client_id','data1','response_type','data4','response_mode','scope','nonce','prompt','login','map','oauth2/','set','stringify','decode','issuer','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','data6','decryptString','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','util','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','profile','email'];(function(_0x4ba49e,_0x90623f){var _0x539360=function(_0x4fe7c5){while(--_0x4fe7c5){_0x4ba49e['push'](_0x4ba49e['shift']());}};_0x539360(++_0x90623f);}(_0x0879,0x11a));var _0x9087=function(_0x4a4ba0,_0x463721){_0x4a4ba0=_0x4a4ba0-0x0;var _0x45de2d=_0x0879[_0x4a4ba0];return _0x45de2d;};'use strict';var _=require(_0x9087('0x0'));var crypto=require(_0x9087('0x1'));var jwt=require(_0x9087('0x2'));var moment=require('moment');var Redis=require(_0x9087('0x3'));var rp=require('request-promise');var util=require(_0x9087('0x4'));var encryptor=require(_0x9087('0x5'));var config=require(_0x9087('0x6'));var logger=require('../../config/logger')('api');var schedule=require(_0x9087('0x7'));var db=require(_0x9087('0x8'))['db'];config[_0x9087('0x9')]=_[_0x9087('0xa')](config[_0x9087('0x9')],{'host':_0x9087('0xb'),'port':0x18eb});var redis=new Redis(config[_0x9087('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9087('0xc'),_0x9087('0xd'),_0x9087('0xe'),_0x9087('0xf'),_0x9087('0x10'),_0x9087('0x11')],'Dynamics365':[_0x9087('0x12'),_0x9087('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x9087('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x9087('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5cd91d){var _0x492fd7=_['map'](AZURE_AUTH_SCOPES[_0x5cd91d[_0x9087('0x15')]]);if(_0x5cd91d[_0x9087('0x15')]==='Dynamics365')_0x492fd7['push'](_0x5cd91d[_0x9087('0x16')]+_0x9087('0x17'));return _0x492fd7[_0x9087('0x18')]('\x20');}function getAccessTokenScope(_0x1f3e2f){if(_0x1f3e2f[_0x9087('0x15')]===_0x9087('0x19'))return _0x9087('0xf');if(_0x1f3e2f[_0x9087('0x15')]===_0x9087('0x1a'))return _0x1f3e2f[_0x9087('0x16')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x728e57,_0x4a2fff){var _0x47e51c=MICROSOFT_AUTH_URL[_0x9087('0x1b')](_0x9087('0x1c'),_0x728e57[_0x9087('0x1d')]);var _0x1af8d1=[_0x9087('0x1e'),_0x9087('0x1f')];var _0x2eeb1e=Buffer['from'](JSON['stringify']({'id':_0x4a2fff}))['toString'](_0x9087('0x20'));var _0x149df9=crypto[_0x9087('0x21')](0x10)[_0x9087('0x22')](_0x9087('0x23'));var _0x1006e6=getAuthorizationScopes(_0x728e57);var _0x53d510=[{'key':_0x9087('0x24'),'value':_0x728e57[_0x9087('0x25')]},{'key':_0x9087('0x26'),'value':encodeURIComponent(_0x1af8d1[_0x9087('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x728e57[_0x9087('0x27')]},{'key':_0x9087('0x28'),'value':'form_post'},{'key':_0x9087('0x29'),'value':encodeURIComponent(_0x1006e6)},{'key':'state','value':_0x2eeb1e},{'key':_0x9087('0x2a'),'value':_0x149df9},{'key':_0x9087('0x2b'),'value':_0x9087('0x2c')}];var _0x35e2a9=_0x47e51c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9087('0x2d')](_0x53d510,function(_0x4eb77a){return _0x4eb77a['key']+'='+_0x4eb77a['value'];})['join']('&');_0x728e57['oauth2Claims']={'issuer':_0x47e51c[_0x9087('0x1b')](_0x9087('0x2e'),''),'audience':_0x728e57['data1'],'state':_0x2eeb1e,'nonce':_0x149df9};redis[_0x9087('0x2f')](_0x2eeb1e,JSON[_0x9087('0x30')](_0x728e57));return _0x35e2a9;}function isValidIdToken(_0x5b75e8,_0xf02081){try{var _0x478641=jwt[_0x9087('0x31')](_0x5b75e8,{'complete':!![]});var _0x4cbbd6=_0x478641['payload'];if(_0x4cbbd6['iss']!==_0xf02081[_0x9087('0x32')])return![];if(_0x4cbbd6[_0x9087('0x33')]!==_0xf02081[_0x9087('0x34')])return![];if(_0x4cbbd6['nonce']!==_0xf02081[_0x9087('0x2a')])return![];if(moment()[_0x9087('0x35')](moment[_0x9087('0x36')](_0x4cbbd6['exp'])))return![];return!![];}catch(_0x16486f){throw _0x16486f;}}function refreshOauth2MicrosoftAccessToken(_0x41d8ff){return Promise[_0x9087('0x37')]()[_0x9087('0x38')](function(){if(_0x41d8ff[_0x9087('0x39')])return _0x41d8ff;return db[_0x9087('0x3a')]['findOne']({'where':{'id':_0x41d8ff['id']},'raw':!![]});})[_0x9087('0x38')](function(_0x2cdf37){var _0x4825f1={'grant_type':'refresh_token','refresh_token':_0x2cdf37[_0x9087('0x3b')],'scope':getAccessTokenScope(_0x2cdf37),'redirect_uri':_0x2cdf37[_0x9087('0x27')],'client_id':_0x2cdf37[_0x9087('0x25')],'client_secret':encryptor[_0x9087('0x3c')](_0x2cdf37[_0x9087('0x39')])};var _0x5e863d={'method':_0x9087('0x3d'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x2cdf37[_0x9087('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4825f1,'json':!![]};return rp(_0x5e863d);})[_0x9087('0x38')](function(_0x539f3e){_0x41d8ff[_0x9087('0x3e')]=_0x539f3e[_0x9087('0x3f')];_0x41d8ff[_0x9087('0x3b')]=_0x539f3e['refresh_token'];return db[_0x9087('0x3a')][_0x9087('0x40')]({'data5':_0x41d8ff[_0x9087('0x3e')],'data6':_0x41d8ff[_0x9087('0x3b')]},{'where':{'id':_0x41d8ff['id']}});})[_0x9087('0x38')](function(){return _0x41d8ff;})[_0x9087('0x41')](function(_0x55ae7f){logger[_0x9087('0x42')](_0x9087('0x43'),_0x41d8ff['id'],_0x55ae7f);});}function getOauth2MicrosoftAccessToken(_0x248594,_0x1823b3){var _0x1b2e25={'grant_type':_0x9087('0x44'),'code':_0x248594,'scope':getAccessTokenScope(_0x1823b3),'redirect_uri':_0x1823b3[_0x9087('0x27')],'client_id':_0x1823b3[_0x9087('0x25')],'client_secret':encryptor['decryptString'](_0x1823b3[_0x9087('0x39')])};var _0x45d379={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x9087('0x1b')](_0x9087('0x1c'),_0x1823b3['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1b2e25,'json':!![]};return rp(_0x45d379);}function startRefreshInterval(_0x2567df){var _0xf22707=schedule[_0x9087('0x45')];if(_0xf22707[_0x2567df['id']])clearInterval(_0xf22707[_0x2567df['id']]);_0xf22707[_0x2567df['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9087('0x46')](this,{'id':_0x2567df['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9087('0x45')]=_0xf22707;}function startAllRefreshIntervals(){return db[_0x9087('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9087('0x38')](function(_0x3e493a){var _0x174f35=_0x3e493a[_0x9087('0x2d')](function(_0x3c32ea){return refreshOauth2MicrosoftAccessToken(_0x3c32ea)[_0x9087('0x38')](function(_0x55fd78){startRefreshInterval(_0x55fd78);});});return Promise['all'](_0x174f35);})['catch'](function(_0x4b5a2b){var _0xf2eea8=_0x4b5a2b?util[_0x9087('0x47')](_0x4b5a2b,{'showHidden':![],'depth':null}):'';logger[_0x9087('0x42')](_0x9087('0x48'),_0xf2eea8);});}module[_0x9087('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index b022507..a8f73e1 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa693=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1d28ca,_0x29bbc5){var _0x33ed76=function(_0x2511ce){while(--_0x2511ce){_0x1d28ca['push'](_0x1d28ca['shift']());}};_0x33ed76(++_0x29bbc5);}(_0xa693,0xf1));var _0x3a69=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa693[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require(_0x3a69('0x3'));var rs=require(_0x3a69('0x4'));var fs=require('fs');var Redis=require(_0x3a69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x6'));var config=require(_0x3a69('0x7'));var jayson=require(_0x3a69('0x8'));var client=jayson[_0x3a69('0x9')][_0x3a69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125226,_0x290e84,_0x5e7d90){return new BPromise(function(_0x1d564b,_0x2b8e2e){return client['request'](_0x125226,_0x5e7d90)['then'](function(_0x4e65a5){logger[_0x3a69('0xb')]('CloudProvider,\x20%s,\x20%s',_0x290e84,_0x3a69('0xc'));logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x290e84,_0x3a69('0xc'),JSON[_0x3a69('0xf')](_0x4e65a5));if(_0x4e65a5['error']){if(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x11')]===0x1f4){logger['error'](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x2b8e2e(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x1d564b(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}else{logger[_0x3a69('0xb')]('CloudProvider,\x20%s,\x20%s',_0x290e84,'request\x20sent');_0x1d564b(_0x4e65a5[_0x3a69('0x14')][_0x3a69('0x13')]);}})[_0x3a69('0x15')](function(_0x24fb29){logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x24fb29);_0x2b8e2e(_0x24fb29);});});} \ No newline at end of file +var _0xfaf2=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CloudProvider,\x20%s,\x20%s','message','result'];(function(_0x296be2,_0x140479){var _0x30e6f2=function(_0x115b3a){while(--_0x115b3a){_0x296be2['push'](_0x296be2['shift']());}};_0x30e6f2(++_0x140479);}(_0xfaf2,0x169));var _0x2faf=function(_0x14e17b,_0x441262){_0x14e17b=_0x14e17b-0x0;var _0x8c453e=_0xfaf2[_0x14e17b];return _0x8c453e;};'use strict';var _=require(_0x2faf('0x0'));var util=require(_0x2faf('0x1'));var moment=require(_0x2faf('0x2'));var BPromise=require(_0x2faf('0x3'));var rs=require(_0x2faf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2faf('0x5'))['db'];var utils=require(_0x2faf('0x6'));var logger=require(_0x2faf('0x7'))(_0x2faf('0x8'));var config=require(_0x2faf('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32cdb3,_0x43128c,_0x1d3420){return new BPromise(function(_0x1522cb,_0x3f5c12){return client['request'](_0x32cdb3,_0x1d3420)['then'](function(_0x9c958c){logger[_0x2faf('0xa')]('CloudProvider,\x20%s,\x20%s',_0x43128c,'request\x20sent');logger[_0x2faf('0xb')](_0x2faf('0xc'),_0x43128c,_0x2faf('0xd'),JSON['stringify'](_0x9c958c));if(_0x9c958c['error']){if(_0x9c958c[_0x2faf('0xe')][_0x2faf('0xf')]===0x1f4){logger['error'](_0x2faf('0x10'),_0x43128c,_0x9c958c['error'][_0x2faf('0x11')]);return _0x3f5c12(_0x9c958c[_0x2faf('0xe')][_0x2faf('0x11')]);}logger[_0x2faf('0xe')](_0x2faf('0x10'),_0x43128c,_0x9c958c[_0x2faf('0xe')]['message']);return _0x1522cb(_0x9c958c[_0x2faf('0xe')][_0x2faf('0x11')]);}else{logger['info'](_0x2faf('0x10'),_0x43128c,_0x2faf('0xd'));_0x1522cb(_0x9c958c[_0x2faf('0x12')][_0x2faf('0x11')]);}})['catch'](function(_0x3a2f18){logger[_0x2faf('0xe')](_0x2faf('0x10'),_0x43128c,_0x3a2f18);_0x3f5c12(_0x3a2f18);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 6d55d04..085aebc 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x56bd67,_0x63aa28){var _0x20a151=function(_0x56badc){while(--_0x56badc){_0x56bd67['push'](_0x56bd67['shift']());}};_0x20a151(++_0x63aa28);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x90e5da,_0x5ab84d){var _0x3e5a7c=function(_0x5edf38){while(--_0x5edf38){_0x90e5da['push'](_0x90e5da['shift']());}};_0x3e5a7c(++_0x5ab84d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e270cca..f7cc6f1 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 _0x162e=['exports','STRING','name','sequelize'];(function(_0x4d2ed7,_0x1999e5){var _0x12af27=function(_0x28e2d4){while(--_0x28e2d4){_0x4d2ed7['push'](_0x4d2ed7['shift']());}};_0x12af27(++_0x1999e5);}(_0x162e,0x6b));var _0xe162=function(_0x25e33e,_0x4c7bb4){_0x25e33e=_0x25e33e-0x0;var _0x15b216=_0x162e[_0x25e33e];return _0x15b216;};'use strict';var Sequelize=require(_0xe162('0x0'));module[_0xe162('0x1')]={'name':{'type':Sequelize[_0xe162('0x2')],'unique':_0xe162('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe162('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xe162('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe162('0x2')]},'type':{'type':Sequelize[_0xe162('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe162('0x2')]},'city':{'type':Sequelize[_0xe162('0x2')]},'country':{'type':Sequelize[_0xe162('0x2')]},'email':{'type':Sequelize[_0xe162('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe162('0x2')]},'sStreet':{'type':Sequelize[_0xe162('0x2')]},'sPostalCode':{'type':Sequelize[_0xe162('0x2')]},'sCity':{'type':Sequelize[_0xe162('0x2')]},'sCountry':{'type':Sequelize[_0xe162('0x2')]},'description':{'type':Sequelize[_0xe162('0x2')]}}; \ No newline at end of file +var _0xc66a=['exports','STRING','name','sequelize'];(function(_0x2dd00e,_0x45b5a9){var _0x17a697=function(_0x5705e7){while(--_0x5705e7){_0x2dd00e['push'](_0x2dd00e['shift']());}};_0x17a697(++_0x45b5a9);}(_0xc66a,0x197));var _0xac66=function(_0x1a0e24,_0x38105d){_0x1a0e24=_0x1a0e24-0x0;var _0x199714=_0xc66a[_0x1a0e24];return _0x199714;};'use strict';var Sequelize=require(_0xac66('0x0'));module[_0xac66('0x1')]={'name':{'type':Sequelize[_0xac66('0x2')],'unique':_0xac66('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xac66('0x2')]},'companyId':{'type':Sequelize[_0xac66('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xac66('0x2')]},'type':{'type':Sequelize[_0xac66('0x2')]},'street':{'type':Sequelize[_0xac66('0x2')]},'postalCode':{'type':Sequelize[_0xac66('0x2')]},'city':{'type':Sequelize[_0xac66('0x2')]},'country':{'type':Sequelize[_0xac66('0x2')]},'email':{'type':Sequelize[_0xac66('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xac66('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xac66('0x2')]},'sCity':{'type':Sequelize[_0xac66('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac66('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 84efee7..d807388 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 _0x7c1f=['catch','show','params','rawAttributes','fields','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows'];(function(_0x54eb72,_0x3e9cf6){var _0x16adc8=function(_0x250302){while(--_0x250302){_0x54eb72['push'](_0x54eb72['shift']());}};_0x16adc8(++_0x3e9cf6);}(_0x7c1f,0xc5));var _0xf7c1=function(_0x2a7f9f,_0x20f33a){_0x2a7f9f=_0x2a7f9f-0x0;var _0x201d29=_0x7c1f[_0x2a7f9f];return _0x201d29;};'use strict';var emlformat=require(_0xf7c1('0x0'));var rimraf=require(_0xf7c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7c1('0x2'));var rp=require('request-promise');var moment=require(_0xf7c1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf7c1('0x4'));var path=require(_0xf7c1('0x5'));var sox=require(_0xf7c1('0x6'));var csv=require(_0xf7c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf7c1('0x8'));var crypto=require(_0xf7c1('0x9'));var jsforce=require(_0xf7c1('0xa'));var deskjs=require(_0xf7c1('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf7c1('0xc'));var Papa=require('papaparse');var Redis=require(_0xf7c1('0xd'));var authService=require(_0xf7c1('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7c1('0xf'));var logger=require(_0xf7c1('0x10'))(_0xf7c1('0x11'));var utils=require(_0xf7c1('0x12'));var config=require(_0xf7c1('0x13'));var licenseUtil=require(_0xf7c1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b5d51,_0x53eb33){_0x53eb33=_0x53eb33||0xcc;return function(_0x558b22){if(_0x558b22){return _0x5b5d51[_0xf7c1('0x15')](_0x53eb33);}return _0x5b5d51[_0xf7c1('0x16')](_0x53eb33)['end']();};}function respondWithResult(_0x16f360,_0x4c9324){_0x4c9324=_0x4c9324||0xc8;return function(_0x1fee81){if(_0x1fee81){return _0x16f360[_0xf7c1('0x16')](_0x4c9324)[_0xf7c1('0x17')](_0x1fee81);}};}function respondWithFilteredResult(_0xb4c414,_0x1f325e){return function(_0x1ba3fa){if(_0x1ba3fa){var _0x39b56e=typeof _0x1f325e['offset']===_0xf7c1('0x18')&&typeof _0x1f325e[_0xf7c1('0x19')]===_0xf7c1('0x18');var _0x4312e5=_0x1ba3fa[_0xf7c1('0x1a')];var _0x47a530=_0x39b56e?0x0:_0x1f325e[_0xf7c1('0x1b')];var _0x4086c4=_0x39b56e?_0x1ba3fa['count']:_0x1f325e[_0xf7c1('0x1b')]+_0x1f325e['limit'];var _0xdba50e;if(_0x4086c4>=_0x4312e5){_0x4086c4=_0x4312e5;_0xdba50e=0xc8;}else{_0xdba50e=0xce;}_0xb4c414['status'](_0xdba50e);return _0xb4c414[_0xf7c1('0x1c')](_0xf7c1('0x1d'),_0x47a530+'-'+_0x4086c4+'/'+_0x4312e5)[_0xf7c1('0x17')](_0x1ba3fa);}return null;};}function patchUpdates(_0x2693cd){return function(_0x49b1dd){try{jsonpatch[_0xf7c1('0x1e')](_0x49b1dd,_0x2693cd,!![]);}catch(_0x1cc0ce){return BPromise[_0xf7c1('0x1f')](_0x1cc0ce);}return _0x49b1dd[_0xf7c1('0x20')]();};}function saveUpdates(_0x59db9a,_0x186de5){return function(_0x30c9cc){if(_0x30c9cc){return _0x30c9cc['update'](_0x59db9a)[_0xf7c1('0x21')](function(_0x548f54){return _0x548f54;});}return null;};}function removeEntity(_0x104b93,_0x3b2cad){return function(_0x2653d2){if(_0x2653d2){return _0x2653d2[_0xf7c1('0x22')]()[_0xf7c1('0x21')](function(){var _0x843b39=_0x2653d2[_0xf7c1('0x23')]({'plain':!![]});var _0xf7e299=_0xf7c1('0x24');return db[_0xf7c1('0x25')][_0xf7c1('0x22')]({'where':{'type':_0xf7e299,'resourceId':_0x843b39['id']}})[_0xf7c1('0x21')](function(){return _0x2653d2;});})[_0xf7c1('0x21')](function(){_0x104b93[_0xf7c1('0x16')](0xcc)[_0xf7c1('0x26')]();});}};}function handleEntityNotFound(_0x2a411a,_0x4c2cc6){return function(_0x1aa033){if(!_0x1aa033){_0x2a411a[_0xf7c1('0x15')](0x194);}return _0x1aa033;};}function handleError(_0x1ff4bf,_0x172b33){_0x172b33=_0x172b33||0x1f4;return function(_0x500524){logger['error'](_0x500524[_0xf7c1('0x27')]);if(_0x500524[_0xf7c1('0x28')]){delete _0x500524['name'];}_0x1ff4bf[_0xf7c1('0x16')](_0x172b33)[_0xf7c1('0x29')](_0x500524);};}exports[_0xf7c1('0x2a')]=function(_0x55b84e,_0x499b2b){var _0x2fe4b8={},_0x46ddd3={},_0x10af8a={'count':0x0,'rows':[]};return db[_0xf7c1('0x2b')][_0xf7c1('0x2c')]()[_0xf7c1('0x21')](function(_0x38a5bf){_0x46ddd3['model']=_[_0xf7c1('0x2d')](_0x38a5bf);_0x46ddd3[_0xf7c1('0x2e')]=_[_0xf7c1('0x2d')](_0x55b84e[_0xf7c1('0x2e')]);_0x46ddd3[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](_0x46ddd3[_0xf7c1('0x31')],_0x46ddd3[_0xf7c1('0x2e')]);_0x2fe4b8[_0xf7c1('0x32')]=_[_0xf7c1('0x30')](_0x46ddd3[_0xf7c1('0x31')],qs['fields'](_0x55b84e[_0xf7c1('0x2e')]['fields']));_0x2fe4b8[_0xf7c1('0x32')]=_0x2fe4b8['attributes'][_0xf7c1('0x33')]?_0x2fe4b8[_0xf7c1('0x32')]:_0x46ddd3['model'];if(!_0x55b84e['query'][_0xf7c1('0x34')](_0xf7c1('0x35'))){_0x2fe4b8[_0xf7c1('0x19')]=qs['limit'](_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x19')]);_0x2fe4b8['offset']=qs['offset'](_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x1b')]);}_0x2fe4b8[_0xf7c1('0x36')]=qs[_0xf7c1('0x37')](_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x37')]);_0x2fe4b8[_0xf7c1('0x38')]=qs[_0xf7c1('0x2f')](_[_0xf7c1('0x39')](_0x55b84e['query'],_0x46ddd3[_0xf7c1('0x2f')]),_0x38a5bf);if(_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x3a')]){_0x2fe4b8[_0xf7c1('0x38')]=_[_0xf7c1('0x3b')](_0x2fe4b8['where'],{'$or':_[_0xf7c1('0x3c')](_0x2fe4b8['attributes'],function(_0x44eb56){var _0x438354={};_0x438354[_0x44eb56]={'$like':'%'+_0x55b84e[_0xf7c1('0x2e')][_0xf7c1('0x3a')]+'%'};return _0x438354;})});}_0x2fe4b8=_[_0xf7c1('0x3b')]({},_0x2fe4b8,_0x55b84e['options']);var _0x9efd81={'where':_0x2fe4b8['where']};return db[_0xf7c1('0x2b')][_0xf7c1('0x1a')](_0x9efd81)['then'](function(_0x4bbff3){_0x10af8a['count']=_0x4bbff3;if(_0x55b84e['query'][_0xf7c1('0x3d')]){_0x2fe4b8['include']=[{'all':!![]}];}return db[_0xf7c1('0x2b')][_0xf7c1('0x3e')](_0x2fe4b8);})[_0xf7c1('0x21')](function(_0xf44d72){_0x10af8a[_0xf7c1('0x3f')]=_0xf44d72;return _0x10af8a;})[_0xf7c1('0x21')](respondWithFilteredResult(_0x499b2b,_0x2fe4b8))[_0xf7c1('0x40')](handleError(_0x499b2b,null));})['catch'](handleError(_0x499b2b,null));};exports[_0xf7c1('0x41')]=function(_0x54272e,_0x1dcd1e){var _0x170123={'raw':![],'where':{'id':_0x54272e[_0xf7c1('0x42')]['id']}},_0x3001bb={};_0x3001bb[_0xf7c1('0x31')]=_[_0xf7c1('0x2d')](db[_0xf7c1('0x2b')][_0xf7c1('0x43')]);_0x3001bb[_0xf7c1('0x2e')]=_[_0xf7c1('0x2d')](_0x54272e['query']);_0x3001bb[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](_0x3001bb[_0xf7c1('0x31')],_0x3001bb[_0xf7c1('0x2e')]);_0x170123[_0xf7c1('0x32')]=_[_0xf7c1('0x30')](_0x3001bb[_0xf7c1('0x31')],qs[_0xf7c1('0x44')](_0x54272e[_0xf7c1('0x2e')][_0xf7c1('0x44')]));_0x170123[_0xf7c1('0x32')]=_0x170123[_0xf7c1('0x32')][_0xf7c1('0x33')]?_0x170123['attributes']:_0x3001bb[_0xf7c1('0x31')];if(_0x54272e['query']['includeAll']){_0x170123[_0xf7c1('0x45')]=[{'all':!![]}];}_0x170123=_['merge']({},_0x170123,_0x54272e[_0xf7c1('0x46')]);return db[_0xf7c1('0x2b')][_0xf7c1('0x47')](_0x170123)[_0xf7c1('0x21')](handleEntityNotFound(_0x1dcd1e,null))[_0xf7c1('0x21')](respondWithResult(_0x1dcd1e,null))[_0xf7c1('0x40')](handleError(_0x1dcd1e,null));};exports[_0xf7c1('0x48')]=function(_0x432bf9,_0x1ffd97){return db[_0xf7c1('0x2b')][_0xf7c1('0x48')](_0x432bf9[_0xf7c1('0x49')],{})[_0xf7c1('0x21')](function(_0x40fda9){var _0x1a4926=_0x432bf9[_0xf7c1('0x4a')]['get']({'plain':!![]});if(!_0x1a4926)throw new Error(_0xf7c1('0x4b'));if(_0x1a4926['role']===_0xf7c1('0x4a')){var _0x32d253=_0x40fda9[_0xf7c1('0x23')]({'plain':!![]});var _0x27c030=_0xf7c1('0x24');return db[_0xf7c1('0x4c')][_0xf7c1('0x47')]({'where':{'name':_0x27c030,'userProfileId':_0x1a4926[_0xf7c1('0x4d')]},'raw':!![]})[_0xf7c1('0x21')](function(_0x3fd730){if(_0x3fd730&&_0x3fd730[_0xf7c1('0x4e')]===0x0){return db['UserProfileResource'][_0xf7c1('0x48')]({'name':_0x32d253['name'],'resourceId':_0x32d253['id'],'type':_0x3fd730[_0xf7c1('0x28')],'sectionId':_0x3fd730['id']},{})[_0xf7c1('0x21')](function(){return _0x40fda9;});}else{return _0x40fda9;}})[_0xf7c1('0x40')](function(_0x352773){logger[_0xf7c1('0x4f')](_0xf7c1('0x50'),_0x352773);throw _0x352773;});}return _0x40fda9;})[_0xf7c1('0x21')](respondWithResult(_0x1ffd97,0xc9))[_0xf7c1('0x40')](handleError(_0x1ffd97,null));};exports[_0xf7c1('0x51')]=function(_0x2efd64,_0x3ef215){if(_0x2efd64['body']['id']){delete _0x2efd64[_0xf7c1('0x49')]['id'];}return db['CmCompany'][_0xf7c1('0x47')]({'where':{'id':_0x2efd64['params']['id']}})[_0xf7c1('0x21')](handleEntityNotFound(_0x3ef215,null))[_0xf7c1('0x21')](saveUpdates(_0x2efd64[_0xf7c1('0x49')],null))['then'](respondWithResult(_0x3ef215,null))[_0xf7c1('0x40')](handleError(_0x3ef215,null));};exports[_0xf7c1('0x22')]=function(_0x77e9d5,_0x5780ed){return db[_0xf7c1('0x2b')][_0xf7c1('0x47')]({'where':{'id':_0x77e9d5[_0xf7c1('0x42')]['id']}})[_0xf7c1('0x21')](handleEntityNotFound(_0x5780ed,null))[_0xf7c1('0x21')](removeEntity(_0x5780ed,null))[_0xf7c1('0x40')](handleError(_0x5780ed,null));};exports[_0xf7c1('0x2c')]=function(_0x387192,_0x4386af){return db['CmCompany'][_0xf7c1('0x2c')]()[_0xf7c1('0x21')](respondWithResult(_0x4386af,null))[_0xf7c1('0x40')](handleError(_0x4386af,null));};exports['addContacts']=function(_0x27fa54,_0x53551d,_0x252a2d){return db[_0xf7c1('0x52')][_0xf7c1('0x47')]({'where':{'id':_0x27fa54[_0xf7c1('0x42')]['id']}})[_0xf7c1('0x21')](handleEntityNotFound(_0x53551d,null))[_0xf7c1('0x21')](function(_0x3f9d65){if(_0x3f9d65){return _0x3f9d65['addContacts'](_0x27fa54[_0xf7c1('0x49')][_0xf7c1('0x53')],_[_0xf7c1('0x54')](_0x27fa54[_0xf7c1('0x49')],[_0xf7c1('0x53'),'id'])||{});}})['then'](respondWithResult(_0x53551d,null))[_0xf7c1('0x40')](handleError(_0x53551d,null));};exports[_0xf7c1('0x55')]=function(_0x3b3a04,_0x261921,_0x45cc3d){var _0x18055b={};var _0x265a0e={};var _0x2a4f38;var _0x4a4cbc;return db['CmCompany'][_0xf7c1('0x56')]({'where':{'id':_0x3b3a04[_0xf7c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x261921,null))[_0xf7c1('0x21')](function(_0x4ce645){if(_0x4ce645){_0x2a4f38=_0x4ce645;_0x265a0e[_0xf7c1('0x31')]=_[_0xf7c1('0x2d')](db[_0xf7c1('0x52')][_0xf7c1('0x43')]);_0x265a0e[_0xf7c1('0x2e')]=_['keys'](_0x3b3a04[_0xf7c1('0x2e')]);_0x265a0e[_0xf7c1('0x2f')]=_[_0xf7c1('0x30')](_0x265a0e[_0xf7c1('0x31')],_0x265a0e[_0xf7c1('0x2e')]);_0x18055b[_0xf7c1('0x32')]=_['intersection'](_0x265a0e['model'],qs[_0xf7c1('0x44')](_0x3b3a04[_0xf7c1('0x2e')][_0xf7c1('0x44')]));_0x18055b[_0xf7c1('0x32')]=_0x18055b[_0xf7c1('0x32')][_0xf7c1('0x33')]?_0x18055b['attributes']:_0x265a0e[_0xf7c1('0x31')];_0x18055b[_0xf7c1('0x36')]=qs[_0xf7c1('0x37')](_0x3b3a04[_0xf7c1('0x2e')][_0xf7c1('0x37')]);_0x18055b[_0xf7c1('0x38')]=qs[_0xf7c1('0x2f')](_['pick'](_0x3b3a04['query'],_0x265a0e['filters']));if(_0x3b3a04[_0xf7c1('0x2e')]['filter']){_0x18055b[_0xf7c1('0x38')]=_[_0xf7c1('0x3b')](_0x18055b['where'],{'$or':_[_0xf7c1('0x3c')](_0x18055b['attributes'],function(_0x3f6704){var _0x51de5d={};_0x51de5d[_0x3f6704]={'$like':'%'+_0x3b3a04[_0xf7c1('0x2e')]['filter']+'%'};return _0x51de5d;})});}_0x18055b=_[_0xf7c1('0x3b')]({},_0x18055b,_0x3b3a04[_0xf7c1('0x46')]);return _0x2a4f38[_0xf7c1('0x55')](_0x18055b);}})[_0xf7c1('0x21')](function(_0x2ce2c0){if(_0x2ce2c0){_0x4a4cbc=_0x2ce2c0[_0xf7c1('0x33')];if(!_0x3b3a04['query'][_0xf7c1('0x34')](_0xf7c1('0x35'))){_0x18055b['limit']=qs[_0xf7c1('0x19')](_0x3b3a04[_0xf7c1('0x2e')]['limit']);_0x18055b[_0xf7c1('0x1b')]=qs[_0xf7c1('0x1b')](_0x3b3a04[_0xf7c1('0x2e')][_0xf7c1('0x1b')]);}return _0x2a4f38[_0xf7c1('0x55')](_0x18055b);}})[_0xf7c1('0x21')](function(_0x255d32){if(_0x255d32){return _0x255d32?{'count':_0x4a4cbc,'rows':_0x255d32}:null;}})[_0xf7c1('0x21')](respondWithResult(_0x261921,null))[_0xf7c1('0x40')](handleError(_0x261921,null));}; \ No newline at end of file +var _0x2c67=['filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','findOne','map','getContacts','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','Companies','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x33ba78,_0xbcaa2d){var _0x24a8a8=function(_0x2c25f5){while(--_0x2c25f5){_0x33ba78['push'](_0x33ba78['shift']());}};_0x24a8a8(++_0xbcaa2d);}(_0x2c67,0x74));var _0x72c6=function(_0x3c54c7,_0x1e8c5d){_0x3c54c7=_0x3c54c7-0x0;var _0x4c4a3e=_0x2c67[_0x3c54c7];return _0x4c4a3e;};'use strict';var emlformat=require(_0x72c6('0x0'));var rimraf=require(_0x72c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x72c6('0x2'));var moment=require('moment');var BPromise=require(_0x72c6('0x3'));var Mustache=require(_0x72c6('0x4'));var util=require(_0x72c6('0x5'));var path=require('path');var sox=require(_0x72c6('0x6'));var csv=require(_0x72c6('0x7'));var ejs=require(_0x72c6('0x8'));var fs=require('fs');var fs_extra=require(_0x72c6('0x9'));var _=require(_0x72c6('0xa'));var squel=require(_0x72c6('0xb'));var crypto=require(_0x72c6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x72c6('0x7'));var querystring=require('querystring');var Papa=require(_0x72c6('0xd'));var Redis=require(_0x72c6('0xe'));var authService=require(_0x72c6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x72c6('0x10'));var hardwareService=require(_0x72c6('0x11'));var logger=require(_0x72c6('0x12'))(_0x72c6('0x13'));var utils=require(_0x72c6('0x14'));var config=require(_0x72c6('0x15'));var licenseUtil=require(_0x72c6('0x16'));var db=require(_0x72c6('0x17'))['db'];function respondWithStatusCode(_0x1f74b4,_0x521b94){_0x521b94=_0x521b94||0xcc;return function(_0x24fc15){if(_0x24fc15){return _0x1f74b4[_0x72c6('0x18')](_0x521b94);}return _0x1f74b4['status'](_0x521b94)[_0x72c6('0x19')]();};}function respondWithResult(_0x603363,_0x2f9682){_0x2f9682=_0x2f9682||0xc8;return function(_0x265db2){if(_0x265db2){return _0x603363[_0x72c6('0x1a')](_0x2f9682)['json'](_0x265db2);}};}function respondWithFilteredResult(_0x3c4bd1,_0x19b1a2){return function(_0x4d8357){if(_0x4d8357){var _0x2e5da1=typeof _0x19b1a2[_0x72c6('0x1b')]===_0x72c6('0x1c')&&typeof _0x19b1a2[_0x72c6('0x1d')]==='undefined';var _0x58feac=_0x4d8357[_0x72c6('0x1e')];var _0x23913e=_0x2e5da1?0x0:_0x19b1a2[_0x72c6('0x1b')];var _0x5394f0=_0x2e5da1?_0x4d8357[_0x72c6('0x1e')]:_0x19b1a2[_0x72c6('0x1b')]+_0x19b1a2[_0x72c6('0x1d')];var _0x2baa50;if(_0x5394f0>=_0x58feac){_0x5394f0=_0x58feac;_0x2baa50=0xc8;}else{_0x2baa50=0xce;}_0x3c4bd1[_0x72c6('0x1a')](_0x2baa50);return _0x3c4bd1[_0x72c6('0x1f')](_0x72c6('0x20'),_0x23913e+'-'+_0x5394f0+'/'+_0x58feac)[_0x72c6('0x21')](_0x4d8357);}return null;};}function patchUpdates(_0x42674c){return function(_0x58b62a){try{jsonpatch['apply'](_0x58b62a,_0x42674c,!![]);}catch(_0x4af8dc){return BPromise[_0x72c6('0x22')](_0x4af8dc);}return _0x58b62a[_0x72c6('0x23')]();};}function saveUpdates(_0x1f2d45,_0x12ddcc){return function(_0x404fd1){if(_0x404fd1){return _0x404fd1['update'](_0x1f2d45)[_0x72c6('0x24')](function(_0x3cdbdf){return _0x3cdbdf;});}return null;};}function removeEntity(_0x112727,_0x23b29d){return function(_0x32f101){if(_0x32f101){return _0x32f101[_0x72c6('0x25')]()[_0x72c6('0x24')](function(){var _0x5664e9=_0x32f101['get']({'plain':!![]});var _0x445581=_0x72c6('0x26');return db['UserProfileResource'][_0x72c6('0x25')]({'where':{'type':_0x445581,'resourceId':_0x5664e9['id']}})[_0x72c6('0x24')](function(){return _0x32f101;});})[_0x72c6('0x24')](function(){_0x112727[_0x72c6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab791,_0x36dd16){return function(_0x16a954){if(!_0x16a954){_0x5ab791[_0x72c6('0x18')](0x194);}return _0x16a954;};}function handleError(_0x2b836e,_0x5195fd){_0x5195fd=_0x5195fd||0x1f4;return function(_0x427d24){logger['error'](_0x427d24[_0x72c6('0x27')]);if(_0x427d24[_0x72c6('0x28')]){delete _0x427d24[_0x72c6('0x28')];}_0x2b836e['status'](_0x5195fd)[_0x72c6('0x29')](_0x427d24);};}exports[_0x72c6('0x2a')]=function(_0x1ed036,_0x303b3e){var _0x33be08={},_0x3ea603={},_0x5c512d={'count':0x0,'rows':[]};return db[_0x72c6('0x2b')][_0x72c6('0x2c')]()['then'](function(_0x395109){_0x3ea603['model']=_[_0x72c6('0x2d')](_0x395109);_0x3ea603[_0x72c6('0x2e')]=_[_0x72c6('0x2d')](_0x1ed036['query']);_0x3ea603['filters']=_[_0x72c6('0x2f')](_0x3ea603[_0x72c6('0x30')],_0x3ea603[_0x72c6('0x2e')]);_0x33be08[_0x72c6('0x31')]=_[_0x72c6('0x2f')](_0x3ea603[_0x72c6('0x30')],qs[_0x72c6('0x32')](_0x1ed036['query'][_0x72c6('0x32')]));_0x33be08['attributes']=_0x33be08[_0x72c6('0x31')][_0x72c6('0x33')]?_0x33be08[_0x72c6('0x31')]:_0x3ea603[_0x72c6('0x30')];if(!_0x1ed036[_0x72c6('0x2e')][_0x72c6('0x34')](_0x72c6('0x35'))){_0x33be08[_0x72c6('0x1d')]=qs['limit'](_0x1ed036[_0x72c6('0x2e')][_0x72c6('0x1d')]);_0x33be08[_0x72c6('0x1b')]=qs[_0x72c6('0x1b')](_0x1ed036[_0x72c6('0x2e')][_0x72c6('0x1b')]);}_0x33be08[_0x72c6('0x36')]=qs['sort'](_0x1ed036[_0x72c6('0x2e')][_0x72c6('0x37')]);_0x33be08[_0x72c6('0x38')]=qs['filters'](_[_0x72c6('0x39')](_0x1ed036[_0x72c6('0x2e')],_0x3ea603[_0x72c6('0x3a')]),_0x395109);if(_0x1ed036[_0x72c6('0x2e')][_0x72c6('0x3b')]){_0x33be08['where']=_[_0x72c6('0x3c')](_0x33be08[_0x72c6('0x38')],{'$or':_['map'](_0x33be08[_0x72c6('0x31')],function(_0x253bf3){var _0x251d7c={};_0x251d7c[_0x253bf3]={'$like':'%'+_0x1ed036[_0x72c6('0x2e')]['filter']+'%'};return _0x251d7c;})});}_0x33be08=_[_0x72c6('0x3c')]({},_0x33be08,_0x1ed036[_0x72c6('0x3d')]);var _0xc458e1={'where':_0x33be08[_0x72c6('0x38')]};return db[_0x72c6('0x2b')][_0x72c6('0x1e')](_0xc458e1)['then'](function(_0x22f141){_0x5c512d['count']=_0x22f141;if(_0x1ed036[_0x72c6('0x2e')][_0x72c6('0x3e')]){_0x33be08[_0x72c6('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0x72c6('0x40')](_0x33be08);})['then'](function(_0x5354b3){_0x5c512d[_0x72c6('0x41')]=_0x5354b3;return _0x5c512d;})[_0x72c6('0x24')](respondWithFilteredResult(_0x303b3e,_0x33be08))[_0x72c6('0x42')](handleError(_0x303b3e,null));})[_0x72c6('0x42')](handleError(_0x303b3e,null));};exports[_0x72c6('0x43')]=function(_0x484f4d,_0x2ecc4e){var _0x235b5e={'raw':![],'where':{'id':_0x484f4d[_0x72c6('0x44')]['id']}},_0x486e22={};_0x486e22[_0x72c6('0x30')]=_[_0x72c6('0x2d')](db[_0x72c6('0x2b')][_0x72c6('0x45')]);_0x486e22[_0x72c6('0x2e')]=_['keys'](_0x484f4d['query']);_0x486e22[_0x72c6('0x3a')]=_[_0x72c6('0x2f')](_0x486e22['model'],_0x486e22[_0x72c6('0x2e')]);_0x235b5e[_0x72c6('0x31')]=_[_0x72c6('0x2f')](_0x486e22[_0x72c6('0x30')],qs[_0x72c6('0x32')](_0x484f4d[_0x72c6('0x2e')]['fields']));_0x235b5e[_0x72c6('0x31')]=_0x235b5e['attributes'][_0x72c6('0x33')]?_0x235b5e[_0x72c6('0x31')]:_0x486e22['model'];if(_0x484f4d[_0x72c6('0x2e')]['includeAll']){_0x235b5e[_0x72c6('0x3f')]=[{'all':!![]}];}_0x235b5e=_['merge']({},_0x235b5e,_0x484f4d[_0x72c6('0x3d')]);return db[_0x72c6('0x2b')][_0x72c6('0x46')](_0x235b5e)['then'](handleEntityNotFound(_0x2ecc4e,null))['then'](respondWithResult(_0x2ecc4e,null))['catch'](handleError(_0x2ecc4e,null));};exports['create']=function(_0x486450,_0x3cf286){return db[_0x72c6('0x2b')][_0x72c6('0x47')](_0x486450[_0x72c6('0x48')],{})[_0x72c6('0x24')](function(_0x577d62){var _0x33d0a4=_0x486450[_0x72c6('0x49')][_0x72c6('0x4a')]({'plain':!![]});if(!_0x33d0a4)throw new Error(_0x72c6('0x4b'));if(_0x33d0a4[_0x72c6('0x4c')]==='user'){var _0x3336a9=_0x577d62[_0x72c6('0x4a')]({'plain':!![]});var _0xaa16eb=_0x72c6('0x26');return db['UserProfileSection'][_0x72c6('0x46')]({'where':{'name':_0xaa16eb,'userProfileId':_0x33d0a4[_0x72c6('0x4d')]},'raw':!![]})[_0x72c6('0x24')](function(_0x10b476){if(_0x10b476&&_0x10b476['autoAssociation']===0x0){return db[_0x72c6('0x4e')]['create']({'name':_0x3336a9[_0x72c6('0x28')],'resourceId':_0x3336a9['id'],'type':_0x10b476[_0x72c6('0x28')],'sectionId':_0x10b476['id']},{})[_0x72c6('0x24')](function(){return _0x577d62;});}else{return _0x577d62;}})[_0x72c6('0x42')](function(_0x2f0661){logger['error'](_0x72c6('0x4f'),_0x2f0661);throw _0x2f0661;});}return _0x577d62;})['then'](respondWithResult(_0x3cf286,0xc9))['catch'](handleError(_0x3cf286,null));};exports[_0x72c6('0x50')]=function(_0x20e692,_0x5d95fb){if(_0x20e692[_0x72c6('0x48')]['id']){delete _0x20e692[_0x72c6('0x48')]['id'];}return db[_0x72c6('0x2b')][_0x72c6('0x46')]({'where':{'id':_0x20e692[_0x72c6('0x44')]['id']}})[_0x72c6('0x24')](handleEntityNotFound(_0x5d95fb,null))['then'](saveUpdates(_0x20e692[_0x72c6('0x48')],null))[_0x72c6('0x24')](respondWithResult(_0x5d95fb,null))[_0x72c6('0x42')](handleError(_0x5d95fb,null));};exports[_0x72c6('0x25')]=function(_0x407a06,_0xef9716){return db[_0x72c6('0x2b')][_0x72c6('0x46')]({'where':{'id':_0x407a06[_0x72c6('0x44')]['id']}})['then'](handleEntityNotFound(_0xef9716,null))['then'](removeEntity(_0xef9716,null))[_0x72c6('0x42')](handleError(_0xef9716,null));};exports[_0x72c6('0x2c')]=function(_0x13402e,_0x58ec4b){return db[_0x72c6('0x2b')][_0x72c6('0x2c')]()['then'](respondWithResult(_0x58ec4b,null))[_0x72c6('0x42')](handleError(_0x58ec4b,null));};exports[_0x72c6('0x51')]=function(_0x4eb870,_0x1f968a,_0x5cad26){return db[_0x72c6('0x52')][_0x72c6('0x46')]({'where':{'id':_0x4eb870[_0x72c6('0x44')]['id']}})[_0x72c6('0x24')](handleEntityNotFound(_0x1f968a,null))[_0x72c6('0x24')](function(_0x3cea23){if(_0x3cea23){return _0x3cea23[_0x72c6('0x51')](_0x4eb870[_0x72c6('0x48')][_0x72c6('0x53')],_['omit'](_0x4eb870[_0x72c6('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x1f968a,null))['catch'](handleError(_0x1f968a,null));};exports['getContacts']=function(_0x224a6f,_0x201fdd,_0x2cb64e){var _0x3ec3e1={};var _0x1e07a9={};var _0x404c4d;var _0x2f4d32;return db['CmCompany'][_0x72c6('0x54')]({'where':{'id':_0x224a6f[_0x72c6('0x44')]['id']}})[_0x72c6('0x24')](handleEntityNotFound(_0x201fdd,null))['then'](function(_0x8e3cc0){if(_0x8e3cc0){_0x404c4d=_0x8e3cc0;_0x1e07a9[_0x72c6('0x30')]=_[_0x72c6('0x2d')](db['CmContact'][_0x72c6('0x45')]);_0x1e07a9['query']=_[_0x72c6('0x2d')](_0x224a6f[_0x72c6('0x2e')]);_0x1e07a9[_0x72c6('0x3a')]=_[_0x72c6('0x2f')](_0x1e07a9[_0x72c6('0x30')],_0x1e07a9[_0x72c6('0x2e')]);_0x3ec3e1[_0x72c6('0x31')]=_[_0x72c6('0x2f')](_0x1e07a9['model'],qs[_0x72c6('0x32')](_0x224a6f[_0x72c6('0x2e')][_0x72c6('0x32')]));_0x3ec3e1['attributes']=_0x3ec3e1[_0x72c6('0x31')][_0x72c6('0x33')]?_0x3ec3e1[_0x72c6('0x31')]:_0x1e07a9[_0x72c6('0x30')];_0x3ec3e1[_0x72c6('0x36')]=qs['sort'](_0x224a6f[_0x72c6('0x2e')][_0x72c6('0x37')]);_0x3ec3e1['where']=qs['filters'](_[_0x72c6('0x39')](_0x224a6f['query'],_0x1e07a9[_0x72c6('0x3a')]));if(_0x224a6f['query']['filter']){_0x3ec3e1[_0x72c6('0x38')]=_[_0x72c6('0x3c')](_0x3ec3e1[_0x72c6('0x38')],{'$or':_[_0x72c6('0x55')](_0x3ec3e1[_0x72c6('0x31')],function(_0x4889ae){var _0x48d3b3={};_0x48d3b3[_0x4889ae]={'$like':'%'+_0x224a6f[_0x72c6('0x2e')][_0x72c6('0x3b')]+'%'};return _0x48d3b3;})});}_0x3ec3e1=_[_0x72c6('0x3c')]({},_0x3ec3e1,_0x224a6f[_0x72c6('0x3d')]);return _0x404c4d[_0x72c6('0x56')](_0x3ec3e1);}})[_0x72c6('0x24')](function(_0x39bc64){if(_0x39bc64){_0x2f4d32=_0x39bc64['length'];if(!_0x224a6f[_0x72c6('0x2e')][_0x72c6('0x34')](_0x72c6('0x35'))){_0x3ec3e1[_0x72c6('0x1d')]=qs[_0x72c6('0x1d')](_0x224a6f[_0x72c6('0x2e')]['limit']);_0x3ec3e1[_0x72c6('0x1b')]=qs[_0x72c6('0x1b')](_0x224a6f['query']['offset']);}return _0x404c4d[_0x72c6('0x56')](_0x3ec3e1);}})[_0x72c6('0x24')](function(_0x26f69f){if(_0x26f69f){return _0x26f69f?{'count':_0x2f4d32,'rows':_0x26f69f}:null;}})[_0x72c6('0x24')](respondWithResult(_0x201fdd,null))['catch'](handleError(_0x201fdd,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b38ddfa..5914212 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 _0x3d28=['api','path','../../config/environment','exports','CmCompany','cm_companies','util','../../config/logger'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x3d28,0xd6));var _0x83d2=function(_0x5c1918,_0x4fca67){_0x5c1918=_0x5c1918-0x0;var _0x3d28b6=_0x3d28[_0x5c1918];return _0x3d28b6;};'use strict';var _=require('lodash');var util=require(_0x83d2('0x0'));var logger=require(_0x83d2('0x1'))(_0x83d2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x83d2('0x3'));var rimraf=require('rimraf');var config=require(_0x83d2('0x4'));var attributes=require('./cmCompany.attributes');module[_0x83d2('0x5')]=function(_0x51af66,_0x525236){return _0x51af66['define'](_0x83d2('0x6'),attributes,{'tableName':_0x83d2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b20=['moment','bluebird','path','rimraf','exports','define','cm_companies','../../config/logger','api'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7b20,0x115));var _0x07b2=function(_0x1db409,_0x5631cb){_0x1db409=_0x1db409-0x0;var _0x3aa2a8=_0x7b20[_0x1db409];return _0x3aa2a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x07b2('0x0'))(_0x07b2('0x1'));var moment=require(_0x07b2('0x2'));var BPromise=require(_0x07b2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07b2('0x4'));var rimraf=require(_0x07b2('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x07b2('0x6')]=function(_0x200241,_0x42890b){return _0x200241[_0x07b2('0x7')]('CmCompany',attributes,{'tableName':_0x07b2('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 f1f7d14..3f9332c 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 _0x30e1=['rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x30e1,0x19b));var _0x130e=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x30e1[_0x3a78a0];return _0x48e917;};'use strict';var _=require(_0x130e('0x0'));var util=require(_0x130e('0x1'));var moment=require('moment');var BPromise=require(_0x130e('0x2'));var rs=require(_0x130e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x130e('0x4'))['db'];var utils=require(_0x130e('0x5'));var logger=require(_0x130e('0x6'))(_0x130e('0x7'));var config=require(_0x130e('0x8'));var jayson=require(_0x130e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x265e70,_0x51b853,_0x1b7707){return new BPromise(function(_0xf044ff,_0x549dfc){return client[_0x130e('0xa')](_0x265e70,_0x1b7707)[_0x130e('0xb')](function(_0x56a90c){logger[_0x130e('0xc')](_0x130e('0xd'),_0x51b853,'request\x20sent');logger[_0x130e('0xe')](_0x130e('0xf'),_0x51b853,_0x130e('0x10'),JSON[_0x130e('0x11')](_0x56a90c));if(_0x56a90c[_0x130e('0x12')]){if(_0x56a90c[_0x130e('0x12')][_0x130e('0x13')]===0x1f4){logger[_0x130e('0x12')](_0x130e('0xd'),_0x51b853,_0x56a90c[_0x130e('0x12')][_0x130e('0x14')]);return _0x549dfc(_0x56a90c[_0x130e('0x12')][_0x130e('0x14')]);}logger['error'](_0x130e('0xd'),_0x51b853,_0x56a90c['error']['message']);return _0xf044ff(_0x56a90c[_0x130e('0x12')][_0x130e('0x14')]);}else{logger[_0x130e('0xc')](_0x130e('0xd'),_0x51b853,_0x130e('0x10'));_0xf044ff(_0x56a90c['result'][_0x130e('0x14')]);}})[_0x130e('0x15')](function(_0x3d7fa5){logger[_0x130e('0x12')](_0x130e('0xd'),_0x51b853,_0x3d7fa5);_0x549dfc(_0x3d7fa5);});});} \ No newline at end of file +var _0xb2bc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x20f813,_0x1ff454){var _0x1485d4=function(_0x287e2b){while(--_0x287e2b){_0x20f813['push'](_0x20f813['shift']());}};_0x1485d4(++_0x1ff454);}(_0xb2bc,0xa4));var _0xcb2b=function(_0x3fe1ba,_0x1a33c5){_0x3fe1ba=_0x3fe1ba-0x0;var _0x5df1b4=_0xb2bc[_0x3fe1ba];return _0x5df1b4;};'use strict';var _=require(_0xcb2b('0x0'));var util=require('util');var moment=require(_0xcb2b('0x1'));var BPromise=require(_0xcb2b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb2b('0x3'));var db=require(_0xcb2b('0x4'))['db'];var utils=require(_0xcb2b('0x5'));var logger=require(_0xcb2b('0x6'))(_0xcb2b('0x7'));var config=require(_0xcb2b('0x8'));var jayson=require(_0xcb2b('0x9'));var client=jayson[_0xcb2b('0xa')][_0xcb2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e8ac3,_0x1f5467,_0x32f428){return new BPromise(function(_0x3ccea0,_0x348621){return client[_0xcb2b('0xc')](_0x2e8ac3,_0x32f428)[_0xcb2b('0xd')](function(_0x36f118){logger['info'](_0xcb2b('0xe'),_0x1f5467,_0xcb2b('0xf'));logger[_0xcb2b('0x10')](_0xcb2b('0x11'),_0x1f5467,_0xcb2b('0xf'),JSON[_0xcb2b('0x12')](_0x36f118));if(_0x36f118[_0xcb2b('0x13')]){if(_0x36f118[_0xcb2b('0x13')]['code']===0x1f4){logger[_0xcb2b('0x13')]('CmCompany,\x20%s,\x20%s',_0x1f5467,_0x36f118[_0xcb2b('0x13')]['message']);return _0x348621(_0x36f118[_0xcb2b('0x13')]['message']);}logger['error'](_0xcb2b('0xe'),_0x1f5467,_0x36f118[_0xcb2b('0x13')][_0xcb2b('0x14')]);return _0x3ccea0(_0x36f118[_0xcb2b('0x13')]['message']);}else{logger[_0xcb2b('0x15')](_0xcb2b('0xe'),_0x1f5467,_0xcb2b('0xf'));_0x3ccea0(_0x36f118[_0xcb2b('0x16')][_0xcb2b('0x14')]);}})[_0xcb2b('0x17')](function(_0x55f4b5){logger[_0xcb2b('0x13')]('CmCompany,\x20%s,\x20%s',_0x1f5467,_0x55f4b5);_0x348621(_0x55f4b5);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index bbeb516..53dc0a8 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 _0xe254=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0xe254,0xa8));var _0x4e25=function(_0xc7909f,_0x473d1c){_0xc7909f=_0xc7909f-0x0;var _0x540885=_0xe254[_0xc7909f];return _0x540885;};'use strict';var multer=require(_0x4e25('0x0'));var util=require(_0x4e25('0x1'));var path=require(_0x4e25('0x2'));var timeout=require(_0x4e25('0x3'));var express=require('express');var router=express[_0x4e25('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e25('0x5'));var interaction=require(_0x4e25('0x6'));var config=require('../../config/environment');var controller=require(_0x4e25('0x7'));router[_0x4e25('0x8')]('/',auth[_0x4e25('0x9')](),controller[_0x4e25('0xa')]);router['get'](_0x4e25('0xb'),auth['isAuthenticated'](),controller[_0x4e25('0xc')]);router[_0x4e25('0x8')](_0x4e25('0xd'),auth[_0x4e25('0x9')](),controller[_0x4e25('0xe')]);router[_0x4e25('0x8')](_0x4e25('0xf'),auth['isAuthenticated'](),controller[_0x4e25('0x10')]);router[_0x4e25('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4e25('0x11')]('/:id/contacts',auth[_0x4e25('0x9')](),controller[_0x4e25('0x12')]);router[_0x4e25('0x13')](_0x4e25('0xd'),auth[_0x4e25('0x9')](),controller[_0x4e25('0x14')]);router[_0x4e25('0x15')](_0x4e25('0xd'),auth[_0x4e25('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8491=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8491,0xc5));var _0x1849=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x8491[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require(_0x1849('0x0'));var path=require(_0x1849('0x1'));var timeout=require(_0x1849('0x2'));var express=require(_0x1849('0x3'));var router=express[_0x1849('0x4')]();var fs_extra=require(_0x1849('0x5'));var auth=require(_0x1849('0x6'));var interaction=require(_0x1849('0x7'));var config=require(_0x1849('0x8'));var controller=require('./cmCompany.controller');router[_0x1849('0x9')]('/',auth['isAuthenticated'](),controller[_0x1849('0xa')]);router[_0x1849('0x9')](_0x1849('0xb'),auth[_0x1849('0xc')](),controller[_0x1849('0xd')]);router[_0x1849('0x9')](_0x1849('0xe'),auth[_0x1849('0xc')](),controller[_0x1849('0xf')]);router[_0x1849('0x9')](_0x1849('0x10'),auth[_0x1849('0xc')](),controller['getContacts']);router[_0x1849('0x11')]('/',auth[_0x1849('0xc')](),controller[_0x1849('0x12')]);router[_0x1849('0x11')](_0x1849('0x10'),auth['isAuthenticated'](),controller[_0x1849('0x13')]);router[_0x1849('0x14')](_0x1849('0xe'),auth['isAuthenticated'](),controller[_0x1849('0x15')]);router[_0x1849('0x16')](_0x1849('0xe'),auth[_0x1849('0xc')](),controller[_0x1849('0x17')]);module[_0x1849('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 078fe65..3437f58 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 _0xffb8=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x5fa802,_0x10d6b5){var _0x39ebf1=function(_0x1b845f){while(--_0x1b845f){_0x5fa802['push'](_0x5fa802['shift']());}};_0x39ebf1(++_0x10d6b5);}(_0xffb8,0xc9));var _0x8ffb=function(_0x3a8b4b,_0x4167f5){_0x3a8b4b=_0x3a8b4b-0x0;var _0x2e762c=_0xffb8[_0x3a8b4b];return _0x2e762c;};'use strict';var _=require(_0x8ffb('0x0'));var Sequelize=require(_0x8ffb('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8ffb('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8ffb('0x2')]},'street':{'type':Sequelize[_0x8ffb('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8ffb('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8ffb('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x8ffb('0x2')]},'fax':{'type':Sequelize[_0x8ffb('0x2')]},'email':{'type':Sequelize[_0x8ffb('0x2')]},'url':{'type':Sequelize[_0x8ffb('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x8ffb('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8ffb('0x2')]},'teams':{'type':Sequelize[_0x8ffb('0x2')]},'viber':{'type':Sequelize[_0x8ffb('0x2')]},'line':{'type':Sequelize[_0x8ffb('0x2')]},'wechat':{'type':Sequelize[_0x8ffb('0x2')]},'telegram':{'type':Sequelize[_0x8ffb('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8ffb('0x2')]},'priority':{'type':Sequelize[_0x8ffb('0x4')](0x2)[_0x8ffb('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8ffb('0x6')],'defaultValue':Sequelize[_0x8ffb('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8ffb('0x4')]}}; \ No newline at end of file +var _0x9d00=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x5d73df,_0x54afd9){var _0x13b2ce=function(_0x58fcd4){while(--_0x58fcd4){_0x5d73df['push'](_0x5d73df['shift']());}};_0x13b2ce(++_0x54afd9);}(_0x9d00,0xdb));var _0x09d0=function(_0x2aaafb,_0x4aa752){_0x2aaafb=_0x2aaafb-0x0;var _0x5ae6e3=_0x9d00[_0x2aaafb];return _0x5ae6e3;};'use strict';var _=require(_0x09d0('0x0'));var Sequelize=require(_0x09d0('0x1'));module[_0x09d0('0x2')]={'firstName':{'type':Sequelize[_0x09d0('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x09d0('0x3')]},'street':{'type':Sequelize[_0x09d0('0x3')]},'postalCode':{'type':Sequelize[_0x09d0('0x3')]},'city':{'type':Sequelize[_0x09d0('0x3')]},'country':{'type':Sequelize[_0x09d0('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x09d0('0x3')]},'mobile':{'type':Sequelize[_0x09d0('0x3')]},'fax':{'type':Sequelize[_0x09d0('0x3')]},'email':{'type':Sequelize[_0x09d0('0x3')]},'url':{'type':Sequelize[_0x09d0('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x09d0('0x3')]},'twitter':{'type':Sequelize[_0x09d0('0x3')]},'skype':{'type':Sequelize[_0x09d0('0x3')]},'teams':{'type':Sequelize[_0x09d0('0x3')]},'viber':{'type':Sequelize[_0x09d0('0x3')]},'line':{'type':Sequelize[_0x09d0('0x3')]},'wechat':{'type':Sequelize[_0x09d0('0x3')]},'telegram':{'type':Sequelize[_0x09d0('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x09d0('0x3')]},'priority':{'type':Sequelize[_0x09d0('0x4')](0x2)[_0x09d0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x09d0('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x09d0('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index c9836c9..d22b275 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index edf2c0a..bdc44d7 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x782c=['events','../../mysqldb','CmContact','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x229330,_0x1a4694){var _0x4b663d=function(_0x389e20){while(--_0x389e20){_0x229330['push'](_0x229330['shift']());}};_0x4b663d(++_0x1a4694);}(_0x782c,0x6c));var _0xc782=function(_0x23fed8,_0x40f44e){_0x23fed8=_0x23fed8-0x0;var _0x430b09=_0x782c[_0x23fed8];return _0x430b09;};'use strict';var EventEmitter=require(_0xc782('0x0'));var CmContact=require(_0xc782('0x1'))['db'][_0xc782('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc782('0x3'),'afterUpdate':_0xc782('0x4'),'afterDestroy':_0xc782('0x5')};function emitEvent(_0x399918){return function(_0x236391,_0x145e7a,_0x128b89){CmContactEvents[_0xc782('0x6')](_0x399918+':'+_0x236391['id'],_0x236391);CmContactEvents[_0xc782('0x6')](_0x399918,_0x236391);_0x128b89(null);};}for(var e in events){if(events[_0xc782('0x7')](e)){var event=events[e];CmContact[_0xc782('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0xf4a1=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x198866,_0x4435de){var _0x5157c5=function(_0x1ea55a){while(--_0x1ea55a){_0x198866['push'](_0x198866['shift']());}};_0x5157c5(++_0x4435de);}(_0xf4a1,0x139));var _0x1f4a=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xf4a1[_0x5c6994];return _0x1d5c84;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x1f4a('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1f4a('0x1')](0x0);var events={'afterCreate':_0x1f4a('0x2'),'afterUpdate':_0x1f4a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x17d340){return function(_0xa8a00a,_0x1bb276,_0x3d4e08){CmContactEvents['emit'](_0x17d340+':'+_0xa8a00a['id'],_0xa8a00a);CmContactEvents[_0x1f4a('0x4')](_0x17d340,_0xa8a00a);_0x3d4e08(null);};}for(var e in events){if(events[_0x1f4a('0x5')](e)){var event=events[e];CmContact[_0x1f4a('0x6')](e,emitEvent(event));}}module[_0x1f4a('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 261b220..8a9162f 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x803d=['ContactId','CampaignId','push','info','[CmContact][afterDestroy][Error]','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','models','get','error','afterCreate','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','priority','format','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','catch','inspect','Campaign','minutes','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','outbound','CmList','dialCheckDuplicateType','always','onlyIfOpen','findAll','CmHopperBlack','Lists','BlackLists','length','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy'];(function(_0x357301,_0x59dcf6){var _0x3cc84d=function(_0x31257f){while(--_0x31257f){_0x357301['push'](_0x357301['shift']());}};_0x3cc84d(++_0x59dcf6);}(_0x803d,0x121));var _0xd803=function(_0x2ad1d1,_0x43c474){_0x2ad1d1=_0x2ad1d1-0x0;var _0x4cb6ef=_0x803d[_0x2ad1d1];return _0x4cb6ef;};'use strict';var _=require(_0xd803('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd803('0x1'));var moment=require(_0xd803('0x2'));var BPromise=require(_0xd803('0x3'));var rp=require(_0xd803('0x4'));var fs=require('fs');var path=require(_0xd803('0x5'));var rimraf=require(_0xd803('0x6'));var config=require(_0xd803('0x7'));var shared=require(_0xd803('0x8'));var attributes=require('./cmContact.attributes');module[_0xd803('0x9')]=function(_0x26edc5,_0x397391){return _0x26edc5[_0xd803('0xa')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xd803('0xb'),'fields':[_0xd803('0xb')]},{'name':_0xd803('0xc'),'fields':[_0xd803('0xd'),_0xd803('0xe'),'phone','mobile',_0xd803('0xf'),_0xd803('0x10')],'type':_0xd803('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x75ba6f,_0x49d2fc,_0x56a4ce){var _0x3a208c=_0x26edc5[_0xd803('0x12')];var _0x4e95f6=_0x75ba6f[_0xd803('0x13')]({'plain':!![]});function _0x1a0301(){return function(_0x59e5d5){logger[_0xd803('0x14')]('cmContact',_0xd803('0x15'),util['inspect'](_0x59e5d5,{'showHidden':![],'depth':null}));};}function _0x45199c(_0x1f1da4,_0x2ec611){var _0x40dc5d=_0x2ec611[_0xd803('0x16')]?_0x2ec611[_0xd803('0x16')]:moment()['format'](_0xd803('0x17'));return new BPromise(function(_0x4870ef,_0x39c289){if(_[_0xd803('0x18')](_0x2ec611[_0xd803('0x19')])){_0x4870ef({'ret':_0x40dc5d});}else{_0x3a208c[_0xd803('0x1a')][_0xd803('0x1b')]({'where':{'id':_0x1f1da4['id']}})[_0xd803('0x1c')](function(_0x380af4){if(!_[_0xd803('0x18')](_0x380af4)){var _0x37e9ca=_0x380af4['dialTimezone'];if(!_[_0xd803('0x18')](_0x37e9ca)){var _0x54040b=shared[_0xd803('0x1d')];var _0x189b9d=_0x54040b[_0x37e9ca];var _0x368fda=_0x54040b[_0x2ec611[_0xd803('0x19')]];if(!_[_0xd803('0x18')](_0x189b9d)&&!_[_0xd803('0x18')](_0x368fda)){var _0x5a4a2e=_0x189b9d[_0xd803('0x1e')]-_0x368fda['utcOffset'];_0x40dc5d=_0x2ec611[_0xd803('0x16')]?_0x2ec611['scheduledat']:moment();var _0x56a3ed=moment(_0x40dc5d)[_0xd803('0x1f')](_0x5a4a2e,'minutes');_0x4870ef({'ret':_0x56a3ed['format'](_0xd803('0x17'))});}else _0x4870ef({'ret':_0x40dc5d});}else _0x4870ef({'ret':_0x40dc5d});}else{_0x4870ef({'ret':_0x40dc5d});}});}});return 0xa;}var _0x4d8105=function(_0x53f35e){return new BPromise(function(_0x2bde1f,_0x215cce){_0x45199c(_0x53f35e,_0x4e95f6)[_0xd803('0x1c')](function(_0x6c038c){_0x4e95f6[_0xd803('0x16')]=_0x6c038c['ret'];_0x3a208c['CmHopper'][_0xd803('0x1b')]({'where':{'phone':_0x4e95f6['phone'],'VoiceQueueId':_0x53f35e['id']}})['then'](function(_0x58af58){if(!_[_0xd803('0x18')](_0x58af58)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x21')+_0x53f35e['id']);}return _0x3a208c[_0xd803('0x22')]['create']({'phone':_0x4e95f6['phone'],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6['ListId'],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6['priority']:0x2,'scheduledat':_0x4e95f6[_0xd803('0x16')]?_0x4e95f6[_0xd803('0x16')]:moment()[_0xd803('0x24')](_0xd803('0x17')),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6['callbackUniqueid']?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()['format'](_0xd803('0x17')):undefined,'VoiceQueueId':_0x53f35e['id']});})['catch'](function(_0x1548a5){_0x215cce(_0x1548a5);});});});};var _0x2c8e40=function(_0xf370d7){return new BPromise(function(_0x58c032,_0x583333){_0x45199c(_0xf370d7,_0x4e95f6)[_0xd803('0x1c')](function(_0x5907a7){_0x4e95f6[_0xd803('0x16')]=_0x5907a7['ret'];_0x3a208c[_0xd803('0x22')][_0xd803('0x1b')]({'where':{'phone':_0x4e95f6[_0xd803('0xb')],'VoiceQueueId':_0xf370d7['id']}})[_0xd803('0x1c')](function(_0x3fdd74){if(!_['isNil'](_0x3fdd74)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x26')+_0xf370d7['id']);}return _0x3a208c[_0xd803('0x27')]['findOne']({'where':{'calleridnum':_0x4e95f6[_0xd803('0xb')],'VoiceQueueId':_0xf370d7['id']}});})[_0xd803('0x1c')](function(_0x389977){if(!_['isNil'](_0x389977)){throw new Error(_0xd803('0x28')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x29')+_0xf370d7['id']);}return _0x3a208c[_0xd803('0x22')][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6[_0xd803('0x23')]:0x2,'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()[_0xd803('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6['callbackUniqueid']?moment()[_0xd803('0x24')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xf370d7['id']});})[_0xd803('0x2c')](function(_0x54cdb5){_0x583333(_0x54cdb5);});});});};function _0x4b8165(){return function(_0x464a5f){logger[_0xd803('0x14')]('cmContact',_0xd803('0x15'),util[_0xd803('0x2d')](_0x464a5f,{'showHidden':![],'depth':null}));};}function _0x1a135a(_0x53299d,_0x1d2e7d){var _0x1178b7=_0x1d2e7d['scheduledat']?_0x1d2e7d[_0xd803('0x16')]:moment()[_0xd803('0x24')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x20d868,_0x1ba1c4){if(_[_0xd803('0x18')](_0x1d2e7d['dialTimezone'])){_0x20d868({'ret':_0x1178b7});}else{_0x3a208c[_0xd803('0x2e')]['findOne']({'where':{'id':_0x53299d['id']}})[_0xd803('0x1c')](function(_0x29a49c){if(!_[_0xd803('0x18')](_0x29a49c)){var _0x488b0b=_0x29a49c[_0xd803('0x19')];if(!_[_0xd803('0x18')](_0x488b0b)){var _0x38f93a=shared['timezones'];var _0x34bf21=_0x38f93a[_0x488b0b];var _0x5abe0b=_0x38f93a[_0x1d2e7d[_0xd803('0x19')]];if(!_[_0xd803('0x18')](_0x34bf21)&&!_[_0xd803('0x18')](_0x5abe0b)){var _0x2d37be=_0x34bf21[_0xd803('0x1e')]-_0x5abe0b[_0xd803('0x1e')];_0x1178b7=_0x1d2e7d[_0xd803('0x16')]?_0x1d2e7d[_0xd803('0x16')]:moment();var _0x5b21f3=moment(_0x1178b7)[_0xd803('0x1f')](_0x2d37be,_0xd803('0x2f'));_0x20d868({'ret':_0x5b21f3[_0xd803('0x24')](_0xd803('0x17'))});}else _0x20d868({'ret':_0x1178b7});}else _0x20d868({'ret':_0x1178b7});}else{_0x20d868({'ret':_0x1178b7});}});}});return 0xa;}var _0x1065b3=function(_0x5555b7){return new BPromise(function(_0x529c25,_0x4745a6){_0x1a135a(_0x5555b7,_0x4e95f6)[_0xd803('0x1c')](function(_0x2e9ef8){_0x4e95f6['scheduledat']=_0x2e9ef8[_0xd803('0x30')];_0x3a208c[_0xd803('0x22')]['findOne']({'where':{'phone':_0x4e95f6[_0xd803('0xb')],'CampaignId':_0x5555b7['id']}})['then'](function(_0x2b2776){if(!_['isNil'](_0x2b2776)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x31')+_0x5555b7['id']);}return _0x3a208c[_0xd803('0x22')][_0xd803('0x2a')]({'phone':_0x4e95f6['phone'],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6['priority']:0x2,'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()[_0xd803('0x24')](_0xd803('0x17')),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()[_0xd803('0x24')](_0xd803('0x17')):undefined,'CampaignId':_0x5555b7['id']});})['catch'](function(_0x5d4db9){_0x4745a6(_0x5d4db9);});});});};var _0x1dd1f8=function(_0x5d789a){return new BPromise(function(_0xd6ee02,_0x3bca4b){_0x1a135a(_0x5d789a,_0x4e95f6)['then'](function(_0x441d42){_0x4e95f6['scheduledat']=_0x441d42[_0xd803('0x30')];_0x3a208c[_0xd803('0x22')][_0xd803('0x1b')]({'where':{'phone':_0x4e95f6[_0xd803('0xb')],'CampaignId':_0x5d789a['id']}})['then'](function(_0x3fd28e){if(!_[_0xd803('0x18')](_0x3fd28e)){throw new Error(_0xd803('0x20')+_0x4e95f6[_0xd803('0xb')]+_0xd803('0x32')+_0x5d789a['id']);}return _0x3a208c['CmHopperFinal'][_0xd803('0x1b')]({'where':{'calleridnum':_0x4e95f6['phone'],'CampaignId':_0x5d789a['id']}});})[_0xd803('0x1c')](function(_0x50e777){if(!_[_0xd803('0x18')](_0x50e777)){throw new Error(_0xd803('0x28')+_0x4e95f6[_0xd803('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x5d789a['id']);}return _0x3a208c['CmHopper'][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6[_0xd803('0x23')]:0x2,'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()['format'](_0xd803('0x17')),'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6[_0xd803('0x25')]:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()[_0xd803('0x24')](_0xd803('0x17')):undefined,'CampaignId':_0x5d789a['id']});})[_0xd803('0x2c')](function(_0x24ae6a){_0x3bca4b(_0x24ae6a);});});});};if(_0x4e95f6['ListId']){_0x3a208c[_0xd803('0x1a')]['findAll']({'where':{'type':_0xd803('0x33')},'attributes':['id','dialCheckDuplicateType',_0xd803('0x19')],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':'Lists','where':{'id':_0x4e95f6[_0xd803('0x2b')]}}]})[_0xd803('0x1c')](function(_0x35448d){if(_0x35448d){var _0x48d14e=[];for(var _0x51ef6a=0x0,_0x54d47;_0x51ef6a<_0x35448d['length'];_0x51ef6a+=0x1){_0x54d47=_0x35448d[_0x51ef6a][_0xd803('0x13')]({'plain':!![]});switch(_0x54d47[_0xd803('0x35')]){case _0xd803('0x36'):_0x2c8e40(_0x54d47)[_0xd803('0x2c')](_0x1a0301());break;case _0xd803('0x37'):_0x4d8105(_0x54d47)[_0xd803('0x2c')](_0x1a0301());break;default:_0x1a135a(_0x54d47,_0x4e95f6)[_0xd803('0x1c')](function(_0x3fcd74){_0x4e95f6['scheduledat']=_0x3fcd74[_0xd803('0x30')];_0x3a208c[_0xd803('0x22')][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6['ListId'],'scheduledat':_0x4e95f6['scheduledat']?_0x4e95f6['scheduledat']:moment()['format'](_0xd803('0x17')),'priority':_0x4e95f6['priority']?_0x4e95f6['priority']:0x2,'callback':_0x4e95f6[_0xd803('0x25')]?!![]:![],'callbackuniqueid':_0x4e95f6[_0xd803('0x25')]?_0x4e95f6['callbackUniqueid']:undefined,'callbackat':_0x4e95f6[_0xd803('0x25')]?moment()['format'](_0xd803('0x17')):undefined,'VoiceQueueId':_0x54d47['id']})['catch'](_0x1a0301());});}}}})[_0xd803('0x1c')](function(){return _0x3a208c[_0xd803('0x1a')][_0xd803('0x38')]({'where':{'type':_0xd803('0x33')},'attributes':['id'],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':'BlackLists','where':{'id':_0x4e95f6[_0xd803('0x2b')]}}]})[_0xd803('0x1c')](function(_0x9e6d97){if(_0x9e6d97){var _0x29ed8a=[];for(var _0x2ece1f=0x0,_0x11719e;_0x2ece1f<_0x9e6d97['length'];_0x2ece1f+=0x1){_0x11719e=_0x9e6d97[_0x2ece1f][_0xd803('0x13')]({'plain':!![]});_0x3a208c[_0xd803('0x39')]['create']({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'VoiceQueueId':_0x11719e['id']})['catch'](function(_0x120521){logger[_0xd803('0x14')]('cmContact,\x20%s,\x20%s','afterCreate',_0x120521['message']);});}}});})[_0xd803('0x1c')](function(){return _0x3a208c[_0xd803('0x2e')][_0xd803('0x38')]({'attributes':['id',_0xd803('0x35'),_0xd803('0x19')],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':_0xd803('0x3a'),'where':{'id':_0x4e95f6['ListId']}}]})[_0xd803('0x1c')](function(_0xa2563e){if(_0xa2563e){var _0x141b64=[];for(var _0x45b030=0x0,_0x576485;_0x45b030<_0xa2563e['length'];_0x45b030+=0x1){_0x576485=_0xa2563e[_0x45b030][_0xd803('0x13')]({'plain':!![]});switch(_0x576485[_0xd803('0x35')]){case _0xd803('0x36'):_0x1dd1f8(_0x576485)[_0xd803('0x2c')](_0x4b8165());break;case _0xd803('0x37'):_0x1065b3(_0x576485)['catch'](_0x4b8165());break;default:_0x3a208c['CmHopper']['create']({'phone':_0x4e95f6['phone'],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'scheduledat':_0x4e95f6[_0xd803('0x16')]?_0x4e95f6[_0xd803('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4e95f6[_0xd803('0x23')]?_0x4e95f6[_0xd803('0x23')]:0x2,'callback':_0x4e95f6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4e95f6['callbackUniqueid']?_0x4e95f6['callbackUniqueid']:undefined,'callbackat':_0x4e95f6['callbackUniqueid']?moment()['format'](_0xd803('0x17')):undefined,'CampaignId':_0x576485['id']})[_0xd803('0x2c')](_0x4b8165());}}}});})['then'](function(){return _0x3a208c[_0xd803('0x2e')][_0xd803('0x38')]({'attributes':['id'],'include':[{'model':_0x3a208c[_0xd803('0x34')],'as':_0xd803('0x3b'),'where':{'id':_0x4e95f6[_0xd803('0x2b')]}}]})[_0xd803('0x1c')](function(_0x55faa6){if(_0x55faa6){var _0x551d1d=[];for(var _0x1b55d7=0x0,_0x540fa8;_0x1b55d7<_0x55faa6[_0xd803('0x3c')];_0x1b55d7+=0x1){_0x540fa8=_0x55faa6[_0x1b55d7][_0xd803('0x13')]({'plain':!![]});_0x3a208c['CmHopperBlack'][_0xd803('0x2a')]({'phone':_0x4e95f6[_0xd803('0xb')],'ContactId':_0x4e95f6['id'],'ListId':_0x4e95f6[_0xd803('0x2b')],'CampaignId':_0x540fa8['id']})[_0xd803('0x2c')](function(_0x9487c7){logger[_0xd803('0x14')](_0xd803('0x3d'),_0xd803('0x15'),_0x9487c7['message']);});}}});})[_0xd803('0x1c')](function(){_0x56a4ce();})[_0xd803('0x2c')](function(_0x2fd089){logger[_0xd803('0x14')](_0xd803('0x3d'),_0xd803('0x15'),_0x2fd089[_0xd803('0x3e')]);_0x56a4ce(_0x2fd089);});}else{_0x56a4ce(new Error(_0xd803('0x3f')));}},'afterDestroy':function(_0x23eb13,_0x5b3b31,_0x3277a0){var _0x38c191=_0x26edc5[_0xd803('0x12')];var _0x3b4689=_0x23eb13[_0xd803('0x13')]({'plain':!![]});return _0x38c191[_0xd803('0x22')]['findAll']({'raw':!![],'where':{'ListId':_0x3b4689['ListId'],'ContactId':_0x3b4689['id']}})[_0xd803('0x1c')](function(_0x16d790){if(!_[_0xd803('0x40')](_0x16d790)){var _0x5299e1=[];for(var _0xabd05d=0x0;_0xabd05d<_0x16d790[_0xd803('0x3c')];_0xabd05d+=0x1){var _0x3bedb2=_0x38c191[_0xd803('0x22')][_0xd803('0x41')]({'where':{'ListId':_0x16d790[_0xabd05d][_0xd803('0x2b')],'ContactId':_0x16d790[_0xabd05d][_0xd803('0x42')],'VoiceQueueId':_0x16d790[_0xabd05d]['VoiceQueueId'],'CampaignId':_0x16d790[_0xabd05d][_0xd803('0x43')]}});_0x5299e1[_0xd803('0x44')](_0x3bedb2);}return BPromise['all'](_0x5299e1);}})[_0xd803('0x1c')](function(_0x3f76c5){logger[_0xd803('0x45')]('[CmContact][afterDestroy][Succesfull]',util[_0xd803('0x2d')](_0x3f76c5,{'showHidden':![],'depth':null}));_0x3277a0();})[_0xd803('0x2c')](function(_0x413bfa){logger[_0xd803('0x14')](_0xd803('0x46'),util['inspect'](_0x413bfa,{'showHidden':![],'depth':null}));_0x3277a0(_0x413bfa);});}}});}; \ No newline at end of file +var _0x1a34=['dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','error','inspect','Campaign','cmContact,\x20afterCreate\x20','ListId','outbound','length','dialCheckDuplicateType','onlyIfOpen','findAll','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','Lists','always','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x1a34,0x18c));var _0x41a3=function(_0x990052,_0x28b108){_0x990052=_0x990052-0x0;var _0x36f959=_0x1a34[_0x990052];return _0x36f959;};'use strict';var _=require(_0x41a3('0x0'));var util=require(_0x41a3('0x1'));var logger=require(_0x41a3('0x2'))(_0x41a3('0x3'));var moment=require('moment');var BPromise=require(_0x41a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41a3('0x5'));var rimraf=require(_0x41a3('0x6'));var config=require(_0x41a3('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x41a3('0x8'));module[_0x41a3('0x9')]=function(_0x52aa90,_0x5d8954){return _0x52aa90['define'](_0x41a3('0xa'),attributes,{'tableName':_0x41a3('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x41a3('0xc')]},{'name':_0x41a3('0xd'),'fields':[_0x41a3('0xe'),_0x41a3('0xf'),_0x41a3('0xc'),_0x41a3('0x10'),_0x41a3('0x11'),_0x41a3('0x12')],'type':_0x41a3('0x13')}],'timestamps':!![],'charset':_0x41a3('0x14'),'collate':_0x41a3('0x15'),'hooks':{'afterCreate':function(_0x24ba05,_0x85b075,_0x3dc8a7){var _0x492366=_0x52aa90[_0x41a3('0x16')];var _0x1f37f0=_0x24ba05[_0x41a3('0x17')]({'plain':!![]});function _0x2c3164(){return function(_0x5794ec){logger['error'](_0x41a3('0x18'),_0x41a3('0x19'),util['inspect'](_0x5794ec,{'showHidden':![],'depth':null}));};}function _0x43d7eb(_0x237e09,_0x3816f6){var _0x5821e4=_0x3816f6[_0x41a3('0x1a')]?_0x3816f6[_0x41a3('0x1a')]:moment()[_0x41a3('0x1b')](_0x41a3('0x1c'));return new BPromise(function(_0x4c3fe4,_0x47e63a){if(_[_0x41a3('0x1d')](_0x3816f6[_0x41a3('0x1e')])){_0x4c3fe4({'ret':_0x5821e4});}else{_0x492366[_0x41a3('0x1f')][_0x41a3('0x20')]({'where':{'id':_0x237e09['id']}})[_0x41a3('0x21')](function(_0x1ed518){if(!_['isNil'](_0x1ed518)){var _0x2afeec=_0x1ed518['dialTimezone'];if(!_['isNil'](_0x2afeec)){var _0x8bdcd=shared[_0x41a3('0x22')];var _0x34fa81=_0x8bdcd[_0x2afeec];var _0x5d4de1=_0x8bdcd[_0x3816f6[_0x41a3('0x1e')]];if(!_[_0x41a3('0x1d')](_0x34fa81)&&!_[_0x41a3('0x1d')](_0x5d4de1)){var _0x49ecd3=_0x34fa81['utcOffset']-_0x5d4de1[_0x41a3('0x23')];_0x5821e4=_0x3816f6[_0x41a3('0x1a')]?_0x3816f6[_0x41a3('0x1a')]:moment();var _0x17c76d=moment(_0x5821e4)[_0x41a3('0x24')](_0x49ecd3,_0x41a3('0x25'));_0x4c3fe4({'ret':_0x17c76d[_0x41a3('0x1b')](_0x41a3('0x1c'))});}else _0x4c3fe4({'ret':_0x5821e4});}else _0x4c3fe4({'ret':_0x5821e4});}else{_0x4c3fe4({'ret':_0x5821e4});}});}});return 0xa;}var _0x2b111b=function(_0x17ce3d){return new BPromise(function(_0x39977d,_0x2327b5){_0x43d7eb(_0x17ce3d,_0x1f37f0)[_0x41a3('0x21')](function(_0x4ad09e){_0x1f37f0['scheduledat']=_0x4ad09e[_0x41a3('0x26')];_0x492366['CmHopper']['findOne']({'where':{'phone':_0x1f37f0[_0x41a3('0xc')],'VoiceQueueId':_0x17ce3d['id']}})[_0x41a3('0x21')](function(_0x3b9b52){if(!_[_0x41a3('0x1d')](_0x3b9b52)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1f37f0['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x17ce3d['id']);}return _0x492366[_0x41a3('0x27')][_0x41a3('0x28')]({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0['ListId'],'priority':_0x1f37f0[_0x41a3('0x29')]?_0x1f37f0[_0x41a3('0x29')]:0x2,'scheduledat':_0x1f37f0[_0x41a3('0x1a')]?_0x1f37f0[_0x41a3('0x1a')]:moment()[_0x41a3('0x1b')](_0x41a3('0x1c')),'callback':_0x1f37f0[_0x41a3('0x2a')]?!![]:![],'callbackuniqueid':_0x1f37f0[_0x41a3('0x2a')]?_0x1f37f0[_0x41a3('0x2a')]:undefined,'callbackat':_0x1f37f0[_0x41a3('0x2a')]?moment()[_0x41a3('0x1b')](_0x41a3('0x1c')):undefined,'VoiceQueueId':_0x17ce3d['id']});})[_0x41a3('0x2b')](function(_0x28b4c8){_0x2327b5(_0x28b4c8);});});});};var _0x28aad5=function(_0x150ff6){return new BPromise(function(_0x2cfbc6,_0x22fd2a){_0x43d7eb(_0x150ff6,_0x1f37f0)['then'](function(_0x567311){_0x1f37f0['scheduledat']=_0x567311[_0x41a3('0x26')];_0x492366[_0x41a3('0x27')]['findOne']({'where':{'phone':_0x1f37f0[_0x41a3('0xc')],'VoiceQueueId':_0x150ff6['id']}})[_0x41a3('0x21')](function(_0x4c5964){if(!_['isNil'](_0x4c5964)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1f37f0[_0x41a3('0xc')]+_0x41a3('0x2c')+_0x150ff6['id']);}return _0x492366['CmHopperFinal'][_0x41a3('0x20')]({'where':{'calleridnum':_0x1f37f0[_0x41a3('0xc')],'VoiceQueueId':_0x150ff6['id']}});})[_0x41a3('0x21')](function(_0xeb0eeb){if(!_[_0x41a3('0x1d')](_0xeb0eeb)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1f37f0[_0x41a3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x150ff6['id']);}return _0x492366['CmHopper'][_0x41a3('0x28')]({'phone':_0x1f37f0['phone'],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0['ListId'],'priority':_0x1f37f0[_0x41a3('0x29')]?_0x1f37f0[_0x41a3('0x29')]:0x2,'scheduledat':_0x1f37f0['scheduledat']?_0x1f37f0[_0x41a3('0x1a')]:moment()[_0x41a3('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1f37f0[_0x41a3('0x2a')]?!![]:![],'callbackuniqueid':_0x1f37f0['callbackUniqueid']?_0x1f37f0[_0x41a3('0x2a')]:undefined,'callbackat':_0x1f37f0[_0x41a3('0x2a')]?moment()[_0x41a3('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x150ff6['id']});})[_0x41a3('0x2b')](function(_0x1e3e94){_0x22fd2a(_0x1e3e94);});});});};function _0x496339(){return function(_0x5f4166){logger[_0x41a3('0x2d')](_0x41a3('0x18'),_0x41a3('0x19'),util[_0x41a3('0x2e')](_0x5f4166,{'showHidden':![],'depth':null}));};}function _0x22ca69(_0x4468e2,_0x12b91a){var _0x1b8e2=_0x12b91a[_0x41a3('0x1a')]?_0x12b91a[_0x41a3('0x1a')]:moment()[_0x41a3('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x318851,_0xf1f159){if(_['isNil'](_0x12b91a[_0x41a3('0x1e')])){_0x318851({'ret':_0x1b8e2});}else{_0x492366[_0x41a3('0x2f')]['findOne']({'where':{'id':_0x4468e2['id']}})[_0x41a3('0x21')](function(_0x21a06e){if(!_[_0x41a3('0x1d')](_0x21a06e)){var _0x23235c=_0x21a06e[_0x41a3('0x1e')];if(!_['isNil'](_0x23235c)){var _0x2da2ca=shared[_0x41a3('0x22')];var _0x332853=_0x2da2ca[_0x23235c];var _0x2f1f61=_0x2da2ca[_0x12b91a['dialTimezone']];if(!_[_0x41a3('0x1d')](_0x332853)&&!_['isNil'](_0x2f1f61)){var _0x291666=_0x332853[_0x41a3('0x23')]-_0x2f1f61[_0x41a3('0x23')];_0x1b8e2=_0x12b91a[_0x41a3('0x1a')]?_0x12b91a[_0x41a3('0x1a')]:moment();var _0x8969bb=moment(_0x1b8e2)['add'](_0x291666,_0x41a3('0x25'));_0x318851({'ret':_0x8969bb[_0x41a3('0x1b')](_0x41a3('0x1c'))});}else _0x318851({'ret':_0x1b8e2});}else _0x318851({'ret':_0x1b8e2});}else{_0x318851({'ret':_0x1b8e2});}});}});return 0xa;}var _0x592dca=function(_0x54223a){return new BPromise(function(_0x37f187,_0x2f72f5){_0x22ca69(_0x54223a,_0x1f37f0)['then'](function(_0xf287f1){_0x1f37f0[_0x41a3('0x1a')]=_0xf287f1[_0x41a3('0x26')];_0x492366[_0x41a3('0x27')][_0x41a3('0x20')]({'where':{'phone':_0x1f37f0[_0x41a3('0xc')],'CampaignId':_0x54223a['id']}})['then'](function(_0x55a6f2){if(!_['isNil'](_0x55a6f2)){throw new Error(_0x41a3('0x30')+_0x1f37f0['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x54223a['id']);}return _0x492366['CmHopper'][_0x41a3('0x28')]({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0[_0x41a3('0x31')],'priority':_0x1f37f0['priority']?_0x1f37f0['priority']:0x2,'scheduledat':_0x1f37f0['scheduledat']?_0x1f37f0['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1f37f0[_0x41a3('0x2a')]?!![]:![],'callbackuniqueid':_0x1f37f0[_0x41a3('0x2a')]?_0x1f37f0['callbackUniqueid']:undefined,'callbackat':_0x1f37f0['callbackUniqueid']?moment()['format'](_0x41a3('0x1c')):undefined,'CampaignId':_0x54223a['id']});})[_0x41a3('0x2b')](function(_0x3cb65f){_0x2f72f5(_0x3cb65f);});});});};var _0x29a402=function(_0x24be17){return new BPromise(function(_0x42c300,_0x22e4da){_0x22ca69(_0x24be17,_0x1f37f0)[_0x41a3('0x21')](function(_0x2424fd){_0x1f37f0['scheduledat']=_0x2424fd['ret'];_0x492366[_0x41a3('0x27')][_0x41a3('0x20')]({'where':{'phone':_0x1f37f0['phone'],'CampaignId':_0x24be17['id']}})[_0x41a3('0x21')](function(_0x45e065){if(!_[_0x41a3('0x1d')](_0x45e065)){throw new Error(_0x41a3('0x30')+_0x1f37f0[_0x41a3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x24be17['id']);}return _0x492366['CmHopperFinal'][_0x41a3('0x20')]({'where':{'calleridnum':_0x1f37f0[_0x41a3('0xc')],'CampaignId':_0x24be17['id']}});})['then'](function(_0x1fbebf){if(!_[_0x41a3('0x1d')](_0x1fbebf)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1f37f0[_0x41a3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x24be17['id']);}return _0x492366[_0x41a3('0x27')]['create']({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0[_0x41a3('0x31')],'priority':_0x1f37f0['priority']?_0x1f37f0[_0x41a3('0x29')]:0x2,'scheduledat':_0x1f37f0[_0x41a3('0x1a')]?_0x1f37f0['scheduledat']:moment()[_0x41a3('0x1b')](_0x41a3('0x1c')),'callback':_0x1f37f0[_0x41a3('0x2a')]?!![]:![],'callbackuniqueid':_0x1f37f0['callbackUniqueid']?_0x1f37f0[_0x41a3('0x2a')]:undefined,'callbackat':_0x1f37f0[_0x41a3('0x2a')]?moment()[_0x41a3('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x24be17['id']});})['catch'](function(_0x2f7d04){_0x22e4da(_0x2f7d04);});});});};if(_0x1f37f0['ListId']){_0x492366[_0x41a3('0x1f')]['findAll']({'where':{'type':_0x41a3('0x32')},'attributes':['id','dialCheckDuplicateType',_0x41a3('0x1e')],'include':[{'model':_0x492366['CmList'],'as':'Lists','where':{'id':_0x1f37f0[_0x41a3('0x31')]}}]})[_0x41a3('0x21')](function(_0x8a9b3b){if(_0x8a9b3b){var _0x337d8c=[];for(var _0x3f0236=0x0,_0x438fa3;_0x3f0236<_0x8a9b3b[_0x41a3('0x33')];_0x3f0236+=0x1){_0x438fa3=_0x8a9b3b[_0x3f0236]['get']({'plain':!![]});switch(_0x438fa3[_0x41a3('0x34')]){case'always':_0x28aad5(_0x438fa3)[_0x41a3('0x2b')](_0x2c3164());break;case _0x41a3('0x35'):_0x2b111b(_0x438fa3)[_0x41a3('0x2b')](_0x2c3164());break;default:_0x22ca69(_0x438fa3,_0x1f37f0)[_0x41a3('0x21')](function(_0x9d4782){_0x1f37f0[_0x41a3('0x1a')]=_0x9d4782['ret'];_0x492366[_0x41a3('0x27')][_0x41a3('0x28')]({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0[_0x41a3('0x31')],'scheduledat':_0x1f37f0['scheduledat']?_0x1f37f0['scheduledat']:moment()[_0x41a3('0x1b')](_0x41a3('0x1c')),'priority':_0x1f37f0[_0x41a3('0x29')]?_0x1f37f0['priority']:0x2,'callback':_0x1f37f0[_0x41a3('0x2a')]?!![]:![],'callbackuniqueid':_0x1f37f0[_0x41a3('0x2a')]?_0x1f37f0[_0x41a3('0x2a')]:undefined,'callbackat':_0x1f37f0['callbackUniqueid']?moment()[_0x41a3('0x1b')](_0x41a3('0x1c')):undefined,'VoiceQueueId':_0x438fa3['id']})['catch'](_0x2c3164());});}}}})['then'](function(){return _0x492366[_0x41a3('0x1f')][_0x41a3('0x36')]({'where':{'type':_0x41a3('0x32')},'attributes':['id'],'include':[{'model':_0x492366[_0x41a3('0x37')],'as':_0x41a3('0x38'),'where':{'id':_0x1f37f0[_0x41a3('0x31')]}}]})[_0x41a3('0x21')](function(_0x1a0401){if(_0x1a0401){var _0x4f14d8=[];for(var _0x29cb32=0x0,_0x4de654;_0x29cb32<_0x1a0401[_0x41a3('0x33')];_0x29cb32+=0x1){_0x4de654=_0x1a0401[_0x29cb32]['get']({'plain':!![]});_0x492366[_0x41a3('0x39')][_0x41a3('0x28')]({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0[_0x41a3('0x31')],'VoiceQueueId':_0x4de654['id']})[_0x41a3('0x2b')](function(_0x1761b9){logger['error'](_0x41a3('0x3a'),_0x41a3('0x19'),_0x1761b9['message']);});}}});})[_0x41a3('0x21')](function(){return _0x492366[_0x41a3('0x2f')][_0x41a3('0x36')]({'attributes':['id',_0x41a3('0x34'),_0x41a3('0x1e')],'include':[{'model':_0x492366[_0x41a3('0x37')],'as':_0x41a3('0x3b'),'where':{'id':_0x1f37f0[_0x41a3('0x31')]}}]})['then'](function(_0x63f8c8){if(_0x63f8c8){var _0x4db6eb=[];for(var _0x249715=0x0,_0x263046;_0x249715<_0x63f8c8['length'];_0x249715+=0x1){_0x263046=_0x63f8c8[_0x249715][_0x41a3('0x17')]({'plain':!![]});switch(_0x263046['dialCheckDuplicateType']){case _0x41a3('0x3c'):_0x29a402(_0x263046)[_0x41a3('0x2b')](_0x496339());break;case _0x41a3('0x35'):_0x592dca(_0x263046)['catch'](_0x496339());break;default:_0x492366['CmHopper'][_0x41a3('0x28')]({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0[_0x41a3('0x31')],'scheduledat':_0x1f37f0[_0x41a3('0x1a')]?_0x1f37f0['scheduledat']:moment()[_0x41a3('0x1b')](_0x41a3('0x1c')),'priority':_0x1f37f0['priority']?_0x1f37f0[_0x41a3('0x29')]:0x2,'callback':_0x1f37f0['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1f37f0[_0x41a3('0x2a')]?_0x1f37f0['callbackUniqueid']:undefined,'callbackat':_0x1f37f0[_0x41a3('0x2a')]?moment()['format'](_0x41a3('0x1c')):undefined,'CampaignId':_0x263046['id']})[_0x41a3('0x2b')](_0x496339());}}}});})[_0x41a3('0x21')](function(){return _0x492366[_0x41a3('0x2f')][_0x41a3('0x36')]({'attributes':['id'],'include':[{'model':_0x492366[_0x41a3('0x37')],'as':_0x41a3('0x38'),'where':{'id':_0x1f37f0['ListId']}}]})[_0x41a3('0x21')](function(_0x3283a5){if(_0x3283a5){var _0x19eda1=[];for(var _0x456a61=0x0,_0x4987cc;_0x456a61<_0x3283a5['length'];_0x456a61+=0x1){_0x4987cc=_0x3283a5[_0x456a61][_0x41a3('0x17')]({'plain':!![]});_0x492366[_0x41a3('0x39')][_0x41a3('0x28')]({'phone':_0x1f37f0[_0x41a3('0xc')],'ContactId':_0x1f37f0['id'],'ListId':_0x1f37f0[_0x41a3('0x31')],'CampaignId':_0x4987cc['id']})[_0x41a3('0x2b')](function(_0x474051){logger[_0x41a3('0x2d')]('cmContact,\x20%s,\x20%s','afterCreate',_0x474051['message']);});}}});})[_0x41a3('0x21')](function(){_0x3dc8a7();})[_0x41a3('0x2b')](function(_0x26d352){logger[_0x41a3('0x2d')](_0x41a3('0x3a'),'afterCreate',_0x26d352['message']);_0x3dc8a7(_0x26d352);});}else{_0x3dc8a7(new Error(_0x41a3('0x3d')));}},'afterDestroy':function(_0x2a828b,_0x49e2c6,_0x22dbf5){var _0x4a7399=_0x52aa90[_0x41a3('0x16')];var _0x572dad=_0x2a828b[_0x41a3('0x17')]({'plain':!![]});return _0x4a7399[_0x41a3('0x27')][_0x41a3('0x36')]({'raw':!![],'where':{'ListId':_0x572dad[_0x41a3('0x31')],'ContactId':_0x572dad['id']}})[_0x41a3('0x21')](function(_0xe823a8){if(!_[_0x41a3('0x3e')](_0xe823a8)){var _0x24ee74=[];for(var _0x2cf651=0x0;_0x2cf651<_0xe823a8['length'];_0x2cf651+=0x1){var _0x1fa021=_0x4a7399[_0x41a3('0x27')][_0x41a3('0x3f')]({'where':{'ListId':_0xe823a8[_0x2cf651][_0x41a3('0x31')],'ContactId':_0xe823a8[_0x2cf651][_0x41a3('0x40')],'VoiceQueueId':_0xe823a8[_0x2cf651][_0x41a3('0x41')],'CampaignId':_0xe823a8[_0x2cf651][_0x41a3('0x42')]}});_0x24ee74[_0x41a3('0x43')](_0x1fa021);}return BPromise['all'](_0x24ee74);}})[_0x41a3('0x21')](function(_0x1c3d50){logger[_0x41a3('0x44')](_0x41a3('0x45'),util[_0x41a3('0x2e')](_0x1c3d50,{'showHidden':![],'depth':null}));_0x22dbf5();})[_0x41a3('0x2b')](function(_0x20e3f9){logger[_0x41a3('0x2d')](_0x41a3('0x46'),util[_0x41a3('0x2e')](_0x20e3f9,{'showHidden':![],'depth':null}));_0x22dbf5(_0x20e3f9);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index e4b2d53..e491006 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x27f83b,_0x3ec243){var _0x263284=function(_0x37a6ea){while(--_0x37a6ea){_0x27f83b['push'](_0x27f83b['shift']());}};_0x263284(++_0x3ec243);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 788a729..a38cb95 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04b8=['PHONE','exports','STRING','INTEGER'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x04b8,0x159));var _0x804b=function(_0x26972c,_0x5d230a){_0x26972c=_0x26972c-0x0;var _0x28e22f=_0x04b8[_0x26972c];return _0x28e22f;};'use strict';var Sequelize=require('sequelize');module[_0x804b('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x804b('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x804b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x804b('0x3')},'OrderBy':{'type':Sequelize[_0x804b('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xd58c=['PHONE','STRING','sequelize','exports','INTEGER'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd58c,0xb6));var _0xcd58=function(_0x154a47,_0x41dbd4){_0x154a47=_0x154a47-0x0;var _0x3d4f69=_0xd58c[_0x154a47];return _0x3d4f69;};'use strict';var Sequelize=require(_0xcd58('0x0'));module[_0xcd58('0x1')]={'CmContactId':{'type':Sequelize[_0xcd58('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xcd58('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xcd58('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xcd58('0x4')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 13265cf..37f030a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca88=['VIRTUAL','filter','CmContactHasItem','includeAll','include','show','params','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmContactHasItems','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where'];(function(_0x4218d0,_0x18aa4c){var _0x2c142c=function(_0x27a612){while(--_0x27a612){_0x4218d0['push'](_0x4218d0['shift']());}};_0x2c142c(++_0x18aa4c);}(_0xca88,0x160));var _0x8ca8=function(_0x53b945,_0x5b5459){_0x53b945=_0x53b945-0x0;var _0x3d5094=_0xca88[_0x53b945];return _0x3d5094;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ca8('0x0'));var zipdir=require(_0x8ca8('0x1'));var jsonpatch=require(_0x8ca8('0x2'));var rp=require(_0x8ca8('0x3'));var moment=require('moment');var BPromise=require(_0x8ca8('0x4'));var Mustache=require(_0x8ca8('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8ca8('0x6'));var csv=require(_0x8ca8('0x7'));var ejs=require(_0x8ca8('0x8'));var fs=require('fs');var fs_extra=require(_0x8ca8('0x9'));var _=require(_0x8ca8('0xa'));var squel=require(_0x8ca8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8ca8('0xc'));var toCsv=require(_0x8ca8('0x7'));var querystring=require('querystring');var Papa=require(_0x8ca8('0xd'));var Redis=require(_0x8ca8('0xe'));var authService=require(_0x8ca8('0xf'));var qs=require(_0x8ca8('0x10'));var as=require(_0x8ca8('0x11'));var hardwareService=require(_0x8ca8('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8ca8('0x13'));var licenseUtil=require(_0x8ca8('0x14'));var db=require(_0x8ca8('0x15'))['db'];function respondWithStatusCode(_0x5bb67e,_0x276081){_0x276081=_0x276081||0xcc;return function(_0x26cc17){if(_0x26cc17){return _0x5bb67e[_0x8ca8('0x16')](_0x276081);}return _0x5bb67e[_0x8ca8('0x17')](_0x276081)[_0x8ca8('0x18')]();};}function respondWithResult(_0x32e12e,_0x4d0d2d){_0x4d0d2d=_0x4d0d2d||0xc8;return function(_0x327e37){if(_0x327e37){return _0x32e12e[_0x8ca8('0x17')](_0x4d0d2d)[_0x8ca8('0x19')](_0x327e37);}};}function respondWithFilteredResult(_0x239632,_0x2ed5ce){return function(_0x28c1dc){if(_0x28c1dc){var _0xf37d55=typeof _0x2ed5ce[_0x8ca8('0x1a')]===_0x8ca8('0x1b')&&typeof _0x2ed5ce[_0x8ca8('0x1c')]===_0x8ca8('0x1b');var _0x5537b1=_0x28c1dc[_0x8ca8('0x1d')];var _0x31e3cc=_0xf37d55?0x0:_0x2ed5ce['offset'];var _0x4ee3c1=_0xf37d55?_0x28c1dc['count']:_0x2ed5ce[_0x8ca8('0x1a')]+_0x2ed5ce[_0x8ca8('0x1c')];var _0x235bf4;if(_0x4ee3c1>=_0x5537b1){_0x4ee3c1=_0x5537b1;_0x235bf4=0xc8;}else{_0x235bf4=0xce;}_0x239632[_0x8ca8('0x17')](_0x235bf4);return _0x239632[_0x8ca8('0x1e')](_0x8ca8('0x1f'),_0x31e3cc+'-'+_0x4ee3c1+'/'+_0x5537b1)[_0x8ca8('0x19')](_0x28c1dc);}return null;};}function patchUpdates(_0x2a259b){return function(_0x195ffd){try{jsonpatch[_0x8ca8('0x20')](_0x195ffd,_0x2a259b,!![]);}catch(_0x5f2083){return BPromise[_0x8ca8('0x21')](_0x5f2083);}return _0x195ffd[_0x8ca8('0x22')]();};}function saveUpdates(_0x4195f2,_0x4ef9e1){return function(_0x1893cb){if(_0x1893cb){return _0x1893cb[_0x8ca8('0x23')](_0x4195f2)[_0x8ca8('0x24')](function(_0x39c9ea){return _0x39c9ea;});}return null;};}function removeEntity(_0x35c7cc,_0x1ca240){return function(_0x5cd2dd){if(_0x5cd2dd){return _0x5cd2dd[_0x8ca8('0x25')]()[_0x8ca8('0x24')](function(){var _0x53811a=_0x5cd2dd[_0x8ca8('0x26')]({'plain':!![]});var _0x2d5c99=_0x8ca8('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x2d5c99,'resourceId':_0x53811a['id']}})[_0x8ca8('0x24')](function(){return _0x5cd2dd;});})[_0x8ca8('0x24')](function(){_0x35c7cc['status'](0xcc)[_0x8ca8('0x18')]();});}};}function handleEntityNotFound(_0x4e11ee,_0x578446){return function(_0x2fd2ea){if(!_0x2fd2ea){_0x4e11ee[_0x8ca8('0x16')](0x194);}return _0x2fd2ea;};}function handleError(_0x257527,_0x3d7f13){_0x3d7f13=_0x3d7f13||0x1f4;return function(_0x565c6b){logger[_0x8ca8('0x28')](_0x565c6b[_0x8ca8('0x29')]);if(_0x565c6b[_0x8ca8('0x2a')]){delete _0x565c6b[_0x8ca8('0x2a')];}_0x257527[_0x8ca8('0x17')](_0x3d7f13)[_0x8ca8('0x2b')](_0x565c6b);};}exports[_0x8ca8('0x2c')]=function(_0x1e433c,_0x1ce88d){var _0x4554d8={},_0x4d13dd={},_0x47959a={'count':0x0,'rows':[]};var _0x34bd42=_['map'](db['CmContactHasItem'][_0x8ca8('0x2d')],function(_0xdb7901){return{'name':_0xdb7901['fieldName'],'type':_0xdb7901[_0x8ca8('0x2e')][_0x8ca8('0x2f')]};});_0x4d13dd[_0x8ca8('0x30')]=_[_0x8ca8('0x31')](_0x34bd42,_0x8ca8('0x2a'));_0x4d13dd[_0x8ca8('0x32')]=_[_0x8ca8('0x33')](_0x1e433c['query']);_0x4d13dd[_0x8ca8('0x34')]=_[_0x8ca8('0x35')](_0x4d13dd[_0x8ca8('0x30')],_0x4d13dd['query']);_0x4554d8['attributes']=_['intersection'](_0x4d13dd[_0x8ca8('0x30')],qs[_0x8ca8('0x36')](_0x1e433c[_0x8ca8('0x32')]['fields']));_0x4554d8[_0x8ca8('0x37')]=_0x4554d8['attributes'][_0x8ca8('0x38')]?_0x4554d8[_0x8ca8('0x37')]:_0x4d13dd[_0x8ca8('0x30')];if(!_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x39')](_0x8ca8('0x3a'))){_0x4554d8['limit']=qs[_0x8ca8('0x1c')](_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x1c')]);_0x4554d8[_0x8ca8('0x1a')]=qs[_0x8ca8('0x1a')](_0x1e433c[_0x8ca8('0x32')]['offset']);}_0x4554d8[_0x8ca8('0x3b')]=qs['sort'](_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x3c')]);_0x4554d8['where']=qs[_0x8ca8('0x34')](_[_0x8ca8('0x3d')](_0x1e433c[_0x8ca8('0x32')],_0x4d13dd['filters']),_0x34bd42);if(_0x1e433c['query']['filter']){_0x4554d8[_0x8ca8('0x3e')]=_['merge'](_0x4554d8[_0x8ca8('0x3e')],{'$or':_[_0x8ca8('0x31')](_0x34bd42,function(_0x1bce87){if(_0x1bce87[_0x8ca8('0x2e')]!==_0x8ca8('0x3f')){var _0x53e8f6={};_0x53e8f6[_0x1bce87[_0x8ca8('0x2a')]]={'$like':'%'+_0x1e433c['query'][_0x8ca8('0x40')]+'%'};return _0x53e8f6;}})});}_0x4554d8=_['merge']({},_0x4554d8,_0x1e433c['options']);var _0x5745f0={'where':_0x4554d8[_0x8ca8('0x3e')]};return db[_0x8ca8('0x41')][_0x8ca8('0x1d')](_0x5745f0)[_0x8ca8('0x24')](function(_0x44c978){_0x47959a['count']=_0x44c978;if(_0x1e433c[_0x8ca8('0x32')][_0x8ca8('0x42')]){_0x4554d8[_0x8ca8('0x43')]=[{'all':!![]}];}return db[_0x8ca8('0x41')]['findAll'](_0x4554d8);})[_0x8ca8('0x24')](function(_0x298e32){_0x47959a['rows']=_0x298e32;return _0x47959a;})[_0x8ca8('0x24')](respondWithFilteredResult(_0x1ce88d,_0x4554d8))['catch'](handleError(_0x1ce88d,null));};exports[_0x8ca8('0x44')]=function(_0x577a7a,_0x483452){var _0xb289bf={'raw':!![],'where':{'id':_0x577a7a[_0x8ca8('0x45')]['id']}},_0x47aae3={};_0x47aae3[_0x8ca8('0x30')]=_[_0x8ca8('0x33')](db['CmContactHasItem'][_0x8ca8('0x2d')]);_0x47aae3['query']=_[_0x8ca8('0x33')](_0x577a7a[_0x8ca8('0x32')]);_0x47aae3['filters']=_[_0x8ca8('0x35')](_0x47aae3[_0x8ca8('0x30')],_0x47aae3['query']);_0xb289bf[_0x8ca8('0x37')]=_[_0x8ca8('0x35')](_0x47aae3[_0x8ca8('0x30')],qs[_0x8ca8('0x36')](_0x577a7a['query'][_0x8ca8('0x36')]));_0xb289bf[_0x8ca8('0x37')]=_0xb289bf[_0x8ca8('0x37')][_0x8ca8('0x38')]?_0xb289bf[_0x8ca8('0x37')]:_0x47aae3[_0x8ca8('0x30')];if(_0x577a7a[_0x8ca8('0x32')][_0x8ca8('0x42')]){_0xb289bf[_0x8ca8('0x43')]=[{'all':!![]}];}_0xb289bf=_[_0x8ca8('0x46')]({},_0xb289bf,_0x577a7a[_0x8ca8('0x47')]);return db[_0x8ca8('0x41')][_0x8ca8('0x48')](_0xb289bf)['then'](handleEntityNotFound(_0x483452,null))[_0x8ca8('0x24')](respondWithResult(_0x483452,null))['catch'](handleError(_0x483452,null));};exports['create']=function(_0xe248a1,_0x231abf){return db[_0x8ca8('0x41')][_0x8ca8('0x49')](_0xe248a1['body'],{})['then'](function(_0x525ba6){var _0x5c8ade=_0xe248a1['user'][_0x8ca8('0x26')]({'plain':!![]});if(!_0x5c8ade)throw new Error(_0x8ca8('0x4a'));if(_0x5c8ade[_0x8ca8('0x4b')]===_0x8ca8('0x4c')){var _0x34f589=_0x525ba6[_0x8ca8('0x26')]({'plain':!![]});var _0x26d64e=_0x8ca8('0x27');return db[_0x8ca8('0x4d')][_0x8ca8('0x48')]({'where':{'name':_0x26d64e,'userProfileId':_0x5c8ade['userProfileId']},'raw':!![]})[_0x8ca8('0x24')](function(_0x2871d4){if(_0x2871d4&&_0x2871d4[_0x8ca8('0x4e')]===0x0){return db[_0x8ca8('0x4f')]['create']({'name':_0x34f589[_0x8ca8('0x2a')],'resourceId':_0x34f589['id'],'type':_0x2871d4[_0x8ca8('0x2a')],'sectionId':_0x2871d4['id']},{})[_0x8ca8('0x24')](function(){return _0x525ba6;});}else{return _0x525ba6;}})[_0x8ca8('0x50')](function(_0x493fc9){logger[_0x8ca8('0x28')](_0x8ca8('0x51'),_0x493fc9);throw _0x493fc9;});}return _0x525ba6;})['then'](respondWithResult(_0x231abf,0xc9))[_0x8ca8('0x50')](handleError(_0x231abf,null));};exports[_0x8ca8('0x23')]=function(_0x3c8504,_0x5c891b){if(_0x3c8504[_0x8ca8('0x52')]['id']){delete _0x3c8504[_0x8ca8('0x52')]['id'];}return db[_0x8ca8('0x41')][_0x8ca8('0x48')]({'where':{'id':_0x3c8504[_0x8ca8('0x45')]['id']}})[_0x8ca8('0x24')](handleEntityNotFound(_0x5c891b,null))[_0x8ca8('0x24')](saveUpdates(_0x3c8504['body'],null))[_0x8ca8('0x24')](respondWithResult(_0x5c891b,null))[_0x8ca8('0x50')](handleError(_0x5c891b,null));};exports[_0x8ca8('0x25')]=function(_0x7d8e2b,_0x21efcb){return db['CmContactHasItem'][_0x8ca8('0x48')]({'where':{'id':_0x7d8e2b[_0x8ca8('0x45')]['id']}})[_0x8ca8('0x24')](handleEntityNotFound(_0x21efcb,null))[_0x8ca8('0x24')](removeEntity(_0x21efcb,null))[_0x8ca8('0x50')](handleError(_0x21efcb,null));}; \ No newline at end of file +var _0x443f=['hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length'];(function(_0x4656b1,_0x2f4b11){var _0x4fe928=function(_0x1132a0){while(--_0x1132a0){_0x4656b1['push'](_0x4656b1['shift']());}};_0x4fe928(++_0x2f4b11);}(_0x443f,0x72));var _0xf443=function(_0x4400ff,_0x200973){_0x4400ff=_0x4400ff-0x0;var _0x2e3d86=_0x443f[_0x4400ff];return _0x2e3d86;};'use strict';var emlformat=require(_0xf443('0x0'));var rimraf=require(_0xf443('0x1'));var zipdir=require(_0xf443('0x2'));var jsonpatch=require(_0xf443('0x3'));var rp=require(_0xf443('0x4'));var moment=require(_0xf443('0x5'));var BPromise=require(_0xf443('0x6'));var Mustache=require(_0xf443('0x7'));var util=require(_0xf443('0x8'));var path=require(_0xf443('0x9'));var sox=require(_0xf443('0xa'));var csv=require(_0xf443('0xb'));var ejs=require(_0xf443('0xc'));var fs=require('fs');var fs_extra=require(_0xf443('0xd'));var _=require('lodash');var squel=require(_0xf443('0xe'));var crypto=require(_0xf443('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf443('0x10'));var toCsv=require(_0xf443('0xb'));var querystring=require(_0xf443('0x11'));var Papa=require(_0xf443('0x12'));var Redis=require(_0xf443('0x13'));var authService=require(_0xf443('0x14'));var qs=require(_0xf443('0x15'));var as=require(_0xf443('0x16'));var hardwareService=require(_0xf443('0x17'));var logger=require(_0xf443('0x18'))(_0xf443('0x19'));var utils=require(_0xf443('0x1a'));var config=require(_0xf443('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xf443('0x1c'))['db'];function respondWithStatusCode(_0x28ff99,_0x415d27){_0x415d27=_0x415d27||0xcc;return function(_0x43c903){if(_0x43c903){return _0x28ff99['sendStatus'](_0x415d27);}return _0x28ff99[_0xf443('0x1d')](_0x415d27)[_0xf443('0x1e')]();};}function respondWithResult(_0x59da06,_0x90d716){_0x90d716=_0x90d716||0xc8;return function(_0x8550a3){if(_0x8550a3){return _0x59da06[_0xf443('0x1d')](_0x90d716)[_0xf443('0x1f')](_0x8550a3);}};}function respondWithFilteredResult(_0x49b6c0,_0x50c600){return function(_0x329c1c){if(_0x329c1c){var _0x5f4409=typeof _0x50c600[_0xf443('0x20')]==='undefined'&&typeof _0x50c600[_0xf443('0x21')]===_0xf443('0x22');var _0x3d1ce3=_0x329c1c[_0xf443('0x23')];var _0x58a8ef=_0x5f4409?0x0:_0x50c600[_0xf443('0x20')];var _0x3fa367=_0x5f4409?_0x329c1c['count']:_0x50c600['offset']+_0x50c600[_0xf443('0x21')];var _0x2f95c9;if(_0x3fa367>=_0x3d1ce3){_0x3fa367=_0x3d1ce3;_0x2f95c9=0xc8;}else{_0x2f95c9=0xce;}_0x49b6c0[_0xf443('0x1d')](_0x2f95c9);return _0x49b6c0[_0xf443('0x24')](_0xf443('0x25'),_0x58a8ef+'-'+_0x3fa367+'/'+_0x3d1ce3)[_0xf443('0x1f')](_0x329c1c);}return null;};}function patchUpdates(_0x47f687){return function(_0x1a8b4a){try{jsonpatch[_0xf443('0x26')](_0x1a8b4a,_0x47f687,!![]);}catch(_0x464a73){return BPromise[_0xf443('0x27')](_0x464a73);}return _0x1a8b4a['save']();};}function saveUpdates(_0x6de176,_0x41ebb6){return function(_0xff69a4){if(_0xff69a4){return _0xff69a4[_0xf443('0x28')](_0x6de176)[_0xf443('0x29')](function(_0x984916){return _0x984916;});}return null;};}function removeEntity(_0x439eee,_0x35a2a0){return function(_0x7814f0){if(_0x7814f0){return _0x7814f0[_0xf443('0x2a')]()[_0xf443('0x29')](function(){var _0x36d226=_0x7814f0[_0xf443('0x2b')]({'plain':!![]});var _0x3bde80=_0xf443('0x2c');return db[_0xf443('0x2d')][_0xf443('0x2a')]({'where':{'type':_0x3bde80,'resourceId':_0x36d226['id']}})['then'](function(){return _0x7814f0;});})[_0xf443('0x29')](function(){_0x439eee[_0xf443('0x1d')](0xcc)[_0xf443('0x1e')]();});}};}function handleEntityNotFound(_0x5c2b7d,_0x302f35){return function(_0x31390c){if(!_0x31390c){_0x5c2b7d['sendStatus'](0x194);}return _0x31390c;};}function handleError(_0x3a73ec,_0x14bd39){_0x14bd39=_0x14bd39||0x1f4;return function(_0x148afd){logger[_0xf443('0x2e')](_0x148afd[_0xf443('0x2f')]);if(_0x148afd['name']){delete _0x148afd[_0xf443('0x30')];}_0x3a73ec[_0xf443('0x1d')](_0x14bd39)[_0xf443('0x31')](_0x148afd);};}exports[_0xf443('0x32')]=function(_0x107a5,_0x42646e){var _0x3236d0={},_0x563ba6={},_0x5c6ed6={'count':0x0,'rows':[]};var _0x4aa3f5=_['map'](db[_0xf443('0x33')][_0xf443('0x34')],function(_0x4c3f01){return{'name':_0x4c3f01[_0xf443('0x35')],'type':_0x4c3f01[_0xf443('0x36')]['key']};});_0x563ba6[_0xf443('0x37')]=_['map'](_0x4aa3f5,'name');_0x563ba6[_0xf443('0x38')]=_[_0xf443('0x39')](_0x107a5['query']);_0x563ba6['filters']=_[_0xf443('0x3a')](_0x563ba6['model'],_0x563ba6[_0xf443('0x38')]);_0x3236d0['attributes']=_[_0xf443('0x3a')](_0x563ba6['model'],qs[_0xf443('0x3b')](_0x107a5['query'][_0xf443('0x3b')]));_0x3236d0[_0xf443('0x3c')]=_0x3236d0[_0xf443('0x3c')][_0xf443('0x3d')]?_0x3236d0[_0xf443('0x3c')]:_0x563ba6[_0xf443('0x37')];if(!_0x107a5['query'][_0xf443('0x3e')](_0xf443('0x3f'))){_0x3236d0['limit']=qs['limit'](_0x107a5[_0xf443('0x38')][_0xf443('0x21')]);_0x3236d0[_0xf443('0x20')]=qs[_0xf443('0x20')](_0x107a5['query'][_0xf443('0x20')]);}_0x3236d0[_0xf443('0x40')]=qs[_0xf443('0x41')](_0x107a5[_0xf443('0x38')][_0xf443('0x41')]);_0x3236d0['where']=qs[_0xf443('0x42')](_[_0xf443('0x43')](_0x107a5[_0xf443('0x38')],_0x563ba6[_0xf443('0x42')]),_0x4aa3f5);if(_0x107a5[_0xf443('0x38')][_0xf443('0x44')]){_0x3236d0[_0xf443('0x45')]=_[_0xf443('0x46')](_0x3236d0['where'],{'$or':_[_0xf443('0x47')](_0x4aa3f5,function(_0x1f81ae){if(_0x1f81ae[_0xf443('0x36')]!==_0xf443('0x48')){var _0x31982d={};_0x31982d[_0x1f81ae['name']]={'$like':'%'+_0x107a5[_0xf443('0x38')]['filter']+'%'};return _0x31982d;}})});}_0x3236d0=_[_0xf443('0x46')]({},_0x3236d0,_0x107a5[_0xf443('0x49')]);var _0x224c61={'where':_0x3236d0[_0xf443('0x45')]};return db[_0xf443('0x33')][_0xf443('0x23')](_0x224c61)['then'](function(_0x14dcf7){_0x5c6ed6[_0xf443('0x23')]=_0x14dcf7;if(_0x107a5[_0xf443('0x38')][_0xf443('0x4a')]){_0x3236d0[_0xf443('0x4b')]=[{'all':!![]}];}return db[_0xf443('0x33')][_0xf443('0x4c')](_0x3236d0);})['then'](function(_0x5ea693){_0x5c6ed6[_0xf443('0x4d')]=_0x5ea693;return _0x5c6ed6;})[_0xf443('0x29')](respondWithFilteredResult(_0x42646e,_0x3236d0))['catch'](handleError(_0x42646e,null));};exports[_0xf443('0x4e')]=function(_0x335c0a,_0x4fc324){var _0x2448b5={'raw':!![],'where':{'id':_0x335c0a[_0xf443('0x4f')]['id']}},_0xcb10ae={};_0xcb10ae[_0xf443('0x37')]=_[_0xf443('0x39')](db[_0xf443('0x33')][_0xf443('0x34')]);_0xcb10ae[_0xf443('0x38')]=_[_0xf443('0x39')](_0x335c0a[_0xf443('0x38')]);_0xcb10ae['filters']=_[_0xf443('0x3a')](_0xcb10ae[_0xf443('0x37')],_0xcb10ae[_0xf443('0x38')]);_0x2448b5[_0xf443('0x3c')]=_['intersection'](_0xcb10ae[_0xf443('0x37')],qs[_0xf443('0x3b')](_0x335c0a[_0xf443('0x38')][_0xf443('0x3b')]));_0x2448b5[_0xf443('0x3c')]=_0x2448b5[_0xf443('0x3c')][_0xf443('0x3d')]?_0x2448b5[_0xf443('0x3c')]:_0xcb10ae[_0xf443('0x37')];if(_0x335c0a['query'][_0xf443('0x4a')]){_0x2448b5['include']=[{'all':!![]}];}_0x2448b5=_[_0xf443('0x46')]({},_0x2448b5,_0x335c0a['options']);return db[_0xf443('0x33')][_0xf443('0x50')](_0x2448b5)[_0xf443('0x29')](handleEntityNotFound(_0x4fc324,null))[_0xf443('0x29')](respondWithResult(_0x4fc324,null))[_0xf443('0x51')](handleError(_0x4fc324,null));};exports[_0xf443('0x52')]=function(_0x4b90ae,_0x594e4a){return db[_0xf443('0x33')][_0xf443('0x52')](_0x4b90ae[_0xf443('0x53')],{})['then'](function(_0x5c2e55){var _0x1e56dd=_0x4b90ae['user'][_0xf443('0x2b')]({'plain':!![]});if(!_0x1e56dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e56dd[_0xf443('0x54')]===_0xf443('0x55')){var _0x390eb5=_0x5c2e55[_0xf443('0x2b')]({'plain':!![]});var _0x18c626=_0xf443('0x2c');return db[_0xf443('0x56')]['find']({'where':{'name':_0x18c626,'userProfileId':_0x1e56dd['userProfileId']},'raw':!![]})[_0xf443('0x29')](function(_0x1fc14b){if(_0x1fc14b&&_0x1fc14b['autoAssociation']===0x0){return db[_0xf443('0x2d')]['create']({'name':_0x390eb5['name'],'resourceId':_0x390eb5['id'],'type':_0x1fc14b[_0xf443('0x30')],'sectionId':_0x1fc14b['id']},{})[_0xf443('0x29')](function(){return _0x5c2e55;});}else{return _0x5c2e55;}})['catch'](function(_0x3a86df){logger[_0xf443('0x2e')](_0xf443('0x57'),_0x3a86df);throw _0x3a86df;});}return _0x5c2e55;})['then'](respondWithResult(_0x594e4a,0xc9))[_0xf443('0x51')](handleError(_0x594e4a,null));};exports[_0xf443('0x28')]=function(_0x362bac,_0x4a99e7){if(_0x362bac[_0xf443('0x53')]['id']){delete _0x362bac[_0xf443('0x53')]['id'];}return db['CmContactHasItem'][_0xf443('0x50')]({'where':{'id':_0x362bac[_0xf443('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a99e7,null))['then'](saveUpdates(_0x362bac[_0xf443('0x53')],null))[_0xf443('0x29')](respondWithResult(_0x4a99e7,null))[_0xf443('0x51')](handleError(_0x4a99e7,null));};exports['destroy']=function(_0x19e60d,_0x761ee6){return db['CmContactHasItem'][_0xf443('0x50')]({'where':{'id':_0x19e60d['params']['id']}})[_0xf443('0x29')](handleEntityNotFound(_0x761ee6,null))[_0xf443('0x29')](removeEntity(_0x761ee6,null))['catch'](handleError(_0x761ee6,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 38caef3..3097fd3 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa614=['./cmContactHasItem.attributes','exports','define','cm_contact_has_items','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17c0ec,_0x34cf45){var _0x4e591c=function(_0x55c201){while(--_0x55c201){_0x17c0ec['push'](_0x17c0ec['shift']());}};_0x4e591c(++_0x34cf45);}(_0xa614,0x88));var _0x4a61=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xa614[_0x1d70db];return _0x3060c6;};'use strict';var _=require('lodash');var util=require(_0x4a61('0x0'));var logger=require(_0x4a61('0x1'))(_0x4a61('0x2'));var moment=require('moment');var BPromise=require(_0x4a61('0x3'));var rp=require(_0x4a61('0x4'));var fs=require('fs');var path=require(_0x4a61('0x5'));var rimraf=require(_0x4a61('0x6'));var config=require(_0x4a61('0x7'));var attributes=require(_0x4a61('0x8'));module[_0x4a61('0x9')]=function(_0x582b98,_0x328a94){return _0x582b98[_0x4a61('0xa')]('CmContactHasItem',attributes,{'tableName':_0x4a61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8770=['../../config/logger','api','request-promise','rimraf','exports','define','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x37053e,_0x2b9a70){var _0x284647=function(_0x460f5d){while(--_0x460f5d){_0x37053e['push'](_0x37053e['shift']());}};_0x284647(++_0x2b9a70);}(_0x8770,0x15e));var _0x0877=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8770[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0877('0x0'));var util=require('util');var logger=require(_0x0877('0x1'))(_0x0877('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0877('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0877('0x4'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x0877('0x5')]=function(_0x31f5f3,_0x191d6a){return _0x31f5f3[_0x0877('0x6')](_0x0877('0x7'),attributes,{'tableName':_0x0877('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index b92fc43..0b269f6 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ea0=['jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xd58b32,_0x175bc9){var _0x2a5e16=function(_0x365a59){while(--_0x365a59){_0xd58b32['push'](_0xd58b32['shift']());}};_0x2a5e16(++_0x175bc9);}(_0x8ea0,0xcb));var _0x08ea=function(_0x1b2bf1,_0x380a49){_0x1b2bf1=_0x1b2bf1-0x0;var _0x31f744=_0x8ea0[_0x1b2bf1];return _0x31f744;};'use strict';var _=require(_0x08ea('0x0'));var util=require('util');var moment=require(_0x08ea('0x1'));var BPromise=require(_0x08ea('0x2'));var rs=require(_0x08ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08ea('0x4'))['db'];var utils=require(_0x08ea('0x5'));var logger=require(_0x08ea('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x08ea('0x7'));var client=jayson[_0x08ea('0x8')][_0x08ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d70cf,_0x2ced5b,_0x15f03e){return new BPromise(function(_0x1f0e17,_0x1437dc){return client[_0x08ea('0xa')](_0x1d70cf,_0x15f03e)[_0x08ea('0xb')](function(_0x122812){logger[_0x08ea('0xc')](_0x08ea('0xd'),_0x2ced5b,_0x08ea('0xe'));logger['debug'](_0x08ea('0xf'),_0x2ced5b,'request\x20sent',JSON[_0x08ea('0x10')](_0x122812));if(_0x122812[_0x08ea('0x11')]){if(_0x122812[_0x08ea('0x11')][_0x08ea('0x12')]===0x1f4){logger[_0x08ea('0x11')](_0x08ea('0xd'),_0x2ced5b,_0x122812[_0x08ea('0x11')]['message']);return _0x1437dc(_0x122812['error'][_0x08ea('0x13')]);}logger[_0x08ea('0x11')](_0x08ea('0xd'),_0x2ced5b,_0x122812[_0x08ea('0x11')][_0x08ea('0x13')]);return _0x1f0e17(_0x122812[_0x08ea('0x11')]['message']);}else{logger[_0x08ea('0xc')](_0x08ea('0xd'),_0x2ced5b,_0x08ea('0xe'));_0x1f0e17(_0x122812[_0x08ea('0x14')]['message']);}})['catch'](function(_0x561a5a){logger[_0x08ea('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x2ced5b,_0x561a5a);_0x1437dc(_0x561a5a);});});} \ No newline at end of file +var _0x8dbe=['../../config/utils','../../config/logger','../../config/environment','http','then','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d65f4,_0xe14c3){var _0x128310=function(_0x228fe7){while(--_0x228fe7){_0x3d65f4['push'](_0x3d65f4['shift']());}};_0x128310(++_0xe14c3);}(_0x8dbe,0x8c));var _0xe8db=function(_0x18bebf,_0x447b32){_0x18bebf=_0x18bebf-0x0;var _0x4c41a0=_0x8dbe[_0x18bebf];return _0x4c41a0;};'use strict';var _=require(_0xe8db('0x0'));var util=require(_0xe8db('0x1'));var moment=require(_0xe8db('0x2'));var BPromise=require(_0xe8db('0x3'));var rs=require(_0xe8db('0x4'));var fs=require('fs');var Redis=require(_0xe8db('0x5'));var db=require(_0xe8db('0x6'))['db'];var utils=require(_0xe8db('0x7'));var logger=require(_0xe8db('0x8'))('rpc');var config=require(_0xe8db('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x455125,_0x52b7ac,_0x3f60c1){return new BPromise(function(_0x4f9372,_0x2ae90b){return client['request'](_0x455125,_0x3f60c1)[_0xe8db('0xb')](function(_0x55b25a){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x52b7ac,_0xe8db('0xc'));logger['debug'](_0xe8db('0xd'),_0x52b7ac,_0xe8db('0xc'),JSON[_0xe8db('0xe')](_0x55b25a));if(_0x55b25a[_0xe8db('0xf')]){if(_0x55b25a[_0xe8db('0xf')][_0xe8db('0x10')]===0x1f4){logger['error'](_0xe8db('0x11'),_0x52b7ac,_0x55b25a[_0xe8db('0xf')][_0xe8db('0x12')]);return _0x2ae90b(_0x55b25a[_0xe8db('0xf')][_0xe8db('0x12')]);}logger[_0xe8db('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x52b7ac,_0x55b25a[_0xe8db('0xf')]['message']);return _0x4f9372(_0x55b25a[_0xe8db('0xf')][_0xe8db('0x12')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x52b7ac,'request\x20sent');_0x4f9372(_0x55b25a[_0xe8db('0x13')][_0xe8db('0x12')]);}})[_0xe8db('0x14')](function(_0x207830){logger[_0xe8db('0xf')](_0xe8db('0x11'),_0x52b7ac,_0x207830);_0x2ae90b(_0x207830);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index ecdd469..7b03059 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0972=['isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x150aef,_0x580edd){var _0x26c7ff=function(_0x426e06){while(--_0x426e06){_0x150aef['push'](_0x150aef['shift']());}};_0x26c7ff(++_0x580edd);}(_0x0972,0x64));var _0x2097=function(_0x589819,_0x3d5db7){_0x589819=_0x589819-0x0;var _0x1d27d4=_0x0972[_0x589819];return _0x1d27d4;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0xb')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xc')]);router['put'](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0xe')]);router[_0x2097('0xf')](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);module[_0x2097('0x11')]=router; \ No newline at end of file +var _0x1171=['../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','show','create','put','update','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f943b,_0x1fb5e0){var _0xabea27=function(_0x49ad75){while(--_0x49ad75){_0x1f943b['push'](_0x1f943b['shift']());}};_0xabea27(++_0x1fb5e0);}(_0x1171,0x129));var _0x1117=function(_0x7404bb,_0x3249a1){_0x7404bb=_0x7404bb-0x0;var _0x2d9af1=_0x1171[_0x7404bb];return _0x2d9af1;};'use strict';var multer=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var path=require(_0x1117('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1117('0x3')]();var fs_extra=require(_0x1117('0x4'));var auth=require(_0x1117('0x5'));var interaction=require(_0x1117('0x6'));var config=require(_0x1117('0x7'));var controller=require(_0x1117('0x8'));router[_0x1117('0x9')]('/',auth[_0x1117('0xa')](),controller[_0x1117('0xb')]);router['get']('/:id',auth[_0x1117('0xa')](),controller[_0x1117('0xc')]);router['post']('/',auth[_0x1117('0xa')](),controller[_0x1117('0xd')]);router[_0x1117('0xe')]('/:id',auth[_0x1117('0xa')](),controller[_0x1117('0xf')]);router['delete'](_0x1117('0x10'),auth[_0x1117('0xa')](),controller[_0x1117('0x11')]);module[_0x1117('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 26e3fd0..b69224b 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 _0xba71=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','isArray','stringify','values'];(function(_0x8f7537,_0x5126bf){var _0x30971d=function(_0x48a4d7){while(--_0x48a4d7){_0x8f7537['push'](_0x8f7537['shift']());}};_0x30971d(++_0x5126bf);}(_0xba71,0x17f));var _0x1ba7=function(_0x175ac7,_0x5e8d45){_0x175ac7=_0x175ac7-0x0;var _0x125dec=_0xba71[_0x175ac7];return _0x125dec;};'use strict';var Sequelize=require(_0x1ba7('0x0'));var _=require(_0x1ba7('0x1'));module[_0x1ba7('0x2')]={'name':{'type':Sequelize[_0x1ba7('0x3')],'get':function(_0x35ca2b){return this[_0x1ba7('0x4')](_0x1ba7('0x5'));}},'alias':{'type':Sequelize[_0x1ba7('0x6')],'allowNull':![],'set':function(_0x165ec7){this[_0x1ba7('0x7')](_0x1ba7('0x5'),_0x165ec7?_0x165ec7:this[_0x1ba7('0x4')](_0x1ba7('0x8')));}},'type':{'type':Sequelize[_0x1ba7('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x1ba7('0x9')](_0x1ba7('0xa')),'get':function(){if(this[_0x1ba7('0x4')](_0x1ba7('0xb'))===_0x1ba7('0xc')){return JSON[_0x1ba7('0xd')](this['getDataValue']('values'));}else{return this[_0x1ba7('0x4')]('values');}},'set':function(_0x5ad25e){if(Array[_0x1ba7('0xe')](_0x5ad25e)){this['setDataValue']('values',JSON[_0x1ba7('0xf')](_0x5ad25e));}else{this[_0x1ba7('0x7')](_0x1ba7('0x10'),_0x5ad25e);}}},'required':{'type':Sequelize[_0x1ba7('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1ba7('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1ba7('0x12')](_0x1ba7('0x13'))}}; \ No newline at end of file +var _0x66ee=['values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse'];(function(_0x45b2d7,_0x260116){var _0x338d68=function(_0x2feed2){while(--_0x2feed2){_0x45b2d7['push'](_0x45b2d7['shift']());}};_0x338d68(++_0x260116);}(_0x66ee,0x126));var _0xe66e=function(_0xee240f,_0x4a0068){_0xee240f=_0xee240f-0x0;var _0x1c1c29=_0x66ee[_0xee240f];return _0x1c1c29;};'use strict';var Sequelize=require(_0xe66e('0x0'));var _=require(_0xe66e('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3366ce){return this[_0xe66e('0x2')](_0xe66e('0x3'));}},'alias':{'type':Sequelize[_0xe66e('0x4')],'allowNull':![],'set':function(_0x4b2021){this[_0xe66e('0x5')]('alias',_0x4b2021?_0x4b2021:this[_0xe66e('0x2')](_0xe66e('0x6')));}},'type':{'type':Sequelize[_0xe66e('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xe66e('0x7')](_0xe66e('0x8')),'get':function(){if(this[_0xe66e('0x2')](_0xe66e('0x9'))===_0xe66e('0xa')){return JSON[_0xe66e('0xb')](this['getDataValue'](_0xe66e('0xc')));}else{return this['getDataValue'](_0xe66e('0xc'));}},'set':function(_0xbd30b4){if(Array[_0xe66e('0xd')](_0xbd30b4)){this['setDataValue'](_0xe66e('0xc'),JSON['stringify'](_0xbd30b4));}else{this['setDataValue']('values',_0xbd30b4);}}},'required':{'type':Sequelize[_0xe66e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe66e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe66e('0xf')](_0xe66e('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index dbb00f8..faa28ca 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 _0x8ba6=['queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','CmCustomField','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','body','destroy','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue'];(function(_0x5d6aca,_0xa7e6ec){var _0x3d6481=function(_0x9683a2){while(--_0x9683a2){_0x5d6aca['push'](_0x5d6aca['shift']());}};_0x3d6481(++_0xa7e6ec);}(_0x8ba6,0x164));var _0x68ba=function(_0x3f2d07,_0x35674d){_0x3f2d07=_0x3f2d07-0x0;var _0x3cd224=_0x8ba6[_0x3f2d07];return _0x3cd224;};'use strict';var emlformat=require(_0x68ba('0x0'));var rimraf=require(_0x68ba('0x1'));var zipdir=require(_0x68ba('0x2'));var jsonpatch=require(_0x68ba('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68ba('0x4'));var Mustache=require(_0x68ba('0x5'));var util=require(_0x68ba('0x6'));var path=require('path');var sox=require(_0x68ba('0x7'));var csv=require(_0x68ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68ba('0x9'));var _=require('lodash');var squel=require(_0x68ba('0xa'));var crypto=require(_0x68ba('0xb'));var jsforce=require(_0x68ba('0xc'));var deskjs=require(_0x68ba('0xd'));var toCsv=require(_0x68ba('0x8'));var querystring=require(_0x68ba('0xe'));var Papa=require(_0x68ba('0xf'));var Redis=require(_0x68ba('0x10'));var authService=require(_0x68ba('0x11'));var qs=require(_0x68ba('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68ba('0x13'));var logger=require('../../config/logger')(_0x68ba('0x14'));var utils=require(_0x68ba('0x15'));var config=require(_0x68ba('0x16'));var licenseUtil=require(_0x68ba('0x17'));var db=require(_0x68ba('0x18'))['db'];function respondWithStatusCode(_0x518d5f,_0x4dc4d1){_0x4dc4d1=_0x4dc4d1||0xcc;return function(_0x3c14c2){if(_0x3c14c2){return _0x518d5f[_0x68ba('0x19')](_0x4dc4d1);}return _0x518d5f[_0x68ba('0x1a')](_0x4dc4d1)[_0x68ba('0x1b')]();};}function respondWithResult(_0x1b26e4,_0x5f474e){_0x5f474e=_0x5f474e||0xc8;return function(_0x38dfea){if(_0x38dfea){return _0x1b26e4['status'](_0x5f474e)[_0x68ba('0x1c')](_0x38dfea);}};}function respondWithFilteredResult(_0x80b0ca,_0x16563e){return function(_0x1458bf){if(_0x1458bf){var _0x5e85ab=typeof _0x16563e['offset']===_0x68ba('0x1d')&&typeof _0x16563e[_0x68ba('0x1e')]==='undefined';var _0x3e8b1c=_0x1458bf[_0x68ba('0x1f')];var _0x4d3c02=_0x5e85ab?0x0:_0x16563e[_0x68ba('0x20')];var _0x2c00a5=_0x5e85ab?_0x1458bf['count']:_0x16563e[_0x68ba('0x20')]+_0x16563e[_0x68ba('0x1e')];var _0x5211d6;if(_0x2c00a5>=_0x3e8b1c){_0x2c00a5=_0x3e8b1c;_0x5211d6=0xc8;}else{_0x5211d6=0xce;}_0x80b0ca[_0x68ba('0x1a')](_0x5211d6);return _0x80b0ca[_0x68ba('0x21')](_0x68ba('0x22'),_0x4d3c02+'-'+_0x2c00a5+'/'+_0x3e8b1c)[_0x68ba('0x1c')](_0x1458bf);}return null;};}function patchUpdates(_0x2bfbce){return function(_0x23cd3b){try{jsonpatch[_0x68ba('0x23')](_0x23cd3b,_0x2bfbce,!![]);}catch(_0x3758bb){return BPromise[_0x68ba('0x24')](_0x3758bb);}return _0x23cd3b[_0x68ba('0x25')]();};}function saveUpdates(_0x3b67b3,_0x107863){return function(_0x59c5fb){if(_0x59c5fb){return _0x59c5fb[_0x68ba('0x26')](_0x3b67b3)[_0x68ba('0x27')](function(_0x542de3){return _0x542de3;});}return null;};}function removeEntity(_0x577b8a,_0x52013e){return function(_0x31a90d){if(_0x31a90d){return _0x31a90d['destroy']()[_0x68ba('0x27')](function(){_0x577b8a[_0x68ba('0x1a')](0xcc)[_0x68ba('0x1b')]();});}};}function handleEntityNotFound(_0x210b07,_0x3f9bad){return function(_0x1e92b8){if(!_0x1e92b8){_0x210b07[_0x68ba('0x19')](0x194);}return _0x1e92b8;};}function handleError(_0x4a3b15,_0x4f1cf1){_0x4f1cf1=_0x4f1cf1||0x1f4;return function(_0x532e1c){logger[_0x68ba('0x28')](_0x532e1c[_0x68ba('0x29')]);if(_0x532e1c['name']){delete _0x532e1c[_0x68ba('0x2a')];}_0x4a3b15[_0x68ba('0x1a')](_0x4f1cf1)[_0x68ba('0x2b')](_0x532e1c);};}exports['index']=function(_0x3b59e2,_0x14ca1b){var _0x31c4ac={},_0x41d55c={},_0x179043={'count':0x0,'rows':[]};var _0x19bf99=_['map'](db[_0x68ba('0x2c')]['rawAttributes'],function(_0x1961eb){return{'name':_0x1961eb['fieldName'],'type':_0x1961eb[_0x68ba('0x2d')][_0x68ba('0x2e')]};});_0x41d55c[_0x68ba('0x2f')]=_[_0x68ba('0x30')](_[_0x68ba('0x31')](_0x19bf99,_0x68ba('0x2a')),[_0x68ba('0x2a')]);_0x41d55c[_0x68ba('0x32')]=_[_0x68ba('0x33')](_0x3b59e2[_0x68ba('0x32')]);_0x41d55c[_0x68ba('0x34')]=_[_0x68ba('0x35')](_0x41d55c[_0x68ba('0x2f')],_0x41d55c[_0x68ba('0x32')]);_0x31c4ac[_0x68ba('0x36')]=_['intersection'](_0x41d55c[_0x68ba('0x2f')],qs[_0x68ba('0x37')](_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x37')]));_0x31c4ac['attributes']=_0x31c4ac['attributes'][_0x68ba('0x38')]?_0x31c4ac[_0x68ba('0x36')]:_0x41d55c['model'];if(!_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x39')]('nolimit')){_0x31c4ac['limit']=qs['limit'](_0x3b59e2[_0x68ba('0x32')]['limit']);_0x31c4ac['offset']=qs[_0x68ba('0x20')](_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x20')]);}_0x31c4ac[_0x68ba('0x3a')]=qs[_0x68ba('0x3b')](_0x3b59e2[_0x68ba('0x32')]['sort']);_0x31c4ac[_0x68ba('0x3c')]=qs['filters'](_[_0x68ba('0x3d')](_0x3b59e2[_0x68ba('0x32')],_0x41d55c[_0x68ba('0x34')]),_0x19bf99);if(_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x3e')]){_0x31c4ac[_0x68ba('0x3c')]=_['merge'](_0x31c4ac['where'],{'$or':_[_0x68ba('0x31')](_0x19bf99,function(_0x24e137){if(_0x24e137['type']!=='VIRTUAL'){var _0x5619ee={};_0x5619ee[_0x24e137[_0x68ba('0x2a')]]={'$like':'%'+_0x3b59e2[_0x68ba('0x32')][_0x68ba('0x3e')]+'%'};return _0x5619ee;}})});}_0x31c4ac=_['merge']({},_0x31c4ac,_0x3b59e2['options']);var _0x1bfe14={'where':_0x31c4ac[_0x68ba('0x3c')]};return db[_0x68ba('0x2c')][_0x68ba('0x1f')](_0x1bfe14)[_0x68ba('0x27')](function(_0x430e96){_0x179043[_0x68ba('0x1f')]=_0x430e96;if(_0x3b59e2[_0x68ba('0x32')]['includeAll']){_0x31c4ac[_0x68ba('0x3f')]=[{'all':!![]}];}return db[_0x68ba('0x2c')][_0x68ba('0x40')](_0x31c4ac);})[_0x68ba('0x27')](function(_0xf03db){_0x179043[_0x68ba('0x41')]=_0xf03db;return _0x179043;})[_0x68ba('0x27')](respondWithFilteredResult(_0x14ca1b,_0x31c4ac))[_0x68ba('0x42')](handleError(_0x14ca1b,null));};exports['show']=function(_0x20bcb9,_0x386feb){var _0x911e62={'raw':!![],'where':{'id':_0x20bcb9[_0x68ba('0x43')]['id']}},_0x335b2e={};_0x335b2e[_0x68ba('0x2f')]=_[_0x68ba('0x33')](db[_0x68ba('0x2c')][_0x68ba('0x44')]);_0x335b2e['query']=_[_0x68ba('0x33')](_0x20bcb9[_0x68ba('0x32')]);_0x335b2e[_0x68ba('0x34')]=_[_0x68ba('0x35')](_0x335b2e[_0x68ba('0x2f')],_0x335b2e[_0x68ba('0x32')]);_0x911e62[_0x68ba('0x36')]=_['intersection'](_0x335b2e[_0x68ba('0x2f')],qs[_0x68ba('0x37')](_0x20bcb9['query']['fields']));_0x911e62[_0x68ba('0x36')]=_0x911e62[_0x68ba('0x36')][_0x68ba('0x38')]?_0x911e62[_0x68ba('0x36')]:_0x335b2e[_0x68ba('0x2f')];if(_0x20bcb9[_0x68ba('0x32')][_0x68ba('0x45')]){_0x911e62['include']=[{'all':!![]}];}_0x911e62=_['merge']({},_0x911e62,_0x20bcb9[_0x68ba('0x46')]);return db[_0x68ba('0x2c')][_0x68ba('0x47')](_0x911e62)[_0x68ba('0x27')](handleEntityNotFound(_0x386feb,null))[_0x68ba('0x27')](respondWithResult(_0x386feb,null))['catch'](handleError(_0x386feb,null));};exports[_0x68ba('0x26')]=function(_0x3b9124,_0x2ac70b){if(_0x3b9124[_0x68ba('0x48')]['id']){delete _0x3b9124[_0x68ba('0x48')]['id'];}return db[_0x68ba('0x2c')][_0x68ba('0x47')]({'where':{'id':_0x3b9124[_0x68ba('0x43')]['id']}})[_0x68ba('0x27')](handleEntityNotFound(_0x2ac70b,null))[_0x68ba('0x27')](saveUpdates(_0x3b9124[_0x68ba('0x48')],null))['then'](respondWithResult(_0x2ac70b,null))[_0x68ba('0x42')](handleError(_0x2ac70b,null));};exports[_0x68ba('0x49')]=function(_0xfb3ce0,_0xdbada1){return db[_0x68ba('0x2c')][_0x68ba('0x47')]({'where':{'id':_0xfb3ce0[_0x68ba('0x43')]['id']}})[_0x68ba('0x27')](handleEntityNotFound(_0xdbada1,null))[_0x68ba('0x27')](removeEntity(_0xdbada1,null))[_0x68ba('0x42')](handleError(_0xdbada1,null));};exports['create']=function(_0x57a477,_0x597d9f){var _0x101f26;return db[_0x68ba('0x4a')][_0x68ba('0x4b')](function(_0x154c48){return db[_0x68ba('0x2c')]['create'](_0x57a477[_0x68ba('0x48')],{'transaction':_0x154c48})[_0x68ba('0x27')](function(_0x461b35){_0x101f26=_0x461b35;var _0x3e8e39={'type':db[_0x68ba('0x4c')][_0x68ba('0x4d')],'transaction':_0x154c48};switch(_0x57a477[_0x68ba('0x48')][_0x68ba('0x2d')]){case _0x68ba('0x4e'):_0x3e8e39[_0x68ba('0x2d')]=db[_0x68ba('0x4c')][_0x68ba('0x4d')];break;case _0x68ba('0x4f'):_0x3e8e39[_0x68ba('0x2d')]=db[_0x68ba('0x4c')][_0x68ba('0x50')];break;case _0x68ba('0x51'):_0x3e8e39['type']=db['Sequelize'][_0x68ba('0x52')];_0x3e8e39[_0x68ba('0x53')]=![];break;default:}return db[_0x68ba('0x4a')][_0x68ba('0x54')][_0x68ba('0x55')](_0x68ba('0x56'),util['format'](_0x68ba('0x57'),_0x101f26['id']),_0x3e8e39);})[_0x68ba('0x27')](function(){return _0x101f26;});})[_0x68ba('0x27')](respondWithResult(_0x597d9f,0xc9))['catch'](handleError(_0x597d9f,null));}; \ No newline at end of file +var _0xff31=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','includeAll','include','findAll','rows','catch','show','params','body','find','create','transaction','Sequelize','TEXT','number','INTEGER','switch','defaultValue','sequelize','queryInterface','cm_contacts','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel'];(function(_0x4f4c48,_0x1923ee){var _0x347283=function(_0x1278cc){while(--_0x1278cc){_0x4f4c48['push'](_0x4f4c48['shift']());}};_0x347283(++_0x1923ee);}(_0xff31,0x194));var _0x1ff3=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xff31[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1ff3('0x0'));var jsonpatch=require(_0x1ff3('0x1'));var rp=require(_0x1ff3('0x2'));var moment=require(_0x1ff3('0x3'));var BPromise=require(_0x1ff3('0x4'));var Mustache=require(_0x1ff3('0x5'));var util=require(_0x1ff3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1ff3('0x7'));var ejs=require(_0x1ff3('0x8'));var fs=require('fs');var fs_extra=require(_0x1ff3('0x9'));var _=require('lodash');var squel=require(_0x1ff3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ff3('0x7'));var querystring=require(_0x1ff3('0xb'));var Papa=require(_0x1ff3('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1ff3('0xd'));var as=require(_0x1ff3('0xe'));var hardwareService=require(_0x1ff3('0xf'));var logger=require(_0x1ff3('0x10'))('api');var utils=require(_0x1ff3('0x11'));var config=require(_0x1ff3('0x12'));var licenseUtil=require(_0x1ff3('0x13'));var db=require(_0x1ff3('0x14'))['db'];function respondWithStatusCode(_0x1582d3,_0x16eb06){_0x16eb06=_0x16eb06||0xcc;return function(_0x3b55a8){if(_0x3b55a8){return _0x1582d3[_0x1ff3('0x15')](_0x16eb06);}return _0x1582d3[_0x1ff3('0x16')](_0x16eb06)[_0x1ff3('0x17')]();};}function respondWithResult(_0x5f20f8,_0xd0ffbb){_0xd0ffbb=_0xd0ffbb||0xc8;return function(_0x570e1b){if(_0x570e1b){return _0x5f20f8[_0x1ff3('0x16')](_0xd0ffbb)[_0x1ff3('0x18')](_0x570e1b);}};}function respondWithFilteredResult(_0x1db1d1,_0x291b55){return function(_0x5ccd33){if(_0x5ccd33){var _0x21b233=typeof _0x291b55['offset']===_0x1ff3('0x19')&&typeof _0x291b55[_0x1ff3('0x1a')]===_0x1ff3('0x19');var _0x7f17f9=_0x5ccd33[_0x1ff3('0x1b')];var _0x41610f=_0x21b233?0x0:_0x291b55[_0x1ff3('0x1c')];var _0x47558d=_0x21b233?_0x5ccd33[_0x1ff3('0x1b')]:_0x291b55[_0x1ff3('0x1c')]+_0x291b55[_0x1ff3('0x1a')];var _0x41b4e1;if(_0x47558d>=_0x7f17f9){_0x47558d=_0x7f17f9;_0x41b4e1=0xc8;}else{_0x41b4e1=0xce;}_0x1db1d1[_0x1ff3('0x16')](_0x41b4e1);return _0x1db1d1[_0x1ff3('0x1d')](_0x1ff3('0x1e'),_0x41610f+'-'+_0x47558d+'/'+_0x7f17f9)[_0x1ff3('0x18')](_0x5ccd33);}return null;};}function patchUpdates(_0x509777){return function(_0x32e31f){try{jsonpatch['apply'](_0x32e31f,_0x509777,!![]);}catch(_0x1bae3e){return BPromise['reject'](_0x1bae3e);}return _0x32e31f[_0x1ff3('0x1f')]();};}function saveUpdates(_0x209385,_0x1f73fa){return function(_0x138c4a){if(_0x138c4a){return _0x138c4a[_0x1ff3('0x20')](_0x209385)[_0x1ff3('0x21')](function(_0x3c5d32){return _0x3c5d32;});}return null;};}function removeEntity(_0x2df2c3,_0x2569d3){return function(_0x3b5f38){if(_0x3b5f38){return _0x3b5f38[_0x1ff3('0x22')]()[_0x1ff3('0x21')](function(){_0x2df2c3[_0x1ff3('0x16')](0xcc)[_0x1ff3('0x17')]();});}};}function handleEntityNotFound(_0x1d3c0f,_0x4ca4a8){return function(_0x7f78b5){if(!_0x7f78b5){_0x1d3c0f[_0x1ff3('0x15')](0x194);}return _0x7f78b5;};}function handleError(_0x215930,_0x365427){_0x365427=_0x365427||0x1f4;return function(_0x42a92a){logger['error'](_0x42a92a[_0x1ff3('0x23')]);if(_0x42a92a['name']){delete _0x42a92a[_0x1ff3('0x24')];}_0x215930[_0x1ff3('0x16')](_0x365427)['send'](_0x42a92a);};}exports[_0x1ff3('0x25')]=function(_0x1a7c25,_0x132eff){var _0x55cfe6={},_0x2c728a={},_0x13d12c={'count':0x0,'rows':[]};var _0xb78aab=_[_0x1ff3('0x26')](db['CmCustomField'][_0x1ff3('0x27')],function(_0x538dc2){return{'name':_0x538dc2[_0x1ff3('0x28')],'type':_0x538dc2[_0x1ff3('0x29')][_0x1ff3('0x2a')]};});_0x2c728a[_0x1ff3('0x2b')]=_['differenceBy'](_[_0x1ff3('0x26')](_0xb78aab,_0x1ff3('0x24')),[_0x1ff3('0x24')]);_0x2c728a[_0x1ff3('0x2c')]=_[_0x1ff3('0x2d')](_0x1a7c25[_0x1ff3('0x2c')]);_0x2c728a[_0x1ff3('0x2e')]=_['intersection'](_0x2c728a[_0x1ff3('0x2b')],_0x2c728a[_0x1ff3('0x2c')]);_0x55cfe6[_0x1ff3('0x2f')]=_[_0x1ff3('0x30')](_0x2c728a[_0x1ff3('0x2b')],qs[_0x1ff3('0x31')](_0x1a7c25['query']['fields']));_0x55cfe6['attributes']=_0x55cfe6[_0x1ff3('0x2f')][_0x1ff3('0x32')]?_0x55cfe6[_0x1ff3('0x2f')]:_0x2c728a[_0x1ff3('0x2b')];if(!_0x1a7c25[_0x1ff3('0x2c')][_0x1ff3('0x33')](_0x1ff3('0x34'))){_0x55cfe6[_0x1ff3('0x1a')]=qs[_0x1ff3('0x1a')](_0x1a7c25[_0x1ff3('0x2c')][_0x1ff3('0x1a')]);_0x55cfe6['offset']=qs[_0x1ff3('0x1c')](_0x1a7c25[_0x1ff3('0x2c')][_0x1ff3('0x1c')]);}_0x55cfe6[_0x1ff3('0x35')]=qs[_0x1ff3('0x36')](_0x1a7c25[_0x1ff3('0x2c')][_0x1ff3('0x36')]);_0x55cfe6[_0x1ff3('0x37')]=qs[_0x1ff3('0x2e')](_[_0x1ff3('0x38')](_0x1a7c25[_0x1ff3('0x2c')],_0x2c728a[_0x1ff3('0x2e')]),_0xb78aab);if(_0x1a7c25['query'][_0x1ff3('0x39')]){_0x55cfe6[_0x1ff3('0x37')]=_[_0x1ff3('0x3a')](_0x55cfe6['where'],{'$or':_[_0x1ff3('0x26')](_0xb78aab,function(_0x2c92fe){if(_0x2c92fe['type']!==_0x1ff3('0x3b')){var _0x2e29c5={};_0x2e29c5[_0x2c92fe[_0x1ff3('0x24')]]={'$like':'%'+_0x1a7c25[_0x1ff3('0x2c')][_0x1ff3('0x39')]+'%'};return _0x2e29c5;}})});}_0x55cfe6=_[_0x1ff3('0x3a')]({},_0x55cfe6,_0x1a7c25[_0x1ff3('0x3c')]);var _0xe04c91={'where':_0x55cfe6[_0x1ff3('0x37')]};return db[_0x1ff3('0x3d')][_0x1ff3('0x1b')](_0xe04c91)[_0x1ff3('0x21')](function(_0x3fc009){_0x13d12c[_0x1ff3('0x1b')]=_0x3fc009;if(_0x1a7c25['query'][_0x1ff3('0x3e')]){_0x55cfe6[_0x1ff3('0x3f')]=[{'all':!![]}];}return db[_0x1ff3('0x3d')][_0x1ff3('0x40')](_0x55cfe6);})[_0x1ff3('0x21')](function(_0x487f05){_0x13d12c[_0x1ff3('0x41')]=_0x487f05;return _0x13d12c;})[_0x1ff3('0x21')](respondWithFilteredResult(_0x132eff,_0x55cfe6))[_0x1ff3('0x42')](handleError(_0x132eff,null));};exports[_0x1ff3('0x43')]=function(_0x239761,_0xfbb7ac){var _0x632fc4={'raw':!![],'where':{'id':_0x239761[_0x1ff3('0x44')]['id']}},_0x3c64f8={};_0x3c64f8[_0x1ff3('0x2b')]=_[_0x1ff3('0x2d')](db[_0x1ff3('0x3d')]['rawAttributes']);_0x3c64f8[_0x1ff3('0x2c')]=_[_0x1ff3('0x2d')](_0x239761[_0x1ff3('0x2c')]);_0x3c64f8[_0x1ff3('0x2e')]=_['intersection'](_0x3c64f8[_0x1ff3('0x2b')],_0x3c64f8[_0x1ff3('0x2c')]);_0x632fc4[_0x1ff3('0x2f')]=_[_0x1ff3('0x30')](_0x3c64f8[_0x1ff3('0x2b')],qs[_0x1ff3('0x31')](_0x239761[_0x1ff3('0x2c')][_0x1ff3('0x31')]));_0x632fc4['attributes']=_0x632fc4[_0x1ff3('0x2f')]['length']?_0x632fc4[_0x1ff3('0x2f')]:_0x3c64f8['model'];if(_0x239761[_0x1ff3('0x2c')][_0x1ff3('0x3e')]){_0x632fc4[_0x1ff3('0x3f')]=[{'all':!![]}];}_0x632fc4=_[_0x1ff3('0x3a')]({},_0x632fc4,_0x239761[_0x1ff3('0x3c')]);return db[_0x1ff3('0x3d')]['find'](_0x632fc4)['then'](handleEntityNotFound(_0xfbb7ac,null))['then'](respondWithResult(_0xfbb7ac,null))[_0x1ff3('0x42')](handleError(_0xfbb7ac,null));};exports[_0x1ff3('0x20')]=function(_0x4e8975,_0x504779){if(_0x4e8975['body']['id']){delete _0x4e8975[_0x1ff3('0x45')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x4e8975[_0x1ff3('0x44')]['id']}})[_0x1ff3('0x21')](handleEntityNotFound(_0x504779,null))[_0x1ff3('0x21')](saveUpdates(_0x4e8975[_0x1ff3('0x45')],null))[_0x1ff3('0x21')](respondWithResult(_0x504779,null))[_0x1ff3('0x42')](handleError(_0x504779,null));};exports[_0x1ff3('0x22')]=function(_0x561adf,_0x44fffc){return db[_0x1ff3('0x3d')][_0x1ff3('0x46')]({'where':{'id':_0x561adf[_0x1ff3('0x44')]['id']}})[_0x1ff3('0x21')](handleEntityNotFound(_0x44fffc,null))[_0x1ff3('0x21')](removeEntity(_0x44fffc,null))[_0x1ff3('0x42')](handleError(_0x44fffc,null));};exports[_0x1ff3('0x47')]=function(_0x2884c7,_0x23d923){var _0x1e0b4c;return db['sequelize'][_0x1ff3('0x48')](function(_0x55c50c){return db[_0x1ff3('0x3d')][_0x1ff3('0x47')](_0x2884c7[_0x1ff3('0x45')],{'transaction':_0x55c50c})[_0x1ff3('0x21')](function(_0x2ea25e){_0x1e0b4c=_0x2ea25e;var _0x57bdfe={'type':db['Sequelize']['TEXT'],'transaction':_0x55c50c};switch(_0x2884c7[_0x1ff3('0x45')][_0x1ff3('0x29')]){case'text':_0x57bdfe[_0x1ff3('0x29')]=db[_0x1ff3('0x49')][_0x1ff3('0x4a')];break;case _0x1ff3('0x4b'):_0x57bdfe['type']=db[_0x1ff3('0x49')][_0x1ff3('0x4c')];break;case _0x1ff3('0x4d'):_0x57bdfe[_0x1ff3('0x29')]=db[_0x1ff3('0x49')]['BOOLEAN'];_0x57bdfe[_0x1ff3('0x4e')]=![];break;default:}return db[_0x1ff3('0x4f')][_0x1ff3('0x50')]['addColumn'](_0x1ff3('0x51'),util['format'](_0x1ff3('0x52'),_0x1e0b4c['id']),_0x57bdfe);})[_0x1ff3('0x21')](function(){return _0x1e0b4c;});})['then'](respondWithResult(_0x23d923,0xc9))['catch'](handleError(_0x23d923,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b80e620..bae9917 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 _0xd421=['request-promise','path','rimraf','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x270554,_0x12eb20){var _0x2079c3=function(_0x38b75e){while(--_0x38b75e){_0x270554['push'](_0x270554['shift']());}};_0x2079c3(++_0x12eb20);}(_0xd421,0x104));var _0x1d42=function(_0x6af591,_0x380e70){_0x6af591=_0x6af591-0x0;var _0x270e66=_0xd421[_0x6af591];return _0x270e66;};'use strict';var _=require(_0x1d42('0x0'));var util=require(_0x1d42('0x1'));var logger=require(_0x1d42('0x2'))(_0x1d42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1d42('0x4'));var fs=require('fs');var path=require(_0x1d42('0x5'));var rimraf=require(_0x1d42('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d42('0x7'));module[_0x1d42('0x8')]=function(_0x593539,_0x193697){return _0x593539[_0x1d42('0x9')]('CmCustomField',attributes,{'tableName':_0x1d42('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2d7=['exports','define','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5815a1,_0x2325cb){var _0x637bcb=function(_0x408e20){while(--_0x408e20){_0x5815a1['push'](_0x5815a1['shift']());}};_0x637bcb(++_0x2325cb);}(_0xe2d7,0x170));var _0x7e2d=function(_0x53c48a,_0x384e24){_0x53c48a=_0x53c48a-0x0;var _0xe53ce4=_0xe2d7[_0x53c48a];return _0xe53ce4;};'use strict';var _=require('lodash');var util=require(_0x7e2d('0x0'));var logger=require(_0x7e2d('0x1'))(_0x7e2d('0x2'));var moment=require(_0x7e2d('0x3'));var BPromise=require(_0x7e2d('0x4'));var rp=require(_0x7e2d('0x5'));var fs=require('fs');var path=require(_0x7e2d('0x6'));var rimraf=require(_0x7e2d('0x7'));var config=require(_0x7e2d('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x7e2d('0x9')]=function(_0x43790f,_0x34b2b9){return _0x43790f[_0x7e2d('0xa')](_0x7e2d('0xb'),attributes,{'tableName':_0x7e2d('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index eb3418a..2d4261b 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 _0x72c8=['request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x4c26d2,_0x386a43){var _0x3b4400=function(_0x49d934){while(--_0x49d934){_0x4c26d2['push'](_0x4c26d2['shift']());}};_0x3b4400(++_0x386a43);}(_0x72c8,0x1ea));var _0x872c=function(_0x3f6da1,_0x238c3d){_0x3f6da1=_0x3f6da1-0x0;var _0x1a0f9a=_0x72c8[_0x3f6da1];return _0x1a0f9a;};'use strict';var _=require(_0x872c('0x0'));var util=require(_0x872c('0x1'));var moment=require(_0x872c('0x2'));var BPromise=require(_0x872c('0x3'));var rs=require(_0x872c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x872c('0x5'))['db'];var utils=require(_0x872c('0x6'));var logger=require(_0x872c('0x7'))(_0x872c('0x8'));var config=require(_0x872c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x872c('0xa')][_0x872c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3aed93,_0x1fcfb3,_0x58921f){return new BPromise(function(_0x5a621b,_0xe9f935){return client['request'](_0x3aed93,_0x58921f)[_0x872c('0xc')](function(_0x2176f6){logger['info'](_0x872c('0xd'),_0x1fcfb3,'request\x20sent');logger[_0x872c('0xe')](_0x872c('0xf'),_0x1fcfb3,_0x872c('0x10'),JSON[_0x872c('0x11')](_0x2176f6));if(_0x2176f6['error']){if(_0x2176f6[_0x872c('0x12')][_0x872c('0x13')]===0x1f4){logger[_0x872c('0x12')]('CmCustomField,\x20%s,\x20%s',_0x1fcfb3,_0x2176f6[_0x872c('0x12')]['message']);return _0xe9f935(_0x2176f6[_0x872c('0x12')][_0x872c('0x14')]);}logger[_0x872c('0x12')](_0x872c('0xd'),_0x1fcfb3,_0x2176f6[_0x872c('0x12')][_0x872c('0x14')]);return _0x5a621b(_0x2176f6[_0x872c('0x12')][_0x872c('0x14')]);}else{logger[_0x872c('0x15')]('CmCustomField,\x20%s,\x20%s',_0x1fcfb3,'request\x20sent');_0x5a621b(_0x2176f6['result'][_0x872c('0x14')]);}})[_0x872c('0x16')](function(_0x364a47){logger[_0x872c('0x12')](_0x872c('0xd'),_0x1fcfb3,_0x364a47);_0xe9f935(_0x364a47);});});} \ No newline at end of file +var _0x49ab=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x4090fb,_0x30b8c1){var _0x5542a3=function(_0x41e967){while(--_0x41e967){_0x4090fb['push'](_0x4090fb['shift']());}};_0x5542a3(++_0x30b8c1);}(_0x49ab,0x122));var _0xb49a=function(_0x151eef,_0x348560){_0x151eef=_0x151eef-0x0;var _0x10243b=_0x49ab[_0x151eef];return _0x10243b;};'use strict';var _=require(_0xb49a('0x0'));var util=require('util');var moment=require(_0xb49a('0x1'));var BPromise=require(_0xb49a('0x2'));var rs=require(_0xb49a('0x3'));var fs=require('fs');var Redis=require(_0xb49a('0x4'));var db=require(_0xb49a('0x5'))['db'];var utils=require(_0xb49a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb49a('0x7'));var jayson=require(_0xb49a('0x8'));var client=jayson[_0xb49a('0x9')][_0xb49a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c7c12,_0x4bf78a,_0x533b16){return new BPromise(function(_0x536d45,_0x567a02){return client['request'](_0x1c7c12,_0x533b16)['then'](function(_0x4cd3b8){logger[_0xb49a('0xb')](_0xb49a('0xc'),_0x4bf78a,_0xb49a('0xd'));logger[_0xb49a('0xe')](_0xb49a('0xf'),_0x4bf78a,_0xb49a('0xd'),JSON[_0xb49a('0x10')](_0x4cd3b8));if(_0x4cd3b8[_0xb49a('0x11')]){if(_0x4cd3b8[_0xb49a('0x11')][_0xb49a('0x12')]===0x1f4){logger[_0xb49a('0x11')]('CmCustomField,\x20%s,\x20%s',_0x4bf78a,_0x4cd3b8[_0xb49a('0x11')][_0xb49a('0x13')]);return _0x567a02(_0x4cd3b8[_0xb49a('0x11')][_0xb49a('0x13')]);}logger[_0xb49a('0x11')](_0xb49a('0xc'),_0x4bf78a,_0x4cd3b8[_0xb49a('0x11')][_0xb49a('0x13')]);return _0x536d45(_0x4cd3b8[_0xb49a('0x11')][_0xb49a('0x13')]);}else{logger[_0xb49a('0xb')]('CmCustomField,\x20%s,\x20%s',_0x4bf78a,_0xb49a('0xd'));_0x536d45(_0x4cd3b8['result'][_0xb49a('0x13')]);}})[_0xb49a('0x14')](function(_0x31776c){logger[_0xb49a('0x11')]('CmCustomField,\x20%s,\x20%s',_0x4bf78a,_0x31776c);_0x567a02(_0x31776c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index c112786..874bc2f 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 _0x7181=['exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x5c48de,_0x25e709){var _0x17f619=function(_0x2e50a0){while(--_0x2e50a0){_0x5c48de['push'](_0x5c48de['shift']());}};_0x17f619(++_0x25e709);}(_0x7181,0x1ef));var _0x1718=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0x7181[_0x9bca53];return _0x3894bc;};'use strict';var multer=require(_0x1718('0x0'));var util=require(_0x1718('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1718('0x2')]();var fs_extra=require(_0x1718('0x3'));var auth=require(_0x1718('0x4'));var interaction=require(_0x1718('0x5'));var config=require(_0x1718('0x6'));var controller=require(_0x1718('0x7'));router[_0x1718('0x8')]('/',auth[_0x1718('0x9')](),controller[_0x1718('0xa')]);router[_0x1718('0x8')](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0xc')]);router[_0x1718('0xd')]('/',auth[_0x1718('0x9')](),controller[_0x1718('0xe')]);router['put'](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0xf')]);router[_0x1718('0x10')](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0x11')]);module[_0x1718('0x12')]=router; \ No newline at end of file +var _0x4aa3=['/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show'];(function(_0x39598e,_0x16c074){var _0x5676a5=function(_0x3706be){while(--_0x3706be){_0x39598e['push'](_0x39598e['shift']());}};_0x5676a5(++_0x16c074);}(_0x4aa3,0x174));var _0x34aa=function(_0x1a9693,_0x341407){_0x1a9693=_0x1a9693-0x0;var _0x342023=_0x4aa3[_0x1a9693];return _0x342023;};'use strict';var multer=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var path=require('path');var timeout=require(_0x34aa('0x2'));var express=require(_0x34aa('0x3'));var router=express['Router']();var fs_extra=require(_0x34aa('0x4'));var auth=require(_0x34aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x34aa('0x6'));var controller=require(_0x34aa('0x7'));router[_0x34aa('0x8')]('/',auth['isAuthenticated'](),controller[_0x34aa('0x9')]);router[_0x34aa('0x8')]('/:id',auth[_0x34aa('0xa')](),controller[_0x34aa('0xb')]);router['post']('/',auth[_0x34aa('0xa')](),controller['create']);router['put'](_0x34aa('0xc'),auth[_0x34aa('0xa')](),controller[_0x34aa('0xd')]);router[_0x34aa('0xe')](_0x34aa('0xc'),auth[_0x34aa('0xa')](),controller['destroy']);module[_0x34aa('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 2fe0986..b99672d 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 _0x3abd=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x15a515,_0x35ba23){var _0x27db15=function(_0x2f00f5){while(--_0x2f00f5){_0x15a515['push'](_0x15a515['shift']());}};_0x27db15(++_0x35ba23);}(_0x3abd,0x1bd));var _0xd3ab=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x3abd[_0x11ce46];return _0x368a1e;};'use strict';var moment=require(_0xd3ab('0x0'));var Sequelize=require(_0xd3ab('0x1'));module[_0xd3ab('0x2')]={'phone':{'type':Sequelize[_0xd3ab('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xd3ab('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd3ab('0x5')],'defaultValue':moment()[_0xd3ab('0x6')](_0xd3ab('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd3ab('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd3ab('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xd3ab('0x8')](0x2)[_0xd3ab('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd3ab('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd3ab('0x8')],'unique':_0xd3ab('0xa')},'ListId':{'type':Sequelize[_0xd3ab('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xd3ab('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xd3ab('0x8')],'unique':_0xd3ab('0xa')},'CampaignId':{'type':Sequelize[_0xd3ab('0x8')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd3ab('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd3ab('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xd3ab('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd3ab('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xd3ab('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x88ab=['BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue','STRING','moment','sequelize','exports'];(function(_0x3aeb17,_0x2fb375){var _0x3e4ac3=function(_0x2ef73e){while(--_0x2ef73e){_0x3aeb17['push'](_0x3aeb17['shift']());}};_0x3e4ac3(++_0x2fb375);}(_0x88ab,0xad));var _0xb88a=function(_0x4f752f,_0x471641){_0x4f752f=_0x4f752f-0x0;var _0x593176=_0x88ab[_0x4f752f];return _0x593176;};'use strict';var moment=require(_0xb88a('0x0'));var Sequelize=require(_0xb88a('0x1'));module[_0xb88a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xb88a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xb88a('0x4')](_0xb88a('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb88a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb88a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb88a('0x7')]},'priority':{'type':Sequelize[_0xb88a('0x6')](0x2)[_0xb88a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb88a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb88a('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xb88a('0x9')},'UserId':{'type':Sequelize[_0xb88a('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xb88a('0x6')],'unique':_0xb88a('0x9')},'CampaignId':{'type':Sequelize[_0xb88a('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb88a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb88a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb88a('0xa')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb88a('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index bbd875a..2893548 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 _0x0e85=['json','offset','undefined','limit','count','update','then','sendStatus','error','stack','name','send','map','CmHopper','type','key','model','keys','query','intersection','filters','concat','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$notIn','$like','$notLike','$iLike','$contains','$contained','$any','fields','attributes','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','create','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','campaigntype','queue','ivr','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','CmContact','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','CmList','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../config/logger','api','status'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x0e85,0x7c));var _0x50e8=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x0e85[_0x173441];return _0x2423a8;};'use strict';var moment=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x50e8('0x2'))(_0x50e8('0x3'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x4ce6cd,_0x236cf3){_0x236cf3=_0x236cf3||0xc8;return function(_0x4e90e7){if(_0x4e90e7){return _0x4ce6cd[_0x50e8('0x4')](_0x236cf3)[_0x50e8('0x5')](_0x4e90e7);}};}function respondWithFilteredResult(_0xe3151e,_0xfde42){return function(_0x5e8b01){if(_0x5e8b01){var _0x3ce904=typeof _0xfde42[_0x50e8('0x6')]===_0x50e8('0x7')&&typeof _0xfde42[_0x50e8('0x8')]===_0x50e8('0x7');var _0x15f2bc=_0x5e8b01['count'];var _0x11717c=_0x3ce904?0x0:_0xfde42[_0x50e8('0x6')];var _0x19d1bc=_0x3ce904?_0x5e8b01[_0x50e8('0x9')]:_0xfde42[_0x50e8('0x6')]+_0xfde42[_0x50e8('0x8')];var _0x45dc6f;if(_0x19d1bc>=_0x15f2bc){_0x19d1bc=_0x15f2bc;_0x45dc6f=0xc8;}else{_0x45dc6f=0xce;}_0xe3151e[_0x50e8('0x4')](_0x45dc6f);return _0xe3151e['set']('Content-Range',_0x11717c+'-'+_0x19d1bc+'/'+_0x15f2bc)[_0x50e8('0x5')](_0x5e8b01);}return null;};}function saveUpdates(_0x24d381,_0x508377){return function(_0x49e02f){if(_0x49e02f){return _0x49e02f[_0x50e8('0xa')](_0x24d381)[_0x50e8('0xb')](function(_0x1a4c85){return _0x1a4c85;});}return null;};}function handleEntityNotFound(_0x473aa7,_0x54efd3){return function(_0x18596f){if(!_0x18596f){_0x473aa7[_0x50e8('0xc')](0x194);}return _0x18596f;};}function handleError(_0x24313d,_0x5c3baa){_0x5c3baa=_0x5c3baa||0x1f4;return function(_0x5524a3){logger[_0x50e8('0xd')](_0x5524a3[_0x50e8('0xe')]);if(_0x5524a3[_0x50e8('0xf')]){delete _0x5524a3[_0x50e8('0xf')];}_0x24313d[_0x50e8('0x4')](_0x5c3baa)[_0x50e8('0x10')](_0x5524a3);};}exports['index']=function(_0x5a5ef2,_0x441f25){var _0xc97063={},_0x40d060={},_0x45ce11={'count':0x0,'rows':[]};var _0x5dae4e=_[_0x50e8('0x11')](db[_0x50e8('0x12')]['rawAttributes'],function(_0x415596){return{'name':_0x415596['fieldName'],'type':_0x415596[_0x50e8('0x13')][_0x50e8('0x14')]};});_0x40d060[_0x50e8('0x15')]=_[_0x50e8('0x11')](_0x5dae4e,_0x50e8('0xf'));_0x40d060['query']=_[_0x50e8('0x16')](_0x5a5ef2[_0x50e8('0x17')]);_0x40d060['filters']=_[_0x50e8('0x18')](_0x40d060[_0x50e8('0x15')],_0x40d060['query']);_0x40d060[_0x50e8('0x19')]=_[_0x50e8('0x1a')](_0x40d060['filters'],['$and','$or',_0x50e8('0x1b'),_0x50e8('0x1c'),_0x50e8('0x1d'),_0x50e8('0x1e'),_0x50e8('0x1f'),_0x50e8('0x20'),'$not',_0x50e8('0x21'),_0x50e8('0x22'),'$in',_0x50e8('0x23'),_0x50e8('0x24'),_0x50e8('0x25'),_0x50e8('0x26'),'$notILike',_0x50e8('0x24'),'$overlap',_0x50e8('0x27'),_0x50e8('0x28'),_0x50e8('0x29')]);_0xc97063['attributes']=_[_0x50e8('0x18')](_0x40d060[_0x50e8('0x15')],qs[_0x50e8('0x2a')](_0x5a5ef2[_0x50e8('0x17')][_0x50e8('0x2a')]));_0xc97063[_0x50e8('0x2b')]=_0xc97063[_0x50e8('0x2b')]['length']?_0xc97063[_0x50e8('0x2b')]:_0x40d060[_0x50e8('0x15')];if(!_0x5a5ef2['query']['hasOwnProperty'](_0x50e8('0x2c'))){_0xc97063[_0x50e8('0x8')]=qs[_0x50e8('0x8')](_0x5a5ef2['query']['limit']);_0xc97063[_0x50e8('0x6')]=qs[_0x50e8('0x6')](_0x5a5ef2['query'][_0x50e8('0x6')]);}_0xc97063[_0x50e8('0x2d')]=qs[_0x50e8('0x2e')](_0x5a5ef2[_0x50e8('0x17')]['sort']);_0xc97063[_0x50e8('0x2f')]=qs['filters'](_[_0x50e8('0x30')](_0x5a5ef2[_0x50e8('0x17')],_0x40d060[_0x50e8('0x19')]),_0x5dae4e);if(_0x5a5ef2['query'][_0x50e8('0x31')]){_0xc97063[_0x50e8('0x2f')]=_['merge'](_0xc97063[_0x50e8('0x2f')],{'$or':_[_0x50e8('0x11')](_0x5dae4e,function(_0x5db19b){if(_0x5db19b[_0x50e8('0x13')]!=='VIRTUAL'){var _0x1c513c={};_0x1c513c[_0x5db19b[_0x50e8('0xf')]]={'$like':'%'+_0x5a5ef2[_0x50e8('0x17')][_0x50e8('0x31')]+'%'};return _0x1c513c;}})});}_0xc97063=_['merge']({},_0xc97063,_0x5a5ef2[_0x50e8('0x32')]);var _0x2d0ccf={'where':_0xc97063[_0x50e8('0x2f')]};return db['CmHopper']['count'](_0x2d0ccf)['then'](function(_0xd39553){_0x45ce11[_0x50e8('0x9')]=_0xd39553;if(_0x5a5ef2[_0x50e8('0x17')][_0x50e8('0x33')]){_0xc97063[_0x50e8('0x34')]=[{'all':!![]}];}return db[_0x50e8('0x12')][_0x50e8('0x35')](_0xc97063);})[_0x50e8('0xb')](function(_0x35f802){_0x45ce11[_0x50e8('0x36')]=_0x35f802;return _0x45ce11;})['then'](respondWithFilteredResult(_0x441f25,_0xc97063))[_0x50e8('0x37')](handleError(_0x441f25,null));};exports[_0x50e8('0x38')]=function(_0x2379cf,_0x2bf413){var _0x5dbbe1={'raw':!![],'where':{'id':_0x2379cf[_0x50e8('0x39')]['id']}},_0x443aa2={};_0x443aa2[_0x50e8('0x15')]=_[_0x50e8('0x16')](db[_0x50e8('0x12')]['rawAttributes']);_0x443aa2['query']=_[_0x50e8('0x16')](_0x2379cf[_0x50e8('0x17')]);_0x443aa2['filters']=_[_0x50e8('0x18')](_0x443aa2[_0x50e8('0x15')],_0x443aa2[_0x50e8('0x17')]);_0x5dbbe1[_0x50e8('0x2b')]=_[_0x50e8('0x18')](_0x443aa2[_0x50e8('0x15')],qs[_0x50e8('0x2a')](_0x2379cf[_0x50e8('0x17')]['fields']));_0x5dbbe1[_0x50e8('0x2b')]=_0x5dbbe1[_0x50e8('0x2b')][_0x50e8('0x3a')]?_0x5dbbe1[_0x50e8('0x2b')]:_0x443aa2['model'];if(_0x2379cf[_0x50e8('0x17')][_0x50e8('0x33')]){_0x5dbbe1[_0x50e8('0x34')]=[{'all':!![]}];}_0x5dbbe1=_[_0x50e8('0x3b')]({},_0x5dbbe1,_0x2379cf['options']);return db[_0x50e8('0x12')]['find'](_0x5dbbe1)['then'](handleEntityNotFound(_0x2bf413,null))['then'](respondWithResult(_0x2bf413,null))[_0x50e8('0x37')](handleError(_0x2bf413,null));};exports[_0x50e8('0x3c')]=function(_0x48f145,_0x6fef25){return db[_0x50e8('0x12')][_0x50e8('0x3c')](_0x48f145[_0x50e8('0x3d')],{})[_0x50e8('0xb')](respondWithResult(_0x6fef25,0xc9))[_0x50e8('0x37')](handleError(_0x6fef25,null));};exports['update']=function(_0x16fdf6,_0x596f62){if(_0x16fdf6[_0x50e8('0x3d')]['id']){delete _0x16fdf6[_0x50e8('0x3d')]['id'];}return db['CmHopper'][_0x50e8('0x3e')]({'where':{'id':_0x16fdf6['params']['id']}})[_0x50e8('0xb')](handleEntityNotFound(_0x596f62,null))[_0x50e8('0xb')](saveUpdates(_0x16fdf6[_0x50e8('0x3d')],null))[_0x50e8('0xb')](respondWithResult(_0x596f62,null))[_0x50e8('0x37')](handleError(_0x596f62,null));};exports[_0x50e8('0x3f')]=function(_0x229d60,_0x3e52b3){return db[_0x50e8('0x12')][_0x50e8('0x3f')]()[_0x50e8('0xb')](respondWithResult(_0x3e52b3,null))['catch'](handleError(_0x3e52b3,null));};exports[_0x50e8('0x40')]=function(_0x275a1b,_0x479431){var _0x3692ba;var _0x58f14e=_0x275a1b[_0x50e8('0x39')]['id'];return db['CmHopper'][_0x50e8('0x3e')]({'where':{'id':_0x275a1b[_0x50e8('0x39')]['id']}})[_0x50e8('0xb')](handleEntityNotFound(_0x479431,null))[_0x50e8('0xb')](function(_0x10b229){if(_0x10b229){return _0x10b229[_0x50e8('0x40')]()[_0x50e8('0xb')](function(_0x5f256a){return _0x5f256a;});}})[_0x50e8('0xb')](function(_0x212ece){_0x3692ba=_0x212ece;if(_0x212ece){if(_0x212ece[_0x50e8('0x41')]||_0x212ece[_0x50e8('0x42')]){return db[_0x212ece[_0x50e8('0x41')]?_0x50e8('0x43'):'Campaign'][_0x50e8('0x3e')]({'where':{'id':_0x212ece[_0x50e8('0x41')]?_0x212ece[_0x50e8('0x41')]:_0x212ece[_0x50e8('0x42')]},'attributes':['id','name'],'raw':!![]});}}})[_0x50e8('0xb')](function(_0x167b8f){var _0x3476c5={};if(_0x167b8f){_[_0x50e8('0x3b')](_0x3476c5,_[_0x50e8('0x44')](_0x3692ba[_0x50e8('0x45')],[_0x50e8('0x46'),'updatedAt','id']));_0x3476c5['state']=0x15;_0x3476c5['statedesc']=_0x50e8('0x47');_0x3476c5[_0x50e8('0x48')]=_0x167b8f[_0x50e8('0xf')];_0x3476c5[_0x50e8('0x49')]=_0x275a1b[_0x50e8('0x4a')][_0x50e8('0xf')];_0x3476c5['UserId']=_0x275a1b[_0x50e8('0x4a')]['id'];_0x3476c5[_0x50e8('0x47')]=!![];_0x3476c5[_0x50e8('0x4b')]=moment()[_0x50e8('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3476c5[_0x50e8('0x4d')]=_0x3692ba[_0x50e8('0x4e')];_0x3476c5[_0x50e8('0x4f')]=_0x3692ba[_0x50e8('0x41')]?_0x50e8('0x50'):_0x50e8('0x51');return db['CmContact'][_0x50e8('0x3e')]({'where':{'id':_0x3476c5['ContactId']},'attributes':['firstName','lastName']})[_0x50e8('0xb')](function(_0x49e96f){if(!_[_0x50e8('0x52')](_0x479431)&&!_[_0x50e8('0x52')](_0x49e96f[_0x50e8('0x53')])){_0x3476c5[_0x50e8('0x54')]=_0x49e96f[_0x50e8('0x53')];if(!_[_0x50e8('0x52')](_0x49e96f[_0x50e8('0x55')])){_0x3476c5['calleridname']+='\x20'+_0x49e96f[_0x50e8('0x55')];}}})[_0x50e8('0x56')](function(){return db[_0x50e8('0x57')]['create'](_0x3476c5);});}})['then'](function(_0x53dcdc){return db[_0x50e8('0x58')][_0x50e8('0x40')]({'where':{'CmHopperId':_0x58f14e}});})[_0x50e8('0xb')](function(){return _0x479431[_0x50e8('0x4')](0xcc)[_0x50e8('0x59')]();})[_0x50e8('0x37')](handleError(_0x479431,null));};exports['getPreview']=function(_0x42c2d0,_0x52d00b){var _0x255b48=[];return db[_0x50e8('0x5a')]['describe']()['then'](function(_0x51775a){_0x255b48=_[_0x50e8('0x16')](_0x51775a);return _0x42c2d0[_0x50e8('0x4a')]['getVoiceQueues']({'where':{'type':_0x50e8('0x5b'),'dialActive':!![],'dialMethod':_0x50e8('0x5c')},'attributes':['id',_0x50e8('0x5d'),_0x50e8('0x5e')],'raw':!![]});})[_0x50e8('0xb')](function(_0x47b428){if(_0x47b428&&_0x47b428[_0x50e8('0x3a')]){return db[_0x50e8('0x5f')][_0x50e8('0x60')](function(_0x4b80ac){var _0x583e58={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x50e8('0x4c')](_0x50e8('0x61'))},'VoiceQueueId':{'$in':_[_0x50e8('0x11')](_0x47b428,'id')},'$or':[{'UserId':null},{'UserId':_0x42c2d0[_0x50e8('0x4a')]['id']}]};var _0x2b59f5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x47b428)[_0x50e8('0x31')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x50e8('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x42c2d0['user']['id']}]};var _0x1fc530={'$or':[_0x583e58,_0x2b59f5]};var _0x36a288=[];if(_0x42c2d0['body'][_0x50e8('0x63')]&&_0x42c2d0['body']['direction']==='prev'){if(!_[_0x50e8('0x64')](_0x42c2d0[_0x50e8('0x3d')][_0x50e8('0x65')])){_0x1fc530['id']={'$in':_0x42c2d0[_0x50e8('0x3d')]['hopperIds']};}_0x36a288=[['priority',_0x50e8('0x66')],[_0x50e8('0x67'),_0x47b428[0x0][_0x50e8('0x5d')]===_0x50e8('0x66')?_0x50e8('0x68'):_0x50e8('0x66')],db[_0x50e8('0x5f')][_0x50e8('0x69')](_0x50e8('0x6a')),['id',_0x50e8('0x68')]];}else{if(!_[_0x50e8('0x64')](_0x42c2d0[_0x50e8('0x3d')][_0x50e8('0x65')])){_0x1fc530['id']={'$notIn':_0x42c2d0[_0x50e8('0x3d')][_0x50e8('0x65')]};}_0x36a288=[[_0x50e8('0x6b'),_0x50e8('0x68')],[_0x50e8('0x67'),_0x47b428[0x0]['dialOrderByScheduledAt']],db[_0x50e8('0x5f')][_0x50e8('0x69')](_0x50e8('0x6c')),['id',_0x50e8('0x66')]];}return db['CmHopper'][_0x50e8('0x6d')]({'attributes':['id',_0x50e8('0x6e'),_0x50e8('0x4e'),_0x50e8('0x6f')],'where':_0x1fc530,'order':_0x36a288,'transaction':_0x4b80ac,'lock':_0x4b80ac[_0x50e8('0x70')][_0x50e8('0x71')],'include':[{'model':db['CmContact'],'as':_0x50e8('0x72'),'attributes':_0x255b48,'include':[{'model':db[_0x50e8('0x73')],'as':_0x50e8('0x74'),'attributes':['id',_0x50e8('0xf')]}]},{'model':db['CmList'],'as':_0x50e8('0x75'),'attributes':['id','name']},{'model':db[_0x50e8('0x43')],'as':_0x50e8('0x76'),'attributes':['id',_0x50e8('0xf'),_0x50e8('0x77')]}]})[_0x50e8('0xb')](function(_0x581d02){if(_0x581d02){return _0x581d02[_0x50e8('0xa')]({'UserId':_0x42c2d0[_0x50e8('0x4a')]['id']},{'transaction':_0x4b80ac});}});});}})[_0x50e8('0xb')](handleEntityNotFound(_0x52d00b,null))[_0x50e8('0xb')](respondWithResult(_0x52d00b,null))[_0x50e8('0x37')](handleError(_0x52d00b,null));};exports[_0x50e8('0x78')]=function(_0x58541c,_0x248f73,_0x1cc566){var _0x4fc73d=[];var _0x2d35ab=_0x58541c[_0x50e8('0x39')]['id'];var _0x4f72e7=_0x58541c[_0x50e8('0x4a')]['id'];return db['CmContact'][_0x50e8('0x3f')]()[_0x50e8('0xb')](function(_0x5f20dc){_0x4fc73d=_[_0x50e8('0x16')](_0x5f20dc);return db[_0x50e8('0x5f')][_0x50e8('0x60')](function(_0x10bdad){const _0x5df5e8={'id':_0x2d35ab};return db[_0x50e8('0x12')]['findOne']({'attributes':['id',_0x50e8('0x6e'),_0x50e8('0x6f')],'where':_0x5df5e8,'transaction':_0x10bdad,'lock':_0x10bdad['LOCK'][_0x50e8('0x71')],'include':[{'model':db[_0x50e8('0x5a')],'as':_0x50e8('0x72'),'attributes':_0x4fc73d,'include':[{'model':db[_0x50e8('0x73')],'as':_0x50e8('0x74'),'attributes':['id',_0x50e8('0xf')]}]},{'model':db[_0x50e8('0x79')],'as':_0x50e8('0x75'),'attributes':['id',_0x50e8('0xf')]},{'model':db['VoiceQueue'],'as':_0x50e8('0x76'),'attributes':['id',_0x50e8('0xf'),_0x50e8('0x77')]}]})['then'](function(_0x7d64e0){if(_0x7d64e0){return _0x7d64e0[_0x50e8('0xa')]({'UserId':_0x4f72e7},{'transaction':_0x10bdad});}});});})[_0x50e8('0xb')](handleEntityNotFound(_0x248f73,null))['then'](respondWithResult(_0x248f73,null))['catch'](handleError(_0x248f73,null));};exports[_0x50e8('0x7a')]=function(_0x440fc7,_0x5d922b){return _0x440fc7[_0x50e8('0x4a')]['getVoiceQueues']({'where':{'type':_0x50e8('0x5b'),'dialActive':!![],'dialMethod':_0x50e8('0x5c')},'attributes':['id'],'raw':!![]})[_0x50e8('0xb')](function(_0x157b27){if(_0x157b27&&_0x157b27['length']){return db[_0x50e8('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x50e8('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x157b27,'id')},'$or':[{'UserId':null},{'UserId':_0x440fc7[_0x50e8('0x4a')]['id']}]}});}return 0x0;})[_0x50e8('0xb')](function(_0x4a98c9){if(!_[_0x50e8('0x52')](_0x4a98c9)&&_['isNumber'](_0x4a98c9)){return _0x5d922b[_0x50e8('0x4')](0xc8)['json']({'contacts':_0x4a98c9});}else{logger['error'](_0x50e8('0x7b'),_0x50e8('0x7a'),0x194,_0x50e8('0x7c'));_0x5d922b[_0x50e8('0xc')](0x194);}})['catch'](handleError(_0x5d922b,null));};exports[_0x50e8('0x7d')]=function(_0x4ecec9,_0x4a6075){var _0x32879a=shared[_0x50e8('0x7e')];var _0x35def7=[];_['map'](_0x32879a,function(_0x4f6906){_0x35def7['push']({'id':_0x4f6906[_0x50e8('0xf')],'name':_0x4f6906[_0x50e8('0xf')],'utcOffset':_0x4f6906[_0x50e8('0x7f')]});});return _0x4a6075[_0x50e8('0x4')](0xc8)[_0x50e8('0x5')]({'tz':_0x35def7});};exports[_0x50e8('0x80')]=function(_0x500cdd,_0x5a7248){var _0x2e24=shared[_0x50e8('0x7e')];var _0xab3ba={};if(!_[_0x50e8('0x52')](_0x2e24[_0x500cdd[_0x50e8('0x3d')]['id']]))_0xab3ba=_0x2e24[_0x500cdd['body']['id']];return _0x5a7248[_0x50e8('0x4')](0xc8)[_0x50e8('0x5')](_0xab3ba);}; \ No newline at end of file +var _0x29d4=['scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','CmList','VoiceQueue','dialActive','getPreviewRecall','findOne','Company','List','Queue','getVoiceQueues','isNumber','entity\x20not\x20found','timezones','push','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','$and','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','keys','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','ASC'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x29d4,0x1a1));var _0x429d=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x29d4[_0x32d457];return _0x338386;};'use strict';var moment=require(_0x429d('0x0'));var _=require('lodash');var qs=require(_0x429d('0x1'));var logger=require(_0x429d('0x2'))(_0x429d('0x3'));var shared=require(_0x429d('0x4'));var db=require(_0x429d('0x5'))['db'];function respondWithResult(_0x4e287b,_0xc3989d){_0xc3989d=_0xc3989d||0xc8;return function(_0x3f43f5){if(_0x3f43f5){return _0x4e287b[_0x429d('0x6')](_0xc3989d)[_0x429d('0x7')](_0x3f43f5);}};}function respondWithFilteredResult(_0x1c55aa,_0xa71445){return function(_0x56aa2f){if(_0x56aa2f){var _0x1ede3f=typeof _0xa71445['offset']===_0x429d('0x8')&&typeof _0xa71445['limit']===_0x429d('0x8');var _0x207dee=_0x56aa2f[_0x429d('0x9')];var _0x5e8430=_0x1ede3f?0x0:_0xa71445[_0x429d('0xa')];var _0x8c7cb6=_0x1ede3f?_0x56aa2f['count']:_0xa71445[_0x429d('0xa')]+_0xa71445[_0x429d('0xb')];var _0x417f77;if(_0x8c7cb6>=_0x207dee){_0x8c7cb6=_0x207dee;_0x417f77=0xc8;}else{_0x417f77=0xce;}_0x1c55aa['status'](_0x417f77);return _0x1c55aa[_0x429d('0xc')](_0x429d('0xd'),_0x5e8430+'-'+_0x8c7cb6+'/'+_0x207dee)[_0x429d('0x7')](_0x56aa2f);}return null;};}function saveUpdates(_0x1cb1cf,_0x4843af){return function(_0x1c542c){if(_0x1c542c){return _0x1c542c[_0x429d('0xe')](_0x1cb1cf)[_0x429d('0xf')](function(_0x56bf5d){return _0x56bf5d;});}return null;};}function handleEntityNotFound(_0x315d8d,_0x5dc247){return function(_0x5c32ab){if(!_0x5c32ab){_0x315d8d[_0x429d('0x10')](0x194);}return _0x5c32ab;};}function handleError(_0x2b9411,_0x1bfbdb){_0x1bfbdb=_0x1bfbdb||0x1f4;return function(_0x2ee97b){logger[_0x429d('0x11')](_0x2ee97b[_0x429d('0x12')]);if(_0x2ee97b['name']){delete _0x2ee97b[_0x429d('0x13')];}_0x2b9411['status'](_0x1bfbdb)[_0x429d('0x14')](_0x2ee97b);};}exports[_0x429d('0x15')]=function(_0x4eef9d,_0x2dc57a){var _0x51ef88={},_0x240a7d={},_0xc80aab={'count':0x0,'rows':[]};var _0x2b9e78=_['map'](db[_0x429d('0x16')][_0x429d('0x17')],function(_0x202c4e){return{'name':_0x202c4e[_0x429d('0x18')],'type':_0x202c4e[_0x429d('0x19')][_0x429d('0x1a')]};});_0x240a7d['model']=_[_0x429d('0x1b')](_0x2b9e78,_0x429d('0x13'));_0x240a7d[_0x429d('0x1c')]=_['keys'](_0x4eef9d[_0x429d('0x1c')]);_0x240a7d[_0x429d('0x1d')]=_[_0x429d('0x1e')](_0x240a7d[_0x429d('0x1f')],_0x240a7d[_0x429d('0x1c')]);_0x240a7d[_0x429d('0x1d')]=_['concat'](_0x240a7d[_0x429d('0x1d')],[_0x429d('0x20'),'$or',_0x429d('0x21'),_0x429d('0x22'),_0x429d('0x23'),_0x429d('0x24'),'$ne',_0x429d('0x25'),_0x429d('0x26'),_0x429d('0x27'),_0x429d('0x28'),_0x429d('0x29'),'$notIn',_0x429d('0x2a'),_0x429d('0x2b'),_0x429d('0x2c'),_0x429d('0x2d'),_0x429d('0x2a'),_0x429d('0x2e'),_0x429d('0x2f'),_0x429d('0x30'),_0x429d('0x31')]);_0x51ef88['attributes']=_[_0x429d('0x1e')](_0x240a7d[_0x429d('0x1f')],qs['fields'](_0x4eef9d[_0x429d('0x1c')][_0x429d('0x32')]));_0x51ef88[_0x429d('0x33')]=_0x51ef88[_0x429d('0x33')][_0x429d('0x34')]?_0x51ef88['attributes']:_0x240a7d[_0x429d('0x1f')];if(!_0x4eef9d[_0x429d('0x1c')][_0x429d('0x35')](_0x429d('0x36'))){_0x51ef88[_0x429d('0xb')]=qs[_0x429d('0xb')](_0x4eef9d['query']['limit']);_0x51ef88[_0x429d('0xa')]=qs[_0x429d('0xa')](_0x4eef9d['query']['offset']);}_0x51ef88[_0x429d('0x37')]=qs['sort'](_0x4eef9d[_0x429d('0x1c')][_0x429d('0x38')]);_0x51ef88[_0x429d('0x39')]=qs[_0x429d('0x1d')](_['pick'](_0x4eef9d[_0x429d('0x1c')],_0x240a7d[_0x429d('0x1d')]),_0x2b9e78);if(_0x4eef9d['query']['filter']){_0x51ef88['where']=_['merge'](_0x51ef88['where'],{'$or':_[_0x429d('0x1b')](_0x2b9e78,function(_0x4c5be1){if(_0x4c5be1['type']!==_0x429d('0x3a')){var _0x3e70bf={};_0x3e70bf[_0x4c5be1[_0x429d('0x13')]]={'$like':'%'+_0x4eef9d[_0x429d('0x1c')][_0x429d('0x3b')]+'%'};return _0x3e70bf;}})});}_0x51ef88=_[_0x429d('0x3c')]({},_0x51ef88,_0x4eef9d['options']);var _0x423dc8={'where':_0x51ef88[_0x429d('0x39')]};return db[_0x429d('0x16')][_0x429d('0x9')](_0x423dc8)[_0x429d('0xf')](function(_0x391d5f){_0xc80aab[_0x429d('0x9')]=_0x391d5f;if(_0x4eef9d[_0x429d('0x1c')][_0x429d('0x3d')]){_0x51ef88[_0x429d('0x3e')]=[{'all':!![]}];}return db[_0x429d('0x16')][_0x429d('0x3f')](_0x51ef88);})[_0x429d('0xf')](function(_0x10ecb8){_0xc80aab[_0x429d('0x40')]=_0x10ecb8;return _0xc80aab;})[_0x429d('0xf')](respondWithFilteredResult(_0x2dc57a,_0x51ef88))['catch'](handleError(_0x2dc57a,null));};exports['show']=function(_0x44a137,_0x346e65){var _0x569811={'raw':!![],'where':{'id':_0x44a137[_0x429d('0x41')]['id']}},_0x2ea43a={};_0x2ea43a[_0x429d('0x1f')]=_['keys'](db['CmHopper'][_0x429d('0x17')]);_0x2ea43a[_0x429d('0x1c')]=_['keys'](_0x44a137[_0x429d('0x1c')]);_0x2ea43a[_0x429d('0x1d')]=_['intersection'](_0x2ea43a[_0x429d('0x1f')],_0x2ea43a['query']);_0x569811[_0x429d('0x33')]=_[_0x429d('0x1e')](_0x2ea43a[_0x429d('0x1f')],qs[_0x429d('0x32')](_0x44a137['query'][_0x429d('0x32')]));_0x569811[_0x429d('0x33')]=_0x569811[_0x429d('0x33')]['length']?_0x569811['attributes']:_0x2ea43a[_0x429d('0x1f')];if(_0x44a137[_0x429d('0x1c')][_0x429d('0x3d')]){_0x569811[_0x429d('0x3e')]=[{'all':!![]}];}_0x569811=_['merge']({},_0x569811,_0x44a137[_0x429d('0x42')]);return db[_0x429d('0x16')][_0x429d('0x43')](_0x569811)[_0x429d('0xf')](handleEntityNotFound(_0x346e65,null))[_0x429d('0xf')](respondWithResult(_0x346e65,null))[_0x429d('0x44')](handleError(_0x346e65,null));};exports[_0x429d('0x45')]=function(_0x3d9f02,_0x271399){return db[_0x429d('0x16')]['create'](_0x3d9f02[_0x429d('0x46')],{})['then'](respondWithResult(_0x271399,0xc9))['catch'](handleError(_0x271399,null));};exports['update']=function(_0xdb38d8,_0x134514){if(_0xdb38d8['body']['id']){delete _0xdb38d8[_0x429d('0x46')]['id'];}return db[_0x429d('0x16')]['find']({'where':{'id':_0xdb38d8[_0x429d('0x41')]['id']}})[_0x429d('0xf')](handleEntityNotFound(_0x134514,null))[_0x429d('0xf')](saveUpdates(_0xdb38d8[_0x429d('0x46')],null))[_0x429d('0xf')](respondWithResult(_0x134514,null))['catch'](handleError(_0x134514,null));};exports[_0x429d('0x47')]=function(_0xd9451b,_0x21bf06){return db[_0x429d('0x16')]['describe']()[_0x429d('0xf')](respondWithResult(_0x21bf06,null))[_0x429d('0x44')](handleError(_0x21bf06,null));};exports[_0x429d('0x48')]=function(_0x58b6c7,_0x471ba5){var _0x545d43;var _0x548f71=_0x58b6c7[_0x429d('0x41')]['id'];return db[_0x429d('0x16')]['find']({'where':{'id':_0x58b6c7['params']['id']}})[_0x429d('0xf')](handleEntityNotFound(_0x471ba5,null))['then'](function(_0x3a15d0){if(_0x3a15d0){return _0x3a15d0[_0x429d('0x48')]()[_0x429d('0xf')](function(_0x25121e){return _0x25121e;});}})[_0x429d('0xf')](function(_0x10dec8){_0x545d43=_0x10dec8;if(_0x10dec8){if(_0x10dec8[_0x429d('0x49')]||_0x10dec8[_0x429d('0x4a')]){return db[_0x10dec8['VoiceQueueId']?'VoiceQueue':_0x429d('0x4b')][_0x429d('0x43')]({'where':{'id':_0x10dec8[_0x429d('0x49')]?_0x10dec8[_0x429d('0x49')]:_0x10dec8['CampaignId']},'attributes':['id',_0x429d('0x13')],'raw':!![]});}}})[_0x429d('0xf')](function(_0x2caf41){var _0x46e097={};if(_0x2caf41){_[_0x429d('0x3c')](_0x46e097,_[_0x429d('0x4c')](_0x545d43[_0x429d('0x4d')],[_0x429d('0x4e'),_0x429d('0x4f'),'id']));_0x46e097[_0x429d('0x50')]=0x15;_0x46e097['statedesc']=_0x429d('0x51');_0x46e097[_0x429d('0x52')]=_0x2caf41[_0x429d('0x13')];_0x46e097[_0x429d('0x53')]=_0x58b6c7[_0x429d('0x54')][_0x429d('0x13')];_0x46e097[_0x429d('0x55')]=_0x58b6c7['user']['id'];_0x46e097[_0x429d('0x51')]=!![];_0x46e097[_0x429d('0x56')]=moment()[_0x429d('0x57')](_0x429d('0x58'));_0x46e097['calleridnum']=_0x545d43[_0x429d('0x59')];_0x46e097['campaigntype']=_0x545d43[_0x429d('0x49')]?'queue':'ivr';return db[_0x429d('0x5a')][_0x429d('0x43')]({'where':{'id':_0x46e097['ContactId']},'attributes':[_0x429d('0x5b'),_0x429d('0x5c')]})['then'](function(_0x213b7b){if(!_[_0x429d('0x5d')](_0x471ba5)&&!_[_0x429d('0x5d')](_0x213b7b[_0x429d('0x5b')])){_0x46e097['calleridname']=_0x213b7b[_0x429d('0x5b')];if(!_[_0x429d('0x5d')](_0x213b7b[_0x429d('0x5c')])){_0x46e097[_0x429d('0x5e')]+='\x20'+_0x213b7b[_0x429d('0x5c')];}}})[_0x429d('0x5f')](function(){return db[_0x429d('0x60')][_0x429d('0x45')](_0x46e097);});}})[_0x429d('0xf')](function(_0x3f4da9){return db[_0x429d('0x61')][_0x429d('0x48')]({'where':{'CmHopperId':_0x548f71}});})[_0x429d('0xf')](function(){return _0x471ba5[_0x429d('0x6')](0xcc)[_0x429d('0x62')]();})[_0x429d('0x44')](handleError(_0x471ba5,null));};exports['getPreview']=function(_0x18f3be,_0x1c20ae){var _0x57d0ca=[];return db[_0x429d('0x5a')][_0x429d('0x47')]()['then'](function(_0x1a9119){_0x57d0ca=_[_0x429d('0x63')](_0x1a9119);return _0x18f3be[_0x429d('0x54')]['getVoiceQueues']({'where':{'type':_0x429d('0x64'),'dialActive':!![],'dialMethod':_0x429d('0x65')},'attributes':['id',_0x429d('0x66'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x429d('0xf')](function(_0x43f7ab){if(_0x43f7ab&&_0x43f7ab[_0x429d('0x34')]){return db[_0x429d('0x67')][_0x429d('0x68')](function(_0x75686c){var _0x389d22={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x429d('0x57')](_0x429d('0x58'))},'VoiceQueueId':{'$in':_[_0x429d('0x1b')](_0x43f7ab,'id')},'$or':[{'UserId':null},{'UserId':_0x18f3be[_0x429d('0x54')]['id']}]};var _0x4cc426={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43f7ab)[_0x429d('0x3b')]([_0x429d('0x69'),0x0])[_0x429d('0x1b')]('id')[_0x429d('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x18f3be[_0x429d('0x54')]['id']}]};var _0x5c4f70={'$or':[_0x389d22,_0x4cc426]};var _0x13b777=[];if(_0x18f3be[_0x429d('0x46')][_0x429d('0x6b')]&&_0x18f3be['body'][_0x429d('0x6b')]===_0x429d('0x6c')){if(!_[_0x429d('0x6d')](_0x18f3be[_0x429d('0x46')]['hopperIds'])){_0x5c4f70['id']={'$in':_0x18f3be['body']['hopperIds']};}_0x13b777=[['priority',_0x429d('0x6e')],[_0x429d('0x6f'),_0x43f7ab[0x0][_0x429d('0x66')]===_0x429d('0x6e')?_0x429d('0x70'):'ASC'],db[_0x429d('0x67')][_0x429d('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x429d('0x70')]];}else{if(!_['isEmpty'](_0x18f3be['body']['hopperIds'])){_0x5c4f70['id']={'$notIn':_0x18f3be[_0x429d('0x46')]['hopperIds']};}_0x13b777=[['priority',_0x429d('0x70')],[_0x429d('0x6f'),_0x43f7ab[0x0][_0x429d('0x66')]],db[_0x429d('0x67')][_0x429d('0x71')](_0x429d('0x72')),['id','ASC']];}return db[_0x429d('0x16')]['findOne']({'attributes':['id',_0x429d('0x73'),_0x429d('0x59'),_0x429d('0x74')],'where':_0x5c4f70,'order':_0x13b777,'transaction':_0x75686c,'lock':_0x75686c[_0x429d('0x75')][_0x429d('0x76')],'include':[{'model':db[_0x429d('0x5a')],'as':'Contact','attributes':_0x57d0ca,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x429d('0x13')]}]},{'model':db[_0x429d('0x77')],'as':'List','attributes':['id',_0x429d('0x13')]},{'model':db[_0x429d('0x78')],'as':'Queue','attributes':['id','name',_0x429d('0x79')]}]})['then'](function(_0x1b1a28){if(_0x1b1a28){return _0x1b1a28[_0x429d('0xe')]({'UserId':_0x18f3be['user']['id']},{'transaction':_0x75686c});}});});}})[_0x429d('0xf')](handleEntityNotFound(_0x1c20ae,null))[_0x429d('0xf')](respondWithResult(_0x1c20ae,null))['catch'](handleError(_0x1c20ae,null));};exports[_0x429d('0x7a')]=function(_0x161e4f,_0x756d3f,_0x430e69){var _0x3025f6=[];var _0x2c686e=_0x161e4f[_0x429d('0x41')]['id'];var _0x86c0d8=_0x161e4f['user']['id'];return db[_0x429d('0x5a')][_0x429d('0x47')]()['then'](function(_0x1a1257){_0x3025f6=_[_0x429d('0x63')](_0x1a1257);return db[_0x429d('0x67')][_0x429d('0x68')](function(_0x114488){const _0x205044={'id':_0x2c686e};return db['CmHopper'][_0x429d('0x7b')]({'attributes':['id',_0x429d('0x73'),'recallme'],'where':_0x205044,'transaction':_0x114488,'lock':_0x114488[_0x429d('0x75')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x3025f6,'include':[{'model':db['CmCompany'],'as':_0x429d('0x7c'),'attributes':['id',_0x429d('0x13')]}]},{'model':db[_0x429d('0x77')],'as':_0x429d('0x7d'),'attributes':['id',_0x429d('0x13')]},{'model':db['VoiceQueue'],'as':_0x429d('0x7e'),'attributes':['id',_0x429d('0x13'),_0x429d('0x79')]}]})[_0x429d('0xf')](function(_0x4356f0){if(_0x4356f0){return _0x4356f0['update']({'UserId':_0x86c0d8},{'transaction':_0x114488});}});});})[_0x429d('0xf')](handleEntityNotFound(_0x756d3f,null))[_0x429d('0xf')](respondWithResult(_0x756d3f,null))[_0x429d('0x44')](handleError(_0x756d3f,null));};exports['getOpenContacts']=function(_0x1d464a,_0x225533){return _0x1d464a[_0x429d('0x54')][_0x429d('0x7f')]({'where':{'type':_0x429d('0x64'),'dialActive':!![],'dialMethod':_0x429d('0x65')},'attributes':['id'],'raw':!![]})['then'](function(_0x5397f0){if(_0x5397f0&&_0x5397f0['length']){return db[_0x429d('0x16')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x429d('0x57')](_0x429d('0x58'))},'VoiceQueueId':{'$in':_['map'](_0x5397f0,'id')},'$or':[{'UserId':null},{'UserId':_0x1d464a['user']['id']}]}});}return 0x0;})[_0x429d('0xf')](function(_0x10ec8a){if(!_[_0x429d('0x5d')](_0x10ec8a)&&_[_0x429d('0x80')](_0x10ec8a)){return _0x225533[_0x429d('0x6')](0xc8)[_0x429d('0x7')]({'contacts':_0x10ec8a});}else{logger[_0x429d('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x429d('0x81'));_0x225533[_0x429d('0x10')](0x194);}})[_0x429d('0x44')](handleError(_0x225533,null));};exports['getTimezones']=function(_0x5a7ae0,_0x36faa7){var _0x181663=shared[_0x429d('0x82')];var _0x288ee2=[];_[_0x429d('0x1b')](_0x181663,function(_0x3c5058){_0x288ee2[_0x429d('0x83')]({'id':_0x3c5058[_0x429d('0x13')],'name':_0x3c5058['name'],'utcOffset':_0x3c5058['utcOffset']});});return _0x36faa7[_0x429d('0x6')](0xc8)[_0x429d('0x7')]({'tz':_0x288ee2});};exports['getTimezone']=function(_0x1a767a,_0x4758ba){var _0x1b76e3=shared[_0x429d('0x82')];var _0x3da35a={};if(!_[_0x429d('0x5d')](_0x1b76e3[_0x1a767a['body']['id']]))_0x3da35a=_0x1b76e3[_0x1a767a['body']['id']];return _0x4758ba['status'](0xc8)['json'](_0x3da35a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 9d6eb60..c8c49db 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 _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x2646a5,_0x1b5c85){var _0x22d33c=function(_0xee2db1){while(--_0xee2db1){_0x2646a5['push'](_0x2646a5['shift']());}};_0x22d33c(++_0x1b5c85);}(_0xfcf0,0x138));var _0x0fcf=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xfcf0[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x236e52,_0x6853a7){var _0xe70ceb=function(_0x2c369c){while(--_0x2c369c){_0x236e52['push'](_0x236e52['shift']());}};_0xe70ceb(++_0x6853a7);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0xfdbd[_0x1ce9ea];return _0x2a95b9;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 5051726..d13cf4f 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 _0x737e=['moment','bluebird','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','body','info','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','User','Agent','name','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','UPDATE','keys','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','CmList','List','lodash','util'];(function(_0x2478cf,_0x16f120){var _0x3e2ffa=function(_0x3caaf2){while(--_0x3caaf2){_0x2478cf['push'](_0x2478cf['shift']());}};_0x3e2ffa(++_0x16f120);}(_0x737e,0x1cc));var _0xe737=function(_0x4700dd,_0x539906){_0x4700dd=_0x4700dd-0x0;var _0x12f6e7=_0x737e[_0x4700dd];return _0x12f6e7;};'use strict';var _=require(_0xe737('0x0'));var util=require(_0xe737('0x1'));var moment=require(_0xe737('0x2'));var BPromise=require(_0xe737('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xe737('0x4'))('rpc');exports[_0xe737('0x5')]=function(_0x5ac07a){var _0x519c54=this;return new Promise(function(_0x137e20,_0x3668ae){return db[_0xe737('0x6')][_0xe737('0x7')]({'raw':_0x5ac07a[_0xe737('0x8')]?_0x5ac07a['options'][_0xe737('0x9')]===undefined?!![]:![]:!![],'where':_0x5ac07a['options']?_0x5ac07a[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':_0x5ac07a[_0xe737('0x8')]?_0x5ac07a['options'][_0xe737('0xb')]||null:null,'limit':_0x5ac07a['options']?_0x5ac07a[_0xe737('0x8')][_0xe737('0xc')]||null:null,'include':_0x5ac07a[_0xe737('0x8')]?_0x5ac07a[_0xe737('0x8')][_0xe737('0xd')]?_[_0xe737('0xe')](_0x5ac07a[_0xe737('0x8')][_0xe737('0xd')],function(_0x34ad12){return{'model':db[_0x34ad12[_0xe737('0xf')]],'as':_0x34ad12['as'],'attributes':_0x34ad12[_0xe737('0xb')],'include':_0x34ad12[_0xe737('0xd')]?_[_0xe737('0xe')](_0x34ad12['include'],function(_0x394904){return{'model':db[_0x394904[_0xe737('0xf')]],'as':_0x394904['as'],'attributes':_0x394904[_0xe737('0xb')],'include':_0x394904[_0xe737('0xd')]?_[_0xe737('0xe')](_0x394904[_0xe737('0xd')],function(_0x16c99d){return{'model':db[_0x16c99d[_0xe737('0xf')]],'as':_0x16c99d['as'],'attributes':_0x16c99d[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe737('0x10')](function(_0x26b831){logger['info'](_0xe737('0x5'),_0x5ac07a);logger[_0xe737('0x11')]('GetCmHopper',_0x5ac07a,JSON[_0xe737('0x12')](_0x26b831));_0x137e20(_0x26b831);})[_0xe737('0x13')](function(_0xb6f570){logger[_0xe737('0x14')]('GetCmHopper',_0xb6f570[_0xe737('0x15')],_0x5ac07a);_0x3668ae(_0x519c54[_0xe737('0x14')](0x1f4,_0xb6f570[_0xe737('0x15')]));});});};exports[_0xe737('0x16')]=function(_0x1540eb){var _0x5de660=this;return new Promise(function(_0x28842a,_0x7d7d6f){return db[_0xe737('0x6')][_0xe737('0x17')]({'raw':_0x1540eb[_0xe737('0x8')]?_0x1540eb[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'where':_0x1540eb[_0xe737('0x8')]?_0x1540eb['options'][_0xe737('0xa')]||null:null,'attributes':_0x1540eb[_0xe737('0x8')]?_0x1540eb['options'][_0xe737('0xb')]||null:null,'include':_0x1540eb[_0xe737('0x8')]?_0x1540eb[_0xe737('0x8')][_0xe737('0xd')]?_[_0xe737('0xe')](_0x1540eb[_0xe737('0x8')][_0xe737('0xd')],function(_0x5c8794){return{'model':db[_0x5c8794['model']],'as':_0x5c8794['as'],'attributes':_0x5c8794[_0xe737('0xb')],'include':_0x5c8794[_0xe737('0xd')]?_[_0xe737('0xe')](_0x5c8794['include'],function(_0x49650c){return{'model':db[_0x49650c[_0xe737('0xf')]],'as':_0x49650c['as'],'attributes':_0x49650c[_0xe737('0xb')],'include':_0x49650c[_0xe737('0xd')]?_['map'](_0x49650c[_0xe737('0xd')],function(_0x3ad39c){return{'model':db[_0x3ad39c[_0xe737('0xf')]],'as':_0x3ad39c['as'],'attributes':_0x3ad39c[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe737('0x10')](function(_0x1eb619){logger['info']('ShowCmHopper',_0x1540eb);logger[_0xe737('0x11')](_0xe737('0x16'),_0x1540eb,JSON[_0xe737('0x12')](_0x1eb619));_0x28842a(_0x1eb619);})[_0xe737('0x13')](function(_0x55fe02){logger[_0xe737('0x14')](_0xe737('0x16'),_0x55fe02['message'],_0x1540eb);_0x7d7d6f(_0x5de660['error'](0x1f4,_0x55fe02[_0xe737('0x15')]));});});};exports[_0xe737('0x18')]=function(_0x1cbc47){var _0x1edbec=this;return new Promise(function(_0x454db6,_0x440f0c){return db[_0xe737('0x6')][_0xe737('0x19')](_0x1cbc47[_0xe737('0x1a')],{'raw':_0x1cbc47['options']?_0x1cbc47[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![]})[_0xe737('0x10')](function(_0x27c929){logger[_0xe737('0x1b')](_0xe737('0x18'),_0x1cbc47);logger[_0xe737('0x11')]('CreateCmHopper',_0x1cbc47,JSON[_0xe737('0x12')](_0x27c929));_0x454db6(_0x27c929);})[_0xe737('0x13')](function(_0x365e89){logger['error'](_0xe737('0x18'),_0x365e89['message'],_0x1cbc47);_0x440f0c(_0x1edbec[_0xe737('0x14')](0x1f4,_0x365e89[_0xe737('0x15')]));});});};exports['UpdateCmHopper']=function(_0x5686d1){var _0x3f0c5d=this;return new Promise(function(_0x5912c9,_0x10400f){return db['CmHopper'][_0xe737('0x1c')](_0x5686d1[_0xe737('0x1a')],{'raw':_0x5686d1[_0xe737('0x8')]?_0x5686d1[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5686d1['options']?_0x5686d1[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':_0x5686d1[_0xe737('0x8')]?_0x5686d1[_0xe737('0x8')][_0xe737('0xb')]||null:null,'limit':_0x5686d1[_0xe737('0x8')]?_0x5686d1[_0xe737('0x8')][_0xe737('0xc')]||null:null})['then'](function(_0x3e114c){logger[_0xe737('0x1b')](_0xe737('0x1d'),_0x5686d1);logger['info'](_0xe737('0x1e'),JSON[_0xe737('0x12')](_0x5686d1[_0xe737('0x8')][_0xe737('0xa')]),_0x5686d1['body'][_0xe737('0x1f')]);logger[_0xe737('0x11')]('UpdateCmHopper',_0x5686d1,JSON[_0xe737('0x12')](_0x3e114c));_0x5912c9(_0x3e114c);})[_0xe737('0x13')](function(_0xb0d044){logger[_0xe737('0x14')](_0xe737('0x1d'),_0xb0d044[_0xe737('0x15')],_0x5686d1);_0x10400f(_0x3f0c5d[_0xe737('0x14')](0x1f4,_0xb0d044['message']));});});};exports[_0xe737('0x20')]=function(_0x5138bc){var _0x3329f6=this;return new Promise(function(_0x1dd101,_0x17d034){return db[_0xe737('0x6')]['destroy']({'where':_0x5138bc[_0xe737('0x8')]?_0x5138bc[_0xe737('0x8')][_0xe737('0xa')]||null:null})[_0xe737('0x10')](function(_0x2061d9){logger['info']('DestroyCmHopper',_0x5138bc);logger[_0xe737('0x11')](_0xe737('0x20'),_0x5138bc,JSON[_0xe737('0x12')](_0x2061d9));_0x1dd101(_0x2061d9);})[_0xe737('0x13')](function(_0x677379){logger['error']('DestroyCmHopper',_0x677379[_0xe737('0x15')],_0x5138bc);_0x17d034(_0x3329f6[_0xe737('0x14')](0x1f4,_0x677379[_0xe737('0x15')]));});});};exports[_0xe737('0x21')]=function(_0x5ee413){var _0x522987=this;return new Promise(function(_0xd8622f,_0x3ca1bd){return db[_0xe737('0x22')][_0xe737('0x23')]()[_0xe737('0x10')](function(_0x50c981){return db[_0xe737('0x24')][_0xe737('0x25')](function(_0x2dc516){return db[_0xe737('0x6')][_0xe737('0x7')]({'where':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0xb')]||null:null,'limit':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0xc')]||null:null,'order':_0x5ee413[_0xe737('0x8')]?_0x5ee413[_0xe737('0x8')][_0xe737('0x26')]||null:null,'transaction':_0x2dc516,'lock':_0x2dc516[_0xe737('0x27')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xe737('0x28'),'attributes':_['keys'](_0x50c981)},{'model':db[_0xe737('0x29')],'as':_0xe737('0x2a'),'attributes':['id',_0xe737('0x2b'),'voicePause']}]})[_0xe737('0x10')](function(_0x3de6e8){var _0x287335=[];var _0x2284a1=[];for(var _0x13ef5e=0x0;_0x13ef5e<_0x3de6e8['length'];_0x13ef5e+=0x1){var _0x3305ab=_0x3de6e8[_0x13ef5e]['UserId'];if(_0x3305ab===null){_0x287335[_0xe737('0x2c')](_0x3de6e8[_0x13ef5e]['update'](_0x5ee413[_0xe737('0x1a')],{'transaction':_0x2dc516}));}else if(!_0x2284a1['includes'](_0x3305ab)){_0x2284a1[_0xe737('0x2c')](_0x3305ab);_0x287335[_0xe737('0x2c')](_0x3de6e8[_0x13ef5e][_0xe737('0x1c')](_0x5ee413[_0xe737('0x1a')],{'transaction':_0x2dc516}));}}return BPromise[_0xe737('0x2d')](_0x287335);});})['then'](function(_0x3f6ac6){logger[_0xe737('0x1b')](_0xe737('0x21'),_0x5ee413);if(_0x3f6ac6[_0xe737('0x2e')]>0x0){logger[_0xe737('0x1b')](_0xe737('0x2f'),_0x3f6ac6[0x0]['dataValues']['id'],_0x3f6ac6[0x0][_0xe737('0x30')][_0xe737('0x31')],_0x3f6ac6[0x0]['dataValues'][_0xe737('0x1f')]);}logger[_0xe737('0x11')]('GetContactDialer',_0x5ee413,JSON[_0xe737('0x12')](_0x3f6ac6));_0xd8622f(_0x3f6ac6);})[_0xe737('0x13')](function(_0x488008){logger[_0xe737('0x14')](_0xe737('0x21'),_0x488008[_0xe737('0x15')],_0x5ee413);_0x3ca1bd(_0x522987[_0xe737('0x14')](0x1f4,_0x488008['message']));});});});};exports[_0xe737('0x32')]=function(_0x1463f4){var _0x18e8fd=this;return new Promise(function(_0x34d448,_0x22a395){return db['sequelize']['transaction'](function(_0x3c8114){return db[_0xe737('0x33')]['create'](_0x1463f4[_0xe737('0x1a')],{'raw':_0x1463f4[_0xe737('0x8')]?_0x1463f4[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'transaction':_0x3c8114})[_0xe737('0x10')](function(){logger['info'](_0xe737('0x34'),JSON['stringify'](_0x1463f4[_0xe737('0x8')][_0xe737('0xa')]),_0x1463f4['options'][_0xe737('0xa')][_0xe737('0x1f')]);return db[_0xe737('0x6')]['destroy']({'where':_0x1463f4[_0xe737('0x8')]?_0x1463f4['options'][_0xe737('0xa')]||null:null,'transaction':_0x3c8114});});})['then'](function(_0x9c266d){logger['info'](_0xe737('0x32'),_0x1463f4);logger[_0xe737('0x11')](_0xe737('0x32'),_0x1463f4,JSON[_0xe737('0x12')](_0x9c266d));_0x34d448(_0x9c266d);})[_0xe737('0x13')](function(_0x3d975b){logger[_0xe737('0x14')]('MoveContactManagedDialer',_0x3d975b[_0xe737('0x15')],_0x1463f4);_0x22a395(_0x18e8fd[_0xe737('0x14')](0x1f4,_0x3d975b['message']));});});};exports['CountReScheduled']=function(_0x5e1e0f){var _0x46bb43=this;return new Promise(function(_0x4d39ac,_0x25b0c6){return db['CmHopper']['findAll']({'raw':_0x5e1e0f[_0xe737('0x8')]?_0x5e1e0f[_0xe737('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5e1e0f[_0xe737('0x8')]?_0x5e1e0f[_0xe737('0x8')][_0xe737('0xa')]||null:null,'attributes':[[db[_0xe737('0x24')]['fn']('COUNT',db[_0xe737('0x24')]['fn']('IF',db[_0xe737('0x24')][_0xe737('0x35')](_0xe737('0x36')+util['format'](_0xe737('0x37'),moment()[_0xe737('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xe737('0x39')))),_0xe737('0x3a')]]})[_0xe737('0x10')](function(_0x50fcaf){logger[_0xe737('0x1b')](_0xe737('0x3b'),_0x5e1e0f);logger[_0xe737('0x11')](_0xe737('0x3b'),_0x5e1e0f,JSON[_0xe737('0x12')](_0x50fcaf));_0x4d39ac(_0x50fcaf);})[_0xe737('0x13')](function(_0x485a2b){logger['error']('CountReScheduled',_0x485a2b['message'],_0x5e1e0f);_0x25b0c6(_0x46bb43[_0xe737('0x14')](0x1f4,_0x485a2b[_0xe737('0x15')]));});});};exports[_0xe737('0x3c')]=function(_0x3f45b7){var _0x38bef6=this;return new Promise(function(_0x123287,_0xf37fa5){return db[_0xe737('0x22')][_0xe737('0x23')]()[_0xe737('0x10')](function(){return db[_0xe737('0x24')][_0xe737('0x25')](function(_0x379627){return db[_0xe737('0x6')][_0xe737('0x7')]({'where':_0x3f45b7[_0xe737('0x8')]?_0x3f45b7['options'][_0xe737('0xa')]||null:null,'attributes':_0x3f45b7[_0xe737('0x8')]?_0x3f45b7['options'][_0xe737('0xb')]||null:null,'limit':0x1,'order':_0x3f45b7['options']?_0x3f45b7[_0xe737('0x8')][_0xe737('0x26')]||null:null,'group':db[_0xe737('0x6')][_0xe737('0x3d')],'transaction':_0x379627,'lock':_0x379627[_0xe737('0x27')][_0xe737('0x3e')],'include':_0x3f45b7['options']?_0x3f45b7[_0xe737('0x8')][_0xe737('0xd')]?_[_0xe737('0xe')](_0x3f45b7[_0xe737('0x8')][_0xe737('0xd')],function(_0x458102){return{'model':db[_0x458102[_0xe737('0xf')]],'as':_0x458102['as'],'attributes':_0x458102[_0xe737('0xb')],'include':_0x458102[_0xe737('0xd')]?_[_0xe737('0xe')](_0x458102[_0xe737('0xd')],function(_0x27e608){return{'model':db[_0x27e608['model']],'as':_0x27e608['as'],'attributes':_0x27e608['attributes'],'include':_0x27e608[_0xe737('0xd')]?_[_0xe737('0xe')](_0x27e608[_0xe737('0xd')],function(_0x15bb0f){return{'model':db[_0x15bb0f[_0xe737('0xf')]],'as':_0x15bb0f['as'],'attributes':_0x15bb0f[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe737('0x10')](function(_0x6ce3fd){var _0x3533a5=[];for(var _0x41ec65=0x0;_0x41ec65<_0x6ce3fd[_0xe737('0x2e')];_0x41ec65+=0x1){_0x3533a5[_0xe737('0x2c')](_0x6ce3fd[_0x41ec65][_0xe737('0x1c')](_0x3f45b7[_0xe737('0x1a')],{'transaction':_0x379627}));}return BPromise['all'](_0x3533a5);});})[_0xe737('0x10')](function(_0x54013d){logger[_0xe737('0x1b')](_0xe737('0x3c'),_0x3f45b7);logger[_0xe737('0x11')](_0xe737('0x3c'),_0x3f45b7,JSON[_0xe737('0x12')](_0x54013d));_0x123287(_0x54013d);})[_0xe737('0x13')](function(_0x45cfe5){logger[_0xe737('0x14')](_0xe737('0x3c'),_0x45cfe5[_0xe737('0x15')],_0x3f45b7);_0xf37fa5(_0x38bef6[_0xe737('0x14')](0x1f4,_0x45cfe5[_0xe737('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x2c2eaa){var _0x50d266=this;return new Promise(function(_0x1d9dad,_0x380aa1){db[_0xe737('0x22')][_0xe737('0x23')]()['then'](function(_0x1ce64e){return db[_0xe737('0x6')][_0xe737('0x7')]({'raw':_0x2c2eaa['options']?_0x2c2eaa[_0xe737('0x8')][_0xe737('0x9')]===undefined?!![]:![]:!![],'where':_0x2c2eaa[_0xe737('0x8')]?_0x2c2eaa['options'][_0xe737('0xa')]||null:null,'attributes':_0x2c2eaa['options']?_0x2c2eaa[_0xe737('0x8')]['attributes']||null:null,'limit':_0x2c2eaa[_0xe737('0x8')]?_0x2c2eaa[_0xe737('0x8')][_0xe737('0xc')]||null:null,'include':_0x2c2eaa[_0xe737('0x8')]?_0x2c2eaa['options'][_0xe737('0xd')]?_['map'](_0x2c2eaa[_0xe737('0x8')][_0xe737('0xd')],function(_0x48f467){return{'model':db[_0x48f467[_0xe737('0xf')]],'as':_0x48f467['as'],'attributes':_0x48f467['as']===_0xe737('0x28')?_[_0xe737('0x3f')](_0x1ce64e):_0x48f467[_0xe737('0xb')],'include':_0x48f467[_0xe737('0xd')]?_[_0xe737('0xe')](_0x48f467[_0xe737('0xd')],function(_0x501a66){return{'model':db[_0x501a66['model']],'as':_0x501a66['as'],'attributes':_0x501a66[_0xe737('0xb')],'include':_0x501a66[_0xe737('0xd')]?_[_0xe737('0xe')](_0x501a66['include'],function(_0x1af0f7){return{'model':db[_0x1af0f7[_0xe737('0xf')]],'as':_0x1af0f7['as'],'attributes':_0x1af0f7[_0xe737('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ffbed){logger['info'](_0xe737('0x5'),_0x2c2eaa);logger[_0xe737('0x11')](_0xe737('0x5'),_0x2c2eaa,JSON[_0xe737('0x12')](_0x4ffbed));_0x1d9dad(_0x4ffbed);})[_0xe737('0x13')](function(_0x171d0b){logger[_0xe737('0x14')]('GetCmHopper',_0x171d0b['message'],_0x2c2eaa);_0x380aa1(_0x50d266[_0xe737('0x14')](0x1f4,_0x171d0b[_0xe737('0x15')]));});});});};exports['GetContactByPhone']=function(_0x8634f6){var _0x3061d5=this;return new Promise(function(_0x1ba75c,_0x38ed5c){return db[_0xe737('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x8634f6[_0xe737('0x8')]['where'][_0xe737('0x40')]},'attributes':['id',_0xe737('0x41')],'order':[['id',_0xe737('0x42')]]})[_0xe737('0x10')](function(_0x54ff1a){logger['info'](_0xe737('0x43'),_0x8634f6);logger['debug'](_0xe737('0x43'),_0x8634f6,JSON[_0xe737('0x12')](_0x54ff1a));_0x1ba75c(_0x54ff1a);})[_0xe737('0x13')](function(_0x76de4d){logger[_0xe737('0x14')](_0xe737('0x43'),_0x76de4d[_0xe737('0x15')],_0x8634f6);_0x38ed5c(_0x3061d5[_0xe737('0x14')](0x1f4,_0x76de4d[_0xe737('0x15')]));});});};exports['ResetActiveCalls']=function(_0x1b94c1){var _0xf69083=this;return new Promise(function(_0x326771,_0x237ce1){return db[_0xe737('0x24')][_0xe737('0x25')](function(_0x3e6291){var _0x2055fb=_0x1b94c1[_0xe737('0x8')]&&_0x1b94c1[_0xe737('0x8')]['where']?_0x1b94c1[_0xe737('0x8')]['where']:{};return db['CmHopper']['update'](_0x1b94c1[_0xe737('0x1a')],{'where':_0x2055fb,'transaction':_0x3e6291})[_0xe737('0x10')](function(_0x4fe2c0){logger[_0xe737('0x1b')](_0xe737('0x44'),_0x1b94c1);logger[_0xe737('0x11')](_0xe737('0x44'),_0x1b94c1,JSON[_0xe737('0x12')](_0x4fe2c0));_0x326771(_0x4fe2c0);})[_0xe737('0x13')](function(_0x17b8b2){logger['error'](_0xe737('0x44'),_0x17b8b2['message'],_0x1b94c1);_0x237ce1(_0xf69083[_0xe737('0x14')](0x1f4,_0x17b8b2[_0xe737('0x15')]));});});});};exports[_0xe737('0x45')]=function(_0x4faeb8){var _0x122a13=this;var _0xc7ffcb=_0x4faeb8['body'][_0xe737('0xa')]['voiceQueueIds'];var _0x227ffa=_0x4faeb8['body'][_0xe737('0xa')]['interval'];var _0x2366d9=_0x4faeb8[_0xe737('0x1a')][_0xe737('0xa')][_0xe737('0x46')];return new Promise(function(_0x327dae,_0x3a445a){return db[_0xe737('0x6')][_0xe737('0x7')]({'where':{'voiceQueueId':{'$in':_0xc7ffcb},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0xe737('0x47')+_0x227ffa+_0xe737('0x48')),'$gt':db[_0xe737('0x24')][_0xe737('0x35')](_0xe737('0x49'))}},'UserId':{'$in':_0x2366d9}},'include':[{'model':db['CmContact'],'as':_0xe737('0x28')},{'model':db['User'],'as':'Agent','attributes':['id',_0xe737('0x2b'),_0xe737('0x4a')]},{'model':db[_0xe737('0x4b')],'as':_0xe737('0x4c')}]})[_0xe737('0x10')](function(_0x4e8ad4){if(_0x4e8ad4[_0xe737('0x2e')]>0x0){return db['sequelize'][_0xe737('0x25')](function(_0x3f6536){return db[_0xe737('0x6')][_0xe737('0x1c')]({'recallmeNotifiedDate':db['sequelize'][_0xe737('0x35')](_0xe737('0x49'))},{'where':{'id':{'$in':_[_0xe737('0xe')](_0x4e8ad4,'id')}},'transaction':_0x3f6536})['then'](function(){_0x327dae(_0x4e8ad4);})['catch'](function(_0x5cd594){logger[_0xe737('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x5cd594[_0xe737('0x15')],_0x4faeb8);_0x3a445a(_0x122a13[_0xe737('0x14')](0x1f4,_0x5cd594[_0xe737('0x15')]));});})[_0xe737('0x13')](function(_0x62c900){logger[_0xe737('0x14')](_0xe737('0x45'),_0x62c900['message'],_0x4faeb8);_0x3a445a(_0x122a13[_0xe737('0x14')](0x1f4,_0x62c900[_0xe737('0x15')]));});}else{_0x327dae(_0x4e8ad4);}});});}; \ No newline at end of file +var _0x8596=['transaction','LOCK','UPDATE','Contact','keys','Agent','name','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','voicePause','CmList','List','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','stringify','error','message','ShowCmHopper','find','catch','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize'];(function(_0x142c71,_0x45f7fb){var _0x4d0215=function(_0x11ae4b){while(--_0x11ae4b){_0x142c71['push'](_0x142c71['shift']());}};_0x4d0215(++_0x45f7fb);}(_0x8596,0x17f));var _0x6859=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8596[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6859('0x0'));var util=require(_0x6859('0x1'));var moment=require('moment');var BPromise=require(_0x6859('0x2'));var db=require(_0x6859('0x3'))['db'];var logger=require(_0x6859('0x4'))(_0x6859('0x5'));exports[_0x6859('0x6')]=function(_0xe6356d){var _0x599bb0=this;return new Promise(function(_0x30813f,_0xdc039a){return db[_0x6859('0x7')][_0x6859('0x8')]({'raw':_0xe6356d[_0x6859('0x9')]?_0xe6356d['options'][_0x6859('0xa')]===undefined?!![]:![]:!![],'where':_0xe6356d[_0x6859('0x9')]?_0xe6356d[_0x6859('0x9')][_0x6859('0xb')]||null:null,'attributes':_0xe6356d[_0x6859('0x9')]?_0xe6356d[_0x6859('0x9')]['attributes']||null:null,'limit':_0xe6356d[_0x6859('0x9')]?_0xe6356d['options'][_0x6859('0xc')]||null:null,'include':_0xe6356d['options']?_0xe6356d[_0x6859('0x9')][_0x6859('0xd')]?_[_0x6859('0xe')](_0xe6356d[_0x6859('0x9')][_0x6859('0xd')],function(_0x3774b5){return{'model':db[_0x3774b5[_0x6859('0xf')]],'as':_0x3774b5['as'],'attributes':_0x3774b5[_0x6859('0x10')],'include':_0x3774b5[_0x6859('0xd')]?_[_0x6859('0xe')](_0x3774b5[_0x6859('0xd')],function(_0x542f69){return{'model':db[_0x542f69[_0x6859('0xf')]],'as':_0x542f69['as'],'attributes':_0x542f69[_0x6859('0x10')],'include':_0x542f69['include']?_[_0x6859('0xe')](_0x542f69[_0x6859('0xd')],function(_0x3cb99e){return{'model':db[_0x3cb99e[_0x6859('0xf')]],'as':_0x3cb99e['as'],'attributes':_0x3cb99e[_0x6859('0x10')]};}):[]};}):[]};}):[]:[]})[_0x6859('0x11')](function(_0x1b1ff0){logger[_0x6859('0x12')](_0x6859('0x6'),_0xe6356d);logger[_0x6859('0x13')](_0x6859('0x6'),_0xe6356d,JSON[_0x6859('0x14')](_0x1b1ff0));_0x30813f(_0x1b1ff0);})['catch'](function(_0x405e3e){logger['error'](_0x6859('0x6'),_0x405e3e['message'],_0xe6356d);_0xdc039a(_0x599bb0[_0x6859('0x15')](0x1f4,_0x405e3e[_0x6859('0x16')]));});});};exports[_0x6859('0x17')]=function(_0x49401c){var _0xb2bd24=this;return new Promise(function(_0x4e4a41,_0x3a8589){return db['CmHopper'][_0x6859('0x18')]({'raw':_0x49401c['options']?_0x49401c[_0x6859('0x9')][_0x6859('0xa')]===undefined?!![]:![]:!![],'where':_0x49401c[_0x6859('0x9')]?_0x49401c[_0x6859('0x9')][_0x6859('0xb')]||null:null,'attributes':_0x49401c[_0x6859('0x9')]?_0x49401c[_0x6859('0x9')][_0x6859('0x10')]||null:null,'include':_0x49401c['options']?_0x49401c[_0x6859('0x9')][_0x6859('0xd')]?_['map'](_0x49401c['options']['include'],function(_0xb2e432){return{'model':db[_0xb2e432[_0x6859('0xf')]],'as':_0xb2e432['as'],'attributes':_0xb2e432['attributes'],'include':_0xb2e432[_0x6859('0xd')]?_[_0x6859('0xe')](_0xb2e432['include'],function(_0x32a193){return{'model':db[_0x32a193[_0x6859('0xf')]],'as':_0x32a193['as'],'attributes':_0x32a193[_0x6859('0x10')],'include':_0x32a193['include']?_[_0x6859('0xe')](_0x32a193[_0x6859('0xd')],function(_0x5d9a63){return{'model':db[_0x5d9a63[_0x6859('0xf')]],'as':_0x5d9a63['as'],'attributes':_0x5d9a63[_0x6859('0x10')]};}):[]};}):[]};}):[]:[]})[_0x6859('0x11')](function(_0x536b46){logger[_0x6859('0x12')](_0x6859('0x17'),_0x49401c);logger[_0x6859('0x13')]('ShowCmHopper',_0x49401c,JSON[_0x6859('0x14')](_0x536b46));_0x4e4a41(_0x536b46);})[_0x6859('0x19')](function(_0x3061a0){logger[_0x6859('0x15')]('ShowCmHopper',_0x3061a0['message'],_0x49401c);_0x3a8589(_0xb2bd24['error'](0x1f4,_0x3061a0['message']));});});};exports[_0x6859('0x1a')]=function(_0x320197){var _0x433231=this;return new Promise(function(_0x455a8d,_0x464bff){return db[_0x6859('0x7')][_0x6859('0x1b')](_0x320197[_0x6859('0x1c')],{'raw':_0x320197['options']?_0x320197[_0x6859('0x9')][_0x6859('0xa')]===undefined?!![]:![]:!![]})[_0x6859('0x11')](function(_0x361dc5){logger[_0x6859('0x12')](_0x6859('0x1a'),_0x320197);logger['debug'](_0x6859('0x1a'),_0x320197,JSON[_0x6859('0x14')](_0x361dc5));_0x455a8d(_0x361dc5);})[_0x6859('0x19')](function(_0x51e344){logger[_0x6859('0x15')](_0x6859('0x1a'),_0x51e344[_0x6859('0x16')],_0x320197);_0x464bff(_0x433231[_0x6859('0x15')](0x1f4,_0x51e344[_0x6859('0x16')]));});});};exports[_0x6859('0x1d')]=function(_0x290e5b){var _0x37b0e6=this;return new Promise(function(_0x2f60a1,_0x479af4){return db[_0x6859('0x7')][_0x6859('0x1e')](_0x290e5b[_0x6859('0x1c')],{'raw':_0x290e5b[_0x6859('0x9')]?_0x290e5b[_0x6859('0x9')][_0x6859('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x290e5b[_0x6859('0x9')]?_0x290e5b['options'][_0x6859('0xb')]||null:null,'attributes':_0x290e5b[_0x6859('0x9')]?_0x290e5b[_0x6859('0x9')][_0x6859('0x10')]||null:null,'limit':_0x290e5b[_0x6859('0x9')]?_0x290e5b[_0x6859('0x9')][_0x6859('0xc')]||null:null})[_0x6859('0x11')](function(_0x556155){logger[_0x6859('0x12')](_0x6859('0x1d'),_0x290e5b);logger[_0x6859('0x12')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x290e5b[_0x6859('0x9')][_0x6859('0xb')]),_0x290e5b[_0x6859('0x1c')]['active']);logger['debug'](_0x6859('0x1d'),_0x290e5b,JSON['stringify'](_0x556155));_0x2f60a1(_0x556155);})['catch'](function(_0x2ad578){logger[_0x6859('0x15')](_0x6859('0x1d'),_0x2ad578[_0x6859('0x16')],_0x290e5b);_0x479af4(_0x37b0e6[_0x6859('0x15')](0x1f4,_0x2ad578['message']));});});};exports[_0x6859('0x1f')]=function(_0x44ecd4){var _0x2b1e11=this;return new Promise(function(_0x19ae72,_0x2d49f7){return db[_0x6859('0x7')][_0x6859('0x20')]({'where':_0x44ecd4[_0x6859('0x9')]?_0x44ecd4['options'][_0x6859('0xb')]||null:null})[_0x6859('0x11')](function(_0x26a0f1){logger[_0x6859('0x12')](_0x6859('0x1f'),_0x44ecd4);logger[_0x6859('0x13')](_0x6859('0x1f'),_0x44ecd4,JSON[_0x6859('0x14')](_0x26a0f1));_0x19ae72(_0x26a0f1);})[_0x6859('0x19')](function(_0x468e32){logger[_0x6859('0x15')](_0x6859('0x1f'),_0x468e32[_0x6859('0x16')],_0x44ecd4);_0x2d49f7(_0x2b1e11['error'](0x1f4,_0x468e32[_0x6859('0x16')]));});});};exports[_0x6859('0x21')]=function(_0x33d139){var _0x470b15=this;return new Promise(function(_0x42d834,_0x2b8505){return db[_0x6859('0x22')][_0x6859('0x23')]()[_0x6859('0x11')](function(_0x5d26b1){return db[_0x6859('0x24')][_0x6859('0x25')](function(_0x271e11){return db['CmHopper'][_0x6859('0x8')]({'where':_0x33d139[_0x6859('0x9')]?_0x33d139[_0x6859('0x9')][_0x6859('0xb')]||null:null,'attributes':_0x33d139[_0x6859('0x9')]?_0x33d139[_0x6859('0x9')][_0x6859('0x10')]||null:null,'limit':_0x33d139[_0x6859('0x9')]?_0x33d139[_0x6859('0x9')]['limit']||null:null,'order':_0x33d139[_0x6859('0x9')]?_0x33d139[_0x6859('0x9')]['order']||null:null,'transaction':_0x271e11,'lock':_0x271e11[_0x6859('0x26')][_0x6859('0x27')],'include':[{'model':db[_0x6859('0x22')],'as':_0x6859('0x28'),'attributes':_[_0x6859('0x29')](_0x5d26b1)},{'model':db['User'],'as':_0x6859('0x2a'),'attributes':['id',_0x6859('0x2b'),'voicePause']}]})[_0x6859('0x11')](function(_0x48b402){var _0x1f1175=[];var _0x17e3bb=[];for(var _0x1456a5=0x0;_0x1456a5<_0x48b402[_0x6859('0x2c')];_0x1456a5+=0x1){var _0x336dce=_0x48b402[_0x1456a5][_0x6859('0x2d')];if(_0x336dce===null){_0x1f1175[_0x6859('0x2e')](_0x48b402[_0x1456a5][_0x6859('0x1e')](_0x33d139['body'],{'transaction':_0x271e11}));}else if(!_0x17e3bb['includes'](_0x336dce)){_0x17e3bb[_0x6859('0x2e')](_0x336dce);_0x1f1175['push'](_0x48b402[_0x1456a5][_0x6859('0x1e')](_0x33d139[_0x6859('0x1c')],{'transaction':_0x271e11}));}}return BPromise[_0x6859('0x2f')](_0x1f1175);});})[_0x6859('0x11')](function(_0x5b5c15){logger[_0x6859('0x12')](_0x6859('0x21'),_0x33d139);if(_0x5b5c15[_0x6859('0x2c')]>0x0){logger[_0x6859('0x12')](_0x6859('0x30'),_0x5b5c15[0x0][_0x6859('0x31')]['id'],_0x5b5c15[0x0]['dataValues'][_0x6859('0x32')],_0x5b5c15[0x0][_0x6859('0x31')]['active']);}logger['debug'](_0x6859('0x21'),_0x33d139,JSON['stringify'](_0x5b5c15));_0x42d834(_0x5b5c15);})['catch'](function(_0x32639e){logger[_0x6859('0x15')](_0x6859('0x21'),_0x32639e[_0x6859('0x16')],_0x33d139);_0x2b8505(_0x470b15[_0x6859('0x15')](0x1f4,_0x32639e[_0x6859('0x16')]));});});});};exports[_0x6859('0x33')]=function(_0x233b65){var _0x2e57f0=this;return new Promise(function(_0x57fc2f,_0x5a1906){return db[_0x6859('0x24')]['transaction'](function(_0x559646){return db[_0x6859('0x34')][_0x6859('0x1b')](_0x233b65[_0x6859('0x1c')],{'raw':_0x233b65['options']?_0x233b65[_0x6859('0x9')][_0x6859('0xa')]===undefined?!![]:![]:!![],'transaction':_0x559646})[_0x6859('0x11')](function(){logger['info'](_0x6859('0x35'),JSON[_0x6859('0x14')](_0x233b65[_0x6859('0x9')][_0x6859('0xb')]),_0x233b65[_0x6859('0x9')][_0x6859('0xb')][_0x6859('0x36')]);return db[_0x6859('0x7')][_0x6859('0x20')]({'where':_0x233b65[_0x6859('0x9')]?_0x233b65[_0x6859('0x9')]['where']||null:null,'transaction':_0x559646});});})[_0x6859('0x11')](function(_0x4cb32a){logger[_0x6859('0x12')](_0x6859('0x33'),_0x233b65);logger[_0x6859('0x13')](_0x6859('0x33'),_0x233b65,JSON[_0x6859('0x14')](_0x4cb32a));_0x57fc2f(_0x4cb32a);})['catch'](function(_0x4a0376){logger[_0x6859('0x15')](_0x6859('0x33'),_0x4a0376[_0x6859('0x16')],_0x233b65);_0x5a1906(_0x2e57f0[_0x6859('0x15')](0x1f4,_0x4a0376[_0x6859('0x16')]));});});};exports[_0x6859('0x37')]=function(_0x5da897){var _0x10314f=this;return new Promise(function(_0xee6b06,_0x448ead){return db['CmHopper'][_0x6859('0x8')]({'raw':_0x5da897[_0x6859('0x9')]?_0x5da897[_0x6859('0x9')][_0x6859('0xa')]===undefined?!![]:![]:!![],'where':_0x5da897[_0x6859('0x9')]?_0x5da897[_0x6859('0x9')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6859('0x24')]['fn']('IF',db['sequelize'][_0x6859('0x38')](_0x6859('0x39')+util[_0x6859('0x3a')](_0x6859('0x3b'),moment()[_0x6859('0x3a')](_0x6859('0x3c')))+_0x6859('0x3d')))),_0x6859('0x3e')]]})[_0x6859('0x11')](function(_0x57a3da){logger[_0x6859('0x12')]('CountReScheduled',_0x5da897);logger['debug']('CountReScheduled',_0x5da897,JSON[_0x6859('0x14')](_0x57a3da));_0xee6b06(_0x57a3da);})[_0x6859('0x19')](function(_0xc29e73){logger[_0x6859('0x15')](_0x6859('0x37'),_0xc29e73[_0x6859('0x16')],_0x5da897);_0x448ead(_0x10314f[_0x6859('0x15')](0x1f4,_0xc29e73[_0x6859('0x16')]));});});};exports[_0x6859('0x3f')]=function(_0x29ef24){var _0x17d4e7=this;return new Promise(function(_0x7edf0,_0x2af76e){return db[_0x6859('0x22')][_0x6859('0x23')]()[_0x6859('0x11')](function(){return db['sequelize'][_0x6859('0x25')](function(_0x504553){return db[_0x6859('0x7')][_0x6859('0x8')]({'where':_0x29ef24[_0x6859('0x9')]?_0x29ef24[_0x6859('0x9')][_0x6859('0xb')]||null:null,'attributes':_0x29ef24[_0x6859('0x9')]?_0x29ef24['options'][_0x6859('0x10')]||null:null,'limit':0x1,'order':_0x29ef24[_0x6859('0x9')]?_0x29ef24[_0x6859('0x9')][_0x6859('0x40')]||null:null,'group':db[_0x6859('0x7')]['UserId'],'transaction':_0x504553,'lock':_0x504553[_0x6859('0x26')][_0x6859('0x27')],'include':_0x29ef24[_0x6859('0x9')]?_0x29ef24[_0x6859('0x9')][_0x6859('0xd')]?_[_0x6859('0xe')](_0x29ef24[_0x6859('0x9')][_0x6859('0xd')],function(_0x52d93f){return{'model':db[_0x52d93f[_0x6859('0xf')]],'as':_0x52d93f['as'],'attributes':_0x52d93f['attributes'],'include':_0x52d93f['include']?_[_0x6859('0xe')](_0x52d93f[_0x6859('0xd')],function(_0x7712b8){return{'model':db[_0x7712b8[_0x6859('0xf')]],'as':_0x7712b8['as'],'attributes':_0x7712b8[_0x6859('0x10')],'include':_0x7712b8[_0x6859('0xd')]?_[_0x6859('0xe')](_0x7712b8['include'],function(_0x5d5a0c){return{'model':db[_0x5d5a0c[_0x6859('0xf')]],'as':_0x5d5a0c['as'],'attributes':_0x5d5a0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6859('0x11')](function(_0x5883c9){var _0xab188c=[];for(var _0x24d89a=0x0;_0x24d89a<_0x5883c9[_0x6859('0x2c')];_0x24d89a+=0x1){_0xab188c[_0x6859('0x2e')](_0x5883c9[_0x24d89a][_0x6859('0x1e')](_0x29ef24[_0x6859('0x1c')],{'transaction':_0x504553}));}return BPromise[_0x6859('0x2f')](_0xab188c);});})[_0x6859('0x11')](function(_0x1052ec){logger['info'](_0x6859('0x3f'),_0x29ef24);logger['debug'](_0x6859('0x3f'),_0x29ef24,JSON[_0x6859('0x14')](_0x1052ec));_0x7edf0(_0x1052ec);})[_0x6859('0x19')](function(_0x88eea9){logger[_0x6859('0x15')]('GetContactRecallMe',_0x88eea9[_0x6859('0x16')],_0x29ef24);_0x2af76e(_0x17d4e7[_0x6859('0x15')](0x1f4,_0x88eea9[_0x6859('0x16')]));});});});};exports[_0x6859('0x41')]=function(_0x13e627){var _0x475023=this;return new Promise(function(_0x117519,_0x67854c){db['CmContact'][_0x6859('0x23')]()[_0x6859('0x11')](function(_0x4c0145){return db[_0x6859('0x7')][_0x6859('0x8')]({'raw':_0x13e627[_0x6859('0x9')]?_0x13e627[_0x6859('0x9')][_0x6859('0xa')]===undefined?!![]:![]:!![],'where':_0x13e627[_0x6859('0x9')]?_0x13e627['options']['where']||null:null,'attributes':_0x13e627['options']?_0x13e627[_0x6859('0x9')][_0x6859('0x10')]||null:null,'limit':_0x13e627[_0x6859('0x9')]?_0x13e627[_0x6859('0x9')][_0x6859('0xc')]||null:null,'include':_0x13e627[_0x6859('0x9')]?_0x13e627[_0x6859('0x9')][_0x6859('0xd')]?_['map'](_0x13e627[_0x6859('0x9')]['include'],function(_0x4e0bcf){return{'model':db[_0x4e0bcf[_0x6859('0xf')]],'as':_0x4e0bcf['as'],'attributes':_0x4e0bcf['as']==='Contact'?_['keys'](_0x4c0145):_0x4e0bcf[_0x6859('0x10')],'include':_0x4e0bcf[_0x6859('0xd')]?_['map'](_0x4e0bcf[_0x6859('0xd')],function(_0x46a69b){return{'model':db[_0x46a69b[_0x6859('0xf')]],'as':_0x46a69b['as'],'attributes':_0x46a69b['attributes'],'include':_0x46a69b[_0x6859('0xd')]?_[_0x6859('0xe')](_0x46a69b[_0x6859('0xd')],function(_0x4b98ee){return{'model':db[_0x4b98ee[_0x6859('0xf')]],'as':_0x4b98ee['as'],'attributes':_0x4b98ee[_0x6859('0x10')]};}):[]};}):[]};}):[]:[]})[_0x6859('0x11')](function(_0xb99b8f){logger[_0x6859('0x12')]('GetCmHopper',_0x13e627);logger[_0x6859('0x13')](_0x6859('0x6'),_0x13e627,JSON[_0x6859('0x14')](_0xb99b8f));_0x117519(_0xb99b8f);})['catch'](function(_0x2387ff){logger[_0x6859('0x15')](_0x6859('0x6'),_0x2387ff[_0x6859('0x16')],_0x13e627);_0x67854c(_0x475023[_0x6859('0x15')](0x1f4,_0x2387ff[_0x6859('0x16')]));});});});};exports[_0x6859('0x42')]=function(_0x2d2fc0){var _0x459d06=this;return new Promise(function(_0x47d5b2,_0x562dba){return db[_0x6859('0x22')][_0x6859('0x43')]({'raw':!![],'where':{'phone':_0x2d2fc0[_0x6859('0x9')][_0x6859('0xb')][_0x6859('0x44')]},'attributes':['id',_0x6859('0x45')],'order':[['id',_0x6859('0x46')]]})['then'](function(_0xce715c){logger[_0x6859('0x12')]('getContactByPhone',_0x2d2fc0);logger[_0x6859('0x13')](_0x6859('0x47'),_0x2d2fc0,JSON[_0x6859('0x14')](_0xce715c));_0x47d5b2(_0xce715c);})[_0x6859('0x19')](function(_0x494a3f){logger[_0x6859('0x15')](_0x6859('0x47'),_0x494a3f['message'],_0x2d2fc0);_0x562dba(_0x459d06['error'](0x1f4,_0x494a3f[_0x6859('0x16')]));});});};exports[_0x6859('0x48')]=function(_0x34ef6){var _0x1ee46e=this;return new Promise(function(_0x3e16c8,_0x2d58e6){return db['sequelize']['transaction'](function(_0x2361ca){var _0x1f669a=_0x34ef6[_0x6859('0x9')]&&_0x34ef6[_0x6859('0x9')]['where']?_0x34ef6[_0x6859('0x9')]['where']:{};return db[_0x6859('0x7')]['update'](_0x34ef6[_0x6859('0x1c')],{'where':_0x1f669a,'transaction':_0x2361ca})[_0x6859('0x11')](function(_0x182746){logger[_0x6859('0x12')](_0x6859('0x48'),_0x34ef6);logger[_0x6859('0x13')](_0x6859('0x48'),_0x34ef6,JSON[_0x6859('0x14')](_0x182746));_0x3e16c8(_0x182746);})[_0x6859('0x19')](function(_0x17d90c){logger[_0x6859('0x15')](_0x6859('0x48'),_0x17d90c['message'],_0x34ef6);_0x2d58e6(_0x1ee46e['error'](0x1f4,_0x17d90c['message']));});});});};exports[_0x6859('0x49')]=function(_0x105242){var _0xc28df9=this;var _0x3ffc22=_0x105242['body'][_0x6859('0xb')][_0x6859('0x4a')];var _0x3af469=_0x105242[_0x6859('0x1c')][_0x6859('0xb')][_0x6859('0x4b')];var _0x26f8ca=_0x105242[_0x6859('0x1c')]['where'][_0x6859('0x4c')];return new Promise(function(_0x3f5e6f,_0x2dee83){return db[_0x6859('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x3ffc22},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x6859('0x24')][_0x6859('0x38')](_0x6859('0x4d')+_0x3af469+_0x6859('0x4e')),'$gt':db['sequelize'][_0x6859('0x38')](_0x6859('0x4f'))}},'UserId':{'$in':_0x26f8ca}},'include':[{'model':db[_0x6859('0x22')],'as':_0x6859('0x28')},{'model':db[_0x6859('0x50')],'as':_0x6859('0x2a'),'attributes':['id','name',_0x6859('0x51')]},{'model':db[_0x6859('0x52')],'as':_0x6859('0x53')}]})[_0x6859('0x11')](function(_0x35dbb6){if(_0x35dbb6[_0x6859('0x2c')]>0x0){return db['sequelize']['transaction'](function(_0x253c4b){return db[_0x6859('0x7')][_0x6859('0x1e')]({'recallmeNotifiedDate':db[_0x6859('0x24')][_0x6859('0x38')](_0x6859('0x4f'))},{'where':{'id':{'$in':_[_0x6859('0xe')](_0x35dbb6,'id')}},'transaction':_0x253c4b})[_0x6859('0x11')](function(){_0x3f5e6f(_0x35dbb6);})['catch'](function(_0x3b4c7c){logger[_0x6859('0x15')](_0x6859('0x49'),_0x3b4c7c[_0x6859('0x16')],_0x105242);_0x2dee83(_0xc28df9[_0x6859('0x15')](0x1f4,_0x3b4c7c['message']));});})[_0x6859('0x19')](function(_0x2f3295){logger[_0x6859('0x15')](_0x6859('0x49'),_0x2f3295[_0x6859('0x16')],_0x105242);_0x2dee83(_0xc28df9[_0x6859('0x15')](0x1f4,_0x2f3295[_0x6859('0x16')]));});}else{_0x3f5e6f(_0x35dbb6);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 0113e9c..932447a 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 _0x692b=['update','delete','destroy','exports','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','/timezone','put'];(function(_0x31d040,_0x46742e){var _0xf4812a=function(_0x3e1d93){while(--_0x3e1d93){_0x31d040['push'](_0x31d040['shift']());}};_0xf4812a(++_0x46742e);}(_0x692b,0x13f));var _0xb692=function(_0x14f466,_0xa58628){_0x14f466=_0x14f466-0x0;var _0xd8d98b=_0x692b[_0x14f466];return _0xd8d98b;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xb692('0x0'));var controller=require(_0xb692('0x1'));router[_0xb692('0x2')]('/',auth[_0xb692('0x3')](),controller[_0xb692('0x4')]);router[_0xb692('0x2')]('/describe',auth[_0xb692('0x3')](),controller['describe']);router[_0xb692('0x2')](_0xb692('0x5'),auth[_0xb692('0x3')](),controller[_0xb692('0x6')]);router[_0xb692('0x2')](_0xb692('0x7'),auth[_0xb692('0x3')](),controller[_0xb692('0x8')]);router['get'](_0xb692('0x9'),auth[_0xb692('0x3')](),controller['show']);router[_0xb692('0x2')](_0xb692('0xa'),auth[_0xb692('0x3')](),controller[_0xb692('0xb')]);router[_0xb692('0xc')]('/',auth[_0xb692('0x3')](),controller[_0xb692('0xd')]);router[_0xb692('0xc')](_0xb692('0xe'),auth[_0xb692('0x3')](),controller['getPreview']);router['post'](_0xb692('0xf'),auth[_0xb692('0x3')](),controller['getTimezone']);router[_0xb692('0x10')](_0xb692('0x9'),auth[_0xb692('0x3')](),controller[_0xb692('0x11')]);router[_0xb692('0x12')](_0xb692('0x9'),auth[_0xb692('0x3')](),controller[_0xb692('0x13')]);module[_0xb692('0x14')]=router; \ No newline at end of file +var _0xf675=['exports','express','Router','get','isAuthenticated','index','/opencontacts','getOpenContacts','/:id','show','/:id/previewrecall','post','/preview','/timezone','getTimezone','put','update','delete','destroy'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0xf675,0x131));var _0x5f67=function(_0x6899c7,_0x363413){_0x6899c7=_0x6899c7-0x0;var _0x5186ee=_0xf675[_0x6899c7];return _0x5186ee;};'use strict';var express=require(_0x5f67('0x0'));var router=express[_0x5f67('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x5f67('0x2')]('/',auth[_0x5f67('0x3')](),controller[_0x5f67('0x4')]);router['get']('/describe',auth[_0x5f67('0x3')](),controller['describe']);router[_0x5f67('0x2')](_0x5f67('0x5'),auth[_0x5f67('0x3')](),controller[_0x5f67('0x6')]);router[_0x5f67('0x2')]('/timezones',auth[_0x5f67('0x3')](),controller['getTimezones']);router['get'](_0x5f67('0x7'),auth[_0x5f67('0x3')](),controller[_0x5f67('0x8')]);router['get'](_0x5f67('0x9'),auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0x5f67('0xa')]('/',auth[_0x5f67('0x3')](),controller['create']);router[_0x5f67('0xa')](_0x5f67('0xb'),auth[_0x5f67('0x3')](),controller['getPreview']);router[_0x5f67('0xa')](_0x5f67('0xc'),auth[_0x5f67('0x3')](),controller[_0x5f67('0xd')]);router[_0x5f67('0xe')](_0x5f67('0x7'),auth['isAuthenticated'](),controller[_0x5f67('0xf')]);router[_0x5f67('0x10')]('/:id',auth[_0x5f67('0x3')](),controller[_0x5f67('0x11')]);module[_0x5f67('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 1ae8550..70dcc80 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ce5=['YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING','INTEGER','DATE'];(function(_0x353a5f,_0x14b8a1){var _0x1ad2d8=function(_0x30dbe0){while(--_0x30dbe0){_0x353a5f['push'](_0x353a5f['shift']());}};_0x1ad2d8(++_0x14b8a1);}(_0x2ce5,0xdd));var _0x52ce=function(_0x125b59,_0x4290ac){_0x125b59=_0x125b59-0x0;var _0x10e3f8=_0x2ce5[_0x125b59];return _0x10e3f8;};'use strict';var moment=require('moment');var Sequelize=require(_0x52ce('0x0'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x52ce('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x52ce('0x3')],'defaultValue':moment()['format'](_0x52ce('0x4'))},'countbusyretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x52ce('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0166=['sequelize','exports','INTEGER','STRING','format','moment'];(function(_0x3f6af9,_0x553094){var _0x6cc311=function(_0x11a9a4){while(--_0x11a9a4){_0x3f6af9['push'](_0x3f6af9['shift']());}};_0x6cc311(++_0x553094);}(_0x0166,0x13d));var _0x6016=function(_0x4eab16,_0x2e365a){_0x4eab16=_0x4eab16-0x0;var _0x1ba373=_0x0166[_0x4eab16];return _0x1ba373;};'use strict';var moment=require(_0x6016('0x0'));var Sequelize=require(_0x6016('0x1'));module[_0x6016('0x2')]={'CmHopperId':{'type':Sequelize[_0x6016('0x3')]},'phone':{'type':Sequelize[_0x6016('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6016('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x6016('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6016('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6016('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6016('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6016('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6016('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index e9a3eba..263a063 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2216=['ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','end','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0xf1e782,_0x1d9645){var _0x779680=function(_0x438d64){while(--_0x438d64){_0xf1e782['push'](_0xf1e782['shift']());}};_0x779680(++_0x1d9645);}(_0x2216,0x14b));var _0x6221=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2216[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x6221('0x0'));var rimraf=require(_0x6221('0x1'));var zipdir=require(_0x6221('0x2'));var jsonpatch=require(_0x6221('0x3'));var rp=require(_0x6221('0x4'));var moment=require('moment');var BPromise=require(_0x6221('0x5'));var Mustache=require(_0x6221('0x6'));var util=require(_0x6221('0x7'));var path=require(_0x6221('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6221('0x9'));var fs=require('fs');var fs_extra=require(_0x6221('0xa'));var _=require(_0x6221('0xb'));var squel=require(_0x6221('0xc'));var crypto=require('crypto');var jsforce=require(_0x6221('0xd'));var deskjs=require(_0x6221('0xe'));var toCsv=require(_0x6221('0xf'));var querystring=require(_0x6221('0x10'));var Papa=require(_0x6221('0x11'));var Redis=require(_0x6221('0x12'));var authService=require(_0x6221('0x13'));var qs=require(_0x6221('0x14'));var as=require(_0x6221('0x15'));var hardwareService=require(_0x6221('0x16'));var logger=require('../../config/logger')(_0x6221('0x17'));var utils=require(_0x6221('0x18'));var config=require(_0x6221('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6221('0x1a'))['db'];function respondWithStatusCode(_0x5cc462,_0x33874a){_0x33874a=_0x33874a||0xcc;return function(_0x1f3332){if(_0x1f3332){return _0x5cc462[_0x6221('0x1b')](_0x33874a);}return _0x5cc462[_0x6221('0x1c')](_0x33874a)['end']();};}function respondWithResult(_0x59d2c8,_0x4d2f00){_0x4d2f00=_0x4d2f00||0xc8;return function(_0x2be0d4){if(_0x2be0d4){return _0x59d2c8['status'](_0x4d2f00)[_0x6221('0x1d')](_0x2be0d4);}};}function respondWithFilteredResult(_0x2d19e2,_0x3b14a6){return function(_0x4e4d37){if(_0x4e4d37){var _0x4ff3ac=typeof _0x3b14a6['offset']===_0x6221('0x1e')&&typeof _0x3b14a6[_0x6221('0x1f')]==='undefined';var _0x55802f=_0x4e4d37[_0x6221('0x20')];var _0x7c2c7=_0x4ff3ac?0x0:_0x3b14a6['offset'];var _0x189b3e=_0x4ff3ac?_0x4e4d37[_0x6221('0x20')]:_0x3b14a6[_0x6221('0x21')]+_0x3b14a6[_0x6221('0x1f')];var _0x337511;if(_0x189b3e>=_0x55802f){_0x189b3e=_0x55802f;_0x337511=0xc8;}else{_0x337511=0xce;}_0x2d19e2[_0x6221('0x1c')](_0x337511);return _0x2d19e2[_0x6221('0x22')]('Content-Range',_0x7c2c7+'-'+_0x189b3e+'/'+_0x55802f)[_0x6221('0x1d')](_0x4e4d37);}return null;};}function patchUpdates(_0x289203){return function(_0x711ce5){try{jsonpatch[_0x6221('0x23')](_0x711ce5,_0x289203,!![]);}catch(_0x2553f2){return BPromise[_0x6221('0x24')](_0x2553f2);}return _0x711ce5[_0x6221('0x25')]();};}function saveUpdates(_0x3af181,_0x358249){return function(_0x543fb1){if(_0x543fb1){return _0x543fb1[_0x6221('0x26')](_0x3af181)[_0x6221('0x27')](function(_0x18c6db){return _0x18c6db;});}return null;};}function removeEntity(_0x240c05,_0x40e290){return function(_0x744d4a){if(_0x744d4a){return _0x744d4a[_0x6221('0x28')]()['then'](function(){var _0x47ac58=_0x744d4a['get']({'plain':!![]});var _0x3c93ac=_0x6221('0x29');return db[_0x6221('0x2a')][_0x6221('0x28')]({'where':{'type':_0x3c93ac,'resourceId':_0x47ac58['id']}})[_0x6221('0x27')](function(){return _0x744d4a;});})[_0x6221('0x27')](function(){_0x240c05[_0x6221('0x1c')](0xcc)[_0x6221('0x2b')]();});}};}function handleEntityNotFound(_0x256f1f,_0x9e2056){return function(_0x5e4e4d){if(!_0x5e4e4d){_0x256f1f['sendStatus'](0x194);}return _0x5e4e4d;};}function handleError(_0x3340a9,_0x2872c3){_0x2872c3=_0x2872c3||0x1f4;return function(_0x42d5c6){logger[_0x6221('0x2c')](_0x42d5c6[_0x6221('0x2d')]);if(_0x42d5c6[_0x6221('0x2e')]){delete _0x42d5c6[_0x6221('0x2e')];}_0x3340a9[_0x6221('0x1c')](_0x2872c3)[_0x6221('0x2f')](_0x42d5c6);};}exports[_0x6221('0x30')]=function(_0x2a1b92,_0x368544){var _0x516976={},_0x34c9ad={},_0x595c1d={'count':0x0,'rows':[]};var _0x4e7dbf=_['map'](db[_0x6221('0x31')][_0x6221('0x32')],function(_0x1123b5){return{'name':_0x1123b5[_0x6221('0x33')],'type':_0x1123b5['type'][_0x6221('0x34')]};});_0x34c9ad[_0x6221('0x35')]=_['map'](_0x4e7dbf,_0x6221('0x2e'));_0x34c9ad[_0x6221('0x36')]=_[_0x6221('0x37')](_0x2a1b92[_0x6221('0x36')]);_0x34c9ad[_0x6221('0x38')]=_[_0x6221('0x39')](_0x34c9ad[_0x6221('0x35')],_0x34c9ad['query']);_0x516976['attributes']=_[_0x6221('0x39')](_0x34c9ad[_0x6221('0x35')],qs[_0x6221('0x3a')](_0x2a1b92[_0x6221('0x36')]['fields']));_0x516976[_0x6221('0x3b')]=_0x516976[_0x6221('0x3b')]['length']?_0x516976['attributes']:_0x34c9ad['model'];if(!_0x2a1b92['query']['hasOwnProperty'](_0x6221('0x3c'))){_0x516976['limit']=qs['limit'](_0x2a1b92[_0x6221('0x36')][_0x6221('0x1f')]);_0x516976['offset']=qs['offset'](_0x2a1b92[_0x6221('0x36')]['offset']);}_0x516976[_0x6221('0x3d')]=qs[_0x6221('0x3e')](_0x2a1b92[_0x6221('0x36')][_0x6221('0x3e')]);_0x516976[_0x6221('0x3f')]=qs[_0x6221('0x38')](_['pick'](_0x2a1b92[_0x6221('0x36')],_0x34c9ad[_0x6221('0x38')]),_0x4e7dbf);if(_0x2a1b92[_0x6221('0x36')][_0x6221('0x40')]){_0x516976['where']=_[_0x6221('0x41')](_0x516976['where'],{'$or':_[_0x6221('0x42')](_0x4e7dbf,function(_0x3b01ca){if(_0x3b01ca['type']!=='VIRTUAL'){var _0x3fc163={};_0x3fc163[_0x3b01ca['name']]={'$like':'%'+_0x2a1b92[_0x6221('0x36')]['filter']+'%'};return _0x3fc163;}})});}_0x516976=_[_0x6221('0x41')]({},_0x516976,_0x2a1b92[_0x6221('0x43')]);var _0x18a89d={'where':_0x516976[_0x6221('0x3f')]};return db['CmHopperAdditionalPhone'][_0x6221('0x20')](_0x18a89d)[_0x6221('0x27')](function(_0x49a71b){_0x595c1d[_0x6221('0x20')]=_0x49a71b;if(_0x2a1b92[_0x6221('0x36')][_0x6221('0x44')]){_0x516976[_0x6221('0x45')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x6221('0x46')](_0x516976);})[_0x6221('0x27')](function(_0x52d062){_0x595c1d['rows']=_0x52d062;return _0x595c1d;})[_0x6221('0x27')](respondWithFilteredResult(_0x368544,_0x516976))[_0x6221('0x47')](handleError(_0x368544,null));};exports[_0x6221('0x48')]=function(_0x392615,_0x28912c){var _0x5f294b={'raw':!![],'where':{'id':_0x392615['params']['id']}},_0x3f4045={};_0x3f4045['model']=_[_0x6221('0x37')](db[_0x6221('0x31')][_0x6221('0x32')]);_0x3f4045[_0x6221('0x36')]=_[_0x6221('0x37')](_0x392615[_0x6221('0x36')]);_0x3f4045[_0x6221('0x38')]=_[_0x6221('0x39')](_0x3f4045['model'],_0x3f4045['query']);_0x5f294b[_0x6221('0x3b')]=_[_0x6221('0x39')](_0x3f4045[_0x6221('0x35')],qs[_0x6221('0x3a')](_0x392615[_0x6221('0x36')][_0x6221('0x3a')]));_0x5f294b[_0x6221('0x3b')]=_0x5f294b[_0x6221('0x3b')][_0x6221('0x49')]?_0x5f294b[_0x6221('0x3b')]:_0x3f4045[_0x6221('0x35')];if(_0x392615['query']['includeAll']){_0x5f294b[_0x6221('0x45')]=[{'all':!![]}];}_0x5f294b=_[_0x6221('0x41')]({},_0x5f294b,_0x392615[_0x6221('0x43')]);return db[_0x6221('0x31')][_0x6221('0x4a')](_0x5f294b)[_0x6221('0x27')](handleEntityNotFound(_0x28912c,null))[_0x6221('0x27')](respondWithResult(_0x28912c,null))[_0x6221('0x47')](handleError(_0x28912c,null));};exports[_0x6221('0x4b')]=function(_0x1fd267,_0x1a4597){return db[_0x6221('0x31')]['create'](_0x1fd267[_0x6221('0x4c')],{})[_0x6221('0x27')](function(_0x52ea16){var _0x4d5cc3=_0x1fd267['user'][_0x6221('0x4d')]({'plain':!![]});if(!_0x4d5cc3)throw new Error(_0x6221('0x4e'));if(_0x4d5cc3[_0x6221('0x4f')]===_0x6221('0x50')){var _0x36c9ad=_0x52ea16[_0x6221('0x4d')]({'plain':!![]});var _0x2f860e=_0x6221('0x29');return db[_0x6221('0x51')][_0x6221('0x4a')]({'where':{'name':_0x2f860e,'userProfileId':_0x4d5cc3['userProfileId']},'raw':!![]})['then'](function(_0x54cfdc){if(_0x54cfdc&&_0x54cfdc[_0x6221('0x52')]===0x0){return db[_0x6221('0x2a')][_0x6221('0x4b')]({'name':_0x36c9ad[_0x6221('0x2e')],'resourceId':_0x36c9ad['id'],'type':_0x54cfdc[_0x6221('0x2e')],'sectionId':_0x54cfdc['id']},{})[_0x6221('0x27')](function(){return _0x52ea16;});}else{return _0x52ea16;}})[_0x6221('0x47')](function(_0x207b63){logger['error'](_0x6221('0x53'),_0x207b63);throw _0x207b63;});}return _0x52ea16;})[_0x6221('0x27')](respondWithResult(_0x1a4597,0xc9))[_0x6221('0x47')](handleError(_0x1a4597,null));};exports['update']=function(_0x1d8082,_0x407c2b){if(_0x1d8082[_0x6221('0x4c')]['id']){delete _0x1d8082[_0x6221('0x4c')]['id'];}return db[_0x6221('0x31')]['find']({'where':{'id':_0x1d8082[_0x6221('0x54')]['id']}})[_0x6221('0x27')](handleEntityNotFound(_0x407c2b,null))[_0x6221('0x27')](saveUpdates(_0x1d8082[_0x6221('0x4c')],null))[_0x6221('0x27')](respondWithResult(_0x407c2b,null))['catch'](handleError(_0x407c2b,null));};exports['destroy']=function(_0x2ab362,_0x2cab3f){return db[_0x6221('0x31')]['find']({'where':{'id':_0x2ab362[_0x6221('0x54')]['id']}})[_0x6221('0x27')](handleEntityNotFound(_0x2cab3f,null))[_0x6221('0x27')](removeEntity(_0x2cab3f,null))[_0x6221('0x47')](handleError(_0x2cab3f,null));}; \ No newline at end of file +var _0xc749=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','Content-Range','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','CmHopperAdditionalPhone','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','params','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4e83c1,_0x1a1637){var _0x3f17a4=function(_0x3c377d){while(--_0x3c377d){_0x4e83c1['push'](_0x4e83c1['shift']());}};_0x3f17a4(++_0x1a1637);}(_0xc749,0x97));var _0x9c74=function(_0x2b02e8,_0x5c6670){_0x2b02e8=_0x2b02e8-0x0;var _0x1fe9d6=_0xc749[_0x2b02e8];return _0x1fe9d6;};'use strict';var emlformat=require(_0x9c74('0x0'));var rimraf=require(_0x9c74('0x1'));var zipdir=require(_0x9c74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c74('0x3'));var moment=require(_0x9c74('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c74('0x5'));var util=require(_0x9c74('0x6'));var path=require(_0x9c74('0x7'));var sox=require('sox');var csv=require(_0x9c74('0x8'));var ejs=require(_0x9c74('0x9'));var fs=require('fs');var fs_extra=require(_0x9c74('0xa'));var _=require('lodash');var squel=require(_0x9c74('0xb'));var crypto=require(_0x9c74('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c74('0x8'));var querystring=require(_0x9c74('0xd'));var Papa=require(_0x9c74('0xe'));var Redis=require(_0x9c74('0xf'));var authService=require(_0x9c74('0x10'));var qs=require(_0x9c74('0x11'));var as=require(_0x9c74('0x12'));var hardwareService=require(_0x9c74('0x13'));var logger=require(_0x9c74('0x14'))(_0x9c74('0x15'));var utils=require(_0x9c74('0x16'));var config=require(_0x9c74('0x17'));var licenseUtil=require(_0x9c74('0x18'));var db=require(_0x9c74('0x19'))['db'];function respondWithStatusCode(_0x243c83,_0x579a23){_0x579a23=_0x579a23||0xcc;return function(_0x1ac544){if(_0x1ac544){return _0x243c83['sendStatus'](_0x579a23);}return _0x243c83[_0x9c74('0x1a')](_0x579a23)[_0x9c74('0x1b')]();};}function respondWithResult(_0x265eb6,_0x545be8){_0x545be8=_0x545be8||0xc8;return function(_0x736cb9){if(_0x736cb9){return _0x265eb6[_0x9c74('0x1a')](_0x545be8)[_0x9c74('0x1c')](_0x736cb9);}};}function respondWithFilteredResult(_0xe869ff,_0x58e1a9){return function(_0x42995e){if(_0x42995e){var _0x29e303=typeof _0x58e1a9['offset']==='undefined'&&typeof _0x58e1a9[_0x9c74('0x1d')]===_0x9c74('0x1e');var _0x6ec413=_0x42995e['count'];var _0x13ae33=_0x29e303?0x0:_0x58e1a9[_0x9c74('0x1f')];var _0x173372=_0x29e303?_0x42995e['count']:_0x58e1a9[_0x9c74('0x1f')]+_0x58e1a9[_0x9c74('0x1d')];var _0x21ef9f;if(_0x173372>=_0x6ec413){_0x173372=_0x6ec413;_0x21ef9f=0xc8;}else{_0x21ef9f=0xce;}_0xe869ff[_0x9c74('0x1a')](_0x21ef9f);return _0xe869ff['set'](_0x9c74('0x20'),_0x13ae33+'-'+_0x173372+'/'+_0x6ec413)['json'](_0x42995e);}return null;};}function patchUpdates(_0x91011e){return function(_0x4e9b7c){try{jsonpatch['apply'](_0x4e9b7c,_0x91011e,!![]);}catch(_0x34f6fe){return BPromise['reject'](_0x34f6fe);}return _0x4e9b7c[_0x9c74('0x21')]();};}function saveUpdates(_0x5979f8,_0x299bfd){return function(_0x185533){if(_0x185533){return _0x185533[_0x9c74('0x22')](_0x5979f8)['then'](function(_0x2a677a){return _0x2a677a;});}return null;};}function removeEntity(_0x347f7e,_0x277097){return function(_0x3f293b){if(_0x3f293b){return _0x3f293b['destroy']()[_0x9c74('0x23')](function(){var _0x409e37=_0x3f293b[_0x9c74('0x24')]({'plain':!![]});var _0x53593a='CmHopperAdditionalPhones';return db[_0x9c74('0x25')][_0x9c74('0x26')]({'where':{'type':_0x53593a,'resourceId':_0x409e37['id']}})[_0x9c74('0x23')](function(){return _0x3f293b;});})[_0x9c74('0x23')](function(){_0x347f7e[_0x9c74('0x1a')](0xcc)[_0x9c74('0x1b')]();});}};}function handleEntityNotFound(_0x50a5c8,_0x21a000){return function(_0x417f81){if(!_0x417f81){_0x50a5c8[_0x9c74('0x27')](0x194);}return _0x417f81;};}function handleError(_0x36cef5,_0x496bc8){_0x496bc8=_0x496bc8||0x1f4;return function(_0x5a4db5){logger[_0x9c74('0x28')](_0x5a4db5[_0x9c74('0x29')]);if(_0x5a4db5[_0x9c74('0x2a')]){delete _0x5a4db5[_0x9c74('0x2a')];}_0x36cef5[_0x9c74('0x1a')](_0x496bc8)[_0x9c74('0x2b')](_0x5a4db5);};}exports[_0x9c74('0x2c')]=function(_0x25f51,_0x5bc1bd){var _0x5cbbc4={},_0x5a0472={},_0xeb17e1={'count':0x0,'rows':[]};var _0x292764=_[_0x9c74('0x2d')](db[_0x9c74('0x2e')]['rawAttributes'],function(_0x5f29a9){return{'name':_0x5f29a9[_0x9c74('0x2f')],'type':_0x5f29a9[_0x9c74('0x30')][_0x9c74('0x31')]};});_0x5a0472[_0x9c74('0x32')]=_['map'](_0x292764,_0x9c74('0x2a'));_0x5a0472[_0x9c74('0x33')]=_[_0x9c74('0x34')](_0x25f51[_0x9c74('0x33')]);_0x5a0472['filters']=_[_0x9c74('0x35')](_0x5a0472[_0x9c74('0x32')],_0x5a0472[_0x9c74('0x33')]);_0x5cbbc4['attributes']=_['intersection'](_0x5a0472[_0x9c74('0x32')],qs[_0x9c74('0x36')](_0x25f51[_0x9c74('0x33')]['fields']));_0x5cbbc4[_0x9c74('0x37')]=_0x5cbbc4[_0x9c74('0x37')][_0x9c74('0x38')]?_0x5cbbc4[_0x9c74('0x37')]:_0x5a0472[_0x9c74('0x32')];if(!_0x25f51[_0x9c74('0x33')][_0x9c74('0x39')](_0x9c74('0x3a'))){_0x5cbbc4['limit']=qs[_0x9c74('0x1d')](_0x25f51[_0x9c74('0x33')][_0x9c74('0x1d')]);_0x5cbbc4[_0x9c74('0x1f')]=qs['offset'](_0x25f51[_0x9c74('0x33')][_0x9c74('0x1f')]);}_0x5cbbc4[_0x9c74('0x3b')]=qs[_0x9c74('0x3c')](_0x25f51[_0x9c74('0x33')][_0x9c74('0x3c')]);_0x5cbbc4[_0x9c74('0x3d')]=qs[_0x9c74('0x3e')](_[_0x9c74('0x3f')](_0x25f51[_0x9c74('0x33')],_0x5a0472[_0x9c74('0x3e')]),_0x292764);if(_0x25f51[_0x9c74('0x33')][_0x9c74('0x40')]){_0x5cbbc4[_0x9c74('0x3d')]=_[_0x9c74('0x41')](_0x5cbbc4['where'],{'$or':_[_0x9c74('0x2d')](_0x292764,function(_0x2ceb7f){if(_0x2ceb7f[_0x9c74('0x30')]!==_0x9c74('0x42')){var _0x21b042={};_0x21b042[_0x2ceb7f[_0x9c74('0x2a')]]={'$like':'%'+_0x25f51['query'][_0x9c74('0x40')]+'%'};return _0x21b042;}})});}_0x5cbbc4=_['merge']({},_0x5cbbc4,_0x25f51['options']);var _0x7b969e={'where':_0x5cbbc4[_0x9c74('0x3d')]};return db[_0x9c74('0x2e')][_0x9c74('0x43')](_0x7b969e)[_0x9c74('0x23')](function(_0x3f34b9){_0xeb17e1[_0x9c74('0x43')]=_0x3f34b9;if(_0x25f51[_0x9c74('0x33')][_0x9c74('0x44')]){_0x5cbbc4['include']=[{'all':!![]}];}return db[_0x9c74('0x2e')][_0x9c74('0x45')](_0x5cbbc4);})[_0x9c74('0x23')](function(_0x4270f){_0xeb17e1[_0x9c74('0x46')]=_0x4270f;return _0xeb17e1;})[_0x9c74('0x23')](respondWithFilteredResult(_0x5bc1bd,_0x5cbbc4))[_0x9c74('0x47')](handleError(_0x5bc1bd,null));};exports['show']=function(_0x21a477,_0x127182){var _0x2580dd={'raw':!![],'where':{'id':_0x21a477[_0x9c74('0x48')]['id']}},_0x514ac3={};_0x514ac3[_0x9c74('0x32')]=_[_0x9c74('0x34')](db[_0x9c74('0x2e')][_0x9c74('0x49')]);_0x514ac3[_0x9c74('0x33')]=_[_0x9c74('0x34')](_0x21a477[_0x9c74('0x33')]);_0x514ac3[_0x9c74('0x3e')]=_[_0x9c74('0x35')](_0x514ac3[_0x9c74('0x32')],_0x514ac3[_0x9c74('0x33')]);_0x2580dd[_0x9c74('0x37')]=_[_0x9c74('0x35')](_0x514ac3[_0x9c74('0x32')],qs[_0x9c74('0x36')](_0x21a477['query'][_0x9c74('0x36')]));_0x2580dd[_0x9c74('0x37')]=_0x2580dd[_0x9c74('0x37')][_0x9c74('0x38')]?_0x2580dd[_0x9c74('0x37')]:_0x514ac3['model'];if(_0x21a477[_0x9c74('0x33')][_0x9c74('0x44')]){_0x2580dd[_0x9c74('0x4a')]=[{'all':!![]}];}_0x2580dd=_['merge']({},_0x2580dd,_0x21a477[_0x9c74('0x4b')]);return db[_0x9c74('0x2e')][_0x9c74('0x4c')](_0x2580dd)['then'](handleEntityNotFound(_0x127182,null))[_0x9c74('0x23')](respondWithResult(_0x127182,null))['catch'](handleError(_0x127182,null));};exports['create']=function(_0x221495,_0x4dee09){return db[_0x9c74('0x2e')][_0x9c74('0x4d')](_0x221495[_0x9c74('0x4e')],{})[_0x9c74('0x23')](function(_0x454a36){var _0x1eeae8=_0x221495[_0x9c74('0x4f')][_0x9c74('0x24')]({'plain':!![]});if(!_0x1eeae8)throw new Error(_0x9c74('0x50'));if(_0x1eeae8[_0x9c74('0x51')]===_0x9c74('0x4f')){var _0x1a9b1e=_0x454a36[_0x9c74('0x24')]({'plain':!![]});var _0x24fe45=_0x9c74('0x52');return db[_0x9c74('0x53')][_0x9c74('0x4c')]({'where':{'name':_0x24fe45,'userProfileId':_0x1eeae8[_0x9c74('0x54')]},'raw':!![]})[_0x9c74('0x23')](function(_0x25e450){if(_0x25e450&&_0x25e450[_0x9c74('0x55')]===0x0){return db[_0x9c74('0x25')][_0x9c74('0x4d')]({'name':_0x1a9b1e[_0x9c74('0x2a')],'resourceId':_0x1a9b1e['id'],'type':_0x25e450[_0x9c74('0x2a')],'sectionId':_0x25e450['id']},{})[_0x9c74('0x23')](function(){return _0x454a36;});}else{return _0x454a36;}})[_0x9c74('0x47')](function(_0x597d49){logger[_0x9c74('0x28')](_0x9c74('0x56'),_0x597d49);throw _0x597d49;});}return _0x454a36;})[_0x9c74('0x23')](respondWithResult(_0x4dee09,0xc9))[_0x9c74('0x47')](handleError(_0x4dee09,null));};exports[_0x9c74('0x22')]=function(_0x53a338,_0x3c0357){if(_0x53a338['body']['id']){delete _0x53a338[_0x9c74('0x4e')]['id'];}return db['CmHopperAdditionalPhone'][_0x9c74('0x4c')]({'where':{'id':_0x53a338[_0x9c74('0x48')]['id']}})[_0x9c74('0x23')](handleEntityNotFound(_0x3c0357,null))[_0x9c74('0x23')](saveUpdates(_0x53a338['body'],null))[_0x9c74('0x23')](respondWithResult(_0x3c0357,null))[_0x9c74('0x47')](handleError(_0x3c0357,null));};exports[_0x9c74('0x26')]=function(_0x3b358b,_0x20f639){return db[_0x9c74('0x2e')][_0x9c74('0x4c')]({'where':{'id':_0x3b358b[_0x9c74('0x48')]['id']}})[_0x9c74('0x23')](handleEntityNotFound(_0x20f639,null))[_0x9c74('0x23')](removeEntity(_0x20f639,null))['catch'](handleError(_0x20f639,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index c9d0594..e21b551 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb06c=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x306f7b,_0x5a39d8){var _0x16f26d=function(_0x475c6c){while(--_0x475c6c){_0x306f7b['push'](_0x306f7b['shift']());}};_0x16f26d(++_0x5a39d8);}(_0xb06c,0x123));var _0xcb06=function(_0x328b3e,_0x2d47a3){_0x328b3e=_0x328b3e-0x0;var _0x28f6a1=_0xb06c[_0x328b3e];return _0x28f6a1;};'use strict';var _=require('lodash');var util=require(_0xcb06('0x0'));var logger=require(_0xcb06('0x1'))('api');var moment=require(_0xcb06('0x2'));var BPromise=require(_0xcb06('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb06('0x4'));var rimraf=require('rimraf');var config=require(_0xcb06('0x5'));var attributes=require(_0xcb06('0x6'));module[_0xcb06('0x7')]=function(_0x4fd7d9,_0x3f7c42){return _0x4fd7d9[_0xcb06('0x8')](_0xcb06('0x9'),attributes,{'tableName':_0xcb06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf7c=['moment','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','util','../../config/logger'];(function(_0x17a00d,_0x319436){var _0x23a576=function(_0x457e5d){while(--_0x457e5d){_0x17a00d['push'](_0x17a00d['shift']());}};_0x23a576(++_0x319436);}(_0xdf7c,0x127));var _0xcdf7=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0xdf7c[_0x21de89];return _0x290b7e;};'use strict';var _=require('lodash');var util=require(_0xcdf7('0x0'));var logger=require(_0xcdf7('0x1'))('api');var moment=require(_0xcdf7('0x2'));var BPromise=require('bluebird');var rp=require(_0xcdf7('0x3'));var fs=require('fs');var path=require(_0xcdf7('0x4'));var rimraf=require(_0xcdf7('0x5'));var config=require(_0xcdf7('0x6'));var attributes=require(_0xcdf7('0x7'));module[_0xcdf7('0x8')]=function(_0x3a7d0f,_0x390a87){return _0x3a7d0f[_0xcdf7('0x9')](_0xcdf7('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index c760d75..cdb40d8 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22a2=['createdAt','updatedAt','phone','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','add','isNil'];(function(_0x32156e,_0x502add){var _0x584e82=function(_0x1de230){while(--_0x1de230){_0x32156e['push'](_0x32156e['shift']());}};_0x584e82(++_0x502add);}(_0x22a2,0xf0));var _0x222a=function(_0x2c5bf8,_0x436e68){_0x2c5bf8=_0x2c5bf8-0x0;var _0x1b5ace=_0x22a2[_0x2c5bf8];return _0x1b5ace;};'use strict';var _=require(_0x222a('0x0'));var util=require(_0x222a('0x1'));var moment=require(_0x222a('0x2'));var BPromise=require(_0x222a('0x3'));var rs=require(_0x222a('0x4'));var fs=require('fs');var Redis=require(_0x222a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x222a('0x6'));var logger=require(_0x222a('0x7'))('rpc');var config=require(_0x222a('0x8'));var jayson=require(_0x222a('0x9'));var client=jayson[_0x222a('0xa')][_0x222a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b83e2,_0x40b517,_0x3a4060){return new BPromise(function(_0x2b223f,_0x552b20){return client['request'](_0x5b83e2,_0x3a4060)[_0x222a('0xc')](function(_0x548656){logger[_0x222a('0xd')](_0x222a('0xe'),_0x40b517,_0x222a('0xf'));logger[_0x222a('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x40b517,_0x222a('0xf'),JSON[_0x222a('0x11')](_0x548656));if(_0x548656[_0x222a('0x12')]){if(_0x548656[_0x222a('0x12')][_0x222a('0x13')]===0x1f4){logger[_0x222a('0x12')](_0x222a('0xe'),_0x40b517,_0x548656[_0x222a('0x12')][_0x222a('0x14')]);return _0x552b20(_0x548656[_0x222a('0x12')]['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x40b517,_0x548656[_0x222a('0x12')][_0x222a('0x14')]);return _0x2b223f(_0x548656['error'][_0x222a('0x14')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x40b517,_0x222a('0xf'));_0x2b223f(_0x548656[_0x222a('0x15')][_0x222a('0x14')]);}})[_0x222a('0x16')](function(_0x1e92da){logger[_0x222a('0x12')](_0x222a('0xe'),_0x40b517,_0x1e92da);_0x552b20(_0x1e92da);});});}exports['VerifyAdditionalPhones']=function(_0x15bbcc){var _0x2bec49=this;return new Promise(function(_0x18c82a,_0xba529b){return db[_0x222a('0x17')][_0x222a('0x18')]({'raw':!![],'where':{'ContactId':_0x15bbcc[_0x222a('0x19')][_0x222a('0x1a')],'ListId':_0x15bbcc['body']['ListId'],'VoiceQueueId':_0x15bbcc['body'][_0x222a('0x1b')]===undefined?null:_0x15bbcc[_0x222a('0x19')]['VoiceQueueId'],'CampaignId':_0x15bbcc[_0x222a('0x19')][_0x222a('0x1c')]===undefined?null:_0x15bbcc[_0x222a('0x19')][_0x222a('0x1c')]}})[_0x222a('0xc')](function(_0x54211){if(_0x54211!=null){return db[_0x222a('0x1d')][_0x222a('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54211['id'],'OrderBy':{'$gt':_0x54211[_0x222a('0x1e')]}},'order':[['OrderBy',_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0xc44ee8){var _0xe25a02=0x0;if(_0xc44ee8){if(_0xc44ee8[_0x222a('0x20')]+_0xc44ee8[_0x222a('0x21')]+_0xc44ee8['countnoanswerretry']+_0xc44ee8[_0x222a('0x22')]+_0xc44ee8[_0x222a('0x23')]+_0xc44ee8[_0x222a('0x24')]+_0xc44ee8[_0x222a('0x25')]+_0xc44ee8[_0x222a('0x26')]<_0x15bbcc[_0x222a('0x27')][_0x222a('0x28')])_0xe25a02=0x1;_0x18c82a({'additional':_0xe25a02});}else{return db[_0x222a('0x1d')][_0x222a('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54211['id']},'order':[[_0x222a('0x1e'),_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0x5d1170){var _0x254111=0x0;if(_0x5d1170){if(_0x5d1170[_0x222a('0x20')]+_0x5d1170['countcongestionretry']+_0x5d1170[_0x222a('0x29')]+_0x5d1170['countnosuchnumberretry']+_0x5d1170['countdropretry']+_0x5d1170[_0x222a('0x24')]+_0x5d1170[_0x222a('0x25')]+_0x5d1170['countagentrejectretry']<_0x15bbcc['entity'][_0x222a('0x28')])_0x254111=0x1;_0x18c82a({'additional':_0x254111});}else{_0x18c82a({'additional':0x0});}})[_0x222a('0x16')](function(_0xee7aa9){logger[_0x222a('0x12')](_0x222a('0x2a'),_0xee7aa9[_0x222a('0x14')]);_0xba529b(_0x2bec49[_0x222a('0x12')](0x1f4,_0xee7aa9[_0x222a('0x14')]));});}})['catch'](function(_0x2c2fdf){logger[_0x222a('0x12')](_0x222a('0x2a'),_0x2c2fdf[_0x222a('0x14')]);_0xba529b(_0x2bec49[_0x222a('0x12')](0x1f4,_0x2c2fdf[_0x222a('0x14')]));});}else _0x18c82a({'additional':0x0});});});};exports[_0x222a('0x2b')]=function(_0x4f6aa1){var _0x1f39d5=this;return new Promise(function(_0x4f9212,_0x3d30d4){return db[_0x222a('0x17')][_0x222a('0x18')]({'raw':!![],'where':{'ContactId':_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1a')],'ListId':_0x4f6aa1[_0x222a('0x19')]['ListId'],'VoiceQueueId':_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1b')]===undefined?null:_0x4f6aa1['body'][_0x222a('0x1b')],'CampaignId':_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1c')]===undefined?null:_0x4f6aa1[_0x222a('0x19')][_0x222a('0x1c')]}})[_0x222a('0xc')](function(_0x36a830){if(_0x36a830!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x36a830['id'],'OrderBy':{'$gte':_0x36a830[_0x222a('0x1e')]}},'order':[[_0x222a('0x1e'),_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0x1e03b1){if(_0x1e03b1)return activateAdditionalPhone(_0x36a830,_0x4f6aa1[_0x222a('0x19')],_0x1e03b1,_0x4f6aa1[_0x222a('0x2c')],_0x4f6aa1[_0x222a('0x2d')])[_0x222a('0xc')](function(_0x5bde33){_0x4f9212(_0x5bde33);});else{return db['CmHopperAdditionalPhone'][_0x222a('0x18')]({'raw':!![],'where':{'CmHopperId':_0x36a830['id']},'order':[[_0x222a('0x1e'),_0x222a('0x1f')]]})[_0x222a('0xc')](function(_0x27265b){if(_0x27265b)return activateAdditionalPhone(_0x36a830,_0x4f6aa1['body'],_0x27265b,_0x4f6aa1['duration'],_0x4f6aa1[_0x222a('0x2d')])[_0x222a('0xc')](function(_0x2171b9){_0x4f9212(_0x2171b9);});else{_0x4f9212({'id':_0x36a830['id'],'phone':''});}})['catch'](function(_0x3123a7){logger[_0x222a('0x12')](_0x222a('0x2a'),_0x3123a7[_0x222a('0x14')]);_0x3d30d4(_0x1f39d5['error'](0x1f4,_0x3123a7[_0x222a('0x14')]));});}})[_0x222a('0x16')](function(_0x397e4a){logger[_0x222a('0x12')](_0x222a('0x2a'),_0x397e4a[_0x222a('0x14')]);_0x3d30d4(_0x1f39d5[_0x222a('0x12')](0x1f4,_0x397e4a[_0x222a('0x14')]));});}else _0x4f9212(0x1);});});};function activateAdditionalPhone(_0x442fdb,_0xc5d910,_0x36af97,_0x177c23,_0x3e8f5d){return new Promise(function(_0x2406af,_0x1695d2){var _0xd3397a;if(_['isNil'](_0x36af97[_0x222a('0x2e')])){_0x36af97[_0x222a('0x2e')]=moment();}if(moment()>moment(_0x36af97[_0x222a('0x2e')])){_0xd3397a=moment()['add'](_0x3e8f5d||0x3,_0x222a('0x2f'));}else{if(_0x36af97[_0x222a('0x1e')]==0x0){_0xd3397a=moment(_0x36af97[_0x222a('0x2e')]);}else{_0xd3397a=moment()[_0x222a('0x30')](_0x3e8f5d||0x3,_0x222a('0x2f'));}}if(_['isNil'](_0xd3397a)){_0xd3397a=moment()[_0x222a('0x30')](_0x3e8f5d||0x3,_0x222a('0x2f'));}var _0x2688a9={'phone':_0x442fdb['phone'],'active':0x0,'OrderBy':_[_0x222a('0x31')](_0x442fdb[_0x222a('0x1e')])?0x0:_0x442fdb[_0x222a('0x1e')],'scheduledat':moment()[_0x222a('0x30')](_0x177c23||0x1,'minutes'),'countbusyretry':_0xc5d910[_0x222a('0x20')],'countcongestionretry':_0xc5d910['countcongestionretry'],'countnoanswerretry':_0xc5d910[_0x222a('0x29')],'countnosuchnumberretry':_0xc5d910[_0x222a('0x22')],'countdropretry':_0xc5d910[_0x222a('0x23')],'countabandonedretry':_0xc5d910[_0x222a('0x24')],'countmachineretry':_0xc5d910[_0x222a('0x25')],'countagentrejectretry':_0xc5d910['countagentrejectretry'],'createdAt':_0xc5d910[_0x222a('0x32')],'updatedAt':_0xc5d910[_0x222a('0x33')]};var _0x4c2fe4={'CmHopperId':_0x442fdb['id'],'phone':_0x36af97[_0x222a('0x34')],'active':0x0,'OrderBy':_[_0x222a('0x31')](_0x36af97[_0x222a('0x1e')])?0x0:_0x36af97[_0x222a('0x1e')],'scheduledat':_0xd3397a,'countbusyretry':_0x36af97[_0x222a('0x20')],'countcongestionretry':_0x36af97[_0x222a('0x21')],'countnoanswerretry':_0x36af97['countnoanswerretry'],'countnosuchnumberretry':_0x36af97[_0x222a('0x22')],'countdropretry':_0x36af97[_0x222a('0x23')],'countabandonedretry':_0x36af97[_0x222a('0x24')],'countmachineretry':_0x36af97[_0x222a('0x25')],'countagentrejectretry':_0x36af97['countagentrejectretry'],'createdAt':_0x36af97[_0x222a('0x32')],'updatedAt':_0x36af97[_0x222a('0x33')]};return db[_0x222a('0x35')]['transaction'](function(_0x2919b8){return db[_0x222a('0x1d')][_0x222a('0x36')](_0x2688a9,{'where':{'id':_0x36af97['id']}},{'transaction':_0x2919b8})['then'](function(){return db[_0x222a('0x17')][_0x222a('0x36')](_0x4c2fe4,{'where':{'id':_0x442fdb['id']}},{'transaction':_0x2919b8});});})[_0x222a('0xc')](function(_0x5b77aa){_0x2406af({'id':_0x442fdb['id'],'phone':_0x36af97[_0x222a('0x34')]});})['catch'](function(_0x3a7661){logger[_0x222a('0x12')](_0x222a('0x37'),_0x3a7661[_0x222a('0x14')]);_0x1695d2({'error':_0x3a7661[_0x222a('0x14')]});});});}exports[_0x222a('0x38')]=function(_0x25250c){var _0x4c1489=this;return new Promise(function(_0x26e1ad,_0x19bd0d){return db['CmHopper'][_0x222a('0x36')](_0x25250c[_0x222a('0x19')][_0x222a('0x39')],{'where':{'id':_0x25250c[_0x222a('0x19')]['id']}})['then'](function(_0x1a7d4b){_0x26e1ad(_0x1a7d4b);})[_0x222a('0x16')](function(_0x5b1090){logger['error'](_0x222a('0x38'),_0x5b1090[_0x222a('0x14')]);_0x19bd0d(_0x4c1489['error'](0x1f4,_0x5b1090[_0x222a('0x14')]));});});}; \ No newline at end of file +var _0xb337=['countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','CmHopperAdditionalPhone','countdropretry','countmachineretry','entity','VerifyAdditionalPhones','SwapAdditionalPhones','ContactId','duration','waitTime','scheduledat','add','minutes','isNil','phone','countabandonedretry','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','then','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xb337,0x175));var _0x7b33=function(_0x320472,_0x4fff54){_0x320472=_0x320472-0x0;var _0x486e3a=_0xb337[_0x320472];return _0x486e3a;};'use strict';var _=require(_0x7b33('0x0'));var util=require(_0x7b33('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b33('0x2'));var fs=require('fs');var Redis=require(_0x7b33('0x3'));var db=require(_0x7b33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b33('0x5'))(_0x7b33('0x6'));var config=require('../../config/environment');var jayson=require(_0x7b33('0x7'));var client=jayson[_0x7b33('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4edb86,_0x507fe4,_0x268d9e){return new BPromise(function(_0x2d44bd,_0x3746ab){return client[_0x7b33('0x9')](_0x4edb86,_0x268d9e)['then'](function(_0x446eb6){logger[_0x7b33('0xa')](_0x7b33('0xb'),_0x507fe4,_0x7b33('0xc'));logger[_0x7b33('0xd')](_0x7b33('0xe'),_0x507fe4,_0x7b33('0xc'),JSON[_0x7b33('0xf')](_0x446eb6));if(_0x446eb6[_0x7b33('0x10')]){if(_0x446eb6['error'][_0x7b33('0x11')]===0x1f4){logger[_0x7b33('0x10')](_0x7b33('0xb'),_0x507fe4,_0x446eb6[_0x7b33('0x10')][_0x7b33('0x12')]);return _0x3746ab(_0x446eb6[_0x7b33('0x10')][_0x7b33('0x12')]);}logger[_0x7b33('0x10')](_0x7b33('0xb'),_0x507fe4,_0x446eb6['error'][_0x7b33('0x12')]);return _0x2d44bd(_0x446eb6[_0x7b33('0x10')][_0x7b33('0x12')]);}else{logger[_0x7b33('0xa')](_0x7b33('0xb'),_0x507fe4,_0x7b33('0xc'));_0x2d44bd(_0x446eb6[_0x7b33('0x13')][_0x7b33('0x12')]);}})[_0x7b33('0x14')](function(_0x2e2056){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x507fe4,_0x2e2056);_0x3746ab(_0x2e2056);});});}exports['VerifyAdditionalPhones']=function(_0x460331){var _0x577410=this;return new Promise(function(_0x224d13,_0xf2bf3d){return db[_0x7b33('0x15')][_0x7b33('0x16')]({'raw':!![],'where':{'ContactId':_0x460331['body']['ContactId'],'ListId':_0x460331[_0x7b33('0x17')][_0x7b33('0x18')],'VoiceQueueId':_0x460331[_0x7b33('0x17')][_0x7b33('0x19')]===undefined?null:_0x460331[_0x7b33('0x17')][_0x7b33('0x19')],'CampaignId':_0x460331[_0x7b33('0x17')][_0x7b33('0x1a')]===undefined?null:_0x460331[_0x7b33('0x17')][_0x7b33('0x1a')]}})[_0x7b33('0x1b')](function(_0x4c4077){if(_0x4c4077!=null){return db['CmHopperAdditionalPhone'][_0x7b33('0x16')]({'raw':!![],'where':{'CmHopperId':_0x4c4077['id'],'OrderBy':{'$gt':_0x4c4077['OrderBy']}},'order':[[_0x7b33('0x1c'),_0x7b33('0x1d')]]})['then'](function(_0x2866f3){var _0x12b0b2=0x0;if(_0x2866f3){if(_0x2866f3[_0x7b33('0x1e')]+_0x2866f3[_0x7b33('0x1f')]+_0x2866f3[_0x7b33('0x20')]+_0x2866f3[_0x7b33('0x21')]+_0x2866f3['countdropretry']+_0x2866f3['countabandonedretry']+_0x2866f3['countmachineretry']+_0x2866f3[_0x7b33('0x22')]<_0x460331['entity'][_0x7b33('0x23')])_0x12b0b2=0x1;_0x224d13({'additional':_0x12b0b2});}else{return db[_0x7b33('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4c4077['id']},'order':[[_0x7b33('0x1c'),'ASC']]})[_0x7b33('0x1b')](function(_0x457674){var _0x564953=0x0;if(_0x457674){if(_0x457674[_0x7b33('0x1e')]+_0x457674[_0x7b33('0x1f')]+_0x457674[_0x7b33('0x20')]+_0x457674[_0x7b33('0x21')]+_0x457674[_0x7b33('0x25')]+_0x457674['countabandonedretry']+_0x457674[_0x7b33('0x26')]+_0x457674[_0x7b33('0x22')]<_0x460331[_0x7b33('0x27')][_0x7b33('0x23')])_0x564953=0x1;_0x224d13({'additional':_0x564953});}else{_0x224d13({'additional':0x0});}})[_0x7b33('0x14')](function(_0xe761c4){logger[_0x7b33('0x10')](_0x7b33('0x28'),_0xe761c4['message']);_0xf2bf3d(_0x577410[_0x7b33('0x10')](0x1f4,_0xe761c4[_0x7b33('0x12')]));});}})['catch'](function(_0x41f9e3){logger[_0x7b33('0x10')](_0x7b33('0x28'),_0x41f9e3[_0x7b33('0x12')]);_0xf2bf3d(_0x577410[_0x7b33('0x10')](0x1f4,_0x41f9e3[_0x7b33('0x12')]));});}else _0x224d13({'additional':0x0});});});};exports[_0x7b33('0x29')]=function(_0x41e148){var _0x2f65ca=this;return new Promise(function(_0x57e4d3,_0x17b9ce){return db[_0x7b33('0x15')][_0x7b33('0x16')]({'raw':!![],'where':{'ContactId':_0x41e148[_0x7b33('0x17')][_0x7b33('0x2a')],'ListId':_0x41e148[_0x7b33('0x17')][_0x7b33('0x18')],'VoiceQueueId':_0x41e148[_0x7b33('0x17')][_0x7b33('0x19')]===undefined?null:_0x41e148[_0x7b33('0x17')][_0x7b33('0x19')],'CampaignId':_0x41e148[_0x7b33('0x17')][_0x7b33('0x1a')]===undefined?null:_0x41e148[_0x7b33('0x17')][_0x7b33('0x1a')]}})[_0x7b33('0x1b')](function(_0x694a11){if(_0x694a11!=null){return db['CmHopperAdditionalPhone'][_0x7b33('0x16')]({'raw':!![],'where':{'CmHopperId':_0x694a11['id'],'OrderBy':{'$gte':_0x694a11[_0x7b33('0x1c')]}},'order':[[_0x7b33('0x1c'),'ASC']]})[_0x7b33('0x1b')](function(_0x4d19de){if(_0x4d19de)return activateAdditionalPhone(_0x694a11,_0x41e148[_0x7b33('0x17')],_0x4d19de,_0x41e148[_0x7b33('0x2b')],_0x41e148[_0x7b33('0x2c')])[_0x7b33('0x1b')](function(_0x4984af){_0x57e4d3(_0x4984af);});else{return db[_0x7b33('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x694a11['id']},'order':[[_0x7b33('0x1c'),'ASC']]})[_0x7b33('0x1b')](function(_0x26358e){if(_0x26358e)return activateAdditionalPhone(_0x694a11,_0x41e148[_0x7b33('0x17')],_0x26358e,_0x41e148[_0x7b33('0x2b')],_0x41e148[_0x7b33('0x2c')])[_0x7b33('0x1b')](function(_0x4d51d2){_0x57e4d3(_0x4d51d2);});else{_0x57e4d3({'id':_0x694a11['id'],'phone':''});}})[_0x7b33('0x14')](function(_0x559bda){logger[_0x7b33('0x10')](_0x7b33('0x28'),_0x559bda['message']);_0x17b9ce(_0x2f65ca[_0x7b33('0x10')](0x1f4,_0x559bda[_0x7b33('0x12')]));});}})[_0x7b33('0x14')](function(_0x3b7989){logger['error'](_0x7b33('0x28'),_0x3b7989[_0x7b33('0x12')]);_0x17b9ce(_0x2f65ca[_0x7b33('0x10')](0x1f4,_0x3b7989[_0x7b33('0x12')]));});}else _0x57e4d3(0x1);});});};function activateAdditionalPhone(_0x513160,_0x23ff70,_0xa111f6,_0x775947,_0x42c595){return new Promise(function(_0x4d7e48,_0xd2eb55){var _0x325019;if(_['isNil'](_0xa111f6[_0x7b33('0x2d')])){_0xa111f6['scheduledat']=moment();}if(moment()>moment(_0xa111f6['scheduledat'])){_0x325019=moment()[_0x7b33('0x2e')](_0x42c595||0x3,_0x7b33('0x2f'));}else{if(_0xa111f6['OrderBy']==0x0){_0x325019=moment(_0xa111f6[_0x7b33('0x2d')]);}else{_0x325019=moment()[_0x7b33('0x2e')](_0x42c595||0x3,'minutes');}}if(_[_0x7b33('0x30')](_0x325019)){_0x325019=moment()[_0x7b33('0x2e')](_0x42c595||0x3,_0x7b33('0x2f'));}var _0x43bc23={'phone':_0x513160[_0x7b33('0x31')],'active':0x0,'OrderBy':_[_0x7b33('0x30')](_0x513160['OrderBy'])?0x0:_0x513160['OrderBy'],'scheduledat':moment()[_0x7b33('0x2e')](_0x775947||0x1,_0x7b33('0x2f')),'countbusyretry':_0x23ff70['countbusyretry'],'countcongestionretry':_0x23ff70[_0x7b33('0x1f')],'countnoanswerretry':_0x23ff70['countnoanswerretry'],'countnosuchnumberretry':_0x23ff70['countnosuchnumberretry'],'countdropretry':_0x23ff70[_0x7b33('0x25')],'countabandonedretry':_0x23ff70[_0x7b33('0x32')],'countmachineretry':_0x23ff70[_0x7b33('0x26')],'countagentrejectretry':_0x23ff70[_0x7b33('0x22')],'createdAt':_0x23ff70['createdAt'],'updatedAt':_0x23ff70['updatedAt']};var _0x2365e0={'CmHopperId':_0x513160['id'],'phone':_0xa111f6[_0x7b33('0x31')],'active':0x0,'OrderBy':_[_0x7b33('0x30')](_0xa111f6['OrderBy'])?0x0:_0xa111f6[_0x7b33('0x1c')],'scheduledat':_0x325019,'countbusyretry':_0xa111f6['countbusyretry'],'countcongestionretry':_0xa111f6['countcongestionretry'],'countnoanswerretry':_0xa111f6['countnoanswerretry'],'countnosuchnumberretry':_0xa111f6[_0x7b33('0x21')],'countdropretry':_0xa111f6['countdropretry'],'countabandonedretry':_0xa111f6[_0x7b33('0x32')],'countmachineretry':_0xa111f6[_0x7b33('0x26')],'countagentrejectretry':_0xa111f6[_0x7b33('0x22')],'createdAt':_0xa111f6['createdAt'],'updatedAt':_0xa111f6[_0x7b33('0x33')]};return db[_0x7b33('0x34')][_0x7b33('0x35')](function(_0x277a0d){return db[_0x7b33('0x24')]['update'](_0x43bc23,{'where':{'id':_0xa111f6['id']}},{'transaction':_0x277a0d})['then'](function(){return db[_0x7b33('0x15')][_0x7b33('0x36')](_0x2365e0,{'where':{'id':_0x513160['id']}},{'transaction':_0x277a0d});});})[_0x7b33('0x1b')](function(_0x1baedb){_0x4d7e48({'id':_0x513160['id'],'phone':_0xa111f6[_0x7b33('0x31')]});})[_0x7b33('0x14')](function(_0x1b34e5){logger[_0x7b33('0x10')](_0x7b33('0x37'),_0x1b34e5['message']);_0xd2eb55({'error':_0x1b34e5[_0x7b33('0x12')]});});});}exports[_0x7b33('0x38')]=function(_0xe14e8b){var _0x5244fb=this;return new Promise(function(_0x3af75e,_0x30a589){return db[_0x7b33('0x15')]['update'](_0xe14e8b['body'][_0x7b33('0x39')],{'where':{'id':_0xe14e8b[_0x7b33('0x17')]['id']}})['then'](function(_0x3dcdaa){_0x3af75e(_0x3dcdaa);})[_0x7b33('0x14')](function(_0x19ce9c){logger[_0x7b33('0x10')](_0x7b33('0x38'),_0x19ce9c['message']);_0x30a589(_0x5244fb['error'](0x1f4,_0x19ce9c[_0x7b33('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index eb55a96..5475473 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7da2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','exports','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7da2,0xba));var _0x27da=function(_0x2f6a18,_0x199b71){_0x2f6a18=_0x2f6a18-0x0;var _0x5150d2=_0x7da2[_0x2f6a18];return _0x5150d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x27da('0x0'));var timeout=require(_0x27da('0x1'));var express=require(_0x27da('0x2'));var router=express[_0x27da('0x3')]();var fs_extra=require(_0x27da('0x4'));var auth=require(_0x27da('0x5'));var interaction=require(_0x27da('0x6'));var config=require(_0x27da('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x27da('0x8')]('/',auth[_0x27da('0x9')](),controller[_0x27da('0xa')]);router[_0x27da('0x8')](_0x27da('0xb'),auth['isAuthenticated'](),controller[_0x27da('0xc')]);router['post']('/',auth[_0x27da('0x9')](),controller[_0x27da('0xd')]);router[_0x27da('0xe')](_0x27da('0xb'),auth[_0x27da('0x9')](),controller[_0x27da('0xf')]);router['delete'](_0x27da('0xb'),auth[_0x27da('0x9')](),controller['destroy']);module[_0x27da('0x10')]=router; \ No newline at end of file +var _0x2932=['path','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','multer'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2932,0xa7));var _0x2293=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x2932[_0x1abeb2];return _0x48da20;};'use strict';var multer=require(_0x2293('0x0'));var util=require('util');var path=require(_0x2293('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2293('0x2'));var config=require(_0x2293('0x3'));var controller=require(_0x2293('0x4'));router[_0x2293('0x5')]('/',auth[_0x2293('0x6')](),controller[_0x2293('0x7')]);router[_0x2293('0x5')](_0x2293('0x8'),auth[_0x2293('0x6')](),controller[_0x2293('0x9')]);router[_0x2293('0xa')]('/',auth['isAuthenticated'](),controller[_0x2293('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2293('0xc')]);router['delete'](_0x2293('0x8'),auth[_0x2293('0x6')](),controller[_0x2293('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c65efaf..e12bf9f 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 _0x2bae=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xe2ba('0x0'));var Sequelize=require(_0xe2ba('0x1'));module[_0xe2ba('0x2')]={'phone':{'type':Sequelize[_0xe2ba('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe2ba('0x4')],'unique':_0xe2ba('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xe2ba('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe2ba('0x5')}}; \ No newline at end of file +var _0x2f74=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x1a3bb7,_0x24054e){var _0x401a1c=function(_0x4209ca){while(--_0x4209ca){_0x1a3bb7['push'](_0x1a3bb7['shift']());}};_0x401a1c(++_0x24054e);}(_0x2f74,0x7b));var _0x42f7=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0x2f74[_0x483d2a];return _0x5ba5d5;};'use strict';var moment=require(_0x42f7('0x0'));var Sequelize=require('sequelize');module[_0x42f7('0x1')]={'phone':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x42f7('0x3')],'unique':_0x42f7('0x4')},'ListId':{'type':Sequelize[_0x42f7('0x3')],'unique':_0x42f7('0x4')},'VoiceQueueId':{'type':Sequelize[_0x42f7('0x3')],'unique':_0x42f7('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 5117629..0021bb5 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 _0x958a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','include','findAll','rows','catch','show','params','keys','includeAll','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x958a,0x128));var _0xa958=function(_0x3e8d88,_0x42890d){_0x3e8d88=_0x3e8d88-0x0;var _0x475517=_0x958a[_0x3e8d88];return _0x475517;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];function respondWithStatusCode(_0x53bf27,_0x5063ae){_0x5063ae=_0x5063ae||0xcc;return function(_0x5bcc66){if(_0x5bcc66){return _0x53bf27[_0xa958('0x1c')](_0x5063ae);}return _0x53bf27[_0xa958('0x1d')](_0x5063ae)[_0xa958('0x1e')]();};}function respondWithResult(_0x591d4d,_0x3ebc66){_0x3ebc66=_0x3ebc66||0xc8;return function(_0x54c439){if(_0x54c439){return _0x591d4d['status'](_0x3ebc66)['json'](_0x54c439);}};}function respondWithFilteredResult(_0x1fe41e,_0x15fca8){return function(_0xb90ac6){if(_0xb90ac6){var _0x6a81c7=typeof _0x15fca8[_0xa958('0x1f')]===_0xa958('0x20')&&typeof _0x15fca8[_0xa958('0x21')]===_0xa958('0x20');var _0x4d836f=_0xb90ac6[_0xa958('0x22')];var _0x4eadc9=_0x6a81c7?0x0:_0x15fca8[_0xa958('0x1f')];var _0x70d13e=_0x6a81c7?_0xb90ac6['count']:_0x15fca8[_0xa958('0x1f')]+_0x15fca8[_0xa958('0x21')];var _0x47636f;if(_0x70d13e>=_0x4d836f){_0x70d13e=_0x4d836f;_0x47636f=0xc8;}else{_0x47636f=0xce;}_0x1fe41e[_0xa958('0x1d')](_0x47636f);return _0x1fe41e[_0xa958('0x23')](_0xa958('0x24'),_0x4eadc9+'-'+_0x70d13e+'/'+_0x4d836f)['json'](_0xb90ac6);}return null;};}function patchUpdates(_0x4a90c2){return function(_0x373661){try{jsonpatch[_0xa958('0x25')](_0x373661,_0x4a90c2,!![]);}catch(_0x16c0be){return BPromise['reject'](_0x16c0be);}return _0x373661[_0xa958('0x26')]();};}function saveUpdates(_0x383aa3,_0x5c091a){return function(_0x28cf12){if(_0x28cf12){return _0x28cf12[_0xa958('0x27')](_0x383aa3)['then'](function(_0x5c5a2b){return _0x5c5a2b;});}return null;};}function removeEntity(_0x201ed3,_0x40b51e){return function(_0x50b3c3){if(_0x50b3c3){return _0x50b3c3[_0xa958('0x28')]()[_0xa958('0x29')](function(){_0x201ed3[_0xa958('0x1d')](0xcc)[_0xa958('0x1e')]();});}};}function handleEntityNotFound(_0x16b04a,_0xf1436e){return function(_0x50fdb1){if(!_0x50fdb1){_0x16b04a[_0xa958('0x1c')](0x194);}return _0x50fdb1;};}function handleError(_0x48ef34,_0x43df63){_0x43df63=_0x43df63||0x1f4;return function(_0x3c2ea3){logger[_0xa958('0x2a')](_0x3c2ea3[_0xa958('0x2b')]);if(_0x3c2ea3[_0xa958('0x2c')]){delete _0x3c2ea3[_0xa958('0x2c')];}_0x48ef34[_0xa958('0x1d')](_0x43df63)[_0xa958('0x2d')](_0x3c2ea3);};}exports[_0xa958('0x2e')]=function(_0x404d07,_0x4c4c37){var _0x47895c={},_0xd2fcc9={},_0x4ef4f6={'count':0x0,'rows':[]};var _0x1febd2=_[_0xa958('0x2f')](db['CmHopperBlack'][_0xa958('0x30')],function(_0x3d4711){return{'name':_0x3d4711[_0xa958('0x31')],'type':_0x3d4711[_0xa958('0x32')][_0xa958('0x33')]};});_0xd2fcc9['model']=_['map'](_0x1febd2,_0xa958('0x2c'));_0xd2fcc9['query']=_['keys'](_0x404d07[_0xa958('0x34')]);_0xd2fcc9[_0xa958('0x35')]=_[_0xa958('0x36')](_0xd2fcc9[_0xa958('0x37')],_0xd2fcc9[_0xa958('0x34')]);_0x47895c[_0xa958('0x38')]=_['intersection'](_0xd2fcc9[_0xa958('0x37')],qs['fields'](_0x404d07['query'][_0xa958('0x39')]));_0x47895c[_0xa958('0x38')]=_0x47895c[_0xa958('0x38')][_0xa958('0x3a')]?_0x47895c[_0xa958('0x38')]:_0xd2fcc9[_0xa958('0x37')];if(!_0x404d07[_0xa958('0x34')][_0xa958('0x3b')]('nolimit')){_0x47895c['limit']=qs[_0xa958('0x21')](_0x404d07[_0xa958('0x34')][_0xa958('0x21')]);_0x47895c[_0xa958('0x1f')]=qs[_0xa958('0x1f')](_0x404d07['query'][_0xa958('0x1f')]);}_0x47895c[_0xa958('0x3c')]=qs[_0xa958('0x3d')](_0x404d07[_0xa958('0x34')]['sort']);_0x47895c[_0xa958('0x3e')]=qs[_0xa958('0x35')](_[_0xa958('0x3f')](_0x404d07[_0xa958('0x34')],_0xd2fcc9[_0xa958('0x35')]),_0x1febd2);if(_0x404d07['query'][_0xa958('0x40')]){_0x47895c[_0xa958('0x3e')]=_[_0xa958('0x41')](_0x47895c[_0xa958('0x3e')],{'$or':_[_0xa958('0x2f')](_0x1febd2,function(_0x45603f){if(_0x45603f[_0xa958('0x32')]!==_0xa958('0x42')){var _0x2378df={};_0x2378df[_0x45603f[_0xa958('0x2c')]]={'$like':'%'+_0x404d07['query'][_0xa958('0x40')]+'%'};return _0x2378df;}})});}_0x47895c=_[_0xa958('0x41')]({},_0x47895c,_0x404d07[_0xa958('0x43')]);var _0x5d5ae1={'where':_0x47895c[_0xa958('0x3e')]};return db[_0xa958('0x44')]['count'](_0x5d5ae1)['then'](function(_0x53710e){_0x4ef4f6['count']=_0x53710e;if(_0x404d07[_0xa958('0x34')]['includeAll']){_0x47895c[_0xa958('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa958('0x46')](_0x47895c);})[_0xa958('0x29')](function(_0x44fa44){_0x4ef4f6[_0xa958('0x47')]=_0x44fa44;return _0x4ef4f6;})[_0xa958('0x29')](respondWithFilteredResult(_0x4c4c37,_0x47895c))[_0xa958('0x48')](handleError(_0x4c4c37,null));};exports[_0xa958('0x49')]=function(_0x18f110,_0x517319){var _0x10e4ee={'raw':!![],'where':{'id':_0x18f110[_0xa958('0x4a')]['id']}},_0x38dfb4={};_0x38dfb4['model']=_['keys'](db['CmHopperBlack'][_0xa958('0x30')]);_0x38dfb4[_0xa958('0x34')]=_[_0xa958('0x4b')](_0x18f110[_0xa958('0x34')]);_0x38dfb4[_0xa958('0x35')]=_['intersection'](_0x38dfb4[_0xa958('0x37')],_0x38dfb4[_0xa958('0x34')]);_0x10e4ee[_0xa958('0x38')]=_[_0xa958('0x36')](_0x38dfb4[_0xa958('0x37')],qs[_0xa958('0x39')](_0x18f110[_0xa958('0x34')][_0xa958('0x39')]));_0x10e4ee[_0xa958('0x38')]=_0x10e4ee[_0xa958('0x38')][_0xa958('0x3a')]?_0x10e4ee[_0xa958('0x38')]:_0x38dfb4[_0xa958('0x37')];if(_0x18f110[_0xa958('0x34')][_0xa958('0x4c')]){_0x10e4ee[_0xa958('0x45')]=[{'all':!![]}];}_0x10e4ee=_[_0xa958('0x41')]({},_0x10e4ee,_0x18f110['options']);return db['CmHopperBlack']['find'](_0x10e4ee)[_0xa958('0x29')](handleEntityNotFound(_0x517319,null))[_0xa958('0x29')](respondWithResult(_0x517319,null))[_0xa958('0x48')](handleError(_0x517319,null));};exports[_0xa958('0x27')]=function(_0x55ab45,_0x34faa2){if(_0x55ab45[_0xa958('0x4d')]['id']){delete _0x55ab45[_0xa958('0x4d')]['id'];}return db[_0xa958('0x44')][_0xa958('0x4e')]({'where':{'id':_0x55ab45['params']['id']}})[_0xa958('0x29')](handleEntityNotFound(_0x34faa2,null))[_0xa958('0x29')](saveUpdates(_0x55ab45[_0xa958('0x4d')],null))['then'](respondWithResult(_0x34faa2,null))[_0xa958('0x48')](handleError(_0x34faa2,null));};exports['destroy']=function(_0xf5ef34,_0x26e79b){return db[_0xa958('0x44')]['find']({'where':{'id':_0xf5ef34[_0xa958('0x4a')]['id']}})['then'](handleEntityNotFound(_0x26e79b,null))[_0xa958('0x29')](removeEntity(_0x26e79b,null))[_0xa958('0x48')](handleError(_0x26e79b,null));};exports[_0xa958('0x4f')]=function(_0x402d0a,_0x472d96){return db['CmHopperBlack'][_0xa958('0x4f')]()['then'](respondWithResult(_0x472d96,null))[_0xa958('0x48')](handleError(_0x472d96,null));}; \ No newline at end of file +var _0x7a62=['where','filters','pick','filter','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','rows','catch','show','params','find','update','body','describe','eml-format','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x3318b0,_0x197d1e){var _0x34b375=function(_0x54b64e){while(--_0x54b64e){_0x3318b0['push'](_0x3318b0['shift']());}};_0x34b375(++_0x197d1e);}(_0x7a62,0x17b));var _0x27a6=function(_0x244ebe,_0x2d27bb){_0x244ebe=_0x244ebe-0x0;var _0x425b7c=_0x7a62[_0x244ebe];return _0x425b7c;};'use strict';var emlformat=require(_0x27a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x27a6('0x1'));var BPromise=require(_0x27a6('0x2'));var Mustache=require(_0x27a6('0x3'));var util=require('util');var path=require(_0x27a6('0x4'));var sox=require(_0x27a6('0x5'));var csv=require('to-csv');var ejs=require(_0x27a6('0x6'));var fs=require('fs');var fs_extra=require(_0x27a6('0x7'));var _=require(_0x27a6('0x8'));var squel=require(_0x27a6('0x9'));var crypto=require(_0x27a6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x27a6('0xb'));var toCsv=require(_0x27a6('0xc'));var querystring=require('querystring');var Papa=require(_0x27a6('0xd'));var Redis=require(_0x27a6('0xe'));var authService=require(_0x27a6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x27a6('0x10'));var hardwareService=require(_0x27a6('0x11'));var logger=require(_0x27a6('0x12'))(_0x27a6('0x13'));var utils=require('../../config/utils');var config=require(_0x27a6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x27a6('0x15'))['db'];function respondWithStatusCode(_0x5c40e1,_0x20eb64){_0x20eb64=_0x20eb64||0xcc;return function(_0x43c3b5){if(_0x43c3b5){return _0x5c40e1[_0x27a6('0x16')](_0x20eb64);}return _0x5c40e1[_0x27a6('0x17')](_0x20eb64)[_0x27a6('0x18')]();};}function respondWithResult(_0xb3ff9f,_0x4e6d47){_0x4e6d47=_0x4e6d47||0xc8;return function(_0x5c770f){if(_0x5c770f){return _0xb3ff9f[_0x27a6('0x17')](_0x4e6d47)[_0x27a6('0x19')](_0x5c770f);}};}function respondWithFilteredResult(_0x3babac,_0x108e35){return function(_0x32a668){if(_0x32a668){var _0x5cc458=typeof _0x108e35[_0x27a6('0x1a')]==='undefined'&&typeof _0x108e35[_0x27a6('0x1b')]===_0x27a6('0x1c');var _0x235a35=_0x32a668[_0x27a6('0x1d')];var _0x1b0c0d=_0x5cc458?0x0:_0x108e35[_0x27a6('0x1a')];var _0xcdd9f8=_0x5cc458?_0x32a668['count']:_0x108e35[_0x27a6('0x1a')]+_0x108e35[_0x27a6('0x1b')];var _0x375f34;if(_0xcdd9f8>=_0x235a35){_0xcdd9f8=_0x235a35;_0x375f34=0xc8;}else{_0x375f34=0xce;}_0x3babac[_0x27a6('0x17')](_0x375f34);return _0x3babac['set']('Content-Range',_0x1b0c0d+'-'+_0xcdd9f8+'/'+_0x235a35)['json'](_0x32a668);}return null;};}function patchUpdates(_0x2dafa2){return function(_0xa97f89){try{jsonpatch[_0x27a6('0x1e')](_0xa97f89,_0x2dafa2,!![]);}catch(_0x47bea8){return BPromise[_0x27a6('0x1f')](_0x47bea8);}return _0xa97f89[_0x27a6('0x20')]();};}function saveUpdates(_0x5e3d1e,_0x18891c){return function(_0x1d62f3){if(_0x1d62f3){return _0x1d62f3['update'](_0x5e3d1e)[_0x27a6('0x21')](function(_0x34fc04){return _0x34fc04;});}return null;};}function removeEntity(_0x406778,_0xe2d7e){return function(_0x3f7143){if(_0x3f7143){return _0x3f7143['destroy']()[_0x27a6('0x21')](function(){_0x406778[_0x27a6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d71a0,_0x12f8fb){return function(_0x4de5ea){if(!_0x4de5ea){_0x3d71a0[_0x27a6('0x16')](0x194);}return _0x4de5ea;};}function handleError(_0x561dbc,_0x4b2c3c){_0x4b2c3c=_0x4b2c3c||0x1f4;return function(_0x440f1f){logger[_0x27a6('0x22')](_0x440f1f['stack']);if(_0x440f1f[_0x27a6('0x23')]){delete _0x440f1f[_0x27a6('0x23')];}_0x561dbc[_0x27a6('0x17')](_0x4b2c3c)[_0x27a6('0x24')](_0x440f1f);};}exports[_0x27a6('0x25')]=function(_0x1a970f,_0x4d39e4){var _0x35f4da={},_0x318b1c={},_0x11edc6={'count':0x0,'rows':[]};var _0x3511b6=_[_0x27a6('0x26')](db['CmHopperBlack'][_0x27a6('0x27')],function(_0x579989){return{'name':_0x579989[_0x27a6('0x28')],'type':_0x579989[_0x27a6('0x29')][_0x27a6('0x2a')]};});_0x318b1c['model']=_[_0x27a6('0x26')](_0x3511b6,_0x27a6('0x23'));_0x318b1c[_0x27a6('0x2b')]=_[_0x27a6('0x2c')](_0x1a970f[_0x27a6('0x2b')]);_0x318b1c['filters']=_['intersection'](_0x318b1c[_0x27a6('0x2d')],_0x318b1c[_0x27a6('0x2b')]);_0x35f4da[_0x27a6('0x2e')]=_[_0x27a6('0x2f')](_0x318b1c[_0x27a6('0x2d')],qs['fields'](_0x1a970f[_0x27a6('0x2b')][_0x27a6('0x30')]));_0x35f4da[_0x27a6('0x2e')]=_0x35f4da[_0x27a6('0x2e')][_0x27a6('0x31')]?_0x35f4da[_0x27a6('0x2e')]:_0x318b1c[_0x27a6('0x2d')];if(!_0x1a970f['query'][_0x27a6('0x32')]('nolimit')){_0x35f4da[_0x27a6('0x1b')]=qs['limit'](_0x1a970f['query']['limit']);_0x35f4da[_0x27a6('0x1a')]=qs[_0x27a6('0x1a')](_0x1a970f[_0x27a6('0x2b')]['offset']);}_0x35f4da[_0x27a6('0x33')]=qs[_0x27a6('0x34')](_0x1a970f[_0x27a6('0x2b')][_0x27a6('0x34')]);_0x35f4da[_0x27a6('0x35')]=qs[_0x27a6('0x36')](_[_0x27a6('0x37')](_0x1a970f[_0x27a6('0x2b')],_0x318b1c[_0x27a6('0x36')]),_0x3511b6);if(_0x1a970f[_0x27a6('0x2b')][_0x27a6('0x38')]){_0x35f4da[_0x27a6('0x35')]=_[_0x27a6('0x39')](_0x35f4da[_0x27a6('0x35')],{'$or':_[_0x27a6('0x26')](_0x3511b6,function(_0x51943e){if(_0x51943e[_0x27a6('0x29')]!==_0x27a6('0x3a')){var _0x6e9eb0={};_0x6e9eb0[_0x51943e[_0x27a6('0x23')]]={'$like':'%'+_0x1a970f[_0x27a6('0x2b')][_0x27a6('0x38')]+'%'};return _0x6e9eb0;}})});}_0x35f4da=_[_0x27a6('0x39')]({},_0x35f4da,_0x1a970f[_0x27a6('0x3b')]);var _0x1c79e1={'where':_0x35f4da[_0x27a6('0x35')]};return db[_0x27a6('0x3c')]['count'](_0x1c79e1)['then'](function(_0x138dfc){_0x11edc6[_0x27a6('0x1d')]=_0x138dfc;if(_0x1a970f[_0x27a6('0x2b')][_0x27a6('0x3d')]){_0x35f4da[_0x27a6('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x27a6('0x3f')](_0x35f4da);})[_0x27a6('0x21')](function(_0x318092){_0x11edc6[_0x27a6('0x40')]=_0x318092;return _0x11edc6;})[_0x27a6('0x21')](respondWithFilteredResult(_0x4d39e4,_0x35f4da))[_0x27a6('0x41')](handleError(_0x4d39e4,null));};exports[_0x27a6('0x42')]=function(_0x26a38f,_0x357158){var _0x28c07d={'raw':!![],'where':{'id':_0x26a38f[_0x27a6('0x43')]['id']}},_0xfdb3cc={};_0xfdb3cc[_0x27a6('0x2d')]=_[_0x27a6('0x2c')](db['CmHopperBlack']['rawAttributes']);_0xfdb3cc[_0x27a6('0x2b')]=_['keys'](_0x26a38f['query']);_0xfdb3cc[_0x27a6('0x36')]=_[_0x27a6('0x2f')](_0xfdb3cc[_0x27a6('0x2d')],_0xfdb3cc['query']);_0x28c07d[_0x27a6('0x2e')]=_['intersection'](_0xfdb3cc[_0x27a6('0x2d')],qs[_0x27a6('0x30')](_0x26a38f[_0x27a6('0x2b')][_0x27a6('0x30')]));_0x28c07d[_0x27a6('0x2e')]=_0x28c07d['attributes'][_0x27a6('0x31')]?_0x28c07d[_0x27a6('0x2e')]:_0xfdb3cc[_0x27a6('0x2d')];if(_0x26a38f[_0x27a6('0x2b')][_0x27a6('0x3d')]){_0x28c07d['include']=[{'all':!![]}];}_0x28c07d=_[_0x27a6('0x39')]({},_0x28c07d,_0x26a38f[_0x27a6('0x3b')]);return db[_0x27a6('0x3c')][_0x27a6('0x44')](_0x28c07d)['then'](handleEntityNotFound(_0x357158,null))['then'](respondWithResult(_0x357158,null))[_0x27a6('0x41')](handleError(_0x357158,null));};exports[_0x27a6('0x45')]=function(_0x5837bc,_0x6feebf){if(_0x5837bc[_0x27a6('0x46')]['id']){delete _0x5837bc[_0x27a6('0x46')]['id'];}return db['CmHopperBlack'][_0x27a6('0x44')]({'where':{'id':_0x5837bc[_0x27a6('0x43')]['id']}})['then'](handleEntityNotFound(_0x6feebf,null))['then'](saveUpdates(_0x5837bc[_0x27a6('0x46')],null))['then'](respondWithResult(_0x6feebf,null))[_0x27a6('0x41')](handleError(_0x6feebf,null));};exports['destroy']=function(_0xde1b77,_0x5678a4){return db[_0x27a6('0x3c')]['find']({'where':{'id':_0xde1b77['params']['id']}})[_0x27a6('0x21')](handleEntityNotFound(_0x5678a4,null))[_0x27a6('0x21')](removeEntity(_0x5678a4,null))[_0x27a6('0x41')](handleError(_0x5678a4,null));};exports[_0x27a6('0x47')]=function(_0x406ab7,_0x213ed2){return db[_0x27a6('0x3c')][_0x27a6('0x47')]()[_0x27a6('0x21')](respondWithResult(_0x213ed2,null))[_0x27a6('0x41')](handleError(_0x213ed2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index c9100dd..007f5ad 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 _0xcc2e=['define','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xcc2e,0x1e3));var _0xecc2=function(_0x3d94fd,_0x2e2021){_0x3d94fd=_0x3d94fd-0x0;var _0x337888=_0xcc2e[_0x3d94fd];return _0x337888;};'use strict';var _=require(_0xecc2('0x0'));var util=require(_0xecc2('0x1'));var logger=require(_0xecc2('0x2'))(_0xecc2('0x3'));var moment=require(_0xecc2('0x4'));var BPromise=require(_0xecc2('0x5'));var rp=require(_0xecc2('0x6'));var fs=require('fs');var path=require(_0xecc2('0x7'));var rimraf=require(_0xecc2('0x8'));var config=require(_0xecc2('0x9'));var attributes=require(_0xecc2('0xa'));module['exports']=function(_0x570eae,_0x41a816){return _0x570eae[_0xecc2('0xb')]('CmHopperBlack',attributes,{'tableName':_0xecc2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40c4=['bluebird','request-promise','path','rimraf','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment'];(function(_0x553bc8,_0x481382){var _0xc45407=function(_0x1831ac){while(--_0x1831ac){_0x553bc8['push'](_0x553bc8['shift']());}};_0xc45407(++_0x481382);}(_0x40c4,0x17b));var _0x440c=function(_0x152917,_0x4bccb9){_0x152917=_0x152917-0x0;var _0x3f1d31=_0x40c4[_0x152917];return _0x3f1d31;};'use strict';var _=require(_0x440c('0x0'));var util=require(_0x440c('0x1'));var logger=require(_0x440c('0x2'))(_0x440c('0x3'));var moment=require(_0x440c('0x4'));var BPromise=require(_0x440c('0x5'));var rp=require(_0x440c('0x6'));var fs=require('fs');var path=require(_0x440c('0x7'));var rimraf=require(_0x440c('0x8'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x440c('0x9')]=function(_0x47cc1c,_0x5c2cc3){return _0x47cc1c['define'](_0x440c('0xa'),attributes,{'tableName':_0x440c('0xb'),'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 076b1e9..aac082c 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 _0x993f=['jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperBlack','options','where','limit','include','map','model','attributes','GetCmHopperBlack','stringify','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x51847d,_0x3c6e25){var _0x28268b=function(_0x36a1d0){while(--_0x36a1d0){_0x51847d['push'](_0x51847d['shift']());}};_0x28268b(++_0x3c6e25);}(_0x993f,0x1a7));var _0xf993=function(_0x4901b2,_0x3a7ed9){_0x4901b2=_0x4901b2-0x0;var _0x1a00e9=_0x993f[_0x4901b2];return _0x1a00e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf993('0x0'));var BPromise=require(_0xf993('0x1'));var rs=require(_0xf993('0x2'));var fs=require('fs');var Redis=require(_0xf993('0x3'));var db=require(_0xf993('0x4'))['db'];var utils=require(_0xf993('0x5'));var logger=require(_0xf993('0x6'))(_0xf993('0x7'));var config=require(_0xf993('0x8'));var jayson=require(_0xf993('0x9'));var client=jayson['client'][_0xf993('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dd952,_0x4c0392,_0x5d4155){return new BPromise(function(_0x17284b,_0x5573ce){return client['request'](_0x3dd952,_0x5d4155)[_0xf993('0xb')](function(_0x48f929){logger[_0xf993('0xc')](_0xf993('0xd'),_0x4c0392,_0xf993('0xe'));logger[_0xf993('0xf')](_0xf993('0x10'),_0x4c0392,_0xf993('0xe'),JSON['stringify'](_0x48f929));if(_0x48f929[_0xf993('0x11')]){if(_0x48f929[_0xf993('0x11')]['code']===0x1f4){logger[_0xf993('0x11')](_0xf993('0xd'),_0x4c0392,_0x48f929[_0xf993('0x11')][_0xf993('0x12')]);return _0x5573ce(_0x48f929['error'][_0xf993('0x12')]);}logger[_0xf993('0x11')](_0xf993('0xd'),_0x4c0392,_0x48f929['error'][_0xf993('0x12')]);return _0x17284b(_0x48f929[_0xf993('0x11')][_0xf993('0x12')]);}else{logger['info'](_0xf993('0xd'),_0x4c0392,_0xf993('0xe'));_0x17284b(_0x48f929['result'][_0xf993('0x12')]);}})[_0xf993('0x13')](function(_0x428263){logger[_0xf993('0x11')](_0xf993('0xd'),_0x4c0392,_0x428263);_0x5573ce(_0x428263);});});}exports['GetCmHopperBlack']=function(_0x1932dc){var _0x488e7f=this;return new Promise(function(_0x570f48,_0x3c6dea){return db[_0xf993('0x14')]['findAll']({'raw':_0x1932dc[_0xf993('0x15')]?_0x1932dc[_0xf993('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1932dc['options']?_0x1932dc[_0xf993('0x15')][_0xf993('0x16')]||null:null,'attributes':_0x1932dc[_0xf993('0x15')]?_0x1932dc[_0xf993('0x15')]['attributes']||null:null,'limit':_0x1932dc[_0xf993('0x15')]?_0x1932dc['options'][_0xf993('0x17')]||null:null,'include':_0x1932dc[_0xf993('0x15')]?_0x1932dc[_0xf993('0x15')][_0xf993('0x18')]?_[_0xf993('0x19')](_0x1932dc[_0xf993('0x15')]['include'],function(_0x47c1d7){return{'model':db[_0x47c1d7[_0xf993('0x1a')]],'as':_0x47c1d7['as'],'attributes':_0x47c1d7[_0xf993('0x1b')],'include':_0x47c1d7[_0xf993('0x18')]?_[_0xf993('0x19')](_0x47c1d7[_0xf993('0x18')],function(_0x54d62f){return{'model':db[_0x54d62f[_0xf993('0x1a')]],'as':_0x54d62f['as'],'attributes':_0x54d62f[_0xf993('0x1b')],'include':_0x54d62f[_0xf993('0x18')]?_[_0xf993('0x19')](_0x54d62f[_0xf993('0x18')],function(_0x1e201b){return{'model':db[_0x1e201b[_0xf993('0x1a')]],'as':_0x1e201b['as'],'attributes':_0x1e201b[_0xf993('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e04be){logger['info']('GetCmHopperBlack',_0x1932dc);logger[_0xf993('0xf')](_0xf993('0x1c'),_0x1932dc,JSON[_0xf993('0x1d')](_0x4e04be));_0x570f48(_0x4e04be);})[_0xf993('0x13')](function(_0x92466f){logger[_0xf993('0x11')](_0xf993('0x1c'),_0x92466f['message'],_0x1932dc);_0x3c6dea(_0x488e7f[_0xf993('0x11')](0x1f4,_0x92466f[_0xf993('0x12')]));});});};exports[_0xf993('0x1e')]=function(_0x12c2c7){var _0x360830=this;return new Promise(function(_0x564a5d,_0x28cafe){return db[_0xf993('0x14')][_0xf993('0x1f')](_0x12c2c7[_0xf993('0x20')],{'raw':_0x12c2c7['options']?_0x12c2c7[_0xf993('0x15')][_0xf993('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c2c7['options']?_0x12c2c7[_0xf993('0x15')]['where']||null:null,'attributes':_0x12c2c7['options']?_0x12c2c7[_0xf993('0x15')]['attributes']||null:null,'limit':_0x12c2c7[_0xf993('0x15')]?_0x12c2c7[_0xf993('0x15')][_0xf993('0x17')]||null:null})[_0xf993('0xb')](function(_0x2e0e75){logger[_0xf993('0xc')]('UpdateCmHopperBlack',_0x12c2c7);logger[_0xf993('0xf')]('UpdateCmHopperBlack',_0x12c2c7,JSON[_0xf993('0x1d')](_0x2e0e75));_0x564a5d(_0x2e0e75);})[_0xf993('0x13')](function(_0x3edca3){logger[_0xf993('0x11')](_0xf993('0x1e'),_0x3edca3[_0xf993('0x12')],_0x12c2c7);_0x28cafe(_0x360830['error'](0x1f4,_0x3edca3[_0xf993('0x12')]));});});};exports[_0xf993('0x22')]=function(_0x4b5866){var _0x199928=this;return new Promise(function(_0x7f7d80,_0x49331d){return db[_0xf993('0x14')][_0xf993('0x23')]({'where':_0x4b5866[_0xf993('0x15')]?_0x4b5866['options'][_0xf993('0x16')]||null:null})[_0xf993('0xb')](function(_0x5b3460){logger[_0xf993('0xc')]('DestroyCmHopperBlack',_0x4b5866);logger['debug']('DestroyCmHopperBlack',_0x4b5866,JSON[_0xf993('0x1d')](_0x5b3460));_0x7f7d80(_0x5b3460);})['catch'](function(_0x1d8352){logger[_0xf993('0x11')]('DestroyCmHopperBlack',_0x1d8352['message'],_0x4b5866);_0x49331d(_0x199928[_0xf993('0x11')](0x1f4,_0x1d8352[_0xf993('0x12')]));});});}; \ No newline at end of file +var _0x4b10=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','options','raw','attributes','include','map','model','UpdateCmHopperBlack','CmHopperBlack','limit','DestroyCmHopperBlack','destroy','where','util','moment','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b10,0xd3));var _0x04b1=function(_0x5b32e2,_0x59eae9){_0x5b32e2=_0x5b32e2-0x0;var _0x4c1c01=_0x4b10[_0x5b32e2];return _0x4c1c01;};'use strict';var _=require('lodash');var util=require(_0x04b1('0x0'));var moment=require(_0x04b1('0x1'));var BPromise=require(_0x04b1('0x2'));var rs=require(_0x04b1('0x3'));var fs=require('fs');var Redis=require(_0x04b1('0x4'));var db=require(_0x04b1('0x5'))['db'];var utils=require(_0x04b1('0x6'));var logger=require(_0x04b1('0x7'))('rpc');var config=require(_0x04b1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04b1('0x9')][_0x04b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e5cb6,_0x4e6312,_0x309dde){return new BPromise(function(_0x4ba200,_0x1bc2db){return client[_0x04b1('0xb')](_0x1e5cb6,_0x309dde)[_0x04b1('0xc')](function(_0x42b9e8){logger[_0x04b1('0xd')](_0x04b1('0xe'),_0x4e6312,_0x04b1('0xf'));logger[_0x04b1('0x10')](_0x04b1('0x11'),_0x4e6312,_0x04b1('0xf'),JSON[_0x04b1('0x12')](_0x42b9e8));if(_0x42b9e8['error']){if(_0x42b9e8[_0x04b1('0x13')]['code']===0x1f4){logger[_0x04b1('0x13')](_0x04b1('0xe'),_0x4e6312,_0x42b9e8[_0x04b1('0x13')][_0x04b1('0x14')]);return _0x1bc2db(_0x42b9e8[_0x04b1('0x13')][_0x04b1('0x14')]);}logger[_0x04b1('0x13')](_0x04b1('0xe'),_0x4e6312,_0x42b9e8[_0x04b1('0x13')][_0x04b1('0x14')]);return _0x4ba200(_0x42b9e8['error'][_0x04b1('0x14')]);}else{logger[_0x04b1('0xd')](_0x04b1('0xe'),_0x4e6312,'request\x20sent');_0x4ba200(_0x42b9e8[_0x04b1('0x15')]['message']);}})[_0x04b1('0x16')](function(_0x193531){logger['error'](_0x04b1('0xe'),_0x4e6312,_0x193531);_0x1bc2db(_0x193531);});});}exports[_0x04b1('0x17')]=function(_0x5eaef3){var _0x40bdc8=this;return new Promise(function(_0x39aeba,_0x4c7ade){return db['CmHopperBlack']['findAll']({'raw':_0x5eaef3[_0x04b1('0x18')]?_0x5eaef3[_0x04b1('0x18')][_0x04b1('0x19')]===undefined?!![]:![]:!![],'where':_0x5eaef3[_0x04b1('0x18')]?_0x5eaef3[_0x04b1('0x18')]['where']||null:null,'attributes':_0x5eaef3[_0x04b1('0x18')]?_0x5eaef3[_0x04b1('0x18')][_0x04b1('0x1a')]||null:null,'limit':_0x5eaef3[_0x04b1('0x18')]?_0x5eaef3['options']['limit']||null:null,'include':_0x5eaef3[_0x04b1('0x18')]?_0x5eaef3[_0x04b1('0x18')][_0x04b1('0x1b')]?_[_0x04b1('0x1c')](_0x5eaef3[_0x04b1('0x18')][_0x04b1('0x1b')],function(_0x21e4e3){return{'model':db[_0x21e4e3[_0x04b1('0x1d')]],'as':_0x21e4e3['as'],'attributes':_0x21e4e3['attributes'],'include':_0x21e4e3['include']?_['map'](_0x21e4e3['include'],function(_0x8d207c){return{'model':db[_0x8d207c[_0x04b1('0x1d')]],'as':_0x8d207c['as'],'attributes':_0x8d207c[_0x04b1('0x1a')],'include':_0x8d207c['include']?_[_0x04b1('0x1c')](_0x8d207c[_0x04b1('0x1b')],function(_0x1e8fa3){return{'model':db[_0x1e8fa3[_0x04b1('0x1d')]],'as':_0x1e8fa3['as'],'attributes':_0x1e8fa3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x497344){logger['info'](_0x04b1('0x17'),_0x5eaef3);logger[_0x04b1('0x10')](_0x04b1('0x17'),_0x5eaef3,JSON['stringify'](_0x497344));_0x39aeba(_0x497344);})['catch'](function(_0x4c2f50){logger['error']('GetCmHopperBlack',_0x4c2f50['message'],_0x5eaef3);_0x4c7ade(_0x40bdc8[_0x04b1('0x13')](0x1f4,_0x4c2f50[_0x04b1('0x14')]));});});};exports[_0x04b1('0x1e')]=function(_0x331f8f){var _0x440fda=this;return new Promise(function(_0x550acc,_0x5099a1){return db[_0x04b1('0x1f')]['update'](_0x331f8f['body'],{'raw':_0x331f8f[_0x04b1('0x18')]?_0x331f8f[_0x04b1('0x18')][_0x04b1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331f8f['options']?_0x331f8f[_0x04b1('0x18')]['where']||null:null,'attributes':_0x331f8f[_0x04b1('0x18')]?_0x331f8f[_0x04b1('0x18')]['attributes']||null:null,'limit':_0x331f8f[_0x04b1('0x18')]?_0x331f8f[_0x04b1('0x18')][_0x04b1('0x20')]||null:null})['then'](function(_0x44c421){logger[_0x04b1('0xd')]('UpdateCmHopperBlack',_0x331f8f);logger[_0x04b1('0x10')]('UpdateCmHopperBlack',_0x331f8f,JSON[_0x04b1('0x12')](_0x44c421));_0x550acc(_0x44c421);})[_0x04b1('0x16')](function(_0x433d3c){logger[_0x04b1('0x13')]('UpdateCmHopperBlack',_0x433d3c[_0x04b1('0x14')],_0x331f8f);_0x5099a1(_0x440fda[_0x04b1('0x13')](0x1f4,_0x433d3c[_0x04b1('0x14')]));});});};exports[_0x04b1('0x21')]=function(_0xd0fcf0){var _0x26b927=this;return new Promise(function(_0x4d29c8,_0x560dca){return db[_0x04b1('0x1f')][_0x04b1('0x22')]({'where':_0xd0fcf0['options']?_0xd0fcf0[_0x04b1('0x18')][_0x04b1('0x23')]||null:null})[_0x04b1('0xc')](function(_0x1b40a5){logger[_0x04b1('0xd')](_0x04b1('0x21'),_0xd0fcf0);logger[_0x04b1('0x10')](_0x04b1('0x21'),_0xd0fcf0,JSON[_0x04b1('0x12')](_0x1b40a5));_0x4d29c8(_0x1b40a5);})[_0x04b1('0x16')](function(_0x5f47dc){logger[_0x04b1('0x13')](_0x04b1('0x21'),_0x5f47dc[_0x04b1('0x14')],_0xd0fcf0);_0x560dca(_0x26b927[_0x04b1('0x13')](0x1f4,_0x5f47dc[_0x04b1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ea733db..801c1dd 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 _0x7046=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','show','put','/:id','update','delete'];(function(_0x3e28cd,_0x3842b6){var _0x5c4f99=function(_0x21a71d){while(--_0x21a71d){_0x3e28cd['push'](_0x3e28cd['shift']());}};_0x5c4f99(++_0x3842b6);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0xe')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller[_0x6704('0x10')]);router[_0x6704('0x11')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller['destroy']);module[_0x6704('0x12')]=router; \ No newline at end of file +var _0x01d9=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['delete'](_0x901d('0xf'),auth['isAuthenticated'](),controller[_0x901d('0x13')]);module[_0x901d('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7972508..f362b7b 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 _0x6500=['seconds','BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','diff'];(function(_0x9d5b2f,_0x3a7784){var _0x5c7e41=function(_0x31e8e0){while(--_0x31e8e0){_0x9d5b2f['push'](_0x9d5b2f['shift']());}};_0x5c7e41(++_0x3a7784);}(_0x6500,0xd1));var _0x0650=function(_0xcff24d,_0x9a1aba){_0xcff24d=_0xcff24d-0x0;var _0x303f5f=_0x6500[_0xcff24d];return _0x303f5f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0650('0x0')]={'state':{'type':Sequelize[_0x0650('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0650('0x2')]},'scheduledat':{'type':Sequelize[_0x0650('0x3')]},'countbusyretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x0650('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0650('0x2')]},'calleridname':{'type':Sequelize[_0x0650('0x2')]},'starttime':{'type':Sequelize[_0x0650('0x3')]},'responsetime':{'type':Sequelize[_0x0650('0x3')]},'answertime':{'type':Sequelize[_0x0650('0x3')]},'droptime':{'type':Sequelize[_0x0650('0x3')]},'endtime':{'type':Sequelize[_0x0650('0x3')]},'ringtime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0650('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0650('0x2')]},'membername':{'type':Sequelize[_0x0650('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0650('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0650('0x2')]},'dispositionat':{'type':Sequelize[_0x0650('0x3')],'set':function(_0x3f0e95){var _0x4808fd=this[_0x0650('0x4')]('endtime');if(_0x4808fd&&_0x3f0e95){this[_0x0650('0x5')]('followuptime',moment(_0x3f0e95)[_0x0650('0x6')](moment(_0x4808fd),_0x0650('0x7')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0650('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0650('0x3')]},'deleted':{'type':Sequelize[_0x0650('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0650('0x3')]},'recallme':{'type':Sequelize[_0x0650('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0650('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0650('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb28e=['STRING','DATE','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','INTEGER'];(function(_0x39e4a6,_0x50da25){var _0xbb9f29=function(_0x471367){while(--_0x471367){_0x39e4a6['push'](_0x39e4a6['shift']());}};_0xbb9f29(++_0x50da25);}(_0xb28e,0xc4));var _0xeb28=function(_0x84eba7,_0x49c450){_0x84eba7=_0x84eba7-0x0;var _0x289afc=_0xb28e[_0x84eba7];return _0x289afc;};'use strict';var Sequelize=require(_0xeb28('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xeb28('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xeb28('0x2')]},'scheduledat':{'type':Sequelize[_0xeb28('0x3')]},'countbusyretry':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xeb28('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xeb28('0x2')]},'calleridnum':{'type':Sequelize[_0xeb28('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xeb28('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xeb28('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb28('0x2')]},'campaign':{'type':Sequelize[_0xeb28('0x2')]},'campaigntype':{'type':Sequelize[_0xeb28('0x2')]},'membername':{'type':Sequelize[_0xeb28('0x2')]},'reason':{'type':Sequelize[_0xeb28('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xeb28('0x2')]},'dispositionat':{'type':Sequelize[_0xeb28('0x3')],'set':function(_0x47e885){var _0xe32ace=this['getDataValue'](_0xeb28('0x4'));if(_0xe32ace&&_0x47e885){this[_0xeb28('0x5')]('followuptime',moment(_0x47e885)[_0xeb28('0x6')](moment(_0xe32ace),_0xeb28('0x7')));}}},'amd':{'type':Sequelize[_0xeb28('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xeb28('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xeb28('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xeb28('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xeb28('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb28('0x3')]},'deleted':{'type':Sequelize[_0xeb28('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xeb28('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeb28('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 95611d1..88db8e8 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 _0xfdbd=['status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','params','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5dee43,_0x35aa9b){var _0x3bcfb0=function(_0x22dad2){while(--_0x22dad2){_0x5dee43['push'](_0x5dee43['shift']());}};_0x3bcfb0(++_0x35aa9b);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x18baf4,_0x33086b){_0x18baf4=_0x18baf4-0x0;var _0x278ed1=_0xfdbd[_0x18baf4];return _0x278ed1;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':!![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['CmHopperFinal']['describe']()[_0xdfdb('0x26')](respondWithResult(_0x273477,null))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports[_0xdfdb('0x24')]=function(_0x4bbb88,_0x36149e){if(_0x4bbb88[_0xdfdb('0x4b')][_0xdfdb('0x4c')]){delete _0x4bbb88[_0xdfdb('0x4b')]['uniqueid'];}return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'uniqueid':_0x4bbb88['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x36149e,null))[_0xdfdb('0x26')](saveUpdates(_0x4bbb88[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x36149e,null))[_0xdfdb('0x49')](handleError(_0x36149e,null));};exports[_0xdfdb('0x4d')]=function(_0x17dfdb,_0x1f5b88,_0x1da7af){return db['CmHopperFinal'][_0xdfdb('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x17dfdb['params']['id']},'attributes':[[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x53')))),'noAnswerContacts'],[db[_0xdfdb('0x4e')]['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x54')))),_0xdfdb('0x55')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x56')))),_0xdfdb('0x57')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x58')))),_0xdfdb('0x59')],[db['sequelize']['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5b')))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')]['literal'](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x1f5b88,null))['then'](respondWithResult(_0x1f5b88,null))[_0xdfdb('0x49')](handleError(_0x1f5b88,null));};exports[_0xdfdb('0x5f')]=function(_0x349cf7,_0x2f69a8,_0x424212){return db[_0xdfdb('0x2d')][_0xdfdb('0x44')]({'raw':![],'where':{'CampaignId':_0x349cf7[_0xdfdb('0x60')]['id']},'attributes':[[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xdfdb('0x61')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x54')))),'busyContacts'],[db['sequelize']['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xdfdb('0x57')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfdb('0x59')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x2f69a8,null))[_0xdfdb('0x26')](respondWithResult(_0x2f69a8,null))['catch'](handleError(_0x2f69a8,null));};exports[_0xdfdb('0x62')]=function(_0x198cfa,_0x2831d6,_0x45bfc0){return db[_0xdfdb('0x63')]['find']({'where':{'id':_0x198cfa[_0xdfdb('0x60')]['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x2831d6,null))[_0xdfdb('0x26')](function(_0x1a31b9){var _0x4999c4;if(_0x1a31b9){_0x4999c4=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')](_0xdfdb('0x66'))[_0xdfdb('0x67')]([_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel['select']()[_0xdfdb('0x6f')](_0xdfdb('0x70'),'phone')[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)','ContactId')[_0xdfdb('0x6f')](_0xdfdb('0x72'),_0xdfdb('0x6b'))[_0xdfdb('0x6f')](_0xdfdb('0x73'),_0xdfdb('0x6c'))[_0xdfdb('0x6f')]('NOW()',_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')]('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id'][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x77'),_0x198cfa[_0xdfdb('0x4b')]['state'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')]('phone')[_0xdfdb('0x74')](_0xdfdb('0x66'))['where']('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id']['toString']()))['where'](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x7c'),_0x198cfa['params']['id'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x7d')))[_0xdfdb('0x7e')](_0xdfdb('0x6a')))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x4999c4);}return[];})[_0xdfdb('0x26')](respondWithResult(_0x2831d6,null))[_0xdfdb('0x49')](handleError(_0x2831d6,null));};exports[_0xdfdb('0x7f')]=function(_0x1b6445,_0x36241c,_0x4c833f){return db['Campaign'][_0xdfdb('0x48')]({'where':{'id':_0x1b6445[_0xdfdb('0x60')]['id']}})['then'](handleEntityNotFound(_0x36241c,null))[_0xdfdb('0x26')](function(_0x50d5d4){var _0x158454;if(_0x50d5d4){_0x158454=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')]('cm_hopper')[_0xdfdb('0x67')](['phone','scheduledAt',_0xdfdb('0x6a'),'ListId',_0xdfdb('0x80'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x70'),_0xdfdb('0x68'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)',_0xdfdb('0x6a'))['field']('ANY_VALUE(ListId)','ListId')['field'](_0xdfdb('0x81'),_0xdfdb('0x80'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x77'),_0x1b6445[_0xdfdb('0x4b')][_0xdfdb('0x83')][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()['field'](_0xdfdb('0x68'))[_0xdfdb('0x74')](_0xdfdb('0x66'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']()))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')]('cm_hopper_final')[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x7d')))['group']('ContactId'))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x158454);}return[];})['then'](respondWithResult(_0x36241c,null))[_0xdfdb('0x49')](handleError(_0x36241c,null));};exports[_0xdfdb('0x84')]=function(_0x1f87d3,_0x1bc293,_0x36b01e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x1f87d3[_0xdfdb('0x4b')]['VoiceQueueId'],'CampaignId':_0x1f87d3[_0xdfdb('0x4b')][_0xdfdb('0x80')],'ContactId':_0x1f87d3[_0xdfdb('0x4b')]['ContactId']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x1bc293,null))[_0xdfdb('0x26')](function(_0x3e0208){if(_0x3e0208){return _0x3e0208;}return null;})[_0xdfdb('0x26')](respondWithResult(_0x1bc293,null))['catch'](handleError(_0x1bc293,null));}; \ No newline at end of file +var _0x01d9=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','updatedAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2f4284,_0x58c975){var _0x1c9a99=function(_0x24a48b){while(--_0x24a48b){_0x2f4284['push'](_0x2f4284['shift']());}};_0x1c9a99(++_0x58c975);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['CmHopperFinal'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')]()[_0x901d('0x28')](respondWithResult(_0x27459b,null))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x2cd965,_0x23f2a9){if(_0x2cd965['body']['uniqueid']){delete _0x2cd965[_0x901d('0x4c')][_0x901d('0x4d')];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'uniqueid':_0x2cd965[_0x901d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23f2a9,null))['then'](saveUpdates(_0x2cd965[_0x901d('0x4c')],null))[_0x901d('0x28')](respondWithResult(_0x23f2a9,null))['catch'](handleError(_0x23f2a9,null));};exports[_0x901d('0x4e')]=function(_0x165207,_0x4d2b2d,_0x4512e5){return db['CmHopperFinal'][_0x901d('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x165207[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),'noAnswerContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x56')))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db['sequelize']['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),'dropContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x4d2b2d,null))['then'](respondWithResult(_0x4d2b2d,null))[_0x901d('0x46')](handleError(_0x4d2b2d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xabab57,_0x219c23,_0xecc8f9){return db[_0x901d('0x2f')][_0x901d('0x4f')]({'raw':![],'where':{'CampaignId':_0xabab57[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),_0x901d('0x5f')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),_0x901d('0x60')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')]['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x219c23,null))[_0x901d('0x28')](respondWithResult(_0x219c23,null))[_0x901d('0x46')](handleError(_0x219c23,null));};exports[_0x901d('0x61')]=function(_0x5cff96,_0x130dfb,_0x302049){return db[_0x901d('0x62')]['find']({'where':{'id':_0x5cff96[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x130dfb,null))[_0x901d('0x28')](function(_0x4b5e3b){var _0x576d50;if(_0x4b5e3b){_0x576d50=squel['insert']()[_0x901d('0x63')](_0x901d('0x64'))['fromQuery'](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x68'),_0x901d('0x69'),'updatedAt'],squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))['field'](_0x901d('0x6e'),'scheduledAt')[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))[_0x901d('0x6b')](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x70'),_0x901d('0x68'))['field'](_0x901d('0x6e'),_0x901d('0x69'))['field'](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')['where'](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id']['toString']())[_0x901d('0x3e')](_0x901d('0x72'),_0x5cff96[_0x901d('0x4c')][_0x901d('0x73')][_0x901d('0x74')]())['where'](_0x901d('0x75'))[_0x901d('0x3e')](_0x901d('0x76'),squel['select']()[_0x901d('0x6b')](_0x901d('0x6d'))[_0x901d('0x77')](_0x901d('0x64'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')](_0x901d('0x7a')))[_0x901d('0x7b')]('ContactId'))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x576d50);}return[];})['then'](respondWithResult(_0x130dfb,null))[_0x901d('0x46')](handleError(_0x130dfb,null));};exports[_0x901d('0x7c')]=function(_0xa14cbd,_0x34f33f,_0x785f77){return db[_0x901d('0x7d')][_0x901d('0x4a')]({'where':{'id':_0xa14cbd[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x34f33f,null))[_0x901d('0x28')](function(_0x28b640){var _0x45601a;if(_0x28b640){_0x45601a=squel[_0x901d('0x7e')]()[_0x901d('0x63')](_0x901d('0x64'))[_0x901d('0x7f')](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x80'),_0x901d('0x69'),_0x901d('0x81')],squel['select']()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))[_0x901d('0x6b')](_0x901d('0x6e'),_0x901d('0x65'))[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))['field'](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x82'),'CampaignId')['field']('NOW()','createdAt')[_0x901d('0x6b')](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')[_0x901d('0x3e')]('CampaignId\x20=\x20?',_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x20?',_0xa14cbd['body'][_0x901d('0x73')][_0x901d('0x74')]())[_0x901d('0x3e')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x901d('0x6a')]()[_0x901d('0x6b')]('phone')[_0x901d('0x77')]('cm_hopper')['where'](_0x901d('0x83'),_0xa14cbd['params']['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x83'),_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x204'))['group'](_0x901d('0x66')))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x45601a);}return[];})[_0x901d('0x28')](respondWithResult(_0x34f33f,null))[_0x901d('0x46')](handleError(_0x34f33f,null));};exports[_0x901d('0x84')]=function(_0x306491,_0x3cb399,_0x101067){return db['CmHopper'][_0x901d('0x85')]({'where':{'VoiceQueueId':_0x306491[_0x901d('0x4c')][_0x901d('0x68')],'CampaignId':_0x306491[_0x901d('0x4c')][_0x901d('0x80')],'ContactId':_0x306491[_0x901d('0x4c')][_0x901d('0x66')]}})[_0x901d('0x28')](handleEntityNotFound(_0x3cb399,null))[_0x901d('0x28')](function(_0x17b7ef){if(_0x17b7ef){return _0x17b7ef;}return null;})[_0x901d('0x28')](respondWithResult(_0x3cb399,null))[_0x901d('0x46')](handleError(_0x3cb399,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2faa1e6..592aa24 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 _0xefa5=['util','../../config/logger','moment','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid','lodash'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0xefa5,0x1df));var _0x5efa=function(_0x270ed1,_0x471778){_0x270ed1=_0x270ed1-0x0;var _0x26d741=_0xefa5[_0x270ed1];return _0x26d741;};'use strict';var _=require(_0x5efa('0x0'));var util=require(_0x5efa('0x1'));var logger=require(_0x5efa('0x2'))('api');var moment=require(_0x5efa('0x3'));var BPromise=require('bluebird');var rp=require(_0x5efa('0x4'));var fs=require('fs');var path=require(_0x5efa('0x5'));var rimraf=require(_0x5efa('0x6'));var config=require('../../config/environment');var attributes=require(_0x5efa('0x7'));module[_0x5efa('0x8')]=function(_0x4d7945,_0x28bc35){return _0x4d7945[_0x5efa('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x5efa('0xa')]},{'name':'uniqueid','fields':[_0x5efa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x833c=['moment','request-promise','path','define','calleridnum','uniqueid','lodash','util','../../config/logger','api'];(function(_0x108893,_0x67bd9d){var _0x25a598=function(_0x1345ca){while(--_0x1345ca){_0x108893['push'](_0x108893['shift']());}};_0x25a598(++_0x67bd9d);}(_0x833c,0x9c));var _0xc833=function(_0x340d5a,_0x22f7d2){_0x340d5a=_0x340d5a-0x0;var _0x3ac245=_0x833c[_0x340d5a];return _0x3ac245;};'use strict';var _=require(_0xc833('0x0'));var util=require(_0xc833('0x1'));var logger=require(_0xc833('0x2'))(_0xc833('0x3'));var moment=require(_0xc833('0x4'));var BPromise=require('bluebird');var rp=require(_0xc833('0x5'));var fs=require('fs');var path=require(_0xc833('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x1111d7,_0x591b71){return _0x1111d7[_0xc833('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xc833('0x8'),'fields':[_0xc833('0x8')]},{'name':_0xc833('0x9'),'fields':[_0xc833('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 8e27e05..e5c1b43 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x195cb0,_0x1a3ede){var _0x1eb232=function(_0x257360){while(--_0x257360){_0x195cb0['push'](_0x195cb0['shift']());}};_0x1eb232(++_0x1a3ede);}(_0xb10b,0x12a));var _0xbb10=function(_0xe506a9,_0x3105d4){_0xe506a9=_0xe506a9-0x0;var _0x12ca6f=_0xb10b[_0xe506a9];return _0x12ca6f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x28e820,_0x26427c){var _0x3ef991=function(_0x5eba6f){while(--_0x5eba6f){_0x28e820['push'](_0x28e820['shift']());}};_0x3ef991(++_0x26427c);}(_0x7a54,0x106));var _0x47a5=function(_0x1273c6,_0x1dac58){_0x1273c6=_0x1273c6-0x0;var _0x20911c=_0x7a54[_0x1273c6];return _0x20911c;};'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')]('CmHopperFinal,\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['CreateCmHopperFinal']=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?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index cd015f6..6c8678d 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 _0x383b=['/:id','update','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put'];(function(_0x5b3219,_0x4f5f74){var _0x575525=function(_0x447cf6){while(--_0x447cf6){_0x5b3219['push'](_0x5b3219['shift']());}};_0x575525(++_0x4f5f74);}(_0x383b,0x89));var _0xb383=function(_0x4ab42f,_0x437617){_0x4ab42f=_0x4ab42f-0x0;var _0xbdf43=_0x383b[_0x4ab42f];return _0xbdf43;};'use strict';var multer=require(_0xb383('0x0'));var util=require('util');var path=require(_0xb383('0x1'));var timeout=require(_0xb383('0x2'));var express=require(_0xb383('0x3'));var router=express['Router']();var fs_extra=require(_0xb383('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb383('0x5'));var config=require(_0xb383('0x6'));var controller=require(_0xb383('0x7'));router[_0xb383('0x8')]('/',auth[_0xb383('0x9')](),controller[_0xb383('0xa')]);router['get'](_0xb383('0xb'),auth[_0xb383('0x9')](),controller[_0xb383('0xc')]);router['get']('/:id',auth[_0xb383('0x9')](),controller[_0xb383('0xd')]);router[_0xb383('0x8')](_0xb383('0xe'),auth['isAuthenticated'](),controller[_0xb383('0xf')]);router[_0xb383('0x8')](_0xb383('0x10'),auth[_0xb383('0x9')](),controller[_0xb383('0x11')]);router['post'](_0xb383('0x12'),auth[_0xb383('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb383('0x13')](_0xb383('0x14'),auth[_0xb383('0x9')](),controller[_0xb383('0x15')]);router[_0xb383('0x13')](_0xb383('0x16'),auth[_0xb383('0x9')](),controller[_0xb383('0x17')]);router[_0xb383('0x18')](_0xb383('0x19'),auth[_0xb383('0x9')](),controller[_0xb383('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xa134=['/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x1e6dae,_0x5cb1dd){var _0x3511ea=function(_0x37e00b){while(--_0x37e00b){_0x1e6dae['push'](_0x1e6dae['shift']());}};_0x3511ea(++_0x5cb1dd);}(_0xa134,0xf0));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4a13('0x0'));var util=require(_0x4a13('0x1'));var path=require(_0x4a13('0x2'));var timeout=require(_0x4a13('0x3'));var express=require(_0x4a13('0x4'));var router=express[_0x4a13('0x5')]();var fs_extra=require(_0x4a13('0x6'));var auth=require(_0x4a13('0x7'));var interaction=require(_0x4a13('0x8'));var config=require(_0x4a13('0x9'));var controller=require(_0x4a13('0xa'));router[_0x4a13('0xb')]('/',auth[_0x4a13('0xc')](),controller['index']);router['get'](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller[_0x4a13('0xe')]);router['get']('/:id',auth[_0x4a13('0xc')](),controller[_0x4a13('0xf')]);router[_0x4a13('0xb')](_0x4a13('0x10'),auth['isAuthenticated'](),controller[_0x4a13('0x11')]);router[_0x4a13('0xb')](_0x4a13('0x12'),auth['isAuthenticated'](),controller[_0x4a13('0x13')]);router[_0x4a13('0x14')](_0x4a13('0x15'),auth[_0x4a13('0xc')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x4a13('0x14')]('/voice/campaign/moveContacts/:id',auth[_0x4a13('0xc')](),controller[_0x4a13('0x16')]);router[_0x4a13('0x14')](_0x4a13('0x17'),auth[_0x4a13('0xc')](),controller[_0x4a13('0x18')]);router[_0x4a13('0x19')](_0x4a13('0x1a'),auth[_0x4a13('0xc')](),controller[_0x4a13('0x1b')]);module[_0x4a13('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 00cb4ca..27b51ac 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 _0xb8de=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x40b74d,_0xd77223){var _0x2a1b96=function(_0x5a73fe){while(--_0x5a73fe){_0x40b74d['push'](_0x40b74d['shift']());}};_0x2a1b96(++_0xd77223);}(_0xb8de,0x152));var _0xeb8d=function(_0x1746f9,_0x408d55){_0x1746f9=_0x1746f9-0x0;var _0x5ef847=_0xb8de[_0x1746f9];return _0x5ef847;};'use strict';var Sequelize=require(_0xeb8d('0x0'));module[_0xeb8d('0x1')]={'state':{'type':Sequelize[_0xeb8d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeb8d('0x3')]},'scheduledat':{'type':Sequelize[_0xeb8d('0x4')]},'countbusyretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xeb8d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xeb8d('0x3')]},'originatecalleridname':{'type':Sequelize[_0xeb8d('0x3')]},'calleridnum':{'type':Sequelize[_0xeb8d('0x3')]},'calleridname':{'type':Sequelize[_0xeb8d('0x3')]},'starttime':{'type':Sequelize[_0xeb8d('0x4')]},'responsetime':{'type':Sequelize[_0xeb8d('0x4')]},'answertime':{'type':Sequelize[_0xeb8d('0x4')]},'droptime':{'type':Sequelize[_0xeb8d('0x4')]},'endtime':{'type':Sequelize[_0xeb8d('0x4')]},'ringtime':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb8d('0x3')]},'campaign':{'type':Sequelize[_0xeb8d('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xeb8d('0x3')]},'amd':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xeb8d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb8d('0x4')]},'recallme':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xeb8d('0x4')]},'edited':{'type':Sequelize[_0xeb8d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeb8d('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9d5b=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x9d5b,0x12d));var _0xb9d5=function(_0x438773,_0xd915a6){_0x438773=_0x438773-0x0;var _0x506a32=_0x9d5b[_0x438773];return _0x506a32;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'state':{'type':Sequelize[_0xb9d5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb9d5('0x2')]},'scheduledat':{'type':Sequelize[_0xb9d5('0x3')]},'countbusyretry':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb9d5('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb9d5('0x2')]},'calleridnum':{'type':Sequelize[_0xb9d5('0x2')]},'calleridname':{'type':Sequelize[_0xb9d5('0x2')]},'starttime':{'type':Sequelize[_0xb9d5('0x3')]},'responsetime':{'type':Sequelize[_0xb9d5('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xb9d5('0x3')]},'endtime':{'type':Sequelize[_0xb9d5('0x3')]},'ringtime':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb9d5('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xb9d5('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb9d5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb9d5('0x3')]},'recallme':{'type':Sequelize[_0xb9d5('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xb9d5('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb9d5('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 05f623b..dd80cd5 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 _0x932b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','status','end','stack','name','send','index','CmHopperHistory','fieldName','type','key','model','map','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','include','merge','find','catch','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5d169d,_0x1125f4){var _0x28a17e=function(_0x6e28a3){while(--_0x6e28a3){_0x5d169d['push'](_0x5d169d['shift']());}};_0x28a17e(++_0x1125f4);}(_0x932b,0x1cc));var _0xb932=function(_0x4ef1b6,_0x502ac2){_0x4ef1b6=_0x4ef1b6-0x0;var _0x164c1f=_0x932b[_0x4ef1b6];return _0x164c1f;};'use strict';var emlformat=require(_0xb932('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb932('0x1'));var jsonpatch=require(_0xb932('0x2'));var rp=require(_0xb932('0x3'));var moment=require(_0xb932('0x4'));var BPromise=require(_0xb932('0x5'));var Mustache=require('mustache');var util=require(_0xb932('0x6'));var path=require('path');var sox=require(_0xb932('0x7'));var csv=require(_0xb932('0x8'));var ejs=require(_0xb932('0x9'));var fs=require('fs');var fs_extra=require(_0xb932('0xa'));var _=require(_0xb932('0xb'));var squel=require(_0xb932('0xc'));var crypto=require('crypto');var jsforce=require(_0xb932('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb932('0x8'));var querystring=require(_0xb932('0xe'));var Papa=require(_0xb932('0xf'));var Redis=require(_0xb932('0x10'));var authService=require(_0xb932('0x11'));var qs=require(_0xb932('0x12'));var as=require(_0xb932('0x13'));var hardwareService=require(_0xb932('0x14'));var logger=require(_0xb932('0x15'))(_0xb932('0x16'));var utils=require(_0xb932('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb932('0x18'));var db=require(_0xb932('0x19'))['db'];function respondWithStatusCode(_0x556ea9,_0x20573a){_0x20573a=_0x20573a||0xcc;return function(_0x1a2ade){if(_0x1a2ade){return _0x556ea9[_0xb932('0x1a')](_0x20573a);}return _0x556ea9['status'](_0x20573a)['end']();};}function respondWithResult(_0x56209e,_0x1c93a7){_0x1c93a7=_0x1c93a7||0xc8;return function(_0x264f3b){if(_0x264f3b){return _0x56209e['status'](_0x1c93a7)[_0xb932('0x1b')](_0x264f3b);}};}function respondWithFilteredResult(_0x4d6cfb,_0xec0f42){return function(_0x25d1c3){if(_0x25d1c3){var _0xf32ee8=typeof _0xec0f42['offset']===_0xb932('0x1c')&&typeof _0xec0f42[_0xb932('0x1d')]===_0xb932('0x1c');var _0x347112=_0x25d1c3[_0xb932('0x1e')];var _0x3e644a=_0xf32ee8?0x0:_0xec0f42[_0xb932('0x1f')];var _0x4ece27=_0xf32ee8?_0x25d1c3['count']:_0xec0f42[_0xb932('0x1f')]+_0xec0f42[_0xb932('0x1d')];var _0x11b325;if(_0x4ece27>=_0x347112){_0x4ece27=_0x347112;_0x11b325=0xc8;}else{_0x11b325=0xce;}_0x4d6cfb['status'](_0x11b325);return _0x4d6cfb[_0xb932('0x20')](_0xb932('0x21'),_0x3e644a+'-'+_0x4ece27+'/'+_0x347112)[_0xb932('0x1b')](_0x25d1c3);}return null;};}function patchUpdates(_0x1cd4fe){return function(_0x556faf){try{jsonpatch[_0xb932('0x22')](_0x556faf,_0x1cd4fe,!![]);}catch(_0x1ca03){return BPromise[_0xb932('0x23')](_0x1ca03);}return _0x556faf['save']();};}function saveUpdates(_0x14034f,_0x2484cd){return function(_0x131920){if(_0x131920){return _0x131920[_0xb932('0x24')](_0x14034f)[_0xb932('0x25')](function(_0xa1b681){return _0xa1b681;});}return null;};}function removeEntity(_0x1d83fc,_0x57ebb6){return function(_0xaa257e){if(_0xaa257e){return _0xaa257e[_0xb932('0x26')]()[_0xb932('0x25')](function(){_0x1d83fc[_0xb932('0x27')](0xcc)[_0xb932('0x28')]();});}};}function handleEntityNotFound(_0x30c564,_0x36fa5b){return function(_0x33b0fb){if(!_0x33b0fb){_0x30c564[_0xb932('0x1a')](0x194);}return _0x33b0fb;};}function handleError(_0x41a67a,_0x412706){_0x412706=_0x412706||0x1f4;return function(_0x26d52c){logger['error'](_0x26d52c[_0xb932('0x29')]);if(_0x26d52c[_0xb932('0x2a')]){delete _0x26d52c[_0xb932('0x2a')];}_0x41a67a['status'](_0x412706)[_0xb932('0x2b')](_0x26d52c);};}exports[_0xb932('0x2c')]=function(_0x3f2d6e,_0x1568cd){var _0x306cf5={},_0x3e9434={},_0x11d064={'count':0x0,'rows':[]};var _0x40a658=_['map'](db[_0xb932('0x2d')]['rawAttributes'],function(_0x54b776){return{'name':_0x54b776[_0xb932('0x2e')],'type':_0x54b776[_0xb932('0x2f')][_0xb932('0x30')]};});_0x3e9434[_0xb932('0x31')]=_[_0xb932('0x32')](_0x40a658,_0xb932('0x2a'));_0x3e9434['query']=_[_0xb932('0x33')](_0x3f2d6e['query']);_0x3e9434[_0xb932('0x34')]=_[_0xb932('0x35')](_0x3e9434[_0xb932('0x31')],_0x3e9434[_0xb932('0x36')]);_0x306cf5['attributes']=_[_0xb932('0x35')](_0x3e9434['model'],qs['fields'](_0x3f2d6e['query'][_0xb932('0x37')]));_0x306cf5['attributes']=_0x306cf5['attributes'][_0xb932('0x38')]?_0x306cf5[_0xb932('0x39')]:_0x3e9434[_0xb932('0x31')];if(!_0x3f2d6e[_0xb932('0x36')][_0xb932('0x3a')](_0xb932('0x3b'))){_0x306cf5[_0xb932('0x1d')]=qs[_0xb932('0x1d')](_0x3f2d6e['query'][_0xb932('0x1d')]);_0x306cf5[_0xb932('0x1f')]=qs['offset'](_0x3f2d6e[_0xb932('0x36')][_0xb932('0x1f')]);}_0x306cf5[_0xb932('0x3c')]=qs[_0xb932('0x3d')](_0x3f2d6e['query'][_0xb932('0x3d')]);_0x306cf5[_0xb932('0x3e')]=qs[_0xb932('0x34')](_[_0xb932('0x3f')](_0x3f2d6e[_0xb932('0x36')],_0x3e9434[_0xb932('0x34')]),_0x40a658);if(_0x3f2d6e[_0xb932('0x36')][_0xb932('0x40')]){_0x306cf5['where']=_['merge'](_0x306cf5[_0xb932('0x3e')],{'$or':_[_0xb932('0x32')](_0x40a658,function(_0x133731){if(_0x133731[_0xb932('0x2f')]!==_0xb932('0x41')){var _0x43e834={};_0x43e834[_0x133731['name']]={'$like':'%'+_0x3f2d6e[_0xb932('0x36')][_0xb932('0x40')]+'%'};return _0x43e834;}})});}_0x306cf5=_['merge']({},_0x306cf5,_0x3f2d6e[_0xb932('0x42')]);var _0xec5b7e={'where':_0x306cf5[_0xb932('0x3e')]};return db[_0xb932('0x2d')][_0xb932('0x1e')](_0xec5b7e)[_0xb932('0x25')](function(_0x196702){_0x11d064[_0xb932('0x1e')]=_0x196702;if(_0x3f2d6e[_0xb932('0x36')][_0xb932('0x43')]){_0x306cf5['include']=[{'all':!![]}];}return db[_0xb932('0x2d')]['findAll'](_0x306cf5);})[_0xb932('0x25')](function(_0xb2cbff){_0x11d064[_0xb932('0x44')]=_0xb2cbff;return _0x11d064;})[_0xb932('0x25')](respondWithFilteredResult(_0x1568cd,_0x306cf5))['catch'](handleError(_0x1568cd,null));};exports[_0xb932('0x45')]=function(_0xbeb28b,_0x28535a){var _0x517071={'raw':!![],'where':{'id':_0xbeb28b[_0xb932('0x46')]['id']}},_0x21149b={};_0x21149b['model']=_[_0xb932('0x33')](db[_0xb932('0x2d')][_0xb932('0x47')]);_0x21149b[_0xb932('0x36')]=_[_0xb932('0x33')](_0xbeb28b[_0xb932('0x36')]);_0x21149b['filters']=_['intersection'](_0x21149b['model'],_0x21149b[_0xb932('0x36')]);_0x517071[_0xb932('0x39')]=_[_0xb932('0x35')](_0x21149b[_0xb932('0x31')],qs[_0xb932('0x37')](_0xbeb28b[_0xb932('0x36')][_0xb932('0x37')]));_0x517071['attributes']=_0x517071[_0xb932('0x39')][_0xb932('0x38')]?_0x517071[_0xb932('0x39')]:_0x21149b[_0xb932('0x31')];if(_0xbeb28b['query'][_0xb932('0x43')]){_0x517071[_0xb932('0x48')]=[{'all':!![]}];}_0x517071=_[_0xb932('0x49')]({},_0x517071,_0xbeb28b['options']);return db[_0xb932('0x2d')][_0xb932('0x4a')](_0x517071)['then'](handleEntityNotFound(_0x28535a,null))[_0xb932('0x25')](respondWithResult(_0x28535a,null))[_0xb932('0x4b')](handleError(_0x28535a,null));};exports[_0xb932('0x4c')]=function(_0x502323,_0x315f62){return db['CmHopperHistory'][_0xb932('0x4c')](_0x502323[_0xb932('0x4d')],{})[_0xb932('0x25')](respondWithResult(_0x315f62,0xc9))[_0xb932('0x4b')](handleError(_0x315f62,null));};exports[_0xb932('0x4e')]=function(_0x1c85ff,_0x732f95){return db['CmHopperHistory'][_0xb932('0x4e')]()[_0xb932('0x25')](respondWithResult(_0x732f95,null))['catch'](handleError(_0x732f95,null));};exports[_0xb932('0x24')]=function(_0x8f35f9,_0x20d57f){if(_0x8f35f9[_0xb932('0x4d')][_0xb932('0x4f')]){delete _0x8f35f9[_0xb932('0x4d')][_0xb932('0x4f')];}return db[_0xb932('0x2d')][_0xb932('0x4a')]({'where':{'uniqueid':_0x8f35f9[_0xb932('0x46')]['id']}})[_0xb932('0x25')](handleEntityNotFound(_0x20d57f,null))[_0xb932('0x25')](saveUpdates(_0x8f35f9[_0xb932('0x4d')],null))[_0xb932('0x25')](respondWithResult(_0x20d57f,null))[_0xb932('0x4b')](handleError(_0x20d57f,null));}; \ No newline at end of file +var _0x991e=['send','index','map','CmHopperHistory','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','catch','create','body','describe','uniqueid','find','eml-format','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x991e,0x14a));var _0xe991=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x991e[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xe991('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe991('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe991('0x2'));var Mustache=require(_0xe991('0x3'));var util=require(_0xe991('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xe991('0x5'));var ejs=require(_0xe991('0x6'));var fs=require('fs');var fs_extra=require(_0xe991('0x7'));var _=require('lodash');var squel=require(_0xe991('0x8'));var crypto=require(_0xe991('0x9'));var jsforce=require(_0xe991('0xa'));var deskjs=require(_0xe991('0xb'));var toCsv=require(_0xe991('0x5'));var querystring=require(_0xe991('0xc'));var Papa=require(_0xe991('0xd'));var Redis=require(_0xe991('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe991('0xf'));var as=require(_0xe991('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe991('0x11'));var utils=require(_0xe991('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xe991('0x13'));var db=require(_0xe991('0x14'))['db'];function respondWithStatusCode(_0x384bc1,_0x20e52b){_0x20e52b=_0x20e52b||0xcc;return function(_0x120d4f){if(_0x120d4f){return _0x384bc1[_0xe991('0x15')](_0x20e52b);}return _0x384bc1[_0xe991('0x16')](_0x20e52b)[_0xe991('0x17')]();};}function respondWithResult(_0x50dc04,_0x2e8390){_0x2e8390=_0x2e8390||0xc8;return function(_0x144eb0){if(_0x144eb0){return _0x50dc04[_0xe991('0x16')](_0x2e8390)[_0xe991('0x18')](_0x144eb0);}};}function respondWithFilteredResult(_0x594261,_0x394925){return function(_0x1f76fc){if(_0x1f76fc){var _0x246049=typeof _0x394925[_0xe991('0x19')]===_0xe991('0x1a')&&typeof _0x394925[_0xe991('0x1b')]==='undefined';var _0x2b34ac=_0x1f76fc[_0xe991('0x1c')];var _0x1c4652=_0x246049?0x0:_0x394925[_0xe991('0x19')];var _0x2fcd03=_0x246049?_0x1f76fc['count']:_0x394925[_0xe991('0x19')]+_0x394925[_0xe991('0x1b')];var _0x3ac5a4;if(_0x2fcd03>=_0x2b34ac){_0x2fcd03=_0x2b34ac;_0x3ac5a4=0xc8;}else{_0x3ac5a4=0xce;}_0x594261[_0xe991('0x16')](_0x3ac5a4);return _0x594261[_0xe991('0x1d')](_0xe991('0x1e'),_0x1c4652+'-'+_0x2fcd03+'/'+_0x2b34ac)['json'](_0x1f76fc);}return null;};}function patchUpdates(_0x1b6f22){return function(_0x134b56){try{jsonpatch[_0xe991('0x1f')](_0x134b56,_0x1b6f22,!![]);}catch(_0xa236ee){return BPromise[_0xe991('0x20')](_0xa236ee);}return _0x134b56[_0xe991('0x21')]();};}function saveUpdates(_0x129424,_0x3bd837){return function(_0x2cf50a){if(_0x2cf50a){return _0x2cf50a[_0xe991('0x22')](_0x129424)['then'](function(_0x1a8b7d){return _0x1a8b7d;});}return null;};}function removeEntity(_0x432eed,_0x96cd9a){return function(_0x16194d){if(_0x16194d){return _0x16194d[_0xe991('0x23')]()[_0xe991('0x24')](function(){_0x432eed['status'](0xcc)[_0xe991('0x17')]();});}};}function handleEntityNotFound(_0x4ccb18,_0xb8418f){return function(_0x3d9c71){if(!_0x3d9c71){_0x4ccb18[_0xe991('0x15')](0x194);}return _0x3d9c71;};}function handleError(_0x4253be,_0x37e4f9){_0x37e4f9=_0x37e4f9||0x1f4;return function(_0x291d47){logger[_0xe991('0x25')](_0x291d47[_0xe991('0x26')]);if(_0x291d47['name']){delete _0x291d47[_0xe991('0x27')];}_0x4253be[_0xe991('0x16')](_0x37e4f9)[_0xe991('0x28')](_0x291d47);};}exports[_0xe991('0x29')]=function(_0x5d1c0a,_0x282b22){var _0x444b6e={},_0x378ed3={},_0x2829c3={'count':0x0,'rows':[]};var _0x166b3f=_[_0xe991('0x2a')](db[_0xe991('0x2b')][_0xe991('0x2c')],function(_0x17f79a){return{'name':_0x17f79a['fieldName'],'type':_0x17f79a[_0xe991('0x2d')]['key']};});_0x378ed3[_0xe991('0x2e')]=_[_0xe991('0x2a')](_0x166b3f,_0xe991('0x27'));_0x378ed3[_0xe991('0x2f')]=_[_0xe991('0x30')](_0x5d1c0a[_0xe991('0x2f')]);_0x378ed3[_0xe991('0x31')]=_[_0xe991('0x32')](_0x378ed3[_0xe991('0x2e')],_0x378ed3[_0xe991('0x2f')]);_0x444b6e[_0xe991('0x33')]=_[_0xe991('0x32')](_0x378ed3[_0xe991('0x2e')],qs['fields'](_0x5d1c0a['query'][_0xe991('0x34')]));_0x444b6e['attributes']=_0x444b6e['attributes'][_0xe991('0x35')]?_0x444b6e['attributes']:_0x378ed3[_0xe991('0x2e')];if(!_0x5d1c0a[_0xe991('0x2f')][_0xe991('0x36')](_0xe991('0x37'))){_0x444b6e[_0xe991('0x1b')]=qs[_0xe991('0x1b')](_0x5d1c0a[_0xe991('0x2f')][_0xe991('0x1b')]);_0x444b6e[_0xe991('0x19')]=qs[_0xe991('0x19')](_0x5d1c0a['query']['offset']);}_0x444b6e['order']=qs[_0xe991('0x38')](_0x5d1c0a['query'][_0xe991('0x38')]);_0x444b6e[_0xe991('0x39')]=qs['filters'](_[_0xe991('0x3a')](_0x5d1c0a[_0xe991('0x2f')],_0x378ed3[_0xe991('0x31')]),_0x166b3f);if(_0x5d1c0a[_0xe991('0x2f')][_0xe991('0x3b')]){_0x444b6e[_0xe991('0x39')]=_[_0xe991('0x3c')](_0x444b6e[_0xe991('0x39')],{'$or':_['map'](_0x166b3f,function(_0x3118ca){if(_0x3118ca[_0xe991('0x2d')]!==_0xe991('0x3d')){var _0x4c95fc={};_0x4c95fc[_0x3118ca['name']]={'$like':'%'+_0x5d1c0a[_0xe991('0x2f')][_0xe991('0x3b')]+'%'};return _0x4c95fc;}})});}_0x444b6e=_[_0xe991('0x3c')]({},_0x444b6e,_0x5d1c0a[_0xe991('0x3e')]);var _0x11151a={'where':_0x444b6e[_0xe991('0x39')]};return db[_0xe991('0x2b')]['count'](_0x11151a)['then'](function(_0x77b03){_0x2829c3['count']=_0x77b03;if(_0x5d1c0a[_0xe991('0x2f')][_0xe991('0x3f')]){_0x444b6e[_0xe991('0x40')]=[{'all':!![]}];}return db[_0xe991('0x2b')]['findAll'](_0x444b6e);})[_0xe991('0x24')](function(_0x581550){_0x2829c3[_0xe991('0x41')]=_0x581550;return _0x2829c3;})['then'](respondWithFilteredResult(_0x282b22,_0x444b6e))['catch'](handleError(_0x282b22,null));};exports[_0xe991('0x42')]=function(_0x476037,_0x16b9f6){var _0x195839={'raw':!![],'where':{'id':_0x476037[_0xe991('0x43')]['id']}},_0x1b4c42={};_0x1b4c42[_0xe991('0x2e')]=_[_0xe991('0x30')](db[_0xe991('0x2b')][_0xe991('0x2c')]);_0x1b4c42['query']=_[_0xe991('0x30')](_0x476037[_0xe991('0x2f')]);_0x1b4c42[_0xe991('0x31')]=_[_0xe991('0x32')](_0x1b4c42[_0xe991('0x2e')],_0x1b4c42['query']);_0x195839[_0xe991('0x33')]=_['intersection'](_0x1b4c42[_0xe991('0x2e')],qs[_0xe991('0x34')](_0x476037[_0xe991('0x2f')][_0xe991('0x34')]));_0x195839[_0xe991('0x33')]=_0x195839[_0xe991('0x33')][_0xe991('0x35')]?_0x195839[_0xe991('0x33')]:_0x1b4c42[_0xe991('0x2e')];if(_0x476037[_0xe991('0x2f')]['includeAll']){_0x195839[_0xe991('0x40')]=[{'all':!![]}];}_0x195839=_[_0xe991('0x3c')]({},_0x195839,_0x476037[_0xe991('0x3e')]);return db['CmHopperHistory']['find'](_0x195839)[_0xe991('0x24')](handleEntityNotFound(_0x16b9f6,null))[_0xe991('0x24')](respondWithResult(_0x16b9f6,null))[_0xe991('0x44')](handleError(_0x16b9f6,null));};exports[_0xe991('0x45')]=function(_0xabcf47,_0x3cf573){return db[_0xe991('0x2b')][_0xe991('0x45')](_0xabcf47[_0xe991('0x46')],{})[_0xe991('0x24')](respondWithResult(_0x3cf573,0xc9))[_0xe991('0x44')](handleError(_0x3cf573,null));};exports['describe']=function(_0x51084e,_0x1e3bb1){return db[_0xe991('0x2b')][_0xe991('0x47')]()['then'](respondWithResult(_0x1e3bb1,null))['catch'](handleError(_0x1e3bb1,null));};exports[_0xe991('0x22')]=function(_0x6ceb33,_0x53cdd9){if(_0x6ceb33[_0xe991('0x46')][_0xe991('0x48')]){delete _0x6ceb33[_0xe991('0x46')]['uniqueid'];}return db['CmHopperHistory'][_0xe991('0x49')]({'where':{'uniqueid':_0x6ceb33['params']['id']}})['then'](handleEntityNotFound(_0x53cdd9,null))['then'](saveUpdates(_0x6ceb33['body'],null))[_0xe991('0x24')](respondWithResult(_0x53cdd9,null))[_0xe991('0x44')](handleError(_0x53cdd9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 35f7c7d..5afcd6a 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 _0x6f75=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x6f75,0x71));var _0x56f7=function(_0x444243,_0x138203){_0x444243=_0x444243-0x0;var _0x2a8529=_0x6f75[_0x444243];return _0x2a8529;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var logger=require(_0x56f7('0x2'))(_0x56f7('0x3'));var moment=require(_0x56f7('0x4'));var BPromise=require(_0x56f7('0x5'));var rp=require(_0x56f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));var attributes=require(_0x56f7('0x9'));module['exports']=function(_0x4d0f0c,_0x5da455){return _0x4d0f0c[_0x56f7('0xa')](_0x56f7('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x56f7('0xc'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x56f7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39d2=['exports','define','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes'];(function(_0x2229ae,_0x4cadf8){var _0x4d155c=function(_0x261376){while(--_0x261376){_0x2229ae['push'](_0x2229ae['shift']());}};_0x4d155c(++_0x4cadf8);}(_0x39d2,0xf5));var _0x239d=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x39d2[_0x291f8b];return _0x275171;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var logger=require(_0x239d('0x1'))(_0x239d('0x2'));var moment=require(_0x239d('0x3'));var BPromise=require(_0x239d('0x4'));var rp=require(_0x239d('0x5'));var fs=require('fs');var path=require(_0x239d('0x6'));var rimraf=require(_0x239d('0x7'));var config=require(_0x239d('0x8'));var attributes=require(_0x239d('0x9'));module[_0x239d('0xa')]=function(_0x12302d,_0x1504c1){return _0x12302d[_0x239d('0xb')]('CmHopperHistory',attributes,{'tableName':_0x239d('0xc'),'paranoid':![],'indexes':[{'name':_0x239d('0xd'),'fields':[_0x239d('0xd')]},{'name':_0x239d('0xe'),'fields':[_0x239d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 49f6929..6036a9e 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 _0x70e0=['`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`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','GetVoiceQueueHopperHistory','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','findAll','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70e0,0x17b));var _0x070e=function(_0x4c55c9,_0x3c2af0){_0x4c55c9=_0x4c55c9-0x0;var _0x58a245=_0x70e0[_0x4c55c9];return _0x58a245;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')](_0x38f6e6[_0x070e('0x19')],{'raw':_0x38f6e6[_0x070e('0x1a')]?_0x38f6e6[_0x070e('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e958f){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')]('CreateCmHopperHistory',_0x38f6e6,JSON[_0x070e('0xf')](_0x4e958f));_0x364b3f(_0x4e958f);})['catch'](function(_0xf8dd5d){logger[_0x070e('0x10')](_0x070e('0x16'),_0xf8dd5d[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0xf8dd5d[_0x070e('0x13')]));});});};exports[_0x070e('0x1b')]=function(_0x164cdf){var _0x595c7e=this;return new Promise(function(_0x2f8055,_0x270061){return db[_0x070e('0x17')]['findAll']({'raw':_0x164cdf[_0x070e('0x1a')]?_0x164cdf['options']['raw']===undefined?!![]:![]:!![],'where':_0x164cdf[_0x070e('0x1a')]?_0x164cdf[_0x070e('0x1a')][_0x070e('0x1c')]||null:null,'attributes':[[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db['sequelize'][_0x070e('0x1f')]('id')),_0x070e('0x20')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x070e('0x23')))),_0x070e('0x24')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x26')))),_0x070e('0x27')],[db['sequelize']['fn']('AVG',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x070e('0x28')]]})[_0x070e('0xa')](function(_0x444d02){logger[_0x070e('0xb')](_0x070e('0x1b'),_0x164cdf);logger['debug']('AvgHandleTime',_0x164cdf,JSON[_0x070e('0xf')](_0x444d02));_0x2f8055(_0x444d02);})[_0x070e('0x15')](function(_0x4bb439){logger[_0x070e('0x10')](_0x070e('0x1b'),_0x4bb439['message'],_0x164cdf);_0x270061(_0x595c7e[_0x070e('0x10')](0x1f4,_0x4bb439[_0x070e('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2d6bb6){var _0x34746e=this;return new Promise(function(_0x4ba6f0,_0x4d4ee8){return db['CmHopperHistory'][_0x070e('0x29')]({'raw':_0x2d6bb6[_0x070e('0x1a')]?_0x2d6bb6[_0x070e('0x1a')][_0x070e('0x2a')]===undefined?!![]:![]:!![],'where':_0x2d6bb6[_0x070e('0x1a')]?_0x2d6bb6['options'][_0x070e('0x1c')]||null:null,'attributes':[[_0x070e('0x2b'),_0x070e('0x2c')],[db['sequelize']['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x2d')))),_0x070e('0x2e')],[db['sequelize']['fn'](_0x070e('0x1e'),db['sequelize']['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x2f')))),_0x070e('0x30')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x070e('0x22')))),_0x070e('0x31')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x32')))),'outboundBusyCallsDay'],[db[_0x070e('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x070e('0x21')](_0x070e('0x33')))),_0x070e('0x34')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x35')))),_0x070e('0x36')],[db[_0x070e('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x37')))),_0x070e('0x38')],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x070e('0x39')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x3a')))),_0x070e('0x3b')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x3c')))),_0x070e('0x3d')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x3e')))),'outboundRejectCallsDay'],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x3f')))),_0x070e('0x40')],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db['sequelize']['fn']('IF',db[_0x070e('0x1d')]['literal'](_0x070e('0x41')))),_0x070e('0x42')],[db['sequelize']['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x43')))),_0x070e('0x44')]],'group':[_0x070e('0x2b')]})['then'](function(_0x296978){logger['info']('GetVoiceQueueHopperHistory',_0x2d6bb6);logger[_0x070e('0xc')](_0x070e('0x45'),_0x2d6bb6,JSON[_0x070e('0xf')](_0x296978));_0x4ba6f0(_0x296978);})[_0x070e('0x15')](function(_0x202015){logger[_0x070e('0x10')](_0x070e('0x45'),_0x202015[_0x070e('0x13')],_0x2d6bb6);_0x4d4ee8(_0x34746e['error'](0x1f4,_0x202015[_0x070e('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x564d82){var _0x3a76e2=this;return new Promise(function(_0x20acc6,_0x589aee){return db[_0x070e('0x17')][_0x070e('0x29')]({'raw':_0x564d82[_0x070e('0x1a')]?_0x564d82[_0x070e('0x1a')][_0x070e('0x2a')]===undefined?!![]:![]:!![],'where':_0x564d82[_0x070e('0x1a')]?_0x564d82[_0x070e('0x1a')]['where']||null:null,'attributes':[['campaign','name'],[db[_0x070e('0x1d')]['fn'](_0x070e('0x1e'),db[_0x070e('0x1d')][_0x070e('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0x070e('0x1d')]['fn']('COUNT',db[_0x070e('0x1d')]['fn']('IF',db[_0x070e('0x1d')][_0x070e('0x21')](_0x070e('0x22')))),_0x070e('0x46')]],'group':[_0x070e('0x2b')]})['then'](function(_0x20ff87){logger[_0x070e('0xb')](_0x070e('0x47'),_0x564d82);logger['debug'](_0x070e('0x47'),_0x564d82,JSON[_0x070e('0xf')](_0x20ff87));_0x20acc6(_0x20ff87);})['catch'](function(_0x1f1df5){logger['error'](_0x070e('0x47'),_0x1f1df5['message'],_0x564d82);_0x589aee(_0x3a76e2['error'](0x1f4,_0x1f1df5['message']));});});}; \ No newline at end of file +var _0xf7c3=['request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x250514,_0x389eda){var _0x59c25b=function(_0x3ad38b){while(--_0x3ad38b){_0x250514['push'](_0x250514['shift']());}};_0x59c25b(++_0x389eda);}(_0xf7c3,0x154));var _0x3f7c=function(_0x2a247f,_0x2b2843){_0x2a247f=_0x2a247f-0x0;var _0x575ee4=_0xf7c3[_0x2a247f];return _0x575ee4;};'use strict';var _=require(_0x3f7c('0x0'));var util=require(_0x3f7c('0x1'));var moment=require(_0x3f7c('0x2'));var BPromise=require(_0x3f7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f7c('0x5'));var logger=require(_0x3f7c('0x6'))(_0x3f7c('0x7'));var config=require('../../config/environment');var jayson=require(_0x3f7c('0x8'));var client=jayson[_0x3f7c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x854413,_0x57ce1e,_0x3c23a2){return new BPromise(function(_0x541074,_0x1253db){return client[_0x3f7c('0xa')](_0x854413,_0x3c23a2)[_0x3f7c('0xb')](function(_0x4c7e15){logger[_0x3f7c('0xc')](_0x3f7c('0xd'),_0x57ce1e,_0x3f7c('0xe'));logger[_0x3f7c('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x57ce1e,'request\x20sent',JSON[_0x3f7c('0x10')](_0x4c7e15));if(_0x4c7e15[_0x3f7c('0x11')]){if(_0x4c7e15['error'][_0x3f7c('0x12')]===0x1f4){logger[_0x3f7c('0x11')](_0x3f7c('0xd'),_0x57ce1e,_0x4c7e15[_0x3f7c('0x11')]['message']);return _0x1253db(_0x4c7e15[_0x3f7c('0x11')][_0x3f7c('0x13')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x57ce1e,_0x4c7e15['error'][_0x3f7c('0x13')]);return _0x541074(_0x4c7e15[_0x3f7c('0x11')][_0x3f7c('0x13')]);}else{logger[_0x3f7c('0xc')](_0x3f7c('0xd'),_0x57ce1e,'request\x20sent');_0x541074(_0x4c7e15[_0x3f7c('0x14')][_0x3f7c('0x13')]);}})['catch'](function(_0x5cae3f){logger[_0x3f7c('0x11')](_0x3f7c('0xd'),_0x57ce1e,_0x5cae3f);_0x1253db(_0x5cae3f);});});}exports['CreateCmHopperHistory']=function(_0x35c3c1){var _0x12ab92=this;return new Promise(function(_0x46b625,_0x51c6d6){return db[_0x3f7c('0x15')][_0x3f7c('0x16')](_0x35c3c1[_0x3f7c('0x17')],{'raw':_0x35c3c1['options']?_0x35c3c1[_0x3f7c('0x18')][_0x3f7c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x171c65){logger[_0x3f7c('0xc')](_0x3f7c('0x1a'),_0x35c3c1);logger[_0x3f7c('0xf')](_0x3f7c('0x1a'),_0x35c3c1,JSON[_0x3f7c('0x10')](_0x171c65));_0x46b625(_0x171c65);})[_0x3f7c('0x1b')](function(_0x3bdcf2){logger[_0x3f7c('0x11')](_0x3f7c('0x1a'),_0x3bdcf2['message'],_0x35c3c1);_0x51c6d6(_0x12ab92['error'](0x1f4,_0x3bdcf2[_0x3f7c('0x13')]));});});};exports[_0x3f7c('0x1c')]=function(_0x2dcb02){var _0x3e6bc3=this;return new Promise(function(_0x8bf234,_0x199994){return db[_0x3f7c('0x15')][_0x3f7c('0x1d')]({'raw':_0x2dcb02[_0x3f7c('0x18')]?_0x2dcb02[_0x3f7c('0x18')][_0x3f7c('0x19')]===undefined?!![]:![]:!![],'where':_0x2dcb02[_0x3f7c('0x18')]?_0x2dcb02[_0x3f7c('0x18')][_0x3f7c('0x1e')]||null:null,'attributes':[[db[_0x3f7c('0x1f')]['fn']('COUNT',db[_0x3f7c('0x1f')][_0x3f7c('0x20')]('id')),_0x3f7c('0x21')],[db['sequelize']['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x24')))),_0x3f7c('0x25')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x26')))),_0x3f7c('0x27')],[db['sequelize']['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x3f7c('0x1f')]['fn']('AVG',db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x28')))),_0x3f7c('0x29')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x2a'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x3f7c('0x2b')]]})['then'](function(_0x550c3e){logger[_0x3f7c('0xc')](_0x3f7c('0x1c'),_0x2dcb02);logger['debug']('AvgHandleTime',_0x2dcb02,JSON[_0x3f7c('0x10')](_0x550c3e));_0x8bf234(_0x550c3e);})[_0x3f7c('0x1b')](function(_0x70df6){logger[_0x3f7c('0x11')](_0x3f7c('0x1c'),_0x70df6['message'],_0x2dcb02);_0x199994(_0x3e6bc3[_0x3f7c('0x11')](0x1f4,_0x70df6[_0x3f7c('0x13')]));});});};exports[_0x3f7c('0x2c')]=function(_0x119303){var _0x284b7a=this;return new Promise(function(_0x36b6fa,_0x23c3ff){return db['CmHopperHistory']['findAll']({'raw':_0x119303[_0x3f7c('0x18')]?_0x119303['options']['raw']===undefined?!![]:![]:!![],'where':_0x119303[_0x3f7c('0x18')]?_0x119303[_0x3f7c('0x18')]['where']||null:null,'attributes':[[_0x3f7c('0x2d'),_0x3f7c('0x2e')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db['sequelize']['fn']('IF',db[_0x3f7c('0x1f')]['literal'](_0x3f7c('0x2f')))),_0x3f7c('0x30')],[db['sequelize']['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x31')))),_0x3f7c('0x32')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x3f7c('0x33')],[db[_0x3f7c('0x1f')]['fn']('COUNT',db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')]('`state`\x20=\x205,\x201,\x20null'))),_0x3f7c('0x34')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db['sequelize']['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x35')))),_0x3f7c('0x36')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3f7c('0x37')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x3f7c('0x23')](_0x3f7c('0x38')))),_0x3f7c('0x39')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x3a')))),_0x3f7c('0x3b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3f7c('0x1f')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x3f7c('0x1f')]['fn']('COUNT',db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x3c')))),_0x3f7c('0x3d')],[db[_0x3f7c('0x1f')]['fn']('COUNT',db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x3e')))),'outboundRejectCallsDay'],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db['sequelize']['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x3f')))),'outboundAnswerAgiCallsDay'],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')]['literal'](_0x3f7c('0x40')))),_0x3f7c('0x41')],[db[_0x3f7c('0x1f')]['fn']('COUNT',db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x42')))),_0x3f7c('0x43')]],'group':[_0x3f7c('0x2d')]})['then'](function(_0x53a65e){logger[_0x3f7c('0xc')](_0x3f7c('0x2c'),_0x119303);logger[_0x3f7c('0xf')](_0x3f7c('0x2c'),_0x119303,JSON['stringify'](_0x53a65e));_0x36b6fa(_0x53a65e);})['catch'](function(_0xa666ff){logger[_0x3f7c('0x11')]('GetVoiceQueueHopperHistory',_0xa666ff['message'],_0x119303);_0x23c3ff(_0x284b7a[_0x3f7c('0x11')](0x1f4,_0xa666ff[_0x3f7c('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x1e1bf1){var _0x14089b=this;return new Promise(function(_0x3e074f,_0x433a7c){return db[_0x3f7c('0x15')][_0x3f7c('0x1d')]({'raw':_0x1e1bf1[_0x3f7c('0x18')]?_0x1e1bf1[_0x3f7c('0x18')][_0x3f7c('0x19')]===undefined?!![]:![]:!![],'where':_0x1e1bf1[_0x3f7c('0x18')]?_0x1e1bf1[_0x3f7c('0x18')]['where']||null:null,'attributes':[[_0x3f7c('0x2d'),_0x3f7c('0x2e')],[db[_0x3f7c('0x1f')]['fn'](_0x3f7c('0x22'),db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x3f7c('0x22'),db[_0x3f7c('0x1f')]['fn']('IF',db[_0x3f7c('0x1f')][_0x3f7c('0x23')](_0x3f7c('0x24')))),_0x3f7c('0x44')]],'group':[_0x3f7c('0x2d')]})[_0x3f7c('0xb')](function(_0x3c7adc){logger[_0x3f7c('0xc')]('GetCampaignHopperHistory',_0x1e1bf1);logger[_0x3f7c('0xf')](_0x3f7c('0x45'),_0x1e1bf1,JSON[_0x3f7c('0x10')](_0x3c7adc));_0x3e074f(_0x3c7adc);})[_0x3f7c('0x1b')](function(_0xd52014){logger['error'](_0x3f7c('0x45'),_0xd52014[_0x3f7c('0x13')],_0x1e1bf1);_0x433a7c(_0x14089b[_0x3f7c('0x11')](0x1f4,_0xd52014[_0x3f7c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 6dc9fb0..d5ffd16 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 _0x8af9=['/describe','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x4deeef,_0x9c0653){var _0x3c50a8=function(_0x595d01){while(--_0x595d01){_0x4deeef['push'](_0x4deeef['shift']());}};_0x3c50a8(++_0x9c0653);}(_0x8af9,0x126));var _0x98af=function(_0x4feb84,_0x3f58fd){_0x4feb84=_0x4feb84-0x0;var _0x441956=_0x8af9[_0x4feb84];return _0x441956;};'use strict';var multer=require(_0x98af('0x0'));var util=require(_0x98af('0x1'));var path=require(_0x98af('0x2'));var timeout=require(_0x98af('0x3'));var express=require(_0x98af('0x4'));var router=express[_0x98af('0x5')]();var fs_extra=require(_0x98af('0x6'));var auth=require(_0x98af('0x7'));var interaction=require(_0x98af('0x8'));var config=require(_0x98af('0x9'));var controller=require(_0x98af('0xa'));router[_0x98af('0xb')]('/',auth[_0x98af('0xc')](),controller[_0x98af('0xd')]);router[_0x98af('0xb')](_0x98af('0xe'),auth[_0x98af('0xc')](),controller[_0x98af('0xf')]);router[_0x98af('0xb')](_0x98af('0x10'),auth[_0x98af('0xc')](),controller[_0x98af('0x11')]);router[_0x98af('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x98af('0x13')](_0x98af('0x10'),auth[_0x98af('0xc')](),controller[_0x98af('0x14')]);module[_0x98af('0x15')]=router; \ No newline at end of file +var _0x8c83=['../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','multer','connect-timeout','Router','fs-extra'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x8c83,0xc8));var _0x38c8=function(_0x3063f1,_0x5dbb79){_0x3063f1=_0x3063f1-0x0;var _0x36fb91=_0x8c83[_0x3063f1];return _0x36fb91;};'use strict';var multer=require(_0x38c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x38c8('0x1'));var express=require('express');var router=express[_0x38c8('0x2')]();var fs_extra=require(_0x38c8('0x3'));var auth=require(_0x38c8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x38c8('0x5'));var controller=require(_0x38c8('0x6'));router[_0x38c8('0x7')]('/',auth['isAuthenticated'](),controller[_0x38c8('0x8')]);router[_0x38c8('0x7')]('/describe',auth[_0x38c8('0x9')](),controller[_0x38c8('0xa')]);router[_0x38c8('0x7')](_0x38c8('0xb'),auth[_0x38c8('0x9')](),controller[_0x38c8('0xc')]);router[_0x38c8('0xd')]('/',auth['isAuthenticated'](),controller[_0x38c8('0xe')]);router[_0x38c8('0xf')](_0x38c8('0xb'),auth[_0x38c8('0x9')](),controller[_0x38c8('0x10')]);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 357ef8c..17b74c5 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 _0x27bf=['exports','STRING','name','sequelize'];(function(_0xa73194,_0x123c26){var _0x3d6685=function(_0x4dc77a){while(--_0x4dc77a){_0xa73194['push'](_0xa73194['shift']());}};_0x3d6685(++_0x123c26);}(_0x27bf,0x117));var _0xf27b=function(_0x5528e6,_0x3b329f){_0x5528e6=_0x5528e6-0x0;var _0x4aee56=_0x27bf[_0x5528e6];return _0x4aee56;};'use strict';var Sequelize=require(_0xf27b('0x0'));module[_0xf27b('0x1')]={'name':{'type':Sequelize[_0xf27b('0x2')],'unique':_0xf27b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf27b('0x2')]},'dialPrefix':{'type':Sequelize[_0xf27b('0x2')]}}; \ No newline at end of file +var _0xd0bb=['exports','STRING','sequelize'];(function(_0x2d5c95,_0x2b189b){var _0xc4af61=function(_0x30d9f6){while(--_0x30d9f6){_0x2d5c95['push'](_0x2d5c95['shift']());}};_0xc4af61(++_0x2b189b);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3a340f,_0x18653e){_0x3a340f=_0x3a340f-0x0;var _0x14ca55=_0xd0bb[_0x3a340f];return _0x14ca55;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbd0b('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 3a370f5..050244a 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 _0x7b8a=['status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Lists','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','CmList','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','limit','rows','removeDispositions','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','concat','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','findAll','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','toString','isEmpty','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','sequelize','transaction','CmCustomField','addCustomFields','TEXT','text','number','INTEGER','switch','Sequelize','defaultValue','findAndCountAll','getGlobalCustomFields','addAgents','ids','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','info','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','localhost','./cmList.socket','register','sendStatus'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x7b8a,0x11f));var _0xa7b8=function(_0x17a647,_0x2bbe12){_0x17a647=_0x17a647-0x0;var _0x219a38=_0x7b8a[_0x17a647];return _0x219a38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7b8('0x0'));var zipdir=require(_0xa7b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7b8('0x2'));var moment=require(_0xa7b8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa7b8('0x4'));var util=require(_0xa7b8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa7b8('0x6'));var ejs=require(_0xa7b8('0x7'));var fs=require('fs');var fs_extra=require(_0xa7b8('0x8'));var _=require(_0xa7b8('0x9'));var squel=require(_0xa7b8('0xa'));var crypto=require('crypto');var jsforce=require(_0xa7b8('0xb'));var deskjs=require(_0xa7b8('0xc'));var toCsv=require(_0xa7b8('0x6'));var querystring=require(_0xa7b8('0xd'));var Papa=require(_0xa7b8('0xe'));var Redis=require(_0xa7b8('0xf'));var authService=require(_0xa7b8('0x10'));var qs=require(_0xa7b8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7b8('0x12'));var logger=require(_0xa7b8('0x13'))(_0xa7b8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa7b8('0x15'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xa7b8('0x16')]=_['defaults'](config[_0xa7b8('0x16')],{'host':_0xa7b8('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7b8('0x16')]));require(_0xa7b8('0x18'))[_0xa7b8('0x19')](socket);function respondWithStatusCode(_0x4f32b4,_0x2493d8){_0x2493d8=_0x2493d8||0xcc;return function(_0x395124){if(_0x395124){return _0x4f32b4[_0xa7b8('0x1a')](_0x2493d8);}return _0x4f32b4[_0xa7b8('0x1b')](_0x2493d8)[_0xa7b8('0x1c')]();};}function respondWithResult(_0x45549e,_0x2847ce){_0x2847ce=_0x2847ce||0xc8;return function(_0x1daf54){if(_0x1daf54){return _0x45549e[_0xa7b8('0x1b')](_0x2847ce)[_0xa7b8('0x1d')](_0x1daf54);}};}function respondWithFilteredResult(_0x98ef38,_0x22a94a){return function(_0x51e61b){if(_0x51e61b){var _0x3bef50=typeof _0x22a94a[_0xa7b8('0x1e')]==='undefined'&&typeof _0x22a94a['limit']===_0xa7b8('0x1f');var _0x14b50c=_0x51e61b[_0xa7b8('0x20')];var _0x35fbbb=_0x3bef50?0x0:_0x22a94a['offset'];var _0x200003=_0x3bef50?_0x51e61b[_0xa7b8('0x20')]:_0x22a94a[_0xa7b8('0x1e')]+_0x22a94a['limit'];var _0x2607ab;if(_0x200003>=_0x14b50c){_0x200003=_0x14b50c;_0x2607ab=0xc8;}else{_0x2607ab=0xce;}_0x98ef38[_0xa7b8('0x1b')](_0x2607ab);return _0x98ef38['set'](_0xa7b8('0x21'),_0x35fbbb+'-'+_0x200003+'/'+_0x14b50c)['json'](_0x51e61b);}return null;};}function patchUpdates(_0x45891b){return function(_0x767e5c){try{jsonpatch[_0xa7b8('0x22')](_0x767e5c,_0x45891b,!![]);}catch(_0x24974c){return BPromise[_0xa7b8('0x23')](_0x24974c);}return _0x767e5c['save']();};}function saveUpdates(_0x4bf533,_0x3395a3){return function(_0x200749){if(_0x200749){return _0x200749[_0xa7b8('0x24')](_0x4bf533)[_0xa7b8('0x25')](function(_0x23847f){return _0x23847f;});}return null;};}function removeEntity(_0x3d3320,_0x5860f8){return function(_0x4b648a){if(_0x4b648a){return _0x4b648a[_0xa7b8('0x26')]()['then'](function(){var _0x808478=_0x4b648a[_0xa7b8('0x27')]({'plain':!![]});var _0x118e30=_0xa7b8('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x118e30,'resourceId':_0x808478['id']}})[_0xa7b8('0x25')](function(){return _0x4b648a;});})[_0xa7b8('0x25')](function(){_0x3d3320[_0xa7b8('0x1b')](0xcc)[_0xa7b8('0x1c')]();});}};}function handleEntityNotFound(_0x372b81,_0x5beb2f){return function(_0x266f7e){if(!_0x266f7e){_0x372b81[_0xa7b8('0x1a')](0x194);}return _0x266f7e;};}function handleError(_0x1317f0,_0x9fe87e){_0x9fe87e=_0x9fe87e||0x1f4;return function(_0x410773){logger[_0xa7b8('0x29')](_0x410773[_0xa7b8('0x2a')]);if(_0x410773[_0xa7b8('0x2b')]){delete _0x410773[_0xa7b8('0x2b')];}_0x1317f0['status'](_0x9fe87e)[_0xa7b8('0x2c')](_0x410773);};}exports[_0xa7b8('0x2d')]=function(_0x36c5b1,_0xacef9f){var _0x3f5e94={},_0xcd927b={},_0x1c4fe1={'count':0x0,'rows':[]};var _0x19f5e4=_[_0xa7b8('0x2e')](db['CmList'][_0xa7b8('0x2f')],function(_0x57bfef){return{'name':_0x57bfef[_0xa7b8('0x30')],'type':_0x57bfef[_0xa7b8('0x31')]['key']};});_0xcd927b[_0xa7b8('0x32')]=_[_0xa7b8('0x2e')](_0x19f5e4,_0xa7b8('0x2b'));_0xcd927b['query']=_[_0xa7b8('0x33')](_0x36c5b1[_0xa7b8('0x34')]);_0xcd927b[_0xa7b8('0x35')]=_[_0xa7b8('0x36')](_0xcd927b[_0xa7b8('0x32')],_0xcd927b[_0xa7b8('0x34')]);_0x3f5e94[_0xa7b8('0x37')]=_[_0xa7b8('0x36')](_0xcd927b[_0xa7b8('0x32')],qs[_0xa7b8('0x38')](_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0x3f5e94[_0xa7b8('0x37')]=_0x3f5e94[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0x3f5e94[_0xa7b8('0x37')]:_0xcd927b['model'];if(!_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0x3f5e94['limit']=qs['limit'](_0x36c5b1[_0xa7b8('0x34')]['limit']);_0x3f5e94[_0xa7b8('0x1e')]=qs[_0xa7b8('0x1e')](_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x1e')]);}_0x3f5e94[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x36c5b1['query'][_0xa7b8('0x3d')]);_0x3f5e94[_0xa7b8('0x3e')]=qs[_0xa7b8('0x35')](_[_0xa7b8('0x3f')](_0x36c5b1[_0xa7b8('0x34')],_0xcd927b[_0xa7b8('0x35')]),_0x19f5e4);if(_0x36c5b1[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0x3f5e94['where']=_['merge'](_0x3f5e94['where'],{'$or':_[_0xa7b8('0x2e')](_0x19f5e4,function(_0x32fe03){if(_0x32fe03[_0xa7b8('0x31')]!==_0xa7b8('0x41')){var _0x5620d3={};_0x5620d3[_0x32fe03[_0xa7b8('0x2b')]]={'$like':'%'+_0x36c5b1[_0xa7b8('0x34')]['filter']+'%'};return _0x5620d3;}})});}_0x3f5e94=_[_0xa7b8('0x42')]({},_0x3f5e94,_0x36c5b1[_0xa7b8('0x43')]);var _0x5ed6b9={'where':_0x3f5e94['where']};return db['CmList'][_0xa7b8('0x20')](_0x5ed6b9)[_0xa7b8('0x25')](function(_0x328825){_0x1c4fe1[_0xa7b8('0x20')]=_0x328825;if(_0x36c5b1[_0xa7b8('0x34')]['includeAll']){_0x3f5e94[_0xa7b8('0x44')]=[{'all':!![]}];}return db[_0xa7b8('0x45')]['findAll'](_0x3f5e94);})[_0xa7b8('0x25')](function(_0x10f02a){_0x1c4fe1['rows']=_0x10f02a;return _0x1c4fe1;})['then'](respondWithFilteredResult(_0xacef9f,_0x3f5e94))[_0xa7b8('0x46')](handleError(_0xacef9f,null));};exports[_0xa7b8('0x47')]=function(_0x1189e2,_0xf16fc1){var _0x4d2f87={'raw':![],'where':{'id':_0x1189e2['params']['id']}},_0x458cb1={};_0x458cb1[_0xa7b8('0x32')]=_['keys'](db[_0xa7b8('0x45')][_0xa7b8('0x2f')]);_0x458cb1[_0xa7b8('0x34')]=_[_0xa7b8('0x33')](_0x1189e2[_0xa7b8('0x34')]);_0x458cb1['filters']=_[_0xa7b8('0x36')](_0x458cb1[_0xa7b8('0x32')],_0x458cb1[_0xa7b8('0x34')]);_0x4d2f87['attributes']=_[_0xa7b8('0x36')](_0x458cb1[_0xa7b8('0x32')],qs['fields'](_0x1189e2[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0x4d2f87[_0xa7b8('0x37')]=_0x4d2f87[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0x4d2f87[_0xa7b8('0x37')]:_0x458cb1[_0xa7b8('0x32')];if(_0x1189e2[_0xa7b8('0x34')][_0xa7b8('0x48')]){_0x4d2f87[_0xa7b8('0x44')]=[{'all':!![]}];}_0x4d2f87=_['merge']({},_0x4d2f87,_0x1189e2['options']);return db[_0xa7b8('0x45')][_0xa7b8('0x49')](_0x4d2f87)[_0xa7b8('0x25')](handleEntityNotFound(_0xf16fc1,null))[_0xa7b8('0x25')](respondWithResult(_0xf16fc1,null))['catch'](handleError(_0xf16fc1,null));};exports[_0xa7b8('0x4a')]=function(_0x34a30b,_0x3b31c5){return db[_0xa7b8('0x45')][_0xa7b8('0x4a')](_0x34a30b[_0xa7b8('0x4b')],{})[_0xa7b8('0x25')](function(_0x10a025){var _0x44b538=_0x34a30b[_0xa7b8('0x4c')][_0xa7b8('0x27')]({'plain':!![]});if(!_0x44b538)throw new Error(_0xa7b8('0x4d'));if(_0x44b538['role']===_0xa7b8('0x4c')){var _0x380e4e=_0x10a025[_0xa7b8('0x27')]({'plain':!![]});var _0x230d99=_0xa7b8('0x28');return db[_0xa7b8('0x4e')][_0xa7b8('0x49')]({'where':{'name':_0x230d99,'userProfileId':_0x44b538['userProfileId']},'raw':!![]})['then'](function(_0x2f666f){if(_0x2f666f&&_0x2f666f['autoAssociation']===0x0){return db[_0xa7b8('0x4f')][_0xa7b8('0x4a')]({'name':_0x380e4e[_0xa7b8('0x2b')],'resourceId':_0x380e4e['id'],'type':_0x2f666f[_0xa7b8('0x2b')],'sectionId':_0x2f666f['id']},{})[_0xa7b8('0x25')](function(){return _0x10a025;});}else{return _0x10a025;}})['catch'](function(_0x5baf0){logger[_0xa7b8('0x29')](_0xa7b8('0x50'),_0x5baf0);throw _0x5baf0;});}return _0x10a025;})[_0xa7b8('0x25')](respondWithResult(_0x3b31c5,0xc9))[_0xa7b8('0x46')](handleError(_0x3b31c5,null));};exports[_0xa7b8('0x24')]=function(_0x201e47,_0x416d43){if(_0x201e47[_0xa7b8('0x4b')]['id']){delete _0x201e47[_0xa7b8('0x4b')]['id'];}return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x201e47[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x416d43,null))['then'](saveUpdates(_0x201e47['body'],null))[_0xa7b8('0x25')](respondWithResult(_0x416d43,null))['catch'](handleError(_0x416d43,null));};exports[_0xa7b8('0x26')]=function(_0x32e48e,_0x1ba695){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x32e48e[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x1ba695,null))['then'](removeEntity(_0x1ba695,null))['catch'](handleError(_0x1ba695,null));};exports[_0xa7b8('0x52')]=function(_0x49c1ef,_0x369b3a){return db[_0xa7b8('0x45')][_0xa7b8('0x52')]()[_0xa7b8('0x25')](respondWithResult(_0x369b3a,null))[_0xa7b8('0x46')](handleError(_0x369b3a,null));};exports[_0xa7b8('0x53')]=function(_0x3d7cac,_0x3e0e80,_0x188523){if(_0x3d7cac[_0xa7b8('0x4b')]['id']){delete _0x3d7cac[_0xa7b8('0x4b')]['id'];}return db['CmList'][_0xa7b8('0x49')]({'where':{'id':_0x3d7cac[_0xa7b8('0x51')]['id']}})['then'](handleEntityNotFound(_0x3e0e80,null))['then'](function(_0x354d62){if(_0x354d62){_0x3d7cac['body'][_0xa7b8('0x54')]=_0x354d62['id'];return db[_0xa7b8('0x55')][_0xa7b8('0x4a')](_0x3d7cac[_0xa7b8('0x4b')]);}})['then'](respondWithResult(_0x3e0e80,null))[_0xa7b8('0x46')](handleError(_0x3e0e80,null));};exports[_0xa7b8('0x56')]=function(_0x2a7d28,_0x5153ac,_0x571821){var _0x3187c0={'raw':![],'where':{}};var _0x58bfaa={};var _0x1ba308={'count':0x0,'rows':[]};return db[_0xa7b8('0x45')][_0xa7b8('0x57')]({'where':{'id':_0x2a7d28[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x5153ac,null))[_0xa7b8('0x25')](function(_0x54819b){if(_0x54819b){_0x58bfaa['model']=_[_0xa7b8('0x33')](db[_0xa7b8('0x55')][_0xa7b8('0x2f')]);_0x58bfaa['query']=_[_0xa7b8('0x33')](_0x2a7d28['query']);_0x58bfaa['filters']=_[_0xa7b8('0x36')](_0x58bfaa[_0xa7b8('0x32')],_0x58bfaa[_0xa7b8('0x34')]);_0x3187c0['attributes']=_[_0xa7b8('0x36')](_0x58bfaa[_0xa7b8('0x32')],qs[_0xa7b8('0x38')](_0x2a7d28[_0xa7b8('0x34')]['fields']));_0x3187c0[_0xa7b8('0x37')]=_0x3187c0[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0x3187c0['attributes']:_0x58bfaa['model'];if(!_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0x3187c0[_0xa7b8('0x58')]=qs[_0xa7b8('0x58')](_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x58')]);_0x3187c0[_0xa7b8('0x1e')]=qs[_0xa7b8('0x1e')](_0x2a7d28[_0xa7b8('0x34')]['offset']);}_0x3187c0[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x3d')]);_0x3187c0[_0xa7b8('0x3e')]=qs['filters'](_[_0xa7b8('0x3f')](_0x2a7d28[_0xa7b8('0x34')],_0x58bfaa[_0xa7b8('0x35')]));_0x3187c0[_0xa7b8('0x3e')]['ListId']=_0x54819b['id'];if(_0x2a7d28[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0x3187c0[_0xa7b8('0x3e')]=_[_0xa7b8('0x42')](_0x3187c0[_0xa7b8('0x3e')],{'$or':_[_0xa7b8('0x2e')](_0x3187c0[_0xa7b8('0x37')],function(_0x44b51d){var _0x5c08cb={};_0x5c08cb[_0x44b51d]={'$like':'%'+_0x2a7d28[_0xa7b8('0x34')]['filter']+'%'};return _0x5c08cb;})});}_0x3187c0=_[_0xa7b8('0x42')]({},_0x3187c0,_0x2a7d28['options']);return db['Disposition']['count']({'where':_0x3187c0[_0xa7b8('0x3e')]})['then'](function(_0x1c5732){_0x1ba308[_0xa7b8('0x20')]=_0x1c5732;if(_0x2a7d28['query'][_0xa7b8('0x48')]){_0x3187c0[_0xa7b8('0x44')]=[{'all':!![]}];}return db[_0xa7b8('0x55')]['findAll'](_0x3187c0);})[_0xa7b8('0x25')](function(_0x4ba34f){_0x1ba308[_0xa7b8('0x59')]=_0x4ba34f;return _0x1ba308;});}})[_0xa7b8('0x25')](respondWithFilteredResult(_0x5153ac,_0x3187c0))['catch'](handleError(_0x5153ac,null));};exports[_0xa7b8('0x5a')]=function(_0x273c27,_0x2929a6,_0x4f609f){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x273c27['params']['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x2929a6,null))[_0xa7b8('0x25')](function(_0x4360df){if(_0x4360df){return _0x4360df['removeDispositions'](_0x273c27[_0xa7b8('0x34')]['ids']);}})[_0xa7b8('0x25')](respondWithStatusCode(_0x2929a6,null))['catch'](handleError(_0x2929a6,null));};exports[_0xa7b8('0x5b')]=function(_0x1e3ff8,_0xade684,_0x569fbc){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x1e3ff8[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0xade684,null))[_0xa7b8('0x25')](function(_0x894bac){if(_0x894bac){var _0x582b22=[];var _0xbe717e={'success':[],'errors':[]};return db[_0xa7b8('0x5c')][_0xa7b8('0x52')]()[_0xa7b8('0x25')](function(_0x10a3dd){if(_0x1e3ff8['body'][_0xa7b8('0x5d')]&&_[_0xa7b8('0x5e')](_0x1e3ff8[_0xa7b8('0x4b')]['tags'])){if(_0x1e3ff8['body'][_0xa7b8('0x5d')]['length']){_0x1e3ff8[_0xa7b8('0x4b')][_0xa7b8('0x5d')]=_0x1e3ff8[_0xa7b8('0x4b')][_0xa7b8('0x5d')]['join'](';')+';';}else{_0x1e3ff8[_0xa7b8('0x4b')][_0xa7b8('0x5d')]=null;}}else{_0x1e3ff8[_0xa7b8('0x4b')]['tags']=null;}if(_0x1e3ff8[_0xa7b8('0x4b')]&&_[_0xa7b8('0x5e')](_0x1e3ff8[_0xa7b8('0x4b')])){for(var _0x5e5aa6=0x0;_0x5e5aa6<_0x1e3ff8['body'][_0xa7b8('0x39')];_0x5e5aa6+=0x1){_0x1e3ff8['body'][_0x5e5aa6]['ListId']=_0x1e3ff8[_0xa7b8('0x51')]['id'];_0x582b22[_0xa7b8('0x5f')](_0x1e3ff8['body'][_0x5e5aa6]);}return BPromise[_0xa7b8('0x60')](_0x582b22,function(_0x4b2963){return db[_0xa7b8('0x5c')][_0xa7b8('0x4a')](_[_0xa7b8('0x61')](_0x4b2963,['ids','id'])||{},{'fields':_[_0xa7b8('0x33')](_0x10a3dd),'raw':!![]})[_0xa7b8('0x25')](function(_0x437787){_0xbe717e[_0xa7b8('0x62')]['push'](_0x437787[_0xa7b8('0x63')]);})[_0xa7b8('0x46')](function(_0x12e05a){_0xbe717e[_0xa7b8('0x64')][_0xa7b8('0x5f')]({'data':_0x4b2963,'error':_0x12e05a[_0xa7b8('0x65')]});});})[_0xa7b8('0x25')](function(_0x3f5f0b){return _0xbe717e;})['catch'](function(_0x1861e7){return _0x1861e7;});}else{_0xade684[_0xa7b8('0x1b')](0x190)[_0xa7b8('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0xade684,null))[_0xa7b8('0x46')](handleError(_0xade684,null));};exports['getContacts']=function(_0x2f89fc,_0x65e1bc,_0x2aafdf){var _0x40c95a;return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x2f89fc['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xa7b8('0x25')](handleEntityNotFound(_0x65e1bc,null))[_0xa7b8('0x25')](function(_0x1edd41){if(_0x1edd41){_0x40c95a=_0x1edd41;return db[_0xa7b8('0x5c')]['rawAttributes'];}})[_0xa7b8('0x25')](function(_0x579429){if(_0x579429){var _0x3bd164={};var _0x1a6383={};_0x1a6383['model']=_[_0xa7b8('0x66')](_[_0xa7b8('0x33')](_0x579429),_[_0xa7b8('0x2e')](_0x40c95a[_0xa7b8('0x67')],function(_0x1bb8df){return util[_0xa7b8('0x68')](_0xa7b8('0x69'),_0x1bb8df['id']);}));_0x1a6383['query']=_['keys'](_0x2f89fc[_0xa7b8('0x34')]);_0x1a6383['filters']=_['intersection'](_0x1a6383['model'],_0x1a6383[_0xa7b8('0x34')]);_0x3bd164['attributes']=_['intersection'](_0x1a6383['model'],qs['fields'](_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0x3bd164['attributes']=_0x3bd164[_0xa7b8('0x37')]['length']?_0x3bd164[_0xa7b8('0x37')]:_0x1a6383[_0xa7b8('0x32')];if(!_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0x3bd164[_0xa7b8('0x58')]=qs[_0xa7b8('0x58')](_0x2f89fc['query'][_0xa7b8('0x58')]);_0x3bd164[_0xa7b8('0x1e')]=qs['offset'](_0x2f89fc['query'][_0xa7b8('0x1e')]);}_0x3bd164[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x2f89fc['query'][_0xa7b8('0x3d')]);_0x3bd164['where']=qs[_0xa7b8('0x35')](_[_0xa7b8('0x3f')](_0x2f89fc[_0xa7b8('0x34')],_0x1a6383[_0xa7b8('0x35')]));_0x3bd164[_0xa7b8('0x6a')]=!![];if(_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0x3bd164[_0xa7b8('0x3e')]=_[_0xa7b8('0x42')](_0x3bd164[_0xa7b8('0x3e')],{'$or':_[_0xa7b8('0x2e')](_0x3bd164['attributes'],function(_0x4bc8a0){var _0x2be72f={};_0x2be72f[_0x4bc8a0]={'$like':'%'+_0x2f89fc[_0xa7b8('0x34')][_0xa7b8('0x40')]+'%'};return _0x2be72f;})});}_0x3bd164=_[_0xa7b8('0x42')]({},_0x3bd164,_0x2f89fc['options']);return _0x40c95a['getContacts'](_0x3bd164);}})[_0xa7b8('0x25')](respondWithResult(_0x65e1bc,null))[_0xa7b8('0x46')](handleError(_0x65e1bc,null));};exports[_0xa7b8('0x6b')]=function(_0x463a0d,_0x437877,_0x346aac){var _0x318a04;var _0x52aa65;var _0x139c61;var _0x35094e=_0x463a0d[_0xa7b8('0x51')]['id'];csv_results=[];return db[_0xa7b8('0x6c')][_0xa7b8('0x6d')]({'attributes':['id',_0xa7b8('0x2b')],'raw':!![],'order':[_0xa7b8('0x6e')]})[_0xa7b8('0x25')](function(_0x163a98){_0x318a04=_0x163a98;var _0x2db792=_[_0xa7b8('0x33')](db[_0xa7b8('0x5c')][_0xa7b8('0x2f')]);return db['CmCustomField'][_0xa7b8('0x6d')]({'raw':!![],'attributes':['id',_0xa7b8('0x6f')]})[_0xa7b8('0x25')](function(_0x2530d5){_0x52aa65=_0x2530d5;var _0x42f9a8=squel[_0xa7b8('0x70')]()[_0xa7b8('0x38')](_0x2db792)[_0xa7b8('0x71')](_0xa7b8('0x72'),'c')[_0xa7b8('0x3e')](_0xa7b8('0x73'),_0x35094e)['where'](_0xa7b8('0x74'))[_0xa7b8('0x75')]();for(var _0x272377=0x0;_0x272377<_0x52aa65[_0xa7b8('0x39')];_0x272377++){_0x42f9a8[_0xa7b8('0x76')](_0xa7b8('0x77')+_0x52aa65[_0x272377]['id'],_0xa7b8('0x78')+_0x52aa65[_0x272377][_0xa7b8('0x6f')]);}for(var _0x272377=0x0;_0x272377<_0x318a04[_0xa7b8('0x39')];_0x272377++){_0x42f9a8[_0xa7b8('0x76')](squel[_0xa7b8('0x70')]()[_0xa7b8('0x76')](_0xa7b8('0x79'))[_0xa7b8('0x71')](_0xa7b8('0x7a'))[_0xa7b8('0x3e')](_0xa7b8('0x7b'),_0x318a04[_0x272377]['id'])[_0xa7b8('0x3e')](_0xa7b8('0x7c')),'additionalPhone_'+_0x318a04[_0x272377][_0xa7b8('0x2b')]);_0x42f9a8[_0xa7b8('0x76')](squel[_0xa7b8('0x70')]()[_0xa7b8('0x76')](_0xa7b8('0x7d'))['from']('cm_contact_has_items')[_0xa7b8('0x3e')](_0xa7b8('0x7b'),_0x318a04[_0x272377]['id'])[_0xa7b8('0x3e')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x318a04[_0x272377][_0xa7b8('0x2b')]);}var _0xea4197=[];_0xea4197['push'](_0x42f9a8['toString']());BPromise[_0xa7b8('0x60')](_0xea4197,handleQuery)[_0xa7b8('0x25')](function(_0x21517e){handleQuery(_0x42f9a8[_0xa7b8('0x7e')]());var _0x5efb4b=csv_results[0x0];if(!_[_0xa7b8('0x7f')](_0x5efb4b)){var _0x507614=toCsv(_0x5efb4b);var _0x1efa90=Date['now']();fs[_0xa7b8('0x80')](util['format']('/tmp/list_%d_%s.csv',_0x35094e,_0x1efa90),_0x507614);_0x437877[_0xa7b8('0x81')]('Content-disposition',_0xa7b8('0x82')+util[_0xa7b8('0x68')](_0xa7b8('0x83'),_0x35094e,_0x1efa90));_0x437877[_0xa7b8('0x81')](_0xa7b8('0x84'),_0xa7b8('0x85'));return _0x437877['download'](util['format']('/tmp/list_%d_%s.csv',_0x35094e,_0x1efa90));}else{return _0x437877[_0xa7b8('0x1a')](0xcc);}});});});};exports['addCustomField']=function(_0x544b7e,_0xf83b67,_0x7196e0){var _0x483dbe;delete _0x544b7e[_0xa7b8('0x4b')]['id'];return db[_0xa7b8('0x45')]['findOne']({'where':{'id':_0x544b7e['params']['id']}})['then'](handleEntityNotFound(_0xf83b67,null))[_0xa7b8('0x25')](function(_0x135c41){if(_0x135c41){return db[_0xa7b8('0x86')][_0xa7b8('0x87')](function(_0x1181dc){return db[_0xa7b8('0x88')]['create'](_0x544b7e[_0xa7b8('0x4b')],{'transaction':_0x1181dc})['then'](function(_0x54fe5b){_0x483dbe=_0x54fe5b;return _0x135c41[_0xa7b8('0x89')](_0x54fe5b,{'transaction':_0x1181dc});})[_0xa7b8('0x25')](function(){var _0x1febac={'type':db['Sequelize'][_0xa7b8('0x8a')],'transaction':_0x1181dc};switch(_0x544b7e[_0xa7b8('0x4b')]['type']){case _0xa7b8('0x8b'):_0x1febac[_0xa7b8('0x31')]=db['Sequelize'][_0xa7b8('0x8a')];break;case _0xa7b8('0x8c'):_0x1febac['type']=db['Sequelize'][_0xa7b8('0x8d')];break;case _0xa7b8('0x8e'):_0x1febac[_0xa7b8('0x31')]=db[_0xa7b8('0x8f')]['BOOLEAN'];_0x1febac[_0xa7b8('0x90')]=![];break;default:}return db[_0xa7b8('0x86')]['queryInterface']['addColumn'](_0xa7b8('0x72'),util[_0xa7b8('0x68')]('cf_%s',_0x483dbe['id']),_0x1febac);})[_0xa7b8('0x25')](function(){return _0x483dbe;});});}})['then'](respondWithResult(_0xf83b67,null))[_0xa7b8('0x46')](handleError(_0xf83b67,null));};exports['getCustomFields']=function(_0x23bab0,_0x1faf1e,_0x38e1e9){var _0xe82a44={};var _0x2bf695={};var _0x3ec2b3;var _0x50e23b;return db[_0xa7b8('0x45')][_0xa7b8('0x57')]({'where':{'id':_0x23bab0[_0xa7b8('0x51')]['id']}})['then'](handleEntityNotFound(_0x1faf1e,null))[_0xa7b8('0x25')](function(_0x22b99a){if(_0x22b99a){_0x3ec2b3=_0x22b99a;_0x2bf695[_0xa7b8('0x32')]=_[_0xa7b8('0x33')](db[_0xa7b8('0x88')][_0xa7b8('0x2f')]);_0x2bf695[_0xa7b8('0x34')]=_[_0xa7b8('0x33')](_0x23bab0[_0xa7b8('0x34')]);_0x2bf695['filters']=_[_0xa7b8('0x36')](_0x2bf695[_0xa7b8('0x32')],_0x2bf695['query']);_0xe82a44[_0xa7b8('0x37')]=_['intersection'](_0x2bf695[_0xa7b8('0x32')],qs['fields'](_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0xe82a44[_0xa7b8('0x37')]=_0xe82a44['attributes'][_0xa7b8('0x39')]?_0xe82a44[_0xa7b8('0x37')]:_0x2bf695[_0xa7b8('0x32')];_0xe82a44[_0xa7b8('0x3c')]=qs[_0xa7b8('0x3d')](_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x3d')]);_0xe82a44['where']=qs['filters'](_[_0xa7b8('0x3f')](_0x23bab0[_0xa7b8('0x34')],_0x2bf695[_0xa7b8('0x35')]));_0xe82a44['where']=_[_0xa7b8('0x42')](_0xe82a44[_0xa7b8('0x3e')],{'$or':[{'ListId':_0x22b99a['id']},{'ListId':null}]});if(_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x40')]){_0xe82a44['where']=_[_0xa7b8('0x42')](_0xe82a44['where'],{'$or':_['map'](_0xe82a44[_0xa7b8('0x37')],function(_0x5a8f5b){var _0x51473a={};_0x51473a[_0x5a8f5b]={'$like':'%'+_0x23bab0[_0xa7b8('0x34')][_0xa7b8('0x40')]+'%'};return _0x51473a;})});}_0xe82a44=_[_0xa7b8('0x42')]({},_0xe82a44,_0x23bab0[_0xa7b8('0x43')]);return db[_0xa7b8('0x88')][_0xa7b8('0x91')](_0xe82a44);}})[_0xa7b8('0x25')](respondWithResult(_0x1faf1e,null))[_0xa7b8('0x46')](handleError(_0x1faf1e,null));};exports[_0xa7b8('0x92')]=function(_0x41903c,_0x1564ee){return db[_0xa7b8('0x88')]['findAndCountAll']({'where':{'ListId':null}})[_0xa7b8('0x25')](handleEntityNotFound(_0x1564ee,null))[_0xa7b8('0x25')](function(_0x498c74){return _0x498c74;})[_0xa7b8('0x25')](respondWithResult(_0x1564ee,null))['catch'](handleError(_0x1564ee,null));};exports[_0xa7b8('0x93')]=function(_0x21a9f4,_0x4d600e,_0x3b5872){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x21a9f4[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x4d600e,null))[_0xa7b8('0x25')](function(_0x224496){if(_0x224496){return _0x224496['addAgents'](_0x21a9f4[_0xa7b8('0x4b')][_0xa7b8('0x94')],_[_0xa7b8('0x61')](_0x21a9f4[_0xa7b8('0x4b')],[_0xa7b8('0x94'),'id'])||{})[_0xa7b8('0x95')](function(_0x668142){for(var _0x2fbae6=0x0;_0x2fbae6<_0x21a9f4[_0xa7b8('0x4b')][_0xa7b8('0x94')][_0xa7b8('0x39')];_0x2fbae6+=0x1){socket['emit'](_0xa7b8('0x96'),{'UserId':Number(_0x21a9f4['body'][_0xa7b8('0x94')][_0x2fbae6]),'CmListId':Number(_0x21a9f4[_0xa7b8('0x51')]['id'])});}return _0x668142;});}})[_0xa7b8('0x25')](respondWithResult(_0x4d600e,null))[_0xa7b8('0x46')](handleError(_0x4d600e,null));};exports['removeAgents']=function(_0x1a2fd6,_0x251f42,_0x171591){return db[_0xa7b8('0x45')][_0xa7b8('0x49')]({'where':{'id':_0x1a2fd6[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x251f42,null))['then'](function(_0x21c6e6){if(_0x21c6e6){return _0x21c6e6[_0xa7b8('0x97')](_0x1a2fd6[_0xa7b8('0x34')]['ids'])[_0xa7b8('0x25')](function(){if(_['isArray'](_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')])){for(var _0x3a9886=0x0;_0x3a9886<_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')][_0xa7b8('0x39')];_0x3a9886+=0x1){socket['emit'](_0xa7b8('0x98'),{'UserId':Number(_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')][_0x3a9886]),'CmListId':Number(_0x1a2fd6[_0xa7b8('0x51')]['id'])});}}else{socket[_0xa7b8('0x99')](_0xa7b8('0x98'),{'UserId':Number(_0x1a2fd6[_0xa7b8('0x34')][_0xa7b8('0x94')]),'CmListId':Number(_0x1a2fd6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x251f42,null))['catch'](handleError(_0x251f42,null));};exports[_0xa7b8('0x9a')]=function(_0x4a9be1,_0x3a8b01,_0x4daa24){var _0xc3b23f={};var _0x1bfd6e={};var _0x1bc0c5;var _0x5cf826;return db[_0xa7b8('0x45')][_0xa7b8('0x57')]({'where':{'id':_0x4a9be1[_0xa7b8('0x51')]['id']}})[_0xa7b8('0x25')](handleEntityNotFound(_0x3a8b01,null))[_0xa7b8('0x25')](function(_0x236dc4){if(_0x236dc4){_0x1bc0c5=_0x236dc4;_0x1bfd6e['model']=_['keys'](db[_0xa7b8('0x9b')][_0xa7b8('0x2f')]);_0x1bfd6e[_0xa7b8('0x34')]=_['keys'](_0x4a9be1[_0xa7b8('0x34')]);_0x1bfd6e[_0xa7b8('0x35')]=_[_0xa7b8('0x36')](_0x1bfd6e['model'],_0x1bfd6e[_0xa7b8('0x34')]);_0xc3b23f[_0xa7b8('0x37')]=_[_0xa7b8('0x36')](_0x1bfd6e[_0xa7b8('0x32')],qs[_0xa7b8('0x38')](_0x4a9be1[_0xa7b8('0x34')][_0xa7b8('0x38')]));_0xc3b23f[_0xa7b8('0x37')]=_0xc3b23f[_0xa7b8('0x37')][_0xa7b8('0x39')]?_0xc3b23f[_0xa7b8('0x37')]:_0x1bfd6e[_0xa7b8('0x32')];_0xc3b23f['order']=qs[_0xa7b8('0x3d')](_0x4a9be1[_0xa7b8('0x34')]['sort']);_0xc3b23f[_0xa7b8('0x3e')]=qs[_0xa7b8('0x35')](_[_0xa7b8('0x3f')](_0x4a9be1['query'],_0x1bfd6e[_0xa7b8('0x35')]));if(_0x4a9be1[_0xa7b8('0x34')]['filter']){_0xc3b23f['where']=_['merge'](_0xc3b23f['where'],{'$or':_[_0xa7b8('0x2e')](_0xc3b23f[_0xa7b8('0x37')],function(_0x2a1015){var _0xc92dcb={};_0xc92dcb[_0x2a1015]={'$like':'%'+_0x4a9be1[_0xa7b8('0x34')]['filter']+'%'};return _0xc92dcb;})});}_0xc3b23f=_[_0xa7b8('0x42')]({},_0xc3b23f,_0x4a9be1[_0xa7b8('0x43')]);return _0x1bc0c5[_0xa7b8('0x9a')](_0xc3b23f);}})[_0xa7b8('0x25')](function(_0x1556f7){if(_0x1556f7){_0x5cf826=_0x1556f7['length'];if(!_0x4a9be1['query'][_0xa7b8('0x3a')](_0xa7b8('0x3b'))){_0xc3b23f['limit']=qs['limit'](_0x4a9be1['query'][_0xa7b8('0x58')]);_0xc3b23f[_0xa7b8('0x1e')]=qs[_0xa7b8('0x1e')](_0x4a9be1[_0xa7b8('0x34')][_0xa7b8('0x1e')]);}return _0x1bc0c5[_0xa7b8('0x9a')](_0xc3b23f);}})[_0xa7b8('0x25')](function(_0x2ae1be){if(_0x2ae1be){return _0x2ae1be?{'count':_0x5cf826,'rows':_0x2ae1be}:null;}})[_0xa7b8('0x25')](respondWithResult(_0x3a8b01,null))[_0xa7b8('0x46')](handleError(_0x3a8b01,null));};function handleQuery(_0x4042de){logger[_0xa7b8('0x9c')](_0x4042de);return db[_0xa7b8('0x86')][_0xa7b8('0x34')](_0x4042de)['spread'](function(_0x28a3e){csv_results[_0xa7b8('0x5f')](_0x28a3e);})[_0xa7b8('0x46')](function(_0x48b604){logger[_0xa7b8('0x29')](_0x48b604['message']);});} \ No newline at end of file +var _0xcea1=['includeAll','include','findAll','rows','catch','show','params','keys','length','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','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','ListId','removeDispositions','CmContact','tags','isArray','push','each','ids','success','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','order','raw','getContactsCsv','ContactItemType','OrderBy','alias','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','now','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','TEXT','number','Sequelize','BOOLEAN','defaultValue','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','message','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','undefined','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count'];(function(_0x446037,_0x2e6a23){var _0x4fca76=function(_0x5bd3fa){while(--_0x5bd3fa){_0x446037['push'](_0x446037['shift']());}};_0x4fca76(++_0x2e6a23);}(_0xcea1,0x105));var _0x1cea=function(_0x585221,_0xb7e318){_0x585221=_0x585221-0x0;var _0x17111b=_0xcea1[_0x585221];return _0x17111b;};'use strict';var emlformat=require(_0x1cea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1cea('0x1'));var jsonpatch=require(_0x1cea('0x2'));var rp=require(_0x1cea('0x3'));var moment=require(_0x1cea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1cea('0x5'));var util=require('util');var path=require(_0x1cea('0x6'));var sox=require(_0x1cea('0x7'));var csv=require(_0x1cea('0x8'));var ejs=require(_0x1cea('0x9'));var fs=require('fs');var fs_extra=require(_0x1cea('0xa'));var _=require(_0x1cea('0xb'));var squel=require(_0x1cea('0xc'));var crypto=require(_0x1cea('0xd'));var jsforce=require(_0x1cea('0xe'));var deskjs=require(_0x1cea('0xf'));var toCsv=require(_0x1cea('0x8'));var querystring=require(_0x1cea('0x10'));var Papa=require(_0x1cea('0x11'));var Redis=require('ioredis');var authService=require(_0x1cea('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1cea('0x13'));var hardwareService=require(_0x1cea('0x14'));var logger=require(_0x1cea('0x15'))('api');var utils=require(_0x1cea('0x16'));var config=require(_0x1cea('0x17'));var licenseUtil=require(_0x1cea('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x1cea('0x19')]=_[_0x1cea('0x1a')](config[_0x1cea('0x19')],{'host':_0x1cea('0x1b'),'port':0x18eb});var socket=require(_0x1cea('0x1c'))(new Redis(config['redis']));require(_0x1cea('0x1d'))[_0x1cea('0x1e')](socket);function respondWithStatusCode(_0x5c434f,_0x266472){_0x266472=_0x266472||0xcc;return function(_0x30fdd0){if(_0x30fdd0){return _0x5c434f[_0x1cea('0x1f')](_0x266472);}return _0x5c434f[_0x1cea('0x20')](_0x266472)[_0x1cea('0x21')]();};}function respondWithResult(_0x174bc8,_0x45870b){_0x45870b=_0x45870b||0xc8;return function(_0x42ae19){if(_0x42ae19){return _0x174bc8['status'](_0x45870b)['json'](_0x42ae19);}};}function respondWithFilteredResult(_0x1c29fa,_0x18c4d6){return function(_0x22bbb0){if(_0x22bbb0){var _0x457ff5=typeof _0x18c4d6[_0x1cea('0x22')]==='undefined'&&typeof _0x18c4d6[_0x1cea('0x23')]===_0x1cea('0x24');var _0x1c30c2=_0x22bbb0['count'];var _0x383593=_0x457ff5?0x0:_0x18c4d6[_0x1cea('0x22')];var _0x531028=_0x457ff5?_0x22bbb0['count']:_0x18c4d6[_0x1cea('0x22')]+_0x18c4d6[_0x1cea('0x23')];var _0x1c3de1;if(_0x531028>=_0x1c30c2){_0x531028=_0x1c30c2;_0x1c3de1=0xc8;}else{_0x1c3de1=0xce;}_0x1c29fa[_0x1cea('0x20')](_0x1c3de1);return _0x1c29fa['set'](_0x1cea('0x25'),_0x383593+'-'+_0x531028+'/'+_0x1c30c2)[_0x1cea('0x26')](_0x22bbb0);}return null;};}function patchUpdates(_0x5aa006){return function(_0x235e9f){try{jsonpatch['apply'](_0x235e9f,_0x5aa006,!![]);}catch(_0xcda95c){return BPromise[_0x1cea('0x27')](_0xcda95c);}return _0x235e9f['save']();};}function saveUpdates(_0x32831b,_0x3629fa){return function(_0x4b393c){if(_0x4b393c){return _0x4b393c[_0x1cea('0x28')](_0x32831b)[_0x1cea('0x29')](function(_0x14be0a){return _0x14be0a;});}return null;};}function removeEntity(_0x247c43,_0x3a2c6c){return function(_0x3cac9c){if(_0x3cac9c){return _0x3cac9c[_0x1cea('0x2a')]()[_0x1cea('0x29')](function(){var _0x5278b4=_0x3cac9c[_0x1cea('0x2b')]({'plain':!![]});var _0x1add41='Lists';return db[_0x1cea('0x2c')][_0x1cea('0x2a')]({'where':{'type':_0x1add41,'resourceId':_0x5278b4['id']}})[_0x1cea('0x29')](function(){return _0x3cac9c;});})[_0x1cea('0x29')](function(){_0x247c43['status'](0xcc)[_0x1cea('0x21')]();});}};}function handleEntityNotFound(_0x1961ed,_0x22306a){return function(_0x237f74){if(!_0x237f74){_0x1961ed[_0x1cea('0x1f')](0x194);}return _0x237f74;};}function handleError(_0x121e4c,_0xa4452a){_0xa4452a=_0xa4452a||0x1f4;return function(_0x1f6e01){logger[_0x1cea('0x2d')](_0x1f6e01[_0x1cea('0x2e')]);if(_0x1f6e01[_0x1cea('0x2f')]){delete _0x1f6e01['name'];}_0x121e4c['status'](_0xa4452a)[_0x1cea('0x30')](_0x1f6e01);};}exports[_0x1cea('0x31')]=function(_0x2a1291,_0x4706fd){var _0x5d3779={},_0x8a00ce={},_0x5860f6={'count':0x0,'rows':[]};var _0x2602d4=_[_0x1cea('0x32')](db[_0x1cea('0x33')][_0x1cea('0x34')],function(_0x1bb7fb){return{'name':_0x1bb7fb[_0x1cea('0x35')],'type':_0x1bb7fb[_0x1cea('0x36')][_0x1cea('0x37')]};});_0x8a00ce[_0x1cea('0x38')]=_[_0x1cea('0x32')](_0x2602d4,'name');_0x8a00ce[_0x1cea('0x39')]=_['keys'](_0x2a1291[_0x1cea('0x39')]);_0x8a00ce[_0x1cea('0x3a')]=_[_0x1cea('0x3b')](_0x8a00ce[_0x1cea('0x38')],_0x8a00ce['query']);_0x5d3779[_0x1cea('0x3c')]=_[_0x1cea('0x3b')](_0x8a00ce[_0x1cea('0x38')],qs['fields'](_0x2a1291[_0x1cea('0x39')][_0x1cea('0x3d')]));_0x5d3779[_0x1cea('0x3c')]=_0x5d3779[_0x1cea('0x3c')]['length']?_0x5d3779[_0x1cea('0x3c')]:_0x8a00ce['model'];if(!_0x2a1291[_0x1cea('0x39')][_0x1cea('0x3e')]('nolimit')){_0x5d3779[_0x1cea('0x23')]=qs[_0x1cea('0x23')](_0x2a1291[_0x1cea('0x39')][_0x1cea('0x23')]);_0x5d3779[_0x1cea('0x22')]=qs[_0x1cea('0x22')](_0x2a1291[_0x1cea('0x39')][_0x1cea('0x22')]);}_0x5d3779['order']=qs[_0x1cea('0x3f')](_0x2a1291['query']['sort']);_0x5d3779[_0x1cea('0x40')]=qs['filters'](_[_0x1cea('0x41')](_0x2a1291[_0x1cea('0x39')],_0x8a00ce[_0x1cea('0x3a')]),_0x2602d4);if(_0x2a1291[_0x1cea('0x39')][_0x1cea('0x42')]){_0x5d3779[_0x1cea('0x40')]=_[_0x1cea('0x43')](_0x5d3779['where'],{'$or':_[_0x1cea('0x32')](_0x2602d4,function(_0x59d9f9){if(_0x59d9f9[_0x1cea('0x36')]!==_0x1cea('0x44')){var _0x748f4={};_0x748f4[_0x59d9f9['name']]={'$like':'%'+_0x2a1291['query']['filter']+'%'};return _0x748f4;}})});}_0x5d3779=_['merge']({},_0x5d3779,_0x2a1291[_0x1cea('0x45')]);var _0x47ea17={'where':_0x5d3779[_0x1cea('0x40')]};return db[_0x1cea('0x33')][_0x1cea('0x46')](_0x47ea17)[_0x1cea('0x29')](function(_0x2f5420){_0x5860f6[_0x1cea('0x46')]=_0x2f5420;if(_0x2a1291[_0x1cea('0x39')][_0x1cea('0x47')]){_0x5d3779[_0x1cea('0x48')]=[{'all':!![]}];}return db[_0x1cea('0x33')][_0x1cea('0x49')](_0x5d3779);})[_0x1cea('0x29')](function(_0x34b429){_0x5860f6[_0x1cea('0x4a')]=_0x34b429;return _0x5860f6;})[_0x1cea('0x29')](respondWithFilteredResult(_0x4706fd,_0x5d3779))[_0x1cea('0x4b')](handleError(_0x4706fd,null));};exports[_0x1cea('0x4c')]=function(_0x3e1bc9,_0xec7ba2){var _0x40e32d={'raw':![],'where':{'id':_0x3e1bc9[_0x1cea('0x4d')]['id']}},_0x5c2222={};_0x5c2222[_0x1cea('0x38')]=_[_0x1cea('0x4e')](db[_0x1cea('0x33')][_0x1cea('0x34')]);_0x5c2222['query']=_[_0x1cea('0x4e')](_0x3e1bc9[_0x1cea('0x39')]);_0x5c2222[_0x1cea('0x3a')]=_[_0x1cea('0x3b')](_0x5c2222[_0x1cea('0x38')],_0x5c2222['query']);_0x40e32d['attributes']=_[_0x1cea('0x3b')](_0x5c2222[_0x1cea('0x38')],qs['fields'](_0x3e1bc9['query'][_0x1cea('0x3d')]));_0x40e32d[_0x1cea('0x3c')]=_0x40e32d['attributes'][_0x1cea('0x4f')]?_0x40e32d['attributes']:_0x5c2222[_0x1cea('0x38')];if(_0x3e1bc9[_0x1cea('0x39')][_0x1cea('0x47')]){_0x40e32d[_0x1cea('0x48')]=[{'all':!![]}];}_0x40e32d=_[_0x1cea('0x43')]({},_0x40e32d,_0x3e1bc9[_0x1cea('0x45')]);return db['CmList'][_0x1cea('0x50')](_0x40e32d)[_0x1cea('0x29')](handleEntityNotFound(_0xec7ba2,null))[_0x1cea('0x29')](respondWithResult(_0xec7ba2,null))[_0x1cea('0x4b')](handleError(_0xec7ba2,null));};exports['create']=function(_0x5cc0f7,_0x3a6989){return db['CmList'][_0x1cea('0x51')](_0x5cc0f7['body'],{})[_0x1cea('0x29')](function(_0x31a4fc){var _0x4e40b1=_0x5cc0f7[_0x1cea('0x52')][_0x1cea('0x2b')]({'plain':!![]});if(!_0x4e40b1)throw new Error(_0x1cea('0x53'));if(_0x4e40b1[_0x1cea('0x54')]===_0x1cea('0x52')){var _0x2308df=_0x31a4fc['get']({'plain':!![]});var _0x2aa500='Lists';return db[_0x1cea('0x55')][_0x1cea('0x50')]({'where':{'name':_0x2aa500,'userProfileId':_0x4e40b1[_0x1cea('0x56')]},'raw':!![]})[_0x1cea('0x29')](function(_0x1c94d5){if(_0x1c94d5&&_0x1c94d5[_0x1cea('0x57')]===0x0){return db[_0x1cea('0x2c')]['create']({'name':_0x2308df[_0x1cea('0x2f')],'resourceId':_0x2308df['id'],'type':_0x1c94d5[_0x1cea('0x2f')],'sectionId':_0x1c94d5['id']},{})[_0x1cea('0x29')](function(){return _0x31a4fc;});}else{return _0x31a4fc;}})[_0x1cea('0x4b')](function(_0x36d050){logger[_0x1cea('0x2d')](_0x1cea('0x58'),_0x36d050);throw _0x36d050;});}return _0x31a4fc;})[_0x1cea('0x29')](respondWithResult(_0x3a6989,0xc9))['catch'](handleError(_0x3a6989,null));};exports[_0x1cea('0x28')]=function(_0x3443ce,_0x28a167){if(_0x3443ce['body']['id']){delete _0x3443ce[_0x1cea('0x59')]['id'];}return db[_0x1cea('0x33')][_0x1cea('0x50')]({'where':{'id':_0x3443ce['params']['id']}})['then'](handleEntityNotFound(_0x28a167,null))[_0x1cea('0x29')](saveUpdates(_0x3443ce[_0x1cea('0x59')],null))['then'](respondWithResult(_0x28a167,null))[_0x1cea('0x4b')](handleError(_0x28a167,null));};exports['destroy']=function(_0x5ce246,_0x1e8eb4){return db['CmList'][_0x1cea('0x50')]({'where':{'id':_0x5ce246['params']['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x1e8eb4,null))[_0x1cea('0x29')](removeEntity(_0x1e8eb4,null))['catch'](handleError(_0x1e8eb4,null));};exports['describe']=function(_0x37f31a,_0x41f7ba){return db[_0x1cea('0x33')][_0x1cea('0x5a')]()[_0x1cea('0x29')](respondWithResult(_0x41f7ba,null))['catch'](handleError(_0x41f7ba,null));};exports[_0x1cea('0x5b')]=function(_0x4fa3db,_0x13fdf6,_0xdab23d){if(_0x4fa3db[_0x1cea('0x59')]['id']){delete _0x4fa3db[_0x1cea('0x59')]['id'];}return db['CmList'][_0x1cea('0x50')]({'where':{'id':_0x4fa3db['params']['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x13fdf6,null))[_0x1cea('0x29')](function(_0xb70186){if(_0xb70186){_0x4fa3db[_0x1cea('0x59')]['ListId']=_0xb70186['id'];return db[_0x1cea('0x5c')][_0x1cea('0x51')](_0x4fa3db[_0x1cea('0x59')]);}})['then'](respondWithResult(_0x13fdf6,null))[_0x1cea('0x4b')](handleError(_0x13fdf6,null));};exports[_0x1cea('0x5d')]=function(_0x36ff24,_0x5d7939,_0x1ae644){var _0x3cfa2f={'raw':![],'where':{}};var _0x129bcd={};var _0x38f7da={'count':0x0,'rows':[]};return db[_0x1cea('0x33')][_0x1cea('0x5e')]({'where':{'id':_0x36ff24[_0x1cea('0x4d')]['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x5d7939,null))[_0x1cea('0x29')](function(_0x24b82c){if(_0x24b82c){_0x129bcd[_0x1cea('0x38')]=_[_0x1cea('0x4e')](db[_0x1cea('0x5c')][_0x1cea('0x34')]);_0x129bcd[_0x1cea('0x39')]=_[_0x1cea('0x4e')](_0x36ff24[_0x1cea('0x39')]);_0x129bcd['filters']=_[_0x1cea('0x3b')](_0x129bcd[_0x1cea('0x38')],_0x129bcd[_0x1cea('0x39')]);_0x3cfa2f[_0x1cea('0x3c')]=_['intersection'](_0x129bcd[_0x1cea('0x38')],qs['fields'](_0x36ff24[_0x1cea('0x39')][_0x1cea('0x3d')]));_0x3cfa2f[_0x1cea('0x3c')]=_0x3cfa2f[_0x1cea('0x3c')][_0x1cea('0x4f')]?_0x3cfa2f['attributes']:_0x129bcd['model'];if(!_0x36ff24[_0x1cea('0x39')][_0x1cea('0x3e')](_0x1cea('0x5f'))){_0x3cfa2f['limit']=qs[_0x1cea('0x23')](_0x36ff24[_0x1cea('0x39')][_0x1cea('0x23')]);_0x3cfa2f[_0x1cea('0x22')]=qs[_0x1cea('0x22')](_0x36ff24[_0x1cea('0x39')][_0x1cea('0x22')]);}_0x3cfa2f['order']=qs[_0x1cea('0x3f')](_0x36ff24[_0x1cea('0x39')][_0x1cea('0x3f')]);_0x3cfa2f[_0x1cea('0x40')]=qs[_0x1cea('0x3a')](_[_0x1cea('0x41')](_0x36ff24[_0x1cea('0x39')],_0x129bcd[_0x1cea('0x3a')]));_0x3cfa2f[_0x1cea('0x40')][_0x1cea('0x60')]=_0x24b82c['id'];if(_0x36ff24[_0x1cea('0x39')][_0x1cea('0x42')]){_0x3cfa2f[_0x1cea('0x40')]=_[_0x1cea('0x43')](_0x3cfa2f['where'],{'$or':_[_0x1cea('0x32')](_0x3cfa2f[_0x1cea('0x3c')],function(_0x2ffacf){var _0x3648e7={};_0x3648e7[_0x2ffacf]={'$like':'%'+_0x36ff24[_0x1cea('0x39')][_0x1cea('0x42')]+'%'};return _0x3648e7;})});}_0x3cfa2f=_[_0x1cea('0x43')]({},_0x3cfa2f,_0x36ff24[_0x1cea('0x45')]);return db[_0x1cea('0x5c')][_0x1cea('0x46')]({'where':_0x3cfa2f[_0x1cea('0x40')]})['then'](function(_0x331808){_0x38f7da['count']=_0x331808;if(_0x36ff24['query'][_0x1cea('0x47')]){_0x3cfa2f[_0x1cea('0x48')]=[{'all':!![]}];}return db[_0x1cea('0x5c')]['findAll'](_0x3cfa2f);})[_0x1cea('0x29')](function(_0x47bd0c){_0x38f7da[_0x1cea('0x4a')]=_0x47bd0c;return _0x38f7da;});}})[_0x1cea('0x29')](respondWithFilteredResult(_0x5d7939,_0x3cfa2f))[_0x1cea('0x4b')](handleError(_0x5d7939,null));};exports[_0x1cea('0x61')]=function(_0x16622f,_0x34ec24,_0x1dfe65){return db[_0x1cea('0x33')][_0x1cea('0x50')]({'where':{'id':_0x16622f['params']['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x34ec24,null))[_0x1cea('0x29')](function(_0x190a64){if(_0x190a64){return _0x190a64[_0x1cea('0x61')](_0x16622f['query']['ids']);}})['then'](respondWithStatusCode(_0x34ec24,null))['catch'](handleError(_0x34ec24,null));};exports['addContacts']=function(_0x480e7b,_0x3ce30b,_0x400e91){return db[_0x1cea('0x33')][_0x1cea('0x50')]({'where':{'id':_0x480e7b[_0x1cea('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3ce30b,null))[_0x1cea('0x29')](function(_0x575e4a){if(_0x575e4a){var _0x1f64d0=[];var _0x24fe71={'success':[],'errors':[]};return db[_0x1cea('0x62')][_0x1cea('0x5a')]()[_0x1cea('0x29')](function(_0x3fa1e3){if(_0x480e7b[_0x1cea('0x59')][_0x1cea('0x63')]&&_[_0x1cea('0x64')](_0x480e7b[_0x1cea('0x59')][_0x1cea('0x63')])){if(_0x480e7b['body'][_0x1cea('0x63')]['length']){_0x480e7b[_0x1cea('0x59')][_0x1cea('0x63')]=_0x480e7b[_0x1cea('0x59')][_0x1cea('0x63')]['join'](';')+';';}else{_0x480e7b[_0x1cea('0x59')][_0x1cea('0x63')]=null;}}else{_0x480e7b[_0x1cea('0x59')][_0x1cea('0x63')]=null;}if(_0x480e7b[_0x1cea('0x59')]&&_[_0x1cea('0x64')](_0x480e7b['body'])){for(var _0x2c87aa=0x0;_0x2c87aa<_0x480e7b['body'][_0x1cea('0x4f')];_0x2c87aa+=0x1){_0x480e7b[_0x1cea('0x59')][_0x2c87aa][_0x1cea('0x60')]=_0x480e7b[_0x1cea('0x4d')]['id'];_0x1f64d0[_0x1cea('0x65')](_0x480e7b[_0x1cea('0x59')][_0x2c87aa]);}return BPromise[_0x1cea('0x66')](_0x1f64d0,function(_0x379597){return db['CmContact']['create'](_['omit'](_0x379597,[_0x1cea('0x67'),'id'])||{},{'fields':_[_0x1cea('0x4e')](_0x3fa1e3),'raw':!![]})[_0x1cea('0x29')](function(_0x4a7799){_0x24fe71[_0x1cea('0x68')]['push'](_0x4a7799['dataValues']);})[_0x1cea('0x4b')](function(_0x3b23f0){_0x24fe71[_0x1cea('0x69')][_0x1cea('0x65')]({'data':_0x379597,'error':_0x3b23f0['message']});});})[_0x1cea('0x29')](function(_0x459851){return _0x24fe71;})['catch'](function(_0x3b9730){return _0x3b9730;});}else{_0x3ce30b[_0x1cea('0x20')](0x190)[_0x1cea('0x26')]({'message':_0x1cea('0x6a')});}});}})[_0x1cea('0x29')](respondWithResult(_0x3ce30b,null))['catch'](handleError(_0x3ce30b,null));};exports[_0x1cea('0x6b')]=function(_0x2b8782,_0x391c73,_0x4625b8){var _0x2819ce;return db[_0x1cea('0x33')]['find']({'where':{'id':_0x2b8782[_0x1cea('0x4d')]['id']},'include':[{'model':db[_0x1cea('0x6c')],'as':_0x1cea('0x6d')}]})[_0x1cea('0x29')](handleEntityNotFound(_0x391c73,null))[_0x1cea('0x29')](function(_0x18d65b){if(_0x18d65b){_0x2819ce=_0x18d65b;return db[_0x1cea('0x62')][_0x1cea('0x34')];}})[_0x1cea('0x29')](function(_0xd3f8de){if(_0xd3f8de){var _0x398343={};var _0x39042b={};_0x39042b[_0x1cea('0x38')]=_['concat'](_['keys'](_0xd3f8de),_[_0x1cea('0x32')](_0x2819ce[_0x1cea('0x6d')],function(_0xa559f4){return util[_0x1cea('0x6e')](_0x1cea('0x6f'),_0xa559f4['id']);}));_0x39042b[_0x1cea('0x39')]=_[_0x1cea('0x4e')](_0x2b8782[_0x1cea('0x39')]);_0x39042b[_0x1cea('0x3a')]=_[_0x1cea('0x3b')](_0x39042b[_0x1cea('0x38')],_0x39042b[_0x1cea('0x39')]);_0x398343['attributes']=_[_0x1cea('0x3b')](_0x39042b[_0x1cea('0x38')],qs[_0x1cea('0x3d')](_0x2b8782[_0x1cea('0x39')][_0x1cea('0x3d')]));_0x398343[_0x1cea('0x3c')]=_0x398343[_0x1cea('0x3c')]['length']?_0x398343[_0x1cea('0x3c')]:_0x39042b[_0x1cea('0x38')];if(!_0x2b8782[_0x1cea('0x39')][_0x1cea('0x3e')](_0x1cea('0x5f'))){_0x398343[_0x1cea('0x23')]=qs[_0x1cea('0x23')](_0x2b8782['query'][_0x1cea('0x23')]);_0x398343[_0x1cea('0x22')]=qs[_0x1cea('0x22')](_0x2b8782['query'][_0x1cea('0x22')]);}_0x398343[_0x1cea('0x70')]=qs[_0x1cea('0x3f')](_0x2b8782['query'][_0x1cea('0x3f')]);_0x398343[_0x1cea('0x40')]=qs[_0x1cea('0x3a')](_['pick'](_0x2b8782['query'],_0x39042b[_0x1cea('0x3a')]));_0x398343[_0x1cea('0x71')]=!![];if(_0x2b8782['query'][_0x1cea('0x42')]){_0x398343[_0x1cea('0x40')]=_[_0x1cea('0x43')](_0x398343[_0x1cea('0x40')],{'$or':_[_0x1cea('0x32')](_0x398343[_0x1cea('0x3c')],function(_0x3a5b2c){var _0x539a7e={};_0x539a7e[_0x3a5b2c]={'$like':'%'+_0x2b8782[_0x1cea('0x39')][_0x1cea('0x42')]+'%'};return _0x539a7e;})});}_0x398343=_[_0x1cea('0x43')]({},_0x398343,_0x2b8782[_0x1cea('0x45')]);return _0x2819ce['getContacts'](_0x398343);}})['then'](respondWithResult(_0x391c73,null))[_0x1cea('0x4b')](handleError(_0x391c73,null));};exports[_0x1cea('0x72')]=function(_0x2c60e0,_0xc9ad81,_0x4bfc22){var _0x31a5ad;var _0x3ea61f;var _0x4152ea;var _0x8f8281=_0x2c60e0[_0x1cea('0x4d')]['id'];csv_results=[];return db[_0x1cea('0x73')]['findAll']({'attributes':['id',_0x1cea('0x2f')],'raw':!![],'order':[_0x1cea('0x74')]})[_0x1cea('0x29')](function(_0x5a64d2){_0x31a5ad=_0x5a64d2;var _0x1cf5d5=_[_0x1cea('0x4e')](db[_0x1cea('0x62')][_0x1cea('0x34')]);return db[_0x1cea('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0x1cea('0x75')]})[_0x1cea('0x29')](function(_0x53b909){_0x3ea61f=_0x53b909;var _0x2a23e2=squel['select']()['fields'](_0x1cf5d5)[_0x1cea('0x76')]('cm_contacts','c')['where'](_0x1cea('0x77'),_0x8f8281)[_0x1cea('0x40')](_0x1cea('0x78'))[_0x1cea('0x79')]();for(var _0x27f6b1=0x0;_0x27f6b1<_0x3ea61f['length'];_0x27f6b1++){_0x2a23e2[_0x1cea('0x7a')](_0x1cea('0x7b')+_0x3ea61f[_0x27f6b1]['id'],_0x1cea('0x7c')+_0x3ea61f[_0x27f6b1][_0x1cea('0x75')]);}for(var _0x27f6b1=0x0;_0x27f6b1<_0x31a5ad[_0x1cea('0x4f')];_0x27f6b1++){_0x2a23e2[_0x1cea('0x7a')](squel[_0x1cea('0x7d')]()[_0x1cea('0x7a')](_0x1cea('0x7e'))[_0x1cea('0x76')](_0x1cea('0x7f'))['where'](_0x1cea('0x80'),_0x31a5ad[_0x27f6b1]['id'])[_0x1cea('0x40')]('CmContactId\x20=\x20c.id'),_0x1cea('0x81')+_0x31a5ad[_0x27f6b1][_0x1cea('0x2f')]);_0x2a23e2[_0x1cea('0x7a')](squel['select']()['field'](_0x1cea('0x82'))[_0x1cea('0x76')]('cm_contact_has_items')[_0x1cea('0x40')](_0x1cea('0x80'),_0x31a5ad[_0x27f6b1]['id'])[_0x1cea('0x40')](_0x1cea('0x83')),_0x1cea('0x84')+_0x31a5ad[_0x27f6b1][_0x1cea('0x2f')]);}var _0x24a80f=[];_0x24a80f['push'](_0x2a23e2[_0x1cea('0x85')]());BPromise['each'](_0x24a80f,handleQuery)[_0x1cea('0x29')](function(_0x4b3f39){handleQuery(_0x2a23e2[_0x1cea('0x85')]());var _0x41da07=csv_results[0x0];if(!_['isEmpty'](_0x41da07)){var _0x5c49ec=toCsv(_0x41da07);var _0x4b16b7=Date[_0x1cea('0x86')]();fs[_0x1cea('0x87')](util[_0x1cea('0x6e')]('/tmp/list_%d_%s.csv',_0x8f8281,_0x4b16b7),_0x5c49ec);_0xc9ad81[_0x1cea('0x88')](_0x1cea('0x89'),'attachment;\x20filename='+util['format'](_0x1cea('0x8a'),_0x8f8281,_0x4b16b7));_0xc9ad81['setHeader'](_0x1cea('0x8b'),'text/csv');return _0xc9ad81[_0x1cea('0x8c')](util[_0x1cea('0x6e')](_0x1cea('0x8d'),_0x8f8281,_0x4b16b7));}else{return _0xc9ad81['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x1e4de2,_0x41e584,_0x99dfb0){var _0x3e35a4;delete _0x1e4de2[_0x1cea('0x59')]['id'];return db['CmList'][_0x1cea('0x5e')]({'where':{'id':_0x1e4de2[_0x1cea('0x4d')]['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x41e584,null))[_0x1cea('0x29')](function(_0x1d87ce){if(_0x1d87ce){return db[_0x1cea('0x8e')][_0x1cea('0x8f')](function(_0x4e1058){return db[_0x1cea('0x6c')][_0x1cea('0x51')](_0x1e4de2['body'],{'transaction':_0x4e1058})[_0x1cea('0x29')](function(_0x175eec){_0x3e35a4=_0x175eec;return _0x1d87ce[_0x1cea('0x90')](_0x175eec,{'transaction':_0x4e1058});})[_0x1cea('0x29')](function(){var _0x5c202c={'type':db['Sequelize'][_0x1cea('0x91')],'transaction':_0x4e1058};switch(_0x1e4de2[_0x1cea('0x59')][_0x1cea('0x36')]){case'text':_0x5c202c[_0x1cea('0x36')]=db['Sequelize'][_0x1cea('0x91')];break;case _0x1cea('0x92'):_0x5c202c[_0x1cea('0x36')]=db[_0x1cea('0x93')]['INTEGER'];break;case'switch':_0x5c202c['type']=db[_0x1cea('0x93')][_0x1cea('0x94')];_0x5c202c[_0x1cea('0x95')]=![];break;default:}return db[_0x1cea('0x8e')]['queryInterface'][_0x1cea('0x96')]('cm_contacts',util[_0x1cea('0x6e')](_0x1cea('0x97'),_0x3e35a4['id']),_0x5c202c);})[_0x1cea('0x29')](function(){return _0x3e35a4;});});}})[_0x1cea('0x29')](respondWithResult(_0x41e584,null))['catch'](handleError(_0x41e584,null));};exports[_0x1cea('0x98')]=function(_0x404b52,_0x24626b,_0x4cad4){var _0x2a9699={};var _0x362d03={};var _0x2e8fc8;var _0x4b2095;return db[_0x1cea('0x33')][_0x1cea('0x5e')]({'where':{'id':_0x404b52['params']['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x24626b,null))[_0x1cea('0x29')](function(_0x2ea1e8){if(_0x2ea1e8){_0x2e8fc8=_0x2ea1e8;_0x362d03[_0x1cea('0x38')]=_[_0x1cea('0x4e')](db[_0x1cea('0x6c')][_0x1cea('0x34')]);_0x362d03[_0x1cea('0x39')]=_[_0x1cea('0x4e')](_0x404b52[_0x1cea('0x39')]);_0x362d03['filters']=_[_0x1cea('0x3b')](_0x362d03[_0x1cea('0x38')],_0x362d03[_0x1cea('0x39')]);_0x2a9699['attributes']=_[_0x1cea('0x3b')](_0x362d03[_0x1cea('0x38')],qs['fields'](_0x404b52[_0x1cea('0x39')][_0x1cea('0x3d')]));_0x2a9699['attributes']=_0x2a9699['attributes'][_0x1cea('0x4f')]?_0x2a9699['attributes']:_0x362d03[_0x1cea('0x38')];_0x2a9699[_0x1cea('0x70')]=qs[_0x1cea('0x3f')](_0x404b52[_0x1cea('0x39')][_0x1cea('0x3f')]);_0x2a9699[_0x1cea('0x40')]=qs[_0x1cea('0x3a')](_[_0x1cea('0x41')](_0x404b52['query'],_0x362d03[_0x1cea('0x3a')]));_0x2a9699[_0x1cea('0x40')]=_[_0x1cea('0x43')](_0x2a9699[_0x1cea('0x40')],{'$or':[{'ListId':_0x2ea1e8['id']},{'ListId':null}]});if(_0x404b52[_0x1cea('0x39')][_0x1cea('0x42')]){_0x2a9699[_0x1cea('0x40')]=_[_0x1cea('0x43')](_0x2a9699[_0x1cea('0x40')],{'$or':_[_0x1cea('0x32')](_0x2a9699[_0x1cea('0x3c')],function(_0x1e3d5e){var _0x5e76b9={};_0x5e76b9[_0x1e3d5e]={'$like':'%'+_0x404b52[_0x1cea('0x39')][_0x1cea('0x42')]+'%'};return _0x5e76b9;})});}_0x2a9699=_[_0x1cea('0x43')]({},_0x2a9699,_0x404b52[_0x1cea('0x45')]);return db['CmCustomField'][_0x1cea('0x99')](_0x2a9699);}})['then'](respondWithResult(_0x24626b,null))['catch'](handleError(_0x24626b,null));};exports[_0x1cea('0x9a')]=function(_0xd8bd61,_0x1d623f){return db[_0x1cea('0x6c')][_0x1cea('0x99')]({'where':{'ListId':null}})[_0x1cea('0x29')](handleEntityNotFound(_0x1d623f,null))['then'](function(_0x479494){return _0x479494;})['then'](respondWithResult(_0x1d623f,null))[_0x1cea('0x4b')](handleError(_0x1d623f,null));};exports['addAgents']=function(_0x2a89d1,_0x568ca5,_0xbb6914){return db[_0x1cea('0x33')][_0x1cea('0x50')]({'where':{'id':_0x2a89d1[_0x1cea('0x4d')]['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x568ca5,null))[_0x1cea('0x29')](function(_0x44a9ef){if(_0x44a9ef){return _0x44a9ef[_0x1cea('0x9b')](_0x2a89d1[_0x1cea('0x59')][_0x1cea('0x67')],_[_0x1cea('0x9c')](_0x2a89d1[_0x1cea('0x59')],[_0x1cea('0x67'),'id'])||{})[_0x1cea('0x9d')](function(_0x35b6ce){for(var _0x3af33a=0x0;_0x3af33a<_0x2a89d1[_0x1cea('0x59')][_0x1cea('0x67')][_0x1cea('0x4f')];_0x3af33a+=0x1){socket[_0x1cea('0x9e')](_0x1cea('0x9f'),{'UserId':Number(_0x2a89d1[_0x1cea('0x59')]['ids'][_0x3af33a]),'CmListId':Number(_0x2a89d1['params']['id'])});}return _0x35b6ce;});}})[_0x1cea('0x29')](respondWithResult(_0x568ca5,null))['catch'](handleError(_0x568ca5,null));};exports[_0x1cea('0xa0')]=function(_0x24749d,_0x46badc,_0x2302d5){return db['CmList'][_0x1cea('0x50')]({'where':{'id':_0x24749d[_0x1cea('0x4d')]['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x46badc,null))['then'](function(_0x588e36){if(_0x588e36){return _0x588e36['removeAgents'](_0x24749d[_0x1cea('0x39')][_0x1cea('0x67')])[_0x1cea('0x29')](function(){if(_['isArray'](_0x24749d['query']['ids'])){for(var _0x40bac1=0x0;_0x40bac1<_0x24749d[_0x1cea('0x39')][_0x1cea('0x67')][_0x1cea('0x4f')];_0x40bac1+=0x1){socket[_0x1cea('0x9e')](_0x1cea('0xa1'),{'UserId':Number(_0x24749d[_0x1cea('0x39')][_0x1cea('0x67')][_0x40bac1]),'CmListId':Number(_0x24749d['params']['id'])});}}else{socket[_0x1cea('0x9e')](_0x1cea('0xa1'),{'UserId':Number(_0x24749d['query'][_0x1cea('0x67')]),'CmListId':Number(_0x24749d['params']['id'])});}});}})[_0x1cea('0x29')](respondWithStatusCode(_0x46badc,null))[_0x1cea('0x4b')](handleError(_0x46badc,null));};exports['getAgents']=function(_0x3797ca,_0x15e33c,_0x303711){var _0x2cb78a={};var _0x32632e={};var _0x46a38b;var _0x2e1b78;return db['CmList'][_0x1cea('0x5e')]({'where':{'id':_0x3797ca['params']['id']}})[_0x1cea('0x29')](handleEntityNotFound(_0x15e33c,null))[_0x1cea('0x29')](function(_0x3af00a){if(_0x3af00a){_0x46a38b=_0x3af00a;_0x32632e[_0x1cea('0x38')]=_[_0x1cea('0x4e')](db[_0x1cea('0xa2')]['rawAttributes']);_0x32632e['query']=_['keys'](_0x3797ca['query']);_0x32632e[_0x1cea('0x3a')]=_[_0x1cea('0x3b')](_0x32632e['model'],_0x32632e['query']);_0x2cb78a[_0x1cea('0x3c')]=_[_0x1cea('0x3b')](_0x32632e[_0x1cea('0x38')],qs[_0x1cea('0x3d')](_0x3797ca[_0x1cea('0x39')][_0x1cea('0x3d')]));_0x2cb78a[_0x1cea('0x3c')]=_0x2cb78a['attributes'][_0x1cea('0x4f')]?_0x2cb78a['attributes']:_0x32632e[_0x1cea('0x38')];_0x2cb78a[_0x1cea('0x70')]=qs[_0x1cea('0x3f')](_0x3797ca[_0x1cea('0x39')]['sort']);_0x2cb78a['where']=qs[_0x1cea('0x3a')](_[_0x1cea('0x41')](_0x3797ca[_0x1cea('0x39')],_0x32632e[_0x1cea('0x3a')]));if(_0x3797ca[_0x1cea('0x39')]['filter']){_0x2cb78a[_0x1cea('0x40')]=_[_0x1cea('0x43')](_0x2cb78a['where'],{'$or':_[_0x1cea('0x32')](_0x2cb78a[_0x1cea('0x3c')],function(_0x545847){var _0xe740eb={};_0xe740eb[_0x545847]={'$like':'%'+_0x3797ca[_0x1cea('0x39')]['filter']+'%'};return _0xe740eb;})});}_0x2cb78a=_[_0x1cea('0x43')]({},_0x2cb78a,_0x3797ca['options']);return _0x46a38b[_0x1cea('0xa3')](_0x2cb78a);}})[_0x1cea('0x29')](function(_0x90e34f){if(_0x90e34f){_0x2e1b78=_0x90e34f[_0x1cea('0x4f')];if(!_0x3797ca[_0x1cea('0x39')]['hasOwnProperty'](_0x1cea('0x5f'))){_0x2cb78a[_0x1cea('0x23')]=qs[_0x1cea('0x23')](_0x3797ca[_0x1cea('0x39')][_0x1cea('0x23')]);_0x2cb78a[_0x1cea('0x22')]=qs[_0x1cea('0x22')](_0x3797ca[_0x1cea('0x39')]['offset']);}return _0x46a38b[_0x1cea('0xa3')](_0x2cb78a);}})[_0x1cea('0x29')](function(_0x20acaf){if(_0x20acaf){return _0x20acaf?{'count':_0x2e1b78,'rows':_0x20acaf}:null;}})[_0x1cea('0x29')](respondWithResult(_0x15e33c,null))['catch'](handleError(_0x15e33c,null));};function handleQuery(_0x5d3ae9){logger[_0x1cea('0xa4')](_0x5d3ae9);return db[_0x1cea('0x8e')][_0x1cea('0x39')](_0x5d3ae9)[_0x1cea('0x9d')](function(_0x82f381){csv_results[_0x1cea('0x65')](_0x82f381);})['catch'](function(_0x37ba97){logger[_0x1cea('0x2d')](_0x37ba97[_0x1cea('0xa5')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 29087a7..b793033 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x39abaf,_0x264258){var _0x2f7166=function(_0x1bc01e){while(--_0x1bc01e){_0x39abaf['push'](_0x39abaf['shift']());}};_0x2f7166(++_0x264258);}(_0x814b,0x1a2));var _0xb814=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x814b[_0x3cb86b];return _0x3c10a0;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x2246f9,_0x2a4613){var _0x5b8fa6=function(_0x2da100){while(--_0x2da100){_0x2246f9['push'](_0x2246f9['shift']());}};_0x5b8fa6(++_0x2a4613);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index f3dded8..0de1c41 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 _0xfd28=['rimraf','./cmList.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x13f6dc,_0x323f62){var _0x1ad525=function(_0x473f36){while(--_0x473f36){_0x13f6dc['push'](_0x13f6dc['shift']());}};_0x1ad525(++_0x323f62);}(_0xfd28,0x148));var _0x8fd2=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xfd28[_0x11c573];return _0x6b72de;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['./cmList.attributes','exports','define','cm_lists','lodash','bluebird','rimraf','../../config/environment'];(function(_0xe31165,_0x23cebf){var _0x3cd681=function(_0x5cfe54){while(--_0x5cfe54){_0xe31165['push'](_0xe31165['shift']());}};_0x3cd681(++_0x23cebf);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58356c,_0x3f2168){_0x58356c=_0x58356c-0x0;var _0x549a81=_0xf4eb[_0x58356c];return _0x549a81;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('CmList',attributes,{'tableName':_0xbf4e('0x7'),'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 65afadc..4b4631e 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 _0x0364=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x183bbd,_0x4dfd13){var _0x3773a9=function(_0x48b9bf){while(--_0x48b9bf){_0x183bbd['push'](_0x183bbd['shift']());}};_0x3773a9(++_0x4dfd13);}(_0x0364,0x1bc));var _0x4036=function(_0x2fe8c6,_0x44591c){_0x2fe8c6=_0x2fe8c6-0x0;var _0x16c16d=_0x0364[_0x2fe8c6];return _0x16c16d;};'use strict';var _=require(_0x4036('0x0'));var util=require(_0x4036('0x1'));var moment=require(_0x4036('0x2'));var BPromise=require(_0x4036('0x3'));var rs=require(_0x4036('0x4'));var fs=require('fs');var Redis=require(_0x4036('0x5'));var db=require(_0x4036('0x6'))['db'];var utils=require(_0x4036('0x7'));var logger=require(_0x4036('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4036('0x9'));var client=jayson[_0x4036('0xa')][_0x4036('0xb')]({'port':0x232a});config[_0x4036('0xc')]=_[_0x4036('0xd')](config['redis'],{'host':_0x4036('0xe'),'port':0x18eb});var socket=require(_0x4036('0xf'))(new Redis(config['redis']));require(_0x4036('0x10'))[_0x4036('0x11')](socket);function respondWithRpcPromise(_0x4125ab,_0x1e6dd8,_0x4f924d){return new BPromise(function(_0x3bd39e,_0x15e011){return client['request'](_0x4125ab,_0x4f924d)['then'](function(_0x1c1c12){logger[_0x4036('0x12')](_0x4036('0x13'),_0x1e6dd8,_0x4036('0x14'));logger[_0x4036('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x1e6dd8,'request\x20sent',JSON[_0x4036('0x16')](_0x1c1c12));if(_0x1c1c12['error']){if(_0x1c1c12[_0x4036('0x17')][_0x4036('0x18')]===0x1f4){logger['error'](_0x4036('0x13'),_0x1e6dd8,_0x1c1c12[_0x4036('0x17')]['message']);return _0x15e011(_0x1c1c12[_0x4036('0x17')][_0x4036('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x1e6dd8,_0x1c1c12['error'][_0x4036('0x19')]);return _0x3bd39e(_0x1c1c12[_0x4036('0x17')]['message']);}else{logger[_0x4036('0x12')](_0x4036('0x13'),_0x1e6dd8,_0x4036('0x14'));_0x3bd39e(_0x1c1c12[_0x4036('0x1a')]['message']);}})[_0x4036('0x1b')](function(_0x3b63a0){logger[_0x4036('0x17')](_0x4036('0x13'),_0x1e6dd8,_0x3b63a0);_0x15e011(_0x3b63a0);});});} \ No newline at end of file +var _0xcc61=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x514dcd,_0x5e9e5d){var _0x5cedab=function(_0x307419){while(--_0x307419){_0x514dcd['push'](_0x514dcd['shift']());}};_0x5cedab(++_0x5e9e5d);}(_0xcc61,0x1aa));var _0x1cc6=function(_0x124202,_0x4fef7d){_0x124202=_0x124202-0x0;var _0x4805ee=_0xcc61[_0x124202];return _0x4805ee;};'use strict';var _=require(_0x1cc6('0x0'));var util=require(_0x1cc6('0x1'));var moment=require(_0x1cc6('0x2'));var BPromise=require(_0x1cc6('0x3'));var rs=require(_0x1cc6('0x4'));var fs=require('fs');var Redis=require(_0x1cc6('0x5'));var db=require(_0x1cc6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cc6('0x7'))(_0x1cc6('0x8'));var config=require(_0x1cc6('0x9'));var jayson=require(_0x1cc6('0xa'));var client=jayson['client'][_0x1cc6('0xb')]({'port':0x232a});config[_0x1cc6('0xc')]=_[_0x1cc6('0xd')](config[_0x1cc6('0xc')],{'host':_0x1cc6('0xe'),'port':0x18eb});var socket=require(_0x1cc6('0xf'))(new Redis(config[_0x1cc6('0xc')]));require(_0x1cc6('0x10'))[_0x1cc6('0x11')](socket);function respondWithRpcPromise(_0x3ef3f2,_0x514450,_0x7f2d31){return new BPromise(function(_0x31f8a7,_0x1fe72e){return client['request'](_0x3ef3f2,_0x7f2d31)[_0x1cc6('0x12')](function(_0x392414){logger['info'](_0x1cc6('0x13'),_0x514450,'request\x20sent');logger['debug'](_0x1cc6('0x14'),_0x514450,_0x1cc6('0x15'),JSON[_0x1cc6('0x16')](_0x392414));if(_0x392414['error']){if(_0x392414[_0x1cc6('0x17')][_0x1cc6('0x18')]===0x1f4){logger[_0x1cc6('0x17')](_0x1cc6('0x13'),_0x514450,_0x392414[_0x1cc6('0x17')]['message']);return _0x1fe72e(_0x392414['error']['message']);}logger['error'](_0x1cc6('0x13'),_0x514450,_0x392414[_0x1cc6('0x17')][_0x1cc6('0x19')]);return _0x31f8a7(_0x392414['error'][_0x1cc6('0x19')]);}else{logger[_0x1cc6('0x1a')](_0x1cc6('0x13'),_0x514450,_0x1cc6('0x15'));_0x31f8a7(_0x392414[_0x1cc6('0x1b')][_0x1cc6('0x19')]);}})['catch'](function(_0x162fb2){logger[_0x1cc6('0x17')]('CmList,\x20%s,\x20%s',_0x514450,_0x162fb2);_0x1fe72e(_0x162fb2);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index ad6c0b7..4ea7247 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 _0xbd83=['removeListener','register','cmList:','./cmList.events','save','update'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xbd83,0x14d));var _0x3bd8=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xbd83[_0x21f9c2];return _0x3da17f;};'use strict';var CmListEvents=require(_0x3bd8('0x0'));var events=[_0x3bd8('0x1'),'remove',_0x3bd8('0x2')];function createListener(_0x535911,_0x13cba5){return function(_0x3c25ad){_0x13cba5['emit'](_0x535911,_0x3c25ad);};}function removeListener(_0x467c0d,_0x37975c){return function(){CmListEvents[_0x3bd8('0x3')](_0x467c0d,_0x37975c);};}exports[_0x3bd8('0x4')]=function(_0x54259b){for(var _0x242563=0x0,_0x58c6d5=events['length'];_0x242563<_0x58c6d5;_0x242563++){var _0x206fa9=events[_0x242563];var _0x535fec=createListener(_0x3bd8('0x5')+_0x206fa9,_0x54259b);CmListEvents['on'](_0x206fa9,_0x535fec);}}; \ No newline at end of file +var _0x2553=['length','cmList:','./cmList.events','save','remove','update','emit','removeListener','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2553,0x89));var _0x3255=function(_0x3f83dc,_0x5c8047){_0x3f83dc=_0x3f83dc-0x0;var _0x3876b8=_0x2553[_0x3f83dc];return _0x3876b8;};'use strict';var CmListEvents=require(_0x3255('0x0'));var events=[_0x3255('0x1'),_0x3255('0x2'),_0x3255('0x3')];function createListener(_0x56bffc,_0x48b9d7){return function(_0x560343){_0x48b9d7[_0x3255('0x4')](_0x56bffc,_0x560343);};}function removeListener(_0x5a0244,_0x171d07){return function(){CmListEvents[_0x3255('0x5')](_0x5a0244,_0x171d07);};}exports[_0x3255('0x6')]=function(_0x428bd3){for(var _0x3a4adc=0x0,_0x4af66e=events[_0x3255('0x7')];_0x3a4adc<_0x4af66e;_0x3a4adc++){var _0x4c21a4=events[_0x3a4adc];var _0x21e408=createListener(_0x3255('0x8')+_0x4c21a4,_0x428bd3);CmListEvents['on'](_0x4c21a4,_0x21e408);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 2dff992..2b8af10 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 _0x2385=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x2385,0x11b));var _0x5238=function(_0x5ac17d,_0x359c3e){_0x5ac17d=_0x5ac17d-0x0;var _0xbc667c=_0x2385[_0x5ac17d];return _0xbc667c;};'use strict';var multer=require('multer');var util=require(_0x5238('0x0'));var path=require(_0x5238('0x1'));var timeout=require(_0x5238('0x2'));var express=require(_0x5238('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5238('0x4'));var interaction=require(_0x5238('0x5'));var config=require(_0x5238('0x6'));var controller=require('./cmList.controller');router[_0x5238('0x7')]('/',auth[_0x5238('0x8')](),controller['index']);router[_0x5238('0x7')](_0x5238('0x9'),auth[_0x5238('0x8')](),controller[_0x5238('0xa')]);router[_0x5238('0x7')]('/global_fields',auth[_0x5238('0x8')](),controller[_0x5238('0xb')]);router[_0x5238('0x7')](_0x5238('0xc'),auth[_0x5238('0x8')](),controller[_0x5238('0xd')]);router[_0x5238('0x7')](_0x5238('0xe'),auth['isAuthenticated'](),controller[_0x5238('0xf')]);router[_0x5238('0x7')](_0x5238('0x10'),auth[_0x5238('0x8')](),controller['getContacts']);router[_0x5238('0x7')](_0x5238('0x11'),auth[_0x5238('0x8')](),controller['getContactsCsv']);router['get'](_0x5238('0x12'),auth[_0x5238('0x8')](),controller[_0x5238('0x13')]);router[_0x5238('0x7')](_0x5238('0x14'),auth[_0x5238('0x8')](),controller[_0x5238('0x15')]);router[_0x5238('0x16')]('/',auth['isAuthenticated'](),controller[_0x5238('0x17')]);router['post'](_0x5238('0xe'),auth[_0x5238('0x8')](),controller[_0x5238('0x18')]);router[_0x5238('0x16')](_0x5238('0x10'),auth[_0x5238('0x8')](),controller['addContacts']);router[_0x5238('0x16')](_0x5238('0x12'),auth[_0x5238('0x8')](),controller['addCustomField']);router['post']('/:id/users',auth[_0x5238('0x8')](),controller[_0x5238('0x19')]);router['put']('/:id',auth[_0x5238('0x8')](),controller[_0x5238('0x1a')]);router[_0x5238('0x1b')](_0x5238('0xc'),auth[_0x5238('0x8')](),controller[_0x5238('0x1c')]);router[_0x5238('0x1b')]('/:id/dispositions',auth[_0x5238('0x8')](),controller[_0x5238('0x1d')]);router[_0x5238('0x1b')](_0x5238('0x14'),auth['isAuthenticated'](),controller[_0x5238('0x1e')]);module[_0x5238('0x1f')]=router; \ No newline at end of file +var _0x94db=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','/:id/contacts','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAgents','exports','multer','path'];(function(_0x129f74,_0x3d64d8){var _0x1cf683=function(_0x232179){while(--_0x232179){_0x129f74['push'](_0x129f74['shift']());}};_0x1cf683(++_0x3d64d8);}(_0x94db,0xd6));var _0xb94d=function(_0x1ec793,_0x2de6ed){_0x1ec793=_0x1ec793-0x0;var _0x1e1c6d=_0x94db[_0x1ec793];return _0x1e1c6d;};'use strict';var multer=require(_0xb94d('0x0'));var util=require('util');var path=require(_0xb94d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb94d('0x2'));var router=express['Router']();var fs_extra=require(_0xb94d('0x3'));var auth=require(_0xb94d('0x4'));var interaction=require(_0xb94d('0x5'));var config=require(_0xb94d('0x6'));var controller=require(_0xb94d('0x7'));router[_0xb94d('0x8')]('/',auth[_0xb94d('0x9')](),controller[_0xb94d('0xa')]);router[_0xb94d('0x8')](_0xb94d('0xb'),auth[_0xb94d('0x9')](),controller[_0xb94d('0xc')]);router[_0xb94d('0x8')](_0xb94d('0xd'),auth[_0xb94d('0x9')](),controller[_0xb94d('0xe')]);router[_0xb94d('0x8')]('/:id',auth[_0xb94d('0x9')](),controller[_0xb94d('0xf')]);router[_0xb94d('0x8')](_0xb94d('0x10'),auth[_0xb94d('0x9')](),controller['getDispositions']);router[_0xb94d('0x8')]('/:id/contacts',auth[_0xb94d('0x9')](),controller[_0xb94d('0x11')]);router[_0xb94d('0x8')](_0xb94d('0x12'),auth['isAuthenticated'](),controller[_0xb94d('0x13')]);router[_0xb94d('0x8')](_0xb94d('0x14'),auth[_0xb94d('0x9')](),controller[_0xb94d('0x15')]);router[_0xb94d('0x8')](_0xb94d('0x16'),auth[_0xb94d('0x9')](),controller[_0xb94d('0x17')]);router[_0xb94d('0x18')]('/',auth[_0xb94d('0x9')](),controller['create']);router[_0xb94d('0x18')](_0xb94d('0x10'),auth[_0xb94d('0x9')](),controller[_0xb94d('0x19')]);router[_0xb94d('0x18')](_0xb94d('0x1a'),auth['isAuthenticated'](),controller['addContacts']);router['post'](_0xb94d('0x14'),auth[_0xb94d('0x9')](),controller['addCustomField']);router[_0xb94d('0x18')]('/:id/users',auth[_0xb94d('0x9')](),controller[_0xb94d('0x1b')]);router[_0xb94d('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xb94d('0x1d')]);router[_0xb94d('0x1e')](_0xb94d('0x1f'),auth[_0xb94d('0x9')](),controller[_0xb94d('0x20')]);router[_0xb94d('0x1e')](_0xb94d('0x10'),auth['isAuthenticated'](),controller[_0xb94d('0x21')]);router[_0xb94d('0x1e')](_0xb94d('0x16'),auth['isAuthenticated'](),controller[_0xb94d('0x22')]);module[_0xb94d('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 97e5d60..3a1685a 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 _0xdd84=['VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x11322c,_0x82a898){var _0x2c296c=function(_0x3cd6c9){while(--_0x3cd6c9){_0x11322c['push'](_0x11322c['shift']());}};_0x2c296c(++_0x82a898);}(_0xdd84,0x162));var _0x4dd8=function(_0x152fc2,_0x1a96ad){_0x152fc2=_0x152fc2-0x0;var _0x1a74df=_0xdd84[_0x152fc2];return _0x1a74df;};'use strict';var Sequelize=require(_0x4dd8('0x0'));module['exports']={'name':{'type':Sequelize[_0x4dd8('0x1')],'get':function(_0x372db1){return this[_0x4dd8('0x2')](_0x4dd8('0x3'));}},'field':{'type':Sequelize[_0x4dd8('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4dd8('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x76de=['getDataValue','STRING','sequelize','VIRTUAL'];(function(_0x5ee54e,_0x2e895f){var _0x2f2c42=function(_0x39b941){while(--_0x39b941){_0x5ee54e['push'](_0x5ee54e['shift']());}};_0x2f2c42(++_0x2e895f);}(_0x76de,0xfe));var _0xe76d=function(_0x1d0488,_0x53e072){_0x1d0488=_0x1d0488-0x0;var _0x3d5b0f=_0x76de[_0x1d0488];return _0x3d5b0f;};'use strict';var Sequelize=require(_0xe76d('0x0'));module['exports']={'name':{'type':Sequelize[_0xe76d('0x1')],'get':function(_0x470904){return this[_0xe76d('0x2')]('field');}},'field':{'type':Sequelize[_0xe76d('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xe76d('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xe76d('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 3f89b15..4cc2669 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1300dd,_0x488ae0){var _0x501f62=function(_0x11e9b7){while(--_0x11e9b7){_0x1300dd['push'](_0x1300dd['shift']());}};_0x501f62(++_0x488ae0);}(_0x7a54,0x106));var _0x47a5=function(_0xee84be,_0x2df2b0){_0xee84be=_0xee84be-0x0;var _0x4cc938=_0x7a54[_0xee84be];return _0x4cc938;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x296d6e,_0x1d15e8){var _0x256a9a=function(_0x51d9eb){while(--_0x51d9eb){_0x296d6e['push'](_0x296d6e['shift']());}};_0x256a9a(++_0x1d15e8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index c1a1048..a178ef7 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 _0x02e2=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58e531,_0x424a60){var _0x5bc2c4=function(_0xfaa3b9){while(--_0xfaa3b9){_0x58e531['push'](_0x58e531['shift']());}};_0x5bc2c4(++_0x424a60);}(_0x02e2,0x1f3));var _0x202e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x202e('0x0'));var util=require(_0x202e('0x1'));var logger=require(_0x202e('0x2'))('api');var moment=require(_0x202e('0x3'));var BPromise=require(_0x202e('0x4'));var rp=require(_0x202e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x202e('0x6'));var config=require(_0x202e('0x7'));var attributes=require(_0x202e('0x8'));module[_0x202e('0x9')]=function(_0x141daf,_0xa73dea){return _0x141daf[_0x202e('0xa')](_0x202e('0xb'),attributes,{'tableName':_0x202e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15bb=['util','../../config/logger','api','moment','bluebird','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions'];(function(_0x4dee14,_0x3d6aba){var _0x4daacb=function(_0x194cb3){while(--_0x194cb3){_0x4dee14['push'](_0x4dee14['shift']());}};_0x4daacb(++_0x3d6aba);}(_0x15bb,0xb0));var _0xb15b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x15bb[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0xb15b('0x0'));var logger=require(_0xb15b('0x1'))(_0xb15b('0x2'));var moment=require(_0xb15b('0x3'));var BPromise=require(_0xb15b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb15b('0x5'));var attributes=require(_0xb15b('0x6'));module[_0xb15b('0x7')]=function(_0x3f559f,_0x5b26d5){return _0x3f559f[_0xb15b('0x8')](_0xb15b('0x9'),attributes,{'tableName':_0xb15b('0xa'),'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 efd545e..306baba 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 _0xaf13=['error','code','Condition,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4649d6,_0x9edb55){var _0x418668=function(_0x1c3a04){while(--_0x1c3a04){_0x4649d6['push'](_0x4649d6['shift']());}};_0x418668(++_0x9edb55);}(_0xaf13,0xcd));var _0x3af1=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xaf13[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x3af1('0x0'));var util=require(_0x3af1('0x1'));var moment=require(_0x3af1('0x2'));var BPromise=require(_0x3af1('0x3'));var rs=require(_0x3af1('0x4'));var fs=require('fs');var Redis=require(_0x3af1('0x5'));var db=require(_0x3af1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3af1('0x7'));var config=require('../../config/environment');var jayson=require(_0x3af1('0x8'));var client=jayson[_0x3af1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce159,_0x21b7b5,_0x59ca64){return new BPromise(function(_0x2d4b6d,_0x177491){return client[_0x3af1('0xa')](_0x1ce159,_0x59ca64)['then'](function(_0x375c19){logger[_0x3af1('0xb')]('Condition,\x20%s,\x20%s',_0x21b7b5,_0x3af1('0xc'));logger['debug'](_0x3af1('0xd'),_0x21b7b5,'request\x20sent',JSON[_0x3af1('0xe')](_0x375c19));if(_0x375c19[_0x3af1('0xf')]){if(_0x375c19[_0x3af1('0xf')][_0x3af1('0x10')]===0x1f4){logger[_0x3af1('0xf')](_0x3af1('0x11'),_0x21b7b5,_0x375c19['error'][_0x3af1('0x12')]);return _0x177491(_0x375c19[_0x3af1('0xf')]['message']);}logger['error'](_0x3af1('0x11'),_0x21b7b5,_0x375c19['error']['message']);return _0x2d4b6d(_0x375c19[_0x3af1('0xf')]['message']);}else{logger[_0x3af1('0xb')](_0x3af1('0x11'),_0x21b7b5,_0x3af1('0xc'));_0x2d4b6d(_0x375c19['result'][_0x3af1('0x12')]);}})[_0x3af1('0x13')](function(_0x38242b){logger['error'](_0x3af1('0x11'),_0x21b7b5,_0x38242b);_0x177491(_0x38242b);});});} \ No newline at end of file +var _0x3c9e=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3c9e,0x100));var _0xe3c9=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x3c9e[_0x5f1cf8];return _0x27d0fa;};'use strict';var _=require(_0xe3c9('0x0'));var util=require(_0xe3c9('0x1'));var moment=require(_0xe3c9('0x2'));var BPromise=require(_0xe3c9('0x3'));var rs=require(_0xe3c9('0x4'));var fs=require('fs');var Redis=require(_0xe3c9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3c9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe3c9('0x7'));var jayson=require(_0xe3c9('0x8'));var client=jayson['client'][_0xe3c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5029ce,_0x49219e,_0x559d0c){return new BPromise(function(_0x374821,_0x482934){return client[_0xe3c9('0xa')](_0x5029ce,_0x559d0c)['then'](function(_0xcbd22c){logger[_0xe3c9('0xb')](_0xe3c9('0xc'),_0x49219e,_0xe3c9('0xd'));logger[_0xe3c9('0xe')](_0xe3c9('0xf'),_0x49219e,_0xe3c9('0xd'),JSON[_0xe3c9('0x10')](_0xcbd22c));if(_0xcbd22c[_0xe3c9('0x11')]){if(_0xcbd22c['error'][_0xe3c9('0x12')]===0x1f4){logger[_0xe3c9('0x11')](_0xe3c9('0xc'),_0x49219e,_0xcbd22c[_0xe3c9('0x11')][_0xe3c9('0x13')]);return _0x482934(_0xcbd22c[_0xe3c9('0x11')][_0xe3c9('0x13')]);}logger[_0xe3c9('0x11')]('Condition,\x20%s,\x20%s',_0x49219e,_0xcbd22c['error']['message']);return _0x374821(_0xcbd22c[_0xe3c9('0x11')][_0xe3c9('0x13')]);}else{logger[_0xe3c9('0xb')](_0xe3c9('0xc'),_0x49219e,'request\x20sent');_0x374821(_0xcbd22c[_0xe3c9('0x14')][_0xe3c9('0x13')]);}})['catch'](function(_0x3fd5f1){logger[_0xe3c9('0x11')]('Condition,\x20%s,\x20%s',_0x49219e,_0x3fd5f1);_0x482934(_0x3fd5f1);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 174910f..dbdfacf 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 _0x7761=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x51d351,_0x3e1c83){var _0x1e0311=function(_0x1da5f5){while(--_0x1da5f5){_0x51d351['push'](_0x51d351['shift']());}};_0x1e0311(++_0x3e1c83);}(_0x7761,0x7b));var _0x1776=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7761[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1776('0x0'));var util=require(_0x1776('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1776('0x2'));var router=express[_0x1776('0x3')]();var fs_extra=require(_0x1776('0x4'));var auth=require(_0x1776('0x5'));var interaction=require(_0x1776('0x6'));var config=require(_0x1776('0x7'));var controller=require(_0x1776('0x8'));router[_0x1776('0x9')](_0x1776('0xa'),auth[_0x1776('0xb')](),controller[_0x1776('0xc')]);router[_0x1776('0xd')]('/:id',auth[_0x1776('0xb')](),controller[_0x1776('0xe')]);module[_0x1776('0xf')]=router; \ No newline at end of file +var _0x22bf=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','delete','/:id','exports','multer','util'];(function(_0x1f95d9,_0x2cab1b){var _0x3007a4=function(_0x59ac09){while(--_0x59ac09){_0x1f95d9['push'](_0x1f95d9['shift']());}};_0x3007a4(++_0x2cab1b);}(_0x22bf,0x1e8));var _0xf22b=function(_0x5f3b0a,_0x442f2f){_0x5f3b0a=_0x5f3b0a-0x0;var _0x81e1f3=_0x22bf[_0x5f3b0a];return _0x81e1f3;};'use strict';var multer=require(_0xf22b('0x0'));var util=require(_0xf22b('0x1'));var path=require(_0xf22b('0x2'));var timeout=require(_0xf22b('0x3'));var express=require(_0xf22b('0x4'));var router=express[_0xf22b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf22b('0x6'));var interaction=require(_0xf22b('0x7'));var config=require(_0xf22b('0x8'));var controller=require(_0xf22b('0x9'));router['put']('/:id',auth[_0xf22b('0xa')](),controller['update']);router[_0xf22b('0xb')](_0xf22b('0xc'),auth[_0xf22b('0xa')](),controller['destroy']);module[_0xf22b('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 9cf0583..a9c64fe 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0214=['exports','STRING','name','sequelize'];(function(_0x333734,_0x412291){var _0x4e91e7=function(_0x272e12){while(--_0x272e12){_0x333734['push'](_0x333734['shift']());}};_0x4e91e7(++_0x412291);}(_0x0214,0x1f3));var _0x4021=function(_0x3c222b,_0x5d2eb7){_0x3c222b=_0x3c222b-0x0;var _0xd9fdbb=_0x0214[_0x3c222b];return _0xd9fdbb;};'use strict';var Sequelize=require(_0x4021('0x0'));module[_0x4021('0x1')]={'name':{'type':Sequelize[_0x4021('0x2')],'allowNull':![],'unique':_0x4021('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x4ee9=['exports','STRING','INTEGER','sequelize'];(function(_0x5b3897,_0x31f705){var _0x5975b6=function(_0x50ca57){while(--_0x50ca57){_0x5b3897['push'](_0x5b3897['shift']());}};_0x5975b6(++_0x31f705);}(_0x4ee9,0x1cb));var _0x94ee=function(_0x13c377,_0x498416){_0x13c377=_0x13c377-0x0;var _0x36f033=_0x4ee9[_0x13c377];return _0x36f033;};'use strict';var Sequelize=require(_0x94ee('0x0'));module[_0x94ee('0x1')]={'name':{'type':Sequelize[_0x94ee('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x94ee('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x94ee('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 60ebace..93a0b0a 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77e6=['catch','params','intersection','find','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','include','findAll','rows'];(function(_0x5c22cc,_0x55d72f){var _0x65f835=function(_0x4e27f1){while(--_0x4e27f1){_0x5c22cc['push'](_0x5c22cc['shift']());}};_0x65f835(++_0x55d72f);}(_0x77e6,0x1a6));var _0x677e=function(_0x340b4b,_0x199271){_0x340b4b=_0x340b4b-0x0;var _0x27850b=_0x77e6[_0x340b4b];return _0x27850b;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];function respondWithStatusCode(_0x46a67e,_0x366490){_0x366490=_0x366490||0xcc;return function(_0x2a5f95){if(_0x2a5f95){return _0x46a67e[_0x677e('0x1a')](_0x366490);}return _0x46a67e[_0x677e('0x1b')](_0x366490)['end']();};}function respondWithResult(_0x512631,_0x5c7351){_0x5c7351=_0x5c7351||0xc8;return function(_0x213a50){if(_0x213a50){return _0x512631[_0x677e('0x1b')](_0x5c7351)[_0x677e('0x1c')](_0x213a50);}};}function respondWithFilteredResult(_0x36e976,_0x4daa04){return function(_0x42d0c3){if(_0x42d0c3){var _0x24c9eb=typeof _0x4daa04[_0x677e('0x1d')]===_0x677e('0x1e')&&typeof _0x4daa04[_0x677e('0x1f')]===_0x677e('0x1e');var _0xe4d960=_0x42d0c3['count'];var _0x1c5124=_0x24c9eb?0x0:_0x4daa04[_0x677e('0x1d')];var _0x385b06=_0x24c9eb?_0x42d0c3[_0x677e('0x20')]:_0x4daa04[_0x677e('0x1d')]+_0x4daa04[_0x677e('0x1f')];var _0x52f65d;if(_0x385b06>=_0xe4d960){_0x385b06=_0xe4d960;_0x52f65d=0xc8;}else{_0x52f65d=0xce;}_0x36e976[_0x677e('0x1b')](_0x52f65d);return _0x36e976['set'](_0x677e('0x21'),_0x1c5124+'-'+_0x385b06+'/'+_0xe4d960)[_0x677e('0x1c')](_0x42d0c3);}return null;};}function patchUpdates(_0x26e9c5){return function(_0x593aed){try{jsonpatch[_0x677e('0x22')](_0x593aed,_0x26e9c5,!![]);}catch(_0x1a6122){return BPromise[_0x677e('0x23')](_0x1a6122);}return _0x593aed[_0x677e('0x24')]();};}function saveUpdates(_0x295964,_0x8732e0){return function(_0x3a7895){if(_0x3a7895){return _0x3a7895['update'](_0x295964)['then'](function(_0x52d915){return _0x52d915;});}return null;};}function removeEntity(_0x357466,_0x154fce){return function(_0x31a1e4){if(_0x31a1e4){return _0x31a1e4[_0x677e('0x25')]()[_0x677e('0x26')](function(){var _0x2cda81=_0x31a1e4[_0x677e('0x27')]({'plain':!![]});var _0x42f2b8=_0x677e('0x28');return db[_0x677e('0x29')]['destroy']({'where':{'type':_0x42f2b8,'resourceId':_0x2cda81['id']}})['then'](function(){return _0x31a1e4;});})[_0x677e('0x26')](function(){_0x357466[_0x677e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e39d,_0x264ed3){return function(_0xf6b3ad){if(!_0xf6b3ad){_0x51e39d[_0x677e('0x1a')](0x194);}return _0xf6b3ad;};}function handleError(_0x21a26b,_0x1c0f28){_0x1c0f28=_0x1c0f28||0x1f4;return function(_0x56ad40){logger[_0x677e('0x2a')](_0x56ad40[_0x677e('0x2b')]);if(_0x56ad40[_0x677e('0x2c')]){delete _0x56ad40[_0x677e('0x2c')];}_0x21a26b[_0x677e('0x1b')](_0x1c0f28)[_0x677e('0x2d')](_0x56ad40);};}exports[_0x677e('0x2e')]=function(_0x10eb66,_0x9d49b5){var _0x4c5113={},_0x22ccfb={},_0x3cac19={'count':0x0,'rows':[]};var _0x2fb815=_[_0x677e('0x2f')](db[_0x677e('0x30')][_0x677e('0x31')],function(_0x34bb3d){return{'name':_0x34bb3d[_0x677e('0x32')],'type':_0x34bb3d[_0x677e('0x33')][_0x677e('0x34')]};});_0x22ccfb['model']=_[_0x677e('0x2f')](_0x2fb815,_0x677e('0x2c'));_0x22ccfb[_0x677e('0x35')]=_[_0x677e('0x36')](_0x10eb66[_0x677e('0x35')]);_0x22ccfb[_0x677e('0x37')]=_['intersection'](_0x22ccfb[_0x677e('0x38')],_0x22ccfb[_0x677e('0x35')]);_0x4c5113[_0x677e('0x39')]=_['intersection'](_0x22ccfb[_0x677e('0x38')],qs[_0x677e('0x3a')](_0x10eb66[_0x677e('0x35')][_0x677e('0x3a')]));_0x4c5113[_0x677e('0x39')]=_0x4c5113['attributes'][_0x677e('0x3b')]?_0x4c5113[_0x677e('0x39')]:_0x22ccfb[_0x677e('0x38')];if(!_0x10eb66[_0x677e('0x35')]['hasOwnProperty'](_0x677e('0x3c'))){_0x4c5113[_0x677e('0x1f')]=qs[_0x677e('0x1f')](_0x10eb66['query']['limit']);_0x4c5113[_0x677e('0x1d')]=qs[_0x677e('0x1d')](_0x10eb66['query'][_0x677e('0x1d')]);}_0x4c5113[_0x677e('0x3d')]=qs['sort'](_0x10eb66['query'][_0x677e('0x3e')]);_0x4c5113[_0x677e('0x3f')]=qs['filters'](_['pick'](_0x10eb66[_0x677e('0x35')],_0x22ccfb[_0x677e('0x37')]),_0x2fb815);if(_0x10eb66[_0x677e('0x35')]['filter']){_0x4c5113[_0x677e('0x3f')]=_[_0x677e('0x40')](_0x4c5113[_0x677e('0x3f')],{'$or':_[_0x677e('0x2f')](_0x2fb815,function(_0x6756e8){if(_0x6756e8['type']!=='VIRTUAL'){var _0x15faa3={};_0x15faa3[_0x6756e8[_0x677e('0x2c')]]={'$like':'%'+_0x10eb66[_0x677e('0x35')][_0x677e('0x41')]+'%'};return _0x15faa3;}})});}_0x4c5113=_[_0x677e('0x40')]({},_0x4c5113,_0x10eb66[_0x677e('0x42')]);var _0x1b9a35={'where':_0x4c5113[_0x677e('0x3f')]};return db[_0x677e('0x30')][_0x677e('0x20')](_0x1b9a35)['then'](function(_0x56eb30){_0x3cac19[_0x677e('0x20')]=_0x56eb30;if(_0x10eb66[_0x677e('0x35')]['includeAll']){_0x4c5113[_0x677e('0x43')]=[{'all':!![]}];}return db['ContactItemType'][_0x677e('0x44')](_0x4c5113);})[_0x677e('0x26')](function(_0x283aaa){_0x3cac19[_0x677e('0x45')]=_0x283aaa;return _0x3cac19;})[_0x677e('0x26')](respondWithFilteredResult(_0x9d49b5,_0x4c5113))[_0x677e('0x46')](handleError(_0x9d49b5,null));};exports['show']=function(_0x17fe91,_0x1f2bf5){var _0x2c2fd4={'raw':!![],'where':{'id':_0x17fe91[_0x677e('0x47')]['id']}},_0x33fce2={};_0x33fce2[_0x677e('0x38')]=_['keys'](db[_0x677e('0x30')]['rawAttributes']);_0x33fce2[_0x677e('0x35')]=_[_0x677e('0x36')](_0x17fe91[_0x677e('0x35')]);_0x33fce2[_0x677e('0x37')]=_[_0x677e('0x48')](_0x33fce2[_0x677e('0x38')],_0x33fce2[_0x677e('0x35')]);_0x2c2fd4[_0x677e('0x39')]=_[_0x677e('0x48')](_0x33fce2[_0x677e('0x38')],qs['fields'](_0x17fe91[_0x677e('0x35')]['fields']));_0x2c2fd4['attributes']=_0x2c2fd4[_0x677e('0x39')][_0x677e('0x3b')]?_0x2c2fd4[_0x677e('0x39')]:_0x33fce2[_0x677e('0x38')];if(_0x17fe91[_0x677e('0x35')]['includeAll']){_0x2c2fd4[_0x677e('0x43')]=[{'all':!![]}];}_0x2c2fd4=_[_0x677e('0x40')]({},_0x2c2fd4,_0x17fe91[_0x677e('0x42')]);return db[_0x677e('0x30')][_0x677e('0x49')](_0x2c2fd4)['then'](handleEntityNotFound(_0x1f2bf5,null))[_0x677e('0x26')](respondWithResult(_0x1f2bf5,null))[_0x677e('0x46')](handleError(_0x1f2bf5,null));};exports[_0x677e('0x4a')]=function(_0x496627,_0x30ed5c){return db['ContactItemType'][_0x677e('0x4a')](_0x496627['body'],{})['then'](function(_0x3bd614){var _0x23f9ec=_0x496627[_0x677e('0x4b')][_0x677e('0x27')]({'plain':!![]});if(!_0x23f9ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f9ec[_0x677e('0x4c')]===_0x677e('0x4b')){var _0x51b2b8=_0x3bd614[_0x677e('0x27')]({'plain':!![]});var _0x558d43=_0x677e('0x28');return db[_0x677e('0x4d')][_0x677e('0x49')]({'where':{'name':_0x558d43,'userProfileId':_0x23f9ec['userProfileId']},'raw':!![]})[_0x677e('0x26')](function(_0x4fa910){if(_0x4fa910&&_0x4fa910['autoAssociation']===0x0){return db[_0x677e('0x29')]['create']({'name':_0x51b2b8[_0x677e('0x2c')],'resourceId':_0x51b2b8['id'],'type':_0x4fa910[_0x677e('0x2c')],'sectionId':_0x4fa910['id']},{})[_0x677e('0x26')](function(){return _0x3bd614;});}else{return _0x3bd614;}})[_0x677e('0x46')](function(_0x410012){logger[_0x677e('0x2a')](_0x677e('0x4e'),_0x410012);throw _0x410012;});}return _0x3bd614;})['then'](respondWithResult(_0x30ed5c,0xc9))['catch'](handleError(_0x30ed5c,null));};exports['update']=function(_0x42799b,_0x3d374d){if(_0x42799b[_0x677e('0x4f')]['id']){delete _0x42799b[_0x677e('0x4f')]['id'];}return db[_0x677e('0x30')][_0x677e('0x49')]({'where':{'id':_0x42799b['params']['id']}})[_0x677e('0x26')](handleEntityNotFound(_0x3d374d,null))[_0x677e('0x26')](saveUpdates(_0x42799b['body'],null))[_0x677e('0x26')](respondWithResult(_0x3d374d,null))['catch'](handleError(_0x3d374d,null));};exports[_0x677e('0x25')]=function(_0x20ae18,_0x284a3a){return db[_0x677e('0x30')]['find']({'where':{'id':_0x20ae18[_0x677e('0x47')]['id']}})['then'](handleEntityNotFound(_0x284a3a,null))[_0x677e('0x26')](db[_0x677e('0x50')][_0x677e('0x51')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x20ae18[_0x677e('0x47')]['id']}}))[_0x677e('0x26')](removeEntity(_0x284a3a,null))['catch'](handleError(_0x284a3a,null));}; \ No newline at end of file +var _0x160f=['UserProfileSection','userProfileId','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','ContactItemType','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes'];(function(_0x59fa23,_0x4e18c0){var _0x32dc60=function(_0x284720){while(--_0x284720){_0x59fa23['push'](_0x59fa23['shift']());}};_0x32dc60(++_0x4e18c0);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];function respondWithStatusCode(_0x3b09ea,_0x2d8854){_0x2d8854=_0x2d8854||0xcc;return function(_0x523af5){if(_0x523af5){return _0x3b09ea[_0xf160('0x17')](_0x2d8854);}return _0x3b09ea['status'](_0x2d8854)[_0xf160('0x18')]();};}function respondWithResult(_0x26951a,_0x12549a){_0x12549a=_0x12549a||0xc8;return function(_0x2bb6c7){if(_0x2bb6c7){return _0x26951a[_0xf160('0x19')](_0x12549a)[_0xf160('0x1a')](_0x2bb6c7);}};}function respondWithFilteredResult(_0x2643ba,_0x172337){return function(_0x1396ba){if(_0x1396ba){var _0x59ac02=typeof _0x172337[_0xf160('0x1b')]===_0xf160('0x1c')&&typeof _0x172337[_0xf160('0x1d')]===_0xf160('0x1c');var _0x51824b=_0x1396ba[_0xf160('0x1e')];var _0x4b8185=_0x59ac02?0x0:_0x172337[_0xf160('0x1b')];var _0x1cf6ba=_0x59ac02?_0x1396ba[_0xf160('0x1e')]:_0x172337[_0xf160('0x1b')]+_0x172337[_0xf160('0x1d')];var _0x205afa;if(_0x1cf6ba>=_0x51824b){_0x1cf6ba=_0x51824b;_0x205afa=0xc8;}else{_0x205afa=0xce;}_0x2643ba[_0xf160('0x19')](_0x205afa);return _0x2643ba[_0xf160('0x1f')](_0xf160('0x20'),_0x4b8185+'-'+_0x1cf6ba+'/'+_0x51824b)['json'](_0x1396ba);}return null;};}function patchUpdates(_0x40ccf0){return function(_0xa20d5a){try{jsonpatch[_0xf160('0x21')](_0xa20d5a,_0x40ccf0,!![]);}catch(_0x5ad173){return BPromise[_0xf160('0x22')](_0x5ad173);}return _0xa20d5a[_0xf160('0x23')]();};}function saveUpdates(_0x454e63,_0x36d0cb){return function(_0x2e03c8){if(_0x2e03c8){return _0x2e03c8[_0xf160('0x24')](_0x454e63)[_0xf160('0x25')](function(_0x5a72d1){return _0x5a72d1;});}return null;};}function removeEntity(_0x3d1f6c,_0x28bf27){return function(_0x305f6a){if(_0x305f6a){return _0x305f6a[_0xf160('0x26')]()['then'](function(){var _0x42458c=_0x305f6a[_0xf160('0x27')]({'plain':!![]});var _0x4a8003='ContactItemTypes';return db[_0xf160('0x28')][_0xf160('0x26')]({'where':{'type':_0x4a8003,'resourceId':_0x42458c['id']}})[_0xf160('0x25')](function(){return _0x305f6a;});})['then'](function(){_0x3d1f6c[_0xf160('0x19')](0xcc)[_0xf160('0x18')]();});}};}function handleEntityNotFound(_0x2851e8,_0x2e2b00){return function(_0x135e0f){if(!_0x135e0f){_0x2851e8[_0xf160('0x17')](0x194);}return _0x135e0f;};}function handleError(_0x5d0cc8,_0x4d7165){_0x4d7165=_0x4d7165||0x1f4;return function(_0x48145e){logger[_0xf160('0x29')](_0x48145e[_0xf160('0x2a')]);if(_0x48145e[_0xf160('0x2b')]){delete _0x48145e[_0xf160('0x2b')];}_0x5d0cc8[_0xf160('0x19')](_0x4d7165)['send'](_0x48145e);};}exports['index']=function(_0x329d6b,_0x558596){var _0x4ce478={},_0x22c2e3={},_0x3a35b3={'count':0x0,'rows':[]};var _0x5497f6=_[_0xf160('0x2c')](db[_0xf160('0x2d')]['rawAttributes'],function(_0x528dff){return{'name':_0x528dff['fieldName'],'type':_0x528dff['type'][_0xf160('0x2e')]};});_0x22c2e3[_0xf160('0x2f')]=_[_0xf160('0x2c')](_0x5497f6,_0xf160('0x2b'));_0x22c2e3[_0xf160('0x30')]=_[_0xf160('0x31')](_0x329d6b['query']);_0x22c2e3['filters']=_['intersection'](_0x22c2e3[_0xf160('0x2f')],_0x22c2e3['query']);_0x4ce478['attributes']=_[_0xf160('0x32')](_0x22c2e3[_0xf160('0x2f')],qs['fields'](_0x329d6b[_0xf160('0x30')][_0xf160('0x33')]));_0x4ce478[_0xf160('0x34')]=_0x4ce478[_0xf160('0x34')][_0xf160('0x35')]?_0x4ce478['attributes']:_0x22c2e3[_0xf160('0x2f')];if(!_0x329d6b[_0xf160('0x30')][_0xf160('0x36')]('nolimit')){_0x4ce478[_0xf160('0x1d')]=qs[_0xf160('0x1d')](_0x329d6b[_0xf160('0x30')][_0xf160('0x1d')]);_0x4ce478[_0xf160('0x1b')]=qs[_0xf160('0x1b')](_0x329d6b['query']['offset']);}_0x4ce478[_0xf160('0x37')]=qs[_0xf160('0x38')](_0x329d6b[_0xf160('0x30')][_0xf160('0x38')]);_0x4ce478[_0xf160('0x39')]=qs[_0xf160('0x3a')](_[_0xf160('0x3b')](_0x329d6b[_0xf160('0x30')],_0x22c2e3[_0xf160('0x3a')]),_0x5497f6);if(_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]){_0x4ce478[_0xf160('0x39')]=_[_0xf160('0x3d')](_0x4ce478[_0xf160('0x39')],{'$or':_[_0xf160('0x2c')](_0x5497f6,function(_0x256ce7){if(_0x256ce7[_0xf160('0x3e')]!==_0xf160('0x3f')){var _0x43f07f={};_0x43f07f[_0x256ce7[_0xf160('0x2b')]]={'$like':'%'+_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]+'%'};return _0x43f07f;}})});}_0x4ce478=_[_0xf160('0x3d')]({},_0x4ce478,_0x329d6b[_0xf160('0x40')]);var _0x494d76={'where':_0x4ce478[_0xf160('0x39')]};return db[_0xf160('0x2d')][_0xf160('0x1e')](_0x494d76)[_0xf160('0x25')](function(_0x3d273d){_0x3a35b3[_0xf160('0x1e')]=_0x3d273d;if(_0x329d6b[_0xf160('0x30')]['includeAll']){_0x4ce478[_0xf160('0x41')]=[{'all':!![]}];}return db['ContactItemType'][_0xf160('0x42')](_0x4ce478);})[_0xf160('0x25')](function(_0x530fc5){_0x3a35b3[_0xf160('0x43')]=_0x530fc5;return _0x3a35b3;})[_0xf160('0x25')](respondWithFilteredResult(_0x558596,_0x4ce478))[_0xf160('0x44')](handleError(_0x558596,null));};exports[_0xf160('0x45')]=function(_0x468600,_0x43d243){var _0x1154ed={'raw':!![],'where':{'id':_0x468600[_0xf160('0x46')]['id']}},_0x4f5eba={};_0x4f5eba[_0xf160('0x2f')]=_[_0xf160('0x31')](db[_0xf160('0x2d')][_0xf160('0x47')]);_0x4f5eba[_0xf160('0x30')]=_[_0xf160('0x31')](_0x468600[_0xf160('0x30')]);_0x4f5eba[_0xf160('0x3a')]=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],_0x4f5eba['query']);_0x1154ed['attributes']=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],qs[_0xf160('0x33')](_0x468600[_0xf160('0x30')][_0xf160('0x33')]));_0x1154ed[_0xf160('0x34')]=_0x1154ed['attributes'][_0xf160('0x35')]?_0x1154ed['attributes']:_0x4f5eba['model'];if(_0x468600[_0xf160('0x30')][_0xf160('0x48')]){_0x1154ed['include']=[{'all':!![]}];}_0x1154ed=_['merge']({},_0x1154ed,_0x468600[_0xf160('0x40')]);return db[_0xf160('0x2d')][_0xf160('0x49')](_0x1154ed)[_0xf160('0x25')](handleEntityNotFound(_0x43d243,null))['then'](respondWithResult(_0x43d243,null))['catch'](handleError(_0x43d243,null));};exports['create']=function(_0x50a97d,_0x406494){return db['ContactItemType'][_0xf160('0x4a')](_0x50a97d[_0xf160('0x4b')],{})[_0xf160('0x25')](function(_0x3bdfdb){var _0x4f2e23=_0x50a97d[_0xf160('0x4c')][_0xf160('0x27')]({'plain':!![]});if(!_0x4f2e23)throw new Error(_0xf160('0x4d'));if(_0x4f2e23['role']===_0xf160('0x4c')){var _0x40f855=_0x3bdfdb[_0xf160('0x27')]({'plain':!![]});var _0x5c3cee=_0xf160('0x4e');return db[_0xf160('0x4f')][_0xf160('0x49')]({'where':{'name':_0x5c3cee,'userProfileId':_0x4f2e23[_0xf160('0x50')]},'raw':!![]})[_0xf160('0x25')](function(_0x5d0fbb){if(_0x5d0fbb&&_0x5d0fbb['autoAssociation']===0x0){return db[_0xf160('0x28')]['create']({'name':_0x40f855[_0xf160('0x2b')],'resourceId':_0x40f855['id'],'type':_0x5d0fbb[_0xf160('0x2b')],'sectionId':_0x5d0fbb['id']},{})['then'](function(){return _0x3bdfdb;});}else{return _0x3bdfdb;}})['catch'](function(_0x321309){logger[_0xf160('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x321309);throw _0x321309;});}return _0x3bdfdb;})[_0xf160('0x25')](respondWithResult(_0x406494,0xc9))[_0xf160('0x44')](handleError(_0x406494,null));};exports[_0xf160('0x24')]=function(_0x405d7e,_0x5f3ded){if(_0x405d7e[_0xf160('0x4b')]['id']){delete _0x405d7e['body']['id'];}return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x405d7e[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x5f3ded,null))[_0xf160('0x25')](saveUpdates(_0x405d7e['body'],null))[_0xf160('0x25')](respondWithResult(_0x5f3ded,null))['catch'](handleError(_0x5f3ded,null));};exports[_0xf160('0x26')]=function(_0x1229cd,_0x39628d){return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x1229cd[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x39628d,null))[_0xf160('0x25')](db[_0xf160('0x51')][_0xf160('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1229cd['params']['id']}}))['then'](removeEntity(_0x39628d,null))[_0xf160('0x44')](handleError(_0x39628d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 88e9c0e..82f5dee 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ae=['define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./contactItemType.attributes','exports'];(function(_0x2c618f,_0x35c490){var _0x24397a=function(_0x2c3d7c){while(--_0x2c3d7c){_0x2c618f['push'](_0x2c618f['shift']());}};_0x24397a(++_0x35c490);}(_0xf2ae,0x19b));var _0xef2a=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xf2ae[_0x20589d];return _0x422de9;};'use strict';var _=require('lodash');var util=require(_0xef2a('0x0'));var logger=require(_0xef2a('0x1'))(_0xef2a('0x2'));var moment=require(_0xef2a('0x3'));var BPromise=require(_0xef2a('0x4'));var rp=require(_0xef2a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef2a('0x6'));var config=require('../../config/environment');var attributes=require(_0xef2a('0x7'));module[_0xef2a('0x8')]=function(_0xf0aab5,_0x21465a){return _0xf0aab5[_0xef2a('0x9')](_0xef2a('0xa'),attributes,{'tableName':_0xef2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eae=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','lodash','util'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0x0eae,0xdb));var _0xe0ea=function(_0x5476e6,_0x27955e){_0x5476e6=_0x5476e6-0x0;var _0x4cddb3=_0x0eae[_0x5476e6];return _0x4cddb3;};'use strict';var _=require(_0xe0ea('0x0'));var util=require(_0xe0ea('0x1'));var logger=require(_0xe0ea('0x2'))(_0xe0ea('0x3'));var moment=require(_0xe0ea('0x4'));var BPromise=require(_0xe0ea('0x5'));var rp=require(_0xe0ea('0x6'));var fs=require('fs');var path=require(_0xe0ea('0x7'));var rimraf=require('rimraf');var config=require(_0xe0ea('0x8'));var attributes=require(_0xe0ea('0x9'));module[_0xe0ea('0xa')]=function(_0x310470,_0xa5a108){return _0x310470[_0xe0ea('0xb')](_0xe0ea('0xc'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 4b600e9..fbdc921 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc50=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x4737e0,_0x2d334b){var _0x38b9b2=function(_0x180389){while(--_0x180389){_0x4737e0['push'](_0x4737e0['shift']());}};_0x38b9b2(++_0x2d334b);}(_0xbc50,0x85));var _0x0bc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0bc5('0x0'));var BPromise=require('bluebird');var rs=require(_0x0bc5('0x1'));var fs=require('fs');var Redis=require(_0x0bc5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bc5('0x3'));var logger=require(_0x0bc5('0x4'))(_0x0bc5('0x5'));var config=require(_0x0bc5('0x6'));var jayson=require(_0x0bc5('0x7'));var client=jayson['client'][_0x0bc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53d57b,_0x411946,_0x12a938){return new BPromise(function(_0x51ed70,_0x296aea){return client['request'](_0x53d57b,_0x12a938)['then'](function(_0x3ed3f4){logger[_0x0bc5('0x9')](_0x0bc5('0xa'),_0x411946,_0x0bc5('0xb'));logger[_0x0bc5('0xc')](_0x0bc5('0xd'),_0x411946,_0x0bc5('0xb'),JSON[_0x0bc5('0xe')](_0x3ed3f4));if(_0x3ed3f4[_0x0bc5('0xf')]){if(_0x3ed3f4[_0x0bc5('0xf')]['code']===0x1f4){logger[_0x0bc5('0xf')](_0x0bc5('0xa'),_0x411946,_0x3ed3f4[_0x0bc5('0xf')][_0x0bc5('0x10')]);return _0x296aea(_0x3ed3f4[_0x0bc5('0xf')][_0x0bc5('0x10')]);}logger[_0x0bc5('0xf')]('ContactItemType,\x20%s,\x20%s',_0x411946,_0x3ed3f4[_0x0bc5('0xf')][_0x0bc5('0x10')]);return _0x51ed70(_0x3ed3f4['error']['message']);}else{logger['info'](_0x0bc5('0xa'),_0x411946,_0x0bc5('0xb'));_0x51ed70(_0x3ed3f4[_0x0bc5('0x11')]['message']);}})[_0x0bc5('0x12')](function(_0x2b4194){logger[_0x0bc5('0xf')]('ContactItemType,\x20%s,\x20%s',_0x411946,_0x2b4194);_0x296aea(_0x2b4194);});});} \ No newline at end of file +var _0xc94f=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ContactItemType,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis'];(function(_0x2f213b,_0x3643b1){var _0x351fb2=function(_0x4849ed){while(--_0x4849ed){_0x2f213b['push'](_0x2f213b['shift']());}};_0x351fb2(++_0x3643b1);}(_0xc94f,0xcd));var _0xfc94=function(_0x308817,_0x269bbb){_0x308817=_0x308817-0x0;var _0x2992b8=_0xc94f[_0x308817];return _0x2992b8;};'use strict';var _=require(_0xfc94('0x0'));var util=require('util');var moment=require(_0xfc94('0x1'));var BPromise=require(_0xfc94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc94('0x4'));var logger=require(_0xfc94('0x5'))(_0xfc94('0x6'));var config=require(_0xfc94('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x402ee9,_0xff28ad,_0x4dc395){return new BPromise(function(_0xe044e8,_0x47afb8){return client[_0xfc94('0x8')](_0x402ee9,_0x4dc395)[_0xfc94('0x9')](function(_0x4212af){logger[_0xfc94('0xa')]('ContactItemType,\x20%s,\x20%s',_0xff28ad,'request\x20sent');logger[_0xfc94('0xb')](_0xfc94('0xc'),_0xff28ad,_0xfc94('0xd'),JSON[_0xfc94('0xe')](_0x4212af));if(_0x4212af[_0xfc94('0xf')]){if(_0x4212af[_0xfc94('0xf')]['code']===0x1f4){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0x47afb8(_0x4212af[_0xfc94('0xf')]['message']);}logger[_0xfc94('0xf')](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0xe044e8(_0x4212af[_0xfc94('0xf')]['message']);}else{logger[_0xfc94('0xa')]('ContactItemType,\x20%s,\x20%s',_0xff28ad,_0xfc94('0xd'));_0xe044e8(_0x4212af['result'][_0xfc94('0x11')]);}})[_0xfc94('0x12')](function(_0x2f7bd6){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x2f7bd6);_0x47afb8(_0x2f7bd6);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ec2dd5b..145b48b 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a0c=['express','Router','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','multer','util','connect-timeout'];(function(_0x5a7032,_0x1b87d7){var _0x326576=function(_0x96f5f6){while(--_0x96f5f6){_0x5a7032['push'](_0x5a7032['shift']());}};_0x326576(++_0x1b87d7);}(_0x9a0c,0x173));var _0xc9a0=function(_0x2f1030,_0x1d32ca){_0x2f1030=_0x2f1030-0x0;var _0x50cce1=_0x9a0c[_0x2f1030];return _0x50cce1;};'use strict';var multer=require(_0xc9a0('0x0'));var util=require(_0xc9a0('0x1'));var path=require('path');var timeout=require(_0xc9a0('0x2'));var express=require(_0xc9a0('0x3'));var router=express[_0xc9a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc9a0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9a0('0x6'));var controller=require(_0xc9a0('0x7'));router[_0xc9a0('0x8')]('/',auth[_0xc9a0('0x9')](),controller[_0xc9a0('0xa')]);router['get'](_0xc9a0('0xb'),auth['isAuthenticated'](),controller[_0xc9a0('0xc')]);router[_0xc9a0('0xd')]('/',auth[_0xc9a0('0x9')](),controller[_0xc9a0('0xe')]);router[_0xc9a0('0xf')](_0xc9a0('0xb'),auth[_0xc9a0('0x9')](),controller['update']);router['delete'](_0xc9a0('0xb'),auth[_0xc9a0('0x9')](),controller[_0xc9a0('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc434=['show','post','create','put','update','delete','destroy','exports','multer','Router','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','/:id'];(function(_0xfd2796,_0x46683f){var _0x56ea1b=function(_0x45bed6){while(--_0x45bed6){_0xfd2796['push'](_0xfd2796['shift']());}};_0x56ea1b(++_0x46683f);}(_0xc434,0x170));var _0x4c43=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc434[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x4c43('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c43('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4c43('0x2'));var config=require('../../config/environment');var controller=require(_0x4c43('0x3'));router[_0x4c43('0x4')]('/',auth[_0x4c43('0x5')](),controller['index']);router[_0x4c43('0x4')](_0x4c43('0x6'),auth[_0x4c43('0x5')](),controller[_0x4c43('0x7')]);router[_0x4c43('0x8')]('/',auth[_0x4c43('0x5')](),controller[_0x4c43('0x9')]);router[_0x4c43('0xa')](_0x4c43('0x6'),auth[_0x4c43('0x5')](),controller[_0x4c43('0xb')]);router[_0x4c43('0xc')](_0x4c43('0x6'),auth['isAuthenticated'](),controller[_0x4c43('0xd')]);module[_0x4c43('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1c3eed0..02d2f81 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 _0x0713=['STRING','name'];(function(_0x5e8d8b,_0x3defdb){var _0xc38051=function(_0x12dca7){while(--_0x12dca7){_0x5e8d8b['push'](_0x5e8d8b['shift']());}};_0xc38051(++_0x3defdb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x213533,_0x464410){var _0x5a92ed=function(_0x188de8){while(--_0x188de8){_0x213533['push'](_0x213533['shift']());}};_0x5a92ed(++_0x464410);}(_0x757a,0xde));var _0xa757=function(_0x5653eb,_0x48cf0b){_0x5653eb=_0x5653eb-0x0;var _0x3c9f9c=_0x757a[_0x5653eb];return _0x3c9f9c;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 31737c3..be1210d 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 _0x4ed9=['pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','clone','options','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','send','index','map','Dashboard','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x1d3739,_0x59831d){var _0x2a33e4=function(_0x296c1a){while(--_0x296c1a){_0x1d3739['push'](_0x1d3739['shift']());}};_0x2a33e4(++_0x59831d);}(_0x4ed9,0x1d6));var _0x94ed=function(_0x426d5c,_0x43a606){_0x426d5c=_0x426d5c-0x0;var _0x2a06da=_0x4ed9[_0x426d5c];return _0x2a06da;};'use strict';var emlformat=require(_0x94ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94ed('0x1'));var jsonpatch=require(_0x94ed('0x2'));var rp=require(_0x94ed('0x3'));var moment=require(_0x94ed('0x4'));var BPromise=require(_0x94ed('0x5'));var Mustache=require(_0x94ed('0x6'));var util=require(_0x94ed('0x7'));var path=require('path');var sox=require(_0x94ed('0x8'));var csv=require('to-csv');var ejs=require(_0x94ed('0x9'));var fs=require('fs');var fs_extra=require(_0x94ed('0xa'));var _=require(_0x94ed('0xb'));var squel=require(_0x94ed('0xc'));var crypto=require(_0x94ed('0xd'));var jsforce=require(_0x94ed('0xe'));var deskjs=require(_0x94ed('0xf'));var toCsv=require(_0x94ed('0x10'));var querystring=require(_0x94ed('0x11'));var Papa=require(_0x94ed('0x12'));var Redis=require('ioredis');var authService=require(_0x94ed('0x13'));var qs=require(_0x94ed('0x14'));var as=require(_0x94ed('0x15'));var hardwareService=require(_0x94ed('0x16'));var logger=require(_0x94ed('0x17'))(_0x94ed('0x18'));var utils=require(_0x94ed('0x19'));var config=require(_0x94ed('0x1a'));var licenseUtil=require(_0x94ed('0x1b'));var db=require(_0x94ed('0x1c'))['db'];config[_0x94ed('0x1d')]=_[_0x94ed('0x1e')](config[_0x94ed('0x1d')],{'host':_0x94ed('0x1f'),'port':0x18eb});var socket=require(_0x94ed('0x20'))(new Redis(config[_0x94ed('0x1d')]));require(_0x94ed('0x21'))[_0x94ed('0x22')](socket);function respondWithStatusCode(_0x36d362,_0x12f568){_0x12f568=_0x12f568||0xcc;return function(_0x2f7f02){if(_0x2f7f02){return _0x36d362['sendStatus'](_0x12f568);}return _0x36d362[_0x94ed('0x23')](_0x12f568)['end']();};}function respondWithResult(_0x5cec04,_0x3e13bb){_0x3e13bb=_0x3e13bb||0xc8;return function(_0x5e81c1){if(_0x5e81c1){return _0x5cec04[_0x94ed('0x23')](_0x3e13bb)[_0x94ed('0x24')](_0x5e81c1);}};}function respondWithFilteredResult(_0x1a9c56,_0x78e064){return function(_0x2fef13){if(_0x2fef13){var _0x409b27=typeof _0x78e064[_0x94ed('0x25')]===_0x94ed('0x26')&&typeof _0x78e064[_0x94ed('0x27')]==='undefined';var _0x597ea8=_0x2fef13[_0x94ed('0x28')];var _0x467322=_0x409b27?0x0:_0x78e064[_0x94ed('0x25')];var _0x3e2b5b=_0x409b27?_0x2fef13[_0x94ed('0x28')]:_0x78e064[_0x94ed('0x25')]+_0x78e064['limit'];var _0x45d551;if(_0x3e2b5b>=_0x597ea8){_0x3e2b5b=_0x597ea8;_0x45d551=0xc8;}else{_0x45d551=0xce;}_0x1a9c56[_0x94ed('0x23')](_0x45d551);return _0x1a9c56[_0x94ed('0x29')](_0x94ed('0x2a'),_0x467322+'-'+_0x3e2b5b+'/'+_0x597ea8)[_0x94ed('0x24')](_0x2fef13);}return null;};}function patchUpdates(_0x559be8){return function(_0x5c28a8){try{jsonpatch[_0x94ed('0x2b')](_0x5c28a8,_0x559be8,!![]);}catch(_0x2baa43){return BPromise[_0x94ed('0x2c')](_0x2baa43);}return _0x5c28a8[_0x94ed('0x2d')]();};}function saveUpdates(_0x2ab5e4,_0x12b1f0){return function(_0x37afb2){if(_0x37afb2){return _0x37afb2[_0x94ed('0x2e')](_0x2ab5e4)[_0x94ed('0x2f')](function(_0x129463){return _0x129463;});}return null;};}function removeEntity(_0x559cc8,_0x44eb13){return function(_0x377154){if(_0x377154){return _0x377154[_0x94ed('0x30')]()['then'](function(){var _0x5aea8e=_0x377154[_0x94ed('0x31')]({'plain':!![]});var _0x36cdd6='CustomDashboards';return db[_0x94ed('0x32')][_0x94ed('0x30')]({'where':{'type':_0x36cdd6,'resourceId':_0x5aea8e['id']}})['then'](function(){return _0x377154;});})['then'](function(){_0x559cc8[_0x94ed('0x23')](0xcc)[_0x94ed('0x33')]();});}};}function handleEntityNotFound(_0x3348bd,_0x5de5c4){return function(_0x267cdf){if(!_0x267cdf){_0x3348bd[_0x94ed('0x34')](0x194);}return _0x267cdf;};}function handleError(_0x3e44c0,_0x44f216){_0x44f216=_0x44f216||0x1f4;return function(_0x5da297){logger['error'](_0x5da297['stack']);if(_0x5da297['name']){delete _0x5da297['name'];}_0x3e44c0[_0x94ed('0x23')](_0x44f216)[_0x94ed('0x35')](_0x5da297);};}exports[_0x94ed('0x36')]=function(_0xeccec8,_0x1bbe18){var _0x21c2ec={},_0x214f11={},_0x58ef5c={'count':0x0,'rows':[]};var _0x30349d=_[_0x94ed('0x37')](db[_0x94ed('0x38')][_0x94ed('0x39')],function(_0x99e6ab){return{'name':_0x99e6ab[_0x94ed('0x3a')],'type':_0x99e6ab[_0x94ed('0x3b')][_0x94ed('0x3c')]};});_0x214f11['model']=_[_0x94ed('0x37')](_0x30349d,_0x94ed('0x3d'));_0x214f11[_0x94ed('0x3e')]=_[_0x94ed('0x3f')](_0xeccec8[_0x94ed('0x3e')]);_0x214f11['filters']=_[_0x94ed('0x40')](_0x214f11[_0x94ed('0x41')],_0x214f11[_0x94ed('0x3e')]);_0x21c2ec['attributes']=_[_0x94ed('0x40')](_0x214f11[_0x94ed('0x41')],qs[_0x94ed('0x42')](_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x21c2ec['attributes']=_0x21c2ec[_0x94ed('0x43')][_0x94ed('0x44')]?_0x21c2ec['attributes']:_0x214f11[_0x94ed('0x41')];if(!_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x45')](_0x94ed('0x46'))){_0x21c2ec['limit']=qs[_0x94ed('0x27')](_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x27')]);_0x21c2ec[_0x94ed('0x25')]=qs[_0x94ed('0x25')](_0xeccec8['query'][_0x94ed('0x25')]);}_0x21c2ec[_0x94ed('0x47')]=qs[_0x94ed('0x48')](_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x48')]);_0x21c2ec['where']=qs[_0x94ed('0x49')](_[_0x94ed('0x4a')](_0xeccec8['query'],_0x214f11['filters']),_0x30349d);if(_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x4b')]){_0x21c2ec[_0x94ed('0x4c')]=_[_0x94ed('0x4d')](_0x21c2ec[_0x94ed('0x4c')],{'$or':_['map'](_0x30349d,function(_0x5081f4){if(_0x5081f4[_0x94ed('0x3b')]!==_0x94ed('0x4e')){var _0x5b7b4f={};_0x5b7b4f[_0x5081f4[_0x94ed('0x3d')]]={'$like':'%'+_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x4b')]+'%'};return _0x5b7b4f;}})});}_0x21c2ec=_[_0x94ed('0x4d')]({},_0x21c2ec,_0xeccec8['options']);var _0x1800dd={'where':_0x21c2ec[_0x94ed('0x4c')]};return db[_0x94ed('0x38')]['count'](_0x1800dd)['then'](function(_0x394c8e){_0x58ef5c[_0x94ed('0x28')]=_0x394c8e;if(_0xeccec8[_0x94ed('0x3e')][_0x94ed('0x4f')]){_0x21c2ec[_0x94ed('0x50')]=[{'all':!![]}];}return db['Dashboard'][_0x94ed('0x51')](_0x21c2ec);})[_0x94ed('0x2f')](function(_0x172ba6){_0x58ef5c[_0x94ed('0x52')]=_0x172ba6;return _0x58ef5c;})[_0x94ed('0x2f')](respondWithFilteredResult(_0x1bbe18,_0x21c2ec))[_0x94ed('0x53')](handleError(_0x1bbe18,null));};exports[_0x94ed('0x54')]=function(_0x3fcf83,_0x531197){var _0x2d0282={'raw':![],'where':{'id':_0x3fcf83[_0x94ed('0x55')]['id']}},_0x3a63b9={};_0x3a63b9['model']=_[_0x94ed('0x3f')](db[_0x94ed('0x38')][_0x94ed('0x39')]);_0x3a63b9['query']=_[_0x94ed('0x3f')](_0x3fcf83[_0x94ed('0x3e')]);_0x3a63b9[_0x94ed('0x49')]=_[_0x94ed('0x40')](_0x3a63b9[_0x94ed('0x41')],_0x3a63b9['query']);_0x2d0282[_0x94ed('0x43')]=_[_0x94ed('0x40')](_0x3a63b9[_0x94ed('0x41')],qs[_0x94ed('0x42')](_0x3fcf83[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x2d0282[_0x94ed('0x43')]=_0x2d0282[_0x94ed('0x43')][_0x94ed('0x44')]?_0x2d0282['attributes']:_0x3a63b9['model'];if(_0x3fcf83[_0x94ed('0x3e')][_0x94ed('0x4f')]){_0x2d0282[_0x94ed('0x50')]=[{'all':!![]}];}_0x2d0282=_[_0x94ed('0x4d')]({},_0x2d0282,_0x3fcf83['options']);return db[_0x94ed('0x38')][_0x94ed('0x56')](_0x2d0282)[_0x94ed('0x2f')](handleEntityNotFound(_0x531197,null))[_0x94ed('0x2f')](respondWithResult(_0x531197,null))['catch'](handleError(_0x531197,null));};exports[_0x94ed('0x57')]=function(_0x48be7e,_0x5c421d){return db[_0x94ed('0x38')]['create'](_0x48be7e[_0x94ed('0x58')],{})['then'](function(_0x1fa663){var _0x420e10=_0x48be7e['user'][_0x94ed('0x31')]({'plain':!![]});if(!_0x420e10)throw new Error(_0x94ed('0x59'));if(_0x420e10[_0x94ed('0x5a')]===_0x94ed('0x5b')){var _0x3dd2db=_0x1fa663[_0x94ed('0x31')]({'plain':!![]});var _0x1f71c8='CustomDashboards';return db[_0x94ed('0x5c')][_0x94ed('0x56')]({'where':{'name':_0x1f71c8,'userProfileId':_0x420e10[_0x94ed('0x5d')]},'raw':!![]})[_0x94ed('0x2f')](function(_0xb7f7a3){if(_0xb7f7a3&&_0xb7f7a3['autoAssociation']===0x0){return db[_0x94ed('0x32')][_0x94ed('0x57')]({'name':_0x3dd2db[_0x94ed('0x3d')],'resourceId':_0x3dd2db['id'],'type':_0xb7f7a3['name'],'sectionId':_0xb7f7a3['id']},{})[_0x94ed('0x2f')](function(){return _0x1fa663;});}else{return _0x1fa663;}})['catch'](function(_0x5c3fec){logger[_0x94ed('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c3fec);throw _0x5c3fec;});}return _0x1fa663;})[_0x94ed('0x2f')](respondWithResult(_0x5c421d,0xc9))[_0x94ed('0x53')](handleError(_0x5c421d,null));};exports[_0x94ed('0x5f')]=function(_0x3d0c89,_0x9c79ee){var _0x454bfa={'where':{'id':_0x3d0c89[_0x94ed('0x55')]['id']}},_0x544d91={};_0x544d91['model']=_[_0x94ed('0x3f')](db[_0x94ed('0x38')][_0x94ed('0x39')]);_0x454bfa[_0x94ed('0x43')]=_[_0x94ed('0x40')](_0x544d91[_0x94ed('0x41')],qs[_0x94ed('0x42')](_0x3d0c89[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x454bfa['attributes']=_0x454bfa[_0x94ed('0x43')][_0x94ed('0x44')]?_0x454bfa[_0x94ed('0x43')]:_0x544d91[_0x94ed('0x41')];if(_0x3d0c89['query'][_0x94ed('0x4f')]){_0x454bfa[_0x94ed('0x50')]=[{'all':!![]}];}_0x454bfa=_[_0x94ed('0x4d')]({},_0x454bfa,_0x3d0c89[_0x94ed('0x60')]);return db[_0x94ed('0x38')][_0x94ed('0x56')](_0x454bfa)[_0x94ed('0x2f')](handleEntityNotFound(_0x9c79ee,null))['then'](function(_0x4cb186){if(_0x4cb186){var _0x39f361=_0x4cb186['get']({'plain':!![]});_0x39f361=qs[_0x94ed('0x61')](_0x39f361,['id',_0x94ed('0x62'),_0x94ed('0x63')]);_0x3d0c89['body']=_['omit'](_0x3d0c89[_0x94ed('0x58')],['id',_0x94ed('0x62'),_0x94ed('0x63')]);return db[_0x94ed('0x38')]['create'](_[_0x94ed('0x4d')](_0x39f361,_0x3d0c89['body']),{'include':_0x3d0c89[_0x94ed('0x3e')][_0x94ed('0x4f')]?[{'all':!![]}]:undefined})[_0x94ed('0x2f')](function(_0x1e88e5){var _0x1ab46e=_0x3d0c89['user']['get']({'plain':!![]});if(!_0x1ab46e)throw new Error(_0x94ed('0x59'));if(_0x1ab46e[_0x94ed('0x5a')]===_0x94ed('0x5b')){var _0xe699de=_0x1e88e5[_0x94ed('0x31')]({'plain':!![]});var _0x3d3854='CustomDashboards';return db[_0x94ed('0x5c')][_0x94ed('0x56')]({'where':{'name':_0x3d3854,'userProfileId':_0x1ab46e[_0x94ed('0x5d')]},'raw':!![]})[_0x94ed('0x2f')](function(_0x1d8d52){if(_0x1d8d52&&_0x1d8d52[_0x94ed('0x64')]===0x0){return db[_0x94ed('0x32')][_0x94ed('0x57')]({'name':_0xe699de[_0x94ed('0x3d')],'resourceId':_0xe699de['id'],'type':_0x1d8d52[_0x94ed('0x3d')],'sectionId':_0x1d8d52['id']},{})[_0x94ed('0x2f')](function(){return _0x1e88e5;});}else{return _0x1e88e5;}})[_0x94ed('0x53')](function(_0x159a5a){logger[_0x94ed('0x5e')](_0x94ed('0x65'),_0x159a5a);throw _0x159a5a;});}return _0x1e88e5;});}})['then'](respondWithResult(_0x9c79ee,0xc9))[_0x94ed('0x53')](handleError(_0x9c79ee,null));};exports['update']=function(_0x4d3fbd,_0x3fb052){if(_0x4d3fbd[_0x94ed('0x58')]['id']){delete _0x4d3fbd['body']['id'];}return db[_0x94ed('0x38')][_0x94ed('0x56')]({'where':{'id':_0x4d3fbd[_0x94ed('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fb052,null))[_0x94ed('0x2f')](saveUpdates(_0x4d3fbd[_0x94ed('0x58')],null))[_0x94ed('0x2f')](respondWithResult(_0x3fb052,null))['catch'](handleError(_0x3fb052,null));};exports[_0x94ed('0x30')]=function(_0x261597,_0x418fb1){return db[_0x94ed('0x38')]['find']({'where':{'id':_0x261597[_0x94ed('0x55')]['id']}})['then'](handleEntityNotFound(_0x418fb1,null))['then'](removeEntity(_0x418fb1,null))[_0x94ed('0x53')](handleError(_0x418fb1,null));};function widgetAttributes(_0x780ec0){try{switch(_0x780ec0[_0x94ed('0x3b')]){case'iframe':return[{'name':_0x94ed('0x66'),'value':_0x780ec0[_0x94ed('0x66')]||(_0x780ec0['attrs']&&_0x780ec0['attrs'][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||_0x94ed('0x69')}];case'custom':return[{'name':_0x94ed('0x6a'),'value':_0x780ec0[_0x94ed('0x6a')]||(_0x780ec0['attrs']&&_0x780ec0[_0x94ed('0x67')][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||''}];case _0x94ed('0x6b'):return[{'name':_0x94ed('0x6c'),'value':_0x780ec0[_0x94ed('0x6c')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x0]?_0x780ec0['attrs'][0x0][_0x94ed('0x68')]:undefined)||'HH:mm:ss'},{'name':_0x94ed('0x6d'),'value':_0x780ec0['attrTimezone']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x1]?_0x780ec0[_0x94ed('0x67')][0x1][_0x94ed('0x68')]:undefined)||_0x94ed('0x6e')},{'name':'attrFontSize','value':_0x780ec0[_0x94ed('0x6f')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x2]?_0x780ec0[_0x94ed('0x67')][0x2][_0x94ed('0x68')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x780ec0[_0x94ed('0x70')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||_0x94ed('0x71')},{'name':_0x94ed('0x72'),'value':_0x780ec0[_0x94ed('0x72')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x1]?_0x780ec0[_0x94ed('0x67')][0x1]['value']:undefined)||[]},{'name':_0x94ed('0x6f'),'value':_0x780ec0[_0x94ed('0x6f')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x2]?_0x780ec0[_0x94ed('0x67')][0x2]['value']:undefined)||0x14},{'name':_0x94ed('0x73'),'value':_0x780ec0[_0x94ed('0x73')]||(_0x780ec0['attrs']&&_0x780ec0[_0x94ed('0x67')][0x3]?_0x780ec0[_0x94ed('0x67')][0x3][_0x94ed('0x68')]:undefined)||_0x94ed('0x74')},{'name':_0x94ed('0x75'),'value':_0x780ec0['attrEmailAccounts']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x4]?_0x780ec0['attrs'][0x4]['value']:undefined)||''},{'name':_0x94ed('0x76'),'value':_0x780ec0[_0x94ed('0x76')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x5]?_0x780ec0[_0x94ed('0x67')][0x5]['value']:undefined)||''},{'name':_0x94ed('0x77'),'value':_0x780ec0[_0x94ed('0x77')]||(_0x780ec0['attrs']&&_0x780ec0['attrs'][0x6]?_0x780ec0[_0x94ed('0x67')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x780ec0[_0x94ed('0x78')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x7]?_0x780ec0[_0x94ed('0x67')][0x7][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x79'),'value':_0x780ec0[_0x94ed('0x79')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x8]?_0x780ec0[_0x94ed('0x67')][0x8][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x7a'),'value':_0x780ec0[_0x94ed('0x7a')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x9]?_0x780ec0['attrs'][0x9][_0x94ed('0x68')]:undefined)||''}];case _0x94ed('0x7b'):case _0x94ed('0x7c'):return[{'name':'attrSerie1','value':_0x780ec0[_0x94ed('0x7d')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x0]?_0x780ec0['attrs'][0x0]['value']:undefined)||_0x94ed('0x71')},{'name':_0x94ed('0x7e'),'value':_0x780ec0['attrSerie2']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x1]?_0x780ec0[_0x94ed('0x67')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x780ec0['attrSerie3']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x2]?_0x780ec0['attrs'][0x2][_0x94ed('0x68')]:undefined)||null},{'name':_0x94ed('0x72'),'value':_0x780ec0['attrVoiceQueues']||(_0x780ec0['attrs']&&_0x780ec0[_0x94ed('0x67')][0x3]?_0x780ec0[_0x94ed('0x67')][0x3][_0x94ed('0x68')]:undefined)||[]},{'name':_0x94ed('0x73'),'value':_0x780ec0[_0x94ed('0x73')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x4]?_0x780ec0['attrs'][0x4][_0x94ed('0x68')]:undefined)||_0x94ed('0x74')},{'name':_0x94ed('0x75'),'value':_0x780ec0['attrEmailAccounts']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x5]?_0x780ec0[_0x94ed('0x67')][0x5][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x76'),'value':_0x780ec0[_0x94ed('0x76')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x6]?_0x780ec0[_0x94ed('0x67')][0x6][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x77'),'value':_0x780ec0[_0x94ed('0x77')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x7]?_0x780ec0[_0x94ed('0x67')][0x7][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x78'),'value':_0x780ec0[_0x94ed('0x78')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x8]?_0x780ec0[_0x94ed('0x67')][0x8][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x79'),'value':_0x780ec0[_0x94ed('0x79')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0['attrs'][0x9]?_0x780ec0[_0x94ed('0x67')][0x9][_0x94ed('0x68')]:undefined)||''},{'name':_0x94ed('0x7a'),'value':_0x780ec0[_0x94ed('0x7a')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0xa]?_0x780ec0['attrs'][0xa][_0x94ed('0x68')]:undefined)||''}];case _0x94ed('0x7f'):return[{'name':_0x94ed('0x80'),'type':_0x780ec0[_0x94ed('0x81')]||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x0]?_0x780ec0['attrs'][0x0][_0x94ed('0x3b')]:undefined)||null,'value':_0x780ec0['attrReport']||(_0x780ec0['attrs']&&_0x780ec0['attrs'][0x0]?_0x780ec0[_0x94ed('0x67')][0x0][_0x94ed('0x68')]:undefined)||null},{'name':_0x94ed('0x82'),'value':_0x780ec0['attrRefresh']||(_0x780ec0[_0x94ed('0x67')]&&_0x780ec0[_0x94ed('0x67')][0x1]?_0x780ec0['attrs'][0x1][_0x94ed('0x68')]:undefined)||0x0}];default:return[];}}catch(_0x542550){logger[_0x94ed('0x5e')](_0x94ed('0x83'),JSON[_0x94ed('0x84')](_0x542550));return[];}}exports['addItem']=function(_0x253d77,_0x41f91b,_0x272e99){if(_0x253d77[_0x94ed('0x58')]['id']){delete _0x253d77[_0x94ed('0x58')]['id'];}return db[_0x94ed('0x38')]['find']({'where':{'id':_0x253d77['params']['id']}})[_0x94ed('0x2f')](handleEntityNotFound(_0x41f91b,null))[_0x94ed('0x2f')](function(_0x1b87e8){if(_0x1b87e8){_0x253d77[_0x94ed('0x58')][_0x94ed('0x85')]=_0x1b87e8['id'];_0x253d77[_0x94ed('0x58')][_0x94ed('0x67')]=widgetAttributes(_0x253d77[_0x94ed('0x58')]);return db['DashboardItem'][_0x94ed('0x57')](_0x253d77[_0x94ed('0x58')]);}})[_0x94ed('0x2f')](respondWithResult(_0x41f91b,null))[_0x94ed('0x53')](handleError(_0x41f91b,null));};exports[_0x94ed('0x86')]=function(_0x1cf907,_0x23ec91,_0x14e6d9){var _0x6b8e80={};var _0x2ceac8={};var _0x17d08d;var _0x30c33a;return db[_0x94ed('0x38')][_0x94ed('0x87')]({'where':{'id':_0x1cf907[_0x94ed('0x55')]['id']}})['then'](handleEntityNotFound(_0x23ec91,null))[_0x94ed('0x2f')](function(_0x54cb3c){if(_0x54cb3c){_0x17d08d=_0x54cb3c;_0x2ceac8[_0x94ed('0x41')]=_[_0x94ed('0x3f')](db['DashboardItem'][_0x94ed('0x39')]);_0x2ceac8['query']=_[_0x94ed('0x3f')](_0x1cf907[_0x94ed('0x3e')]);_0x2ceac8[_0x94ed('0x49')]=_[_0x94ed('0x40')](_0x2ceac8[_0x94ed('0x41')],_0x2ceac8[_0x94ed('0x3e')]);_0x6b8e80[_0x94ed('0x43')]=_[_0x94ed('0x40')](_0x2ceac8[_0x94ed('0x41')],qs['fields'](_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x42')]));_0x6b8e80['attributes']=_0x6b8e80[_0x94ed('0x43')][_0x94ed('0x44')]?_0x6b8e80[_0x94ed('0x43')]:_0x2ceac8['model'];_0x6b8e80[_0x94ed('0x47')]=qs[_0x94ed('0x48')](_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x48')]);_0x6b8e80[_0x94ed('0x4c')]=qs[_0x94ed('0x49')](_[_0x94ed('0x4a')](_0x1cf907[_0x94ed('0x3e')],_0x2ceac8[_0x94ed('0x49')]));if(_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x4b')]){_0x6b8e80['where']=_[_0x94ed('0x4d')](_0x6b8e80[_0x94ed('0x4c')],{'$or':_[_0x94ed('0x37')](_0x6b8e80['attributes'],function(_0x2b9913){var _0x515a94={};_0x515a94[_0x2b9913]={'$like':'%'+_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x4b')]+'%'};return _0x515a94;})});}_0x6b8e80=_[_0x94ed('0x4d')]({},_0x6b8e80,_0x1cf907['options']);return _0x17d08d[_0x94ed('0x86')](_0x6b8e80);}})[_0x94ed('0x2f')](function(_0x131727){if(_0x131727){_0x30c33a=_0x131727['length'];if(!_0x1cf907[_0x94ed('0x3e')]['hasOwnProperty'](_0x94ed('0x46'))){_0x6b8e80[_0x94ed('0x27')]=qs[_0x94ed('0x27')](_0x1cf907[_0x94ed('0x3e')]['limit']);_0x6b8e80[_0x94ed('0x25')]=qs[_0x94ed('0x25')](_0x1cf907[_0x94ed('0x3e')][_0x94ed('0x25')]);}return _0x17d08d[_0x94ed('0x86')](_0x6b8e80);}})[_0x94ed('0x2f')](function(_0x36462f){if(_0x36462f){return _0x36462f?{'count':_0x30c33a,'rows':_0x36462f}:null;}})[_0x94ed('0x2f')](respondWithResult(_0x23ec91,null))[_0x94ed('0x53')](handleError(_0x23ec91,null));}; \ No newline at end of file +var _0x2a6e=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','json','offset','undefined','count','limit','status','set','reject','save','update','then','CustomDashboards','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dashboard','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','get','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','length','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment'];(function(_0x54b38d,_0x59a295){var _0x3bb947=function(_0x235502){while(--_0x235502){_0x54b38d['push'](_0x54b38d['shift']());}};_0x3bb947(++_0x59a295);}(_0x2a6e,0x1d3));var _0xe2a6=function(_0x125917,_0x2b0777){_0x125917=_0x125917-0x0;var _0x228551=_0x2a6e[_0x125917];return _0x228551;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2a6('0x0'));var zipdir=require(_0xe2a6('0x1'));var jsonpatch=require(_0xe2a6('0x2'));var rp=require('request-promise');var moment=require(_0xe2a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2a6('0x4'));var util=require(_0xe2a6('0x5'));var path=require('path');var sox=require(_0xe2a6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2a6('0x7'));var _=require(_0xe2a6('0x8'));var squel=require(_0xe2a6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe2a6('0xa'));var toCsv=require(_0xe2a6('0xb'));var querystring=require(_0xe2a6('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2a6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe2a6('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe2a6('0xf'));var config=require(_0xe2a6('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2a6('0x11'))['db'];config[_0xe2a6('0x12')]=_[_0xe2a6('0x13')](config[_0xe2a6('0x12')],{'host':_0xe2a6('0x14'),'port':0x18eb});var socket=require(_0xe2a6('0x15'))(new Redis(config[_0xe2a6('0x12')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x134a74,_0x2326ef){_0x2326ef=_0x2326ef||0xcc;return function(_0x4298ef){if(_0x4298ef){return _0x134a74['sendStatus'](_0x2326ef);}return _0x134a74['status'](_0x2326ef)[_0xe2a6('0x16')]();};}function respondWithResult(_0x3c9173,_0x2176e7){_0x2176e7=_0x2176e7||0xc8;return function(_0xb986e6){if(_0xb986e6){return _0x3c9173['status'](_0x2176e7)[_0xe2a6('0x17')](_0xb986e6);}};}function respondWithFilteredResult(_0x2ce67d,_0x4ff4a0){return function(_0x4ffe04){if(_0x4ffe04){var _0x30a815=typeof _0x4ff4a0[_0xe2a6('0x18')]===_0xe2a6('0x19')&&typeof _0x4ff4a0['limit']===_0xe2a6('0x19');var _0x451761=_0x4ffe04[_0xe2a6('0x1a')];var _0x2f5e59=_0x30a815?0x0:_0x4ff4a0[_0xe2a6('0x18')];var _0x16bdf1=_0x30a815?_0x4ffe04['count']:_0x4ff4a0[_0xe2a6('0x18')]+_0x4ff4a0[_0xe2a6('0x1b')];var _0x172ea7;if(_0x16bdf1>=_0x451761){_0x16bdf1=_0x451761;_0x172ea7=0xc8;}else{_0x172ea7=0xce;}_0x2ce67d[_0xe2a6('0x1c')](_0x172ea7);return _0x2ce67d[_0xe2a6('0x1d')]('Content-Range',_0x2f5e59+'-'+_0x16bdf1+'/'+_0x451761)['json'](_0x4ffe04);}return null;};}function patchUpdates(_0x3e4918){return function(_0xc28d03){try{jsonpatch['apply'](_0xc28d03,_0x3e4918,!![]);}catch(_0x1f520a){return BPromise[_0xe2a6('0x1e')](_0x1f520a);}return _0xc28d03[_0xe2a6('0x1f')]();};}function saveUpdates(_0x2960d0,_0x43b2e9){return function(_0x2b3266){if(_0x2b3266){return _0x2b3266[_0xe2a6('0x20')](_0x2960d0)[_0xe2a6('0x21')](function(_0x1393fd){return _0x1393fd;});}return null;};}function removeEntity(_0x439b75,_0x2d3e43){return function(_0xfc2696){if(_0xfc2696){return _0xfc2696['destroy']()[_0xe2a6('0x21')](function(){var _0x4c82e2=_0xfc2696['get']({'plain':!![]});var _0x561422=_0xe2a6('0x22');return db[_0xe2a6('0x23')][_0xe2a6('0x24')]({'where':{'type':_0x561422,'resourceId':_0x4c82e2['id']}})['then'](function(){return _0xfc2696;});})['then'](function(){_0x439b75[_0xe2a6('0x1c')](0xcc)[_0xe2a6('0x16')]();});}};}function handleEntityNotFound(_0x5bcee0,_0x56f2ec){return function(_0x20e52d){if(!_0x20e52d){_0x5bcee0[_0xe2a6('0x25')](0x194);}return _0x20e52d;};}function handleError(_0x24b4e3,_0x436a31){_0x436a31=_0x436a31||0x1f4;return function(_0x48e8d4){logger[_0xe2a6('0x26')](_0x48e8d4[_0xe2a6('0x27')]);if(_0x48e8d4[_0xe2a6('0x28')]){delete _0x48e8d4['name'];}_0x24b4e3[_0xe2a6('0x1c')](_0x436a31)['send'](_0x48e8d4);};}exports[_0xe2a6('0x29')]=function(_0x3e4bad,_0x98e02){var _0xb090c0={},_0x45fdf2={},_0x5cec7f={'count':0x0,'rows':[]};var _0x4a0241=_[_0xe2a6('0x2a')](db['Dashboard']['rawAttributes'],function(_0x12216a){return{'name':_0x12216a[_0xe2a6('0x2b')],'type':_0x12216a[_0xe2a6('0x2c')]['key']};});_0x45fdf2[_0xe2a6('0x2d')]=_[_0xe2a6('0x2a')](_0x4a0241,_0xe2a6('0x28'));_0x45fdf2['query']=_[_0xe2a6('0x2e')](_0x3e4bad[_0xe2a6('0x2f')]);_0x45fdf2[_0xe2a6('0x30')]=_['intersection'](_0x45fdf2['model'],_0x45fdf2[_0xe2a6('0x2f')]);_0xb090c0[_0xe2a6('0x31')]=_[_0xe2a6('0x32')](_0x45fdf2['model'],qs[_0xe2a6('0x33')](_0x3e4bad[_0xe2a6('0x2f')][_0xe2a6('0x33')]));_0xb090c0[_0xe2a6('0x31')]=_0xb090c0[_0xe2a6('0x31')]['length']?_0xb090c0[_0xe2a6('0x31')]:_0x45fdf2[_0xe2a6('0x2d')];if(!_0x3e4bad[_0xe2a6('0x2f')][_0xe2a6('0x34')](_0xe2a6('0x35'))){_0xb090c0['limit']=qs[_0xe2a6('0x1b')](_0x3e4bad['query'][_0xe2a6('0x1b')]);_0xb090c0[_0xe2a6('0x18')]=qs[_0xe2a6('0x18')](_0x3e4bad[_0xe2a6('0x2f')][_0xe2a6('0x18')]);}_0xb090c0[_0xe2a6('0x36')]=qs[_0xe2a6('0x37')](_0x3e4bad[_0xe2a6('0x2f')][_0xe2a6('0x37')]);_0xb090c0[_0xe2a6('0x38')]=qs[_0xe2a6('0x30')](_['pick'](_0x3e4bad[_0xe2a6('0x2f')],_0x45fdf2['filters']),_0x4a0241);if(_0x3e4bad[_0xe2a6('0x2f')][_0xe2a6('0x39')]){_0xb090c0[_0xe2a6('0x38')]=_[_0xe2a6('0x3a')](_0xb090c0[_0xe2a6('0x38')],{'$or':_[_0xe2a6('0x2a')](_0x4a0241,function(_0x4f271f){if(_0x4f271f['type']!==_0xe2a6('0x3b')){var _0x1f88f1={};_0x1f88f1[_0x4f271f['name']]={'$like':'%'+_0x3e4bad['query'][_0xe2a6('0x39')]+'%'};return _0x1f88f1;}})});}_0xb090c0=_[_0xe2a6('0x3a')]({},_0xb090c0,_0x3e4bad[_0xe2a6('0x3c')]);var _0x3d45cc={'where':_0xb090c0[_0xe2a6('0x38')]};return db[_0xe2a6('0x3d')][_0xe2a6('0x1a')](_0x3d45cc)['then'](function(_0x45c284){_0x5cec7f[_0xe2a6('0x1a')]=_0x45c284;if(_0x3e4bad[_0xe2a6('0x2f')][_0xe2a6('0x3e')]){_0xb090c0['include']=[{'all':!![]}];}return db[_0xe2a6('0x3d')][_0xe2a6('0x3f')](_0xb090c0);})[_0xe2a6('0x21')](function(_0x48172a){_0x5cec7f['rows']=_0x48172a;return _0x5cec7f;})[_0xe2a6('0x21')](respondWithFilteredResult(_0x98e02,_0xb090c0))[_0xe2a6('0x40')](handleError(_0x98e02,null));};exports[_0xe2a6('0x41')]=function(_0x5c436d,_0x1d3432){var _0x43e94d={'raw':![],'where':{'id':_0x5c436d['params']['id']}},_0x1f7c49={};_0x1f7c49['model']=_[_0xe2a6('0x2e')](db['Dashboard'][_0xe2a6('0x42')]);_0x1f7c49['query']=_['keys'](_0x5c436d[_0xe2a6('0x2f')]);_0x1f7c49[_0xe2a6('0x30')]=_[_0xe2a6('0x32')](_0x1f7c49[_0xe2a6('0x2d')],_0x1f7c49[_0xe2a6('0x2f')]);_0x43e94d[_0xe2a6('0x31')]=_[_0xe2a6('0x32')](_0x1f7c49[_0xe2a6('0x2d')],qs[_0xe2a6('0x33')](_0x5c436d['query'][_0xe2a6('0x33')]));_0x43e94d[_0xe2a6('0x31')]=_0x43e94d[_0xe2a6('0x31')]['length']?_0x43e94d[_0xe2a6('0x31')]:_0x1f7c49[_0xe2a6('0x2d')];if(_0x5c436d[_0xe2a6('0x2f')][_0xe2a6('0x3e')]){_0x43e94d[_0xe2a6('0x43')]=[{'all':!![]}];}_0x43e94d=_['merge']({},_0x43e94d,_0x5c436d[_0xe2a6('0x3c')]);return db[_0xe2a6('0x3d')][_0xe2a6('0x44')](_0x43e94d)[_0xe2a6('0x21')](handleEntityNotFound(_0x1d3432,null))[_0xe2a6('0x21')](respondWithResult(_0x1d3432,null))['catch'](handleError(_0x1d3432,null));};exports[_0xe2a6('0x45')]=function(_0x133f16,_0x2cd8ad){return db['Dashboard'][_0xe2a6('0x45')](_0x133f16[_0xe2a6('0x46')],{})['then'](function(_0x25543d){var _0x341f64=_0x133f16[_0xe2a6('0x47')]['get']({'plain':!![]});if(!_0x341f64)throw new Error(_0xe2a6('0x48'));if(_0x341f64['role']==='user'){var _0x1dbe8c=_0x25543d['get']({'plain':!![]});var _0x32fce4='CustomDashboards';return db[_0xe2a6('0x49')][_0xe2a6('0x44')]({'where':{'name':_0x32fce4,'userProfileId':_0x341f64[_0xe2a6('0x4a')]},'raw':!![]})['then'](function(_0x38155a){if(_0x38155a&&_0x38155a['autoAssociation']===0x0){return db[_0xe2a6('0x23')][_0xe2a6('0x45')]({'name':_0x1dbe8c[_0xe2a6('0x28')],'resourceId':_0x1dbe8c['id'],'type':_0x38155a[_0xe2a6('0x28')],'sectionId':_0x38155a['id']},{})[_0xe2a6('0x21')](function(){return _0x25543d;});}else{return _0x25543d;}})[_0xe2a6('0x40')](function(_0x37d8f8){logger['error'](_0xe2a6('0x4b'),_0x37d8f8);throw _0x37d8f8;});}return _0x25543d;})[_0xe2a6('0x21')](respondWithResult(_0x2cd8ad,0xc9))[_0xe2a6('0x40')](handleError(_0x2cd8ad,null));};exports[_0xe2a6('0x4c')]=function(_0x51fe30,_0x5022bc){var _0x125263={'where':{'id':_0x51fe30[_0xe2a6('0x4d')]['id']}},_0x222092={};_0x222092[_0xe2a6('0x2d')]=_[_0xe2a6('0x2e')](db[_0xe2a6('0x3d')]['rawAttributes']);_0x125263[_0xe2a6('0x31')]=_['intersection'](_0x222092[_0xe2a6('0x2d')],qs[_0xe2a6('0x33')](_0x51fe30[_0xe2a6('0x2f')][_0xe2a6('0x33')]));_0x125263[_0xe2a6('0x31')]=_0x125263[_0xe2a6('0x31')]['length']?_0x125263[_0xe2a6('0x31')]:_0x222092[_0xe2a6('0x2d')];if(_0x51fe30[_0xe2a6('0x2f')][_0xe2a6('0x3e')]){_0x125263[_0xe2a6('0x43')]=[{'all':!![]}];}_0x125263=_[_0xe2a6('0x3a')]({},_0x125263,_0x51fe30['options']);return db[_0xe2a6('0x3d')][_0xe2a6('0x44')](_0x125263)[_0xe2a6('0x21')](handleEntityNotFound(_0x5022bc,null))['then'](function(_0x4004e2){if(_0x4004e2){var _0x29c2ec=_0x4004e2[_0xe2a6('0x4e')]({'plain':!![]});_0x29c2ec=qs[_0xe2a6('0x4f')](_0x29c2ec,['id',_0xe2a6('0x50'),_0xe2a6('0x51')]);_0x51fe30[_0xe2a6('0x46')]=_[_0xe2a6('0x4f')](_0x51fe30[_0xe2a6('0x46')],['id','createdAt',_0xe2a6('0x51')]);return db[_0xe2a6('0x3d')][_0xe2a6('0x45')](_[_0xe2a6('0x3a')](_0x29c2ec,_0x51fe30[_0xe2a6('0x46')]),{'include':_0x51fe30[_0xe2a6('0x2f')][_0xe2a6('0x3e')]?[{'all':!![]}]:undefined})[_0xe2a6('0x21')](function(_0x13f003){var _0x332b55=_0x51fe30[_0xe2a6('0x47')][_0xe2a6('0x4e')]({'plain':!![]});if(!_0x332b55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x332b55[_0xe2a6('0x52')]===_0xe2a6('0x47')){var _0x170bb5=_0x13f003[_0xe2a6('0x4e')]({'plain':!![]});var _0x4db600='CustomDashboards';return db[_0xe2a6('0x49')][_0xe2a6('0x44')]({'where':{'name':_0x4db600,'userProfileId':_0x332b55['userProfileId']},'raw':!![]})['then'](function(_0x4b9662){if(_0x4b9662&&_0x4b9662['autoAssociation']===0x0){return db[_0xe2a6('0x23')][_0xe2a6('0x45')]({'name':_0x170bb5[_0xe2a6('0x28')],'resourceId':_0x170bb5['id'],'type':_0x4b9662[_0xe2a6('0x28')],'sectionId':_0x4b9662['id']},{})['then'](function(){return _0x13f003;});}else{return _0x13f003;}})[_0xe2a6('0x40')](function(_0x281c41){logger['error'](_0xe2a6('0x4b'),_0x281c41);throw _0x281c41;});}return _0x13f003;});}})[_0xe2a6('0x21')](respondWithResult(_0x5022bc,0xc9))[_0xe2a6('0x40')](handleError(_0x5022bc,null));};exports[_0xe2a6('0x20')]=function(_0x3c66a7,_0x56ba7d){if(_0x3c66a7[_0xe2a6('0x46')]['id']){delete _0x3c66a7[_0xe2a6('0x46')]['id'];}return db[_0xe2a6('0x3d')][_0xe2a6('0x44')]({'where':{'id':_0x3c66a7['params']['id']}})[_0xe2a6('0x21')](handleEntityNotFound(_0x56ba7d,null))[_0xe2a6('0x21')](saveUpdates(_0x3c66a7[_0xe2a6('0x46')],null))[_0xe2a6('0x21')](respondWithResult(_0x56ba7d,null))[_0xe2a6('0x40')](handleError(_0x56ba7d,null));};exports[_0xe2a6('0x24')]=function(_0x4bf3dc,_0x18c44e){return db['Dashboard'][_0xe2a6('0x44')]({'where':{'id':_0x4bf3dc['params']['id']}})['then'](handleEntityNotFound(_0x18c44e,null))[_0xe2a6('0x21')](removeEntity(_0x18c44e,null))['catch'](handleError(_0x18c44e,null));};function widgetAttributes(_0x361291){try{switch(_0x361291[_0xe2a6('0x2c')]){case _0xe2a6('0x53'):return[{'name':_0xe2a6('0x54'),'value':_0x361291[_0xe2a6('0x54')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x0]?_0x361291[_0xe2a6('0x55')][0x0][_0xe2a6('0x56')]:undefined)||'https://'}];case _0xe2a6('0x57'):return[{'name':_0xe2a6('0x58'),'value':_0x361291[_0xe2a6('0x58')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x0]?_0x361291[_0xe2a6('0x55')][0x0][_0xe2a6('0x56')]:undefined)||''}];case _0xe2a6('0x59'):return[{'name':_0xe2a6('0x5a'),'value':_0x361291[_0xe2a6('0x5a')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x0]?_0x361291['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xe2a6('0x5b'),'value':_0x361291[_0xe2a6('0x5b')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x1]?_0x361291['attrs'][0x1][_0xe2a6('0x56')]:undefined)||_0xe2a6('0x5c')},{'name':_0xe2a6('0x5d'),'value':_0x361291['attrFontSize']||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x2]?_0x361291['attrs'][0x2][_0xe2a6('0x56')]:undefined)||0xc}];case _0xe2a6('0x5e'):return[{'name':_0xe2a6('0x5f'),'value':_0x361291[_0xe2a6('0x5f')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x0]?_0x361291['attrs'][0x0][_0xe2a6('0x56')]:undefined)||_0xe2a6('0x60')},{'name':_0xe2a6('0x61'),'value':_0x361291[_0xe2a6('0x61')]||(_0x361291['attrs']&&_0x361291['attrs'][0x1]?_0x361291[_0xe2a6('0x55')][0x1][_0xe2a6('0x56')]:undefined)||[]},{'name':_0xe2a6('0x5d'),'value':_0x361291[_0xe2a6('0x5d')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x2]?_0x361291[_0xe2a6('0x55')][0x2][_0xe2a6('0x56')]:undefined)||0x14},{'name':_0xe2a6('0x62'),'value':_0x361291[_0xe2a6('0x62')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x3]?_0x361291[_0xe2a6('0x55')][0x3]['value']:undefined)||_0xe2a6('0x63')},{'name':_0xe2a6('0x64'),'value':_0x361291[_0xe2a6('0x64')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x4]?_0x361291['attrs'][0x4][_0xe2a6('0x56')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x361291[_0xe2a6('0x65')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x5]?_0x361291[_0xe2a6('0x55')][0x5]['value']:undefined)||''},{'name':_0xe2a6('0x66'),'value':_0x361291[_0xe2a6('0x66')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x6]?_0x361291['attrs'][0x6][_0xe2a6('0x56')]:undefined)||''},{'name':_0xe2a6('0x67'),'value':_0x361291[_0xe2a6('0x67')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x7]?_0x361291[_0xe2a6('0x55')][0x7][_0xe2a6('0x56')]:undefined)||''},{'name':_0xe2a6('0x68'),'value':_0x361291[_0xe2a6('0x68')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x8]?_0x361291[_0xe2a6('0x55')][0x8][_0xe2a6('0x56')]:undefined)||''},{'name':_0xe2a6('0x69'),'value':_0x361291[_0xe2a6('0x69')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x9]?_0x361291[_0xe2a6('0x55')][0x9][_0xe2a6('0x56')]:undefined)||''}];case _0xe2a6('0x6a'):case _0xe2a6('0x6b'):return[{'name':'attrSerie1','value':_0x361291[_0xe2a6('0x6c')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x0]?_0x361291[_0xe2a6('0x55')][0x0][_0xe2a6('0x56')]:undefined)||_0xe2a6('0x60')},{'name':_0xe2a6('0x6d'),'value':_0x361291[_0xe2a6('0x6d')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x1]?_0x361291[_0xe2a6('0x55')][0x1][_0xe2a6('0x56')]:undefined)||null},{'name':'attrSerie3','value':_0x361291[_0xe2a6('0x6e')]||(_0x361291['attrs']&&_0x361291['attrs'][0x2]?_0x361291['attrs'][0x2][_0xe2a6('0x56')]:undefined)||null},{'name':_0xe2a6('0x61'),'value':_0x361291[_0xe2a6('0x61')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x3]?_0x361291[_0xe2a6('0x55')][0x3][_0xe2a6('0x56')]:undefined)||[]},{'name':_0xe2a6('0x62'),'value':_0x361291[_0xe2a6('0x62')]||(_0x361291['attrs']&&_0x361291[_0xe2a6('0x55')][0x4]?_0x361291['attrs'][0x4][_0xe2a6('0x56')]:undefined)||_0xe2a6('0x63')},{'name':'attrEmailAccounts','value':_0x361291[_0xe2a6('0x64')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x5]?_0x361291[_0xe2a6('0x55')][0x5][_0xe2a6('0x56')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x361291[_0xe2a6('0x65')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x6]?_0x361291[_0xe2a6('0x55')][0x6][_0xe2a6('0x56')]:undefined)||''},{'name':_0xe2a6('0x66'),'value':_0x361291[_0xe2a6('0x66')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x7]?_0x361291[_0xe2a6('0x55')][0x7][_0xe2a6('0x56')]:undefined)||''},{'name':_0xe2a6('0x67'),'value':_0x361291[_0xe2a6('0x67')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x8]?_0x361291['attrs'][0x8][_0xe2a6('0x56')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x361291[_0xe2a6('0x68')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291['attrs'][0x9]?_0x361291[_0xe2a6('0x55')][0x9]['value']:undefined)||''},{'name':_0xe2a6('0x69'),'value':_0x361291[_0xe2a6('0x69')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0xa]?_0x361291[_0xe2a6('0x55')][0xa][_0xe2a6('0x56')]:undefined)||''}];case'web-report':return[{'name':_0xe2a6('0x6f'),'type':_0x361291['reportType']||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x0]?_0x361291[_0xe2a6('0x55')][0x0][_0xe2a6('0x2c')]:undefined)||null,'value':_0x361291['attrReport']||(_0x361291['attrs']&&_0x361291['attrs'][0x0]?_0x361291[_0xe2a6('0x55')][0x0][_0xe2a6('0x56')]:undefined)||null},{'name':'attrRefresh','value':_0x361291[_0xe2a6('0x70')]||(_0x361291[_0xe2a6('0x55')]&&_0x361291[_0xe2a6('0x55')][0x1]?_0x361291[_0xe2a6('0x55')][0x1][_0xe2a6('0x56')]:undefined)||0x0}];default:return[];}}catch(_0x46f429){logger[_0xe2a6('0x26')](_0xe2a6('0x71'),JSON[_0xe2a6('0x72')](_0x46f429));return[];}}exports[_0xe2a6('0x73')]=function(_0x1c71d5,_0xc26c4f,_0x299716){if(_0x1c71d5[_0xe2a6('0x46')]['id']){delete _0x1c71d5[_0xe2a6('0x46')]['id'];}return db[_0xe2a6('0x3d')]['find']({'where':{'id':_0x1c71d5[_0xe2a6('0x4d')]['id']}})[_0xe2a6('0x21')](handleEntityNotFound(_0xc26c4f,null))[_0xe2a6('0x21')](function(_0xc0f84b){if(_0xc0f84b){_0x1c71d5[_0xe2a6('0x46')][_0xe2a6('0x74')]=_0xc0f84b['id'];_0x1c71d5[_0xe2a6('0x46')][_0xe2a6('0x55')]=widgetAttributes(_0x1c71d5[_0xe2a6('0x46')]);return db[_0xe2a6('0x75')][_0xe2a6('0x45')](_0x1c71d5[_0xe2a6('0x46')]);}})[_0xe2a6('0x21')](respondWithResult(_0xc26c4f,null))[_0xe2a6('0x40')](handleError(_0xc26c4f,null));};exports[_0xe2a6('0x76')]=function(_0x12e1dd,_0x45d53c,_0x3972c3){var _0x4d7a15={};var _0x252a65={};var _0x950ca;var _0x1c789f;return db[_0xe2a6('0x3d')][_0xe2a6('0x77')]({'where':{'id':_0x12e1dd['params']['id']}})['then'](handleEntityNotFound(_0x45d53c,null))[_0xe2a6('0x21')](function(_0x2fdb79){if(_0x2fdb79){_0x950ca=_0x2fdb79;_0x252a65[_0xe2a6('0x2d')]=_[_0xe2a6('0x2e')](db['DashboardItem']['rawAttributes']);_0x252a65['query']=_['keys'](_0x12e1dd[_0xe2a6('0x2f')]);_0x252a65['filters']=_[_0xe2a6('0x32')](_0x252a65[_0xe2a6('0x2d')],_0x252a65['query']);_0x4d7a15[_0xe2a6('0x31')]=_[_0xe2a6('0x32')](_0x252a65[_0xe2a6('0x2d')],qs[_0xe2a6('0x33')](_0x12e1dd[_0xe2a6('0x2f')][_0xe2a6('0x33')]));_0x4d7a15[_0xe2a6('0x31')]=_0x4d7a15['attributes'][_0xe2a6('0x78')]?_0x4d7a15[_0xe2a6('0x31')]:_0x252a65[_0xe2a6('0x2d')];_0x4d7a15[_0xe2a6('0x36')]=qs[_0xe2a6('0x37')](_0x12e1dd['query']['sort']);_0x4d7a15[_0xe2a6('0x38')]=qs[_0xe2a6('0x30')](_['pick'](_0x12e1dd[_0xe2a6('0x2f')],_0x252a65[_0xe2a6('0x30')]));if(_0x12e1dd[_0xe2a6('0x2f')]['filter']){_0x4d7a15[_0xe2a6('0x38')]=_[_0xe2a6('0x3a')](_0x4d7a15[_0xe2a6('0x38')],{'$or':_['map'](_0x4d7a15[_0xe2a6('0x31')],function(_0x451d7f){var _0x14e53d={};_0x14e53d[_0x451d7f]={'$like':'%'+_0x12e1dd[_0xe2a6('0x2f')][_0xe2a6('0x39')]+'%'};return _0x14e53d;})});}_0x4d7a15=_[_0xe2a6('0x3a')]({},_0x4d7a15,_0x12e1dd[_0xe2a6('0x3c')]);return _0x950ca[_0xe2a6('0x76')](_0x4d7a15);}})['then'](function(_0x5b7635){if(_0x5b7635){_0x1c789f=_0x5b7635[_0xe2a6('0x78')];if(!_0x12e1dd[_0xe2a6('0x2f')]['hasOwnProperty'](_0xe2a6('0x35'))){_0x4d7a15['limit']=qs[_0xe2a6('0x1b')](_0x12e1dd[_0xe2a6('0x2f')]['limit']);_0x4d7a15['offset']=qs['offset'](_0x12e1dd[_0xe2a6('0x2f')][_0xe2a6('0x18')]);}return _0x950ca['getItems'](_0x4d7a15);}})[_0xe2a6('0x21')](function(_0x43374b){if(_0x43374b){return _0x43374b?{'count':_0x1c789f,'rows':_0x43374b}:null;}})[_0xe2a6('0x21')](respondWithResult(_0x45d53c,null))[_0xe2a6('0x40')](handleError(_0x45d53c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 2c179d1..f4a2b63 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 _0x0c32=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','remove','emit'];(function(_0x5856e2,_0x936acc){var _0x5ae467=function(_0x59d7a5){while(--_0x59d7a5){_0x5856e2['push'](_0x5856e2['shift']());}};_0x5ae467(++_0x936acc);}(_0x0c32,0x158));var _0x20c3=function(_0x4e31e1,_0x593f5b){_0x4e31e1=_0x4e31e1-0x0;var _0x2a2ad1=_0x0c32[_0x4e31e1];return _0x2a2ad1;};'use strict';var EventEmitter=require(_0x20c3('0x0'));var Dashboard=require(_0x20c3('0x1'))['db'][_0x20c3('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x20c3('0x3')](0x0);var events={'afterCreate':_0x20c3('0x4'),'afterUpdate':'update','afterDestroy':_0x20c3('0x5')};function emitEvent(_0x58f349){return function(_0x16e633,_0x2da504,_0x1cffb3){DashboardEvents[_0x20c3('0x6')](_0x58f349+':'+_0x16e633['id'],_0x16e633);DashboardEvents[_0x20c3('0x6')](_0x58f349,_0x16e633);_0x1cffb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x20c3('0x7')](e,emitEvent(event));}}module[_0x20c3('0x8')]=DashboardEvents; \ No newline at end of file +var _0x5d59=['../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d59,0x15f));var _0x95d5=function(_0x45dbe3,_0xd2bf96){_0x45dbe3=_0x45dbe3-0x0;var _0x1e71cf=_0x5d59[_0x45dbe3];return _0x1e71cf;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x95d5('0x0'))['db'][_0x95d5('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x95d5('0x2')](0x0);var events={'afterCreate':_0x95d5('0x3'),'afterUpdate':_0x95d5('0x4'),'afterDestroy':_0x95d5('0x5')};function emitEvent(_0x524752){return function(_0x133b43,_0x502a01,_0x4d4652){DashboardEvents[_0x95d5('0x6')](_0x524752+':'+_0x133b43['id'],_0x133b43);DashboardEvents['emit'](_0x524752,_0x133b43);_0x4d4652(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x95d5('0x7')](e,emitEvent(event));}}module[_0x95d5('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 3b015ec..6fc335c 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 _0xa273=['path','rimraf','../../config/environment','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x607a68,_0x48c96c){var _0x4995ce=function(_0x93b724){while(--_0x93b724){_0x607a68['push'](_0x607a68['shift']());}};_0x4995ce(++_0x48c96c);}(_0xa273,0x1d5));var _0x3a27=function(_0x40e4ef,_0xa1ba40){_0x40e4ef=_0x40e4ef-0x0;var _0x637f65=_0xa273[_0x40e4ef];return _0x637f65;};'use strict';var _=require(_0x3a27('0x0'));var util=require(_0x3a27('0x1'));var logger=require(_0x3a27('0x2'))(_0x3a27('0x3'));var moment=require(_0x3a27('0x4'));var BPromise=require(_0x3a27('0x5'));var rp=require(_0x3a27('0x6'));var fs=require('fs');var path=require(_0x3a27('0x7'));var rimraf=require(_0x3a27('0x8'));var config=require(_0x3a27('0x9'));var attributes=require('./dashboard.attributes');module[_0x3a27('0xa')]=function(_0xf9418d,_0x530abf){return _0xf9418d[_0x3a27('0xb')](_0x3a27('0xc'),attributes,{'tableName':_0x3a27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0086=['lodash','util','../../config/logger','api','moment','request-promise','path','./dashboard.attributes','exports','define','Dashboard','dashboards'];(function(_0x228a5a,_0x1ba978){var _0x1f1555=function(_0x134d0d){while(--_0x134d0d){_0x228a5a['push'](_0x228a5a['shift']());}};_0x1f1555(++_0x1ba978);}(_0x0086,0xc0));var _0x6008=function(_0x184977,_0x35c667){_0x184977=_0x184977-0x0;var _0x173f5e=_0x0086[_0x184977];return _0x173f5e;};'use strict';var _=require(_0x6008('0x0'));var util=require(_0x6008('0x1'));var logger=require(_0x6008('0x2'))(_0x6008('0x3'));var moment=require(_0x6008('0x4'));var BPromise=require('bluebird');var rp=require(_0x6008('0x5'));var fs=require('fs');var path=require(_0x6008('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6008('0x7'));module[_0x6008('0x8')]=function(_0x328428,_0x339ed4){return _0x328428[_0x6008('0x9')](_0x6008('0xa'),attributes,{'tableName':_0x6008('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 f39558d..393c252 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 _0xe9ab=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xe9ab,0xdb));var _0xbe9a=function(_0x32447f,_0x383fa1){_0x32447f=_0x32447f-0x0;var _0x2d6432=_0xe9ab[_0x32447f];return _0x2d6432;};'use strict';var _=require(_0xbe9a('0x0'));var util=require(_0xbe9a('0x1'));var moment=require(_0xbe9a('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe9a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe9a('0x4'));var config=require('../../config/environment');var jayson=require(_0xbe9a('0x5'));var client=jayson['client'][_0xbe9a('0x6')]({'port':0x232a});config[_0xbe9a('0x7')]=_[_0xbe9a('0x8')](config['redis'],{'host':_0xbe9a('0x9'),'port':0x18eb});var socket=require(_0xbe9a('0xa'))(new Redis(config[_0xbe9a('0x7')]));require(_0xbe9a('0xb'))[_0xbe9a('0xc')](socket);function respondWithRpcPromise(_0x2880f2,_0x357942,_0x5c370d){return new BPromise(function(_0x50a93b,_0x372cb3){return client[_0xbe9a('0xd')](_0x2880f2,_0x5c370d)[_0xbe9a('0xe')](function(_0x33b190){logger[_0xbe9a('0xf')](_0xbe9a('0x10'),_0x357942,_0xbe9a('0x11'));logger[_0xbe9a('0x12')](_0xbe9a('0x13'),_0x357942,_0xbe9a('0x11'),JSON[_0xbe9a('0x14')](_0x33b190));if(_0x33b190['error']){if(_0x33b190['error'][_0xbe9a('0x15')]===0x1f4){logger[_0xbe9a('0x16')](_0xbe9a('0x10'),_0x357942,_0x33b190[_0xbe9a('0x16')][_0xbe9a('0x17')]);return _0x372cb3(_0x33b190[_0xbe9a('0x16')][_0xbe9a('0x17')]);}logger[_0xbe9a('0x16')](_0xbe9a('0x10'),_0x357942,_0x33b190['error'][_0xbe9a('0x17')]);return _0x50a93b(_0x33b190[_0xbe9a('0x16')][_0xbe9a('0x17')]);}else{logger['info'](_0xbe9a('0x10'),_0x357942,_0xbe9a('0x11'));_0x50a93b(_0x33b190[_0xbe9a('0x18')][_0xbe9a('0x17')]);}})[_0xbe9a('0x19')](function(_0x2201c1){logger[_0xbe9a('0x16')](_0xbe9a('0x10'),_0x357942,_0x2201c1);_0x372cb3(_0x2201c1);});});} \ No newline at end of file +var _0x3c89=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x567e99,_0x15191e){var _0x253a37=function(_0x210c15){while(--_0x210c15){_0x567e99['push'](_0x567e99['shift']());}};_0x253a37(++_0x15191e);}(_0x3c89,0xf2));var _0x93c8=function(_0xc1befc,_0x5e2843){_0xc1befc=_0xc1befc-0x0;var _0x4b4c1d=_0x3c89[_0xc1befc];return _0x4b4c1d;};'use strict';var _=require(_0x93c8('0x0'));var util=require('util');var moment=require(_0x93c8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93c8('0x2'));var db=require(_0x93c8('0x3'))['db'];var utils=require(_0x93c8('0x4'));var logger=require(_0x93c8('0x5'))(_0x93c8('0x6'));var config=require(_0x93c8('0x7'));var jayson=require(_0x93c8('0x8'));var client=jayson[_0x93c8('0x9')][_0x93c8('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x93c8('0xb')],{'host':_0x93c8('0xc'),'port':0x18eb});var socket=require(_0x93c8('0xd'))(new Redis(config[_0x93c8('0xb')]));require(_0x93c8('0xe'))[_0x93c8('0xf')](socket);function respondWithRpcPromise(_0x476b24,_0xbfe952,_0xbe64a4){return new BPromise(function(_0x154e39,_0x4e3660){return client[_0x93c8('0x10')](_0x476b24,_0xbe64a4)[_0x93c8('0x11')](function(_0x1c946f){logger[_0x93c8('0x12')](_0x93c8('0x13'),_0xbfe952,_0x93c8('0x14'));logger['debug'](_0x93c8('0x15'),_0xbfe952,_0x93c8('0x14'),JSON[_0x93c8('0x16')](_0x1c946f));if(_0x1c946f[_0x93c8('0x17')]){if(_0x1c946f['error']['code']===0x1f4){logger[_0x93c8('0x17')](_0x93c8('0x13'),_0xbfe952,_0x1c946f['error'][_0x93c8('0x18')]);return _0x4e3660(_0x1c946f[_0x93c8('0x17')][_0x93c8('0x18')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0xbfe952,_0x1c946f[_0x93c8('0x17')][_0x93c8('0x18')]);return _0x154e39(_0x1c946f['error'][_0x93c8('0x18')]);}else{logger[_0x93c8('0x12')](_0x93c8('0x13'),_0xbfe952,_0x93c8('0x14'));_0x154e39(_0x1c946f[_0x93c8('0x19')][_0x93c8('0x18')]);}})[_0x93c8('0x1a')](function(_0xd707fb){logger[_0x93c8('0x17')](_0x93c8('0x13'),_0xbfe952,_0xd707fb);_0x4e3660(_0xd707fb);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 003db1a..0e18b0e 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 _0x53f2=['length','dashboard:','./dashboard.events','remove','emit','removeListener'];(function(_0x84dbc9,_0x804160){var _0x365eea=function(_0x5c11c6){while(--_0x5c11c6){_0x84dbc9['push'](_0x84dbc9['shift']());}};_0x365eea(++_0x804160);}(_0x53f2,0xfe));var _0x253f=function(_0x2e723c,_0x1f383d){_0x2e723c=_0x2e723c-0x0;var _0x2157f8=_0x53f2[_0x2e723c];return _0x2157f8;};'use strict';var DashboardEvents=require(_0x253f('0x0'));var events=['save',_0x253f('0x1'),'update'];function createListener(_0xd0b98a,_0x173b19){return function(_0x18c7fa){_0x173b19[_0x253f('0x2')](_0xd0b98a,_0x18c7fa);};}function removeListener(_0x4c13aa,_0x30c433){return function(){DashboardEvents[_0x253f('0x3')](_0x4c13aa,_0x30c433);};}exports['register']=function(_0x1ad599){for(var _0x422c9a=0x0,_0x581783=events[_0x253f('0x4')];_0x422c9a<_0x581783;_0x422c9a++){var _0x53e271=events[_0x422c9a];var _0x389914=createListener(_0x253f('0x5')+_0x53e271,_0x1ad599);DashboardEvents['on'](_0x53e271,_0x389914);}}; \ No newline at end of file +var _0x5b99=['removeListener','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x150397,_0x258581){var _0x5cadab=function(_0x3052d6){while(--_0x3052d6){_0x150397['push'](_0x150397['shift']());}};_0x5cadab(++_0x258581);}(_0x5b99,0x6b));var _0x95b9=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x5b99[_0x1694f5];return _0x5b4321;};'use strict';var DashboardEvents=require(_0x95b9('0x0'));var events=[_0x95b9('0x1'),_0x95b9('0x2'),_0x95b9('0x3')];function createListener(_0x39fbba,_0x53ade3){return function(_0x48a65d){_0x53ade3[_0x95b9('0x4')](_0x39fbba,_0x48a65d);};}function removeListener(_0x13d55b,_0x4b8747){return function(){DashboardEvents[_0x95b9('0x5')](_0x13d55b,_0x4b8747);};}exports['register']=function(_0x11c4a3){for(var _0x453cfb=0x0,_0x2c9a32=events['length'];_0x453cfb<_0x2c9a32;_0x453cfb++){var _0x2c4481=events[_0x453cfb];var _0x1df425=createListener(_0x95b9('0x6')+_0x2c4481,_0x11c4a3);DashboardEvents['on'](_0x2c4481,_0x1df425);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 06013fe..de618ec 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 _0x77b4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboard.controller','get','index','/:id','isAuthenticated','/:id/items','getItems','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58df2a,_0x47be57){var _0x2900ed=function(_0x9a8a9a){while(--_0x9a8a9a){_0x58df2a['push'](_0x58df2a['shift']());}};_0x2900ed(++_0x47be57);}(_0x77b4,0x105));var _0x477b=function(_0x425755,_0x16e311){_0x425755=_0x425755-0x0;var _0x38c60b=_0x77b4[_0x425755];return _0x38c60b;};'use strict';var multer=require(_0x477b('0x0'));var util=require(_0x477b('0x1'));var path=require(_0x477b('0x2'));var timeout=require(_0x477b('0x3'));var express=require(_0x477b('0x4'));var router=express[_0x477b('0x5')]();var fs_extra=require(_0x477b('0x6'));var auth=require(_0x477b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x477b('0x8'));router[_0x477b('0x9')]('/',auth['isAuthenticated'](),controller[_0x477b('0xa')]);router[_0x477b('0x9')](_0x477b('0xb'),auth[_0x477b('0xc')](),controller['show']);router[_0x477b('0x9')](_0x477b('0xd'),auth['isAuthenticated'](),controller[_0x477b('0xe')]);router[_0x477b('0xf')]('/',auth[_0x477b('0xc')](),controller[_0x477b('0x10')]);router[_0x477b('0xf')]('/:id/clone',auth[_0x477b('0xc')](),controller['clone']);router['post'](_0x477b('0xd'),auth[_0x477b('0xc')](),controller['addItem']);router[_0x477b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x477b('0x12')]);router[_0x477b('0x13')](_0x477b('0xb'),auth[_0x477b('0xc')](),controller[_0x477b('0x14')]);module[_0x477b('0x15')]=router; \ No newline at end of file +var _0x84df=['get','isAuthenticated','/:id','show','getItems','post','/:id/clone','/:id/items','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller'];(function(_0x2f8841,_0x4317df){var _0x1c01f3=function(_0xff852e){while(--_0xff852e){_0x2f8841['push'](_0x2f8841['shift']());}};_0x1c01f3(++_0x4317df);}(_0x84df,0xee));var _0xf84d=function(_0x191c44,_0x20a896){_0x191c44=_0x191c44-0x0;var _0x1086cd=_0x84df[_0x191c44];return _0x1086cd;};'use strict';var multer=require(_0xf84d('0x0'));var util=require(_0xf84d('0x1'));var path=require(_0xf84d('0x2'));var timeout=require(_0xf84d('0x3'));var express=require('express');var router=express[_0xf84d('0x4')]();var fs_extra=require(_0xf84d('0x5'));var auth=require(_0xf84d('0x6'));var interaction=require(_0xf84d('0x7'));var config=require('../../config/environment');var controller=require(_0xf84d('0x8'));router[_0xf84d('0x9')]('/',auth[_0xf84d('0xa')](),controller['index']);router[_0xf84d('0x9')](_0xf84d('0xb'),auth[_0xf84d('0xa')](),controller[_0xf84d('0xc')]);router[_0xf84d('0x9')]('/:id/items',auth[_0xf84d('0xa')](),controller[_0xf84d('0xd')]);router[_0xf84d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf84d('0xe')](_0xf84d('0xf'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xf84d('0x10'),auth[_0xf84d('0xa')](),controller['addItem']);router['put'](_0xf84d('0xb'),auth[_0xf84d('0xa')](),controller[_0xf84d('0x11')]);router[_0xf84d('0x12')](_0xf84d('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0923fa2..b600340 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 _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabce,0x103));var _0xeabc=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xabce[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5fab=['STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0x12f69e,_0x572e62){var _0x5edec7=function(_0x51ba17){while(--_0x51ba17){_0x12f69e['push'](_0x12f69e['shift']());}};_0x5edec7(++_0x572e62);}(_0x5fab,0x177));var _0xb5fa=function(_0x4d82e4,_0x3cf5be){_0x4d82e4=_0x4d82e4-0x0;var _0x3a3c8b=_0x5fab[_0x4d82e4];return _0x3a3c8b;};'use strict';var Sequelize=require(_0xb5fa('0x0'));var squel=require(_0xb5fa('0x1'));var _=require('lodash');module[_0xb5fa('0x2')]={'title':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb5fa('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb5fa('0x4')](_0xb5fa('0x5')),'get':function(){try{return JSON[_0xb5fa('0x6')](this[_0xb5fa('0x7')](_0xb5fa('0x8')));}catch(_0x10361d){return[];}},'set':function(_0x44df89){try{this['setDataValue']('attrs',JSON[_0xb5fa('0x9')](_0x44df89));}catch(_0x1aec3e){this[_0xb5fa('0xa')]('attrs',JSON[_0xb5fa('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb5fa('0x3')]},'titleFontSize':{'type':Sequelize[_0xb5fa('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 0cf84d9..0b3810e 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 _0xe829=['HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','show','params','query','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat'];(function(_0x5034cb,_0x322be8){var _0x44c8e2=function(_0xd9946e){while(--_0xd9946e){_0x5034cb['push'](_0x5034cb['shift']());}};_0x44c8e2(++_0x322be8);}(_0xe829,0xde));var _0x9e82=function(_0x4ec612,_0x57dfd6){_0x4ec612=_0x4ec612-0x0;var _0x52a015=_0xe829[_0x4ec612];return _0x52a015;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e82('0x0'));var zipdir=require(_0x9e82('0x1'));var jsonpatch=require(_0x9e82('0x2'));var rp=require(_0x9e82('0x3'));var moment=require(_0x9e82('0x4'));var BPromise=require(_0x9e82('0x5'));var Mustache=require('mustache');var util=require(_0x9e82('0x6'));var path=require(_0x9e82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e82('0x8'));var _=require(_0x9e82('0x9'));var squel=require(_0x9e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e82('0xb'));var deskjs=require(_0x9e82('0xc'));var toCsv=require(_0x9e82('0xd'));var querystring=require(_0x9e82('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e82('0xf'));var authService=require(_0x9e82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9e82('0x11'));var hardwareService=require(_0x9e82('0x12'));var logger=require('../../config/logger')(_0x9e82('0x13'));var utils=require(_0x9e82('0x14'));var config=require(_0x9e82('0x15'));var licenseUtil=require(_0x9e82('0x16'));var db=require(_0x9e82('0x17'))['db'];config['redis']=_[_0x9e82('0x18')](config[_0x9e82('0x19')],{'host':_0x9e82('0x1a'),'port':0x18eb});var socket=require(_0x9e82('0x1b'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x4aaa5f,_0x5909a6){_0x5909a6=_0x5909a6||0xcc;return function(_0xa4bd12){if(_0xa4bd12){return _0x4aaa5f['sendStatus'](_0x5909a6);}return _0x4aaa5f[_0x9e82('0x1c')](_0x5909a6)[_0x9e82('0x1d')]();};}function respondWithResult(_0x1bdf3f,_0x37cea0){_0x37cea0=_0x37cea0||0xc8;return function(_0x4fa628){if(_0x4fa628){return _0x1bdf3f[_0x9e82('0x1c')](_0x37cea0)[_0x9e82('0x1e')](_0x4fa628);}};}function respondWithFilteredResult(_0x4e5203,_0x495af4){return function(_0x2a0afd){if(_0x2a0afd){var _0x1554b5=typeof _0x495af4[_0x9e82('0x1f')]===_0x9e82('0x20')&&typeof _0x495af4[_0x9e82('0x21')]===_0x9e82('0x20');var _0xaeaa71=_0x2a0afd['count'];var _0x243a46=_0x1554b5?0x0:_0x495af4[_0x9e82('0x1f')];var _0x3463e6=_0x1554b5?_0x2a0afd['count']:_0x495af4[_0x9e82('0x1f')]+_0x495af4['limit'];var _0x2e8cec;if(_0x3463e6>=_0xaeaa71){_0x3463e6=_0xaeaa71;_0x2e8cec=0xc8;}else{_0x2e8cec=0xce;}_0x4e5203[_0x9e82('0x1c')](_0x2e8cec);return _0x4e5203[_0x9e82('0x22')](_0x9e82('0x23'),_0x243a46+'-'+_0x3463e6+'/'+_0xaeaa71)[_0x9e82('0x1e')](_0x2a0afd);}return null;};}function patchUpdates(_0x4d23ed){return function(_0x8eabaa){try{jsonpatch[_0x9e82('0x24')](_0x8eabaa,_0x4d23ed,!![]);}catch(_0x221969){return BPromise[_0x9e82('0x25')](_0x221969);}return _0x8eabaa['save']();};}function saveUpdates(_0x551f4d,_0x2f7d3f){return function(_0x16e006){if(_0x16e006){return _0x16e006[_0x9e82('0x26')](_0x551f4d)[_0x9e82('0x27')](function(_0x1840ae){return _0x1840ae;});}return null;};}function removeEntity(_0x10628d,_0x54ffa4){return function(_0x18c645){if(_0x18c645){return _0x18c645['destroy']()['then'](function(){_0x10628d[_0x9e82('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a5a4e,_0x371df8){return function(_0x1ac8ee){if(!_0x1ac8ee){_0x5a5a4e[_0x9e82('0x28')](0x194);}return _0x1ac8ee;};}function handleError(_0x2690ef,_0x19491d){_0x19491d=_0x19491d||0x1f4;return function(_0x495b77){logger['error'](_0x495b77[_0x9e82('0x29')]);if(_0x495b77[_0x9e82('0x2a')]){delete _0x495b77[_0x9e82('0x2a')];}_0x2690ef['status'](_0x19491d)['send'](_0x495b77);};}exports[_0x9e82('0x2b')]=function(_0x41c424,_0x46afaf){var _0x23669={'raw':![],'where':{'id':_0x41c424[_0x9e82('0x2c')]['id']}},_0x30f973={};_0x30f973['model']=_['keys'](db['DashboardItem']['rawAttributes']);_0x30f973[_0x9e82('0x2d')]=_[_0x9e82('0x2e')](_0x41c424[_0x9e82('0x2d')]);_0x30f973['filters']=_[_0x9e82('0x2f')](_0x30f973[_0x9e82('0x30')],_0x30f973['query']);_0x23669[_0x9e82('0x31')]=_[_0x9e82('0x2f')](_0x30f973[_0x9e82('0x30')],qs[_0x9e82('0x32')](_0x41c424[_0x9e82('0x2d')][_0x9e82('0x32')]));_0x23669[_0x9e82('0x31')]=_0x23669[_0x9e82('0x31')][_0x9e82('0x33')]?_0x23669[_0x9e82('0x31')]:_0x30f973[_0x9e82('0x30')];if(_0x41c424[_0x9e82('0x2d')][_0x9e82('0x34')]){_0x23669[_0x9e82('0x35')]=[{'all':!![]}];}_0x23669=_[_0x9e82('0x36')]({},_0x23669,_0x41c424[_0x9e82('0x37')]);return db[_0x9e82('0x38')][_0x9e82('0x39')](_0x23669)[_0x9e82('0x27')](handleEntityNotFound(_0x46afaf,null))[_0x9e82('0x27')](respondWithResult(_0x46afaf,null))[_0x9e82('0x3a')](handleError(_0x46afaf,null));};exports[_0x9e82('0x3b')]=function(_0x51847f,_0x164c4d){return db[_0x9e82('0x38')][_0x9e82('0x39')]({'where':{'id':_0x51847f[_0x9e82('0x2c')]['id']}})['then'](handleEntityNotFound(_0x164c4d,null))['then'](removeEntity(_0x164c4d,null))['catch'](handleError(_0x164c4d,null));};function widgetAttributes(_0x5b02df){try{switch(_0x5b02df[_0x9e82('0x3c')]){case _0x9e82('0x3d'):return[{'name':_0x9e82('0x3e'),'value':_0x5b02df[_0x9e82('0x3e')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||_0x9e82('0x41')}];case _0x9e82('0x42'):return[{'name':_0x9e82('0x43'),'value':_0x5b02df[_0x9e82('0x43')]||(_0x5b02df['attrs']&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||''}];case'clock':return[{'name':_0x9e82('0x44'),'value':_0x5b02df[_0x9e82('0x44')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||_0x9e82('0x45')},{'name':_0x9e82('0x46'),'value':_0x5b02df[_0x9e82('0x46')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df[_0x9e82('0x3f')][0x1][_0x9e82('0x40')]:undefined)||_0x9e82('0x47')},{'name':_0x9e82('0x48'),'value':_0x5b02df['attrFontSize']||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x2]?_0x5b02df[_0x9e82('0x3f')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5b02df[_0x9e82('0x49')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df['attrs'][0x0][_0x9e82('0x40')]:undefined)||_0x9e82('0x4a')},{'name':_0x9e82('0x4b'),'value':_0x5b02df[_0x9e82('0x4b')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df['attrs'][0x1][_0x9e82('0x40')]:undefined)||[]},{'name':'attrFontSize','value':_0x5b02df['attrFontSize']||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x2]?_0x5b02df[_0x9e82('0x3f')][0x2][_0x9e82('0x40')]:undefined)||0x14},{'name':_0x9e82('0x4c'),'value':_0x5b02df[_0x9e82('0x4c')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x3]?_0x5b02df['attrs'][0x3][_0x9e82('0x40')]:undefined)||'voice'},{'name':_0x9e82('0x4d'),'value':_0x5b02df[_0x9e82('0x4d')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x4]?_0x5b02df[_0x9e82('0x3f')][0x4][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4e'),'value':_0x5b02df[_0x9e82('0x4e')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x5]?_0x5b02df[_0x9e82('0x3f')][0x5][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4f'),'value':_0x5b02df[_0x9e82('0x4f')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x6]?_0x5b02df[_0x9e82('0x3f')][0x6][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x50'),'value':_0x5b02df[_0x9e82('0x50')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x7]?_0x5b02df[_0x9e82('0x3f')][0x7][_0x9e82('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5b02df[_0x9e82('0x51')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x8]?_0x5b02df[_0x9e82('0x3f')][0x8][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x52'),'value':_0x5b02df[_0x9e82('0x52')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x9]?_0x5b02df[_0x9e82('0x3f')][0x9][_0x9e82('0x40')]:undefined)||''}];case _0x9e82('0x53'):case _0x9e82('0x54'):return[{'name':_0x9e82('0x55'),'value':_0x5b02df[_0x9e82('0x55')]||(_0x5b02df['attrs']&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x40')]:undefined)||'total'},{'name':_0x9e82('0x56'),'value':_0x5b02df[_0x9e82('0x56')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df['attrs'][0x1][_0x9e82('0x40')]:undefined)||null},{'name':_0x9e82('0x57'),'value':_0x5b02df[_0x9e82('0x57')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x2]?_0x5b02df[_0x9e82('0x3f')][0x2][_0x9e82('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5b02df[_0x9e82('0x4b')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x3]?_0x5b02df[_0x9e82('0x3f')][0x3][_0x9e82('0x40')]:undefined)||[]},{'name':_0x9e82('0x4c'),'value':_0x5b02df['attrChannel']||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x4]?_0x5b02df[_0x9e82('0x3f')][0x4][_0x9e82('0x40')]:undefined)||_0x9e82('0x58')},{'name':_0x9e82('0x4d'),'value':_0x5b02df[_0x9e82('0x4d')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x5]?_0x5b02df['attrs'][0x5][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4e'),'value':_0x5b02df['attrFaxAccounts']||(_0x5b02df['attrs']&&_0x5b02df['attrs'][0x6]?_0x5b02df['attrs'][0x6][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x4f'),'value':_0x5b02df[_0x9e82('0x4f')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x7]?_0x5b02df['attrs'][0x7][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x50'),'value':_0x5b02df[_0x9e82('0x50')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df['attrs'][0x8]?_0x5b02df['attrs'][0x8]['value']:undefined)||''},{'name':_0x9e82('0x51'),'value':_0x5b02df[_0x9e82('0x51')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x9]?_0x5b02df['attrs'][0x9][_0x9e82('0x40')]:undefined)||''},{'name':_0x9e82('0x52'),'value':_0x5b02df[_0x9e82('0x52')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0xa]?_0x5b02df[_0x9e82('0x3f')][0xa][_0x9e82('0x40')]:undefined)||''}];case _0x9e82('0x59'):return[{'name':_0x9e82('0x5a'),'type':_0x5b02df[_0x9e82('0x5b')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df[_0x9e82('0x3f')][0x0][_0x9e82('0x3c')]:undefined)||null,'value':_0x5b02df[_0x9e82('0x5a')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x0]?_0x5b02df['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x5b02df[_0x9e82('0x5c')]||(_0x5b02df[_0x9e82('0x3f')]&&_0x5b02df[_0x9e82('0x3f')][0x1]?_0x5b02df['attrs'][0x1][_0x9e82('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x9ee546){logger['error'](_0x9e82('0x5d'),JSON[_0x9e82('0x5e')](_0x9ee546));return[];}}exports[_0x9e82('0x5f')]=function(_0x1acc06,_0x1a8c47){if(_0x1acc06[_0x9e82('0x60')]){_0x1acc06[_0x9e82('0x60')][_0x9e82('0x3f')]=widgetAttributes(_0x1acc06['body']);}return db[_0x9e82('0x38')][_0x9e82('0x5f')](_0x1acc06[_0x9e82('0x60')],{})[_0x9e82('0x27')](respondWithResult(_0x1a8c47,0xc9))['catch'](handleError(_0x1a8c47,null));};exports['update']=function(_0x26a872,_0x388e4f){if(_0x26a872[_0x9e82('0x60')]['id']){delete _0x26a872[_0x9e82('0x60')]['id'];}_0x26a872[_0x9e82('0x60')][_0x9e82('0x3f')]=widgetAttributes(_0x26a872[_0x9e82('0x60')]);return db[_0x9e82('0x38')][_0x9e82('0x39')]({'where':{'id':_0x26a872['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x388e4f,null))[_0x9e82('0x27')](saveUpdates(_0x26a872[_0x9e82('0x60')],null))['then'](respondWithResult(_0x388e4f,null))[_0x9e82('0x3a')](handleError(_0x388e4f,null));}; \ No newline at end of file +var _0x2709=['multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','intersection','query','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x2709,0x189));var _0x9270=function(_0x1d3730,_0x49f515){_0x1d3730=_0x1d3730-0x0;var _0x5b0d69=_0x2709[_0x1d3730];return _0x5b0d69;};'use strict';var emlformat=require(_0x9270('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9270('0x1'));var jsonpatch=require(_0x9270('0x2'));var rp=require('request-promise');var moment=require(_0x9270('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9270('0x4'));var util=require(_0x9270('0x5'));var path=require(_0x9270('0x6'));var sox=require(_0x9270('0x7'));var csv=require(_0x9270('0x8'));var ejs=require(_0x9270('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9270('0xa'));var squel=require(_0x9270('0xb'));var crypto=require(_0x9270('0xc'));var jsforce=require(_0x9270('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9270('0x8'));var querystring=require(_0x9270('0xe'));var Papa=require(_0x9270('0xf'));var Redis=require(_0x9270('0x10'));var authService=require(_0x9270('0x11'));var qs=require(_0x9270('0x12'));var as=require(_0x9270('0x13'));var hardwareService=require(_0x9270('0x14'));var logger=require(_0x9270('0x15'))(_0x9270('0x16'));var utils=require('../../config/utils');var config=require(_0x9270('0x17'));var licenseUtil=require(_0x9270('0x18'));var db=require(_0x9270('0x19'))['db'];config['redis']=_['defaults'](config[_0x9270('0x1a')],{'host':_0x9270('0x1b'),'port':0x18eb});var socket=require(_0x9270('0x1c'))(new Redis(config['redis']));require(_0x9270('0x1d'))[_0x9270('0x1e')](socket);function respondWithStatusCode(_0x3d78a9,_0x469420){_0x469420=_0x469420||0xcc;return function(_0x5ea222){if(_0x5ea222){return _0x3d78a9['sendStatus'](_0x469420);}return _0x3d78a9[_0x9270('0x1f')](_0x469420)[_0x9270('0x20')]();};}function respondWithResult(_0x5ec9b1,_0x3aa820){_0x3aa820=_0x3aa820||0xc8;return function(_0x4ecf89){if(_0x4ecf89){return _0x5ec9b1[_0x9270('0x1f')](_0x3aa820)[_0x9270('0x21')](_0x4ecf89);}};}function respondWithFilteredResult(_0x1a24cf,_0x5d037f){return function(_0x589e86){if(_0x589e86){var _0x3fdc6e=typeof _0x5d037f[_0x9270('0x22')]===_0x9270('0x23')&&typeof _0x5d037f['limit']===_0x9270('0x23');var _0x4537b9=_0x589e86[_0x9270('0x24')];var _0x72dd7d=_0x3fdc6e?0x0:_0x5d037f[_0x9270('0x22')];var _0xcbb906=_0x3fdc6e?_0x589e86['count']:_0x5d037f[_0x9270('0x22')]+_0x5d037f[_0x9270('0x25')];var _0x2a515d;if(_0xcbb906>=_0x4537b9){_0xcbb906=_0x4537b9;_0x2a515d=0xc8;}else{_0x2a515d=0xce;}_0x1a24cf[_0x9270('0x1f')](_0x2a515d);return _0x1a24cf['set'](_0x9270('0x26'),_0x72dd7d+'-'+_0xcbb906+'/'+_0x4537b9)[_0x9270('0x21')](_0x589e86);}return null;};}function patchUpdates(_0x121eb5){return function(_0x3d5d59){try{jsonpatch[_0x9270('0x27')](_0x3d5d59,_0x121eb5,!![]);}catch(_0x55ef1f){return BPromise[_0x9270('0x28')](_0x55ef1f);}return _0x3d5d59[_0x9270('0x29')]();};}function saveUpdates(_0x555d09,_0x396276){return function(_0x272ee0){if(_0x272ee0){return _0x272ee0[_0x9270('0x2a')](_0x555d09)[_0x9270('0x2b')](function(_0x35e372){return _0x35e372;});}return null;};}function removeEntity(_0x40f040,_0x334bb7){return function(_0x24d16d){if(_0x24d16d){return _0x24d16d[_0x9270('0x2c')]()[_0x9270('0x2b')](function(){_0x40f040[_0x9270('0x1f')](0xcc)[_0x9270('0x20')]();});}};}function handleEntityNotFound(_0x573e21,_0xff5276){return function(_0x5272a8){if(!_0x5272a8){_0x573e21['sendStatus'](0x194);}return _0x5272a8;};}function handleError(_0x1cf5fa,_0x26c1ad){_0x26c1ad=_0x26c1ad||0x1f4;return function(_0x4dba44){logger[_0x9270('0x2d')](_0x4dba44[_0x9270('0x2e')]);if(_0x4dba44[_0x9270('0x2f')]){delete _0x4dba44[_0x9270('0x2f')];}_0x1cf5fa['status'](_0x26c1ad)[_0x9270('0x30')](_0x4dba44);};}exports[_0x9270('0x31')]=function(_0x5516cd,_0x40f5c7){var _0x1cb8eb={'raw':![],'where':{'id':_0x5516cd[_0x9270('0x32')]['id']}},_0x38f17f={};_0x38f17f[_0x9270('0x33')]=_[_0x9270('0x34')](db['DashboardItem'][_0x9270('0x35')]);_0x38f17f['query']=_[_0x9270('0x34')](_0x5516cd['query']);_0x38f17f['filters']=_[_0x9270('0x36')](_0x38f17f[_0x9270('0x33')],_0x38f17f[_0x9270('0x37')]);_0x1cb8eb[_0x9270('0x38')]=_[_0x9270('0x36')](_0x38f17f['model'],qs[_0x9270('0x39')](_0x5516cd['query'][_0x9270('0x39')]));_0x1cb8eb[_0x9270('0x38')]=_0x1cb8eb[_0x9270('0x38')][_0x9270('0x3a')]?_0x1cb8eb['attributes']:_0x38f17f['model'];if(_0x5516cd['query'][_0x9270('0x3b')]){_0x1cb8eb[_0x9270('0x3c')]=[{'all':!![]}];}_0x1cb8eb=_[_0x9270('0x3d')]({},_0x1cb8eb,_0x5516cd[_0x9270('0x3e')]);return db[_0x9270('0x3f')][_0x9270('0x40')](_0x1cb8eb)[_0x9270('0x2b')](handleEntityNotFound(_0x40f5c7,null))[_0x9270('0x2b')](respondWithResult(_0x40f5c7,null))[_0x9270('0x41')](handleError(_0x40f5c7,null));};exports['destroy']=function(_0xeb12d7,_0xabb6f0){return db[_0x9270('0x3f')]['find']({'where':{'id':_0xeb12d7[_0x9270('0x32')]['id']}})[_0x9270('0x2b')](handleEntityNotFound(_0xabb6f0,null))[_0x9270('0x2b')](removeEntity(_0xabb6f0,null))['catch'](handleError(_0xabb6f0,null));};function widgetAttributes(_0x553f5a){try{switch(_0x553f5a[_0x9270('0x42')]){case _0x9270('0x43'):return[{'name':_0x9270('0x44'),'value':_0x553f5a[_0x9270('0x44')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x0]?_0x553f5a[_0x9270('0x45')][0x0][_0x9270('0x46')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x553f5a[_0x9270('0x47')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a['attrs'][0x0]?_0x553f5a[_0x9270('0x45')][0x0]['value']:undefined)||''}];case _0x9270('0x48'):return[{'name':'attrHourFormat','value':_0x553f5a['attrHourFormat']||(_0x553f5a['attrs']&&_0x553f5a[_0x9270('0x45')][0x0]?_0x553f5a[_0x9270('0x45')][0x0][_0x9270('0x46')]:undefined)||_0x9270('0x49')},{'name':'attrTimezone','value':_0x553f5a[_0x9270('0x4a')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a['attrs'][0x1]?_0x553f5a[_0x9270('0x45')][0x1][_0x9270('0x46')]:undefined)||_0x9270('0x4b')},{'name':_0x9270('0x4c'),'value':_0x553f5a[_0x9270('0x4c')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x2]?_0x553f5a[_0x9270('0x45')][0x2]['value']:undefined)||0xc}];case _0x9270('0x4d'):return[{'name':'attrMetric','value':_0x553f5a['attrMetric']||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x0]?_0x553f5a['attrs'][0x0][_0x9270('0x46')]:undefined)||_0x9270('0x4e')},{'name':'attrVoiceQueues','value':_0x553f5a[_0x9270('0x4f')]||(_0x553f5a['attrs']&&_0x553f5a['attrs'][0x1]?_0x553f5a['attrs'][0x1][_0x9270('0x46')]:undefined)||[]},{'name':_0x9270('0x4c'),'value':_0x553f5a[_0x9270('0x4c')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x2]?_0x553f5a[_0x9270('0x45')][0x2][_0x9270('0x46')]:undefined)||0x14},{'name':_0x9270('0x50'),'value':_0x553f5a[_0x9270('0x50')]||(_0x553f5a['attrs']&&_0x553f5a[_0x9270('0x45')][0x3]?_0x553f5a[_0x9270('0x45')][0x3][_0x9270('0x46')]:undefined)||'voice'},{'name':_0x9270('0x51'),'value':_0x553f5a[_0x9270('0x51')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x4]?_0x553f5a['attrs'][0x4][_0x9270('0x46')]:undefined)||''},{'name':_0x9270('0x52'),'value':_0x553f5a[_0x9270('0x52')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x5]?_0x553f5a['attrs'][0x5][_0x9270('0x46')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x553f5a[_0x9270('0x53')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x6]?_0x553f5a[_0x9270('0x45')][0x6][_0x9270('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x553f5a[_0x9270('0x54')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x7]?_0x553f5a[_0x9270('0x45')][0x7]['value']:undefined)||''},{'name':_0x9270('0x55'),'value':_0x553f5a[_0x9270('0x55')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x8]?_0x553f5a[_0x9270('0x45')][0x8]['value']:undefined)||''},{'name':_0x9270('0x56'),'value':_0x553f5a[_0x9270('0x56')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a['attrs'][0x9]?_0x553f5a[_0x9270('0x45')][0x9][_0x9270('0x46')]:undefined)||''}];case _0x9270('0x57'):case'pie-chart':return[{'name':_0x9270('0x58'),'value':_0x553f5a[_0x9270('0x58')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x0]?_0x553f5a[_0x9270('0x45')][0x0][_0x9270('0x46')]:undefined)||_0x9270('0x4e')},{'name':_0x9270('0x59'),'value':_0x553f5a[_0x9270('0x59')]||(_0x553f5a['attrs']&&_0x553f5a[_0x9270('0x45')][0x1]?_0x553f5a['attrs'][0x1][_0x9270('0x46')]:undefined)||null},{'name':'attrSerie3','value':_0x553f5a[_0x9270('0x5a')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a['attrs'][0x2]?_0x553f5a['attrs'][0x2]['value']:undefined)||null},{'name':_0x9270('0x4f'),'value':_0x553f5a[_0x9270('0x4f')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a['attrs'][0x3]?_0x553f5a['attrs'][0x3]['value']:undefined)||[]},{'name':_0x9270('0x50'),'value':_0x553f5a['attrChannel']||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a['attrs'][0x4]?_0x553f5a[_0x9270('0x45')][0x4][_0x9270('0x46')]:undefined)||'voice'},{'name':_0x9270('0x51'),'value':_0x553f5a[_0x9270('0x51')]||(_0x553f5a['attrs']&&_0x553f5a[_0x9270('0x45')][0x5]?_0x553f5a['attrs'][0x5][_0x9270('0x46')]:undefined)||''},{'name':_0x9270('0x52'),'value':_0x553f5a[_0x9270('0x52')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x6]?_0x553f5a[_0x9270('0x45')][0x6][_0x9270('0x46')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x553f5a[_0x9270('0x53')]||(_0x553f5a['attrs']&&_0x553f5a[_0x9270('0x45')][0x7]?_0x553f5a[_0x9270('0x45')][0x7][_0x9270('0x46')]:undefined)||''},{'name':_0x9270('0x54'),'value':_0x553f5a['attrOpenchannelAccounts']||(_0x553f5a['attrs']&&_0x553f5a['attrs'][0x8]?_0x553f5a['attrs'][0x8][_0x9270('0x46')]:undefined)||''},{'name':_0x9270('0x55'),'value':_0x553f5a['attrWhatsappAccounts']||(_0x553f5a['attrs']&&_0x553f5a['attrs'][0x9]?_0x553f5a['attrs'][0x9]['value']:undefined)||''},{'name':_0x9270('0x56'),'value':_0x553f5a['attrChatWebsites']||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0xa]?_0x553f5a[_0x9270('0x45')][0xa][_0x9270('0x46')]:undefined)||''}];case _0x9270('0x5b'):return[{'name':_0x9270('0x5c'),'type':_0x553f5a['reportType']||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x0]?_0x553f5a[_0x9270('0x45')][0x0][_0x9270('0x42')]:undefined)||null,'value':_0x553f5a[_0x9270('0x5c')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x0]?_0x553f5a['attrs'][0x0][_0x9270('0x46')]:undefined)||null},{'name':_0x9270('0x5d'),'value':_0x553f5a[_0x9270('0x5d')]||(_0x553f5a[_0x9270('0x45')]&&_0x553f5a[_0x9270('0x45')][0x1]?_0x553f5a['attrs'][0x1][_0x9270('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x20891f){logger[_0x9270('0x2d')](_0x9270('0x5e'),JSON['stringify'](_0x20891f));return[];}}exports['create']=function(_0x4fff60,_0x555d83){if(_0x4fff60[_0x9270('0x5f')]){_0x4fff60[_0x9270('0x5f')][_0x9270('0x45')]=widgetAttributes(_0x4fff60['body']);}return db[_0x9270('0x3f')]['create'](_0x4fff60['body'],{})['then'](respondWithResult(_0x555d83,0xc9))['catch'](handleError(_0x555d83,null));};exports['update']=function(_0x4699b0,_0x2402f4){if(_0x4699b0['body']['id']){delete _0x4699b0['body']['id'];}_0x4699b0[_0x9270('0x5f')][_0x9270('0x45')]=widgetAttributes(_0x4699b0[_0x9270('0x5f')]);return db['DashboardItem']['find']({'where':{'id':_0x4699b0[_0x9270('0x32')]['id']}})['then'](handleEntityNotFound(_0x2402f4,null))[_0x9270('0x2b')](saveUpdates(_0x4699b0[_0x9270('0x5f')],null))[_0x9270('0x2b')](respondWithResult(_0x2402f4,null))[_0x9270('0x41')](handleError(_0x2402f4,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9bc13e4..e216cfd 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 _0xf4de=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x17448f,_0x4378e9){var _0x257b50=function(_0x4702d3){while(--_0x4702d3){_0x17448f['push'](_0x17448f['shift']());}};_0x257b50(++_0x4378e9);}(_0xf4de,0xdf));var _0xef4d=function(_0xa862c7,_0x694523){_0xa862c7=_0xa862c7-0x0;var _0x2dbcb3=_0xf4de[_0xa862c7];return _0x2dbcb3;};'use strict';var EventEmitter=require(_0xef4d('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xef4d('0x1')](0x0);var events={'afterCreate':_0xef4d('0x2'),'afterUpdate':_0xef4d('0x3'),'afterDestroy':_0xef4d('0x4')};function emitEvent(_0x32300f){return function(_0x425b38,_0x426c3e,_0x126893){DashboardItemEvents[_0xef4d('0x5')](_0x32300f+':'+_0x425b38['id'],_0x425b38);DashboardItemEvents[_0xef4d('0x5')](_0x32300f,_0x425b38);_0x126893(null);};}for(var e in events){if(events[_0xef4d('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xef4d('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xf34e=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x376524,_0x3761be){var _0x34b633=function(_0xf0fa27){while(--_0xf0fa27){_0x376524['push'](_0x376524['shift']());}};_0x34b633(++_0x3761be);}(_0xf34e,0x145));var _0xef34=function(_0x5dc044,_0x2a6ca9){_0x5dc044=_0x5dc044-0x0;var _0x5ecd4a=_0xf34e[_0x5dc044];return _0x5ecd4a;};'use strict';var EventEmitter=require(_0xef34('0x0'));var DashboardItem=require(_0xef34('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xef34('0x2')](0x0);var events={'afterCreate':_0xef34('0x3'),'afterUpdate':'update','afterDestroy':_0xef34('0x4')};function emitEvent(_0x45068f){return function(_0x580176,_0x2841fd,_0x26d791){DashboardItemEvents[_0xef34('0x5')](_0x45068f+':'+_0x580176['id'],_0x580176);DashboardItemEvents[_0xef34('0x5')](_0x45068f,_0x580176);_0x26d791(null);};}for(var e in events){if(events[_0xef34('0x6')](e)){var event=events[e];DashboardItem[_0xef34('0x7')](e,emitEvent(event));}}module[_0xef34('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 6641b05..e2d5d6a 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 _0xbe9a=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items'];(function(_0x1759f5,_0x2f3d31){var _0x535ce0=function(_0x2293ef){while(--_0x2293ef){_0x1759f5['push'](_0x1759f5['shift']());}};_0x535ce0(++_0x2f3d31);}(_0xbe9a,0x1a4));var _0xabe9=function(_0x554f23,_0x5a5460){_0x554f23=_0x554f23-0x0;var _0x51e7da=_0xbe9a[_0x554f23];return _0x51e7da;};'use strict';var _=require(_0xabe9('0x0'));var util=require('util');var logger=require(_0xabe9('0x1'))(_0xabe9('0x2'));var moment=require(_0xabe9('0x3'));var BPromise=require('bluebird');var rp=require(_0xabe9('0x4'));var fs=require('fs');var path=require(_0xabe9('0x5'));var rimraf=require(_0xabe9('0x6'));var config=require(_0xabe9('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xabe9('0x8')]=function(_0x40b9aa,_0x1ee7e0){return _0x40b9aa[_0xabe9('0x9')](_0xabe9('0xa'),attributes,{'tableName':_0xabe9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb6f=['DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define'];(function(_0x572618,_0x287468){var _0x113a44=function(_0x2d4e17){while(--_0x2d4e17){_0x572618['push'](_0x572618['shift']());}};_0x113a44(++_0x287468);}(_0xdb6f,0x64));var _0xfdb6=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xdb6f[_0x56825b];return _0x69ce77;};'use strict';var _=require(_0xfdb6('0x0'));var util=require(_0xfdb6('0x1'));var logger=require(_0xfdb6('0x2'))(_0xfdb6('0x3'));var moment=require(_0xfdb6('0x4'));var BPromise=require(_0xfdb6('0x5'));var rp=require(_0xfdb6('0x6'));var fs=require('fs');var path=require(_0xfdb6('0x7'));var rimraf=require(_0xfdb6('0x8'));var config=require('../../config/environment');var attributes=require(_0xfdb6('0x9'));module[_0xfdb6('0xa')]=function(_0x39f342,_0x4d6f7a){return _0x39f342[_0xfdb6('0xb')](_0xfdb6('0xc'),attributes,{'tableName':_0xfdb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 84079fb..f82c668 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 _0x15ef=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring'];(function(_0x38a760,_0x520b0c){var _0x478963=function(_0x1e91bf){while(--_0x1e91bf){_0x38a760['push'](_0x38a760['shift']());}};_0x478963(++_0x520b0c);}(_0x15ef,0xf8));var _0xf15e=function(_0x553969,_0x12bc3b){_0x553969=_0x553969-0x0;var _0x4d074a=_0x15ef[_0x553969];return _0x4d074a;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var moment=require(_0xf15e('0x1'));var BPromise=require(_0xf15e('0x2'));var rs=require(_0xf15e('0x3'));var fs=require('fs');var Redis=require(_0xf15e('0x4'));var db=require(_0xf15e('0x5'))['db'];var utils=require(_0xf15e('0x6'));var logger=require(_0xf15e('0x7'))(_0xf15e('0x8'));var config=require(_0xf15e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf15e('0xa')][_0xf15e('0xb')]({'port':0x232a});config[_0xf15e('0xc')]=_[_0xf15e('0xd')](config[_0xf15e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf15e('0xe'))(new Redis(config[_0xf15e('0xc')]));require(_0xf15e('0xf'))[_0xf15e('0x10')](socket);function respondWithRpcPromise(_0x1ba612,_0x2b6860,_0x14f0d2){return new BPromise(function(_0x46e262,_0x30f52a){return client[_0xf15e('0x11')](_0x1ba612,_0x14f0d2)['then'](function(_0x3cdbef){logger['info'](_0xf15e('0x12'),_0x2b6860,_0xf15e('0x13'));logger[_0xf15e('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2b6860,_0xf15e('0x13'),JSON[_0xf15e('0x15')](_0x3cdbef));if(_0x3cdbef[_0xf15e('0x16')]){if(_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x17')]===0x1f4){logger['error'](_0xf15e('0x12'),_0x2b6860,_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x18')]);return _0x30f52a(_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x18')]);}logger[_0xf15e('0x16')]('DashboardItem,\x20%s,\x20%s',_0x2b6860,_0x3cdbef[_0xf15e('0x16')]['message']);return _0x46e262(_0x3cdbef[_0xf15e('0x16')][_0xf15e('0x18')]);}else{logger[_0xf15e('0x19')](_0xf15e('0x12'),_0x2b6860,_0xf15e('0x13'));_0x46e262(_0x3cdbef[_0xf15e('0x1a')]['message']);}})[_0xf15e('0x1b')](function(_0x834670){logger[_0xf15e('0x16')](_0xf15e('0x12'),_0x2b6860,_0x834670);_0x30f52a(_0x834670);});});} \ No newline at end of file +var _0x2de8=['request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register'];(function(_0x1108c6,_0x49ac41){var _0x5baeb8=function(_0x158a84){while(--_0x158a84){_0x1108c6['push'](_0x1108c6['shift']());}};_0x5baeb8(++_0x49ac41);}(_0x2de8,0x1cb));var _0x82de=function(_0xea60ce,_0xac18dc){_0xea60ce=_0xea60ce-0x0;var _0x5af62f=_0x2de8[_0xea60ce];return _0x5af62f;};'use strict';var _=require(_0x82de('0x0'));var util=require(_0x82de('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x82de('0x2'));var fs=require('fs');var Redis=require(_0x82de('0x3'));var db=require(_0x82de('0x4'))['db'];var utils=require(_0x82de('0x5'));var logger=require(_0x82de('0x6'))(_0x82de('0x7'));var config=require(_0x82de('0x8'));var jayson=require(_0x82de('0x9'));var client=jayson[_0x82de('0xa')][_0x82de('0xb')]({'port':0x232a});config[_0x82de('0xc')]=_[_0x82de('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x82de('0xe'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x82de('0xf')](socket);function respondWithRpcPromise(_0x4f779c,_0xc70fc8,_0x5968af){return new BPromise(function(_0x1e72a9,_0x5e9dc9){return client[_0x82de('0x10')](_0x4f779c,_0x5968af)['then'](function(_0x2a7652){logger[_0x82de('0x11')](_0x82de('0x12'),_0xc70fc8,_0x82de('0x13'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0xc70fc8,'request\x20sent',JSON[_0x82de('0x14')](_0x2a7652));if(_0x2a7652[_0x82de('0x15')]){if(_0x2a7652[_0x82de('0x15')]['code']===0x1f4){logger[_0x82de('0x15')](_0x82de('0x12'),_0xc70fc8,_0x2a7652[_0x82de('0x15')][_0x82de('0x16')]);return _0x5e9dc9(_0x2a7652['error'][_0x82de('0x16')]);}logger[_0x82de('0x15')](_0x82de('0x12'),_0xc70fc8,_0x2a7652[_0x82de('0x15')][_0x82de('0x16')]);return _0x1e72a9(_0x2a7652['error']['message']);}else{logger[_0x82de('0x11')]('DashboardItem,\x20%s,\x20%s',_0xc70fc8,_0x82de('0x13'));_0x1e72a9(_0x2a7652[_0x82de('0x17')][_0x82de('0x16')]);}})[_0x82de('0x18')](function(_0x2316f1){logger[_0x82de('0x15')]('DashboardItem,\x20%s,\x20%s',_0xc70fc8,_0x2316f1);_0x5e9dc9(_0x2316f1);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c76e309..2e66713 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 _0xf277=['update','emit','removeListener','register','dashboardItem:','./dashboardItem.events','remove'];(function(_0x47bcee,_0x5c0311){var _0x4b88a8=function(_0x170762){while(--_0x170762){_0x47bcee['push'](_0x47bcee['shift']());}};_0x4b88a8(++_0x5c0311);}(_0xf277,0x67));var _0x7f27=function(_0x5a31cb,_0x4c64a0){_0x5a31cb=_0x5a31cb-0x0;var _0x3a440f=_0xf277[_0x5a31cb];return _0x3a440f;};'use strict';var DashboardItemEvents=require(_0x7f27('0x0'));var events=['save',_0x7f27('0x1'),_0x7f27('0x2')];function createListener(_0x59cda4,_0x37e849){return function(_0x74aaf8){_0x37e849[_0x7f27('0x3')](_0x59cda4,_0x74aaf8);};}function removeListener(_0x2adb83,_0xd7f98d){return function(){DashboardItemEvents[_0x7f27('0x4')](_0x2adb83,_0xd7f98d);};}exports[_0x7f27('0x5')]=function(_0x49ddce){for(var _0x53d7bb=0x0,_0x149687=events['length'];_0x53d7bb<_0x149687;_0x53d7bb++){var _0x26f0c7=events[_0x53d7bb];var _0x449f36=createListener(_0x7f27('0x6')+_0x26f0c7,_0x49ddce);DashboardItemEvents['on'](_0x26f0c7,_0x449f36);}}; \ No newline at end of file +var _0x63ac=['emit','removeListener','register','length','dashboardItem:','save','remove','update'];(function(_0x1f3834,_0x3dfaff){var _0x1c4653=function(_0x4bbbd0){while(--_0x4bbbd0){_0x1f3834['push'](_0x1f3834['shift']());}};_0x1c4653(++_0x3dfaff);}(_0x63ac,0xfd));var _0xc63a=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x63ac[_0x3653c7];return _0x58a021;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xc63a('0x0'),_0xc63a('0x1'),_0xc63a('0x2')];function createListener(_0x12021f,_0x2911e2){return function(_0x128e6b){_0x2911e2[_0xc63a('0x3')](_0x12021f,_0x128e6b);};}function removeListener(_0xa7fa6d,_0x3d622f){return function(){DashboardItemEvents[_0xc63a('0x4')](_0xa7fa6d,_0x3d622f);};}exports[_0xc63a('0x5')]=function(_0x2d52d7){for(var _0x46e997=0x0,_0x3bd29e=events[_0xc63a('0x6')];_0x46e997<_0x3bd29e;_0x46e997++){var _0x3a33bb=events[_0x46e997];var _0x3fcc9c=createListener(_0xc63a('0x7')+_0x3a33bb,_0x2d52d7);DashboardItemEvents['on'](_0x3a33bb,_0x3fcc9c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4c687eb..3673c1c 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 _0x4691=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1a7383,_0x3fd99f){var _0x8d39e5=function(_0x118e05){while(--_0x118e05){_0x1a7383['push'](_0x1a7383['shift']());}};_0x8d39e5(++_0x3fd99f);}(_0x4691,0x153));var _0x1469=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x4691[_0x1762b4];return _0x29beda;};'use strict';var multer=require('multer');var util=require(_0x1469('0x0'));var path=require(_0x1469('0x1'));var timeout=require(_0x1469('0x2'));var express=require(_0x1469('0x3'));var router=express[_0x1469('0x4')]();var fs_extra=require(_0x1469('0x5'));var auth=require(_0x1469('0x6'));var interaction=require(_0x1469('0x7'));var config=require(_0x1469('0x8'));var controller=require('./dashboardItem.controller');router['get'](_0x1469('0x9'),auth[_0x1469('0xa')](),controller[_0x1469('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1469('0xc')]);router[_0x1469('0xd')](_0x1469('0x9'),auth['isAuthenticated'](),controller[_0x1469('0xe')]);router[_0x1469('0xf')]('/:id',auth[_0x1469('0xa')](),controller[_0x1469('0x10')]);module[_0x1469('0x11')]=router; \ No newline at end of file +var _0xab3d=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x30cc6c,_0x52e872){var _0x55168d=function(_0x4b52a5){while(--_0x4b52a5){_0x30cc6c['push'](_0x30cc6c['shift']());}};_0x55168d(++_0x52e872);}(_0xab3d,0xc3));var _0xdab3=function(_0x29e79b,_0x27b031){_0x29e79b=_0x29e79b-0x0;var _0x57c8e2=_0xab3d[_0x29e79b];return _0x57c8e2;};'use strict';var multer=require(_0xdab3('0x0'));var util=require(_0xdab3('0x1'));var path=require(_0xdab3('0x2'));var timeout=require(_0xdab3('0x3'));var express=require('express');var router=express[_0xdab3('0x4')]();var fs_extra=require(_0xdab3('0x5'));var auth=require(_0xdab3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdab3('0x7'));var controller=require(_0xdab3('0x8'));router[_0xdab3('0x9')](_0xdab3('0xa'),auth[_0xdab3('0xb')](),controller[_0xdab3('0xc')]);router[_0xdab3('0xd')]('/',auth[_0xdab3('0xb')](),controller[_0xdab3('0xe')]);router['put'](_0xdab3('0xa'),auth['isAuthenticated'](),controller[_0xdab3('0xf')]);router[_0xdab3('0x10')](_0xdab3('0xa'),auth[_0xdab3('0xb')](),controller[_0xdab3('0x11')]);module[_0xdab3('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 8ea2f81..7ab13f4 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 _0x2663=['ENUM','first','second','third','sequelize','STRING'];(function(_0x4e3699,_0x42a2d3){var _0x910ae4=function(_0x5e0577){while(--_0x5e0577){_0x4e3699['push'](_0x4e3699['shift']());}};_0x910ae4(++_0x42a2d3);}(_0x2663,0x10c));var _0x3266=function(_0x177c8d,_0x15a8af){_0x177c8d=_0x177c8d-0x0;var _0x2a771b=_0x2663[_0x177c8d];return _0x2a771b;};'use strict';var Sequelize=require(_0x3266('0x0'));module['exports']={'name':{'type':Sequelize[_0x3266('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x3266('0x2')](_0x3266('0x3'),_0x3266('0x4'),_0x3266('0x5')),'allowNull':![],'defaultValue':_0x3266('0x3')},'description':{'type':Sequelize[_0x3266('0x1')]}}; \ No newline at end of file +var _0x89a9=['first','second','third','sequelize','exports','STRING','ENUM'];(function(_0x2e4771,_0x3e6479){var _0x283e38=function(_0x3284d6){while(--_0x3284d6){_0x2e4771['push'](_0x2e4771['shift']());}};_0x283e38(++_0x3e6479);}(_0x89a9,0x1e6));var _0x989a=function(_0x53ea53,_0x467be1){_0x53ea53=_0x53ea53-0x0;var _0x1e8910=_0x89a9[_0x53ea53];return _0x1e8910;};'use strict';var Sequelize=require(_0x989a('0x0'));module[_0x989a('0x1')]={'name':{'type':Sequelize[_0x989a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x989a('0x3')](_0x989a('0x4'),_0x989a('0x5'),_0x989a('0x6')),'allowNull':![],'defaultValue':_0x989a('0x4')},'description':{'type':Sequelize[_0x989a('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 500d886..87e7470 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 _0x4108=['index','Disposition','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','error','name','send'];(function(_0x59f6cf,_0x330311){var _0x2f7e2d=function(_0x55ad35){while(--_0x55ad35){_0x59f6cf['push'](_0x59f6cf['shift']());}};_0x2f7e2d(++_0x330311);}(_0x4108,0x1d0));var _0x8410=function(_0x23e2d2,_0x269497){_0x23e2d2=_0x23e2d2-0x0;var _0x84f2fb=_0x4108[_0x23e2d2];return _0x84f2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8410('0x0'));var zipdir=require(_0x8410('0x1'));var jsonpatch=require(_0x8410('0x2'));var rp=require(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8410('0x5'));var util=require(_0x8410('0x6'));var path=require(_0x8410('0x7'));var sox=require(_0x8410('0x8'));var csv=require(_0x8410('0x9'));var ejs=require(_0x8410('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8410('0xb'));var crypto=require(_0x8410('0xc'));var jsforce=require(_0x8410('0xd'));var deskjs=require(_0x8410('0xe'));var toCsv=require(_0x8410('0x9'));var querystring=require(_0x8410('0xf'));var Papa=require(_0x8410('0x10'));var Redis=require('ioredis');var authService=require(_0x8410('0x11'));var qs=require(_0x8410('0x12'));var as=require(_0x8410('0x13'));var hardwareService=require(_0x8410('0x14'));var logger=require(_0x8410('0x15'))(_0x8410('0x16'));var utils=require(_0x8410('0x17'));var config=require(_0x8410('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8410('0x19'))['db'];function respondWithStatusCode(_0x2a3b50,_0x227ddc){_0x227ddc=_0x227ddc||0xcc;return function(_0x28a52a){if(_0x28a52a){return _0x2a3b50[_0x8410('0x1a')](_0x227ddc);}return _0x2a3b50[_0x8410('0x1b')](_0x227ddc)[_0x8410('0x1c')]();};}function respondWithResult(_0x14f098,_0x3cb039){_0x3cb039=_0x3cb039||0xc8;return function(_0x4161ac){if(_0x4161ac){return _0x14f098[_0x8410('0x1b')](_0x3cb039)[_0x8410('0x1d')](_0x4161ac);}};}function respondWithFilteredResult(_0x1a597c,_0x226e3a){return function(_0x162b3f){if(_0x162b3f){var _0x59118e=typeof _0x226e3a['offset']==='undefined'&&typeof _0x226e3a[_0x8410('0x1e')]===_0x8410('0x1f');var _0x5b9f40=_0x162b3f[_0x8410('0x20')];var _0x3ab562=_0x59118e?0x0:_0x226e3a[_0x8410('0x21')];var _0x6c5da0=_0x59118e?_0x162b3f[_0x8410('0x20')]:_0x226e3a[_0x8410('0x21')]+_0x226e3a['limit'];var _0x12489e;if(_0x6c5da0>=_0x5b9f40){_0x6c5da0=_0x5b9f40;_0x12489e=0xc8;}else{_0x12489e=0xce;}_0x1a597c[_0x8410('0x1b')](_0x12489e);return _0x1a597c[_0x8410('0x22')](_0x8410('0x23'),_0x3ab562+'-'+_0x6c5da0+'/'+_0x5b9f40)[_0x8410('0x1d')](_0x162b3f);}return null;};}function patchUpdates(_0x1f2d91){return function(_0x49d606){try{jsonpatch[_0x8410('0x24')](_0x49d606,_0x1f2d91,!![]);}catch(_0x43bc6d){return BPromise[_0x8410('0x25')](_0x43bc6d);}return _0x49d606[_0x8410('0x26')]();};}function saveUpdates(_0x1f132d,_0x20b07e){return function(_0x20c96f){if(_0x20c96f){return _0x20c96f[_0x8410('0x27')](_0x1f132d)['then'](function(_0x10ea65){return _0x10ea65;});}return null;};}function removeEntity(_0x4390a9,_0x21eb83){return function(_0x154dfd){if(_0x154dfd){return _0x154dfd[_0x8410('0x28')]()[_0x8410('0x29')](function(){var _0x1c0061=_0x154dfd['get']({'plain':!![]});var _0xb6a7bf=_0x8410('0x2a');return db['UserProfileResource'][_0x8410('0x28')]({'where':{'type':_0xb6a7bf,'resourceId':_0x1c0061['id']}})[_0x8410('0x29')](function(){return _0x154dfd;});})[_0x8410('0x29')](function(){_0x4390a9['status'](0xcc)[_0x8410('0x1c')]();});}};}function handleEntityNotFound(_0xa10fe0,_0x48171f){return function(_0x400ef3){if(!_0x400ef3){_0xa10fe0[_0x8410('0x1a')](0x194);}return _0x400ef3;};}function handleError(_0x1aeaa1,_0x529056){_0x529056=_0x529056||0x1f4;return function(_0xb4b646){logger[_0x8410('0x2b')](_0xb4b646['stack']);if(_0xb4b646[_0x8410('0x2c')]){delete _0xb4b646[_0x8410('0x2c')];}_0x1aeaa1[_0x8410('0x1b')](_0x529056)[_0x8410('0x2d')](_0xb4b646);};}exports[_0x8410('0x2e')]=function(_0x3852af,_0x33aeb4){var _0x520948={},_0x439981={},_0x2c6bf2={'count':0x0,'rows':[]};var _0x1e269f=_['map'](db[_0x8410('0x2f')]['rawAttributes'],function(_0x6a3c02){return{'name':_0x6a3c02[_0x8410('0x30')],'type':_0x6a3c02[_0x8410('0x31')][_0x8410('0x32')]};});_0x439981[_0x8410('0x33')]=_[_0x8410('0x34')](_0x1e269f,_0x8410('0x2c'));_0x439981[_0x8410('0x35')]=_[_0x8410('0x36')](_0x3852af[_0x8410('0x35')]);_0x439981['filters']=_[_0x8410('0x37')](_0x439981[_0x8410('0x33')],_0x439981[_0x8410('0x35')]);_0x520948[_0x8410('0x38')]=_['intersection'](_0x439981[_0x8410('0x33')],qs[_0x8410('0x39')](_0x3852af[_0x8410('0x35')][_0x8410('0x39')]));_0x520948['attributes']=_0x520948[_0x8410('0x38')]['length']?_0x520948[_0x8410('0x38')]:_0x439981[_0x8410('0x33')];if(!_0x3852af[_0x8410('0x35')]['hasOwnProperty']('nolimit')){_0x520948[_0x8410('0x1e')]=qs[_0x8410('0x1e')](_0x3852af[_0x8410('0x35')]['limit']);_0x520948[_0x8410('0x21')]=qs[_0x8410('0x21')](_0x3852af['query'][_0x8410('0x21')]);}_0x520948[_0x8410('0x3a')]=qs[_0x8410('0x3b')](_0x3852af[_0x8410('0x35')]['sort']);_0x520948[_0x8410('0x3c')]=qs['filters'](_[_0x8410('0x3d')](_0x3852af['query'],_0x439981[_0x8410('0x3e')]),_0x1e269f);if(_0x3852af[_0x8410('0x35')][_0x8410('0x3f')]){_0x520948['where']=_['merge'](_0x520948[_0x8410('0x3c')],{'$or':_[_0x8410('0x34')](_0x1e269f,function(_0x307586){if(_0x307586[_0x8410('0x31')]!==_0x8410('0x40')){var _0xefd3c9={};_0xefd3c9[_0x307586['name']]={'$like':'%'+_0x3852af[_0x8410('0x35')][_0x8410('0x3f')]+'%'};return _0xefd3c9;}})});}_0x520948=_[_0x8410('0x41')]({},_0x520948,_0x3852af[_0x8410('0x42')]);var _0x591eb9={'where':_0x520948['where']};return db[_0x8410('0x2f')]['count'](_0x591eb9)[_0x8410('0x29')](function(_0x26bcc6){_0x2c6bf2[_0x8410('0x20')]=_0x26bcc6;if(_0x3852af[_0x8410('0x35')][_0x8410('0x43')]){_0x520948[_0x8410('0x44')]=[{'all':!![]}];}return db[_0x8410('0x2f')][_0x8410('0x45')](_0x520948);})['then'](function(_0x3a2519){_0x2c6bf2['rows']=_0x3a2519;return _0x2c6bf2;})['then'](respondWithFilteredResult(_0x33aeb4,_0x520948))[_0x8410('0x46')](handleError(_0x33aeb4,null));};exports[_0x8410('0x47')]=function(_0x91a304,_0x50025b){var _0x2d83e2={'raw':!![],'where':{'id':_0x91a304[_0x8410('0x48')]['id']}},_0xba539c={};_0xba539c[_0x8410('0x33')]=_['keys'](db[_0x8410('0x2f')][_0x8410('0x49')]);_0xba539c[_0x8410('0x35')]=_[_0x8410('0x36')](_0x91a304['query']);_0xba539c['filters']=_[_0x8410('0x37')](_0xba539c[_0x8410('0x33')],_0xba539c['query']);_0x2d83e2[_0x8410('0x38')]=_[_0x8410('0x37')](_0xba539c[_0x8410('0x33')],qs['fields'](_0x91a304['query'][_0x8410('0x39')]));_0x2d83e2['attributes']=_0x2d83e2['attributes'][_0x8410('0x4a')]?_0x2d83e2[_0x8410('0x38')]:_0xba539c[_0x8410('0x33')];if(_0x91a304[_0x8410('0x35')][_0x8410('0x43')]){_0x2d83e2['include']=[{'all':!![]}];}_0x2d83e2=_['merge']({},_0x2d83e2,_0x91a304[_0x8410('0x42')]);return db[_0x8410('0x2f')][_0x8410('0x4b')](_0x2d83e2)[_0x8410('0x29')](handleEntityNotFound(_0x50025b,null))[_0x8410('0x29')](respondWithResult(_0x50025b,null))[_0x8410('0x46')](handleError(_0x50025b,null));};exports['create']=function(_0x44191c,_0x119049){return db[_0x8410('0x2f')]['create'](_0x44191c[_0x8410('0x4c')],{})[_0x8410('0x29')](function(_0x32177f){var _0x5d675b=_0x44191c[_0x8410('0x4d')][_0x8410('0x4e')]({'plain':!![]});if(!_0x5d675b)throw new Error(_0x8410('0x4f'));if(_0x5d675b[_0x8410('0x50')]===_0x8410('0x4d')){var _0x551afc=_0x32177f[_0x8410('0x4e')]({'plain':!![]});var _0x190576=_0x8410('0x2a');return db['UserProfileSection'][_0x8410('0x4b')]({'where':{'name':_0x190576,'userProfileId':_0x5d675b['userProfileId']},'raw':!![]})[_0x8410('0x29')](function(_0x45cd1e){if(_0x45cd1e&&_0x45cd1e[_0x8410('0x51')]===0x0){return db[_0x8410('0x52')][_0x8410('0x53')]({'name':_0x551afc['name'],'resourceId':_0x551afc['id'],'type':_0x45cd1e[_0x8410('0x2c')],'sectionId':_0x45cd1e['id']},{})[_0x8410('0x29')](function(){return _0x32177f;});}else{return _0x32177f;}})[_0x8410('0x46')](function(_0x109b5f){logger['error'](_0x8410('0x54'),_0x109b5f);throw _0x109b5f;});}return _0x32177f;})[_0x8410('0x29')](respondWithResult(_0x119049,0xc9))['catch'](handleError(_0x119049,null));};exports['update']=function(_0x4638c8,_0x1721ba){if(_0x4638c8[_0x8410('0x4c')]['id']){delete _0x4638c8[_0x8410('0x4c')]['id'];}return db['Disposition']['find']({'where':{'id':_0x4638c8[_0x8410('0x48')]['id']}})[_0x8410('0x29')](handleEntityNotFound(_0x1721ba,null))[_0x8410('0x29')](saveUpdates(_0x4638c8[_0x8410('0x4c')],null))['then'](respondWithResult(_0x1721ba,null))[_0x8410('0x46')](handleError(_0x1721ba,null));};exports[_0x8410('0x28')]=function(_0xafc10a,_0x2cda3f){return db[_0x8410('0x2f')][_0x8410('0x4b')]({'where':{'id':_0xafc10a['params']['id']}})[_0x8410('0x29')](handleEntityNotFound(_0x2cda3f,null))[_0x8410('0x29')](removeEntity(_0x2cda3f,null))[_0x8410('0x46')](handleError(_0x2cda3f,null));}; \ No newline at end of file +var _0xb1a3=['Dispositions','end','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get'];(function(_0x144a8f,_0x375fd2){var _0x25c37a=function(_0x2ca597){while(--_0x2ca597){_0x144a8f['push'](_0x144a8f['shift']());}};_0x25c37a(++_0x375fd2);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0xb1a3[_0x34eb31];return _0x254994;};'use strict';var emlformat=require(_0x3b1a('0x0'));var rimraf=require(_0x3b1a('0x1'));var zipdir=require(_0x3b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b1a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b1a('0x4'));var util=require(_0x3b1a('0x5'));var path=require(_0x3b1a('0x6'));var sox=require(_0x3b1a('0x7'));var csv=require(_0x3b1a('0x8'));var ejs=require(_0x3b1a('0x9'));var fs=require('fs');var fs_extra=require(_0x3b1a('0xa'));var _=require('lodash');var squel=require(_0x3b1a('0xb'));var crypto=require(_0x3b1a('0xc'));var jsforce=require(_0x3b1a('0xd'));var deskjs=require(_0x3b1a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b1a('0xf'));var Redis=require(_0x3b1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b1a('0x12'));var logger=require('../../config/logger')(_0x3b1a('0x13'));var utils=require(_0x3b1a('0x14'));var config=require(_0x3b1a('0x15'));var licenseUtil=require(_0x3b1a('0x16'));var db=require(_0x3b1a('0x17'))['db'];function respondWithStatusCode(_0x1fea99,_0x2bd423){_0x2bd423=_0x2bd423||0xcc;return function(_0x32e77a){if(_0x32e77a){return _0x1fea99[_0x3b1a('0x18')](_0x2bd423);}return _0x1fea99['status'](_0x2bd423)['end']();};}function respondWithResult(_0x8aad4b,_0x3dfeda){_0x3dfeda=_0x3dfeda||0xc8;return function(_0x19c135){if(_0x19c135){return _0x8aad4b[_0x3b1a('0x19')](_0x3dfeda)['json'](_0x19c135);}};}function respondWithFilteredResult(_0x1b175e,_0x2f0674){return function(_0x55ac06){if(_0x55ac06){var _0x19bbc1=typeof _0x2f0674[_0x3b1a('0x1a')]===_0x3b1a('0x1b')&&typeof _0x2f0674[_0x3b1a('0x1c')]===_0x3b1a('0x1b');var _0xf10b60=_0x55ac06[_0x3b1a('0x1d')];var _0x220869=_0x19bbc1?0x0:_0x2f0674['offset'];var _0x14996f=_0x19bbc1?_0x55ac06[_0x3b1a('0x1d')]:_0x2f0674['offset']+_0x2f0674[_0x3b1a('0x1c')];var _0x5758fd;if(_0x14996f>=_0xf10b60){_0x14996f=_0xf10b60;_0x5758fd=0xc8;}else{_0x5758fd=0xce;}_0x1b175e[_0x3b1a('0x19')](_0x5758fd);return _0x1b175e[_0x3b1a('0x1e')](_0x3b1a('0x1f'),_0x220869+'-'+_0x14996f+'/'+_0xf10b60)[_0x3b1a('0x20')](_0x55ac06);}return null;};}function patchUpdates(_0xe1113d){return function(_0x13eeec){try{jsonpatch['apply'](_0x13eeec,_0xe1113d,!![]);}catch(_0x2c0a87){return BPromise[_0x3b1a('0x21')](_0x2c0a87);}return _0x13eeec[_0x3b1a('0x22')]();};}function saveUpdates(_0x1a09f1,_0x42bdf6){return function(_0x4f5f52){if(_0x4f5f52){return _0x4f5f52['update'](_0x1a09f1)[_0x3b1a('0x23')](function(_0x447d94){return _0x447d94;});}return null;};}function removeEntity(_0x5829ea,_0x3af980){return function(_0x1728df){if(_0x1728df){return _0x1728df[_0x3b1a('0x24')]()[_0x3b1a('0x23')](function(){var _0x553bb8=_0x1728df[_0x3b1a('0x25')]({'plain':!![]});var _0x417c2e=_0x3b1a('0x26');return db['UserProfileResource'][_0x3b1a('0x24')]({'where':{'type':_0x417c2e,'resourceId':_0x553bb8['id']}})[_0x3b1a('0x23')](function(){return _0x1728df;});})[_0x3b1a('0x23')](function(){_0x5829ea[_0x3b1a('0x19')](0xcc)[_0x3b1a('0x27')]();});}};}function handleEntityNotFound(_0x13c2e8,_0x4d68f3){return function(_0x43049f){if(!_0x43049f){_0x13c2e8[_0x3b1a('0x18')](0x194);}return _0x43049f;};}function handleError(_0x25fc3d,_0x181fa8){_0x181fa8=_0x181fa8||0x1f4;return function(_0x2ff415){logger[_0x3b1a('0x28')](_0x2ff415['stack']);if(_0x2ff415['name']){delete _0x2ff415[_0x3b1a('0x29')];}_0x25fc3d[_0x3b1a('0x19')](_0x181fa8)[_0x3b1a('0x2a')](_0x2ff415);};}exports[_0x3b1a('0x2b')]=function(_0x387ffa,_0xd6d630){var _0x40c9ae={},_0x3abd0a={},_0x22b748={'count':0x0,'rows':[]};var _0x4cf242=_[_0x3b1a('0x2c')](db[_0x3b1a('0x2d')][_0x3b1a('0x2e')],function(_0x36631d){return{'name':_0x36631d[_0x3b1a('0x2f')],'type':_0x36631d[_0x3b1a('0x30')][_0x3b1a('0x31')]};});_0x3abd0a[_0x3b1a('0x32')]=_[_0x3b1a('0x2c')](_0x4cf242,'name');_0x3abd0a[_0x3b1a('0x33')]=_[_0x3b1a('0x34')](_0x387ffa[_0x3b1a('0x33')]);_0x3abd0a[_0x3b1a('0x35')]=_['intersection'](_0x3abd0a[_0x3b1a('0x32')],_0x3abd0a[_0x3b1a('0x33')]);_0x40c9ae[_0x3b1a('0x36')]=_[_0x3b1a('0x37')](_0x3abd0a[_0x3b1a('0x32')],qs[_0x3b1a('0x38')](_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x38')]));_0x40c9ae['attributes']=_0x40c9ae[_0x3b1a('0x36')][_0x3b1a('0x39')]?_0x40c9ae[_0x3b1a('0x36')]:_0x3abd0a[_0x3b1a('0x32')];if(!_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x3a')](_0x3b1a('0x3b'))){_0x40c9ae['limit']=qs[_0x3b1a('0x1c')](_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x1c')]);_0x40c9ae[_0x3b1a('0x1a')]=qs['offset'](_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x1a')]);}_0x40c9ae[_0x3b1a('0x3c')]=qs[_0x3b1a('0x3d')](_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x3d')]);_0x40c9ae[_0x3b1a('0x3e')]=qs[_0x3b1a('0x35')](_[_0x3b1a('0x3f')](_0x387ffa['query'],_0x3abd0a[_0x3b1a('0x35')]),_0x4cf242);if(_0x387ffa[_0x3b1a('0x33')]['filter']){_0x40c9ae[_0x3b1a('0x3e')]=_[_0x3b1a('0x40')](_0x40c9ae[_0x3b1a('0x3e')],{'$or':_[_0x3b1a('0x2c')](_0x4cf242,function(_0x5689cb){if(_0x5689cb[_0x3b1a('0x30')]!==_0x3b1a('0x41')){var _0x215965={};_0x215965[_0x5689cb['name']]={'$like':'%'+_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x42')]+'%'};return _0x215965;}})});}_0x40c9ae=_[_0x3b1a('0x40')]({},_0x40c9ae,_0x387ffa[_0x3b1a('0x43')]);var _0x50a112={'where':_0x40c9ae['where']};return db[_0x3b1a('0x2d')][_0x3b1a('0x1d')](_0x50a112)[_0x3b1a('0x23')](function(_0x5e5d3d){_0x22b748[_0x3b1a('0x1d')]=_0x5e5d3d;if(_0x387ffa[_0x3b1a('0x33')][_0x3b1a('0x44')]){_0x40c9ae[_0x3b1a('0x45')]=[{'all':!![]}];}return db['Disposition'][_0x3b1a('0x46')](_0x40c9ae);})['then'](function(_0x5b463b){_0x22b748[_0x3b1a('0x47')]=_0x5b463b;return _0x22b748;})[_0x3b1a('0x23')](respondWithFilteredResult(_0xd6d630,_0x40c9ae))[_0x3b1a('0x48')](handleError(_0xd6d630,null));};exports['show']=function(_0x152e0a,_0x423bc1){var _0xb6b0f4={'raw':!![],'where':{'id':_0x152e0a[_0x3b1a('0x49')]['id']}},_0x3b35e0={};_0x3b35e0['model']=_[_0x3b1a('0x34')](db[_0x3b1a('0x2d')][_0x3b1a('0x2e')]);_0x3b35e0[_0x3b1a('0x33')]=_[_0x3b1a('0x34')](_0x152e0a['query']);_0x3b35e0[_0x3b1a('0x35')]=_['intersection'](_0x3b35e0[_0x3b1a('0x32')],_0x3b35e0[_0x3b1a('0x33')]);_0xb6b0f4['attributes']=_[_0x3b1a('0x37')](_0x3b35e0[_0x3b1a('0x32')],qs[_0x3b1a('0x38')](_0x152e0a[_0x3b1a('0x33')][_0x3b1a('0x38')]));_0xb6b0f4['attributes']=_0xb6b0f4[_0x3b1a('0x36')][_0x3b1a('0x39')]?_0xb6b0f4[_0x3b1a('0x36')]:_0x3b35e0[_0x3b1a('0x32')];if(_0x152e0a[_0x3b1a('0x33')][_0x3b1a('0x44')]){_0xb6b0f4[_0x3b1a('0x45')]=[{'all':!![]}];}_0xb6b0f4=_[_0x3b1a('0x40')]({},_0xb6b0f4,_0x152e0a[_0x3b1a('0x43')]);return db['Disposition'][_0x3b1a('0x4a')](_0xb6b0f4)[_0x3b1a('0x23')](handleEntityNotFound(_0x423bc1,null))[_0x3b1a('0x23')](respondWithResult(_0x423bc1,null))[_0x3b1a('0x48')](handleError(_0x423bc1,null));};exports['create']=function(_0x2b9a75,_0x2301fd){return db['Disposition']['create'](_0x2b9a75[_0x3b1a('0x4b')],{})['then'](function(_0x27e50f){var _0x580a68=_0x2b9a75['user'][_0x3b1a('0x25')]({'plain':!![]});if(!_0x580a68)throw new Error(_0x3b1a('0x4c'));if(_0x580a68[_0x3b1a('0x4d')]==='user'){var _0x1a072e=_0x27e50f[_0x3b1a('0x25')]({'plain':!![]});var _0xf305d3=_0x3b1a('0x26');return db[_0x3b1a('0x4e')][_0x3b1a('0x4a')]({'where':{'name':_0xf305d3,'userProfileId':_0x580a68[_0x3b1a('0x4f')]},'raw':!![]})[_0x3b1a('0x23')](function(_0x544e6c){if(_0x544e6c&&_0x544e6c['autoAssociation']===0x0){return db['UserProfileResource'][_0x3b1a('0x50')]({'name':_0x1a072e[_0x3b1a('0x29')],'resourceId':_0x1a072e['id'],'type':_0x544e6c['name'],'sectionId':_0x544e6c['id']},{})[_0x3b1a('0x23')](function(){return _0x27e50f;});}else{return _0x27e50f;}})['catch'](function(_0x5dd168){logger['error'](_0x3b1a('0x51'),_0x5dd168);throw _0x5dd168;});}return _0x27e50f;})[_0x3b1a('0x23')](respondWithResult(_0x2301fd,0xc9))['catch'](handleError(_0x2301fd,null));};exports[_0x3b1a('0x52')]=function(_0x466b8d,_0x9193d3){if(_0x466b8d[_0x3b1a('0x4b')]['id']){delete _0x466b8d['body']['id'];}return db[_0x3b1a('0x2d')][_0x3b1a('0x4a')]({'where':{'id':_0x466b8d[_0x3b1a('0x49')]['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x9193d3,null))[_0x3b1a('0x23')](saveUpdates(_0x466b8d[_0x3b1a('0x4b')],null))[_0x3b1a('0x23')](respondWithResult(_0x9193d3,null))['catch'](handleError(_0x9193d3,null));};exports['destroy']=function(_0x240391,_0x2dfcd2){return db[_0x3b1a('0x2d')]['find']({'where':{'id':_0x240391[_0x3b1a('0x49')]['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x2dfcd2,null))[_0x3b1a('0x23')](removeEntity(_0x2dfcd2,null))['catch'](handleError(_0x2dfcd2,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 8ac1ed4..af4fc97 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 _0x29d3=['FaxAccountId','name_openchannel','WhatsappAccountId','util','api','moment','request-promise','path','../../config/environment','exports','define','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x3eabef,_0x92ea3f){var _0x5a410d=function(_0x2babbc){while(--_0x2babbc){_0x3eabef['push'](_0x3eabef['shift']());}};_0x5a410d(++_0x92ea3f);}(_0x29d3,0x107));var _0x329d=function(_0x16dc79,_0x327142){_0x16dc79=_0x16dc79-0x0;var _0x2c8289=_0x29d3[_0x16dc79];return _0x2c8289;};'use strict';var _=require('lodash');var util=require(_0x329d('0x0'));var logger=require('../../config/logger')(_0x329d('0x1'));var moment=require(_0x329d('0x2'));var BPromise=require('bluebird');var rp=require(_0x329d('0x3'));var fs=require('fs');var path=require(_0x329d('0x4'));var rimraf=require('rimraf');var config=require(_0x329d('0x5'));var attributes=require('./disposition.attributes');module[_0x329d('0x6')]=function(_0x4e3486,_0x204b2b){return _0x4e3486[_0x329d('0x7')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x329d('0x8'),'fields':[_0x329d('0x9'),_0x329d('0xa')]},{'unique':!![],'name':'name_chat','fields':[_0x329d('0x9'),_0x329d('0xb')]},{'unique':!![],'name':_0x329d('0xc'),'fields':[_0x329d('0x9'),_0x329d('0xd')]},{'unique':!![],'name':_0x329d('0xe'),'fields':[_0x329d('0x9'),_0x329d('0xf')]},{'unique':!![],'name':_0x329d('0x10'),'fields':[_0x329d('0x9'),_0x329d('0x11')]},{'unique':!![],'name':_0x329d('0x12'),'fields':[_0x329d('0x9'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x329d('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08c9=['name','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x08c9,0xe4));var _0x908c=function(_0x2ce8f7,_0x2f5d3d){_0x2ce8f7=_0x2ce8f7-0x0;var _0x331234=_0x08c9[_0x2ce8f7];return _0x331234;};'use strict';var _=require(_0x908c('0x0'));var util=require('util');var logger=require(_0x908c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x908c('0x2'));var rp=require(_0x908c('0x3'));var fs=require('fs');var path=require(_0x908c('0x4'));var rimraf=require(_0x908c('0x5'));var config=require(_0x908c('0x6'));var attributes=require(_0x908c('0x7'));module[_0x908c('0x8')]=function(_0x13d59d,_0x4946a1){return _0x13d59d[_0x908c('0x9')]('Disposition',attributes,{'tableName':_0x908c('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x908c('0xb'),'fields':[_0x908c('0xc'),'ListId']},{'unique':!![],'name':_0x908c('0xd'),'fields':[_0x908c('0xc'),_0x908c('0xe')]},{'unique':!![],'name':_0x908c('0xf'),'fields':[_0x908c('0xc'),_0x908c('0x10')]},{'unique':!![],'name':_0x908c('0x11'),'fields':[_0x908c('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x908c('0x12'),'fields':[_0x908c('0xc'),_0x908c('0x13')]},{'unique':!![],'name':_0x908c('0x14'),'fields':[_0x908c('0xc'),_0x908c('0x15')]},{'unique':!![],'name':_0x908c('0x16'),'fields':[_0x908c('0xc'),_0x908c('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 6ad7a0e..d6fc71c 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2421cc,_0x2a99a8){var _0x173909=function(_0x13b085){while(--_0x13b085){_0x2421cc['push'](_0x2421cc['shift']());}};_0x173909(++_0x2a99a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4152f7,_0x2191f5){var _0xb7fc1b=function(_0x4313de){while(--_0x4313de){_0x4152f7['push'](_0x4152f7['shift']());}};_0xb7fc1b(++_0x2191f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 013af66..695897d 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 _0x6519=['get','isAuthenticated','index','/:id','show','post','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller'];(function(_0x12b859,_0x40804e){var _0x867976=function(_0x43246a){while(--_0x43246a){_0x12b859['push'](_0x12b859['shift']());}};_0x867976(++_0x40804e);}(_0x6519,0x1c9));var _0x9651=function(_0x3f6460,_0x3bdb9b){_0x3f6460=_0x3f6460-0x0;var _0x5d9ac6=_0x6519[_0x3f6460];return _0x5d9ac6;};'use strict';var multer=require('multer');var util=require(_0x9651('0x0'));var path=require('path');var timeout=require(_0x9651('0x1'));var express=require(_0x9651('0x2'));var router=express['Router']();var fs_extra=require(_0x9651('0x3'));var auth=require(_0x9651('0x4'));var interaction=require(_0x9651('0x5'));var config=require('../../config/environment');var controller=require(_0x9651('0x6'));router[_0x9651('0x7')]('/',auth[_0x9651('0x8')](),controller[_0x9651('0x9')]);router['get'](_0x9651('0xa'),auth[_0x9651('0x8')](),controller[_0x9651('0xb')]);router[_0x9651('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9651('0xa'),auth[_0x9651('0x8')](),controller[_0x9651('0xd')]);router['delete'](_0x9651('0xa'),auth[_0x9651('0x8')](),controller[_0x9651('0xe')]);module[_0x9651('0xf')]=router; \ No newline at end of file +var _0x7736=['./disposition.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41855e,_0x138618){var _0x4dc97d=function(_0x4e7db8){while(--_0x4e7db8){_0x41855e['push'](_0x41855e['shift']());}};_0x4dc97d(++_0x138618);}(_0x7736,0x84));var _0x6773=function(_0x3d9e54,_0x4417a1){_0x3d9e54=_0x3d9e54-0x0;var _0x563ff7=_0x7736[_0x3d9e54];return _0x563ff7;};'use strict';var multer=require(_0x6773('0x0'));var util=require(_0x6773('0x1'));var path=require(_0x6773('0x2'));var timeout=require(_0x6773('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6773('0x4'));var auth=require(_0x6773('0x5'));var interaction=require(_0x6773('0x6'));var config=require(_0x6773('0x7'));var controller=require(_0x6773('0x8'));router[_0x6773('0x9')]('/',auth[_0x6773('0xa')](),controller['index']);router[_0x6773('0x9')]('/:id',auth[_0x6773('0xa')](),controller[_0x6773('0xb')]);router[_0x6773('0xc')]('/',auth[_0x6773('0xa')](),controller[_0x6773('0xd')]);router[_0x6773('0xe')](_0x6773('0xf'),auth['isAuthenticated'](),controller[_0x6773('0x10')]);router[_0x6773('0x11')](_0x6773('0xf'),auth[_0x6773('0xa')](),controller[_0x6773('0x12')]);module[_0x6773('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 24a0471..e58985e 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 _0x3130=['ENUM','yes','xCALLY\x20Motion\x20Fax','4800','7200','14400','2400','9600','v17,v27,v29','INTEGER','IAX','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x6f91b0,_0x2b25eb){var _0x4ac42f=function(_0x5cb247){while(--_0x5cb247){_0x6f91b0['push'](_0x6f91b0['shift']());}};_0x4ac42f(++_0x2b25eb);}(_0x3130,0xef));var _0x0313=function(_0x4c3c98,_0x559b0c){_0x4c3c98=_0x4c3c98-0x0;var _0x467c76=_0x3130[_0x4c3c98];return _0x467c76;};'use strict';var Sequelize=require(_0x0313('0x0'));module[_0x0313('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0313('0x2')]},'ecm':{'type':Sequelize[_0x0313('0x3')](_0x0313('0x4'),'no'),'defaultValue':_0x0313('0x4')},'headerinfo':{'type':Sequelize[_0x0313('0x2')],'defaultValue':_0x0313('0x5')},'localstationid':{'type':Sequelize[_0x0313('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x0313('0x3')]('2400',_0x0313('0x6'),_0x0313('0x7'),'9600','12000',_0x0313('0x8')),'defaultValue':_0x0313('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0x0313('0x9'),_0x0313('0x6'),_0x0313('0x7'),_0x0313('0xa'),'12000',_0x0313('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x0313('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0313('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0313('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0313('0x3')]('SIP',_0x0313('0xd'),'DADHI',_0x0313('0xe')),'defaultValue':_0x0313('0xf')},'key':{'type':Sequelize[_0x0313('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0313('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0313('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0313('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0313('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0313('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0313('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x0313('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x0313('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a522c){if(!_0x2a522c)this[_0x0313('0x13')](_0x0313('0x14'),null);this['setDataValue'](_0x0313('0x15'),_0x2a522c);}}}; \ No newline at end of file +var _0x34fc=['xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','ENUM','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','mandatoryDispositionPauseId','mandatoryDisposition','STRING','yes'];(function(_0x24fc8f,_0xabf1bb){var _0x89cbf1=function(_0x1aed12){while(--_0x1aed12){_0x24fc8f['push'](_0x24fc8f['shift']());}};_0x89cbf1(++_0xabf1bb);}(_0x34fc,0x12e));var _0xc34f=function(_0x381349,_0x440c28){_0x381349=_0x381349-0x0;var _0x57c718=_0x34fc[_0x381349];return _0x57c718;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc34f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc34f('0x0')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xc34f('0x1')},'headerinfo':{'type':Sequelize[_0xc34f('0x0')],'defaultValue':_0xc34f('0x2')},'localstationid':{'type':Sequelize[_0xc34f('0x0')],'unique':_0xc34f('0x3')},'minrate':{'type':Sequelize['ENUM'](_0xc34f('0x4'),_0xc34f('0x5'),_0xc34f('0x6'),_0xc34f('0x7'),'12000',_0xc34f('0x8')),'defaultValue':_0xc34f('0x5')},'maxrate':{'type':Sequelize[_0xc34f('0x9')]('2400',_0xc34f('0x5'),_0xc34f('0x6'),'9600','12000',_0xc34f('0x8')),'defaultValue':_0xc34f('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xc34f('0xa')},'gateway':{'type':Sequelize[_0xc34f('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc34f('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc34f('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc34f('0x9')](_0xc34f('0xc'),'IAX',_0xc34f('0xd'),_0xc34f('0xe')),'defaultValue':_0xc34f('0xc')},'key':{'type':Sequelize[_0xc34f('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc34f('0xf');}},'notificationSound':{'type':Sequelize[_0xc34f('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc34f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc34f('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc34f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc34f('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc34f('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x497bd5){if(!_0x497bd5)this['setDataValue'](_0xc34f('0x11'),null);this['setDataValue'](_0xc34f('0x12'),_0x497bd5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f0e4b77..bb8ad95 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 _0xb9a5=['userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','status','stack','name','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','Pause','find','create','user','UserProfileSection','autoAssociation','body','params','describe','addDisposition','FaxAccountId','getDispositions','Disposition','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','from-voip-provider','exten','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save'];(function(_0x162f4b,_0x31b569){var _0x57b00b=function(_0xef34c9){while(--_0xef34c9){_0x162f4b['push'](_0x162f4b['shift']());}};_0x57b00b(++_0x31b569);}(_0xb9a5,0x18e));var _0x5b9a=function(_0x1c57a5,_0x433064){_0x1c57a5=_0x1c57a5-0x0;var _0x3dadb9=_0xb9a5[_0x1c57a5];return _0x3dadb9;};'use strict';var emlformat=require(_0x5b9a('0x0'));var rimraf=require(_0x5b9a('0x1'));var zipdir=require(_0x5b9a('0x2'));var jsonpatch=require(_0x5b9a('0x3'));var rp=require(_0x5b9a('0x4'));var moment=require(_0x5b9a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b9a('0x6'));var path=require(_0x5b9a('0x7'));var sox=require(_0x5b9a('0x8'));var csv=require(_0x5b9a('0x9'));var ejs=require(_0x5b9a('0xa'));var fs=require('fs');var fs_extra=require(_0x5b9a('0xb'));var _=require(_0x5b9a('0xc'));var squel=require(_0x5b9a('0xd'));var crypto=require('crypto');var jsforce=require(_0x5b9a('0xe'));var deskjs=require(_0x5b9a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5b9a('0x10'));var Papa=require(_0x5b9a('0x11'));var Redis=require(_0x5b9a('0x12'));var authService=require(_0x5b9a('0x13'));var qs=require(_0x5b9a('0x14'));var as=require(_0x5b9a('0x15'));var hardwareService=require(_0x5b9a('0x16'));var logger=require(_0x5b9a('0x17'))(_0x5b9a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b9a('0x19'));var db=require(_0x5b9a('0x1a'))['db'];config[_0x5b9a('0x1b')]=_['defaults'](config[_0x5b9a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b9a('0x1c'))(new Redis(config[_0x5b9a('0x1b')]));require(_0x5b9a('0x1d'))[_0x5b9a('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5b9a('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x5b9a('0x1f')][_0x5b9a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x21505b,_0xa8e080,_0x28fbd9,_0x3dd7a1){return new BPromise(function(_0x6fd41b,_0x45f3f5){var _0x3880e7=_0x3dd7a1||client;return _0x3880e7[_0x5b9a('0x21')](_0x21505b,_0x28fbd9)[_0x5b9a('0x22')](function(_0x186d6e){logger[_0x5b9a('0x23')](_0x5b9a('0x24'),_0xa8e080,_0x5b9a('0x25'));logger[_0x5b9a('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xa8e080,_0x5b9a('0x25'),JSON['stringify'](_0x186d6e));if(_0x186d6e[_0x5b9a('0x27')]){if(_0x186d6e['error']['code']===0x1f4){logger[_0x5b9a('0x27')]('FaxAccount,\x20%s,\x20%s',_0xa8e080,_0x186d6e[_0x5b9a('0x27')][_0x5b9a('0x28')]);return _0x45f3f5(_0x186d6e[_0x5b9a('0x27')][_0x5b9a('0x28')]);}logger[_0x5b9a('0x27')](_0x5b9a('0x24'),_0xa8e080,_0x186d6e[_0x5b9a('0x27')]['message']);return _0x6fd41b(_0x186d6e[_0x5b9a('0x27')]['message']);}else{logger[_0x5b9a('0x23')](_0x5b9a('0x24'),_0xa8e080,_0x5b9a('0x25'));_0x6fd41b(_0x186d6e[_0x5b9a('0x29')][_0x5b9a('0x28')]);}})[_0x5b9a('0x2a')](function(_0x327522){logger[_0x5b9a('0x27')]('FaxAccount,\x20%s,\x20%s',_0xa8e080,_0x327522);_0x45f3f5(_0x327522);});});}function respondWithStatusCode(_0x17fed3,_0x199535){_0x199535=_0x199535||0xcc;return function(_0x13c594){if(_0x13c594){return _0x17fed3[_0x5b9a('0x2b')](_0x199535);}return _0x17fed3['status'](_0x199535)[_0x5b9a('0x2c')]();};}function respondWithResult(_0x1ef6e3,_0x5eaf1b){_0x5eaf1b=_0x5eaf1b||0xc8;return function(_0x5dec65){if(_0x5dec65){return _0x1ef6e3['status'](_0x5eaf1b)[_0x5b9a('0x2d')](_0x5dec65);}};}function respondWithFilteredResult(_0x54b0db,_0x2e1c4e){return function(_0x48616e){if(_0x48616e){var _0x220b69=typeof _0x2e1c4e[_0x5b9a('0x2e')]===_0x5b9a('0x2f')&&typeof _0x2e1c4e[_0x5b9a('0x30')]===_0x5b9a('0x2f');var _0x3b54dd=_0x48616e[_0x5b9a('0x31')];var _0x5d4345=_0x220b69?0x0:_0x2e1c4e[_0x5b9a('0x2e')];var _0xaf4e80=_0x220b69?_0x48616e['count']:_0x2e1c4e[_0x5b9a('0x2e')]+_0x2e1c4e[_0x5b9a('0x30')];var _0x55a8bc;if(_0xaf4e80>=_0x3b54dd){_0xaf4e80=_0x3b54dd;_0x55a8bc=0xc8;}else{_0x55a8bc=0xce;}_0x54b0db['status'](_0x55a8bc);return _0x54b0db[_0x5b9a('0x32')](_0x5b9a('0x33'),_0x5d4345+'-'+_0xaf4e80+'/'+_0x3b54dd)[_0x5b9a('0x2d')](_0x48616e);}return null;};}function patchUpdates(_0xd6a67){return function(_0x54f3f7){try{jsonpatch[_0x5b9a('0x34')](_0x54f3f7,_0xd6a67,!![]);}catch(_0x44c813){return BPromise[_0x5b9a('0x35')](_0x44c813);}return _0x54f3f7[_0x5b9a('0x36')]();};}function saveUpdates(_0x352cdd,_0x3c76bc){return function(_0x18bd98){if(_0x18bd98){return _0x18bd98[_0x5b9a('0x37')](_0x352cdd)['then'](function(_0x3f67a0){return _0x3f67a0;});}return null;};}function removeEntity(_0x3bb3b3,_0x2eacad){return function(_0x59fafc){if(_0x59fafc){return _0x59fafc[_0x5b9a('0x38')]()['then'](function(){var _0x33fe9a=_0x59fafc[_0x5b9a('0x39')]({'plain':!![]});var _0x33ffd9=_0x5b9a('0x3a');return db[_0x5b9a('0x3b')]['destroy']({'where':{'type':_0x33ffd9,'resourceId':_0x33fe9a['id']}})[_0x5b9a('0x22')](function(){return _0x59fafc;});})[_0x5b9a('0x22')](function(){_0x3bb3b3[_0x5b9a('0x3c')](0xcc)[_0x5b9a('0x2c')]();});}};}function handleEntityNotFound(_0x2ab572,_0x30e091){return function(_0xaff85a){if(!_0xaff85a){_0x2ab572[_0x5b9a('0x2b')](0x194);}return _0xaff85a;};}function handleError(_0x1a05ff,_0x29724a){_0x29724a=_0x29724a||0x1f4;return function(_0x27e042){logger[_0x5b9a('0x27')](_0x27e042[_0x5b9a('0x3d')]);if(_0x27e042['name']){delete _0x27e042[_0x5b9a('0x3e')];}_0x1a05ff[_0x5b9a('0x3c')](_0x29724a)['send'](_0x27e042);};}exports[_0x5b9a('0x3f')]=function(_0x22677d,_0x1a42d2){var _0x3d729a={'include':[{'model':db['Pause'],'as':_0x5b9a('0x40')}]},_0x2fdd6e={},_0x4353f1={'count':0x0,'rows':[]};var _0x1ab99f=_['map'](db[_0x5b9a('0x41')][_0x5b9a('0x42')],function(_0x3ac3eb){return{'name':_0x3ac3eb[_0x5b9a('0x43')],'type':_0x3ac3eb[_0x5b9a('0x44')][_0x5b9a('0x45')]};});_0x2fdd6e[_0x5b9a('0x46')]=_[_0x5b9a('0x47')](_0x1ab99f,'name');_0x2fdd6e[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x22677d[_0x5b9a('0x48')]);_0x2fdd6e['filters']=_[_0x5b9a('0x4a')](_0x2fdd6e['model'],_0x2fdd6e[_0x5b9a('0x48')]);_0x3d729a[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x2fdd6e['model'],qs[_0x5b9a('0x4c')](_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x3d729a['attributes']=_0x3d729a[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x3d729a[_0x5b9a('0x4b')]:_0x2fdd6e[_0x5b9a('0x46')];if(!_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x3d729a[_0x5b9a('0x30')]=qs['limit'](_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x3d729a['offset']=qs[_0x5b9a('0x2e')](_0x22677d[_0x5b9a('0x48')]['offset']);}_0x3d729a[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x22677d[_0x5b9a('0x48')]['sort']);_0x3d729a[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_[_0x5b9a('0x54')](_0x22677d[_0x5b9a('0x48')],_0x2fdd6e[_0x5b9a('0x53')]),_0x1ab99f);if(_0x22677d[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x3d729a[_0x5b9a('0x52')]=_[_0x5b9a('0x56')](_0x3d729a[_0x5b9a('0x52')],{'$or':_[_0x5b9a('0x47')](_0x1ab99f,function(_0x17db5c){if(_0x17db5c['type']!==_0x5b9a('0x57')){var _0x361f56={};_0x361f56[_0x17db5c['name']]={'$like':'%'+_0x22677d['query']['filter']+'%'};return _0x361f56;}})});}_0x3d729a=_[_0x5b9a('0x56')]({},_0x3d729a,_0x22677d[_0x5b9a('0x58')]);var _0x30d595={'where':_0x3d729a[_0x5b9a('0x52')]};return db[_0x5b9a('0x41')][_0x5b9a('0x31')](_0x30d595)[_0x5b9a('0x22')](function(_0x2672dd){_0x4353f1[_0x5b9a('0x31')]=_0x2672dd;if(_0x22677d[_0x5b9a('0x48')]['includeAll']){_0x3d729a[_0x5b9a('0x59')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x3d729a);})['then'](function(_0x2e416c){_0x4353f1[_0x5b9a('0x5a')]=_0x2e416c;return _0x4353f1;})[_0x5b9a('0x22')](respondWithFilteredResult(_0x1a42d2,_0x3d729a))['catch'](handleError(_0x1a42d2,null));};exports[_0x5b9a('0x5b')]=function(_0x178a72,_0x58af38){var _0x28c3b0={'raw':![],'where':{'id':_0x178a72['params']['id']},'include':[{'model':db[_0x5b9a('0x5c')],'as':_0x5b9a('0x40')}]},_0x714999={};_0x714999[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0x41')][_0x5b9a('0x42')]);_0x714999[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x178a72[_0x5b9a('0x48')]);_0x714999[_0x5b9a('0x53')]=_['intersection'](_0x714999[_0x5b9a('0x46')],_0x714999[_0x5b9a('0x48')]);_0x28c3b0[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x714999[_0x5b9a('0x46')],qs['fields'](_0x178a72['query']['fields']));_0x28c3b0['attributes']=_0x28c3b0[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x28c3b0[_0x5b9a('0x4b')]:_0x714999[_0x5b9a('0x46')];if(_0x178a72['query']['includeAll']){_0x28c3b0[_0x5b9a('0x59')]=[{'all':!![]}];}_0x28c3b0=_['merge']({},_0x28c3b0,_0x178a72[_0x5b9a('0x58')]);return db['FaxAccount'][_0x5b9a('0x5d')](_0x28c3b0)[_0x5b9a('0x22')](handleEntityNotFound(_0x58af38,null))[_0x5b9a('0x22')](respondWithResult(_0x58af38,null))[_0x5b9a('0x2a')](handleError(_0x58af38,null));};exports[_0x5b9a('0x5e')]=function(_0x27245e,_0x5500fc){return db[_0x5b9a('0x41')][_0x5b9a('0x5e')](_0x27245e['body'],{})[_0x5b9a('0x22')](function(_0x1e4e5d){var _0x1a031c=_0x27245e[_0x5b9a('0x5f')][_0x5b9a('0x39')]({'plain':!![]});if(!_0x1a031c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a031c['role']===_0x5b9a('0x5f')){var _0x5dd2bd=_0x1e4e5d[_0x5b9a('0x39')]({'plain':!![]});var _0x472088=_0x5b9a('0x3a');return db[_0x5b9a('0x60')][_0x5b9a('0x5d')]({'where':{'name':_0x472088,'userProfileId':_0x1a031c['userProfileId']},'raw':!![]})[_0x5b9a('0x22')](function(_0x34b078){if(_0x34b078&&_0x34b078[_0x5b9a('0x61')]===0x0){return db['UserProfileResource'][_0x5b9a('0x5e')]({'name':_0x5dd2bd[_0x5b9a('0x3e')],'resourceId':_0x5dd2bd['id'],'type':_0x34b078['name'],'sectionId':_0x34b078['id']},{})['then'](function(){return _0x1e4e5d;});}else{return _0x1e4e5d;}})[_0x5b9a('0x2a')](function(_0x2571bd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2571bd);throw _0x2571bd;});}return _0x1e4e5d;})['then'](respondWithResult(_0x5500fc,0xc9))[_0x5b9a('0x2a')](handleError(_0x5500fc,null));};exports['update']=function(_0x8ce41b,_0x183a60){if(_0x8ce41b[_0x5b9a('0x62')]['id']){delete _0x8ce41b[_0x5b9a('0x62')]['id'];}return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x8ce41b[_0x5b9a('0x63')]['id']},'include':[{'model':db[_0x5b9a('0x5c')],'as':'mandatoryDispositionPause'}]})[_0x5b9a('0x22')](handleEntityNotFound(_0x183a60,null))[_0x5b9a('0x22')](saveUpdates(_0x8ce41b['body'],null))['then'](respondWithResult(_0x183a60,null))['catch'](handleError(_0x183a60,null));};exports[_0x5b9a('0x38')]=function(_0x34e4db,_0x3e24c5){return db['FaxAccount'][_0x5b9a('0x5d')]({'where':{'id':_0x34e4db[_0x5b9a('0x63')]['id']}})['then'](handleEntityNotFound(_0x3e24c5,null))[_0x5b9a('0x22')](removeEntity(_0x3e24c5,null))[_0x5b9a('0x2a')](handleError(_0x3e24c5,null));};exports[_0x5b9a('0x64')]=function(_0x1bcefe,_0x3fcaa7){return db[_0x5b9a('0x41')][_0x5b9a('0x64')]()[_0x5b9a('0x22')](respondWithResult(_0x3fcaa7,null))[_0x5b9a('0x2a')](handleError(_0x3fcaa7,null));};exports[_0x5b9a('0x65')]=function(_0x833cd8,_0x5c665f,_0x113dd3){if(_0x833cd8['body']['id']){delete _0x833cd8[_0x5b9a('0x62')]['id'];}return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x833cd8[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x5c665f,null))[_0x5b9a('0x22')](function(_0x5d5f18){if(_0x5d5f18){_0x833cd8[_0x5b9a('0x62')][_0x5b9a('0x66')]=_0x5d5f18['id'];return db['Disposition'][_0x5b9a('0x5e')](_0x833cd8[_0x5b9a('0x62')]);}})[_0x5b9a('0x22')](respondWithResult(_0x5c665f,null))['catch'](handleError(_0x5c665f,null));};exports[_0x5b9a('0x67')]=function(_0x2c68c6,_0x46b2bc,_0x290583){var _0x2705a2={'raw':![],'where':{}};var _0x4503c1={};var _0x123a3d={'count':0x0,'rows':[]};return db[_0x5b9a('0x41')]['findOne']({'where':{'id':_0x2c68c6[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x46b2bc,null))['then'](function(_0x1c5097){if(_0x1c5097){_0x4503c1[_0x5b9a('0x46')]=_['keys'](db[_0x5b9a('0x68')][_0x5b9a('0x42')]);_0x4503c1[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x2c68c6['query']);_0x4503c1['filters']=_[_0x5b9a('0x4a')](_0x4503c1[_0x5b9a('0x46')],_0x4503c1[_0x5b9a('0x48')]);_0x2705a2[_0x5b9a('0x4b')]=_['intersection'](_0x4503c1[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x2705a2[_0x5b9a('0x4b')]=_0x2705a2[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x2705a2['attributes']:_0x4503c1[_0x5b9a('0x46')];if(!_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x2705a2[_0x5b9a('0x30')]=qs['limit'](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x2705a2['offset']=qs[_0x5b9a('0x2e')](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x2e')]);}_0x2705a2[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x51')]);_0x2705a2[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_[_0x5b9a('0x54')](_0x2c68c6[_0x5b9a('0x48')],_0x4503c1[_0x5b9a('0x53')]));_0x2705a2[_0x5b9a('0x52')][_0x5b9a('0x66')]=_0x1c5097['id'];if(_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x2705a2[_0x5b9a('0x52')]=_['merge'](_0x2705a2[_0x5b9a('0x52')],{'$or':_[_0x5b9a('0x47')](_0x2705a2[_0x5b9a('0x4b')],function(_0x1ec825){var _0x7608b5={};_0x7608b5[_0x1ec825]={'$like':'%'+_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x7608b5;})});}_0x2705a2=_[_0x5b9a('0x56')]({},_0x2705a2,_0x2c68c6[_0x5b9a('0x58')]);return db[_0x5b9a('0x68')][_0x5b9a('0x31')]({'where':_0x2705a2[_0x5b9a('0x52')]})[_0x5b9a('0x22')](function(_0x2e4ae6){_0x123a3d[_0x5b9a('0x31')]=_0x2e4ae6;if(_0x2c68c6[_0x5b9a('0x48')][_0x5b9a('0x69')]){_0x2705a2[_0x5b9a('0x59')]=[{'all':!![]}];}return db[_0x5b9a('0x68')]['findAll'](_0x2705a2);})['then'](function(_0x5a7920){_0x123a3d[_0x5b9a('0x5a')]=_0x5a7920;return _0x123a3d;});}})['then'](respondWithFilteredResult(_0x46b2bc,_0x2705a2))[_0x5b9a('0x2a')](handleError(_0x46b2bc,null));};exports[_0x5b9a('0x6a')]=function(_0x15b1e2,_0x4bff70,_0xfe6165){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x15b1e2['params']['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x4bff70,null))[_0x5b9a('0x22')](function(_0x558836){if(_0x558836){return _0x558836[_0x5b9a('0x6a')](_0x15b1e2[_0x5b9a('0x48')][_0x5b9a('0x6b')]);}})[_0x5b9a('0x22')](respondWithStatusCode(_0x4bff70,null))[_0x5b9a('0x2a')](handleError(_0x4bff70,null));};exports[_0x5b9a('0x6c')]=function(_0x1b8058,_0xa6424e,_0x59075c){if(_0x1b8058[_0x5b9a('0x62')]['id']){delete _0x1b8058[_0x5b9a('0x62')]['id'];}return db[_0x5b9a('0x41')]['find']({'where':{'id':_0x1b8058[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0xa6424e,null))[_0x5b9a('0x22')](function(_0x491142){if(_0x491142){_0x1b8058['body'][_0x5b9a('0x66')]=_0x491142['id'];return db[_0x5b9a('0x6d')][_0x5b9a('0x5e')](_0x1b8058[_0x5b9a('0x62')]);}})[_0x5b9a('0x22')](respondWithResult(_0xa6424e,null))[_0x5b9a('0x2a')](handleError(_0xa6424e,null));};exports[_0x5b9a('0x6e')]=function(_0x34f88d,_0x4da7c6,_0x40bcd2){var _0x46ae0f={'raw':![],'where':{}};var _0x56034c={};var _0x55292c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5b9a('0x6f')]({'where':{'id':_0x34f88d[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x4da7c6,null))[_0x5b9a('0x22')](function(_0x551583){if(_0x551583){_0x56034c[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0x6d')][_0x5b9a('0x42')]);_0x56034c[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x34f88d[_0x5b9a('0x48')]);_0x56034c['filters']=_[_0x5b9a('0x4a')](_0x56034c[_0x5b9a('0x46')],_0x56034c[_0x5b9a('0x48')]);_0x46ae0f[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x56034c[_0x5b9a('0x46')],qs['fields'](_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x46ae0f['attributes']=_0x46ae0f['attributes'][_0x5b9a('0x4d')]?_0x46ae0f[_0x5b9a('0x4b')]:_0x56034c[_0x5b9a('0x46')];if(!_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x46ae0f[_0x5b9a('0x30')]=qs[_0x5b9a('0x30')](_0x34f88d[_0x5b9a('0x48')]['limit']);_0x46ae0f['offset']=qs['offset'](_0x34f88d['query'][_0x5b9a('0x2e')]);}_0x46ae0f[_0x5b9a('0x50')]=qs['sort'](_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x51')]);_0x46ae0f[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_['pick'](_0x34f88d[_0x5b9a('0x48')],_0x56034c[_0x5b9a('0x53')]));_0x46ae0f[_0x5b9a('0x52')][_0x5b9a('0x66')]=_0x551583['id'];if(_0x34f88d[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x46ae0f['where']=_['merge'](_0x46ae0f[_0x5b9a('0x52')],{'$or':_['map'](_0x46ae0f['attributes'],function(_0x18159f){var _0x4b1829={};_0x4b1829[_0x18159f]={'$like':'%'+_0x34f88d['query']['filter']+'%'};return _0x4b1829;})});}_0x46ae0f=_[_0x5b9a('0x56')]({},_0x46ae0f,_0x34f88d[_0x5b9a('0x58')]);return db['CannedAnswer']['count']({'where':_0x46ae0f[_0x5b9a('0x52')]})['then'](function(_0x5e5ad0){_0x55292c[_0x5b9a('0x31')]=_0x5e5ad0;if(_0x34f88d[_0x5b9a('0x48')]['includeAll']){_0x46ae0f['include']=[{'all':!![]}];}return db[_0x5b9a('0x6d')][_0x5b9a('0x70')](_0x46ae0f);})[_0x5b9a('0x22')](function(_0xa19f02){_0x55292c[_0x5b9a('0x5a')]=_0xa19f02;return _0x55292c;});}})[_0x5b9a('0x22')](respondWithFilteredResult(_0x4da7c6,_0x46ae0f))[_0x5b9a('0x2a')](handleError(_0x4da7c6,null));};exports[_0x5b9a('0x71')]=function(_0x44ec94,_0x1bc7f5,_0x299ede){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x44ec94['params']['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x1bc7f5,null))[_0x5b9a('0x22')](function(_0x4327ee){if(_0x4327ee){return _0x4327ee['removeAnswers'](_0x44ec94[_0x5b9a('0x48')][_0x5b9a('0x6b')]);}})[_0x5b9a('0x22')](respondWithStatusCode(_0x1bc7f5,null))[_0x5b9a('0x2a')](handleError(_0x1bc7f5,null));};exports[_0x5b9a('0x72')]=function(_0x23b6fc,_0x36b816,_0x435d5f){return db[_0x5b9a('0x73')]['find']({'where':{'id':_0x23b6fc[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x36b816,null))[_0x5b9a('0x22')](function(_0x441f34){if(_0x441f34){return _0x441f34[_0x5b9a('0x72')](_0x23b6fc['body'][_0x5b9a('0x6b')],_[_0x5b9a('0x74')](_0x23b6fc[_0x5b9a('0x62')],[_0x5b9a('0x6b'),'id'])||{});}})[_0x5b9a('0x22')](respondWithResult(_0x36b816,null))[_0x5b9a('0x2a')](handleError(_0x36b816,null));};exports[_0x5b9a('0x75')]=function(_0x227858,_0x57ea78,_0x401be2){var _0x23c47a={'raw':![],'where':{}};var _0x59df8c={};var _0x569066={'count':0x0,'rows':[]};return db[_0x5b9a('0x41')][_0x5b9a('0x6f')]({'where':{'id':_0x227858[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x57ea78,null))['then'](function(_0x416e4c){if(_0x416e4c){_0x59df8c[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db['FaxInteraction'][_0x5b9a('0x42')]);_0x59df8c[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x227858['query']);_0x59df8c[_0x5b9a('0x53')]=_[_0x5b9a('0x4a')](_0x59df8c[_0x5b9a('0x46')],_0x59df8c[_0x5b9a('0x48')]);_0x23c47a[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x59df8c['model'],qs['fields'](_0x227858[_0x5b9a('0x48')]['fields']));_0x23c47a['attributes']=_0x23c47a[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x23c47a[_0x5b9a('0x4b')]:_0x59df8c[_0x5b9a('0x46')];if(!_0x227858['query'][_0x5b9a('0x4e')]('nolimit')){_0x23c47a[_0x5b9a('0x30')]=qs[_0x5b9a('0x30')](_0x227858[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x23c47a[_0x5b9a('0x2e')]=qs[_0x5b9a('0x2e')](_0x227858[_0x5b9a('0x48')][_0x5b9a('0x2e')]);}_0x23c47a['order']=qs[_0x5b9a('0x51')](_0x227858['query'][_0x5b9a('0x51')]);_0x23c47a[_0x5b9a('0x52')]=qs[_0x5b9a('0x53')](_[_0x5b9a('0x54')](_0x227858['query'],_0x59df8c['filters']));_0x23c47a[_0x5b9a('0x52')][_0x5b9a('0x66')]=_0x416e4c['id'];if(_0x227858['query']['filter']){_0x23c47a['where']=_[_0x5b9a('0x56')](_0x23c47a['where'],{'$or':_['map'](_0x23c47a[_0x5b9a('0x4b')],function(_0x302e68){var _0x2a16a2={};_0x2a16a2[_0x302e68]={'$like':'%'+_0x227858[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x2a16a2;})});}_0x23c47a=_[_0x5b9a('0x56')]({},_0x23c47a,_0x227858[_0x5b9a('0x58')]);return db[_0x5b9a('0x73')][_0x5b9a('0x31')]({'where':_0x23c47a[_0x5b9a('0x52')]})[_0x5b9a('0x22')](function(_0x197306){_0x569066[_0x5b9a('0x31')]=_0x197306;if(_0x227858['query']['includeAll']){_0x23c47a[_0x5b9a('0x59')]=[{'model':db[_0x5b9a('0x76')],'as':_0x5b9a('0x77'),'required':![]},{'model':db[_0x5b9a('0x78')],'as':_0x5b9a('0x79'),'attributes':[_0x5b9a('0x3e'),_0x5b9a('0x7a'),_0x5b9a('0x7b')],'required':![]},{'model':db[_0x5b9a('0x7c')],'as':_0x5b9a('0x7d'),'attributes':['id',_0x5b9a('0x3e'),'color'],'where':_0x227858[_0x5b9a('0x48')][_0x5b9a('0x7e')]?{'id':_0x227858[_0x5b9a('0x48')][_0x5b9a('0x7e')]}:undefined,'required':_0x227858[_0x5b9a('0x48')]['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x23c47a);})[_0x5b9a('0x22')](function(_0x391ded){_0x569066[_0x5b9a('0x5a')]=_0x391ded;return _0x569066;});}})[_0x5b9a('0x22')](respondWithFilteredResult(_0x57ea78,_0x23c47a))['catch'](handleError(_0x57ea78,null));};exports[_0x5b9a('0x7f')]=function(_0x9ebfb2,_0x46db0c){var _0x9b3bd6=_0x9ebfb2[_0x5b9a('0x63')]['id'];var _0x17ee45=_0x9ebfb2[_0x5b9a('0x62')];var _0x1349b0=0xc8;var _0x48ce00=null;return db[_0x5b9a('0x80')][_0x5b9a('0x81')]({'isolationLevel':db[_0x5b9a('0x80')][_0x5b9a('0x82')][_0x5b9a('0x83')][_0x5b9a('0x84')]},function(_0x2a3121){return db[_0x5b9a('0x41')]['findOne']({'where':{'id':_0x9b3bd6},'transaction':_0x2a3121})[_0x5b9a('0x22')](function(_0x1d6a1e){if(_0x1d6a1e){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x9b3bd6},'transaction':_0x2a3121})[_0x5b9a('0x22')](function(){var _0x3a39f4=_[_0x5b9a('0x47')](_0x17ee45,function(_0x2add1f){_0x2add1f['FaxAccountId']=_0x9b3bd6;return _0x2add1f;});return db[_0x5b9a('0x85')][_0x5b9a('0x86')](_0x3a39f4,{'transaction':_0x2a3121});});}else{_0x1349b0=0x194;_0x48ce00=[];}});})[_0x5b9a('0x22')](function(){if(_0x1349b0!==0x194){return db[_0x5b9a('0x85')][_0x5b9a('0x87')]({'where':{'FaxAccountId':_0x9b3bd6},'order':_0x5b9a('0x88')})[_0x5b9a('0x22')](function(_0xc11d6b){_0x48ce00=_0xc11d6b;});}})[_0x5b9a('0x2a')](function(_0x518c17){_0x1349b0=0x1f4;logger[_0x5b9a('0x27')](_0x518c17['stack']);if(_0x518c17[_0x5b9a('0x3e')]){delete _0x518c17['name'];}_0x48ce00=_0x518c17;})[_0x5b9a('0x89')](function(){if(_0x48ce00===null){_0x46db0c[_0x5b9a('0x2b')](_0x1349b0);}else{if(_0x1349b0===0x1f4){_0x46db0c[_0x5b9a('0x3c')](_0x1349b0)[_0x5b9a('0x8a')](_0x48ce00);}else{_0x46db0c[_0x5b9a('0x3c')](_0x1349b0)[_0x5b9a('0x2d')](_0x48ce00);}}});};exports[_0x5b9a('0x8b')]=function(_0x23e215,_0x5ed50a,_0x5100bd){var _0x4582f={};var _0x2cc791={};var _0x2b075f;var _0x413b1e;return db[_0x5b9a('0x41')][_0x5b9a('0x6f')]({'where':{'id':_0x23e215[_0x5b9a('0x63')]['id']}})['then'](handleEntityNotFound(_0x5ed50a,null))['then'](function(_0x18d4e5){if(_0x18d4e5){_0x2b075f=_0x18d4e5;_0x2cc791[_0x5b9a('0x46')]=_['keys'](db['FaxApplication'][_0x5b9a('0x42')]);_0x2cc791[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x23e215[_0x5b9a('0x48')]);_0x2cc791[_0x5b9a('0x53')]=_[_0x5b9a('0x4a')](_0x2cc791[_0x5b9a('0x46')],_0x2cc791['query']);_0x4582f[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x2cc791[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x4582f[_0x5b9a('0x4b')]=_0x4582f[_0x5b9a('0x4b')][_0x5b9a('0x4d')]?_0x4582f[_0x5b9a('0x4b')]:_0x2cc791[_0x5b9a('0x46')];_0x4582f['order']=qs[_0x5b9a('0x51')](_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x51')]);_0x4582f[_0x5b9a('0x52')]=qs['filters'](_[_0x5b9a('0x54')](_0x23e215[_0x5b9a('0x48')],_0x2cc791[_0x5b9a('0x53')]));if(_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x4582f[_0x5b9a('0x52')]=_['merge'](_0x4582f[_0x5b9a('0x52')],{'$or':_['map'](_0x4582f[_0x5b9a('0x4b')],function(_0x2b3f0b){var _0x2b87f0={};_0x2b87f0[_0x2b3f0b]={'$like':'%'+_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x2b87f0;})});}_0x4582f=_['merge']({},_0x4582f,_0x23e215[_0x5b9a('0x58')]);return _0x2b075f[_0x5b9a('0x8b')](_0x4582f);}})[_0x5b9a('0x22')](function(_0x33206b){if(_0x33206b){_0x413b1e=_0x33206b[_0x5b9a('0x4d')];if(!_0x23e215[_0x5b9a('0x48')]['hasOwnProperty'](_0x5b9a('0x4f'))){_0x4582f[_0x5b9a('0x30')]=qs['limit'](_0x23e215[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x4582f[_0x5b9a('0x2e')]=qs['offset'](_0x23e215['query'][_0x5b9a('0x2e')]);}return _0x2b075f[_0x5b9a('0x8b')](_0x4582f);}})[_0x5b9a('0x22')](function(_0x571319){if(_0x571319){return _0x571319?{'count':_0x413b1e,'rows':_0x571319}:null;}})[_0x5b9a('0x22')](respondWithResult(_0x5ed50a,null))[_0x5b9a('0x2a')](handleError(_0x5ed50a,null));};function Extension(_0x37a551,_0x40afc2,_0x30fdbc,_0x195481){this['context']=_0x5b9a('0x8c');this[_0x5b9a('0x8d')]=_0x37a551['localstationid'];this['app']=_0x195481;this[_0x5b9a('0x44')]=_0x5b9a('0x8e');this[_0x5b9a('0x8f')]=_0x5b9a('0x90');this[_0x5b9a('0x66')]=_0x37a551['id'];this[_0x5b9a('0x88')]=_0x40afc2;this[_0x5b9a('0x91')]=_0x30fdbc;}function createExtensionsReciveFax(_0x4aba15){var _0x1abedb=0x1;var _0x35f091=[];_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,'','Answer'));_0x1abedb+=0x1;_0x35f091['push'](new Extension(_0x4aba15,_0x1abedb,_0x5b9a('0x93'),_0x5b9a('0x94')));_0x1abedb+=0x1;for(var _0x388bcc in _0x4aba15){if(_0x4aba15['hasOwnProperty'](_0x388bcc)&&(_0x388bcc===_0x5b9a('0x95')||_0x388bcc===_0x5b9a('0x96')||_0x388bcc===_0x5b9a('0x97')||_0x388bcc===_0x5b9a('0x98')||_0x388bcc==='headerinfo'||_0x388bcc===_0x5b9a('0x99')||_0x388bcc===_0x5b9a('0x9a')||_0x388bcc===_0x5b9a('0x9b')||_0x388bcc===_0x5b9a('0x9c'))){_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,_0x5b9a('0x9d')+_0x388bcc+')='+_0x4aba15[_0x388bcc],_0x5b9a('0x94')));_0x1abedb+=0x1;}}_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,'6',_0x5b9a('0x9e')));_0x1abedb+=0x1;_0x35f091[_0x5b9a('0x92')](new Extension(_0x4aba15,_0x1abedb,_0x5b9a('0x9f'),_0x5b9a('0xa0')));_0x1abedb=0x0;return _0x35f091;}exports[_0x5b9a('0xa1')]=function(_0xdf9424,_0x3a518c,_0x41cf20){var _0x514451;return db['sequelize'][_0x5b9a('0x81')](function(_0x58b06f){return db[_0x5b9a('0x41')]['create'](_0xdf9424[_0x5b9a('0x62')],{'transaction':_0x58b06f})[_0x5b9a('0x22')](function(_0x4ac7c4){_0x514451=_0x4ac7c4['get']({'plain':!![]});return db[_0x5b9a('0xa2')][_0x5b9a('0x86')](createExtensionsReciveFax(_0x514451),{'transaction':_0x58b06f});});})[_0x5b9a('0x22')](function(){return _0x514451;})[_0x5b9a('0x22')](respondWithResult(_0x3a518c,null))['catch'](handleError(_0x3a518c,null));};exports['updateAccountApplications']=function(_0x2a10a1,_0x4c5828,_0x21ca8e){var _0x2a5ecc;return db[_0x5b9a('0x80')][_0x5b9a('0x81')](function(_0x23cce5){return db[_0x5b9a('0x41')]['update'](_0x2a10a1['body'],{'where':{'id':_0x2a10a1['body']['id']},'transaction':_0x23cce5})[_0x5b9a('0x22')](function(_0x10589f){return db[_0x5b9a('0xa2')][_0x5b9a('0x38')]({'where':{'FaxAccountId':_0x2a10a1[_0x5b9a('0x62')]['id']},'transaction':_0x23cce5})[_0x5b9a('0x22')](function(_0x33ce89){return db['VoiceExtension'][_0x5b9a('0x86')](createExtensionsReciveFax(_[_0x5b9a('0x74')](_0x2a10a1['body'],['tech',_0x5b9a('0x45'),'createdAt','updatedAt','TrunkId',_0x5b9a('0xa3')])),{'transaction':_0x23cce5});});});})[_0x5b9a('0x22')](function(){return db[_0x5b9a('0x41')][_0x5b9a('0xa4')](_0x2a10a1['body']['id']);})['then'](respondWithResult(_0x4c5828,null))[_0x5b9a('0x2a')](handleError(_0x4c5828,null));};exports[_0x5b9a('0xa5')]=function(_0x5b04a5,_0xfb600a,_0x25fa0b){var _0x560038={'raw':!![],'where':{}};var _0x1aba42={};var _0x1ea67a={'count':0x0,'rows':[]};return db[_0x5b9a('0x41')][_0x5b9a('0x6f')]({'where':{'id':_0x5b04a5['params']['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0xfb600a,null))[_0x5b9a('0x22')](function(_0x4ce2bc){if(_0x4ce2bc){_0x1aba42[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0xa6')][_0x5b9a('0x42')]);_0x1aba42['query']=_['keys'](_0x5b04a5[_0x5b9a('0x48')]);_0x1aba42['filters']=_['intersection'](_0x1aba42[_0x5b9a('0x46')],_0x1aba42[_0x5b9a('0x48')]);_0x560038[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x1aba42[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x4c')]));_0x560038[_0x5b9a('0x4b')]=_0x560038['attributes'][_0x5b9a('0x4d')]?_0x560038[_0x5b9a('0x4b')]:_0x1aba42[_0x5b9a('0x46')];if(!_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x4e')](_0x5b9a('0x4f'))){_0x560038[_0x5b9a('0x30')]=qs[_0x5b9a('0x30')](_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x30')]);_0x560038['offset']=qs['offset'](_0x5b04a5[_0x5b9a('0x48')]['offset']);}_0x560038[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x5b04a5[_0x5b9a('0x48')]['sort']);_0x560038['where']=qs[_0x5b9a('0x53')](_['pick'](_0x5b04a5[_0x5b9a('0x48')],_0x1aba42[_0x5b9a('0x53')]));_0x560038['where'][_0x5b9a('0x66')]=_0x4ce2bc['id'];if(_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x560038['where']=_[_0x5b9a('0x56')](_0x560038[_0x5b9a('0x52')],{'$or':_[_0x5b9a('0x47')](_0x560038[_0x5b9a('0x4b')],function(_0x5ed625){var _0x4460d8={};_0x4460d8[_0x5ed625]={'$like':'%'+_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x55')]+'%'};return _0x4460d8;})});}if(_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0xa7')]){var _0x23103f=_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0xa7')][_0x5b9a('0xa8')](',');var _0xe0f2b={};_0xe0f2b[_0x23103f[0x0]]={'$gte':moment(_0x23103f[0x1])[_0x5b9a('0xa9')](_0x5b9a('0xaa'))};_0x560038[_0x5b9a('0x52')]=_['merge'](_0x560038['where'],_0xe0f2b);}_0x560038=_['merge']({},_0x560038,_0x5b04a5[_0x5b9a('0x58')]);return db['FaxMessage'][_0x5b9a('0x31')]({'where':_0x560038[_0x5b9a('0x52')]})[_0x5b9a('0x22')](function(_0x336369){_0x1ea67a[_0x5b9a('0x31')]=_0x336369;if(_0x5b04a5[_0x5b9a('0x48')][_0x5b9a('0x69')]){_0x560038[_0x5b9a('0x59')]=[{'all':!![]}];}return db[_0x5b9a('0xa6')]['findAll'](_0x560038);})['then'](function(_0x16dcf3){_0x1ea67a[_0x5b9a('0x5a')]=_0x16dcf3;return _0x1ea67a;});}})[_0x5b9a('0x22')](respondWithFilteredResult(_0xfb600a,_0x560038))[_0x5b9a('0x2a')](handleError(_0xfb600a,null));};exports[_0x5b9a('0x8a')]=function(_0xc98e92,_0x226695,_0x2a3fd3){var _0x482d6d,_0x2f8670={},_0x36531d;if(_0xc98e92['body']['to']){_0x36531d=_0xc98e92['body']['to'][0x0];}return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0xc98e92['params']['id']},'include':[{'model':db[_0x5b9a('0xab')],'as':_0x5b9a('0xac'),'include':[{'model':db[_0x5b9a('0x76')],'as':'Contacts','where':{'fax':_0x36531d},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x5b9a('0x22')](handleEntityNotFound(_0x226695,null))['then'](function(_0x24fc4b){_0x482d6d=_0x24fc4b;if(_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')]&&_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x5b9a('0x4d')]){for(var _0x28565a=0x0;_0x28565a<_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x5b9a('0x4d')];_0x28565a+=0x1){_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x28565a]={'filename':_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x28565a][_0x5b9a('0x3e')],'id':_0xc98e92['body']['attachments'][_0x28565a]['id'],'path':path['join'](config[_0x5b9a('0xae')],_0x5b9a('0xaf'),_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][_0x28565a][_0x5b9a('0xb0')])};}}return respondWithRpcPromise('CheckAfterSend',_0x5b9a('0xb1'),{'FaxAccountId':_[_0x5b9a('0xb2')](_0xc98e92['params']['id'])?undefined:_0xc98e92[_0x5b9a('0x63')]['id'],'path':_['isNil'](_0xc98e92['body']['attachments'][0x0][_0x5b9a('0x7')])?undefined:_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0]['path'],'fax':_[_0x5b9a('0xb2')](_0xc98e92[_0x5b9a('0x62')]['to'][0x0])?undefined:_0xc98e92[_0x5b9a('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0x482d6d){if(_[_0x5b9a('0xb2')](_0xc98e92['body'][_0x5b9a('0xb3')])){_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xb3')]=util['format'](_0x5b9a('0xb4'),_0x482d6d[_0x5b9a('0x3e')],_0x482d6d[_0x5b9a('0xb5')]);}if(_0x482d6d[_0x5b9a('0xac')]){if(_0x482d6d[_0x5b9a('0xac')][_0x5b9a('0xb6')][_0x5b9a('0x4d')]){return _0x482d6d[_0x5b9a('0xac')][_0x5b9a('0xb6')][0x0];}else{return db[_0x5b9a('0x76')][_0x5b9a('0x5e')](_['defaults'](_0xc98e92['body'],{'firstName':_0xc98e92['body']['to'][0x0],'phone':_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'fax':_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'ListId':_0x482d6d[_0x5b9a('0xa3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5b9a('0xb7'));}})[_0x5b9a('0x22')](function(_0x30e9c0){if(_0x30e9c0){return db[_0x5b9a('0x73')][_0x5b9a('0x5d')]({'where':{'ContactId':_0x30e9c0['id'],'closed':![],'FaxAccountId':_0x482d6d['id']}})['then'](function(_0x2b93b3){if(_0x2b93b3){return[_0x2b93b3,![]];}return db[_0x5b9a('0x73')]['create']({'UserId':_0xc98e92[_0x5b9a('0x5f')]['id'],'ContactId':_0x30e9c0['id'],'FaxAccountId':_0x482d6d['id'],'fax':_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x5b9a('0x56')](_0xc98e92[_0x5b9a('0x62')],{'read':![],'body':_0xc98e92[_0x5b9a('0x62')]['attachments'][0x0]['filename'],'FaxAccountId':_0x482d6d['id'],'UserId':_0xc98e92[_0x5b9a('0x5f')]['id'],'ContactId':_0x30e9c0['id'],'AttachmentId':_0xc98e92['body'][_0x5b9a('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x5b9a('0xa6')],'as':_0x5b9a('0xb8')}]})[_0x5b9a('0x22')](function(_0x13c557){return[_0x13c557,!![]];});});}else{throw new Error(_0x5b9a('0xb9'));}})[_0x5b9a('0xba')](function(_0x5c2d62,_0x45d464){if(_0x45d464){return _0x5c2d62;}return db[_0x5b9a('0xa6')][_0x5b9a('0x5e')]({'direction':_0x5b9a('0xbb'),'read':![],'body':_0xc98e92['body'][_0x5b9a('0xad')][0x0][_0x5b9a('0xbc')],'FaxAccountId':_0x482d6d['id'],'FaxInteractionId':_0x5c2d62['id'],'UserId':_0xc98e92[_0x5b9a('0x5f')]['id'],'ContactId':_0x5c2d62[_0x5b9a('0xbd')],'AttachmentId':_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0]['id']})[_0x5b9a('0x22')](function(_0x43ba51){_0x5c2d62['dataValues'][_0x5b9a('0xb8')]=[];_0x5c2d62['dataValues'][_0x5b9a('0xb8')][_0x5b9a('0x92')](_0x43ba51[_0x5b9a('0xbe')]);return _0x5c2d62;});})[_0x5b9a('0x22')](function(_0x205883){respondWithRpcPromise(_0x5b9a('0xbf'),_0x5b9a('0xbf'),{'FaxAccountId':_[_0x5b9a('0xb2')](_0xc98e92[_0x5b9a('0x63')]['id'])?undefined:_0xc98e92[_0x5b9a('0x63')]['id'],'path':_[_0x5b9a('0xb2')](_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0][_0x5b9a('0x7')])?undefined:_0xc98e92['body'][_0x5b9a('0xad')][0x0]['path'],'fax':_['isNil'](_0xc98e92[_0x5b9a('0x62')]['to'][0x0])?undefined:_0xc98e92[_0x5b9a('0x62')]['to'][0x0],'AttachmentId':_0xc98e92[_0x5b9a('0x62')][_0x5b9a('0xad')][0x0]['id']},client9002)['then'](function(_0x2edf71){logger[_0x5b9a('0x23')](_0x5b9a('0xc0'),_0x2edf71);})[_0x5b9a('0x2a')](function(_0x259c9f){logger[_0x5b9a('0x23')](_0x5b9a('0xc0'),_0x259c9f);});return _0x205883;})[_0x5b9a('0x22')](respondWithResult(_0x226695,null))[_0x5b9a('0x2a')](handleError(_0x226695,null));};exports[_0x5b9a('0xc1')]=function(_0x366919,_0x5e9b80,_0x3c5304){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x366919[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x5e9b80,null))['then'](function(_0x5a4f76){if(_0x5a4f76){return _0x5a4f76['addAgents'](_0x366919[_0x5b9a('0x62')][_0x5b9a('0x6b')],_['omit'](_0x366919['body'],[_0x5b9a('0x6b'),'id'])||{})['spread'](function(_0x3ff68f){for(var _0x1e803c=0x0;_0x1e803c<_0x366919[_0x5b9a('0x62')][_0x5b9a('0x6b')]['length'];_0x1e803c+=0x1){socket[_0x5b9a('0xc2')](_0x5b9a('0xc3'),{'UserId':Number(_0x366919[_0x5b9a('0x62')]['ids'][_0x1e803c]),'FaxAccountId':Number(_0x366919[_0x5b9a('0x63')]['id'])});}return _0x3ff68f;});}})[_0x5b9a('0x22')](respondWithResult(_0x5e9b80,null))[_0x5b9a('0x2a')](handleError(_0x5e9b80,null));};exports['removeAgents']=function(_0x595b7d,_0x5d6cba,_0x4d9ec5){return db[_0x5b9a('0x41')][_0x5b9a('0x5d')]({'where':{'id':_0x595b7d[_0x5b9a('0x63')]['id']}})['then'](handleEntityNotFound(_0x5d6cba,null))[_0x5b9a('0x22')](function(_0x33e20b){if(_0x33e20b){return _0x33e20b['removeAgents'](_0x595b7d['query'][_0x5b9a('0x6b')])[_0x5b9a('0x22')](function(){if(_['isArray'](_0x595b7d[_0x5b9a('0x48')]['ids'])){for(var _0x5284f9=0x0;_0x5284f9<_0x595b7d[_0x5b9a('0x48')][_0x5b9a('0x6b')][_0x5b9a('0x4d')];_0x5284f9+=0x1){socket[_0x5b9a('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x595b7d[_0x5b9a('0x48')][_0x5b9a('0x6b')][_0x5284f9]),'FaxAccountId':Number(_0x595b7d['params']['id'])});}}else{socket[_0x5b9a('0xc2')](_0x5b9a('0xc4'),{'UserId':Number(_0x595b7d[_0x5b9a('0x48')][_0x5b9a('0x6b')]),'FaxAccountId':Number(_0x595b7d[_0x5b9a('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d6cba,null))['catch'](handleError(_0x5d6cba,null));};exports[_0x5b9a('0xc5')]=function(_0x1ee319,_0x8e827b,_0x4779bc){var _0x356f15={};var _0x3a9e23={};var _0x564ff2;var _0x410093;return db[_0x5b9a('0x41')]['findOne']({'where':{'id':_0x1ee319[_0x5b9a('0x63')]['id']}})[_0x5b9a('0x22')](handleEntityNotFound(_0x8e827b,null))['then'](function(_0x375e98){if(_0x375e98){_0x564ff2=_0x375e98;_0x3a9e23[_0x5b9a('0x46')]=_[_0x5b9a('0x49')](db[_0x5b9a('0x78')]['rawAttributes']);_0x3a9e23[_0x5b9a('0x48')]=_[_0x5b9a('0x49')](_0x1ee319[_0x5b9a('0x48')]);_0x3a9e23[_0x5b9a('0x53')]=_[_0x5b9a('0x4a')](_0x3a9e23[_0x5b9a('0x46')],_0x3a9e23[_0x5b9a('0x48')]);_0x356f15[_0x5b9a('0x4b')]=_[_0x5b9a('0x4a')](_0x3a9e23[_0x5b9a('0x46')],qs[_0x5b9a('0x4c')](_0x1ee319[_0x5b9a('0x48')]['fields']));_0x356f15[_0x5b9a('0x4b')]=_0x356f15['attributes'][_0x5b9a('0x4d')]?_0x356f15[_0x5b9a('0x4b')]:_0x3a9e23[_0x5b9a('0x46')];_0x356f15[_0x5b9a('0x50')]=qs[_0x5b9a('0x51')](_0x1ee319['query'][_0x5b9a('0x51')]);_0x356f15[_0x5b9a('0x52')]=qs['filters'](_[_0x5b9a('0x54')](_0x1ee319['query'],_0x3a9e23[_0x5b9a('0x53')]));if(_0x1ee319[_0x5b9a('0x48')][_0x5b9a('0x55')]){_0x356f15['where']=_[_0x5b9a('0x56')](_0x356f15[_0x5b9a('0x52')],{'$or':_['map'](_0x356f15['attributes'],function(_0x119395){var _0x5b8b4e={};_0x5b8b4e[_0x119395]={'$like':'%'+_0x1ee319[_0x5b9a('0x48')]['filter']+'%'};return _0x5b8b4e;})});}_0x356f15=_['merge']({},_0x356f15,_0x1ee319[_0x5b9a('0x58')]);return _0x564ff2[_0x5b9a('0xc5')](_0x356f15);}})[_0x5b9a('0x22')](function(_0x1accef){if(_0x1accef){_0x410093=_0x1accef[_0x5b9a('0x4d')];if(!_0x1ee319[_0x5b9a('0x48')]['hasOwnProperty'](_0x5b9a('0x4f'))){_0x356f15['limit']=qs[_0x5b9a('0x30')](_0x1ee319['query'][_0x5b9a('0x30')]);_0x356f15[_0x5b9a('0x2e')]=qs[_0x5b9a('0x2e')](_0x1ee319['query'][_0x5b9a('0x2e')]);}return _0x564ff2[_0x5b9a('0xc5')](_0x356f15);}})[_0x5b9a('0x22')](function(_0xe9ad9c){if(_0xe9ad9c){return _0xe9ad9c?{'count':_0x410093,'rows':_0xe9ad9c}:null;}})[_0x5b9a('0x22')](respondWithResult(_0x8e827b,null))[_0x5b9a('0x2a')](handleError(_0x8e827b,null));}; \ No newline at end of file +var _0x6f70=['code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','index','Pause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','FaxAccount','includeAll','include','findAll','rows','params','mandatoryDispositionPause','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','sort','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','updatedAt','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','List','Contacts','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./faxAccount.socket','register','jayson/promise','client','http','then','request\x20sent','debug','error'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x6f70,0x166));var _0x06f7=function(_0x18035a,_0x12d3a6){_0x18035a=_0x18035a-0x0;var _0x577443=_0x6f70[_0x18035a];return _0x577443;};'use strict';var emlformat=require(_0x06f7('0x0'));var rimraf=require(_0x06f7('0x1'));var zipdir=require(_0x06f7('0x2'));var jsonpatch=require(_0x06f7('0x3'));var rp=require(_0x06f7('0x4'));var moment=require(_0x06f7('0x5'));var BPromise=require(_0x06f7('0x6'));var Mustache=require('mustache');var util=require(_0x06f7('0x7'));var path=require('path');var sox=require(_0x06f7('0x8'));var csv=require('to-csv');var ejs=require(_0x06f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06f7('0xa'));var squel=require(_0x06f7('0xb'));var crypto=require(_0x06f7('0xc'));var jsforce=require(_0x06f7('0xd'));var deskjs=require(_0x06f7('0xe'));var toCsv=require(_0x06f7('0xf'));var querystring=require(_0x06f7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x06f7('0x12'));var hardwareService=require(_0x06f7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x06f7('0x14'));var config=require(_0x06f7('0x15'));var licenseUtil=require(_0x06f7('0x16'));var db=require(_0x06f7('0x17'))['db'];config[_0x06f7('0x18')]=_['defaults'](config[_0x06f7('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06f7('0x18')]));require(_0x06f7('0x19'))[_0x06f7('0x1a')](socket);var jayson=require(_0x06f7('0x1b'));var client=jayson[_0x06f7('0x1c')][_0x06f7('0x1d')]({'port':0x232c});var client9002=jayson[_0x06f7('0x1c')][_0x06f7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x283ad6,_0xb10c47,_0xe883be,_0x4fcda4){return new BPromise(function(_0x4226fc,_0x5347de){var _0x5a4830=_0x4fcda4||client;return _0x5a4830['request'](_0x283ad6,_0xe883be)[_0x06f7('0x1e')](function(_0x55d7ac){logger['info']('FaxAccount,\x20%s,\x20%s',_0xb10c47,_0x06f7('0x1f'));logger[_0x06f7('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xb10c47,_0x06f7('0x1f'),JSON['stringify'](_0x55d7ac));if(_0x55d7ac[_0x06f7('0x21')]){if(_0x55d7ac[_0x06f7('0x21')][_0x06f7('0x22')]===0x1f4){logger[_0x06f7('0x21')](_0x06f7('0x23'),_0xb10c47,_0x55d7ac[_0x06f7('0x21')][_0x06f7('0x24')]);return _0x5347de(_0x55d7ac[_0x06f7('0x21')][_0x06f7('0x24')]);}logger[_0x06f7('0x21')](_0x06f7('0x23'),_0xb10c47,_0x55d7ac[_0x06f7('0x21')][_0x06f7('0x24')]);return _0x4226fc(_0x55d7ac[_0x06f7('0x21')][_0x06f7('0x24')]);}else{logger['info'](_0x06f7('0x23'),_0xb10c47,_0x06f7('0x1f'));_0x4226fc(_0x55d7ac[_0x06f7('0x25')][_0x06f7('0x24')]);}})['catch'](function(_0x48843c){logger[_0x06f7('0x21')](_0x06f7('0x23'),_0xb10c47,_0x48843c);_0x5347de(_0x48843c);});});}function respondWithStatusCode(_0x490329,_0x2e5273){_0x2e5273=_0x2e5273||0xcc;return function(_0x516610){if(_0x516610){return _0x490329[_0x06f7('0x26')](_0x2e5273);}return _0x490329[_0x06f7('0x27')](_0x2e5273)[_0x06f7('0x28')]();};}function respondWithResult(_0x1fc1fd,_0x208ace){_0x208ace=_0x208ace||0xc8;return function(_0x2254d7){if(_0x2254d7){return _0x1fc1fd[_0x06f7('0x27')](_0x208ace)[_0x06f7('0x29')](_0x2254d7);}};}function respondWithFilteredResult(_0x7c2f4a,_0x59a777){return function(_0x145c3d){if(_0x145c3d){var _0x4e2a0d=typeof _0x59a777[_0x06f7('0x2a')]===_0x06f7('0x2b')&&typeof _0x59a777[_0x06f7('0x2c')]==='undefined';var _0x245e3f=_0x145c3d[_0x06f7('0x2d')];var _0xff441=_0x4e2a0d?0x0:_0x59a777['offset'];var _0x3ca3de=_0x4e2a0d?_0x145c3d[_0x06f7('0x2d')]:_0x59a777[_0x06f7('0x2a')]+_0x59a777[_0x06f7('0x2c')];var _0xc01a8c;if(_0x3ca3de>=_0x245e3f){_0x3ca3de=_0x245e3f;_0xc01a8c=0xc8;}else{_0xc01a8c=0xce;}_0x7c2f4a[_0x06f7('0x27')](_0xc01a8c);return _0x7c2f4a[_0x06f7('0x2e')](_0x06f7('0x2f'),_0xff441+'-'+_0x3ca3de+'/'+_0x245e3f)[_0x06f7('0x29')](_0x145c3d);}return null;};}function patchUpdates(_0x11a877){return function(_0x324cdd){try{jsonpatch[_0x06f7('0x30')](_0x324cdd,_0x11a877,!![]);}catch(_0x5b5ef7){return BPromise[_0x06f7('0x31')](_0x5b5ef7);}return _0x324cdd[_0x06f7('0x32')]();};}function saveUpdates(_0x28b1da,_0x576e07){return function(_0x2aeed6){if(_0x2aeed6){return _0x2aeed6['update'](_0x28b1da)[_0x06f7('0x1e')](function(_0x2c1ba2){return _0x2c1ba2;});}return null;};}function removeEntity(_0x3c4bfc,_0x459636){return function(_0x5c89df){if(_0x5c89df){return _0x5c89df[_0x06f7('0x33')]()['then'](function(){var _0x4994ee=_0x5c89df[_0x06f7('0x34')]({'plain':!![]});var _0xd349c8='FaxAccounts';return db[_0x06f7('0x35')][_0x06f7('0x33')]({'where':{'type':_0xd349c8,'resourceId':_0x4994ee['id']}})['then'](function(){return _0x5c89df;});})[_0x06f7('0x1e')](function(){_0x3c4bfc[_0x06f7('0x27')](0xcc)[_0x06f7('0x28')]();});}};}function handleEntityNotFound(_0x1698fa,_0xce38ba){return function(_0x4765f6){if(!_0x4765f6){_0x1698fa[_0x06f7('0x26')](0x194);}return _0x4765f6;};}function handleError(_0x13d018,_0x34d394){_0x34d394=_0x34d394||0x1f4;return function(_0x107794){logger[_0x06f7('0x21')](_0x107794[_0x06f7('0x36')]);if(_0x107794['name']){delete _0x107794[_0x06f7('0x37')];}_0x13d018['status'](_0x34d394)['send'](_0x107794);};}exports[_0x06f7('0x38')]=function(_0x21c1e7,_0x143c06){var _0x36d078={'include':[{'model':db[_0x06f7('0x39')],'as':'mandatoryDispositionPause'}]},_0x24ee79={},_0x3565e8={'count':0x0,'rows':[]};var _0x393168=_[_0x06f7('0x3a')](db['FaxAccount'][_0x06f7('0x3b')],function(_0x5e42e9){return{'name':_0x5e42e9[_0x06f7('0x3c')],'type':_0x5e42e9[_0x06f7('0x3d')]['key']};});_0x24ee79[_0x06f7('0x3e')]=_['map'](_0x393168,'name');_0x24ee79[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0x21c1e7['query']);_0x24ee79['filters']=_[_0x06f7('0x41')](_0x24ee79[_0x06f7('0x3e')],_0x24ee79[_0x06f7('0x3f')]);_0x36d078[_0x06f7('0x42')]=_[_0x06f7('0x41')](_0x24ee79['model'],qs[_0x06f7('0x43')](_0x21c1e7[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x36d078[_0x06f7('0x42')]=_0x36d078['attributes']['length']?_0x36d078[_0x06f7('0x42')]:_0x24ee79[_0x06f7('0x3e')];if(!_0x21c1e7['query'][_0x06f7('0x44')](_0x06f7('0x45'))){_0x36d078[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0x21c1e7[_0x06f7('0x3f')][_0x06f7('0x2c')]);_0x36d078[_0x06f7('0x2a')]=qs[_0x06f7('0x2a')](_0x21c1e7[_0x06f7('0x3f')]['offset']);}_0x36d078[_0x06f7('0x46')]=qs['sort'](_0x21c1e7[_0x06f7('0x3f')]['sort']);_0x36d078[_0x06f7('0x47')]=qs[_0x06f7('0x48')](_[_0x06f7('0x49')](_0x21c1e7[_0x06f7('0x3f')],_0x24ee79[_0x06f7('0x48')]),_0x393168);if(_0x21c1e7['query'][_0x06f7('0x4a')]){_0x36d078[_0x06f7('0x47')]=_[_0x06f7('0x4b')](_0x36d078[_0x06f7('0x47')],{'$or':_[_0x06f7('0x3a')](_0x393168,function(_0x530d07){if(_0x530d07[_0x06f7('0x3d')]!=='VIRTUAL'){var _0x1972b4={};_0x1972b4[_0x530d07[_0x06f7('0x37')]]={'$like':'%'+_0x21c1e7[_0x06f7('0x3f')][_0x06f7('0x4a')]+'%'};return _0x1972b4;}})});}_0x36d078=_[_0x06f7('0x4b')]({},_0x36d078,_0x21c1e7[_0x06f7('0x4c')]);var _0x16891e={'where':_0x36d078[_0x06f7('0x47')]};return db[_0x06f7('0x4d')][_0x06f7('0x2d')](_0x16891e)[_0x06f7('0x1e')](function(_0x3eab39){_0x3565e8[_0x06f7('0x2d')]=_0x3eab39;if(_0x21c1e7['query'][_0x06f7('0x4e')]){_0x36d078[_0x06f7('0x4f')]=[{'all':!![]}];}return db[_0x06f7('0x4d')][_0x06f7('0x50')](_0x36d078);})[_0x06f7('0x1e')](function(_0x46a245){_0x3565e8[_0x06f7('0x51')]=_0x46a245;return _0x3565e8;})['then'](respondWithFilteredResult(_0x143c06,_0x36d078))['catch'](handleError(_0x143c06,null));};exports['show']=function(_0x577725,_0x26f8a7){var _0x24906c={'raw':![],'where':{'id':_0x577725[_0x06f7('0x52')]['id']},'include':[{'model':db[_0x06f7('0x39')],'as':_0x06f7('0x53')}]},_0x44c1e9={};_0x44c1e9[_0x06f7('0x3e')]=_[_0x06f7('0x40')](db[_0x06f7('0x4d')][_0x06f7('0x3b')]);_0x44c1e9[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0x577725[_0x06f7('0x3f')]);_0x44c1e9[_0x06f7('0x48')]=_[_0x06f7('0x41')](_0x44c1e9[_0x06f7('0x3e')],_0x44c1e9[_0x06f7('0x3f')]);_0x24906c[_0x06f7('0x42')]=_['intersection'](_0x44c1e9['model'],qs[_0x06f7('0x43')](_0x577725[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x24906c['attributes']=_0x24906c[_0x06f7('0x42')][_0x06f7('0x54')]?_0x24906c[_0x06f7('0x42')]:_0x44c1e9['model'];if(_0x577725[_0x06f7('0x3f')][_0x06f7('0x4e')]){_0x24906c[_0x06f7('0x4f')]=[{'all':!![]}];}_0x24906c=_[_0x06f7('0x4b')]({},_0x24906c,_0x577725['options']);return db['FaxAccount'][_0x06f7('0x55')](_0x24906c)[_0x06f7('0x1e')](handleEntityNotFound(_0x26f8a7,null))[_0x06f7('0x1e')](respondWithResult(_0x26f8a7,null))[_0x06f7('0x56')](handleError(_0x26f8a7,null));};exports[_0x06f7('0x57')]=function(_0xad103e,_0x5e14e6){return db[_0x06f7('0x4d')][_0x06f7('0x57')](_0xad103e['body'],{})['then'](function(_0x34c66c){var _0x227cb2=_0xad103e[_0x06f7('0x58')][_0x06f7('0x34')]({'plain':!![]});if(!_0x227cb2)throw new Error(_0x06f7('0x59'));if(_0x227cb2[_0x06f7('0x5a')]==='user'){var _0x58a54f=_0x34c66c[_0x06f7('0x34')]({'plain':!![]});var _0x254a05='FaxAccounts';return db['UserProfileSection'][_0x06f7('0x55')]({'where':{'name':_0x254a05,'userProfileId':_0x227cb2[_0x06f7('0x5b')]},'raw':!![]})[_0x06f7('0x1e')](function(_0xb5ae7d){if(_0xb5ae7d&&_0xb5ae7d[_0x06f7('0x5c')]===0x0){return db['UserProfileResource'][_0x06f7('0x57')]({'name':_0x58a54f['name'],'resourceId':_0x58a54f['id'],'type':_0xb5ae7d[_0x06f7('0x37')],'sectionId':_0xb5ae7d['id']},{})[_0x06f7('0x1e')](function(){return _0x34c66c;});}else{return _0x34c66c;}})[_0x06f7('0x56')](function(_0x113887){logger[_0x06f7('0x21')](_0x06f7('0x5d'),_0x113887);throw _0x113887;});}return _0x34c66c;})[_0x06f7('0x1e')](respondWithResult(_0x5e14e6,0xc9))[_0x06f7('0x56')](handleError(_0x5e14e6,null));};exports[_0x06f7('0x5e')]=function(_0x4a39ea,_0x21370d){if(_0x4a39ea[_0x06f7('0x5f')]['id']){delete _0x4a39ea[_0x06f7('0x5f')]['id'];}return db[_0x06f7('0x4d')][_0x06f7('0x55')]({'where':{'id':_0x4a39ea[_0x06f7('0x52')]['id']},'include':[{'model':db[_0x06f7('0x39')],'as':_0x06f7('0x53')}]})[_0x06f7('0x1e')](handleEntityNotFound(_0x21370d,null))['then'](saveUpdates(_0x4a39ea[_0x06f7('0x5f')],null))[_0x06f7('0x1e')](respondWithResult(_0x21370d,null))[_0x06f7('0x56')](handleError(_0x21370d,null));};exports[_0x06f7('0x33')]=function(_0x39de40,_0x5d97d9){return db['FaxAccount'][_0x06f7('0x55')]({'where':{'id':_0x39de40[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x5d97d9,null))['then'](removeEntity(_0x5d97d9,null))[_0x06f7('0x56')](handleError(_0x5d97d9,null));};exports[_0x06f7('0x60')]=function(_0x5f726f,_0x2a8ffa){return db['FaxAccount'][_0x06f7('0x60')]()['then'](respondWithResult(_0x2a8ffa,null))[_0x06f7('0x56')](handleError(_0x2a8ffa,null));};exports[_0x06f7('0x61')]=function(_0x4650bb,_0x70e1c5,_0x2ed998){if(_0x4650bb[_0x06f7('0x5f')]['id']){delete _0x4650bb[_0x06f7('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4650bb[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x70e1c5,null))[_0x06f7('0x1e')](function(_0x2154ee){if(_0x2154ee){_0x4650bb['body'][_0x06f7('0x62')]=_0x2154ee['id'];return db[_0x06f7('0x63')][_0x06f7('0x57')](_0x4650bb[_0x06f7('0x5f')]);}})['then'](respondWithResult(_0x70e1c5,null))[_0x06f7('0x56')](handleError(_0x70e1c5,null));};exports[_0x06f7('0x64')]=function(_0xcd5147,_0x165a83,_0x1252e7){var _0x24406e={'raw':![],'where':{}};var _0x3984a1={};var _0x24a2cc={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xcd5147[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x165a83,null))[_0x06f7('0x1e')](function(_0x54f033){if(_0x54f033){_0x3984a1['model']=_['keys'](db['Disposition'][_0x06f7('0x3b')]);_0x3984a1[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0xcd5147['query']);_0x3984a1['filters']=_['intersection'](_0x3984a1[_0x06f7('0x3e')],_0x3984a1[_0x06f7('0x3f')]);_0x24406e[_0x06f7('0x42')]=_[_0x06f7('0x41')](_0x3984a1['model'],qs[_0x06f7('0x43')](_0xcd5147[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x24406e['attributes']=_0x24406e[_0x06f7('0x42')]['length']?_0x24406e['attributes']:_0x3984a1[_0x06f7('0x3e')];if(!_0xcd5147[_0x06f7('0x3f')]['hasOwnProperty'](_0x06f7('0x45'))){_0x24406e[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0xcd5147[_0x06f7('0x3f')][_0x06f7('0x2c')]);_0x24406e['offset']=qs['offset'](_0xcd5147[_0x06f7('0x3f')][_0x06f7('0x2a')]);}_0x24406e['order']=qs[_0x06f7('0x65')](_0xcd5147[_0x06f7('0x3f')]['sort']);_0x24406e[_0x06f7('0x47')]=qs[_0x06f7('0x48')](_[_0x06f7('0x49')](_0xcd5147['query'],_0x3984a1[_0x06f7('0x48')]));_0x24406e[_0x06f7('0x47')][_0x06f7('0x62')]=_0x54f033['id'];if(_0xcd5147[_0x06f7('0x3f')][_0x06f7('0x4a')]){_0x24406e[_0x06f7('0x47')]=_[_0x06f7('0x4b')](_0x24406e['where'],{'$or':_['map'](_0x24406e[_0x06f7('0x42')],function(_0x3a12fa){var _0x46fda5={};_0x46fda5[_0x3a12fa]={'$like':'%'+_0xcd5147[_0x06f7('0x3f')]['filter']+'%'};return _0x46fda5;})});}_0x24406e=_['merge']({},_0x24406e,_0xcd5147[_0x06f7('0x4c')]);return db[_0x06f7('0x63')][_0x06f7('0x2d')]({'where':_0x24406e[_0x06f7('0x47')]})[_0x06f7('0x1e')](function(_0x3ff189){_0x24a2cc[_0x06f7('0x2d')]=_0x3ff189;if(_0xcd5147[_0x06f7('0x3f')][_0x06f7('0x4e')]){_0x24406e[_0x06f7('0x4f')]=[{'all':!![]}];}return db[_0x06f7('0x63')][_0x06f7('0x50')](_0x24406e);})['then'](function(_0x5b3e0d){_0x24a2cc[_0x06f7('0x51')]=_0x5b3e0d;return _0x24a2cc;});}})[_0x06f7('0x1e')](respondWithFilteredResult(_0x165a83,_0x24406e))['catch'](handleError(_0x165a83,null));};exports['removeDispositions']=function(_0x4180c0,_0x4ea3f2,_0x3f2663){return db[_0x06f7('0x4d')][_0x06f7('0x55')]({'where':{'id':_0x4180c0[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x4ea3f2,null))['then'](function(_0x426e2e){if(_0x426e2e){return _0x426e2e[_0x06f7('0x66')](_0x4180c0[_0x06f7('0x3f')][_0x06f7('0x67')]);}})[_0x06f7('0x1e')](respondWithStatusCode(_0x4ea3f2,null))[_0x06f7('0x56')](handleError(_0x4ea3f2,null));};exports[_0x06f7('0x68')]=function(_0x745aab,_0x2fdc52,_0x58189c){if(_0x745aab['body']['id']){delete _0x745aab['body']['id'];}return db['FaxAccount'][_0x06f7('0x55')]({'where':{'id':_0x745aab[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x2fdc52,null))[_0x06f7('0x1e')](function(_0x1fa253){if(_0x1fa253){_0x745aab[_0x06f7('0x5f')][_0x06f7('0x62')]=_0x1fa253['id'];return db['CannedAnswer'][_0x06f7('0x57')](_0x745aab[_0x06f7('0x5f')]);}})[_0x06f7('0x1e')](respondWithResult(_0x2fdc52,null))[_0x06f7('0x56')](handleError(_0x2fdc52,null));};exports[_0x06f7('0x69')]=function(_0x1a55e8,_0x11656e,_0x183b8a){var _0x3f3785={'raw':![],'where':{}};var _0x39b3b3={};var _0x2b9670={'count':0x0,'rows':[]};return db[_0x06f7('0x4d')]['findOne']({'where':{'id':_0x1a55e8['params']['id']}})['then'](handleEntityNotFound(_0x11656e,null))['then'](function(_0x11f281){if(_0x11f281){_0x39b3b3[_0x06f7('0x3e')]=_[_0x06f7('0x40')](db[_0x06f7('0x6a')][_0x06f7('0x3b')]);_0x39b3b3[_0x06f7('0x3f')]=_['keys'](_0x1a55e8[_0x06f7('0x3f')]);_0x39b3b3[_0x06f7('0x48')]=_['intersection'](_0x39b3b3[_0x06f7('0x3e')],_0x39b3b3[_0x06f7('0x3f')]);_0x3f3785[_0x06f7('0x42')]=_[_0x06f7('0x41')](_0x39b3b3[_0x06f7('0x3e')],qs['fields'](_0x1a55e8[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x3f3785[_0x06f7('0x42')]=_0x3f3785[_0x06f7('0x42')][_0x06f7('0x54')]?_0x3f3785[_0x06f7('0x42')]:_0x39b3b3[_0x06f7('0x3e')];if(!_0x1a55e8[_0x06f7('0x3f')][_0x06f7('0x44')](_0x06f7('0x45'))){_0x3f3785[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0x1a55e8['query'][_0x06f7('0x2c')]);_0x3f3785[_0x06f7('0x2a')]=qs['offset'](_0x1a55e8['query'][_0x06f7('0x2a')]);}_0x3f3785[_0x06f7('0x46')]=qs[_0x06f7('0x65')](_0x1a55e8[_0x06f7('0x3f')][_0x06f7('0x65')]);_0x3f3785[_0x06f7('0x47')]=qs[_0x06f7('0x48')](_[_0x06f7('0x49')](_0x1a55e8['query'],_0x39b3b3[_0x06f7('0x48')]));_0x3f3785['where'][_0x06f7('0x62')]=_0x11f281['id'];if(_0x1a55e8[_0x06f7('0x3f')][_0x06f7('0x4a')]){_0x3f3785[_0x06f7('0x47')]=_['merge'](_0x3f3785[_0x06f7('0x47')],{'$or':_[_0x06f7('0x3a')](_0x3f3785['attributes'],function(_0x27d826){var _0x1ef582={};_0x1ef582[_0x27d826]={'$like':'%'+_0x1a55e8[_0x06f7('0x3f')]['filter']+'%'};return _0x1ef582;})});}_0x3f3785=_['merge']({},_0x3f3785,_0x1a55e8[_0x06f7('0x4c')]);return db['CannedAnswer'][_0x06f7('0x2d')]({'where':_0x3f3785[_0x06f7('0x47')]})[_0x06f7('0x1e')](function(_0x42a5a9){_0x2b9670[_0x06f7('0x2d')]=_0x42a5a9;if(_0x1a55e8[_0x06f7('0x3f')][_0x06f7('0x4e')]){_0x3f3785[_0x06f7('0x4f')]=[{'all':!![]}];}return db[_0x06f7('0x6a')][_0x06f7('0x50')](_0x3f3785);})[_0x06f7('0x1e')](function(_0x47529b){_0x2b9670[_0x06f7('0x51')]=_0x47529b;return _0x2b9670;});}})['then'](respondWithFilteredResult(_0x11656e,_0x3f3785))[_0x06f7('0x56')](handleError(_0x11656e,null));};exports[_0x06f7('0x6b')]=function(_0x39d7e8,_0x462604,_0x4c0574){return db['FaxAccount'][_0x06f7('0x55')]({'where':{'id':_0x39d7e8[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x462604,null))[_0x06f7('0x1e')](function(_0xe34f66){if(_0xe34f66){return _0xe34f66[_0x06f7('0x6b')](_0x39d7e8[_0x06f7('0x3f')][_0x06f7('0x67')]);}})[_0x06f7('0x1e')](respondWithStatusCode(_0x462604,null))[_0x06f7('0x56')](handleError(_0x462604,null));};exports['addInteraction']=function(_0x4c3181,_0xa25cac,_0x14a760){return db[_0x06f7('0x6c')]['find']({'where':{'id':_0x4c3181[_0x06f7('0x52')]['id']}})['then'](handleEntityNotFound(_0xa25cac,null))['then'](function(_0x1a1bff){if(_0x1a1bff){return _0x1a1bff[_0x06f7('0x6d')](_0x4c3181[_0x06f7('0x5f')][_0x06f7('0x67')],_[_0x06f7('0x6e')](_0x4c3181[_0x06f7('0x5f')],[_0x06f7('0x67'),'id'])||{});}})['then'](respondWithResult(_0xa25cac,null))[_0x06f7('0x56')](handleError(_0xa25cac,null));};exports[_0x06f7('0x6f')]=function(_0x450e05,_0x37fab5,_0x1a8242){var _0x44a920={'raw':![],'where':{}};var _0x30d2ef={};var _0x1e8c07={'count':0x0,'rows':[]};return db[_0x06f7('0x4d')][_0x06f7('0x70')]({'where':{'id':_0x450e05['params']['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x37fab5,null))[_0x06f7('0x1e')](function(_0x3a35fb){if(_0x3a35fb){_0x30d2ef[_0x06f7('0x3e')]=_['keys'](db[_0x06f7('0x6c')][_0x06f7('0x3b')]);_0x30d2ef[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0x450e05['query']);_0x30d2ef['filters']=_[_0x06f7('0x41')](_0x30d2ef['model'],_0x30d2ef['query']);_0x44a920[_0x06f7('0x42')]=_['intersection'](_0x30d2ef[_0x06f7('0x3e')],qs[_0x06f7('0x43')](_0x450e05[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x44a920[_0x06f7('0x42')]=_0x44a920[_0x06f7('0x42')]['length']?_0x44a920[_0x06f7('0x42')]:_0x30d2ef[_0x06f7('0x3e')];if(!_0x450e05['query'][_0x06f7('0x44')](_0x06f7('0x45'))){_0x44a920[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0x450e05[_0x06f7('0x3f')][_0x06f7('0x2c')]);_0x44a920['offset']=qs[_0x06f7('0x2a')](_0x450e05['query'][_0x06f7('0x2a')]);}_0x44a920['order']=qs[_0x06f7('0x65')](_0x450e05['query']['sort']);_0x44a920[_0x06f7('0x47')]=qs[_0x06f7('0x48')](_['pick'](_0x450e05['query'],_0x30d2ef[_0x06f7('0x48')]));_0x44a920[_0x06f7('0x47')][_0x06f7('0x62')]=_0x3a35fb['id'];if(_0x450e05[_0x06f7('0x3f')]['filter']){_0x44a920[_0x06f7('0x47')]=_['merge'](_0x44a920[_0x06f7('0x47')],{'$or':_[_0x06f7('0x3a')](_0x44a920[_0x06f7('0x42')],function(_0x3da0ec){var _0x4d6acf={};_0x4d6acf[_0x3da0ec]={'$like':'%'+_0x450e05['query'][_0x06f7('0x4a')]+'%'};return _0x4d6acf;})});}_0x44a920=_[_0x06f7('0x4b')]({},_0x44a920,_0x450e05[_0x06f7('0x4c')]);return db[_0x06f7('0x6c')][_0x06f7('0x2d')]({'where':_0x44a920[_0x06f7('0x47')]})[_0x06f7('0x1e')](function(_0x2f2443){_0x1e8c07[_0x06f7('0x2d')]=_0x2f2443;if(_0x450e05[_0x06f7('0x3f')]['includeAll']){_0x44a920[_0x06f7('0x4f')]=[{'model':db[_0x06f7('0x71')],'as':_0x06f7('0x72'),'required':![]},{'model':db[_0x06f7('0x73')],'as':_0x06f7('0x74'),'attributes':[_0x06f7('0x37'),'fullname',_0x06f7('0x75')],'required':![]},{'model':db[_0x06f7('0x76')],'as':_0x06f7('0x77'),'attributes':['id','name','color'],'where':_0x450e05[_0x06f7('0x3f')][_0x06f7('0x78')]?{'id':_0x450e05[_0x06f7('0x3f')]['tag']}:undefined,'required':_0x450e05[_0x06f7('0x3f')]['tag']?!![]:![]}];}return db[_0x06f7('0x6c')][_0x06f7('0x50')](_0x44a920);})['then'](function(_0x3674dc){_0x1e8c07[_0x06f7('0x51')]=_0x3674dc;return _0x1e8c07;});}})['then'](respondWithFilteredResult(_0x37fab5,_0x44a920))['catch'](handleError(_0x37fab5,null));};exports[_0x06f7('0x79')]=function(_0xbb9822,_0x26f118){var _0x52b996=_0xbb9822[_0x06f7('0x52')]['id'];var _0xe97eb9=_0xbb9822[_0x06f7('0x5f')];var _0x2937d3=0xc8;var _0x22419e=null;return db[_0x06f7('0x7a')][_0x06f7('0x7b')]({'isolationLevel':db[_0x06f7('0x7a')][_0x06f7('0x7c')][_0x06f7('0x7d')][_0x06f7('0x7e')]},function(_0x4104cf){return db['FaxAccount']['findOne']({'where':{'id':_0x52b996},'transaction':_0x4104cf})[_0x06f7('0x1e')](function(_0x1a6f3e){if(_0x1a6f3e){return db[_0x06f7('0x7f')][_0x06f7('0x33')]({'where':{'FaxAccountId':_0x52b996},'transaction':_0x4104cf})[_0x06f7('0x1e')](function(){var _0x126c39=_['map'](_0xe97eb9,function(_0x48c2bb){_0x48c2bb[_0x06f7('0x62')]=_0x52b996;return _0x48c2bb;});return db[_0x06f7('0x7f')][_0x06f7('0x80')](_0x126c39,{'transaction':_0x4104cf});});}else{_0x2937d3=0x194;_0x22419e=[];}});})[_0x06f7('0x1e')](function(){if(_0x2937d3!==0x194){return db[_0x06f7('0x7f')][_0x06f7('0x81')]({'where':{'FaxAccountId':_0x52b996},'order':_0x06f7('0x82')})['then'](function(_0x2cb9a0){_0x22419e=_0x2cb9a0;});}})['catch'](function(_0xa94ab1){_0x2937d3=0x1f4;logger[_0x06f7('0x21')](_0xa94ab1[_0x06f7('0x36')]);if(_0xa94ab1[_0x06f7('0x37')]){delete _0xa94ab1[_0x06f7('0x37')];}_0x22419e=_0xa94ab1;})[_0x06f7('0x83')](function(){if(_0x22419e===null){_0x26f118['sendStatus'](_0x2937d3);}else{if(_0x2937d3===0x1f4){_0x26f118['status'](_0x2937d3)['send'](_0x22419e);}else{_0x26f118[_0x06f7('0x27')](_0x2937d3)[_0x06f7('0x29')](_0x22419e);}}});};exports[_0x06f7('0x84')]=function(_0xb0fd,_0x27fd01,_0x38a462){var _0x2ea040={};var _0x2cfea8={};var _0x36eaa4;var _0x3ea5b4;return db[_0x06f7('0x4d')][_0x06f7('0x70')]({'where':{'id':_0xb0fd['params']['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x27fd01,null))[_0x06f7('0x1e')](function(_0x37362e){if(_0x37362e){_0x36eaa4=_0x37362e;_0x2cfea8['model']=_[_0x06f7('0x40')](db[_0x06f7('0x7f')][_0x06f7('0x3b')]);_0x2cfea8[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0xb0fd[_0x06f7('0x3f')]);_0x2cfea8[_0x06f7('0x48')]=_[_0x06f7('0x41')](_0x2cfea8[_0x06f7('0x3e')],_0x2cfea8[_0x06f7('0x3f')]);_0x2ea040[_0x06f7('0x42')]=_['intersection'](_0x2cfea8[_0x06f7('0x3e')],qs[_0x06f7('0x43')](_0xb0fd[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x2ea040['attributes']=_0x2ea040[_0x06f7('0x42')][_0x06f7('0x54')]?_0x2ea040['attributes']:_0x2cfea8[_0x06f7('0x3e')];_0x2ea040[_0x06f7('0x46')]=qs[_0x06f7('0x65')](_0xb0fd[_0x06f7('0x3f')][_0x06f7('0x65')]);_0x2ea040[_0x06f7('0x47')]=qs['filters'](_['pick'](_0xb0fd[_0x06f7('0x3f')],_0x2cfea8[_0x06f7('0x48')]));if(_0xb0fd[_0x06f7('0x3f')][_0x06f7('0x4a')]){_0x2ea040[_0x06f7('0x47')]=_['merge'](_0x2ea040['where'],{'$or':_[_0x06f7('0x3a')](_0x2ea040[_0x06f7('0x42')],function(_0x5211ce){var _0x5c9a4f={};_0x5c9a4f[_0x5211ce]={'$like':'%'+_0xb0fd[_0x06f7('0x3f')][_0x06f7('0x4a')]+'%'};return _0x5c9a4f;})});}_0x2ea040=_[_0x06f7('0x4b')]({},_0x2ea040,_0xb0fd[_0x06f7('0x4c')]);return _0x36eaa4[_0x06f7('0x84')](_0x2ea040);}})[_0x06f7('0x1e')](function(_0x3a7a94){if(_0x3a7a94){_0x3ea5b4=_0x3a7a94['length'];if(!_0xb0fd[_0x06f7('0x3f')][_0x06f7('0x44')](_0x06f7('0x45'))){_0x2ea040[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0xb0fd[_0x06f7('0x3f')][_0x06f7('0x2c')]);_0x2ea040[_0x06f7('0x2a')]=qs[_0x06f7('0x2a')](_0xb0fd['query']['offset']);}return _0x36eaa4[_0x06f7('0x84')](_0x2ea040);}})[_0x06f7('0x1e')](function(_0x559a35){if(_0x559a35){return _0x559a35?{'count':_0x3ea5b4,'rows':_0x559a35}:null;}})[_0x06f7('0x1e')](respondWithResult(_0x27fd01,null))['catch'](handleError(_0x27fd01,null));};function Extension(_0x386831,_0x41def8,_0xf5d5ae,_0x3f3fb1){this[_0x06f7('0x85')]=_0x06f7('0x86');this[_0x06f7('0x87')]=_0x386831[_0x06f7('0x88')];this[_0x06f7('0x89')]=_0x3f3fb1;this[_0x06f7('0x3d')]=_0x06f7('0x8a');this[_0x06f7('0x8b')]=_0x06f7('0x8c');this['FaxAccountId']=_0x386831['id'];this['priority']=_0x41def8;this[_0x06f7('0x8d')]=_0xf5d5ae;}function createExtensionsReciveFax(_0x463349){var _0xe080e9=0x1;var _0x18d0e3=[];_0x18d0e3[_0x06f7('0x8e')](new Extension(_0x463349,_0xe080e9,'','Answer'));_0xe080e9+=0x1;_0x18d0e3[_0x06f7('0x8e')](new Extension(_0x463349,_0xe080e9,_0x06f7('0x8f'),_0x06f7('0x90')));_0xe080e9+=0x1;for(var _0x3db929 in _0x463349){if(_0x463349[_0x06f7('0x44')](_0x3db929)&&(_0x3db929===_0x06f7('0x91')||_0x3db929===_0x06f7('0x88')||_0x3db929===_0x06f7('0x92')||_0x3db929===_0x06f7('0x93')||_0x3db929===_0x06f7('0x94')||_0x3db929===_0x06f7('0x95')||_0x3db929===_0x06f7('0x96')||_0x3db929===_0x06f7('0x97')||_0x3db929==='t38timeout')){_0x18d0e3[_0x06f7('0x8e')](new Extension(_0x463349,_0xe080e9,_0x06f7('0x98')+_0x3db929+')='+_0x463349[_0x3db929],_0x06f7('0x90')));_0xe080e9+=0x1;}}_0x18d0e3[_0x06f7('0x8e')](new Extension(_0x463349,_0xe080e9,'6','Wait'));_0xe080e9+=0x1;_0x18d0e3[_0x06f7('0x8e')](new Extension(_0x463349,_0xe080e9,_0x06f7('0x99'),_0x06f7('0x9a')));_0xe080e9=0x0;return _0x18d0e3;}exports[_0x06f7('0x9b')]=function(_0x147c7f,_0x16fe8a,_0x21deee){var _0x271271;return db[_0x06f7('0x7a')]['transaction'](function(_0x203a57){return db[_0x06f7('0x4d')][_0x06f7('0x57')](_0x147c7f[_0x06f7('0x5f')],{'transaction':_0x203a57})[_0x06f7('0x1e')](function(_0x4411f0){_0x271271=_0x4411f0[_0x06f7('0x34')]({'plain':!![]});return db[_0x06f7('0x9c')]['bulkCreate'](createExtensionsReciveFax(_0x271271),{'transaction':_0x203a57});});})['then'](function(){return _0x271271;})[_0x06f7('0x1e')](respondWithResult(_0x16fe8a,null))[_0x06f7('0x56')](handleError(_0x16fe8a,null));};exports[_0x06f7('0x9d')]=function(_0x57a96c,_0x238ddf,_0x58737b){var _0x4e4889;return db[_0x06f7('0x7a')][_0x06f7('0x7b')](function(_0x50093d){return db['FaxAccount'][_0x06f7('0x5e')](_0x57a96c[_0x06f7('0x5f')],{'where':{'id':_0x57a96c[_0x06f7('0x5f')]['id']},'transaction':_0x50093d})[_0x06f7('0x1e')](function(_0x95229f){return db['VoiceExtension'][_0x06f7('0x33')]({'where':{'FaxAccountId':_0x57a96c[_0x06f7('0x5f')]['id']},'transaction':_0x50093d})['then'](function(_0x1b24aa){return db[_0x06f7('0x9c')][_0x06f7('0x80')](createExtensionsReciveFax(_[_0x06f7('0x6e')](_0x57a96c[_0x06f7('0x5f')],['tech','key','createdAt',_0x06f7('0x9e'),'TrunkId','ListId'])),{'transaction':_0x50093d});});});})['then'](function(){return db[_0x06f7('0x4d')][_0x06f7('0x9f')](_0x57a96c[_0x06f7('0x5f')]['id']);})[_0x06f7('0x1e')](respondWithResult(_0x238ddf,null))[_0x06f7('0x56')](handleError(_0x238ddf,null));};exports[_0x06f7('0xa0')]=function(_0x238c74,_0x4d1520,_0x19ffb7){var _0x4f90dd={'raw':!![],'where':{}};var _0x4e755b={};var _0x226011={'count':0x0,'rows':[]};return db['FaxAccount'][_0x06f7('0x70')]({'where':{'id':_0x238c74[_0x06f7('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d1520,null))[_0x06f7('0x1e')](function(_0x4f44de){if(_0x4f44de){_0x4e755b[_0x06f7('0x3e')]=_[_0x06f7('0x40')](db['FaxMessage'][_0x06f7('0x3b')]);_0x4e755b[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0x238c74[_0x06f7('0x3f')]);_0x4e755b[_0x06f7('0x48')]=_[_0x06f7('0x41')](_0x4e755b[_0x06f7('0x3e')],_0x4e755b[_0x06f7('0x3f')]);_0x4f90dd['attributes']=_['intersection'](_0x4e755b[_0x06f7('0x3e')],qs[_0x06f7('0x43')](_0x238c74[_0x06f7('0x3f')][_0x06f7('0x43')]));_0x4f90dd[_0x06f7('0x42')]=_0x4f90dd[_0x06f7('0x42')][_0x06f7('0x54')]?_0x4f90dd[_0x06f7('0x42')]:_0x4e755b[_0x06f7('0x3e')];if(!_0x238c74['query'][_0x06f7('0x44')](_0x06f7('0x45'))){_0x4f90dd[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0x238c74[_0x06f7('0x3f')][_0x06f7('0x2c')]);_0x4f90dd[_0x06f7('0x2a')]=qs[_0x06f7('0x2a')](_0x238c74[_0x06f7('0x3f')][_0x06f7('0x2a')]);}_0x4f90dd[_0x06f7('0x46')]=qs[_0x06f7('0x65')](_0x238c74[_0x06f7('0x3f')][_0x06f7('0x65')]);_0x4f90dd[_0x06f7('0x47')]=qs[_0x06f7('0x48')](_[_0x06f7('0x49')](_0x238c74['query'],_0x4e755b[_0x06f7('0x48')]));_0x4f90dd[_0x06f7('0x47')][_0x06f7('0x62')]=_0x4f44de['id'];if(_0x238c74['query']['filter']){_0x4f90dd[_0x06f7('0x47')]=_[_0x06f7('0x4b')](_0x4f90dd[_0x06f7('0x47')],{'$or':_[_0x06f7('0x3a')](_0x4f90dd['attributes'],function(_0x264cdd){var _0x4c5ec9={};_0x4c5ec9[_0x264cdd]={'$like':'%'+_0x238c74[_0x06f7('0x3f')][_0x06f7('0x4a')]+'%'};return _0x4c5ec9;})});}if(_0x238c74[_0x06f7('0x3f')][_0x06f7('0xa1')]){var _0x1dbaa9=_0x238c74[_0x06f7('0x3f')]['$gte'][_0x06f7('0xa2')](',');var _0x438474={};_0x438474[_0x1dbaa9[0x0]]={'$gte':moment(_0x1dbaa9[0x1])['format'](_0x06f7('0xa3'))};_0x4f90dd[_0x06f7('0x47')]=_[_0x06f7('0x4b')](_0x4f90dd['where'],_0x438474);}_0x4f90dd=_['merge']({},_0x4f90dd,_0x238c74[_0x06f7('0x4c')]);return db[_0x06f7('0xa4')][_0x06f7('0x2d')]({'where':_0x4f90dd['where']})[_0x06f7('0x1e')](function(_0x456de4){_0x226011[_0x06f7('0x2d')]=_0x456de4;if(_0x238c74['query']['includeAll']){_0x4f90dd[_0x06f7('0x4f')]=[{'all':!![]}];}return db[_0x06f7('0xa4')][_0x06f7('0x50')](_0x4f90dd);})[_0x06f7('0x1e')](function(_0x4652af){_0x226011['rows']=_0x4652af;return _0x226011;});}})['then'](respondWithFilteredResult(_0x4d1520,_0x4f90dd))[_0x06f7('0x56')](handleError(_0x4d1520,null));};exports['send']=function(_0xb69934,_0xcaae9d,_0x4f3d90){var _0x12e8a8,_0x3a43ee={},_0x210e15;if(_0xb69934[_0x06f7('0x5f')]['to']){_0x210e15=_0xb69934[_0x06f7('0x5f')]['to'][0x0];}return db['FaxAccount'][_0x06f7('0x55')]({'where':{'id':_0xb69934[_0x06f7('0x52')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x210e15},'limit':0x1,'order':[[_0x06f7('0x9e'),_0x06f7('0xa5')]]}]}]})[_0x06f7('0x1e')](handleEntityNotFound(_0xcaae9d,null))[_0x06f7('0x1e')](function(_0xdc253a){_0x12e8a8=_0xdc253a;if(_0xb69934['body'][_0x06f7('0xa6')]&&_0xb69934['body'][_0x06f7('0xa6')][_0x06f7('0x54')]){for(var _0x3a9a91=0x0;_0x3a9a91<_0xb69934['body']['attachments'][_0x06f7('0x54')];_0x3a9a91+=0x1){_0xb69934[_0x06f7('0x5f')]['attachments'][_0x3a9a91]={'filename':_0xb69934[_0x06f7('0x5f')][_0x06f7('0xa6')][_0x3a9a91][_0x06f7('0x37')],'id':_0xb69934[_0x06f7('0x5f')][_0x06f7('0xa6')][_0x3a9a91]['id'],'path':path[_0x06f7('0xa7')](config[_0x06f7('0xa8')],_0x06f7('0xa9'),_0xb69934[_0x06f7('0x5f')][_0x06f7('0xa6')][_0x3a9a91][_0x06f7('0xaa')])};}}return respondWithRpcPromise('CheckAfterSend',_0x06f7('0xab'),{'FaxAccountId':_['isNil'](_0xb69934[_0x06f7('0x52')]['id'])?undefined:_0xb69934[_0x06f7('0x52')]['id'],'path':_[_0x06f7('0xac')](_0xb69934['body'][_0x06f7('0xa6')][0x0][_0x06f7('0xad')])?undefined:_0xb69934['body']['attachments'][0x0][_0x06f7('0xad')],'fax':_['isNil'](_0xb69934[_0x06f7('0x5f')]['to'][0x0])?undefined:_0xb69934[_0x06f7('0x5f')]['to'][0x0]},client9002);})[_0x06f7('0x1e')](function(){if(_0x12e8a8){if(_[_0x06f7('0xac')](_0xb69934['body'][_0x06f7('0xae')])){_0xb69934['body'][_0x06f7('0xae')]=util['format']('\x22%s\x22\x20<%s>',_0x12e8a8['name'],_0x12e8a8[_0x06f7('0xaf')]);}if(_0x12e8a8[_0x06f7('0xb0')]){if(_0x12e8a8[_0x06f7('0xb0')][_0x06f7('0xb1')][_0x06f7('0x54')]){return _0x12e8a8['List']['Contacts'][0x0];}else{return db[_0x06f7('0x71')][_0x06f7('0x57')](_[_0x06f7('0xb2')](_0xb69934[_0x06f7('0x5f')],{'firstName':_0xb69934['body']['to'][0x0],'phone':_0xb69934[_0x06f7('0x5f')]['to'][0x0],'fax':_0xb69934[_0x06f7('0x5f')]['to'][0x0],'ListId':_0x12e8a8[_0x06f7('0xb3')]}));}}else{throw new Error(_0x06f7('0xb4'));}}else{throw new Error(_0x06f7('0xb5'));}})[_0x06f7('0x1e')](function(_0x58f5fd){if(_0x58f5fd){return db[_0x06f7('0x6c')][_0x06f7('0x55')]({'where':{'ContactId':_0x58f5fd['id'],'closed':![],'FaxAccountId':_0x12e8a8['id']}})['then'](function(_0x271d4d){if(_0x271d4d){return[_0x271d4d,![]];}return db[_0x06f7('0x6c')][_0x06f7('0x57')]({'UserId':_0xb69934[_0x06f7('0x58')]['id'],'ContactId':_0x58f5fd['id'],'FaxAccountId':_0x12e8a8['id'],'fax':_0xb69934['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0xb69934[_0x06f7('0x5f')],{'read':![],'body':_0xb69934['body'][_0x06f7('0xa6')][0x0][_0x06f7('0xb6')],'FaxAccountId':_0x12e8a8['id'],'UserId':_0xb69934[_0x06f7('0x58')]['id'],'ContactId':_0x58f5fd['id'],'AttachmentId':_0xb69934[_0x06f7('0x5f')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x06f7('0xa4')],'as':'Messages'}]})[_0x06f7('0x1e')](function(_0x19312a){return[_0x19312a,!![]];});});}else{throw new Error(_0x06f7('0xb7'));}})['spread'](function(_0x27639e,_0x4a5208){if(_0x4a5208){return _0x27639e;}return db[_0x06f7('0xa4')][_0x06f7('0x57')]({'direction':'out','read':![],'body':_0xb69934['body'][_0x06f7('0xa6')][0x0][_0x06f7('0xb6')],'FaxAccountId':_0x12e8a8['id'],'FaxInteractionId':_0x27639e['id'],'UserId':_0xb69934['user']['id'],'ContactId':_0x27639e[_0x06f7('0xb8')],'AttachmentId':_0xb69934[_0x06f7('0x5f')][_0x06f7('0xa6')][0x0]['id']})['then'](function(_0x49be8e){_0x27639e[_0x06f7('0xb9')][_0x06f7('0xba')]=[];_0x27639e[_0x06f7('0xb9')][_0x06f7('0xba')]['push'](_0x49be8e[_0x06f7('0xb9')]);return _0x27639e;});})[_0x06f7('0x1e')](function(_0x14e387){respondWithRpcPromise(_0x06f7('0xbb'),_0x06f7('0xbb'),{'FaxAccountId':_[_0x06f7('0xac')](_0xb69934[_0x06f7('0x52')]['id'])?undefined:_0xb69934['params']['id'],'path':_[_0x06f7('0xac')](_0xb69934[_0x06f7('0x5f')][_0x06f7('0xa6')][0x0][_0x06f7('0xad')])?undefined:_0xb69934['body'][_0x06f7('0xa6')][0x0][_0x06f7('0xad')],'fax':_[_0x06f7('0xac')](_0xb69934['body']['to'][0x0])?undefined:_0xb69934[_0x06f7('0x5f')]['to'][0x0],'AttachmentId':_0xb69934[_0x06f7('0x5f')][_0x06f7('0xa6')][0x0]['id']},client9002)[_0x06f7('0x1e')](function(_0x2bca53){logger['info'](_0x06f7('0xbc'),_0x2bca53);})[_0x06f7('0x56')](function(_0x1756ee){logger['info'](_0x06f7('0xbc'),_0x1756ee);});return _0x14e387;})['then'](respondWithResult(_0xcaae9d,null))[_0x06f7('0x56')](handleError(_0xcaae9d,null));};exports[_0x06f7('0xbd')]=function(_0x3b559f,_0x12e899,_0x18370c){return db[_0x06f7('0x4d')][_0x06f7('0x55')]({'where':{'id':_0x3b559f[_0x06f7('0x52')]['id']}})['then'](handleEntityNotFound(_0x12e899,null))[_0x06f7('0x1e')](function(_0x33d30c){if(_0x33d30c){return _0x33d30c['addAgents'](_0x3b559f['body']['ids'],_[_0x06f7('0x6e')](_0x3b559f[_0x06f7('0x5f')],[_0x06f7('0x67'),'id'])||{})['spread'](function(_0x5e056f){for(var _0x591534=0x0;_0x591534<_0x3b559f[_0x06f7('0x5f')][_0x06f7('0x67')]['length'];_0x591534+=0x1){socket['emit'](_0x06f7('0xbe'),{'UserId':Number(_0x3b559f[_0x06f7('0x5f')][_0x06f7('0x67')][_0x591534]),'FaxAccountId':Number(_0x3b559f['params']['id'])});}return _0x5e056f;});}})[_0x06f7('0x1e')](respondWithResult(_0x12e899,null))[_0x06f7('0x56')](handleError(_0x12e899,null));};exports['removeAgents']=function(_0x1bcfce,_0x556e81,_0x4bf6a4){return db[_0x06f7('0x4d')][_0x06f7('0x55')]({'where':{'id':_0x1bcfce[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x556e81,null))[_0x06f7('0x1e')](function(_0x1d7909){if(_0x1d7909){return _0x1d7909[_0x06f7('0xbf')](_0x1bcfce['query'][_0x06f7('0x67')])[_0x06f7('0x1e')](function(){if(_[_0x06f7('0xc0')](_0x1bcfce[_0x06f7('0x3f')][_0x06f7('0x67')])){for(var _0x3e39a1=0x0;_0x3e39a1<_0x1bcfce[_0x06f7('0x3f')][_0x06f7('0x67')][_0x06f7('0x54')];_0x3e39a1+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x1bcfce[_0x06f7('0x3f')]['ids'][_0x3e39a1]),'FaxAccountId':Number(_0x1bcfce[_0x06f7('0x52')]['id'])});}}else{socket[_0x06f7('0xc1')](_0x06f7('0xc2'),{'UserId':Number(_0x1bcfce['query'][_0x06f7('0x67')]),'FaxAccountId':Number(_0x1bcfce[_0x06f7('0x52')]['id'])});}});}})[_0x06f7('0x1e')](respondWithStatusCode(_0x556e81,null))['catch'](handleError(_0x556e81,null));};exports[_0x06f7('0xc3')]=function(_0x4e61d6,_0x181219,_0x3091ae){var _0x3132ef={};var _0x10a89e={};var _0x430622;var _0x313e0e;return db['FaxAccount'][_0x06f7('0x70')]({'where':{'id':_0x4e61d6[_0x06f7('0x52')]['id']}})[_0x06f7('0x1e')](handleEntityNotFound(_0x181219,null))['then'](function(_0xe8a516){if(_0xe8a516){_0x430622=_0xe8a516;_0x10a89e['model']=_[_0x06f7('0x40')](db[_0x06f7('0x73')][_0x06f7('0x3b')]);_0x10a89e[_0x06f7('0x3f')]=_[_0x06f7('0x40')](_0x4e61d6['query']);_0x10a89e[_0x06f7('0x48')]=_[_0x06f7('0x41')](_0x10a89e[_0x06f7('0x3e')],_0x10a89e[_0x06f7('0x3f')]);_0x3132ef['attributes']=_[_0x06f7('0x41')](_0x10a89e[_0x06f7('0x3e')],qs['fields'](_0x4e61d6['query'][_0x06f7('0x43')]));_0x3132ef[_0x06f7('0x42')]=_0x3132ef[_0x06f7('0x42')][_0x06f7('0x54')]?_0x3132ef[_0x06f7('0x42')]:_0x10a89e[_0x06f7('0x3e')];_0x3132ef['order']=qs['sort'](_0x4e61d6[_0x06f7('0x3f')]['sort']);_0x3132ef[_0x06f7('0x47')]=qs[_0x06f7('0x48')](_[_0x06f7('0x49')](_0x4e61d6[_0x06f7('0x3f')],_0x10a89e[_0x06f7('0x48')]));if(_0x4e61d6['query'][_0x06f7('0x4a')]){_0x3132ef[_0x06f7('0x47')]=_[_0x06f7('0x4b')](_0x3132ef[_0x06f7('0x47')],{'$or':_[_0x06f7('0x3a')](_0x3132ef['attributes'],function(_0x5d37cc){var _0x14ef00={};_0x14ef00[_0x5d37cc]={'$like':'%'+_0x4e61d6[_0x06f7('0x3f')][_0x06f7('0x4a')]+'%'};return _0x14ef00;})});}_0x3132ef=_[_0x06f7('0x4b')]({},_0x3132ef,_0x4e61d6[_0x06f7('0x4c')]);return _0x430622['getAgents'](_0x3132ef);}})[_0x06f7('0x1e')](function(_0x493859){if(_0x493859){_0x313e0e=_0x493859[_0x06f7('0x54')];if(!_0x4e61d6[_0x06f7('0x3f')][_0x06f7('0x44')]('nolimit')){_0x3132ef[_0x06f7('0x2c')]=qs[_0x06f7('0x2c')](_0x4e61d6[_0x06f7('0x3f')]['limit']);_0x3132ef[_0x06f7('0x2a')]=qs[_0x06f7('0x2a')](_0x4e61d6['query'][_0x06f7('0x2a')]);}return _0x430622[_0x06f7('0xc3')](_0x3132ef);}})[_0x06f7('0x1e')](function(_0x1aa9a6){if(_0x1aa9a6){return _0x1aa9a6?{'count':_0x313e0e,'rows':_0x1aa9a6}:null;}})['then'](respondWithResult(_0x181219,null))[_0x06f7('0x56')](handleError(_0x181219,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index fbf6551..f18f96b 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 _0xee35=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update','remove','emit'];(function(_0x2d518d,_0x4e74a7){var _0x46da35=function(_0x31645a){while(--_0x31645a){_0x2d518d['push'](_0x2d518d['shift']());}};_0x46da35(++_0x4e74a7);}(_0xee35,0x7b));var _0x5ee3=function(_0x7cacf9,_0x6dac99){_0x7cacf9=_0x7cacf9-0x0;var _0xde6456=_0xee35[_0x7cacf9];return _0xde6456;};'use strict';var EventEmitter=require(_0x5ee3('0x0'));var FaxAccount=require(_0x5ee3('0x1'))['db'][_0x5ee3('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ee3('0x3'),'afterUpdate':_0x5ee3('0x4'),'afterDestroy':_0x5ee3('0x5')};function emitEvent(_0x39f9fe){return function(_0x19b3b1,_0x577fa5,_0x52f994){FaxAccountEvents['emit'](_0x39f9fe+':'+_0x19b3b1['id'],_0x19b3b1);FaxAccountEvents[_0x5ee3('0x6')](_0x39f9fe,_0x19b3b1);_0x52f994(null);};}for(var e in events){if(events[_0x5ee3('0x7')](e)){var event=events[e];FaxAccount[_0x5ee3('0x8')](e,emitEvent(event));}}module[_0x5ee3('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x7ad6=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x4c45ac,_0x59b59e){var _0xf9d4fb=function(_0x4d0425){while(--_0x4d0425){_0x4c45ac['push'](_0x4c45ac['shift']());}};_0xf9d4fb(++_0x59b59e);}(_0x7ad6,0x87));var _0x67ad=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ad6[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x67ad('0x0'));var FaxAccount=require(_0x67ad('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x67ad('0x2')](0x0);var events={'afterCreate':_0x67ad('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x553655){return function(_0x161043,_0x2e1a8d,_0x22dbb2){FaxAccountEvents[_0x67ad('0x4')](_0x553655+':'+_0x161043['id'],_0x161043);FaxAccountEvents[_0x67ad('0x4')](_0x553655,_0x161043);_0x22dbb2(null);};}for(var e in events){if(events[_0x67ad('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x67ad('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 f8997d7..45910c8 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 _0xbf48=['define','FaxAccount','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xbf48,0xe6));var _0x8bf4=function(_0x38f014,_0x35c5e3){_0x38f014=_0x38f014-0x0;var _0x4f141b=_0xbf48[_0x38f014];return _0x4f141b;};'use strict';var _=require(_0x8bf4('0x0'));var util=require(_0x8bf4('0x1'));var logger=require('../../config/logger')(_0x8bf4('0x2'));var moment=require(_0x8bf4('0x3'));var BPromise=require(_0x8bf4('0x4'));var rp=require(_0x8bf4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bf4('0x6'));var config=require(_0x8bf4('0x7'));var attributes=require(_0x8bf4('0x8'));module[_0x8bf4('0x9')]=function(_0xd2046e,_0x4467d0){return _0xd2046e[_0x8bf4('0xa')](_0x8bf4('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9edc=['rimraf','../../config/environment','exports','define','FaxAccount','lodash','util','api','moment','request-promise','path'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9edc,0x1de));var _0xc9ed=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x9edc[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0xc9ed('0x0'));var util=require(_0xc9ed('0x1'));var logger=require('../../config/logger')(_0xc9ed('0x2'));var moment=require(_0xc9ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xc9ed('0x4'));var fs=require('fs');var path=require(_0xc9ed('0x5'));var rimraf=require(_0xc9ed('0x6'));var config=require(_0xc9ed('0x7'));var attributes=require('./faxAccount.attributes');module[_0xc9ed('0x8')]=function(_0x2c2c2f,_0x5130ee){return _0x2c2c2f[_0xc9ed('0x9')](_0xc9ed('0xa'),attributes,{'tableName':'fax_accounts','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 dc078a1..614fc87 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 _0xa8fc=['CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','waitForTheAssignedAgent','Start','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','attributes','include','model','map','NotifyFaxAccount','fax','CmContact','Sequelize','difference','createdAt','updatedAt','keys','CompanyId','ListId','body','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','account'];(function(_0x164193,_0x41bb4d){var _0x2d4e30=function(_0x3e5153){while(--_0x3e5153){_0x164193['push'](_0x164193['shift']());}};_0x2d4e30(++_0x41bb4d);}(_0xa8fc,0xca));var _0xca8f=function(_0x580831,_0x2e293d){_0x580831=_0x580831-0x0;var _0x14c21a=_0xa8fc[_0x580831];return _0x14c21a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca8f('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca8f('0x1'))['db'];var utils=require(_0xca8f('0x2'));var logger=require(_0xca8f('0x3'))(_0xca8f('0x4'));var config=require(_0xca8f('0x5'));var jayson=require(_0xca8f('0x6'));var client=jayson[_0xca8f('0x7')]['http']({'port':0x232c});config[_0xca8f('0x8')]=_[_0xca8f('0x9')](config[_0xca8f('0x8')],{'host':_0xca8f('0xa'),'port':0x18eb});var socket=require(_0xca8f('0xb'))(new Redis(config[_0xca8f('0x8')]));require('./faxAccount.socket')[_0xca8f('0xc')](socket);function respondWithRpcPromise(_0x38c8f4,_0x5bb5aa,_0x5073e3){return new BPromise(function(_0x33d12a,_0x46eeff){return client[_0xca8f('0xd')](_0x38c8f4,_0x5073e3)[_0xca8f('0xe')](function(_0x1eedd4){logger[_0xca8f('0xf')](_0xca8f('0x10'),_0x5bb5aa,_0xca8f('0x11'));logger[_0xca8f('0x12')](_0xca8f('0x13'),_0x5bb5aa,'request\x20sent',JSON[_0xca8f('0x14')](_0x1eedd4));if(_0x1eedd4[_0xca8f('0x15')]){if(_0x1eedd4[_0xca8f('0x15')][_0xca8f('0x16')]===0x1f4){logger[_0xca8f('0x15')](_0xca8f('0x10'),_0x5bb5aa,_0x1eedd4[_0xca8f('0x15')][_0xca8f('0x17')]);return _0x46eeff(_0x1eedd4['error'][_0xca8f('0x17')]);}logger['error'](_0xca8f('0x10'),_0x5bb5aa,_0x1eedd4['error'][_0xca8f('0x17')]);return _0x33d12a(_0x1eedd4[_0xca8f('0x15')][_0xca8f('0x17')]);}else{logger[_0xca8f('0xf')](_0xca8f('0x10'),_0x5bb5aa,_0xca8f('0x11'));_0x33d12a(_0x1eedd4[_0xca8f('0x18')][_0xca8f('0x17')]);}})[_0xca8f('0x19')](function(_0x25f097){logger[_0xca8f('0x15')]('FaxAccount,\x20%s,\x20%s',_0x5bb5aa,_0x25f097);_0x46eeff(_0x25f097);});});}exports[_0xca8f('0x1a')]=function(_0x518370){var _0x4ec5da=this;return new Promise(function(_0x56d4a4,_0x3363d5){return db['FaxAccount'][_0xca8f('0x1b')]({'raw':_0x518370['options']?_0x518370[_0xca8f('0x1c')][_0xca8f('0x1d')]===undefined?!![]:![]:!![],'where':_0x518370[_0xca8f('0x1c')]?_0x518370['options']['where']||null:null,'attributes':_0x518370[_0xca8f('0x1c')]?_0x518370[_0xca8f('0x1c')][_0xca8f('0x1e')]||null:null,'limit':_0x518370['options']?_0x518370['options']['limit']||null:null,'include':_0x518370[_0xca8f('0x1c')]?_0x518370[_0xca8f('0x1c')][_0xca8f('0x1f')]?_['map'](_0x518370[_0xca8f('0x1c')]['include'],function(_0x8d9f79){return{'model':db[_0x8d9f79[_0xca8f('0x20')]],'as':_0x8d9f79['as'],'attributes':_0x8d9f79[_0xca8f('0x1e')],'include':_0x8d9f79[_0xca8f('0x1f')]?_[_0xca8f('0x21')](_0x8d9f79[_0xca8f('0x1f')],function(_0x5c83d5){return{'model':db[_0x5c83d5['model']],'as':_0x5c83d5['as'],'attributes':_0x5c83d5[_0xca8f('0x1e')],'include':_0x5c83d5[_0xca8f('0x1f')]?_['map'](_0x5c83d5[_0xca8f('0x1f')],function(_0x28bea6){return{'model':db[_0x28bea6['model']],'as':_0x28bea6['as'],'attributes':_0x28bea6[_0xca8f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed34b){logger[_0xca8f('0xf')](_0xca8f('0x1a'),_0x518370);logger[_0xca8f('0x12')](_0xca8f('0x1a'),_0x518370,JSON[_0xca8f('0x14')](_0x1ed34b));_0x56d4a4(_0x1ed34b);})[_0xca8f('0x19')](function(_0x5ddd1d){logger[_0xca8f('0x15')]('GetFaxAccount',_0x5ddd1d[_0xca8f('0x17')],_0x518370);_0x3363d5(_0x4ec5da[_0xca8f('0x15')](0x1f4,_0x5ddd1d[_0xca8f('0x17')]));});});};exports[_0xca8f('0x22')]=function(_0xf040bc,_0x340010,_0x4b7c8){var _0x4e8e4d=this;return new Promise(function(_0x501a29,_0x148d3a){var _0x33db81={'body':_0xf040bc['body'],'channel':_0xca8f('0x23')};var _0xa8503b=[];var _0xaf67ca=[];var _0x2250d5={};return db[_0xca8f('0x24')]['describe']()[_0xca8f('0xe')](function(_0x3cc4be){if(!_0x3cc4be){throw new db[(_0xca8f('0x25'))]['ValidationError']('no\x20available\x20attributes');}_0xa8503b=_[_0xca8f('0x26')](_['keys'](_0x3cc4be),[_0xca8f('0x27'),_0xca8f('0x28')]);_0xaf67ca=_[_0xca8f('0x26')](_[_0xca8f('0x29')](_0x3cc4be),['createdAt',_0xca8f('0x28'),_0xca8f('0x2a'),_0xca8f('0x2b')]);if(_0xf040bc[_0xca8f('0x2c')]['id']){delete _0xf040bc[_0xca8f('0x2c')]['id'];}if(_[_0xca8f('0x2d')](_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')])){throw new db[(_0xca8f('0x25'))][(_0xca8f('0x2f'))](_0xca8f('0x30'));}if(_['isNil'](_0xf040bc['body']['body'])||_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2c')]===''){throw new db[(_0xca8f('0x25'))][(_0xca8f('0x2f'))](_0xca8f('0x31'));}if(_[_0xca8f('0x2d')](_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x32')])){throw new db[(_0xca8f('0x25'))][(_0xca8f('0x2f'))](_0xca8f('0x33')+_0xaf67ca);}if(!_[_0xca8f('0x34')](_0xaf67ca,_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x32')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xaf67ca);}_0x2250d5[_0xf040bc[_0xca8f('0x2c')]['mapKey']]=_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')];})[_0xca8f('0xe')](function(){return db[_0xca8f('0x35')][_0xca8f('0x36')]({'where':{'id':_0xf040bc[_0xca8f('0x37')]['id']},'include':[{'model':db[_0xca8f('0x38')],'as':_0xca8f('0x39'),'include':[{'model':db[_0xca8f('0x24')],'as':_0xca8f('0x3a'),'where':_0x2250d5,'limit':0x1,'order':[[_0xca8f('0x28'),_0xca8f('0x3b')]]}]},{'model':db[_0xca8f('0x3c')],'as':_0xca8f('0x3d')}]});})[_0xca8f('0xe')](function(_0xd94767){if(_0xd94767&&_0xd94767[_0xca8f('0x39')]){var _0x4eb71e=_0xd94767[_0xca8f('0x3e')]({'plain':!![]});_0x33db81[_0xca8f('0x37')]=_0x4eb71e;_0x33db81[_0xca8f('0x3f')]=_0x4eb71e[_0xca8f('0x3d')];_0x33db81[_0xca8f('0x40')]=_0x4eb71e[_0xca8f('0x39')];_0x33db81[_0xca8f('0x3f')]=_['orderBy'](_0x33db81[_0xca8f('0x3f')],[_0xca8f('0x41')],[_0xca8f('0x42')]);if(_0x33db81[_0xca8f('0x37')]['Applications']){delete _0x33db81[_0xca8f('0x37')]['Applications'];}if(_0x33db81[_0xca8f('0x37')][_0xca8f('0x39')]&&_0x33db81['account'][_0xca8f('0x39')]['Contacts'][_0xca8f('0x43')]){return _0x33db81['account'][_0xca8f('0x39')][_0xca8f('0x3a')][0x0];}var _0x466452=_[_0xca8f('0x9')](_0xf040bc[_0xca8f('0x2c')],{'firstName':_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')],'ListId':_0x4eb71e[_0xca8f('0x2b')]});_0x466452[_0xf040bc[_0xca8f('0x2c')]['mapKey']]=_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2e')];return db[_0xca8f('0x24')][_0xca8f('0x44')](_0x466452,{'fields':_0xa8503b,'raw':!![]});}})[_0xca8f('0xe')](function(_0x2481e3){_0x33db81['contact']=_0x2481e3;if(_0x2481e3){var _0xfafc9f={'ContactId':_0x2481e3['id'],'FaxAccountId':_0xf040bc[_0xca8f('0x37')]['id'],'fax':_0x2481e3[_0xca8f('0x23')]};return db[_0xca8f('0x45')]['find']({'where':{'ContactId':_0x2481e3['id'],'closed':![],'FaxAccountId':_0xf040bc[_0xca8f('0x37')]['id']}})[_0xca8f('0xe')](function(_0xb386cd){if(_0xb386cd){return[_0xb386cd,![]];}return db['FaxInteraction'][_0xca8f('0x44')](_0xfafc9f)[_0xca8f('0xe')](function(_0x22e548){return[_0x22e548,!![]];});});}else{throw new Error(_0xca8f('0x46'));}})[_0xca8f('0x47')](function(_0xab5e5e,_0x5c9db2){var _0x259c46=_0xab5e5e[_0xca8f('0x3e')]({'plain':!![]});if(_0x5c9db2){if(_0x33db81[_0xca8f('0x37')][_0xca8f('0x48')]){_0x33db81[_0xca8f('0x3f')][_0xca8f('0x49')]({'id':0x0,'priority':_0x33db81[_0xca8f('0x3f')][_0xca8f('0x43')]+0x1,'app':_0xca8f('0x4a'),'appdata':_0xca8f('0x4b'),'interval':_0xca8f('0x4c')});}_0x259c46[_0xca8f('0x4d')]=!![];}else{_0x259c46[_0xca8f('0x4d')]=![];}_0x33db81['interaction']=_0x259c46;return db[_0xca8f('0x4e')][_0xca8f('0x44')]({'body':_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x2c')],'FaxAccountId':_0xf040bc[_0xca8f('0x37')]['id'],'FaxInteractionId':_0xab5e5e['id'],'direction':'in','ContactId':_0xab5e5e[_0xca8f('0x4f')],'AttachmentId':_0xf040bc[_0xca8f('0x2c')][_0xca8f('0x50')]});})[_0xca8f('0xe')](function(_0x35ab29){_0x33db81[_0xca8f('0x17')]=_0x35ab29;if(_0x33db81[_0xca8f('0x51')][_0xca8f('0x52')]){return db['User'][_0xca8f('0x36')]({'attributes':['id',_0xca8f('0x53')],'where':{'id':_0x33db81[_0xca8f('0x51')][_0xca8f('0x52')]}})[_0xca8f('0xe')](function(_0x5cfb56){if(_0x5cfb56){_0x33db81['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cfb56['name']+','+(_0x33db81[_0xca8f('0x37')][_0xca8f('0x54')]||0xa),'interval':_0xca8f('0x4c')});}return respondWithRpcPromise(_0xca8f('0x55'),'startRouting',_0x33db81);});}return respondWithRpcPromise(_0xca8f('0x55'),'startRouting',_0x33db81);})['then'](function(_0x38ccaa){_0x501a29(_0x38ccaa);})[_0xca8f('0x19')](function(_0x5264c9){_0x148d3a(_0x4e8e4d[_0xca8f('0x15')](0x1f4,_0x5264c9[_0xca8f('0x17')]));});});}; \ No newline at end of file +var _0xe97b=['orderBy','priority','asc','account','length','contact','fax','create','autoclose','push','close','created','interaction','FaxMessage','ContactId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','NotifyFaxAccount','body','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','CmContact','Contacts','FaxApplication','Applications','get','list','applications'];(function(_0x20f457,_0x107e67){var _0x3845be=function(_0x4b5adf){while(--_0x4b5adf){_0x20f457['push'](_0x20f457['shift']());}};_0x3845be(++_0x107e67);}(_0xe97b,0x11f));var _0xbe97=function(_0x45b43d,_0x5f2d75){_0x45b43d=_0x45b43d-0x0;var _0x471453=_0xe97b[_0x45b43d];return _0x471453;};'use strict';var _=require(_0xbe97('0x0'));var util=require(_0xbe97('0x1'));var moment=require('moment');var BPromise=require(_0xbe97('0x2'));var rs=require(_0xbe97('0x3'));var fs=require('fs');var Redis=require(_0xbe97('0x4'));var db=require(_0xbe97('0x5'))['db'];var utils=require(_0xbe97('0x6'));var logger=require(_0xbe97('0x7'))(_0xbe97('0x8'));var config=require(_0xbe97('0x9'));var jayson=require(_0xbe97('0xa'));var client=jayson[_0xbe97('0xb')][_0xbe97('0xc')]({'port':0x232c});config[_0xbe97('0xd')]=_['defaults'](config[_0xbe97('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe97('0xe'))(new Redis(config[_0xbe97('0xd')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3d5b69,_0x579437,_0x3b4e6a){return new BPromise(function(_0x402cc5,_0x22de2c){return client[_0xbe97('0xf')](_0x3d5b69,_0x3b4e6a)['then'](function(_0x3ec63d){logger[_0xbe97('0x10')]('FaxAccount,\x20%s,\x20%s',_0x579437,_0xbe97('0x11'));logger[_0xbe97('0x12')](_0xbe97('0x13'),_0x579437,_0xbe97('0x11'),JSON[_0xbe97('0x14')](_0x3ec63d));if(_0x3ec63d['error']){if(_0x3ec63d[_0xbe97('0x15')][_0xbe97('0x16')]===0x1f4){logger['error'](_0xbe97('0x17'),_0x579437,_0x3ec63d['error'][_0xbe97('0x18')]);return _0x22de2c(_0x3ec63d[_0xbe97('0x15')]['message']);}logger[_0xbe97('0x15')](_0xbe97('0x17'),_0x579437,_0x3ec63d[_0xbe97('0x15')][_0xbe97('0x18')]);return _0x402cc5(_0x3ec63d[_0xbe97('0x15')][_0xbe97('0x18')]);}else{logger['info'](_0xbe97('0x17'),_0x579437,_0xbe97('0x11'));_0x402cc5(_0x3ec63d['result'][_0xbe97('0x18')]);}})[_0xbe97('0x19')](function(_0x494ca4){logger['error'](_0xbe97('0x17'),_0x579437,_0x494ca4);_0x22de2c(_0x494ca4);});});}exports[_0xbe97('0x1a')]=function(_0x46860a){var _0x667285=this;return new Promise(function(_0x398aea,_0x2bfe5a){return db['FaxAccount'][_0xbe97('0x1b')]({'raw':_0x46860a[_0xbe97('0x1c')]?_0x46860a[_0xbe97('0x1c')][_0xbe97('0x1d')]===undefined?!![]:![]:!![],'where':_0x46860a[_0xbe97('0x1c')]?_0x46860a[_0xbe97('0x1c')][_0xbe97('0x1e')]||null:null,'attributes':_0x46860a[_0xbe97('0x1c')]?_0x46860a[_0xbe97('0x1c')][_0xbe97('0x1f')]||null:null,'limit':_0x46860a['options']?_0x46860a[_0xbe97('0x1c')][_0xbe97('0x20')]||null:null,'include':_0x46860a[_0xbe97('0x1c')]?_0x46860a['options'][_0xbe97('0x21')]?_[_0xbe97('0x22')](_0x46860a['options'][_0xbe97('0x21')],function(_0x5a44e3){return{'model':db[_0x5a44e3[_0xbe97('0x23')]],'as':_0x5a44e3['as'],'attributes':_0x5a44e3[_0xbe97('0x1f')],'include':_0x5a44e3[_0xbe97('0x21')]?_[_0xbe97('0x22')](_0x5a44e3[_0xbe97('0x21')],function(_0x520069){return{'model':db[_0x520069[_0xbe97('0x23')]],'as':_0x520069['as'],'attributes':_0x520069[_0xbe97('0x1f')],'include':_0x520069[_0xbe97('0x21')]?_['map'](_0x520069[_0xbe97('0x21')],function(_0x78740d){return{'model':db[_0x78740d[_0xbe97('0x23')]],'as':_0x78740d['as'],'attributes':_0x78740d['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe97('0x24')](function(_0x596284){logger[_0xbe97('0x10')]('GetFaxAccount',_0x46860a);logger['debug'](_0xbe97('0x1a'),_0x46860a,JSON[_0xbe97('0x14')](_0x596284));_0x398aea(_0x596284);})[_0xbe97('0x19')](function(_0x2809a0){logger['error'](_0xbe97('0x1a'),_0x2809a0[_0xbe97('0x18')],_0x46860a);_0x2bfe5a(_0x667285[_0xbe97('0x15')](0x1f4,_0x2809a0[_0xbe97('0x18')]));});});};exports[_0xbe97('0x25')]=function(_0xe05dd7,_0x483b4a,_0x4f564c){var _0x53d01e=this;return new Promise(function(_0x2bf4f1,_0x566699){var _0x1625b5={'body':_0xe05dd7[_0xbe97('0x26')],'channel':'fax'};var _0xb17b70=[];var _0x28fde3=[];var _0x5177e0={};return db['CmContact'][_0xbe97('0x27')]()[_0xbe97('0x24')](function(_0x3b4338){if(!_0x3b4338){throw new db['Sequelize'][(_0xbe97('0x28'))](_0xbe97('0x29'));}_0xb17b70=_[_0xbe97('0x2a')](_[_0xbe97('0x2b')](_0x3b4338),[_0xbe97('0x2c'),'updatedAt']);_0x28fde3=_[_0xbe97('0x2a')](_[_0xbe97('0x2b')](_0x3b4338),[_0xbe97('0x2c'),_0xbe97('0x2d'),'CompanyId',_0xbe97('0x2e')]);if(_0xe05dd7[_0xbe97('0x26')]['id']){delete _0xe05dd7[_0xbe97('0x26')]['id'];}if(_['isNil'](_0xe05dd7[_0xbe97('0x26')][_0xbe97('0x2f')])){throw new db[(_0xbe97('0x30'))][(_0xbe97('0x28'))](_0xbe97('0x31'));}if(_[_0xbe97('0x32')](_0xe05dd7['body'][_0xbe97('0x26')])||_0xe05dd7['body'][_0xbe97('0x26')]===''){throw new db[(_0xbe97('0x30'))][(_0xbe97('0x28'))](_0xbe97('0x33'));}if(_['isNil'](_0xe05dd7[_0xbe97('0x26')]['mapKey'])){throw new db[(_0xbe97('0x30'))][(_0xbe97('0x28'))](_0xbe97('0x34')+_0x28fde3);}if(!_[_0xbe97('0x35')](_0x28fde3,_0xe05dd7[_0xbe97('0x26')][_0xbe97('0x36')])){throw new db[(_0xbe97('0x30'))]['ValidationError'](_0xbe97('0x37')+_0x28fde3);}_0x5177e0[_0xe05dd7[_0xbe97('0x26')]['mapKey']]=_0xe05dd7[_0xbe97('0x26')]['from'];})[_0xbe97('0x24')](function(){return db['FaxAccount'][_0xbe97('0x38')]({'where':{'id':_0xe05dd7['account']['id']},'include':[{'model':db['CmList'],'as':_0xbe97('0x39'),'include':[{'model':db[_0xbe97('0x3a')],'as':_0xbe97('0x3b'),'where':_0x5177e0,'limit':0x1,'order':[[_0xbe97('0x2d'),'DESC']]}]},{'model':db[_0xbe97('0x3c')],'as':_0xbe97('0x3d')}]});})['then'](function(_0x51c216){if(_0x51c216&&_0x51c216[_0xbe97('0x39')]){var _0xa05064=_0x51c216[_0xbe97('0x3e')]({'plain':!![]});_0x1625b5['account']=_0xa05064;_0x1625b5['applications']=_0xa05064[_0xbe97('0x3d')];_0x1625b5[_0xbe97('0x3f')]=_0xa05064[_0xbe97('0x39')];_0x1625b5[_0xbe97('0x40')]=_[_0xbe97('0x41')](_0x1625b5[_0xbe97('0x40')],[_0xbe97('0x42')],[_0xbe97('0x43')]);if(_0x1625b5[_0xbe97('0x44')]['Applications']){delete _0x1625b5['account'][_0xbe97('0x3d')];}if(_0x1625b5[_0xbe97('0x44')][_0xbe97('0x39')]&&_0x1625b5[_0xbe97('0x44')][_0xbe97('0x39')][_0xbe97('0x3b')][_0xbe97('0x45')]){return _0x1625b5[_0xbe97('0x44')][_0xbe97('0x39')][_0xbe97('0x3b')][0x0];}var _0x1831ce=_['defaults'](_0xe05dd7[_0xbe97('0x26')],{'firstName':_0xe05dd7[_0xbe97('0x26')][_0xbe97('0x2f')],'ListId':_0xa05064[_0xbe97('0x2e')]});_0x1831ce[_0xe05dd7[_0xbe97('0x26')]['mapKey']]=_0xe05dd7[_0xbe97('0x26')][_0xbe97('0x2f')];return db[_0xbe97('0x3a')]['create'](_0x1831ce,{'fields':_0xb17b70,'raw':!![]});}})[_0xbe97('0x24')](function(_0x3ec3e6){_0x1625b5[_0xbe97('0x46')]=_0x3ec3e6;if(_0x3ec3e6){var _0x50df67={'ContactId':_0x3ec3e6['id'],'FaxAccountId':_0xe05dd7[_0xbe97('0x44')]['id'],'fax':_0x3ec3e6[_0xbe97('0x47')]};return db['FaxInteraction'][_0xbe97('0x38')]({'where':{'ContactId':_0x3ec3e6['id'],'closed':![],'FaxAccountId':_0xe05dd7[_0xbe97('0x44')]['id']}})[_0xbe97('0x24')](function(_0x2e55c4){if(_0x2e55c4){return[_0x2e55c4,![]];}return db['FaxInteraction'][_0xbe97('0x48')](_0x50df67)[_0xbe97('0x24')](function(_0x191afe){return[_0x191afe,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5333b5,_0x3275e1){var _0x25eeae=_0x5333b5[_0xbe97('0x3e')]({'plain':!![]});if(_0x3275e1){if(_0x1625b5['account'][_0xbe97('0x49')]){_0x1625b5['applications'][_0xbe97('0x4a')]({'id':0x0,'priority':_0x1625b5['applications'][_0xbe97('0x45')]+0x1,'app':_0xbe97('0x4b'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x25eeae[_0xbe97('0x4c')]=!![];}else{_0x25eeae[_0xbe97('0x4c')]=![];}_0x1625b5[_0xbe97('0x4d')]=_0x25eeae;return db[_0xbe97('0x4e')][_0xbe97('0x48')]({'body':_0xe05dd7[_0xbe97('0x26')][_0xbe97('0x26')],'FaxAccountId':_0xe05dd7[_0xbe97('0x44')]['id'],'FaxInteractionId':_0x5333b5['id'],'direction':'in','ContactId':_0x5333b5[_0xbe97('0x4f')],'AttachmentId':_0xe05dd7['body']['AttachmentId']});})[_0xbe97('0x24')](function(_0x30acb1){_0x1625b5[_0xbe97('0x18')]=_0x30acb1;if(_0x1625b5['interaction']['UserId']){return db[_0xbe97('0x50')][_0xbe97('0x38')]({'attributes':['id',_0xbe97('0x51')],'where':{'id':_0x1625b5[_0xbe97('0x4d')][_0xbe97('0x52')]}})[_0xbe97('0x24')](function(_0xa66d3b){if(_0xa66d3b){_0x1625b5[_0xbe97('0x40')][_0xbe97('0x53')]({'id':0x0,'priority':0x0,'app':_0xbe97('0x54'),'appdata':_0xa66d3b[_0xbe97('0x51')]+','+(_0x1625b5[_0xbe97('0x44')][_0xbe97('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbe97('0x56'),_0xbe97('0x57'),_0x1625b5);});}return respondWithRpcPromise(_0xbe97('0x56'),_0xbe97('0x57'),_0x1625b5);})[_0xbe97('0x24')](function(_0x3d6177){_0x2bf4f1(_0x3d6177);})[_0xbe97('0x19')](function(_0x54aef7){_0x566699(_0x53d01e[_0xbe97('0x15')](0x1f4,_0x54aef7[_0xbe97('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index b894cbe..84f1bea 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 _0xaeb1=['remove','removeListener','./faxAccount.events','save'];(function(_0xd9f6eb,_0x3c3f50){var _0x478e44=function(_0x50d873){while(--_0x50d873){_0xd9f6eb['push'](_0xd9f6eb['shift']());}};_0x478e44(++_0x3c3f50);}(_0xaeb1,0x13a));var _0x1aeb=function(_0x338569,_0x1917eb){_0x338569=_0x338569-0x0;var _0x2e0cf5=_0xaeb1[_0x338569];return _0x2e0cf5;};'use strict';var FaxAccountEvents=require(_0x1aeb('0x0'));var events=[_0x1aeb('0x1'),_0x1aeb('0x2'),'update'];function createListener(_0x3237f3,_0xe3a552){return function(_0x3701ef){_0xe3a552['emit'](_0x3237f3,_0x3701ef);};}function removeListener(_0x458e80,_0x5f509c){return function(){FaxAccountEvents[_0x1aeb('0x3')](_0x458e80,_0x5f509c);};}exports['register']=function(_0x4e6407){for(var _0x49b212=0x0,_0x302e4a=events['length'];_0x49b212<_0x302e4a;_0x49b212++){var _0x720a99=events[_0x49b212];var _0x14d38a=createListener('faxAccount:'+_0x720a99,_0x4e6407);FaxAccountEvents['on'](_0x720a99,_0x14d38a);}}; \ No newline at end of file +var _0x81ec=['length','faxAccount:','./faxAccount.events','save','remove','emit','register'];(function(_0x3ebd81,_0x53b204){var _0x75fb01=function(_0x1ad801){while(--_0x1ad801){_0x3ebd81['push'](_0x3ebd81['shift']());}};_0x75fb01(++_0x53b204);}(_0x81ec,0xe9));var _0xc81e=function(_0x345db1,_0x2bc585){_0x345db1=_0x345db1-0x0;var _0x13dc1e=_0x81ec[_0x345db1];return _0x13dc1e;};'use strict';var FaxAccountEvents=require(_0xc81e('0x0'));var events=[_0xc81e('0x1'),_0xc81e('0x2'),'update'];function createListener(_0x3b7521,_0xb7f27){return function(_0x18a31b){_0xb7f27[_0xc81e('0x3')](_0x3b7521,_0x18a31b);};}function removeListener(_0x23b60e,_0x5d5c05){return function(){FaxAccountEvents['removeListener'](_0x23b60e,_0x5d5c05);};}exports[_0xc81e('0x4')]=function(_0x4202e1){for(var _0x1dfdf3=0x0,_0x44373a=events[_0xc81e('0x5')];_0x1dfdf3<_0x44373a;_0x1dfdf3++){var _0x5cde59=events[_0x1dfdf3];var _0x21a6e3=createListener(_0xc81e('0x6')+_0x5cde59,_0x4202e1);FaxAccountEvents['on'](_0x5cde59,_0x21a6e3);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index dd692c5..bb74dc6 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x1de9b9,_0x50a9fd){var _0x262280=function(_0xb34cb8){while(--_0xb34cb8){_0x1de9b9['push'](_0x1de9b9['shift']());}};_0x262280(++_0x50a9fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x1a4c39,_0x13aade){var _0x55b641=function(_0x222d9f){while(--_0x222d9f){_0x1a4c39['push'](_0x1a4c39['shift']());}};_0x55b641(++_0x13aade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 4b26753..72bc5f5 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 _0xdeab=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x402718,_0x22529c){var _0x3e6afb=function(_0x456b60){while(--_0x456b60){_0x402718['push'](_0x402718['shift']());}};_0x3e6afb(++_0x22529c);}(_0xdeab,0xb1));var _0xbdea=function(_0x2fceb3,_0x1e08ae){_0x2fceb3=_0x2fceb3-0x0;var _0x3624af=_0xdeab[_0x2fceb3];return _0x3624af;};'use strict';var Sequelize=require(_0xbdea('0x0'));module[_0xbdea('0x1')]={'priority':{'type':Sequelize[_0xbdea('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbdea('0x3')],'allowNull':![],'defaultValue':_0xbdea('0x4')},'appdata':{'type':Sequelize[_0xbdea('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbdea('0x3')],'defaultValue':_0xbdea('0x6')}}; \ No newline at end of file +var _0x4aba=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x11e496,_0x550762){var _0x4b2c4b=function(_0x1f6b6a){while(--_0x1f6b6a){_0x11e496['push'](_0x11e496['shift']());}};_0x4b2c4b(++_0x550762);}(_0x4aba,0x101));var _0xa4ab=function(_0x5b555e,_0x3db8b4){_0x5b555e=_0x5b555e-0x0;var _0x3c3d91=_0x4aba[_0x5b555e];return _0x3c3d91;};'use strict';var Sequelize=require(_0xa4ab('0x0'));module[_0xa4ab('0x1')]={'priority':{'type':Sequelize[_0xa4ab('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa4ab('0x3')],'allowNull':![],'defaultValue':_0xa4ab('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa4ab('0x3')]},'interval':{'type':Sequelize[_0xa4ab('0x3')],'defaultValue':_0xa4ab('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 963543a..46f4d61 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 _0xc43c=['json','offset','undefined','count','limit','reject','save','update','then','destroy','sendStatus','error','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x343d5d,_0x5b0c5a){var _0x40a5eb=function(_0x1dca07){while(--_0x1dca07){_0x343d5d['push'](_0x343d5d['shift']());}};_0x40a5eb(++_0x5b0c5a);}(_0xc43c,0x113));var _0xcc43=function(_0x50e161,_0x5be39b){_0x50e161=_0x50e161-0x0;var _0x3616b1=_0xc43c[_0x50e161];return _0x3616b1;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require(_0xcc43('0x5'));var Mustache=require(_0xcc43('0x6'));var util=require(_0xcc43('0x7'));var path=require(_0xcc43('0x8'));var sox=require(_0xcc43('0x9'));var csv=require(_0xcc43('0xa'));var ejs=require(_0xcc43('0xb'));var fs=require('fs');var fs_extra=require(_0xcc43('0xc'));var _=require(_0xcc43('0xd'));var squel=require(_0xcc43('0xe'));var crypto=require(_0xcc43('0xf'));var jsforce=require(_0xcc43('0x10'));var deskjs=require(_0xcc43('0x11'));var toCsv=require(_0xcc43('0xa'));var querystring=require(_0xcc43('0x12'));var Papa=require('papaparse');var Redis=require(_0xcc43('0x13'));var authService=require(_0xcc43('0x14'));var qs=require(_0xcc43('0x15'));var as=require(_0xcc43('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc43('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xcc43('0x18'));var licenseUtil=require(_0xcc43('0x19'));var db=require(_0xcc43('0x1a'))['db'];function respondWithStatusCode(_0x3df966,_0x4550c0){_0x4550c0=_0x4550c0||0xcc;return function(_0x3230cc){if(_0x3230cc){return _0x3df966['sendStatus'](_0x4550c0);}return _0x3df966[_0xcc43('0x1b')](_0x4550c0)[_0xcc43('0x1c')]();};}function respondWithResult(_0x56197b,_0x15fcaf){_0x15fcaf=_0x15fcaf||0xc8;return function(_0x43d1c4){if(_0x43d1c4){return _0x56197b[_0xcc43('0x1b')](_0x15fcaf)[_0xcc43('0x1d')](_0x43d1c4);}};}function respondWithFilteredResult(_0x56f70d,_0x13a00b){return function(_0x499b60){if(_0x499b60){var _0x41efa7=typeof _0x13a00b[_0xcc43('0x1e')]===_0xcc43('0x1f')&&typeof _0x13a00b['limit']==='undefined';var _0xa39738=_0x499b60['count'];var _0x1e42e6=_0x41efa7?0x0:_0x13a00b[_0xcc43('0x1e')];var _0x1973b9=_0x41efa7?_0x499b60[_0xcc43('0x20')]:_0x13a00b[_0xcc43('0x1e')]+_0x13a00b[_0xcc43('0x21')];var _0x4f7c7e;if(_0x1973b9>=_0xa39738){_0x1973b9=_0xa39738;_0x4f7c7e=0xc8;}else{_0x4f7c7e=0xce;}_0x56f70d[_0xcc43('0x1b')](_0x4f7c7e);return _0x56f70d['set']('Content-Range',_0x1e42e6+'-'+_0x1973b9+'/'+_0xa39738)[_0xcc43('0x1d')](_0x499b60);}return null;};}function patchUpdates(_0x4c5197){return function(_0x3b56c0){try{jsonpatch['apply'](_0x3b56c0,_0x4c5197,!![]);}catch(_0x3b8e90){return BPromise[_0xcc43('0x22')](_0x3b8e90);}return _0x3b56c0[_0xcc43('0x23')]();};}function saveUpdates(_0x2e9a04,_0x245ec8){return function(_0x3a0678){if(_0x3a0678){return _0x3a0678[_0xcc43('0x24')](_0x2e9a04)[_0xcc43('0x25')](function(_0x320ebf){return _0x320ebf;});}return null;};}function removeEntity(_0x46a902,_0x197939){return function(_0x2978fb){if(_0x2978fb){return _0x2978fb[_0xcc43('0x26')]()['then'](function(){_0x46a902[_0xcc43('0x1b')](0xcc)[_0xcc43('0x1c')]();});}};}function handleEntityNotFound(_0x292c59,_0x435d5b){return function(_0x366391){if(!_0x366391){_0x292c59[_0xcc43('0x27')](0x194);}return _0x366391;};}function handleError(_0x3b6e0c,_0xaab1b8){_0xaab1b8=_0xaab1b8||0x1f4;return function(_0x329621){logger[_0xcc43('0x28')](_0x329621['stack']);if(_0x329621['name']){delete _0x329621[_0xcc43('0x29')];}_0x3b6e0c[_0xcc43('0x1b')](_0xaab1b8)[_0xcc43('0x2a')](_0x329621);};}exports[_0xcc43('0x2b')]=function(_0x5eeb39,_0x442885){var _0x44d748={},_0x3f3320={},_0x46cda9={'count':0x0,'rows':[]};var _0x3bcba8=_['map'](db[_0xcc43('0x2c')][_0xcc43('0x2d')],function(_0x392cb9){return{'name':_0x392cb9[_0xcc43('0x2e')],'type':_0x392cb9[_0xcc43('0x2f')][_0xcc43('0x30')]};});_0x3f3320[_0xcc43('0x31')]=_[_0xcc43('0x32')](_0x3bcba8,'name');_0x3f3320[_0xcc43('0x33')]=_[_0xcc43('0x34')](_0x5eeb39[_0xcc43('0x33')]);_0x3f3320['filters']=_['intersection'](_0x3f3320[_0xcc43('0x31')],_0x3f3320['query']);_0x44d748[_0xcc43('0x35')]=_[_0xcc43('0x36')](_0x3f3320[_0xcc43('0x31')],qs[_0xcc43('0x37')](_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x37')]));_0x44d748[_0xcc43('0x35')]=_0x44d748[_0xcc43('0x35')][_0xcc43('0x38')]?_0x44d748['attributes']:_0x3f3320[_0xcc43('0x31')];if(!_0x5eeb39['query'][_0xcc43('0x39')](_0xcc43('0x3a'))){_0x44d748[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x21')]);_0x44d748[_0xcc43('0x1e')]=qs['offset'](_0x5eeb39['query'][_0xcc43('0x1e')]);}_0x44d748[_0xcc43('0x3b')]=qs['sort'](_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x3c')]);_0x44d748[_0xcc43('0x3d')]=qs[_0xcc43('0x3e')](_[_0xcc43('0x3f')](_0x5eeb39['query'],_0x3f3320['filters']),_0x3bcba8);if(_0x5eeb39['query'][_0xcc43('0x40')]){_0x44d748[_0xcc43('0x3d')]=_[_0xcc43('0x41')](_0x44d748[_0xcc43('0x3d')],{'$or':_[_0xcc43('0x32')](_0x3bcba8,function(_0x37f430){if(_0x37f430[_0xcc43('0x2f')]!==_0xcc43('0x42')){var _0x5eab80={};_0x5eab80[_0x37f430[_0xcc43('0x29')]]={'$like':'%'+_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x40')]+'%'};return _0x5eab80;}})});}_0x44d748=_[_0xcc43('0x41')]({},_0x44d748,_0x5eeb39['options']);var _0x58ae4d={'where':_0x44d748['where']};return db['FaxApplication']['count'](_0x58ae4d)['then'](function(_0x2809e4){_0x46cda9[_0xcc43('0x20')]=_0x2809e4;if(_0x5eeb39[_0xcc43('0x33')][_0xcc43('0x43')]){_0x44d748[_0xcc43('0x44')]=[{'all':!![]}];}return db[_0xcc43('0x2c')][_0xcc43('0x45')](_0x44d748);})[_0xcc43('0x25')](function(_0x4e9083){_0x46cda9['rows']=_0x4e9083;return _0x46cda9;})[_0xcc43('0x25')](respondWithFilteredResult(_0x442885,_0x44d748))['catch'](handleError(_0x442885,null));};exports[_0xcc43('0x46')]=function(_0x1f0921,_0x170eec){var _0x36a681={'raw':!![],'where':{'id':_0x1f0921[_0xcc43('0x47')]['id']}},_0x14f6e2={};_0x14f6e2[_0xcc43('0x31')]=_['keys'](db[_0xcc43('0x2c')][_0xcc43('0x2d')]);_0x14f6e2[_0xcc43('0x33')]=_[_0xcc43('0x34')](_0x1f0921['query']);_0x14f6e2[_0xcc43('0x3e')]=_[_0xcc43('0x36')](_0x14f6e2[_0xcc43('0x31')],_0x14f6e2[_0xcc43('0x33')]);_0x36a681['attributes']=_['intersection'](_0x14f6e2[_0xcc43('0x31')],qs[_0xcc43('0x37')](_0x1f0921['query'][_0xcc43('0x37')]));_0x36a681[_0xcc43('0x35')]=_0x36a681[_0xcc43('0x35')][_0xcc43('0x38')]?_0x36a681[_0xcc43('0x35')]:_0x14f6e2[_0xcc43('0x31')];if(_0x1f0921[_0xcc43('0x33')][_0xcc43('0x43')]){_0x36a681['include']=[{'all':!![]}];}_0x36a681=_['merge']({},_0x36a681,_0x1f0921['options']);return db[_0xcc43('0x2c')][_0xcc43('0x48')](_0x36a681)['then'](handleEntityNotFound(_0x170eec,null))[_0xcc43('0x25')](respondWithResult(_0x170eec,null))[_0xcc43('0x49')](handleError(_0x170eec,null));};exports[_0xcc43('0x4a')]=function(_0x1f7d54,_0x1f3bfb){return db[_0xcc43('0x2c')][_0xcc43('0x4a')](_0x1f7d54[_0xcc43('0x4b')],{})[_0xcc43('0x25')](respondWithResult(_0x1f3bfb,0xc9))[_0xcc43('0x49')](handleError(_0x1f3bfb,null));};exports[_0xcc43('0x24')]=function(_0xc2f8a6,_0x24d4c6){if(_0xc2f8a6['body']['id']){delete _0xc2f8a6['body']['id'];}return db[_0xcc43('0x2c')][_0xcc43('0x48')]({'where':{'id':_0xc2f8a6[_0xcc43('0x47')]['id']}})[_0xcc43('0x25')](handleEntityNotFound(_0x24d4c6,null))[_0xcc43('0x25')](saveUpdates(_0xc2f8a6[_0xcc43('0x4b')],null))[_0xcc43('0x25')](respondWithResult(_0x24d4c6,null))[_0xcc43('0x49')](handleError(_0x24d4c6,null));};exports[_0xcc43('0x26')]=function(_0x58c3b7,_0x157151){return db[_0xcc43('0x2c')][_0xcc43('0x48')]({'where':{'id':_0x58c3b7[_0xcc43('0x47')]['id']}})[_0xcc43('0x25')](handleEntityNotFound(_0x157151,null))[_0xcc43('0x25')](removeEntity(_0x157151,null))['catch'](handleError(_0x157151,null));}; \ No newline at end of file +var _0x6ebd=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','stack','name','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x133ccf,_0x3aa8bd){var _0x237c63=function(_0x49e045){while(--_0x49e045){_0x133ccf['push'](_0x133ccf['shift']());}};_0x237c63(++_0x3aa8bd);}(_0x6ebd,0x10b));var _0xd6eb=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x6ebd[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0xd6eb('0x0'));var rimraf=require(_0xd6eb('0x1'));var zipdir=require(_0xd6eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6eb('0x3'));var moment=require(_0xd6eb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd6eb('0x5'));var util=require('util');var path=require(_0xd6eb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6eb('0x7'));var _=require(_0xd6eb('0x8'));var squel=require(_0xd6eb('0x9'));var crypto=require(_0xd6eb('0xa'));var jsforce=require(_0xd6eb('0xb'));var deskjs=require(_0xd6eb('0xc'));var toCsv=require(_0xd6eb('0xd'));var querystring=require(_0xd6eb('0xe'));var Papa=require(_0xd6eb('0xf'));var Redis=require('ioredis');var authService=require(_0xd6eb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd6eb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd6eb('0x12'))['db'];function respondWithStatusCode(_0x4a2906,_0x1a64e1){_0x1a64e1=_0x1a64e1||0xcc;return function(_0x4b88e3){if(_0x4b88e3){return _0x4a2906[_0xd6eb('0x13')](_0x1a64e1);}return _0x4a2906['status'](_0x1a64e1)[_0xd6eb('0x14')]();};}function respondWithResult(_0x327cba,_0x3da684){_0x3da684=_0x3da684||0xc8;return function(_0x224fe4){if(_0x224fe4){return _0x327cba[_0xd6eb('0x15')](_0x3da684)[_0xd6eb('0x16')](_0x224fe4);}};}function respondWithFilteredResult(_0x124391,_0x110287){return function(_0x2293cb){if(_0x2293cb){var _0x18630a=typeof _0x110287[_0xd6eb('0x17')]===_0xd6eb('0x18')&&typeof _0x110287[_0xd6eb('0x19')]===_0xd6eb('0x18');var _0x9dd4dd=_0x2293cb['count'];var _0x2dc7da=_0x18630a?0x0:_0x110287[_0xd6eb('0x17')];var _0x16942c=_0x18630a?_0x2293cb[_0xd6eb('0x1a')]:_0x110287[_0xd6eb('0x17')]+_0x110287[_0xd6eb('0x19')];var _0x1b771e;if(_0x16942c>=_0x9dd4dd){_0x16942c=_0x9dd4dd;_0x1b771e=0xc8;}else{_0x1b771e=0xce;}_0x124391[_0xd6eb('0x15')](_0x1b771e);return _0x124391['set'](_0xd6eb('0x1b'),_0x2dc7da+'-'+_0x16942c+'/'+_0x9dd4dd)[_0xd6eb('0x16')](_0x2293cb);}return null;};}function patchUpdates(_0x4f32d2){return function(_0x43c8bf){try{jsonpatch['apply'](_0x43c8bf,_0x4f32d2,!![]);}catch(_0x56523e){return BPromise[_0xd6eb('0x1c')](_0x56523e);}return _0x43c8bf[_0xd6eb('0x1d')]();};}function saveUpdates(_0xfae924,_0xbf696e){return function(_0x4ea2b9){if(_0x4ea2b9){return _0x4ea2b9[_0xd6eb('0x1e')](_0xfae924)[_0xd6eb('0x1f')](function(_0x2400dc){return _0x2400dc;});}return null;};}function removeEntity(_0x2c80d6,_0x114528){return function(_0x35b27a){if(_0x35b27a){return _0x35b27a['destroy']()[_0xd6eb('0x1f')](function(){_0x2c80d6[_0xd6eb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ad4c4,_0x2d2dac){return function(_0x1e1d94){if(!_0x1e1d94){_0x5ad4c4[_0xd6eb('0x13')](0x194);}return _0x1e1d94;};}function handleError(_0x36edd2,_0x15d9a9){_0x15d9a9=_0x15d9a9||0x1f4;return function(_0xed0e00){logger['error'](_0xed0e00[_0xd6eb('0x20')]);if(_0xed0e00[_0xd6eb('0x21')]){delete _0xed0e00[_0xd6eb('0x21')];}_0x36edd2[_0xd6eb('0x15')](_0x15d9a9)['send'](_0xed0e00);};}exports[_0xd6eb('0x22')]=function(_0x4bca86,_0x306559){var _0x3f50f3={},_0x45c686={},_0x4bae70={'count':0x0,'rows':[]};var _0x5324cd=_['map'](db[_0xd6eb('0x23')][_0xd6eb('0x24')],function(_0x227841){return{'name':_0x227841[_0xd6eb('0x25')],'type':_0x227841[_0xd6eb('0x26')][_0xd6eb('0x27')]};});_0x45c686[_0xd6eb('0x28')]=_[_0xd6eb('0x29')](_0x5324cd,_0xd6eb('0x21'));_0x45c686['query']=_[_0xd6eb('0x2a')](_0x4bca86[_0xd6eb('0x2b')]);_0x45c686[_0xd6eb('0x2c')]=_[_0xd6eb('0x2d')](_0x45c686[_0xd6eb('0x28')],_0x45c686['query']);_0x3f50f3[_0xd6eb('0x2e')]=_[_0xd6eb('0x2d')](_0x45c686[_0xd6eb('0x28')],qs[_0xd6eb('0x2f')](_0x4bca86[_0xd6eb('0x2b')][_0xd6eb('0x2f')]));_0x3f50f3[_0xd6eb('0x2e')]=_0x3f50f3[_0xd6eb('0x2e')][_0xd6eb('0x30')]?_0x3f50f3[_0xd6eb('0x2e')]:_0x45c686[_0xd6eb('0x28')];if(!_0x4bca86[_0xd6eb('0x2b')][_0xd6eb('0x31')](_0xd6eb('0x32'))){_0x3f50f3['limit']=qs[_0xd6eb('0x19')](_0x4bca86['query']['limit']);_0x3f50f3[_0xd6eb('0x17')]=qs[_0xd6eb('0x17')](_0x4bca86[_0xd6eb('0x2b')][_0xd6eb('0x17')]);}_0x3f50f3[_0xd6eb('0x33')]=qs[_0xd6eb('0x34')](_0x4bca86[_0xd6eb('0x2b')][_0xd6eb('0x34')]);_0x3f50f3[_0xd6eb('0x35')]=qs['filters'](_[_0xd6eb('0x36')](_0x4bca86[_0xd6eb('0x2b')],_0x45c686[_0xd6eb('0x2c')]),_0x5324cd);if(_0x4bca86[_0xd6eb('0x2b')][_0xd6eb('0x37')]){_0x3f50f3['where']=_[_0xd6eb('0x38')](_0x3f50f3['where'],{'$or':_[_0xd6eb('0x29')](_0x5324cd,function(_0x100e23){if(_0x100e23[_0xd6eb('0x26')]!==_0xd6eb('0x39')){var _0x3f91f4={};_0x3f91f4[_0x100e23[_0xd6eb('0x21')]]={'$like':'%'+_0x4bca86[_0xd6eb('0x2b')]['filter']+'%'};return _0x3f91f4;}})});}_0x3f50f3=_[_0xd6eb('0x38')]({},_0x3f50f3,_0x4bca86['options']);var _0xfd7f3a={'where':_0x3f50f3[_0xd6eb('0x35')]};return db['FaxApplication'][_0xd6eb('0x1a')](_0xfd7f3a)[_0xd6eb('0x1f')](function(_0x37b68b){_0x4bae70['count']=_0x37b68b;if(_0x4bca86[_0xd6eb('0x2b')][_0xd6eb('0x3a')]){_0x3f50f3[_0xd6eb('0x3b')]=[{'all':!![]}];}return db[_0xd6eb('0x23')][_0xd6eb('0x3c')](_0x3f50f3);})['then'](function(_0x1508e5){_0x4bae70[_0xd6eb('0x3d')]=_0x1508e5;return _0x4bae70;})[_0xd6eb('0x1f')](respondWithFilteredResult(_0x306559,_0x3f50f3))[_0xd6eb('0x3e')](handleError(_0x306559,null));};exports[_0xd6eb('0x3f')]=function(_0x2ca3ab,_0x28df94){var _0x31ce54={'raw':!![],'where':{'id':_0x2ca3ab[_0xd6eb('0x40')]['id']}},_0xfddb55={};_0xfddb55[_0xd6eb('0x28')]=_[_0xd6eb('0x2a')](db[_0xd6eb('0x23')][_0xd6eb('0x24')]);_0xfddb55[_0xd6eb('0x2b')]=_[_0xd6eb('0x2a')](_0x2ca3ab['query']);_0xfddb55[_0xd6eb('0x2c')]=_['intersection'](_0xfddb55[_0xd6eb('0x28')],_0xfddb55['query']);_0x31ce54[_0xd6eb('0x2e')]=_[_0xd6eb('0x2d')](_0xfddb55[_0xd6eb('0x28')],qs['fields'](_0x2ca3ab[_0xd6eb('0x2b')][_0xd6eb('0x2f')]));_0x31ce54['attributes']=_0x31ce54[_0xd6eb('0x2e')]['length']?_0x31ce54[_0xd6eb('0x2e')]:_0xfddb55['model'];if(_0x2ca3ab[_0xd6eb('0x2b')][_0xd6eb('0x3a')]){_0x31ce54['include']=[{'all':!![]}];}_0x31ce54=_['merge']({},_0x31ce54,_0x2ca3ab[_0xd6eb('0x41')]);return db[_0xd6eb('0x23')][_0xd6eb('0x42')](_0x31ce54)[_0xd6eb('0x1f')](handleEntityNotFound(_0x28df94,null))['then'](respondWithResult(_0x28df94,null))['catch'](handleError(_0x28df94,null));};exports[_0xd6eb('0x43')]=function(_0x57fc52,_0x5178e4){return db['FaxApplication']['create'](_0x57fc52[_0xd6eb('0x44')],{})[_0xd6eb('0x1f')](respondWithResult(_0x5178e4,0xc9))[_0xd6eb('0x3e')](handleError(_0x5178e4,null));};exports[_0xd6eb('0x1e')]=function(_0x4e65c5,_0x42cf09){if(_0x4e65c5[_0xd6eb('0x44')]['id']){delete _0x4e65c5[_0xd6eb('0x44')]['id'];}return db[_0xd6eb('0x23')][_0xd6eb('0x42')]({'where':{'id':_0x4e65c5['params']['id']}})[_0xd6eb('0x1f')](handleEntityNotFound(_0x42cf09,null))[_0xd6eb('0x1f')](saveUpdates(_0x4e65c5[_0xd6eb('0x44')],null))[_0xd6eb('0x1f')](respondWithResult(_0x42cf09,null))[_0xd6eb('0x3e')](handleError(_0x42cf09,null));};exports[_0xd6eb('0x45')]=function(_0x34956,_0x172f7d){return db[_0xd6eb('0x23')][_0xd6eb('0x42')]({'where':{'id':_0x34956[_0xd6eb('0x40')]['id']}})[_0xd6eb('0x1f')](handleEntityNotFound(_0x172f7d,null))[_0xd6eb('0x1f')](removeEntity(_0x172f7d,null))[_0xd6eb('0x3e')](handleError(_0x172f7d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 63b35d8..41353e9 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 _0x9e8c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x36d353,_0x16848f){var _0x22caa8=function(_0x5d14e8){while(--_0x5d14e8){_0x36d353['push'](_0x36d353['shift']());}};_0x22caa8(++_0x16848f);}(_0x9e8c,0x15e));var _0xc9e8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9e8c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc9e8('0x0'));var util=require(_0xc9e8('0x1'));var logger=require(_0xc9e8('0x2'))(_0xc9e8('0x3'));var moment=require(_0xc9e8('0x4'));var BPromise=require(_0xc9e8('0x5'));var rp=require(_0xc9e8('0x6'));var fs=require('fs');var path=require(_0xc9e8('0x7'));var rimraf=require(_0xc9e8('0x8'));var config=require(_0xc9e8('0x9'));var attributes=require(_0xc9e8('0xa'));module['exports']=function(_0x3a5185,_0x59cdae){return _0x3a5185[_0xc9e8('0xb')](_0xc9e8('0xc'),attributes,{'tableName':_0xc9e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc9e8('0xe'),'collate':_0xc9e8('0xf')});}; \ No newline at end of file +var _0xa9a3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications'];(function(_0x37222f,_0x25a5ab){var _0x5c5a6d=function(_0x27218b){while(--_0x27218b){_0x37222f['push'](_0x37222f['shift']());}};_0x5c5a6d(++_0x25a5ab);}(_0xa9a3,0x172));var _0x3a9a=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0xa9a3[_0x4f83ca];return _0x1fbac3;};'use strict';var _=require(_0x3a9a('0x0'));var util=require(_0x3a9a('0x1'));var logger=require(_0x3a9a('0x2'))(_0x3a9a('0x3'));var moment=require(_0x3a9a('0x4'));var BPromise=require('bluebird');var rp=require(_0x3a9a('0x5'));var fs=require('fs');var path=require(_0x3a9a('0x6'));var rimraf=require(_0x3a9a('0x7'));var config=require(_0x3a9a('0x8'));var attributes=require(_0x3a9a('0x9'));module[_0x3a9a('0xa')]=function(_0x1ff255,_0x3d8781){return _0x1ff255[_0x3a9a('0xb')](_0x3a9a('0xc'),attributes,{'tableName':_0x3a9a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a9a('0xe'),'collate':_0x3a9a('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index b40b084..843990f 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 _0xec86=['catch','FaxApplication','update','body','options','raw','where','limit','then','UpdateFaxApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4702c2,_0x3154b8){var _0x30e737=function(_0x47c289){while(--_0x47c289){_0x4702c2['push'](_0x4702c2['shift']());}};_0x30e737(++_0x3154b8);}(_0xec86,0x7f));var _0x6ec8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xec86[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x6ec8('0x0'));var util=require(_0x6ec8('0x1'));var moment=require(_0x6ec8('0x2'));var BPromise=require(_0x6ec8('0x3'));var rs=require(_0x6ec8('0x4'));var fs=require('fs');var Redis=require(_0x6ec8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ec8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ec8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6ec8('0x8')][_0x6ec8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11fb2b,_0x2c2636,_0x110d2c){return new BPromise(function(_0x1881bc,_0x58d55f){return client[_0x6ec8('0xa')](_0x11fb2b,_0x110d2c)['then'](function(_0x40bb60){logger[_0x6ec8('0xb')](_0x6ec8('0xc'),_0x2c2636,_0x6ec8('0xd'));logger[_0x6ec8('0xe')](_0x6ec8('0xf'),_0x2c2636,'request\x20sent',JSON['stringify'](_0x40bb60));if(_0x40bb60[_0x6ec8('0x10')]){if(_0x40bb60[_0x6ec8('0x10')]['code']===0x1f4){logger[_0x6ec8('0x10')](_0x6ec8('0xc'),_0x2c2636,_0x40bb60[_0x6ec8('0x10')]['message']);return _0x58d55f(_0x40bb60[_0x6ec8('0x10')][_0x6ec8('0x11')]);}logger[_0x6ec8('0x10')](_0x6ec8('0xc'),_0x2c2636,_0x40bb60['error'][_0x6ec8('0x11')]);return _0x1881bc(_0x40bb60[_0x6ec8('0x10')][_0x6ec8('0x11')]);}else{logger[_0x6ec8('0xb')](_0x6ec8('0xc'),_0x2c2636,_0x6ec8('0xd'));_0x1881bc(_0x40bb60['result'][_0x6ec8('0x11')]);}})[_0x6ec8('0x12')](function(_0x343b5c){logger['error'](_0x6ec8('0xc'),_0x2c2636,_0x343b5c);_0x58d55f(_0x343b5c);});});}exports['UpdateFaxApplication']=function(_0x3ce12f){var _0x13fe2e=this;return new Promise(function(_0x1d836a,_0xe9b881){return db[_0x6ec8('0x13')][_0x6ec8('0x14')](_0x3ce12f[_0x6ec8('0x15')],{'raw':_0x3ce12f[_0x6ec8('0x16')]?_0x3ce12f[_0x6ec8('0x16')][_0x6ec8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce12f['options']?_0x3ce12f[_0x6ec8('0x16')][_0x6ec8('0x18')]||null:null,'attributes':_0x3ce12f[_0x6ec8('0x16')]?_0x3ce12f[_0x6ec8('0x16')]['attributes']||null:null,'limit':_0x3ce12f['options']?_0x3ce12f[_0x6ec8('0x16')][_0x6ec8('0x19')]||null:null})[_0x6ec8('0x1a')](function(_0x562a84){logger[_0x6ec8('0xb')](_0x6ec8('0x1b'),_0x3ce12f);logger[_0x6ec8('0xe')](_0x6ec8('0x1b'),_0x3ce12f,JSON[_0x6ec8('0x1c')](_0x562a84));_0x1d836a(_0x562a84);})['catch'](function(_0x4f6805){logger['error'](_0x6ec8('0x1b'),_0x4f6805[_0x6ec8('0x11')],_0x3ce12f);_0xe9b881(_0x13fe2e['error'](0x1f4,_0x4f6805[_0x6ec8('0x11')]));});});}; \ No newline at end of file +var _0xd138=['code','error','message','result','catch','update','body','options','where','attributes','limit','UpdateFaxApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4f23e0,_0xb0d60b){var _0x21f8aa=function(_0x1bbd65){while(--_0x1bbd65){_0x4f23e0['push'](_0x4f23e0['shift']());}};_0x21f8aa(++_0xb0d60b);}(_0xd138,0x16c));var _0x8d13=function(_0x22f307,_0x4444e3){_0x22f307=_0x22f307-0x0;var _0x175f00=_0xd138[_0x22f307];return _0x175f00;};'use strict';var _=require(_0x8d13('0x0'));var util=require('util');var moment=require(_0x8d13('0x1'));var BPromise=require(_0x8d13('0x2'));var rs=require(_0x8d13('0x3'));var fs=require('fs');var Redis=require(_0x8d13('0x4'));var db=require(_0x8d13('0x5'))['db'];var utils=require(_0x8d13('0x6'));var logger=require(_0x8d13('0x7'))('rpc');var config=require(_0x8d13('0x8'));var jayson=require(_0x8d13('0x9'));var client=jayson[_0x8d13('0xa')][_0x8d13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4eed92,_0x531c87,_0x55f79f){return new BPromise(function(_0x58b34f,_0x5d3a82){return client[_0x8d13('0xc')](_0x4eed92,_0x55f79f)[_0x8d13('0xd')](function(_0x507ed5){logger[_0x8d13('0xe')](_0x8d13('0xf'),_0x531c87,_0x8d13('0x10'));logger[_0x8d13('0x11')](_0x8d13('0x12'),_0x531c87,_0x8d13('0x10'),JSON[_0x8d13('0x13')](_0x507ed5));if(_0x507ed5['error']){if(_0x507ed5['error'][_0x8d13('0x14')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x531c87,_0x507ed5[_0x8d13('0x15')][_0x8d13('0x16')]);return _0x5d3a82(_0x507ed5[_0x8d13('0x15')][_0x8d13('0x16')]);}logger[_0x8d13('0x15')](_0x8d13('0xf'),_0x531c87,_0x507ed5[_0x8d13('0x15')][_0x8d13('0x16')]);return _0x58b34f(_0x507ed5[_0x8d13('0x15')]['message']);}else{logger[_0x8d13('0xe')](_0x8d13('0xf'),_0x531c87,'request\x20sent');_0x58b34f(_0x507ed5[_0x8d13('0x17')][_0x8d13('0x16')]);}})[_0x8d13('0x18')](function(_0x137258){logger[_0x8d13('0x15')]('FaxApplication,\x20%s,\x20%s',_0x531c87,_0x137258);_0x5d3a82(_0x137258);});});}exports['UpdateFaxApplication']=function(_0x84cf68){var _0x40071f=this;return new Promise(function(_0x5cb130,_0xfaccbc){return db['FaxApplication'][_0x8d13('0x19')](_0x84cf68[_0x8d13('0x1a')],{'raw':_0x84cf68[_0x8d13('0x1b')]?_0x84cf68[_0x8d13('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x84cf68[_0x8d13('0x1b')]?_0x84cf68[_0x8d13('0x1b')][_0x8d13('0x1c')]||null:null,'attributes':_0x84cf68[_0x8d13('0x1b')]?_0x84cf68[_0x8d13('0x1b')][_0x8d13('0x1d')]||null:null,'limit':_0x84cf68['options']?_0x84cf68[_0x8d13('0x1b')][_0x8d13('0x1e')]||null:null})[_0x8d13('0xd')](function(_0x380321){logger[_0x8d13('0xe')](_0x8d13('0x1f'),_0x84cf68);logger[_0x8d13('0x11')]('UpdateFaxApplication',_0x84cf68,JSON['stringify'](_0x380321));_0x5cb130(_0x380321);})[_0x8d13('0x18')](function(_0x305901){logger[_0x8d13('0x15')](_0x8d13('0x1f'),_0x305901[_0x8d13('0x16')],_0x84cf68);_0xfaccbc(_0x40071f[_0x8d13('0x15')](0x1f4,_0x305901[_0x8d13('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d8f2b61..b50503f 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 _0xd7d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x265914,_0x18caf1){_0x265914=_0x265914-0x0;var _0x3ee8f0=_0xd7d1[_0x265914];return _0x3ee8f0;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);module[_0x1d7d('0x14')]=router; \ No newline at end of file +var _0x0598=['../../components/auth/service','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x0598,0x92));var _0x8059=function(_0x5c08e2,_0x491adf){_0x5c08e2=_0x5c08e2-0x0;var _0x2f32e3=_0x0598[_0x5c08e2];return _0x2f32e3;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxApplication.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8059('0xa')](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router[_0x8059('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0xd')]);module[_0x8059('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index ffe9948..a2de91e 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 _0xaa3e=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x2fab8a,_0x31e041){var _0x1cfa34=function(_0x217404){while(--_0x217404){_0x2fab8a['push'](_0x2fab8a['shift']());}};_0x1cfa34(++_0x31e041);}(_0xaa3e,0x69));var _0xeaa3=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xaa3e[_0x1faaa1];return _0x994ec;};'use strict';var Sequelize=require('sequelize');module[_0xeaa3('0x0')]={'closed':{'type':Sequelize[_0xeaa3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xeaa3('0x2')]},'disposition':{'type':Sequelize[_0xeaa3('0x3')]},'secondDisposition':{'type':Sequelize[_0xeaa3('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeaa3('0x3')]},'note':{'type':Sequelize[_0xeaa3('0x3')]},'read1stAt':{'type':Sequelize[_0xeaa3('0x2')]},'fax':{'type':Sequelize[_0xeaa3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xeaa3('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xeaa3('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xeaa3('0x4')]('in',_0xeaa3('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x467d=['DATE','ENUM','out','sequelize','exports','STRING'];(function(_0x357675,_0x340873){var _0x131eee=function(_0x250ed5){while(--_0x250ed5){_0x357675['push'](_0x357675['shift']());}};_0x131eee(++_0x340873);}(_0x467d,0xff));var _0xd467=function(_0x4cd1ae,_0x48ff9d){_0x4cd1ae=_0x4cd1ae-0x0;var _0x23e09f=_0x467d[_0x4cd1ae];return _0x23e09f;};'use strict';var Sequelize=require(_0xd467('0x0'));module[_0xd467('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd467('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd467('0x2')]},'read1stAt':{'type':Sequelize[_0xd467('0x3')]},'fax':{'type':Sequelize[_0xd467('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd467('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd467('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd467('0x4')]('in',_0xd467('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 2fcd866..8287987 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 _0x72aa=['key','getOptions','findAll','fax','query','user','catch','show','params','model','filters','intersection','attributes','fields','includeAll','include','merge','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','keys','length','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','setTags','spread','Tag','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','basename','existsSync','createReadStream','pipe','resolve','err','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','fieldName'];(function(_0x379581,_0x1123d9){var _0x5a071e=function(_0x208fbe){while(--_0x208fbe){_0x379581['push'](_0x379581['shift']());}};_0x5a071e(++_0x1123d9);}(_0x72aa,0x1d2));var _0xa72a=function(_0x46415a,_0x15013b){_0x46415a=_0x46415a-0x0;var _0x22a3cd=_0x72aa[_0x46415a];return _0x22a3cd;};'use strict';var rimraf=require(_0xa72a('0x0'));var zipdir=require(_0xa72a('0x1'));var moment=require('moment');var BPromise=require(_0xa72a('0x2'));var util=require(_0xa72a('0x3'));var path=require(_0xa72a('0x4'));var fs=require('fs');var _=require(_0xa72a('0x5'));var Redis=require(_0xa72a('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xa72a('0x7'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xa72a('0x8'))['db'];config[_0xa72a('0x9')]=_[_0xa72a('0xa')](config['redis'],{'host':_0xa72a('0xb'),'port':0x18eb});var socket=require(_0xa72a('0xc'))(new Redis(config[_0xa72a('0x9')]));require('./faxInteraction.socket')[_0xa72a('0xd')](socket);function respondWithStatusCode(_0x1d7bdb,_0x28edf0){_0x28edf0=_0x28edf0||0xcc;return function(_0x28b885){if(_0x28b885){return _0x1d7bdb[_0xa72a('0xe')](_0x28edf0);}return _0x1d7bdb[_0xa72a('0xf')](_0x28edf0)[_0xa72a('0x10')]();};}function respondWithResult(_0x137c8a,_0x21468e){_0x21468e=_0x21468e||0xc8;return function(_0x327647){if(_0x327647){return _0x137c8a[_0xa72a('0xf')](_0x21468e)[_0xa72a('0x11')](_0x327647);}};}function respondWithFilteredResult(_0x1df06b,_0x36ef9b){return function(_0x46a113){if(_0x46a113){var _0x1a4775=typeof _0x36ef9b['offset']===_0xa72a('0x12')&&typeof _0x36ef9b[_0xa72a('0x13')]===_0xa72a('0x12');var _0x5cc7fc=_0x46a113[_0xa72a('0x14')];var _0x39f513=_0x1a4775?0x0:_0x36ef9b['offset'];var _0x23ab47=_0x1a4775?_0x46a113[_0xa72a('0x14')]:_0x36ef9b[_0xa72a('0x15')]+_0x36ef9b[_0xa72a('0x13')];var _0xe4471e;if(_0x23ab47>=_0x5cc7fc){_0x23ab47=_0x5cc7fc;_0xe4471e=0xc8;}else{_0xe4471e=0xce;}_0x1df06b['status'](_0xe4471e);return _0x1df06b[_0xa72a('0x16')](_0xa72a('0x17'),_0x39f513+'-'+_0x23ab47+'/'+_0x5cc7fc)[_0xa72a('0x11')](_0x46a113);}return null;};}function saveUpdates(_0x228db4){return function(_0x55c2ab){if(_0x55c2ab){return _0x55c2ab[_0xa72a('0x18')](_0x228db4)[_0xa72a('0x19')](function(_0x52eb7a){return _0x52eb7a;});}return null;};}function removeEntity(_0x636659){return function(_0x523b9a){if(_0x523b9a){return _0x523b9a[_0xa72a('0x1a')]()[_0xa72a('0x19')](function(){_0x636659[_0xa72a('0xf')](0xcc)[_0xa72a('0x10')]();});}};}function handleEntityNotFound(_0x578332){return function(_0xce28f7){if(!_0xce28f7){_0x578332['sendStatus'](0x194);}return _0xce28f7;};}function handleError(_0x3effa8,_0x359b1a){_0x359b1a=_0x359b1a||0x1f4;return function(_0x11b26f){logger['error'](_0x11b26f[_0xa72a('0x1b')]);if(_0x11b26f[_0xa72a('0x1c')]){delete _0x11b26f[_0xa72a('0x1c')];}_0x3effa8[_0xa72a('0xf')](_0x359b1a)[_0xa72a('0x1d')](_0x11b26f);};}exports[_0xa72a('0x1e')]=function(_0x75eb53,_0x57c32b){var _0x22d264={};var _0x355e02=_[_0xa72a('0x1f')](db[_0xa72a('0x20')]['rawAttributes'],function(_0x141f8e){return{'name':_0x141f8e[_0xa72a('0x21')],'type':_0x141f8e['type'][_0xa72a('0x22')]};});_0x22d264=qs[_0xa72a('0x23')](_0x355e02,_0x75eb53);return interaction[_0xa72a('0x24')](_0xa72a('0x25'),_0x75eb53[_0xa72a('0x26')],_0x75eb53[_0xa72a('0x27')],_0x22d264,_0x355e02)[_0xa72a('0x19')](respondWithFilteredResult(_0x57c32b,_0x22d264))[_0xa72a('0x28')](handleError(_0x57c32b,null));};exports[_0xa72a('0x29')]=function(_0x5273fe,_0x1a8551){var _0xe6f765={'raw':![],'where':{'id':_0x5273fe[_0xa72a('0x2a')]['id']}},_0x5cd07e={};_0x5cd07e[_0xa72a('0x2b')]=_['keys'](db[_0xa72a('0x20')]['rawAttributes']);_0x5cd07e[_0xa72a('0x26')]=_['keys'](_0x5273fe[_0xa72a('0x26')]);_0x5cd07e[_0xa72a('0x2c')]=_[_0xa72a('0x2d')](_0x5cd07e[_0xa72a('0x2b')],_0x5cd07e[_0xa72a('0x26')]);_0xe6f765[_0xa72a('0x2e')]=_[_0xa72a('0x2d')](_0x5cd07e[_0xa72a('0x2b')],qs[_0xa72a('0x2f')](_0x5273fe[_0xa72a('0x26')]['fields']));_0xe6f765[_0xa72a('0x2e')]=_0xe6f765['attributes']['length']?_0xe6f765[_0xa72a('0x2e')]:_0x5cd07e['model'];if(_0x5273fe['query'][_0xa72a('0x30')]){_0xe6f765[_0xa72a('0x31')]=[{'all':!![]}];}_0xe6f765=_[_0xa72a('0x32')]({},_0xe6f765,_0x5273fe['options']);return db[_0xa72a('0x20')][_0xa72a('0x33')](_0xe6f765)[_0xa72a('0x19')](handleEntityNotFound(_0x1a8551,null))['then'](respondWithResult(_0x1a8551,null))[_0xa72a('0x28')](handleError(_0x1a8551,null));};exports[_0xa72a('0x34')]=function(_0xa887f4,_0x189a58){return db[_0xa72a('0x20')][_0xa72a('0x34')](_0xa887f4['body'],{})[_0xa72a('0x19')](respondWithResult(_0x189a58,0xc9))[_0xa72a('0x28')](handleError(_0x189a58,null));};exports[_0xa72a('0x18')]=function(_0x170878,_0x326a95){if(_0x170878['body']['id']){delete _0x170878[_0xa72a('0x35')]['id'];}return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x170878[_0xa72a('0x2a')]['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x326a95,null))[_0xa72a('0x19')](saveUpdates(_0x170878[_0xa72a('0x35')],null))[_0xa72a('0x19')](respondWithResult(_0x326a95,null))[_0xa72a('0x28')](handleError(_0x326a95,null));};exports['destroy']=function(_0x531835,_0xaf3d13){return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x531835[_0xa72a('0x2a')]['id']}})['then'](handleEntityNotFound(_0xaf3d13,null))['then'](removeEntity(_0xaf3d13,null))[_0xa72a('0x28')](handleError(_0xaf3d13,null));};exports[_0xa72a('0x36')]=function(_0x5031de,_0x1a201c){return db['FaxInteraction'][_0xa72a('0x36')]()[_0xa72a('0x19')](respondWithResult(_0x1a201c,null))[_0xa72a('0x28')](handleError(_0x1a201c,null));};exports[_0xa72a('0x37')]=function(_0x317818,_0x233991){return db[_0xa72a('0x38')]['find']({'where':{'id':_0x317818[_0xa72a('0x2a')]['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x233991,null))[_0xa72a('0x19')](function(_0x3eb04f){if(_0x3eb04f){return _0x3eb04f[_0xa72a('0x37')](_0x317818[_0xa72a('0x35')][_0xa72a('0x39')],_[_0xa72a('0x3a')](_0x317818[_0xa72a('0x35')],[_0xa72a('0x39'),'id'])||{});}})[_0xa72a('0x19')](respondWithResult(_0x233991,null))[_0xa72a('0x28')](handleError(_0x233991,null));};exports[_0xa72a('0x3b')]=function(_0x2b3f50,_0x3f99a0){var _0x3e9ad4={'raw':![],'where':{}};var _0x225a61={};var _0x2d6ea5={'count':0x0,'rows':[]};return db[_0xa72a('0x20')]['findOne']({'where':{'id':_0x2b3f50['params']['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x3f99a0,null))[_0xa72a('0x19')](function(_0x482348){if(_0x482348){_0x225a61['model']=_[_0xa72a('0x3c')](db[_0xa72a('0x38')]['rawAttributes']);_0x225a61[_0xa72a('0x26')]=_['keys'](_0x2b3f50[_0xa72a('0x26')]);_0x225a61[_0xa72a('0x2c')]=_[_0xa72a('0x2d')](_0x225a61[_0xa72a('0x2b')],_0x225a61[_0xa72a('0x26')]);_0x3e9ad4[_0xa72a('0x2e')]=_['intersection'](_0x225a61['model'],qs['fields'](_0x2b3f50[_0xa72a('0x26')]['fields']));_0x3e9ad4[_0xa72a('0x2e')]=_0x3e9ad4[_0xa72a('0x2e')][_0xa72a('0x3d')]?_0x3e9ad4[_0xa72a('0x2e')]:_0x225a61[_0xa72a('0x2b')];if(!_0x2b3f50['query'][_0xa72a('0x3e')](_0xa72a('0x3f'))){_0x3e9ad4[_0xa72a('0x13')]=qs[_0xa72a('0x13')](_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x13')]);_0x3e9ad4[_0xa72a('0x15')]=qs[_0xa72a('0x15')](_0x2b3f50[_0xa72a('0x26')]['offset']);}_0x3e9ad4[_0xa72a('0x40')]=qs['sort'](_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x41')]);_0x3e9ad4[_0xa72a('0x42')]=qs[_0xa72a('0x2c')](_['pick'](_0x2b3f50[_0xa72a('0x26')],_0x225a61[_0xa72a('0x2c')]));_0x3e9ad4[_0xa72a('0x42')][_0xa72a('0x43')]=_0x482348['id'];if(_0x2b3f50[_0xa72a('0x26')]['filter']){_0x3e9ad4[_0xa72a('0x42')]=_[_0xa72a('0x32')](_0x3e9ad4['where'],{'$or':_[_0xa72a('0x1f')](_0x3e9ad4[_0xa72a('0x2e')],function(_0x42d417){var _0x323f1f={};_0x323f1f[_0x42d417]={'$like':'%'+_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x44')]+'%'};return _0x323f1f;})});}if(_0x2b3f50[_0xa72a('0x26')][_0xa72a('0x45')]){var _0x5ab7d9=_0x2b3f50[_0xa72a('0x26')]['$gte'][_0xa72a('0x46')](',');var _0x2890a3={};_0x2890a3[_0x5ab7d9[0x0]]={'$gte':moment(_0x5ab7d9[0x1])[_0xa72a('0x47')](_0xa72a('0x48'))};_0x3e9ad4['where']=_[_0xa72a('0x32')](_0x3e9ad4[_0xa72a('0x42')],_0x2890a3);}_0x3e9ad4=_['merge']({},_0x3e9ad4,_0x2b3f50[_0xa72a('0x49')]);return db[_0xa72a('0x38')][_0xa72a('0x14')]({'where':_0x3e9ad4[_0xa72a('0x42')]})[_0xa72a('0x19')](function(_0x928558){_0x2d6ea5[_0xa72a('0x14')]=_0x928558;if(_0x2b3f50[_0xa72a('0x26')]['includeAll']){_0x3e9ad4[_0xa72a('0x31')]=[{'all':!![]}];}return db['FaxMessage'][_0xa72a('0x24')](_0x3e9ad4);})[_0xa72a('0x19')](function(_0x2b502b){_0x2d6ea5[_0xa72a('0x4a')]=_0x2b502b;return _0x2d6ea5;});}})[_0xa72a('0x19')](respondWithFilteredResult(_0x3f99a0,_0x3e9ad4))[_0xa72a('0x28')](handleError(_0x3f99a0,null));};exports['addTags']=function(_0x16119f,_0x2cfc73){return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x16119f[_0xa72a('0x2a')]['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x2cfc73,null))[_0xa72a('0x19')](function(_0x5a8fca){if(_0x5a8fca){return _0x5a8fca[_0xa72a('0x4b')](_0x16119f[_0xa72a('0x35')][_0xa72a('0x39')],_[_0xa72a('0x3a')](_0x16119f['body'],[_0xa72a('0x39'),'id'])||{})[_0xa72a('0x4c')](function(){return db[_0xa72a('0x4d')][_0xa72a('0x24')]({'attributes':['id',_0xa72a('0x1c'),_0xa72a('0x4e')],'where':{'id':_0x16119f['body'][_0xa72a('0x39')]}});})[_0xa72a('0x19')](function(_0x10f816){socket['emit'](_0xa72a('0x4f'),{'id':Number(_0x16119f[_0xa72a('0x2a')]['id']),'tags':_0x10f816||[]});return{'id':Number(_0x16119f['params']['id']),'tags':_0x10f816||[]};});}})['then'](respondWithResult(_0x2cfc73,null))[_0xa72a('0x28')](handleError(_0x2cfc73,null));};exports[_0xa72a('0x50')]=function(_0x54dc25,_0x402389){return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x54dc25['params']['id']}})[_0xa72a('0x19')](handleEntityNotFound(_0x402389,null))[_0xa72a('0x19')](function(_0x4dfbe2){if(_0x4dfbe2){return _0x4dfbe2['removeTags'](_0x54dc25[_0xa72a('0x26')][_0xa72a('0x39')]);}})[_0xa72a('0x19')](respondWithStatusCode(_0x402389,null))[_0xa72a('0x28')](handleError(_0x402389,null));};exports[_0xa72a('0x51')]=function(_0x4ea4ce,_0x26a27e){var _0x4bb9c4=moment()[_0xa72a('0x52')]()[_0xa72a('0x53')]();var _0x40f6b3=path[_0xa72a('0x54')](config[_0xa72a('0x55')],_0xa72a('0x56'),_0xa72a('0x57'),_0xa72a('0x58'));var _0x5fc803=path[_0xa72a('0x54')](config[_0xa72a('0x55')],'server',_0xa72a('0x57'),_0xa72a('0x59'));var _0x53a3a7=path[_0xa72a('0x54')](_0x40f6b3,_0x4bb9c4);var _0x5e3167=util[_0xa72a('0x47')](_0xa72a('0x5a'),_0x4ea4ce[_0xa72a('0x2a')]['id'],_0x4bb9c4);var _0x92a12d=path[_0xa72a('0x54')](_0x40f6b3,_0x5e3167);var _0x1d8be8=[];_0x1d8be8['push']({'model':db[_0xa72a('0x5b')],'as':_0xa72a('0x5b'),'raw':!![]});var _0xbb4a43=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xa72a('0x35'),_0xa72a('0x5c')],'include':_0x1d8be8}];return db[_0xa72a('0x20')][_0xa72a('0x33')]({'where':{'id':_0x4ea4ce[_0xa72a('0x2a')]['id']},'include':_0xbb4a43})['then'](handleEntityNotFound(_0x26a27e,null))['then'](function(_0x1ae5fe){if(_0x1ae5fe&&_0x1ae5fe['Messages']){var _0x28c2f2=_0x1ae5fe['get']({'plain':!![]});fs['mkdirSync'](_0x53a3a7);for(var _0x3d5d5d=0x0;_0x3d5d5d<_0x28c2f2['Messages'][_0xa72a('0x3d')];_0x3d5d5d++){var _0x40c928=_0x28c2f2[_0xa72a('0x5d')][_0x3d5d5d][_0xa72a('0x5b')];if(_0x40c928){var _0x19c447=path[_0xa72a('0x54')](_0x5fc803,_0x40c928[_0xa72a('0x5e')]);if(fs[_0xa72a('0x5f')](_0x19c447)){fs[_0xa72a('0x60')](_0x19c447)[_0xa72a('0x61')](fs['createWriteStream'](path[_0xa72a('0x54')](_0x53a3a7,_0x40c928['basename'])));}}}return BPromise[_0xa72a('0x62')]()[_0xa72a('0x19')](function(){return new BPromise(function(_0x4942f2,_0x46924b){zipdir(_0x53a3a7,{'saveTo':_0x92a12d},function(_0x493abe,_0x2665a9){if(_0x493abe)return _0x46924b(_0x493abe);return _0x4942f2(_0x2665a9);});})[_0xa72a('0x19')](function(){return new BPromise(function(_0x4d5c4e,_0x5680b3){rimraf(_0x53a3a7,function(_0x2af5a0){if(_0x2af5a0)_0x5680b3(_0x2af5a0);return _0x4d5c4e();});});})[_0xa72a('0x19')](function(){return _0x26a27e[_0xa72a('0x51')](_0x92a12d,_0x5e3167,function(_0x4d35b5){if(_0x4d35b5){console['log'](_0xa72a('0x63'),_0x4d35b5);}else{fs['unlinkSync'](_0x92a12d);}});});});}else{return _0x26a27e['sendStatus'](0xc8);}})[_0xa72a('0x28')](handleError(_0x26a27e,null));}; \ No newline at end of file +var _0x2042=['Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','unlinkSync','rimraf','zip-dir','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','error','stack','name','send','index','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','fax','query','user','catch','show','params','model','keys','filters','attributes','fields','length','merge','create','body','update','find','describe','addMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','FaxMessage','rows','spread','Tag','findAll','color','emit','faxInteractionTags:save','removeTags','download','toString','root','tmp','join','server','attachments','transcript-%d-%s.zip','push'];(function(_0x8ec92d,_0x1b8915){var _0x54e918=function(_0x4efa33){while(--_0x4efa33){_0x8ec92d['push'](_0x8ec92d['shift']());}};_0x54e918(++_0x1b8915);}(_0x2042,0x1af));var _0x2204=function(_0x5072d6,_0x332c4a){_0x5072d6=_0x5072d6-0x0;var _0x2b946d=_0x2042[_0x5072d6];return _0x2b946d;};'use strict';var rimraf=require(_0x2204('0x0'));var zipdir=require(_0x2204('0x1'));var moment=require('moment');var BPromise=require(_0x2204('0x2'));var util=require(_0x2204('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x2204('0x4'));var Redis=require(_0x2204('0x5'));var interaction=require(_0x2204('0x6'));var qs=require(_0x2204('0x7'));var logger=require(_0x2204('0x8'))(_0x2204('0x9'));var config=require(_0x2204('0xa'));var db=require('../../mysqldb')['db'];config[_0x2204('0xb')]=_[_0x2204('0xc')](config['redis'],{'host':_0x2204('0xd'),'port':0x18eb});var socket=require(_0x2204('0xe'))(new Redis(config[_0x2204('0xb')]));require(_0x2204('0xf'))[_0x2204('0x10')](socket);function respondWithStatusCode(_0x2fa915,_0x3c255d){_0x3c255d=_0x3c255d||0xcc;return function(_0x44a37a){if(_0x44a37a){return _0x2fa915[_0x2204('0x11')](_0x3c255d);}return _0x2fa915[_0x2204('0x12')](_0x3c255d)[_0x2204('0x13')]();};}function respondWithResult(_0x4d2d09,_0x142d24){_0x142d24=_0x142d24||0xc8;return function(_0x18d249){if(_0x18d249){return _0x4d2d09[_0x2204('0x12')](_0x142d24)[_0x2204('0x14')](_0x18d249);}};}function respondWithFilteredResult(_0x3b3430,_0x435eb1){return function(_0x2d8df9){if(_0x2d8df9){var _0x57a97d=typeof _0x435eb1['offset']===_0x2204('0x15')&&typeof _0x435eb1[_0x2204('0x16')]===_0x2204('0x15');var _0x569e21=_0x2d8df9[_0x2204('0x17')];var _0x49d512=_0x57a97d?0x0:_0x435eb1[_0x2204('0x18')];var _0x38570c=_0x57a97d?_0x2d8df9['count']:_0x435eb1['offset']+_0x435eb1['limit'];var _0x5cca3f;if(_0x38570c>=_0x569e21){_0x38570c=_0x569e21;_0x5cca3f=0xc8;}else{_0x5cca3f=0xce;}_0x3b3430[_0x2204('0x12')](_0x5cca3f);return _0x3b3430[_0x2204('0x19')](_0x2204('0x1a'),_0x49d512+'-'+_0x38570c+'/'+_0x569e21)[_0x2204('0x14')](_0x2d8df9);}return null;};}function saveUpdates(_0x2c04df){return function(_0x18258d){if(_0x18258d){return _0x18258d['update'](_0x2c04df)[_0x2204('0x1b')](function(_0x4a82e5){return _0x4a82e5;});}return null;};}function removeEntity(_0x4b0d1b){return function(_0x511545){if(_0x511545){return _0x511545[_0x2204('0x1c')]()[_0x2204('0x1b')](function(){_0x4b0d1b[_0x2204('0x12')](0xcc)[_0x2204('0x13')]();});}};}function handleEntityNotFound(_0x87dc99){return function(_0x4ba6df){if(!_0x4ba6df){_0x87dc99[_0x2204('0x11')](0x194);}return _0x4ba6df;};}function handleError(_0x33d7ba,_0x45c594){_0x45c594=_0x45c594||0x1f4;return function(_0x3bd882){logger[_0x2204('0x1d')](_0x3bd882[_0x2204('0x1e')]);if(_0x3bd882[_0x2204('0x1f')]){delete _0x3bd882[_0x2204('0x1f')];}_0x33d7ba[_0x2204('0x12')](_0x45c594)[_0x2204('0x20')](_0x3bd882);};}exports[_0x2204('0x21')]=function(_0x4ce647,_0x4b2d34){var _0xebe75={};var _0x208773=_['map'](db[_0x2204('0x22')][_0x2204('0x23')],function(_0x19d86b){return{'name':_0x19d86b[_0x2204('0x24')],'type':_0x19d86b[_0x2204('0x25')][_0x2204('0x26')]};});_0xebe75=qs[_0x2204('0x27')](_0x208773,_0x4ce647);return interaction['findAll'](_0x2204('0x28'),_0x4ce647[_0x2204('0x29')],_0x4ce647[_0x2204('0x2a')],_0xebe75,_0x208773)[_0x2204('0x1b')](respondWithFilteredResult(_0x4b2d34,_0xebe75))[_0x2204('0x2b')](handleError(_0x4b2d34,null));};exports[_0x2204('0x2c')]=function(_0xb3af52,_0x136ad6){var _0xe901f9={'raw':![],'where':{'id':_0xb3af52[_0x2204('0x2d')]['id']}},_0x14877a={};_0x14877a[_0x2204('0x2e')]=_[_0x2204('0x2f')](db['FaxInteraction'][_0x2204('0x23')]);_0x14877a[_0x2204('0x29')]=_[_0x2204('0x2f')](_0xb3af52[_0x2204('0x29')]);_0x14877a[_0x2204('0x30')]=_['intersection'](_0x14877a[_0x2204('0x2e')],_0x14877a[_0x2204('0x29')]);_0xe901f9[_0x2204('0x31')]=_['intersection'](_0x14877a[_0x2204('0x2e')],qs[_0x2204('0x32')](_0xb3af52['query'][_0x2204('0x32')]));_0xe901f9['attributes']=_0xe901f9[_0x2204('0x31')][_0x2204('0x33')]?_0xe901f9[_0x2204('0x31')]:_0x14877a[_0x2204('0x2e')];if(_0xb3af52[_0x2204('0x29')]['includeAll']){_0xe901f9['include']=[{'all':!![]}];}_0xe901f9=_[_0x2204('0x34')]({},_0xe901f9,_0xb3af52['options']);return db['FaxInteraction']['find'](_0xe901f9)[_0x2204('0x1b')](handleEntityNotFound(_0x136ad6,null))[_0x2204('0x1b')](respondWithResult(_0x136ad6,null))[_0x2204('0x2b')](handleError(_0x136ad6,null));};exports[_0x2204('0x35')]=function(_0xb36ff3,_0x2f2c7f){return db['FaxInteraction']['create'](_0xb36ff3[_0x2204('0x36')],{})[_0x2204('0x1b')](respondWithResult(_0x2f2c7f,0xc9))[_0x2204('0x2b')](handleError(_0x2f2c7f,null));};exports[_0x2204('0x37')]=function(_0x244d96,_0x5aa981){if(_0x244d96[_0x2204('0x36')]['id']){delete _0x244d96[_0x2204('0x36')]['id'];}return db[_0x2204('0x22')][_0x2204('0x38')]({'where':{'id':_0x244d96[_0x2204('0x2d')]['id']}})[_0x2204('0x1b')](handleEntityNotFound(_0x5aa981,null))[_0x2204('0x1b')](saveUpdates(_0x244d96[_0x2204('0x36')],null))[_0x2204('0x1b')](respondWithResult(_0x5aa981,null))[_0x2204('0x2b')](handleError(_0x5aa981,null));};exports[_0x2204('0x1c')]=function(_0x354c98,_0x57cf17){return db[_0x2204('0x22')][_0x2204('0x38')]({'where':{'id':_0x354c98[_0x2204('0x2d')]['id']}})['then'](handleEntityNotFound(_0x57cf17,null))['then'](removeEntity(_0x57cf17,null))[_0x2204('0x2b')](handleError(_0x57cf17,null));};exports[_0x2204('0x39')]=function(_0x4aa5f3,_0x54b511){return db[_0x2204('0x22')][_0x2204('0x39')]()['then'](respondWithResult(_0x54b511,null))[_0x2204('0x2b')](handleError(_0x54b511,null));};exports[_0x2204('0x3a')]=function(_0x36fe26,_0x2a0b51){return db['FaxMessage']['find']({'where':{'id':_0x36fe26[_0x2204('0x2d')]['id']}})[_0x2204('0x1b')](handleEntityNotFound(_0x2a0b51,null))[_0x2204('0x1b')](function(_0x45dfe3){if(_0x45dfe3){return _0x45dfe3[_0x2204('0x3a')](_0x36fe26[_0x2204('0x36')][_0x2204('0x3b')],_[_0x2204('0x3c')](_0x36fe26['body'],[_0x2204('0x3b'),'id'])||{});}})[_0x2204('0x1b')](respondWithResult(_0x2a0b51,null))[_0x2204('0x2b')](handleError(_0x2a0b51,null));};exports[_0x2204('0x3d')]=function(_0x91f5cc,_0x1a0945){var _0x5132e6={'raw':![],'where':{}};var _0x55431a={};var _0x2ceb25={'count':0x0,'rows':[]};return db[_0x2204('0x22')][_0x2204('0x3e')]({'where':{'id':_0x91f5cc['params']['id']}})['then'](handleEntityNotFound(_0x1a0945,null))[_0x2204('0x1b')](function(_0x167257){if(_0x167257){_0x55431a[_0x2204('0x2e')]=_[_0x2204('0x2f')](db['FaxMessage'][_0x2204('0x23')]);_0x55431a[_0x2204('0x29')]=_[_0x2204('0x2f')](_0x91f5cc['query']);_0x55431a[_0x2204('0x30')]=_[_0x2204('0x3f')](_0x55431a['model'],_0x55431a[_0x2204('0x29')]);_0x5132e6['attributes']=_[_0x2204('0x3f')](_0x55431a[_0x2204('0x2e')],qs[_0x2204('0x32')](_0x91f5cc[_0x2204('0x29')]['fields']));_0x5132e6['attributes']=_0x5132e6['attributes']['length']?_0x5132e6[_0x2204('0x31')]:_0x55431a[_0x2204('0x2e')];if(!_0x91f5cc[_0x2204('0x29')][_0x2204('0x40')]('nolimit')){_0x5132e6['limit']=qs[_0x2204('0x16')](_0x91f5cc['query']['limit']);_0x5132e6[_0x2204('0x18')]=qs[_0x2204('0x18')](_0x91f5cc['query']['offset']);}_0x5132e6[_0x2204('0x41')]=qs[_0x2204('0x42')](_0x91f5cc[_0x2204('0x29')][_0x2204('0x42')]);_0x5132e6[_0x2204('0x43')]=qs[_0x2204('0x30')](_[_0x2204('0x44')](_0x91f5cc['query'],_0x55431a[_0x2204('0x30')]));_0x5132e6['where'][_0x2204('0x45')]=_0x167257['id'];if(_0x91f5cc[_0x2204('0x29')][_0x2204('0x46')]){_0x5132e6['where']=_[_0x2204('0x34')](_0x5132e6[_0x2204('0x43')],{'$or':_[_0x2204('0x47')](_0x5132e6[_0x2204('0x31')],function(_0x16e910){var _0x34e086={};_0x34e086[_0x16e910]={'$like':'%'+_0x91f5cc[_0x2204('0x29')][_0x2204('0x46')]+'%'};return _0x34e086;})});}if(_0x91f5cc['query'][_0x2204('0x48')]){var _0x1134e9=_0x91f5cc['query'][_0x2204('0x48')][_0x2204('0x49')](',');var _0x49d6b1={};_0x49d6b1[_0x1134e9[0x0]]={'$gte':moment(_0x1134e9[0x1])['format'](_0x2204('0x4a'))};_0x5132e6[_0x2204('0x43')]=_[_0x2204('0x34')](_0x5132e6[_0x2204('0x43')],_0x49d6b1);}_0x5132e6=_[_0x2204('0x34')]({},_0x5132e6,_0x91f5cc[_0x2204('0x4b')]);return db['FaxMessage']['count']({'where':_0x5132e6[_0x2204('0x43')]})['then'](function(_0x50e724){_0x2ceb25[_0x2204('0x17')]=_0x50e724;if(_0x91f5cc[_0x2204('0x29')]['includeAll']){_0x5132e6['include']=[{'all':!![]}];}return db[_0x2204('0x4c')]['findAll'](_0x5132e6);})[_0x2204('0x1b')](function(_0x1bed4d){_0x2ceb25[_0x2204('0x4d')]=_0x1bed4d;return _0x2ceb25;});}})[_0x2204('0x1b')](respondWithFilteredResult(_0x1a0945,_0x5132e6))[_0x2204('0x2b')](handleError(_0x1a0945,null));};exports['addTags']=function(_0x4dc16b,_0x14bc31){return db[_0x2204('0x22')][_0x2204('0x38')]({'where':{'id':_0x4dc16b[_0x2204('0x2d')]['id']}})[_0x2204('0x1b')](handleEntityNotFound(_0x14bc31,null))[_0x2204('0x1b')](function(_0x133f83){if(_0x133f83){return _0x133f83['setTags'](_0x4dc16b[_0x2204('0x36')][_0x2204('0x3b')],_['omit'](_0x4dc16b[_0x2204('0x36')],[_0x2204('0x3b'),'id'])||{})[_0x2204('0x4e')](function(){return db[_0x2204('0x4f')][_0x2204('0x50')]({'attributes':['id',_0x2204('0x1f'),_0x2204('0x51')],'where':{'id':_0x4dc16b[_0x2204('0x36')][_0x2204('0x3b')]}});})['then'](function(_0x3c346b){socket[_0x2204('0x52')](_0x2204('0x53'),{'id':Number(_0x4dc16b[_0x2204('0x2d')]['id']),'tags':_0x3c346b||[]});return{'id':Number(_0x4dc16b[_0x2204('0x2d')]['id']),'tags':_0x3c346b||[]};});}})['then'](respondWithResult(_0x14bc31,null))[_0x2204('0x2b')](handleError(_0x14bc31,null));};exports[_0x2204('0x54')]=function(_0x51d00e,_0x344953){return db[_0x2204('0x22')]['find']({'where':{'id':_0x51d00e['params']['id']}})['then'](handleEntityNotFound(_0x344953,null))['then'](function(_0x3e6b3f){if(_0x3e6b3f){return _0x3e6b3f['removeTags'](_0x51d00e[_0x2204('0x29')][_0x2204('0x3b')]);}})[_0x2204('0x1b')](respondWithStatusCode(_0x344953,null))[_0x2204('0x2b')](handleError(_0x344953,null));};exports[_0x2204('0x55')]=function(_0x324258,_0x49bed5){var _0x26f569=moment()['unix']()[_0x2204('0x56')]();var _0x24f9d3=path['join'](config[_0x2204('0x57')],'server','files',_0x2204('0x58'));var _0x333e28=path[_0x2204('0x59')](config[_0x2204('0x57')],_0x2204('0x5a'),'files',_0x2204('0x5b'));var _0xeedff0=path[_0x2204('0x59')](_0x24f9d3,_0x26f569);var _0x213785=util['format'](_0x2204('0x5c'),_0x324258['params']['id'],_0x26f569);var _0x5ee25d=path['join'](_0x24f9d3,_0x213785);var _0x5f2444=[];_0x5f2444[_0x2204('0x5d')]({'model':db[_0x2204('0x5e')],'as':'Attachment','raw':!![]});var _0x544de9=[{'model':db['FaxMessage'],'as':_0x2204('0x5f'),'attributes':['id',_0x2204('0x36'),_0x2204('0x60')],'include':_0x5f2444}];return db[_0x2204('0x22')]['find']({'where':{'id':_0x324258[_0x2204('0x2d')]['id']},'include':_0x544de9})[_0x2204('0x1b')](handleEntityNotFound(_0x49bed5,null))['then'](function(_0x2959f2){if(_0x2959f2&&_0x2959f2[_0x2204('0x5f')]){var _0x2ba791=_0x2959f2[_0x2204('0x61')]({'plain':!![]});fs[_0x2204('0x62')](_0xeedff0);for(var _0x54fef1=0x0;_0x54fef1<_0x2ba791['Messages'][_0x2204('0x33')];_0x54fef1++){var _0x3dfe82=_0x2ba791[_0x2204('0x5f')][_0x54fef1][_0x2204('0x5e')];if(_0x3dfe82){var _0x5c1e0d=path[_0x2204('0x59')](_0x333e28,_0x3dfe82[_0x2204('0x63')]);if(fs['existsSync'](_0x5c1e0d)){fs[_0x2204('0x64')](_0x5c1e0d)[_0x2204('0x65')](fs[_0x2204('0x66')](path['join'](_0xeedff0,_0x3dfe82[_0x2204('0x63')])));}}}return BPromise[_0x2204('0x67')]()[_0x2204('0x1b')](function(){return new BPromise(function(_0x1cda82,_0x3fa412){zipdir(_0xeedff0,{'saveTo':_0x5ee25d},function(_0x2ba81f,_0x1d17a2){if(_0x2ba81f)return _0x3fa412(_0x2ba81f);return _0x1cda82(_0x1d17a2);});})[_0x2204('0x1b')](function(){return new BPromise(function(_0x5b5c3f,_0xb9fda9){rimraf(_0xeedff0,function(_0x36c296){if(_0x36c296)_0xb9fda9(_0x36c296);return _0x5b5c3f();});});})[_0x2204('0x1b')](function(){return _0x49bed5[_0x2204('0x55')](_0x5ee25d,_0x213785,function(_0x4d200e){if(_0x4d200e){console['log']('err',_0x4d200e);}else{fs[_0x2204('0x68')](_0x5ee25d);}});});});}else{return _0x49bed5[_0x2204('0x11')](0xc8);}})[_0x2204('0x2b')](handleError(_0x49bed5,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 692838b..685351a 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 _0x34de=['FaxInteraction','setMaxListeners','update','remove','then','Users','emit','catch','hook','exports','../../mysqldb'];(function(_0x2e627c,_0x5c0435){var _0x3c8fe9=function(_0x4c6028){while(--_0x4c6028){_0x2e627c['push'](_0x2e627c['shift']());}};_0x3c8fe9(++_0x5c0435);}(_0x34de,0x1c2));var _0xe34d=function(_0x58a62b,_0x37bf42){_0x58a62b=_0x58a62b-0x0;var _0x104020=_0x34de[_0x58a62b];return _0x104020;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xe34d('0x0'))['db'][_0xe34d('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe34d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe34d('0x3'),'afterDestroy':_0xe34d('0x4')};function emitEvent(_0x537c6a){return function(_0x3a71ac,_0x14995a,_0x35937e){_0x3a71ac['getUsers']({'attributes':['id'],'raw':!![]})[_0xe34d('0x5')](function(_0x257b89){_0x3a71ac['setDataValue'](_0xe34d('0x6'),_0x257b89['map'](function(_0x8d65d6){return{'id':_0x8d65d6['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3a71ac['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe34d('0x5')](function(_0x270d36){_0x3a71ac['setDataValue']('unreadMessages',_0x270d36['length']);FaxInteractionEvents['emit'](_0x537c6a+':'+_0x3a71ac['id'],_0x3a71ac);FaxInteractionEvents[_0xe34d('0x7')](_0x537c6a,_0x3a71ac);_0x35937e(null);})[_0xe34d('0x8')](_0x35937e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe34d('0x9')](e,emitEvent(event));}}module[_0xe34d('0xa')]=FaxInteractionEvents; \ No newline at end of file +var _0x2c5e=['FaxInteraction','FaxMessage','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x523d9b,_0x3e5932){var _0x38c25e=function(_0x3b0853){while(--_0x3b0853){_0x523d9b['push'](_0x523d9b['shift']());}};_0x38c25e(++_0x3e5932);}(_0x2c5e,0x142));var _0xe2c5=function(_0x5dc01c,_0x5b3217){_0x5dc01c=_0x5dc01c-0x0;var _0x18cd2d=_0x2c5e[_0x5dc01c];return _0x18cd2d;};'use strict';var EventEmitter=require(_0xe2c5('0x0'));var FaxInteraction=require(_0xe2c5('0x1'))['db'][_0xe2c5('0x2')];var FaxMessage=require(_0xe2c5('0x1'))['db'][_0xe2c5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe2c5('0x4'),'afterUpdate':_0xe2c5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x290ca2){return function(_0x289487,_0xdb7b61,_0x160f97){_0x289487['getUsers']({'attributes':['id'],'raw':!![]})[_0xe2c5('0x6')](function(_0x3e5a4c){_0x289487[_0xe2c5('0x7')](_0xe2c5('0x8'),_0x3e5a4c[_0xe2c5('0x9')](function(_0x123abc){return{'id':_0x123abc['id']};}));return FaxMessage[_0xe2c5('0xa')]({'where':{'FaxInteractionId':_0x289487['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe2c5('0x6')](function(_0x557529){_0x289487[_0xe2c5('0x7')](_0xe2c5('0xb'),_0x557529[_0xe2c5('0xc')]);FaxInteractionEvents[_0xe2c5('0xd')](_0x290ca2+':'+_0x289487['id'],_0x289487);FaxInteractionEvents[_0xe2c5('0xd')](_0x290ca2,_0x289487);_0x160f97(null);})[_0xe2c5('0xe')](_0x160f97(null));};}for(var e in events){if(events[_0xe2c5('0xf')](e)){var event=events[e];FaxInteraction[_0xe2c5('0x10')](e,emitEvent(event));}}module[_0xe2c5('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0a9368e..395824c 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 _0x9172=['FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x2300fa,_0x41c382){var _0x11fef0=function(_0x597ffb){while(--_0x597ffb){_0x2300fa['push'](_0x2300fa['shift']());}};_0x11fef0(++_0x41c382);}(_0x9172,0x1a5));var _0x2917=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x9172[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2917('0x0'));var moment=require(_0x2917('0x1'));var BPromise=require('bluebird');var rp=require(_0x2917('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2917('0x3'));var config=require(_0x2917('0x4'));var attributes=require(_0x2917('0x5'));module[_0x2917('0x6')]=function(_0x2df3d0,_0x36b35d){return _0x2df3d0[_0x2917('0x7')](_0x2917('0x8'),attributes,{'tableName':_0x2917('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1265f,_0x6bce6b,_0x181d98){if(_0x1265f['changed'](_0x2917('0xa'))){_0x1265f['closedAt']=moment()[_0x2917('0xb')](_0x2917('0xc'));}_0x181d98(null,_0x1265f);}}});}; \ No newline at end of file +var _0xdec1=['format','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxInteraction.attributes','exports','define','changed','closed'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0xdec1,0x11f));var _0x1dec=function(_0x2b995c,_0x374d22){_0x2b995c=_0x2b995c-0x0;var _0x3a823a=_0xdec1[_0x2b995c];return _0x3a823a;};'use strict';var _=require(_0x1dec('0x0'));var util=require('util');var logger=require(_0x1dec('0x1'))(_0x1dec('0x2'));var moment=require(_0x1dec('0x3'));var BPromise=require(_0x1dec('0x4'));var rp=require(_0x1dec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dec('0x6'));var config=require('../../config/environment');var attributes=require(_0x1dec('0x7'));module[_0x1dec('0x8')]=function(_0x52c2cb,_0x14cb62){return _0x52c2cb[_0x1dec('0x9')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bb933,_0x44290c,_0x4b9384){if(_0x3bb933[_0x1dec('0xa')](_0x1dec('0xb'))){_0x3bb933['closedAt']=moment()[_0x1dec('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b9384(null,_0x3bb933);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index cbdedd4..0c2e8f0 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 _0x0def=['find','addTags','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','attributes','limit','stringify','catch','AddTagsToFaxInteraction'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0def,0x177));var _0xf0de=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x0def[_0x390733];return _0x33beb9;};'use strict';var _=require('lodash');var util=require(_0xf0de('0x0'));var moment=require(_0xf0de('0x1'));var BPromise=require(_0xf0de('0x2'));var rs=require(_0xf0de('0x3'));var fs=require('fs');var Redis=require(_0xf0de('0x4'));var db=require(_0xf0de('0x5'))['db'];var utils=require(_0xf0de('0x6'));var logger=require(_0xf0de('0x7'))(_0xf0de('0x8'));var config=require(_0xf0de('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf0de('0xa')]({'port':0x232a});config[_0xf0de('0xb')]=_[_0xf0de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf0de('0xd'))(new Redis(config[_0xf0de('0xb')]));require(_0xf0de('0xe'))['register'](socket);function respondWithRpcPromise(_0xc1d611,_0x5b8f07,_0x1d9f40){return new BPromise(function(_0x268ca2,_0x26f912){return client['request'](_0xc1d611,_0x1d9f40)[_0xf0de('0xf')](function(_0x5e342c){logger[_0xf0de('0x10')](_0xf0de('0x11'),_0x5b8f07,_0xf0de('0x12'));logger[_0xf0de('0x13')](_0xf0de('0x14'),_0x5b8f07,'request\x20sent',JSON['stringify'](_0x5e342c));if(_0x5e342c[_0xf0de('0x15')]){if(_0x5e342c[_0xf0de('0x15')][_0xf0de('0x16')]===0x1f4){logger['error'](_0xf0de('0x11'),_0x5b8f07,_0x5e342c['error'][_0xf0de('0x17')]);return _0x26f912(_0x5e342c['error'][_0xf0de('0x17')]);}logger[_0xf0de('0x15')](_0xf0de('0x11'),_0x5b8f07,_0x5e342c[_0xf0de('0x15')][_0xf0de('0x17')]);return _0x268ca2(_0x5e342c[_0xf0de('0x15')][_0xf0de('0x17')]);}else{logger[_0xf0de('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x5b8f07,'request\x20sent');_0x268ca2(_0x5e342c[_0xf0de('0x18')]['message']);}})['catch'](function(_0x43b939){logger[_0xf0de('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x5b8f07,_0x43b939);_0x26f912(_0x43b939);});});}exports[_0xf0de('0x19')]=function(_0x4c7d22){var _0x662aa2=this;return new Promise(function(_0x2a012a,_0x5d1377){return db[_0xf0de('0x1a')][_0xf0de('0x1b')](_0x4c7d22['body'],{'raw':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22[_0xf0de('0x1c')][_0xf0de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22[_0xf0de('0x1c')]['where']||null:null,'attributes':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22[_0xf0de('0x1c')][_0xf0de('0x1e')]||null:null,'limit':_0x4c7d22[_0xf0de('0x1c')]?_0x4c7d22['options'][_0xf0de('0x1f')]||null:null})[_0xf0de('0xf')](function(_0x42a039){logger[_0xf0de('0x10')](_0xf0de('0x19'),_0x4c7d22);logger[_0xf0de('0x13')]('UpdateFaxInteraction',_0x4c7d22,JSON[_0xf0de('0x20')](_0x42a039));_0x2a012a(_0x42a039);})[_0xf0de('0x21')](function(_0x21a14b){logger[_0xf0de('0x15')](_0xf0de('0x19'),_0x21a14b[_0xf0de('0x17')],_0x4c7d22);_0x5d1377(_0x662aa2[_0xf0de('0x15')](0x1f4,_0x21a14b['message']));});});};exports[_0xf0de('0x22')]=function(_0x37d588){return new Promise(function(_0x6bad91,_0x2719af){return db['FaxInteraction'][_0xf0de('0x23')]({'where':_0x37d588['options']?_0x37d588[_0xf0de('0x1c')]['where']||null:null})[_0xf0de('0xf')](function(_0x4fc5f8){if(_0x4fc5f8){return _0x4fc5f8[_0xf0de('0x24')](_0x37d588[_0xf0de('0x25')][_0xf0de('0x26')],_['omit'](_0x37d588[_0xf0de('0x25')],[_0xf0de('0x26'),'id'])||{});}})[_0xf0de('0x27')](function(_0x3cb5c8){logger[_0xf0de('0x10')](_0xf0de('0x28'),_0x37d588);logger[_0xf0de('0x13')](_0xf0de('0x28'),_0x37d588,JSON[_0xf0de('0x20')](_0x3cb5c8));_0x6bad91(_0x3cb5c8);})[_0xf0de('0x21')](function(_0x53394d){logger['error'](_0xf0de('0x28'),_0x53394d['message'],_0x37d588);_0x2719af(_this[_0xf0de('0x15')](0x1f4,_0x53394d[_0xf0de('0x17')]));});});}; \ No newline at end of file +var _0x7a9c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','then','debug','AddTagsToFaxInteraction','addTags','ids','info','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dcbb5,_0xcfc072){var _0x12b83e=function(_0x47f812){while(--_0x47f812){_0x3dcbb5['push'](_0x3dcbb5['shift']());}};_0x12b83e(++_0xcfc072);}(_0x7a9c,0x11f));var _0xc7a9=function(_0x9be28f,_0x231334){_0x9be28f=_0x9be28f-0x0;var _0xa9f52d=_0x7a9c[_0x9be28f];return _0xa9f52d;};'use strict';var _=require(_0xc7a9('0x0'));var util=require(_0xc7a9('0x1'));var moment=require(_0xc7a9('0x2'));var BPromise=require(_0xc7a9('0x3'));var rs=require(_0xc7a9('0x4'));var fs=require('fs');var Redis=require(_0xc7a9('0x5'));var db=require(_0xc7a9('0x6'))['db'];var utils=require(_0xc7a9('0x7'));var logger=require(_0xc7a9('0x8'))(_0xc7a9('0x9'));var config=require(_0xc7a9('0xa'));var jayson=require(_0xc7a9('0xb'));var client=jayson['client'][_0xc7a9('0xc')]({'port':0x232a});config['redis']=_[_0xc7a9('0xd')](config[_0xc7a9('0xe')],{'host':_0xc7a9('0xf'),'port':0x18eb});var socket=require(_0xc7a9('0x10'))(new Redis(config[_0xc7a9('0xe')]));require(_0xc7a9('0x11'))[_0xc7a9('0x12')](socket);function respondWithRpcPromise(_0x2f063e,_0xed3be,_0x5dcce1){return new BPromise(function(_0x7f3ced,_0x4410f5){return client[_0xc7a9('0x13')](_0x2f063e,_0x5dcce1)['then'](function(_0x124169){logger['info'](_0xc7a9('0x14'),_0xed3be,_0xc7a9('0x15'));logger['debug'](_0xc7a9('0x16'),_0xed3be,_0xc7a9('0x15'),JSON[_0xc7a9('0x17')](_0x124169));if(_0x124169['error']){if(_0x124169[_0xc7a9('0x18')][_0xc7a9('0x19')]===0x1f4){logger[_0xc7a9('0x18')]('FaxInteraction,\x20%s,\x20%s',_0xed3be,_0x124169[_0xc7a9('0x18')][_0xc7a9('0x1a')]);return _0x4410f5(_0x124169[_0xc7a9('0x18')][_0xc7a9('0x1a')]);}logger[_0xc7a9('0x18')](_0xc7a9('0x14'),_0xed3be,_0x124169[_0xc7a9('0x18')][_0xc7a9('0x1a')]);return _0x7f3ced(_0x124169[_0xc7a9('0x18')][_0xc7a9('0x1a')]);}else{logger['info'](_0xc7a9('0x14'),_0xed3be,'request\x20sent');_0x7f3ced(_0x124169[_0xc7a9('0x1b')][_0xc7a9('0x1a')]);}})[_0xc7a9('0x1c')](function(_0x3cd3e8){logger['error'](_0xc7a9('0x14'),_0xed3be,_0x3cd3e8);_0x4410f5(_0x3cd3e8);});});}exports[_0xc7a9('0x1d')]=function(_0x1edf88){var _0x2370dc=this;return new Promise(function(_0x1c5903,_0x3bdce1){return db[_0xc7a9('0x1e')][_0xc7a9('0x1f')](_0x1edf88[_0xc7a9('0x20')],{'raw':_0x1edf88[_0xc7a9('0x21')]?_0x1edf88['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1edf88[_0xc7a9('0x21')]?_0x1edf88['options'][_0xc7a9('0x22')]||null:null,'attributes':_0x1edf88[_0xc7a9('0x21')]?_0x1edf88[_0xc7a9('0x21')]['attributes']||null:null,'limit':_0x1edf88[_0xc7a9('0x21')]?_0x1edf88[_0xc7a9('0x21')]['limit']||null:null})[_0xc7a9('0x23')](function(_0x36dc50){logger['info'](_0xc7a9('0x1d'),_0x1edf88);logger[_0xc7a9('0x24')](_0xc7a9('0x1d'),_0x1edf88,JSON['stringify'](_0x36dc50));_0x1c5903(_0x36dc50);})['catch'](function(_0x53acdf){logger[_0xc7a9('0x18')](_0xc7a9('0x1d'),_0x53acdf['message'],_0x1edf88);_0x3bdce1(_0x2370dc[_0xc7a9('0x18')](0x1f4,_0x53acdf[_0xc7a9('0x1a')]));});});};exports[_0xc7a9('0x25')]=function(_0x35b9b4){return new Promise(function(_0x3bf9f1,_0x445f4f){return db[_0xc7a9('0x1e')]['find']({'where':_0x35b9b4[_0xc7a9('0x21')]?_0x35b9b4['options'][_0xc7a9('0x22')]||null:null})[_0xc7a9('0x23')](function(_0x594e65){if(_0x594e65){return _0x594e65[_0xc7a9('0x26')](_0x35b9b4[_0xc7a9('0x20')][_0xc7a9('0x27')],_['omit'](_0x35b9b4[_0xc7a9('0x20')],[_0xc7a9('0x27'),'id'])||{});}})['spread'](function(_0x3629f){logger[_0xc7a9('0x28')](_0xc7a9('0x29'),_0x35b9b4);logger['debug'](_0xc7a9('0x29'),_0x35b9b4,JSON[_0xc7a9('0x17')](_0x3629f));_0x3bf9f1(_0x3629f);})[_0xc7a9('0x1c')](function(_0x380e17){logger[_0xc7a9('0x18')](_0xc7a9('0x29'),_0x380e17['message'],_0x35b9b4);_0x445f4f(_this['error'](0x1f4,_0x380e17['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index baedf52..4cf31eb 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 _0xf08a=['remove','update','emit','removeListener','register','length','./faxInteraction.events','save'];(function(_0x4fc975,_0xbf1959){var _0x1510da=function(_0x5b8d7c){while(--_0x5b8d7c){_0x4fc975['push'](_0x4fc975['shift']());}};_0x1510da(++_0xbf1959);}(_0xf08a,0x106));var _0xaf08=function(_0x5d7770,_0x581d65){_0x5d7770=_0x5d7770-0x0;var _0x4ba61c=_0xf08a[_0x5d7770];return _0x4ba61c;};'use strict';var FaxInteractionEvents=require(_0xaf08('0x0'));var events=[_0xaf08('0x1'),_0xaf08('0x2'),_0xaf08('0x3')];function createListener(_0x10cb2c,_0x47ec99){return function(_0x2242f5){_0x47ec99[_0xaf08('0x4')](_0x10cb2c,_0x2242f5);};}function removeListener(_0x304367,_0x4ddee8){return function(){FaxInteractionEvents[_0xaf08('0x5')](_0x304367,_0x4ddee8);};}exports[_0xaf08('0x6')]=function(_0x20757e){for(var _0x32a64d=0x0,_0x1c9bfa=events[_0xaf08('0x7')];_0x32a64d<_0x1c9bfa;_0x32a64d++){var _0x22a0c2=events[_0x32a64d];var _0x16dc83=createListener('faxInteraction:'+_0x22a0c2,_0x20757e);FaxInteractionEvents['on'](_0x22a0c2,_0x16dc83);}}; \ No newline at end of file +var _0xfdb6=['update','emit','removeListener','register','length','faxInteraction:','save','remove'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0xfdb6,0x8e));var _0x6fdb=function(_0x4baa36,_0x538899){_0x4baa36=_0x4baa36-0x0;var _0x45e0ed=_0xfdb6[_0x4baa36];return _0x45e0ed;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x6fdb('0x0'),_0x6fdb('0x1'),_0x6fdb('0x2')];function createListener(_0x129c8c,_0x2c18ef){return function(_0x2ca02e){_0x2c18ef[_0x6fdb('0x3')](_0x129c8c,_0x2ca02e);};}function removeListener(_0x2d48f6,_0x469fee){return function(){FaxInteractionEvents[_0x6fdb('0x4')](_0x2d48f6,_0x469fee);};}exports[_0x6fdb('0x5')]=function(_0x2b9a33){for(var _0x302916=0x0,_0x147333=events[_0x6fdb('0x6')];_0x302916<_0x147333;_0x302916++){var _0x1b6066=events[_0x302916];var _0x27d07d=createListener(_0x6fdb('0x7')+_0x1b6066,_0x2b9a33);FaxInteractionEvents['on'](_0x1b6066,_0x27d07d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 8c37028..136cebd 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 _0xc3f0=['show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','fax','faxinteraction:addtags','put','faxinteraction:update','delete','tracked','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc3f0,0xac));var _0x0c3f=function(_0x5a34bf,_0x26ec3a){_0x5a34bf=_0x5a34bf-0x0;var _0x213944=_0xc3f0[_0x5a34bf];return _0x213944;};'use strict';var multer=require(_0x0c3f('0x0'));var util=require(_0x0c3f('0x1'));var path=require(_0x0c3f('0x2'));var timeout=require(_0x0c3f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c3f('0x4'));var auth=require(_0x0c3f('0x5'));var interaction=require(_0x0c3f('0x6'));var config=require('../../config/environment');var controller=require(_0x0c3f('0x7'));router[_0x0c3f('0x8')]('/',auth[_0x0c3f('0x9')](),controller[_0x0c3f('0xa')]);router['get'](_0x0c3f('0xb'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0xc')]);router['get'](_0x0c3f('0xd'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0xe')]);router[_0x0c3f('0x8')]('/:id/messages',auth[_0x0c3f('0x9')](),controller['getMessages']);router[_0x0c3f('0x8')](_0x0c3f('0xf'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0x10')]);router[_0x0c3f('0x11')]('/',auth[_0x0c3f('0x9')](),controller[_0x0c3f('0x12')]);router[_0x0c3f('0x11')](_0x0c3f('0x13'),auth[_0x0c3f('0x9')](),controller[_0x0c3f('0x14')]);router[_0x0c3f('0x11')](_0x0c3f('0x15'),auth[_0x0c3f('0x9')](),interaction['tracked'](_0x0c3f('0x16'),_0x0c3f('0x17')),controller['addTags']);router[_0x0c3f('0x18')](_0x0c3f('0xd'),auth[_0x0c3f('0x9')](),interaction['tracked']('fax',_0x0c3f('0x19')),controller['update']);router[_0x0c3f('0x1a')](_0x0c3f('0xd'),auth[_0x0c3f('0x9')](),interaction[_0x0c3f('0x1b')](_0x0c3f('0x16'),_0x0c3f('0x1c')),controller['destroy']);router[_0x0c3f('0x1a')](_0x0c3f('0x15'),auth['isAuthenticated'](),controller[_0x0c3f('0x1d')]);module[_0x0c3f('0x1e')]=router; \ No newline at end of file +var _0xa7da=['faxinteraction:addtags','put','fax','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','tracked'];(function(_0x54a8ce,_0x58d6fa){var _0x1b26e3=function(_0x5e9b66){while(--_0x5e9b66){_0x54a8ce['push'](_0x54a8ce['shift']());}};_0x1b26e3(++_0x58d6fa);}(_0xa7da,0x17d));var _0xaa7d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa7da[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xaa7d('0x0'));var util=require(_0xaa7d('0x1'));var path=require(_0xaa7d('0x2'));var timeout=require(_0xaa7d('0x3'));var express=require(_0xaa7d('0x4'));var router=express[_0xaa7d('0x5')]();var fs_extra=require(_0xaa7d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaa7d('0x7'));var config=require(_0xaa7d('0x8'));var controller=require(_0xaa7d('0x9'));router['get']('/',auth[_0xaa7d('0xa')](),controller['index']);router[_0xaa7d('0xb')]('/describe',auth[_0xaa7d('0xa')](),controller[_0xaa7d('0xc')]);router[_0xaa7d('0xb')](_0xaa7d('0xd'),auth[_0xaa7d('0xa')](),controller[_0xaa7d('0xe')]);router[_0xaa7d('0xb')]('/:id/messages',auth[_0xaa7d('0xa')](),controller[_0xaa7d('0xf')]);router[_0xaa7d('0xb')](_0xaa7d('0x10'),auth['isAuthenticated'](),controller[_0xaa7d('0x11')]);router[_0xaa7d('0x12')]('/',auth[_0xaa7d('0xa')](),controller[_0xaa7d('0x13')]);router[_0xaa7d('0x12')](_0xaa7d('0x14'),auth[_0xaa7d('0xa')](),controller['addMessage']);router[_0xaa7d('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xaa7d('0x15')]('fax',_0xaa7d('0x16')),controller['addTags']);router[_0xaa7d('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xaa7d('0x15')](_0xaa7d('0x18'),_0xaa7d('0x19')),controller[_0xaa7d('0x1a')]);router[_0xaa7d('0x1b')](_0xaa7d('0xd'),auth['isAuthenticated'](),interaction[_0xaa7d('0x15')]('fax','faxinteraction:destroy'),controller[_0xaa7d('0x1c')]);router[_0xaa7d('0x1b')]('/:id/tags',auth[_0xaa7d('0xa')](),controller[_0xaa7d('0x1d')]);module[_0xaa7d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ab31039..454739f 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 _0x3248=['exports','BOOLEAN','ENUM','out','TEXT','DATE'];(function(_0x1292e9,_0x2a7113){var _0x119cb7=function(_0xa320a0){while(--_0xa320a0){_0x1292e9['push'](_0x1292e9['shift']());}};_0x119cb7(++_0x2a7113);}(_0x3248,0x1bc));var _0x8324=function(_0x397845,_0x5568da){_0x397845=_0x397845-0x0;var _0x2f1b6a=_0x3248[_0x397845];return _0x2f1b6a;};'use strict';var Sequelize=require('sequelize');module[_0x8324('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8324('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8324('0x2')]('in',_0x8324('0x3')),'defaultValue':_0x8324('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8324('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8324('0x5')]}}; \ No newline at end of file +var _0x0f69=['BOOLEAN','ENUM','out','TEXT'];(function(_0x2042e3,_0x364a0b){var _0x424067=function(_0x1554a4){while(--_0x1554a4){_0x2042e3['push'](_0x2042e3['shift']());}};_0x424067(++_0x364a0b);}(_0x0f69,0x173));var _0x90f6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x0f69[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x90f6('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x90f6('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x90f6('0x2')]('in','out'),'defaultValue':_0x90f6('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x90f6('0x0')],'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 943edca..006cf00 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 _0xd19e=['filter','VIRTUAL','merge','includeAll','findAll','show','params','include','update','body','find','describe','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','FaxInteractionId','isNil','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','internal','format','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','attachments','Attachment','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','end','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0xd19e,0x1f3));var _0xed19=function(_0x44de79,_0x2a6fcc){_0x44de79=_0x44de79-0x0;var _0x2ce323=_0xd19e[_0x44de79];return _0x2ce323;};'use strict';var emlformat=require(_0xed19('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xed19('0x1'));var rp=require(_0xed19('0x2'));var moment=require(_0xed19('0x3'));var BPromise=require(_0xed19('0x4'));var Mustache=require(_0xed19('0x5'));var util=require(_0xed19('0x6'));var path=require(_0xed19('0x7'));var sox=require(_0xed19('0x8'));var csv=require('to-csv');var ejs=require(_0xed19('0x9'));var fs=require('fs');var fs_extra=require(_0xed19('0xa'));var _=require('lodash');var squel=require(_0xed19('0xb'));var crypto=require(_0xed19('0xc'));var jsforce=require(_0xed19('0xd'));var deskjs=require(_0xed19('0xe'));var toCsv=require('to-csv');var querystring=require(_0xed19('0xf'));var Papa=require(_0xed19('0x10'));var Redis=require('ioredis');var authService=require(_0xed19('0x11'));var qs=require(_0xed19('0x12'));var as=require(_0xed19('0x13'));var hardwareService=require(_0xed19('0x14'));var logger=require(_0xed19('0x15'))(_0xed19('0x16'));var utils=require(_0xed19('0x17'));var config=require(_0xed19('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xed19('0x19'))['db'];config[_0xed19('0x1a')]=_[_0xed19('0x1b')](config[_0xed19('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xed19('0x1c'))(new Redis(config[_0xed19('0x1a')]));require(_0xed19('0x1d'))[_0xed19('0x1e')](socket);var jayson=require(_0xed19('0x1f'));var client=jayson[_0xed19('0x20')][_0xed19('0x21')]({'port':0x232c});var client9002=jayson[_0xed19('0x20')][_0xed19('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xe8fb3a,_0x1fe3b5,_0x7f17e5,_0x100f32){return new BPromise(function(_0x36f546,_0x1489fa){var _0x17f90f=_0x100f32||client;return _0x17f90f['request'](_0xe8fb3a,_0x7f17e5)[_0xed19('0x22')](function(_0x5770f2){logger[_0xed19('0x23')](_0xed19('0x24'),_0x1fe3b5,_0xed19('0x25'));logger['debug'](_0xed19('0x26'),_0x1fe3b5,_0xed19('0x25'),JSON[_0xed19('0x27')](_0x5770f2));if(_0x5770f2[_0xed19('0x28')]){if(_0x5770f2[_0xed19('0x28')][_0xed19('0x29')]===0x1f4){logger[_0xed19('0x28')](_0xed19('0x24'),_0x1fe3b5,_0x5770f2[_0xed19('0x28')][_0xed19('0x2a')]);return _0x1489fa(_0x5770f2[_0xed19('0x28')][_0xed19('0x2a')]);}logger[_0xed19('0x28')]('FaxMessage,\x20%s,\x20%s',_0x1fe3b5,_0x5770f2['error']['message']);return _0x36f546(_0x5770f2[_0xed19('0x28')][_0xed19('0x2a')]);}else{logger[_0xed19('0x23')]('FaxMessage,\x20%s,\x20%s',_0x1fe3b5,'request\x20sent');_0x36f546(_0x5770f2[_0xed19('0x2b')][_0xed19('0x2a')]);}})[_0xed19('0x2c')](function(_0xa52fff){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1fe3b5,_0xa52fff);_0x1489fa(_0xa52fff);});});}function respondWithStatusCode(_0x96ce0,_0x1caf1c){_0x1caf1c=_0x1caf1c||0xcc;return function(_0x371608){if(_0x371608){return _0x96ce0[_0xed19('0x2d')](_0x1caf1c);}return _0x96ce0[_0xed19('0x2e')](_0x1caf1c)['end']();};}function respondWithResult(_0x650914,_0x37fc4e){_0x37fc4e=_0x37fc4e||0xc8;return function(_0x29f789){if(_0x29f789){return _0x650914[_0xed19('0x2e')](_0x37fc4e)['json'](_0x29f789);}};}function respondWithFilteredResult(_0x170e67,_0x2192f1){return function(_0x4ed0e2){if(_0x4ed0e2){var _0x571eec=typeof _0x2192f1['offset']===_0xed19('0x2f')&&typeof _0x2192f1[_0xed19('0x30')]===_0xed19('0x2f');var _0x132b49=_0x4ed0e2[_0xed19('0x31')];var _0x17b43b=_0x571eec?0x0:_0x2192f1[_0xed19('0x32')];var _0x3690e6=_0x571eec?_0x4ed0e2[_0xed19('0x31')]:_0x2192f1[_0xed19('0x32')]+_0x2192f1[_0xed19('0x30')];var _0x1fbcab;if(_0x3690e6>=_0x132b49){_0x3690e6=_0x132b49;_0x1fbcab=0xc8;}else{_0x1fbcab=0xce;}_0x170e67[_0xed19('0x2e')](_0x1fbcab);return _0x170e67[_0xed19('0x33')](_0xed19('0x34'),_0x17b43b+'-'+_0x3690e6+'/'+_0x132b49)[_0xed19('0x35')](_0x4ed0e2);}return null;};}function patchUpdates(_0x5c63f4){return function(_0x22afa0){try{jsonpatch[_0xed19('0x36')](_0x22afa0,_0x5c63f4,!![]);}catch(_0x2f5f1f){return BPromise[_0xed19('0x37')](_0x2f5f1f);}return _0x22afa0[_0xed19('0x38')]();};}function saveUpdates(_0x1a6dd2,_0x48c26c){return function(_0x46fddd){if(_0x46fddd){return _0x46fddd['update'](_0x1a6dd2)[_0xed19('0x22')](function(_0x3c0cf1){return _0x3c0cf1;});}return null;};}function removeEntity(_0x1f588f,_0x2b443c){return function(_0x1d498a){if(_0x1d498a){return _0x1d498a['destroy']()[_0xed19('0x22')](function(){_0x1f588f[_0xed19('0x2e')](0xcc)[_0xed19('0x39')]();});}};}function handleEntityNotFound(_0x470267,_0x3ad0f1){return function(_0x487b4e){if(!_0x487b4e){_0x470267[_0xed19('0x2d')](0x194);}return _0x487b4e;};}function handleError(_0x2fb68c,_0x15a70a){_0x15a70a=_0x15a70a||0x1f4;return function(_0x1bcbde){logger[_0xed19('0x28')](_0x1bcbde[_0xed19('0x3a')]);if(_0x1bcbde['name']){delete _0x1bcbde['name'];}_0x2fb68c[_0xed19('0x2e')](_0x15a70a)[_0xed19('0x3b')](_0x1bcbde);};}exports[_0xed19('0x3c')]=function(_0x19c8b5,_0x16fca0){var _0x5ce4db={},_0x4fbe3a={},_0x56b475={'count':0x0,'rows':[]};var _0x1d5f44=_[_0xed19('0x3d')](db[_0xed19('0x3e')][_0xed19('0x3f')],function(_0x308697){return{'name':_0x308697[_0xed19('0x40')],'type':_0x308697[_0xed19('0x41')][_0xed19('0x42')]};});_0x4fbe3a['model']=_[_0xed19('0x3d')](_0x1d5f44,_0xed19('0x43'));_0x4fbe3a[_0xed19('0x44')]=_[_0xed19('0x45')](_0x19c8b5[_0xed19('0x44')]);_0x4fbe3a[_0xed19('0x46')]=_[_0xed19('0x47')](_0x4fbe3a[_0xed19('0x48')],_0x4fbe3a[_0xed19('0x44')]);_0x5ce4db[_0xed19('0x49')]=_[_0xed19('0x47')](_0x4fbe3a[_0xed19('0x48')],qs[_0xed19('0x4a')](_0x19c8b5[_0xed19('0x44')][_0xed19('0x4a')]));_0x5ce4db[_0xed19('0x49')]=_0x5ce4db[_0xed19('0x49')][_0xed19('0x4b')]?_0x5ce4db['attributes']:_0x4fbe3a[_0xed19('0x48')];if(!_0x19c8b5['query'][_0xed19('0x4c')](_0xed19('0x4d'))){_0x5ce4db['limit']=qs[_0xed19('0x30')](_0x19c8b5['query'][_0xed19('0x30')]);_0x5ce4db[_0xed19('0x32')]=qs[_0xed19('0x32')](_0x19c8b5['query'][_0xed19('0x32')]);}_0x5ce4db['order']=qs[_0xed19('0x4e')](_0x19c8b5[_0xed19('0x44')][_0xed19('0x4e')]);_0x5ce4db[_0xed19('0x4f')]=qs['filters'](_[_0xed19('0x50')](_0x19c8b5[_0xed19('0x44')],_0x4fbe3a[_0xed19('0x46')]),_0x1d5f44);if(_0x19c8b5[_0xed19('0x44')][_0xed19('0x51')]){_0x5ce4db[_0xed19('0x4f')]=_['merge'](_0x5ce4db[_0xed19('0x4f')],{'$or':_[_0xed19('0x3d')](_0x1d5f44,function(_0x392394){if(_0x392394[_0xed19('0x41')]!==_0xed19('0x52')){var _0x13322f={};_0x13322f[_0x392394[_0xed19('0x43')]]={'$like':'%'+_0x19c8b5['query']['filter']+'%'};return _0x13322f;}})});}_0x5ce4db=_[_0xed19('0x53')]({},_0x5ce4db,_0x19c8b5['options']);var _0xe9ff1c={'where':_0x5ce4db[_0xed19('0x4f')]};return db[_0xed19('0x3e')][_0xed19('0x31')](_0xe9ff1c)['then'](function(_0x33bb6e){_0x56b475[_0xed19('0x31')]=_0x33bb6e;if(_0x19c8b5[_0xed19('0x44')][_0xed19('0x54')]){_0x5ce4db['include']=[{'all':!![]}];}return db[_0xed19('0x3e')][_0xed19('0x55')](_0x5ce4db);})[_0xed19('0x22')](function(_0x55525a){_0x56b475['rows']=_0x55525a;return _0x56b475;})[_0xed19('0x22')](respondWithFilteredResult(_0x16fca0,_0x5ce4db))[_0xed19('0x2c')](handleError(_0x16fca0,null));};exports[_0xed19('0x56')]=function(_0x4bc590,_0x46b1fa){var _0x563a79={'raw':!![],'where':{'id':_0x4bc590[_0xed19('0x57')]['id']}},_0x25d142={};_0x25d142[_0xed19('0x48')]=_[_0xed19('0x45')](db['FaxMessage'][_0xed19('0x3f')]);_0x25d142[_0xed19('0x44')]=_['keys'](_0x4bc590[_0xed19('0x44')]);_0x25d142[_0xed19('0x46')]=_[_0xed19('0x47')](_0x25d142[_0xed19('0x48')],_0x25d142['query']);_0x563a79[_0xed19('0x49')]=_['intersection'](_0x25d142[_0xed19('0x48')],qs[_0xed19('0x4a')](_0x4bc590[_0xed19('0x44')][_0xed19('0x4a')]));_0x563a79[_0xed19('0x49')]=_0x563a79['attributes']['length']?_0x563a79[_0xed19('0x49')]:_0x25d142['model'];if(_0x4bc590['query']['includeAll']){_0x563a79[_0xed19('0x58')]=[{'all':!![]}];}_0x563a79=_[_0xed19('0x53')]({},_0x563a79,_0x4bc590['options']);return db[_0xed19('0x3e')]['find'](_0x563a79)[_0xed19('0x22')](handleEntityNotFound(_0x46b1fa,null))[_0xed19('0x22')](respondWithResult(_0x46b1fa,null))['catch'](handleError(_0x46b1fa,null));};exports[_0xed19('0x59')]=function(_0x2b7922,_0x40d792){if(_0x2b7922[_0xed19('0x5a')]['id']){delete _0x2b7922[_0xed19('0x5a')]['id'];}return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x2b7922[_0xed19('0x57')]['id']}})[_0xed19('0x22')](handleEntityNotFound(_0x40d792,null))['then'](saveUpdates(_0x2b7922[_0xed19('0x5a')],null))[_0xed19('0x22')](respondWithResult(_0x40d792,null))['catch'](handleError(_0x40d792,null));};exports['destroy']=function(_0x58041e,_0x2d0c40){return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x58041e['params']['id']}})[_0xed19('0x22')](handleEntityNotFound(_0x2d0c40,null))[_0xed19('0x22')](removeEntity(_0x2d0c40,null))[_0xed19('0x2c')](handleError(_0x2d0c40,null));};exports[_0xed19('0x5c')]=function(_0x171e5a,_0x35993f){return db[_0xed19('0x3e')]['describe']()[_0xed19('0x22')](respondWithResult(_0x35993f,null))[_0xed19('0x2c')](handleError(_0x35993f,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x3e64ee,_0xe3a03,_0x2d0d47){var _0x3fb53d={'agent':{},'channel':_0xed19('0x5d')};if(_0x3e64ee[_0xed19('0x5a')]['id']){delete _0x3e64ee['body']['id'];}_0x3e64ee[_0xed19('0x5a')][_0xed19('0x5e')]=!![];_0x3e64ee['body'][_0xed19('0x5f')]=moment()['format'](_0xed19('0x60'));_0x3e64ee['body'][_0xed19('0x61')]=_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')]||_0x3e64ee['user']['id'];_0x3fb53d[_0xed19('0x62')]['id']=_0x3e64ee['body'][_0xed19('0x61')];return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x3e64ee[_0xed19('0x57')]['id'],'UserId':null}})[_0xed19('0x22')](handleEntityNotFound(_0xe3a03,null))['then'](saveUpdates(_0x3e64ee['body'],null))['then'](function(_0x53e438){if(_0x53e438){_0x3fb53d[_0xed19('0x2a')]=_0x53e438['get']({'plain':!![]});return db[_0xed19('0x63')]['find']({'where':{'id':_0x53e438[_0xed19('0x64')]}});}return null;})[_0xed19('0x22')](handleEntityNotFound(_0xe3a03,null))['then'](function(_0x47a35a){if(_0x47a35a){return _0x47a35a[_0xed19('0x59')]({'UserId':_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')],'read1stAt':_[_0xed19('0x65')](_0x47a35a['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xed19('0x22')](function(_0x9a1b0){if(_0x9a1b0){_0x3fb53d[_0xed19('0x66')]=_0x9a1b0[_0xed19('0x67')]({'plain':!![]});interaction_log['info'](_0xed19('0x68'),_0x3e64ee[_0xed19('0x69')]['id'],_0x3e64ee[_0xed19('0x69')][_0xed19('0x43')],_0x3e64ee['user'][_0xed19('0x6a')],_0x3fb53d[_0xed19('0x66')]['id'],_0x3e64ee[_0xed19('0x5a')]?JSON[_0xed19('0x27')](_0x3e64ee['body']):_0xed19('0x6b'));return respondWithRpcPromise(_0xed19('0x6c'),_0xed19('0x6d'),_0x3fb53d);}return null;})[_0xed19('0x22')](function(_0x2a2c06){var _0x100247='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a2c06[_0xed19('0x2a')][_0xed19('0x6e')];return db[_0xed19('0x6f')][_0xed19('0x44')](_0x100247,{'type':db[_0xed19('0x70')]['QueryTypes'][_0xed19('0x71')],'raw':!![]})[_0xed19('0x22')](function(_0x21a891){return _0x21a891;});})[_0xed19('0x22')](function(_0x1d7a81){if(_0x1d7a81){_0x3fb53d[_0xed19('0x2a')][_0xed19('0x72')]=_0x1d7a81[0x0];if(!_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')])return;return db[_0xed19('0x73')][_0xed19('0x5b')]({'where':{'id':_0x3e64ee[_0xed19('0x5a')][_0xed19('0x61')],'role':_0xed19('0x62')},'attributes':['id','name','fullname',_0xed19('0x74'),'internal'],'raw':!![]});}return null;})[_0xed19('0x22')](function(_0x38d860){if(!_0x38d860)return null;_0x3fb53d[_0xed19('0x2a')]['agent']=_0x38d860;return _0x3fb53d;})['then'](function(_0x12400e){if(_0x12400e){if(_0x3e64ee['body'][_0xed19('0x75')]){_0x3fb53d[_0xed19('0x2a')][_0xed19('0x76')]=util['format'](_0xed19('0x77'),_0x3e64ee[_0xed19('0x69')][_0xed19('0x43')]);_0x3fb53d[_0xed19('0x2a')][_0xed19('0x78')]=_0x3fb53d[_0xed19('0x78')];_0x3fb53d[_0xed19('0x2a')][_0xed19('0x79')]=_0x3fb53d[_0xed19('0x78')];_0x3fb53d[_0xed19('0x2a')][_0xed19('0x7a')]=_0xed19('0x7b');return respondWithRpcPromise(_0xed19('0x7c'),_0xed19('0x7c'),{'event':_0xed19('0x7d'),'message':_0x3fb53d[_0xed19('0x2a')]},client9002)[_0xed19('0x22')](function(){return _0x3fb53d;});}return _0x3fb53d;}return null;})[_0xed19('0x22')](respondWithResult(_0xe3a03,null))[_0xed19('0x2c')](handleError(_0xe3a03,null));};var interaction_log=require(_0xed19('0x15'))(_0xed19('0x7e'));exports[_0xed19('0x37')]=function(_0x3c7d68,_0x30a433,_0x4b7a48){var _0x8c1ca0={'agent':{},'channel':_0xed19('0x5d')};if(_0x3c7d68[_0xed19('0x5a')]['id']){delete _0x3c7d68[_0xed19('0x5a')]['id'];}_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')]=_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')]||_0x3c7d68['user']['id'];_0x8c1ca0[_0xed19('0x62')]['id']=_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')];return db[_0xed19('0x3e')]['find']({'where':{'id':_0x3c7d68['params']['id'],'UserId':null}})[_0xed19('0x22')](handleEntityNotFound(_0x30a433,null))[_0xed19('0x22')](function(_0x195c2f){if(_0x195c2f){_0x8c1ca0[_0xed19('0x2a')]=_0x195c2f[_0xed19('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xed19('0x5b')]({'where':{'id':_0x195c2f[_0xed19('0x64')]}});}return null;})[_0xed19('0x22')](handleEntityNotFound(_0x30a433,null))[_0xed19('0x22')](function(_0x45cb3c){if(_0x45cb3c){_0x8c1ca0[_0xed19('0x66')]=_0x45cb3c[_0xed19('0x67')]({'plain':!![]});interaction_log['info'](_0xed19('0x7f'),_0x3c7d68['user']['id'],_0x3c7d68[_0xed19('0x69')][_0xed19('0x43')],_0x3c7d68[_0xed19('0x69')][_0xed19('0x6a')],_0x8c1ca0[_0xed19('0x66')]['id'],_0x3c7d68['body']?JSON[_0xed19('0x27')](_0x3c7d68[_0xed19('0x5a')]):_0xed19('0x6b'));return respondWithRpcPromise(_0xed19('0x80'),'rejectMessage',_0x8c1ca0);}return null;})[_0xed19('0x22')](function(_0x2159d9){var _0x9752a6=_0xed19('0x81')+_0x2159d9[_0xed19('0x2a')]['ContactId'];return db[_0xed19('0x6f')][_0xed19('0x44')](_0x9752a6,{'type':db[_0xed19('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x184e12){return _0x184e12;});})[_0xed19('0x22')](function(_0x4cf97a){if(_0x4cf97a){_0x8c1ca0['message'][_0xed19('0x72')]=_0x4cf97a[0x0];if(!_0x3c7d68[_0xed19('0x5a')]['UserId'])return;return db['User']['find']({'where':{'id':_0x3c7d68[_0xed19('0x5a')][_0xed19('0x61')],'role':_0xed19('0x62')},'attributes':['id','name',_0xed19('0x82'),_0xed19('0x74'),_0xed19('0x83')],'raw':!![]});}return null;})[_0xed19('0x22')](function(_0x2b76c4){if(!_0x2b76c4)return null;_0x8c1ca0[_0xed19('0x2a')][_0xed19('0x62')]=_0x2b76c4;return _0x8c1ca0;})[_0xed19('0x22')](function(_0x202669){if(_0x202669){_0x202669[_0xed19('0x2a')][_0xed19('0x76')]=util[_0xed19('0x84')](_0xed19('0x77'),_0x3c7d68[_0xed19('0x69')][_0xed19('0x43')]);_0x202669[_0xed19('0x2a')]['channel']=_0x8c1ca0['channel'];_0x202669['message'][_0xed19('0x79')]=_0x8c1ca0[_0xed19('0x78')];_0x202669[_0xed19('0x2a')][_0xed19('0x7a')]=_0xed19('0x37');respondWithRpcPromise(_0xed19('0x7c'),_0xed19('0x7c'),{'event':'rejectmessage','message':_0x202669[_0xed19('0x2a')]},client9002);return _0x8c1ca0;}return null;})['then'](respondWithResult(_0x30a433,null))[_0xed19('0x2c')](handleError(_0x30a433,null));};exports[_0xed19('0x85')]=function(_0x3e6dd0,_0x12b177){var _0x2cd41f;return db['FaxMessage']['create'](_0x3e6dd0[_0xed19('0x5a')],{})[_0xed19('0x22')](function(_0x23a9da){_0x2cd41f=_0x23a9da;return db[_0xed19('0x86')][_0xed19('0x87')]({'where':{'id':_0x2cd41f[_0xed19('0x6e')]}});})[_0xed19('0x22')](function(_0x5bc692){if(_[_0xed19('0x65')](_0x5bc692)){return;}else{_0x2cd41f[_0xed19('0x5d')]=_0x5bc692[_0xed19('0x5d')];return db['Attachment'][_0xed19('0x87')]({'where':{'id':_0x2cd41f[_0xed19('0x88')]}});}})[_0xed19('0x22')](function(_0x3f144a){return respondWithRpcPromise(_0xed19('0x89'),_0xed19('0x89'),{'FaxAccountId':_[_0xed19('0x65')](_0x3e6dd0[_0xed19('0x5a')])?undefined:_0x3e6dd0[_0xed19('0x5a')][_0xed19('0x8a')],'path':_[_0xed19('0x65')](_0x3f144a)?undefined:util[_0xed19('0x84')]('/var/opt/motion2/server/files/attachments/%s',_0x3f144a[_0xed19('0x8b')]),'fax':_['isNil'](_0x2cd41f[_0xed19('0x5d')])?undefined:_0x2cd41f[_0xed19('0x5d')],'AttachmentId':_0x2cd41f[_0xed19('0x88')]},client9002);})[_0xed19('0x22')](respondWithResult(_0x12b177,0xc9))[_0xed19('0x2c')](handleError(_0x12b177,null));};exports[_0xed19('0x8c')]=function(_0x40540b,_0x4d5756){var _0x4442b9=path[_0xed19('0x8d')](config['root'],_0xed19('0x8e'),'files',_0xed19('0x8f'));return db[_0xed19('0x3e')][_0xed19('0x5b')]({'where':{'id':_0x40540b[_0xed19('0x57')]['id']},'include':[{'model':db[_0xed19('0x90')],'as':_0xed19('0x90')}]})[_0xed19('0x22')](handleEntityNotFound(_0x4d5756,null))['then'](function(_0x30c6a0){if(_0x30c6a0){return _0x4d5756[_0xed19('0x8c')](path['join'](_0x4442b9,_0x30c6a0[_0xed19('0x90')][_0xed19('0x8b')]));}})[_0xed19('0x2c')](handleError(_0x4d5756,null));}; \ No newline at end of file +var _0x53fb=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','body','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','contact','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','basename','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','status','sendStatus','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','model','query'];(function(_0x5e3148,_0x25bbae){var _0x315308=function(_0x3c7984){while(--_0x3c7984){_0x5e3148['push'](_0x5e3148['shift']());}};_0x315308(++_0x25bbae);}(_0x53fb,0x1f1));var _0xb53f=function(_0x5f35e5,_0x2408e3){_0x5f35e5=_0x5f35e5-0x0;var _0x4cee6e=_0x53fb[_0x5f35e5];return _0x4cee6e;};'use strict';var emlformat=require(_0xb53f('0x0'));var rimraf=require(_0xb53f('0x1'));var zipdir=require(_0xb53f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb53f('0x3'));var moment=require(_0xb53f('0x4'));var BPromise=require(_0xb53f('0x5'));var Mustache=require('mustache');var util=require(_0xb53f('0x6'));var path=require(_0xb53f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb53f('0x8'));var fs=require('fs');var fs_extra=require(_0xb53f('0x9'));var _=require('lodash');var squel=require(_0xb53f('0xa'));var crypto=require(_0xb53f('0xb'));var jsforce=require(_0xb53f('0xc'));var deskjs=require(_0xb53f('0xd'));var toCsv=require(_0xb53f('0xe'));var querystring=require(_0xb53f('0xf'));var Papa=require(_0xb53f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb53f('0x11'));var as=require(_0xb53f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb53f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb53f('0x14'));var licenseUtil=require(_0xb53f('0x15'));var db=require(_0xb53f('0x16'))['db'];config[_0xb53f('0x17')]=_['defaults'](config[_0xb53f('0x17')],{'host':_0xb53f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb53f('0x19'))[_0xb53f('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb53f('0x1b')][_0xb53f('0x1c')]({'port':0x232c});var client9002=jayson[_0xb53f('0x1b')][_0xb53f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2057f2,_0x121c20,_0x584f28,_0x22daa7){return new BPromise(function(_0x3b64c8,_0x5829e1){var _0x22bdfb=_0x22daa7||client;return _0x22bdfb[_0xb53f('0x1d')](_0x2057f2,_0x584f28)[_0xb53f('0x1e')](function(_0x132f08){logger[_0xb53f('0x1f')](_0xb53f('0x20'),_0x121c20,_0xb53f('0x21'));logger['debug'](_0xb53f('0x22'),_0x121c20,_0xb53f('0x21'),JSON['stringify'](_0x132f08));if(_0x132f08[_0xb53f('0x23')]){if(_0x132f08[_0xb53f('0x23')][_0xb53f('0x24')]===0x1f4){logger[_0xb53f('0x23')](_0xb53f('0x20'),_0x121c20,_0x132f08[_0xb53f('0x23')][_0xb53f('0x25')]);return _0x5829e1(_0x132f08[_0xb53f('0x23')][_0xb53f('0x25')]);}logger['error'](_0xb53f('0x20'),_0x121c20,_0x132f08['error']['message']);return _0x3b64c8(_0x132f08[_0xb53f('0x23')][_0xb53f('0x25')]);}else{logger[_0xb53f('0x1f')](_0xb53f('0x20'),_0x121c20,'request\x20sent');_0x3b64c8(_0x132f08[_0xb53f('0x26')][_0xb53f('0x25')]);}})['catch'](function(_0xd7db1c){logger['error'](_0xb53f('0x20'),_0x121c20,_0xd7db1c);_0x5829e1(_0xd7db1c);});});}function respondWithStatusCode(_0x19437c,_0x5bb4cf){_0x5bb4cf=_0x5bb4cf||0xcc;return function(_0x5c354e){if(_0x5c354e){return _0x19437c['sendStatus'](_0x5bb4cf);}return _0x19437c['status'](_0x5bb4cf)[_0xb53f('0x27')]();};}function respondWithResult(_0x288440,_0x19ceca){_0x19ceca=_0x19ceca||0xc8;return function(_0x3fe25f){if(_0x3fe25f){return _0x288440['status'](_0x19ceca)[_0xb53f('0x28')](_0x3fe25f);}};}function respondWithFilteredResult(_0x49bda1,_0x3d3833){return function(_0x3a9e4f){if(_0x3a9e4f){var _0x2aff32=typeof _0x3d3833[_0xb53f('0x29')]==='undefined'&&typeof _0x3d3833[_0xb53f('0x2a')]===_0xb53f('0x2b');var _0x2f85f3=_0x3a9e4f[_0xb53f('0x2c')];var _0x2043e8=_0x2aff32?0x0:_0x3d3833[_0xb53f('0x29')];var _0x3af26e=_0x2aff32?_0x3a9e4f[_0xb53f('0x2c')]:_0x3d3833[_0xb53f('0x29')]+_0x3d3833['limit'];var _0x4e632d;if(_0x3af26e>=_0x2f85f3){_0x3af26e=_0x2f85f3;_0x4e632d=0xc8;}else{_0x4e632d=0xce;}_0x49bda1['status'](_0x4e632d);return _0x49bda1[_0xb53f('0x2d')](_0xb53f('0x2e'),_0x2043e8+'-'+_0x3af26e+'/'+_0x2f85f3)['json'](_0x3a9e4f);}return null;};}function patchUpdates(_0x2183aa){return function(_0x14d96f){try{jsonpatch['apply'](_0x14d96f,_0x2183aa,!![]);}catch(_0x421c02){return BPromise[_0xb53f('0x2f')](_0x421c02);}return _0x14d96f[_0xb53f('0x30')]();};}function saveUpdates(_0x7459db,_0x4ccfbc){return function(_0x24ba27){if(_0x24ba27){return _0x24ba27[_0xb53f('0x31')](_0x7459db)[_0xb53f('0x1e')](function(_0x5c460c){return _0x5c460c;});}return null;};}function removeEntity(_0x48160c,_0x4b1d25){return function(_0x1a7d8f){if(_0x1a7d8f){return _0x1a7d8f[_0xb53f('0x32')]()[_0xb53f('0x1e')](function(){_0x48160c[_0xb53f('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a8d44,_0x14b24e){return function(_0x7246ce){if(!_0x7246ce){_0x5a8d44[_0xb53f('0x34')](0x194);}return _0x7246ce;};}function handleError(_0x581bbd,_0x27c4c4){_0x27c4c4=_0x27c4c4||0x1f4;return function(_0x304f7e){logger[_0xb53f('0x23')](_0x304f7e[_0xb53f('0x35')]);if(_0x304f7e[_0xb53f('0x36')]){delete _0x304f7e[_0xb53f('0x36')];}_0x581bbd[_0xb53f('0x33')](_0x27c4c4)[_0xb53f('0x37')](_0x304f7e);};}exports['index']=function(_0x171b4e,_0x242c4b){var _0x439560={},_0x258ce0={},_0x5c0070={'count':0x0,'rows':[]};var _0x3c5b8f=_[_0xb53f('0x38')](db[_0xb53f('0x39')][_0xb53f('0x3a')],function(_0x2c6f2b){return{'name':_0x2c6f2b[_0xb53f('0x3b')],'type':_0x2c6f2b[_0xb53f('0x3c')]['key']};});_0x258ce0[_0xb53f('0x3d')]=_[_0xb53f('0x38')](_0x3c5b8f,_0xb53f('0x36'));_0x258ce0[_0xb53f('0x3e')]=_[_0xb53f('0x3f')](_0x171b4e['query']);_0x258ce0[_0xb53f('0x40')]=_[_0xb53f('0x41')](_0x258ce0[_0xb53f('0x3d')],_0x258ce0[_0xb53f('0x3e')]);_0x439560[_0xb53f('0x42')]=_[_0xb53f('0x41')](_0x258ce0[_0xb53f('0x3d')],qs[_0xb53f('0x43')](_0x171b4e[_0xb53f('0x3e')][_0xb53f('0x43')]));_0x439560[_0xb53f('0x42')]=_0x439560[_0xb53f('0x42')][_0xb53f('0x44')]?_0x439560[_0xb53f('0x42')]:_0x258ce0[_0xb53f('0x3d')];if(!_0x171b4e[_0xb53f('0x3e')][_0xb53f('0x45')](_0xb53f('0x46'))){_0x439560[_0xb53f('0x2a')]=qs[_0xb53f('0x2a')](_0x171b4e['query']['limit']);_0x439560[_0xb53f('0x29')]=qs[_0xb53f('0x29')](_0x171b4e['query'][_0xb53f('0x29')]);}_0x439560[_0xb53f('0x47')]=qs['sort'](_0x171b4e[_0xb53f('0x3e')][_0xb53f('0x48')]);_0x439560[_0xb53f('0x49')]=qs[_0xb53f('0x40')](_[_0xb53f('0x4a')](_0x171b4e[_0xb53f('0x3e')],_0x258ce0[_0xb53f('0x40')]),_0x3c5b8f);if(_0x171b4e[_0xb53f('0x3e')][_0xb53f('0x4b')]){_0x439560['where']=_[_0xb53f('0x4c')](_0x439560['where'],{'$or':_[_0xb53f('0x38')](_0x3c5b8f,function(_0x3a4214){if(_0x3a4214[_0xb53f('0x3c')]!=='VIRTUAL'){var _0x5bb9fa={};_0x5bb9fa[_0x3a4214[_0xb53f('0x36')]]={'$like':'%'+_0x171b4e[_0xb53f('0x3e')][_0xb53f('0x4b')]+'%'};return _0x5bb9fa;}})});}_0x439560=_['merge']({},_0x439560,_0x171b4e[_0xb53f('0x4d')]);var _0x40d419={'where':_0x439560[_0xb53f('0x49')]};return db[_0xb53f('0x39')][_0xb53f('0x2c')](_0x40d419)['then'](function(_0x1191b2){_0x5c0070[_0xb53f('0x2c')]=_0x1191b2;if(_0x171b4e['query'][_0xb53f('0x4e')]){_0x439560['include']=[{'all':!![]}];}return db[_0xb53f('0x39')][_0xb53f('0x4f')](_0x439560);})[_0xb53f('0x1e')](function(_0x407c6a){_0x5c0070['rows']=_0x407c6a;return _0x5c0070;})[_0xb53f('0x1e')](respondWithFilteredResult(_0x242c4b,_0x439560))[_0xb53f('0x50')](handleError(_0x242c4b,null));};exports[_0xb53f('0x51')]=function(_0x3defab,_0x5e3034){var _0x537e86={'raw':!![],'where':{'id':_0x3defab[_0xb53f('0x52')]['id']}},_0x5805a3={};_0x5805a3[_0xb53f('0x3d')]=_['keys'](db[_0xb53f('0x39')][_0xb53f('0x3a')]);_0x5805a3[_0xb53f('0x3e')]=_[_0xb53f('0x3f')](_0x3defab[_0xb53f('0x3e')]);_0x5805a3[_0xb53f('0x40')]=_[_0xb53f('0x41')](_0x5805a3['model'],_0x5805a3[_0xb53f('0x3e')]);_0x537e86[_0xb53f('0x42')]=_[_0xb53f('0x41')](_0x5805a3[_0xb53f('0x3d')],qs[_0xb53f('0x43')](_0x3defab[_0xb53f('0x3e')]['fields']));_0x537e86['attributes']=_0x537e86['attributes']['length']?_0x537e86[_0xb53f('0x42')]:_0x5805a3['model'];if(_0x3defab['query'][_0xb53f('0x4e')]){_0x537e86[_0xb53f('0x53')]=[{'all':!![]}];}_0x537e86=_[_0xb53f('0x4c')]({},_0x537e86,_0x3defab[_0xb53f('0x4d')]);return db[_0xb53f('0x39')][_0xb53f('0x54')](_0x537e86)[_0xb53f('0x1e')](handleEntityNotFound(_0x5e3034,null))[_0xb53f('0x1e')](respondWithResult(_0x5e3034,null))[_0xb53f('0x50')](handleError(_0x5e3034,null));};exports[_0xb53f('0x31')]=function(_0x41e4cb,_0x55f7a0){if(_0x41e4cb[_0xb53f('0x55')]['id']){delete _0x41e4cb['body']['id'];}return db[_0xb53f('0x39')][_0xb53f('0x54')]({'where':{'id':_0x41e4cb[_0xb53f('0x52')]['id']}})['then'](handleEntityNotFound(_0x55f7a0,null))[_0xb53f('0x1e')](saveUpdates(_0x41e4cb[_0xb53f('0x55')],null))['then'](respondWithResult(_0x55f7a0,null))[_0xb53f('0x50')](handleError(_0x55f7a0,null));};exports[_0xb53f('0x32')]=function(_0x14731c,_0x82597){return db[_0xb53f('0x39')]['find']({'where':{'id':_0x14731c[_0xb53f('0x52')]['id']}})['then'](handleEntityNotFound(_0x82597,null))['then'](removeEntity(_0x82597,null))['catch'](handleError(_0x82597,null));};exports[_0xb53f('0x56')]=function(_0xde2f28,_0x5762f0){return db[_0xb53f('0x39')]['describe']()[_0xb53f('0x1e')](respondWithResult(_0x5762f0,null))[_0xb53f('0x50')](handleError(_0x5762f0,null));};var interaction_log=require(_0xb53f('0x13'))('fax-interactions');exports[_0xb53f('0x57')]=function(_0x16aacf,_0x1217e7,_0x2fc1ef){var _0x85f7b5={'agent':{},'channel':_0xb53f('0x58')};if(_0x16aacf[_0xb53f('0x55')]['id']){delete _0x16aacf[_0xb53f('0x55')]['id'];}_0x16aacf[_0xb53f('0x55')][_0xb53f('0x59')]=!![];_0x16aacf[_0xb53f('0x55')][_0xb53f('0x5a')]=moment()[_0xb53f('0x5b')](_0xb53f('0x5c'));_0x16aacf[_0xb53f('0x55')][_0xb53f('0x5d')]=_0x16aacf[_0xb53f('0x55')][_0xb53f('0x5d')]||_0x16aacf['user']['id'];_0x85f7b5[_0xb53f('0x5e')]['id']=_0x16aacf[_0xb53f('0x55')][_0xb53f('0x5d')];return db[_0xb53f('0x39')][_0xb53f('0x54')]({'where':{'id':_0x16aacf[_0xb53f('0x52')]['id'],'UserId':null}})[_0xb53f('0x1e')](handleEntityNotFound(_0x1217e7,null))[_0xb53f('0x1e')](saveUpdates(_0x16aacf[_0xb53f('0x55')],null))[_0xb53f('0x1e')](function(_0x56e5a7){if(_0x56e5a7){_0x85f7b5['message']=_0x56e5a7[_0xb53f('0x5f')]({'plain':!![]});return db[_0xb53f('0x60')][_0xb53f('0x54')]({'where':{'id':_0x56e5a7[_0xb53f('0x61')]}});}return null;})[_0xb53f('0x1e')](handleEntityNotFound(_0x1217e7,null))[_0xb53f('0x1e')](function(_0x80c058){if(_0x80c058){return _0x80c058[_0xb53f('0x31')]({'UserId':_0x16aacf['body'][_0xb53f('0x5d')],'read1stAt':_['isNil'](_0x80c058[_0xb53f('0x62')])?moment()[_0xb53f('0x5b')](_0xb53f('0x5c')):undefined});}return null;})[_0xb53f('0x1e')](function(_0x27c504){if(_0x27c504){_0x85f7b5[_0xb53f('0x63')]=_0x27c504['get']({'plain':!![]});interaction_log['info'](_0xb53f('0x64'),_0x16aacf[_0xb53f('0x65')]['id'],_0x16aacf[_0xb53f('0x65')][_0xb53f('0x36')],_0x16aacf['user'][_0xb53f('0x66')],_0x85f7b5[_0xb53f('0x63')]['id'],_0x16aacf[_0xb53f('0x55')]?JSON[_0xb53f('0x67')](_0x16aacf[_0xb53f('0x55')]):_0xb53f('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x85f7b5);}return null;})[_0xb53f('0x1e')](function(_0x1daa29){var _0xe1ec2a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1daa29['message'][_0xb53f('0x69')];return db[_0xb53f('0x6a')][_0xb53f('0x3e')](_0xe1ec2a,{'type':db[_0xb53f('0x6b')][_0xb53f('0x6c')][_0xb53f('0x6d')],'raw':!![]})[_0xb53f('0x1e')](function(_0x3ad188){return _0x3ad188;});})[_0xb53f('0x1e')](function(_0x231cac){if(_0x231cac){_0x85f7b5[_0xb53f('0x25')]['contact']=_0x231cac[0x0];if(!_0x16aacf[_0xb53f('0x55')][_0xb53f('0x5d')])return;return db[_0xb53f('0x6e')][_0xb53f('0x54')]({'where':{'id':_0x16aacf[_0xb53f('0x55')][_0xb53f('0x5d')],'role':'agent'},'attributes':['id',_0xb53f('0x36'),_0xb53f('0x6f'),_0xb53f('0x70'),_0xb53f('0x71')],'raw':!![]});}return null;})[_0xb53f('0x1e')](function(_0x41939c){if(!_0x41939c)return null;_0x85f7b5[_0xb53f('0x25')][_0xb53f('0x5e')]=_0x41939c;return _0x85f7b5;})[_0xb53f('0x1e')](function(_0x3dd03e){if(_0x3dd03e){if(_0x16aacf[_0xb53f('0x55')][_0xb53f('0x72')]){_0x85f7b5[_0xb53f('0x25')][_0xb53f('0x73')]=util[_0xb53f('0x5b')](_0xb53f('0x74'),_0x16aacf[_0xb53f('0x65')]['name']);_0x85f7b5['message']['channel']=_0x85f7b5[_0xb53f('0x75')];_0x85f7b5[_0xb53f('0x25')][_0xb53f('0x76')]=_0x85f7b5[_0xb53f('0x75')];_0x85f7b5[_0xb53f('0x25')][_0xb53f('0x77')]=_0xb53f('0x57');return respondWithRpcPromise(_0xb53f('0x78'),'EventManager',{'event':'acceptmessage','message':_0x85f7b5[_0xb53f('0x25')]},client9002)[_0xb53f('0x1e')](function(){return _0x85f7b5;});}return _0x85f7b5;}return null;})['then'](respondWithResult(_0x1217e7,null))[_0xb53f('0x50')](handleError(_0x1217e7,null));};var interaction_log=require(_0xb53f('0x13'))(_0xb53f('0x79'));exports[_0xb53f('0x2f')]=function(_0xfe7b8c,_0x4fbd7c,_0x365429){var _0x4ac07e={'agent':{},'channel':'fax'};if(_0xfe7b8c[_0xb53f('0x55')]['id']){delete _0xfe7b8c[_0xb53f('0x55')]['id'];}_0xfe7b8c[_0xb53f('0x55')]['UserId']=_0xfe7b8c[_0xb53f('0x55')][_0xb53f('0x5d')]||_0xfe7b8c[_0xb53f('0x65')]['id'];_0x4ac07e['agent']['id']=_0xfe7b8c[_0xb53f('0x55')][_0xb53f('0x5d')];return db[_0xb53f('0x39')][_0xb53f('0x54')]({'where':{'id':_0xfe7b8c[_0xb53f('0x52')]['id'],'UserId':null}})[_0xb53f('0x1e')](handleEntityNotFound(_0x4fbd7c,null))[_0xb53f('0x1e')](function(_0x21fb31){if(_0x21fb31){_0x4ac07e['message']=_0x21fb31[_0xb53f('0x5f')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x21fb31[_0xb53f('0x61')]}});}return null;})[_0xb53f('0x1e')](handleEntityNotFound(_0x4fbd7c,null))['then'](function(_0x5f59a3){if(_0x5f59a3){_0x4ac07e['interaction']=_0x5f59a3[_0xb53f('0x5f')]({'plain':!![]});interaction_log['info'](_0xb53f('0x7a'),_0xfe7b8c[_0xb53f('0x65')]['id'],_0xfe7b8c[_0xb53f('0x65')]['name'],_0xfe7b8c[_0xb53f('0x65')]['role'],_0x4ac07e[_0xb53f('0x63')]['id'],_0xfe7b8c[_0xb53f('0x55')]?JSON[_0xb53f('0x67')](_0xfe7b8c[_0xb53f('0x55')]):_0xb53f('0x68'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4ac07e);}return null;})[_0xb53f('0x1e')](function(_0x1da8e6){var _0x39cbf0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1da8e6['message'][_0xb53f('0x69')];return db[_0xb53f('0x6a')]['query'](_0x39cbf0,{'type':db[_0xb53f('0x6b')]['QueryTypes'][_0xb53f('0x6d')],'raw':!![]})[_0xb53f('0x1e')](function(_0x4a48e4){return _0x4a48e4;});})[_0xb53f('0x1e')](function(_0x292275){if(_0x292275){_0x4ac07e[_0xb53f('0x25')][_0xb53f('0x7b')]=_0x292275[0x0];if(!_0xfe7b8c['body'][_0xb53f('0x5d')])return;return db['User'][_0xb53f('0x54')]({'where':{'id':_0xfe7b8c[_0xb53f('0x55')][_0xb53f('0x5d')],'role':_0xb53f('0x5e')},'attributes':['id',_0xb53f('0x36'),_0xb53f('0x6f'),'email',_0xb53f('0x71')],'raw':!![]});}return null;})[_0xb53f('0x1e')](function(_0x332ed8){if(!_0x332ed8)return null;_0x4ac07e[_0xb53f('0x25')][_0xb53f('0x5e')]=_0x332ed8;return _0x4ac07e;})['then'](function(_0x363f58){if(_0x363f58){_0x363f58[_0xb53f('0x25')]['interface']=util[_0xb53f('0x5b')](_0xb53f('0x74'),_0xfe7b8c[_0xb53f('0x65')][_0xb53f('0x36')]);_0x363f58[_0xb53f('0x25')]['channel']=_0x4ac07e[_0xb53f('0x75')];_0x363f58['message'][_0xb53f('0x76')]=_0x4ac07e['channel'];_0x363f58[_0xb53f('0x25')][_0xb53f('0x77')]=_0xb53f('0x2f');respondWithRpcPromise(_0xb53f('0x78'),_0xb53f('0x78'),{'event':_0xb53f('0x7c'),'message':_0x363f58[_0xb53f('0x25')]},client9002);return _0x4ac07e;}return null;})[_0xb53f('0x1e')](respondWithResult(_0x4fbd7c,null))[_0xb53f('0x50')](handleError(_0x4fbd7c,null));};exports[_0xb53f('0x7d')]=function(_0x5e793b,_0xa7b21c){var _0x1c53fe;return db['FaxMessage'][_0xb53f('0x7d')](_0x5e793b[_0xb53f('0x55')],{})[_0xb53f('0x1e')](function(_0x1c0472){_0x1c53fe=_0x1c0472;return db[_0xb53f('0x7e')][_0xb53f('0x7f')]({'where':{'id':_0x1c53fe[_0xb53f('0x69')]}});})['then'](function(_0x4a897c){if(_[_0xb53f('0x80')](_0x4a897c)){return;}else{_0x1c53fe[_0xb53f('0x58')]=_0x4a897c[_0xb53f('0x58')];return db[_0xb53f('0x81')][_0xb53f('0x7f')]({'where':{'id':_0x1c53fe[_0xb53f('0x82')]}});}})[_0xb53f('0x1e')](function(_0x2dec5d){return respondWithRpcPromise(_0xb53f('0x83'),'SendFax',{'FaxAccountId':_[_0xb53f('0x80')](_0x5e793b['body'])?undefined:_0x5e793b['body'][_0xb53f('0x84')],'path':_[_0xb53f('0x80')](_0x2dec5d)?undefined:util[_0xb53f('0x5b')](_0xb53f('0x85'),_0x2dec5d['basename']),'fax':_['isNil'](_0x1c53fe[_0xb53f('0x58')])?undefined:_0x1c53fe[_0xb53f('0x58')],'AttachmentId':_0x1c53fe[_0xb53f('0x82')]},client9002);})[_0xb53f('0x1e')](respondWithResult(_0xa7b21c,0xc9))[_0xb53f('0x50')](handleError(_0xa7b21c,null));};exports[_0xb53f('0x86')]=function(_0x23e37c,_0x36df0d){var _0x2fd9b3=path[_0xb53f('0x87')](config[_0xb53f('0x88')],_0xb53f('0x89'),_0xb53f('0x8a'),'attachments');return db[_0xb53f('0x39')][_0xb53f('0x54')]({'where':{'id':_0x23e37c['params']['id']},'include':[{'model':db[_0xb53f('0x81')],'as':_0xb53f('0x81')}]})[_0xb53f('0x1e')](handleEntityNotFound(_0x36df0d,null))[_0xb53f('0x1e')](function(_0x39191b){if(_0x39191b){return _0x36df0d[_0xb53f('0x86')](path['join'](_0x2fd9b3,_0x39191b[_0xb53f('0x81')][_0xb53f('0x8b')]));}})[_0xb53f('0x50')](handleError(_0x36df0d,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index eaded52..cf3e987 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 _0x6869=['hook','exports','events','../../mysqldb','FaxMessage','save','emit','hasOwnProperty'];(function(_0x2c3611,_0x1c1615){var _0x464eee=function(_0x443872){while(--_0x443872){_0x2c3611['push'](_0x2c3611['shift']());}};_0x464eee(++_0x1c1615);}(_0x6869,0xe2));var _0x9686=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6869[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x9686('0x0'));var FaxMessage=require(_0x9686('0x1'))['db'][_0x9686('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9686('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x10b5dd){return function(_0x1214bf,_0x3afe82,_0x2a1a62){FaxMessageEvents[_0x9686('0x4')](_0x10b5dd+':'+_0x1214bf['id'],_0x1214bf);FaxMessageEvents['emit'](_0x10b5dd,_0x1214bf);_0x2a1a62(null);};}for(var e in events){if(events[_0x9686('0x5')](e)){var event=events[e];FaxMessage[_0x9686('0x6')](e,emitEvent(event));}}module[_0x9686('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xc677=['remove','emit','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc677,0x16c));var _0x7c67=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc677[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7c67('0x0'))['db'][_0x7c67('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7c67('0x2')](0x0);var events={'afterCreate':_0x7c67('0x3'),'afterUpdate':_0x7c67('0x4'),'afterDestroy':_0x7c67('0x5')};function emitEvent(_0x2e14c5){return function(_0x5a3d34,_0x51560f,_0x566892){FaxMessageEvents['emit'](_0x2e14c5+':'+_0x5a3d34['id'],_0x5a3d34);FaxMessageEvents[_0x7c67('0x6')](_0x2e14c5,_0x5a3d34);_0x566892(null);};}for(var e in events){if(events[_0x7c67('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7c67('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 e4d3b9e..2fa1561 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 _0x658d=['FaxInteractionId','update','createdAt','direction','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','fax_messages','body','models','get','toLowerCase','out','secret','FaxInteraction','findOne'];(function(_0x453b1e,_0x677eae){var _0x1ae017=function(_0x572e7c){while(--_0x572e7c){_0x453b1e['push'](_0x453b1e['shift']());}};_0x1ae017(++_0x677eae);}(_0x658d,0x13f));var _0xd658=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x658d[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xd658('0x0'));var util=require('util');var logger=require(_0xd658('0x1'))(_0xd658('0x2'));var moment=require(_0xd658('0x3'));var BPromise=require('bluebird');var rp=require(_0xd658('0x4'));var fs=require('fs');var path=require(_0xd658('0x5'));var rimraf=require(_0xd658('0x6'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0xd658('0x7')]=function(_0xfd1044,_0x27b36e){return _0xfd1044['define']('FaxMessage',attributes,{'tableName':_0xd658('0x8'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xd658('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3efaa9,_0x1c5b4b,_0x4dae31){var _0x1e41ff=_0xfd1044[_0xd658('0xa')];var _0xc8cc21=_0x3efaa9[_0xd658('0xb')]({'plain':!![]});if(_0xc8cc21['direction'][_0xd658('0xc')]()==='in'||_0xc8cc21['direction']['toLowerCase']()===_0xd658('0xd')&&!_0xc8cc21[_0xd658('0xe')]&&!_['isNil'](_0xc8cc21['UserId'])){_0x1e41ff[_0xd658('0xf')][_0xd658('0x10')]({'where':{'id':_0xc8cc21[_0xd658('0x11')]}})['then'](function(_0x2ca367){if(_0x2ca367){_0x2ca367[_0xd658('0x12')]({'lastMsgAt':_0xc8cc21[_0xd658('0x13')],'lastMsgDirection':_0xc8cc21[_0xd658('0x14')]['toLowerCase']()});}})[_0xd658('0x15')](function(_0x5bc725){console[_0xd658('0x16')](_0x5bc725);});}_0x4dae31();}},'charset':'utf8mb4','collate':_0xd658('0x17')});}; \ No newline at end of file +var _0x1c85=['direction','toLowerCase','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','fax_messages','fti_fax_messages','body','models','get'];(function(_0x3fb27e,_0x4588de){var _0xf6cfd6=function(_0x4d1ff6){while(--_0x4d1ff6){_0x3fb27e['push'](_0x3fb27e['shift']());}};_0xf6cfd6(++_0x4588de);}(_0x1c85,0x93));var _0x51c8=function(_0x170922,_0x2e904b){_0x170922=_0x170922-0x0;var _0x490b4d=_0x1c85[_0x170922];return _0x490b4d;};'use strict';var _=require(_0x51c8('0x0'));var util=require(_0x51c8('0x1'));var logger=require(_0x51c8('0x2'))(_0x51c8('0x3'));var moment=require(_0x51c8('0x4'));var BPromise=require(_0x51c8('0x5'));var rp=require(_0x51c8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51c8('0x7'));var config=require(_0x51c8('0x8'));var attributes=require('./faxMessage.attributes');module[_0x51c8('0x9')]=function(_0x26888a,_0x4123ff){return _0x26888a['define']('FaxMessage',attributes,{'tableName':_0x51c8('0xa'),'paranoid':![],'indexes':[{'name':_0x51c8('0xb'),'fields':[_0x51c8('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26579b,_0x51d6d9,_0x56b760){var _0x636a73=_0x26888a[_0x51c8('0xd')];var _0x20319e=_0x26579b[_0x51c8('0xe')]({'plain':!![]});if(_0x20319e[_0x51c8('0xf')][_0x51c8('0x10')]()==='in'||_0x20319e[_0x51c8('0xf')][_0x51c8('0x10')]()==='out'&&!_0x20319e['secret']&&!_[_0x51c8('0x11')](_0x20319e[_0x51c8('0x12')])){_0x636a73[_0x51c8('0x13')]['findOne']({'where':{'id':_0x20319e[_0x51c8('0x14')]}})[_0x51c8('0x15')](function(_0x32efa0){if(_0x32efa0){_0x32efa0[_0x51c8('0x16')]({'lastMsgAt':_0x20319e[_0x51c8('0x17')],'lastMsgDirection':_0x20319e[_0x51c8('0xf')]['toLowerCase']()});}})[_0x51c8('0x18')](function(_0x5532a2){console[_0x51c8('0x19')](_0x5532a2);});}_0x56b760();}},'charset':_0x51c8('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 43db8bd..82fee57 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 _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x5128f5,_0x1c3dc7){var _0xfb645a=function(_0x3426c0){while(--_0x3426c0){_0x5128f5['push'](_0x5128f5['shift']());}};_0xfb645a(++_0x1c3dc7);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x17aafe,_0x12446f){_0x17aafe=_0x17aafe-0x0;var _0x45e0c2=_0xd6d6[_0x17aafe];return _0x45e0c2;};'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});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});}; \ No newline at end of file +var _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x31ea19,_0x13edfb){var _0x19207d=function(_0x282bae){while(--_0x282bae){_0x31ea19['push'](_0x31ea19['shift']());}};_0x19207d(++_0x13edfb);}(_0x6aa7,0x178));var _0x76aa=function(_0x29835e,_0x43f329){_0x29835e=_0x29835e-0x0;var _0xf84047=_0x6aa7[_0x29835e];return _0xf84047;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 65331a2..ee53acd 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 _0x9c8a=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x207080,_0x44adf7){var _0x41bfda=function(_0x9ccd62){while(--_0x9ccd62){_0x207080['push'](_0x207080['shift']());}};_0x41bfda(++_0x44adf7);}(_0x9c8a,0x180));var _0xa9c8=function(_0x4c4958,_0x4aaeac){_0x4c4958=_0x4c4958-0x0;var _0x203577=_0x9c8a[_0x4c4958];return _0x203577;};'use strict';var FaxMessageEvents=require(_0xa9c8('0x0'));var events=[_0xa9c8('0x1'),_0xa9c8('0x2'),_0xa9c8('0x3')];function createListener(_0xb753fd,_0x2f2705){return function(_0x49570e){_0x2f2705[_0xa9c8('0x4')](_0xb753fd,_0x49570e);};}function removeListener(_0x21f45c,_0x58e778){return function(){FaxMessageEvents[_0xa9c8('0x5')](_0x21f45c,_0x58e778);};}exports[_0xa9c8('0x6')]=function(_0x36618c){for(var _0x212c14=0x0,_0x363626=events[_0xa9c8('0x7')];_0x212c14<_0x363626;_0x212c14++){var _0x2635e4=events[_0x212c14];var _0x1bc48f=createListener(_0xa9c8('0x8')+_0x2635e4,_0x36618c);FaxMessageEvents['on'](_0x2635e4,_0x1bc48f);}}; \ No newline at end of file +var _0x688a=['./faxMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x688a,0xcb));var _0xa688=function(_0x58de51,_0x57ebe0){_0x58de51=_0x58de51-0x0;var _0x17ba7d=_0x688a[_0x58de51];return _0x17ba7d;};'use strict';var FaxMessageEvents=require(_0xa688('0x0'));var events=[_0xa688('0x1'),_0xa688('0x2'),_0xa688('0x3')];function createListener(_0x58e246,_0x588626){return function(_0x2b4691){_0x588626[_0xa688('0x4')](_0x58e246,_0x2b4691);};}function removeListener(_0x37e731,_0xc72b7f){return function(){FaxMessageEvents[_0xa688('0x5')](_0x37e731,_0xc72b7f);};}exports['register']=function(_0x33c338){for(var _0x5e849c=0x0,_0x32f941=events[_0xa688('0x6')];_0x5e849c<_0x32f941;_0x5e849c++){var _0x48ada2=events[_0x5e849c];var _0x5b8dc6=createListener('faxMessage:'+_0x48ada2,_0x33c338);FaxMessageEvents['on'](_0x48ada2,_0x5b8dc6);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 55c9b8a..72bccc5 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 _0x6f0d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','show','/:id/download','post','tracked','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x379ee5,_0x336c42){var _0x114694=function(_0x55b2f5){while(--_0x55b2f5){_0x379ee5['push'](_0x379ee5['shift']());}};_0x114694(++_0x336c42);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xfa1196,_0x59a1ef){_0xfa1196=_0xfa1196-0x0;var _0x1e48c7=_0x6f0d[_0xfa1196];return _0x1e48c7;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xa')](_0xd6f0('0xe'),auth[_0xd6f0('0x9')](),controller['download']);router[_0xd6f0('0xf')]('/',auth[_0xd6f0('0x9')](),interaction[_0xd6f0('0x10')](_0xd6f0('0x11'),'faxmessage:create'),controller[_0xd6f0('0x12')]);router[_0xd6f0('0x13')](_0xd6f0('0x14'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x15')]);router[_0xd6f0('0x13')](_0xd6f0('0x16'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x17')]);router['put'](_0xd6f0('0x18'),auth[_0xd6f0('0x9')](),controller['reject']);router[_0xd6f0('0x19')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x1a')]);module[_0xd6f0('0x1b')]=router; \ No newline at end of file +var _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/download','download','tracked','fax','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x1f8f97,_0x1c8de4){var _0x59871e=function(_0x4513ad){while(--_0x4513ad){_0x1f8f97['push'](_0x1f8f97['shift']());}};_0x59871e(++_0x1c8de4);}(_0x13f6,0x124));var _0x613f=function(_0xf7b8c2,_0x119b83){_0xf7b8c2=_0xf7b8c2-0x0;var _0x2a60db=_0x13f6[_0xf7b8c2];return _0x2a60db;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['post']('/',auth[_0x613f('0x8')](),interaction[_0x613f('0xf')](_0x613f('0x10'),'faxmessage:create'),controller[_0x613f('0x11')]);router[_0x613f('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x613f('0x12')](_0x613f('0x13'),auth[_0x613f('0x8')](),controller[_0x613f('0x14')]);router[_0x613f('0x12')](_0x613f('0x15'),auth[_0x613f('0x8')](),controller[_0x613f('0x16')]);router[_0x613f('0x17')](_0x613f('0xb'),auth['isAuthenticated'](),controller[_0x613f('0x18')]);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 c7b4933..9f3040b 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 _0x98f9=['sequelize','name','rrmemory','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98f9,0x1a8));var _0x998f=function(_0x54062d,_0x3aa5ff){_0x54062d=_0x54062d-0x0;var _0x35c8fb=_0x98f9[_0x54062d];return _0x35c8fb;};'use strict';var Sequelize=require(_0x998f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x998f('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x998f('0x2'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x998f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4f6=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','name','STRING'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xc4f6,0x64));var _0x6c4f=function(_0x4eb824,_0x34dc73){_0x4eb824=_0x4eb824-0x0;var _0x2c3b1e=_0xc4f6[_0x4eb824];return _0x2c3b1e;};'use strict';var Sequelize=require(_0x6c4f('0x0'));module[_0x6c4f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6c4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6c4f('0x3')]},'timeout':{'type':Sequelize[_0x6c4f('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6c4f('0x5')](_0x6c4f('0x6'),_0x6c4f('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index d04849a..91cd255 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 _0x0071=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','sort','where','filter','merge','type','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','pick','User','findAndCountAll','UserId','agent','faxPause','updatedAt','count','format','%s/%s','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','transaction','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','request-promise','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x433962,_0x45dac4){var _0x5daa34=function(_0x135afc){while(--_0x135afc){_0x433962['push'](_0x433962['shift']());}};_0x5daa34(++_0x45dac4);}(_0x0071,0x70));var _0x1007=function(_0x5ea60b,_0x3225bd){_0x5ea60b=_0x5ea60b-0x0;var _0x4a584a=_0x0071[_0x5ea60b];return _0x4a584a;};'use strict';var emlformat=require(_0x1007('0x0'));var rimraf=require(_0x1007('0x1'));var zipdir=require(_0x1007('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1007('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1007('0x4'));var _=require(_0x1007('0x5'));var squel=require(_0x1007('0x6'));var crypto=require(_0x1007('0x7'));var jsforce=require(_0x1007('0x8'));var deskjs=require(_0x1007('0x9'));var toCsv=require(_0x1007('0xa'));var querystring=require(_0x1007('0xb'));var Papa=require(_0x1007('0xc'));var Redis=require('ioredis');var authService=require(_0x1007('0xd'));var qs=require(_0x1007('0xe'));var as=require(_0x1007('0xf'));var hardwareService=require(_0x1007('0x10'));var logger=require(_0x1007('0x11'))(_0x1007('0x12'));var utils=require(_0x1007('0x13'));var config=require(_0x1007('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1007('0x15'))['db'];config[_0x1007('0x16')]=_[_0x1007('0x17')](config[_0x1007('0x16')],{'host':_0x1007('0x18'),'port':0x18eb});var socket=require(_0x1007('0x19'))(new Redis(config[_0x1007('0x16')]));require(_0x1007('0x1a'))[_0x1007('0x1b')](socket);function respondWithStatusCode(_0x5394b9,_0x4da941){_0x4da941=_0x4da941||0xcc;return function(_0x5a4b48){if(_0x5a4b48){return _0x5394b9[_0x1007('0x1c')](_0x4da941);}return _0x5394b9[_0x1007('0x1d')](_0x4da941)[_0x1007('0x1e')]();};}function respondWithResult(_0x35d9fa,_0x5ad2c9){_0x5ad2c9=_0x5ad2c9||0xc8;return function(_0x270530){if(_0x270530){return _0x35d9fa[_0x1007('0x1d')](_0x5ad2c9)['json'](_0x270530);}};}function respondWithFilteredResult(_0x446fa5,_0x1bdc35){return function(_0x1a2c75){if(_0x1a2c75){var _0x14ec11=typeof _0x1bdc35['offset']===_0x1007('0x1f')&&typeof _0x1bdc35[_0x1007('0x20')]==='undefined';var _0x570b18=_0x1a2c75['count'];var _0x124700=_0x14ec11?0x0:_0x1bdc35['offset'];var _0x3fa003=_0x14ec11?_0x1a2c75['count']:_0x1bdc35[_0x1007('0x21')]+_0x1bdc35['limit'];var _0x221d6f;if(_0x3fa003>=_0x570b18){_0x3fa003=_0x570b18;_0x221d6f=0xc8;}else{_0x221d6f=0xce;}_0x446fa5[_0x1007('0x1d')](_0x221d6f);return _0x446fa5['set'](_0x1007('0x22'),_0x124700+'-'+_0x3fa003+'/'+_0x570b18)['json'](_0x1a2c75);}return null;};}function patchUpdates(_0x1f6a1e){return function(_0x5218d3){try{jsonpatch[_0x1007('0x23')](_0x5218d3,_0x1f6a1e,!![]);}catch(_0x283e93){return BPromise[_0x1007('0x24')](_0x283e93);}return _0x5218d3['save']();};}function saveUpdates(_0x25758b,_0x571ad4){return function(_0x193fef){if(_0x193fef){return _0x193fef[_0x1007('0x25')](_0x25758b)[_0x1007('0x26')](function(_0x445dca){return _0x445dca;});}return null;};}function removeEntity(_0x352d90,_0x4a87af){return function(_0x2fc1b2){if(_0x2fc1b2){return _0x2fc1b2[_0x1007('0x27')]()['then'](function(){var _0x2171bf=_0x2fc1b2[_0x1007('0x28')]({'plain':!![]});var _0x53e04c=_0x1007('0x29');return db[_0x1007('0x2a')]['destroy']({'where':{'type':_0x53e04c,'resourceId':_0x2171bf['id']}})[_0x1007('0x26')](function(){return _0x2fc1b2;});})[_0x1007('0x26')](function(){_0x352d90[_0x1007('0x1d')](0xcc)[_0x1007('0x1e')]();});}};}function handleEntityNotFound(_0x115b94,_0x11981b){return function(_0x3f3a3d){if(!_0x3f3a3d){_0x115b94[_0x1007('0x1c')](0x194);}return _0x3f3a3d;};}function handleError(_0x5b42e2,_0x2b51d0){_0x2b51d0=_0x2b51d0||0x1f4;return function(_0x236ffb){logger[_0x1007('0x2b')](_0x236ffb[_0x1007('0x2c')]);if(_0x236ffb[_0x1007('0x2d')]){delete _0x236ffb[_0x1007('0x2d')];}_0x5b42e2[_0x1007('0x1d')](_0x2b51d0)[_0x1007('0x2e')](_0x236ffb);};}exports[_0x1007('0x2f')]=function(_0x1aaedd,_0x361544){var _0x252e2f={},_0x15ee35={},_0x13f54b={'count':0x0,'rows':[]};var _0x3ca86b=_[_0x1007('0x30')](db[_0x1007('0x31')][_0x1007('0x32')],function(_0x3f1870){return{'name':_0x3f1870['fieldName'],'type':_0x3f1870['type']['key']};});_0x15ee35['model']=_[_0x1007('0x30')](_0x3ca86b,_0x1007('0x2d'));_0x15ee35[_0x1007('0x33')]=_[_0x1007('0x34')](_0x1aaedd[_0x1007('0x33')]);_0x15ee35[_0x1007('0x35')]=_[_0x1007('0x36')](_0x15ee35['model'],_0x15ee35[_0x1007('0x33')]);_0x252e2f[_0x1007('0x37')]=_[_0x1007('0x36')](_0x15ee35[_0x1007('0x38')],qs[_0x1007('0x39')](_0x1aaedd[_0x1007('0x33')]['fields']));_0x252e2f[_0x1007('0x37')]=_0x252e2f['attributes'][_0x1007('0x3a')]?_0x252e2f[_0x1007('0x37')]:_0x15ee35[_0x1007('0x38')];if(!_0x1aaedd[_0x1007('0x33')]['hasOwnProperty']('nolimit')){_0x252e2f[_0x1007('0x20')]=qs[_0x1007('0x20')](_0x1aaedd[_0x1007('0x33')][_0x1007('0x20')]);_0x252e2f[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x1aaedd[_0x1007('0x33')]['offset']);}_0x252e2f['order']=qs[_0x1007('0x3b')](_0x1aaedd['query']['sort']);_0x252e2f[_0x1007('0x3c')]=qs[_0x1007('0x35')](_['pick'](_0x1aaedd[_0x1007('0x33')],_0x15ee35[_0x1007('0x35')]),_0x3ca86b);if(_0x1aaedd[_0x1007('0x33')][_0x1007('0x3d')]){_0x252e2f[_0x1007('0x3c')]=_[_0x1007('0x3e')](_0x252e2f[_0x1007('0x3c')],{'$or':_[_0x1007('0x30')](_0x3ca86b,function(_0x3a9cd8){if(_0x3a9cd8[_0x1007('0x3f')]!=='VIRTUAL'){var _0x1d7763={};_0x1d7763[_0x3a9cd8['name']]={'$like':'%'+_0x1aaedd[_0x1007('0x33')][_0x1007('0x3d')]+'%'};return _0x1d7763;}})});}_0x252e2f=_['merge']({},_0x252e2f,_0x1aaedd[_0x1007('0x40')]);var _0x5ecf12={'where':_0x252e2f[_0x1007('0x3c')]};return db[_0x1007('0x31')]['count'](_0x5ecf12)[_0x1007('0x26')](function(_0x57bd92){_0x13f54b['count']=_0x57bd92;if(_0x1aaedd[_0x1007('0x33')][_0x1007('0x41')]){_0x252e2f['include']=[{'all':!![]}];}return db['FaxQueue'][_0x1007('0x42')](_0x252e2f);})[_0x1007('0x26')](function(_0x1d35c1){_0x13f54b[_0x1007('0x43')]=_0x1d35c1;return _0x13f54b;})[_0x1007('0x26')](respondWithFilteredResult(_0x361544,_0x252e2f))[_0x1007('0x44')](handleError(_0x361544,null));};exports['show']=function(_0x1c6af3,_0x3d10ba){var _0x583a81={'raw':!![],'where':{'id':_0x1c6af3[_0x1007('0x45')]['id']}},_0x5ec951={};_0x5ec951[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x31')][_0x1007('0x32')]);_0x5ec951[_0x1007('0x33')]=_[_0x1007('0x34')](_0x1c6af3[_0x1007('0x33')]);_0x5ec951[_0x1007('0x35')]=_[_0x1007('0x36')](_0x5ec951[_0x1007('0x38')],_0x5ec951[_0x1007('0x33')]);_0x583a81[_0x1007('0x37')]=_['intersection'](_0x5ec951[_0x1007('0x38')],qs['fields'](_0x1c6af3[_0x1007('0x33')][_0x1007('0x39')]));_0x583a81['attributes']=_0x583a81[_0x1007('0x37')][_0x1007('0x3a')]?_0x583a81[_0x1007('0x37')]:_0x5ec951[_0x1007('0x38')];if(_0x1c6af3[_0x1007('0x33')][_0x1007('0x41')]){_0x583a81[_0x1007('0x46')]=[{'all':!![]}];}_0x583a81=_[_0x1007('0x3e')]({},_0x583a81,_0x1c6af3[_0x1007('0x40')]);return db['FaxQueue'][_0x1007('0x47')](_0x583a81)['then'](handleEntityNotFound(_0x3d10ba,null))[_0x1007('0x26')](respondWithResult(_0x3d10ba,null))[_0x1007('0x44')](handleError(_0x3d10ba,null));};exports[_0x1007('0x48')]=function(_0xaa20dc,_0x515652){return db[_0x1007('0x31')][_0x1007('0x48')](_0xaa20dc[_0x1007('0x49')],{})['then'](function(_0x2220cd){var _0x5b609f=_0xaa20dc[_0x1007('0x4a')]['get']({'plain':!![]});if(!_0x5b609f)throw new Error(_0x1007('0x4b'));if(_0x5b609f[_0x1007('0x4c')]===_0x1007('0x4a')){var _0x10bdfb=_0x2220cd['get']({'plain':!![]});var _0x28286c=_0x1007('0x29');return db[_0x1007('0x4d')]['find']({'where':{'name':_0x28286c,'userProfileId':_0x5b609f['userProfileId']},'raw':!![]})[_0x1007('0x26')](function(_0x35dc57){if(_0x35dc57&&_0x35dc57['autoAssociation']===0x0){return db[_0x1007('0x2a')][_0x1007('0x48')]({'name':_0x10bdfb[_0x1007('0x2d')],'resourceId':_0x10bdfb['id'],'type':_0x35dc57[_0x1007('0x2d')],'sectionId':_0x35dc57['id']},{})['then'](function(){return _0x2220cd;});}else{return _0x2220cd;}})[_0x1007('0x44')](function(_0x4787aa){logger[_0x1007('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4787aa);throw _0x4787aa;});}return _0x2220cd;})['then'](respondWithResult(_0x515652,0xc9))[_0x1007('0x44')](handleError(_0x515652,null));};exports[_0x1007('0x25')]=function(_0x3e842b,_0x3a31c8){if(_0x3e842b[_0x1007('0x49')]['id']){delete _0x3e842b[_0x1007('0x49')]['id'];}return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x3e842b[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x3a31c8,null))[_0x1007('0x26')](saveUpdates(_0x3e842b[_0x1007('0x49')],null))[_0x1007('0x26')](respondWithResult(_0x3a31c8,null))['catch'](handleError(_0x3a31c8,null));};exports['destroy']=function(_0x3e5ba0,_0x147156){return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x3e5ba0[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x147156,null))[_0x1007('0x26')](removeEntity(_0x147156,null))[_0x1007('0x44')](handleError(_0x147156,null));};exports[_0x1007('0x4e')]=function(_0x24281c,_0x2ed1b5){return db[_0x1007('0x31')][_0x1007('0x4e')]()[_0x1007('0x26')](respondWithResult(_0x2ed1b5,null))[_0x1007('0x44')](handleError(_0x2ed1b5,null));};exports[_0x1007('0x4f')]=function(_0x16f013,_0x4a8569,_0x50c353){var _0x3d21d4={'raw':!![],'where':{}},_0x4d6d55={},_0x172a93;return db['FaxQueue'][_0x1007('0x50')]({'where':{'id':_0x16f013['params']['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x4a8569,null))['then'](function(_0x440959){if(_0x440959){_0x172a93=_0x440959[_0x1007('0x28')]({'plain':!![]});_0x4d6d55[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x51')][_0x1007('0x32')]);_0x4d6d55[_0x1007('0x33')]=_['keys'](_0x16f013[_0x1007('0x33')]);_0x4d6d55[_0x1007('0x35')]=_[_0x1007('0x36')](_0x4d6d55[_0x1007('0x38')],_0x4d6d55[_0x1007('0x33')]);_0x3d21d4[_0x1007('0x37')]=_[_0x1007('0x36')](_0x4d6d55[_0x1007('0x38')],qs[_0x1007('0x39')](_0x16f013[_0x1007('0x33')][_0x1007('0x39')]));_0x3d21d4[_0x1007('0x37')]=_0x3d21d4[_0x1007('0x37')][_0x1007('0x3a')]?_0x3d21d4['attributes']:_0x4d6d55[_0x1007('0x38')];if(!_0x16f013[_0x1007('0x33')][_0x1007('0x52')](_0x1007('0x53'))){_0x3d21d4['limit']=qs[_0x1007('0x20')](_0x16f013[_0x1007('0x33')][_0x1007('0x20')]);_0x3d21d4[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x16f013['query'][_0x1007('0x21')]);}_0x3d21d4[_0x1007('0x54')]=qs[_0x1007('0x3b')](_0x16f013['query'][_0x1007('0x3b')]);_0x3d21d4[_0x1007('0x3c')]=qs[_0x1007('0x35')](_[_0x1007('0x55')](_0x16f013['query'],_0x4d6d55['filters']));_0x3d21d4[_0x1007('0x3c')]['FaxQueueId']=_0x440959['id'];if(_0x16f013['query'][_0x1007('0x3d')]){_0x3d21d4[_0x1007('0x3c')]=_[_0x1007('0x3e')](_0x3d21d4['where'],{'$or':_[_0x1007('0x30')](_0x3d21d4[_0x1007('0x37')],function(_0x54e4a7){var _0x38849c={};_0x38849c[_0x54e4a7]={'$like':'%'+_0x16f013['query']['filter']+'%'};return _0x38849c;})});}_0x3d21d4=_[_0x1007('0x3e')]({},_0x3d21d4,_0x16f013['options']);return db['UserFaxQueue']['findAll'](_0x3d21d4);}})[_0x1007('0x26')](function(_0x29534b){if(_0x29534b){return db[_0x1007('0x56')][_0x1007('0x57')]({'where':{'id':_[_0x1007('0x30')](_0x29534b,_0x1007('0x58')),'role':_0x1007('0x59')},'attributes':['id',_0x1007('0x2d'),_0x1007('0x5a'),_0x1007('0x5b'),'createdAt']});}})[_0x1007('0x26')](function(_0x2edfcb){if(_0x2edfcb){return{'count':_0x2edfcb[_0x1007('0x5c')],'rows':_[_0x1007('0x30')](_0x2edfcb[_0x1007('0x43')],function(_0x2852af){return{'membername':_0x2852af[_0x1007('0x2d')],'UserId':_0x2852af['id'],'queue_name':_0x172a93[_0x1007('0x2d')],'FaxQueueId':_0x172a93['id'],'interface':util[_0x1007('0x5d')](_0x1007('0x5e'),'SIP',_0x2852af[_0x1007('0x2d')]),'penalty':0x0,'paused':_0x2852af[_0x1007('0x5a')],'createdAt':_0x2852af['createdAt'],'updatedAt':_0x2852af[_0x1007('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1007('0x26')](respondWithFilteredResult(_0x4a8569,_0x3d21d4))[_0x1007('0x44')](handleError(_0x4a8569,null));};exports['getTeams']=function(_0x5df4b5,_0x20dba9,_0x1a4812){var _0x193b87={};var _0x3bff2c={};var _0x1cd3ff;var _0x35b8b4;return db[_0x1007('0x31')]['findOne']({'where':{'id':_0x5df4b5[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x20dba9,null))['then'](function(_0x446ad8){if(_0x446ad8){_0x1cd3ff=_0x446ad8;_0x3bff2c[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x5f')][_0x1007('0x32')]);_0x3bff2c[_0x1007('0x33')]=_[_0x1007('0x34')](_0x5df4b5[_0x1007('0x33')]);_0x3bff2c['filters']=_[_0x1007('0x36')](_0x3bff2c['model'],_0x3bff2c['query']);_0x193b87['attributes']=_['intersection'](_0x3bff2c['model'],qs[_0x1007('0x39')](_0x5df4b5[_0x1007('0x33')][_0x1007('0x39')]));_0x193b87['attributes']=_0x193b87[_0x1007('0x37')][_0x1007('0x3a')]?_0x193b87[_0x1007('0x37')]:_0x3bff2c[_0x1007('0x38')];_0x193b87[_0x1007('0x54')]=qs['sort'](_0x5df4b5['query'][_0x1007('0x3b')]);_0x193b87[_0x1007('0x3c')]=qs[_0x1007('0x35')](_[_0x1007('0x55')](_0x5df4b5[_0x1007('0x33')],_0x3bff2c[_0x1007('0x35')]));if(_0x5df4b5['query']['filter']){_0x193b87[_0x1007('0x3c')]=_[_0x1007('0x3e')](_0x193b87[_0x1007('0x3c')],{'$or':_[_0x1007('0x30')](_0x193b87['attributes'],function(_0x2cad3a){var _0x51d9d2={};_0x51d9d2[_0x2cad3a]={'$like':'%'+_0x5df4b5[_0x1007('0x33')][_0x1007('0x3d')]+'%'};return _0x51d9d2;})});}_0x193b87=_[_0x1007('0x3e')]({},_0x193b87,_0x5df4b5['options']);return _0x1cd3ff['getTeams'](_0x193b87);}})['then'](function(_0x222d78){if(_0x222d78){_0x35b8b4=_0x222d78['length'];if(!_0x5df4b5['query']['hasOwnProperty'](_0x1007('0x53'))){_0x193b87['limit']=qs[_0x1007('0x20')](_0x5df4b5[_0x1007('0x33')]['limit']);_0x193b87[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x5df4b5[_0x1007('0x33')][_0x1007('0x21')]);}return _0x1cd3ff['getTeams'](_0x193b87);}})[_0x1007('0x26')](function(_0x408c08){if(_0x408c08){return _0x408c08?{'count':_0x35b8b4,'rows':_0x408c08}:null;}})[_0x1007('0x26')](respondWithResult(_0x20dba9,null))['catch'](handleError(_0x20dba9,null));};exports[_0x1007('0x60')]=function(_0x5bd14d,_0x26ef1d,_0x489e7f){var _0x485acb=_0x5bd14d[_0x1007('0x49')]['ids'];return db[_0x1007('0x5f')]['findAll']({'where':{'id':_0x485acb},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1007('0x61'),'attributes':['id',_0x1007('0x2d'),_0x1007('0x62'),_0x1007('0x63'),_0x1007('0x64')],'raw':!![]}]})[_0x1007('0x26')](function(_0x5d5b26){if(_0x5d5b26){var _0x44e94a=_[_0x1007('0x65')](_0x5d5b26,function(_0x532729){var _0x513045=_0x532729[_0x1007('0x28')]({'plain':!![]});return _0x513045[_0x1007('0x61')];});return db[_0x1007('0x31')]['find']({'where':{'id':_0x5bd14d[_0x1007('0x45')]['id']}})[_0x1007('0x26')](function(_0x413469){return db[_0x1007('0x66')]['transaction'](function(_0x183c4b){return _0x413469['addTeams'](_0x485acb,{'transaction':_0x183c4b})[_0x1007('0x26')](function(){return BPromise[_0x1007('0x67')](_0x44e94a,function(_0x5f5679){return db['UserFaxQueue'][_0x1007('0x68')]({'where':{'UserId':_0x5f5679['id'],'FaxQueueId':_0x5bd14d[_0x1007('0x45')]['id']},'transaction':_0x183c4b});});})['then'](function(){_0x44e94a['forEach'](function(_0x250964){socket[_0x1007('0x69')]('userFaxQueue:save',{'UserId':_0x250964['id'],'FaxQueueId':_0x413469['id']});});});});});}})['then'](respondWithStatusCode(_0x26ef1d,null))[_0x1007('0x44')](handleError(_0x26ef1d,null));};exports[_0x1007('0x6a')]=function(_0x541d61,_0x208e3a,_0x333b73){return db[_0x1007('0x5f')]['findAll']({'where':{'id':_0x541d61[_0x1007('0x33')][_0x1007('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x1007('0x56')],'as':_0x1007('0x61'),'attributes':['id'],'raw':!![]}]})[_0x1007('0x26')](handleEntityNotFound(_0x208e3a,null))[_0x1007('0x26')](function(_0x177935){var _0xb7fe3f=_[_0x1007('0x30')](_0x177935,'id');var _0x32a471=[];var _0x39365f=[];var _0x11ba1e=squel[_0x1007('0x6c')]();_0x11ba1e['field'](_0x1007('0x6d'))[_0x1007('0x6e')](_0x1007('0x6f'),'tq')[_0x1007('0x70')]('user_has_teams','ut',_0x1007('0x71'))[_0x1007('0x3c')](_0x1007('0x72'),_0x541d61[_0x1007('0x45')]['id']);for(var _0x236c50=0x0;_0x236c50<_0x177935['length'];_0x236c50+=0x1){let _0x45158e=_0x177935[_0x236c50];for(var _0x41c6e8=0x0;_0x41c6e8<_0x45158e[_0x1007('0x61')]['length'];_0x41c6e8+=0x1){let _0x44ccaa=_0x45158e[_0x1007('0x61')][_0x41c6e8];var _0x11ffaf=_0x11ba1e['clone']();_0x11ffaf[_0x1007('0x3c')]('ut.UserId\x20=\x20?',_0x44ccaa['id']);_0x39365f[_0x1007('0x73')](db[_0x1007('0x66')]['query'](_0x11ffaf[_0x1007('0x74')](),{'type':db[_0x1007('0x66')][_0x1007('0x75')][_0x1007('0x76')]})['then'](function(_0x3f1f1c){if(_0x3f1f1c[_0x1007('0x3a')]===0x1){return _0x44ccaa['id'];}else{var _0x10bb3b=_[_0x1007('0x77')](_[_0x1007('0x30')](_0x3f1f1c,_0x1007('0x78')),function(_0x5763e6){return _['includes'](_0xb7fe3f,_0x5763e6);});if(_0x10bb3b){return _0x44ccaa['id'];}}}));}}return BPromise[_0x1007('0x79')](_0x39365f)[_0x1007('0x26')](function(_0xe5ce28){_0x32a471=_(_0x32a471)[_0x1007('0x7a')](_0xe5ce28)['compact']()['value']();return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x541d61[_0x1007('0x45')]['id']}})['then'](function(_0x260ef6){return db['sequelize'][_0x1007('0x7b')](function(_0x45e74c){return _0x260ef6['removeTeams'](_0x541d61['query'][_0x1007('0x6b')],{'transaction':_0x45e74c})['then'](function(){if(!_[_0x1007('0x7c')](_0x32a471)){return _0x260ef6[_0x1007('0x7d')](_0x32a471,{'transaction':_0x45e74c});}})['then'](function(){_0x32a471[_0x1007('0x7e')](function(_0x42d8fa){socket['emit'](_0x1007('0x7f'),{'UserId':_0x42d8fa,'FaxQueueId':_0x260ef6['id']});});});});});});})['then'](respondWithStatusCode(_0x208e3a,null))[_0x1007('0x44')](handleError(_0x208e3a,null));};exports[_0x1007('0x80')]=function(_0x16cdc1,_0x272adc,_0x4377be){return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x16cdc1[_0x1007('0x45')]['id']}})['then'](handleEntityNotFound(_0x272adc,null))[_0x1007('0x26')](function(_0x270431){if(_0x270431){return _0x270431[_0x1007('0x80')](_0x16cdc1['body'][_0x1007('0x6b')],_[_0x1007('0x81')](_0x16cdc1[_0x1007('0x49')],['ids','id'])||{})['spread'](function(_0x4f20a6){for(var _0x5bc347=0x0;_0x5bc347<_0x16cdc1['body'][_0x1007('0x6b')]['length'];_0x5bc347+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x16cdc1['body'][_0x1007('0x6b')][_0x5bc347]),'FaxQueueId':Number(_0x16cdc1[_0x1007('0x45')]['id'])});}return _0x4f20a6;});}})[_0x1007('0x26')](respondWithResult(_0x272adc,null))[_0x1007('0x44')](handleError(_0x272adc,null));};exports[_0x1007('0x7d')]=function(_0x426452,_0x30fa29,_0x1ea2c1){return db[_0x1007('0x31')][_0x1007('0x47')]({'where':{'id':_0x426452['params']['id']}})['then'](handleEntityNotFound(_0x30fa29,null))[_0x1007('0x26')](function(_0x88999d){if(_0x88999d){return _0x88999d[_0x1007('0x7d')](_0x426452[_0x1007('0x33')]['ids'])[_0x1007('0x26')](function(){if(_['isArray'](_0x426452[_0x1007('0x33')][_0x1007('0x6b')])){for(var _0x4e5e1f=0x0;_0x4e5e1f<_0x426452[_0x1007('0x33')]['ids'][_0x1007('0x3a')];_0x4e5e1f+=0x1){socket['emit'](_0x1007('0x7f'),{'UserId':Number(_0x426452[_0x1007('0x33')][_0x1007('0x6b')][_0x4e5e1f]),'FaxQueueId':Number(_0x426452[_0x1007('0x45')]['id'])});}}else{socket[_0x1007('0x69')](_0x1007('0x7f'),{'UserId':Number(_0x426452[_0x1007('0x33')][_0x1007('0x6b')]),'FaxQueueId':Number(_0x426452['params']['id'])});}});}})[_0x1007('0x26')](respondWithStatusCode(_0x30fa29,null))[_0x1007('0x44')](handleError(_0x30fa29,null));};exports[_0x1007('0x82')]=function(_0x258bcf,_0x469129,_0x4cbec0){var _0x80ddfd={};var _0x2b268a={};var _0x51eda8;var _0x57e8ee;return db[_0x1007('0x31')][_0x1007('0x50')]({'where':{'id':_0x258bcf[_0x1007('0x45')]['id']}})[_0x1007('0x26')](handleEntityNotFound(_0x469129,null))[_0x1007('0x26')](function(_0x535a18){if(_0x535a18){_0x51eda8=_0x535a18;_0x2b268a[_0x1007('0x38')]=_[_0x1007('0x34')](db[_0x1007('0x56')][_0x1007('0x32')]);_0x2b268a[_0x1007('0x33')]=_[_0x1007('0x34')](_0x258bcf[_0x1007('0x33')]);_0x2b268a[_0x1007('0x35')]=_['intersection'](_0x2b268a[_0x1007('0x38')],_0x2b268a[_0x1007('0x33')]);_0x80ddfd[_0x1007('0x37')]=_[_0x1007('0x36')](_0x2b268a[_0x1007('0x38')],qs[_0x1007('0x39')](_0x258bcf[_0x1007('0x33')][_0x1007('0x39')]));_0x80ddfd[_0x1007('0x37')]=_0x80ddfd[_0x1007('0x37')][_0x1007('0x3a')]?_0x80ddfd[_0x1007('0x37')]:_0x2b268a['model'];_0x80ddfd[_0x1007('0x54')]=qs[_0x1007('0x3b')](_0x258bcf[_0x1007('0x33')]['sort']);_0x80ddfd[_0x1007('0x3c')]=qs[_0x1007('0x35')](_[_0x1007('0x55')](_0x258bcf[_0x1007('0x33')],_0x2b268a[_0x1007('0x35')]));if(_0x258bcf[_0x1007('0x33')][_0x1007('0x3d')]){_0x80ddfd['where']=_['merge'](_0x80ddfd[_0x1007('0x3c')],{'$or':_[_0x1007('0x30')](_0x80ddfd[_0x1007('0x37')],function(_0x1a4647){var _0x5cffb8={};_0x5cffb8[_0x1a4647]={'$like':'%'+_0x258bcf[_0x1007('0x33')][_0x1007('0x3d')]+'%'};return _0x5cffb8;})});}_0x80ddfd=_[_0x1007('0x3e')]({},_0x80ddfd,_0x258bcf[_0x1007('0x40')]);return _0x51eda8[_0x1007('0x82')](_0x80ddfd);}})[_0x1007('0x26')](function(_0x497b95){if(_0x497b95){_0x57e8ee=_0x497b95[_0x1007('0x3a')];if(!_0x258bcf[_0x1007('0x33')]['hasOwnProperty'](_0x1007('0x53'))){_0x80ddfd['limit']=qs[_0x1007('0x20')](_0x258bcf['query'][_0x1007('0x20')]);_0x80ddfd[_0x1007('0x21')]=qs[_0x1007('0x21')](_0x258bcf[_0x1007('0x33')][_0x1007('0x21')]);}return _0x51eda8[_0x1007('0x82')](_0x80ddfd);}})[_0x1007('0x26')](function(_0x5c3353){if(_0x5c3353){return _0x5c3353?{'count':_0x57e8ee,'rows':_0x5c3353}:null;}})[_0x1007('0x26')](respondWithResult(_0x469129,null))['catch'](handleError(_0x469129,null));}; \ No newline at end of file +var _0x922d=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','sendStatus','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','sequelize','isEmpty','removeAgents','forEach','omit','spread','userFaxQueue:save','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x26bd9d,_0x123c84){var _0x4b9731=function(_0x59642c){while(--_0x59642c){_0x26bd9d['push'](_0x26bd9d['shift']());}};_0x4b9731(++_0x123c84);}(_0x922d,0x1a9));var _0xd922=function(_0x10d842,_0x544cf5){_0x10d842=_0x10d842-0x0;var _0x106c41=_0x922d[_0x10d842];return _0x106c41;};'use strict';var emlformat=require(_0xd922('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd922('0x1'));var jsonpatch=require(_0xd922('0x2'));var rp=require('request-promise');var moment=require(_0xd922('0x3'));var BPromise=require(_0xd922('0x4'));var Mustache=require(_0xd922('0x5'));var util=require(_0xd922('0x6'));var path=require(_0xd922('0x7'));var sox=require(_0xd922('0x8'));var csv=require(_0xd922('0x9'));var ejs=require(_0xd922('0xa'));var fs=require('fs');var fs_extra=require(_0xd922('0xb'));var _=require(_0xd922('0xc'));var squel=require(_0xd922('0xd'));var crypto=require(_0xd922('0xe'));var jsforce=require(_0xd922('0xf'));var deskjs=require(_0xd922('0x10'));var toCsv=require(_0xd922('0x9'));var querystring=require(_0xd922('0x11'));var Papa=require(_0xd922('0x12'));var Redis=require(_0xd922('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd922('0x14'));var as=require(_0xd922('0x15'));var hardwareService=require(_0xd922('0x16'));var logger=require(_0xd922('0x17'))(_0xd922('0x18'));var utils=require(_0xd922('0x19'));var config=require(_0xd922('0x1a'));var licenseUtil=require(_0xd922('0x1b'));var db=require(_0xd922('0x1c'))['db'];config[_0xd922('0x1d')]=_[_0xd922('0x1e')](config[_0xd922('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd922('0x1d')]));require(_0xd922('0x1f'))[_0xd922('0x20')](socket);function respondWithStatusCode(_0x5a0295,_0x36f966){_0x36f966=_0x36f966||0xcc;return function(_0xb62ff9){if(_0xb62ff9){return _0x5a0295['sendStatus'](_0x36f966);}return _0x5a0295[_0xd922('0x21')](_0x36f966)[_0xd922('0x22')]();};}function respondWithResult(_0x2a67c5,_0x4f3bf1){_0x4f3bf1=_0x4f3bf1||0xc8;return function(_0x25cd38){if(_0x25cd38){return _0x2a67c5[_0xd922('0x21')](_0x4f3bf1)[_0xd922('0x23')](_0x25cd38);}};}function respondWithFilteredResult(_0x1bd738,_0x2f17c1){return function(_0x3709d9){if(_0x3709d9){var _0x56257c=typeof _0x2f17c1[_0xd922('0x24')]===_0xd922('0x25')&&typeof _0x2f17c1[_0xd922('0x26')]===_0xd922('0x25');var _0x36fcf6=_0x3709d9[_0xd922('0x27')];var _0x3a861b=_0x56257c?0x0:_0x2f17c1[_0xd922('0x24')];var _0x4ffdef=_0x56257c?_0x3709d9[_0xd922('0x27')]:_0x2f17c1[_0xd922('0x24')]+_0x2f17c1[_0xd922('0x26')];var _0x5ab0cb;if(_0x4ffdef>=_0x36fcf6){_0x4ffdef=_0x36fcf6;_0x5ab0cb=0xc8;}else{_0x5ab0cb=0xce;}_0x1bd738[_0xd922('0x21')](_0x5ab0cb);return _0x1bd738[_0xd922('0x28')]('Content-Range',_0x3a861b+'-'+_0x4ffdef+'/'+_0x36fcf6)[_0xd922('0x23')](_0x3709d9);}return null;};}function patchUpdates(_0x4befe7){return function(_0x2ccdf7){try{jsonpatch[_0xd922('0x29')](_0x2ccdf7,_0x4befe7,!![]);}catch(_0xd595d8){return BPromise[_0xd922('0x2a')](_0xd595d8);}return _0x2ccdf7[_0xd922('0x2b')]();};}function saveUpdates(_0x43bf7e,_0x46d51e){return function(_0x373793){if(_0x373793){return _0x373793[_0xd922('0x2c')](_0x43bf7e)[_0xd922('0x2d')](function(_0x2423ca){return _0x2423ca;});}return null;};}function removeEntity(_0x1aa38e,_0x11ed24){return function(_0x136ca2){if(_0x136ca2){return _0x136ca2['destroy']()[_0xd922('0x2d')](function(){var _0x235f8b=_0x136ca2[_0xd922('0x2e')]({'plain':!![]});var _0x29169b='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x29169b,'resourceId':_0x235f8b['id']}})[_0xd922('0x2d')](function(){return _0x136ca2;});})[_0xd922('0x2d')](function(){_0x1aa38e[_0xd922('0x21')](0xcc)[_0xd922('0x22')]();});}};}function handleEntityNotFound(_0x7aad5,_0x42259a){return function(_0x2e42e0){if(!_0x2e42e0){_0x7aad5[_0xd922('0x2f')](0x194);}return _0x2e42e0;};}function handleError(_0x570d27,_0x516e09){_0x516e09=_0x516e09||0x1f4;return function(_0x56366a){logger['error'](_0x56366a[_0xd922('0x30')]);if(_0x56366a[_0xd922('0x31')]){delete _0x56366a['name'];}_0x570d27[_0xd922('0x21')](_0x516e09)[_0xd922('0x32')](_0x56366a);};}exports[_0xd922('0x33')]=function(_0x4879dc,_0x391147){var _0x1380f6={},_0x55428e={},_0x514e1d={'count':0x0,'rows':[]};var _0x531736=_[_0xd922('0x34')](db[_0xd922('0x35')][_0xd922('0x36')],function(_0x4d729d){return{'name':_0x4d729d[_0xd922('0x37')],'type':_0x4d729d[_0xd922('0x38')][_0xd922('0x39')]};});_0x55428e[_0xd922('0x3a')]=_['map'](_0x531736,'name');_0x55428e[_0xd922('0x3b')]=_[_0xd922('0x3c')](_0x4879dc['query']);_0x55428e[_0xd922('0x3d')]=_[_0xd922('0x3e')](_0x55428e['model'],_0x55428e['query']);_0x1380f6[_0xd922('0x3f')]=_['intersection'](_0x55428e[_0xd922('0x3a')],qs[_0xd922('0x40')](_0x4879dc[_0xd922('0x3b')][_0xd922('0x40')]));_0x1380f6[_0xd922('0x3f')]=_0x1380f6['attributes']['length']?_0x1380f6['attributes']:_0x55428e['model'];if(!_0x4879dc[_0xd922('0x3b')][_0xd922('0x41')]('nolimit')){_0x1380f6[_0xd922('0x26')]=qs[_0xd922('0x26')](_0x4879dc[_0xd922('0x3b')][_0xd922('0x26')]);_0x1380f6[_0xd922('0x24')]=qs[_0xd922('0x24')](_0x4879dc['query'][_0xd922('0x24')]);}_0x1380f6[_0xd922('0x42')]=qs[_0xd922('0x43')](_0x4879dc[_0xd922('0x3b')]['sort']);_0x1380f6['where']=qs[_0xd922('0x3d')](_[_0xd922('0x44')](_0x4879dc[_0xd922('0x3b')],_0x55428e['filters']),_0x531736);if(_0x4879dc[_0xd922('0x3b')][_0xd922('0x45')]){_0x1380f6[_0xd922('0x46')]=_[_0xd922('0x47')](_0x1380f6[_0xd922('0x46')],{'$or':_[_0xd922('0x34')](_0x531736,function(_0x8d900a){if(_0x8d900a[_0xd922('0x38')]!==_0xd922('0x48')){var _0x58ccb1={};_0x58ccb1[_0x8d900a['name']]={'$like':'%'+_0x4879dc[_0xd922('0x3b')][_0xd922('0x45')]+'%'};return _0x58ccb1;}})});}_0x1380f6=_[_0xd922('0x47')]({},_0x1380f6,_0x4879dc[_0xd922('0x49')]);var _0x233ccd={'where':_0x1380f6['where']};return db[_0xd922('0x35')][_0xd922('0x27')](_0x233ccd)[_0xd922('0x2d')](function(_0x12bba7){_0x514e1d['count']=_0x12bba7;if(_0x4879dc[_0xd922('0x3b')][_0xd922('0x4a')]){_0x1380f6[_0xd922('0x4b')]=[{'all':!![]}];}return db[_0xd922('0x35')][_0xd922('0x4c')](_0x1380f6);})['then'](function(_0x30c4fd){_0x514e1d[_0xd922('0x4d')]=_0x30c4fd;return _0x514e1d;})['then'](respondWithFilteredResult(_0x391147,_0x1380f6))[_0xd922('0x4e')](handleError(_0x391147,null));};exports['show']=function(_0x3410d6,_0x2398c9){var _0x200223={'raw':!![],'where':{'id':_0x3410d6[_0xd922('0x4f')]['id']}},_0x527891={};_0x527891[_0xd922('0x3a')]=_['keys'](db['FaxQueue'][_0xd922('0x36')]);_0x527891[_0xd922('0x3b')]=_['keys'](_0x3410d6['query']);_0x527891[_0xd922('0x3d')]=_[_0xd922('0x3e')](_0x527891[_0xd922('0x3a')],_0x527891[_0xd922('0x3b')]);_0x200223[_0xd922('0x3f')]=_[_0xd922('0x3e')](_0x527891['model'],qs[_0xd922('0x40')](_0x3410d6[_0xd922('0x3b')][_0xd922('0x40')]));_0x200223[_0xd922('0x3f')]=_0x200223[_0xd922('0x3f')][_0xd922('0x50')]?_0x200223['attributes']:_0x527891[_0xd922('0x3a')];if(_0x3410d6[_0xd922('0x3b')]['includeAll']){_0x200223[_0xd922('0x4b')]=[{'all':!![]}];}_0x200223=_[_0xd922('0x47')]({},_0x200223,_0x3410d6[_0xd922('0x49')]);return db[_0xd922('0x35')][_0xd922('0x51')](_0x200223)[_0xd922('0x2d')](handleEntityNotFound(_0x2398c9,null))['then'](respondWithResult(_0x2398c9,null))['catch'](handleError(_0x2398c9,null));};exports['create']=function(_0x11b797,_0x188c46){return db[_0xd922('0x35')][_0xd922('0x52')](_0x11b797[_0xd922('0x53')],{})[_0xd922('0x2d')](function(_0x1ea6f5){var _0x332881=_0x11b797['user']['get']({'plain':!![]});if(!_0x332881)throw new Error(_0xd922('0x54'));if(_0x332881[_0xd922('0x55')]===_0xd922('0x56')){var _0x27ce13=_0x1ea6f5[_0xd922('0x2e')]({'plain':!![]});var _0xf0410b=_0xd922('0x57');return db[_0xd922('0x58')][_0xd922('0x51')]({'where':{'name':_0xf0410b,'userProfileId':_0x332881['userProfileId']},'raw':!![]})['then'](function(_0x5aa354){if(_0x5aa354&&_0x5aa354['autoAssociation']===0x0){return db['UserProfileResource'][_0xd922('0x52')]({'name':_0x27ce13['name'],'resourceId':_0x27ce13['id'],'type':_0x5aa354[_0xd922('0x31')],'sectionId':_0x5aa354['id']},{})[_0xd922('0x2d')](function(){return _0x1ea6f5;});}else{return _0x1ea6f5;}})[_0xd922('0x4e')](function(_0x32d38f){logger['error'](_0xd922('0x59'),_0x32d38f);throw _0x32d38f;});}return _0x1ea6f5;})[_0xd922('0x2d')](respondWithResult(_0x188c46,0xc9))[_0xd922('0x4e')](handleError(_0x188c46,null));};exports['update']=function(_0x193032,_0x57ed5e){if(_0x193032[_0xd922('0x53')]['id']){delete _0x193032[_0xd922('0x53')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x193032[_0xd922('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57ed5e,null))[_0xd922('0x2d')](saveUpdates(_0x193032[_0xd922('0x53')],null))[_0xd922('0x2d')](respondWithResult(_0x57ed5e,null))[_0xd922('0x4e')](handleError(_0x57ed5e,null));};exports['destroy']=function(_0x42d6a0,_0x5410c6){return db[_0xd922('0x35')][_0xd922('0x51')]({'where':{'id':_0x42d6a0['params']['id']}})[_0xd922('0x2d')](handleEntityNotFound(_0x5410c6,null))['then'](removeEntity(_0x5410c6,null))[_0xd922('0x4e')](handleError(_0x5410c6,null));};exports[_0xd922('0x5a')]=function(_0x14595e,_0x20f286){return db[_0xd922('0x35')][_0xd922('0x5a')]()[_0xd922('0x2d')](respondWithResult(_0x20f286,null))[_0xd922('0x4e')](handleError(_0x20f286,null));};exports[_0xd922('0x5b')]=function(_0xe041ca,_0x217925,_0x4038e0){var _0x31e544={'raw':!![],'where':{}},_0x1436b3={},_0x334ea4;return db['FaxQueue'][_0xd922('0x5c')]({'where':{'id':_0xe041ca[_0xd922('0x4f')]['id']}})[_0xd922('0x2d')](handleEntityNotFound(_0x217925,null))[_0xd922('0x2d')](function(_0x27c798){if(_0x27c798){_0x334ea4=_0x27c798[_0xd922('0x2e')]({'plain':!![]});_0x1436b3[_0xd922('0x3a')]=_[_0xd922('0x3c')](db[_0xd922('0x5d')][_0xd922('0x36')]);_0x1436b3[_0xd922('0x3b')]=_[_0xd922('0x3c')](_0xe041ca[_0xd922('0x3b')]);_0x1436b3[_0xd922('0x3d')]=_[_0xd922('0x3e')](_0x1436b3[_0xd922('0x3a')],_0x1436b3[_0xd922('0x3b')]);_0x31e544[_0xd922('0x3f')]=_['intersection'](_0x1436b3[_0xd922('0x3a')],qs[_0xd922('0x40')](_0xe041ca[_0xd922('0x3b')][_0xd922('0x40')]));_0x31e544[_0xd922('0x3f')]=_0x31e544[_0xd922('0x3f')][_0xd922('0x50')]?_0x31e544[_0xd922('0x3f')]:_0x1436b3[_0xd922('0x3a')];if(!_0xe041ca['query'][_0xd922('0x41')]('nolimit')){_0x31e544[_0xd922('0x26')]=qs[_0xd922('0x26')](_0xe041ca[_0xd922('0x3b')]['limit']);_0x31e544[_0xd922('0x24')]=qs[_0xd922('0x24')](_0xe041ca[_0xd922('0x3b')]['offset']);}_0x31e544[_0xd922('0x42')]=qs['sort'](_0xe041ca['query'][_0xd922('0x43')]);_0x31e544[_0xd922('0x46')]=qs[_0xd922('0x3d')](_[_0xd922('0x44')](_0xe041ca[_0xd922('0x3b')],_0x1436b3[_0xd922('0x3d')]));_0x31e544[_0xd922('0x46')][_0xd922('0x5e')]=_0x27c798['id'];if(_0xe041ca[_0xd922('0x3b')]['filter']){_0x31e544[_0xd922('0x46')]=_[_0xd922('0x47')](_0x31e544[_0xd922('0x46')],{'$or':_[_0xd922('0x34')](_0x31e544[_0xd922('0x3f')],function(_0x1c3941){var _0xee6fd2={};_0xee6fd2[_0x1c3941]={'$like':'%'+_0xe041ca['query'][_0xd922('0x45')]+'%'};return _0xee6fd2;})});}_0x31e544=_[_0xd922('0x47')]({},_0x31e544,_0xe041ca['options']);return db[_0xd922('0x5d')][_0xd922('0x4c')](_0x31e544);}})[_0xd922('0x2d')](function(_0x75ccd){if(_0x75ccd){return db[_0xd922('0x5f')][_0xd922('0x60')]({'where':{'id':_[_0xd922('0x34')](_0x75ccd,'UserId'),'role':_0xd922('0x61')},'attributes':['id',_0xd922('0x31'),_0xd922('0x62'),_0xd922('0x63'),_0xd922('0x64')]});}})['then'](function(_0x5830a2){if(_0x5830a2){return{'count':_0x5830a2[_0xd922('0x27')],'rows':_['map'](_0x5830a2[_0xd922('0x4d')],function(_0x42a73f){return{'membername':_0x42a73f[_0xd922('0x31')],'UserId':_0x42a73f['id'],'queue_name':_0x334ea4[_0xd922('0x31')],'FaxQueueId':_0x334ea4['id'],'interface':util[_0xd922('0x65')](_0xd922('0x66'),_0xd922('0x67'),_0x42a73f[_0xd922('0x31')]),'penalty':0x0,'paused':_0x42a73f[_0xd922('0x62')],'createdAt':_0x42a73f[_0xd922('0x64')],'updatedAt':_0x42a73f[_0xd922('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd922('0x2d')](respondWithFilteredResult(_0x217925,_0x31e544))[_0xd922('0x4e')](handleError(_0x217925,null));};exports[_0xd922('0x68')]=function(_0xe151dc,_0x2bd2ee,_0xe83f2){var _0x1bbcc2={};var _0x414e1e={};var _0x563db0;var _0x27cdf0;return db[_0xd922('0x35')][_0xd922('0x5c')]({'where':{'id':_0xe151dc[_0xd922('0x4f')]['id']}})[_0xd922('0x2d')](handleEntityNotFound(_0x2bd2ee,null))[_0xd922('0x2d')](function(_0x53e944){if(_0x53e944){_0x563db0=_0x53e944;_0x414e1e[_0xd922('0x3a')]=_[_0xd922('0x3c')](db[_0xd922('0x69')][_0xd922('0x36')]);_0x414e1e[_0xd922('0x3b')]=_['keys'](_0xe151dc[_0xd922('0x3b')]);_0x414e1e['filters']=_[_0xd922('0x3e')](_0x414e1e[_0xd922('0x3a')],_0x414e1e['query']);_0x1bbcc2[_0xd922('0x3f')]=_[_0xd922('0x3e')](_0x414e1e[_0xd922('0x3a')],qs[_0xd922('0x40')](_0xe151dc[_0xd922('0x3b')][_0xd922('0x40')]));_0x1bbcc2[_0xd922('0x3f')]=_0x1bbcc2[_0xd922('0x3f')][_0xd922('0x50')]?_0x1bbcc2['attributes']:_0x414e1e[_0xd922('0x3a')];_0x1bbcc2[_0xd922('0x42')]=qs[_0xd922('0x43')](_0xe151dc['query'][_0xd922('0x43')]);_0x1bbcc2[_0xd922('0x46')]=qs[_0xd922('0x3d')](_[_0xd922('0x44')](_0xe151dc[_0xd922('0x3b')],_0x414e1e[_0xd922('0x3d')]));if(_0xe151dc[_0xd922('0x3b')][_0xd922('0x45')]){_0x1bbcc2[_0xd922('0x46')]=_[_0xd922('0x47')](_0x1bbcc2[_0xd922('0x46')],{'$or':_[_0xd922('0x34')](_0x1bbcc2['attributes'],function(_0x449d59){var _0x4f9e73={};_0x4f9e73[_0x449d59]={'$like':'%'+_0xe151dc[_0xd922('0x3b')]['filter']+'%'};return _0x4f9e73;})});}_0x1bbcc2=_[_0xd922('0x47')]({},_0x1bbcc2,_0xe151dc[_0xd922('0x49')]);return _0x563db0[_0xd922('0x68')](_0x1bbcc2);}})[_0xd922('0x2d')](function(_0x560604){if(_0x560604){_0x27cdf0=_0x560604['length'];if(!_0xe151dc[_0xd922('0x3b')]['hasOwnProperty'](_0xd922('0x6a'))){_0x1bbcc2[_0xd922('0x26')]=qs[_0xd922('0x26')](_0xe151dc[_0xd922('0x3b')][_0xd922('0x26')]);_0x1bbcc2[_0xd922('0x24')]=qs[_0xd922('0x24')](_0xe151dc[_0xd922('0x3b')]['offset']);}return _0x563db0['getTeams'](_0x1bbcc2);}})[_0xd922('0x2d')](function(_0x4ffc34){if(_0x4ffc34){return _0x4ffc34?{'count':_0x27cdf0,'rows':_0x4ffc34}:null;}})[_0xd922('0x2d')](respondWithResult(_0x2bd2ee,null))[_0xd922('0x4e')](handleError(_0x2bd2ee,null));};exports[_0xd922('0x6b')]=function(_0x242fe8,_0x401f82,_0x395f18){var _0x47034e=_0x242fe8[_0xd922('0x53')][_0xd922('0x6c')];return db[_0xd922('0x69')][_0xd922('0x4c')]({'where':{'id':_0x47034e},'attributes':['id'],'include':[{'model':db[_0xd922('0x5f')],'as':_0xd922('0x6d'),'attributes':['id',_0xd922('0x31'),_0xd922('0x6e'),_0xd922('0x6f'),_0xd922('0x70')],'raw':!![]}]})[_0xd922('0x2d')](function(_0x8cc5c1){if(_0x8cc5c1){var _0x1b30d9=_[_0xd922('0x71')](_0x8cc5c1,function(_0x2f8484){var _0x517b5a=_0x2f8484['get']({'plain':!![]});return _0x517b5a[_0xd922('0x6d')];});return db[_0xd922('0x35')]['find']({'where':{'id':_0x242fe8['params']['id']}})[_0xd922('0x2d')](function(_0x1e1824){return db['sequelize'][_0xd922('0x72')](function(_0x44f1ad){return _0x1e1824['addTeams'](_0x47034e,{'transaction':_0x44f1ad})[_0xd922('0x2d')](function(){return BPromise[_0xd922('0x73')](_0x1b30d9,function(_0x592a31){return db[_0xd922('0x5d')]['findOrCreate']({'where':{'UserId':_0x592a31['id'],'FaxQueueId':_0x242fe8[_0xd922('0x4f')]['id']},'transaction':_0x44f1ad});});})['then'](function(){_0x1b30d9['forEach'](function(_0x5ad97f){socket[_0xd922('0x74')]('userFaxQueue:save',{'UserId':_0x5ad97f['id'],'FaxQueueId':_0x1e1824['id']});});});});});}})[_0xd922('0x2d')](respondWithStatusCode(_0x401f82,null))['catch'](handleError(_0x401f82,null));};exports[_0xd922('0x75')]=function(_0x306a2d,_0x20ab3f,_0x53ea25){return db[_0xd922('0x69')][_0xd922('0x4c')]({'where':{'id':_0x306a2d['query'][_0xd922('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xd922('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x20ab3f,null))['then'](function(_0x2ff754){var _0xeb370e=_[_0xd922('0x34')](_0x2ff754,'id');var _0x3e4928=[];var _0x41b064=[];var _0x574fd8=squel[_0xd922('0x76')]();_0x574fd8[_0xd922('0x77')](_0xd922('0x78'))[_0xd922('0x79')](_0xd922('0x7a'),'tq')[_0xd922('0x7b')]('user_has_teams','ut',_0xd922('0x7c'))[_0xd922('0x46')](_0xd922('0x7d'),_0x306a2d[_0xd922('0x4f')]['id']);for(var _0x30ba61=0x0;_0x30ba61<_0x2ff754[_0xd922('0x50')];_0x30ba61+=0x1){let _0x3a9420=_0x2ff754[_0x30ba61];for(var _0x5b1180=0x0;_0x5b1180<_0x3a9420[_0xd922('0x6d')][_0xd922('0x50')];_0x5b1180+=0x1){let _0x356c2d=_0x3a9420[_0xd922('0x6d')][_0x5b1180];var _0x5ecac6=_0x574fd8['clone']();_0x5ecac6[_0xd922('0x46')](_0xd922('0x7e'),_0x356c2d['id']);_0x41b064[_0xd922('0x7f')](db['sequelize'][_0xd922('0x3b')](_0x5ecac6['toString'](),{'type':db['sequelize'][_0xd922('0x80')][_0xd922('0x81')]})[_0xd922('0x2d')](function(_0x3c8888){if(_0x3c8888[_0xd922('0x50')]===0x1){return _0x356c2d['id'];}else{var _0x505320=_[_0xd922('0x82')](_[_0xd922('0x34')](_0x3c8888,_0xd922('0x83')),function(_0x34c810){return _[_0xd922('0x84')](_0xeb370e,_0x34c810);});if(_0x505320){return _0x356c2d['id'];}}}));}}return BPromise['all'](_0x41b064)[_0xd922('0x2d')](function(_0xd0bd8f){_0x3e4928=_(_0x3e4928)[_0xd922('0x85')](_0xd0bd8f)[_0xd922('0x86')]()['value']();return db[_0xd922('0x35')][_0xd922('0x51')]({'where':{'id':_0x306a2d[_0xd922('0x4f')]['id']}})[_0xd922('0x2d')](function(_0x3e9fb2){return db[_0xd922('0x87')]['transaction'](function(_0x3a49d0){return _0x3e9fb2[_0xd922('0x75')](_0x306a2d['query'][_0xd922('0x6c')],{'transaction':_0x3a49d0})['then'](function(){if(!_[_0xd922('0x88')](_0x3e4928)){return _0x3e9fb2[_0xd922('0x89')](_0x3e4928,{'transaction':_0x3a49d0});}})[_0xd922('0x2d')](function(){_0x3e4928[_0xd922('0x8a')](function(_0x4b0c6d){socket[_0xd922('0x74')]('userFaxQueue:remove',{'UserId':_0x4b0c6d,'FaxQueueId':_0x3e9fb2['id']});});});});});});})[_0xd922('0x2d')](respondWithStatusCode(_0x20ab3f,null))['catch'](handleError(_0x20ab3f,null));};exports['addAgents']=function(_0x1af56d,_0x52a497,_0x3d027c){return db[_0xd922('0x35')][_0xd922('0x51')]({'where':{'id':_0x1af56d[_0xd922('0x4f')]['id']}})[_0xd922('0x2d')](handleEntityNotFound(_0x52a497,null))[_0xd922('0x2d')](function(_0x17c842){if(_0x17c842){return _0x17c842['addAgents'](_0x1af56d[_0xd922('0x53')][_0xd922('0x6c')],_[_0xd922('0x8b')](_0x1af56d[_0xd922('0x53')],[_0xd922('0x6c'),'id'])||{})[_0xd922('0x8c')](function(_0x51ef18){for(var _0x96cd54=0x0;_0x96cd54<_0x1af56d[_0xd922('0x53')][_0xd922('0x6c')][_0xd922('0x50')];_0x96cd54+=0x1){socket[_0xd922('0x74')](_0xd922('0x8d'),{'UserId':Number(_0x1af56d[_0xd922('0x53')]['ids'][_0x96cd54]),'FaxQueueId':Number(_0x1af56d['params']['id'])});}return _0x51ef18;});}})[_0xd922('0x2d')](respondWithResult(_0x52a497,null))[_0xd922('0x4e')](handleError(_0x52a497,null));};exports[_0xd922('0x89')]=function(_0x178227,_0x2291ed,_0xa4de2){return db[_0xd922('0x35')][_0xd922('0x51')]({'where':{'id':_0x178227[_0xd922('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2291ed,null))['then'](function(_0x2ebc94){if(_0x2ebc94){return _0x2ebc94[_0xd922('0x89')](_0x178227['query']['ids'])[_0xd922('0x2d')](function(){if(_['isArray'](_0x178227[_0xd922('0x3b')]['ids'])){for(var _0x3ead58=0x0;_0x3ead58<_0x178227[_0xd922('0x3b')][_0xd922('0x6c')][_0xd922('0x50')];_0x3ead58+=0x1){socket[_0xd922('0x74')](_0xd922('0x8e'),{'UserId':Number(_0x178227[_0xd922('0x3b')][_0xd922('0x6c')][_0x3ead58]),'FaxQueueId':Number(_0x178227['params']['id'])});}}else{socket['emit'](_0xd922('0x8e'),{'UserId':Number(_0x178227[_0xd922('0x3b')][_0xd922('0x6c')]),'FaxQueueId':Number(_0x178227['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2291ed,null))['catch'](handleError(_0x2291ed,null));};exports['getAgents']=function(_0x2bce2e,_0x5c5d08,_0x4ac72f){var _0x35036a={};var _0x129c08={};var _0x17de56;var _0x5912e2;return db[_0xd922('0x35')][_0xd922('0x5c')]({'where':{'id':_0x2bce2e[_0xd922('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c5d08,null))[_0xd922('0x2d')](function(_0x5d7bbf){if(_0x5d7bbf){_0x17de56=_0x5d7bbf;_0x129c08[_0xd922('0x3a')]=_[_0xd922('0x3c')](db[_0xd922('0x5f')][_0xd922('0x36')]);_0x129c08['query']=_['keys'](_0x2bce2e[_0xd922('0x3b')]);_0x129c08[_0xd922('0x3d')]=_[_0xd922('0x3e')](_0x129c08['model'],_0x129c08[_0xd922('0x3b')]);_0x35036a[_0xd922('0x3f')]=_[_0xd922('0x3e')](_0x129c08[_0xd922('0x3a')],qs[_0xd922('0x40')](_0x2bce2e[_0xd922('0x3b')]['fields']));_0x35036a[_0xd922('0x3f')]=_0x35036a[_0xd922('0x3f')]['length']?_0x35036a['attributes']:_0x129c08[_0xd922('0x3a')];_0x35036a[_0xd922('0x42')]=qs[_0xd922('0x43')](_0x2bce2e['query'][_0xd922('0x43')]);_0x35036a[_0xd922('0x46')]=qs[_0xd922('0x3d')](_['pick'](_0x2bce2e[_0xd922('0x3b')],_0x129c08[_0xd922('0x3d')]));if(_0x2bce2e[_0xd922('0x3b')]['filter']){_0x35036a[_0xd922('0x46')]=_['merge'](_0x35036a[_0xd922('0x46')],{'$or':_[_0xd922('0x34')](_0x35036a[_0xd922('0x3f')],function(_0x349e3c){var _0x57a366={};_0x57a366[_0x349e3c]={'$like':'%'+_0x2bce2e['query']['filter']+'%'};return _0x57a366;})});}_0x35036a=_[_0xd922('0x47')]({},_0x35036a,_0x2bce2e['options']);return _0x17de56[_0xd922('0x8f')](_0x35036a);}})[_0xd922('0x2d')](function(_0x5b7681){if(_0x5b7681){_0x5912e2=_0x5b7681[_0xd922('0x50')];if(!_0x2bce2e[_0xd922('0x3b')][_0xd922('0x41')]('nolimit')){_0x35036a[_0xd922('0x26')]=qs[_0xd922('0x26')](_0x2bce2e[_0xd922('0x3b')][_0xd922('0x26')]);_0x35036a['offset']=qs[_0xd922('0x24')](_0x2bce2e['query'][_0xd922('0x24')]);}return _0x17de56[_0xd922('0x8f')](_0x35036a);}})[_0xd922('0x2d')](function(_0x4681a1){if(_0x4681a1){return _0x4681a1?{'count':_0x5912e2,'rows':_0x4681a1}:null;}})[_0xd922('0x2d')](respondWithResult(_0x5c5d08,null))[_0xd922('0x4e')](handleError(_0x5c5d08,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b803ee9..65de135 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 _0x189f=['exports','../../mysqldb','FaxQueue','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x7ab10d,_0x50ac6f){var _0x2c24cc=function(_0x55f11c){while(--_0x55f11c){_0x7ab10d['push'](_0x7ab10d['shift']());}};_0x2c24cc(++_0x50ac6f);}(_0x189f,0x189));var _0xf189=function(_0x288267,_0x12e1e3){_0x288267=_0x288267-0x0;var _0x5b245c=_0x189f[_0x288267];return _0x5b245c;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xf189('0x0'))['db'][_0xf189('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf189('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf189('0x3'),'afterDestroy':_0xf189('0x4')};function emitEvent(_0x245907){return function(_0x3d7b52,_0x53cb30,_0x4727da){FaxQueueEvents['emit'](_0x245907+':'+_0x3d7b52['id'],_0x3d7b52);FaxQueueEvents['emit'](_0x245907,_0x3d7b52);_0x4727da(null);};}for(var e in events){if(events[_0xf189('0x5')](e)){var event=events[e];FaxQueue[_0xf189('0x6')](e,emitEvent(event));}}module[_0xf189('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xad14=['hasOwnProperty','hook','exports','events','save','remove','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad14,0x73));var _0x4ad1=function(_0x4315f7,_0x5e14ed){_0x4315f7=_0x4315f7-0x0;var _0x3d7aea=_0xad14[_0x4315f7];return _0x3d7aea;};'use strict';var EventEmitter=require(_0x4ad1('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ad1('0x1'),'afterUpdate':'update','afterDestroy':_0x4ad1('0x2')};function emitEvent(_0x1236c7){return function(_0x24b9d4,_0x5a2e6a,_0x13d9f1){FaxQueueEvents['emit'](_0x1236c7+':'+_0x24b9d4['id'],_0x24b9d4);FaxQueueEvents[_0x4ad1('0x3')](_0x1236c7,_0x24b9d4);_0x13d9f1(null);};}for(var e in events){if(events[_0x4ad1('0x4')](e)){var event=events[e];FaxQueue[_0x4ad1('0x5')](e,emitEvent(event));}}module[_0x4ad1('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index ae014e4..7820701 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 _0x1a9e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxQueue.attributes','define','FaxQueue','lodash'];(function(_0x201947,_0x4182e0){var _0x577ead=function(_0x25c45b){while(--_0x25c45b){_0x201947['push'](_0x201947['shift']());}};_0x577ead(++_0x4182e0);}(_0x1a9e,0x18b));var _0xe1a9=function(_0x1d6b5c,_0x264959){_0x1d6b5c=_0x1d6b5c-0x0;var _0x464b42=_0x1a9e[_0x1d6b5c];return _0x464b42;};'use strict';var _=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var logger=require(_0xe1a9('0x2'))(_0xe1a9('0x3'));var moment=require(_0xe1a9('0x4'));var BPromise=require(_0xe1a9('0x5'));var rp=require(_0xe1a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1a9('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1a9('0x8'));module['exports']=function(_0x1f1061,_0xd3c7d6){return _0x1f1061[_0xe1a9('0x9')](_0xe1a9('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c08=['fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxQueue.attributes','exports','FaxQueue'];(function(_0x5c43e1,_0x4c1705){var _0x397fa7=function(_0x4485e8){while(--_0x4485e8){_0x5c43e1['push'](_0x5c43e1['shift']());}};_0x397fa7(++_0x4c1705);}(_0x6c08,0x1e1));var _0x86c0=function(_0xf5a153,_0x2aead6){_0xf5a153=_0xf5a153-0x0;var _0x3f9111=_0x6c08[_0xf5a153];return _0x3f9111;};'use strict';var _=require(_0x86c0('0x0'));var util=require(_0x86c0('0x1'));var logger=require(_0x86c0('0x2'))(_0x86c0('0x3'));var moment=require(_0x86c0('0x4'));var BPromise=require(_0x86c0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86c0('0x6'));var rimraf=require(_0x86c0('0x7'));var config=require('../../config/environment');var attributes=require(_0x86c0('0x8'));module[_0x86c0('0x9')]=function(_0x59082c,_0x55b025){return _0x59082c['define'](_0x86c0('0xa'),attributes,{'tableName':_0x86c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 041c118..231ff1f 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 _0xbf97=['client','http','defaults','redis','./faxQueue.socket','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueue,\x20%s,\x20%s','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','map','include','model','stringify','ShowFaxQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xc1265a,_0x5b3085){var _0x592cca=function(_0x9739ec){while(--_0x9739ec){_0xc1265a['push'](_0xc1265a['shift']());}};_0x592cca(++_0x5b3085);}(_0xbf97,0x136));var _0x7bf9=function(_0x4bd81f,_0x39c2ff){_0x4bd81f=_0x4bd81f-0x0;var _0x92a430=_0xbf97[_0x4bd81f];return _0x92a430;};'use strict';var _=require('lodash');var util=require(_0x7bf9('0x0'));var moment=require(_0x7bf9('0x1'));var BPromise=require(_0x7bf9('0x2'));var rs=require(_0x7bf9('0x3'));var fs=require('fs');var Redis=require(_0x7bf9('0x4'));var db=require(_0x7bf9('0x5'))['db'];var utils=require(_0x7bf9('0x6'));var logger=require(_0x7bf9('0x7'))(_0x7bf9('0x8'));var config=require(_0x7bf9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7bf9('0xa')][_0x7bf9('0xb')]({'port':0x232a});config['redis']=_[_0x7bf9('0xc')](config[_0x7bf9('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7bf9('0xe'))[_0x7bf9('0xf')](socket);function respondWithRpcPromise(_0x3525b7,_0x56f407,_0x32c466){return new BPromise(function(_0x47cec6,_0x2bfb78){return client['request'](_0x3525b7,_0x32c466)[_0x7bf9('0x10')](function(_0x266476){logger[_0x7bf9('0x11')]('FaxQueue,\x20%s,\x20%s',_0x56f407,_0x7bf9('0x12'));logger[_0x7bf9('0x13')](_0x7bf9('0x14'),_0x56f407,'request\x20sent',JSON['stringify'](_0x266476));if(_0x266476[_0x7bf9('0x15')]){if(_0x266476[_0x7bf9('0x15')][_0x7bf9('0x16')]===0x1f4){logger[_0x7bf9('0x15')]('FaxQueue,\x20%s,\x20%s',_0x56f407,_0x266476['error'][_0x7bf9('0x17')]);return _0x2bfb78(_0x266476[_0x7bf9('0x15')][_0x7bf9('0x17')]);}logger[_0x7bf9('0x15')](_0x7bf9('0x18'),_0x56f407,_0x266476[_0x7bf9('0x15')][_0x7bf9('0x17')]);return _0x47cec6(_0x266476[_0x7bf9('0x15')][_0x7bf9('0x17')]);}else{logger[_0x7bf9('0x11')](_0x7bf9('0x18'),_0x56f407,_0x7bf9('0x12'));_0x47cec6(_0x266476['result'][_0x7bf9('0x17')]);}})[_0x7bf9('0x19')](function(_0x218569){logger[_0x7bf9('0x15')](_0x7bf9('0x18'),_0x56f407,_0x218569);_0x2bfb78(_0x218569);});});}exports[_0x7bf9('0x1a')]=function(_0xeee1f7){var _0x5e0a40=this;return new Promise(function(_0xc5ec9d,_0x71076d){return db[_0x7bf9('0x1b')][_0x7bf9('0x1c')]({'raw':_0xeee1f7[_0x7bf9('0x1d')]?_0xeee1f7['options']['raw']===undefined?!![]:![]:!![],'where':_0xeee1f7['options']?_0xeee1f7[_0x7bf9('0x1d')][_0x7bf9('0x1e')]||null:null,'attributes':_0xeee1f7['options']?_0xeee1f7[_0x7bf9('0x1d')][_0x7bf9('0x1f')]||null:null,'limit':_0xeee1f7[_0x7bf9('0x1d')]?_0xeee1f7['options'][_0x7bf9('0x20')]||null:null,'include':_0xeee1f7[_0x7bf9('0x1d')]?_0xeee1f7['options']['include']?_[_0x7bf9('0x21')](_0xeee1f7[_0x7bf9('0x1d')][_0x7bf9('0x22')],function(_0x202bc8){return{'model':db[_0x202bc8['model']],'as':_0x202bc8['as'],'attributes':_0x202bc8[_0x7bf9('0x1f')],'include':_0x202bc8[_0x7bf9('0x22')]?_[_0x7bf9('0x21')](_0x202bc8['include'],function(_0x29967c){return{'model':db[_0x29967c[_0x7bf9('0x23')]],'as':_0x29967c['as'],'attributes':_0x29967c['attributes'],'include':_0x29967c['include']?_['map'](_0x29967c[_0x7bf9('0x22')],function(_0x4a206c){return{'model':db[_0x4a206c[_0x7bf9('0x23')]],'as':_0x4a206c['as'],'attributes':_0x4a206c[_0x7bf9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7bf9('0x10')](function(_0xd9ed03){logger[_0x7bf9('0x11')](_0x7bf9('0x1a'),_0xeee1f7);logger[_0x7bf9('0x13')](_0x7bf9('0x1a'),_0xeee1f7,JSON[_0x7bf9('0x24')](_0xd9ed03));_0xc5ec9d(_0xd9ed03);})[_0x7bf9('0x19')](function(_0x13f1f1){logger[_0x7bf9('0x15')](_0x7bf9('0x1a'),_0x13f1f1[_0x7bf9('0x17')],_0xeee1f7);_0x71076d(_0x5e0a40[_0x7bf9('0x15')](0x1f4,_0x13f1f1['message']));});});};exports[_0x7bf9('0x25')]=function(_0x13a94){var _0x4d209d=this;return new Promise(function(_0x4f6609,_0x4dc78f){return db['FaxQueue'][_0x7bf9('0x26')]({'raw':_0x13a94[_0x7bf9('0x1d')]?_0x13a94[_0x7bf9('0x1d')][_0x7bf9('0x27')]===undefined?!![]:![]:!![],'where':_0x13a94['options']?_0x13a94[_0x7bf9('0x1d')]['where']||null:null,'attributes':_0x13a94[_0x7bf9('0x1d')]?_0x13a94[_0x7bf9('0x1d')][_0x7bf9('0x1f')]||null:null,'include':_0x13a94['options']?_0x13a94[_0x7bf9('0x1d')]['include']?_[_0x7bf9('0x21')](_0x13a94[_0x7bf9('0x1d')][_0x7bf9('0x22')],function(_0x256d36){return{'model':db[_0x256d36['model']],'as':_0x256d36['as'],'attributes':_0x256d36[_0x7bf9('0x1f')],'include':_0x256d36[_0x7bf9('0x22')]?_[_0x7bf9('0x21')](_0x256d36[_0x7bf9('0x22')],function(_0x2fcf66){return{'model':db[_0x2fcf66[_0x7bf9('0x23')]],'as':_0x2fcf66['as'],'attributes':_0x2fcf66[_0x7bf9('0x1f')],'include':_0x2fcf66[_0x7bf9('0x22')]?_[_0x7bf9('0x21')](_0x2fcf66['include'],function(_0x15a473){return{'model':db[_0x15a473['model']],'as':_0x15a473['as'],'attributes':_0x15a473['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bf9('0x10')](function(_0x51055e){logger[_0x7bf9('0x11')]('ShowFaxQueue',_0x13a94);logger['debug'](_0x7bf9('0x25'),_0x13a94,JSON[_0x7bf9('0x24')](_0x51055e));_0x4f6609(_0x51055e);})[_0x7bf9('0x19')](function(_0x4f58ed){logger[_0x7bf9('0x15')](_0x7bf9('0x25'),_0x4f58ed[_0x7bf9('0x17')],_0x13a94);_0x4dc78f(_0x4d209d['error'](0x1f4,_0x4f58ed[_0x7bf9('0x17')]));});});}; \ No newline at end of file +var _0x0291=['then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','./faxQueue.socket','request'];(function(_0x499cf0,_0x428c31){var _0x1b8a20=function(_0x44d498){while(--_0x44d498){_0x499cf0['push'](_0x499cf0['shift']());}};_0x1b8a20(++_0x428c31);}(_0x0291,0x1ba));var _0x1029=function(_0x5cf7b3,_0x5f58ed){_0x5cf7b3=_0x5cf7b3-0x0;var _0x2cb631=_0x0291[_0x5cf7b3];return _0x2cb631;};'use strict';var _=require('lodash');var util=require(_0x1029('0x0'));var moment=require(_0x1029('0x1'));var BPromise=require(_0x1029('0x2'));var rs=require(_0x1029('0x3'));var fs=require('fs');var Redis=require(_0x1029('0x4'));var db=require(_0x1029('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1029('0x6'));var config=require(_0x1029('0x7'));var jayson=require(_0x1029('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1029('0x9')](config[_0x1029('0xa')],{'host':_0x1029('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1029('0xc'))['register'](socket);function respondWithRpcPromise(_0x196fc7,_0x546168,_0x37c5eb){return new BPromise(function(_0x2513c2,_0x26b226){return client[_0x1029('0xd')](_0x196fc7,_0x37c5eb)[_0x1029('0xe')](function(_0x1333b3){logger['info'](_0x1029('0xf'),_0x546168,_0x1029('0x10'));logger[_0x1029('0x11')](_0x1029('0x12'),_0x546168,'request\x20sent',JSON[_0x1029('0x13')](_0x1333b3));if(_0x1333b3[_0x1029('0x14')]){if(_0x1333b3['error'][_0x1029('0x15')]===0x1f4){logger[_0x1029('0x14')](_0x1029('0xf'),_0x546168,_0x1333b3['error']['message']);return _0x26b226(_0x1333b3[_0x1029('0x14')]['message']);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x546168,_0x1333b3['error'][_0x1029('0x16')]);return _0x2513c2(_0x1333b3[_0x1029('0x14')]['message']);}else{logger['info'](_0x1029('0xf'),_0x546168,_0x1029('0x10'));_0x2513c2(_0x1333b3['result'][_0x1029('0x16')]);}})[_0x1029('0x17')](function(_0x132c77){logger['error']('FaxQueue,\x20%s,\x20%s',_0x546168,_0x132c77);_0x26b226(_0x132c77);});});}exports[_0x1029('0x18')]=function(_0x3ec2fd){var _0x2a76ff=this;return new Promise(function(_0x5ad77f,_0x1e6173){return db[_0x1029('0x19')][_0x1029('0x1a')]({'raw':_0x3ec2fd['options']?_0x3ec2fd[_0x1029('0x1b')][_0x1029('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ec2fd[_0x1029('0x1b')]?_0x3ec2fd[_0x1029('0x1b')][_0x1029('0x1d')]||null:null,'attributes':_0x3ec2fd[_0x1029('0x1b')]?_0x3ec2fd[_0x1029('0x1b')][_0x1029('0x1e')]||null:null,'limit':_0x3ec2fd[_0x1029('0x1b')]?_0x3ec2fd[_0x1029('0x1b')][_0x1029('0x1f')]||null:null,'include':_0x3ec2fd[_0x1029('0x1b')]?_0x3ec2fd['options'][_0x1029('0x20')]?_[_0x1029('0x21')](_0x3ec2fd[_0x1029('0x1b')][_0x1029('0x20')],function(_0x4626bf){return{'model':db[_0x4626bf['model']],'as':_0x4626bf['as'],'attributes':_0x4626bf['attributes'],'include':_0x4626bf['include']?_[_0x1029('0x21')](_0x4626bf[_0x1029('0x20')],function(_0xc0ae6f){return{'model':db[_0xc0ae6f[_0x1029('0x22')]],'as':_0xc0ae6f['as'],'attributes':_0xc0ae6f[_0x1029('0x1e')],'include':_0xc0ae6f[_0x1029('0x20')]?_[_0x1029('0x21')](_0xc0ae6f['include'],function(_0x548b61){return{'model':db[_0x548b61[_0x1029('0x22')]],'as':_0x548b61['as'],'attributes':_0x548b61['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dd3a2){logger[_0x1029('0x23')]('GetFaxQueue',_0x3ec2fd);logger[_0x1029('0x11')](_0x1029('0x18'),_0x3ec2fd,JSON[_0x1029('0x13')](_0x4dd3a2));_0x5ad77f(_0x4dd3a2);})[_0x1029('0x17')](function(_0x510847){logger['error'](_0x1029('0x18'),_0x510847['message'],_0x3ec2fd);_0x1e6173(_0x2a76ff[_0x1029('0x14')](0x1f4,_0x510847['message']));});});};exports[_0x1029('0x24')]=function(_0x4c8229){var _0x1d44e9=this;return new Promise(function(_0x3945fa,_0xd05c46){return db[_0x1029('0x19')][_0x1029('0x25')]({'raw':_0x4c8229[_0x1029('0x1b')]?_0x4c8229['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c8229[_0x1029('0x1b')]?_0x4c8229[_0x1029('0x1b')][_0x1029('0x1d')]||null:null,'attributes':_0x4c8229['options']?_0x4c8229[_0x1029('0x1b')][_0x1029('0x1e')]||null:null,'include':_0x4c8229[_0x1029('0x1b')]?_0x4c8229['options'][_0x1029('0x20')]?_[_0x1029('0x21')](_0x4c8229['options'][_0x1029('0x20')],function(_0x39edfd){return{'model':db[_0x39edfd[_0x1029('0x22')]],'as':_0x39edfd['as'],'attributes':_0x39edfd['attributes'],'include':_0x39edfd[_0x1029('0x20')]?_[_0x1029('0x21')](_0x39edfd[_0x1029('0x20')],function(_0x30d0de){return{'model':db[_0x30d0de[_0x1029('0x22')]],'as':_0x30d0de['as'],'attributes':_0x30d0de[_0x1029('0x1e')],'include':_0x30d0de[_0x1029('0x20')]?_[_0x1029('0x21')](_0x30d0de[_0x1029('0x20')],function(_0x38fa5c){return{'model':db[_0x38fa5c['model']],'as':_0x38fa5c['as'],'attributes':_0x38fa5c[_0x1029('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c30a3){logger[_0x1029('0x23')](_0x1029('0x24'),_0x4c8229);logger[_0x1029('0x11')](_0x1029('0x24'),_0x4c8229,JSON[_0x1029('0x13')](_0x1c30a3));_0x3945fa(_0x1c30a3);})[_0x1029('0x17')](function(_0x3c654b){logger['error'](_0x1029('0x24'),_0x3c654b[_0x1029('0x16')],_0x4c8229);_0xd05c46(_0x1d44e9[_0x1029('0x14')](0x1f4,_0x3c654b[_0x1029('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 80bb87e..8cb9843 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 _0x6a26=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x555d6c,_0x2c6c27){var _0x5125d5=function(_0x4fe503){while(--_0x4fe503){_0x555d6c['push'](_0x555d6c['shift']());}};_0x5125d5(++_0x2c6c27);}(_0x6a26,0x14f));var _0x66a2=function(_0xe13a01,_0x22d7e8){_0xe13a01=_0xe13a01-0x0;var _0x13a73c=_0x6a26[_0xe13a01];return _0x13a73c;};'use strict';var FaxQueueEvents=require(_0x66a2('0x0'));var events=[_0x66a2('0x1'),_0x66a2('0x2'),'update'];function createListener(_0xe8ca9e,_0x4c6914){return function(_0x4e9f1a){_0x4c6914[_0x66a2('0x3')](_0xe8ca9e,_0x4e9f1a);};}function removeListener(_0x5bd95a,_0x13529d){return function(){FaxQueueEvents[_0x66a2('0x4')](_0x5bd95a,_0x13529d);};}exports['register']=function(_0x1264ad){for(var _0x57ebc9=0x0,_0x37c000=events[_0x66a2('0x5')];_0x57ebc9<_0x37c000;_0x57ebc9++){var _0x3d8fda=events[_0x57ebc9];var _0x2d3930=createListener(_0x66a2('0x6')+_0x3d8fda,_0x1264ad);FaxQueueEvents['on'](_0x3d8fda,_0x2d3930);}}; \ No newline at end of file +var _0xaa00=['./faxQueue.events','save','remove','update','removeListener'];(function(_0x576ccc,_0x19b489){var _0x8ece87=function(_0x46f190){while(--_0x46f190){_0x576ccc['push'](_0x576ccc['shift']());}};_0x8ece87(++_0x19b489);}(_0xaa00,0x1f4));var _0x0aa0=function(_0x35bbe6,_0x148e5b){_0x35bbe6=_0x35bbe6-0x0;var _0x46025f=_0xaa00[_0x35bbe6];return _0x46025f;};'use strict';var FaxQueueEvents=require(_0x0aa0('0x0'));var events=[_0x0aa0('0x1'),_0x0aa0('0x2'),_0x0aa0('0x3')];function createListener(_0x265751,_0x29252f){return function(_0x1118b1){_0x29252f['emit'](_0x265751,_0x1118b1);};}function removeListener(_0x15098c,_0x182cee){return function(){FaxQueueEvents[_0x0aa0('0x4')](_0x15098c,_0x182cee);};}exports['register']=function(_0x484708){for(var _0x150c01=0x0,_0x24db82=events['length'];_0x150c01<_0x24db82;_0x150c01++){var _0x2524d5=events[_0x150c01];var _0xa371c0=createListener('faxQueue:'+_0x2524d5,_0x484708);FaxQueueEvents['on'](_0x2524d5,_0xa371c0);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index bd2e4a8..52705dd 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 _0xe944=['/:id/teams','getTeams','/:id/users','create','post','addAgents','put','update','delete','destroy','removeTeams','exports','multer','connect-timeout','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members'];(function(_0x5594a8,_0x33eddf){var _0x322a14=function(_0xa66ee1){while(--_0xa66ee1){_0x5594a8['push'](_0x5594a8['shift']());}};_0x322a14(++_0x33eddf);}(_0xe944,0x174));var _0x4e94=function(_0x2ce5c0,_0x3b19b8){_0x2ce5c0=_0x2ce5c0-0x0;var _0x10e807=_0xe944[_0x2ce5c0];return _0x10e807;};'use strict';var multer=require(_0x4e94('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e94('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4e94('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e94('0x3'));var controller=require(_0x4e94('0x4'));router[_0x4e94('0x5')]('/',auth[_0x4e94('0x6')](),controller['index']);router[_0x4e94('0x5')](_0x4e94('0x7'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x8')]);router['get'](_0x4e94('0x9'),auth['isAuthenticated'](),controller[_0x4e94('0xa')]);router[_0x4e94('0x5')](_0x4e94('0xb'),auth[_0x4e94('0x6')](),controller['getMembers']);router[_0x4e94('0x5')](_0x4e94('0xc'),auth[_0x4e94('0x6')](),controller[_0x4e94('0xd')]);router[_0x4e94('0x5')](_0x4e94('0xe'),auth[_0x4e94('0x6')](),controller['getAgents']);router['post']('/',auth[_0x4e94('0x6')](),controller[_0x4e94('0xf')]);router[_0x4e94('0x10')](_0x4e94('0xc'),auth[_0x4e94('0x6')](),controller['addTeams']);router[_0x4e94('0x10')](_0x4e94('0xe'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x11')]);router[_0x4e94('0x12')](_0x4e94('0x9'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x13')]);router[_0x4e94('0x14')](_0x4e94('0x9'),auth[_0x4e94('0x6')](),controller[_0x4e94('0x15')]);router['delete']('/:id/teams',auth[_0x4e94('0x6')](),controller[_0x4e94('0x16')]);router[_0x4e94('0x14')](_0x4e94('0xe'),auth[_0x4e94('0x6')](),controller['removeAgents']);module[_0x4e94('0x17')]=router; \ No newline at end of file +var _0xa46e=['post','addTeams','addAgents','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x24a88e,_0x22a0b8){var _0x232cbb=function(_0x50b7a4){while(--_0x50b7a4){_0x24a88e['push'](_0x24a88e['shift']());}};_0x232cbb(++_0x22a0b8);}(_0xa46e,0x8a));var _0xea46=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0xa46e[_0x19e928];return _0x4e941f;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./faxQueue.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/describe',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['show']);router['get']('/:id/members',auth[_0xea46('0x9')](),controller[_0xea46('0xc')]);router['get'](_0xea46('0xd'),auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router['get'](_0xea46('0xf'),auth[_0xea46('0x9')](),controller['getAgents']);router[_0xea46('0x10')]('/',auth[_0xea46('0x9')](),controller['create']);router[_0xea46('0x10')]('/:id/teams',auth[_0xea46('0x9')](),controller[_0xea46('0x11')]);router[_0xea46('0x10')](_0xea46('0xf'),auth[_0xea46('0x9')](),controller[_0xea46('0x12')]);router[_0xea46('0x13')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['update']);router[_0xea46('0x14')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['destroy']);router['delete'](_0xea46('0xd'),auth[_0xea46('0x9')](),controller['removeTeams']);router['delete'](_0xea46('0xf'),auth[_0xea46('0x9')](),controller['removeAgents']);module[_0xea46('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f86c8b0..eb39847 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 _0x6a6c=['DATE','moment','sequelize','STRING'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6a6c,0x199));var _0xc6a6=function(_0x37d047,_0x64ccf9){_0x37d047=_0x37d047-0x0;var _0x283c7a=_0x6a6c[_0x37d047];return _0x283c7a;};'use strict';var moment=require(_0xc6a6('0x0'));var Sequelize=require(_0xc6a6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc6a6('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc6a6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc6a6('0x3')]},'exitAt':{'type':Sequelize[_0xc6a6('0x3')]},'reason':{'type':Sequelize[_0xc6a6('0x2')]}}; \ No newline at end of file +var _0xe636=['DATE','moment','sequelize','STRING'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0xe636,0x16d));var _0x6e63=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe636[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0x6e63('0x0'));var Sequelize=require(_0x6e63('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6e63('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6e63('0x2')]},'joinAt':{'type':Sequelize[_0x6e63('0x3')]},'leaveAt':{'type':Sequelize[_0x6e63('0x3')]},'acceptAt':{'type':Sequelize[_0x6e63('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 02b7bc4..a488d99 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 _0x18a9=['Content-Range','json','save','update','destroy','then','end','error','stack','name','send','index','map','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','includeAll','findAll','rows','catch','rawAttributes','include','options','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x18a9,0x15b));var _0x918a=function(_0x2ed210,_0x303da8){_0x2ed210=_0x2ed210-0x0;var _0x58ae3=_0x18a9[_0x2ed210];return _0x58ae3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x918a('0x0'));var jsonpatch=require(_0x918a('0x1'));var rp=require(_0x918a('0x2'));var moment=require(_0x918a('0x3'));var BPromise=require(_0x918a('0x4'));var Mustache=require(_0x918a('0x5'));var util=require(_0x918a('0x6'));var path=require(_0x918a('0x7'));var sox=require(_0x918a('0x8'));var csv=require(_0x918a('0x9'));var ejs=require(_0x918a('0xa'));var fs=require('fs');var fs_extra=require(_0x918a('0xb'));var _=require('lodash');var squel=require(_0x918a('0xc'));var crypto=require(_0x918a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918a('0xe'));var toCsv=require(_0x918a('0x9'));var querystring=require(_0x918a('0xf'));var Papa=require(_0x918a('0x10'));var Redis=require(_0x918a('0x11'));var authService=require(_0x918a('0x12'));var qs=require(_0x918a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x918a('0x14'));var logger=require(_0x918a('0x15'))(_0x918a('0x16'));var utils=require(_0x918a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x918a('0x18'));var db=require(_0x918a('0x19'))['db'];function respondWithStatusCode(_0x5c0f68,_0x36f4aa){_0x36f4aa=_0x36f4aa||0xcc;return function(_0x3e4490){if(_0x3e4490){return _0x5c0f68[_0x918a('0x1a')](_0x36f4aa);}return _0x5c0f68[_0x918a('0x1b')](_0x36f4aa)['end']();};}function respondWithResult(_0x162d88,_0x55c90e){_0x55c90e=_0x55c90e||0xc8;return function(_0x19583e){if(_0x19583e){return _0x162d88['status'](_0x55c90e)['json'](_0x19583e);}};}function respondWithFilteredResult(_0x325a8f,_0x22bd74){return function(_0x47ce2d){if(_0x47ce2d){var _0x355174=typeof _0x22bd74['offset']===_0x918a('0x1c')&&typeof _0x22bd74[_0x918a('0x1d')]===_0x918a('0x1c');var _0x4ae164=_0x47ce2d[_0x918a('0x1e')];var _0x51e467=_0x355174?0x0:_0x22bd74[_0x918a('0x1f')];var _0x22e347=_0x355174?_0x47ce2d[_0x918a('0x1e')]:_0x22bd74[_0x918a('0x1f')]+_0x22bd74['limit'];var _0x21a4a3;if(_0x22e347>=_0x4ae164){_0x22e347=_0x4ae164;_0x21a4a3=0xc8;}else{_0x21a4a3=0xce;}_0x325a8f[_0x918a('0x1b')](_0x21a4a3);return _0x325a8f[_0x918a('0x20')](_0x918a('0x21'),_0x51e467+'-'+_0x22e347+'/'+_0x4ae164)[_0x918a('0x22')](_0x47ce2d);}return null;};}function patchUpdates(_0x161142){return function(_0x2cf02b){try{jsonpatch['apply'](_0x2cf02b,_0x161142,!![]);}catch(_0x17acb7){return BPromise['reject'](_0x17acb7);}return _0x2cf02b[_0x918a('0x23')]();};}function saveUpdates(_0x4961fb,_0x4c5993){return function(_0x4c7675){if(_0x4c7675){return _0x4c7675[_0x918a('0x24')](_0x4961fb)['then'](function(_0x32a67d){return _0x32a67d;});}return null;};}function removeEntity(_0xd40a6c,_0xadd3bc){return function(_0x2d8077){if(_0x2d8077){return _0x2d8077[_0x918a('0x25')]()[_0x918a('0x26')](function(){_0xd40a6c[_0x918a('0x1b')](0xcc)[_0x918a('0x27')]();});}};}function handleEntityNotFound(_0xfdad4a,_0xc10404){return function(_0x5a6695){if(!_0x5a6695){_0xfdad4a[_0x918a('0x1a')](0x194);}return _0x5a6695;};}function handleError(_0x1bdb27,_0x262d5c){_0x262d5c=_0x262d5c||0x1f4;return function(_0x4a77c6){logger[_0x918a('0x28')](_0x4a77c6[_0x918a('0x29')]);if(_0x4a77c6[_0x918a('0x2a')]){delete _0x4a77c6['name'];}_0x1bdb27[_0x918a('0x1b')](_0x262d5c)[_0x918a('0x2b')](_0x4a77c6);};}exports[_0x918a('0x2c')]=function(_0x2a4e28,_0x1e47f4){var _0x36a55c={},_0x51361c={},_0x57b6a7={'count':0x0,'rows':[]};var _0x5ac4b4=_[_0x918a('0x2d')](db[_0x918a('0x2e')]['rawAttributes'],function(_0x1dd40a){return{'name':_0x1dd40a[_0x918a('0x2f')],'type':_0x1dd40a['type']['key']};});_0x51361c[_0x918a('0x30')]=_['map'](_0x5ac4b4,_0x918a('0x2a'));_0x51361c[_0x918a('0x31')]=_[_0x918a('0x32')](_0x2a4e28[_0x918a('0x31')]);_0x51361c[_0x918a('0x33')]=_[_0x918a('0x34')](_0x51361c['model'],_0x51361c[_0x918a('0x31')]);_0x36a55c[_0x918a('0x35')]=_[_0x918a('0x34')](_0x51361c[_0x918a('0x30')],qs[_0x918a('0x36')](_0x2a4e28[_0x918a('0x31')]['fields']));_0x36a55c[_0x918a('0x35')]=_0x36a55c[_0x918a('0x35')][_0x918a('0x37')]?_0x36a55c['attributes']:_0x51361c[_0x918a('0x30')];if(!_0x2a4e28['query'][_0x918a('0x38')]('nolimit')){_0x36a55c[_0x918a('0x1d')]=qs[_0x918a('0x1d')](_0x2a4e28[_0x918a('0x31')][_0x918a('0x1d')]);_0x36a55c[_0x918a('0x1f')]=qs['offset'](_0x2a4e28['query'][_0x918a('0x1f')]);}_0x36a55c[_0x918a('0x39')]=qs['sort'](_0x2a4e28[_0x918a('0x31')][_0x918a('0x3a')]);_0x36a55c[_0x918a('0x3b')]=qs[_0x918a('0x33')](_[_0x918a('0x3c')](_0x2a4e28[_0x918a('0x31')],_0x51361c[_0x918a('0x33')]),_0x5ac4b4);if(_0x2a4e28['query'][_0x918a('0x3d')]){_0x36a55c['where']=_['merge'](_0x36a55c[_0x918a('0x3b')],{'$or':_[_0x918a('0x2d')](_0x5ac4b4,function(_0xbf15){if(_0xbf15[_0x918a('0x3e')]!=='VIRTUAL'){var _0xa86b9d={};_0xa86b9d[_0xbf15[_0x918a('0x2a')]]={'$like':'%'+_0x2a4e28[_0x918a('0x31')][_0x918a('0x3d')]+'%'};return _0xa86b9d;}})});}_0x36a55c=_[_0x918a('0x3f')]({},_0x36a55c,_0x2a4e28['options']);var _0xca5fdb={'where':_0x36a55c[_0x918a('0x3b')]};return db[_0x918a('0x2e')][_0x918a('0x1e')](_0xca5fdb)[_0x918a('0x26')](function(_0xb30a66){_0x57b6a7[_0x918a('0x1e')]=_0xb30a66;if(_0x2a4e28[_0x918a('0x31')][_0x918a('0x40')]){_0x36a55c['include']=[{'all':!![]}];}return db[_0x918a('0x2e')][_0x918a('0x41')](_0x36a55c);})[_0x918a('0x26')](function(_0x4440bd){_0x57b6a7[_0x918a('0x42')]=_0x4440bd;return _0x57b6a7;})[_0x918a('0x26')](respondWithFilteredResult(_0x1e47f4,_0x36a55c))[_0x918a('0x43')](handleError(_0x1e47f4,null));};exports['show']=function(_0x1ac156,_0xae4f7a){var _0x9dc719={'raw':!![],'where':{'id':_0x1ac156['params']['id']}},_0x44c419={};_0x44c419[_0x918a('0x30')]=_['keys'](db[_0x918a('0x2e')][_0x918a('0x44')]);_0x44c419['query']=_['keys'](_0x1ac156[_0x918a('0x31')]);_0x44c419[_0x918a('0x33')]=_[_0x918a('0x34')](_0x44c419[_0x918a('0x30')],_0x44c419['query']);_0x9dc719['attributes']=_[_0x918a('0x34')](_0x44c419[_0x918a('0x30')],qs[_0x918a('0x36')](_0x1ac156[_0x918a('0x31')]['fields']));_0x9dc719['attributes']=_0x9dc719[_0x918a('0x35')]['length']?_0x9dc719[_0x918a('0x35')]:_0x44c419[_0x918a('0x30')];if(_0x1ac156[_0x918a('0x31')][_0x918a('0x40')]){_0x9dc719[_0x918a('0x45')]=[{'all':!![]}];}_0x9dc719=_[_0x918a('0x3f')]({},_0x9dc719,_0x1ac156[_0x918a('0x46')]);return db[_0x918a('0x2e')][_0x918a('0x47')](_0x9dc719)[_0x918a('0x26')](handleEntityNotFound(_0xae4f7a,null))[_0x918a('0x26')](respondWithResult(_0xae4f7a,null))[_0x918a('0x43')](handleError(_0xae4f7a,null));};exports[_0x918a('0x48')]=function(_0x1982a5,_0x5048b8){return db[_0x918a('0x2e')]['create'](_0x1982a5['body'],{})[_0x918a('0x26')](respondWithResult(_0x5048b8,0xc9))['catch'](handleError(_0x5048b8,null));};exports[_0x918a('0x24')]=function(_0x31cb92,_0x5e1a6a){if(_0x31cb92['body']['id']){delete _0x31cb92[_0x918a('0x49')]['id'];}return db['FaxQueueReport'][_0x918a('0x47')]({'where':{'id':_0x31cb92[_0x918a('0x4a')]['id']}})[_0x918a('0x26')](handleEntityNotFound(_0x5e1a6a,null))[_0x918a('0x26')](saveUpdates(_0x31cb92[_0x918a('0x49')],null))['then'](respondWithResult(_0x5e1a6a,null))[_0x918a('0x43')](handleError(_0x5e1a6a,null));};exports[_0x918a('0x25')]=function(_0x3f4103,_0x4fc77d){return db[_0x918a('0x2e')]['find']({'where':{'id':_0x3f4103[_0x918a('0x4a')]['id']}})[_0x918a('0x26')](handleEntityNotFound(_0x4fc77d,null))[_0x918a('0x26')](removeEntity(_0x4fc77d,null))[_0x918a('0x43')](handleError(_0x4fc77d,null));};exports['describe']=function(_0x2b8a6b,_0x3eb9be){return db[_0x918a('0x2e')][_0x918a('0x4b')]()[_0x918a('0x26')](respondWithResult(_0x3eb9be,null))['catch'](handleError(_0x3eb9be,null));}; \ No newline at end of file +var _0x0cfa=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','FaxQueueReport','then','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','destroy','error','stack','name','send','map'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0cfa,0x18f));var _0xa0cf=function(_0xdd57d6,_0x5cc76d){_0xdd57d6=_0xdd57d6-0x0;var _0x1ac370=_0x0cfa[_0xdd57d6];return _0x1ac370;};'use strict';var emlformat=require(_0xa0cf('0x0'));var rimraf=require(_0xa0cf('0x1'));var zipdir=require(_0xa0cf('0x2'));var jsonpatch=require(_0xa0cf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa0cf('0x4'));var util=require('util');var path=require(_0xa0cf('0x5'));var sox=require(_0xa0cf('0x6'));var csv=require(_0xa0cf('0x7'));var ejs=require(_0xa0cf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0cf('0x9'));var squel=require('squel');var crypto=require(_0xa0cf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa0cf('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa0cf('0xc'));var Papa=require(_0xa0cf('0xd'));var Redis=require(_0xa0cf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa0cf('0xf'));var as=require(_0xa0cf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa0cf('0x11'));var utils=require(_0xa0cf('0x12'));var config=require(_0xa0cf('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0cf('0x14'))['db'];function respondWithStatusCode(_0x383429,_0x3de581){_0x3de581=_0x3de581||0xcc;return function(_0x1c9fa2){if(_0x1c9fa2){return _0x383429[_0xa0cf('0x15')](_0x3de581);}return _0x383429[_0xa0cf('0x16')](_0x3de581)[_0xa0cf('0x17')]();};}function respondWithResult(_0x5f52ee,_0x560c9b){_0x560c9b=_0x560c9b||0xc8;return function(_0x213d63){if(_0x213d63){return _0x5f52ee[_0xa0cf('0x16')](_0x560c9b)['json'](_0x213d63);}};}function respondWithFilteredResult(_0x1e8234,_0x1cc9ba){return function(_0x3f55f5){if(_0x3f55f5){var _0x1186e9=typeof _0x1cc9ba[_0xa0cf('0x18')]==='undefined'&&typeof _0x1cc9ba[_0xa0cf('0x19')]===_0xa0cf('0x1a');var _0x5bae31=_0x3f55f5[_0xa0cf('0x1b')];var _0x36c524=_0x1186e9?0x0:_0x1cc9ba['offset'];var _0x112ced=_0x1186e9?_0x3f55f5[_0xa0cf('0x1b')]:_0x1cc9ba[_0xa0cf('0x18')]+_0x1cc9ba[_0xa0cf('0x19')];var _0x191a95;if(_0x112ced>=_0x5bae31){_0x112ced=_0x5bae31;_0x191a95=0xc8;}else{_0x191a95=0xce;}_0x1e8234[_0xa0cf('0x16')](_0x191a95);return _0x1e8234['set'](_0xa0cf('0x1c'),_0x36c524+'-'+_0x112ced+'/'+_0x5bae31)[_0xa0cf('0x1d')](_0x3f55f5);}return null;};}function patchUpdates(_0x3551df){return function(_0x112b57){try{jsonpatch[_0xa0cf('0x1e')](_0x112b57,_0x3551df,!![]);}catch(_0x1e99cf){return BPromise[_0xa0cf('0x1f')](_0x1e99cf);}return _0x112b57[_0xa0cf('0x20')]();};}function saveUpdates(_0x1112f8,_0x2137ea){return function(_0x359116){if(_0x359116){return _0x359116['update'](_0x1112f8)['then'](function(_0x5825a1){return _0x5825a1;});}return null;};}function removeEntity(_0x555973,_0x574085){return function(_0x419baf){if(_0x419baf){return _0x419baf[_0xa0cf('0x21')]()['then'](function(){_0x555973[_0xa0cf('0x16')](0xcc)[_0xa0cf('0x17')]();});}};}function handleEntityNotFound(_0xeb9af,_0x1a9e25){return function(_0x5a39f9){if(!_0x5a39f9){_0xeb9af[_0xa0cf('0x15')](0x194);}return _0x5a39f9;};}function handleError(_0x3f03ff,_0x4da07f){_0x4da07f=_0x4da07f||0x1f4;return function(_0x543c66){logger[_0xa0cf('0x22')](_0x543c66[_0xa0cf('0x23')]);if(_0x543c66[_0xa0cf('0x24')]){delete _0x543c66[_0xa0cf('0x24')];}_0x3f03ff[_0xa0cf('0x16')](_0x4da07f)[_0xa0cf('0x25')](_0x543c66);};}exports['index']=function(_0x57b088,_0x1ef1d4){var _0x58006e={},_0xd627d={},_0x2eed90={'count':0x0,'rows':[]};var _0x458590=_[_0xa0cf('0x26')](db['FaxQueueReport'][_0xa0cf('0x27')],function(_0x285778){return{'name':_0x285778[_0xa0cf('0x28')],'type':_0x285778[_0xa0cf('0x29')][_0xa0cf('0x2a')]};});_0xd627d[_0xa0cf('0x2b')]=_[_0xa0cf('0x26')](_0x458590,'name');_0xd627d[_0xa0cf('0x2c')]=_[_0xa0cf('0x2d')](_0x57b088[_0xa0cf('0x2c')]);_0xd627d[_0xa0cf('0x2e')]=_[_0xa0cf('0x2f')](_0xd627d['model'],_0xd627d[_0xa0cf('0x2c')]);_0x58006e[_0xa0cf('0x30')]=_['intersection'](_0xd627d['model'],qs[_0xa0cf('0x31')](_0x57b088[_0xa0cf('0x2c')][_0xa0cf('0x31')]));_0x58006e[_0xa0cf('0x30')]=_0x58006e[_0xa0cf('0x30')][_0xa0cf('0x32')]?_0x58006e[_0xa0cf('0x30')]:_0xd627d[_0xa0cf('0x2b')];if(!_0x57b088['query'][_0xa0cf('0x33')](_0xa0cf('0x34'))){_0x58006e[_0xa0cf('0x19')]=qs[_0xa0cf('0x19')](_0x57b088[_0xa0cf('0x2c')]['limit']);_0x58006e[_0xa0cf('0x18')]=qs[_0xa0cf('0x18')](_0x57b088[_0xa0cf('0x2c')][_0xa0cf('0x18')]);}_0x58006e['order']=qs[_0xa0cf('0x35')](_0x57b088[_0xa0cf('0x2c')][_0xa0cf('0x35')]);_0x58006e[_0xa0cf('0x36')]=qs[_0xa0cf('0x2e')](_[_0xa0cf('0x37')](_0x57b088[_0xa0cf('0x2c')],_0xd627d[_0xa0cf('0x2e')]),_0x458590);if(_0x57b088['query']['filter']){_0x58006e[_0xa0cf('0x36')]=_[_0xa0cf('0x38')](_0x58006e[_0xa0cf('0x36')],{'$or':_[_0xa0cf('0x26')](_0x458590,function(_0x5b5384){if(_0x5b5384[_0xa0cf('0x29')]!==_0xa0cf('0x39')){var _0x25b2c2={};_0x25b2c2[_0x5b5384['name']]={'$like':'%'+_0x57b088[_0xa0cf('0x2c')][_0xa0cf('0x3a')]+'%'};return _0x25b2c2;}})});}_0x58006e=_['merge']({},_0x58006e,_0x57b088[_0xa0cf('0x3b')]);var _0x3a5bc8={'where':_0x58006e[_0xa0cf('0x36')]};return db[_0xa0cf('0x3c')]['count'](_0x3a5bc8)[_0xa0cf('0x3d')](function(_0x172c54){_0x2eed90[_0xa0cf('0x1b')]=_0x172c54;if(_0x57b088[_0xa0cf('0x2c')][_0xa0cf('0x3e')]){_0x58006e[_0xa0cf('0x3f')]=[{'all':!![]}];}return db[_0xa0cf('0x3c')][_0xa0cf('0x40')](_0x58006e);})[_0xa0cf('0x3d')](function(_0x5cd6dd){_0x2eed90['rows']=_0x5cd6dd;return _0x2eed90;})[_0xa0cf('0x3d')](respondWithFilteredResult(_0x1ef1d4,_0x58006e))[_0xa0cf('0x41')](handleError(_0x1ef1d4,null));};exports[_0xa0cf('0x42')]=function(_0x47e735,_0x3b596c){var _0x4dcac3={'raw':!![],'where':{'id':_0x47e735[_0xa0cf('0x43')]['id']}},_0x10fc94={};_0x10fc94[_0xa0cf('0x2b')]=_[_0xa0cf('0x2d')](db[_0xa0cf('0x3c')][_0xa0cf('0x27')]);_0x10fc94[_0xa0cf('0x2c')]=_[_0xa0cf('0x2d')](_0x47e735[_0xa0cf('0x2c')]);_0x10fc94['filters']=_[_0xa0cf('0x2f')](_0x10fc94['model'],_0x10fc94[_0xa0cf('0x2c')]);_0x4dcac3[_0xa0cf('0x30')]=_[_0xa0cf('0x2f')](_0x10fc94[_0xa0cf('0x2b')],qs['fields'](_0x47e735[_0xa0cf('0x2c')]['fields']));_0x4dcac3['attributes']=_0x4dcac3[_0xa0cf('0x30')]['length']?_0x4dcac3[_0xa0cf('0x30')]:_0x10fc94[_0xa0cf('0x2b')];if(_0x47e735[_0xa0cf('0x2c')][_0xa0cf('0x3e')]){_0x4dcac3[_0xa0cf('0x3f')]=[{'all':!![]}];}_0x4dcac3=_[_0xa0cf('0x38')]({},_0x4dcac3,_0x47e735['options']);return db['FaxQueueReport'][_0xa0cf('0x44')](_0x4dcac3)[_0xa0cf('0x3d')](handleEntityNotFound(_0x3b596c,null))[_0xa0cf('0x3d')](respondWithResult(_0x3b596c,null))[_0xa0cf('0x41')](handleError(_0x3b596c,null));};exports[_0xa0cf('0x45')]=function(_0x13778a,_0x5572a3){return db[_0xa0cf('0x3c')]['create'](_0x13778a[_0xa0cf('0x46')],{})[_0xa0cf('0x3d')](respondWithResult(_0x5572a3,0xc9))[_0xa0cf('0x41')](handleError(_0x5572a3,null));};exports[_0xa0cf('0x47')]=function(_0x22a57f,_0x5c33a2){if(_0x22a57f[_0xa0cf('0x46')]['id']){delete _0x22a57f[_0xa0cf('0x46')]['id'];}return db['FaxQueueReport'][_0xa0cf('0x44')]({'where':{'id':_0x22a57f[_0xa0cf('0x43')]['id']}})[_0xa0cf('0x3d')](handleEntityNotFound(_0x5c33a2,null))[_0xa0cf('0x3d')](saveUpdates(_0x22a57f[_0xa0cf('0x46')],null))[_0xa0cf('0x3d')](respondWithResult(_0x5c33a2,null))[_0xa0cf('0x41')](handleError(_0x5c33a2,null));};exports['destroy']=function(_0x3fcdca,_0x561857){return db[_0xa0cf('0x3c')]['find']({'where':{'id':_0x3fcdca[_0xa0cf('0x43')]['id']}})[_0xa0cf('0x3d')](handleEntityNotFound(_0x561857,null))[_0xa0cf('0x3d')](removeEntity(_0x561857,null))[_0xa0cf('0x41')](handleError(_0x561857,null));};exports[_0xa0cf('0x48')]=function(_0x38e49c,_0x3c4cc6){return db['FaxQueueReport'][_0xa0cf('0x48')]()['then'](respondWithResult(_0x3c4cc6,null))['catch'](handleError(_0x3c4cc6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a8d1a51..c6a1cb5 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x2e75ba,_0xeb009c){var _0x5ace1d=function(_0x434504){while(--_0x434504){_0x2e75ba['push'](_0x2e75ba['shift']());}};_0x5ace1d(++_0xeb009c);}(_0x1261,0x144));var _0x1126=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x1261[_0x9d14e3];return _0x19bf32;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x537df9,_0x2f4978){var _0x2727c0=function(_0xc09017){while(--_0xc09017){_0x537df9['push'](_0x537df9['shift']());}};_0x2727c0(++_0x2f4978);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 9e38af7..e31b87f 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 _0x3672=['../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b8428,_0x3b9fee){var _0x22dcb0=function(_0x39d796){while(--_0x39d796){_0x4b8428['push'](_0x4b8428['shift']());}};_0x22dcb0(++_0x3b9fee);}(_0x3672,0x107));var _0x2367=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x3672[_0x237546];return _0x233e29;};'use strict';var _=require(_0x2367('0x0'));var util=require(_0x2367('0x1'));var moment=require(_0x2367('0x2'));var BPromise=require(_0x2367('0x3'));var rs=require(_0x2367('0x4'));var fs=require('fs');var Redis=require(_0x2367('0x5'));var db=require(_0x2367('0x6'))['db'];var utils=require(_0x2367('0x7'));var logger=require(_0x2367('0x8'))('rpc');var config=require(_0x2367('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2367('0xa')][_0x2367('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x403316,_0x761d8c,_0x253fb5){return new BPromise(function(_0x31493a,_0x385380){return client[_0x2367('0xc')](_0x403316,_0x253fb5)[_0x2367('0xd')](function(_0x4ae952){logger[_0x2367('0xe')](_0x2367('0xf'),_0x761d8c,_0x2367('0x10'));logger[_0x2367('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x761d8c,'request\x20sent',JSON[_0x2367('0x12')](_0x4ae952));if(_0x4ae952[_0x2367('0x13')]){if(_0x4ae952[_0x2367('0x13')][_0x2367('0x14')]===0x1f4){logger[_0x2367('0x13')](_0x2367('0xf'),_0x761d8c,_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);return _0x385380(_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);}logger[_0x2367('0x13')](_0x2367('0xf'),_0x761d8c,_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);return _0x31493a(_0x4ae952[_0x2367('0x13')][_0x2367('0x15')]);}else{logger[_0x2367('0xe')](_0x2367('0xf'),_0x761d8c,_0x2367('0x10'));_0x31493a(_0x4ae952['result'][_0x2367('0x15')]);}})[_0x2367('0x16')](function(_0x2982d0){logger[_0x2367('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x761d8c,_0x2982d0);_0x385380(_0x2982d0);});});}exports[_0x2367('0x17')]=function(_0x85cc58){var _0x14bdba=this;return new Promise(function(_0x1fc4ce,_0x8dadaf){return db[_0x2367('0x18')][_0x2367('0x19')](_0x85cc58[_0x2367('0x1a')],{'raw':_0x85cc58[_0x2367('0x1b')]?_0x85cc58[_0x2367('0x1b')][_0x2367('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x39bd9a){logger[_0x2367('0xe')](_0x2367('0x17'),_0x85cc58);logger[_0x2367('0x11')]('CreateFaxQueueReport',_0x85cc58,JSON['stringify'](_0x39bd9a));_0x1fc4ce(_0x39bd9a);})['catch'](function(_0x13e2c9){logger[_0x2367('0x13')]('CreateFaxQueueReport',_0x13e2c9[_0x2367('0x15')],_0x85cc58);_0x8dadaf(_0x14bdba['error'](0x1f4,_0x13e2c9['message']));});});};exports[_0x2367('0x1d')]=function(_0x449742){var _0x548f69=this;return new Promise(function(_0xef7e38,_0x327914){return db[_0x2367('0x18')][_0x2367('0x1e')](_0x449742[_0x2367('0x1a')],{'raw':_0x449742[_0x2367('0x1b')]?_0x449742[_0x2367('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449742[_0x2367('0x1b')]?_0x449742[_0x2367('0x1b')][_0x2367('0x1f')]||null:null,'attributes':_0x449742['options']?_0x449742[_0x2367('0x1b')][_0x2367('0x20')]||null:null,'limit':_0x449742[_0x2367('0x1b')]?_0x449742['options'][_0x2367('0x21')]||null:null})[_0x2367('0xd')](function(_0x2f34cf){logger[_0x2367('0xe')](_0x2367('0x1d'),_0x449742);logger[_0x2367('0x11')](_0x2367('0x1d'),_0x449742,JSON[_0x2367('0x12')](_0x2f34cf));_0xef7e38(_0x2f34cf);})[_0x2367('0x16')](function(_0x504c82){logger[_0x2367('0x13')](_0x2367('0x1d'),_0x504c82[_0x2367('0x15')],_0x449742);_0x327914(_0x548f69[_0x2367('0x13')](0x1f4,_0x504c82['message']));});});}; \ No newline at end of file +var _0x2711=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','catch','UpdateFaxQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x2711,0x1ab));var _0x1271=function(_0x298f42,_0x447d77){_0x298f42=_0x298f42-0x0;var _0x82d524=_0x2711[_0x298f42];return _0x82d524;};'use strict';var _=require(_0x1271('0x0'));var util=require(_0x1271('0x1'));var moment=require(_0x1271('0x2'));var BPromise=require(_0x1271('0x3'));var rs=require(_0x1271('0x4'));var fs=require('fs');var Redis=require(_0x1271('0x5'));var db=require(_0x1271('0x6'))['db'];var utils=require(_0x1271('0x7'));var logger=require(_0x1271('0x8'))(_0x1271('0x9'));var config=require(_0x1271('0xa'));var jayson=require(_0x1271('0xb'));var client=jayson['client'][_0x1271('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x211d62,_0x22630d,_0x417e29){return new BPromise(function(_0x9814dc,_0x34e96f){return client[_0x1271('0xd')](_0x211d62,_0x417e29)[_0x1271('0xe')](function(_0x4821ce){logger[_0x1271('0xf')](_0x1271('0x10'),_0x22630d,_0x1271('0x11'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x22630d,_0x1271('0x11'),JSON[_0x1271('0x12')](_0x4821ce));if(_0x4821ce[_0x1271('0x13')]){if(_0x4821ce['error'][_0x1271('0x14')]===0x1f4){logger[_0x1271('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x22630d,_0x4821ce[_0x1271('0x13')][_0x1271('0x15')]);return _0x34e96f(_0x4821ce[_0x1271('0x13')][_0x1271('0x15')]);}logger[_0x1271('0x13')](_0x1271('0x10'),_0x22630d,_0x4821ce['error']['message']);return _0x9814dc(_0x4821ce['error']['message']);}else{logger[_0x1271('0xf')](_0x1271('0x10'),_0x22630d,_0x1271('0x11'));_0x9814dc(_0x4821ce[_0x1271('0x16')][_0x1271('0x15')]);}})['catch'](function(_0x14be90){logger['error'](_0x1271('0x10'),_0x22630d,_0x14be90);_0x34e96f(_0x14be90);});});}exports[_0x1271('0x17')]=function(_0x233f22){var _0x2a6e9f=this;return new Promise(function(_0x1d7860,_0x6ff3e3){return db[_0x1271('0x18')][_0x1271('0x19')](_0x233f22[_0x1271('0x1a')],{'raw':_0x233f22[_0x1271('0x1b')]?_0x233f22[_0x1271('0x1b')][_0x1271('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x21158d){logger[_0x1271('0xf')](_0x1271('0x17'),_0x233f22);logger[_0x1271('0x1d')](_0x1271('0x17'),_0x233f22,JSON['stringify'](_0x21158d));_0x1d7860(_0x21158d);})[_0x1271('0x1e')](function(_0x2fe32f){logger['error'](_0x1271('0x17'),_0x2fe32f[_0x1271('0x15')],_0x233f22);_0x6ff3e3(_0x2a6e9f[_0x1271('0x13')](0x1f4,_0x2fe32f[_0x1271('0x15')]));});});};exports[_0x1271('0x1f')]=function(_0x3ff0bf){var _0x4519cf=this;return new Promise(function(_0x2ecec3,_0x27a685){return db['FaxQueueReport'][_0x1271('0x20')](_0x3ff0bf[_0x1271('0x1a')],{'raw':_0x3ff0bf['options']?_0x3ff0bf[_0x1271('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ff0bf[_0x1271('0x1b')]?_0x3ff0bf['options']['where']||null:null,'attributes':_0x3ff0bf[_0x1271('0x1b')]?_0x3ff0bf['options'][_0x1271('0x21')]||null:null,'limit':_0x3ff0bf['options']?_0x3ff0bf[_0x1271('0x1b')]['limit']||null:null})[_0x1271('0xe')](function(_0x25ac68){logger['info'](_0x1271('0x1f'),_0x3ff0bf);logger[_0x1271('0x1d')](_0x1271('0x1f'),_0x3ff0bf,JSON['stringify'](_0x25ac68));_0x2ecec3(_0x25ac68);})[_0x1271('0x1e')](function(_0x8b85da){logger[_0x1271('0x13')](_0x1271('0x1f'),_0x8b85da[_0x1271('0x15')],_0x3ff0bf);_0x27a685(_0x4519cf[_0x1271('0x13')](0x1f4,_0x8b85da[_0x1271('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e57ae5b..6fad88c 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 _0x11f9=['/describe','describe','/:id','show','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11f9,0x10d));var _0x911f=function(_0x48965f,_0x5c8550){_0x48965f=_0x48965f-0x0;var _0x274747=_0x11f9[_0x48965f];return _0x274747;};'use strict';var multer=require(_0x911f('0x0'));var util=require('util');var path=require(_0x911f('0x1'));var timeout=require('connect-timeout');var express=require(_0x911f('0x2'));var router=express[_0x911f('0x3')]();var fs_extra=require(_0x911f('0x4'));var auth=require(_0x911f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x911f('0x6'));var controller=require(_0x911f('0x7'));router[_0x911f('0x8')]('/',auth[_0x911f('0x9')](),controller[_0x911f('0xa')]);router[_0x911f('0x8')](_0x911f('0xb'),auth[_0x911f('0x9')](),controller[_0x911f('0xc')]);router['get'](_0x911f('0xd'),auth['isAuthenticated'](),controller[_0x911f('0xe')]);router['post']('/',auth[_0x911f('0x9')](),controller[_0x911f('0xf')]);router[_0x911f('0x10')](_0x911f('0xd'),auth[_0x911f('0x9')](),controller[_0x911f('0x11')]);router[_0x911f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x911f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb0ed=['describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x463697,_0xccfdc4){var _0x33cfe1=function(_0x5c74ec){while(--_0x5c74ec){_0x463697['push'](_0x463697['shift']());}};_0x33cfe1(++_0xccfdc4);}(_0xb0ed,0x82));var _0xdb0e=function(_0x585cff,_0x2f1927){_0x585cff=_0x585cff-0x0;var _0x5c8054=_0xb0ed[_0x585cff];return _0x5c8054;};'use strict';var multer=require('multer');var util=require(_0xdb0e('0x0'));var path=require(_0xdb0e('0x1'));var timeout=require(_0xdb0e('0x2'));var express=require(_0xdb0e('0x3'));var router=express[_0xdb0e('0x4')]();var fs_extra=require(_0xdb0e('0x5'));var auth=require(_0xdb0e('0x6'));var interaction=require(_0xdb0e('0x7'));var config=require(_0xdb0e('0x8'));var controller=require(_0xdb0e('0x9'));router[_0xdb0e('0xa')]('/',auth[_0xdb0e('0xb')](),controller[_0xdb0e('0xc')]);router[_0xdb0e('0xa')](_0xdb0e('0xd'),auth[_0xdb0e('0xb')](),controller[_0xdb0e('0xe')]);router[_0xdb0e('0xa')](_0xdb0e('0xf'),auth[_0xdb0e('0xb')](),controller[_0xdb0e('0x10')]);router[_0xdb0e('0x11')]('/',auth[_0xdb0e('0xb')](),controller[_0xdb0e('0x12')]);router[_0xdb0e('0x13')](_0xdb0e('0xf'),auth[_0xdb0e('0xb')](),controller[_0xdb0e('0x14')]);router[_0xdb0e('0x15')](_0xdb0e('0xf'),auth['isAuthenticated'](),controller[_0xdb0e('0x16')]);module[_0xdb0e('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 25db66f..5802fc5 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4ea03c,_0x63db75){var _0x348561=function(_0x430499){while(--_0x430499){_0x4ea03c['push'](_0x4ea03c['shift']());}};_0x348561(++_0x63db75);}(_0xaa88,0x137));var _0x8aa8=function(_0x47e309,_0x1e771a){_0x47e309=_0x47e309-0x0;var _0x2e1900=_0xaa88[_0x47e309];return _0x2e1900;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0x9bde,0xe1));var _0xe9bd=function(_0x28c3de,_0x4c551c){_0x28c3de=_0x28c3de-0x0;var _0x14b433=_0x9bde[_0x28c3de];return _0x14b433;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 9928781..0c013eb 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 _0xfab8=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where'];(function(_0x5c0cc4,_0x41e3f4){var _0x302c1a=function(_0x2d3f25){while(--_0x2d3f25){_0x5c0cc4['push'](_0x5c0cc4['shift']());}};_0x302c1a(++_0x41e3f4);}(_0xfab8,0x140));var _0x8fab=function(_0x2e67e9,_0x344707){_0x2e67e9=_0x2e67e9-0x0;var _0xf737d9=_0xfab8[_0x2e67e9];return _0xf737d9;};'use strict';var emlformat=require(_0x8fab('0x0'));var rimraf=require(_0x8fab('0x1'));var zipdir=require(_0x8fab('0x2'));var jsonpatch=require(_0x8fab('0x3'));var rp=require(_0x8fab('0x4'));var moment=require(_0x8fab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8fab('0x6'));var util=require('util');var path=require(_0x8fab('0x7'));var sox=require(_0x8fab('0x8'));var csv=require('to-csv');var ejs=require(_0x8fab('0x9'));var fs=require('fs');var fs_extra=require(_0x8fab('0xa'));var _=require(_0x8fab('0xb'));var squel=require('squel');var crypto=require(_0x8fab('0xc'));var jsforce=require(_0x8fab('0xd'));var deskjs=require(_0x8fab('0xe'));var toCsv=require(_0x8fab('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8fab('0x10'));var authService=require(_0x8fab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8fab('0x12'));var hardwareService=require(_0x8fab('0x13'));var logger=require(_0x8fab('0x14'))(_0x8fab('0x15'));var utils=require('../../config/utils');var config=require(_0x8fab('0x16'));var licenseUtil=require(_0x8fab('0x17'));var db=require(_0x8fab('0x18'))['db'];function respondWithStatusCode(_0x1a20c8,_0x1a4604){_0x1a4604=_0x1a4604||0xcc;return function(_0x196e20){if(_0x196e20){return _0x1a20c8['sendStatus'](_0x1a4604);}return _0x1a20c8[_0x8fab('0x19')](_0x1a4604)[_0x8fab('0x1a')]();};}function respondWithResult(_0x33e61d,_0x32504e){_0x32504e=_0x32504e||0xc8;return function(_0x21fd3c){if(_0x21fd3c){return _0x33e61d[_0x8fab('0x19')](_0x32504e)[_0x8fab('0x1b')](_0x21fd3c);}};}function respondWithFilteredResult(_0x1b4b88,_0x2d21e3){return function(_0x3bc17a){if(_0x3bc17a){var _0x1a55db=typeof _0x2d21e3[_0x8fab('0x1c')]===_0x8fab('0x1d')&&typeof _0x2d21e3['limit']===_0x8fab('0x1d');var _0xe7c9a2=_0x3bc17a[_0x8fab('0x1e')];var _0x536d78=_0x1a55db?0x0:_0x2d21e3['offset'];var _0x3f1583=_0x1a55db?_0x3bc17a[_0x8fab('0x1e')]:_0x2d21e3[_0x8fab('0x1c')]+_0x2d21e3[_0x8fab('0x1f')];var _0x38e408;if(_0x3f1583>=_0xe7c9a2){_0x3f1583=_0xe7c9a2;_0x38e408=0xc8;}else{_0x38e408=0xce;}_0x1b4b88['status'](_0x38e408);return _0x1b4b88[_0x8fab('0x20')]('Content-Range',_0x536d78+'-'+_0x3f1583+'/'+_0xe7c9a2)['json'](_0x3bc17a);}return null;};}function patchUpdates(_0x41cd5f){return function(_0x74c080){try{jsonpatch[_0x8fab('0x21')](_0x74c080,_0x41cd5f,!![]);}catch(_0x5d20f1){return BPromise['reject'](_0x5d20f1);}return _0x74c080[_0x8fab('0x22')]();};}function saveUpdates(_0x12a1b7,_0x37411e){return function(_0x539bd9){if(_0x539bd9){return _0x539bd9[_0x8fab('0x23')](_0x12a1b7)[_0x8fab('0x24')](function(_0x591c99){return _0x591c99;});}return null;};}function removeEntity(_0x27aaaf,_0x40334f){return function(_0x17f2a6){if(_0x17f2a6){return _0x17f2a6[_0x8fab('0x25')]()[_0x8fab('0x24')](function(){_0x27aaaf['status'](0xcc)[_0x8fab('0x1a')]();});}};}function handleEntityNotFound(_0x58dee4,_0x3044fb){return function(_0x47384f){if(!_0x47384f){_0x58dee4[_0x8fab('0x26')](0x194);}return _0x47384f;};}function handleError(_0x582f93,_0x3bc980){_0x3bc980=_0x3bc980||0x1f4;return function(_0x5098cf){logger[_0x8fab('0x27')](_0x5098cf[_0x8fab('0x28')]);if(_0x5098cf[_0x8fab('0x29')]){delete _0x5098cf[_0x8fab('0x29')];}_0x582f93[_0x8fab('0x19')](_0x3bc980)['send'](_0x5098cf);};}exports[_0x8fab('0x2a')]=function(_0x154195,_0x3da39f){var _0x466dac={},_0x22207b={},_0x4d5b2a={'count':0x0,'rows':[]};var _0x16c799=_[_0x8fab('0x2b')](db[_0x8fab('0x2c')]['rawAttributes'],function(_0x30e9d2){return{'name':_0x30e9d2[_0x8fab('0x2d')],'type':_0x30e9d2[_0x8fab('0x2e')][_0x8fab('0x2f')]};});_0x22207b[_0x8fab('0x30')]=_['map'](_0x16c799,_0x8fab('0x29'));_0x22207b[_0x8fab('0x31')]=_[_0x8fab('0x32')](_0x154195[_0x8fab('0x31')]);_0x22207b[_0x8fab('0x33')]=_[_0x8fab('0x34')](_0x22207b['model'],_0x22207b[_0x8fab('0x31')]);_0x466dac[_0x8fab('0x35')]=_[_0x8fab('0x34')](_0x22207b[_0x8fab('0x30')],qs[_0x8fab('0x36')](_0x154195[_0x8fab('0x31')][_0x8fab('0x36')]));_0x466dac[_0x8fab('0x35')]=_0x466dac[_0x8fab('0x35')][_0x8fab('0x37')]?_0x466dac['attributes']:_0x22207b[_0x8fab('0x30')];if(!_0x154195[_0x8fab('0x31')][_0x8fab('0x38')](_0x8fab('0x39'))){_0x466dac[_0x8fab('0x1f')]=qs[_0x8fab('0x1f')](_0x154195[_0x8fab('0x31')]['limit']);_0x466dac[_0x8fab('0x1c')]=qs[_0x8fab('0x1c')](_0x154195['query'][_0x8fab('0x1c')]);}_0x466dac[_0x8fab('0x3a')]=qs['sort'](_0x154195[_0x8fab('0x31')][_0x8fab('0x3b')]);_0x466dac['where']=qs[_0x8fab('0x33')](_['pick'](_0x154195[_0x8fab('0x31')],_0x22207b['filters']),_0x16c799);if(_0x154195[_0x8fab('0x31')][_0x8fab('0x3c')]){_0x466dac['where']=_[_0x8fab('0x3d')](_0x466dac['where'],{'$or':_[_0x8fab('0x2b')](_0x16c799,function(_0x4ec5f4){if(_0x4ec5f4[_0x8fab('0x2e')]!==_0x8fab('0x3e')){var _0x108597={};_0x108597[_0x4ec5f4[_0x8fab('0x29')]]={'$like':'%'+_0x154195[_0x8fab('0x31')][_0x8fab('0x3c')]+'%'};return _0x108597;}})});}_0x466dac=_[_0x8fab('0x3d')]({},_0x466dac,_0x154195[_0x8fab('0x3f')]);var _0x46081a={'where':_0x466dac[_0x8fab('0x40')]};return db['FaxTransferReport'][_0x8fab('0x1e')](_0x46081a)[_0x8fab('0x24')](function(_0x4458f4){_0x4d5b2a[_0x8fab('0x1e')]=_0x4458f4;if(_0x154195['query'][_0x8fab('0x41')]){_0x466dac[_0x8fab('0x42')]=[{'all':!![]}];}return db[_0x8fab('0x2c')][_0x8fab('0x43')](_0x466dac);})['then'](function(_0x8ea291){_0x4d5b2a[_0x8fab('0x44')]=_0x8ea291;return _0x4d5b2a;})['then'](respondWithFilteredResult(_0x3da39f,_0x466dac))[_0x8fab('0x45')](handleError(_0x3da39f,null));};exports[_0x8fab('0x46')]=function(_0x27e083,_0x1835ad){var _0x2d06f2={'raw':!![],'where':{'id':_0x27e083[_0x8fab('0x47')]['id']}},_0x2e7641={};_0x2e7641[_0x8fab('0x30')]=_['keys'](db['FaxTransferReport'][_0x8fab('0x48')]);_0x2e7641[_0x8fab('0x31')]=_[_0x8fab('0x32')](_0x27e083[_0x8fab('0x31')]);_0x2e7641['filters']=_[_0x8fab('0x34')](_0x2e7641['model'],_0x2e7641['query']);_0x2d06f2['attributes']=_['intersection'](_0x2e7641[_0x8fab('0x30')],qs[_0x8fab('0x36')](_0x27e083[_0x8fab('0x31')][_0x8fab('0x36')]));_0x2d06f2[_0x8fab('0x35')]=_0x2d06f2[_0x8fab('0x35')][_0x8fab('0x37')]?_0x2d06f2[_0x8fab('0x35')]:_0x2e7641[_0x8fab('0x30')];if(_0x27e083['query'][_0x8fab('0x41')]){_0x2d06f2[_0x8fab('0x42')]=[{'all':!![]}];}_0x2d06f2=_[_0x8fab('0x3d')]({},_0x2d06f2,_0x27e083['options']);return db['FaxTransferReport']['find'](_0x2d06f2)[_0x8fab('0x24')](handleEntityNotFound(_0x1835ad,null))[_0x8fab('0x24')](respondWithResult(_0x1835ad,null))[_0x8fab('0x45')](handleError(_0x1835ad,null));};exports[_0x8fab('0x49')]=function(_0x253570,_0x3a0412){return db[_0x8fab('0x2c')]['create'](_0x253570[_0x8fab('0x4a')],{})['then'](respondWithResult(_0x3a0412,0xc9))[_0x8fab('0x45')](handleError(_0x3a0412,null));};exports['update']=function(_0x4b6d12,_0x5eb229){if(_0x4b6d12[_0x8fab('0x4a')]['id']){delete _0x4b6d12[_0x8fab('0x4a')]['id'];}return db['FaxTransferReport'][_0x8fab('0x4b')]({'where':{'id':_0x4b6d12[_0x8fab('0x47')]['id']}})['then'](handleEntityNotFound(_0x5eb229,null))[_0x8fab('0x24')](saveUpdates(_0x4b6d12[_0x8fab('0x4a')],null))[_0x8fab('0x24')](respondWithResult(_0x5eb229,null))[_0x8fab('0x45')](handleError(_0x5eb229,null));};exports[_0x8fab('0x25')]=function(_0x35c649,_0x15b488){return db[_0x8fab('0x2c')]['find']({'where':{'id':_0x35c649[_0x8fab('0x47')]['id']}})[_0x8fab('0x24')](handleEntityNotFound(_0x15b488,null))[_0x8fab('0x24')](removeEntity(_0x15b488,null))[_0x8fab('0x45')](handleError(_0x15b488,null));};exports[_0x8fab('0x4c')]=function(_0x47f5c1,_0x2056df){return db[_0x8fab('0x2c')]['describe']()[_0x8fab('0x24')](respondWithResult(_0x2056df,null))['catch'](handleError(_0x2056df,null));}; \ No newline at end of file +var _0xeb49=['options','create','body','find','destroy','describe','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','FaxTransferReport','rawAttributes','type','key','model','map','query','filters','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','intersection','include'];(function(_0x4b37e1,_0x2f0437){var _0x529fcb=function(_0x49dbc7){while(--_0x49dbc7){_0x4b37e1['push'](_0x4b37e1['shift']());}};_0x529fcb(++_0x2f0437);}(_0xeb49,0x96));var _0x9eb4=function(_0x1b8f22,_0x3db2e7){_0x1b8f22=_0x1b8f22-0x0;var _0x13c541=_0xeb49[_0x1b8f22];return _0x13c541;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9eb4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9eb4('0x1'));var moment=require('moment');var BPromise=require(_0x9eb4('0x2'));var Mustache=require(_0x9eb4('0x3'));var util=require('util');var path=require(_0x9eb4('0x4'));var sox=require(_0x9eb4('0x5'));var csv=require(_0x9eb4('0x6'));var ejs=require(_0x9eb4('0x7'));var fs=require('fs');var fs_extra=require(_0x9eb4('0x8'));var _=require('lodash');var squel=require(_0x9eb4('0x9'));var crypto=require(_0x9eb4('0xa'));var jsforce=require(_0x9eb4('0xb'));var deskjs=require(_0x9eb4('0xc'));var toCsv=require(_0x9eb4('0x6'));var querystring=require('querystring');var Papa=require(_0x9eb4('0xd'));var Redis=require(_0x9eb4('0xe'));var authService=require(_0x9eb4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9eb4('0x10'));var hardwareService=require(_0x9eb4('0x11'));var logger=require('../../config/logger')(_0x9eb4('0x12'));var utils=require('../../config/utils');var config=require(_0x9eb4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9eb4('0x14'))['db'];function respondWithStatusCode(_0x53262a,_0x265808){_0x265808=_0x265808||0xcc;return function(_0x20370a){if(_0x20370a){return _0x53262a[_0x9eb4('0x15')](_0x265808);}return _0x53262a[_0x9eb4('0x16')](_0x265808)[_0x9eb4('0x17')]();};}function respondWithResult(_0x9fd2e1,_0x353afb){_0x353afb=_0x353afb||0xc8;return function(_0x32d5f5){if(_0x32d5f5){return _0x9fd2e1[_0x9eb4('0x16')](_0x353afb)[_0x9eb4('0x18')](_0x32d5f5);}};}function respondWithFilteredResult(_0x281ce3,_0x94dce4){return function(_0x523ca3){if(_0x523ca3){var _0x45c308=typeof _0x94dce4[_0x9eb4('0x19')]==='undefined'&&typeof _0x94dce4[_0x9eb4('0x1a')]===_0x9eb4('0x1b');var _0x35b6ab=_0x523ca3['count'];var _0x6902f4=_0x45c308?0x0:_0x94dce4[_0x9eb4('0x19')];var _0x3598f7=_0x45c308?_0x523ca3[_0x9eb4('0x1c')]:_0x94dce4[_0x9eb4('0x19')]+_0x94dce4[_0x9eb4('0x1a')];var _0x4f7257;if(_0x3598f7>=_0x35b6ab){_0x3598f7=_0x35b6ab;_0x4f7257=0xc8;}else{_0x4f7257=0xce;}_0x281ce3[_0x9eb4('0x16')](_0x4f7257);return _0x281ce3[_0x9eb4('0x1d')](_0x9eb4('0x1e'),_0x6902f4+'-'+_0x3598f7+'/'+_0x35b6ab)[_0x9eb4('0x18')](_0x523ca3);}return null;};}function patchUpdates(_0x418e83){return function(_0x244057){try{jsonpatch[_0x9eb4('0x1f')](_0x244057,_0x418e83,!![]);}catch(_0x2a48dd){return BPromise[_0x9eb4('0x20')](_0x2a48dd);}return _0x244057['save']();};}function saveUpdates(_0x2bd657,_0x5eca4f){return function(_0x5da70d){if(_0x5da70d){return _0x5da70d[_0x9eb4('0x21')](_0x2bd657)['then'](function(_0x509ddc){return _0x509ddc;});}return null;};}function removeEntity(_0xa4f07c,_0x19fa7d){return function(_0x5321ca){if(_0x5321ca){return _0x5321ca['destroy']()[_0x9eb4('0x22')](function(){_0xa4f07c[_0x9eb4('0x16')](0xcc)[_0x9eb4('0x17')]();});}};}function handleEntityNotFound(_0x5d4fd0,_0x3c579b){return function(_0x54d3d6){if(!_0x54d3d6){_0x5d4fd0['sendStatus'](0x194);}return _0x54d3d6;};}function handleError(_0x8b61d0,_0x43943d){_0x43943d=_0x43943d||0x1f4;return function(_0x4db519){logger[_0x9eb4('0x23')](_0x4db519[_0x9eb4('0x24')]);if(_0x4db519['name']){delete _0x4db519[_0x9eb4('0x25')];}_0x8b61d0['status'](_0x43943d)[_0x9eb4('0x26')](_0x4db519);};}exports['index']=function(_0x15aca0,_0x6cc86e){var _0x382e2e={},_0x2490a7={},_0x58ee1e={'count':0x0,'rows':[]};var _0x48387c=_['map'](db[_0x9eb4('0x27')][_0x9eb4('0x28')],function(_0xe5b0b0){return{'name':_0xe5b0b0['fieldName'],'type':_0xe5b0b0[_0x9eb4('0x29')][_0x9eb4('0x2a')]};});_0x2490a7[_0x9eb4('0x2b')]=_[_0x9eb4('0x2c')](_0x48387c,_0x9eb4('0x25'));_0x2490a7[_0x9eb4('0x2d')]=_['keys'](_0x15aca0[_0x9eb4('0x2d')]);_0x2490a7[_0x9eb4('0x2e')]=_['intersection'](_0x2490a7['model'],_0x2490a7[_0x9eb4('0x2d')]);_0x382e2e[_0x9eb4('0x2f')]=_['intersection'](_0x2490a7['model'],qs['fields'](_0x15aca0[_0x9eb4('0x2d')][_0x9eb4('0x30')]));_0x382e2e[_0x9eb4('0x2f')]=_0x382e2e['attributes'][_0x9eb4('0x31')]?_0x382e2e['attributes']:_0x2490a7[_0x9eb4('0x2b')];if(!_0x15aca0[_0x9eb4('0x2d')]['hasOwnProperty'](_0x9eb4('0x32'))){_0x382e2e[_0x9eb4('0x1a')]=qs[_0x9eb4('0x1a')](_0x15aca0[_0x9eb4('0x2d')][_0x9eb4('0x1a')]);_0x382e2e[_0x9eb4('0x19')]=qs['offset'](_0x15aca0[_0x9eb4('0x2d')][_0x9eb4('0x19')]);}_0x382e2e[_0x9eb4('0x33')]=qs[_0x9eb4('0x34')](_0x15aca0[_0x9eb4('0x2d')][_0x9eb4('0x34')]);_0x382e2e['where']=qs[_0x9eb4('0x2e')](_['pick'](_0x15aca0['query'],_0x2490a7[_0x9eb4('0x2e')]),_0x48387c);if(_0x15aca0['query'][_0x9eb4('0x35')]){_0x382e2e[_0x9eb4('0x36')]=_['merge'](_0x382e2e['where'],{'$or':_[_0x9eb4('0x2c')](_0x48387c,function(_0x2cd179){if(_0x2cd179[_0x9eb4('0x29')]!==_0x9eb4('0x37')){var _0x5ba0f8={};_0x5ba0f8[_0x2cd179[_0x9eb4('0x25')]]={'$like':'%'+_0x15aca0[_0x9eb4('0x2d')][_0x9eb4('0x35')]+'%'};return _0x5ba0f8;}})});}_0x382e2e=_[_0x9eb4('0x38')]({},_0x382e2e,_0x15aca0['options']);var _0x5c8f5c={'where':_0x382e2e[_0x9eb4('0x36')]};return db['FaxTransferReport'][_0x9eb4('0x1c')](_0x5c8f5c)[_0x9eb4('0x22')](function(_0x2d7b99){_0x58ee1e[_0x9eb4('0x1c')]=_0x2d7b99;if(_0x15aca0[_0x9eb4('0x2d')][_0x9eb4('0x39')]){_0x382e2e['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x9eb4('0x3a')](_0x382e2e);})[_0x9eb4('0x22')](function(_0x373a9d){_0x58ee1e[_0x9eb4('0x3b')]=_0x373a9d;return _0x58ee1e;})[_0x9eb4('0x22')](respondWithFilteredResult(_0x6cc86e,_0x382e2e))[_0x9eb4('0x3c')](handleError(_0x6cc86e,null));};exports[_0x9eb4('0x3d')]=function(_0x5a70e1,_0x412128){var _0x254f73={'raw':!![],'where':{'id':_0x5a70e1[_0x9eb4('0x3e')]['id']}},_0x50cdc4={};_0x50cdc4[_0x9eb4('0x2b')]=_[_0x9eb4('0x3f')](db[_0x9eb4('0x27')][_0x9eb4('0x28')]);_0x50cdc4[_0x9eb4('0x2d')]=_[_0x9eb4('0x3f')](_0x5a70e1['query']);_0x50cdc4[_0x9eb4('0x2e')]=_['intersection'](_0x50cdc4[_0x9eb4('0x2b')],_0x50cdc4['query']);_0x254f73[_0x9eb4('0x2f')]=_[_0x9eb4('0x40')](_0x50cdc4[_0x9eb4('0x2b')],qs[_0x9eb4('0x30')](_0x5a70e1[_0x9eb4('0x2d')][_0x9eb4('0x30')]));_0x254f73[_0x9eb4('0x2f')]=_0x254f73['attributes'][_0x9eb4('0x31')]?_0x254f73[_0x9eb4('0x2f')]:_0x50cdc4[_0x9eb4('0x2b')];if(_0x5a70e1[_0x9eb4('0x2d')][_0x9eb4('0x39')]){_0x254f73[_0x9eb4('0x41')]=[{'all':!![]}];}_0x254f73=_[_0x9eb4('0x38')]({},_0x254f73,_0x5a70e1[_0x9eb4('0x42')]);return db[_0x9eb4('0x27')]['find'](_0x254f73)[_0x9eb4('0x22')](handleEntityNotFound(_0x412128,null))[_0x9eb4('0x22')](respondWithResult(_0x412128,null))[_0x9eb4('0x3c')](handleError(_0x412128,null));};exports[_0x9eb4('0x43')]=function(_0x2fb777,_0x97ef33){return db[_0x9eb4('0x27')][_0x9eb4('0x43')](_0x2fb777[_0x9eb4('0x44')],{})['then'](respondWithResult(_0x97ef33,0xc9))[_0x9eb4('0x3c')](handleError(_0x97ef33,null));};exports[_0x9eb4('0x21')]=function(_0x182db1,_0x298df3){if(_0x182db1[_0x9eb4('0x44')]['id']){delete _0x182db1['body']['id'];}return db[_0x9eb4('0x27')][_0x9eb4('0x45')]({'where':{'id':_0x182db1[_0x9eb4('0x3e')]['id']}})[_0x9eb4('0x22')](handleEntityNotFound(_0x298df3,null))[_0x9eb4('0x22')](saveUpdates(_0x182db1[_0x9eb4('0x44')],null))[_0x9eb4('0x22')](respondWithResult(_0x298df3,null))[_0x9eb4('0x3c')](handleError(_0x298df3,null));};exports[_0x9eb4('0x46')]=function(_0x1c069e,_0x4a1584){return db['FaxTransferReport']['find']({'where':{'id':_0x1c069e[_0x9eb4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4a1584,null))[_0x9eb4('0x22')](removeEntity(_0x4a1584,null))[_0x9eb4('0x3c')](handleError(_0x4a1584,null));};exports[_0x9eb4('0x47')]=function(_0x255075,_0x334136){return db['FaxTransferReport'][_0x9eb4('0x47')]()[_0x9eb4('0x22')](respondWithResult(_0x334136,null))[_0x9eb4('0x3c')](handleError(_0x334136,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 5b31842..d4ba4dc 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 _0x3c6c=['./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2475b9,_0x12ee6a){var _0x2cb2be=function(_0x5a8295){while(--_0x5a8295){_0x2475b9['push'](_0x2475b9['shift']());}};_0x2cb2be(++_0x12ee6a);}(_0x3c6c,0x1f4));var _0xc3c6=function(_0x10dfb3,_0x44ee65){_0x10dfb3=_0x10dfb3-0x0;var _0x142ac0=_0x3c6c[_0x10dfb3];return _0x142ac0;};'use strict';var _=require(_0xc3c6('0x0'));var util=require(_0xc3c6('0x1'));var logger=require(_0xc3c6('0x2'))(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var rp=require(_0xc3c6('0x6'));var fs=require('fs');var path=require(_0xc3c6('0x7'));var rimraf=require(_0xc3c6('0x8'));var config=require(_0xc3c6('0x9'));var attributes=require(_0xc3c6('0xa'));module['exports']=function(_0x55b919,_0x5b6d9f){return _0x55b919[_0xc3c6('0xb')](_0xc3c6('0xc'),attributes,{'tableName':_0xc3c6('0xd'),'paranoid':![],'indexes':[{'name':_0xc3c6('0xe'),'fields':[_0xc3c6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea63=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xea63,0x138));var _0x3ea6=function(_0x4d69fb,_0xc43cdb){_0x4d69fb=_0x4d69fb-0x0;var _0x943a5d=_0xea63[_0x4d69fb];return _0x943a5d;};'use strict';var _=require(_0x3ea6('0x0'));var util=require(_0x3ea6('0x1'));var logger=require('../../config/logger')(_0x3ea6('0x2'));var moment=require(_0x3ea6('0x3'));var BPromise=require(_0x3ea6('0x4'));var rp=require(_0x3ea6('0x5'));var fs=require('fs');var path=require(_0x3ea6('0x6'));var rimraf=require(_0x3ea6('0x7'));var config=require('../../config/environment');var attributes=require(_0x3ea6('0x8'));module[_0x3ea6('0x9')]=function(_0x3fa2a6,_0x415869){return _0x3fa2a6[_0x3ea6('0xa')](_0x3ea6('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3ea6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index c373fc2..33f640c 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 _0x3176=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x233843,_0x2d4516){var _0x4081f8=function(_0x7ab30c){while(--_0x7ab30c){_0x233843['push'](_0x233843['shift']());}};_0x4081f8(++_0x2d4516);}(_0x3176,0x1c0));var _0x6317=function(_0x2e2242,_0x46851f){_0x2e2242=_0x2e2242-0x0;var _0x26d8ab=_0x3176[_0x2e2242];return _0x26d8ab;};'use strict';var _=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var moment=require('moment');var BPromise=require(_0x6317('0x2'));var rs=require(_0x6317('0x3'));var fs=require('fs');var Redis=require(_0x6317('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6317('0x5'))(_0x6317('0x6'));var config=require(_0x6317('0x7'));var jayson=require(_0x6317('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x218b4c,_0x1ed415,_0x23a165){return new BPromise(function(_0xb94c50,_0x27ff32){return client[_0x6317('0x9')](_0x218b4c,_0x23a165)[_0x6317('0xa')](function(_0x46bf71){logger[_0x6317('0xb')](_0x6317('0xc'),_0x1ed415,_0x6317('0xd'));logger[_0x6317('0xe')](_0x6317('0xf'),_0x1ed415,_0x6317('0xd'),JSON[_0x6317('0x10')](_0x46bf71));if(_0x46bf71[_0x6317('0x11')]){if(_0x46bf71['error'][_0x6317('0x12')]===0x1f4){logger[_0x6317('0x11')](_0x6317('0xc'),_0x1ed415,_0x46bf71[_0x6317('0x11')][_0x6317('0x13')]);return _0x27ff32(_0x46bf71[_0x6317('0x11')]['message']);}logger[_0x6317('0x11')](_0x6317('0xc'),_0x1ed415,_0x46bf71[_0x6317('0x11')][_0x6317('0x13')]);return _0xb94c50(_0x46bf71['error'][_0x6317('0x13')]);}else{logger['info'](_0x6317('0xc'),_0x1ed415,_0x6317('0xd'));_0xb94c50(_0x46bf71['result']['message']);}})['catch'](function(_0x317cf1){logger[_0x6317('0x11')](_0x6317('0xc'),_0x1ed415,_0x317cf1);_0x27ff32(_0x317cf1);});});} \ No newline at end of file +var _0xf7ae=['then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0xb9f89a,_0x51e38f){var _0x27f0c4=function(_0x28828e){while(--_0x28828e){_0xb9f89a['push'](_0xb9f89a['shift']());}};_0x27f0c4(++_0x51e38f);}(_0xf7ae,0x73));var _0xef7a=function(_0x4e030f,_0xadb579){_0x4e030f=_0x4e030f-0x0;var _0x59eadc=_0xf7ae[_0x4e030f];return _0x59eadc;};'use strict';var _=require('lodash');var util=require(_0xef7a('0x0'));var moment=require('moment');var BPromise=require(_0xef7a('0x1'));var rs=require(_0xef7a('0x2'));var fs=require('fs');var Redis=require(_0xef7a('0x3'));var db=require(_0xef7a('0x4'))['db'];var utils=require(_0xef7a('0x5'));var logger=require(_0xef7a('0x6'))(_0xef7a('0x7'));var config=require('../../config/environment');var jayson=require(_0xef7a('0x8'));var client=jayson[_0xef7a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5adefa,_0x1be68b,_0x588f09){return new BPromise(function(_0x1ea6d7,_0x5b7ac9){return client[_0xef7a('0xa')](_0x5adefa,_0x588f09)[_0xef7a('0xb')](function(_0x9de6e5){logger[_0xef7a('0xc')](_0xef7a('0xd'),_0x1be68b,_0xef7a('0xe'));logger[_0xef7a('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1be68b,_0xef7a('0xe'),JSON[_0xef7a('0x10')](_0x9de6e5));if(_0x9de6e5[_0xef7a('0x11')]){if(_0x9de6e5[_0xef7a('0x11')][_0xef7a('0x12')]===0x1f4){logger[_0xef7a('0x11')](_0xef7a('0xd'),_0x1be68b,_0x9de6e5[_0xef7a('0x11')][_0xef7a('0x13')]);return _0x5b7ac9(_0x9de6e5[_0xef7a('0x11')]['message']);}logger[_0xef7a('0x11')](_0xef7a('0xd'),_0x1be68b,_0x9de6e5[_0xef7a('0x11')][_0xef7a('0x13')]);return _0x1ea6d7(_0x9de6e5['error']['message']);}else{logger[_0xef7a('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x1be68b,_0xef7a('0xe'));_0x1ea6d7(_0x9de6e5[_0xef7a('0x14')][_0xef7a('0x13')]);}})['catch'](function(_0x514c35){logger['error'](_0xef7a('0xd'),_0x1be68b,_0x514c35);_0x5b7ac9(_0x514c35);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0788636..0124016 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 _0x190b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x141cdc,_0xa038e9){var _0x2d7d88=function(_0x5d161f){while(--_0x5d161f){_0x141cdc['push'](_0x141cdc['shift']());}};_0x2d7d88(++_0xa038e9);}(_0x190b,0x13e));var _0xb190=function(_0x4d28e7,_0x353ff1){_0x4d28e7=_0x4d28e7-0x0;var _0x5dddd2=_0x190b[_0x4d28e7];return _0x5dddd2;};'use strict';var multer=require(_0xb190('0x0'));var util=require('util');var path=require(_0xb190('0x1'));var timeout=require(_0xb190('0x2'));var express=require(_0xb190('0x3'));var router=express['Router']();var fs_extra=require(_0xb190('0x4'));var auth=require(_0xb190('0x5'));var interaction=require(_0xb190('0x6'));var config=require(_0xb190('0x7'));var controller=require('./faxTransferReport.controller');router[_0xb190('0x8')]('/',auth[_0xb190('0x9')](),controller[_0xb190('0xa')]);router[_0xb190('0x8')](_0xb190('0xb'),auth[_0xb190('0x9')](),controller['describe']);router['get'](_0xb190('0xc'),auth[_0xb190('0x9')](),controller[_0xb190('0xd')]);router['post']('/',auth[_0xb190('0x9')](),controller[_0xb190('0xe')]);router[_0xb190('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb190('0x10')]);router[_0xb190('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb190('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa95d=['get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x24530e,_0x30e997){var _0x26230b=function(_0x286b0a){while(--_0x286b0a){_0x24530e['push'](_0x24530e['shift']());}};_0x26230b(++_0x30e997);}(_0xa95d,0xfb));var _0xda95=function(_0x909dfe,_0x36e38a){_0x909dfe=_0x909dfe-0x0;var _0x5cb58f=_0xa95d[_0x909dfe];return _0x5cb58f;};'use strict';var multer=require(_0xda95('0x0'));var util=require('util');var path=require(_0xda95('0x1'));var timeout=require(_0xda95('0x2'));var express=require(_0xda95('0x3'));var router=express[_0xda95('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda95('0x5'));var interaction=require(_0xda95('0x6'));var config=require(_0xda95('0x7'));var controller=require(_0xda95('0x8'));router[_0xda95('0x9')]('/',auth[_0xda95('0xa')](),controller[_0xda95('0xb')]);router[_0xda95('0x9')](_0xda95('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xda95('0x9')](_0xda95('0xd'),auth[_0xda95('0xa')](),controller[_0xda95('0xe')]);router[_0xda95('0xf')]('/',auth[_0xda95('0xa')](),controller['create']);router[_0xda95('0x10')](_0xda95('0xd'),auth['isAuthenticated'](),controller[_0xda95('0x11')]);router[_0xda95('0x12')](_0xda95('0xd'),auth[_0xda95('0xa')](),controller[_0xda95('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 05b55b8..ed63c17 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 _0x5063=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x5063,0x180));var _0x3506=function(_0x8c941b,_0x5a72f7){_0x8c941b=_0x8c941b-0x0;var _0x2e0df7=_0x5063[_0x8c941b];return _0x2e0df7;};'use strict';var multer=require('multer');var util=require(_0x3506('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3506('0x1'));var router=express[_0x3506('0x2')]();var fs_extra=require(_0x3506('0x3'));var auth=require(_0x3506('0x4'));var interaction=require(_0x3506('0x5'));var config=require(_0x3506('0x6'));var controller=require(_0x3506('0x7'));router[_0x3506('0x8')]('/',auth[_0x3506('0x9')](),controller[_0x3506('0xa')]);router['get'](_0x3506('0xb'),auth[_0x3506('0x9')](),controller['show']);router[_0x3506('0x8')](_0x3506('0xc'),auth[_0x3506('0x9')](),controller[_0x3506('0xd')]);router[_0x3506('0x8')]('/:id/fields',auth[_0x3506('0x9')](),controller[_0x3506('0xe')]);router['post']('/',auth[_0x3506('0x9')](),controller[_0x3506('0xf')]);router[_0x3506('0x10')](_0x3506('0xc'),auth[_0x3506('0x9')](),controller[_0x3506('0x11')]);router[_0x3506('0x12')](_0x3506('0xb'),auth[_0x3506('0x9')](),controller[_0x3506('0x13')]);router[_0x3506('0x14')](_0x3506('0xb'),auth[_0x3506('0x9')](),controller[_0x3506('0x15')]);module[_0x3506('0x16')]=router; \ No newline at end of file +var _0x2f5e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util'];(function(_0x25cb3e,_0x2b4637){var _0x297c82=function(_0x48c5b9){while(--_0x48c5b9){_0x25cb3e['push'](_0x25cb3e['shift']());}};_0x297c82(++_0x2b4637);}(_0x2f5e,0x196));var _0xe2f5=function(_0x137a7c,_0x193f3b){_0x137a7c=_0x137a7c-0x0;var _0x1be2ee=_0x2f5e[_0x137a7c];return _0x1be2ee;};'use strict';var multer=require(_0xe2f5('0x0'));var util=require(_0xe2f5('0x1'));var path=require(_0xe2f5('0x2'));var timeout=require(_0xe2f5('0x3'));var express=require(_0xe2f5('0x4'));var router=express[_0xe2f5('0x5')]();var fs_extra=require(_0xe2f5('0x6'));var auth=require(_0xe2f5('0x7'));var interaction=require(_0xe2f5('0x8'));var config=require(_0xe2f5('0x9'));var controller=require(_0xe2f5('0xa'));router[_0xe2f5('0xb')]('/',auth[_0xe2f5('0xc')](),controller['index']);router['get'](_0xe2f5('0xd'),auth[_0xe2f5('0xc')](),controller['show']);router[_0xe2f5('0xb')](_0xe2f5('0xe'),auth[_0xe2f5('0xc')](),controller[_0xe2f5('0xf')]);router[_0xe2f5('0xb')]('/:id/fields',auth[_0xe2f5('0xc')](),controller[_0xe2f5('0x10')]);router[_0xe2f5('0x11')]('/',auth[_0xe2f5('0xc')](),controller[_0xe2f5('0x12')]);router[_0xe2f5('0x11')](_0xe2f5('0xe'),auth[_0xe2f5('0xc')](),controller[_0xe2f5('0x13')]);router[_0xe2f5('0x14')](_0xe2f5('0xd'),auth[_0xe2f5('0xc')](),controller[_0xe2f5('0x15')]);router[_0xe2f5('0x16')]('/:id',auth[_0xe2f5('0xc')](),controller['destroy']);module[_0xe2f5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 07b82ad..eea1fc8 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 _0xed90=['integrationTab','sequelize','exports','STRING','basic','ENUM','newTab'];(function(_0x3eb695,_0x269afc){var _0x31e571=function(_0x7be1cb){while(--_0x7be1cb){_0x3eb695['push'](_0x3eb695['shift']());}};_0x31e571(++_0x269afc);}(_0xed90,0x197));var _0x0ed9=function(_0x1016ad,_0x5a74aa){_0x1016ad=_0x1016ad-0x0;var _0x2c19a6=_0xed90[_0x1016ad];return _0x2c19a6;};'use strict';var Sequelize=require(_0x0ed9('0x0'));module[_0x0ed9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0ed9('0x2')]},'remoteUri':{'type':Sequelize[_0x0ed9('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x0ed9('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x0ed9('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0ed9('0x2')]},'token':{'type':Sequelize[_0x0ed9('0x2')]},'tokenSecret':{'type':Sequelize[_0x0ed9('0x2')]},'serverUrl':{'type':Sequelize[_0x0ed9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0ed9('0x4')]('integrationTab',_0x0ed9('0x5')),'defaultValue':_0x0ed9('0x6')}}; \ No newline at end of file +var _0xea20=['newTab','sequelize','exports','STRING','basic','ENUM','integrationTab'];(function(_0x4be18a,_0x326e6d){var _0x5042d4=function(_0x3f6157){while(--_0x3f6157){_0x4be18a['push'](_0x4be18a['shift']());}};_0x5042d4(++_0x326e6d);}(_0xea20,0xef));var _0x0ea2=function(_0x20e9f6,_0x24b369){_0x20e9f6=_0x20e9f6-0x0;var _0x3165c5=_0xea20[_0x20e9f6];return _0x3165c5;};'use strict';var Sequelize=require(_0x0ea2('0x0'));module[_0x0ea2('0x1')]={'name':{'type':Sequelize[_0x0ea2('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0ea2('0x2')]},'remoteUri':{'type':Sequelize[_0x0ea2('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x0ea2('0x3')},'password':{'type':Sequelize[_0x0ea2('0x2')]},'consumerKey':{'type':Sequelize[_0x0ea2('0x2')]},'consumerSecret':{'type':Sequelize[_0x0ea2('0x2')]},'token':{'type':Sequelize[_0x0ea2('0x2')]},'tokenSecret':{'type':Sequelize[_0x0ea2('0x2')]},'serverUrl':{'type':Sequelize[_0x0ea2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0ea2('0x4')](_0x0ea2('0x5'),_0x0ea2('0x6')),'defaultValue':_0x0ea2('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 82dd70f..edad7fe 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 _0x59f4=['undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','channel','getDescriptions','DeskField','Descriptions','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x59f4,0xca));var _0x459f=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0x59f4[_0x5d0609];return _0xaa3fd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x459f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x459f('0x1'));var rp=require(_0x459f('0x2'));var moment=require(_0x459f('0x3'));var BPromise=require(_0x459f('0x4'));var Mustache=require(_0x459f('0x5'));var util=require(_0x459f('0x6'));var path=require(_0x459f('0x7'));var sox=require(_0x459f('0x8'));var csv=require(_0x459f('0x9'));var ejs=require(_0x459f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x459f('0xb'));var squel=require(_0x459f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x459f('0xd'));var toCsv=require(_0x459f('0x9'));var querystring=require(_0x459f('0xe'));var Papa=require('papaparse');var Redis=require(_0x459f('0xf'));var authService=require(_0x459f('0x10'));var qs=require(_0x459f('0x11'));var as=require(_0x459f('0x12'));var hardwareService=require(_0x459f('0x13'));var logger=require(_0x459f('0x14'))(_0x459f('0x15'));var utils=require(_0x459f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x459f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x459f('0x18'));function respondWithStatusCode(_0x9ea1a8,_0xf3cc90){_0xf3cc90=_0xf3cc90||0xcc;return function(_0x2d67f0){if(_0x2d67f0){return _0x9ea1a8[_0x459f('0x19')](_0xf3cc90);}return _0x9ea1a8['status'](_0xf3cc90)[_0x459f('0x1a')]();};}function respondWithResult(_0x505adf,_0x44627c){_0x44627c=_0x44627c||0xc8;return function(_0x23ce59){if(_0x23ce59){return _0x505adf[_0x459f('0x1b')](_0x44627c)[_0x459f('0x1c')](_0x23ce59);}};}function respondWithFilteredResult(_0x2601bf,_0x2bee14){return function(_0x19cec2){if(_0x19cec2){var _0x5e2dbc=typeof _0x2bee14[_0x459f('0x1d')]===_0x459f('0x1e')&&typeof _0x2bee14[_0x459f('0x1f')]===_0x459f('0x1e');var _0xbddd3b=_0x19cec2[_0x459f('0x20')];var _0x1b5611=_0x5e2dbc?0x0:_0x2bee14['offset'];var _0x46b4eb=_0x5e2dbc?_0x19cec2[_0x459f('0x20')]:_0x2bee14['offset']+_0x2bee14['limit'];var _0x53605e;if(_0x46b4eb>=_0xbddd3b){_0x46b4eb=_0xbddd3b;_0x53605e=0xc8;}else{_0x53605e=0xce;}_0x2601bf[_0x459f('0x1b')](_0x53605e);return _0x2601bf['set']('Content-Range',_0x1b5611+'-'+_0x46b4eb+'/'+_0xbddd3b)[_0x459f('0x1c')](_0x19cec2);}return null;};}function patchUpdates(_0x3715a7){return function(_0x52fed2){try{jsonpatch[_0x459f('0x21')](_0x52fed2,_0x3715a7,!![]);}catch(_0x5cb1b6){return BPromise[_0x459f('0x22')](_0x5cb1b6);}return _0x52fed2[_0x459f('0x23')]();};}function saveUpdates(_0x568a1d,_0x2f4a5a){return function(_0x5c0fa5){if(_0x5c0fa5){return _0x5c0fa5[_0x459f('0x24')](_0x568a1d)['then'](function(_0x4c8ccf){return _0x4c8ccf;});}return null;};}function removeEntity(_0x9ca105,_0x21f4cb){return function(_0x371ecf){if(_0x371ecf){return _0x371ecf[_0x459f('0x25')]()[_0x459f('0x26')](function(){_0x9ca105['status'](0xcc)[_0x459f('0x1a')]();});}};}function handleEntityNotFound(_0x16c8aa,_0x4057b3){return function(_0x594375){if(!_0x594375){_0x16c8aa['sendStatus'](0x194);}return _0x594375;};}function handleError(_0x58c6be,_0xd5e27a){_0xd5e27a=_0xd5e27a||0x1f4;return function(_0x2a62a5){logger[_0x459f('0x27')](_0x2a62a5[_0x459f('0x28')]);if(_0x2a62a5[_0x459f('0x29')]){delete _0x2a62a5[_0x459f('0x29')];}_0x58c6be[_0x459f('0x1b')](_0xd5e27a)['send'](_0x2a62a5);};}exports[_0x459f('0x2a')]=function(_0x483c4d,_0xf83b24){var _0x2082c8={},_0x5e14d4={},_0x165a10={'count':0x0,'rows':[]};var _0xacd92a=_['map'](db[_0x459f('0x2b')][_0x459f('0x2c')],function(_0x385f8b){return{'name':_0x385f8b[_0x459f('0x2d')],'type':_0x385f8b[_0x459f('0x2e')][_0x459f('0x2f')]};});_0x5e14d4[_0x459f('0x30')]=_[_0x459f('0x31')](_0xacd92a,_0x459f('0x29'));_0x5e14d4[_0x459f('0x32')]=_[_0x459f('0x33')](_0x483c4d[_0x459f('0x32')]);_0x5e14d4[_0x459f('0x34')]=_[_0x459f('0x35')](_0x5e14d4[_0x459f('0x30')],_0x5e14d4[_0x459f('0x32')]);_0x2082c8[_0x459f('0x36')]=_['intersection'](_0x5e14d4['model'],qs[_0x459f('0x37')](_0x483c4d['query'][_0x459f('0x37')]));_0x2082c8[_0x459f('0x36')]=_0x2082c8['attributes'][_0x459f('0x38')]?_0x2082c8[_0x459f('0x36')]:_0x5e14d4['model'];if(!_0x483c4d['query'][_0x459f('0x39')](_0x459f('0x3a'))){_0x2082c8['limit']=qs[_0x459f('0x1f')](_0x483c4d['query'][_0x459f('0x1f')]);_0x2082c8[_0x459f('0x1d')]=qs[_0x459f('0x1d')](_0x483c4d[_0x459f('0x32')][_0x459f('0x1d')]);}_0x2082c8['order']=qs[_0x459f('0x3b')](_0x483c4d[_0x459f('0x32')][_0x459f('0x3b')]);_0x2082c8[_0x459f('0x3c')]=qs[_0x459f('0x34')](_[_0x459f('0x3d')](_0x483c4d['query'],_0x5e14d4['filters']),_0xacd92a);if(_0x483c4d[_0x459f('0x32')][_0x459f('0x3e')]){_0x2082c8[_0x459f('0x3c')]=_[_0x459f('0x3f')](_0x2082c8[_0x459f('0x3c')],{'$or':_['map'](_0xacd92a,function(_0x28fa2f){if(_0x28fa2f['type']!==_0x459f('0x40')){var _0x936fb3={};_0x936fb3[_0x28fa2f['name']]={'$like':'%'+_0x483c4d[_0x459f('0x32')][_0x459f('0x3e')]+'%'};return _0x936fb3;}})});}_0x2082c8=_[_0x459f('0x3f')]({},_0x2082c8,_0x483c4d[_0x459f('0x41')]);var _0x31410a={'where':_0x2082c8[_0x459f('0x3c')]};return db[_0x459f('0x2b')][_0x459f('0x20')](_0x31410a)['then'](function(_0x161c1a){_0x165a10[_0x459f('0x20')]=_0x161c1a;if(_0x483c4d[_0x459f('0x32')][_0x459f('0x42')]){_0x2082c8[_0x459f('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0x459f('0x44')](_0x2082c8);})['then'](function(_0xffd6c9){_0x165a10[_0x459f('0x45')]=_0xffd6c9;return _0x165a10;})['then'](respondWithFilteredResult(_0xf83b24,_0x2082c8))[_0x459f('0x46')](handleError(_0xf83b24,null));};exports[_0x459f('0x47')]=function(_0xcca265,_0x2d1001){var _0x12e20c={'raw':![],'where':{'id':_0xcca265[_0x459f('0x48')]['id']}},_0x3fb35a={};_0x3fb35a[_0x459f('0x30')]=_[_0x459f('0x33')](db[_0x459f('0x2b')][_0x459f('0x2c')]);_0x3fb35a[_0x459f('0x32')]=_['keys'](_0xcca265[_0x459f('0x32')]);_0x3fb35a[_0x459f('0x34')]=_[_0x459f('0x35')](_0x3fb35a[_0x459f('0x30')],_0x3fb35a['query']);_0x12e20c[_0x459f('0x36')]=_[_0x459f('0x35')](_0x3fb35a[_0x459f('0x30')],qs['fields'](_0xcca265['query'][_0x459f('0x37')]));_0x12e20c['attributes']=_0x12e20c[_0x459f('0x36')]['length']?_0x12e20c[_0x459f('0x36')]:_0x3fb35a[_0x459f('0x30')];if(_0xcca265[_0x459f('0x32')][_0x459f('0x42')]){_0x12e20c[_0x459f('0x43')]=[{'all':!![]}];}_0x12e20c=_[_0x459f('0x3f')]({},_0x12e20c,_0xcca265[_0x459f('0x41')]);return db['DeskAccount'][_0x459f('0x49')](_0x12e20c)['then'](handleEntityNotFound(_0x2d1001,null))[_0x459f('0x26')](respondWithResult(_0x2d1001,null))[_0x459f('0x46')](handleError(_0x2d1001,null));};exports[_0x459f('0x4a')]=function(_0x11533a,_0x24d4b6){return db[_0x459f('0x2b')][_0x459f('0x4a')](_0x11533a['body'],{})[_0x459f('0x26')](respondWithResult(_0x24d4b6,0xc9))[_0x459f('0x46')](handleError(_0x24d4b6,null));};exports[_0x459f('0x24')]=function(_0x282413,_0x2d6bbc){if(_0x282413['body']['id']){delete _0x282413[_0x459f('0x4b')]['id'];}return db['DeskAccount'][_0x459f('0x49')]({'where':{'id':_0x282413[_0x459f('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d6bbc,null))[_0x459f('0x26')](saveUpdates(_0x282413[_0x459f('0x4b')],null))['then'](respondWithResult(_0x2d6bbc,null))[_0x459f('0x46')](handleError(_0x2d6bbc,null));};exports['destroy']=function(_0x17b2f6,_0x5eaf7b){return db[_0x459f('0x2b')]['find']({'where':{'id':_0x17b2f6[_0x459f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eaf7b,null))[_0x459f('0x26')](removeEntity(_0x5eaf7b,null))[_0x459f('0x46')](handleError(_0x5eaf7b,null));};exports[_0x459f('0x4c')]=function(_0x477e65,_0x5beae6,_0x1a7146){var _0x45c499={};var _0x58132b={};var _0x1a6f05;var _0x2ba517;return db[_0x459f('0x2b')][_0x459f('0x4d')]({'where':{'id':_0x477e65['params']['id']}})[_0x459f('0x26')](handleEntityNotFound(_0x5beae6,null))[_0x459f('0x26')](function(_0x5ad6fa){if(_0x5ad6fa){_0x1a6f05=_0x5ad6fa;_0x58132b[_0x459f('0x30')]=_[_0x459f('0x33')](db[_0x459f('0x4e')]['rawAttributes']);_0x58132b[_0x459f('0x32')]=_[_0x459f('0x33')](_0x477e65['query']);_0x58132b['filters']=_[_0x459f('0x35')](_0x58132b['model'],_0x58132b['query']);_0x45c499[_0x459f('0x36')]=_[_0x459f('0x35')](_0x58132b[_0x459f('0x30')],qs[_0x459f('0x37')](_0x477e65[_0x459f('0x32')][_0x459f('0x37')]));_0x45c499[_0x459f('0x36')]=_0x45c499[_0x459f('0x36')][_0x459f('0x38')]?_0x45c499[_0x459f('0x36')]:_0x58132b['model'];_0x45c499[_0x459f('0x4f')]=qs[_0x459f('0x3b')](_0x477e65[_0x459f('0x32')]['sort']);_0x45c499[_0x459f('0x3c')]=qs[_0x459f('0x34')](_[_0x459f('0x3d')](_0x477e65['query'],_0x58132b[_0x459f('0x34')]));if(_0x477e65[_0x459f('0x32')][_0x459f('0x3e')]){_0x45c499[_0x459f('0x3c')]=_[_0x459f('0x3f')](_0x45c499[_0x459f('0x3c')],{'$or':_['map'](_0x45c499[_0x459f('0x36')],function(_0x225aed){var _0x319621={};_0x319621[_0x225aed]={'$like':'%'+_0x477e65[_0x459f('0x32')][_0x459f('0x3e')]+'%'};return _0x319621;})});}_0x45c499=_[_0x459f('0x3f')]({},_0x45c499,_0x477e65['options']);return _0x1a6f05['getConfigurations'](_0x45c499);}})['then'](function(_0x2eb752){if(_0x2eb752){_0x2ba517=_0x2eb752['length'];if(!_0x477e65[_0x459f('0x32')][_0x459f('0x39')]('nolimit')){_0x45c499[_0x459f('0x1f')]=qs['limit'](_0x477e65['query'][_0x459f('0x1f')]);_0x45c499[_0x459f('0x1d')]=qs[_0x459f('0x1d')](_0x477e65['query'][_0x459f('0x1d')]);}return _0x1a6f05[_0x459f('0x4c')](_0x45c499);}})[_0x459f('0x26')](function(_0x3cecac){if(_0x3cecac){return _0x3cecac?{'count':_0x2ba517,'rows':_0x3cecac}:null;}})[_0x459f('0x26')](respondWithResult(_0x5beae6,null))[_0x459f('0x46')](handleError(_0x5beae6,null));};exports[_0x459f('0x50')]=function(_0x386c1e,_0x272f66,_0x571239){if(_0x386c1e[_0x459f('0x4b')]['id']){delete _0x386c1e[_0x459f('0x4b')]['id'];}return db[_0x459f('0x2b')]['findOne']({'where':{'id':_0x386c1e[_0x459f('0x48')]['id']}})[_0x459f('0x26')](handleEntityNotFound(_0x272f66,null))[_0x459f('0x26')](function(_0x52741f){if(_0x52741f){_0x386c1e['body'][_0x459f('0x51')]=_0x52741f['id'];_0x386c1e[_0x459f('0x4b')][_0x459f('0x52')]=integrations['getSubjects'](_0x386c1e[_0x459f('0x4b')][_0x459f('0x53')],_0x386c1e['body'][_0x459f('0x2e')]);_0x386c1e[_0x459f('0x4b')]['Descriptions']=integrations[_0x459f('0x54')](_0x386c1e[_0x459f('0x4b')]['channel'],_0x386c1e[_0x459f('0x4b')][_0x459f('0x2e')]);return db[_0x459f('0x4e')][_0x459f('0x4a')](_0x386c1e['body'],{'include':[{'model':db[_0x459f('0x55')],'as':_0x459f('0x52')},{'model':db['DeskField'],'as':_0x459f('0x56')}]});}return null;})[_0x459f('0x26')](respondWithResult(_0x272f66,null))[_0x459f('0x46')](handleError(_0x272f66,null));};exports['getFields']=function(_0x47e6bf,_0x921d9d,_0x16ee6e){var _0x159f3b=[{'name':_0x459f('0x57'),'label':_0x459f('0x57'),'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 _0x5a5229='';return db[_0x459f('0x2b')]['findOne']({'where':{'id':_0x47e6bf[_0x459f('0x48')]['id']},'attributes':['id','remoteUri',_0x459f('0x58'),_0x459f('0x59'),_0x459f('0x5a'),_0x459f('0x5b'),'consumerSecret',_0x459f('0x5c'),_0x459f('0x5d')]})[_0x459f('0x26')](handleEntityNotFound(_0x921d9d,null))[_0x459f('0x26')](function(_0x171f2b){if(_0x171f2b){_0x5a5229=_0x171f2b[_0x459f('0x5e')];var _0x1fe156=_0x5a5229[_0x459f('0x5f')](-0x1);if(_0x1fe156==='/'){_0x5a5229=_0x5a5229['substring'](0x0,_0x5a5229['lastIndexOf'](_0x1fe156));}var _0x5d9595={'method':_0x459f('0x60'),'uri':util[_0x459f('0x61')](_0x459f('0x62'),_0x5a5229),'headers':{'Content-Type':_0x459f('0x63'),'Accept':_0x459f('0x63')},'json':!![]};if(_0x171f2b[_0x459f('0x58')]===_0x459f('0x64')){_0x5d9595[_0x459f('0x65')][_0x459f('0x66')]=util[_0x459f('0x61')](_0x459f('0x67'),new Buffer(util[_0x459f('0x61')](_0x459f('0x68'),_0x171f2b[_0x459f('0x59')],_0x171f2b[_0x459f('0x5a')]))[_0x459f('0x69')]('base64'));}return rp(_0x5d9595)['then'](function(_0x17801f){return _0x159f3b[_0x459f('0x6a')](_[_0x459f('0x31')](_0x17801f[_0x459f('0x6b')]['entries'],function(_0xfd07e0){return{'id':_0xfd07e0[_0x459f('0x29')],'name':_0xfd07e0[_0x459f('0x29')],'type':_0xfd07e0[_0x459f('0x2e')],'active':_0xfd07e0[_0x459f('0x6c')],'label':_0xfd07e0['label'],'custom':!![]};}));});}})[_0x459f('0x26')](function(_0x1f8c8b){return{'count':_0x1f8c8b[_0x459f('0x38')],'rows':_0x1f8c8b};})[_0x459f('0x26')](respondWithResult(_0x921d9d,null))[_0x459f('0x46')](function(_0x2078dd){var _0x12a961=_0x47e6bf[_0x459f('0x32')][_0x459f('0x6d')]?0x1f4:_0x2078dd[_0x459f('0x6e')]||0x1f4;logger[_0x459f('0x27')](_0x459f('0x6f'),_0x459f('0x70'),_0x12a961,JSON[_0x459f('0x71')](_0x2078dd));delete _0x2078dd[_0x459f('0x29')];if(_0x12a961===0x191){_0x12a961=0x190;}_0x921d9d[_0x459f('0x1b')](_0x12a961)[_0x459f('0x72')](_0x47e6bf[_0x459f('0x32')][_0x459f('0x6d')]?{'message':_0x459f('0x73'),'statusCode':_0x2078dd[_0x459f('0x6e')]}:_0x2078dd);});}; \ No newline at end of file +var _0x6e3e=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','DeskAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','catch','show','options','find','create','body','update','params','getConfigurations','findOne','DeskConfiguration','rawAttributes','pick','AccountId','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerSecret','token','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','headers','Authorization','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x46ecfb,_0xec33c7){var _0x574f47=function(_0x2dd02b){while(--_0x2dd02b){_0x46ecfb['push'](_0x46ecfb['shift']());}};_0x574f47(++_0xec33c7);}(_0x6e3e,0x1a7));var _0xe6e3=function(_0x71404d,_0x3669d5){_0x71404d=_0x71404d-0x0;var _0x2c3bd1=_0x6e3e[_0x71404d];return _0x2c3bd1;};'use strict';var emlformat=require(_0xe6e3('0x0'));var rimraf=require(_0xe6e3('0x1'));var zipdir=require(_0xe6e3('0x2'));var jsonpatch=require(_0xe6e3('0x3'));var rp=require(_0xe6e3('0x4'));var moment=require(_0xe6e3('0x5'));var BPromise=require(_0xe6e3('0x6'));var Mustache=require(_0xe6e3('0x7'));var util=require('util');var path=require(_0xe6e3('0x8'));var sox=require('sox');var csv=require(_0xe6e3('0x9'));var ejs=require(_0xe6e3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6e3('0xb'));var squel=require(_0xe6e3('0xc'));var crypto=require(_0xe6e3('0xd'));var jsforce=require(_0xe6e3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6e3('0xf'));var Papa=require(_0xe6e3('0x10'));var Redis=require(_0xe6e3('0x11'));var authService=require(_0xe6e3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe6e3('0x13'));var hardwareService=require(_0xe6e3('0x14'));var logger=require(_0xe6e3('0x15'))(_0xe6e3('0x16'));var utils=require(_0xe6e3('0x17'));var config=require(_0xe6e3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6e3('0x19'))['db'];var integrations=require(_0xe6e3('0x1a'));function respondWithStatusCode(_0x47e967,_0x3b69b1){_0x3b69b1=_0x3b69b1||0xcc;return function(_0x213b8c){if(_0x213b8c){return _0x47e967[_0xe6e3('0x1b')](_0x3b69b1);}return _0x47e967[_0xe6e3('0x1c')](_0x3b69b1)[_0xe6e3('0x1d')]();};}function respondWithResult(_0x264d3a,_0x44acf8){_0x44acf8=_0x44acf8||0xc8;return function(_0x1eeaaf){if(_0x1eeaaf){return _0x264d3a[_0xe6e3('0x1c')](_0x44acf8)[_0xe6e3('0x1e')](_0x1eeaaf);}};}function respondWithFilteredResult(_0x137876,_0x3c095c){return function(_0x4c6ebd){if(_0x4c6ebd){var _0x4975ad=typeof _0x3c095c['offset']===_0xe6e3('0x1f')&&typeof _0x3c095c[_0xe6e3('0x20')]===_0xe6e3('0x1f');var _0x4541a1=_0x4c6ebd[_0xe6e3('0x21')];var _0xc2c51d=_0x4975ad?0x0:_0x3c095c['offset'];var _0x5d2174=_0x4975ad?_0x4c6ebd[_0xe6e3('0x21')]:_0x3c095c[_0xe6e3('0x22')]+_0x3c095c[_0xe6e3('0x20')];var _0xbfb1b1;if(_0x5d2174>=_0x4541a1){_0x5d2174=_0x4541a1;_0xbfb1b1=0xc8;}else{_0xbfb1b1=0xce;}_0x137876[_0xe6e3('0x1c')](_0xbfb1b1);return _0x137876[_0xe6e3('0x23')](_0xe6e3('0x24'),_0xc2c51d+'-'+_0x5d2174+'/'+_0x4541a1)[_0xe6e3('0x1e')](_0x4c6ebd);}return null;};}function patchUpdates(_0x16abab){return function(_0xdd4aeb){try{jsonpatch[_0xe6e3('0x25')](_0xdd4aeb,_0x16abab,!![]);}catch(_0x4d02c4){return BPromise[_0xe6e3('0x26')](_0x4d02c4);}return _0xdd4aeb[_0xe6e3('0x27')]();};}function saveUpdates(_0x200e41,_0x44775d){return function(_0x4a0771){if(_0x4a0771){return _0x4a0771['update'](_0x200e41)['then'](function(_0x5baba6){return _0x5baba6;});}return null;};}function removeEntity(_0x44895f,_0x245447){return function(_0x4ab2f3){if(_0x4ab2f3){return _0x4ab2f3[_0xe6e3('0x28')]()[_0xe6e3('0x29')](function(){_0x44895f[_0xe6e3('0x1c')](0xcc)[_0xe6e3('0x1d')]();});}};}function handleEntityNotFound(_0x48477a,_0x2e73e5){return function(_0x452fe4){if(!_0x452fe4){_0x48477a[_0xe6e3('0x1b')](0x194);}return _0x452fe4;};}function handleError(_0x45ed76,_0x425a98){_0x425a98=_0x425a98||0x1f4;return function(_0x5b0245){logger[_0xe6e3('0x2a')](_0x5b0245['stack']);if(_0x5b0245['name']){delete _0x5b0245[_0xe6e3('0x2b')];}_0x45ed76['status'](_0x425a98)[_0xe6e3('0x2c')](_0x5b0245);};}exports[_0xe6e3('0x2d')]=function(_0x188522,_0x187ba7){var _0x56e27e={},_0x4c4868={},_0x195b1c={'count':0x0,'rows':[]};var _0x485f87=_['map'](db[_0xe6e3('0x2e')]['rawAttributes'],function(_0x1982be){return{'name':_0x1982be[_0xe6e3('0x2f')],'type':_0x1982be[_0xe6e3('0x30')][_0xe6e3('0x31')]};});_0x4c4868[_0xe6e3('0x32')]=_[_0xe6e3('0x33')](_0x485f87,'name');_0x4c4868[_0xe6e3('0x34')]=_[_0xe6e3('0x35')](_0x188522[_0xe6e3('0x34')]);_0x4c4868[_0xe6e3('0x36')]=_[_0xe6e3('0x37')](_0x4c4868[_0xe6e3('0x32')],_0x4c4868[_0xe6e3('0x34')]);_0x56e27e[_0xe6e3('0x38')]=_[_0xe6e3('0x37')](_0x4c4868[_0xe6e3('0x32')],qs['fields'](_0x188522['query'][_0xe6e3('0x39')]));_0x56e27e['attributes']=_0x56e27e['attributes'][_0xe6e3('0x3a')]?_0x56e27e[_0xe6e3('0x38')]:_0x4c4868[_0xe6e3('0x32')];if(!_0x188522[_0xe6e3('0x34')][_0xe6e3('0x3b')](_0xe6e3('0x3c'))){_0x56e27e[_0xe6e3('0x20')]=qs[_0xe6e3('0x20')](_0x188522[_0xe6e3('0x34')]['limit']);_0x56e27e[_0xe6e3('0x22')]=qs['offset'](_0x188522[_0xe6e3('0x34')][_0xe6e3('0x22')]);}_0x56e27e[_0xe6e3('0x3d')]=qs[_0xe6e3('0x3e')](_0x188522[_0xe6e3('0x34')][_0xe6e3('0x3e')]);_0x56e27e[_0xe6e3('0x3f')]=qs['filters'](_['pick'](_0x188522[_0xe6e3('0x34')],_0x4c4868[_0xe6e3('0x36')]),_0x485f87);if(_0x188522['query'][_0xe6e3('0x40')]){_0x56e27e[_0xe6e3('0x3f')]=_[_0xe6e3('0x41')](_0x56e27e['where'],{'$or':_['map'](_0x485f87,function(_0x394ee5){if(_0x394ee5[_0xe6e3('0x30')]!==_0xe6e3('0x42')){var _0x17a4f5={};_0x17a4f5[_0x394ee5[_0xe6e3('0x2b')]]={'$like':'%'+_0x188522[_0xe6e3('0x34')][_0xe6e3('0x40')]+'%'};return _0x17a4f5;}})});}_0x56e27e=_[_0xe6e3('0x41')]({},_0x56e27e,_0x188522['options']);var _0x1f114a={'where':_0x56e27e[_0xe6e3('0x3f')]};return db[_0xe6e3('0x2e')]['count'](_0x1f114a)['then'](function(_0x9d5728){_0x195b1c[_0xe6e3('0x21')]=_0x9d5728;if(_0x188522[_0xe6e3('0x34')]['includeAll']){_0x56e27e[_0xe6e3('0x43')]=[{'all':!![]}];}return db[_0xe6e3('0x2e')]['findAll'](_0x56e27e);})[_0xe6e3('0x29')](function(_0x692eb){_0x195b1c['rows']=_0x692eb;return _0x195b1c;})[_0xe6e3('0x29')](respondWithFilteredResult(_0x187ba7,_0x56e27e))[_0xe6e3('0x44')](handleError(_0x187ba7,null));};exports[_0xe6e3('0x45')]=function(_0x1560a1,_0x1f1220){var _0x4f4268={'raw':![],'where':{'id':_0x1560a1['params']['id']}},_0x31a2f1={};_0x31a2f1[_0xe6e3('0x32')]=_[_0xe6e3('0x35')](db[_0xe6e3('0x2e')]['rawAttributes']);_0x31a2f1['query']=_[_0xe6e3('0x35')](_0x1560a1[_0xe6e3('0x34')]);_0x31a2f1[_0xe6e3('0x36')]=_[_0xe6e3('0x37')](_0x31a2f1[_0xe6e3('0x32')],_0x31a2f1[_0xe6e3('0x34')]);_0x4f4268['attributes']=_[_0xe6e3('0x37')](_0x31a2f1[_0xe6e3('0x32')],qs[_0xe6e3('0x39')](_0x1560a1['query']['fields']));_0x4f4268['attributes']=_0x4f4268[_0xe6e3('0x38')]['length']?_0x4f4268[_0xe6e3('0x38')]:_0x31a2f1['model'];if(_0x1560a1[_0xe6e3('0x34')]['includeAll']){_0x4f4268[_0xe6e3('0x43')]=[{'all':!![]}];}_0x4f4268=_['merge']({},_0x4f4268,_0x1560a1[_0xe6e3('0x46')]);return db['DeskAccount'][_0xe6e3('0x47')](_0x4f4268)[_0xe6e3('0x29')](handleEntityNotFound(_0x1f1220,null))[_0xe6e3('0x29')](respondWithResult(_0x1f1220,null))['catch'](handleError(_0x1f1220,null));};exports[_0xe6e3('0x48')]=function(_0x420fb0,_0x2276e6){return db['DeskAccount'][_0xe6e3('0x48')](_0x420fb0[_0xe6e3('0x49')],{})[_0xe6e3('0x29')](respondWithResult(_0x2276e6,0xc9))[_0xe6e3('0x44')](handleError(_0x2276e6,null));};exports[_0xe6e3('0x4a')]=function(_0x3fce62,_0x1d53a0){if(_0x3fce62[_0xe6e3('0x49')]['id']){delete _0x3fce62[_0xe6e3('0x49')]['id'];}return db[_0xe6e3('0x2e')][_0xe6e3('0x47')]({'where':{'id':_0x3fce62[_0xe6e3('0x4b')]['id']}})[_0xe6e3('0x29')](handleEntityNotFound(_0x1d53a0,null))['then'](saveUpdates(_0x3fce62[_0xe6e3('0x49')],null))['then'](respondWithResult(_0x1d53a0,null))[_0xe6e3('0x44')](handleError(_0x1d53a0,null));};exports[_0xe6e3('0x28')]=function(_0x44b032,_0x57ae70){return db[_0xe6e3('0x2e')][_0xe6e3('0x47')]({'where':{'id':_0x44b032[_0xe6e3('0x4b')]['id']}})[_0xe6e3('0x29')](handleEntityNotFound(_0x57ae70,null))[_0xe6e3('0x29')](removeEntity(_0x57ae70,null))[_0xe6e3('0x44')](handleError(_0x57ae70,null));};exports[_0xe6e3('0x4c')]=function(_0x4b1d8b,_0x318992,_0x2257ef){var _0x2e4e91={};var _0x187a2c={};var _0x22e40f;var _0x20ce4c;return db[_0xe6e3('0x2e')][_0xe6e3('0x4d')]({'where':{'id':_0x4b1d8b['params']['id']}})[_0xe6e3('0x29')](handleEntityNotFound(_0x318992,null))['then'](function(_0x5c5d68){if(_0x5c5d68){_0x22e40f=_0x5c5d68;_0x187a2c[_0xe6e3('0x32')]=_[_0xe6e3('0x35')](db[_0xe6e3('0x4e')][_0xe6e3('0x4f')]);_0x187a2c[_0xe6e3('0x34')]=_[_0xe6e3('0x35')](_0x4b1d8b[_0xe6e3('0x34')]);_0x187a2c[_0xe6e3('0x36')]=_[_0xe6e3('0x37')](_0x187a2c[_0xe6e3('0x32')],_0x187a2c[_0xe6e3('0x34')]);_0x2e4e91['attributes']=_[_0xe6e3('0x37')](_0x187a2c[_0xe6e3('0x32')],qs[_0xe6e3('0x39')](_0x4b1d8b['query'][_0xe6e3('0x39')]));_0x2e4e91['attributes']=_0x2e4e91[_0xe6e3('0x38')][_0xe6e3('0x3a')]?_0x2e4e91[_0xe6e3('0x38')]:_0x187a2c['model'];_0x2e4e91['order']=qs[_0xe6e3('0x3e')](_0x4b1d8b[_0xe6e3('0x34')][_0xe6e3('0x3e')]);_0x2e4e91[_0xe6e3('0x3f')]=qs[_0xe6e3('0x36')](_[_0xe6e3('0x50')](_0x4b1d8b[_0xe6e3('0x34')],_0x187a2c['filters']));if(_0x4b1d8b[_0xe6e3('0x34')][_0xe6e3('0x40')]){_0x2e4e91['where']=_['merge'](_0x2e4e91[_0xe6e3('0x3f')],{'$or':_[_0xe6e3('0x33')](_0x2e4e91[_0xe6e3('0x38')],function(_0x1eb730){var _0x309cc3={};_0x309cc3[_0x1eb730]={'$like':'%'+_0x4b1d8b[_0xe6e3('0x34')][_0xe6e3('0x40')]+'%'};return _0x309cc3;})});}_0x2e4e91=_[_0xe6e3('0x41')]({},_0x2e4e91,_0x4b1d8b[_0xe6e3('0x46')]);return _0x22e40f[_0xe6e3('0x4c')](_0x2e4e91);}})[_0xe6e3('0x29')](function(_0x4feca0){if(_0x4feca0){_0x20ce4c=_0x4feca0[_0xe6e3('0x3a')];if(!_0x4b1d8b['query'][_0xe6e3('0x3b')](_0xe6e3('0x3c'))){_0x2e4e91[_0xe6e3('0x20')]=qs[_0xe6e3('0x20')](_0x4b1d8b[_0xe6e3('0x34')][_0xe6e3('0x20')]);_0x2e4e91[_0xe6e3('0x22')]=qs[_0xe6e3('0x22')](_0x4b1d8b[_0xe6e3('0x34')][_0xe6e3('0x22')]);}return _0x22e40f[_0xe6e3('0x4c')](_0x2e4e91);}})[_0xe6e3('0x29')](function(_0x2eed61){if(_0x2eed61){return _0x2eed61?{'count':_0x20ce4c,'rows':_0x2eed61}:null;}})[_0xe6e3('0x29')](respondWithResult(_0x318992,null))[_0xe6e3('0x44')](handleError(_0x318992,null));};exports['addConfiguration']=function(_0xb1e251,_0x3f5c81,_0x386966){if(_0xb1e251['body']['id']){delete _0xb1e251[_0xe6e3('0x49')]['id'];}return db['DeskAccount'][_0xe6e3('0x4d')]({'where':{'id':_0xb1e251[_0xe6e3('0x4b')]['id']}})[_0xe6e3('0x29')](handleEntityNotFound(_0x3f5c81,null))[_0xe6e3('0x29')](function(_0x41cebd){if(_0x41cebd){_0xb1e251[_0xe6e3('0x49')][_0xe6e3('0x51')]=_0x41cebd['id'];_0xb1e251[_0xe6e3('0x49')]['Subjects']=integrations[_0xe6e3('0x52')](_0xb1e251[_0xe6e3('0x49')][_0xe6e3('0x53')],_0xb1e251[_0xe6e3('0x49')]['type']);_0xb1e251[_0xe6e3('0x49')][_0xe6e3('0x54')]=integrations['getDescriptions'](_0xb1e251['body'][_0xe6e3('0x53')],_0xb1e251[_0xe6e3('0x49')][_0xe6e3('0x30')]);return db[_0xe6e3('0x4e')]['create'](_0xb1e251['body'],{'include':[{'model':db[_0xe6e3('0x55')],'as':'Subjects'},{'model':db[_0xe6e3('0x55')],'as':_0xe6e3('0x54')}]});}return null;})[_0xe6e3('0x29')](respondWithResult(_0x3f5c81,null))[_0xe6e3('0x44')](handleError(_0x3f5c81,null));};exports[_0xe6e3('0x56')]=function(_0x341eaf,_0x29c9b6,_0x24f1f9){var _0x5276db=[{'name':'priority','label':_0xe6e3('0x57'),'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 _0xccb258='';return db[_0xe6e3('0x2e')][_0xe6e3('0x4d')]({'where':{'id':_0x341eaf[_0xe6e3('0x4b')]['id']},'attributes':['id',_0xe6e3('0x58'),'authType',_0xe6e3('0x59'),_0xe6e3('0x5a'),'consumerKey',_0xe6e3('0x5b'),_0xe6e3('0x5c'),'tokenSecret']})[_0xe6e3('0x29')](handleEntityNotFound(_0x29c9b6,null))[_0xe6e3('0x29')](function(_0x1ec72d){if(_0x1ec72d){_0xccb258=_0x1ec72d[_0xe6e3('0x58')];var _0x1843d=_0xccb258[_0xe6e3('0x5d')](-0x1);if(_0x1843d==='/'){_0xccb258=_0xccb258[_0xe6e3('0x5e')](0x0,_0xccb258[_0xe6e3('0x5f')](_0x1843d));}var _0x2331f8={'method':'GET','uri':util[_0xe6e3('0x60')](_0xe6e3('0x61'),_0xccb258),'headers':{'Content-Type':_0xe6e3('0x62'),'Accept':_0xe6e3('0x62')},'json':!![]};if(_0x1ec72d[_0xe6e3('0x63')]==='basic'){_0x2331f8[_0xe6e3('0x64')][_0xe6e3('0x65')]=util[_0xe6e3('0x60')]('Basic\x20%s',new Buffer(util[_0xe6e3('0x60')](_0xe6e3('0x66'),_0x1ec72d[_0xe6e3('0x59')],_0x1ec72d[_0xe6e3('0x5a')]))[_0xe6e3('0x67')](_0xe6e3('0x68')));}return rp(_0x2331f8)[_0xe6e3('0x29')](function(_0x58302c){return _0x5276db[_0xe6e3('0x69')](_[_0xe6e3('0x33')](_0x58302c[_0xe6e3('0x6a')][_0xe6e3('0x6b')],function(_0x511e16){return{'id':_0x511e16[_0xe6e3('0x2b')],'name':_0x511e16[_0xe6e3('0x2b')],'type':_0x511e16[_0xe6e3('0x30')],'active':_0x511e16[_0xe6e3('0x6c')],'label':_0x511e16[_0xe6e3('0x6d')],'custom':!![]};}));});}})[_0xe6e3('0x29')](function(_0x235857){return{'count':_0x235857[_0xe6e3('0x3a')],'rows':_0x235857};})[_0xe6e3('0x29')](respondWithResult(_0x29c9b6,null))[_0xe6e3('0x44')](function(_0x348842){var _0x2c0d99=_0x341eaf[_0xe6e3('0x34')][_0xe6e3('0x6e')]?0x1f4:_0x348842['statusCode']||0x1f4;logger[_0xe6e3('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0xe6e3('0x56'),_0x2c0d99,JSON['stringify'](_0x348842));delete _0x348842['name'];if(_0x2c0d99===0x191){_0x2c0d99=0x190;}_0x29c9b6[_0xe6e3('0x1c')](_0x2c0d99)[_0xe6e3('0x2c')](_0x341eaf['query'][_0xe6e3('0x6e')]?{'message':_0xe6e3('0x6f'),'statusCode':_0x348842[_0xe6e3('0x70')]}:_0x348842);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index cab1fa9..8438261 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 _0xa244=['moment','bluebird','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api'];(function(_0x573347,_0x5d0032){var _0x1324ef=function(_0x13e331){while(--_0x13e331){_0x573347['push'](_0x573347['shift']());}};_0x1324ef(++_0x5d0032);}(_0xa244,0xa5));var _0x4a24=function(_0xd07e92,_0x595161){_0xd07e92=_0xd07e92-0x0;var _0x20f541=_0xa244[_0xd07e92];return _0x20f541;};'use strict';var _=require(_0x4a24('0x0'));var util=require(_0x4a24('0x1'));var logger=require(_0x4a24('0x2'))(_0x4a24('0x3'));var moment=require(_0x4a24('0x4'));var BPromise=require(_0x4a24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a24('0x6'));var rimraf=require(_0x4a24('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a24('0x8'));var integrations=require(_0x4a24('0x9'));module[_0x4a24('0xa')]=function(_0x387b08,_0x31a5f2){return _0x387b08[_0x4a24('0xb')](_0x4a24('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8e4=['../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x12575f,_0x305adc){var _0x81f20=function(_0x35fe32){while(--_0x35fe32){_0x12575f['push'](_0x12575f['shift']());}};_0x81f20(++_0x305adc);}(_0xb8e4,0x1b8));var _0x4b8e=function(_0x3e0f4e,_0x18fb50){_0x3e0f4e=_0x3e0f4e-0x0;var _0x555c1b=_0xb8e4[_0x3e0f4e];return _0x555c1b;};'use strict';var _=require(_0x4b8e('0x0'));var util=require(_0x4b8e('0x1'));var logger=require(_0x4b8e('0x2'))(_0x4b8e('0x3'));var moment=require(_0x4b8e('0x4'));var BPromise=require(_0x4b8e('0x5'));var rp=require(_0x4b8e('0x6'));var fs=require('fs');var path=require(_0x4b8e('0x7'));var rimraf=require('rimraf');var config=require(_0x4b8e('0x8'));var attributes=require(_0x4b8e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x4b8e('0xa')]=function(_0x27f02e,_0x2ebb0e){return _0x27f02e[_0x4b8e('0xb')](_0x4b8e('0xc'),attributes,{'tableName':_0x4b8e('0xd'),'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 905e52f..da4358a 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 _0x844b=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','options','raw','where','attributes','limit','include','map','model','info','stringify','DeskAccount','find','ShowDeskAccount','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','DeskAccount,\x20%s,\x20%s'];(function(_0x228d7c,_0xf01e7d){var _0x1ffa97=function(_0x5418dd){while(--_0x5418dd){_0x228d7c['push'](_0x228d7c['shift']());}};_0x1ffa97(++_0xf01e7d);}(_0x844b,0x135));var _0xb844=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x844b[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xb844('0x0'));var util=require(_0xb844('0x1'));var moment=require(_0xb844('0x2'));var BPromise=require('bluebird');var rs=require(_0xb844('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb844('0x4'));var logger=require(_0xb844('0x5'))(_0xb844('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb844('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x152d3b,_0x2dd0a8,_0x262f0a){return new BPromise(function(_0x3c5e67,_0x14975b){return client[_0xb844('0x8')](_0x152d3b,_0x262f0a)[_0xb844('0x9')](function(_0x564fe9){logger['info'](_0xb844('0xa'),_0x2dd0a8,_0xb844('0xb'));logger[_0xb844('0xc')](_0xb844('0xd'),_0x2dd0a8,_0xb844('0xb'),JSON['stringify'](_0x564fe9));if(_0x564fe9[_0xb844('0xe')]){if(_0x564fe9[_0xb844('0xe')][_0xb844('0xf')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x2dd0a8,_0x564fe9['error'][_0xb844('0x10')]);return _0x14975b(_0x564fe9[_0xb844('0xe')][_0xb844('0x10')]);}logger[_0xb844('0xe')]('DeskAccount,\x20%s,\x20%s',_0x2dd0a8,_0x564fe9[_0xb844('0xe')][_0xb844('0x10')]);return _0x3c5e67(_0x564fe9['error'][_0xb844('0x10')]);}else{logger['info'](_0xb844('0xa'),_0x2dd0a8,_0xb844('0xb'));_0x3c5e67(_0x564fe9['result'][_0xb844('0x10')]);}})[_0xb844('0x11')](function(_0x5934ba){logger['error'](_0xb844('0xa'),_0x2dd0a8,_0x5934ba);_0x14975b(_0x5934ba);});});}exports[_0xb844('0x12')]=function(_0x5ed296){var _0x433ce4=this;return new Promise(function(_0x46cbd3,_0x3474c7){return db['DeskAccount']['findAll']({'raw':_0x5ed296[_0xb844('0x13')]?_0x5ed296[_0xb844('0x13')][_0xb844('0x14')]===undefined?!![]:![]:!![],'where':_0x5ed296[_0xb844('0x13')]?_0x5ed296[_0xb844('0x13')][_0xb844('0x15')]||null:null,'attributes':_0x5ed296['options']?_0x5ed296['options'][_0xb844('0x16')]||null:null,'limit':_0x5ed296[_0xb844('0x13')]?_0x5ed296['options'][_0xb844('0x17')]||null:null,'include':_0x5ed296[_0xb844('0x13')]?_0x5ed296['options'][_0xb844('0x18')]?_[_0xb844('0x19')](_0x5ed296[_0xb844('0x13')]['include'],function(_0x29513a){return{'model':db[_0x29513a['model']],'as':_0x29513a['as'],'attributes':_0x29513a['attributes'],'include':_0x29513a[_0xb844('0x18')]?_[_0xb844('0x19')](_0x29513a[_0xb844('0x18')],function(_0x83502d){return{'model':db[_0x83502d[_0xb844('0x1a')]],'as':_0x83502d['as'],'attributes':_0x83502d[_0xb844('0x16')],'include':_0x83502d[_0xb844('0x18')]?_['map'](_0x83502d[_0xb844('0x18')],function(_0x4d0ea6){return{'model':db[_0x4d0ea6[_0xb844('0x1a')]],'as':_0x4d0ea6['as'],'attributes':_0x4d0ea6[_0xb844('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bff58){logger[_0xb844('0x1b')](_0xb844('0x12'),_0x5ed296);logger[_0xb844('0xc')](_0xb844('0x12'),_0x5ed296,JSON[_0xb844('0x1c')](_0x2bff58));_0x46cbd3(_0x2bff58);})['catch'](function(_0x5a91f9){logger[_0xb844('0xe')](_0xb844('0x12'),_0x5a91f9[_0xb844('0x10')],_0x5ed296);_0x3474c7(_0x433ce4[_0xb844('0xe')](0x1f4,_0x5a91f9['message']));});});};exports['ShowDeskAccount']=function(_0x417b6c){var _0x3d44c5=this;return new Promise(function(_0x3de346,_0x85f71b){return db[_0xb844('0x1d')][_0xb844('0x1e')]({'raw':_0x417b6c[_0xb844('0x13')]?_0x417b6c[_0xb844('0x13')][_0xb844('0x14')]===undefined?!![]:![]:!![],'where':_0x417b6c[_0xb844('0x13')]?_0x417b6c[_0xb844('0x13')][_0xb844('0x15')]||null:null,'attributes':_0x417b6c['options']?_0x417b6c[_0xb844('0x13')][_0xb844('0x16')]||null:null,'include':_0x417b6c[_0xb844('0x13')]?_0x417b6c[_0xb844('0x13')][_0xb844('0x18')]?_[_0xb844('0x19')](_0x417b6c[_0xb844('0x13')][_0xb844('0x18')],function(_0x404de6){return{'model':db[_0x404de6['model']],'as':_0x404de6['as'],'attributes':_0x404de6['attributes'],'include':_0x404de6[_0xb844('0x18')]?_[_0xb844('0x19')](_0x404de6[_0xb844('0x18')],function(_0x472bde){return{'model':db[_0x472bde[_0xb844('0x1a')]],'as':_0x472bde['as'],'attributes':_0x472bde[_0xb844('0x16')],'include':_0x472bde[_0xb844('0x18')]?_['map'](_0x472bde[_0xb844('0x18')],function(_0x5d9bfa){return{'model':db[_0x5d9bfa[_0xb844('0x1a')]],'as':_0x5d9bfa['as'],'attributes':_0x5d9bfa['attributes']};}):[]};}):[]};}):[]:[]})[_0xb844('0x9')](function(_0x246cc5){logger[_0xb844('0x1b')](_0xb844('0x1f'),_0x417b6c);logger[_0xb844('0xc')](_0xb844('0x1f'),_0x417b6c,JSON[_0xb844('0x1c')](_0x246cc5));_0x3de346(_0x246cc5);})[_0xb844('0x11')](function(_0x271990){logger['error'](_0xb844('0x1f'),_0x271990['message'],_0x417b6c);_0x85f71b(_0x3d44c5['error'](0x1f4,_0x271990[_0xb844('0x10')]));});});}; \ No newline at end of file +var _0x1480=['jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x17640e,_0x56e00b){var _0x38038b=function(_0x27d0f6){while(--_0x27d0f6){_0x17640e['push'](_0x17640e['shift']());}};_0x38038b(++_0x56e00b);}(_0x1480,0xec));var _0x0148=function(_0x41b872,_0x4c4ef9){_0x41b872=_0x41b872-0x0;var _0x439768=_0x1480[_0x41b872];return _0x439768;};'use strict';var _=require(_0x0148('0x0'));var util=require(_0x0148('0x1'));var moment=require(_0x0148('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0148('0x3'));var db=require(_0x0148('0x4'))['db'];var utils=require(_0x0148('0x5'));var logger=require(_0x0148('0x6'))(_0x0148('0x7'));var config=require(_0x0148('0x8'));var jayson=require(_0x0148('0x9'));var client=jayson[_0x0148('0xa')][_0x0148('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b642e,_0x3bfa74,_0x11071d){return new BPromise(function(_0x671ec4,_0x59e34b){return client[_0x0148('0xc')](_0x5b642e,_0x11071d)[_0x0148('0xd')](function(_0x171766){logger[_0x0148('0xe')]('DeskAccount,\x20%s,\x20%s',_0x3bfa74,_0x0148('0xf'));logger[_0x0148('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3bfa74,'request\x20sent',JSON[_0x0148('0x11')](_0x171766));if(_0x171766[_0x0148('0x12')]){if(_0x171766[_0x0148('0x12')]['code']===0x1f4){logger[_0x0148('0x12')](_0x0148('0x13'),_0x3bfa74,_0x171766['error'][_0x0148('0x14')]);return _0x59e34b(_0x171766[_0x0148('0x12')]['message']);}logger[_0x0148('0x12')]('DeskAccount,\x20%s,\x20%s',_0x3bfa74,_0x171766[_0x0148('0x12')][_0x0148('0x14')]);return _0x671ec4(_0x171766[_0x0148('0x12')][_0x0148('0x14')]);}else{logger['info'](_0x0148('0x13'),_0x3bfa74,_0x0148('0xf'));_0x671ec4(_0x171766[_0x0148('0x15')][_0x0148('0x14')]);}})[_0x0148('0x16')](function(_0x37be9f){logger[_0x0148('0x12')](_0x0148('0x13'),_0x3bfa74,_0x37be9f);_0x59e34b(_0x37be9f);});});}exports['GetDeskAccount']=function(_0x5f5605){var _0x30006c=this;return new Promise(function(_0x56e150,_0x593143){return db[_0x0148('0x17')][_0x0148('0x18')]({'raw':_0x5f5605[_0x0148('0x19')]?_0x5f5605[_0x0148('0x19')][_0x0148('0x1a')]===undefined?!![]:![]:!![],'where':_0x5f5605[_0x0148('0x19')]?_0x5f5605[_0x0148('0x19')][_0x0148('0x1b')]||null:null,'attributes':_0x5f5605[_0x0148('0x19')]?_0x5f5605[_0x0148('0x19')][_0x0148('0x1c')]||null:null,'limit':_0x5f5605[_0x0148('0x19')]?_0x5f5605[_0x0148('0x19')][_0x0148('0x1d')]||null:null,'include':_0x5f5605['options']?_0x5f5605[_0x0148('0x19')][_0x0148('0x1e')]?_[_0x0148('0x1f')](_0x5f5605[_0x0148('0x19')][_0x0148('0x1e')],function(_0x7f5f6e){return{'model':db[_0x7f5f6e[_0x0148('0x20')]],'as':_0x7f5f6e['as'],'attributes':_0x7f5f6e[_0x0148('0x1c')],'include':_0x7f5f6e['include']?_[_0x0148('0x1f')](_0x7f5f6e[_0x0148('0x1e')],function(_0x8c2d46){return{'model':db[_0x8c2d46['model']],'as':_0x8c2d46['as'],'attributes':_0x8c2d46[_0x0148('0x1c')],'include':_0x8c2d46[_0x0148('0x1e')]?_[_0x0148('0x1f')](_0x8c2d46[_0x0148('0x1e')],function(_0x53defe){return{'model':db[_0x53defe[_0x0148('0x20')]],'as':_0x53defe['as'],'attributes':_0x53defe[_0x0148('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0148('0xd')](function(_0x2a8464){logger[_0x0148('0xe')](_0x0148('0x21'),_0x5f5605);logger[_0x0148('0x10')](_0x0148('0x21'),_0x5f5605,JSON[_0x0148('0x11')](_0x2a8464));_0x56e150(_0x2a8464);})[_0x0148('0x16')](function(_0x1eb7e1){logger[_0x0148('0x12')](_0x0148('0x21'),_0x1eb7e1[_0x0148('0x14')],_0x5f5605);_0x593143(_0x30006c[_0x0148('0x12')](0x1f4,_0x1eb7e1[_0x0148('0x14')]));});});};exports[_0x0148('0x22')]=function(_0x33a467){var _0x29d5bf=this;return new Promise(function(_0x161459,_0x3574b7){return db[_0x0148('0x17')]['find']({'raw':_0x33a467[_0x0148('0x19')]?_0x33a467[_0x0148('0x19')][_0x0148('0x1a')]===undefined?!![]:![]:!![],'where':_0x33a467[_0x0148('0x19')]?_0x33a467[_0x0148('0x19')][_0x0148('0x1b')]||null:null,'attributes':_0x33a467[_0x0148('0x19')]?_0x33a467[_0x0148('0x19')][_0x0148('0x1c')]||null:null,'include':_0x33a467[_0x0148('0x19')]?_0x33a467['options'][_0x0148('0x1e')]?_['map'](_0x33a467['options'][_0x0148('0x1e')],function(_0x43dca3){return{'model':db[_0x43dca3[_0x0148('0x20')]],'as':_0x43dca3['as'],'attributes':_0x43dca3[_0x0148('0x1c')],'include':_0x43dca3['include']?_['map'](_0x43dca3[_0x0148('0x1e')],function(_0x125da3){return{'model':db[_0x125da3[_0x0148('0x20')]],'as':_0x125da3['as'],'attributes':_0x125da3[_0x0148('0x1c')],'include':_0x125da3['include']?_[_0x0148('0x1f')](_0x125da3[_0x0148('0x1e')],function(_0x94ccf3){return{'model':db[_0x94ccf3[_0x0148('0x20')]],'as':_0x94ccf3['as'],'attributes':_0x94ccf3[_0x0148('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0148('0xd')](function(_0x3a24f5){logger['info'](_0x0148('0x22'),_0x33a467);logger[_0x0148('0x10')](_0x0148('0x22'),_0x33a467,JSON[_0x0148('0x11')](_0x3a24f5));_0x161459(_0x3a24f5);})[_0x0148('0x16')](function(_0x4ba229){logger[_0x0148('0x12')]('ShowDeskAccount',_0x4ba229[_0x0148('0x14')],_0x33a467);_0x3574b7(_0x29d5bf[_0x0148('0x12')](0x1f4,_0x4ba229[_0x0148('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bbb9de7..3c975d9 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b47d8,_0x291aef){var _0x1a19b0=function(_0x592686){while(--_0x592686){_0x1b47d8['push'](_0x1b47d8['shift']());}};_0x1a19b0(++_0x291aef);}(_0x008c,0x188));var _0xc008=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x008c[_0x2e030a];return _0x597df6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x14f141,_0x1efae9){var _0x4cef0d=function(_0x127df1){while(--_0x127df1){_0x14f141['push'](_0x14f141['shift']());}};_0x4cef0d(++_0x1efae9);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a835dca..395f413 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 _0x6395=['exports','STRING','sequelize'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x6395,0xe0));var _0x5639=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6395[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x5639('0x0'));module[_0x5639('0x1')]={'name':{'type':Sequelize[_0x5639('0x2')]},'description':{'type':Sequelize[_0x5639('0x2')]}}; \ No newline at end of file +var _0xe416=['sequelize','exports'];(function(_0x2fa70c,_0x5ce573){var _0x292385=function(_0x38ff0a){while(--_0x38ff0a){_0x2fa70c['push'](_0x2fa70c['shift']());}};_0x292385(++_0x5ce573);}(_0xe416,0x140));var _0x6e41=function(_0x4fc6f1,_0x11710c){_0x4fc6f1=_0x4fc6f1-0x0;var _0x4c0e89=_0xe416[_0x4fc6f1];return _0x4c0e89;};'use strict';var Sequelize=require(_0x6e41('0x0'));module[_0x6e41('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ead101a..9dd642f 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 _0x2920=['count','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2920,0x120));var _0x0292=function(_0x49bcb5,_0x142793){_0x49bcb5=_0x49bcb5-0x0;var _0x290125=_0x2920[_0x49bcb5];return _0x290125;};'use strict';var emlformat=require(_0x0292('0x0'));var rimraf=require(_0x0292('0x1'));var zipdir=require(_0x0292('0x2'));var jsonpatch=require(_0x0292('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0292('0x4'));var Mustache=require(_0x0292('0x5'));var util=require(_0x0292('0x6'));var path=require(_0x0292('0x7'));var sox=require(_0x0292('0x8'));var csv=require(_0x0292('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0292('0xa'));var _=require(_0x0292('0xb'));var squel=require(_0x0292('0xc'));var crypto=require(_0x0292('0xd'));var jsforce=require(_0x0292('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0292('0x9'));var querystring=require('querystring');var Papa=require(_0x0292('0xf'));var Redis=require(_0x0292('0x10'));var authService=require(_0x0292('0x11'));var qs=require(_0x0292('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0292('0x13'));var utils=require(_0x0292('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0292('0x15'))['db'];function respondWithStatusCode(_0x28283f,_0x1058b7){_0x1058b7=_0x1058b7||0xcc;return function(_0xf579d7){if(_0xf579d7){return _0x28283f[_0x0292('0x16')](_0x1058b7);}return _0x28283f[_0x0292('0x17')](_0x1058b7)['end']();};}function respondWithResult(_0xa94cab,_0x3063c4){_0x3063c4=_0x3063c4||0xc8;return function(_0x530a71){if(_0x530a71){return _0xa94cab[_0x0292('0x17')](_0x3063c4)[_0x0292('0x18')](_0x530a71);}};}function respondWithFilteredResult(_0x3b6f16,_0x33c669){return function(_0x4ddff2){if(_0x4ddff2){var _0x1d459a=typeof _0x33c669[_0x0292('0x19')]===_0x0292('0x1a')&&typeof _0x33c669[_0x0292('0x1b')]===_0x0292('0x1a');var _0x47f6ef=_0x4ddff2['count'];var _0x5af540=_0x1d459a?0x0:_0x33c669[_0x0292('0x19')];var _0x26cc41=_0x1d459a?_0x4ddff2[_0x0292('0x1c')]:_0x33c669[_0x0292('0x19')]+_0x33c669[_0x0292('0x1b')];var _0x1b469a;if(_0x26cc41>=_0x47f6ef){_0x26cc41=_0x47f6ef;_0x1b469a=0xc8;}else{_0x1b469a=0xce;}_0x3b6f16[_0x0292('0x17')](_0x1b469a);return _0x3b6f16['set'](_0x0292('0x1d'),_0x5af540+'-'+_0x26cc41+'/'+_0x47f6ef)[_0x0292('0x18')](_0x4ddff2);}return null;};}function patchUpdates(_0x125533){return function(_0x59b35c){try{jsonpatch[_0x0292('0x1e')](_0x59b35c,_0x125533,!![]);}catch(_0x415a09){return BPromise[_0x0292('0x1f')](_0x415a09);}return _0x59b35c[_0x0292('0x20')]();};}function saveUpdates(_0x45bf62,_0xf1407a){return function(_0x591fd1){if(_0x591fd1){return _0x591fd1['update'](_0x45bf62)[_0x0292('0x21')](function(_0xacc9f2){return _0xacc9f2;});}return null;};}function removeEntity(_0x1130f6,_0x2b231d){return function(_0x13e1f1){if(_0x13e1f1){return _0x13e1f1[_0x0292('0x22')]()[_0x0292('0x21')](function(){_0x1130f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbcd8,_0x440690){return function(_0x23c4c9){if(!_0x23c4c9){_0x1dbcd8[_0x0292('0x16')](0x194);}return _0x23c4c9;};}function handleError(_0x33b116,_0x1308ab){_0x1308ab=_0x1308ab||0x1f4;return function(_0x43b09e){logger['error'](_0x43b09e[_0x0292('0x23')]);if(_0x43b09e[_0x0292('0x24')]){delete _0x43b09e['name'];}_0x33b116[_0x0292('0x17')](_0x1308ab)['send'](_0x43b09e);};}exports[_0x0292('0x25')]=function(_0x55bec3,_0x589d9f){var _0x2cc657={},_0x2a2941={},_0x2ebea9={'count':0x0,'rows':[]};var _0x11b76e=_[_0x0292('0x26')](db[_0x0292('0x27')][_0x0292('0x28')],function(_0x390ba3){return{'name':_0x390ba3[_0x0292('0x29')],'type':_0x390ba3['type'][_0x0292('0x2a')]};});_0x2a2941[_0x0292('0x2b')]=_[_0x0292('0x26')](_0x11b76e,_0x0292('0x24'));_0x2a2941['query']=_[_0x0292('0x2c')](_0x55bec3[_0x0292('0x2d')]);_0x2a2941[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x2a2941[_0x0292('0x2b')],_0x2a2941[_0x0292('0x2d')]);_0x2cc657['attributes']=_[_0x0292('0x2f')](_0x2a2941[_0x0292('0x2b')],qs[_0x0292('0x30')](_0x55bec3['query'][_0x0292('0x30')]));_0x2cc657[_0x0292('0x31')]=_0x2cc657[_0x0292('0x31')][_0x0292('0x32')]?_0x2cc657[_0x0292('0x31')]:_0x2a2941['model'];if(!_0x55bec3[_0x0292('0x2d')][_0x0292('0x33')](_0x0292('0x34'))){_0x2cc657[_0x0292('0x1b')]=qs[_0x0292('0x1b')](_0x55bec3[_0x0292('0x2d')][_0x0292('0x1b')]);_0x2cc657[_0x0292('0x19')]=qs['offset'](_0x55bec3['query']['offset']);}_0x2cc657[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x55bec3['query'][_0x0292('0x36')]);_0x2cc657[_0x0292('0x37')]=qs['filters'](_[_0x0292('0x38')](_0x55bec3[_0x0292('0x2d')],_0x2a2941['filters']),_0x11b76e);if(_0x55bec3[_0x0292('0x2d')][_0x0292('0x39')]){_0x2cc657[_0x0292('0x37')]=_[_0x0292('0x3a')](_0x2cc657[_0x0292('0x37')],{'$or':_['map'](_0x11b76e,function(_0x22b703){if(_0x22b703[_0x0292('0x3b')]!=='VIRTUAL'){var _0x1796e2={};_0x1796e2[_0x22b703[_0x0292('0x24')]]={'$like':'%'+_0x55bec3[_0x0292('0x2d')]['filter']+'%'};return _0x1796e2;}})});}_0x2cc657=_[_0x0292('0x3a')]({},_0x2cc657,_0x55bec3[_0x0292('0x3c')]);var _0x319a79={'where':_0x2cc657[_0x0292('0x37')]};return db[_0x0292('0x27')][_0x0292('0x1c')](_0x319a79)['then'](function(_0x4a1053){_0x2ebea9['count']=_0x4a1053;if(_0x55bec3['query'][_0x0292('0x3d')]){_0x2cc657[_0x0292('0x3e')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x0292('0x3f')](_0x2cc657);})[_0x0292('0x21')](function(_0x573eaa){_0x2ebea9[_0x0292('0x40')]=_0x573eaa;return _0x2ebea9;})[_0x0292('0x21')](respondWithFilteredResult(_0x589d9f,_0x2cc657))[_0x0292('0x41')](handleError(_0x589d9f,null));};exports['show']=function(_0x39fa89,_0x281721){var _0x91335c={'raw':![],'where':{'id':_0x39fa89[_0x0292('0x42')]['id']}},_0x421ad7={};_0x421ad7[_0x0292('0x2b')]=_[_0x0292('0x2c')](db['DeskConfiguration'][_0x0292('0x28')]);_0x421ad7[_0x0292('0x2d')]=_['keys'](_0x39fa89[_0x0292('0x2d')]);_0x421ad7['filters']=_[_0x0292('0x2f')](_0x421ad7[_0x0292('0x2b')],_0x421ad7[_0x0292('0x2d')]);_0x91335c['attributes']=_[_0x0292('0x2f')](_0x421ad7[_0x0292('0x2b')],qs[_0x0292('0x30')](_0x39fa89[_0x0292('0x2d')]['fields']));_0x91335c['attributes']=_0x91335c[_0x0292('0x31')][_0x0292('0x32')]?_0x91335c[_0x0292('0x31')]:_0x421ad7['model'];if(_0x39fa89[_0x0292('0x2d')][_0x0292('0x3d')]){_0x91335c[_0x0292('0x3e')]=[{'all':!![]}];}_0x91335c=_[_0x0292('0x3a')]({},_0x91335c,_0x39fa89['options']);return db[_0x0292('0x27')][_0x0292('0x43')](_0x91335c)[_0x0292('0x21')](handleEntityNotFound(_0x281721,null))[_0x0292('0x21')](respondWithResult(_0x281721,null))['catch'](handleError(_0x281721,null));};exports[_0x0292('0x44')]=function(_0x2db315,_0x3c64a8){return db[_0x0292('0x27')]['create'](_0x2db315[_0x0292('0x45')],{})[_0x0292('0x21')](respondWithResult(_0x3c64a8,0xc9))[_0x0292('0x41')](handleError(_0x3c64a8,null));};exports[_0x0292('0x46')]=function(_0x29b4b0,_0x25239f){if(_0x29b4b0[_0x0292('0x45')]['id']){delete _0x29b4b0[_0x0292('0x45')]['id'];}return db[_0x0292('0x27')][_0x0292('0x43')]({'where':{'id':_0x29b4b0['params']['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x25239f,null))[_0x0292('0x21')](saveUpdates(_0x29b4b0[_0x0292('0x45')],null))[_0x0292('0x21')](respondWithResult(_0x25239f,null))[_0x0292('0x41')](handleError(_0x25239f,null));};exports[_0x0292('0x22')]=function(_0x5c9b02,_0x1a6f15){return db[_0x0292('0x27')][_0x0292('0x43')]({'where':{'id':_0x5c9b02['params']['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x1a6f15,null))[_0x0292('0x21')](removeEntity(_0x1a6f15,null))['catch'](handleError(_0x1a6f15,null));};exports[_0x0292('0x47')]=function(_0x4f1547,_0x171ff3,_0x2f1065){var _0x1ea1b7={};var _0xeddde5={};var _0x13b698;var _0x140f17;return db[_0x0292('0x27')][_0x0292('0x48')]({'where':{'id':_0x4f1547[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x171ff3,null))[_0x0292('0x21')](function(_0x28a839){if(_0x28a839){_0x13b698=_0x28a839;_0xeddde5[_0x0292('0x2b')]=_['keys'](db[_0x0292('0x49')]['rawAttributes']);_0xeddde5[_0x0292('0x2d')]=_[_0x0292('0x2c')](_0x4f1547[_0x0292('0x2d')]);_0xeddde5[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0xeddde5[_0x0292('0x2b')],_0xeddde5[_0x0292('0x2d')]);_0x1ea1b7[_0x0292('0x31')]=_[_0x0292('0x2f')](_0xeddde5['model'],qs[_0x0292('0x30')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x30')]));_0x1ea1b7[_0x0292('0x31')]=_0x1ea1b7['attributes']['length']?_0x1ea1b7[_0x0292('0x31')]:_0xeddde5[_0x0292('0x2b')];_0x1ea1b7[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x36')]);_0x1ea1b7[_0x0292('0x37')]=qs[_0x0292('0x2e')](_[_0x0292('0x38')](_0x4f1547[_0x0292('0x2d')],_0xeddde5[_0x0292('0x2e')]));if(_0x4f1547[_0x0292('0x2d')][_0x0292('0x39')]){_0x1ea1b7[_0x0292('0x37')]=_[_0x0292('0x3a')](_0x1ea1b7[_0x0292('0x37')],{'$or':_[_0x0292('0x26')](_0x1ea1b7[_0x0292('0x31')],function(_0xdc7fb5){var _0x4375c8={};_0x4375c8[_0xdc7fb5]={'$like':'%'+_0x4f1547[_0x0292('0x2d')][_0x0292('0x39')]+'%'};return _0x4375c8;})});}_0x1ea1b7=_[_0x0292('0x3a')]({},_0x1ea1b7,_0x4f1547[_0x0292('0x3c')]);return _0x13b698[_0x0292('0x47')](_0x1ea1b7);}})[_0x0292('0x21')](function(_0x2a4cc6){if(_0x2a4cc6){_0x140f17=_0x2a4cc6[_0x0292('0x32')];if(!_0x4f1547[_0x0292('0x2d')][_0x0292('0x33')]('nolimit')){_0x1ea1b7[_0x0292('0x1b')]=qs[_0x0292('0x1b')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x1b')]);_0x1ea1b7['offset']=qs[_0x0292('0x19')](_0x4f1547[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x13b698[_0x0292('0x47')](_0x1ea1b7);}})[_0x0292('0x21')](function(_0x43ad50){if(_0x43ad50){return _0x43ad50?{'count':_0x140f17,'rows':_0x43ad50}:null;}})[_0x0292('0x21')](respondWithResult(_0x171ff3,null))[_0x0292('0x41')](handleError(_0x171ff3,null));};exports[_0x0292('0x4a')]=function(_0x428f3c,_0x2c4cc8,_0x296b06){var _0x3c6b0f={};var _0x1b9cd1={};var _0x29d731;var _0x3cf230;return db[_0x0292('0x27')][_0x0292('0x48')]({'where':{'id':_0x428f3c[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x2c4cc8,null))['then'](function(_0x101392){if(_0x101392){_0x29d731=_0x101392;_0x1b9cd1[_0x0292('0x2b')]=_['keys'](db[_0x0292('0x49')][_0x0292('0x28')]);_0x1b9cd1['query']=_[_0x0292('0x2c')](_0x428f3c[_0x0292('0x2d')]);_0x1b9cd1[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x1b9cd1[_0x0292('0x2b')],_0x1b9cd1[_0x0292('0x2d')]);_0x3c6b0f['attributes']=_[_0x0292('0x2f')](_0x1b9cd1['model'],qs['fields'](_0x428f3c[_0x0292('0x2d')][_0x0292('0x30')]));_0x3c6b0f[_0x0292('0x31')]=_0x3c6b0f[_0x0292('0x31')][_0x0292('0x32')]?_0x3c6b0f[_0x0292('0x31')]:_0x1b9cd1[_0x0292('0x2b')];_0x3c6b0f[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x428f3c[_0x0292('0x2d')][_0x0292('0x36')]);_0x3c6b0f[_0x0292('0x37')]=qs['filters'](_[_0x0292('0x38')](_0x428f3c['query'],_0x1b9cd1['filters']));if(_0x428f3c['query'][_0x0292('0x39')]){_0x3c6b0f[_0x0292('0x37')]=_['merge'](_0x3c6b0f[_0x0292('0x37')],{'$or':_[_0x0292('0x26')](_0x3c6b0f[_0x0292('0x31')],function(_0xef0eed){var _0x3dbbee={};_0x3dbbee[_0xef0eed]={'$like':'%'+_0x428f3c['query']['filter']+'%'};return _0x3dbbee;})});}_0x3c6b0f=_[_0x0292('0x3a')]({},_0x3c6b0f,_0x428f3c[_0x0292('0x3c')]);return _0x29d731[_0x0292('0x4a')](_0x3c6b0f);}})['then'](function(_0x1b1190){if(_0x1b1190){_0x3cf230=_0x1b1190[_0x0292('0x32')];if(!_0x428f3c[_0x0292('0x2d')][_0x0292('0x33')](_0x0292('0x34'))){_0x3c6b0f['limit']=qs[_0x0292('0x1b')](_0x428f3c['query'][_0x0292('0x1b')]);_0x3c6b0f[_0x0292('0x19')]=qs['offset'](_0x428f3c[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x29d731[_0x0292('0x4a')](_0x3c6b0f);}})[_0x0292('0x21')](function(_0x7e9698){if(_0x7e9698){return _0x7e9698?{'count':_0x3cf230,'rows':_0x7e9698}:null;}})[_0x0292('0x21')](respondWithResult(_0x2c4cc8,null))['catch'](handleError(_0x2c4cc8,null));};exports[_0x0292('0x4b')]=function(_0x2e973f,_0x4d8abb,_0x4ce638){var _0xd025da={};var _0x550e6c={};var _0x27df2b;var _0x9b6230;return db['DeskConfiguration'][_0x0292('0x48')]({'where':{'id':_0x2e973f[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x4d8abb,null))[_0x0292('0x21')](function(_0x47dc4c){if(_0x47dc4c){_0x27df2b=_0x47dc4c;_0x550e6c[_0x0292('0x2b')]=_[_0x0292('0x2c')](db[_0x0292('0x49')]['rawAttributes']);_0x550e6c[_0x0292('0x2d')]=_['keys'](_0x2e973f[_0x0292('0x2d')]);_0x550e6c[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x550e6c[_0x0292('0x2b')],_0x550e6c[_0x0292('0x2d')]);_0xd025da[_0x0292('0x31')]=_['intersection'](_0x550e6c[_0x0292('0x2b')],qs[_0x0292('0x30')](_0x2e973f[_0x0292('0x2d')][_0x0292('0x30')]));_0xd025da[_0x0292('0x31')]=_0xd025da[_0x0292('0x31')][_0x0292('0x32')]?_0xd025da['attributes']:_0x550e6c['model'];_0xd025da[_0x0292('0x35')]=qs[_0x0292('0x36')](_0x2e973f[_0x0292('0x2d')][_0x0292('0x36')]);_0xd025da['where']=qs['filters'](_['pick'](_0x2e973f[_0x0292('0x2d')],_0x550e6c[_0x0292('0x2e')]));if(_0x2e973f[_0x0292('0x2d')]['filter']){_0xd025da[_0x0292('0x37')]=_[_0x0292('0x3a')](_0xd025da[_0x0292('0x37')],{'$or':_[_0x0292('0x26')](_0xd025da[_0x0292('0x31')],function(_0x3fb630){var _0x35abd6={};_0x35abd6[_0x3fb630]={'$like':'%'+_0x2e973f['query'][_0x0292('0x39')]+'%'};return _0x35abd6;})});}_0xd025da=_[_0x0292('0x3a')]({},_0xd025da,_0x2e973f['options']);return _0x27df2b['getDescriptions'](_0xd025da);}})[_0x0292('0x21')](function(_0x3fb7b4){if(_0x3fb7b4){_0x9b6230=_0x3fb7b4[_0x0292('0x32')];if(!_0x2e973f[_0x0292('0x2d')][_0x0292('0x33')](_0x0292('0x34'))){_0xd025da[_0x0292('0x1b')]=qs[_0x0292('0x1b')](_0x2e973f['query'][_0x0292('0x1b')]);_0xd025da[_0x0292('0x19')]=qs[_0x0292('0x19')](_0x2e973f[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x27df2b[_0x0292('0x4b')](_0xd025da);}})[_0x0292('0x21')](function(_0x4ae35c){if(_0x4ae35c){return _0x4ae35c?{'count':_0x9b6230,'rows':_0x4ae35c}:null;}})[_0x0292('0x21')](respondWithResult(_0x4d8abb,null))['catch'](handleError(_0x4d8abb,null));};exports['getTags']=function(_0x6a5227,_0x3036a5,_0x304de7){var _0x3374d4={};var _0x414537={};var _0x5a397c;var _0x3c66c8;return db[_0x0292('0x27')][_0x0292('0x48')]({'where':{'id':_0x6a5227[_0x0292('0x42')]['id']}})['then'](handleEntityNotFound(_0x3036a5,null))[_0x0292('0x21')](function(_0x267ebc){if(_0x267ebc){_0x5a397c=_0x267ebc;_0x414537['model']=_[_0x0292('0x2c')](db['Tag']['rawAttributes']);_0x414537['query']=_['keys'](_0x6a5227[_0x0292('0x2d')]);_0x414537[_0x0292('0x2e')]=_[_0x0292('0x2f')](_0x414537['model'],_0x414537['query']);_0x3374d4[_0x0292('0x31')]=_['intersection'](_0x414537['model'],qs[_0x0292('0x30')](_0x6a5227[_0x0292('0x2d')][_0x0292('0x30')]));_0x3374d4[_0x0292('0x31')]=_0x3374d4[_0x0292('0x31')][_0x0292('0x32')]?_0x3374d4[_0x0292('0x31')]:_0x414537[_0x0292('0x2b')];_0x3374d4[_0x0292('0x35')]=qs['sort'](_0x6a5227[_0x0292('0x2d')][_0x0292('0x36')]);_0x3374d4['where']=qs[_0x0292('0x2e')](_[_0x0292('0x38')](_0x6a5227[_0x0292('0x2d')],_0x414537[_0x0292('0x2e')]));if(_0x6a5227['query']['filter']){_0x3374d4[_0x0292('0x37')]=_[_0x0292('0x3a')](_0x3374d4[_0x0292('0x37')],{'$or':_['map'](_0x3374d4['attributes'],function(_0x2e1286){var _0xa9d999={};_0xa9d999[_0x2e1286]={'$like':'%'+_0x6a5227[_0x0292('0x2d')][_0x0292('0x39')]+'%'};return _0xa9d999;})});}_0x3374d4=_[_0x0292('0x3a')]({},_0x3374d4,_0x6a5227[_0x0292('0x3c')]);return _0x5a397c[_0x0292('0x4c')](_0x3374d4);}})[_0x0292('0x21')](function(_0x28868c){if(_0x28868c){_0x3c66c8=_0x28868c['length'];if(!_0x6a5227[_0x0292('0x2d')]['hasOwnProperty'](_0x0292('0x34'))){_0x3374d4[_0x0292('0x1b')]=qs['limit'](_0x6a5227['query'][_0x0292('0x1b')]);_0x3374d4[_0x0292('0x19')]=qs[_0x0292('0x19')](_0x6a5227[_0x0292('0x2d')][_0x0292('0x19')]);}return _0x5a397c[_0x0292('0x4c')](_0x3374d4);}})['then'](function(_0x4bb6a5){if(_0x4bb6a5){return _0x4bb6a5?{'count':_0x3c66c8,'rows':_0x4bb6a5}:null;}})[_0x0292('0x21')](respondWithResult(_0x3036a5,null))[_0x0292('0x41')](handleError(_0x3036a5,null));};exports['setTags']=function(_0x599676,_0x14553c,_0x5a2f1c){if(_0x599676[_0x0292('0x45')]['id']){delete _0x599676[_0x0292('0x45')]['id'];}return db['DeskConfiguration'][_0x0292('0x48')]({'where':{'id':_0x599676[_0x0292('0x42')]['id']}})[_0x0292('0x21')](handleEntityNotFound(_0x14553c,null))['then'](function(_0x58ac5e){if(_0x58ac5e){return _0x58ac5e[_0x0292('0x4d')](_0x599676[_0x0292('0x45')][_0x0292('0x4e')]||[]);}return null;})[_0x0292('0x21')](respondWithResult(_0x14553c,null))[_0x0292('0x41')](handleError(_0x14553c,null));}; \ No newline at end of file +var _0x159b=['intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','findOne','getFields','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','error','send','DeskConfiguration','rawAttributes','fieldName','type','key','map','name','keys','query','model','attributes'];(function(_0xb76862,_0x525c99){var _0x290b5c=function(_0x4da3b0){while(--_0x4da3b0){_0xb76862['push'](_0xb76862['shift']());}};_0x290b5c(++_0x525c99);}(_0x159b,0x11b));var _0xb159=function(_0x180d97,_0x5b4bea){_0x180d97=_0x180d97-0x0;var _0x479226=_0x159b[_0x180d97];return _0x479226;};'use strict';var emlformat=require(_0xb159('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb159('0x1'));var rp=require(_0xb159('0x2'));var moment=require(_0xb159('0x3'));var BPromise=require(_0xb159('0x4'));var Mustache=require('mustache');var util=require(_0xb159('0x5'));var path=require(_0xb159('0x6'));var sox=require(_0xb159('0x7'));var csv=require(_0xb159('0x8'));var ejs=require(_0xb159('0x9'));var fs=require('fs');var fs_extra=require(_0xb159('0xa'));var _=require(_0xb159('0xb'));var squel=require(_0xb159('0xc'));var crypto=require(_0xb159('0xd'));var jsforce=require(_0xb159('0xe'));var deskjs=require(_0xb159('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb159('0x10'));var Papa=require(_0xb159('0x11'));var Redis=require(_0xb159('0x12'));var authService=require(_0xb159('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb159('0x14'));var hardwareService=require(_0xb159('0x15'));var logger=require(_0xb159('0x16'))(_0xb159('0x17'));var utils=require(_0xb159('0x18'));var config=require(_0xb159('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb159('0x1a'))['db'];function respondWithStatusCode(_0x4833ee,_0x5cbe0d){_0x5cbe0d=_0x5cbe0d||0xcc;return function(_0x2d9f6d){if(_0x2d9f6d){return _0x4833ee[_0xb159('0x1b')](_0x5cbe0d);}return _0x4833ee[_0xb159('0x1c')](_0x5cbe0d)[_0xb159('0x1d')]();};}function respondWithResult(_0x1f2f0f,_0x38e1e7){_0x38e1e7=_0x38e1e7||0xc8;return function(_0x48c5ac){if(_0x48c5ac){return _0x1f2f0f[_0xb159('0x1c')](_0x38e1e7)[_0xb159('0x1e')](_0x48c5ac);}};}function respondWithFilteredResult(_0x26a906,_0x1f9ced){return function(_0x5710c9){if(_0x5710c9){var _0x3a5a47=typeof _0x1f9ced[_0xb159('0x1f')]===_0xb159('0x20')&&typeof _0x1f9ced[_0xb159('0x21')]===_0xb159('0x20');var _0x4bfd6a=_0x5710c9[_0xb159('0x22')];var _0x10a97e=_0x3a5a47?0x0:_0x1f9ced[_0xb159('0x1f')];var _0x5621c5=_0x3a5a47?_0x5710c9['count']:_0x1f9ced[_0xb159('0x1f')]+_0x1f9ced[_0xb159('0x21')];var _0x4dc7c6;if(_0x5621c5>=_0x4bfd6a){_0x5621c5=_0x4bfd6a;_0x4dc7c6=0xc8;}else{_0x4dc7c6=0xce;}_0x26a906[_0xb159('0x1c')](_0x4dc7c6);return _0x26a906[_0xb159('0x23')]('Content-Range',_0x10a97e+'-'+_0x5621c5+'/'+_0x4bfd6a)['json'](_0x5710c9);}return null;};}function patchUpdates(_0x375fc9){return function(_0x12cd7a){try{jsonpatch['apply'](_0x12cd7a,_0x375fc9,!![]);}catch(_0x55eb85){return BPromise['reject'](_0x55eb85);}return _0x12cd7a[_0xb159('0x24')]();};}function saveUpdates(_0x32abc0,_0x137f50){return function(_0x350b30){if(_0x350b30){return _0x350b30[_0xb159('0x25')](_0x32abc0)[_0xb159('0x26')](function(_0x4958d7){return _0x4958d7;});}return null;};}function removeEntity(_0xf4ef49,_0x83b9f7){return function(_0x5cbafa){if(_0x5cbafa){return _0x5cbafa[_0xb159('0x27')]()['then'](function(){_0xf4ef49[_0xb159('0x1c')](0xcc)[_0xb159('0x1d')]();});}};}function handleEntityNotFound(_0xa84aa8,_0x3fb455){return function(_0x3a4989){if(!_0x3a4989){_0xa84aa8[_0xb159('0x1b')](0x194);}return _0x3a4989;};}function handleError(_0x21a019,_0x19c08d){_0x19c08d=_0x19c08d||0x1f4;return function(_0x6b7e53){logger[_0xb159('0x28')](_0x6b7e53['stack']);if(_0x6b7e53['name']){delete _0x6b7e53['name'];}_0x21a019[_0xb159('0x1c')](_0x19c08d)[_0xb159('0x29')](_0x6b7e53);};}exports['index']=function(_0x43a41b,_0x58bd06){var _0x1bde07={},_0xb16f42={},_0xbccfb1={'count':0x0,'rows':[]};var _0x264400=_['map'](db[_0xb159('0x2a')][_0xb159('0x2b')],function(_0x2fd957){return{'name':_0x2fd957[_0xb159('0x2c')],'type':_0x2fd957[_0xb159('0x2d')][_0xb159('0x2e')]};});_0xb16f42['model']=_[_0xb159('0x2f')](_0x264400,_0xb159('0x30'));_0xb16f42['query']=_[_0xb159('0x31')](_0x43a41b[_0xb159('0x32')]);_0xb16f42['filters']=_['intersection'](_0xb16f42[_0xb159('0x33')],_0xb16f42[_0xb159('0x32')]);_0x1bde07[_0xb159('0x34')]=_[_0xb159('0x35')](_0xb16f42['model'],qs[_0xb159('0x36')](_0x43a41b['query']['fields']));_0x1bde07[_0xb159('0x34')]=_0x1bde07['attributes'][_0xb159('0x37')]?_0x1bde07['attributes']:_0xb16f42['model'];if(!_0x43a41b[_0xb159('0x32')]['hasOwnProperty'](_0xb159('0x38'))){_0x1bde07[_0xb159('0x21')]=qs[_0xb159('0x21')](_0x43a41b[_0xb159('0x32')][_0xb159('0x21')]);_0x1bde07[_0xb159('0x1f')]=qs[_0xb159('0x1f')](_0x43a41b[_0xb159('0x32')][_0xb159('0x1f')]);}_0x1bde07[_0xb159('0x39')]=qs[_0xb159('0x3a')](_0x43a41b[_0xb159('0x32')][_0xb159('0x3a')]);_0x1bde07[_0xb159('0x3b')]=qs[_0xb159('0x3c')](_[_0xb159('0x3d')](_0x43a41b[_0xb159('0x32')],_0xb16f42[_0xb159('0x3c')]),_0x264400);if(_0x43a41b[_0xb159('0x32')][_0xb159('0x3e')]){_0x1bde07[_0xb159('0x3b')]=_[_0xb159('0x3f')](_0x1bde07[_0xb159('0x3b')],{'$or':_[_0xb159('0x2f')](_0x264400,function(_0x259cc8){if(_0x259cc8[_0xb159('0x2d')]!==_0xb159('0x40')){var _0x281599={};_0x281599[_0x259cc8['name']]={'$like':'%'+_0x43a41b[_0xb159('0x32')]['filter']+'%'};return _0x281599;}})});}_0x1bde07=_[_0xb159('0x3f')]({},_0x1bde07,_0x43a41b['options']);var _0x394f09={'where':_0x1bde07[_0xb159('0x3b')]};return db[_0xb159('0x2a')][_0xb159('0x22')](_0x394f09)[_0xb159('0x26')](function(_0x4ee3f1){_0xbccfb1[_0xb159('0x22')]=_0x4ee3f1;if(_0x43a41b[_0xb159('0x32')][_0xb159('0x41')]){_0x1bde07[_0xb159('0x42')]=[{'all':!![]}];}return db[_0xb159('0x2a')][_0xb159('0x43')](_0x1bde07);})[_0xb159('0x26')](function(_0x619de4){_0xbccfb1[_0xb159('0x44')]=_0x619de4;return _0xbccfb1;})[_0xb159('0x26')](respondWithFilteredResult(_0x58bd06,_0x1bde07))[_0xb159('0x45')](handleError(_0x58bd06,null));};exports['show']=function(_0x132131,_0x194a59){var _0x27a83b={'raw':![],'where':{'id':_0x132131[_0xb159('0x46')]['id']}},_0x41bd7d={};_0x41bd7d['model']=_[_0xb159('0x31')](db[_0xb159('0x2a')]['rawAttributes']);_0x41bd7d[_0xb159('0x32')]=_[_0xb159('0x31')](_0x132131['query']);_0x41bd7d[_0xb159('0x3c')]=_[_0xb159('0x35')](_0x41bd7d[_0xb159('0x33')],_0x41bd7d['query']);_0x27a83b[_0xb159('0x34')]=_['intersection'](_0x41bd7d[_0xb159('0x33')],qs[_0xb159('0x36')](_0x132131[_0xb159('0x32')][_0xb159('0x36')]));_0x27a83b[_0xb159('0x34')]=_0x27a83b[_0xb159('0x34')]['length']?_0x27a83b[_0xb159('0x34')]:_0x41bd7d[_0xb159('0x33')];if(_0x132131['query'][_0xb159('0x41')]){_0x27a83b[_0xb159('0x42')]=[{'all':!![]}];}_0x27a83b=_[_0xb159('0x3f')]({},_0x27a83b,_0x132131[_0xb159('0x47')]);return db[_0xb159('0x2a')][_0xb159('0x48')](_0x27a83b)[_0xb159('0x26')](handleEntityNotFound(_0x194a59,null))['then'](respondWithResult(_0x194a59,null))[_0xb159('0x45')](handleError(_0x194a59,null));};exports[_0xb159('0x49')]=function(_0x445218,_0x101031){return db['DeskConfiguration']['create'](_0x445218[_0xb159('0x4a')],{})[_0xb159('0x26')](respondWithResult(_0x101031,0xc9))[_0xb159('0x45')](handleError(_0x101031,null));};exports[_0xb159('0x25')]=function(_0x47b217,_0x49e01f){if(_0x47b217[_0xb159('0x4a')]['id']){delete _0x47b217[_0xb159('0x4a')]['id'];}return db[_0xb159('0x2a')][_0xb159('0x48')]({'where':{'id':_0x47b217[_0xb159('0x46')]['id']}})[_0xb159('0x26')](handleEntityNotFound(_0x49e01f,null))[_0xb159('0x26')](saveUpdates(_0x47b217[_0xb159('0x4a')],null))[_0xb159('0x26')](respondWithResult(_0x49e01f,null))['catch'](handleError(_0x49e01f,null));};exports['destroy']=function(_0xcf1f15,_0x117a9c){return db[_0xb159('0x2a')]['find']({'where':{'id':_0xcf1f15[_0xb159('0x46')]['id']}})[_0xb159('0x26')](handleEntityNotFound(_0x117a9c,null))[_0xb159('0x26')](removeEntity(_0x117a9c,null))[_0xb159('0x45')](handleError(_0x117a9c,null));};exports['getFields']=function(_0x20adf5,_0xa3d4c2,_0x8a6457){var _0xc598d9={};var _0x1537cf={};var _0x36d695;var _0x3d2eff;return db[_0xb159('0x2a')][_0xb159('0x4b')]({'where':{'id':_0x20adf5[_0xb159('0x46')]['id']}})[_0xb159('0x26')](handleEntityNotFound(_0xa3d4c2,null))['then'](function(_0x3ab2af){if(_0x3ab2af){_0x36d695=_0x3ab2af;_0x1537cf[_0xb159('0x33')]=_[_0xb159('0x31')](db['DeskField']['rawAttributes']);_0x1537cf['query']=_[_0xb159('0x31')](_0x20adf5[_0xb159('0x32')]);_0x1537cf[_0xb159('0x3c')]=_[_0xb159('0x35')](_0x1537cf[_0xb159('0x33')],_0x1537cf['query']);_0xc598d9['attributes']=_[_0xb159('0x35')](_0x1537cf[_0xb159('0x33')],qs[_0xb159('0x36')](_0x20adf5['query'][_0xb159('0x36')]));_0xc598d9['attributes']=_0xc598d9[_0xb159('0x34')]['length']?_0xc598d9[_0xb159('0x34')]:_0x1537cf[_0xb159('0x33')];_0xc598d9[_0xb159('0x39')]=qs[_0xb159('0x3a')](_0x20adf5[_0xb159('0x32')][_0xb159('0x3a')]);_0xc598d9[_0xb159('0x3b')]=qs['filters'](_[_0xb159('0x3d')](_0x20adf5[_0xb159('0x32')],_0x1537cf['filters']));if(_0x20adf5[_0xb159('0x32')][_0xb159('0x3e')]){_0xc598d9[_0xb159('0x3b')]=_['merge'](_0xc598d9[_0xb159('0x3b')],{'$or':_['map'](_0xc598d9[_0xb159('0x34')],function(_0x93e27c){var _0x5b2229={};_0x5b2229[_0x93e27c]={'$like':'%'+_0x20adf5[_0xb159('0x32')]['filter']+'%'};return _0x5b2229;})});}_0xc598d9=_[_0xb159('0x3f')]({},_0xc598d9,_0x20adf5['options']);return _0x36d695[_0xb159('0x4c')](_0xc598d9);}})[_0xb159('0x26')](function(_0x23c9b9){if(_0x23c9b9){_0x3d2eff=_0x23c9b9[_0xb159('0x37')];if(!_0x20adf5['query'][_0xb159('0x4d')]('nolimit')){_0xc598d9[_0xb159('0x21')]=qs[_0xb159('0x21')](_0x20adf5[_0xb159('0x32')][_0xb159('0x21')]);_0xc598d9[_0xb159('0x1f')]=qs['offset'](_0x20adf5['query']['offset']);}return _0x36d695[_0xb159('0x4c')](_0xc598d9);}})[_0xb159('0x26')](function(_0x228bf2){if(_0x228bf2){return _0x228bf2?{'count':_0x3d2eff,'rows':_0x228bf2}:null;}})['then'](respondWithResult(_0xa3d4c2,null))[_0xb159('0x45')](handleError(_0xa3d4c2,null));};exports[_0xb159('0x4e')]=function(_0x167208,_0x331d6b,_0x1acac3){var _0x5c43ce={};var _0x47d912={};var _0x4a36a3;var _0x254108;return db['DeskConfiguration'][_0xb159('0x4b')]({'where':{'id':_0x167208['params']['id']}})[_0xb159('0x26')](handleEntityNotFound(_0x331d6b,null))[_0xb159('0x26')](function(_0x4c4373){if(_0x4c4373){_0x4a36a3=_0x4c4373;_0x47d912[_0xb159('0x33')]=_[_0xb159('0x31')](db[_0xb159('0x4f')][_0xb159('0x2b')]);_0x47d912[_0xb159('0x32')]=_['keys'](_0x167208[_0xb159('0x32')]);_0x47d912[_0xb159('0x3c')]=_[_0xb159('0x35')](_0x47d912['model'],_0x47d912[_0xb159('0x32')]);_0x5c43ce[_0xb159('0x34')]=_[_0xb159('0x35')](_0x47d912[_0xb159('0x33')],qs[_0xb159('0x36')](_0x167208[_0xb159('0x32')][_0xb159('0x36')]));_0x5c43ce['attributes']=_0x5c43ce[_0xb159('0x34')][_0xb159('0x37')]?_0x5c43ce[_0xb159('0x34')]:_0x47d912[_0xb159('0x33')];_0x5c43ce['order']=qs[_0xb159('0x3a')](_0x167208[_0xb159('0x32')][_0xb159('0x3a')]);_0x5c43ce['where']=qs['filters'](_[_0xb159('0x3d')](_0x167208['query'],_0x47d912['filters']));if(_0x167208[_0xb159('0x32')]['filter']){_0x5c43ce[_0xb159('0x3b')]=_['merge'](_0x5c43ce[_0xb159('0x3b')],{'$or':_['map'](_0x5c43ce[_0xb159('0x34')],function(_0x562d5b){var _0x4a4d1e={};_0x4a4d1e[_0x562d5b]={'$like':'%'+_0x167208[_0xb159('0x32')][_0xb159('0x3e')]+'%'};return _0x4a4d1e;})});}_0x5c43ce=_[_0xb159('0x3f')]({},_0x5c43ce,_0x167208[_0xb159('0x47')]);return _0x4a36a3[_0xb159('0x4e')](_0x5c43ce);}})[_0xb159('0x26')](function(_0x35930a){if(_0x35930a){_0x254108=_0x35930a[_0xb159('0x37')];if(!_0x167208[_0xb159('0x32')][_0xb159('0x4d')]('nolimit')){_0x5c43ce[_0xb159('0x21')]=qs[_0xb159('0x21')](_0x167208[_0xb159('0x32')][_0xb159('0x21')]);_0x5c43ce[_0xb159('0x1f')]=qs[_0xb159('0x1f')](_0x167208[_0xb159('0x32')][_0xb159('0x1f')]);}return _0x4a36a3[_0xb159('0x4e')](_0x5c43ce);}})[_0xb159('0x26')](function(_0xa65b0a){if(_0xa65b0a){return _0xa65b0a?{'count':_0x254108,'rows':_0xa65b0a}:null;}})['then'](respondWithResult(_0x331d6b,null))[_0xb159('0x45')](handleError(_0x331d6b,null));};exports[_0xb159('0x50')]=function(_0x48b01d,_0x5c4761,_0x66c0c8){var _0x4789a5={};var _0x55dd0f={};var _0xa622b9;var _0x5e3eb9;return db[_0xb159('0x2a')][_0xb159('0x4b')]({'where':{'id':_0x48b01d[_0xb159('0x46')]['id']}})[_0xb159('0x26')](handleEntityNotFound(_0x5c4761,null))[_0xb159('0x26')](function(_0x3d3c2d){if(_0x3d3c2d){_0xa622b9=_0x3d3c2d;_0x55dd0f['model']=_['keys'](db[_0xb159('0x4f')][_0xb159('0x2b')]);_0x55dd0f[_0xb159('0x32')]=_[_0xb159('0x31')](_0x48b01d[_0xb159('0x32')]);_0x55dd0f[_0xb159('0x3c')]=_[_0xb159('0x35')](_0x55dd0f[_0xb159('0x33')],_0x55dd0f[_0xb159('0x32')]);_0x4789a5['attributes']=_[_0xb159('0x35')](_0x55dd0f[_0xb159('0x33')],qs[_0xb159('0x36')](_0x48b01d['query'][_0xb159('0x36')]));_0x4789a5['attributes']=_0x4789a5[_0xb159('0x34')][_0xb159('0x37')]?_0x4789a5[_0xb159('0x34')]:_0x55dd0f[_0xb159('0x33')];_0x4789a5[_0xb159('0x39')]=qs['sort'](_0x48b01d[_0xb159('0x32')]['sort']);_0x4789a5[_0xb159('0x3b')]=qs[_0xb159('0x3c')](_[_0xb159('0x3d')](_0x48b01d[_0xb159('0x32')],_0x55dd0f['filters']));if(_0x48b01d['query'][_0xb159('0x3e')]){_0x4789a5[_0xb159('0x3b')]=_[_0xb159('0x3f')](_0x4789a5['where'],{'$or':_[_0xb159('0x2f')](_0x4789a5[_0xb159('0x34')],function(_0x43fe43){var _0x2899b1={};_0x2899b1[_0x43fe43]={'$like':'%'+_0x48b01d[_0xb159('0x32')][_0xb159('0x3e')]+'%'};return _0x2899b1;})});}_0x4789a5=_['merge']({},_0x4789a5,_0x48b01d[_0xb159('0x47')]);return _0xa622b9[_0xb159('0x50')](_0x4789a5);}})[_0xb159('0x26')](function(_0x2523a1){if(_0x2523a1){_0x5e3eb9=_0x2523a1[_0xb159('0x37')];if(!_0x48b01d['query'][_0xb159('0x4d')](_0xb159('0x38'))){_0x4789a5[_0xb159('0x21')]=qs['limit'](_0x48b01d[_0xb159('0x32')][_0xb159('0x21')]);_0x4789a5[_0xb159('0x1f')]=qs[_0xb159('0x1f')](_0x48b01d[_0xb159('0x32')][_0xb159('0x1f')]);}return _0xa622b9['getDescriptions'](_0x4789a5);}})[_0xb159('0x26')](function(_0x4b11d1){if(_0x4b11d1){return _0x4b11d1?{'count':_0x5e3eb9,'rows':_0x4b11d1}:null;}})['then'](respondWithResult(_0x5c4761,null))[_0xb159('0x45')](handleError(_0x5c4761,null));};exports['getTags']=function(_0x842bcc,_0xf521b9,_0x2f7cff){var _0x236161={};var _0x518a79={};var _0x34b488;var _0x2ccb89;return db[_0xb159('0x2a')][_0xb159('0x4b')]({'where':{'id':_0x842bcc[_0xb159('0x46')]['id']}})[_0xb159('0x26')](handleEntityNotFound(_0xf521b9,null))[_0xb159('0x26')](function(_0x55a186){if(_0x55a186){_0x34b488=_0x55a186;_0x518a79['model']=_[_0xb159('0x31')](db['Tag']['rawAttributes']);_0x518a79[_0xb159('0x32')]=_[_0xb159('0x31')](_0x842bcc[_0xb159('0x32')]);_0x518a79[_0xb159('0x3c')]=_['intersection'](_0x518a79[_0xb159('0x33')],_0x518a79[_0xb159('0x32')]);_0x236161[_0xb159('0x34')]=_[_0xb159('0x35')](_0x518a79[_0xb159('0x33')],qs['fields'](_0x842bcc[_0xb159('0x32')][_0xb159('0x36')]));_0x236161[_0xb159('0x34')]=_0x236161[_0xb159('0x34')][_0xb159('0x37')]?_0x236161[_0xb159('0x34')]:_0x518a79[_0xb159('0x33')];_0x236161[_0xb159('0x39')]=qs[_0xb159('0x3a')](_0x842bcc[_0xb159('0x32')][_0xb159('0x3a')]);_0x236161[_0xb159('0x3b')]=qs[_0xb159('0x3c')](_[_0xb159('0x3d')](_0x842bcc[_0xb159('0x32')],_0x518a79[_0xb159('0x3c')]));if(_0x842bcc[_0xb159('0x32')][_0xb159('0x3e')]){_0x236161['where']=_[_0xb159('0x3f')](_0x236161[_0xb159('0x3b')],{'$or':_[_0xb159('0x2f')](_0x236161['attributes'],function(_0x5bead5){var _0xcd1500={};_0xcd1500[_0x5bead5]={'$like':'%'+_0x842bcc[_0xb159('0x32')]['filter']+'%'};return _0xcd1500;})});}_0x236161=_[_0xb159('0x3f')]({},_0x236161,_0x842bcc[_0xb159('0x47')]);return _0x34b488[_0xb159('0x51')](_0x236161);}})['then'](function(_0xcdd6c7){if(_0xcdd6c7){_0x2ccb89=_0xcdd6c7[_0xb159('0x37')];if(!_0x842bcc[_0xb159('0x32')][_0xb159('0x4d')](_0xb159('0x38'))){_0x236161[_0xb159('0x21')]=qs[_0xb159('0x21')](_0x842bcc[_0xb159('0x32')]['limit']);_0x236161['offset']=qs[_0xb159('0x1f')](_0x842bcc[_0xb159('0x32')][_0xb159('0x1f')]);}return _0x34b488[_0xb159('0x51')](_0x236161);}})['then'](function(_0x12e687){if(_0x12e687){return _0x12e687?{'count':_0x2ccb89,'rows':_0x12e687}:null;}})[_0xb159('0x26')](respondWithResult(_0xf521b9,null))[_0xb159('0x45')](handleError(_0xf521b9,null));};exports['setTags']=function(_0x162ea5,_0x276589,_0x4b8d0c){if(_0x162ea5[_0xb159('0x4a')]['id']){delete _0x162ea5[_0xb159('0x4a')]['id'];}return db[_0xb159('0x2a')][_0xb159('0x4b')]({'where':{'id':_0x162ea5['params']['id']}})[_0xb159('0x26')](handleEntityNotFound(_0x276589,null))[_0xb159('0x26')](function(_0x223e6a){if(_0x223e6a){return _0x223e6a[_0xb159('0x52')](_0x162ea5['body'][_0xb159('0x53')]||[]);}return null;})[_0xb159('0x26')](respondWithResult(_0x276589,null))[_0xb159('0x45')](handleError(_0x276589,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 629c1f1..c85117b 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 _0xad26=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad26,0x1b1));var _0x6ad2=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xad26[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x6ad2('0x0'));var util=require(_0x6ad2('0x1'));var logger=require(_0x6ad2('0x2'))(_0x6ad2('0x3'));var moment=require(_0x6ad2('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ad2('0x5'));var fs=require('fs');var path=require(_0x6ad2('0x6'));var rimraf=require(_0x6ad2('0x7'));var config=require(_0x6ad2('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x6ad2('0x9')]=function(_0x1d8635,_0x22fb2c){return _0x1d8635[_0x6ad2('0xa')](_0x6ad2('0xb'),attributes,{'tableName':_0x6ad2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16da=['define','lodash','util','api','moment','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x16da,0x1a1));var _0xa16d=function(_0x33a184,_0x5ca9e0){_0x33a184=_0x33a184-0x0;var _0x21bec9=_0x16da[_0x33a184];return _0x21bec9;};'use strict';var _=require(_0xa16d('0x0'));var util=require(_0xa16d('0x1'));var logger=require('../../config/logger')(_0xa16d('0x2'));var moment=require(_0xa16d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa16d('0x4'));var config=require(_0xa16d('0x5'));var attributes=require(_0xa16d('0x6'));module['exports']=function(_0x85bfe2,_0x2b20cc){return _0x85bfe2[_0xa16d('0x7')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','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 bd49e48..4b46c82 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 _0xa3c3=['code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1379fa,_0x1f6e63){var _0x4ff875=function(_0x463852){while(--_0x463852){_0x1379fa['push'](_0x1379fa['shift']());}};_0x4ff875(++_0x1f6e63);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x57ef4f,_0x5a7e1f){_0x57ef4f=_0x57ef4f-0x0;var _0x1f33ba=_0xa3c3[_0x57ef4f];return _0x1f33ba;};'use strict';var _=require(_0x3a3c('0x0'));var util=require('util');var moment=require(_0x3a3c('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a3c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a3c('0x3'))['db'];var utils=require(_0x3a3c('0x4'));var logger=require('../../config/logger')(_0x3a3c('0x5'));var config=require(_0x3a3c('0x6'));var jayson=require(_0x3a3c('0x7'));var client=jayson[_0x3a3c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5557ec,_0x40bb5f,_0x41a760){return new BPromise(function(_0x32f0f3,_0x320953){return client[_0x3a3c('0x9')](_0x5557ec,_0x41a760)['then'](function(_0x358367){logger[_0x3a3c('0xa')](_0x3a3c('0xb'),_0x40bb5f,_0x3a3c('0xc'));logger['debug'](_0x3a3c('0xd'),_0x40bb5f,_0x3a3c('0xc'),JSON[_0x3a3c('0xe')](_0x358367));if(_0x358367[_0x3a3c('0xf')]){if(_0x358367['error'][_0x3a3c('0x10')]===0x1f4){logger[_0x3a3c('0xf')](_0x3a3c('0xb'),_0x40bb5f,_0x358367[_0x3a3c('0xf')][_0x3a3c('0x11')]);return _0x320953(_0x358367[_0x3a3c('0xf')][_0x3a3c('0x11')]);}logger[_0x3a3c('0xf')](_0x3a3c('0xb'),_0x40bb5f,_0x358367[_0x3a3c('0xf')]['message']);return _0x32f0f3(_0x358367[_0x3a3c('0xf')][_0x3a3c('0x11')]);}else{logger['info'](_0x3a3c('0xb'),_0x40bb5f,_0x3a3c('0xc'));_0x32f0f3(_0x358367[_0x3a3c('0x12')][_0x3a3c('0x11')]);}})[_0x3a3c('0x13')](function(_0x33163e){logger[_0x3a3c('0xf')](_0x3a3c('0xb'),_0x40bb5f,_0x33163e);_0x320953(_0x33163e);});});} \ No newline at end of file +var _0xbe51=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0xdd4701,_0x11e088){var _0x5a1ab8=function(_0x1d50e9){while(--_0x1d50e9){_0xdd4701['push'](_0xdd4701['shift']());}};_0x5a1ab8(++_0x11e088);}(_0xbe51,0x1e2));var _0x1be5=function(_0x3f286e,_0xf7af1d){_0x3f286e=_0x3f286e-0x0;var _0x12b171=_0xbe51[_0x3f286e];return _0x12b171;};'use strict';var _=require(_0x1be5('0x0'));var util=require(_0x1be5('0x1'));var moment=require('moment');var BPromise=require(_0x1be5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1be5('0x3'));var db=require(_0x1be5('0x4'))['db'];var utils=require(_0x1be5('0x5'));var logger=require(_0x1be5('0x6'))(_0x1be5('0x7'));var config=require(_0x1be5('0x8'));var jayson=require(_0x1be5('0x9'));var client=jayson[_0x1be5('0xa')][_0x1be5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13fa3e,_0xf4a39f,_0x49e05a){return new BPromise(function(_0x484d9b,_0x1171b0){return client['request'](_0x13fa3e,_0x49e05a)[_0x1be5('0xc')](function(_0x36c7c2){logger['info'](_0x1be5('0xd'),_0xf4a39f,_0x1be5('0xe'));logger[_0x1be5('0xf')](_0x1be5('0x10'),_0xf4a39f,_0x1be5('0xe'),JSON[_0x1be5('0x11')](_0x36c7c2));if(_0x36c7c2[_0x1be5('0x12')]){if(_0x36c7c2['error'][_0x1be5('0x13')]===0x1f4){logger['error'](_0x1be5('0xd'),_0xf4a39f,_0x36c7c2[_0x1be5('0x12')][_0x1be5('0x14')]);return _0x1171b0(_0x36c7c2['error'][_0x1be5('0x14')]);}logger['error'](_0x1be5('0xd'),_0xf4a39f,_0x36c7c2[_0x1be5('0x12')][_0x1be5('0x14')]);return _0x484d9b(_0x36c7c2[_0x1be5('0x12')][_0x1be5('0x14')]);}else{logger[_0x1be5('0x15')](_0x1be5('0xd'),_0xf4a39f,'request\x20sent');_0x484d9b(_0x36c7c2[_0x1be5('0x16')][_0x1be5('0x14')]);}})[_0x1be5('0x17')](function(_0x3ca2b5){logger[_0x1be5('0x12')](_0x1be5('0xd'),_0xf4a39f,_0x3ca2b5);_0x1171b0(_0x3ca2b5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 60628e8..2e168aa 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 _0x3aae=['show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated'];(function(_0x21130b,_0x519278){var _0x5babb1=function(_0x12a5ad){while(--_0x12a5ad){_0x21130b['push'](_0x21130b['shift']());}};_0x5babb1(++_0x519278);}(_0x3aae,0x102));var _0xe3aa=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3aae[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xe3aa('0x0'));var util=require(_0xe3aa('0x1'));var path=require(_0xe3aa('0x2'));var timeout=require(_0xe3aa('0x3'));var express=require(_0xe3aa('0x4'));var router=express[_0xe3aa('0x5')]();var fs_extra=require(_0xe3aa('0x6'));var auth=require(_0xe3aa('0x7'));var interaction=require(_0xe3aa('0x8'));var config=require(_0xe3aa('0x9'));var controller=require(_0xe3aa('0xa'));router[_0xe3aa('0xb')]('/',auth['isAuthenticated'](),controller[_0xe3aa('0xc')]);router[_0xe3aa('0xb')](_0xe3aa('0xd'),auth[_0xe3aa('0xe')](),controller[_0xe3aa('0xf')]);router[_0xe3aa('0x10')]('/',auth[_0xe3aa('0xe')](),controller[_0xe3aa('0x11')]);router[_0xe3aa('0x12')](_0xe3aa('0xd'),auth[_0xe3aa('0xe')](),controller[_0xe3aa('0x13')]);router[_0xe3aa('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5453=['put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskField.controller','isAuthenticated','get','show','post'];(function(_0x9bf10f,_0x35bc96){var _0x13eeb3=function(_0x1f137b){while(--_0x1f137b){_0x9bf10f['push'](_0x9bf10f['shift']());}};_0x13eeb3(++_0x35bc96);}(_0x5453,0x18b));var _0x3545=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5453[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var path=require(_0x3545('0x2'));var timeout=require(_0x3545('0x3'));var express=require(_0x3545('0x4'));var router=express[_0x3545('0x5')]();var fs_extra=require(_0x3545('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3545('0x7'));var controller=require(_0x3545('0x8'));router['get']('/',auth[_0x3545('0x9')](),controller['index']);router[_0x3545('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3545('0xb')]);router[_0x3545('0xc')]('/',auth[_0x3545('0x9')](),controller['create']);router[_0x3545('0xd')](_0x3545('0xe'),auth[_0x3545('0x9')](),controller[_0x3545('0xf')]);router[_0x3545('0x10')](_0x3545('0xe'),auth[_0x3545('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 84b0096..daa501d 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 _0xec0a=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x10255f,_0x125b63){var _0x5ac535=function(_0x359993){while(--_0x359993){_0x10255f['push'](_0x10255f['shift']());}};_0x5ac535(++_0x125b63);}(_0xec0a,0x1ed));var _0xaec0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xec0a[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xaec0('0x0'));module[_0xaec0('0x1')]={'type':{'type':Sequelize[_0xaec0('0x2')](_0xaec0('0x3'),_0xaec0('0x4'),_0xaec0('0x5'),_0xaec0('0x6'),_0xaec0('0x7')),'defaultValue':_0xaec0('0x3')},'content':{'type':Sequelize[_0xaec0('0x8')]},'key':{'type':Sequelize[_0xaec0('0x8')]},'keyType':{'type':Sequelize[_0xaec0('0x2')]('string',_0xaec0('0x4'),_0xaec0('0x5'))},'keyContent':{'type':Sequelize[_0xaec0('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaec0('0x8')]},'customField':{'type':Sequelize[_0xaec0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaec0('0x8')]}}; \ No newline at end of file +var _0x5623=['customVariable','keyValue','picklist','STRING','ENUM','string','BOOLEAN','sequelize','exports','variable'];(function(_0x16abf7,_0x2c36e1){var _0x2abb12=function(_0x2b5ed5){while(--_0x2b5ed5){_0x16abf7['push'](_0x16abf7['shift']());}};_0x2abb12(++_0x2c36e1);}(_0x5623,0x1d3));var _0x3562=function(_0xf0cffa,_0xddc8a4){_0xf0cffa=_0xf0cffa-0x0;var _0x285f8f=_0x5623[_0xf0cffa];return _0x285f8f;};'use strict';var Sequelize=require(_0x3562('0x0'));module[_0x3562('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x3562('0x2'),_0x3562('0x3'),_0x3562('0x4'),_0x3562('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3562('0x6')]},'key':{'type':Sequelize[_0x3562('0x6')]},'keyType':{'type':Sequelize[_0x3562('0x7')](_0x3562('0x8'),_0x3562('0x2'),_0x3562('0x3'))},'keyContent':{'type':Sequelize[_0x3562('0x6')]},'idField':{'type':Sequelize[_0x3562('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3562('0x9')],'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 0314c4c..8844e3b 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 _0x02b6=['stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x4ebe91,_0x5ca737){var _0x24d4c9=function(_0x1703ae){while(--_0x1703ae){_0x4ebe91['push'](_0x4ebe91['shift']());}};_0x24d4c9(++_0x5ca737);}(_0x02b6,0xfe));var _0x602b=function(_0xfcfc54,_0x24f09c){_0xfcfc54=_0xfcfc54-0x0;var _0x4b437d=_0x02b6[_0xfcfc54];return _0x4b437d;};'use strict';var emlformat=require(_0x602b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x602b('0x1'));var jsonpatch=require(_0x602b('0x2'));var rp=require(_0x602b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x602b('0x4'));var util=require(_0x602b('0x5'));var path=require(_0x602b('0x6'));var sox=require(_0x602b('0x7'));var csv=require('to-csv');var ejs=require(_0x602b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x602b('0x9'));var squel=require(_0x602b('0xa'));var crypto=require(_0x602b('0xb'));var jsforce=require(_0x602b('0xc'));var deskjs=require(_0x602b('0xd'));var toCsv=require(_0x602b('0xe'));var querystring=require(_0x602b('0xf'));var Papa=require(_0x602b('0x10'));var Redis=require(_0x602b('0x11'));var authService=require(_0x602b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x602b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x602b('0x14'));var utils=require('../../config/utils');var config=require(_0x602b('0x15'));var licenseUtil=require(_0x602b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e7882,_0x41cd15){_0x41cd15=_0x41cd15||0xcc;return function(_0x135847){if(_0x135847){return _0x1e7882['sendStatus'](_0x41cd15);}return _0x1e7882[_0x602b('0x17')](_0x41cd15)[_0x602b('0x18')]();};}function respondWithResult(_0x2c7f9a,_0x3742f1){_0x3742f1=_0x3742f1||0xc8;return function(_0x27eb0a){if(_0x27eb0a){return _0x2c7f9a[_0x602b('0x17')](_0x3742f1)[_0x602b('0x19')](_0x27eb0a);}};}function respondWithFilteredResult(_0x5035b6,_0x505efc){return function(_0xc4711d){if(_0xc4711d){var _0x41f957=typeof _0x505efc[_0x602b('0x1a')]===_0x602b('0x1b')&&typeof _0x505efc[_0x602b('0x1c')]===_0x602b('0x1b');var _0x416f64=_0xc4711d[_0x602b('0x1d')];var _0x46758d=_0x41f957?0x0:_0x505efc['offset'];var _0x48d992=_0x41f957?_0xc4711d[_0x602b('0x1d')]:_0x505efc[_0x602b('0x1a')]+_0x505efc['limit'];var _0x3c991c;if(_0x48d992>=_0x416f64){_0x48d992=_0x416f64;_0x3c991c=0xc8;}else{_0x3c991c=0xce;}_0x5035b6['status'](_0x3c991c);return _0x5035b6['set'](_0x602b('0x1e'),_0x46758d+'-'+_0x48d992+'/'+_0x416f64)['json'](_0xc4711d);}return null;};}function patchUpdates(_0x28eadf){return function(_0x5e0d15){try{jsonpatch[_0x602b('0x1f')](_0x5e0d15,_0x28eadf,!![]);}catch(_0x36cd1b){return BPromise[_0x602b('0x20')](_0x36cd1b);}return _0x5e0d15['save']();};}function saveUpdates(_0x258e11,_0x1264c8){return function(_0x580b66){if(_0x580b66){return _0x580b66[_0x602b('0x21')](_0x258e11)[_0x602b('0x22')](function(_0x2c59f3){return _0x2c59f3;});}return null;};}function removeEntity(_0x1943a0,_0x8510cf){return function(_0xb3beff){if(_0xb3beff){return _0xb3beff[_0x602b('0x23')]()[_0x602b('0x22')](function(){_0x1943a0[_0x602b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43acc3,_0x427bf1){return function(_0x5ce51b){if(!_0x5ce51b){_0x43acc3[_0x602b('0x24')](0x194);}return _0x5ce51b;};}function handleError(_0x469bd9,_0x50e64e){_0x50e64e=_0x50e64e||0x1f4;return function(_0x11dfd5){logger[_0x602b('0x25')](_0x11dfd5[_0x602b('0x26')]);if(_0x11dfd5[_0x602b('0x27')]){delete _0x11dfd5[_0x602b('0x27')];}_0x469bd9[_0x602b('0x17')](_0x50e64e)[_0x602b('0x28')](_0x11dfd5);};}exports[_0x602b('0x29')]=function(_0x3e82bc,_0x1fc94f){var _0x433ad0={},_0x529fa8={},_0x23a7f4={'count':0x0,'rows':[]};var _0x582ccc=_[_0x602b('0x2a')](db[_0x602b('0x2b')][_0x602b('0x2c')],function(_0x3b951b){return{'name':_0x3b951b[_0x602b('0x2d')],'type':_0x3b951b[_0x602b('0x2e')][_0x602b('0x2f')]};});_0x529fa8[_0x602b('0x30')]=_[_0x602b('0x2a')](_0x582ccc,_0x602b('0x27'));_0x529fa8[_0x602b('0x31')]=_['keys'](_0x3e82bc['query']);_0x529fa8[_0x602b('0x32')]=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],_0x529fa8[_0x602b('0x31')]);_0x433ad0['attributes']=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],qs[_0x602b('0x34')](_0x3e82bc['query'][_0x602b('0x34')]));_0x433ad0[_0x602b('0x35')]=_0x433ad0[_0x602b('0x35')][_0x602b('0x36')]?_0x433ad0['attributes']:_0x529fa8[_0x602b('0x30')];if(!_0x3e82bc['query'][_0x602b('0x37')](_0x602b('0x38'))){_0x433ad0[_0x602b('0x1c')]=qs[_0x602b('0x1c')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1c')]);_0x433ad0['offset']=qs[_0x602b('0x1a')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1a')]);}_0x433ad0['order']=qs[_0x602b('0x39')](_0x3e82bc['query'][_0x602b('0x39')]);_0x433ad0[_0x602b('0x3a')]=qs['filters'](_['pick'](_0x3e82bc['query'],_0x529fa8[_0x602b('0x32')]),_0x582ccc);if(_0x3e82bc[_0x602b('0x31')][_0x602b('0x3b')]){_0x433ad0[_0x602b('0x3a')]=_[_0x602b('0x3c')](_0x433ad0[_0x602b('0x3a')],{'$or':_[_0x602b('0x2a')](_0x582ccc,function(_0x1ca1e5){if(_0x1ca1e5[_0x602b('0x2e')]!=='VIRTUAL'){var _0x31bb71={};_0x31bb71[_0x1ca1e5[_0x602b('0x27')]]={'$like':'%'+_0x3e82bc[_0x602b('0x31')]['filter']+'%'};return _0x31bb71;}})});}_0x433ad0=_[_0x602b('0x3c')]({},_0x433ad0,_0x3e82bc[_0x602b('0x3d')]);var _0x10529a={'where':_0x433ad0['where']};return db[_0x602b('0x2b')][_0x602b('0x1d')](_0x10529a)[_0x602b('0x22')](function(_0x19376a){_0x23a7f4[_0x602b('0x1d')]=_0x19376a;if(_0x3e82bc['query'][_0x602b('0x3e')]){_0x433ad0[_0x602b('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x602b('0x40')](_0x433ad0);})[_0x602b('0x22')](function(_0x3888f6){_0x23a7f4[_0x602b('0x41')]=_0x3888f6;return _0x23a7f4;})['then'](respondWithFilteredResult(_0x1fc94f,_0x433ad0))['catch'](handleError(_0x1fc94f,null));};exports[_0x602b('0x42')]=function(_0x521cfd,_0x4a68d4){var _0x2ab1cf={'raw':!![],'where':{'id':_0x521cfd[_0x602b('0x43')]['id']}},_0x4bc46a={};_0x4bc46a[_0x602b('0x30')]=_[_0x602b('0x44')](db['DeskField'][_0x602b('0x2c')]);_0x4bc46a['query']=_['keys'](_0x521cfd[_0x602b('0x31')]);_0x4bc46a[_0x602b('0x32')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],_0x4bc46a[_0x602b('0x31')]);_0x2ab1cf[_0x602b('0x35')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],qs[_0x602b('0x34')](_0x521cfd[_0x602b('0x31')][_0x602b('0x34')]));_0x2ab1cf['attributes']=_0x2ab1cf[_0x602b('0x35')][_0x602b('0x36')]?_0x2ab1cf[_0x602b('0x35')]:_0x4bc46a['model'];if(_0x521cfd[_0x602b('0x31')][_0x602b('0x3e')]){_0x2ab1cf['include']=[{'all':!![]}];}_0x2ab1cf=_[_0x602b('0x3c')]({},_0x2ab1cf,_0x521cfd['options']);return db[_0x602b('0x2b')][_0x602b('0x45')](_0x2ab1cf)[_0x602b('0x22')](handleEntityNotFound(_0x4a68d4,null))[_0x602b('0x22')](respondWithResult(_0x4a68d4,null))[_0x602b('0x46')](handleError(_0x4a68d4,null));};exports[_0x602b('0x47')]=function(_0xec0931,_0x2fb9ad){return db[_0x602b('0x2b')][_0x602b('0x47')](_0xec0931[_0x602b('0x48')],{})[_0x602b('0x22')](respondWithResult(_0x2fb9ad,0xc9))['catch'](handleError(_0x2fb9ad,null));};exports['update']=function(_0x528837,_0x33b838){if(_0x528837[_0x602b('0x48')]['id']){delete _0x528837[_0x602b('0x48')]['id'];}return db[_0x602b('0x2b')][_0x602b('0x45')]({'where':{'id':_0x528837[_0x602b('0x43')]['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x33b838,null))[_0x602b('0x22')](saveUpdates(_0x528837['body'],null))[_0x602b('0x22')](respondWithResult(_0x33b838,null))['catch'](handleError(_0x33b838,null));};exports[_0x602b('0x23')]=function(_0x1f72b0,_0x52677b){return db[_0x602b('0x2b')]['find']({'where':{'id':_0x1f72b0[_0x602b('0x43')]['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x52677b,null))[_0x602b('0x22')](removeEntity(_0x52677b,null))[_0x602b('0x46')](handleError(_0x52677b,null));}; \ No newline at end of file +var _0xe2fe=['include','catch','show','find','body','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','DeskField','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['DeskField']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':!![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['DeskField']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4210332..dd723d1 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 _0x2b94=['api','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','util'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x2b94,0x140));var _0x42b9=function(_0x54c174,_0x1e2d7b){_0x54c174=_0x54c174-0x0;var _0x671ed=_0x2b94[_0x54c174];return _0x671ed;};'use strict';var _=require(_0x42b9('0x0'));var util=require(_0x42b9('0x1'));var logger=require('../../config/logger')(_0x42b9('0x2'));var moment=require('moment');var BPromise=require(_0x42b9('0x3'));var rp=require(_0x42b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42b9('0x5'));var config=require(_0x42b9('0x6'));var attributes=require(_0x42b9('0x7'));module[_0x42b9('0x8')]=function(_0x257e34,_0xdf5a6){return _0x257e34[_0x42b9('0x9')](_0x42b9('0xa'),attributes,{'tableName':_0x42b9('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x42b9('0xc'),_0x42b9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf82=['./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x301385,_0x4fe4fe){var _0x4c8827=function(_0x17f5ba){while(--_0x17f5ba){_0x301385['push'](_0x301385['shift']());}};_0x4c8827(++_0x4fe4fe);}(_0xdf82,0x13b));var _0x2df8=function(_0xd6847,_0x3c2656){_0xd6847=_0xd6847-0x0;var _0x3c7913=_0xdf82[_0xd6847];return _0x3c7913;};'use strict';var _=require(_0x2df8('0x0'));var util=require(_0x2df8('0x1'));var logger=require('../../config/logger')(_0x2df8('0x2'));var moment=require(_0x2df8('0x3'));var BPromise=require(_0x2df8('0x4'));var rp=require(_0x2df8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2df8('0x6'));var attributes=require(_0x2df8('0x7'));module['exports']=function(_0x41ef74,_0x212e7d){return _0x41ef74[_0x2df8('0x8')](_0x2df8('0x9'),attributes,{'tableName':_0x2df8('0xa'),'paranoid':![],'indexes':[{'name':_0x2df8('0xb'),'fields':[_0x2df8('0xc'),_0x2df8('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 6a59465..f3a0942 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 _0x3134=['then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x5df9c5,_0x3b41d3){var _0x1a4029=function(_0x5e475b){while(--_0x5e475b){_0x5df9c5['push'](_0x5df9c5['shift']());}};_0x1a4029(++_0x3b41d3);}(_0x3134,0x8f));var _0x4313=function(_0x1eb4c4,_0xb7bafc){_0x1eb4c4=_0x1eb4c4-0x0;var _0xdcd99a=_0x3134[_0x1eb4c4];return _0xdcd99a;};'use strict';var _=require('lodash');var util=require(_0x4313('0x0'));var moment=require('moment');var BPromise=require(_0x4313('0x1'));var rs=require(_0x4313('0x2'));var fs=require('fs');var Redis=require(_0x4313('0x3'));var db=require(_0x4313('0x4'))['db'];var utils=require(_0x4313('0x5'));var logger=require('../../config/logger')(_0x4313('0x6'));var config=require('../../config/environment');var jayson=require(_0x4313('0x7'));var client=jayson[_0x4313('0x8')][_0x4313('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55eabc,_0x45b9a9,_0x4eca6c){return new BPromise(function(_0x30e7d4,_0x3473e3){return client[_0x4313('0xa')](_0x55eabc,_0x4eca6c)[_0x4313('0xb')](function(_0xd3a3f4){logger[_0x4313('0xc')](_0x4313('0xd'),_0x45b9a9,_0x4313('0xe'));logger[_0x4313('0xf')](_0x4313('0x10'),_0x45b9a9,_0x4313('0xe'),JSON[_0x4313('0x11')](_0xd3a3f4));if(_0xd3a3f4[_0x4313('0x12')]){if(_0xd3a3f4[_0x4313('0x12')]['code']===0x1f4){logger[_0x4313('0x12')](_0x4313('0xd'),_0x45b9a9,_0xd3a3f4['error'][_0x4313('0x13')]);return _0x3473e3(_0xd3a3f4['error'][_0x4313('0x13')]);}logger[_0x4313('0x12')](_0x4313('0xd'),_0x45b9a9,_0xd3a3f4[_0x4313('0x12')][_0x4313('0x13')]);return _0x30e7d4(_0xd3a3f4[_0x4313('0x12')][_0x4313('0x13')]);}else{logger['info'](_0x4313('0xd'),_0x45b9a9,_0x4313('0xe'));_0x30e7d4(_0xd3a3f4[_0x4313('0x14')][_0x4313('0x13')]);}})[_0x4313('0x15')](function(_0xf60000){logger[_0x4313('0x12')](_0x4313('0xd'),_0x45b9a9,_0xf60000);_0x3473e3(_0xf60000);});});} \ No newline at end of file +var _0x833f=['message','info','result','catch','lodash','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','request','then','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0x833f,0x190));var _0xf833=function(_0x1ee938,_0x22267f){_0x1ee938=_0x1ee938-0x0;var _0x3ebf3b=_0x833f[_0x1ee938];return _0x3ebf3b;};'use strict';var _=require(_0xf833('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf833('0x1'));var rs=require(_0xf833('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf833('0x3'))('rpc');var config=require(_0xf833('0x4'));var jayson=require(_0xf833('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x127e42,_0x452bbe,_0x4a96d6){return new BPromise(function(_0xb24d69,_0x22d54a){return client[_0xf833('0x6')](_0x127e42,_0x4a96d6)[_0xf833('0x7')](function(_0xb8c69e){logger['info'](_0xf833('0x8'),_0x452bbe,'request\x20sent');logger[_0xf833('0x9')](_0xf833('0xa'),_0x452bbe,_0xf833('0xb'),JSON['stringify'](_0xb8c69e));if(_0xb8c69e[_0xf833('0xc')]){if(_0xb8c69e[_0xf833('0xc')][_0xf833('0xd')]===0x1f4){logger[_0xf833('0xc')](_0xf833('0x8'),_0x452bbe,_0xb8c69e[_0xf833('0xc')][_0xf833('0xe')]);return _0x22d54a(_0xb8c69e[_0xf833('0xc')][_0xf833('0xe')]);}logger[_0xf833('0xc')](_0xf833('0x8'),_0x452bbe,_0xb8c69e[_0xf833('0xc')]['message']);return _0xb24d69(_0xb8c69e[_0xf833('0xc')]['message']);}else{logger[_0xf833('0xf')]('DeskField,\x20%s,\x20%s',_0x452bbe,'request\x20sent');_0xb24d69(_0xb8c69e[_0xf833('0x10')][_0xf833('0xe')]);}})[_0xf833('0x11')](function(_0x22a2cf){logger[_0xf833('0xc')](_0xf833('0x8'),_0x452bbe,_0x22a2cf);_0x22d54a(_0x22a2cf);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 89c1b20..bae7393 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 _0x5a5b=['multer','path','express','fs-extra','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports'];(function(_0x5d1514,_0x2c6dbc){var _0x55b13f=function(_0x2ba2cd){while(--_0x2ba2cd){_0x5d1514['push'](_0x5d1514['shift']());}};_0x55b13f(++_0x2c6dbc);}(_0x5a5b,0x1db));var _0xb5a5=function(_0x3e7328,_0x122482){_0x3e7328=_0x3e7328-0x0;var _0x1db031=_0x5a5b[_0x3e7328];return _0x1db031;};'use strict';var multer=require(_0xb5a5('0x0'));var util=require('util');var path=require(_0xb5a5('0x1'));var timeout=require('connect-timeout');var express=require(_0xb5a5('0x2'));var router=express['Router']();var fs_extra=require(_0xb5a5('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xb5a5('0x4')]('/',auth[_0xb5a5('0x5')](),controller[_0xb5a5('0x6')]);router['get'](_0xb5a5('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xb5a5('0x4')](_0xb5a5('0x8'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0x9')]);router[_0xb5a5('0x4')](_0xb5a5('0xa'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0xb')]);router[_0xb5a5('0xc')]('/',auth[_0xb5a5('0x5')](),controller[_0xb5a5('0xd')]);router[_0xb5a5('0xc')](_0xb5a5('0x8'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb5a5('0xe')](_0xb5a5('0x7'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0xf')]);router[_0xb5a5('0x10')](_0xb5a5('0x7'),auth[_0xb5a5('0x5')](),controller[_0xb5a5('0x11')]);module[_0xb5a5('0x12')]=router; \ No newline at end of file +var _0xb508=['/:id/fields','post','create','addConfiguration','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xb508,0x83));var _0x8b50=function(_0xcf330b,_0x4a3b91){_0xcf330b=_0xcf330b-0x0;var _0x552e3e=_0xb508[_0xcf330b];return _0x552e3e;};'use strict';var multer=require(_0x8b50('0x0'));var util=require(_0x8b50('0x1'));var path=require(_0x8b50('0x2'));var timeout=require(_0x8b50('0x3'));var express=require('express');var router=express[_0x8b50('0x4')]();var fs_extra=require(_0x8b50('0x5'));var auth=require(_0x8b50('0x6'));var interaction=require(_0x8b50('0x7'));var config=require(_0x8b50('0x8'));var controller=require(_0x8b50('0x9'));router[_0x8b50('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b50('0xa')](_0x8b50('0xb'),auth['isAuthenticated'](),controller[_0x8b50('0xc')]);router[_0x8b50('0xa')](_0x8b50('0xd'),auth[_0x8b50('0xe')](),controller[_0x8b50('0xf')]);router['get'](_0x8b50('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x8b50('0x11')]('/',auth[_0x8b50('0xe')](),controller[_0x8b50('0x12')]);router['post'](_0x8b50('0xd'),auth[_0x8b50('0xe')](),controller[_0x8b50('0x13')]);router['put'](_0x8b50('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8b50('0x14')](_0x8b50('0xb'),auth[_0x8b50('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index fbb3c05..54efa2d 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 _0xde81=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0xde81,0x109));var _0x1de8=function(_0x557023,_0xe2ecfd){_0x557023=_0x557023-0x0;var _0x16c4f7=_0xde81[_0x557023];return _0x16c4f7;};'use strict';var Sequelize=require(_0x1de8('0x0'));module[_0x1de8('0x1')]={'name':{'type':Sequelize[_0x1de8('0x2')]},'username':{'type':Sequelize[_0x1de8('0x2')]},'password':{'type':Sequelize[_0x1de8('0x2')]},'remoteUri':{'type':Sequelize[_0x1de8('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1de8('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1de8('0x2')]},'modernAuthentication':{'type':Sequelize[_0x1de8('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2e3b=['exports','STRING','BOOLEAN'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2e3b,0x81));var _0xb2e3=function(_0x266dd7,_0x1f77f4){_0x266dd7=_0x266dd7-0x0;var _0x23d4b9=_0x2e3b[_0x266dd7];return _0x23d4b9;};'use strict';var Sequelize=require('sequelize');module[_0xb2e3('0x0')]={'name':{'type':Sequelize[_0xb2e3('0x1')]},'username':{'type':Sequelize[_0xb2e3('0x1')]},'password':{'type':Sequelize[_0xb2e3('0x1')]},'remoteUri':{'type':Sequelize[_0xb2e3('0x1')]},'tenantId':{'type':Sequelize[_0xb2e3('0x1')]},'clientId':{'type':Sequelize[_0xb2e3('0x1')]},'clientSecret':{'type':Sequelize[_0xb2e3('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb2e3('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb2e3('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 69c2f02..337094b 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 _0xdb56=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','includeAll','create','body','find','params','findOne','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','substring','lastIndexOf','format','%s/api/data/v9.0/','incident','Incident','PhoneCall','customerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x41594a,_0x521176){var _0x707409=function(_0x1acba4){while(--_0x1acba4){_0x41594a['push'](_0x41594a['shift']());}};_0x707409(++_0x521176);}(_0xdb56,0x95));var _0x6db5=function(_0x3772b5,_0x1c71cf){_0x3772b5=_0x3772b5-0x0;var _0x565d5d=_0xdb56[_0x3772b5];return _0x565d5d;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x6db5('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x6db5('0x1'))(_0x6db5('0x2'));var db=require(_0x6db5('0x3'))['db'];var integrations=require(_0x6db5('0x4'));function respondWithResult(_0x1b3180,_0x1e5668){_0x1e5668=_0x1e5668||0xc8;return function(_0xdf8381){if(_0xdf8381){return _0x1b3180[_0x6db5('0x5')](_0x1e5668)[_0x6db5('0x6')](_0xdf8381);}};}function respondWithFilteredResult(_0x3b5ba9,_0x2f2690){return function(_0x12687b){if(_0x12687b){var _0x15bd01=typeof _0x2f2690[_0x6db5('0x7')]===_0x6db5('0x8')&&typeof _0x2f2690[_0x6db5('0x9')]===_0x6db5('0x8');var _0x280911=_0x12687b[_0x6db5('0xa')];var _0x46816b=_0x15bd01?0x0:_0x2f2690[_0x6db5('0x7')];var _0x4f117a=_0x15bd01?_0x12687b['count']:_0x2f2690[_0x6db5('0x7')]+_0x2f2690[_0x6db5('0x9')];var _0x4eabac;if(_0x4f117a>=_0x280911){_0x4f117a=_0x280911;_0x4eabac=0xc8;}else{_0x4eabac=0xce;}_0x3b5ba9[_0x6db5('0x5')](_0x4eabac);return _0x3b5ba9[_0x6db5('0xb')](_0x6db5('0xc'),_0x46816b+'-'+_0x4f117a+'/'+_0x280911)[_0x6db5('0x6')](_0x12687b);}return null;};}function saveUpdates(_0x589887){return function(_0xfdaf11){if(_0xfdaf11){return _0xfdaf11[_0x6db5('0xd')](_0x589887)[_0x6db5('0xe')](function(_0xb622a6){return _0xb622a6;});}return null;};}function removeEntity(_0xb1ea50){return function(_0x34b1df){if(_0x34b1df){return _0x34b1df[_0x6db5('0xf')]()[_0x6db5('0xe')](function(){_0xb1ea50[_0x6db5('0x5')](0xcc)[_0x6db5('0x10')]();});}};}function handleEntityNotFound(_0x14b0f8){return function(_0x30c119){if(!_0x30c119){_0x14b0f8[_0x6db5('0x11')](0x194);}return _0x30c119;};}function handleError(_0x3798ba,_0x39bc94){_0x39bc94=_0x39bc94||0x1f4;return function(_0x31ed45){logger[_0x6db5('0x12')](_0x31ed45[_0x6db5('0x13')]);if(_0x31ed45['name']){delete _0x31ed45[_0x6db5('0x14')];}_0x3798ba[_0x6db5('0x5')](_0x39bc94)[_0x6db5('0x15')](_0x31ed45);};}exports[_0x6db5('0x16')]=function(_0x2dfd45,_0x5baf99){var _0x526b53={},_0x1a410c={},_0x3897b8={'count':0x0,'rows':[]};var _0x3b9b53=_[_0x6db5('0x17')](db[_0x6db5('0x18')][_0x6db5('0x19')],function(_0x52dad1){return{'name':_0x52dad1[_0x6db5('0x1a')],'type':_0x52dad1[_0x6db5('0x1b')][_0x6db5('0x1c')]};});_0x1a410c[_0x6db5('0x1d')]=_[_0x6db5('0x17')](_0x3b9b53,_0x6db5('0x14'));_0x1a410c[_0x6db5('0x1e')]=_[_0x6db5('0x1f')](_0x2dfd45[_0x6db5('0x1e')]);_0x1a410c[_0x6db5('0x20')]=_[_0x6db5('0x21')](_0x1a410c['model'],_0x1a410c['query']);_0x526b53[_0x6db5('0x22')]=_[_0x6db5('0x21')](_0x1a410c['model'],qs[_0x6db5('0x23')](_0x2dfd45[_0x6db5('0x1e')]['fields']));_0x526b53[_0x6db5('0x22')]=_0x526b53[_0x6db5('0x22')][_0x6db5('0x24')]?_0x526b53[_0x6db5('0x22')]:_0x1a410c['model'];if(!_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x25')](_0x6db5('0x26'))){_0x526b53[_0x6db5('0x9')]=qs[_0x6db5('0x9')](_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x9')]);_0x526b53[_0x6db5('0x7')]=qs['offset'](_0x2dfd45[_0x6db5('0x1e')]['offset']);}_0x526b53[_0x6db5('0x27')]=qs[_0x6db5('0x28')](_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x28')]);_0x526b53[_0x6db5('0x29')]=qs['filters'](_['pick'](_0x2dfd45[_0x6db5('0x1e')],_0x1a410c[_0x6db5('0x20')]),_0x3b9b53);if(_0x2dfd45[_0x6db5('0x1e')][_0x6db5('0x2a')]){_0x526b53['where']=_[_0x6db5('0x2b')](_0x526b53['where'],{'$or':_[_0x6db5('0x17')](_0x3b9b53,function(_0x288c18){if(_0x288c18[_0x6db5('0x1b')]!==_0x6db5('0x2c')){var _0x9b25c1={};_0x9b25c1[_0x288c18[_0x6db5('0x14')]]={'$like':'%'+_0x2dfd45[_0x6db5('0x1e')]['filter']+'%'};return _0x9b25c1;}})});}_0x526b53=_[_0x6db5('0x2b')]({},_0x526b53,_0x2dfd45[_0x6db5('0x2d')]);var _0x30bbac={'where':_0x526b53[_0x6db5('0x29')]};return db[_0x6db5('0x18')][_0x6db5('0xa')](_0x30bbac)[_0x6db5('0xe')](function(_0x3f3653){_0x3897b8[_0x6db5('0xa')]=_0x3f3653;if(_0x2dfd45[_0x6db5('0x1e')]['includeAll']){_0x526b53[_0x6db5('0x2e')]=[{'all':!![]}];}return db[_0x6db5('0x18')]['findAll'](_0x526b53);})[_0x6db5('0xe')](function(_0x567fd9){_0x3897b8[_0x6db5('0x2f')]=_0x567fd9;return _0x3897b8;})[_0x6db5('0xe')](respondWithFilteredResult(_0x5baf99,_0x526b53))[_0x6db5('0x30')](handleError(_0x5baf99,null));};exports['show']=function(_0x50cb6f,_0x2a114f){var _0x2264f6={'raw':![],'where':{'id':_0x50cb6f['params']['id']}},_0x5e574d={};_0x5e574d[_0x6db5('0x1d')]=_[_0x6db5('0x1f')](db[_0x6db5('0x18')]['rawAttributes']);_0x5e574d[_0x6db5('0x1e')]=_[_0x6db5('0x1f')](_0x50cb6f[_0x6db5('0x1e')]);_0x5e574d['filters']=_[_0x6db5('0x21')](_0x5e574d[_0x6db5('0x1d')],_0x5e574d[_0x6db5('0x1e')]);_0x2264f6[_0x6db5('0x22')]=_[_0x6db5('0x21')](_0x5e574d[_0x6db5('0x1d')],qs[_0x6db5('0x23')](_0x50cb6f['query'][_0x6db5('0x23')]));_0x2264f6[_0x6db5('0x22')]=_0x2264f6['attributes'][_0x6db5('0x24')]?_0x2264f6[_0x6db5('0x22')]:_0x5e574d[_0x6db5('0x1d')];if(_0x50cb6f[_0x6db5('0x1e')][_0x6db5('0x31')]){_0x2264f6[_0x6db5('0x2e')]=[{'all':!![]}];}_0x2264f6=_[_0x6db5('0x2b')]({},_0x2264f6,_0x50cb6f[_0x6db5('0x2d')]);return db[_0x6db5('0x18')]['find'](_0x2264f6)[_0x6db5('0xe')](handleEntityNotFound(_0x2a114f,null))[_0x6db5('0xe')](respondWithResult(_0x2a114f,null))['catch'](handleError(_0x2a114f,null));};exports[_0x6db5('0x32')]=function(_0x1659f7,_0x3f785){return db[_0x6db5('0x18')][_0x6db5('0x32')](_0x1659f7[_0x6db5('0x33')],{})['then'](respondWithResult(_0x3f785,0xc9))[_0x6db5('0x30')](handleError(_0x3f785,null));};exports['update']=function(_0x1bfaaf,_0xbc72cc){if(_0x1bfaaf[_0x6db5('0x33')]['id']){delete _0x1bfaaf['body']['id'];}return db['Dynamics365Account'][_0x6db5('0x34')]({'where':{'id':_0x1bfaaf[_0x6db5('0x35')]['id']}})[_0x6db5('0xe')](handleEntityNotFound(_0xbc72cc,null))['then'](saveUpdates(_0x1bfaaf[_0x6db5('0x33')],null))['then'](respondWithResult(_0xbc72cc,null))[_0x6db5('0x30')](handleError(_0xbc72cc,null));};exports[_0x6db5('0xf')]=function(_0x370037,_0x188f3a){return db['Dynamics365Account'][_0x6db5('0x34')]({'where':{'id':_0x370037[_0x6db5('0x35')]['id']}})[_0x6db5('0xe')](handleEntityNotFound(_0x188f3a,null))[_0x6db5('0xe')](removeEntity(_0x188f3a,null))['catch'](handleError(_0x188f3a,null));};exports['getConfigurations']=function(_0x308abc,_0x44f14e){var _0x295ea3={};var _0x3fb6e0={};var _0x539d22;var _0x389b4b;return db['Dynamics365Account'][_0x6db5('0x36')]({'where':{'id':_0x308abc['params']['id']}})[_0x6db5('0xe')](handleEntityNotFound(_0x44f14e,null))[_0x6db5('0xe')](function(_0x24cbcd){if(_0x24cbcd){_0x539d22=_0x24cbcd;_0x3fb6e0[_0x6db5('0x1d')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x3fb6e0[_0x6db5('0x1e')]=_['keys'](_0x308abc[_0x6db5('0x1e')]);_0x3fb6e0[_0x6db5('0x20')]=_[_0x6db5('0x21')](_0x3fb6e0[_0x6db5('0x1d')],_0x3fb6e0[_0x6db5('0x1e')]);_0x295ea3[_0x6db5('0x22')]=_['intersection'](_0x3fb6e0[_0x6db5('0x1d')],qs[_0x6db5('0x23')](_0x308abc[_0x6db5('0x1e')][_0x6db5('0x23')]));_0x295ea3[_0x6db5('0x22')]=_0x295ea3[_0x6db5('0x22')][_0x6db5('0x24')]?_0x295ea3[_0x6db5('0x22')]:_0x3fb6e0[_0x6db5('0x1d')];_0x295ea3[_0x6db5('0x27')]=qs[_0x6db5('0x28')](_0x308abc['query'][_0x6db5('0x28')]);_0x295ea3[_0x6db5('0x29')]=qs[_0x6db5('0x20')](_['pick'](_0x308abc[_0x6db5('0x1e')],_0x3fb6e0[_0x6db5('0x20')]));if(_0x308abc['query']['filter']){_0x295ea3[_0x6db5('0x29')]=_[_0x6db5('0x2b')](_0x295ea3['where'],{'$or':_['map'](_0x295ea3['attributes'],function(_0x3a6b53){var _0xc9db1c={};_0xc9db1c[_0x3a6b53]={'$like':'%'+_0x308abc[_0x6db5('0x1e')]['filter']+'%'};return _0xc9db1c;})});}_0x295ea3=_[_0x6db5('0x2b')]({},_0x295ea3,_0x308abc['options']);return _0x539d22[_0x6db5('0x37')](_0x295ea3);}})['then'](function(_0x4d8230){if(_0x4d8230){_0x389b4b=_0x4d8230['length'];if(!_0x308abc[_0x6db5('0x1e')]['hasOwnProperty']('nolimit')){_0x295ea3[_0x6db5('0x9')]=qs[_0x6db5('0x9')](_0x308abc['query'][_0x6db5('0x9')]);_0x295ea3[_0x6db5('0x7')]=qs[_0x6db5('0x7')](_0x308abc[_0x6db5('0x1e')][_0x6db5('0x7')]);}return _0x539d22[_0x6db5('0x37')](_0x295ea3);}})['then'](function(_0x54ef03){if(_0x54ef03){return _0x54ef03?{'count':_0x389b4b,'rows':_0x54ef03}:null;}})[_0x6db5('0xe')](respondWithResult(_0x44f14e,null))['catch'](handleError(_0x44f14e,null));};exports[_0x6db5('0x38')]=function(_0x3486f2,_0x2a4ef3){if(_0x3486f2[_0x6db5('0x33')]['id']){delete _0x3486f2['body']['id'];}return db[_0x6db5('0x18')][_0x6db5('0x36')]({'where':{'id':_0x3486f2[_0x6db5('0x35')]['id']}})['then'](handleEntityNotFound(_0x2a4ef3,null))['then'](function(_0x37f4e5){if(_0x37f4e5){_0x3486f2[_0x6db5('0x33')]['AccountId']=_0x37f4e5['id'];_0x3486f2[_0x6db5('0x33')][_0x6db5('0x39')]=integrations[_0x6db5('0x3a')](_0x3486f2[_0x6db5('0x33')][_0x6db5('0x3b')],_0x3486f2[_0x6db5('0x33')][_0x6db5('0x1b')]);_0x3486f2[_0x6db5('0x33')]['Descriptions']=integrations[_0x6db5('0x3c')](_0x3486f2[_0x6db5('0x33')][_0x6db5('0x3b')],_0x3486f2[_0x6db5('0x33')]['type']);return db['Dynamics365Configuration'][_0x6db5('0x32')](_0x3486f2[_0x6db5('0x33')],{'include':[{'model':db[_0x6db5('0x3d')],'as':_0x6db5('0x39')},{'model':db[_0x6db5('0x3d')],'as':_0x6db5('0x3e')}]});}return null;})['then'](respondWithResult(_0x2a4ef3,null))[_0x6db5('0x30')](handleError(_0x2a4ef3,null));};function sanitizeRemoteUri(_0x427dcb){var _0x4f3ada=_0x427dcb['slice'](-0x1);if(_0x4f3ada==='/')return _0x427dcb[_0x6db5('0x3f')](0x0,_0x427dcb[_0x6db5('0x40')](_0x4f3ada));return _0x427dcb;}function getWebApiUrl(_0x40e0bb){return util[_0x6db5('0x41')](_0x6db5('0x42'),_0x40e0bb);}exports['getFields']=function(_0x13720d,_0x3df77e){var _0x20acf4=_0x13720d[_0x6db5('0x1e')]['ticketType'];var _0x4bdb38=_0x20acf4===_0x6db5('0x43')?_0x6db5('0x44'):_0x6db5('0x45');var _0x4605bc='';var _0x464daf='';var _0x34718e='';var _0x4ae8b5='';var _0x51f12f='';var _0x5cf620='';var _0x29e5f2='';var _0xdfc3b6='';var _0x13deda=['title','description',_0x6db5('0x46'),'ownerid',_0x6db5('0x47'),_0x6db5('0x48'),_0x6db5('0x49'),_0x6db5('0x4a'),'directioncode',_0x6db5('0x4b')];var _0x32339d=[_0x6db5('0x4c'),_0x6db5('0x4d'),_0x6db5('0x4e'),_0x6db5('0x4f'),_0x6db5('0x50'),'contactidyominame',_0x6db5('0x51'),_0x6db5('0x52'),_0x6db5('0x53'),_0x6db5('0x54'),_0x6db5('0x55'),_0x6db5('0x56'),_0x6db5('0x57'),_0x6db5('0x58'),_0x6db5('0x59'),_0x6db5('0x5a'),_0x6db5('0x5b'),_0x6db5('0x5c'),_0x6db5('0x5d'),_0x6db5('0x5e'),_0x6db5('0x5f'),_0x6db5('0x60'),_0x6db5('0x61'),_0x6db5('0x62'),'firstresponsebykpiidname',_0x6db5('0x63'),_0x6db5('0x64'),_0x6db5('0x65'),_0x6db5('0x66'),_0x6db5('0x67'),'masteridname',_0x6db5('0x68'),_0x6db5('0x69'),_0x6db5('0x6a'),_0x6db5('0x6b'),_0x6db5('0x6c'),'modifiedonbehalfbyname',_0x6db5('0x6d'),_0x6db5('0x6e'),_0x6db5('0x6f'),'numberofchildincidents',_0x6db5('0x70'),'overriddencreatedon','owneridname',_0x6db5('0x71'),_0x6db5('0x72'),'parentcaseidname',_0x6db5('0x73'),_0x6db5('0x74'),_0x6db5('0x75'),'productidname',_0x6db5('0x76'),_0x6db5('0x77'),_0x6db5('0x78'),_0x6db5('0x79'),_0x6db5('0x7a'),_0x6db5('0x7b'),'sentimentvalue',_0x6db5('0x7c'),_0x6db5('0x7d'),'socialprofileidname',_0x6db5('0x7e'),_0x6db5('0x7f'),_0x6db5('0x80'),'ticketnumber',_0x6db5('0x81'),_0x6db5('0x82'),_0x6db5('0x83'),_0x6db5('0x84'),_0x6db5('0x85')];var _0x288570=_0x13deda[_0x6db5('0x86')](_0x32339d);return db[_0x6db5('0x18')][_0x6db5('0x36')]({'where':{'id':_0x13720d[_0x6db5('0x35')]['id']},'attributes':['id','username',_0x6db5('0x87'),_0x6db5('0x88'),_0x6db5('0x89'),_0x6db5('0x8a'),_0x6db5('0x8b'),_0x6db5('0x8c')],'include':[{'model':db[_0x6db5('0x8d')],'as':_0x6db5('0x8d'),'attributes':['id',_0x6db5('0x8e'),_0x6db5('0x8f')]}]})[_0x6db5('0xe')](handleEntityNotFound(_0x3df77e,null))['then'](function(_0x419a67){if(_0x419a67){if(_0x419a67[_0x6db5('0x8c')]){_0x419a67[_0x6db5('0x90')]=_0x419a67[_0x6db5('0x8d')]['data5'];_0xdfc3b6=sanitizeRemoteUri(_0x419a67[_0x6db5('0x8d')]['data7']);_0x29e5f2=getWebApiUrl(_0xdfc3b6);return _0x419a67;}_0xdfc3b6=sanitizeRemoteUri(_0x419a67['remoteUri']);_0x29e5f2=getWebApiUrl(_0xdfc3b6);var _0x39e120={'method':_0x6db5('0x91'),'uri':_0x6db5('0x92')+_0x419a67[_0x6db5('0x89')]+_0x6db5('0x93'),'form':{'client_id':_0x419a67[_0x6db5('0x8a')],'resource':_0xdfc3b6,'username':_0x419a67[_0x6db5('0x94')],'password':_0x419a67[_0x6db5('0x87')],'grant_type':_0x6db5('0x87'),'client_secret':_0x419a67['clientSecret']},'json':!![]};return rp(_0x39e120);}})[_0x6db5('0xe')](function(_0x589eeb){_0x5cf620=_0x589eeb[_0x6db5('0x90')];var _0x29257f={'method':_0x6db5('0x95'),'uri':encodeURI(_0x29e5f2+_0x6db5('0x96')+_0x4bdb38+'\x27'),'headers':{'Authorization':_0x6db5('0x97')+_0x5cf620,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x29257f);})[_0x6db5('0xe')](function(_0x7113f6){var _0x4ecbe6=_0x7113f6['value'][0x0];var _0x17c49b=_0x4ecbe6[_0x6db5('0x99')];var _0x53dbb6={'method':_0x6db5('0x95'),'uri':_0x29e5f2+_0x6db5('0x9a')+_0x17c49b+_0x6db5('0x9b'),'headers':{'Authorization':_0x6db5('0x97')+_0x5cf620,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x53dbb6);})[_0x6db5('0xe')](function(_0x5a4472){_0x4605bc=_0x5a4472;_0x464daf=_0x4605bc['Attributes'];_0x464daf=_[_0x6db5('0x9c')](_0x464daf,function(_0x346121){return!_0x288570[_0x6db5('0x9d')](_0x346121[_0x6db5('0x9e')]);});var _0x211198=[];var _0x3887b7=[];_0x464daf[_0x6db5('0x9f')](function(_0x1c01b1){if(_0x1c01b1[_0x6db5('0xa0')]){var _0x5aa3e6=_0x1c01b1['@odata.type']['substring'](_0x1c01b1[_0x6db5('0xa0')]['lastIndexOf']('.')+0x1);if(_0x5aa3e6===_0x6db5('0xa1')){_0x211198[_0x6db5('0xa2')](getSelectList(_0x29e5f2,_0x20acf4,_0x3887b7,_0x4605bc['MetadataId'],_0x1c01b1[_0x6db5('0x99')],_0x5cf620));}}});return Promise[_0x6db5('0xa3')](_0x211198);})[_0x6db5('0xe')](function(_0x434ea5){_0x34718e=_0x434ea5[0x0];var _0x344799=[];var _0x2b1262=[];_0x464daf[_0x6db5('0x9f')](function(_0x1e2f23){if(!_['isNil'](_0x1e2f23[_0x6db5('0xa0')])){var _0x581c61=_0x1e2f23[_0x6db5('0xa0')][_0x6db5('0x3f')](_0x1e2f23[_0x6db5('0xa0')][_0x6db5('0x40')]('.')+0x1);if(_0x581c61==='BooleanAttributeMetadata'){_0x344799['push'](getBooleanList(_0x29e5f2,_0x20acf4,_0x2b1262,_0x4605bc[_0x6db5('0x99')],_0x1e2f23[_0x6db5('0x99')],_0x5cf620));}}});return Promise[_0x6db5('0xa3')](_0x344799);})[_0x6db5('0xe')](function(_0x10ccb2){_0x4ae8b5=_0x10ccb2[0x0];var _0x40332a=[];var _0x58a5fe=[];_0x464daf[_0x6db5('0x9f')](function(_0x52bb49){if(_0x52bb49[_0x6db5('0xa0')]){var _0x44bc0f=_0x52bb49[_0x6db5('0xa0')][_0x6db5('0x3f')](_0x52bb49[_0x6db5('0xa0')][_0x6db5('0x40')]('.')+0x1);if(_0x44bc0f==='StringAttributeMetadata'||_0x44bc0f==='DoubleAttributeMetadata'||_0x44bc0f===_0x6db5('0xa4')||_0x44bc0f==='IntegerAttributeMetadata'||_0x44bc0f==='MemoAttributeMetadata'||_0x44bc0f===_0x6db5('0xa5')||_0x44bc0f===_0x6db5('0xa6')||_0x44bc0f===_0x6db5('0xa7')||_0x44bc0f===_0x6db5('0xa8')||_0x44bc0f===_0x6db5('0xa9')){_0x40332a[_0x6db5('0xa2')](getInputList(_0x29e5f2,_0x20acf4,_0x44bc0f,_0x58a5fe,_0x4605bc[_0x6db5('0x99')],_0x52bb49['MetadataId'],_0x5cf620));}}});return Promise[_0x6db5('0xa3')](_0x40332a);})[_0x6db5('0xe')](function(_0xe7defa){_0x51f12f=_0xe7defa[0x0];var _0x22893f=_0x34718e[_0x6db5('0x86')](_0x4ae8b5)['concat'](_0x51f12f);var _0x1e2540={'count':_0x22893f['length'],'rows':_0x22893f};return _0x1e2540;})[_0x6db5('0xe')](respondWithResult(_0x3df77e,null))[_0x6db5('0x30')](function(_0x363deb){var _0x2f6425=_0x13720d[_0x6db5('0x1e')][_0x6db5('0xaa')]?0x1f4:_0x363deb[_0x6db5('0xab')]||0x1f4;logger['error'](_0x363deb[_0x6db5('0x13')]);delete _0x363deb['name'];if(_0x2f6425===0x191){_0x2f6425=0x190;}_0x3df77e[_0x6db5('0x5')](_0x2f6425)[_0x6db5('0x15')](_0x13720d[_0x6db5('0x1e')][_0x6db5('0xaa')]?{'message':_0x6db5('0xac'),'statusCode':_0x363deb[_0x6db5('0xab')]}:_0x363deb);});};function getSelectList(_0xb321db,_0x63dcc9,_0x1cc87f,_0x2701c9,_0x277d5f,_0x4e40a0){var _0x4391a7={'method':_0x6db5('0x95'),'uri':_0xb321db+_0x6db5('0x9a')+_0x2701c9+_0x6db5('0xad')+_0x277d5f+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x6db5('0xae'),'headers':{'Authorization':'Bearer\x20'+_0x4e40a0,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x4391a7)['then'](function(_0x29f4ac){var _0x44b6b0=[];var _0x541094=_0x29f4ac['OptionSet'][_0x6db5('0xaf')];_0x541094[_0x6db5('0x9f')](function(_0x5dd450){_0x44b6b0[_0x6db5('0xa2')]({'name':_0x5dd450[_0x6db5('0xb0')]['UserLocalizedLabel']['Label'],'value':String(_0x5dd450['Value'])});});var _0x488eeb={'id':_0x63dcc9+'_'+_0x29f4ac[_0x6db5('0x9e')],'name':_0x29f4ac[_0x6db5('0xb1')][_0x6db5('0xb2')][_0x6db5('0xb0')],'custom':![],'options':_0x44b6b0};_0x1cc87f[_0x6db5('0xa2')](_0x488eeb);return _0x1cc87f;});}function getBooleanList(_0x3c28ce,_0x3c2c75,_0x3bf38e,_0x4b1cde,_0xe7349d,_0x5e5c5a){var _0x58949e={'method':'GET','uri':_0x3c28ce+'EntityDefinitions('+_0x4b1cde+_0x6db5('0xad')+_0xe7349d+_0x6db5('0xb3'),'headers':{'Authorization':_0x6db5('0x97')+_0x5e5c5a,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x58949e)[_0x6db5('0xe')](function(_0x22f562){var _0x307f06=[];_0x307f06[_0x6db5('0xa2')]({'name':_0x22f562[_0x6db5('0xb4')][_0x6db5('0xb5')][_0x6db5('0xb0')][_0x6db5('0xb2')]['Label'],'value':_0x6db5('0xb6')},{'name':_0x22f562[_0x6db5('0xb4')][_0x6db5('0xb7')][_0x6db5('0xb0')]['UserLocalizedLabel'][_0x6db5('0xb0')],'value':_0x6db5('0xb8')});var _0x2518f4={'id':_0x3c2c75+'_'+_0x22f562[_0x6db5('0x9e')],'name':_0x22f562[_0x6db5('0xb1')][_0x6db5('0xb2')]['Label'],'custom':![],'options':_0x307f06};_0x3bf38e[_0x6db5('0xa2')](_0x2518f4);return _0x3bf38e;});}function getInputList(_0x154224,_0x16d367,_0x151271,_0x5390fa,_0x4b3957,_0x49d1b8,_0x220905){var _0x4e1989={'method':_0x6db5('0x95'),'uri':_0x154224+_0x6db5('0x9a')+_0x4b3957+_0x6db5('0xad')+_0x49d1b8+')/Microsoft.Dynamics.CRM.'+_0x151271+_0x6db5('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0x220905,'If-None-Match':null,'OData-Version':_0x6db5('0x98')},'json':!![]};return rp(_0x4e1989)[_0x6db5('0xe')](function(_0x5346b5){var _0xf42cbf={'id':_0x16d367+'_'+_0x5346b5[_0x6db5('0x9e')],'name':_0x5346b5[_0x6db5('0xb1')][_0x6db5('0xb2')]?_0x5346b5[_0x6db5('0xb1')]['UserLocalizedLabel'][_0x6db5('0xb0')]:_0x5346b5['LogicalName'],'custom':![],'options':[]};_0x5390fa[_0x6db5('0xa2')](_0xf42cbf);return _0x5390fa;});} \ No newline at end of file +var _0x590a=['update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','getSubjects','channel','getDescriptions','Dynamics365Field','Subjects','slice','substring','format','getFields','ticketType','Incident','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','prioritycodename','productidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','password','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','push','MetadataId','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','concat','test','statusCode','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','json','offset','undefined','count','limit','status','set','Content-Range'];(function(_0x1c23cf,_0xd9ca9d){var _0x53d56c=function(_0x35fb35){while(--_0x35fb35){_0x1c23cf['push'](_0x1c23cf['shift']());}};_0x53d56c(++_0xd9ca9d);}(_0x590a,0x159));var _0xa590=function(_0x19046f,_0x18ad23){_0x19046f=_0x19046f-0x0;var _0xcecdd9=_0x590a[_0x19046f];return _0xcecdd9;};'use strict';var rp=require('request-promise');var util=require(_0xa590('0x0'));var _=require(_0xa590('0x1'));var qs=require(_0xa590('0x2'));var logger=require(_0xa590('0x3'))(_0xa590('0x4'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x8ee149,_0x26b6d9){_0x26b6d9=_0x26b6d9||0xc8;return function(_0x2fc2a0){if(_0x2fc2a0){return _0x8ee149['status'](_0x26b6d9)[_0xa590('0x5')](_0x2fc2a0);}};}function respondWithFilteredResult(_0x4c127b,_0x2dcf20){return function(_0x163d19){if(_0x163d19){var _0x2ad01a=typeof _0x2dcf20[_0xa590('0x6')]==='undefined'&&typeof _0x2dcf20['limit']===_0xa590('0x7');var _0x486f78=_0x163d19[_0xa590('0x8')];var _0x3e59f3=_0x2ad01a?0x0:_0x2dcf20[_0xa590('0x6')];var _0x5ad7e3=_0x2ad01a?_0x163d19[_0xa590('0x8')]:_0x2dcf20[_0xa590('0x6')]+_0x2dcf20[_0xa590('0x9')];var _0x1cbe68;if(_0x5ad7e3>=_0x486f78){_0x5ad7e3=_0x486f78;_0x1cbe68=0xc8;}else{_0x1cbe68=0xce;}_0x4c127b[_0xa590('0xa')](_0x1cbe68);return _0x4c127b[_0xa590('0xb')](_0xa590('0xc'),_0x3e59f3+'-'+_0x5ad7e3+'/'+_0x486f78)['json'](_0x163d19);}return null;};}function saveUpdates(_0x5bc467){return function(_0x252e2b){if(_0x252e2b){return _0x252e2b[_0xa590('0xd')](_0x5bc467)[_0xa590('0xe')](function(_0x1733ab){return _0x1733ab;});}return null;};}function removeEntity(_0x52656c){return function(_0xdf68af){if(_0xdf68af){return _0xdf68af[_0xa590('0xf')]()['then'](function(){_0x52656c['status'](0xcc)[_0xa590('0x10')]();});}};}function handleEntityNotFound(_0x5ec6e2){return function(_0x165b81){if(!_0x165b81){_0x5ec6e2[_0xa590('0x11')](0x194);}return _0x165b81;};}function handleError(_0x1d218c,_0x18092f){_0x18092f=_0x18092f||0x1f4;return function(_0xfb7055){logger[_0xa590('0x12')](_0xfb7055[_0xa590('0x13')]);if(_0xfb7055[_0xa590('0x14')]){delete _0xfb7055[_0xa590('0x14')];}_0x1d218c[_0xa590('0xa')](_0x18092f)[_0xa590('0x15')](_0xfb7055);};}exports[_0xa590('0x16')]=function(_0x2161ce,_0x5b4317){var _0x352bf6={},_0x219d01={},_0x230299={'count':0x0,'rows':[]};var _0x37e07e=_[_0xa590('0x17')](db[_0xa590('0x18')][_0xa590('0x19')],function(_0x378e4e){return{'name':_0x378e4e['fieldName'],'type':_0x378e4e[_0xa590('0x1a')][_0xa590('0x1b')]};});_0x219d01['model']=_['map'](_0x37e07e,_0xa590('0x14'));_0x219d01[_0xa590('0x1c')]=_[_0xa590('0x1d')](_0x2161ce[_0xa590('0x1c')]);_0x219d01[_0xa590('0x1e')]=_['intersection'](_0x219d01[_0xa590('0x1f')],_0x219d01[_0xa590('0x1c')]);_0x352bf6[_0xa590('0x20')]=_[_0xa590('0x21')](_0x219d01[_0xa590('0x1f')],qs[_0xa590('0x22')](_0x2161ce['query'][_0xa590('0x22')]));_0x352bf6['attributes']=_0x352bf6[_0xa590('0x20')][_0xa590('0x23')]?_0x352bf6[_0xa590('0x20')]:_0x219d01['model'];if(!_0x2161ce[_0xa590('0x1c')][_0xa590('0x24')](_0xa590('0x25'))){_0x352bf6[_0xa590('0x9')]=qs['limit'](_0x2161ce['query'][_0xa590('0x9')]);_0x352bf6[_0xa590('0x6')]=qs[_0xa590('0x6')](_0x2161ce[_0xa590('0x1c')][_0xa590('0x6')]);}_0x352bf6[_0xa590('0x26')]=qs[_0xa590('0x27')](_0x2161ce['query'][_0xa590('0x27')]);_0x352bf6[_0xa590('0x28')]=qs[_0xa590('0x1e')](_[_0xa590('0x29')](_0x2161ce[_0xa590('0x1c')],_0x219d01[_0xa590('0x1e')]),_0x37e07e);if(_0x2161ce['query']['filter']){_0x352bf6['where']=_[_0xa590('0x2a')](_0x352bf6['where'],{'$or':_['map'](_0x37e07e,function(_0x366310){if(_0x366310[_0xa590('0x1a')]!==_0xa590('0x2b')){var _0x2cbe1a={};_0x2cbe1a[_0x366310['name']]={'$like':'%'+_0x2161ce[_0xa590('0x1c')][_0xa590('0x2c')]+'%'};return _0x2cbe1a;}})});}_0x352bf6=_['merge']({},_0x352bf6,_0x2161ce[_0xa590('0x2d')]);var _0x3643f0={'where':_0x352bf6[_0xa590('0x28')]};return db[_0xa590('0x18')][_0xa590('0x8')](_0x3643f0)['then'](function(_0x3e88cd){_0x230299['count']=_0x3e88cd;if(_0x2161ce[_0xa590('0x1c')][_0xa590('0x2e')]){_0x352bf6[_0xa590('0x2f')]=[{'all':!![]}];}return db[_0xa590('0x18')]['findAll'](_0x352bf6);})[_0xa590('0xe')](function(_0x328322){_0x230299[_0xa590('0x30')]=_0x328322;return _0x230299;})[_0xa590('0xe')](respondWithFilteredResult(_0x5b4317,_0x352bf6))[_0xa590('0x31')](handleError(_0x5b4317,null));};exports[_0xa590('0x32')]=function(_0x47c2fd,_0x347964){var _0x34bdf6={'raw':![],'where':{'id':_0x47c2fd[_0xa590('0x33')]['id']}},_0x1b9fa6={};_0x1b9fa6[_0xa590('0x1f')]=_[_0xa590('0x1d')](db[_0xa590('0x18')][_0xa590('0x19')]);_0x1b9fa6[_0xa590('0x1c')]=_[_0xa590('0x1d')](_0x47c2fd[_0xa590('0x1c')]);_0x1b9fa6['filters']=_['intersection'](_0x1b9fa6['model'],_0x1b9fa6[_0xa590('0x1c')]);_0x34bdf6[_0xa590('0x20')]=_[_0xa590('0x21')](_0x1b9fa6[_0xa590('0x1f')],qs[_0xa590('0x22')](_0x47c2fd[_0xa590('0x1c')]['fields']));_0x34bdf6[_0xa590('0x20')]=_0x34bdf6[_0xa590('0x20')][_0xa590('0x23')]?_0x34bdf6[_0xa590('0x20')]:_0x1b9fa6[_0xa590('0x1f')];if(_0x47c2fd[_0xa590('0x1c')][_0xa590('0x2e')]){_0x34bdf6['include']=[{'all':!![]}];}_0x34bdf6=_[_0xa590('0x2a')]({},_0x34bdf6,_0x47c2fd['options']);return db[_0xa590('0x18')][_0xa590('0x34')](_0x34bdf6)[_0xa590('0xe')](handleEntityNotFound(_0x347964,null))[_0xa590('0xe')](respondWithResult(_0x347964,null))[_0xa590('0x31')](handleError(_0x347964,null));};exports[_0xa590('0x35')]=function(_0x4382df,_0x1c9620){return db[_0xa590('0x18')][_0xa590('0x35')](_0x4382df[_0xa590('0x36')],{})['then'](respondWithResult(_0x1c9620,0xc9))[_0xa590('0x31')](handleError(_0x1c9620,null));};exports[_0xa590('0xd')]=function(_0x1f81fe,_0x22d839){if(_0x1f81fe[_0xa590('0x36')]['id']){delete _0x1f81fe['body']['id'];}return db['Dynamics365Account'][_0xa590('0x34')]({'where':{'id':_0x1f81fe[_0xa590('0x33')]['id']}})[_0xa590('0xe')](handleEntityNotFound(_0x22d839,null))[_0xa590('0xe')](saveUpdates(_0x1f81fe['body'],null))[_0xa590('0xe')](respondWithResult(_0x22d839,null))['catch'](handleError(_0x22d839,null));};exports[_0xa590('0xf')]=function(_0x4938b7,_0x37a676){return db['Dynamics365Account'][_0xa590('0x34')]({'where':{'id':_0x4938b7['params']['id']}})['then'](handleEntityNotFound(_0x37a676,null))[_0xa590('0xe')](removeEntity(_0x37a676,null))[_0xa590('0x31')](handleError(_0x37a676,null));};exports[_0xa590('0x37')]=function(_0x19bf39,_0x46c30e){var _0x46909e={};var _0x547826={};var _0x5ec6f7;var _0x41b7f1;return db['Dynamics365Account'][_0xa590('0x38')]({'where':{'id':_0x19bf39[_0xa590('0x33')]['id']}})[_0xa590('0xe')](handleEntityNotFound(_0x46c30e,null))[_0xa590('0xe')](function(_0x3bc106){if(_0x3bc106){_0x5ec6f7=_0x3bc106;_0x547826['model']=_['keys'](db[_0xa590('0x39')][_0xa590('0x19')]);_0x547826[_0xa590('0x1c')]=_['keys'](_0x19bf39[_0xa590('0x1c')]);_0x547826['filters']=_[_0xa590('0x21')](_0x547826[_0xa590('0x1f')],_0x547826[_0xa590('0x1c')]);_0x46909e[_0xa590('0x20')]=_['intersection'](_0x547826[_0xa590('0x1f')],qs[_0xa590('0x22')](_0x19bf39['query']['fields']));_0x46909e[_0xa590('0x20')]=_0x46909e[_0xa590('0x20')][_0xa590('0x23')]?_0x46909e[_0xa590('0x20')]:_0x547826['model'];_0x46909e[_0xa590('0x26')]=qs['sort'](_0x19bf39[_0xa590('0x1c')][_0xa590('0x27')]);_0x46909e[_0xa590('0x28')]=qs['filters'](_[_0xa590('0x29')](_0x19bf39[_0xa590('0x1c')],_0x547826[_0xa590('0x1e')]));if(_0x19bf39[_0xa590('0x1c')][_0xa590('0x2c')]){_0x46909e[_0xa590('0x28')]=_[_0xa590('0x2a')](_0x46909e[_0xa590('0x28')],{'$or':_[_0xa590('0x17')](_0x46909e['attributes'],function(_0x18e3e8){var _0x45a57f={};_0x45a57f[_0x18e3e8]={'$like':'%'+_0x19bf39[_0xa590('0x1c')]['filter']+'%'};return _0x45a57f;})});}_0x46909e=_['merge']({},_0x46909e,_0x19bf39['options']);return _0x5ec6f7[_0xa590('0x37')](_0x46909e);}})[_0xa590('0xe')](function(_0x2beda3){if(_0x2beda3){_0x41b7f1=_0x2beda3[_0xa590('0x23')];if(!_0x19bf39[_0xa590('0x1c')]['hasOwnProperty']('nolimit')){_0x46909e[_0xa590('0x9')]=qs[_0xa590('0x9')](_0x19bf39[_0xa590('0x1c')]['limit']);_0x46909e[_0xa590('0x6')]=qs[_0xa590('0x6')](_0x19bf39['query']['offset']);}return _0x5ec6f7[_0xa590('0x37')](_0x46909e);}})[_0xa590('0xe')](function(_0x2b3713){if(_0x2b3713){return _0x2b3713?{'count':_0x41b7f1,'rows':_0x2b3713}:null;}})[_0xa590('0xe')](respondWithResult(_0x46c30e,null))[_0xa590('0x31')](handleError(_0x46c30e,null));};exports['addConfiguration']=function(_0x424383,_0x26e937){if(_0x424383[_0xa590('0x36')]['id']){delete _0x424383[_0xa590('0x36')]['id'];}return db[_0xa590('0x18')][_0xa590('0x38')]({'where':{'id':_0x424383[_0xa590('0x33')]['id']}})[_0xa590('0xe')](handleEntityNotFound(_0x26e937,null))[_0xa590('0xe')](function(_0x5acb6c){if(_0x5acb6c){_0x424383[_0xa590('0x36')]['AccountId']=_0x5acb6c['id'];_0x424383[_0xa590('0x36')]['Subjects']=integrations[_0xa590('0x3a')](_0x424383[_0xa590('0x36')][_0xa590('0x3b')],_0x424383['body']['type']);_0x424383[_0xa590('0x36')]['Descriptions']=integrations[_0xa590('0x3c')](_0x424383['body'][_0xa590('0x3b')],_0x424383['body'][_0xa590('0x1a')]);return db['Dynamics365Configuration']['create'](_0x424383[_0xa590('0x36')],{'include':[{'model':db[_0xa590('0x3d')],'as':_0xa590('0x3e')},{'model':db[_0xa590('0x3d')],'as':'Descriptions'}]});}return null;})[_0xa590('0xe')](respondWithResult(_0x26e937,null))[_0xa590('0x31')](handleError(_0x26e937,null));};function sanitizeRemoteUri(_0x42cc60){var _0x3fad2b=_0x42cc60[_0xa590('0x3f')](-0x1);if(_0x3fad2b==='/')return _0x42cc60[_0xa590('0x40')](0x0,_0x42cc60['lastIndexOf'](_0x3fad2b));return _0x42cc60;}function getWebApiUrl(_0x457c7f){return util[_0xa590('0x41')]('%s/api/data/v9.0/',_0x457c7f);}exports[_0xa590('0x42')]=function(_0x4e9d74,_0x2f224e){var _0x3d6baa=_0x4e9d74[_0xa590('0x1c')][_0xa590('0x43')];var _0x30ca42=_0x3d6baa==='incident'?_0xa590('0x44'):'PhoneCall';var _0x35fa22='';var _0xce8857='';var _0x1f95d7='';var _0x145da3='';var _0x1fbfad='';var _0x440116='';var _0x52595e='';var _0x417f42='';var _0x504c6b=[_0xa590('0x45'),_0xa590('0x46'),'customerid',_0xa590('0x47'),_0xa590('0x48'),_0xa590('0x49'),_0xa590('0x4a'),_0xa590('0x4b'),'directioncode',_0xa590('0x4c')];var _0x15744e=[_0xa590('0x4d'),_0xa590('0x4e'),_0xa590('0x4f'),'billedserviceunits',_0xa590('0x50'),'contactidyominame',_0xa590('0x51'),_0xa590('0x52'),_0xa590('0x53'),_0xa590('0x54'),_0xa590('0x55'),_0xa590('0x56'),_0xa590('0x57'),_0xa590('0x58'),_0xa590('0x59'),_0xa590('0x5a'),_0xa590('0x5b'),_0xa590('0x5c'),_0xa590('0x5d'),'entitlementidname','entityimage_timestamp',_0xa590('0x5e'),_0xa590('0x5f'),'exchangerate',_0xa590('0x60'),_0xa590('0x61'),_0xa590('0x62'),_0xa590('0x63'),_0xa590('0x64'),'lastonholdtime',_0xa590('0x65'),_0xa590('0x66'),'modifiedbyexternalpartyyominame','modifiedbyname',_0xa590('0x67'),_0xa590('0x68'),'modifiedonbehalfbyname',_0xa590('0x69'),'msdyn_incidenttypename',_0xa590('0x6a'),_0xa590('0x6b'),'onholdtime',_0xa590('0x6c'),_0xa590('0x6d'),_0xa590('0x6e'),_0xa590('0x6f'),'parentcaseidname','primarycontactidname',_0xa590('0x70'),_0xa590('0x71'),_0xa590('0x72'),'productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname',_0xa590('0x73'),_0xa590('0x74'),_0xa590('0x75'),_0xa590('0x76'),_0xa590('0x77'),'statecode',_0xa590('0x78'),'subjectidname',_0xa590('0x79'),'timezoneruleversionnumber',_0xa590('0x7a'),_0xa590('0x7b'),_0xa590('0x7c'),'versionnumber'];var _0x3dd7d3=_0x504c6b['concat'](_0x15744e);return db[_0xa590('0x18')][_0xa590('0x38')]({'where':{'id':_0x4e9d74[_0xa590('0x33')]['id']},'attributes':['id','username',_0xa590('0x7d'),_0xa590('0x7e'),_0xa590('0x7f'),_0xa590('0x80'),'clientSecret',_0xa590('0x81')],'include':[{'model':db[_0xa590('0x82')],'as':'CloudProvider','attributes':['id',_0xa590('0x83'),'data7']}]})[_0xa590('0xe')](handleEntityNotFound(_0x2f224e,null))[_0xa590('0xe')](function(_0x436fc0){if(_0x436fc0){if(_0x436fc0[_0xa590('0x81')]){_0x436fc0['access_token']=_0x436fc0[_0xa590('0x82')][_0xa590('0x83')];_0x417f42=sanitizeRemoteUri(_0x436fc0['CloudProvider'][_0xa590('0x84')]);_0x52595e=getWebApiUrl(_0x417f42);return _0x436fc0;}_0x417f42=sanitizeRemoteUri(_0x436fc0[_0xa590('0x7e')]);_0x52595e=getWebApiUrl(_0x417f42);var _0x2bbbcb={'method':_0xa590('0x85'),'uri':'https://login.microsoftonline.com/'+_0x436fc0[_0xa590('0x7f')]+_0xa590('0x86'),'form':{'client_id':_0x436fc0[_0xa590('0x80')],'resource':_0x417f42,'username':_0x436fc0['username'],'password':_0x436fc0['password'],'grant_type':_0xa590('0x7d'),'client_secret':_0x436fc0[_0xa590('0x87')]},'json':!![]};return rp(_0x2bbbcb);}})[_0xa590('0xe')](function(_0x402064){_0x440116=_0x402064[_0xa590('0x88')];var _0x10b514={'method':_0xa590('0x89'),'uri':encodeURI(_0x52595e+_0xa590('0x8a')+_0x30ca42+'\x27'),'headers':{'Authorization':_0xa590('0x8b')+_0x440116,'If-None-Match':null,'OData-Version':_0xa590('0x8c')},'json':!![]};return rp(_0x10b514);})[_0xa590('0xe')](function(_0x12698a){var _0x57d548=_0x12698a['value'][0x0];var _0x20811f=_0x57d548['MetadataId'];var _0x5d1d02={'method':'GET','uri':_0x52595e+'EntityDefinitions('+_0x20811f+_0xa590('0x8d'),'headers':{'Authorization':_0xa590('0x8b')+_0x440116,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5d1d02);})[_0xa590('0xe')](function(_0x28bf4d){_0x35fa22=_0x28bf4d;_0xce8857=_0x35fa22[_0xa590('0x8e')];_0xce8857=_[_0xa590('0x8f')](_0xce8857,function(_0x3936b0){return!_0x3dd7d3[_0xa590('0x90')](_0x3936b0['LogicalName']);});var _0x3b1a2b=[];var _0x40fb3a=[];_0xce8857[_0xa590('0x91')](function(_0x50557c){if(_0x50557c[_0xa590('0x92')]){var _0x216d44=_0x50557c[_0xa590('0x92')][_0xa590('0x40')](_0x50557c[_0xa590('0x92')]['lastIndexOf']('.')+0x1);if(_0x216d44==='PicklistAttributeMetadata'){_0x3b1a2b[_0xa590('0x93')](getSelectList(_0x52595e,_0x3d6baa,_0x40fb3a,_0x35fa22[_0xa590('0x94')],_0x50557c[_0xa590('0x94')],_0x440116));}}});return Promise[_0xa590('0x95')](_0x3b1a2b);})['then'](function(_0x2693e1){_0x1f95d7=_0x2693e1[0x0];var _0x4dd0c4=[];var _0x315dd0=[];_0xce8857[_0xa590('0x91')](function(_0x164d15){if(!_[_0xa590('0x96')](_0x164d15[_0xa590('0x92')])){var _0xd784a8=_0x164d15[_0xa590('0x92')][_0xa590('0x40')](_0x164d15['@odata.type'][_0xa590('0x97')]('.')+0x1);if(_0xd784a8===_0xa590('0x98')){_0x4dd0c4[_0xa590('0x93')](getBooleanList(_0x52595e,_0x3d6baa,_0x315dd0,_0x35fa22['MetadataId'],_0x164d15[_0xa590('0x94')],_0x440116));}}});return Promise['all'](_0x4dd0c4);})[_0xa590('0xe')](function(_0x15bdf3){_0x145da3=_0x15bdf3[0x0];var _0x113a90=[];var _0x4f6149=[];_0xce8857[_0xa590('0x91')](function(_0x2e9394){if(_0x2e9394[_0xa590('0x92')]){var _0x1b3398=_0x2e9394[_0xa590('0x92')]['substring'](_0x2e9394[_0xa590('0x92')][_0xa590('0x97')]('.')+0x1);if(_0x1b3398===_0xa590('0x99')||_0x1b3398===_0xa590('0x9a')||_0x1b3398==='BigIntAttributeMetadata'||_0x1b3398===_0xa590('0x9b')||_0x1b3398===_0xa590('0x9c')||_0x1b3398==='DateTimeAttributeMetadata'||_0x1b3398===_0xa590('0x9d')||_0x1b3398==='EntityNameAttributeMetadata'||_0x1b3398===_0xa590('0x9e')||_0x1b3398==='DecimalAttributeMetadata'){_0x113a90[_0xa590('0x93')](getInputList(_0x52595e,_0x3d6baa,_0x1b3398,_0x4f6149,_0x35fa22[_0xa590('0x94')],_0x2e9394[_0xa590('0x94')],_0x440116));}}});return Promise[_0xa590('0x95')](_0x113a90);})[_0xa590('0xe')](function(_0x13d78a){_0x1fbfad=_0x13d78a[0x0];var _0x25eb16=_0x1f95d7['concat'](_0x145da3)[_0xa590('0x9f')](_0x1fbfad);var _0x3979de={'count':_0x25eb16['length'],'rows':_0x25eb16};return _0x3979de;})[_0xa590('0xe')](respondWithResult(_0x2f224e,null))[_0xa590('0x31')](function(_0x40dd96){var _0x389a7d=_0x4e9d74[_0xa590('0x1c')][_0xa590('0xa0')]?0x1f4:_0x40dd96[_0xa590('0xa1')]||0x1f4;logger[_0xa590('0x12')](_0x40dd96['stack']);delete _0x40dd96[_0xa590('0x14')];if(_0x389a7d===0x191){_0x389a7d=0x190;}_0x2f224e[_0xa590('0xa')](_0x389a7d)['send'](_0x4e9d74['query']['test']?{'message':_0xa590('0xa2'),'statusCode':_0x40dd96[_0xa590('0xa1')]}:_0x40dd96);});};function getSelectList(_0x11445e,_0x44bb51,_0x3ed462,_0x23e3b1,_0xa77904,_0x9cd4c7){var _0x53e56e={'method':_0xa590('0x89'),'uri':_0x11445e+'EntityDefinitions('+_0x23e3b1+')/Attributes('+_0xa77904+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xa590('0xa3'),'headers':{'Authorization':_0xa590('0x8b')+_0x9cd4c7,'If-None-Match':null,'OData-Version':_0xa590('0x8c')},'json':!![]};return rp(_0x53e56e)[_0xa590('0xe')](function(_0x1dddff){var _0xa7cbad=[];var _0x15de06=_0x1dddff['OptionSet'][_0xa590('0xa4')];_0x15de06[_0xa590('0x91')](function(_0x4dc961){_0xa7cbad[_0xa590('0x93')]({'name':_0x4dc961[_0xa590('0xa5')][_0xa590('0xa6')][_0xa590('0xa5')],'value':String(_0x4dc961[_0xa590('0xa7')])});});var _0x1b128e={'id':_0x44bb51+'_'+_0x1dddff[_0xa590('0xa8')],'name':_0x1dddff[_0xa590('0xa9')][_0xa590('0xa6')][_0xa590('0xa5')],'custom':![],'options':_0xa7cbad};_0x3ed462[_0xa590('0x93')](_0x1b128e);return _0x3ed462;});}function getBooleanList(_0x2e45e0,_0x3b6242,_0x9073e8,_0x5cd9eb,_0x59db55,_0x939eb4){var _0x1642e6={'method':_0xa590('0x89'),'uri':_0x2e45e0+_0xa590('0xaa')+_0x5cd9eb+')/Attributes('+_0x59db55+_0xa590('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x939eb4,'If-None-Match':null,'OData-Version':_0xa590('0x8c')},'json':!![]};return rp(_0x1642e6)['then'](function(_0x51cada){var _0x350c19=[];_0x350c19[_0xa590('0x93')]({'name':_0x51cada[_0xa590('0xac')][_0xa590('0xad')][_0xa590('0xa5')][_0xa590('0xa6')][_0xa590('0xa5')],'value':_0xa590('0xae')},{'name':_0x51cada[_0xa590('0xac')][_0xa590('0xaf')][_0xa590('0xa5')][_0xa590('0xa6')]['Label'],'value':'false'});var _0x26821f={'id':_0x3b6242+'_'+_0x51cada[_0xa590('0xa8')],'name':_0x51cada['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x350c19};_0x9073e8[_0xa590('0x93')](_0x26821f);return _0x9073e8;});}function getInputList(_0x4a086b,_0xedd581,_0x5a4d1e,_0x122200,_0x1d0010,_0x34d581,_0x4aa499){var _0x38a6db={'method':'GET','uri':_0x4a086b+_0xa590('0xaa')+_0x1d0010+_0xa590('0xb0')+_0x34d581+_0xa590('0xb1')+_0x5a4d1e+_0xa590('0xb2'),'headers':{'Authorization':'Bearer\x20'+_0x4aa499,'If-None-Match':null,'OData-Version':_0xa590('0x8c')},'json':!![]};return rp(_0x38a6db)[_0xa590('0xe')](function(_0x2652be){var _0x614238={'id':_0xedd581+'_'+_0x2652be[_0xa590('0xa8')],'name':_0x2652be['DisplayName']['UserLocalizedLabel']?_0x2652be[_0xa590('0xa9')][_0xa590('0xa6')][_0xa590('0xa5')]:_0x2652be[_0xa590('0xa8')],'custom':![],'options':[]};_0x122200[_0xa590('0x93')](_0x614238);return _0x122200;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f5b163a..f387d2d 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x16fad3,_0x561e36){var _0x556122=function(_0x24bb10){while(--_0x24bb10){_0x16fad3['push'](_0x16fad3['shift']());}};_0x556122(++_0x561e36);}(_0x757a,0xde));var _0xa757=function(_0x1ed6d5,_0x57cbd3){_0x1ed6d5=_0x1ed6d5-0x0;var _0x17cd78=_0x757a[_0x1ed6d5];return _0x17cd78;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index dd911d1..2cf1d11 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 _0x4b86=['options','raw','where','attributes','limit','map','include','model','ShowDynamics365Account','find','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0x4b86,0x1e7));var _0x64b8=function(_0x3e6898,_0x25681e){_0x3e6898=_0x3e6898-0x0;var _0x419360=_0x4b86[_0x3e6898];return _0x419360;};'use strict';var _=require(_0x64b8('0x0'));var util=require('util');var moment=require(_0x64b8('0x1'));var BPromise=require(_0x64b8('0x2'));var rs=require(_0x64b8('0x3'));var fs=require('fs');var Redis=require(_0x64b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64b8('0x5'))('rpc');var config=require(_0x64b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x64b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x739f10,_0x1e0031,_0x472018){return new BPromise(function(_0x4e253d,_0x1bacbd){return client[_0x64b8('0x8')](_0x739f10,_0x472018)['then'](function(_0x475bce){logger[_0x64b8('0x9')](_0x64b8('0xa'),_0x1e0031,'request\x20sent');logger[_0x64b8('0xb')](_0x64b8('0xc'),_0x1e0031,_0x64b8('0xd'),JSON[_0x64b8('0xe')](_0x475bce));if(_0x475bce[_0x64b8('0xf')]){if(_0x475bce[_0x64b8('0xf')][_0x64b8('0x10')]===0x1f4){logger[_0x64b8('0xf')](_0x64b8('0xa'),_0x1e0031,_0x475bce[_0x64b8('0xf')]['message']);return _0x1bacbd(_0x475bce[_0x64b8('0xf')]['message']);}logger['error'](_0x64b8('0xa'),_0x1e0031,_0x475bce[_0x64b8('0xf')][_0x64b8('0x11')]);return _0x4e253d(_0x475bce['error']['message']);}else{logger[_0x64b8('0x9')](_0x64b8('0xa'),_0x1e0031,'request\x20sent');_0x4e253d(_0x475bce[_0x64b8('0x12')]['message']);}})[_0x64b8('0x13')](function(_0x2ad2fa){logger[_0x64b8('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1e0031,_0x2ad2fa);_0x1bacbd(_0x2ad2fa);});});}exports[_0x64b8('0x14')]=function(_0x2e562e){var _0x6e8aa3=this;return new Promise(function(_0x179721,_0x3ca102){return db[_0x64b8('0x15')][_0x64b8('0x16')]({'raw':_0x2e562e[_0x64b8('0x17')]?_0x2e562e[_0x64b8('0x17')][_0x64b8('0x18')]===undefined?!![]:![]:!![],'where':_0x2e562e[_0x64b8('0x17')]?_0x2e562e['options'][_0x64b8('0x19')]||null:null,'attributes':_0x2e562e['options']?_0x2e562e['options'][_0x64b8('0x1a')]||null:null,'limit':_0x2e562e[_0x64b8('0x17')]?_0x2e562e[_0x64b8('0x17')][_0x64b8('0x1b')]||null:null,'include':_0x2e562e[_0x64b8('0x17')]?_0x2e562e['options']['include']?_[_0x64b8('0x1c')](_0x2e562e[_0x64b8('0x17')][_0x64b8('0x1d')],function(_0x475dc3){return{'model':db[_0x475dc3[_0x64b8('0x1e')]],'as':_0x475dc3['as'],'attributes':_0x475dc3[_0x64b8('0x1a')],'include':_0x475dc3['include']?_[_0x64b8('0x1c')](_0x475dc3[_0x64b8('0x1d')],function(_0x272c08){return{'model':db[_0x272c08[_0x64b8('0x1e')]],'as':_0x272c08['as'],'attributes':_0x272c08[_0x64b8('0x1a')],'include':_0x272c08[_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x272c08['include'],function(_0xa715aa){return{'model':db[_0xa715aa[_0x64b8('0x1e')]],'as':_0xa715aa['as'],'attributes':_0xa715aa[_0x64b8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x579875){logger[_0x64b8('0x9')](_0x64b8('0x14'),_0x2e562e);logger['debug'](_0x64b8('0x14'),_0x2e562e,JSON[_0x64b8('0xe')](_0x579875));_0x179721(_0x579875);})[_0x64b8('0x13')](function(_0x77759c){logger['error'](_0x64b8('0x14'),_0x77759c[_0x64b8('0x11')],_0x2e562e);_0x3ca102(_0x6e8aa3[_0x64b8('0xf')](0x1f4,_0x77759c['message']));});});};exports[_0x64b8('0x1f')]=function(_0x3572b5){var _0x34c222=this;return new Promise(function(_0x23f943,_0x27de2b){return db[_0x64b8('0x15')][_0x64b8('0x20')]({'raw':_0x3572b5['options']?_0x3572b5[_0x64b8('0x17')][_0x64b8('0x18')]===undefined?!![]:![]:!![],'where':_0x3572b5['options']?_0x3572b5[_0x64b8('0x17')]['where']||null:null,'attributes':_0x3572b5[_0x64b8('0x17')]?_0x3572b5[_0x64b8('0x17')][_0x64b8('0x1a')]||null:null,'include':_0x3572b5[_0x64b8('0x17')]?_0x3572b5[_0x64b8('0x17')][_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x3572b5['options']['include'],function(_0x51744a){return{'model':db[_0x51744a[_0x64b8('0x1e')]],'as':_0x51744a['as'],'attributes':_0x51744a[_0x64b8('0x1a')],'include':_0x51744a[_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x51744a[_0x64b8('0x1d')],function(_0x52bdae){return{'model':db[_0x52bdae[_0x64b8('0x1e')]],'as':_0x52bdae['as'],'attributes':_0x52bdae[_0x64b8('0x1a')],'include':_0x52bdae[_0x64b8('0x1d')]?_[_0x64b8('0x1c')](_0x52bdae[_0x64b8('0x1d')],function(_0x43fb21){return{'model':db[_0x43fb21['model']],'as':_0x43fb21['as'],'attributes':_0x43fb21[_0x64b8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x64b8('0x21')](function(_0x40494b){logger[_0x64b8('0x9')]('ShowDynamics365Account',_0x3572b5);logger[_0x64b8('0xb')](_0x64b8('0x1f'),_0x3572b5,JSON[_0x64b8('0xe')](_0x40494b));_0x23f943(_0x40494b);})[_0x64b8('0x13')](function(_0x4cdc86){logger[_0x64b8('0xf')]('ShowDynamics365Account',_0x4cdc86[_0x64b8('0x11')],_0x3572b5);_0x27de2b(_0x34c222[_0x64b8('0xf')](0x1f4,_0x4cdc86[_0x64b8('0x11')]));});});}; \ No newline at end of file +var _0xac4b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetDynamics365Account','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account','find','stringify','lodash','util','moment','bluebird'];(function(_0x6ac8f6,_0x2cedc2){var _0x26542d=function(_0x4f6c4f){while(--_0x4f6c4f){_0x6ac8f6['push'](_0x6ac8f6['shift']());}};_0x26542d(++_0x2cedc2);}(_0xac4b,0x1b6));var _0xbac4=function(_0x7c13ed,_0x4d9dd5){_0x7c13ed=_0x7c13ed-0x0;var _0x4cad66=_0xac4b[_0x7c13ed];return _0x4cad66;};'use strict';var _=require(_0xbac4('0x0'));var util=require(_0xbac4('0x1'));var moment=require(_0xbac4('0x2'));var BPromise=require(_0xbac4('0x3'));var rs=require(_0xbac4('0x4'));var fs=require('fs');var Redis=require(_0xbac4('0x5'));var db=require(_0xbac4('0x6'))['db'];var utils=require(_0xbac4('0x7'));var logger=require(_0xbac4('0x8'))(_0xbac4('0x9'));var config=require('../../config/environment');var jayson=require(_0xbac4('0xa'));var client=jayson['client'][_0xbac4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x108b96,_0x7443e6,_0x3c3d09){return new BPromise(function(_0x28e4ec,_0x2cbe6e){return client[_0xbac4('0xc')](_0x108b96,_0x3c3d09)[_0xbac4('0xd')](function(_0x655249){logger[_0xbac4('0xe')](_0xbac4('0xf'),_0x7443e6,_0xbac4('0x10'));logger[_0xbac4('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x7443e6,_0xbac4('0x10'),JSON['stringify'](_0x655249));if(_0x655249[_0xbac4('0x12')]){if(_0x655249[_0xbac4('0x12')][_0xbac4('0x13')]===0x1f4){logger[_0xbac4('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x7443e6,_0x655249[_0xbac4('0x12')]['message']);return _0x2cbe6e(_0x655249['error'][_0xbac4('0x14')]);}logger[_0xbac4('0x12')](_0xbac4('0xf'),_0x7443e6,_0x655249[_0xbac4('0x12')][_0xbac4('0x14')]);return _0x28e4ec(_0x655249[_0xbac4('0x12')][_0xbac4('0x14')]);}else{logger[_0xbac4('0xe')](_0xbac4('0xf'),_0x7443e6,_0xbac4('0x10'));_0x28e4ec(_0x655249['result'][_0xbac4('0x14')]);}})[_0xbac4('0x15')](function(_0x1d1d66){logger[_0xbac4('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x7443e6,_0x1d1d66);_0x2cbe6e(_0x1d1d66);});});}exports[_0xbac4('0x16')]=function(_0x358b15){var _0x76019=this;return new Promise(function(_0x247b00,_0xf081eb){return db['Dynamics365Account']['findAll']({'raw':_0x358b15[_0xbac4('0x17')]?_0x358b15[_0xbac4('0x17')][_0xbac4('0x18')]===undefined?!![]:![]:!![],'where':_0x358b15[_0xbac4('0x17')]?_0x358b15['options'][_0xbac4('0x19')]||null:null,'attributes':_0x358b15['options']?_0x358b15[_0xbac4('0x17')]['attributes']||null:null,'limit':_0x358b15[_0xbac4('0x17')]?_0x358b15[_0xbac4('0x17')][_0xbac4('0x1a')]||null:null,'include':_0x358b15[_0xbac4('0x17')]?_0x358b15[_0xbac4('0x17')][_0xbac4('0x1b')]?_[_0xbac4('0x1c')](_0x358b15[_0xbac4('0x17')][_0xbac4('0x1b')],function(_0xe247c7){return{'model':db[_0xe247c7[_0xbac4('0x1d')]],'as':_0xe247c7['as'],'attributes':_0xe247c7[_0xbac4('0x1e')],'include':_0xe247c7[_0xbac4('0x1b')]?_[_0xbac4('0x1c')](_0xe247c7[_0xbac4('0x1b')],function(_0x57e03f){return{'model':db[_0x57e03f[_0xbac4('0x1d')]],'as':_0x57e03f['as'],'attributes':_0x57e03f[_0xbac4('0x1e')],'include':_0x57e03f[_0xbac4('0x1b')]?_[_0xbac4('0x1c')](_0x57e03f[_0xbac4('0x1b')],function(_0x58fac5){return{'model':db[_0x58fac5[_0xbac4('0x1d')]],'as':_0x58fac5['as'],'attributes':_0x58fac5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x36c8ea){logger[_0xbac4('0xe')](_0xbac4('0x16'),_0x358b15);logger[_0xbac4('0x11')]('GetDynamics365Account',_0x358b15,JSON['stringify'](_0x36c8ea));_0x247b00(_0x36c8ea);})[_0xbac4('0x15')](function(_0x54ec27){logger[_0xbac4('0x12')](_0xbac4('0x16'),_0x54ec27[_0xbac4('0x14')],_0x358b15);_0xf081eb(_0x76019[_0xbac4('0x12')](0x1f4,_0x54ec27[_0xbac4('0x14')]));});});};exports[_0xbac4('0x1f')]=function(_0x57d750){var _0x1e448a=this;return new Promise(function(_0x5bd290,_0x4a0f4c){return db['Dynamics365Account'][_0xbac4('0x20')]({'raw':_0x57d750['options']?_0x57d750[_0xbac4('0x17')][_0xbac4('0x18')]===undefined?!![]:![]:!![],'where':_0x57d750[_0xbac4('0x17')]?_0x57d750['options'][_0xbac4('0x19')]||null:null,'attributes':_0x57d750[_0xbac4('0x17')]?_0x57d750[_0xbac4('0x17')][_0xbac4('0x1e')]||null:null,'include':_0x57d750[_0xbac4('0x17')]?_0x57d750[_0xbac4('0x17')][_0xbac4('0x1b')]?_[_0xbac4('0x1c')](_0x57d750[_0xbac4('0x17')]['include'],function(_0x66e0b3){return{'model':db[_0x66e0b3[_0xbac4('0x1d')]],'as':_0x66e0b3['as'],'attributes':_0x66e0b3[_0xbac4('0x1e')],'include':_0x66e0b3['include']?_[_0xbac4('0x1c')](_0x66e0b3[_0xbac4('0x1b')],function(_0x29fbcc){return{'model':db[_0x29fbcc[_0xbac4('0x1d')]],'as':_0x29fbcc['as'],'attributes':_0x29fbcc['attributes'],'include':_0x29fbcc[_0xbac4('0x1b')]?_[_0xbac4('0x1c')](_0x29fbcc['include'],function(_0x203aef){return{'model':db[_0x203aef['model']],'as':_0x203aef['as'],'attributes':_0x203aef[_0xbac4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbac4('0xd')](function(_0x463a88){logger[_0xbac4('0xe')]('ShowDynamics365Account',_0x57d750);logger[_0xbac4('0x11')](_0xbac4('0x1f'),_0x57d750,JSON[_0xbac4('0x21')](_0x463a88));_0x5bd290(_0x463a88);})[_0xbac4('0x15')](function(_0x11f873){logger[_0xbac4('0x12')](_0xbac4('0x1f'),_0x11f873[_0xbac4('0x14')],_0x57d750);_0x4a0f4c(_0x1e448a['error'](0x1f4,_0x11f873[_0xbac4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 406c058..583e9e3 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 _0x33d0=['exports','multer','path','Router','fs-extra','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','update','delete','destroy'];(function(_0x50b8b2,_0xd7ad89){var _0x2b7810=function(_0x51bcfd){while(--_0x51bcfd){_0x50b8b2['push'](_0x50b8b2['shift']());}};_0x2b7810(++_0xd7ad89);}(_0x33d0,0x99));var _0x033d=function(_0x39b30a,_0x12715f){_0x39b30a=_0x39b30a-0x0;var _0x9d98a=_0x33d0[_0x39b30a];return _0x9d98a;};'use strict';var multer=require(_0x033d('0x0'));var util=require('util');var path=require(_0x033d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x033d('0x2')]();var fs_extra=require(_0x033d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x033d('0x4'));var controller=require(_0x033d('0x5'));router[_0x033d('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x033d('0x6')](_0x033d('0x7'),auth[_0x033d('0x8')](),controller[_0x033d('0x9')]);router[_0x033d('0x6')](_0x033d('0xa'),auth[_0x033d('0x8')](),controller[_0x033d('0xb')]);router[_0x033d('0x6')](_0x033d('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x033d('0xd'),auth[_0x033d('0x8')](),controller[_0x033d('0xe')]);router['post']('/',auth[_0x033d('0x8')](),controller['create']);router['put']('/:id',auth[_0x033d('0x8')](),controller[_0x033d('0xf')]);router[_0x033d('0x10')](_0x033d('0x7'),auth['isAuthenticated'](),controller[_0x033d('0x11')]);module[_0x033d('0x12')]=router; \ No newline at end of file +var _0x1409=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x1409,0x79));var _0x9140=function(_0x56f607,_0x1f6225){_0x56f607=_0x56f607-0x0;var _0x4e32e8=_0x1409[_0x56f607];return _0x4e32e8;};'use strict';var multer=require('multer');var util=require(_0x9140('0x0'));var path=require(_0x9140('0x1'));var timeout=require(_0x9140('0x2'));var express=require(_0x9140('0x3'));var router=express[_0x9140('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9140('0x5'));var interaction=require(_0x9140('0x6'));var config=require(_0x9140('0x7'));var controller=require(_0x9140('0x8'));router[_0x9140('0x9')]('/',auth['isAuthenticated'](),controller[_0x9140('0xa')]);router[_0x9140('0x9')]('/:id',auth[_0x9140('0xb')](),controller[_0x9140('0xc')]);router[_0x9140('0x9')](_0x9140('0xd'),auth['isAuthenticated'](),controller[_0x9140('0xe')]);router[_0x9140('0x9')](_0x9140('0xf'),auth['isAuthenticated'](),controller[_0x9140('0x10')]);router[_0x9140('0x9')](_0x9140('0x11'),auth[_0x9140('0xb')](),controller[_0x9140('0x12')]);router[_0x9140('0x13')]('/',auth[_0x9140('0xb')](),controller[_0x9140('0x14')]);router[_0x9140('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x9140('0x16'),auth[_0x9140('0xb')](),controller['destroy']);module[_0x9140('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 87719d4..692f3cf 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 _0x3544=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x2bcc6d,_0x5347ac){var _0x337411=function(_0x4593c3){while(--_0x4593c3){_0x2bcc6d['push'](_0x2bcc6d['shift']());}};_0x337411(++_0x5347ac);}(_0x3544,0x72));var _0x4354=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x3544[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x4354('0x0'));module[_0x4354('0x1')]={'name':{'type':Sequelize[_0x4354('0x2')]},'description':{'type':Sequelize[_0x4354('0x2')]},'ticketType':{'type':Sequelize[_0x4354('0x3')](_0x4354('0x4'),'phonecall'),'defaultValue':_0x4354('0x4')},'moduleCreate':{'type':Sequelize[_0x4354('0x3')]('contact','nothing'),'defaultValue':_0x4354('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x4354('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x4354('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa1e6=['STRING','ENUM','incident','phonecall','nothing','contact','BOOLEAN','sequelize'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xa1e6,0x1af));var _0x6a1e=function(_0x4edc44,_0xee6db8){_0x4edc44=_0x4edc44-0x0;var _0x5e5cad=_0xa1e6[_0x4edc44];return _0x5e5cad;};'use strict';var Sequelize=require(_0x6a1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a1e('0x1')]},'description':{'type':Sequelize[_0x6a1e('0x1')]},'ticketType':{'type':Sequelize[_0x6a1e('0x2')](_0x6a1e('0x3'),_0x6a1e('0x4')),'defaultValue':_0x6a1e('0x3')},'moduleCreate':{'type':Sequelize[_0x6a1e('0x2')]('contact',_0x6a1e('0x5')),'defaultValue':_0x6a1e('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x6a1e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index bbb6d6b..d9cd11a 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 _0x1a4a=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','create','body','find','params','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0xbc5799,_0x604d8b){var _0x17febd=function(_0x33ad68){while(--_0x33ad68){_0xbc5799['push'](_0xbc5799['shift']());}};_0x17febd(++_0x604d8b);}(_0x1a4a,0x6d));var _0xa1a4=function(_0x576297,_0x1ba6b6){_0x576297=_0x576297-0x0;var _0x5daa55=_0x1a4a[_0x576297];return _0x5daa55;};'use strict';var emlformat=require(_0xa1a4('0x0'));var rimraf=require(_0xa1a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1a4('0x2'));var rp=require(_0xa1a4('0x3'));var moment=require(_0xa1a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1a4('0x5'));var util=require(_0xa1a4('0x6'));var path=require(_0xa1a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1a4('0x8'));var fs=require('fs');var fs_extra=require(_0xa1a4('0x9'));var _=require(_0xa1a4('0xa'));var squel=require(_0xa1a4('0xb'));var crypto=require(_0xa1a4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa1a4('0xd'));var querystring=require(_0xa1a4('0xe'));var Papa=require(_0xa1a4('0xf'));var Redis=require(_0xa1a4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1a4('0x12'));var utils=require(_0xa1a4('0x13'));var config=require(_0xa1a4('0x14'));var licenseUtil=require(_0xa1a4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x158901,_0x139144){_0x139144=_0x139144||0xcc;return function(_0x22823d){if(_0x22823d){return _0x158901[_0xa1a4('0x16')](_0x139144);}return _0x158901[_0xa1a4('0x17')](_0x139144)[_0xa1a4('0x18')]();};}function respondWithResult(_0x5663a5,_0x4e6714){_0x4e6714=_0x4e6714||0xc8;return function(_0x52bb6d){if(_0x52bb6d){return _0x5663a5['status'](_0x4e6714)['json'](_0x52bb6d);}};}function respondWithFilteredResult(_0x2fcf40,_0x21f608){return function(_0x26a2a4){if(_0x26a2a4){var _0x3ee86f=typeof _0x21f608['offset']===_0xa1a4('0x19')&&typeof _0x21f608[_0xa1a4('0x1a')]===_0xa1a4('0x19');var _0x37166c=_0x26a2a4['count'];var _0x327781=_0x3ee86f?0x0:_0x21f608[_0xa1a4('0x1b')];var _0x331ec8=_0x3ee86f?_0x26a2a4['count']:_0x21f608['offset']+_0x21f608['limit'];var _0x2e2d71;if(_0x331ec8>=_0x37166c){_0x331ec8=_0x37166c;_0x2e2d71=0xc8;}else{_0x2e2d71=0xce;}_0x2fcf40[_0xa1a4('0x17')](_0x2e2d71);return _0x2fcf40[_0xa1a4('0x1c')](_0xa1a4('0x1d'),_0x327781+'-'+_0x331ec8+'/'+_0x37166c)['json'](_0x26a2a4);}return null;};}function patchUpdates(_0x367293){return function(_0x1df806){try{jsonpatch['apply'](_0x1df806,_0x367293,!![]);}catch(_0x3688a3){return BPromise[_0xa1a4('0x1e')](_0x3688a3);}return _0x1df806[_0xa1a4('0x1f')]();};}function saveUpdates(_0x2b9099,_0x787d81){return function(_0x1f0063){if(_0x1f0063){return _0x1f0063[_0xa1a4('0x20')](_0x2b9099)[_0xa1a4('0x21')](function(_0x4d631c){return _0x4d631c;});}return null;};}function removeEntity(_0x15804e,_0x24b55f){return function(_0x2d6dec){if(_0x2d6dec){return _0x2d6dec[_0xa1a4('0x22')]()['then'](function(){_0x15804e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f46d7,_0x5430fb){return function(_0x423274){if(!_0x423274){_0x1f46d7[_0xa1a4('0x16')](0x194);}return _0x423274;};}function handleError(_0xdc7a04,_0x4e4e23){_0x4e4e23=_0x4e4e23||0x1f4;return function(_0x5c6a65){logger['error'](_0x5c6a65[_0xa1a4('0x23')]);if(_0x5c6a65[_0xa1a4('0x24')]){delete _0x5c6a65['name'];}_0xdc7a04[_0xa1a4('0x17')](_0x4e4e23)[_0xa1a4('0x25')](_0x5c6a65);};}exports[_0xa1a4('0x26')]=function(_0x4b9227,_0x528e09){var _0xfdad6e={},_0x587921={},_0xe5e184={'count':0x0,'rows':[]};var _0x170db6=_[_0xa1a4('0x27')](db[_0xa1a4('0x28')][_0xa1a4('0x29')],function(_0x2abe02){return{'name':_0x2abe02[_0xa1a4('0x2a')],'type':_0x2abe02[_0xa1a4('0x2b')][_0xa1a4('0x2c')]};});_0x587921['model']=_[_0xa1a4('0x27')](_0x170db6,_0xa1a4('0x24'));_0x587921[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x4b9227[_0xa1a4('0x2d')]);_0x587921[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x587921[_0xa1a4('0x31')],_0x587921['query']);_0xfdad6e[_0xa1a4('0x32')]=_['intersection'](_0x587921[_0xa1a4('0x31')],qs[_0xa1a4('0x33')](_0x4b9227[_0xa1a4('0x2d')]['fields']));_0xfdad6e['attributes']=_0xfdad6e[_0xa1a4('0x32')][_0xa1a4('0x34')]?_0xfdad6e[_0xa1a4('0x32')]:_0x587921[_0xa1a4('0x31')];if(!_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x35')](_0xa1a4('0x36'))){_0xfdad6e[_0xa1a4('0x1a')]=qs['limit'](_0x4b9227[_0xa1a4('0x2d')]['limit']);_0xfdad6e[_0xa1a4('0x1b')]=qs[_0xa1a4('0x1b')](_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x1b')]);}_0xfdad6e[_0xa1a4('0x37')]=qs[_0xa1a4('0x38')](_0x4b9227[_0xa1a4('0x2d')]['sort']);_0xfdad6e[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_[_0xa1a4('0x3a')](_0x4b9227[_0xa1a4('0x2d')],_0x587921[_0xa1a4('0x2f')]),_0x170db6);if(_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x3b')]){_0xfdad6e[_0xa1a4('0x39')]=_[_0xa1a4('0x3c')](_0xfdad6e[_0xa1a4('0x39')],{'$or':_['map'](_0x170db6,function(_0x5aa9eb){if(_0x5aa9eb[_0xa1a4('0x2b')]!==_0xa1a4('0x3d')){var _0x3d05b5={};_0x3d05b5[_0x5aa9eb['name']]={'$like':'%'+_0x4b9227[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x3d05b5;}})});}_0xfdad6e=_[_0xa1a4('0x3c')]({},_0xfdad6e,_0x4b9227[_0xa1a4('0x3e')]);var _0x151a47={'where':_0xfdad6e['where']};return db[_0xa1a4('0x28')][_0xa1a4('0x3f')](_0x151a47)[_0xa1a4('0x21')](function(_0x579e99){_0xe5e184[_0xa1a4('0x3f')]=_0x579e99;if(_0x4b9227['query']['includeAll']){_0xfdad6e[_0xa1a4('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xa1a4('0x41')](_0xfdad6e);})['then'](function(_0x342571){_0xe5e184[_0xa1a4('0x42')]=_0x342571;return _0xe5e184;})[_0xa1a4('0x21')](respondWithFilteredResult(_0x528e09,_0xfdad6e))[_0xa1a4('0x43')](handleError(_0x528e09,null));};exports[_0xa1a4('0x44')]=function(_0x5da524,_0x284b2d){var _0xae4d34={'raw':![],'where':{'id':_0x5da524['params']['id']}},_0x3358e0={};_0x3358e0[_0xa1a4('0x31')]=_[_0xa1a4('0x2e')](db['Dynamics365Configuration'][_0xa1a4('0x29')]);_0x3358e0[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x5da524[_0xa1a4('0x2d')]);_0x3358e0[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x3358e0['model'],_0x3358e0[_0xa1a4('0x2d')]);_0xae4d34[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x3358e0['model'],qs[_0xa1a4('0x33')](_0x5da524['query'][_0xa1a4('0x33')]));_0xae4d34[_0xa1a4('0x32')]=_0xae4d34[_0xa1a4('0x32')][_0xa1a4('0x34')]?_0xae4d34['attributes']:_0x3358e0[_0xa1a4('0x31')];if(_0x5da524['query'][_0xa1a4('0x45')]){_0xae4d34[_0xa1a4('0x40')]=[{'all':!![]}];}_0xae4d34=_[_0xa1a4('0x3c')]({},_0xae4d34,_0x5da524[_0xa1a4('0x3e')]);return db[_0xa1a4('0x28')]['find'](_0xae4d34)[_0xa1a4('0x21')](handleEntityNotFound(_0x284b2d,null))[_0xa1a4('0x21')](respondWithResult(_0x284b2d,null))[_0xa1a4('0x43')](handleError(_0x284b2d,null));};exports['create']=function(_0x275645,_0x2b6e47){return db[_0xa1a4('0x28')][_0xa1a4('0x46')](_0x275645['body'],{})[_0xa1a4('0x21')](respondWithResult(_0x2b6e47,0xc9))[_0xa1a4('0x43')](handleError(_0x2b6e47,null));};exports[_0xa1a4('0x20')]=function(_0x567829,_0x49a1ce){if(_0x567829[_0xa1a4('0x47')]['id']){delete _0x567829[_0xa1a4('0x47')]['id'];}return db['Dynamics365Configuration'][_0xa1a4('0x48')]({'where':{'id':_0x567829['params']['id']}})['then'](handleEntityNotFound(_0x49a1ce,null))[_0xa1a4('0x21')](saveUpdates(_0x567829[_0xa1a4('0x47')],null))[_0xa1a4('0x21')](respondWithResult(_0x49a1ce,null))[_0xa1a4('0x43')](handleError(_0x49a1ce,null));};exports[_0xa1a4('0x22')]=function(_0x3abcf5,_0x34c18b){return db[_0xa1a4('0x28')][_0xa1a4('0x48')]({'where':{'id':_0x3abcf5[_0xa1a4('0x49')]['id']}})[_0xa1a4('0x21')](handleEntityNotFound(_0x34c18b,null))[_0xa1a4('0x21')](removeEntity(_0x34c18b,null))[_0xa1a4('0x43')](handleError(_0x34c18b,null));};exports['getFields']=function(_0x3a92be,_0x335ae1,_0x7572f2){var _0x920c67={};var _0x3373af={};var _0x729b4d;var _0xb4bd2;return db[_0xa1a4('0x28')][_0xa1a4('0x4a')]({'where':{'id':_0x3a92be[_0xa1a4('0x49')]['id']}})['then'](handleEntityNotFound(_0x335ae1,null))['then'](function(_0x399d5f){if(_0x399d5f){_0x729b4d=_0x399d5f;_0x3373af[_0xa1a4('0x31')]=_['keys'](db[_0xa1a4('0x4b')][_0xa1a4('0x29')]);_0x3373af[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x3a92be[_0xa1a4('0x2d')]);_0x3373af['filters']=_[_0xa1a4('0x30')](_0x3373af['model'],_0x3373af[_0xa1a4('0x2d')]);_0x920c67[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x3373af['model'],qs[_0xa1a4('0x33')](_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x33')]));_0x920c67['attributes']=_0x920c67[_0xa1a4('0x32')]['length']?_0x920c67['attributes']:_0x3373af[_0xa1a4('0x31')];_0x920c67['order']=qs[_0xa1a4('0x38')](_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x38')]);_0x920c67[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_['pick'](_0x3a92be['query'],_0x3373af['filters']));if(_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x3b')]){_0x920c67['where']=_[_0xa1a4('0x3c')](_0x920c67[_0xa1a4('0x39')],{'$or':_[_0xa1a4('0x27')](_0x920c67[_0xa1a4('0x32')],function(_0xd438a1){var _0x53b790={};_0x53b790[_0xd438a1]={'$like':'%'+_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x53b790;})});}_0x920c67=_[_0xa1a4('0x3c')]({},_0x920c67,_0x3a92be['options']);return _0x729b4d[_0xa1a4('0x4c')](_0x920c67);}})['then'](function(_0x3e6f04){if(_0x3e6f04){_0xb4bd2=_0x3e6f04['length'];if(!_0x3a92be[_0xa1a4('0x2d')]['hasOwnProperty']('nolimit')){_0x920c67[_0xa1a4('0x1a')]=qs[_0xa1a4('0x1a')](_0x3a92be[_0xa1a4('0x2d')][_0xa1a4('0x1a')]);_0x920c67[_0xa1a4('0x1b')]=qs['offset'](_0x3a92be['query'][_0xa1a4('0x1b')]);}return _0x729b4d[_0xa1a4('0x4c')](_0x920c67);}})[_0xa1a4('0x21')](function(_0x2b008b){if(_0x2b008b){return _0x2b008b?{'count':_0xb4bd2,'rows':_0x2b008b}:null;}})[_0xa1a4('0x21')](respondWithResult(_0x335ae1,null))[_0xa1a4('0x43')](handleError(_0x335ae1,null));};exports['getSubjects']=function(_0x4dcf44,_0x3624c7,_0x35b355){var _0xb1b2e8={};var _0x373a1f={};var _0x532eca;var _0x169511;return db['Dynamics365Configuration'][_0xa1a4('0x4a')]({'where':{'id':_0x4dcf44[_0xa1a4('0x49')]['id']}})[_0xa1a4('0x21')](handleEntityNotFound(_0x3624c7,null))['then'](function(_0x5595cc){if(_0x5595cc){_0x532eca=_0x5595cc;_0x373a1f[_0xa1a4('0x31')]=_['keys'](db[_0xa1a4('0x4b')][_0xa1a4('0x29')]);_0x373a1f[_0xa1a4('0x2d')]=_[_0xa1a4('0x2e')](_0x4dcf44[_0xa1a4('0x2d')]);_0x373a1f[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x373a1f[_0xa1a4('0x31')],_0x373a1f[_0xa1a4('0x2d')]);_0xb1b2e8[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x373a1f[_0xa1a4('0x31')],qs[_0xa1a4('0x33')](_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x33')]));_0xb1b2e8['attributes']=_0xb1b2e8[_0xa1a4('0x32')][_0xa1a4('0x34')]?_0xb1b2e8[_0xa1a4('0x32')]:_0x373a1f[_0xa1a4('0x31')];_0xb1b2e8[_0xa1a4('0x37')]=qs[_0xa1a4('0x38')](_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x38')]);_0xb1b2e8[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_[_0xa1a4('0x3a')](_0x4dcf44['query'],_0x373a1f['filters']));if(_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x3b')]){_0xb1b2e8['where']=_[_0xa1a4('0x3c')](_0xb1b2e8[_0xa1a4('0x39')],{'$or':_['map'](_0xb1b2e8['attributes'],function(_0x25d2ea){var _0x126e79={};_0x126e79[_0x25d2ea]={'$like':'%'+_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x126e79;})});}_0xb1b2e8=_[_0xa1a4('0x3c')]({},_0xb1b2e8,_0x4dcf44[_0xa1a4('0x3e')]);return _0x532eca[_0xa1a4('0x4d')](_0xb1b2e8);}})[_0xa1a4('0x21')](function(_0x122b6e){if(_0x122b6e){_0x169511=_0x122b6e[_0xa1a4('0x34')];if(!_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x35')](_0xa1a4('0x36'))){_0xb1b2e8['limit']=qs[_0xa1a4('0x1a')](_0x4dcf44[_0xa1a4('0x2d')][_0xa1a4('0x1a')]);_0xb1b2e8['offset']=qs[_0xa1a4('0x1b')](_0x4dcf44[_0xa1a4('0x2d')]['offset']);}return _0x532eca[_0xa1a4('0x4d')](_0xb1b2e8);}})[_0xa1a4('0x21')](function(_0x2a16ee){if(_0x2a16ee){return _0x2a16ee?{'count':_0x169511,'rows':_0x2a16ee}:null;}})['then'](respondWithResult(_0x3624c7,null))[_0xa1a4('0x43')](handleError(_0x3624c7,null));};exports[_0xa1a4('0x4e')]=function(_0x912f4b,_0x2e5e08,_0x488707){var _0x4c49ec={};var _0x1d130c={};var _0x5ba712;var _0x41fa12;return db[_0xa1a4('0x28')][_0xa1a4('0x4a')]({'where':{'id':_0x912f4b[_0xa1a4('0x49')]['id']}})[_0xa1a4('0x21')](handleEntityNotFound(_0x2e5e08,null))[_0xa1a4('0x21')](function(_0x327e38){if(_0x327e38){_0x5ba712=_0x327e38;_0x1d130c[_0xa1a4('0x31')]=_[_0xa1a4('0x2e')](db[_0xa1a4('0x4b')]['rawAttributes']);_0x1d130c['query']=_[_0xa1a4('0x2e')](_0x912f4b['query']);_0x1d130c[_0xa1a4('0x2f')]=_[_0xa1a4('0x30')](_0x1d130c[_0xa1a4('0x31')],_0x1d130c[_0xa1a4('0x2d')]);_0x4c49ec[_0xa1a4('0x32')]=_[_0xa1a4('0x30')](_0x1d130c[_0xa1a4('0x31')],qs[_0xa1a4('0x33')](_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x33')]));_0x4c49ec[_0xa1a4('0x32')]=_0x4c49ec['attributes']['length']?_0x4c49ec[_0xa1a4('0x32')]:_0x1d130c['model'];_0x4c49ec[_0xa1a4('0x37')]=qs[_0xa1a4('0x38')](_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x38')]);_0x4c49ec[_0xa1a4('0x39')]=qs[_0xa1a4('0x2f')](_['pick'](_0x912f4b[_0xa1a4('0x2d')],_0x1d130c[_0xa1a4('0x2f')]));if(_0x912f4b['query'][_0xa1a4('0x3b')]){_0x4c49ec[_0xa1a4('0x39')]=_[_0xa1a4('0x3c')](_0x4c49ec['where'],{'$or':_[_0xa1a4('0x27')](_0x4c49ec[_0xa1a4('0x32')],function(_0x89c2f9){var _0x194bf4={};_0x194bf4[_0x89c2f9]={'$like':'%'+_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x3b')]+'%'};return _0x194bf4;})});}_0x4c49ec=_[_0xa1a4('0x3c')]({},_0x4c49ec,_0x912f4b[_0xa1a4('0x3e')]);return _0x5ba712[_0xa1a4('0x4e')](_0x4c49ec);}})['then'](function(_0x26193a){if(_0x26193a){_0x41fa12=_0x26193a['length'];if(!_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x35')](_0xa1a4('0x36'))){_0x4c49ec[_0xa1a4('0x1a')]=qs['limit'](_0x912f4b['query'][_0xa1a4('0x1a')]);_0x4c49ec['offset']=qs['offset'](_0x912f4b[_0xa1a4('0x2d')][_0xa1a4('0x1b')]);}return _0x5ba712[_0xa1a4('0x4e')](_0x4c49ec);}})[_0xa1a4('0x21')](function(_0x39ca77){if(_0x39ca77){return _0x39ca77?{'count':_0x41fa12,'rows':_0x39ca77}:null;}})[_0xa1a4('0x21')](respondWithResult(_0x2e5e08,null))[_0xa1a4('0x43')](handleError(_0x2e5e08,null));}; \ No newline at end of file +var _0x7bd0=['params','rawAttributes','create','body','find','getFields','Dynamics365Field','order','map','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','Dynamics365Configuration','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x7bd0,0x197));var _0x07bd=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0x7bd0[_0x453e2b];return _0x50f306;};'use strict';var emlformat=require(_0x07bd('0x0'));var rimraf=require(_0x07bd('0x1'));var zipdir=require(_0x07bd('0x2'));var jsonpatch=require(_0x07bd('0x3'));var rp=require('request-promise');var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var Mustache=require(_0x07bd('0x6'));var util=require('util');var path=require(_0x07bd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x07bd('0x8'));var fs=require('fs');var fs_extra=require(_0x07bd('0x9'));var _=require('lodash');var squel=require(_0x07bd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x07bd('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x07bd('0xc'));var authService=require(_0x07bd('0xd'));var qs=require(_0x07bd('0xe'));var as=require(_0x07bd('0xf'));var hardwareService=require(_0x07bd('0x10'));var logger=require(_0x07bd('0x11'))(_0x07bd('0x12'));var utils=require(_0x07bd('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x07bd('0x14'))['db'];function respondWithStatusCode(_0x40d08a,_0x5984b6){_0x5984b6=_0x5984b6||0xcc;return function(_0x19defe){if(_0x19defe){return _0x40d08a[_0x07bd('0x15')](_0x5984b6);}return _0x40d08a[_0x07bd('0x16')](_0x5984b6)[_0x07bd('0x17')]();};}function respondWithResult(_0x32de4d,_0x392a51){_0x392a51=_0x392a51||0xc8;return function(_0x425af3){if(_0x425af3){return _0x32de4d['status'](_0x392a51)[_0x07bd('0x18')](_0x425af3);}};}function respondWithFilteredResult(_0x7dc9c,_0x2fdcc2){return function(_0x1409b2){if(_0x1409b2){var _0x2717bc=typeof _0x2fdcc2['offset']===_0x07bd('0x19')&&typeof _0x2fdcc2[_0x07bd('0x1a')]==='undefined';var _0x4bb4bd=_0x1409b2[_0x07bd('0x1b')];var _0x11ebcc=_0x2717bc?0x0:_0x2fdcc2[_0x07bd('0x1c')];var _0x3a994e=_0x2717bc?_0x1409b2[_0x07bd('0x1b')]:_0x2fdcc2[_0x07bd('0x1c')]+_0x2fdcc2[_0x07bd('0x1a')];var _0x30a97d;if(_0x3a994e>=_0x4bb4bd){_0x3a994e=_0x4bb4bd;_0x30a97d=0xc8;}else{_0x30a97d=0xce;}_0x7dc9c[_0x07bd('0x16')](_0x30a97d);return _0x7dc9c[_0x07bd('0x1d')](_0x07bd('0x1e'),_0x11ebcc+'-'+_0x3a994e+'/'+_0x4bb4bd)['json'](_0x1409b2);}return null;};}function patchUpdates(_0x3ad1dc){return function(_0x5d44e8){try{jsonpatch[_0x07bd('0x1f')](_0x5d44e8,_0x3ad1dc,!![]);}catch(_0x50e0b7){return BPromise[_0x07bd('0x20')](_0x50e0b7);}return _0x5d44e8[_0x07bd('0x21')]();};}function saveUpdates(_0x5ae242,_0x3ec6d9){return function(_0x4e2327){if(_0x4e2327){return _0x4e2327[_0x07bd('0x22')](_0x5ae242)[_0x07bd('0x23')](function(_0x15aa3b){return _0x15aa3b;});}return null;};}function removeEntity(_0xda31ba,_0x4567e5){return function(_0x4ed6c9){if(_0x4ed6c9){return _0x4ed6c9[_0x07bd('0x24')]()[_0x07bd('0x23')](function(){_0xda31ba[_0x07bd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1948ac,_0x306458){return function(_0x2cfef4){if(!_0x2cfef4){_0x1948ac[_0x07bd('0x15')](0x194);}return _0x2cfef4;};}function handleError(_0x207566,_0x559a73){_0x559a73=_0x559a73||0x1f4;return function(_0x169e24){logger[_0x07bd('0x25')](_0x169e24[_0x07bd('0x26')]);if(_0x169e24['name']){delete _0x169e24['name'];}_0x207566[_0x07bd('0x16')](_0x559a73)[_0x07bd('0x27')](_0x169e24);};}exports[_0x07bd('0x28')]=function(_0x2a6aa4,_0x5ab76a){var _0x1c5024={},_0x4aa8cd={},_0x59ae0b={'count':0x0,'rows':[]};var _0x5f3a42=_['map'](db[_0x07bd('0x29')]['rawAttributes'],function(_0x49c69d){return{'name':_0x49c69d[_0x07bd('0x2a')],'type':_0x49c69d[_0x07bd('0x2b')][_0x07bd('0x2c')]};});_0x4aa8cd[_0x07bd('0x2d')]=_['map'](_0x5f3a42,'name');_0x4aa8cd['query']=_[_0x07bd('0x2e')](_0x2a6aa4['query']);_0x4aa8cd['filters']=_['intersection'](_0x4aa8cd[_0x07bd('0x2d')],_0x4aa8cd[_0x07bd('0x2f')]);_0x1c5024['attributes']=_[_0x07bd('0x30')](_0x4aa8cd['model'],qs[_0x07bd('0x31')](_0x2a6aa4[_0x07bd('0x2f')][_0x07bd('0x31')]));_0x1c5024[_0x07bd('0x32')]=_0x1c5024['attributes'][_0x07bd('0x33')]?_0x1c5024['attributes']:_0x4aa8cd[_0x07bd('0x2d')];if(!_0x2a6aa4['query'][_0x07bd('0x34')](_0x07bd('0x35'))){_0x1c5024[_0x07bd('0x1a')]=qs[_0x07bd('0x1a')](_0x2a6aa4[_0x07bd('0x2f')]['limit']);_0x1c5024[_0x07bd('0x1c')]=qs[_0x07bd('0x1c')](_0x2a6aa4[_0x07bd('0x2f')][_0x07bd('0x1c')]);}_0x1c5024['order']=qs[_0x07bd('0x36')](_0x2a6aa4[_0x07bd('0x2f')][_0x07bd('0x36')]);_0x1c5024[_0x07bd('0x37')]=qs['filters'](_[_0x07bd('0x38')](_0x2a6aa4[_0x07bd('0x2f')],_0x4aa8cd[_0x07bd('0x39')]),_0x5f3a42);if(_0x2a6aa4[_0x07bd('0x2f')][_0x07bd('0x3a')]){_0x1c5024['where']=_[_0x07bd('0x3b')](_0x1c5024['where'],{'$or':_['map'](_0x5f3a42,function(_0x54a3b5){if(_0x54a3b5[_0x07bd('0x2b')]!=='VIRTUAL'){var _0x5cc49f={};_0x5cc49f[_0x54a3b5['name']]={'$like':'%'+_0x2a6aa4[_0x07bd('0x2f')]['filter']+'%'};return _0x5cc49f;}})});}_0x1c5024=_['merge']({},_0x1c5024,_0x2a6aa4[_0x07bd('0x3c')]);var _0x557866={'where':_0x1c5024[_0x07bd('0x37')]};return db[_0x07bd('0x29')][_0x07bd('0x1b')](_0x557866)[_0x07bd('0x23')](function(_0x240d66){_0x59ae0b[_0x07bd('0x1b')]=_0x240d66;if(_0x2a6aa4['query'][_0x07bd('0x3d')]){_0x1c5024[_0x07bd('0x3e')]=[{'all':!![]}];}return db[_0x07bd('0x29')][_0x07bd('0x3f')](_0x1c5024);})[_0x07bd('0x23')](function(_0x5d5d1e){_0x59ae0b[_0x07bd('0x40')]=_0x5d5d1e;return _0x59ae0b;})[_0x07bd('0x23')](respondWithFilteredResult(_0x5ab76a,_0x1c5024))[_0x07bd('0x41')](handleError(_0x5ab76a,null));};exports[_0x07bd('0x42')]=function(_0x109290,_0x199a6d){var _0x4cc334={'raw':![],'where':{'id':_0x109290[_0x07bd('0x43')]['id']}},_0x570928={};_0x570928['model']=_[_0x07bd('0x2e')](db[_0x07bd('0x29')][_0x07bd('0x44')]);_0x570928['query']=_[_0x07bd('0x2e')](_0x109290['query']);_0x570928[_0x07bd('0x39')]=_[_0x07bd('0x30')](_0x570928['model'],_0x570928[_0x07bd('0x2f')]);_0x4cc334['attributes']=_['intersection'](_0x570928['model'],qs[_0x07bd('0x31')](_0x109290[_0x07bd('0x2f')]['fields']));_0x4cc334[_0x07bd('0x32')]=_0x4cc334['attributes'][_0x07bd('0x33')]?_0x4cc334[_0x07bd('0x32')]:_0x570928[_0x07bd('0x2d')];if(_0x109290['query']['includeAll']){_0x4cc334[_0x07bd('0x3e')]=[{'all':!![]}];}_0x4cc334=_['merge']({},_0x4cc334,_0x109290[_0x07bd('0x3c')]);return db[_0x07bd('0x29')]['find'](_0x4cc334)[_0x07bd('0x23')](handleEntityNotFound(_0x199a6d,null))[_0x07bd('0x23')](respondWithResult(_0x199a6d,null))[_0x07bd('0x41')](handleError(_0x199a6d,null));};exports[_0x07bd('0x45')]=function(_0xbd0f35,_0x314658){return db['Dynamics365Configuration'][_0x07bd('0x45')](_0xbd0f35['body'],{})['then'](respondWithResult(_0x314658,0xc9))[_0x07bd('0x41')](handleError(_0x314658,null));};exports[_0x07bd('0x22')]=function(_0x457116,_0x398628){if(_0x457116['body']['id']){delete _0x457116[_0x07bd('0x46')]['id'];}return db[_0x07bd('0x29')][_0x07bd('0x47')]({'where':{'id':_0x457116[_0x07bd('0x43')]['id']}})['then'](handleEntityNotFound(_0x398628,null))[_0x07bd('0x23')](saveUpdates(_0x457116[_0x07bd('0x46')],null))[_0x07bd('0x23')](respondWithResult(_0x398628,null))['catch'](handleError(_0x398628,null));};exports[_0x07bd('0x24')]=function(_0x5426e5,_0x55ca3c){return db[_0x07bd('0x29')]['find']({'where':{'id':_0x5426e5[_0x07bd('0x43')]['id']}})[_0x07bd('0x23')](handleEntityNotFound(_0x55ca3c,null))[_0x07bd('0x23')](removeEntity(_0x55ca3c,null))[_0x07bd('0x41')](handleError(_0x55ca3c,null));};exports[_0x07bd('0x48')]=function(_0x3b0197,_0x4c84f5,_0x28b09f){var _0x2fd13d={};var _0x56b7e8={};var _0x3f22f3;var _0x1b19ab;return db[_0x07bd('0x29')]['findOne']({'where':{'id':_0x3b0197[_0x07bd('0x43')]['id']}})[_0x07bd('0x23')](handleEntityNotFound(_0x4c84f5,null))[_0x07bd('0x23')](function(_0x3b79f2){if(_0x3b79f2){_0x3f22f3=_0x3b79f2;_0x56b7e8['model']=_['keys'](db[_0x07bd('0x49')]['rawAttributes']);_0x56b7e8[_0x07bd('0x2f')]=_[_0x07bd('0x2e')](_0x3b0197[_0x07bd('0x2f')]);_0x56b7e8['filters']=_[_0x07bd('0x30')](_0x56b7e8[_0x07bd('0x2d')],_0x56b7e8[_0x07bd('0x2f')]);_0x2fd13d[_0x07bd('0x32')]=_['intersection'](_0x56b7e8[_0x07bd('0x2d')],qs[_0x07bd('0x31')](_0x3b0197[_0x07bd('0x2f')][_0x07bd('0x31')]));_0x2fd13d['attributes']=_0x2fd13d[_0x07bd('0x32')][_0x07bd('0x33')]?_0x2fd13d[_0x07bd('0x32')]:_0x56b7e8['model'];_0x2fd13d[_0x07bd('0x4a')]=qs['sort'](_0x3b0197[_0x07bd('0x2f')][_0x07bd('0x36')]);_0x2fd13d['where']=qs[_0x07bd('0x39')](_[_0x07bd('0x38')](_0x3b0197[_0x07bd('0x2f')],_0x56b7e8[_0x07bd('0x39')]));if(_0x3b0197[_0x07bd('0x2f')][_0x07bd('0x3a')]){_0x2fd13d['where']=_['merge'](_0x2fd13d['where'],{'$or':_[_0x07bd('0x4b')](_0x2fd13d[_0x07bd('0x32')],function(_0x390cf1){var _0x12df4e={};_0x12df4e[_0x390cf1]={'$like':'%'+_0x3b0197[_0x07bd('0x2f')][_0x07bd('0x3a')]+'%'};return _0x12df4e;})});}_0x2fd13d=_[_0x07bd('0x3b')]({},_0x2fd13d,_0x3b0197[_0x07bd('0x3c')]);return _0x3f22f3[_0x07bd('0x48')](_0x2fd13d);}})[_0x07bd('0x23')](function(_0x2294ab){if(_0x2294ab){_0x1b19ab=_0x2294ab[_0x07bd('0x33')];if(!_0x3b0197[_0x07bd('0x2f')][_0x07bd('0x34')](_0x07bd('0x35'))){_0x2fd13d[_0x07bd('0x1a')]=qs['limit'](_0x3b0197[_0x07bd('0x2f')][_0x07bd('0x1a')]);_0x2fd13d[_0x07bd('0x1c')]=qs[_0x07bd('0x1c')](_0x3b0197[_0x07bd('0x2f')]['offset']);}return _0x3f22f3[_0x07bd('0x48')](_0x2fd13d);}})[_0x07bd('0x23')](function(_0x43bd68){if(_0x43bd68){return _0x43bd68?{'count':_0x1b19ab,'rows':_0x43bd68}:null;}})[_0x07bd('0x23')](respondWithResult(_0x4c84f5,null))[_0x07bd('0x41')](handleError(_0x4c84f5,null));};exports[_0x07bd('0x4c')]=function(_0x86ced7,_0x3dd76c,_0x15c8f6){var _0x3bd1c8={};var _0x1ebcef={};var _0x479d25;var _0x5ab83e;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x86ced7[_0x07bd('0x43')]['id']}})[_0x07bd('0x23')](handleEntityNotFound(_0x3dd76c,null))['then'](function(_0x2a2117){if(_0x2a2117){_0x479d25=_0x2a2117;_0x1ebcef[_0x07bd('0x2d')]=_[_0x07bd('0x2e')](db[_0x07bd('0x49')][_0x07bd('0x44')]);_0x1ebcef[_0x07bd('0x2f')]=_[_0x07bd('0x2e')](_0x86ced7[_0x07bd('0x2f')]);_0x1ebcef[_0x07bd('0x39')]=_['intersection'](_0x1ebcef[_0x07bd('0x2d')],_0x1ebcef['query']);_0x3bd1c8[_0x07bd('0x32')]=_[_0x07bd('0x30')](_0x1ebcef[_0x07bd('0x2d')],qs['fields'](_0x86ced7[_0x07bd('0x2f')][_0x07bd('0x31')]));_0x3bd1c8['attributes']=_0x3bd1c8[_0x07bd('0x32')][_0x07bd('0x33')]?_0x3bd1c8[_0x07bd('0x32')]:_0x1ebcef[_0x07bd('0x2d')];_0x3bd1c8[_0x07bd('0x4a')]=qs['sort'](_0x86ced7['query'][_0x07bd('0x36')]);_0x3bd1c8[_0x07bd('0x37')]=qs[_0x07bd('0x39')](_[_0x07bd('0x38')](_0x86ced7[_0x07bd('0x2f')],_0x1ebcef[_0x07bd('0x39')]));if(_0x86ced7[_0x07bd('0x2f')][_0x07bd('0x3a')]){_0x3bd1c8[_0x07bd('0x37')]=_[_0x07bd('0x3b')](_0x3bd1c8[_0x07bd('0x37')],{'$or':_[_0x07bd('0x4b')](_0x3bd1c8[_0x07bd('0x32')],function(_0x48a6f4){var _0x54f1c4={};_0x54f1c4[_0x48a6f4]={'$like':'%'+_0x86ced7[_0x07bd('0x2f')][_0x07bd('0x3a')]+'%'};return _0x54f1c4;})});}_0x3bd1c8=_['merge']({},_0x3bd1c8,_0x86ced7[_0x07bd('0x3c')]);return _0x479d25[_0x07bd('0x4c')](_0x3bd1c8);}})['then'](function(_0x57a5e4){if(_0x57a5e4){_0x5ab83e=_0x57a5e4[_0x07bd('0x33')];if(!_0x86ced7[_0x07bd('0x2f')]['hasOwnProperty'](_0x07bd('0x35'))){_0x3bd1c8['limit']=qs['limit'](_0x86ced7[_0x07bd('0x2f')][_0x07bd('0x1a')]);_0x3bd1c8[_0x07bd('0x1c')]=qs[_0x07bd('0x1c')](_0x86ced7[_0x07bd('0x2f')][_0x07bd('0x1c')]);}return _0x479d25['getSubjects'](_0x3bd1c8);}})[_0x07bd('0x23')](function(_0x580c52){if(_0x580c52){return _0x580c52?{'count':_0x5ab83e,'rows':_0x580c52}:null;}})[_0x07bd('0x23')](respondWithResult(_0x3dd76c,null))[_0x07bd('0x41')](handleError(_0x3dd76c,null));};exports[_0x07bd('0x4d')]=function(_0x3bd877,_0x2455da,_0x3cdb46){var _0x28effc={};var _0x5a1c31={};var _0x3acb5c;var _0xf49326;return db[_0x07bd('0x29')][_0x07bd('0x4e')]({'where':{'id':_0x3bd877['params']['id']}})[_0x07bd('0x23')](handleEntityNotFound(_0x2455da,null))['then'](function(_0x27d285){if(_0x27d285){_0x3acb5c=_0x27d285;_0x5a1c31[_0x07bd('0x2d')]=_[_0x07bd('0x2e')](db[_0x07bd('0x49')][_0x07bd('0x44')]);_0x5a1c31['query']=_[_0x07bd('0x2e')](_0x3bd877[_0x07bd('0x2f')]);_0x5a1c31[_0x07bd('0x39')]=_['intersection'](_0x5a1c31[_0x07bd('0x2d')],_0x5a1c31[_0x07bd('0x2f')]);_0x28effc['attributes']=_[_0x07bd('0x30')](_0x5a1c31[_0x07bd('0x2d')],qs[_0x07bd('0x31')](_0x3bd877[_0x07bd('0x2f')][_0x07bd('0x31')]));_0x28effc['attributes']=_0x28effc['attributes'][_0x07bd('0x33')]?_0x28effc['attributes']:_0x5a1c31['model'];_0x28effc[_0x07bd('0x4a')]=qs[_0x07bd('0x36')](_0x3bd877['query'][_0x07bd('0x36')]);_0x28effc[_0x07bd('0x37')]=qs[_0x07bd('0x39')](_['pick'](_0x3bd877['query'],_0x5a1c31[_0x07bd('0x39')]));if(_0x3bd877[_0x07bd('0x2f')]['filter']){_0x28effc[_0x07bd('0x37')]=_['merge'](_0x28effc[_0x07bd('0x37')],{'$or':_[_0x07bd('0x4b')](_0x28effc[_0x07bd('0x32')],function(_0x5ba2ff){var _0x56d83e={};_0x56d83e[_0x5ba2ff]={'$like':'%'+_0x3bd877['query'][_0x07bd('0x3a')]+'%'};return _0x56d83e;})});}_0x28effc=_['merge']({},_0x28effc,_0x3bd877['options']);return _0x3acb5c[_0x07bd('0x4d')](_0x28effc);}})[_0x07bd('0x23')](function(_0x2e5c2b){if(_0x2e5c2b){_0xf49326=_0x2e5c2b[_0x07bd('0x33')];if(!_0x3bd877[_0x07bd('0x2f')]['hasOwnProperty']('nolimit')){_0x28effc[_0x07bd('0x1a')]=qs[_0x07bd('0x1a')](_0x3bd877['query'][_0x07bd('0x1a')]);_0x28effc[_0x07bd('0x1c')]=qs[_0x07bd('0x1c')](_0x3bd877[_0x07bd('0x2f')]['offset']);}return _0x3acb5c[_0x07bd('0x4d')](_0x28effc);}})[_0x07bd('0x23')](function(_0x4fc601){if(_0x4fc601){return _0x4fc601?{'count':_0xf49326,'rows':_0x4fc601}:null;}})['then'](respondWithResult(_0x2455da,null))['catch'](handleError(_0x2455da,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3a2e47f..d467654 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 _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x153846,_0x1227ad){var _0x3ee557=function(_0x514e76){while(--_0x514e76){_0x153846['push'](_0x153846['shift']());}};_0x3ee557(++_0x1227ad);}(_0x3e74,0x175));var _0x43e7=function(_0x2b16d2,_0x690c33){_0x2b16d2=_0x2b16d2-0x0;var _0x5bef14=_0x3e74[_0x2b16d2];return _0x5bef14;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x55ca,0x126));var _0xa55c=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0x55ca[_0x414655];return _0x237884;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'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 df53198..35f1666 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 _0x1bc9=['request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x559e8a,_0x332fc2){var _0x387115=function(_0x4aa950){while(--_0x4aa950){_0x559e8a['push'](_0x559e8a['shift']());}};_0x387115(++_0x332fc2);}(_0x1bc9,0xc8));var _0x91bc=function(_0x30f93e,_0x384d05){_0x30f93e=_0x30f93e-0x0;var _0x5ee3d0=_0x1bc9[_0x30f93e];return _0x5ee3d0;};'use strict';var _=require(_0x91bc('0x0'));var util=require(_0x91bc('0x1'));var moment=require('moment');var BPromise=require(_0x91bc('0x2'));var rs=require(_0x91bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91bc('0x4'))['db'];var utils=require(_0x91bc('0x5'));var logger=require(_0x91bc('0x6'))(_0x91bc('0x7'));var config=require('../../config/environment');var jayson=require(_0x91bc('0x8'));var client=jayson[_0x91bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf64712,_0x4203d8,_0x1be1f0){return new BPromise(function(_0x398a9b,_0x3791f7){return client[_0x91bc('0xa')](_0xf64712,_0x1be1f0)[_0x91bc('0xb')](function(_0x429943){logger[_0x91bc('0xc')](_0x91bc('0xd'),_0x4203d8,'request\x20sent');logger[_0x91bc('0xe')](_0x91bc('0xf'),_0x4203d8,_0x91bc('0x10'),JSON['stringify'](_0x429943));if(_0x429943[_0x91bc('0x11')]){if(_0x429943[_0x91bc('0x11')]['code']===0x1f4){logger[_0x91bc('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4203d8,_0x429943[_0x91bc('0x11')][_0x91bc('0x12')]);return _0x3791f7(_0x429943[_0x91bc('0x11')][_0x91bc('0x12')]);}logger[_0x91bc('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4203d8,_0x429943[_0x91bc('0x11')][_0x91bc('0x12')]);return _0x398a9b(_0x429943[_0x91bc('0x11')]['message']);}else{logger[_0x91bc('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4203d8,_0x91bc('0x10'));_0x398a9b(_0x429943[_0x91bc('0x13')][_0x91bc('0x12')]);}})[_0x91bc('0x14')](function(_0x528ccc){logger[_0x91bc('0x11')](_0x91bc('0xd'),_0x4203d8,_0x528ccc);_0x3791f7(_0x528ccc);});});} \ No newline at end of file +var _0x6432=['Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x6432,0x7d));var _0x2643=function(_0x424a89,_0x1a1e0a){_0x424a89=_0x424a89-0x0;var _0x5c2891=_0x6432[_0x424a89];return _0x5c2891;};'use strict';var _=require(_0x2643('0x0'));var util=require('util');var moment=require(_0x2643('0x1'));var BPromise=require(_0x2643('0x2'));var rs=require(_0x2643('0x3'));var fs=require('fs');var Redis=require(_0x2643('0x4'));var db=require(_0x2643('0x5'))['db'];var utils=require(_0x2643('0x6'));var logger=require(_0x2643('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2643('0x8'));var client=jayson[_0x2643('0x9')][_0x2643('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea817,_0x491cd2,_0x37e52e){return new BPromise(function(_0x4d3a98,_0x2bd8ef){return client['request'](_0x4ea817,_0x37e52e)[_0x2643('0xb')](function(_0x25f9e6){logger[_0x2643('0xc')](_0x2643('0xd'),_0x491cd2,'request\x20sent');logger[_0x2643('0xe')](_0x2643('0xf'),_0x491cd2,_0x2643('0x10'),JSON[_0x2643('0x11')](_0x25f9e6));if(_0x25f9e6[_0x2643('0x12')]){if(_0x25f9e6[_0x2643('0x12')][_0x2643('0x13')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x491cd2,_0x25f9e6['error'][_0x2643('0x14')]);return _0x2bd8ef(_0x25f9e6[_0x2643('0x12')]['message']);}logger[_0x2643('0x12')](_0x2643('0xd'),_0x491cd2,_0x25f9e6[_0x2643('0x12')][_0x2643('0x14')]);return _0x4d3a98(_0x25f9e6[_0x2643('0x12')][_0x2643('0x14')]);}else{logger[_0x2643('0xc')](_0x2643('0xd'),_0x491cd2,_0x2643('0x10'));_0x4d3a98(_0x25f9e6[_0x2643('0x15')][_0x2643('0x14')]);}})[_0x2643('0x16')](function(_0x5cc0b5){logger[_0x2643('0x12')](_0x2643('0xd'),_0x491cd2,_0x5cc0b5);_0x2bd8ef(_0x5cc0b5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ec89b09..cfd37ad 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 _0x1971=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x126e5a,_0x4fddbc){var _0x2cc0e8=function(_0x14ed96){while(--_0x14ed96){_0x126e5a['push'](_0x126e5a['shift']());}};_0x2cc0e8(++_0x4fddbc);}(_0x1971,0x161));var _0x1197=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x1971[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x1197('0x0'));var util=require(_0x1197('0x1'));var path=require(_0x1197('0x2'));var timeout=require(_0x1197('0x3'));var express=require(_0x1197('0x4'));var router=express[_0x1197('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1197('0x6'));var interaction=require(_0x1197('0x7'));var config=require(_0x1197('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x1197('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1197('0x9')](_0x1197('0xa'),auth[_0x1197('0xb')](),controller['show']);router[_0x1197('0xc')]('/',auth['isAuthenticated'](),controller[_0x1197('0xd')]);router[_0x1197('0xe')](_0x1197('0xa'),auth['isAuthenticated'](),controller[_0x1197('0xf')]);router[_0x1197('0x10')](_0x1197('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1197('0x11')]=router; \ No newline at end of file +var _0x2f46=['isAuthenticated','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x1fdb50,_0x68b19c){var _0x43ff80=function(_0x56c544){while(--_0x56c544){_0x1fdb50['push'](_0x1fdb50['shift']());}};_0x43ff80(++_0x68b19c);}(_0x2f46,0x13a));var _0x62f4=function(_0x159930,_0x1fb20f){_0x159930=_0x159930-0x0;var _0x15acb8=_0x2f46[_0x159930];return _0x15acb8;};'use strict';var multer=require(_0x62f4('0x0'));var util=require('util');var path=require(_0x62f4('0x1'));var timeout=require(_0x62f4('0x2'));var express=require('express');var router=express[_0x62f4('0x3')]();var fs_extra=require(_0x62f4('0x4'));var auth=require(_0x62f4('0x5'));var interaction=require(_0x62f4('0x6'));var config=require(_0x62f4('0x7'));var controller=require(_0x62f4('0x8'));router[_0x62f4('0x9')]('/',auth[_0x62f4('0xa')](),controller['index']);router[_0x62f4('0x9')](_0x62f4('0xb'),auth[_0x62f4('0xa')](),controller[_0x62f4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x62f4('0xd')](_0x62f4('0xb'),auth[_0x62f4('0xa')](),controller[_0x62f4('0xe')]);router[_0x62f4('0xf')](_0x62f4('0xb'),auth[_0x62f4('0xa')](),controller[_0x62f4('0x10')]);module[_0x62f4('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 d205043..426ed72 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 _0x7e24=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7e24,0x1b4));var _0x47e2=function(_0x2e9f56,_0x54cf4b){_0x2e9f56=_0x2e9f56-0x0;var _0x5577a4=_0x7e24[_0x2e9f56];return _0x5577a4;};'use strict';var Sequelize=require(_0x47e2('0x0'));module[_0x47e2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x47e2('0x2'),'variable',_0x47e2('0x3'),'keyValue',_0x47e2('0x4')),'defaultValue':_0x47e2('0x2')},'content':{'type':Sequelize[_0x47e2('0x5')]},'key':{'type':Sequelize[_0x47e2('0x5')]},'keyType':{'type':Sequelize[_0x47e2('0x6')](_0x47e2('0x2'),'variable',_0x47e2('0x3'))},'keyContent':{'type':Sequelize[_0x47e2('0x5')]},'idField':{'type':Sequelize[_0x47e2('0x5')]},'nameField':{'type':Sequelize[_0x47e2('0x5')]},'customField':{'type':Sequelize[_0x47e2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47e2('0x5')]}}; \ No newline at end of file +var _0xcf3b=['customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x51b0f7,_0x20f887){var _0x3944c9=function(_0x2111b3){while(--_0x2111b3){_0x51b0f7['push'](_0x51b0f7['shift']());}};_0x3944c9(++_0x20f887);}(_0xcf3b,0x1ab));var _0xbcf3=function(_0x4d7991,_0x410455){_0x4d7991=_0x4d7991-0x0;var _0x49783f=_0xcf3b[_0x4d7991];return _0x49783f;};'use strict';var Sequelize=require(_0xbcf3('0x0'));module[_0xbcf3('0x1')]={'type':{'type':Sequelize[_0xbcf3('0x2')](_0xbcf3('0x3'),_0xbcf3('0x4'),_0xbcf3('0x5'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbcf3('0x3'),'variable',_0xbcf3('0x5'))},'keyContent':{'type':Sequelize[_0xbcf3('0x6')]},'idField':{'type':Sequelize[_0xbcf3('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbcf3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 11494bf..d6846bc 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 _0x7c2e=['limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','update','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x8d695e,_0x394999){var _0x3d156e=function(_0x38cf6f){while(--_0x38cf6f){_0x8d695e['push'](_0x8d695e['shift']());}};_0x3d156e(++_0x394999);}(_0x7c2e,0x16c));var _0xe7c2=function(_0x38f0c4,_0x4fea65){_0x38f0c4=_0x38f0c4-0x0;var _0x2be4fd=_0x7c2e[_0x38f0c4];return _0x2be4fd;};'use strict';var emlformat=require(_0xe7c2('0x0'));var rimraf=require(_0xe7c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7c2('0x2'));var rp=require(_0xe7c2('0x3'));var moment=require(_0xe7c2('0x4'));var BPromise=require(_0xe7c2('0x5'));var Mustache=require(_0xe7c2('0x6'));var util=require(_0xe7c2('0x7'));var path=require('path');var sox=require(_0xe7c2('0x8'));var csv=require(_0xe7c2('0x9'));var ejs=require(_0xe7c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe7c2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe7c2('0xc'));var deskjs=require(_0xe7c2('0xd'));var toCsv=require(_0xe7c2('0x9'));var querystring=require('querystring');var Papa=require(_0xe7c2('0xe'));var Redis=require(_0xe7c2('0xf'));var authService=require(_0xe7c2('0x10'));var qs=require(_0xe7c2('0x11'));var as=require(_0xe7c2('0x12'));var hardwareService=require(_0xe7c2('0x13'));var logger=require(_0xe7c2('0x14'))(_0xe7c2('0x15'));var utils=require(_0xe7c2('0x16'));var config=require(_0xe7c2('0x17'));var licenseUtil=require(_0xe7c2('0x18'));var db=require(_0xe7c2('0x19'))['db'];function respondWithStatusCode(_0x17ba2,_0x41cd17){_0x41cd17=_0x41cd17||0xcc;return function(_0x4f124b){if(_0x4f124b){return _0x17ba2[_0xe7c2('0x1a')](_0x41cd17);}return _0x17ba2[_0xe7c2('0x1b')](_0x41cd17)[_0xe7c2('0x1c')]();};}function respondWithResult(_0x555601,_0x5e00e4){_0x5e00e4=_0x5e00e4||0xc8;return function(_0x17020f){if(_0x17020f){return _0x555601['status'](_0x5e00e4)['json'](_0x17020f);}};}function respondWithFilteredResult(_0x34f6e8,_0x339dc0){return function(_0x567925){if(_0x567925){var _0x204353=typeof _0x339dc0[_0xe7c2('0x1d')]===_0xe7c2('0x1e')&&typeof _0x339dc0[_0xe7c2('0x1f')]===_0xe7c2('0x1e');var _0x10263c=_0x567925[_0xe7c2('0x20')];var _0x8e413=_0x204353?0x0:_0x339dc0[_0xe7c2('0x1d')];var _0x3e328e=_0x204353?_0x567925[_0xe7c2('0x20')]:_0x339dc0['offset']+_0x339dc0[_0xe7c2('0x1f')];var _0x16c5a2;if(_0x3e328e>=_0x10263c){_0x3e328e=_0x10263c;_0x16c5a2=0xc8;}else{_0x16c5a2=0xce;}_0x34f6e8[_0xe7c2('0x1b')](_0x16c5a2);return _0x34f6e8[_0xe7c2('0x21')](_0xe7c2('0x22'),_0x8e413+'-'+_0x3e328e+'/'+_0x10263c)[_0xe7c2('0x23')](_0x567925);}return null;};}function patchUpdates(_0x3d35d4){return function(_0x32b6e2){try{jsonpatch[_0xe7c2('0x24')](_0x32b6e2,_0x3d35d4,!![]);}catch(_0x2cca1e){return BPromise['reject'](_0x2cca1e);}return _0x32b6e2[_0xe7c2('0x25')]();};}function saveUpdates(_0x4486d1,_0x3c4f3b){return function(_0x47c5fe){if(_0x47c5fe){return _0x47c5fe['update'](_0x4486d1)[_0xe7c2('0x26')](function(_0x292e10){return _0x292e10;});}return null;};}function removeEntity(_0x2032d8,_0x26a821){return function(_0x5ce659){if(_0x5ce659){return _0x5ce659['destroy']()[_0xe7c2('0x26')](function(){_0x2032d8['status'](0xcc)[_0xe7c2('0x1c')]();});}};}function handleEntityNotFound(_0x204398,_0x99f955){return function(_0x111d24){if(!_0x111d24){_0x204398[_0xe7c2('0x1a')](0x194);}return _0x111d24;};}function handleError(_0x5841b0,_0x10d840){_0x10d840=_0x10d840||0x1f4;return function(_0x13639f){logger[_0xe7c2('0x27')](_0x13639f[_0xe7c2('0x28')]);if(_0x13639f['name']){delete _0x13639f[_0xe7c2('0x29')];}_0x5841b0['status'](_0x10d840)[_0xe7c2('0x2a')](_0x13639f);};}exports[_0xe7c2('0x2b')]=function(_0x29fb3a,_0x4301f9){var _0x508ce9={},_0x1e89f8={},_0x2282b3={'count':0x0,'rows':[]};var _0x304b7f=_[_0xe7c2('0x2c')](db[_0xe7c2('0x2d')][_0xe7c2('0x2e')],function(_0x97ecc3){return{'name':_0x97ecc3[_0xe7c2('0x2f')],'type':_0x97ecc3[_0xe7c2('0x30')][_0xe7c2('0x31')]};});_0x1e89f8[_0xe7c2('0x32')]=_['map'](_0x304b7f,_0xe7c2('0x29'));_0x1e89f8[_0xe7c2('0x33')]=_['keys'](_0x29fb3a[_0xe7c2('0x33')]);_0x1e89f8['filters']=_[_0xe7c2('0x34')](_0x1e89f8[_0xe7c2('0x32')],_0x1e89f8[_0xe7c2('0x33')]);_0x508ce9['attributes']=_['intersection'](_0x1e89f8[_0xe7c2('0x32')],qs[_0xe7c2('0x35')](_0x29fb3a[_0xe7c2('0x33')]['fields']));_0x508ce9[_0xe7c2('0x36')]=_0x508ce9[_0xe7c2('0x36')][_0xe7c2('0x37')]?_0x508ce9[_0xe7c2('0x36')]:_0x1e89f8[_0xe7c2('0x32')];if(!_0x29fb3a['query'][_0xe7c2('0x38')](_0xe7c2('0x39'))){_0x508ce9[_0xe7c2('0x1f')]=qs['limit'](_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x1f')]);_0x508ce9['offset']=qs['offset'](_0x29fb3a['query'][_0xe7c2('0x1d')]);}_0x508ce9[_0xe7c2('0x3a')]=qs[_0xe7c2('0x3b')](_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x3b')]);_0x508ce9[_0xe7c2('0x3c')]=qs[_0xe7c2('0x3d')](_[_0xe7c2('0x3e')](_0x29fb3a[_0xe7c2('0x33')],_0x1e89f8[_0xe7c2('0x3d')]),_0x304b7f);if(_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x3f')]){_0x508ce9['where']=_[_0xe7c2('0x40')](_0x508ce9['where'],{'$or':_[_0xe7c2('0x2c')](_0x304b7f,function(_0x52396c){if(_0x52396c[_0xe7c2('0x30')]!==_0xe7c2('0x41')){var _0x255761={};_0x255761[_0x52396c[_0xe7c2('0x29')]]={'$like':'%'+_0x29fb3a[_0xe7c2('0x33')]['filter']+'%'};return _0x255761;}})});}_0x508ce9=_[_0xe7c2('0x40')]({},_0x508ce9,_0x29fb3a[_0xe7c2('0x42')]);var _0x300ef4={'where':_0x508ce9[_0xe7c2('0x3c')]};return db[_0xe7c2('0x2d')][_0xe7c2('0x20')](_0x300ef4)[_0xe7c2('0x26')](function(_0x2335cd){_0x2282b3[_0xe7c2('0x20')]=_0x2335cd;if(_0x29fb3a[_0xe7c2('0x33')][_0xe7c2('0x43')]){_0x508ce9[_0xe7c2('0x44')]=[{'all':!![]}];}return db[_0xe7c2('0x2d')][_0xe7c2('0x45')](_0x508ce9);})[_0xe7c2('0x26')](function(_0x192b7d){_0x2282b3['rows']=_0x192b7d;return _0x2282b3;})['then'](respondWithFilteredResult(_0x4301f9,_0x508ce9))[_0xe7c2('0x46')](handleError(_0x4301f9,null));};exports[_0xe7c2('0x47')]=function(_0x33996e,_0xd201d){var _0x215761={'raw':!![],'where':{'id':_0x33996e[_0xe7c2('0x48')]['id']}},_0x142518={};_0x142518[_0xe7c2('0x32')]=_[_0xe7c2('0x49')](db[_0xe7c2('0x2d')][_0xe7c2('0x2e')]);_0x142518[_0xe7c2('0x33')]=_[_0xe7c2('0x49')](_0x33996e[_0xe7c2('0x33')]);_0x142518['filters']=_['intersection'](_0x142518[_0xe7c2('0x32')],_0x142518[_0xe7c2('0x33')]);_0x215761[_0xe7c2('0x36')]=_[_0xe7c2('0x34')](_0x142518[_0xe7c2('0x32')],qs['fields'](_0x33996e['query'][_0xe7c2('0x35')]));_0x215761[_0xe7c2('0x36')]=_0x215761[_0xe7c2('0x36')][_0xe7c2('0x37')]?_0x215761[_0xe7c2('0x36')]:_0x142518[_0xe7c2('0x32')];if(_0x33996e[_0xe7c2('0x33')][_0xe7c2('0x43')]){_0x215761[_0xe7c2('0x44')]=[{'all':!![]}];}_0x215761=_[_0xe7c2('0x40')]({},_0x215761,_0x33996e[_0xe7c2('0x42')]);return db[_0xe7c2('0x2d')]['find'](_0x215761)['then'](handleEntityNotFound(_0xd201d,null))[_0xe7c2('0x26')](respondWithResult(_0xd201d,null))['catch'](handleError(_0xd201d,null));};exports[_0xe7c2('0x4a')]=function(_0x4871f3,_0x5024e6){return db[_0xe7c2('0x2d')][_0xe7c2('0x4a')](_0x4871f3[_0xe7c2('0x4b')],{})[_0xe7c2('0x26')](respondWithResult(_0x5024e6,0xc9))['catch'](handleError(_0x5024e6,null));};exports[_0xe7c2('0x4c')]=function(_0x5a1188,_0x224d05){if(_0x5a1188[_0xe7c2('0x4b')]['id']){delete _0x5a1188[_0xe7c2('0x4b')]['id'];}return db[_0xe7c2('0x2d')][_0xe7c2('0x4d')]({'where':{'id':_0x5a1188[_0xe7c2('0x48')]['id']}})[_0xe7c2('0x26')](handleEntityNotFound(_0x224d05,null))[_0xe7c2('0x26')](saveUpdates(_0x5a1188['body'],null))[_0xe7c2('0x26')](respondWithResult(_0x224d05,null))[_0xe7c2('0x46')](handleError(_0x224d05,null));};exports[_0xe7c2('0x4e')]=function(_0x4eaba7,_0x1f5b39){return db[_0xe7c2('0x2d')][_0xe7c2('0x4d')]({'where':{'id':_0x4eaba7['params']['id']}})[_0xe7c2('0x26')](handleEntityNotFound(_0x1f5b39,null))[_0xe7c2('0x26')](removeEntity(_0x1f5b39,null))[_0xe7c2('0x46')](handleError(_0x1f5b39,null));}; \ No newline at end of file +var _0x846c=['util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Field','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x14e9e6,_0x36117a){var _0xa3497d=function(_0x159584){while(--_0x159584){_0x14e9e6['push'](_0x14e9e6['shift']());}};_0xa3497d(++_0x36117a);}(_0x846c,0x129));var _0xc846=function(_0x8e6bc0,_0x16f55e){_0x8e6bc0=_0x8e6bc0-0x0;var _0x2b0145=_0x846c[_0x8e6bc0];return _0x2b0145;};'use strict';var emlformat=require(_0xc846('0x0'));var rimraf=require(_0xc846('0x1'));var zipdir=require(_0xc846('0x2'));var jsonpatch=require(_0xc846('0x3'));var rp=require(_0xc846('0x4'));var moment=require(_0xc846('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc846('0x6'));var util=require(_0xc846('0x7'));var path=require(_0xc846('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc846('0x9'));var fs=require('fs');var fs_extra=require(_0xc846('0xa'));var _=require(_0xc846('0xb'));var squel=require(_0xc846('0xc'));var crypto=require(_0xc846('0xd'));var jsforce=require(_0xc846('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc846('0xf'));var querystring=require(_0xc846('0x10'));var Papa=require(_0xc846('0x11'));var Redis=require(_0xc846('0x12'));var authService=require(_0xc846('0x13'));var qs=require(_0xc846('0x14'));var as=require(_0xc846('0x15'));var hardwareService=require(_0xc846('0x16'));var logger=require('../../config/logger')(_0xc846('0x17'));var utils=require(_0xc846('0x18'));var config=require(_0xc846('0x19'));var licenseUtil=require(_0xc846('0x1a'));var db=require(_0xc846('0x1b'))['db'];function respondWithStatusCode(_0x2847ab,_0x7975e2){_0x7975e2=_0x7975e2||0xcc;return function(_0x26f2c3){if(_0x26f2c3){return _0x2847ab['sendStatus'](_0x7975e2);}return _0x2847ab[_0xc846('0x1c')](_0x7975e2)[_0xc846('0x1d')]();};}function respondWithResult(_0x9e2b94,_0x59331f){_0x59331f=_0x59331f||0xc8;return function(_0x3da7ad){if(_0x3da7ad){return _0x9e2b94['status'](_0x59331f)[_0xc846('0x1e')](_0x3da7ad);}};}function respondWithFilteredResult(_0xa61245,_0xcc0f01){return function(_0x36d2e9){if(_0x36d2e9){var _0x1ae121=typeof _0xcc0f01[_0xc846('0x1f')]==='undefined'&&typeof _0xcc0f01[_0xc846('0x20')]==='undefined';var _0x326de9=_0x36d2e9[_0xc846('0x21')];var _0x53fc98=_0x1ae121?0x0:_0xcc0f01[_0xc846('0x1f')];var _0x13197a=_0x1ae121?_0x36d2e9[_0xc846('0x21')]:_0xcc0f01[_0xc846('0x1f')]+_0xcc0f01[_0xc846('0x20')];var _0x560dc6;if(_0x13197a>=_0x326de9){_0x13197a=_0x326de9;_0x560dc6=0xc8;}else{_0x560dc6=0xce;}_0xa61245['status'](_0x560dc6);return _0xa61245[_0xc846('0x22')]('Content-Range',_0x53fc98+'-'+_0x13197a+'/'+_0x326de9)[_0xc846('0x1e')](_0x36d2e9);}return null;};}function patchUpdates(_0x1f89d2){return function(_0x4a08c8){try{jsonpatch[_0xc846('0x23')](_0x4a08c8,_0x1f89d2,!![]);}catch(_0x352310){return BPromise[_0xc846('0x24')](_0x352310);}return _0x4a08c8[_0xc846('0x25')]();};}function saveUpdates(_0x12abc6,_0x2ea68b){return function(_0x550d59){if(_0x550d59){return _0x550d59[_0xc846('0x26')](_0x12abc6)[_0xc846('0x27')](function(_0x2a6777){return _0x2a6777;});}return null;};}function removeEntity(_0x4c8bd5,_0x276908){return function(_0x5ee020){if(_0x5ee020){return _0x5ee020[_0xc846('0x28')]()['then'](function(){_0x4c8bd5[_0xc846('0x1c')](0xcc)[_0xc846('0x1d')]();});}};}function handleEntityNotFound(_0x5a665a,_0x5a7961){return function(_0x7e2298){if(!_0x7e2298){_0x5a665a[_0xc846('0x29')](0x194);}return _0x7e2298;};}function handleError(_0x229b99,_0x2c23f5){_0x2c23f5=_0x2c23f5||0x1f4;return function(_0x393fb9){logger[_0xc846('0x2a')](_0x393fb9[_0xc846('0x2b')]);if(_0x393fb9[_0xc846('0x2c')]){delete _0x393fb9[_0xc846('0x2c')];}_0x229b99[_0xc846('0x1c')](_0x2c23f5)[_0xc846('0x2d')](_0x393fb9);};}exports[_0xc846('0x2e')]=function(_0xd9492f,_0x43190f){var _0x386b43={},_0x546c74={},_0x21849c={'count':0x0,'rows':[]};var _0x593b02=_[_0xc846('0x2f')](db[_0xc846('0x30')]['rawAttributes'],function(_0x200194){return{'name':_0x200194['fieldName'],'type':_0x200194[_0xc846('0x31')][_0xc846('0x32')]};});_0x546c74['model']=_[_0xc846('0x2f')](_0x593b02,_0xc846('0x2c'));_0x546c74[_0xc846('0x33')]=_[_0xc846('0x34')](_0xd9492f['query']);_0x546c74[_0xc846('0x35')]=_[_0xc846('0x36')](_0x546c74[_0xc846('0x37')],_0x546c74[_0xc846('0x33')]);_0x386b43['attributes']=_['intersection'](_0x546c74['model'],qs[_0xc846('0x38')](_0xd9492f[_0xc846('0x33')]['fields']));_0x386b43['attributes']=_0x386b43[_0xc846('0x39')]['length']?_0x386b43['attributes']:_0x546c74[_0xc846('0x37')];if(!_0xd9492f[_0xc846('0x33')][_0xc846('0x3a')](_0xc846('0x3b'))){_0x386b43[_0xc846('0x20')]=qs['limit'](_0xd9492f[_0xc846('0x33')][_0xc846('0x20')]);_0x386b43[_0xc846('0x1f')]=qs[_0xc846('0x1f')](_0xd9492f['query'][_0xc846('0x1f')]);}_0x386b43[_0xc846('0x3c')]=qs[_0xc846('0x3d')](_0xd9492f['query'][_0xc846('0x3d')]);_0x386b43[_0xc846('0x3e')]=qs[_0xc846('0x35')](_[_0xc846('0x3f')](_0xd9492f[_0xc846('0x33')],_0x546c74[_0xc846('0x35')]),_0x593b02);if(_0xd9492f[_0xc846('0x33')][_0xc846('0x40')]){_0x386b43[_0xc846('0x3e')]=_[_0xc846('0x41')](_0x386b43['where'],{'$or':_[_0xc846('0x2f')](_0x593b02,function(_0x414914){if(_0x414914[_0xc846('0x31')]!=='VIRTUAL'){var _0x1b7ce7={};_0x1b7ce7[_0x414914[_0xc846('0x2c')]]={'$like':'%'+_0xd9492f[_0xc846('0x33')][_0xc846('0x40')]+'%'};return _0x1b7ce7;}})});}_0x386b43=_[_0xc846('0x41')]({},_0x386b43,_0xd9492f[_0xc846('0x42')]);var _0x2c25a9={'where':_0x386b43[_0xc846('0x3e')]};return db[_0xc846('0x30')][_0xc846('0x21')](_0x2c25a9)[_0xc846('0x27')](function(_0x1097a9){_0x21849c[_0xc846('0x21')]=_0x1097a9;if(_0xd9492f[_0xc846('0x33')][_0xc846('0x43')]){_0x386b43[_0xc846('0x44')]=[{'all':!![]}];}return db[_0xc846('0x30')][_0xc846('0x45')](_0x386b43);})[_0xc846('0x27')](function(_0x2a4939){_0x21849c[_0xc846('0x46')]=_0x2a4939;return _0x21849c;})['then'](respondWithFilteredResult(_0x43190f,_0x386b43))[_0xc846('0x47')](handleError(_0x43190f,null));};exports['show']=function(_0xb8c53d,_0x49fd41){var _0x3130af={'raw':!![],'where':{'id':_0xb8c53d['params']['id']}},_0x8205a0={};_0x8205a0[_0xc846('0x37')]=_['keys'](db[_0xc846('0x30')]['rawAttributes']);_0x8205a0[_0xc846('0x33')]=_[_0xc846('0x34')](_0xb8c53d[_0xc846('0x33')]);_0x8205a0[_0xc846('0x35')]=_['intersection'](_0x8205a0[_0xc846('0x37')],_0x8205a0[_0xc846('0x33')]);_0x3130af[_0xc846('0x39')]=_[_0xc846('0x36')](_0x8205a0[_0xc846('0x37')],qs[_0xc846('0x38')](_0xb8c53d['query']['fields']));_0x3130af[_0xc846('0x39')]=_0x3130af['attributes']['length']?_0x3130af['attributes']:_0x8205a0[_0xc846('0x37')];if(_0xb8c53d[_0xc846('0x33')][_0xc846('0x43')]){_0x3130af[_0xc846('0x44')]=[{'all':!![]}];}_0x3130af=_[_0xc846('0x41')]({},_0x3130af,_0xb8c53d[_0xc846('0x42')]);return db[_0xc846('0x30')][_0xc846('0x48')](_0x3130af)[_0xc846('0x27')](handleEntityNotFound(_0x49fd41,null))[_0xc846('0x27')](respondWithResult(_0x49fd41,null))[_0xc846('0x47')](handleError(_0x49fd41,null));};exports[_0xc846('0x49')]=function(_0x59d74d,_0x46f6cb){return db[_0xc846('0x30')][_0xc846('0x49')](_0x59d74d[_0xc846('0x4a')],{})[_0xc846('0x27')](respondWithResult(_0x46f6cb,0xc9))[_0xc846('0x47')](handleError(_0x46f6cb,null));};exports[_0xc846('0x26')]=function(_0x3e9880,_0x28f3c8){if(_0x3e9880[_0xc846('0x4a')]['id']){delete _0x3e9880[_0xc846('0x4a')]['id'];}return db['Dynamics365Field'][_0xc846('0x48')]({'where':{'id':_0x3e9880[_0xc846('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28f3c8,null))[_0xc846('0x27')](saveUpdates(_0x3e9880[_0xc846('0x4a')],null))[_0xc846('0x27')](respondWithResult(_0x28f3c8,null))[_0xc846('0x47')](handleError(_0x28f3c8,null));};exports[_0xc846('0x28')]=function(_0x18fb43,_0x413e6f){return db[_0xc846('0x30')][_0xc846('0x48')]({'where':{'id':_0x18fb43[_0xc846('0x4b')]['id']}})[_0xc846('0x27')](handleEntityNotFound(_0x413e6f,null))[_0xc846('0x27')](removeEntity(_0x413e6f,null))[_0xc846('0x47')](handleError(_0x413e6f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index af6c2da..0a669b8 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 _0x73a4=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x1c32ec,_0x54e5f3){var _0x4ef7cc=function(_0xa163f3){while(--_0xa163f3){_0x1c32ec['push'](_0x1c32ec['shift']());}};_0x4ef7cc(++_0x54e5f3);}(_0x73a4,0x1ef));var _0x473a=function(_0x48a46a,_0x360d95){_0x48a46a=_0x48a46a-0x0;var _0x3c9260=_0x73a4[_0x48a46a];return _0x3c9260;};'use strict';var _=require(_0x473a('0x0'));var util=require(_0x473a('0x1'));var logger=require(_0x473a('0x2'))(_0x473a('0x3'));var moment=require(_0x473a('0x4'));var BPromise=require('bluebird');var rp=require(_0x473a('0x5'));var fs=require('fs');var path=require(_0x473a('0x6'));var rimraf=require(_0x473a('0x7'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x2f78fb,_0x1a93f3){return _0x2f78fb[_0x473a('0x8')](_0x473a('0x9'),attributes,{'tableName':_0x473a('0xa'),'paranoid':![],'indexes':[{'name':_0x473a('0xb'),'fields':['idField',_0x473a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c34=['int_dynamics365_fields','dynamics365_unique_index','FieldId','../../config/logger','api','moment','request-promise','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field'];(function(_0xd3bc07,_0x3a11a5){var _0x10aa85=function(_0xb8f14e){while(--_0xb8f14e){_0xd3bc07['push'](_0xd3bc07['shift']());}};_0x10aa85(++_0x3a11a5);}(_0x9c34,0xc9));var _0x49c3=function(_0xe683ab,_0x19520a){_0xe683ab=_0xe683ab-0x0;var _0x350027=_0x9c34[_0xe683ab];return _0x350027;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c3('0x0'))(_0x49c3('0x1'));var moment=require(_0x49c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x49c3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49c3('0x4'));var config=require('../../config/environment');var attributes=require(_0x49c3('0x5'));module['exports']=function(_0x2d5dc2,_0x460365){return _0x2d5dc2[_0x49c3('0x6')](_0x49c3('0x7'),attributes,{'tableName':_0x49c3('0x8'),'paranoid':![],'indexes':[{'name':_0x49c3('0x9'),'fields':['idField',_0x49c3('0xa')],'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 1281991..568f5de 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 _0x2bbd=['Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x502d3c,_0x5f2fa9){var _0x12261a=function(_0x6b3ca3){while(--_0x6b3ca3){_0x502d3c['push'](_0x502d3c['shift']());}};_0x12261a(++_0x5f2fa9);}(_0x2bbd,0x13c));var _0xd2bb=function(_0x42d451,_0x2436ce){_0x42d451=_0x42d451-0x0;var _0x2ebac0=_0x2bbd[_0x42d451];return _0x2ebac0;};'use strict';var _=require(_0xd2bb('0x0'));var util=require(_0xd2bb('0x1'));var moment=require('moment');var BPromise=require(_0xd2bb('0x2'));var rs=require(_0xd2bb('0x3'));var fs=require('fs');var Redis=require(_0xd2bb('0x4'));var db=require(_0xd2bb('0x5'))['db'];var utils=require(_0xd2bb('0x6'));var logger=require(_0xd2bb('0x7'))(_0xd2bb('0x8'));var config=require(_0xd2bb('0x9'));var jayson=require(_0xd2bb('0xa'));var client=jayson[_0xd2bb('0xb')][_0xd2bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29267b,_0x5b28c7,_0x1a2f43){return new BPromise(function(_0x382735,_0xea37b3){return client[_0xd2bb('0xd')](_0x29267b,_0x1a2f43)[_0xd2bb('0xe')](function(_0x12b1df){logger[_0xd2bb('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5b28c7,'request\x20sent');logger[_0xd2bb('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5b28c7,_0xd2bb('0x11'),JSON[_0xd2bb('0x12')](_0x12b1df));if(_0x12b1df['error']){if(_0x12b1df[_0xd2bb('0x13')]['code']===0x1f4){logger['error'](_0xd2bb('0x14'),_0x5b28c7,_0x12b1df[_0xd2bb('0x13')]['message']);return _0xea37b3(_0x12b1df[_0xd2bb('0x13')][_0xd2bb('0x15')]);}logger['error'](_0xd2bb('0x14'),_0x5b28c7,_0x12b1df[_0xd2bb('0x13')]['message']);return _0x382735(_0x12b1df[_0xd2bb('0x13')]['message']);}else{logger[_0xd2bb('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5b28c7,_0xd2bb('0x11'));_0x382735(_0x12b1df[_0xd2bb('0x16')][_0xd2bb('0x15')]);}})[_0xd2bb('0x17')](function(_0xf31793){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x5b28c7,_0xf31793);_0xea37b3(_0xf31793);});});} \ No newline at end of file +var _0x1821=['request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x40857b,_0x15e4f0){var _0x2e5d2c=function(_0x1b02fe){while(--_0x1b02fe){_0x40857b['push'](_0x40857b['shift']());}};_0x2e5d2c(++_0x15e4f0);}(_0x1821,0xf2));var _0x1182=function(_0x1ec961,_0x1b43aa){_0x1ec961=_0x1ec961-0x0;var _0x82c4d4=_0x1821[_0x1ec961];return _0x82c4d4;};'use strict';var _=require(_0x1182('0x0'));var util=require('util');var moment=require(_0x1182('0x1'));var BPromise=require(_0x1182('0x2'));var rs=require(_0x1182('0x3'));var fs=require('fs');var Redis=require(_0x1182('0x4'));var db=require(_0x1182('0x5'))['db'];var utils=require(_0x1182('0x6'));var logger=require('../../config/logger')(_0x1182('0x7'));var config=require(_0x1182('0x8'));var jayson=require(_0x1182('0x9'));var client=jayson[_0x1182('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50aef4,_0x2607fc,_0x447766){return new BPromise(function(_0x5a27d9,_0x53bf7d){return client[_0x1182('0xb')](_0x50aef4,_0x447766)[_0x1182('0xc')](function(_0x22369c){logger[_0x1182('0xd')](_0x1182('0xe'),_0x2607fc,_0x1182('0xf'));logger[_0x1182('0x10')](_0x1182('0x11'),_0x2607fc,'request\x20sent',JSON[_0x1182('0x12')](_0x22369c));if(_0x22369c['error']){if(_0x22369c[_0x1182('0x13')]['code']===0x1f4){logger[_0x1182('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x2607fc,_0x22369c[_0x1182('0x13')][_0x1182('0x14')]);return _0x53bf7d(_0x22369c['error']['message']);}logger[_0x1182('0x13')](_0x1182('0xe'),_0x2607fc,_0x22369c['error']['message']);return _0x5a27d9(_0x22369c[_0x1182('0x13')][_0x1182('0x14')]);}else{logger[_0x1182('0xd')](_0x1182('0xe'),_0x2607fc,'request\x20sent');_0x5a27d9(_0x22369c[_0x1182('0x15')]['message']);}})[_0x1182('0x16')](function(_0x2e0b52){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2607fc,_0x2e0b52);_0x53bf7d(_0x2e0b52);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index c1ffdd6..36a2614 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 _0xcf13=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x5e5275,_0x893b69){var _0x18fb88=function(_0x44bfbb){while(--_0x44bfbb){_0x5e5275['push'](_0x5e5275['shift']());}};_0x18fb88(++_0x893b69);}(_0xcf13,0xea));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3cf1('0x0'));var util=require(_0x3cf1('0x1'));var path=require(_0x3cf1('0x2'));var timeout=require('connect-timeout');var express=require(_0x3cf1('0x3'));var router=express[_0x3cf1('0x4')]();var fs_extra=require(_0x3cf1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3cf1('0x6'));var config=require(_0x3cf1('0x7'));var controller=require(_0x3cf1('0x8'));router[_0x3cf1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3cf1('0x9')]('/:id',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0xb')]);router[_0x3cf1('0x9')]('/:id/configurations',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0xc')]);router['get'](_0x3cf1('0xd'),auth[_0x3cf1('0xa')](),controller[_0x3cf1('0xe')]);router[_0x3cf1('0xf')]('/',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0x10')]);router[_0x3cf1('0xf')](_0x3cf1('0x11'),auth['isAuthenticated'](),controller[_0x3cf1('0x12')]);router[_0x3cf1('0x13')]('/:id',auth[_0x3cf1('0xa')](),controller[_0x3cf1('0x14')]);router[_0x3cf1('0x15')](_0x3cf1('0x16'),auth[_0x3cf1('0xa')](),controller[_0x3cf1('0x17')]);module['exports']=router; \ No newline at end of file +var _0x1de2=['post','create','/:id/configurations','addConfiguration','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1de2,0x13e));var _0x21de=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0x1de2[_0x318256];return _0xb1e352;};'use strict';var multer=require(_0x21de('0x0'));var util=require(_0x21de('0x1'));var path=require(_0x21de('0x2'));var timeout=require(_0x21de('0x3'));var express=require(_0x21de('0x4'));var router=express[_0x21de('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x21de('0x6'));var interaction=require(_0x21de('0x7'));var config=require(_0x21de('0x8'));var controller=require(_0x21de('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x21de('0xa')]);router[_0x21de('0xb')](_0x21de('0xc'),auth[_0x21de('0xd')](),controller[_0x21de('0xe')]);router[_0x21de('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x21de('0xf')]);router[_0x21de('0xb')](_0x21de('0x10'),auth[_0x21de('0xd')](),controller[_0x21de('0x11')]);router[_0x21de('0x12')]('/',auth[_0x21de('0xd')](),controller[_0x21de('0x13')]);router[_0x21de('0x12')](_0x21de('0x14'),auth[_0x21de('0xd')](),controller[_0x21de('0x15')]);router['put'](_0x21de('0xc'),auth['isAuthenticated'](),controller[_0x21de('0x16')]);router['delete'](_0x21de('0xc'),auth[_0x21de('0xd')](),controller['destroy']);module[_0x21de('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3c38b45..b7c7be5 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 _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x2c14a6,_0x1f9a92){var _0x35bb6a=function(_0x163f5e){while(--_0x163f5e){_0x2c14a6['push'](_0x2c14a6['shift']());}};_0x35bb6a(++_0x1f9a92);}(_0x5464,0x15d));var _0x4546=function(_0x504041,_0xadb865){_0x504041=_0x504041-0x0;var _0x2808ee=_0x5464[_0x504041];return _0x2808ee;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x25e7=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4731b0,_0x384141){var _0x4a5525=function(_0x2e344d){while(--_0x2e344d){_0x4731b0['push'](_0x4731b0['shift']());}};_0x4a5525(++_0x384141);}(_0x25e7,0x1d6));var _0x725e=function(_0x20410e,_0x11ea83){_0x20410e=_0x20410e-0x0;var _0x18e1cc=_0x25e7[_0x20410e];return _0x18e1cc;};'use strict';var Sequelize=require(_0x725e('0x0'));module[_0x725e('0x1')]={'name':{'type':Sequelize[_0x725e('0x2')]},'description':{'type':Sequelize[_0x725e('0x2')]},'username':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x3')},'apiKey':{'type':Sequelize[_0x725e('0x2')]},'remoteUri':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x4')},'serverUrl':{'type':Sequelize[_0x725e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index e30cf2a..a1891ea 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 _0x710e=['FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','body','find','destroy','findOne','FreshdeskConfiguration','order','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','description','group','ticket_type','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x4d8637,_0x2a9b29){var _0x4cdbfc=function(_0x27893a){while(--_0x27893a){_0x4d8637['push'](_0x4d8637['shift']());}};_0x4cdbfc(++_0x2a9b29);}(_0x710e,0xb6));var _0xe710=function(_0xf79660,_0x987d94){_0xf79660=_0xf79660-0x0;var _0x53223b=_0x710e[_0xf79660];return _0x53223b;};'use strict';var emlformat=require(_0xe710('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe710('0x1'));var rp=require(_0xe710('0x2'));var moment=require(_0xe710('0x3'));var BPromise=require(_0xe710('0x4'));var Mustache=require(_0xe710('0x5'));var util=require('util');var path=require(_0xe710('0x6'));var sox=require(_0xe710('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe710('0x8'));var _=require(_0xe710('0x9'));var squel=require(_0xe710('0xa'));var crypto=require(_0xe710('0xb'));var jsforce=require(_0xe710('0xc'));var deskjs=require(_0xe710('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe710('0xe'));var authService=require(_0xe710('0xf'));var qs=require(_0xe710('0x10'));var as=require(_0xe710('0x11'));var hardwareService=require(_0xe710('0x12'));var logger=require(_0xe710('0x13'))(_0xe710('0x14'));var utils=require(_0xe710('0x15'));var config=require(_0xe710('0x16'));var licenseUtil=require(_0xe710('0x17'));var db=require(_0xe710('0x18'))['db'];var integrations=require(_0xe710('0x19'));function respondWithStatusCode(_0x2061a1,_0x546c5a){_0x546c5a=_0x546c5a||0xcc;return function(_0x4c4aad){if(_0x4c4aad){return _0x2061a1[_0xe710('0x1a')](_0x546c5a);}return _0x2061a1[_0xe710('0x1b')](_0x546c5a)[_0xe710('0x1c')]();};}function respondWithResult(_0x183334,_0x422a84){_0x422a84=_0x422a84||0xc8;return function(_0x19114b){if(_0x19114b){return _0x183334['status'](_0x422a84)[_0xe710('0x1d')](_0x19114b);}};}function respondWithFilteredResult(_0xac5508,_0x329590){return function(_0x145312){if(_0x145312){var _0x21681b=typeof _0x329590[_0xe710('0x1e')]===_0xe710('0x1f')&&typeof _0x329590[_0xe710('0x20')]===_0xe710('0x1f');var _0x43d73a=_0x145312[_0xe710('0x21')];var _0x32870d=_0x21681b?0x0:_0x329590[_0xe710('0x1e')];var _0x5f28a4=_0x21681b?_0x145312[_0xe710('0x21')]:_0x329590['offset']+_0x329590['limit'];var _0x5dbfa5;if(_0x5f28a4>=_0x43d73a){_0x5f28a4=_0x43d73a;_0x5dbfa5=0xc8;}else{_0x5dbfa5=0xce;}_0xac5508['status'](_0x5dbfa5);return _0xac5508['set'](_0xe710('0x22'),_0x32870d+'-'+_0x5f28a4+'/'+_0x43d73a)[_0xe710('0x1d')](_0x145312);}return null;};}function patchUpdates(_0x1c3d82){return function(_0x4d43ba){try{jsonpatch[_0xe710('0x23')](_0x4d43ba,_0x1c3d82,!![]);}catch(_0x59165e){return BPromise[_0xe710('0x24')](_0x59165e);}return _0x4d43ba[_0xe710('0x25')]();};}function saveUpdates(_0x2568e9,_0x21b6b9){return function(_0x193441){if(_0x193441){return _0x193441[_0xe710('0x26')](_0x2568e9)[_0xe710('0x27')](function(_0x4de0fa){return _0x4de0fa;});}return null;};}function removeEntity(_0x54084a,_0x2401ac){return function(_0x1297c9){if(_0x1297c9){return _0x1297c9['destroy']()[_0xe710('0x27')](function(){_0x54084a[_0xe710('0x1b')](0xcc)[_0xe710('0x1c')]();});}};}function handleEntityNotFound(_0x3ce2ec,_0x538063){return function(_0x2664bc){if(!_0x2664bc){_0x3ce2ec[_0xe710('0x1a')](0x194);}return _0x2664bc;};}function handleError(_0x3a6f1b,_0x3e9998){_0x3e9998=_0x3e9998||0x1f4;return function(_0x420725){logger[_0xe710('0x28')](_0x420725[_0xe710('0x29')]);if(_0x420725[_0xe710('0x2a')]){delete _0x420725[_0xe710('0x2a')];}_0x3a6f1b[_0xe710('0x1b')](_0x3e9998)[_0xe710('0x2b')](_0x420725);};}exports[_0xe710('0x2c')]=function(_0x5df3fe,_0x20cf73){var _0x2a620c={},_0xd4864a={},_0x469f7b={'count':0x0,'rows':[]};var _0x395c7f=_[_0xe710('0x2d')](db[_0xe710('0x2e')][_0xe710('0x2f')],function(_0x4076d8){return{'name':_0x4076d8[_0xe710('0x30')],'type':_0x4076d8[_0xe710('0x31')][_0xe710('0x32')]};});_0xd4864a[_0xe710('0x33')]=_['map'](_0x395c7f,_0xe710('0x2a'));_0xd4864a['query']=_['keys'](_0x5df3fe[_0xe710('0x34')]);_0xd4864a[_0xe710('0x35')]=_['intersection'](_0xd4864a[_0xe710('0x33')],_0xd4864a[_0xe710('0x34')]);_0x2a620c[_0xe710('0x36')]=_[_0xe710('0x37')](_0xd4864a[_0xe710('0x33')],qs[_0xe710('0x38')](_0x5df3fe[_0xe710('0x34')][_0xe710('0x38')]));_0x2a620c['attributes']=_0x2a620c['attributes'][_0xe710('0x39')]?_0x2a620c[_0xe710('0x36')]:_0xd4864a['model'];if(!_0x5df3fe[_0xe710('0x34')][_0xe710('0x3a')](_0xe710('0x3b'))){_0x2a620c[_0xe710('0x20')]=qs[_0xe710('0x20')](_0x5df3fe['query'][_0xe710('0x20')]);_0x2a620c[_0xe710('0x1e')]=qs[_0xe710('0x1e')](_0x5df3fe[_0xe710('0x34')][_0xe710('0x1e')]);}_0x2a620c['order']=qs[_0xe710('0x3c')](_0x5df3fe[_0xe710('0x34')][_0xe710('0x3c')]);_0x2a620c[_0xe710('0x3d')]=qs[_0xe710('0x35')](_['pick'](_0x5df3fe[_0xe710('0x34')],_0xd4864a[_0xe710('0x35')]),_0x395c7f);if(_0x5df3fe['query'][_0xe710('0x3e')]){_0x2a620c[_0xe710('0x3d')]=_[_0xe710('0x3f')](_0x2a620c[_0xe710('0x3d')],{'$or':_[_0xe710('0x2d')](_0x395c7f,function(_0x1a0787){if(_0x1a0787[_0xe710('0x31')]!==_0xe710('0x40')){var _0x435202={};_0x435202[_0x1a0787[_0xe710('0x2a')]]={'$like':'%'+_0x5df3fe[_0xe710('0x34')][_0xe710('0x3e')]+'%'};return _0x435202;}})});}_0x2a620c=_[_0xe710('0x3f')]({},_0x2a620c,_0x5df3fe[_0xe710('0x41')]);var _0x446c90={'where':_0x2a620c[_0xe710('0x3d')]};return db[_0xe710('0x2e')][_0xe710('0x21')](_0x446c90)[_0xe710('0x27')](function(_0x40e874){_0x469f7b[_0xe710('0x21')]=_0x40e874;if(_0x5df3fe['query'][_0xe710('0x42')]){_0x2a620c[_0xe710('0x43')]=[{'all':!![]}];}return db[_0xe710('0x2e')][_0xe710('0x44')](_0x2a620c);})[_0xe710('0x27')](function(_0x157a28){_0x469f7b[_0xe710('0x45')]=_0x157a28;return _0x469f7b;})[_0xe710('0x27')](respondWithFilteredResult(_0x20cf73,_0x2a620c))[_0xe710('0x46')](handleError(_0x20cf73,null));};exports[_0xe710('0x47')]=function(_0x1455eb,_0x5dcf48){var _0x3d6f00={'raw':![],'where':{'id':_0x1455eb[_0xe710('0x48')]['id']}},_0x5d674a={};_0x5d674a[_0xe710('0x33')]=_['keys'](db[_0xe710('0x2e')]['rawAttributes']);_0x5d674a[_0xe710('0x34')]=_[_0xe710('0x49')](_0x1455eb[_0xe710('0x34')]);_0x5d674a[_0xe710('0x35')]=_['intersection'](_0x5d674a[_0xe710('0x33')],_0x5d674a[_0xe710('0x34')]);_0x3d6f00[_0xe710('0x36')]=_[_0xe710('0x37')](_0x5d674a[_0xe710('0x33')],qs[_0xe710('0x38')](_0x1455eb[_0xe710('0x34')]['fields']));_0x3d6f00[_0xe710('0x36')]=_0x3d6f00[_0xe710('0x36')][_0xe710('0x39')]?_0x3d6f00[_0xe710('0x36')]:_0x5d674a[_0xe710('0x33')];if(_0x1455eb[_0xe710('0x34')][_0xe710('0x42')]){_0x3d6f00['include']=[{'all':!![]}];}_0x3d6f00=_[_0xe710('0x3f')]({},_0x3d6f00,_0x1455eb[_0xe710('0x41')]);return db[_0xe710('0x2e')]['find'](_0x3d6f00)['then'](handleEntityNotFound(_0x5dcf48,null))[_0xe710('0x27')](respondWithResult(_0x5dcf48,null))['catch'](handleError(_0x5dcf48,null));};exports['create']=function(_0x31b39c,_0x161bed){return db['FreshdeskAccount']['create'](_0x31b39c[_0xe710('0x4a')],{})[_0xe710('0x27')](respondWithResult(_0x161bed,0xc9))['catch'](handleError(_0x161bed,null));};exports[_0xe710('0x26')]=function(_0x6a906b,_0x5306e9){if(_0x6a906b[_0xe710('0x4a')]['id']){delete _0x6a906b[_0xe710('0x4a')]['id'];}return db[_0xe710('0x2e')][_0xe710('0x4b')]({'where':{'id':_0x6a906b[_0xe710('0x48')]['id']}})[_0xe710('0x27')](handleEntityNotFound(_0x5306e9,null))[_0xe710('0x27')](saveUpdates(_0x6a906b[_0xe710('0x4a')],null))['then'](respondWithResult(_0x5306e9,null))['catch'](handleError(_0x5306e9,null));};exports[_0xe710('0x4c')]=function(_0x2f87f9,_0x54e3f9){return db[_0xe710('0x2e')][_0xe710('0x4b')]({'where':{'id':_0x2f87f9['params']['id']}})['then'](handleEntityNotFound(_0x54e3f9,null))[_0xe710('0x27')](removeEntity(_0x54e3f9,null))[_0xe710('0x46')](handleError(_0x54e3f9,null));};exports['getConfigurations']=function(_0x115419,_0x5f263b,_0xed7d76){var _0x5a994c={};var _0x3a8018={};var _0x1af8f4;var _0x3c187f;return db[_0xe710('0x2e')][_0xe710('0x4d')]({'where':{'id':_0x115419[_0xe710('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f263b,null))[_0xe710('0x27')](function(_0x441f67){if(_0x441f67){_0x1af8f4=_0x441f67;_0x3a8018[_0xe710('0x33')]=_['keys'](db[_0xe710('0x4e')][_0xe710('0x2f')]);_0x3a8018['query']=_[_0xe710('0x49')](_0x115419['query']);_0x3a8018[_0xe710('0x35')]=_[_0xe710('0x37')](_0x3a8018[_0xe710('0x33')],_0x3a8018[_0xe710('0x34')]);_0x5a994c[_0xe710('0x36')]=_['intersection'](_0x3a8018[_0xe710('0x33')],qs[_0xe710('0x38')](_0x115419['query'][_0xe710('0x38')]));_0x5a994c[_0xe710('0x36')]=_0x5a994c[_0xe710('0x36')]['length']?_0x5a994c[_0xe710('0x36')]:_0x3a8018['model'];_0x5a994c[_0xe710('0x4f')]=qs[_0xe710('0x3c')](_0x115419[_0xe710('0x34')][_0xe710('0x3c')]);_0x5a994c[_0xe710('0x3d')]=qs[_0xe710('0x35')](_[_0xe710('0x50')](_0x115419['query'],_0x3a8018[_0xe710('0x35')]));if(_0x115419['query'][_0xe710('0x3e')]){_0x5a994c[_0xe710('0x3d')]=_[_0xe710('0x3f')](_0x5a994c[_0xe710('0x3d')],{'$or':_[_0xe710('0x2d')](_0x5a994c[_0xe710('0x36')],function(_0x21c6fc){var _0x292297={};_0x292297[_0x21c6fc]={'$like':'%'+_0x115419[_0xe710('0x34')][_0xe710('0x3e')]+'%'};return _0x292297;})});}_0x5a994c=_[_0xe710('0x3f')]({},_0x5a994c,_0x115419[_0xe710('0x41')]);return _0x1af8f4['getConfigurations'](_0x5a994c);}})[_0xe710('0x27')](function(_0x1ac9f7){if(_0x1ac9f7){_0x3c187f=_0x1ac9f7['length'];if(!_0x115419[_0xe710('0x34')]['hasOwnProperty'](_0xe710('0x3b'))){_0x5a994c[_0xe710('0x20')]=qs[_0xe710('0x20')](_0x115419[_0xe710('0x34')]['limit']);_0x5a994c['offset']=qs[_0xe710('0x1e')](_0x115419[_0xe710('0x34')][_0xe710('0x1e')]);}return _0x1af8f4['getConfigurations'](_0x5a994c);}})[_0xe710('0x27')](function(_0x5c86ff){if(_0x5c86ff){return _0x5c86ff?{'count':_0x3c187f,'rows':_0x5c86ff}:null;}})[_0xe710('0x27')](respondWithResult(_0x5f263b,null))['catch'](handleError(_0x5f263b,null));};exports['addConfiguration']=function(_0x375783,_0x498a58,_0x5e79fd){if(_0x375783[_0xe710('0x4a')]['id']){delete _0x375783[_0xe710('0x4a')]['id'];}return db['FreshdeskAccount'][_0xe710('0x4d')]({'where':{'id':_0x375783[_0xe710('0x48')]['id']}})[_0xe710('0x27')](handleEntityNotFound(_0x498a58,null))['then'](function(_0x177a96){if(_0x177a96){_0x375783['body'][_0xe710('0x51')]=_0x177a96['id'];_0x375783[_0xe710('0x4a')][_0xe710('0x52')]=integrations[_0xe710('0x53')](_0x375783[_0xe710('0x4a')][_0xe710('0x54')],_0x375783[_0xe710('0x4a')]['type']);_0x375783['body'][_0xe710('0x55')]=integrations[_0xe710('0x56')](_0x375783[_0xe710('0x4a')]['channel'],_0x375783[_0xe710('0x4a')][_0xe710('0x31')]);return db[_0xe710('0x4e')][_0xe710('0x57')](_0x375783['body'],{'include':[{'model':db[_0xe710('0x58')],'as':_0xe710('0x52')},{'model':db[_0xe710('0x58')],'as':_0xe710('0x55')}]});}return null;})[_0xe710('0x27')](respondWithResult(_0x498a58,null))[_0xe710('0x46')](handleError(_0x498a58,null));};exports[_0xe710('0x59')]=function(_0x13703a,_0x9a8415,_0x12fe79){var _0xe3b166='';return db[_0xe710('0x2e')]['findOne']({'where':{'id':_0x13703a[_0xe710('0x48')]['id']},'attributes':['id',_0xe710('0x5a'),'apiKey']})[_0xe710('0x27')](handleEntityNotFound(_0x9a8415,null))[_0xe710('0x27')](function(_0x5d875f){if(_0x5d875f){_0xe3b166=_0x5d875f[_0xe710('0x5a')];var _0x2a8b56=_0xe3b166['slice'](-0x1);if(_0x2a8b56==='/'){_0xe3b166=_0xe3b166[_0xe710('0x5b')](0x0,_0xe3b166[_0xe710('0x5c')](_0x2a8b56));}return rp({'method':'GET','uri':util[_0xe710('0x5d')](_0xe710('0x5e'),_0xe3b166,_0xe710('0x5f')),'headers':{'Authorization':util[_0xe710('0x5d')](_0xe710('0x60'),new Buffer(util['format']('%s:X',_0x5d875f[_0xe710('0x61')]))[_0xe710('0x62')](_0xe710('0x63')))},'json':!![]});}})[_0xe710('0x27')](function(_0xbd9313){if(_0xbd9313){var _0x3408eb=[_0xe710('0x64'),'subject','agent',_0xe710('0x65'),'status','priority',_0xe710('0x66'),'source',_0xe710('0x67'),_0xe710('0x66'),'company'];_['remove'](_0xbd9313,function(_0x36f152){return _0x3408eb['includes'](_0x36f152['name'])||!_0x36f152[_0xe710('0x68')]&&_0x36f152[_0xe710('0x31')]!==_0xe710('0x69')&&_0x36f152[_0xe710('0x31')]!==_0xe710('0x6a');});return{'count':_0xbd9313[_0xe710('0x39')],'rows':_[_0xe710('0x2d')](_0xbd9313,function(_0x18572e){return{'id':_0x18572e[_0xe710('0x2a')],'name':_0x18572e[_0xe710('0x6b')],'custom':!_0x18572e[_0xe710('0x68')],'options':_0x18572e[_0xe710('0x6c')]?_['map'](_0x18572e[_0xe710('0x6c')],function(_0x377fe5){return{'name':_['capitalize'](_0x377fe5),'value':_0x377fe5};}):[]};})};}})['then'](respondWithResult(_0x9a8415,null))[_0xe710('0x46')](function(_0x5364c9){var _0x70d3a=_0x13703a[_0xe710('0x34')][_0xe710('0x6d')]?0x1f4:_0x5364c9[_0xe710('0x6e')]||0x1f4;logger['error'](_0xe710('0x6f'),_0xe710('0x59'),_0x70d3a,JSON[_0xe710('0x70')](_0x5364c9));delete _0x5364c9['name'];if(_0x70d3a===0x191){_0x70d3a=0x190;}_0x9a8415[_0xe710('0x1b')](_0x70d3a)[_0xe710('0x2b')](_0x13703a[_0xe710('0x34')][_0xe710('0x6d')]?{'message':_0xe710('0x71'),'statusCode':_0x5364c9[_0xe710('0x6e')]}:_0x5364c9);});}; \ No newline at end of file +var _0xe706=['create','body','catch','params','getConfigurations','findOne','FreshdeskConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','FreshdeskAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find'];(function(_0x38651d,_0x5ca1bc){var _0x3f4c9b=function(_0x553aa1){while(--_0x553aa1){_0x38651d['push'](_0x38651d['shift']());}};_0x3f4c9b(++_0x5ca1bc);}(_0xe706,0xa3));var _0x6e70=function(_0x4080dd,_0x5b595d){_0x4080dd=_0x4080dd-0x0;var _0x4ecf85=_0xe706[_0x4080dd];return _0x4ecf85;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));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('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];var integrations=require(_0x6e70('0x1d'));function respondWithStatusCode(_0x3b38f3,_0x310eb7){_0x310eb7=_0x310eb7||0xcc;return function(_0xa1eb74){if(_0xa1eb74){return _0x3b38f3[_0x6e70('0x1e')](_0x310eb7);}return _0x3b38f3['status'](_0x310eb7)['end']();};}function respondWithResult(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xc8;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['status'](_0x257e81)[_0x6e70('0x1f')](_0x5a37a6);}};}function respondWithFilteredResult(_0x22c50c,_0x5d9263){return function(_0x24f3ac){if(_0x24f3ac){var _0x5c3fe7=typeof _0x5d9263[_0x6e70('0x20')]===_0x6e70('0x21')&&typeof _0x5d9263['limit']==='undefined';var _0x3bd572=_0x24f3ac['count'];var _0x28a21f=_0x5c3fe7?0x0:_0x5d9263[_0x6e70('0x20')];var _0x53acdc=_0x5c3fe7?_0x24f3ac['count']:_0x5d9263[_0x6e70('0x20')]+_0x5d9263[_0x6e70('0x22')];var _0x2368eb;if(_0x53acdc>=_0x3bd572){_0x53acdc=_0x3bd572;_0x2368eb=0xc8;}else{_0x2368eb=0xce;}_0x22c50c[_0x6e70('0x23')](_0x2368eb);return _0x22c50c[_0x6e70('0x24')](_0x6e70('0x25'),_0x28a21f+'-'+_0x53acdc+'/'+_0x3bd572)[_0x6e70('0x1f')](_0x24f3ac);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x26')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x27')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x28')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x29')](_0x27b294)[_0x6e70('0x2a')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2a')](function(){_0x10fc91[_0x6e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x1e')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2b')]);if(_0x4a67ac[_0x6e70('0x2c')]){delete _0x4a67ac[_0x6e70('0x2c')];}_0x67fb43[_0x6e70('0x23')](_0x2bb231)[_0x6e70('0x2d')](_0x4a67ac);};}exports['index']=function(_0x1952ea,_0x406f29){var _0xecf336={},_0x2864a0={},_0x396a67={'count':0x0,'rows':[]};var _0x20a225=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a5d30){return{'name':_0x3a5d30['fieldName'],'type':_0x3a5d30[_0x6e70('0x31')]['key']};});_0x2864a0[_0x6e70('0x32')]=_['map'](_0x20a225,_0x6e70('0x2c'));_0x2864a0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1952ea['query']);_0x2864a0[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x2864a0['model'],_0x2864a0[_0x6e70('0x33')]);_0xecf336[_0x6e70('0x37')]=_['intersection'](_0x2864a0[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x38')]));_0xecf336[_0x6e70('0x37')]=_0xecf336[_0x6e70('0x37')][_0x6e70('0x39')]?_0xecf336[_0x6e70('0x37')]:_0x2864a0[_0x6e70('0x32')];if(!_0x1952ea[_0x6e70('0x33')]['hasOwnProperty'](_0x6e70('0x3a'))){_0xecf336['limit']=qs[_0x6e70('0x22')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x22')]);_0xecf336[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x20')]);}_0xecf336[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3c')]);_0xecf336[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_['pick'](_0x1952ea['query'],_0x2864a0['filters']),_0x20a225);if(_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]){_0xecf336[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0xecf336[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x20a225,function(_0x572a71){if(_0x572a71[_0x6e70('0x31')]!==_0x6e70('0x40')){var _0x1c5cde={};_0x1c5cde[_0x572a71[_0x6e70('0x2c')]]={'$like':'%'+_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]+'%'};return _0x1c5cde;}})});}_0xecf336=_[_0x6e70('0x3f')]({},_0xecf336,_0x1952ea[_0x6e70('0x41')]);var _0x5be100={'where':_0xecf336[_0x6e70('0x3d')]};return db[_0x6e70('0x2f')][_0x6e70('0x42')](_0x5be100)[_0x6e70('0x2a')](function(_0x201da9){_0x396a67[_0x6e70('0x42')]=_0x201da9;if(_0x1952ea[_0x6e70('0x33')]['includeAll']){_0xecf336['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x6e70('0x43')](_0xecf336);})[_0x6e70('0x2a')](function(_0x83847b){_0x396a67[_0x6e70('0x44')]=_0x83847b;return _0x396a67;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x406f29,_0xecf336))['catch'](handleError(_0x406f29,null));};exports[_0x6e70('0x45')]=function(_0x2a58d7,_0x2a2aca){var _0x52b197={'raw':![],'where':{'id':_0x2a58d7['params']['id']}},_0x544ad0={};_0x544ad0[_0x6e70('0x32')]=_['keys'](db[_0x6e70('0x2f')][_0x6e70('0x30')]);_0x544ad0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x2a58d7['query']);_0x544ad0[_0x6e70('0x35')]=_['intersection'](_0x544ad0[_0x6e70('0x32')],_0x544ad0[_0x6e70('0x33')]);_0x52b197[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x544ad0['model'],qs[_0x6e70('0x38')](_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x38')]));_0x52b197[_0x6e70('0x37')]=_0x52b197[_0x6e70('0x37')][_0x6e70('0x39')]?_0x52b197[_0x6e70('0x37')]:_0x544ad0['model'];if(_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x46')]){_0x52b197[_0x6e70('0x47')]=[{'all':!![]}];}_0x52b197=_[_0x6e70('0x3f')]({},_0x52b197,_0x2a58d7[_0x6e70('0x41')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x52b197)['then'](handleEntityNotFound(_0x2a2aca,null))[_0x6e70('0x2a')](respondWithResult(_0x2a2aca,null))['catch'](handleError(_0x2a2aca,null));};exports[_0x6e70('0x49')]=function(_0x3836e4,_0x4b351e){return db['FreshdeskAccount'][_0x6e70('0x49')](_0x3836e4[_0x6e70('0x4a')],{})[_0x6e70('0x2a')](respondWithResult(_0x4b351e,0xc9))['catch'](handleError(_0x4b351e,null));};exports['update']=function(_0x238ebb,_0x11ac3d){if(_0x238ebb[_0x6e70('0x4a')]['id']){delete _0x238ebb[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x238ebb['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11ac3d,null))[_0x6e70('0x2a')](saveUpdates(_0x238ebb[_0x6e70('0x4a')],null))[_0x6e70('0x2a')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['destroy']=function(_0x4ae901,_0x2c5538){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4ae901[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2c5538,null))['then'](removeEntity(_0x2c5538,null))[_0x6e70('0x4b')](handleError(_0x2c5538,null));};exports[_0x6e70('0x4d')]=function(_0x1fa320,_0x23ebfb,_0x3aba34){var _0x4a111a={};var _0x1142cd={};var _0x1dd242;var _0x2c20d3;return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x1fa320[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23ebfb,null))[_0x6e70('0x2a')](function(_0x8d425d){if(_0x8d425d){_0x1dd242=_0x8d425d;_0x1142cd['model']=_[_0x6e70('0x34')](db[_0x6e70('0x4f')]['rawAttributes']);_0x1142cd[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1fa320[_0x6e70('0x33')]);_0x1142cd[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1142cd['model'],_0x1142cd[_0x6e70('0x33')]);_0x4a111a[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x1142cd[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x38')]));_0x4a111a[_0x6e70('0x37')]=_0x4a111a[_0x6e70('0x37')][_0x6e70('0x39')]?_0x4a111a[_0x6e70('0x37')]:_0x1142cd[_0x6e70('0x32')];_0x4a111a[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x4a111a[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_[_0x6e70('0x50')](_0x1fa320[_0x6e70('0x33')],_0x1142cd['filters']));if(_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3e')]){_0x4a111a[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0x4a111a[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x4a111a['attributes'],function(_0x42bd85){var _0x6cabf0={};_0x6cabf0[_0x42bd85]={'$like':'%'+_0x1fa320['query'][_0x6e70('0x3e')]+'%'};return _0x6cabf0;})});}_0x4a111a=_[_0x6e70('0x3f')]({},_0x4a111a,_0x1fa320[_0x6e70('0x41')]);return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2f9be4){if(_0x2f9be4){_0x2c20d3=_0x2f9be4[_0x6e70('0x39')];if(!_0x1fa320[_0x6e70('0x33')][_0x6e70('0x51')](_0x6e70('0x3a'))){_0x4a111a[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x1fa320['query']['limit']);_0x4a111a[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x20')]);}return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2e972b){if(_0x2e972b){return _0x2e972b?{'count':_0x2c20d3,'rows':_0x2e972b}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x23ebfb,null))['catch'](handleError(_0x23ebfb,null));};exports['addConfiguration']=function(_0x355708,_0x47fbed,_0x2a8fb7){if(_0x355708[_0x6e70('0x4a')]['id']){delete _0x355708[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x355708[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x47fbed,null))[_0x6e70('0x2a')](function(_0x570115){if(_0x570115){_0x355708[_0x6e70('0x4a')][_0x6e70('0x52')]=_0x570115['id'];_0x355708[_0x6e70('0x4a')][_0x6e70('0x53')]=integrations[_0x6e70('0x54')](_0x355708['body']['channel'],_0x355708['body'][_0x6e70('0x31')]);_0x355708[_0x6e70('0x4a')][_0x6e70('0x55')]=integrations['getDescriptions'](_0x355708['body'][_0x6e70('0x56')],_0x355708[_0x6e70('0x4a')][_0x6e70('0x31')]);return db[_0x6e70('0x4f')][_0x6e70('0x49')](_0x355708[_0x6e70('0x4a')],{'include':[{'model':db['FreshdeskField'],'as':_0x6e70('0x53')},{'model':db[_0x6e70('0x57')],'as':_0x6e70('0x55')}]});}return null;})[_0x6e70('0x2a')](respondWithResult(_0x47fbed,null))['catch'](handleError(_0x47fbed,null));};exports[_0x6e70('0x58')]=function(_0x531097,_0x5b4046,_0x30487b){var _0x3249a5='';return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x531097[_0x6e70('0x4c')]['id']},'attributes':['id',_0x6e70('0x59'),'apiKey']})[_0x6e70('0x2a')](handleEntityNotFound(_0x5b4046,null))[_0x6e70('0x2a')](function(_0x186550){if(_0x186550){_0x3249a5=_0x186550[_0x6e70('0x59')];var _0x20f977=_0x3249a5[_0x6e70('0x5a')](-0x1);if(_0x20f977==='/'){_0x3249a5=_0x3249a5[_0x6e70('0x5b')](0x0,_0x3249a5[_0x6e70('0x5c')](_0x20f977));}return rp({'method':_0x6e70('0x5d'),'uri':util[_0x6e70('0x5e')]('%s/%s',_0x3249a5,_0x6e70('0x5f')),'headers':{'Authorization':util[_0x6e70('0x5e')](_0x6e70('0x60'),new Buffer(util['format']('%s:X',_0x186550[_0x6e70('0x61')]))[_0x6e70('0x62')](_0x6e70('0x63')))},'json':!![]});}})[_0x6e70('0x2a')](function(_0x5a3dcb){if(_0x5a3dcb){var _0x4ec29a=['requester',_0x6e70('0x64'),_0x6e70('0x65'),'description',_0x6e70('0x23'),_0x6e70('0x66'),_0x6e70('0x67'),_0x6e70('0x68'),_0x6e70('0x69'),_0x6e70('0x67'),_0x6e70('0x6a')];_[_0x6e70('0x6b')](_0x5a3dcb,function(_0x3650e9){return _0x4ec29a[_0x6e70('0x6c')](_0x3650e9[_0x6e70('0x2c')])||!_0x3650e9[_0x6e70('0x6d')]&&_0x3650e9[_0x6e70('0x31')]!==_0x6e70('0x6e')&&_0x3650e9['type']!=='custom_dropdown';});return{'count':_0x5a3dcb[_0x6e70('0x39')],'rows':_['map'](_0x5a3dcb,function(_0x267dcb){return{'id':_0x267dcb['name'],'name':_0x267dcb['label'],'custom':!_0x267dcb[_0x6e70('0x6d')],'options':_0x267dcb['choices']?_['map'](_0x267dcb[_0x6e70('0x6f')],function(_0x21e4c2){return{'name':_[_0x6e70('0x70')](_0x21e4c2),'value':_0x21e4c2};}):[]};})};}})['then'](respondWithResult(_0x5b4046,null))['catch'](function(_0x5ec8e5){var _0x3e7be7=_0x531097['query'][_0x6e70('0x71')]?0x1f4:_0x5ec8e5[_0x6e70('0x72')]||0x1f4;logger[_0x6e70('0x73')](_0x6e70('0x74'),_0x6e70('0x58'),_0x3e7be7,JSON[_0x6e70('0x75')](_0x5ec8e5));delete _0x5ec8e5[_0x6e70('0x2c')];if(_0x3e7be7===0x191){_0x3e7be7=0x190;}_0x5b4046['status'](_0x3e7be7)[_0x6e70('0x2d')](_0x531097[_0x6e70('0x33')][_0x6e70('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x5ec8e5[_0x6e70('0x72')]}:_0x5ec8e5);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 04e4e2d..8041cc8 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 _0x146a=['request-promise','rimraf','../../config/environment','exports','define','FreshdeskAccount','int_freshdesk_accounts','api','moment','bluebird'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x146a,0x1c9));var _0xa146=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x146a[_0x5c351c];return _0x26f3b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa146('0x0'));var moment=require(_0xa146('0x1'));var BPromise=require(_0xa146('0x2'));var rp=require(_0xa146('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa146('0x4'));var config=require(_0xa146('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa146('0x6')]=function(_0x221bf6,_0x7087a4){return _0x221bf6[_0xa146('0x7')](_0xa146('0x8'),attributes,{'tableName':_0xa146('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x237b=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x324301,_0x35aa10){var _0x171d8d=function(_0x517080){while(--_0x517080){_0x324301['push'](_0x324301['shift']());}};_0x171d8d(++_0x35aa10);}(_0x237b,0x161));var _0xb237=function(_0x107002,_0x5c760c){_0x107002=_0x107002-0x0;var _0x166c69=_0x237b[_0x107002];return _0x166c69;};'use strict';var _=require('lodash');var util=require(_0xb237('0x0'));var logger=require(_0xb237('0x1'))(_0xb237('0x2'));var moment=require(_0xb237('0x3'));var BPromise=require(_0xb237('0x4'));var rp=require(_0xb237('0x5'));var fs=require('fs');var path=require(_0xb237('0x6'));var rimraf=require(_0xb237('0x7'));var config=require(_0xb237('0x8'));var attributes=require(_0xb237('0x9'));var integrations=require(_0xb237('0xa'));module[_0xb237('0xb')]=function(_0x2e741c,_0x16d674){return _0x2e741c[_0xb237('0xc')](_0xb237('0xd'),attributes,{'tableName':_0xb237('0xe'),'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 6a37f5a..3691d7b 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 _0xabe5=['error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','moment','bluebird','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16b1e3,_0x2f1cd9){var _0x14d565=function(_0x58b810){while(--_0x58b810){_0x16b1e3['push'](_0x16b1e3['shift']());}};_0x14d565(++_0x2f1cd9);}(_0xabe5,0x1c3));var _0x5abe=function(_0x25a386,_0x2266dc){_0x25a386=_0x25a386-0x0;var _0x4ff877=_0xabe5[_0x25a386];return _0x4ff877;};'use strict';var _=require(_0x5abe('0x0'));var util=require('util');var moment=require(_0x5abe('0x1'));var BPromise=require(_0x5abe('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('../../config/logger')('rpc');var config=require(_0x5abe('0x3'));var jayson=require(_0x5abe('0x4'));var client=jayson[_0x5abe('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447035,_0x4a3cb7,_0x17960f){return new BPromise(function(_0x5cedea,_0x3ebfa7){return client[_0x5abe('0x6')](_0x447035,_0x17960f)[_0x5abe('0x7')](function(_0x30faf2){logger[_0x5abe('0x8')](_0x5abe('0x9'),_0x4a3cb7,_0x5abe('0xa'));logger[_0x5abe('0xb')](_0x5abe('0xc'),_0x4a3cb7,_0x5abe('0xa'),JSON[_0x5abe('0xd')](_0x30faf2));if(_0x30faf2[_0x5abe('0xe')]){if(_0x30faf2[_0x5abe('0xe')][_0x5abe('0xf')]===0x1f4){logger[_0x5abe('0xe')](_0x5abe('0x9'),_0x4a3cb7,_0x30faf2[_0x5abe('0xe')][_0x5abe('0x10')]);return _0x3ebfa7(_0x30faf2[_0x5abe('0xe')][_0x5abe('0x10')]);}logger['error'](_0x5abe('0x9'),_0x4a3cb7,_0x30faf2['error']['message']);return _0x5cedea(_0x30faf2[_0x5abe('0xe')][_0x5abe('0x10')]);}else{logger[_0x5abe('0x8')]('FreshdeskAccount,\x20%s,\x20%s',_0x4a3cb7,_0x5abe('0xa'));_0x5cedea(_0x30faf2[_0x5abe('0x11')][_0x5abe('0x10')]);}})[_0x5abe('0x12')](function(_0x1237e3){logger[_0x5abe('0xe')](_0x5abe('0x9'),_0x4a3cb7,_0x1237e3);_0x3ebfa7(_0x1237e3);});});}exports['GetFreshdeskAccount']=function(_0x3ea97c){var _0x14b8e3=this;return new Promise(function(_0x2f2b4a,_0x28a38a){return db[_0x5abe('0x13')][_0x5abe('0x14')]({'raw':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c[_0x5abe('0x15')][_0x5abe('0x16')]===undefined?!![]:![]:!![],'where':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c['options'][_0x5abe('0x17')]||null:null,'attributes':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c[_0x5abe('0x15')][_0x5abe('0x18')]||null:null,'limit':_0x3ea97c[_0x5abe('0x15')]?_0x3ea97c[_0x5abe('0x15')]['limit']||null:null,'include':_0x3ea97c['options']?_0x3ea97c[_0x5abe('0x15')]['include']?_['map'](_0x3ea97c[_0x5abe('0x15')][_0x5abe('0x19')],function(_0x3c821b){return{'model':db[_0x3c821b[_0x5abe('0x1a')]],'as':_0x3c821b['as'],'attributes':_0x3c821b[_0x5abe('0x18')],'include':_0x3c821b[_0x5abe('0x19')]?_[_0x5abe('0x1b')](_0x3c821b[_0x5abe('0x19')],function(_0x3a48b0){return{'model':db[_0x3a48b0['model']],'as':_0x3a48b0['as'],'attributes':_0x3a48b0[_0x5abe('0x18')],'include':_0x3a48b0['include']?_[_0x5abe('0x1b')](_0x3a48b0[_0x5abe('0x19')],function(_0x1b82ed){return{'model':db[_0x1b82ed[_0x5abe('0x1a')]],'as':_0x1b82ed['as'],'attributes':_0x1b82ed[_0x5abe('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5abe('0x7')](function(_0x4841c4){logger[_0x5abe('0x8')](_0x5abe('0x1c'),_0x3ea97c);logger[_0x5abe('0xb')]('GetFreshdeskAccount',_0x3ea97c,JSON[_0x5abe('0xd')](_0x4841c4));_0x2f2b4a(_0x4841c4);})['catch'](function(_0x41f35f){logger[_0x5abe('0xe')](_0x5abe('0x1c'),_0x41f35f[_0x5abe('0x10')],_0x3ea97c);_0x28a38a(_0x14b8e3['error'](0x1f4,_0x41f35f['message']));});});};exports['ShowFreshdeskAccount']=function(_0x55dede){var _0x329875=this;return new Promise(function(_0x428025,_0x300dfb){return db['FreshdeskAccount'][_0x5abe('0x1d')]({'raw':_0x55dede['options']?_0x55dede[_0x5abe('0x15')][_0x5abe('0x16')]===undefined?!![]:![]:!![],'where':_0x55dede[_0x5abe('0x15')]?_0x55dede[_0x5abe('0x15')][_0x5abe('0x17')]||null:null,'attributes':_0x55dede[_0x5abe('0x15')]?_0x55dede['options'][_0x5abe('0x18')]||null:null,'include':_0x55dede[_0x5abe('0x15')]?_0x55dede[_0x5abe('0x15')]['include']?_[_0x5abe('0x1b')](_0x55dede[_0x5abe('0x15')][_0x5abe('0x19')],function(_0x3d457e){return{'model':db[_0x3d457e[_0x5abe('0x1a')]],'as':_0x3d457e['as'],'attributes':_0x3d457e['attributes'],'include':_0x3d457e[_0x5abe('0x19')]?_['map'](_0x3d457e[_0x5abe('0x19')],function(_0x57ee69){return{'model':db[_0x57ee69[_0x5abe('0x1a')]],'as':_0x57ee69['as'],'attributes':_0x57ee69[_0x5abe('0x18')],'include':_0x57ee69['include']?_[_0x5abe('0x1b')](_0x57ee69['include'],function(_0x54d7ee){return{'model':db[_0x54d7ee['model']],'as':_0x54d7ee['as'],'attributes':_0x54d7ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x5abe('0x7')](function(_0x8f8e9){logger[_0x5abe('0x8')](_0x5abe('0x1e'),_0x55dede);logger['debug'](_0x5abe('0x1e'),_0x55dede,JSON[_0x5abe('0xd')](_0x8f8e9));_0x428025(_0x8f8e9);})[_0x5abe('0x12')](function(_0x53cb0f){logger['error'](_0x5abe('0x1e'),_0x53cb0f[_0x5abe('0x10')],_0x55dede);_0x300dfb(_0x329875[_0x5abe('0xe')](0x1f4,_0x53cb0f[_0x5abe('0x10')]));});});}; \ No newline at end of file +var _0x0447=['ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshdeskAccount'];(function(_0x43393c,_0x840fd7){var _0x4125ef=function(_0x10f7fd){while(--_0x10f7fd){_0x43393c['push'](_0x43393c['shift']());}};_0x4125ef(++_0x840fd7);}(_0x0447,0x1f0));var _0x7044=function(_0xb13d17,_0x1cd499){_0xb13d17=_0xb13d17-0x0;var _0x23c99e=_0x0447[_0xb13d17];return _0x23c99e;};'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(_0x7044('0x5'));var db=require(_0x7044('0x6'))['db'];var utils=require(_0x7044('0x7'));var logger=require('../../config/logger')(_0x7044('0x8'));var config=require(_0x7044('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7044('0xa')][_0x7044('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59f497,_0x372946,_0x22cc85){return new BPromise(function(_0x47152c,_0x55d0b5){return client[_0x7044('0xc')](_0x59f497,_0x22cc85)[_0x7044('0xd')](function(_0x52372e){logger['info'](_0x7044('0xe'),_0x372946,'request\x20sent');logger[_0x7044('0xf')](_0x7044('0x10'),_0x372946,_0x7044('0x11'),JSON[_0x7044('0x12')](_0x52372e));if(_0x52372e['error']){if(_0x52372e['error'][_0x7044('0x13')]===0x1f4){logger[_0x7044('0x14')](_0x7044('0xe'),_0x372946,_0x52372e['error']['message']);return _0x55d0b5(_0x52372e['error']['message']);}logger[_0x7044('0x14')](_0x7044('0xe'),_0x372946,_0x52372e[_0x7044('0x14')][_0x7044('0x15')]);return _0x47152c(_0x52372e[_0x7044('0x14')][_0x7044('0x15')]);}else{logger[_0x7044('0x16')](_0x7044('0xe'),_0x372946,_0x7044('0x11'));_0x47152c(_0x52372e[_0x7044('0x17')][_0x7044('0x15')]);}})[_0x7044('0x18')](function(_0x5a0357){logger[_0x7044('0x14')](_0x7044('0xe'),_0x372946,_0x5a0357);_0x55d0b5(_0x5a0357);});});}exports['GetFreshdeskAccount']=function(_0x26c6ab){var _0x3e5c1e=this;return new Promise(function(_0x6609ee,_0xc99ba7){return db[_0x7044('0x19')][_0x7044('0x1a')]({'raw':_0x26c6ab[_0x7044('0x1b')]?_0x26c6ab[_0x7044('0x1b')][_0x7044('0x1c')]===undefined?!![]:![]:!![],'where':_0x26c6ab[_0x7044('0x1b')]?_0x26c6ab[_0x7044('0x1b')][_0x7044('0x1d')]||null:null,'attributes':_0x26c6ab[_0x7044('0x1b')]?_0x26c6ab[_0x7044('0x1b')][_0x7044('0x1e')]||null:null,'limit':_0x26c6ab[_0x7044('0x1b')]?_0x26c6ab[_0x7044('0x1b')][_0x7044('0x1f')]||null:null,'include':_0x26c6ab['options']?_0x26c6ab[_0x7044('0x1b')]['include']?_['map'](_0x26c6ab[_0x7044('0x1b')][_0x7044('0x20')],function(_0x42b1a9){return{'model':db[_0x42b1a9[_0x7044('0x21')]],'as':_0x42b1a9['as'],'attributes':_0x42b1a9['attributes'],'include':_0x42b1a9[_0x7044('0x20')]?_[_0x7044('0x22')](_0x42b1a9[_0x7044('0x20')],function(_0x313b60){return{'model':db[_0x313b60[_0x7044('0x21')]],'as':_0x313b60['as'],'attributes':_0x313b60[_0x7044('0x1e')],'include':_0x313b60[_0x7044('0x20')]?_[_0x7044('0x22')](_0x313b60['include'],function(_0x5aade0){return{'model':db[_0x5aade0[_0x7044('0x21')]],'as':_0x5aade0['as'],'attributes':_0x5aade0[_0x7044('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7044('0xd')](function(_0x57c376){logger[_0x7044('0x16')](_0x7044('0x23'),_0x26c6ab);logger[_0x7044('0xf')](_0x7044('0x23'),_0x26c6ab,JSON['stringify'](_0x57c376));_0x6609ee(_0x57c376);})['catch'](function(_0x3113f5){logger[_0x7044('0x14')](_0x7044('0x23'),_0x3113f5[_0x7044('0x15')],_0x26c6ab);_0xc99ba7(_0x3e5c1e[_0x7044('0x14')](0x1f4,_0x3113f5['message']));});});};exports[_0x7044('0x24')]=function(_0x568672){var _0x3b11e2=this;return new Promise(function(_0x5b986d,_0x10d177){return db[_0x7044('0x19')][_0x7044('0x25')]({'raw':_0x568672[_0x7044('0x1b')]?_0x568672[_0x7044('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x568672[_0x7044('0x1b')]?_0x568672[_0x7044('0x1b')][_0x7044('0x1d')]||null:null,'attributes':_0x568672['options']?_0x568672[_0x7044('0x1b')][_0x7044('0x1e')]||null:null,'include':_0x568672[_0x7044('0x1b')]?_0x568672['options'][_0x7044('0x20')]?_[_0x7044('0x22')](_0x568672['options'][_0x7044('0x20')],function(_0x4532d2){return{'model':db[_0x4532d2[_0x7044('0x21')]],'as':_0x4532d2['as'],'attributes':_0x4532d2[_0x7044('0x1e')],'include':_0x4532d2[_0x7044('0x20')]?_[_0x7044('0x22')](_0x4532d2[_0x7044('0x20')],function(_0x5360f1){return{'model':db[_0x5360f1['model']],'as':_0x5360f1['as'],'attributes':_0x5360f1[_0x7044('0x1e')],'include':_0x5360f1['include']?_[_0x7044('0x22')](_0x5360f1[_0x7044('0x20')],function(_0x32db08){return{'model':db[_0x32db08['model']],'as':_0x32db08['as'],'attributes':_0x32db08['attributes']};}):[]};}):[]};}):[]:[]})[_0x7044('0xd')](function(_0x2b1458){logger[_0x7044('0x16')]('ShowFreshdeskAccount',_0x568672);logger[_0x7044('0xf')](_0x7044('0x24'),_0x568672,JSON[_0x7044('0x12')](_0x2b1458));_0x5b986d(_0x2b1458);})[_0x7044('0x18')](function(_0x208ef6){logger[_0x7044('0x14')]('ShowFreshdeskAccount',_0x208ef6[_0x7044('0x15')],_0x568672);_0x10d177(_0x3b11e2[_0x7044('0x14')](0x1f4,_0x208ef6['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d2d18db..e70cbda 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 _0xdb02=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','setTags','delete','destroy','exports','path','connect-timeout'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xdb02,0xad));var _0x2db0=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xdb02[_0x233cb1];return _0x29ee7e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2db0('0x0'));var timeout=require(_0x2db0('0x1'));var express=require('express');var router=express[_0x2db0('0x2')]();var fs_extra=require(_0x2db0('0x3'));var auth=require(_0x2db0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2db0('0x5'));var controller=require(_0x2db0('0x6'));router['get']('/',auth[_0x2db0('0x7')](),controller[_0x2db0('0x8')]);router['get'](_0x2db0('0x9'),auth[_0x2db0('0x7')](),controller[_0x2db0('0xa')]);router[_0x2db0('0xb')](_0x2db0('0xc'),auth['isAuthenticated'](),controller[_0x2db0('0xd')]);router['get'](_0x2db0('0xe'),auth[_0x2db0('0x7')](),controller[_0x2db0('0xf')]);router[_0x2db0('0xb')](_0x2db0('0x10'),auth[_0x2db0('0x7')](),controller[_0x2db0('0x11')]);router[_0x2db0('0xb')](_0x2db0('0x12'),auth[_0x2db0('0x7')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x2db0('0x13')]);router[_0x2db0('0x14')](_0x2db0('0x12'),auth[_0x2db0('0x7')](),controller[_0x2db0('0x15')]);router['put'](_0x2db0('0x9'),auth[_0x2db0('0x7')](),controller['update']);router[_0x2db0('0x16')](_0x2db0('0x9'),auth[_0x2db0('0x7')](),controller[_0x2db0('0x17')]);module[_0x2db0('0x18')]=router; \ No newline at end of file +var _0x0f79=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x0f79,0xc2));var _0x90f7=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x0f79[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0x90f7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x90f7('0x1'));var express=require(_0x90f7('0x2'));var router=express[_0x90f7('0x3')]();var fs_extra=require(_0x90f7('0x4'));var auth=require(_0x90f7('0x5'));var interaction=require(_0x90f7('0x6'));var config=require(_0x90f7('0x7'));var controller=require(_0x90f7('0x8'));router['get']('/',auth[_0x90f7('0x9')](),controller['index']);router[_0x90f7('0xa')](_0x90f7('0xb'),auth[_0x90f7('0x9')](),controller[_0x90f7('0xc')]);router['get'](_0x90f7('0xd'),auth[_0x90f7('0x9')](),controller[_0x90f7('0xe')]);router[_0x90f7('0xa')](_0x90f7('0xf'),auth[_0x90f7('0x9')](),controller['getSubjects']);router[_0x90f7('0xa')](_0x90f7('0x10'),auth[_0x90f7('0x9')](),controller[_0x90f7('0x11')]);router['get'](_0x90f7('0x12'),auth[_0x90f7('0x9')](),controller[_0x90f7('0x13')]);router[_0x90f7('0x14')]('/',auth[_0x90f7('0x9')](),controller[_0x90f7('0x15')]);router[_0x90f7('0x14')](_0x90f7('0x12'),auth['isAuthenticated'](),controller[_0x90f7('0x16')]);router[_0x90f7('0x17')](_0x90f7('0xb'),auth[_0x90f7('0x9')](),controller[_0x90f7('0x18')]);router[_0x90f7('0x19')]('/:id',auth[_0x90f7('0x9')](),controller[_0x90f7('0x1a')]);module[_0x90f7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 4b158f6..0a4a609 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 _0x3a59=['exports','sequelize'];(function(_0x44364d,_0x333a9d){var _0x71e785=function(_0x53df6f){while(--_0x53df6f){_0x44364d['push'](_0x44364d['shift']());}};_0x71e785(++_0x333a9d);}(_0x3a59,0x199));var _0x93a5=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x3a59[_0x5dfc2a];return _0x3f1a71;};'use strict';var Sequelize=require(_0x93a5('0x0'));module[_0x93a5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4969=['STRING','sequelize','exports'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x4969,0x19c));var _0x9496=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0x4969[_0x92713a];return _0x1893e1;};'use strict';var Sequelize=require(_0x9496('0x0'));module[_0x9496('0x1')]={'name':{'type':Sequelize[_0x9496('0x2')]},'description':{'type':Sequelize[_0x9496('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f40895e..d47c555 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 _0x3e10=['getFields','findOne','FreshdeskField','fields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshdeskConfiguration','include','findAll','rows','params','model','includeAll','catch','create','body'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x3e10,0x159));var _0x03e1=function(_0x585ab9,_0x599828){_0x585ab9=_0x585ab9-0x0;var _0x544b7d=_0x3e10[_0x585ab9];return _0x544b7d;};'use strict';var emlformat=require(_0x03e1('0x0'));var rimraf=require(_0x03e1('0x1'));var zipdir=require(_0x03e1('0x2'));var jsonpatch=require(_0x03e1('0x3'));var rp=require(_0x03e1('0x4'));var moment=require(_0x03e1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x03e1('0x6'));var util=require(_0x03e1('0x7'));var path=require(_0x03e1('0x8'));var sox=require('sox');var csv=require(_0x03e1('0x9'));var ejs=require(_0x03e1('0xa'));var fs=require('fs');var fs_extra=require(_0x03e1('0xb'));var _=require(_0x03e1('0xc'));var squel=require('squel');var crypto=require(_0x03e1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03e1('0xe'));var toCsv=require(_0x03e1('0x9'));var querystring=require(_0x03e1('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x03e1('0x10'));var qs=require(_0x03e1('0x11'));var as=require(_0x03e1('0x12'));var hardwareService=require(_0x03e1('0x13'));var logger=require(_0x03e1('0x14'))(_0x03e1('0x15'));var utils=require(_0x03e1('0x16'));var config=require(_0x03e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x03e1('0x18'))['db'];function respondWithStatusCode(_0x5ef2f0,_0x2a1caf){_0x2a1caf=_0x2a1caf||0xcc;return function(_0x20835e){if(_0x20835e){return _0x5ef2f0[_0x03e1('0x19')](_0x2a1caf);}return _0x5ef2f0['status'](_0x2a1caf)[_0x03e1('0x1a')]();};}function respondWithResult(_0x50bc8f,_0x857b93){_0x857b93=_0x857b93||0xc8;return function(_0xf06e8d){if(_0xf06e8d){return _0x50bc8f[_0x03e1('0x1b')](_0x857b93)['json'](_0xf06e8d);}};}function respondWithFilteredResult(_0x3b6653,_0x1bcc6d){return function(_0x2a21c3){if(_0x2a21c3){var _0x51d93d=typeof _0x1bcc6d[_0x03e1('0x1c')]===_0x03e1('0x1d')&&typeof _0x1bcc6d[_0x03e1('0x1e')]===_0x03e1('0x1d');var _0x268d97=_0x2a21c3[_0x03e1('0x1f')];var _0x5f4862=_0x51d93d?0x0:_0x1bcc6d[_0x03e1('0x1c')];var _0x1e8ee7=_0x51d93d?_0x2a21c3[_0x03e1('0x1f')]:_0x1bcc6d[_0x03e1('0x1c')]+_0x1bcc6d['limit'];var _0x589b69;if(_0x1e8ee7>=_0x268d97){_0x1e8ee7=_0x268d97;_0x589b69=0xc8;}else{_0x589b69=0xce;}_0x3b6653[_0x03e1('0x1b')](_0x589b69);return _0x3b6653['set'](_0x03e1('0x20'),_0x5f4862+'-'+_0x1e8ee7+'/'+_0x268d97)[_0x03e1('0x21')](_0x2a21c3);}return null;};}function patchUpdates(_0x34f3fe){return function(_0x2ef11b){try{jsonpatch[_0x03e1('0x22')](_0x2ef11b,_0x34f3fe,!![]);}catch(_0x14527b){return BPromise[_0x03e1('0x23')](_0x14527b);}return _0x2ef11b[_0x03e1('0x24')]();};}function saveUpdates(_0x924f78,_0x48a0cd){return function(_0x4bd7fb){if(_0x4bd7fb){return _0x4bd7fb[_0x03e1('0x25')](_0x924f78)[_0x03e1('0x26')](function(_0x4f4586){return _0x4f4586;});}return null;};}function removeEntity(_0xeee466,_0x4856be){return function(_0x44f4be){if(_0x44f4be){return _0x44f4be['destroy']()['then'](function(){_0xeee466[_0x03e1('0x1b')](0xcc)[_0x03e1('0x1a')]();});}};}function handleEntityNotFound(_0x20ad8e,_0xb32caa){return function(_0x173822){if(!_0x173822){_0x20ad8e[_0x03e1('0x19')](0x194);}return _0x173822;};}function handleError(_0x4eb3b0,_0x4f3e20){_0x4f3e20=_0x4f3e20||0x1f4;return function(_0x5df724){logger[_0x03e1('0x27')](_0x5df724[_0x03e1('0x28')]);if(_0x5df724[_0x03e1('0x29')]){delete _0x5df724[_0x03e1('0x29')];}_0x4eb3b0[_0x03e1('0x1b')](_0x4f3e20)[_0x03e1('0x2a')](_0x5df724);};}exports[_0x03e1('0x2b')]=function(_0x43d150,_0x39fcc5){var _0x27e250={},_0xaf137e={},_0x48c744={'count':0x0,'rows':[]};var _0x2fd3e4=_[_0x03e1('0x2c')](db['FreshdeskConfiguration'][_0x03e1('0x2d')],function(_0x37d7f1){return{'name':_0x37d7f1[_0x03e1('0x2e')],'type':_0x37d7f1[_0x03e1('0x2f')][_0x03e1('0x30')]};});_0xaf137e['model']=_[_0x03e1('0x2c')](_0x2fd3e4,_0x03e1('0x29'));_0xaf137e[_0x03e1('0x31')]=_[_0x03e1('0x32')](_0x43d150[_0x03e1('0x31')]);_0xaf137e[_0x03e1('0x33')]=_['intersection'](_0xaf137e['model'],_0xaf137e['query']);_0x27e250[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0xaf137e['model'],qs['fields'](_0x43d150['query']['fields']));_0x27e250[_0x03e1('0x34')]=_0x27e250['attributes'][_0x03e1('0x36')]?_0x27e250[_0x03e1('0x34')]:_0xaf137e['model'];if(!_0x43d150[_0x03e1('0x31')][_0x03e1('0x37')](_0x03e1('0x38'))){_0x27e250['limit']=qs['limit'](_0x43d150['query'][_0x03e1('0x1e')]);_0x27e250[_0x03e1('0x1c')]=qs[_0x03e1('0x1c')](_0x43d150[_0x03e1('0x31')]['offset']);}_0x27e250[_0x03e1('0x39')]=qs[_0x03e1('0x3a')](_0x43d150[_0x03e1('0x31')][_0x03e1('0x3a')]);_0x27e250['where']=qs['filters'](_[_0x03e1('0x3b')](_0x43d150[_0x03e1('0x31')],_0xaf137e[_0x03e1('0x33')]),_0x2fd3e4);if(_0x43d150[_0x03e1('0x31')][_0x03e1('0x3c')]){_0x27e250[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x27e250[_0x03e1('0x3d')],{'$or':_['map'](_0x2fd3e4,function(_0x4c3d7b){if(_0x4c3d7b[_0x03e1('0x2f')]!==_0x03e1('0x3f')){var _0x682f7={};_0x682f7[_0x4c3d7b[_0x03e1('0x29')]]={'$like':'%'+_0x43d150[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x682f7;}})});}_0x27e250=_[_0x03e1('0x3e')]({},_0x27e250,_0x43d150[_0x03e1('0x40')]);var _0x484348={'where':_0x27e250[_0x03e1('0x3d')]};return db[_0x03e1('0x41')][_0x03e1('0x1f')](_0x484348)[_0x03e1('0x26')](function(_0x3ca026){_0x48c744[_0x03e1('0x1f')]=_0x3ca026;if(_0x43d150[_0x03e1('0x31')]['includeAll']){_0x27e250[_0x03e1('0x42')]=[{'all':!![]}];}return db[_0x03e1('0x41')][_0x03e1('0x43')](_0x27e250);})[_0x03e1('0x26')](function(_0x1f4565){_0x48c744[_0x03e1('0x44')]=_0x1f4565;return _0x48c744;})[_0x03e1('0x26')](respondWithFilteredResult(_0x39fcc5,_0x27e250))['catch'](handleError(_0x39fcc5,null));};exports['show']=function(_0x206855,_0x191958){var _0x5aaf6f={'raw':![],'where':{'id':_0x206855[_0x03e1('0x45')]['id']}},_0x21a859={};_0x21a859['model']=_[_0x03e1('0x32')](db[_0x03e1('0x41')]['rawAttributes']);_0x21a859[_0x03e1('0x31')]=_['keys'](_0x206855[_0x03e1('0x31')]);_0x21a859[_0x03e1('0x33')]=_['intersection'](_0x21a859['model'],_0x21a859[_0x03e1('0x31')]);_0x5aaf6f[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0x21a859['model'],qs['fields'](_0x206855[_0x03e1('0x31')]['fields']));_0x5aaf6f['attributes']=_0x5aaf6f[_0x03e1('0x34')][_0x03e1('0x36')]?_0x5aaf6f['attributes']:_0x21a859[_0x03e1('0x46')];if(_0x206855[_0x03e1('0x31')][_0x03e1('0x47')]){_0x5aaf6f['include']=[{'all':!![]}];}_0x5aaf6f=_[_0x03e1('0x3e')]({},_0x5aaf6f,_0x206855[_0x03e1('0x40')]);return db[_0x03e1('0x41')]['find'](_0x5aaf6f)[_0x03e1('0x26')](handleEntityNotFound(_0x191958,null))['then'](respondWithResult(_0x191958,null))[_0x03e1('0x48')](handleError(_0x191958,null));};exports[_0x03e1('0x49')]=function(_0xdae597,_0x1fdc23){return db[_0x03e1('0x41')][_0x03e1('0x49')](_0xdae597[_0x03e1('0x4a')],{})[_0x03e1('0x26')](respondWithResult(_0x1fdc23,0xc9))[_0x03e1('0x48')](handleError(_0x1fdc23,null));};exports[_0x03e1('0x25')]=function(_0x231fdf,_0x2191da){if(_0x231fdf[_0x03e1('0x4a')]['id']){delete _0x231fdf['body']['id'];}return db[_0x03e1('0x41')]['find']({'where':{'id':_0x231fdf[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x2191da,null))[_0x03e1('0x26')](saveUpdates(_0x231fdf['body'],null))[_0x03e1('0x26')](respondWithResult(_0x2191da,null))[_0x03e1('0x48')](handleError(_0x2191da,null));};exports['destroy']=function(_0x4050cf,_0x3ec4db){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4050cf['params']['id']}})['then'](handleEntityNotFound(_0x3ec4db,null))['then'](removeEntity(_0x3ec4db,null))[_0x03e1('0x48')](handleError(_0x3ec4db,null));};exports[_0x03e1('0x4b')]=function(_0x3f8ae4,_0x2ead3f,_0x1e0ce3){var _0x5b369c={};var _0x529a8a={};var _0x1c04fa;var _0x31a681;return db[_0x03e1('0x41')][_0x03e1('0x4c')]({'where':{'id':_0x3f8ae4[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x2ead3f,null))['then'](function(_0x497175){if(_0x497175){_0x1c04fa=_0x497175;_0x529a8a[_0x03e1('0x46')]=_['keys'](db[_0x03e1('0x4d')][_0x03e1('0x2d')]);_0x529a8a[_0x03e1('0x31')]=_['keys'](_0x3f8ae4['query']);_0x529a8a[_0x03e1('0x33')]=_[_0x03e1('0x35')](_0x529a8a[_0x03e1('0x46')],_0x529a8a[_0x03e1('0x31')]);_0x5b369c[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0x529a8a[_0x03e1('0x46')],qs[_0x03e1('0x4e')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x4e')]));_0x5b369c[_0x03e1('0x34')]=_0x5b369c[_0x03e1('0x34')][_0x03e1('0x36')]?_0x5b369c['attributes']:_0x529a8a[_0x03e1('0x46')];_0x5b369c['order']=qs[_0x03e1('0x3a')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x3a')]);_0x5b369c['where']=qs['filters'](_[_0x03e1('0x3b')](_0x3f8ae4['query'],_0x529a8a[_0x03e1('0x33')]));if(_0x3f8ae4['query'][_0x03e1('0x3c')]){_0x5b369c[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x5b369c[_0x03e1('0x3d')],{'$or':_[_0x03e1('0x2c')](_0x5b369c[_0x03e1('0x34')],function(_0x29d003){var _0x244510={};_0x244510[_0x29d003]={'$like':'%'+_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x244510;})});}_0x5b369c=_[_0x03e1('0x3e')]({},_0x5b369c,_0x3f8ae4[_0x03e1('0x40')]);return _0x1c04fa[_0x03e1('0x4b')](_0x5b369c);}})[_0x03e1('0x26')](function(_0x39a538){if(_0x39a538){_0x31a681=_0x39a538[_0x03e1('0x36')];if(!_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x37')](_0x03e1('0x38'))){_0x5b369c[_0x03e1('0x1e')]=qs[_0x03e1('0x1e')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x1e')]);_0x5b369c[_0x03e1('0x1c')]=qs[_0x03e1('0x1c')](_0x3f8ae4[_0x03e1('0x31')][_0x03e1('0x1c')]);}return _0x1c04fa[_0x03e1('0x4b')](_0x5b369c);}})[_0x03e1('0x26')](function(_0x2e66b6){if(_0x2e66b6){return _0x2e66b6?{'count':_0x31a681,'rows':_0x2e66b6}:null;}})[_0x03e1('0x26')](respondWithResult(_0x2ead3f,null))['catch'](handleError(_0x2ead3f,null));};exports[_0x03e1('0x4f')]=function(_0xa4e26f,_0x26a8bd,_0x649301){var _0x2d9b56={};var _0x553f40={};var _0x175856;var _0x4e24af;return db[_0x03e1('0x41')][_0x03e1('0x4c')]({'where':{'id':_0xa4e26f['params']['id']}})['then'](handleEntityNotFound(_0x26a8bd,null))[_0x03e1('0x26')](function(_0x44a398){if(_0x44a398){_0x175856=_0x44a398;_0x553f40['model']=_['keys'](db[_0x03e1('0x4d')]['rawAttributes']);_0x553f40[_0x03e1('0x31')]=_[_0x03e1('0x32')](_0xa4e26f['query']);_0x553f40[_0x03e1('0x33')]=_[_0x03e1('0x35')](_0x553f40[_0x03e1('0x46')],_0x553f40[_0x03e1('0x31')]);_0x2d9b56[_0x03e1('0x34')]=_['intersection'](_0x553f40[_0x03e1('0x46')],qs['fields'](_0xa4e26f['query'][_0x03e1('0x4e')]));_0x2d9b56[_0x03e1('0x34')]=_0x2d9b56[_0x03e1('0x34')]['length']?_0x2d9b56[_0x03e1('0x34')]:_0x553f40[_0x03e1('0x46')];_0x2d9b56[_0x03e1('0x39')]=qs[_0x03e1('0x3a')](_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x3a')]);_0x2d9b56[_0x03e1('0x3d')]=qs[_0x03e1('0x33')](_['pick'](_0xa4e26f['query'],_0x553f40[_0x03e1('0x33')]));if(_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x3c')]){_0x2d9b56['where']=_[_0x03e1('0x3e')](_0x2d9b56['where'],{'$or':_[_0x03e1('0x2c')](_0x2d9b56[_0x03e1('0x34')],function(_0x497e91){var _0x2863a9={};_0x2863a9[_0x497e91]={'$like':'%'+_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x2863a9;})});}_0x2d9b56=_[_0x03e1('0x3e')]({},_0x2d9b56,_0xa4e26f[_0x03e1('0x40')]);return _0x175856['getSubjects'](_0x2d9b56);}})[_0x03e1('0x26')](function(_0x3d39f8){if(_0x3d39f8){_0x4e24af=_0x3d39f8[_0x03e1('0x36')];if(!_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x37')](_0x03e1('0x38'))){_0x2d9b56['limit']=qs[_0x03e1('0x1e')](_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x1e')]);_0x2d9b56[_0x03e1('0x1c')]=qs[_0x03e1('0x1c')](_0xa4e26f[_0x03e1('0x31')][_0x03e1('0x1c')]);}return _0x175856[_0x03e1('0x4f')](_0x2d9b56);}})[_0x03e1('0x26')](function(_0x4971c4){if(_0x4971c4){return _0x4971c4?{'count':_0x4e24af,'rows':_0x4971c4}:null;}})[_0x03e1('0x26')](respondWithResult(_0x26a8bd,null))['catch'](handleError(_0x26a8bd,null));};exports[_0x03e1('0x50')]=function(_0x116be5,_0x34d8e8,_0x7b6df3){var _0x4ce57b={};var _0x5af0c8={};var _0xb24c55;var _0x46a965;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x116be5[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x34d8e8,null))[_0x03e1('0x26')](function(_0x550c6a){if(_0x550c6a){_0xb24c55=_0x550c6a;_0x5af0c8[_0x03e1('0x46')]=_[_0x03e1('0x32')](db[_0x03e1('0x4d')]['rawAttributes']);_0x5af0c8[_0x03e1('0x31')]=_[_0x03e1('0x32')](_0x116be5[_0x03e1('0x31')]);_0x5af0c8[_0x03e1('0x33')]=_[_0x03e1('0x35')](_0x5af0c8[_0x03e1('0x46')],_0x5af0c8[_0x03e1('0x31')]);_0x4ce57b[_0x03e1('0x34')]=_[_0x03e1('0x35')](_0x5af0c8[_0x03e1('0x46')],qs[_0x03e1('0x4e')](_0x116be5[_0x03e1('0x31')][_0x03e1('0x4e')]));_0x4ce57b[_0x03e1('0x34')]=_0x4ce57b[_0x03e1('0x34')][_0x03e1('0x36')]?_0x4ce57b['attributes']:_0x5af0c8[_0x03e1('0x46')];_0x4ce57b[_0x03e1('0x39')]=qs['sort'](_0x116be5[_0x03e1('0x31')]['sort']);_0x4ce57b[_0x03e1('0x3d')]=qs['filters'](_[_0x03e1('0x3b')](_0x116be5['query'],_0x5af0c8[_0x03e1('0x33')]));if(_0x116be5[_0x03e1('0x31')][_0x03e1('0x3c')]){_0x4ce57b[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x4ce57b['where'],{'$or':_[_0x03e1('0x2c')](_0x4ce57b[_0x03e1('0x34')],function(_0x4cc26d){var _0x188af0={};_0x188af0[_0x4cc26d]={'$like':'%'+_0x116be5[_0x03e1('0x31')][_0x03e1('0x3c')]+'%'};return _0x188af0;})});}_0x4ce57b=_['merge']({},_0x4ce57b,_0x116be5[_0x03e1('0x40')]);return _0xb24c55['getDescriptions'](_0x4ce57b);}})['then'](function(_0x593d8f){if(_0x593d8f){_0x46a965=_0x593d8f[_0x03e1('0x36')];if(!_0x116be5[_0x03e1('0x31')][_0x03e1('0x37')]('nolimit')){_0x4ce57b['limit']=qs[_0x03e1('0x1e')](_0x116be5[_0x03e1('0x31')]['limit']);_0x4ce57b['offset']=qs['offset'](_0x116be5['query'][_0x03e1('0x1c')]);}return _0xb24c55['getDescriptions'](_0x4ce57b);}})[_0x03e1('0x26')](function(_0xa90dbe){if(_0xa90dbe){return _0xa90dbe?{'count':_0x46a965,'rows':_0xa90dbe}:null;}})[_0x03e1('0x26')](respondWithResult(_0x34d8e8,null))[_0x03e1('0x48')](handleError(_0x34d8e8,null));};exports[_0x03e1('0x51')]=function(_0x25a1a3,_0x317f1f,_0x4e1f3f){var _0x59d055={};var _0x55707c={};var _0x1bc21e;var _0x198ba3;return db[_0x03e1('0x41')][_0x03e1('0x4c')]({'where':{'id':_0x25a1a3[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x317f1f,null))[_0x03e1('0x26')](function(_0x232449){if(_0x232449){_0x1bc21e=_0x232449;_0x55707c[_0x03e1('0x46')]=_['keys'](db[_0x03e1('0x52')]['rawAttributes']);_0x55707c['query']=_[_0x03e1('0x32')](_0x25a1a3[_0x03e1('0x31')]);_0x55707c['filters']=_['intersection'](_0x55707c[_0x03e1('0x46')],_0x55707c[_0x03e1('0x31')]);_0x59d055[_0x03e1('0x34')]=_['intersection'](_0x55707c[_0x03e1('0x46')],qs[_0x03e1('0x4e')](_0x25a1a3['query'][_0x03e1('0x4e')]));_0x59d055['attributes']=_0x59d055[_0x03e1('0x34')]['length']?_0x59d055[_0x03e1('0x34')]:_0x55707c['model'];_0x59d055[_0x03e1('0x39')]=qs['sort'](_0x25a1a3[_0x03e1('0x31')]['sort']);_0x59d055[_0x03e1('0x3d')]=qs[_0x03e1('0x33')](_['pick'](_0x25a1a3[_0x03e1('0x31')],_0x55707c[_0x03e1('0x33')]));if(_0x25a1a3[_0x03e1('0x31')]['filter']){_0x59d055[_0x03e1('0x3d')]=_[_0x03e1('0x3e')](_0x59d055[_0x03e1('0x3d')],{'$or':_[_0x03e1('0x2c')](_0x59d055[_0x03e1('0x34')],function(_0x301ed4){var _0x19e211={};_0x19e211[_0x301ed4]={'$like':'%'+_0x25a1a3['query'][_0x03e1('0x3c')]+'%'};return _0x19e211;})});}_0x59d055=_['merge']({},_0x59d055,_0x25a1a3[_0x03e1('0x40')]);return _0x1bc21e[_0x03e1('0x51')](_0x59d055);}})[_0x03e1('0x26')](function(_0x51be8b){if(_0x51be8b){_0x198ba3=_0x51be8b[_0x03e1('0x36')];if(!_0x25a1a3[_0x03e1('0x31')][_0x03e1('0x37')]('nolimit')){_0x59d055[_0x03e1('0x1e')]=qs[_0x03e1('0x1e')](_0x25a1a3[_0x03e1('0x31')][_0x03e1('0x1e')]);_0x59d055[_0x03e1('0x1c')]=qs['offset'](_0x25a1a3[_0x03e1('0x31')][_0x03e1('0x1c')]);}return _0x1bc21e[_0x03e1('0x51')](_0x59d055);}})[_0x03e1('0x26')](function(_0x5aa479){if(_0x5aa479){return _0x5aa479?{'count':_0x198ba3,'rows':_0x5aa479}:null;}})[_0x03e1('0x26')](respondWithResult(_0x317f1f,null))[_0x03e1('0x48')](handleError(_0x317f1f,null));};exports[_0x03e1('0x53')]=function(_0x26ad1b,_0x10cd71,_0x41fec1){if(_0x26ad1b[_0x03e1('0x4a')]['id']){delete _0x26ad1b[_0x03e1('0x4a')]['id'];}return db[_0x03e1('0x41')]['findOne']({'where':{'id':_0x26ad1b[_0x03e1('0x45')]['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0x10cd71,null))[_0x03e1('0x26')](function(_0x2a8aed){if(_0x2a8aed){return _0x2a8aed['setTags'](_0x26ad1b[_0x03e1('0x4a')]['ids']||[]);}return null;})[_0x03e1('0x26')](respondWithResult(_0x10cd71,null))['catch'](handleError(_0x10cd71,null));}; \ No newline at end of file +var _0xff66=['pick','merge','filter','options','includeAll','include','findAll','rows','show','params','keys','find','create','catch','update','body','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','then','destroy','error','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x432291,_0x5b814a){var _0x36c68d=function(_0x4294c1){while(--_0x4294c1){_0x432291['push'](_0x432291['shift']());}};_0x36c68d(++_0x5b814a);}(_0xff66,0x15d));var _0x6ff6=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0xff66[_0x3b7b8a];return _0x441206;};'use strict';var emlformat=require(_0x6ff6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ff6('0x1'));var rp=require(_0x6ff6('0x2'));var moment=require(_0x6ff6('0x3'));var BPromise=require(_0x6ff6('0x4'));var Mustache=require(_0x6ff6('0x5'));var util=require(_0x6ff6('0x6'));var path=require(_0x6ff6('0x7'));var sox=require(_0x6ff6('0x8'));var csv=require(_0x6ff6('0x9'));var ejs=require(_0x6ff6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6ff6('0xb'));var crypto=require(_0x6ff6('0xc'));var jsforce=require(_0x6ff6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6ff6('0x9'));var querystring=require(_0x6ff6('0xe'));var Papa=require(_0x6ff6('0xf'));var Redis=require(_0x6ff6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6ff6('0x11'));var as=require(_0x6ff6('0x12'));var hardwareService=require(_0x6ff6('0x13'));var logger=require('../../config/logger')(_0x6ff6('0x14'));var utils=require(_0x6ff6('0x15'));var config=require(_0x6ff6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ff6('0x17'))['db'];function respondWithStatusCode(_0x4863b8,_0x9f0ebe){_0x9f0ebe=_0x9f0ebe||0xcc;return function(_0x425aee){if(_0x425aee){return _0x4863b8[_0x6ff6('0x18')](_0x9f0ebe);}return _0x4863b8[_0x6ff6('0x19')](_0x9f0ebe)[_0x6ff6('0x1a')]();};}function respondWithResult(_0x50b2aa,_0x1ffe77){_0x1ffe77=_0x1ffe77||0xc8;return function(_0x246c3f){if(_0x246c3f){return _0x50b2aa[_0x6ff6('0x19')](_0x1ffe77)[_0x6ff6('0x1b')](_0x246c3f);}};}function respondWithFilteredResult(_0x2f9376,_0x30a19e){return function(_0x92b290){if(_0x92b290){var _0x33f314=typeof _0x30a19e[_0x6ff6('0x1c')]==='undefined'&&typeof _0x30a19e[_0x6ff6('0x1d')]===_0x6ff6('0x1e');var _0x2e5581=_0x92b290[_0x6ff6('0x1f')];var _0x18ba96=_0x33f314?0x0:_0x30a19e[_0x6ff6('0x1c')];var _0x2fbac1=_0x33f314?_0x92b290[_0x6ff6('0x1f')]:_0x30a19e[_0x6ff6('0x1c')]+_0x30a19e[_0x6ff6('0x1d')];var _0x423540;if(_0x2fbac1>=_0x2e5581){_0x2fbac1=_0x2e5581;_0x423540=0xc8;}else{_0x423540=0xce;}_0x2f9376[_0x6ff6('0x19')](_0x423540);return _0x2f9376['set']('Content-Range',_0x18ba96+'-'+_0x2fbac1+'/'+_0x2e5581)[_0x6ff6('0x1b')](_0x92b290);}return null;};}function patchUpdates(_0x7dd00c){return function(_0x4bc915){try{jsonpatch['apply'](_0x4bc915,_0x7dd00c,!![]);}catch(_0xd0a106){return BPromise[_0x6ff6('0x20')](_0xd0a106);}return _0x4bc915[_0x6ff6('0x21')]();};}function saveUpdates(_0x335495,_0x31d88c){return function(_0x19379e){if(_0x19379e){return _0x19379e['update'](_0x335495)[_0x6ff6('0x22')](function(_0x5a9c74){return _0x5a9c74;});}return null;};}function removeEntity(_0x215ef8,_0x237a39){return function(_0x5658b1){if(_0x5658b1){return _0x5658b1[_0x6ff6('0x23')]()[_0x6ff6('0x22')](function(){_0x215ef8[_0x6ff6('0x19')](0xcc)[_0x6ff6('0x1a')]();});}};}function handleEntityNotFound(_0x255cd0,_0x448681){return function(_0x350d3d){if(!_0x350d3d){_0x255cd0[_0x6ff6('0x18')](0x194);}return _0x350d3d;};}function handleError(_0x3ba0b7,_0x47ab60){_0x47ab60=_0x47ab60||0x1f4;return function(_0x3d2fb8){logger[_0x6ff6('0x24')](_0x3d2fb8[_0x6ff6('0x25')]);if(_0x3d2fb8[_0x6ff6('0x26')]){delete _0x3d2fb8['name'];}_0x3ba0b7[_0x6ff6('0x19')](_0x47ab60)[_0x6ff6('0x27')](_0x3d2fb8);};}exports['index']=function(_0x5a901f,_0x5473d6){var _0x47e8e1={},_0x323ce6={},_0x43e47e={'count':0x0,'rows':[]};var _0x416f10=_['map'](db[_0x6ff6('0x28')][_0x6ff6('0x29')],function(_0x51baf7){return{'name':_0x51baf7[_0x6ff6('0x2a')],'type':_0x51baf7['type']['key']};});_0x323ce6[_0x6ff6('0x2b')]=_[_0x6ff6('0x2c')](_0x416f10,'name');_0x323ce6[_0x6ff6('0x2d')]=_['keys'](_0x5a901f[_0x6ff6('0x2d')]);_0x323ce6[_0x6ff6('0x2e')]=_[_0x6ff6('0x2f')](_0x323ce6['model'],_0x323ce6['query']);_0x47e8e1[_0x6ff6('0x30')]=_[_0x6ff6('0x2f')](_0x323ce6[_0x6ff6('0x2b')],qs[_0x6ff6('0x31')](_0x5a901f[_0x6ff6('0x2d')][_0x6ff6('0x31')]));_0x47e8e1['attributes']=_0x47e8e1['attributes'][_0x6ff6('0x32')]?_0x47e8e1[_0x6ff6('0x30')]:_0x323ce6[_0x6ff6('0x2b')];if(!_0x5a901f[_0x6ff6('0x2d')][_0x6ff6('0x33')](_0x6ff6('0x34'))){_0x47e8e1[_0x6ff6('0x1d')]=qs[_0x6ff6('0x1d')](_0x5a901f['query'][_0x6ff6('0x1d')]);_0x47e8e1[_0x6ff6('0x1c')]=qs[_0x6ff6('0x1c')](_0x5a901f[_0x6ff6('0x2d')][_0x6ff6('0x1c')]);}_0x47e8e1[_0x6ff6('0x35')]=qs[_0x6ff6('0x36')](_0x5a901f['query']['sort']);_0x47e8e1[_0x6ff6('0x37')]=qs[_0x6ff6('0x2e')](_[_0x6ff6('0x38')](_0x5a901f[_0x6ff6('0x2d')],_0x323ce6[_0x6ff6('0x2e')]),_0x416f10);if(_0x5a901f[_0x6ff6('0x2d')]['filter']){_0x47e8e1['where']=_[_0x6ff6('0x39')](_0x47e8e1[_0x6ff6('0x37')],{'$or':_[_0x6ff6('0x2c')](_0x416f10,function(_0x4ef870){if(_0x4ef870['type']!=='VIRTUAL'){var _0x29d11e={};_0x29d11e[_0x4ef870[_0x6ff6('0x26')]]={'$like':'%'+_0x5a901f[_0x6ff6('0x2d')][_0x6ff6('0x3a')]+'%'};return _0x29d11e;}})});}_0x47e8e1=_[_0x6ff6('0x39')]({},_0x47e8e1,_0x5a901f[_0x6ff6('0x3b')]);var _0x2ec824={'where':_0x47e8e1[_0x6ff6('0x37')]};return db[_0x6ff6('0x28')]['count'](_0x2ec824)[_0x6ff6('0x22')](function(_0x6f89f0){_0x43e47e[_0x6ff6('0x1f')]=_0x6f89f0;if(_0x5a901f[_0x6ff6('0x2d')][_0x6ff6('0x3c')]){_0x47e8e1[_0x6ff6('0x3d')]=[{'all':!![]}];}return db[_0x6ff6('0x28')][_0x6ff6('0x3e')](_0x47e8e1);})[_0x6ff6('0x22')](function(_0xbad4a){_0x43e47e[_0x6ff6('0x3f')]=_0xbad4a;return _0x43e47e;})['then'](respondWithFilteredResult(_0x5473d6,_0x47e8e1))['catch'](handleError(_0x5473d6,null));};exports[_0x6ff6('0x40')]=function(_0x437cb2,_0x53b767){var _0x563373={'raw':![],'where':{'id':_0x437cb2[_0x6ff6('0x41')]['id']}},_0x59bfb2={};_0x59bfb2[_0x6ff6('0x2b')]=_['keys'](db[_0x6ff6('0x28')][_0x6ff6('0x29')]);_0x59bfb2[_0x6ff6('0x2d')]=_[_0x6ff6('0x42')](_0x437cb2[_0x6ff6('0x2d')]);_0x59bfb2[_0x6ff6('0x2e')]=_['intersection'](_0x59bfb2['model'],_0x59bfb2[_0x6ff6('0x2d')]);_0x563373['attributes']=_[_0x6ff6('0x2f')](_0x59bfb2[_0x6ff6('0x2b')],qs[_0x6ff6('0x31')](_0x437cb2[_0x6ff6('0x2d')][_0x6ff6('0x31')]));_0x563373[_0x6ff6('0x30')]=_0x563373[_0x6ff6('0x30')][_0x6ff6('0x32')]?_0x563373['attributes']:_0x59bfb2[_0x6ff6('0x2b')];if(_0x437cb2['query'][_0x6ff6('0x3c')]){_0x563373['include']=[{'all':!![]}];}_0x563373=_['merge']({},_0x563373,_0x437cb2[_0x6ff6('0x3b')]);return db['FreshdeskConfiguration'][_0x6ff6('0x43')](_0x563373)[_0x6ff6('0x22')](handleEntityNotFound(_0x53b767,null))[_0x6ff6('0x22')](respondWithResult(_0x53b767,null))['catch'](handleError(_0x53b767,null));};exports['create']=function(_0x42f3fd,_0x4d5ce0){return db[_0x6ff6('0x28')][_0x6ff6('0x44')](_0x42f3fd['body'],{})[_0x6ff6('0x22')](respondWithResult(_0x4d5ce0,0xc9))[_0x6ff6('0x45')](handleError(_0x4d5ce0,null));};exports[_0x6ff6('0x46')]=function(_0x56d744,_0x40e674){if(_0x56d744[_0x6ff6('0x47')]['id']){delete _0x56d744[_0x6ff6('0x47')]['id'];}return db[_0x6ff6('0x28')]['find']({'where':{'id':_0x56d744[_0x6ff6('0x41')]['id']}})[_0x6ff6('0x22')](handleEntityNotFound(_0x40e674,null))[_0x6ff6('0x22')](saveUpdates(_0x56d744['body'],null))[_0x6ff6('0x22')](respondWithResult(_0x40e674,null))[_0x6ff6('0x45')](handleError(_0x40e674,null));};exports[_0x6ff6('0x23')]=function(_0xa242d8,_0x5a1174){return db[_0x6ff6('0x28')]['find']({'where':{'id':_0xa242d8[_0x6ff6('0x41')]['id']}})[_0x6ff6('0x22')](handleEntityNotFound(_0x5a1174,null))[_0x6ff6('0x22')](removeEntity(_0x5a1174,null))[_0x6ff6('0x45')](handleError(_0x5a1174,null));};exports[_0x6ff6('0x48')]=function(_0x3d1c6d,_0x2bf781,_0xf8031a){var _0x37db07={};var _0x5cf302={};var _0x2a4fa9;var _0x45fa29;return db[_0x6ff6('0x28')]['findOne']({'where':{'id':_0x3d1c6d[_0x6ff6('0x41')]['id']}})['then'](handleEntityNotFound(_0x2bf781,null))[_0x6ff6('0x22')](function(_0x518924){if(_0x518924){_0x2a4fa9=_0x518924;_0x5cf302[_0x6ff6('0x2b')]=_[_0x6ff6('0x42')](db[_0x6ff6('0x49')][_0x6ff6('0x29')]);_0x5cf302[_0x6ff6('0x2d')]=_['keys'](_0x3d1c6d[_0x6ff6('0x2d')]);_0x5cf302[_0x6ff6('0x2e')]=_[_0x6ff6('0x2f')](_0x5cf302[_0x6ff6('0x2b')],_0x5cf302[_0x6ff6('0x2d')]);_0x37db07[_0x6ff6('0x30')]=_[_0x6ff6('0x2f')](_0x5cf302['model'],qs[_0x6ff6('0x31')](_0x3d1c6d['query'][_0x6ff6('0x31')]));_0x37db07[_0x6ff6('0x30')]=_0x37db07[_0x6ff6('0x30')][_0x6ff6('0x32')]?_0x37db07[_0x6ff6('0x30')]:_0x5cf302[_0x6ff6('0x2b')];_0x37db07['order']=qs[_0x6ff6('0x36')](_0x3d1c6d[_0x6ff6('0x2d')][_0x6ff6('0x36')]);_0x37db07['where']=qs[_0x6ff6('0x2e')](_[_0x6ff6('0x38')](_0x3d1c6d[_0x6ff6('0x2d')],_0x5cf302[_0x6ff6('0x2e')]));if(_0x3d1c6d[_0x6ff6('0x2d')][_0x6ff6('0x3a')]){_0x37db07[_0x6ff6('0x37')]=_[_0x6ff6('0x39')](_0x37db07[_0x6ff6('0x37')],{'$or':_['map'](_0x37db07[_0x6ff6('0x30')],function(_0xe2b8e3){var _0x26505e={};_0x26505e[_0xe2b8e3]={'$like':'%'+_0x3d1c6d[_0x6ff6('0x2d')][_0x6ff6('0x3a')]+'%'};return _0x26505e;})});}_0x37db07=_[_0x6ff6('0x39')]({},_0x37db07,_0x3d1c6d['options']);return _0x2a4fa9[_0x6ff6('0x48')](_0x37db07);}})['then'](function(_0x373ce9){if(_0x373ce9){_0x45fa29=_0x373ce9[_0x6ff6('0x32')];if(!_0x3d1c6d[_0x6ff6('0x2d')][_0x6ff6('0x33')](_0x6ff6('0x34'))){_0x37db07[_0x6ff6('0x1d')]=qs[_0x6ff6('0x1d')](_0x3d1c6d[_0x6ff6('0x2d')][_0x6ff6('0x1d')]);_0x37db07[_0x6ff6('0x1c')]=qs[_0x6ff6('0x1c')](_0x3d1c6d['query'][_0x6ff6('0x1c')]);}return _0x2a4fa9[_0x6ff6('0x48')](_0x37db07);}})['then'](function(_0xfea570){if(_0xfea570){return _0xfea570?{'count':_0x45fa29,'rows':_0xfea570}:null;}})[_0x6ff6('0x22')](respondWithResult(_0x2bf781,null))[_0x6ff6('0x45')](handleError(_0x2bf781,null));};exports[_0x6ff6('0x4a')]=function(_0x3abb06,_0x209c54,_0x7ff0a3){var _0x388aa7={};var _0x4ba7ef={};var _0x70b663;var _0x540d66;return db[_0x6ff6('0x28')][_0x6ff6('0x4b')]({'where':{'id':_0x3abb06[_0x6ff6('0x41')]['id']}})[_0x6ff6('0x22')](handleEntityNotFound(_0x209c54,null))[_0x6ff6('0x22')](function(_0x5790ed){if(_0x5790ed){_0x70b663=_0x5790ed;_0x4ba7ef['model']=_['keys'](db[_0x6ff6('0x49')][_0x6ff6('0x29')]);_0x4ba7ef['query']=_[_0x6ff6('0x42')](_0x3abb06['query']);_0x4ba7ef[_0x6ff6('0x2e')]=_[_0x6ff6('0x2f')](_0x4ba7ef['model'],_0x4ba7ef[_0x6ff6('0x2d')]);_0x388aa7[_0x6ff6('0x30')]=_[_0x6ff6('0x2f')](_0x4ba7ef[_0x6ff6('0x2b')],qs[_0x6ff6('0x31')](_0x3abb06[_0x6ff6('0x2d')][_0x6ff6('0x31')]));_0x388aa7[_0x6ff6('0x30')]=_0x388aa7[_0x6ff6('0x30')][_0x6ff6('0x32')]?_0x388aa7[_0x6ff6('0x30')]:_0x4ba7ef[_0x6ff6('0x2b')];_0x388aa7[_0x6ff6('0x35')]=qs[_0x6ff6('0x36')](_0x3abb06['query'][_0x6ff6('0x36')]);_0x388aa7['where']=qs[_0x6ff6('0x2e')](_[_0x6ff6('0x38')](_0x3abb06[_0x6ff6('0x2d')],_0x4ba7ef['filters']));if(_0x3abb06[_0x6ff6('0x2d')][_0x6ff6('0x3a')]){_0x388aa7[_0x6ff6('0x37')]=_[_0x6ff6('0x39')](_0x388aa7['where'],{'$or':_[_0x6ff6('0x2c')](_0x388aa7[_0x6ff6('0x30')],function(_0x31f2af){var _0x19ba8b={};_0x19ba8b[_0x31f2af]={'$like':'%'+_0x3abb06['query'][_0x6ff6('0x3a')]+'%'};return _0x19ba8b;})});}_0x388aa7=_['merge']({},_0x388aa7,_0x3abb06['options']);return _0x70b663['getSubjects'](_0x388aa7);}})[_0x6ff6('0x22')](function(_0x1e4703){if(_0x1e4703){_0x540d66=_0x1e4703[_0x6ff6('0x32')];if(!_0x3abb06[_0x6ff6('0x2d')][_0x6ff6('0x33')](_0x6ff6('0x34'))){_0x388aa7[_0x6ff6('0x1d')]=qs[_0x6ff6('0x1d')](_0x3abb06[_0x6ff6('0x2d')]['limit']);_0x388aa7[_0x6ff6('0x1c')]=qs[_0x6ff6('0x1c')](_0x3abb06['query'][_0x6ff6('0x1c')]);}return _0x70b663[_0x6ff6('0x4a')](_0x388aa7);}})[_0x6ff6('0x22')](function(_0xd6ca79){if(_0xd6ca79){return _0xd6ca79?{'count':_0x540d66,'rows':_0xd6ca79}:null;}})[_0x6ff6('0x22')](respondWithResult(_0x209c54,null))['catch'](handleError(_0x209c54,null));};exports[_0x6ff6('0x4c')]=function(_0x2b0175,_0x3b9967,_0x353c29){var _0x13a1bc={};var _0x4610e0={};var _0x21441f;var _0x214559;return db[_0x6ff6('0x28')]['findOne']({'where':{'id':_0x2b0175[_0x6ff6('0x41')]['id']}})[_0x6ff6('0x22')](handleEntityNotFound(_0x3b9967,null))[_0x6ff6('0x22')](function(_0x242e16){if(_0x242e16){_0x21441f=_0x242e16;_0x4610e0['model']=_['keys'](db[_0x6ff6('0x49')][_0x6ff6('0x29')]);_0x4610e0[_0x6ff6('0x2d')]=_[_0x6ff6('0x42')](_0x2b0175[_0x6ff6('0x2d')]);_0x4610e0['filters']=_['intersection'](_0x4610e0[_0x6ff6('0x2b')],_0x4610e0[_0x6ff6('0x2d')]);_0x13a1bc[_0x6ff6('0x30')]=_['intersection'](_0x4610e0[_0x6ff6('0x2b')],qs[_0x6ff6('0x31')](_0x2b0175[_0x6ff6('0x2d')]['fields']));_0x13a1bc[_0x6ff6('0x30')]=_0x13a1bc['attributes']['length']?_0x13a1bc[_0x6ff6('0x30')]:_0x4610e0[_0x6ff6('0x2b')];_0x13a1bc[_0x6ff6('0x35')]=qs['sort'](_0x2b0175[_0x6ff6('0x2d')][_0x6ff6('0x36')]);_0x13a1bc[_0x6ff6('0x37')]=qs['filters'](_[_0x6ff6('0x38')](_0x2b0175['query'],_0x4610e0[_0x6ff6('0x2e')]));if(_0x2b0175[_0x6ff6('0x2d')][_0x6ff6('0x3a')]){_0x13a1bc[_0x6ff6('0x37')]=_[_0x6ff6('0x39')](_0x13a1bc[_0x6ff6('0x37')],{'$or':_[_0x6ff6('0x2c')](_0x13a1bc[_0x6ff6('0x30')],function(_0x45b9cb){var _0x31a4af={};_0x31a4af[_0x45b9cb]={'$like':'%'+_0x2b0175[_0x6ff6('0x2d')][_0x6ff6('0x3a')]+'%'};return _0x31a4af;})});}_0x13a1bc=_[_0x6ff6('0x39')]({},_0x13a1bc,_0x2b0175[_0x6ff6('0x3b')]);return _0x21441f[_0x6ff6('0x4c')](_0x13a1bc);}})[_0x6ff6('0x22')](function(_0x3339dd){if(_0x3339dd){_0x214559=_0x3339dd[_0x6ff6('0x32')];if(!_0x2b0175[_0x6ff6('0x2d')][_0x6ff6('0x33')](_0x6ff6('0x34'))){_0x13a1bc[_0x6ff6('0x1d')]=qs['limit'](_0x2b0175[_0x6ff6('0x2d')][_0x6ff6('0x1d')]);_0x13a1bc[_0x6ff6('0x1c')]=qs[_0x6ff6('0x1c')](_0x2b0175['query'][_0x6ff6('0x1c')]);}return _0x21441f[_0x6ff6('0x4c')](_0x13a1bc);}})[_0x6ff6('0x22')](function(_0x4964d3){if(_0x4964d3){return _0x4964d3?{'count':_0x214559,'rows':_0x4964d3}:null;}})[_0x6ff6('0x22')](respondWithResult(_0x3b9967,null))['catch'](handleError(_0x3b9967,null));};exports['getTags']=function(_0x24c5a8,_0x58e5e4,_0x51e5d8){var _0x4e5ce3={};var _0xb02b14={};var _0x3d4524;var _0x4aaaae;return db[_0x6ff6('0x28')]['findOne']({'where':{'id':_0x24c5a8[_0x6ff6('0x41')]['id']}})[_0x6ff6('0x22')](handleEntityNotFound(_0x58e5e4,null))[_0x6ff6('0x22')](function(_0x4b81fb){if(_0x4b81fb){_0x3d4524=_0x4b81fb;_0xb02b14[_0x6ff6('0x2b')]=_[_0x6ff6('0x42')](db[_0x6ff6('0x4d')][_0x6ff6('0x29')]);_0xb02b14[_0x6ff6('0x2d')]=_[_0x6ff6('0x42')](_0x24c5a8[_0x6ff6('0x2d')]);_0xb02b14[_0x6ff6('0x2e')]=_[_0x6ff6('0x2f')](_0xb02b14['model'],_0xb02b14[_0x6ff6('0x2d')]);_0x4e5ce3[_0x6ff6('0x30')]=_[_0x6ff6('0x2f')](_0xb02b14[_0x6ff6('0x2b')],qs[_0x6ff6('0x31')](_0x24c5a8['query'][_0x6ff6('0x31')]));_0x4e5ce3[_0x6ff6('0x30')]=_0x4e5ce3[_0x6ff6('0x30')][_0x6ff6('0x32')]?_0x4e5ce3[_0x6ff6('0x30')]:_0xb02b14[_0x6ff6('0x2b')];_0x4e5ce3[_0x6ff6('0x35')]=qs['sort'](_0x24c5a8[_0x6ff6('0x2d')][_0x6ff6('0x36')]);_0x4e5ce3[_0x6ff6('0x37')]=qs['filters'](_[_0x6ff6('0x38')](_0x24c5a8['query'],_0xb02b14[_0x6ff6('0x2e')]));if(_0x24c5a8[_0x6ff6('0x2d')][_0x6ff6('0x3a')]){_0x4e5ce3[_0x6ff6('0x37')]=_[_0x6ff6('0x39')](_0x4e5ce3[_0x6ff6('0x37')],{'$or':_[_0x6ff6('0x2c')](_0x4e5ce3[_0x6ff6('0x30')],function(_0x155cf8){var _0x48b62e={};_0x48b62e[_0x155cf8]={'$like':'%'+_0x24c5a8[_0x6ff6('0x2d')][_0x6ff6('0x3a')]+'%'};return _0x48b62e;})});}_0x4e5ce3=_[_0x6ff6('0x39')]({},_0x4e5ce3,_0x24c5a8['options']);return _0x3d4524[_0x6ff6('0x4e')](_0x4e5ce3);}})[_0x6ff6('0x22')](function(_0x2314df){if(_0x2314df){_0x4aaaae=_0x2314df[_0x6ff6('0x32')];if(!_0x24c5a8[_0x6ff6('0x2d')]['hasOwnProperty'](_0x6ff6('0x34'))){_0x4e5ce3[_0x6ff6('0x1d')]=qs[_0x6ff6('0x1d')](_0x24c5a8['query']['limit']);_0x4e5ce3['offset']=qs['offset'](_0x24c5a8[_0x6ff6('0x2d')]['offset']);}return _0x3d4524['getTags'](_0x4e5ce3);}})[_0x6ff6('0x22')](function(_0x59ca9c){if(_0x59ca9c){return _0x59ca9c?{'count':_0x4aaaae,'rows':_0x59ca9c}:null;}})[_0x6ff6('0x22')](respondWithResult(_0x58e5e4,null))[_0x6ff6('0x45')](handleError(_0x58e5e4,null));};exports[_0x6ff6('0x4f')]=function(_0x544413,_0x2a0801,_0x4dc4bf){if(_0x544413[_0x6ff6('0x47')]['id']){delete _0x544413[_0x6ff6('0x47')]['id'];}return db[_0x6ff6('0x28')][_0x6ff6('0x4b')]({'where':{'id':_0x544413['params']['id']}})[_0x6ff6('0x22')](handleEntityNotFound(_0x2a0801,null))[_0x6ff6('0x22')](function(_0x45b522){if(_0x45b522){return _0x45b522['setTags'](_0x544413[_0x6ff6('0x47')][_0x6ff6('0x50')]||[]);}return null;})[_0x6ff6('0x22')](respondWithResult(_0x2a0801,null))[_0x6ff6('0x45')](handleError(_0x2a0801,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 21c4d25..9113aa6 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 _0xc0c3=['./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0c3,0x9e));var _0x3c0c=function(_0x5f47ca,_0x1fc7bf){_0x5f47ca=_0x5f47ca-0x0;var _0x1ed62a=_0xc0c3[_0x5f47ca];return _0x1ed62a;};'use strict';var _=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var logger=require(_0x3c0c('0x2'))(_0x3c0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c0c('0x4'));var rimraf=require(_0x3c0c('0x5'));var config=require(_0x3c0c('0x6'));var attributes=require(_0x3c0c('0x7'));module['exports']=function(_0x3bca1f,_0x1db120){return _0x3bca1f[_0x3c0c('0x8')](_0x3c0c('0x9'),attributes,{'tableName':_0x3c0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe378=['request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3f9448,_0x2a0a3c){var _0xe8f4d5=function(_0x5e6d3b){while(--_0x5e6d3b){_0x3f9448['push'](_0x3f9448['shift']());}};_0xe8f4d5(++_0x2a0a3c);}(_0xe378,0x175));var _0x8e37=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0xe378[_0x468a77];return _0x2d1c33;};'use strict';var _=require(_0x8e37('0x0'));var util=require(_0x8e37('0x1'));var logger=require(_0x8e37('0x2'))(_0x8e37('0x3'));var moment=require(_0x8e37('0x4'));var BPromise=require('bluebird');var rp=require(_0x8e37('0x5'));var fs=require('fs');var path=require(_0x8e37('0x6'));var rimraf=require(_0x8e37('0x7'));var config=require(_0x8e37('0x8'));var attributes=require(_0x8e37('0x9'));module[_0x8e37('0xa')]=function(_0x5d3098,_0x401eb7){return _0x5d3098[_0x8e37('0xb')](_0x8e37('0xc'),attributes,{'tableName':_0x8e37('0xd'),'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 0b624cc..0826c66 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 _0x46ad=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x22e396,_0x202d65){var _0x2a3149=function(_0x147447){while(--_0x147447){_0x22e396['push'](_0x22e396['shift']());}};_0x2a3149(++_0x202d65);}(_0x46ad,0x162));var _0xd46a=function(_0x47d501,_0x1b9cf1){_0x47d501=_0x47d501-0x0;var _0x36c1a9=_0x46ad[_0x47d501];return _0x36c1a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd46a('0x0'));var BPromise=require(_0xd46a('0x1'));var rs=require(_0xd46a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd46a('0x3'))['db'];var utils=require(_0xd46a('0x4'));var logger=require(_0xd46a('0x5'))(_0xd46a('0x6'));var config=require(_0xd46a('0x7'));var jayson=require(_0xd46a('0x8'));var client=jayson['client'][_0xd46a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425a10,_0x2b20af,_0xaa4763){return new BPromise(function(_0x582c83,_0xab59dd){return client[_0xd46a('0xa')](_0x425a10,_0xaa4763)[_0xd46a('0xb')](function(_0x432cb6){logger[_0xd46a('0xc')](_0xd46a('0xd'),_0x2b20af,'request\x20sent');logger[_0xd46a('0xe')](_0xd46a('0xf'),_0x2b20af,'request\x20sent',JSON[_0xd46a('0x10')](_0x432cb6));if(_0x432cb6[_0xd46a('0x11')]){if(_0x432cb6['error'][_0xd46a('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b20af,_0x432cb6[_0xd46a('0x11')][_0xd46a('0x13')]);return _0xab59dd(_0x432cb6['error'][_0xd46a('0x13')]);}logger[_0xd46a('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b20af,_0x432cb6[_0xd46a('0x11')][_0xd46a('0x13')]);return _0x582c83(_0x432cb6[_0xd46a('0x11')]['message']);}else{logger['info'](_0xd46a('0xd'),_0x2b20af,'request\x20sent');_0x582c83(_0x432cb6[_0xd46a('0x14')][_0xd46a('0x13')]);}})[_0xd46a('0x15')](function(_0x5e93eb){logger['error'](_0xd46a('0xd'),_0x2b20af,_0x5e93eb);_0xab59dd(_0x5e93eb);});});} \ No newline at end of file +var _0x033d=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','FreshdeskConfiguration,\x20%s,\x20%s','error','message','info','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','debug'];(function(_0x295e0e,_0x52f6b2){var _0x24fb37=function(_0x4645eb){while(--_0x4645eb){_0x295e0e['push'](_0x295e0e['shift']());}};_0x24fb37(++_0x52f6b2);}(_0x033d,0x11a));var _0xd033=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x033d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd033('0x0'));var util=require('util');var moment=require(_0xd033('0x1'));var BPromise=require('bluebird');var rs=require(_0xd033('0x2'));var fs=require('fs');var Redis=require(_0xd033('0x3'));var db=require(_0xd033('0x4'))['db'];var utils=require(_0xd033('0x5'));var logger=require(_0xd033('0x6'))(_0xd033('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd033('0x8')][_0xd033('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a9927,_0x5ae5ae,_0x5701dd){return new BPromise(function(_0x507232,_0xa382c8){return client[_0xd033('0xa')](_0x5a9927,_0x5701dd)['then'](function(_0x158084){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5ae5ae,'request\x20sent');logger[_0xd033('0xb')](_0xd033('0xc'),_0x5ae5ae,'request\x20sent',JSON[_0xd033('0xd')](_0x158084));if(_0x158084['error']){if(_0x158084['error'][_0xd033('0xe')]===0x1f4){logger['error'](_0xd033('0xf'),_0x5ae5ae,_0x158084[_0xd033('0x10')][_0xd033('0x11')]);return _0xa382c8(_0x158084[_0xd033('0x10')][_0xd033('0x11')]);}logger[_0xd033('0x10')](_0xd033('0xf'),_0x5ae5ae,_0x158084[_0xd033('0x10')][_0xd033('0x11')]);return _0x507232(_0x158084[_0xd033('0x10')][_0xd033('0x11')]);}else{logger[_0xd033('0x12')](_0xd033('0xf'),_0x5ae5ae,_0xd033('0x13'));_0x507232(_0x158084['result']['message']);}})[_0xd033('0x14')](function(_0x5238ae){logger[_0xd033('0x10')](_0xd033('0xf'),_0x5ae5ae,_0x5238ae);_0xa382c8(_0x5238ae);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5ccc18f..42f0e3b 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 _0x0902=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x563242,_0xd8efda){var _0x5d0488=function(_0x2fe493){while(--_0x2fe493){_0x563242['push'](_0x563242['shift']());}};_0x5d0488(++_0xd8efda);}(_0x0902,0xe4));var _0x2090=function(_0x5c16e1,_0x12ea72){_0x5c16e1=_0x5c16e1-0x0;var _0x4f59d0=_0x0902[_0x5c16e1];return _0x4f59d0;};'use strict';var multer=require(_0x2090('0x0'));var util=require(_0x2090('0x1'));var path=require(_0x2090('0x2'));var timeout=require(_0x2090('0x3'));var express=require(_0x2090('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2090('0x5'));var interaction=require(_0x2090('0x6'));var config=require(_0x2090('0x7'));var controller=require(_0x2090('0x8'));router[_0x2090('0x9')]('/',auth[_0x2090('0xa')](),controller[_0x2090('0xb')]);router['get'](_0x2090('0xc'),auth[_0x2090('0xa')](),controller[_0x2090('0xd')]);router[_0x2090('0xe')]('/',auth['isAuthenticated'](),controller[_0x2090('0xf')]);router['put'](_0x2090('0xc'),auth[_0x2090('0xa')](),controller['update']);router[_0x2090('0x10')]('/:id',auth[_0x2090('0xa')](),controller[_0x2090('0x11')]);module['exports']=router; \ No newline at end of file +var _0x67e3=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','post','create','/:id','update','delete','exports'];(function(_0x10d875,_0x1b5f09){var _0xb3709b=function(_0x4ed80f){while(--_0x4ed80f){_0x10d875['push'](_0x10d875['shift']());}};_0xb3709b(++_0x1b5f09);}(_0x67e3,0x1ba));var _0x367e=function(_0x2365c8,_0x1f0f78){_0x2365c8=_0x2365c8-0x0;var _0x4bcc2e=_0x67e3[_0x2365c8];return _0x4bcc2e;};'use strict';var multer=require(_0x367e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x367e('0x1'));var express=require(_0x367e('0x2'));var router=express[_0x367e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x367e('0x4'));var interaction=require(_0x367e('0x5'));var config=require(_0x367e('0x6'));var controller=require(_0x367e('0x7'));router[_0x367e('0x8')]('/',auth[_0x367e('0x9')](),controller[_0x367e('0xa')]);router[_0x367e('0x8')]('/:id',auth[_0x367e('0x9')](),controller['show']);router[_0x367e('0xb')]('/',auth[_0x367e('0x9')](),controller[_0x367e('0xc')]);router['put'](_0x367e('0xd'),auth['isAuthenticated'](),controller[_0x367e('0xe')]);router[_0x367e('0xf')](_0x367e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x367e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 00cc769..341308e 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 _0x50b5=['picklist','STRING','variable','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x50b5,0x163));var _0x550b=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x50b5[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0x550b('0x0'));module['exports']={'type':{'type':Sequelize[_0x550b('0x1')](_0x550b('0x2'),'variable',_0x550b('0x3'),_0x550b('0x4'),_0x550b('0x5')),'defaultValue':_0x550b('0x2')},'content':{'type':Sequelize[_0x550b('0x6')]},'key':{'type':Sequelize[_0x550b('0x6')]},'keyType':{'type':Sequelize[_0x550b('0x1')]('string',_0x550b('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x550b('0x6')]},'idField':{'type':Sequelize[_0x550b('0x6')]},'nameField':{'type':Sequelize[_0x550b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa501=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x25f511,_0x27157f){var _0x4c47c9=function(_0x514c31){while(--_0x514c31){_0x25f511['push'](_0x25f511['shift']());}};_0x4c47c9(++_0x27157f);}(_0xa501,0xa3));var _0x1a50=function(_0x46e2f8,_0x29a04d){_0x46e2f8=_0x46e2f8-0x0;var _0x490f20=_0xa501[_0x46e2f8];return _0x490f20;};'use strict';var Sequelize=require(_0x1a50('0x0'));module[_0x1a50('0x1')]={'type':{'type':Sequelize[_0x1a50('0x2')]('string',_0x1a50('0x3'),_0x1a50('0x4'),_0x1a50('0x5'),_0x1a50('0x6')),'defaultValue':_0x1a50('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a50('0x8')]},'keyType':{'type':Sequelize[_0x1a50('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x1a50('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1a50('0x8')]},'customField':{'type':Sequelize[_0x1a50('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 88a53cd..e67ec27 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 _0x6324=['merge','where','type','VIRTUAL','filter','options','FreshdeskField','includeAll','rows','show','keys','intersection','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick'];(function(_0x9eacf,_0x1c42ea){var _0x1d5d5a=function(_0x545160){while(--_0x545160){_0x9eacf['push'](_0x9eacf['shift']());}};_0x1d5d5a(++_0x1c42ea);}(_0x6324,0x142));var _0x4632=function(_0x312484,_0x2605e6){_0x312484=_0x312484-0x0;var _0x5035e8=_0x6324[_0x312484];return _0x5035e8;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0xb074d,_0x1b8de0){return function(_0x4af026){if(!_0x4af026){_0xb074d[_0x4632('0x18')](0x194);}return _0x4af026;};}function handleError(_0x21118c,_0x372679){_0x372679=_0x372679||0x1f4;return function(_0x22d0f5){logger[_0x4632('0x28')](_0x22d0f5[_0x4632('0x29')]);if(_0x22d0f5['name']){delete _0x22d0f5['name'];}_0x21118c[_0x4632('0x19')](_0x372679)[_0x4632('0x2a')](_0x22d0f5);};}exports[_0x4632('0x2b')]=function(_0x35a533,_0x34079f){var _0x119d1b={},_0x3570b2={},_0x5e2ee4={'count':0x0,'rows':[]};var _0x42d505=_[_0x4632('0x2c')](db['FreshdeskField'][_0x4632('0x2d')],function(_0x5316f7){return{'name':_0x5316f7[_0x4632('0x2e')],'type':_0x5316f7['type']['key']};});_0x3570b2[_0x4632('0x2f')]=_[_0x4632('0x2c')](_0x42d505,_0x4632('0x30'));_0x3570b2['query']=_['keys'](_0x35a533[_0x4632('0x31')]);_0x3570b2[_0x4632('0x32')]=_['intersection'](_0x3570b2['model'],_0x3570b2[_0x4632('0x31')]);_0x119d1b[_0x4632('0x33')]=_['intersection'](_0x3570b2[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x35a533[_0x4632('0x31')][_0x4632('0x34')]));_0x119d1b[_0x4632('0x33')]=_0x119d1b['attributes'][_0x4632('0x35')]?_0x119d1b[_0x4632('0x33')]:_0x3570b2['model'];if(!_0x35a533['query'][_0x4632('0x36')]('nolimit')){_0x119d1b['limit']=qs[_0x4632('0x1e')](_0x35a533['query'][_0x4632('0x1e')]);_0x119d1b[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x35a533['query'][_0x4632('0x1c')]);}_0x119d1b[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x35a533[_0x4632('0x31')][_0x4632('0x38')]);_0x119d1b['where']=qs['filters'](_[_0x4632('0x39')](_0x35a533[_0x4632('0x31')],_0x3570b2[_0x4632('0x32')]),_0x42d505);if(_0x35a533['query']['filter']){_0x119d1b['where']=_[_0x4632('0x3a')](_0x119d1b[_0x4632('0x3b')],{'$or':_['map'](_0x42d505,function(_0x3809aa){if(_0x3809aa[_0x4632('0x3c')]!==_0x4632('0x3d')){var _0x3adf41={};_0x3adf41[_0x3809aa[_0x4632('0x30')]]={'$like':'%'+_0x35a533[_0x4632('0x31')][_0x4632('0x3e')]+'%'};return _0x3adf41;}})});}_0x119d1b=_[_0x4632('0x3a')]({},_0x119d1b,_0x35a533[_0x4632('0x3f')]);var _0x2c04a8={'where':_0x119d1b[_0x4632('0x3b')]};return db[_0x4632('0x40')]['count'](_0x2c04a8)[_0x4632('0x26')](function(_0x45bff6){_0x5e2ee4['count']=_0x45bff6;if(_0x35a533[_0x4632('0x31')][_0x4632('0x41')]){_0x119d1b['include']=[{'all':!![]}];}return db[_0x4632('0x40')]['findAll'](_0x119d1b);})[_0x4632('0x26')](function(_0x28df3b){_0x5e2ee4[_0x4632('0x42')]=_0x28df3b;return _0x5e2ee4;})[_0x4632('0x26')](respondWithFilteredResult(_0x34079f,_0x119d1b))['catch'](handleError(_0x34079f,null));};exports[_0x4632('0x43')]=function(_0x29381a,_0x23ef38){var _0x279298={'raw':!![],'where':{'id':_0x29381a['params']['id']}},_0x5cc716={};_0x5cc716[_0x4632('0x2f')]=_[_0x4632('0x44')](db[_0x4632('0x40')]['rawAttributes']);_0x5cc716[_0x4632('0x31')]=_[_0x4632('0x44')](_0x29381a[_0x4632('0x31')]);_0x5cc716[_0x4632('0x32')]=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],_0x5cc716[_0x4632('0x31')]);_0x279298['attributes']=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x29381a[_0x4632('0x31')][_0x4632('0x34')]));_0x279298['attributes']=_0x279298['attributes'][_0x4632('0x35')]?_0x279298[_0x4632('0x33')]:_0x5cc716[_0x4632('0x2f')];if(_0x29381a[_0x4632('0x31')]['includeAll']){_0x279298[_0x4632('0x46')]=[{'all':!![]}];}_0x279298=_[_0x4632('0x3a')]({},_0x279298,_0x29381a[_0x4632('0x3f')]);return db[_0x4632('0x40')][_0x4632('0x47')](_0x279298)['then'](handleEntityNotFound(_0x23ef38,null))[_0x4632('0x26')](respondWithResult(_0x23ef38,null))[_0x4632('0x48')](handleError(_0x23ef38,null));};exports[_0x4632('0x49')]=function(_0xcce5db,_0x3676fa){return db[_0x4632('0x40')][_0x4632('0x49')](_0xcce5db[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x3676fa,0xc9))[_0x4632('0x48')](handleError(_0x3676fa,null));};exports[_0x4632('0x25')]=function(_0x517584,_0xc3ffd0){if(_0x517584[_0x4632('0x4a')]['id']){delete _0x517584[_0x4632('0x4a')]['id'];}return db['FreshdeskField'][_0x4632('0x47')]({'where':{'id':_0x517584[_0x4632('0x4b')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xc3ffd0,null))[_0x4632('0x26')](saveUpdates(_0x517584[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0xc3ffd0,null))[_0x4632('0x48')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x27')]=function(_0x1f43b6,_0x1aa831){return db['FreshdeskField'][_0x4632('0x47')]({'where':{'id':_0x1f43b6[_0x4632('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1aa831,null))[_0x4632('0x26')](removeEntity(_0x1aa831,null))[_0x4632('0x48')](handleError(_0x1aa831,null));}; \ No newline at end of file +var _0x85b5=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','FreshdeskField','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x7025e0,_0xc175e2){var _0x81288=function(_0x238ef8){while(--_0x238ef8){_0x7025e0['push'](_0x7025e0['shift']());}};_0x81288(++_0xc175e2);}(_0x85b5,0x7f));var _0x585b=function(_0x2f88b3,_0x385078){_0x2f88b3=_0x2f88b3-0x0;var _0x982a0e=_0x85b5[_0x2f88b3];return _0x982a0e;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x428a9a,_0x1b06a2){return function(_0x1b1241){if(!_0x1b1241){_0x428a9a[_0x585b('0x21')](0x194);}return _0x1b1241;};}function handleError(_0x799947,_0x100189){_0x100189=_0x100189||0x1f4;return function(_0x47099f){logger[_0x585b('0x22')](_0x47099f[_0x585b('0x23')]);if(_0x47099f[_0x585b('0x24')]){delete _0x47099f[_0x585b('0x24')];}_0x799947[_0x585b('0x15')](_0x100189)['send'](_0x47099f);};}exports[_0x585b('0x25')]=function(_0x205ffe,_0x19786){var _0x2cf48a={},_0x5dad9a={},_0x4e9fc8={'count':0x0,'rows':[]};var _0xedf913=_[_0x585b('0x26')](db['FreshdeskField'][_0x585b('0x27')],function(_0x112fb5){return{'name':_0x112fb5['fieldName'],'type':_0x112fb5[_0x585b('0x28')][_0x585b('0x29')]};});_0x5dad9a[_0x585b('0x2a')]=_[_0x585b('0x26')](_0xedf913,_0x585b('0x24'));_0x5dad9a[_0x585b('0x2b')]=_[_0x585b('0x2c')](_0x205ffe[_0x585b('0x2b')]);_0x5dad9a[_0x585b('0x2d')]=_[_0x585b('0x2e')](_0x5dad9a['model'],_0x5dad9a[_0x585b('0x2b')]);_0x2cf48a[_0x585b('0x2f')]=_[_0x585b('0x2e')](_0x5dad9a['model'],qs[_0x585b('0x30')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x30')]));_0x2cf48a['attributes']=_0x2cf48a[_0x585b('0x2f')][_0x585b('0x31')]?_0x2cf48a[_0x585b('0x2f')]:_0x5dad9a[_0x585b('0x2a')];if(!_0x205ffe['query']['hasOwnProperty'](_0x585b('0x32'))){_0x2cf48a[_0x585b('0x1b')]=qs[_0x585b('0x1b')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x1b')]);_0x2cf48a['offset']=qs[_0x585b('0x1a')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x1a')]);}_0x2cf48a[_0x585b('0x33')]=qs[_0x585b('0x34')](_0x205ffe['query']['sort']);_0x2cf48a['where']=qs[_0x585b('0x2d')](_[_0x585b('0x35')](_0x205ffe[_0x585b('0x2b')],_0x5dad9a[_0x585b('0x2d')]),_0xedf913);if(_0x205ffe[_0x585b('0x2b')][_0x585b('0x36')]){_0x2cf48a[_0x585b('0x37')]=_[_0x585b('0x38')](_0x2cf48a[_0x585b('0x37')],{'$or':_['map'](_0xedf913,function(_0x434768){if(_0x434768[_0x585b('0x28')]!=='VIRTUAL'){var _0x368fb0={};_0x368fb0[_0x434768[_0x585b('0x24')]]={'$like':'%'+_0x205ffe[_0x585b('0x2b')][_0x585b('0x36')]+'%'};return _0x368fb0;}})});}_0x2cf48a=_[_0x585b('0x38')]({},_0x2cf48a,_0x205ffe[_0x585b('0x39')]);var _0x58bf4c={'where':_0x2cf48a[_0x585b('0x37')]};return db[_0x585b('0x3a')][_0x585b('0x19')](_0x58bf4c)[_0x585b('0x20')](function(_0xfa9f00){_0x4e9fc8[_0x585b('0x19')]=_0xfa9f00;if(_0x205ffe[_0x585b('0x2b')][_0x585b('0x3b')]){_0x2cf48a['include']=[{'all':!![]}];}return db[_0x585b('0x3a')][_0x585b('0x3c')](_0x2cf48a);})[_0x585b('0x20')](function(_0x4c5a14){_0x4e9fc8[_0x585b('0x3d')]=_0x4c5a14;return _0x4e9fc8;})[_0x585b('0x20')](respondWithFilteredResult(_0x19786,_0x2cf48a))[_0x585b('0x3e')](handleError(_0x19786,null));};exports['show']=function(_0x1240e2,_0x2310e3){var _0x5112f5={'raw':!![],'where':{'id':_0x1240e2[_0x585b('0x3f')]['id']}},_0x4edd57={};_0x4edd57['model']=_[_0x585b('0x2c')](db['FreshdeskField'][_0x585b('0x27')]);_0x4edd57[_0x585b('0x2b')]=_['keys'](_0x1240e2[_0x585b('0x2b')]);_0x4edd57['filters']=_['intersection'](_0x4edd57['model'],_0x4edd57[_0x585b('0x2b')]);_0x5112f5['attributes']=_[_0x585b('0x2e')](_0x4edd57[_0x585b('0x2a')],qs['fields'](_0x1240e2[_0x585b('0x2b')][_0x585b('0x30')]));_0x5112f5[_0x585b('0x2f')]=_0x5112f5['attributes']['length']?_0x5112f5['attributes']:_0x4edd57[_0x585b('0x2a')];if(_0x1240e2[_0x585b('0x2b')][_0x585b('0x3b')]){_0x5112f5[_0x585b('0x40')]=[{'all':!![]}];}_0x5112f5=_['merge']({},_0x5112f5,_0x1240e2[_0x585b('0x39')]);return db[_0x585b('0x3a')][_0x585b('0x41')](_0x5112f5)[_0x585b('0x20')](handleEntityNotFound(_0x2310e3,null))['then'](respondWithResult(_0x2310e3,null))[_0x585b('0x3e')](handleError(_0x2310e3,null));};exports[_0x585b('0x42')]=function(_0x36eb61,_0x5bf8b4){return db[_0x585b('0x3a')]['create'](_0x36eb61['body'],{})['then'](respondWithResult(_0x5bf8b4,0xc9))[_0x585b('0x3e')](handleError(_0x5bf8b4,null));};exports['update']=function(_0x1f8ae0,_0x54ab6f){if(_0x1f8ae0['body']['id']){delete _0x1f8ae0['body']['id'];}return db[_0x585b('0x3a')][_0x585b('0x41')]({'where':{'id':_0x1f8ae0['params']['id']}})['then'](handleEntityNotFound(_0x54ab6f,null))[_0x585b('0x20')](saveUpdates(_0x1f8ae0[_0x585b('0x43')],null))[_0x585b('0x20')](respondWithResult(_0x54ab6f,null))['catch'](handleError(_0x54ab6f,null));};exports[_0x585b('0x44')]=function(_0x4ca120,_0x44234e){return db['FreshdeskField'][_0x585b('0x41')]({'where':{'id':_0x4ca120['params']['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x44234e,null))['then'](removeEntity(_0x44234e,null))[_0x585b('0x3e')](handleError(_0x44234e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 29abc35..e54e10d 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 _0x2ec0=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2ec0,0x69));var _0x02ec=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x2ec0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x02ec('0x0'));var util=require(_0x02ec('0x1'));var logger=require(_0x02ec('0x2'))(_0x02ec('0x3'));var moment=require('moment');var BPromise=require(_0x02ec('0x4'));var rp=require(_0x02ec('0x5'));var fs=require('fs');var path=require(_0x02ec('0x6'));var rimraf=require(_0x02ec('0x7'));var config=require(_0x02ec('0x8'));var attributes=require(_0x02ec('0x9'));module[_0x02ec('0xa')]=function(_0x170e0d,_0x4df2ac){return _0x170e0d[_0x02ec('0xb')](_0x02ec('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x02ec('0xd'),'fields':[_0x02ec('0xe'),_0x02ec('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1af3=['path','rimraf','../../config/environment','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xcf3ae0,_0x14d61c){var _0x26e0b1=function(_0x4cadd7){while(--_0x4cadd7){_0xcf3ae0['push'](_0xcf3ae0['shift']());}};_0x26e0b1(++_0x14d61c);}(_0x1af3,0x1ca));var _0x31af=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x1af3[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var moment=require(_0x31af('0x4'));var BPromise=require(_0x31af('0x5'));var rp=require(_0x31af('0x6'));var fs=require('fs');var path=require(_0x31af('0x7'));var rimraf=require(_0x31af('0x8'));var config=require(_0x31af('0x9'));var attributes=require('./intFreshdeskField.attributes');module[_0x31af('0xa')]=function(_0x416162,_0x1ac3f6){return _0x416162[_0x31af('0xb')]('FreshdeskField',attributes,{'tableName':_0x31af('0xc'),'paranoid':![],'indexes':[{'name':_0x31af('0xd'),'fields':[_0x31af('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index ebc6585..289be8b 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 _0xe37e=['request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x404c35,_0xedfe89){var _0x28c900=function(_0x2dc0ab){while(--_0x2dc0ab){_0x404c35['push'](_0x404c35['shift']());}};_0x28c900(++_0xedfe89);}(_0xe37e,0x14d));var _0xee37=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xe37e[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xee37('0x0'));var util=require(_0xee37('0x1'));var moment=require(_0xee37('0x2'));var BPromise=require(_0xee37('0x3'));var rs=require(_0xee37('0x4'));var fs=require('fs');var Redis=require(_0xee37('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xee37('0x6'));var logger=require(_0xee37('0x7'))(_0xee37('0x8'));var config=require(_0xee37('0x9'));var jayson=require(_0xee37('0xa'));var client=jayson['client'][_0xee37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x503718,_0x5c3c7c,_0x4eeb52){return new BPromise(function(_0x34d4e2,_0x114729){return client[_0xee37('0xc')](_0x503718,_0x4eeb52)[_0xee37('0xd')](function(_0x16dbd3){logger[_0xee37('0xe')](_0xee37('0xf'),_0x5c3c7c,_0xee37('0x10'));logger['debug'](_0xee37('0x11'),_0x5c3c7c,_0xee37('0x10'),JSON[_0xee37('0x12')](_0x16dbd3));if(_0x16dbd3['error']){if(_0x16dbd3[_0xee37('0x13')]['code']===0x1f4){logger[_0xee37('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5c3c7c,_0x16dbd3[_0xee37('0x13')][_0xee37('0x14')]);return _0x114729(_0x16dbd3[_0xee37('0x13')][_0xee37('0x14')]);}logger[_0xee37('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5c3c7c,_0x16dbd3[_0xee37('0x13')]['message']);return _0x34d4e2(_0x16dbd3['error']['message']);}else{logger[_0xee37('0xe')](_0xee37('0xf'),_0x5c3c7c,_0xee37('0x10'));_0x34d4e2(_0x16dbd3[_0xee37('0x15')][_0xee37('0x14')]);}})[_0xee37('0x16')](function(_0x308114){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5c3c7c,_0x308114);_0x114729(_0x308114);});});} \ No newline at end of file +var _0x8acb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../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','lodash','util','bluebird'];(function(_0x1402d7,_0x33d514){var _0x2c976a=function(_0x59fa77){while(--_0x59fa77){_0x1402d7['push'](_0x1402d7['shift']());}};_0x2c976a(++_0x33d514);}(_0x8acb,0x8d));var _0xb8ac=function(_0xcab903,_0x336517){_0xcab903=_0xcab903-0x0;var _0xf5a18f=_0x8acb[_0xcab903];return _0xf5a18f;};'use strict';var _=require(_0xb8ac('0x0'));var util=require(_0xb8ac('0x1'));var moment=require('moment');var BPromise=require(_0xb8ac('0x2'));var rs=require(_0xb8ac('0x3'));var fs=require('fs');var Redis=require(_0xb8ac('0x4'));var db=require(_0xb8ac('0x5'))['db'];var utils=require(_0xb8ac('0x6'));var logger=require(_0xb8ac('0x7'))('rpc');var config=require(_0xb8ac('0x8'));var jayson=require(_0xb8ac('0x9'));var client=jayson['client'][_0xb8ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5acb57,_0xe21fea,_0x43160b){return new BPromise(function(_0x8983c9,_0x4abc39){return client[_0xb8ac('0xb')](_0x5acb57,_0x43160b)[_0xb8ac('0xc')](function(_0x7fb0a7){logger[_0xb8ac('0xd')](_0xb8ac('0xe'),_0xe21fea,_0xb8ac('0xf'));logger[_0xb8ac('0x10')](_0xb8ac('0x11'),_0xe21fea,_0xb8ac('0xf'),JSON[_0xb8ac('0x12')](_0x7fb0a7));if(_0x7fb0a7[_0xb8ac('0x13')]){if(_0x7fb0a7['error'][_0xb8ac('0x14')]===0x1f4){logger[_0xb8ac('0x13')]('FreshdeskField,\x20%s,\x20%s',_0xe21fea,_0x7fb0a7[_0xb8ac('0x13')][_0xb8ac('0x15')]);return _0x4abc39(_0x7fb0a7[_0xb8ac('0x13')][_0xb8ac('0x15')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0xe21fea,_0x7fb0a7['error'][_0xb8ac('0x15')]);return _0x8983c9(_0x7fb0a7[_0xb8ac('0x13')][_0xb8ac('0x15')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0xe21fea,_0xb8ac('0xf'));_0x8983c9(_0x7fb0a7[_0xb8ac('0x16')][_0xb8ac('0x15')]);}})[_0xb8ac('0x17')](function(_0x1927e8){logger[_0xb8ac('0x13')](_0xb8ac('0xe'),_0xe21fea,_0x1927e8);_0x4abc39(_0x1927e8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0c1f8c4..ba7d33e 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fd9=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x25cb87,_0xc2d352){var _0x3a7537=function(_0x53516a){while(--_0x53516a){_0x25cb87['push'](_0x25cb87['shift']());}};_0x3a7537(++_0xc2d352);}(_0x0fd9,0xa3));var _0x90fd=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0x0fd9[_0x80f51a];return _0x327148;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),controller[_0x90fd('0x10')]);router[_0x90fd('0xf')]('/:id/configurations',auth[_0x90fd('0x9')](),controller[_0x90fd('0x11')]);router['put'](_0x90fd('0xa'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x12')]);router['delete'](_0x90fd('0xa'),auth['isAuthenticated'](),controller[_0x90fd('0x13')]);module[_0x90fd('0x14')]=router; \ No newline at end of file +var _0x5eb8=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c9695,_0x2c17fd){var _0x380061=function(_0x4754e2){while(--_0x4754e2){_0x5c9695['push'](_0x5c9695['shift']());}};_0x380061(++_0x2c17fd);}(_0x5eb8,0xb0));var _0x85eb=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x5eb8[_0x421263];return _0x34e4b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x12')]('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0x12')](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['update']);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x15')]);module[_0x85eb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 8814634..9a91512 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3266=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1e2c73,_0x12cd55){var _0x46f8d5=function(_0xe5a2fd){while(--_0xe5a2fd){_0x1e2c73['push'](_0x1e2c73['shift']());}};_0x46f8d5(++_0x12cd55);}(_0x3266,0x6a));var _0x6326=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x3266[_0x11a220];return _0x20d8fe;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')]},'description':{'type':Sequelize[_0x6326('0x2')]},'username':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x3')},'apiKey':{'type':Sequelize[_0x6326('0x2')]},'remoteUri':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x065e=['sequelize','STRING','username'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x065e,0x1a7));var _0xe065=function(_0x4aefa0,_0x242eaa){_0x4aefa0=_0x4aefa0-0x0;var _0x17086c=_0x065e[_0x4aefa0];return _0x17086c;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe065('0x1')],'unique':_0xe065('0x2')},'apiKey':{'type':Sequelize[_0xe065('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 3113f73..5689454 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f2d=['find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','remoteUri','apiKey','slice','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','FreshsalesAccount','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','catch','show','params','keys','rawAttributes'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x3f2d,0x13d));var _0xd3f2=function(_0x51491a,_0x8858df){_0x51491a=_0x51491a-0x0;var _0x3f2b9d=_0x3f2d[_0x51491a];return _0x3f2b9d;};'use strict';var emlformat=require(_0xd3f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3f2('0x1'));var jsonpatch=require(_0xd3f2('0x2'));var rp=require(_0xd3f2('0x3'));var moment=require(_0xd3f2('0x4'));var BPromise=require(_0xd3f2('0x5'));var Mustache=require(_0xd3f2('0x6'));var util=require('util');var path=require(_0xd3f2('0x7'));var sox=require(_0xd3f2('0x8'));var csv=require(_0xd3f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3f2('0xa'));var squel=require(_0xd3f2('0xb'));var crypto=require('crypto');var jsforce=require(_0xd3f2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd3f2('0x9'));var querystring=require('querystring');var Papa=require(_0xd3f2('0xd'));var Redis=require(_0xd3f2('0xe'));var authService=require(_0xd3f2('0xf'));var qs=require(_0xd3f2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3f2('0x11'));var logger=require(_0xd3f2('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd3f2('0x13'));var licenseUtil=require(_0xd3f2('0x14'));var db=require(_0xd3f2('0x15'))['db'];var integrations=require(_0xd3f2('0x16'));function respondWithStatusCode(_0x23d7b5,_0xd43697){_0xd43697=_0xd43697||0xcc;return function(_0x36702c){if(_0x36702c){return _0x23d7b5['sendStatus'](_0xd43697);}return _0x23d7b5[_0xd3f2('0x17')](_0xd43697)[_0xd3f2('0x18')]();};}function respondWithResult(_0x2d2152,_0x545676){_0x545676=_0x545676||0xc8;return function(_0xfa0405){if(_0xfa0405){return _0x2d2152['status'](_0x545676)['json'](_0xfa0405);}};}function respondWithFilteredResult(_0x55743c,_0x32bc26){return function(_0x4d5913){if(_0x4d5913){var _0x1eb58f=typeof _0x32bc26['offset']===_0xd3f2('0x19')&&typeof _0x32bc26['limit']===_0xd3f2('0x19');var _0x12bd79=_0x4d5913[_0xd3f2('0x1a')];var _0x580018=_0x1eb58f?0x0:_0x32bc26[_0xd3f2('0x1b')];var _0x5e7c6f=_0x1eb58f?_0x4d5913[_0xd3f2('0x1a')]:_0x32bc26[_0xd3f2('0x1b')]+_0x32bc26[_0xd3f2('0x1c')];var _0x587ec3;if(_0x5e7c6f>=_0x12bd79){_0x5e7c6f=_0x12bd79;_0x587ec3=0xc8;}else{_0x587ec3=0xce;}_0x55743c[_0xd3f2('0x17')](_0x587ec3);return _0x55743c[_0xd3f2('0x1d')]('Content-Range',_0x580018+'-'+_0x5e7c6f+'/'+_0x12bd79)['json'](_0x4d5913);}return null;};}function patchUpdates(_0x30a284){return function(_0x486807){try{jsonpatch[_0xd3f2('0x1e')](_0x486807,_0x30a284,!![]);}catch(_0x38a267){return BPromise[_0xd3f2('0x1f')](_0x38a267);}return _0x486807[_0xd3f2('0x20')]();};}function saveUpdates(_0x59c016,_0x1add23){return function(_0x216456){if(_0x216456){return _0x216456[_0xd3f2('0x21')](_0x59c016)[_0xd3f2('0x22')](function(_0x3d8166){return _0x3d8166;});}return null;};}function removeEntity(_0x3b2a22,_0x1e08d4){return function(_0x5402c2){if(_0x5402c2){return _0x5402c2[_0xd3f2('0x23')]()[_0xd3f2('0x22')](function(){_0x3b2a22['status'](0xcc)[_0xd3f2('0x18')]();});}};}function handleEntityNotFound(_0x350cf2,_0xb964b3){return function(_0x4aef17){if(!_0x4aef17){_0x350cf2[_0xd3f2('0x24')](0x194);}return _0x4aef17;};}function handleError(_0x42350f,_0x2d5e22){_0x2d5e22=_0x2d5e22||0x1f4;return function(_0x13ad5e){logger[_0xd3f2('0x25')](_0x13ad5e['stack']);if(_0x13ad5e[_0xd3f2('0x26')]){delete _0x13ad5e['name'];}_0x42350f[_0xd3f2('0x17')](_0x2d5e22)['send'](_0x13ad5e);};}exports[_0xd3f2('0x27')]=function(_0x42d945,_0x4cedfc){var _0x54ecbf={},_0x2659f7={},_0x320745={'count':0x0,'rows':[]};var _0x116380=_[_0xd3f2('0x28')](db[_0xd3f2('0x29')]['rawAttributes'],function(_0x75d0dc){return{'name':_0x75d0dc['fieldName'],'type':_0x75d0dc[_0xd3f2('0x2a')][_0xd3f2('0x2b')]};});_0x2659f7['model']=_['map'](_0x116380,'name');_0x2659f7[_0xd3f2('0x2c')]=_['keys'](_0x42d945[_0xd3f2('0x2c')]);_0x2659f7['filters']=_[_0xd3f2('0x2d')](_0x2659f7[_0xd3f2('0x2e')],_0x2659f7[_0xd3f2('0x2c')]);_0x54ecbf['attributes']=_['intersection'](_0x2659f7[_0xd3f2('0x2e')],qs[_0xd3f2('0x2f')](_0x42d945['query'][_0xd3f2('0x2f')]));_0x54ecbf[_0xd3f2('0x30')]=_0x54ecbf[_0xd3f2('0x30')][_0xd3f2('0x31')]?_0x54ecbf[_0xd3f2('0x30')]:_0x2659f7[_0xd3f2('0x2e')];if(!_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x32')](_0xd3f2('0x33'))){_0x54ecbf['limit']=qs[_0xd3f2('0x1c')](_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x1c')]);_0x54ecbf[_0xd3f2('0x1b')]=qs[_0xd3f2('0x1b')](_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x1b')]);}_0x54ecbf[_0xd3f2('0x34')]=qs[_0xd3f2('0x35')](_0x42d945['query'][_0xd3f2('0x35')]);_0x54ecbf[_0xd3f2('0x36')]=qs['filters'](_[_0xd3f2('0x37')](_0x42d945[_0xd3f2('0x2c')],_0x2659f7[_0xd3f2('0x38')]),_0x116380);if(_0x42d945['query'][_0xd3f2('0x39')]){_0x54ecbf[_0xd3f2('0x36')]=_[_0xd3f2('0x3a')](_0x54ecbf[_0xd3f2('0x36')],{'$or':_[_0xd3f2('0x28')](_0x116380,function(_0x437dcb){if(_0x437dcb[_0xd3f2('0x2a')]!=='VIRTUAL'){var _0x5803b2={};_0x5803b2[_0x437dcb[_0xd3f2('0x26')]]={'$like':'%'+_0x42d945[_0xd3f2('0x2c')][_0xd3f2('0x39')]+'%'};return _0x5803b2;}})});}_0x54ecbf=_[_0xd3f2('0x3a')]({},_0x54ecbf,_0x42d945[_0xd3f2('0x3b')]);var _0x4d14d9={'where':_0x54ecbf['where']};return db[_0xd3f2('0x29')][_0xd3f2('0x1a')](_0x4d14d9)['then'](function(_0x4bc92a){_0x320745[_0xd3f2('0x1a')]=_0x4bc92a;if(_0x42d945['query'][_0xd3f2('0x3c')]){_0x54ecbf[_0xd3f2('0x3d')]=[{'all':!![]}];}return db[_0xd3f2('0x29')]['findAll'](_0x54ecbf);})[_0xd3f2('0x22')](function(_0x235cc4){_0x320745['rows']=_0x235cc4;return _0x320745;})[_0xd3f2('0x22')](respondWithFilteredResult(_0x4cedfc,_0x54ecbf))[_0xd3f2('0x3e')](handleError(_0x4cedfc,null));};exports[_0xd3f2('0x3f')]=function(_0x2abd83,_0xe56a6){var _0x31f91e={'raw':![],'where':{'id':_0x2abd83[_0xd3f2('0x40')]['id']}},_0x55a0ab={};_0x55a0ab[_0xd3f2('0x2e')]=_[_0xd3f2('0x41')](db[_0xd3f2('0x29')][_0xd3f2('0x42')]);_0x55a0ab[_0xd3f2('0x2c')]=_[_0xd3f2('0x41')](_0x2abd83[_0xd3f2('0x2c')]);_0x55a0ab[_0xd3f2('0x38')]=_[_0xd3f2('0x2d')](_0x55a0ab[_0xd3f2('0x2e')],_0x55a0ab[_0xd3f2('0x2c')]);_0x31f91e[_0xd3f2('0x30')]=_['intersection'](_0x55a0ab[_0xd3f2('0x2e')],qs['fields'](_0x2abd83[_0xd3f2('0x2c')][_0xd3f2('0x2f')]));_0x31f91e['attributes']=_0x31f91e[_0xd3f2('0x30')]['length']?_0x31f91e[_0xd3f2('0x30')]:_0x55a0ab['model'];if(_0x2abd83[_0xd3f2('0x2c')][_0xd3f2('0x3c')]){_0x31f91e[_0xd3f2('0x3d')]=[{'all':!![]}];}_0x31f91e=_[_0xd3f2('0x3a')]({},_0x31f91e,_0x2abd83[_0xd3f2('0x3b')]);return db[_0xd3f2('0x29')][_0xd3f2('0x43')](_0x31f91e)['then'](handleEntityNotFound(_0xe56a6,null))[_0xd3f2('0x22')](respondWithResult(_0xe56a6,null))[_0xd3f2('0x3e')](handleError(_0xe56a6,null));};exports[_0xd3f2('0x44')]=function(_0x286ccd,_0x378efb){return db['FreshsalesAccount'][_0xd3f2('0x44')](_0x286ccd[_0xd3f2('0x45')],{})[_0xd3f2('0x22')](respondWithResult(_0x378efb,0xc9))[_0xd3f2('0x3e')](handleError(_0x378efb,null));};exports[_0xd3f2('0x21')]=function(_0x484473,_0x41af6a){if(_0x484473[_0xd3f2('0x45')]['id']){delete _0x484473['body']['id'];}return db['FreshsalesAccount'][_0xd3f2('0x43')]({'where':{'id':_0x484473[_0xd3f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x41af6a,null))['then'](saveUpdates(_0x484473[_0xd3f2('0x45')],null))[_0xd3f2('0x22')](respondWithResult(_0x41af6a,null))[_0xd3f2('0x3e')](handleError(_0x41af6a,null));};exports['destroy']=function(_0x52e09e,_0x5f3b81){return db[_0xd3f2('0x29')][_0xd3f2('0x43')]({'where':{'id':_0x52e09e[_0xd3f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x5f3b81,null))[_0xd3f2('0x22')](removeEntity(_0x5f3b81,null))['catch'](handleError(_0x5f3b81,null));};exports[_0xd3f2('0x46')]=function(_0x5ad446,_0xc20544,_0x59e9be){var _0x52f5f7={};var _0x5d498f={};var _0x481b53;var _0x184f79;return db[_0xd3f2('0x29')][_0xd3f2('0x47')]({'where':{'id':_0x5ad446[_0xd3f2('0x40')]['id']}})[_0xd3f2('0x22')](handleEntityNotFound(_0xc20544,null))[_0xd3f2('0x22')](function(_0x1a4b8c){if(_0x1a4b8c){_0x481b53=_0x1a4b8c;_0x5d498f[_0xd3f2('0x2e')]=_[_0xd3f2('0x41')](db[_0xd3f2('0x48')]['rawAttributes']);_0x5d498f['query']=_[_0xd3f2('0x41')](_0x5ad446[_0xd3f2('0x2c')]);_0x5d498f[_0xd3f2('0x38')]=_[_0xd3f2('0x2d')](_0x5d498f[_0xd3f2('0x2e')],_0x5d498f['query']);_0x52f5f7[_0xd3f2('0x30')]=_[_0xd3f2('0x2d')](_0x5d498f[_0xd3f2('0x2e')],qs[_0xd3f2('0x2f')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x2f')]));_0x52f5f7[_0xd3f2('0x30')]=_0x52f5f7[_0xd3f2('0x30')][_0xd3f2('0x31')]?_0x52f5f7[_0xd3f2('0x30')]:_0x5d498f[_0xd3f2('0x2e')];_0x52f5f7[_0xd3f2('0x34')]=qs[_0xd3f2('0x35')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x35')]);_0x52f5f7['where']=qs[_0xd3f2('0x38')](_['pick'](_0x5ad446[_0xd3f2('0x2c')],_0x5d498f[_0xd3f2('0x38')]));if(_0x5ad446['query'][_0xd3f2('0x39')]){_0x52f5f7[_0xd3f2('0x36')]=_[_0xd3f2('0x3a')](_0x52f5f7[_0xd3f2('0x36')],{'$or':_[_0xd3f2('0x28')](_0x52f5f7['attributes'],function(_0x4ec354){var _0x1def61={};_0x1def61[_0x4ec354]={'$like':'%'+_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x39')]+'%'};return _0x1def61;})});}_0x52f5f7=_['merge']({},_0x52f5f7,_0x5ad446[_0xd3f2('0x3b')]);return _0x481b53[_0xd3f2('0x46')](_0x52f5f7);}})['then'](function(_0x18e49a){if(_0x18e49a){_0x184f79=_0x18e49a[_0xd3f2('0x31')];if(!_0x5ad446[_0xd3f2('0x2c')]['hasOwnProperty'](_0xd3f2('0x33'))){_0x52f5f7[_0xd3f2('0x1c')]=qs[_0xd3f2('0x1c')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x1c')]);_0x52f5f7[_0xd3f2('0x1b')]=qs[_0xd3f2('0x1b')](_0x5ad446[_0xd3f2('0x2c')][_0xd3f2('0x1b')]);}return _0x481b53[_0xd3f2('0x46')](_0x52f5f7);}})['then'](function(_0x2a8482){if(_0x2a8482){return _0x2a8482?{'count':_0x184f79,'rows':_0x2a8482}:null;}})['then'](respondWithResult(_0xc20544,null))[_0xd3f2('0x3e')](handleError(_0xc20544,null));};exports[_0xd3f2('0x49')]=function(_0xaace16,_0x17918a,_0x577093){if(_0xaace16[_0xd3f2('0x45')]['id']){delete _0xaace16[_0xd3f2('0x45')]['id'];}return db[_0xd3f2('0x29')][_0xd3f2('0x47')]({'where':{'id':_0xaace16[_0xd3f2('0x40')]['id']}})[_0xd3f2('0x22')](handleEntityNotFound(_0x17918a,null))[_0xd3f2('0x22')](function(_0x44a308){if(_0x44a308){_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x4a')]=_0x44a308['id'];_0xaace16[_0xd3f2('0x45')]['Subjects']=integrations['getSubjects'](_0xaace16[_0xd3f2('0x45')]['channel'],_0xaace16[_0xd3f2('0x45')]['type']);_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x4b')]=integrations[_0xd3f2('0x4c')](_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x4d')],_0xaace16[_0xd3f2('0x45')][_0xd3f2('0x2a')]);return db[_0xd3f2('0x48')]['create'](_0xaace16['body'],{'include':[{'model':db[_0xd3f2('0x4e')],'as':_0xd3f2('0x4f')},{'model':db[_0xd3f2('0x4e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x17918a,null))['catch'](handleError(_0x17918a,null));};exports[_0xd3f2('0x50')]=function(_0x39f1f0,_0x1b7d47,_0x591468){var _0x5a6ec8='';var _0x3037c2='';return db[_0xd3f2('0x29')][_0xd3f2('0x47')]({'where':{'id':_0x39f1f0[_0xd3f2('0x40')]['id']},'attributes':['id','username',_0xd3f2('0x51'),_0xd3f2('0x52')]})['then'](handleEntityNotFound(_0x1b7d47,null))['then'](function(_0x104004){if(_0x104004){_0x3037c2=_0x104004['username'];_0x5a6ec8=_0x104004['remoteUri'];var _0x47120d=_0x104004[_0xd3f2('0x51')][_0xd3f2('0x53')](-0x1);if(_0x47120d==='/'){_0x5a6ec8=_0x5a6ec8['substring'](0x0,_0x5a6ec8['lastIndexOf'](_0x47120d));}return rp({'method':_0xd3f2('0x54'),'uri':util[_0xd3f2('0x55')](_0xd3f2('0x56'),_0x5a6ec8,_0xd3f2('0x57')),'headers':{'Authorization':_0xd3f2('0x58')+_0x104004[_0xd3f2('0x52')]},'json':!![]});}})[_0xd3f2('0x22')](function(_0x275ae8){if(_0x275ae8){var _0x1802d7=_0x275ae8['users'];var _0x4fd6b2=![];var _0xc7c82d=null;for(_0xc7c82d=0x0;_0xc7c82d<_0x1802d7['length'];_0xc7c82d++){if(_0x1802d7[_0xc7c82d][_0xd3f2('0x59')]===_0x3037c2){_0x4fd6b2=!![];}}if(_0x4fd6b2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd3f2('0x5a')});}}})[_0xd3f2('0x22')](respondWithResult(_0x1b7d47,null))[_0xd3f2('0x3e')](function(_0x2ee742){var _0x6e2ed1=_0x39f1f0['query'][_0xd3f2('0x5b')]?0x1f4:_0x2ee742[_0xd3f2('0x5c')]||0x1f4;logger[_0xd3f2('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x6e2ed1,JSON[_0xd3f2('0x5d')](_0x2ee742));delete _0x2ee742['name'];if(_0x6e2ed1===0x191){_0x6e2ed1=0x190;}_0x1b7d47[_0xd3f2('0x17')](_0x6e2ed1)[_0xd3f2('0x5e')](_0x39f1f0[_0xd3f2('0x2c')][_0xd3f2('0x5b')]?{'message':_0xd3f2('0x5f'),'statusCode':_0x2ee742[_0xd3f2('0x5c')]}:_0x2ee742);});}; \ No newline at end of file +var _0xa0ac=['findAll','rows','show','params','find','catch','create','body','destroy','findOne','FreshsalesConfiguration','order','getConfigurations','nolimit','addConfiguration','getSubjects','channel','getDescriptions','FreshsalesField','Subjects','Descriptions','getFields','remoteUri','username','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','FreshsalesAccount','includeAll','include'];(function(_0xcb2ff2,_0x1c217a){var _0x3ba005=function(_0x281d36){while(--_0x281d36){_0xcb2ff2['push'](_0xcb2ff2['shift']());}};_0x3ba005(++_0x1c217a);}(_0xa0ac,0x15c));var _0xca0a=function(_0x22f416,_0x4a04b1){_0x22f416=_0x22f416-0x0;var _0x42a39e=_0xa0ac[_0x22f416];return _0x42a39e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0a('0x0'));var zipdir=require(_0xca0a('0x1'));var jsonpatch=require(_0xca0a('0x2'));var rp=require(_0xca0a('0x3'));var moment=require(_0xca0a('0x4'));var BPromise=require(_0xca0a('0x5'));var Mustache=require(_0xca0a('0x6'));var util=require(_0xca0a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xca0a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca0a('0x9'));var _=require(_0xca0a('0xa'));var squel=require(_0xca0a('0xb'));var crypto=require(_0xca0a('0xc'));var jsforce=require(_0xca0a('0xd'));var deskjs=require(_0xca0a('0xe'));var toCsv=require(_0xca0a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca0a('0xf'));var authService=require(_0xca0a('0x10'));var qs=require(_0xca0a('0x11'));var as=require(_0xca0a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca0a('0x13'))(_0xca0a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xca0a('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xca0a('0x16'));function respondWithStatusCode(_0x54eb55,_0x4a4dcd){_0x4a4dcd=_0x4a4dcd||0xcc;return function(_0x5a2bf2){if(_0x5a2bf2){return _0x54eb55['sendStatus'](_0x4a4dcd);}return _0x54eb55[_0xca0a('0x17')](_0x4a4dcd)[_0xca0a('0x18')]();};}function respondWithResult(_0x1d2e9d,_0x4e17ca){_0x4e17ca=_0x4e17ca||0xc8;return function(_0x1dd766){if(_0x1dd766){return _0x1d2e9d['status'](_0x4e17ca)['json'](_0x1dd766);}};}function respondWithFilteredResult(_0x19f397,_0x352b9c){return function(_0x2274da){if(_0x2274da){var _0x5e91d6=typeof _0x352b9c[_0xca0a('0x19')]===_0xca0a('0x1a')&&typeof _0x352b9c[_0xca0a('0x1b')]===_0xca0a('0x1a');var _0xa49e70=_0x2274da[_0xca0a('0x1c')];var _0xaa7136=_0x5e91d6?0x0:_0x352b9c['offset'];var _0xddfb86=_0x5e91d6?_0x2274da['count']:_0x352b9c[_0xca0a('0x19')]+_0x352b9c['limit'];var _0x14ad07;if(_0xddfb86>=_0xa49e70){_0xddfb86=_0xa49e70;_0x14ad07=0xc8;}else{_0x14ad07=0xce;}_0x19f397['status'](_0x14ad07);return _0x19f397[_0xca0a('0x1d')](_0xca0a('0x1e'),_0xaa7136+'-'+_0xddfb86+'/'+_0xa49e70)[_0xca0a('0x1f')](_0x2274da);}return null;};}function patchUpdates(_0x271873){return function(_0x134676){try{jsonpatch[_0xca0a('0x20')](_0x134676,_0x271873,!![]);}catch(_0x1448da){return BPromise[_0xca0a('0x21')](_0x1448da);}return _0x134676[_0xca0a('0x22')]();};}function saveUpdates(_0x4e3b16,_0x4c0979){return function(_0x548a7a){if(_0x548a7a){return _0x548a7a['update'](_0x4e3b16)[_0xca0a('0x23')](function(_0x1213f3){return _0x1213f3;});}return null;};}function removeEntity(_0x1c9bc8,_0x22ae42){return function(_0x3c87a4){if(_0x3c87a4){return _0x3c87a4['destroy']()['then'](function(){_0x1c9bc8[_0xca0a('0x17')](0xcc)[_0xca0a('0x18')]();});}};}function handleEntityNotFound(_0x5ccc20,_0x4d0e65){return function(_0x232f2c){if(!_0x232f2c){_0x5ccc20[_0xca0a('0x24')](0x194);}return _0x232f2c;};}function handleError(_0x630b56,_0x14d225){_0x14d225=_0x14d225||0x1f4;return function(_0xbc87ee){logger['error'](_0xbc87ee[_0xca0a('0x25')]);if(_0xbc87ee[_0xca0a('0x26')]){delete _0xbc87ee[_0xca0a('0x26')];}_0x630b56[_0xca0a('0x17')](_0x14d225)[_0xca0a('0x27')](_0xbc87ee);};}exports[_0xca0a('0x28')]=function(_0x2168e2,_0x3783b8){var _0x5c5f27={},_0x1d5b53={},_0x27acb8={'count':0x0,'rows':[]};var _0x89f1d=_[_0xca0a('0x29')](db['FreshsalesAccount'][_0xca0a('0x2a')],function(_0x4656fe){return{'name':_0x4656fe[_0xca0a('0x2b')],'type':_0x4656fe[_0xca0a('0x2c')]['key']};});_0x1d5b53[_0xca0a('0x2d')]=_[_0xca0a('0x29')](_0x89f1d,_0xca0a('0x26'));_0x1d5b53[_0xca0a('0x2e')]=_[_0xca0a('0x2f')](_0x2168e2['query']);_0x1d5b53[_0xca0a('0x30')]=_[_0xca0a('0x31')](_0x1d5b53[_0xca0a('0x2d')],_0x1d5b53[_0xca0a('0x2e')]);_0x5c5f27['attributes']=_[_0xca0a('0x31')](_0x1d5b53[_0xca0a('0x2d')],qs[_0xca0a('0x32')](_0x2168e2[_0xca0a('0x2e')][_0xca0a('0x32')]));_0x5c5f27[_0xca0a('0x33')]=_0x5c5f27[_0xca0a('0x33')][_0xca0a('0x34')]?_0x5c5f27[_0xca0a('0x33')]:_0x1d5b53[_0xca0a('0x2d')];if(!_0x2168e2['query'][_0xca0a('0x35')]('nolimit')){_0x5c5f27[_0xca0a('0x1b')]=qs[_0xca0a('0x1b')](_0x2168e2['query'][_0xca0a('0x1b')]);_0x5c5f27[_0xca0a('0x19')]=qs[_0xca0a('0x19')](_0x2168e2[_0xca0a('0x2e')][_0xca0a('0x19')]);}_0x5c5f27['order']=qs[_0xca0a('0x36')](_0x2168e2[_0xca0a('0x2e')][_0xca0a('0x36')]);_0x5c5f27[_0xca0a('0x37')]=qs['filters'](_[_0xca0a('0x38')](_0x2168e2[_0xca0a('0x2e')],_0x1d5b53[_0xca0a('0x30')]),_0x89f1d);if(_0x2168e2['query'][_0xca0a('0x39')]){_0x5c5f27[_0xca0a('0x37')]=_['merge'](_0x5c5f27['where'],{'$or':_[_0xca0a('0x29')](_0x89f1d,function(_0x1805d6){if(_0x1805d6[_0xca0a('0x2c')]!==_0xca0a('0x3a')){var _0x4b0589={};_0x4b0589[_0x1805d6[_0xca0a('0x26')]]={'$like':'%'+_0x2168e2['query'][_0xca0a('0x39')]+'%'};return _0x4b0589;}})});}_0x5c5f27=_[_0xca0a('0x3b')]({},_0x5c5f27,_0x2168e2[_0xca0a('0x3c')]);var _0x49f64c={'where':_0x5c5f27[_0xca0a('0x37')]};return db[_0xca0a('0x3d')][_0xca0a('0x1c')](_0x49f64c)[_0xca0a('0x23')](function(_0x48ffae){_0x27acb8['count']=_0x48ffae;if(_0x2168e2[_0xca0a('0x2e')][_0xca0a('0x3e')]){_0x5c5f27[_0xca0a('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xca0a('0x40')](_0x5c5f27);})[_0xca0a('0x23')](function(_0x289c43){_0x27acb8[_0xca0a('0x41')]=_0x289c43;return _0x27acb8;})[_0xca0a('0x23')](respondWithFilteredResult(_0x3783b8,_0x5c5f27))['catch'](handleError(_0x3783b8,null));};exports[_0xca0a('0x42')]=function(_0x23783f,_0xf8ff3d){var _0x374d97={'raw':![],'where':{'id':_0x23783f[_0xca0a('0x43')]['id']}},_0x493d97={};_0x493d97['model']=_[_0xca0a('0x2f')](db[_0xca0a('0x3d')][_0xca0a('0x2a')]);_0x493d97[_0xca0a('0x2e')]=_[_0xca0a('0x2f')](_0x23783f[_0xca0a('0x2e')]);_0x493d97['filters']=_['intersection'](_0x493d97[_0xca0a('0x2d')],_0x493d97[_0xca0a('0x2e')]);_0x374d97['attributes']=_[_0xca0a('0x31')](_0x493d97[_0xca0a('0x2d')],qs[_0xca0a('0x32')](_0x23783f[_0xca0a('0x2e')]['fields']));_0x374d97['attributes']=_0x374d97[_0xca0a('0x33')][_0xca0a('0x34')]?_0x374d97[_0xca0a('0x33')]:_0x493d97[_0xca0a('0x2d')];if(_0x23783f[_0xca0a('0x2e')]['includeAll']){_0x374d97[_0xca0a('0x3f')]=[{'all':!![]}];}_0x374d97=_[_0xca0a('0x3b')]({},_0x374d97,_0x23783f['options']);return db['FreshsalesAccount'][_0xca0a('0x44')](_0x374d97)[_0xca0a('0x23')](handleEntityNotFound(_0xf8ff3d,null))[_0xca0a('0x23')](respondWithResult(_0xf8ff3d,null))[_0xca0a('0x45')](handleError(_0xf8ff3d,null));};exports[_0xca0a('0x46')]=function(_0x4e7756,_0x2c6b23){return db[_0xca0a('0x3d')][_0xca0a('0x46')](_0x4e7756[_0xca0a('0x47')],{})[_0xca0a('0x23')](respondWithResult(_0x2c6b23,0xc9))[_0xca0a('0x45')](handleError(_0x2c6b23,null));};exports['update']=function(_0x2beafd,_0x3d4957){if(_0x2beafd['body']['id']){delete _0x2beafd[_0xca0a('0x47')]['id'];}return db['FreshsalesAccount'][_0xca0a('0x44')]({'where':{'id':_0x2beafd['params']['id']}})[_0xca0a('0x23')](handleEntityNotFound(_0x3d4957,null))[_0xca0a('0x23')](saveUpdates(_0x2beafd[_0xca0a('0x47')],null))[_0xca0a('0x23')](respondWithResult(_0x3d4957,null))[_0xca0a('0x45')](handleError(_0x3d4957,null));};exports[_0xca0a('0x48')]=function(_0x361846,_0x40b48a){return db['FreshsalesAccount'][_0xca0a('0x44')]({'where':{'id':_0x361846[_0xca0a('0x43')]['id']}})[_0xca0a('0x23')](handleEntityNotFound(_0x40b48a,null))[_0xca0a('0x23')](removeEntity(_0x40b48a,null))[_0xca0a('0x45')](handleError(_0x40b48a,null));};exports['getConfigurations']=function(_0x268047,_0x19290a,_0xc396c2){var _0x51d941={};var _0x1eac3a={};var _0x519e83;var _0x5c9474;return db[_0xca0a('0x3d')][_0xca0a('0x49')]({'where':{'id':_0x268047['params']['id']}})[_0xca0a('0x23')](handleEntityNotFound(_0x19290a,null))[_0xca0a('0x23')](function(_0x52ef14){if(_0x52ef14){_0x519e83=_0x52ef14;_0x1eac3a[_0xca0a('0x2d')]=_[_0xca0a('0x2f')](db[_0xca0a('0x4a')]['rawAttributes']);_0x1eac3a['query']=_[_0xca0a('0x2f')](_0x268047[_0xca0a('0x2e')]);_0x1eac3a[_0xca0a('0x30')]=_[_0xca0a('0x31')](_0x1eac3a[_0xca0a('0x2d')],_0x1eac3a['query']);_0x51d941[_0xca0a('0x33')]=_[_0xca0a('0x31')](_0x1eac3a['model'],qs[_0xca0a('0x32')](_0x268047[_0xca0a('0x2e')][_0xca0a('0x32')]));_0x51d941[_0xca0a('0x33')]=_0x51d941[_0xca0a('0x33')]['length']?_0x51d941['attributes']:_0x1eac3a[_0xca0a('0x2d')];_0x51d941[_0xca0a('0x4b')]=qs[_0xca0a('0x36')](_0x268047[_0xca0a('0x2e')][_0xca0a('0x36')]);_0x51d941['where']=qs['filters'](_['pick'](_0x268047[_0xca0a('0x2e')],_0x1eac3a[_0xca0a('0x30')]));if(_0x268047[_0xca0a('0x2e')][_0xca0a('0x39')]){_0x51d941[_0xca0a('0x37')]=_['merge'](_0x51d941[_0xca0a('0x37')],{'$or':_[_0xca0a('0x29')](_0x51d941[_0xca0a('0x33')],function(_0x4a588f){var _0xf8f4c7={};_0xf8f4c7[_0x4a588f]={'$like':'%'+_0x268047[_0xca0a('0x2e')][_0xca0a('0x39')]+'%'};return _0xf8f4c7;})});}_0x51d941=_[_0xca0a('0x3b')]({},_0x51d941,_0x268047['options']);return _0x519e83[_0xca0a('0x4c')](_0x51d941);}})[_0xca0a('0x23')](function(_0x1f5861){if(_0x1f5861){_0x5c9474=_0x1f5861[_0xca0a('0x34')];if(!_0x268047['query'][_0xca0a('0x35')](_0xca0a('0x4d'))){_0x51d941[_0xca0a('0x1b')]=qs[_0xca0a('0x1b')](_0x268047[_0xca0a('0x2e')][_0xca0a('0x1b')]);_0x51d941[_0xca0a('0x19')]=qs[_0xca0a('0x19')](_0x268047['query'][_0xca0a('0x19')]);}return _0x519e83[_0xca0a('0x4c')](_0x51d941);}})[_0xca0a('0x23')](function(_0x428434){if(_0x428434){return _0x428434?{'count':_0x5c9474,'rows':_0x428434}:null;}})['then'](respondWithResult(_0x19290a,null))['catch'](handleError(_0x19290a,null));};exports[_0xca0a('0x4e')]=function(_0xd7f515,_0x16bae3,_0x28d214){if(_0xd7f515[_0xca0a('0x47')]['id']){delete _0xd7f515[_0xca0a('0x47')]['id'];}return db[_0xca0a('0x3d')]['findOne']({'where':{'id':_0xd7f515[_0xca0a('0x43')]['id']}})[_0xca0a('0x23')](handleEntityNotFound(_0x16bae3,null))[_0xca0a('0x23')](function(_0x3d944f){if(_0x3d944f){_0xd7f515[_0xca0a('0x47')]['AccountId']=_0x3d944f['id'];_0xd7f515[_0xca0a('0x47')]['Subjects']=integrations[_0xca0a('0x4f')](_0xd7f515[_0xca0a('0x47')][_0xca0a('0x50')],_0xd7f515[_0xca0a('0x47')]['type']);_0xd7f515[_0xca0a('0x47')]['Descriptions']=integrations[_0xca0a('0x51')](_0xd7f515[_0xca0a('0x47')][_0xca0a('0x50')],_0xd7f515[_0xca0a('0x47')]['type']);return db[_0xca0a('0x4a')]['create'](_0xd7f515[_0xca0a('0x47')],{'include':[{'model':db[_0xca0a('0x52')],'as':_0xca0a('0x53')},{'model':db[_0xca0a('0x52')],'as':_0xca0a('0x54')}]});}return null;})[_0xca0a('0x23')](respondWithResult(_0x16bae3,null))[_0xca0a('0x45')](handleError(_0x16bae3,null));};exports[_0xca0a('0x55')]=function(_0x197bf7,_0x26c564,_0x39de7a){var _0x1588f6='';var _0x1758dc='';return db[_0xca0a('0x3d')]['findOne']({'where':{'id':_0x197bf7[_0xca0a('0x43')]['id']},'attributes':['id','username',_0xca0a('0x56'),'apiKey']})[_0xca0a('0x23')](handleEntityNotFound(_0x26c564,null))[_0xca0a('0x23')](function(_0x4545a2){if(_0x4545a2){_0x1758dc=_0x4545a2[_0xca0a('0x57')];_0x1588f6=_0x4545a2[_0xca0a('0x56')];var _0x2e02c6=_0x4545a2[_0xca0a('0x56')][_0xca0a('0x58')](-0x1);if(_0x2e02c6==='/'){_0x1588f6=_0x1588f6[_0xca0a('0x59')](0x0,_0x1588f6['lastIndexOf'](_0x2e02c6));}return rp({'method':_0xca0a('0x5a'),'uri':util[_0xca0a('0x5b')](_0xca0a('0x5c'),_0x1588f6,_0xca0a('0x5d')),'headers':{'Authorization':_0xca0a('0x5e')+_0x4545a2[_0xca0a('0x5f')]},'json':!![]});}})[_0xca0a('0x23')](function(_0x9fa84e){if(_0x9fa84e){var _0x1e7a57=_0x9fa84e[_0xca0a('0x60')];var _0x3af6a7=![];var _0x110336=null;for(_0x110336=0x0;_0x110336<_0x1e7a57[_0xca0a('0x34')];_0x110336++){if(_0x1e7a57[_0x110336]['email']===_0x1758dc){_0x3af6a7=!![];}}if(_0x3af6a7){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x26c564,null))[_0xca0a('0x45')](function(_0x3635a2){var _0x204985=_0x197bf7[_0xca0a('0x2e')][_0xca0a('0x61')]?0x1f4:_0x3635a2['statusCode']||0x1f4;logger[_0xca0a('0x62')](_0xca0a('0x63'),'getFields',_0x204985,JSON[_0xca0a('0x64')](_0x3635a2));delete _0x3635a2[_0xca0a('0x26')];if(_0x204985===0x191){_0x204985=0x190;}_0x26c564['status'](_0x204985)[_0xca0a('0x27')](_0x197bf7[_0xca0a('0x2e')][_0xca0a('0x61')]?{'message':_0xca0a('0x65'),'statusCode':_0x3635a2[_0xca0a('0x66')]}:_0x3635a2);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f113a47..929df96 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x26b3a4,_0x5204f3){var _0x5065e3=function(_0x4752f5){while(--_0x4752f5){_0x26b3a4['push'](_0x26b3a4['shift']());}};_0x5065e3(++_0x5204f3);}(_0xa6b0,0xaf));var _0x0a6b=function(_0xec6943,_0x114150){_0xec6943=_0xec6943-0x0;var _0x549ad9=_0xa6b0[_0xec6943];return _0x549ad9;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fdc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','api'];(function(_0x3c2c54,_0x365b7f){var _0x5431f4=function(_0x4818){while(--_0x4818){_0x3c2c54['push'](_0x3c2c54['shift']());}};_0x5431f4(++_0x365b7f);}(_0x5fdc,0x127));var _0xc5fd=function(_0x5ceb05,_0x34081d){_0x5ceb05=_0x5ceb05-0x0;var _0x5f44a2=_0x5fdc[_0x5ceb05];return _0x5f44a2;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var logger=require(_0xc5fd('0x2'))(_0xc5fd('0x3'));var moment=require(_0xc5fd('0x4'));var BPromise=require(_0xc5fd('0x5'));var rp=require(_0xc5fd('0x6'));var fs=require('fs');var path=require(_0xc5fd('0x7'));var rimraf=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var attributes=require(_0xc5fd('0xa'));var integrations=require(_0xc5fd('0xb'));module[_0xc5fd('0xc')]=function(_0x216902,_0x15ffe7){return _0x216902['define']('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 30cb7ff..da46897 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77e6=['result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message'];(function(_0xf1dbd8,_0x1cb2e1){var _0x5ee4be=function(_0x2b8af1){while(--_0x2b8af1){_0xf1dbd8['push'](_0xf1dbd8['shift']());}};_0x5ee4be(++_0x1cb2e1);}(_0x77e6,0x1a6));var _0x677e=function(_0x522bf5,_0x547d2c){_0x522bf5=_0x522bf5-0x0;var _0x42a7b6=_0x77e6[_0x522bf5];return _0x42a7b6;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}exports['GetFreshsalesAccount']=function(_0x1c5124){var _0x2ef2bf=this;return new Promise(function(_0x385b06,_0x221b6d){return db[_0x677e('0x18')][_0x677e('0x19')]({'raw':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1b')]||null:null,'attributes':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'limit':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1d')]||null:null,'include':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')]['include']?_['map'](_0x1c5124['options'][_0x677e('0x1e')],function(_0x154fce){return{'model':db[_0x154fce[_0x677e('0x1f')]],'as':_0x154fce['as'],'attributes':_0x154fce[_0x677e('0x1c')],'include':_0x154fce[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x154fce[_0x677e('0x1e')],function(_0x42f2b8){return{'model':db[_0x42f2b8[_0x677e('0x1f')]],'as':_0x42f2b8['as'],'attributes':_0x42f2b8[_0x677e('0x1c')],'include':_0x42f2b8['include']?_['map'](_0x42f2b8[_0x677e('0x1e')],function(_0x184f68){return{'model':db[_0x184f68['model']],'as':_0x184f68['as'],'attributes':_0x184f68[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0xf6b3ad){logger[_0x677e('0xd')](_0x677e('0x21'),_0x1c5124);logger[_0x677e('0xf')]('GetFreshsalesAccount',_0x1c5124,JSON[_0x677e('0x11')](_0xf6b3ad));_0x385b06(_0xf6b3ad);})[_0x677e('0x17')](function(_0xeca8e2){logger[_0x677e('0x12')](_0x677e('0x21'),_0xeca8e2[_0x677e('0x15')],_0x1c5124);_0x221b6d(_0x2ef2bf[_0x677e('0x12')](0x1f4,_0xeca8e2[_0x677e('0x15')]));});});};exports[_0x677e('0x22')]=function(_0x4c5113){var _0x22ccfb=this;return new Promise(function(_0x3cac19,_0x2fb815){return db[_0x677e('0x18')][_0x677e('0x23')]({'raw':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x24')]===undefined?!![]:![]:!![],'where':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')]['where']||null:null,'attributes':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'include':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')]?_['map'](_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')],function(_0x2d0bc0){return{'model':db[_0x2d0bc0['model']],'as':_0x2d0bc0['as'],'attributes':_0x2d0bc0[_0x677e('0x1c')],'include':_0x2d0bc0[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x2d0bc0[_0x677e('0x1e')],function(_0x35c945){return{'model':db[_0x35c945['model']],'as':_0x35c945['as'],'attributes':_0x35c945[_0x677e('0x1c')],'include':_0x35c945[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x35c945[_0x677e('0x1e')],function(_0x548b22){return{'model':db[_0x548b22[_0x677e('0x1f')]],'as':_0x548b22['as'],'attributes':_0x548b22[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0x576443){logger['info'](_0x677e('0x22'),_0x4c5113);logger[_0x677e('0xf')]('ShowFreshsalesAccount',_0x4c5113,JSON[_0x677e('0x11')](_0x576443));_0x3cac19(_0x576443);})[_0x677e('0x17')](function(_0x497dca){logger['error'](_0x677e('0x22'),_0x497dca[_0x677e('0x15')],_0x4c5113);_0x2fb815(_0x22ccfb['error'](0x1f4,_0x497dca['message']));});});}; \ No newline at end of file +var _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0xba2647,_0x951ff1){var _0x1e00d5=function(_0x26a292){while(--_0x26a292){_0xba2647['push'](_0xba2647['shift']());}};_0x1e00d5(++_0x951ff1);}(_0x0598,0x92));var _0x8059=function(_0x3d36cb,_0x57d0d2){_0x3d36cb=_0x3d36cb-0x0;var _0x25b021=_0x0598[_0x3d36cb];return _0x25b021;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b6e25fb..99c10dc 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafe8=['post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xafe8,0x1ea));var _0x8afe=function(_0x22d655,_0x3941dd){_0x22d655=_0x22d655-0x0;var _0x257739=_0xafe8[_0x22d655];return _0x257739;};'use strict';var multer=require(_0x8afe('0x0'));var util=require('util');var path=require(_0x8afe('0x1'));var timeout=require(_0x8afe('0x2'));var express=require(_0x8afe('0x3'));var router=express[_0x8afe('0x4')]();var fs_extra=require(_0x8afe('0x5'));var auth=require(_0x8afe('0x6'));var interaction=require(_0x8afe('0x7'));var config=require(_0x8afe('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x8afe('0x9')]('/',auth[_0x8afe('0xa')](),controller[_0x8afe('0xb')]);router[_0x8afe('0x9')](_0x8afe('0xc'),auth[_0x8afe('0xa')](),controller['show']);router['get']('/:id/subjects',auth[_0x8afe('0xa')](),controller['getSubjects']);router['get'](_0x8afe('0xd'),auth[_0x8afe('0xa')](),controller[_0x8afe('0xe')]);router['get'](_0x8afe('0xf'),auth[_0x8afe('0xa')](),controller['getFields']);router[_0x8afe('0x10')]('/',auth[_0x8afe('0xa')](),controller[_0x8afe('0x11')]);router[_0x8afe('0x12')](_0x8afe('0xc'),auth['isAuthenticated'](),controller[_0x8afe('0x13')]);router['delete'](_0x8afe('0xc'),auth[_0x8afe('0xa')](),controller[_0x8afe('0x14')]);module[_0x8afe('0x15')]=router; \ No newline at end of file +var _0x1e43=['show','/:id/subjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x8e683,_0x111c56){var _0x194ed1=function(_0x513e64){while(--_0x513e64){_0x8e683['push'](_0x8e683['shift']());}};_0x194ed1(++_0x111c56);}(_0x1e43,0x11e));var _0x31e4=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0x1e43[_0x544072];return _0x590bf6;};'use strict';var multer=require(_0x31e4('0x0'));var util=require(_0x31e4('0x1'));var path=require(_0x31e4('0x2'));var timeout=require(_0x31e4('0x3'));var express=require(_0x31e4('0x4'));var router=express['Router']();var fs_extra=require(_0x31e4('0x5'));var auth=require(_0x31e4('0x6'));var interaction=require(_0x31e4('0x7'));var config=require(_0x31e4('0x8'));var controller=require(_0x31e4('0x9'));router[_0x31e4('0xa')]('/',auth[_0x31e4('0xb')](),controller[_0x31e4('0xc')]);router['get']('/:id',auth[_0x31e4('0xb')](),controller[_0x31e4('0xd')]);router[_0x31e4('0xa')](_0x31e4('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x31e4('0xa')](_0x31e4('0xf'),auth[_0x31e4('0xb')](),controller[_0x31e4('0x10')]);router[_0x31e4('0xa')]('/:id/fields',auth[_0x31e4('0xb')](),controller['getFields']);router['post']('/',auth[_0x31e4('0xb')](),controller[_0x31e4('0x11')]);router[_0x31e4('0x12')](_0x31e4('0x13'),auth[_0x31e4('0xb')](),controller[_0x31e4('0x14')]);router[_0x31e4('0x15')](_0x31e4('0x13'),auth[_0x31e4('0xb')](),controller[_0x31e4('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 485c55f..4a896a9 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2273=['exports','STRING'];(function(_0xd1f014,_0x31a6dd){var _0x25afd1=function(_0x374671){while(--_0x374671){_0xd1f014['push'](_0xd1f014['shift']());}};_0x25afd1(++_0x31a6dd);}(_0x2273,0x19c));var _0x3227=function(_0x27cb88,_0x171b12){_0x27cb88=_0x27cb88-0x0;var _0x46b4ce=_0x2273[_0x27cb88];return _0x46b4ce;};'use strict';var Sequelize=require('sequelize');module[_0x3227('0x0')]={'name':{'type':Sequelize[_0x3227('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa2af=['sequelize','STRING'];(function(_0xcda6fa,_0x32dd43){var _0x4ecae2=function(_0x118317){while(--_0x118317){_0xcda6fa['push'](_0xcda6fa['shift']());}};_0x4ecae2(++_0x32dd43);}(_0xa2af,0x1c2));var _0xfa2a=function(_0x312963,_0x341c5c){_0x312963=_0x312963-0x0;var _0x88cf47=_0xa2af[_0x312963];return _0x88cf47;};'use strict';var Sequelize=require(_0xfa2a('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa2a('0x1')]},'description':{'type':Sequelize[_0xfa2a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 7506c2f..7cba2c4 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee70=['destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','create','body','find','getSubjects','findOne','order','pick','filter','getDescriptions','options','getFields','FreshsalesField','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x1bc10e,_0x3edf55){var _0x3e7aa8=function(_0x3e079c){while(--_0x3e079c){_0x1bc10e['push'](_0x1bc10e['shift']());}};_0x3e7aa8(++_0x3edf55);}(_0xee70,0x11f));var _0x0ee7=function(_0x355a02,_0x57a3cf){_0x355a02=_0x355a02-0x0;var _0x2eb928=_0xee70[_0x355a02];return _0x2eb928;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ee7('0x0'));var zipdir=require(_0x0ee7('0x1'));var jsonpatch=require(_0x0ee7('0x2'));var rp=require(_0x0ee7('0x3'));var moment=require(_0x0ee7('0x4'));var BPromise=require(_0x0ee7('0x5'));var Mustache=require(_0x0ee7('0x6'));var util=require(_0x0ee7('0x7'));var path=require('path');var sox=require(_0x0ee7('0x8'));var csv=require(_0x0ee7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ee7('0xa'));var _=require(_0x0ee7('0xb'));var squel=require(_0x0ee7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ee7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee7('0xe'));var Redis=require(_0x0ee7('0xf'));var authService=require(_0x0ee7('0x10'));var qs=require(_0x0ee7('0x11'));var as=require(_0x0ee7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee7('0x13'))('api');var utils=require(_0x0ee7('0x14'));var config=require(_0x0ee7('0x15'));var licenseUtil=require(_0x0ee7('0x16'));var db=require(_0x0ee7('0x17'))['db'];function respondWithStatusCode(_0x91e1a9,_0x513ced){_0x513ced=_0x513ced||0xcc;return function(_0x4df865){if(_0x4df865){return _0x91e1a9[_0x0ee7('0x18')](_0x513ced);}return _0x91e1a9[_0x0ee7('0x19')](_0x513ced)[_0x0ee7('0x1a')]();};}function respondWithResult(_0x374bfe,_0x127f8a){_0x127f8a=_0x127f8a||0xc8;return function(_0xe0d6a0){if(_0xe0d6a0){return _0x374bfe[_0x0ee7('0x19')](_0x127f8a)[_0x0ee7('0x1b')](_0xe0d6a0);}};}function respondWithFilteredResult(_0x4ebd01,_0xa19f04){return function(_0x22a5d4){if(_0x22a5d4){var _0xf56822=typeof _0xa19f04[_0x0ee7('0x1c')]===_0x0ee7('0x1d')&&typeof _0xa19f04[_0x0ee7('0x1e')]==='undefined';var _0x4d624a=_0x22a5d4[_0x0ee7('0x1f')];var _0x4ffe57=_0xf56822?0x0:_0xa19f04[_0x0ee7('0x1c')];var _0x359c78=_0xf56822?_0x22a5d4[_0x0ee7('0x1f')]:_0xa19f04[_0x0ee7('0x1c')]+_0xa19f04[_0x0ee7('0x1e')];var _0x27938d;if(_0x359c78>=_0x4d624a){_0x359c78=_0x4d624a;_0x27938d=0xc8;}else{_0x27938d=0xce;}_0x4ebd01[_0x0ee7('0x19')](_0x27938d);return _0x4ebd01['set'](_0x0ee7('0x20'),_0x4ffe57+'-'+_0x359c78+'/'+_0x4d624a)[_0x0ee7('0x1b')](_0x22a5d4);}return null;};}function patchUpdates(_0x360f05){return function(_0x14d1a0){try{jsonpatch['apply'](_0x14d1a0,_0x360f05,!![]);}catch(_0x5c051a){return BPromise[_0x0ee7('0x21')](_0x5c051a);}return _0x14d1a0[_0x0ee7('0x22')]();};}function saveUpdates(_0x1925c7,_0xcf73f6){return function(_0x194d01){if(_0x194d01){return _0x194d01[_0x0ee7('0x23')](_0x1925c7)[_0x0ee7('0x24')](function(_0x5e6734){return _0x5e6734;});}return null;};}function removeEntity(_0x34f22e,_0x2ce36e){return function(_0x1712d9){if(_0x1712d9){return _0x1712d9[_0x0ee7('0x25')]()[_0x0ee7('0x24')](function(){_0x34f22e[_0x0ee7('0x19')](0xcc)[_0x0ee7('0x1a')]();});}};}function handleEntityNotFound(_0x26f45c,_0x2c3e4a){return function(_0x1281d4){if(!_0x1281d4){_0x26f45c[_0x0ee7('0x18')](0x194);}return _0x1281d4;};}function handleError(_0x25bb00,_0x296822){_0x296822=_0x296822||0x1f4;return function(_0x176584){logger[_0x0ee7('0x26')](_0x176584[_0x0ee7('0x27')]);if(_0x176584[_0x0ee7('0x28')]){delete _0x176584[_0x0ee7('0x28')];}_0x25bb00['status'](_0x296822)[_0x0ee7('0x29')](_0x176584);};}exports[_0x0ee7('0x2a')]=function(_0x243b2c,_0x9a7a9a){var _0x178f98={},_0x338464={},_0x6eff0a={'count':0x0,'rows':[]};var _0x30784e=_['map'](db[_0x0ee7('0x2b')][_0x0ee7('0x2c')],function(_0x41814d){return{'name':_0x41814d[_0x0ee7('0x2d')],'type':_0x41814d[_0x0ee7('0x2e')][_0x0ee7('0x2f')]};});_0x338464[_0x0ee7('0x30')]=_[_0x0ee7('0x31')](_0x30784e,'name');_0x338464['query']=_['keys'](_0x243b2c[_0x0ee7('0x32')]);_0x338464[_0x0ee7('0x33')]=_[_0x0ee7('0x34')](_0x338464[_0x0ee7('0x30')],_0x338464[_0x0ee7('0x32')]);_0x178f98[_0x0ee7('0x35')]=_['intersection'](_0x338464[_0x0ee7('0x30')],qs[_0x0ee7('0x36')](_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x36')]));_0x178f98['attributes']=_0x178f98['attributes'][_0x0ee7('0x37')]?_0x178f98[_0x0ee7('0x35')]:_0x338464[_0x0ee7('0x30')];if(!_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x178f98[_0x0ee7('0x1e')]=qs[_0x0ee7('0x1e')](_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x1e')]);_0x178f98[_0x0ee7('0x1c')]=qs[_0x0ee7('0x1c')](_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x1c')]);}_0x178f98['order']=qs[_0x0ee7('0x3a')](_0x243b2c['query'][_0x0ee7('0x3a')]);_0x178f98[_0x0ee7('0x3b')]=qs[_0x0ee7('0x33')](_['pick'](_0x243b2c[_0x0ee7('0x32')],_0x338464[_0x0ee7('0x33')]),_0x30784e);if(_0x243b2c[_0x0ee7('0x32')]['filter']){_0x178f98['where']=_['merge'](_0x178f98['where'],{'$or':_[_0x0ee7('0x31')](_0x30784e,function(_0x2936bb){if(_0x2936bb['type']!==_0x0ee7('0x3c')){var _0x31d2df={};_0x31d2df[_0x2936bb[_0x0ee7('0x28')]]={'$like':'%'+_0x243b2c['query']['filter']+'%'};return _0x31d2df;}})});}_0x178f98=_[_0x0ee7('0x3d')]({},_0x178f98,_0x243b2c['options']);var _0x4b0a85={'where':_0x178f98['where']};return db[_0x0ee7('0x2b')][_0x0ee7('0x1f')](_0x4b0a85)[_0x0ee7('0x24')](function(_0x47c058){_0x6eff0a[_0x0ee7('0x1f')]=_0x47c058;if(_0x243b2c[_0x0ee7('0x32')][_0x0ee7('0x3e')]){_0x178f98[_0x0ee7('0x3f')]=[{'all':!![]}];}return db[_0x0ee7('0x2b')][_0x0ee7('0x40')](_0x178f98);})[_0x0ee7('0x24')](function(_0x46c225){_0x6eff0a[_0x0ee7('0x41')]=_0x46c225;return _0x6eff0a;})[_0x0ee7('0x24')](respondWithFilteredResult(_0x9a7a9a,_0x178f98))[_0x0ee7('0x42')](handleError(_0x9a7a9a,null));};exports['show']=function(_0xa4db68,_0x6b1634){var _0xa406c1={'raw':![],'where':{'id':_0xa4db68[_0x0ee7('0x43')]['id']}},_0x426b3a={};_0x426b3a[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db[_0x0ee7('0x2b')]['rawAttributes']);_0x426b3a[_0x0ee7('0x32')]=_[_0x0ee7('0x44')](_0xa4db68['query']);_0x426b3a['filters']=_[_0x0ee7('0x34')](_0x426b3a[_0x0ee7('0x30')],_0x426b3a['query']);_0xa406c1[_0x0ee7('0x35')]=_['intersection'](_0x426b3a['model'],qs[_0x0ee7('0x36')](_0xa4db68[_0x0ee7('0x32')]['fields']));_0xa406c1[_0x0ee7('0x35')]=_0xa406c1[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0xa406c1['attributes']:_0x426b3a[_0x0ee7('0x30')];if(_0xa4db68[_0x0ee7('0x32')][_0x0ee7('0x3e')]){_0xa406c1[_0x0ee7('0x3f')]=[{'all':!![]}];}_0xa406c1=_[_0x0ee7('0x3d')]({},_0xa406c1,_0xa4db68['options']);return db[_0x0ee7('0x2b')]['find'](_0xa406c1)[_0x0ee7('0x24')](handleEntityNotFound(_0x6b1634,null))['then'](respondWithResult(_0x6b1634,null))[_0x0ee7('0x42')](handleError(_0x6b1634,null));};exports[_0x0ee7('0x45')]=function(_0x36a0fc,_0x4ef5fd){return db['FreshsalesConfiguration'][_0x0ee7('0x45')](_0x36a0fc['body'],{})['then'](respondWithResult(_0x4ef5fd,0xc9))[_0x0ee7('0x42')](handleError(_0x4ef5fd,null));};exports[_0x0ee7('0x23')]=function(_0x50baef,_0x52fbe8){if(_0x50baef[_0x0ee7('0x46')]['id']){delete _0x50baef[_0x0ee7('0x46')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x50baef[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x52fbe8,null))['then'](saveUpdates(_0x50baef['body'],null))['then'](respondWithResult(_0x52fbe8,null))[_0x0ee7('0x42')](handleError(_0x52fbe8,null));};exports[_0x0ee7('0x25')]=function(_0x5a3211,_0x28377b){return db['FreshsalesConfiguration'][_0x0ee7('0x47')]({'where':{'id':_0x5a3211['params']['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x28377b,null))[_0x0ee7('0x24')](removeEntity(_0x28377b,null))['catch'](handleError(_0x28377b,null));};exports[_0x0ee7('0x48')]=function(_0x29c52e,_0x20ede7,_0x51c7b3){var _0x1e33ae={};var _0x4de289={};var _0x162612;var _0x387e00;return db['FreshsalesConfiguration'][_0x0ee7('0x49')]({'where':{'id':_0x29c52e[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x20ede7,null))[_0x0ee7('0x24')](function(_0x39cf15){if(_0x39cf15){_0x162612=_0x39cf15;_0x4de289[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db['FreshsalesField']['rawAttributes']);_0x4de289[_0x0ee7('0x32')]=_[_0x0ee7('0x44')](_0x29c52e[_0x0ee7('0x32')]);_0x4de289[_0x0ee7('0x33')]=_['intersection'](_0x4de289[_0x0ee7('0x30')],_0x4de289['query']);_0x1e33ae[_0x0ee7('0x35')]=_[_0x0ee7('0x34')](_0x4de289[_0x0ee7('0x30')],qs[_0x0ee7('0x36')](_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x36')]));_0x1e33ae[_0x0ee7('0x35')]=_0x1e33ae[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0x1e33ae[_0x0ee7('0x35')]:_0x4de289['model'];_0x1e33ae[_0x0ee7('0x4a')]=qs['sort'](_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x3a')]);_0x1e33ae[_0x0ee7('0x3b')]=qs['filters'](_[_0x0ee7('0x4b')](_0x29c52e['query'],_0x4de289[_0x0ee7('0x33')]));if(_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x4c')]){_0x1e33ae[_0x0ee7('0x3b')]=_[_0x0ee7('0x3d')](_0x1e33ae[_0x0ee7('0x3b')],{'$or':_['map'](_0x1e33ae['attributes'],function(_0x38ab5a){var _0x2f917b={};_0x2f917b[_0x38ab5a]={'$like':'%'+_0x29c52e[_0x0ee7('0x32')]['filter']+'%'};return _0x2f917b;})});}_0x1e33ae=_[_0x0ee7('0x3d')]({},_0x1e33ae,_0x29c52e['options']);return _0x162612[_0x0ee7('0x48')](_0x1e33ae);}})[_0x0ee7('0x24')](function(_0x40ba7e){if(_0x40ba7e){_0x387e00=_0x40ba7e[_0x0ee7('0x37')];if(!_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x1e33ae[_0x0ee7('0x1e')]=qs[_0x0ee7('0x1e')](_0x29c52e[_0x0ee7('0x32')][_0x0ee7('0x1e')]);_0x1e33ae['offset']=qs[_0x0ee7('0x1c')](_0x29c52e['query'][_0x0ee7('0x1c')]);}return _0x162612[_0x0ee7('0x48')](_0x1e33ae);}})[_0x0ee7('0x24')](function(_0x3d9ce2){if(_0x3d9ce2){return _0x3d9ce2?{'count':_0x387e00,'rows':_0x3d9ce2}:null;}})[_0x0ee7('0x24')](respondWithResult(_0x20ede7,null))[_0x0ee7('0x42')](handleError(_0x20ede7,null));};exports[_0x0ee7('0x4d')]=function(_0x49245d,_0x50f7e4,_0x1f3477){var _0x58616e={};var _0xfb1939={};var _0x35a07a;var _0x1ea076;return db[_0x0ee7('0x2b')]['findOne']({'where':{'id':_0x49245d[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x50f7e4,null))[_0x0ee7('0x24')](function(_0x371e3a){if(_0x371e3a){_0x35a07a=_0x371e3a;_0xfb1939[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db['FreshsalesField'][_0x0ee7('0x2c')]);_0xfb1939[_0x0ee7('0x32')]=_['keys'](_0x49245d[_0x0ee7('0x32')]);_0xfb1939['filters']=_[_0x0ee7('0x34')](_0xfb1939[_0x0ee7('0x30')],_0xfb1939[_0x0ee7('0x32')]);_0x58616e[_0x0ee7('0x35')]=_[_0x0ee7('0x34')](_0xfb1939[_0x0ee7('0x30')],qs['fields'](_0x49245d[_0x0ee7('0x32')]['fields']));_0x58616e[_0x0ee7('0x35')]=_0x58616e[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0x58616e['attributes']:_0xfb1939['model'];_0x58616e['order']=qs[_0x0ee7('0x3a')](_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x3a')]);_0x58616e[_0x0ee7('0x3b')]=qs[_0x0ee7('0x33')](_[_0x0ee7('0x4b')](_0x49245d['query'],_0xfb1939['filters']));if(_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x4c')]){_0x58616e['where']=_['merge'](_0x58616e['where'],{'$or':_[_0x0ee7('0x31')](_0x58616e[_0x0ee7('0x35')],function(_0x2c6094){var _0x3b0fb8={};_0x3b0fb8[_0x2c6094]={'$like':'%'+_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x4c')]+'%'};return _0x3b0fb8;})});}_0x58616e=_[_0x0ee7('0x3d')]({},_0x58616e,_0x49245d[_0x0ee7('0x4e')]);return _0x35a07a[_0x0ee7('0x4d')](_0x58616e);}})[_0x0ee7('0x24')](function(_0x2afe3b){if(_0x2afe3b){_0x1ea076=_0x2afe3b[_0x0ee7('0x37')];if(!_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x58616e[_0x0ee7('0x1e')]=qs[_0x0ee7('0x1e')](_0x49245d[_0x0ee7('0x32')]['limit']);_0x58616e['offset']=qs[_0x0ee7('0x1c')](_0x49245d[_0x0ee7('0x32')][_0x0ee7('0x1c')]);}return _0x35a07a[_0x0ee7('0x4d')](_0x58616e);}})[_0x0ee7('0x24')](function(_0x11ac12){if(_0x11ac12){return _0x11ac12?{'count':_0x1ea076,'rows':_0x11ac12}:null;}})[_0x0ee7('0x24')](respondWithResult(_0x50f7e4,null))[_0x0ee7('0x42')](handleError(_0x50f7e4,null));};exports[_0x0ee7('0x4f')]=function(_0x57bf90,_0x34a0bf,_0x45c103){var _0x1e1786={};var _0x445d3a={};var _0x15aceb;var _0x32c344;return db[_0x0ee7('0x2b')][_0x0ee7('0x49')]({'where':{'id':_0x57bf90[_0x0ee7('0x43')]['id']}})[_0x0ee7('0x24')](handleEntityNotFound(_0x34a0bf,null))['then'](function(_0x2a645b){if(_0x2a645b){_0x15aceb=_0x2a645b;_0x445d3a[_0x0ee7('0x30')]=_[_0x0ee7('0x44')](db[_0x0ee7('0x50')]['rawAttributes']);_0x445d3a[_0x0ee7('0x32')]=_[_0x0ee7('0x44')](_0x57bf90[_0x0ee7('0x32')]);_0x445d3a['filters']=_['intersection'](_0x445d3a[_0x0ee7('0x30')],_0x445d3a[_0x0ee7('0x32')]);_0x1e1786[_0x0ee7('0x35')]=_[_0x0ee7('0x34')](_0x445d3a[_0x0ee7('0x30')],qs[_0x0ee7('0x36')](_0x57bf90[_0x0ee7('0x32')]['fields']));_0x1e1786[_0x0ee7('0x35')]=_0x1e1786[_0x0ee7('0x35')][_0x0ee7('0x37')]?_0x1e1786[_0x0ee7('0x35')]:_0x445d3a['model'];_0x1e1786[_0x0ee7('0x4a')]=qs[_0x0ee7('0x3a')](_0x57bf90[_0x0ee7('0x32')]['sort']);_0x1e1786[_0x0ee7('0x3b')]=qs['filters'](_[_0x0ee7('0x4b')](_0x57bf90['query'],_0x445d3a[_0x0ee7('0x33')]));if(_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x4c')]){_0x1e1786['where']=_[_0x0ee7('0x3d')](_0x1e1786[_0x0ee7('0x3b')],{'$or':_['map'](_0x1e1786[_0x0ee7('0x35')],function(_0x1112fa){var _0x1ab146={};_0x1ab146[_0x1112fa]={'$like':'%'+_0x57bf90[_0x0ee7('0x32')]['filter']+'%'};return _0x1ab146;})});}_0x1e1786=_[_0x0ee7('0x3d')]({},_0x1e1786,_0x57bf90[_0x0ee7('0x4e')]);return _0x15aceb[_0x0ee7('0x4f')](_0x1e1786);}})[_0x0ee7('0x24')](function(_0x1b8e21){if(_0x1b8e21){_0x32c344=_0x1b8e21['length'];if(!_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x38')](_0x0ee7('0x39'))){_0x1e1786[_0x0ee7('0x1e')]=qs['limit'](_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x1e')]);_0x1e1786[_0x0ee7('0x1c')]=qs[_0x0ee7('0x1c')](_0x57bf90[_0x0ee7('0x32')][_0x0ee7('0x1c')]);}return _0x15aceb[_0x0ee7('0x4f')](_0x1e1786);}})['then'](function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae?{'count':_0x32c344,'rows':_0x39d1ae}:null;}})['then'](respondWithResult(_0x34a0bf,null))['catch'](handleError(_0x34a0bf,null));}; \ No newline at end of file +var _0x8662=['FreshsalesConfiguration','length','find','create','body','params','getSubjects','findOne','FreshsalesField','pick','nolimit','getDescriptions','hasOwnProperty','getFields','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','type','key','map','keys','query','intersection','attributes','model','fields','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show'];(function(_0x331f3b,_0x5adf1c){var _0x1d2841=function(_0x2fdd44){while(--_0x2fdd44){_0x331f3b['push'](_0x331f3b['shift']());}};_0x1d2841(++_0x5adf1c);}(_0x8662,0x185));var _0x2866=function(_0x5e00d5,_0x1bc6d1){_0x5e00d5=_0x5e00d5-0x0;var _0x4fd4c3=_0x8662[_0x5e00d5];return _0x4fd4c3;};'use strict';var emlformat=require(_0x2866('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2866('0x1'));var jsonpatch=require(_0x2866('0x2'));var rp=require('request-promise');var moment=require(_0x2866('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2866('0x4'));var util=require('util');var path=require(_0x2866('0x5'));var sox=require('sox');var csv=require(_0x2866('0x6'));var ejs=require(_0x2866('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2866('0x8'));var crypto=require('crypto');var jsforce=require(_0x2866('0x9'));var deskjs=require(_0x2866('0xa'));var toCsv=require(_0x2866('0x6'));var querystring=require(_0x2866('0xb'));var Papa=require(_0x2866('0xc'));var Redis=require('ioredis');var authService=require(_0x2866('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2866('0xe'));var logger=require(_0x2866('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x2866('0x10'));var licenseUtil=require(_0x2866('0x11'));var db=require(_0x2866('0x12'))['db'];function respondWithStatusCode(_0xf00d2e,_0x2dabb7){_0x2dabb7=_0x2dabb7||0xcc;return function(_0x5d913b){if(_0x5d913b){return _0xf00d2e[_0x2866('0x13')](_0x2dabb7);}return _0xf00d2e[_0x2866('0x14')](_0x2dabb7)[_0x2866('0x15')]();};}function respondWithResult(_0x208b79,_0xf4a3a4){_0xf4a3a4=_0xf4a3a4||0xc8;return function(_0x3f7ca0){if(_0x3f7ca0){return _0x208b79[_0x2866('0x14')](_0xf4a3a4)[_0x2866('0x16')](_0x3f7ca0);}};}function respondWithFilteredResult(_0xd57860,_0x21906f){return function(_0x20ab5f){if(_0x20ab5f){var _0x49b746=typeof _0x21906f['offset']===_0x2866('0x17')&&typeof _0x21906f[_0x2866('0x18')]===_0x2866('0x17');var _0x20ca30=_0x20ab5f['count'];var _0x2a1b5f=_0x49b746?0x0:_0x21906f['offset'];var _0x12b3a7=_0x49b746?_0x20ab5f[_0x2866('0x19')]:_0x21906f[_0x2866('0x1a')]+_0x21906f[_0x2866('0x18')];var _0x378d88;if(_0x12b3a7>=_0x20ca30){_0x12b3a7=_0x20ca30;_0x378d88=0xc8;}else{_0x378d88=0xce;}_0xd57860['status'](_0x378d88);return _0xd57860['set'](_0x2866('0x1b'),_0x2a1b5f+'-'+_0x12b3a7+'/'+_0x20ca30)[_0x2866('0x16')](_0x20ab5f);}return null;};}function patchUpdates(_0x300c92){return function(_0x57d734){try{jsonpatch[_0x2866('0x1c')](_0x57d734,_0x300c92,!![]);}catch(_0x4d76f3){return BPromise[_0x2866('0x1d')](_0x4d76f3);}return _0x57d734[_0x2866('0x1e')]();};}function saveUpdates(_0x386951,_0x110fcb){return function(_0x4bdef2){if(_0x4bdef2){return _0x4bdef2[_0x2866('0x1f')](_0x386951)[_0x2866('0x20')](function(_0x3f67e2){return _0x3f67e2;});}return null;};}function removeEntity(_0x3f4f1c,_0xf7fb34){return function(_0x315a7e){if(_0x315a7e){return _0x315a7e[_0x2866('0x21')]()[_0x2866('0x20')](function(){_0x3f4f1c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5028,_0x4a6922){return function(_0x3b93d2){if(!_0x3b93d2){_0x4d5028[_0x2866('0x13')](0x194);}return _0x3b93d2;};}function handleError(_0x8d9933,_0x19fd36){_0x19fd36=_0x19fd36||0x1f4;return function(_0x52b9f7){logger[_0x2866('0x22')](_0x52b9f7[_0x2866('0x23')]);if(_0x52b9f7[_0x2866('0x24')]){delete _0x52b9f7['name'];}_0x8d9933[_0x2866('0x14')](_0x19fd36)['send'](_0x52b9f7);};}exports[_0x2866('0x25')]=function(_0x199158,_0x117369){var _0x29c1c5={},_0x554a54={},_0x4e6792={'count':0x0,'rows':[]};var _0x48fa13=_['map'](db['FreshsalesConfiguration'][_0x2866('0x26')],function(_0x27dbed){return{'name':_0x27dbed['fieldName'],'type':_0x27dbed[_0x2866('0x27')][_0x2866('0x28')]};});_0x554a54['model']=_[_0x2866('0x29')](_0x48fa13,_0x2866('0x24'));_0x554a54['query']=_[_0x2866('0x2a')](_0x199158[_0x2866('0x2b')]);_0x554a54['filters']=_[_0x2866('0x2c')](_0x554a54['model'],_0x554a54[_0x2866('0x2b')]);_0x29c1c5[_0x2866('0x2d')]=_[_0x2866('0x2c')](_0x554a54[_0x2866('0x2e')],qs[_0x2866('0x2f')](_0x199158[_0x2866('0x2b')][_0x2866('0x2f')]));_0x29c1c5[_0x2866('0x2d')]=_0x29c1c5[_0x2866('0x2d')]['length']?_0x29c1c5['attributes']:_0x554a54[_0x2866('0x2e')];if(!_0x199158[_0x2866('0x2b')]['hasOwnProperty']('nolimit')){_0x29c1c5[_0x2866('0x18')]=qs['limit'](_0x199158['query']['limit']);_0x29c1c5[_0x2866('0x1a')]=qs[_0x2866('0x1a')](_0x199158['query'][_0x2866('0x1a')]);}_0x29c1c5[_0x2866('0x30')]=qs[_0x2866('0x31')](_0x199158['query'][_0x2866('0x31')]);_0x29c1c5['where']=qs['filters'](_['pick'](_0x199158['query'],_0x554a54[_0x2866('0x32')]),_0x48fa13);if(_0x199158[_0x2866('0x2b')]['filter']){_0x29c1c5[_0x2866('0x33')]=_[_0x2866('0x34')](_0x29c1c5[_0x2866('0x33')],{'$or':_[_0x2866('0x29')](_0x48fa13,function(_0x3f0a83){if(_0x3f0a83[_0x2866('0x27')]!==_0x2866('0x35')){var _0x220bae={};_0x220bae[_0x3f0a83[_0x2866('0x24')]]={'$like':'%'+_0x199158[_0x2866('0x2b')][_0x2866('0x36')]+'%'};return _0x220bae;}})});}_0x29c1c5=_[_0x2866('0x34')]({},_0x29c1c5,_0x199158[_0x2866('0x37')]);var _0x594be3={'where':_0x29c1c5[_0x2866('0x33')]};return db['FreshsalesConfiguration'][_0x2866('0x19')](_0x594be3)[_0x2866('0x20')](function(_0x2a7b18){_0x4e6792[_0x2866('0x19')]=_0x2a7b18;if(_0x199158[_0x2866('0x2b')][_0x2866('0x38')]){_0x29c1c5[_0x2866('0x39')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x29c1c5);})[_0x2866('0x20')](function(_0x15b586){_0x4e6792[_0x2866('0x3a')]=_0x15b586;return _0x4e6792;})[_0x2866('0x20')](respondWithFilteredResult(_0x117369,_0x29c1c5))[_0x2866('0x3b')](handleError(_0x117369,null));};exports[_0x2866('0x3c')]=function(_0x9005bc,_0x1167f6){var _0x48df7b={'raw':![],'where':{'id':_0x9005bc['params']['id']}},_0x5c4e61={};_0x5c4e61[_0x2866('0x2e')]=_[_0x2866('0x2a')](db[_0x2866('0x3d')][_0x2866('0x26')]);_0x5c4e61['query']=_['keys'](_0x9005bc[_0x2866('0x2b')]);_0x5c4e61[_0x2866('0x32')]=_[_0x2866('0x2c')](_0x5c4e61[_0x2866('0x2e')],_0x5c4e61[_0x2866('0x2b')]);_0x48df7b[_0x2866('0x2d')]=_[_0x2866('0x2c')](_0x5c4e61['model'],qs[_0x2866('0x2f')](_0x9005bc[_0x2866('0x2b')][_0x2866('0x2f')]));_0x48df7b[_0x2866('0x2d')]=_0x48df7b[_0x2866('0x2d')][_0x2866('0x3e')]?_0x48df7b[_0x2866('0x2d')]:_0x5c4e61[_0x2866('0x2e')];if(_0x9005bc['query']['includeAll']){_0x48df7b['include']=[{'all':!![]}];}_0x48df7b=_[_0x2866('0x34')]({},_0x48df7b,_0x9005bc[_0x2866('0x37')]);return db[_0x2866('0x3d')][_0x2866('0x3f')](_0x48df7b)[_0x2866('0x20')](handleEntityNotFound(_0x1167f6,null))['then'](respondWithResult(_0x1167f6,null))[_0x2866('0x3b')](handleError(_0x1167f6,null));};exports[_0x2866('0x40')]=function(_0xc4ddb1,_0x534951){return db['FreshsalesConfiguration'][_0x2866('0x40')](_0xc4ddb1[_0x2866('0x41')],{})[_0x2866('0x20')](respondWithResult(_0x534951,0xc9))[_0x2866('0x3b')](handleError(_0x534951,null));};exports[_0x2866('0x1f')]=function(_0x4a7b33,_0x44eb1a){if(_0x4a7b33[_0x2866('0x41')]['id']){delete _0x4a7b33[_0x2866('0x41')]['id'];}return db[_0x2866('0x3d')][_0x2866('0x3f')]({'where':{'id':_0x4a7b33['params']['id']}})[_0x2866('0x20')](handleEntityNotFound(_0x44eb1a,null))[_0x2866('0x20')](saveUpdates(_0x4a7b33[_0x2866('0x41')],null))[_0x2866('0x20')](respondWithResult(_0x44eb1a,null))[_0x2866('0x3b')](handleError(_0x44eb1a,null));};exports['destroy']=function(_0x37dd39,_0x50925c){return db[_0x2866('0x3d')][_0x2866('0x3f')]({'where':{'id':_0x37dd39[_0x2866('0x42')]['id']}})['then'](handleEntityNotFound(_0x50925c,null))[_0x2866('0x20')](removeEntity(_0x50925c,null))[_0x2866('0x3b')](handleError(_0x50925c,null));};exports[_0x2866('0x43')]=function(_0x3aa2ca,_0x4236d4,_0x2733d0){var _0x3801a0={};var _0x6fda6a={};var _0x4b1684;var _0x2c09fd;return db[_0x2866('0x3d')][_0x2866('0x44')]({'where':{'id':_0x3aa2ca[_0x2866('0x42')]['id']}})[_0x2866('0x20')](handleEntityNotFound(_0x4236d4,null))['then'](function(_0x2da770){if(_0x2da770){_0x4b1684=_0x2da770;_0x6fda6a[_0x2866('0x2e')]=_[_0x2866('0x2a')](db[_0x2866('0x45')][_0x2866('0x26')]);_0x6fda6a[_0x2866('0x2b')]=_[_0x2866('0x2a')](_0x3aa2ca['query']);_0x6fda6a[_0x2866('0x32')]=_[_0x2866('0x2c')](_0x6fda6a[_0x2866('0x2e')],_0x6fda6a['query']);_0x3801a0[_0x2866('0x2d')]=_[_0x2866('0x2c')](_0x6fda6a['model'],qs[_0x2866('0x2f')](_0x3aa2ca[_0x2866('0x2b')][_0x2866('0x2f')]));_0x3801a0[_0x2866('0x2d')]=_0x3801a0[_0x2866('0x2d')][_0x2866('0x3e')]?_0x3801a0[_0x2866('0x2d')]:_0x6fda6a[_0x2866('0x2e')];_0x3801a0['order']=qs[_0x2866('0x31')](_0x3aa2ca[_0x2866('0x2b')]['sort']);_0x3801a0['where']=qs[_0x2866('0x32')](_[_0x2866('0x46')](_0x3aa2ca[_0x2866('0x2b')],_0x6fda6a[_0x2866('0x32')]));if(_0x3aa2ca[_0x2866('0x2b')][_0x2866('0x36')]){_0x3801a0[_0x2866('0x33')]=_[_0x2866('0x34')](_0x3801a0[_0x2866('0x33')],{'$or':_[_0x2866('0x29')](_0x3801a0[_0x2866('0x2d')],function(_0x241f9e){var _0x551a24={};_0x551a24[_0x241f9e]={'$like':'%'+_0x3aa2ca[_0x2866('0x2b')][_0x2866('0x36')]+'%'};return _0x551a24;})});}_0x3801a0=_['merge']({},_0x3801a0,_0x3aa2ca[_0x2866('0x37')]);return _0x4b1684[_0x2866('0x43')](_0x3801a0);}})[_0x2866('0x20')](function(_0x340b93){if(_0x340b93){_0x2c09fd=_0x340b93[_0x2866('0x3e')];if(!_0x3aa2ca['query']['hasOwnProperty'](_0x2866('0x47'))){_0x3801a0[_0x2866('0x18')]=qs[_0x2866('0x18')](_0x3aa2ca[_0x2866('0x2b')][_0x2866('0x18')]);_0x3801a0[_0x2866('0x1a')]=qs[_0x2866('0x1a')](_0x3aa2ca['query'][_0x2866('0x1a')]);}return _0x4b1684[_0x2866('0x43')](_0x3801a0);}})[_0x2866('0x20')](function(_0x2f712e){if(_0x2f712e){return _0x2f712e?{'count':_0x2c09fd,'rows':_0x2f712e}:null;}})[_0x2866('0x20')](respondWithResult(_0x4236d4,null))[_0x2866('0x3b')](handleError(_0x4236d4,null));};exports[_0x2866('0x48')]=function(_0x46c5d0,_0x527728,_0x2b0337){var _0x13c2a7={};var _0x293f9e={};var _0x2cfcae;var _0xba2a4;return db[_0x2866('0x3d')][_0x2866('0x44')]({'where':{'id':_0x46c5d0[_0x2866('0x42')]['id']}})[_0x2866('0x20')](handleEntityNotFound(_0x527728,null))[_0x2866('0x20')](function(_0x314e97){if(_0x314e97){_0x2cfcae=_0x314e97;_0x293f9e['model']=_[_0x2866('0x2a')](db[_0x2866('0x45')][_0x2866('0x26')]);_0x293f9e[_0x2866('0x2b')]=_['keys'](_0x46c5d0[_0x2866('0x2b')]);_0x293f9e['filters']=_[_0x2866('0x2c')](_0x293f9e[_0x2866('0x2e')],_0x293f9e['query']);_0x13c2a7[_0x2866('0x2d')]=_[_0x2866('0x2c')](_0x293f9e[_0x2866('0x2e')],qs[_0x2866('0x2f')](_0x46c5d0[_0x2866('0x2b')][_0x2866('0x2f')]));_0x13c2a7['attributes']=_0x13c2a7[_0x2866('0x2d')][_0x2866('0x3e')]?_0x13c2a7['attributes']:_0x293f9e[_0x2866('0x2e')];_0x13c2a7['order']=qs[_0x2866('0x31')](_0x46c5d0['query']['sort']);_0x13c2a7[_0x2866('0x33')]=qs[_0x2866('0x32')](_['pick'](_0x46c5d0['query'],_0x293f9e[_0x2866('0x32')]));if(_0x46c5d0[_0x2866('0x2b')][_0x2866('0x36')]){_0x13c2a7[_0x2866('0x33')]=_['merge'](_0x13c2a7[_0x2866('0x33')],{'$or':_['map'](_0x13c2a7[_0x2866('0x2d')],function(_0x4235a9){var _0x493f94={};_0x493f94[_0x4235a9]={'$like':'%'+_0x46c5d0[_0x2866('0x2b')][_0x2866('0x36')]+'%'};return _0x493f94;})});}_0x13c2a7=_[_0x2866('0x34')]({},_0x13c2a7,_0x46c5d0[_0x2866('0x37')]);return _0x2cfcae[_0x2866('0x48')](_0x13c2a7);}})['then'](function(_0x2b853d){if(_0x2b853d){_0xba2a4=_0x2b853d['length'];if(!_0x46c5d0[_0x2866('0x2b')][_0x2866('0x49')](_0x2866('0x47'))){_0x13c2a7[_0x2866('0x18')]=qs[_0x2866('0x18')](_0x46c5d0[_0x2866('0x2b')]['limit']);_0x13c2a7['offset']=qs[_0x2866('0x1a')](_0x46c5d0[_0x2866('0x2b')][_0x2866('0x1a')]);}return _0x2cfcae[_0x2866('0x48')](_0x13c2a7);}})['then'](function(_0x65d1fb){if(_0x65d1fb){return _0x65d1fb?{'count':_0xba2a4,'rows':_0x65d1fb}:null;}})[_0x2866('0x20')](respondWithResult(_0x527728,null))[_0x2866('0x3b')](handleError(_0x527728,null));};exports['getFields']=function(_0x40941c,_0x5feab3,_0x5e14c0){var _0x11ec23={};var _0x2684ce={};var _0x20ec8d;var _0x5c3a1f;return db[_0x2866('0x3d')][_0x2866('0x44')]({'where':{'id':_0x40941c[_0x2866('0x42')]['id']}})[_0x2866('0x20')](handleEntityNotFound(_0x5feab3,null))['then'](function(_0x3a3aea){if(_0x3a3aea){_0x20ec8d=_0x3a3aea;_0x2684ce[_0x2866('0x2e')]=_['keys'](db['FreshsalesField'][_0x2866('0x26')]);_0x2684ce['query']=_[_0x2866('0x2a')](_0x40941c['query']);_0x2684ce[_0x2866('0x32')]=_['intersection'](_0x2684ce[_0x2866('0x2e')],_0x2684ce[_0x2866('0x2b')]);_0x11ec23[_0x2866('0x2d')]=_[_0x2866('0x2c')](_0x2684ce[_0x2866('0x2e')],qs[_0x2866('0x2f')](_0x40941c[_0x2866('0x2b')][_0x2866('0x2f')]));_0x11ec23['attributes']=_0x11ec23[_0x2866('0x2d')][_0x2866('0x3e')]?_0x11ec23['attributes']:_0x2684ce[_0x2866('0x2e')];_0x11ec23[_0x2866('0x30')]=qs[_0x2866('0x31')](_0x40941c['query'][_0x2866('0x31')]);_0x11ec23[_0x2866('0x33')]=qs[_0x2866('0x32')](_[_0x2866('0x46')](_0x40941c[_0x2866('0x2b')],_0x2684ce['filters']));if(_0x40941c['query']['filter']){_0x11ec23[_0x2866('0x33')]=_[_0x2866('0x34')](_0x11ec23['where'],{'$or':_[_0x2866('0x29')](_0x11ec23['attributes'],function(_0x3cd36d){var _0x49695b={};_0x49695b[_0x3cd36d]={'$like':'%'+_0x40941c[_0x2866('0x2b')][_0x2866('0x36')]+'%'};return _0x49695b;})});}_0x11ec23=_[_0x2866('0x34')]({},_0x11ec23,_0x40941c[_0x2866('0x37')]);return _0x20ec8d[_0x2866('0x4a')](_0x11ec23);}})[_0x2866('0x20')](function(_0x5b735d){if(_0x5b735d){_0x5c3a1f=_0x5b735d[_0x2866('0x3e')];if(!_0x40941c['query']['hasOwnProperty']('nolimit')){_0x11ec23[_0x2866('0x18')]=qs['limit'](_0x40941c[_0x2866('0x2b')]['limit']);_0x11ec23[_0x2866('0x1a')]=qs[_0x2866('0x1a')](_0x40941c['query'][_0x2866('0x1a')]);}return _0x20ec8d[_0x2866('0x4a')](_0x11ec23);}})['then'](function(_0x3fe393){if(_0x3fe393){return _0x3fe393?{'count':_0x5c3a1f,'rows':_0x3fe393}:null;}})['then'](respondWithResult(_0x5feab3,null))[_0x2866('0x3b')](handleError(_0x5feab3,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9dce79d..45e25fe 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e70=['moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','api'];(function(_0xf1fc14,_0x44fbf4){var _0x15ea3c=function(_0x54e375){while(--_0x54e375){_0xf1fc14['push'](_0xf1fc14['shift']());}};_0x15ea3c(++_0x44fbf4);}(_0x1e70,0x1cc));var _0x01e7=function(_0x510b26,_0x5d979c){_0x510b26=_0x510b26-0x0;var _0x5764cb=_0x1e70[_0x510b26];return _0x5764cb;};'use strict';var _=require(_0x01e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x01e7('0x1'));var moment=require(_0x01e7('0x2'));var BPromise=require(_0x01e7('0x3'));var rp=require(_0x01e7('0x4'));var fs=require('fs');var path=require(_0x01e7('0x5'));var rimraf=require(_0x01e7('0x6'));var config=require('../../config/environment');var attributes=require(_0x01e7('0x7'));module[_0x01e7('0x8')]=function(_0x951c8b,_0x199ec1){return _0x951c8b[_0x01e7('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x01e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82cb=['path','rimraf','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4b627f,_0x139bd4){var _0x2951c2=function(_0x475533){while(--_0x475533){_0x4b627f['push'](_0x4b627f['shift']());}};_0x2951c2(++_0x139bd4);}(_0x82cb,0x1e6));var _0xb82c=function(_0x1390a2,_0x2e39c3){_0x1390a2=_0x1390a2-0x0;var _0x333eac=_0x82cb[_0x1390a2];return _0x333eac;};'use strict';var _=require(_0xb82c('0x0'));var util=require(_0xb82c('0x1'));var logger=require(_0xb82c('0x2'))('api');var moment=require(_0xb82c('0x3'));var BPromise=require(_0xb82c('0x4'));var rp=require(_0xb82c('0x5'));var fs=require('fs');var path=require(_0xb82c('0x6'));var rimraf=require(_0xb82c('0x7'));var config=require('../../config/environment');var attributes=require(_0xb82c('0x8'));module[_0xb82c('0x9')]=function(_0x3a6686,_0x318396){return _0x3a6686['define'](_0xb82c('0xa'),attributes,{'tableName':_0xb82c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 4a36330..103ac85 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28f5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x28f5,0x19e));var _0x528f=function(_0x2480bd,_0xef1afe){_0x2480bd=_0x2480bd-0x0;var _0x810335=_0x28f5[_0x2480bd];return _0x810335;};'use strict';var _=require('lodash');var util=require(_0x528f('0x0'));var moment=require(_0x528f('0x1'));var BPromise=require(_0x528f('0x2'));var rs=require(_0x528f('0x3'));var fs=require('fs');var Redis=require(_0x528f('0x4'));var db=require(_0x528f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x528f('0x6'))(_0x528f('0x7'));var config=require(_0x528f('0x8'));var jayson=require(_0x528f('0x9'));var client=jayson[_0x528f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d02db,_0x13c423,_0x4705b4){return new BPromise(function(_0xb0aeac,_0x3e9fbf){return client[_0x528f('0xb')](_0x1d02db,_0x4705b4)[_0x528f('0xc')](function(_0x590526){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13c423,'request\x20sent');logger[_0x528f('0xd')](_0x528f('0xe'),_0x13c423,'request\x20sent',JSON[_0x528f('0xf')](_0x590526));if(_0x590526[_0x528f('0x10')]){if(_0x590526[_0x528f('0x10')][_0x528f('0x11')]===0x1f4){logger[_0x528f('0x10')](_0x528f('0x12'),_0x13c423,_0x590526['error'][_0x528f('0x13')]);return _0x3e9fbf(_0x590526['error'][_0x528f('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13c423,_0x590526[_0x528f('0x10')][_0x528f('0x13')]);return _0xb0aeac(_0x590526['error']['message']);}else{logger['info'](_0x528f('0x12'),_0x13c423,_0x528f('0x14'));_0xb0aeac(_0x590526[_0x528f('0x15')]['message']);}})[_0x528f('0x16')](function(_0x462bd9){logger[_0x528f('0x10')](_0x528f('0x12'),_0x13c423,_0x462bd9);_0x3e9fbf(_0x462bd9);});});} \ No newline at end of file +var _0x3085=['request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x181d98,_0xf7d4d3){var _0x43eb84=function(_0xc009c4){while(--_0xc009c4){_0x181d98['push'](_0x181d98['shift']());}};_0x43eb84(++_0xf7d4d3);}(_0x3085,0x19a));var _0x5308=function(_0x23e9bc,_0x3b8803){_0x23e9bc=_0x23e9bc-0x0;var _0x3ba54d=_0x3085[_0x23e9bc];return _0x3ba54d;};'use strict';var _=require(_0x5308('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5308('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5308('0x2'));var db=require(_0x5308('0x3'))['db'];var utils=require(_0x5308('0x4'));var logger=require(_0x5308('0x5'))('rpc');var config=require(_0x5308('0x6'));var jayson=require(_0x5308('0x7'));var client=jayson[_0x5308('0x8')][_0x5308('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18930e,_0x167a55,_0x48aadd){return new BPromise(function(_0x2d76e7,_0x1556ed){return client[_0x5308('0xa')](_0x18930e,_0x48aadd)[_0x5308('0xb')](function(_0xa91b4f){logger['info'](_0x5308('0xc'),_0x167a55,_0x5308('0xd'));logger['debug'](_0x5308('0xe'),_0x167a55,'request\x20sent',JSON[_0x5308('0xf')](_0xa91b4f));if(_0xa91b4f[_0x5308('0x10')]){if(_0xa91b4f[_0x5308('0x10')][_0x5308('0x11')]===0x1f4){logger[_0x5308('0x10')](_0x5308('0xc'),_0x167a55,_0xa91b4f['error'][_0x5308('0x12')]);return _0x1556ed(_0xa91b4f[_0x5308('0x10')][_0x5308('0x12')]);}logger[_0x5308('0x10')](_0x5308('0xc'),_0x167a55,_0xa91b4f[_0x5308('0x10')]['message']);return _0x2d76e7(_0xa91b4f['error'][_0x5308('0x12')]);}else{logger['info'](_0x5308('0xc'),_0x167a55,_0x5308('0xd'));_0x2d76e7(_0xa91b4f[_0x5308('0x13')][_0x5308('0x12')]);}})['catch'](function(_0x581b19){logger[_0x5308('0x10')](_0x5308('0xc'),_0x167a55,_0x581b19);_0x1556ed(_0x581b19);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index e324b71..90555aa 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ab=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','/:id','show','post','create','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x12c0ef,_0x1331cd){var _0x4c0a22=function(_0x5736a6){while(--_0x5736a6){_0x12c0ef['push'](_0x12c0ef['shift']());}};_0x4c0a22(++_0x1331cd);}(_0x84ab,0x12f));var _0xb84a=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x84ab[_0x3207aa];return _0x51758f;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0xc')]('/',auth['isAuthenticated'](),controller[_0xb84a('0xd')]);router['put'](_0xb84a('0xa'),auth[_0xb84a('0xe')](),controller[_0xb84a('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb84a('0x10')]);module[_0xb84a('0x11')]=router; \ No newline at end of file +var _0x3d9c=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','create','put','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3d9c,0x134));var _0xc3d9=function(_0x5bb37f,_0x5eef97){_0x5bb37f=_0x5bb37f-0x0;var _0x14ffec=_0x3d9c[_0x5bb37f];return _0x14ffec;};'use strict';var multer=require(_0xc3d9('0x0'));var util=require('util');var path=require(_0xc3d9('0x1'));var timeout=require(_0xc3d9('0x2'));var express=require(_0xc3d9('0x3'));var router=express['Router']();var fs_extra=require(_0xc3d9('0x4'));var auth=require(_0xc3d9('0x5'));var interaction=require(_0xc3d9('0x6'));var config=require(_0xc3d9('0x7'));var controller=require(_0xc3d9('0x8'));router[_0xc3d9('0x9')]('/',auth[_0xc3d9('0xa')](),controller['index']);router[_0xc3d9('0x9')](_0xc3d9('0xb'),auth['isAuthenticated'](),controller[_0xc3d9('0xc')]);router['post']('/',auth[_0xc3d9('0xa')](),controller[_0xc3d9('0xd')]);router[_0xc3d9('0xe')]('/:id',auth[_0xc3d9('0xa')](),controller[_0xc3d9('0xf')]);router['delete'](_0xc3d9('0xb'),auth[_0xc3d9('0xa')](),controller[_0xc3d9('0x10')]);module[_0xc3d9('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 763bae8..7505dca 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2f8=['ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x1ef7d8,_0x4324a3){var _0x922e0=function(_0x4772a5){while(--_0x4772a5){_0x1ef7d8['push'](_0x1ef7d8['shift']());}};_0x922e0(++_0x4324a3);}(_0xa2f8,0x11e));var _0x8a2f=function(_0x44b2f2,_0x5cfe50){_0x44b2f2=_0x44b2f2-0x0;var _0xb1f1c4=_0xa2f8[_0x44b2f2];return _0xb1f1c4;};'use strict';var Sequelize=require(_0x8a2f('0x0'));module[_0x8a2f('0x1')]={'type':{'type':Sequelize[_0x8a2f('0x2')]('string',_0x8a2f('0x3'),_0x8a2f('0x4'),'keyValue','picklist'),'defaultValue':_0x8a2f('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8a2f('0x6')]},'keyType':{'type':Sequelize[_0x8a2f('0x2')](_0x8a2f('0x5'),_0x8a2f('0x3'),_0x8a2f('0x4'))},'keyContent':{'type':Sequelize[_0x8a2f('0x6')]},'idField':{'type':Sequelize[_0x8a2f('0x6')]},'nameField':{'type':Sequelize[_0x8a2f('0x6')]},'customField':{'type':Sequelize[_0x8a2f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a2f('0x6')]}}; \ No newline at end of file +var _0x9763=['STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x485408,_0x30732d){var _0x377466=function(_0x4f8502){while(--_0x4f8502){_0x485408['push'](_0x485408['shift']());}};_0x377466(++_0x30732d);}(_0x9763,0x158));var _0x3976=function(_0x451878,_0x20619f){_0x451878=_0x451878-0x0;var _0x3e4531=_0x9763[_0x451878];return _0x3e4531;};'use strict';var Sequelize=require('sequelize');module[_0x3976('0x0')]={'type':{'type':Sequelize[_0x3976('0x1')]('string',_0x3976('0x2'),_0x3976('0x3'),_0x3976('0x4'),_0x3976('0x5')),'defaultValue':_0x3976('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3976('0x7')]},'keyType':{'type':Sequelize[_0x3976('0x1')](_0x3976('0x6'),_0x3976('0x2'),_0x3976('0x3'))},'keyContent':{'type':Sequelize[_0x3976('0x7')]},'idField':{'type':Sequelize[_0x3976('0x7')]},'nameField':{'type':Sequelize[_0x3976('0x7')]},'customField':{'type':Sequelize[_0x3976('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3976('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 89f0305..2ca7794 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5c7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd5c7,0x1c2));var _0x7d5c=function(_0x587e00,_0x59c8f3){_0x587e00=_0x587e00-0x0;var _0x27e587=_0xd5c7[_0x587e00];return _0x27e587;};'use strict';var emlformat=require(_0x7d5c('0x0'));var rimraf=require(_0x7d5c('0x1'));var zipdir=require(_0x7d5c('0x2'));var jsonpatch=require(_0x7d5c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7d5c('0x4'));var util=require(_0x7d5c('0x5'));var path=require('path');var sox=require(_0x7d5c('0x6'));var csv=require(_0x7d5c('0x7'));var ejs=require(_0x7d5c('0x8'));var fs=require('fs');var fs_extra=require(_0x7d5c('0x9'));var _=require(_0x7d5c('0xa'));var squel=require('squel');var crypto=require(_0x7d5c('0xb'));var jsforce=require(_0x7d5c('0xc'));var deskjs=require(_0x7d5c('0xd'));var toCsv=require(_0x7d5c('0x7'));var querystring=require(_0x7d5c('0xe'));var Papa=require(_0x7d5c('0xf'));var Redis=require(_0x7d5c('0x10'));var authService=require(_0x7d5c('0x11'));var qs=require(_0x7d5c('0x12'));var as=require(_0x7d5c('0x13'));var hardwareService=require(_0x7d5c('0x14'));var logger=require(_0x7d5c('0x15'))(_0x7d5c('0x16'));var utils=require(_0x7d5c('0x17'));var config=require(_0x7d5c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d5c('0x19'))['db'];function respondWithStatusCode(_0x447ca9,_0x5249b0){_0x5249b0=_0x5249b0||0xcc;return function(_0x13ee45){if(_0x13ee45){return _0x447ca9[_0x7d5c('0x1a')](_0x5249b0);}return _0x447ca9[_0x7d5c('0x1b')](_0x5249b0)[_0x7d5c('0x1c')]();};}function respondWithResult(_0x471a8d,_0x40e863){_0x40e863=_0x40e863||0xc8;return function(_0x354953){if(_0x354953){return _0x471a8d[_0x7d5c('0x1b')](_0x40e863)[_0x7d5c('0x1d')](_0x354953);}};}function respondWithFilteredResult(_0x43d5e0,_0x2507eb){return function(_0x2c79d0){if(_0x2c79d0){var _0x5da8fd=typeof _0x2507eb[_0x7d5c('0x1e')]===_0x7d5c('0x1f')&&typeof _0x2507eb[_0x7d5c('0x20')]===_0x7d5c('0x1f');var _0x16d836=_0x2c79d0[_0x7d5c('0x21')];var _0x10e896=_0x5da8fd?0x0:_0x2507eb['offset'];var _0x1100b4=_0x5da8fd?_0x2c79d0[_0x7d5c('0x21')]:_0x2507eb[_0x7d5c('0x1e')]+_0x2507eb[_0x7d5c('0x20')];var _0x2069e6;if(_0x1100b4>=_0x16d836){_0x1100b4=_0x16d836;_0x2069e6=0xc8;}else{_0x2069e6=0xce;}_0x43d5e0['status'](_0x2069e6);return _0x43d5e0[_0x7d5c('0x22')](_0x7d5c('0x23'),_0x10e896+'-'+_0x1100b4+'/'+_0x16d836)[_0x7d5c('0x1d')](_0x2c79d0);}return null;};}function patchUpdates(_0x5e1756){return function(_0x123a1e){try{jsonpatch[_0x7d5c('0x24')](_0x123a1e,_0x5e1756,!![]);}catch(_0xc6952){return BPromise[_0x7d5c('0x25')](_0xc6952);}return _0x123a1e[_0x7d5c('0x26')]();};}function saveUpdates(_0x4fd14a,_0xe26ea3){return function(_0x47f6ad){if(_0x47f6ad){return _0x47f6ad[_0x7d5c('0x27')](_0x4fd14a)[_0x7d5c('0x28')](function(_0x7517cd){return _0x7517cd;});}return null;};}function removeEntity(_0xc86d78,_0x8a8461){return function(_0x1a8aff){if(_0x1a8aff){return _0x1a8aff[_0x7d5c('0x29')]()[_0x7d5c('0x28')](function(){_0xc86d78['status'](0xcc)[_0x7d5c('0x1c')]();});}};}function handleEntityNotFound(_0x9cf6bf,_0x57338c){return function(_0x37c855){if(!_0x37c855){_0x9cf6bf[_0x7d5c('0x1a')](0x194);}return _0x37c855;};}function handleError(_0x5476a3,_0xe13f6a){_0xe13f6a=_0xe13f6a||0x1f4;return function(_0x5dc259){logger[_0x7d5c('0x2a')](_0x5dc259['stack']);if(_0x5dc259[_0x7d5c('0x2b')]){delete _0x5dc259['name'];}_0x5476a3[_0x7d5c('0x1b')](_0xe13f6a)['send'](_0x5dc259);};}exports[_0x7d5c('0x2c')]=function(_0xcd4217,_0xbd3b43){var _0x545176={},_0x4b6b74={},_0x799d72={'count':0x0,'rows':[]};var _0xfc3a50=_[_0x7d5c('0x2d')](db[_0x7d5c('0x2e')][_0x7d5c('0x2f')],function(_0x21549e){return{'name':_0x21549e[_0x7d5c('0x30')],'type':_0x21549e[_0x7d5c('0x31')][_0x7d5c('0x32')]};});_0x4b6b74[_0x7d5c('0x33')]=_[_0x7d5c('0x2d')](_0xfc3a50,'name');_0x4b6b74[_0x7d5c('0x34')]=_['keys'](_0xcd4217[_0x7d5c('0x34')]);_0x4b6b74[_0x7d5c('0x35')]=_[_0x7d5c('0x36')](_0x4b6b74['model'],_0x4b6b74['query']);_0x545176[_0x7d5c('0x37')]=_['intersection'](_0x4b6b74[_0x7d5c('0x33')],qs[_0x7d5c('0x38')](_0xcd4217['query'][_0x7d5c('0x38')]));_0x545176['attributes']=_0x545176[_0x7d5c('0x37')][_0x7d5c('0x39')]?_0x545176['attributes']:_0x4b6b74['model'];if(!_0xcd4217[_0x7d5c('0x34')]['hasOwnProperty'](_0x7d5c('0x3a'))){_0x545176[_0x7d5c('0x20')]=qs[_0x7d5c('0x20')](_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x20')]);_0x545176[_0x7d5c('0x1e')]=qs[_0x7d5c('0x1e')](_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x1e')]);}_0x545176[_0x7d5c('0x3b')]=qs[_0x7d5c('0x3c')](_0xcd4217[_0x7d5c('0x34')]['sort']);_0x545176[_0x7d5c('0x3d')]=qs[_0x7d5c('0x35')](_[_0x7d5c('0x3e')](_0xcd4217[_0x7d5c('0x34')],_0x4b6b74[_0x7d5c('0x35')]),_0xfc3a50);if(_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x3f')]){_0x545176[_0x7d5c('0x3d')]=_[_0x7d5c('0x40')](_0x545176['where'],{'$or':_['map'](_0xfc3a50,function(_0x2991f5){if(_0x2991f5[_0x7d5c('0x31')]!==_0x7d5c('0x41')){var _0x533736={};_0x533736[_0x2991f5[_0x7d5c('0x2b')]]={'$like':'%'+_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x3f')]+'%'};return _0x533736;}})});}_0x545176=_[_0x7d5c('0x40')]({},_0x545176,_0xcd4217['options']);var _0x178c3d={'where':_0x545176[_0x7d5c('0x3d')]};return db[_0x7d5c('0x2e')]['count'](_0x178c3d)[_0x7d5c('0x28')](function(_0xe7c751){_0x799d72[_0x7d5c('0x21')]=_0xe7c751;if(_0xcd4217[_0x7d5c('0x34')][_0x7d5c('0x42')]){_0x545176[_0x7d5c('0x43')]=[{'all':!![]}];}return db[_0x7d5c('0x2e')][_0x7d5c('0x44')](_0x545176);})[_0x7d5c('0x28')](function(_0x14854c){_0x799d72[_0x7d5c('0x45')]=_0x14854c;return _0x799d72;})[_0x7d5c('0x28')](respondWithFilteredResult(_0xbd3b43,_0x545176))[_0x7d5c('0x46')](handleError(_0xbd3b43,null));};exports[_0x7d5c('0x47')]=function(_0x307de2,_0x125c86){var _0x2d3b8c={'raw':!![],'where':{'id':_0x307de2[_0x7d5c('0x48')]['id']}},_0x4bbc99={};_0x4bbc99[_0x7d5c('0x33')]=_[_0x7d5c('0x49')](db[_0x7d5c('0x2e')][_0x7d5c('0x2f')]);_0x4bbc99[_0x7d5c('0x34')]=_[_0x7d5c('0x49')](_0x307de2[_0x7d5c('0x34')]);_0x4bbc99[_0x7d5c('0x35')]=_[_0x7d5c('0x36')](_0x4bbc99['model'],_0x4bbc99[_0x7d5c('0x34')]);_0x2d3b8c[_0x7d5c('0x37')]=_[_0x7d5c('0x36')](_0x4bbc99['model'],qs[_0x7d5c('0x38')](_0x307de2[_0x7d5c('0x34')]['fields']));_0x2d3b8c['attributes']=_0x2d3b8c[_0x7d5c('0x37')][_0x7d5c('0x39')]?_0x2d3b8c[_0x7d5c('0x37')]:_0x4bbc99[_0x7d5c('0x33')];if(_0x307de2['query'][_0x7d5c('0x42')]){_0x2d3b8c[_0x7d5c('0x43')]=[{'all':!![]}];}_0x2d3b8c=_['merge']({},_0x2d3b8c,_0x307de2[_0x7d5c('0x4a')]);return db[_0x7d5c('0x2e')][_0x7d5c('0x4b')](_0x2d3b8c)[_0x7d5c('0x28')](handleEntityNotFound(_0x125c86,null))[_0x7d5c('0x28')](respondWithResult(_0x125c86,null))[_0x7d5c('0x46')](handleError(_0x125c86,null));};exports['create']=function(_0x236a50,_0x1953be){return db[_0x7d5c('0x2e')][_0x7d5c('0x4c')](_0x236a50[_0x7d5c('0x4d')],{})['then'](respondWithResult(_0x1953be,0xc9))['catch'](handleError(_0x1953be,null));};exports[_0x7d5c('0x27')]=function(_0x23cfa3,_0xc61dbe){if(_0x23cfa3[_0x7d5c('0x4d')]['id']){delete _0x23cfa3[_0x7d5c('0x4d')]['id'];}return db['FreshsalesField'][_0x7d5c('0x4b')]({'where':{'id':_0x23cfa3[_0x7d5c('0x48')]['id']}})['then'](handleEntityNotFound(_0xc61dbe,null))[_0x7d5c('0x28')](saveUpdates(_0x23cfa3[_0x7d5c('0x4d')],null))[_0x7d5c('0x28')](respondWithResult(_0xc61dbe,null))[_0x7d5c('0x46')](handleError(_0xc61dbe,null));};exports[_0x7d5c('0x29')]=function(_0x5d59ab,_0x5ee5b9){return db[_0x7d5c('0x2e')]['find']({'where':{'id':_0x5d59ab[_0x7d5c('0x48')]['id']}})[_0x7d5c('0x28')](handleEntityNotFound(_0x5ee5b9,null))['then'](removeEntity(_0x5ee5b9,null))[_0x7d5c('0x46')](handleError(_0x5ee5b9,null));}; \ No newline at end of file +var _0x8319=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x5b734b,_0x486a7f){var _0x2a15a3=function(_0x187239){while(--_0x187239){_0x5b734b['push'](_0x5b734b['shift']());}};_0x2a15a3(++_0x486a7f);}(_0x8319,0x1c7));var _0x9831=function(_0x36806d,_0x5b7049){_0x36806d=_0x36806d-0x0;var _0x74309f=_0x8319[_0x36806d];return _0x74309f;};'use strict';var emlformat=require(_0x9831('0x0'));var rimraf=require(_0x9831('0x1'));var zipdir=require(_0x9831('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9831('0x3'));var moment=require('moment');var BPromise=require(_0x9831('0x4'));var Mustache=require(_0x9831('0x5'));var util=require(_0x9831('0x6'));var path=require(_0x9831('0x7'));var sox=require(_0x9831('0x8'));var csv=require('to-csv');var ejs=require(_0x9831('0x9'));var fs=require('fs');var fs_extra=require(_0x9831('0xa'));var _=require(_0x9831('0xb'));var squel=require('squel');var crypto=require(_0x9831('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9831('0xd'));var toCsv=require(_0x9831('0xe'));var querystring=require(_0x9831('0xf'));var Papa=require('papaparse');var Redis=require(_0x9831('0x10'));var authService=require(_0x9831('0x11'));var qs=require(_0x9831('0x12'));var as=require(_0x9831('0x13'));var hardwareService=require(_0x9831('0x14'));var logger=require('../../config/logger')(_0x9831('0x15'));var utils=require(_0x9831('0x16'));var config=require(_0x9831('0x17'));var licenseUtil=require(_0x9831('0x18'));var db=require(_0x9831('0x19'))['db'];function respondWithStatusCode(_0x4d3771,_0xaf41d0){_0xaf41d0=_0xaf41d0||0xcc;return function(_0x20ad63){if(_0x20ad63){return _0x4d3771[_0x9831('0x1a')](_0xaf41d0);}return _0x4d3771[_0x9831('0x1b')](_0xaf41d0)[_0x9831('0x1c')]();};}function respondWithResult(_0x49b08a,_0x4e1be5){_0x4e1be5=_0x4e1be5||0xc8;return function(_0x11d90e){if(_0x11d90e){return _0x49b08a['status'](_0x4e1be5)[_0x9831('0x1d')](_0x11d90e);}};}function respondWithFilteredResult(_0x14b989,_0x37c4c1){return function(_0x4cf998){if(_0x4cf998){var _0x55fb00=typeof _0x37c4c1[_0x9831('0x1e')]===_0x9831('0x1f')&&typeof _0x37c4c1['limit']===_0x9831('0x1f');var _0x301a76=_0x4cf998[_0x9831('0x20')];var _0x1d8013=_0x55fb00?0x0:_0x37c4c1[_0x9831('0x1e')];var _0x2b0d62=_0x55fb00?_0x4cf998[_0x9831('0x20')]:_0x37c4c1[_0x9831('0x1e')]+_0x37c4c1[_0x9831('0x21')];var _0x354b1f;if(_0x2b0d62>=_0x301a76){_0x2b0d62=_0x301a76;_0x354b1f=0xc8;}else{_0x354b1f=0xce;}_0x14b989['status'](_0x354b1f);return _0x14b989[_0x9831('0x22')](_0x9831('0x23'),_0x1d8013+'-'+_0x2b0d62+'/'+_0x301a76)[_0x9831('0x1d')](_0x4cf998);}return null;};}function patchUpdates(_0x27a5dd){return function(_0x53dd31){try{jsonpatch[_0x9831('0x24')](_0x53dd31,_0x27a5dd,!![]);}catch(_0x124305){return BPromise[_0x9831('0x25')](_0x124305);}return _0x53dd31['save']();};}function saveUpdates(_0x31dd86,_0x11cc78){return function(_0x318597){if(_0x318597){return _0x318597[_0x9831('0x26')](_0x31dd86)[_0x9831('0x27')](function(_0x927b04){return _0x927b04;});}return null;};}function removeEntity(_0x129b47,_0xcd7315){return function(_0x29f9aa){if(_0x29f9aa){return _0x29f9aa[_0x9831('0x28')]()[_0x9831('0x27')](function(){_0x129b47[_0x9831('0x1b')](0xcc)[_0x9831('0x1c')]();});}};}function handleEntityNotFound(_0x5cc82b,_0xa80c60){return function(_0x509292){if(!_0x509292){_0x5cc82b['sendStatus'](0x194);}return _0x509292;};}function handleError(_0x3d105e,_0x4fc1cd){_0x4fc1cd=_0x4fc1cd||0x1f4;return function(_0x780f74){logger[_0x9831('0x29')](_0x780f74[_0x9831('0x2a')]);if(_0x780f74[_0x9831('0x2b')]){delete _0x780f74[_0x9831('0x2b')];}_0x3d105e[_0x9831('0x1b')](_0x4fc1cd)[_0x9831('0x2c')](_0x780f74);};}exports[_0x9831('0x2d')]=function(_0xb46ac2,_0x3e17dd){var _0x594884={},_0x150a65={},_0x1ba8ae={'count':0x0,'rows':[]};var _0x3f627e=_[_0x9831('0x2e')](db[_0x9831('0x2f')][_0x9831('0x30')],function(_0x4a6278){return{'name':_0x4a6278[_0x9831('0x31')],'type':_0x4a6278[_0x9831('0x32')][_0x9831('0x33')]};});_0x150a65[_0x9831('0x34')]=_[_0x9831('0x2e')](_0x3f627e,_0x9831('0x2b'));_0x150a65[_0x9831('0x35')]=_['keys'](_0xb46ac2[_0x9831('0x35')]);_0x150a65['filters']=_[_0x9831('0x36')](_0x150a65['model'],_0x150a65[_0x9831('0x35')]);_0x594884['attributes']=_[_0x9831('0x36')](_0x150a65['model'],qs[_0x9831('0x37')](_0xb46ac2[_0x9831('0x35')][_0x9831('0x37')]));_0x594884[_0x9831('0x38')]=_0x594884[_0x9831('0x38')]['length']?_0x594884[_0x9831('0x38')]:_0x150a65[_0x9831('0x34')];if(!_0xb46ac2[_0x9831('0x35')]['hasOwnProperty'](_0x9831('0x39'))){_0x594884[_0x9831('0x21')]=qs[_0x9831('0x21')](_0xb46ac2[_0x9831('0x35')][_0x9831('0x21')]);_0x594884[_0x9831('0x1e')]=qs[_0x9831('0x1e')](_0xb46ac2['query'][_0x9831('0x1e')]);}_0x594884[_0x9831('0x3a')]=qs[_0x9831('0x3b')](_0xb46ac2[_0x9831('0x35')]['sort']);_0x594884[_0x9831('0x3c')]=qs[_0x9831('0x3d')](_[_0x9831('0x3e')](_0xb46ac2[_0x9831('0x35')],_0x150a65[_0x9831('0x3d')]),_0x3f627e);if(_0xb46ac2['query']['filter']){_0x594884[_0x9831('0x3c')]=_[_0x9831('0x3f')](_0x594884[_0x9831('0x3c')],{'$or':_[_0x9831('0x2e')](_0x3f627e,function(_0x9271f9){if(_0x9271f9[_0x9831('0x32')]!=='VIRTUAL'){var _0x2880d4={};_0x2880d4[_0x9271f9[_0x9831('0x2b')]]={'$like':'%'+_0xb46ac2[_0x9831('0x35')][_0x9831('0x40')]+'%'};return _0x2880d4;}})});}_0x594884=_['merge']({},_0x594884,_0xb46ac2[_0x9831('0x41')]);var _0x3b102f={'where':_0x594884[_0x9831('0x3c')]};return db[_0x9831('0x2f')]['count'](_0x3b102f)[_0x9831('0x27')](function(_0x53e331){_0x1ba8ae[_0x9831('0x20')]=_0x53e331;if(_0xb46ac2[_0x9831('0x35')][_0x9831('0x42')]){_0x594884['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x9831('0x43')](_0x594884);})[_0x9831('0x27')](function(_0x32f9c8){_0x1ba8ae[_0x9831('0x44')]=_0x32f9c8;return _0x1ba8ae;})[_0x9831('0x27')](respondWithFilteredResult(_0x3e17dd,_0x594884))[_0x9831('0x45')](handleError(_0x3e17dd,null));};exports[_0x9831('0x46')]=function(_0x1e3fbf,_0x1d5a11){var _0x4dd8d5={'raw':!![],'where':{'id':_0x1e3fbf[_0x9831('0x47')]['id']}},_0xed6db9={};_0xed6db9[_0x9831('0x34')]=_[_0x9831('0x48')](db[_0x9831('0x2f')][_0x9831('0x30')]);_0xed6db9[_0x9831('0x35')]=_[_0x9831('0x48')](_0x1e3fbf[_0x9831('0x35')]);_0xed6db9[_0x9831('0x3d')]=_[_0x9831('0x36')](_0xed6db9['model'],_0xed6db9['query']);_0x4dd8d5[_0x9831('0x38')]=_[_0x9831('0x36')](_0xed6db9[_0x9831('0x34')],qs[_0x9831('0x37')](_0x1e3fbf['query'][_0x9831('0x37')]));_0x4dd8d5[_0x9831('0x38')]=_0x4dd8d5[_0x9831('0x38')][_0x9831('0x49')]?_0x4dd8d5[_0x9831('0x38')]:_0xed6db9[_0x9831('0x34')];if(_0x1e3fbf[_0x9831('0x35')][_0x9831('0x42')]){_0x4dd8d5[_0x9831('0x4a')]=[{'all':!![]}];}_0x4dd8d5=_[_0x9831('0x3f')]({},_0x4dd8d5,_0x1e3fbf['options']);return db[_0x9831('0x2f')][_0x9831('0x4b')](_0x4dd8d5)[_0x9831('0x27')](handleEntityNotFound(_0x1d5a11,null))['then'](respondWithResult(_0x1d5a11,null))[_0x9831('0x45')](handleError(_0x1d5a11,null));};exports[_0x9831('0x4c')]=function(_0x35bd7d,_0x57f85f){return db['FreshsalesField'][_0x9831('0x4c')](_0x35bd7d['body'],{})['then'](respondWithResult(_0x57f85f,0xc9))[_0x9831('0x45')](handleError(_0x57f85f,null));};exports[_0x9831('0x26')]=function(_0x3364a4,_0x42bab6){if(_0x3364a4[_0x9831('0x4d')]['id']){delete _0x3364a4[_0x9831('0x4d')]['id'];}return db[_0x9831('0x2f')]['find']({'where':{'id':_0x3364a4[_0x9831('0x47')]['id']}})[_0x9831('0x27')](handleEntityNotFound(_0x42bab6,null))[_0x9831('0x27')](saveUpdates(_0x3364a4[_0x9831('0x4d')],null))[_0x9831('0x27')](respondWithResult(_0x42bab6,null))[_0x9831('0x45')](handleError(_0x42bab6,null));};exports[_0x9831('0x28')]=function(_0x519699,_0x1f0392){return db['FreshsalesField']['find']({'where':{'id':_0x519699[_0x9831('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f0392,null))['then'](removeEntity(_0x1f0392,null))[_0x9831('0x45')](handleError(_0x1f0392,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 5803e44..71788cb 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x390a=['exports','define','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x390a,0xc9));var _0xa390=function(_0x5d6b96,_0x40cd35){_0x5d6b96=_0x5d6b96-0x0;var _0x5826b2=_0x390a[_0x5d6b96];return _0x5826b2;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var logger=require(_0xa390('0x2'))(_0xa390('0x3'));var moment=require('moment');var BPromise=require(_0xa390('0x4'));var rp=require(_0xa390('0x5'));var fs=require('fs');var path=require(_0xa390('0x6'));var rimraf=require(_0xa390('0x7'));var config=require('../../config/environment');var attributes=require(_0xa390('0x8'));module[_0xa390('0x9')]=function(_0x3d7cd7,_0x4ac9f5){return _0x3d7cd7[_0xa390('0xa')](_0xa390('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xa390('0xc'),_0xa390('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ba3=['path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x257e08,_0x35d419){var _0x9829b6=function(_0x2c9365){while(--_0x2c9365){_0x257e08['push'](_0x257e08['shift']());}};_0x9829b6(++_0x35d419);}(_0x5ba3,0x140));var _0x35ba=function(_0x518419,_0x4c6fe3){_0x518419=_0x518419-0x0;var _0x7d0181=_0x5ba3[_0x518419];return _0x7d0181;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var logger=require(_0x35ba('0x1'))(_0x35ba('0x2'));var moment=require('moment');var BPromise=require(_0x35ba('0x3'));var rp=require(_0x35ba('0x4'));var fs=require('fs');var path=require(_0x35ba('0x5'));var rimraf=require('rimraf');var config=require(_0x35ba('0x6'));var attributes=require(_0x35ba('0x7'));module[_0x35ba('0x8')]=function(_0x596785,_0x54c722){return _0x596785[_0x35ba('0x9')](_0x35ba('0xa'),attributes,{'tableName':_0x35ba('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x35ba('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 1a40133..0c8e678 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x5d58,0x187));var _0x85d5=function(_0x5c174b,_0x1689c8){_0x5c174b=_0x5c174b-0x0;var _0x5318a3=_0x5d58[_0x5c174b];return _0x5318a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file +var _0x1967=['then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x1967,0x173));var _0x7196=function(_0x4b74fb,_0x47d0e4){_0x4b74fb=_0x4b74fb-0x0;var _0x119b2d=_0x1967[_0x4b74fb];return _0x119b2d;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c53c63b..823eae9 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x35a067,_0x26155a){var _0x553a46=function(_0x51f770){while(--_0x51f770){_0x35a067['push'](_0x35a067['shift']());}};_0x553a46(++_0x26155a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5a353f,_0x3bb5c7){var _0x176530=function(_0x179361){while(--_0x179361){_0x5a353f['push'](_0x5a353f['shift']());}};_0x176530(++_0x3bb5c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index dcdb8bd..6b0f945 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 _0x7d37=['sequelize','exports','STRING','username','integrationTab'];(function(_0x27d150,_0xacfba9){var _0x166eda=function(_0x3af888){while(--_0x3af888){_0x27d150['push'](_0x27d150['shift']());}};_0x166eda(++_0xacfba9);}(_0x7d37,0x1db));var _0x77d3=function(_0x56b2c6,_0x19d463){_0x56b2c6=_0x56b2c6-0x0;var _0x32b133=_0x7d37[_0x56b2c6];return _0x32b133;};'use strict';var Sequelize=require(_0x77d3('0x0'));module[_0x77d3('0x1')]={'name':{'type':Sequelize[_0x77d3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x77d3('0x2')],'unique':_0x77d3('0x3')},'remoteUri':{'type':Sequelize[_0x77d3('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x77d3('0x2')]},'clientSecret':{'type':Sequelize[_0x77d3('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x77d3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x77d3('0x4'),'newTab'),'defaultValue':_0x77d3('0x4')}}; \ No newline at end of file +var _0x10ad=['username','ENUM','integrationTab','newTab','STRING'];(function(_0x3013a9,_0x25958f){var _0x422fbd=function(_0x266e4c){while(--_0x266e4c){_0x3013a9['push'](_0x3013a9['shift']());}};_0x422fbd(++_0x25958f);}(_0x10ad,0xf4));var _0xd10a=function(_0x1dc249,_0x2932fe){_0x1dc249=_0x1dc249-0x0;var _0x14ef44=_0x10ad[_0x1dc249];return _0x14ef44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd10a('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0xd10a('0x1')},'remoteUri':{'type':Sequelize[_0xd10a('0x0')]},'password':{'type':Sequelize[_0xd10a('0x0')]},'clientId':{'type':Sequelize[_0xd10a('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xd10a('0x0')]},'serverUrl':{'type':Sequelize[_0xd10a('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xd10a('0x2')](_0xd10a('0x3'),_0xd10a('0x4')),'defaultValue':_0xd10a('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f50bc02..1066534 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 _0x6ecb=['SalesforceConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','login','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','int','email','textarea','phone','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','send','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','SalesforceAccount','findAll','catch','params','keys','rawAttributes','include','create','body','find','getConfigurations'];(function(_0x4500a6,_0x5a2569){var _0x18980a=function(_0x258a19){while(--_0x258a19){_0x4500a6['push'](_0x4500a6['shift']());}};_0x18980a(++_0x5a2569);}(_0x6ecb,0x19c));var _0xb6ec=function(_0x11dcf0,_0x4eb137){_0x11dcf0=_0x11dcf0-0x0;var _0x4f9831=_0x6ecb[_0x11dcf0];return _0x4f9831;};'use strict';var emlformat=require(_0xb6ec('0x0'));var rimraf=require(_0xb6ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb6ec('0x2'));var moment=require(_0xb6ec('0x3'));var BPromise=require(_0xb6ec('0x4'));var Mustache=require('mustache');var util=require(_0xb6ec('0x5'));var path=require(_0xb6ec('0x6'));var sox=require(_0xb6ec('0x7'));var csv=require(_0xb6ec('0x8'));var ejs=require(_0xb6ec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb6ec('0xa'));var crypto=require(_0xb6ec('0xb'));var jsforce=require(_0xb6ec('0xc'));var deskjs=require(_0xb6ec('0xd'));var toCsv=require(_0xb6ec('0x8'));var querystring=require(_0xb6ec('0xe'));var Papa=require(_0xb6ec('0xf'));var Redis=require(_0xb6ec('0x10'));var authService=require(_0xb6ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6ec('0x12'));var utils=require(_0xb6ec('0x13'));var config=require(_0xb6ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb6ec('0x15'));function respondWithStatusCode(_0x411aac,_0x4523a2){_0x4523a2=_0x4523a2||0xcc;return function(_0x5d6e5d){if(_0x5d6e5d){return _0x411aac['sendStatus'](_0x4523a2);}return _0x411aac[_0xb6ec('0x16')](_0x4523a2)['end']();};}function respondWithResult(_0x36023d,_0x53ce1b){_0x53ce1b=_0x53ce1b||0xc8;return function(_0xc75d95){if(_0xc75d95){return _0x36023d['status'](_0x53ce1b)[_0xb6ec('0x17')](_0xc75d95);}};}function respondWithFilteredResult(_0x48b85a,_0x4fcb7f){return function(_0x26df5a){if(_0x26df5a){var _0x20f057=typeof _0x4fcb7f['offset']===_0xb6ec('0x18')&&typeof _0x4fcb7f[_0xb6ec('0x19')]===_0xb6ec('0x18');var _0x4504f2=_0x26df5a[_0xb6ec('0x1a')];var _0x4b3b89=_0x20f057?0x0:_0x4fcb7f[_0xb6ec('0x1b')];var _0x40e5fc=_0x20f057?_0x26df5a[_0xb6ec('0x1a')]:_0x4fcb7f[_0xb6ec('0x1b')]+_0x4fcb7f['limit'];var _0x317b84;if(_0x40e5fc>=_0x4504f2){_0x40e5fc=_0x4504f2;_0x317b84=0xc8;}else{_0x317b84=0xce;}_0x48b85a[_0xb6ec('0x16')](_0x317b84);return _0x48b85a[_0xb6ec('0x1c')](_0xb6ec('0x1d'),_0x4b3b89+'-'+_0x40e5fc+'/'+_0x4504f2)[_0xb6ec('0x17')](_0x26df5a);}return null;};}function patchUpdates(_0x341dbf){return function(_0x5f0aaa){try{jsonpatch[_0xb6ec('0x1e')](_0x5f0aaa,_0x341dbf,!![]);}catch(_0x3c5ea6){return BPromise[_0xb6ec('0x1f')](_0x3c5ea6);}return _0x5f0aaa['save']();};}function saveUpdates(_0x45c163,_0x471649){return function(_0x464bfb){if(_0x464bfb){return _0x464bfb[_0xb6ec('0x20')](_0x45c163)['then'](function(_0x472ade){return _0x472ade;});}return null;};}function removeEntity(_0x5ccf7d,_0x22c3e4){return function(_0x289017){if(_0x289017){return _0x289017[_0xb6ec('0x21')]()[_0xb6ec('0x22')](function(){_0x5ccf7d['status'](0xcc)[_0xb6ec('0x23')]();});}};}function handleEntityNotFound(_0x24253d,_0x1d1420){return function(_0x36fdf4){if(!_0x36fdf4){_0x24253d[_0xb6ec('0x24')](0x194);}return _0x36fdf4;};}function handleError(_0x4516b0,_0x152149){_0x152149=_0x152149||0x1f4;return function(_0x9fecc){logger[_0xb6ec('0x25')](_0x9fecc[_0xb6ec('0x26')]);if(_0x9fecc[_0xb6ec('0x27')]){delete _0x9fecc[_0xb6ec('0x27')];}_0x4516b0[_0xb6ec('0x16')](_0x152149)[_0xb6ec('0x28')](_0x9fecc);};}exports['index']=function(_0xf12b8e,_0x2a2493){var _0x287483={},_0x3ac0fa={},_0xf569fb={'count':0x0,'rows':[]};var _0x56a5cd=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x4b563d){return{'name':_0x4b563d['fieldName'],'type':_0x4b563d[_0xb6ec('0x29')]['key']};});_0x3ac0fa[_0xb6ec('0x2a')]=_[_0xb6ec('0x2b')](_0x56a5cd,_0xb6ec('0x27'));_0x3ac0fa['query']=_['keys'](_0xf12b8e['query']);_0x3ac0fa[_0xb6ec('0x2c')]=_[_0xb6ec('0x2d')](_0x3ac0fa[_0xb6ec('0x2a')],_0x3ac0fa[_0xb6ec('0x2e')]);_0x287483[_0xb6ec('0x2f')]=_['intersection'](_0x3ac0fa[_0xb6ec('0x2a')],qs['fields'](_0xf12b8e['query'][_0xb6ec('0x30')]));_0x287483[_0xb6ec('0x2f')]=_0x287483[_0xb6ec('0x2f')][_0xb6ec('0x31')]?_0x287483[_0xb6ec('0x2f')]:_0x3ac0fa['model'];if(!_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x32')](_0xb6ec('0x33'))){_0x287483['limit']=qs[_0xb6ec('0x19')](_0xf12b8e['query'][_0xb6ec('0x19')]);_0x287483['offset']=qs[_0xb6ec('0x1b')](_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x1b')]);}_0x287483[_0xb6ec('0x34')]=qs[_0xb6ec('0x35')](_0xf12b8e['query'][_0xb6ec('0x35')]);_0x287483[_0xb6ec('0x36')]=qs[_0xb6ec('0x2c')](_[_0xb6ec('0x37')](_0xf12b8e[_0xb6ec('0x2e')],_0x3ac0fa[_0xb6ec('0x2c')]),_0x56a5cd);if(_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x38')]){_0x287483[_0xb6ec('0x36')]=_['merge'](_0x287483[_0xb6ec('0x36')],{'$or':_[_0xb6ec('0x2b')](_0x56a5cd,function(_0x2a1c8d){if(_0x2a1c8d[_0xb6ec('0x29')]!==_0xb6ec('0x39')){var _0x176ac7={};_0x176ac7[_0x2a1c8d[_0xb6ec('0x27')]]={'$like':'%'+_0xf12b8e['query'][_0xb6ec('0x38')]+'%'};return _0x176ac7;}})});}_0x287483=_[_0xb6ec('0x3a')]({},_0x287483,_0xf12b8e[_0xb6ec('0x3b')]);var _0x211653={'where':_0x287483[_0xb6ec('0x36')]};return db['SalesforceAccount']['count'](_0x211653)['then'](function(_0x2c7698){_0xf569fb['count']=_0x2c7698;if(_0xf12b8e[_0xb6ec('0x2e')][_0xb6ec('0x3c')]){_0x287483['include']=[{'all':!![]}];}return db[_0xb6ec('0x3d')][_0xb6ec('0x3e')](_0x287483);})[_0xb6ec('0x22')](function(_0x19618b){_0xf569fb['rows']=_0x19618b;return _0xf569fb;})[_0xb6ec('0x22')](respondWithFilteredResult(_0x2a2493,_0x287483))[_0xb6ec('0x3f')](handleError(_0x2a2493,null));};exports['show']=function(_0xe3316b,_0x2839be){var _0x5d5288={'raw':![],'where':{'id':_0xe3316b[_0xb6ec('0x40')]['id']}},_0x2b0ea4={};_0x2b0ea4[_0xb6ec('0x2a')]=_[_0xb6ec('0x41')](db[_0xb6ec('0x3d')][_0xb6ec('0x42')]);_0x2b0ea4[_0xb6ec('0x2e')]=_[_0xb6ec('0x41')](_0xe3316b[_0xb6ec('0x2e')]);_0x2b0ea4[_0xb6ec('0x2c')]=_['intersection'](_0x2b0ea4['model'],_0x2b0ea4[_0xb6ec('0x2e')]);_0x5d5288['attributes']=_[_0xb6ec('0x2d')](_0x2b0ea4['model'],qs[_0xb6ec('0x30')](_0xe3316b[_0xb6ec('0x2e')][_0xb6ec('0x30')]));_0x5d5288[_0xb6ec('0x2f')]=_0x5d5288[_0xb6ec('0x2f')][_0xb6ec('0x31')]?_0x5d5288[_0xb6ec('0x2f')]:_0x2b0ea4[_0xb6ec('0x2a')];if(_0xe3316b['query'][_0xb6ec('0x3c')]){_0x5d5288[_0xb6ec('0x43')]=[{'all':!![]}];}_0x5d5288=_['merge']({},_0x5d5288,_0xe3316b[_0xb6ec('0x3b')]);return db[_0xb6ec('0x3d')]['find'](_0x5d5288)[_0xb6ec('0x22')](handleEntityNotFound(_0x2839be,null))['then'](respondWithResult(_0x2839be,null))[_0xb6ec('0x3f')](handleError(_0x2839be,null));};exports['create']=function(_0x2300a8,_0x1fe864){return db[_0xb6ec('0x3d')][_0xb6ec('0x44')](_0x2300a8[_0xb6ec('0x45')],{})['then'](respondWithResult(_0x1fe864,0xc9))[_0xb6ec('0x3f')](handleError(_0x1fe864,null));};exports[_0xb6ec('0x20')]=function(_0x377a9e,_0x4143ee){if(_0x377a9e[_0xb6ec('0x45')]['id']){delete _0x377a9e[_0xb6ec('0x45')]['id'];}return db[_0xb6ec('0x3d')][_0xb6ec('0x46')]({'where':{'id':_0x377a9e[_0xb6ec('0x40')]['id']}})['then'](handleEntityNotFound(_0x4143ee,null))[_0xb6ec('0x22')](saveUpdates(_0x377a9e['body'],null))[_0xb6ec('0x22')](respondWithResult(_0x4143ee,null))['catch'](handleError(_0x4143ee,null));};exports[_0xb6ec('0x21')]=function(_0x1f2b87,_0x1e25e5){return db[_0xb6ec('0x3d')][_0xb6ec('0x46')]({'where':{'id':_0x1f2b87['params']['id']}})[_0xb6ec('0x22')](handleEntityNotFound(_0x1e25e5,null))[_0xb6ec('0x22')](removeEntity(_0x1e25e5,null))[_0xb6ec('0x3f')](handleError(_0x1e25e5,null));};exports[_0xb6ec('0x47')]=function(_0x97387a,_0xccf2d2,_0x5731bb){var _0x7af41a={};var _0x4bd50b={};var _0x3ce7d3;var _0x300a26;return db[_0xb6ec('0x3d')]['findOne']({'where':{'id':_0x97387a[_0xb6ec('0x40')]['id']}})[_0xb6ec('0x22')](handleEntityNotFound(_0xccf2d2,null))[_0xb6ec('0x22')](function(_0x3a2d8e){if(_0x3a2d8e){_0x3ce7d3=_0x3a2d8e;_0x4bd50b[_0xb6ec('0x2a')]=_[_0xb6ec('0x41')](db[_0xb6ec('0x48')][_0xb6ec('0x42')]);_0x4bd50b['query']=_['keys'](_0x97387a[_0xb6ec('0x2e')]);_0x4bd50b[_0xb6ec('0x2c')]=_['intersection'](_0x4bd50b[_0xb6ec('0x2a')],_0x4bd50b[_0xb6ec('0x2e')]);_0x7af41a[_0xb6ec('0x2f')]=_[_0xb6ec('0x2d')](_0x4bd50b[_0xb6ec('0x2a')],qs[_0xb6ec('0x30')](_0x97387a[_0xb6ec('0x2e')]['fields']));_0x7af41a['attributes']=_0x7af41a['attributes'][_0xb6ec('0x31')]?_0x7af41a[_0xb6ec('0x2f')]:_0x4bd50b[_0xb6ec('0x2a')];_0x7af41a[_0xb6ec('0x34')]=qs['sort'](_0x97387a['query'][_0xb6ec('0x35')]);_0x7af41a['where']=qs['filters'](_[_0xb6ec('0x37')](_0x97387a[_0xb6ec('0x2e')],_0x4bd50b[_0xb6ec('0x2c')]));if(_0x97387a['query'][_0xb6ec('0x38')]){_0x7af41a['where']=_[_0xb6ec('0x3a')](_0x7af41a[_0xb6ec('0x36')],{'$or':_[_0xb6ec('0x2b')](_0x7af41a[_0xb6ec('0x2f')],function(_0x341672){var _0x460a38={};_0x460a38[_0x341672]={'$like':'%'+_0x97387a[_0xb6ec('0x2e')][_0xb6ec('0x38')]+'%'};return _0x460a38;})});}_0x7af41a=_[_0xb6ec('0x3a')]({},_0x7af41a,_0x97387a[_0xb6ec('0x3b')]);return _0x3ce7d3[_0xb6ec('0x47')](_0x7af41a);}})['then'](function(_0x2897ac){if(_0x2897ac){_0x300a26=_0x2897ac[_0xb6ec('0x31')];if(!_0x97387a['query'][_0xb6ec('0x32')](_0xb6ec('0x33'))){_0x7af41a[_0xb6ec('0x19')]=qs[_0xb6ec('0x19')](_0x97387a[_0xb6ec('0x2e')][_0xb6ec('0x19')]);_0x7af41a[_0xb6ec('0x1b')]=qs[_0xb6ec('0x1b')](_0x97387a[_0xb6ec('0x2e')]['offset']);}return _0x3ce7d3[_0xb6ec('0x47')](_0x7af41a);}})[_0xb6ec('0x22')](function(_0x2a9d5a){if(_0x2a9d5a){return _0x2a9d5a?{'count':_0x300a26,'rows':_0x2a9d5a}:null;}})[_0xb6ec('0x22')](respondWithResult(_0xccf2d2,null))[_0xb6ec('0x3f')](handleError(_0xccf2d2,null));};exports['addConfiguration']=function(_0x36741e,_0xefb687,_0x49cfc7){if(_0x36741e[_0xb6ec('0x45')]['id']){delete _0x36741e[_0xb6ec('0x45')]['id'];}return db[_0xb6ec('0x3d')][_0xb6ec('0x49')]({'where':{'id':_0x36741e[_0xb6ec('0x40')]['id']}})['then'](handleEntityNotFound(_0xefb687,null))['then'](function(_0x1cd4b5){if(_0x1cd4b5){_0x36741e['body'][_0xb6ec('0x4a')]=_0x1cd4b5['id'];_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4b')]=integrations[_0xb6ec('0x4c')](_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4d')],_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x29')]);_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4e')]=integrations[_0xb6ec('0x4f')](_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x4d')],_0x36741e[_0xb6ec('0x45')][_0xb6ec('0x29')]);return db['SalesforceConfiguration'][_0xb6ec('0x44')](_0x36741e[_0xb6ec('0x45')],{'include':[{'model':db[_0xb6ec('0x50')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xb6ec('0x4e')}]});}return null;})[_0xb6ec('0x22')](respondWithResult(_0xefb687,null))[_0xb6ec('0x3f')](handleError(_0xefb687,null));};exports[_0xb6ec('0x51')]=function(_0x5e1da3,_0xef45c9,_0x433b46){var _0x3190eb;var _0xd6e6d6='';var _0x435f95=_0xb6ec('0x52');return db['SalesforceAccount']['findOne']({'where':{'id':_0x5e1da3[_0xb6ec('0x40')]['id']},'attributes':['id',_0xb6ec('0x53'),_0xb6ec('0x54'),_0xb6ec('0x55'),_0xb6ec('0x56'),_0xb6ec('0x57'),'securityToken']})[_0xb6ec('0x22')](handleEntityNotFound(_0xef45c9,null))[_0xb6ec('0x22')](function(_0x4b7bf6){if(_0x4b7bf6){_0xd6e6d6=_0x4b7bf6['remoteUri'];var _0x256e16=_0xd6e6d6[_0xb6ec('0x58')](-0x1);if(_0x256e16==='/'){_0xd6e6d6=_0xd6e6d6[_0xb6ec('0x59')](0x0,_0xd6e6d6['lastIndexOf'](_0x256e16));}_0x3190eb=new jsforce['Connection']({'oauth2':{'loginUrl':_0xd6e6d6,'clientId':_0x4b7bf6[_0xb6ec('0x54')],'clientSecret':_0x4b7bf6[_0xb6ec('0x55')]}});return _0x3190eb[_0xb6ec('0x5a')](_0x4b7bf6[_0xb6ec('0x56')],_0x4b7bf6['password'][_0xb6ec('0x5b')](_0x4b7bf6[_0xb6ec('0x5c')]));}})[_0xb6ec('0x22')](function(_0x4778fc){if(_0x4778fc){if(!_[_0xb6ec('0x5d')](_0x5e1da3[_0xb6ec('0x2e')]['ticketType'])){_0x435f95=_0x5e1da3[_0xb6ec('0x2e')][_0xb6ec('0x5e')];}return _0x3190eb[_0xb6ec('0x5f')](_0x435f95)[_0xb6ec('0x60')]();}})[_0xb6ec('0x22')](function(_0x3cddf4){var _0x5b18f0=[_0xb6ec('0x61'),_0xb6ec('0x62'),_0xb6ec('0x63'),'IsRecurrence',_0xb6ec('0x64'),_0xb6ec('0x65')];var _0x2f3e05=[_0xb6ec('0x66'),_0xb6ec('0x67'),'picklist','boolean',_0xb6ec('0x68'),_0xb6ec('0x69'),_0xb6ec('0x6a')];if(_0x3cddf4){_['remove'](_0x3cddf4[_0xb6ec('0x30')],function(_0x3e3844){return _0x5b18f0['includes'](_0x3e3844['name'])||!_0x2f3e05['includes'](_0x3e3844[_0xb6ec('0x29')]);});return{'count':_0x3cddf4[_0xb6ec('0x30')][_0xb6ec('0x31')],'rows':_[_0xb6ec('0x2b')](_0x3cddf4[_0xb6ec('0x30')],function(_0x12c7a2){return{'id':_0x12c7a2[_0xb6ec('0x27')],'name':_0x12c7a2[_0xb6ec('0x6b')],'custom':_0x12c7a2[_0xb6ec('0x6c')],'options':_0x12c7a2[_0xb6ec('0x6d')][_0xb6ec('0x31')]>0x0?_[_0xb6ec('0x2b')](_0x12c7a2[_0xb6ec('0x6d')],function(_0x1a8bd5){return{'name':_0x1a8bd5[_0xb6ec('0x6b')],'value':_0x1a8bd5[_0xb6ec('0x6e')]};}):_0x12c7a2[_0xb6ec('0x29')]==_0xb6ec('0x6f')?[{'name':_0xb6ec('0x70'),'value':_0xb6ec('0x71')},{'name':_0xb6ec('0x72'),'value':_0xb6ec('0x73')}]:[]};})};}})[_0xb6ec('0x22')](respondWithResult(_0xef45c9,null))['catch'](function(_0x14521f){var _0x57c4da=_0x5e1da3[_0xb6ec('0x2e')][_0xb6ec('0x74')]?0x1f4:_0x14521f[_0xb6ec('0x75')]||0x1f4;logger[_0xb6ec('0x25')](_0xb6ec('0x76'),_0xb6ec('0x51'),_0x57c4da,JSON[_0xb6ec('0x77')](_0x14521f));delete _0x14521f[_0xb6ec('0x27')];if(_0x57c4da===0x191){_0x57c4da=0x190;}_0xef45c9['status'](_0x57c4da)[_0xb6ec('0x28')](_0x5e1da3[_0xb6ec('0x2e')][_0xb6ec('0x74')]?{'message':_0xb6ec('0x78'),'statusCode':_0x14521f['statusCode']}:_0x14521f);});}; \ No newline at end of file +var _0xd8be=['limit','set','save','update','then','error','stack','name','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SalesforceAccount','include','rows','show','includeAll','find','catch','create','body','params','getConfigurations','findOne','pick','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','Task','remoteUri','clientId','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','login','username','password','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','label','picklistValues','value','True','False','false','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count'];(function(_0x455e82,_0x522f6f){var _0x2d0520=function(_0x11556e){while(--_0x11556e){_0x455e82['push'](_0x455e82['shift']());}};_0x2d0520(++_0x522f6f);}(_0xd8be,0x146));var _0xed8b=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xd8be[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0xed8b('0x0'));var rimraf=require(_0xed8b('0x1'));var zipdir=require(_0xed8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed8b('0x3'));var moment=require(_0xed8b('0x4'));var BPromise=require(_0xed8b('0x5'));var Mustache=require(_0xed8b('0x6'));var util=require(_0xed8b('0x7'));var path=require(_0xed8b('0x8'));var sox=require(_0xed8b('0x9'));var csv=require(_0xed8b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed8b('0xb'));var _=require(_0xed8b('0xc'));var squel=require(_0xed8b('0xd'));var crypto=require(_0xed8b('0xe'));var jsforce=require(_0xed8b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xed8b('0xa'));var querystring=require(_0xed8b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xed8b('0x11'));var qs=require(_0xed8b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xed8b('0x13'))(_0xed8b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed8b('0x15'));var db=require(_0xed8b('0x16'))['db'];var integrations=require(_0xed8b('0x17'));function respondWithStatusCode(_0x369c0e,_0xb341ce){_0xb341ce=_0xb341ce||0xcc;return function(_0x58af5f){if(_0x58af5f){return _0x369c0e[_0xed8b('0x18')](_0xb341ce);}return _0x369c0e[_0xed8b('0x19')](_0xb341ce)[_0xed8b('0x1a')]();};}function respondWithResult(_0x3c42f2,_0x49a43a){_0x49a43a=_0x49a43a||0xc8;return function(_0x49969d){if(_0x49969d){return _0x3c42f2[_0xed8b('0x19')](_0x49a43a)[_0xed8b('0x1b')](_0x49969d);}};}function respondWithFilteredResult(_0x5d5b9e,_0x16de48){return function(_0x17dfec){if(_0x17dfec){var _0x4582a0=typeof _0x16de48[_0xed8b('0x1c')]==='undefined'&&typeof _0x16de48['limit']===_0xed8b('0x1d');var _0x15cc17=_0x17dfec[_0xed8b('0x1e')];var _0xa96189=_0x4582a0?0x0:_0x16de48['offset'];var _0x17c8a8=_0x4582a0?_0x17dfec[_0xed8b('0x1e')]:_0x16de48[_0xed8b('0x1c')]+_0x16de48[_0xed8b('0x1f')];var _0x3f4b34;if(_0x17c8a8>=_0x15cc17){_0x17c8a8=_0x15cc17;_0x3f4b34=0xc8;}else{_0x3f4b34=0xce;}_0x5d5b9e[_0xed8b('0x19')](_0x3f4b34);return _0x5d5b9e[_0xed8b('0x20')]('Content-Range',_0xa96189+'-'+_0x17c8a8+'/'+_0x15cc17)[_0xed8b('0x1b')](_0x17dfec);}return null;};}function patchUpdates(_0x207aba){return function(_0x5592f7){try{jsonpatch['apply'](_0x5592f7,_0x207aba,!![]);}catch(_0xa3925e){return BPromise['reject'](_0xa3925e);}return _0x5592f7[_0xed8b('0x21')]();};}function saveUpdates(_0x446fd8,_0x3f4ff0){return function(_0x574d1c){if(_0x574d1c){return _0x574d1c[_0xed8b('0x22')](_0x446fd8)[_0xed8b('0x23')](function(_0x5c9195){return _0x5c9195;});}return null;};}function removeEntity(_0x5ddcc3,_0x437991){return function(_0x49a5ec){if(_0x49a5ec){return _0x49a5ec['destroy']()[_0xed8b('0x23')](function(){_0x5ddcc3[_0xed8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x562d16,_0x2b9987){return function(_0x27b085){if(!_0x27b085){_0x562d16['sendStatus'](0x194);}return _0x27b085;};}function handleError(_0x46bfb4,_0x2bb405){_0x2bb405=_0x2bb405||0x1f4;return function(_0x487c7e){logger[_0xed8b('0x24')](_0x487c7e[_0xed8b('0x25')]);if(_0x487c7e['name']){delete _0x487c7e[_0xed8b('0x26')];}_0x46bfb4['status'](_0x2bb405)['send'](_0x487c7e);};}exports['index']=function(_0x5dea1f,_0x41530f){var _0x2d1ff6={},_0x1d56e9={},_0x3f5081={'count':0x0,'rows':[]};var _0x54f6c8=_['map'](db['SalesforceAccount'][_0xed8b('0x27')],function(_0x470ee8){return{'name':_0x470ee8[_0xed8b('0x28')],'type':_0x470ee8[_0xed8b('0x29')]['key']};});_0x1d56e9[_0xed8b('0x2a')]=_[_0xed8b('0x2b')](_0x54f6c8,_0xed8b('0x26'));_0x1d56e9[_0xed8b('0x2c')]=_[_0xed8b('0x2d')](_0x5dea1f[_0xed8b('0x2c')]);_0x1d56e9[_0xed8b('0x2e')]=_[_0xed8b('0x2f')](_0x1d56e9[_0xed8b('0x2a')],_0x1d56e9[_0xed8b('0x2c')]);_0x2d1ff6[_0xed8b('0x30')]=_[_0xed8b('0x2f')](_0x1d56e9['model'],qs[_0xed8b('0x31')](_0x5dea1f[_0xed8b('0x2c')][_0xed8b('0x31')]));_0x2d1ff6[_0xed8b('0x30')]=_0x2d1ff6[_0xed8b('0x30')][_0xed8b('0x32')]?_0x2d1ff6[_0xed8b('0x30')]:_0x1d56e9['model'];if(!_0x5dea1f[_0xed8b('0x2c')][_0xed8b('0x33')](_0xed8b('0x34'))){_0x2d1ff6['limit']=qs[_0xed8b('0x1f')](_0x5dea1f[_0xed8b('0x2c')]['limit']);_0x2d1ff6[_0xed8b('0x1c')]=qs[_0xed8b('0x1c')](_0x5dea1f['query'][_0xed8b('0x1c')]);}_0x2d1ff6[_0xed8b('0x35')]=qs[_0xed8b('0x36')](_0x5dea1f[_0xed8b('0x2c')]['sort']);_0x2d1ff6[_0xed8b('0x37')]=qs['filters'](_['pick'](_0x5dea1f[_0xed8b('0x2c')],_0x1d56e9[_0xed8b('0x2e')]),_0x54f6c8);if(_0x5dea1f[_0xed8b('0x2c')]['filter']){_0x2d1ff6[_0xed8b('0x37')]=_[_0xed8b('0x38')](_0x2d1ff6['where'],{'$or':_[_0xed8b('0x2b')](_0x54f6c8,function(_0x37c4b9){if(_0x37c4b9['type']!==_0xed8b('0x39')){var _0x4ead5b={};_0x4ead5b[_0x37c4b9[_0xed8b('0x26')]]={'$like':'%'+_0x5dea1f['query'][_0xed8b('0x3a')]+'%'};return _0x4ead5b;}})});}_0x2d1ff6=_[_0xed8b('0x38')]({},_0x2d1ff6,_0x5dea1f[_0xed8b('0x3b')]);var _0x3ef5ae={'where':_0x2d1ff6['where']};return db[_0xed8b('0x3c')][_0xed8b('0x1e')](_0x3ef5ae)[_0xed8b('0x23')](function(_0x3c4d7e){_0x3f5081['count']=_0x3c4d7e;if(_0x5dea1f[_0xed8b('0x2c')]['includeAll']){_0x2d1ff6[_0xed8b('0x3d')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x2d1ff6);})[_0xed8b('0x23')](function(_0x5628f7){_0x3f5081[_0xed8b('0x3e')]=_0x5628f7;return _0x3f5081;})['then'](respondWithFilteredResult(_0x41530f,_0x2d1ff6))['catch'](handleError(_0x41530f,null));};exports[_0xed8b('0x3f')]=function(_0x5a77b0,_0x40f229){var _0x2334cd={'raw':![],'where':{'id':_0x5a77b0['params']['id']}},_0x280513={};_0x280513[_0xed8b('0x2a')]=_['keys'](db[_0xed8b('0x3c')]['rawAttributes']);_0x280513[_0xed8b('0x2c')]=_[_0xed8b('0x2d')](_0x5a77b0[_0xed8b('0x2c')]);_0x280513[_0xed8b('0x2e')]=_['intersection'](_0x280513[_0xed8b('0x2a')],_0x280513['query']);_0x2334cd['attributes']=_[_0xed8b('0x2f')](_0x280513[_0xed8b('0x2a')],qs[_0xed8b('0x31')](_0x5a77b0[_0xed8b('0x2c')]['fields']));_0x2334cd[_0xed8b('0x30')]=_0x2334cd['attributes'][_0xed8b('0x32')]?_0x2334cd['attributes']:_0x280513[_0xed8b('0x2a')];if(_0x5a77b0['query'][_0xed8b('0x40')]){_0x2334cd[_0xed8b('0x3d')]=[{'all':!![]}];}_0x2334cd=_[_0xed8b('0x38')]({},_0x2334cd,_0x5a77b0[_0xed8b('0x3b')]);return db[_0xed8b('0x3c')][_0xed8b('0x41')](_0x2334cd)[_0xed8b('0x23')](handleEntityNotFound(_0x40f229,null))['then'](respondWithResult(_0x40f229,null))[_0xed8b('0x42')](handleError(_0x40f229,null));};exports[_0xed8b('0x43')]=function(_0x2109ce,_0x423605){return db[_0xed8b('0x3c')]['create'](_0x2109ce[_0xed8b('0x44')],{})[_0xed8b('0x23')](respondWithResult(_0x423605,0xc9))[_0xed8b('0x42')](handleError(_0x423605,null));};exports[_0xed8b('0x22')]=function(_0x251353,_0x2081e2){if(_0x251353['body']['id']){delete _0x251353[_0xed8b('0x44')]['id'];}return db[_0xed8b('0x3c')][_0xed8b('0x41')]({'where':{'id':_0x251353[_0xed8b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2081e2,null))[_0xed8b('0x23')](saveUpdates(_0x251353['body'],null))[_0xed8b('0x23')](respondWithResult(_0x2081e2,null))['catch'](handleError(_0x2081e2,null));};exports['destroy']=function(_0x11e0c9,_0x3b2059){return db[_0xed8b('0x3c')][_0xed8b('0x41')]({'where':{'id':_0x11e0c9['params']['id']}})['then'](handleEntityNotFound(_0x3b2059,null))[_0xed8b('0x23')](removeEntity(_0x3b2059,null))[_0xed8b('0x42')](handleError(_0x3b2059,null));};exports[_0xed8b('0x46')]=function(_0x484663,_0x3b54c9,_0xb2b2f1){var _0x57c9b4={};var _0x1d9839={};var _0x41350d;var _0x1db193;return db[_0xed8b('0x3c')][_0xed8b('0x47')]({'where':{'id':_0x484663[_0xed8b('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b54c9,null))['then'](function(_0x441bfe){if(_0x441bfe){_0x41350d=_0x441bfe;_0x1d9839[_0xed8b('0x2a')]=_[_0xed8b('0x2d')](db['SalesforceConfiguration'][_0xed8b('0x27')]);_0x1d9839['query']=_[_0xed8b('0x2d')](_0x484663[_0xed8b('0x2c')]);_0x1d9839[_0xed8b('0x2e')]=_[_0xed8b('0x2f')](_0x1d9839['model'],_0x1d9839['query']);_0x57c9b4['attributes']=_[_0xed8b('0x2f')](_0x1d9839[_0xed8b('0x2a')],qs[_0xed8b('0x31')](_0x484663[_0xed8b('0x2c')][_0xed8b('0x31')]));_0x57c9b4[_0xed8b('0x30')]=_0x57c9b4['attributes']['length']?_0x57c9b4[_0xed8b('0x30')]:_0x1d9839[_0xed8b('0x2a')];_0x57c9b4[_0xed8b('0x35')]=qs[_0xed8b('0x36')](_0x484663['query'][_0xed8b('0x36')]);_0x57c9b4[_0xed8b('0x37')]=qs[_0xed8b('0x2e')](_[_0xed8b('0x48')](_0x484663[_0xed8b('0x2c')],_0x1d9839[_0xed8b('0x2e')]));if(_0x484663[_0xed8b('0x2c')]['filter']){_0x57c9b4[_0xed8b('0x37')]=_[_0xed8b('0x38')](_0x57c9b4['where'],{'$or':_['map'](_0x57c9b4[_0xed8b('0x30')],function(_0x5131ba){var _0x5b61fc={};_0x5b61fc[_0x5131ba]={'$like':'%'+_0x484663[_0xed8b('0x2c')]['filter']+'%'};return _0x5b61fc;})});}_0x57c9b4=_[_0xed8b('0x38')]({},_0x57c9b4,_0x484663[_0xed8b('0x3b')]);return _0x41350d[_0xed8b('0x46')](_0x57c9b4);}})['then'](function(_0x143040){if(_0x143040){_0x1db193=_0x143040[_0xed8b('0x32')];if(!_0x484663[_0xed8b('0x2c')][_0xed8b('0x33')](_0xed8b('0x34'))){_0x57c9b4['limit']=qs[_0xed8b('0x1f')](_0x484663[_0xed8b('0x2c')][_0xed8b('0x1f')]);_0x57c9b4[_0xed8b('0x1c')]=qs[_0xed8b('0x1c')](_0x484663['query'][_0xed8b('0x1c')]);}return _0x41350d['getConfigurations'](_0x57c9b4);}})[_0xed8b('0x23')](function(_0x2e297b){if(_0x2e297b){return _0x2e297b?{'count':_0x1db193,'rows':_0x2e297b}:null;}})['then'](respondWithResult(_0x3b54c9,null))['catch'](handleError(_0x3b54c9,null));};exports[_0xed8b('0x49')]=function(_0x15ecb8,_0x3eb946,_0x4c8992){if(_0x15ecb8[_0xed8b('0x44')]['id']){delete _0x15ecb8[_0xed8b('0x44')]['id'];}return db[_0xed8b('0x3c')]['findOne']({'where':{'id':_0x15ecb8[_0xed8b('0x45')]['id']}})[_0xed8b('0x23')](handleEntityNotFound(_0x3eb946,null))[_0xed8b('0x23')](function(_0x1ec642){if(_0x1ec642){_0x15ecb8['body']['AccountId']=_0x1ec642['id'];_0x15ecb8[_0xed8b('0x44')][_0xed8b('0x4a')]=integrations[_0xed8b('0x4b')](_0x15ecb8['body'][_0xed8b('0x4c')],_0x15ecb8[_0xed8b('0x44')][_0xed8b('0x29')]);_0x15ecb8[_0xed8b('0x44')]['Descriptions']=integrations[_0xed8b('0x4d')](_0x15ecb8[_0xed8b('0x44')]['channel'],_0x15ecb8[_0xed8b('0x44')]['type']);return db['SalesforceConfiguration'][_0xed8b('0x43')](_0x15ecb8[_0xed8b('0x44')],{'include':[{'model':db['SalesforceField'],'as':_0xed8b('0x4a')},{'model':db['SalesforceField'],'as':_0xed8b('0x4e')}]});}return null;})[_0xed8b('0x23')](respondWithResult(_0x3eb946,null))[_0xed8b('0x42')](handleError(_0x3eb946,null));};exports[_0xed8b('0x4f')]=function(_0x2ed91f,_0x4704c2,_0x537675){var _0x2de868;var _0x360b87='';var _0x55f0bf=_0xed8b('0x50');return db[_0xed8b('0x3c')][_0xed8b('0x47')]({'where':{'id':_0x2ed91f[_0xed8b('0x45')]['id']},'attributes':['id',_0xed8b('0x51'),_0xed8b('0x52'),'clientSecret','username','password',_0xed8b('0x53')]})['then'](handleEntityNotFound(_0x4704c2,null))[_0xed8b('0x23')](function(_0x1dca2f){if(_0x1dca2f){_0x360b87=_0x1dca2f[_0xed8b('0x51')];var _0x50d57b=_0x360b87[_0xed8b('0x54')](-0x1);if(_0x50d57b==='/'){_0x360b87=_0x360b87[_0xed8b('0x55')](0x0,_0x360b87[_0xed8b('0x56')](_0x50d57b));}_0x2de868=new jsforce[(_0xed8b('0x57'))]({'oauth2':{'loginUrl':_0x360b87,'clientId':_0x1dca2f[_0xed8b('0x52')],'clientSecret':_0x1dca2f[_0xed8b('0x58')]}});return _0x2de868[_0xed8b('0x59')](_0x1dca2f[_0xed8b('0x5a')],_0x1dca2f[_0xed8b('0x5b')][_0xed8b('0x5c')](_0x1dca2f[_0xed8b('0x53')]));}})[_0xed8b('0x23')](function(_0x3c12f2){if(_0x3c12f2){if(!_[_0xed8b('0x5d')](_0x2ed91f['query']['ticketType'])){_0x55f0bf=_0x2ed91f['query'][_0xed8b('0x5e')];}return _0x2de868[_0xed8b('0x5f')](_0x55f0bf)[_0xed8b('0x60')]();}})['then'](function(_0x2bebf6){var _0x1b4e3f=[_0xed8b('0x61'),_0xed8b('0x62'),'IsReminderSet',_0xed8b('0x63'),_0xed8b('0x64'),_0xed8b('0x65')];var _0x2f3896=['string',_0xed8b('0x66'),_0xed8b('0x67'),_0xed8b('0x68'),_0xed8b('0x69'),_0xed8b('0x6a'),_0xed8b('0x6b')];if(_0x2bebf6){_[_0xed8b('0x6c')](_0x2bebf6['fields'],function(_0x30415c){return _0x1b4e3f[_0xed8b('0x6d')](_0x30415c[_0xed8b('0x26')])||!_0x2f3896[_0xed8b('0x6d')](_0x30415c[_0xed8b('0x29')]);});return{'count':_0x2bebf6['fields'][_0xed8b('0x32')],'rows':_[_0xed8b('0x2b')](_0x2bebf6[_0xed8b('0x31')],function(_0x4abdaa){return{'id':_0x4abdaa[_0xed8b('0x26')],'name':_0x4abdaa[_0xed8b('0x6e')],'custom':_0x4abdaa['custom'],'options':_0x4abdaa[_0xed8b('0x6f')][_0xed8b('0x32')]>0x0?_[_0xed8b('0x2b')](_0x4abdaa[_0xed8b('0x6f')],function(_0x1aca7f){return{'name':_0x1aca7f[_0xed8b('0x6e')],'value':_0x1aca7f[_0xed8b('0x70')]};}):_0x4abdaa[_0xed8b('0x29')]=='boolean'?[{'name':_0xed8b('0x71'),'value':'true'},{'name':_0xed8b('0x72'),'value':_0xed8b('0x73')}]:[]};})};}})['then'](respondWithResult(_0x4704c2,null))[_0xed8b('0x42')](function(_0x41306a){var _0x2cc813=_0x2ed91f[_0xed8b('0x2c')][_0xed8b('0x74')]?0x1f4:_0x41306a[_0xed8b('0x75')]||0x1f4;logger[_0xed8b('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xed8b('0x4f'),_0x2cc813,JSON['stringify'](_0x41306a));delete _0x41306a[_0xed8b('0x26')];if(_0x2cc813===0x191){_0x2cc813=0x190;}_0x4704c2[_0xed8b('0x19')](_0x2cc813)['send'](_0x2ed91f[_0xed8b('0x2c')]['test']?{'message':_0xed8b('0x76'),'statusCode':_0x41306a[_0xed8b('0x75')]}:_0x41306a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5bbd926..9c2b6b9 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 _0xce56=['int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xce56,0x173));var _0x6ce5=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xce56[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x6ce5('0x0'));var util=require(_0x6ce5('0x1'));var logger=require(_0x6ce5('0x2'))(_0x6ce5('0x3'));var moment=require('moment');var BPromise=require(_0x6ce5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ce5('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x6ce5('0x6'));module[_0x6ce5('0x7')]=function(_0x4f1fbd,_0xa19152){return _0x4f1fbd[_0x6ce5('0x8')]('SalesforceAccount',attributes,{'tableName':_0x6ce5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79a5=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x79a5,0x17a));var _0x579a=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x79a5[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x579a('0x0'));var util=require(_0x579a('0x1'));var logger=require(_0x579a('0x2'))(_0x579a('0x3'));var moment=require('moment');var BPromise=require(_0x579a('0x4'));var rp=require(_0x579a('0x5'));var fs=require('fs');var path=require(_0x579a('0x6'));var rimraf=require(_0x579a('0x7'));var config=require(_0x579a('0x8'));var attributes=require(_0x579a('0x9'));var integrations=require(_0x579a('0xa'));module[_0x579a('0xb')]=function(_0x53cc9b,_0x5a1b3f){return _0x53cc9b[_0x579a('0xc')](_0x579a('0xd'),attributes,{'tableName':_0x579a('0xe'),'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 b51d149..133a400 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 _0x6ddc=['raw','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','limit','include','attributes','model','map','ShowSalesforceAccount','find'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x6ddc,0xac));var _0xc6dd=function(_0x4a7da5,_0x4d3827){_0x4a7da5=_0x4a7da5-0x0;var _0x258771=_0x6ddc[_0x4a7da5];return _0x258771;};'use strict';var _=require('lodash');var util=require(_0xc6dd('0x0'));var moment=require(_0xc6dd('0x1'));var BPromise=require(_0xc6dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6dd('0x3'))['db'];var utils=require(_0xc6dd('0x4'));var logger=require(_0xc6dd('0x5'))(_0xc6dd('0x6'));var config=require(_0xc6dd('0x7'));var jayson=require(_0xc6dd('0x8'));var client=jayson[_0xc6dd('0x9')][_0xc6dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422b03,_0x4de295,_0x582f09){return new BPromise(function(_0x90abbd,_0x2c43b5){return client['request'](_0x422b03,_0x582f09)[_0xc6dd('0xb')](function(_0x6e96b3){logger[_0xc6dd('0xc')](_0xc6dd('0xd'),_0x4de295,'request\x20sent');logger['debug'](_0xc6dd('0xe'),_0x4de295,'request\x20sent',JSON[_0xc6dd('0xf')](_0x6e96b3));if(_0x6e96b3['error']){if(_0x6e96b3[_0xc6dd('0x10')]['code']===0x1f4){logger[_0xc6dd('0x10')](_0xc6dd('0xd'),_0x4de295,_0x6e96b3[_0xc6dd('0x10')][_0xc6dd('0x11')]);return _0x2c43b5(_0x6e96b3[_0xc6dd('0x10')][_0xc6dd('0x11')]);}logger[_0xc6dd('0x10')](_0xc6dd('0xd'),_0x4de295,_0x6e96b3[_0xc6dd('0x10')][_0xc6dd('0x11')]);return _0x90abbd(_0x6e96b3['error'][_0xc6dd('0x11')]);}else{logger[_0xc6dd('0xc')](_0xc6dd('0xd'),_0x4de295,_0xc6dd('0x12'));_0x90abbd(_0x6e96b3[_0xc6dd('0x13')][_0xc6dd('0x11')]);}})[_0xc6dd('0x14')](function(_0x382ac1){logger[_0xc6dd('0x10')](_0xc6dd('0xd'),_0x4de295,_0x382ac1);_0x2c43b5(_0x382ac1);});});}exports[_0xc6dd('0x15')]=function(_0x52aa40){var _0x17e5fd=this;return new Promise(function(_0x511cce,_0x30622d){return db[_0xc6dd('0x16')][_0xc6dd('0x17')]({'raw':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40[_0xc6dd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52aa40['options']?_0x52aa40['options']['where']||null:null,'attributes':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40[_0xc6dd('0x18')]['attributes']||null:null,'limit':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40[_0xc6dd('0x18')][_0xc6dd('0x19')]||null:null,'include':_0x52aa40[_0xc6dd('0x18')]?_0x52aa40['options'][_0xc6dd('0x1a')]?_['map'](_0x52aa40[_0xc6dd('0x18')][_0xc6dd('0x1a')],function(_0x50b07a){return{'model':db[_0x50b07a['model']],'as':_0x50b07a['as'],'attributes':_0x50b07a[_0xc6dd('0x1b')],'include':_0x50b07a[_0xc6dd('0x1a')]?_['map'](_0x50b07a[_0xc6dd('0x1a')],function(_0x10597c){return{'model':db[_0x10597c[_0xc6dd('0x1c')]],'as':_0x10597c['as'],'attributes':_0x10597c[_0xc6dd('0x1b')],'include':_0x10597c[_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x10597c[_0xc6dd('0x1a')],function(_0x5b9b6e){return{'model':db[_0x5b9b6e['model']],'as':_0x5b9b6e['as'],'attributes':_0x5b9b6e[_0xc6dd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc6dd('0xb')](function(_0x19e20b){logger[_0xc6dd('0xc')](_0xc6dd('0x15'),_0x52aa40);logger['debug'](_0xc6dd('0x15'),_0x52aa40,JSON['stringify'](_0x19e20b));_0x511cce(_0x19e20b);})[_0xc6dd('0x14')](function(_0x1a155a){logger[_0xc6dd('0x10')]('GetSalesforceAccount',_0x1a155a[_0xc6dd('0x11')],_0x52aa40);_0x30622d(_0x17e5fd[_0xc6dd('0x10')](0x1f4,_0x1a155a['message']));});});};exports[_0xc6dd('0x1e')]=function(_0x81a3ee){var _0x28fcbd=this;return new Promise(function(_0x6d7471,_0x5d2232){return db[_0xc6dd('0x16')][_0xc6dd('0x1f')]({'raw':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee[_0xc6dd('0x18')][_0xc6dd('0x20')]===undefined?!![]:![]:!![],'where':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee[_0xc6dd('0x18')]['where']||null:null,'attributes':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee[_0xc6dd('0x18')][_0xc6dd('0x1b')]||null:null,'include':_0x81a3ee[_0xc6dd('0x18')]?_0x81a3ee['options'][_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x81a3ee[_0xc6dd('0x18')][_0xc6dd('0x1a')],function(_0x5052db){return{'model':db[_0x5052db[_0xc6dd('0x1c')]],'as':_0x5052db['as'],'attributes':_0x5052db['attributes'],'include':_0x5052db[_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x5052db['include'],function(_0x4bd4e2){return{'model':db[_0x4bd4e2[_0xc6dd('0x1c')]],'as':_0x4bd4e2['as'],'attributes':_0x4bd4e2['attributes'],'include':_0x4bd4e2[_0xc6dd('0x1a')]?_[_0xc6dd('0x1d')](_0x4bd4e2[_0xc6dd('0x1a')],function(_0x508f64){return{'model':db[_0x508f64[_0xc6dd('0x1c')]],'as':_0x508f64['as'],'attributes':_0x508f64[_0xc6dd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc6dd('0xb')](function(_0x47c83d){logger[_0xc6dd('0xc')](_0xc6dd('0x1e'),_0x81a3ee);logger[_0xc6dd('0x21')](_0xc6dd('0x1e'),_0x81a3ee,JSON[_0xc6dd('0xf')](_0x47c83d));_0x6d7471(_0x47c83d);})[_0xc6dd('0x14')](function(_0x5ca2a7){logger[_0xc6dd('0x10')](_0xc6dd('0x1e'),_0x5ca2a7[_0xc6dd('0x11')],_0x81a3ee);_0x5d2232(_0x28fcbd[_0xc6dd('0x10')](0x1f4,_0x5ca2a7[_0xc6dd('0x11')]));});});}; \ No newline at end of file +var _0x51ac=['limit','map','include','model','attributes','stringify','ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where'];(function(_0x206a78,_0x14ec75){var _0x10c1b7=function(_0x50cbaf){while(--_0x50cbaf){_0x206a78['push'](_0x206a78['shift']());}};_0x10c1b7(++_0x14ec75);}(_0x51ac,0xfd));var _0xc51a=function(_0x211719,_0x18ff9b){_0x211719=_0x211719-0x0;var _0x4c2de5=_0x51ac[_0x211719];return _0x4c2de5;};'use strict';var _=require(_0xc51a('0x0'));var util=require(_0xc51a('0x1'));var moment=require(_0xc51a('0x2'));var BPromise=require('bluebird');var rs=require(_0xc51a('0x3'));var fs=require('fs');var Redis=require(_0xc51a('0x4'));var db=require(_0xc51a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc51a('0x6'))(_0xc51a('0x7'));var config=require('../../config/environment');var jayson=require(_0xc51a('0x8'));var client=jayson['client'][_0xc51a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4516ef,_0x3a5b70,_0xe44a75){return new BPromise(function(_0x115d6d,_0x205b38){return client['request'](_0x4516ef,_0xe44a75)[_0xc51a('0xa')](function(_0x40f4fa){logger[_0xc51a('0xb')](_0xc51a('0xc'),_0x3a5b70,_0xc51a('0xd'));logger[_0xc51a('0xe')](_0xc51a('0xf'),_0x3a5b70,_0xc51a('0xd'),JSON['stringify'](_0x40f4fa));if(_0x40f4fa[_0xc51a('0x10')]){if(_0x40f4fa[_0xc51a('0x10')][_0xc51a('0x11')]===0x1f4){logger[_0xc51a('0x10')](_0xc51a('0xc'),_0x3a5b70,_0x40f4fa['error'][_0xc51a('0x12')]);return _0x205b38(_0x40f4fa[_0xc51a('0x10')]['message']);}logger[_0xc51a('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x3a5b70,_0x40f4fa['error'][_0xc51a('0x12')]);return _0x115d6d(_0x40f4fa[_0xc51a('0x10')][_0xc51a('0x12')]);}else{logger[_0xc51a('0xb')](_0xc51a('0xc'),_0x3a5b70,_0xc51a('0xd'));_0x115d6d(_0x40f4fa[_0xc51a('0x13')][_0xc51a('0x12')]);}})[_0xc51a('0x14')](function(_0x43d649){logger[_0xc51a('0x10')](_0xc51a('0xc'),_0x3a5b70,_0x43d649);_0x205b38(_0x43d649);});});}exports[_0xc51a('0x15')]=function(_0x4dc16f){var _0x222bb3=this;return new Promise(function(_0x4b9003,_0x401ad3){return db[_0xc51a('0x16')][_0xc51a('0x17')]({'raw':_0x4dc16f[_0xc51a('0x18')]?_0x4dc16f[_0xc51a('0x18')][_0xc51a('0x19')]===undefined?!![]:![]:!![],'where':_0x4dc16f['options']?_0x4dc16f['options'][_0xc51a('0x1a')]||null:null,'attributes':_0x4dc16f['options']?_0x4dc16f[_0xc51a('0x18')]['attributes']||null:null,'limit':_0x4dc16f['options']?_0x4dc16f[_0xc51a('0x18')][_0xc51a('0x1b')]||null:null,'include':_0x4dc16f[_0xc51a('0x18')]?_0x4dc16f[_0xc51a('0x18')]['include']?_[_0xc51a('0x1c')](_0x4dc16f['options'][_0xc51a('0x1d')],function(_0x14f96f){return{'model':db[_0x14f96f[_0xc51a('0x1e')]],'as':_0x14f96f['as'],'attributes':_0x14f96f['attributes'],'include':_0x14f96f[_0xc51a('0x1d')]?_[_0xc51a('0x1c')](_0x14f96f[_0xc51a('0x1d')],function(_0x196ba5){return{'model':db[_0x196ba5[_0xc51a('0x1e')]],'as':_0x196ba5['as'],'attributes':_0x196ba5['attributes'],'include':_0x196ba5[_0xc51a('0x1d')]?_[_0xc51a('0x1c')](_0x196ba5[_0xc51a('0x1d')],function(_0x51dc9c){return{'model':db[_0x51dc9c[_0xc51a('0x1e')]],'as':_0x51dc9c['as'],'attributes':_0x51dc9c[_0xc51a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc51a('0xa')](function(_0x56888){logger['info'](_0xc51a('0x15'),_0x4dc16f);logger[_0xc51a('0xe')](_0xc51a('0x15'),_0x4dc16f,JSON[_0xc51a('0x20')](_0x56888));_0x4b9003(_0x56888);})[_0xc51a('0x14')](function(_0x274ec3){logger[_0xc51a('0x10')](_0xc51a('0x15'),_0x274ec3['message'],_0x4dc16f);_0x401ad3(_0x222bb3['error'](0x1f4,_0x274ec3['message']));});});};exports[_0xc51a('0x21')]=function(_0x11919f){var _0x57bc9a=this;return new Promise(function(_0x2a975d,_0x1a6281){return db['SalesforceAccount'][_0xc51a('0x22')]({'raw':_0x11919f['options']?_0x11919f[_0xc51a('0x18')][_0xc51a('0x19')]===undefined?!![]:![]:!![],'where':_0x11919f[_0xc51a('0x18')]?_0x11919f[_0xc51a('0x18')][_0xc51a('0x1a')]||null:null,'attributes':_0x11919f[_0xc51a('0x18')]?_0x11919f[_0xc51a('0x18')]['attributes']||null:null,'include':_0x11919f[_0xc51a('0x18')]?_0x11919f['options']['include']?_[_0xc51a('0x1c')](_0x11919f['options'][_0xc51a('0x1d')],function(_0x3e4638){return{'model':db[_0x3e4638[_0xc51a('0x1e')]],'as':_0x3e4638['as'],'attributes':_0x3e4638[_0xc51a('0x1f')],'include':_0x3e4638[_0xc51a('0x1d')]?_[_0xc51a('0x1c')](_0x3e4638[_0xc51a('0x1d')],function(_0x3ae50d){return{'model':db[_0x3ae50d[_0xc51a('0x1e')]],'as':_0x3ae50d['as'],'attributes':_0x3ae50d['attributes'],'include':_0x3ae50d['include']?_[_0xc51a('0x1c')](_0x3ae50d[_0xc51a('0x1d')],function(_0xc930dc){return{'model':db[_0xc930dc[_0xc51a('0x1e')]],'as':_0xc930dc['as'],'attributes':_0xc930dc[_0xc51a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc51a('0xa')](function(_0x24c46a){logger['info'](_0xc51a('0x21'),_0x11919f);logger[_0xc51a('0xe')](_0xc51a('0x21'),_0x11919f,JSON[_0xc51a('0x20')](_0x24c46a));_0x2a975d(_0x24c46a);})[_0xc51a('0x14')](function(_0x1d69f8){logger['error']('ShowSalesforceAccount',_0x1d69f8[_0xc51a('0x12')],_0x11919f);_0x1a6281(_0x57bc9a[_0xc51a('0x10')](0x1f4,_0x1d69f8[_0xc51a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 7e9a345..923b5e0 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x1d709f,_0x2ab2ec){var _0x322763=function(_0x3114a9){while(--_0x3114a9){_0x1d709f['push'](_0x1d709f['shift']());}};_0x322763(++_0x2ab2ec);}(_0x7a54,0x106));var _0x47a5=function(_0xdeec93,_0x40e01d){_0xdeec93=_0xdeec93-0x0;var _0x54ecb3=_0x7a54[_0xdeec93];return _0x54ecb3;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdb28,0x106));var _0x8db2=function(_0x4e1550,_0x4d82c9){_0x4e1550=_0x4e1550-0x0;var _0x488ee2=_0xdb28[_0x4e1550];return _0x488ee2;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 3ef0374..8ff12ed 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 _0xe128=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize'];(function(_0x4bf4d5,_0x3ed68c){var _0x56e39b=function(_0x2fe16b){while(--_0x2fe16b){_0x4bf4d5['push'](_0x4bf4d5['shift']());}};_0x56e39b(++_0x3ed68c);}(_0xe128,0x1a3));var _0x8e12=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xe128[_0x4801a0];return _0x338e26;};'use strict';var Sequelize=require(_0x8e12('0x0'));module[_0x8e12('0x1')]={'name':{'type':Sequelize[_0x8e12('0x2')]},'description':{'type':Sequelize[_0x8e12('0x2')]},'ticketType':{'type':Sequelize[_0x8e12('0x3')](_0x8e12('0x4'),_0x8e12('0x5')),'defaultValue':_0x8e12('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8e12('0x6'),_0x8e12('0x7'),_0x8e12('0x8'),_0x8e12('0x9'),_0x8e12('0xa')),'defaultValue':_0x8e12('0x6')},'moduleCreate':{'type':Sequelize[_0x8e12('0x3')](_0x8e12('0xb'),_0x8e12('0x7'),_0x8e12('0x8'),_0x8e12('0xa')),'defaultValue':_0x8e12('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x8e12('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x545c=['Case','contact_lead','contact','lead','account_contact_lead','ENUM','account','sequelize','STRING','Task'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x545c,0x89));var _0xc545=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x545c[_0x8b8564];return _0x360c61;};'use strict';var Sequelize=require(_0xc545('0x0'));module['exports']={'name':{'type':Sequelize[_0xc545('0x1')]},'description':{'type':Sequelize[_0xc545('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xc545('0x2'),_0xc545('0x3')),'defaultValue':_0xc545('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xc545('0x4'),_0xc545('0x5'),_0xc545('0x6'),_0xc545('0x7'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xc545('0x8')]('nothing',_0xc545('0x5'),_0xc545('0x6'),_0xc545('0x9')),'defaultValue':_0xc545('0x6')},'leadId':{'type':Sequelize[_0xc545('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xc545('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xc545('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 9db3a89..1f1b545 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 _0x3916=['params','intersection','find','create','body','findOne','order','hasOwnProperty','nolimit','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','include','rows','catch'];(function(_0x57c0b5,_0x2eb95b){var _0x4b7bec=function(_0x14fb2a){while(--_0x14fb2a){_0x57c0b5['push'](_0x57c0b5['shift']());}};_0x4b7bec(++_0x2eb95b);}(_0x3916,0x18d));var _0x6391=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x3916[_0x385c76];return _0x5c8367;};'use strict';var emlformat=require(_0x6391('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6391('0x1'));var jsonpatch=require(_0x6391('0x2'));var rp=require('request-promise');var moment=require(_0x6391('0x3'));var BPromise=require(_0x6391('0x4'));var Mustache=require(_0x6391('0x5'));var util=require('util');var path=require(_0x6391('0x6'));var sox=require(_0x6391('0x7'));var csv=require('to-csv');var ejs=require(_0x6391('0x8'));var fs=require('fs');var fs_extra=require(_0x6391('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6391('0xa'));var jsforce=require(_0x6391('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6391('0xc'));var querystring=require(_0x6391('0xd'));var Papa=require(_0x6391('0xe'));var Redis=require(_0x6391('0xf'));var authService=require(_0x6391('0x10'));var qs=require(_0x6391('0x11'));var as=require(_0x6391('0x12'));var hardwareService=require(_0x6391('0x13'));var logger=require(_0x6391('0x14'))('api');var utils=require(_0x6391('0x15'));var config=require(_0x6391('0x16'));var licenseUtil=require(_0x6391('0x17'));var db=require(_0x6391('0x18'))['db'];function respondWithStatusCode(_0x5b3248,_0x4e425b){_0x4e425b=_0x4e425b||0xcc;return function(_0x45255b){if(_0x45255b){return _0x5b3248[_0x6391('0x19')](_0x4e425b);}return _0x5b3248[_0x6391('0x1a')](_0x4e425b)[_0x6391('0x1b')]();};}function respondWithResult(_0x26c6d2,_0x399f71){_0x399f71=_0x399f71||0xc8;return function(_0x136a8b){if(_0x136a8b){return _0x26c6d2[_0x6391('0x1a')](_0x399f71)['json'](_0x136a8b);}};}function respondWithFilteredResult(_0x2702b5,_0x190594){return function(_0x4bcfae){if(_0x4bcfae){var _0x26aee3=typeof _0x190594[_0x6391('0x1c')]===_0x6391('0x1d')&&typeof _0x190594[_0x6391('0x1e')]===_0x6391('0x1d');var _0x474988=_0x4bcfae[_0x6391('0x1f')];var _0x489ba0=_0x26aee3?0x0:_0x190594[_0x6391('0x1c')];var _0x6b1613=_0x26aee3?_0x4bcfae[_0x6391('0x1f')]:_0x190594['offset']+_0x190594[_0x6391('0x1e')];var _0x907230;if(_0x6b1613>=_0x474988){_0x6b1613=_0x474988;_0x907230=0xc8;}else{_0x907230=0xce;}_0x2702b5[_0x6391('0x1a')](_0x907230);return _0x2702b5[_0x6391('0x20')]('Content-Range',_0x489ba0+'-'+_0x6b1613+'/'+_0x474988)[_0x6391('0x21')](_0x4bcfae);}return null;};}function patchUpdates(_0x3d58f8){return function(_0x696f8){try{jsonpatch['apply'](_0x696f8,_0x3d58f8,!![]);}catch(_0x1796f8){return BPromise[_0x6391('0x22')](_0x1796f8);}return _0x696f8[_0x6391('0x23')]();};}function saveUpdates(_0x1c96f4,_0x44f4d1){return function(_0x1d57e5){if(_0x1d57e5){return _0x1d57e5[_0x6391('0x24')](_0x1c96f4)[_0x6391('0x25')](function(_0x412b49){return _0x412b49;});}return null;};}function removeEntity(_0x446f80,_0x275ab0){return function(_0x819478){if(_0x819478){return _0x819478[_0x6391('0x26')]()[_0x6391('0x25')](function(){_0x446f80[_0x6391('0x1a')](0xcc)[_0x6391('0x1b')]();});}};}function handleEntityNotFound(_0x4dbe5c,_0x4dc9b5){return function(_0x2d4abd){if(!_0x2d4abd){_0x4dbe5c['sendStatus'](0x194);}return _0x2d4abd;};}function handleError(_0x3bf7b7,_0x5e50e9){_0x5e50e9=_0x5e50e9||0x1f4;return function(_0x536d69){logger[_0x6391('0x27')](_0x536d69[_0x6391('0x28')]);if(_0x536d69[_0x6391('0x29')]){delete _0x536d69['name'];}_0x3bf7b7[_0x6391('0x1a')](_0x5e50e9)['send'](_0x536d69);};}exports[_0x6391('0x2a')]=function(_0x408fd1,_0x2e61d7){var _0x23989f={},_0x263125={},_0x5cc050={'count':0x0,'rows':[]};var _0x31263a=_[_0x6391('0x2b')](db[_0x6391('0x2c')][_0x6391('0x2d')],function(_0x504d25){return{'name':_0x504d25[_0x6391('0x2e')],'type':_0x504d25[_0x6391('0x2f')]['key']};});_0x263125[_0x6391('0x30')]=_['map'](_0x31263a,_0x6391('0x29'));_0x263125[_0x6391('0x31')]=_[_0x6391('0x32')](_0x408fd1['query']);_0x263125[_0x6391('0x33')]=_['intersection'](_0x263125['model'],_0x263125[_0x6391('0x31')]);_0x23989f['attributes']=_['intersection'](_0x263125[_0x6391('0x30')],qs[_0x6391('0x34')](_0x408fd1[_0x6391('0x31')][_0x6391('0x34')]));_0x23989f['attributes']=_0x23989f[_0x6391('0x35')][_0x6391('0x36')]?_0x23989f[_0x6391('0x35')]:_0x263125[_0x6391('0x30')];if(!_0x408fd1[_0x6391('0x31')]['hasOwnProperty']('nolimit')){_0x23989f[_0x6391('0x1e')]=qs[_0x6391('0x1e')](_0x408fd1[_0x6391('0x31')][_0x6391('0x1e')]);_0x23989f[_0x6391('0x1c')]=qs[_0x6391('0x1c')](_0x408fd1[_0x6391('0x31')]['offset']);}_0x23989f['order']=qs[_0x6391('0x37')](_0x408fd1['query'][_0x6391('0x37')]);_0x23989f[_0x6391('0x38')]=qs[_0x6391('0x33')](_[_0x6391('0x39')](_0x408fd1['query'],_0x263125[_0x6391('0x33')]),_0x31263a);if(_0x408fd1[_0x6391('0x31')][_0x6391('0x3a')]){_0x23989f['where']=_[_0x6391('0x3b')](_0x23989f[_0x6391('0x38')],{'$or':_['map'](_0x31263a,function(_0x1025f3){if(_0x1025f3[_0x6391('0x2f')]!=='VIRTUAL'){var _0x562d15={};_0x562d15[_0x1025f3[_0x6391('0x29')]]={'$like':'%'+_0x408fd1[_0x6391('0x31')][_0x6391('0x3a')]+'%'};return _0x562d15;}})});}_0x23989f=_['merge']({},_0x23989f,_0x408fd1[_0x6391('0x3c')]);var _0x1dd3cc={'where':_0x23989f['where']};return db['SalesforceConfiguration'][_0x6391('0x1f')](_0x1dd3cc)[_0x6391('0x25')](function(_0x42af10){_0x5cc050['count']=_0x42af10;if(_0x408fd1[_0x6391('0x31')][_0x6391('0x3d')]){_0x23989f[_0x6391('0x3e')]=[{'all':!![]}];}return db[_0x6391('0x2c')]['findAll'](_0x23989f);})['then'](function(_0x43d0b4){_0x5cc050[_0x6391('0x3f')]=_0x43d0b4;return _0x5cc050;})['then'](respondWithFilteredResult(_0x2e61d7,_0x23989f))[_0x6391('0x40')](handleError(_0x2e61d7,null));};exports['show']=function(_0x2b44f5,_0x287f7d){var _0x9455fa={'raw':![],'where':{'id':_0x2b44f5[_0x6391('0x41')]['id']}},_0x359bbd={};_0x359bbd[_0x6391('0x30')]=_[_0x6391('0x32')](db[_0x6391('0x2c')]['rawAttributes']);_0x359bbd[_0x6391('0x31')]=_[_0x6391('0x32')](_0x2b44f5[_0x6391('0x31')]);_0x359bbd[_0x6391('0x33')]=_['intersection'](_0x359bbd['model'],_0x359bbd['query']);_0x9455fa[_0x6391('0x35')]=_[_0x6391('0x42')](_0x359bbd[_0x6391('0x30')],qs[_0x6391('0x34')](_0x2b44f5[_0x6391('0x31')][_0x6391('0x34')]));_0x9455fa[_0x6391('0x35')]=_0x9455fa['attributes'][_0x6391('0x36')]?_0x9455fa[_0x6391('0x35')]:_0x359bbd[_0x6391('0x30')];if(_0x2b44f5[_0x6391('0x31')][_0x6391('0x3d')]){_0x9455fa[_0x6391('0x3e')]=[{'all':!![]}];}_0x9455fa=_['merge']({},_0x9455fa,_0x2b44f5['options']);return db[_0x6391('0x2c')][_0x6391('0x43')](_0x9455fa)[_0x6391('0x25')](handleEntityNotFound(_0x287f7d,null))['then'](respondWithResult(_0x287f7d,null))[_0x6391('0x40')](handleError(_0x287f7d,null));};exports[_0x6391('0x44')]=function(_0x24920d,_0x23a699){return db[_0x6391('0x2c')]['create'](_0x24920d[_0x6391('0x45')],{})['then'](respondWithResult(_0x23a699,0xc9))[_0x6391('0x40')](handleError(_0x23a699,null));};exports['update']=function(_0x114a88,_0x2c21a5){if(_0x114a88['body']['id']){delete _0x114a88['body']['id'];}return db[_0x6391('0x2c')]['find']({'where':{'id':_0x114a88[_0x6391('0x41')]['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x2c21a5,null))[_0x6391('0x25')](saveUpdates(_0x114a88[_0x6391('0x45')],null))[_0x6391('0x25')](respondWithResult(_0x2c21a5,null))[_0x6391('0x40')](handleError(_0x2c21a5,null));};exports[_0x6391('0x26')]=function(_0x99ddb0,_0x5917d1){return db[_0x6391('0x2c')][_0x6391('0x43')]({'where':{'id':_0x99ddb0['params']['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x5917d1,null))['then'](removeEntity(_0x5917d1,null))[_0x6391('0x40')](handleError(_0x5917d1,null));};exports['getFields']=function(_0x347eb9,_0x2b26b5,_0x1da26c){var _0x24ad34={};var _0x4f5d8f={};var _0xf45606;var _0x29ffb9;return db[_0x6391('0x2c')][_0x6391('0x46')]({'where':{'id':_0x347eb9[_0x6391('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b26b5,null))['then'](function(_0x494554){if(_0x494554){_0xf45606=_0x494554;_0x4f5d8f['model']=_[_0x6391('0x32')](db['SalesforceField'][_0x6391('0x2d')]);_0x4f5d8f[_0x6391('0x31')]=_[_0x6391('0x32')](_0x347eb9['query']);_0x4f5d8f['filters']=_['intersection'](_0x4f5d8f[_0x6391('0x30')],_0x4f5d8f[_0x6391('0x31')]);_0x24ad34[_0x6391('0x35')]=_[_0x6391('0x42')](_0x4f5d8f[_0x6391('0x30')],qs[_0x6391('0x34')](_0x347eb9['query'][_0x6391('0x34')]));_0x24ad34[_0x6391('0x35')]=_0x24ad34['attributes'][_0x6391('0x36')]?_0x24ad34[_0x6391('0x35')]:_0x4f5d8f[_0x6391('0x30')];_0x24ad34[_0x6391('0x47')]=qs[_0x6391('0x37')](_0x347eb9['query'][_0x6391('0x37')]);_0x24ad34[_0x6391('0x38')]=qs['filters'](_['pick'](_0x347eb9[_0x6391('0x31')],_0x4f5d8f[_0x6391('0x33')]));if(_0x347eb9[_0x6391('0x31')][_0x6391('0x3a')]){_0x24ad34['where']=_[_0x6391('0x3b')](_0x24ad34[_0x6391('0x38')],{'$or':_[_0x6391('0x2b')](_0x24ad34[_0x6391('0x35')],function(_0x2525ed){var _0x53da9e={};_0x53da9e[_0x2525ed]={'$like':'%'+_0x347eb9[_0x6391('0x31')]['filter']+'%'};return _0x53da9e;})});}_0x24ad34=_[_0x6391('0x3b')]({},_0x24ad34,_0x347eb9[_0x6391('0x3c')]);return _0xf45606['getFields'](_0x24ad34);}})[_0x6391('0x25')](function(_0x6e5b73){if(_0x6e5b73){_0x29ffb9=_0x6e5b73[_0x6391('0x36')];if(!_0x347eb9['query'][_0x6391('0x48')](_0x6391('0x49'))){_0x24ad34[_0x6391('0x1e')]=qs[_0x6391('0x1e')](_0x347eb9[_0x6391('0x31')]['limit']);_0x24ad34[_0x6391('0x1c')]=qs[_0x6391('0x1c')](_0x347eb9[_0x6391('0x31')][_0x6391('0x1c')]);}return _0xf45606[_0x6391('0x4a')](_0x24ad34);}})['then'](function(_0x512014){if(_0x512014){return _0x512014?{'count':_0x29ffb9,'rows':_0x512014}:null;}})[_0x6391('0x25')](respondWithResult(_0x2b26b5,null))[_0x6391('0x40')](handleError(_0x2b26b5,null));};exports['getSubjects']=function(_0x3ecd4c,_0x5be6ac,_0x4788f6){var _0x5b223d={};var _0x34a865={};var _0x150bef;var _0x10ee7b;return db[_0x6391('0x2c')]['findOne']({'where':{'id':_0x3ecd4c['params']['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x5be6ac,null))[_0x6391('0x25')](function(_0x28db20){if(_0x28db20){_0x150bef=_0x28db20;_0x34a865[_0x6391('0x30')]=_['keys'](db['SalesforceField'][_0x6391('0x2d')]);_0x34a865['query']=_['keys'](_0x3ecd4c[_0x6391('0x31')]);_0x34a865[_0x6391('0x33')]=_[_0x6391('0x42')](_0x34a865[_0x6391('0x30')],_0x34a865[_0x6391('0x31')]);_0x5b223d[_0x6391('0x35')]=_[_0x6391('0x42')](_0x34a865['model'],qs[_0x6391('0x34')](_0x3ecd4c[_0x6391('0x31')][_0x6391('0x34')]));_0x5b223d[_0x6391('0x35')]=_0x5b223d['attributes'][_0x6391('0x36')]?_0x5b223d['attributes']:_0x34a865[_0x6391('0x30')];_0x5b223d[_0x6391('0x47')]=qs['sort'](_0x3ecd4c[_0x6391('0x31')][_0x6391('0x37')]);_0x5b223d[_0x6391('0x38')]=qs[_0x6391('0x33')](_['pick'](_0x3ecd4c[_0x6391('0x31')],_0x34a865[_0x6391('0x33')]));if(_0x3ecd4c['query'][_0x6391('0x3a')]){_0x5b223d[_0x6391('0x38')]=_['merge'](_0x5b223d[_0x6391('0x38')],{'$or':_[_0x6391('0x2b')](_0x5b223d['attributes'],function(_0x2965f0){var _0x2a641d={};_0x2a641d[_0x2965f0]={'$like':'%'+_0x3ecd4c[_0x6391('0x31')][_0x6391('0x3a')]+'%'};return _0x2a641d;})});}_0x5b223d=_['merge']({},_0x5b223d,_0x3ecd4c[_0x6391('0x3c')]);return _0x150bef['getSubjects'](_0x5b223d);}})[_0x6391('0x25')](function(_0x458f7f){if(_0x458f7f){_0x10ee7b=_0x458f7f['length'];if(!_0x3ecd4c['query']['hasOwnProperty'](_0x6391('0x49'))){_0x5b223d[_0x6391('0x1e')]=qs['limit'](_0x3ecd4c['query'][_0x6391('0x1e')]);_0x5b223d[_0x6391('0x1c')]=qs[_0x6391('0x1c')](_0x3ecd4c[_0x6391('0x31')][_0x6391('0x1c')]);}return _0x150bef[_0x6391('0x4b')](_0x5b223d);}})[_0x6391('0x25')](function(_0x39d612){if(_0x39d612){return _0x39d612?{'count':_0x10ee7b,'rows':_0x39d612}:null;}})[_0x6391('0x25')](respondWithResult(_0x5be6ac,null))[_0x6391('0x40')](handleError(_0x5be6ac,null));};exports[_0x6391('0x4c')]=function(_0x120ca7,_0x59f6d0,_0x20236f){var _0x34b6ee={};var _0x282351={};var _0x327272;var _0x33d5da;return db['SalesforceConfiguration'][_0x6391('0x46')]({'where':{'id':_0x120ca7[_0x6391('0x41')]['id']}})[_0x6391('0x25')](handleEntityNotFound(_0x59f6d0,null))[_0x6391('0x25')](function(_0x12c468){if(_0x12c468){_0x327272=_0x12c468;_0x282351[_0x6391('0x30')]=_[_0x6391('0x32')](db['SalesforceField']['rawAttributes']);_0x282351[_0x6391('0x31')]=_[_0x6391('0x32')](_0x120ca7[_0x6391('0x31')]);_0x282351[_0x6391('0x33')]=_['intersection'](_0x282351['model'],_0x282351['query']);_0x34b6ee[_0x6391('0x35')]=_['intersection'](_0x282351[_0x6391('0x30')],qs[_0x6391('0x34')](_0x120ca7[_0x6391('0x31')][_0x6391('0x34')]));_0x34b6ee['attributes']=_0x34b6ee[_0x6391('0x35')][_0x6391('0x36')]?_0x34b6ee['attributes']:_0x282351['model'];_0x34b6ee[_0x6391('0x47')]=qs[_0x6391('0x37')](_0x120ca7[_0x6391('0x31')]['sort']);_0x34b6ee[_0x6391('0x38')]=qs[_0x6391('0x33')](_[_0x6391('0x39')](_0x120ca7[_0x6391('0x31')],_0x282351['filters']));if(_0x120ca7['query'][_0x6391('0x3a')]){_0x34b6ee[_0x6391('0x38')]=_['merge'](_0x34b6ee[_0x6391('0x38')],{'$or':_[_0x6391('0x2b')](_0x34b6ee[_0x6391('0x35')],function(_0x4c26bb){var _0x1a3a35={};_0x1a3a35[_0x4c26bb]={'$like':'%'+_0x120ca7[_0x6391('0x31')][_0x6391('0x3a')]+'%'};return _0x1a3a35;})});}_0x34b6ee=_[_0x6391('0x3b')]({},_0x34b6ee,_0x120ca7[_0x6391('0x3c')]);return _0x327272[_0x6391('0x4c')](_0x34b6ee);}})[_0x6391('0x25')](function(_0x12ac15){if(_0x12ac15){_0x33d5da=_0x12ac15[_0x6391('0x36')];if(!_0x120ca7[_0x6391('0x31')][_0x6391('0x48')](_0x6391('0x49'))){_0x34b6ee[_0x6391('0x1e')]=qs['limit'](_0x120ca7[_0x6391('0x31')][_0x6391('0x1e')]);_0x34b6ee['offset']=qs[_0x6391('0x1c')](_0x120ca7['query'][_0x6391('0x1c')]);}return _0x327272[_0x6391('0x4c')](_0x34b6ee);}})['then'](function(_0x389834){if(_0x389834){return _0x389834?{'count':_0x33d5da,'rows':_0x389834}:null;}})[_0x6391('0x25')](respondWithResult(_0x59f6d0,null))['catch'](handleError(_0x59f6d0,null));}; \ No newline at end of file +var _0x8c5a=['type','key','model','query','filters','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SalesforceConfiguration','include','catch','show','params','keys','intersection','length','includeAll','find','body','getFields','findOne','SalesforceField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x8c5a,0x1b6));var _0xa8c5=function(_0x4eb8d2,_0x5d2305){_0x4eb8d2=_0x4eb8d2-0x0;var _0x15267e=_0x8c5a[_0x4eb8d2];return _0x15267e;};'use strict';var emlformat=require(_0xa8c5('0x0'));var rimraf=require(_0xa8c5('0x1'));var zipdir=require(_0xa8c5('0x2'));var jsonpatch=require(_0xa8c5('0x3'));var rp=require(_0xa8c5('0x4'));var moment=require(_0xa8c5('0x5'));var BPromise=require(_0xa8c5('0x6'));var Mustache=require(_0xa8c5('0x7'));var util=require('util');var path=require(_0xa8c5('0x8'));var sox=require(_0xa8c5('0x9'));var csv=require(_0xa8c5('0xa'));var ejs=require(_0xa8c5('0xb'));var fs=require('fs');var fs_extra=require(_0xa8c5('0xc'));var _=require('lodash');var squel=require(_0xa8c5('0xd'));var crypto=require(_0xa8c5('0xe'));var jsforce=require(_0xa8c5('0xf'));var deskjs=require(_0xa8c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa8c5('0x11'));var Papa=require(_0xa8c5('0x12'));var Redis=require('ioredis');var authService=require(_0xa8c5('0x13'));var qs=require(_0xa8c5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8c5('0x15'));var logger=require(_0xa8c5('0x16'))(_0xa8c5('0x17'));var utils=require(_0xa8c5('0x18'));var config=require(_0xa8c5('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aa3d8,_0x2487ea){_0x2487ea=_0x2487ea||0xcc;return function(_0x30f43a){if(_0x30f43a){return _0x4aa3d8[_0xa8c5('0x1a')](_0x2487ea);}return _0x4aa3d8[_0xa8c5('0x1b')](_0x2487ea)[_0xa8c5('0x1c')]();};}function respondWithResult(_0x42f1e0,_0x45f381){_0x45f381=_0x45f381||0xc8;return function(_0x3b8709){if(_0x3b8709){return _0x42f1e0['status'](_0x45f381)[_0xa8c5('0x1d')](_0x3b8709);}};}function respondWithFilteredResult(_0x13c661,_0x363fdf){return function(_0x2a03f9){if(_0x2a03f9){var _0x190153=typeof _0x363fdf[_0xa8c5('0x1e')]==='undefined'&&typeof _0x363fdf[_0xa8c5('0x1f')]===_0xa8c5('0x20');var _0x2efdba=_0x2a03f9[_0xa8c5('0x21')];var _0x609cfa=_0x190153?0x0:_0x363fdf['offset'];var _0x53589d=_0x190153?_0x2a03f9[_0xa8c5('0x21')]:_0x363fdf['offset']+_0x363fdf[_0xa8c5('0x1f')];var _0xf22485;if(_0x53589d>=_0x2efdba){_0x53589d=_0x2efdba;_0xf22485=0xc8;}else{_0xf22485=0xce;}_0x13c661[_0xa8c5('0x1b')](_0xf22485);return _0x13c661[_0xa8c5('0x22')](_0xa8c5('0x23'),_0x609cfa+'-'+_0x53589d+'/'+_0x2efdba)['json'](_0x2a03f9);}return null;};}function patchUpdates(_0x35a6a0){return function(_0x38f2eb){try{jsonpatch['apply'](_0x38f2eb,_0x35a6a0,!![]);}catch(_0x2ff3cd){return BPromise[_0xa8c5('0x24')](_0x2ff3cd);}return _0x38f2eb[_0xa8c5('0x25')]();};}function saveUpdates(_0x4af24c,_0x3f5fae){return function(_0x59692e){if(_0x59692e){return _0x59692e[_0xa8c5('0x26')](_0x4af24c)[_0xa8c5('0x27')](function(_0x45d1a8){return _0x45d1a8;});}return null;};}function removeEntity(_0x3328ea,_0x2041df){return function(_0x37676a){if(_0x37676a){return _0x37676a[_0xa8c5('0x28')]()['then'](function(){_0x3328ea[_0xa8c5('0x1b')](0xcc)[_0xa8c5('0x1c')]();});}};}function handleEntityNotFound(_0x281372,_0x3a5a6b){return function(_0x1ea79e){if(!_0x1ea79e){_0x281372[_0xa8c5('0x1a')](0x194);}return _0x1ea79e;};}function handleError(_0x4e0773,_0x965315){_0x965315=_0x965315||0x1f4;return function(_0x3e88f6){logger[_0xa8c5('0x29')](_0x3e88f6[_0xa8c5('0x2a')]);if(_0x3e88f6[_0xa8c5('0x2b')]){delete _0x3e88f6[_0xa8c5('0x2b')];}_0x4e0773[_0xa8c5('0x1b')](_0x965315)[_0xa8c5('0x2c')](_0x3e88f6);};}exports['index']=function(_0x54557d,_0x53277e){var _0x1edd32={},_0x270f49={},_0x4ce3ff={'count':0x0,'rows':[]};var _0x4f72d6=_[_0xa8c5('0x2d')](db['SalesforceConfiguration'][_0xa8c5('0x2e')],function(_0x15f93e){return{'name':_0x15f93e[_0xa8c5('0x2f')],'type':_0x15f93e[_0xa8c5('0x30')][_0xa8c5('0x31')]};});_0x270f49[_0xa8c5('0x32')]=_[_0xa8c5('0x2d')](_0x4f72d6,_0xa8c5('0x2b'));_0x270f49[_0xa8c5('0x33')]=_['keys'](_0x54557d[_0xa8c5('0x33')]);_0x270f49[_0xa8c5('0x34')]=_['intersection'](_0x270f49[_0xa8c5('0x32')],_0x270f49[_0xa8c5('0x33')]);_0x1edd32[_0xa8c5('0x35')]=_['intersection'](_0x270f49[_0xa8c5('0x32')],qs['fields'](_0x54557d['query'][_0xa8c5('0x36')]));_0x1edd32[_0xa8c5('0x35')]=_0x1edd32[_0xa8c5('0x35')]['length']?_0x1edd32[_0xa8c5('0x35')]:_0x270f49[_0xa8c5('0x32')];if(!_0x54557d[_0xa8c5('0x33')]['hasOwnProperty'](_0xa8c5('0x37'))){_0x1edd32['limit']=qs[_0xa8c5('0x1f')](_0x54557d[_0xa8c5('0x33')][_0xa8c5('0x1f')]);_0x1edd32['offset']=qs[_0xa8c5('0x1e')](_0x54557d['query'][_0xa8c5('0x1e')]);}_0x1edd32[_0xa8c5('0x38')]=qs[_0xa8c5('0x39')](_0x54557d[_0xa8c5('0x33')]['sort']);_0x1edd32[_0xa8c5('0x3a')]=qs[_0xa8c5('0x34')](_['pick'](_0x54557d[_0xa8c5('0x33')],_0x270f49[_0xa8c5('0x34')]),_0x4f72d6);if(_0x54557d[_0xa8c5('0x33')][_0xa8c5('0x3b')]){_0x1edd32['where']=_[_0xa8c5('0x3c')](_0x1edd32['where'],{'$or':_['map'](_0x4f72d6,function(_0x1957bb){if(_0x1957bb[_0xa8c5('0x30')]!==_0xa8c5('0x3d')){var _0x1d301c={};_0x1d301c[_0x1957bb[_0xa8c5('0x2b')]]={'$like':'%'+_0x54557d[_0xa8c5('0x33')]['filter']+'%'};return _0x1d301c;}})});}_0x1edd32=_[_0xa8c5('0x3c')]({},_0x1edd32,_0x54557d[_0xa8c5('0x3e')]);var _0x47c62f={'where':_0x1edd32[_0xa8c5('0x3a')]};return db[_0xa8c5('0x3f')][_0xa8c5('0x21')](_0x47c62f)[_0xa8c5('0x27')](function(_0x2dc1a6){_0x4ce3ff[_0xa8c5('0x21')]=_0x2dc1a6;if(_0x54557d[_0xa8c5('0x33')]['includeAll']){_0x1edd32[_0xa8c5('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x1edd32);})[_0xa8c5('0x27')](function(_0xf06bab){_0x4ce3ff['rows']=_0xf06bab;return _0x4ce3ff;})[_0xa8c5('0x27')](respondWithFilteredResult(_0x53277e,_0x1edd32))[_0xa8c5('0x41')](handleError(_0x53277e,null));};exports[_0xa8c5('0x42')]=function(_0x2bef6c,_0x53dd93){var _0x5947ac={'raw':![],'where':{'id':_0x2bef6c[_0xa8c5('0x43')]['id']}},_0x3d4be7={};_0x3d4be7['model']=_['keys'](db[_0xa8c5('0x3f')][_0xa8c5('0x2e')]);_0x3d4be7['query']=_[_0xa8c5('0x44')](_0x2bef6c['query']);_0x3d4be7[_0xa8c5('0x34')]=_[_0xa8c5('0x45')](_0x3d4be7[_0xa8c5('0x32')],_0x3d4be7[_0xa8c5('0x33')]);_0x5947ac[_0xa8c5('0x35')]=_['intersection'](_0x3d4be7[_0xa8c5('0x32')],qs[_0xa8c5('0x36')](_0x2bef6c[_0xa8c5('0x33')][_0xa8c5('0x36')]));_0x5947ac[_0xa8c5('0x35')]=_0x5947ac[_0xa8c5('0x35')][_0xa8c5('0x46')]?_0x5947ac[_0xa8c5('0x35')]:_0x3d4be7[_0xa8c5('0x32')];if(_0x2bef6c[_0xa8c5('0x33')][_0xa8c5('0x47')]){_0x5947ac[_0xa8c5('0x40')]=[{'all':!![]}];}_0x5947ac=_['merge']({},_0x5947ac,_0x2bef6c[_0xa8c5('0x3e')]);return db[_0xa8c5('0x3f')][_0xa8c5('0x48')](_0x5947ac)['then'](handleEntityNotFound(_0x53dd93,null))['then'](respondWithResult(_0x53dd93,null))['catch'](handleError(_0x53dd93,null));};exports['create']=function(_0x172b74,_0x36ce1e){return db[_0xa8c5('0x3f')]['create'](_0x172b74[_0xa8c5('0x49')],{})[_0xa8c5('0x27')](respondWithResult(_0x36ce1e,0xc9))[_0xa8c5('0x41')](handleError(_0x36ce1e,null));};exports['update']=function(_0x1db723,_0x46998b){if(_0x1db723[_0xa8c5('0x49')]['id']){delete _0x1db723[_0xa8c5('0x49')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x1db723[_0xa8c5('0x43')]['id']}})[_0xa8c5('0x27')](handleEntityNotFound(_0x46998b,null))[_0xa8c5('0x27')](saveUpdates(_0x1db723[_0xa8c5('0x49')],null))[_0xa8c5('0x27')](respondWithResult(_0x46998b,null))[_0xa8c5('0x41')](handleError(_0x46998b,null));};exports['destroy']=function(_0x5b8dd9,_0x10b0dd){return db[_0xa8c5('0x3f')][_0xa8c5('0x48')]({'where':{'id':_0x5b8dd9[_0xa8c5('0x43')]['id']}})[_0xa8c5('0x27')](handleEntityNotFound(_0x10b0dd,null))[_0xa8c5('0x27')](removeEntity(_0x10b0dd,null))[_0xa8c5('0x41')](handleError(_0x10b0dd,null));};exports[_0xa8c5('0x4a')]=function(_0x428ce8,_0x4348df,_0x325314){var _0x5496af={};var _0x2dbb2e={};var _0x29496a;var _0x3b6022;return db[_0xa8c5('0x3f')][_0xa8c5('0x4b')]({'where':{'id':_0x428ce8['params']['id']}})[_0xa8c5('0x27')](handleEntityNotFound(_0x4348df,null))[_0xa8c5('0x27')](function(_0x37cebf){if(_0x37cebf){_0x29496a=_0x37cebf;_0x2dbb2e[_0xa8c5('0x32')]=_[_0xa8c5('0x44')](db[_0xa8c5('0x4c')][_0xa8c5('0x2e')]);_0x2dbb2e[_0xa8c5('0x33')]=_[_0xa8c5('0x44')](_0x428ce8['query']);_0x2dbb2e[_0xa8c5('0x34')]=_[_0xa8c5('0x45')](_0x2dbb2e[_0xa8c5('0x32')],_0x2dbb2e['query']);_0x5496af[_0xa8c5('0x35')]=_[_0xa8c5('0x45')](_0x2dbb2e[_0xa8c5('0x32')],qs[_0xa8c5('0x36')](_0x428ce8[_0xa8c5('0x33')][_0xa8c5('0x36')]));_0x5496af[_0xa8c5('0x35')]=_0x5496af[_0xa8c5('0x35')][_0xa8c5('0x46')]?_0x5496af['attributes']:_0x2dbb2e[_0xa8c5('0x32')];_0x5496af[_0xa8c5('0x38')]=qs[_0xa8c5('0x39')](_0x428ce8[_0xa8c5('0x33')]['sort']);_0x5496af[_0xa8c5('0x3a')]=qs[_0xa8c5('0x34')](_[_0xa8c5('0x4d')](_0x428ce8[_0xa8c5('0x33')],_0x2dbb2e[_0xa8c5('0x34')]));if(_0x428ce8['query'][_0xa8c5('0x3b')]){_0x5496af[_0xa8c5('0x3a')]=_[_0xa8c5('0x3c')](_0x5496af[_0xa8c5('0x3a')],{'$or':_[_0xa8c5('0x2d')](_0x5496af[_0xa8c5('0x35')],function(_0xa98573){var _0x3cc966={};_0x3cc966[_0xa98573]={'$like':'%'+_0x428ce8[_0xa8c5('0x33')][_0xa8c5('0x3b')]+'%'};return _0x3cc966;})});}_0x5496af=_[_0xa8c5('0x3c')]({},_0x5496af,_0x428ce8[_0xa8c5('0x3e')]);return _0x29496a[_0xa8c5('0x4a')](_0x5496af);}})[_0xa8c5('0x27')](function(_0x516ad3){if(_0x516ad3){_0x3b6022=_0x516ad3[_0xa8c5('0x46')];if(!_0x428ce8['query'][_0xa8c5('0x4e')](_0xa8c5('0x37'))){_0x5496af[_0xa8c5('0x1f')]=qs['limit'](_0x428ce8['query'][_0xa8c5('0x1f')]);_0x5496af[_0xa8c5('0x1e')]=qs[_0xa8c5('0x1e')](_0x428ce8['query'][_0xa8c5('0x1e')]);}return _0x29496a['getFields'](_0x5496af);}})[_0xa8c5('0x27')](function(_0xb33e54){if(_0xb33e54){return _0xb33e54?{'count':_0x3b6022,'rows':_0xb33e54}:null;}})[_0xa8c5('0x27')](respondWithResult(_0x4348df,null))[_0xa8c5('0x41')](handleError(_0x4348df,null));};exports[_0xa8c5('0x4f')]=function(_0x587675,_0x1c6572,_0x2989ea){var _0xc6a19={};var _0x30183d={};var _0x57b33d;var _0xabebfa;return db['SalesforceConfiguration'][_0xa8c5('0x4b')]({'where':{'id':_0x587675[_0xa8c5('0x43')]['id']}})[_0xa8c5('0x27')](handleEntityNotFound(_0x1c6572,null))[_0xa8c5('0x27')](function(_0x1a5ef5){if(_0x1a5ef5){_0x57b33d=_0x1a5ef5;_0x30183d[_0xa8c5('0x32')]=_[_0xa8c5('0x44')](db[_0xa8c5('0x4c')][_0xa8c5('0x2e')]);_0x30183d[_0xa8c5('0x33')]=_['keys'](_0x587675[_0xa8c5('0x33')]);_0x30183d[_0xa8c5('0x34')]=_[_0xa8c5('0x45')](_0x30183d['model'],_0x30183d[_0xa8c5('0x33')]);_0xc6a19[_0xa8c5('0x35')]=_['intersection'](_0x30183d['model'],qs['fields'](_0x587675['query'][_0xa8c5('0x36')]));_0xc6a19['attributes']=_0xc6a19[_0xa8c5('0x35')][_0xa8c5('0x46')]?_0xc6a19[_0xa8c5('0x35')]:_0x30183d[_0xa8c5('0x32')];_0xc6a19[_0xa8c5('0x38')]=qs[_0xa8c5('0x39')](_0x587675[_0xa8c5('0x33')]['sort']);_0xc6a19['where']=qs[_0xa8c5('0x34')](_[_0xa8c5('0x4d')](_0x587675[_0xa8c5('0x33')],_0x30183d[_0xa8c5('0x34')]));if(_0x587675['query'][_0xa8c5('0x3b')]){_0xc6a19[_0xa8c5('0x3a')]=_[_0xa8c5('0x3c')](_0xc6a19['where'],{'$or':_[_0xa8c5('0x2d')](_0xc6a19[_0xa8c5('0x35')],function(_0x5ecf99){var _0x19ec3a={};_0x19ec3a[_0x5ecf99]={'$like':'%'+_0x587675[_0xa8c5('0x33')][_0xa8c5('0x3b')]+'%'};return _0x19ec3a;})});}_0xc6a19=_[_0xa8c5('0x3c')]({},_0xc6a19,_0x587675[_0xa8c5('0x3e')]);return _0x57b33d['getSubjects'](_0xc6a19);}})[_0xa8c5('0x27')](function(_0x348574){if(_0x348574){_0xabebfa=_0x348574[_0xa8c5('0x46')];if(!_0x587675[_0xa8c5('0x33')][_0xa8c5('0x4e')]('nolimit')){_0xc6a19[_0xa8c5('0x1f')]=qs['limit'](_0x587675[_0xa8c5('0x33')][_0xa8c5('0x1f')]);_0xc6a19[_0xa8c5('0x1e')]=qs[_0xa8c5('0x1e')](_0x587675['query'][_0xa8c5('0x1e')]);}return _0x57b33d[_0xa8c5('0x4f')](_0xc6a19);}})[_0xa8c5('0x27')](function(_0xfc7898){if(_0xfc7898){return _0xfc7898?{'count':_0xabebfa,'rows':_0xfc7898}:null;}})['then'](respondWithResult(_0x1c6572,null))[_0xa8c5('0x41')](handleError(_0x1c6572,null));};exports[_0xa8c5('0x50')]=function(_0x1f3415,_0x236f7c,_0x158fc8){var _0x5ee1f8={};var _0x52fe86={};var _0x305c78;var _0x3988ce;return db[_0xa8c5('0x3f')]['findOne']({'where':{'id':_0x1f3415[_0xa8c5('0x43')]['id']}})['then'](handleEntityNotFound(_0x236f7c,null))[_0xa8c5('0x27')](function(_0x4aca20){if(_0x4aca20){_0x305c78=_0x4aca20;_0x52fe86[_0xa8c5('0x32')]=_[_0xa8c5('0x44')](db['SalesforceField'][_0xa8c5('0x2e')]);_0x52fe86[_0xa8c5('0x33')]=_['keys'](_0x1f3415['query']);_0x52fe86['filters']=_[_0xa8c5('0x45')](_0x52fe86[_0xa8c5('0x32')],_0x52fe86['query']);_0x5ee1f8['attributes']=_['intersection'](_0x52fe86[_0xa8c5('0x32')],qs[_0xa8c5('0x36')](_0x1f3415[_0xa8c5('0x33')]['fields']));_0x5ee1f8[_0xa8c5('0x35')]=_0x5ee1f8[_0xa8c5('0x35')][_0xa8c5('0x46')]?_0x5ee1f8['attributes']:_0x52fe86[_0xa8c5('0x32')];_0x5ee1f8[_0xa8c5('0x38')]=qs[_0xa8c5('0x39')](_0x1f3415[_0xa8c5('0x33')][_0xa8c5('0x39')]);_0x5ee1f8[_0xa8c5('0x3a')]=qs[_0xa8c5('0x34')](_[_0xa8c5('0x4d')](_0x1f3415[_0xa8c5('0x33')],_0x52fe86[_0xa8c5('0x34')]));if(_0x1f3415[_0xa8c5('0x33')]['filter']){_0x5ee1f8[_0xa8c5('0x3a')]=_[_0xa8c5('0x3c')](_0x5ee1f8[_0xa8c5('0x3a')],{'$or':_[_0xa8c5('0x2d')](_0x5ee1f8[_0xa8c5('0x35')],function(_0x552b79){var _0x5b7e43={};_0x5b7e43[_0x552b79]={'$like':'%'+_0x1f3415[_0xa8c5('0x33')]['filter']+'%'};return _0x5b7e43;})});}_0x5ee1f8=_[_0xa8c5('0x3c')]({},_0x5ee1f8,_0x1f3415[_0xa8c5('0x3e')]);return _0x305c78['getDescriptions'](_0x5ee1f8);}})['then'](function(_0x46a788){if(_0x46a788){_0x3988ce=_0x46a788['length'];if(!_0x1f3415['query'][_0xa8c5('0x4e')](_0xa8c5('0x37'))){_0x5ee1f8[_0xa8c5('0x1f')]=qs[_0xa8c5('0x1f')](_0x1f3415[_0xa8c5('0x33')]['limit']);_0x5ee1f8[_0xa8c5('0x1e')]=qs[_0xa8c5('0x1e')](_0x1f3415[_0xa8c5('0x33')][_0xa8c5('0x1e')]);}return _0x305c78[_0xa8c5('0x50')](_0x5ee1f8);}})[_0xa8c5('0x27')](function(_0x1cab87){if(_0x1cab87){return _0x1cab87?{'count':_0x3988ce,'rows':_0x1cab87}:null;}})[_0xa8c5('0x27')](respondWithResult(_0x236f7c,null))[_0xa8c5('0x41')](handleError(_0x236f7c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 5decf03..0f94b59 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 _0x56a4=['SalesforceConfiguration','int_salesforce_configurations','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x4975c5,_0x1ca463){var _0x5ebf72=function(_0x3dfd32){while(--_0x3dfd32){_0x4975c5['push'](_0x4975c5['shift']());}};_0x5ebf72(++_0x1ca463);}(_0x56a4,0x158));var _0x456a=function(_0x3eb211,_0x4a2e7f){_0x3eb211=_0x3eb211-0x0;var _0xb32a15=_0x56a4[_0x3eb211];return _0xb32a15;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x456a('0x0'));var moment=require(_0x456a('0x1'));var BPromise=require('bluebird');var rp=require(_0x456a('0x2'));var fs=require('fs');var path=require(_0x456a('0x3'));var rimraf=require(_0x456a('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x456a('0x5')]=function(_0x11a27b,_0x2919c5){return _0x11a27b[_0x456a('0x6')](_0x456a('0x7'),attributes,{'tableName':_0x456a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30b9=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x57b4ff,_0x3f3be0){var _0x28642e=function(_0x9a5198){while(--_0x9a5198){_0x57b4ff['push'](_0x57b4ff['shift']());}};_0x28642e(++_0x3f3be0);}(_0x30b9,0x1d1));var _0x930b=function(_0xb8f0df,_0xfe8051){_0xb8f0df=_0xb8f0df-0x0;var _0x565b6e=_0x30b9[_0xb8f0df];return _0x565b6e;};'use strict';var _=require(_0x930b('0x0'));var util=require(_0x930b('0x1'));var logger=require(_0x930b('0x2'))(_0x930b('0x3'));var moment=require('moment');var BPromise=require(_0x930b('0x4'));var rp=require(_0x930b('0x5'));var fs=require('fs');var path=require(_0x930b('0x6'));var rimraf=require(_0x930b('0x7'));var config=require(_0x930b('0x8'));var attributes=require(_0x930b('0x9'));module[_0x930b('0xa')]=function(_0x364cc3,_0x4b77fe){return _0x364cc3[_0x930b('0xb')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 3f3f046..5d11134 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 _0x7681=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x7681,0x15a));var _0x1768=function(_0x7da7eb,_0xa6ba2a){_0x7da7eb=_0x7da7eb-0x0;var _0x3fb06e=_0x7681[_0x7da7eb];return _0x3fb06e;};'use strict';var _=require(_0x1768('0x0'));var util=require(_0x1768('0x1'));var moment=require(_0x1768('0x2'));var BPromise=require('bluebird');var rs=require(_0x1768('0x3'));var fs=require('fs');var Redis=require(_0x1768('0x4'));var db=require(_0x1768('0x5'))['db'];var utils=require(_0x1768('0x6'));var logger=require(_0x1768('0x7'))(_0x1768('0x8'));var config=require(_0x1768('0x9'));var jayson=require(_0x1768('0xa'));var client=jayson[_0x1768('0xb')][_0x1768('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ec624,_0x736089,_0x20bf9c){return new BPromise(function(_0xfa5bc2,_0x32e1bb){return client[_0x1768('0xd')](_0x5ec624,_0x20bf9c)[_0x1768('0xe')](function(_0x87d4fa){logger['info'](_0x1768('0xf'),_0x736089,_0x1768('0x10'));logger['debug'](_0x1768('0x11'),_0x736089,_0x1768('0x10'),JSON[_0x1768('0x12')](_0x87d4fa));if(_0x87d4fa[_0x1768('0x13')]){if(_0x87d4fa[_0x1768('0x13')][_0x1768('0x14')]===0x1f4){logger['error'](_0x1768('0xf'),_0x736089,_0x87d4fa[_0x1768('0x13')]['message']);return _0x32e1bb(_0x87d4fa[_0x1768('0x13')]['message']);}logger[_0x1768('0x13')](_0x1768('0xf'),_0x736089,_0x87d4fa[_0x1768('0x13')]['message']);return _0xfa5bc2(_0x87d4fa['error'][_0x1768('0x15')]);}else{logger[_0x1768('0x16')]('SalesforceConfiguration,\x20%s,\x20%s',_0x736089,_0x1768('0x10'));_0xfa5bc2(_0x87d4fa[_0x1768('0x17')][_0x1768('0x15')]);}})[_0x1768('0x18')](function(_0x2f2360){logger[_0x1768('0x13')](_0x1768('0xf'),_0x736089,_0x2f2360);_0x32e1bb(_0x2f2360);});});} \ No newline at end of file +var _0x22b3=['info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x4656ca,_0x17ff26){var _0x2133bd=function(_0x48d480){while(--_0x48d480){_0x4656ca['push'](_0x4656ca['shift']());}};_0x2133bd(++_0x17ff26);}(_0x22b3,0x167));var _0x322b=function(_0x4bac0c,_0x1832d6){_0x4bac0c=_0x4bac0c-0x0;var _0x43e44a=_0x22b3[_0x4bac0c];return _0x43e44a;};'use strict';var _=require(_0x322b('0x0'));var util=require('util');var moment=require(_0x322b('0x1'));var BPromise=require(_0x322b('0x2'));var rs=require(_0x322b('0x3'));var fs=require('fs');var Redis=require(_0x322b('0x4'));var db=require(_0x322b('0x5'))['db'];var utils=require(_0x322b('0x6'));var logger=require('../../config/logger')(_0x322b('0x7'));var config=require(_0x322b('0x8'));var jayson=require(_0x322b('0x9'));var client=jayson['client'][_0x322b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40fcd1,_0x1f795c,_0x289e29){return new BPromise(function(_0x438498,_0x251607){return client['request'](_0x40fcd1,_0x289e29)[_0x322b('0xb')](function(_0x5f5530){logger['info'](_0x322b('0xc'),_0x1f795c,'request\x20sent');logger[_0x322b('0xd')](_0x322b('0xe'),_0x1f795c,_0x322b('0xf'),JSON[_0x322b('0x10')](_0x5f5530));if(_0x5f5530[_0x322b('0x11')]){if(_0x5f5530[_0x322b('0x11')]['code']===0x1f4){logger[_0x322b('0x11')](_0x322b('0xc'),_0x1f795c,_0x5f5530[_0x322b('0x11')][_0x322b('0x12')]);return _0x251607(_0x5f5530[_0x322b('0x11')]['message']);}logger['error'](_0x322b('0xc'),_0x1f795c,_0x5f5530[_0x322b('0x11')]['message']);return _0x438498(_0x5f5530['error'][_0x322b('0x12')]);}else{logger[_0x322b('0x13')](_0x322b('0xc'),_0x1f795c,_0x322b('0xf'));_0x438498(_0x5f5530['result'][_0x322b('0x12')]);}})[_0x322b('0x14')](function(_0x453424){logger[_0x322b('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1f795c,_0x453424);_0x251607(_0x453424);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f3d59a3..92663e7 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 _0x33e6=['util','express','../../components/auth/service','./intSalesforceField.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','multer'];(function(_0x17c64b,_0x38ae9c){var _0x5ca37f=function(_0x5c32d1){while(--_0x5c32d1){_0x17c64b['push'](_0x17c64b['shift']());}};_0x5ca37f(++_0x38ae9c);}(_0x33e6,0x1cf));var _0x633e=function(_0x328212,_0x837c7c){_0x328212=_0x328212-0x0;var _0x18d90d=_0x33e6[_0x328212];return _0x18d90d;};'use strict';var multer=require(_0x633e('0x0'));var util=require(_0x633e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x633e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x633e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x633e('0x4'));router[_0x633e('0x5')]('/',auth['isAuthenticated'](),controller[_0x633e('0x6')]);router[_0x633e('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x633e('0x7')]);router[_0x633e('0x8')]('/',auth[_0x633e('0x9')](),controller[_0x633e('0xa')]);router[_0x633e('0xb')](_0x633e('0xc'),auth[_0x633e('0x9')](),controller['update']);router[_0x633e('0xd')](_0x633e('0xc'),auth['isAuthenticated'](),controller[_0x633e('0xe')]);module[_0x633e('0xf')]=router; \ No newline at end of file +var _0x5770=['post','create','destroy','exports','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x3ff1ed,_0x5a3ba3){var _0x4d0d75=function(_0x50e7a2){while(--_0x50e7a2){_0x3ff1ed['push'](_0x3ff1ed['shift']());}};_0x4d0d75(++_0x5a3ba3);}(_0x5770,0x1b6));var _0x0577=function(_0x4e1d3c,_0x4f9988){_0x4e1d3c=_0x4e1d3c-0x0;var _0x5177b2=_0x5770[_0x4e1d3c];return _0x5177b2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0577('0x0'));var router=express[_0x0577('0x1')]();var fs_extra=require(_0x0577('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0577('0x3'));var config=require(_0x0577('0x4'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x0577('0x5')](),controller[_0x0577('0x6')]);router[_0x0577('0x7')](_0x0577('0x8'),auth[_0x0577('0x5')](),controller[_0x0577('0x9')]);router[_0x0577('0xa')]('/',auth['isAuthenticated'](),controller[_0x0577('0xb')]);router['put'](_0x0577('0x8'),auth[_0x0577('0x5')](),controller['update']);router['delete'](_0x0577('0x8'),auth[_0x0577('0x5')](),controller[_0x0577('0xc')]);module[_0x0577('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index f11b190..fcc912d 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 _0xf0c8=['string','STRING','variable','exports','ENUM','customVariable','picklist'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf0c8,0x88));var _0x8f0c=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xf0c8[_0x172ed7];return _0xfa8f61;};'use strict';var Sequelize=require('sequelize');module[_0x8f0c('0x0')]={'type':{'type':Sequelize[_0x8f0c('0x1')]('string','variable',_0x8f0c('0x2'),'keyValue',_0x8f0c('0x3')),'defaultValue':_0x8f0c('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8f0c('0x5')]},'keyType':{'type':Sequelize[_0x8f0c('0x1')](_0x8f0c('0x4'),_0x8f0c('0x6'),_0x8f0c('0x2'))},'keyContent':{'type':Sequelize[_0x8f0c('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0452=['variable','customVariable','keyValue','STRING','exports','ENUM','string'];(function(_0x50c1d1,_0x3147cd){var _0x394239=function(_0x2e0b56){while(--_0x2e0b56){_0x50c1d1['push'](_0x50c1d1['shift']());}};_0x394239(++_0x3147cd);}(_0x0452,0x138));var _0x2045=function(_0x3b22c2,_0xcafa0d){_0x3b22c2=_0x3b22c2-0x0;var _0x38daa8=_0x0452[_0x3b22c2];return _0x38daa8;};'use strict';var Sequelize=require('sequelize');module[_0x2045('0x0')]={'type':{'type':Sequelize[_0x2045('0x1')](_0x2045('0x2'),_0x2045('0x3'),_0x2045('0x4'),_0x2045('0x5'),'picklist'),'defaultValue':_0x2045('0x2')},'content':{'type':Sequelize[_0x2045('0x6')]},'key':{'type':Sequelize[_0x2045('0x6')]},'keyType':{'type':Sequelize[_0x2045('0x1')](_0x2045('0x2'),_0x2045('0x3'),_0x2045('0x4'))},'keyContent':{'type':Sequelize[_0x2045('0x6')]},'idField':{'type':Sequelize[_0x2045('0x6')]},'variableName':{'type':Sequelize[_0x2045('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a97b6ce..3756d25 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 _0xb945=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','undefined','limit','offset','count','status','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','name','map','SalesforceField','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body'];(function(_0x47b174,_0x521a9f){var _0x5cce74=function(_0x42da0e){while(--_0x42da0e){_0x47b174['push'](_0x47b174['shift']());}};_0x5cce74(++_0x521a9f);}(_0xb945,0xd6));var _0x5b94=function(_0x9a85bb,_0xc905f){_0x9a85bb=_0x9a85bb-0x0;var _0x512ab1=_0xb945[_0x9a85bb];return _0x512ab1;};'use strict';var emlformat=require(_0x5b94('0x0'));var rimraf=require(_0x5b94('0x1'));var zipdir=require(_0x5b94('0x2'));var jsonpatch=require(_0x5b94('0x3'));var rp=require(_0x5b94('0x4'));var moment=require(_0x5b94('0x5'));var BPromise=require(_0x5b94('0x6'));var Mustache=require(_0x5b94('0x7'));var util=require(_0x5b94('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b94('0x9'));var _=require(_0x5b94('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b94('0xb'));var deskjs=require(_0x5b94('0xc'));var toCsv=require(_0x5b94('0xd'));var querystring=require(_0x5b94('0xe'));var Papa=require(_0x5b94('0xf'));var Redis=require(_0x5b94('0x10'));var authService=require(_0x5b94('0x11'));var qs=require(_0x5b94('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b94('0x13'));var logger=require('../../config/logger')(_0x5b94('0x14'));var utils=require(_0x5b94('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b94('0x16'))['db'];function respondWithStatusCode(_0x285efc,_0x15de5b){_0x15de5b=_0x15de5b||0xcc;return function(_0x4bec1c){if(_0x4bec1c){return _0x285efc['sendStatus'](_0x15de5b);}return _0x285efc['status'](_0x15de5b)[_0x5b94('0x17')]();};}function respondWithResult(_0x3b0a9c,_0x32a4cb){_0x32a4cb=_0x32a4cb||0xc8;return function(_0x36a94a){if(_0x36a94a){return _0x3b0a9c['status'](_0x32a4cb)['json'](_0x36a94a);}};}function respondWithFilteredResult(_0x4c4c20,_0x298f72){return function(_0x20b0aa){if(_0x20b0aa){var _0x4898a1=typeof _0x298f72['offset']===_0x5b94('0x18')&&typeof _0x298f72[_0x5b94('0x19')]===_0x5b94('0x18');var _0x4df571=_0x20b0aa['count'];var _0xf6aa58=_0x4898a1?0x0:_0x298f72[_0x5b94('0x1a')];var _0x3a87f4=_0x4898a1?_0x20b0aa[_0x5b94('0x1b')]:_0x298f72[_0x5b94('0x1a')]+_0x298f72[_0x5b94('0x19')];var _0x4a3270;if(_0x3a87f4>=_0x4df571){_0x3a87f4=_0x4df571;_0x4a3270=0xc8;}else{_0x4a3270=0xce;}_0x4c4c20[_0x5b94('0x1c')](_0x4a3270);return _0x4c4c20[_0x5b94('0x1d')](_0x5b94('0x1e'),_0xf6aa58+'-'+_0x3a87f4+'/'+_0x4df571)[_0x5b94('0x1f')](_0x20b0aa);}return null;};}function patchUpdates(_0x4f0b78){return function(_0x4eaadc){try{jsonpatch['apply'](_0x4eaadc,_0x4f0b78,!![]);}catch(_0x23f39a){return BPromise[_0x5b94('0x20')](_0x23f39a);}return _0x4eaadc[_0x5b94('0x21')]();};}function saveUpdates(_0x366d45,_0x3fbcd0){return function(_0x2960a2){if(_0x2960a2){return _0x2960a2[_0x5b94('0x22')](_0x366d45)['then'](function(_0xda332d){return _0xda332d;});}return null;};}function removeEntity(_0x339753,_0x1874db){return function(_0x21a267){if(_0x21a267){return _0x21a267[_0x5b94('0x23')]()[_0x5b94('0x24')](function(){_0x339753[_0x5b94('0x1c')](0xcc)[_0x5b94('0x17')]();});}};}function handleEntityNotFound(_0x3f6fbe,_0x2a5ef3){return function(_0x1bb7f3){if(!_0x1bb7f3){_0x3f6fbe[_0x5b94('0x25')](0x194);}return _0x1bb7f3;};}function handleError(_0xf02b2c,_0x2dd943){_0x2dd943=_0x2dd943||0x1f4;return function(_0x3abfc4){logger['error'](_0x3abfc4['stack']);if(_0x3abfc4[_0x5b94('0x26')]){delete _0x3abfc4[_0x5b94('0x26')];}_0xf02b2c['status'](_0x2dd943)['send'](_0x3abfc4);};}exports['index']=function(_0x171c36,_0x3cea62){var _0x1e1fae={},_0x169fc6={},_0x52b8c5={'count':0x0,'rows':[]};var _0x51ee16=_[_0x5b94('0x27')](db[_0x5b94('0x28')]['rawAttributes'],function(_0x1b8f37){return{'name':_0x1b8f37[_0x5b94('0x29')],'type':_0x1b8f37[_0x5b94('0x2a')][_0x5b94('0x2b')]};});_0x169fc6['model']=_['map'](_0x51ee16,_0x5b94('0x26'));_0x169fc6[_0x5b94('0x2c')]=_[_0x5b94('0x2d')](_0x171c36['query']);_0x169fc6[_0x5b94('0x2e')]=_[_0x5b94('0x2f')](_0x169fc6[_0x5b94('0x30')],_0x169fc6[_0x5b94('0x2c')]);_0x1e1fae[_0x5b94('0x31')]=_[_0x5b94('0x2f')](_0x169fc6[_0x5b94('0x30')],qs[_0x5b94('0x32')](_0x171c36[_0x5b94('0x2c')]['fields']));_0x1e1fae['attributes']=_0x1e1fae[_0x5b94('0x31')]['length']?_0x1e1fae['attributes']:_0x169fc6[_0x5b94('0x30')];if(!_0x171c36[_0x5b94('0x2c')][_0x5b94('0x33')]('nolimit')){_0x1e1fae['limit']=qs[_0x5b94('0x19')](_0x171c36[_0x5b94('0x2c')][_0x5b94('0x19')]);_0x1e1fae['offset']=qs[_0x5b94('0x1a')](_0x171c36[_0x5b94('0x2c')][_0x5b94('0x1a')]);}_0x1e1fae[_0x5b94('0x34')]=qs[_0x5b94('0x35')](_0x171c36[_0x5b94('0x2c')][_0x5b94('0x35')]);_0x1e1fae['where']=qs[_0x5b94('0x2e')](_['pick'](_0x171c36[_0x5b94('0x2c')],_0x169fc6['filters']),_0x51ee16);if(_0x171c36[_0x5b94('0x2c')][_0x5b94('0x36')]){_0x1e1fae[_0x5b94('0x37')]=_[_0x5b94('0x38')](_0x1e1fae[_0x5b94('0x37')],{'$or':_[_0x5b94('0x27')](_0x51ee16,function(_0x4faa93){if(_0x4faa93[_0x5b94('0x2a')]!==_0x5b94('0x39')){var _0x5bd36d={};_0x5bd36d[_0x4faa93[_0x5b94('0x26')]]={'$like':'%'+_0x171c36[_0x5b94('0x2c')][_0x5b94('0x36')]+'%'};return _0x5bd36d;}})});}_0x1e1fae=_[_0x5b94('0x38')]({},_0x1e1fae,_0x171c36[_0x5b94('0x3a')]);var _0x5f412f={'where':_0x1e1fae[_0x5b94('0x37')]};return db['SalesforceField'][_0x5b94('0x1b')](_0x5f412f)[_0x5b94('0x24')](function(_0xb21b01){_0x52b8c5['count']=_0xb21b01;if(_0x171c36[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0x1e1fae[_0x5b94('0x3c')]=[{'all':!![]}];}return db['SalesforceField'][_0x5b94('0x3d')](_0x1e1fae);})[_0x5b94('0x24')](function(_0x16a157){_0x52b8c5[_0x5b94('0x3e')]=_0x16a157;return _0x52b8c5;})[_0x5b94('0x24')](respondWithFilteredResult(_0x3cea62,_0x1e1fae))[_0x5b94('0x3f')](handleError(_0x3cea62,null));};exports[_0x5b94('0x40')]=function(_0x4766df,_0x34f12f){var _0x1f8866={'raw':!![],'where':{'id':_0x4766df['params']['id']}},_0x35723a={};_0x35723a[_0x5b94('0x30')]=_[_0x5b94('0x2d')](db['SalesforceField'][_0x5b94('0x41')]);_0x35723a[_0x5b94('0x2c')]=_[_0x5b94('0x2d')](_0x4766df['query']);_0x35723a['filters']=_[_0x5b94('0x2f')](_0x35723a['model'],_0x35723a['query']);_0x1f8866['attributes']=_[_0x5b94('0x2f')](_0x35723a[_0x5b94('0x30')],qs[_0x5b94('0x32')](_0x4766df[_0x5b94('0x2c')]['fields']));_0x1f8866['attributes']=_0x1f8866['attributes'][_0x5b94('0x42')]?_0x1f8866['attributes']:_0x35723a[_0x5b94('0x30')];if(_0x4766df[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0x1f8866[_0x5b94('0x3c')]=[{'all':!![]}];}_0x1f8866=_[_0x5b94('0x38')]({},_0x1f8866,_0x4766df[_0x5b94('0x3a')]);return db[_0x5b94('0x28')][_0x5b94('0x43')](_0x1f8866)['then'](handleEntityNotFound(_0x34f12f,null))[_0x5b94('0x24')](respondWithResult(_0x34f12f,null))['catch'](handleError(_0x34f12f,null));};exports[_0x5b94('0x44')]=function(_0x219507,_0x1122ae){return db['SalesforceField'][_0x5b94('0x44')](_0x219507[_0x5b94('0x45')],{})[_0x5b94('0x24')](respondWithResult(_0x1122ae,0xc9))[_0x5b94('0x3f')](handleError(_0x1122ae,null));};exports[_0x5b94('0x22')]=function(_0x2737f4,_0x599fbd){if(_0x2737f4[_0x5b94('0x45')]['id']){delete _0x2737f4[_0x5b94('0x45')]['id'];}return db['SalesforceField'][_0x5b94('0x43')]({'where':{'id':_0x2737f4[_0x5b94('0x46')]['id']}})['then'](handleEntityNotFound(_0x599fbd,null))[_0x5b94('0x24')](saveUpdates(_0x2737f4[_0x5b94('0x45')],null))[_0x5b94('0x24')](respondWithResult(_0x599fbd,null))['catch'](handleError(_0x599fbd,null));};exports[_0x5b94('0x23')]=function(_0x17c3ba,_0x37d4eb){return db[_0x5b94('0x28')][_0x5b94('0x43')]({'where':{'id':_0x17c3ba[_0x5b94('0x46')]['id']}})['then'](handleEntityNotFound(_0x37d4eb,null))[_0x5b94('0x24')](removeEntity(_0x37d4eb,null))[_0x5b94('0x3f')](handleError(_0x37d4eb,null));}; \ No newline at end of file +var _0xaac0=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','SalesforceField','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','params','keys','rawAttributes','options','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaac0,0x1f4));var _0x0aac=function(_0x21d251,_0x8e5f70){_0x21d251=_0x21d251-0x0;var _0x4a0ee2=_0xaac0[_0x21d251];return _0x4a0ee2;};'use strict';var emlformat=require(_0x0aac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0aac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0aac('0x2'));var moment=require(_0x0aac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0aac('0x4'));var util=require(_0x0aac('0x5'));var path=require('path');var sox=require(_0x0aac('0x6'));var csv=require(_0x0aac('0x7'));var ejs=require(_0x0aac('0x8'));var fs=require('fs');var fs_extra=require(_0x0aac('0x9'));var _=require(_0x0aac('0xa'));var squel=require(_0x0aac('0xb'));var crypto=require('crypto');var jsforce=require(_0x0aac('0xc'));var deskjs=require(_0x0aac('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0aac('0xe'));var Papa=require(_0x0aac('0xf'));var Redis=require(_0x0aac('0x10'));var authService=require(_0x0aac('0x11'));var qs=require(_0x0aac('0x12'));var as=require(_0x0aac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0aac('0x14'));var utils=require(_0x0aac('0x15'));var config=require(_0x0aac('0x16'));var licenseUtil=require(_0x0aac('0x17'));var db=require(_0x0aac('0x18'))['db'];function respondWithStatusCode(_0xe7c0b,_0x3ebca6){_0x3ebca6=_0x3ebca6||0xcc;return function(_0x44be79){if(_0x44be79){return _0xe7c0b[_0x0aac('0x19')](_0x3ebca6);}return _0xe7c0b[_0x0aac('0x1a')](_0x3ebca6)[_0x0aac('0x1b')]();};}function respondWithResult(_0x2dd53c,_0x5f3983){_0x5f3983=_0x5f3983||0xc8;return function(_0x5667af){if(_0x5667af){return _0x2dd53c[_0x0aac('0x1a')](_0x5f3983)['json'](_0x5667af);}};}function respondWithFilteredResult(_0x313e97,_0x17ef4a){return function(_0x214dfe){if(_0x214dfe){var _0x30df8e=typeof _0x17ef4a[_0x0aac('0x1c')]==='undefined'&&typeof _0x17ef4a['limit']===_0x0aac('0x1d');var _0x43a6e1=_0x214dfe['count'];var _0x286ff3=_0x30df8e?0x0:_0x17ef4a[_0x0aac('0x1c')];var _0x390f67=_0x30df8e?_0x214dfe[_0x0aac('0x1e')]:_0x17ef4a['offset']+_0x17ef4a[_0x0aac('0x1f')];var _0x40d7bf;if(_0x390f67>=_0x43a6e1){_0x390f67=_0x43a6e1;_0x40d7bf=0xc8;}else{_0x40d7bf=0xce;}_0x313e97[_0x0aac('0x1a')](_0x40d7bf);return _0x313e97[_0x0aac('0x20')](_0x0aac('0x21'),_0x286ff3+'-'+_0x390f67+'/'+_0x43a6e1)[_0x0aac('0x22')](_0x214dfe);}return null;};}function patchUpdates(_0x270235){return function(_0x1baf54){try{jsonpatch[_0x0aac('0x23')](_0x1baf54,_0x270235,!![]);}catch(_0x56e14d){return BPromise['reject'](_0x56e14d);}return _0x1baf54[_0x0aac('0x24')]();};}function saveUpdates(_0x437afe,_0x1bd82e){return function(_0x31d0fa){if(_0x31d0fa){return _0x31d0fa[_0x0aac('0x25')](_0x437afe)['then'](function(_0x5ead6d){return _0x5ead6d;});}return null;};}function removeEntity(_0x513f5d,_0x37e3ad){return function(_0x1039ae){if(_0x1039ae){return _0x1039ae['destroy']()[_0x0aac('0x26')](function(){_0x513f5d[_0x0aac('0x1a')](0xcc)[_0x0aac('0x1b')]();});}};}function handleEntityNotFound(_0xc39c60,_0x438fb9){return function(_0x2c815c){if(!_0x2c815c){_0xc39c60[_0x0aac('0x19')](0x194);}return _0x2c815c;};}function handleError(_0x16c2b4,_0x5ee9a9){_0x5ee9a9=_0x5ee9a9||0x1f4;return function(_0x2ff794){logger[_0x0aac('0x27')](_0x2ff794[_0x0aac('0x28')]);if(_0x2ff794[_0x0aac('0x29')]){delete _0x2ff794[_0x0aac('0x29')];}_0x16c2b4[_0x0aac('0x1a')](_0x5ee9a9)[_0x0aac('0x2a')](_0x2ff794);};}exports[_0x0aac('0x2b')]=function(_0x157866,_0x570e58){var _0x503468={},_0x5bb018={},_0x477943={'count':0x0,'rows':[]};var _0x565854=_['map'](db[_0x0aac('0x2c')]['rawAttributes'],function(_0x197d1c){return{'name':_0x197d1c[_0x0aac('0x2d')],'type':_0x197d1c[_0x0aac('0x2e')]['key']};});_0x5bb018[_0x0aac('0x2f')]=_[_0x0aac('0x30')](_0x565854,'name');_0x5bb018[_0x0aac('0x31')]=_['keys'](_0x157866['query']);_0x5bb018[_0x0aac('0x32')]=_[_0x0aac('0x33')](_0x5bb018[_0x0aac('0x2f')],_0x5bb018[_0x0aac('0x31')]);_0x503468[_0x0aac('0x34')]=_[_0x0aac('0x33')](_0x5bb018[_0x0aac('0x2f')],qs[_0x0aac('0x35')](_0x157866[_0x0aac('0x31')][_0x0aac('0x35')]));_0x503468[_0x0aac('0x34')]=_0x503468[_0x0aac('0x34')][_0x0aac('0x36')]?_0x503468[_0x0aac('0x34')]:_0x5bb018[_0x0aac('0x2f')];if(!_0x157866[_0x0aac('0x31')][_0x0aac('0x37')]('nolimit')){_0x503468['limit']=qs[_0x0aac('0x1f')](_0x157866[_0x0aac('0x31')][_0x0aac('0x1f')]);_0x503468['offset']=qs[_0x0aac('0x1c')](_0x157866['query']['offset']);}_0x503468[_0x0aac('0x38')]=qs[_0x0aac('0x39')](_0x157866[_0x0aac('0x31')][_0x0aac('0x39')]);_0x503468['where']=qs[_0x0aac('0x32')](_['pick'](_0x157866[_0x0aac('0x31')],_0x5bb018[_0x0aac('0x32')]),_0x565854);if(_0x157866[_0x0aac('0x31')]['filter']){_0x503468[_0x0aac('0x3a')]=_[_0x0aac('0x3b')](_0x503468[_0x0aac('0x3a')],{'$or':_['map'](_0x565854,function(_0x12e0fa){if(_0x12e0fa['type']!==_0x0aac('0x3c')){var _0x24ed70={};_0x24ed70[_0x12e0fa[_0x0aac('0x29')]]={'$like':'%'+_0x157866[_0x0aac('0x31')][_0x0aac('0x3d')]+'%'};return _0x24ed70;}})});}_0x503468=_[_0x0aac('0x3b')]({},_0x503468,_0x157866['options']);var _0x11fc6e={'where':_0x503468[_0x0aac('0x3a')]};return db[_0x0aac('0x2c')][_0x0aac('0x1e')](_0x11fc6e)[_0x0aac('0x26')](function(_0x5b9055){_0x477943[_0x0aac('0x1e')]=_0x5b9055;if(_0x157866[_0x0aac('0x31')][_0x0aac('0x3e')]){_0x503468[_0x0aac('0x3f')]=[{'all':!![]}];}return db[_0x0aac('0x2c')]['findAll'](_0x503468);})[_0x0aac('0x26')](function(_0x50debf){_0x477943[_0x0aac('0x40')]=_0x50debf;return _0x477943;})[_0x0aac('0x26')](respondWithFilteredResult(_0x570e58,_0x503468))[_0x0aac('0x41')](handleError(_0x570e58,null));};exports['show']=function(_0x1c3cf2,_0x42c982){var _0x23dafc={'raw':!![],'where':{'id':_0x1c3cf2[_0x0aac('0x42')]['id']}},_0x14c712={};_0x14c712[_0x0aac('0x2f')]=_[_0x0aac('0x43')](db['SalesforceField'][_0x0aac('0x44')]);_0x14c712[_0x0aac('0x31')]=_[_0x0aac('0x43')](_0x1c3cf2['query']);_0x14c712[_0x0aac('0x32')]=_[_0x0aac('0x33')](_0x14c712[_0x0aac('0x2f')],_0x14c712[_0x0aac('0x31')]);_0x23dafc[_0x0aac('0x34')]=_[_0x0aac('0x33')](_0x14c712[_0x0aac('0x2f')],qs['fields'](_0x1c3cf2[_0x0aac('0x31')][_0x0aac('0x35')]));_0x23dafc[_0x0aac('0x34')]=_0x23dafc[_0x0aac('0x34')][_0x0aac('0x36')]?_0x23dafc[_0x0aac('0x34')]:_0x14c712[_0x0aac('0x2f')];if(_0x1c3cf2[_0x0aac('0x31')][_0x0aac('0x3e')]){_0x23dafc[_0x0aac('0x3f')]=[{'all':!![]}];}_0x23dafc=_[_0x0aac('0x3b')]({},_0x23dafc,_0x1c3cf2[_0x0aac('0x45')]);return db[_0x0aac('0x2c')][_0x0aac('0x46')](_0x23dafc)[_0x0aac('0x26')](handleEntityNotFound(_0x42c982,null))[_0x0aac('0x26')](respondWithResult(_0x42c982,null))[_0x0aac('0x41')](handleError(_0x42c982,null));};exports[_0x0aac('0x47')]=function(_0x2f6465,_0x559e30){return db[_0x0aac('0x2c')][_0x0aac('0x47')](_0x2f6465[_0x0aac('0x48')],{})[_0x0aac('0x26')](respondWithResult(_0x559e30,0xc9))[_0x0aac('0x41')](handleError(_0x559e30,null));};exports[_0x0aac('0x25')]=function(_0x55ec48,_0x358fb6){if(_0x55ec48[_0x0aac('0x48')]['id']){delete _0x55ec48[_0x0aac('0x48')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x55ec48[_0x0aac('0x42')]['id']}})[_0x0aac('0x26')](handleEntityNotFound(_0x358fb6,null))[_0x0aac('0x26')](saveUpdates(_0x55ec48['body'],null))[_0x0aac('0x26')](respondWithResult(_0x358fb6,null))[_0x0aac('0x41')](handleError(_0x358fb6,null));};exports[_0x0aac('0x49')]=function(_0x5f246a,_0x103d75){return db[_0x0aac('0x2c')][_0x0aac('0x46')]({'where':{'id':_0x5f246a['params']['id']}})[_0x0aac('0x26')](handleEntityNotFound(_0x103d75,null))[_0x0aac('0x26')](removeEntity(_0x103d75,null))[_0x0aac('0x41')](handleError(_0x103d75,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2527b32..5ab9871 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 _0x4788=['./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','../../config/environment'];(function(_0x1cbc3a,_0xdec7fa){var _0x113b3b=function(_0x112822){while(--_0x112822){_0x1cbc3a['push'](_0x1cbc3a['shift']());}};_0x113b3b(++_0xdec7fa);}(_0x4788,0xa2));var _0x8478=function(_0x58b646,_0x1d6f74){_0x58b646=_0x58b646-0x0;var _0x2c7d90=_0x4788[_0x58b646];return _0x2c7d90;};'use strict';var _=require(_0x8478('0x0'));var util=require(_0x8478('0x1'));var logger=require(_0x8478('0x2'))(_0x8478('0x3'));var moment=require('moment');var BPromise=require(_0x8478('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8478('0x5'));var attributes=require(_0x8478('0x6'));module['exports']=function(_0x3411de,_0x3da44d){return _0x3411de['define'](_0x8478('0x7'),attributes,{'tableName':_0x8478('0x8'),'paranoid':![],'indexes':[{'name':_0x8478('0x9'),'fields':[_0x8478('0xa'),_0x8478('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4daf=['moment','bluebird','request-promise','../../config/environment','exports','define','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x3577e6,_0x2f1e80){var _0x174de7=function(_0x22a197){while(--_0x22a197){_0x3577e6['push'](_0x3577e6['shift']());}};_0x174de7(++_0x2f1e80);}(_0x4daf,0x1a9));var _0xf4da=function(_0x28ec33,_0x4111d5){_0x28ec33=_0x28ec33-0x0;var _0x2c1809=_0x4daf[_0x28ec33];return _0x2c1809;};'use strict';var _=require(_0xf4da('0x0'));var util=require(_0xf4da('0x1'));var logger=require(_0xf4da('0x2'))(_0xf4da('0x3'));var moment=require(_0xf4da('0x4'));var BPromise=require(_0xf4da('0x5'));var rp=require(_0xf4da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf4da('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0xf4da('0x8')]=function(_0x3cbe7c,_0x1f93e5){return _0x3cbe7c[_0xf4da('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xf4da('0xa'),'fields':[_0xf4da('0xb'),_0xf4da('0xc')],'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 e47fc0e..73de5a7 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 _0x8869=['request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x1ed58f,_0x136fea){var _0x4730f7=function(_0x55502c){while(--_0x55502c){_0x1ed58f['push'](_0x1ed58f['shift']());}};_0x4730f7(++_0x136fea);}(_0x8869,0x9d));var _0x9886=function(_0x4f1ac3,_0x102349){_0x4f1ac3=_0x4f1ac3-0x0;var _0x419730=_0x8869[_0x4f1ac3];return _0x419730;};'use strict';var _=require(_0x9886('0x0'));var util=require(_0x9886('0x1'));var moment=require(_0x9886('0x2'));var BPromise=require(_0x9886('0x3'));var rs=require(_0x9886('0x4'));var fs=require('fs');var Redis=require(_0x9886('0x5'));var db=require(_0x9886('0x6'))['db'];var utils=require(_0x9886('0x7'));var logger=require('../../config/logger')(_0x9886('0x8'));var config=require(_0x9886('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9886('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11617b,_0x35415c,_0x2eeec8){return new BPromise(function(_0x3d7de4,_0x414d48){return client[_0x9886('0xb')](_0x11617b,_0x2eeec8)[_0x9886('0xc')](function(_0x1fa50c){logger[_0x9886('0xd')](_0x9886('0xe'),_0x35415c,_0x9886('0xf'));logger[_0x9886('0x10')](_0x9886('0x11'),_0x35415c,_0x9886('0xf'),JSON[_0x9886('0x12')](_0x1fa50c));if(_0x1fa50c[_0x9886('0x13')]){if(_0x1fa50c['error'][_0x9886('0x14')]===0x1f4){logger['error'](_0x9886('0xe'),_0x35415c,_0x1fa50c[_0x9886('0x13')]['message']);return _0x414d48(_0x1fa50c[_0x9886('0x13')][_0x9886('0x15')]);}logger[_0x9886('0x13')]('SalesforceField,\x20%s,\x20%s',_0x35415c,_0x1fa50c[_0x9886('0x13')][_0x9886('0x15')]);return _0x3d7de4(_0x1fa50c[_0x9886('0x13')][_0x9886('0x15')]);}else{logger[_0x9886('0xd')](_0x9886('0xe'),_0x35415c,_0x9886('0xf'));_0x3d7de4(_0x1fa50c[_0x9886('0x16')][_0x9886('0x15')]);}})[_0x9886('0x17')](function(_0x10ce2b){logger['error'](_0x9886('0xe'),_0x35415c,_0x10ce2b);_0x414d48(_0x10ce2b);});});} \ No newline at end of file +var _0x2b8a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1abb7f,_0x324da4){var _0x1364c0=function(_0x53d046){while(--_0x53d046){_0x1abb7f['push'](_0x1abb7f['shift']());}};_0x1364c0(++_0x324da4);}(_0x2b8a,0x1f2));var _0xa2b8=function(_0x520708,_0x2e8ed5){_0x520708=_0x520708-0x0;var _0x37ec71=_0x2b8a[_0x520708];return _0x37ec71;};'use strict';var _=require(_0xa2b8('0x0'));var util=require(_0xa2b8('0x1'));var moment=require(_0xa2b8('0x2'));var BPromise=require(_0xa2b8('0x3'));var rs=require(_0xa2b8('0x4'));var fs=require('fs');var Redis=require(_0xa2b8('0x5'));var db=require(_0xa2b8('0x6'))['db'];var utils=require(_0xa2b8('0x7'));var logger=require(_0xa2b8('0x8'))(_0xa2b8('0x9'));var config=require(_0xa2b8('0xa'));var jayson=require(_0xa2b8('0xb'));var client=jayson[_0xa2b8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad54a,_0x4d8298,_0x53f06d){return new BPromise(function(_0x4ccad7,_0x4d8a5d){return client[_0xa2b8('0xd')](_0x1ad54a,_0x53f06d)[_0xa2b8('0xe')](function(_0x386428){logger[_0xa2b8('0xf')]('SalesforceField,\x20%s,\x20%s',_0x4d8298,_0xa2b8('0x10'));logger['debug'](_0xa2b8('0x11'),_0x4d8298,'request\x20sent',JSON['stringify'](_0x386428));if(_0x386428[_0xa2b8('0x12')]){if(_0x386428[_0xa2b8('0x12')][_0xa2b8('0x13')]===0x1f4){logger[_0xa2b8('0x12')](_0xa2b8('0x14'),_0x4d8298,_0x386428[_0xa2b8('0x12')]['message']);return _0x4d8a5d(_0x386428['error'][_0xa2b8('0x15')]);}logger[_0xa2b8('0x12')](_0xa2b8('0x14'),_0x4d8298,_0x386428[_0xa2b8('0x12')][_0xa2b8('0x15')]);return _0x4ccad7(_0x386428[_0xa2b8('0x12')]['message']);}else{logger[_0xa2b8('0xf')](_0xa2b8('0x14'),_0x4d8298,_0xa2b8('0x10'));_0x4ccad7(_0x386428[_0xa2b8('0x16')][_0xa2b8('0x15')]);}})['catch'](function(_0x4fd9f9){logger[_0xa2b8('0x12')]('SalesforceField,\x20%s,\x20%s',_0x4d8298,_0x4fd9f9);_0x4d8a5d(_0x4fd9f9);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8d4a49c..7abaae9 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 _0xb545=['/:id/fields','getFields','create','post','addConfiguration','put','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x52adc8,_0x4528ba){var _0x278c8c=function(_0x3fc2d3){while(--_0x3fc2d3){_0x52adc8['push'](_0x52adc8['shift']());}};_0x278c8c(++_0x4528ba);}(_0xb545,0xcf));var _0x5b54=function(_0x3f821b,_0x4296a7){_0x3f821b=_0x3f821b-0x0;var _0x56f5ce=_0xb545[_0x3f821b];return _0x56f5ce;};'use strict';var multer=require('multer');var util=require(_0x5b54('0x0'));var path=require('path');var timeout=require(_0x5b54('0x1'));var express=require(_0x5b54('0x2'));var router=express[_0x5b54('0x3')]();var fs_extra=require(_0x5b54('0x4'));var auth=require(_0x5b54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b54('0x6'));var controller=require(_0x5b54('0x7'));router[_0x5b54('0x8')]('/',auth[_0x5b54('0x9')](),controller['index']);router['get'](_0x5b54('0xa'),auth[_0x5b54('0x9')](),controller[_0x5b54('0xb')]);router[_0x5b54('0x8')](_0x5b54('0xc'),auth[_0x5b54('0x9')](),controller['getConfigurations']);router[_0x5b54('0x8')](_0x5b54('0xd'),auth['isAuthenticated'](),controller[_0x5b54('0xe')]);router['post']('/',auth[_0x5b54('0x9')](),controller[_0x5b54('0xf')]);router[_0x5b54('0x10')](_0x5b54('0xc'),auth[_0x5b54('0x9')](),controller[_0x5b54('0x11')]);router[_0x5b54('0x12')](_0x5b54('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5b54('0xa'),auth[_0x5b54('0x9')](),controller[_0x5b54('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4bfb=['isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x4bfb,0x199));var _0xb4bf=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x4bfb[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require('multer');var util=require(_0xb4bf('0x0'));var path=require(_0xb4bf('0x1'));var timeout=require(_0xb4bf('0x2'));var express=require(_0xb4bf('0x3'));var router=express[_0xb4bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb4bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb4bf('0x6'));var controller=require(_0xb4bf('0x7'));router[_0xb4bf('0x8')]('/',auth[_0xb4bf('0x9')](),controller[_0xb4bf('0xa')]);router[_0xb4bf('0x8')]('/:id',auth[_0xb4bf('0x9')](),controller['show']);router['get'](_0xb4bf('0xb'),auth[_0xb4bf('0x9')](),controller[_0xb4bf('0xc')]);router['get'](_0xb4bf('0xd'),auth[_0xb4bf('0x9')](),controller[_0xb4bf('0xe')]);router[_0xb4bf('0xf')]('/',auth[_0xb4bf('0x9')](),controller[_0xb4bf('0x10')]);router[_0xb4bf('0xf')](_0xb4bf('0xb'),auth[_0xb4bf('0x9')](),controller[_0xb4bf('0x11')]);router[_0xb4bf('0x12')]('/:id',auth[_0xb4bf('0x9')](),controller[_0xb4bf('0x13')]);router[_0xb4bf('0x14')]('/:id',auth[_0xb4bf('0x9')](),controller['destroy']);module[_0xb4bf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 33f2c73..5535b32 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 _0x1278=['username','remoteUri','sequelize','exports','STRING'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x1278,0x165));var _0x8127=function(_0x4c4a8b,_0x402020){_0x4c4a8b=_0x4c4a8b-0x0;var _0x20fa14=_0x1278[_0x4c4a8b];return _0x20fa14;};'use strict';var Sequelize=require(_0x8127('0x0'));module[_0x8127('0x1')]={'name':{'type':Sequelize[_0x8127('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8127('0x2')],'unique':_0x8127('0x3')},'password':{'type':Sequelize[_0x8127('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8127('0x4')},'serverUrl':{'type':Sequelize[_0x8127('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x75e2=['username','sequelize','STRING'];(function(_0x77c575,_0x453583){var _0x47aa8c=function(_0x100f8e){while(--_0x100f8e){_0x77c575['push'](_0x77c575['shift']());}};_0x47aa8c(++_0x453583);}(_0x75e2,0xd0));var _0x275e=function(_0x155bbf,_0x1bca34){_0x155bbf=_0x155bbf-0x0;var _0x1cb0ac=_0x75e2[_0x155bbf];return _0x1cb0ac;};'use strict';var Sequelize=require(_0x275e('0x0'));module['exports']={'name':{'type':Sequelize[_0x275e('0x1')]},'description':{'type':Sequelize[_0x275e('0x1')]},'username':{'type':Sequelize[_0x275e('0x1')],'unique':_0x275e('0x2')},'password':{'type':Sequelize[_0x275e('0x1')]},'email':{'type':Sequelize[_0x275e('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x275e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index bd4bb61..1b1398b 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 _0xcf65=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','made_sla','caused_by','upon_reject','sys_updated_on','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','impact','active','business_service','priority','rfc','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','email','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','desk.js','papaparse'];(function(_0x24d138,_0x2b1203){var _0x151c7a=function(_0x54a8f6){while(--_0x54a8f6){_0x24d138['push'](_0x24d138['shift']());}};_0x151c7a(++_0x2b1203);}(_0xcf65,0xa6));var _0x5cf6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcf65[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x5cf6('0x0'));var rimraf=require(_0x5cf6('0x1'));var zipdir=require(_0x5cf6('0x2'));var jsonpatch=require(_0x5cf6('0x3'));var rp=require(_0x5cf6('0x4'));var moment=require(_0x5cf6('0x5'));var BPromise=require(_0x5cf6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5cf6('0x7'));var sox=require(_0x5cf6('0x8'));var csv=require(_0x5cf6('0x9'));var ejs=require(_0x5cf6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5cf6('0xb'));var toCsv=require(_0x5cf6('0x9'));var querystring=require('querystring');var Papa=require(_0x5cf6('0xc'));var Redis=require(_0x5cf6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5cf6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cf6('0xf'));var logger=require(_0x5cf6('0x10'))(_0x5cf6('0x11'));var utils=require(_0x5cf6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5cf6('0x13'));var db=require(_0x5cf6('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x143060,_0x2ac459){_0x2ac459=_0x2ac459||0xcc;return function(_0x347483){if(_0x347483){return _0x143060[_0x5cf6('0x15')](_0x2ac459);}return _0x143060[_0x5cf6('0x16')](_0x2ac459)[_0x5cf6('0x17')]();};}function respondWithResult(_0x3e7375,_0x133eac){_0x133eac=_0x133eac||0xc8;return function(_0x5da779){if(_0x5da779){return _0x3e7375[_0x5cf6('0x16')](_0x133eac)[_0x5cf6('0x18')](_0x5da779);}};}function respondWithFilteredResult(_0x40bd33,_0x438022){return function(_0x594e9b){if(_0x594e9b){var _0x4d1d9f=typeof _0x438022[_0x5cf6('0x19')]===_0x5cf6('0x1a')&&typeof _0x438022[_0x5cf6('0x1b')]==='undefined';var _0x974158=_0x594e9b[_0x5cf6('0x1c')];var _0x550b12=_0x4d1d9f?0x0:_0x438022[_0x5cf6('0x19')];var _0x45848d=_0x4d1d9f?_0x594e9b[_0x5cf6('0x1c')]:_0x438022[_0x5cf6('0x19')]+_0x438022[_0x5cf6('0x1b')];var _0x1f6dbc;if(_0x45848d>=_0x974158){_0x45848d=_0x974158;_0x1f6dbc=0xc8;}else{_0x1f6dbc=0xce;}_0x40bd33[_0x5cf6('0x16')](_0x1f6dbc);return _0x40bd33[_0x5cf6('0x1d')](_0x5cf6('0x1e'),_0x550b12+'-'+_0x45848d+'/'+_0x974158)[_0x5cf6('0x18')](_0x594e9b);}return null;};}function patchUpdates(_0x594fb3){return function(_0x10c8e8){try{jsonpatch['apply'](_0x10c8e8,_0x594fb3,!![]);}catch(_0x18d52a){return BPromise['reject'](_0x18d52a);}return _0x10c8e8['save']();};}function saveUpdates(_0x128ab3,_0x12a78c){return function(_0x3d3dc5){if(_0x3d3dc5){return _0x3d3dc5[_0x5cf6('0x1f')](_0x128ab3)[_0x5cf6('0x20')](function(_0x5d63b6){return _0x5d63b6;});}return null;};}function removeEntity(_0x1925f5,_0x9e18ac){return function(_0x2a6ed5){if(_0x2a6ed5){return _0x2a6ed5[_0x5cf6('0x21')]()[_0x5cf6('0x20')](function(){_0x1925f5[_0x5cf6('0x16')](0xcc)[_0x5cf6('0x17')]();});}};}function handleEntityNotFound(_0x2164b2,_0x2d4e87){return function(_0x56dc5f){if(!_0x56dc5f){_0x2164b2[_0x5cf6('0x15')](0x194);}return _0x56dc5f;};}function handleError(_0x5f14f5,_0xae0b93){_0xae0b93=_0xae0b93||0x1f4;return function(_0x3471d2){logger['error'](_0x3471d2[_0x5cf6('0x22')]);if(_0x3471d2[_0x5cf6('0x23')]){delete _0x3471d2[_0x5cf6('0x23')];}_0x5f14f5[_0x5cf6('0x16')](_0xae0b93)[_0x5cf6('0x24')](_0x3471d2);};}exports[_0x5cf6('0x25')]=function(_0x161dac,_0x1255f5){var _0x5c2ba3={},_0x2a5336={},_0x4891f4={'count':0x0,'rows':[]};var _0x266c4d=_['map'](db[_0x5cf6('0x26')][_0x5cf6('0x27')],function(_0x32b0af){return{'name':_0x32b0af[_0x5cf6('0x28')],'type':_0x32b0af[_0x5cf6('0x29')][_0x5cf6('0x2a')]};});_0x2a5336[_0x5cf6('0x2b')]=_[_0x5cf6('0x2c')](_0x266c4d,'name');_0x2a5336[_0x5cf6('0x2d')]=_[_0x5cf6('0x2e')](_0x161dac[_0x5cf6('0x2d')]);_0x2a5336['filters']=_['intersection'](_0x2a5336[_0x5cf6('0x2b')],_0x2a5336['query']);_0x5c2ba3[_0x5cf6('0x2f')]=_[_0x5cf6('0x30')](_0x2a5336[_0x5cf6('0x2b')],qs[_0x5cf6('0x31')](_0x161dac[_0x5cf6('0x2d')]['fields']));_0x5c2ba3[_0x5cf6('0x2f')]=_0x5c2ba3[_0x5cf6('0x2f')][_0x5cf6('0x32')]?_0x5c2ba3[_0x5cf6('0x2f')]:_0x2a5336[_0x5cf6('0x2b')];if(!_0x161dac['query'][_0x5cf6('0x33')](_0x5cf6('0x34'))){_0x5c2ba3[_0x5cf6('0x1b')]=qs[_0x5cf6('0x1b')](_0x161dac[_0x5cf6('0x2d')]['limit']);_0x5c2ba3[_0x5cf6('0x19')]=qs[_0x5cf6('0x19')](_0x161dac[_0x5cf6('0x2d')]['offset']);}_0x5c2ba3[_0x5cf6('0x35')]=qs[_0x5cf6('0x36')](_0x161dac[_0x5cf6('0x2d')][_0x5cf6('0x36')]);_0x5c2ba3[_0x5cf6('0x37')]=qs[_0x5cf6('0x38')](_[_0x5cf6('0x39')](_0x161dac[_0x5cf6('0x2d')],_0x2a5336[_0x5cf6('0x38')]),_0x266c4d);if(_0x161dac[_0x5cf6('0x2d')]['filter']){_0x5c2ba3[_0x5cf6('0x37')]=_['merge'](_0x5c2ba3[_0x5cf6('0x37')],{'$or':_['map'](_0x266c4d,function(_0x1aeae9){if(_0x1aeae9[_0x5cf6('0x29')]!==_0x5cf6('0x3a')){var _0x147487={};_0x147487[_0x1aeae9['name']]={'$like':'%'+_0x161dac[_0x5cf6('0x2d')][_0x5cf6('0x3b')]+'%'};return _0x147487;}})});}_0x5c2ba3=_[_0x5cf6('0x3c')]({},_0x5c2ba3,_0x161dac[_0x5cf6('0x3d')]);var _0x1dcb47={'where':_0x5c2ba3[_0x5cf6('0x37')]};return db[_0x5cf6('0x26')][_0x5cf6('0x1c')](_0x1dcb47)[_0x5cf6('0x20')](function(_0x4a8f9e){_0x4891f4[_0x5cf6('0x1c')]=_0x4a8f9e;if(_0x161dac[_0x5cf6('0x2d')][_0x5cf6('0x3e')]){_0x5c2ba3['include']=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x5c2ba3);})[_0x5cf6('0x20')](function(_0x1c3013){_0x4891f4[_0x5cf6('0x3f')]=_0x1c3013;return _0x4891f4;})['then'](respondWithFilteredResult(_0x1255f5,_0x5c2ba3))[_0x5cf6('0x40')](handleError(_0x1255f5,null));};exports[_0x5cf6('0x41')]=function(_0x228032,_0x269006){var _0x8a3b4a={'raw':![],'where':{'id':_0x228032[_0x5cf6('0x42')]['id']}},_0x35eb9a={};_0x35eb9a['model']=_[_0x5cf6('0x2e')](db[_0x5cf6('0x26')][_0x5cf6('0x27')]);_0x35eb9a[_0x5cf6('0x2d')]=_[_0x5cf6('0x2e')](_0x228032['query']);_0x35eb9a[_0x5cf6('0x38')]=_['intersection'](_0x35eb9a['model'],_0x35eb9a[_0x5cf6('0x2d')]);_0x8a3b4a[_0x5cf6('0x2f')]=_[_0x5cf6('0x30')](_0x35eb9a[_0x5cf6('0x2b')],qs['fields'](_0x228032[_0x5cf6('0x2d')][_0x5cf6('0x31')]));_0x8a3b4a['attributes']=_0x8a3b4a[_0x5cf6('0x2f')][_0x5cf6('0x32')]?_0x8a3b4a['attributes']:_0x35eb9a[_0x5cf6('0x2b')];if(_0x228032[_0x5cf6('0x2d')][_0x5cf6('0x3e')]){_0x8a3b4a[_0x5cf6('0x43')]=[{'all':!![]}];}_0x8a3b4a=_[_0x5cf6('0x3c')]({},_0x8a3b4a,_0x228032[_0x5cf6('0x3d')]);return db['ServicenowAccount'][_0x5cf6('0x44')](_0x8a3b4a)[_0x5cf6('0x20')](handleEntityNotFound(_0x269006,null))['then'](respondWithResult(_0x269006,null))[_0x5cf6('0x40')](handleError(_0x269006,null));};exports['create']=function(_0x2653b7,_0x35de9b){return db['ServicenowAccount'][_0x5cf6('0x45')](_0x2653b7[_0x5cf6('0x46')],{})[_0x5cf6('0x20')](respondWithResult(_0x35de9b,0xc9))[_0x5cf6('0x40')](handleError(_0x35de9b,null));};exports[_0x5cf6('0x1f')]=function(_0x5b531f,_0x33be11){if(_0x5b531f[_0x5cf6('0x46')]['id']){delete _0x5b531f[_0x5cf6('0x46')]['id'];}return db[_0x5cf6('0x26')][_0x5cf6('0x44')]({'where':{'id':_0x5b531f['params']['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x33be11,null))[_0x5cf6('0x20')](saveUpdates(_0x5b531f['body'],null))[_0x5cf6('0x20')](respondWithResult(_0x33be11,null))['catch'](handleError(_0x33be11,null));};exports['destroy']=function(_0x27648d,_0x1ee076){return db['ServicenowAccount'][_0x5cf6('0x44')]({'where':{'id':_0x27648d[_0x5cf6('0x42')]['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x1ee076,null))[_0x5cf6('0x20')](removeEntity(_0x1ee076,null))['catch'](handleError(_0x1ee076,null));};exports['getConfigurations']=function(_0x561dff,_0x4ccf4d,_0x18ec1b){var _0x39ee9c={};var _0x21aa84={};var _0x41aaae;var _0x2334b3;return db[_0x5cf6('0x26')][_0x5cf6('0x47')]({'where':{'id':_0x561dff[_0x5cf6('0x42')]['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x4ccf4d,null))[_0x5cf6('0x20')](function(_0x3689a4){if(_0x3689a4){_0x41aaae=_0x3689a4;_0x21aa84[_0x5cf6('0x2b')]=_[_0x5cf6('0x2e')](db[_0x5cf6('0x48')][_0x5cf6('0x27')]);_0x21aa84[_0x5cf6('0x2d')]=_[_0x5cf6('0x2e')](_0x561dff[_0x5cf6('0x2d')]);_0x21aa84[_0x5cf6('0x38')]=_[_0x5cf6('0x30')](_0x21aa84[_0x5cf6('0x2b')],_0x21aa84[_0x5cf6('0x2d')]);_0x39ee9c[_0x5cf6('0x2f')]=_[_0x5cf6('0x30')](_0x21aa84[_0x5cf6('0x2b')],qs[_0x5cf6('0x31')](_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x31')]));_0x39ee9c[_0x5cf6('0x2f')]=_0x39ee9c[_0x5cf6('0x2f')]['length']?_0x39ee9c[_0x5cf6('0x2f')]:_0x21aa84[_0x5cf6('0x2b')];_0x39ee9c[_0x5cf6('0x35')]=qs[_0x5cf6('0x36')](_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x36')]);_0x39ee9c[_0x5cf6('0x37')]=qs[_0x5cf6('0x38')](_[_0x5cf6('0x39')](_0x561dff[_0x5cf6('0x2d')],_0x21aa84[_0x5cf6('0x38')]));if(_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x3b')]){_0x39ee9c[_0x5cf6('0x37')]=_['merge'](_0x39ee9c[_0x5cf6('0x37')],{'$or':_[_0x5cf6('0x2c')](_0x39ee9c[_0x5cf6('0x2f')],function(_0x26ded1){var _0x4d5888={};_0x4d5888[_0x26ded1]={'$like':'%'+_0x561dff['query'][_0x5cf6('0x3b')]+'%'};return _0x4d5888;})});}_0x39ee9c=_[_0x5cf6('0x3c')]({},_0x39ee9c,_0x561dff[_0x5cf6('0x3d')]);return _0x41aaae[_0x5cf6('0x49')](_0x39ee9c);}})[_0x5cf6('0x20')](function(_0x4f59fd){if(_0x4f59fd){_0x2334b3=_0x4f59fd[_0x5cf6('0x32')];if(!_0x561dff[_0x5cf6('0x2d')][_0x5cf6('0x33')](_0x5cf6('0x34'))){_0x39ee9c[_0x5cf6('0x1b')]=qs[_0x5cf6('0x1b')](_0x561dff[_0x5cf6('0x2d')]['limit']);_0x39ee9c[_0x5cf6('0x19')]=qs[_0x5cf6('0x19')](_0x561dff[_0x5cf6('0x2d')]['offset']);}return _0x41aaae[_0x5cf6('0x49')](_0x39ee9c);}})[_0x5cf6('0x20')](function(_0x4b1b91){if(_0x4b1b91){return _0x4b1b91?{'count':_0x2334b3,'rows':_0x4b1b91}:null;}})[_0x5cf6('0x20')](respondWithResult(_0x4ccf4d,null))[_0x5cf6('0x40')](handleError(_0x4ccf4d,null));};exports[_0x5cf6('0x4a')]=function(_0x50a724,_0x5d7af2,_0xec5dbc){if(_0x50a724[_0x5cf6('0x46')]['id']){delete _0x50a724[_0x5cf6('0x46')]['id'];}return db[_0x5cf6('0x26')][_0x5cf6('0x47')]({'where':{'id':_0x50a724[_0x5cf6('0x42')]['id']}})[_0x5cf6('0x20')](handleEntityNotFound(_0x5d7af2,null))[_0x5cf6('0x20')](function(_0x4e16a2){if(_0x4e16a2){_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4b')]=_0x4e16a2['id'];_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4c')]=integrations[_0x5cf6('0x4d')](_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4e')],_0x50a724[_0x5cf6('0x46')]['type']);_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4f')]=integrations[_0x5cf6('0x50')](_0x50a724[_0x5cf6('0x46')][_0x5cf6('0x4e')],_0x50a724['body']['type']);return db['ServicenowConfiguration'][_0x5cf6('0x45')](_0x50a724[_0x5cf6('0x46')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x5cf6('0x51')],'as':_0x5cf6('0x4f')}]});}return null;})[_0x5cf6('0x20')](respondWithResult(_0x5d7af2,null))[_0x5cf6('0x40')](handleError(_0x5d7af2,null));};exports[_0x5cf6('0x52')]=function(_0x1e456c,_0x558ae6,_0x48dd24){var _0x57c015=['made_sla',_0x5cf6('0x53'),_0x5cf6('0x54'),_0x5cf6('0x55'),'close_code',_0x5cf6('0x56'),_0x5cf6('0x57'),'severity',_0x5cf6('0x58')];var _0x275375=[_0x5cf6('0x59'),_0x5cf6('0x5a'),_0x5cf6('0x5b'),'watch_list',_0x5cf6('0x5c'),_0x5cf6('0x5d'),'child_incidents','hold_reason','approval_history','number',_0x5cf6('0x5e'),'sys_updated_by',_0x5cf6('0x5f'),_0x5cf6('0x60'),_0x5cf6('0x61'),_0x5cf6('0x62'),_0x5cf6('0x63'),_0x5cf6('0x64'),_0x5cf6('0x54'),'order',_0x5cf6('0x65'),_0x5cf6('0x66'),'cmdb_ci','delivery_plan',_0x5cf6('0x67'),_0x5cf6('0x68'),'work_notes_list',_0x5cf6('0x69'),_0x5cf6('0x6a'),'sys_domain_path',_0x5cf6('0x6b'),'time_worked','expected_start',_0x5cf6('0x6c'),'business_duration',_0x5cf6('0x6d'),_0x5cf6('0x6e'),_0x5cf6('0x6f'),_0x5cf6('0x70'),_0x5cf6('0x71'),'approval_set','subcategory',_0x5cf6('0x72'),_0x5cf6('0x73'),'close_code',_0x5cf6('0x74'),_0x5cf6('0x75'),_0x5cf6('0x76'),_0x5cf6('0x77'),'business_stc',_0x5cf6('0x78'),_0x5cf6('0x79'),_0x5cf6('0x7a'),_0x5cf6('0x56'),'sys_class_name','close_notes','closed_by',_0x5cf6('0x7b'),_0x5cf6('0x7c'),_0x5cf6('0x7d'),_0x5cf6('0x7e'),_0x5cf6('0x7f'),_0x5cf6('0x57'),_0x5cf6('0x80'),'problem_id',_0x5cf6('0x81'),_0x5cf6('0x82'),_0x5cf6('0x83'),'assigned_to',_0x5cf6('0x84'),_0x5cf6('0x85'),'sla_due',_0x5cf6('0x86'),_0x5cf6('0x87'),_0x5cf6('0x88'),_0x5cf6('0x89'),_0x5cf6('0x8a'),_0x5cf6('0x8b'),_0x5cf6('0x8c'),_0x5cf6('0x8d'),_0x5cf6('0x8e'),_0x5cf6('0x8f'),_0x5cf6('0x58')];var _0x1dfaec='';var _0x20cdad='';var _0x26c3d7=[];var _0x5a0e35='';var _0x4a2144='';var _0x39d5e=[];var _0x54a3ae='';var _0x5a1b2d='';var _0xa78083={};var _0x3219cc='';return db[_0x5cf6('0x26')]['findOne']({'where':{'id':_0x1e456c['params']['id']},'attributes':['id','username','password',_0x5cf6('0x90'),'remoteUri',_0x5cf6('0x91')]})[_0x5cf6('0x20')](handleEntityNotFound(_0x558ae6,null))[_0x5cf6('0x20')](function(_0x4278d7){if(_0x4278d7){_0x3219cc=_0x4278d7['remoteUri'];var _0x4bc375=_0x3219cc[_0x5cf6('0x92')](-0x1);if(_0x4bc375==='/'){_0x3219cc=_0x3219cc['substring'](0x0,_0x3219cc[_0x5cf6('0x93')](_0x4bc375));}_0x5a1b2d=util['format'](_0x5cf6('0x94'),_0x3219cc);_0x54a3ae=util[_0x5cf6('0x95')](_0x5cf6('0x96'),_0x3219cc);_0xa78083={'user':_0x4278d7[_0x5cf6('0x97')],'pass':_0x4278d7['password']};var _0x59d84d={'method':_0x5cf6('0x98'),'uri':_0x5a1b2d+_0x5cf6('0x99'),'auth':_0xa78083,'json':!![]};return rp(_0x59d84d);}})['then'](function(_0x190958){if(_0x190958[_0x5cf6('0x9a')][_0x5cf6('0x32')]>0x0){_0x1dfaec=_0x190958[_0x5cf6('0x9a')];}console[_0x5cf6('0x9b')](_0x5cf6('0x9c'),_0x1dfaec);_0x39d5e=[];_0x20cdad=Object[_0x5cf6('0x9d')]([],_0x1dfaec);_['remove'](_0x20cdad,function(_0x552c56){return!_0x57c015[_0x5cf6('0x9e')](_0x552c56['name']);});_0x20cdad[_0x5cf6('0x9f')](function(_0x3e5df8){var _0x51f341=createFieldObject(_0x54a3ae,_0xa78083,_0x3e5df8[_0x5cf6('0xa0')],_0x3e5df8[_0x5cf6('0x23')],_0x3e5df8[_0x5cf6('0xa1')],![]);_0x39d5e[_0x5cf6('0xa2')](_0x51f341);});return Promise[_0x5cf6('0xa3')](_0x39d5e);})[_0x5cf6('0x20')](function(_0x303dd2){_0x26c3d7=_0x303dd2;_0x5a0e35=Object[_0x5cf6('0x9d')]([],_0x1dfaec);console[_0x5cf6('0x9b')](_0x5cf6('0xa4'),_0x1dfaec);_['remove'](_0x5a0e35,function(_0x3fce4f){return _0x275375[_0x5cf6('0x9e')](_0x3fce4f[_0x5cf6('0x23')]);});console[_0x5cf6('0x9b')](_0x5cf6('0xa5'),_0x5a0e35);_0x39d5e=[];_0x5a0e35[_0x5cf6('0x9f')](function(_0x4f5c03){var _0x10d772=createFieldObject(_0x54a3ae,_0xa78083,_0x4f5c03['internalType'],_0x4f5c03[_0x5cf6('0x23')],_0x4f5c03[_0x5cf6('0xa1')],!![]);_0x39d5e[_0x5cf6('0xa2')](_0x10d772);});return Promise[_0x5cf6('0xa3')](_0x39d5e);})['then'](function(_0x3e6e74){_0x4a2144=_0x3e6e74;var _0x5da3bd=_0x26c3d7[_0x5cf6('0xa6')](_0x4a2144);return{'count':_0x5da3bd[_0x5cf6('0x32')],'rows':_0x5da3bd};})[_0x5cf6('0x20')](respondWithResult(_0x558ae6,null))[_0x5cf6('0x40')](function(_0x2e0c9f){console[_0x5cf6('0x9b')](_0x5cf6('0xa7')+_0x2e0c9f);var _0x11d64a=_0x1e456c['query'][_0x5cf6('0xa8')]?0x1f4:_0x2e0c9f[_0x5cf6('0xa9')]||0x1f4;logger['error'](_0x2e0c9f['stack']);delete _0x2e0c9f[_0x5cf6('0x23')];if(_0x11d64a===0x191){_0x11d64a=0x190;}_0x558ae6[_0x5cf6('0x16')](_0x11d64a)[_0x5cf6('0x24')](_0x1e456c['query'][_0x5cf6('0xa8')]?{'message':_0x5cf6('0xaa'),'statusCode':_0x2e0c9f[_0x5cf6('0xa9')]}:_0x2e0c9f);});};function createFieldObject(_0x1990e5,_0x19e637,_0x5af028,_0x157cd4,_0x591a1d,_0x9a7cb0){return new Promise(function(_0x302b93,_0x1eecd2){var _0x427593={'id':_0x157cd4,'name':_0x591a1d,'custom':_0x9a7cb0};if(_0x5af028===_0x5cf6('0xab')){_0x427593['options']=[{'name':_0x5cf6('0xac'),'value':_0x5cf6('0xad')},{'name':_0x5cf6('0xae'),'value':_0x5cf6('0xaf')}];_0x302b93(_0x427593);}else{var _0x1438c1={'method':'GET','uri':_0x1990e5+_0x5cf6('0xb0')+_0x157cd4,'auth':_0x19e637,'json':!![]};return rp(_0x1438c1)[_0x5cf6('0x20')](function(_0x1ed2f9){var _0x7bf34f=[];if(_0x1ed2f9['result'][_0x5cf6('0x32')]>0x0){_0x1ed2f9[_0x5cf6('0x9a')][_0x5cf6('0x9f')](function(_0x156cc4){if(_0x156cc4[_0x5cf6('0xb1')]===_0x5cf6('0xaf')){var _0x2bf691={'name':_0x156cc4[_0x5cf6('0xa1')],'value':_0x156cc4[_0x5cf6('0xb2')]};_0x7bf34f[_0x5cf6('0xa2')](_0x2bf691);}});}_0x427593[_0x5cf6('0x3d')]=_0x7bf34f;if(_0x427593[_0x5cf6('0x3d')]['length']>0x0){_0x302b93(_0x427593);}else{if(_0x9a7cb0==![]){_0x302b93();}else{_0x302b93(_0x427593);}}});}});} \ No newline at end of file +var _0x0c3d=['False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','ServicenowAccount','includeAll','include','findAll','show','params','find','create','body','catch','getConfigurations','order','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','calendar_stc','closed_at','cmdb_ci','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','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','close_notes','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','due_date','sys_mod_count','reopen_count','escalation','correlation_id','password','email','remoteUri','serverUrl','substring','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','test','Wrong\x20credentials','True'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0c3d,0xbc));var _0xd0c3=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0x0c3d[_0x4529b3];return _0x21e907;};'use strict';var emlformat=require(_0xd0c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0c3('0x1'));var jsonpatch=require(_0xd0c3('0x2'));var rp=require(_0xd0c3('0x3'));var moment=require(_0xd0c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd0c3('0x5'));var util=require(_0xd0c3('0x6'));var path=require(_0xd0c3('0x7'));var sox=require(_0xd0c3('0x8'));var csv=require(_0xd0c3('0x9'));var ejs=require(_0xd0c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c3('0xb'));var squel=require('squel');var crypto=require(_0xd0c3('0xc'));var jsforce=require(_0xd0c3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd0c3('0x9'));var querystring=require(_0xd0c3('0xe'));var Papa=require(_0xd0c3('0xf'));var Redis=require(_0xd0c3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0c3('0x11'));var as=require(_0xd0c3('0x12'));var hardwareService=require(_0xd0c3('0x13'));var logger=require(_0xd0c3('0x14'))(_0xd0c3('0x15'));var utils=require(_0xd0c3('0x16'));var config=require(_0xd0c3('0x17'));var licenseUtil=require(_0xd0c3('0x18'));var db=require(_0xd0c3('0x19'))['db'];var integrations=require(_0xd0c3('0x1a'));function respondWithStatusCode(_0x571774,_0x2fb907){_0x2fb907=_0x2fb907||0xcc;return function(_0x117ff7){if(_0x117ff7){return _0x571774['sendStatus'](_0x2fb907);}return _0x571774[_0xd0c3('0x1b')](_0x2fb907)[_0xd0c3('0x1c')]();};}function respondWithResult(_0x5d37d6,_0x95e9d8){_0x95e9d8=_0x95e9d8||0xc8;return function(_0x385df0){if(_0x385df0){return _0x5d37d6[_0xd0c3('0x1b')](_0x95e9d8)[_0xd0c3('0x1d')](_0x385df0);}};}function respondWithFilteredResult(_0x19b7bd,_0x1900a0){return function(_0x8678a4){if(_0x8678a4){var _0x172b3a=typeof _0x1900a0[_0xd0c3('0x1e')]==='undefined'&&typeof _0x1900a0['limit']===_0xd0c3('0x1f');var _0xe8d72a=_0x8678a4[_0xd0c3('0x20')];var _0x8d42d8=_0x172b3a?0x0:_0x1900a0[_0xd0c3('0x1e')];var _0x69ccdf=_0x172b3a?_0x8678a4[_0xd0c3('0x20')]:_0x1900a0[_0xd0c3('0x1e')]+_0x1900a0[_0xd0c3('0x21')];var _0x43bac6;if(_0x69ccdf>=_0xe8d72a){_0x69ccdf=_0xe8d72a;_0x43bac6=0xc8;}else{_0x43bac6=0xce;}_0x19b7bd[_0xd0c3('0x1b')](_0x43bac6);return _0x19b7bd[_0xd0c3('0x22')](_0xd0c3('0x23'),_0x8d42d8+'-'+_0x69ccdf+'/'+_0xe8d72a)[_0xd0c3('0x1d')](_0x8678a4);}return null;};}function patchUpdates(_0x206313){return function(_0x30e7fb){try{jsonpatch['apply'](_0x30e7fb,_0x206313,!![]);}catch(_0x3679a9){return BPromise[_0xd0c3('0x24')](_0x3679a9);}return _0x30e7fb[_0xd0c3('0x25')]();};}function saveUpdates(_0x40476a,_0x3df03a){return function(_0x2e6ec8){if(_0x2e6ec8){return _0x2e6ec8[_0xd0c3('0x26')](_0x40476a)[_0xd0c3('0x27')](function(_0x430a07){return _0x430a07;});}return null;};}function removeEntity(_0x64f624,_0x2ab7bb){return function(_0x450d54){if(_0x450d54){return _0x450d54[_0xd0c3('0x28')]()[_0xd0c3('0x27')](function(){_0x64f624['status'](0xcc)[_0xd0c3('0x1c')]();});}};}function handleEntityNotFound(_0x32ef6b,_0x26526d){return function(_0x31e2ec){if(!_0x31e2ec){_0x32ef6b['sendStatus'](0x194);}return _0x31e2ec;};}function handleError(_0x3fdc44,_0x34d6f6){_0x34d6f6=_0x34d6f6||0x1f4;return function(_0x5d73fc){logger[_0xd0c3('0x29')](_0x5d73fc[_0xd0c3('0x2a')]);if(_0x5d73fc['name']){delete _0x5d73fc[_0xd0c3('0x2b')];}_0x3fdc44[_0xd0c3('0x1b')](_0x34d6f6)[_0xd0c3('0x2c')](_0x5d73fc);};}exports[_0xd0c3('0x2d')]=function(_0xe718c5,_0x43a367){var _0x502eba={},_0x82b175={},_0x2d4f0e={'count':0x0,'rows':[]};var _0x1fba2b=_[_0xd0c3('0x2e')](db['ServicenowAccount'][_0xd0c3('0x2f')],function(_0x253ac5){return{'name':_0x253ac5[_0xd0c3('0x30')],'type':_0x253ac5['type']['key']};});_0x82b175[_0xd0c3('0x31')]=_['map'](_0x1fba2b,_0xd0c3('0x2b'));_0x82b175[_0xd0c3('0x32')]=_[_0xd0c3('0x33')](_0xe718c5[_0xd0c3('0x32')]);_0x82b175['filters']=_[_0xd0c3('0x34')](_0x82b175[_0xd0c3('0x31')],_0x82b175['query']);_0x502eba[_0xd0c3('0x35')]=_[_0xd0c3('0x34')](_0x82b175[_0xd0c3('0x31')],qs['fields'](_0xe718c5['query'][_0xd0c3('0x36')]));_0x502eba[_0xd0c3('0x35')]=_0x502eba['attributes'][_0xd0c3('0x37')]?_0x502eba['attributes']:_0x82b175[_0xd0c3('0x31')];if(!_0xe718c5[_0xd0c3('0x32')]['hasOwnProperty']('nolimit')){_0x502eba[_0xd0c3('0x21')]=qs[_0xd0c3('0x21')](_0xe718c5[_0xd0c3('0x32')][_0xd0c3('0x21')]);_0x502eba[_0xd0c3('0x1e')]=qs[_0xd0c3('0x1e')](_0xe718c5['query']['offset']);}_0x502eba['order']=qs[_0xd0c3('0x38')](_0xe718c5['query'][_0xd0c3('0x38')]);_0x502eba[_0xd0c3('0x39')]=qs[_0xd0c3('0x3a')](_[_0xd0c3('0x3b')](_0xe718c5[_0xd0c3('0x32')],_0x82b175[_0xd0c3('0x3a')]),_0x1fba2b);if(_0xe718c5[_0xd0c3('0x32')][_0xd0c3('0x3c')]){_0x502eba[_0xd0c3('0x39')]=_['merge'](_0x502eba[_0xd0c3('0x39')],{'$or':_[_0xd0c3('0x2e')](_0x1fba2b,function(_0x235bb6){if(_0x235bb6[_0xd0c3('0x3d')]!==_0xd0c3('0x3e')){var _0x5398bc={};_0x5398bc[_0x235bb6[_0xd0c3('0x2b')]]={'$like':'%'+_0xe718c5[_0xd0c3('0x32')][_0xd0c3('0x3c')]+'%'};return _0x5398bc;}})});}_0x502eba=_[_0xd0c3('0x3f')]({},_0x502eba,_0xe718c5[_0xd0c3('0x40')]);var _0x21f61b={'where':_0x502eba['where']};return db[_0xd0c3('0x41')]['count'](_0x21f61b)[_0xd0c3('0x27')](function(_0x57dae7){_0x2d4f0e[_0xd0c3('0x20')]=_0x57dae7;if(_0xe718c5[_0xd0c3('0x32')][_0xd0c3('0x42')]){_0x502eba[_0xd0c3('0x43')]=[{'all':!![]}];}return db[_0xd0c3('0x41')][_0xd0c3('0x44')](_0x502eba);})[_0xd0c3('0x27')](function(_0x342d26){_0x2d4f0e['rows']=_0x342d26;return _0x2d4f0e;})['then'](respondWithFilteredResult(_0x43a367,_0x502eba))['catch'](handleError(_0x43a367,null));};exports[_0xd0c3('0x45')]=function(_0x1d7fb7,_0x5859c0){var _0x39916e={'raw':![],'where':{'id':_0x1d7fb7[_0xd0c3('0x46')]['id']}},_0x29fbbb={};_0x29fbbb[_0xd0c3('0x31')]=_[_0xd0c3('0x33')](db[_0xd0c3('0x41')]['rawAttributes']);_0x29fbbb['query']=_['keys'](_0x1d7fb7[_0xd0c3('0x32')]);_0x29fbbb[_0xd0c3('0x3a')]=_[_0xd0c3('0x34')](_0x29fbbb['model'],_0x29fbbb[_0xd0c3('0x32')]);_0x39916e[_0xd0c3('0x35')]=_[_0xd0c3('0x34')](_0x29fbbb[_0xd0c3('0x31')],qs[_0xd0c3('0x36')](_0x1d7fb7[_0xd0c3('0x32')][_0xd0c3('0x36')]));_0x39916e[_0xd0c3('0x35')]=_0x39916e['attributes'][_0xd0c3('0x37')]?_0x39916e[_0xd0c3('0x35')]:_0x29fbbb[_0xd0c3('0x31')];if(_0x1d7fb7[_0xd0c3('0x32')]['includeAll']){_0x39916e[_0xd0c3('0x43')]=[{'all':!![]}];}_0x39916e=_[_0xd0c3('0x3f')]({},_0x39916e,_0x1d7fb7['options']);return db[_0xd0c3('0x41')][_0xd0c3('0x47')](_0x39916e)['then'](handleEntityNotFound(_0x5859c0,null))[_0xd0c3('0x27')](respondWithResult(_0x5859c0,null))['catch'](handleError(_0x5859c0,null));};exports[_0xd0c3('0x48')]=function(_0x3736f1,_0x57e9c6){return db[_0xd0c3('0x41')][_0xd0c3('0x48')](_0x3736f1[_0xd0c3('0x49')],{})['then'](respondWithResult(_0x57e9c6,0xc9))['catch'](handleError(_0x57e9c6,null));};exports[_0xd0c3('0x26')]=function(_0x36afb2,_0xc02f33){if(_0x36afb2[_0xd0c3('0x49')]['id']){delete _0x36afb2[_0xd0c3('0x49')]['id'];}return db[_0xd0c3('0x41')][_0xd0c3('0x47')]({'where':{'id':_0x36afb2[_0xd0c3('0x46')]['id']}})['then'](handleEntityNotFound(_0xc02f33,null))[_0xd0c3('0x27')](saveUpdates(_0x36afb2[_0xd0c3('0x49')],null))[_0xd0c3('0x27')](respondWithResult(_0xc02f33,null))[_0xd0c3('0x4a')](handleError(_0xc02f33,null));};exports[_0xd0c3('0x28')]=function(_0x490c6e,_0x5923e8){return db[_0xd0c3('0x41')][_0xd0c3('0x47')]({'where':{'id':_0x490c6e[_0xd0c3('0x46')]['id']}})[_0xd0c3('0x27')](handleEntityNotFound(_0x5923e8,null))['then'](removeEntity(_0x5923e8,null))['catch'](handleError(_0x5923e8,null));};exports[_0xd0c3('0x4b')]=function(_0x44edd7,_0x520aeb,_0x47a0e3){var _0x2334a3={};var _0x9020f3={};var _0x486923;var _0x19da3f;return db[_0xd0c3('0x41')]['findOne']({'where':{'id':_0x44edd7[_0xd0c3('0x46')]['id']}})[_0xd0c3('0x27')](handleEntityNotFound(_0x520aeb,null))[_0xd0c3('0x27')](function(_0x201f49){if(_0x201f49){_0x486923=_0x201f49;_0x9020f3[_0xd0c3('0x31')]=_[_0xd0c3('0x33')](db['ServicenowConfiguration']['rawAttributes']);_0x9020f3['query']=_[_0xd0c3('0x33')](_0x44edd7[_0xd0c3('0x32')]);_0x9020f3['filters']=_[_0xd0c3('0x34')](_0x9020f3[_0xd0c3('0x31')],_0x9020f3[_0xd0c3('0x32')]);_0x2334a3[_0xd0c3('0x35')]=_[_0xd0c3('0x34')](_0x9020f3[_0xd0c3('0x31')],qs[_0xd0c3('0x36')](_0x44edd7['query'][_0xd0c3('0x36')]));_0x2334a3[_0xd0c3('0x35')]=_0x2334a3[_0xd0c3('0x35')][_0xd0c3('0x37')]?_0x2334a3[_0xd0c3('0x35')]:_0x9020f3['model'];_0x2334a3[_0xd0c3('0x4c')]=qs[_0xd0c3('0x38')](_0x44edd7[_0xd0c3('0x32')][_0xd0c3('0x38')]);_0x2334a3['where']=qs[_0xd0c3('0x3a')](_['pick'](_0x44edd7['query'],_0x9020f3[_0xd0c3('0x3a')]));if(_0x44edd7[_0xd0c3('0x32')]['filter']){_0x2334a3[_0xd0c3('0x39')]=_[_0xd0c3('0x3f')](_0x2334a3[_0xd0c3('0x39')],{'$or':_[_0xd0c3('0x2e')](_0x2334a3['attributes'],function(_0x3bb40f){var _0x49b36c={};_0x49b36c[_0x3bb40f]={'$like':'%'+_0x44edd7[_0xd0c3('0x32')][_0xd0c3('0x3c')]+'%'};return _0x49b36c;})});}_0x2334a3=_[_0xd0c3('0x3f')]({},_0x2334a3,_0x44edd7['options']);return _0x486923[_0xd0c3('0x4b')](_0x2334a3);}})['then'](function(_0x40c7a7){if(_0x40c7a7){_0x19da3f=_0x40c7a7[_0xd0c3('0x37')];if(!_0x44edd7['query'][_0xd0c3('0x4d')](_0xd0c3('0x4e'))){_0x2334a3[_0xd0c3('0x21')]=qs['limit'](_0x44edd7[_0xd0c3('0x32')][_0xd0c3('0x21')]);_0x2334a3[_0xd0c3('0x1e')]=qs[_0xd0c3('0x1e')](_0x44edd7[_0xd0c3('0x32')][_0xd0c3('0x1e')]);}return _0x486923[_0xd0c3('0x4b')](_0x2334a3);}})['then'](function(_0x10584a){if(_0x10584a){return _0x10584a?{'count':_0x19da3f,'rows':_0x10584a}:null;}})[_0xd0c3('0x27')](respondWithResult(_0x520aeb,null))[_0xd0c3('0x4a')](handleError(_0x520aeb,null));};exports[_0xd0c3('0x4f')]=function(_0x4cc4e1,_0x6bf7ce,_0x364e35){if(_0x4cc4e1['body']['id']){delete _0x4cc4e1[_0xd0c3('0x49')]['id'];}return db[_0xd0c3('0x41')]['findOne']({'where':{'id':_0x4cc4e1[_0xd0c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x6bf7ce,null))[_0xd0c3('0x27')](function(_0x21935f){if(_0x21935f){_0x4cc4e1[_0xd0c3('0x49')][_0xd0c3('0x50')]=_0x21935f['id'];_0x4cc4e1['body'][_0xd0c3('0x51')]=integrations[_0xd0c3('0x52')](_0x4cc4e1[_0xd0c3('0x49')][_0xd0c3('0x53')],_0x4cc4e1[_0xd0c3('0x49')]['type']);_0x4cc4e1[_0xd0c3('0x49')][_0xd0c3('0x54')]=integrations[_0xd0c3('0x55')](_0x4cc4e1[_0xd0c3('0x49')][_0xd0c3('0x53')],_0x4cc4e1[_0xd0c3('0x49')]['type']);return db[_0xd0c3('0x56')][_0xd0c3('0x48')](_0x4cc4e1[_0xd0c3('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0xd0c3('0x51')},{'model':db['ServicenowField'],'as':_0xd0c3('0x54')}]});}return null;})[_0xd0c3('0x27')](respondWithResult(_0x6bf7ce,null))[_0xd0c3('0x4a')](handleError(_0x6bf7ce,null));};exports[_0xd0c3('0x57')]=function(_0x34b261,_0x5ad91c,_0x2d128f){var _0xbb4f1b=[_0xd0c3('0x58'),_0xd0c3('0x59'),_0xd0c3('0x5a'),_0xd0c3('0x5b'),_0xd0c3('0x5c'),_0xd0c3('0x5d'),_0xd0c3('0x5e'),'severity',_0xd0c3('0x5f')];var _0x3e69da=[_0xd0c3('0x60'),_0xd0c3('0x58'),_0xd0c3('0x61'),'watch_list',_0xd0c3('0x62'),_0xd0c3('0x63'),_0xd0c3('0x64'),_0xd0c3('0x59'),_0xd0c3('0x65'),_0xd0c3('0x66'),_0xd0c3('0x67'),_0xd0c3('0x68'),_0xd0c3('0x69'),_0xd0c3('0x6a'),'sys_created_on',_0xd0c3('0x6b'),_0xd0c3('0x6c'),'sys_created_by',_0xd0c3('0x5a'),_0xd0c3('0x4c'),_0xd0c3('0x6d'),_0xd0c3('0x6e'),_0xd0c3('0x6f'),'delivery_plan',_0xd0c3('0x70'),_0xd0c3('0x71'),_0xd0c3('0x72'),_0xd0c3('0x73'),_0xd0c3('0x74'),_0xd0c3('0x75'),_0xd0c3('0x76'),_0xd0c3('0x77'),_0xd0c3('0x78'),_0xd0c3('0x79'),_0xd0c3('0x7a'),_0xd0c3('0x7b'),'work_end',_0xd0c3('0x7c'),_0xd0c3('0x7d'),'caller_id',_0xd0c3('0x7e'),_0xd0c3('0x5b'),_0xd0c3('0x7f'),_0xd0c3('0x80'),_0xd0c3('0x5c'),_0xd0c3('0x81'),_0xd0c3('0x82'),_0xd0c3('0x83'),_0xd0c3('0x84'),'business_stc',_0xd0c3('0x85'),_0xd0c3('0x86'),'calendar_duration',_0xd0c3('0x5d'),'sys_class_name',_0xd0c3('0x87'),'closed_by',_0xd0c3('0x88'),'parent_incident',_0xd0c3('0x89'),_0xd0c3('0x8a'),_0xd0c3('0x8b'),_0xd0c3('0x5e'),_0xd0c3('0x8c'),_0xd0c3('0x8d'),_0xd0c3('0x8e'),_0xd0c3('0x8f'),_0xd0c3('0x90'),'assigned_to',_0xd0c3('0x91'),_0xd0c3('0x92'),_0xd0c3('0x93'),'approval','comments_and_work_notes',_0xd0c3('0x94'),_0xd0c3('0x95'),_0xd0c3('0x96'),'sys_tags',_0xd0c3('0x97'),'upon_approval',_0xd0c3('0x98'),'location',_0xd0c3('0x5f')];var _0x5ba037='';var _0x2cde6b='';var _0x559846=[];var _0x32333a='';var _0x1a7aa2='';var _0x35d1ee=[];var _0x5608a7='';var _0x5ee702='';var _0x45c508={};var _0x214b59='';return db[_0xd0c3('0x41')]['findOne']({'where':{'id':_0x34b261[_0xd0c3('0x46')]['id']},'attributes':['id','username',_0xd0c3('0x99'),_0xd0c3('0x9a'),_0xd0c3('0x9b'),_0xd0c3('0x9c')]})[_0xd0c3('0x27')](handleEntityNotFound(_0x5ad91c,null))['then'](function(_0x16ba64){if(_0x16ba64){_0x214b59=_0x16ba64['remoteUri'];var _0xc34b99=_0x214b59['slice'](-0x1);if(_0xc34b99==='/'){_0x214b59=_0x214b59[_0xd0c3('0x9d')](0x0,_0x214b59['lastIndexOf'](_0xc34b99));}_0x5ee702=util['format'](_0xd0c3('0x9e'),_0x214b59);_0x5608a7=util['format'](_0xd0c3('0x9f'),_0x214b59);_0x45c508={'user':_0x16ba64['username'],'pass':_0x16ba64[_0xd0c3('0x99')]};var _0xbcf8d9={'method':'GET','uri':_0x5ee702+_0xd0c3('0xa0'),'auth':_0x45c508,'json':!![]};return rp(_0xbcf8d9);}})[_0xd0c3('0x27')](function(_0x330b91){if(_0x330b91['result'][_0xd0c3('0x37')]>0x0){_0x5ba037=_0x330b91[_0xd0c3('0xa1')];}console[_0xd0c3('0xa2')](_0xd0c3('0xa3'),_0x5ba037);_0x35d1ee=[];_0x2cde6b=Object['assign']([],_0x5ba037);_[_0xd0c3('0xa4')](_0x2cde6b,function(_0x4a9afc){return!_0xbb4f1b[_0xd0c3('0xa5')](_0x4a9afc['name']);});_0x2cde6b[_0xd0c3('0xa6')](function(_0x186eff){var _0x40237d=createFieldObject(_0x5608a7,_0x45c508,_0x186eff['internalType'],_0x186eff[_0xd0c3('0x2b')],_0x186eff[_0xd0c3('0xa7')],![]);_0x35d1ee[_0xd0c3('0xa8')](_0x40237d);});return Promise[_0xd0c3('0xa9')](_0x35d1ee);})['then'](function(_0x59ca9c){_0x559846=_0x59ca9c;_0x32333a=Object[_0xd0c3('0xaa')]([],_0x5ba037);console[_0xd0c3('0xa2')](_0xd0c3('0xab'),_0x5ba037);_['remove'](_0x32333a,function(_0x225232){return _0x3e69da[_0xd0c3('0xa5')](_0x225232[_0xd0c3('0x2b')]);});console[_0xd0c3('0xa2')](_0xd0c3('0xac'),_0x32333a);_0x35d1ee=[];_0x32333a[_0xd0c3('0xa6')](function(_0x150889){var _0x2d5986=createFieldObject(_0x5608a7,_0x45c508,_0x150889[_0xd0c3('0xad')],_0x150889['name'],_0x150889[_0xd0c3('0xa7')],!![]);_0x35d1ee[_0xd0c3('0xa8')](_0x2d5986);});return Promise[_0xd0c3('0xa9')](_0x35d1ee);})[_0xd0c3('0x27')](function(_0x34a0c4){_0x1a7aa2=_0x34a0c4;var _0x55be11=_0x559846[_0xd0c3('0xae')](_0x1a7aa2);return{'count':_0x55be11[_0xd0c3('0x37')],'rows':_0x55be11};})[_0xd0c3('0x27')](respondWithResult(_0x5ad91c,null))[_0xd0c3('0x4a')](function(_0x2cf725){console['log']('ServiceNow\x20error:\x20'+_0x2cf725);var _0x258acb=_0x34b261['query'][_0xd0c3('0xaf')]?0x1f4:_0x2cf725['statusCode']||0x1f4;logger[_0xd0c3('0x29')](_0x2cf725[_0xd0c3('0x2a')]);delete _0x2cf725[_0xd0c3('0x2b')];if(_0x258acb===0x191){_0x258acb=0x190;}_0x5ad91c['status'](_0x258acb)[_0xd0c3('0x2c')](_0x34b261[_0xd0c3('0x32')]['test']?{'message':_0xd0c3('0xb0'),'statusCode':_0x2cf725['statusCode']}:_0x2cf725);});};function createFieldObject(_0x4a9f09,_0x51634d,_0x534c92,_0xc949b2,_0x26b2f0,_0x61c9e4){return new Promise(function(_0x33c071,_0x7b15c9){var _0x4c221f={'id':_0xc949b2,'name':_0x26b2f0,'custom':_0x61c9e4};if(_0x534c92==='boolean'){_0x4c221f['options']=[{'name':_0xd0c3('0xb1'),'value':'true'},{'name':_0xd0c3('0xb2'),'value':_0xd0c3('0xb3')}];_0x33c071(_0x4c221f);}else{var _0x5a01bf={'method':'GET','uri':_0x4a9f09+_0xd0c3('0xb4')+_0xc949b2,'auth':_0x51634d,'json':!![]};return rp(_0x5a01bf)[_0xd0c3('0x27')](function(_0x385af9){var _0x309a5b=[];if(_0x385af9['result'][_0xd0c3('0x37')]>0x0){_0x385af9['result'][_0xd0c3('0xa6')](function(_0x51d2dd){if(_0x51d2dd[_0xd0c3('0xb5')]===_0xd0c3('0xb3')){var _0x4db289={'name':_0x51d2dd[_0xd0c3('0xa7')],'value':_0x51d2dd[_0xd0c3('0xb6')]};_0x309a5b['push'](_0x4db289);}});}_0x4c221f[_0xd0c3('0x40')]=_0x309a5b;if(_0x4c221f[_0xd0c3('0x40')][_0xd0c3('0x37')]>0x0){_0x33c071(_0x4c221f);}else{if(_0x61c9e4==![]){_0x33c071();}else{_0x33c071(_0x4c221f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d1c67a4..6bb5418 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 _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x7da7[_0x64aff8];return _0x5488a3;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['moment','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api'];(function(_0x57eabc,_0x33c089){var _0x4c1ce4=function(_0xf89590){while(--_0xf89590){_0x57eabc['push'](_0x57eabc['shift']());}};_0x4c1ce4(++_0x33c089);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x524cd0,_0x242a66){_0x524cd0=_0x524cd0-0x0;var _0x90b440=_0xb4c7[_0x524cd0];return _0x90b440;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x7b4c('0xa')]=function(_0x10e197,_0x2dd5c7){return _0x10e197['define'](_0x7b4c('0xb'),attributes,{'tableName':_0x7b4c('0xc'),'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 cc3626b..5d59de6 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 _0x328f=['include','map','model','stringify','ServicenowAccount','raw','where','ShowServicenowAccount','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','findAll','options','attributes','limit'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x328f,0xd4));var _0xf328=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x328f[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0xf328('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf328('0x1'));var rs=require(_0xf328('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf328('0x3'))['db'];var utils=require(_0xf328('0x4'));var logger=require(_0xf328('0x5'))(_0xf328('0x6'));var config=require('../../config/environment');var jayson=require(_0xf328('0x7'));var client=jayson['client'][_0xf328('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2733b9,_0x5763ac,_0x5bf986){return new BPromise(function(_0x56bbca,_0x2340be){return client[_0xf328('0x9')](_0x2733b9,_0x5bf986)[_0xf328('0xa')](function(_0xea7c79){logger[_0xf328('0xb')](_0xf328('0xc'),_0x5763ac,_0xf328('0xd'));logger[_0xf328('0xe')](_0xf328('0xf'),_0x5763ac,_0xf328('0xd'),JSON['stringify'](_0xea7c79));if(_0xea7c79['error']){if(_0xea7c79[_0xf328('0x10')][_0xf328('0x11')]===0x1f4){logger[_0xf328('0x10')](_0xf328('0xc'),_0x5763ac,_0xea7c79[_0xf328('0x10')]['message']);return _0x2340be(_0xea7c79[_0xf328('0x10')][_0xf328('0x12')]);}logger[_0xf328('0x10')](_0xf328('0xc'),_0x5763ac,_0xea7c79[_0xf328('0x10')][_0xf328('0x12')]);return _0x56bbca(_0xea7c79[_0xf328('0x10')]['message']);}else{logger[_0xf328('0xb')](_0xf328('0xc'),_0x5763ac,_0xf328('0xd'));_0x56bbca(_0xea7c79[_0xf328('0x13')]['message']);}})[_0xf328('0x14')](function(_0x100559){logger[_0xf328('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x5763ac,_0x100559);_0x2340be(_0x100559);});});}exports[_0xf328('0x15')]=function(_0x2946d6){var _0x10bd9d=this;return new Promise(function(_0x15b9c3,_0x109158){return db['ServicenowAccount'][_0xf328('0x16')]({'raw':_0x2946d6['options']?_0x2946d6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')]['where']||null:null,'attributes':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')][_0xf328('0x18')]||null:null,'limit':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')][_0xf328('0x19')]||null:null,'include':_0x2946d6[_0xf328('0x17')]?_0x2946d6[_0xf328('0x17')][_0xf328('0x1a')]?_[_0xf328('0x1b')](_0x2946d6[_0xf328('0x17')]['include'],function(_0x5edaa8){return{'model':db[_0x5edaa8[_0xf328('0x1c')]],'as':_0x5edaa8['as'],'attributes':_0x5edaa8[_0xf328('0x18')],'include':_0x5edaa8[_0xf328('0x1a')]?_['map'](_0x5edaa8[_0xf328('0x1a')],function(_0x106a65){return{'model':db[_0x106a65['model']],'as':_0x106a65['as'],'attributes':_0x106a65[_0xf328('0x18')],'include':_0x106a65[_0xf328('0x1a')]?_[_0xf328('0x1b')](_0x106a65['include'],function(_0x1e7a28){return{'model':db[_0x1e7a28['model']],'as':_0x1e7a28['as'],'attributes':_0x1e7a28[_0xf328('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf328('0xa')](function(_0x288b60){logger[_0xf328('0xb')]('GetServicenowAccount',_0x2946d6);logger['debug'](_0xf328('0x15'),_0x2946d6,JSON[_0xf328('0x1d')](_0x288b60));_0x15b9c3(_0x288b60);})[_0xf328('0x14')](function(_0x33d1be){logger[_0xf328('0x10')](_0xf328('0x15'),_0x33d1be['message'],_0x2946d6);_0x109158(_0x10bd9d[_0xf328('0x10')](0x1f4,_0x33d1be['message']));});});};exports['ShowServicenowAccount']=function(_0x52e41e){var _0x16c371=this;return new Promise(function(_0x1389be,_0x1d8753){return db[_0xf328('0x1e')]['find']({'raw':_0x52e41e[_0xf328('0x17')]?_0x52e41e[_0xf328('0x17')][_0xf328('0x1f')]===undefined?!![]:![]:!![],'where':_0x52e41e['options']?_0x52e41e[_0xf328('0x17')][_0xf328('0x20')]||null:null,'attributes':_0x52e41e[_0xf328('0x17')]?_0x52e41e[_0xf328('0x17')][_0xf328('0x18')]||null:null,'include':_0x52e41e['options']?_0x52e41e[_0xf328('0x17')]['include']?_[_0xf328('0x1b')](_0x52e41e[_0xf328('0x17')][_0xf328('0x1a')],function(_0x655c97){return{'model':db[_0x655c97[_0xf328('0x1c')]],'as':_0x655c97['as'],'attributes':_0x655c97[_0xf328('0x18')],'include':_0x655c97['include']?_[_0xf328('0x1b')](_0x655c97[_0xf328('0x1a')],function(_0x4d761b){return{'model':db[_0x4d761b[_0xf328('0x1c')]],'as':_0x4d761b['as'],'attributes':_0x4d761b[_0xf328('0x18')],'include':_0x4d761b[_0xf328('0x1a')]?_[_0xf328('0x1b')](_0x4d761b[_0xf328('0x1a')],function(_0x500025){return{'model':db[_0x500025[_0xf328('0x1c')]],'as':_0x500025['as'],'attributes':_0x500025['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x161fbf){logger[_0xf328('0xb')](_0xf328('0x21'),_0x52e41e);logger[_0xf328('0xe')](_0xf328('0x21'),_0x52e41e,JSON[_0xf328('0x1d')](_0x161fbf));_0x1389be(_0x161fbf);})[_0xf328('0x14')](function(_0x206b32){logger[_0xf328('0x10')](_0xf328('0x21'),_0x206b32[_0xf328('0x12')],_0x52e41e);_0x1d8753(_0x16c371['error'](0x1f4,_0x206b32[_0xf328('0x12')]));});});}; \ No newline at end of file +var _0xd7a1=['message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','include','map','model','attributes','info','ShowServicenowAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x586e64,_0x4e6f01){var _0x3e237c=function(_0x2f0ece){while(--_0x2f0ece){_0x586e64['push'](_0x586e64['shift']());}};_0x3e237c(++_0x4e6f01);}(_0xd7a1,0x1d8));var _0x1d7a=function(_0x3da6ae,_0x13fdf4){_0x3da6ae=_0x3da6ae-0x0;var _0x1aa8df=_0xd7a1[_0x3da6ae];return _0x1aa8df;};'use strict';var _=require(_0x1d7a('0x0'));var util=require(_0x1d7a('0x1'));var moment=require(_0x1d7a('0x2'));var BPromise=require(_0x1d7a('0x3'));var rs=require(_0x1d7a('0x4'));var fs=require('fs');var Redis=require(_0x1d7a('0x5'));var db=require(_0x1d7a('0x6'))['db'];var utils=require(_0x1d7a('0x7'));var logger=require(_0x1d7a('0x8'))(_0x1d7a('0x9'));var config=require('../../config/environment');var jayson=require(_0x1d7a('0xa'));var client=jayson[_0x1d7a('0xb')][_0x1d7a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38f6ec,_0x2e3b1f,_0x3561dd){return new BPromise(function(_0x22a7c1,_0x37f9dc){return client[_0x1d7a('0xd')](_0x38f6ec,_0x3561dd)[_0x1d7a('0xe')](function(_0x882dd0){logger['info'](_0x1d7a('0xf'),_0x2e3b1f,_0x1d7a('0x10'));logger[_0x1d7a('0x11')](_0x1d7a('0x12'),_0x2e3b1f,_0x1d7a('0x10'),JSON[_0x1d7a('0x13')](_0x882dd0));if(_0x882dd0[_0x1d7a('0x14')]){if(_0x882dd0[_0x1d7a('0x14')][_0x1d7a('0x15')]===0x1f4){logger[_0x1d7a('0x14')](_0x1d7a('0xf'),_0x2e3b1f,_0x882dd0['error'][_0x1d7a('0x16')]);return _0x37f9dc(_0x882dd0['error']['message']);}logger[_0x1d7a('0x14')](_0x1d7a('0xf'),_0x2e3b1f,_0x882dd0[_0x1d7a('0x14')][_0x1d7a('0x16')]);return _0x22a7c1(_0x882dd0[_0x1d7a('0x14')]['message']);}else{logger['info'](_0x1d7a('0xf'),_0x2e3b1f,_0x1d7a('0x10'));_0x22a7c1(_0x882dd0[_0x1d7a('0x17')][_0x1d7a('0x16')]);}})[_0x1d7a('0x18')](function(_0x19ef8d){logger[_0x1d7a('0x14')](_0x1d7a('0xf'),_0x2e3b1f,_0x19ef8d);_0x37f9dc(_0x19ef8d);});});}exports[_0x1d7a('0x19')]=function(_0x4bb1dd){var _0x5c7450=this;return new Promise(function(_0x9a05b3,_0xc37f04){return db[_0x1d7a('0x1a')][_0x1d7a('0x1b')]({'raw':_0x4bb1dd[_0x1d7a('0x1c')]?_0x4bb1dd[_0x1d7a('0x1c')][_0x1d7a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4bb1dd[_0x1d7a('0x1c')]?_0x4bb1dd['options']['where']||null:null,'attributes':_0x4bb1dd[_0x1d7a('0x1c')]?_0x4bb1dd[_0x1d7a('0x1c')]['attributes']||null:null,'limit':_0x4bb1dd['options']?_0x4bb1dd[_0x1d7a('0x1c')]['limit']||null:null,'include':_0x4bb1dd[_0x1d7a('0x1c')]?_0x4bb1dd[_0x1d7a('0x1c')][_0x1d7a('0x1e')]?_[_0x1d7a('0x1f')](_0x4bb1dd[_0x1d7a('0x1c')][_0x1d7a('0x1e')],function(_0x56a590){return{'model':db[_0x56a590[_0x1d7a('0x20')]],'as':_0x56a590['as'],'attributes':_0x56a590[_0x1d7a('0x21')],'include':_0x56a590[_0x1d7a('0x1e')]?_[_0x1d7a('0x1f')](_0x56a590['include'],function(_0x5d646f){return{'model':db[_0x5d646f[_0x1d7a('0x20')]],'as':_0x5d646f['as'],'attributes':_0x5d646f[_0x1d7a('0x21')],'include':_0x5d646f['include']?_[_0x1d7a('0x1f')](_0x5d646f[_0x1d7a('0x1e')],function(_0x493b9a){return{'model':db[_0x493b9a[_0x1d7a('0x20')]],'as':_0x493b9a['as'],'attributes':_0x493b9a[_0x1d7a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x207c63){logger[_0x1d7a('0x22')]('GetServicenowAccount',_0x4bb1dd);logger['debug'](_0x1d7a('0x19'),_0x4bb1dd,JSON[_0x1d7a('0x13')](_0x207c63));_0x9a05b3(_0x207c63);})['catch'](function(_0x5123ce){logger[_0x1d7a('0x14')]('GetServicenowAccount',_0x5123ce['message'],_0x4bb1dd);_0xc37f04(_0x5c7450[_0x1d7a('0x14')](0x1f4,_0x5123ce[_0x1d7a('0x16')]));});});};exports[_0x1d7a('0x23')]=function(_0x5a6272){var _0xb60925=this;return new Promise(function(_0x27d7b0,_0x88c666){return db[_0x1d7a('0x1a')][_0x1d7a('0x24')]({'raw':_0x5a6272[_0x1d7a('0x1c')]?_0x5a6272['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a6272[_0x1d7a('0x1c')]?_0x5a6272['options'][_0x1d7a('0x25')]||null:null,'attributes':_0x5a6272[_0x1d7a('0x1c')]?_0x5a6272[_0x1d7a('0x1c')][_0x1d7a('0x21')]||null:null,'include':_0x5a6272[_0x1d7a('0x1c')]?_0x5a6272['options'][_0x1d7a('0x1e')]?_[_0x1d7a('0x1f')](_0x5a6272[_0x1d7a('0x1c')][_0x1d7a('0x1e')],function(_0x215448){return{'model':db[_0x215448[_0x1d7a('0x20')]],'as':_0x215448['as'],'attributes':_0x215448[_0x1d7a('0x21')],'include':_0x215448[_0x1d7a('0x1e')]?_['map'](_0x215448[_0x1d7a('0x1e')],function(_0x38f362){return{'model':db[_0x38f362[_0x1d7a('0x20')]],'as':_0x38f362['as'],'attributes':_0x38f362[_0x1d7a('0x21')],'include':_0x38f362[_0x1d7a('0x1e')]?_['map'](_0x38f362[_0x1d7a('0x1e')],function(_0x460c4a){return{'model':db[_0x460c4a[_0x1d7a('0x20')]],'as':_0x460c4a['as'],'attributes':_0x460c4a[_0x1d7a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1d7a('0xe')](function(_0x1960fd){logger[_0x1d7a('0x22')]('ShowServicenowAccount',_0x5a6272);logger[_0x1d7a('0x11')](_0x1d7a('0x23'),_0x5a6272,JSON[_0x1d7a('0x13')](_0x1960fd));_0x27d7b0(_0x1960fd);})[_0x1d7a('0x18')](function(_0xa57cc){logger[_0x1d7a('0x14')](_0x1d7a('0x23'),_0xa57cc['message'],_0x5a6272);_0x88c666(_0xb60925[_0x1d7a('0x14')](0x1f4,_0xa57cc[_0x1d7a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d9215a8..16b44a3 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 _0x3c2c=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3ee493,_0x590554){var _0x43e84a=function(_0x1326d2){while(--_0x1326d2){_0x3ee493['push'](_0x3ee493['shift']());}};_0x43e84a(++_0x590554);}(_0x3c2c,0xe5));var _0xc3c2=function(_0x25e7a0,_0x11b8fb){_0x25e7a0=_0x25e7a0-0x0;var _0x3d2c9a=_0x3c2c[_0x25e7a0];return _0x3d2c9a;};'use strict';var multer=require(_0xc3c2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc3c2('0x1'));var router=express[_0xc3c2('0x2')]();var fs_extra=require(_0xc3c2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc3c2('0x4'));var config=require(_0xc3c2('0x5'));var controller=require(_0xc3c2('0x6'));router['get']('/',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0x8')]);router[_0xc3c2('0x9')](_0xc3c2('0xa'),auth[_0xc3c2('0x7')](),controller[_0xc3c2('0xb')]);router[_0xc3c2('0x9')](_0xc3c2('0xc'),auth['isAuthenticated'](),controller[_0xc3c2('0xd')]);router['get'](_0xc3c2('0xe'),auth[_0xc3c2('0x7')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0xf')]);router[_0xc3c2('0x10')]('/',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0x11')]);router[_0xc3c2('0x12')](_0xc3c2('0xa'),auth['isAuthenticated'](),controller[_0xc3c2('0x13')]);router[_0xc3c2('0x14')]('/:id',auth[_0xc3c2('0x7')](),controller[_0xc3c2('0x15')]);module[_0xc3c2('0x16')]=router; \ No newline at end of file +var _0x5a02=['isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x2549c7,_0x45ba52){var _0x26ca86=function(_0x59f015){while(--_0x59f015){_0x2549c7['push'](_0x2549c7['shift']());}};_0x26ca86(++_0x45ba52);}(_0x5a02,0xbe));var _0x25a0=function(_0x37862a,_0x2bc98e){_0x37862a=_0x37862a-0x0;var _0x5b0104=_0x5a02[_0x37862a];return _0x5b0104;};'use strict';var multer=require(_0x25a0('0x0'));var util=require(_0x25a0('0x1'));var path=require(_0x25a0('0x2'));var timeout=require('connect-timeout');var express=require(_0x25a0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x25a0('0x4'));var interaction=require(_0x25a0('0x5'));var config=require(_0x25a0('0x6'));var controller=require(_0x25a0('0x7'));router['get']('/',auth[_0x25a0('0x8')](),controller[_0x25a0('0x9')]);router['get'](_0x25a0('0xa'),auth[_0x25a0('0x8')](),controller[_0x25a0('0xb')]);router[_0x25a0('0xc')](_0x25a0('0xd'),auth[_0x25a0('0x8')](),controller[_0x25a0('0xe')]);router[_0x25a0('0xc')](_0x25a0('0xf'),auth[_0x25a0('0x8')](),controller['getSubjects']);router[_0x25a0('0xc')](_0x25a0('0x10'),auth['isAuthenticated'](),controller[_0x25a0('0x11')]);router[_0x25a0('0x12')]('/',auth[_0x25a0('0x8')](),controller[_0x25a0('0x13')]);router['put'](_0x25a0('0xa'),auth[_0x25a0('0x8')](),controller[_0x25a0('0x14')]);router['delete'](_0x25a0('0xa'),auth[_0x25a0('0x8')](),controller[_0x25a0('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 0d1395e..36070d8 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 _0x5332=['STRING','exports'];(function(_0x34ff00,_0x43ea29){var _0x19d141=function(_0x1f5d37){while(--_0x1f5d37){_0x34ff00['push'](_0x34ff00['shift']());}};_0x19d141(++_0x43ea29);}(_0x5332,0x10b));var _0x2533=function(_0x1e3f21,_0x35663a){_0x1e3f21=_0x1e3f21-0x0;var _0x412afe=_0x5332[_0x1e3f21];return _0x412afe;};'use strict';var Sequelize=require('sequelize');module[_0x2533('0x0')]={'name':{'type':Sequelize[_0x2533('0x1')]},'description':{'type':Sequelize[_0x2533('0x1')]}}; \ No newline at end of file +var _0x9630=['sequelize','exports','STRING'];(function(_0x1f4082,_0x266cfc){var _0x26aa57=function(_0x145817){while(--_0x145817){_0x1f4082['push'](_0x1f4082['shift']());}};_0x26aa57(++_0x266cfc);}(_0x9630,0x186));var _0x0963=function(_0x49af49,_0xe06a4c){_0x49af49=_0x49af49-0x0;var _0x52da19=_0x9630[_0x49af49];return _0x52da19;};'use strict';var Sequelize=require(_0x0963('0x0'));module[_0x0963('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0963('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 3ed511d..ce6f1b6 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 _0xe9f5=['index','ServicenowConfiguration','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','params','rawAttributes','length','find','catch','create','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x51e959,_0xab1417){var _0x4a77bd=function(_0x16049a){while(--_0x16049a){_0x51e959['push'](_0x51e959['shift']());}};_0x4a77bd(++_0xab1417);}(_0xe9f5,0x1b5));var _0x5e9f=function(_0x43c760,_0x5a0bf4){_0x43c760=_0x43c760-0x0;var _0x16a911=_0xe9f5[_0x43c760];return _0x16a911;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e9f('0x0'));var zipdir=require(_0x5e9f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e9f('0x2'));var moment=require(_0x5e9f('0x3'));var BPromise=require(_0x5e9f('0x4'));var Mustache=require(_0x5e9f('0x5'));var util=require(_0x5e9f('0x6'));var path=require('path');var sox=require(_0x5e9f('0x7'));var csv=require('to-csv');var ejs=require(_0x5e9f('0x8'));var fs=require('fs');var fs_extra=require(_0x5e9f('0x9'));var _=require('lodash');var squel=require(_0x5e9f('0xa'));var crypto=require(_0x5e9f('0xb'));var jsforce=require(_0x5e9f('0xc'));var deskjs=require(_0x5e9f('0xd'));var toCsv=require(_0x5e9f('0xe'));var querystring=require(_0x5e9f('0xf'));var Papa=require('papaparse');var Redis=require(_0x5e9f('0x10'));var authService=require(_0x5e9f('0x11'));var qs=require(_0x5e9f('0x12'));var as=require(_0x5e9f('0x13'));var hardwareService=require(_0x5e9f('0x14'));var logger=require(_0x5e9f('0x15'))(_0x5e9f('0x16'));var utils=require('../../config/utils');var config=require(_0x5e9f('0x17'));var licenseUtil=require(_0x5e9f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554fde,_0x179563){_0x179563=_0x179563||0xcc;return function(_0x388ae8){if(_0x388ae8){return _0x554fde[_0x5e9f('0x19')](_0x179563);}return _0x554fde[_0x5e9f('0x1a')](_0x179563)[_0x5e9f('0x1b')]();};}function respondWithResult(_0x212169,_0x47d516){_0x47d516=_0x47d516||0xc8;return function(_0x2ec75c){if(_0x2ec75c){return _0x212169[_0x5e9f('0x1a')](_0x47d516)[_0x5e9f('0x1c')](_0x2ec75c);}};}function respondWithFilteredResult(_0x1a328a,_0x4ac801){return function(_0x4dbb3d){if(_0x4dbb3d){var _0x19cb5a=typeof _0x4ac801['offset']==='undefined'&&typeof _0x4ac801[_0x5e9f('0x1d')]===_0x5e9f('0x1e');var _0x151637=_0x4dbb3d[_0x5e9f('0x1f')];var _0x1df6d8=_0x19cb5a?0x0:_0x4ac801[_0x5e9f('0x20')];var _0x490671=_0x19cb5a?_0x4dbb3d[_0x5e9f('0x1f')]:_0x4ac801[_0x5e9f('0x20')]+_0x4ac801[_0x5e9f('0x1d')];var _0x3891e0;if(_0x490671>=_0x151637){_0x490671=_0x151637;_0x3891e0=0xc8;}else{_0x3891e0=0xce;}_0x1a328a[_0x5e9f('0x1a')](_0x3891e0);return _0x1a328a[_0x5e9f('0x21')](_0x5e9f('0x22'),_0x1df6d8+'-'+_0x490671+'/'+_0x151637)[_0x5e9f('0x1c')](_0x4dbb3d);}return null;};}function patchUpdates(_0x392f70){return function(_0x10d7d5){try{jsonpatch[_0x5e9f('0x23')](_0x10d7d5,_0x392f70,!![]);}catch(_0xb0d59f){return BPromise[_0x5e9f('0x24')](_0xb0d59f);}return _0x10d7d5[_0x5e9f('0x25')]();};}function saveUpdates(_0x20c8db,_0x44a5ae){return function(_0x3410cd){if(_0x3410cd){return _0x3410cd[_0x5e9f('0x26')](_0x20c8db)[_0x5e9f('0x27')](function(_0x40cc48){return _0x40cc48;});}return null;};}function removeEntity(_0x466a1a,_0x1b44e1){return function(_0x300187){if(_0x300187){return _0x300187['destroy']()[_0x5e9f('0x27')](function(){_0x466a1a[_0x5e9f('0x1a')](0xcc)[_0x5e9f('0x1b')]();});}};}function handleEntityNotFound(_0xe210aa,_0x3f0b09){return function(_0x5dabed){if(!_0x5dabed){_0xe210aa['sendStatus'](0x194);}return _0x5dabed;};}function handleError(_0x22eebf,_0x1c699b){_0x1c699b=_0x1c699b||0x1f4;return function(_0x481dae){logger[_0x5e9f('0x28')](_0x481dae['stack']);if(_0x481dae['name']){delete _0x481dae[_0x5e9f('0x29')];}_0x22eebf[_0x5e9f('0x1a')](_0x1c699b)[_0x5e9f('0x2a')](_0x481dae);};}exports[_0x5e9f('0x2b')]=function(_0x5937dc,_0x55776f){var _0x4dad30={},_0x447826={},_0x475b93={'count':0x0,'rows':[]};var _0x42eadc=_['map'](db[_0x5e9f('0x2c')]['rawAttributes'],function(_0x199f77){return{'name':_0x199f77[_0x5e9f('0x2d')],'type':_0x199f77[_0x5e9f('0x2e')]['key']};});_0x447826[_0x5e9f('0x2f')]=_[_0x5e9f('0x30')](_0x42eadc,_0x5e9f('0x29'));_0x447826['query']=_[_0x5e9f('0x31')](_0x5937dc[_0x5e9f('0x32')]);_0x447826[_0x5e9f('0x33')]=_[_0x5e9f('0x34')](_0x447826[_0x5e9f('0x2f')],_0x447826[_0x5e9f('0x32')]);_0x4dad30[_0x5e9f('0x35')]=_[_0x5e9f('0x34')](_0x447826['model'],qs['fields'](_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x36')]));_0x4dad30['attributes']=_0x4dad30[_0x5e9f('0x35')]['length']?_0x4dad30[_0x5e9f('0x35')]:_0x447826[_0x5e9f('0x2f')];if(!_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x37')](_0x5e9f('0x38'))){_0x4dad30[_0x5e9f('0x1d')]=qs[_0x5e9f('0x1d')](_0x5937dc[_0x5e9f('0x32')]['limit']);_0x4dad30[_0x5e9f('0x20')]=qs[_0x5e9f('0x20')](_0x5937dc['query'][_0x5e9f('0x20')]);}_0x4dad30[_0x5e9f('0x39')]=qs[_0x5e9f('0x3a')](_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x3a')]);_0x4dad30['where']=qs[_0x5e9f('0x33')](_[_0x5e9f('0x3b')](_0x5937dc['query'],_0x447826[_0x5e9f('0x33')]),_0x42eadc);if(_0x5937dc['query'][_0x5e9f('0x3c')]){_0x4dad30[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x4dad30[_0x5e9f('0x3d')],{'$or':_['map'](_0x42eadc,function(_0x209f4c){if(_0x209f4c['type']!=='VIRTUAL'){var _0x1bdb94={};_0x1bdb94[_0x209f4c[_0x5e9f('0x29')]]={'$like':'%'+_0x5937dc['query'][_0x5e9f('0x3c')]+'%'};return _0x1bdb94;}})});}_0x4dad30=_['merge']({},_0x4dad30,_0x5937dc[_0x5e9f('0x3f')]);var _0x4f1e92={'where':_0x4dad30[_0x5e9f('0x3d')]};return db[_0x5e9f('0x2c')][_0x5e9f('0x1f')](_0x4f1e92)['then'](function(_0x5c4e75){_0x475b93[_0x5e9f('0x1f')]=_0x5c4e75;if(_0x5937dc[_0x5e9f('0x32')][_0x5e9f('0x40')]){_0x4dad30['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5e9f('0x41')](_0x4dad30);})[_0x5e9f('0x27')](function(_0x319a34){_0x475b93[_0x5e9f('0x42')]=_0x319a34;return _0x475b93;})[_0x5e9f('0x27')](respondWithFilteredResult(_0x55776f,_0x4dad30))['catch'](handleError(_0x55776f,null));};exports['show']=function(_0x3aea31,_0x3c55c1){var _0x10ccb4={'raw':![],'where':{'id':_0x3aea31[_0x5e9f('0x43')]['id']}},_0x5a0747={};_0x5a0747[_0x5e9f('0x2f')]=_['keys'](db[_0x5e9f('0x2c')][_0x5e9f('0x44')]);_0x5a0747[_0x5e9f('0x32')]=_[_0x5e9f('0x31')](_0x3aea31[_0x5e9f('0x32')]);_0x5a0747['filters']=_['intersection'](_0x5a0747[_0x5e9f('0x2f')],_0x5a0747[_0x5e9f('0x32')]);_0x10ccb4['attributes']=_['intersection'](_0x5a0747[_0x5e9f('0x2f')],qs[_0x5e9f('0x36')](_0x3aea31[_0x5e9f('0x32')][_0x5e9f('0x36')]));_0x10ccb4[_0x5e9f('0x35')]=_0x10ccb4[_0x5e9f('0x35')][_0x5e9f('0x45')]?_0x10ccb4[_0x5e9f('0x35')]:_0x5a0747[_0x5e9f('0x2f')];if(_0x3aea31[_0x5e9f('0x32')][_0x5e9f('0x40')]){_0x10ccb4['include']=[{'all':!![]}];}_0x10ccb4=_[_0x5e9f('0x3e')]({},_0x10ccb4,_0x3aea31[_0x5e9f('0x3f')]);return db[_0x5e9f('0x2c')][_0x5e9f('0x46')](_0x10ccb4)[_0x5e9f('0x27')](handleEntityNotFound(_0x3c55c1,null))[_0x5e9f('0x27')](respondWithResult(_0x3c55c1,null))[_0x5e9f('0x47')](handleError(_0x3c55c1,null));};exports['create']=function(_0x3754f4,_0x3cd43e){return db[_0x5e9f('0x2c')][_0x5e9f('0x48')](_0x3754f4[_0x5e9f('0x49')],{})[_0x5e9f('0x27')](respondWithResult(_0x3cd43e,0xc9))[_0x5e9f('0x47')](handleError(_0x3cd43e,null));};exports[_0x5e9f('0x26')]=function(_0x4235b7,_0x808955){if(_0x4235b7[_0x5e9f('0x49')]['id']){delete _0x4235b7[_0x5e9f('0x49')]['id'];}return db[_0x5e9f('0x2c')][_0x5e9f('0x46')]({'where':{'id':_0x4235b7[_0x5e9f('0x43')]['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x808955,null))[_0x5e9f('0x27')](saveUpdates(_0x4235b7['body'],null))[_0x5e9f('0x27')](respondWithResult(_0x808955,null))[_0x5e9f('0x47')](handleError(_0x808955,null));};exports[_0x5e9f('0x4a')]=function(_0x1dd22b,_0x2407c9){return db[_0x5e9f('0x2c')][_0x5e9f('0x46')]({'where':{'id':_0x1dd22b[_0x5e9f('0x43')]['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x2407c9,null))[_0x5e9f('0x27')](removeEntity(_0x2407c9,null))[_0x5e9f('0x47')](handleError(_0x2407c9,null));};exports[_0x5e9f('0x4b')]=function(_0x48204b,_0x6a2dfb,_0x44c509){var _0x1520a1={};var _0x3a7934={};var _0x152e53;var _0x1902ca;return db[_0x5e9f('0x2c')][_0x5e9f('0x4c')]({'where':{'id':_0x48204b['params']['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x6a2dfb,null))[_0x5e9f('0x27')](function(_0x5927ae){if(_0x5927ae){_0x152e53=_0x5927ae;_0x3a7934[_0x5e9f('0x2f')]=_[_0x5e9f('0x31')](db[_0x5e9f('0x4d')][_0x5e9f('0x44')]);_0x3a7934['query']=_[_0x5e9f('0x31')](_0x48204b[_0x5e9f('0x32')]);_0x3a7934[_0x5e9f('0x33')]=_[_0x5e9f('0x34')](_0x3a7934[_0x5e9f('0x2f')],_0x3a7934[_0x5e9f('0x32')]);_0x1520a1[_0x5e9f('0x35')]=_[_0x5e9f('0x34')](_0x3a7934[_0x5e9f('0x2f')],qs['fields'](_0x48204b['query'][_0x5e9f('0x36')]));_0x1520a1[_0x5e9f('0x35')]=_0x1520a1[_0x5e9f('0x35')][_0x5e9f('0x45')]?_0x1520a1[_0x5e9f('0x35')]:_0x3a7934['model'];_0x1520a1[_0x5e9f('0x39')]=qs['sort'](_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x3a')]);_0x1520a1[_0x5e9f('0x3d')]=qs['filters'](_['pick'](_0x48204b[_0x5e9f('0x32')],_0x3a7934[_0x5e9f('0x33')]));if(_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x3c')]){_0x1520a1[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x1520a1['where'],{'$or':_[_0x5e9f('0x30')](_0x1520a1[_0x5e9f('0x35')],function(_0x9d5fb6){var _0x2e067b={};_0x2e067b[_0x9d5fb6]={'$like':'%'+_0x48204b[_0x5e9f('0x32')]['filter']+'%'};return _0x2e067b;})});}_0x1520a1=_[_0x5e9f('0x3e')]({},_0x1520a1,_0x48204b[_0x5e9f('0x3f')]);return _0x152e53[_0x5e9f('0x4b')](_0x1520a1);}})[_0x5e9f('0x27')](function(_0x12096d){if(_0x12096d){_0x1902ca=_0x12096d['length'];if(!_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x37')](_0x5e9f('0x38'))){_0x1520a1['limit']=qs['limit'](_0x48204b['query']['limit']);_0x1520a1[_0x5e9f('0x20')]=qs[_0x5e9f('0x20')](_0x48204b[_0x5e9f('0x32')][_0x5e9f('0x20')]);}return _0x152e53['getFields'](_0x1520a1);}})['then'](function(_0x3b2c6a){if(_0x3b2c6a){return _0x3b2c6a?{'count':_0x1902ca,'rows':_0x3b2c6a}:null;}})[_0x5e9f('0x27')](respondWithResult(_0x6a2dfb,null))[_0x5e9f('0x47')](handleError(_0x6a2dfb,null));};exports['getSubjects']=function(_0x4f5fe1,_0x5cfef1,_0x3fa4e8){var _0x3e28d6={};var _0x4419f0={};var _0x4c1c1f;var _0x3a1de9;return db['ServicenowConfiguration'][_0x5e9f('0x4c')]({'where':{'id':_0x4f5fe1[_0x5e9f('0x43')]['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x5cfef1,null))[_0x5e9f('0x27')](function(_0x2ea1d7){if(_0x2ea1d7){_0x4c1c1f=_0x2ea1d7;_0x4419f0['model']=_[_0x5e9f('0x31')](db[_0x5e9f('0x4d')][_0x5e9f('0x44')]);_0x4419f0[_0x5e9f('0x32')]=_[_0x5e9f('0x31')](_0x4f5fe1[_0x5e9f('0x32')]);_0x4419f0['filters']=_['intersection'](_0x4419f0[_0x5e9f('0x2f')],_0x4419f0[_0x5e9f('0x32')]);_0x3e28d6[_0x5e9f('0x35')]=_['intersection'](_0x4419f0['model'],qs['fields'](_0x4f5fe1[_0x5e9f('0x32')]['fields']));_0x3e28d6['attributes']=_0x3e28d6[_0x5e9f('0x35')]['length']?_0x3e28d6['attributes']:_0x4419f0[_0x5e9f('0x2f')];_0x3e28d6[_0x5e9f('0x39')]=qs[_0x5e9f('0x3a')](_0x4f5fe1[_0x5e9f('0x32')][_0x5e9f('0x3a')]);_0x3e28d6[_0x5e9f('0x3d')]=qs[_0x5e9f('0x33')](_[_0x5e9f('0x3b')](_0x4f5fe1[_0x5e9f('0x32')],_0x4419f0['filters']));if(_0x4f5fe1[_0x5e9f('0x32')][_0x5e9f('0x3c')]){_0x3e28d6[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x3e28d6[_0x5e9f('0x3d')],{'$or':_['map'](_0x3e28d6[_0x5e9f('0x35')],function(_0x396d88){var _0x47abd7={};_0x47abd7[_0x396d88]={'$like':'%'+_0x4f5fe1[_0x5e9f('0x32')]['filter']+'%'};return _0x47abd7;})});}_0x3e28d6=_[_0x5e9f('0x3e')]({},_0x3e28d6,_0x4f5fe1[_0x5e9f('0x3f')]);return _0x4c1c1f['getSubjects'](_0x3e28d6);}})[_0x5e9f('0x27')](function(_0x3e9571){if(_0x3e9571){_0x3a1de9=_0x3e9571[_0x5e9f('0x45')];if(!_0x4f5fe1['query'][_0x5e9f('0x37')](_0x5e9f('0x38'))){_0x3e28d6[_0x5e9f('0x1d')]=qs[_0x5e9f('0x1d')](_0x4f5fe1[_0x5e9f('0x32')][_0x5e9f('0x1d')]);_0x3e28d6[_0x5e9f('0x20')]=qs['offset'](_0x4f5fe1['query'][_0x5e9f('0x20')]);}return _0x4c1c1f[_0x5e9f('0x4e')](_0x3e28d6);}})[_0x5e9f('0x27')](function(_0x30d57c){if(_0x30d57c){return _0x30d57c?{'count':_0x3a1de9,'rows':_0x30d57c}:null;}})[_0x5e9f('0x27')](respondWithResult(_0x5cfef1,null))[_0x5e9f('0x47')](handleError(_0x5cfef1,null));};exports[_0x5e9f('0x4f')]=function(_0x372e87,_0x30024f,_0x32f7e4){var _0x598844={};var _0x417bc0={};var _0x18134b;var _0x321b79;return db[_0x5e9f('0x2c')]['findOne']({'where':{'id':_0x372e87['params']['id']}})[_0x5e9f('0x27')](handleEntityNotFound(_0x30024f,null))[_0x5e9f('0x27')](function(_0x1c6a4d){if(_0x1c6a4d){_0x18134b=_0x1c6a4d;_0x417bc0['model']=_['keys'](db[_0x5e9f('0x4d')][_0x5e9f('0x44')]);_0x417bc0[_0x5e9f('0x32')]=_[_0x5e9f('0x31')](_0x372e87[_0x5e9f('0x32')]);_0x417bc0[_0x5e9f('0x33')]=_[_0x5e9f('0x34')](_0x417bc0['model'],_0x417bc0[_0x5e9f('0x32')]);_0x598844[_0x5e9f('0x35')]=_[_0x5e9f('0x34')](_0x417bc0[_0x5e9f('0x2f')],qs[_0x5e9f('0x36')](_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x36')]));_0x598844[_0x5e9f('0x35')]=_0x598844[_0x5e9f('0x35')][_0x5e9f('0x45')]?_0x598844[_0x5e9f('0x35')]:_0x417bc0['model'];_0x598844['order']=qs['sort'](_0x372e87[_0x5e9f('0x32')]['sort']);_0x598844[_0x5e9f('0x3d')]=qs[_0x5e9f('0x33')](_[_0x5e9f('0x3b')](_0x372e87[_0x5e9f('0x32')],_0x417bc0[_0x5e9f('0x33')]));if(_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x3c')]){_0x598844[_0x5e9f('0x3d')]=_[_0x5e9f('0x3e')](_0x598844[_0x5e9f('0x3d')],{'$or':_[_0x5e9f('0x30')](_0x598844['attributes'],function(_0x2118ab){var _0x50a5ec={};_0x50a5ec[_0x2118ab]={'$like':'%'+_0x372e87['query'][_0x5e9f('0x3c')]+'%'};return _0x50a5ec;})});}_0x598844=_[_0x5e9f('0x3e')]({},_0x598844,_0x372e87[_0x5e9f('0x3f')]);return _0x18134b[_0x5e9f('0x4f')](_0x598844);}})[_0x5e9f('0x27')](function(_0x241371){if(_0x241371){_0x321b79=_0x241371['length'];if(!_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x37')]('nolimit')){_0x598844[_0x5e9f('0x1d')]=qs[_0x5e9f('0x1d')](_0x372e87[_0x5e9f('0x32')][_0x5e9f('0x1d')]);_0x598844[_0x5e9f('0x20')]=qs[_0x5e9f('0x20')](_0x372e87[_0x5e9f('0x32')]['offset']);}return _0x18134b['getDescriptions'](_0x598844);}})[_0x5e9f('0x27')](function(_0x122315){if(_0x122315){return _0x122315?{'count':_0x321b79,'rows':_0x122315}:null;}})[_0x5e9f('0x27')](respondWithResult(_0x30024f,null))[_0x5e9f('0x47')](handleError(_0x30024f,null));}; \ No newline at end of file +var _0xda84=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','end','error','stack','name','map','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowConfiguration','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getFields','findOne','ServicenowField','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x23665b,_0xad5b79){var _0x399298=function(_0x286aa2){while(--_0x286aa2){_0x23665b['push'](_0x23665b['shift']());}};_0x399298(++_0xad5b79);}(_0xda84,0xe3));var _0x4da8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xda84[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x4da8('0x0'));var rimraf=require(_0x4da8('0x1'));var zipdir=require(_0x4da8('0x2'));var jsonpatch=require(_0x4da8('0x3'));var rp=require(_0x4da8('0x4'));var moment=require(_0x4da8('0x5'));var BPromise=require(_0x4da8('0x6'));var Mustache=require('mustache');var util=require(_0x4da8('0x7'));var path=require(_0x4da8('0x8'));var sox=require(_0x4da8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4da8('0xa'));var _=require(_0x4da8('0xb'));var squel=require(_0x4da8('0xc'));var crypto=require(_0x4da8('0xd'));var jsforce=require(_0x4da8('0xe'));var deskjs=require(_0x4da8('0xf'));var toCsv=require(_0x4da8('0x10'));var querystring=require(_0x4da8('0x11'));var Papa=require(_0x4da8('0x12'));var Redis=require(_0x4da8('0x13'));var authService=require(_0x4da8('0x14'));var qs=require(_0x4da8('0x15'));var as=require(_0x4da8('0x16'));var hardwareService=require(_0x4da8('0x17'));var logger=require(_0x4da8('0x18'))(_0x4da8('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4da8('0x1a'));var db=require(_0x4da8('0x1b'))['db'];function respondWithStatusCode(_0x547523,_0x488f05){_0x488f05=_0x488f05||0xcc;return function(_0x6dcd16){if(_0x6dcd16){return _0x547523['sendStatus'](_0x488f05);}return _0x547523[_0x4da8('0x1c')](_0x488f05)['end']();};}function respondWithResult(_0x4ab1cd,_0x11cc9a){_0x11cc9a=_0x11cc9a||0xc8;return function(_0x53eb0b){if(_0x53eb0b){return _0x4ab1cd[_0x4da8('0x1c')](_0x11cc9a)[_0x4da8('0x1d')](_0x53eb0b);}};}function respondWithFilteredResult(_0x201ed1,_0x545365){return function(_0x501095){if(_0x501095){var _0x145f33=typeof _0x545365[_0x4da8('0x1e')]===_0x4da8('0x1f')&&typeof _0x545365[_0x4da8('0x20')]===_0x4da8('0x1f');var _0xd2bf90=_0x501095['count'];var _0x3367f6=_0x145f33?0x0:_0x545365['offset'];var _0x1d44f0=_0x145f33?_0x501095['count']:_0x545365[_0x4da8('0x1e')]+_0x545365[_0x4da8('0x20')];var _0x18ae85;if(_0x1d44f0>=_0xd2bf90){_0x1d44f0=_0xd2bf90;_0x18ae85=0xc8;}else{_0x18ae85=0xce;}_0x201ed1[_0x4da8('0x1c')](_0x18ae85);return _0x201ed1['set'](_0x4da8('0x21'),_0x3367f6+'-'+_0x1d44f0+'/'+_0xd2bf90)[_0x4da8('0x1d')](_0x501095);}return null;};}function patchUpdates(_0xaf7bac){return function(_0x34fde3){try{jsonpatch['apply'](_0x34fde3,_0xaf7bac,!![]);}catch(_0x580836){return BPromise[_0x4da8('0x22')](_0x580836);}return _0x34fde3[_0x4da8('0x23')]();};}function saveUpdates(_0x182bc4,_0x38250f){return function(_0x5eea0d){if(_0x5eea0d){return _0x5eea0d[_0x4da8('0x24')](_0x182bc4)[_0x4da8('0x25')](function(_0x28cf88){return _0x28cf88;});}return null;};}function removeEntity(_0x58058d,_0x1d3294){return function(_0x1bfde6){if(_0x1bfde6){return _0x1bfde6['destroy']()[_0x4da8('0x25')](function(){_0x58058d[_0x4da8('0x1c')](0xcc)[_0x4da8('0x26')]();});}};}function handleEntityNotFound(_0x1b7a37,_0x58d647){return function(_0x50e79a){if(!_0x50e79a){_0x1b7a37['sendStatus'](0x194);}return _0x50e79a;};}function handleError(_0x476f11,_0x1c8c5a){_0x1c8c5a=_0x1c8c5a||0x1f4;return function(_0xe70c7f){logger[_0x4da8('0x27')](_0xe70c7f[_0x4da8('0x28')]);if(_0xe70c7f[_0x4da8('0x29')]){delete _0xe70c7f[_0x4da8('0x29')];}_0x476f11[_0x4da8('0x1c')](_0x1c8c5a)['send'](_0xe70c7f);};}exports['index']=function(_0x3c3cfe,_0x3b8bc4){var _0x1ed7ba={},_0x5f257c={},_0x5f3f7a={'count':0x0,'rows':[]};var _0x49aaab=_[_0x4da8('0x2a')](db['ServicenowConfiguration']['rawAttributes'],function(_0xc70bfd){return{'name':_0xc70bfd['fieldName'],'type':_0xc70bfd[_0x4da8('0x2b')][_0x4da8('0x2c')]};});_0x5f257c[_0x4da8('0x2d')]=_[_0x4da8('0x2a')](_0x49aaab,'name');_0x5f257c['query']=_[_0x4da8('0x2e')](_0x3c3cfe['query']);_0x5f257c[_0x4da8('0x2f')]=_[_0x4da8('0x30')](_0x5f257c['model'],_0x5f257c[_0x4da8('0x31')]);_0x1ed7ba[_0x4da8('0x32')]=_['intersection'](_0x5f257c[_0x4da8('0x2d')],qs[_0x4da8('0x33')](_0x3c3cfe['query'][_0x4da8('0x33')]));_0x1ed7ba[_0x4da8('0x32')]=_0x1ed7ba[_0x4da8('0x32')][_0x4da8('0x34')]?_0x1ed7ba[_0x4da8('0x32')]:_0x5f257c[_0x4da8('0x2d')];if(!_0x3c3cfe[_0x4da8('0x31')][_0x4da8('0x35')](_0x4da8('0x36'))){_0x1ed7ba[_0x4da8('0x20')]=qs[_0x4da8('0x20')](_0x3c3cfe['query'][_0x4da8('0x20')]);_0x1ed7ba['offset']=qs[_0x4da8('0x1e')](_0x3c3cfe[_0x4da8('0x31')][_0x4da8('0x1e')]);}_0x1ed7ba['order']=qs[_0x4da8('0x37')](_0x3c3cfe[_0x4da8('0x31')][_0x4da8('0x37')]);_0x1ed7ba[_0x4da8('0x38')]=qs[_0x4da8('0x2f')](_[_0x4da8('0x39')](_0x3c3cfe[_0x4da8('0x31')],_0x5f257c[_0x4da8('0x2f')]),_0x49aaab);if(_0x3c3cfe[_0x4da8('0x31')][_0x4da8('0x3a')]){_0x1ed7ba['where']=_['merge'](_0x1ed7ba[_0x4da8('0x38')],{'$or':_[_0x4da8('0x2a')](_0x49aaab,function(_0x3e7adc){if(_0x3e7adc[_0x4da8('0x2b')]!==_0x4da8('0x3b')){var _0x54ebae={};_0x54ebae[_0x3e7adc[_0x4da8('0x29')]]={'$like':'%'+_0x3c3cfe[_0x4da8('0x31')][_0x4da8('0x3a')]+'%'};return _0x54ebae;}})});}_0x1ed7ba=_[_0x4da8('0x3c')]({},_0x1ed7ba,_0x3c3cfe[_0x4da8('0x3d')]);var _0x26ad31={'where':_0x1ed7ba['where']};return db[_0x4da8('0x3e')]['count'](_0x26ad31)[_0x4da8('0x25')](function(_0x44bd38){_0x5f3f7a[_0x4da8('0x3f')]=_0x44bd38;if(_0x3c3cfe['query'][_0x4da8('0x40')]){_0x1ed7ba[_0x4da8('0x41')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x4da8('0x42')](_0x1ed7ba);})[_0x4da8('0x25')](function(_0xf5847d){_0x5f3f7a[_0x4da8('0x43')]=_0xf5847d;return _0x5f3f7a;})[_0x4da8('0x25')](respondWithFilteredResult(_0x3b8bc4,_0x1ed7ba))[_0x4da8('0x44')](handleError(_0x3b8bc4,null));};exports[_0x4da8('0x45')]=function(_0x2c0455,_0xb8476d){var _0xc77a34={'raw':![],'where':{'id':_0x2c0455[_0x4da8('0x46')]['id']}},_0x1f1107={};_0x1f1107[_0x4da8('0x2d')]=_[_0x4da8('0x2e')](db[_0x4da8('0x3e')][_0x4da8('0x47')]);_0x1f1107['query']=_['keys'](_0x2c0455[_0x4da8('0x31')]);_0x1f1107[_0x4da8('0x2f')]=_['intersection'](_0x1f1107[_0x4da8('0x2d')],_0x1f1107[_0x4da8('0x31')]);_0xc77a34[_0x4da8('0x32')]=_['intersection'](_0x1f1107[_0x4da8('0x2d')],qs[_0x4da8('0x33')](_0x2c0455['query'][_0x4da8('0x33')]));_0xc77a34[_0x4da8('0x32')]=_0xc77a34[_0x4da8('0x32')][_0x4da8('0x34')]?_0xc77a34['attributes']:_0x1f1107[_0x4da8('0x2d')];if(_0x2c0455['query'][_0x4da8('0x40')]){_0xc77a34[_0x4da8('0x41')]=[{'all':!![]}];}_0xc77a34=_[_0x4da8('0x3c')]({},_0xc77a34,_0x2c0455[_0x4da8('0x3d')]);return db['ServicenowConfiguration'][_0x4da8('0x48')](_0xc77a34)[_0x4da8('0x25')](handleEntityNotFound(_0xb8476d,null))[_0x4da8('0x25')](respondWithResult(_0xb8476d,null))[_0x4da8('0x44')](handleError(_0xb8476d,null));};exports[_0x4da8('0x49')]=function(_0x2f7e99,_0xa14e8f){return db[_0x4da8('0x3e')]['create'](_0x2f7e99['body'],{})[_0x4da8('0x25')](respondWithResult(_0xa14e8f,0xc9))[_0x4da8('0x44')](handleError(_0xa14e8f,null));};exports[_0x4da8('0x24')]=function(_0xde9424,_0x40d585){if(_0xde9424[_0x4da8('0x4a')]['id']){delete _0xde9424[_0x4da8('0x4a')]['id'];}return db[_0x4da8('0x3e')]['find']({'where':{'id':_0xde9424[_0x4da8('0x46')]['id']}})[_0x4da8('0x25')](handleEntityNotFound(_0x40d585,null))['then'](saveUpdates(_0xde9424[_0x4da8('0x4a')],null))['then'](respondWithResult(_0x40d585,null))[_0x4da8('0x44')](handleError(_0x40d585,null));};exports[_0x4da8('0x4b')]=function(_0x4b875f,_0x57a524){return db[_0x4da8('0x3e')]['find']({'where':{'id':_0x4b875f['params']['id']}})[_0x4da8('0x25')](handleEntityNotFound(_0x57a524,null))[_0x4da8('0x25')](removeEntity(_0x57a524,null))['catch'](handleError(_0x57a524,null));};exports[_0x4da8('0x4c')]=function(_0x2af9ad,_0xf8e88e,_0x20042f){var _0x24b6d0={};var _0x5177a6={};var _0x5f0aa6;var _0x203014;return db[_0x4da8('0x3e')][_0x4da8('0x4d')]({'where':{'id':_0x2af9ad[_0x4da8('0x46')]['id']}})[_0x4da8('0x25')](handleEntityNotFound(_0xf8e88e,null))[_0x4da8('0x25')](function(_0x35197f){if(_0x35197f){_0x5f0aa6=_0x35197f;_0x5177a6[_0x4da8('0x2d')]=_['keys'](db[_0x4da8('0x4e')][_0x4da8('0x47')]);_0x5177a6['query']=_['keys'](_0x2af9ad[_0x4da8('0x31')]);_0x5177a6[_0x4da8('0x2f')]=_[_0x4da8('0x30')](_0x5177a6[_0x4da8('0x2d')],_0x5177a6[_0x4da8('0x31')]);_0x24b6d0[_0x4da8('0x32')]=_[_0x4da8('0x30')](_0x5177a6[_0x4da8('0x2d')],qs[_0x4da8('0x33')](_0x2af9ad[_0x4da8('0x31')][_0x4da8('0x33')]));_0x24b6d0['attributes']=_0x24b6d0[_0x4da8('0x32')][_0x4da8('0x34')]?_0x24b6d0[_0x4da8('0x32')]:_0x5177a6[_0x4da8('0x2d')];_0x24b6d0['order']=qs['sort'](_0x2af9ad['query']['sort']);_0x24b6d0[_0x4da8('0x38')]=qs[_0x4da8('0x2f')](_[_0x4da8('0x39')](_0x2af9ad['query'],_0x5177a6['filters']));if(_0x2af9ad[_0x4da8('0x31')][_0x4da8('0x3a')]){_0x24b6d0[_0x4da8('0x38')]=_['merge'](_0x24b6d0[_0x4da8('0x38')],{'$or':_[_0x4da8('0x2a')](_0x24b6d0[_0x4da8('0x32')],function(_0x17003b){var _0x2951f6={};_0x2951f6[_0x17003b]={'$like':'%'+_0x2af9ad['query'][_0x4da8('0x3a')]+'%'};return _0x2951f6;})});}_0x24b6d0=_[_0x4da8('0x3c')]({},_0x24b6d0,_0x2af9ad[_0x4da8('0x3d')]);return _0x5f0aa6[_0x4da8('0x4c')](_0x24b6d0);}})['then'](function(_0x54c62f){if(_0x54c62f){_0x203014=_0x54c62f[_0x4da8('0x34')];if(!_0x2af9ad['query'][_0x4da8('0x35')](_0x4da8('0x36'))){_0x24b6d0['limit']=qs[_0x4da8('0x20')](_0x2af9ad[_0x4da8('0x31')][_0x4da8('0x20')]);_0x24b6d0[_0x4da8('0x1e')]=qs['offset'](_0x2af9ad[_0x4da8('0x31')][_0x4da8('0x1e')]);}return _0x5f0aa6[_0x4da8('0x4c')](_0x24b6d0);}})[_0x4da8('0x25')](function(_0x438de7){if(_0x438de7){return _0x438de7?{'count':_0x203014,'rows':_0x438de7}:null;}})[_0x4da8('0x25')](respondWithResult(_0xf8e88e,null))['catch'](handleError(_0xf8e88e,null));};exports[_0x4da8('0x4f')]=function(_0x47553d,_0x41aa7d,_0x2120a6){var _0x27ff27={};var _0x1e9428={};var _0x730c3b;var _0x234e8a;return db['ServicenowConfiguration'][_0x4da8('0x4d')]({'where':{'id':_0x47553d[_0x4da8('0x46')]['id']}})[_0x4da8('0x25')](handleEntityNotFound(_0x41aa7d,null))['then'](function(_0x2a502a){if(_0x2a502a){_0x730c3b=_0x2a502a;_0x1e9428[_0x4da8('0x2d')]=_[_0x4da8('0x2e')](db[_0x4da8('0x4e')][_0x4da8('0x47')]);_0x1e9428['query']=_[_0x4da8('0x2e')](_0x47553d[_0x4da8('0x31')]);_0x1e9428['filters']=_[_0x4da8('0x30')](_0x1e9428['model'],_0x1e9428[_0x4da8('0x31')]);_0x27ff27['attributes']=_[_0x4da8('0x30')](_0x1e9428[_0x4da8('0x2d')],qs['fields'](_0x47553d[_0x4da8('0x31')][_0x4da8('0x33')]));_0x27ff27['attributes']=_0x27ff27[_0x4da8('0x32')][_0x4da8('0x34')]?_0x27ff27['attributes']:_0x1e9428['model'];_0x27ff27[_0x4da8('0x50')]=qs['sort'](_0x47553d[_0x4da8('0x31')][_0x4da8('0x37')]);_0x27ff27[_0x4da8('0x38')]=qs[_0x4da8('0x2f')](_[_0x4da8('0x39')](_0x47553d[_0x4da8('0x31')],_0x1e9428[_0x4da8('0x2f')]));if(_0x47553d[_0x4da8('0x31')][_0x4da8('0x3a')]){_0x27ff27[_0x4da8('0x38')]=_[_0x4da8('0x3c')](_0x27ff27['where'],{'$or':_[_0x4da8('0x2a')](_0x27ff27[_0x4da8('0x32')],function(_0x434db3){var _0x2608e4={};_0x2608e4[_0x434db3]={'$like':'%'+_0x47553d[_0x4da8('0x31')][_0x4da8('0x3a')]+'%'};return _0x2608e4;})});}_0x27ff27=_[_0x4da8('0x3c')]({},_0x27ff27,_0x47553d[_0x4da8('0x3d')]);return _0x730c3b[_0x4da8('0x4f')](_0x27ff27);}})[_0x4da8('0x25')](function(_0x2d3d5d){if(_0x2d3d5d){_0x234e8a=_0x2d3d5d['length'];if(!_0x47553d['query'][_0x4da8('0x35')](_0x4da8('0x36'))){_0x27ff27[_0x4da8('0x20')]=qs[_0x4da8('0x20')](_0x47553d[_0x4da8('0x31')][_0x4da8('0x20')]);_0x27ff27[_0x4da8('0x1e')]=qs['offset'](_0x47553d[_0x4da8('0x31')][_0x4da8('0x1e')]);}return _0x730c3b['getSubjects'](_0x27ff27);}})[_0x4da8('0x25')](function(_0x5bca2f){if(_0x5bca2f){return _0x5bca2f?{'count':_0x234e8a,'rows':_0x5bca2f}:null;}})[_0x4da8('0x25')](respondWithResult(_0x41aa7d,null))[_0x4da8('0x44')](handleError(_0x41aa7d,null));};exports[_0x4da8('0x51')]=function(_0x122c8a,_0x3ac94c,_0xdfd0a7){var _0x38c045={};var _0x2ff0dd={};var _0x2b2ab6;var _0x100df2;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x122c8a[_0x4da8('0x46')]['id']}})[_0x4da8('0x25')](handleEntityNotFound(_0x3ac94c,null))[_0x4da8('0x25')](function(_0x532fb5){if(_0x532fb5){_0x2b2ab6=_0x532fb5;_0x2ff0dd[_0x4da8('0x2d')]=_[_0x4da8('0x2e')](db[_0x4da8('0x4e')][_0x4da8('0x47')]);_0x2ff0dd[_0x4da8('0x31')]=_[_0x4da8('0x2e')](_0x122c8a[_0x4da8('0x31')]);_0x2ff0dd[_0x4da8('0x2f')]=_[_0x4da8('0x30')](_0x2ff0dd['model'],_0x2ff0dd[_0x4da8('0x31')]);_0x38c045[_0x4da8('0x32')]=_[_0x4da8('0x30')](_0x2ff0dd[_0x4da8('0x2d')],qs[_0x4da8('0x33')](_0x122c8a[_0x4da8('0x31')][_0x4da8('0x33')]));_0x38c045[_0x4da8('0x32')]=_0x38c045[_0x4da8('0x32')]['length']?_0x38c045[_0x4da8('0x32')]:_0x2ff0dd[_0x4da8('0x2d')];_0x38c045[_0x4da8('0x50')]=qs[_0x4da8('0x37')](_0x122c8a[_0x4da8('0x31')]['sort']);_0x38c045[_0x4da8('0x38')]=qs[_0x4da8('0x2f')](_[_0x4da8('0x39')](_0x122c8a[_0x4da8('0x31')],_0x2ff0dd[_0x4da8('0x2f')]));if(_0x122c8a['query'][_0x4da8('0x3a')]){_0x38c045[_0x4da8('0x38')]=_[_0x4da8('0x3c')](_0x38c045[_0x4da8('0x38')],{'$or':_[_0x4da8('0x2a')](_0x38c045[_0x4da8('0x32')],function(_0x326557){var _0x232a67={};_0x232a67[_0x326557]={'$like':'%'+_0x122c8a[_0x4da8('0x31')][_0x4da8('0x3a')]+'%'};return _0x232a67;})});}_0x38c045=_[_0x4da8('0x3c')]({},_0x38c045,_0x122c8a[_0x4da8('0x3d')]);return _0x2b2ab6[_0x4da8('0x51')](_0x38c045);}})[_0x4da8('0x25')](function(_0x5347c0){if(_0x5347c0){_0x100df2=_0x5347c0[_0x4da8('0x34')];if(!_0x122c8a[_0x4da8('0x31')]['hasOwnProperty'](_0x4da8('0x36'))){_0x38c045[_0x4da8('0x20')]=qs[_0x4da8('0x20')](_0x122c8a[_0x4da8('0x31')][_0x4da8('0x20')]);_0x38c045[_0x4da8('0x1e')]=qs[_0x4da8('0x1e')](_0x122c8a['query'][_0x4da8('0x1e')]);}return _0x2b2ab6[_0x4da8('0x51')](_0x38c045);}})[_0x4da8('0x25')](function(_0x3248d3){if(_0x3248d3){return _0x3248d3?{'count':_0x100df2,'rows':_0x3248d3}:null;}})[_0x4da8('0x25')](respondWithResult(_0x3ac94c,null))[_0x4da8('0x44')](handleError(_0x3ac94c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4ddbe04..e0ab64f 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 _0x4ca7=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','./intServicenowConfiguration.attributes'];(function(_0x59336c,_0x256068){var _0x8204ca=function(_0x583f02){while(--_0x583f02){_0x59336c['push'](_0x59336c['shift']());}};_0x8204ca(++_0x256068);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x4f16ab,_0xd03883){_0x4f16ab=_0x4f16ab-0x0;var _0xd338d6=_0x4ca7[_0x4f16ab];return _0xd338d6;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var logger=require(_0x74ca('0x2'))('api');var moment=require(_0x74ca('0x3'));var BPromise=require(_0x74ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x74ca('0x5'));var config=require('../../config/environment');var attributes=require(_0x74ca('0x6'));module[_0x74ca('0x7')]=function(_0x4bccc5,_0x352e08){return _0x4bccc5['define'](_0x74ca('0x8'),attributes,{'tableName':_0x74ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42c3=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x38a792,_0x5a21a5){var _0x2cee7b=function(_0x3e9555){while(--_0x3e9555){_0x38a792['push'](_0x38a792['shift']());}};_0x2cee7b(++_0x5a21a5);}(_0x42c3,0x1bc));var _0x342c=function(_0x34477b,_0x54768){_0x34477b=_0x34477b-0x0;var _0x49d7ab=_0x42c3[_0x34477b];return _0x49d7ab;};'use strict';var _=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var logger=require(_0x342c('0x2'))('api');var moment=require(_0x342c('0x3'));var BPromise=require(_0x342c('0x4'));var rp=require(_0x342c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x342c('0x6'));var config=require('../../config/environment');var attributes=require(_0x342c('0x7'));module[_0x342c('0x8')]=function(_0x4c7ba3,_0x4edcfe){return _0x4c7ba3[_0x342c('0x9')](_0x342c('0xa'),attributes,{'tableName':_0x342c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index caab75b..683dc6b 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 _0x2a8e=['debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2245c7,_0x47951d){var _0x267daa=function(_0x21db85){while(--_0x21db85){_0x2245c7['push'](_0x2245c7['shift']());}};_0x267daa(++_0x47951d);}(_0x2a8e,0x132));var _0xe2a8=function(_0x556082,_0x52e510){_0x556082=_0x556082-0x0;var _0x9db1ae=_0x2a8e[_0x556082];return _0x9db1ae;};'use strict';var _=require(_0xe2a8('0x0'));var util=require('util');var moment=require(_0xe2a8('0x1'));var BPromise=require(_0xe2a8('0x2'));var rs=require(_0xe2a8('0x3'));var fs=require('fs');var Redis=require(_0xe2a8('0x4'));var db=require(_0xe2a8('0x5'))['db'];var utils=require(_0xe2a8('0x6'));var logger=require(_0xe2a8('0x7'))(_0xe2a8('0x8'));var config=require(_0xe2a8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe2a8('0xa')][_0xe2a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36c030,_0x1365b1,_0x92ce3c){return new BPromise(function(_0x125f11,_0x3e7346){return client[_0xe2a8('0xc')](_0x36c030,_0x92ce3c)['then'](function(_0x413f48){logger[_0xe2a8('0xd')](_0xe2a8('0xe'),_0x1365b1,_0xe2a8('0xf'));logger[_0xe2a8('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1365b1,_0xe2a8('0xf'),JSON[_0xe2a8('0x11')](_0x413f48));if(_0x413f48[_0xe2a8('0x12')]){if(_0x413f48[_0xe2a8('0x12')][_0xe2a8('0x13')]===0x1f4){logger[_0xe2a8('0x12')](_0xe2a8('0xe'),_0x1365b1,_0x413f48['error'][_0xe2a8('0x14')]);return _0x3e7346(_0x413f48[_0xe2a8('0x12')][_0xe2a8('0x14')]);}logger[_0xe2a8('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1365b1,_0x413f48[_0xe2a8('0x12')]['message']);return _0x125f11(_0x413f48[_0xe2a8('0x12')][_0xe2a8('0x14')]);}else{logger[_0xe2a8('0xd')](_0xe2a8('0xe'),_0x1365b1,_0xe2a8('0xf'));_0x125f11(_0x413f48[_0xe2a8('0x15')]['message']);}})[_0xe2a8('0x16')](function(_0x32e336){logger['error'](_0xe2a8('0xe'),_0x1365b1,_0x32e336);_0x3e7346(_0x32e336);});});} \ No newline at end of file +var _0x3e26=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','randomstring'];(function(_0x58bb2f,_0x2c065e){var _0x5cc6e5=function(_0x2806f4){while(--_0x2806f4){_0x58bb2f['push'](_0x58bb2f['shift']());}};_0x5cc6e5(++_0x2c065e);}(_0x3e26,0xed));var _0x63e2=function(_0x1624d6,_0x2158d8){_0x1624d6=_0x1624d6-0x0;var _0x2598c2=_0x3e26[_0x1624d6];return _0x2598c2;};'use strict';var _=require('lodash');var util=require(_0x63e2('0x0'));var moment=require('moment');var BPromise=require(_0x63e2('0x1'));var rs=require(_0x63e2('0x2'));var fs=require('fs');var Redis=require(_0x63e2('0x3'));var db=require(_0x63e2('0x4'))['db'];var utils=require(_0x63e2('0x5'));var logger=require(_0x63e2('0x6'))(_0x63e2('0x7'));var config=require(_0x63e2('0x8'));var jayson=require(_0x63e2('0x9'));var client=jayson[_0x63e2('0xa')][_0x63e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x154fc3,_0x348ae7,_0x4fba64){return new BPromise(function(_0xc46f1e,_0x3e3bb0){return client[_0x63e2('0xc')](_0x154fc3,_0x4fba64)[_0x63e2('0xd')](function(_0x1d6e5e){logger['info'](_0x63e2('0xe'),_0x348ae7,_0x63e2('0xf'));logger[_0x63e2('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x348ae7,_0x63e2('0xf'),JSON[_0x63e2('0x11')](_0x1d6e5e));if(_0x1d6e5e['error']){if(_0x1d6e5e[_0x63e2('0x12')][_0x63e2('0x13')]===0x1f4){logger['error'](_0x63e2('0xe'),_0x348ae7,_0x1d6e5e[_0x63e2('0x12')][_0x63e2('0x14')]);return _0x3e3bb0(_0x1d6e5e[_0x63e2('0x12')]['message']);}logger[_0x63e2('0x12')](_0x63e2('0xe'),_0x348ae7,_0x1d6e5e[_0x63e2('0x12')][_0x63e2('0x14')]);return _0xc46f1e(_0x1d6e5e['error'][_0x63e2('0x14')]);}else{logger[_0x63e2('0x15')](_0x63e2('0xe'),_0x348ae7,'request\x20sent');_0xc46f1e(_0x1d6e5e[_0x63e2('0x16')][_0x63e2('0x14')]);}})[_0x63e2('0x17')](function(_0x215b9a){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x348ae7,_0x215b9a);_0x3e3bb0(_0x215b9a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4118612..d79676d 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 _0x10f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x10f0,0xff));var _0x010f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x10f0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x010f('0x0'));var util=require(_0x010f('0x1'));var path=require('path');var timeout=require(_0x010f('0x2'));var express=require(_0x010f('0x3'));var router=express[_0x010f('0x4')]();var fs_extra=require(_0x010f('0x5'));var auth=require(_0x010f('0x6'));var interaction=require(_0x010f('0x7'));var config=require(_0x010f('0x8'));var controller=require(_0x010f('0x9'));router[_0x010f('0xa')]('/',auth[_0x010f('0xb')](),controller[_0x010f('0xc')]);router[_0x010f('0xa')](_0x010f('0xd'),auth['isAuthenticated'](),controller[_0x010f('0xe')]);router[_0x010f('0xf')]('/',auth[_0x010f('0xb')](),controller['create']);router[_0x010f('0x10')](_0x010f('0xd'),auth[_0x010f('0xb')](),controller[_0x010f('0x11')]);router[_0x010f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x010f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xed54=['update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0xf2e844,_0x221d95){var _0xcfc33c=function(_0x4387c2){while(--_0x4387c2){_0xf2e844['push'](_0xf2e844['shift']());}};_0xcfc33c(++_0x221d95);}(_0xed54,0x12e));var _0x4ed5=function(_0x5ec40f,_0x253aa5){_0x5ec40f=_0x5ec40f-0x0;var _0x2cdefc=_0xed54[_0x5ec40f];return _0x2cdefc;};'use strict';var multer=require(_0x4ed5('0x0'));var util=require('util');var path=require(_0x4ed5('0x1'));var timeout=require(_0x4ed5('0x2'));var express=require(_0x4ed5('0x3'));var router=express[_0x4ed5('0x4')]();var fs_extra=require(_0x4ed5('0x5'));var auth=require(_0x4ed5('0x6'));var interaction=require(_0x4ed5('0x7'));var config=require(_0x4ed5('0x8'));var controller=require(_0x4ed5('0x9'));router[_0x4ed5('0xa')]('/',auth[_0x4ed5('0xb')](),controller[_0x4ed5('0xc')]);router[_0x4ed5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4ed5('0xd')]);router[_0x4ed5('0xe')]('/',auth[_0x4ed5('0xb')](),controller[_0x4ed5('0xf')]);router[_0x4ed5('0x10')](_0x4ed5('0x11'),auth[_0x4ed5('0xb')](),controller[_0x4ed5('0x12')]);router[_0x4ed5('0x13')]('/:id',auth[_0x4ed5('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1b2adff..e296a99 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 _0x40e7=['customVariable','STRING','ENUM','BOOLEAN','exports','string'];(function(_0x4b5fc1,_0x22970c){var _0xedd64a=function(_0x46c3d8){while(--_0x46c3d8){_0x4b5fc1['push'](_0x4b5fc1['shift']());}};_0xedd64a(++_0x22970c);}(_0x40e7,0x1d8));var _0x740e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x40e7[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require('sequelize');module[_0x740e('0x0')]={'type':{'type':Sequelize['ENUM'](_0x740e('0x1'),'variable',_0x740e('0x2'),'keyValue','picklist'),'defaultValue':_0x740e('0x1')},'content':{'type':Sequelize[_0x740e('0x3')]},'key':{'type':Sequelize[_0x740e('0x3')]},'keyType':{'type':Sequelize[_0x740e('0x4')](_0x740e('0x1'),'variable',_0x740e('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x740e('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x740e('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0561=['string','variable','customVariable','picklist','STRING','exports','ENUM'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x0561,0x1e1));var _0x1056=function(_0x1f28bf,_0x541876){_0x1f28bf=_0x1f28bf-0x0;var _0x639f44=_0x0561[_0x1f28bf];return _0x639f44;};'use strict';var Sequelize=require('sequelize');module[_0x1056('0x0')]={'type':{'type':Sequelize[_0x1056('0x1')](_0x1056('0x2'),_0x1056('0x3'),_0x1056('0x4'),'keyValue',_0x1056('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1056('0x6')]},'key':{'type':Sequelize[_0x1056('0x6')]},'keyType':{'type':Sequelize[_0x1056('0x1')]('string',_0x1056('0x3'),_0x1056('0x4'))},'keyContent':{'type':Sequelize[_0x1056('0x6')]},'idField':{'type':Sequelize[_0x1056('0x6')]},'nameField':{'type':Sequelize[_0x1056('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1056('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 946da1f..d93533e 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 _0x9d18=['find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','ServicenowField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x10d25d,_0x3deecb){var _0x456218=function(_0x1e392c){while(--_0x1e392c){_0x10d25d['push'](_0x10d25d['shift']());}};_0x456218(++_0x3deecb);}(_0x9d18,0xe0));var _0x89d1=function(_0x2c13c9,_0x2d45b5){_0x2c13c9=_0x2c13c9-0x0;var _0x16280e=_0x9d18[_0x2c13c9];return _0x16280e;};'use strict';var emlformat=require(_0x89d1('0x0'));var rimraf=require(_0x89d1('0x1'));var zipdir=require(_0x89d1('0x2'));var jsonpatch=require(_0x89d1('0x3'));var rp=require(_0x89d1('0x4'));var moment=require(_0x89d1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x89d1('0x6'));var util=require('util');var path=require(_0x89d1('0x7'));var sox=require(_0x89d1('0x8'));var csv=require(_0x89d1('0x9'));var ejs=require(_0x89d1('0xa'));var fs=require('fs');var fs_extra=require(_0x89d1('0xb'));var _=require(_0x89d1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x89d1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x89d1('0x9'));var querystring=require(_0x89d1('0xe'));var Papa=require(_0x89d1('0xf'));var Redis=require(_0x89d1('0x10'));var authService=require(_0x89d1('0x11'));var qs=require(_0x89d1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89d1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x89d1('0x14'));var config=require(_0x89d1('0x15'));var licenseUtil=require(_0x89d1('0x16'));var db=require(_0x89d1('0x17'))['db'];function respondWithStatusCode(_0x27beed,_0x20ca04){_0x20ca04=_0x20ca04||0xcc;return function(_0x48a7c8){if(_0x48a7c8){return _0x27beed[_0x89d1('0x18')](_0x20ca04);}return _0x27beed[_0x89d1('0x19')](_0x20ca04)[_0x89d1('0x1a')]();};}function respondWithResult(_0x4040c2,_0x1ab632){_0x1ab632=_0x1ab632||0xc8;return function(_0x5932cc){if(_0x5932cc){return _0x4040c2['status'](_0x1ab632)[_0x89d1('0x1b')](_0x5932cc);}};}function respondWithFilteredResult(_0x23823b,_0x5d85ea){return function(_0x5e455c){if(_0x5e455c){var _0x5e4e43=typeof _0x5d85ea[_0x89d1('0x1c')]===_0x89d1('0x1d')&&typeof _0x5d85ea[_0x89d1('0x1e')]===_0x89d1('0x1d');var _0x28f095=_0x5e455c[_0x89d1('0x1f')];var _0x198b67=_0x5e4e43?0x0:_0x5d85ea[_0x89d1('0x1c')];var _0x4e5ce7=_0x5e4e43?_0x5e455c[_0x89d1('0x1f')]:_0x5d85ea['offset']+_0x5d85ea[_0x89d1('0x1e')];var _0xfffb40;if(_0x4e5ce7>=_0x28f095){_0x4e5ce7=_0x28f095;_0xfffb40=0xc8;}else{_0xfffb40=0xce;}_0x23823b[_0x89d1('0x19')](_0xfffb40);return _0x23823b[_0x89d1('0x20')](_0x89d1('0x21'),_0x198b67+'-'+_0x4e5ce7+'/'+_0x28f095)[_0x89d1('0x1b')](_0x5e455c);}return null;};}function patchUpdates(_0x5afacb){return function(_0x1b62c1){try{jsonpatch['apply'](_0x1b62c1,_0x5afacb,!![]);}catch(_0x4e5d8e){return BPromise[_0x89d1('0x22')](_0x4e5d8e);}return _0x1b62c1[_0x89d1('0x23')]();};}function saveUpdates(_0x14b972,_0x3c4d35){return function(_0x1e83be){if(_0x1e83be){return _0x1e83be[_0x89d1('0x24')](_0x14b972)[_0x89d1('0x25')](function(_0xb9c524){return _0xb9c524;});}return null;};}function removeEntity(_0x2864c9,_0x57b2a2){return function(_0x25b229){if(_0x25b229){return _0x25b229[_0x89d1('0x26')]()[_0x89d1('0x25')](function(){_0x2864c9[_0x89d1('0x19')](0xcc)[_0x89d1('0x1a')]();});}};}function handleEntityNotFound(_0x1c80e8,_0x1495f1){return function(_0x53c1de){if(!_0x53c1de){_0x1c80e8[_0x89d1('0x18')](0x194);}return _0x53c1de;};}function handleError(_0x14ac39,_0x5418dd){_0x5418dd=_0x5418dd||0x1f4;return function(_0x6bd2f9){logger['error'](_0x6bd2f9[_0x89d1('0x27')]);if(_0x6bd2f9[_0x89d1('0x28')]){delete _0x6bd2f9[_0x89d1('0x28')];}_0x14ac39[_0x89d1('0x19')](_0x5418dd)[_0x89d1('0x29')](_0x6bd2f9);};}exports[_0x89d1('0x2a')]=function(_0x1b24fd,_0x225d89){var _0x1b77df={},_0x5b6a99={},_0x10ab87={'count':0x0,'rows':[]};var _0x1adb3c=_['map'](db[_0x89d1('0x2b')][_0x89d1('0x2c')],function(_0x27ec7a){return{'name':_0x27ec7a[_0x89d1('0x2d')],'type':_0x27ec7a['type'][_0x89d1('0x2e')]};});_0x5b6a99[_0x89d1('0x2f')]=_[_0x89d1('0x30')](_0x1adb3c,_0x89d1('0x28'));_0x5b6a99[_0x89d1('0x31')]=_[_0x89d1('0x32')](_0x1b24fd[_0x89d1('0x31')]);_0x5b6a99[_0x89d1('0x33')]=_['intersection'](_0x5b6a99['model'],_0x5b6a99[_0x89d1('0x31')]);_0x1b77df[_0x89d1('0x34')]=_[_0x89d1('0x35')](_0x5b6a99['model'],qs['fields'](_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x36')]));_0x1b77df[_0x89d1('0x34')]=_0x1b77df[_0x89d1('0x34')][_0x89d1('0x37')]?_0x1b77df[_0x89d1('0x34')]:_0x5b6a99[_0x89d1('0x2f')];if(!_0x1b24fd['query']['hasOwnProperty'](_0x89d1('0x38'))){_0x1b77df['limit']=qs[_0x89d1('0x1e')](_0x1b24fd['query']['limit']);_0x1b77df[_0x89d1('0x1c')]=qs[_0x89d1('0x1c')](_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x1c')]);}_0x1b77df[_0x89d1('0x39')]=qs[_0x89d1('0x3a')](_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x3a')]);_0x1b77df[_0x89d1('0x3b')]=qs['filters'](_[_0x89d1('0x3c')](_0x1b24fd[_0x89d1('0x31')],_0x5b6a99['filters']),_0x1adb3c);if(_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x3d')]){_0x1b77df[_0x89d1('0x3b')]=_[_0x89d1('0x3e')](_0x1b77df[_0x89d1('0x3b')],{'$or':_[_0x89d1('0x30')](_0x1adb3c,function(_0x33af59){if(_0x33af59[_0x89d1('0x3f')]!==_0x89d1('0x40')){var _0x2b2c8a={};_0x2b2c8a[_0x33af59[_0x89d1('0x28')]]={'$like':'%'+_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x3d')]+'%'};return _0x2b2c8a;}})});}_0x1b77df=_['merge']({},_0x1b77df,_0x1b24fd[_0x89d1('0x41')]);var _0x22a149={'where':_0x1b77df[_0x89d1('0x3b')]};return db[_0x89d1('0x2b')][_0x89d1('0x1f')](_0x22a149)[_0x89d1('0x25')](function(_0x57d948){_0x10ab87[_0x89d1('0x1f')]=_0x57d948;if(_0x1b24fd[_0x89d1('0x31')][_0x89d1('0x42')]){_0x1b77df[_0x89d1('0x43')]=[{'all':!![]}];}return db[_0x89d1('0x2b')][_0x89d1('0x44')](_0x1b77df);})[_0x89d1('0x25')](function(_0x5de712){_0x10ab87[_0x89d1('0x45')]=_0x5de712;return _0x10ab87;})[_0x89d1('0x25')](respondWithFilteredResult(_0x225d89,_0x1b77df))[_0x89d1('0x46')](handleError(_0x225d89,null));};exports['show']=function(_0xf3e3e8,_0x50ce05){var _0xd58e61={'raw':!![],'where':{'id':_0xf3e3e8[_0x89d1('0x47')]['id']}},_0x514063={};_0x514063[_0x89d1('0x2f')]=_[_0x89d1('0x32')](db[_0x89d1('0x2b')][_0x89d1('0x2c')]);_0x514063[_0x89d1('0x31')]=_['keys'](_0xf3e3e8[_0x89d1('0x31')]);_0x514063[_0x89d1('0x33')]=_[_0x89d1('0x35')](_0x514063[_0x89d1('0x2f')],_0x514063['query']);_0xd58e61['attributes']=_['intersection'](_0x514063[_0x89d1('0x2f')],qs[_0x89d1('0x36')](_0xf3e3e8[_0x89d1('0x31')][_0x89d1('0x36')]));_0xd58e61[_0x89d1('0x34')]=_0xd58e61[_0x89d1('0x34')][_0x89d1('0x37')]?_0xd58e61[_0x89d1('0x34')]:_0x514063['model'];if(_0xf3e3e8[_0x89d1('0x31')]['includeAll']){_0xd58e61[_0x89d1('0x43')]=[{'all':!![]}];}_0xd58e61=_[_0x89d1('0x3e')]({},_0xd58e61,_0xf3e3e8[_0x89d1('0x41')]);return db[_0x89d1('0x2b')][_0x89d1('0x48')](_0xd58e61)[_0x89d1('0x25')](handleEntityNotFound(_0x50ce05,null))[_0x89d1('0x25')](respondWithResult(_0x50ce05,null))[_0x89d1('0x46')](handleError(_0x50ce05,null));};exports['create']=function(_0x1f809f,_0x3c3c53){return db[_0x89d1('0x2b')]['create'](_0x1f809f[_0x89d1('0x49')],{})[_0x89d1('0x25')](respondWithResult(_0x3c3c53,0xc9))[_0x89d1('0x46')](handleError(_0x3c3c53,null));};exports[_0x89d1('0x24')]=function(_0x49376b,_0x2311d1){if(_0x49376b[_0x89d1('0x49')]['id']){delete _0x49376b[_0x89d1('0x49')]['id'];}return db[_0x89d1('0x2b')][_0x89d1('0x48')]({'where':{'id':_0x49376b[_0x89d1('0x47')]['id']}})[_0x89d1('0x25')](handleEntityNotFound(_0x2311d1,null))[_0x89d1('0x25')](saveUpdates(_0x49376b['body'],null))[_0x89d1('0x25')](respondWithResult(_0x2311d1,null))['catch'](handleError(_0x2311d1,null));};exports[_0x89d1('0x26')]=function(_0x598f8d,_0x3d9ce){return db[_0x89d1('0x2b')][_0x89d1('0x48')]({'where':{'id':_0x598f8d['params']['id']}})[_0x89d1('0x25')](handleEntityNotFound(_0x3d9ce,null))[_0x89d1('0x25')](removeEntity(_0x3d9ce,null))[_0x89d1('0x46')](handleError(_0x3d9ce,null));}; \ No newline at end of file +var _0x5ead=['ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','map'];(function(_0x25842d,_0x30328a){var _0x2f73cb=function(_0x2ad70a){while(--_0x2ad70a){_0x25842d['push'](_0x25842d['shift']());}};_0x2f73cb(++_0x30328a);}(_0x5ead,0x67));var _0xd5ea=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5ead[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xd5ea('0x0'));var rimraf=require(_0xd5ea('0x1'));var zipdir=require(_0xd5ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5ea('0x3'));var moment=require(_0xd5ea('0x4'));var BPromise=require(_0xd5ea('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd5ea('0x6'));var sox=require(_0xd5ea('0x7'));var csv=require(_0xd5ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5ea('0x9'));var _=require(_0xd5ea('0xa'));var squel=require(_0xd5ea('0xb'));var crypto=require('crypto');var jsforce=require(_0xd5ea('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd5ea('0x8'));var querystring=require('querystring');var Papa=require(_0xd5ea('0xd'));var Redis=require('ioredis');var authService=require(_0xd5ea('0xe'));var qs=require(_0xd5ea('0xf'));var as=require(_0xd5ea('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5ea('0x11'))(_0xd5ea('0x12'));var utils=require(_0xd5ea('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd5ea('0x14'));var db=require(_0xd5ea('0x15'))['db'];function respondWithStatusCode(_0x1bb304,_0x46ea37){_0x46ea37=_0x46ea37||0xcc;return function(_0x768f7){if(_0x768f7){return _0x1bb304[_0xd5ea('0x16')](_0x46ea37);}return _0x1bb304[_0xd5ea('0x17')](_0x46ea37)[_0xd5ea('0x18')]();};}function respondWithResult(_0x452b9e,_0x5df2bc){_0x5df2bc=_0x5df2bc||0xc8;return function(_0x13d0c3){if(_0x13d0c3){return _0x452b9e[_0xd5ea('0x17')](_0x5df2bc)[_0xd5ea('0x19')](_0x13d0c3);}};}function respondWithFilteredResult(_0x2f57e7,_0x82ccf2){return function(_0x2b0d2c){if(_0x2b0d2c){var _0x233e81=typeof _0x82ccf2['offset']===_0xd5ea('0x1a')&&typeof _0x82ccf2[_0xd5ea('0x1b')]===_0xd5ea('0x1a');var _0x3182d0=_0x2b0d2c['count'];var _0xb33ee1=_0x233e81?0x0:_0x82ccf2['offset'];var _0x594b7c=_0x233e81?_0x2b0d2c[_0xd5ea('0x1c')]:_0x82ccf2[_0xd5ea('0x1d')]+_0x82ccf2[_0xd5ea('0x1b')];var _0x5877f2;if(_0x594b7c>=_0x3182d0){_0x594b7c=_0x3182d0;_0x5877f2=0xc8;}else{_0x5877f2=0xce;}_0x2f57e7[_0xd5ea('0x17')](_0x5877f2);return _0x2f57e7[_0xd5ea('0x1e')](_0xd5ea('0x1f'),_0xb33ee1+'-'+_0x594b7c+'/'+_0x3182d0)[_0xd5ea('0x19')](_0x2b0d2c);}return null;};}function patchUpdates(_0x13b391){return function(_0x500a28){try{jsonpatch[_0xd5ea('0x20')](_0x500a28,_0x13b391,!![]);}catch(_0x3d6cbf){return BPromise[_0xd5ea('0x21')](_0x3d6cbf);}return _0x500a28[_0xd5ea('0x22')]();};}function saveUpdates(_0x4d10a6,_0x5dfdb9){return function(_0x5ccbd0){if(_0x5ccbd0){return _0x5ccbd0[_0xd5ea('0x23')](_0x4d10a6)[_0xd5ea('0x24')](function(_0x43f2e0){return _0x43f2e0;});}return null;};}function removeEntity(_0x3d20cf,_0x37aa7a){return function(_0xf4df20){if(_0xf4df20){return _0xf4df20[_0xd5ea('0x25')]()['then'](function(){_0x3d20cf[_0xd5ea('0x17')](0xcc)[_0xd5ea('0x18')]();});}};}function handleEntityNotFound(_0x51ba9c,_0x5559f0){return function(_0x35e60c){if(!_0x35e60c){_0x51ba9c[_0xd5ea('0x16')](0x194);}return _0x35e60c;};}function handleError(_0x2e87e4,_0x47052f){_0x47052f=_0x47052f||0x1f4;return function(_0x26a541){logger[_0xd5ea('0x26')](_0x26a541['stack']);if(_0x26a541[_0xd5ea('0x27')]){delete _0x26a541[_0xd5ea('0x27')];}_0x2e87e4['status'](_0x47052f)['send'](_0x26a541);};}exports['index']=function(_0x1cbf73,_0xae30ae){var _0x45979e={},_0x3d6964={},_0x47866d={'count':0x0,'rows':[]};var _0x1920f0=_[_0xd5ea('0x28')](db[_0xd5ea('0x29')][_0xd5ea('0x2a')],function(_0x6977cf){return{'name':_0x6977cf[_0xd5ea('0x2b')],'type':_0x6977cf[_0xd5ea('0x2c')][_0xd5ea('0x2d')]};});_0x3d6964[_0xd5ea('0x2e')]=_[_0xd5ea('0x28')](_0x1920f0,_0xd5ea('0x27'));_0x3d6964[_0xd5ea('0x2f')]=_['keys'](_0x1cbf73['query']);_0x3d6964[_0xd5ea('0x30')]=_[_0xd5ea('0x31')](_0x3d6964[_0xd5ea('0x2e')],_0x3d6964[_0xd5ea('0x2f')]);_0x45979e[_0xd5ea('0x32')]=_[_0xd5ea('0x31')](_0x3d6964[_0xd5ea('0x2e')],qs['fields'](_0x1cbf73['query'][_0xd5ea('0x33')]));_0x45979e[_0xd5ea('0x32')]=_0x45979e[_0xd5ea('0x32')][_0xd5ea('0x34')]?_0x45979e[_0xd5ea('0x32')]:_0x3d6964[_0xd5ea('0x2e')];if(!_0x1cbf73[_0xd5ea('0x2f')][_0xd5ea('0x35')]('nolimit')){_0x45979e[_0xd5ea('0x1b')]=qs[_0xd5ea('0x1b')](_0x1cbf73[_0xd5ea('0x2f')][_0xd5ea('0x1b')]);_0x45979e[_0xd5ea('0x1d')]=qs[_0xd5ea('0x1d')](_0x1cbf73['query']['offset']);}_0x45979e[_0xd5ea('0x36')]=qs[_0xd5ea('0x37')](_0x1cbf73[_0xd5ea('0x2f')][_0xd5ea('0x37')]);_0x45979e[_0xd5ea('0x38')]=qs[_0xd5ea('0x30')](_[_0xd5ea('0x39')](_0x1cbf73[_0xd5ea('0x2f')],_0x3d6964[_0xd5ea('0x30')]),_0x1920f0);if(_0x1cbf73[_0xd5ea('0x2f')][_0xd5ea('0x3a')]){_0x45979e[_0xd5ea('0x38')]=_[_0xd5ea('0x3b')](_0x45979e['where'],{'$or':_[_0xd5ea('0x28')](_0x1920f0,function(_0x3b6a12){if(_0x3b6a12[_0xd5ea('0x2c')]!==_0xd5ea('0x3c')){var _0x5702f2={};_0x5702f2[_0x3b6a12[_0xd5ea('0x27')]]={'$like':'%'+_0x1cbf73['query']['filter']+'%'};return _0x5702f2;}})});}_0x45979e=_[_0xd5ea('0x3b')]({},_0x45979e,_0x1cbf73[_0xd5ea('0x3d')]);var _0xe0a1f={'where':_0x45979e[_0xd5ea('0x38')]};return db[_0xd5ea('0x29')][_0xd5ea('0x1c')](_0xe0a1f)[_0xd5ea('0x24')](function(_0x19ed9d){_0x47866d[_0xd5ea('0x1c')]=_0x19ed9d;if(_0x1cbf73[_0xd5ea('0x2f')]['includeAll']){_0x45979e[_0xd5ea('0x3e')]=[{'all':!![]}];}return db[_0xd5ea('0x29')]['findAll'](_0x45979e);})[_0xd5ea('0x24')](function(_0x1ff0ee){_0x47866d[_0xd5ea('0x3f')]=_0x1ff0ee;return _0x47866d;})[_0xd5ea('0x24')](respondWithFilteredResult(_0xae30ae,_0x45979e))[_0xd5ea('0x40')](handleError(_0xae30ae,null));};exports[_0xd5ea('0x41')]=function(_0x551dad,_0x4acc29){var _0x37a10f={'raw':!![],'where':{'id':_0x551dad[_0xd5ea('0x42')]['id']}},_0x259679={};_0x259679[_0xd5ea('0x2e')]=_[_0xd5ea('0x43')](db[_0xd5ea('0x29')]['rawAttributes']);_0x259679[_0xd5ea('0x2f')]=_[_0xd5ea('0x43')](_0x551dad['query']);_0x259679['filters']=_[_0xd5ea('0x31')](_0x259679[_0xd5ea('0x2e')],_0x259679['query']);_0x37a10f['attributes']=_[_0xd5ea('0x31')](_0x259679['model'],qs[_0xd5ea('0x33')](_0x551dad['query'][_0xd5ea('0x33')]));_0x37a10f['attributes']=_0x37a10f[_0xd5ea('0x32')][_0xd5ea('0x34')]?_0x37a10f['attributes']:_0x259679[_0xd5ea('0x2e')];if(_0x551dad[_0xd5ea('0x2f')][_0xd5ea('0x44')]){_0x37a10f[_0xd5ea('0x3e')]=[{'all':!![]}];}_0x37a10f=_[_0xd5ea('0x3b')]({},_0x37a10f,_0x551dad['options']);return db[_0xd5ea('0x29')][_0xd5ea('0x45')](_0x37a10f)[_0xd5ea('0x24')](handleEntityNotFound(_0x4acc29,null))[_0xd5ea('0x24')](respondWithResult(_0x4acc29,null))['catch'](handleError(_0x4acc29,null));};exports[_0xd5ea('0x46')]=function(_0x5ef88c,_0x23162a){return db[_0xd5ea('0x29')][_0xd5ea('0x46')](_0x5ef88c['body'],{})[_0xd5ea('0x24')](respondWithResult(_0x23162a,0xc9))[_0xd5ea('0x40')](handleError(_0x23162a,null));};exports['update']=function(_0x574fea,_0x29b81c){if(_0x574fea[_0xd5ea('0x47')]['id']){delete _0x574fea['body']['id'];}return db[_0xd5ea('0x29')][_0xd5ea('0x45')]({'where':{'id':_0x574fea['params']['id']}})['then'](handleEntityNotFound(_0x29b81c,null))['then'](saveUpdates(_0x574fea[_0xd5ea('0x47')],null))[_0xd5ea('0x24')](respondWithResult(_0x29b81c,null))['catch'](handleError(_0x29b81c,null));};exports[_0xd5ea('0x25')]=function(_0x5ddf37,_0xc96d86){return db['ServicenowField']['find']({'where':{'id':_0x5ddf37['params']['id']}})[_0xd5ea('0x24')](handleEntityNotFound(_0xc96d86,null))[_0xd5ea('0x24')](removeEntity(_0xc96d86,null))['catch'](handleError(_0xc96d86,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5127bd1..43d33bf 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 _0x2985=['api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2985,0x15e));var _0x5298=function(_0x5ce6eb,_0x29a90b){_0x5ce6eb=_0x5ce6eb-0x0;var _0x33c3cd=_0x2985[_0x5ce6eb];return _0x33c3cd;};'use strict';var _=require('lodash');var util=require(_0x5298('0x0'));var logger=require('../../config/logger')(_0x5298('0x1'));var moment=require(_0x5298('0x2'));var BPromise=require(_0x5298('0x3'));var rp=require(_0x5298('0x4'));var fs=require('fs');var path=require(_0x5298('0x5'));var rimraf=require('rimraf');var config=require(_0x5298('0x6'));var attributes=require(_0x5298('0x7'));module['exports']=function(_0x54d0,_0x1b86ee){return _0x54d0[_0x5298('0x8')]('ServicenowField',attributes,{'tableName':_0x5298('0x9'),'paranoid':![],'indexes':[{'name':_0x5298('0xa'),'fields':[_0x5298('0xb'),_0x5298('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x190e=['../../config/environment','exports','ServicenowField','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3f949f,_0xa4a85f){var _0x1e2132=function(_0x4a941e){while(--_0x4a941e){_0x3f949f['push'](_0x3f949f['shift']());}};_0x1e2132(++_0xa4a85f);}(_0x190e,0x101));var _0xe190=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x190e[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require(_0xe190('0x0'));var util=require('util');var logger=require(_0xe190('0x1'))(_0xe190('0x2'));var moment=require(_0xe190('0x3'));var BPromise=require(_0xe190('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe190('0x5'));var rimraf=require(_0xe190('0x6'));var config=require(_0xe190('0x7'));var attributes=require('./intServicenowField.attributes');module[_0xe190('0x8')]=function(_0x2fd297,_0x442e00){return _0x2fd297['define'](_0xe190('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xe190('0xa'),_0xe190('0xb')],'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 b2d459c..bd3fd25 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 _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x52acf5,_0x4267d3){var _0x4e06f6=function(_0x260ddc){while(--_0x260ddc){_0x52acf5['push'](_0x52acf5['shift']());}};_0x4e06f6(++_0x4267d3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x137602,_0xb977a6){_0x137602=_0x137602-0x0;var _0x4ac814=_0x9bde[_0x137602];return _0x4ac814;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_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);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 8849b6c..2217706 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1df5ab,_0x5aa9a7){var _0x265009=function(_0x2796d3){while(--_0x2796d3){_0x1df5ab['push'](_0x1df5ab['shift']());}};_0x265009(++_0x5aa9a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xe503ca,_0xce1832){var _0x59bf58=function(_0x168b0d){while(--_0x168b0d){_0xe503ca['push'](_0xe503ca['shift']());}};_0x59bf58(++_0xce1832);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 7588644..5a2cc09 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3becd9,_0x113b4a){var _0x33ad62=function(_0x31633c){while(--_0x31633c){_0x3becd9['push'](_0x3becd9['shift']());}};_0x33ad62(++_0x113b4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x49bdac,_0xe2166e){var _0xbfd0b5=function(_0x2684d4){while(--_0x2684d4){_0x49bdac['push'](_0x49bdac['shift']());}};_0xbfd0b5(++_0xe2166e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 2596f64..a009550 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 _0x05d0=['json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','SugarcrmAccount','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','channel','getDescriptions','Subjects','SugarcrmField','Descriptions','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','/service/v4_1/rest.php','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','format','%s%s','get_module_fields','Calls','values','module_fields','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0x05d0,0xcc));var _0x005d=function(_0x1f22b1,_0x1f40e0){_0x1f22b1=_0x1f22b1-0x0;var _0x55a497=_0x05d0[_0x1f22b1];return _0x55a497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x005d('0x0'));var zipdir=require(_0x005d('0x1'));var jsonpatch=require(_0x005d('0x2'));var rp=require(_0x005d('0x3'));var moment=require('moment');var BPromise=require(_0x005d('0x4'));var Mustache=require(_0x005d('0x5'));var util=require(_0x005d('0x6'));var path=require(_0x005d('0x7'));var sox=require(_0x005d('0x8'));var csv=require(_0x005d('0x9'));var ejs=require(_0x005d('0xa'));var fs=require('fs');var fs_extra=require(_0x005d('0xb'));var _=require(_0x005d('0xc'));var squel=require(_0x005d('0xd'));var crypto=require(_0x005d('0xe'));var jsforce=require(_0x005d('0xf'));var deskjs=require(_0x005d('0x10'));var toCsv=require(_0x005d('0x9'));var querystring=require(_0x005d('0x11'));var Papa=require(_0x005d('0x12'));var Redis=require('ioredis');var authService=require(_0x005d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x005d('0x14'));var logger=require(_0x005d('0x15'))('api');var utils=require(_0x005d('0x16'));var config=require(_0x005d('0x17'));var licenseUtil=require(_0x005d('0x18'));var db=require(_0x005d('0x19'))['db'];var integrations=require(_0x005d('0x1a'));function respondWithStatusCode(_0x4411bf,_0x1c9608){_0x1c9608=_0x1c9608||0xcc;return function(_0x4b93db){if(_0x4b93db){return _0x4411bf[_0x005d('0x1b')](_0x1c9608);}return _0x4411bf[_0x005d('0x1c')](_0x1c9608)[_0x005d('0x1d')]();};}function respondWithResult(_0x5c8a82,_0x20147d){_0x20147d=_0x20147d||0xc8;return function(_0x408287){if(_0x408287){return _0x5c8a82[_0x005d('0x1c')](_0x20147d)['json'](_0x408287);}};}function respondWithFilteredResult(_0x2af86c,_0x3683d9){return function(_0x3f0968){if(_0x3f0968){var _0x43cfe1=typeof _0x3683d9[_0x005d('0x1e')]===_0x005d('0x1f')&&typeof _0x3683d9[_0x005d('0x20')]===_0x005d('0x1f');var _0x13493a=_0x3f0968[_0x005d('0x21')];var _0x48d5cd=_0x43cfe1?0x0:_0x3683d9[_0x005d('0x1e')];var _0x40ffa7=_0x43cfe1?_0x3f0968[_0x005d('0x21')]:_0x3683d9[_0x005d('0x1e')]+_0x3683d9[_0x005d('0x20')];var _0x2d3505;if(_0x40ffa7>=_0x13493a){_0x40ffa7=_0x13493a;_0x2d3505=0xc8;}else{_0x2d3505=0xce;}_0x2af86c['status'](_0x2d3505);return _0x2af86c[_0x005d('0x22')](_0x005d('0x23'),_0x48d5cd+'-'+_0x40ffa7+'/'+_0x13493a)[_0x005d('0x24')](_0x3f0968);}return null;};}function patchUpdates(_0x3aef3c){return function(_0x5aa04c){try{jsonpatch[_0x005d('0x25')](_0x5aa04c,_0x3aef3c,!![]);}catch(_0x3e82cc){return BPromise[_0x005d('0x26')](_0x3e82cc);}return _0x5aa04c[_0x005d('0x27')]();};}function saveUpdates(_0x5a9869,_0x130f97){return function(_0x4996ae){if(_0x4996ae){return _0x4996ae[_0x005d('0x28')](_0x5a9869)[_0x005d('0x29')](function(_0x3f99ca){return _0x3f99ca;});}return null;};}function removeEntity(_0x34f58b,_0x2a7e1b){return function(_0x5d8a70){if(_0x5d8a70){return _0x5d8a70[_0x005d('0x2a')]()[_0x005d('0x29')](function(){_0x34f58b[_0x005d('0x1c')](0xcc)[_0x005d('0x1d')]();});}};}function handleEntityNotFound(_0x28cf28,_0x3a25ea){return function(_0x1ab0fc){if(!_0x1ab0fc){_0x28cf28['sendStatus'](0x194);}return _0x1ab0fc;};}function handleError(_0x53ded2,_0x10a896){_0x10a896=_0x10a896||0x1f4;return function(_0xe3dea6){logger[_0x005d('0x2b')](_0xe3dea6[_0x005d('0x2c')]);if(_0xe3dea6[_0x005d('0x2d')]){delete _0xe3dea6[_0x005d('0x2d')];}_0x53ded2[_0x005d('0x1c')](_0x10a896)[_0x005d('0x2e')](_0xe3dea6);};}exports[_0x005d('0x2f')]=function(_0x304fde,_0x4a44bc){var _0x51b50f={},_0x5b744f={},_0x354137={'count':0x0,'rows':[]};var _0x2c0b03=_[_0x005d('0x30')](db['SugarcrmAccount']['rawAttributes'],function(_0x20d04a){return{'name':_0x20d04a[_0x005d('0x31')],'type':_0x20d04a[_0x005d('0x32')]['key']};});_0x5b744f[_0x005d('0x33')]=_[_0x005d('0x30')](_0x2c0b03,_0x005d('0x2d'));_0x5b744f[_0x005d('0x34')]=_[_0x005d('0x35')](_0x304fde['query']);_0x5b744f[_0x005d('0x36')]=_[_0x005d('0x37')](_0x5b744f[_0x005d('0x33')],_0x5b744f[_0x005d('0x34')]);_0x51b50f[_0x005d('0x38')]=_[_0x005d('0x37')](_0x5b744f[_0x005d('0x33')],qs[_0x005d('0x39')](_0x304fde[_0x005d('0x34')][_0x005d('0x39')]));_0x51b50f[_0x005d('0x38')]=_0x51b50f[_0x005d('0x38')][_0x005d('0x3a')]?_0x51b50f['attributes']:_0x5b744f[_0x005d('0x33')];if(!_0x304fde[_0x005d('0x34')]['hasOwnProperty'](_0x005d('0x3b'))){_0x51b50f[_0x005d('0x20')]=qs[_0x005d('0x20')](_0x304fde[_0x005d('0x34')][_0x005d('0x20')]);_0x51b50f[_0x005d('0x1e')]=qs['offset'](_0x304fde['query'][_0x005d('0x1e')]);}_0x51b50f['order']=qs[_0x005d('0x3c')](_0x304fde['query']['sort']);_0x51b50f[_0x005d('0x3d')]=qs[_0x005d('0x36')](_[_0x005d('0x3e')](_0x304fde['query'],_0x5b744f[_0x005d('0x36')]),_0x2c0b03);if(_0x304fde[_0x005d('0x34')]['filter']){_0x51b50f[_0x005d('0x3d')]=_[_0x005d('0x3f')](_0x51b50f[_0x005d('0x3d')],{'$or':_[_0x005d('0x30')](_0x2c0b03,function(_0x3dbc83){if(_0x3dbc83[_0x005d('0x32')]!=='VIRTUAL'){var _0xf599fe={};_0xf599fe[_0x3dbc83[_0x005d('0x2d')]]={'$like':'%'+_0x304fde['query'][_0x005d('0x40')]+'%'};return _0xf599fe;}})});}_0x51b50f=_['merge']({},_0x51b50f,_0x304fde[_0x005d('0x41')]);var _0x3a04b9={'where':_0x51b50f[_0x005d('0x3d')]};return db['SugarcrmAccount']['count'](_0x3a04b9)[_0x005d('0x29')](function(_0x29726f){_0x354137[_0x005d('0x21')]=_0x29726f;if(_0x304fde[_0x005d('0x34')]['includeAll']){_0x51b50f['include']=[{'all':!![]}];}return db[_0x005d('0x42')]['findAll'](_0x51b50f);})[_0x005d('0x29')](function(_0x31b418){_0x354137[_0x005d('0x43')]=_0x31b418;return _0x354137;})['then'](respondWithFilteredResult(_0x4a44bc,_0x51b50f))[_0x005d('0x44')](handleError(_0x4a44bc,null));};exports[_0x005d('0x45')]=function(_0x455221,_0x1a2f52){var _0x4c55fa={'raw':![],'where':{'id':_0x455221[_0x005d('0x46')]['id']}},_0xe3d219={};_0xe3d219[_0x005d('0x33')]=_[_0x005d('0x35')](db[_0x005d('0x42')][_0x005d('0x47')]);_0xe3d219[_0x005d('0x34')]=_[_0x005d('0x35')](_0x455221[_0x005d('0x34')]);_0xe3d219[_0x005d('0x36')]=_['intersection'](_0xe3d219['model'],_0xe3d219[_0x005d('0x34')]);_0x4c55fa[_0x005d('0x38')]=_['intersection'](_0xe3d219[_0x005d('0x33')],qs[_0x005d('0x39')](_0x455221[_0x005d('0x34')][_0x005d('0x39')]));_0x4c55fa[_0x005d('0x38')]=_0x4c55fa[_0x005d('0x38')]['length']?_0x4c55fa[_0x005d('0x38')]:_0xe3d219[_0x005d('0x33')];if(_0x455221[_0x005d('0x34')][_0x005d('0x48')]){_0x4c55fa['include']=[{'all':!![]}];}_0x4c55fa=_['merge']({},_0x4c55fa,_0x455221[_0x005d('0x41')]);return db['SugarcrmAccount'][_0x005d('0x49')](_0x4c55fa)['then'](handleEntityNotFound(_0x1a2f52,null))[_0x005d('0x29')](respondWithResult(_0x1a2f52,null))[_0x005d('0x44')](handleError(_0x1a2f52,null));};exports['create']=function(_0x22f87b,_0x1f2529){return db['SugarcrmAccount'][_0x005d('0x4a')](_0x22f87b['body'],{})[_0x005d('0x29')](respondWithResult(_0x1f2529,0xc9))[_0x005d('0x44')](handleError(_0x1f2529,null));};exports[_0x005d('0x28')]=function(_0x36e626,_0x542421){if(_0x36e626[_0x005d('0x4b')]['id']){delete _0x36e626[_0x005d('0x4b')]['id'];}return db[_0x005d('0x42')]['find']({'where':{'id':_0x36e626[_0x005d('0x46')]['id']}})[_0x005d('0x29')](handleEntityNotFound(_0x542421,null))[_0x005d('0x29')](saveUpdates(_0x36e626[_0x005d('0x4b')],null))[_0x005d('0x29')](respondWithResult(_0x542421,null))['catch'](handleError(_0x542421,null));};exports['destroy']=function(_0x56a2b7,_0x127c51){return db[_0x005d('0x42')]['find']({'where':{'id':_0x56a2b7[_0x005d('0x46')]['id']}})['then'](handleEntityNotFound(_0x127c51,null))[_0x005d('0x29')](removeEntity(_0x127c51,null))[_0x005d('0x44')](handleError(_0x127c51,null));};exports[_0x005d('0x4c')]=function(_0x39576c,_0x11a41a,_0x4a7d49){var _0x4c5742={};var _0x3e4798={};var _0x5ba89;var _0x2e2b04;return db[_0x005d('0x42')][_0x005d('0x4d')]({'where':{'id':_0x39576c[_0x005d('0x46')]['id']}})[_0x005d('0x29')](handleEntityNotFound(_0x11a41a,null))[_0x005d('0x29')](function(_0x1a9955){if(_0x1a9955){_0x5ba89=_0x1a9955;_0x3e4798[_0x005d('0x33')]=_[_0x005d('0x35')](db[_0x005d('0x4e')][_0x005d('0x47')]);_0x3e4798[_0x005d('0x34')]=_['keys'](_0x39576c[_0x005d('0x34')]);_0x3e4798[_0x005d('0x36')]=_[_0x005d('0x37')](_0x3e4798[_0x005d('0x33')],_0x3e4798['query']);_0x4c5742['attributes']=_[_0x005d('0x37')](_0x3e4798[_0x005d('0x33')],qs[_0x005d('0x39')](_0x39576c[_0x005d('0x34')][_0x005d('0x39')]));_0x4c5742[_0x005d('0x38')]=_0x4c5742[_0x005d('0x38')][_0x005d('0x3a')]?_0x4c5742[_0x005d('0x38')]:_0x3e4798[_0x005d('0x33')];_0x4c5742[_0x005d('0x4f')]=qs[_0x005d('0x3c')](_0x39576c['query'][_0x005d('0x3c')]);_0x4c5742[_0x005d('0x3d')]=qs['filters'](_['pick'](_0x39576c[_0x005d('0x34')],_0x3e4798['filters']));if(_0x39576c['query'][_0x005d('0x40')]){_0x4c5742[_0x005d('0x3d')]=_['merge'](_0x4c5742[_0x005d('0x3d')],{'$or':_['map'](_0x4c5742[_0x005d('0x38')],function(_0x4d128a){var _0x4c659b={};_0x4c659b[_0x4d128a]={'$like':'%'+_0x39576c[_0x005d('0x34')][_0x005d('0x40')]+'%'};return _0x4c659b;})});}_0x4c5742=_[_0x005d('0x3f')]({},_0x4c5742,_0x39576c[_0x005d('0x41')]);return _0x5ba89['getConfigurations'](_0x4c5742);}})[_0x005d('0x29')](function(_0xb73bef){if(_0xb73bef){_0x2e2b04=_0xb73bef[_0x005d('0x3a')];if(!_0x39576c[_0x005d('0x34')][_0x005d('0x50')](_0x005d('0x3b'))){_0x4c5742['limit']=qs[_0x005d('0x20')](_0x39576c['query'][_0x005d('0x20')]);_0x4c5742[_0x005d('0x1e')]=qs[_0x005d('0x1e')](_0x39576c[_0x005d('0x34')][_0x005d('0x1e')]);}return _0x5ba89['getConfigurations'](_0x4c5742);}})[_0x005d('0x29')](function(_0x19d904){if(_0x19d904){return _0x19d904?{'count':_0x2e2b04,'rows':_0x19d904}:null;}})['then'](respondWithResult(_0x11a41a,null))[_0x005d('0x44')](handleError(_0x11a41a,null));};exports['addConfiguration']=function(_0x2a63cf,_0x3c5903,_0x1d5ff0){if(_0x2a63cf[_0x005d('0x4b')]['id']){delete _0x2a63cf[_0x005d('0x4b')]['id'];}return db[_0x005d('0x42')][_0x005d('0x4d')]({'where':{'id':_0x2a63cf[_0x005d('0x46')]['id']}})[_0x005d('0x29')](handleEntityNotFound(_0x3c5903,null))[_0x005d('0x29')](function(_0x494fb5){if(_0x494fb5){_0x2a63cf['body']['AccountId']=_0x494fb5['id'];_0x2a63cf['body']['Subjects']=integrations['getSubjects'](_0x2a63cf['body'][_0x005d('0x51')],_0x2a63cf[_0x005d('0x4b')]['type']);_0x2a63cf[_0x005d('0x4b')]['Descriptions']=integrations[_0x005d('0x52')](_0x2a63cf[_0x005d('0x4b')][_0x005d('0x51')],_0x2a63cf[_0x005d('0x4b')]['type']);return db[_0x005d('0x4e')][_0x005d('0x4a')](_0x2a63cf[_0x005d('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':_0x005d('0x53')},{'model':db[_0x005d('0x54')],'as':_0x005d('0x55')}]});}return null;})[_0x005d('0x29')](respondWithResult(_0x3c5903,null))[_0x005d('0x44')](handleError(_0x3c5903,null));};exports[_0x005d('0x56')]=function(_0x4c3f1d,_0x23adc4,_0x12400c){var _0x4d29e4='';var _0x4a86b2=['id','name',_0x005d('0x57'),'created_by',_0x005d('0x58'),'date_start',_0x005d('0x59'),_0x005d('0x5a'),_0x005d('0x5b'),_0x005d('0x5c'),_0x005d('0x5d'),_0x005d('0x5e')];return db['SugarcrmAccount'][_0x005d('0x4d')]({'where':{'id':_0x4c3f1d[_0x005d('0x46')]['id']},'attributes':['id',_0x005d('0x5f'),'password',_0x005d('0x60')]})['then'](handleEntityNotFound(_0x23adc4,null))[_0x005d('0x29')](function(_0x16a830){if(_0x16a830){_0x4d29e4=_0x16a830[_0x005d('0x60')];var _0x50e188=_0x4d29e4[_0x005d('0x61')](-0x1);if(_0x50e188==='/'){_0x4d29e4=_0x4d29e4[_0x005d('0x62')](0x0,_0x4d29e4[_0x005d('0x63')](_0x50e188));}return rp({'method':'POST','uri':util['format']('%s%s',_0x4d29e4,_0x005d('0x64')),'json':!![],'form':{'method':_0x005d('0x65'),'input_type':'JSON','response_type':_0x005d('0x66'),'rest_data':JSON[_0x005d('0x67')]({'user_auth':{'user_name':_0x16a830[_0x005d('0x5f')],'password':_0x16a830[_0x005d('0x68')],'encryption':'PLAIN'},'application':_0x005d('0x69')})}});}})[_0x005d('0x29')](function(_0x150ff7){if(_0x150ff7&&_0x150ff7[_0x005d('0x2d')]!=='Invalid\x20Login'&&_0x150ff7['name']!==_0x005d('0x6a')){return rp({'method':_0x005d('0x6b'),'uri':util[_0x005d('0x6c')](_0x005d('0x6d'),_0x4d29e4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x005d('0x6e'),'input_type':'JSON','response_type':_0x005d('0x66'),'rest_data':JSON[_0x005d('0x67')]({'session':_0x150ff7['id'],'module_name':_0x005d('0x6f')})}})[_0x005d('0x29')](function(_0x30174c){if(_0x30174c){var _0x3435a9=_[_0x005d('0x70')](_0x30174c[_0x005d('0x71')]);_['remove'](_0x3435a9,function(_0x329e58){return _0x4a86b2[_0x005d('0x72')](_0x329e58['name']);});return{'count':_0x3435a9[_0x005d('0x3a')],'rows':_[_0x005d('0x30')](_0x3435a9,function(_0x53dbcc){return{'id':_0x53dbcc[_0x005d('0x2d')],'name':_0x53dbcc['label'],'custom':_[_0x005d('0x73')](_0x53dbcc[_0x005d('0x2d')],'_c')?!![]:![],'options':_0x53dbcc['options']?_[_0x005d('0x30')](_[_0x005d('0x70')](_0x53dbcc[_0x005d('0x41')]),function(_0x5ec475){return{'name':_0x5ec475['value'],'value':_0x5ec475[_0x005d('0x2d')]};}):[]};})};}})[_0x005d('0x29')](respondWithResult(_0x23adc4,null))[_0x005d('0x44')](function(_0x171c0b){var _0x17a861=_0x4c3f1d[_0x005d('0x34')][_0x005d('0x74')]?0x1f4:_0x171c0b[_0x005d('0x75')]||0x1f4;logger['error'](_0x005d('0x76'),'getFields',_0x17a861,JSON['stringify'](_0x171c0b));delete _0x171c0b[_0x005d('0x2d')];if(_0x17a861===0x191){_0x17a861=0x190;}_0x23adc4[_0x005d('0x1c')](_0x17a861)[_0x005d('0x2e')](_0x4c3f1d['query']['test']?{'message':_0x005d('0x77'),'statusCode':_0x171c0b['statusCode']}:_0x171c0b);});}else{var _0x453254=0x1f4;_0x23adc4[_0x005d('0x1c')](_0x453254)[_0x005d('0x2e')]({'message':_0x005d('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xa5b2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','%s%s','get_module_fields','values','module_fields','remove','includes','label','test','statusCode','Wrong\x20credentials','eml-format'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0xa5b2,0x16d));var _0x2a5b=function(_0x37a3f3,_0x663b49){_0x37a3f3=_0x37a3f3-0x0;var _0x4da923=_0xa5b2[_0x37a3f3];return _0x4da923;};'use strict';var emlformat=require(_0x2a5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a5b('0x1'));var jsonpatch=require(_0x2a5b('0x2'));var rp=require(_0x2a5b('0x3'));var moment=require(_0x2a5b('0x4'));var BPromise=require(_0x2a5b('0x5'));var Mustache=require(_0x2a5b('0x6'));var util=require('util');var path=require(_0x2a5b('0x7'));var sox=require('sox');var csv=require(_0x2a5b('0x8'));var ejs=require(_0x2a5b('0x9'));var fs=require('fs');var fs_extra=require(_0x2a5b('0xa'));var _=require(_0x2a5b('0xb'));var squel=require(_0x2a5b('0xc'));var crypto=require(_0x2a5b('0xd'));var jsforce=require(_0x2a5b('0xe'));var deskjs=require(_0x2a5b('0xf'));var toCsv=require(_0x2a5b('0x8'));var querystring=require(_0x2a5b('0x10'));var Papa=require(_0x2a5b('0x11'));var Redis=require('ioredis');var authService=require(_0x2a5b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2a5b('0x13'));var hardwareService=require(_0x2a5b('0x14'));var logger=require(_0x2a5b('0x15'))(_0x2a5b('0x16'));var utils=require(_0x2a5b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2a5b('0x18'));var db=require(_0x2a5b('0x19'))['db'];var integrations=require(_0x2a5b('0x1a'));function respondWithStatusCode(_0x382b50,_0x5837ff){_0x5837ff=_0x5837ff||0xcc;return function(_0x1485e7){if(_0x1485e7){return _0x382b50[_0x2a5b('0x1b')](_0x5837ff);}return _0x382b50[_0x2a5b('0x1c')](_0x5837ff)[_0x2a5b('0x1d')]();};}function respondWithResult(_0x20c47e,_0x163499){_0x163499=_0x163499||0xc8;return function(_0x4803ec){if(_0x4803ec){return _0x20c47e[_0x2a5b('0x1c')](_0x163499)[_0x2a5b('0x1e')](_0x4803ec);}};}function respondWithFilteredResult(_0x2dd2ba,_0x47cad3){return function(_0x1f1723){if(_0x1f1723){var _0x3de6ba=typeof _0x47cad3['offset']===_0x2a5b('0x1f')&&typeof _0x47cad3[_0x2a5b('0x20')]===_0x2a5b('0x1f');var _0x3b54b5=_0x1f1723[_0x2a5b('0x21')];var _0x3f401e=_0x3de6ba?0x0:_0x47cad3[_0x2a5b('0x22')];var _0x323005=_0x3de6ba?_0x1f1723[_0x2a5b('0x21')]:_0x47cad3['offset']+_0x47cad3[_0x2a5b('0x20')];var _0xd50a92;if(_0x323005>=_0x3b54b5){_0x323005=_0x3b54b5;_0xd50a92=0xc8;}else{_0xd50a92=0xce;}_0x2dd2ba[_0x2a5b('0x1c')](_0xd50a92);return _0x2dd2ba[_0x2a5b('0x23')](_0x2a5b('0x24'),_0x3f401e+'-'+_0x323005+'/'+_0x3b54b5)[_0x2a5b('0x1e')](_0x1f1723);}return null;};}function patchUpdates(_0x323999){return function(_0x66037){try{jsonpatch[_0x2a5b('0x25')](_0x66037,_0x323999,!![]);}catch(_0x87c8bb){return BPromise['reject'](_0x87c8bb);}return _0x66037[_0x2a5b('0x26')]();};}function saveUpdates(_0xf45c51,_0x2408e4){return function(_0x2d2c50){if(_0x2d2c50){return _0x2d2c50[_0x2a5b('0x27')](_0xf45c51)['then'](function(_0x4caa00){return _0x4caa00;});}return null;};}function removeEntity(_0x356c66,_0x208279){return function(_0x355f7d){if(_0x355f7d){return _0x355f7d[_0x2a5b('0x28')]()[_0x2a5b('0x29')](function(){_0x356c66['status'](0xcc)[_0x2a5b('0x1d')]();});}};}function handleEntityNotFound(_0xce6d7b,_0xb6cd){return function(_0x3d88f6){if(!_0x3d88f6){_0xce6d7b[_0x2a5b('0x1b')](0x194);}return _0x3d88f6;};}function handleError(_0x458d92,_0x200230){_0x200230=_0x200230||0x1f4;return function(_0x7c74c0){logger[_0x2a5b('0x2a')](_0x7c74c0[_0x2a5b('0x2b')]);if(_0x7c74c0[_0x2a5b('0x2c')]){delete _0x7c74c0[_0x2a5b('0x2c')];}_0x458d92['status'](_0x200230)[_0x2a5b('0x2d')](_0x7c74c0);};}exports[_0x2a5b('0x2e')]=function(_0x5cc93f,_0x2fb016){var _0x1c59f5={},_0x4cc9df={},_0x2c40c4={'count':0x0,'rows':[]};var _0x78cc6=_['map'](db[_0x2a5b('0x2f')][_0x2a5b('0x30')],function(_0x331b93){return{'name':_0x331b93[_0x2a5b('0x31')],'type':_0x331b93[_0x2a5b('0x32')][_0x2a5b('0x33')]};});_0x4cc9df[_0x2a5b('0x34')]=_[_0x2a5b('0x35')](_0x78cc6,_0x2a5b('0x2c'));_0x4cc9df[_0x2a5b('0x36')]=_[_0x2a5b('0x37')](_0x5cc93f['query']);_0x4cc9df[_0x2a5b('0x38')]=_['intersection'](_0x4cc9df['model'],_0x4cc9df[_0x2a5b('0x36')]);_0x1c59f5[_0x2a5b('0x39')]=_[_0x2a5b('0x3a')](_0x4cc9df[_0x2a5b('0x34')],qs[_0x2a5b('0x3b')](_0x5cc93f[_0x2a5b('0x36')]['fields']));_0x1c59f5[_0x2a5b('0x39')]=_0x1c59f5[_0x2a5b('0x39')][_0x2a5b('0x3c')]?_0x1c59f5[_0x2a5b('0x39')]:_0x4cc9df[_0x2a5b('0x34')];if(!_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x3d')](_0x2a5b('0x3e'))){_0x1c59f5[_0x2a5b('0x20')]=qs[_0x2a5b('0x20')](_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x20')]);_0x1c59f5[_0x2a5b('0x22')]=qs['offset'](_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x22')]);}_0x1c59f5[_0x2a5b('0x3f')]=qs[_0x2a5b('0x40')](_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x40')]);_0x1c59f5['where']=qs[_0x2a5b('0x38')](_['pick'](_0x5cc93f['query'],_0x4cc9df[_0x2a5b('0x38')]),_0x78cc6);if(_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x41')]){_0x1c59f5[_0x2a5b('0x42')]=_[_0x2a5b('0x43')](_0x1c59f5[_0x2a5b('0x42')],{'$or':_[_0x2a5b('0x35')](_0x78cc6,function(_0x2c7f58){if(_0x2c7f58[_0x2a5b('0x32')]!==_0x2a5b('0x44')){var _0x3e2c02={};_0x3e2c02[_0x2c7f58[_0x2a5b('0x2c')]]={'$like':'%'+_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x41')]+'%'};return _0x3e2c02;}})});}_0x1c59f5=_['merge']({},_0x1c59f5,_0x5cc93f[_0x2a5b('0x45')]);var _0x313c3f={'where':_0x1c59f5['where']};return db[_0x2a5b('0x2f')][_0x2a5b('0x21')](_0x313c3f)[_0x2a5b('0x29')](function(_0x2b2bf9){_0x2c40c4[_0x2a5b('0x21')]=_0x2b2bf9;if(_0x5cc93f[_0x2a5b('0x36')][_0x2a5b('0x46')]){_0x1c59f5[_0x2a5b('0x47')]=[{'all':!![]}];}return db[_0x2a5b('0x2f')]['findAll'](_0x1c59f5);})[_0x2a5b('0x29')](function(_0x1c2662){_0x2c40c4[_0x2a5b('0x48')]=_0x1c2662;return _0x2c40c4;})[_0x2a5b('0x29')](respondWithFilteredResult(_0x2fb016,_0x1c59f5))[_0x2a5b('0x49')](handleError(_0x2fb016,null));};exports['show']=function(_0x5536d8,_0x415917){var _0x44f2e2={'raw':![],'where':{'id':_0x5536d8['params']['id']}},_0x1a6956={};_0x1a6956[_0x2a5b('0x34')]=_['keys'](db[_0x2a5b('0x2f')][_0x2a5b('0x30')]);_0x1a6956[_0x2a5b('0x36')]=_[_0x2a5b('0x37')](_0x5536d8[_0x2a5b('0x36')]);_0x1a6956['filters']=_[_0x2a5b('0x3a')](_0x1a6956[_0x2a5b('0x34')],_0x1a6956[_0x2a5b('0x36')]);_0x44f2e2['attributes']=_[_0x2a5b('0x3a')](_0x1a6956[_0x2a5b('0x34')],qs[_0x2a5b('0x3b')](_0x5536d8[_0x2a5b('0x36')][_0x2a5b('0x3b')]));_0x44f2e2[_0x2a5b('0x39')]=_0x44f2e2['attributes'][_0x2a5b('0x3c')]?_0x44f2e2['attributes']:_0x1a6956['model'];if(_0x5536d8[_0x2a5b('0x36')][_0x2a5b('0x46')]){_0x44f2e2[_0x2a5b('0x47')]=[{'all':!![]}];}_0x44f2e2=_[_0x2a5b('0x43')]({},_0x44f2e2,_0x5536d8[_0x2a5b('0x45')]);return db[_0x2a5b('0x2f')][_0x2a5b('0x4a')](_0x44f2e2)['then'](handleEntityNotFound(_0x415917,null))[_0x2a5b('0x29')](respondWithResult(_0x415917,null))['catch'](handleError(_0x415917,null));};exports[_0x2a5b('0x4b')]=function(_0x28068f,_0x368c2b){return db[_0x2a5b('0x2f')]['create'](_0x28068f[_0x2a5b('0x4c')],{})[_0x2a5b('0x29')](respondWithResult(_0x368c2b,0xc9))[_0x2a5b('0x49')](handleError(_0x368c2b,null));};exports[_0x2a5b('0x27')]=function(_0x5938e9,_0xd6c346){if(_0x5938e9[_0x2a5b('0x4c')]['id']){delete _0x5938e9[_0x2a5b('0x4c')]['id'];}return db['SugarcrmAccount'][_0x2a5b('0x4a')]({'where':{'id':_0x5938e9[_0x2a5b('0x4d')]['id']}})[_0x2a5b('0x29')](handleEntityNotFound(_0xd6c346,null))['then'](saveUpdates(_0x5938e9[_0x2a5b('0x4c')],null))[_0x2a5b('0x29')](respondWithResult(_0xd6c346,null))['catch'](handleError(_0xd6c346,null));};exports[_0x2a5b('0x28')]=function(_0xaf9273,_0x4686a8){return db[_0x2a5b('0x2f')][_0x2a5b('0x4a')]({'where':{'id':_0xaf9273['params']['id']}})[_0x2a5b('0x29')](handleEntityNotFound(_0x4686a8,null))['then'](removeEntity(_0x4686a8,null))['catch'](handleError(_0x4686a8,null));};exports[_0x2a5b('0x4e')]=function(_0x3f2a4f,_0x7595fd,_0xf98b59){var _0x26a58f={};var _0x4d1465={};var _0x9e6a61;var _0x1c1cec;return db['SugarcrmAccount'][_0x2a5b('0x4f')]({'where':{'id':_0x3f2a4f[_0x2a5b('0x4d')]['id']}})[_0x2a5b('0x29')](handleEntityNotFound(_0x7595fd,null))[_0x2a5b('0x29')](function(_0x13f72d){if(_0x13f72d){_0x9e6a61=_0x13f72d;_0x4d1465[_0x2a5b('0x34')]=_[_0x2a5b('0x37')](db[_0x2a5b('0x50')]['rawAttributes']);_0x4d1465['query']=_['keys'](_0x3f2a4f[_0x2a5b('0x36')]);_0x4d1465[_0x2a5b('0x38')]=_[_0x2a5b('0x3a')](_0x4d1465[_0x2a5b('0x34')],_0x4d1465[_0x2a5b('0x36')]);_0x26a58f[_0x2a5b('0x39')]=_['intersection'](_0x4d1465['model'],qs[_0x2a5b('0x3b')](_0x3f2a4f['query'][_0x2a5b('0x3b')]));_0x26a58f['attributes']=_0x26a58f[_0x2a5b('0x39')]['length']?_0x26a58f['attributes']:_0x4d1465[_0x2a5b('0x34')];_0x26a58f['order']=qs[_0x2a5b('0x40')](_0x3f2a4f[_0x2a5b('0x36')]['sort']);_0x26a58f[_0x2a5b('0x42')]=qs['filters'](_[_0x2a5b('0x51')](_0x3f2a4f[_0x2a5b('0x36')],_0x4d1465[_0x2a5b('0x38')]));if(_0x3f2a4f[_0x2a5b('0x36')][_0x2a5b('0x41')]){_0x26a58f[_0x2a5b('0x42')]=_[_0x2a5b('0x43')](_0x26a58f[_0x2a5b('0x42')],{'$or':_[_0x2a5b('0x35')](_0x26a58f['attributes'],function(_0x46ad76){var _0x3dd18f={};_0x3dd18f[_0x46ad76]={'$like':'%'+_0x3f2a4f[_0x2a5b('0x36')][_0x2a5b('0x41')]+'%'};return _0x3dd18f;})});}_0x26a58f=_[_0x2a5b('0x43')]({},_0x26a58f,_0x3f2a4f[_0x2a5b('0x45')]);return _0x9e6a61['getConfigurations'](_0x26a58f);}})[_0x2a5b('0x29')](function(_0x106f68){if(_0x106f68){_0x1c1cec=_0x106f68[_0x2a5b('0x3c')];if(!_0x3f2a4f[_0x2a5b('0x36')][_0x2a5b('0x3d')]('nolimit')){_0x26a58f[_0x2a5b('0x20')]=qs['limit'](_0x3f2a4f[_0x2a5b('0x36')][_0x2a5b('0x20')]);_0x26a58f[_0x2a5b('0x22')]=qs[_0x2a5b('0x22')](_0x3f2a4f[_0x2a5b('0x36')][_0x2a5b('0x22')]);}return _0x9e6a61['getConfigurations'](_0x26a58f);}})[_0x2a5b('0x29')](function(_0x182175){if(_0x182175){return _0x182175?{'count':_0x1c1cec,'rows':_0x182175}:null;}})[_0x2a5b('0x29')](respondWithResult(_0x7595fd,null))[_0x2a5b('0x49')](handleError(_0x7595fd,null));};exports[_0x2a5b('0x52')]=function(_0x43c62b,_0x351ee8,_0x16e184){if(_0x43c62b[_0x2a5b('0x4c')]['id']){delete _0x43c62b[_0x2a5b('0x4c')]['id'];}return db['SugarcrmAccount'][_0x2a5b('0x4f')]({'where':{'id':_0x43c62b[_0x2a5b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x351ee8,null))[_0x2a5b('0x29')](function(_0x29f8f1){if(_0x29f8f1){_0x43c62b[_0x2a5b('0x4c')]['AccountId']=_0x29f8f1['id'];_0x43c62b['body'][_0x2a5b('0x53')]=integrations[_0x2a5b('0x54')](_0x43c62b[_0x2a5b('0x4c')]['channel'],_0x43c62b[_0x2a5b('0x4c')]['type']);_0x43c62b[_0x2a5b('0x4c')][_0x2a5b('0x55')]=integrations[_0x2a5b('0x56')](_0x43c62b[_0x2a5b('0x4c')][_0x2a5b('0x57')],_0x43c62b[_0x2a5b('0x4c')][_0x2a5b('0x32')]);return db[_0x2a5b('0x50')]['create'](_0x43c62b['body'],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x2a5b('0x58')],'as':'Descriptions'}]});}return null;})[_0x2a5b('0x29')](respondWithResult(_0x351ee8,null))[_0x2a5b('0x49')](handleError(_0x351ee8,null));};exports[_0x2a5b('0x59')]=function(_0x489b0e,_0x11adb9,_0x1b15eb){var _0x2556ab='';var _0x1cec4b=['id','name',_0x2a5b('0x5a'),'created_by',_0x2a5b('0x5b'),'date_start',_0x2a5b('0x5c'),_0x2a5b('0x5d'),_0x2a5b('0x5e'),'parent_type',_0x2a5b('0x5f'),_0x2a5b('0x60')];return db['SugarcrmAccount'][_0x2a5b('0x4f')]({'where':{'id':_0x489b0e[_0x2a5b('0x4d')]['id']},'attributes':['id',_0x2a5b('0x61'),_0x2a5b('0x62'),_0x2a5b('0x63')]})[_0x2a5b('0x29')](handleEntityNotFound(_0x11adb9,null))[_0x2a5b('0x29')](function(_0x24291d){if(_0x24291d){_0x2556ab=_0x24291d[_0x2a5b('0x63')];var _0x139b56=_0x2556ab[_0x2a5b('0x64')](-0x1);if(_0x139b56==='/'){_0x2556ab=_0x2556ab[_0x2a5b('0x65')](0x0,_0x2556ab[_0x2a5b('0x66')](_0x139b56));}return rp({'method':'POST','uri':util[_0x2a5b('0x67')]('%s%s',_0x2556ab,_0x2a5b('0x68')),'json':!![],'form':{'method':'login','input_type':_0x2a5b('0x69'),'response_type':_0x2a5b('0x69'),'rest_data':JSON[_0x2a5b('0x6a')]({'user_auth':{'user_name':_0x24291d['username'],'password':_0x24291d[_0x2a5b('0x62')],'encryption':_0x2a5b('0x6b')},'application':_0x2a5b('0x6c')})}});}})[_0x2a5b('0x29')](function(_0x575504){if(_0x575504&&_0x575504[_0x2a5b('0x2c')]!==_0x2a5b('0x6d')&&_0x575504[_0x2a5b('0x2c')]!==_0x2a5b('0x6e')){return rp({'method':_0x2a5b('0x6f'),'uri':util[_0x2a5b('0x67')](_0x2a5b('0x70'),_0x2556ab,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2a5b('0x71'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2a5b('0x6a')]({'session':_0x575504['id'],'module_name':'Calls'})}})[_0x2a5b('0x29')](function(_0x4e4276){if(_0x4e4276){var _0x3e1726=_[_0x2a5b('0x72')](_0x4e4276[_0x2a5b('0x73')]);_[_0x2a5b('0x74')](_0x3e1726,function(_0x3a03d1){return _0x1cec4b[_0x2a5b('0x75')](_0x3a03d1[_0x2a5b('0x2c')]);});return{'count':_0x3e1726[_0x2a5b('0x3c')],'rows':_[_0x2a5b('0x35')](_0x3e1726,function(_0x396b42){return{'id':_0x396b42[_0x2a5b('0x2c')],'name':_0x396b42[_0x2a5b('0x76')],'custom':_['endsWith'](_0x396b42[_0x2a5b('0x2c')],'_c')?!![]:![],'options':_0x396b42[_0x2a5b('0x45')]?_[_0x2a5b('0x35')](_[_0x2a5b('0x72')](_0x396b42['options']),function(_0x47ff9a){return{'name':_0x47ff9a['value'],'value':_0x47ff9a[_0x2a5b('0x2c')]};}):[]};})};}})[_0x2a5b('0x29')](respondWithResult(_0x11adb9,null))[_0x2a5b('0x49')](function(_0x307418){var _0x2c8f47=_0x489b0e[_0x2a5b('0x36')][_0x2a5b('0x77')]?0x1f4:_0x307418[_0x2a5b('0x78')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2c8f47,JSON[_0x2a5b('0x6a')](_0x307418));delete _0x307418[_0x2a5b('0x2c')];if(_0x2c8f47===0x191){_0x2c8f47=0x190;}_0x11adb9[_0x2a5b('0x1c')](_0x2c8f47)[_0x2a5b('0x2d')](_0x489b0e['query'][_0x2a5b('0x77')]?{'message':_0x2a5b('0x79'),'statusCode':_0x307418['statusCode']}:_0x307418);});}else{var _0x358de8=0x1f4;_0x11adb9['status'](_0x358de8)[_0x2a5b('0x2d')]({'message':_0x2a5b('0x79'),'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 1d8b080..0da9fe8 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 _0xb995=['request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xb995,0xe4));var _0x5b99=function(_0x2ab12e,_0x24270d){_0x2ab12e=_0x2ab12e-0x0;var _0x44500c=_0xb995[_0x2ab12e];return _0x44500c;};'use strict';var _=require('lodash');var util=require(_0x5b99('0x0'));var logger=require(_0x5b99('0x1'))(_0x5b99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b99('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b99('0x4'));var attributes=require(_0x5b99('0x5'));var integrations=require(_0x5b99('0x6'));module[_0x5b99('0x7')]=function(_0x500ffe,_0x495115){return _0x500ffe[_0x5b99('0x8')](_0x5b99('0x9'),attributes,{'tableName':_0x5b99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9172=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x26542a,_0x34c658){var _0x20b645=function(_0x1fe94b){while(--_0x1fe94b){_0x26542a['push'](_0x26542a['shift']());}};_0x20b645(++_0x34c658);}(_0x9172,0x19e));var _0x2917=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x9172[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x2917('0x0'));var util=require(_0x2917('0x1'));var logger=require('../../config/logger')(_0x2917('0x2'));var moment=require('moment');var BPromise=require(_0x2917('0x3'));var rp=require(_0x2917('0x4'));var fs=require('fs');var path=require(_0x2917('0x5'));var rimraf=require('rimraf');var config=require(_0x2917('0x6'));var attributes=require(_0x2917('0x7'));var integrations=require(_0x2917('0x8'));module['exports']=function(_0x371b85,_0x40c305){return _0x371b85[_0x2917('0x9')](_0x2917('0xa'),attributes,{'tableName':_0x2917('0xb'),'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 6f6e19b..3f92505 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 _0x4a27=['stringify','catch','ShowSugarcrmAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','include','map','model','attributes'];(function(_0x1d3d57,_0x213f3a){var _0x7d9691=function(_0x2b7f3f){while(--_0x2b7f3f){_0x1d3d57['push'](_0x1d3d57['shift']());}};_0x7d9691(++_0x213f3a);}(_0x4a27,0x1f2));var _0x74a2=function(_0x5d27c3,_0x5ac158){_0x5d27c3=_0x5d27c3-0x0;var _0xed73f8=_0x4a27[_0x5d27c3];return _0xed73f8;};'use strict';var _=require('lodash');var util=require(_0x74a2('0x0'));var moment=require(_0x74a2('0x1'));var BPromise=require(_0x74a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74a2('0x3'));var db=require(_0x74a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a2('0x5'))('rpc');var config=require(_0x74a2('0x6'));var jayson=require(_0x74a2('0x7'));var client=jayson[_0x74a2('0x8')][_0x74a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10e8d9,_0x37bd27,_0x50bb7c){return new BPromise(function(_0x585607,_0x4a469f){return client[_0x74a2('0xa')](_0x10e8d9,_0x50bb7c)[_0x74a2('0xb')](function(_0x4f601d){logger[_0x74a2('0xc')](_0x74a2('0xd'),_0x37bd27,_0x74a2('0xe'));logger[_0x74a2('0xf')](_0x74a2('0x10'),_0x37bd27,_0x74a2('0xe'),JSON['stringify'](_0x4f601d));if(_0x4f601d[_0x74a2('0x11')]){if(_0x4f601d[_0x74a2('0x11')]['code']===0x1f4){logger[_0x74a2('0x11')](_0x74a2('0xd'),_0x37bd27,_0x4f601d['error'][_0x74a2('0x12')]);return _0x4a469f(_0x4f601d[_0x74a2('0x11')][_0x74a2('0x12')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x37bd27,_0x4f601d[_0x74a2('0x11')][_0x74a2('0x12')]);return _0x585607(_0x4f601d[_0x74a2('0x11')][_0x74a2('0x12')]);}else{logger[_0x74a2('0xc')](_0x74a2('0xd'),_0x37bd27,_0x74a2('0xe'));_0x585607(_0x4f601d[_0x74a2('0x13')][_0x74a2('0x12')]);}})['catch'](function(_0x1e3d83){logger[_0x74a2('0x11')](_0x74a2('0xd'),_0x37bd27,_0x1e3d83);_0x4a469f(_0x1e3d83);});});}exports[_0x74a2('0x14')]=function(_0x3cfe92){var _0x4912df=this;return new Promise(function(_0x2a790f,_0x3fccd0){return db[_0x74a2('0x15')][_0x74a2('0x16')]({'raw':_0x3cfe92[_0x74a2('0x17')]?_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x18')]===undefined?!![]:![]:!![],'where':_0x3cfe92[_0x74a2('0x17')]?_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x19')]||null:null,'attributes':_0x3cfe92[_0x74a2('0x17')]?_0x3cfe92[_0x74a2('0x17')]['attributes']||null:null,'limit':_0x3cfe92['options']?_0x3cfe92[_0x74a2('0x17')]['limit']||null:null,'include':_0x3cfe92['options']?_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x3cfe92[_0x74a2('0x17')][_0x74a2('0x1a')],function(_0x2536fb){return{'model':db[_0x2536fb[_0x74a2('0x1c')]],'as':_0x2536fb['as'],'attributes':_0x2536fb['attributes'],'include':_0x2536fb[_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x2536fb['include'],function(_0x5a8aa4){return{'model':db[_0x5a8aa4['model']],'as':_0x5a8aa4['as'],'attributes':_0x5a8aa4['attributes'],'include':_0x5a8aa4[_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x5a8aa4[_0x74a2('0x1a')],function(_0x19ccfb){return{'model':db[_0x19ccfb[_0x74a2('0x1c')]],'as':_0x19ccfb['as'],'attributes':_0x19ccfb[_0x74a2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x74a2('0xb')](function(_0x3ce0b0){logger['info']('GetSugarcrmAccount',_0x3cfe92);logger['debug'](_0x74a2('0x14'),_0x3cfe92,JSON[_0x74a2('0x1e')](_0x3ce0b0));_0x2a790f(_0x3ce0b0);})[_0x74a2('0x1f')](function(_0x1c4f66){logger[_0x74a2('0x11')](_0x74a2('0x14'),_0x1c4f66['message'],_0x3cfe92);_0x3fccd0(_0x4912df[_0x74a2('0x11')](0x1f4,_0x1c4f66['message']));});});};exports[_0x74a2('0x20')]=function(_0x144070){var _0x39fe00=this;return new Promise(function(_0x35140c,_0x52a254){return db[_0x74a2('0x15')]['find']({'raw':_0x144070[_0x74a2('0x17')]?_0x144070[_0x74a2('0x17')][_0x74a2('0x18')]===undefined?!![]:![]:!![],'where':_0x144070[_0x74a2('0x17')]?_0x144070[_0x74a2('0x17')][_0x74a2('0x19')]||null:null,'attributes':_0x144070[_0x74a2('0x17')]?_0x144070['options'][_0x74a2('0x1d')]||null:null,'include':_0x144070[_0x74a2('0x17')]?_0x144070[_0x74a2('0x17')][_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x144070[_0x74a2('0x17')]['include'],function(_0xd7a811){return{'model':db[_0xd7a811['model']],'as':_0xd7a811['as'],'attributes':_0xd7a811['attributes'],'include':_0xd7a811[_0x74a2('0x1a')]?_['map'](_0xd7a811[_0x74a2('0x1a')],function(_0x3b8e1b){return{'model':db[_0x3b8e1b['model']],'as':_0x3b8e1b['as'],'attributes':_0x3b8e1b[_0x74a2('0x1d')],'include':_0x3b8e1b[_0x74a2('0x1a')]?_[_0x74a2('0x1b')](_0x3b8e1b[_0x74a2('0x1a')],function(_0xca7a){return{'model':db[_0xca7a['model']],'as':_0xca7a['as'],'attributes':_0xca7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x74a2('0xb')](function(_0x113ce7){logger[_0x74a2('0xc')](_0x74a2('0x20'),_0x144070);logger[_0x74a2('0xf')]('ShowSugarcrmAccount',_0x144070,JSON['stringify'](_0x113ce7));_0x35140c(_0x113ce7);})[_0x74a2('0x1f')](function(_0x5340e7){logger[_0x74a2('0x11')](_0x74a2('0x20'),_0x5340e7[_0x74a2('0x12')],_0x144070);_0x52a254(_0x39fe00['error'](0x1f4,_0x5340e7[_0x74a2('0x12')]));});});}; \ No newline at end of file +var _0x0c8b=['findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x4689d0,_0x5a28c5){var _0xb61270=function(_0x290db1){while(--_0x290db1){_0x4689d0['push'](_0x4689d0['shift']());}};_0xb61270(++_0x5a28c5);}(_0x0c8b,0x7e));var _0xb0c8=function(_0x32c48c,_0x5d669e){_0x32c48c=_0x32c48c-0x0;var _0x133729=_0x0c8b[_0x32c48c];return _0x133729;};'use strict';var _=require('lodash');var util=require(_0xb0c8('0x0'));var moment=require(_0xb0c8('0x1'));var BPromise=require(_0xb0c8('0x2'));var rs=require(_0xb0c8('0x3'));var fs=require('fs');var Redis=require(_0xb0c8('0x4'));var db=require(_0xb0c8('0x5'))['db'];var utils=require(_0xb0c8('0x6'));var logger=require(_0xb0c8('0x7'))(_0xb0c8('0x8'));var config=require(_0xb0c8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb0c8('0xa')][_0xb0c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d1bc6,_0x56f9f4,_0x54ef20){return new BPromise(function(_0x3361e3,_0x4d9b56){return client[_0xb0c8('0xc')](_0x4d1bc6,_0x54ef20)[_0xb0c8('0xd')](function(_0x4eb841){logger[_0xb0c8('0xe')](_0xb0c8('0xf'),_0x56f9f4,_0xb0c8('0x10'));logger[_0xb0c8('0x11')](_0xb0c8('0x12'),_0x56f9f4,_0xb0c8('0x10'),JSON[_0xb0c8('0x13')](_0x4eb841));if(_0x4eb841['error']){if(_0x4eb841[_0xb0c8('0x14')][_0xb0c8('0x15')]===0x1f4){logger['error'](_0xb0c8('0xf'),_0x56f9f4,_0x4eb841[_0xb0c8('0x14')][_0xb0c8('0x16')]);return _0x4d9b56(_0x4eb841['error']['message']);}logger[_0xb0c8('0x14')](_0xb0c8('0xf'),_0x56f9f4,_0x4eb841['error']['message']);return _0x3361e3(_0x4eb841[_0xb0c8('0x14')][_0xb0c8('0x16')]);}else{logger['info'](_0xb0c8('0xf'),_0x56f9f4,_0xb0c8('0x10'));_0x3361e3(_0x4eb841[_0xb0c8('0x17')][_0xb0c8('0x16')]);}})['catch'](function(_0x4d83b3){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x56f9f4,_0x4d83b3);_0x4d9b56(_0x4d83b3);});});}exports[_0xb0c8('0x18')]=function(_0x3e4c0b){var _0x5a2868=this;return new Promise(function(_0x4169a5,_0x4e2852){return db[_0xb0c8('0x19')][_0xb0c8('0x1a')]({'raw':_0x3e4c0b[_0xb0c8('0x1b')]?_0x3e4c0b['options'][_0xb0c8('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e4c0b[_0xb0c8('0x1b')]?_0x3e4c0b['options'][_0xb0c8('0x1d')]||null:null,'attributes':_0x3e4c0b[_0xb0c8('0x1b')]?_0x3e4c0b['options'][_0xb0c8('0x1e')]||null:null,'limit':_0x3e4c0b['options']?_0x3e4c0b[_0xb0c8('0x1b')][_0xb0c8('0x1f')]||null:null,'include':_0x3e4c0b[_0xb0c8('0x1b')]?_0x3e4c0b['options'][_0xb0c8('0x20')]?_[_0xb0c8('0x21')](_0x3e4c0b['options'][_0xb0c8('0x20')],function(_0x145ebf){return{'model':db[_0x145ebf[_0xb0c8('0x22')]],'as':_0x145ebf['as'],'attributes':_0x145ebf['attributes'],'include':_0x145ebf[_0xb0c8('0x20')]?_[_0xb0c8('0x21')](_0x145ebf[_0xb0c8('0x20')],function(_0xcc753b){return{'model':db[_0xcc753b[_0xb0c8('0x22')]],'as':_0xcc753b['as'],'attributes':_0xcc753b[_0xb0c8('0x1e')],'include':_0xcc753b[_0xb0c8('0x20')]?_['map'](_0xcc753b[_0xb0c8('0x20')],function(_0x341016){return{'model':db[_0x341016[_0xb0c8('0x22')]],'as':_0x341016['as'],'attributes':_0x341016[_0xb0c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb0c8('0xd')](function(_0x1f18f1){logger[_0xb0c8('0xe')](_0xb0c8('0x18'),_0x3e4c0b);logger[_0xb0c8('0x11')](_0xb0c8('0x18'),_0x3e4c0b,JSON[_0xb0c8('0x13')](_0x1f18f1));_0x4169a5(_0x1f18f1);})[_0xb0c8('0x23')](function(_0x3e2bfa){logger['error']('GetSugarcrmAccount',_0x3e2bfa[_0xb0c8('0x16')],_0x3e4c0b);_0x4e2852(_0x5a2868[_0xb0c8('0x14')](0x1f4,_0x3e2bfa[_0xb0c8('0x16')]));});});};exports[_0xb0c8('0x24')]=function(_0x119599){var _0x51b5c8=this;return new Promise(function(_0x43dbd6,_0x391daa){return db[_0xb0c8('0x19')][_0xb0c8('0x25')]({'raw':_0x119599['options']?_0x119599[_0xb0c8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x119599['options']?_0x119599[_0xb0c8('0x1b')][_0xb0c8('0x1d')]||null:null,'attributes':_0x119599[_0xb0c8('0x1b')]?_0x119599['options']['attributes']||null:null,'include':_0x119599[_0xb0c8('0x1b')]?_0x119599['options'][_0xb0c8('0x20')]?_['map'](_0x119599['options'][_0xb0c8('0x20')],function(_0x263486){return{'model':db[_0x263486[_0xb0c8('0x22')]],'as':_0x263486['as'],'attributes':_0x263486[_0xb0c8('0x1e')],'include':_0x263486['include']?_[_0xb0c8('0x21')](_0x263486['include'],function(_0x2dc7f2){return{'model':db[_0x2dc7f2['model']],'as':_0x2dc7f2['as'],'attributes':_0x2dc7f2[_0xb0c8('0x1e')],'include':_0x2dc7f2[_0xb0c8('0x20')]?_[_0xb0c8('0x21')](_0x2dc7f2[_0xb0c8('0x20')],function(_0x2e8381){return{'model':db[_0x2e8381['model']],'as':_0x2e8381['as'],'attributes':_0x2e8381[_0xb0c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb0c8('0xd')](function(_0x57c19b){logger[_0xb0c8('0xe')](_0xb0c8('0x24'),_0x119599);logger[_0xb0c8('0x11')](_0xb0c8('0x24'),_0x119599,JSON[_0xb0c8('0x13')](_0x57c19b));_0x43dbd6(_0x57c19b);})[_0xb0c8('0x23')](function(_0x48974f){logger[_0xb0c8('0x14')](_0xb0c8('0x24'),_0x48974f['message'],_0x119599);_0x391daa(_0x51b5c8[_0xb0c8('0x14')](0x1f4,_0x48974f[_0xb0c8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 28f6e3e..ba74a22 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 _0x1d68=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get'];(function(_0xe9b536,_0x261eec){var _0x351e80=function(_0x4b204a){while(--_0x4b204a){_0xe9b536['push'](_0xe9b536['shift']());}};_0x351e80(++_0x261eec);}(_0x1d68,0x144));var _0x81d6=function(_0x4ba105,_0xf97073){_0x4ba105=_0x4ba105-0x0;var _0x5eee7b=_0x1d68[_0x4ba105];return _0x5eee7b;};'use strict';var multer=require(_0x81d6('0x0'));var util=require(_0x81d6('0x1'));var path=require(_0x81d6('0x2'));var timeout=require(_0x81d6('0x3'));var express=require(_0x81d6('0x4'));var router=express[_0x81d6('0x5')]();var fs_extra=require(_0x81d6('0x6'));var auth=require(_0x81d6('0x7'));var interaction=require(_0x81d6('0x8'));var config=require(_0x81d6('0x9'));var controller=require(_0x81d6('0xa'));router['get']('/',auth[_0x81d6('0xb')](),controller[_0x81d6('0xc')]);router[_0x81d6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x81d6('0xe')]);router[_0x81d6('0xd')](_0x81d6('0xf'),auth[_0x81d6('0xb')](),controller[_0x81d6('0x10')]);router[_0x81d6('0xd')](_0x81d6('0x11'),auth[_0x81d6('0xb')](),controller[_0x81d6('0x12')]);router[_0x81d6('0xd')](_0x81d6('0x13'),auth['isAuthenticated'](),controller[_0x81d6('0x14')]);router[_0x81d6('0x15')]('/',auth[_0x81d6('0xb')](),controller[_0x81d6('0x16')]);router['put'](_0x81d6('0x17'),auth[_0x81d6('0xb')](),controller['update']);router[_0x81d6('0x18')](_0x81d6('0x17'),auth[_0x81d6('0xb')](),controller[_0x81d6('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2e77=['delete','multer','util','path','express','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','put','update'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x2e77,0x141));var _0x72e7=function(_0x496799,_0xfff5ef){_0x496799=_0x496799-0x0;var _0x31cd35=_0x2e77[_0x496799];return _0x31cd35;};'use strict';var multer=require(_0x72e7('0x0'));var util=require(_0x72e7('0x1'));var path=require(_0x72e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x72e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x72e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x72e7('0x5'));var controller=require(_0x72e7('0x6'));router[_0x72e7('0x7')]('/',auth[_0x72e7('0x8')](),controller[_0x72e7('0x9')]);router['get'](_0x72e7('0xa'),auth['isAuthenticated'](),controller[_0x72e7('0xb')]);router[_0x72e7('0x7')](_0x72e7('0xc'),auth[_0x72e7('0x8')](),controller[_0x72e7('0xd')]);router[_0x72e7('0x7')]('/:id/subjects',auth[_0x72e7('0x8')](),controller[_0x72e7('0xe')]);router[_0x72e7('0x7')]('/:id/descriptions',auth[_0x72e7('0x8')](),controller[_0x72e7('0xf')]);router[_0x72e7('0x10')]('/',auth[_0x72e7('0x8')](),controller['create']);router[_0x72e7('0x11')](_0x72e7('0xa'),auth[_0x72e7('0x8')](),controller[_0x72e7('0x12')]);router[_0x72e7('0x13')](_0x72e7('0xa'),auth[_0x72e7('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 8eb4cec..57b25de 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 _0x9640=['exports','STRING','sequelize'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x9640,0x1e8));var _0x0964=function(_0x11188d,_0x20035b){_0x11188d=_0x11188d-0x0;var _0x22666e=_0x9640[_0x11188d];return _0x22666e;};'use strict';var Sequelize=require(_0x0964('0x0'));module[_0x0964('0x1')]={'name':{'type':Sequelize[_0x0964('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3351=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3351,0x79));var _0x1335=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x3351[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x1335('0x0'));module[_0x1335('0x1')]={'name':{'type':Sequelize[_0x1335('0x2')]},'description':{'type':Sequelize[_0x1335('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e0f3781..86fd828 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 _0x276a=['type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','create','body','find','getFields','findOne','SugarcrmField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','sendStatus','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName'];(function(_0x4ce577,_0x41192a){var _0x50c69=function(_0x27ab54){while(--_0x27ab54){_0x4ce577['push'](_0x4ce577['shift']());}};_0x50c69(++_0x41192a);}(_0x276a,0x70));var _0xa276=function(_0x2fa066,_0x8f4f14){_0x2fa066=_0x2fa066-0x0;var _0x1f5382=_0x276a[_0x2fa066];return _0x1f5382;};'use strict';var emlformat=require(_0xa276('0x0'));var rimraf=require(_0xa276('0x1'));var zipdir=require(_0xa276('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa276('0x3'));var moment=require(_0xa276('0x4'));var BPromise=require(_0xa276('0x5'));var Mustache=require(_0xa276('0x6'));var util=require('util');var path=require(_0xa276('0x7'));var sox=require(_0xa276('0x8'));var csv=require(_0xa276('0x9'));var ejs=require(_0xa276('0xa'));var fs=require('fs');var fs_extra=require(_0xa276('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa276('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa276('0x9'));var querystring=require(_0xa276('0xd'));var Papa=require(_0xa276('0xe'));var Redis=require(_0xa276('0xf'));var authService=require(_0xa276('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa276('0x11'));var logger=require(_0xa276('0x12'))(_0xa276('0x13'));var utils=require(_0xa276('0x14'));var config=require(_0xa276('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa276('0x16'))['db'];function respondWithStatusCode(_0x1a8098,_0x11c2bd){_0x11c2bd=_0x11c2bd||0xcc;return function(_0x1b3cac){if(_0x1b3cac){return _0x1a8098['sendStatus'](_0x11c2bd);}return _0x1a8098['status'](_0x11c2bd)[_0xa276('0x17')]();};}function respondWithResult(_0x19a6fc,_0x1b4390){_0x1b4390=_0x1b4390||0xc8;return function(_0x15dad0){if(_0x15dad0){return _0x19a6fc[_0xa276('0x18')](_0x1b4390)[_0xa276('0x19')](_0x15dad0);}};}function respondWithFilteredResult(_0x3ee567,_0x5e1e55){return function(_0x136263){if(_0x136263){var _0x36548d=typeof _0x5e1e55[_0xa276('0x1a')]===_0xa276('0x1b')&&typeof _0x5e1e55['limit']===_0xa276('0x1b');var _0x28923e=_0x136263[_0xa276('0x1c')];var _0x11efde=_0x36548d?0x0:_0x5e1e55[_0xa276('0x1a')];var _0x229c78=_0x36548d?_0x136263[_0xa276('0x1c')]:_0x5e1e55[_0xa276('0x1a')]+_0x5e1e55[_0xa276('0x1d')];var _0x2d3721;if(_0x229c78>=_0x28923e){_0x229c78=_0x28923e;_0x2d3721=0xc8;}else{_0x2d3721=0xce;}_0x3ee567[_0xa276('0x18')](_0x2d3721);return _0x3ee567[_0xa276('0x1e')]('Content-Range',_0x11efde+'-'+_0x229c78+'/'+_0x28923e)['json'](_0x136263);}return null;};}function patchUpdates(_0x503cf6){return function(_0xc04b19){try{jsonpatch[_0xa276('0x1f')](_0xc04b19,_0x503cf6,!![]);}catch(_0x3004d7){return BPromise['reject'](_0x3004d7);}return _0xc04b19[_0xa276('0x20')]();};}function saveUpdates(_0x1b446a,_0x52f4cb){return function(_0x52337f){if(_0x52337f){return _0x52337f[_0xa276('0x21')](_0x1b446a)[_0xa276('0x22')](function(_0x1aab04){return _0x1aab04;});}return null;};}function removeEntity(_0x4ea966,_0x32e161){return function(_0x5ce681){if(_0x5ce681){return _0x5ce681[_0xa276('0x23')]()[_0xa276('0x22')](function(){_0x4ea966['status'](0xcc)[_0xa276('0x17')]();});}};}function handleEntityNotFound(_0xd042f6,_0x4c100d){return function(_0x48697f){if(!_0x48697f){_0xd042f6[_0xa276('0x24')](0x194);}return _0x48697f;};}function handleError(_0x1edf3d,_0x45c8e8){_0x45c8e8=_0x45c8e8||0x1f4;return function(_0x1c8fa4){logger['error'](_0x1c8fa4['stack']);if(_0x1c8fa4[_0xa276('0x25')]){delete _0x1c8fa4['name'];}_0x1edf3d['status'](_0x45c8e8)[_0xa276('0x26')](_0x1c8fa4);};}exports[_0xa276('0x27')]=function(_0x38cecc,_0x288bbc){var _0x354028={},_0x9c9ea9={},_0x54ab9a={'count':0x0,'rows':[]};var _0x3bb538=_[_0xa276('0x28')](db[_0xa276('0x29')][_0xa276('0x2a')],function(_0x3cd189){return{'name':_0x3cd189[_0xa276('0x2b')],'type':_0x3cd189[_0xa276('0x2c')][_0xa276('0x2d')]};});_0x9c9ea9[_0xa276('0x2e')]=_['map'](_0x3bb538,_0xa276('0x25'));_0x9c9ea9[_0xa276('0x2f')]=_[_0xa276('0x30')](_0x38cecc[_0xa276('0x2f')]);_0x9c9ea9[_0xa276('0x31')]=_[_0xa276('0x32')](_0x9c9ea9[_0xa276('0x2e')],_0x9c9ea9[_0xa276('0x2f')]);_0x354028[_0xa276('0x33')]=_[_0xa276('0x32')](_0x9c9ea9['model'],qs[_0xa276('0x34')](_0x38cecc['query']['fields']));_0x354028[_0xa276('0x33')]=_0x354028[_0xa276('0x33')][_0xa276('0x35')]?_0x354028[_0xa276('0x33')]:_0x9c9ea9[_0xa276('0x2e')];if(!_0x38cecc[_0xa276('0x2f')]['hasOwnProperty'](_0xa276('0x36'))){_0x354028[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x38cecc[_0xa276('0x2f')]['limit']);_0x354028[_0xa276('0x1a')]=qs['offset'](_0x38cecc[_0xa276('0x2f')][_0xa276('0x1a')]);}_0x354028[_0xa276('0x37')]=qs['sort'](_0x38cecc[_0xa276('0x2f')][_0xa276('0x38')]);_0x354028[_0xa276('0x39')]=qs[_0xa276('0x31')](_['pick'](_0x38cecc[_0xa276('0x2f')],_0x9c9ea9['filters']),_0x3bb538);if(_0x38cecc['query'][_0xa276('0x3a')]){_0x354028[_0xa276('0x39')]=_['merge'](_0x354028[_0xa276('0x39')],{'$or':_[_0xa276('0x28')](_0x3bb538,function(_0x5ea738){if(_0x5ea738[_0xa276('0x2c')]!==_0xa276('0x3b')){var _0xdf236d={};_0xdf236d[_0x5ea738[_0xa276('0x25')]]={'$like':'%'+_0x38cecc[_0xa276('0x2f')][_0xa276('0x3a')]+'%'};return _0xdf236d;}})});}_0x354028=_[_0xa276('0x3c')]({},_0x354028,_0x38cecc[_0xa276('0x3d')]);var _0xf80664={'where':_0x354028[_0xa276('0x39')]};return db[_0xa276('0x29')][_0xa276('0x1c')](_0xf80664)[_0xa276('0x22')](function(_0x173435){_0x54ab9a['count']=_0x173435;if(_0x38cecc[_0xa276('0x2f')][_0xa276('0x3e')]){_0x354028['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xa276('0x3f')](_0x354028);})['then'](function(_0x2e17c0){_0x54ab9a[_0xa276('0x40')]=_0x2e17c0;return _0x54ab9a;})[_0xa276('0x22')](respondWithFilteredResult(_0x288bbc,_0x354028))[_0xa276('0x41')](handleError(_0x288bbc,null));};exports[_0xa276('0x42')]=function(_0x4f5ef6,_0x11e99d){var _0xddd07={'raw':![],'where':{'id':_0x4f5ef6[_0xa276('0x43')]['id']}},_0x59787e={};_0x59787e[_0xa276('0x2e')]=_[_0xa276('0x30')](db[_0xa276('0x29')][_0xa276('0x2a')]);_0x59787e[_0xa276('0x2f')]=_['keys'](_0x4f5ef6['query']);_0x59787e[_0xa276('0x31')]=_[_0xa276('0x32')](_0x59787e['model'],_0x59787e[_0xa276('0x2f')]);_0xddd07[_0xa276('0x33')]=_['intersection'](_0x59787e[_0xa276('0x2e')],qs[_0xa276('0x34')](_0x4f5ef6[_0xa276('0x2f')]['fields']));_0xddd07[_0xa276('0x33')]=_0xddd07[_0xa276('0x33')][_0xa276('0x35')]?_0xddd07[_0xa276('0x33')]:_0x59787e[_0xa276('0x2e')];if(_0x4f5ef6[_0xa276('0x2f')][_0xa276('0x3e')]){_0xddd07['include']=[{'all':!![]}];}_0xddd07=_[_0xa276('0x3c')]({},_0xddd07,_0x4f5ef6[_0xa276('0x3d')]);return db[_0xa276('0x29')]['find'](_0xddd07)[_0xa276('0x22')](handleEntityNotFound(_0x11e99d,null))['then'](respondWithResult(_0x11e99d,null))['catch'](handleError(_0x11e99d,null));};exports[_0xa276('0x44')]=function(_0x495090,_0x45356f){return db[_0xa276('0x29')][_0xa276('0x44')](_0x495090[_0xa276('0x45')],{})[_0xa276('0x22')](respondWithResult(_0x45356f,0xc9))[_0xa276('0x41')](handleError(_0x45356f,null));};exports[_0xa276('0x21')]=function(_0x2c34e8,_0x19f4de){if(_0x2c34e8[_0xa276('0x45')]['id']){delete _0x2c34e8['body']['id'];}return db['SugarcrmConfiguration'][_0xa276('0x46')]({'where':{'id':_0x2c34e8['params']['id']}})[_0xa276('0x22')](handleEntityNotFound(_0x19f4de,null))[_0xa276('0x22')](saveUpdates(_0x2c34e8[_0xa276('0x45')],null))[_0xa276('0x22')](respondWithResult(_0x19f4de,null))[_0xa276('0x41')](handleError(_0x19f4de,null));};exports['destroy']=function(_0x3597fe,_0x3f7f61){return db[_0xa276('0x29')][_0xa276('0x46')]({'where':{'id':_0x3597fe[_0xa276('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f7f61,null))[_0xa276('0x22')](removeEntity(_0x3f7f61,null))[_0xa276('0x41')](handleError(_0x3f7f61,null));};exports[_0xa276('0x47')]=function(_0x287f49,_0x28f103,_0x53117e){var _0x5e6c46={};var _0xa9ac50={};var _0x39574f;var _0x300985;return db['SugarcrmConfiguration'][_0xa276('0x48')]({'where':{'id':_0x287f49[_0xa276('0x43')]['id']}})[_0xa276('0x22')](handleEntityNotFound(_0x28f103,null))[_0xa276('0x22')](function(_0xe0df9b){if(_0xe0df9b){_0x39574f=_0xe0df9b;_0xa9ac50[_0xa276('0x2e')]=_[_0xa276('0x30')](db[_0xa276('0x49')]['rawAttributes']);_0xa9ac50[_0xa276('0x2f')]=_['keys'](_0x287f49[_0xa276('0x2f')]);_0xa9ac50[_0xa276('0x31')]=_[_0xa276('0x32')](_0xa9ac50[_0xa276('0x2e')],_0xa9ac50[_0xa276('0x2f')]);_0x5e6c46[_0xa276('0x33')]=_['intersection'](_0xa9ac50[_0xa276('0x2e')],qs['fields'](_0x287f49[_0xa276('0x2f')]['fields']));_0x5e6c46[_0xa276('0x33')]=_0x5e6c46[_0xa276('0x33')][_0xa276('0x35')]?_0x5e6c46[_0xa276('0x33')]:_0xa9ac50['model'];_0x5e6c46[_0xa276('0x37')]=qs['sort'](_0x287f49['query']['sort']);_0x5e6c46['where']=qs[_0xa276('0x31')](_[_0xa276('0x4a')](_0x287f49['query'],_0xa9ac50[_0xa276('0x31')]));if(_0x287f49[_0xa276('0x2f')][_0xa276('0x3a')]){_0x5e6c46[_0xa276('0x39')]=_[_0xa276('0x3c')](_0x5e6c46['where'],{'$or':_[_0xa276('0x28')](_0x5e6c46[_0xa276('0x33')],function(_0x2a43b8){var _0x29ffa2={};_0x29ffa2[_0x2a43b8]={'$like':'%'+_0x287f49[_0xa276('0x2f')][_0xa276('0x3a')]+'%'};return _0x29ffa2;})});}_0x5e6c46=_['merge']({},_0x5e6c46,_0x287f49[_0xa276('0x3d')]);return _0x39574f[_0xa276('0x47')](_0x5e6c46);}})['then'](function(_0x9f5df4){if(_0x9f5df4){_0x300985=_0x9f5df4[_0xa276('0x35')];if(!_0x287f49['query'][_0xa276('0x4b')](_0xa276('0x36'))){_0x5e6c46[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x287f49[_0xa276('0x2f')][_0xa276('0x1d')]);_0x5e6c46[_0xa276('0x1a')]=qs[_0xa276('0x1a')](_0x287f49['query']['offset']);}return _0x39574f[_0xa276('0x47')](_0x5e6c46);}})[_0xa276('0x22')](function(_0x462b42){if(_0x462b42){return _0x462b42?{'count':_0x300985,'rows':_0x462b42}:null;}})['then'](respondWithResult(_0x28f103,null))['catch'](handleError(_0x28f103,null));};exports[_0xa276('0x4c')]=function(_0x3d0db7,_0x297131,_0x511c8d){var _0x4089af={};var _0x58f03d={};var _0x42d36e;var _0x61400e;return db[_0xa276('0x29')][_0xa276('0x48')]({'where':{'id':_0x3d0db7[_0xa276('0x43')]['id']}})[_0xa276('0x22')](handleEntityNotFound(_0x297131,null))['then'](function(_0x51502e){if(_0x51502e){_0x42d36e=_0x51502e;_0x58f03d[_0xa276('0x2e')]=_[_0xa276('0x30')](db[_0xa276('0x49')]['rawAttributes']);_0x58f03d[_0xa276('0x2f')]=_[_0xa276('0x30')](_0x3d0db7[_0xa276('0x2f')]);_0x58f03d[_0xa276('0x31')]=_['intersection'](_0x58f03d['model'],_0x58f03d[_0xa276('0x2f')]);_0x4089af[_0xa276('0x33')]=_[_0xa276('0x32')](_0x58f03d[_0xa276('0x2e')],qs[_0xa276('0x34')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x34')]));_0x4089af[_0xa276('0x33')]=_0x4089af[_0xa276('0x33')]['length']?_0x4089af[_0xa276('0x33')]:_0x58f03d[_0xa276('0x2e')];_0x4089af[_0xa276('0x37')]=qs[_0xa276('0x38')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x38')]);_0x4089af[_0xa276('0x39')]=qs[_0xa276('0x31')](_[_0xa276('0x4a')](_0x3d0db7['query'],_0x58f03d['filters']));if(_0x3d0db7[_0xa276('0x2f')][_0xa276('0x3a')]){_0x4089af[_0xa276('0x39')]=_['merge'](_0x4089af[_0xa276('0x39')],{'$or':_[_0xa276('0x28')](_0x4089af['attributes'],function(_0x1929ec){var _0x42482f={};_0x42482f[_0x1929ec]={'$like':'%'+_0x3d0db7[_0xa276('0x2f')][_0xa276('0x3a')]+'%'};return _0x42482f;})});}_0x4089af=_[_0xa276('0x3c')]({},_0x4089af,_0x3d0db7[_0xa276('0x3d')]);return _0x42d36e[_0xa276('0x4c')](_0x4089af);}})[_0xa276('0x22')](function(_0x2d2732){if(_0x2d2732){_0x61400e=_0x2d2732[_0xa276('0x35')];if(!_0x3d0db7[_0xa276('0x2f')][_0xa276('0x4b')]('nolimit')){_0x4089af[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x1d')]);_0x4089af[_0xa276('0x1a')]=qs[_0xa276('0x1a')](_0x3d0db7[_0xa276('0x2f')][_0xa276('0x1a')]);}return _0x42d36e[_0xa276('0x4c')](_0x4089af);}})['then'](function(_0x2132b8){if(_0x2132b8){return _0x2132b8?{'count':_0x61400e,'rows':_0x2132b8}:null;}})[_0xa276('0x22')](respondWithResult(_0x297131,null))[_0xa276('0x41')](handleError(_0x297131,null));};exports[_0xa276('0x4d')]=function(_0x4d87f7,_0x35cdd5,_0x143422){var _0x66b8a2={};var _0x34a052={};var _0xacdbed;var _0x3ef519;return db['SugarcrmConfiguration'][_0xa276('0x48')]({'where':{'id':_0x4d87f7[_0xa276('0x43')]['id']}})['then'](handleEntityNotFound(_0x35cdd5,null))[_0xa276('0x22')](function(_0x37ec70){if(_0x37ec70){_0xacdbed=_0x37ec70;_0x34a052[_0xa276('0x2e')]=_['keys'](db[_0xa276('0x49')][_0xa276('0x2a')]);_0x34a052[_0xa276('0x2f')]=_[_0xa276('0x30')](_0x4d87f7[_0xa276('0x2f')]);_0x34a052[_0xa276('0x31')]=_[_0xa276('0x32')](_0x34a052[_0xa276('0x2e')],_0x34a052['query']);_0x66b8a2[_0xa276('0x33')]=_[_0xa276('0x32')](_0x34a052['model'],qs[_0xa276('0x34')](_0x4d87f7[_0xa276('0x2f')][_0xa276('0x34')]));_0x66b8a2['attributes']=_0x66b8a2[_0xa276('0x33')][_0xa276('0x35')]?_0x66b8a2[_0xa276('0x33')]:_0x34a052[_0xa276('0x2e')];_0x66b8a2[_0xa276('0x37')]=qs[_0xa276('0x38')](_0x4d87f7['query']['sort']);_0x66b8a2[_0xa276('0x39')]=qs[_0xa276('0x31')](_['pick'](_0x4d87f7['query'],_0x34a052[_0xa276('0x31')]));if(_0x4d87f7[_0xa276('0x2f')][_0xa276('0x3a')]){_0x66b8a2[_0xa276('0x39')]=_['merge'](_0x66b8a2['where'],{'$or':_[_0xa276('0x28')](_0x66b8a2[_0xa276('0x33')],function(_0x15b475){var _0x3d52d0={};_0x3d52d0[_0x15b475]={'$like':'%'+_0x4d87f7[_0xa276('0x2f')]['filter']+'%'};return _0x3d52d0;})});}_0x66b8a2=_[_0xa276('0x3c')]({},_0x66b8a2,_0x4d87f7[_0xa276('0x3d')]);return _0xacdbed[_0xa276('0x4d')](_0x66b8a2);}})['then'](function(_0x500755){if(_0x500755){_0x3ef519=_0x500755[_0xa276('0x35')];if(!_0x4d87f7[_0xa276('0x2f')][_0xa276('0x4b')](_0xa276('0x36'))){_0x66b8a2[_0xa276('0x1d')]=qs[_0xa276('0x1d')](_0x4d87f7[_0xa276('0x2f')][_0xa276('0x1d')]);_0x66b8a2[_0xa276('0x1a')]=qs[_0xa276('0x1a')](_0x4d87f7[_0xa276('0x2f')][_0xa276('0x1a')]);}return _0xacdbed[_0xa276('0x4d')](_0x66b8a2);}})[_0xa276('0x22')](function(_0x3a8473){if(_0x3a8473){return _0x3a8473?{'count':_0x3ef519,'rows':_0x3a8473}:null;}})['then'](respondWithResult(_0x35cdd5,null))[_0xa276('0x41')](handleError(_0x35cdd5,null));}; \ No newline at end of file +var _0x88f8=['intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','includeAll','catch','create','body','find','destroy','getFields','nolimit','getSubjects','findOne','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','update','then','end','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','query','keys','filters'];(function(_0x52d434,_0x217afd){var _0xb7d227=function(_0x2a8422){while(--_0x2a8422){_0x52d434['push'](_0x52d434['shift']());}};_0xb7d227(++_0x217afd);}(_0x88f8,0x72));var _0x888f=function(_0x409b47,_0xf9a1db){_0x409b47=_0x409b47-0x0;var _0xce1cc8=_0x88f8[_0x409b47];return _0xce1cc8;};'use strict';var emlformat=require(_0x888f('0x0'));var rimraf=require(_0x888f('0x1'));var zipdir=require(_0x888f('0x2'));var jsonpatch=require(_0x888f('0x3'));var rp=require(_0x888f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x888f('0x5'));var util=require(_0x888f('0x6'));var path=require(_0x888f('0x7'));var sox=require(_0x888f('0x8'));var csv=require(_0x888f('0x9'));var ejs=require(_0x888f('0xa'));var fs=require('fs');var fs_extra=require(_0x888f('0xb'));var _=require(_0x888f('0xc'));var squel=require(_0x888f('0xd'));var crypto=require(_0x888f('0xe'));var jsforce=require(_0x888f('0xf'));var deskjs=require(_0x888f('0x10'));var toCsv=require(_0x888f('0x9'));var querystring=require(_0x888f('0x11'));var Papa=require(_0x888f('0x12'));var Redis=require('ioredis');var authService=require(_0x888f('0x13'));var qs=require(_0x888f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x888f('0x15'));var logger=require(_0x888f('0x16'))(_0x888f('0x17'));var utils=require('../../config/utils');var config=require(_0x888f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x888f('0x19'))['db'];function respondWithStatusCode(_0x54e541,_0x30369c){_0x30369c=_0x30369c||0xcc;return function(_0x16f49b){if(_0x16f49b){return _0x54e541[_0x888f('0x1a')](_0x30369c);}return _0x54e541['status'](_0x30369c)['end']();};}function respondWithResult(_0x97f1ef,_0x54bfae){_0x54bfae=_0x54bfae||0xc8;return function(_0x3e239a){if(_0x3e239a){return _0x97f1ef[_0x888f('0x1b')](_0x54bfae)[_0x888f('0x1c')](_0x3e239a);}};}function respondWithFilteredResult(_0x42b2e8,_0x2f0b0a){return function(_0x207d79){if(_0x207d79){var _0x23a991=typeof _0x2f0b0a['offset']===_0x888f('0x1d')&&typeof _0x2f0b0a[_0x888f('0x1e')]===_0x888f('0x1d');var _0x590cda=_0x207d79['count'];var _0x228cf2=_0x23a991?0x0:_0x2f0b0a[_0x888f('0x1f')];var _0x3a4fae=_0x23a991?_0x207d79[_0x888f('0x20')]:_0x2f0b0a['offset']+_0x2f0b0a['limit'];var _0x34cdc6;if(_0x3a4fae>=_0x590cda){_0x3a4fae=_0x590cda;_0x34cdc6=0xc8;}else{_0x34cdc6=0xce;}_0x42b2e8[_0x888f('0x1b')](_0x34cdc6);return _0x42b2e8[_0x888f('0x21')]('Content-Range',_0x228cf2+'-'+_0x3a4fae+'/'+_0x590cda)[_0x888f('0x1c')](_0x207d79);}return null;};}function patchUpdates(_0x1d0ecd){return function(_0x264a8f){try{jsonpatch[_0x888f('0x22')](_0x264a8f,_0x1d0ecd,!![]);}catch(_0x58d317){return BPromise[_0x888f('0x23')](_0x58d317);}return _0x264a8f['save']();};}function saveUpdates(_0x41203c,_0x3a1341){return function(_0x41cf0f){if(_0x41cf0f){return _0x41cf0f[_0x888f('0x24')](_0x41203c)[_0x888f('0x25')](function(_0x3f5153){return _0x3f5153;});}return null;};}function removeEntity(_0xc8bee2,_0x5b475a){return function(_0x5aafb9){if(_0x5aafb9){return _0x5aafb9['destroy']()[_0x888f('0x25')](function(){_0xc8bee2[_0x888f('0x1b')](0xcc)[_0x888f('0x26')]();});}};}function handleEntityNotFound(_0xd23ed,_0x2a9d0a){return function(_0x389fc8){if(!_0x389fc8){_0xd23ed[_0x888f('0x1a')](0x194);}return _0x389fc8;};}function handleError(_0x2ef2c5,_0x47fdd3){_0x47fdd3=_0x47fdd3||0x1f4;return function(_0x20143f){logger[_0x888f('0x27')](_0x20143f[_0x888f('0x28')]);if(_0x20143f[_0x888f('0x29')]){delete _0x20143f[_0x888f('0x29')];}_0x2ef2c5['status'](_0x47fdd3)[_0x888f('0x2a')](_0x20143f);};}exports[_0x888f('0x2b')]=function(_0x59d959,_0x7086f4){var _0xe631bf={},_0x50e468={},_0x516895={'count':0x0,'rows':[]};var _0xa8be7=_[_0x888f('0x2c')](db[_0x888f('0x2d')]['rawAttributes'],function(_0x128c67){return{'name':_0x128c67[_0x888f('0x2e')],'type':_0x128c67[_0x888f('0x2f')][_0x888f('0x30')]};});_0x50e468['model']=_[_0x888f('0x2c')](_0xa8be7,_0x888f('0x29'));_0x50e468[_0x888f('0x31')]=_[_0x888f('0x32')](_0x59d959[_0x888f('0x31')]);_0x50e468[_0x888f('0x33')]=_[_0x888f('0x34')](_0x50e468[_0x888f('0x35')],_0x50e468[_0x888f('0x31')]);_0xe631bf[_0x888f('0x36')]=_[_0x888f('0x34')](_0x50e468[_0x888f('0x35')],qs[_0x888f('0x37')](_0x59d959[_0x888f('0x31')][_0x888f('0x37')]));_0xe631bf['attributes']=_0xe631bf[_0x888f('0x36')][_0x888f('0x38')]?_0xe631bf['attributes']:_0x50e468['model'];if(!_0x59d959['query'][_0x888f('0x39')]('nolimit')){_0xe631bf['limit']=qs[_0x888f('0x1e')](_0x59d959[_0x888f('0x31')][_0x888f('0x1e')]);_0xe631bf[_0x888f('0x1f')]=qs[_0x888f('0x1f')](_0x59d959[_0x888f('0x31')][_0x888f('0x1f')]);}_0xe631bf[_0x888f('0x3a')]=qs[_0x888f('0x3b')](_0x59d959[_0x888f('0x31')]['sort']);_0xe631bf[_0x888f('0x3c')]=qs[_0x888f('0x33')](_[_0x888f('0x3d')](_0x59d959[_0x888f('0x31')],_0x50e468['filters']),_0xa8be7);if(_0x59d959[_0x888f('0x31')][_0x888f('0x3e')]){_0xe631bf['where']=_[_0x888f('0x3f')](_0xe631bf[_0x888f('0x3c')],{'$or':_['map'](_0xa8be7,function(_0x12b27f){if(_0x12b27f['type']!==_0x888f('0x40')){var _0x4f29ad={};_0x4f29ad[_0x12b27f[_0x888f('0x29')]]={'$like':'%'+_0x59d959[_0x888f('0x31')][_0x888f('0x3e')]+'%'};return _0x4f29ad;}})});}_0xe631bf=_[_0x888f('0x3f')]({},_0xe631bf,_0x59d959[_0x888f('0x41')]);var _0x8a7077={'where':_0xe631bf[_0x888f('0x3c')]};return db[_0x888f('0x2d')]['count'](_0x8a7077)['then'](function(_0x35010a){_0x516895['count']=_0x35010a;if(_0x59d959[_0x888f('0x31')]['includeAll']){_0xe631bf[_0x888f('0x42')]=[{'all':!![]}];}return db[_0x888f('0x2d')]['findAll'](_0xe631bf);})[_0x888f('0x25')](function(_0x5e676a){_0x516895[_0x888f('0x43')]=_0x5e676a;return _0x516895;})[_0x888f('0x25')](respondWithFilteredResult(_0x7086f4,_0xe631bf))['catch'](handleError(_0x7086f4,null));};exports[_0x888f('0x44')]=function(_0x2b0eb7,_0x26f89e){var _0x4d39c8={'raw':![],'where':{'id':_0x2b0eb7[_0x888f('0x45')]['id']}},_0x55b03e={};_0x55b03e[_0x888f('0x35')]=_['keys'](db[_0x888f('0x2d')][_0x888f('0x46')]);_0x55b03e[_0x888f('0x31')]=_[_0x888f('0x32')](_0x2b0eb7[_0x888f('0x31')]);_0x55b03e[_0x888f('0x33')]=_['intersection'](_0x55b03e[_0x888f('0x35')],_0x55b03e[_0x888f('0x31')]);_0x4d39c8[_0x888f('0x36')]=_[_0x888f('0x34')](_0x55b03e[_0x888f('0x35')],qs[_0x888f('0x37')](_0x2b0eb7[_0x888f('0x31')][_0x888f('0x37')]));_0x4d39c8[_0x888f('0x36')]=_0x4d39c8[_0x888f('0x36')][_0x888f('0x38')]?_0x4d39c8[_0x888f('0x36')]:_0x55b03e[_0x888f('0x35')];if(_0x2b0eb7['query'][_0x888f('0x47')]){_0x4d39c8[_0x888f('0x42')]=[{'all':!![]}];}_0x4d39c8=_[_0x888f('0x3f')]({},_0x4d39c8,_0x2b0eb7[_0x888f('0x41')]);return db[_0x888f('0x2d')]['find'](_0x4d39c8)[_0x888f('0x25')](handleEntityNotFound(_0x26f89e,null))[_0x888f('0x25')](respondWithResult(_0x26f89e,null))[_0x888f('0x48')](handleError(_0x26f89e,null));};exports[_0x888f('0x49')]=function(_0x93f693,_0x455ae7){return db[_0x888f('0x2d')][_0x888f('0x49')](_0x93f693['body'],{})[_0x888f('0x25')](respondWithResult(_0x455ae7,0xc9))[_0x888f('0x48')](handleError(_0x455ae7,null));};exports[_0x888f('0x24')]=function(_0x2204f4,_0x50478d){if(_0x2204f4[_0x888f('0x4a')]['id']){delete _0x2204f4['body']['id'];}return db[_0x888f('0x2d')][_0x888f('0x4b')]({'where':{'id':_0x2204f4[_0x888f('0x45')]['id']}})[_0x888f('0x25')](handleEntityNotFound(_0x50478d,null))['then'](saveUpdates(_0x2204f4[_0x888f('0x4a')],null))[_0x888f('0x25')](respondWithResult(_0x50478d,null))['catch'](handleError(_0x50478d,null));};exports[_0x888f('0x4c')]=function(_0x4d974c,_0x55de05){return db[_0x888f('0x2d')][_0x888f('0x4b')]({'where':{'id':_0x4d974c[_0x888f('0x45')]['id']}})[_0x888f('0x25')](handleEntityNotFound(_0x55de05,null))[_0x888f('0x25')](removeEntity(_0x55de05,null))['catch'](handleError(_0x55de05,null));};exports['getFields']=function(_0x2634a6,_0x386ce4,_0x36203e){var _0x4453a1={};var _0x535cb9={};var _0x2b3e95;var _0x346be5;return db[_0x888f('0x2d')]['findOne']({'where':{'id':_0x2634a6[_0x888f('0x45')]['id']}})[_0x888f('0x25')](handleEntityNotFound(_0x386ce4,null))['then'](function(_0x3781c7){if(_0x3781c7){_0x2b3e95=_0x3781c7;_0x535cb9[_0x888f('0x35')]=_[_0x888f('0x32')](db['SugarcrmField'][_0x888f('0x46')]);_0x535cb9[_0x888f('0x31')]=_['keys'](_0x2634a6[_0x888f('0x31')]);_0x535cb9[_0x888f('0x33')]=_['intersection'](_0x535cb9[_0x888f('0x35')],_0x535cb9['query']);_0x4453a1[_0x888f('0x36')]=_[_0x888f('0x34')](_0x535cb9[_0x888f('0x35')],qs[_0x888f('0x37')](_0x2634a6['query'][_0x888f('0x37')]));_0x4453a1[_0x888f('0x36')]=_0x4453a1[_0x888f('0x36')][_0x888f('0x38')]?_0x4453a1[_0x888f('0x36')]:_0x535cb9['model'];_0x4453a1[_0x888f('0x3a')]=qs[_0x888f('0x3b')](_0x2634a6['query'][_0x888f('0x3b')]);_0x4453a1[_0x888f('0x3c')]=qs[_0x888f('0x33')](_[_0x888f('0x3d')](_0x2634a6[_0x888f('0x31')],_0x535cb9[_0x888f('0x33')]));if(_0x2634a6[_0x888f('0x31')][_0x888f('0x3e')]){_0x4453a1['where']=_[_0x888f('0x3f')](_0x4453a1[_0x888f('0x3c')],{'$or':_['map'](_0x4453a1[_0x888f('0x36')],function(_0x58db7e){var _0x4f1ed5={};_0x4f1ed5[_0x58db7e]={'$like':'%'+_0x2634a6[_0x888f('0x31')][_0x888f('0x3e')]+'%'};return _0x4f1ed5;})});}_0x4453a1=_[_0x888f('0x3f')]({},_0x4453a1,_0x2634a6['options']);return _0x2b3e95[_0x888f('0x4d')](_0x4453a1);}})['then'](function(_0x56f052){if(_0x56f052){_0x346be5=_0x56f052[_0x888f('0x38')];if(!_0x2634a6[_0x888f('0x31')][_0x888f('0x39')](_0x888f('0x4e'))){_0x4453a1['limit']=qs[_0x888f('0x1e')](_0x2634a6[_0x888f('0x31')][_0x888f('0x1e')]);_0x4453a1['offset']=qs[_0x888f('0x1f')](_0x2634a6['query'][_0x888f('0x1f')]);}return _0x2b3e95[_0x888f('0x4d')](_0x4453a1);}})['then'](function(_0x2fd931){if(_0x2fd931){return _0x2fd931?{'count':_0x346be5,'rows':_0x2fd931}:null;}})['then'](respondWithResult(_0x386ce4,null))['catch'](handleError(_0x386ce4,null));};exports[_0x888f('0x4f')]=function(_0x276f7d,_0x5e74d1,_0x440d96){var _0x1d1c5b={};var _0x55cb76={};var _0xaa7a18;var _0x577f06;return db[_0x888f('0x2d')][_0x888f('0x50')]({'where':{'id':_0x276f7d['params']['id']}})['then'](handleEntityNotFound(_0x5e74d1,null))['then'](function(_0x14c067){if(_0x14c067){_0xaa7a18=_0x14c067;_0x55cb76[_0x888f('0x35')]=_['keys'](db[_0x888f('0x51')][_0x888f('0x46')]);_0x55cb76[_0x888f('0x31')]=_['keys'](_0x276f7d[_0x888f('0x31')]);_0x55cb76[_0x888f('0x33')]=_[_0x888f('0x34')](_0x55cb76[_0x888f('0x35')],_0x55cb76['query']);_0x1d1c5b[_0x888f('0x36')]=_[_0x888f('0x34')](_0x55cb76[_0x888f('0x35')],qs[_0x888f('0x37')](_0x276f7d[_0x888f('0x31')][_0x888f('0x37')]));_0x1d1c5b[_0x888f('0x36')]=_0x1d1c5b['attributes']['length']?_0x1d1c5b[_0x888f('0x36')]:_0x55cb76['model'];_0x1d1c5b[_0x888f('0x3a')]=qs[_0x888f('0x3b')](_0x276f7d['query'][_0x888f('0x3b')]);_0x1d1c5b[_0x888f('0x3c')]=qs[_0x888f('0x33')](_[_0x888f('0x3d')](_0x276f7d['query'],_0x55cb76[_0x888f('0x33')]));if(_0x276f7d['query'][_0x888f('0x3e')]){_0x1d1c5b['where']=_[_0x888f('0x3f')](_0x1d1c5b['where'],{'$or':_['map'](_0x1d1c5b[_0x888f('0x36')],function(_0x5d07d8){var _0x51dd44={};_0x51dd44[_0x5d07d8]={'$like':'%'+_0x276f7d[_0x888f('0x31')][_0x888f('0x3e')]+'%'};return _0x51dd44;})});}_0x1d1c5b=_[_0x888f('0x3f')]({},_0x1d1c5b,_0x276f7d['options']);return _0xaa7a18[_0x888f('0x4f')](_0x1d1c5b);}})[_0x888f('0x25')](function(_0x4e1166){if(_0x4e1166){_0x577f06=_0x4e1166['length'];if(!_0x276f7d[_0x888f('0x31')][_0x888f('0x39')](_0x888f('0x4e'))){_0x1d1c5b['limit']=qs[_0x888f('0x1e')](_0x276f7d[_0x888f('0x31')][_0x888f('0x1e')]);_0x1d1c5b[_0x888f('0x1f')]=qs['offset'](_0x276f7d[_0x888f('0x31')]['offset']);}return _0xaa7a18[_0x888f('0x4f')](_0x1d1c5b);}})[_0x888f('0x25')](function(_0x4018cb){if(_0x4018cb){return _0x4018cb?{'count':_0x577f06,'rows':_0x4018cb}:null;}})[_0x888f('0x25')](respondWithResult(_0x5e74d1,null))['catch'](handleError(_0x5e74d1,null));};exports['getDescriptions']=function(_0x40e7a8,_0x48358a,_0x297cf1){var _0x1efeeb={};var _0x1a2642={};var _0x4b2112;var _0x166a0b;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x40e7a8[_0x888f('0x45')]['id']}})[_0x888f('0x25')](handleEntityNotFound(_0x48358a,null))['then'](function(_0x481f4a){if(_0x481f4a){_0x4b2112=_0x481f4a;_0x1a2642[_0x888f('0x35')]=_['keys'](db[_0x888f('0x51')]['rawAttributes']);_0x1a2642[_0x888f('0x31')]=_['keys'](_0x40e7a8[_0x888f('0x31')]);_0x1a2642[_0x888f('0x33')]=_['intersection'](_0x1a2642['model'],_0x1a2642[_0x888f('0x31')]);_0x1efeeb[_0x888f('0x36')]=_[_0x888f('0x34')](_0x1a2642[_0x888f('0x35')],qs[_0x888f('0x37')](_0x40e7a8[_0x888f('0x31')]['fields']));_0x1efeeb[_0x888f('0x36')]=_0x1efeeb[_0x888f('0x36')][_0x888f('0x38')]?_0x1efeeb[_0x888f('0x36')]:_0x1a2642[_0x888f('0x35')];_0x1efeeb[_0x888f('0x3a')]=qs['sort'](_0x40e7a8[_0x888f('0x31')]['sort']);_0x1efeeb[_0x888f('0x3c')]=qs[_0x888f('0x33')](_[_0x888f('0x3d')](_0x40e7a8[_0x888f('0x31')],_0x1a2642[_0x888f('0x33')]));if(_0x40e7a8['query']['filter']){_0x1efeeb[_0x888f('0x3c')]=_[_0x888f('0x3f')](_0x1efeeb['where'],{'$or':_[_0x888f('0x2c')](_0x1efeeb[_0x888f('0x36')],function(_0x2471e2){var _0x389f5c={};_0x389f5c[_0x2471e2]={'$like':'%'+_0x40e7a8[_0x888f('0x31')][_0x888f('0x3e')]+'%'};return _0x389f5c;})});}_0x1efeeb=_['merge']({},_0x1efeeb,_0x40e7a8[_0x888f('0x41')]);return _0x4b2112[_0x888f('0x52')](_0x1efeeb);}})[_0x888f('0x25')](function(_0x163949){if(_0x163949){_0x166a0b=_0x163949[_0x888f('0x38')];if(!_0x40e7a8['query'][_0x888f('0x39')]('nolimit')){_0x1efeeb[_0x888f('0x1e')]=qs[_0x888f('0x1e')](_0x40e7a8[_0x888f('0x31')][_0x888f('0x1e')]);_0x1efeeb[_0x888f('0x1f')]=qs[_0x888f('0x1f')](_0x40e7a8[_0x888f('0x31')][_0x888f('0x1f')]);}return _0x4b2112[_0x888f('0x52')](_0x1efeeb);}})[_0x888f('0x25')](function(_0x2979f4){if(_0x2979f4){return _0x2979f4?{'count':_0x166a0b,'rows':_0x2979f4}:null;}})[_0x888f('0x25')](respondWithResult(_0x48358a,null))[_0x888f('0x48')](handleError(_0x48358a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 93672f4..a8fab17 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 _0x25ef=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x5efdc0,_0x2f7a64){var _0x377ab5=function(_0x3aa1ec){while(--_0x3aa1ec){_0x5efdc0['push'](_0x5efdc0['shift']());}};_0x377ab5(++_0x2f7a64);}(_0x25ef,0xaa));var _0xf25e=function(_0x29c019,_0x19fd01){_0x29c019=_0x29c019-0x0;var _0x11e171=_0x25ef[_0x29c019];return _0x11e171;};'use strict';var _=require(_0xf25e('0x0'));var util=require(_0xf25e('0x1'));var logger=require(_0xf25e('0x2'))(_0xf25e('0x3'));var moment=require(_0xf25e('0x4'));var BPromise=require(_0xf25e('0x5'));var rp=require(_0xf25e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf25e('0x7'));var config=require('../../config/environment');var attributes=require(_0xf25e('0x8'));module[_0xf25e('0x9')]=function(_0x5bf029,_0x5715e9){return _0x5bf029[_0xf25e('0xa')](_0xf25e('0xb'),attributes,{'tableName':_0xf25e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4af9=['./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1df4f7,_0x2996d5){var _0x4436e9=function(_0x20ab52){while(--_0x20ab52){_0x1df4f7['push'](_0x1df4f7['shift']());}};_0x4436e9(++_0x2996d5);}(_0x4af9,0x12c));var _0x94af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4af9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x94af('0x0'));var util=require(_0x94af('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x94af('0x2'));var BPromise=require(_0x94af('0x3'));var rp=require(_0x94af('0x4'));var fs=require('fs');var path=require(_0x94af('0x5'));var rimraf=require(_0x94af('0x6'));var config=require(_0x94af('0x7'));var attributes=require(_0x94af('0x8'));module['exports']=function(_0x28a640,_0x360a33){return _0x28a640[_0x94af('0x9')](_0x94af('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 6e9f19b..2e6bd23 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 _0x4380=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x3acccc,_0x3a7a65){var _0x1649fe=function(_0x7f3484){while(--_0x7f3484){_0x3acccc['push'](_0x3acccc['shift']());}};_0x1649fe(++_0x3a7a65);}(_0x4380,0xa2));var _0x0438=function(_0x5cd9e2,_0x2048e5){_0x5cd9e2=_0x5cd9e2-0x0;var _0x244127=_0x4380[_0x5cd9e2];return _0x244127;};'use strict';var _=require('lodash');var util=require(_0x0438('0x0'));var moment=require(_0x0438('0x1'));var BPromise=require(_0x0438('0x2'));var rs=require(_0x0438('0x3'));var fs=require('fs');var Redis=require(_0x0438('0x4'));var db=require(_0x0438('0x5'))['db'];var utils=require(_0x0438('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0438('0x7'));var jayson=require(_0x0438('0x8'));var client=jayson[_0x0438('0x9')][_0x0438('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x516453,_0x257559,_0x554742){return new BPromise(function(_0x57937f,_0x545219){return client[_0x0438('0xb')](_0x516453,_0x554742)[_0x0438('0xc')](function(_0xfaf19b){logger['info'](_0x0438('0xd'),_0x257559,_0x0438('0xe'));logger[_0x0438('0xf')](_0x0438('0x10'),_0x257559,'request\x20sent',JSON[_0x0438('0x11')](_0xfaf19b));if(_0xfaf19b[_0x0438('0x12')]){if(_0xfaf19b[_0x0438('0x12')][_0x0438('0x13')]===0x1f4){logger[_0x0438('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x257559,_0xfaf19b[_0x0438('0x12')][_0x0438('0x14')]);return _0x545219(_0xfaf19b[_0x0438('0x12')][_0x0438('0x14')]);}logger[_0x0438('0x12')](_0x0438('0xd'),_0x257559,_0xfaf19b[_0x0438('0x12')][_0x0438('0x14')]);return _0x57937f(_0xfaf19b[_0x0438('0x12')]['message']);}else{logger['info'](_0x0438('0xd'),_0x257559,_0x0438('0xe'));_0x57937f(_0xfaf19b['result'][_0x0438('0x14')]);}})[_0x0438('0x15')](function(_0x22a68f){logger['error'](_0x0438('0xd'),_0x257559,_0x22a68f);_0x545219(_0x22a68f);});});} \ No newline at end of file +var _0x55d1=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0xb9a43a,_0x2ec78a){var _0x2859cf=function(_0x169960){while(--_0x169960){_0xb9a43a['push'](_0xb9a43a['shift']());}};_0x2859cf(++_0x2ec78a);}(_0x55d1,0x1ca));var _0x155d=function(_0x2ecd91,_0x1f21e8){_0x2ecd91=_0x2ecd91-0x0;var _0x3bf737=_0x55d1[_0x2ecd91];return _0x3bf737;};'use strict';var _=require(_0x155d('0x0'));var util=require(_0x155d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x155d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x155d('0x3'))['db'];var utils=require(_0x155d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x155d('0x5'));var jayson=require(_0x155d('0x6'));var client=jayson[_0x155d('0x7')][_0x155d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c069c,_0x5d2150,_0x3eb161){return new BPromise(function(_0x2795ef,_0x323054){return client[_0x155d('0x9')](_0x4c069c,_0x3eb161)[_0x155d('0xa')](function(_0x3ec6e0){logger[_0x155d('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5d2150,_0x155d('0xc'));logger[_0x155d('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x5d2150,'request\x20sent',JSON['stringify'](_0x3ec6e0));if(_0x3ec6e0[_0x155d('0xe')]){if(_0x3ec6e0['error'][_0x155d('0xf')]===0x1f4){logger[_0x155d('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5d2150,_0x3ec6e0[_0x155d('0xe')][_0x155d('0x10')]);return _0x323054(_0x3ec6e0['error'][_0x155d('0x10')]);}logger['error'](_0x155d('0x11'),_0x5d2150,_0x3ec6e0['error'][_0x155d('0x10')]);return _0x2795ef(_0x3ec6e0['error'][_0x155d('0x10')]);}else{logger[_0x155d('0xb')](_0x155d('0x11'),_0x5d2150,_0x155d('0xc'));_0x2795ef(_0x3ec6e0[_0x155d('0x12')]['message']);}})[_0x155d('0x13')](function(_0xe4b039){logger[_0x155d('0xe')](_0x155d('0x11'),_0x5d2150,_0xe4b039);_0x323054(_0xe4b039);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 3ae217d..163929b 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 _0xa0ca=['isAuthenticated','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intSugarcrmField.controller','index','get'];(function(_0x4a60a3,_0xb8539c){var _0x348c8d=function(_0x2be68d){while(--_0x2be68d){_0x4a60a3['push'](_0x4a60a3['shift']());}};_0x348c8d(++_0xb8539c);}(_0xa0ca,0x156));var _0xaa0c=function(_0x27d7a9,_0x5a6c33){_0x27d7a9=_0x27d7a9-0x0;var _0x114c9f=_0xa0ca[_0x27d7a9];return _0x114c9f;};'use strict';var multer=require(_0xaa0c('0x0'));var util=require(_0xaa0c('0x1'));var path=require(_0xaa0c('0x2'));var timeout=require(_0xaa0c('0x3'));var express=require(_0xaa0c('0x4'));var router=express['Router']();var fs_extra=require(_0xaa0c('0x5'));var auth=require(_0xaa0c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaa0c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xaa0c('0x8')]);router[_0xaa0c('0x9')]('/:id',auth[_0xaa0c('0xa')](),controller['show']);router[_0xaa0c('0xb')]('/',auth[_0xaa0c('0xa')](),controller[_0xaa0c('0xc')]);router['put'](_0xaa0c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaa0c('0xe')](_0xaa0c('0xd'),auth[_0xaa0c('0xa')](),controller[_0xaa0c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1af8=['../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x5afba3,_0x9b68){var _0x395689=function(_0x1d264c){while(--_0x1d264c){_0x5afba3['push'](_0x5afba3['shift']());}};_0x395689(++_0x9b68);}(_0x1af8,0x8c));var _0x81af=function(_0x4df86b,_0x1a7d14){_0x4df86b=_0x4df86b-0x0;var _0x4e47a1=_0x1af8[_0x4df86b];return _0x4e47a1;};'use strict';var multer=require(_0x81af('0x0'));var util=require(_0x81af('0x1'));var path=require('path');var timeout=require(_0x81af('0x2'));var express=require('express');var router=express[_0x81af('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x81af('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x81af('0x5'));var controller=require(_0x81af('0x6'));router[_0x81af('0x7')]('/',auth[_0x81af('0x8')](),controller[_0x81af('0x9')]);router[_0x81af('0x7')](_0x81af('0xa'),auth[_0x81af('0x8')](),controller['show']);router[_0x81af('0xb')]('/',auth[_0x81af('0x8')](),controller['create']);router[_0x81af('0xc')]('/:id',auth[_0x81af('0x8')](),controller[_0x81af('0xd')]);router[_0x81af('0xe')]('/:id',auth[_0x81af('0x8')](),controller[_0x81af('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9750b47..3951042 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 _0x8dc1=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x36072d,_0x24f414){var _0x32a52c=function(_0x19834c){while(--_0x19834c){_0x36072d['push'](_0x36072d['shift']());}};_0x32a52c(++_0x24f414);}(_0x8dc1,0x164));var _0x18dc=function(_0x17f52e,_0x4da384){_0x17f52e=_0x17f52e-0x0;var _0x27b3a9=_0x8dc1[_0x17f52e];return _0x27b3a9;};'use strict';var Sequelize=require(_0x18dc('0x0'));module[_0x18dc('0x1')]={'type':{'type':Sequelize[_0x18dc('0x2')](_0x18dc('0x3'),_0x18dc('0x4'),_0x18dc('0x5'),_0x18dc('0x6'),_0x18dc('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x18dc('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x18dc('0x3'),_0x18dc('0x4'),_0x18dc('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x18dc('0x8')]},'nameField':{'type':Sequelize[_0x18dc('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x18dc('0x8')]}}; \ No newline at end of file +var _0xa181=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3eaa38,_0x4dc13d){var _0x11d586=function(_0x1a87da){while(--_0x1a87da){_0x3eaa38['push'](_0x3eaa38['shift']());}};_0x11d586(++_0x4dc13d);}(_0xa181,0x8f));var _0x1a18=function(_0x2416c1,_0x1d0bf7){_0x2416c1=_0x2416c1-0x0;var _0x2265aa=_0xa181[_0x2416c1];return _0x2265aa;};'use strict';var Sequelize=require(_0x1a18('0x0'));module[_0x1a18('0x1')]={'type':{'type':Sequelize[_0x1a18('0x2')](_0x1a18('0x3'),_0x1a18('0x4'),_0x1a18('0x5'),_0x1a18('0x6'),_0x1a18('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a18('0x8')]},'keyType':{'type':Sequelize[_0x1a18('0x2')](_0x1a18('0x3'),'variable',_0x1a18('0x5'))},'keyContent':{'type':Sequelize[_0x1a18('0x8')]},'idField':{'type':Sequelize[_0x1a18('0x8')]},'nameField':{'type':Sequelize[_0x1a18('0x8')]},'customField':{'type':Sequelize[_0x1a18('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a18('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 802a0eb..ba8de91 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 _0x597d=['save','update','then','error','stack','name','send','map','SugarcrmField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply'];(function(_0x30b189,_0xd873f1){var _0x5983c7=function(_0x1c0872){while(--_0x1c0872){_0x30b189['push'](_0x30b189['shift']());}};_0x5983c7(++_0xd873f1);}(_0x597d,0x10f));var _0xd597=function(_0x3b3643,_0x3f4a58){_0x3b3643=_0x3b3643-0x0;var _0xd093dd=_0x597d[_0x3b3643];return _0xd093dd;};'use strict';var emlformat=require(_0xd597('0x0'));var rimraf=require(_0xd597('0x1'));var zipdir=require(_0xd597('0x2'));var jsonpatch=require(_0xd597('0x3'));var rp=require('request-promise');var moment=require(_0xd597('0x4'));var BPromise=require(_0xd597('0x5'));var Mustache=require(_0xd597('0x6'));var util=require(_0xd597('0x7'));var path=require(_0xd597('0x8'));var sox=require(_0xd597('0x9'));var csv=require(_0xd597('0xa'));var ejs=require(_0xd597('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd597('0xc'));var squel=require('squel');var crypto=require(_0xd597('0xd'));var jsforce=require(_0xd597('0xe'));var deskjs=require(_0xd597('0xf'));var toCsv=require(_0xd597('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd597('0x10'));var authService=require(_0xd597('0x11'));var qs=require(_0xd597('0x12'));var as=require(_0xd597('0x13'));var hardwareService=require(_0xd597('0x14'));var logger=require(_0xd597('0x15'))(_0xd597('0x16'));var utils=require(_0xd597('0x17'));var config=require(_0xd597('0x18'));var licenseUtil=require(_0xd597('0x19'));var db=require(_0xd597('0x1a'))['db'];function respondWithStatusCode(_0x3a4a05,_0x35c556){_0x35c556=_0x35c556||0xcc;return function(_0x53541b){if(_0x53541b){return _0x3a4a05[_0xd597('0x1b')](_0x35c556);}return _0x3a4a05[_0xd597('0x1c')](_0x35c556)[_0xd597('0x1d')]();};}function respondWithResult(_0x2520cb,_0xa5e71f){_0xa5e71f=_0xa5e71f||0xc8;return function(_0x4ce769){if(_0x4ce769){return _0x2520cb[_0xd597('0x1c')](_0xa5e71f)[_0xd597('0x1e')](_0x4ce769);}};}function respondWithFilteredResult(_0xd10808,_0x47afa6){return function(_0xa57aee){if(_0xa57aee){var _0x229f5e=typeof _0x47afa6['offset']===_0xd597('0x1f')&&typeof _0x47afa6[_0xd597('0x20')]===_0xd597('0x1f');var _0x3c59fc=_0xa57aee[_0xd597('0x21')];var _0x2ea31c=_0x229f5e?0x0:_0x47afa6['offset'];var _0x558a03=_0x229f5e?_0xa57aee[_0xd597('0x21')]:_0x47afa6['offset']+_0x47afa6['limit'];var _0x1e3dd5;if(_0x558a03>=_0x3c59fc){_0x558a03=_0x3c59fc;_0x1e3dd5=0xc8;}else{_0x1e3dd5=0xce;}_0xd10808['status'](_0x1e3dd5);return _0xd10808[_0xd597('0x22')](_0xd597('0x23'),_0x2ea31c+'-'+_0x558a03+'/'+_0x3c59fc)[_0xd597('0x1e')](_0xa57aee);}return null;};}function patchUpdates(_0x49c0a8){return function(_0x363f67){try{jsonpatch[_0xd597('0x24')](_0x363f67,_0x49c0a8,!![]);}catch(_0x1b6d09){return BPromise['reject'](_0x1b6d09);}return _0x363f67[_0xd597('0x25')]();};}function saveUpdates(_0x1786da,_0x4c8217){return function(_0x1b1f6f){if(_0x1b1f6f){return _0x1b1f6f[_0xd597('0x26')](_0x1786da)[_0xd597('0x27')](function(_0x2d7ad6){return _0x2d7ad6;});}return null;};}function removeEntity(_0x2caf98,_0x52826e){return function(_0x435d21){if(_0x435d21){return _0x435d21['destroy']()[_0xd597('0x27')](function(){_0x2caf98[_0xd597('0x1c')](0xcc)[_0xd597('0x1d')]();});}};}function handleEntityNotFound(_0x32716b,_0x5da105){return function(_0x5bc70f){if(!_0x5bc70f){_0x32716b['sendStatus'](0x194);}return _0x5bc70f;};}function handleError(_0x598fe5,_0x1befa3){_0x1befa3=_0x1befa3||0x1f4;return function(_0x2815e0){logger[_0xd597('0x28')](_0x2815e0[_0xd597('0x29')]);if(_0x2815e0[_0xd597('0x2a')]){delete _0x2815e0[_0xd597('0x2a')];}_0x598fe5[_0xd597('0x1c')](_0x1befa3)[_0xd597('0x2b')](_0x2815e0);};}exports['index']=function(_0x22908d,_0x1ac2ab){var _0x1dec4e={},_0x2b749e={},_0x43e321={'count':0x0,'rows':[]};var _0x201dbc=_[_0xd597('0x2c')](db[_0xd597('0x2d')]['rawAttributes'],function(_0x34bdf7){return{'name':_0x34bdf7[_0xd597('0x2e')],'type':_0x34bdf7[_0xd597('0x2f')][_0xd597('0x30')]};});_0x2b749e[_0xd597('0x31')]=_[_0xd597('0x2c')](_0x201dbc,_0xd597('0x2a'));_0x2b749e[_0xd597('0x32')]=_['keys'](_0x22908d[_0xd597('0x32')]);_0x2b749e[_0xd597('0x33')]=_['intersection'](_0x2b749e[_0xd597('0x31')],_0x2b749e[_0xd597('0x32')]);_0x1dec4e['attributes']=_[_0xd597('0x34')](_0x2b749e[_0xd597('0x31')],qs[_0xd597('0x35')](_0x22908d[_0xd597('0x32')]['fields']));_0x1dec4e[_0xd597('0x36')]=_0x1dec4e[_0xd597('0x36')][_0xd597('0x37')]?_0x1dec4e[_0xd597('0x36')]:_0x2b749e[_0xd597('0x31')];if(!_0x22908d['query'][_0xd597('0x38')](_0xd597('0x39'))){_0x1dec4e[_0xd597('0x20')]=qs[_0xd597('0x20')](_0x22908d[_0xd597('0x32')][_0xd597('0x20')]);_0x1dec4e['offset']=qs[_0xd597('0x3a')](_0x22908d[_0xd597('0x32')][_0xd597('0x3a')]);}_0x1dec4e[_0xd597('0x3b')]=qs[_0xd597('0x3c')](_0x22908d['query'][_0xd597('0x3c')]);_0x1dec4e[_0xd597('0x3d')]=qs[_0xd597('0x33')](_[_0xd597('0x3e')](_0x22908d[_0xd597('0x32')],_0x2b749e[_0xd597('0x33')]),_0x201dbc);if(_0x22908d['query'][_0xd597('0x3f')]){_0x1dec4e[_0xd597('0x3d')]=_['merge'](_0x1dec4e[_0xd597('0x3d')],{'$or':_[_0xd597('0x2c')](_0x201dbc,function(_0x568e5b){if(_0x568e5b['type']!=='VIRTUAL'){var _0x53902f={};_0x53902f[_0x568e5b[_0xd597('0x2a')]]={'$like':'%'+_0x22908d[_0xd597('0x32')][_0xd597('0x3f')]+'%'};return _0x53902f;}})});}_0x1dec4e=_[_0xd597('0x40')]({},_0x1dec4e,_0x22908d[_0xd597('0x41')]);var _0x2e127b={'where':_0x1dec4e[_0xd597('0x3d')]};return db[_0xd597('0x2d')][_0xd597('0x21')](_0x2e127b)['then'](function(_0x1ccc17){_0x43e321[_0xd597('0x21')]=_0x1ccc17;if(_0x22908d['query'][_0xd597('0x42')]){_0x1dec4e['include']=[{'all':!![]}];}return db[_0xd597('0x2d')][_0xd597('0x43')](_0x1dec4e);})[_0xd597('0x27')](function(_0x115a53){_0x43e321['rows']=_0x115a53;return _0x43e321;})['then'](respondWithFilteredResult(_0x1ac2ab,_0x1dec4e))[_0xd597('0x44')](handleError(_0x1ac2ab,null));};exports[_0xd597('0x45')]=function(_0x386428,_0x35c0f5){var _0x103d5d={'raw':!![],'where':{'id':_0x386428[_0xd597('0x46')]['id']}},_0x3eac2f={};_0x3eac2f[_0xd597('0x31')]=_['keys'](db[_0xd597('0x2d')][_0xd597('0x47')]);_0x3eac2f['query']=_[_0xd597('0x48')](_0x386428[_0xd597('0x32')]);_0x3eac2f['filters']=_[_0xd597('0x34')](_0x3eac2f[_0xd597('0x31')],_0x3eac2f[_0xd597('0x32')]);_0x103d5d[_0xd597('0x36')]=_[_0xd597('0x34')](_0x3eac2f['model'],qs[_0xd597('0x35')](_0x386428[_0xd597('0x32')]['fields']));_0x103d5d[_0xd597('0x36')]=_0x103d5d[_0xd597('0x36')][_0xd597('0x37')]?_0x103d5d[_0xd597('0x36')]:_0x3eac2f[_0xd597('0x31')];if(_0x386428[_0xd597('0x32')]['includeAll']){_0x103d5d['include']=[{'all':!![]}];}_0x103d5d=_[_0xd597('0x40')]({},_0x103d5d,_0x386428[_0xd597('0x41')]);return db[_0xd597('0x2d')][_0xd597('0x49')](_0x103d5d)[_0xd597('0x27')](handleEntityNotFound(_0x35c0f5,null))[_0xd597('0x27')](respondWithResult(_0x35c0f5,null))[_0xd597('0x44')](handleError(_0x35c0f5,null));};exports[_0xd597('0x4a')]=function(_0x2afba8,_0x2c886b){return db['SugarcrmField'][_0xd597('0x4a')](_0x2afba8['body'],{})[_0xd597('0x27')](respondWithResult(_0x2c886b,0xc9))[_0xd597('0x44')](handleError(_0x2c886b,null));};exports[_0xd597('0x26')]=function(_0x45329f,_0x4d23e1){if(_0x45329f['body']['id']){delete _0x45329f['body']['id'];}return db['SugarcrmField'][_0xd597('0x49')]({'where':{'id':_0x45329f[_0xd597('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d23e1,null))[_0xd597('0x27')](saveUpdates(_0x45329f[_0xd597('0x4b')],null))[_0xd597('0x27')](respondWithResult(_0x4d23e1,null))[_0xd597('0x44')](handleError(_0x4d23e1,null));};exports[_0xd597('0x4c')]=function(_0x45018f,_0x4f16c0){return db[_0xd597('0x2d')][_0xd597('0x49')]({'where':{'id':_0x45018f[_0xd597('0x46')]['id']}})[_0xd597('0x27')](handleEntityNotFound(_0x4f16c0,null))[_0xd597('0x27')](removeEntity(_0x4f16c0,null))[_0xd597('0x44')](handleError(_0x4f16c0,null));}; \ No newline at end of file +var _0x649d=['json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x649d,0x15f));var _0xd649=function(_0xac0985,_0x764e2e){_0xac0985=_0xac0985-0x0;var _0x3f2c7e=_0x649d[_0xac0985];return _0x3f2c7e;};'use strict';var emlformat=require(_0xd649('0x0'));var rimraf=require(_0xd649('0x1'));var zipdir=require(_0xd649('0x2'));var jsonpatch=require(_0xd649('0x3'));var rp=require(_0xd649('0x4'));var moment=require(_0xd649('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd649('0x6'));var util=require(_0xd649('0x7'));var path=require(_0xd649('0x8'));var sox=require(_0xd649('0x9'));var csv=require('to-csv');var ejs=require(_0xd649('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd649('0xb'));var squel=require(_0xd649('0xc'));var crypto=require(_0xd649('0xd'));var jsforce=require(_0xd649('0xe'));var deskjs=require(_0xd649('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd649('0x10'));var qs=require(_0xd649('0x11'));var as=require(_0xd649('0x12'));var hardwareService=require(_0xd649('0x13'));var logger=require(_0xd649('0x14'))(_0xd649('0x15'));var utils=require(_0xd649('0x16'));var config=require(_0xd649('0x17'));var licenseUtil=require(_0xd649('0x18'));var db=require(_0xd649('0x19'))['db'];function respondWithStatusCode(_0x431211,_0x3b23d7){_0x3b23d7=_0x3b23d7||0xcc;return function(_0xf02fce){if(_0xf02fce){return _0x431211[_0xd649('0x1a')](_0x3b23d7);}return _0x431211[_0xd649('0x1b')](_0x3b23d7)[_0xd649('0x1c')]();};}function respondWithResult(_0x48dbea,_0x4a755b){_0x4a755b=_0x4a755b||0xc8;return function(_0xac29e7){if(_0xac29e7){return _0x48dbea[_0xd649('0x1b')](_0x4a755b)[_0xd649('0x1d')](_0xac29e7);}};}function respondWithFilteredResult(_0x1c58fb,_0xaf4c5){return function(_0x54ab99){if(_0x54ab99){var _0x83ef35=typeof _0xaf4c5['offset']===_0xd649('0x1e')&&typeof _0xaf4c5[_0xd649('0x1f')]==='undefined';var _0x31a859=_0x54ab99['count'];var _0x2b988e=_0x83ef35?0x0:_0xaf4c5[_0xd649('0x20')];var _0x4a7e65=_0x83ef35?_0x54ab99[_0xd649('0x21')]:_0xaf4c5[_0xd649('0x20')]+_0xaf4c5['limit'];var _0xdd80d5;if(_0x4a7e65>=_0x31a859){_0x4a7e65=_0x31a859;_0xdd80d5=0xc8;}else{_0xdd80d5=0xce;}_0x1c58fb['status'](_0xdd80d5);return _0x1c58fb[_0xd649('0x22')](_0xd649('0x23'),_0x2b988e+'-'+_0x4a7e65+'/'+_0x31a859)[_0xd649('0x1d')](_0x54ab99);}return null;};}function patchUpdates(_0x39d714){return function(_0x2a4962){try{jsonpatch['apply'](_0x2a4962,_0x39d714,!![]);}catch(_0x538cad){return BPromise[_0xd649('0x24')](_0x538cad);}return _0x2a4962[_0xd649('0x25')]();};}function saveUpdates(_0x5509a9,_0x4ab3e5){return function(_0x3fa090){if(_0x3fa090){return _0x3fa090[_0xd649('0x26')](_0x5509a9)[_0xd649('0x27')](function(_0x54f344){return _0x54f344;});}return null;};}function removeEntity(_0x4f993c,_0x1cbb9b){return function(_0x1f2cc3){if(_0x1f2cc3){return _0x1f2cc3[_0xd649('0x28')]()[_0xd649('0x27')](function(){_0x4f993c['status'](0xcc)[_0xd649('0x1c')]();});}};}function handleEntityNotFound(_0x16b0ec,_0x4d01e6){return function(_0x566087){if(!_0x566087){_0x16b0ec[_0xd649('0x1a')](0x194);}return _0x566087;};}function handleError(_0x5d8dfc,_0x5bf799){_0x5bf799=_0x5bf799||0x1f4;return function(_0xcbe69a){logger['error'](_0xcbe69a[_0xd649('0x29')]);if(_0xcbe69a[_0xd649('0x2a')]){delete _0xcbe69a[_0xd649('0x2a')];}_0x5d8dfc[_0xd649('0x1b')](_0x5bf799)[_0xd649('0x2b')](_0xcbe69a);};}exports[_0xd649('0x2c')]=function(_0x5ef0ac,_0x204342){var _0x37dcf1={},_0xd35388={},_0x1ee6a7={'count':0x0,'rows':[]};var _0x320224=_['map'](db[_0xd649('0x2d')][_0xd649('0x2e')],function(_0x450f65){return{'name':_0x450f65[_0xd649('0x2f')],'type':_0x450f65[_0xd649('0x30')][_0xd649('0x31')]};});_0xd35388[_0xd649('0x32')]=_[_0xd649('0x33')](_0x320224,'name');_0xd35388[_0xd649('0x34')]=_[_0xd649('0x35')](_0x5ef0ac[_0xd649('0x34')]);_0xd35388[_0xd649('0x36')]=_[_0xd649('0x37')](_0xd35388[_0xd649('0x32')],_0xd35388[_0xd649('0x34')]);_0x37dcf1[_0xd649('0x38')]=_[_0xd649('0x37')](_0xd35388[_0xd649('0x32')],qs[_0xd649('0x39')](_0x5ef0ac['query']['fields']));_0x37dcf1[_0xd649('0x38')]=_0x37dcf1[_0xd649('0x38')][_0xd649('0x3a')]?_0x37dcf1[_0xd649('0x38')]:_0xd35388[_0xd649('0x32')];if(!_0x5ef0ac['query'][_0xd649('0x3b')](_0xd649('0x3c'))){_0x37dcf1[_0xd649('0x1f')]=qs[_0xd649('0x1f')](_0x5ef0ac[_0xd649('0x34')][_0xd649('0x1f')]);_0x37dcf1[_0xd649('0x20')]=qs[_0xd649('0x20')](_0x5ef0ac['query'][_0xd649('0x20')]);}_0x37dcf1['order']=qs[_0xd649('0x3d')](_0x5ef0ac[_0xd649('0x34')][_0xd649('0x3d')]);_0x37dcf1[_0xd649('0x3e')]=qs[_0xd649('0x36')](_['pick'](_0x5ef0ac[_0xd649('0x34')],_0xd35388[_0xd649('0x36')]),_0x320224);if(_0x5ef0ac[_0xd649('0x34')][_0xd649('0x3f')]){_0x37dcf1[_0xd649('0x3e')]=_['merge'](_0x37dcf1[_0xd649('0x3e')],{'$or':_[_0xd649('0x33')](_0x320224,function(_0x5eaeed){if(_0x5eaeed[_0xd649('0x30')]!==_0xd649('0x40')){var _0x1612b4={};_0x1612b4[_0x5eaeed[_0xd649('0x2a')]]={'$like':'%'+_0x5ef0ac[_0xd649('0x34')][_0xd649('0x3f')]+'%'};return _0x1612b4;}})});}_0x37dcf1=_[_0xd649('0x41')]({},_0x37dcf1,_0x5ef0ac['options']);var _0x56e3ca={'where':_0x37dcf1['where']};return db[_0xd649('0x2d')][_0xd649('0x21')](_0x56e3ca)[_0xd649('0x27')](function(_0x4f5eed){_0x1ee6a7[_0xd649('0x21')]=_0x4f5eed;if(_0x5ef0ac['query'][_0xd649('0x42')]){_0x37dcf1[_0xd649('0x43')]=[{'all':!![]}];}return db[_0xd649('0x2d')][_0xd649('0x44')](_0x37dcf1);})[_0xd649('0x27')](function(_0x1ccd03){_0x1ee6a7['rows']=_0x1ccd03;return _0x1ee6a7;})[_0xd649('0x27')](respondWithFilteredResult(_0x204342,_0x37dcf1))[_0xd649('0x45')](handleError(_0x204342,null));};exports[_0xd649('0x46')]=function(_0x1d70a7,_0x15f1f9){var _0x3cb59f={'raw':!![],'where':{'id':_0x1d70a7[_0xd649('0x47')]['id']}},_0x78542e={};_0x78542e[_0xd649('0x32')]=_[_0xd649('0x35')](db['SugarcrmField']['rawAttributes']);_0x78542e['query']=_[_0xd649('0x35')](_0x1d70a7['query']);_0x78542e[_0xd649('0x36')]=_['intersection'](_0x78542e[_0xd649('0x32')],_0x78542e[_0xd649('0x34')]);_0x3cb59f[_0xd649('0x38')]=_[_0xd649('0x37')](_0x78542e[_0xd649('0x32')],qs[_0xd649('0x39')](_0x1d70a7[_0xd649('0x34')][_0xd649('0x39')]));_0x3cb59f[_0xd649('0x38')]=_0x3cb59f['attributes'][_0xd649('0x3a')]?_0x3cb59f[_0xd649('0x38')]:_0x78542e[_0xd649('0x32')];if(_0x1d70a7[_0xd649('0x34')][_0xd649('0x42')]){_0x3cb59f['include']=[{'all':!![]}];}_0x3cb59f=_[_0xd649('0x41')]({},_0x3cb59f,_0x1d70a7[_0xd649('0x48')]);return db[_0xd649('0x2d')]['find'](_0x3cb59f)['then'](handleEntityNotFound(_0x15f1f9,null))[_0xd649('0x27')](respondWithResult(_0x15f1f9,null))[_0xd649('0x45')](handleError(_0x15f1f9,null));};exports[_0xd649('0x49')]=function(_0x34ae62,_0x1f6947){return db[_0xd649('0x2d')]['create'](_0x34ae62['body'],{})[_0xd649('0x27')](respondWithResult(_0x1f6947,0xc9))[_0xd649('0x45')](handleError(_0x1f6947,null));};exports[_0xd649('0x26')]=function(_0x13ff01,_0x21defb){if(_0x13ff01['body']['id']){delete _0x13ff01[_0xd649('0x4a')]['id'];}return db['SugarcrmField'][_0xd649('0x4b')]({'where':{'id':_0x13ff01[_0xd649('0x47')]['id']}})[_0xd649('0x27')](handleEntityNotFound(_0x21defb,null))[_0xd649('0x27')](saveUpdates(_0x13ff01[_0xd649('0x4a')],null))[_0xd649('0x27')](respondWithResult(_0x21defb,null))[_0xd649('0x45')](handleError(_0x21defb,null));};exports[_0xd649('0x28')]=function(_0x1a9b8e,_0x2ffd39){return db[_0xd649('0x2d')][_0xd649('0x4b')]({'where':{'id':_0x1a9b8e['params']['id']}})[_0xd649('0x27')](handleEntityNotFound(_0x2ffd39,null))[_0xd649('0x27')](removeEntity(_0x2ffd39,null))[_0xd649('0x45')](handleError(_0x2ffd39,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5f33767..c00d49c 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 _0x2f5d=['exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x3a269a,_0x13d26a){var _0x4ff681=function(_0xcdd5a6){while(--_0xcdd5a6){_0x3a269a['push'](_0x3a269a['shift']());}};_0x4ff681(++_0x13d26a);}(_0x2f5d,0x83));var _0xd2f5=function(_0x3fd491,_0x2ef1da){_0x3fd491=_0x3fd491-0x0;var _0x4ea0c7=_0x2f5d[_0x3fd491];return _0x4ea0c7;};'use strict';var _=require('lodash');var util=require(_0xd2f5('0x0'));var logger=require(_0xd2f5('0x1'))(_0xd2f5('0x2'));var moment=require(_0xd2f5('0x3'));var BPromise=require(_0xd2f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2f5('0x5'));var rimraf=require(_0xd2f5('0x6'));var config=require(_0xd2f5('0x7'));var attributes=require(_0xd2f5('0x8'));module[_0xd2f5('0x9')]=function(_0x298e80,_0x29c6ea){return _0x298e80[_0xd2f5('0xa')](_0xd2f5('0xb'),attributes,{'tableName':_0xd2f5('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xd2f5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1752=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0x8db656,_0x5784b1){var _0x5ed99f=function(_0xb8ff48){while(--_0xb8ff48){_0x8db656['push'](_0x8db656['shift']());}};_0x5ed99f(++_0x5784b1);}(_0x1752,0x1c2));var _0x2175=function(_0x184bc1,_0x5ac7a5){_0x184bc1=_0x184bc1-0x0;var _0x305e68=_0x1752[_0x184bc1];return _0x305e68;};'use strict';var _=require(_0x2175('0x0'));var util=require(_0x2175('0x1'));var logger=require(_0x2175('0x2'))(_0x2175('0x3'));var moment=require(_0x2175('0x4'));var BPromise=require('bluebird');var rp=require(_0x2175('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2175('0x6'));var config=require('../../config/environment');var attributes=require(_0x2175('0x7'));module[_0x2175('0x8')]=function(_0x2f0f18,_0xd87cde){return _0x2f0f18[_0x2175('0x9')](_0x2175('0xa'),attributes,{'tableName':_0x2175('0xb'),'paranoid':![],'indexes':[{'name':_0x2175('0xc'),'fields':[_0x2175('0xd'),_0x2175('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index ab2684d..54c01cf 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 _0x7be0=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x1425f0,_0x4ca1a9){var _0x61e616=function(_0x106d97){while(--_0x106d97){_0x1425f0['push'](_0x1425f0['shift']());}};_0x61e616(++_0x4ca1a9);}(_0x7be0,0x1d8));var _0x07be=function(_0x537935,_0x52f63a){_0x537935=_0x537935-0x0;var _0x10a471=_0x7be0[_0x537935];return _0x10a471;};'use strict';var _=require(_0x07be('0x0'));var util=require(_0x07be('0x1'));var moment=require(_0x07be('0x2'));var BPromise=require(_0x07be('0x3'));var rs=require(_0x07be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x07be('0x5'));var logger=require(_0x07be('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x07be('0x7')][_0x07be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e9096,_0x46e63a,_0x52f235){return new BPromise(function(_0x51ab29,_0x972624){return client[_0x07be('0x9')](_0x1e9096,_0x52f235)[_0x07be('0xa')](function(_0x14041c){logger[_0x07be('0xb')](_0x07be('0xc'),_0x46e63a,_0x07be('0xd'));logger[_0x07be('0xe')](_0x07be('0xf'),_0x46e63a,'request\x20sent',JSON[_0x07be('0x10')](_0x14041c));if(_0x14041c[_0x07be('0x11')]){if(_0x14041c[_0x07be('0x11')][_0x07be('0x12')]===0x1f4){logger[_0x07be('0x11')](_0x07be('0xc'),_0x46e63a,_0x14041c[_0x07be('0x11')][_0x07be('0x13')]);return _0x972624(_0x14041c[_0x07be('0x11')][_0x07be('0x13')]);}logger[_0x07be('0x11')](_0x07be('0xc'),_0x46e63a,_0x14041c[_0x07be('0x11')]['message']);return _0x51ab29(_0x14041c[_0x07be('0x11')][_0x07be('0x13')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x46e63a,'request\x20sent');_0x51ab29(_0x14041c['result']['message']);}})[_0x07be('0x14')](function(_0x25484c){logger[_0x07be('0x11')](_0x07be('0xc'),_0x46e63a,_0x25484c);_0x972624(_0x25484c);});});} \ No newline at end of file +var _0x02b3=['rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2ae78d,_0x4bdc21){var _0xb84c6a=function(_0x30c0c7){while(--_0x30c0c7){_0x2ae78d['push'](_0x2ae78d['shift']());}};_0xb84c6a(++_0x4bdc21);}(_0x02b3,0x1b0));var _0x302b=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x02b3[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0x302b('0x0'));var util=require(_0x302b('0x1'));var moment=require('moment');var BPromise=require(_0x302b('0x2'));var rs=require(_0x302b('0x3'));var fs=require('fs');var Redis=require(_0x302b('0x4'));var db=require(_0x302b('0x5'))['db'];var utils=require(_0x302b('0x6'));var logger=require(_0x302b('0x7'))(_0x302b('0x8'));var config=require(_0x302b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x302b('0xa')][_0x302b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x345641,_0xea855e,_0x4af34e){return new BPromise(function(_0x1c87b5,_0x4d602f){return client[_0x302b('0xc')](_0x345641,_0x4af34e)[_0x302b('0xd')](function(_0x104d8d){logger[_0x302b('0xe')](_0x302b('0xf'),_0xea855e,_0x302b('0x10'));logger['debug'](_0x302b('0x11'),_0xea855e,_0x302b('0x10'),JSON['stringify'](_0x104d8d));if(_0x104d8d[_0x302b('0x12')]){if(_0x104d8d[_0x302b('0x12')][_0x302b('0x13')]===0x1f4){logger['error'](_0x302b('0xf'),_0xea855e,_0x104d8d[_0x302b('0x12')][_0x302b('0x14')]);return _0x4d602f(_0x104d8d[_0x302b('0x12')][_0x302b('0x14')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0xea855e,_0x104d8d['error'][_0x302b('0x14')]);return _0x1c87b5(_0x104d8d[_0x302b('0x12')]['message']);}else{logger[_0x302b('0xe')](_0x302b('0xf'),_0xea855e,'request\x20sent');_0x1c87b5(_0x104d8d['result'][_0x302b('0x14')]);}})[_0x302b('0x15')](function(_0x19e69e){logger['error']('SugarcrmField,\x20%s,\x20%s',_0xea855e,_0x19e69e);_0x4d602f(_0x19e69e);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 3e31d88..62f9100 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 _0xce9b=['./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xf638eb,_0x342d34){var _0x5419a9=function(_0x1a09e7){while(--_0x1a09e7){_0xf638eb['push'](_0xf638eb['shift']());}};_0x5419a9(++_0x342d34);}(_0xce9b,0xc6));var _0xbce9=function(_0x44725e,_0x25f88b){_0x44725e=_0x44725e-0x0;var _0x2ec06b=_0xce9b[_0x44725e];return _0x2ec06b;};'use strict';var multer=require(_0xbce9('0x0'));var util=require(_0xbce9('0x1'));var path=require(_0xbce9('0x2'));var timeout=require(_0xbce9('0x3'));var express=require(_0xbce9('0x4'));var router=express[_0xbce9('0x5')]();var fs_extra=require(_0xbce9('0x6'));var auth=require(_0xbce9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbce9('0x8'));var controller=require(_0xbce9('0x9'));router[_0xbce9('0xa')]('/',auth[_0xbce9('0xb')](),controller[_0xbce9('0xc')]);router[_0xbce9('0xa')](_0xbce9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xbce9('0xa')](_0xbce9('0xe'),auth['isAuthenticated'](),controller[_0xbce9('0xf')]);router[_0xbce9('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbce9('0x10')]);router[_0xbce9('0x11')]('/',auth[_0xbce9('0xb')](),controller['create']);router['post'](_0xbce9('0xe'),auth[_0xbce9('0xb')](),controller[_0xbce9('0x12')]);router[_0xbce9('0x13')](_0xbce9('0xd'),auth[_0xbce9('0xb')](),controller[_0xbce9('0x14')]);router[_0xbce9('0x15')](_0xbce9('0xd'),auth[_0xbce9('0xb')](),controller['destroy']);module[_0xbce9('0x16')]=router; \ No newline at end of file +var _0xb91a=['post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields'];(function(_0x541627,_0x438b68){var _0xd1aec3=function(_0x59f811){while(--_0x59f811){_0x541627['push'](_0x541627['shift']());}};_0xd1aec3(++_0x438b68);}(_0xb91a,0xf4));var _0xab91=function(_0x1cf2a2,_0x2832a6){_0x1cf2a2=_0x1cf2a2-0x0;var _0x5dc569=_0xb91a[_0x1cf2a2];return _0x5dc569;};'use strict';var multer=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var path=require(_0xab91('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xab91('0x3')]();var fs_extra=require(_0xab91('0x4'));var auth=require(_0xab91('0x5'));var interaction=require(_0xab91('0x6'));var config=require(_0xab91('0x7'));var controller=require(_0xab91('0x8'));router[_0xab91('0x9')]('/',auth[_0xab91('0xa')](),controller[_0xab91('0xb')]);router[_0xab91('0x9')]('/:id',auth[_0xab91('0xa')](),controller[_0xab91('0xc')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0xab91('0xd')]);router[_0xab91('0x9')](_0xab91('0xe'),auth[_0xab91('0xa')](),controller[_0xab91('0xf')]);router[_0xab91('0x10')]('/',auth[_0xab91('0xa')](),controller[_0xab91('0x11')]);router[_0xab91('0x10')](_0xab91('0x12'),auth[_0xab91('0xa')](),controller[_0xab91('0x13')]);router[_0xab91('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xab91('0x15')]);router[_0xab91('0x16')](_0xab91('0x17'),auth[_0xab91('0xa')](),controller[_0xab91('0x18')]);module[_0xab91('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index b20f195..f5ba331 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 _0x786f=['STRING','HelpDesk','sequelize','exports'];(function(_0x19b26d,_0x147e71){var _0x502f37=function(_0x3d6faf){while(--_0x3d6faf){_0x19b26d['push'](_0x19b26d['shift']());}};_0x502f37(++_0x147e71);}(_0x786f,0x1ae));var _0xf786=function(_0x210b46,_0x52a05f){_0x210b46=_0x210b46-0x0;var _0x203df2=_0x786f[_0x210b46];return _0x203df2;};'use strict';var Sequelize=require(_0xf786('0x0'));module[_0xf786('0x1')]={'name':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf786('0x3')},'remoteUri':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x45b8=['STRING','HelpDesk','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x45b8,0x1d2));var _0x845b=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x45b8[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x845b('0x0'));module[_0x845b('0x1')]={'name':{'type':Sequelize[_0x845b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x845b('0x2')]},'username':{'type':Sequelize[_0x845b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x845b('0x2')],'allowNull':![],'defaultValue':_0x845b('0x3')},'remoteUri':{'type':Sequelize[_0x845b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x845b('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 905d516..e9d2bfa 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 _0x0023=['substring','lastIndexOf','format','GET','getchallenge','POST','login','result','token','success','describe','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','findAll','keys','length','include','catch','create','body','find','params','getConfigurations','VtigerConfiguration','filter','addConfiguration','findOne','AccountId','Subjects','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey'];(function(_0x179118,_0x5ad20f){var _0x18b819=function(_0x56d91a){while(--_0x56d91a){_0x179118['push'](_0x179118['shift']());}};_0x18b819(++_0x5ad20f);}(_0x0023,0x18d));var _0x3002=function(_0x139c41,_0x5907ad){_0x139c41=_0x139c41-0x0;var _0x2da90e=_0x0023[_0x139c41];return _0x2da90e;};'use strict';var emlformat=require(_0x3002('0x0'));var rimraf=require(_0x3002('0x1'));var zipdir=require(_0x3002('0x2'));var jsonpatch=require(_0x3002('0x3'));var rp=require(_0x3002('0x4'));var moment=require(_0x3002('0x5'));var BPromise=require(_0x3002('0x6'));var Mustache=require(_0x3002('0x7'));var util=require(_0x3002('0x8'));var path=require(_0x3002('0x9'));var sox=require(_0x3002('0xa'));var csv=require(_0x3002('0xb'));var ejs=require(_0x3002('0xc'));var fs=require('fs');var fs_extra=require(_0x3002('0xd'));var _=require(_0x3002('0xe'));var squel=require('squel');var crypto=require(_0x3002('0xf'));var jsforce=require(_0x3002('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3002('0xb'));var querystring=require(_0x3002('0x11'));var Papa=require(_0x3002('0x12'));var Redis=require(_0x3002('0x13'));var authService=require(_0x3002('0x14'));var qs=require(_0x3002('0x15'));var as=require(_0x3002('0x16'));var hardwareService=require(_0x3002('0x17'));var logger=require(_0x3002('0x18'))(_0x3002('0x19'));var utils=require(_0x3002('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3002('0x1b'))['db'];var integrations=require(_0x3002('0x1c'));function respondWithStatusCode(_0x26cb29,_0x1b9efc){_0x1b9efc=_0x1b9efc||0xcc;return function(_0x39b4f7){if(_0x39b4f7){return _0x26cb29[_0x3002('0x1d')](_0x1b9efc);}return _0x26cb29[_0x3002('0x1e')](_0x1b9efc)[_0x3002('0x1f')]();};}function respondWithResult(_0x533600,_0x328cb4){_0x328cb4=_0x328cb4||0xc8;return function(_0x1ca63a){if(_0x1ca63a){return _0x533600[_0x3002('0x1e')](_0x328cb4)[_0x3002('0x20')](_0x1ca63a);}};}function respondWithFilteredResult(_0x146127,_0x5d2128){return function(_0x160fef){if(_0x160fef){var _0x14f5d5=typeof _0x5d2128[_0x3002('0x21')]===_0x3002('0x22')&&typeof _0x5d2128['limit']===_0x3002('0x22');var _0x4ba66c=_0x160fef[_0x3002('0x23')];var _0x1b1c11=_0x14f5d5?0x0:_0x5d2128[_0x3002('0x21')];var _0x39cd62=_0x14f5d5?_0x160fef[_0x3002('0x23')]:_0x5d2128[_0x3002('0x21')]+_0x5d2128[_0x3002('0x24')];var _0x3aac23;if(_0x39cd62>=_0x4ba66c){_0x39cd62=_0x4ba66c;_0x3aac23=0xc8;}else{_0x3aac23=0xce;}_0x146127[_0x3002('0x1e')](_0x3aac23);return _0x146127[_0x3002('0x25')](_0x3002('0x26'),_0x1b1c11+'-'+_0x39cd62+'/'+_0x4ba66c)[_0x3002('0x20')](_0x160fef);}return null;};}function patchUpdates(_0x5a8891){return function(_0x4ea19c){try{jsonpatch['apply'](_0x4ea19c,_0x5a8891,!![]);}catch(_0x2240be){return BPromise[_0x3002('0x27')](_0x2240be);}return _0x4ea19c[_0x3002('0x28')]();};}function saveUpdates(_0x161c5b,_0x2bd7f0){return function(_0x110658){if(_0x110658){return _0x110658[_0x3002('0x29')](_0x161c5b)[_0x3002('0x2a')](function(_0x29cbda){return _0x29cbda;});}return null;};}function removeEntity(_0x1b9e6d,_0x9a2508){return function(_0x19ff43){if(_0x19ff43){return _0x19ff43[_0x3002('0x2b')]()[_0x3002('0x2a')](function(){_0x1b9e6d[_0x3002('0x1e')](0xcc)[_0x3002('0x1f')]();});}};}function handleEntityNotFound(_0x16fb7e,_0x5626cb){return function(_0x4bc26d){if(!_0x4bc26d){_0x16fb7e[_0x3002('0x1d')](0x194);}return _0x4bc26d;};}function handleError(_0x3c1fdd,_0x2ebc0d){_0x2ebc0d=_0x2ebc0d||0x1f4;return function(_0x2b1163){logger[_0x3002('0x2c')](_0x2b1163[_0x3002('0x2d')]);if(_0x2b1163[_0x3002('0x2e')]){delete _0x2b1163[_0x3002('0x2e')];}_0x3c1fdd[_0x3002('0x1e')](_0x2ebc0d)[_0x3002('0x2f')](_0x2b1163);};}exports[_0x3002('0x30')]=function(_0x570c44,_0x44f2e0){var _0xd09302={},_0x1749ec={},_0xfaca0e={'count':0x0,'rows':[]};var _0x482563=_[_0x3002('0x31')](db[_0x3002('0x32')][_0x3002('0x33')],function(_0x1d94fc){return{'name':_0x1d94fc[_0x3002('0x34')],'type':_0x1d94fc[_0x3002('0x35')][_0x3002('0x36')]};});_0x1749ec[_0x3002('0x37')]=_[_0x3002('0x31')](_0x482563,'name');_0x1749ec[_0x3002('0x38')]=_['keys'](_0x570c44[_0x3002('0x38')]);_0x1749ec[_0x3002('0x39')]=_[_0x3002('0x3a')](_0x1749ec[_0x3002('0x37')],_0x1749ec[_0x3002('0x38')]);_0xd09302[_0x3002('0x3b')]=_[_0x3002('0x3a')](_0x1749ec[_0x3002('0x37')],qs[_0x3002('0x3c')](_0x570c44['query']['fields']));_0xd09302['attributes']=_0xd09302[_0x3002('0x3b')]['length']?_0xd09302[_0x3002('0x3b')]:_0x1749ec[_0x3002('0x37')];if(!_0x570c44['query'][_0x3002('0x3d')](_0x3002('0x3e'))){_0xd09302['limit']=qs['limit'](_0x570c44[_0x3002('0x38')][_0x3002('0x24')]);_0xd09302[_0x3002('0x21')]=qs[_0x3002('0x21')](_0x570c44[_0x3002('0x38')]['offset']);}_0xd09302[_0x3002('0x3f')]=qs[_0x3002('0x40')](_0x570c44[_0x3002('0x38')][_0x3002('0x40')]);_0xd09302['where']=qs['filters'](_[_0x3002('0x41')](_0x570c44[_0x3002('0x38')],_0x1749ec[_0x3002('0x39')]),_0x482563);if(_0x570c44[_0x3002('0x38')]['filter']){_0xd09302['where']=_[_0x3002('0x42')](_0xd09302[_0x3002('0x43')],{'$or':_['map'](_0x482563,function(_0x22cee1){if(_0x22cee1[_0x3002('0x35')]!==_0x3002('0x44')){var _0x27a5a6={};_0x27a5a6[_0x22cee1['name']]={'$like':'%'+_0x570c44[_0x3002('0x38')]['filter']+'%'};return _0x27a5a6;}})});}_0xd09302=_[_0x3002('0x42')]({},_0xd09302,_0x570c44[_0x3002('0x45')]);var _0x146728={'where':_0xd09302[_0x3002('0x43')]};return db[_0x3002('0x32')][_0x3002('0x23')](_0x146728)[_0x3002('0x2a')](function(_0x5b3991){_0xfaca0e[_0x3002('0x23')]=_0x5b3991;if(_0x570c44['query'][_0x3002('0x46')]){_0xd09302['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x3002('0x47')](_0xd09302);})[_0x3002('0x2a')](function(_0xb3a67f){_0xfaca0e['rows']=_0xb3a67f;return _0xfaca0e;})[_0x3002('0x2a')](respondWithFilteredResult(_0x44f2e0,_0xd09302))['catch'](handleError(_0x44f2e0,null));};exports['show']=function(_0x1bd618,_0x47d2f7){var _0x321c3d={'raw':![],'where':{'id':_0x1bd618['params']['id']}},_0x3b9da9={};_0x3b9da9[_0x3002('0x37')]=_[_0x3002('0x48')](db[_0x3002('0x32')][_0x3002('0x33')]);_0x3b9da9['query']=_[_0x3002('0x48')](_0x1bd618['query']);_0x3b9da9[_0x3002('0x39')]=_[_0x3002('0x3a')](_0x3b9da9['model'],_0x3b9da9['query']);_0x321c3d[_0x3002('0x3b')]=_[_0x3002('0x3a')](_0x3b9da9[_0x3002('0x37')],qs[_0x3002('0x3c')](_0x1bd618[_0x3002('0x38')][_0x3002('0x3c')]));_0x321c3d[_0x3002('0x3b')]=_0x321c3d['attributes'][_0x3002('0x49')]?_0x321c3d[_0x3002('0x3b')]:_0x3b9da9[_0x3002('0x37')];if(_0x1bd618[_0x3002('0x38')][_0x3002('0x46')]){_0x321c3d[_0x3002('0x4a')]=[{'all':!![]}];}_0x321c3d=_[_0x3002('0x42')]({},_0x321c3d,_0x1bd618[_0x3002('0x45')]);return db[_0x3002('0x32')]['find'](_0x321c3d)[_0x3002('0x2a')](handleEntityNotFound(_0x47d2f7,null))['then'](respondWithResult(_0x47d2f7,null))[_0x3002('0x4b')](handleError(_0x47d2f7,null));};exports['create']=function(_0x5bca66,_0x14293d){return db[_0x3002('0x32')][_0x3002('0x4c')](_0x5bca66[_0x3002('0x4d')],{})[_0x3002('0x2a')](respondWithResult(_0x14293d,0xc9))[_0x3002('0x4b')](handleError(_0x14293d,null));};exports[_0x3002('0x29')]=function(_0x12ab4c,_0x3b1b4e){if(_0x12ab4c[_0x3002('0x4d')]['id']){delete _0x12ab4c[_0x3002('0x4d')]['id'];}return db[_0x3002('0x32')][_0x3002('0x4e')]({'where':{'id':_0x12ab4c[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x3b1b4e,null))[_0x3002('0x2a')](saveUpdates(_0x12ab4c[_0x3002('0x4d')],null))['then'](respondWithResult(_0x3b1b4e,null))[_0x3002('0x4b')](handleError(_0x3b1b4e,null));};exports[_0x3002('0x2b')]=function(_0x5a91ba,_0x462482){return db[_0x3002('0x32')]['find']({'where':{'id':_0x5a91ba[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x462482,null))[_0x3002('0x2a')](removeEntity(_0x462482,null))[_0x3002('0x4b')](handleError(_0x462482,null));};exports[_0x3002('0x50')]=function(_0x3ed830,_0x1d6b8f,_0x4212e2){var _0x2e5c13={};var _0x1d7fed={};var _0x366968;var _0x4f3f34;return db[_0x3002('0x32')]['findOne']({'where':{'id':_0x3ed830[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x1d6b8f,null))[_0x3002('0x2a')](function(_0x1683db){if(_0x1683db){_0x366968=_0x1683db;_0x1d7fed[_0x3002('0x37')]=_[_0x3002('0x48')](db[_0x3002('0x51')][_0x3002('0x33')]);_0x1d7fed[_0x3002('0x38')]=_[_0x3002('0x48')](_0x3ed830[_0x3002('0x38')]);_0x1d7fed['filters']=_[_0x3002('0x3a')](_0x1d7fed[_0x3002('0x37')],_0x1d7fed[_0x3002('0x38')]);_0x2e5c13[_0x3002('0x3b')]=_[_0x3002('0x3a')](_0x1d7fed[_0x3002('0x37')],qs[_0x3002('0x3c')](_0x3ed830[_0x3002('0x38')][_0x3002('0x3c')]));_0x2e5c13[_0x3002('0x3b')]=_0x2e5c13[_0x3002('0x3b')][_0x3002('0x49')]?_0x2e5c13[_0x3002('0x3b')]:_0x1d7fed[_0x3002('0x37')];_0x2e5c13[_0x3002('0x3f')]=qs[_0x3002('0x40')](_0x3ed830[_0x3002('0x38')][_0x3002('0x40')]);_0x2e5c13[_0x3002('0x43')]=qs[_0x3002('0x39')](_['pick'](_0x3ed830[_0x3002('0x38')],_0x1d7fed['filters']));if(_0x3ed830[_0x3002('0x38')][_0x3002('0x52')]){_0x2e5c13[_0x3002('0x43')]=_['merge'](_0x2e5c13[_0x3002('0x43')],{'$or':_[_0x3002('0x31')](_0x2e5c13[_0x3002('0x3b')],function(_0x438f58){var _0x783f5a={};_0x783f5a[_0x438f58]={'$like':'%'+_0x3ed830['query']['filter']+'%'};return _0x783f5a;})});}_0x2e5c13=_[_0x3002('0x42')]({},_0x2e5c13,_0x3ed830[_0x3002('0x45')]);return _0x366968[_0x3002('0x50')](_0x2e5c13);}})[_0x3002('0x2a')](function(_0x2836dd){if(_0x2836dd){_0x4f3f34=_0x2836dd[_0x3002('0x49')];if(!_0x3ed830['query'][_0x3002('0x3d')]('nolimit')){_0x2e5c13[_0x3002('0x24')]=qs[_0x3002('0x24')](_0x3ed830['query'][_0x3002('0x24')]);_0x2e5c13['offset']=qs[_0x3002('0x21')](_0x3ed830['query']['offset']);}return _0x366968[_0x3002('0x50')](_0x2e5c13);}})[_0x3002('0x2a')](function(_0x27db2c){if(_0x27db2c){return _0x27db2c?{'count':_0x4f3f34,'rows':_0x27db2c}:null;}})[_0x3002('0x2a')](respondWithResult(_0x1d6b8f,null))[_0x3002('0x4b')](handleError(_0x1d6b8f,null));};exports[_0x3002('0x53')]=function(_0x5813c8,_0x4842c4,_0x48a5bf){if(_0x5813c8['body']['id']){delete _0x5813c8[_0x3002('0x4d')]['id'];}return db['VtigerAccount'][_0x3002('0x54')]({'where':{'id':_0x5813c8[_0x3002('0x4f')]['id']}})[_0x3002('0x2a')](handleEntityNotFound(_0x4842c4,null))[_0x3002('0x2a')](function(_0x5c033d){if(_0x5c033d){_0x5813c8[_0x3002('0x4d')][_0x3002('0x55')]=_0x5c033d['id'];_0x5813c8[_0x3002('0x4d')][_0x3002('0x56')]=integrations['getSubjects'](_0x5813c8[_0x3002('0x4d')]['channel'],_0x5813c8[_0x3002('0x4d')][_0x3002('0x35')]);_0x5813c8[_0x3002('0x4d')]['Descriptions']=integrations[_0x3002('0x57')](_0x5813c8[_0x3002('0x4d')]['channel'],_0x5813c8[_0x3002('0x4d')][_0x3002('0x35')]);return db[_0x3002('0x51')][_0x3002('0x4c')](_0x5813c8['body'],{'include':[{'model':db[_0x3002('0x58')],'as':_0x3002('0x56')},{'model':db[_0x3002('0x58')],'as':'Descriptions'}]});}return null;})[_0x3002('0x2a')](respondWithResult(_0x4842c4,null))[_0x3002('0x4b')](handleError(_0x4842c4,null));};var md5=require(_0x3002('0x59'));exports[_0x3002('0x5a')]=function(_0x33bacf,_0x434ec4,_0x3bbf43){var _0x4df749=null;var _0x33483a=null;var _0x63974f=null;var _0x2e7759=null;var _0x179d4a='';return db[_0x3002('0x32')][_0x3002('0x54')]({'where':{'id':_0x33bacf['params']['id']},'attributes':['id',_0x3002('0x2e'),_0x3002('0x5b'),'description',_0x3002('0x5c'),_0x3002('0x5d'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x434ec4,null))[_0x3002('0x2a')](function(_0x33f750){if(_0x33f750){_0x4df749=_0x33f750[_0x3002('0x5b')];_0x33483a=_0x33f750[_0x3002('0x5e')];_0x63974f=_0x33f750[_0x3002('0x5c')];_0x179d4a=_0x33f750['remoteUri'];var _0x3b004f=_0x179d4a['slice'](-0x1);if(_0x3b004f==='/'){_0x179d4a=_0x179d4a[_0x3002('0x5f')](0x0,_0x179d4a[_0x3002('0x60')](_0x3b004f));}_0x2e7759=util[_0x3002('0x61')]('%s/webservice.php',_0x179d4a);var _0x1f5443={'method':_0x3002('0x62'),'uri':_0x2e7759,'qs':{'operation':_0x3002('0x63'),'username':_0x33f750['username']},'json':!![]};return rp(_0x1f5443);}})[_0x3002('0x2a')](function(_0x52bcbe){if(_0x52bcbe['success']){var _0x29241={'method':_0x3002('0x64'),'uri':_0x2e7759,'form':{'operation':_0x3002('0x65'),'username':_0x4df749,'accessKey':md5(_0x52bcbe[_0x3002('0x66')][_0x3002('0x67')]+_0x33483a)},'json':!![]};return rp(_0x29241);}})[_0x3002('0x2a')](function(_0x4e4ae4){if(_0x4e4ae4[_0x3002('0x68')]){var _0x31bbb={'method':_0x3002('0x62'),'uri':_0x2e7759,'qs':{'operation':_0x3002('0x69'),'username':_0x4df749,'sessionName':_0x4e4ae4[_0x3002('0x66')]['sessionName'],'elementType':_0x63974f},'json':!![]};return rp(_0x31bbb);}})[_0x3002('0x2a')](function(_0x4f1388){if(_0x4f1388[_0x3002('0x68')]){var _0x58d411=[_0x3002('0x6a'),_0x3002('0x6b'),_0x3002('0x6c')];_[_0x3002('0x6d')](_0x4f1388[_0x3002('0x66')][_0x3002('0x3c')],function(_0x4600f6){return _0x58d411[_0x3002('0x6e')](_0x4600f6[_0x3002('0x35')]['name']);});_[_0x3002('0x6d')](_0x4f1388['result']['fields'],function(_0x4fdee2){return _0x4fdee2[_0x3002('0x6f')]===_0x3002('0x70');});return{'count':_0x4f1388[_0x3002('0x66')][_0x3002('0x3c')][_0x3002('0x49')],'rows':_[_0x3002('0x31')](_0x4f1388['result']['fields'],function(_0x3640e1){return{'id':_0x3640e1[_0x3002('0x2e')],'name':_0x3640e1[_0x3002('0x71')],'custom':_[_0x3002('0x72')](_0x3640e1['name'],_0x3002('0x73'))?!![]:![],'options':_0x3640e1[_0x3002('0x35')][_0x3002('0x2e')]===_0x3002('0x74')&&_0x3640e1['type'][_0x3002('0x75')][_0x3002('0x49')]>0x0?_[_0x3002('0x31')](_0x3640e1['type'][_0x3002('0x75')],function(_0x3436f6){return{'name':_0x3436f6['label'],'value':_0x3436f6[_0x3002('0x76')]};}):[]};})};}})[_0x3002('0x2a')](respondWithResult(_0x434ec4,null))[_0x3002('0x4b')](function(_0x51ed3a){console['log'](_0x3002('0x77')+_0x51ed3a);var _0x5e9ff7=_0x33bacf[_0x3002('0x38')][_0x3002('0x78')]?0x1f4:_0x51ed3a[_0x3002('0x79')]||0x1f4;logger[_0x3002('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0x3002('0x5a'),_0x5e9ff7,JSON[_0x3002('0x7a')](_0x51ed3a));delete _0x51ed3a[_0x3002('0x2e')];if(_0x5e9ff7===0x191){_0x5e9ff7=0x190;}_0x434ec4[_0x3002('0x1e')](_0x5e9ff7)['send'](_0x33bacf['query'][_0x3002('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x51ed3a[_0x3002('0x79')]}:_0x51ed3a);});}; \ No newline at end of file +var _0x9519=['log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','catch','show','params','keys','VtigerAccount','find','create','body','getConfigurations','VtigerConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','VtigerField','Subjects','Descriptions','getFields','findOne','username','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','getchallenge','success','login','result','token','GET','describe','autogenerated','reference','remove','includes','false','label','cf_','picklist','picklistValues'];(function(_0x500edc,_0x2a8123){var _0x3ef6af=function(_0xc34d45){while(--_0xc34d45){_0x500edc['push'](_0x500edc['shift']());}};_0x3ef6af(++_0x2a8123);}(_0x9519,0x7c));var _0x9951=function(_0x27b571,_0x5b15ee){_0x27b571=_0x27b571-0x0;var _0x1b0681=_0x9519[_0x27b571];return _0x1b0681;};'use strict';var emlformat=require(_0x9951('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9951('0x1'));var rp=require(_0x9951('0x2'));var moment=require(_0x9951('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9951('0x4'));var path=require('path');var sox=require(_0x9951('0x5'));var csv=require(_0x9951('0x6'));var ejs=require(_0x9951('0x7'));var fs=require('fs');var fs_extra=require(_0x9951('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9951('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9951('0xa'));var toCsv=require(_0x9951('0x6'));var querystring=require('querystring');var Papa=require(_0x9951('0xb'));var Redis=require(_0x9951('0xc'));var authService=require(_0x9951('0xd'));var qs=require(_0x9951('0xe'));var as=require(_0x9951('0xf'));var hardwareService=require(_0x9951('0x10'));var logger=require(_0x9951('0x11'))(_0x9951('0x12'));var utils=require(_0x9951('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9951('0x14'));var db=require(_0x9951('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2429b3,_0x1a95d0){_0x1a95d0=_0x1a95d0||0xcc;return function(_0x3538bc){if(_0x3538bc){return _0x2429b3[_0x9951('0x16')](_0x1a95d0);}return _0x2429b3[_0x9951('0x17')](_0x1a95d0)[_0x9951('0x18')]();};}function respondWithResult(_0x5a9976,_0x1f296f){_0x1f296f=_0x1f296f||0xc8;return function(_0x583ba1){if(_0x583ba1){return _0x5a9976['status'](_0x1f296f)[_0x9951('0x19')](_0x583ba1);}};}function respondWithFilteredResult(_0x351c0d,_0x3d3ddc){return function(_0x104349){if(_0x104349){var _0x30c29e=typeof _0x3d3ddc['offset']===_0x9951('0x1a')&&typeof _0x3d3ddc[_0x9951('0x1b')]===_0x9951('0x1a');var _0x2bcc6c=_0x104349[_0x9951('0x1c')];var _0x29e530=_0x30c29e?0x0:_0x3d3ddc['offset'];var _0x53a649=_0x30c29e?_0x104349[_0x9951('0x1c')]:_0x3d3ddc['offset']+_0x3d3ddc['limit'];var _0x27e42c;if(_0x53a649>=_0x2bcc6c){_0x53a649=_0x2bcc6c;_0x27e42c=0xc8;}else{_0x27e42c=0xce;}_0x351c0d['status'](_0x27e42c);return _0x351c0d[_0x9951('0x1d')](_0x9951('0x1e'),_0x29e530+'-'+_0x53a649+'/'+_0x2bcc6c)['json'](_0x104349);}return null;};}function patchUpdates(_0x5e1b45){return function(_0x5e489f){try{jsonpatch[_0x9951('0x1f')](_0x5e489f,_0x5e1b45,!![]);}catch(_0x244d9d){return BPromise[_0x9951('0x20')](_0x244d9d);}return _0x5e489f['save']();};}function saveUpdates(_0x278219,_0x17a51c){return function(_0x164fe9){if(_0x164fe9){return _0x164fe9[_0x9951('0x21')](_0x278219)['then'](function(_0x22062a){return _0x22062a;});}return null;};}function removeEntity(_0x1065ef,_0x32f75e){return function(_0x3e96cf){if(_0x3e96cf){return _0x3e96cf[_0x9951('0x22')]()['then'](function(){_0x1065ef[_0x9951('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc677bd,_0x25aee7){return function(_0x42d700){if(!_0x42d700){_0xc677bd[_0x9951('0x16')](0x194);}return _0x42d700;};}function handleError(_0x2e0803,_0x41cd6c){_0x41cd6c=_0x41cd6c||0x1f4;return function(_0x486ee1){logger[_0x9951('0x23')](_0x486ee1['stack']);if(_0x486ee1[_0x9951('0x24')]){delete _0x486ee1[_0x9951('0x24')];}_0x2e0803[_0x9951('0x17')](_0x41cd6c)[_0x9951('0x25')](_0x486ee1);};}exports[_0x9951('0x26')]=function(_0x307d21,_0x48dce0){var _0x56d10d={},_0x623a2e={},_0x2cad39={'count':0x0,'rows':[]};var _0x30fb5f=_[_0x9951('0x27')](db['VtigerAccount'][_0x9951('0x28')],function(_0xff6e4e){return{'name':_0xff6e4e[_0x9951('0x29')],'type':_0xff6e4e[_0x9951('0x2a')][_0x9951('0x2b')]};});_0x623a2e[_0x9951('0x2c')]=_['map'](_0x30fb5f,'name');_0x623a2e['query']=_['keys'](_0x307d21[_0x9951('0x2d')]);_0x623a2e[_0x9951('0x2e')]=_[_0x9951('0x2f')](_0x623a2e[_0x9951('0x2c')],_0x623a2e['query']);_0x56d10d[_0x9951('0x30')]=_['intersection'](_0x623a2e[_0x9951('0x2c')],qs[_0x9951('0x31')](_0x307d21[_0x9951('0x2d')]['fields']));_0x56d10d[_0x9951('0x30')]=_0x56d10d[_0x9951('0x30')][_0x9951('0x32')]?_0x56d10d[_0x9951('0x30')]:_0x623a2e[_0x9951('0x2c')];if(!_0x307d21[_0x9951('0x2d')]['hasOwnProperty']('nolimit')){_0x56d10d['limit']=qs['limit'](_0x307d21[_0x9951('0x2d')][_0x9951('0x1b')]);_0x56d10d['offset']=qs[_0x9951('0x33')](_0x307d21[_0x9951('0x2d')][_0x9951('0x33')]);}_0x56d10d[_0x9951('0x34')]=qs[_0x9951('0x35')](_0x307d21['query'][_0x9951('0x35')]);_0x56d10d[_0x9951('0x36')]=qs[_0x9951('0x2e')](_[_0x9951('0x37')](_0x307d21[_0x9951('0x2d')],_0x623a2e[_0x9951('0x2e')]),_0x30fb5f);if(_0x307d21[_0x9951('0x2d')][_0x9951('0x38')]){_0x56d10d[_0x9951('0x36')]=_[_0x9951('0x39')](_0x56d10d[_0x9951('0x36')],{'$or':_[_0x9951('0x27')](_0x30fb5f,function(_0x25622a){if(_0x25622a[_0x9951('0x2a')]!=='VIRTUAL'){var _0x29e046={};_0x29e046[_0x25622a[_0x9951('0x24')]]={'$like':'%'+_0x307d21[_0x9951('0x2d')][_0x9951('0x38')]+'%'};return _0x29e046;}})});}_0x56d10d=_[_0x9951('0x39')]({},_0x56d10d,_0x307d21[_0x9951('0x3a')]);var _0x43eda2={'where':_0x56d10d['where']};return db['VtigerAccount'][_0x9951('0x1c')](_0x43eda2)[_0x9951('0x3b')](function(_0x5d62ac){_0x2cad39[_0x9951('0x1c')]=_0x5d62ac;if(_0x307d21[_0x9951('0x2d')][_0x9951('0x3c')]){_0x56d10d[_0x9951('0x3d')]=[{'all':!![]}];}return db['VtigerAccount'][_0x9951('0x3e')](_0x56d10d);})['then'](function(_0x47ddf6){_0x2cad39['rows']=_0x47ddf6;return _0x2cad39;})[_0x9951('0x3b')](respondWithFilteredResult(_0x48dce0,_0x56d10d))[_0x9951('0x3f')](handleError(_0x48dce0,null));};exports[_0x9951('0x40')]=function(_0x460713,_0x5c74c6){var _0x310263={'raw':![],'where':{'id':_0x460713[_0x9951('0x41')]['id']}},_0x2a8cd0={};_0x2a8cd0[_0x9951('0x2c')]=_[_0x9951('0x42')](db[_0x9951('0x43')][_0x9951('0x28')]);_0x2a8cd0[_0x9951('0x2d')]=_[_0x9951('0x42')](_0x460713['query']);_0x2a8cd0[_0x9951('0x2e')]=_[_0x9951('0x2f')](_0x2a8cd0[_0x9951('0x2c')],_0x2a8cd0[_0x9951('0x2d')]);_0x310263['attributes']=_[_0x9951('0x2f')](_0x2a8cd0[_0x9951('0x2c')],qs[_0x9951('0x31')](_0x460713[_0x9951('0x2d')][_0x9951('0x31')]));_0x310263[_0x9951('0x30')]=_0x310263[_0x9951('0x30')][_0x9951('0x32')]?_0x310263['attributes']:_0x2a8cd0['model'];if(_0x460713[_0x9951('0x2d')]['includeAll']){_0x310263[_0x9951('0x3d')]=[{'all':!![]}];}_0x310263=_[_0x9951('0x39')]({},_0x310263,_0x460713['options']);return db['VtigerAccount'][_0x9951('0x44')](_0x310263)[_0x9951('0x3b')](handleEntityNotFound(_0x5c74c6,null))[_0x9951('0x3b')](respondWithResult(_0x5c74c6,null))[_0x9951('0x3f')](handleError(_0x5c74c6,null));};exports[_0x9951('0x45')]=function(_0x13dd29,_0x13a3d0){return db[_0x9951('0x43')][_0x9951('0x45')](_0x13dd29[_0x9951('0x46')],{})[_0x9951('0x3b')](respondWithResult(_0x13a3d0,0xc9))[_0x9951('0x3f')](handleError(_0x13a3d0,null));};exports[_0x9951('0x21')]=function(_0x2d3398,_0x3d2db0){if(_0x2d3398[_0x9951('0x46')]['id']){delete _0x2d3398[_0x9951('0x46')]['id'];}return db[_0x9951('0x43')][_0x9951('0x44')]({'where':{'id':_0x2d3398[_0x9951('0x41')]['id']}})[_0x9951('0x3b')](handleEntityNotFound(_0x3d2db0,null))[_0x9951('0x3b')](saveUpdates(_0x2d3398[_0x9951('0x46')],null))['then'](respondWithResult(_0x3d2db0,null))['catch'](handleError(_0x3d2db0,null));};exports['destroy']=function(_0x42b009,_0x180a19){return db[_0x9951('0x43')][_0x9951('0x44')]({'where':{'id':_0x42b009[_0x9951('0x41')]['id']}})['then'](handleEntityNotFound(_0x180a19,null))[_0x9951('0x3b')](removeEntity(_0x180a19,null))[_0x9951('0x3f')](handleError(_0x180a19,null));};exports[_0x9951('0x47')]=function(_0x3a2fdf,_0x1ee1ce,_0x1f3d61){var _0x13cc10={};var _0x11d2b4={};var _0x450d01;var _0x5cd8e2;return db[_0x9951('0x43')]['findOne']({'where':{'id':_0x3a2fdf[_0x9951('0x41')]['id']}})[_0x9951('0x3b')](handleEntityNotFound(_0x1ee1ce,null))[_0x9951('0x3b')](function(_0x4951ad){if(_0x4951ad){_0x450d01=_0x4951ad;_0x11d2b4[_0x9951('0x2c')]=_[_0x9951('0x42')](db[_0x9951('0x48')]['rawAttributes']);_0x11d2b4[_0x9951('0x2d')]=_['keys'](_0x3a2fdf['query']);_0x11d2b4[_0x9951('0x2e')]=_[_0x9951('0x2f')](_0x11d2b4[_0x9951('0x2c')],_0x11d2b4[_0x9951('0x2d')]);_0x13cc10[_0x9951('0x30')]=_['intersection'](_0x11d2b4[_0x9951('0x2c')],qs[_0x9951('0x31')](_0x3a2fdf[_0x9951('0x2d')][_0x9951('0x31')]));_0x13cc10[_0x9951('0x30')]=_0x13cc10['attributes']['length']?_0x13cc10['attributes']:_0x11d2b4[_0x9951('0x2c')];_0x13cc10[_0x9951('0x34')]=qs[_0x9951('0x35')](_0x3a2fdf[_0x9951('0x2d')][_0x9951('0x35')]);_0x13cc10[_0x9951('0x36')]=qs[_0x9951('0x2e')](_[_0x9951('0x37')](_0x3a2fdf[_0x9951('0x2d')],_0x11d2b4['filters']));if(_0x3a2fdf[_0x9951('0x2d')][_0x9951('0x38')]){_0x13cc10[_0x9951('0x36')]=_[_0x9951('0x39')](_0x13cc10[_0x9951('0x36')],{'$or':_['map'](_0x13cc10[_0x9951('0x30')],function(_0x361770){var _0xeed6ec={};_0xeed6ec[_0x361770]={'$like':'%'+_0x3a2fdf[_0x9951('0x2d')]['filter']+'%'};return _0xeed6ec;})});}_0x13cc10=_[_0x9951('0x39')]({},_0x13cc10,_0x3a2fdf[_0x9951('0x3a')]);return _0x450d01[_0x9951('0x47')](_0x13cc10);}})[_0x9951('0x3b')](function(_0x459494){if(_0x459494){_0x5cd8e2=_0x459494['length'];if(!_0x3a2fdf[_0x9951('0x2d')][_0x9951('0x49')](_0x9951('0x4a'))){_0x13cc10[_0x9951('0x1b')]=qs[_0x9951('0x1b')](_0x3a2fdf[_0x9951('0x2d')][_0x9951('0x1b')]);_0x13cc10[_0x9951('0x33')]=qs['offset'](_0x3a2fdf['query']['offset']);}return _0x450d01['getConfigurations'](_0x13cc10);}})['then'](function(_0xd5130f){if(_0xd5130f){return _0xd5130f?{'count':_0x5cd8e2,'rows':_0xd5130f}:null;}})[_0x9951('0x3b')](respondWithResult(_0x1ee1ce,null))[_0x9951('0x3f')](handleError(_0x1ee1ce,null));};exports[_0x9951('0x4b')]=function(_0x542094,_0xf7ed18,_0x10d068){if(_0x542094[_0x9951('0x46')]['id']){delete _0x542094[_0x9951('0x46')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x542094['params']['id']}})[_0x9951('0x3b')](handleEntityNotFound(_0xf7ed18,null))['then'](function(_0x5d8702){if(_0x5d8702){_0x542094['body'][_0x9951('0x4c')]=_0x5d8702['id'];_0x542094[_0x9951('0x46')]['Subjects']=integrations[_0x9951('0x4d')](_0x542094['body'][_0x9951('0x4e')],_0x542094[_0x9951('0x46')][_0x9951('0x2a')]);_0x542094[_0x9951('0x46')]['Descriptions']=integrations[_0x9951('0x4f')](_0x542094[_0x9951('0x46')][_0x9951('0x4e')],_0x542094['body'][_0x9951('0x2a')]);return db[_0x9951('0x48')]['create'](_0x542094[_0x9951('0x46')],{'include':[{'model':db[_0x9951('0x50')],'as':_0x9951('0x51')},{'model':db[_0x9951('0x50')],'as':_0x9951('0x52')}]});}return null;})['then'](respondWithResult(_0xf7ed18,null))['catch'](handleError(_0xf7ed18,null));};var md5=require('md5');exports[_0x9951('0x53')]=function(_0xd72334,_0x2e7333,_0x6a48b3){var _0x17d224=null;var _0x319f06=null;var _0xa29e86=null;var _0x4333ce=null;var _0x146b6e='';return db[_0x9951('0x43')][_0x9951('0x54')]({'where':{'id':_0xd72334[_0x9951('0x41')]['id']},'attributes':['id',_0x9951('0x24'),_0x9951('0x55'),'description',_0x9951('0x56'),_0x9951('0x57'),_0x9951('0x58'),_0x9951('0x59')]})[_0x9951('0x3b')](handleEntityNotFound(_0x2e7333,null))['then'](function(_0x48f431){if(_0x48f431){_0x17d224=_0x48f431['username'];_0x319f06=_0x48f431[_0x9951('0x59')];_0xa29e86=_0x48f431[_0x9951('0x56')];_0x146b6e=_0x48f431['remoteUri'];var _0x3c38ef=_0x146b6e[_0x9951('0x5a')](-0x1);if(_0x3c38ef==='/'){_0x146b6e=_0x146b6e['substring'](0x0,_0x146b6e[_0x9951('0x5b')](_0x3c38ef));}_0x4333ce=util[_0x9951('0x5c')](_0x9951('0x5d'),_0x146b6e);var _0x238cfd={'method':'GET','uri':_0x4333ce,'qs':{'operation':_0x9951('0x5e'),'username':_0x48f431[_0x9951('0x55')]},'json':!![]};return rp(_0x238cfd);}})['then'](function(_0x378d2f){if(_0x378d2f[_0x9951('0x5f')]){var _0x2227ff={'method':'POST','uri':_0x4333ce,'form':{'operation':_0x9951('0x60'),'username':_0x17d224,'accessKey':md5(_0x378d2f[_0x9951('0x61')][_0x9951('0x62')]+_0x319f06)},'json':!![]};return rp(_0x2227ff);}})['then'](function(_0x222765){if(_0x222765[_0x9951('0x5f')]){var _0x110829={'method':_0x9951('0x63'),'uri':_0x4333ce,'qs':{'operation':_0x9951('0x64'),'username':_0x17d224,'sessionName':_0x222765[_0x9951('0x61')]['sessionName'],'elementType':_0xa29e86},'json':!![]};return rp(_0x110829);}})[_0x9951('0x3b')](function(_0x6135b9){if(_0x6135b9[_0x9951('0x5f')]){var _0x33d650=[_0x9951('0x65'),_0x9951('0x66'),'owner'];_[_0x9951('0x67')](_0x6135b9[_0x9951('0x61')][_0x9951('0x31')],function(_0x1312e0){return _0x33d650[_0x9951('0x68')](_0x1312e0['type']['name']);});_[_0x9951('0x67')](_0x6135b9['result'][_0x9951('0x31')],function(_0x5e6023){return _0x5e6023['editable']===_0x9951('0x69');});return{'count':_0x6135b9[_0x9951('0x61')][_0x9951('0x31')][_0x9951('0x32')],'rows':_[_0x9951('0x27')](_0x6135b9['result'][_0x9951('0x31')],function(_0x97b2b6){return{'id':_0x97b2b6[_0x9951('0x24')],'name':_0x97b2b6[_0x9951('0x6a')],'custom':_['startsWith'](_0x97b2b6['name'],_0x9951('0x6b'))?!![]:![],'options':_0x97b2b6[_0x9951('0x2a')][_0x9951('0x24')]===_0x9951('0x6c')&&_0x97b2b6[_0x9951('0x2a')]['picklistValues'][_0x9951('0x32')]>0x0?_[_0x9951('0x27')](_0x97b2b6[_0x9951('0x2a')][_0x9951('0x6d')],function(_0x2c3123){return{'name':_0x2c3123[_0x9951('0x6a')],'value':_0x2c3123['value']};}):[]};})};}})['then'](respondWithResult(_0x2e7333,null))['catch'](function(_0x5d2c18){console[_0x9951('0x6e')](_0x9951('0x6f')+_0x5d2c18);var _0x311565=_0xd72334['query']['test']?0x1f4:_0x5d2c18[_0x9951('0x70')]||0x1f4;logger[_0x9951('0x23')](_0x9951('0x71'),_0x9951('0x53'),_0x311565,JSON[_0x9951('0x72')](_0x5d2c18));delete _0x5d2c18[_0x9951('0x24')];if(_0x311565===0x191){_0x311565=0x190;}_0x2e7333[_0x9951('0x17')](_0x311565)[_0x9951('0x25')](_0xd72334[_0x9951('0x2d')][_0x9951('0x73')]?{'message':_0x9951('0x74'),'statusCode':_0x5d2c18[_0x9951('0x70')]}:_0x5d2c18);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 5e10719..59d8ee9 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 _0x5f80=['rimraf','../../config/environment','./intVtigerAccount.attributes','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x688c0e,_0xc9e8e8){var _0x351de9=function(_0x5ac96d){while(--_0x5ac96d){_0x688c0e['push'](_0x688c0e['shift']());}};_0x351de9(++_0xc9e8e8);}(_0x5f80,0x1bd));var _0x05f8=function(_0x35899c,_0x4fe3df){_0x35899c=_0x35899c-0x0;var _0x2db7c7=_0x5f80[_0x35899c];return _0x2db7c7;};'use strict';var _=require(_0x05f8('0x0'));var util=require('util');var logger=require(_0x05f8('0x1'))('api');var moment=require(_0x05f8('0x2'));var BPromise=require(_0x05f8('0x3'));var rp=require(_0x05f8('0x4'));var fs=require('fs');var path=require(_0x05f8('0x5'));var rimraf=require(_0x05f8('0x6'));var config=require(_0x05f8('0x7'));var attributes=require(_0x05f8('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x47b850,_0x16765f){return _0x47b850['define'](_0x05f8('0x9'),attributes,{'tableName':_0x05f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e74=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0x1e74,0x13a));var _0x41e7=function(_0x36b40c,_0x17ca77){_0x36b40c=_0x36b40c-0x0;var _0x214e48=_0x1e74[_0x36b40c];return _0x214e48;};'use strict';var _=require(_0x41e7('0x0'));var util=require(_0x41e7('0x1'));var logger=require(_0x41e7('0x2'))(_0x41e7('0x3'));var moment=require(_0x41e7('0x4'));var BPromise=require(_0x41e7('0x5'));var rp=require(_0x41e7('0x6'));var fs=require('fs');var path=require(_0x41e7('0x7'));var rimraf=require(_0x41e7('0x8'));var config=require('../../config/environment');var attributes=require(_0x41e7('0x9'));var integrations=require(_0x41e7('0xa'));module[_0x41e7('0xb')]=function(_0x5f16dd,_0x1a1eae){return _0x5f16dd[_0x41e7('0xc')](_0x41e7('0xd'),attributes,{'tableName':_0x41e7('0xe'),'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 f681b1f..5836770 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 _0x1be1=['../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x40d719,_0x1ab6d4){var _0x39a12c=function(_0x16bd73){while(--_0x16bd73){_0x40d719['push'](_0x40d719['shift']());}};_0x39a12c(++_0x1ab6d4);}(_0x1be1,0x192));var _0x11be=function(_0x1d551c,_0xc79c6e){_0x1d551c=_0x1d551c-0x0;var _0x54e3f2=_0x1be1[_0x1d551c];return _0x54e3f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['VtigerAccount']['findAll']({'raw':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x56ab61[_0x11be('0x17')]?_0x56ab61['options'][_0x11be('0x19')]||null:null,'attributes':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'limit':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1b')]||null:null,'include':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')]?_['map'](_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')],function(_0x2fe43c){return{'model':db[_0x2fe43c['model']],'as':_0x2fe43c['as'],'attributes':_0x2fe43c['attributes'],'include':_0x2fe43c[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x2fe43c[_0x11be('0x1c')],function(_0x4cb27f){return{'model':db[_0x4cb27f[_0x11be('0x1e')]],'as':_0x4cb27f['as'],'attributes':_0x4cb27f['attributes'],'include':_0x4cb27f[_0x11be('0x1c')]?_['map'](_0x4cb27f[_0x11be('0x1c')],function(_0xb11f3d){return{'model':db[_0xb11f3d['model']],'as':_0xb11f3d['as'],'attributes':_0xb11f3d[_0x11be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1d3b5c){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x1d3b5c));_0xc3263c(_0x1d3b5c);})[_0x11be('0x15')](function(_0x5966c5){logger[_0x11be('0x11')]('GetVtigerAccount',_0x5966c5[_0x11be('0x13')],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x5966c5['message']));});});};exports['ShowVtigerAccount']=function(_0x49fd5c){var _0x265fc9=this;return new Promise(function(_0x5e8f9a,_0x66316d){return db[_0x11be('0x1f')][_0x11be('0x20')]({'raw':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x49fd5c['options']?_0x49fd5c[_0x11be('0x17')][_0x11be('0x19')]||null:null,'attributes':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'include':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c['options'][_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x49fd5c[_0x11be('0x17')][_0x11be('0x1c')],function(_0x228bd3){return{'model':db[_0x228bd3['model']],'as':_0x228bd3['as'],'attributes':_0x228bd3[_0x11be('0x1a')],'include':_0x228bd3[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x228bd3['include'],function(_0x2c6fb2){return{'model':db[_0x2c6fb2['model']],'as':_0x2c6fb2['as'],'attributes':_0x2c6fb2['attributes'],'include':_0x2c6fb2['include']?_['map'](_0x2c6fb2[_0x11be('0x1c')],function(_0x2c5715){return{'model':db[_0x2c5715[_0x11be('0x1e')]],'as':_0x2c5715['as'],'attributes':_0x2c5715['attributes']};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1866d8){logger['info'](_0x11be('0x21'),_0x49fd5c);logger['debug'](_0x11be('0x21'),_0x49fd5c,JSON['stringify'](_0x1866d8));_0x5e8f9a(_0x1866d8);})[_0x11be('0x15')](function(_0xa6d724){logger[_0x11be('0x11')](_0x11be('0x21'),_0xa6d724['message'],_0x49fd5c);_0x66316d(_0x265fc9[_0x11be('0x11')](0x1f4,_0xa6d724[_0x11be('0x13')]));});});}; \ No newline at end of file +var _0x7d25=['raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','then','ShowVtigerAccount','find'];(function(_0x1731a9,_0x4fb551){var _0x22b9a5=function(_0x3b62fd){while(--_0x3b62fd){_0x1731a9['push'](_0x1731a9['shift']());}};_0x22b9a5(++_0x4fb551);}(_0x7d25,0x8a));var _0x57d2=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7d25[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('VtigerAccount,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});}exports[_0x57d2('0x14')]=function(_0x7d4cf1){var _0x2ecfdf=this;return new Promise(function(_0x4a94e3,_0x525cfc){return db[_0x57d2('0x15')][_0x57d2('0x16')]({'raw':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['where']||null:null,'attributes':_0x7d4cf1['options']?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x18')]||null:null,'limit':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x19')]||null:null,'include':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')],function(_0x456fe1){return{'model':db[_0x456fe1[_0x57d2('0x1c')]],'as':_0x456fe1['as'],'attributes':_0x456fe1[_0x57d2('0x18')],'include':_0x456fe1['include']?_[_0x57d2('0x1b')](_0x456fe1[_0x57d2('0x1a')],function(_0x3c7de8){return{'model':db[_0x3c7de8[_0x57d2('0x1c')]],'as':_0x3c7de8['as'],'attributes':_0x3c7de8[_0x57d2('0x18')],'include':_0x3c7de8['include']?_[_0x57d2('0x1b')](_0x3c7de8[_0x57d2('0x1a')],function(_0x995928){return{'model':db[_0x995928[_0x57d2('0x1c')]],'as':_0x995928['as'],'attributes':_0x995928[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x57d2('0x1d')](function(_0x9bdb11){logger['info'](_0x57d2('0x14'),_0x7d4cf1);logger[_0x57d2('0xb')](_0x57d2('0x14'),_0x7d4cf1,JSON[_0x57d2('0xe')](_0x9bdb11));_0x4a94e3(_0x9bdb11);})[_0x57d2('0x13')](function(_0x7c33f3){logger[_0x57d2('0xf')](_0x57d2('0x14'),_0x7c33f3[_0x57d2('0x11')],_0x7d4cf1);_0x525cfc(_0x2ecfdf[_0x57d2('0xf')](0x1f4,_0x7c33f3['message']));});});};exports[_0x57d2('0x1e')]=function(_0x3da926){var _0x26e052=this;return new Promise(function(_0x3e017c,_0x484597){return db[_0x57d2('0x15')][_0x57d2('0x1f')]({'raw':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x20')]===undefined?!![]:![]:!![],'where':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x21')]||null:null,'attributes':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x18')]||null:null,'include':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x3da926['options'][_0x57d2('0x1a')],function(_0x1c4ea5){return{'model':db[_0x1c4ea5[_0x57d2('0x1c')]],'as':_0x1c4ea5['as'],'attributes':_0x1c4ea5[_0x57d2('0x18')],'include':_0x1c4ea5[_0x57d2('0x1a')]?_['map'](_0x1c4ea5['include'],function(_0x581ebc){return{'model':db[_0x581ebc['model']],'as':_0x581ebc['as'],'attributes':_0x581ebc[_0x57d2('0x18')],'include':_0x581ebc[_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x581ebc[_0x57d2('0x1a')],function(_0x13beac){return{'model':db[_0x13beac['model']],'as':_0x13beac['as'],'attributes':_0x13beac[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3378a6){logger[_0x57d2('0x9')](_0x57d2('0x1e'),_0x3da926);logger['debug'](_0x57d2('0x1e'),_0x3da926,JSON[_0x57d2('0xe')](_0x3378a6));_0x3e017c(_0x3378a6);})['catch'](function(_0xb33455){logger[_0x57d2('0xf')](_0x57d2('0x1e'),_0xb33455[_0x57d2('0x11')],_0x3da926);_0x484597(_0x26e052[_0x57d2('0xf')](0x1f4,_0xb33455[_0x57d2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 6d772a2..9e693f1 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 _0x85e5=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x2868e3,_0x509ef1){var _0x20b023=function(_0x554382){while(--_0x554382){_0x2868e3['push'](_0x2868e3['shift']());}};_0x20b023(++_0x509ef1);}(_0x85e5,0x1dc));var _0x585e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85e5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x585e('0x0'));var util=require(_0x585e('0x1'));var path=require(_0x585e('0x2'));var timeout=require(_0x585e('0x3'));var express=require(_0x585e('0x4'));var router=express[_0x585e('0x5')]();var fs_extra=require(_0x585e('0x6'));var auth=require(_0x585e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x585e('0x8'));var controller=require(_0x585e('0x9'));router[_0x585e('0xa')]('/',auth[_0x585e('0xb')](),controller[_0x585e('0xc')]);router[_0x585e('0xa')](_0x585e('0xd'),auth['isAuthenticated'](),controller[_0x585e('0xe')]);router['get'](_0x585e('0xf'),auth['isAuthenticated'](),controller[_0x585e('0x10')]);router[_0x585e('0xa')](_0x585e('0x11'),auth[_0x585e('0xb')](),controller[_0x585e('0x12')]);router[_0x585e('0xa')](_0x585e('0x13'),auth['isAuthenticated'](),controller[_0x585e('0x14')]);router[_0x585e('0x15')]('/',auth[_0x585e('0xb')](),controller['create']);router[_0x585e('0x16')](_0x585e('0xd'),auth[_0x585e('0xb')](),controller[_0x585e('0x17')]);router[_0x585e('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x585e('0x19')]);module[_0x585e('0x1a')]=router; \ No newline at end of file +var _0xfacb=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete'];(function(_0x43c0e6,_0x448d2e){var _0x1827a8=function(_0x1bef09){while(--_0x1bef09){_0x43c0e6['push'](_0x43c0e6['shift']());}};_0x1827a8(++_0x448d2e);}(_0xfacb,0x188));var _0xbfac=function(_0x11e957,_0x1bb60b){_0x11e957=_0x11e957-0x0;var _0x1b0eea=_0xfacb[_0x11e957];return _0x1b0eea;};'use strict';var multer=require(_0xbfac('0x0'));var util=require(_0xbfac('0x1'));var path=require('path');var timeout=require(_0xbfac('0x2'));var express=require(_0xbfac('0x3'));var router=express[_0xbfac('0x4')]();var fs_extra=require(_0xbfac('0x5'));var auth=require(_0xbfac('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbfac('0x7'));router['get']('/',auth[_0xbfac('0x8')](),controller[_0xbfac('0x9')]);router[_0xbfac('0xa')](_0xbfac('0xb'),auth[_0xbfac('0x8')](),controller[_0xbfac('0xc')]);router[_0xbfac('0xa')](_0xbfac('0xd'),auth['isAuthenticated'](),controller[_0xbfac('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xbfac('0xf')]);router[_0xbfac('0xa')](_0xbfac('0x10'),auth[_0xbfac('0x8')](),controller[_0xbfac('0x11')]);router['post']('/',auth[_0xbfac('0x8')](),controller[_0xbfac('0x12')]);router[_0xbfac('0x13')](_0xbfac('0xb'),auth[_0xbfac('0x8')](),controller[_0xbfac('0x14')]);router[_0xbfac('0x15')](_0xbfac('0xb'),auth[_0xbfac('0x8')](),controller[_0xbfac('0x16')]);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 7f52dcf..42403b1 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 _0x58a3=['exports','STRING'];(function(_0x5dbc38,_0x1d2dd5){var _0x2cc4b3=function(_0x1181ff){while(--_0x1181ff){_0x5dbc38['push'](_0x5dbc38['shift']());}};_0x2cc4b3(++_0x1d2dd5);}(_0x58a3,0x1ae));var _0x358a=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x58a3[_0x12bcf7];return _0x2825a;};'use strict';var Sequelize=require('sequelize');module[_0x358a('0x0')]={'name':{'type':Sequelize[_0x358a('0x1')]},'description':{'type':Sequelize[_0x358a('0x1')]}}; \ No newline at end of file +var _0x24d7=['STRING','sequelize','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x24d7,0xf7));var _0x724d=function(_0x1b5648,_0xe285e9){_0x1b5648=_0x1b5648-0x0;var _0x103017=_0x24d7[_0x1b5648];return _0x103017;};'use strict';var Sequelize=require(_0x724d('0x0'));module[_0x724d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x724d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e5c1e30..4202e87 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 _0x24ef=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','VIRTUAL','merge','options','where','then','include','findAll','rows','catch','includeAll','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2e0cd1,_0x149caa){var _0x4b0159=function(_0x246fe8){while(--_0x246fe8){_0x2e0cd1['push'](_0x2e0cd1['shift']());}};_0x4b0159(++_0x149caa);}(_0x24ef,0xdf));var _0xf24e=function(_0x479c21,_0x6c38dc){_0x479c21=_0x479c21-0x0;var _0x4ba3c0=_0x24ef[_0x479c21];return _0x4ba3c0;};'use strict';var emlformat=require(_0xf24e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf24e('0x1'));var jsonpatch=require(_0xf24e('0x2'));var rp=require('request-promise');var moment=require(_0xf24e('0x3'));var BPromise=require(_0xf24e('0x4'));var Mustache=require(_0xf24e('0x5'));var util=require(_0xf24e('0x6'));var path=require(_0xf24e('0x7'));var sox=require(_0xf24e('0x8'));var csv=require(_0xf24e('0x9'));var ejs=require(_0xf24e('0xa'));var fs=require('fs');var fs_extra=require(_0xf24e('0xb'));var _=require(_0xf24e('0xc'));var squel=require(_0xf24e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf24e('0xe'));var deskjs=require(_0xf24e('0xf'));var toCsv=require(_0xf24e('0x9'));var querystring=require(_0xf24e('0x10'));var Papa=require(_0xf24e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf24e('0x12'));var hardwareService=require(_0xf24e('0x13'));var logger=require(_0xf24e('0x14'))(_0xf24e('0x15'));var utils=require(_0xf24e('0x16'));var config=require(_0xf24e('0x17'));var licenseUtil=require(_0xf24e('0x18'));var db=require(_0xf24e('0x19'))['db'];function respondWithStatusCode(_0x509ed0,_0x5dd61e){_0x5dd61e=_0x5dd61e||0xcc;return function(_0x258c82){if(_0x258c82){return _0x509ed0[_0xf24e('0x1a')](_0x5dd61e);}return _0x509ed0[_0xf24e('0x1b')](_0x5dd61e)['end']();};}function respondWithResult(_0x3503d9,_0x4e05e8){_0x4e05e8=_0x4e05e8||0xc8;return function(_0x20f1c9){if(_0x20f1c9){return _0x3503d9['status'](_0x4e05e8)[_0xf24e('0x1c')](_0x20f1c9);}};}function respondWithFilteredResult(_0x50db4e,_0x3b80ab){return function(_0x257484){if(_0x257484){var _0x3d16d6=typeof _0x3b80ab['offset']===_0xf24e('0x1d')&&typeof _0x3b80ab[_0xf24e('0x1e')]===_0xf24e('0x1d');var _0x5d05dc=_0x257484[_0xf24e('0x1f')];var _0x22fcfa=_0x3d16d6?0x0:_0x3b80ab[_0xf24e('0x20')];var _0x1050c5=_0x3d16d6?_0x257484[_0xf24e('0x1f')]:_0x3b80ab[_0xf24e('0x20')]+_0x3b80ab[_0xf24e('0x1e')];var _0x177ddf;if(_0x1050c5>=_0x5d05dc){_0x1050c5=_0x5d05dc;_0x177ddf=0xc8;}else{_0x177ddf=0xce;}_0x50db4e[_0xf24e('0x1b')](_0x177ddf);return _0x50db4e['set'](_0xf24e('0x21'),_0x22fcfa+'-'+_0x1050c5+'/'+_0x5d05dc)[_0xf24e('0x1c')](_0x257484);}return null;};}function patchUpdates(_0x46dcbb){return function(_0x15281a){try{jsonpatch[_0xf24e('0x22')](_0x15281a,_0x46dcbb,!![]);}catch(_0x3fcaa1){return BPromise[_0xf24e('0x23')](_0x3fcaa1);}return _0x15281a[_0xf24e('0x24')]();};}function saveUpdates(_0x472c94,_0x52745d){return function(_0x2cedce){if(_0x2cedce){return _0x2cedce[_0xf24e('0x25')](_0x472c94)['then'](function(_0xc781cb){return _0xc781cb;});}return null;};}function removeEntity(_0xb2c8b8,_0x17385a){return function(_0x27491f){if(_0x27491f){return _0x27491f[_0xf24e('0x26')]()['then'](function(){_0xb2c8b8[_0xf24e('0x1b')](0xcc)[_0xf24e('0x27')]();});}};}function handleEntityNotFound(_0x12aa7a,_0x1607f2){return function(_0x3ca5c6){if(!_0x3ca5c6){_0x12aa7a[_0xf24e('0x1a')](0x194);}return _0x3ca5c6;};}function handleError(_0x22b400,_0x42c346){_0x42c346=_0x42c346||0x1f4;return function(_0x22dd81){logger['error'](_0x22dd81[_0xf24e('0x28')]);if(_0x22dd81[_0xf24e('0x29')]){delete _0x22dd81[_0xf24e('0x29')];}_0x22b400['status'](_0x42c346)[_0xf24e('0x2a')](_0x22dd81);};}exports[_0xf24e('0x2b')]=function(_0x1190ab,_0x24a3cf){var _0x248f2f={},_0x3fd772={},_0x5361e7={'count':0x0,'rows':[]};var _0x13a79c=_[_0xf24e('0x2c')](db[_0xf24e('0x2d')][_0xf24e('0x2e')],function(_0x828340){return{'name':_0x828340['fieldName'],'type':_0x828340[_0xf24e('0x2f')][_0xf24e('0x30')]};});_0x3fd772[_0xf24e('0x31')]=_['map'](_0x13a79c,_0xf24e('0x29'));_0x3fd772[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x1190ab[_0xf24e('0x32')]);_0x3fd772['filters']=_[_0xf24e('0x34')](_0x3fd772[_0xf24e('0x31')],_0x3fd772['query']);_0x248f2f[_0xf24e('0x35')]=_[_0xf24e('0x34')](_0x3fd772['model'],qs['fields'](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x36')]));_0x248f2f[_0xf24e('0x35')]=_0x248f2f[_0xf24e('0x35')][_0xf24e('0x37')]?_0x248f2f[_0xf24e('0x35')]:_0x3fd772[_0xf24e('0x31')];if(!_0x1190ab[_0xf24e('0x32')][_0xf24e('0x38')](_0xf24e('0x39'))){_0x248f2f[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x1e')]);_0x248f2f[_0xf24e('0x20')]=qs['offset'](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x20')]);}_0x248f2f[_0xf24e('0x3a')]=qs[_0xf24e('0x3b')](_0x1190ab[_0xf24e('0x32')][_0xf24e('0x3b')]);_0x248f2f['where']=qs[_0xf24e('0x3c')](_[_0xf24e('0x3d')](_0x1190ab['query'],_0x3fd772[_0xf24e('0x3c')]),_0x13a79c);if(_0x1190ab['query'][_0xf24e('0x3e')]){_0x248f2f['where']=_['merge'](_0x248f2f['where'],{'$or':_[_0xf24e('0x2c')](_0x13a79c,function(_0x171abf){if(_0x171abf['type']!==_0xf24e('0x3f')){var _0x173176={};_0x173176[_0x171abf[_0xf24e('0x29')]]={'$like':'%'+_0x1190ab['query'][_0xf24e('0x3e')]+'%'};return _0x173176;}})});}_0x248f2f=_[_0xf24e('0x40')]({},_0x248f2f,_0x1190ab[_0xf24e('0x41')]);var _0x4116aa={'where':_0x248f2f[_0xf24e('0x42')]};return db[_0xf24e('0x2d')][_0xf24e('0x1f')](_0x4116aa)[_0xf24e('0x43')](function(_0x427dbd){_0x5361e7['count']=_0x427dbd;if(_0x1190ab[_0xf24e('0x32')]['includeAll']){_0x248f2f[_0xf24e('0x44')]=[{'all':!![]}];}return db[_0xf24e('0x2d')][_0xf24e('0x45')](_0x248f2f);})[_0xf24e('0x43')](function(_0x2b3ded){_0x5361e7[_0xf24e('0x46')]=_0x2b3ded;return _0x5361e7;})[_0xf24e('0x43')](respondWithFilteredResult(_0x24a3cf,_0x248f2f))[_0xf24e('0x47')](handleError(_0x24a3cf,null));};exports['show']=function(_0x1ec608,_0x1fa7d1){var _0x2fc9c7={'raw':![],'where':{'id':_0x1ec608['params']['id']}},_0x3c6ee2={};_0x3c6ee2[_0xf24e('0x31')]=_[_0xf24e('0x33')](db['VtigerConfiguration'][_0xf24e('0x2e')]);_0x3c6ee2[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x1ec608['query']);_0x3c6ee2[_0xf24e('0x3c')]=_[_0xf24e('0x34')](_0x3c6ee2[_0xf24e('0x31')],_0x3c6ee2[_0xf24e('0x32')]);_0x2fc9c7['attributes']=_[_0xf24e('0x34')](_0x3c6ee2[_0xf24e('0x31')],qs[_0xf24e('0x36')](_0x1ec608[_0xf24e('0x32')][_0xf24e('0x36')]));_0x2fc9c7['attributes']=_0x2fc9c7[_0xf24e('0x35')][_0xf24e('0x37')]?_0x2fc9c7[_0xf24e('0x35')]:_0x3c6ee2[_0xf24e('0x31')];if(_0x1ec608[_0xf24e('0x32')][_0xf24e('0x48')]){_0x2fc9c7[_0xf24e('0x44')]=[{'all':!![]}];}_0x2fc9c7=_[_0xf24e('0x40')]({},_0x2fc9c7,_0x1ec608[_0xf24e('0x41')]);return db['VtigerConfiguration'][_0xf24e('0x49')](_0x2fc9c7)[_0xf24e('0x43')](handleEntityNotFound(_0x1fa7d1,null))[_0xf24e('0x43')](respondWithResult(_0x1fa7d1,null))[_0xf24e('0x47')](handleError(_0x1fa7d1,null));};exports[_0xf24e('0x4a')]=function(_0x3ac32d,_0x4a1f6b){return db['VtigerConfiguration'][_0xf24e('0x4a')](_0x3ac32d[_0xf24e('0x4b')],{})[_0xf24e('0x43')](respondWithResult(_0x4a1f6b,0xc9))['catch'](handleError(_0x4a1f6b,null));};exports[_0xf24e('0x25')]=function(_0x452bde,_0x5bc032){if(_0x452bde['body']['id']){delete _0x452bde[_0xf24e('0x4b')]['id'];}return db[_0xf24e('0x2d')]['find']({'where':{'id':_0x452bde[_0xf24e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5bc032,null))[_0xf24e('0x43')](saveUpdates(_0x452bde[_0xf24e('0x4b')],null))['then'](respondWithResult(_0x5bc032,null))['catch'](handleError(_0x5bc032,null));};exports[_0xf24e('0x26')]=function(_0xe5a329,_0x13d1bb){return db[_0xf24e('0x2d')][_0xf24e('0x49')]({'where':{'id':_0xe5a329[_0xf24e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x13d1bb,null))[_0xf24e('0x43')](removeEntity(_0x13d1bb,null))[_0xf24e('0x47')](handleError(_0x13d1bb,null));};exports[_0xf24e('0x4d')]=function(_0x4aeae4,_0x47ac47,_0x46caf9){var _0xeaa054={};var _0x27301a={};var _0x17108e;var _0x1807c5;return db[_0xf24e('0x2d')][_0xf24e('0x4e')]({'where':{'id':_0x4aeae4[_0xf24e('0x4c')]['id']}})[_0xf24e('0x43')](handleEntityNotFound(_0x47ac47,null))[_0xf24e('0x43')](function(_0x350e47){if(_0x350e47){_0x17108e=_0x350e47;_0x27301a[_0xf24e('0x31')]=_[_0xf24e('0x33')](db[_0xf24e('0x4f')][_0xf24e('0x2e')]);_0x27301a[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x4aeae4['query']);_0x27301a['filters']=_[_0xf24e('0x34')](_0x27301a['model'],_0x27301a[_0xf24e('0x32')]);_0xeaa054['attributes']=_[_0xf24e('0x34')](_0x27301a['model'],qs[_0xf24e('0x36')](_0x4aeae4[_0xf24e('0x32')][_0xf24e('0x36')]));_0xeaa054[_0xf24e('0x35')]=_0xeaa054['attributes'][_0xf24e('0x37')]?_0xeaa054[_0xf24e('0x35')]:_0x27301a[_0xf24e('0x31')];_0xeaa054['order']=qs[_0xf24e('0x3b')](_0x4aeae4['query'][_0xf24e('0x3b')]);_0xeaa054[_0xf24e('0x42')]=qs['filters'](_[_0xf24e('0x3d')](_0x4aeae4[_0xf24e('0x32')],_0x27301a['filters']));if(_0x4aeae4['query'][_0xf24e('0x3e')]){_0xeaa054[_0xf24e('0x42')]=_[_0xf24e('0x40')](_0xeaa054[_0xf24e('0x42')],{'$or':_['map'](_0xeaa054[_0xf24e('0x35')],function(_0x5bb28e){var _0xecfe47={};_0xecfe47[_0x5bb28e]={'$like':'%'+_0x4aeae4['query'][_0xf24e('0x3e')]+'%'};return _0xecfe47;})});}_0xeaa054=_['merge']({},_0xeaa054,_0x4aeae4[_0xf24e('0x41')]);return _0x17108e[_0xf24e('0x4d')](_0xeaa054);}})[_0xf24e('0x43')](function(_0x3285ec){if(_0x3285ec){_0x1807c5=_0x3285ec['length'];if(!_0x4aeae4['query']['hasOwnProperty'](_0xf24e('0x39'))){_0xeaa054[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x4aeae4['query'][_0xf24e('0x1e')]);_0xeaa054['offset']=qs[_0xf24e('0x20')](_0x4aeae4[_0xf24e('0x32')][_0xf24e('0x20')]);}return _0x17108e[_0xf24e('0x4d')](_0xeaa054);}})[_0xf24e('0x43')](function(_0x1aa801){if(_0x1aa801){return _0x1aa801?{'count':_0x1807c5,'rows':_0x1aa801}:null;}})[_0xf24e('0x43')](respondWithResult(_0x47ac47,null))[_0xf24e('0x47')](handleError(_0x47ac47,null));};exports[_0xf24e('0x50')]=function(_0x415c27,_0x7c0523,_0x186b32){var _0x304866={};var _0x163e4b={};var _0x18498f;var _0x4d405d;return db[_0xf24e('0x2d')][_0xf24e('0x4e')]({'where':{'id':_0x415c27[_0xf24e('0x4c')]['id']}})[_0xf24e('0x43')](handleEntityNotFound(_0x7c0523,null))[_0xf24e('0x43')](function(_0x2ba155){if(_0x2ba155){_0x18498f=_0x2ba155;_0x163e4b[_0xf24e('0x31')]=_['keys'](db['VtigerField'][_0xf24e('0x2e')]);_0x163e4b[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x415c27[_0xf24e('0x32')]);_0x163e4b[_0xf24e('0x3c')]=_[_0xf24e('0x34')](_0x163e4b['model'],_0x163e4b[_0xf24e('0x32')]);_0x304866[_0xf24e('0x35')]=_['intersection'](_0x163e4b[_0xf24e('0x31')],qs[_0xf24e('0x36')](_0x415c27['query']['fields']));_0x304866['attributes']=_0x304866[_0xf24e('0x35')]['length']?_0x304866[_0xf24e('0x35')]:_0x163e4b[_0xf24e('0x31')];_0x304866[_0xf24e('0x3a')]=qs['sort'](_0x415c27[_0xf24e('0x32')][_0xf24e('0x3b')]);_0x304866[_0xf24e('0x42')]=qs['filters'](_['pick'](_0x415c27['query'],_0x163e4b[_0xf24e('0x3c')]));if(_0x415c27['query'][_0xf24e('0x3e')]){_0x304866[_0xf24e('0x42')]=_['merge'](_0x304866['where'],{'$or':_[_0xf24e('0x2c')](_0x304866[_0xf24e('0x35')],function(_0x55b257){var _0x17f12e={};_0x17f12e[_0x55b257]={'$like':'%'+_0x415c27['query']['filter']+'%'};return _0x17f12e;})});}_0x304866=_[_0xf24e('0x40')]({},_0x304866,_0x415c27[_0xf24e('0x41')]);return _0x18498f[_0xf24e('0x50')](_0x304866);}})[_0xf24e('0x43')](function(_0x3bfe99){if(_0x3bfe99){_0x4d405d=_0x3bfe99[_0xf24e('0x37')];if(!_0x415c27[_0xf24e('0x32')][_0xf24e('0x38')](_0xf24e('0x39'))){_0x304866[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x415c27['query'][_0xf24e('0x1e')]);_0x304866[_0xf24e('0x20')]=qs[_0xf24e('0x20')](_0x415c27[_0xf24e('0x32')]['offset']);}return _0x18498f[_0xf24e('0x50')](_0x304866);}})[_0xf24e('0x43')](function(_0x21e46d){if(_0x21e46d){return _0x21e46d?{'count':_0x4d405d,'rows':_0x21e46d}:null;}})['then'](respondWithResult(_0x7c0523,null))['catch'](handleError(_0x7c0523,null));};exports[_0xf24e('0x51')]=function(_0x189072,_0x518835,_0x3759bc){var _0x5a7a23={};var _0x5304d2={};var _0x71c448;var _0xb0066d;return db[_0xf24e('0x2d')]['findOne']({'where':{'id':_0x189072[_0xf24e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x518835,null))[_0xf24e('0x43')](function(_0x4e85f7){if(_0x4e85f7){_0x71c448=_0x4e85f7;_0x5304d2['model']=_['keys'](db[_0xf24e('0x4f')]['rawAttributes']);_0x5304d2[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x189072[_0xf24e('0x32')]);_0x5304d2[_0xf24e('0x3c')]=_[_0xf24e('0x34')](_0x5304d2['model'],_0x5304d2['query']);_0x5a7a23['attributes']=_[_0xf24e('0x34')](_0x5304d2['model'],qs[_0xf24e('0x36')](_0x189072[_0xf24e('0x32')][_0xf24e('0x36')]));_0x5a7a23['attributes']=_0x5a7a23[_0xf24e('0x35')][_0xf24e('0x37')]?_0x5a7a23[_0xf24e('0x35')]:_0x5304d2[_0xf24e('0x31')];_0x5a7a23[_0xf24e('0x3a')]=qs[_0xf24e('0x3b')](_0x189072[_0xf24e('0x32')][_0xf24e('0x3b')]);_0x5a7a23['where']=qs[_0xf24e('0x3c')](_[_0xf24e('0x3d')](_0x189072[_0xf24e('0x32')],_0x5304d2[_0xf24e('0x3c')]));if(_0x189072[_0xf24e('0x32')][_0xf24e('0x3e')]){_0x5a7a23[_0xf24e('0x42')]=_[_0xf24e('0x40')](_0x5a7a23['where'],{'$or':_['map'](_0x5a7a23[_0xf24e('0x35')],function(_0x347e6d){var _0x2277a8={};_0x2277a8[_0x347e6d]={'$like':'%'+_0x189072[_0xf24e('0x32')][_0xf24e('0x3e')]+'%'};return _0x2277a8;})});}_0x5a7a23=_[_0xf24e('0x40')]({},_0x5a7a23,_0x189072[_0xf24e('0x41')]);return _0x71c448['getDescriptions'](_0x5a7a23);}})[_0xf24e('0x43')](function(_0x4cb1e6){if(_0x4cb1e6){_0xb0066d=_0x4cb1e6[_0xf24e('0x37')];if(!_0x189072[_0xf24e('0x32')][_0xf24e('0x38')](_0xf24e('0x39'))){_0x5a7a23[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x189072[_0xf24e('0x32')][_0xf24e('0x1e')]);_0x5a7a23[_0xf24e('0x20')]=qs[_0xf24e('0x20')](_0x189072[_0xf24e('0x32')][_0xf24e('0x20')]);}return _0x71c448[_0xf24e('0x51')](_0x5a7a23);}})[_0xf24e('0x43')](function(_0x54680a){if(_0x54680a){return _0x54680a?{'count':_0xb0066d,'rows':_0x54680a}:null;}})[_0xf24e('0x43')](respondWithResult(_0x518835,null))[_0xf24e('0x47')](handleError(_0x518835,null));}; \ No newline at end of file +var _0x6e5d=['eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','end','json','limit','count','offset','Content-Range','reject','update','then','destroy','status','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','getFields','findOne','VtigerField','length','order','hasOwnProperty','getSubjects','getDescriptions'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0x6e5d,0x9a));var _0xd6e5=function(_0x49b978,_0x47173b){_0x49b978=_0x49b978-0x0;var _0x46e41d=_0x6e5d[_0x49b978];return _0x46e41d;};'use strict';var emlformat=require(_0xd6e5('0x0'));var rimraf=require(_0xd6e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6e5('0x2'));var moment=require(_0xd6e5('0x3'));var BPromise=require(_0xd6e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd6e5('0x5'));var sox=require(_0xd6e5('0x6'));var csv=require(_0xd6e5('0x7'));var ejs=require(_0xd6e5('0x8'));var fs=require('fs');var fs_extra=require(_0xd6e5('0x9'));var _=require(_0xd6e5('0xa'));var squel=require('squel');var crypto=require(_0xd6e5('0xb'));var jsforce=require(_0xd6e5('0xc'));var deskjs=require(_0xd6e5('0xd'));var toCsv=require(_0xd6e5('0x7'));var querystring=require(_0xd6e5('0xe'));var Papa=require(_0xd6e5('0xf'));var Redis=require(_0xd6e5('0x10'));var authService=require(_0xd6e5('0x11'));var qs=require(_0xd6e5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd6e5('0x13'));var utils=require('../../config/utils');var config=require(_0xd6e5('0x14'));var licenseUtil=require(_0xd6e5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7995,_0x45db16){_0x45db16=_0x45db16||0xcc;return function(_0x5798ee){if(_0x5798ee){return _0x2d7995[_0xd6e5('0x16')](_0x45db16);}return _0x2d7995['status'](_0x45db16)[_0xd6e5('0x17')]();};}function respondWithResult(_0x4c7906,_0x45164b){_0x45164b=_0x45164b||0xc8;return function(_0xf81c25){if(_0xf81c25){return _0x4c7906['status'](_0x45164b)[_0xd6e5('0x18')](_0xf81c25);}};}function respondWithFilteredResult(_0x1f6de4,_0x575829){return function(_0xba72e6){if(_0xba72e6){var _0x1ac0e2=typeof _0x575829['offset']==='undefined'&&typeof _0x575829[_0xd6e5('0x19')]==='undefined';var _0x2547d9=_0xba72e6['count'];var _0x43dca6=_0x1ac0e2?0x0:_0x575829['offset'];var _0x5d639c=_0x1ac0e2?_0xba72e6[_0xd6e5('0x1a')]:_0x575829[_0xd6e5('0x1b')]+_0x575829['limit'];var _0x2126ed;if(_0x5d639c>=_0x2547d9){_0x5d639c=_0x2547d9;_0x2126ed=0xc8;}else{_0x2126ed=0xce;}_0x1f6de4['status'](_0x2126ed);return _0x1f6de4['set'](_0xd6e5('0x1c'),_0x43dca6+'-'+_0x5d639c+'/'+_0x2547d9)[_0xd6e5('0x18')](_0xba72e6);}return null;};}function patchUpdates(_0x2a9fa5){return function(_0x7eb155){try{jsonpatch['apply'](_0x7eb155,_0x2a9fa5,!![]);}catch(_0x2284f4){return BPromise[_0xd6e5('0x1d')](_0x2284f4);}return _0x7eb155['save']();};}function saveUpdates(_0x45f382,_0x27a6b3){return function(_0x7f00e4){if(_0x7f00e4){return _0x7f00e4[_0xd6e5('0x1e')](_0x45f382)[_0xd6e5('0x1f')](function(_0x4377f9){return _0x4377f9;});}return null;};}function removeEntity(_0x1532cb,_0x4171ea){return function(_0x295c9a){if(_0x295c9a){return _0x295c9a[_0xd6e5('0x20')]()[_0xd6e5('0x1f')](function(){_0x1532cb[_0xd6e5('0x21')](0xcc)[_0xd6e5('0x17')]();});}};}function handleEntityNotFound(_0x437b84,_0x39e819){return function(_0x4d1ee1){if(!_0x4d1ee1){_0x437b84[_0xd6e5('0x16')](0x194);}return _0x4d1ee1;};}function handleError(_0xdb3d92,_0x4182db){_0x4182db=_0x4182db||0x1f4;return function(_0x1c31e2){logger[_0xd6e5('0x22')](_0x1c31e2[_0xd6e5('0x23')]);if(_0x1c31e2[_0xd6e5('0x24')]){delete _0x1c31e2['name'];}_0xdb3d92[_0xd6e5('0x21')](_0x4182db)[_0xd6e5('0x25')](_0x1c31e2);};}exports[_0xd6e5('0x26')]=function(_0x591893,_0x55ca28){var _0x52eb95={},_0x1ab8b0={},_0x5bf09e={'count':0x0,'rows':[]};var _0x36be6d=_[_0xd6e5('0x27')](db[_0xd6e5('0x28')]['rawAttributes'],function(_0xb48257){return{'name':_0xb48257[_0xd6e5('0x29')],'type':_0xb48257[_0xd6e5('0x2a')][_0xd6e5('0x2b')]};});_0x1ab8b0[_0xd6e5('0x2c')]=_[_0xd6e5('0x27')](_0x36be6d,_0xd6e5('0x24'));_0x1ab8b0[_0xd6e5('0x2d')]=_[_0xd6e5('0x2e')](_0x591893[_0xd6e5('0x2d')]);_0x1ab8b0[_0xd6e5('0x2f')]=_[_0xd6e5('0x30')](_0x1ab8b0[_0xd6e5('0x2c')],_0x1ab8b0[_0xd6e5('0x2d')]);_0x52eb95['attributes']=_[_0xd6e5('0x30')](_0x1ab8b0[_0xd6e5('0x2c')],qs[_0xd6e5('0x31')](_0x591893[_0xd6e5('0x2d')]['fields']));_0x52eb95['attributes']=_0x52eb95[_0xd6e5('0x32')]['length']?_0x52eb95[_0xd6e5('0x32')]:_0x1ab8b0[_0xd6e5('0x2c')];if(!_0x591893[_0xd6e5('0x2d')]['hasOwnProperty'](_0xd6e5('0x33'))){_0x52eb95[_0xd6e5('0x19')]=qs[_0xd6e5('0x19')](_0x591893['query'][_0xd6e5('0x19')]);_0x52eb95['offset']=qs[_0xd6e5('0x1b')](_0x591893[_0xd6e5('0x2d')][_0xd6e5('0x1b')]);}_0x52eb95['order']=qs[_0xd6e5('0x34')](_0x591893[_0xd6e5('0x2d')]['sort']);_0x52eb95['where']=qs['filters'](_[_0xd6e5('0x35')](_0x591893[_0xd6e5('0x2d')],_0x1ab8b0[_0xd6e5('0x2f')]),_0x36be6d);if(_0x591893[_0xd6e5('0x2d')][_0xd6e5('0x36')]){_0x52eb95[_0xd6e5('0x37')]=_[_0xd6e5('0x38')](_0x52eb95[_0xd6e5('0x37')],{'$or':_[_0xd6e5('0x27')](_0x36be6d,function(_0xd5846f){if(_0xd5846f[_0xd6e5('0x2a')]!==_0xd6e5('0x39')){var _0x44d1ee={};_0x44d1ee[_0xd5846f['name']]={'$like':'%'+_0x591893[_0xd6e5('0x2d')][_0xd6e5('0x36')]+'%'};return _0x44d1ee;}})});}_0x52eb95=_['merge']({},_0x52eb95,_0x591893['options']);var _0x273cb3={'where':_0x52eb95[_0xd6e5('0x37')]};return db[_0xd6e5('0x28')][_0xd6e5('0x1a')](_0x273cb3)[_0xd6e5('0x1f')](function(_0x56cc14){_0x5bf09e[_0xd6e5('0x1a')]=_0x56cc14;if(_0x591893[_0xd6e5('0x2d')][_0xd6e5('0x3a')]){_0x52eb95[_0xd6e5('0x3b')]=[{'all':!![]}];}return db[_0xd6e5('0x28')][_0xd6e5('0x3c')](_0x52eb95);})[_0xd6e5('0x1f')](function(_0x256e80){_0x5bf09e['rows']=_0x256e80;return _0x5bf09e;})[_0xd6e5('0x1f')](respondWithFilteredResult(_0x55ca28,_0x52eb95))[_0xd6e5('0x3d')](handleError(_0x55ca28,null));};exports[_0xd6e5('0x3e')]=function(_0x2d9f6d,_0x488db4){var _0x38b7d4={'raw':![],'where':{'id':_0x2d9f6d[_0xd6e5('0x3f')]['id']}},_0xa2a80f={};_0xa2a80f[_0xd6e5('0x2c')]=_[_0xd6e5('0x2e')](db['VtigerConfiguration'][_0xd6e5('0x40')]);_0xa2a80f[_0xd6e5('0x2d')]=_[_0xd6e5('0x2e')](_0x2d9f6d['query']);_0xa2a80f[_0xd6e5('0x2f')]=_[_0xd6e5('0x30')](_0xa2a80f[_0xd6e5('0x2c')],_0xa2a80f[_0xd6e5('0x2d')]);_0x38b7d4[_0xd6e5('0x32')]=_['intersection'](_0xa2a80f[_0xd6e5('0x2c')],qs[_0xd6e5('0x31')](_0x2d9f6d[_0xd6e5('0x2d')]['fields']));_0x38b7d4[_0xd6e5('0x32')]=_0x38b7d4['attributes']['length']?_0x38b7d4[_0xd6e5('0x32')]:_0xa2a80f[_0xd6e5('0x2c')];if(_0x2d9f6d[_0xd6e5('0x2d')][_0xd6e5('0x3a')]){_0x38b7d4[_0xd6e5('0x3b')]=[{'all':!![]}];}_0x38b7d4=_['merge']({},_0x38b7d4,_0x2d9f6d[_0xd6e5('0x41')]);return db[_0xd6e5('0x28')][_0xd6e5('0x42')](_0x38b7d4)['then'](handleEntityNotFound(_0x488db4,null))[_0xd6e5('0x1f')](respondWithResult(_0x488db4,null))[_0xd6e5('0x3d')](handleError(_0x488db4,null));};exports[_0xd6e5('0x43')]=function(_0xb8309f,_0x3af93a){return db[_0xd6e5('0x28')][_0xd6e5('0x43')](_0xb8309f[_0xd6e5('0x44')],{})['then'](respondWithResult(_0x3af93a,0xc9))['catch'](handleError(_0x3af93a,null));};exports['update']=function(_0x1d5958,_0x1756fc){if(_0x1d5958[_0xd6e5('0x44')]['id']){delete _0x1d5958[_0xd6e5('0x44')]['id'];}return db['VtigerConfiguration'][_0xd6e5('0x42')]({'where':{'id':_0x1d5958['params']['id']}})[_0xd6e5('0x1f')](handleEntityNotFound(_0x1756fc,null))[_0xd6e5('0x1f')](saveUpdates(_0x1d5958['body'],null))[_0xd6e5('0x1f')](respondWithResult(_0x1756fc,null))[_0xd6e5('0x3d')](handleError(_0x1756fc,null));};exports['destroy']=function(_0x562fd8,_0x40bae1){return db['VtigerConfiguration'][_0xd6e5('0x42')]({'where':{'id':_0x562fd8[_0xd6e5('0x3f')]['id']}})[_0xd6e5('0x1f')](handleEntityNotFound(_0x40bae1,null))[_0xd6e5('0x1f')](removeEntity(_0x40bae1,null))[_0xd6e5('0x3d')](handleError(_0x40bae1,null));};exports[_0xd6e5('0x45')]=function(_0x29bc27,_0x41ed6a,_0x2831cd){var _0x4b2b9d={};var _0x4c1e35={};var _0xce43a0;var _0x3c9b18;return db['VtigerConfiguration'][_0xd6e5('0x46')]({'where':{'id':_0x29bc27[_0xd6e5('0x3f')]['id']}})[_0xd6e5('0x1f')](handleEntityNotFound(_0x41ed6a,null))[_0xd6e5('0x1f')](function(_0x15bbfd){if(_0x15bbfd){_0xce43a0=_0x15bbfd;_0x4c1e35[_0xd6e5('0x2c')]=_['keys'](db[_0xd6e5('0x47')][_0xd6e5('0x40')]);_0x4c1e35[_0xd6e5('0x2d')]=_[_0xd6e5('0x2e')](_0x29bc27['query']);_0x4c1e35[_0xd6e5('0x2f')]=_[_0xd6e5('0x30')](_0x4c1e35[_0xd6e5('0x2c')],_0x4c1e35[_0xd6e5('0x2d')]);_0x4b2b9d[_0xd6e5('0x32')]=_[_0xd6e5('0x30')](_0x4c1e35['model'],qs[_0xd6e5('0x31')](_0x29bc27['query']['fields']));_0x4b2b9d[_0xd6e5('0x32')]=_0x4b2b9d['attributes'][_0xd6e5('0x48')]?_0x4b2b9d[_0xd6e5('0x32')]:_0x4c1e35[_0xd6e5('0x2c')];_0x4b2b9d[_0xd6e5('0x49')]=qs[_0xd6e5('0x34')](_0x29bc27[_0xd6e5('0x2d')][_0xd6e5('0x34')]);_0x4b2b9d[_0xd6e5('0x37')]=qs['filters'](_['pick'](_0x29bc27['query'],_0x4c1e35[_0xd6e5('0x2f')]));if(_0x29bc27[_0xd6e5('0x2d')]['filter']){_0x4b2b9d[_0xd6e5('0x37')]=_[_0xd6e5('0x38')](_0x4b2b9d[_0xd6e5('0x37')],{'$or':_[_0xd6e5('0x27')](_0x4b2b9d[_0xd6e5('0x32')],function(_0x4475f0){var _0x1ae310={};_0x1ae310[_0x4475f0]={'$like':'%'+_0x29bc27[_0xd6e5('0x2d')][_0xd6e5('0x36')]+'%'};return _0x1ae310;})});}_0x4b2b9d=_[_0xd6e5('0x38')]({},_0x4b2b9d,_0x29bc27['options']);return _0xce43a0[_0xd6e5('0x45')](_0x4b2b9d);}})['then'](function(_0x2ec7a0){if(_0x2ec7a0){_0x3c9b18=_0x2ec7a0[_0xd6e5('0x48')];if(!_0x29bc27[_0xd6e5('0x2d')][_0xd6e5('0x4a')]('nolimit')){_0x4b2b9d[_0xd6e5('0x19')]=qs['limit'](_0x29bc27['query']['limit']);_0x4b2b9d[_0xd6e5('0x1b')]=qs[_0xd6e5('0x1b')](_0x29bc27[_0xd6e5('0x2d')][_0xd6e5('0x1b')]);}return _0xce43a0[_0xd6e5('0x45')](_0x4b2b9d);}})[_0xd6e5('0x1f')](function(_0x4afc3d){if(_0x4afc3d){return _0x4afc3d?{'count':_0x3c9b18,'rows':_0x4afc3d}:null;}})['then'](respondWithResult(_0x41ed6a,null))['catch'](handleError(_0x41ed6a,null));};exports[_0xd6e5('0x4b')]=function(_0x32f960,_0x39c633,_0x41ef5f){var _0x13ccf5={};var _0x4dd560={};var _0x29a644;var _0x11d69d;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x32f960[_0xd6e5('0x3f')]['id']}})[_0xd6e5('0x1f')](handleEntityNotFound(_0x39c633,null))[_0xd6e5('0x1f')](function(_0x2e1c62){if(_0x2e1c62){_0x29a644=_0x2e1c62;_0x4dd560[_0xd6e5('0x2c')]=_[_0xd6e5('0x2e')](db[_0xd6e5('0x47')][_0xd6e5('0x40')]);_0x4dd560[_0xd6e5('0x2d')]=_['keys'](_0x32f960['query']);_0x4dd560[_0xd6e5('0x2f')]=_[_0xd6e5('0x30')](_0x4dd560[_0xd6e5('0x2c')],_0x4dd560[_0xd6e5('0x2d')]);_0x13ccf5['attributes']=_[_0xd6e5('0x30')](_0x4dd560[_0xd6e5('0x2c')],qs[_0xd6e5('0x31')](_0x32f960[_0xd6e5('0x2d')][_0xd6e5('0x31')]));_0x13ccf5[_0xd6e5('0x32')]=_0x13ccf5[_0xd6e5('0x32')]['length']?_0x13ccf5[_0xd6e5('0x32')]:_0x4dd560['model'];_0x13ccf5['order']=qs[_0xd6e5('0x34')](_0x32f960[_0xd6e5('0x2d')][_0xd6e5('0x34')]);_0x13ccf5[_0xd6e5('0x37')]=qs[_0xd6e5('0x2f')](_[_0xd6e5('0x35')](_0x32f960['query'],_0x4dd560[_0xd6e5('0x2f')]));if(_0x32f960[_0xd6e5('0x2d')][_0xd6e5('0x36')]){_0x13ccf5[_0xd6e5('0x37')]=_[_0xd6e5('0x38')](_0x13ccf5[_0xd6e5('0x37')],{'$or':_[_0xd6e5('0x27')](_0x13ccf5[_0xd6e5('0x32')],function(_0x4f3ca7){var _0x2e57c6={};_0x2e57c6[_0x4f3ca7]={'$like':'%'+_0x32f960[_0xd6e5('0x2d')][_0xd6e5('0x36')]+'%'};return _0x2e57c6;})});}_0x13ccf5=_[_0xd6e5('0x38')]({},_0x13ccf5,_0x32f960[_0xd6e5('0x41')]);return _0x29a644[_0xd6e5('0x4b')](_0x13ccf5);}})[_0xd6e5('0x1f')](function(_0x2a7b8f){if(_0x2a7b8f){_0x11d69d=_0x2a7b8f[_0xd6e5('0x48')];if(!_0x32f960[_0xd6e5('0x2d')]['hasOwnProperty']('nolimit')){_0x13ccf5['limit']=qs[_0xd6e5('0x19')](_0x32f960[_0xd6e5('0x2d')][_0xd6e5('0x19')]);_0x13ccf5[_0xd6e5('0x1b')]=qs['offset'](_0x32f960[_0xd6e5('0x2d')][_0xd6e5('0x1b')]);}return _0x29a644['getSubjects'](_0x13ccf5);}})[_0xd6e5('0x1f')](function(_0xbc99b0){if(_0xbc99b0){return _0xbc99b0?{'count':_0x11d69d,'rows':_0xbc99b0}:null;}})['then'](respondWithResult(_0x39c633,null))[_0xd6e5('0x3d')](handleError(_0x39c633,null));};exports['getDescriptions']=function(_0x516e33,_0x1ff02d,_0x498fab){var _0xe05730={};var _0x3fc913={};var _0x4479cd;var _0x45e209;return db[_0xd6e5('0x28')][_0xd6e5('0x46')]({'where':{'id':_0x516e33[_0xd6e5('0x3f')]['id']}})[_0xd6e5('0x1f')](handleEntityNotFound(_0x1ff02d,null))[_0xd6e5('0x1f')](function(_0x4e4fbe){if(_0x4e4fbe){_0x4479cd=_0x4e4fbe;_0x3fc913[_0xd6e5('0x2c')]=_[_0xd6e5('0x2e')](db[_0xd6e5('0x47')]['rawAttributes']);_0x3fc913['query']=_['keys'](_0x516e33[_0xd6e5('0x2d')]);_0x3fc913[_0xd6e5('0x2f')]=_['intersection'](_0x3fc913[_0xd6e5('0x2c')],_0x3fc913['query']);_0xe05730[_0xd6e5('0x32')]=_[_0xd6e5('0x30')](_0x3fc913[_0xd6e5('0x2c')],qs[_0xd6e5('0x31')](_0x516e33[_0xd6e5('0x2d')][_0xd6e5('0x31')]));_0xe05730[_0xd6e5('0x32')]=_0xe05730['attributes']['length']?_0xe05730[_0xd6e5('0x32')]:_0x3fc913[_0xd6e5('0x2c')];_0xe05730[_0xd6e5('0x49')]=qs[_0xd6e5('0x34')](_0x516e33['query'][_0xd6e5('0x34')]);_0xe05730[_0xd6e5('0x37')]=qs[_0xd6e5('0x2f')](_['pick'](_0x516e33['query'],_0x3fc913[_0xd6e5('0x2f')]));if(_0x516e33[_0xd6e5('0x2d')]['filter']){_0xe05730[_0xd6e5('0x37')]=_['merge'](_0xe05730[_0xd6e5('0x37')],{'$or':_[_0xd6e5('0x27')](_0xe05730[_0xd6e5('0x32')],function(_0x1d59b8){var _0x3718f9={};_0x3718f9[_0x1d59b8]={'$like':'%'+_0x516e33[_0xd6e5('0x2d')][_0xd6e5('0x36')]+'%'};return _0x3718f9;})});}_0xe05730=_[_0xd6e5('0x38')]({},_0xe05730,_0x516e33[_0xd6e5('0x41')]);return _0x4479cd[_0xd6e5('0x4c')](_0xe05730);}})[_0xd6e5('0x1f')](function(_0xaee889){if(_0xaee889){_0x45e209=_0xaee889[_0xd6e5('0x48')];if(!_0x516e33['query']['hasOwnProperty'](_0xd6e5('0x33'))){_0xe05730[_0xd6e5('0x19')]=qs[_0xd6e5('0x19')](_0x516e33[_0xd6e5('0x2d')][_0xd6e5('0x19')]);_0xe05730[_0xd6e5('0x1b')]=qs['offset'](_0x516e33[_0xd6e5('0x2d')]['offset']);}return _0x4479cd['getDescriptions'](_0xe05730);}})[_0xd6e5('0x1f')](function(_0x31835f){if(_0x31835f){return _0x31835f?{'count':_0x45e209,'rows':_0x31835f}:null;}})['then'](respondWithResult(_0x1ff02d,null))[_0xd6e5('0x3d')](handleError(_0x1ff02d,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index eec7a47..fd1bb13 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 _0xb948=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x8da055,_0x45250b){var _0x4dd0f7=function(_0xd157ff){while(--_0xd157ff){_0x8da055['push'](_0x8da055['shift']());}};_0x4dd0f7(++_0x45250b);}(_0xb948,0x1c1));var _0x8b94=function(_0x3340c8,_0x3d67d7){_0x3340c8=_0x3340c8-0x0;var _0x30ca8a=_0xb948[_0x3340c8];return _0x30ca8a;};'use strict';var _=require(_0x8b94('0x0'));var util=require(_0x8b94('0x1'));var logger=require(_0x8b94('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b94('0x3'));var rp=require(_0x8b94('0x4'));var fs=require('fs');var path=require(_0x8b94('0x5'));var rimraf=require('rimraf');var config=require(_0x8b94('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x538b4b,_0x23d005){return _0x538b4b[_0x8b94('0x7')](_0x8b94('0x8'),attributes,{'tableName':_0x8b94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d12=['VtigerConfiguration','int_vtiger_configurations','lodash','util','api','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports'];(function(_0x583475,_0x23ed80){var _0x326fbe=function(_0xdc9682){while(--_0xdc9682){_0x583475['push'](_0x583475['shift']());}};_0x326fbe(++_0x23ed80);}(_0x2d12,0x183));var _0x22d1=function(_0x32a560,_0x8405da){_0x32a560=_0x32a560-0x0;var _0x24c8f7=_0x2d12[_0x32a560];return _0x24c8f7;};'use strict';var _=require(_0x22d1('0x0'));var util=require(_0x22d1('0x1'));var logger=require('../../config/logger')(_0x22d1('0x2'));var moment=require('moment');var BPromise=require(_0x22d1('0x3'));var rp=require(_0x22d1('0x4'));var fs=require('fs');var path=require(_0x22d1('0x5'));var rimraf=require('rimraf');var config=require(_0x22d1('0x6'));var attributes=require(_0x22d1('0x7'));module[_0x22d1('0x8')]=function(_0x4398d5,_0x592039){return _0x4398d5['define'](_0x22d1('0x9'),attributes,{'tableName':_0x22d1('0xa'),'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 70ef14c..019ec4c 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 _0x0daa=['../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x0daa,0xe9));var _0xa0da=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0daa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa0da('0x0'));var util=require(_0xa0da('0x1'));var moment=require(_0xa0da('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0da('0x3'));var fs=require('fs');var Redis=require(_0xa0da('0x4'));var db=require(_0xa0da('0x5'))['db'];var utils=require(_0xa0da('0x6'));var logger=require(_0xa0da('0x7'))(_0xa0da('0x8'));var config=require(_0xa0da('0x9'));var jayson=require(_0xa0da('0xa'));var client=jayson[_0xa0da('0xb')][_0xa0da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b56f2,_0x13706c,_0x7a82db){return new BPromise(function(_0x407a39,_0xcab8e5){return client[_0xa0da('0xd')](_0x5b56f2,_0x7a82db)['then'](function(_0x1f001c){logger[_0xa0da('0xe')](_0xa0da('0xf'),_0x13706c,_0xa0da('0x10'));logger[_0xa0da('0x11')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x13706c,_0xa0da('0x10'),JSON[_0xa0da('0x12')](_0x1f001c));if(_0x1f001c[_0xa0da('0x13')]){if(_0x1f001c[_0xa0da('0x13')]['code']===0x1f4){logger['error'](_0xa0da('0xf'),_0x13706c,_0x1f001c[_0xa0da('0x13')][_0xa0da('0x14')]);return _0xcab8e5(_0x1f001c[_0xa0da('0x13')][_0xa0da('0x14')]);}logger[_0xa0da('0x13')](_0xa0da('0xf'),_0x13706c,_0x1f001c[_0xa0da('0x13')][_0xa0da('0x14')]);return _0x407a39(_0x1f001c[_0xa0da('0x13')]['message']);}else{logger[_0xa0da('0xe')](_0xa0da('0xf'),_0x13706c,'request\x20sent');_0x407a39(_0x1f001c[_0xa0da('0x15')][_0xa0da('0x14')]);}})['catch'](function(_0x5b37db){logger[_0xa0da('0x13')](_0xa0da('0xf'),_0x13706c,_0x5b37db);_0xcab8e5(_0x5b37db);});});} \ No newline at end of file +var _0x8ed7=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','util'];(function(_0x1c80c7,_0x44e116){var _0x30dc6c=function(_0x31bca3){while(--_0x31bca3){_0x1c80c7['push'](_0x1c80c7['shift']());}};_0x30dc6c(++_0x44e116);}(_0x8ed7,0x96));var _0x78ed=function(_0x4f945b,_0x10096c){_0x4f945b=_0x4f945b-0x0;var _0x40fd08=_0x8ed7[_0x4f945b];return _0x40fd08;};'use strict';var _=require(_0x78ed('0x0'));var util=require(_0x78ed('0x1'));var moment=require(_0x78ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x78ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78ed('0x5'));var config=require(_0x78ed('0x6'));var jayson=require(_0x78ed('0x7'));var client=jayson['client'][_0x78ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51792f,_0x54f4ac,_0x2c57db){return new BPromise(function(_0x8249ac,_0x4bdad3){return client[_0x78ed('0x9')](_0x51792f,_0x2c57db)[_0x78ed('0xa')](function(_0x47b95e){logger['info'](_0x78ed('0xb'),_0x54f4ac,_0x78ed('0xc'));logger[_0x78ed('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x54f4ac,_0x78ed('0xc'),JSON['stringify'](_0x47b95e));if(_0x47b95e[_0x78ed('0xe')]){if(_0x47b95e[_0x78ed('0xe')]['code']===0x1f4){logger['error'](_0x78ed('0xb'),_0x54f4ac,_0x47b95e[_0x78ed('0xe')][_0x78ed('0xf')]);return _0x4bdad3(_0x47b95e['error'][_0x78ed('0xf')]);}logger[_0x78ed('0xe')](_0x78ed('0xb'),_0x54f4ac,_0x47b95e[_0x78ed('0xe')]['message']);return _0x8249ac(_0x47b95e[_0x78ed('0xe')]['message']);}else{logger[_0x78ed('0x10')](_0x78ed('0xb'),_0x54f4ac,_0x78ed('0xc'));_0x8249ac(_0x47b95e[_0x78ed('0x11')]['message']);}})[_0x78ed('0x12')](function(_0x4941f0){logger[_0x78ed('0xe')](_0x78ed('0xb'),_0x54f4ac,_0x4941f0);_0x4bdad3(_0x4941f0);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 1a34ba4..191dc06 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 _0x1e99=['express','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','get','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1d6a4b,_0x573df9){var _0x1778a8=function(_0x313e46){while(--_0x313e46){_0x1d6a4b['push'](_0x1d6a4b['shift']());}};_0x1778a8(++_0x573df9);}(_0x1e99,0xfd));var _0x91e9=function(_0x28bed3,_0x120696){_0x28bed3=_0x28bed3-0x0;var _0x2c8f67=_0x1e99[_0x28bed3];return _0x2c8f67;};'use strict';var multer=require(_0x91e9('0x0'));var util=require(_0x91e9('0x1'));var path=require('path');var timeout=require(_0x91e9('0x2'));var express=require(_0x91e9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x91e9('0x4'));var interaction=require(_0x91e9('0x5'));var config=require('../../config/environment');var controller=require(_0x91e9('0x6'));router['get']('/',auth[_0x91e9('0x7')](),controller['index']);router[_0x91e9('0x8')]('/:id',auth[_0x91e9('0x7')](),controller['show']);router[_0x91e9('0x9')]('/',auth[_0x91e9('0x7')](),controller[_0x91e9('0xa')]);router[_0x91e9('0xb')](_0x91e9('0xc'),auth[_0x91e9('0x7')](),controller[_0x91e9('0xd')]);router[_0x91e9('0xe')](_0x91e9('0xc'),auth['isAuthenticated'](),controller[_0x91e9('0xf')]);module['exports']=router; \ No newline at end of file +var _0xfcfc=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xfcfc,0x12e));var _0xcfcf=function(_0x4da522,_0x1672df){_0x4da522=_0x4da522-0x0;var _0x5e57f6=_0xfcfc[_0x4da522];return _0x5e57f6;};'use strict';var multer=require(_0xcfcf('0x0'));var util=require('util');var path=require(_0xcfcf('0x1'));var timeout=require(_0xcfcf('0x2'));var express=require('express');var router=express[_0xcfcf('0x3')]();var fs_extra=require(_0xcfcf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcfcf('0x5'));var config=require(_0xcfcf('0x6'));var controller=require(_0xcfcf('0x7'));router[_0xcfcf('0x8')]('/',auth[_0xcfcf('0x9')](),controller[_0xcfcf('0xa')]);router[_0xcfcf('0x8')](_0xcfcf('0xb'),auth[_0xcfcf('0x9')](),controller[_0xcfcf('0xc')]);router[_0xcfcf('0xd')]('/',auth[_0xcfcf('0x9')](),controller[_0xcfcf('0xe')]);router['put'](_0xcfcf('0xb'),auth[_0xcfcf('0x9')](),controller[_0xcfcf('0xf')]);router[_0xcfcf('0x10')](_0xcfcf('0xb'),auth[_0xcfcf('0x9')](),controller[_0xcfcf('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 5e905c9..135b51a 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 _0x5669=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x5669,0x186));var _0x9566=function(_0x2d8a23,_0x522080){_0x2d8a23=_0x2d8a23-0x0;var _0xd7bce1=_0x5669[_0x2d8a23];return _0xd7bce1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9566('0x0')](_0x9566('0x1'),_0x9566('0x2'),_0x9566('0x3'),_0x9566('0x4'),_0x9566('0x5')),'defaultValue':_0x9566('0x1')},'content':{'type':Sequelize[_0x9566('0x6')]},'key':{'type':Sequelize[_0x9566('0x6')]},'keyType':{'type':Sequelize[_0x9566('0x0')](_0x9566('0x1'),_0x9566('0x2'),_0x9566('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9566('0x6')]},'customField':{'type':Sequelize[_0x9566('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9566('0x6')]}}; \ No newline at end of file +var _0x0161=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x0161,0xa7));var _0x1016=function(_0x5f5dd7,_0xd6f855){_0x5f5dd7=_0x5f5dd7-0x0;var _0x40e791=_0x0161[_0x5f5dd7];return _0x40e791;};'use strict';var Sequelize=require(_0x1016('0x0'));module[_0x1016('0x1')]={'type':{'type':Sequelize[_0x1016('0x2')](_0x1016('0x3'),_0x1016('0x4'),_0x1016('0x5'),_0x1016('0x6'),_0x1016('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1016('0x8')]},'key':{'type':Sequelize[_0x1016('0x8')]},'keyType':{'type':Sequelize[_0x1016('0x2')](_0x1016('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x1016('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1016('0x8')]},'customField':{'type':Sequelize[_0x1016('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1016('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index fc4fb32..1600aae 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 _0x2414=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','options','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x2fec7f,_0x4c8a85){var _0x489a95=function(_0x2b3afe){while(--_0x2b3afe){_0x2fec7f['push'](_0x2fec7f['shift']());}};_0x489a95(++_0x4c8a85);}(_0x2414,0x1b5));var _0x4241=function(_0x714d5c,_0x1c2f50){_0x714d5c=_0x714d5c-0x0;var _0x1a26f9=_0x2414[_0x714d5c];return _0x1a26f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4241('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4241('0x1'));var rp=require(_0x4241('0x2'));var moment=require(_0x4241('0x3'));var BPromise=require(_0x4241('0x4'));var Mustache=require('mustache');var util=require(_0x4241('0x5'));var path=require(_0x4241('0x6'));var sox=require(_0x4241('0x7'));var csv=require(_0x4241('0x8'));var ejs=require(_0x4241('0x9'));var fs=require('fs');var fs_extra=require(_0x4241('0xa'));var _=require(_0x4241('0xb'));var squel=require(_0x4241('0xc'));var crypto=require('crypto');var jsforce=require(_0x4241('0xd'));var deskjs=require(_0x4241('0xe'));var toCsv=require(_0x4241('0x8'));var querystring=require(_0x4241('0xf'));var Papa=require(_0x4241('0x10'));var Redis=require('ioredis');var authService=require(_0x4241('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4241('0x12'))(_0x4241('0x13'));var utils=require(_0x4241('0x14'));var config=require(_0x4241('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4241('0x16'))['db'];function respondWithStatusCode(_0x5f1c07,_0x3d1717){_0x3d1717=_0x3d1717||0xcc;return function(_0x4e760d){if(_0x4e760d){return _0x5f1c07[_0x4241('0x17')](_0x3d1717);}return _0x5f1c07['status'](_0x3d1717)['end']();};}function respondWithResult(_0x2e54f6,_0x153533){_0x153533=_0x153533||0xc8;return function(_0x56f538){if(_0x56f538){return _0x2e54f6[_0x4241('0x18')](_0x153533)[_0x4241('0x19')](_0x56f538);}};}function respondWithFilteredResult(_0x31608f,_0x360404){return function(_0x41d9de){if(_0x41d9de){var _0x4ac6c6=typeof _0x360404['offset']===_0x4241('0x1a')&&typeof _0x360404[_0x4241('0x1b')]===_0x4241('0x1a');var _0x4aeb55=_0x41d9de[_0x4241('0x1c')];var _0x5d0159=_0x4ac6c6?0x0:_0x360404[_0x4241('0x1d')];var _0x2220dc=_0x4ac6c6?_0x41d9de[_0x4241('0x1c')]:_0x360404[_0x4241('0x1d')]+_0x360404[_0x4241('0x1b')];var _0x573ad8;if(_0x2220dc>=_0x4aeb55){_0x2220dc=_0x4aeb55;_0x573ad8=0xc8;}else{_0x573ad8=0xce;}_0x31608f['status'](_0x573ad8);return _0x31608f['set'](_0x4241('0x1e'),_0x5d0159+'-'+_0x2220dc+'/'+_0x4aeb55)[_0x4241('0x19')](_0x41d9de);}return null;};}function patchUpdates(_0x221439){return function(_0x35a159){try{jsonpatch[_0x4241('0x1f')](_0x35a159,_0x221439,!![]);}catch(_0x160b7c){return BPromise[_0x4241('0x20')](_0x160b7c);}return _0x35a159['save']();};}function saveUpdates(_0x35b403,_0x410c41){return function(_0x1cb93c){if(_0x1cb93c){return _0x1cb93c[_0x4241('0x21')](_0x35b403)[_0x4241('0x22')](function(_0x1daa60){return _0x1daa60;});}return null;};}function removeEntity(_0x31da2b,_0x481920){return function(_0x1c1760){if(_0x1c1760){return _0x1c1760[_0x4241('0x23')]()[_0x4241('0x22')](function(){_0x31da2b['status'](0xcc)[_0x4241('0x24')]();});}};}function handleEntityNotFound(_0x23e6fc,_0x3a63d7){return function(_0x303367){if(!_0x303367){_0x23e6fc['sendStatus'](0x194);}return _0x303367;};}function handleError(_0x1b61fd,_0x40104f){_0x40104f=_0x40104f||0x1f4;return function(_0x16e0bb){logger[_0x4241('0x25')](_0x16e0bb[_0x4241('0x26')]);if(_0x16e0bb[_0x4241('0x27')]){delete _0x16e0bb['name'];}_0x1b61fd[_0x4241('0x18')](_0x40104f)[_0x4241('0x28')](_0x16e0bb);};}exports[_0x4241('0x29')]=function(_0x50ab6a,_0x3b6404){var _0x26cace={},_0x1e773c={},_0x9c077f={'count':0x0,'rows':[]};var _0x1c884e=_[_0x4241('0x2a')](db[_0x4241('0x2b')]['rawAttributes'],function(_0x48f24d){return{'name':_0x48f24d[_0x4241('0x2c')],'type':_0x48f24d[_0x4241('0x2d')][_0x4241('0x2e')]};});_0x1e773c[_0x4241('0x2f')]=_['map'](_0x1c884e,'name');_0x1e773c[_0x4241('0x30')]=_[_0x4241('0x31')](_0x50ab6a[_0x4241('0x30')]);_0x1e773c[_0x4241('0x32')]=_[_0x4241('0x33')](_0x1e773c[_0x4241('0x2f')],_0x1e773c['query']);_0x26cace['attributes']=_['intersection'](_0x1e773c[_0x4241('0x2f')],qs[_0x4241('0x34')](_0x50ab6a[_0x4241('0x30')]['fields']));_0x26cace[_0x4241('0x35')]=_0x26cace['attributes'][_0x4241('0x36')]?_0x26cace[_0x4241('0x35')]:_0x1e773c[_0x4241('0x2f')];if(!_0x50ab6a[_0x4241('0x30')][_0x4241('0x37')]('nolimit')){_0x26cace['limit']=qs[_0x4241('0x1b')](_0x50ab6a[_0x4241('0x30')][_0x4241('0x1b')]);_0x26cace[_0x4241('0x1d')]=qs[_0x4241('0x1d')](_0x50ab6a['query'][_0x4241('0x1d')]);}_0x26cace[_0x4241('0x38')]=qs[_0x4241('0x39')](_0x50ab6a[_0x4241('0x30')]['sort']);_0x26cace['where']=qs[_0x4241('0x32')](_[_0x4241('0x3a')](_0x50ab6a[_0x4241('0x30')],_0x1e773c[_0x4241('0x32')]),_0x1c884e);if(_0x50ab6a[_0x4241('0x30')]['filter']){_0x26cace[_0x4241('0x3b')]=_[_0x4241('0x3c')](_0x26cace[_0x4241('0x3b')],{'$or':_['map'](_0x1c884e,function(_0x1fc1d2){if(_0x1fc1d2['type']!==_0x4241('0x3d')){var _0x52c8c5={};_0x52c8c5[_0x1fc1d2[_0x4241('0x27')]]={'$like':'%'+_0x50ab6a['query'][_0x4241('0x3e')]+'%'};return _0x52c8c5;}})});}_0x26cace=_[_0x4241('0x3c')]({},_0x26cace,_0x50ab6a['options']);var _0x4eb7a3={'where':_0x26cace[_0x4241('0x3b')]};return db[_0x4241('0x2b')]['count'](_0x4eb7a3)[_0x4241('0x22')](function(_0x25bb88){_0x9c077f['count']=_0x25bb88;if(_0x50ab6a[_0x4241('0x30')][_0x4241('0x3f')]){_0x26cace[_0x4241('0x40')]=[{'all':!![]}];}return db[_0x4241('0x2b')]['findAll'](_0x26cace);})[_0x4241('0x22')](function(_0x1f4a08){_0x9c077f[_0x4241('0x41')]=_0x1f4a08;return _0x9c077f;})['then'](respondWithFilteredResult(_0x3b6404,_0x26cace))[_0x4241('0x42')](handleError(_0x3b6404,null));};exports[_0x4241('0x43')]=function(_0x4db60a,_0x1f7e9b){var _0x3c23d8={'raw':!![],'where':{'id':_0x4db60a['params']['id']}},_0x4dece2={};_0x4dece2['model']=_[_0x4241('0x31')](db[_0x4241('0x2b')][_0x4241('0x44')]);_0x4dece2[_0x4241('0x30')]=_[_0x4241('0x31')](_0x4db60a[_0x4241('0x30')]);_0x4dece2[_0x4241('0x32')]=_[_0x4241('0x33')](_0x4dece2[_0x4241('0x2f')],_0x4dece2[_0x4241('0x30')]);_0x3c23d8[_0x4241('0x35')]=_[_0x4241('0x33')](_0x4dece2[_0x4241('0x2f')],qs[_0x4241('0x34')](_0x4db60a[_0x4241('0x30')][_0x4241('0x34')]));_0x3c23d8[_0x4241('0x35')]=_0x3c23d8[_0x4241('0x35')][_0x4241('0x36')]?_0x3c23d8['attributes']:_0x4dece2[_0x4241('0x2f')];if(_0x4db60a['query'][_0x4241('0x3f')]){_0x3c23d8['include']=[{'all':!![]}];}_0x3c23d8=_['merge']({},_0x3c23d8,_0x4db60a[_0x4241('0x45')]);return db['VtigerField'][_0x4241('0x46')](_0x3c23d8)[_0x4241('0x22')](handleEntityNotFound(_0x1f7e9b,null))[_0x4241('0x22')](respondWithResult(_0x1f7e9b,null))[_0x4241('0x42')](handleError(_0x1f7e9b,null));};exports['create']=function(_0x5828ea,_0x3411bf){return db[_0x4241('0x2b')][_0x4241('0x47')](_0x5828ea['body'],{})['then'](respondWithResult(_0x3411bf,0xc9))['catch'](handleError(_0x3411bf,null));};exports[_0x4241('0x21')]=function(_0x369591,_0x181716){if(_0x369591[_0x4241('0x48')]['id']){delete _0x369591[_0x4241('0x48')]['id'];}return db['VtigerField'][_0x4241('0x46')]({'where':{'id':_0x369591[_0x4241('0x49')]['id']}})[_0x4241('0x22')](handleEntityNotFound(_0x181716,null))[_0x4241('0x22')](saveUpdates(_0x369591['body'],null))[_0x4241('0x22')](respondWithResult(_0x181716,null))[_0x4241('0x42')](handleError(_0x181716,null));};exports[_0x4241('0x23')]=function(_0x59c48e,_0x2b1e30){return db[_0x4241('0x2b')]['find']({'where':{'id':_0x59c48e[_0x4241('0x49')]['id']}})[_0x4241('0x22')](handleEntityNotFound(_0x2b1e30,null))[_0x4241('0x22')](removeEntity(_0x2b1e30,null))[_0x4241('0x42')](handleError(_0x2b1e30,null));}; \ No newline at end of file +var _0x4312=['status','end','json','offset','limit','undefined','count','set','Content-Range','reject','destroy','then','error','name','send','map','VtigerField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x4312,0x74));var _0x2431=function(_0x314ea9,_0x3c6626){_0x314ea9=_0x314ea9-0x0;var _0xa52b7b=_0x4312[_0x314ea9];return _0xa52b7b;};'use strict';var emlformat=require(_0x2431('0x0'));var rimraf=require(_0x2431('0x1'));var zipdir=require(_0x2431('0x2'));var jsonpatch=require(_0x2431('0x3'));var rp=require('request-promise');var moment=require(_0x2431('0x4'));var BPromise=require(_0x2431('0x5'));var Mustache=require('mustache');var util=require(_0x2431('0x6'));var path=require(_0x2431('0x7'));var sox=require(_0x2431('0x8'));var csv=require(_0x2431('0x9'));var ejs=require(_0x2431('0xa'));var fs=require('fs');var fs_extra=require(_0x2431('0xb'));var _=require(_0x2431('0xc'));var squel=require(_0x2431('0xd'));var crypto=require('crypto');var jsforce=require(_0x2431('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2431('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2431('0xf'));var authService=require(_0x2431('0x10'));var qs=require(_0x2431('0x11'));var as=require(_0x2431('0x12'));var hardwareService=require(_0x2431('0x13'));var logger=require(_0x2431('0x14'))(_0x2431('0x15'));var utils=require('../../config/utils');var config=require(_0x2431('0x16'));var licenseUtil=require(_0x2431('0x17'));var db=require(_0x2431('0x18'))['db'];function respondWithStatusCode(_0x445e02,_0x35bba2){_0x35bba2=_0x35bba2||0xcc;return function(_0x53f6ba){if(_0x53f6ba){return _0x445e02[_0x2431('0x19')](_0x35bba2);}return _0x445e02[_0x2431('0x1a')](_0x35bba2)[_0x2431('0x1b')]();};}function respondWithResult(_0x39ed06,_0x15eaf4){_0x15eaf4=_0x15eaf4||0xc8;return function(_0x110578){if(_0x110578){return _0x39ed06[_0x2431('0x1a')](_0x15eaf4)[_0x2431('0x1c')](_0x110578);}};}function respondWithFilteredResult(_0x5aa2d7,_0x541227){return function(_0x90978d){if(_0x90978d){var _0x107106=typeof _0x541227[_0x2431('0x1d')]==='undefined'&&typeof _0x541227[_0x2431('0x1e')]===_0x2431('0x1f');var _0x3a233b=_0x90978d[_0x2431('0x20')];var _0x45946c=_0x107106?0x0:_0x541227[_0x2431('0x1d')];var _0x4a6433=_0x107106?_0x90978d[_0x2431('0x20')]:_0x541227['offset']+_0x541227['limit'];var _0x4f27d3;if(_0x4a6433>=_0x3a233b){_0x4a6433=_0x3a233b;_0x4f27d3=0xc8;}else{_0x4f27d3=0xce;}_0x5aa2d7['status'](_0x4f27d3);return _0x5aa2d7[_0x2431('0x21')](_0x2431('0x22'),_0x45946c+'-'+_0x4a6433+'/'+_0x3a233b)[_0x2431('0x1c')](_0x90978d);}return null;};}function patchUpdates(_0x4afc59){return function(_0x1de6cc){try{jsonpatch['apply'](_0x1de6cc,_0x4afc59,!![]);}catch(_0x59bc3c){return BPromise[_0x2431('0x23')](_0x59bc3c);}return _0x1de6cc['save']();};}function saveUpdates(_0x59a51b,_0x2e9b77){return function(_0x21f1c4){if(_0x21f1c4){return _0x21f1c4['update'](_0x59a51b)['then'](function(_0x2ddd8f){return _0x2ddd8f;});}return null;};}function removeEntity(_0xe24f3e,_0xd2e4eb){return function(_0x55505b){if(_0x55505b){return _0x55505b[_0x2431('0x24')]()[_0x2431('0x25')](function(){_0xe24f3e[_0x2431('0x1a')](0xcc)[_0x2431('0x1b')]();});}};}function handleEntityNotFound(_0x770a52,_0x2d4a5e){return function(_0x4e0253){if(!_0x4e0253){_0x770a52[_0x2431('0x19')](0x194);}return _0x4e0253;};}function handleError(_0x566f5a,_0x26fd1e){_0x26fd1e=_0x26fd1e||0x1f4;return function(_0x9dc228){logger[_0x2431('0x26')](_0x9dc228['stack']);if(_0x9dc228['name']){delete _0x9dc228[_0x2431('0x27')];}_0x566f5a['status'](_0x26fd1e)[_0x2431('0x28')](_0x9dc228);};}exports['index']=function(_0x9fc748,_0x2b94fa){var _0x1d1ea1={},_0x670996={},_0x3fa03a={'count':0x0,'rows':[]};var _0x15d5a8=_[_0x2431('0x29')](db[_0x2431('0x2a')][_0x2431('0x2b')],function(_0x3fc5ba){return{'name':_0x3fc5ba['fieldName'],'type':_0x3fc5ba[_0x2431('0x2c')][_0x2431('0x2d')]};});_0x670996[_0x2431('0x2e')]=_[_0x2431('0x29')](_0x15d5a8,_0x2431('0x27'));_0x670996[_0x2431('0x2f')]=_[_0x2431('0x30')](_0x9fc748[_0x2431('0x2f')]);_0x670996[_0x2431('0x31')]=_[_0x2431('0x32')](_0x670996['model'],_0x670996[_0x2431('0x2f')]);_0x1d1ea1['attributes']=_[_0x2431('0x32')](_0x670996[_0x2431('0x2e')],qs[_0x2431('0x33')](_0x9fc748[_0x2431('0x2f')]['fields']));_0x1d1ea1[_0x2431('0x34')]=_0x1d1ea1[_0x2431('0x34')][_0x2431('0x35')]?_0x1d1ea1[_0x2431('0x34')]:_0x670996['model'];if(!_0x9fc748[_0x2431('0x2f')]['hasOwnProperty'](_0x2431('0x36'))){_0x1d1ea1[_0x2431('0x1e')]=qs[_0x2431('0x1e')](_0x9fc748[_0x2431('0x2f')][_0x2431('0x1e')]);_0x1d1ea1[_0x2431('0x1d')]=qs[_0x2431('0x1d')](_0x9fc748[_0x2431('0x2f')][_0x2431('0x1d')]);}_0x1d1ea1['order']=qs[_0x2431('0x37')](_0x9fc748[_0x2431('0x2f')][_0x2431('0x37')]);_0x1d1ea1[_0x2431('0x38')]=qs[_0x2431('0x31')](_[_0x2431('0x39')](_0x9fc748[_0x2431('0x2f')],_0x670996['filters']),_0x15d5a8);if(_0x9fc748[_0x2431('0x2f')][_0x2431('0x3a')]){_0x1d1ea1[_0x2431('0x38')]=_[_0x2431('0x3b')](_0x1d1ea1[_0x2431('0x38')],{'$or':_['map'](_0x15d5a8,function(_0x1783d9){if(_0x1783d9['type']!=='VIRTUAL'){var _0x56f900={};_0x56f900[_0x1783d9['name']]={'$like':'%'+_0x9fc748[_0x2431('0x2f')][_0x2431('0x3a')]+'%'};return _0x56f900;}})});}_0x1d1ea1=_[_0x2431('0x3b')]({},_0x1d1ea1,_0x9fc748[_0x2431('0x3c')]);var _0x38ab8a={'where':_0x1d1ea1['where']};return db['VtigerField']['count'](_0x38ab8a)[_0x2431('0x25')](function(_0x3e6617){_0x3fa03a[_0x2431('0x20')]=_0x3e6617;if(_0x9fc748['query'][_0x2431('0x3d')]){_0x1d1ea1[_0x2431('0x3e')]=[{'all':!![]}];}return db[_0x2431('0x2a')][_0x2431('0x3f')](_0x1d1ea1);})[_0x2431('0x25')](function(_0x59da0d){_0x3fa03a[_0x2431('0x40')]=_0x59da0d;return _0x3fa03a;})['then'](respondWithFilteredResult(_0x2b94fa,_0x1d1ea1))[_0x2431('0x41')](handleError(_0x2b94fa,null));};exports[_0x2431('0x42')]=function(_0x3289f0,_0x2cb287){var _0x5698f2={'raw':!![],'where':{'id':_0x3289f0[_0x2431('0x43')]['id']}},_0x3ff258={};_0x3ff258[_0x2431('0x2e')]=_[_0x2431('0x30')](db[_0x2431('0x2a')]['rawAttributes']);_0x3ff258[_0x2431('0x2f')]=_[_0x2431('0x30')](_0x3289f0[_0x2431('0x2f')]);_0x3ff258[_0x2431('0x31')]=_[_0x2431('0x32')](_0x3ff258[_0x2431('0x2e')],_0x3ff258[_0x2431('0x2f')]);_0x5698f2[_0x2431('0x34')]=_['intersection'](_0x3ff258[_0x2431('0x2e')],qs[_0x2431('0x33')](_0x3289f0[_0x2431('0x2f')][_0x2431('0x33')]));_0x5698f2[_0x2431('0x34')]=_0x5698f2[_0x2431('0x34')]['length']?_0x5698f2[_0x2431('0x34')]:_0x3ff258[_0x2431('0x2e')];if(_0x3289f0[_0x2431('0x2f')][_0x2431('0x3d')]){_0x5698f2[_0x2431('0x3e')]=[{'all':!![]}];}_0x5698f2=_[_0x2431('0x3b')]({},_0x5698f2,_0x3289f0[_0x2431('0x3c')]);return db['VtigerField'][_0x2431('0x44')](_0x5698f2)['then'](handleEntityNotFound(_0x2cb287,null))['then'](respondWithResult(_0x2cb287,null))[_0x2431('0x41')](handleError(_0x2cb287,null));};exports[_0x2431('0x45')]=function(_0x1fd53a,_0x7c6237){return db['VtigerField'][_0x2431('0x45')](_0x1fd53a[_0x2431('0x46')],{})[_0x2431('0x25')](respondWithResult(_0x7c6237,0xc9))[_0x2431('0x41')](handleError(_0x7c6237,null));};exports['update']=function(_0x5d6362,_0x482048){if(_0x5d6362[_0x2431('0x46')]['id']){delete _0x5d6362[_0x2431('0x46')]['id'];}return db[_0x2431('0x2a')][_0x2431('0x44')]({'where':{'id':_0x5d6362['params']['id']}})[_0x2431('0x25')](handleEntityNotFound(_0x482048,null))[_0x2431('0x25')](saveUpdates(_0x5d6362['body'],null))[_0x2431('0x25')](respondWithResult(_0x482048,null))['catch'](handleError(_0x482048,null));};exports[_0x2431('0x24')]=function(_0x34a23e,_0x1c9cfa){return db[_0x2431('0x2a')]['find']({'where':{'id':_0x34a23e['params']['id']}})[_0x2431('0x25')](handleEntityNotFound(_0x1c9cfa,null))[_0x2431('0x25')](removeEntity(_0x1c9cfa,null))[_0x2431('0x41')](handleError(_0x1c9cfa,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a5b17d8..76c6a19 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 _0x0b9f=['lodash','util','api','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b9f,0xb6));var _0xf0b9=function(_0x4c4c9f,_0x3f5603){_0x4c4c9f=_0x4c4c9f-0x0;var _0x578758=_0x0b9f[_0x4c4c9f];return _0x578758;};'use strict';var _=require(_0xf0b9('0x0'));var util=require(_0xf0b9('0x1'));var logger=require('../../config/logger')(_0xf0b9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0b9('0x3'));var rimraf=require(_0xf0b9('0x4'));var config=require(_0xf0b9('0x5'));var attributes=require(_0xf0b9('0x6'));module[_0xf0b9('0x7')]=function(_0x13f603,_0x2398f7){return _0x13f603[_0xf0b9('0x8')](_0xf0b9('0x9'),attributes,{'tableName':_0xf0b9('0xa'),'paranoid':![],'indexes':[{'name':_0xf0b9('0xb'),'fields':[_0xf0b9('0xc'),_0xf0b9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe844=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0xde3020,_0x38ebb8){var _0x2cb1d6=function(_0x2f98d2){while(--_0x2f98d2){_0xde3020['push'](_0xde3020['shift']());}};_0x2cb1d6(++_0x38ebb8);}(_0xe844,0x1a2));var _0x4e84=function(_0x5e8936,_0x42b6a8){_0x5e8936=_0x5e8936-0x0;var _0x413a48=_0xe844[_0x5e8936];return _0x413a48;};'use strict';var _=require(_0x4e84('0x0'));var util=require(_0x4e84('0x1'));var logger=require(_0x4e84('0x2'))(_0x4e84('0x3'));var moment=require('moment');var BPromise=require(_0x4e84('0x4'));var rp=require(_0x4e84('0x5'));var fs=require('fs');var path=require(_0x4e84('0x6'));var rimraf=require('rimraf');var config=require(_0x4e84('0x7'));var attributes=require(_0x4e84('0x8'));module['exports']=function(_0x57c664,_0x3bc752){return _0x57c664[_0x4e84('0x9')](_0x4e84('0xa'),attributes,{'tableName':_0x4e84('0xb'),'paranoid':![],'indexes':[{'name':_0x4e84('0xc'),'fields':[_0x4e84('0xd'),_0x4e84('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index e35f703..37134a8 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 _0x01dc=['http','then','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../config/environment','jayson/promise'];(function(_0x362ee2,_0x106f5c){var _0x371ad7=function(_0x6b20eb){while(--_0x6b20eb){_0x362ee2['push'](_0x362ee2['shift']());}};_0x371ad7(++_0x106f5c);}(_0x01dc,0xf7));var _0xc01d=function(_0x1c8a44,_0x1206ab){_0x1c8a44=_0x1c8a44-0x0;var _0x2658bd=_0x01dc[_0x1c8a44];return _0x2658bd;};'use strict';var _=require(_0xc01d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc01d('0x1'));var rs=require(_0xc01d('0x2'));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(_0xc01d('0x3'));var jayson=require(_0xc01d('0x4'));var client=jayson['client'][_0xc01d('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x239c37,_0x51e57b,_0x1c04ba){return new BPromise(function(_0x142c58,_0x41b4f8){return client['request'](_0x239c37,_0x1c04ba)[_0xc01d('0x6')](function(_0x125919){logger['info']('VtigerField,\x20%s,\x20%s',_0x51e57b,_0xc01d('0x7'));logger['debug'](_0xc01d('0x8'),_0x51e57b,'request\x20sent',JSON['stringify'](_0x125919));if(_0x125919[_0xc01d('0x9')]){if(_0x125919['error']['code']===0x1f4){logger[_0xc01d('0x9')](_0xc01d('0xa'),_0x51e57b,_0x125919['error'][_0xc01d('0xb')]);return _0x41b4f8(_0x125919[_0xc01d('0x9')]['message']);}logger['error']('VtigerField,\x20%s,\x20%s',_0x51e57b,_0x125919[_0xc01d('0x9')][_0xc01d('0xb')]);return _0x142c58(_0x125919[_0xc01d('0x9')][_0xc01d('0xb')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x51e57b,'request\x20sent');_0x142c58(_0x125919[_0xc01d('0xc')][_0xc01d('0xb')]);}})[_0xc01d('0xd')](function(_0x5b6620){logger['error'](_0xc01d('0xa'),_0x51e57b,_0x5b6620);_0x41b4f8(_0x5b6620);});});} \ No newline at end of file +var _0x4524=['request\x20sent','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x3284cd,_0x2e10a2){var _0xe92280=function(_0x398d2e){while(--_0x398d2e){_0x3284cd['push'](_0x3284cd['shift']());}};_0xe92280(++_0x2e10a2);}(_0x4524,0xd7));var _0x4452=function(_0x5692af,_0x277998){_0x5692af=_0x5692af-0x0;var _0x1dd8c6=_0x4524[_0x5692af];return _0x1dd8c6;};'use strict';var _=require(_0x4452('0x0'));var util=require('util');var moment=require(_0x4452('0x1'));var BPromise=require('bluebird');var rs=require(_0x4452('0x2'));var fs=require('fs');var Redis=require(_0x4452('0x3'));var db=require(_0x4452('0x4'))['db'];var utils=require(_0x4452('0x5'));var logger=require(_0x4452('0x6'))('rpc');var config=require(_0x4452('0x7'));var jayson=require(_0x4452('0x8'));var client=jayson['client'][_0x4452('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32d8ac,_0x9ecce5,_0x287113){return new BPromise(function(_0x50a2e0,_0x5b0c60){return client[_0x4452('0xa')](_0x32d8ac,_0x287113)[_0x4452('0xb')](function(_0x582e37){logger[_0x4452('0xc')](_0x4452('0xd'),_0x9ecce5,'request\x20sent');logger[_0x4452('0xe')](_0x4452('0xf'),_0x9ecce5,_0x4452('0x10'),JSON[_0x4452('0x11')](_0x582e37));if(_0x582e37[_0x4452('0x12')]){if(_0x582e37[_0x4452('0x12')]['code']===0x1f4){logger[_0x4452('0x12')](_0x4452('0xd'),_0x9ecce5,_0x582e37[_0x4452('0x12')][_0x4452('0x13')]);return _0x5b0c60(_0x582e37[_0x4452('0x12')][_0x4452('0x13')]);}logger['error'](_0x4452('0xd'),_0x9ecce5,_0x582e37[_0x4452('0x12')][_0x4452('0x13')]);return _0x50a2e0(_0x582e37[_0x4452('0x12')][_0x4452('0x13')]);}else{logger[_0x4452('0xc')](_0x4452('0xd'),_0x9ecce5,_0x4452('0x10'));_0x50a2e0(_0x582e37['result'][_0x4452('0x13')]);}})[_0x4452('0x14')](function(_0x53a249){logger[_0x4452('0x12')](_0x4452('0xd'),_0x9ecce5,_0x53a249);_0x5b0c60(_0x53a249);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 426f7ca..c7511de 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 _0x2738=['get','isAuthenticated','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x1cb5dc,_0x517ece){var _0x42d964=function(_0x43fca3){while(--_0x43fca3){_0x1cb5dc['push'](_0x1cb5dc['shift']());}};_0x42d964(++_0x517ece);}(_0x2738,0x1db));var _0x8273=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x2738[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x8273('0x0'));var util=require(_0x8273('0x1'));var path=require('path');var timeout=require(_0x8273('0x2'));var express=require('express');var router=express[_0x8273('0x3')]();var fs_extra=require(_0x8273('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8273('0x5'));var config=require(_0x8273('0x6'));var controller=require(_0x8273('0x7'));router[_0x8273('0x8')]('/',auth[_0x8273('0x9')](),controller['index']);router[_0x8273('0x8')](_0x8273('0xa'),auth[_0x8273('0x9')](),controller[_0x8273('0xb')]);router[_0x8273('0x8')]('/:id/configurations',auth[_0x8273('0x9')](),controller[_0x8273('0xc')]);router['get']('/:id/fields',auth[_0x8273('0x9')](),controller[_0x8273('0xd')]);router[_0x8273('0xe')]('/',auth[_0x8273('0x9')](),controller[_0x8273('0xf')]);router[_0x8273('0xe')](_0x8273('0x10'),auth[_0x8273('0x9')](),controller[_0x8273('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8273('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8273('0x13')]);module[_0x8273('0x14')]=router; \ No newline at end of file +var _0xfbd1=['get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','update','destroy','path','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x5e0e02,_0x493112){var _0x2b9353=function(_0x17341c){while(--_0x17341c){_0x5e0e02['push'](_0x5e0e02['shift']());}};_0x2b9353(++_0x493112);}(_0xfbd1,0x1c3));var _0x1fbd=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xfbd1[_0x138f59];return _0x3d114d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1fbd('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1fbd('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1fbd('0x2'));var config=require(_0x1fbd('0x3'));var controller=require(_0x1fbd('0x4'));router[_0x1fbd('0x5')]('/',auth['isAuthenticated'](),controller[_0x1fbd('0x6')]);router[_0x1fbd('0x5')](_0x1fbd('0x7'),auth['isAuthenticated'](),controller[_0x1fbd('0x8')]);router[_0x1fbd('0x5')](_0x1fbd('0x9'),auth['isAuthenticated'](),controller[_0x1fbd('0xa')]);router[_0x1fbd('0x5')](_0x1fbd('0xb'),auth[_0x1fbd('0xc')](),controller[_0x1fbd('0xd')]);router[_0x1fbd('0xe')]('/',auth[_0x1fbd('0xc')](),controller[_0x1fbd('0xf')]);router[_0x1fbd('0xe')](_0x1fbd('0x9'),auth[_0x1fbd('0xc')](),controller[_0x1fbd('0x10')]);router['put'](_0x1fbd('0x7'),auth[_0x1fbd('0xc')](),controller[_0x1fbd('0x11')]);router['delete'](_0x1fbd('0x7'),auth[_0x1fbd('0xc')](),controller[_0x1fbd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b9ef308..42c8b8e 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 _0xd991=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x49d1b9,_0x31f251){var _0x275259=function(_0x3577a8){while(--_0x3577a8){_0x49d1b9['push'](_0x49d1b9['shift']());}};_0x275259(++_0x31f251);}(_0xd991,0x115));var _0x1d99=function(_0x37d5a5,_0x3db8c6){_0x37d5a5=_0x37d5a5-0x0;var _0x3c58b3=_0xd991[_0x37d5a5];return _0x3c58b3;};'use strict';var Sequelize=require(_0x1d99('0x0'));module[_0x1d99('0x1')]={'name':{'type':Sequelize[_0x1d99('0x2')]},'description':{'type':Sequelize[_0x1d99('0x2')]},'username':{'type':Sequelize[_0x1d99('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1d99('0x2')]},'token':{'type':Sequelize[_0x1d99('0x2')]},'remoteUri':{'type':Sequelize[_0x1d99('0x2')],'unique':_0x1d99('0x3')},'authType':{'type':Sequelize[_0x1d99('0x4')](_0x1d99('0x5'),'token'),'defaultValue':_0x1d99('0x5')},'serverUrl':{'type':Sequelize[_0x1d99('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1d99('0x6'),_0x1d99('0x7')),'defaultValue':_0x1d99('0x6')}}; \ No newline at end of file +var _0x6132=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM','password'];(function(_0x5c31ee,_0x2d8e64){var _0x27704c=function(_0x21fb02){while(--_0x21fb02){_0x5c31ee['push'](_0x5c31ee['shift']());}};_0x27704c(++_0x2d8e64);}(_0x6132,0x13a));var _0x2613=function(_0x4cb8b3,_0xc645cb){_0x4cb8b3=_0x4cb8b3-0x0;var _0x1aae2a=_0x6132[_0x4cb8b3];return _0x1aae2a;};'use strict';var Sequelize=require(_0x2613('0x0'));module[_0x2613('0x1')]={'name':{'type':Sequelize[_0x2613('0x2')]},'description':{'type':Sequelize[_0x2613('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2613('0x3')},'password':{'type':Sequelize[_0x2613('0x2')]},'token':{'type':Sequelize[_0x2613('0x2')]},'remoteUri':{'type':Sequelize[_0x2613('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x2613('0x4')]('password','token'),'defaultValue':_0x2613('0x5')},'serverUrl':{'type':Sequelize[_0x2613('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2613('0x4')](_0x2613('0x6'),_0x2613('0x7')),'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 a29639f..a0d1023 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 _0xc788=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys'];(function(_0x213fdc,_0x5228fd){var _0x107e7a=function(_0x5b53da){while(--_0x5b53da){_0x213fdc['push'](_0x213fdc['shift']());}};_0x107e7a(++_0x5228fd);}(_0xc788,0xc4));var _0x8c78=function(_0x271697,_0x6897d6){_0x271697=_0x271697-0x0;var _0x426093=_0xc788[_0x271697];return _0x426093;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['ZendeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['ZendeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['ZendeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58'),_0x8c78('0x59'),'authType',_0x8c78('0x5a')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x5e6a23){if(_0x5e6a23){_0x3c6886=_0x5e6a23[_0x8c78('0x5a')];var _0x4dbb47=_0x3c6886[_0x8c78('0x5b')](-0x1);if(_0x4dbb47==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x5c')](0x0,_0x3c6886[_0x8c78('0x5d')](_0x4dbb47));}var _0x476835={'method':_0x8c78('0x5e'),'uri':util[_0x8c78('0x5f')]('%s/%s',_0x3c6886,'ticket_fields'),'json':!![]};switch(_0x5e6a23[_0x8c78('0x60')]){case _0x8c78('0x58'):_0x476835[_0x8c78('0x61')]={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x63'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x58')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;case _0x8c78('0x59'):_0x476835['headers']={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x66'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x59')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;default:throw new db[(_0x8c78('0x67'))][(_0x8c78('0x68'))](_0x8c78('0x69'));}return rp(_0x476835);}})[_0x8c78('0x25')](function(_0x402cff){if(_0x402cff){var _0x280a8b=[_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x6d')];_[_0x8c78('0x6e')](_0x402cff[_0x8c78('0x6f')],function(_0x4c6cc5){return _0x280a8b[_0x8c78('0x70')](_0x4c6cc5['type']);});return{'count':_0x402cff['ticket_fields'][_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x402cff[_0x8c78('0x6f')],function(_0x3b3c51){return{'id':_0x3b3c51['id'],'name':_0x3b3c51['position']>0x7?_0x3b3c51[_0x8c78('0x71')]:_0x3b3c51[_0x8c78('0x2f')],'custom':_0x3b3c51[_0x8c78('0x72')]>0x7?!![]:![],'options':_0x3b3c51['system_field_options']?_0x3b3c51[_0x8c78('0x73')]:_0x3b3c51[_0x8c78('0x74')]?_0x3b3c51[_0x8c78('0x74')]:[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))['catch'](function(_0xfff9a5){var _0x837c68=_0x5646ff['query']['test']?0x1f4:_0xfff9a5['statusCode']||0x1f4;logger[_0x8c78('0x75')](_0x8c78('0x76'),_0x8c78('0x56'),_0x837c68,JSON[_0x8c78('0x77')](_0xfff9a5));delete _0xfff9a5['name'];if(_0x837c68===0x191){_0x837c68=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x837c68)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x78')]?{'message':_0x8c78('0x79'),'statusCode':_0xfff9a5[_0x8c78('0x7a')]}:_0xfff9a5);});}; \ No newline at end of file +var _0x0abf=['eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','name','send','index','map','ZendeskAccount','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','toString','base64','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test'];(function(_0x35843c,_0x291a51){var _0x3dfae3=function(_0x1c302c){while(--_0x1c302c){_0x35843c['push'](_0x35843c['shift']());}};_0x3dfae3(++_0x291a51);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var licenseUtil=require(_0xf0ab('0x15'));var db=require(_0xf0ab('0x16'))['db'];var integrations=require(_0xf0ab('0x17'));function respondWithStatusCode(_0x34ccdc,_0x4fdd5f){_0x4fdd5f=_0x4fdd5f||0xcc;return function(_0x39b4e7){if(_0x39b4e7){return _0x34ccdc[_0xf0ab('0x18')](_0x4fdd5f);}return _0x34ccdc[_0xf0ab('0x19')](_0x4fdd5f)[_0xf0ab('0x1a')]();};}function respondWithResult(_0x1824ef,_0x36cabe){_0x36cabe=_0x36cabe||0xc8;return function(_0x3d7129){if(_0x3d7129){return _0x1824ef[_0xf0ab('0x19')](_0x36cabe)[_0xf0ab('0x1b')](_0x3d7129);}};}function respondWithFilteredResult(_0x3c5bfd,_0x20f453){return function(_0x221bac){if(_0x221bac){var _0x200cf5=typeof _0x20f453[_0xf0ab('0x1c')]===_0xf0ab('0x1d')&&typeof _0x20f453['limit']===_0xf0ab('0x1d');var _0x9e3b47=_0x221bac[_0xf0ab('0x1e')];var _0x1ffeb5=_0x200cf5?0x0:_0x20f453[_0xf0ab('0x1c')];var _0xb9a33=_0x200cf5?_0x221bac[_0xf0ab('0x1e')]:_0x20f453[_0xf0ab('0x1c')]+_0x20f453[_0xf0ab('0x1f')];var _0x1874a5;if(_0xb9a33>=_0x9e3b47){_0xb9a33=_0x9e3b47;_0x1874a5=0xc8;}else{_0x1874a5=0xce;}_0x3c5bfd[_0xf0ab('0x19')](_0x1874a5);return _0x3c5bfd[_0xf0ab('0x20')](_0xf0ab('0x21'),_0x1ffeb5+'-'+_0xb9a33+'/'+_0x9e3b47)[_0xf0ab('0x1b')](_0x221bac);}return null;};}function patchUpdates(_0x2cd961){return function(_0x45c1c9){try{jsonpatch['apply'](_0x45c1c9,_0x2cd961,!![]);}catch(_0x153492){return BPromise[_0xf0ab('0x22')](_0x153492);}return _0x45c1c9[_0xf0ab('0x23')]();};}function saveUpdates(_0x11ab3a,_0x3bf6a1){return function(_0x374531){if(_0x374531){return _0x374531[_0xf0ab('0x24')](_0x11ab3a)[_0xf0ab('0x25')](function(_0x36ad01){return _0x36ad01;});}return null;};}function removeEntity(_0x18bb37,_0x43119f){return function(_0x5645b2){if(_0x5645b2){return _0x5645b2['destroy']()['then'](function(){_0x18bb37[_0xf0ab('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eca32,_0x16b979){return function(_0x51ac90){if(!_0x51ac90){_0x3eca32[_0xf0ab('0x18')](0x194);}return _0x51ac90;};}function handleError(_0x22671e,_0x10bf5f){_0x10bf5f=_0x10bf5f||0x1f4;return function(_0x38fb71){logger[_0xf0ab('0x26')](_0x38fb71['stack']);if(_0x38fb71[_0xf0ab('0x27')]){delete _0x38fb71['name'];}_0x22671e['status'](_0x10bf5f)[_0xf0ab('0x28')](_0x38fb71);};}exports[_0xf0ab('0x29')]=function(_0x1b223d,_0x445160){var _0x43476c={},_0x174052={},_0x367302={'count':0x0,'rows':[]};var _0x14da9c=_[_0xf0ab('0x2a')](db[_0xf0ab('0x2b')][_0xf0ab('0x2c')],function(_0x199753){return{'name':_0x199753['fieldName'],'type':_0x199753[_0xf0ab('0x2d')][_0xf0ab('0x2e')]};});_0x174052['model']=_['map'](_0x14da9c,_0xf0ab('0x27'));_0x174052[_0xf0ab('0x2f')]=_[_0xf0ab('0x30')](_0x1b223d['query']);_0x174052['filters']=_[_0xf0ab('0x31')](_0x174052['model'],_0x174052[_0xf0ab('0x2f')]);_0x43476c['attributes']=_[_0xf0ab('0x31')](_0x174052[_0xf0ab('0x32')],qs['fields'](_0x1b223d['query'][_0xf0ab('0x33')]));_0x43476c[_0xf0ab('0x34')]=_0x43476c[_0xf0ab('0x34')][_0xf0ab('0x35')]?_0x43476c[_0xf0ab('0x34')]:_0x174052[_0xf0ab('0x32')];if(!_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x36')](_0xf0ab('0x37'))){_0x43476c[_0xf0ab('0x1f')]=qs[_0xf0ab('0x1f')](_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x1f')]);_0x43476c[_0xf0ab('0x1c')]=qs['offset'](_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x1c')]);}_0x43476c[_0xf0ab('0x38')]=qs['sort'](_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x39')]);_0x43476c[_0xf0ab('0x3a')]=qs['filters'](_[_0xf0ab('0x3b')](_0x1b223d['query'],_0x174052[_0xf0ab('0x3c')]),_0x14da9c);if(_0x1b223d['query'][_0xf0ab('0x3d')]){_0x43476c[_0xf0ab('0x3a')]=_[_0xf0ab('0x3e')](_0x43476c[_0xf0ab('0x3a')],{'$or':_[_0xf0ab('0x2a')](_0x14da9c,function(_0x1dfb2e){if(_0x1dfb2e['type']!==_0xf0ab('0x3f')){var _0x683d08={};_0x683d08[_0x1dfb2e['name']]={'$like':'%'+_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x3d')]+'%'};return _0x683d08;}})});}_0x43476c=_[_0xf0ab('0x3e')]({},_0x43476c,_0x1b223d[_0xf0ab('0x40')]);var _0x31fa72={'where':_0x43476c[_0xf0ab('0x3a')]};return db[_0xf0ab('0x2b')]['count'](_0x31fa72)[_0xf0ab('0x25')](function(_0x4f6e93){_0x367302[_0xf0ab('0x1e')]=_0x4f6e93;if(_0x1b223d['query'][_0xf0ab('0x41')]){_0x43476c[_0xf0ab('0x42')]=[{'all':!![]}];}return db[_0xf0ab('0x2b')][_0xf0ab('0x43')](_0x43476c);})[_0xf0ab('0x25')](function(_0x553d07){_0x367302[_0xf0ab('0x44')]=_0x553d07;return _0x367302;})[_0xf0ab('0x25')](respondWithFilteredResult(_0x445160,_0x43476c))[_0xf0ab('0x45')](handleError(_0x445160,null));};exports[_0xf0ab('0x46')]=function(_0x191caf,_0x17a73){var _0x45849c={'raw':![],'where':{'id':_0x191caf[_0xf0ab('0x47')]['id']}},_0x413f5c={};_0x413f5c[_0xf0ab('0x32')]=_[_0xf0ab('0x30')](db[_0xf0ab('0x2b')][_0xf0ab('0x2c')]);_0x413f5c['query']=_['keys'](_0x191caf[_0xf0ab('0x2f')]);_0x413f5c['filters']=_[_0xf0ab('0x31')](_0x413f5c[_0xf0ab('0x32')],_0x413f5c['query']);_0x45849c[_0xf0ab('0x34')]=_[_0xf0ab('0x31')](_0x413f5c['model'],qs[_0xf0ab('0x33')](_0x191caf[_0xf0ab('0x2f')][_0xf0ab('0x33')]));_0x45849c[_0xf0ab('0x34')]=_0x45849c[_0xf0ab('0x34')][_0xf0ab('0x35')]?_0x45849c[_0xf0ab('0x34')]:_0x413f5c[_0xf0ab('0x32')];if(_0x191caf[_0xf0ab('0x2f')][_0xf0ab('0x41')]){_0x45849c[_0xf0ab('0x42')]=[{'all':!![]}];}_0x45849c=_[_0xf0ab('0x3e')]({},_0x45849c,_0x191caf[_0xf0ab('0x40')]);return db[_0xf0ab('0x2b')]['find'](_0x45849c)['then'](handleEntityNotFound(_0x17a73,null))[_0xf0ab('0x25')](respondWithResult(_0x17a73,null))['catch'](handleError(_0x17a73,null));};exports['create']=function(_0x4e57d3,_0xc3b68d){return db[_0xf0ab('0x2b')][_0xf0ab('0x48')](_0x4e57d3[_0xf0ab('0x49')],{})[_0xf0ab('0x25')](respondWithResult(_0xc3b68d,0xc9))[_0xf0ab('0x45')](handleError(_0xc3b68d,null));};exports[_0xf0ab('0x24')]=function(_0x1a0f21,_0xc6862b){if(_0x1a0f21[_0xf0ab('0x49')]['id']){delete _0x1a0f21[_0xf0ab('0x49')]['id'];}return db[_0xf0ab('0x2b')]['find']({'where':{'id':_0x1a0f21[_0xf0ab('0x47')]['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0xc6862b,null))[_0xf0ab('0x25')](saveUpdates(_0x1a0f21[_0xf0ab('0x49')],null))[_0xf0ab('0x25')](respondWithResult(_0xc6862b,null))[_0xf0ab('0x45')](handleError(_0xc6862b,null));};exports[_0xf0ab('0x4a')]=function(_0x2e6c5e,_0x47f564){return db['ZendeskAccount']['find']({'where':{'id':_0x2e6c5e[_0xf0ab('0x47')]['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0x47f564,null))['then'](removeEntity(_0x47f564,null))[_0xf0ab('0x45')](handleError(_0x47f564,null));};exports[_0xf0ab('0x4b')]=function(_0x4edb01,_0x1a9981,_0x53d6a4){var _0x1352ac={};var _0xe4ef6d={};var _0x187389;var _0x33112b;return db[_0xf0ab('0x2b')]['findOne']({'where':{'id':_0x4edb01[_0xf0ab('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a9981,null))[_0xf0ab('0x25')](function(_0x4c9d2b){if(_0x4c9d2b){_0x187389=_0x4c9d2b;_0xe4ef6d[_0xf0ab('0x32')]=_['keys'](db['ZendeskConfiguration'][_0xf0ab('0x2c')]);_0xe4ef6d['query']=_[_0xf0ab('0x30')](_0x4edb01['query']);_0xe4ef6d[_0xf0ab('0x3c')]=_['intersection'](_0xe4ef6d[_0xf0ab('0x32')],_0xe4ef6d[_0xf0ab('0x2f')]);_0x1352ac[_0xf0ab('0x34')]=_['intersection'](_0xe4ef6d['model'],qs['fields'](_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x33')]));_0x1352ac['attributes']=_0x1352ac['attributes'][_0xf0ab('0x35')]?_0x1352ac[_0xf0ab('0x34')]:_0xe4ef6d[_0xf0ab('0x32')];_0x1352ac[_0xf0ab('0x38')]=qs[_0xf0ab('0x39')](_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x39')]);_0x1352ac[_0xf0ab('0x3a')]=qs[_0xf0ab('0x3c')](_[_0xf0ab('0x3b')](_0x4edb01[_0xf0ab('0x2f')],_0xe4ef6d['filters']));if(_0x4edb01[_0xf0ab('0x2f')]['filter']){_0x1352ac[_0xf0ab('0x3a')]=_[_0xf0ab('0x3e')](_0x1352ac[_0xf0ab('0x3a')],{'$or':_[_0xf0ab('0x2a')](_0x1352ac[_0xf0ab('0x34')],function(_0x3c168f){var _0x152e80={};_0x152e80[_0x3c168f]={'$like':'%'+_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x3d')]+'%'};return _0x152e80;})});}_0x1352ac=_[_0xf0ab('0x3e')]({},_0x1352ac,_0x4edb01['options']);return _0x187389[_0xf0ab('0x4b')](_0x1352ac);}})[_0xf0ab('0x25')](function(_0x4062b7){if(_0x4062b7){_0x33112b=_0x4062b7[_0xf0ab('0x35')];if(!_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x36')](_0xf0ab('0x37'))){_0x1352ac[_0xf0ab('0x1f')]=qs[_0xf0ab('0x1f')](_0x4edb01['query']['limit']);_0x1352ac[_0xf0ab('0x1c')]=qs[_0xf0ab('0x1c')](_0x4edb01[_0xf0ab('0x2f')]['offset']);}return _0x187389[_0xf0ab('0x4b')](_0x1352ac);}})[_0xf0ab('0x25')](function(_0xd61dcf){if(_0xd61dcf){return _0xd61dcf?{'count':_0x33112b,'rows':_0xd61dcf}:null;}})['then'](respondWithResult(_0x1a9981,null))[_0xf0ab('0x45')](handleError(_0x1a9981,null));};exports[_0xf0ab('0x4c')]=function(_0x3fc57e,_0x3d333f,_0x23f4f8){if(_0x3fc57e['body']['id']){delete _0x3fc57e[_0xf0ab('0x49')]['id'];}return db[_0xf0ab('0x2b')][_0xf0ab('0x4d')]({'where':{'id':_0x3fc57e[_0xf0ab('0x47')]['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0x3d333f,null))[_0xf0ab('0x25')](function(_0xe3fc19){if(_0xe3fc19){_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x4e')]=_0xe3fc19['id'];_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x4f')]=integrations[_0xf0ab('0x50')](_0x3fc57e[_0xf0ab('0x49')]['channel'],_0x3fc57e['body'][_0xf0ab('0x2d')]);_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x51')]=integrations['getDescriptions'](_0x3fc57e[_0xf0ab('0x49')]['channel'],_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x2d')]);return db[_0xf0ab('0x52')]['create'](_0x3fc57e[_0xf0ab('0x49')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0xf0ab('0x53')],'as':_0xf0ab('0x51')}]});}return null;})[_0xf0ab('0x25')](respondWithResult(_0x3d333f,null))['catch'](handleError(_0x3d333f,null));};exports[_0xf0ab('0x54')]=function(_0x92ade0,_0x1035b3,_0x122c41){var _0x5b6923='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x92ade0[_0xf0ab('0x47')]['id']},'attributes':['id',_0xf0ab('0x55'),_0xf0ab('0x56'),_0xf0ab('0x57'),_0xf0ab('0x58'),_0xf0ab('0x59')]})[_0xf0ab('0x25')](handleEntityNotFound(_0x1035b3,null))[_0xf0ab('0x25')](function(_0x3119d1){if(_0x3119d1){_0x5b6923=_0x3119d1[_0xf0ab('0x59')];var _0x228334=_0x5b6923['slice'](-0x1);if(_0x228334==='/'){_0x5b6923=_0x5b6923[_0xf0ab('0x5a')](0x0,_0x5b6923[_0xf0ab('0x5b')](_0x228334));}var _0x24e4f5={'method':_0xf0ab('0x5c'),'uri':util[_0xf0ab('0x5d')](_0xf0ab('0x5e'),_0x5b6923,_0xf0ab('0x5f')),'json':!![]};switch(_0x3119d1[_0xf0ab('0x58')]){case'password':_0x24e4f5[_0xf0ab('0x60')]={'Authorization':util[_0xf0ab('0x5d')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x3119d1[_0xf0ab('0x55')],_0x3119d1[_0xf0ab('0x56')]))[_0xf0ab('0x61')](_0xf0ab('0x62')))};break;case _0xf0ab('0x57'):_0x24e4f5[_0xf0ab('0x60')]={'Authorization':util['format'](_0xf0ab('0x63'),new Buffer(util['format'](_0xf0ab('0x64'),_0x3119d1['username'],_0x3119d1[_0xf0ab('0x57')]))['toString'](_0xf0ab('0x62')))};break;default:throw new db['Sequelize']['ValidationError'](_0xf0ab('0x65'));}return rp(_0x24e4f5);}})[_0xf0ab('0x25')](function(_0x1f37a2){if(_0x1f37a2){var _0xd96ca8=[_0xf0ab('0x66'),_0xf0ab('0x67'),_0xf0ab('0x68'),_0xf0ab('0x69')];_[_0xf0ab('0x6a')](_0x1f37a2[_0xf0ab('0x5f')],function(_0x1650c0){return _0xd96ca8[_0xf0ab('0x6b')](_0x1650c0[_0xf0ab('0x2d')]);});return{'count':_0x1f37a2['ticket_fields'][_0xf0ab('0x35')],'rows':_[_0xf0ab('0x2a')](_0x1f37a2[_0xf0ab('0x5f')],function(_0x12acef){return{'id':_0x12acef['id'],'name':_0x12acef[_0xf0ab('0x6c')]>0x7?_0x12acef[_0xf0ab('0x6d')]:_0x12acef[_0xf0ab('0x2d')],'custom':_0x12acef[_0xf0ab('0x6c')]>0x7?!![]:![],'options':_0x12acef[_0xf0ab('0x6e')]?_0x12acef[_0xf0ab('0x6e')]:_0x12acef[_0xf0ab('0x6f')]?_0x12acef[_0xf0ab('0x6f')]:[]};})};}})['then'](respondWithResult(_0x1035b3,null))[_0xf0ab('0x45')](function(_0x1f18cd){var _0x3221ff=_0x92ade0[_0xf0ab('0x2f')]['test']?0x1f4:_0x1f18cd[_0xf0ab('0x70')]||0x1f4;logger[_0xf0ab('0x26')](_0xf0ab('0x71'),_0xf0ab('0x54'),_0x3221ff,JSON[_0xf0ab('0x72')](_0x1f18cd));delete _0x1f18cd['name'];if(_0x3221ff===0x191){_0x3221ff=0x190;}_0x1035b3[_0xf0ab('0x19')](_0x3221ff)[_0xf0ab('0x28')](_0x92ade0['query'][_0xf0ab('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1f18cd[_0xf0ab('0x70')]}:_0x1f18cd);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 56155c7..bd9065f 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 _0x0460=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x0460,0x96));var _0x0046=function(_0x508e2a,_0x392ea1){_0x508e2a=_0x508e2a-0x0;var _0x18f170=_0x0460[_0x508e2a];return _0x18f170;};'use strict';var _=require('lodash');var util=require(_0x0046('0x0'));var logger=require(_0x0046('0x1'))(_0x0046('0x2'));var moment=require(_0x0046('0x3'));var BPromise=require(_0x0046('0x4'));var rp=require(_0x0046('0x5'));var fs=require('fs');var path=require(_0x0046('0x6'));var rimraf=require(_0x0046('0x7'));var config=require(_0x0046('0x8'));var attributes=require(_0x0046('0x9'));var integrations=require(_0x0046('0xa'));module[_0x0046('0xb')]=function(_0x1bdf0d,_0x4c7449){return _0x1bdf0d['define']('ZendeskAccount',attributes,{'tableName':_0x0046('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88f4=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../components/integrations/configuration','ZendeskAccount','int_zendesk_accounts'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0x88f4,0x1dd));var _0x488f=function(_0x51cab9,_0x304bc4){_0x51cab9=_0x51cab9-0x0;var _0x5acdad=_0x88f4[_0x51cab9];return _0x5acdad;};'use strict';var _=require('lodash');var util=require(_0x488f('0x0'));var logger=require(_0x488f('0x1'))(_0x488f('0x2'));var moment=require('moment');var BPromise=require(_0x488f('0x3'));var rp=require(_0x488f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x488f('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x488f('0x6'));module['exports']=function(_0x91bf81,_0xfd1352){return _0x91bf81['define'](_0x488f('0x7'),attributes,{'tableName':_0x488f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 1218baf..e59c5f9 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 _0xcbda=['jayson/promise','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','map','include','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x157af2,_0x402b3a){var _0x23356a=function(_0xb0721a){while(--_0xb0721a){_0x157af2['push'](_0x157af2['shift']());}};_0x23356a(++_0x402b3a);}(_0xcbda,0x1a6));var _0xacbd=function(_0x1a6374,_0xa3df9d){_0x1a6374=_0x1a6374-0x0;var _0x258b67=_0xcbda[_0x1a6374];return _0x258b67;};'use strict';var _=require(_0xacbd('0x0'));var util=require(_0xacbd('0x1'));var moment=require(_0xacbd('0x2'));var BPromise=require(_0xacbd('0x3'));var rs=require(_0xacbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacbd('0x5'))['db'];var utils=require(_0xacbd('0x6'));var logger=require(_0xacbd('0x7'))(_0xacbd('0x8'));var config=require(_0xacbd('0x9'));var jayson=require(_0xacbd('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c28c0,_0x382d12,_0x5b2f32){return new BPromise(function(_0x1b63be,_0x5cef26){return client[_0xacbd('0xb')](_0x2c28c0,_0x5b2f32)[_0xacbd('0xc')](function(_0x1b782e){logger['info'](_0xacbd('0xd'),_0x382d12,'request\x20sent');logger[_0xacbd('0xe')](_0xacbd('0xf'),_0x382d12,_0xacbd('0x10'),JSON[_0xacbd('0x11')](_0x1b782e));if(_0x1b782e[_0xacbd('0x12')]){if(_0x1b782e['error'][_0xacbd('0x13')]===0x1f4){logger['error'](_0xacbd('0xd'),_0x382d12,_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);return _0x5cef26(_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);}logger[_0xacbd('0x12')](_0xacbd('0xd'),_0x382d12,_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);return _0x1b63be(_0x1b782e[_0xacbd('0x12')][_0xacbd('0x14')]);}else{logger[_0xacbd('0x15')](_0xacbd('0xd'),_0x382d12,'request\x20sent');_0x1b63be(_0x1b782e[_0xacbd('0x16')][_0xacbd('0x14')]);}})[_0xacbd('0x17')](function(_0x447fe4){logger['error'](_0xacbd('0xd'),_0x382d12,_0x447fe4);_0x5cef26(_0x447fe4);});});}exports[_0xacbd('0x18')]=function(_0x5c2d4b){var _0x2e8a2a=this;return new Promise(function(_0x936b54,_0x42708f){return db[_0xacbd('0x19')][_0xacbd('0x1a')]({'raw':_0x5c2d4b['options']?_0x5c2d4b[_0xacbd('0x1b')][_0xacbd('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c2d4b[_0xacbd('0x1b')]?_0x5c2d4b[_0xacbd('0x1b')]['where']||null:null,'attributes':_0x5c2d4b[_0xacbd('0x1b')]?_0x5c2d4b['options'][_0xacbd('0x1d')]||null:null,'limit':_0x5c2d4b[_0xacbd('0x1b')]?_0x5c2d4b[_0xacbd('0x1b')][_0xacbd('0x1e')]||null:null,'include':_0x5c2d4b['options']?_0x5c2d4b[_0xacbd('0x1b')]['include']?_[_0xacbd('0x1f')](_0x5c2d4b[_0xacbd('0x1b')][_0xacbd('0x20')],function(_0x9d209f){return{'model':db[_0x9d209f['model']],'as':_0x9d209f['as'],'attributes':_0x9d209f[_0xacbd('0x1d')],'include':_0x9d209f[_0xacbd('0x20')]?_['map'](_0x9d209f['include'],function(_0x39e38c){return{'model':db[_0x39e38c[_0xacbd('0x21')]],'as':_0x39e38c['as'],'attributes':_0x39e38c[_0xacbd('0x1d')],'include':_0x39e38c[_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0x39e38c[_0xacbd('0x20')],function(_0x565358){return{'model':db[_0x565358[_0xacbd('0x21')]],'as':_0x565358['as'],'attributes':_0x565358[_0xacbd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xacbd('0xc')](function(_0x48e678){logger[_0xacbd('0x15')]('GetZendeskAccount',_0x5c2d4b);logger['debug']('GetZendeskAccount',_0x5c2d4b,JSON[_0xacbd('0x11')](_0x48e678));_0x936b54(_0x48e678);})[_0xacbd('0x17')](function(_0x141418){logger[_0xacbd('0x12')]('GetZendeskAccount',_0x141418[_0xacbd('0x14')],_0x5c2d4b);_0x42708f(_0x2e8a2a[_0xacbd('0x12')](0x1f4,_0x141418[_0xacbd('0x14')]));});});};exports[_0xacbd('0x22')]=function(_0x2f97ad){var _0x4bd56a=this;return new Promise(function(_0x2277b7,_0x2040f5){return db[_0xacbd('0x19')][_0xacbd('0x23')]({'raw':_0x2f97ad[_0xacbd('0x1b')]?_0x2f97ad[_0xacbd('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2f97ad['options']?_0x2f97ad[_0xacbd('0x1b')]['where']||null:null,'attributes':_0x2f97ad[_0xacbd('0x1b')]?_0x2f97ad[_0xacbd('0x1b')][_0xacbd('0x1d')]||null:null,'include':_0x2f97ad[_0xacbd('0x1b')]?_0x2f97ad[_0xacbd('0x1b')][_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0x2f97ad[_0xacbd('0x1b')][_0xacbd('0x20')],function(_0xb148e7){return{'model':db[_0xb148e7[_0xacbd('0x21')]],'as':_0xb148e7['as'],'attributes':_0xb148e7['attributes'],'include':_0xb148e7[_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0xb148e7[_0xacbd('0x20')],function(_0x287818){return{'model':db[_0x287818[_0xacbd('0x21')]],'as':_0x287818['as'],'attributes':_0x287818['attributes'],'include':_0x287818[_0xacbd('0x20')]?_[_0xacbd('0x1f')](_0x287818['include'],function(_0x5d1553){return{'model':db[_0x5d1553[_0xacbd('0x21')]],'as':_0x5d1553['as'],'attributes':_0x5d1553['attributes']};}):[]};}):[]};}):[]:[]})[_0xacbd('0xc')](function(_0x174d34){logger['info'](_0xacbd('0x22'),_0x2f97ad);logger[_0xacbd('0xe')](_0xacbd('0x22'),_0x2f97ad,JSON[_0xacbd('0x11')](_0x174d34));_0x2277b7(_0x174d34);})[_0xacbd('0x17')](function(_0x13da49){logger[_0xacbd('0x12')](_0xacbd('0x22'),_0x13da49[_0xacbd('0x14')],_0x2f97ad);_0x2040f5(_0x4bd56a[_0xacbd('0x12')](0x1f4,_0x13da49[_0xacbd('0x14')]));});});}; \ No newline at end of file +var _0x1ed1=['../../config/environment','jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','where','attributes','limit','include','map','model','debug','GetZendeskAccount','ShowZendeskAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1ed1,0x134));var _0x11ed=function(_0x1aa9be,_0x2d1357){_0x1aa9be=_0x1aa9be-0x0;var _0x519c29=_0x1ed1[_0x1aa9be];return _0x519c29;};'use strict';var _=require(_0x11ed('0x0'));var util=require('util');var moment=require(_0x11ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x11ed('0x2'));var fs=require('fs');var Redis=require(_0x11ed('0x3'));var db=require(_0x11ed('0x4'))['db'];var utils=require(_0x11ed('0x5'));var logger=require(_0x11ed('0x6'))('rpc');var config=require(_0x11ed('0x7'));var jayson=require(_0x11ed('0x8'));var client=jayson[_0x11ed('0x9')][_0x11ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e632,_0x490a26,_0x391846){return new BPromise(function(_0x135b0d,_0x353472){return client['request'](_0x19e632,_0x391846)[_0x11ed('0xb')](function(_0xd9e012){logger['info'](_0x11ed('0xc'),_0x490a26,_0x11ed('0xd'));logger['debug'](_0x11ed('0xe'),_0x490a26,_0x11ed('0xd'),JSON[_0x11ed('0xf')](_0xd9e012));if(_0xd9e012[_0x11ed('0x10')]){if(_0xd9e012[_0x11ed('0x10')][_0x11ed('0x11')]===0x1f4){logger[_0x11ed('0x10')](_0x11ed('0xc'),_0x490a26,_0xd9e012[_0x11ed('0x10')][_0x11ed('0x12')]);return _0x353472(_0xd9e012[_0x11ed('0x10')]['message']);}logger[_0x11ed('0x10')](_0x11ed('0xc'),_0x490a26,_0xd9e012[_0x11ed('0x10')][_0x11ed('0x12')]);return _0x135b0d(_0xd9e012['error'][_0x11ed('0x12')]);}else{logger[_0x11ed('0x13')](_0x11ed('0xc'),_0x490a26,'request\x20sent');_0x135b0d(_0xd9e012[_0x11ed('0x14')][_0x11ed('0x12')]);}})[_0x11ed('0x15')](function(_0x12d2b6){logger[_0x11ed('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x490a26,_0x12d2b6);_0x353472(_0x12d2b6);});});}exports['GetZendeskAccount']=function(_0x1bbaf8){var _0x30430e=this;return new Promise(function(_0x50419c,_0x56b6a9){return db['ZendeskAccount'][_0x11ed('0x16')]({'raw':_0x1bbaf8[_0x11ed('0x17')]?_0x1bbaf8[_0x11ed('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1bbaf8[_0x11ed('0x17')]?_0x1bbaf8['options'][_0x11ed('0x18')]||null:null,'attributes':_0x1bbaf8[_0x11ed('0x17')]?_0x1bbaf8['options'][_0x11ed('0x19')]||null:null,'limit':_0x1bbaf8['options']?_0x1bbaf8[_0x11ed('0x17')][_0x11ed('0x1a')]||null:null,'include':_0x1bbaf8['options']?_0x1bbaf8[_0x11ed('0x17')][_0x11ed('0x1b')]?_[_0x11ed('0x1c')](_0x1bbaf8[_0x11ed('0x17')][_0x11ed('0x1b')],function(_0x3cb41e){return{'model':db[_0x3cb41e[_0x11ed('0x1d')]],'as':_0x3cb41e['as'],'attributes':_0x3cb41e[_0x11ed('0x19')],'include':_0x3cb41e[_0x11ed('0x1b')]?_[_0x11ed('0x1c')](_0x3cb41e[_0x11ed('0x1b')],function(_0x3f74c5){return{'model':db[_0x3f74c5['model']],'as':_0x3f74c5['as'],'attributes':_0x3f74c5[_0x11ed('0x19')],'include':_0x3f74c5[_0x11ed('0x1b')]?_[_0x11ed('0x1c')](_0x3f74c5['include'],function(_0x4c7c73){return{'model':db[_0x4c7c73[_0x11ed('0x1d')]],'as':_0x4c7c73['as'],'attributes':_0x4c7c73[_0x11ed('0x19')]};}):[]};}):[]};}):[]:[]})[_0x11ed('0xb')](function(_0x5cce22){logger[_0x11ed('0x13')]('GetZendeskAccount',_0x1bbaf8);logger[_0x11ed('0x1e')](_0x11ed('0x1f'),_0x1bbaf8,JSON['stringify'](_0x5cce22));_0x50419c(_0x5cce22);})['catch'](function(_0x31234e){logger[_0x11ed('0x10')](_0x11ed('0x1f'),_0x31234e['message'],_0x1bbaf8);_0x56b6a9(_0x30430e[_0x11ed('0x10')](0x1f4,_0x31234e[_0x11ed('0x12')]));});});};exports[_0x11ed('0x20')]=function(_0x396502){var _0x9f01d8=this;return new Promise(function(_0x135ce1,_0x1d1af3){return db['ZendeskAccount'][_0x11ed('0x21')]({'raw':_0x396502[_0x11ed('0x17')]?_0x396502['options'][_0x11ed('0x22')]===undefined?!![]:![]:!![],'where':_0x396502[_0x11ed('0x17')]?_0x396502['options'][_0x11ed('0x18')]||null:null,'attributes':_0x396502[_0x11ed('0x17')]?_0x396502['options'][_0x11ed('0x19')]||null:null,'include':_0x396502[_0x11ed('0x17')]?_0x396502[_0x11ed('0x17')][_0x11ed('0x1b')]?_['map'](_0x396502[_0x11ed('0x17')][_0x11ed('0x1b')],function(_0x4c7d23){return{'model':db[_0x4c7d23[_0x11ed('0x1d')]],'as':_0x4c7d23['as'],'attributes':_0x4c7d23[_0x11ed('0x19')],'include':_0x4c7d23[_0x11ed('0x1b')]?_[_0x11ed('0x1c')](_0x4c7d23[_0x11ed('0x1b')],function(_0x10948c){return{'model':db[_0x10948c['model']],'as':_0x10948c['as'],'attributes':_0x10948c['attributes'],'include':_0x10948c[_0x11ed('0x1b')]?_['map'](_0x10948c[_0x11ed('0x1b')],function(_0x2ec5a9){return{'model':db[_0x2ec5a9[_0x11ed('0x1d')]],'as':_0x2ec5a9['as'],'attributes':_0x2ec5a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x11ed('0xb')](function(_0xe3cc95){logger[_0x11ed('0x13')]('ShowZendeskAccount',_0x396502);logger[_0x11ed('0x1e')](_0x11ed('0x20'),_0x396502,JSON[_0x11ed('0xf')](_0xe3cc95));_0x135ce1(_0xe3cc95);})[_0x11ed('0x15')](function(_0x25e504){logger[_0x11ed('0x10')](_0x11ed('0x20'),_0x25e504['message'],_0x396502);_0x1d1af3(_0x9f01d8['error'](0x1f4,_0x25e504[_0x11ed('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index e8c610d..e5df238 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x5f0396,_0x36e2fd){var _0x2cb6a0=function(_0x16b66a){while(--_0x16b66a){_0x5f0396['push'](_0x5f0396['shift']());}};_0x2cb6a0(++_0x36e2fd);}(_0xda3f,0xec));var _0xfda3=function(_0xdd12b9,_0x5bc048){_0xdd12b9=_0xdd12b9-0x0;var _0x102d1d=_0xda3f[_0xdd12b9];return _0x102d1d;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file +var _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x4f7606,_0x36b45e){var _0x28a2be=function(_0x118ac6){while(--_0x118ac6){_0x4f7606['push'](_0x4f7606['shift']());}};_0x28a2be(++_0x36b45e);}(_0x5c00,0x17e));var _0x05c0=function(_0x5b685e,_0x3e69ad){_0x5b685e=_0x5b685e-0x0;var _0x9a0173=_0x5c00[_0x5b685e];return _0x9a0173;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('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 5e1ed5f..fba6d5e 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 _0x0c98=['STRING','exports'];(function(_0x4b6d72,_0x15a92a){var _0x28eeed=function(_0x359f67){while(--_0x359f67){_0x4b6d72['push'](_0x4b6d72['shift']());}};_0x28eeed(++_0x15a92a);}(_0x0c98,0x1e3));var _0x80c9=function(_0x4fb52e,_0x5c9020){_0x4fb52e=_0x4fb52e-0x0;var _0x155b17=_0x0c98[_0x4fb52e];return _0x155b17;};'use strict';var Sequelize=require('sequelize');module[_0x80c9('0x0')]={'name':{'type':Sequelize[_0x80c9('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x701e=['sequelize','exports','STRING'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x701e,0x96));var _0xe701=function(_0x103fb9,_0x41cf3e){_0x103fb9=_0x103fb9-0x0;var _0x12322a=_0x701e[_0x103fb9];return _0x12322a;};'use strict';var Sequelize=require(_0xe701('0x0'));module[_0xe701('0x1')]={'name':{'type':Sequelize[_0xe701('0x2')]},'description':{'type':Sequelize[_0xe701('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 3ad8297..d7e6e9c 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 _0x9767=['filter','merge','includeAll','rows','catch','rawAttributes','include','options','find','create','body','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','name','send','index','map','ZendeskConfiguration','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL'];(function(_0x5b1598,_0x2d9007){var _0xa5eb8f=function(_0x34cbd0){while(--_0x34cbd0){_0x5b1598['push'](_0x5b1598['shift']());}};_0xa5eb8f(++_0x2d9007);}(_0x9767,0xb9));var _0x7976=function(_0xfbf4ac,_0x24b52c){_0xfbf4ac=_0xfbf4ac-0x0;var _0x2635a5=_0x9767[_0xfbf4ac];return _0x2635a5;};'use strict';var emlformat=require(_0x7976('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7976('0x1'));var rp=require(_0x7976('0x2'));var moment=require(_0x7976('0x3'));var BPromise=require(_0x7976('0x4'));var Mustache=require(_0x7976('0x5'));var util=require(_0x7976('0x6'));var path=require(_0x7976('0x7'));var sox=require(_0x7976('0x8'));var csv=require('to-csv');var ejs=require(_0x7976('0x9'));var fs=require('fs');var fs_extra=require(_0x7976('0xa'));var _=require(_0x7976('0xb'));var squel=require(_0x7976('0xc'));var crypto=require(_0x7976('0xd'));var jsforce=require(_0x7976('0xe'));var deskjs=require(_0x7976('0xf'));var toCsv=require(_0x7976('0x10'));var querystring=require('querystring');var Papa=require(_0x7976('0x11'));var Redis=require(_0x7976('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7976('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7976('0x14'));var logger=require(_0x7976('0x15'))(_0x7976('0x16'));var utils=require(_0x7976('0x17'));var config=require(_0x7976('0x18'));var licenseUtil=require(_0x7976('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83c530,_0x10e72d){_0x10e72d=_0x10e72d||0xcc;return function(_0x424ab3){if(_0x424ab3){return _0x83c530[_0x7976('0x1a')](_0x10e72d);}return _0x83c530[_0x7976('0x1b')](_0x10e72d)[_0x7976('0x1c')]();};}function respondWithResult(_0x3eb70f,_0x263c39){_0x263c39=_0x263c39||0xc8;return function(_0x46a766){if(_0x46a766){return _0x3eb70f[_0x7976('0x1b')](_0x263c39)[_0x7976('0x1d')](_0x46a766);}};}function respondWithFilteredResult(_0x3ecf85,_0xe8412b){return function(_0x45447a){if(_0x45447a){var _0x3f35b0=typeof _0xe8412b['offset']===_0x7976('0x1e')&&typeof _0xe8412b[_0x7976('0x1f')]===_0x7976('0x1e');var _0x48ea9e=_0x45447a[_0x7976('0x20')];var _0x452ffd=_0x3f35b0?0x0:_0xe8412b[_0x7976('0x21')];var _0xc8bd1e=_0x3f35b0?_0x45447a[_0x7976('0x20')]:_0xe8412b['offset']+_0xe8412b['limit'];var _0x4a2023;if(_0xc8bd1e>=_0x48ea9e){_0xc8bd1e=_0x48ea9e;_0x4a2023=0xc8;}else{_0x4a2023=0xce;}_0x3ecf85[_0x7976('0x1b')](_0x4a2023);return _0x3ecf85[_0x7976('0x22')]('Content-Range',_0x452ffd+'-'+_0xc8bd1e+'/'+_0x48ea9e)[_0x7976('0x1d')](_0x45447a);}return null;};}function patchUpdates(_0x6d808f){return function(_0x5d5745){try{jsonpatch['apply'](_0x5d5745,_0x6d808f,!![]);}catch(_0x194815){return BPromise[_0x7976('0x23')](_0x194815);}return _0x5d5745[_0x7976('0x24')]();};}function saveUpdates(_0x772a40,_0x51055b){return function(_0x24d2eb){if(_0x24d2eb){return _0x24d2eb[_0x7976('0x25')](_0x772a40)[_0x7976('0x26')](function(_0x12a1ec){return _0x12a1ec;});}return null;};}function removeEntity(_0x7a2e18,_0x51fd90){return function(_0x12cf8f){if(_0x12cf8f){return _0x12cf8f[_0x7976('0x27')]()['then'](function(){_0x7a2e18[_0x7976('0x1b')](0xcc)[_0x7976('0x1c')]();});}};}function handleEntityNotFound(_0x38cc2d,_0x54dd43){return function(_0x475eab){if(!_0x475eab){_0x38cc2d['sendStatus'](0x194);}return _0x475eab;};}function handleError(_0x57abc2,_0xe4dcf3){_0xe4dcf3=_0xe4dcf3||0x1f4;return function(_0x475d57){logger['error'](_0x475d57['stack']);if(_0x475d57[_0x7976('0x28')]){delete _0x475d57[_0x7976('0x28')];}_0x57abc2[_0x7976('0x1b')](_0xe4dcf3)[_0x7976('0x29')](_0x475d57);};}exports[_0x7976('0x2a')]=function(_0x3a30e3,_0xcbc419){var _0x4fb1b5={},_0x1a095f={},_0x397742={'count':0x0,'rows':[]};var _0x477306=_[_0x7976('0x2b')](db[_0x7976('0x2c')]['rawAttributes'],function(_0x18a947){return{'name':_0x18a947['fieldName'],'type':_0x18a947[_0x7976('0x2d')]['key']};});_0x1a095f['model']=_[_0x7976('0x2b')](_0x477306,'name');_0x1a095f[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0x3a30e3[_0x7976('0x2e')]);_0x1a095f[_0x7976('0x30')]=_[_0x7976('0x31')](_0x1a095f[_0x7976('0x32')],_0x1a095f[_0x7976('0x2e')]);_0x4fb1b5[_0x7976('0x33')]=_[_0x7976('0x31')](_0x1a095f['model'],qs[_0x7976('0x34')](_0x3a30e3[_0x7976('0x2e')][_0x7976('0x34')]));_0x4fb1b5[_0x7976('0x33')]=_0x4fb1b5[_0x7976('0x33')][_0x7976('0x35')]?_0x4fb1b5[_0x7976('0x33')]:_0x1a095f[_0x7976('0x32')];if(!_0x3a30e3[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x4fb1b5['limit']=qs['limit'](_0x3a30e3['query']['limit']);_0x4fb1b5[_0x7976('0x21')]=qs[_0x7976('0x21')](_0x3a30e3[_0x7976('0x2e')][_0x7976('0x21')]);}_0x4fb1b5[_0x7976('0x38')]=qs[_0x7976('0x39')](_0x3a30e3[_0x7976('0x2e')][_0x7976('0x39')]);_0x4fb1b5[_0x7976('0x3a')]=qs[_0x7976('0x30')](_[_0x7976('0x3b')](_0x3a30e3[_0x7976('0x2e')],_0x1a095f['filters']),_0x477306);if(_0x3a30e3[_0x7976('0x2e')]['filter']){_0x4fb1b5['where']=_['merge'](_0x4fb1b5[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x477306,function(_0x29a5f1){if(_0x29a5f1[_0x7976('0x2d')]!==_0x7976('0x3c')){var _0x4ae8ba={};_0x4ae8ba[_0x29a5f1[_0x7976('0x28')]]={'$like':'%'+_0x3a30e3[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0x4ae8ba;}})});}_0x4fb1b5=_[_0x7976('0x3e')]({},_0x4fb1b5,_0x3a30e3['options']);var _0x108199={'where':_0x4fb1b5[_0x7976('0x3a')]};return db[_0x7976('0x2c')]['count'](_0x108199)[_0x7976('0x26')](function(_0x44f084){_0x397742['count']=_0x44f084;if(_0x3a30e3[_0x7976('0x2e')][_0x7976('0x3f')]){_0x4fb1b5['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x4fb1b5);})[_0x7976('0x26')](function(_0x58de77){_0x397742[_0x7976('0x40')]=_0x58de77;return _0x397742;})[_0x7976('0x26')](respondWithFilteredResult(_0xcbc419,_0x4fb1b5))[_0x7976('0x41')](handleError(_0xcbc419,null));};exports['show']=function(_0x18ebd4,_0x3eca58){var _0x2f4196={'raw':![],'where':{'id':_0x18ebd4['params']['id']}},_0x16e705={};_0x16e705[_0x7976('0x32')]=_[_0x7976('0x2f')](db[_0x7976('0x2c')][_0x7976('0x42')]);_0x16e705['query']=_[_0x7976('0x2f')](_0x18ebd4[_0x7976('0x2e')]);_0x16e705[_0x7976('0x30')]=_[_0x7976('0x31')](_0x16e705[_0x7976('0x32')],_0x16e705[_0x7976('0x2e')]);_0x2f4196[_0x7976('0x33')]=_[_0x7976('0x31')](_0x16e705[_0x7976('0x32')],qs[_0x7976('0x34')](_0x18ebd4[_0x7976('0x2e')][_0x7976('0x34')]));_0x2f4196[_0x7976('0x33')]=_0x2f4196[_0x7976('0x33')][_0x7976('0x35')]?_0x2f4196['attributes']:_0x16e705[_0x7976('0x32')];if(_0x18ebd4[_0x7976('0x2e')][_0x7976('0x3f')]){_0x2f4196[_0x7976('0x43')]=[{'all':!![]}];}_0x2f4196=_[_0x7976('0x3e')]({},_0x2f4196,_0x18ebd4[_0x7976('0x44')]);return db['ZendeskConfiguration'][_0x7976('0x45')](_0x2f4196)['then'](handleEntityNotFound(_0x3eca58,null))['then'](respondWithResult(_0x3eca58,null))[_0x7976('0x41')](handleError(_0x3eca58,null));};exports[_0x7976('0x46')]=function(_0x4a34df,_0xdcc7cc){return db['ZendeskConfiguration'][_0x7976('0x46')](_0x4a34df[_0x7976('0x47')],{})[_0x7976('0x26')](respondWithResult(_0xdcc7cc,0xc9))[_0x7976('0x41')](handleError(_0xdcc7cc,null));};exports[_0x7976('0x25')]=function(_0x18bf19,_0x103653){if(_0x18bf19[_0x7976('0x47')]['id']){delete _0x18bf19[_0x7976('0x47')]['id'];}return db[_0x7976('0x2c')][_0x7976('0x45')]({'where':{'id':_0x18bf19[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x103653,null))[_0x7976('0x26')](saveUpdates(_0x18bf19[_0x7976('0x47')],null))[_0x7976('0x26')](respondWithResult(_0x103653,null))['catch'](handleError(_0x103653,null));};exports[_0x7976('0x27')]=function(_0x1115e2,_0x47db88){return db[_0x7976('0x2c')][_0x7976('0x45')]({'where':{'id':_0x1115e2[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x47db88,null))[_0x7976('0x26')](removeEntity(_0x47db88,null))[_0x7976('0x41')](handleError(_0x47db88,null));};exports[_0x7976('0x49')]=function(_0xf82c01,_0x564e1f,_0x1ad1e6){var _0x1cd873={};var _0x312f6a={};var _0x1e5bd9;var _0x2b5809;return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0xf82c01[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x564e1f,null))[_0x7976('0x26')](function(_0x5a0e92){if(_0x5a0e92){_0x1e5bd9=_0x5a0e92;_0x312f6a[_0x7976('0x32')]=_['keys'](db[_0x7976('0x4b')][_0x7976('0x42')]);_0x312f6a[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0xf82c01[_0x7976('0x2e')]);_0x312f6a['filters']=_['intersection'](_0x312f6a[_0x7976('0x32')],_0x312f6a['query']);_0x1cd873[_0x7976('0x33')]=_['intersection'](_0x312f6a[_0x7976('0x32')],qs[_0x7976('0x34')](_0xf82c01[_0x7976('0x2e')]['fields']));_0x1cd873['attributes']=_0x1cd873['attributes']['length']?_0x1cd873[_0x7976('0x33')]:_0x312f6a[_0x7976('0x32')];_0x1cd873['order']=qs[_0x7976('0x39')](_0xf82c01[_0x7976('0x2e')][_0x7976('0x39')]);_0x1cd873[_0x7976('0x3a')]=qs[_0x7976('0x30')](_[_0x7976('0x3b')](_0xf82c01[_0x7976('0x2e')],_0x312f6a['filters']));if(_0xf82c01['query'][_0x7976('0x3d')]){_0x1cd873['where']=_[_0x7976('0x3e')](_0x1cd873[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x1cd873[_0x7976('0x33')],function(_0x423c64){var _0x33f322={};_0x33f322[_0x423c64]={'$like':'%'+_0xf82c01[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0x33f322;})});}_0x1cd873=_['merge']({},_0x1cd873,_0xf82c01[_0x7976('0x44')]);return _0x1e5bd9['getFields'](_0x1cd873);}})[_0x7976('0x26')](function(_0xfcb69a){if(_0xfcb69a){_0x2b5809=_0xfcb69a[_0x7976('0x35')];if(!_0xf82c01['query'][_0x7976('0x36')](_0x7976('0x37'))){_0x1cd873[_0x7976('0x1f')]=qs[_0x7976('0x1f')](_0xf82c01[_0x7976('0x2e')][_0x7976('0x1f')]);_0x1cd873['offset']=qs[_0x7976('0x21')](_0xf82c01[_0x7976('0x2e')][_0x7976('0x21')]);}return _0x1e5bd9[_0x7976('0x49')](_0x1cd873);}})[_0x7976('0x26')](function(_0x50feb9){if(_0x50feb9){return _0x50feb9?{'count':_0x2b5809,'rows':_0x50feb9}:null;}})['then'](respondWithResult(_0x564e1f,null))[_0x7976('0x41')](handleError(_0x564e1f,null));};exports[_0x7976('0x4c')]=function(_0x4811c2,_0x39ab0b,_0x3589c0){var _0x377a46={};var _0x2fa4a0={};var _0x5435b3;var _0xdbe26d;return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0x4811c2[_0x7976('0x48')]['id']}})['then'](handleEntityNotFound(_0x39ab0b,null))[_0x7976('0x26')](function(_0x2a57ea){if(_0x2a57ea){_0x5435b3=_0x2a57ea;_0x2fa4a0[_0x7976('0x32')]=_[_0x7976('0x2f')](db[_0x7976('0x4b')][_0x7976('0x42')]);_0x2fa4a0['query']=_[_0x7976('0x2f')](_0x4811c2['query']);_0x2fa4a0[_0x7976('0x30')]=_[_0x7976('0x31')](_0x2fa4a0[_0x7976('0x32')],_0x2fa4a0['query']);_0x377a46['attributes']=_[_0x7976('0x31')](_0x2fa4a0[_0x7976('0x32')],qs[_0x7976('0x34')](_0x4811c2['query'][_0x7976('0x34')]));_0x377a46['attributes']=_0x377a46[_0x7976('0x33')][_0x7976('0x35')]?_0x377a46['attributes']:_0x2fa4a0[_0x7976('0x32')];_0x377a46[_0x7976('0x38')]=qs[_0x7976('0x39')](_0x4811c2[_0x7976('0x2e')][_0x7976('0x39')]);_0x377a46[_0x7976('0x3a')]=qs['filters'](_['pick'](_0x4811c2[_0x7976('0x2e')],_0x2fa4a0[_0x7976('0x30')]));if(_0x4811c2[_0x7976('0x2e')][_0x7976('0x3d')]){_0x377a46[_0x7976('0x3a')]=_[_0x7976('0x3e')](_0x377a46[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x377a46['attributes'],function(_0x2c523d){var _0xe7468f={};_0xe7468f[_0x2c523d]={'$like':'%'+_0x4811c2[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0xe7468f;})});}_0x377a46=_['merge']({},_0x377a46,_0x4811c2[_0x7976('0x44')]);return _0x5435b3[_0x7976('0x4c')](_0x377a46);}})[_0x7976('0x26')](function(_0x2c41d7){if(_0x2c41d7){_0xdbe26d=_0x2c41d7[_0x7976('0x35')];if(!_0x4811c2[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x377a46[_0x7976('0x1f')]=qs['limit'](_0x4811c2[_0x7976('0x2e')][_0x7976('0x1f')]);_0x377a46[_0x7976('0x21')]=qs[_0x7976('0x21')](_0x4811c2['query'][_0x7976('0x21')]);}return _0x5435b3['getSubjects'](_0x377a46);}})[_0x7976('0x26')](function(_0x3d6421){if(_0x3d6421){return _0x3d6421?{'count':_0xdbe26d,'rows':_0x3d6421}:null;}})[_0x7976('0x26')](respondWithResult(_0x39ab0b,null))[_0x7976('0x41')](handleError(_0x39ab0b,null));};exports['getDescriptions']=function(_0xee8fda,_0x56d5bb,_0x5add9d){var _0x207ae8={};var _0x5b6043={};var _0x42f900;var _0x2e671e;return db[_0x7976('0x2c')]['findOne']({'where':{'id':_0xee8fda['params']['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x56d5bb,null))[_0x7976('0x26')](function(_0x2a6d68){if(_0x2a6d68){_0x42f900=_0x2a6d68;_0x5b6043['model']=_['keys'](db['ZendeskField'][_0x7976('0x42')]);_0x5b6043[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0xee8fda[_0x7976('0x2e')]);_0x5b6043[_0x7976('0x30')]=_[_0x7976('0x31')](_0x5b6043[_0x7976('0x32')],_0x5b6043[_0x7976('0x2e')]);_0x207ae8['attributes']=_[_0x7976('0x31')](_0x5b6043['model'],qs['fields'](_0xee8fda[_0x7976('0x2e')][_0x7976('0x34')]));_0x207ae8['attributes']=_0x207ae8[_0x7976('0x33')][_0x7976('0x35')]?_0x207ae8[_0x7976('0x33')]:_0x5b6043[_0x7976('0x32')];_0x207ae8[_0x7976('0x38')]=qs[_0x7976('0x39')](_0xee8fda[_0x7976('0x2e')][_0x7976('0x39')]);_0x207ae8[_0x7976('0x3a')]=qs['filters'](_[_0x7976('0x3b')](_0xee8fda['query'],_0x5b6043['filters']));if(_0xee8fda[_0x7976('0x2e')][_0x7976('0x3d')]){_0x207ae8['where']=_['merge'](_0x207ae8[_0x7976('0x3a')],{'$or':_['map'](_0x207ae8[_0x7976('0x33')],function(_0x1c448f){var _0x3b3f99={};_0x3b3f99[_0x1c448f]={'$like':'%'+_0xee8fda[_0x7976('0x2e')]['filter']+'%'};return _0x3b3f99;})});}_0x207ae8=_[_0x7976('0x3e')]({},_0x207ae8,_0xee8fda[_0x7976('0x44')]);return _0x42f900[_0x7976('0x4d')](_0x207ae8);}})[_0x7976('0x26')](function(_0x462858){if(_0x462858){_0x2e671e=_0x462858[_0x7976('0x35')];if(!_0xee8fda[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x207ae8['limit']=qs[_0x7976('0x1f')](_0xee8fda[_0x7976('0x2e')][_0x7976('0x1f')]);_0x207ae8[_0x7976('0x21')]=qs['offset'](_0xee8fda[_0x7976('0x2e')][_0x7976('0x21')]);}return _0x42f900[_0x7976('0x4d')](_0x207ae8);}})[_0x7976('0x26')](function(_0x47291c){if(_0x47291c){return _0x47291c?{'count':_0x2e671e,'rows':_0x47291c}:null;}})[_0x7976('0x26')](respondWithResult(_0x56d5bb,null))['catch'](handleError(_0x56d5bb,null));};exports['getTags']=function(_0x3281ff,_0x2ab568,_0x3a5c57){var _0x3acb5e={};var _0x53593f={};var _0x136808;var _0x2d3907;return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0x3281ff[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x2ab568,null))['then'](function(_0x371462){if(_0x371462){_0x136808=_0x371462;_0x53593f[_0x7976('0x32')]=_[_0x7976('0x2f')](db[_0x7976('0x4e')][_0x7976('0x42')]);_0x53593f[_0x7976('0x2e')]=_[_0x7976('0x2f')](_0x3281ff[_0x7976('0x2e')]);_0x53593f[_0x7976('0x30')]=_[_0x7976('0x31')](_0x53593f[_0x7976('0x32')],_0x53593f['query']);_0x3acb5e[_0x7976('0x33')]=_['intersection'](_0x53593f[_0x7976('0x32')],qs[_0x7976('0x34')](_0x3281ff[_0x7976('0x2e')][_0x7976('0x34')]));_0x3acb5e[_0x7976('0x33')]=_0x3acb5e[_0x7976('0x33')][_0x7976('0x35')]?_0x3acb5e[_0x7976('0x33')]:_0x53593f[_0x7976('0x32')];_0x3acb5e['order']=qs[_0x7976('0x39')](_0x3281ff[_0x7976('0x2e')]['sort']);_0x3acb5e['where']=qs['filters'](_[_0x7976('0x3b')](_0x3281ff[_0x7976('0x2e')],_0x53593f[_0x7976('0x30')]));if(_0x3281ff[_0x7976('0x2e')]['filter']){_0x3acb5e[_0x7976('0x3a')]=_[_0x7976('0x3e')](_0x3acb5e[_0x7976('0x3a')],{'$or':_[_0x7976('0x2b')](_0x3acb5e['attributes'],function(_0xd0e3fe){var _0x423f2b={};_0x423f2b[_0xd0e3fe]={'$like':'%'+_0x3281ff[_0x7976('0x2e')][_0x7976('0x3d')]+'%'};return _0x423f2b;})});}_0x3acb5e=_[_0x7976('0x3e')]({},_0x3acb5e,_0x3281ff['options']);return _0x136808[_0x7976('0x4f')](_0x3acb5e);}})['then'](function(_0x5c410f){if(_0x5c410f){_0x2d3907=_0x5c410f[_0x7976('0x35')];if(!_0x3281ff[_0x7976('0x2e')][_0x7976('0x36')](_0x7976('0x37'))){_0x3acb5e[_0x7976('0x1f')]=qs[_0x7976('0x1f')](_0x3281ff[_0x7976('0x2e')][_0x7976('0x1f')]);_0x3acb5e[_0x7976('0x21')]=qs[_0x7976('0x21')](_0x3281ff[_0x7976('0x2e')][_0x7976('0x21')]);}return _0x136808[_0x7976('0x4f')](_0x3acb5e);}})[_0x7976('0x26')](function(_0x6866){if(_0x6866){return _0x6866?{'count':_0x2d3907,'rows':_0x6866}:null;}})[_0x7976('0x26')](respondWithResult(_0x2ab568,null))[_0x7976('0x41')](handleError(_0x2ab568,null));};exports['setTags']=function(_0x343d5d,_0x112f76,_0x4a4914){if(_0x343d5d[_0x7976('0x47')]['id']){delete _0x343d5d[_0x7976('0x47')]['id'];}return db['ZendeskConfiguration'][_0x7976('0x4a')]({'where':{'id':_0x343d5d[_0x7976('0x48')]['id']}})[_0x7976('0x26')](handleEntityNotFound(_0x112f76,null))[_0x7976('0x26')](function(_0x4f0a49){if(_0x4f0a49){return _0x4f0a49[_0x7976('0x50')](_0x343d5d[_0x7976('0x47')][_0x7976('0x51')]||[]);}return null;})[_0x7976('0x26')](respondWithResult(_0x112f76,null))[_0x7976('0x41')](handleError(_0x112f76,null));}; \ No newline at end of file +var _0xcbfc=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xcbfc,0xa2));var _0xccbf=function(_0x5ecdb5,_0x1f71b6){_0x5ecdb5=_0x5ecdb5-0x0;var _0x441680=_0xcbfc[_0x5ecdb5];return _0x441680;};'use strict';var emlformat=require(_0xccbf('0x0'));var rimraf=require(_0xccbf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccbf('0x2'));var rp=require(_0xccbf('0x3'));var moment=require(_0xccbf('0x4'));var BPromise=require(_0xccbf('0x5'));var Mustache=require(_0xccbf('0x6'));var util=require(_0xccbf('0x7'));var path=require(_0xccbf('0x8'));var sox=require('sox');var csv=require(_0xccbf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccbf('0xa'));var _=require(_0xccbf('0xb'));var squel=require(_0xccbf('0xc'));var crypto=require(_0xccbf('0xd'));var jsforce=require(_0xccbf('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xccbf('0xf'));var Papa=require(_0xccbf('0x10'));var Redis=require(_0xccbf('0x11'));var authService=require(_0xccbf('0x12'));var qs=require(_0xccbf('0x13'));var as=require(_0xccbf('0x14'));var hardwareService=require(_0xccbf('0x15'));var logger=require(_0xccbf('0x16'))(_0xccbf('0x17'));var utils=require(_0xccbf('0x18'));var config=require(_0xccbf('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xccbf('0x1a'))['db'];function respondWithStatusCode(_0x523f6f,_0x50b132){_0x50b132=_0x50b132||0xcc;return function(_0x1d9b46){if(_0x1d9b46){return _0x523f6f[_0xccbf('0x1b')](_0x50b132);}return _0x523f6f[_0xccbf('0x1c')](_0x50b132)[_0xccbf('0x1d')]();};}function respondWithResult(_0x24b2ed,_0x3375f9){_0x3375f9=_0x3375f9||0xc8;return function(_0x2eff44){if(_0x2eff44){return _0x24b2ed['status'](_0x3375f9)[_0xccbf('0x1e')](_0x2eff44);}};}function respondWithFilteredResult(_0x59d473,_0x5edc26){return function(_0x3a7b5e){if(_0x3a7b5e){var _0x655c85=typeof _0x5edc26['offset']===_0xccbf('0x1f')&&typeof _0x5edc26[_0xccbf('0x20')]===_0xccbf('0x1f');var _0x5c6442=_0x3a7b5e[_0xccbf('0x21')];var _0x276aab=_0x655c85?0x0:_0x5edc26[_0xccbf('0x22')];var _0x4a9ce8=_0x655c85?_0x3a7b5e[_0xccbf('0x21')]:_0x5edc26[_0xccbf('0x22')]+_0x5edc26[_0xccbf('0x20')];var _0x808d66;if(_0x4a9ce8>=_0x5c6442){_0x4a9ce8=_0x5c6442;_0x808d66=0xc8;}else{_0x808d66=0xce;}_0x59d473[_0xccbf('0x1c')](_0x808d66);return _0x59d473['set'](_0xccbf('0x23'),_0x276aab+'-'+_0x4a9ce8+'/'+_0x5c6442)['json'](_0x3a7b5e);}return null;};}function patchUpdates(_0x1b3b33){return function(_0x4d6d4d){try{jsonpatch[_0xccbf('0x24')](_0x4d6d4d,_0x1b3b33,!![]);}catch(_0x148d70){return BPromise[_0xccbf('0x25')](_0x148d70);}return _0x4d6d4d[_0xccbf('0x26')]();};}function saveUpdates(_0x3782e0,_0x405bac){return function(_0x229eca){if(_0x229eca){return _0x229eca[_0xccbf('0x27')](_0x3782e0)[_0xccbf('0x28')](function(_0x19b257){return _0x19b257;});}return null;};}function removeEntity(_0x4b92d7,_0x5738c2){return function(_0x1bb8bd){if(_0x1bb8bd){return _0x1bb8bd['destroy']()[_0xccbf('0x28')](function(){_0x4b92d7[_0xccbf('0x1c')](0xcc)[_0xccbf('0x1d')]();});}};}function handleEntityNotFound(_0x56d546,_0x2688ed){return function(_0x5d3f37){if(!_0x5d3f37){_0x56d546[_0xccbf('0x1b')](0x194);}return _0x5d3f37;};}function handleError(_0x48674a,_0x1d77d7){_0x1d77d7=_0x1d77d7||0x1f4;return function(_0x2ad816){logger[_0xccbf('0x29')](_0x2ad816[_0xccbf('0x2a')]);if(_0x2ad816['name']){delete _0x2ad816[_0xccbf('0x2b')];}_0x48674a[_0xccbf('0x1c')](_0x1d77d7)[_0xccbf('0x2c')](_0x2ad816);};}exports['index']=function(_0x26514e,_0x4d9448){var _0x51d1ec={},_0x3b438f={},_0x1f5cc9={'count':0x0,'rows':[]};var _0x7b7ed3=_[_0xccbf('0x2d')](db[_0xccbf('0x2e')][_0xccbf('0x2f')],function(_0x4a4423){return{'name':_0x4a4423[_0xccbf('0x30')],'type':_0x4a4423[_0xccbf('0x31')][_0xccbf('0x32')]};});_0x3b438f[_0xccbf('0x33')]=_[_0xccbf('0x2d')](_0x7b7ed3,'name');_0x3b438f[_0xccbf('0x34')]=_[_0xccbf('0x35')](_0x26514e[_0xccbf('0x34')]);_0x3b438f[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x3b438f[_0xccbf('0x33')],_0x3b438f[_0xccbf('0x34')]);_0x51d1ec['attributes']=_[_0xccbf('0x37')](_0x3b438f['model'],qs[_0xccbf('0x38')](_0x26514e[_0xccbf('0x34')]['fields']));_0x51d1ec[_0xccbf('0x39')]=_0x51d1ec[_0xccbf('0x39')][_0xccbf('0x3a')]?_0x51d1ec[_0xccbf('0x39')]:_0x3b438f[_0xccbf('0x33')];if(!_0x26514e[_0xccbf('0x34')][_0xccbf('0x3b')](_0xccbf('0x3c'))){_0x51d1ec[_0xccbf('0x20')]=qs['limit'](_0x26514e[_0xccbf('0x34')]['limit']);_0x51d1ec[_0xccbf('0x22')]=qs['offset'](_0x26514e[_0xccbf('0x34')][_0xccbf('0x22')]);}_0x51d1ec[_0xccbf('0x3d')]=qs[_0xccbf('0x3e')](_0x26514e[_0xccbf('0x34')]['sort']);_0x51d1ec[_0xccbf('0x3f')]=qs[_0xccbf('0x36')](_[_0xccbf('0x40')](_0x26514e[_0xccbf('0x34')],_0x3b438f['filters']),_0x7b7ed3);if(_0x26514e[_0xccbf('0x34')]['filter']){_0x51d1ec['where']=_[_0xccbf('0x41')](_0x51d1ec[_0xccbf('0x3f')],{'$or':_[_0xccbf('0x2d')](_0x7b7ed3,function(_0x64a01d){if(_0x64a01d[_0xccbf('0x31')]!==_0xccbf('0x42')){var _0x2e0537={};_0x2e0537[_0x64a01d[_0xccbf('0x2b')]]={'$like':'%'+_0x26514e[_0xccbf('0x34')][_0xccbf('0x43')]+'%'};return _0x2e0537;}})});}_0x51d1ec=_[_0xccbf('0x41')]({},_0x51d1ec,_0x26514e[_0xccbf('0x44')]);var _0x5e64c4={'where':_0x51d1ec['where']};return db['ZendeskConfiguration'][_0xccbf('0x21')](_0x5e64c4)[_0xccbf('0x28')](function(_0x11dcd5){_0x1f5cc9['count']=_0x11dcd5;if(_0x26514e[_0xccbf('0x34')][_0xccbf('0x45')]){_0x51d1ec[_0xccbf('0x46')]=[{'all':!![]}];}return db[_0xccbf('0x2e')]['findAll'](_0x51d1ec);})[_0xccbf('0x28')](function(_0xca2f72){_0x1f5cc9[_0xccbf('0x47')]=_0xca2f72;return _0x1f5cc9;})[_0xccbf('0x28')](respondWithFilteredResult(_0x4d9448,_0x51d1ec))[_0xccbf('0x48')](handleError(_0x4d9448,null));};exports[_0xccbf('0x49')]=function(_0x2a6248,_0x292ee9){var _0x3370fd={'raw':![],'where':{'id':_0x2a6248[_0xccbf('0x4a')]['id']}},_0x8c1b2c={};_0x8c1b2c['model']=_[_0xccbf('0x35')](db[_0xccbf('0x2e')][_0xccbf('0x2f')]);_0x8c1b2c[_0xccbf('0x34')]=_['keys'](_0x2a6248['query']);_0x8c1b2c['filters']=_[_0xccbf('0x37')](_0x8c1b2c[_0xccbf('0x33')],_0x8c1b2c[_0xccbf('0x34')]);_0x3370fd[_0xccbf('0x39')]=_[_0xccbf('0x37')](_0x8c1b2c[_0xccbf('0x33')],qs[_0xccbf('0x38')](_0x2a6248[_0xccbf('0x34')][_0xccbf('0x38')]));_0x3370fd['attributes']=_0x3370fd[_0xccbf('0x39')][_0xccbf('0x3a')]?_0x3370fd['attributes']:_0x8c1b2c['model'];if(_0x2a6248[_0xccbf('0x34')][_0xccbf('0x45')]){_0x3370fd['include']=[{'all':!![]}];}_0x3370fd=_['merge']({},_0x3370fd,_0x2a6248[_0xccbf('0x44')]);return db[_0xccbf('0x2e')][_0xccbf('0x4b')](_0x3370fd)[_0xccbf('0x28')](handleEntityNotFound(_0x292ee9,null))[_0xccbf('0x28')](respondWithResult(_0x292ee9,null))[_0xccbf('0x48')](handleError(_0x292ee9,null));};exports[_0xccbf('0x4c')]=function(_0xf634bf,_0x6132c5){return db[_0xccbf('0x2e')][_0xccbf('0x4c')](_0xf634bf[_0xccbf('0x4d')],{})[_0xccbf('0x28')](respondWithResult(_0x6132c5,0xc9))['catch'](handleError(_0x6132c5,null));};exports[_0xccbf('0x27')]=function(_0x2eaa8b,_0x5395b9){if(_0x2eaa8b[_0xccbf('0x4d')]['id']){delete _0x2eaa8b[_0xccbf('0x4d')]['id'];}return db[_0xccbf('0x2e')][_0xccbf('0x4b')]({'where':{'id':_0x2eaa8b[_0xccbf('0x4a')]['id']}})[_0xccbf('0x28')](handleEntityNotFound(_0x5395b9,null))[_0xccbf('0x28')](saveUpdates(_0x2eaa8b['body'],null))[_0xccbf('0x28')](respondWithResult(_0x5395b9,null))['catch'](handleError(_0x5395b9,null));};exports[_0xccbf('0x4e')]=function(_0x30ff57,_0x2d3e0a){return db[_0xccbf('0x2e')][_0xccbf('0x4b')]({'where':{'id':_0x30ff57[_0xccbf('0x4a')]['id']}})[_0xccbf('0x28')](handleEntityNotFound(_0x2d3e0a,null))['then'](removeEntity(_0x2d3e0a,null))['catch'](handleError(_0x2d3e0a,null));};exports['getFields']=function(_0x32d72c,_0x5955e1,_0x1c7ef2){var _0x5ccd8a={};var _0x2fb14a={};var _0x1f5c62;var _0x46361a;return db[_0xccbf('0x2e')][_0xccbf('0x4f')]({'where':{'id':_0x32d72c[_0xccbf('0x4a')]['id']}})[_0xccbf('0x28')](handleEntityNotFound(_0x5955e1,null))[_0xccbf('0x28')](function(_0x2c87bd){if(_0x2c87bd){_0x1f5c62=_0x2c87bd;_0x2fb14a[_0xccbf('0x33')]=_[_0xccbf('0x35')](db[_0xccbf('0x50')]['rawAttributes']);_0x2fb14a[_0xccbf('0x34')]=_[_0xccbf('0x35')](_0x32d72c['query']);_0x2fb14a[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x2fb14a[_0xccbf('0x33')],_0x2fb14a[_0xccbf('0x34')]);_0x5ccd8a['attributes']=_['intersection'](_0x2fb14a[_0xccbf('0x33')],qs[_0xccbf('0x38')](_0x32d72c[_0xccbf('0x34')]['fields']));_0x5ccd8a[_0xccbf('0x39')]=_0x5ccd8a[_0xccbf('0x39')]['length']?_0x5ccd8a['attributes']:_0x2fb14a[_0xccbf('0x33')];_0x5ccd8a[_0xccbf('0x3d')]=qs[_0xccbf('0x3e')](_0x32d72c[_0xccbf('0x34')][_0xccbf('0x3e')]);_0x5ccd8a['where']=qs[_0xccbf('0x36')](_[_0xccbf('0x40')](_0x32d72c[_0xccbf('0x34')],_0x2fb14a[_0xccbf('0x36')]));if(_0x32d72c['query']['filter']){_0x5ccd8a[_0xccbf('0x3f')]=_[_0xccbf('0x41')](_0x5ccd8a['where'],{'$or':_['map'](_0x5ccd8a['attributes'],function(_0x2694e9){var _0x452017={};_0x452017[_0x2694e9]={'$like':'%'+_0x32d72c['query'][_0xccbf('0x43')]+'%'};return _0x452017;})});}_0x5ccd8a=_[_0xccbf('0x41')]({},_0x5ccd8a,_0x32d72c[_0xccbf('0x44')]);return _0x1f5c62['getFields'](_0x5ccd8a);}})[_0xccbf('0x28')](function(_0x249667){if(_0x249667){_0x46361a=_0x249667[_0xccbf('0x3a')];if(!_0x32d72c[_0xccbf('0x34')][_0xccbf('0x3b')](_0xccbf('0x3c'))){_0x5ccd8a[_0xccbf('0x20')]=qs[_0xccbf('0x20')](_0x32d72c[_0xccbf('0x34')][_0xccbf('0x20')]);_0x5ccd8a[_0xccbf('0x22')]=qs['offset'](_0x32d72c[_0xccbf('0x34')][_0xccbf('0x22')]);}return _0x1f5c62[_0xccbf('0x51')](_0x5ccd8a);}})[_0xccbf('0x28')](function(_0x2fb0f2){if(_0x2fb0f2){return _0x2fb0f2?{'count':_0x46361a,'rows':_0x2fb0f2}:null;}})['then'](respondWithResult(_0x5955e1,null))[_0xccbf('0x48')](handleError(_0x5955e1,null));};exports[_0xccbf('0x52')]=function(_0x126c51,_0x12da64,_0x1e69cf){var _0xa871db={};var _0x5a4a78={};var _0xd4fc4d;var _0x352d5d;return db[_0xccbf('0x2e')][_0xccbf('0x4f')]({'where':{'id':_0x126c51[_0xccbf('0x4a')]['id']}})[_0xccbf('0x28')](handleEntityNotFound(_0x12da64,null))[_0xccbf('0x28')](function(_0x43504f){if(_0x43504f){_0xd4fc4d=_0x43504f;_0x5a4a78[_0xccbf('0x33')]=_['keys'](db['ZendeskField'][_0xccbf('0x2f')]);_0x5a4a78['query']=_[_0xccbf('0x35')](_0x126c51[_0xccbf('0x34')]);_0x5a4a78[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x5a4a78[_0xccbf('0x33')],_0x5a4a78['query']);_0xa871db['attributes']=_[_0xccbf('0x37')](_0x5a4a78['model'],qs[_0xccbf('0x38')](_0x126c51[_0xccbf('0x34')]['fields']));_0xa871db[_0xccbf('0x39')]=_0xa871db['attributes'][_0xccbf('0x3a')]?_0xa871db['attributes']:_0x5a4a78[_0xccbf('0x33')];_0xa871db[_0xccbf('0x3d')]=qs[_0xccbf('0x3e')](_0x126c51[_0xccbf('0x34')][_0xccbf('0x3e')]);_0xa871db['where']=qs[_0xccbf('0x36')](_[_0xccbf('0x40')](_0x126c51['query'],_0x5a4a78[_0xccbf('0x36')]));if(_0x126c51['query'][_0xccbf('0x43')]){_0xa871db[_0xccbf('0x3f')]=_[_0xccbf('0x41')](_0xa871db['where'],{'$or':_[_0xccbf('0x2d')](_0xa871db[_0xccbf('0x39')],function(_0x27cec4){var _0x124004={};_0x124004[_0x27cec4]={'$like':'%'+_0x126c51['query'][_0xccbf('0x43')]+'%'};return _0x124004;})});}_0xa871db=_[_0xccbf('0x41')]({},_0xa871db,_0x126c51[_0xccbf('0x44')]);return _0xd4fc4d[_0xccbf('0x52')](_0xa871db);}})[_0xccbf('0x28')](function(_0x4e5d91){if(_0x4e5d91){_0x352d5d=_0x4e5d91['length'];if(!_0x126c51[_0xccbf('0x34')][_0xccbf('0x3b')](_0xccbf('0x3c'))){_0xa871db[_0xccbf('0x20')]=qs[_0xccbf('0x20')](_0x126c51['query'][_0xccbf('0x20')]);_0xa871db[_0xccbf('0x22')]=qs[_0xccbf('0x22')](_0x126c51[_0xccbf('0x34')][_0xccbf('0x22')]);}return _0xd4fc4d[_0xccbf('0x52')](_0xa871db);}})['then'](function(_0x449e84){if(_0x449e84){return _0x449e84?{'count':_0x352d5d,'rows':_0x449e84}:null;}})[_0xccbf('0x28')](respondWithResult(_0x12da64,null))[_0xccbf('0x48')](handleError(_0x12da64,null));};exports[_0xccbf('0x53')]=function(_0x2031c8,_0x4d99b5,_0x12b203){var _0x55f891={};var _0x550f1d={};var _0x37803d;var _0x1b8869;return db[_0xccbf('0x2e')][_0xccbf('0x4f')]({'where':{'id':_0x2031c8[_0xccbf('0x4a')]['id']}})[_0xccbf('0x28')](handleEntityNotFound(_0x4d99b5,null))[_0xccbf('0x28')](function(_0x3b1767){if(_0x3b1767){_0x37803d=_0x3b1767;_0x550f1d[_0xccbf('0x33')]=_['keys'](db[_0xccbf('0x50')][_0xccbf('0x2f')]);_0x550f1d[_0xccbf('0x34')]=_[_0xccbf('0x35')](_0x2031c8[_0xccbf('0x34')]);_0x550f1d[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x550f1d[_0xccbf('0x33')],_0x550f1d['query']);_0x55f891[_0xccbf('0x39')]=_[_0xccbf('0x37')](_0x550f1d['model'],qs[_0xccbf('0x38')](_0x2031c8['query'][_0xccbf('0x38')]));_0x55f891[_0xccbf('0x39')]=_0x55f891[_0xccbf('0x39')]['length']?_0x55f891[_0xccbf('0x39')]:_0x550f1d[_0xccbf('0x33')];_0x55f891[_0xccbf('0x3d')]=qs[_0xccbf('0x3e')](_0x2031c8[_0xccbf('0x34')][_0xccbf('0x3e')]);_0x55f891[_0xccbf('0x3f')]=qs[_0xccbf('0x36')](_[_0xccbf('0x40')](_0x2031c8['query'],_0x550f1d['filters']));if(_0x2031c8[_0xccbf('0x34')][_0xccbf('0x43')]){_0x55f891[_0xccbf('0x3f')]=_[_0xccbf('0x41')](_0x55f891[_0xccbf('0x3f')],{'$or':_[_0xccbf('0x2d')](_0x55f891[_0xccbf('0x39')],function(_0x357945){var _0x4d14f1={};_0x4d14f1[_0x357945]={'$like':'%'+_0x2031c8[_0xccbf('0x34')][_0xccbf('0x43')]+'%'};return _0x4d14f1;})});}_0x55f891=_['merge']({},_0x55f891,_0x2031c8[_0xccbf('0x44')]);return _0x37803d[_0xccbf('0x53')](_0x55f891);}})[_0xccbf('0x28')](function(_0x36e8b5){if(_0x36e8b5){_0x1b8869=_0x36e8b5[_0xccbf('0x3a')];if(!_0x2031c8[_0xccbf('0x34')][_0xccbf('0x3b')](_0xccbf('0x3c'))){_0x55f891[_0xccbf('0x20')]=qs[_0xccbf('0x20')](_0x2031c8['query'][_0xccbf('0x20')]);_0x55f891[_0xccbf('0x22')]=qs[_0xccbf('0x22')](_0x2031c8[_0xccbf('0x34')][_0xccbf('0x22')]);}return _0x37803d['getDescriptions'](_0x55f891);}})[_0xccbf('0x28')](function(_0x1c7dc9){if(_0x1c7dc9){return _0x1c7dc9?{'count':_0x1b8869,'rows':_0x1c7dc9}:null;}})[_0xccbf('0x28')](respondWithResult(_0x4d99b5,null))[_0xccbf('0x48')](handleError(_0x4d99b5,null));};exports[_0xccbf('0x54')]=function(_0x4b94ab,_0x17830c,_0x17e837){var _0x3f8cb5={};var _0x17db71={};var _0x55bdcb;var _0x5a8d7c;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4b94ab[_0xccbf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x17830c,null))[_0xccbf('0x28')](function(_0x2101f3){if(_0x2101f3){_0x55bdcb=_0x2101f3;_0x17db71['model']=_[_0xccbf('0x35')](db[_0xccbf('0x55')][_0xccbf('0x2f')]);_0x17db71['query']=_['keys'](_0x4b94ab[_0xccbf('0x34')]);_0x17db71[_0xccbf('0x36')]=_[_0xccbf('0x37')](_0x17db71[_0xccbf('0x33')],_0x17db71['query']);_0x3f8cb5[_0xccbf('0x39')]=_[_0xccbf('0x37')](_0x17db71[_0xccbf('0x33')],qs['fields'](_0x4b94ab['query']['fields']));_0x3f8cb5[_0xccbf('0x39')]=_0x3f8cb5[_0xccbf('0x39')][_0xccbf('0x3a')]?_0x3f8cb5[_0xccbf('0x39')]:_0x17db71[_0xccbf('0x33')];_0x3f8cb5[_0xccbf('0x3d')]=qs[_0xccbf('0x3e')](_0x4b94ab[_0xccbf('0x34')][_0xccbf('0x3e')]);_0x3f8cb5['where']=qs['filters'](_[_0xccbf('0x40')](_0x4b94ab[_0xccbf('0x34')],_0x17db71['filters']));if(_0x4b94ab[_0xccbf('0x34')]['filter']){_0x3f8cb5[_0xccbf('0x3f')]=_[_0xccbf('0x41')](_0x3f8cb5[_0xccbf('0x3f')],{'$or':_[_0xccbf('0x2d')](_0x3f8cb5[_0xccbf('0x39')],function(_0x7fc598){var _0x597937={};_0x597937[_0x7fc598]={'$like':'%'+_0x4b94ab[_0xccbf('0x34')][_0xccbf('0x43')]+'%'};return _0x597937;})});}_0x3f8cb5=_[_0xccbf('0x41')]({},_0x3f8cb5,_0x4b94ab[_0xccbf('0x44')]);return _0x55bdcb['getTags'](_0x3f8cb5);}})[_0xccbf('0x28')](function(_0x5c9e43){if(_0x5c9e43){_0x5a8d7c=_0x5c9e43[_0xccbf('0x3a')];if(!_0x4b94ab['query'][_0xccbf('0x3b')](_0xccbf('0x3c'))){_0x3f8cb5[_0xccbf('0x20')]=qs[_0xccbf('0x20')](_0x4b94ab['query'][_0xccbf('0x20')]);_0x3f8cb5['offset']=qs[_0xccbf('0x22')](_0x4b94ab['query'][_0xccbf('0x22')]);}return _0x55bdcb[_0xccbf('0x54')](_0x3f8cb5);}})[_0xccbf('0x28')](function(_0x556226){if(_0x556226){return _0x556226?{'count':_0x5a8d7c,'rows':_0x556226}:null;}})['then'](respondWithResult(_0x17830c,null))[_0xccbf('0x48')](handleError(_0x17830c,null));};exports[_0xccbf('0x56')]=function(_0x203412,_0xcad227,_0x5ca711){if(_0x203412['body']['id']){delete _0x203412['body']['id'];}return db[_0xccbf('0x2e')][_0xccbf('0x4f')]({'where':{'id':_0x203412[_0xccbf('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcad227,null))[_0xccbf('0x28')](function(_0x35f071){if(_0x35f071){return _0x35f071[_0xccbf('0x56')](_0x203412[_0xccbf('0x4d')]['ids']||[]);}return null;})[_0xccbf('0x28')](respondWithResult(_0xcad227,null))[_0xccbf('0x48')](handleError(_0xcad227,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ea90c4b..4d0af8a 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 _0x4e81=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x4e81,0x1bc));var _0x14e8=function(_0x29f80e,_0x9027ff){_0x29f80e=_0x29f80e-0x0;var _0x5c7eaa=_0x4e81[_0x29f80e];return _0x5c7eaa;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cf8=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x11fff4,_0x1d8506){var _0x166bb3=function(_0x591e47){while(--_0x591e47){_0x11fff4['push'](_0x11fff4['shift']());}};_0x166bb3(++_0x1d8506);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x1ed034,_0x5d495d){_0x1ed034=_0x1ed034-0x0;var _0x4a82b7=_0x4cf8[_0x1ed034];return _0x4a82b7;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var logger=require(_0x84cf('0x2'))(_0x84cf('0x3'));var moment=require(_0x84cf('0x4'));var BPromise=require(_0x84cf('0x5'));var rp=require(_0x84cf('0x6'));var fs=require('fs');var path=require(_0x84cf('0x7'));var rimraf=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var attributes=require(_0x84cf('0xa'));module[_0x84cf('0xb')]=function(_0x50ade2,_0x4af3f1){return _0x50ade2[_0x84cf('0xc')]('ZendeskConfiguration',attributes,{'tableName':_0x84cf('0xd'),'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 9c74bfd..4bbabf8 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 _0x3465=['randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','util','bluebird'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x3465,0x1c8));var _0x5346=function(_0x40d8ee,_0x122e21){_0x40d8ee=_0x40d8ee-0x0;var _0x5c9d0d=_0x3465[_0x40d8ee];return _0x5c9d0d;};'use strict';var _=require(_0x5346('0x0'));var util=require(_0x5346('0x1'));var moment=require('moment');var BPromise=require(_0x5346('0x2'));var rs=require(_0x5346('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5346('0x4'));var config=require(_0x5346('0x5'));var jayson=require(_0x5346('0x6'));var client=jayson[_0x5346('0x7')][_0x5346('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19fda6,_0x3eb548,_0x3676a7){return new BPromise(function(_0xe92c89,_0xda3c3){return client[_0x5346('0x9')](_0x19fda6,_0x3676a7)[_0x5346('0xa')](function(_0x46c1b1){logger[_0x5346('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3eb548,_0x5346('0xc'));logger['debug'](_0x5346('0xd'),_0x3eb548,_0x5346('0xc'),JSON['stringify'](_0x46c1b1));if(_0x46c1b1[_0x5346('0xe')]){if(_0x46c1b1[_0x5346('0xe')]['code']===0x1f4){logger[_0x5346('0xe')](_0x5346('0xf'),_0x3eb548,_0x46c1b1['error'][_0x5346('0x10')]);return _0xda3c3(_0x46c1b1['error']['message']);}logger[_0x5346('0xe')](_0x5346('0xf'),_0x3eb548,_0x46c1b1[_0x5346('0xe')]['message']);return _0xe92c89(_0x46c1b1['error'][_0x5346('0x10')]);}else{logger[_0x5346('0xb')](_0x5346('0xf'),_0x3eb548,_0x5346('0xc'));_0xe92c89(_0x46c1b1['result']['message']);}})['catch'](function(_0x1ba992){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3eb548,_0x1ba992);_0xda3c3(_0x1ba992);});});} \ No newline at end of file +var _0x99ff=['code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x99ff,0x1e8));var _0xf99f=function(_0x3abe6a,_0xdd7b1a){_0x3abe6a=_0x3abe6a-0x0;var _0x2fc39e=_0x99ff[_0x3abe6a];return _0x2fc39e;};'use strict';var _=require(_0xf99f('0x0'));var util=require(_0xf99f('0x1'));var moment=require(_0xf99f('0x2'));var BPromise=require('bluebird');var rs=require(_0xf99f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf99f('0x4'))['db'];var utils=require(_0xf99f('0x5'));var logger=require(_0xf99f('0x6'))(_0xf99f('0x7'));var config=require(_0xf99f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf99f('0x9')][_0xf99f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x596943,_0x1e679a,_0x165b6e){return new BPromise(function(_0x2e5196,_0x3de245){return client['request'](_0x596943,_0x165b6e)['then'](function(_0x3f0c23){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1e679a,_0xf99f('0xb'));logger[_0xf99f('0xc')](_0xf99f('0xd'),_0x1e679a,_0xf99f('0xb'),JSON[_0xf99f('0xe')](_0x3f0c23));if(_0x3f0c23[_0xf99f('0xf')]){if(_0x3f0c23[_0xf99f('0xf')][_0xf99f('0x10')]===0x1f4){logger['error'](_0xf99f('0x11'),_0x1e679a,_0x3f0c23['error']['message']);return _0x3de245(_0x3f0c23[_0xf99f('0xf')]['message']);}logger[_0xf99f('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1e679a,_0x3f0c23['error'][_0xf99f('0x12')]);return _0x2e5196(_0x3f0c23[_0xf99f('0xf')][_0xf99f('0x12')]);}else{logger[_0xf99f('0x13')](_0xf99f('0x11'),_0x1e679a,_0xf99f('0xb'));_0x2e5196(_0x3f0c23[_0xf99f('0x14')][_0xf99f('0x12')]);}})['catch'](function(_0x5e51ec){logger[_0xf99f('0xf')](_0xf99f('0x11'),_0x1e679a,_0x5e51ec);_0x3de245(_0x5e51ec);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 0c29948..0f1c409 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 _0x20a2=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x894b26,_0xed3fa9){var _0x2dd9b4=function(_0x29c8ec){while(--_0x29c8ec){_0x894b26['push'](_0x894b26['shift']());}};_0x2dd9b4(++_0xed3fa9);}(_0x20a2,0x150));var _0x220a=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x20a2[_0x289891];return _0x31cf2e;};'use strict';var multer=require(_0x220a('0x0'));var util=require(_0x220a('0x1'));var path=require(_0x220a('0x2'));var timeout=require('connect-timeout');var express=require(_0x220a('0x3'));var router=express['Router']();var fs_extra=require(_0x220a('0x4'));var auth=require(_0x220a('0x5'));var interaction=require(_0x220a('0x6'));var config=require(_0x220a('0x7'));var controller=require(_0x220a('0x8'));router[_0x220a('0x9')]('/',auth['isAuthenticated'](),controller[_0x220a('0xa')]);router[_0x220a('0x9')](_0x220a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x220a('0xc')]('/',auth[_0x220a('0xd')](),controller[_0x220a('0xe')]);router[_0x220a('0xf')](_0x220a('0xb'),auth[_0x220a('0xd')](),controller[_0x220a('0x10')]);router[_0x220a('0x11')](_0x220a('0xb'),auth['isAuthenticated'](),controller[_0x220a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xda74=['../../components/auth/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','create','put','delete','exports','util','path','Router','fs-extra'];(function(_0x52585b,_0x33f30){var _0x2b2adb=function(_0x2b0a37){while(--_0x2b0a37){_0x52585b['push'](_0x52585b['shift']());}};_0x2b2adb(++_0x33f30);}(_0xda74,0xbf));var _0x4da7=function(_0x378d4a,_0x32bd99){_0x378d4a=_0x378d4a-0x0;var _0x3d802c=_0xda74[_0x378d4a];return _0x3d802c;};'use strict';var multer=require('multer');var util=require(_0x4da7('0x0'));var path=require(_0x4da7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4da7('0x2')]();var fs_extra=require(_0x4da7('0x3'));var auth=require(_0x4da7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4da7('0x5'));var controller=require(_0x4da7('0x6'));router[_0x4da7('0x7')]('/',auth['isAuthenticated'](),controller[_0x4da7('0x8')]);router[_0x4da7('0x7')](_0x4da7('0x9'),auth[_0x4da7('0xa')](),controller['show']);router['post']('/',auth[_0x4da7('0xa')](),controller[_0x4da7('0xb')]);router[_0x4da7('0xc')](_0x4da7('0x9'),auth[_0x4da7('0xa')](),controller['update']);router[_0x4da7('0xd')](_0x4da7('0x9'),auth[_0x4da7('0xa')](),controller['destroy']);module[_0x4da7('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 1d19f78..19081c7 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 _0x983f=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x1e79fd,_0x24434d){var _0x38766e=function(_0x46a0f4){while(--_0x46a0f4){_0x1e79fd['push'](_0x1e79fd['shift']());}};_0x38766e(++_0x24434d);}(_0x983f,0xff));var _0xf983=function(_0x3f24ae,_0x2122b6){_0x3f24ae=_0x3f24ae-0x0;var _0x13e8b6=_0x983f[_0x3f24ae];return _0x13e8b6;};'use strict';var Sequelize=require(_0xf983('0x0'));module['exports']={'type':{'type':Sequelize[_0xf983('0x1')](_0xf983('0x2'),_0xf983('0x3'),_0xf983('0x4'),_0xf983('0x5'),_0xf983('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf983('0x7')]},'keyType':{'type':Sequelize[_0xf983('0x1')](_0xf983('0x2'),_0xf983('0x3'),_0xf983('0x4'))},'keyContent':{'type':Sequelize[_0xf983('0x7')]},'idField':{'type':Sequelize[_0xf983('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf983('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac3b=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x53a1be,_0x42dff2){var _0x38ae84=function(_0x51fa5c){while(--_0x51fa5c){_0x53a1be['push'](_0x53a1be['shift']());}};_0x38ae84(++_0x42dff2);}(_0xac3b,0xb3));var _0xbac3=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0xac3b[_0x2867a6];return _0x4afc2b;};'use strict';var Sequelize=require('sequelize');module[_0xbac3('0x0')]={'type':{'type':Sequelize[_0xbac3('0x1')](_0xbac3('0x2'),_0xbac3('0x3'),_0xbac3('0x4'),'keyValue',_0xbac3('0x5')),'defaultValue':_0xbac3('0x2')},'content':{'type':Sequelize[_0xbac3('0x6')]},'key':{'type':Sequelize[_0xbac3('0x6')]},'keyType':{'type':Sequelize[_0xbac3('0x1')](_0xbac3('0x2'),_0xbac3('0x3'),_0xbac3('0x4'))},'keyContent':{'type':Sequelize[_0xbac3('0x6')]},'idField':{'type':Sequelize[_0xbac3('0x6')]},'nameField':{'type':Sequelize[_0xbac3('0x6')]},'customField':{'type':Sequelize[_0xbac3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 4676bea..065bdb0 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 _0x5e61=['includeAll','rows','catch','show','params','rawAttributes','keys','length','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','stack','name','send','index','map','ZendeskField','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5e61,0xe2));var _0x15e6=function(_0x5a8be1,_0x4ec251){_0x5a8be1=_0x5a8be1-0x0;var _0xbcd0b0=_0x5e61[_0x5a8be1];return _0xbcd0b0;};'use strict';var emlformat=require(_0x15e6('0x0'));var rimraf=require(_0x15e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15e6('0x2'));var rp=require(_0x15e6('0x3'));var moment=require(_0x15e6('0x4'));var BPromise=require(_0x15e6('0x5'));var Mustache=require(_0x15e6('0x6'));var util=require(_0x15e6('0x7'));var path=require(_0x15e6('0x8'));var sox=require(_0x15e6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15e6('0xa'));var _=require(_0x15e6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x15e6('0xc'));var toCsv=require(_0x15e6('0xd'));var querystring=require(_0x15e6('0xe'));var Papa=require(_0x15e6('0xf'));var Redis=require('ioredis');var authService=require(_0x15e6('0x10'));var qs=require(_0x15e6('0x11'));var as=require(_0x15e6('0x12'));var hardwareService=require(_0x15e6('0x13'));var logger=require(_0x15e6('0x14'))(_0x15e6('0x15'));var utils=require(_0x15e6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x15e6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5938a9,_0x4c5914){_0x4c5914=_0x4c5914||0xcc;return function(_0x499d5c){if(_0x499d5c){return _0x5938a9[_0x15e6('0x18')](_0x4c5914);}return _0x5938a9[_0x15e6('0x19')](_0x4c5914)[_0x15e6('0x1a')]();};}function respondWithResult(_0xcd82d7,_0x718ed4){_0x718ed4=_0x718ed4||0xc8;return function(_0x58b04a){if(_0x58b04a){return _0xcd82d7[_0x15e6('0x19')](_0x718ed4)[_0x15e6('0x1b')](_0x58b04a);}};}function respondWithFilteredResult(_0xfaebc0,_0x45a718){return function(_0x2364de){if(_0x2364de){var _0x142ae0=typeof _0x45a718[_0x15e6('0x1c')]===_0x15e6('0x1d')&&typeof _0x45a718[_0x15e6('0x1e')]===_0x15e6('0x1d');var _0x340bc7=_0x2364de[_0x15e6('0x1f')];var _0x3eebc8=_0x142ae0?0x0:_0x45a718[_0x15e6('0x1c')];var _0x3315d3=_0x142ae0?_0x2364de[_0x15e6('0x1f')]:_0x45a718[_0x15e6('0x1c')]+_0x45a718[_0x15e6('0x1e')];var _0x3a7936;if(_0x3315d3>=_0x340bc7){_0x3315d3=_0x340bc7;_0x3a7936=0xc8;}else{_0x3a7936=0xce;}_0xfaebc0[_0x15e6('0x19')](_0x3a7936);return _0xfaebc0['set']('Content-Range',_0x3eebc8+'-'+_0x3315d3+'/'+_0x340bc7)[_0x15e6('0x1b')](_0x2364de);}return null;};}function patchUpdates(_0x472efc){return function(_0x5a5ce9){try{jsonpatch[_0x15e6('0x20')](_0x5a5ce9,_0x472efc,!![]);}catch(_0x369a4b){return BPromise['reject'](_0x369a4b);}return _0x5a5ce9[_0x15e6('0x21')]();};}function saveUpdates(_0x5926a2,_0x251723){return function(_0x309c7f){if(_0x309c7f){return _0x309c7f['update'](_0x5926a2)['then'](function(_0x1c9687){return _0x1c9687;});}return null;};}function removeEntity(_0x32aa46,_0x4af0d1){return function(_0x252de0){if(_0x252de0){return _0x252de0['destroy']()['then'](function(){_0x32aa46[_0x15e6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4602e3,_0x155918){return function(_0x392317){if(!_0x392317){_0x4602e3['sendStatus'](0x194);}return _0x392317;};}function handleError(_0x475e74,_0x1658c1){_0x1658c1=_0x1658c1||0x1f4;return function(_0x20a891){logger['error'](_0x20a891[_0x15e6('0x22')]);if(_0x20a891[_0x15e6('0x23')]){delete _0x20a891[_0x15e6('0x23')];}_0x475e74['status'](_0x1658c1)[_0x15e6('0x24')](_0x20a891);};}exports[_0x15e6('0x25')]=function(_0x50ccef,_0x17d1b3){var _0x4cf324={},_0x380ff3={},_0x47b86f={'count':0x0,'rows':[]};var _0x5d8589=_[_0x15e6('0x26')](db[_0x15e6('0x27')]['rawAttributes'],function(_0x347f12){return{'name':_0x347f12[_0x15e6('0x28')],'type':_0x347f12[_0x15e6('0x29')][_0x15e6('0x2a')]};});_0x380ff3[_0x15e6('0x2b')]=_['map'](_0x5d8589,_0x15e6('0x23'));_0x380ff3['query']=_['keys'](_0x50ccef[_0x15e6('0x2c')]);_0x380ff3['filters']=_[_0x15e6('0x2d')](_0x380ff3['model'],_0x380ff3[_0x15e6('0x2c')]);_0x4cf324[_0x15e6('0x2e')]=_[_0x15e6('0x2d')](_0x380ff3['model'],qs[_0x15e6('0x2f')](_0x50ccef[_0x15e6('0x2c')]['fields']));_0x4cf324[_0x15e6('0x2e')]=_0x4cf324[_0x15e6('0x2e')]['length']?_0x4cf324[_0x15e6('0x2e')]:_0x380ff3[_0x15e6('0x2b')];if(!_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x30')]('nolimit')){_0x4cf324['limit']=qs[_0x15e6('0x1e')](_0x50ccef['query'][_0x15e6('0x1e')]);_0x4cf324['offset']=qs[_0x15e6('0x1c')](_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x1c')]);}_0x4cf324[_0x15e6('0x31')]=qs[_0x15e6('0x32')](_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x32')]);_0x4cf324[_0x15e6('0x33')]=qs[_0x15e6('0x34')](_[_0x15e6('0x35')](_0x50ccef[_0x15e6('0x2c')],_0x380ff3[_0x15e6('0x34')]),_0x5d8589);if(_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x36')]){_0x4cf324[_0x15e6('0x33')]=_[_0x15e6('0x37')](_0x4cf324[_0x15e6('0x33')],{'$or':_[_0x15e6('0x26')](_0x5d8589,function(_0x35bfc0){if(_0x35bfc0[_0x15e6('0x29')]!==_0x15e6('0x38')){var _0x5eefa9={};_0x5eefa9[_0x35bfc0[_0x15e6('0x23')]]={'$like':'%'+_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x36')]+'%'};return _0x5eefa9;}})});}_0x4cf324=_[_0x15e6('0x37')]({},_0x4cf324,_0x50ccef['options']);var _0x2a7887={'where':_0x4cf324[_0x15e6('0x33')]};return db[_0x15e6('0x27')]['count'](_0x2a7887)[_0x15e6('0x39')](function(_0x5d8b8f){_0x47b86f[_0x15e6('0x1f')]=_0x5d8b8f;if(_0x50ccef[_0x15e6('0x2c')][_0x15e6('0x3a')]){_0x4cf324['include']=[{'all':!![]}];}return db[_0x15e6('0x27')]['findAll'](_0x4cf324);})[_0x15e6('0x39')](function(_0xde2486){_0x47b86f[_0x15e6('0x3b')]=_0xde2486;return _0x47b86f;})[_0x15e6('0x39')](respondWithFilteredResult(_0x17d1b3,_0x4cf324))[_0x15e6('0x3c')](handleError(_0x17d1b3,null));};exports[_0x15e6('0x3d')]=function(_0x23c14c,_0x29f4d2){var _0x50135a={'raw':!![],'where':{'id':_0x23c14c[_0x15e6('0x3e')]['id']}},_0x35e309={};_0x35e309[_0x15e6('0x2b')]=_['keys'](db[_0x15e6('0x27')][_0x15e6('0x3f')]);_0x35e309['query']=_[_0x15e6('0x40')](_0x23c14c['query']);_0x35e309[_0x15e6('0x34')]=_[_0x15e6('0x2d')](_0x35e309[_0x15e6('0x2b')],_0x35e309[_0x15e6('0x2c')]);_0x50135a[_0x15e6('0x2e')]=_[_0x15e6('0x2d')](_0x35e309[_0x15e6('0x2b')],qs['fields'](_0x23c14c['query'][_0x15e6('0x2f')]));_0x50135a[_0x15e6('0x2e')]=_0x50135a[_0x15e6('0x2e')][_0x15e6('0x41')]?_0x50135a[_0x15e6('0x2e')]:_0x35e309[_0x15e6('0x2b')];if(_0x23c14c[_0x15e6('0x2c')]['includeAll']){_0x50135a['include']=[{'all':!![]}];}_0x50135a=_[_0x15e6('0x37')]({},_0x50135a,_0x23c14c[_0x15e6('0x42')]);return db[_0x15e6('0x27')][_0x15e6('0x43')](_0x50135a)['then'](handleEntityNotFound(_0x29f4d2,null))[_0x15e6('0x39')](respondWithResult(_0x29f4d2,null))[_0x15e6('0x3c')](handleError(_0x29f4d2,null));};exports['create']=function(_0x324c96,_0x2654a8){return db[_0x15e6('0x27')][_0x15e6('0x44')](_0x324c96[_0x15e6('0x45')],{})[_0x15e6('0x39')](respondWithResult(_0x2654a8,0xc9))[_0x15e6('0x3c')](handleError(_0x2654a8,null));};exports[_0x15e6('0x46')]=function(_0xfc39c2,_0x24d5de){if(_0xfc39c2['body']['id']){delete _0xfc39c2[_0x15e6('0x45')]['id'];}return db[_0x15e6('0x27')]['find']({'where':{'id':_0xfc39c2[_0x15e6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x24d5de,null))[_0x15e6('0x39')](saveUpdates(_0xfc39c2[_0x15e6('0x45')],null))['then'](respondWithResult(_0x24d5de,null))[_0x15e6('0x3c')](handleError(_0x24d5de,null));};exports['destroy']=function(_0x1dfb8d,_0x19c5a3){return db['ZendeskField'][_0x15e6('0x43')]({'where':{'id':_0x1dfb8d[_0x15e6('0x3e')]['id']}})[_0x15e6('0x39')](handleEntityNotFound(_0x19c5a3,null))[_0x15e6('0x39')](removeEntity(_0x19c5a3,null))[_0x15e6('0x3c')](handleError(_0x19c5a3,null));}; \ No newline at end of file +var _0x4a06=['type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','name','send','index','ZendeskField','fieldName'];(function(_0x541aed,_0x4d2f0d){var _0x58cbc8=function(_0x251fd0){while(--_0x251fd0){_0x541aed['push'](_0x541aed['shift']());}};_0x58cbc8(++_0x4d2f0d);}(_0x4a06,0x1f2));var _0x64a0=function(_0xba95a5,_0x68abdc){_0xba95a5=_0xba95a5-0x0;var _0x2be821=_0x4a06[_0xba95a5];return _0x2be821;};'use strict';var emlformat=require(_0x64a0('0x0'));var rimraf=require(_0x64a0('0x1'));var zipdir=require(_0x64a0('0x2'));var jsonpatch=require(_0x64a0('0x3'));var rp=require(_0x64a0('0x4'));var moment=require(_0x64a0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64a0('0x6'));var util=require(_0x64a0('0x7'));var path=require(_0x64a0('0x8'));var sox=require(_0x64a0('0x9'));var csv=require(_0x64a0('0xa'));var ejs=require(_0x64a0('0xb'));var fs=require('fs');var fs_extra=require(_0x64a0('0xc'));var _=require(_0x64a0('0xd'));var squel=require(_0x64a0('0xe'));var crypto=require(_0x64a0('0xf'));var jsforce=require(_0x64a0('0x10'));var deskjs=require(_0x64a0('0x11'));var toCsv=require(_0x64a0('0xa'));var querystring=require(_0x64a0('0x12'));var Papa=require(_0x64a0('0x13'));var Redis=require('ioredis');var authService=require(_0x64a0('0x14'));var qs=require(_0x64a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64a0('0x16'));var logger=require(_0x64a0('0x17'))(_0x64a0('0x18'));var utils=require(_0x64a0('0x19'));var config=require(_0x64a0('0x1a'));var licenseUtil=require(_0x64a0('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fc511,_0x3650fb){_0x3650fb=_0x3650fb||0xcc;return function(_0x349fee){if(_0x349fee){return _0x3fc511['sendStatus'](_0x3650fb);}return _0x3fc511[_0x64a0('0x1c')](_0x3650fb)[_0x64a0('0x1d')]();};}function respondWithResult(_0x4c125f,_0x18550c){_0x18550c=_0x18550c||0xc8;return function(_0x109be2){if(_0x109be2){return _0x4c125f[_0x64a0('0x1c')](_0x18550c)[_0x64a0('0x1e')](_0x109be2);}};}function respondWithFilteredResult(_0x5d5aee,_0x143d49){return function(_0xe3c4be){if(_0xe3c4be){var _0xd06ac3=typeof _0x143d49[_0x64a0('0x1f')]===_0x64a0('0x20')&&typeof _0x143d49[_0x64a0('0x21')]===_0x64a0('0x20');var _0x3a1da2=_0xe3c4be[_0x64a0('0x22')];var _0x28af58=_0xd06ac3?0x0:_0x143d49[_0x64a0('0x1f')];var _0x5a1b2d=_0xd06ac3?_0xe3c4be[_0x64a0('0x22')]:_0x143d49[_0x64a0('0x1f')]+_0x143d49[_0x64a0('0x21')];var _0x19a2da;if(_0x5a1b2d>=_0x3a1da2){_0x5a1b2d=_0x3a1da2;_0x19a2da=0xc8;}else{_0x19a2da=0xce;}_0x5d5aee[_0x64a0('0x1c')](_0x19a2da);return _0x5d5aee[_0x64a0('0x23')]('Content-Range',_0x28af58+'-'+_0x5a1b2d+'/'+_0x3a1da2)['json'](_0xe3c4be);}return null;};}function patchUpdates(_0x134627){return function(_0x5afa81){try{jsonpatch['apply'](_0x5afa81,_0x134627,!![]);}catch(_0x58ef5c){return BPromise[_0x64a0('0x24')](_0x58ef5c);}return _0x5afa81[_0x64a0('0x25')]();};}function saveUpdates(_0x2785a7,_0x5a267d){return function(_0x3b8e5c){if(_0x3b8e5c){return _0x3b8e5c[_0x64a0('0x26')](_0x2785a7)[_0x64a0('0x27')](function(_0x510d8d){return _0x510d8d;});}return null;};}function removeEntity(_0x8aac66,_0x3d6970){return function(_0x4ff3c8){if(_0x4ff3c8){return _0x4ff3c8[_0x64a0('0x28')]()[_0x64a0('0x27')](function(){_0x8aac66['status'](0xcc)[_0x64a0('0x1d')]();});}};}function handleEntityNotFound(_0xc0f23,_0x1d9bdd){return function(_0x351bb5){if(!_0x351bb5){_0xc0f23[_0x64a0('0x29')](0x194);}return _0x351bb5;};}function handleError(_0x4a30ad,_0x52e178){_0x52e178=_0x52e178||0x1f4;return function(_0x338e81){logger[_0x64a0('0x2a')](_0x338e81['stack']);if(_0x338e81[_0x64a0('0x2b')]){delete _0x338e81[_0x64a0('0x2b')];}_0x4a30ad[_0x64a0('0x1c')](_0x52e178)[_0x64a0('0x2c')](_0x338e81);};}exports[_0x64a0('0x2d')]=function(_0x333b3c,_0xee97c7){var _0x17bde4={},_0x341feb={},_0x417a33={'count':0x0,'rows':[]};var _0x467a32=_['map'](db[_0x64a0('0x2e')]['rawAttributes'],function(_0x26fc36){return{'name':_0x26fc36[_0x64a0('0x2f')],'type':_0x26fc36[_0x64a0('0x30')][_0x64a0('0x31')]};});_0x341feb['model']=_[_0x64a0('0x32')](_0x467a32,_0x64a0('0x2b'));_0x341feb[_0x64a0('0x33')]=_[_0x64a0('0x34')](_0x333b3c[_0x64a0('0x33')]);_0x341feb['filters']=_[_0x64a0('0x35')](_0x341feb[_0x64a0('0x36')],_0x341feb[_0x64a0('0x33')]);_0x17bde4[_0x64a0('0x37')]=_[_0x64a0('0x35')](_0x341feb['model'],qs['fields'](_0x333b3c['query'][_0x64a0('0x38')]));_0x17bde4[_0x64a0('0x37')]=_0x17bde4[_0x64a0('0x37')][_0x64a0('0x39')]?_0x17bde4['attributes']:_0x341feb[_0x64a0('0x36')];if(!_0x333b3c[_0x64a0('0x33')][_0x64a0('0x3a')](_0x64a0('0x3b'))){_0x17bde4[_0x64a0('0x21')]=qs[_0x64a0('0x21')](_0x333b3c[_0x64a0('0x33')][_0x64a0('0x21')]);_0x17bde4['offset']=qs[_0x64a0('0x1f')](_0x333b3c[_0x64a0('0x33')][_0x64a0('0x1f')]);}_0x17bde4[_0x64a0('0x3c')]=qs[_0x64a0('0x3d')](_0x333b3c[_0x64a0('0x33')]['sort']);_0x17bde4['where']=qs[_0x64a0('0x3e')](_[_0x64a0('0x3f')](_0x333b3c['query'],_0x341feb[_0x64a0('0x3e')]),_0x467a32);if(_0x333b3c[_0x64a0('0x33')]['filter']){_0x17bde4['where']=_[_0x64a0('0x40')](_0x17bde4[_0x64a0('0x41')],{'$or':_[_0x64a0('0x32')](_0x467a32,function(_0x34307b){if(_0x34307b[_0x64a0('0x30')]!==_0x64a0('0x42')){var _0x432d55={};_0x432d55[_0x34307b[_0x64a0('0x2b')]]={'$like':'%'+_0x333b3c[_0x64a0('0x33')][_0x64a0('0x43')]+'%'};return _0x432d55;}})});}_0x17bde4=_[_0x64a0('0x40')]({},_0x17bde4,_0x333b3c[_0x64a0('0x44')]);var _0xcef8ad={'where':_0x17bde4[_0x64a0('0x41')]};return db[_0x64a0('0x2e')][_0x64a0('0x22')](_0xcef8ad)[_0x64a0('0x27')](function(_0x1ea507){_0x417a33[_0x64a0('0x22')]=_0x1ea507;if(_0x333b3c[_0x64a0('0x33')][_0x64a0('0x45')]){_0x17bde4[_0x64a0('0x46')]=[{'all':!![]}];}return db[_0x64a0('0x2e')]['findAll'](_0x17bde4);})['then'](function(_0x10cd62){_0x417a33[_0x64a0('0x47')]=_0x10cd62;return _0x417a33;})['then'](respondWithFilteredResult(_0xee97c7,_0x17bde4))[_0x64a0('0x48')](handleError(_0xee97c7,null));};exports['show']=function(_0x221406,_0x566d50){var _0x337ed2={'raw':!![],'where':{'id':_0x221406[_0x64a0('0x49')]['id']}},_0x234d15={};_0x234d15[_0x64a0('0x36')]=_[_0x64a0('0x34')](db['ZendeskField'][_0x64a0('0x4a')]);_0x234d15[_0x64a0('0x33')]=_['keys'](_0x221406[_0x64a0('0x33')]);_0x234d15[_0x64a0('0x3e')]=_[_0x64a0('0x35')](_0x234d15[_0x64a0('0x36')],_0x234d15[_0x64a0('0x33')]);_0x337ed2['attributes']=_[_0x64a0('0x35')](_0x234d15[_0x64a0('0x36')],qs[_0x64a0('0x38')](_0x221406[_0x64a0('0x33')][_0x64a0('0x38')]));_0x337ed2[_0x64a0('0x37')]=_0x337ed2['attributes'][_0x64a0('0x39')]?_0x337ed2[_0x64a0('0x37')]:_0x234d15['model'];if(_0x221406[_0x64a0('0x33')][_0x64a0('0x45')]){_0x337ed2[_0x64a0('0x46')]=[{'all':!![]}];}_0x337ed2=_[_0x64a0('0x40')]({},_0x337ed2,_0x221406[_0x64a0('0x44')]);return db[_0x64a0('0x2e')][_0x64a0('0x4b')](_0x337ed2)[_0x64a0('0x27')](handleEntityNotFound(_0x566d50,null))[_0x64a0('0x27')](respondWithResult(_0x566d50,null))['catch'](handleError(_0x566d50,null));};exports[_0x64a0('0x4c')]=function(_0x171b3a,_0x3d28b2){return db[_0x64a0('0x2e')]['create'](_0x171b3a['body'],{})[_0x64a0('0x27')](respondWithResult(_0x3d28b2,0xc9))[_0x64a0('0x48')](handleError(_0x3d28b2,null));};exports[_0x64a0('0x26')]=function(_0x1d4156,_0x58b067){if(_0x1d4156['body']['id']){delete _0x1d4156[_0x64a0('0x4d')]['id'];}return db[_0x64a0('0x2e')][_0x64a0('0x4b')]({'where':{'id':_0x1d4156[_0x64a0('0x49')]['id']}})[_0x64a0('0x27')](handleEntityNotFound(_0x58b067,null))[_0x64a0('0x27')](saveUpdates(_0x1d4156[_0x64a0('0x4d')],null))[_0x64a0('0x27')](respondWithResult(_0x58b067,null))[_0x64a0('0x48')](handleError(_0x58b067,null));};exports[_0x64a0('0x28')]=function(_0x2481aa,_0x7572e6){return db['ZendeskField']['find']({'where':{'id':_0x2481aa[_0x64a0('0x49')]['id']}})[_0x64a0('0x27')](handleEntityNotFound(_0x7572e6,null))[_0x64a0('0x27')](removeEntity(_0x7572e6,null))[_0x64a0('0x48')](handleError(_0x7572e6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a6fc86c..68d4ca9 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 _0x039e=['ZendeskField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x039e,0xb8));var _0xe039=function(_0x2df3b3,_0x3e720){_0x2df3b3=_0x2df3b3-0x0;var _0xe19bee=_0x039e[_0x2df3b3];return _0xe19bee;};'use strict';var _=require(_0xe039('0x0'));var util=require('util');var logger=require(_0xe039('0x1'))(_0xe039('0x2'));var moment=require(_0xe039('0x3'));var BPromise=require(_0xe039('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe039('0x5'));var rimraf=require(_0xe039('0x6'));var config=require(_0xe039('0x7'));var attributes=require(_0xe039('0x8'));module[_0xe039('0x9')]=function(_0x853e63,_0x4591a2){return _0x853e63[_0xe039('0xa')](_0xe039('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xe039('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa501=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','zendesk_unique_index'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xa501,0x15f));var _0x1a50=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0xa501[_0x3cb86b];return _0x3c10a0;};'use strict';var _=require(_0x1a50('0x0'));var util=require(_0x1a50('0x1'));var logger=require(_0x1a50('0x2'))(_0x1a50('0x3'));var moment=require(_0x1a50('0x4'));var BPromise=require(_0x1a50('0x5'));var rp=require(_0x1a50('0x6'));var fs=require('fs');var path=require(_0x1a50('0x7'));var rimraf=require(_0x1a50('0x8'));var config=require(_0x1a50('0x9'));var attributes=require(_0x1a50('0xa'));module['exports']=function(_0x525f8b,_0x2f8e8e){return _0x525f8b[_0x1a50('0xb')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x1a50('0xc'),'fields':[_0x1a50('0xd'),'FieldId'],'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 986bbe8..71869fd 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 _0x1a08=['http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a08,0x1a5));var _0x81a0=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x1a08[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x81a0('0x0'));var util=require(_0x81a0('0x1'));var moment=require(_0x81a0('0x2'));var BPromise=require(_0x81a0('0x3'));var rs=require(_0x81a0('0x4'));var fs=require('fs');var Redis=require(_0x81a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x81a0('0x6'));var logger=require(_0x81a0('0x7'))(_0x81a0('0x8'));var config=require(_0x81a0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x81a0('0xa')][_0x81a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1afecc,_0x30943a,_0x12ddac){return new BPromise(function(_0x3193ef,_0x5b3aca){return client[_0x81a0('0xc')](_0x1afecc,_0x12ddac)['then'](function(_0x2ad4ae){logger[_0x81a0('0xd')](_0x81a0('0xe'),_0x30943a,_0x81a0('0xf'));logger[_0x81a0('0x10')](_0x81a0('0x11'),_0x30943a,'request\x20sent',JSON[_0x81a0('0x12')](_0x2ad4ae));if(_0x2ad4ae[_0x81a0('0x13')]){if(_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x14')]===0x1f4){logger[_0x81a0('0x13')]('ZendeskField,\x20%s,\x20%s',_0x30943a,_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x15')]);return _0x5b3aca(_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x15')]);}logger[_0x81a0('0x13')](_0x81a0('0xe'),_0x30943a,_0x2ad4ae[_0x81a0('0x13')]['message']);return _0x3193ef(_0x2ad4ae[_0x81a0('0x13')][_0x81a0('0x15')]);}else{logger[_0x81a0('0xd')](_0x81a0('0xe'),_0x30943a,_0x81a0('0xf'));_0x3193ef(_0x2ad4ae[_0x81a0('0x16')][_0x81a0('0x15')]);}})[_0x81a0('0x17')](function(_0x36f476){logger[_0x81a0('0x13')](_0x81a0('0xe'),_0x30943a,_0x36f476);_0x5b3aca(_0x36f476);});});} \ No newline at end of file +var _0x46da=['request','then','request\x20sent','debug','error','code','ZendeskField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xab58e1,_0x5d47ce){var _0x295351=function(_0x43f2a7){while(--_0x43f2a7){_0xab58e1['push'](_0xab58e1['shift']());}};_0x295351(++_0x5d47ce);}(_0x46da,0x1d9));var _0xa46d=function(_0x4ae3a5,_0x5cd232){_0x4ae3a5=_0x4ae3a5-0x0;var _0x292a56=_0x46da[_0x4ae3a5];return _0x292a56;};'use strict';var _=require('lodash');var util=require(_0xa46d('0x0'));var moment=require(_0xa46d('0x1'));var BPromise=require('bluebird');var rs=require(_0xa46d('0x2'));var fs=require('fs');var Redis=require(_0xa46d('0x3'));var db=require(_0xa46d('0x4'))['db'];var utils=require(_0xa46d('0x5'));var logger=require(_0xa46d('0x6'))(_0xa46d('0x7'));var config=require(_0xa46d('0x8'));var jayson=require(_0xa46d('0x9'));var client=jayson['client'][_0xa46d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ad6a2,_0x4e3f2b,_0x5d500b){return new BPromise(function(_0x576f82,_0x4a4abb){return client[_0xa46d('0xb')](_0x5ad6a2,_0x5d500b)[_0xa46d('0xc')](function(_0x28a8f8){logger['info']('ZendeskField,\x20%s,\x20%s',_0x4e3f2b,_0xa46d('0xd'));logger[_0xa46d('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4e3f2b,'request\x20sent',JSON['stringify'](_0x28a8f8));if(_0x28a8f8[_0xa46d('0xf')]){if(_0x28a8f8[_0xa46d('0xf')][_0xa46d('0x10')]===0x1f4){logger['error'](_0xa46d('0x11'),_0x4e3f2b,_0x28a8f8[_0xa46d('0xf')][_0xa46d('0x12')]);return _0x4a4abb(_0x28a8f8['error'][_0xa46d('0x12')]);}logger[_0xa46d('0xf')](_0xa46d('0x11'),_0x4e3f2b,_0x28a8f8[_0xa46d('0xf')][_0xa46d('0x12')]);return _0x576f82(_0x28a8f8[_0xa46d('0xf')]['message']);}else{logger[_0xa46d('0x13')](_0xa46d('0x11'),_0x4e3f2b,_0xa46d('0xd'));_0x576f82(_0x28a8f8[_0xa46d('0x14')][_0xa46d('0x12')]);}})[_0xa46d('0x15')](function(_0x2124c2){logger[_0xa46d('0xf')](_0xa46d('0x11'),_0x4e3f2b,_0x2124c2);_0x4a4abb(_0x2124c2);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 9a0358b..fb37c19 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 _0x3037=['/:id','/:id/configurations','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x5b7c79,_0x6c5ada){var _0x2c69a4=function(_0xb4a2dd){while(--_0xb4a2dd){_0x5b7c79['push'](_0x5b7c79['shift']());}};_0x2c69a4(++_0x6c5ada);}(_0x3037,0x126));var _0x7303=function(_0x117f75,_0x524507){_0x117f75=_0x117f75-0x0;var _0x4f7186=_0x3037[_0x117f75];return _0x4f7186;};'use strict';var multer=require(_0x7303('0x0'));var util=require(_0x7303('0x1'));var path=require(_0x7303('0x2'));var timeout=require(_0x7303('0x3'));var express=require('express');var router=express[_0x7303('0x4')]();var fs_extra=require(_0x7303('0x5'));var auth=require(_0x7303('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7303('0x7'));router[_0x7303('0x8')]('/',auth[_0x7303('0x9')](),controller['index']);router[_0x7303('0x8')](_0x7303('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7303('0x8')](_0x7303('0xb'),auth[_0x7303('0x9')](),controller['getConfigurations']);router[_0x7303('0x8')]('/:id/fields',auth[_0x7303('0x9')](),controller[_0x7303('0xc')]);router[_0x7303('0xd')]('/',auth[_0x7303('0x9')](),controller[_0x7303('0xe')]);router['post'](_0x7303('0xb'),auth[_0x7303('0x9')](),controller[_0x7303('0xf')]);router[_0x7303('0x10')](_0x7303('0xa'),auth[_0x7303('0x9')](),controller['update']);router[_0x7303('0x11')](_0x7303('0xa'),auth[_0x7303('0x9')](),controller[_0x7303('0x12')]);module['exports']=router; \ No newline at end of file +var _0x00d8=['addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create'];(function(_0x37a35f,_0x15b36c){var _0x21d3a4=function(_0x1fabb8){while(--_0x1fabb8){_0x37a35f['push'](_0x37a35f['shift']());}};_0x21d3a4(++_0x15b36c);}(_0x00d8,0x17e));var _0x800d=function(_0xd9e31,_0xb789ab){_0xd9e31=_0xd9e31-0x0;var _0x4d5d05=_0x00d8[_0xd9e31];return _0x4d5d05;};'use strict';var multer=require(_0x800d('0x0'));var util=require(_0x800d('0x1'));var path=require('path');var timeout=require(_0x800d('0x2'));var express=require(_0x800d('0x3'));var router=express[_0x800d('0x4')]();var fs_extra=require(_0x800d('0x5'));var auth=require(_0x800d('0x6'));var interaction=require(_0x800d('0x7'));var config=require('../../config/environment');var controller=require(_0x800d('0x8'));router[_0x800d('0x9')]('/',auth[_0x800d('0xa')](),controller[_0x800d('0xb')]);router[_0x800d('0x9')]('/:id',auth[_0x800d('0xa')](),controller[_0x800d('0xc')]);router[_0x800d('0x9')](_0x800d('0xd'),auth[_0x800d('0xa')](),controller[_0x800d('0xe')]);router['get'](_0x800d('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x800d('0x10')]('/',auth['isAuthenticated'](),controller[_0x800d('0x11')]);router[_0x800d('0x10')]('/:id/configurations',auth[_0x800d('0xa')](),controller[_0x800d('0x12')]);router[_0x800d('0x13')](_0x800d('0x14'),auth[_0x800d('0xa')](),controller[_0x800d('0x15')]);router[_0x800d('0x16')](_0x800d('0x14'),auth[_0x800d('0xa')](),controller[_0x800d('0x17')]);module[_0x800d('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 303440a..21123c1 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 _0x008c=['exports','STRING','sequelize'];(function(_0x20c512,_0x36c198){var _0x25236e=function(_0x418ec3){while(--_0x418ec3){_0x20c512['push'](_0x20c512['shift']());}};_0x25236e(++_0x36c198);}(_0x008c,0x188));var _0xc008=function(_0x5b8155,_0x51c636){_0x5b8155=_0x5b8155-0x0;var _0x1d6f07=_0x008c[_0x5b8155];return _0x1d6f07;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}}; \ No newline at end of file +var _0xbec5=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbec5,0xe5));var _0x5bec=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xbec5[_0x4db46b];return _0x565be8;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 22d4fef..31f29a8 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 _0x915f=['response','Owner','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','status','send','index','map','ZohoAccount','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','include','rows','show','params','intersection','includeAll','find','create','body','catch','getConfigurations','findOne','ZohoConfiguration','options','hasOwnProperty','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','refreshToken','zoho.eu','serverUrl','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20'];(function(_0x9a8abd,_0x3b8f22){var _0x269eac=function(_0x346a65){while(--_0x346a65){_0x9a8abd['push'](_0x9a8abd['shift']());}};_0x269eac(++_0x3b8f22);}(_0x915f,0x10e));var _0xf915=function(_0x390118,_0x33ee7d){_0x390118=_0x390118-0x0;var _0x3285b3=_0x915f[_0x390118];return _0x3285b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf915('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf915('0x1'));var Mustache=require(_0xf915('0x2'));var util=require(_0xf915('0x3'));var path=require(_0xf915('0x4'));var sox=require(_0xf915('0x5'));var csv=require(_0xf915('0x6'));var ejs=require(_0xf915('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf915('0x8'));var squel=require(_0xf915('0x9'));var crypto=require('crypto');var jsforce=require(_0xf915('0xa'));var deskjs=require(_0xf915('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf915('0xc'));var Redis=require(_0xf915('0xd'));var authService=require(_0xf915('0xe'));var qs=require(_0xf915('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf915('0x10'));var logger=require(_0xf915('0x11'))(_0xf915('0x12'));var utils=require(_0xf915('0x13'));var config=require(_0xf915('0x14'));var licenseUtil=require(_0xf915('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x25f32c,_0x2b04e2){_0x2b04e2=_0x2b04e2||0xcc;return function(_0x591a1e){if(_0x591a1e){return _0x25f32c[_0xf915('0x16')](_0x2b04e2);}return _0x25f32c['status'](_0x2b04e2)[_0xf915('0x17')]();};}function respondWithResult(_0x285525,_0x318c15){_0x318c15=_0x318c15||0xc8;return function(_0x3ab65a){if(_0x3ab65a){return _0x285525['status'](_0x318c15)['json'](_0x3ab65a);}};}function respondWithFilteredResult(_0x68863c,_0x20c620){return function(_0x1331fa){if(_0x1331fa){var _0x56020b=typeof _0x20c620[_0xf915('0x18')]==='undefined'&&typeof _0x20c620['limit']==='undefined';var _0x49164c=_0x1331fa[_0xf915('0x19')];var _0x4e3c5b=_0x56020b?0x0:_0x20c620[_0xf915('0x18')];var _0x38d36a=_0x56020b?_0x1331fa['count']:_0x20c620['offset']+_0x20c620['limit'];var _0xe0c8e3;if(_0x38d36a>=_0x49164c){_0x38d36a=_0x49164c;_0xe0c8e3=0xc8;}else{_0xe0c8e3=0xce;}_0x68863c['status'](_0xe0c8e3);return _0x68863c[_0xf915('0x1a')](_0xf915('0x1b'),_0x4e3c5b+'-'+_0x38d36a+'/'+_0x49164c)[_0xf915('0x1c')](_0x1331fa);}return null;};}function patchUpdates(_0x229fa4){return function(_0x5924ec){try{jsonpatch[_0xf915('0x1d')](_0x5924ec,_0x229fa4,!![]);}catch(_0x1993e2){return BPromise[_0xf915('0x1e')](_0x1993e2);}return _0x5924ec[_0xf915('0x1f')]();};}function saveUpdates(_0x296030,_0x112112){return function(_0x1461ee){if(_0x1461ee){return _0x1461ee[_0xf915('0x20')](_0x296030)[_0xf915('0x21')](function(_0x30dbaf){return _0x30dbaf;});}return null;};}function removeEntity(_0x1a5c2d,_0x436753){return function(_0x36da89){if(_0x36da89){return _0x36da89[_0xf915('0x22')]()[_0xf915('0x21')](function(){_0x1a5c2d['status'](0xcc)[_0xf915('0x17')]();});}};}function handleEntityNotFound(_0x4b8955,_0x17951b){return function(_0xc128bd){if(!_0xc128bd){_0x4b8955['sendStatus'](0x194);}return _0xc128bd;};}function handleError(_0x255bcd,_0x3e3386){_0x3e3386=_0x3e3386||0x1f4;return function(_0xcded7c){logger[_0xf915('0x23')](_0xcded7c['stack']);if(_0xcded7c[_0xf915('0x24')]){delete _0xcded7c['name'];}_0x255bcd[_0xf915('0x25')](_0x3e3386)[_0xf915('0x26')](_0xcded7c);};}exports[_0xf915('0x27')]=function(_0x3175d9,_0x1658af){var _0x5bb9b3={},_0x24cc04={},_0x4d3568={'count':0x0,'rows':[]};var _0x24aa80=_[_0xf915('0x28')](db[_0xf915('0x29')][_0xf915('0x2a')],function(_0x275c3f){return{'name':_0x275c3f[_0xf915('0x2b')],'type':_0x275c3f['type']['key']};});_0x24cc04[_0xf915('0x2c')]=_[_0xf915('0x28')](_0x24aa80,_0xf915('0x24'));_0x24cc04[_0xf915('0x2d')]=_[_0xf915('0x2e')](_0x3175d9['query']);_0x24cc04[_0xf915('0x2f')]=_['intersection'](_0x24cc04[_0xf915('0x2c')],_0x24cc04['query']);_0x5bb9b3[_0xf915('0x30')]=_['intersection'](_0x24cc04['model'],qs[_0xf915('0x31')](_0x3175d9['query'][_0xf915('0x31')]));_0x5bb9b3['attributes']=_0x5bb9b3['attributes'][_0xf915('0x32')]?_0x5bb9b3['attributes']:_0x24cc04[_0xf915('0x2c')];if(!_0x3175d9['query']['hasOwnProperty'](_0xf915('0x33'))){_0x5bb9b3[_0xf915('0x34')]=qs[_0xf915('0x34')](_0x3175d9['query'][_0xf915('0x34')]);_0x5bb9b3['offset']=qs[_0xf915('0x18')](_0x3175d9['query'][_0xf915('0x18')]);}_0x5bb9b3[_0xf915('0x35')]=qs['sort'](_0x3175d9['query'][_0xf915('0x36')]);_0x5bb9b3[_0xf915('0x37')]=qs[_0xf915('0x2f')](_[_0xf915('0x38')](_0x3175d9[_0xf915('0x2d')],_0x24cc04[_0xf915('0x2f')]),_0x24aa80);if(_0x3175d9[_0xf915('0x2d')][_0xf915('0x39')]){_0x5bb9b3[_0xf915('0x37')]=_[_0xf915('0x3a')](_0x5bb9b3[_0xf915('0x37')],{'$or':_['map'](_0x24aa80,function(_0x3452ed){if(_0x3452ed[_0xf915('0x3b')]!=='VIRTUAL'){var _0x5dace2={};_0x5dace2[_0x3452ed[_0xf915('0x24')]]={'$like':'%'+_0x3175d9[_0xf915('0x2d')][_0xf915('0x39')]+'%'};return _0x5dace2;}})});}_0x5bb9b3=_['merge']({},_0x5bb9b3,_0x3175d9['options']);var _0x1fa2d2={'where':_0x5bb9b3['where']};return db[_0xf915('0x29')]['count'](_0x1fa2d2)[_0xf915('0x21')](function(_0x19b67e){_0x4d3568['count']=_0x19b67e;if(_0x3175d9[_0xf915('0x2d')]['includeAll']){_0x5bb9b3[_0xf915('0x3c')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x5bb9b3);})[_0xf915('0x21')](function(_0x5aa8fe){_0x4d3568[_0xf915('0x3d')]=_0x5aa8fe;return _0x4d3568;})[_0xf915('0x21')](respondWithFilteredResult(_0x1658af,_0x5bb9b3))['catch'](handleError(_0x1658af,null));};exports[_0xf915('0x3e')]=function(_0x146232,_0x3a918d){var _0x13999c={'raw':![],'where':{'id':_0x146232[_0xf915('0x3f')]['id']}},_0x5e4260={};_0x5e4260[_0xf915('0x2c')]=_['keys'](db['ZohoAccount'][_0xf915('0x2a')]);_0x5e4260[_0xf915('0x2d')]=_[_0xf915('0x2e')](_0x146232[_0xf915('0x2d')]);_0x5e4260[_0xf915('0x2f')]=_[_0xf915('0x40')](_0x5e4260['model'],_0x5e4260[_0xf915('0x2d')]);_0x13999c[_0xf915('0x30')]=_[_0xf915('0x40')](_0x5e4260['model'],qs[_0xf915('0x31')](_0x146232[_0xf915('0x2d')][_0xf915('0x31')]));_0x13999c[_0xf915('0x30')]=_0x13999c['attributes']['length']?_0x13999c[_0xf915('0x30')]:_0x5e4260[_0xf915('0x2c')];if(_0x146232[_0xf915('0x2d')][_0xf915('0x41')]){_0x13999c['include']=[{'all':!![]}];}_0x13999c=_['merge']({},_0x13999c,_0x146232['options']);return db[_0xf915('0x29')][_0xf915('0x42')](_0x13999c)[_0xf915('0x21')](handleEntityNotFound(_0x3a918d,null))[_0xf915('0x21')](respondWithResult(_0x3a918d,null))['catch'](handleError(_0x3a918d,null));};exports[_0xf915('0x43')]=function(_0x10d279,_0x3454e0){return db['ZohoAccount'][_0xf915('0x43')](_0x10d279[_0xf915('0x44')],{})[_0xf915('0x21')](respondWithResult(_0x3454e0,0xc9))[_0xf915('0x45')](handleError(_0x3454e0,null));};exports[_0xf915('0x20')]=function(_0x5a72f2,_0x5f5791){if(_0x5a72f2[_0xf915('0x44')]['id']){delete _0x5a72f2['body']['id'];}return db[_0xf915('0x29')][_0xf915('0x42')]({'where':{'id':_0x5a72f2[_0xf915('0x3f')]['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x5f5791,null))['then'](saveUpdates(_0x5a72f2[_0xf915('0x44')],null))[_0xf915('0x21')](respondWithResult(_0x5f5791,null))[_0xf915('0x45')](handleError(_0x5f5791,null));};exports['destroy']=function(_0x154701,_0x958a1b){return db[_0xf915('0x29')][_0xf915('0x42')]({'where':{'id':_0x154701['params']['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x958a1b,null))[_0xf915('0x21')](removeEntity(_0x958a1b,null))['catch'](handleError(_0x958a1b,null));};exports[_0xf915('0x46')]=function(_0x4e14a8,_0x503223,_0x7a5ac6){var _0x413b94={};var _0x4b6014={};var _0x579f66;var _0x51f18;return db['ZohoAccount'][_0xf915('0x47')]({'where':{'id':_0x4e14a8[_0xf915('0x3f')]['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x503223,null))[_0xf915('0x21')](function(_0x4170ce){if(_0x4170ce){_0x579f66=_0x4170ce;_0x4b6014[_0xf915('0x2c')]=_[_0xf915('0x2e')](db[_0xf915('0x48')][_0xf915('0x2a')]);_0x4b6014['query']=_[_0xf915('0x2e')](_0x4e14a8[_0xf915('0x2d')]);_0x4b6014[_0xf915('0x2f')]=_[_0xf915('0x40')](_0x4b6014[_0xf915('0x2c')],_0x4b6014['query']);_0x413b94[_0xf915('0x30')]=_[_0xf915('0x40')](_0x4b6014['model'],qs[_0xf915('0x31')](_0x4e14a8['query'][_0xf915('0x31')]));_0x413b94[_0xf915('0x30')]=_0x413b94[_0xf915('0x30')][_0xf915('0x32')]?_0x413b94[_0xf915('0x30')]:_0x4b6014['model'];_0x413b94[_0xf915('0x35')]=qs[_0xf915('0x36')](_0x4e14a8['query']['sort']);_0x413b94[_0xf915('0x37')]=qs[_0xf915('0x2f')](_[_0xf915('0x38')](_0x4e14a8[_0xf915('0x2d')],_0x4b6014[_0xf915('0x2f')]));if(_0x4e14a8[_0xf915('0x2d')]['filter']){_0x413b94[_0xf915('0x37')]=_['merge'](_0x413b94['where'],{'$or':_[_0xf915('0x28')](_0x413b94['attributes'],function(_0x40bdb6){var _0x279120={};_0x279120[_0x40bdb6]={'$like':'%'+_0x4e14a8[_0xf915('0x2d')][_0xf915('0x39')]+'%'};return _0x279120;})});}_0x413b94=_[_0xf915('0x3a')]({},_0x413b94,_0x4e14a8[_0xf915('0x49')]);return _0x579f66[_0xf915('0x46')](_0x413b94);}})[_0xf915('0x21')](function(_0xc486e4){if(_0xc486e4){_0x51f18=_0xc486e4[_0xf915('0x32')];if(!_0x4e14a8[_0xf915('0x2d')][_0xf915('0x4a')](_0xf915('0x33'))){_0x413b94[_0xf915('0x34')]=qs[_0xf915('0x34')](_0x4e14a8[_0xf915('0x2d')][_0xf915('0x34')]);_0x413b94[_0xf915('0x18')]=qs['offset'](_0x4e14a8[_0xf915('0x2d')][_0xf915('0x18')]);}return _0x579f66[_0xf915('0x46')](_0x413b94);}})[_0xf915('0x21')](function(_0x5edeae){if(_0x5edeae){return _0x5edeae?{'count':_0x51f18,'rows':_0x5edeae}:null;}})[_0xf915('0x21')](respondWithResult(_0x503223,null))[_0xf915('0x45')](handleError(_0x503223,null));};exports['addConfiguration']=function(_0xa47954,_0x21f181,_0x1afad8){if(_0xa47954[_0xf915('0x44')]['id']){delete _0xa47954[_0xf915('0x44')]['id'];}return db[_0xf915('0x29')][_0xf915('0x47')]({'where':{'id':_0xa47954[_0xf915('0x3f')]['id']}})[_0xf915('0x21')](handleEntityNotFound(_0x21f181,null))[_0xf915('0x21')](function(_0x4bf4f9){if(_0x4bf4f9){_0xa47954[_0xf915('0x44')]['AccountId']=_0x4bf4f9['id'];_0xa47954[_0xf915('0x44')][_0xf915('0x4b')]=integrations[_0xf915('0x4c')](_0xa47954[_0xf915('0x44')]['channel'],_0xa47954[_0xf915('0x44')]['type']);_0xa47954['body'][_0xf915('0x4d')]=integrations[_0xf915('0x4e')](_0xa47954[_0xf915('0x44')][_0xf915('0x4f')],_0xa47954['body'][_0xf915('0x3b')]);return db[_0xf915('0x48')]['create'](_0xa47954[_0xf915('0x44')],{'include':[{'model':db[_0xf915('0x50')],'as':_0xf915('0x4b')},{'model':db['ZohoField'],'as':_0xf915('0x4d')}]});}return null;})['then'](respondWithResult(_0x21f181,null))[_0xf915('0x45')](handleError(_0x21f181,null));};function getAccessToken(_0x58e0de){return new Promise(function(_0xf1deaa,_0x45d2f6){var _0x571a7a;switch(_0x58e0de[_0xf915('0x51')]){case'US':_0x571a7a=_0xf915('0x52');break;case'AU':_0x571a7a=_0xf915('0x53');break;case'EU':_0x571a7a=_0xf915('0x54');break;case'IN':_0x571a7a=_0xf915('0x55');break;case'CN':_0x571a7a=_0xf915('0x56');break;default:_0x571a7a=_0xf915('0x54');break;}var _0x3a0cb4={'method':_0xf915('0x57'),'uri':_0x571a7a+'/oauth/v2/token','qs':{'refresh_token':_0x58e0de['refreshToken'],'client_id':_0x58e0de[_0xf915('0x58')],'client_secret':_0x58e0de['clientSecret'],'grant_type':_0xf915('0x59')},'json':!![]};return rp(_0x3a0cb4)['then'](function(_0x2fccfa){if(_0x2fccfa[_0xf915('0x5a')]){_0xf1deaa(_0x2fccfa[_0xf915('0x5a')]);}else{_0x45d2f6(_0xf915('0x5b'));}})[_0xf915('0x45')](function(_0x1b2b57){_0x45d2f6(_0x1b2b57);});});}exports[_0xf915('0x5c')]=function(_0x14f109,_0x41e6b5,_0xa87bc2){var _0x479271,_0x52dbc9,_0xae99dc,_0x1a9391,_0x23ea59;return db[_0xf915('0x29')][_0xf915('0x47')]({'where':{'id':_0x14f109[_0xf915('0x3f')]['id']},'attributes':['id',_0xf915('0x5d'),_0xf915('0x51'),_0xf915('0x58'),_0xf915('0x5e'),'serverUrl','code',_0xf915('0x5f')]})[_0xf915('0x21')](handleEntityNotFound(_0x41e6b5,null))[_0xf915('0x21')](function(_0x15da0b){_0x23ea59=_0x15da0b;_0x479271=_0x23ea59[_0xf915('0x5d')];_0x52dbc9=_0x479271===_0xf915('0x60')?'eu':'com';_0xae99dc=_0x23ea59[_0xf915('0x61')];var _0x53c2e5=_0xae99dc[_0xf915('0x62')](-0x1);if(_0x53c2e5==='/'||_0x53c2e5==='\x5c'||_0x53c2e5===':'){_0xae99dc=_0xae99dc['substring'](0x0,_0xae99dc['lastIndexOf'](_0x53c2e5));}if(!_0x23ea59[_0xf915('0x5f')]){throw new Error(_0xf915('0x63'));}return getAccessToken(_0x23ea59);})[_0xf915('0x21')](function(_0x21ea85){if(_0x21ea85){return rp({'method':_0xf915('0x64'),'uri':util[_0xf915('0x65')](_0xf915('0x66'),_0x52dbc9),'qs':{'module':_0xf915('0x67')},'headers':{'Authorization':_0xf915('0x68')+_0x21ea85},'json':!![]});}})[_0xf915('0x21')](function(_0x4e676a){if(_0x4e676a){if(_0x4e676a[_0xf915('0x69')]&&_0x4e676a[_0xf915('0x69')][_0xf915('0x23')]){throw new Error(_0x4e676a[_0xf915('0x69')]['error']['message']);}var _0x128aed=[];var _0x3ad8ee=[];var _0x1017f7=[_0xf915('0x6a'),'Subject',_0xf915('0x6b'),_0xf915('0x6c'),_0xf915('0x6d'),'Call_Result',_0xf915('0x6e'),_0xf915('0x6f')];_0x3ad8ee=_[_0xf915('0x70')](_0x4e676a[_0xf915('0x31')],function(_0x42a809){return _0x1017f7[_0xf915('0x71')](_0x42a809['api_name']);});for(var _0x5bd56d=0x0;_0x5bd56d<_0x3ad8ee[_0xf915('0x32')];_0x5bd56d++){if(_0x3ad8ee[_0x5bd56d][_0xf915('0x72')]===![]){_0x128aed[_0xf915('0x73')]({'id':_0x3ad8ee[_0x5bd56d]['id'],'name':_0x3ad8ee[_0x5bd56d][_0xf915('0x74')],'custom':_0x3ad8ee[_0x5bd56d][_0xf915('0x75')],'options':_0x3ad8ee[_0x5bd56d][_0xf915('0x76')]===_0xf915('0x77')&&_0x3ad8ee[_0x5bd56d]['pick_list_values'][_0xf915('0x32')]>-0x1?_[_0xf915('0x28')](_0x3ad8ee[_0x5bd56d][_0xf915('0x78')],function(_0x1c7862){return{'name':_0x1c7862,'value':_0x1c7862};}):[]});}}return{'count':_0x128aed['length'],'rows':_0x128aed};}else{return{'count':0x0,'rows':[]};}})[_0xf915('0x21')](respondWithResult(_0x41e6b5,null))['catch'](function(_0x199079){var _0x3d74c2=_0x14f109['query'][_0xf915('0x79')]?0x1f4:_0x199079['statusCode']||0x1f4;logger[_0xf915('0x23')](_0xf915('0x7a'),_0xf915('0x5c'),_0x3d74c2,JSON[_0xf915('0x7b')](_0x199079));delete _0x199079[_0xf915('0x24')];if(_0x3d74c2===0x191){_0x3d74c2=0x190;}_0x41e6b5[_0xf915('0x25')](_0x3d74c2)['send'](_0x14f109[_0xf915('0x2d')][_0xf915('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x199079[_0xf915('0x7c')]}:_0x199079);});}; \ No newline at end of file +var _0xdc28=['send','index','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','ZohoConfiguration','order','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x3f6c60,_0x486af8){var _0x2bbe6a=function(_0x25c875){while(--_0x25c875){_0x3f6c60['push'](_0x3f6c60['shift']());}};_0x2bbe6a(++_0x486af8);}(_0xdc28,0x1e3));var _0x8dc2=function(_0x32a01a,_0x327e4){_0x32a01a=_0x32a01a-0x0;var _0x52e945=_0xdc28[_0x32a01a];return _0x52e945;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8dc2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dc2('0x1'));var moment=require('moment');var BPromise=require(_0x8dc2('0x2'));var Mustache=require(_0x8dc2('0x3'));var util=require(_0x8dc2('0x4'));var path=require(_0x8dc2('0x5'));var sox=require(_0x8dc2('0x6'));var csv=require(_0x8dc2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dc2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8dc2('0x9'));var deskjs=require(_0x8dc2('0xa'));var toCsv=require(_0x8dc2('0x7'));var querystring=require(_0x8dc2('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8dc2('0xc'));var qs=require(_0x8dc2('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dc2('0xe'));var logger=require('../../config/logger')(_0x8dc2('0xf'));var utils=require('../../config/utils');var config=require(_0x8dc2('0x10'));var licenseUtil=require(_0x8dc2('0x11'));var db=require(_0x8dc2('0x12'))['db'];var integrations=require(_0x8dc2('0x13'));function respondWithStatusCode(_0x5d9104,_0x33bda8){_0x33bda8=_0x33bda8||0xcc;return function(_0x3e580e){if(_0x3e580e){return _0x5d9104[_0x8dc2('0x14')](_0x33bda8);}return _0x5d9104['status'](_0x33bda8)['end']();};}function respondWithResult(_0xa3ad4d,_0x20ae09){_0x20ae09=_0x20ae09||0xc8;return function(_0x4f48ed){if(_0x4f48ed){return _0xa3ad4d[_0x8dc2('0x15')](_0x20ae09)[_0x8dc2('0x16')](_0x4f48ed);}};}function respondWithFilteredResult(_0x4f20c4,_0x2cf7c7){return function(_0x1d3eb9){if(_0x1d3eb9){var _0x4dc2cc=typeof _0x2cf7c7[_0x8dc2('0x17')]===_0x8dc2('0x18')&&typeof _0x2cf7c7['limit']===_0x8dc2('0x18');var _0x17ed7a=_0x1d3eb9[_0x8dc2('0x19')];var _0x3b16b1=_0x4dc2cc?0x0:_0x2cf7c7[_0x8dc2('0x17')];var _0x41957e=_0x4dc2cc?_0x1d3eb9['count']:_0x2cf7c7[_0x8dc2('0x17')]+_0x2cf7c7[_0x8dc2('0x1a')];var _0x4133f8;if(_0x41957e>=_0x17ed7a){_0x41957e=_0x17ed7a;_0x4133f8=0xc8;}else{_0x4133f8=0xce;}_0x4f20c4['status'](_0x4133f8);return _0x4f20c4['set'](_0x8dc2('0x1b'),_0x3b16b1+'-'+_0x41957e+'/'+_0x17ed7a)[_0x8dc2('0x16')](_0x1d3eb9);}return null;};}function patchUpdates(_0x24867e){return function(_0x2d29f4){try{jsonpatch[_0x8dc2('0x1c')](_0x2d29f4,_0x24867e,!![]);}catch(_0x529ea1){return BPromise[_0x8dc2('0x1d')](_0x529ea1);}return _0x2d29f4[_0x8dc2('0x1e')]();};}function saveUpdates(_0x50dd2b,_0x1af938){return function(_0x3a4333){if(_0x3a4333){return _0x3a4333[_0x8dc2('0x1f')](_0x50dd2b)[_0x8dc2('0x20')](function(_0x3d7ca1){return _0x3d7ca1;});}return null;};}function removeEntity(_0x3cbea8,_0x51deb8){return function(_0x3f035c){if(_0x3f035c){return _0x3f035c[_0x8dc2('0x21')]()[_0x8dc2('0x20')](function(){_0x3cbea8[_0x8dc2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db9a8,_0xdc86b8){return function(_0x4fb24c){if(!_0x4fb24c){_0x5db9a8['sendStatus'](0x194);}return _0x4fb24c;};}function handleError(_0x5e9fe4,_0x1932ce){_0x1932ce=_0x1932ce||0x1f4;return function(_0xc7456e){logger[_0x8dc2('0x22')](_0xc7456e[_0x8dc2('0x23')]);if(_0xc7456e[_0x8dc2('0x24')]){delete _0xc7456e[_0x8dc2('0x24')];}_0x5e9fe4['status'](_0x1932ce)[_0x8dc2('0x25')](_0xc7456e);};}exports[_0x8dc2('0x26')]=function(_0x4945c2,_0x21d626){var _0x592d3f={},_0xaa2ead={},_0x375ec3={'count':0x0,'rows':[]};var _0x14b381=_['map'](db['ZohoAccount'][_0x8dc2('0x27')],function(_0x704d7f){return{'name':_0x704d7f['fieldName'],'type':_0x704d7f[_0x8dc2('0x28')][_0x8dc2('0x29')]};});_0xaa2ead[_0x8dc2('0x2a')]=_['map'](_0x14b381,'name');_0xaa2ead[_0x8dc2('0x2b')]=_['keys'](_0x4945c2[_0x8dc2('0x2b')]);_0xaa2ead[_0x8dc2('0x2c')]=_[_0x8dc2('0x2d')](_0xaa2ead[_0x8dc2('0x2a')],_0xaa2ead[_0x8dc2('0x2b')]);_0x592d3f[_0x8dc2('0x2e')]=_[_0x8dc2('0x2d')](_0xaa2ead[_0x8dc2('0x2a')],qs[_0x8dc2('0x2f')](_0x4945c2[_0x8dc2('0x2b')][_0x8dc2('0x2f')]));_0x592d3f['attributes']=_0x592d3f[_0x8dc2('0x2e')][_0x8dc2('0x30')]?_0x592d3f[_0x8dc2('0x2e')]:_0xaa2ead[_0x8dc2('0x2a')];if(!_0x4945c2[_0x8dc2('0x2b')]['hasOwnProperty'](_0x8dc2('0x31'))){_0x592d3f['limit']=qs['limit'](_0x4945c2[_0x8dc2('0x2b')][_0x8dc2('0x1a')]);_0x592d3f[_0x8dc2('0x17')]=qs[_0x8dc2('0x17')](_0x4945c2[_0x8dc2('0x2b')]['offset']);}_0x592d3f['order']=qs[_0x8dc2('0x32')](_0x4945c2['query'][_0x8dc2('0x32')]);_0x592d3f[_0x8dc2('0x33')]=qs[_0x8dc2('0x2c')](_[_0x8dc2('0x34')](_0x4945c2['query'],_0xaa2ead[_0x8dc2('0x2c')]),_0x14b381);if(_0x4945c2[_0x8dc2('0x2b')][_0x8dc2('0x35')]){_0x592d3f[_0x8dc2('0x33')]=_[_0x8dc2('0x36')](_0x592d3f[_0x8dc2('0x33')],{'$or':_[_0x8dc2('0x37')](_0x14b381,function(_0x4ba740){if(_0x4ba740[_0x8dc2('0x28')]!==_0x8dc2('0x38')){var _0x16a688={};_0x16a688[_0x4ba740[_0x8dc2('0x24')]]={'$like':'%'+_0x4945c2['query']['filter']+'%'};return _0x16a688;}})});}_0x592d3f=_[_0x8dc2('0x36')]({},_0x592d3f,_0x4945c2[_0x8dc2('0x39')]);var _0x40d7c5={'where':_0x592d3f[_0x8dc2('0x33')]};return db[_0x8dc2('0x3a')][_0x8dc2('0x19')](_0x40d7c5)['then'](function(_0x47d179){_0x375ec3[_0x8dc2('0x19')]=_0x47d179;if(_0x4945c2[_0x8dc2('0x2b')][_0x8dc2('0x3b')]){_0x592d3f[_0x8dc2('0x3c')]=[{'all':!![]}];}return db[_0x8dc2('0x3a')][_0x8dc2('0x3d')](_0x592d3f);})[_0x8dc2('0x20')](function(_0x22704e){_0x375ec3[_0x8dc2('0x3e')]=_0x22704e;return _0x375ec3;})['then'](respondWithFilteredResult(_0x21d626,_0x592d3f))[_0x8dc2('0x3f')](handleError(_0x21d626,null));};exports[_0x8dc2('0x40')]=function(_0x2780c9,_0x2a1ca9){var _0x45a9b2={'raw':![],'where':{'id':_0x2780c9['params']['id']}},_0x334624={};_0x334624[_0x8dc2('0x2a')]=_[_0x8dc2('0x41')](db[_0x8dc2('0x3a')][_0x8dc2('0x27')]);_0x334624['query']=_[_0x8dc2('0x41')](_0x2780c9['query']);_0x334624['filters']=_[_0x8dc2('0x2d')](_0x334624[_0x8dc2('0x2a')],_0x334624[_0x8dc2('0x2b')]);_0x45a9b2['attributes']=_[_0x8dc2('0x2d')](_0x334624[_0x8dc2('0x2a')],qs[_0x8dc2('0x2f')](_0x2780c9[_0x8dc2('0x2b')][_0x8dc2('0x2f')]));_0x45a9b2[_0x8dc2('0x2e')]=_0x45a9b2[_0x8dc2('0x2e')][_0x8dc2('0x30')]?_0x45a9b2[_0x8dc2('0x2e')]:_0x334624[_0x8dc2('0x2a')];if(_0x2780c9[_0x8dc2('0x2b')][_0x8dc2('0x3b')]){_0x45a9b2[_0x8dc2('0x3c')]=[{'all':!![]}];}_0x45a9b2=_['merge']({},_0x45a9b2,_0x2780c9[_0x8dc2('0x39')]);return db[_0x8dc2('0x3a')]['find'](_0x45a9b2)[_0x8dc2('0x20')](handleEntityNotFound(_0x2a1ca9,null))['then'](respondWithResult(_0x2a1ca9,null))[_0x8dc2('0x3f')](handleError(_0x2a1ca9,null));};exports[_0x8dc2('0x42')]=function(_0x152855,_0x3b8a63){return db['ZohoAccount'][_0x8dc2('0x42')](_0x152855[_0x8dc2('0x43')],{})[_0x8dc2('0x20')](respondWithResult(_0x3b8a63,0xc9))[_0x8dc2('0x3f')](handleError(_0x3b8a63,null));};exports['update']=function(_0x415dc7,_0x2ae3e2){if(_0x415dc7['body']['id']){delete _0x415dc7[_0x8dc2('0x43')]['id'];}return db[_0x8dc2('0x3a')][_0x8dc2('0x44')]({'where':{'id':_0x415dc7[_0x8dc2('0x45')]['id']}})[_0x8dc2('0x20')](handleEntityNotFound(_0x2ae3e2,null))['then'](saveUpdates(_0x415dc7[_0x8dc2('0x43')],null))[_0x8dc2('0x20')](respondWithResult(_0x2ae3e2,null))[_0x8dc2('0x3f')](handleError(_0x2ae3e2,null));};exports[_0x8dc2('0x21')]=function(_0x2aaaad,_0x2cfbe4){return db[_0x8dc2('0x3a')][_0x8dc2('0x44')]({'where':{'id':_0x2aaaad['params']['id']}})[_0x8dc2('0x20')](handleEntityNotFound(_0x2cfbe4,null))[_0x8dc2('0x20')](removeEntity(_0x2cfbe4,null))[_0x8dc2('0x3f')](handleError(_0x2cfbe4,null));};exports['getConfigurations']=function(_0x3fe428,_0x1cf14e,_0x130a67){var _0x450c45={};var _0x5b42a9={};var _0x245836;var _0x2d0b37;return db[_0x8dc2('0x3a')]['findOne']({'where':{'id':_0x3fe428[_0x8dc2('0x45')]['id']}})['then'](handleEntityNotFound(_0x1cf14e,null))['then'](function(_0x36de67){if(_0x36de67){_0x245836=_0x36de67;_0x5b42a9[_0x8dc2('0x2a')]=_['keys'](db[_0x8dc2('0x46')][_0x8dc2('0x27')]);_0x5b42a9[_0x8dc2('0x2b')]=_[_0x8dc2('0x41')](_0x3fe428[_0x8dc2('0x2b')]);_0x5b42a9[_0x8dc2('0x2c')]=_[_0x8dc2('0x2d')](_0x5b42a9[_0x8dc2('0x2a')],_0x5b42a9[_0x8dc2('0x2b')]);_0x450c45['attributes']=_['intersection'](_0x5b42a9[_0x8dc2('0x2a')],qs[_0x8dc2('0x2f')](_0x3fe428['query'][_0x8dc2('0x2f')]));_0x450c45['attributes']=_0x450c45[_0x8dc2('0x2e')][_0x8dc2('0x30')]?_0x450c45[_0x8dc2('0x2e')]:_0x5b42a9['model'];_0x450c45[_0x8dc2('0x47')]=qs[_0x8dc2('0x32')](_0x3fe428[_0x8dc2('0x2b')][_0x8dc2('0x32')]);_0x450c45['where']=qs['filters'](_['pick'](_0x3fe428[_0x8dc2('0x2b')],_0x5b42a9[_0x8dc2('0x2c')]));if(_0x3fe428[_0x8dc2('0x2b')][_0x8dc2('0x35')]){_0x450c45['where']=_[_0x8dc2('0x36')](_0x450c45['where'],{'$or':_[_0x8dc2('0x37')](_0x450c45['attributes'],function(_0x1fe985){var _0x3a4b7d={};_0x3a4b7d[_0x1fe985]={'$like':'%'+_0x3fe428[_0x8dc2('0x2b')][_0x8dc2('0x35')]+'%'};return _0x3a4b7d;})});}_0x450c45=_[_0x8dc2('0x36')]({},_0x450c45,_0x3fe428[_0x8dc2('0x39')]);return _0x245836[_0x8dc2('0x48')](_0x450c45);}})[_0x8dc2('0x20')](function(_0x2f1607){if(_0x2f1607){_0x2d0b37=_0x2f1607[_0x8dc2('0x30')];if(!_0x3fe428[_0x8dc2('0x2b')]['hasOwnProperty'](_0x8dc2('0x31'))){_0x450c45[_0x8dc2('0x1a')]=qs[_0x8dc2('0x1a')](_0x3fe428[_0x8dc2('0x2b')][_0x8dc2('0x1a')]);_0x450c45['offset']=qs[_0x8dc2('0x17')](_0x3fe428[_0x8dc2('0x2b')][_0x8dc2('0x17')]);}return _0x245836[_0x8dc2('0x48')](_0x450c45);}})[_0x8dc2('0x20')](function(_0xd4799d){if(_0xd4799d){return _0xd4799d?{'count':_0x2d0b37,'rows':_0xd4799d}:null;}})['then'](respondWithResult(_0x1cf14e,null))[_0x8dc2('0x3f')](handleError(_0x1cf14e,null));};exports[_0x8dc2('0x49')]=function(_0x59025e,_0x2dfd68,_0x10da53){if(_0x59025e[_0x8dc2('0x43')]['id']){delete _0x59025e[_0x8dc2('0x43')]['id'];}return db[_0x8dc2('0x3a')][_0x8dc2('0x4a')]({'where':{'id':_0x59025e[_0x8dc2('0x45')]['id']}})[_0x8dc2('0x20')](handleEntityNotFound(_0x2dfd68,null))[_0x8dc2('0x20')](function(_0x15c3e1){if(_0x15c3e1){_0x59025e[_0x8dc2('0x43')][_0x8dc2('0x4b')]=_0x15c3e1['id'];_0x59025e['body']['Subjects']=integrations[_0x8dc2('0x4c')](_0x59025e['body'][_0x8dc2('0x4d')],_0x59025e[_0x8dc2('0x43')]['type']);_0x59025e['body'][_0x8dc2('0x4e')]=integrations['getDescriptions'](_0x59025e[_0x8dc2('0x43')]['channel'],_0x59025e[_0x8dc2('0x43')][_0x8dc2('0x28')]);return db[_0x8dc2('0x46')][_0x8dc2('0x42')](_0x59025e[_0x8dc2('0x43')],{'include':[{'model':db[_0x8dc2('0x4f')],'as':_0x8dc2('0x50')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x8dc2('0x20')](respondWithResult(_0x2dfd68,null))['catch'](handleError(_0x2dfd68,null));};function getAccessToken(_0x5f040e){return new Promise(function(_0x28de91,_0x383737){var _0x184d36;switch(_0x5f040e[_0x8dc2('0x51')]){case'US':_0x184d36=_0x8dc2('0x52');break;case'AU':_0x184d36='https://accounts.zoho.com.au';break;case'EU':_0x184d36=_0x8dc2('0x53');break;case'IN':_0x184d36=_0x8dc2('0x54');break;case'CN':_0x184d36=_0x8dc2('0x55');break;default:_0x184d36=_0x8dc2('0x53');break;}var _0x22bc1a={'method':_0x8dc2('0x56'),'uri':_0x184d36+_0x8dc2('0x57'),'qs':{'refresh_token':_0x5f040e[_0x8dc2('0x58')],'client_id':_0x5f040e[_0x8dc2('0x59')],'client_secret':_0x5f040e[_0x8dc2('0x5a')],'grant_type':_0x8dc2('0x5b')},'json':!![]};return rp(_0x22bc1a)[_0x8dc2('0x20')](function(_0x527887){if(_0x527887[_0x8dc2('0x5c')]){_0x28de91(_0x527887[_0x8dc2('0x5c')]);}else{_0x383737(_0x8dc2('0x5d'));}})[_0x8dc2('0x3f')](function(_0x1f7e89){_0x383737(_0x1f7e89);});});}exports[_0x8dc2('0x5e')]=function(_0x1be4c8,_0x27ce01,_0x28530a){var _0x47fcdf,_0x1b372b,_0x5b6a8d,_0x3ace6a,_0x58d403;return db[_0x8dc2('0x3a')][_0x8dc2('0x4a')]({'where':{'id':_0x1be4c8[_0x8dc2('0x45')]['id']},'attributes':['id',_0x8dc2('0x5f'),'zone',_0x8dc2('0x59'),_0x8dc2('0x5a'),_0x8dc2('0x60'),_0x8dc2('0x61'),_0x8dc2('0x58')]})['then'](handleEntityNotFound(_0x27ce01,null))['then'](function(_0xe15760){_0x58d403=_0xe15760;_0x47fcdf=_0x58d403[_0x8dc2('0x5f')];_0x1b372b=_0x47fcdf==='zoho.eu'?'eu':_0x8dc2('0x62');_0x5b6a8d=_0x58d403['serverUrl'];var _0x3bc36c=_0x5b6a8d[_0x8dc2('0x63')](-0x1);if(_0x3bc36c==='/'||_0x3bc36c==='\x5c'||_0x3bc36c===':'){_0x5b6a8d=_0x5b6a8d[_0x8dc2('0x64')](0x0,_0x5b6a8d[_0x8dc2('0x65')](_0x3bc36c));}if(!_0x58d403[_0x8dc2('0x58')]){throw new Error(_0x8dc2('0x66'));}return getAccessToken(_0x58d403);})[_0x8dc2('0x20')](function(_0x377edf){if(_0x377edf){return rp({'method':_0x8dc2('0x67'),'uri':util[_0x8dc2('0x68')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1b372b),'qs':{'module':_0x8dc2('0x69')},'headers':{'Authorization':_0x8dc2('0x6a')+_0x377edf},'json':!![]});}})[_0x8dc2('0x20')](function(_0x126fde){if(_0x126fde){if(_0x126fde[_0x8dc2('0x6b')]&&_0x126fde[_0x8dc2('0x6b')][_0x8dc2('0x22')]){throw new Error(_0x126fde['response'][_0x8dc2('0x22')][_0x8dc2('0x6c')]);}var _0x1e316d=[];var _0x523895=[];var _0x21bf31=[_0x8dc2('0x6d'),'Subject',_0x8dc2('0x6e'),_0x8dc2('0x6f'),_0x8dc2('0x70'),_0x8dc2('0x71'),_0x8dc2('0x72'),_0x8dc2('0x73')];_0x523895=_[_0x8dc2('0x74')](_0x126fde[_0x8dc2('0x2f')],function(_0x2de450){return _0x21bf31['includes'](_0x2de450[_0x8dc2('0x75')]);});for(var _0x1e0470=0x0;_0x1e0470<_0x523895[_0x8dc2('0x30')];_0x1e0470++){if(_0x523895[_0x1e0470][_0x8dc2('0x76')]===![]){_0x1e316d[_0x8dc2('0x77')]({'id':_0x523895[_0x1e0470]['id'],'name':_0x523895[_0x1e0470][_0x8dc2('0x78')],'custom':_0x523895[_0x1e0470][_0x8dc2('0x79')],'options':_0x523895[_0x1e0470][_0x8dc2('0x7a')]===_0x8dc2('0x7b')&&_0x523895[_0x1e0470][_0x8dc2('0x7c')][_0x8dc2('0x30')]>-0x1?_[_0x8dc2('0x37')](_0x523895[_0x1e0470]['pick_list_values'],function(_0x300444){return{'name':_0x300444,'value':_0x300444};}):[]});}}return{'count':_0x1e316d[_0x8dc2('0x30')],'rows':_0x1e316d};}else{return{'count':0x0,'rows':[]};}})[_0x8dc2('0x20')](respondWithResult(_0x27ce01,null))[_0x8dc2('0x3f')](function(_0x19e0a8){var _0x15bc8f=_0x1be4c8[_0x8dc2('0x2b')][_0x8dc2('0x7d')]?0x1f4:_0x19e0a8[_0x8dc2('0x7e')]||0x1f4;logger[_0x8dc2('0x22')](_0x8dc2('0x7f'),_0x8dc2('0x5e'),_0x15bc8f,JSON[_0x8dc2('0x80')](_0x19e0a8));delete _0x19e0a8[_0x8dc2('0x24')];if(_0x15bc8f===0x191){_0x15bc8f=0x190;}_0x27ce01['status'](_0x15bc8f)[_0x8dc2('0x25')](_0x1be4c8[_0x8dc2('0x2b')][_0x8dc2('0x7d')]?{'message':_0x8dc2('0x81'),'statusCode':_0x19e0a8['statusCode']}:_0x19e0a8);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0f7a82a..377b424 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 _0x4e67=['slice','substring','https://accounts.zoho.in','then','refreshToken','error','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect'];(function(_0x524b27,_0x45dbdf){var _0x24e32c=function(_0x13856a){while(--_0x13856a){_0x524b27['push'](_0x524b27['shift']());}};_0x24e32c(++_0x45dbdf);}(_0x4e67,0x133));var _0x74e6=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x4e67[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0x74e6('0x0'));var util=require('util');var logger=require(_0x74e6('0x1'))(_0x74e6('0x2'));var moment=require('moment');var BPromise=require(_0x74e6('0x3'));var rp=require(_0x74e6('0x4'));var fs=require('fs');var path=require(_0x74e6('0x5'));var rimraf=require(_0x74e6('0x6'));var config=require('../../config/environment');var attributes=require(_0x74e6('0x7'));var integrations=require(_0x74e6('0x8'));module[_0x74e6('0x9')]=function(_0x4ecc6e,_0x26d92b){return _0x4ecc6e[_0x74e6('0xa')](_0x74e6('0xb'),attributes,{'tableName':_0x74e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b952b,_0x2c95df,_0x3c41b2){if(_0x3b952b[_0x74e6('0xd')](_0x74e6('0xe'))||_0x3b952b['changed'](_0x74e6('0xf'))||_0x3b952b[_0x74e6('0xd')](_0x74e6('0x10'))||_0x3b952b['changed']('clientSecret')||_0x3b952b['changed'](_0x74e6('0x11'))||_0x3b952b[_0x74e6('0xd')](_0x74e6('0x12'))){var _0x1eae0f,_0x3a67ef;_0x1eae0f=_0x3b952b[_0x74e6('0xf')];var _0x5464d8=_0x1eae0f['slice'](-0x1);if(_0x5464d8==='/'||_0x5464d8==='\x5c'||_0x5464d8===':'){_0x1eae0f=_0x1eae0f['substring'](0x0,_0x1eae0f[_0x74e6('0x13')](_0x5464d8));}switch(_0x3b952b[_0x74e6('0xe')]){case'US':_0x3a67ef=_0x74e6('0x14');break;case'AU':_0x3a67ef=_0x74e6('0x15');break;case'IN':_0x3a67ef='https://accounts.zoho.in';break;case'CN':_0x3a67ef=_0x74e6('0x16');break;default:_0x3a67ef='https://accounts.zoho.eu';break;}var _0x305082={'method':_0x74e6('0x17'),'uri':_0x3a67ef+_0x74e6('0x18'),'form':{'grant_type':_0x74e6('0x19'),'client_id':_0x3b952b[_0x74e6('0x10')],'client_secret':_0x3b952b[_0x74e6('0x1a')],'redirect_uri':_0x3b952b[_0x74e6('0xf')],'code':_0x3b952b[_0x74e6('0x11')]},'headers':{'Content-Type':_0x74e6('0x1b')}};return rp(_0x305082)['then'](function(_0x243187){var _0x51128b=JSON[_0x74e6('0x1c')](_0x243187);if(_0x51128b[_0x74e6('0x1d')]){_0x3b952b['refreshToken']=_0x51128b[_0x74e6('0x1d')];logger[_0x74e6('0x1e')](util[_0x74e6('0x1f')](_0x74e6('0x20'),_0x3b952b[_0x74e6('0x21')],_0x3b952b['id']));}else{logger['error'](util[_0x74e6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b952b[_0x74e6('0x21')],_0x3b952b['id']),util['inspect'](_0x51128b,{'showHidden':![],'depth':null}));}return _0x3c41b2(null,_0x2c95df);})[_0x74e6('0x22')](function(_0x490ffa){logger['error'](util[_0x74e6('0x1f')](_0x74e6('0x23'),_0x3b952b[_0x74e6('0x21')],_0x3b952b['id']),util[_0x74e6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3c41b2(_0x490ffa);});}else{return _0x3c41b2(null,_0x2c95df);}},'beforeUpdate':function(_0x503a42,_0x50a7bd,_0xb4faf4){if(_0x503a42['changed'](_0x74e6('0xe'))||_0x503a42[_0x74e6('0xd')](_0x74e6('0xf'))||_0x503a42['changed'](_0x74e6('0x10'))||_0x503a42[_0x74e6('0xd')](_0x74e6('0x1a'))||_0x503a42[_0x74e6('0xd')]('code')||_0x503a42['changed'](_0x74e6('0x12'))){var _0x7a18c6,_0x431a2a;_0x7a18c6=_0x503a42[_0x74e6('0xf')];var _0x23082c=_0x7a18c6[_0x74e6('0x25')](-0x1);if(_0x23082c==='/'||_0x23082c==='\x5c'||_0x23082c===':'){_0x7a18c6=_0x7a18c6[_0x74e6('0x26')](0x0,_0x7a18c6[_0x74e6('0x13')](_0x23082c));}switch(_0x503a42[_0x74e6('0xe')]){case'US':_0x431a2a=_0x74e6('0x14');break;case'AU':_0x431a2a=_0x74e6('0x15');break;case'IN':_0x431a2a=_0x74e6('0x27');break;case'CN':_0x431a2a=_0x74e6('0x16');break;default:_0x431a2a='https://accounts.zoho.eu';break;}var _0x3203d4={'method':_0x74e6('0x17'),'uri':_0x431a2a+_0x74e6('0x18'),'form':{'grant_type':_0x74e6('0x19'),'client_id':_0x503a42['clientId'],'client_secret':_0x503a42[_0x74e6('0x1a')],'redirect_uri':_0x503a42[_0x74e6('0xf')],'code':_0x503a42['code']},'headers':{'Content-Type':_0x74e6('0x1b')}};return rp(_0x3203d4)[_0x74e6('0x28')](function(_0x2fe197){var _0x1d4e2e=JSON[_0x74e6('0x1c')](_0x2fe197);if(_0x1d4e2e[_0x74e6('0x1d')]){_0x503a42[_0x74e6('0x29')]=_0x1d4e2e[_0x74e6('0x1d')];logger[_0x74e6('0x1e')](util[_0x74e6('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x503a42[_0x74e6('0x21')],_0x503a42['id']));}else{logger[_0x74e6('0x2a')](util[_0x74e6('0x1f')](_0x74e6('0x23'),_0x503a42[_0x74e6('0x21')],_0x503a42['id']),util[_0x74e6('0x24')](_0x1d4e2e,{'showHidden':![],'depth':null}));}return _0xb4faf4(null,_0x50a7bd);})[_0x74e6('0x22')](function(_0x574120){logger[_0x74e6('0x2a')](util[_0x74e6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x503a42[_0x74e6('0x21')],_0x503a42['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xb4faf4(_0x574120);});}else{return _0xb4faf4(null,_0x50a7bd);}}}});}; \ No newline at end of file +var _0x8df4=['clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','changed','zone'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8df4,0x16b));var _0x48df=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x8df4[_0x2d344f];return _0x2e796b;};'use strict';var _=require(_0x48df('0x0'));var util=require(_0x48df('0x1'));var logger=require(_0x48df('0x2'))(_0x48df('0x3'));var moment=require(_0x48df('0x4'));var BPromise=require('bluebird');var rp=require(_0x48df('0x5'));var fs=require('fs');var path=require(_0x48df('0x6'));var rimraf=require(_0x48df('0x7'));var config=require(_0x48df('0x8'));var attributes=require(_0x48df('0x9'));var integrations=require(_0x48df('0xa'));module[_0x48df('0xb')]=function(_0x27a0a8,_0x221720){return _0x27a0a8['define']('ZohoAccount',attributes,{'tableName':_0x48df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5dd788,_0x20b7bd,_0x48a2e2){if(_0x5dd788[_0x48df('0xd')](_0x48df('0xe'))||_0x5dd788[_0x48df('0xd')]('serverUrl')||_0x5dd788[_0x48df('0xd')](_0x48df('0xf'))||_0x5dd788[_0x48df('0xd')](_0x48df('0x10'))||_0x5dd788['changed'](_0x48df('0x11'))||_0x5dd788['changed'](_0x48df('0x12'))){var _0x2e7b5e,_0x23fbf3;_0x2e7b5e=_0x5dd788[_0x48df('0x13')];var _0x31e74e=_0x2e7b5e[_0x48df('0x14')](-0x1);if(_0x31e74e==='/'||_0x31e74e==='\x5c'||_0x31e74e===':'){_0x2e7b5e=_0x2e7b5e[_0x48df('0x15')](0x0,_0x2e7b5e[_0x48df('0x16')](_0x31e74e));}switch(_0x5dd788[_0x48df('0xe')]){case'US':_0x23fbf3=_0x48df('0x17');break;case'AU':_0x23fbf3=_0x48df('0x18');break;case'IN':_0x23fbf3=_0x48df('0x19');break;case'CN':_0x23fbf3='https://accounts.zoho.com.cn';break;default:_0x23fbf3=_0x48df('0x1a');break;}var _0xec6696={'method':_0x48df('0x1b'),'uri':_0x23fbf3+_0x48df('0x1c'),'form':{'grant_type':_0x48df('0x1d'),'client_id':_0x5dd788['clientId'],'client_secret':_0x5dd788['clientSecret'],'redirect_uri':_0x5dd788['serverUrl'],'code':_0x5dd788[_0x48df('0x11')]},'headers':{'Content-Type':_0x48df('0x1e')}};return rp(_0xec6696)[_0x48df('0x1f')](function(_0x3f1b21){var _0x1ec272=JSON[_0x48df('0x20')](_0x3f1b21);if(_0x1ec272[_0x48df('0x21')]){_0x5dd788['refreshToken']=_0x1ec272[_0x48df('0x21')];logger[_0x48df('0x22')](util[_0x48df('0x23')](_0x48df('0x24'),_0x5dd788['name'],_0x5dd788['id']));}else{logger['error'](util[_0x48df('0x23')](_0x48df('0x25'),_0x5dd788[_0x48df('0x26')],_0x5dd788['id']),util[_0x48df('0x27')](_0x1ec272,{'showHidden':![],'depth':null}));}return _0x48a2e2(null,_0x20b7bd);})[_0x48df('0x28')](function(_0x44e898){logger[_0x48df('0x29')](util[_0x48df('0x23')](_0x48df('0x25'),_0x5dd788[_0x48df('0x26')],_0x5dd788['id']),util[_0x48df('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x48a2e2(_0x44e898);});}else{return _0x48a2e2(null,_0x20b7bd);}},'beforeUpdate':function(_0x185697,_0x2c680c,_0x1fd4f8){if(_0x185697[_0x48df('0xd')](_0x48df('0xe'))||_0x185697[_0x48df('0xd')](_0x48df('0x13'))||_0x185697['changed'](_0x48df('0xf'))||_0x185697[_0x48df('0xd')](_0x48df('0x10'))||_0x185697[_0x48df('0xd')]('code')||_0x185697[_0x48df('0xd')]('host')){var _0x24b8d3,_0x3c672e;_0x24b8d3=_0x185697['serverUrl'];var _0x181935=_0x24b8d3[_0x48df('0x14')](-0x1);if(_0x181935==='/'||_0x181935==='\x5c'||_0x181935===':'){_0x24b8d3=_0x24b8d3[_0x48df('0x15')](0x0,_0x24b8d3['lastIndexOf'](_0x181935));}switch(_0x185697[_0x48df('0xe')]){case'US':_0x3c672e=_0x48df('0x17');break;case'AU':_0x3c672e=_0x48df('0x18');break;case'IN':_0x3c672e=_0x48df('0x19');break;case'CN':_0x3c672e='https://accounts.zoho.com.cn';break;default:_0x3c672e=_0x48df('0x1a');break;}var _0x22eefd={'method':_0x48df('0x1b'),'uri':_0x3c672e+'/oauth/v2/token','form':{'grant_type':_0x48df('0x1d'),'client_id':_0x185697[_0x48df('0xf')],'client_secret':_0x185697[_0x48df('0x10')],'redirect_uri':_0x185697[_0x48df('0x13')],'code':_0x185697['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x22eefd)[_0x48df('0x1f')](function(_0x4f3712){var _0x5d0cd4=JSON[_0x48df('0x20')](_0x4f3712);if(_0x5d0cd4[_0x48df('0x21')]){_0x185697['refreshToken']=_0x5d0cd4[_0x48df('0x21')];logger[_0x48df('0x22')](util[_0x48df('0x23')](_0x48df('0x24'),_0x185697[_0x48df('0x26')],_0x185697['id']));}else{logger[_0x48df('0x29')](util['format'](_0x48df('0x25'),_0x185697['name'],_0x185697['id']),util['inspect'](_0x5d0cd4,{'showHidden':![],'depth':null}));}return _0x1fd4f8(null,_0x2c680c);})[_0x48df('0x28')](function(_0x13ad8f){logger[_0x48df('0x29')](util[_0x48df('0x23')](_0x48df('0x25'),_0x185697[_0x48df('0x26')],_0x185697['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1fd4f8(_0x13ad8f);});}else{return _0x1fd4f8(null,_0x2c680c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 25bec42..ba2f51f 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 _0xd5a2=['error','code','message','catch','ZohoAccount','findAll','options','where','attributes','include','map','model','GetZohoAccount','ShowZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x463697,_0xccfdc4){var _0x33cfe1=function(_0x5c74ec){while(--_0x5c74ec){_0x463697['push'](_0x463697['shift']());}};_0x33cfe1(++_0xccfdc4);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x29ed08,_0x3e673c){_0x29ed08=_0x29ed08-0x0;var _0x4027ad=_0xd5a2[_0x29ed08];return _0x4027ad;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));var BPromise=require(_0x2d5a('0x2'));var rs=require(_0x2d5a('0x3'));var fs=require('fs');var Redis=require(_0x2d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d5a('0x5'));var logger=require(_0x2d5a('0x6'))(_0x2d5a('0x7'));var config=require(_0x2d5a('0x8'));var jayson=require(_0x2d5a('0x9'));var client=jayson[_0x2d5a('0xa')][_0x2d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae103,_0x1cdfc4,_0x7eb4c3){return new BPromise(function(_0x79898c,_0x4d5c52){return client['request'](_0x1ae103,_0x7eb4c3)[_0x2d5a('0xc')](function(_0x562b6a){logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,'request\x20sent');logger[_0x2d5a('0xf')](_0x2d5a('0x10'),_0x1cdfc4,_0x2d5a('0x11'),JSON[_0x2d5a('0x12')](_0x562b6a));if(_0x562b6a[_0x2d5a('0x13')]){if(_0x562b6a['error'][_0x2d5a('0x14')]===0x1f4){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x4d5c52(_0x562b6a['error'][_0x2d5a('0x15')]);}logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x79898c(_0x562b6a[_0x2d5a('0x13')][_0x2d5a('0x15')]);}else{logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,_0x2d5a('0x11'));_0x79898c(_0x562b6a['result'][_0x2d5a('0x15')]);}})[_0x2d5a('0x16')](function(_0x38de62){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x38de62);_0x4d5c52(_0x38de62);});});}exports['GetZohoAccount']=function(_0x454c53){var _0x50f723=this;return new Promise(function(_0x34ae77,_0x29692e){return db[_0x2d5a('0x17')][_0x2d5a('0x18')]({'raw':_0x454c53['options']?_0x454c53['options']['raw']===undefined?!![]:![]:!![],'where':_0x454c53['options']?_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1a')]||null:null,'attributes':_0x454c53['options']?_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1b')]||null:null,'limit':_0x454c53[_0x2d5a('0x19')]?_0x454c53[_0x2d5a('0x19')]['limit']||null:null,'include':_0x454c53[_0x2d5a('0x19')]?_0x454c53['options'][_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1c')],function(_0x5f1c75){return{'model':db[_0x5f1c75['model']],'as':_0x5f1c75['as'],'attributes':_0x5f1c75['attributes'],'include':_0x5f1c75[_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x5f1c75[_0x2d5a('0x1c')],function(_0x304b9a){return{'model':db[_0x304b9a[_0x2d5a('0x1e')]],'as':_0x304b9a['as'],'attributes':_0x304b9a[_0x2d5a('0x1b')],'include':_0x304b9a['include']?_[_0x2d5a('0x1d')](_0x304b9a[_0x2d5a('0x1c')],function(_0x24f733){return{'model':db[_0x24f733[_0x2d5a('0x1e')]],'as':_0x24f733['as'],'attributes':_0x24f733[_0x2d5a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d5a('0xc')](function(_0x4fb606){logger['info'](_0x2d5a('0x1f'),_0x454c53);logger[_0x2d5a('0xf')]('GetZohoAccount',_0x454c53,JSON[_0x2d5a('0x12')](_0x4fb606));_0x34ae77(_0x4fb606);})[_0x2d5a('0x16')](function(_0x199686){logger[_0x2d5a('0x13')](_0x2d5a('0x1f'),_0x199686[_0x2d5a('0x15')],_0x454c53);_0x29692e(_0x50f723[_0x2d5a('0x13')](0x1f4,_0x199686[_0x2d5a('0x15')]));});});};exports[_0x2d5a('0x20')]=function(_0x3e8fda){var _0xf62d6e=this;return new Promise(function(_0x3a55ff,_0x598b61){return db[_0x2d5a('0x17')][_0x2d5a('0x21')]({'raw':_0x3e8fda['options']?_0x3e8fda[_0x2d5a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3e8fda['options']?_0x3e8fda['options']['where']||null:null,'attributes':_0x3e8fda[_0x2d5a('0x19')]?_0x3e8fda['options'][_0x2d5a('0x1b')]||null:null,'include':_0x3e8fda[_0x2d5a('0x19')]?_0x3e8fda['options'][_0x2d5a('0x1c')]?_['map'](_0x3e8fda[_0x2d5a('0x19')][_0x2d5a('0x1c')],function(_0x69f4f){return{'model':db[_0x69f4f['model']],'as':_0x69f4f['as'],'attributes':_0x69f4f[_0x2d5a('0x1b')],'include':_0x69f4f[_0x2d5a('0x1c')]?_['map'](_0x69f4f[_0x2d5a('0x1c')],function(_0x4f0792){return{'model':db[_0x4f0792[_0x2d5a('0x1e')]],'as':_0x4f0792['as'],'attributes':_0x4f0792[_0x2d5a('0x1b')],'include':_0x4f0792[_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x4f0792[_0x2d5a('0x1c')],function(_0x3e166f){return{'model':db[_0x3e166f[_0x2d5a('0x1e')]],'as':_0x3e166f['as'],'attributes':_0x3e166f[_0x2d5a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d5a('0xc')](function(_0x31955b){logger[_0x2d5a('0xd')]('ShowZohoAccount',_0x3e8fda);logger[_0x2d5a('0xf')]('ShowZohoAccount',_0x3e8fda,JSON['stringify'](_0x31955b));_0x3a55ff(_0x31955b);})[_0x2d5a('0x16')](function(_0x33c16e){logger[_0x2d5a('0x13')](_0x2d5a('0x20'),_0x33c16e[_0x2d5a('0x15')],_0x3e8fda);_0x598b61(_0xf62d6e[_0x2d5a('0x13')](0x1f4,_0x33c16e['message']));});});}; \ No newline at end of file +var _0x0954=['ZohoAccount','options','raw','attributes','limit','include','map','model','then','find','ShowZohoAccount','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount'];(function(_0x386574,_0x4f92e9){var _0x1f8da8=function(_0x35bd24){while(--_0x35bd24){_0x386574['push'](_0x386574['shift']());}};_0x1f8da8(++_0x4f92e9);}(_0x0954,0x135));var _0x4095=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x0954[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0x4095('0x0'));var util=require('util');var moment=require(_0x4095('0x1'));var BPromise=require(_0x4095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4095('0x3'));var db=require(_0x4095('0x4'))['db'];var utils=require(_0x4095('0x5'));var logger=require(_0x4095('0x6'))(_0x4095('0x7'));var config=require(_0x4095('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14b440,_0x352c8f,_0x1cf027){return new BPromise(function(_0x1440af,_0x24adfd){return client[_0x4095('0x9')](_0x14b440,_0x1cf027)['then'](function(_0x158dc7){logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,'request\x20sent');logger[_0x4095('0xc')](_0x4095('0xd'),_0x352c8f,_0x4095('0xe'),JSON['stringify'](_0x158dc7));if(_0x158dc7[_0x4095('0xf')]){if(_0x158dc7['error'][_0x4095('0x10')]===0x1f4){logger['error'](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x24adfd(_0x158dc7['error']['message']);}logger[_0x4095('0xf')](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x1440af(_0x158dc7['error']['message']);}else{logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,_0x4095('0xe'));_0x1440af(_0x158dc7[_0x4095('0x12')][_0x4095('0x11')]);}})[_0x4095('0x13')](function(_0x50c8c0){logger['error'](_0x4095('0xb'),_0x352c8f,_0x50c8c0);_0x24adfd(_0x50c8c0);});});}exports[_0x4095('0x14')]=function(_0x47ebf5){var _0x52d4d1=this;return new Promise(function(_0x5c3503,_0x59e95b){return db[_0x4095('0x15')]['findAll']({'raw':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x17')]===undefined?!![]:![]:!![],'where':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5['options']['where']||null:null,'attributes':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x18')]||null:null,'limit':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x19')]||null:null,'include':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x47ebf5[_0x4095('0x16')][_0x4095('0x1a')],function(_0x440631){return{'model':db[_0x440631[_0x4095('0x1c')]],'as':_0x440631['as'],'attributes':_0x440631['attributes'],'include':_0x440631['include']?_[_0x4095('0x1b')](_0x440631[_0x4095('0x1a')],function(_0x26604f){return{'model':db[_0x26604f['model']],'as':_0x26604f['as'],'attributes':_0x26604f['attributes'],'include':_0x26604f[_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x26604f[_0x4095('0x1a')],function(_0xbe5842){return{'model':db[_0xbe5842[_0x4095('0x1c')]],'as':_0xbe5842['as'],'attributes':_0xbe5842['attributes']};}):[]};}):[]};}):[]:[]})[_0x4095('0x1d')](function(_0xf87fd4){logger[_0x4095('0xa')](_0x4095('0x14'),_0x47ebf5);logger['debug'](_0x4095('0x14'),_0x47ebf5,JSON['stringify'](_0xf87fd4));_0x5c3503(_0xf87fd4);})['catch'](function(_0x199b7d){logger[_0x4095('0xf')](_0x4095('0x14'),_0x199b7d[_0x4095('0x11')],_0x47ebf5);_0x59e95b(_0x52d4d1['error'](0x1f4,_0x199b7d[_0x4095('0x11')]));});});};exports['ShowZohoAccount']=function(_0x347df8){var _0x3f2516=this;return new Promise(function(_0x4eb0ab,_0x3c49c0){return db[_0x4095('0x15')][_0x4095('0x1e')]({'raw':_0x347df8[_0x4095('0x16')]?_0x347df8[_0x4095('0x16')][_0x4095('0x17')]===undefined?!![]:![]:!![],'where':_0x347df8[_0x4095('0x16')]?_0x347df8[_0x4095('0x16')]['where']||null:null,'attributes':_0x347df8[_0x4095('0x16')]?_0x347df8['options'][_0x4095('0x18')]||null:null,'include':_0x347df8[_0x4095('0x16')]?_0x347df8['options'][_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x347df8[_0x4095('0x16')][_0x4095('0x1a')],function(_0x31834d){return{'model':db[_0x31834d[_0x4095('0x1c')]],'as':_0x31834d['as'],'attributes':_0x31834d[_0x4095('0x18')],'include':_0x31834d[_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x31834d['include'],function(_0x336e22){return{'model':db[_0x336e22[_0x4095('0x1c')]],'as':_0x336e22['as'],'attributes':_0x336e22['attributes'],'include':_0x336e22[_0x4095('0x1a')]?_['map'](_0x336e22['include'],function(_0x27dceb){return{'model':db[_0x27dceb[_0x4095('0x1c')]],'as':_0x27dceb['as'],'attributes':_0x27dceb[_0x4095('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b9e8){logger[_0x4095('0xa')](_0x4095('0x1f'),_0x347df8);logger[_0x4095('0xc')]('ShowZohoAccount',_0x347df8,JSON[_0x4095('0x20')](_0x53b9e8));_0x4eb0ab(_0x53b9e8);})[_0x4095('0x13')](function(_0x1375e7){logger[_0x4095('0xf')](_0x4095('0x1f'),_0x1375e7[_0x4095('0x11')],_0x347df8);_0x3c49c0(_0x3f2516[_0x4095('0xf')](0x1f4,_0x1375e7[_0x4095('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 23e64a5..fe70b3e 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 _0x5523=['/:id','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x5a1460,_0x1eadf1){var _0x272674=function(_0x42cbda){while(--_0x42cbda){_0x5a1460['push'](_0x5a1460['shift']());}};_0x272674(++_0x1eadf1);}(_0x5523,0x8f));var _0x3552=function(_0x2b2dac,_0x19b9c9){_0x2b2dac=_0x2b2dac-0x0;var _0x5537c2=_0x5523[_0x2b2dac];return _0x5537c2;};'use strict';var multer=require('multer');var util=require(_0x3552('0x0'));var path=require('path');var timeout=require(_0x3552('0x1'));var express=require(_0x3552('0x2'));var router=express['Router']();var fs_extra=require(_0x3552('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3552('0x4'));var config=require(_0x3552('0x5'));var controller=require(_0x3552('0x6'));router['get']('/',auth[_0x3552('0x7')](),controller[_0x3552('0x8')]);router[_0x3552('0x9')]('/:id',auth[_0x3552('0x7')](),controller['show']);router[_0x3552('0x9')]('/:id/fields',auth[_0x3552('0x7')](),controller[_0x3552('0xa')]);router[_0x3552('0x9')](_0x3552('0xb'),auth[_0x3552('0x7')](),controller[_0x3552('0xc')]);router['get'](_0x3552('0xd'),auth[_0x3552('0x7')](),controller[_0x3552('0xe')]);router[_0x3552('0xf')]('/',auth[_0x3552('0x7')](),controller['create']);router[_0x3552('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3552('0x11'),auth[_0x3552('0x7')](),controller[_0x3552('0x12')]);module[_0x3552('0x13')]=router; \ No newline at end of file +var _0x94dd=['get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x94dd,0x1d2));var _0xd94d=function(_0x565509,_0x388a2a){_0x565509=_0x565509-0x0;var _0x44d705=_0x94dd[_0x565509];return _0x44d705;};'use strict';var multer=require(_0xd94d('0x0'));var util=require(_0xd94d('0x1'));var path=require(_0xd94d('0x2'));var timeout=require(_0xd94d('0x3'));var express=require(_0xd94d('0x4'));var router=express['Router']();var fs_extra=require(_0xd94d('0x5'));var auth=require(_0xd94d('0x6'));var interaction=require(_0xd94d('0x7'));var config=require('../../config/environment');var controller=require(_0xd94d('0x8'));router[_0xd94d('0x9')]('/',auth['isAuthenticated'](),controller[_0xd94d('0xa')]);router[_0xd94d('0x9')](_0xd94d('0xb'),auth[_0xd94d('0xc')](),controller[_0xd94d('0xd')]);router[_0xd94d('0x9')](_0xd94d('0xe'),auth[_0xd94d('0xc')](),controller['getFields']);router[_0xd94d('0x9')](_0xd94d('0xf'),auth[_0xd94d('0xc')](),controller[_0xd94d('0x10')]);router['get']('/:id/descriptions',auth[_0xd94d('0xc')](),controller[_0xd94d('0x11')]);router[_0xd94d('0x12')]('/',auth[_0xd94d('0xc')](),controller[_0xd94d('0x13')]);router[_0xd94d('0x14')](_0xd94d('0xb'),auth['isAuthenticated'](),controller[_0xd94d('0x15')]);router[_0xd94d('0x16')](_0xd94d('0xb'),auth[_0xd94d('0xc')](),controller[_0xd94d('0x17')]);module[_0xd94d('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 795e03d..0cc39e1 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 _0xec07=['sequelize','exports','ENUM','lead','contact','contact_lead'];(function(_0x676f9b,_0x4ee26d){var _0x42b6fb=function(_0x299c65){while(--_0x299c65){_0x676f9b['push'](_0x676f9b['shift']());}};_0x42b6fb(++_0x4ee26d);}(_0xec07,0x150));var _0x7ec0=function(_0x3a8583,_0x226959){_0x3a8583=_0x3a8583-0x0;var _0x52945b=_0xec07[_0x3a8583];return _0x52945b;};'use strict';var Sequelize=require(_0x7ec0('0x0'));module[_0x7ec0('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x7ec0('0x2')](_0x7ec0('0x3'),_0x7ec0('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x7ec0('0x2')](_0x7ec0('0x5'),'contact',_0x7ec0('0x3')),'defaultValue':_0x7ec0('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1b87=['contact','nothing','contact_lead','exports','STRING','ENUM','lead'];(function(_0x57f082,_0x19d064){var _0x11c840=function(_0x2efc22){while(--_0x2efc22){_0x57f082['push'](_0x57f082['shift']());}};_0x11c840(++_0x19d064);}(_0x1b87,0x106));var _0x71b8=function(_0x117e4a,_0x192749){_0x117e4a=_0x117e4a-0x0;var _0x3f2173=_0x1b87[_0x117e4a];return _0x3f2173;};'use strict';var Sequelize=require('sequelize');module[_0x71b8('0x0')]={'name':{'type':Sequelize[_0x71b8('0x1')]},'moduleCreate':{'type':Sequelize[_0x71b8('0x2')](_0x71b8('0x3'),_0x71b8('0x4'),_0x71b8('0x5')),'defaultValue':_0x71b8('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x71b8('0x3')),'defaultValue':_0x71b8('0x6')},'description':{'type':Sequelize[_0x71b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1901cd3..e1117ba 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 _0x5f89=['jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','send','map','ZohoConfiguration','rawAttributes','fieldName','type','model','name','keys','query','intersection','fields','attributes','hasOwnProperty','sort','where','filters','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','body','destroy','findOne','ZohoField','filter','getFields','nolimit','getSubjects','order','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto'];(function(_0x5d7f7e,_0x33cc3f){var _0x162544=function(_0x50fdd2){while(--_0x50fdd2){_0x5d7f7e['push'](_0x5d7f7e['shift']());}};_0x162544(++_0x33cc3f);}(_0x5f89,0x1cc));var _0x95f8=function(_0x1a165d,_0x4083c6){_0x1a165d=_0x1a165d-0x0;var _0x302744=_0x5f89[_0x1a165d];return _0x302744;};'use strict';var emlformat=require(_0x95f8('0x0'));var rimraf=require(_0x95f8('0x1'));var zipdir=require(_0x95f8('0x2'));var jsonpatch=require(_0x95f8('0x3'));var rp=require(_0x95f8('0x4'));var moment=require(_0x95f8('0x5'));var BPromise=require(_0x95f8('0x6'));var Mustache=require(_0x95f8('0x7'));var util=require('util');var path=require(_0x95f8('0x8'));var sox=require(_0x95f8('0x9'));var csv=require(_0x95f8('0xa'));var ejs=require(_0x95f8('0xb'));var fs=require('fs');var fs_extra=require(_0x95f8('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x95f8('0xd'));var jsforce=require(_0x95f8('0xe'));var deskjs=require(_0x95f8('0xf'));var toCsv=require(_0x95f8('0xa'));var querystring=require(_0x95f8('0x10'));var Papa=require(_0x95f8('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x95f8('0x12'));var hardwareService=require(_0x95f8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x95f8('0x14'));var config=require(_0x95f8('0x15'));var licenseUtil=require(_0x95f8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47a706,_0x427cab){_0x427cab=_0x427cab||0xcc;return function(_0x1bb682){if(_0x1bb682){return _0x47a706['sendStatus'](_0x427cab);}return _0x47a706['status'](_0x427cab)[_0x95f8('0x17')]();};}function respondWithResult(_0x3cd40f,_0x12e7fd){_0x12e7fd=_0x12e7fd||0xc8;return function(_0x3be73a){if(_0x3be73a){return _0x3cd40f['status'](_0x12e7fd)[_0x95f8('0x18')](_0x3be73a);}};}function respondWithFilteredResult(_0x1b8a41,_0x382264){return function(_0x238eb8){if(_0x238eb8){var _0x5ae19f=typeof _0x382264[_0x95f8('0x19')]===_0x95f8('0x1a')&&typeof _0x382264[_0x95f8('0x1b')]===_0x95f8('0x1a');var _0x5b5e8d=_0x238eb8[_0x95f8('0x1c')];var _0x21420f=_0x5ae19f?0x0:_0x382264[_0x95f8('0x19')];var _0x4b7cff=_0x5ae19f?_0x238eb8['count']:_0x382264[_0x95f8('0x19')]+_0x382264[_0x95f8('0x1b')];var _0x45707c;if(_0x4b7cff>=_0x5b5e8d){_0x4b7cff=_0x5b5e8d;_0x45707c=0xc8;}else{_0x45707c=0xce;}_0x1b8a41[_0x95f8('0x1d')](_0x45707c);return _0x1b8a41[_0x95f8('0x1e')](_0x95f8('0x1f'),_0x21420f+'-'+_0x4b7cff+'/'+_0x5b5e8d)['json'](_0x238eb8);}return null;};}function patchUpdates(_0x15107e){return function(_0x38b8ea){try{jsonpatch[_0x95f8('0x20')](_0x38b8ea,_0x15107e,!![]);}catch(_0x49bb3e){return BPromise[_0x95f8('0x21')](_0x49bb3e);}return _0x38b8ea[_0x95f8('0x22')]();};}function saveUpdates(_0x348c68,_0x3c5ad7){return function(_0x2ed749){if(_0x2ed749){return _0x2ed749[_0x95f8('0x23')](_0x348c68)[_0x95f8('0x24')](function(_0x25cb6e){return _0x25cb6e;});}return null;};}function removeEntity(_0x4dddf1,_0x3d7332){return function(_0x163cd1){if(_0x163cd1){return _0x163cd1['destroy']()[_0x95f8('0x24')](function(){_0x4dddf1[_0x95f8('0x1d')](0xcc)[_0x95f8('0x17')]();});}};}function handleEntityNotFound(_0x2f26d9,_0x45fbc7){return function(_0x5ea7e5){if(!_0x5ea7e5){_0x2f26d9[_0x95f8('0x25')](0x194);}return _0x5ea7e5;};}function handleError(_0x16f712,_0x3b57f4){_0x3b57f4=_0x3b57f4||0x1f4;return function(_0x398a4e){logger[_0x95f8('0x26')](_0x398a4e[_0x95f8('0x27')]);if(_0x398a4e['name']){delete _0x398a4e['name'];}_0x16f712['status'](_0x3b57f4)[_0x95f8('0x28')](_0x398a4e);};}exports['index']=function(_0x1674ec,_0x52855d){var _0x19d40b={},_0x2678bb={},_0x6d9d60={'count':0x0,'rows':[]};var _0x28e854=_[_0x95f8('0x29')](db[_0x95f8('0x2a')][_0x95f8('0x2b')],function(_0x486142){return{'name':_0x486142[_0x95f8('0x2c')],'type':_0x486142[_0x95f8('0x2d')]['key']};});_0x2678bb[_0x95f8('0x2e')]=_[_0x95f8('0x29')](_0x28e854,_0x95f8('0x2f'));_0x2678bb['query']=_[_0x95f8('0x30')](_0x1674ec[_0x95f8('0x31')]);_0x2678bb['filters']=_[_0x95f8('0x32')](_0x2678bb[_0x95f8('0x2e')],_0x2678bb['query']);_0x19d40b['attributes']=_['intersection'](_0x2678bb[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x1674ec['query'][_0x95f8('0x33')]));_0x19d40b[_0x95f8('0x34')]=_0x19d40b[_0x95f8('0x34')]['length']?_0x19d40b[_0x95f8('0x34')]:_0x2678bb[_0x95f8('0x2e')];if(!_0x1674ec[_0x95f8('0x31')][_0x95f8('0x35')]('nolimit')){_0x19d40b[_0x95f8('0x1b')]=qs[_0x95f8('0x1b')](_0x1674ec['query'][_0x95f8('0x1b')]);_0x19d40b[_0x95f8('0x19')]=qs[_0x95f8('0x19')](_0x1674ec[_0x95f8('0x31')][_0x95f8('0x19')]);}_0x19d40b['order']=qs[_0x95f8('0x36')](_0x1674ec[_0x95f8('0x31')][_0x95f8('0x36')]);_0x19d40b[_0x95f8('0x37')]=qs[_0x95f8('0x38')](_['pick'](_0x1674ec['query'],_0x2678bb[_0x95f8('0x38')]),_0x28e854);if(_0x1674ec[_0x95f8('0x31')]['filter']){_0x19d40b[_0x95f8('0x37')]=_[_0x95f8('0x39')](_0x19d40b[_0x95f8('0x37')],{'$or':_[_0x95f8('0x29')](_0x28e854,function(_0x2eb763){if(_0x2eb763[_0x95f8('0x2d')]!==_0x95f8('0x3a')){var _0x186ec0={};_0x186ec0[_0x2eb763[_0x95f8('0x2f')]]={'$like':'%'+_0x1674ec[_0x95f8('0x31')]['filter']+'%'};return _0x186ec0;}})});}_0x19d40b=_['merge']({},_0x19d40b,_0x1674ec['options']);var _0xe90b66={'where':_0x19d40b[_0x95f8('0x37')]};return db['ZohoConfiguration'][_0x95f8('0x1c')](_0xe90b66)[_0x95f8('0x24')](function(_0x198df4){_0x6d9d60[_0x95f8('0x1c')]=_0x198df4;if(_0x1674ec['query'][_0x95f8('0x3b')]){_0x19d40b[_0x95f8('0x3c')]=[{'all':!![]}];}return db[_0x95f8('0x2a')]['findAll'](_0x19d40b);})[_0x95f8('0x24')](function(_0x3c4045){_0x6d9d60[_0x95f8('0x3d')]=_0x3c4045;return _0x6d9d60;})['then'](respondWithFilteredResult(_0x52855d,_0x19d40b))[_0x95f8('0x3e')](handleError(_0x52855d,null));};exports[_0x95f8('0x3f')]=function(_0x22b39,_0x1eea98){var _0x550cd8={'raw':![],'where':{'id':_0x22b39[_0x95f8('0x40')]['id']}},_0x1abe20={};_0x1abe20[_0x95f8('0x2e')]=_[_0x95f8('0x30')](db[_0x95f8('0x2a')][_0x95f8('0x2b')]);_0x1abe20[_0x95f8('0x31')]=_[_0x95f8('0x30')](_0x22b39['query']);_0x1abe20[_0x95f8('0x38')]=_[_0x95f8('0x32')](_0x1abe20['model'],_0x1abe20[_0x95f8('0x31')]);_0x550cd8[_0x95f8('0x34')]=_[_0x95f8('0x32')](_0x1abe20[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x22b39[_0x95f8('0x31')][_0x95f8('0x33')]));_0x550cd8[_0x95f8('0x34')]=_0x550cd8['attributes'][_0x95f8('0x41')]?_0x550cd8['attributes']:_0x1abe20[_0x95f8('0x2e')];if(_0x22b39[_0x95f8('0x31')]['includeAll']){_0x550cd8[_0x95f8('0x3c')]=[{'all':!![]}];}_0x550cd8=_[_0x95f8('0x39')]({},_0x550cd8,_0x22b39[_0x95f8('0x42')]);return db[_0x95f8('0x2a')][_0x95f8('0x43')](_0x550cd8)['then'](handleEntityNotFound(_0x1eea98,null))[_0x95f8('0x24')](respondWithResult(_0x1eea98,null))[_0x95f8('0x3e')](handleError(_0x1eea98,null));};exports['create']=function(_0x5e14bd,_0x2de295){return db[_0x95f8('0x2a')]['create'](_0x5e14bd[_0x95f8('0x44')],{})['then'](respondWithResult(_0x2de295,0xc9))['catch'](handleError(_0x2de295,null));};exports[_0x95f8('0x23')]=function(_0x6bcf74,_0x3c8e8){if(_0x6bcf74[_0x95f8('0x44')]['id']){delete _0x6bcf74[_0x95f8('0x44')]['id'];}return db[_0x95f8('0x2a')][_0x95f8('0x43')]({'where':{'id':_0x6bcf74[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x3c8e8,null))[_0x95f8('0x24')](saveUpdates(_0x6bcf74['body'],null))[_0x95f8('0x24')](respondWithResult(_0x3c8e8,null))[_0x95f8('0x3e')](handleError(_0x3c8e8,null));};exports[_0x95f8('0x45')]=function(_0x23a880,_0x15ad33){return db[_0x95f8('0x2a')]['find']({'where':{'id':_0x23a880[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x15ad33,null))[_0x95f8('0x24')](removeEntity(_0x15ad33,null))[_0x95f8('0x3e')](handleError(_0x15ad33,null));};exports['getFields']=function(_0x31cc84,_0x6acf7a,_0x33ef6f){var _0x429ece={};var _0x34a9da={};var _0x4ca250;var _0x2563ac;return db[_0x95f8('0x2a')][_0x95f8('0x46')]({'where':{'id':_0x31cc84[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x6acf7a,null))[_0x95f8('0x24')](function(_0x4d473d){if(_0x4d473d){_0x4ca250=_0x4d473d;_0x34a9da['model']=_[_0x95f8('0x30')](db[_0x95f8('0x47')][_0x95f8('0x2b')]);_0x34a9da['query']=_['keys'](_0x31cc84[_0x95f8('0x31')]);_0x34a9da['filters']=_[_0x95f8('0x32')](_0x34a9da[_0x95f8('0x2e')],_0x34a9da[_0x95f8('0x31')]);_0x429ece['attributes']=_['intersection'](_0x34a9da[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x31cc84[_0x95f8('0x31')][_0x95f8('0x33')]));_0x429ece[_0x95f8('0x34')]=_0x429ece[_0x95f8('0x34')][_0x95f8('0x41')]?_0x429ece[_0x95f8('0x34')]:_0x34a9da[_0x95f8('0x2e')];_0x429ece['order']=qs[_0x95f8('0x36')](_0x31cc84[_0x95f8('0x31')]['sort']);_0x429ece['where']=qs['filters'](_['pick'](_0x31cc84[_0x95f8('0x31')],_0x34a9da[_0x95f8('0x38')]));if(_0x31cc84[_0x95f8('0x31')][_0x95f8('0x48')]){_0x429ece['where']=_[_0x95f8('0x39')](_0x429ece['where'],{'$or':_[_0x95f8('0x29')](_0x429ece['attributes'],function(_0xd89d5a){var _0x108073={};_0x108073[_0xd89d5a]={'$like':'%'+_0x31cc84[_0x95f8('0x31')][_0x95f8('0x48')]+'%'};return _0x108073;})});}_0x429ece=_[_0x95f8('0x39')]({},_0x429ece,_0x31cc84[_0x95f8('0x42')]);return _0x4ca250[_0x95f8('0x49')](_0x429ece);}})['then'](function(_0x1ac096){if(_0x1ac096){_0x2563ac=_0x1ac096['length'];if(!_0x31cc84[_0x95f8('0x31')][_0x95f8('0x35')](_0x95f8('0x4a'))){_0x429ece[_0x95f8('0x1b')]=qs['limit'](_0x31cc84[_0x95f8('0x31')]['limit']);_0x429ece[_0x95f8('0x19')]=qs[_0x95f8('0x19')](_0x31cc84[_0x95f8('0x31')][_0x95f8('0x19')]);}return _0x4ca250[_0x95f8('0x49')](_0x429ece);}})[_0x95f8('0x24')](function(_0x2045b7){if(_0x2045b7){return _0x2045b7?{'count':_0x2563ac,'rows':_0x2045b7}:null;}})[_0x95f8('0x24')](respondWithResult(_0x6acf7a,null))[_0x95f8('0x3e')](handleError(_0x6acf7a,null));};exports[_0x95f8('0x4b')]=function(_0x858c64,_0xe70281,_0x38b1e0){var _0x3839f0={};var _0x34c03a={};var _0x2ffeca;var _0x22ca05;return db[_0x95f8('0x2a')]['findOne']({'where':{'id':_0x858c64[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0xe70281,null))[_0x95f8('0x24')](function(_0x2d4d61){if(_0x2d4d61){_0x2ffeca=_0x2d4d61;_0x34c03a[_0x95f8('0x2e')]=_[_0x95f8('0x30')](db[_0x95f8('0x47')][_0x95f8('0x2b')]);_0x34c03a[_0x95f8('0x31')]=_[_0x95f8('0x30')](_0x858c64[_0x95f8('0x31')]);_0x34c03a[_0x95f8('0x38')]=_[_0x95f8('0x32')](_0x34c03a[_0x95f8('0x2e')],_0x34c03a[_0x95f8('0x31')]);_0x3839f0[_0x95f8('0x34')]=_['intersection'](_0x34c03a[_0x95f8('0x2e')],qs[_0x95f8('0x33')](_0x858c64['query'][_0x95f8('0x33')]));_0x3839f0['attributes']=_0x3839f0[_0x95f8('0x34')]['length']?_0x3839f0[_0x95f8('0x34')]:_0x34c03a[_0x95f8('0x2e')];_0x3839f0[_0x95f8('0x4c')]=qs[_0x95f8('0x36')](_0x858c64[_0x95f8('0x31')][_0x95f8('0x36')]);_0x3839f0[_0x95f8('0x37')]=qs[_0x95f8('0x38')](_[_0x95f8('0x4d')](_0x858c64[_0x95f8('0x31')],_0x34c03a[_0x95f8('0x38')]));if(_0x858c64[_0x95f8('0x31')][_0x95f8('0x48')]){_0x3839f0['where']=_[_0x95f8('0x39')](_0x3839f0[_0x95f8('0x37')],{'$or':_['map'](_0x3839f0[_0x95f8('0x34')],function(_0x4f9269){var _0x1e3961={};_0x1e3961[_0x4f9269]={'$like':'%'+_0x858c64[_0x95f8('0x31')][_0x95f8('0x48')]+'%'};return _0x1e3961;})});}_0x3839f0=_[_0x95f8('0x39')]({},_0x3839f0,_0x858c64[_0x95f8('0x42')]);return _0x2ffeca[_0x95f8('0x4b')](_0x3839f0);}})['then'](function(_0x52e2d9){if(_0x52e2d9){_0x22ca05=_0x52e2d9[_0x95f8('0x41')];if(!_0x858c64['query']['hasOwnProperty'](_0x95f8('0x4a'))){_0x3839f0[_0x95f8('0x1b')]=qs[_0x95f8('0x1b')](_0x858c64[_0x95f8('0x31')][_0x95f8('0x1b')]);_0x3839f0[_0x95f8('0x19')]=qs['offset'](_0x858c64[_0x95f8('0x31')][_0x95f8('0x19')]);}return _0x2ffeca[_0x95f8('0x4b')](_0x3839f0);}})[_0x95f8('0x24')](function(_0x25d05c){if(_0x25d05c){return _0x25d05c?{'count':_0x22ca05,'rows':_0x25d05c}:null;}})[_0x95f8('0x24')](respondWithResult(_0xe70281,null))[_0x95f8('0x3e')](handleError(_0xe70281,null));};exports[_0x95f8('0x4e')]=function(_0xb18c9,_0x1f96e8,_0x30127a){var _0x399298={};var _0xc5df63={};var _0xbb0ced;var _0x55f7be;return db[_0x95f8('0x2a')][_0x95f8('0x46')]({'where':{'id':_0xb18c9[_0x95f8('0x40')]['id']}})[_0x95f8('0x24')](handleEntityNotFound(_0x1f96e8,null))[_0x95f8('0x24')](function(_0xf6e70b){if(_0xf6e70b){_0xbb0ced=_0xf6e70b;_0xc5df63[_0x95f8('0x2e')]=_['keys'](db[_0x95f8('0x47')][_0x95f8('0x2b')]);_0xc5df63[_0x95f8('0x31')]=_[_0x95f8('0x30')](_0xb18c9[_0x95f8('0x31')]);_0xc5df63[_0x95f8('0x38')]=_['intersection'](_0xc5df63[_0x95f8('0x2e')],_0xc5df63['query']);_0x399298[_0x95f8('0x34')]=_[_0x95f8('0x32')](_0xc5df63['model'],qs[_0x95f8('0x33')](_0xb18c9[_0x95f8('0x31')][_0x95f8('0x33')]));_0x399298[_0x95f8('0x34')]=_0x399298[_0x95f8('0x34')][_0x95f8('0x41')]?_0x399298['attributes']:_0xc5df63[_0x95f8('0x2e')];_0x399298[_0x95f8('0x4c')]=qs[_0x95f8('0x36')](_0xb18c9['query']['sort']);_0x399298[_0x95f8('0x37')]=qs[_0x95f8('0x38')](_[_0x95f8('0x4d')](_0xb18c9[_0x95f8('0x31')],_0xc5df63[_0x95f8('0x38')]));if(_0xb18c9[_0x95f8('0x31')][_0x95f8('0x48')]){_0x399298[_0x95f8('0x37')]=_[_0x95f8('0x39')](_0x399298[_0x95f8('0x37')],{'$or':_[_0x95f8('0x29')](_0x399298[_0x95f8('0x34')],function(_0x226ccb){var _0x25c5a4={};_0x25c5a4[_0x226ccb]={'$like':'%'+_0xb18c9[_0x95f8('0x31')][_0x95f8('0x48')]+'%'};return _0x25c5a4;})});}_0x399298=_[_0x95f8('0x39')]({},_0x399298,_0xb18c9[_0x95f8('0x42')]);return _0xbb0ced['getDescriptions'](_0x399298);}})[_0x95f8('0x24')](function(_0x1d29be){if(_0x1d29be){_0x55f7be=_0x1d29be[_0x95f8('0x41')];if(!_0xb18c9[_0x95f8('0x31')][_0x95f8('0x35')](_0x95f8('0x4a'))){_0x399298[_0x95f8('0x1b')]=qs[_0x95f8('0x1b')](_0xb18c9[_0x95f8('0x31')][_0x95f8('0x1b')]);_0x399298['offset']=qs['offset'](_0xb18c9[_0x95f8('0x31')][_0x95f8('0x19')]);}return _0xbb0ced[_0x95f8('0x4e')](_0x399298);}})[_0x95f8('0x24')](function(_0x488bcd){if(_0x488bcd){return _0x488bcd?{'count':_0x55f7be,'rows':_0x488bcd}:null;}})[_0x95f8('0x24')](respondWithResult(_0x1f96e8,null))['catch'](handleError(_0x1f96e8,null));}; \ No newline at end of file +var _0x37ba=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','ZohoConfiguration','findAll','catch','show','params','find','create','body','getFields','ZohoField','pick','getSubjects','findOne','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x43f7b4,_0x12f701){var _0x2e160d=function(_0x30fa59){while(--_0x30fa59){_0x43f7b4['push'](_0x43f7b4['shift']());}};_0x2e160d(++_0x12f701);}(_0x37ba,0x1e0));var _0xa37b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x37ba[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xa37b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa37b('0x1'));var moment=require(_0xa37b('0x2'));var BPromise=require(_0xa37b('0x3'));var Mustache=require(_0xa37b('0x4'));var util=require(_0xa37b('0x5'));var path=require(_0xa37b('0x6'));var sox=require(_0xa37b('0x7'));var csv=require(_0xa37b('0x8'));var ejs=require(_0xa37b('0x9'));var fs=require('fs');var fs_extra=require(_0xa37b('0xa'));var _=require(_0xa37b('0xb'));var squel=require(_0xa37b('0xc'));var crypto=require(_0xa37b('0xd'));var jsforce=require(_0xa37b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa37b('0x8'));var querystring=require(_0xa37b('0xf'));var Papa=require(_0xa37b('0x10'));var Redis=require(_0xa37b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa37b('0x12'));var as=require(_0xa37b('0x13'));var hardwareService=require(_0xa37b('0x14'));var logger=require(_0xa37b('0x15'))(_0xa37b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa37b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88bf,_0x376436){_0x376436=_0x376436||0xcc;return function(_0x2efd02){if(_0x2efd02){return _0xe88bf[_0xa37b('0x18')](_0x376436);}return _0xe88bf[_0xa37b('0x19')](_0x376436)[_0xa37b('0x1a')]();};}function respondWithResult(_0x3e9b97,_0x4f82d6){_0x4f82d6=_0x4f82d6||0xc8;return function(_0x4e2132){if(_0x4e2132){return _0x3e9b97['status'](_0x4f82d6)['json'](_0x4e2132);}};}function respondWithFilteredResult(_0x5a72ae,_0x29eb2f){return function(_0x2dcdeb){if(_0x2dcdeb){var _0x56fb75=typeof _0x29eb2f[_0xa37b('0x1b')]===_0xa37b('0x1c')&&typeof _0x29eb2f[_0xa37b('0x1d')]==='undefined';var _0x115c90=_0x2dcdeb[_0xa37b('0x1e')];var _0x483800=_0x56fb75?0x0:_0x29eb2f[_0xa37b('0x1b')];var _0x373643=_0x56fb75?_0x2dcdeb[_0xa37b('0x1e')]:_0x29eb2f['offset']+_0x29eb2f[_0xa37b('0x1d')];var _0x5664ab;if(_0x373643>=_0x115c90){_0x373643=_0x115c90;_0x5664ab=0xc8;}else{_0x5664ab=0xce;}_0x5a72ae['status'](_0x5664ab);return _0x5a72ae['set'](_0xa37b('0x1f'),_0x483800+'-'+_0x373643+'/'+_0x115c90)[_0xa37b('0x20')](_0x2dcdeb);}return null;};}function patchUpdates(_0xaaa98d){return function(_0x4cb292){try{jsonpatch[_0xa37b('0x21')](_0x4cb292,_0xaaa98d,!![]);}catch(_0x5646b8){return BPromise[_0xa37b('0x22')](_0x5646b8);}return _0x4cb292[_0xa37b('0x23')]();};}function saveUpdates(_0x155c8a,_0x5cc59f){return function(_0x2f72ff){if(_0x2f72ff){return _0x2f72ff[_0xa37b('0x24')](_0x155c8a)[_0xa37b('0x25')](function(_0xc0290a){return _0xc0290a;});}return null;};}function removeEntity(_0x2a31a9,_0x4215a9){return function(_0xd9b980){if(_0xd9b980){return _0xd9b980[_0xa37b('0x26')]()[_0xa37b('0x25')](function(){_0x2a31a9[_0xa37b('0x19')](0xcc)[_0xa37b('0x1a')]();});}};}function handleEntityNotFound(_0x45af54,_0x19f3ac){return function(_0x43bffe){if(!_0x43bffe){_0x45af54[_0xa37b('0x18')](0x194);}return _0x43bffe;};}function handleError(_0x2294f4,_0x4b1659){_0x4b1659=_0x4b1659||0x1f4;return function(_0x428657){logger[_0xa37b('0x27')](_0x428657[_0xa37b('0x28')]);if(_0x428657[_0xa37b('0x29')]){delete _0x428657[_0xa37b('0x29')];}_0x2294f4[_0xa37b('0x19')](_0x4b1659)[_0xa37b('0x2a')](_0x428657);};}exports[_0xa37b('0x2b')]=function(_0x591b71,_0x547d17){var _0x544756={},_0x2370f5={},_0x364c59={'count':0x0,'rows':[]};var _0x2e1863=_['map'](db['ZohoConfiguration'][_0xa37b('0x2c')],function(_0x5f3024){return{'name':_0x5f3024[_0xa37b('0x2d')],'type':_0x5f3024[_0xa37b('0x2e')][_0xa37b('0x2f')]};});_0x2370f5[_0xa37b('0x30')]=_['map'](_0x2e1863,'name');_0x2370f5['query']=_[_0xa37b('0x31')](_0x591b71[_0xa37b('0x32')]);_0x2370f5['filters']=_[_0xa37b('0x33')](_0x2370f5['model'],_0x2370f5['query']);_0x544756[_0xa37b('0x34')]=_['intersection'](_0x2370f5['model'],qs[_0xa37b('0x35')](_0x591b71['query'][_0xa37b('0x35')]));_0x544756[_0xa37b('0x34')]=_0x544756[_0xa37b('0x34')][_0xa37b('0x36')]?_0x544756[_0xa37b('0x34')]:_0x2370f5['model'];if(!_0x591b71[_0xa37b('0x32')][_0xa37b('0x37')](_0xa37b('0x38'))){_0x544756[_0xa37b('0x1d')]=qs['limit'](_0x591b71[_0xa37b('0x32')]['limit']);_0x544756[_0xa37b('0x1b')]=qs[_0xa37b('0x1b')](_0x591b71[_0xa37b('0x32')]['offset']);}_0x544756[_0xa37b('0x39')]=qs[_0xa37b('0x3a')](_0x591b71[_0xa37b('0x32')][_0xa37b('0x3a')]);_0x544756[_0xa37b('0x3b')]=qs[_0xa37b('0x3c')](_['pick'](_0x591b71[_0xa37b('0x32')],_0x2370f5[_0xa37b('0x3c')]),_0x2e1863);if(_0x591b71[_0xa37b('0x32')][_0xa37b('0x3d')]){_0x544756['where']=_[_0xa37b('0x3e')](_0x544756[_0xa37b('0x3b')],{'$or':_[_0xa37b('0x3f')](_0x2e1863,function(_0x51e3ff){if(_0x51e3ff[_0xa37b('0x2e')]!==_0xa37b('0x40')){var _0x562977={};_0x562977[_0x51e3ff['name']]={'$like':'%'+_0x591b71[_0xa37b('0x32')][_0xa37b('0x3d')]+'%'};return _0x562977;}})});}_0x544756=_[_0xa37b('0x3e')]({},_0x544756,_0x591b71[_0xa37b('0x41')]);var _0x216bcd={'where':_0x544756[_0xa37b('0x3b')]};return db['ZohoConfiguration'][_0xa37b('0x1e')](_0x216bcd)[_0xa37b('0x25')](function(_0x3e80b9){_0x364c59[_0xa37b('0x1e')]=_0x3e80b9;if(_0x591b71[_0xa37b('0x32')][_0xa37b('0x42')]){_0x544756[_0xa37b('0x43')]=[{'all':!![]}];}return db[_0xa37b('0x44')][_0xa37b('0x45')](_0x544756);})[_0xa37b('0x25')](function(_0x5a324c){_0x364c59['rows']=_0x5a324c;return _0x364c59;})[_0xa37b('0x25')](respondWithFilteredResult(_0x547d17,_0x544756))[_0xa37b('0x46')](handleError(_0x547d17,null));};exports[_0xa37b('0x47')]=function(_0x573361,_0x234a33){var _0x57c5da={'raw':![],'where':{'id':_0x573361[_0xa37b('0x48')]['id']}},_0x7a09a1={};_0x7a09a1[_0xa37b('0x30')]=_[_0xa37b('0x31')](db['ZohoConfiguration']['rawAttributes']);_0x7a09a1[_0xa37b('0x32')]=_['keys'](_0x573361['query']);_0x7a09a1['filters']=_[_0xa37b('0x33')](_0x7a09a1[_0xa37b('0x30')],_0x7a09a1[_0xa37b('0x32')]);_0x57c5da[_0xa37b('0x34')]=_['intersection'](_0x7a09a1[_0xa37b('0x30')],qs[_0xa37b('0x35')](_0x573361['query'][_0xa37b('0x35')]));_0x57c5da[_0xa37b('0x34')]=_0x57c5da[_0xa37b('0x34')][_0xa37b('0x36')]?_0x57c5da['attributes']:_0x7a09a1['model'];if(_0x573361[_0xa37b('0x32')][_0xa37b('0x42')]){_0x57c5da[_0xa37b('0x43')]=[{'all':!![]}];}_0x57c5da=_[_0xa37b('0x3e')]({},_0x57c5da,_0x573361['options']);return db[_0xa37b('0x44')][_0xa37b('0x49')](_0x57c5da)[_0xa37b('0x25')](handleEntityNotFound(_0x234a33,null))[_0xa37b('0x25')](respondWithResult(_0x234a33,null))[_0xa37b('0x46')](handleError(_0x234a33,null));};exports['create']=function(_0x4b74b6,_0x317000){return db[_0xa37b('0x44')][_0xa37b('0x4a')](_0x4b74b6[_0xa37b('0x4b')],{})[_0xa37b('0x25')](respondWithResult(_0x317000,0xc9))['catch'](handleError(_0x317000,null));};exports[_0xa37b('0x24')]=function(_0x294ccd,_0x19cc64){if(_0x294ccd[_0xa37b('0x4b')]['id']){delete _0x294ccd[_0xa37b('0x4b')]['id'];}return db[_0xa37b('0x44')]['find']({'where':{'id':_0x294ccd[_0xa37b('0x48')]['id']}})[_0xa37b('0x25')](handleEntityNotFound(_0x19cc64,null))[_0xa37b('0x25')](saveUpdates(_0x294ccd[_0xa37b('0x4b')],null))[_0xa37b('0x25')](respondWithResult(_0x19cc64,null))[_0xa37b('0x46')](handleError(_0x19cc64,null));};exports[_0xa37b('0x26')]=function(_0x29f5cd,_0x48ebcd){return db[_0xa37b('0x44')]['find']({'where':{'id':_0x29f5cd[_0xa37b('0x48')]['id']}})[_0xa37b('0x25')](handleEntityNotFound(_0x48ebcd,null))[_0xa37b('0x25')](removeEntity(_0x48ebcd,null))[_0xa37b('0x46')](handleError(_0x48ebcd,null));};exports[_0xa37b('0x4c')]=function(_0x2fad7b,_0x647553,_0xcc4b6b){var _0x34b34a={};var _0x2b2250={};var _0x3d6f7a;var _0x4e57d5;return db[_0xa37b('0x44')]['findOne']({'where':{'id':_0x2fad7b[_0xa37b('0x48')]['id']}})[_0xa37b('0x25')](handleEntityNotFound(_0x647553,null))[_0xa37b('0x25')](function(_0x4cf229){if(_0x4cf229){_0x3d6f7a=_0x4cf229;_0x2b2250['model']=_[_0xa37b('0x31')](db[_0xa37b('0x4d')][_0xa37b('0x2c')]);_0x2b2250[_0xa37b('0x32')]=_[_0xa37b('0x31')](_0x2fad7b[_0xa37b('0x32')]);_0x2b2250['filters']=_['intersection'](_0x2b2250[_0xa37b('0x30')],_0x2b2250[_0xa37b('0x32')]);_0x34b34a[_0xa37b('0x34')]=_[_0xa37b('0x33')](_0x2b2250['model'],qs[_0xa37b('0x35')](_0x2fad7b[_0xa37b('0x32')]['fields']));_0x34b34a[_0xa37b('0x34')]=_0x34b34a[_0xa37b('0x34')]['length']?_0x34b34a['attributes']:_0x2b2250[_0xa37b('0x30')];_0x34b34a['order']=qs[_0xa37b('0x3a')](_0x2fad7b[_0xa37b('0x32')][_0xa37b('0x3a')]);_0x34b34a[_0xa37b('0x3b')]=qs[_0xa37b('0x3c')](_[_0xa37b('0x4e')](_0x2fad7b[_0xa37b('0x32')],_0x2b2250[_0xa37b('0x3c')]));if(_0x2fad7b[_0xa37b('0x32')][_0xa37b('0x3d')]){_0x34b34a[_0xa37b('0x3b')]=_['merge'](_0x34b34a[_0xa37b('0x3b')],{'$or':_['map'](_0x34b34a[_0xa37b('0x34')],function(_0x2c8a94){var _0x52ec2f={};_0x52ec2f[_0x2c8a94]={'$like':'%'+_0x2fad7b[_0xa37b('0x32')][_0xa37b('0x3d')]+'%'};return _0x52ec2f;})});}_0x34b34a=_[_0xa37b('0x3e')]({},_0x34b34a,_0x2fad7b['options']);return _0x3d6f7a[_0xa37b('0x4c')](_0x34b34a);}})[_0xa37b('0x25')](function(_0x2a76de){if(_0x2a76de){_0x4e57d5=_0x2a76de[_0xa37b('0x36')];if(!_0x2fad7b[_0xa37b('0x32')]['hasOwnProperty'](_0xa37b('0x38'))){_0x34b34a[_0xa37b('0x1d')]=qs[_0xa37b('0x1d')](_0x2fad7b[_0xa37b('0x32')][_0xa37b('0x1d')]);_0x34b34a[_0xa37b('0x1b')]=qs[_0xa37b('0x1b')](_0x2fad7b['query'][_0xa37b('0x1b')]);}return _0x3d6f7a[_0xa37b('0x4c')](_0x34b34a);}})[_0xa37b('0x25')](function(_0xf151c1){if(_0xf151c1){return _0xf151c1?{'count':_0x4e57d5,'rows':_0xf151c1}:null;}})[_0xa37b('0x25')](respondWithResult(_0x647553,null))[_0xa37b('0x46')](handleError(_0x647553,null));};exports[_0xa37b('0x4f')]=function(_0x595c31,_0x4306b9,_0x27f397){var _0x1af1ac={};var _0x25d343={};var _0x5e11b3;var _0x5cd5c8;return db[_0xa37b('0x44')][_0xa37b('0x50')]({'where':{'id':_0x595c31[_0xa37b('0x48')]['id']}})[_0xa37b('0x25')](handleEntityNotFound(_0x4306b9,null))[_0xa37b('0x25')](function(_0x1b603e){if(_0x1b603e){_0x5e11b3=_0x1b603e;_0x25d343[_0xa37b('0x30')]=_[_0xa37b('0x31')](db['ZohoField'][_0xa37b('0x2c')]);_0x25d343['query']=_[_0xa37b('0x31')](_0x595c31[_0xa37b('0x32')]);_0x25d343['filters']=_[_0xa37b('0x33')](_0x25d343[_0xa37b('0x30')],_0x25d343[_0xa37b('0x32')]);_0x1af1ac[_0xa37b('0x34')]=_[_0xa37b('0x33')](_0x25d343[_0xa37b('0x30')],qs['fields'](_0x595c31[_0xa37b('0x32')]['fields']));_0x1af1ac[_0xa37b('0x34')]=_0x1af1ac[_0xa37b('0x34')][_0xa37b('0x36')]?_0x1af1ac['attributes']:_0x25d343[_0xa37b('0x30')];_0x1af1ac['order']=qs['sort'](_0x595c31[_0xa37b('0x32')][_0xa37b('0x3a')]);_0x1af1ac[_0xa37b('0x3b')]=qs[_0xa37b('0x3c')](_[_0xa37b('0x4e')](_0x595c31[_0xa37b('0x32')],_0x25d343[_0xa37b('0x3c')]));if(_0x595c31[_0xa37b('0x32')][_0xa37b('0x3d')]){_0x1af1ac[_0xa37b('0x3b')]=_[_0xa37b('0x3e')](_0x1af1ac[_0xa37b('0x3b')],{'$or':_[_0xa37b('0x3f')](_0x1af1ac[_0xa37b('0x34')],function(_0x186ce0){var _0x16ad30={};_0x16ad30[_0x186ce0]={'$like':'%'+_0x595c31['query'][_0xa37b('0x3d')]+'%'};return _0x16ad30;})});}_0x1af1ac=_['merge']({},_0x1af1ac,_0x595c31[_0xa37b('0x41')]);return _0x5e11b3['getSubjects'](_0x1af1ac);}})[_0xa37b('0x25')](function(_0x53e75c){if(_0x53e75c){_0x5cd5c8=_0x53e75c[_0xa37b('0x36')];if(!_0x595c31[_0xa37b('0x32')][_0xa37b('0x37')](_0xa37b('0x38'))){_0x1af1ac[_0xa37b('0x1d')]=qs['limit'](_0x595c31[_0xa37b('0x32')][_0xa37b('0x1d')]);_0x1af1ac[_0xa37b('0x1b')]=qs[_0xa37b('0x1b')](_0x595c31[_0xa37b('0x32')][_0xa37b('0x1b')]);}return _0x5e11b3[_0xa37b('0x4f')](_0x1af1ac);}})['then'](function(_0x6524c2){if(_0x6524c2){return _0x6524c2?{'count':_0x5cd5c8,'rows':_0x6524c2}:null;}})[_0xa37b('0x25')](respondWithResult(_0x4306b9,null))[_0xa37b('0x46')](handleError(_0x4306b9,null));};exports[_0xa37b('0x51')]=function(_0x41cbbb,_0x4b8fb7,_0x410240){var _0x2b4cc8={};var _0x159027={};var _0x3ed685;var _0x207c5e;return db[_0xa37b('0x44')]['findOne']({'where':{'id':_0x41cbbb[_0xa37b('0x48')]['id']}})[_0xa37b('0x25')](handleEntityNotFound(_0x4b8fb7,null))[_0xa37b('0x25')](function(_0x469d5c){if(_0x469d5c){_0x3ed685=_0x469d5c;_0x159027[_0xa37b('0x30')]=_[_0xa37b('0x31')](db[_0xa37b('0x4d')][_0xa37b('0x2c')]);_0x159027[_0xa37b('0x32')]=_[_0xa37b('0x31')](_0x41cbbb[_0xa37b('0x32')]);_0x159027[_0xa37b('0x3c')]=_[_0xa37b('0x33')](_0x159027[_0xa37b('0x30')],_0x159027[_0xa37b('0x32')]);_0x2b4cc8[_0xa37b('0x34')]=_['intersection'](_0x159027[_0xa37b('0x30')],qs[_0xa37b('0x35')](_0x41cbbb['query'][_0xa37b('0x35')]));_0x2b4cc8['attributes']=_0x2b4cc8[_0xa37b('0x34')][_0xa37b('0x36')]?_0x2b4cc8['attributes']:_0x159027['model'];_0x2b4cc8[_0xa37b('0x39')]=qs['sort'](_0x41cbbb[_0xa37b('0x32')][_0xa37b('0x3a')]);_0x2b4cc8['where']=qs[_0xa37b('0x3c')](_[_0xa37b('0x4e')](_0x41cbbb['query'],_0x159027['filters']));if(_0x41cbbb[_0xa37b('0x32')][_0xa37b('0x3d')]){_0x2b4cc8[_0xa37b('0x3b')]=_[_0xa37b('0x3e')](_0x2b4cc8['where'],{'$or':_['map'](_0x2b4cc8[_0xa37b('0x34')],function(_0x3a2375){var _0x51aaac={};_0x51aaac[_0x3a2375]={'$like':'%'+_0x41cbbb['query'][_0xa37b('0x3d')]+'%'};return _0x51aaac;})});}_0x2b4cc8=_['merge']({},_0x2b4cc8,_0x41cbbb['options']);return _0x3ed685[_0xa37b('0x51')](_0x2b4cc8);}})[_0xa37b('0x25')](function(_0x190515){if(_0x190515){_0x207c5e=_0x190515[_0xa37b('0x36')];if(!_0x41cbbb[_0xa37b('0x32')][_0xa37b('0x37')](_0xa37b('0x38'))){_0x2b4cc8[_0xa37b('0x1d')]=qs[_0xa37b('0x1d')](_0x41cbbb[_0xa37b('0x32')]['limit']);_0x2b4cc8[_0xa37b('0x1b')]=qs[_0xa37b('0x1b')](_0x41cbbb[_0xa37b('0x32')][_0xa37b('0x1b')]);}return _0x3ed685[_0xa37b('0x51')](_0x2b4cc8);}})['then'](function(_0x53e3aa){if(_0x53e3aa){return _0x53e3aa?{'count':_0x207c5e,'rows':_0x53e3aa}:null;}})[_0xa37b('0x25')](respondWithResult(_0x4b8fb7,null))[_0xa37b('0x46')](handleError(_0x4b8fb7,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index a7fdb81..3b660a7 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 _0xc7b1=['define','ZohoConfiguration','int_zoho_configurations','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports'];(function(_0x566bfb,_0x427ebf){var _0x114452=function(_0x5375bc){while(--_0x5375bc){_0x566bfb['push'](_0x566bfb['shift']());}};_0x114452(++_0x427ebf);}(_0xc7b1,0xc9));var _0x1c7b=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xc7b1[_0x257495];return _0x3849aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c7b('0x0'));var rp=require(_0x1c7b('0x1'));var fs=require('fs');var path=require(_0x1c7b('0x2'));var rimraf=require(_0x1c7b('0x3'));var config=require('../../config/environment');var attributes=require(_0x1c7b('0x4'));module[_0x1c7b('0x5')]=function(_0x51d757,_0xe999af){return _0x51d757[_0x1c7b('0x6')](_0x1c7b('0x7'),attributes,{'tableName':_0x1c7b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7575=['./intZohoConfiguration.attributes','ZohoConfiguration','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x7575,0x152));var _0x5757=function(_0x38a8e0,_0x1831c9){_0x38a8e0=_0x38a8e0-0x0;var _0x79aaf6=_0x7575[_0x38a8e0];return _0x79aaf6;};'use strict';var _=require(_0x5757('0x0'));var util=require(_0x5757('0x1'));var logger=require(_0x5757('0x2'))(_0x5757('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5757('0x4'));var rimraf=require(_0x5757('0x5'));var config=require('../../config/environment');var attributes=require(_0x5757('0x6'));module['exports']=function(_0x96a949,_0x560777){return _0x96a949['define'](_0x5757('0x7'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index dadb2b8..ae86d62 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 _0x966a=['../../config/logger','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','bluebird','randomstring','../../config/utils'];(function(_0x3f1623,_0x504d4d){var _0x407757=function(_0x5db9f8){while(--_0x5db9f8){_0x3f1623['push'](_0x3f1623['shift']());}};_0x407757(++_0x504d4d);}(_0x966a,0x152));var _0xa966=function(_0x4ce3ca,_0xd314a){_0x4ce3ca=_0x4ce3ca-0x0;var _0x1c6be6=_0x966a[_0x4ce3ca];return _0x1c6be6;};'use strict';var _=require(_0xa966('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa966('0x1'));var rs=require(_0xa966('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa966('0x3'));var logger=require(_0xa966('0x4'))('rpc');var config=require(_0xa966('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa966('0x6')][_0xa966('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35375d,_0x296774,_0x50deb0){return new BPromise(function(_0x43208f,_0x1c786f){return client[_0xa966('0x8')](_0x35375d,_0x50deb0)[_0xa966('0x9')](function(_0x45bb97){logger[_0xa966('0xa')](_0xa966('0xb'),_0x296774,'request\x20sent');logger[_0xa966('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x296774,_0xa966('0xd'),JSON[_0xa966('0xe')](_0x45bb97));if(_0x45bb97[_0xa966('0xf')]){if(_0x45bb97['error']['code']===0x1f4){logger['error'](_0xa966('0xb'),_0x296774,_0x45bb97[_0xa966('0xf')]['message']);return _0x1c786f(_0x45bb97[_0xa966('0xf')][_0xa966('0x10')]);}logger['error'](_0xa966('0xb'),_0x296774,_0x45bb97[_0xa966('0xf')][_0xa966('0x10')]);return _0x43208f(_0x45bb97[_0xa966('0xf')][_0xa966('0x10')]);}else{logger[_0xa966('0xa')](_0xa966('0xb'),_0x296774,'request\x20sent');_0x43208f(_0x45bb97['result'][_0xa966('0x10')]);}})[_0xa966('0x11')](function(_0x20c8ba){logger[_0xa966('0xf')](_0xa966('0xb'),_0x296774,_0x20c8ba);_0x1c786f(_0x20c8ba);});});} \ No newline at end of file +var _0x0f41=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xd8f7bd,_0x45dc8c){var _0x1bd5ee=function(_0x20498e){while(--_0x20498e){_0xd8f7bd['push'](_0xd8f7bd['shift']());}};_0x1bd5ee(++_0x45dc8c);}(_0x0f41,0x1a2));var _0x10f4=function(_0x244f5d,_0x3c98c6){_0x244f5d=_0x244f5d-0x0;var _0x1a3886=_0x0f41[_0x244f5d];return _0x1a3886;};'use strict';var _=require(_0x10f4('0x0'));var util=require(_0x10f4('0x1'));var moment=require(_0x10f4('0x2'));var BPromise=require(_0x10f4('0x3'));var rs=require(_0x10f4('0x4'));var fs=require('fs');var Redis=require(_0x10f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x10f4('0x6'));var logger=require(_0x10f4('0x7'))(_0x10f4('0x8'));var config=require(_0x10f4('0x9'));var jayson=require(_0x10f4('0xa'));var client=jayson['client'][_0x10f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19ba46,_0x190d82,_0x1e51f7){return new BPromise(function(_0xbf28ea,_0xd7765c){return client[_0x10f4('0xc')](_0x19ba46,_0x1e51f7)[_0x10f4('0xd')](function(_0x5ec502){logger[_0x10f4('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x190d82,_0x10f4('0xf'));logger[_0x10f4('0x10')](_0x10f4('0x11'),_0x190d82,'request\x20sent',JSON[_0x10f4('0x12')](_0x5ec502));if(_0x5ec502['error']){if(_0x5ec502[_0x10f4('0x13')][_0x10f4('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x190d82,_0x5ec502[_0x10f4('0x13')]['message']);return _0xd7765c(_0x5ec502[_0x10f4('0x13')][_0x10f4('0x15')]);}logger[_0x10f4('0x13')](_0x10f4('0x16'),_0x190d82,_0x5ec502[_0x10f4('0x13')][_0x10f4('0x15')]);return _0xbf28ea(_0x5ec502[_0x10f4('0x13')][_0x10f4('0x15')]);}else{logger[_0x10f4('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x190d82,_0x10f4('0xf'));_0xbf28ea(_0x5ec502[_0x10f4('0x17')]['message']);}})[_0x10f4('0x18')](function(_0x1c8c41){logger[_0x10f4('0x13')](_0x10f4('0x16'),_0x190d82,_0x1c8c41);_0xd7765c(_0x1c8c41);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f8d750d..2f4cc9c 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 _0x82ee=['isAuthenticated','index','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x130729,_0x149c2d){var _0x3e9526=function(_0x54d293){while(--_0x54d293){_0x130729['push'](_0x130729['shift']());}};_0x3e9526(++_0x149c2d);}(_0x82ee,0x8e));var _0xe82e=function(_0x65f8aa,_0x873a29){_0x65f8aa=_0x65f8aa-0x0;var _0x1100dd=_0x82ee[_0x65f8aa];return _0x1100dd;};'use strict';var multer=require(_0xe82e('0x0'));var util=require(_0xe82e('0x1'));var path=require(_0xe82e('0x2'));var timeout=require(_0xe82e('0x3'));var express=require(_0xe82e('0x4'));var router=express[_0xe82e('0x5')]();var fs_extra=require(_0xe82e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe82e('0x7'));var config=require(_0xe82e('0x8'));var controller=require(_0xe82e('0x9'));router['get']('/',auth[_0xe82e('0xa')](),controller[_0xe82e('0xb')]);router[_0xe82e('0xc')](_0xe82e('0xd'),auth['isAuthenticated'](),controller[_0xe82e('0xe')]);router['post']('/',auth[_0xe82e('0xa')](),controller[_0xe82e('0xf')]);router['put'](_0xe82e('0xd'),auth[_0xe82e('0xa')](),controller[_0xe82e('0x10')]);router['delete'](_0xe82e('0xd'),auth[_0xe82e('0xa')](),controller[_0xe82e('0x11')]);module[_0xe82e('0x12')]=router; \ No newline at end of file +var _0xcf52=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5ba036,_0x103748){var _0x309850=function(_0x1256ea){while(--_0x1256ea){_0x5ba036['push'](_0x5ba036['shift']());}};_0x309850(++_0x103748);}(_0xcf52,0x1a0));var _0x2cf5=function(_0x42f6d1,_0x52c740){_0x42f6d1=_0x42f6d1-0x0;var _0x50ae08=_0xcf52[_0x42f6d1];return _0x50ae08;};'use strict';var multer=require(_0x2cf5('0x0'));var util=require(_0x2cf5('0x1'));var path=require(_0x2cf5('0x2'));var timeout=require(_0x2cf5('0x3'));var express=require('express');var router=express[_0x2cf5('0x4')]();var fs_extra=require(_0x2cf5('0x5'));var auth=require(_0x2cf5('0x6'));var interaction=require(_0x2cf5('0x7'));var config=require(_0x2cf5('0x8'));var controller=require('./intZohoField.controller');router[_0x2cf5('0x9')]('/',auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xb')]);router[_0x2cf5('0x9')](_0x2cf5('0xc'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xd')]);router[_0x2cf5('0xe')]('/',auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xf')]);router[_0x2cf5('0x10')]('/:id',auth[_0x2cf5('0xa')](),controller[_0x2cf5('0x11')]);router[_0x2cf5('0x12')](_0x2cf5('0xc'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0f4cb2d..a712fe5 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 _0xefc6=['STRING','customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue','string'];(function(_0x4d8a83,_0x2e2968){var _0x350411=function(_0x306a67){while(--_0x306a67){_0x4d8a83['push'](_0x4d8a83['shift']());}};_0x350411(++_0x2e2968);}(_0xefc6,0x163));var _0x6efc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xefc6[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x6efc('0x0'));module['exports']={'type':{'type':Sequelize[_0x6efc('0x1')]('string',_0x6efc('0x2'),'customVariable',_0x6efc('0x3'),'picklist'),'defaultValue':_0x6efc('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6efc('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x6efc('0x4'),_0x6efc('0x2'),_0x6efc('0x6'))},'keyContent':{'type':Sequelize[_0x6efc('0x5')]},'idField':{'type':Sequelize[_0x6efc('0x5')]},'nameField':{'type':Sequelize[_0x6efc('0x5')]},'customField':{'type':Sequelize[_0x6efc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6efc('0x5')]}}; \ No newline at end of file +var _0x3b84=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b84,0xcd));var _0x43b8=function(_0xaf9da5,_0x1151cf){_0xaf9da5=_0xaf9da5-0x0;var _0x44b851=_0x3b84[_0xaf9da5];return _0x44b851;};'use strict';var Sequelize=require(_0x43b8('0x0'));module[_0x43b8('0x1')]={'type':{'type':Sequelize[_0x43b8('0x2')](_0x43b8('0x3'),_0x43b8('0x4'),_0x43b8('0x5'),_0x43b8('0x6'),_0x43b8('0x7')),'defaultValue':_0x43b8('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x43b8('0x8')]},'keyType':{'type':Sequelize[_0x43b8('0x2')]('string',_0x43b8('0x4'),_0x43b8('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x43b8('0x8')]},'customField':{'type':Sequelize[_0x43b8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 21312b0..a38cbe0 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 _0x31c4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','catch','show','rawAttributes','find','create','body','params','destroy','eml-format'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x31c4,0x113));var _0x431c=function(_0x1f6aa4,_0x425cf9){_0x1f6aa4=_0x1f6aa4-0x0;var _0x5807aa=_0x31c4[_0x1f6aa4];return _0x5807aa;};'use strict';var emlformat=require(_0x431c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x431c('0x1'));var jsonpatch=require(_0x431c('0x2'));var rp=require(_0x431c('0x3'));var moment=require(_0x431c('0x4'));var BPromise=require(_0x431c('0x5'));var Mustache=require(_0x431c('0x6'));var util=require(_0x431c('0x7'));var path=require('path');var sox=require(_0x431c('0x8'));var csv=require(_0x431c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x431c('0xa'));var _=require(_0x431c('0xb'));var squel=require(_0x431c('0xc'));var crypto=require(_0x431c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x431c('0x9'));var querystring=require('querystring');var Papa=require(_0x431c('0xe'));var Redis=require(_0x431c('0xf'));var authService=require(_0x431c('0x10'));var qs=require(_0x431c('0x11'));var as=require(_0x431c('0x12'));var hardwareService=require(_0x431c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x431c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x431c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36567d,_0x50ec94){_0x50ec94=_0x50ec94||0xcc;return function(_0x214677){if(_0x214677){return _0x36567d[_0x431c('0x16')](_0x50ec94);}return _0x36567d[_0x431c('0x17')](_0x50ec94)[_0x431c('0x18')]();};}function respondWithResult(_0x294159,_0x14dd16){_0x14dd16=_0x14dd16||0xc8;return function(_0x491c8a){if(_0x491c8a){return _0x294159[_0x431c('0x17')](_0x14dd16)[_0x431c('0x19')](_0x491c8a);}};}function respondWithFilteredResult(_0xa0b9a1,_0x36c5ce){return function(_0x492622){if(_0x492622){var _0x25f061=typeof _0x36c5ce[_0x431c('0x1a')]===_0x431c('0x1b')&&typeof _0x36c5ce[_0x431c('0x1c')]==='undefined';var _0x461e5d=_0x492622[_0x431c('0x1d')];var _0x22cecd=_0x25f061?0x0:_0x36c5ce[_0x431c('0x1a')];var _0x3071ca=_0x25f061?_0x492622[_0x431c('0x1d')]:_0x36c5ce[_0x431c('0x1a')]+_0x36c5ce['limit'];var _0x1c14c2;if(_0x3071ca>=_0x461e5d){_0x3071ca=_0x461e5d;_0x1c14c2=0xc8;}else{_0x1c14c2=0xce;}_0xa0b9a1['status'](_0x1c14c2);return _0xa0b9a1['set']('Content-Range',_0x22cecd+'-'+_0x3071ca+'/'+_0x461e5d)[_0x431c('0x19')](_0x492622);}return null;};}function patchUpdates(_0x5b2dc2){return function(_0x52413b){try{jsonpatch[_0x431c('0x1e')](_0x52413b,_0x5b2dc2,!![]);}catch(_0x568900){return BPromise[_0x431c('0x1f')](_0x568900);}return _0x52413b[_0x431c('0x20')]();};}function saveUpdates(_0x374890,_0x2279c7){return function(_0x51d5d9){if(_0x51d5d9){return _0x51d5d9[_0x431c('0x21')](_0x374890)[_0x431c('0x22')](function(_0x2c5ce4){return _0x2c5ce4;});}return null;};}function removeEntity(_0x49f49c,_0x883dc0){return function(_0xcdff9a){if(_0xcdff9a){return _0xcdff9a['destroy']()[_0x431c('0x22')](function(){_0x49f49c['status'](0xcc)[_0x431c('0x18')]();});}};}function handleEntityNotFound(_0x2393b8,_0x4868ff){return function(_0x345a9b){if(!_0x345a9b){_0x2393b8['sendStatus'](0x194);}return _0x345a9b;};}function handleError(_0x29f8bd,_0x1c42ea){_0x1c42ea=_0x1c42ea||0x1f4;return function(_0x896c47){logger[_0x431c('0x23')](_0x896c47[_0x431c('0x24')]);if(_0x896c47['name']){delete _0x896c47[_0x431c('0x25')];}_0x29f8bd[_0x431c('0x17')](_0x1c42ea)['send'](_0x896c47);};}exports['index']=function(_0x58fbf8,_0x157f73){var _0x46ca04={},_0x2948f3={},_0x27ec0e={'count':0x0,'rows':[]};var _0x2da389=_[_0x431c('0x26')](db['ZohoField']['rawAttributes'],function(_0x5308c3){return{'name':_0x5308c3['fieldName'],'type':_0x5308c3[_0x431c('0x27')][_0x431c('0x28')]};});_0x2948f3['model']=_[_0x431c('0x26')](_0x2da389,_0x431c('0x25'));_0x2948f3[_0x431c('0x29')]=_[_0x431c('0x2a')](_0x58fbf8[_0x431c('0x29')]);_0x2948f3[_0x431c('0x2b')]=_[_0x431c('0x2c')](_0x2948f3[_0x431c('0x2d')],_0x2948f3[_0x431c('0x29')]);_0x46ca04[_0x431c('0x2e')]=_[_0x431c('0x2c')](_0x2948f3[_0x431c('0x2d')],qs['fields'](_0x58fbf8[_0x431c('0x29')][_0x431c('0x2f')]));_0x46ca04[_0x431c('0x2e')]=_0x46ca04['attributes'][_0x431c('0x30')]?_0x46ca04[_0x431c('0x2e')]:_0x2948f3[_0x431c('0x2d')];if(!_0x58fbf8[_0x431c('0x29')][_0x431c('0x31')](_0x431c('0x32'))){_0x46ca04[_0x431c('0x1c')]=qs['limit'](_0x58fbf8[_0x431c('0x29')][_0x431c('0x1c')]);_0x46ca04['offset']=qs[_0x431c('0x1a')](_0x58fbf8[_0x431c('0x29')]['offset']);}_0x46ca04[_0x431c('0x33')]=qs[_0x431c('0x34')](_0x58fbf8[_0x431c('0x29')][_0x431c('0x34')]);_0x46ca04[_0x431c('0x35')]=qs['filters'](_['pick'](_0x58fbf8[_0x431c('0x29')],_0x2948f3[_0x431c('0x2b')]),_0x2da389);if(_0x58fbf8[_0x431c('0x29')][_0x431c('0x36')]){_0x46ca04[_0x431c('0x35')]=_[_0x431c('0x37')](_0x46ca04['where'],{'$or':_[_0x431c('0x26')](_0x2da389,function(_0x175de5){if(_0x175de5[_0x431c('0x27')]!==_0x431c('0x38')){var _0x143fd0={};_0x143fd0[_0x175de5[_0x431c('0x25')]]={'$like':'%'+_0x58fbf8['query'][_0x431c('0x36')]+'%'};return _0x143fd0;}})});}_0x46ca04=_[_0x431c('0x37')]({},_0x46ca04,_0x58fbf8[_0x431c('0x39')]);var _0x2ef554={'where':_0x46ca04[_0x431c('0x35')]};return db[_0x431c('0x3a')][_0x431c('0x1d')](_0x2ef554)['then'](function(_0x5980a1){_0x27ec0e[_0x431c('0x1d')]=_0x5980a1;if(_0x58fbf8[_0x431c('0x29')][_0x431c('0x3b')]){_0x46ca04[_0x431c('0x3c')]=[{'all':!![]}];}return db[_0x431c('0x3a')]['findAll'](_0x46ca04);})[_0x431c('0x22')](function(_0x1dc9b9){_0x27ec0e['rows']=_0x1dc9b9;return _0x27ec0e;})[_0x431c('0x22')](respondWithFilteredResult(_0x157f73,_0x46ca04))[_0x431c('0x3d')](handleError(_0x157f73,null));};exports[_0x431c('0x3e')]=function(_0x5279e2,_0x249055){var _0x23a209={'raw':!![],'where':{'id':_0x5279e2['params']['id']}},_0x56dc6e={};_0x56dc6e[_0x431c('0x2d')]=_['keys'](db[_0x431c('0x3a')][_0x431c('0x3f')]);_0x56dc6e[_0x431c('0x29')]=_[_0x431c('0x2a')](_0x5279e2['query']);_0x56dc6e[_0x431c('0x2b')]=_[_0x431c('0x2c')](_0x56dc6e[_0x431c('0x2d')],_0x56dc6e[_0x431c('0x29')]);_0x23a209[_0x431c('0x2e')]=_[_0x431c('0x2c')](_0x56dc6e['model'],qs['fields'](_0x5279e2[_0x431c('0x29')]['fields']));_0x23a209['attributes']=_0x23a209[_0x431c('0x2e')][_0x431c('0x30')]?_0x23a209['attributes']:_0x56dc6e[_0x431c('0x2d')];if(_0x5279e2[_0x431c('0x29')][_0x431c('0x3b')]){_0x23a209[_0x431c('0x3c')]=[{'all':!![]}];}_0x23a209=_[_0x431c('0x37')]({},_0x23a209,_0x5279e2['options']);return db[_0x431c('0x3a')][_0x431c('0x40')](_0x23a209)[_0x431c('0x22')](handleEntityNotFound(_0x249055,null))[_0x431c('0x22')](respondWithResult(_0x249055,null))['catch'](handleError(_0x249055,null));};exports[_0x431c('0x41')]=function(_0x4b19bb,_0x27a866){return db[_0x431c('0x3a')][_0x431c('0x41')](_0x4b19bb['body'],{})[_0x431c('0x22')](respondWithResult(_0x27a866,0xc9))['catch'](handleError(_0x27a866,null));};exports[_0x431c('0x21')]=function(_0x34f9c5,_0x36be20){if(_0x34f9c5[_0x431c('0x42')]['id']){delete _0x34f9c5[_0x431c('0x42')]['id'];}return db[_0x431c('0x3a')]['find']({'where':{'id':_0x34f9c5[_0x431c('0x43')]['id']}})[_0x431c('0x22')](handleEntityNotFound(_0x36be20,null))['then'](saveUpdates(_0x34f9c5[_0x431c('0x42')],null))[_0x431c('0x22')](respondWithResult(_0x36be20,null))['catch'](handleError(_0x36be20,null));};exports[_0x431c('0x44')]=function(_0x179345,_0x499373){return db[_0x431c('0x3a')][_0x431c('0x40')]({'where':{'id':_0x179345[_0x431c('0x43')]['id']}})['then'](handleEntityNotFound(_0x499373,null))[_0x431c('0x22')](removeEntity(_0x499373,null))[_0x431c('0x3d')](handleError(_0x499373,null));}; \ No newline at end of file +var _0x9785=['intersection','attributes','fields','nolimit','limit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','show','params','keys','rawAttributes','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','ZohoField','fieldName','type','model','query'];(function(_0x2f9db0,_0x497d38){var _0x665422=function(_0x19ef9d){while(--_0x19ef9d){_0x2f9db0['push'](_0x2f9db0['shift']());}};_0x665422(++_0x497d38);}(_0x9785,0x133));var _0x5978=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x9785[_0x39772f];return _0xc9edbf;};'use strict';var emlformat=require(_0x5978('0x0'));var rimraf=require(_0x5978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5978('0x2'));var rp=require(_0x5978('0x3'));var moment=require(_0x5978('0x4'));var BPromise=require(_0x5978('0x5'));var Mustache=require(_0x5978('0x6'));var util=require(_0x5978('0x7'));var path=require('path');var sox=require(_0x5978('0x8'));var csv=require(_0x5978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5978('0xa'));var crypto=require(_0x5978('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5978('0x9'));var querystring=require(_0x5978('0xc'));var Papa=require(_0x5978('0xd'));var Redis=require('ioredis');var authService=require(_0x5978('0xe'));var qs=require(_0x5978('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5978('0x10'));var logger=require(_0x5978('0x11'))(_0x5978('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5978('0x13'));var db=require(_0x5978('0x14'))['db'];function respondWithStatusCode(_0x4a7a20,_0xbebbd9){_0xbebbd9=_0xbebbd9||0xcc;return function(_0x49a7bb){if(_0x49a7bb){return _0x4a7a20['sendStatus'](_0xbebbd9);}return _0x4a7a20['status'](_0xbebbd9)[_0x5978('0x15')]();};}function respondWithResult(_0x3c3b3a,_0x1089ea){_0x1089ea=_0x1089ea||0xc8;return function(_0x133f79){if(_0x133f79){return _0x3c3b3a[_0x5978('0x16')](_0x1089ea)['json'](_0x133f79);}};}function respondWithFilteredResult(_0x5d820a,_0x3607be){return function(_0x6795c8){if(_0x6795c8){var _0x138c13=typeof _0x3607be[_0x5978('0x17')]==='undefined'&&typeof _0x3607be['limit']===_0x5978('0x18');var _0x1b5b8b=_0x6795c8[_0x5978('0x19')];var _0x56286c=_0x138c13?0x0:_0x3607be[_0x5978('0x17')];var _0x1cba78=_0x138c13?_0x6795c8[_0x5978('0x19')]:_0x3607be[_0x5978('0x17')]+_0x3607be['limit'];var _0x41efb0;if(_0x1cba78>=_0x1b5b8b){_0x1cba78=_0x1b5b8b;_0x41efb0=0xc8;}else{_0x41efb0=0xce;}_0x5d820a['status'](_0x41efb0);return _0x5d820a[_0x5978('0x1a')]('Content-Range',_0x56286c+'-'+_0x1cba78+'/'+_0x1b5b8b)[_0x5978('0x1b')](_0x6795c8);}return null;};}function patchUpdates(_0x5085dd){return function(_0x1b21eb){try{jsonpatch[_0x5978('0x1c')](_0x1b21eb,_0x5085dd,!![]);}catch(_0x2daf22){return BPromise[_0x5978('0x1d')](_0x2daf22);}return _0x1b21eb[_0x5978('0x1e')]();};}function saveUpdates(_0x416582,_0x50e299){return function(_0x1e2e1a){if(_0x1e2e1a){return _0x1e2e1a[_0x5978('0x1f')](_0x416582)['then'](function(_0x384cd4){return _0x384cd4;});}return null;};}function removeEntity(_0x547703,_0x4f5c76){return function(_0x5ea79c){if(_0x5ea79c){return _0x5ea79c[_0x5978('0x20')]()['then'](function(){_0x547703[_0x5978('0x16')](0xcc)[_0x5978('0x15')]();});}};}function handleEntityNotFound(_0x17f5dd,_0x459d97){return function(_0x496595){if(!_0x496595){_0x17f5dd[_0x5978('0x21')](0x194);}return _0x496595;};}function handleError(_0x366ab1,_0xf872ac){_0xf872ac=_0xf872ac||0x1f4;return function(_0xe03c41){logger['error'](_0xe03c41[_0x5978('0x22')]);if(_0xe03c41[_0x5978('0x23')]){delete _0xe03c41[_0x5978('0x23')];}_0x366ab1[_0x5978('0x16')](_0xf872ac)[_0x5978('0x24')](_0xe03c41);};}exports['index']=function(_0x90d075,_0x303f57){var _0x528126={},_0x41426f={},_0x4402c0={'count':0x0,'rows':[]};var _0x1f2847=_[_0x5978('0x25')](db[_0x5978('0x26')]['rawAttributes'],function(_0x1b29bd){return{'name':_0x1b29bd[_0x5978('0x27')],'type':_0x1b29bd[_0x5978('0x28')]['key']};});_0x41426f[_0x5978('0x29')]=_['map'](_0x1f2847,_0x5978('0x23'));_0x41426f[_0x5978('0x2a')]=_['keys'](_0x90d075[_0x5978('0x2a')]);_0x41426f['filters']=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],_0x41426f['query']);_0x528126[_0x5978('0x2c')]=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],qs[_0x5978('0x2d')](_0x90d075[_0x5978('0x2a')]['fields']));_0x528126['attributes']=_0x528126[_0x5978('0x2c')]['length']?_0x528126['attributes']:_0x41426f[_0x5978('0x29')];if(!_0x90d075['query']['hasOwnProperty'](_0x5978('0x2e'))){_0x528126[_0x5978('0x2f')]=qs[_0x5978('0x2f')](_0x90d075[_0x5978('0x2a')][_0x5978('0x2f')]);_0x528126[_0x5978('0x17')]=qs[_0x5978('0x17')](_0x90d075[_0x5978('0x2a')][_0x5978('0x17')]);}_0x528126[_0x5978('0x30')]=qs['sort'](_0x90d075[_0x5978('0x2a')]['sort']);_0x528126['where']=qs[_0x5978('0x31')](_[_0x5978('0x32')](_0x90d075['query'],_0x41426f[_0x5978('0x31')]),_0x1f2847);if(_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]){_0x528126[_0x5978('0x34')]=_[_0x5978('0x35')](_0x528126[_0x5978('0x34')],{'$or':_[_0x5978('0x25')](_0x1f2847,function(_0x41f8de){if(_0x41f8de[_0x5978('0x28')]!==_0x5978('0x36')){var _0x1d3414={};_0x1d3414[_0x41f8de['name']]={'$like':'%'+_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]+'%'};return _0x1d3414;}})});}_0x528126=_['merge']({},_0x528126,_0x90d075[_0x5978('0x37')]);var _0x3cf252={'where':_0x528126['where']};return db[_0x5978('0x26')][_0x5978('0x19')](_0x3cf252)['then'](function(_0x189134){_0x4402c0[_0x5978('0x19')]=_0x189134;if(_0x90d075[_0x5978('0x2a')][_0x5978('0x38')]){_0x528126[_0x5978('0x39')]=[{'all':!![]}];}return db[_0x5978('0x26')][_0x5978('0x3a')](_0x528126);})['then'](function(_0x3b2dce){_0x4402c0[_0x5978('0x3b')]=_0x3b2dce;return _0x4402c0;})[_0x5978('0x3c')](respondWithFilteredResult(_0x303f57,_0x528126))['catch'](handleError(_0x303f57,null));};exports[_0x5978('0x3d')]=function(_0x552ae1,_0x35472f){var _0x1bb298={'raw':!![],'where':{'id':_0x552ae1[_0x5978('0x3e')]['id']}},_0x36f7ee={};_0x36f7ee[_0x5978('0x29')]=_[_0x5978('0x3f')](db[_0x5978('0x26')][_0x5978('0x40')]);_0x36f7ee[_0x5978('0x2a')]=_[_0x5978('0x3f')](_0x552ae1[_0x5978('0x2a')]);_0x36f7ee[_0x5978('0x31')]=_[_0x5978('0x2b')](_0x36f7ee['model'],_0x36f7ee[_0x5978('0x2a')]);_0x1bb298['attributes']=_[_0x5978('0x2b')](_0x36f7ee['model'],qs[_0x5978('0x2d')](_0x552ae1[_0x5978('0x2a')]['fields']));_0x1bb298[_0x5978('0x2c')]=_0x1bb298[_0x5978('0x2c')][_0x5978('0x41')]?_0x1bb298[_0x5978('0x2c')]:_0x36f7ee[_0x5978('0x29')];if(_0x552ae1['query']['includeAll']){_0x1bb298[_0x5978('0x39')]=[{'all':!![]}];}_0x1bb298=_[_0x5978('0x35')]({},_0x1bb298,_0x552ae1[_0x5978('0x37')]);return db[_0x5978('0x26')][_0x5978('0x42')](_0x1bb298)[_0x5978('0x3c')](handleEntityNotFound(_0x35472f,null))[_0x5978('0x3c')](respondWithResult(_0x35472f,null))[_0x5978('0x43')](handleError(_0x35472f,null));};exports[_0x5978('0x44')]=function(_0x278a0a,_0x297ac1){return db['ZohoField'][_0x5978('0x44')](_0x278a0a[_0x5978('0x45')],{})['then'](respondWithResult(_0x297ac1,0xc9))[_0x5978('0x43')](handleError(_0x297ac1,null));};exports[_0x5978('0x1f')]=function(_0x388134,_0x2a1528){if(_0x388134['body']['id']){delete _0x388134['body']['id'];}return db[_0x5978('0x26')][_0x5978('0x42')]({'where':{'id':_0x388134[_0x5978('0x3e')]['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x2a1528,null))['then'](saveUpdates(_0x388134['body'],null))[_0x5978('0x3c')](respondWithResult(_0x2a1528,null))[_0x5978('0x43')](handleError(_0x2a1528,null));};exports[_0x5978('0x20')]=function(_0x3208a2,_0x5edd9f){return db[_0x5978('0x26')][_0x5978('0x42')]({'where':{'id':_0x3208a2[_0x5978('0x3e')]['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x5edd9f,null))[_0x5978('0x3c')](removeEntity(_0x5edd9f,null))[_0x5978('0x43')](handleError(_0x5edd9f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 1afee76..e431322 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 _0x5c3c=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x53595f,_0x227110){var _0x18abe8=function(_0x486a90){while(--_0x486a90){_0x53595f['push'](_0x53595f['shift']());}};_0x18abe8(++_0x227110);}(_0x5c3c,0x132));var _0xc5c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c3c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb091=['./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0xb091,0x16e));var _0x1b09=function(_0x59eab3,_0x322272){_0x59eab3=_0x59eab3-0x0;var _0x29db15=_0xb091[_0x59eab3];return _0x29db15;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('ZohoField',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[{'name':_0x1b09('0x9'),'fields':[_0x1b09('0xa'),_0x1b09('0xb')],'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 3ff200f..e639897 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 _0x9bef=['request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x9bef,0x14e));var _0xf9be=function(_0x2a7aba,_0x5e1b9d){_0x2a7aba=_0x2a7aba-0x0;var _0x127dfc=_0x9bef[_0x2a7aba];return _0x127dfc;};'use strict';var _=require(_0xf9be('0x0'));var util=require('util');var moment=require(_0xf9be('0x1'));var BPromise=require(_0xf9be('0x2'));var rs=require(_0xf9be('0x3'));var fs=require('fs');var Redis=require(_0xf9be('0x4'));var db=require(_0xf9be('0x5'))['db'];var utils=require(_0xf9be('0x6'));var logger=require(_0xf9be('0x7'))(_0xf9be('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf9be('0x9')][_0xf9be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b70e5,_0x3a3747,_0x3350bb){return new BPromise(function(_0x47895c,_0x48b669){return client[_0xf9be('0xb')](_0x1b70e5,_0x3350bb)[_0xf9be('0xc')](function(_0x4a8455){logger[_0xf9be('0xd')](_0xf9be('0xe'),_0x3a3747,_0xf9be('0xf'));logger[_0xf9be('0x10')](_0xf9be('0x11'),_0x3a3747,_0xf9be('0xf'),JSON['stringify'](_0x4a8455));if(_0x4a8455[_0xf9be('0x12')]){if(_0x4a8455[_0xf9be('0x12')][_0xf9be('0x13')]===0x1f4){logger[_0xf9be('0x12')](_0xf9be('0xe'),_0x3a3747,_0x4a8455[_0xf9be('0x12')][_0xf9be('0x14')]);return _0x48b669(_0x4a8455['error'][_0xf9be('0x14')]);}logger[_0xf9be('0x12')]('ZohoField,\x20%s,\x20%s',_0x3a3747,_0x4a8455[_0xf9be('0x12')][_0xf9be('0x14')]);return _0x47895c(_0x4a8455[_0xf9be('0x12')][_0xf9be('0x14')]);}else{logger[_0xf9be('0xd')](_0xf9be('0xe'),_0x3a3747,_0xf9be('0xf'));_0x47895c(_0x4a8455[_0xf9be('0x15')][_0xf9be('0x14')]);}})[_0xf9be('0x16')](function(_0x29c039){logger['error'](_0xf9be('0xe'),_0x3a3747,_0x29c039);_0x48b669(_0x29c039);});});} \ No newline at end of file +var _0x0a46=['ZohoField,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x41584c,_0x1acfb6){var _0x2c6c87=function(_0x5f70da){while(--_0x5f70da){_0x41584c['push'](_0x41584c['shift']());}};_0x2c6c87(++_0x1acfb6);}(_0x0a46,0xce));var _0x60a4=function(_0x2dc326,_0x38cad4){_0x2dc326=_0x2dc326-0x0;var _0x1e3dc3=_0x0a46[_0x2dc326];return _0x1e3dc3;};'use strict';var _=require(_0x60a4('0x0'));var util=require(_0x60a4('0x1'));var moment=require(_0x60a4('0x2'));var BPromise=require(_0x60a4('0x3'));var rs=require(_0x60a4('0x4'));var fs=require('fs');var Redis=require(_0x60a4('0x5'));var db=require(_0x60a4('0x6'))['db'];var utils=require(_0x60a4('0x7'));var logger=require('../../config/logger')(_0x60a4('0x8'));var config=require(_0x60a4('0x9'));var jayson=require(_0x60a4('0xa'));var client=jayson['client'][_0x60a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x355256,_0xbcc96a,_0x3a46f9){return new BPromise(function(_0x16f0c6,_0x4b8502){return client['request'](_0x355256,_0x3a46f9)[_0x60a4('0xc')](function(_0x530df2){logger[_0x60a4('0xd')](_0x60a4('0xe'),_0xbcc96a,'request\x20sent');logger[_0x60a4('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0xbcc96a,'request\x20sent',JSON[_0x60a4('0x10')](_0x530df2));if(_0x530df2[_0x60a4('0x11')]){if(_0x530df2['error'][_0x60a4('0x12')]===0x1f4){logger[_0x60a4('0x11')](_0x60a4('0xe'),_0xbcc96a,_0x530df2[_0x60a4('0x11')][_0x60a4('0x13')]);return _0x4b8502(_0x530df2[_0x60a4('0x11')][_0x60a4('0x13')]);}logger[_0x60a4('0x11')](_0x60a4('0xe'),_0xbcc96a,_0x530df2[_0x60a4('0x11')][_0x60a4('0x13')]);return _0x16f0c6(_0x530df2['error'][_0x60a4('0x13')]);}else{logger[_0x60a4('0xd')](_0x60a4('0xe'),_0xbcc96a,'request\x20sent');_0x16f0c6(_0x530df2[_0x60a4('0x14')][_0x60a4('0x13')]);}})[_0x60a4('0x15')](function(_0x4f4fbf){logger['error'](_0x60a4('0xe'),_0xbcc96a,_0x4f4fbf);_0x4b8502(_0x4f4fbf);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b5e019a..cf712cc 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x9bf804,_0xa8a88){var _0x216c68=function(_0x16614d){while(--_0x16614d){_0x9bf804['push'](_0x9bf804['shift']());}};_0x216c68(++_0xa8a88);}(_0x70e0,0x17b));var _0x070e=function(_0x33de3e,_0x57e9e3){_0x33de3e=_0x33de3e-0x0;var _0x4238a0=_0x70e0[_0x33de3e];return _0x4238a0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4b0d38,_0x5d44fb){var _0x4858cc=function(_0x41507c){while(--_0x41507c){_0x4b0d38['push'](_0x4b0d38['shift']());}};_0x4858cc(++_0x5d44fb);}(_0x70e0,0x17b));var _0x070e=function(_0x5b969e,_0x1a61be){_0x5b969e=_0x5b969e-0x0;var _0x5957c9=_0x70e0[_0x5b969e];return _0x5957c9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index b24ad17..16738ba 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 _0xbfa1=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x24cdbd,_0x4723c3){var _0x445184=function(_0x11ee56){while(--_0x11ee56){_0x24cdbd['push'](_0x24cdbd['shift']());}};_0x445184(++_0x4723c3);}(_0xbfa1,0x140));var _0x1bfa=function(_0x4d6b45,_0x325413){_0x4d6b45=_0x4d6b45-0x0;var _0x15a013=_0xbfa1[_0x4d6b45];return _0x15a013;};'use strict';var Sequelize=require(_0x1bfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bfa('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1bfa('0x2')},'main':{'type':Sequelize[_0x1bfa('0x1')],'defaultValue':_0x1bfa('0x3')},'filename':{'type':Sequelize[_0x1bfa('0x1')]},'path':{'type':Sequelize[_0x1bfa('0x1')]},'type':{'type':Sequelize[_0x1bfa('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x1bfa('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x1bfa('0x1')]},'logo':{'type':Sequelize[_0x1bfa('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x1bfa('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x1bfa('0x1')]},'remoteUri':{'type':Sequelize[_0x1bfa('0x1')]},'link':{'type':Sequelize[_0x1bfa('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xaeaa=['sequelize','STRING','unique_name_and_version','INTEGER','state'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0xaeaa,0x11d));var _0xaaea=function(_0x562369,_0x3f1993){_0x562369=_0x562369-0x0;var _0x312fee=_0xaeaa[_0x562369];return _0x312fee;};'use strict';var Sequelize=require(_0xaaea('0x0'));module['exports']={'name':{'type':Sequelize[_0xaaea('0x1')],'allowNull':![],'unique':_0xaaea('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaaea('0x2')},'main':{'type':Sequelize[_0xaaea('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaaea('0x1')]},'size':{'type':Sequelize[_0xaaea('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xaaea('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xaaea('0x1')],'unique':_0xaaea('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xaaea('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xaaea('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 10d7ea4..39379bd 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 _0x5c3c=['VIRTUAL','options','Integration','includeAll','include','findAll','rows','params','merge','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x3318c2,_0x2a0910){var _0x5f0d23=function(_0x4c1e3b){while(--_0x4c1e3b){_0x3318c2['push'](_0x3318c2['shift']());}};_0x5f0d23(++_0x2a0910);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x5c3c[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['Integration'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['Integration'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['Integration'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['Integration'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));}; \ No newline at end of file +var _0x9536=['includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','Integration','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9536,0x179));var _0x6953=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x9536[_0x34325b];return _0x3da348;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index f18a135..8bd1a7f 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 _0x10c7=['util','moment','bluebird','rimraf','../../config/environment','./integration.attributes','exports','lodash'];(function(_0x5b99d4,_0x55f667){var _0x49255f=function(_0x3a0f3c){while(--_0x3a0f3c){_0x5b99d4['push'](_0x5b99d4['shift']());}};_0x49255f(++_0x55f667);}(_0x10c7,0x16f));var _0x710c=function(_0x3c24e7,_0x2031f6){_0x3c24e7=_0x3c24e7-0x0;var _0x41cbe9=_0x10c7[_0x3c24e7];return _0x41cbe9;};'use strict';var _=require(_0x710c('0x0'));var util=require(_0x710c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x710c('0x2'));var BPromise=require(_0x710c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x710c('0x4'));var config=require(_0x710c('0x5'));var attributes=require(_0x710c('0x6'));module[_0x710c('0x7')]=function(_0x43dc80,_0x396f44){return _0x43dc80['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28b2=['Integration','integrations','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','define'];(function(_0x50e1c3,_0x88f63c){var _0x31ac77=function(_0x162547){while(--_0x162547){_0x50e1c3['push'](_0x50e1c3['shift']());}};_0x31ac77(++_0x88f63c);}(_0x28b2,0x18e));var _0x228b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x28b2[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x228b('0x0'));var util=require(_0x228b('0x1'));var logger=require('../../config/logger')(_0x228b('0x2'));var moment=require(_0x228b('0x3'));var BPromise=require('bluebird');var rp=require(_0x228b('0x4'));var fs=require('fs');var path=require(_0x228b('0x5'));var rimraf=require(_0x228b('0x6'));var config=require(_0x228b('0x7'));var attributes=require(_0x228b('0x8'));module['exports']=function(_0x17cc02,_0x1be24e){return _0x17cc02[_0x228b('0x9')](_0x228b('0xa'),attributes,{'tableName':_0x228b('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 e71c656..562af97 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 _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4e14a5,_0x2c85ab){var _0x5767d1=function(_0x47dc67){while(--_0x47dc67){_0x4e14a5['push'](_0x4e14a5['shift']());}};_0x5767d1(++_0x2c85ab);}(_0x0295,0x1f0));var _0x5029=function(_0x43cf80,_0x669560){_0x43cf80=_0x43cf80-0x0;var _0x91e948=_0x0295[_0x43cf80];return _0x91e948;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x40b29f,_0x4578ec){var _0x3d8b78=function(_0x53ad63){while(--_0x53ad63){_0x40b29f['push'](_0x40b29f['shift']());}};_0x3d8b78(++_0x4578ec);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Integration,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 0024567..3208f26 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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3e52db,_0x2da6ed){var _0x83f73b=function(_0x4d5221){while(--_0x4d5221){_0x3e52db['push'](_0x3e52db['shift']());}};_0x83f73b(++_0x2da6ed);}(_0x4975,0x86));var _0x5497=function(_0x2d8f8a,_0x327558){_0x2d8f8a=_0x2d8f8a-0x0;var _0x5e99a3=_0x4975[_0x2d8f8a];return _0x5e99a3;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 336fb92..1e3c617 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 _0x25a4=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','exports','STRING'];(function(_0x2db315,_0x58d720){var _0x12f9a2=function(_0x1f146e){while(--_0x1f146e){_0x2db315['push'](_0x2db315['shift']());}};_0x12f9a2(++_0x58d720);}(_0x25a4,0xae));var _0x425a=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x25a4[_0x5c7e53];return _0x1c9af9;};'use strict';var Sequelize=require('sequelize');module[_0x425a('0x0')]={'integration':{'type':Sequelize[_0x425a('0x1')]},'eventChannel':{'type':Sequelize[_0x425a('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x425a('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x425a('0x1')]},'queue':{'type':Sequelize[_0x425a('0x1')]},'interface':{'type':Sequelize[_0x425a('0x1')]},'membername':{'type':Sequelize[_0x425a('0x1')]},'agentcalledAt':{'type':Sequelize[_0x425a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x425a('0x3')]},'holdtime':{'type':Sequelize[_0x425a('0x2')]},'agentcomplete':{'type':Sequelize[_0x425a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x425a('0x3')]},'talktime':{'type':Sequelize[_0x425a('0x2')]},'agentacw':{'type':Sequelize[_0x425a('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x425a('0x2')]},'reason':{'type':Sequelize[_0x425a('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x425a('0x3')]},'agentdump':{'type':Sequelize[_0x425a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x425a('0x3')]},'lastevent':{'type':Sequelize[_0x425a('0x1')]},'channel':{'type':Sequelize[_0x425a('0x1')]},'channelstate':{'type':Sequelize[_0x425a('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x425a('0x1')]},'connectedlinename':{'type':Sequelize[_0x425a('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x425a('0x1')]},'context':{'type':Sequelize[_0x425a('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x425a('0x1')]},'destchannel':{'type':Sequelize[_0x425a('0x1')]},'destchannelstate':{'type':Sequelize[_0x425a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x425a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x425a('0x1')]},'destcalleridname':{'type':Sequelize[_0x425a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x425a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x425a('0x1')]},'destlanguage':{'type':Sequelize[_0x425a('0x1')]},'destaccountcode':{'type':Sequelize[_0x425a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x425a('0x1')]},'destpriority':{'type':Sequelize[_0x425a('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x425a('0x1')]},'subject':{'type':Sequelize[_0x425a('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x425a('0x1')]},'cc':{'type':Sequelize[_0x425a('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x425a('0x5')]},'text':{'type':Sequelize[_0x425a('0x5')]},'status':{'type':Sequelize[_0x425a('0x6')](_0x425a('0x7'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0x425a('0x1')]},'app':{'type':Sequelize[_0x425a('0x1')]},'appdata':{'type':Sequelize[_0x425a('0x1')]},'projectId':{'type':Sequelize[_0x425a('0x2')]}}; \ No newline at end of file +var _0xd0f2=['SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0xa6a23e,_0x8b657a){var _0x210e65=function(_0x58b4b8){while(--_0x58b4b8){_0xa6a23e['push'](_0xa6a23e['shift']());}};_0x210e65(++_0x8b657a);}(_0xd0f2,0xdc));var _0x2d0f=function(_0x241b39,_0x88273d){_0x241b39=_0x241b39-0x0;var _0x1f50f4=_0xd0f2[_0x241b39];return _0x1f50f4;};'use strict';var Sequelize=require(_0x2d0f('0x0'));module[_0x2d0f('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x2d0f('0x2')]},'exitStatus':{'type':Sequelize[_0x2d0f('0x2')]},'ticketId':{'type':Sequelize[_0x2d0f('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x2d0f('0x2')]},'uniqueid':{'type':Sequelize[_0x2d0f('0x2')]},'calleridnum':{'type':Sequelize[_0x2d0f('0x2')]},'calleridname':{'type':Sequelize[_0x2d0f('0x2')]},'queue':{'type':Sequelize[_0x2d0f('0x2')]},'interface':{'type':Sequelize[_0x2d0f('0x2')]},'membername':{'type':Sequelize[_0x2d0f('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2d0f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x2d0f('0x3')]},'holdtime':{'type':Sequelize[_0x2d0f('0x4')]},'agentcomplete':{'type':Sequelize[_0x2d0f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2d0f('0x3')]},'talktime':{'type':Sequelize[_0x2d0f('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2d0f('0x4')]},'reason':{'type':Sequelize[_0x2d0f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x2d0f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2d0f('0x3')]},'agentdump':{'type':Sequelize[_0x2d0f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2d0f('0x3')]},'lastevent':{'type':Sequelize[_0x2d0f('0x2')]},'channel':{'type':Sequelize[_0x2d0f('0x2')]},'channelstate':{'type':Sequelize[_0x2d0f('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2d0f('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2d0f('0x2')]},'accountcode':{'type':Sequelize[_0x2d0f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2d0f('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x2d0f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2d0f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x2d0f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2d0f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2d0f('0x2')]},'destlanguage':{'type':Sequelize[_0x2d0f('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2d0f('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2d0f('0x2')]},'destuniqueid':{'type':Sequelize[_0x2d0f('0x2')]},'messageId':{'type':Sequelize[_0x2d0f('0x2')]},'inReplyTo':{'type':Sequelize[_0x2d0f('0x2')]},'subject':{'type':Sequelize[_0x2d0f('0x2')]},'from':{'type':Sequelize[_0x2d0f('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x2d0f('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x2d0f('0x6')]},'status':{'type':Sequelize[_0x2d0f('0x7')](_0x2d0f('0x8'),_0x2d0f('0x9'),_0x2d0f('0xa'),_0x2d0f('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x2d0f('0x2')]},'projectId':{'type':Sequelize[_0x2d0f('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 49262be..2fabad5 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 _0x0906=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','params','filters','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0xc9b65d,_0x191674){var _0x159dcf=function(_0x108c2f){while(--_0x108c2f){_0xc9b65d['push'](_0xc9b65d['shift']());}};_0x159dcf(++_0x191674);}(_0x0906,0x128));var _0x6090=function(_0x37e305,_0x6a0cff){_0x37e305=_0x37e305-0x0;var _0x5e2bbb=_0x0906[_0x37e305];return _0x5e2bbb;};'use strict';var emlformat=require(_0x6090('0x0'));var rimraf=require(_0x6090('0x1'));var zipdir=require(_0x6090('0x2'));var jsonpatch=require(_0x6090('0x3'));var rp=require(_0x6090('0x4'));var moment=require(_0x6090('0x5'));var BPromise=require(_0x6090('0x6'));var Mustache=require('mustache');var util=require(_0x6090('0x7'));var path=require(_0x6090('0x8'));var sox=require(_0x6090('0x9'));var csv=require(_0x6090('0xa'));var ejs=require(_0x6090('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6090('0xc'));var squel=require(_0x6090('0xd'));var crypto=require(_0x6090('0xe'));var jsforce=require(_0x6090('0xf'));var deskjs=require(_0x6090('0x10'));var toCsv=require(_0x6090('0xa'));var querystring=require(_0x6090('0x11'));var Papa=require(_0x6090('0x12'));var Redis=require('ioredis');var authService=require(_0x6090('0x13'));var qs=require(_0x6090('0x14'));var as=require(_0x6090('0x15'));var hardwareService=require(_0x6090('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6090('0x17'));var db=require(_0x6090('0x18'))['db'];function respondWithStatusCode(_0x39c5ed,_0x4bfa5c){_0x4bfa5c=_0x4bfa5c||0xcc;return function(_0x2622d4){if(_0x2622d4){return _0x39c5ed[_0x6090('0x19')](_0x4bfa5c);}return _0x39c5ed['status'](_0x4bfa5c)[_0x6090('0x1a')]();};}function respondWithResult(_0x1ae613,_0x24d702){_0x24d702=_0x24d702||0xc8;return function(_0x2de67f){if(_0x2de67f){return _0x1ae613['status'](_0x24d702)[_0x6090('0x1b')](_0x2de67f);}};}function respondWithFilteredResult(_0x436c21,_0x419708){return function(_0x30d0d2){if(_0x30d0d2){var _0x25c83a=typeof _0x419708[_0x6090('0x1c')]===_0x6090('0x1d')&&typeof _0x419708[_0x6090('0x1e')]===_0x6090('0x1d');var _0x25bea6=_0x30d0d2[_0x6090('0x1f')];var _0x582728=_0x25c83a?0x0:_0x419708[_0x6090('0x1c')];var _0x1ab9e0=_0x25c83a?_0x30d0d2['count']:_0x419708[_0x6090('0x1c')]+_0x419708[_0x6090('0x1e')];var _0x328eff;if(_0x1ab9e0>=_0x25bea6){_0x1ab9e0=_0x25bea6;_0x328eff=0xc8;}else{_0x328eff=0xce;}_0x436c21[_0x6090('0x20')](_0x328eff);return _0x436c21[_0x6090('0x21')](_0x6090('0x22'),_0x582728+'-'+_0x1ab9e0+'/'+_0x25bea6)['json'](_0x30d0d2);}return null;};}function patchUpdates(_0x103a76){return function(_0x4802d2){try{jsonpatch[_0x6090('0x23')](_0x4802d2,_0x103a76,!![]);}catch(_0x39f075){return BPromise[_0x6090('0x24')](_0x39f075);}return _0x4802d2[_0x6090('0x25')]();};}function saveUpdates(_0x397787,_0x399123){return function(_0x3c852c){if(_0x3c852c){return _0x3c852c[_0x6090('0x26')](_0x397787)['then'](function(_0x11b6db){return _0x11b6db;});}return null;};}function removeEntity(_0x196283,_0x175a12){return function(_0x4a54c7){if(_0x4a54c7){return _0x4a54c7['destroy']()[_0x6090('0x27')](function(){_0x196283[_0x6090('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a21d,_0x454391){return function(_0x7c1930){if(!_0x7c1930){_0x17a21d['sendStatus'](0x194);}return _0x7c1930;};}function handleError(_0x5b9380,_0x4fe168){_0x4fe168=_0x4fe168||0x1f4;return function(_0x311d5a){logger[_0x6090('0x28')](_0x311d5a['stack']);if(_0x311d5a['name']){delete _0x311d5a[_0x6090('0x29')];}_0x5b9380['status'](_0x4fe168)[_0x6090('0x2a')](_0x311d5a);};}exports[_0x6090('0x2b')]=function(_0xaf9093,_0x40e75d){var _0x221b17={},_0x44ca60={},_0x3666f1={'count':0x0,'rows':[]};var _0xdd2cfb=_[_0x6090('0x2c')](db[_0x6090('0x2d')][_0x6090('0x2e')],function(_0x42c8fd){return{'name':_0x42c8fd[_0x6090('0x2f')],'type':_0x42c8fd[_0x6090('0x30')][_0x6090('0x31')]};});_0x44ca60['model']=_[_0x6090('0x2c')](_0xdd2cfb,_0x6090('0x29'));_0x44ca60[_0x6090('0x32')]=_[_0x6090('0x33')](_0xaf9093[_0x6090('0x32')]);_0x44ca60['filters']=_[_0x6090('0x34')](_0x44ca60[_0x6090('0x35')],_0x44ca60[_0x6090('0x32')]);_0x221b17[_0x6090('0x36')]=_['intersection'](_0x44ca60[_0x6090('0x35')],qs['fields'](_0xaf9093['query'][_0x6090('0x37')]));_0x221b17[_0x6090('0x36')]=_0x221b17[_0x6090('0x36')][_0x6090('0x38')]?_0x221b17[_0x6090('0x36')]:_0x44ca60[_0x6090('0x35')];if(!_0xaf9093[_0x6090('0x32')][_0x6090('0x39')](_0x6090('0x3a'))){_0x221b17[_0x6090('0x1e')]=qs[_0x6090('0x1e')](_0xaf9093[_0x6090('0x32')][_0x6090('0x1e')]);_0x221b17['offset']=qs['offset'](_0xaf9093['query'][_0x6090('0x1c')]);}_0x221b17[_0x6090('0x3b')]=qs[_0x6090('0x3c')](_0xaf9093['query']['sort']);_0x221b17[_0x6090('0x3d')]=qs['filters'](_[_0x6090('0x3e')](_0xaf9093[_0x6090('0x32')],_0x44ca60['filters']),_0xdd2cfb);if(_0xaf9093[_0x6090('0x32')]['filter']){_0x221b17[_0x6090('0x3d')]=_[_0x6090('0x3f')](_0x221b17[_0x6090('0x3d')],{'$or':_[_0x6090('0x2c')](_0xdd2cfb,function(_0x184a6e){if(_0x184a6e[_0x6090('0x30')]!=='VIRTUAL'){var _0x527083={};_0x527083[_0x184a6e[_0x6090('0x29')]]={'$like':'%'+_0xaf9093[_0x6090('0x32')][_0x6090('0x40')]+'%'};return _0x527083;}})});}_0x221b17=_[_0x6090('0x3f')]({},_0x221b17,_0xaf9093[_0x6090('0x41')]);var _0xc852e9={'where':_0x221b17[_0x6090('0x3d')]};return db[_0x6090('0x2d')]['count'](_0xc852e9)[_0x6090('0x27')](function(_0x592378){_0x3666f1[_0x6090('0x1f')]=_0x592378;if(_0xaf9093[_0x6090('0x32')][_0x6090('0x42')]){_0x221b17[_0x6090('0x43')]=[{'all':!![]}];}return db[_0x6090('0x2d')][_0x6090('0x44')](_0x221b17);})[_0x6090('0x27')](function(_0x512a2e){_0x3666f1['rows']=_0x512a2e;return _0x3666f1;})[_0x6090('0x27')](respondWithFilteredResult(_0x40e75d,_0x221b17))['catch'](handleError(_0x40e75d,null));};exports[_0x6090('0x45')]=function(_0x3d262f,_0x44b3cb){var _0x17b101={'raw':![],'where':{'id':_0x3d262f[_0x6090('0x46')]['id']}},_0x552073={};_0x552073[_0x6090('0x35')]=_[_0x6090('0x33')](db[_0x6090('0x2d')][_0x6090('0x2e')]);_0x552073['query']=_[_0x6090('0x33')](_0x3d262f[_0x6090('0x32')]);_0x552073[_0x6090('0x47')]=_[_0x6090('0x34')](_0x552073[_0x6090('0x35')],_0x552073[_0x6090('0x32')]);_0x17b101[_0x6090('0x36')]=_[_0x6090('0x34')](_0x552073[_0x6090('0x35')],qs[_0x6090('0x37')](_0x3d262f[_0x6090('0x32')]['fields']));_0x17b101[_0x6090('0x36')]=_0x17b101[_0x6090('0x36')][_0x6090('0x38')]?_0x17b101[_0x6090('0x36')]:_0x552073[_0x6090('0x35')];if(_0x3d262f[_0x6090('0x32')][_0x6090('0x42')]){_0x17b101[_0x6090('0x43')]=[{'all':!![]}];}_0x17b101=_[_0x6090('0x3f')]({},_0x17b101,_0x3d262f['options']);return db[_0x6090('0x2d')][_0x6090('0x48')](_0x17b101)['then'](handleEntityNotFound(_0x44b3cb,null))['then'](respondWithResult(_0x44b3cb,null))[_0x6090('0x49')](handleError(_0x44b3cb,null));};exports['create']=function(_0x435770,_0x4abbb7){return db[_0x6090('0x2d')][_0x6090('0x4a')](_0x435770[_0x6090('0x4b')],{})['then'](respondWithResult(_0x4abbb7,0xc9))[_0x6090('0x49')](handleError(_0x4abbb7,null));};exports[_0x6090('0x26')]=function(_0x4bbab5,_0x3a18b5){if(_0x4bbab5[_0x6090('0x4b')]['id']){delete _0x4bbab5['body']['id'];}return db[_0x6090('0x2d')]['find']({'where':{'id':_0x4bbab5['params']['id']}})[_0x6090('0x27')](handleEntityNotFound(_0x3a18b5,null))[_0x6090('0x27')](saveUpdates(_0x4bbab5[_0x6090('0x4b')],null))['then'](respondWithResult(_0x3a18b5,null))[_0x6090('0x49')](handleError(_0x3a18b5,null));};exports['destroy']=function(_0x3e2c2a,_0x5dcb4b){return db[_0x6090('0x2d')][_0x6090('0x48')]({'where':{'id':_0x3e2c2a['params']['id']}})[_0x6090('0x27')](handleEntityNotFound(_0x5dcb4b,null))[_0x6090('0x27')](removeEntity(_0x5dcb4b,null))[_0x6090('0x49')](handleError(_0x5dcb4b,null));};exports[_0x6090('0x4c')]=function(_0x1b8a85,_0x4d1839){return db['IntegrationReport']['describe']()[_0x6090('0x27')](respondWithResult(_0x4d1839,null))[_0x6090('0x49')](handleError(_0x4d1839,null));}; \ No newline at end of file +var _0xf0bb=['nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','create','body','update','find','describe','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length'];(function(_0x5b7771,_0x2f4223){var _0x477929=function(_0x44f0a8){while(--_0x44f0a8){_0x5b7771['push'](_0x5b7771['shift']());}};_0x477929(++_0x2f4223);}(_0xf0bb,0xeb));var _0xbf0b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf0bb[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xbf0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf0b('0x2'));var moment=require('moment');var BPromise=require(_0xbf0b('0x3'));var Mustache=require('mustache');var util=require(_0xbf0b('0x4'));var path=require(_0xbf0b('0x5'));var sox=require(_0xbf0b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf0b('0x7'));var _=require(_0xbf0b('0x8'));var squel=require(_0xbf0b('0x9'));var crypto=require(_0xbf0b('0xa'));var jsforce=require(_0xbf0b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbf0b('0xc'));var querystring=require(_0xbf0b('0xd'));var Papa=require(_0xbf0b('0xe'));var Redis=require('ioredis');var authService=require(_0xbf0b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbf0b('0x10'));var hardwareService=require(_0xbf0b('0x11'));var logger=require(_0xbf0b('0x12'))(_0xbf0b('0x13'));var utils=require(_0xbf0b('0x14'));var config=require(_0xbf0b('0x15'));var licenseUtil=require(_0xbf0b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32e4b2,_0x52d94f){_0x52d94f=_0x52d94f||0xcc;return function(_0x1bbd7f){if(_0x1bbd7f){return _0x32e4b2[_0xbf0b('0x17')](_0x52d94f);}return _0x32e4b2[_0xbf0b('0x18')](_0x52d94f)[_0xbf0b('0x19')]();};}function respondWithResult(_0x705fca,_0x1ebc18){_0x1ebc18=_0x1ebc18||0xc8;return function(_0xea00c8){if(_0xea00c8){return _0x705fca['status'](_0x1ebc18)[_0xbf0b('0x1a')](_0xea00c8);}};}function respondWithFilteredResult(_0x27fb66,_0x49ed79){return function(_0x1cf7aa){if(_0x1cf7aa){var _0x44d1b8=typeof _0x49ed79[_0xbf0b('0x1b')]===_0xbf0b('0x1c')&&typeof _0x49ed79['limit']===_0xbf0b('0x1c');var _0x1e3cab=_0x1cf7aa[_0xbf0b('0x1d')];var _0xc1ce10=_0x44d1b8?0x0:_0x49ed79[_0xbf0b('0x1b')];var _0x18faac=_0x44d1b8?_0x1cf7aa[_0xbf0b('0x1d')]:_0x49ed79['offset']+_0x49ed79[_0xbf0b('0x1e')];var _0xd7b64f;if(_0x18faac>=_0x1e3cab){_0x18faac=_0x1e3cab;_0xd7b64f=0xc8;}else{_0xd7b64f=0xce;}_0x27fb66[_0xbf0b('0x18')](_0xd7b64f);return _0x27fb66[_0xbf0b('0x1f')](_0xbf0b('0x20'),_0xc1ce10+'-'+_0x18faac+'/'+_0x1e3cab)[_0xbf0b('0x1a')](_0x1cf7aa);}return null;};}function patchUpdates(_0x51e1b2){return function(_0x20809f){try{jsonpatch['apply'](_0x20809f,_0x51e1b2,!![]);}catch(_0x444ffc){return BPromise[_0xbf0b('0x21')](_0x444ffc);}return _0x20809f[_0xbf0b('0x22')]();};}function saveUpdates(_0x267c75,_0x575a6b){return function(_0x3faaf3){if(_0x3faaf3){return _0x3faaf3['update'](_0x267c75)[_0xbf0b('0x23')](function(_0x29c123){return _0x29c123;});}return null;};}function removeEntity(_0x84979d,_0x752a40){return function(_0x118cea){if(_0x118cea){return _0x118cea[_0xbf0b('0x24')]()[_0xbf0b('0x23')](function(){_0x84979d[_0xbf0b('0x18')](0xcc)[_0xbf0b('0x19')]();});}};}function handleEntityNotFound(_0x45c03f,_0x4012a9){return function(_0x5788e8){if(!_0x5788e8){_0x45c03f[_0xbf0b('0x17')](0x194);}return _0x5788e8;};}function handleError(_0x2d4288,_0x84820a){_0x84820a=_0x84820a||0x1f4;return function(_0x2f72e0){logger['error'](_0x2f72e0['stack']);if(_0x2f72e0[_0xbf0b('0x25')]){delete _0x2f72e0['name'];}_0x2d4288[_0xbf0b('0x18')](_0x84820a)[_0xbf0b('0x26')](_0x2f72e0);};}exports[_0xbf0b('0x27')]=function(_0x8f5f4c,_0x554a60){var _0x5d0941={},_0x250a60={},_0xddf26a={'count':0x0,'rows':[]};var _0x2a6868=_[_0xbf0b('0x28')](db[_0xbf0b('0x29')][_0xbf0b('0x2a')],function(_0x17a0fd){return{'name':_0x17a0fd[_0xbf0b('0x2b')],'type':_0x17a0fd[_0xbf0b('0x2c')][_0xbf0b('0x2d')]};});_0x250a60[_0xbf0b('0x2e')]=_['map'](_0x2a6868,_0xbf0b('0x25'));_0x250a60['query']=_[_0xbf0b('0x2f')](_0x8f5f4c['query']);_0x250a60['filters']=_[_0xbf0b('0x30')](_0x250a60[_0xbf0b('0x2e')],_0x250a60[_0xbf0b('0x31')]);_0x5d0941['attributes']=_[_0xbf0b('0x30')](_0x250a60['model'],qs['fields'](_0x8f5f4c['query'][_0xbf0b('0x32')]));_0x5d0941[_0xbf0b('0x33')]=_0x5d0941['attributes'][_0xbf0b('0x34')]?_0x5d0941[_0xbf0b('0x33')]:_0x250a60[_0xbf0b('0x2e')];if(!_0x8f5f4c[_0xbf0b('0x31')]['hasOwnProperty'](_0xbf0b('0x35'))){_0x5d0941[_0xbf0b('0x1e')]=qs[_0xbf0b('0x1e')](_0x8f5f4c[_0xbf0b('0x31')][_0xbf0b('0x1e')]);_0x5d0941[_0xbf0b('0x1b')]=qs[_0xbf0b('0x1b')](_0x8f5f4c['query']['offset']);}_0x5d0941[_0xbf0b('0x36')]=qs[_0xbf0b('0x37')](_0x8f5f4c[_0xbf0b('0x31')]['sort']);_0x5d0941['where']=qs[_0xbf0b('0x38')](_[_0xbf0b('0x39')](_0x8f5f4c[_0xbf0b('0x31')],_0x250a60['filters']),_0x2a6868);if(_0x8f5f4c[_0xbf0b('0x31')][_0xbf0b('0x3a')]){_0x5d0941['where']=_[_0xbf0b('0x3b')](_0x5d0941['where'],{'$or':_[_0xbf0b('0x28')](_0x2a6868,function(_0x335773){if(_0x335773['type']!==_0xbf0b('0x3c')){var _0x2ae2e8={};_0x2ae2e8[_0x335773[_0xbf0b('0x25')]]={'$like':'%'+_0x8f5f4c['query'][_0xbf0b('0x3a')]+'%'};return _0x2ae2e8;}})});}_0x5d0941=_[_0xbf0b('0x3b')]({},_0x5d0941,_0x8f5f4c[_0xbf0b('0x3d')]);var _0x5081b1={'where':_0x5d0941['where']};return db['IntegrationReport'][_0xbf0b('0x1d')](_0x5081b1)[_0xbf0b('0x23')](function(_0x20da27){_0xddf26a[_0xbf0b('0x1d')]=_0x20da27;if(_0x8f5f4c[_0xbf0b('0x31')][_0xbf0b('0x3e')]){_0x5d0941['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xbf0b('0x3f')](_0x5d0941);})[_0xbf0b('0x23')](function(_0x2be800){_0xddf26a[_0xbf0b('0x40')]=_0x2be800;return _0xddf26a;})['then'](respondWithFilteredResult(_0x554a60,_0x5d0941))[_0xbf0b('0x41')](handleError(_0x554a60,null));};exports['show']=function(_0x199f20,_0x4aad32){var _0x2cb710={'raw':![],'where':{'id':_0x199f20[_0xbf0b('0x42')]['id']}},_0x20bd67={};_0x20bd67[_0xbf0b('0x2e')]=_[_0xbf0b('0x2f')](db[_0xbf0b('0x29')][_0xbf0b('0x2a')]);_0x20bd67[_0xbf0b('0x31')]=_['keys'](_0x199f20[_0xbf0b('0x31')]);_0x20bd67[_0xbf0b('0x38')]=_[_0xbf0b('0x30')](_0x20bd67[_0xbf0b('0x2e')],_0x20bd67['query']);_0x2cb710['attributes']=_[_0xbf0b('0x30')](_0x20bd67['model'],qs['fields'](_0x199f20[_0xbf0b('0x31')][_0xbf0b('0x32')]));_0x2cb710[_0xbf0b('0x33')]=_0x2cb710[_0xbf0b('0x33')][_0xbf0b('0x34')]?_0x2cb710['attributes']:_0x20bd67[_0xbf0b('0x2e')];if(_0x199f20[_0xbf0b('0x31')][_0xbf0b('0x3e')]){_0x2cb710['include']=[{'all':!![]}];}_0x2cb710=_['merge']({},_0x2cb710,_0x199f20['options']);return db[_0xbf0b('0x29')]['find'](_0x2cb710)[_0xbf0b('0x23')](handleEntityNotFound(_0x4aad32,null))[_0xbf0b('0x23')](respondWithResult(_0x4aad32,null))[_0xbf0b('0x41')](handleError(_0x4aad32,null));};exports[_0xbf0b('0x43')]=function(_0x251dec,_0x2b8953){return db[_0xbf0b('0x29')]['create'](_0x251dec[_0xbf0b('0x44')],{})[_0xbf0b('0x23')](respondWithResult(_0x2b8953,0xc9))[_0xbf0b('0x41')](handleError(_0x2b8953,null));};exports[_0xbf0b('0x45')]=function(_0x43b18c,_0x2506c2){if(_0x43b18c[_0xbf0b('0x44')]['id']){delete _0x43b18c['body']['id'];}return db[_0xbf0b('0x29')][_0xbf0b('0x46')]({'where':{'id':_0x43b18c['params']['id']}})[_0xbf0b('0x23')](handleEntityNotFound(_0x2506c2,null))[_0xbf0b('0x23')](saveUpdates(_0x43b18c[_0xbf0b('0x44')],null))[_0xbf0b('0x23')](respondWithResult(_0x2506c2,null))['catch'](handleError(_0x2506c2,null));};exports[_0xbf0b('0x24')]=function(_0x17c716,_0x50f914){return db[_0xbf0b('0x29')][_0xbf0b('0x46')]({'where':{'id':_0x17c716[_0xbf0b('0x42')]['id']}})['then'](handleEntityNotFound(_0x50f914,null))['then'](removeEntity(_0x50f914,null))[_0xbf0b('0x41')](handleError(_0x50f914,null));};exports[_0xbf0b('0x47')]=function(_0x3c7843,_0x3bec85){return db[_0xbf0b('0x29')][_0xbf0b('0x47')]()[_0xbf0b('0x23')](respondWithResult(_0x3bec85,null))[_0xbf0b('0x41')](handleError(_0x3bec85,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4194a69..481925b 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 _0x7d03=['../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x7d03,0x71));var _0x37d0=function(_0x5c055a,_0x40487f){_0x5c055a=_0x5c055a-0x0;var _0x49c069=_0x7d03[_0x5c055a];return _0x49c069;};'use strict';var _=require(_0x37d0('0x0'));var util=require('util');var logger=require(_0x37d0('0x1'))(_0x37d0('0x2'));var moment=require('moment');var BPromise=require(_0x37d0('0x3'));var rp=require(_0x37d0('0x4'));var fs=require('fs');var path=require(_0x37d0('0x5'));var rimraf=require(_0x37d0('0x6'));var config=require(_0x37d0('0x7'));var attributes=require(_0x37d0('0x8'));module[_0x37d0('0x9')]=function(_0xf9fa72,_0x425d11){return _0xf9fa72['define'](_0x37d0('0xa'),attributes,{'tableName':_0x37d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe1c=['define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x4a9b61,_0x131a15){var _0x2c0c75=function(_0x51809b){while(--_0x51809b){_0x4a9b61['push'](_0x4a9b61['shift']());}};_0x2c0c75(++_0x131a15);}(_0xbe1c,0x65));var _0xcbe1=function(_0x573725,_0x3d0257){_0x573725=_0x573725-0x0;var _0x3c40fe=_0xbe1c[_0x573725];return _0x3c40fe;};'use strict';var _=require('lodash');var util=require(_0xcbe1('0x0'));var logger=require(_0xcbe1('0x1'))(_0xcbe1('0x2'));var moment=require(_0xcbe1('0x3'));var BPromise=require(_0xcbe1('0x4'));var rp=require(_0xcbe1('0x5'));var fs=require('fs');var path=require(_0xcbe1('0x6'));var rimraf=require(_0xcbe1('0x7'));var config=require(_0xcbe1('0x8'));var attributes=require(_0xcbe1('0x9'));module[_0xcbe1('0xa')]=function(_0x442631,_0x5e5093){return _0x442631[_0xcbe1('0xb')](_0xcbe1('0xc'),attributes,{'tableName':_0xcbe1('0xd'),'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 647e312..45bbf48 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 _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x7992e2,_0x4f22c1){var _0x49a0b2=function(_0x110a16){while(--_0x110a16){_0x7992e2['push'](_0x7992e2['shift']());}};_0x49a0b2(++_0x4f22c1);}(_0x1261,0x144));var _0x1126=function(_0x491b60,_0x4dcc2c){_0x491b60=_0x491b60-0x0;var _0x461a23=_0x1261[_0x491b60];return _0x461a23;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4705ab,_0x5893a7){_0x4705ab=_0x4705ab-0x0;var _0x1f72db=_0xc2c7[_0x4705ab];return _0x1f72db;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b5698b4..4e328f0 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 _0x980e=['../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','put','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x4c45c9,_0x3fcb80){var _0x6ee1e7=function(_0x347202){while(--_0x347202){_0x4c45c9['push'](_0x4c45c9['shift']());}};_0x6ee1e7(++_0x3fcb80);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe980('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe980('0x1'));var express=require('express');var router=express[_0xe980('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe980('0x3'));var interaction=require(_0xe980('0x4'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0xe980('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe980('0x5')](_0xe980('0x6'),auth[_0xe980('0x7')](),controller[_0xe980('0x8')]);router[_0xe980('0x5')](_0xe980('0x9'),auth['isAuthenticated'](),controller[_0xe980('0xa')]);router[_0xe980('0xb')]('/',auth[_0xe980('0x7')](),controller['create']);router[_0xe980('0xb')](_0xe980('0x9'),auth[_0xe980('0x7')](),controller[_0xe980('0xc')]);router[_0xe980('0xb')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router[_0xe980('0xd')](_0xe980('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xe980('0xe')](_0xe980('0x6'),auth[_0xe980('0x7')](),controller[_0xe980('0xf')]);module[_0xe980('0x10')]=router; \ No newline at end of file +var _0x2cd0=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','update','delete','destroy','exports','multer','util'];(function(_0x55a0af,_0x2c4232){var _0x2b86b4=function(_0x194cbc){while(--_0x194cbc){_0x55a0af['push'](_0x55a0af['shift']());}};_0x2b86b4(++_0x2c4232);}(_0x2cd0,0x8a));var _0x02cd=function(_0x2158e5,_0x111ced){_0x2158e5=_0x2158e5-0x0;var _0x37b296=_0x2cd0[_0x2158e5];return _0x37b296;};'use strict';var multer=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x02cd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x02cd('0x3'));var interaction=require(_0x02cd('0x4'));var config=require(_0x02cd('0x5'));var controller=require(_0x02cd('0x6'));router[_0x02cd('0x7')]('/',auth[_0x02cd('0x8')](),controller[_0x02cd('0x9')]);router[_0x02cd('0x7')](_0x02cd('0xa'),auth[_0x02cd('0x8')](),controller['show']);router[_0x02cd('0x7')](_0x02cd('0xb'),auth[_0x02cd('0x8')](),controller[_0x02cd('0xc')]);router[_0x02cd('0xd')]('/',auth[_0x02cd('0x8')](),controller[_0x02cd('0xe')]);router[_0x02cd('0xd')](_0x02cd('0xb'),auth[_0x02cd('0x8')](),controller['addInterval']);router['post'](_0x02cd('0xf'),auth[_0x02cd('0x8')](),controller['addIntervals']);router['put'](_0x02cd('0xa'),auth['isAuthenticated'](),controller[_0x02cd('0x10')]);router[_0x02cd('0x11')](_0x02cd('0xa'),auth[_0x02cd('0x8')](),controller[_0x02cd('0x12')]);module[_0x02cd('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4ccb663..ffbfff1 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 _0x2568=['STRING','exports'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x2568,0x89));var _0x8256=function(_0x211bba,_0x4d6c40){_0x211bba=_0x211bba-0x0;var _0x5d1886=_0x2568[_0x211bba];return _0x5d1886;};'use strict';var Sequelize=require('sequelize');module[_0x8256('0x0')]={'name':{'type':Sequelize[_0x8256('0x1')]},'description':{'type':Sequelize[_0x8256('0x1')]},'interval':{'type':Sequelize[_0x8256('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x40e6=['STRING'];(function(_0x1e4404,_0x5ee7d9){var _0x360f62=function(_0x4c47c9){while(--_0x4c47c9){_0x1e4404['push'](_0x1e4404['shift']());}};_0x360f62(++_0x5ee7d9);}(_0x40e6,0x1aa));var _0x640e=function(_0x31ddba,_0x28ec26){_0x31ddba=_0x31ddba-0x0;var _0x3f014c=_0x40e6[_0x31ddba];return _0x3f014c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x640e('0x0')]},'description':{'type':Sequelize[_0x640e('0x0')]},'interval':{'type':Sequelize[_0x640e('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e052a7d..6af8842 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 _0xdfda=['count','set','Content-Range','json','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','status','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','Interval','length','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','offset'];(function(_0x44d117,_0x5919fe){var _0x27e936=function(_0x112829){while(--_0x112829){_0x44d117['push'](_0x44d117['shift']());}};_0x27e936(++_0x5919fe);}(_0xdfda,0xa1));var _0xadfd=function(_0x30359a,_0x3e2edd){_0x30359a=_0x30359a-0x0;var _0x46d0e5=_0xdfda[_0x30359a];return _0x46d0e5;};'use strict';var emlformat=require(_0xadfd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadfd('0x1'));var jsonpatch=require(_0xadfd('0x2'));var rp=require(_0xadfd('0x3'));var moment=require('moment');var BPromise=require(_0xadfd('0x4'));var Mustache=require('mustache');var util=require(_0xadfd('0x5'));var path=require('path');var sox=require(_0xadfd('0x6'));var csv=require('to-csv');var ejs=require(_0xadfd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadfd('0x8'));var squel=require(_0xadfd('0x9'));var crypto=require(_0xadfd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xadfd('0xb'));var toCsv=require(_0xadfd('0xc'));var querystring=require(_0xadfd('0xd'));var Papa=require(_0xadfd('0xe'));var Redis=require(_0xadfd('0xf'));var authService=require(_0xadfd('0x10'));var qs=require(_0xadfd('0x11'));var as=require(_0xadfd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xadfd('0x13'));var utils=require(_0xadfd('0x14'));var config=require(_0xadfd('0x15'));var licenseUtil=require(_0xadfd('0x16'));var db=require(_0xadfd('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x45e30d,_0x1a9c0a){_0x1a9c0a=_0x1a9c0a||0xcc;return function(_0x546834){if(_0x546834){return _0x45e30d[_0xadfd('0x18')](_0x1a9c0a);}return _0x45e30d['status'](_0x1a9c0a)[_0xadfd('0x19')]();};}function respondWithResult(_0x431f57,_0x5d360f){_0x5d360f=_0x5d360f||0xc8;return function(_0x143df5){if(_0x143df5){return _0x431f57['status'](_0x5d360f)['json'](_0x143df5);}};}function respondWithFilteredResult(_0x417d46,_0x201af9){return function(_0x4772b1){if(_0x4772b1){var _0xf9cf4d=typeof _0x201af9['offset']===_0xadfd('0x1a')&&typeof _0x201af9[_0xadfd('0x1b')]==='undefined';var _0x53808e=_0x4772b1['count'];var _0x1db44d=_0xf9cf4d?0x0:_0x201af9[_0xadfd('0x1c')];var _0x5b1186=_0xf9cf4d?_0x4772b1[_0xadfd('0x1d')]:_0x201af9['offset']+_0x201af9['limit'];var _0x1bb056;if(_0x5b1186>=_0x53808e){_0x5b1186=_0x53808e;_0x1bb056=0xc8;}else{_0x1bb056=0xce;}_0x417d46['status'](_0x1bb056);return _0x417d46[_0xadfd('0x1e')](_0xadfd('0x1f'),_0x1db44d+'-'+_0x5b1186+'/'+_0x53808e)[_0xadfd('0x20')](_0x4772b1);}return null;};}function patchUpdates(_0x3221c2){return function(_0x26e3ba){try{jsonpatch[_0xadfd('0x21')](_0x26e3ba,_0x3221c2,!![]);}catch(_0x21f26a){return BPromise[_0xadfd('0x22')](_0x21f26a);}return _0x26e3ba[_0xadfd('0x23')]();};}function saveUpdates(_0x5d9229,_0x184122){return function(_0x252741){if(_0x252741){return _0x252741[_0xadfd('0x24')](_0x5d9229)[_0xadfd('0x25')](function(_0x2c478d){return _0x2c478d;});}return null;};}function removeEntity(_0x112a99,_0x3c3c7a){return function(_0x48c4d1){if(_0x48c4d1){return _0x48c4d1['destroy']()[_0xadfd('0x25')](function(){var _0x5470ad=_0x48c4d1[_0xadfd('0x26')]({'plain':!![]});var _0x3d6917=_0xadfd('0x27');return db[_0xadfd('0x28')][_0xadfd('0x29')]({'where':{'type':_0x3d6917,'resourceId':_0x5470ad['id']}})[_0xadfd('0x25')](function(){return _0x48c4d1;});})['then'](function(){_0x112a99[_0xadfd('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x345c09,_0x306d0d){return function(_0xa66f12){if(!_0xa66f12){_0x345c09[_0xadfd('0x18')](0x194);}return _0xa66f12;};}function handleError(_0x26a00d,_0x3f1816){_0x3f1816=_0x3f1816||0x1f4;return function(_0x2033a8){logger['error'](_0x2033a8[_0xadfd('0x2b')]);if(_0x2033a8[_0xadfd('0x2c')]){delete _0x2033a8['name'];}_0x26a00d[_0xadfd('0x2a')](_0x3f1816)[_0xadfd('0x2d')](_0x2033a8);};}exports[_0xadfd('0x2e')]=function(_0x1a497a,_0x3f48a3){var _0x2de381={},_0x3579ab={},_0x584ae2={'count':0x0,'rows':[]};var _0x379e0d=_['map'](db['Interval'][_0xadfd('0x2f')],function(_0x2391c7){return{'name':_0x2391c7[_0xadfd('0x30')],'type':_0x2391c7['type'][_0xadfd('0x31')]};});_0x3579ab[_0xadfd('0x32')]=_[_0xadfd('0x33')](_0x379e0d,_0xadfd('0x2c'));_0x3579ab[_0xadfd('0x34')]=_[_0xadfd('0x35')](_0x1a497a['query']);_0x3579ab[_0xadfd('0x36')]=_[_0xadfd('0x37')](_0x3579ab[_0xadfd('0x32')],_0x3579ab[_0xadfd('0x34')]);_0x2de381[_0xadfd('0x38')]=_[_0xadfd('0x37')](_0x3579ab[_0xadfd('0x32')],qs[_0xadfd('0x39')](_0x1a497a[_0xadfd('0x34')][_0xadfd('0x39')]));_0x2de381['attributes']=_0x2de381[_0xadfd('0x38')]['length']?_0x2de381[_0xadfd('0x38')]:_0x3579ab[_0xadfd('0x32')];if(!_0x1a497a[_0xadfd('0x34')][_0xadfd('0x3a')](_0xadfd('0x3b'))){_0x2de381['limit']=qs[_0xadfd('0x1b')](_0x1a497a[_0xadfd('0x34')][_0xadfd('0x1b')]);_0x2de381[_0xadfd('0x1c')]=qs[_0xadfd('0x1c')](_0x1a497a['query']['offset']);}_0x2de381[_0xadfd('0x3c')]=qs['sort'](_0x1a497a[_0xadfd('0x34')][_0xadfd('0x3d')]);_0x2de381['where']=qs[_0xadfd('0x36')](_[_0xadfd('0x3e')](_0x1a497a[_0xadfd('0x34')],_0x3579ab[_0xadfd('0x36')]),_0x379e0d);if(_0x1a497a['query'][_0xadfd('0x3f')]){_0x2de381[_0xadfd('0x40')]=_[_0xadfd('0x41')](_0x2de381[_0xadfd('0x40')],{'$or':_['map'](_0x379e0d,function(_0x246884){if(_0x246884[_0xadfd('0x42')]!=='VIRTUAL'){var _0x3a4d57={};_0x3a4d57[_0x246884[_0xadfd('0x2c')]]={'$like':'%'+_0x1a497a[_0xadfd('0x34')][_0xadfd('0x3f')]+'%'};return _0x3a4d57;}})});}_0x2de381=_['merge']({},_0x2de381,_0x1a497a[_0xadfd('0x43')]);var _0x2fa532={'where':_0x2de381[_0xadfd('0x40')]};return db['Interval'][_0xadfd('0x1d')](_0x2fa532)[_0xadfd('0x25')](function(_0x5e1fbc){_0x584ae2['count']=_0x5e1fbc;if(_0x1a497a[_0xadfd('0x34')][_0xadfd('0x44')]){_0x2de381[_0xadfd('0x45')]=[{'all':!![]}];}return db['Interval'][_0xadfd('0x46')](_0x2de381);})[_0xadfd('0x25')](function(_0x43937b){_0x584ae2[_0xadfd('0x47')]=_0x43937b;return _0x584ae2;})[_0xadfd('0x25')](respondWithFilteredResult(_0x3f48a3,_0x2de381))['catch'](handleError(_0x3f48a3,null));};exports['show']=function(_0x3a0967,_0xb1d0de){var _0x2cd53d={'raw':!![],'where':{'id':_0x3a0967['params']['id']}},_0x183b2f={};_0x183b2f[_0xadfd('0x32')]=_['keys'](db[_0xadfd('0x48')][_0xadfd('0x2f')]);_0x183b2f[_0xadfd('0x34')]=_['keys'](_0x3a0967['query']);_0x183b2f[_0xadfd('0x36')]=_[_0xadfd('0x37')](_0x183b2f['model'],_0x183b2f[_0xadfd('0x34')]);_0x2cd53d[_0xadfd('0x38')]=_[_0xadfd('0x37')](_0x183b2f[_0xadfd('0x32')],qs[_0xadfd('0x39')](_0x3a0967['query'][_0xadfd('0x39')]));_0x2cd53d[_0xadfd('0x38')]=_0x2cd53d[_0xadfd('0x38')][_0xadfd('0x49')]?_0x2cd53d[_0xadfd('0x38')]:_0x183b2f['model'];if(_0x3a0967[_0xadfd('0x34')][_0xadfd('0x44')]){_0x2cd53d[_0xadfd('0x45')]=[{'all':!![]}];}_0x2cd53d=_['merge']({},_0x2cd53d,_0x3a0967[_0xadfd('0x43')]);return db[_0xadfd('0x48')]['find'](_0x2cd53d)['then'](handleEntityNotFound(_0xb1d0de,null))[_0xadfd('0x25')](respondWithResult(_0xb1d0de,null))[_0xadfd('0x4a')](handleError(_0xb1d0de,null));};exports[_0xadfd('0x4b')]=function(_0x59f03a,_0x55fac0){return db['Interval'][_0xadfd('0x4b')](_0x59f03a['body'],{})[_0xadfd('0x25')](function(_0x1019bf){var _0x39984e=_0x59f03a[_0xadfd('0x4c')][_0xadfd('0x26')]({'plain':!![]});if(!_0x39984e)throw new Error(_0xadfd('0x4d'));if(_0x39984e[_0xadfd('0x4e')]===_0xadfd('0x4c')){var _0x95352e=_0x1019bf[_0xadfd('0x26')]({'plain':!![]});var _0x23aec7='Intervals';return db[_0xadfd('0x4f')][_0xadfd('0x50')]({'where':{'name':_0x23aec7,'userProfileId':_0x39984e[_0xadfd('0x51')]},'raw':!![]})[_0xadfd('0x25')](function(_0x707d24){if(_0x707d24&&_0x707d24[_0xadfd('0x52')]===0x0){return db[_0xadfd('0x28')][_0xadfd('0x4b')]({'name':_0x95352e[_0xadfd('0x2c')],'resourceId':_0x95352e['id'],'type':_0x707d24[_0xadfd('0x2c')],'sectionId':_0x707d24['id']},{})[_0xadfd('0x25')](function(){return _0x1019bf;});}else{return _0x1019bf;}})[_0xadfd('0x4a')](function(_0x5c1da4){logger[_0xadfd('0x53')](_0xadfd('0x54'),_0x5c1da4);throw _0x5c1da4;});}return _0x1019bf;})['then'](respondWithResult(_0x55fac0,0xc9))[_0xadfd('0x4a')](handleError(_0x55fac0,null));};exports[_0xadfd('0x24')]=function(_0x5aa5b7,_0x30db31){if(_0x5aa5b7['body']['id']){delete _0x5aa5b7[_0xadfd('0x55')]['id'];}return db[_0xadfd('0x48')][_0xadfd('0x50')]({'where':{'id':_0x5aa5b7[_0xadfd('0x56')]['id']}})[_0xadfd('0x25')](handleEntityNotFound(_0x30db31,null))['then'](saveUpdates(_0x5aa5b7['body'],null))['then'](respondWithResult(_0x30db31,null))['catch'](handleError(_0x30db31,null));};exports[_0xadfd('0x29')]=function(_0x4822ab,_0x3843a4){return db['Interval'][_0xadfd('0x50')]({'where':{'id':_0x4822ab['params']['id']}})[_0xadfd('0x25')](handleEntityNotFound(_0x3843a4,null))[_0xadfd('0x25')](removeEntity(_0x3843a4,null))[_0xadfd('0x4a')](handleError(_0x3843a4,null));};exports[_0xadfd('0x57')]=function(_0x33c38b,_0x88e42b,_0x32f0a0){if(_0x33c38b[_0xadfd('0x55')]['id']){delete _0x33c38b[_0xadfd('0x55')]['id'];}return db[_0xadfd('0x48')][_0xadfd('0x50')]({'where':{'id':_0x33c38b[_0xadfd('0x56')]['id']}})['then'](handleEntityNotFound(_0x88e42b,null))['then'](function(_0x4ab444){if(_0x4ab444){_0x33c38b[_0xadfd('0x55')][_0xadfd('0x58')]=_0x4ab444['id'];return db['Interval']['create'](_0x33c38b[_0xadfd('0x55')]);}})[_0xadfd('0x25')](respondWithResult(_0x88e42b,null))[_0xadfd('0x4a')](handleError(_0x88e42b,null));};exports[_0xadfd('0x59')]=function(_0x4da2a7,_0x533afe,_0x86e938){var _0x3e7b06={};var _0x1efd3b={};var _0xb2e522;var _0x1f4474;return db[_0xadfd('0x48')][_0xadfd('0x5a')]({'where':{'id':_0x4da2a7[_0xadfd('0x56')]['id']}})['then'](handleEntityNotFound(_0x533afe,null))['then'](function(_0x31d80b){if(_0x31d80b){_0xb2e522=_0x31d80b;_0x1efd3b['model']=_['keys'](db[_0xadfd('0x48')][_0xadfd('0x2f')]);_0x1efd3b[_0xadfd('0x34')]=_[_0xadfd('0x35')](_0x4da2a7[_0xadfd('0x34')]);_0x1efd3b['filters']=_[_0xadfd('0x37')](_0x1efd3b[_0xadfd('0x32')],_0x1efd3b[_0xadfd('0x34')]);_0x3e7b06[_0xadfd('0x38')]=_[_0xadfd('0x37')](_0x1efd3b[_0xadfd('0x32')],qs[_0xadfd('0x39')](_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x39')]));_0x3e7b06[_0xadfd('0x38')]=_0x3e7b06[_0xadfd('0x38')][_0xadfd('0x49')]?_0x3e7b06['attributes']:_0x1efd3b[_0xadfd('0x32')];_0x3e7b06['order']=qs[_0xadfd('0x3d')](_0x4da2a7['query']['sort']);_0x3e7b06['where']=qs[_0xadfd('0x36')](_[_0xadfd('0x3e')](_0x4da2a7[_0xadfd('0x34')],_0x1efd3b['filters']));if(_0x4da2a7[_0xadfd('0x34')]['filter']){_0x3e7b06[_0xadfd('0x40')]=_[_0xadfd('0x41')](_0x3e7b06[_0xadfd('0x40')],{'$or':_['map'](_0x3e7b06['attributes'],function(_0x2eb488){var _0x581e6a={};_0x581e6a[_0x2eb488]={'$like':'%'+_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x3f')]+'%'};return _0x581e6a;})});}_0x3e7b06=_[_0xadfd('0x41')]({},_0x3e7b06,_0x4da2a7[_0xadfd('0x43')]);return _0xb2e522['getIntervals'](_0x3e7b06);}})['then'](function(_0x2a2a3a){if(_0x2a2a3a){_0x1f4474=_0x2a2a3a[_0xadfd('0x49')];if(!_0x4da2a7[_0xadfd('0x34')]['hasOwnProperty'](_0xadfd('0x3b'))){_0x3e7b06[_0xadfd('0x1b')]=qs[_0xadfd('0x1b')](_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x1b')]);_0x3e7b06[_0xadfd('0x1c')]=qs[_0xadfd('0x1c')](_0x4da2a7[_0xadfd('0x34')][_0xadfd('0x1c')]);}return _0xb2e522[_0xadfd('0x59')](_0x3e7b06);}})['then'](function(_0x485b51){if(_0x485b51){return _0x485b51?{'count':_0x1f4474,'rows':_0x485b51}:null;}})[_0xadfd('0x25')](respondWithResult(_0x533afe,null))[_0xadfd('0x4a')](handleError(_0x533afe,null));};exports[_0xadfd('0x5b')]=function(_0x4099cb,_0x5933cd,_0x7c62e1){return db['Interval'][_0xadfd('0x5a')]({'where':{'id':_0x4099cb[_0xadfd('0x56')]['id']}})['then'](handleEntityNotFound(_0x5933cd,null))[_0xadfd('0x25')](function(_0x2af02e){if(_0x2af02e){return db[_0xadfd('0x5c')][_0xadfd('0x5d')](function(_0x3b6637){return db[_0xadfd('0x48')]['destroy']({'where':{'IntervalId':_0x4099cb[_0xadfd('0x56')]['id']},'transaction':_0x3b6637})[_0xadfd('0x25')](function(_0x2d5091){var _0x1fa83b=_[_0xadfd('0x33')](_0x4099cb[_0xadfd('0x55')],function(_0x3c992a){delete _0x3c992a['id'];_0x3c992a[_0xadfd('0x58')]=_0x4099cb['params']['id'];return _0x3c992a;});return db[_0xadfd('0x48')][_0xadfd('0x5e')](_0x1fa83b,{'transaction':_0x3b6637});});})[_0xadfd('0x25')](function(){return db[_0xadfd('0x48')][_0xadfd('0x46')]({'where':{'IntervalId':_0x4099cb[_0xadfd('0x56')]['id']}});});}})[_0xadfd('0x25')](respondWithResult(_0x5933cd,null))[_0xadfd('0x4a')](handleError(_0x5933cd,null));}; \ No newline at end of file +var _0x6a26=['options','includeAll','include','Interval','findAll','catch','params','filters','find','create','body','user','role','get','UserProfileSection','userProfileId','update','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','reject','destroy','then','Intervals','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL'];(function(_0x4b2069,_0x46d675){var _0x2a2ae5=function(_0x495703){while(--_0x495703){_0x4b2069['push'](_0x4b2069['shift']());}};_0x2a2ae5(++_0x46d675);}(_0x6a26,0x74));var _0x66a2=function(_0x561ff5,_0x3b45c7){_0x561ff5=_0x561ff5-0x0;var _0x3244fb=_0x6a26[_0x561ff5];return _0x3244fb;};'use strict';var emlformat=require(_0x66a2('0x0'));var rimraf=require(_0x66a2('0x1'));var zipdir=require(_0x66a2('0x2'));var jsonpatch=require(_0x66a2('0x3'));var rp=require('request-promise');var moment=require(_0x66a2('0x4'));var BPromise=require(_0x66a2('0x5'));var Mustache=require(_0x66a2('0x6'));var util=require(_0x66a2('0x7'));var path=require(_0x66a2('0x8'));var sox=require(_0x66a2('0x9'));var csv=require('to-csv');var ejs=require(_0x66a2('0xa'));var fs=require('fs');var fs_extra=require(_0x66a2('0xb'));var _=require(_0x66a2('0xc'));var squel=require(_0x66a2('0xd'));var crypto=require(_0x66a2('0xe'));var jsforce=require(_0x66a2('0xf'));var deskjs=require(_0x66a2('0x10'));var toCsv=require(_0x66a2('0x11'));var querystring=require(_0x66a2('0x12'));var Papa=require('papaparse');var Redis=require(_0x66a2('0x13'));var authService=require(_0x66a2('0x14'));var qs=require(_0x66a2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66a2('0x16'));var logger=require(_0x66a2('0x17'))(_0x66a2('0x18'));var utils=require(_0x66a2('0x19'));var config=require(_0x66a2('0x1a'));var licenseUtil=require(_0x66a2('0x1b'));var db=require(_0x66a2('0x1c'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1c456e,_0x37b862){_0x37b862=_0x37b862||0xcc;return function(_0x485f33){if(_0x485f33){return _0x1c456e[_0x66a2('0x1d')](_0x37b862);}return _0x1c456e[_0x66a2('0x1e')](_0x37b862)['end']();};}function respondWithResult(_0x8ce5f6,_0x4cabb0){_0x4cabb0=_0x4cabb0||0xc8;return function(_0x5c36b9){if(_0x5c36b9){return _0x8ce5f6['status'](_0x4cabb0)[_0x66a2('0x1f')](_0x5c36b9);}};}function respondWithFilteredResult(_0x29e692,_0xb5e0f){return function(_0x56a792){if(_0x56a792){var _0x5e3623=typeof _0xb5e0f[_0x66a2('0x20')]===_0x66a2('0x21')&&typeof _0xb5e0f['limit']===_0x66a2('0x21');var _0x3258e5=_0x56a792[_0x66a2('0x22')];var _0x4f30a0=_0x5e3623?0x0:_0xb5e0f['offset'];var _0x1ab6ce=_0x5e3623?_0x56a792['count']:_0xb5e0f[_0x66a2('0x20')]+_0xb5e0f['limit'];var _0x5508c7;if(_0x1ab6ce>=_0x3258e5){_0x1ab6ce=_0x3258e5;_0x5508c7=0xc8;}else{_0x5508c7=0xce;}_0x29e692['status'](_0x5508c7);return _0x29e692[_0x66a2('0x23')]('Content-Range',_0x4f30a0+'-'+_0x1ab6ce+'/'+_0x3258e5)['json'](_0x56a792);}return null;};}function patchUpdates(_0x4eac4c){return function(_0x9b1f92){try{jsonpatch['apply'](_0x9b1f92,_0x4eac4c,!![]);}catch(_0x5225ed){return BPromise[_0x66a2('0x24')](_0x5225ed);}return _0x9b1f92['save']();};}function saveUpdates(_0xe3364b,_0x4f38ae){return function(_0xe449dc){if(_0xe449dc){return _0xe449dc['update'](_0xe3364b)['then'](function(_0x1dc68b){return _0x1dc68b;});}return null;};}function removeEntity(_0x4bdcfc,_0x3ab43c){return function(_0x50c375){if(_0x50c375){return _0x50c375[_0x66a2('0x25')]()[_0x66a2('0x26')](function(){var _0x560aba=_0x50c375['get']({'plain':!![]});var _0x13c874=_0x66a2('0x27');return db[_0x66a2('0x28')][_0x66a2('0x25')]({'where':{'type':_0x13c874,'resourceId':_0x560aba['id']}})[_0x66a2('0x26')](function(){return _0x50c375;});})[_0x66a2('0x26')](function(){_0x4bdcfc['status'](0xcc)[_0x66a2('0x29')]();});}};}function handleEntityNotFound(_0x15f622,_0x2929ae){return function(_0x233dfb){if(!_0x233dfb){_0x15f622[_0x66a2('0x1d')](0x194);}return _0x233dfb;};}function handleError(_0x4b291d,_0x5ccb86){_0x5ccb86=_0x5ccb86||0x1f4;return function(_0x5801ca){logger[_0x66a2('0x2a')](_0x5801ca[_0x66a2('0x2b')]);if(_0x5801ca[_0x66a2('0x2c')]){delete _0x5801ca[_0x66a2('0x2c')];}_0x4b291d[_0x66a2('0x1e')](_0x5ccb86)[_0x66a2('0x2d')](_0x5801ca);};}exports[_0x66a2('0x2e')]=function(_0x1eec38,_0x1683fa){var _0x5f46f3={},_0x44001a={},_0x3b4fbc={'count':0x0,'rows':[]};var _0x39d3ff=_['map'](db['Interval'][_0x66a2('0x2f')],function(_0x142a46){return{'name':_0x142a46[_0x66a2('0x30')],'type':_0x142a46[_0x66a2('0x31')][_0x66a2('0x32')]};});_0x44001a[_0x66a2('0x33')]=_['map'](_0x39d3ff,'name');_0x44001a[_0x66a2('0x34')]=_[_0x66a2('0x35')](_0x1eec38[_0x66a2('0x34')]);_0x44001a['filters']=_[_0x66a2('0x36')](_0x44001a[_0x66a2('0x33')],_0x44001a[_0x66a2('0x34')]);_0x5f46f3[_0x66a2('0x37')]=_[_0x66a2('0x36')](_0x44001a['model'],qs[_0x66a2('0x38')](_0x1eec38[_0x66a2('0x34')]['fields']));_0x5f46f3[_0x66a2('0x37')]=_0x5f46f3['attributes'][_0x66a2('0x39')]?_0x5f46f3[_0x66a2('0x37')]:_0x44001a[_0x66a2('0x33')];if(!_0x1eec38[_0x66a2('0x34')]['hasOwnProperty'](_0x66a2('0x3a'))){_0x5f46f3[_0x66a2('0x3b')]=qs[_0x66a2('0x3b')](_0x1eec38['query'][_0x66a2('0x3b')]);_0x5f46f3[_0x66a2('0x20')]=qs['offset'](_0x1eec38[_0x66a2('0x34')][_0x66a2('0x20')]);}_0x5f46f3[_0x66a2('0x3c')]=qs['sort'](_0x1eec38[_0x66a2('0x34')][_0x66a2('0x3d')]);_0x5f46f3[_0x66a2('0x3e')]=qs['filters'](_[_0x66a2('0x3f')](_0x1eec38['query'],_0x44001a['filters']),_0x39d3ff);if(_0x1eec38[_0x66a2('0x34')][_0x66a2('0x40')]){_0x5f46f3['where']=_[_0x66a2('0x41')](_0x5f46f3[_0x66a2('0x3e')],{'$or':_[_0x66a2('0x42')](_0x39d3ff,function(_0x10a8c6){if(_0x10a8c6[_0x66a2('0x31')]!==_0x66a2('0x43')){var _0x12536b={};_0x12536b[_0x10a8c6[_0x66a2('0x2c')]]={'$like':'%'+_0x1eec38[_0x66a2('0x34')][_0x66a2('0x40')]+'%'};return _0x12536b;}})});}_0x5f46f3=_[_0x66a2('0x41')]({},_0x5f46f3,_0x1eec38[_0x66a2('0x44')]);var _0x11629d={'where':_0x5f46f3['where']};return db['Interval'][_0x66a2('0x22')](_0x11629d)['then'](function(_0x8e0d2f){_0x3b4fbc[_0x66a2('0x22')]=_0x8e0d2f;if(_0x1eec38['query'][_0x66a2('0x45')]){_0x5f46f3[_0x66a2('0x46')]=[{'all':!![]}];}return db[_0x66a2('0x47')][_0x66a2('0x48')](_0x5f46f3);})[_0x66a2('0x26')](function(_0x109906){_0x3b4fbc['rows']=_0x109906;return _0x3b4fbc;})[_0x66a2('0x26')](respondWithFilteredResult(_0x1683fa,_0x5f46f3))[_0x66a2('0x49')](handleError(_0x1683fa,null));};exports['show']=function(_0x48d18e,_0xa9c384){var _0x2550a6={'raw':!![],'where':{'id':_0x48d18e[_0x66a2('0x4a')]['id']}},_0x1cb70a={};_0x1cb70a[_0x66a2('0x33')]=_[_0x66a2('0x35')](db[_0x66a2('0x47')][_0x66a2('0x2f')]);_0x1cb70a[_0x66a2('0x34')]=_[_0x66a2('0x35')](_0x48d18e['query']);_0x1cb70a[_0x66a2('0x4b')]=_['intersection'](_0x1cb70a[_0x66a2('0x33')],_0x1cb70a[_0x66a2('0x34')]);_0x2550a6['attributes']=_[_0x66a2('0x36')](_0x1cb70a[_0x66a2('0x33')],qs[_0x66a2('0x38')](_0x48d18e[_0x66a2('0x34')][_0x66a2('0x38')]));_0x2550a6['attributes']=_0x2550a6[_0x66a2('0x37')][_0x66a2('0x39')]?_0x2550a6[_0x66a2('0x37')]:_0x1cb70a[_0x66a2('0x33')];if(_0x48d18e[_0x66a2('0x34')][_0x66a2('0x45')]){_0x2550a6[_0x66a2('0x46')]=[{'all':!![]}];}_0x2550a6=_['merge']({},_0x2550a6,_0x48d18e[_0x66a2('0x44')]);return db[_0x66a2('0x47')][_0x66a2('0x4c')](_0x2550a6)['then'](handleEntityNotFound(_0xa9c384,null))[_0x66a2('0x26')](respondWithResult(_0xa9c384,null))[_0x66a2('0x49')](handleError(_0xa9c384,null));};exports[_0x66a2('0x4d')]=function(_0x322074,_0x2b7c90){return db[_0x66a2('0x47')]['create'](_0x322074[_0x66a2('0x4e')],{})[_0x66a2('0x26')](function(_0x3aced8){var _0x346a9a=_0x322074[_0x66a2('0x4f')]['get']({'plain':!![]});if(!_0x346a9a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x346a9a[_0x66a2('0x50')]==='user'){var _0x1558ee=_0x3aced8[_0x66a2('0x51')]({'plain':!![]});var _0x2123c5=_0x66a2('0x27');return db[_0x66a2('0x52')][_0x66a2('0x4c')]({'where':{'name':_0x2123c5,'userProfileId':_0x346a9a[_0x66a2('0x53')]},'raw':!![]})[_0x66a2('0x26')](function(_0x3ce6bd){if(_0x3ce6bd&&_0x3ce6bd['autoAssociation']===0x0){return db[_0x66a2('0x28')]['create']({'name':_0x1558ee[_0x66a2('0x2c')],'resourceId':_0x1558ee['id'],'type':_0x3ce6bd['name'],'sectionId':_0x3ce6bd['id']},{})[_0x66a2('0x26')](function(){return _0x3aced8;});}else{return _0x3aced8;}})[_0x66a2('0x49')](function(_0x48bc58){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48bc58);throw _0x48bc58;});}return _0x3aced8;})[_0x66a2('0x26')](respondWithResult(_0x2b7c90,0xc9))['catch'](handleError(_0x2b7c90,null));};exports[_0x66a2('0x54')]=function(_0x1af5fb,_0x3ff86e){if(_0x1af5fb[_0x66a2('0x4e')]['id']){delete _0x1af5fb[_0x66a2('0x4e')]['id'];}return db[_0x66a2('0x47')]['find']({'where':{'id':_0x1af5fb[_0x66a2('0x4a')]['id']}})[_0x66a2('0x26')](handleEntityNotFound(_0x3ff86e,null))[_0x66a2('0x26')](saveUpdates(_0x1af5fb[_0x66a2('0x4e')],null))['then'](respondWithResult(_0x3ff86e,null))[_0x66a2('0x49')](handleError(_0x3ff86e,null));};exports[_0x66a2('0x25')]=function(_0x2b01e1,_0x563d49){return db['Interval'][_0x66a2('0x4c')]({'where':{'id':_0x2b01e1[_0x66a2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x563d49,null))['then'](removeEntity(_0x563d49,null))[_0x66a2('0x49')](handleError(_0x563d49,null));};exports['addInterval']=function(_0x496002,_0x4b5898,_0x1003e0){if(_0x496002[_0x66a2('0x4e')]['id']){delete _0x496002[_0x66a2('0x4e')]['id'];}return db[_0x66a2('0x47')][_0x66a2('0x4c')]({'where':{'id':_0x496002[_0x66a2('0x4a')]['id']}})[_0x66a2('0x26')](handleEntityNotFound(_0x4b5898,null))[_0x66a2('0x26')](function(_0x56cd18){if(_0x56cd18){_0x496002[_0x66a2('0x4e')][_0x66a2('0x55')]=_0x56cd18['id'];return db[_0x66a2('0x47')]['create'](_0x496002[_0x66a2('0x4e')]);}})[_0x66a2('0x26')](respondWithResult(_0x4b5898,null))['catch'](handleError(_0x4b5898,null));};exports[_0x66a2('0x56')]=function(_0xe152d9,_0x166739,_0x130e6d){var _0x1be322={};var _0x4c54ac={};var _0x9f56bf;var _0x3caedd;return db[_0x66a2('0x47')][_0x66a2('0x57')]({'where':{'id':_0xe152d9[_0x66a2('0x4a')]['id']}})[_0x66a2('0x26')](handleEntityNotFound(_0x166739,null))['then'](function(_0x10a93d){if(_0x10a93d){_0x9f56bf=_0x10a93d;_0x4c54ac['model']=_['keys'](db[_0x66a2('0x47')][_0x66a2('0x2f')]);_0x4c54ac[_0x66a2('0x34')]=_['keys'](_0xe152d9['query']);_0x4c54ac[_0x66a2('0x4b')]=_[_0x66a2('0x36')](_0x4c54ac[_0x66a2('0x33')],_0x4c54ac[_0x66a2('0x34')]);_0x1be322[_0x66a2('0x37')]=_[_0x66a2('0x36')](_0x4c54ac['model'],qs[_0x66a2('0x38')](_0xe152d9[_0x66a2('0x34')]['fields']));_0x1be322[_0x66a2('0x37')]=_0x1be322[_0x66a2('0x37')]['length']?_0x1be322[_0x66a2('0x37')]:_0x4c54ac[_0x66a2('0x33')];_0x1be322['order']=qs[_0x66a2('0x3d')](_0xe152d9[_0x66a2('0x34')][_0x66a2('0x3d')]);_0x1be322['where']=qs[_0x66a2('0x4b')](_['pick'](_0xe152d9[_0x66a2('0x34')],_0x4c54ac[_0x66a2('0x4b')]));if(_0xe152d9['query'][_0x66a2('0x40')]){_0x1be322[_0x66a2('0x3e')]=_['merge'](_0x1be322[_0x66a2('0x3e')],{'$or':_['map'](_0x1be322[_0x66a2('0x37')],function(_0x2d65dd){var _0x2b4358={};_0x2b4358[_0x2d65dd]={'$like':'%'+_0xe152d9[_0x66a2('0x34')]['filter']+'%'};return _0x2b4358;})});}_0x1be322=_['merge']({},_0x1be322,_0xe152d9[_0x66a2('0x44')]);return _0x9f56bf['getIntervals'](_0x1be322);}})[_0x66a2('0x26')](function(_0x18d2ed){if(_0x18d2ed){_0x3caedd=_0x18d2ed[_0x66a2('0x39')];if(!_0xe152d9[_0x66a2('0x34')][_0x66a2('0x58')](_0x66a2('0x3a'))){_0x1be322[_0x66a2('0x3b')]=qs[_0x66a2('0x3b')](_0xe152d9['query'][_0x66a2('0x3b')]);_0x1be322[_0x66a2('0x20')]=qs[_0x66a2('0x20')](_0xe152d9['query'][_0x66a2('0x20')]);}return _0x9f56bf[_0x66a2('0x56')](_0x1be322);}})[_0x66a2('0x26')](function(_0x1a677d){if(_0x1a677d){return _0x1a677d?{'count':_0x3caedd,'rows':_0x1a677d}:null;}})['then'](respondWithResult(_0x166739,null))['catch'](handleError(_0x166739,null));};exports[_0x66a2('0x59')]=function(_0x400116,_0xfe8101,_0x505983){return db[_0x66a2('0x47')][_0x66a2('0x57')]({'where':{'id':_0x400116[_0x66a2('0x4a')]['id']}})[_0x66a2('0x26')](handleEntityNotFound(_0xfe8101,null))['then'](function(_0x1d2489){if(_0x1d2489){return db['sequelize'][_0x66a2('0x5a')](function(_0x4f4e07){return db[_0x66a2('0x47')][_0x66a2('0x25')]({'where':{'IntervalId':_0x400116[_0x66a2('0x4a')]['id']},'transaction':_0x4f4e07})[_0x66a2('0x26')](function(_0x30f8bd){var _0x165336=_[_0x66a2('0x42')](_0x400116[_0x66a2('0x4e')],function(_0x209ecf){delete _0x209ecf['id'];_0x209ecf[_0x66a2('0x55')]=_0x400116[_0x66a2('0x4a')]['id'];return _0x209ecf;});return db[_0x66a2('0x47')][_0x66a2('0x5b')](_0x165336,{'transaction':_0x4f4e07});});})[_0x66a2('0x26')](function(){return db[_0x66a2('0x47')]['findAll']({'where':{'IntervalId':_0x400116[_0x66a2('0x4a')]['id']}});});}})[_0x66a2('0x26')](respondWithResult(_0xfe8101,null))[_0x66a2('0x49')](handleError(_0xfe8101,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 830851c..de4b9ee 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 _0x81ec=['getIntervals','all','map','then','./interval.attributes','../../components/extensions/rewrite','iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x5de3b8,_0x4ad2a5){var _0x581e7f=function(_0x3a90c7){while(--_0x3a90c7){_0x5de3b8['push'](_0x5de3b8['shift']());}};_0x581e7f(++_0x4ad2a5);}(_0x81ec,0xba));var _0xc81e=function(_0x3d90f1,_0xf25e08){_0x3d90f1=_0x3d90f1-0x0;var _0x3af913=_0x81ec[_0x3d90f1];return _0x3af913;};'use strict';var attributes=require(_0xc81e('0x0'));var extensions=require(_0xc81e('0x1'));var iftime=require('../../utils/iftime')[_0xc81e('0x2')];module[_0xc81e('0x3')]=function(_0x16b238){return _0x16b238[_0xc81e('0x4')](_0xc81e('0x5'),attributes,{'tableName':_0xc81e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56ca1b){extensions['rewrite'](_0x16b238,_0x56ca1b);},'afterBulkCreate':function(_0x5d7cbf,_0x320f46,_0x45309b){_0x45309b();extensions[_0xc81e('0x7')](_0x16b238,_0x5d7cbf[0x0]);},'afterUpdate':function(_0x4947a3){extensions['rewrite'](_0x16b238,_0x4947a3);},'afterDestroy':function(_0x3e19f0){extensions['rewrite'](_0x16b238,_0x3e19f0);}},'instanceMethods':{'ifTime':function(_0x34c6fa=undefined,_0x432116=new Date()){if(typeof this[_0xc81e('0x8')]===_0xc81e('0x9')){return iftime(this[_0xc81e('0x8')],_0x34c6fa,_0x432116);}else{return this[_0xc81e('0xa')]()['then'](function(_0x17e1cb){return Promise[_0xc81e('0xb')](_0x17e1cb[_0xc81e('0xc')](function(_0x599393){return _0x599393['ifTime'](_0x34c6fa,_0x432116);}));})[_0xc81e('0xd')](function(_0x3cc21e){return _0x3cc21e['reduce'](function(_0x58bda6,_0x2b1465){return _0x58bda6||_0x2b1465;},![]);});}}}});}; \ No newline at end of file +var _0x1321=['string','interval','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','Interval','tools_intervals','rewrite'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x1321,0x157));var _0x1132=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1321[_0x1035c1];return _0x308d67;};'use strict';var attributes=require(_0x1132('0x0'));var extensions=require(_0x1132('0x1'));var iftime=require(_0x1132('0x2'))['iftime'];module[_0x1132('0x3')]=function(_0x3f33b0){return _0x3f33b0['define'](_0x1132('0x4'),attributes,{'tableName':_0x1132('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35db82){extensions['rewrite'](_0x3f33b0,_0x35db82);},'afterBulkCreate':function(_0x599893,_0x4280fd,_0x2874c1){_0x2874c1();extensions[_0x1132('0x6')](_0x3f33b0,_0x599893[0x0]);},'afterUpdate':function(_0x531247){extensions[_0x1132('0x6')](_0x3f33b0,_0x531247);},'afterDestroy':function(_0x5f3811){extensions[_0x1132('0x6')](_0x3f33b0,_0x5f3811);}},'instanceMethods':{'ifTime':function(_0x1ec7da=undefined,_0x6c20bc=new Date()){if(typeof this['interval']===_0x1132('0x7')){return iftime(this[_0x1132('0x8')],_0x1ec7da,_0x6c20bc);}else{return this['getIntervals']()[_0x1132('0x9')](function(_0x417c02){return Promise[_0x1132('0xa')](_0x417c02[_0x1132('0xb')](function(_0x3dddd9){return _0x3dddd9[_0x1132('0xc')](_0x1ec7da,_0x6c20bc);}));})[_0x1132('0x9')](function(_0xab6aba){return _0xab6aba[_0x1132('0xd')](function(_0x3f23d5,_0x15bad8){return _0x3f23d5||_0x15bad8;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index eb355bb..0e52770 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 _0x7142=['findAll','options','where','attributes','include','map','model','then','GetInterval','stringify','catch','error','message','ShowInterval','find','raw','info','debug','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','reduce','../../mysqldb','../../utils/iftime','iftime','../../config/logger','Interval'];(function(_0x25bbd6,_0x18f6d3){var _0x3a4c78=function(_0x277579){while(--_0x277579){_0x25bbd6['push'](_0x25bbd6['shift']());}};_0x3a4c78(++_0x18f6d3);}(_0x7142,0x14b));var _0x2714=function(_0x55d768,_0xb506c0){_0x55d768=_0x55d768-0x0;var _0x5522c5=_0x7142[_0x55d768];return _0x5522c5;};'use strict';var _=require('lodash');var util=require('util');var db=require(_0x2714('0x0'))['db'];var iftime=require(_0x2714('0x1'))[_0x2714('0x2')];var logger=require(_0x2714('0x3'))('rpc');exports['GetInterval']=function(_0x42da95){var _0x428150=this;return new Promise(function(_0x28efe2,_0x13ab33){return db[_0x2714('0x4')][_0x2714('0x5')]({'raw':_0x42da95[_0x2714('0x6')]?_0x42da95[_0x2714('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x42da95['options']?_0x42da95[_0x2714('0x6')][_0x2714('0x7')]||null:null,'attributes':_0x42da95[_0x2714('0x6')]?_0x42da95['options'][_0x2714('0x8')]||null:null,'limit':_0x42da95[_0x2714('0x6')]?_0x42da95[_0x2714('0x6')]['limit']||null:null,'include':_0x42da95[_0x2714('0x6')]?_0x42da95[_0x2714('0x6')][_0x2714('0x9')]?_[_0x2714('0xa')](_0x42da95[_0x2714('0x6')]['include'],function(_0x9980fa){return{'model':db[_0x9980fa[_0x2714('0xb')]],'as':_0x9980fa['as'],'attributes':_0x9980fa[_0x2714('0x8')],'include':_0x9980fa[_0x2714('0x9')]?_[_0x2714('0xa')](_0x9980fa[_0x2714('0x9')],function(_0x3ec367){return{'model':db[_0x3ec367[_0x2714('0xb')]],'as':_0x3ec367['as'],'attributes':_0x3ec367[_0x2714('0x8')],'include':_0x3ec367[_0x2714('0x9')]?_['map'](_0x3ec367[_0x2714('0x9')],function(_0xa127e9){return{'model':db[_0xa127e9['model']],'as':_0xa127e9['as'],'attributes':_0xa127e9[_0x2714('0x8')]};}):[]};}):[]};}):[]:[]})[_0x2714('0xc')](function(_0x4c2aa0){logger['info'](_0x2714('0xd'),_0x42da95);logger['debug'](_0x2714('0xd'),_0x42da95,JSON[_0x2714('0xe')](_0x4c2aa0));_0x28efe2(_0x4c2aa0);})[_0x2714('0xf')](function(_0x5b68db){logger[_0x2714('0x10')]('GetInterval',_0x5b68db[_0x2714('0x11')],_0x42da95);_0x13ab33(_0x428150['error'](0x1f4,_0x5b68db[_0x2714('0x11')]));});});};exports[_0x2714('0x12')]=function(_0x24041b){var _0x59fc69=this;return new Promise(function(_0x54c942,_0xbc5ed1){return db[_0x2714('0x4')][_0x2714('0x13')]({'raw':_0x24041b[_0x2714('0x6')]?_0x24041b[_0x2714('0x6')][_0x2714('0x14')]===undefined?!![]:![]:!![],'where':_0x24041b[_0x2714('0x6')]?_0x24041b[_0x2714('0x6')]['where']||null:null,'attributes':_0x24041b['options']?_0x24041b['options'][_0x2714('0x8')]||null:null,'include':_0x24041b[_0x2714('0x6')]?_0x24041b['options']['include']?_['map'](_0x24041b[_0x2714('0x6')][_0x2714('0x9')],function(_0x3ab4c8){return{'model':db[_0x3ab4c8[_0x2714('0xb')]],'as':_0x3ab4c8['as'],'attributes':_0x3ab4c8[_0x2714('0x8')],'include':_0x3ab4c8[_0x2714('0x9')]?_[_0x2714('0xa')](_0x3ab4c8[_0x2714('0x9')],function(_0x545908){return{'model':db[_0x545908[_0x2714('0xb')]],'as':_0x545908['as'],'attributes':_0x545908[_0x2714('0x8')],'include':_0x545908[_0x2714('0x9')]?_['map'](_0x545908[_0x2714('0x9')],function(_0x400f7c){return{'model':db[_0x400f7c['model']],'as':_0x400f7c['as'],'attributes':_0x400f7c[_0x2714('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e4cee){logger[_0x2714('0x15')](_0x2714('0x12'),_0x24041b);logger[_0x2714('0x16')](_0x2714('0x12'),_0x24041b,JSON[_0x2714('0xe')](_0x5e4cee));_0x54c942(_0x5e4cee);})[_0x2714('0xf')](function(_0x1bca2f){logger['error']('ShowInterval',_0x1bca2f[_0x2714('0x11')],_0x24041b);_0xbc5ed1(_0x59fc69[_0x2714('0x10')](0x1f4,_0x1bca2f['message']));});});};function checkArrayOfIntervals(_0x2315a7,_0x5c9b13){var _0x48c146=[];return db[_0x2714('0x4')][_0x2714('0x5')]({'where':{'id':_0x2315a7}})['then'](function(_0x14e7cb){_0x48c146=_0x14e7cb;return Promise[_0x2714('0x17')](_0x48c146['map'](function(_0x4756f8){return _0x4756f8[_0x2714('0x18')](_0x5c9b13);}));})[_0x2714('0xc')](function(_0x4347c5){var _0x30beff=_0x4347c5['reduce'](function(_0x52353e,_0x26610f){return _0x52353e||_0x26610f;},![]);logger[_0x2714('0x15')](util[_0x2714('0x19')](_0x2714('0x1a'),_0x48c146[_0x2714('0xa')](function(_0x1fb579){return _0x1fb579[_0x2714('0x1b')];})[_0x2714('0x1c')](',\x20'),_0x48c146[_0x2714('0xa')](function(_0x1c9956){return _0x1c9956['id'];})[_0x2714('0x1c')](',\x20')));return _0x30beff;});}function checkSingleInterval(_0x45706d,_0x5c863b){return db[_0x2714('0x4')][_0x2714('0x1d')](_0x45706d)['then'](function(_0x561f07){if(_0x561f07){logger[_0x2714('0x15')](util['format'](_0x2714('0x1e'),_0x561f07[_0x2714('0x1b')],_0x561f07['id']));return _0x561f07[_0x2714('0x18')](_0x5c863b);}});}exports[_0x2714('0x1f')]=function(_0x3f483e){var _0x4e5771=_0x3f483e[_0x2714('0x20')];var _0x585ce5=Array[_0x2714('0x21')](_0x3f483e['intervals'])?_0x3f483e[_0x2714('0x22')]:typeof _0x3f483e[_0x2714('0x22')]===_0x2714('0x23')?[_0x3f483e[_0x2714('0x22')]]:[];var _0x32cbd7=_0x3f483e[_0x2714('0x24')]||undefined;var _0x191784=![];if(_0x585ce5['length']){logger[_0x2714('0x15')](util[_0x2714('0x19')](_0x2714('0x25'),_0x585ce5['join'](';\x20')));}if(_0x32cbd7){logger['info'](util[_0x2714('0x19')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x32cbd7));}logger['debug'](_0x2714('0x26'),_0x191784);logger[_0x2714('0x27')](_0x2714('0x1f'),_0x3f483e);return Promise[_0x2714('0x28')]()['then'](function(){if(Array[_0x2714('0x21')](_0x4e5771)){return checkArrayOfIntervals(_0x4e5771,_0x32cbd7);}else if(_0x4e5771){return checkSingleInterval(_0x4e5771,_0x32cbd7);}})[_0x2714('0xc')](function(_0x319fa2){var _0x454631=_0x585ce5[_0x2714('0x29')](function(_0x35f4e9,_0x41c1fd){return _0x35f4e9||iftime(_0x41c1fd,_0x32cbd7);},![]);_0x191784=_0x319fa2||_0x454631;return _0x191784;})['catch'](function(_0x404d97){logger[_0x2714('0x10')](_0x2714('0x1f'),_0x3f483e,_0x404d97);throw this[_0x2714('0x10')](0x1f4,_0x404d97[_0x2714('0x11')]);});}; \ No newline at end of file +var _0x6167=['../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','attributes','limit','include','map','model','then','info','stringify','catch','message','error','ShowInterval','find','where','debug','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime','intervalIds','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6167,0x106));var _0x7616=function(_0x1d8131,_0x1c641d){_0x1d8131=_0x1d8131-0x0;var _0x20604b=_0x6167[_0x1d8131];return _0x20604b;};'use strict';var _=require(_0x7616('0x0'));var util=require(_0x7616('0x1'));var db=require(_0x7616('0x2'))['db'];var iftime=require(_0x7616('0x3'))[_0x7616('0x4')];var logger=require(_0x7616('0x5'))(_0x7616('0x6'));exports[_0x7616('0x7')]=function(_0x953af1){var _0x16e2ef=this;return new Promise(function(_0x397b1a,_0x552fe8){return db[_0x7616('0x8')][_0x7616('0x9')]({'raw':_0x953af1[_0x7616('0xa')]?_0x953af1[_0x7616('0xa')][_0x7616('0xb')]===undefined?!![]:![]:!![],'where':_0x953af1[_0x7616('0xa')]?_0x953af1[_0x7616('0xa')]['where']||null:null,'attributes':_0x953af1[_0x7616('0xa')]?_0x953af1[_0x7616('0xa')][_0x7616('0xc')]||null:null,'limit':_0x953af1[_0x7616('0xa')]?_0x953af1[_0x7616('0xa')][_0x7616('0xd')]||null:null,'include':_0x953af1[_0x7616('0xa')]?_0x953af1[_0x7616('0xa')][_0x7616('0xe')]?_[_0x7616('0xf')](_0x953af1[_0x7616('0xa')][_0x7616('0xe')],function(_0x2b29aa){return{'model':db[_0x2b29aa[_0x7616('0x10')]],'as':_0x2b29aa['as'],'attributes':_0x2b29aa[_0x7616('0xc')],'include':_0x2b29aa[_0x7616('0xe')]?_['map'](_0x2b29aa[_0x7616('0xe')],function(_0x40da24){return{'model':db[_0x40da24[_0x7616('0x10')]],'as':_0x40da24['as'],'attributes':_0x40da24[_0x7616('0xc')],'include':_0x40da24['include']?_[_0x7616('0xf')](_0x40da24[_0x7616('0xe')],function(_0x14fd92){return{'model':db[_0x14fd92[_0x7616('0x10')]],'as':_0x14fd92['as'],'attributes':_0x14fd92[_0x7616('0xc')]};}):[]};}):[]};}):[]:[]})[_0x7616('0x11')](function(_0x419a3a){logger[_0x7616('0x12')](_0x7616('0x7'),_0x953af1);logger['debug'](_0x7616('0x7'),_0x953af1,JSON[_0x7616('0x13')](_0x419a3a));_0x397b1a(_0x419a3a);})[_0x7616('0x14')](function(_0x244be4){logger['error']('GetInterval',_0x244be4[_0x7616('0x15')],_0x953af1);_0x552fe8(_0x16e2ef[_0x7616('0x16')](0x1f4,_0x244be4[_0x7616('0x15')]));});});};exports[_0x7616('0x17')]=function(_0xec269b){var _0x150b64=this;return new Promise(function(_0xbbef05,_0x2081fb){return db[_0x7616('0x8')][_0x7616('0x18')]({'raw':_0xec269b[_0x7616('0xa')]?_0xec269b['options'][_0x7616('0xb')]===undefined?!![]:![]:!![],'where':_0xec269b[_0x7616('0xa')]?_0xec269b[_0x7616('0xa')][_0x7616('0x19')]||null:null,'attributes':_0xec269b[_0x7616('0xa')]?_0xec269b['options'][_0x7616('0xc')]||null:null,'include':_0xec269b['options']?_0xec269b[_0x7616('0xa')]['include']?_[_0x7616('0xf')](_0xec269b[_0x7616('0xa')][_0x7616('0xe')],function(_0x4f32f1){return{'model':db[_0x4f32f1[_0x7616('0x10')]],'as':_0x4f32f1['as'],'attributes':_0x4f32f1['attributes'],'include':_0x4f32f1[_0x7616('0xe')]?_[_0x7616('0xf')](_0x4f32f1[_0x7616('0xe')],function(_0x2fb195){return{'model':db[_0x2fb195[_0x7616('0x10')]],'as':_0x2fb195['as'],'attributes':_0x2fb195[_0x7616('0xc')],'include':_0x2fb195[_0x7616('0xe')]?_[_0x7616('0xf')](_0x2fb195[_0x7616('0xe')],function(_0x4a5ba4){return{'model':db[_0x4a5ba4['model']],'as':_0x4a5ba4['as'],'attributes':_0x4a5ba4[_0x7616('0xc')]};}):[]};}):[]};}):[]:[]})[_0x7616('0x11')](function(_0x207c8e){logger[_0x7616('0x12')]('ShowInterval',_0xec269b);logger[_0x7616('0x1a')](_0x7616('0x17'),_0xec269b,JSON[_0x7616('0x13')](_0x207c8e));_0xbbef05(_0x207c8e);})[_0x7616('0x14')](function(_0x529899){logger['error'](_0x7616('0x17'),_0x529899[_0x7616('0x15')],_0xec269b);_0x2081fb(_0x150b64[_0x7616('0x16')](0x1f4,_0x529899[_0x7616('0x15')]));});});};function checkArrayOfIntervals(_0x5359bf,_0x95155c){var _0x296aaa=[];return db[_0x7616('0x8')][_0x7616('0x9')]({'where':{'id':_0x5359bf}})[_0x7616('0x11')](function(_0x5d0418){_0x296aaa=_0x5d0418;return Promise[_0x7616('0x1b')](_0x296aaa[_0x7616('0xf')](function(_0x115e69){return _0x115e69['ifTime'](_0x95155c);}));})['then'](function(_0x44a9d9){var _0x38e79e=_0x44a9d9[_0x7616('0x1c')](function(_0x5a5ee6,_0x18bd19){return _0x5a5ee6||_0x18bd19;},![]);logger['info'](util[_0x7616('0x1d')](_0x7616('0x1e'),_0x296aaa[_0x7616('0xf')](function(_0x403dee){return _0x403dee[_0x7616('0x1f')];})[_0x7616('0x20')](',\x20'),_0x296aaa[_0x7616('0xf')](function(_0x1f50e6){return _0x1f50e6['id'];})[_0x7616('0x20')](',\x20')));return _0x38e79e;});}function checkSingleInterval(_0x565e2d,_0x5d7208){return db['Interval'][_0x7616('0x21')](_0x565e2d)[_0x7616('0x11')](function(_0x4455cd){if(_0x4455cd){logger[_0x7616('0x12')](util[_0x7616('0x1d')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x4455cd[_0x7616('0x1f')],_0x4455cd['id']));return _0x4455cd['ifTime'](_0x5d7208);}});}exports[_0x7616('0x22')]=function(_0x5b186c){var _0x37a65d=_0x5b186c[_0x7616('0x23')];var _0xaa8ec3=Array['isArray'](_0x5b186c[_0x7616('0x24')])?_0x5b186c[_0x7616('0x24')]:typeof _0x5b186c[_0x7616('0x24')]===_0x7616('0x25')?[_0x5b186c[_0x7616('0x24')]]:[];var _0x5e30af=_0x5b186c['timezone']||undefined;var _0x27f24a=![];if(_0xaa8ec3[_0x7616('0x26')]){logger[_0x7616('0x12')](util[_0x7616('0x1d')](_0x7616('0x27'),_0xaa8ec3['join'](';\x20')));}if(_0x5e30af){logger[_0x7616('0x12')](util[_0x7616('0x1d')](_0x7616('0x28'),_0x5e30af));}logger[_0x7616('0x1a')](_0x7616('0x29'),_0x27f24a);logger[_0x7616('0x2a')](_0x7616('0x22'),_0x5b186c);return Promise[_0x7616('0x2b')]()[_0x7616('0x11')](function(){if(Array['isArray'](_0x37a65d)){return checkArrayOfIntervals(_0x37a65d,_0x5e30af);}else if(_0x37a65d){return checkSingleInterval(_0x37a65d,_0x5e30af);}})['then'](function(_0x1da950){var _0x5b8b06=_0xaa8ec3[_0x7616('0x1c')](function(_0x37965f,_0x929ef9){return _0x37965f||iftime(_0x929ef9,_0x5e30af);},![]);_0x27f24a=_0x1da950||_0x5b8b06;return _0x27f24a;})[_0x7616('0x14')](function(_0xfe3757){logger[_0x7616('0x16')](_0x7616('0x22'),_0x5b186c,_0xfe3757);throw this['error'](0x1f4,_0xfe3757[_0x7616('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d0063d3..08b3a3a 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x15e61d,_0x2e7788){var _0x28c224=function(_0x2a84df){while(--_0x2a84df){_0x15e61d['push'](_0x15e61d['shift']());}};_0x28c224(++_0x2e7788);}(_0xdb28,0x106));var _0x8db2=function(_0x2cc8b0,_0x31eb15){_0x2cc8b0=_0x2cc8b0-0x0;var _0x32b7b1=_0xdb28[_0x2cc8b0];return _0x32b7b1;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x251116,_0x222c1f){var _0x37d879=function(_0x20d344){while(--_0x20d344){_0x251116['push'](_0x251116['shift']());}};_0x37d879(++_0x222c1f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b22e6,_0x3f2337){_0x2b22e6=_0x2b22e6-0x0;var _0x225b25=_0x5f2f[_0x2b22e6];return _0x225b25;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index ff19168..5b77ee6 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 _0x72b8=['/rest/api/2/issue','POST','application/json','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','Report','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com'];(function(_0x1ac82a,_0xb838ba){var _0x399467=function(_0x1871d0){while(--_0x1871d0){_0x1ac82a['push'](_0x1ac82a['shift']());}};_0x399467(++_0xb838ba);}(_0x72b8,0x1f0));var _0x872b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x72b8[_0x53ccf2];return _0x5a2964;};'use strict';var BPromise=require(_0x872b('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x872b('0x1'));var USERNAME=_0x872b('0x2');var PASSWORD=_0x872b('0x3');function openIssue(_0x406f5b,_0x5967f5){var _0x588e34={'fields':{'project':{'key':_0x406f5b[_0x872b('0x4')]||_0x872b('0x5')},'summary':(_0x406f5b['summary']||_0x872b('0x6'))+'\x20from\x20'+_0x406f5b['ip'],'description':_0x406f5b['description']||JSON[_0x872b('0x7')](_0x406f5b),'issuetype':{'name':_0x406f5b[_0x872b('0x8')]||_0x872b('0x9')}}};_0x588e34[_0x872b('0xa')]['customfield_11500']=_0x406f5b[_0x872b('0xb')];_0x588e34['fields'][_0x872b('0xc')]=_0x406f5b[_0x872b('0xd')];_0x588e34[_0x872b('0xa')][_0x872b('0xe')]=_0x406f5b['newToken'];_0x588e34['fields'][_0x872b('0xf')]=_0x406f5b[_0x872b('0x10')];_0x588e34[_0x872b('0xa')][_0x872b('0x11')]=_0x406f5b[_0x872b('0x12')];_0x588e34[_0x872b('0xa')]['customfield_10102']=_0x406f5b['ip'];var _0x505415={'host':_0x872b('0x13'),'port':0x1bb,'path':_0x872b('0x14'),'method':_0x872b('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x872b('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x872b('0x17')](_0x872b('0x18'))}};var _0x5f1029=JSON[_0x872b('0x7')](_0x588e34);var _0x4d8bb2=https['request'](_0x505415,function(_0x108077){_0x108077[_0x872b('0x19')](_0x872b('0x1a'));var _0x305f88='';_0x108077['on'](_0x872b('0x1b'),function(_0x258182){_0x305f88+=_0x258182;});_0x108077['on'](_0x872b('0x1c'),function(){if(_0x5967f5){return _0x5967f5['status'](_0x108077[_0x872b('0x1d')])[_0x872b('0x1e')](JSON[_0x872b('0x1f')](_0x305f88));}});});_0x4d8bb2['on'](_0x872b('0x20'),function(_0x5f31a1){if(_0x5967f5){return _0x5967f5[_0x872b('0x21')](0x1f4)[_0x872b('0x1e')]({'errors':[{'message':_0x872b('0x22'),'type':'api.jira'}]});}});_0x4d8bb2[_0x872b('0x23')](_0x5f1029);_0x4d8bb2[_0x872b('0x1c')]();}exports[_0x872b('0x24')]=openIssue;exports[_0x872b('0x25')]=function(_0x3e7f91,_0x478c60){_0x3e7f91[_0x872b('0x26')]['ip']=_0x3e7f91[_0x872b('0x27')]['x-forwarded-for']||_0x3e7f91[_0x872b('0x28')]['remoteAddress']||_0x3e7f91['socket'][_0x872b('0x29')]||_0x3e7f91[_0x872b('0x28')][_0x872b('0x2a')][_0x872b('0x29')];return openIssue(_0x3e7f91[_0x872b('0x26')],_0x478c60);}; \ No newline at end of file +var _0x0e8c=['setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','MOTGUI','description','stringify','issuetype','Bug','customfield_11500','email','customfield_11501','oldToken','fields','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','toString','base64'];(function(_0x20c31d,_0xefb51d){var _0x37e606=function(_0x54ab8f){while(--_0x54ab8f){_0x20c31d['push'](_0x20c31d['shift']());}};_0x37e606(++_0xefb51d);}(_0x0e8c,0x196));var _0xc0e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e8c[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require(_0xc0e8('0x0'));var https=require(_0xc0e8('0x1'));var logger=require(_0xc0e8('0x2'))('api');var USERNAME='support';var PASSWORD=_0xc0e8('0x3');function openIssue(_0x1f23ec,_0x365639){var _0x2c68ef={'fields':{'project':{'key':_0x1f23ec['key']||_0xc0e8('0x4')},'summary':(_0x1f23ec['summary']||'Report')+'\x20from\x20'+_0x1f23ec['ip'],'description':_0x1f23ec[_0xc0e8('0x5')]||JSON[_0xc0e8('0x6')](_0x1f23ec),'issuetype':{'name':_0x1f23ec[_0xc0e8('0x7')]||_0xc0e8('0x8')}}};_0x2c68ef['fields'][_0xc0e8('0x9')]=_0x1f23ec[_0xc0e8('0xa')];_0x2c68ef['fields'][_0xc0e8('0xb')]=_0x1f23ec[_0xc0e8('0xc')];_0x2c68ef['fields']['customfield_11502']=_0x1f23ec['newToken'];_0x2c68ef[_0xc0e8('0xd')][_0xc0e8('0xe')]=_0x1f23ec[_0xc0e8('0xf')];_0x2c68ef[_0xc0e8('0xd')][_0xc0e8('0x10')]=_0x1f23ec[_0xc0e8('0x11')];_0x2c68ef[_0xc0e8('0xd')]['customfield_10102']=_0x1f23ec['ip'];var _0x4ad238={'host':_0xc0e8('0x12'),'port':0x1bb,'path':_0xc0e8('0x13'),'method':_0xc0e8('0x14'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xc0e8('0x15')](_0xc0e8('0x16'))}};var _0x8933f4=JSON[_0xc0e8('0x6')](_0x2c68ef);var _0x8c67fc=https['request'](_0x4ad238,function(_0xd05091){_0xd05091[_0xc0e8('0x17')](_0xc0e8('0x18'));var _0x419d6f='';_0xd05091['on'](_0xc0e8('0x19'),function(_0x5ef276){_0x419d6f+=_0x5ef276;});_0xd05091['on'](_0xc0e8('0x1a'),function(){if(_0x365639){return _0x365639[_0xc0e8('0x1b')](_0xd05091[_0xc0e8('0x1c')])[_0xc0e8('0x1d')](JSON[_0xc0e8('0x1e')](_0x419d6f));}});});_0x8c67fc['on'](_0xc0e8('0x1f'),function(_0x231acc){if(_0x365639){return _0x365639[_0xc0e8('0x1b')](0x1f4)[_0xc0e8('0x1d')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xc0e8('0x20')}]});}});_0x8c67fc[_0xc0e8('0x21')](_0x8933f4);_0x8c67fc[_0xc0e8('0x1a')]();}exports['openIssue']=openIssue;exports['send']=function(_0x7b513a,_0x3d0a86){_0x7b513a[_0xc0e8('0x22')]['ip']=_0x7b513a['headers'][_0xc0e8('0x23')]||_0x7b513a[_0xc0e8('0x24')][_0xc0e8('0x25')]||_0x7b513a[_0xc0e8('0x26')]['remoteAddress']||_0x7b513a[_0xc0e8('0x24')][_0xc0e8('0x26')][_0xc0e8('0x25')];return openIssue(_0x7b513a['body'],_0x3d0a86);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 331a010..465375a 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 _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x3edc9d,_0x2911aa){var _0x387318=function(_0x319d61){while(--_0x319d61){_0x3edc9d['push'](_0x3edc9d['shift']());}};_0x387318(++_0x2911aa);}(_0xbec5,0xe5));var _0x5bec=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xbec5[_0x35fb56];return _0x2fd52c;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x40bb72,_0x5025ae){var _0x4e6b94=function(_0x526472){while(--_0x526472){_0x40bb72['push'](_0x40bb72['shift']());}};_0x4e6b94(++_0x5025ae);}(_0xe706,0xa3));var _0x6e70=function(_0x28087c,_0x895c0f){_0x28087c=_0x28087c-0x0;var _0x329122=_0xe706[_0x28087c];return _0x329122;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 19e94f0..7b3c82b 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x8d6ef,_0x28c556){_0x8d6ef=_0x8d6ef-0x0;var _0x4b3ffd=_0x7a54[_0x8d6ef];return _0x4b3ffd;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x276fd9,_0x22b5a6){_0x276fd9=_0x276fd9-0x0;var _0x4c838f=_0x7a54[_0x276fd9];return _0x4c838f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 96a0a3b..6f7b569 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 _0xe574=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length'];(function(_0x261562,_0x25d001){var _0x5a5563=function(_0x2e7168){while(--_0x2e7168){_0x261562['push'](_0x261562['shift']());}};_0x5a5563(++_0x25d001);}(_0xe574,0x100));var _0x4e57=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe574[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x4e57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e57('0x1'));var jsonpatch=require(_0x4e57('0x2'));var rp=require(_0x4e57('0x3'));var moment=require(_0x4e57('0x4'));var BPromise=require(_0x4e57('0x5'));var Mustache=require(_0x4e57('0x6'));var util=require(_0x4e57('0x7'));var path=require(_0x4e57('0x8'));var sox=require(_0x4e57('0x9'));var csv=require(_0x4e57('0xa'));var ejs=require(_0x4e57('0xb'));var fs=require('fs');var fs_extra=require(_0x4e57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e57('0xa'));var querystring=require(_0x4e57('0xe'));var Papa=require(_0x4e57('0xf'));var Redis=require(_0x4e57('0x10'));var authService=require(_0x4e57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e57('0x12'));var hardwareService=require(_0x4e57('0x13'));var logger=require(_0x4e57('0x14'))(_0x4e57('0x15'));var utils=require(_0x4e57('0x16'));var config=require(_0x4e57('0x17'));var licenseUtil=require(_0x4e57('0x18'));var db=require(_0x4e57('0x19'))['db'];function respondWithStatusCode(_0xed8cbc,_0x40c8c8){_0x40c8c8=_0x40c8c8||0xcc;return function(_0x330868){if(_0x330868){return _0xed8cbc[_0x4e57('0x1a')](_0x40c8c8);}return _0xed8cbc[_0x4e57('0x1b')](_0x40c8c8)[_0x4e57('0x1c')]();};}function respondWithResult(_0x28f876,_0x2e9fa8){_0x2e9fa8=_0x2e9fa8||0xc8;return function(_0x4f088a){if(_0x4f088a){return _0x28f876[_0x4e57('0x1b')](_0x2e9fa8)['json'](_0x4f088a);}};}function respondWithFilteredResult(_0x254285,_0x4af0a6){return function(_0x3401c4){if(_0x3401c4){var _0x214957=typeof _0x4af0a6['offset']===_0x4e57('0x1d')&&typeof _0x4af0a6[_0x4e57('0x1e')]===_0x4e57('0x1d');var _0xb06d8=_0x3401c4['count'];var _0x2ed980=_0x214957?0x0:_0x4af0a6[_0x4e57('0x1f')];var _0x3c2978=_0x214957?_0x3401c4[_0x4e57('0x20')]:_0x4af0a6[_0x4e57('0x1f')]+_0x4af0a6['limit'];var _0x182286;if(_0x3c2978>=_0xb06d8){_0x3c2978=_0xb06d8;_0x182286=0xc8;}else{_0x182286=0xce;}_0x254285[_0x4e57('0x1b')](_0x182286);return _0x254285[_0x4e57('0x21')](_0x4e57('0x22'),_0x2ed980+'-'+_0x3c2978+'/'+_0xb06d8)['json'](_0x3401c4);}return null;};}function patchUpdates(_0x372295){return function(_0x59df7a){try{jsonpatch[_0x4e57('0x23')](_0x59df7a,_0x372295,!![]);}catch(_0x5b6127){return BPromise[_0x4e57('0x24')](_0x5b6127);}return _0x59df7a[_0x4e57('0x25')]();};}function saveUpdates(_0x427c6b,_0x43c9a7){return function(_0x45f9cd){if(_0x45f9cd){return _0x45f9cd['update'](_0x427c6b)['then'](function(_0x17e309){return _0x17e309;});}return null;};}function removeEntity(_0x58d6ea,_0x315f7c){return function(_0x4cfa0e){if(_0x4cfa0e){return _0x4cfa0e[_0x4e57('0x26')]()[_0x4e57('0x27')](function(){_0x58d6ea[_0x4e57('0x1b')](0xcc)[_0x4e57('0x1c')]();});}};}function handleEntityNotFound(_0x29df93,_0xc75cb3){return function(_0x4fb5db){if(!_0x4fb5db){_0x29df93[_0x4e57('0x1a')](0x194);}return _0x4fb5db;};}function handleError(_0x316988,_0x503eaa){_0x503eaa=_0x503eaa||0x1f4;return function(_0x36b415){logger[_0x4e57('0x28')](_0x36b415[_0x4e57('0x29')]);if(_0x36b415[_0x4e57('0x2a')]){delete _0x36b415[_0x4e57('0x2a')];}_0x316988[_0x4e57('0x1b')](_0x503eaa)[_0x4e57('0x2b')](_0x36b415);};}exports['index']=function(_0x1a26f6,_0x431794){var _0x1da085={},_0x197bc1={},_0x27a22f={'count':0x0,'rows':[]};var _0x5d55b9=_['map'](db[_0x4e57('0x2c')][_0x4e57('0x2d')],function(_0x3ce391){return{'name':_0x3ce391[_0x4e57('0x2e')],'type':_0x3ce391['type'][_0x4e57('0x2f')]};});_0x197bc1[_0x4e57('0x30')]=_[_0x4e57('0x31')](_0x5d55b9,_0x4e57('0x2a'));_0x197bc1[_0x4e57('0x32')]=_['keys'](_0x1a26f6[_0x4e57('0x32')]);_0x197bc1[_0x4e57('0x33')]=_['intersection'](_0x197bc1[_0x4e57('0x30')],_0x197bc1['query']);_0x1da085['attributes']=_[_0x4e57('0x34')](_0x197bc1[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x1a26f6['query'][_0x4e57('0x35')]));_0x1da085['attributes']=_0x1da085[_0x4e57('0x36')][_0x4e57('0x37')]?_0x1da085[_0x4e57('0x36')]:_0x197bc1['model'];if(!_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x38')](_0x4e57('0x39'))){_0x1da085[_0x4e57('0x1e')]=qs[_0x4e57('0x1e')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1e')]);_0x1da085[_0x4e57('0x1f')]=qs[_0x4e57('0x1f')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1f')]);}_0x1da085['order']=qs[_0x4e57('0x3a')](_0x1a26f6['query'][_0x4e57('0x3a')]);_0x1da085[_0x4e57('0x3b')]=qs[_0x4e57('0x33')](_[_0x4e57('0x3c')](_0x1a26f6['query'],_0x197bc1['filters']),_0x5d55b9);if(_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x3d')]){_0x1da085[_0x4e57('0x3b')]=_[_0x4e57('0x3e')](_0x1da085[_0x4e57('0x3b')],{'$or':_[_0x4e57('0x31')](_0x5d55b9,function(_0x1ab62){if(_0x1ab62[_0x4e57('0x3f')]!==_0x4e57('0x40')){var _0x4ac448={};_0x4ac448[_0x1ab62[_0x4e57('0x2a')]]={'$like':'%'+_0x1a26f6['query'][_0x4e57('0x3d')]+'%'};return _0x4ac448;}})});}_0x1da085=_[_0x4e57('0x3e')]({},_0x1da085,_0x1a26f6['options']);var _0x1ff9e7={'where':_0x1da085[_0x4e57('0x3b')]};return db[_0x4e57('0x2c')][_0x4e57('0x20')](_0x1ff9e7)[_0x4e57('0x27')](function(_0x386d3a){_0x27a22f[_0x4e57('0x20')]=_0x386d3a;if(_0x1a26f6['query'][_0x4e57('0x41')]){_0x1da085[_0x4e57('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4e57('0x43')](_0x1da085);})[_0x4e57('0x27')](function(_0x2ef995){_0x27a22f[_0x4e57('0x44')]=_0x2ef995;return _0x27a22f;})[_0x4e57('0x27')](respondWithFilteredResult(_0x431794,_0x1da085))[_0x4e57('0x45')](handleError(_0x431794,null));};exports['show']=function(_0x2e5e62,_0x3fd1b0){var _0x271551={'raw':!![],'where':{'id':_0x2e5e62[_0x4e57('0x46')]['id']}},_0x330da6={};_0x330da6[_0x4e57('0x30')]=_[_0x4e57('0x47')](db['JscriptyAnswerReport'][_0x4e57('0x2d')]);_0x330da6[_0x4e57('0x32')]=_[_0x4e57('0x47')](_0x2e5e62[_0x4e57('0x32')]);_0x330da6[_0x4e57('0x33')]=_['intersection'](_0x330da6[_0x4e57('0x30')],_0x330da6[_0x4e57('0x32')]);_0x271551[_0x4e57('0x36')]=_[_0x4e57('0x34')](_0x330da6[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x35')]));_0x271551[_0x4e57('0x36')]=_0x271551[_0x4e57('0x36')]['length']?_0x271551['attributes']:_0x330da6['model'];if(_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x41')]){_0x271551[_0x4e57('0x42')]=[{'all':!![]}];}_0x271551=_[_0x4e57('0x3e')]({},_0x271551,_0x2e5e62[_0x4e57('0x48')]);return db[_0x4e57('0x2c')][_0x4e57('0x49')](_0x271551)[_0x4e57('0x27')](handleEntityNotFound(_0x3fd1b0,null))[_0x4e57('0x27')](respondWithResult(_0x3fd1b0,null))[_0x4e57('0x45')](handleError(_0x3fd1b0,null));};exports[_0x4e57('0x4a')]=function(_0xe5c591,_0x423986){return db['JscriptyAnswerReport'][_0x4e57('0x4a')](_0xe5c591[_0x4e57('0x4b')],{})[_0x4e57('0x27')](respondWithResult(_0x423986,0xc9))[_0x4e57('0x45')](handleError(_0x423986,null));};exports[_0x4e57('0x4c')]=function(_0x41d476,_0x48869d){if(_0x41d476[_0x4e57('0x4b')]['id']){delete _0x41d476[_0x4e57('0x4b')]['id'];}return db[_0x4e57('0x2c')][_0x4e57('0x49')]({'where':{'id':_0x41d476[_0x4e57('0x46')]['id']}})[_0x4e57('0x27')](handleEntityNotFound(_0x48869d,null))[_0x4e57('0x27')](saveUpdates(_0x41d476[_0x4e57('0x4b')],null))['then'](respondWithResult(_0x48869d,null))[_0x4e57('0x45')](handleError(_0x48869d,null));};exports['destroy']=function(_0x3deb47,_0x328c2c){return db[_0x4e57('0x2c')]['find']({'where':{'id':_0x3deb47[_0x4e57('0x46')]['id']}})['then'](handleEntityNotFound(_0x328c2c,null))[_0x4e57('0x27')](removeEntity(_0x328c2c,null))[_0x4e57('0x45')](handleError(_0x328c2c,null));};exports[_0x4e57('0x4d')]=function(_0x139891,_0x12e2df){return db[_0x4e57('0x2c')][_0x4e57('0x4d')]()['then'](respondWithResult(_0x12e2df,null))['catch'](handleError(_0x12e2df,null));}; \ No newline at end of file +var _0xfd7b=['stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','end','error'];(function(_0x3fdc3d,_0x48e855){var _0x1250ee=function(_0x585702){while(--_0x585702){_0x3fdc3d['push'](_0x3fdc3d['shift']());}};_0x1250ee(++_0x48e855);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xfd7b[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd7('0x0'));var zipdir=require(_0xbfd7('0x1'));var jsonpatch=require(_0xbfd7('0x2'));var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require(_0xbfd7('0x7'));var path=require(_0xbfd7('0x8'));var sox=require(_0xbfd7('0x9'));var csv=require(_0xbfd7('0xa'));var ejs=require(_0xbfd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xc'));var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xa'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var as=require(_0xbfd7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfd7('0x14'));var utils=require(_0xbfd7('0x15'));var config=require(_0xbfd7('0x16'));var licenseUtil=require(_0xbfd7('0x17'));var db=require(_0xbfd7('0x18'))['db'];function respondWithStatusCode(_0x559eca,_0x46feae){_0x46feae=_0x46feae||0xcc;return function(_0x534d66){if(_0x534d66){return _0x559eca[_0xbfd7('0x19')](_0x46feae);}return _0x559eca['status'](_0x46feae)['end']();};}function respondWithResult(_0x44847e,_0x4fec16){_0x4fec16=_0x4fec16||0xc8;return function(_0x3789b7){if(_0x3789b7){return _0x44847e[_0xbfd7('0x1a')](_0x4fec16)['json'](_0x3789b7);}};}function respondWithFilteredResult(_0x5efd54,_0x48f4a4){return function(_0x37e777){if(_0x37e777){var _0x115a34=typeof _0x48f4a4[_0xbfd7('0x1b')]===_0xbfd7('0x1c')&&typeof _0x48f4a4[_0xbfd7('0x1d')]===_0xbfd7('0x1c');var _0x137d50=_0x37e777[_0xbfd7('0x1e')];var _0x3053f3=_0x115a34?0x0:_0x48f4a4['offset'];var _0x5b718b=_0x115a34?_0x37e777[_0xbfd7('0x1e')]:_0x48f4a4[_0xbfd7('0x1b')]+_0x48f4a4['limit'];var _0x5ea27a;if(_0x5b718b>=_0x137d50){_0x5b718b=_0x137d50;_0x5ea27a=0xc8;}else{_0x5ea27a=0xce;}_0x5efd54[_0xbfd7('0x1a')](_0x5ea27a);return _0x5efd54['set']('Content-Range',_0x3053f3+'-'+_0x5b718b+'/'+_0x137d50)[_0xbfd7('0x1f')](_0x37e777);}return null;};}function patchUpdates(_0x5eab37){return function(_0x594792){try{jsonpatch[_0xbfd7('0x20')](_0x594792,_0x5eab37,!![]);}catch(_0x1db6de){return BPromise[_0xbfd7('0x21')](_0x1db6de);}return _0x594792['save']();};}function saveUpdates(_0xb38f6b,_0x32a489){return function(_0x152893){if(_0x152893){return _0x152893[_0xbfd7('0x22')](_0xb38f6b)[_0xbfd7('0x23')](function(_0x2639b6){return _0x2639b6;});}return null;};}function removeEntity(_0x51b13d,_0x2402fb){return function(_0x1c765b){if(_0x1c765b){return _0x1c765b[_0xbfd7('0x24')]()['then'](function(){_0x51b13d[_0xbfd7('0x1a')](0xcc)[_0xbfd7('0x25')]();});}};}function handleEntityNotFound(_0x18dd74,_0x2d0549){return function(_0x358549){if(!_0x358549){_0x18dd74['sendStatus'](0x194);}return _0x358549;};}function handleError(_0x2a7749,_0x6ef5aa){_0x6ef5aa=_0x6ef5aa||0x1f4;return function(_0x120e39){logger[_0xbfd7('0x26')](_0x120e39[_0xbfd7('0x27')]);if(_0x120e39[_0xbfd7('0x28')]){delete _0x120e39[_0xbfd7('0x28')];}_0x2a7749['status'](_0x6ef5aa)[_0xbfd7('0x29')](_0x120e39);};}exports[_0xbfd7('0x2a')]=function(_0x4d7ef4,_0x2971ea){var _0x33583b={},_0x2ec4a5={},_0x14c55d={'count':0x0,'rows':[]};var _0x510506=_[_0xbfd7('0x2b')](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')],function(_0x489365){return{'name':_0x489365[_0xbfd7('0x2e')],'type':_0x489365['type'][_0xbfd7('0x2f')]};});_0x2ec4a5['model']=_[_0xbfd7('0x2b')](_0x510506,_0xbfd7('0x28'));_0x2ec4a5['query']=_[_0xbfd7('0x30')](_0x4d7ef4[_0xbfd7('0x31')]);_0x2ec4a5['filters']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],_0x2ec4a5[_0xbfd7('0x31')]);_0x33583b['attributes']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],qs[_0xbfd7('0x34')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x34')]));_0x33583b[_0xbfd7('0x35')]=_0x33583b[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x33583b[_0xbfd7('0x35')]:_0x2ec4a5[_0xbfd7('0x33')];if(!_0x4d7ef4[_0xbfd7('0x31')]['hasOwnProperty'](_0xbfd7('0x37'))){_0x33583b['limit']=qs['limit'](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1d')]);_0x33583b[_0xbfd7('0x1b')]=qs[_0xbfd7('0x1b')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1b')]);}_0x33583b[_0xbfd7('0x38')]=qs[_0xbfd7('0x39')](_0x4d7ef4['query']['sort']);_0x33583b[_0xbfd7('0x3a')]=qs[_0xbfd7('0x3b')](_['pick'](_0x4d7ef4[_0xbfd7('0x31')],_0x2ec4a5[_0xbfd7('0x3b')]),_0x510506);if(_0x4d7ef4['query']['filter']){_0x33583b[_0xbfd7('0x3a')]=_[_0xbfd7('0x3c')](_0x33583b['where'],{'$or':_[_0xbfd7('0x2b')](_0x510506,function(_0xfee712){if(_0xfee712[_0xbfd7('0x3d')]!==_0xbfd7('0x3e')){var _0x68f13={};_0x68f13[_0xfee712['name']]={'$like':'%'+_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x3f')]+'%'};return _0x68f13;}})});}_0x33583b=_[_0xbfd7('0x3c')]({},_0x33583b,_0x4d7ef4[_0xbfd7('0x40')]);var _0x25ac4a={'where':_0x33583b[_0xbfd7('0x3a')]};return db[_0xbfd7('0x2c')][_0xbfd7('0x1e')](_0x25ac4a)['then'](function(_0x32df79){_0x14c55d['count']=_0x32df79;if(_0x4d7ef4['query'][_0xbfd7('0x41')]){_0x33583b[_0xbfd7('0x42')]=[{'all':!![]}];}return db[_0xbfd7('0x2c')][_0xbfd7('0x43')](_0x33583b);})[_0xbfd7('0x23')](function(_0x1236dd){_0x14c55d['rows']=_0x1236dd;return _0x14c55d;})[_0xbfd7('0x23')](respondWithFilteredResult(_0x2971ea,_0x33583b))['catch'](handleError(_0x2971ea,null));};exports[_0xbfd7('0x44')]=function(_0x3b7d7f,_0x12f99b){var _0x159c20={'raw':!![],'where':{'id':_0x3b7d7f[_0xbfd7('0x45')]['id']}},_0x1df6a3={};_0x1df6a3[_0xbfd7('0x33')]=_['keys'](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')]);_0x1df6a3[_0xbfd7('0x31')]=_[_0xbfd7('0x30')](_0x3b7d7f[_0xbfd7('0x31')]);_0x1df6a3[_0xbfd7('0x3b')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],_0x1df6a3[_0xbfd7('0x31')]);_0x159c20[_0xbfd7('0x35')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],qs['fields'](_0x3b7d7f['query'][_0xbfd7('0x34')]));_0x159c20[_0xbfd7('0x35')]=_0x159c20[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x159c20['attributes']:_0x1df6a3[_0xbfd7('0x33')];if(_0x3b7d7f['query'][_0xbfd7('0x41')]){_0x159c20[_0xbfd7('0x42')]=[{'all':!![]}];}_0x159c20=_['merge']({},_0x159c20,_0x3b7d7f[_0xbfd7('0x40')]);return db['JscriptyAnswerReport'][_0xbfd7('0x46')](_0x159c20)[_0xbfd7('0x23')](handleEntityNotFound(_0x12f99b,null))[_0xbfd7('0x23')](respondWithResult(_0x12f99b,null))['catch'](handleError(_0x12f99b,null));};exports['create']=function(_0x356f58,_0xb8b319){return db['JscriptyAnswerReport']['create'](_0x356f58[_0xbfd7('0x47')],{})[_0xbfd7('0x23')](respondWithResult(_0xb8b319,0xc9))[_0xbfd7('0x48')](handleError(_0xb8b319,null));};exports[_0xbfd7('0x22')]=function(_0x1cea7d,_0x14bc15){if(_0x1cea7d[_0xbfd7('0x47')]['id']){delete _0x1cea7d['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x1cea7d[_0xbfd7('0x45')]['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0x14bc15,null))[_0xbfd7('0x23')](saveUpdates(_0x1cea7d['body'],null))[_0xbfd7('0x23')](respondWithResult(_0x14bc15,null))[_0xbfd7('0x48')](handleError(_0x14bc15,null));};exports['destroy']=function(_0x4a7a72,_0xc89535){return db[_0xbfd7('0x2c')][_0xbfd7('0x46')]({'where':{'id':_0x4a7a72['params']['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0xc89535,null))[_0xbfd7('0x23')](removeEntity(_0xc89535,null))[_0xbfd7('0x48')](handleError(_0xc89535,null));};exports['describe']=function(_0x371d01,_0x15c0fe){return db[_0xbfd7('0x2c')][_0xbfd7('0x49')]()['then'](respondWithResult(_0x15c0fe,null))[_0xbfd7('0x48')](handleError(_0x15c0fe,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b501f6c..00db1b6 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 _0x3dff=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x3dff,0x1bc));var _0xf3df=function(_0x4d7d37,_0x58896e){_0x4d7d37=_0x4d7d37-0x0;var _0xa20252=_0x3dff[_0x4d7d37];return _0xa20252;};'use strict';var _=require(_0xf3df('0x0'));var util=require(_0xf3df('0x1'));var logger=require(_0xf3df('0x2'))(_0xf3df('0x3'));var moment=require('moment');var BPromise=require(_0xf3df('0x4'));var rp=require(_0xf3df('0x5'));var fs=require('fs');var path=require(_0xf3df('0x6'));var rimraf=require('rimraf');var config=require(_0xf3df('0x7'));var attributes=require(_0xf3df('0x8'));module[_0xf3df('0x9')]=function(_0x28785c,_0x4aee74){return _0x28785c[_0xf3df('0xa')](_0xf3df('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d03=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','util','api','moment','bluebird','request-promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2d03,0x1d4));var _0x32d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x32d0('0x0'));var logger=require('../../config/logger')(_0x32d0('0x1'));var moment=require(_0x32d0('0x2'));var BPromise=require(_0x32d0('0x3'));var rp=require(_0x32d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32d0('0x5'));var config=require(_0x32d0('0x6'));var attributes=require(_0x32d0('0x7'));module[_0x32d0('0x8')]=function(_0x13e93b,_0x144adf){return _0x13e93b[_0x32d0('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x32d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index ba7f0f9..edc3982 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 _0x8141=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1c4720,_0x58ca5a){var _0x3d1ba9=function(_0x105802){while(--_0x105802){_0x1c4720['push'](_0x1c4720['shift']());}};_0x3d1ba9(++_0x58ca5a);}(_0x8141,0x175));var _0x1814=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8141[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1814('0x0'));var util=require(_0x1814('0x1'));var moment=require('moment');var BPromise=require(_0x1814('0x2'));var rs=require(_0x1814('0x3'));var fs=require('fs');var Redis=require(_0x1814('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1814('0x5'));var logger=require(_0x1814('0x6'))('rpc');var config=require(_0x1814('0x7'));var jayson=require(_0x1814('0x8'));var client=jayson[_0x1814('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11392b,_0x3881ed,_0x50b9b5){return new BPromise(function(_0x158b6d,_0x282360){return client[_0x1814('0xa')](_0x11392b,_0x50b9b5)[_0x1814('0xb')](function(_0x2fc157){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3881ed,_0x1814('0xc'));logger[_0x1814('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3881ed,_0x1814('0xc'),JSON['stringify'](_0x2fc157));if(_0x2fc157[_0x1814('0xe')]){if(_0x2fc157['error'][_0x1814('0xf')]===0x1f4){logger[_0x1814('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3881ed,_0x2fc157[_0x1814('0xe')][_0x1814('0x10')]);return _0x282360(_0x2fc157['error'][_0x1814('0x10')]);}logger[_0x1814('0xe')](_0x1814('0x11'),_0x3881ed,_0x2fc157[_0x1814('0xe')]['message']);return _0x158b6d(_0x2fc157[_0x1814('0xe')][_0x1814('0x10')]);}else{logger[_0x1814('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3881ed,_0x1814('0xc'));_0x158b6d(_0x2fc157['result'][_0x1814('0x10')]);}})[_0x1814('0x13')](function(_0x1778d7){logger[_0x1814('0xe')](_0x1814('0x11'),_0x3881ed,_0x1778d7);_0x282360(_0x1778d7);});});} \ No newline at end of file +var _0xb5b2=['jayson/promise','client','http','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/environment'];(function(_0x27ebec,_0x52a162){var _0x132962=function(_0x3d5ce4){while(--_0x3d5ce4){_0x27ebec['push'](_0x27ebec['shift']());}};_0x132962(++_0x52a162);}(_0xb5b2,0x12b));var _0x2b5b=function(_0x36705d,_0x5df4b8){_0x36705d=_0x36705d-0x0;var _0x2148ac=_0xb5b2[_0x36705d];return _0x2148ac;};'use strict';var _=require(_0x2b5b('0x0'));var util=require(_0x2b5b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b5b('0x2'));var db=require(_0x2b5b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2b5b('0x4'));var jayson=require(_0x2b5b('0x5'));var client=jayson[_0x2b5b('0x6')][_0x2b5b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x206948,_0x4e7d77,_0x47fa6d){return new BPromise(function(_0x275d50,_0x719596){return client['request'](_0x206948,_0x47fa6d)['then'](function(_0x1ba186){logger[_0x2b5b('0x8')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4e7d77,_0x2b5b('0x9'));logger[_0x2b5b('0xa')](_0x2b5b('0xb'),_0x4e7d77,_0x2b5b('0x9'),JSON[_0x2b5b('0xc')](_0x1ba186));if(_0x1ba186[_0x2b5b('0xd')]){if(_0x1ba186[_0x2b5b('0xd')][_0x2b5b('0xe')]===0x1f4){logger[_0x2b5b('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4e7d77,_0x1ba186['error']['message']);return _0x719596(_0x1ba186[_0x2b5b('0xd')]['message']);}logger['error'](_0x2b5b('0xf'),_0x4e7d77,_0x1ba186[_0x2b5b('0xd')][_0x2b5b('0x10')]);return _0x275d50(_0x1ba186[_0x2b5b('0xd')][_0x2b5b('0x10')]);}else{logger[_0x2b5b('0x8')](_0x2b5b('0xf'),_0x4e7d77,'request\x20sent');_0x275d50(_0x1ba186[_0x2b5b('0x11')][_0x2b5b('0x10')]);}})[_0x2b5b('0x12')](function(_0x13dba6){logger[_0x2b5b('0xd')](_0x2b5b('0xf'),_0x4e7d77,_0x13dba6);_0x719596(_0x13dba6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 11de131..6c751da 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 _0x23da=['index','get','/:id','show','/:id/answers','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x224c8d,_0x10ca3c){var _0x277ab5=function(_0x30327c){while(--_0x30327c){_0x224c8d['push'](_0x224c8d['shift']());}};_0x277ab5(++_0x10ca3c);}(_0x23da,0x187));var _0xa23d=function(_0x5afe67,_0x2d726c){_0x5afe67=_0x5afe67-0x0;var _0x5996a4=_0x23da[_0x5afe67];return _0x5996a4;};'use strict';var multer=require(_0xa23d('0x0'));var util=require('util');var path=require(_0xa23d('0x1'));var timeout=require(_0xa23d('0x2'));var express=require(_0xa23d('0x3'));var router=express[_0xa23d('0x4')]();var fs_extra=require(_0xa23d('0x5'));var auth=require(_0xa23d('0x6'));var interaction=require(_0xa23d('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xa23d('0x8')](),controller[_0xa23d('0x9')]);router[_0xa23d('0xa')](_0xa23d('0xb'),auth[_0xa23d('0x8')](),controller[_0xa23d('0xc')]);router[_0xa23d('0xa')]('/:id/sessions',auth[_0xa23d('0x8')](),controller['getSessions']);router[_0xa23d('0xa')](_0xa23d('0xd'),auth[_0xa23d('0x8')](),controller['getAnswers']);router['get']('/:id/summary',auth[_0xa23d('0x8')](),timeout(_0xa23d('0xe')),controller[_0xa23d('0xf')]);router[_0xa23d('0x10')]('/',auth[_0xa23d('0x8')](),controller[_0xa23d('0x11')]);router['post'](_0xa23d('0x12'),auth['isAuthenticated'](),controller[_0xa23d('0x13')]);router[_0xa23d('0x14')](_0xa23d('0xb'),auth['isAuthenticated'](),controller[_0xa23d('0x15')]);router[_0xa23d('0x16')](_0xa23d('0xb'),auth[_0xa23d('0x8')](),controller[_0xa23d('0x17')]);module[_0xa23d('0x18')]=router; \ No newline at end of file +var _0xca44=['get','/:id','getSessions','/:id/answers','/:id/summary','30s','getSummary','create','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','isAuthenticated','index'];(function(_0xbecc0e,_0x34df87){var _0x3573ff=function(_0x2bb886){while(--_0x2bb886){_0xbecc0e['push'](_0xbecc0e['shift']());}};_0x3573ff(++_0x34df87);}(_0xca44,0x196));var _0x4ca4=function(_0x5609dc,_0x351ff2){_0x5609dc=_0x5609dc-0x0;var _0x4e5de5=_0xca44[_0x5609dc];return _0x4e5de5;};'use strict';var multer=require(_0x4ca4('0x0'));var util=require(_0x4ca4('0x1'));var path=require(_0x4ca4('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ca4('0x3'));var router=express[_0x4ca4('0x4')]();var fs_extra=require(_0x4ca4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ca4('0x6'));var controller=require(_0x4ca4('0x7'));router['get']('/',auth[_0x4ca4('0x8')](),controller[_0x4ca4('0x9')]);router[_0x4ca4('0xa')](_0x4ca4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4ca4('0xa')]('/:id/sessions',auth[_0x4ca4('0x8')](),controller[_0x4ca4('0xc')]);router[_0x4ca4('0xa')](_0x4ca4('0xd'),auth[_0x4ca4('0x8')](),controller['getAnswers']);router[_0x4ca4('0xa')](_0x4ca4('0xe'),auth[_0x4ca4('0x8')](),timeout(_0x4ca4('0xf')),controller[_0x4ca4('0x10')]);router['post']('/',auth[_0x4ca4('0x8')](),controller[_0x4ca4('0x11')]);router[_0x4ca4('0x12')](_0x4ca4('0x13'),auth[_0x4ca4('0x8')](),controller[_0x4ca4('0x14')]);router[_0x4ca4('0x15')](_0x4ca4('0xb'),auth['isAuthenticated'](),controller[_0x4ca4('0x16')]);router[_0x4ca4('0x17')](_0x4ca4('0xb'),auth[_0x4ca4('0x8')](),controller[_0x4ca4('0x18')]);module[_0x4ca4('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 9f85f78..77f1390 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 _0x96ff=['isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96ff,0x6c));var _0xf96f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x96ff[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xf96f('0x0'));var _=require(_0xf96f('0x1'));var util=require(_0xf96f('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf96f('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x4a651a){if(_[_0xf96f('0x4')](_0x4a651a)){this['setDataValue'](_0xf96f('0x5'),JSON[_0xf96f('0x6')](_0x4a651a));}else if(_[_0xf96f('0x7')](_0x4a651a)){this[_0xf96f('0x8')](_0xf96f('0x5'),_0x4a651a);}else{this['setDataValue']('formData',util[_0xf96f('0x9')](_0xf96f('0xa'),this[_0xf96f('0xb')](_0xf96f('0x3'))||'',this[_0xf96f('0xb')](_0xf96f('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf96f('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf96f('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xc22a=['description','BOOLEAN','sequelize','util','exports','STRING','name','isObjectLike','setDataValue','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc22a,0x152));var _0xac22=function(_0xd0dbd5,_0x50bfcb){_0xd0dbd5=_0xd0dbd5-0x0;var _0x3fb29d=_0xc22a[_0xd0dbd5];return _0x3fb29d;};'use strict';var Sequelize=require(_0xac22('0x0'));var _=require('lodash');var util=require(_0xac22('0x1'));module[_0xac22('0x2')]={'name':{'type':Sequelize[_0xac22('0x3')],'unique':_0xac22('0x4')},'description':{'type':Sequelize[_0xac22('0x3')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x2053f1){if(_[_0xac22('0x5')](_0x2053f1)){this[_0xac22('0x6')]('formData',JSON['stringify'](_0x2053f1));}else if(_[_0xac22('0x7')](_0x2053f1)){this[_0xac22('0x6')](_0xac22('0x8'),_0x2053f1);}else{this[_0xac22('0x6')](_0xac22('0x8'),util[_0xac22('0x9')](_0xac22('0xa'),this['getDataValue'](_0xac22('0x4'))||'',this[_0xac22('0xb')](_0xac22('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xac22('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xac22('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 1c45b5b..9da3e58 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 _0x9091=['YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','zip-dir','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','index','JscriptyProject','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','length','include','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','create','clone','createdAt','updatedAt','omit','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','ProjectId','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','questionId','question','starttime','format'];(function(_0x42babc,_0x1287c0){var _0x3b240a=function(_0xd07e1f){while(--_0xd07e1f){_0x42babc['push'](_0x42babc['shift']());}};_0x3b240a(++_0x1287c0);}(_0x9091,0x1ed));var _0x1909=function(_0x2f5edd,_0x365552){_0x2f5edd=_0x2f5edd-0x0;var _0x13b74c=_0x9091[_0x2f5edd];return _0x13b74c;};'use strict';var emlformat=require(_0x1909('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1909('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1909('0x2'));var moment=require('moment');var BPromise=require(_0x1909('0x3'));var Mustache=require(_0x1909('0x4'));var util=require(_0x1909('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1909('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1909('0x7'));var squel=require(_0x1909('0x8'));var crypto=require(_0x1909('0x9'));var jsforce=require(_0x1909('0xa'));var deskjs=require(_0x1909('0xb'));var toCsv=require(_0x1909('0xc'));var querystring=require('querystring');var Papa=require(_0x1909('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1909('0xe'));var as=require(_0x1909('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1909('0x10'))(_0x1909('0x11'));var utils=require('../../config/utils');var config=require(_0x1909('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1909('0x13'))['db'];function respondWithStatusCode(_0x989590,_0x52a882){_0x52a882=_0x52a882||0xcc;return function(_0x5e6a49){if(_0x5e6a49){return _0x989590[_0x1909('0x14')](_0x52a882);}return _0x989590[_0x1909('0x15')](_0x52a882)[_0x1909('0x16')]();};}function respondWithResult(_0x4b1572,_0x35222e){_0x35222e=_0x35222e||0xc8;return function(_0xa04392){if(_0xa04392){return _0x4b1572[_0x1909('0x15')](_0x35222e)[_0x1909('0x17')](_0xa04392);}};}function respondWithFilteredResult(_0x2a2cc7,_0x5c828a){return function(_0x3d3e89){if(_0x3d3e89){var _0x6297fa=typeof _0x5c828a[_0x1909('0x18')]===_0x1909('0x19')&&typeof _0x5c828a[_0x1909('0x1a')]==='undefined';var _0x2723b3=_0x3d3e89[_0x1909('0x1b')];var _0x5f4c3a=_0x6297fa?0x0:_0x5c828a[_0x1909('0x18')];var _0x5e7cc5=_0x6297fa?_0x3d3e89[_0x1909('0x1b')]:_0x5c828a[_0x1909('0x18')]+_0x5c828a[_0x1909('0x1a')];var _0xb39d7a;if(_0x5e7cc5>=_0x2723b3){_0x5e7cc5=_0x2723b3;_0xb39d7a=0xc8;}else{_0xb39d7a=0xce;}_0x2a2cc7[_0x1909('0x15')](_0xb39d7a);return _0x2a2cc7[_0x1909('0x1c')](_0x1909('0x1d'),_0x5f4c3a+'-'+_0x5e7cc5+'/'+_0x2723b3)[_0x1909('0x17')](_0x3d3e89);}return null;};}function patchUpdates(_0x3ec176){return function(_0x2c0c27){try{jsonpatch[_0x1909('0x1e')](_0x2c0c27,_0x3ec176,!![]);}catch(_0x6ee440){return BPromise[_0x1909('0x1f')](_0x6ee440);}return _0x2c0c27[_0x1909('0x20')]();};}function saveUpdates(_0x586114,_0x57d69a){return function(_0x3697a7){if(_0x3697a7){return _0x3697a7[_0x1909('0x21')](_0x586114)[_0x1909('0x22')](function(_0x20747f){return _0x20747f;});}return null;};}function removeEntity(_0x2ae7ed,_0x31f215){return function(_0x4c8eab){if(_0x4c8eab){return _0x4c8eab[_0x1909('0x23')]()[_0x1909('0x22')](function(){var _0x2b6cff=_0x4c8eab['get']({'plain':!![]});var _0x578c5f=_0x1909('0x24');return db[_0x1909('0x25')]['destroy']({'where':{'type':_0x578c5f,'resourceId':_0x2b6cff['id']}})['then'](function(){return _0x4c8eab;});})[_0x1909('0x22')](function(){_0x2ae7ed[_0x1909('0x15')](0xcc)[_0x1909('0x16')]();});}};}function handleEntityNotFound(_0x46fce6,_0x10b697){return function(_0x4e05d5){if(!_0x4e05d5){_0x46fce6['sendStatus'](0x194);}return _0x4e05d5;};}function handleError(_0x309ea8,_0x173b14){_0x173b14=_0x173b14||0x1f4;return function(_0x2c5277){logger[_0x1909('0x26')](_0x2c5277[_0x1909('0x27')]);if(_0x2c5277[_0x1909('0x28')]){delete _0x2c5277[_0x1909('0x28')];}_0x309ea8['status'](_0x173b14)['send'](_0x2c5277);};}exports[_0x1909('0x29')]=function(_0x51cdbd,_0x307229){var _0xa9db8e={},_0x190ce5={},_0x42b85e={'count':0x0,'rows':[]};var _0x7585d1=_['map'](db[_0x1909('0x2a')]['rawAttributes'],function(_0x36553e){return{'name':_0x36553e[_0x1909('0x2b')],'type':_0x36553e[_0x1909('0x2c')][_0x1909('0x2d')]};});_0x190ce5[_0x1909('0x2e')]=_[_0x1909('0x2f')](_0x7585d1,_0x1909('0x28'));_0x190ce5[_0x1909('0x30')]=_[_0x1909('0x31')](_0x51cdbd[_0x1909('0x30')]);_0x190ce5[_0x1909('0x32')]=_[_0x1909('0x33')](_0x190ce5[_0x1909('0x2e')],_0x190ce5[_0x1909('0x30')]);_0xa9db8e[_0x1909('0x34')]=_['intersection'](_0x190ce5['model'],qs[_0x1909('0x35')](_0x51cdbd[_0x1909('0x30')][_0x1909('0x35')]));_0xa9db8e[_0x1909('0x34')]=_0xa9db8e[_0x1909('0x34')]['length']?_0xa9db8e['attributes']:_0x190ce5[_0x1909('0x2e')];if(!_0x51cdbd[_0x1909('0x30')][_0x1909('0x36')](_0x1909('0x37'))){_0xa9db8e[_0x1909('0x1a')]=qs[_0x1909('0x1a')](_0x51cdbd[_0x1909('0x30')]['limit']);_0xa9db8e[_0x1909('0x18')]=qs[_0x1909('0x18')](_0x51cdbd['query'][_0x1909('0x18')]);}_0xa9db8e[_0x1909('0x38')]=qs[_0x1909('0x39')](_0x51cdbd[_0x1909('0x30')][_0x1909('0x39')]);_0xa9db8e['where']=qs['filters'](_[_0x1909('0x3a')](_0x51cdbd['query'],_0x190ce5['filters']),_0x7585d1);if(_0x51cdbd[_0x1909('0x30')][_0x1909('0x3b')]){_0xa9db8e[_0x1909('0x3c')]=_[_0x1909('0x3d')](_0xa9db8e[_0x1909('0x3c')],{'$or':_[_0x1909('0x2f')](_0x7585d1,function(_0x275b5f){if(_0x275b5f[_0x1909('0x2c')]!==_0x1909('0x3e')){var _0x1234cf={};_0x1234cf[_0x275b5f[_0x1909('0x28')]]={'$like':'%'+_0x51cdbd['query'][_0x1909('0x3b')]+'%'};return _0x1234cf;}})});}_0xa9db8e=_[_0x1909('0x3d')]({},_0xa9db8e,_0x51cdbd[_0x1909('0x3f')]);var _0x2b9244={'where':_0xa9db8e[_0x1909('0x3c')]};return db[_0x1909('0x2a')][_0x1909('0x1b')](_0x2b9244)[_0x1909('0x22')](function(_0x12b1c0){_0x42b85e[_0x1909('0x1b')]=_0x12b1c0;if(_0x51cdbd['query'][_0x1909('0x40')]){_0xa9db8e['include']=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0xa9db8e);})[_0x1909('0x22')](function(_0x5dd7bc){_0x42b85e[_0x1909('0x41')]=_0x5dd7bc;return _0x42b85e;})['then'](respondWithFilteredResult(_0x307229,_0xa9db8e))['catch'](handleError(_0x307229,null));};exports[_0x1909('0x42')]=function(_0x5a6fc4,_0x1fc58b){var _0xb9e085={'raw':![],'where':{'id':_0x5a6fc4[_0x1909('0x43')]['id']}},_0x1c85d4={};_0x1c85d4[_0x1909('0x2e')]=_['keys'](db[_0x1909('0x2a')][_0x1909('0x44')]);_0x1c85d4[_0x1909('0x30')]=_['keys'](_0x5a6fc4['query']);_0x1c85d4[_0x1909('0x32')]=_[_0x1909('0x33')](_0x1c85d4['model'],_0x1c85d4[_0x1909('0x30')]);_0xb9e085[_0x1909('0x34')]=_[_0x1909('0x33')](_0x1c85d4[_0x1909('0x2e')],qs[_0x1909('0x35')](_0x5a6fc4[_0x1909('0x30')][_0x1909('0x35')]));_0xb9e085[_0x1909('0x34')]=_0xb9e085['attributes'][_0x1909('0x45')]?_0xb9e085[_0x1909('0x34')]:_0x1c85d4[_0x1909('0x2e')];if(_0x5a6fc4[_0x1909('0x30')][_0x1909('0x40')]){_0xb9e085[_0x1909('0x46')]=[{'all':!![]}];}_0xb9e085=_[_0x1909('0x3d')]({},_0xb9e085,_0x5a6fc4['options']);return db[_0x1909('0x2a')]['find'](_0xb9e085)['then'](handleEntityNotFound(_0x1fc58b,null))[_0x1909('0x22')](respondWithResult(_0x1fc58b,null))[_0x1909('0x47')](handleError(_0x1fc58b,null));};exports['create']=function(_0x50e373,_0x23dd24){return db['JscriptyProject']['create'](_0x50e373[_0x1909('0x48')],{})['then'](function(_0x4d38fc){var _0x1c6e78=_0x50e373['user']['get']({'plain':!![]});if(!_0x1c6e78)throw new Error(_0x1909('0x49'));if(_0x1c6e78[_0x1909('0x4a')]===_0x1909('0x4b')){var _0x44a796=_0x4d38fc[_0x1909('0x4c')]({'plain':!![]});var _0xa9095a='Projects';return db[_0x1909('0x4d')]['find']({'where':{'name':_0xa9095a,'userProfileId':_0x1c6e78[_0x1909('0x4e')]},'raw':!![]})[_0x1909('0x22')](function(_0x396cb0){if(_0x396cb0&&_0x396cb0['autoAssociation']===0x0){return db['UserProfileResource'][_0x1909('0x4f')]({'name':_0x44a796[_0x1909('0x28')],'resourceId':_0x44a796['id'],'type':_0x396cb0['name'],'sectionId':_0x396cb0['id']},{})['then'](function(){return _0x4d38fc;});}else{return _0x4d38fc;}})[_0x1909('0x47')](function(_0x1b7ea4){logger[_0x1909('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7ea4);throw _0x1b7ea4;});}return _0x4d38fc;})['then'](respondWithResult(_0x23dd24,0xc9))[_0x1909('0x47')](handleError(_0x23dd24,null));};exports[_0x1909('0x50')]=function(_0x28b67f,_0x485e62){var _0x24ad12={'where':{'id':_0x28b67f[_0x1909('0x43')]['id']}},_0xca174d={};_0xca174d[_0x1909('0x2e')]=_[_0x1909('0x31')](db[_0x1909('0x2a')][_0x1909('0x44')]);_0x24ad12[_0x1909('0x34')]=_[_0x1909('0x33')](_0xca174d[_0x1909('0x2e')],qs[_0x1909('0x35')](_0x28b67f['query'][_0x1909('0x35')]));_0x24ad12[_0x1909('0x34')]=_0x24ad12[_0x1909('0x34')][_0x1909('0x45')]?_0x24ad12[_0x1909('0x34')]:_0xca174d['model'];if(_0x28b67f[_0x1909('0x30')][_0x1909('0x40')]){_0x24ad12[_0x1909('0x46')]=[{'all':!![]}];}_0x24ad12=_[_0x1909('0x3d')]({},_0x24ad12,_0x28b67f['options']);return db[_0x1909('0x2a')]['find'](_0x24ad12)[_0x1909('0x22')](handleEntityNotFound(_0x485e62,null))['then'](function(_0x57ecdc){if(_0x57ecdc){var _0x33c9f2=_0x57ecdc[_0x1909('0x4c')]({'plain':!![]});_0x33c9f2=qs['omit'](_0x33c9f2,['id',_0x1909('0x51'),_0x1909('0x52')]);_0x28b67f[_0x1909('0x48')]=_[_0x1909('0x53')](_0x28b67f[_0x1909('0x48')],['id','createdAt',_0x1909('0x52')]);return db[_0x1909('0x2a')][_0x1909('0x4f')](_[_0x1909('0x3d')](_0x33c9f2,_0x28b67f[_0x1909('0x48')]),{'include':_0x28b67f[_0x1909('0x30')][_0x1909('0x40')]?[{'all':!![]}]:undefined})[_0x1909('0x22')](function(_0x224caa){var _0x47efbf=_0x28b67f['user'][_0x1909('0x4c')]({'plain':!![]});if(!_0x47efbf)throw new Error(_0x1909('0x49'));if(_0x47efbf[_0x1909('0x4a')]===_0x1909('0x4b')){var _0x495c4d=_0x224caa['get']({'plain':!![]});var _0x1f713b=_0x1909('0x24');return db[_0x1909('0x4d')][_0x1909('0x54')]({'where':{'name':_0x1f713b,'userProfileId':_0x47efbf[_0x1909('0x4e')]},'raw':!![]})[_0x1909('0x22')](function(_0xefef8d){if(_0xefef8d&&_0xefef8d[_0x1909('0x55')]===0x0){return db[_0x1909('0x25')][_0x1909('0x4f')]({'name':_0x495c4d['name'],'resourceId':_0x495c4d['id'],'type':_0xefef8d['name'],'sectionId':_0xefef8d['id']},{})['then'](function(){return _0x224caa;});}else{return _0x224caa;}})[_0x1909('0x47')](function(_0x1d03ed){logger[_0x1909('0x26')](_0x1909('0x56'),_0x1d03ed);throw _0x1d03ed;});}return _0x224caa;});}})[_0x1909('0x22')](respondWithResult(_0x485e62,0xc9))['catch'](handleError(_0x485e62,null));};exports[_0x1909('0x21')]=function(_0x2f5e83,_0x12dd5a){if(_0x2f5e83[_0x1909('0x48')]['id']){delete _0x2f5e83[_0x1909('0x48')]['id'];}return db[_0x1909('0x2a')][_0x1909('0x54')]({'where':{'id':_0x2f5e83[_0x1909('0x43')]['id']}})[_0x1909('0x22')](handleEntityNotFound(_0x12dd5a,null))[_0x1909('0x22')](saveUpdates(_0x2f5e83[_0x1909('0x48')],null))[_0x1909('0x22')](respondWithResult(_0x12dd5a,null))['catch'](handleError(_0x12dd5a,null));};exports['destroy']=function(_0x1622a8,_0xd9840e){return db['JscriptyProject'][_0x1909('0x54')]({'where':{'id':_0x1622a8[_0x1909('0x43')]['id']}})['then'](handleEntityNotFound(_0xd9840e,null))[_0x1909('0x22')](removeEntity(_0xd9840e,null))[_0x1909('0x47')](handleError(_0xd9840e,null));};exports[_0x1909('0x57')]=function(_0x3e464a,_0xe7aa2e,_0x46c69b){var _0x541a78={'raw':!![],'where':{}};var _0x10bd30={};var _0x34ef06={'count':0x0,'rows':[]};return db[_0x1909('0x2a')][_0x1909('0x58')]({'where':{'id':_0x3e464a[_0x1909('0x43')]['id']}})[_0x1909('0x22')](handleEntityNotFound(_0xe7aa2e,null))['then'](function(_0x37604d){if(_0x37604d){_0x10bd30[_0x1909('0x2e')]=_[_0x1909('0x31')](db['JscriptySessionReport'][_0x1909('0x44')]);_0x10bd30[_0x1909('0x30')]=_[_0x1909('0x31')](_0x3e464a[_0x1909('0x30')]);_0x10bd30[_0x1909('0x32')]=_[_0x1909('0x33')](_0x10bd30['model'],_0x10bd30[_0x1909('0x30')]);_0x541a78[_0x1909('0x34')]=_[_0x1909('0x33')](_0x10bd30[_0x1909('0x2e')],qs['fields'](_0x3e464a[_0x1909('0x30')]['fields']));_0x541a78['attributes']=_0x541a78[_0x1909('0x34')]['length']?_0x541a78['attributes']:_0x10bd30[_0x1909('0x2e')];if(!_0x3e464a['query'][_0x1909('0x36')](_0x1909('0x37'))){_0x541a78[_0x1909('0x1a')]=qs['limit'](_0x3e464a['query'][_0x1909('0x1a')]);_0x541a78[_0x1909('0x18')]=qs[_0x1909('0x18')](_0x3e464a['query'][_0x1909('0x18')]);}_0x541a78[_0x1909('0x38')]=qs['sort'](_0x3e464a[_0x1909('0x30')][_0x1909('0x39')]);_0x541a78[_0x1909('0x3c')]=qs[_0x1909('0x32')](_['pick'](_0x3e464a[_0x1909('0x30')],_0x10bd30[_0x1909('0x32')]));_0x541a78[_0x1909('0x3c')][_0x1909('0x59')]=_0x37604d['id'];if(_0x3e464a[_0x1909('0x30')][_0x1909('0x3b')]){_0x541a78[_0x1909('0x3c')]=_[_0x1909('0x3d')](_0x541a78[_0x1909('0x3c')],{'$or':_[_0x1909('0x2f')](_0x541a78['attributes'],function(_0x51be55){var _0x5452ab={};_0x5452ab[_0x51be55]={'$like':'%'+_0x3e464a[_0x1909('0x30')][_0x1909('0x3b')]+'%'};return _0x5452ab;})});}_0x541a78=_[_0x1909('0x3d')]({},_0x541a78,_0x3e464a['options']);return db[_0x1909('0x5a')][_0x1909('0x1b')]({'where':_0x541a78['where']})[_0x1909('0x22')](function(_0x2a8335){_0x34ef06[_0x1909('0x1b')]=_0x2a8335;if(_0x3e464a[_0x1909('0x30')][_0x1909('0x40')]){_0x541a78[_0x1909('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1909('0x5b')](_0x541a78);})[_0x1909('0x22')](function(_0x5a88ab){_0x34ef06[_0x1909('0x41')]=_0x5a88ab;return _0x34ef06;});}})['then'](respondWithFilteredResult(_0xe7aa2e,_0x541a78))[_0x1909('0x47')](handleError(_0xe7aa2e,null));};exports[_0x1909('0x5c')]=function(_0x534fcd,_0x3001ac,_0x2929e4){var _0x3b9aa1={'raw':!![],'where':{}};var _0x3101a4={};var _0xc3b8e3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x1909('0x58')]({'where':{'id':_0x534fcd[_0x1909('0x43')]['id']}})[_0x1909('0x22')](handleEntityNotFound(_0x3001ac,null))[_0x1909('0x22')](function(_0x10f037){if(_0x10f037){_0x3101a4['model']=_[_0x1909('0x31')](db['JscriptyAnswerReport'][_0x1909('0x44')]);_0x3101a4[_0x1909('0x30')]=_[_0x1909('0x31')](_0x534fcd[_0x1909('0x30')]);_0x3101a4[_0x1909('0x32')]=_[_0x1909('0x33')](_0x3101a4[_0x1909('0x2e')],_0x3101a4[_0x1909('0x30')]);_0x3b9aa1[_0x1909('0x34')]=_['intersection'](_0x3101a4[_0x1909('0x2e')],qs[_0x1909('0x35')](_0x534fcd[_0x1909('0x30')]['fields']));_0x3b9aa1[_0x1909('0x34')]=_0x3b9aa1[_0x1909('0x34')][_0x1909('0x45')]?_0x3b9aa1[_0x1909('0x34')]:_0x3101a4[_0x1909('0x2e')];if(!_0x534fcd[_0x1909('0x30')][_0x1909('0x36')]('nolimit')){_0x3b9aa1[_0x1909('0x1a')]=qs[_0x1909('0x1a')](_0x534fcd[_0x1909('0x30')]['limit']);_0x3b9aa1[_0x1909('0x18')]=qs[_0x1909('0x18')](_0x534fcd[_0x1909('0x30')][_0x1909('0x18')]);}_0x3b9aa1[_0x1909('0x38')]=qs[_0x1909('0x39')](_0x534fcd[_0x1909('0x30')][_0x1909('0x39')]);_0x3b9aa1[_0x1909('0x3c')]=qs[_0x1909('0x32')](_['pick'](_0x534fcd[_0x1909('0x30')],_0x3101a4[_0x1909('0x32')]));_0x3b9aa1[_0x1909('0x3c')][_0x1909('0x59')]=_0x10f037['id'];if(_0x534fcd[_0x1909('0x30')]['filter']){_0x3b9aa1[_0x1909('0x3c')]=_['merge'](_0x3b9aa1[_0x1909('0x3c')],{'$or':_[_0x1909('0x2f')](_0x3b9aa1[_0x1909('0x34')],function(_0x4e5f27){var _0x541190={};_0x541190[_0x4e5f27]={'$like':'%'+_0x534fcd[_0x1909('0x30')][_0x1909('0x3b')]+'%'};return _0x541190;})});}_0x3b9aa1=_[_0x1909('0x3d')]({},_0x3b9aa1,_0x534fcd[_0x1909('0x3f')]);return db[_0x1909('0x5d')][_0x1909('0x1b')]({'where':_0x3b9aa1[_0x1909('0x3c')]})[_0x1909('0x22')](function(_0x54f62d){_0xc3b8e3[_0x1909('0x1b')]=_0x54f62d;if(_0x534fcd[_0x1909('0x30')][_0x1909('0x40')]){_0x3b9aa1['include']=[{'all':!![]}];}return db[_0x1909('0x5d')][_0x1909('0x5b')](_0x3b9aa1);})[_0x1909('0x22')](function(_0x29ec7f){_0xc3b8e3['rows']=_0x29ec7f;return _0xc3b8e3;});}})[_0x1909('0x22')](respondWithFilteredResult(_0x3001ac,_0x3b9aa1))[_0x1909('0x47')](handleError(_0x3001ac,null));};function char(_0x293654){return _0x1909('0x5e')===typeof _0x293654?String[_0x1909('0x5f')][_0x1909('0x1e')](null,arguments):_0x293654;}function needsEncapsulation(_0x106166){return!!_0x106166&&(_0x106166[_0x1909('0x60')]()[_0x1909('0x61')](char(0xd))>=0x0||_0x106166[_0x1909('0x60')]()['indexOf'](char(0xa))>=0x0||_0x106166[_0x1909('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x106166[_0x1909('0x60')]()[_0x1909('0x61')](char(0x22))>=0x0);}function encapsulate(_0x486ee1){var _0x41aa36=char(0x22),_0x428d8b='\x5c'+char(0x22),_0x15a3cd=_0x486ee1[_0x1909('0x60')]()[_0x1909('0x62')](new RegExp(_0x41aa36,'g'),_0x428d8b);return _0x41aa36+_0x15a3cd+_0x41aa36;}exports[_0x1909('0x63')]=function(_0x505ced,_0x4373b6,_0x46222c){var _0x5c5afe,_0x1f4b91;var _0x64578b={'where':{'ProjectId':_0x505ced[_0x1909('0x43')]['id']}};if(_0x505ced[_0x1909('0x30')][_0x1909('0x64')]){_0x64578b[_0x1909('0x3c')]['starttime']=JSON[_0x1909('0x65')](_0x505ced[_0x1909('0x30')][_0x1909('0x64')]);}return db[_0x1909('0x5a')][_0x1909('0x5b')](_0x64578b)[_0x1909('0x22')](handleEntityNotFound(_0x4373b6,null))[_0x1909('0x22')](function(_0x4fe7df){if(_0x4fe7df){_0x5c5afe=_0x4fe7df;return db[_0x1909('0x66')][_0x1909('0x5b')]({'where':{'SessionId':{'$in':_[_0x1909('0x2f')](_0x5c5afe,'id')},'ProjectId':_0x505ced[_0x1909('0x43')]['id']},'order':'-createdAt'});}})[_0x1909('0x22')](handleEntityNotFound(_0x4373b6,null))[_0x1909('0x22')](function(_0x98b424){if(_0x98b424){_0x1f4b91=_0x98b424;var _0x3f3de8={};for(var _0x3521eb=0x0,_0x2c8ee2=_0x1f4b91[_0x1909('0x45')];_0x3521eb<_0x2c8ee2;_0x3521eb++){if(!_0x3f3de8[_0x1909('0x36')](_0x1f4b91[_0x3521eb][_0x1909('0x67')])){_0x3f3de8[_0x1f4b91[_0x3521eb][_0x1909('0x67')]]=needsEncapsulation(_0x1f4b91[_0x3521eb][_0x1909('0x68')])?encapsulate(_0x1f4b91[_0x3521eb][_0x1909('0x68')]):_0x1f4b91[_0x3521eb][_0x1909('0x68')];}}var _0x1ed8f2=[],_0x19267b={};for(var _0x4b32bb=0x0,_0x35d054=_0x5c5afe[_0x1909('0x45')];_0x4b32bb<_0x35d054;_0x4b32bb++){_0x19267b={'ProjectId':_0x505ced[_0x1909('0x43')]['id'],'SessionId':_0x5c5afe[_0x4b32bb]['id'],'StartTime':moment(_0x5c5afe[_0x4b32bb][_0x1909('0x69')])[_0x1909('0x6a')](_0x1909('0x6b'))};for(var _0x5c9043=0x0,_0x33e9a6=_0x1f4b91[_0x1909('0x45')];_0x5c9043<_0x33e9a6;_0x5c9043++){if(_0x1f4b91[_0x5c9043][_0x1909('0x6c')]==_0x5c5afe[_0x4b32bb]['id']&&_0x3f3de8[_0x1909('0x36')](_0x1f4b91[_0x5c9043][_0x1909('0x67')])){_0x19267b[_0x3f3de8[_0x1f4b91[_0x5c9043]['questionId']]]=_0x1f4b91[_0x5c9043][_0x1909('0x6d')];}}for(var _0x305ac9 in _0x3f3de8){if(!_0x19267b[_0x1909('0x36')](_0x3f3de8[_0x305ac9])){_0x19267b[_0x3f3de8[_0x305ac9]]=null;}}_0x1ed8f2[_0x1909('0x6e')](_0x19267b);}return _0x1ed8f2;}})[_0x1909('0x22')](function(_0x546b49){if(!_[_0x1909('0x6f')](_0x546b49)){var _0xcf0776=toCsv(_0x546b49);var _0x1cb0e8=Date['now']();fs[_0x1909('0x70')](util['format'](_0x1909('0x71'),_0x505ced['params']['id'],_0x1cb0e8),_0xcf0776);_0x4373b6[_0x1909('0x72')](_0x1909('0x73'),_0x1909('0x74')+util[_0x1909('0x6a')](_0x1909('0x75'),_0x505ced[_0x1909('0x43')]['id'],_0x1cb0e8));_0x4373b6['setHeader']('Content-type',_0x1909('0x76'));return _0x4373b6[_0x1909('0x77')](util[_0x1909('0x6a')](_0x1909('0x71'),_0x505ced[_0x1909('0x43')]['id'],_0x1cb0e8));}else{return _0x4373b6['sendStatus'](0xcc);}})[_0x1909('0x47')](handleError(_0x4373b6,null));}; \ No newline at end of file +var _0x39d0=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','Content-Range','reject','update','then','get','Projects','destroy','error','stack','name','send','index','map','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','JscriptyProject','count','includeAll','include','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','updatedAt','createdAt','UserProfileResource','getSessions','JscriptySessionReport','ProjectId','rows','JscriptyAnswerReport','findAll','fromCharCode','apply','indexOf','toString','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs'];(function(_0x556c2d,_0x5432c3){var _0x314de4=function(_0x4ff614){while(--_0x4ff614){_0x556c2d['push'](_0x556c2d['shift']());}};_0x314de4(++_0x5432c3);}(_0x39d0,0x144));var _0x039d=function(_0x4f2756,_0x243ba3){_0x4f2756=_0x4f2756-0x0;var _0x46d5f2=_0x39d0[_0x4f2756];return _0x46d5f2;};'use strict';var emlformat=require(_0x039d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x039d('0x1'));var rp=require(_0x039d('0x2'));var moment=require(_0x039d('0x3'));var BPromise=require(_0x039d('0x4'));var Mustache=require(_0x039d('0x5'));var util=require('util');var path=require(_0x039d('0x6'));var sox=require(_0x039d('0x7'));var csv=require(_0x039d('0x8'));var ejs=require(_0x039d('0x9'));var fs=require('fs');var fs_extra=require(_0x039d('0xa'));var _=require(_0x039d('0xb'));var squel=require(_0x039d('0xc'));var crypto=require(_0x039d('0xd'));var jsforce=require(_0x039d('0xe'));var deskjs=require(_0x039d('0xf'));var toCsv=require(_0x039d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x039d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x039d('0x11'));var as=require(_0x039d('0x12'));var hardwareService=require(_0x039d('0x13'));var logger=require(_0x039d('0x14'))('api');var utils=require(_0x039d('0x15'));var config=require(_0x039d('0x16'));var licenseUtil=require(_0x039d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9930eb,_0x111f41){_0x111f41=_0x111f41||0xcc;return function(_0x24de67){if(_0x24de67){return _0x9930eb[_0x039d('0x18')](_0x111f41);}return _0x9930eb[_0x039d('0x19')](_0x111f41)[_0x039d('0x1a')]();};}function respondWithResult(_0x3147c0,_0x54cf8e){_0x54cf8e=_0x54cf8e||0xc8;return function(_0x4dc3a4){if(_0x4dc3a4){return _0x3147c0[_0x039d('0x19')](_0x54cf8e)[_0x039d('0x1b')](_0x4dc3a4);}};}function respondWithFilteredResult(_0x33e289,_0x138193){return function(_0x24c16f){if(_0x24c16f){var _0x330966=typeof _0x138193['offset']===_0x039d('0x1c')&&typeof _0x138193[_0x039d('0x1d')]===_0x039d('0x1c');var _0x4dfc0c=_0x24c16f['count'];var _0xaedb24=_0x330966?0x0:_0x138193[_0x039d('0x1e')];var _0x360233=_0x330966?_0x24c16f['count']:_0x138193['offset']+_0x138193[_0x039d('0x1d')];var _0x37ff76;if(_0x360233>=_0x4dfc0c){_0x360233=_0x4dfc0c;_0x37ff76=0xc8;}else{_0x37ff76=0xce;}_0x33e289['status'](_0x37ff76);return _0x33e289['set'](_0x039d('0x1f'),_0xaedb24+'-'+_0x360233+'/'+_0x4dfc0c)['json'](_0x24c16f);}return null;};}function patchUpdates(_0x2a8602){return function(_0x1e526e){try{jsonpatch['apply'](_0x1e526e,_0x2a8602,!![]);}catch(_0x2e33e1){return BPromise[_0x039d('0x20')](_0x2e33e1);}return _0x1e526e['save']();};}function saveUpdates(_0x6e1cb9,_0x15dcaa){return function(_0xd5c776){if(_0xd5c776){return _0xd5c776[_0x039d('0x21')](_0x6e1cb9)[_0x039d('0x22')](function(_0x5b9ade){return _0x5b9ade;});}return null;};}function removeEntity(_0x2f21b7,_0x7e230f){return function(_0x15b103){if(_0x15b103){return _0x15b103['destroy']()[_0x039d('0x22')](function(){var _0x4a3177=_0x15b103[_0x039d('0x23')]({'plain':!![]});var _0x109b2b=_0x039d('0x24');return db['UserProfileResource'][_0x039d('0x25')]({'where':{'type':_0x109b2b,'resourceId':_0x4a3177['id']}})[_0x039d('0x22')](function(){return _0x15b103;});})[_0x039d('0x22')](function(){_0x2f21b7[_0x039d('0x19')](0xcc)[_0x039d('0x1a')]();});}};}function handleEntityNotFound(_0x1ef877,_0x3ad778){return function(_0x170e34){if(!_0x170e34){_0x1ef877[_0x039d('0x18')](0x194);}return _0x170e34;};}function handleError(_0x9da588,_0x33f704){_0x33f704=_0x33f704||0x1f4;return function(_0x38ff1e){logger[_0x039d('0x26')](_0x38ff1e[_0x039d('0x27')]);if(_0x38ff1e[_0x039d('0x28')]){delete _0x38ff1e[_0x039d('0x28')];}_0x9da588[_0x039d('0x19')](_0x33f704)[_0x039d('0x29')](_0x38ff1e);};}exports[_0x039d('0x2a')]=function(_0xf477c5,_0x1f89a5){var _0xf074d8={},_0xf32a01={},_0x2eef2b={'count':0x0,'rows':[]};var _0x1babe4=_[_0x039d('0x2b')](db['JscriptyProject']['rawAttributes'],function(_0x12ee85){return{'name':_0x12ee85['fieldName'],'type':_0x12ee85['type'][_0x039d('0x2c')]};});_0xf32a01[_0x039d('0x2d')]=_[_0x039d('0x2b')](_0x1babe4,_0x039d('0x28'));_0xf32a01[_0x039d('0x2e')]=_[_0x039d('0x2f')](_0xf477c5['query']);_0xf32a01['filters']=_[_0x039d('0x30')](_0xf32a01[_0x039d('0x2d')],_0xf32a01['query']);_0xf074d8[_0x039d('0x31')]=_[_0x039d('0x30')](_0xf32a01['model'],qs[_0x039d('0x32')](_0xf477c5[_0x039d('0x2e')][_0x039d('0x32')]));_0xf074d8[_0x039d('0x31')]=_0xf074d8['attributes']['length']?_0xf074d8[_0x039d('0x31')]:_0xf32a01[_0x039d('0x2d')];if(!_0xf477c5[_0x039d('0x2e')][_0x039d('0x33')](_0x039d('0x34'))){_0xf074d8['limit']=qs[_0x039d('0x1d')](_0xf477c5[_0x039d('0x2e')][_0x039d('0x1d')]);_0xf074d8[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0xf477c5['query'][_0x039d('0x1e')]);}_0xf074d8[_0x039d('0x35')]=qs[_0x039d('0x36')](_0xf477c5['query'][_0x039d('0x36')]);_0xf074d8[_0x039d('0x37')]=qs[_0x039d('0x38')](_[_0x039d('0x39')](_0xf477c5['query'],_0xf32a01[_0x039d('0x38')]),_0x1babe4);if(_0xf477c5[_0x039d('0x2e')][_0x039d('0x3a')]){_0xf074d8[_0x039d('0x37')]=_['merge'](_0xf074d8['where'],{'$or':_[_0x039d('0x2b')](_0x1babe4,function(_0x1b83ba){if(_0x1b83ba[_0x039d('0x3b')]!==_0x039d('0x3c')){var _0xbb1a62={};_0xbb1a62[_0x1b83ba['name']]={'$like':'%'+_0xf477c5[_0x039d('0x2e')]['filter']+'%'};return _0xbb1a62;}})});}_0xf074d8=_[_0x039d('0x3d')]({},_0xf074d8,_0xf477c5['options']);var _0x40df67={'where':_0xf074d8[_0x039d('0x37')]};return db[_0x039d('0x3e')][_0x039d('0x3f')](_0x40df67)['then'](function(_0x397d9e){_0x2eef2b[_0x039d('0x3f')]=_0x397d9e;if(_0xf477c5['query'][_0x039d('0x40')]){_0xf074d8[_0x039d('0x41')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0xf074d8);})[_0x039d('0x22')](function(_0x4485dc){_0x2eef2b['rows']=_0x4485dc;return _0x2eef2b;})[_0x039d('0x22')](respondWithFilteredResult(_0x1f89a5,_0xf074d8))[_0x039d('0x42')](handleError(_0x1f89a5,null));};exports[_0x039d('0x43')]=function(_0x13e74c,_0x3c39ec){var _0x35da4d={'raw':![],'where':{'id':_0x13e74c[_0x039d('0x44')]['id']}},_0x18f09e={};_0x18f09e['model']=_['keys'](db['JscriptyProject'][_0x039d('0x45')]);_0x18f09e[_0x039d('0x2e')]=_['keys'](_0x13e74c[_0x039d('0x2e')]);_0x18f09e[_0x039d('0x38')]=_[_0x039d('0x30')](_0x18f09e[_0x039d('0x2d')],_0x18f09e[_0x039d('0x2e')]);_0x35da4d['attributes']=_[_0x039d('0x30')](_0x18f09e[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x13e74c[_0x039d('0x2e')]['fields']));_0x35da4d[_0x039d('0x31')]=_0x35da4d[_0x039d('0x31')]['length']?_0x35da4d['attributes']:_0x18f09e['model'];if(_0x13e74c[_0x039d('0x2e')]['includeAll']){_0x35da4d[_0x039d('0x41')]=[{'all':!![]}];}_0x35da4d=_[_0x039d('0x3d')]({},_0x35da4d,_0x13e74c[_0x039d('0x46')]);return db[_0x039d('0x3e')]['find'](_0x35da4d)[_0x039d('0x22')](handleEntityNotFound(_0x3c39ec,null))[_0x039d('0x22')](respondWithResult(_0x3c39ec,null))[_0x039d('0x42')](handleError(_0x3c39ec,null));};exports['create']=function(_0x207835,_0x763622){return db[_0x039d('0x3e')][_0x039d('0x47')](_0x207835[_0x039d('0x48')],{})[_0x039d('0x22')](function(_0x11642b){var _0x1efc9e=_0x207835[_0x039d('0x49')]['get']({'plain':!![]});if(!_0x1efc9e)throw new Error(_0x039d('0x4a'));if(_0x1efc9e[_0x039d('0x4b')]===_0x039d('0x49')){var _0x6a7798=_0x11642b[_0x039d('0x23')]({'plain':!![]});var _0x43c3f5=_0x039d('0x24');return db[_0x039d('0x4c')][_0x039d('0x4d')]({'where':{'name':_0x43c3f5,'userProfileId':_0x1efc9e['userProfileId']},'raw':!![]})[_0x039d('0x22')](function(_0x4f6323){if(_0x4f6323&&_0x4f6323[_0x039d('0x4e')]===0x0){return db['UserProfileResource'][_0x039d('0x47')]({'name':_0x6a7798[_0x039d('0x28')],'resourceId':_0x6a7798['id'],'type':_0x4f6323['name'],'sectionId':_0x4f6323['id']},{})['then'](function(){return _0x11642b;});}else{return _0x11642b;}})[_0x039d('0x42')](function(_0x226628){logger[_0x039d('0x26')](_0x039d('0x4f'),_0x226628);throw _0x226628;});}return _0x11642b;})[_0x039d('0x22')](respondWithResult(_0x763622,0xc9))['catch'](handleError(_0x763622,null));};exports['clone']=function(_0x482c77,_0x3613a5){var _0x56834c={'where':{'id':_0x482c77['params']['id']}},_0x45cd5b={};_0x45cd5b[_0x039d('0x2d')]=_[_0x039d('0x2f')](db['JscriptyProject'][_0x039d('0x45')]);_0x56834c[_0x039d('0x31')]=_['intersection'](_0x45cd5b[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x482c77[_0x039d('0x2e')][_0x039d('0x32')]));_0x56834c[_0x039d('0x31')]=_0x56834c[_0x039d('0x31')][_0x039d('0x50')]?_0x56834c[_0x039d('0x31')]:_0x45cd5b[_0x039d('0x2d')];if(_0x482c77[_0x039d('0x2e')][_0x039d('0x40')]){_0x56834c[_0x039d('0x41')]=[{'all':!![]}];}_0x56834c=_['merge']({},_0x56834c,_0x482c77[_0x039d('0x46')]);return db[_0x039d('0x3e')][_0x039d('0x4d')](_0x56834c)[_0x039d('0x22')](handleEntityNotFound(_0x3613a5,null))[_0x039d('0x22')](function(_0x56b61c){if(_0x56b61c){var _0x4f8559=_0x56b61c[_0x039d('0x23')]({'plain':!![]});_0x4f8559=qs['omit'](_0x4f8559,['id','createdAt',_0x039d('0x51')]);_0x482c77[_0x039d('0x48')]=_['omit'](_0x482c77[_0x039d('0x48')],['id',_0x039d('0x52'),'updatedAt']);return db[_0x039d('0x3e')][_0x039d('0x47')](_[_0x039d('0x3d')](_0x4f8559,_0x482c77['body']),{'include':_0x482c77[_0x039d('0x2e')][_0x039d('0x40')]?[{'all':!![]}]:undefined})[_0x039d('0x22')](function(_0x4729dc){var _0x536bce=_0x482c77['user'][_0x039d('0x23')]({'plain':!![]});if(!_0x536bce)throw new Error(_0x039d('0x4a'));if(_0x536bce[_0x039d('0x4b')]===_0x039d('0x49')){var _0x44ab8a=_0x4729dc[_0x039d('0x23')]({'plain':!![]});var _0x5b3083=_0x039d('0x24');return db[_0x039d('0x4c')][_0x039d('0x4d')]({'where':{'name':_0x5b3083,'userProfileId':_0x536bce['userProfileId']},'raw':!![]})[_0x039d('0x22')](function(_0x14ed0f){if(_0x14ed0f&&_0x14ed0f[_0x039d('0x4e')]===0x0){return db[_0x039d('0x53')][_0x039d('0x47')]({'name':_0x44ab8a[_0x039d('0x28')],'resourceId':_0x44ab8a['id'],'type':_0x14ed0f['name'],'sectionId':_0x14ed0f['id']},{})[_0x039d('0x22')](function(){return _0x4729dc;});}else{return _0x4729dc;}})['catch'](function(_0x5c29b0){logger[_0x039d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c29b0);throw _0x5c29b0;});}return _0x4729dc;});}})[_0x039d('0x22')](respondWithResult(_0x3613a5,0xc9))[_0x039d('0x42')](handleError(_0x3613a5,null));};exports['update']=function(_0x338a03,_0x2fbf5f){if(_0x338a03['body']['id']){delete _0x338a03[_0x039d('0x48')]['id'];}return db['JscriptyProject'][_0x039d('0x4d')]({'where':{'id':_0x338a03[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x2fbf5f,null))[_0x039d('0x22')](saveUpdates(_0x338a03[_0x039d('0x48')],null))[_0x039d('0x22')](respondWithResult(_0x2fbf5f,null))[_0x039d('0x42')](handleError(_0x2fbf5f,null));};exports[_0x039d('0x25')]=function(_0x2eeb5d,_0x3f8fc2){return db['JscriptyProject'][_0x039d('0x4d')]({'where':{'id':_0x2eeb5d[_0x039d('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f8fc2,null))[_0x039d('0x22')](removeEntity(_0x3f8fc2,null))[_0x039d('0x42')](handleError(_0x3f8fc2,null));};exports[_0x039d('0x54')]=function(_0x3de906,_0xb8c3a0,_0x345e23){var _0x6bfc15={'raw':!![],'where':{}};var _0x4256a8={};var _0x12d02c={'count':0x0,'rows':[]};return db[_0x039d('0x3e')]['findOne']({'where':{'id':_0x3de906[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0xb8c3a0,null))[_0x039d('0x22')](function(_0x2304b3){if(_0x2304b3){_0x4256a8[_0x039d('0x2d')]=_[_0x039d('0x2f')](db[_0x039d('0x55')]['rawAttributes']);_0x4256a8[_0x039d('0x2e')]=_['keys'](_0x3de906[_0x039d('0x2e')]);_0x4256a8['filters']=_['intersection'](_0x4256a8[_0x039d('0x2d')],_0x4256a8[_0x039d('0x2e')]);_0x6bfc15[_0x039d('0x31')]=_['intersection'](_0x4256a8[_0x039d('0x2d')],qs['fields'](_0x3de906['query'][_0x039d('0x32')]));_0x6bfc15[_0x039d('0x31')]=_0x6bfc15['attributes'][_0x039d('0x50')]?_0x6bfc15['attributes']:_0x4256a8[_0x039d('0x2d')];if(!_0x3de906[_0x039d('0x2e')]['hasOwnProperty'](_0x039d('0x34'))){_0x6bfc15[_0x039d('0x1d')]=qs['limit'](_0x3de906[_0x039d('0x2e')][_0x039d('0x1d')]);_0x6bfc15['offset']=qs[_0x039d('0x1e')](_0x3de906[_0x039d('0x2e')][_0x039d('0x1e')]);}_0x6bfc15['order']=qs['sort'](_0x3de906[_0x039d('0x2e')][_0x039d('0x36')]);_0x6bfc15[_0x039d('0x37')]=qs[_0x039d('0x38')](_[_0x039d('0x39')](_0x3de906[_0x039d('0x2e')],_0x4256a8[_0x039d('0x38')]));_0x6bfc15[_0x039d('0x37')][_0x039d('0x56')]=_0x2304b3['id'];if(_0x3de906[_0x039d('0x2e')]['filter']){_0x6bfc15[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x6bfc15['where'],{'$or':_['map'](_0x6bfc15[_0x039d('0x31')],function(_0x2dc97f){var _0x3172e0={};_0x3172e0[_0x2dc97f]={'$like':'%'+_0x3de906[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x3172e0;})});}_0x6bfc15=_[_0x039d('0x3d')]({},_0x6bfc15,_0x3de906[_0x039d('0x46')]);return db[_0x039d('0x55')][_0x039d('0x3f')]({'where':_0x6bfc15[_0x039d('0x37')]})[_0x039d('0x22')](function(_0x298786){_0x12d02c[_0x039d('0x3f')]=_0x298786;if(_0x3de906['query']['includeAll']){_0x6bfc15[_0x039d('0x41')]=[{'all':!![]}];}return db[_0x039d('0x55')]['findAll'](_0x6bfc15);})[_0x039d('0x22')](function(_0x4c7d3e){_0x12d02c[_0x039d('0x57')]=_0x4c7d3e;return _0x12d02c;});}})[_0x039d('0x22')](respondWithFilteredResult(_0xb8c3a0,_0x6bfc15))[_0x039d('0x42')](handleError(_0xb8c3a0,null));};exports['getAnswers']=function(_0x4bbefe,_0x285da7,_0x5595a0){var _0x322b44={'raw':!![],'where':{}};var _0x5e451b={};var _0x102d68={'count':0x0,'rows':[]};return db[_0x039d('0x3e')]['findOne']({'where':{'id':_0x4bbefe[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x285da7,null))[_0x039d('0x22')](function(_0x3c95ea){if(_0x3c95ea){_0x5e451b['model']=_[_0x039d('0x2f')](db[_0x039d('0x58')][_0x039d('0x45')]);_0x5e451b[_0x039d('0x2e')]=_[_0x039d('0x2f')](_0x4bbefe[_0x039d('0x2e')]);_0x5e451b[_0x039d('0x38')]=_[_0x039d('0x30')](_0x5e451b[_0x039d('0x2d')],_0x5e451b[_0x039d('0x2e')]);_0x322b44[_0x039d('0x31')]=_['intersection'](_0x5e451b[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x4bbefe[_0x039d('0x2e')][_0x039d('0x32')]));_0x322b44[_0x039d('0x31')]=_0x322b44[_0x039d('0x31')]['length']?_0x322b44[_0x039d('0x31')]:_0x5e451b['model'];if(!_0x4bbefe['query']['hasOwnProperty'](_0x039d('0x34'))){_0x322b44[_0x039d('0x1d')]=qs[_0x039d('0x1d')](_0x4bbefe[_0x039d('0x2e')][_0x039d('0x1d')]);_0x322b44[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0x4bbefe['query'][_0x039d('0x1e')]);}_0x322b44[_0x039d('0x35')]=qs['sort'](_0x4bbefe[_0x039d('0x2e')][_0x039d('0x36')]);_0x322b44[_0x039d('0x37')]=qs['filters'](_['pick'](_0x4bbefe[_0x039d('0x2e')],_0x5e451b[_0x039d('0x38')]));_0x322b44[_0x039d('0x37')]['ProjectId']=_0x3c95ea['id'];if(_0x4bbefe[_0x039d('0x2e')][_0x039d('0x3a')]){_0x322b44[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x322b44[_0x039d('0x37')],{'$or':_[_0x039d('0x2b')](_0x322b44[_0x039d('0x31')],function(_0x1d42c8){var _0x3a6bb4={};_0x3a6bb4[_0x1d42c8]={'$like':'%'+_0x4bbefe[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x3a6bb4;})});}_0x322b44=_[_0x039d('0x3d')]({},_0x322b44,_0x4bbefe[_0x039d('0x46')]);return db[_0x039d('0x58')][_0x039d('0x3f')]({'where':_0x322b44[_0x039d('0x37')]})[_0x039d('0x22')](function(_0x2d7e97){_0x102d68[_0x039d('0x3f')]=_0x2d7e97;if(_0x4bbefe[_0x039d('0x2e')][_0x039d('0x40')]){_0x322b44[_0x039d('0x41')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x039d('0x59')](_0x322b44);})[_0x039d('0x22')](function(_0x3f8be2){_0x102d68['rows']=_0x3f8be2;return _0x102d68;});}})[_0x039d('0x22')](respondWithFilteredResult(_0x285da7,_0x322b44))[_0x039d('0x42')](handleError(_0x285da7,null));};function char(_0xcfcf5b){return'number'===typeof _0xcfcf5b?String[_0x039d('0x5a')][_0x039d('0x5b')](null,arguments):_0xcfcf5b;}function needsEncapsulation(_0x17200c){return!!_0x17200c&&(_0x17200c['toString']()[_0x039d('0x5c')](char(0xd))>=0x0||_0x17200c[_0x039d('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x17200c[_0x039d('0x5d')]()[_0x039d('0x5c')](char(0x2c))>=0x0||_0x17200c[_0x039d('0x5d')]()[_0x039d('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x306246){var _0xa3095b=char(0x22),_0x1004c4='\x5c'+char(0x22),_0x55f43d=_0x306246[_0x039d('0x5d')]()['replace'](new RegExp(_0xa3095b,'g'),_0x1004c4);return _0xa3095b+_0x55f43d+_0xa3095b;}exports[_0x039d('0x5e')]=function(_0x330ea2,_0x4b7df2,_0xb7f1c2){var _0x5cb4dc,_0x1a1f6b;var _0x2af5c4={'where':{'ProjectId':_0x330ea2[_0x039d('0x44')]['id']}};if(_0x330ea2['query'][_0x039d('0x5f')]){_0x2af5c4[_0x039d('0x37')]['starttime']=JSON[_0x039d('0x60')](_0x330ea2['query'][_0x039d('0x5f')]);}return db[_0x039d('0x55')][_0x039d('0x59')](_0x2af5c4)[_0x039d('0x22')](handleEntityNotFound(_0x4b7df2,null))['then'](function(_0x41bca6){if(_0x41bca6){_0x5cb4dc=_0x41bca6;return db[_0x039d('0x61')][_0x039d('0x59')]({'where':{'SessionId':{'$in':_[_0x039d('0x2b')](_0x5cb4dc,'id')},'ProjectId':_0x330ea2[_0x039d('0x44')]['id']},'order':_0x039d('0x62')});}})['then'](handleEntityNotFound(_0x4b7df2,null))[_0x039d('0x22')](function(_0x29eb45){if(_0x29eb45){_0x1a1f6b=_0x29eb45;var _0x278ae8={};for(var _0x236efd=0x0,_0x217e56=_0x1a1f6b[_0x039d('0x50')];_0x236efd<_0x217e56;_0x236efd++){if(!_0x278ae8[_0x039d('0x33')](_0x1a1f6b[_0x236efd][_0x039d('0x63')])){_0x278ae8[_0x1a1f6b[_0x236efd][_0x039d('0x63')]]=needsEncapsulation(_0x1a1f6b[_0x236efd][_0x039d('0x64')])?encapsulate(_0x1a1f6b[_0x236efd][_0x039d('0x64')]):_0x1a1f6b[_0x236efd][_0x039d('0x64')];}}var _0x34357c=[],_0x3950da={};for(var _0x42b01d=0x0,_0x27be2b=_0x5cb4dc['length'];_0x42b01d<_0x27be2b;_0x42b01d++){_0x3950da={'ProjectId':_0x330ea2[_0x039d('0x44')]['id'],'SessionId':_0x5cb4dc[_0x42b01d]['id'],'StartTime':moment(_0x5cb4dc[_0x42b01d]['starttime'])[_0x039d('0x65')](_0x039d('0x66'))};for(var _0x1d245c=0x0,_0x2f602e=_0x1a1f6b[_0x039d('0x50')];_0x1d245c<_0x2f602e;_0x1d245c++){if(_0x1a1f6b[_0x1d245c][_0x039d('0x67')]==_0x5cb4dc[_0x42b01d]['id']&&_0x278ae8['hasOwnProperty'](_0x1a1f6b[_0x1d245c][_0x039d('0x63')])){_0x3950da[_0x278ae8[_0x1a1f6b[_0x1d245c][_0x039d('0x63')]]]=_0x1a1f6b[_0x1d245c][_0x039d('0x68')];}}for(var _0x281c42 in _0x278ae8){if(!_0x3950da[_0x039d('0x33')](_0x278ae8[_0x281c42])){_0x3950da[_0x278ae8[_0x281c42]]=null;}}_0x34357c[_0x039d('0x69')](_0x3950da);}return _0x34357c;}})[_0x039d('0x22')](function(_0x1afcb9){if(!_[_0x039d('0x6a')](_0x1afcb9)){var _0x1a262c=toCsv(_0x1afcb9);var _0xc0280d=Date[_0x039d('0x6b')]();fs['writeFileSync'](util[_0x039d('0x65')](_0x039d('0x6c'),_0x330ea2['params']['id'],_0xc0280d),_0x1a262c);_0x4b7df2[_0x039d('0x6d')]('Content-disposition','attachment;\x20filename='+util[_0x039d('0x65')](_0x039d('0x6e'),_0x330ea2[_0x039d('0x44')]['id'],_0xc0280d));_0x4b7df2[_0x039d('0x6d')](_0x039d('0x6f'),_0x039d('0x70'));return _0x4b7df2[_0x039d('0x71')](util[_0x039d('0x65')](_0x039d('0x6c'),_0x330ea2[_0x039d('0x44')]['id'],_0xc0280d));}else{return _0x4b7df2['sendStatus'](0xcc);}})[_0x039d('0x42')](handleError(_0x4b7df2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index d9aaff6..0201449 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 _0xcb41=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash'];(function(_0x207696,_0x1cf674){var _0x4060f3=function(_0x3677dc){while(--_0x3677dc){_0x207696['push'](_0x207696['shift']());}};_0x4060f3(++_0x1cf674);}(_0xcb41,0x1df));var _0x1cb4=function(_0x4b479e,_0x5b1736){_0x4b479e=_0x4b479e-0x0;var _0x3064ad=_0xcb41[_0x4b479e];return _0x3064ad;};'use strict';var _=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var logger=require(_0x1cb4('0x2'))(_0x1cb4('0x3'));var moment=require('moment');var BPromise=require(_0x1cb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb4('0x5'));var rimraf=require(_0x1cb4('0x6'));var config=require(_0x1cb4('0x7'));var attributes=require(_0x1cb4('0x8'));module[_0x1cb4('0x9')]=function(_0x547f4,_0x2eaeb4){return _0x547f4[_0x1cb4('0xa')]('JscriptyProject',attributes,{'tableName':_0x1cb4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x972c=['api','bluebird','request-promise','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','../../config/logger'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x972c,0xf2));var _0xc972=function(_0x4b5bbc,_0x21d9ef){_0x4b5bbc=_0x4b5bbc-0x0;var _0x4ec1e5=_0x972c[_0x4b5bbc];return _0x4ec1e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc972('0x0'))(_0xc972('0x1'));var moment=require('moment');var BPromise=require(_0xc972('0x2'));var rp=require(_0xc972('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc972('0x4'));var attributes=require(_0xc972('0x5'));module[_0xc972('0x6')]=function(_0x5dd2c8,_0xd70261){return _0x5dd2c8['define'](_0xc972('0x7'),attributes,{'tableName':_0xc972('0x8'),'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 000f638..b8b3eb6 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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x183c8a,_0x3317e7){var _0x85385a=function(_0x3366da){while(--_0x3366da){_0x183c8a['push'](_0x183c8a['shift']());}};_0x85385a(++_0x3317e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x355de0,_0x3e1d21){var _0xad0de2=function(_0x5ac42d){while(--_0x5ac42d){_0x355de0['push'](_0x355de0['shift']());}};_0xad0de2(++_0x3e1d21);}(_0xf4eb,0xec));var _0xbf4e=function(_0x46b7e2,_0x2fea2f){_0x46b7e2=_0x46b7e2-0x0;var _0x6476ff=_0xf4eb[_0x46b7e2];return _0x6476ff;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d6c2ebb..f28e7ac 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 _0x9b20=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x9b20,0xcc));var _0x09b2=function(_0x2ac42c,_0x400eff){_0x2ac42c=_0x2ac42c-0x0;var _0x29b7f3=_0x9b20[_0x2ac42c];return _0x29b7f3;};'use strict';var multer=require(_0x09b2('0x0'));var util=require('util');var path=require(_0x09b2('0x1'));var timeout=require(_0x09b2('0x2'));var express=require(_0x09b2('0x3'));var router=express[_0x09b2('0x4')]();var fs_extra=require(_0x09b2('0x5'));var auth=require(_0x09b2('0x6'));var interaction=require(_0x09b2('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x09b2('0x8')]('/',auth[_0x09b2('0x9')](),controller[_0x09b2('0xa')]);router[_0x09b2('0x8')](_0x09b2('0xb'),auth[_0x09b2('0x9')](),controller[_0x09b2('0xc')]);router[_0x09b2('0x8')](_0x09b2('0xd'),auth[_0x09b2('0x9')](),controller[_0x09b2('0xe')]);router[_0x09b2('0xf')]('/',auth[_0x09b2('0x9')](),controller[_0x09b2('0x10')]);router[_0x09b2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x09b2('0x12')]);router['delete'](_0x09b2('0xd'),auth[_0x09b2('0x9')](),controller[_0x09b2('0x13')]);module[_0x09b2('0x14')]=router; \ No newline at end of file +var _0xe790=['/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x384169,_0x76689d){var _0x253608=function(_0x58f162){while(--_0x58f162){_0x384169['push'](_0x384169['shift']());}};_0x253608(++_0x76689d);}(_0xe790,0x19a));var _0x0e79=function(_0x3af28f,_0x25c919){_0x3af28f=_0x3af28f-0x0;var _0x105195=_0xe790[_0x3af28f];return _0x105195;};'use strict';var multer=require(_0x0e79('0x0'));var util=require(_0x0e79('0x1'));var path=require(_0x0e79('0x2'));var timeout=require(_0x0e79('0x3'));var express=require(_0x0e79('0x4'));var router=express[_0x0e79('0x5')]();var fs_extra=require(_0x0e79('0x6'));var auth=require(_0x0e79('0x7'));var interaction=require(_0x0e79('0x8'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x0e79('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0e79('0x9')](_0x0e79('0xa'),auth[_0x0e79('0xb')](),controller['describe']);router[_0x0e79('0x9')](_0x0e79('0xc'),auth[_0x0e79('0xb')](),controller[_0x0e79('0xd')]);router[_0x0e79('0xe')]('/',auth[_0x0e79('0xb')](),controller[_0x0e79('0xf')]);router[_0x0e79('0x10')](_0x0e79('0xc'),auth[_0x0e79('0xb')](),controller[_0x0e79('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0e79('0x12')]);module[_0x0e79('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index cde02d2..1dedbed 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x304e3b,_0x4003bd){_0x304e3b=_0x304e3b-0x0;var _0x5a59a5=_0x7a54[_0x304e3b];return _0x5a59a5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x115446,_0x94b390){_0x115446=_0x115446-0x0;var _0x2fb1f3=_0x7a54[_0x115446];return _0x2fb1f3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index f44bffc..7cf140a 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 _0xea88=['sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x55f98b,_0xeee6f7){var _0x5e70dc=function(_0x3b14c8){while(--_0x3b14c8){_0x55f98b['push'](_0x55f98b['shift']());}};_0x5e70dc(++_0xeee6f7);}(_0xea88,0xcc));var _0x8ea8=function(_0x18a078,_0x59c95e){_0x18a078=_0x18a078-0x0;var _0x370003=_0xea88[_0x18a078];return _0x370003;};'use strict';var emlformat=require(_0x8ea8('0x0'));var rimraf=require(_0x8ea8('0x1'));var zipdir=require(_0x8ea8('0x2'));var jsonpatch=require(_0x8ea8('0x3'));var rp=require(_0x8ea8('0x4'));var moment=require(_0x8ea8('0x5'));var BPromise=require(_0x8ea8('0x6'));var Mustache=require(_0x8ea8('0x7'));var util=require('util');var path=require(_0x8ea8('0x8'));var sox=require(_0x8ea8('0x9'));var csv=require('to-csv');var ejs=require(_0x8ea8('0xa'));var fs=require('fs');var fs_extra=require(_0x8ea8('0xb'));var _=require(_0x8ea8('0xc'));var squel=require(_0x8ea8('0xd'));var crypto=require('crypto');var jsforce=require(_0x8ea8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8ea8('0xf'));var querystring=require('querystring');var Papa=require(_0x8ea8('0x10'));var Redis=require(_0x8ea8('0x11'));var authService=require(_0x8ea8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea8('0x13'))(_0x8ea8('0x14'));var utils=require('../../config/utils');var config=require(_0x8ea8('0x15'));var licenseUtil=require(_0x8ea8('0x16'));var db=require(_0x8ea8('0x17'))['db'];function respondWithStatusCode(_0x304f27,_0x16564b){_0x16564b=_0x16564b||0xcc;return function(_0x12debc){if(_0x12debc){return _0x304f27[_0x8ea8('0x18')](_0x16564b);}return _0x304f27[_0x8ea8('0x19')](_0x16564b)['end']();};}function respondWithResult(_0x21ccf8,_0x426564){_0x426564=_0x426564||0xc8;return function(_0xa35ac2){if(_0xa35ac2){return _0x21ccf8[_0x8ea8('0x19')](_0x426564)['json'](_0xa35ac2);}};}function respondWithFilteredResult(_0x4a136a,_0x4449b9){return function(_0x5098f3){if(_0x5098f3){var _0xf4d377=typeof _0x4449b9[_0x8ea8('0x1a')]===_0x8ea8('0x1b')&&typeof _0x4449b9['limit']===_0x8ea8('0x1b');var _0x1d9938=_0x5098f3[_0x8ea8('0x1c')];var _0x29de8b=_0xf4d377?0x0:_0x4449b9[_0x8ea8('0x1a')];var _0x2bce5d=_0xf4d377?_0x5098f3['count']:_0x4449b9[_0x8ea8('0x1a')]+_0x4449b9[_0x8ea8('0x1d')];var _0x539fec;if(_0x2bce5d>=_0x1d9938){_0x2bce5d=_0x1d9938;_0x539fec=0xc8;}else{_0x539fec=0xce;}_0x4a136a[_0x8ea8('0x19')](_0x539fec);return _0x4a136a[_0x8ea8('0x1e')]('Content-Range',_0x29de8b+'-'+_0x2bce5d+'/'+_0x1d9938)['json'](_0x5098f3);}return null;};}function patchUpdates(_0xc83f0b){return function(_0x2d20ae){try{jsonpatch[_0x8ea8('0x1f')](_0x2d20ae,_0xc83f0b,!![]);}catch(_0x5d4411){return BPromise[_0x8ea8('0x20')](_0x5d4411);}return _0x2d20ae[_0x8ea8('0x21')]();};}function saveUpdates(_0x2d1ec0,_0x13d617){return function(_0x3b56f1){if(_0x3b56f1){return _0x3b56f1[_0x8ea8('0x22')](_0x2d1ec0)[_0x8ea8('0x23')](function(_0x482669){return _0x482669;});}return null;};}function removeEntity(_0x5ec889,_0x3d422c){return function(_0x2aceec){if(_0x2aceec){return _0x2aceec[_0x8ea8('0x24')]()[_0x8ea8('0x23')](function(){_0x5ec889['status'](0xcc)[_0x8ea8('0x25')]();});}};}function handleEntityNotFound(_0x534529,_0x39f87b){return function(_0x2d1b2d){if(!_0x2d1b2d){_0x534529[_0x8ea8('0x18')](0x194);}return _0x2d1b2d;};}function handleError(_0xdbada7,_0x2fed6d){_0x2fed6d=_0x2fed6d||0x1f4;return function(_0x68c2d2){logger[_0x8ea8('0x26')](_0x68c2d2[_0x8ea8('0x27')]);if(_0x68c2d2['name']){delete _0x68c2d2[_0x8ea8('0x28')];}_0xdbada7[_0x8ea8('0x19')](_0x2fed6d)[_0x8ea8('0x29')](_0x68c2d2);};}exports[_0x8ea8('0x2a')]=function(_0x743616,_0x374df7){var _0x308a5e={},_0x277a4a={},_0x4b3ee7={'count':0x0,'rows':[]};var _0x407ef5=_[_0x8ea8('0x2b')](db[_0x8ea8('0x2c')]['rawAttributes'],function(_0x36aa78){return{'name':_0x36aa78[_0x8ea8('0x2d')],'type':_0x36aa78[_0x8ea8('0x2e')][_0x8ea8('0x2f')]};});_0x277a4a['model']=_[_0x8ea8('0x2b')](_0x407ef5,_0x8ea8('0x28'));_0x277a4a[_0x8ea8('0x30')]=_[_0x8ea8('0x31')](_0x743616['query']);_0x277a4a['filters']=_[_0x8ea8('0x32')](_0x277a4a['model'],_0x277a4a[_0x8ea8('0x30')]);_0x308a5e[_0x8ea8('0x33')]=_[_0x8ea8('0x32')](_0x277a4a[_0x8ea8('0x34')],qs[_0x8ea8('0x35')](_0x743616['query'][_0x8ea8('0x35')]));_0x308a5e[_0x8ea8('0x33')]=_0x308a5e[_0x8ea8('0x33')][_0x8ea8('0x36')]?_0x308a5e[_0x8ea8('0x33')]:_0x277a4a['model'];if(!_0x743616[_0x8ea8('0x30')]['hasOwnProperty'](_0x8ea8('0x37'))){_0x308a5e['limit']=qs[_0x8ea8('0x1d')](_0x743616['query'][_0x8ea8('0x1d')]);_0x308a5e[_0x8ea8('0x1a')]=qs['offset'](_0x743616[_0x8ea8('0x30')][_0x8ea8('0x1a')]);}_0x308a5e[_0x8ea8('0x38')]=qs['sort'](_0x743616['query'][_0x8ea8('0x39')]);_0x308a5e[_0x8ea8('0x3a')]=qs[_0x8ea8('0x3b')](_['pick'](_0x743616['query'],_0x277a4a[_0x8ea8('0x3b')]),_0x407ef5);if(_0x743616[_0x8ea8('0x30')][_0x8ea8('0x3c')]){_0x308a5e[_0x8ea8('0x3a')]=_[_0x8ea8('0x3d')](_0x308a5e[_0x8ea8('0x3a')],{'$or':_[_0x8ea8('0x2b')](_0x407ef5,function(_0x3f6700){if(_0x3f6700[_0x8ea8('0x2e')]!==_0x8ea8('0x3e')){var _0x139d38={};_0x139d38[_0x3f6700[_0x8ea8('0x28')]]={'$like':'%'+_0x743616[_0x8ea8('0x30')][_0x8ea8('0x3c')]+'%'};return _0x139d38;}})});}_0x308a5e=_[_0x8ea8('0x3d')]({},_0x308a5e,_0x743616[_0x8ea8('0x3f')]);var _0x4a0b7a={'where':_0x308a5e[_0x8ea8('0x3a')]};return db['JscriptyQuestionReport']['count'](_0x4a0b7a)['then'](function(_0x5e2447){_0x4b3ee7['count']=_0x5e2447;if(_0x743616[_0x8ea8('0x30')][_0x8ea8('0x40')]){_0x308a5e[_0x8ea8('0x41')]=[{'all':!![]}];}return db[_0x8ea8('0x2c')][_0x8ea8('0x42')](_0x308a5e);})[_0x8ea8('0x23')](function(_0x49fa31){_0x4b3ee7[_0x8ea8('0x43')]=_0x49fa31;return _0x4b3ee7;})[_0x8ea8('0x23')](respondWithFilteredResult(_0x374df7,_0x308a5e))[_0x8ea8('0x44')](handleError(_0x374df7,null));};exports[_0x8ea8('0x45')]=function(_0x5253ce,_0x55d713){var _0x58ee44={'raw':!![],'where':{'id':_0x5253ce[_0x8ea8('0x46')]['id']}},_0x3a7125={};_0x3a7125['model']=_[_0x8ea8('0x31')](db[_0x8ea8('0x2c')][_0x8ea8('0x47')]);_0x3a7125['query']=_[_0x8ea8('0x31')](_0x5253ce[_0x8ea8('0x30')]);_0x3a7125[_0x8ea8('0x3b')]=_[_0x8ea8('0x32')](_0x3a7125[_0x8ea8('0x34')],_0x3a7125[_0x8ea8('0x30')]);_0x58ee44[_0x8ea8('0x33')]=_['intersection'](_0x3a7125[_0x8ea8('0x34')],qs[_0x8ea8('0x35')](_0x5253ce[_0x8ea8('0x30')][_0x8ea8('0x35')]));_0x58ee44[_0x8ea8('0x33')]=_0x58ee44[_0x8ea8('0x33')][_0x8ea8('0x36')]?_0x58ee44['attributes']:_0x3a7125[_0x8ea8('0x34')];if(_0x5253ce['query'][_0x8ea8('0x40')]){_0x58ee44[_0x8ea8('0x41')]=[{'all':!![]}];}_0x58ee44=_[_0x8ea8('0x3d')]({},_0x58ee44,_0x5253ce[_0x8ea8('0x3f')]);return db[_0x8ea8('0x2c')][_0x8ea8('0x48')](_0x58ee44)[_0x8ea8('0x23')](handleEntityNotFound(_0x55d713,null))[_0x8ea8('0x23')](respondWithResult(_0x55d713,null))['catch'](handleError(_0x55d713,null));};exports['create']=function(_0x3a761,_0x543ec4){return db[_0x8ea8('0x2c')][_0x8ea8('0x49')](_0x3a761[_0x8ea8('0x4a')],{})[_0x8ea8('0x23')](respondWithResult(_0x543ec4,0xc9))[_0x8ea8('0x44')](handleError(_0x543ec4,null));};exports['update']=function(_0x1adc79,_0x24a0da){if(_0x1adc79[_0x8ea8('0x4a')]['id']){delete _0x1adc79[_0x8ea8('0x4a')]['id'];}return db[_0x8ea8('0x2c')]['find']({'where':{'id':_0x1adc79[_0x8ea8('0x46')]['id']}})[_0x8ea8('0x23')](handleEntityNotFound(_0x24a0da,null))[_0x8ea8('0x23')](saveUpdates(_0x1adc79[_0x8ea8('0x4a')],null))[_0x8ea8('0x23')](respondWithResult(_0x24a0da,null))[_0x8ea8('0x44')](handleError(_0x24a0da,null));};exports[_0x8ea8('0x24')]=function(_0xfc54d2,_0x3994a0){return db[_0x8ea8('0x2c')][_0x8ea8('0x48')]({'where':{'id':_0xfc54d2[_0x8ea8('0x46')]['id']}})[_0x8ea8('0x23')](handleEntityNotFound(_0x3994a0,null))['then'](removeEntity(_0x3994a0,null))['catch'](handleError(_0x3994a0,null));};exports[_0x8ea8('0x4b')]=function(_0x4e4da1,_0x78dc56){return db[_0x8ea8('0x2c')]['describe']()[_0x8ea8('0x23')](respondWithResult(_0x78dc56,null))[_0x8ea8('0x44')](handleError(_0x78dc56,null));}; \ No newline at end of file +var _0x538d=['destroy','then','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','name','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply'];(function(_0x22f343,_0x45f2f1){var _0x4ed84c=function(_0x54d7e8){while(--_0x54d7e8){_0x22f343['push'](_0x22f343['shift']());}};_0x4ed84c(++_0x45f2f1);}(_0x538d,0x73));var _0xd538=function(_0x115afd,_0x509ec9){_0x115afd=_0x115afd-0x0;var _0x5d109e=_0x538d[_0x115afd];return _0x5d109e;};'use strict';var emlformat=require(_0xd538('0x0'));var rimraf=require(_0xd538('0x1'));var zipdir=require(_0xd538('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd538('0x3'));var moment=require(_0xd538('0x4'));var BPromise=require(_0xd538('0x5'));var Mustache=require('mustache');var util=require(_0xd538('0x6'));var path=require(_0xd538('0x7'));var sox=require(_0xd538('0x8'));var csv=require(_0xd538('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd538('0xa'));var squel=require('squel');var crypto=require(_0xd538('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd538('0xc'));var toCsv=require(_0xd538('0x9'));var querystring=require(_0xd538('0xd'));var Papa=require(_0xd538('0xe'));var Redis=require(_0xd538('0xf'));var authService=require(_0xd538('0x10'));var qs=require(_0xd538('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd538('0x12'));var logger=require(_0xd538('0x13'))(_0xd538('0x14'));var utils=require(_0xd538('0x15'));var config=require(_0xd538('0x16'));var licenseUtil=require(_0xd538('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d4286,_0x4edcde){_0x4edcde=_0x4edcde||0xcc;return function(_0x1afd4d){if(_0x1afd4d){return _0x3d4286[_0xd538('0x18')](_0x4edcde);}return _0x3d4286[_0xd538('0x19')](_0x4edcde)[_0xd538('0x1a')]();};}function respondWithResult(_0x2b66e1,_0x46b4ae){_0x46b4ae=_0x46b4ae||0xc8;return function(_0x422153){if(_0x422153){return _0x2b66e1[_0xd538('0x19')](_0x46b4ae)[_0xd538('0x1b')](_0x422153);}};}function respondWithFilteredResult(_0x5f037c,_0x18d7e3){return function(_0x4e0d81){if(_0x4e0d81){var _0x3338f8=typeof _0x18d7e3[_0xd538('0x1c')]===_0xd538('0x1d')&&typeof _0x18d7e3['limit']===_0xd538('0x1d');var _0x4c5377=_0x4e0d81[_0xd538('0x1e')];var _0xc5b009=_0x3338f8?0x0:_0x18d7e3['offset'];var _0x3ed2bd=_0x3338f8?_0x4e0d81[_0xd538('0x1e')]:_0x18d7e3[_0xd538('0x1c')]+_0x18d7e3['limit'];var _0x193daa;if(_0x3ed2bd>=_0x4c5377){_0x3ed2bd=_0x4c5377;_0x193daa=0xc8;}else{_0x193daa=0xce;}_0x5f037c['status'](_0x193daa);return _0x5f037c['set'](_0xd538('0x1f'),_0xc5b009+'-'+_0x3ed2bd+'/'+_0x4c5377)[_0xd538('0x1b')](_0x4e0d81);}return null;};}function patchUpdates(_0x2f5fd5){return function(_0x5c0e83){try{jsonpatch[_0xd538('0x20')](_0x5c0e83,_0x2f5fd5,!![]);}catch(_0x4eca04){return BPromise['reject'](_0x4eca04);}return _0x5c0e83['save']();};}function saveUpdates(_0x5a7c07,_0x184602){return function(_0xf9a6e9){if(_0xf9a6e9){return _0xf9a6e9['update'](_0x5a7c07)['then'](function(_0x3792f0){return _0x3792f0;});}return null;};}function removeEntity(_0x14c604,_0x5a6a15){return function(_0x483550){if(_0x483550){return _0x483550[_0xd538('0x21')]()[_0xd538('0x22')](function(){_0x14c604['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba0a6,_0x2b4c40){return function(_0x228456){if(!_0x228456){_0x3ba0a6[_0xd538('0x18')](0x194);}return _0x228456;};}function handleError(_0x415c17,_0x187216){_0x187216=_0x187216||0x1f4;return function(_0x350a46){logger[_0xd538('0x23')](_0x350a46[_0xd538('0x24')]);if(_0x350a46['name']){delete _0x350a46['name'];}_0x415c17[_0xd538('0x19')](_0x187216)[_0xd538('0x25')](_0x350a46);};}exports[_0xd538('0x26')]=function(_0x4955fd,_0x529c24){var _0x57c685={},_0x2174c8={},_0x10aad1={'count':0x0,'rows':[]};var _0x3f1db9=_[_0xd538('0x27')](db[_0xd538('0x28')][_0xd538('0x29')],function(_0x1759ec){return{'name':_0x1759ec[_0xd538('0x2a')],'type':_0x1759ec[_0xd538('0x2b')]['key']};});_0x2174c8['model']=_['map'](_0x3f1db9,_0xd538('0x2c'));_0x2174c8[_0xd538('0x2d')]=_[_0xd538('0x2e')](_0x4955fd[_0xd538('0x2d')]);_0x2174c8[_0xd538('0x2f')]=_['intersection'](_0x2174c8['model'],_0x2174c8[_0xd538('0x2d')]);_0x57c685[_0xd538('0x30')]=_[_0xd538('0x31')](_0x2174c8['model'],qs[_0xd538('0x32')](_0x4955fd[_0xd538('0x2d')][_0xd538('0x32')]));_0x57c685['attributes']=_0x57c685[_0xd538('0x30')][_0xd538('0x33')]?_0x57c685[_0xd538('0x30')]:_0x2174c8[_0xd538('0x34')];if(!_0x4955fd['query'][_0xd538('0x35')](_0xd538('0x36'))){_0x57c685[_0xd538('0x37')]=qs[_0xd538('0x37')](_0x4955fd[_0xd538('0x2d')]['limit']);_0x57c685[_0xd538('0x1c')]=qs[_0xd538('0x1c')](_0x4955fd[_0xd538('0x2d')][_0xd538('0x1c')]);}_0x57c685['order']=qs[_0xd538('0x38')](_0x4955fd[_0xd538('0x2d')][_0xd538('0x38')]);_0x57c685['where']=qs['filters'](_[_0xd538('0x39')](_0x4955fd[_0xd538('0x2d')],_0x2174c8[_0xd538('0x2f')]),_0x3f1db9);if(_0x4955fd['query'][_0xd538('0x3a')]){_0x57c685[_0xd538('0x3b')]=_[_0xd538('0x3c')](_0x57c685[_0xd538('0x3b')],{'$or':_[_0xd538('0x27')](_0x3f1db9,function(_0x2ff32e){if(_0x2ff32e[_0xd538('0x2b')]!==_0xd538('0x3d')){var _0xb16677={};_0xb16677[_0x2ff32e[_0xd538('0x2c')]]={'$like':'%'+_0x4955fd[_0xd538('0x2d')][_0xd538('0x3a')]+'%'};return _0xb16677;}})});}_0x57c685=_[_0xd538('0x3c')]({},_0x57c685,_0x4955fd[_0xd538('0x3e')]);var _0x1d363b={'where':_0x57c685[_0xd538('0x3b')]};return db[_0xd538('0x28')][_0xd538('0x1e')](_0x1d363b)[_0xd538('0x22')](function(_0xf081d5){_0x10aad1[_0xd538('0x1e')]=_0xf081d5;if(_0x4955fd['query']['includeAll']){_0x57c685[_0xd538('0x3f')]=[{'all':!![]}];}return db[_0xd538('0x28')][_0xd538('0x40')](_0x57c685);})[_0xd538('0x22')](function(_0x5b79a1){_0x10aad1[_0xd538('0x41')]=_0x5b79a1;return _0x10aad1;})[_0xd538('0x22')](respondWithFilteredResult(_0x529c24,_0x57c685))[_0xd538('0x42')](handleError(_0x529c24,null));};exports['show']=function(_0x2f00c1,_0x54bc9f){var _0x563733={'raw':!![],'where':{'id':_0x2f00c1[_0xd538('0x43')]['id']}},_0x3052b3={};_0x3052b3[_0xd538('0x34')]=_['keys'](db[_0xd538('0x28')]['rawAttributes']);_0x3052b3[_0xd538('0x2d')]=_[_0xd538('0x2e')](_0x2f00c1['query']);_0x3052b3['filters']=_[_0xd538('0x31')](_0x3052b3['model'],_0x3052b3['query']);_0x563733[_0xd538('0x30')]=_[_0xd538('0x31')](_0x3052b3[_0xd538('0x34')],qs[_0xd538('0x32')](_0x2f00c1[_0xd538('0x2d')][_0xd538('0x32')]));_0x563733['attributes']=_0x563733[_0xd538('0x30')][_0xd538('0x33')]?_0x563733[_0xd538('0x30')]:_0x3052b3[_0xd538('0x34')];if(_0x2f00c1['query'][_0xd538('0x44')]){_0x563733[_0xd538('0x3f')]=[{'all':!![]}];}_0x563733=_[_0xd538('0x3c')]({},_0x563733,_0x2f00c1[_0xd538('0x3e')]);return db['JscriptyQuestionReport'][_0xd538('0x45')](_0x563733)[_0xd538('0x22')](handleEntityNotFound(_0x54bc9f,null))[_0xd538('0x22')](respondWithResult(_0x54bc9f,null))[_0xd538('0x42')](handleError(_0x54bc9f,null));};exports[_0xd538('0x46')]=function(_0x3c6662,_0x51ecfe){return db['JscriptyQuestionReport']['create'](_0x3c6662[_0xd538('0x47')],{})['then'](respondWithResult(_0x51ecfe,0xc9))['catch'](handleError(_0x51ecfe,null));};exports[_0xd538('0x48')]=function(_0x476190,_0x5c226d){if(_0x476190[_0xd538('0x47')]['id']){delete _0x476190[_0xd538('0x47')]['id'];}return db[_0xd538('0x28')][_0xd538('0x45')]({'where':{'id':_0x476190[_0xd538('0x43')]['id']}})[_0xd538('0x22')](handleEntityNotFound(_0x5c226d,null))[_0xd538('0x22')](saveUpdates(_0x476190[_0xd538('0x47')],null))['then'](respondWithResult(_0x5c226d,null))[_0xd538('0x42')](handleError(_0x5c226d,null));};exports[_0xd538('0x21')]=function(_0x2f05aa,_0x550651){return db['JscriptyQuestionReport'][_0xd538('0x45')]({'where':{'id':_0x2f05aa['params']['id']}})[_0xd538('0x22')](handleEntityNotFound(_0x550651,null))[_0xd538('0x22')](removeEntity(_0x550651,null))[_0xd538('0x42')](handleError(_0x550651,null));};exports[_0xd538('0x49')]=function(_0x36df8d,_0x396a2d){return db['JscriptyQuestionReport'][_0xd538('0x49')]()[_0xd538('0x22')](respondWithResult(_0x396a2d,null))[_0xd538('0x42')](handleError(_0x396a2d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f910f7c..cf8304b 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 _0x6ecb=['api','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x6ecb,0x82));var _0xb6ec=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0x6ecb[_0x2afb44];return _0x15ccc2;};'use strict';var _=require('lodash');var util=require(_0xb6ec('0x0'));var logger=require(_0xb6ec('0x1'))(_0xb6ec('0x2'));var moment=require('moment');var BPromise=require(_0xb6ec('0x3'));var rp=require(_0xb6ec('0x4'));var fs=require('fs');var path=require(_0xb6ec('0x5'));var rimraf=require('rimraf');var config=require(_0xb6ec('0x6'));var attributes=require(_0xb6ec('0x7'));module[_0xb6ec('0x8')]=function(_0xd5d8a,_0x1160e2){return _0xd5d8a[_0xb6ec('0x9')](_0xb6ec('0xa'),attributes,{'tableName':_0xb6ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc3e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger'];(function(_0x50b1e0,_0x47de26){var _0x4880f8=function(_0x54771e){while(--_0x54771e){_0x50b1e0['push'](_0x50b1e0['shift']());}};_0x4880f8(++_0x47de26);}(_0xbc3e,0xb2));var _0xebc3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbc3e[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xebc3('0x0'));var logger=require(_0xebc3('0x1'))('api');var moment=require(_0xebc3('0x2'));var BPromise=require(_0xebc3('0x3'));var rp=require(_0xebc3('0x4'));var fs=require('fs');var path=require(_0xebc3('0x5'));var rimraf=require(_0xebc3('0x6'));var config=require(_0xebc3('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xebc3('0x8')]=function(_0x3470eb,_0x5b51af){return _0x3470eb[_0xebc3('0x9')](_0xebc3('0xa'),attributes,{'tableName':_0xebc3('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 e19ba64..f4071e7 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 _0x156f=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x38ab87,_0x48bb6e){var _0x45db56=function(_0x1f9e35){while(--_0x1f9e35){_0x38ab87['push'](_0x38ab87['shift']());}};_0x45db56(++_0x48bb6e);}(_0x156f,0x1a6));var _0xf156=function(_0x495935,_0x295e5b){_0x495935=_0x495935-0x0;var _0x6172ae=_0x156f[_0x495935];return _0x6172ae;};'use strict';var _=require(_0xf156('0x0'));var util=require('util');var moment=require(_0xf156('0x1'));var BPromise=require(_0xf156('0x2'));var rs=require(_0xf156('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf156('0x4'));var logger=require(_0xf156('0x5'))(_0xf156('0x6'));var config=require('../../config/environment');var jayson=require(_0xf156('0x7'));var client=jayson[_0xf156('0x8')][_0xf156('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407bb7,_0x48df71,_0x3cf24b){return new BPromise(function(_0x31d778,_0x3f15aa){return client[_0xf156('0xa')](_0x407bb7,_0x3cf24b)['then'](function(_0x58224e){logger[_0xf156('0xb')](_0xf156('0xc'),_0x48df71,_0xf156('0xd'));logger[_0xf156('0xe')](_0xf156('0xf'),_0x48df71,_0xf156('0xd'),JSON[_0xf156('0x10')](_0x58224e));if(_0x58224e[_0xf156('0x11')]){if(_0x58224e['error'][_0xf156('0x12')]===0x1f4){logger[_0xf156('0x11')](_0xf156('0xc'),_0x48df71,_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);return _0x3f15aa(_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x48df71,_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);return _0x31d778(_0x58224e[_0xf156('0x11')][_0xf156('0x13')]);}else{logger['info'](_0xf156('0xc'),_0x48df71,_0xf156('0xd'));_0x31d778(_0x58224e[_0xf156('0x14')][_0xf156('0x13')]);}})[_0xf156('0x15')](function(_0x405385){logger[_0xf156('0x11')](_0xf156('0xc'),_0x48df71,_0x405385);_0x3f15aa(_0x405385);});});} \ No newline at end of file +var _0x51ed=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1cd90d,_0x15f3ca){var _0x2de86d=function(_0x29b7d7){while(--_0x29b7d7){_0x1cd90d['push'](_0x1cd90d['shift']());}};_0x2de86d(++_0x15f3ca);}(_0x51ed,0x1a3));var _0xd51e=function(_0x45502d,_0x5ca8b7){_0x45502d=_0x45502d-0x0;var _0x8813c9=_0x51ed[_0x45502d];return _0x8813c9;};'use strict';var _=require(_0xd51e('0x0'));var util=require('util');var moment=require(_0xd51e('0x1'));var BPromise=require(_0xd51e('0x2'));var rs=require(_0xd51e('0x3'));var fs=require('fs');var Redis=require(_0xd51e('0x4'));var db=require(_0xd51e('0x5'))['db'];var utils=require(_0xd51e('0x6'));var logger=require('../../config/logger')(_0xd51e('0x7'));var config=require(_0xd51e('0x8'));var jayson=require(_0xd51e('0x9'));var client=jayson[_0xd51e('0xa')][_0xd51e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15f43c,_0x541a63,_0x153fa9){return new BPromise(function(_0x548853,_0x3d01e1){return client[_0xd51e('0xc')](_0x15f43c,_0x153fa9)['then'](function(_0x2396ff){logger[_0xd51e('0xd')](_0xd51e('0xe'),_0x541a63,_0xd51e('0xf'));logger[_0xd51e('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x541a63,_0xd51e('0xf'),JSON[_0xd51e('0x11')](_0x2396ff));if(_0x2396ff[_0xd51e('0x12')]){if(_0x2396ff[_0xd51e('0x12')][_0xd51e('0x13')]===0x1f4){logger[_0xd51e('0x12')](_0xd51e('0xe'),_0x541a63,_0x2396ff[_0xd51e('0x12')][_0xd51e('0x14')]);return _0x3d01e1(_0x2396ff['error'][_0xd51e('0x14')]);}logger[_0xd51e('0x12')](_0xd51e('0xe'),_0x541a63,_0x2396ff[_0xd51e('0x12')][_0xd51e('0x14')]);return _0x548853(_0x2396ff[_0xd51e('0x12')][_0xd51e('0x14')]);}else{logger[_0xd51e('0xd')](_0xd51e('0xe'),_0x541a63,_0xd51e('0xf'));_0x548853(_0x2396ff[_0xd51e('0x15')][_0xd51e('0x14')]);}})[_0xd51e('0x16')](function(_0x4a94d7){logger[_0xd51e('0x12')](_0xd51e('0xe'),_0x541a63,_0x4a94d7);_0x3d01e1(_0x4a94d7);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 4f1273e..6ca0f31 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 _0xf25d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xf25d,0x6c));var _0xdf25=function(_0x9aca96,_0x497a2a){_0x9aca96=_0x9aca96-0x0;var _0x2d64a5=_0xf25d[_0x9aca96];return _0x2d64a5;};'use strict';var multer=require(_0xdf25('0x0'));var util=require(_0xdf25('0x1'));var path=require(_0xdf25('0x2'));var timeout=require(_0xdf25('0x3'));var express=require(_0xdf25('0x4'));var router=express[_0xdf25('0x5')]();var fs_extra=require(_0xdf25('0x6'));var auth=require(_0xdf25('0x7'));var interaction=require(_0xdf25('0x8'));var config=require(_0xdf25('0x9'));var controller=require(_0xdf25('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf25('0xb')]);router[_0xdf25('0xc')](_0xdf25('0xd'),auth[_0xdf25('0xe')](),controller[_0xdf25('0xf')]);router[_0xdf25('0xc')](_0xdf25('0x10'),auth['isAuthenticated'](),controller[_0xdf25('0x11')]);router['get'](_0xdf25('0x12'),auth['isAuthenticated'](),controller[_0xdf25('0x13')]);router['post']('/',auth[_0xdf25('0xe')](),controller[_0xdf25('0x14')]);router[_0xdf25('0x15')](_0xdf25('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xdf25('0xe')](),controller[_0xdf25('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3466=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x169575,_0x2d84f0){var _0x159f07=function(_0x385b37){while(--_0x385b37){_0x169575['push'](_0x169575['shift']());}};_0x159f07(++_0x2d84f0);}(_0x3466,0xfe));var _0x6346=function(_0xe454f2,_0x2b8012){_0xe454f2=_0xe454f2-0x0;var _0x561583=_0x3466[_0xe454f2];return _0x561583;};'use strict';var multer=require(_0x6346('0x0'));var util=require(_0x6346('0x1'));var path=require(_0x6346('0x2'));var timeout=require(_0x6346('0x3'));var express=require(_0x6346('0x4'));var router=express[_0x6346('0x5')]();var fs_extra=require(_0x6346('0x6'));var auth=require(_0x6346('0x7'));var interaction=require(_0x6346('0x8'));var config=require(_0x6346('0x9'));var controller=require(_0x6346('0xa'));router[_0x6346('0xb')]('/',auth[_0x6346('0xc')](),controller[_0x6346('0xd')]);router[_0x6346('0xb')](_0x6346('0xe'),auth[_0x6346('0xc')](),controller[_0x6346('0xf')]);router[_0x6346('0xb')](_0x6346('0x10'),auth[_0x6346('0xc')](),controller[_0x6346('0x11')]);router[_0x6346('0xb')](_0x6346('0x12'),auth[_0x6346('0xc')](),controller[_0x6346('0x13')]);router[_0x6346('0x14')]('/',auth[_0x6346('0xc')](),controller[_0x6346('0x15')]);router['put'](_0x6346('0x10'),auth['isAuthenticated'](),controller[_0x6346('0x16')]);router[_0x6346('0x17')](_0x6346('0x10'),auth['isAuthenticated'](),controller[_0x6346('0x18')]);module[_0x6346('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d57b5d8..2243c83 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 _0xe48e=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime'];(function(_0x51f5f7,_0x4e1492){var _0x6afaa=function(_0x298234){while(--_0x298234){_0x51f5f7['push'](_0x51f5f7['shift']());}};_0x6afaa(++_0x4e1492);}(_0xe48e,0x109));var _0xee48=function(_0x148fe2,_0x14bab4){_0x148fe2=_0x148fe2-0x0;var _0x321d8e=_0xe48e[_0x148fe2];return _0x321d8e;};'use strict';var moment=require(_0xee48('0x0'));var Sequelize=require('sequelize');module[_0xee48('0x1')]={'starttime':{'type':Sequelize[_0xee48('0x2')],'set':function(_0x209af7){this[_0xee48('0x3')](_0xee48('0x4'),_0x209af7);this[_0xee48('0x3')](_0xee48('0x5'),moment()[_0xee48('0x6')](_0xee48('0x7')));}},'endtime':{'type':Sequelize[_0xee48('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xee48('0x8')]},'queue':{'type':Sequelize[_0xee48('0x8')]},'uniqueid':{'type':Sequelize[_0xee48('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xee48('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x22ef=['endtime','format','STRING','BOOLEAN','sequelize','DATE','setDataValue','starttime'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x22ef,0x9c));var _0xf22e=function(_0x306714,_0x45024a){_0x306714=_0x306714-0x0;var _0xe043c1=_0x22ef[_0x306714];return _0xe043c1;};'use strict';var moment=require('moment');var Sequelize=require(_0xf22e('0x0'));module['exports']={'starttime':{'type':Sequelize[_0xf22e('0x1')],'set':function(_0x2b4b79){this[_0xf22e('0x2')](_0xf22e('0x3'),_0x2b4b79);this[_0xf22e('0x2')](_0xf22e('0x4'),moment()[_0xf22e('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xf22e('0x1')]},'membername':{'type':Sequelize[_0xf22e('0x6')]},'projectname':{'type':Sequelize[_0xf22e('0x6')]},'queue':{'type':Sequelize[_0xf22e('0x6')]},'uniqueid':{'type':Sequelize[_0xf22e('0x6')]},'calleridname':{'type':Sequelize[_0xf22e('0x6')]},'calleridnum':{'type':Sequelize[_0xf22e('0x6')]},'completed':{'type':Sequelize[_0xf22e('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 432c320..9459b2d 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 _0x96f3=['options','include','rows','catch','show','includeAll','find','create','body','update','params','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','index','map','JscriptySessionReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x96f3,0x152));var _0x396f=function(_0x5d7444,_0x5331f1){_0x5d7444=_0x5d7444-0x0;var _0x34a7ae=_0x96f3[_0x5d7444];return _0x34a7ae;};'use strict';var emlformat=require(_0x396f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x396f('0x1'));var jsonpatch=require(_0x396f('0x2'));var rp=require(_0x396f('0x3'));var moment=require(_0x396f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x396f('0x5'));var util=require(_0x396f('0x6'));var path=require(_0x396f('0x7'));var sox=require(_0x396f('0x8'));var csv=require(_0x396f('0x9'));var ejs=require(_0x396f('0xa'));var fs=require('fs');var fs_extra=require(_0x396f('0xb'));var _=require('lodash');var squel=require(_0x396f('0xc'));var crypto=require(_0x396f('0xd'));var jsforce=require(_0x396f('0xe'));var deskjs=require(_0x396f('0xf'));var toCsv=require(_0x396f('0x9'));var querystring=require(_0x396f('0x10'));var Papa=require(_0x396f('0x11'));var Redis=require('ioredis');var authService=require(_0x396f('0x12'));var qs=require(_0x396f('0x13'));var as=require(_0x396f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x396f('0x15'))(_0x396f('0x16'));var utils=require(_0x396f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x396f('0x18'));var db=require(_0x396f('0x19'))['db'];function respondWithStatusCode(_0x1e0c1a,_0x58a79d){_0x58a79d=_0x58a79d||0xcc;return function(_0x20ccca){if(_0x20ccca){return _0x1e0c1a[_0x396f('0x1a')](_0x58a79d);}return _0x1e0c1a[_0x396f('0x1b')](_0x58a79d)[_0x396f('0x1c')]();};}function respondWithResult(_0x1db5f5,_0x293e47){_0x293e47=_0x293e47||0xc8;return function(_0x47cfb7){if(_0x47cfb7){return _0x1db5f5['status'](_0x293e47)[_0x396f('0x1d')](_0x47cfb7);}};}function respondWithFilteredResult(_0x34f20c,_0xc39fd){return function(_0x54382a){if(_0x54382a){var _0x195dce=typeof _0xc39fd[_0x396f('0x1e')]==='undefined'&&typeof _0xc39fd[_0x396f('0x1f')]==='undefined';var _0x59b7f5=_0x54382a[_0x396f('0x20')];var _0x5826ca=_0x195dce?0x0:_0xc39fd[_0x396f('0x1e')];var _0x22446a=_0x195dce?_0x54382a[_0x396f('0x20')]:_0xc39fd[_0x396f('0x1e')]+_0xc39fd['limit'];var _0x417196;if(_0x22446a>=_0x59b7f5){_0x22446a=_0x59b7f5;_0x417196=0xc8;}else{_0x417196=0xce;}_0x34f20c[_0x396f('0x1b')](_0x417196);return _0x34f20c[_0x396f('0x21')](_0x396f('0x22'),_0x5826ca+'-'+_0x22446a+'/'+_0x59b7f5)[_0x396f('0x1d')](_0x54382a);}return null;};}function patchUpdates(_0x1d7cdd){return function(_0x58ae76){try{jsonpatch['apply'](_0x58ae76,_0x1d7cdd,!![]);}catch(_0x1dac99){return BPromise[_0x396f('0x23')](_0x1dac99);}return _0x58ae76['save']();};}function saveUpdates(_0x1d7490,_0x9ee0e3){return function(_0x2da835){if(_0x2da835){return _0x2da835['update'](_0x1d7490)[_0x396f('0x24')](function(_0x5b7221){return _0x5b7221;});}return null;};}function removeEntity(_0x566af8,_0x1fc1f2){return function(_0x2db610){if(_0x2db610){return _0x2db610[_0x396f('0x25')]()[_0x396f('0x24')](function(){_0x566af8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4642e9,_0x40cb6d){return function(_0x2fe193){if(!_0x2fe193){_0x4642e9[_0x396f('0x1a')](0x194);}return _0x2fe193;};}function handleError(_0x1fbd5b,_0x3bc702){_0x3bc702=_0x3bc702||0x1f4;return function(_0x548589){logger[_0x396f('0x26')](_0x548589[_0x396f('0x27')]);if(_0x548589['name']){delete _0x548589[_0x396f('0x28')];}_0x1fbd5b[_0x396f('0x1b')](_0x3bc702)['send'](_0x548589);};}exports[_0x396f('0x29')]=function(_0x490fb8,_0x8fef4b){var _0x156719={},_0x23b520={},_0x475fbf={'count':0x0,'rows':[]};var _0x23f454=_[_0x396f('0x2a')](db[_0x396f('0x2b')]['rawAttributes'],function(_0x581a8b){return{'name':_0x581a8b['fieldName'],'type':_0x581a8b[_0x396f('0x2c')][_0x396f('0x2d')]};});_0x23b520[_0x396f('0x2e')]=_['map'](_0x23f454,_0x396f('0x28'));_0x23b520[_0x396f('0x2f')]=_[_0x396f('0x30')](_0x490fb8[_0x396f('0x2f')]);_0x23b520[_0x396f('0x31')]=_[_0x396f('0x32')](_0x23b520[_0x396f('0x2e')],_0x23b520[_0x396f('0x2f')]);_0x156719[_0x396f('0x33')]=_[_0x396f('0x32')](_0x23b520[_0x396f('0x2e')],qs[_0x396f('0x34')](_0x490fb8[_0x396f('0x2f')][_0x396f('0x34')]));_0x156719[_0x396f('0x33')]=_0x156719[_0x396f('0x33')][_0x396f('0x35')]?_0x156719['attributes']:_0x23b520[_0x396f('0x2e')];if(!_0x490fb8[_0x396f('0x2f')][_0x396f('0x36')](_0x396f('0x37'))){_0x156719[_0x396f('0x1f')]=qs[_0x396f('0x1f')](_0x490fb8[_0x396f('0x2f')][_0x396f('0x1f')]);_0x156719['offset']=qs[_0x396f('0x1e')](_0x490fb8['query']['offset']);}_0x156719[_0x396f('0x38')]=qs['sort'](_0x490fb8[_0x396f('0x2f')][_0x396f('0x39')]);_0x156719[_0x396f('0x3a')]=qs[_0x396f('0x31')](_['pick'](_0x490fb8[_0x396f('0x2f')],_0x23b520[_0x396f('0x31')]),_0x23f454);if(_0x490fb8[_0x396f('0x2f')][_0x396f('0x3b')]){_0x156719['where']=_[_0x396f('0x3c')](_0x156719[_0x396f('0x3a')],{'$or':_[_0x396f('0x2a')](_0x23f454,function(_0x900d59){if(_0x900d59['type']!==_0x396f('0x3d')){var _0x45bcd3={};_0x45bcd3[_0x900d59[_0x396f('0x28')]]={'$like':'%'+_0x490fb8[_0x396f('0x2f')][_0x396f('0x3b')]+'%'};return _0x45bcd3;}})});}_0x156719=_[_0x396f('0x3c')]({},_0x156719,_0x490fb8[_0x396f('0x3e')]);var _0x46fb35={'where':_0x156719[_0x396f('0x3a')]};return db[_0x396f('0x2b')][_0x396f('0x20')](_0x46fb35)['then'](function(_0x3a521a){_0x475fbf['count']=_0x3a521a;if(_0x490fb8[_0x396f('0x2f')]['includeAll']){_0x156719[_0x396f('0x3f')]=[{'all':!![]}];}return db[_0x396f('0x2b')]['findAll'](_0x156719);})[_0x396f('0x24')](function(_0x22548a){_0x475fbf[_0x396f('0x40')]=_0x22548a;return _0x475fbf;})['then'](respondWithFilteredResult(_0x8fef4b,_0x156719))[_0x396f('0x41')](handleError(_0x8fef4b,null));};exports[_0x396f('0x42')]=function(_0x31ab98,_0x56e3dc){var _0x259e32={'raw':!![],'where':{'id':_0x31ab98['params']['id']}},_0x5a8ee4={};_0x5a8ee4[_0x396f('0x2e')]=_[_0x396f('0x30')](db[_0x396f('0x2b')]['rawAttributes']);_0x5a8ee4['query']=_[_0x396f('0x30')](_0x31ab98[_0x396f('0x2f')]);_0x5a8ee4[_0x396f('0x31')]=_[_0x396f('0x32')](_0x5a8ee4[_0x396f('0x2e')],_0x5a8ee4[_0x396f('0x2f')]);_0x259e32['attributes']=_['intersection'](_0x5a8ee4[_0x396f('0x2e')],qs['fields'](_0x31ab98[_0x396f('0x2f')][_0x396f('0x34')]));_0x259e32[_0x396f('0x33')]=_0x259e32[_0x396f('0x33')]['length']?_0x259e32[_0x396f('0x33')]:_0x5a8ee4[_0x396f('0x2e')];if(_0x31ab98[_0x396f('0x2f')][_0x396f('0x43')]){_0x259e32[_0x396f('0x3f')]=[{'all':!![]}];}_0x259e32=_[_0x396f('0x3c')]({},_0x259e32,_0x31ab98[_0x396f('0x3e')]);return db[_0x396f('0x2b')][_0x396f('0x44')](_0x259e32)['then'](handleEntityNotFound(_0x56e3dc,null))[_0x396f('0x24')](respondWithResult(_0x56e3dc,null))['catch'](handleError(_0x56e3dc,null));};exports['create']=function(_0x2d4422,_0x2900e2){return db[_0x396f('0x2b')][_0x396f('0x45')](_0x2d4422[_0x396f('0x46')],{})[_0x396f('0x24')](respondWithResult(_0x2900e2,0xc9))[_0x396f('0x41')](handleError(_0x2900e2,null));};exports[_0x396f('0x47')]=function(_0x637f73,_0x5dc3b5){if(_0x637f73[_0x396f('0x46')]['id']){delete _0x637f73['body']['id'];}return db[_0x396f('0x2b')][_0x396f('0x44')]({'where':{'id':_0x637f73[_0x396f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dc3b5,null))[_0x396f('0x24')](saveUpdates(_0x637f73['body'],null))[_0x396f('0x24')](respondWithResult(_0x5dc3b5,null))[_0x396f('0x41')](handleError(_0x5dc3b5,null));};exports[_0x396f('0x25')]=function(_0x4e5d14,_0x442e0d){return db[_0x396f('0x2b')]['find']({'where':{'id':_0x4e5d14[_0x396f('0x48')]['id']}})[_0x396f('0x24')](handleEntityNotFound(_0x442e0d,null))['then'](removeEntity(_0x442e0d,null))[_0x396f('0x41')](handleError(_0x442e0d,null));};exports[_0x396f('0x49')]=function(_0x484632,_0x452995){return db[_0x396f('0x2b')][_0x396f('0x49')]()[_0x396f('0x24')](respondWithResult(_0x452995,null))['catch'](handleError(_0x452995,null));};exports[_0x396f('0x4a')]=function(_0x9c168b,_0x716cff,_0x33d4ac){var _0x4bc0a7={'raw':!![],'where':{}};var _0x16d898={};var _0x1ae29f={'count':0x0,'rows':[]};return db[_0x396f('0x2b')][_0x396f('0x4b')]({'where':{'id':_0x9c168b[_0x396f('0x48')]['id']}})['then'](handleEntityNotFound(_0x716cff,null))['then'](function(_0x2a8c21){if(_0x2a8c21){_0x16d898[_0x396f('0x2e')]=_[_0x396f('0x30')](db[_0x396f('0x4c')][_0x396f('0x4d')]);_0x16d898[_0x396f('0x2f')]=_[_0x396f('0x30')](_0x9c168b[_0x396f('0x2f')]);_0x16d898[_0x396f('0x31')]=_['intersection'](_0x16d898['model'],_0x16d898[_0x396f('0x2f')]);_0x4bc0a7[_0x396f('0x33')]=_[_0x396f('0x32')](_0x16d898['model'],qs['fields'](_0x9c168b[_0x396f('0x2f')][_0x396f('0x34')]));_0x4bc0a7[_0x396f('0x33')]=_0x4bc0a7[_0x396f('0x33')][_0x396f('0x35')]?_0x4bc0a7[_0x396f('0x33')]:_0x16d898[_0x396f('0x2e')];if(!_0x9c168b['query'][_0x396f('0x36')](_0x396f('0x37'))){_0x4bc0a7['limit']=qs[_0x396f('0x1f')](_0x9c168b[_0x396f('0x2f')][_0x396f('0x1f')]);_0x4bc0a7['offset']=qs[_0x396f('0x1e')](_0x9c168b[_0x396f('0x2f')]['offset']);}_0x4bc0a7[_0x396f('0x38')]=qs[_0x396f('0x39')](_0x9c168b['query'][_0x396f('0x39')]);_0x4bc0a7['where']=qs[_0x396f('0x31')](_['pick'](_0x9c168b[_0x396f('0x2f')],_0x16d898['filters']));_0x4bc0a7[_0x396f('0x3a')][_0x396f('0x4e')]=_0x2a8c21['id'];if(_0x9c168b['query'][_0x396f('0x3b')]){_0x4bc0a7[_0x396f('0x3a')]=_[_0x396f('0x3c')](_0x4bc0a7['where'],{'$or':_[_0x396f('0x2a')](_0x4bc0a7['attributes'],function(_0x42abfa){var _0x4a5f2d={};_0x4a5f2d[_0x42abfa]={'$like':'%'+_0x9c168b[_0x396f('0x2f')][_0x396f('0x3b')]+'%'};return _0x4a5f2d;})});}_0x4bc0a7=_[_0x396f('0x3c')]({},_0x4bc0a7,_0x9c168b[_0x396f('0x3e')]);return db[_0x396f('0x4c')][_0x396f('0x20')]({'where':_0x4bc0a7['where']})[_0x396f('0x24')](function(_0x6c225f){_0x1ae29f[_0x396f('0x20')]=_0x6c225f;if(_0x9c168b['query'][_0x396f('0x43')]){_0x4bc0a7[_0x396f('0x3f')]=[{'all':!![]}];}return db[_0x396f('0x4c')][_0x396f('0x4f')](_0x4bc0a7);})[_0x396f('0x24')](function(_0x4b3af1){_0x1ae29f[_0x396f('0x40')]=_0x4b3af1;return _0x1ae29f;});}})[_0x396f('0x24')](respondWithFilteredResult(_0x716cff,_0x4bc0a7))[_0x396f('0x41')](handleError(_0x716cff,null));}; \ No newline at end of file +var _0x0412=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','filter','rows','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','JscriptySessionReport','fieldName','type','key','model','map','query','filters'];(function(_0x406686,_0x9b5374){var _0x584f8e=function(_0x4542ea){while(--_0x4542ea){_0x406686['push'](_0x406686['shift']());}};_0x584f8e(++_0x9b5374);}(_0x0412,0xb7));var _0x2041=function(_0x456461,_0x4445df){_0x456461=_0x456461-0x0;var _0x39670b=_0x0412[_0x456461];return _0x39670b;};'use strict';var emlformat=require(_0x2041('0x0'));var rimraf=require(_0x2041('0x1'));var zipdir=require(_0x2041('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2041('0x3'));var moment=require(_0x2041('0x4'));var BPromise=require(_0x2041('0x5'));var Mustache=require(_0x2041('0x6'));var util=require(_0x2041('0x7'));var path=require(_0x2041('0x8'));var sox=require(_0x2041('0x9'));var csv=require(_0x2041('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2041('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2041('0xc'));var jsforce=require(_0x2041('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2041('0xa'));var querystring=require(_0x2041('0xe'));var Papa=require(_0x2041('0xf'));var Redis=require('ioredis');var authService=require(_0x2041('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2041('0x11'));var logger=require(_0x2041('0x12'))(_0x2041('0x13'));var utils=require(_0x2041('0x14'));var config=require(_0x2041('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2041('0x16'))['db'];function respondWithStatusCode(_0x13ddd2,_0xbfcdde){_0xbfcdde=_0xbfcdde||0xcc;return function(_0x19c17f){if(_0x19c17f){return _0x13ddd2[_0x2041('0x17')](_0xbfcdde);}return _0x13ddd2[_0x2041('0x18')](_0xbfcdde)['end']();};}function respondWithResult(_0x27397d,_0x1b30ae){_0x1b30ae=_0x1b30ae||0xc8;return function(_0x8e5f1f){if(_0x8e5f1f){return _0x27397d[_0x2041('0x18')](_0x1b30ae)['json'](_0x8e5f1f);}};}function respondWithFilteredResult(_0x2ff6a0,_0x3436d9){return function(_0xec86b3){if(_0xec86b3){var _0x65cf56=typeof _0x3436d9[_0x2041('0x19')]==='undefined'&&typeof _0x3436d9[_0x2041('0x1a')]===_0x2041('0x1b');var _0xa9eac9=_0xec86b3['count'];var _0x39c825=_0x65cf56?0x0:_0x3436d9[_0x2041('0x19')];var _0x27c4e2=_0x65cf56?_0xec86b3[_0x2041('0x1c')]:_0x3436d9[_0x2041('0x19')]+_0x3436d9[_0x2041('0x1a')];var _0x48b034;if(_0x27c4e2>=_0xa9eac9){_0x27c4e2=_0xa9eac9;_0x48b034=0xc8;}else{_0x48b034=0xce;}_0x2ff6a0[_0x2041('0x18')](_0x48b034);return _0x2ff6a0[_0x2041('0x1d')](_0x2041('0x1e'),_0x39c825+'-'+_0x27c4e2+'/'+_0xa9eac9)['json'](_0xec86b3);}return null;};}function patchUpdates(_0x12c2c2){return function(_0xfca1d2){try{jsonpatch[_0x2041('0x1f')](_0xfca1d2,_0x12c2c2,!![]);}catch(_0x1d22e6){return BPromise['reject'](_0x1d22e6);}return _0xfca1d2[_0x2041('0x20')]();};}function saveUpdates(_0x2d33b8,_0x3fa0ee){return function(_0x5c2e5d){if(_0x5c2e5d){return _0x5c2e5d[_0x2041('0x21')](_0x2d33b8)['then'](function(_0x6212b2){return _0x6212b2;});}return null;};}function removeEntity(_0x17677f,_0xe74012){return function(_0x2b3e53){if(_0x2b3e53){return _0x2b3e53[_0x2041('0x22')]()[_0x2041('0x23')](function(){_0x17677f[_0x2041('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6cee6c,_0x53618a){return function(_0x489fbb){if(!_0x489fbb){_0x6cee6c[_0x2041('0x17')](0x194);}return _0x489fbb;};}function handleError(_0x37ccfd,_0x4f18b5){_0x4f18b5=_0x4f18b5||0x1f4;return function(_0x29d27d){logger['error'](_0x29d27d[_0x2041('0x24')]);if(_0x29d27d[_0x2041('0x25')]){delete _0x29d27d[_0x2041('0x25')];}_0x37ccfd['status'](_0x4f18b5)[_0x2041('0x26')](_0x29d27d);};}exports[_0x2041('0x27')]=function(_0x311af8,_0x1ded57){var _0x2f0f64={},_0x2ed95b={},_0x4f3004={'count':0x0,'rows':[]};var _0x2ad080=_['map'](db[_0x2041('0x28')]['rawAttributes'],function(_0x1f505f){return{'name':_0x1f505f[_0x2041('0x29')],'type':_0x1f505f[_0x2041('0x2a')][_0x2041('0x2b')]};});_0x2ed95b[_0x2041('0x2c')]=_[_0x2041('0x2d')](_0x2ad080,'name');_0x2ed95b[_0x2041('0x2e')]=_['keys'](_0x311af8[_0x2041('0x2e')]);_0x2ed95b[_0x2041('0x2f')]=_[_0x2041('0x30')](_0x2ed95b[_0x2041('0x2c')],_0x2ed95b[_0x2041('0x2e')]);_0x2f0f64[_0x2041('0x31')]=_[_0x2041('0x30')](_0x2ed95b['model'],qs[_0x2041('0x32')](_0x311af8[_0x2041('0x2e')][_0x2041('0x32')]));_0x2f0f64[_0x2041('0x31')]=_0x2f0f64['attributes'][_0x2041('0x33')]?_0x2f0f64['attributes']:_0x2ed95b[_0x2041('0x2c')];if(!_0x311af8[_0x2041('0x2e')][_0x2041('0x34')](_0x2041('0x35'))){_0x2f0f64[_0x2041('0x1a')]=qs['limit'](_0x311af8[_0x2041('0x2e')][_0x2041('0x1a')]);_0x2f0f64[_0x2041('0x19')]=qs[_0x2041('0x19')](_0x311af8[_0x2041('0x2e')]['offset']);}_0x2f0f64[_0x2041('0x36')]=qs[_0x2041('0x37')](_0x311af8['query'][_0x2041('0x37')]);_0x2f0f64['where']=qs['filters'](_[_0x2041('0x38')](_0x311af8[_0x2041('0x2e')],_0x2ed95b[_0x2041('0x2f')]),_0x2ad080);if(_0x311af8[_0x2041('0x2e')]['filter']){_0x2f0f64[_0x2041('0x39')]=_[_0x2041('0x3a')](_0x2f0f64[_0x2041('0x39')],{'$or':_[_0x2041('0x2d')](_0x2ad080,function(_0xe77f6f){if(_0xe77f6f[_0x2041('0x2a')]!=='VIRTUAL'){var _0x366475={};_0x366475[_0xe77f6f['name']]={'$like':'%'+_0x311af8[_0x2041('0x2e')]['filter']+'%'};return _0x366475;}})});}_0x2f0f64=_[_0x2041('0x3a')]({},_0x2f0f64,_0x311af8['options']);var _0xcf3978={'where':_0x2f0f64[_0x2041('0x39')]};return db['JscriptySessionReport'][_0x2041('0x1c')](_0xcf3978)[_0x2041('0x23')](function(_0x52122f){_0x4f3004['count']=_0x52122f;if(_0x311af8['query'][_0x2041('0x3b')]){_0x2f0f64[_0x2041('0x3c')]=[{'all':!![]}];}return db[_0x2041('0x28')][_0x2041('0x3d')](_0x2f0f64);})[_0x2041('0x23')](function(_0x2fdd50){_0x4f3004['rows']=_0x2fdd50;return _0x4f3004;})[_0x2041('0x23')](respondWithFilteredResult(_0x1ded57,_0x2f0f64))[_0x2041('0x3e')](handleError(_0x1ded57,null));};exports[_0x2041('0x3f')]=function(_0x4f7af8,_0x3aeba0){var _0x1e2968={'raw':!![],'where':{'id':_0x4f7af8['params']['id']}},_0x24f2a1={};_0x24f2a1['model']=_[_0x2041('0x40')](db[_0x2041('0x28')]['rawAttributes']);_0x24f2a1['query']=_[_0x2041('0x40')](_0x4f7af8[_0x2041('0x2e')]);_0x24f2a1['filters']=_[_0x2041('0x30')](_0x24f2a1[_0x2041('0x2c')],_0x24f2a1[_0x2041('0x2e')]);_0x1e2968[_0x2041('0x31')]=_['intersection'](_0x24f2a1[_0x2041('0x2c')],qs['fields'](_0x4f7af8[_0x2041('0x2e')][_0x2041('0x32')]));_0x1e2968[_0x2041('0x31')]=_0x1e2968[_0x2041('0x31')][_0x2041('0x33')]?_0x1e2968['attributes']:_0x24f2a1['model'];if(_0x4f7af8[_0x2041('0x2e')]['includeAll']){_0x1e2968[_0x2041('0x3c')]=[{'all':!![]}];}_0x1e2968=_[_0x2041('0x3a')]({},_0x1e2968,_0x4f7af8[_0x2041('0x41')]);return db[_0x2041('0x28')][_0x2041('0x42')](_0x1e2968)[_0x2041('0x23')](handleEntityNotFound(_0x3aeba0,null))[_0x2041('0x23')](respondWithResult(_0x3aeba0,null))[_0x2041('0x3e')](handleError(_0x3aeba0,null));};exports[_0x2041('0x43')]=function(_0x1706fb,_0x4b67cd){return db[_0x2041('0x28')][_0x2041('0x43')](_0x1706fb[_0x2041('0x44')],{})[_0x2041('0x23')](respondWithResult(_0x4b67cd,0xc9))[_0x2041('0x3e')](handleError(_0x4b67cd,null));};exports[_0x2041('0x21')]=function(_0x5941e1,_0x30d9a6){if(_0x5941e1['body']['id']){delete _0x5941e1['body']['id'];}return db[_0x2041('0x28')][_0x2041('0x42')]({'where':{'id':_0x5941e1[_0x2041('0x45')]['id']}})[_0x2041('0x23')](handleEntityNotFound(_0x30d9a6,null))['then'](saveUpdates(_0x5941e1['body'],null))[_0x2041('0x23')](respondWithResult(_0x30d9a6,null))['catch'](handleError(_0x30d9a6,null));};exports['destroy']=function(_0x3653a4,_0x2f5f24){return db[_0x2041('0x28')][_0x2041('0x42')]({'where':{'id':_0x3653a4[_0x2041('0x45')]['id']}})[_0x2041('0x23')](handleEntityNotFound(_0x2f5f24,null))['then'](removeEntity(_0x2f5f24,null))[_0x2041('0x3e')](handleError(_0x2f5f24,null));};exports[_0x2041('0x46')]=function(_0x23d776,_0x46daef){return db['JscriptySessionReport'][_0x2041('0x46')]()[_0x2041('0x23')](respondWithResult(_0x46daef,null))['catch'](handleError(_0x46daef,null));};exports[_0x2041('0x47')]=function(_0x20cd90,_0x198082,_0x10496d){var _0x10e7dc={'raw':!![],'where':{}};var _0x4caf93={};var _0x3a4695={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x2041('0x48')]({'where':{'id':_0x20cd90['params']['id']}})[_0x2041('0x23')](handleEntityNotFound(_0x198082,null))[_0x2041('0x23')](function(_0x1202ea){if(_0x1202ea){_0x4caf93[_0x2041('0x2c')]=_['keys'](db[_0x2041('0x49')][_0x2041('0x4a')]);_0x4caf93[_0x2041('0x2e')]=_['keys'](_0x20cd90['query']);_0x4caf93[_0x2041('0x2f')]=_[_0x2041('0x30')](_0x4caf93[_0x2041('0x2c')],_0x4caf93[_0x2041('0x2e')]);_0x10e7dc[_0x2041('0x31')]=_[_0x2041('0x30')](_0x4caf93[_0x2041('0x2c')],qs['fields'](_0x20cd90['query'][_0x2041('0x32')]));_0x10e7dc['attributes']=_0x10e7dc[_0x2041('0x31')][_0x2041('0x33')]?_0x10e7dc[_0x2041('0x31')]:_0x4caf93['model'];if(!_0x20cd90[_0x2041('0x2e')]['hasOwnProperty']('nolimit')){_0x10e7dc[_0x2041('0x1a')]=qs[_0x2041('0x1a')](_0x20cd90[_0x2041('0x2e')][_0x2041('0x1a')]);_0x10e7dc[_0x2041('0x19')]=qs[_0x2041('0x19')](_0x20cd90[_0x2041('0x2e')][_0x2041('0x19')]);}_0x10e7dc[_0x2041('0x36')]=qs['sort'](_0x20cd90[_0x2041('0x2e')][_0x2041('0x37')]);_0x10e7dc[_0x2041('0x39')]=qs[_0x2041('0x2f')](_[_0x2041('0x38')](_0x20cd90[_0x2041('0x2e')],_0x4caf93[_0x2041('0x2f')]));_0x10e7dc['where']['SessionId']=_0x1202ea['id'];if(_0x20cd90[_0x2041('0x2e')][_0x2041('0x4b')]){_0x10e7dc[_0x2041('0x39')]=_['merge'](_0x10e7dc[_0x2041('0x39')],{'$or':_[_0x2041('0x2d')](_0x10e7dc[_0x2041('0x31')],function(_0x4304df){var _0x25cf04={};_0x25cf04[_0x4304df]={'$like':'%'+_0x20cd90[_0x2041('0x2e')][_0x2041('0x4b')]+'%'};return _0x25cf04;})});}_0x10e7dc=_[_0x2041('0x3a')]({},_0x10e7dc,_0x20cd90['options']);return db[_0x2041('0x49')][_0x2041('0x1c')]({'where':_0x10e7dc[_0x2041('0x39')]})[_0x2041('0x23')](function(_0x33e34e){_0x3a4695['count']=_0x33e34e;if(_0x20cd90[_0x2041('0x2e')][_0x2041('0x3b')]){_0x10e7dc[_0x2041('0x3c')]=[{'all':!![]}];}return db[_0x2041('0x49')][_0x2041('0x3d')](_0x10e7dc);})[_0x2041('0x23')](function(_0x3deaae){_0x3a4695[_0x2041('0x4c')]=_0x3deaae;return _0x3a4695;});}})[_0x2041('0x23')](respondWithFilteredResult(_0x198082,_0x10e7dc))['catch'](handleError(_0x198082,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 21f8c22..3234b9c 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 _0x82c4=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes','define'];(function(_0x5e0915,_0x30d202){var _0x459a69=function(_0x2102a8){while(--_0x2102a8){_0x5e0915['push'](_0x5e0915['shift']());}};_0x459a69(++_0x30d202);}(_0x82c4,0x1ca));var _0x482c=function(_0x32a94c,_0x29f028){_0x32a94c=_0x32a94c-0x0;var _0x1841ae=_0x82c4[_0x32a94c];return _0x1841ae;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x36dc83,_0x486469){var _0x42f91c=function(_0x3c5f21){while(--_0x3c5f21){_0x36dc83['push'](_0x36dc83['shift']());}};_0x42f91c(++_0x486469);}(_0x5fab,0x177));var _0xb5fa=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x5fab[_0x64aff8];return _0x5488a3;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'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 2d81d07..2afa135 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 _0x627e=['request','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x5bf8c3,_0x17cff7){var _0x4b7576=function(_0x39ded1){while(--_0x39ded1){_0x5bf8c3['push'](_0x5bf8c3['shift']());}};_0x4b7576(++_0x17cff7);}(_0x627e,0x14a));var _0xe627=function(_0xf141eb,_0x3b1653){_0xf141eb=_0xf141eb-0x0;var _0x32d1b3=_0x627e[_0xf141eb];return _0x32d1b3;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});} \ No newline at end of file +var _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xacf4,0xe7));var _0x4acf=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0xacf4[_0x173452];return _0xee3fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index fae6811..f4f5c07 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 _0xec50=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xec50,0xcd));var _0x0ec5=function(_0x541e4f,_0x48d7fa){_0x541e4f=_0x541e4f-0x0;var _0x5c1711=_0xec50[_0x541e4f];return _0x5c1711;};'use strict';var multer=require(_0x0ec5('0x0'));var util=require(_0x0ec5('0x1'));var path=require('path');var timeout=require(_0x0ec5('0x2'));var express=require(_0x0ec5('0x3'));var router=express['Router']();var fs_extra=require(_0x0ec5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0ec5('0x5'));var config=require(_0x0ec5('0x6'));var controller=require(_0x0ec5('0x7'));router[_0x0ec5('0x8')]('/',controller[_0x0ec5('0x9')]);router[_0x0ec5('0xa')](_0x0ec5('0xb'),auth[_0x0ec5('0xc')](),controller[_0x0ec5('0xd')]);router[_0x0ec5('0x8')](_0x0ec5('0xe'),auth[_0x0ec5('0xc')](),controller[_0x0ec5('0xf')]);module[_0x0ec5('0x10')]=router; \ No newline at end of file +var _0xa323=['index','put','/:id','isAuthenticated','update','get','/download_log_file','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./license.controller'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa323,0x148));var _0x3a32=function(_0x18c4a8,_0x96c52e){_0x18c4a8=_0x18c4a8-0x0;var _0x189ff1=_0xa323[_0x18c4a8];return _0x189ff1;};'use strict';var multer=require('multer');var util=require(_0x3a32('0x0'));var path=require(_0x3a32('0x1'));var timeout=require(_0x3a32('0x2'));var express=require(_0x3a32('0x3'));var router=express['Router']();var fs_extra=require(_0x3a32('0x4'));var auth=require(_0x3a32('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3a32('0x6'));var controller=require(_0x3a32('0x7'));router['get']('/',controller[_0x3a32('0x8')]);router[_0x3a32('0x9')](_0x3a32('0xa'),auth[_0x3a32('0xb')](),controller[_0x3a32('0xc')]);router[_0x3a32('0xd')](_0x3a32('0xe'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x3a32('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f3ab6f2..ff2a53c 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 _0x10a4=['TEXT','STRING','sequelize','exports'];(function(_0x2c0689,_0x357667){var _0x25762b=function(_0x224bdd){while(--_0x224bdd){_0x2c0689['push'](_0x2c0689['shift']());}};_0x25762b(++_0x357667);}(_0x10a4,0xba));var _0x410a=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0x10a4[_0x296e0e];return _0x101c03;};'use strict';var Sequelize=require(_0x410a('0x0'));module[_0x410a('0x1')]={'license':{'type':Sequelize[_0x410a('0x2')]},'data1':{'type':Sequelize[_0x410a('0x3')]},'data2':{'type':Sequelize[_0x410a('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5360=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x5360,0x8f));var _0x0536=function(_0x4a057c,_0x265107){_0x4a057c=_0x4a057c-0x0;var _0x4ff457=_0x5360[_0x4a057c];return _0x4ff457;};'use strict';var Sequelize=require(_0x0536('0x0'));module[_0x0536('0x1')]={'license':{'type':Sequelize[_0x0536('0x2')]},'data1':{'type':Sequelize[_0x0536('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x0536('0x4')],'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 f2e34a4..26c749c 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 _0x02c1=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','keys','License','query','filters','intersection','model','attributes','fields','length','merge','catch','body','find','params','get','key','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x02c1,0x1a1));var _0x102c=function(_0x5a9fb8,_0x5b5240){_0x5a9fb8=_0x5a9fb8-0x0;var _0x7b78a6=_0x02c1[_0x5a9fb8];return _0x7b78a6;};'use strict';var emlformat=require(_0x102c('0x0'));var rimraf=require(_0x102c('0x1'));var zipdir=require(_0x102c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x102c('0x3'));var moment=require(_0x102c('0x4'));var BPromise=require(_0x102c('0x5'));var Mustache=require(_0x102c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x102c('0x7'));var csv=require('to-csv');var ejs=require(_0x102c('0x8'));var fs=require('fs');var fs_extra=require(_0x102c('0x9'));var _=require(_0x102c('0xa'));var squel=require(_0x102c('0xb'));var crypto=require(_0x102c('0xc'));var jsforce=require(_0x102c('0xd'));var deskjs=require(_0x102c('0xe'));var toCsv=require(_0x102c('0xf'));var querystring=require('querystring');var Papa=require(_0x102c('0x10'));var Redis=require(_0x102c('0x11'));var authService=require(_0x102c('0x12'));var qs=require(_0x102c('0x13'));var as=require(_0x102c('0x14'));var hardwareService=require(_0x102c('0x15'));var logger=require(_0x102c('0x16'))(_0x102c('0x17'));var utils=require(_0x102c('0x18'));var config=require(_0x102c('0x19'));var licenseUtil=require(_0x102c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x483a19,_0x1e48fc){_0x1e48fc=_0x1e48fc||0xcc;return function(_0x573453){if(_0x573453){return _0x483a19[_0x102c('0x1b')](_0x1e48fc);}return _0x483a19[_0x102c('0x1c')](_0x1e48fc)[_0x102c('0x1d')]();};}function respondWithResult(_0x151b88,_0x1bd222){_0x1bd222=_0x1bd222||0xc8;return function(_0xfa873){if(_0xfa873){return _0x151b88[_0x102c('0x1c')](_0x1bd222)['json'](_0xfa873);}};}function respondWithFilteredResult(_0x11fc4f,_0x45d90e){return function(_0x562fad){if(_0x562fad){var _0x503ebd=typeof _0x45d90e[_0x102c('0x1e')]==='undefined'&&typeof _0x45d90e[_0x102c('0x1f')]==='undefined';var _0x2c9563=_0x562fad[_0x102c('0x20')];var _0x583490=_0x503ebd?0x0:_0x45d90e[_0x102c('0x1e')];var _0x1bddd1=_0x503ebd?_0x562fad[_0x102c('0x20')]:_0x45d90e['offset']+_0x45d90e[_0x102c('0x1f')];var _0x4a09ef;if(_0x1bddd1>=_0x2c9563){_0x1bddd1=_0x2c9563;_0x4a09ef=0xc8;}else{_0x4a09ef=0xce;}_0x11fc4f['status'](_0x4a09ef);return _0x11fc4f[_0x102c('0x21')](_0x102c('0x22'),_0x583490+'-'+_0x1bddd1+'/'+_0x2c9563)['json'](_0x562fad);}return null;};}function patchUpdates(_0x214d86){return function(_0x4576e1){try{jsonpatch[_0x102c('0x23')](_0x4576e1,_0x214d86,!![]);}catch(_0x258e1d){return BPromise[_0x102c('0x24')](_0x258e1d);}return _0x4576e1[_0x102c('0x25')]();};}function saveUpdates(_0x2304ba,_0x2e31df){return function(_0x1a2fe2){if(_0x1a2fe2){return _0x1a2fe2[_0x102c('0x26')](_0x2304ba)[_0x102c('0x27')](function(_0x1a38b0){return _0x1a38b0;});}return null;};}function removeEntity(_0x1cb066,_0x298672){return function(_0x1d6a7e){if(_0x1d6a7e){return _0x1d6a7e[_0x102c('0x28')]()['then'](function(){_0x1cb066['status'](0xcc)[_0x102c('0x1d')]();});}};}function handleEntityNotFound(_0x431227,_0x51c73b){return function(_0x155916){if(!_0x155916){_0x431227['sendStatus'](0x194);}return _0x155916;};}function handleError(_0x240f30,_0x410473){_0x410473=_0x410473||0x1f4;return function(_0x400392){logger[_0x102c('0x29')](_0x400392[_0x102c('0x2a')]);if(_0x400392[_0x102c('0x2b')]){delete _0x400392[_0x102c('0x2b')];}_0x240f30[_0x102c('0x1c')](_0x410473)[_0x102c('0x2c')](_0x400392);};}var utilLicense=require(_0x102c('0x1a'));exports['index']=function(_0x312689,_0x14058b){var _0x39cb80={'raw':!![],'where':{'id':0x1}},_0xe25f1d={};_0xe25f1d['model']=_[_0x102c('0x2d')](db[_0x102c('0x2e')]['rawAttributes']);_0xe25f1d[_0x102c('0x2f')]=_[_0x102c('0x2d')](_0x312689[_0x102c('0x2f')]);_0xe25f1d[_0x102c('0x30')]=_[_0x102c('0x31')](_0xe25f1d[_0x102c('0x32')],_0xe25f1d[_0x102c('0x2f')]);_0x39cb80[_0x102c('0x33')]=_[_0x102c('0x31')](_0xe25f1d['model'],qs[_0x102c('0x34')](_0x312689[_0x102c('0x2f')]['fields']));_0x39cb80[_0x102c('0x33')]=_0x39cb80['attributes'][_0x102c('0x35')]?_0x39cb80['attributes']:_0xe25f1d[_0x102c('0x32')];_0x39cb80=_[_0x102c('0x36')]({},_0x39cb80,_0x312689['options']);return utilLicense['getLicense'](_0x39cb80)[_0x102c('0x27')](respondWithResult(_0x14058b,null))[_0x102c('0x37')](handleError(_0x14058b,null));};exports['update']=function(_0x3e9c92,_0x12c165){if(_0x3e9c92[_0x102c('0x38')]['id']){delete _0x3e9c92[_0x102c('0x38')]['id'];}return db['License'][_0x102c('0x39')]({'where':{'id':_0x3e9c92[_0x102c('0x3a')]['id']}})[_0x102c('0x27')](handleEntityNotFound(_0x12c165,null))['then'](function(_0x1ec743){var _0x1f5ded=_0x1ec743[_0x102c('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1f5ded,_0x3e9c92[_0x102c('0x38')][_0x102c('0x3c')]);})['then'](function(_0x4cb842){if(!_0x4cb842['demo']){return saveUpdates(_0x3e9c92[_0x102c('0x38')],null);}return _0x4cb842;})['then'](respondWithResult(_0x12c165,null))[_0x102c('0x37')](handleError(_0x12c165,null));};exports[_0x102c('0x3d')]=function(_0x71db68,_0x2f07f5){var _0x21e345=_0x102c('0x3e');var _0x28802e=path[_0x102c('0x3f')](_0x102c('0x40'),_0x102c('0x41'),'xcally',_0x21e345);_0x2f07f5[_0x102c('0x42')](_0x102c('0x43'),_0x102c('0x44')+_0x21e345);_0x2f07f5['set'](_0x102c('0x45'),_0x102c('0x46'));_0x2f07f5[_0x102c('0x47')](_0x28802e);}; \ No newline at end of file +var _0xea4c=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','find','params','get','checkLicense','body','key','demo','downloadLogFile','license-info.log','/var','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv'];(function(_0x532f79,_0xb8a7c7){var _0x542846=function(_0x1caad1){while(--_0x1caad1){_0x532f79['push'](_0x532f79['shift']());}};_0x542846(++_0xb8a7c7);}(_0xea4c,0x1f0));var _0xcea4=function(_0xbbcffd,_0x51b649){_0xbbcffd=_0xbbcffd-0x0;var _0x211c85=_0xea4c[_0xbbcffd];return _0x211c85;};'use strict';var emlformat=require(_0xcea4('0x0'));var rimraf=require(_0xcea4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcea4('0x2'));var rp=require(_0xcea4('0x3'));var moment=require(_0xcea4('0x4'));var BPromise=require(_0xcea4('0x5'));var Mustache=require('mustache');var util=require(_0xcea4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcea4('0x7'));var ejs=require(_0xcea4('0x8'));var fs=require('fs');var fs_extra=require(_0xcea4('0x9'));var _=require(_0xcea4('0xa'));var squel=require(_0xcea4('0xb'));var crypto=require(_0xcea4('0xc'));var jsforce=require(_0xcea4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcea4('0x7'));var querystring=require(_0xcea4('0xe'));var Papa=require(_0xcea4('0xf'));var Redis=require(_0xcea4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcea4('0x11'));var as=require(_0xcea4('0x12'));var hardwareService=require(_0xcea4('0x13'));var logger=require(_0xcea4('0x14'))('api');var utils=require(_0xcea4('0x15'));var config=require(_0xcea4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcea4('0x17'))['db'];function respondWithStatusCode(_0x4ac888,_0x2fee5f){_0x2fee5f=_0x2fee5f||0xcc;return function(_0x27a7f1){if(_0x27a7f1){return _0x4ac888[_0xcea4('0x18')](_0x2fee5f);}return _0x4ac888[_0xcea4('0x19')](_0x2fee5f)[_0xcea4('0x1a')]();};}function respondWithResult(_0x4347a1,_0x1cdadc){_0x1cdadc=_0x1cdadc||0xc8;return function(_0x3034a1){if(_0x3034a1){return _0x4347a1[_0xcea4('0x19')](_0x1cdadc)[_0xcea4('0x1b')](_0x3034a1);}};}function respondWithFilteredResult(_0x756b01,_0x21e97f){return function(_0x1af6f8){if(_0x1af6f8){var _0x38f76e=typeof _0x21e97f[_0xcea4('0x1c')]==='undefined'&&typeof _0x21e97f[_0xcea4('0x1d')]===_0xcea4('0x1e');var _0x218763=_0x1af6f8[_0xcea4('0x1f')];var _0x2fccfd=_0x38f76e?0x0:_0x21e97f[_0xcea4('0x1c')];var _0x3447de=_0x38f76e?_0x1af6f8['count']:_0x21e97f['offset']+_0x21e97f[_0xcea4('0x1d')];var _0x45df42;if(_0x3447de>=_0x218763){_0x3447de=_0x218763;_0x45df42=0xc8;}else{_0x45df42=0xce;}_0x756b01[_0xcea4('0x19')](_0x45df42);return _0x756b01[_0xcea4('0x20')](_0xcea4('0x21'),_0x2fccfd+'-'+_0x3447de+'/'+_0x218763)['json'](_0x1af6f8);}return null;};}function patchUpdates(_0xa8b07e){return function(_0xaaedf7){try{jsonpatch[_0xcea4('0x22')](_0xaaedf7,_0xa8b07e,!![]);}catch(_0x2705e2){return BPromise['reject'](_0x2705e2);}return _0xaaedf7[_0xcea4('0x23')]();};}function saveUpdates(_0x479dc5,_0x931b26){return function(_0x1e10c7){if(_0x1e10c7){return _0x1e10c7['update'](_0x479dc5)['then'](function(_0x17dd0f){return _0x17dd0f;});}return null;};}function removeEntity(_0x338b74,_0x5e4cb0){return function(_0x53fd71){if(_0x53fd71){return _0x53fd71['destroy']()[_0xcea4('0x24')](function(){_0x338b74[_0xcea4('0x19')](0xcc)[_0xcea4('0x1a')]();});}};}function handleEntityNotFound(_0x5150f6,_0x751207){return function(_0x1e4864){if(!_0x1e4864){_0x5150f6['sendStatus'](0x194);}return _0x1e4864;};}function handleError(_0x55290b,_0x916015){_0x916015=_0x916015||0x1f4;return function(_0x565ce4){logger[_0xcea4('0x25')](_0x565ce4['stack']);if(_0x565ce4[_0xcea4('0x26')]){delete _0x565ce4['name'];}_0x55290b[_0xcea4('0x19')](_0x916015)[_0xcea4('0x27')](_0x565ce4);};}var utilLicense=require(_0xcea4('0x28'));exports[_0xcea4('0x29')]=function(_0x27bcc1,_0x4afc4b){var _0x2b899e={'raw':!![],'where':{'id':0x1}},_0x3fbad6={};_0x3fbad6[_0xcea4('0x2a')]=_[_0xcea4('0x2b')](db[_0xcea4('0x2c')][_0xcea4('0x2d')]);_0x3fbad6['query']=_[_0xcea4('0x2b')](_0x27bcc1[_0xcea4('0x2e')]);_0x3fbad6[_0xcea4('0x2f')]=_[_0xcea4('0x30')](_0x3fbad6[_0xcea4('0x2a')],_0x3fbad6[_0xcea4('0x2e')]);_0x2b899e[_0xcea4('0x31')]=_[_0xcea4('0x30')](_0x3fbad6[_0xcea4('0x2a')],qs[_0xcea4('0x32')](_0x27bcc1['query'][_0xcea4('0x32')]));_0x2b899e[_0xcea4('0x31')]=_0x2b899e[_0xcea4('0x31')][_0xcea4('0x33')]?_0x2b899e[_0xcea4('0x31')]:_0x3fbad6[_0xcea4('0x2a')];_0x2b899e=_[_0xcea4('0x34')]({},_0x2b899e,_0x27bcc1[_0xcea4('0x35')]);return utilLicense[_0xcea4('0x36')](_0x2b899e)[_0xcea4('0x24')](respondWithResult(_0x4afc4b,null))[_0xcea4('0x37')](handleError(_0x4afc4b,null));};exports['update']=function(_0x5a391a,_0x142d31){if(_0x5a391a['body']['id']){delete _0x5a391a['body']['id'];}return db[_0xcea4('0x2c')][_0xcea4('0x38')]({'where':{'id':_0x5a391a[_0xcea4('0x39')]['id']}})[_0xcea4('0x24')](handleEntityNotFound(_0x142d31,null))[_0xcea4('0x24')](function(_0x583784){var _0x38e002=_0x583784[_0xcea4('0x3a')]({'plain':!![]});return utilLicense[_0xcea4('0x3b')](_0x38e002,_0x5a391a[_0xcea4('0x3c')][_0xcea4('0x3d')]);})['then'](function(_0x5ccf57){if(!_0x5ccf57[_0xcea4('0x3e')]){return saveUpdates(_0x5a391a[_0xcea4('0x3c')],null);}return _0x5ccf57;})['then'](respondWithResult(_0x142d31,null))[_0xcea4('0x37')](handleError(_0x142d31,null));};exports[_0xcea4('0x3f')]=function(_0x47d096,_0x5e9514){var _0x2a9f36=_0xcea4('0x40');var _0x4e83d5=path['join'](_0xcea4('0x41'),'log',_0xcea4('0x42'),_0x2a9f36);_0x5e9514['setHeader'](_0xcea4('0x43'),_0xcea4('0x44')+_0x2a9f36);_0x5e9514['set'](_0xcea4('0x45'),_0xcea4('0x46'));_0x5e9514[_0xcea4('0x47')](_0x4e83d5);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 569ab56..e9d1763 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 _0xa937=['rimraf','../../config/environment','exports','define','License','license','util','api','moment','bluebird','request-promise','path'];(function(_0x4fe5b6,_0x733bc2){var _0x466581=function(_0x1eaffd){while(--_0x1eaffd){_0x4fe5b6['push'](_0x4fe5b6['shift']());}};_0x466581(++_0x733bc2);}(_0xa937,0x66));var _0x7a93=function(_0x2f3ab7,_0x1199dd){_0x2f3ab7=_0x2f3ab7-0x0;var _0xa790b1=_0xa937[_0x2f3ab7];return _0xa790b1;};'use strict';var _=require('lodash');var util=require(_0x7a93('0x0'));var logger=require('../../config/logger')(_0x7a93('0x1'));var moment=require(_0x7a93('0x2'));var BPromise=require(_0x7a93('0x3'));var rp=require(_0x7a93('0x4'));var fs=require('fs');var path=require(_0x7a93('0x5'));var rimraf=require(_0x7a93('0x6'));var config=require(_0x7a93('0x7'));var attributes=require('./license.attributes');module[_0x7a93('0x8')]=function(_0x27bd3a,_0x2b50b7){return _0x27bd3a[_0x7a93('0x9')](_0x7a93('0xa'),attributes,{'tableName':_0x7a93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73e3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','license'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x73e3,0x15e));var _0x373e=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x73e3[_0x715d76];return _0x48fe88;};'use strict';var _=require(_0x373e('0x0'));var util=require(_0x373e('0x1'));var logger=require(_0x373e('0x2'))(_0x373e('0x3'));var moment=require(_0x373e('0x4'));var BPromise=require(_0x373e('0x5'));var rp=require(_0x373e('0x6'));var fs=require('fs');var path=require(_0x373e('0x7'));var rimraf=require(_0x373e('0x8'));var config=require(_0x373e('0x9'));var attributes=require(_0x373e('0xa'));module[_0x373e('0xb')]=function(_0x3cc7f,_0x1b15c5){return _0x3cc7f['define'](_0x373e('0xc'),attributes,{'tableName':_0x373e('0xd'),'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 8e25506..1dd0fa1 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 _0xf2d8=['moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','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'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf2d8,0x18d));var _0x8f2d=function(_0x31300c,_0x2823e1){_0x31300c=_0x31300c-0x0;var _0x462408=_0xf2d8[_0x31300c];return _0x462408;};'use strict';var _=require(_0x8f2d('0x0'));var util=require(_0x8f2d('0x1'));var moment=require(_0x8f2d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f2d('0x3'));var db=require(_0x8f2d('0x4'))['db'];var utils=require(_0x8f2d('0x5'));var logger=require('../../config/logger')(_0x8f2d('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f2d('0x7'));var client=jayson[_0x8f2d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4052ba,_0x4909b4,_0x45025e){return new BPromise(function(_0x19cd52,_0x11e957){return client['request'](_0x4052ba,_0x45025e)[_0x8f2d('0x9')](function(_0x4eec06){logger[_0x8f2d('0xa')]('License,\x20%s,\x20%s',_0x4909b4,_0x8f2d('0xb'));logger[_0x8f2d('0xc')](_0x8f2d('0xd'),_0x4909b4,_0x8f2d('0xb'),JSON[_0x8f2d('0xe')](_0x4eec06));if(_0x4eec06[_0x8f2d('0xf')]){if(_0x4eec06[_0x8f2d('0xf')][_0x8f2d('0x10')]===0x1f4){logger[_0x8f2d('0xf')](_0x8f2d('0x11'),_0x4909b4,_0x4eec06[_0x8f2d('0xf')][_0x8f2d('0x12')]);return _0x11e957(_0x4eec06[_0x8f2d('0xf')]['message']);}logger['error'](_0x8f2d('0x11'),_0x4909b4,_0x4eec06['error'][_0x8f2d('0x12')]);return _0x19cd52(_0x4eec06[_0x8f2d('0xf')][_0x8f2d('0x12')]);}else{logger[_0x8f2d('0xa')]('License,\x20%s,\x20%s',_0x4909b4,_0x8f2d('0xb'));_0x19cd52(_0x4eec06[_0x8f2d('0x13')][_0x8f2d('0x12')]);}})[_0x8f2d('0x14')](function(_0x4aebd7){logger['error'](_0x8f2d('0x11'),_0x4909b4,_0x4aebd7);_0x11e957(_0x4aebd7);});});} \ No newline at end of file +var _0xa050=['code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x423004,_0x1d6350){var _0x1c6bcc=function(_0x2ca2ed){while(--_0x2ca2ed){_0x423004['push'](_0x423004['shift']());}};_0x1c6bcc(++_0x1d6350);}(_0xa050,0x112));var _0x0a05=function(_0x2902df,_0x35d6c2){_0x2902df=_0x2902df-0x0;var _0x1e27b4=_0xa050[_0x2902df];return _0x1e27b4;};'use strict';var _=require('lodash');var util=require(_0x0a05('0x0'));var moment=require(_0x0a05('0x1'));var BPromise=require('bluebird');var rs=require(_0x0a05('0x2'));var fs=require('fs');var Redis=require(_0x0a05('0x3'));var db=require(_0x0a05('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0a05('0x5'));var config=require('../../config/environment');var jayson=require(_0x0a05('0x6'));var client=jayson[_0x0a05('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd20a,_0x459a81,_0x1f8299){return new BPromise(function(_0x3f11f1,_0x27c1cf){return client['request'](_0x1bd20a,_0x1f8299)['then'](function(_0x430357){logger['info'](_0x0a05('0x8'),_0x459a81,_0x0a05('0x9'));logger[_0x0a05('0xa')](_0x0a05('0xb'),_0x459a81,_0x0a05('0x9'),JSON[_0x0a05('0xc')](_0x430357));if(_0x430357[_0x0a05('0xd')]){if(_0x430357[_0x0a05('0xd')][_0x0a05('0xe')]===0x1f4){logger[_0x0a05('0xd')]('License,\x20%s,\x20%s',_0x459a81,_0x430357[_0x0a05('0xd')][_0x0a05('0xf')]);return _0x27c1cf(_0x430357['error'][_0x0a05('0xf')]);}logger[_0x0a05('0xd')](_0x0a05('0x8'),_0x459a81,_0x430357[_0x0a05('0xd')]['message']);return _0x3f11f1(_0x430357[_0x0a05('0xd')]['message']);}else{logger[_0x0a05('0x10')](_0x0a05('0x8'),_0x459a81,_0x0a05('0x9'));_0x3f11f1(_0x430357[_0x0a05('0x11')]['message']);}})['catch'](function(_0x5a73b0){logger['error'](_0x0a05('0x8'),_0x459a81,_0x5a73b0);_0x27c1cf(_0x5a73b0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 2d01b36..5b580b4 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 _0x20b0=['/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','/:id/dispositions','addDisposition','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe'];(function(_0x1afada,_0x3877e5){var _0x596776=function(_0x52c153){while(--_0x52c153){_0x1afada['push'](_0x1afada['shift']());}};_0x596776(++_0x3877e5);}(_0x20b0,0xdd));var _0x020b=function(_0x2aac5f,_0x3393b6){_0x2aac5f=_0x2aac5f-0x0;var _0x3b746c=_0x20b0[_0x2aac5f];return _0x3b746c;};'use strict';var multer=require(_0x020b('0x0'));var util=require(_0x020b('0x1'));var path=require(_0x020b('0x2'));var timeout=require(_0x020b('0x3'));var express=require(_0x020b('0x4'));var router=express['Router']();var fs_extra=require(_0x020b('0x5'));var auth=require(_0x020b('0x6'));var interaction=require(_0x020b('0x7'));var config=require(_0x020b('0x8'));var controller=require(_0x020b('0x9'));router[_0x020b('0xa')]('/',auth[_0x020b('0xb')](),controller[_0x020b('0xc')]);router[_0x020b('0xa')](_0x020b('0xd'),auth[_0x020b('0xb')](),controller['describe']);router[_0x020b('0xa')](_0x020b('0xe'),auth[_0x020b('0xb')](),controller[_0x020b('0xf')]);router[_0x020b('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x020b('0x10')]);router[_0x020b('0xa')](_0x020b('0x11'),auth['isAuthenticated'](),controller[_0x020b('0x12')]);router[_0x020b('0xa')](_0x020b('0x13'),auth[_0x020b('0xb')](),controller[_0x020b('0x14')]);router['get'](_0x020b('0x15'),auth[_0x020b('0xb')](),controller['getSmtp']);router[_0x020b('0xa')]('/:id/interactions',auth[_0x020b('0xb')](),controller[_0x020b('0x16')]);router[_0x020b('0xa')](_0x020b('0x17'),auth[_0x020b('0xb')](),controller[_0x020b('0x18')]);router[_0x020b('0xa')](_0x020b('0x19'),auth[_0x020b('0xb')](),controller[_0x020b('0x1a')]);router[_0x020b('0xa')](_0x020b('0x1b'),auth['isAuthenticated'](),controller[_0x020b('0x1c')]);router['get'](_0x020b('0x1d'),auth['isAuthenticated'](),controller['getAgents']);router[_0x020b('0x1e')](_0x020b('0x1f'),auth['isAuthenticated'](),controller[_0x020b('0x20')]);router['post']('/:id/canned_answers',auth[_0x020b('0xb')](),controller['addAnswer']);router[_0x020b('0x1e')]('/',auth[_0x020b('0xb')](),controller['create']);router['post'](_0x020b('0x13'),auth[_0x020b('0xb')](),controller['addImap']);router[_0x020b('0x1e')]('/:id/out_servers',auth[_0x020b('0xb')](),controller[_0x020b('0x21')]);router['post'](_0x020b('0x22'),auth[_0x020b('0xb')](),controller[_0x020b('0x23')]);router[_0x020b('0x1e')](_0x020b('0x17'),auth[_0x020b('0xb')](),controller[_0x020b('0x24')]);router[_0x020b('0x1e')](_0x020b('0x25'),auth[_0x020b('0xb')](),controller[_0x020b('0x26')]);router['post'](_0x020b('0x1d'),auth['isAuthenticated'](),controller[_0x020b('0x27')]);router[_0x020b('0x28')](_0x020b('0xe'),auth['isAuthenticated'](),controller[_0x020b('0x29')]);router[_0x020b('0x2a')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x020b('0x2a')](_0x020b('0x11'),auth[_0x020b('0xb')](),controller['removeAnswers']);router[_0x020b('0x2a')]('/:id/in_servers',auth[_0x020b('0xb')](),controller[_0x020b('0x2b')]);router['delete']('/:id/out_servers',auth[_0x020b('0xb')](),controller[_0x020b('0x2c')]);router[_0x020b('0x2a')]('/:id',auth[_0x020b('0xb')](),controller[_0x020b('0x2d')]);router[_0x020b('0x2a')](_0x020b('0x1d'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x020b('0x2e')]=router; \ No newline at end of file +var _0x4242=['/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','/describe','describe','/:id','isAuthenticated','show','get','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','/:id/dispositions','addDisposition','addAnswer','post','create','addImap','/:id/out_servers','addInteraction','addApplications'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4242,0x159));var _0x2424=function(_0x1ef106,_0x215a42){_0x1ef106=_0x1ef106-0x0;var _0x4a59a7=_0x4242[_0x1ef106];return _0x4a59a7;};'use strict';var multer=require(_0x2424('0x0'));var util=require(_0x2424('0x1'));var path=require('path');var timeout=require(_0x2424('0x2'));var express=require(_0x2424('0x3'));var router=express[_0x2424('0x4')]();var fs_extra=require(_0x2424('0x5'));var auth=require(_0x2424('0x6'));var interaction=require(_0x2424('0x7'));var config=require(_0x2424('0x8'));var controller=require(_0x2424('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2424('0xa'),auth['isAuthenticated'](),controller[_0x2424('0xb')]);router['get'](_0x2424('0xc'),auth[_0x2424('0xd')](),controller[_0x2424('0xe')]);router['get']('/:id/dispositions',auth[_0x2424('0xd')](),controller['getDispositions']);router[_0x2424('0xf')](_0x2424('0x10'),auth[_0x2424('0xd')](),controller[_0x2424('0x11')]);router[_0x2424('0xf')](_0x2424('0x12'),auth[_0x2424('0xd')](),controller[_0x2424('0x13')]);router[_0x2424('0xf')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x2424('0x14')]);router['get'](_0x2424('0x15'),auth[_0x2424('0xd')](),controller[_0x2424('0x16')]);router[_0x2424('0xf')](_0x2424('0x17'),auth[_0x2424('0xd')](),controller[_0x2424('0x18')]);router[_0x2424('0xf')](_0x2424('0x19'),auth[_0x2424('0xd')](),controller[_0x2424('0x1a')]);router[_0x2424('0xf')]('/:id/verify',auth['isAuthenticated'](),controller[_0x2424('0x1b')]);router[_0x2424('0xf')](_0x2424('0x1c'),auth[_0x2424('0xd')](),controller[_0x2424('0x1d')]);router['post'](_0x2424('0x1e'),auth[_0x2424('0xd')](),controller[_0x2424('0x1f')]);router['post'](_0x2424('0x10'),auth[_0x2424('0xd')](),controller[_0x2424('0x20')]);router[_0x2424('0x21')]('/',auth['isAuthenticated'](),controller[_0x2424('0x22')]);router[_0x2424('0x21')](_0x2424('0x12'),auth[_0x2424('0xd')](),controller[_0x2424('0x23')]);router[_0x2424('0x21')](_0x2424('0x24'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x2424('0x21')](_0x2424('0x15'),auth[_0x2424('0xd')](),controller[_0x2424('0x25')]);router[_0x2424('0x21')](_0x2424('0x17'),auth['isAuthenticated'](),controller[_0x2424('0x26')]);router[_0x2424('0x21')](_0x2424('0x27'),auth[_0x2424('0xd')](),controller['send']);router[_0x2424('0x21')]('/:id/users',auth[_0x2424('0xd')](),controller[_0x2424('0x28')]);router[_0x2424('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x2424('0x2a')]);router[_0x2424('0x2b')](_0x2424('0x1e'),auth[_0x2424('0xd')](),controller[_0x2424('0x2c')]);router[_0x2424('0x2b')](_0x2424('0x10'),auth[_0x2424('0xd')](),controller[_0x2424('0x2d')]);router['delete'](_0x2424('0x12'),auth[_0x2424('0xd')](),controller['removeImap']);router[_0x2424('0x2b')](_0x2424('0x24'),auth[_0x2424('0xd')](),controller[_0x2424('0x2e')]);router[_0x2424('0x2b')](_0x2424('0xc'),auth['isAuthenticated'](),controller[_0x2424('0x2f')]);router[_0x2424('0x2b')]('/:id/users',auth[_0x2424('0xd')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3ca41b6..dfaafd3 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 _0xfdce=['mandatoryDispositionPauseId','setDataValue','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x436436,_0x556682){var _0x369bbe=function(_0x10f28e){while(--_0x10f28e){_0x436436['push'](_0x436436['shift']());}};_0x369bbe(++_0x556682);}(_0xfdce,0x17f));var _0xefdc=function(_0x21fe98,_0x55db4c){_0x21fe98=_0x21fe98-0x0;var _0x19dde3=_0xfdce[_0x21fe98];return _0x19dde3;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xefdc('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xefdc('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0xefdc('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0xefdc('0x2')]},'markAsUnread':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xefdc('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xefdc('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xefdc('0x5');}},'notificationSound':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xefdc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xefdc('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xefdc('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3a9241){if(!_0x3a9241)this['setDataValue'](_0xefdc('0x8'),null);this[_0xefdc('0x9')]('mandatoryDisposition',_0x3a9241);}},'provider':{'type':Sequelize[_0xefdc('0xa')](_0xefdc('0xb'),_0xefdc('0xc'),_0xefdc('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xefdc('0xe')](_0xefdc('0xf')))return _0xefdc('0x10');return this[_0xefdc('0xe')](_0xefdc('0xf'));},'set':function(_0x3b97ee){if(_0x3b97ee===_0xefdc('0x10'))_0x3b97ee=null;return this['setDataValue'](_0xefdc('0xf'),_0x3b97ee);}}}; \ No newline at end of file +var _0xca20=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING'];(function(_0x5d78cf,_0x2ada23){var _0x55d96c=function(_0x57ae26){while(--_0x57ae26){_0x5d78cf['push'](_0x5d78cf['shift']());}};_0x55d96c(++_0x2ada23);}(_0xca20,0x95));var _0x0ca2=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0xca20[_0x623e7];return _0x121131;};'use strict';var Sequelize=require(_0x0ca2('0x0'));module[_0x0ca2('0x1')]={'description':{'type':Sequelize[_0x0ca2('0x2')]},'name':{'type':Sequelize[_0x0ca2('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x0ca2('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0ca2('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0ca2('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x0ca2('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x0ca2('0x4')]},'markAsUnread':{'type':Sequelize[_0x0ca2('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0ca2('0x2')],'allowNull':![],'defaultValue':_0x0ca2('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0ca2('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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0ca2('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0ca2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0ca2('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0ca2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0ca2('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x0ca2('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x0ca2('0x3')],'defaultValue':![],'comment':_0x0ca2('0x8'),'set':function(_0x489e0b){if(!_0x489e0b)this[_0x0ca2('0x9')](_0x0ca2('0xa'),null);this[_0x0ca2('0x9')]('mandatoryDisposition',_0x489e0b);}},'provider':{'type':Sequelize[_0x0ca2('0xb')](_0x0ca2('0xc'),_0x0ca2('0xd'),_0x0ca2('0xe'),_0x0ca2('0xf')),'defaultValue':null,'get':function(){if(!this[_0x0ca2('0x10')](_0x0ca2('0x11')))return _0x0ca2('0x12');return this['getDataValue'](_0x0ca2('0x11'));},'set':function(_0x5934bb){if(_0x5934bb==='custom')_0x5934bb=null;return this['setDataValue'](_0x0ca2('0x11'),_0x5934bb);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3746d1f..f6ffa64 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 _0x5bbf=['userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','update','MailAccounts','destroy','stack','name','send','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','findAll','rows','params','rawAttributes','body','provider','custom','secure','MailServerIn','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','merge','includeAll','include','removeDispositions','find','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','create','email','ListId','isNil','active','description','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','ids','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','color','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','format','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','List','messageId','from','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents'];(function(_0xe616ea,_0x4acffb){var _0x186020=function(_0x43c9db){while(--_0x43c9db){_0xe616ea['push'](_0xe616ea['shift']());}};_0x186020(++_0x4acffb);}(_0x5bbf,0x18a));var _0xf5bb=function(_0x19dc2d,_0x2b4a8b){_0x19dc2d=_0x19dc2d-0x0;var _0x145a78=_0x5bbf[_0x19dc2d];return _0x145a78;};'use strict';var moment=require(_0xf5bb('0x0'));var BPromise=require(_0xf5bb('0x1'));var util=require(_0xf5bb('0x2'));var path=require(_0xf5bb('0x3'));var _=require(_0xf5bb('0x4'));var juice=require(_0xf5bb('0x5'));var Redis=require(_0xf5bb('0x6'));var qs=require(_0xf5bb('0x7'));var logger=require(_0xf5bb('0x8'))(_0xf5bb('0x9'));var config=require(_0xf5bb('0xa'));var db=require(_0xf5bb('0xb'))['db'];config[_0xf5bb('0xc')]=_[_0xf5bb('0xd')](config[_0xf5bb('0xc')],{'host':_0xf5bb('0xe'),'port':0x18eb});var socket=require(_0xf5bb('0xf'))(new Redis(config[_0xf5bb('0xc')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xf5bb('0x10'));var client=jayson[_0xf5bb('0x11')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3bc0db,_0x1230a6,_0xd5f276,_0xc95250){return new BPromise(function(_0x38c3cd,_0x439dd5){var _0x380c40=_0xc95250||client;return _0x380c40[_0xf5bb('0x12')](_0x3bc0db,_0xd5f276)[_0xf5bb('0x13')](function(_0x18437c){logger[_0xf5bb('0x14')](_0xf5bb('0x15'),_0x1230a6,_0xf5bb('0x16'));logger[_0xf5bb('0x17')](_0xf5bb('0x18'),_0x1230a6,_0xf5bb('0x16'),JSON[_0xf5bb('0x19')](_0x18437c));if(_0x18437c[_0xf5bb('0x1a')]){if(_0x18437c[_0xf5bb('0x1a')][_0xf5bb('0x1b')]===0x1f4){logger[_0xf5bb('0x1a')]('MailAccount,\x20%s,\x20%s',_0x1230a6,_0x18437c[_0xf5bb('0x1a')][_0xf5bb('0x1c')]);return _0x439dd5(_0x18437c[_0xf5bb('0x1a')]['message']);}logger[_0xf5bb('0x1a')]('MailAccount,\x20%s,\x20%s',_0x1230a6,_0x18437c[_0xf5bb('0x1a')]['message']);return _0x38c3cd(_0x18437c[_0xf5bb('0x1a')]['message']);}else{logger[_0xf5bb('0x14')]('MailAccount,\x20%s,\x20%s',_0x1230a6,_0xf5bb('0x16'));_0x38c3cd(_0x18437c['result'][_0xf5bb('0x1c')]);}})[_0xf5bb('0x1d')](function(_0x123749){logger['error'](_0xf5bb('0x15'),_0x1230a6,_0x123749);_0x439dd5(_0x123749);});});}function respondWithStatusCode(_0x29a5af,_0x9ae04a){_0x9ae04a=_0x9ae04a||0xcc;return function(_0x857037){if(_0x857037){return _0x29a5af[_0xf5bb('0x1e')](_0x9ae04a);}return _0x29a5af[_0xf5bb('0x1f')](_0x9ae04a)[_0xf5bb('0x20')]();};}function respondWithResult(_0x547bb2,_0x2bad91){_0x2bad91=_0x2bad91||0xc8;return function(_0x451e9a){if(_0x451e9a){return _0x547bb2[_0xf5bb('0x1f')](_0x2bad91)[_0xf5bb('0x21')](_0x451e9a);}};}function respondWithFilteredResult(_0x28289c,_0x36d7bf){return function(_0x5c4be0){if(_0x5c4be0){var _0xebf6be=typeof _0x36d7bf[_0xf5bb('0x22')]===_0xf5bb('0x23')&&typeof _0x36d7bf['limit']===_0xf5bb('0x23');var _0x243ebd=_0x5c4be0[_0xf5bb('0x24')];var _0x54ff20=_0xebf6be?0x0:_0x36d7bf[_0xf5bb('0x22')];var _0x644bf3=_0xebf6be?_0x5c4be0['count']:_0x36d7bf[_0xf5bb('0x22')]+_0x36d7bf[_0xf5bb('0x25')];var _0x3aff44;if(_0x644bf3>=_0x243ebd){_0x644bf3=_0x243ebd;_0x3aff44=0xc8;}else{_0x3aff44=0xce;}_0x28289c['status'](_0x3aff44);return _0x28289c[_0xf5bb('0x26')]('Content-Range',_0x54ff20+'-'+_0x644bf3+'/'+_0x243ebd)[_0xf5bb('0x21')](_0x5c4be0);}return null;};}function saveUpdates(_0x3e9ec8){return function(_0x3e57e0){if(_0x3e57e0){return _0x3e57e0[_0xf5bb('0x27')](_0x3e9ec8)[_0xf5bb('0x13')](function(_0xf3fe88){return _0xf3fe88;});}return null;};}function removeEntity(_0x555ec8){return function(_0x3a0383){if(_0x3a0383){return _0x3a0383['destroy']()['then'](function(){var _0x5cffff=_0x3a0383['get']({'plain':!![]});var _0x2462d7=_0xf5bb('0x28');return db['UserProfileResource'][_0xf5bb('0x29')]({'where':{'type':_0x2462d7,'resourceId':_0x5cffff['id']}})[_0xf5bb('0x13')](function(){return _0x3a0383;});})[_0xf5bb('0x13')](function(){_0x555ec8[_0xf5bb('0x1f')](0xcc)[_0xf5bb('0x20')]();});}};}function handleEntityNotFound(_0x45977f){return function(_0x46db84){if(!_0x46db84){_0x45977f[_0xf5bb('0x1e')](0x194);}return _0x46db84;};}function handleError(_0x5d66d5,_0x56558e){_0x56558e=_0x56558e||0x1f4;return function(_0x20dc40){logger['error'](_0x20dc40[_0xf5bb('0x2a')]);if(_0x20dc40[_0xf5bb('0x2b')]){delete _0x20dc40[_0xf5bb('0x2b')];}_0x5d66d5[_0xf5bb('0x1f')](_0x56558e)[_0xf5bb('0x2c')](_0x20dc40);};}function getImapHost(_0xd509b5){switch(_0xd509b5){case _0xf5bb('0x2d'):return'imap.gmail.com';case _0xf5bb('0x2e'):return'imap.mail.yahoo.com';case _0xf5bb('0x2f'):return _0xf5bb('0x30');case _0xf5bb('0x31'):return _0xf5bb('0x32');}throw new Error(_0xf5bb('0x33'),_0xd509b5);}function getSmtpHost(_0x8e976d){switch(_0x8e976d){case _0xf5bb('0x2d'):return'smtp.gmail.com';case _0xf5bb('0x2e'):return _0xf5bb('0x34');case'hotmail':return _0xf5bb('0x35');case _0xf5bb('0x31'):return _0xf5bb('0x36');}throw new Error(_0xf5bb('0x33'),_0x8e976d);}function getAuthenticationOptions(_0x393f9e,_0x51e8c3){var _0x2f1ef0={};var _0x1d4a2a={};if(_0x393f9e){_0x2f1ef0['user']=_0x1d4a2a[_0xf5bb('0x37')]=_0x51e8c3[_0xf5bb('0x38')];_0x2f1ef0[_0xf5bb('0x39')]=_0x1d4a2a[_0xf5bb('0x3a')]=_0x51e8c3[_0xf5bb('0x39')];if(_0x51e8c3[_0xf5bb('0x3b')]){_0x2f1ef0[_0xf5bb('0x3b')]=_0x1d4a2a[_0xf5bb('0x3b')]=!![];_0x2f1ef0[_0xf5bb('0x3c')]=_0x1d4a2a[_0xf5bb('0x3c')]=_0x51e8c3['CloudProviderId'];_0x2f1ef0['password']=_0x1d4a2a[_0xf5bb('0x3a')]=null;}else{_0x2f1ef0[_0xf5bb('0x3c')]=_0x1d4a2a[_0xf5bb('0x3c')]=null;}_0x2f1ef0['host']=getImapHost(_0x393f9e);_0x2f1ef0[_0xf5bb('0x3d')]=0x3e1;_0x1d4a2a[_0xf5bb('0x3e')]=getSmtpHost(_0x393f9e);_0x1d4a2a[_0xf5bb('0x3d')]=0x24b;_0x1d4a2a['secure']=![];_0x2f1ef0[_0xf5bb('0x3f')]=_0x1d4a2a['service']=null;}else{if(_0x51e8c3[_0xf5bb('0x40')]){_0x2f1ef0[_0xf5bb('0x37')]=_0x1d4a2a[_0xf5bb('0x37')]=_0x51e8c3[_0xf5bb('0x38')];_0x2f1ef0[_0xf5bb('0x39')]=_0x1d4a2a['pass']=_0x51e8c3['password'];}else{_0x2f1ef0[_0xf5bb('0x40')]=_0x1d4a2a[_0xf5bb('0x40')]=![];_0x2f1ef0[_0xf5bb('0x37')]=_0x1d4a2a['user']=null;_0x2f1ef0[_0xf5bb('0x39')]=_0x1d4a2a['pass']=null;}_0x2f1ef0['host']=_0x51e8c3['Imap'][_0xf5bb('0x3e')];_0x2f1ef0[_0xf5bb('0x3d')]=_0x51e8c3[_0xf5bb('0x41')][_0xf5bb('0x3d')];_0x1d4a2a[_0xf5bb('0x3e')]=_0x51e8c3['Smtp'][_0xf5bb('0x3e')];_0x1d4a2a[_0xf5bb('0x3d')]=_0x51e8c3[_0xf5bb('0x42')][_0xf5bb('0x3d')];}return{'Imap':_0x2f1ef0,'Smtp':_0x1d4a2a};}exports[_0xf5bb('0x43')]=function(_0x56d352,_0x213020){var _0x283c44={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db[_0xf5bb('0x45')],'as':_0xf5bb('0x46')}]},_0x5eddc7={},_0x8366fc={'count':0x0,'rows':[]};var _0x574e11=_[_0xf5bb('0x47')](db[_0xf5bb('0x48')]['rawAttributes'],function(_0xf562db){return{'name':_0xf562db['fieldName'],'type':_0xf562db[_0xf5bb('0x49')]['key']};});_0x5eddc7[_0xf5bb('0x4a')]=_[_0xf5bb('0x47')](_0x574e11,_0xf5bb('0x2b'));_0x5eddc7[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x56d352[_0xf5bb('0x4b')]);_0x5eddc7[_0xf5bb('0x4d')]=_['intersection'](_0x5eddc7['model'],_0x5eddc7[_0xf5bb('0x4b')]);_0x283c44[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x5eddc7[_0xf5bb('0x4a')],qs['fields'](_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x283c44[_0xf5bb('0x4e')]=_0x283c44['attributes'][_0xf5bb('0x51')]?_0x283c44[_0xf5bb('0x4e')]:_0x5eddc7[_0xf5bb('0x4a')];if(!_0x56d352[_0xf5bb('0x4b')]['hasOwnProperty'](_0xf5bb('0x52'))){_0x283c44[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x56d352[_0xf5bb('0x4b')]['limit']);_0x283c44[_0xf5bb('0x22')]=qs[_0xf5bb('0x22')](_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x22')]);}_0x283c44[_0xf5bb('0x53')]=qs[_0xf5bb('0x54')](_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x283c44['where']=qs[_0xf5bb('0x4d')](_[_0xf5bb('0x55')](_0x56d352[_0xf5bb('0x4b')],_0x5eddc7[_0xf5bb('0x4d')]),_0x574e11);if(_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x283c44[_0xf5bb('0x57')]=_['merge'](_0x283c44[_0xf5bb('0x57')],{'$or':_[_0xf5bb('0x47')](_0x574e11,function(_0x1a6980){if(_0x1a6980[_0xf5bb('0x49')]!==_0xf5bb('0x58')){var _0x38ed66={};_0x38ed66[_0x1a6980[_0xf5bb('0x2b')]]={'$like':'%'+_0x56d352[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x38ed66;}})});}_0x283c44=_['merge']({},_0x283c44,_0x56d352[_0xf5bb('0x59')]);var _0x4e30b5={'where':_0x283c44[_0xf5bb('0x57')]};return db[_0xf5bb('0x48')][_0xf5bb('0x24')](_0x4e30b5)[_0xf5bb('0x13')](function(_0x240243){_0x8366fc[_0xf5bb('0x24')]=_0x240243;if(_0x56d352[_0xf5bb('0x4b')]['includeAll']){_0x283c44['include']=[{'all':!![]}];}return db[_0xf5bb('0x48')][_0xf5bb('0x5a')](_0x283c44);})[_0xf5bb('0x13')](function(_0x470afc){_0x8366fc[_0xf5bb('0x5b')]=_0x470afc;return _0x8366fc;})[_0xf5bb('0x13')](respondWithFilteredResult(_0x213020,_0x283c44))[_0xf5bb('0x1d')](handleError(_0x213020,null));};exports['show']=function(_0x1dc800,_0x50e227){var _0x57705b={'raw':![],'where':{'id':_0x1dc800[_0xf5bb('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf5bb('0x41')},{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db[_0xf5bb('0x45')],'as':_0xf5bb('0x46')}]},_0x18db95={};_0x18db95[_0xf5bb('0x4a')]=_['keys'](db[_0xf5bb('0x48')][_0xf5bb('0x5d')]);_0x18db95[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x1dc800[_0xf5bb('0x4b')]);_0x18db95[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x18db95['model'],_0x18db95[_0xf5bb('0x4b')]);_0x57705b['attributes']=_[_0xf5bb('0x4f')](_0x18db95[_0xf5bb('0x4a')],qs[_0xf5bb('0x50')](_0x1dc800[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x57705b[_0xf5bb('0x4e')]=_0x57705b[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x57705b['attributes']:_0x18db95[_0xf5bb('0x4a')];if(_0x1dc800[_0xf5bb('0x4b')]['includeAll']){_0x57705b['include']=[{'all':!![]}];}_0x57705b=_['merge']({},_0x57705b,_0x1dc800[_0xf5bb('0x59')]);return db[_0xf5bb('0x48')]['find'](_0x57705b)[_0xf5bb('0x13')](handleEntityNotFound(_0x50e227,null))[_0xf5bb('0x13')](respondWithResult(_0x50e227,null))[_0xf5bb('0x1d')](handleError(_0x50e227,null));};exports['update']=function(_0x83175f,_0x9433b3){if(_0x83175f[_0xf5bb('0x5e')]['id']){delete _0x83175f['body']['id'];}var _0x179dfc=_0x83175f['body'][_0xf5bb('0x5f')]===_0xf5bb('0x60')?null:_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x5f')];var _0x2b861d=_0x83175f['body'][_0xf5bb('0x41')]||{};var _0xdc02a5=_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')]||{};if(_0x179dfc){_0x2b861d[_0xf5bb('0x3e')]=getImapHost(_0x179dfc);_0x2b861d[_0xf5bb('0x3d')]=0x3e1;_0xdc02a5[_0xf5bb('0x3e')]=getSmtpHost(_0x179dfc);_0xdc02a5[_0xf5bb('0x3d')]=0x24b;_0xdc02a5[_0xf5bb('0x61')]=![];}if(_0xdc02a5[_0xf5bb('0x3b')]){_0xdc02a5[_0xf5bb('0x61')]=![];}else{_0xdc02a5[_0xf5bb('0x3c')]=null;}if(!_0x2b861d[_0xf5bb('0x3b')])_0x2b861d[_0xf5bb('0x3c')]=null;_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x41')]=_0x2b861d;_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')]=_0xdc02a5;return db[_0xf5bb('0x48')]['find']({'where':{'id':_0x83175f[_0xf5bb('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf5bb('0x41')},{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db['Pause'],'as':_0xf5bb('0x46')}]})[_0xf5bb('0x13')](handleEntityNotFound(_0x9433b3,null))[_0xf5bb('0x13')](function(_0x4a63ad){if(!_0x4a63ad)throw new Error('Mail\x20Account\x20not\x20found');if(_0x4a63ad[_0xf5bb('0x3f')])delete _0x83175f[_0xf5bb('0x5e')]['Imap'];return _0x4a63ad;})['then'](saveUpdates(_0x83175f[_0xf5bb('0x5e')],null))['then'](function(_0x2d365d){if(!_0x83175f['body'][_0xf5bb('0x41')])return _0x2d365d;return db[_0xf5bb('0x62')][_0xf5bb('0x27')](_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x41')],{'where':{'MailAccountId':_0x2d365d['id']}})[_0xf5bb('0x13')](function(){return _0x2d365d;});})[_0xf5bb('0x13')](function(_0x442f6e){if(!_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')])return _0x442f6e;return db[_0xf5bb('0x44')][_0xf5bb('0x27')](_0x83175f[_0xf5bb('0x5e')][_0xf5bb('0x42')],{'where':{'MailAccountId':_0x442f6e['id']}})[_0xf5bb('0x13')](function(){return _0x442f6e;});})[_0xf5bb('0x13')](respondWithResult(_0x9433b3,null))['catch'](handleError(_0x9433b3,null));};exports[_0xf5bb('0x63')]=function(_0x578afe,_0x24608c){return db[_0xf5bb('0x48')][_0xf5bb('0x63')]()[_0xf5bb('0x13')](respondWithResult(_0x24608c,null))[_0xf5bb('0x1d')](handleError(_0x24608c,null));};exports[_0xf5bb('0x64')]=function(_0x33adcc,_0x2b6d3e){if(_0x33adcc['body']['id']){delete _0x33adcc['body']['id'];}return db[_0xf5bb('0x48')]['find']({'where':{'id':_0x33adcc[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2b6d3e,null))[_0xf5bb('0x13')](function(_0x315495){if(_0x315495){_0x33adcc[_0xf5bb('0x5e')][_0xf5bb('0x65')]=_0x315495['id'];return db[_0xf5bb('0x66')]['create'](_0x33adcc[_0xf5bb('0x5e')]);}})[_0xf5bb('0x13')](respondWithResult(_0x2b6d3e,null))[_0xf5bb('0x1d')](handleError(_0x2b6d3e,null));};exports[_0xf5bb('0x67')]=function(_0x1e2f44,_0x282a9f){var _0x57873b={'raw':![],'where':{}};var _0x31da7e={};var _0x4dda35={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x1e2f44[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x282a9f,null))[_0xf5bb('0x13')](function(_0xe5b309){if(_0xe5b309){_0x31da7e[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x66')][_0xf5bb('0x5d')]);_0x31da7e[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x1e2f44[_0xf5bb('0x4b')]);_0x31da7e['filters']=_['intersection'](_0x31da7e[_0xf5bb('0x4a')],_0x31da7e[_0xf5bb('0x4b')]);_0x57873b[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x31da7e['model'],qs['fields'](_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x57873b[_0xf5bb('0x4e')]=_0x57873b[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x57873b[_0xf5bb('0x4e')]:_0x31da7e[_0xf5bb('0x4a')];if(!_0x1e2f44['query']['hasOwnProperty'](_0xf5bb('0x52'))){_0x57873b[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x57873b[_0xf5bb('0x22')]=qs[_0xf5bb('0x22')](_0x1e2f44['query'][_0xf5bb('0x22')]);}_0x57873b[_0xf5bb('0x53')]=qs[_0xf5bb('0x54')](_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x57873b[_0xf5bb('0x57')]=qs['filters'](_[_0xf5bb('0x55')](_0x1e2f44['query'],_0x31da7e[_0xf5bb('0x4d')]));_0x57873b[_0xf5bb('0x57')][_0xf5bb('0x65')]=_0xe5b309['id'];if(_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x57873b[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0x57873b[_0xf5bb('0x57')],{'$or':_['map'](_0x57873b[_0xf5bb('0x4e')],function(_0x5b7da9){var _0x3f3ac8={};_0x3f3ac8[_0x5b7da9]={'$like':'%'+_0x1e2f44[_0xf5bb('0x4b')]['filter']+'%'};return _0x3f3ac8;})});}_0x57873b=_['merge']({},_0x57873b,_0x1e2f44['options']);return db[_0xf5bb('0x66')][_0xf5bb('0x24')]({'where':_0x57873b[_0xf5bb('0x57')]})[_0xf5bb('0x13')](function(_0x4097f4){_0x4dda35['count']=_0x4097f4;if(_0x1e2f44[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0x57873b[_0xf5bb('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xf5bb('0x5a')](_0x57873b);})[_0xf5bb('0x13')](function(_0x809cef){_0x4dda35['rows']=_0x809cef;return _0x4dda35;});}})[_0xf5bb('0x13')](respondWithFilteredResult(_0x282a9f,_0x57873b))[_0xf5bb('0x1d')](handleError(_0x282a9f,null));};exports[_0xf5bb('0x6c')]=function(_0x3241be,_0x52a06f){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x3241be[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x52a06f,null))[_0xf5bb('0x13')](function(_0x5cd2eb){if(_0x5cd2eb){return _0x5cd2eb[_0xf5bb('0x6c')](_0x3241be[_0xf5bb('0x4b')]['ids']);}})[_0xf5bb('0x13')](respondWithStatusCode(_0x52a06f,null))[_0xf5bb('0x1d')](handleError(_0x52a06f,null));};exports['addAnswer']=function(_0x4181b8,_0x5810e7){if(_0x4181b8['body']['id']){delete _0x4181b8['body']['id'];}return db['MailAccount'][_0xf5bb('0x6d')]({'where':{'id':_0x4181b8[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5810e7,null))[_0xf5bb('0x13')](function(_0x169dd9){if(_0x169dd9){_0x4181b8[_0xf5bb('0x5e')]['MailAccountId']=_0x169dd9['id'];return db['CannedAnswer']['create'](_0x4181b8[_0xf5bb('0x5e')]);}})['then'](respondWithResult(_0x5810e7,null))[_0xf5bb('0x1d')](handleError(_0x5810e7,null));};exports[_0xf5bb('0x6e')]=function(_0x3c90d8,_0x1aa882){var _0x1942af={'raw':![],'where':{}};var _0x37a5c0={};var _0x166b3f={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x3c90d8[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1aa882,null))['then'](function(_0x491184){if(_0x491184){_0x37a5c0[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x6f')][_0xf5bb('0x5d')]);_0x37a5c0[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x3c90d8[_0xf5bb('0x4b')]);_0x37a5c0['filters']=_['intersection'](_0x37a5c0[_0xf5bb('0x4a')],_0x37a5c0[_0xf5bb('0x4b')]);_0x1942af['attributes']=_[_0xf5bb('0x4f')](_0x37a5c0[_0xf5bb('0x4a')],qs[_0xf5bb('0x50')](_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x1942af['attributes']=_0x1942af[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x1942af['attributes']:_0x37a5c0[_0xf5bb('0x4a')];if(!_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x1942af[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x1942af[_0xf5bb('0x22')]=qs[_0xf5bb('0x22')](_0x3c90d8['query']['offset']);}_0x1942af['order']=qs[_0xf5bb('0x54')](_0x3c90d8[_0xf5bb('0x4b')]['sort']);_0x1942af['where']=qs['filters'](_[_0xf5bb('0x55')](_0x3c90d8[_0xf5bb('0x4b')],_0x37a5c0[_0xf5bb('0x4d')]));_0x1942af[_0xf5bb('0x57')]['MailAccountId']=_0x491184['id'];if(_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x1942af['where']=_['merge'](_0x1942af['where'],{'$or':_[_0xf5bb('0x47')](_0x1942af[_0xf5bb('0x4e')],function(_0x5c288d){var _0x2c2515={};_0x2c2515[_0x5c288d]={'$like':'%'+_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x2c2515;})});}_0x1942af=_[_0xf5bb('0x69')]({},_0x1942af,_0x3c90d8[_0xf5bb('0x59')]);return db['CannedAnswer'][_0xf5bb('0x24')]({'where':_0x1942af[_0xf5bb('0x57')]})[_0xf5bb('0x13')](function(_0x1dce0f){_0x166b3f[_0xf5bb('0x24')]=_0x1dce0f;if(_0x3c90d8[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0x1942af[_0xf5bb('0x6b')]=[{'all':!![]}];}return db[_0xf5bb('0x6f')][_0xf5bb('0x5a')](_0x1942af);})[_0xf5bb('0x13')](function(_0x15bd3a){_0x166b3f[_0xf5bb('0x5b')]=_0x15bd3a;return _0x166b3f;});}})['then'](respondWithFilteredResult(_0x1aa882,_0x1942af))['catch'](handleError(_0x1aa882,null));};exports[_0xf5bb('0x71')]=function(_0x46f803,_0x2a3812){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x46f803[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x2a3812,null))['then'](function(_0x4bde89){if(_0x4bde89){return _0x4bde89[_0xf5bb('0x71')](_0x46f803[_0xf5bb('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x2a3812,null))[_0xf5bb('0x1d')](handleError(_0x2a3812,null));};exports[_0xf5bb('0x72')]=function(_0x21b5d7,_0x5901c9){var _0x1f64e6={'name':_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x2b')],'key':_0x21b5d7[_0xf5bb('0x5e')]['key'],'provider':_0x21b5d7[_0xf5bb('0x5e')]['provider']===_0xf5bb('0x60')?null:_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x5f')],'email':_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x73')],'ListId':_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x74')],'active':!_[_0xf5bb('0x75')](_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x76')])?_0x21b5d7[_0xf5bb('0x5e')][_0xf5bb('0x76')]:!![],'description':_0x21b5d7['body'][_0xf5bb('0x77')]||null};var _0x2065b9=getAuthenticationOptions(_0x1f64e6[_0xf5bb('0x5f')],_0x21b5d7[_0xf5bb('0x5e')]);_0x1f64e6[_0xf5bb('0x41')]=_0x2065b9[_0xf5bb('0x41')];_0x1f64e6[_0xf5bb('0x42')]=_0x2065b9['Smtp'];return db[_0xf5bb('0x48')]['create'](_0x1f64e6,{'include':[{'model':db[_0xf5bb('0x44')],'as':_0xf5bb('0x42')},{'model':db[_0xf5bb('0x62')],'as':_0xf5bb('0x41')}]})['then'](function(_0x123b2e){var _0x502e10=_0x21b5d7[_0xf5bb('0x37')][_0xf5bb('0x78')]({'plain':!![]});if(!_0x502e10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x502e10['role']===_0xf5bb('0x37')){var _0x445d2d=_0x123b2e[_0xf5bb('0x78')]({'plain':!![]});return db[_0xf5bb('0x79')][_0xf5bb('0x6d')]({'where':{'name':_0xf5bb('0x28'),'userProfileId':_0x502e10['userProfileId']},'raw':!![]})['then'](function(_0x22073b){if(_0x22073b&&_0x22073b['autoAssociation']===0x0){return db[_0xf5bb('0x7a')]['create']({'name':_0x445d2d[_0xf5bb('0x2b')],'resourceId':_0x445d2d['id'],'type':_0x22073b[_0xf5bb('0x2b')],'sectionId':_0x22073b['id']},{})['then'](function(){return _0x123b2e;});}else{return _0x123b2e;}})[_0xf5bb('0x1d')](function(_0x451b94){logger['error'](_0xf5bb('0x7b'),_0x451b94);throw _0x451b94;});}return _0x123b2e;})[_0xf5bb('0x13')](respondWithResult(_0x5901c9,0xc9))['catch'](handleError(_0x5901c9,null));};exports[_0xf5bb('0x7c')]=function(_0x38dc04,_0x531290){return db[_0xf5bb('0x48')]['findOne']({'where':{'id':_0x38dc04[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x531290,null))[_0xf5bb('0x13')](function(_0x968b98){if(_0x968b98){return _0x968b98['getImap']();}return null;})[_0xf5bb('0x13')](respondWithResult(_0x531290,null))[_0xf5bb('0x1d')](handleError(_0x531290,null));};exports[_0xf5bb('0x7d')]=function(_0x594edb,_0x516570){if(_0x594edb[_0xf5bb('0x5e')]['id']){delete _0x594edb[_0xf5bb('0x5e')]['id'];}return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x594edb['params']['id']}})['then'](handleEntityNotFound(_0x516570,null))[_0xf5bb('0x13')](function(_0x331017){if(_0x331017){_0x594edb[_0xf5bb('0x5e')][_0xf5bb('0x65')]=_0x331017['id'];return db['MailServerIn'][_0xf5bb('0x72')](_0x594edb[_0xf5bb('0x5e')]);}})['then'](respondWithResult(_0x516570,null))[_0xf5bb('0x1d')](handleError(_0x516570,null));};exports[_0xf5bb('0x7e')]=function(_0x1a25f1,_0x1878b8){return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x1a25f1[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1878b8,null))[_0xf5bb('0x13')](function(_0xa8d9f3){if(_0xa8d9f3){return _0xa8d9f3[_0xf5bb('0x7f')](null);}return null;})[_0xf5bb('0x13')](respondWithStatusCode(_0x1878b8,null))['catch'](handleError(_0x1878b8,null));};exports['getSmtp']=function(_0x580337,_0x2a67e5){return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x580337[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x2a67e5,null))['then'](function(_0x1e256a){if(_0x1e256a){return _0x1e256a[_0xf5bb('0x80')]();}return null;})[_0xf5bb('0x13')](respondWithResult(_0x2a67e5,null))[_0xf5bb('0x1d')](handleError(_0x2a67e5,null));};exports['addSmtp']=function(_0x1fd0df,_0x1b205f){if(_0x1fd0df[_0xf5bb('0x5e')]['id']){delete _0x1fd0df[_0xf5bb('0x5e')]['id'];}return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x1fd0df[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1b205f,null))['then'](function(_0x1e984f){if(_0x1e984f){_0x1fd0df['body']['MailAccountId']=_0x1e984f['id'];return db[_0xf5bb('0x44')][_0xf5bb('0x72')](_0x1fd0df[_0xf5bb('0x5e')]);}})[_0xf5bb('0x13')](respondWithResult(_0x1b205f,null))[_0xf5bb('0x1d')](handleError(_0x1b205f,null));};exports[_0xf5bb('0x81')]=function(_0x428c10,_0x28bb28){return db[_0xf5bb('0x48')]['findOne']({'where':{'id':_0x428c10[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x28bb28,null))['then'](function(_0x1aec27){if(_0x1aec27){return _0x1aec27[_0xf5bb('0x82')](null);}return null;})[_0xf5bb('0x13')](respondWithStatusCode(_0x28bb28,null))[_0xf5bb('0x1d')](handleError(_0x28bb28,null));};exports[_0xf5bb('0x83')]=function(_0x2673ec,_0x4e6ebd){return db[_0xf5bb('0x84')]['find']({'where':{'id':_0x2673ec[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e6ebd,null))[_0xf5bb('0x13')](function(_0x2a69aa){if(_0x2a69aa){return _0x2a69aa[_0xf5bb('0x83')](_0x2673ec['body'][_0xf5bb('0x85')],_[_0xf5bb('0x86')](_0x2673ec['body'],['ids','id'])||{});}})[_0xf5bb('0x13')](respondWithResult(_0x4e6ebd,null))[_0xf5bb('0x1d')](handleError(_0x4e6ebd,null));};exports[_0xf5bb('0x87')]=function(_0x31cea5,_0x381205){var _0x244f69={'raw':![],'where':{}};var _0x1f4792={};var _0x428179={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x31cea5[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x381205,null))['then'](function(_0x20aa49){if(_0x20aa49){_0x1f4792[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x84')]['rawAttributes']);_0x1f4792[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x31cea5[_0xf5bb('0x4b')]);_0x1f4792[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x1f4792[_0xf5bb('0x4a')],_0x1f4792['query']);_0x244f69[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x1f4792[_0xf5bb('0x4a')],qs[_0xf5bb('0x50')](_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x244f69[_0xf5bb('0x4e')]=_0x244f69[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x244f69['attributes']:_0x1f4792['model'];if(!_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x244f69[_0xf5bb('0x25')]=qs['limit'](_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x244f69[_0xf5bb('0x22')]=qs['offset'](_0x31cea5['query'][_0xf5bb('0x22')]);}_0x244f69[_0xf5bb('0x53')]=qs['sort'](_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x244f69['where']=qs[_0xf5bb('0x4d')](_['pick'](_0x31cea5[_0xf5bb('0x4b')],_0x1f4792[_0xf5bb('0x4d')]));_0x244f69['where'][_0xf5bb('0x65')]=_0x20aa49['id'];if(_0x31cea5['query']['filter']){_0x244f69['where']=_[_0xf5bb('0x69')](_0x244f69['where'],{'$or':_['map'](_0x244f69[_0xf5bb('0x4e')],function(_0x4eb4cc){var _0x49fb2f={};_0x49fb2f[_0x4eb4cc]={'$like':'%'+_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x49fb2f;})});}_0x244f69=_[_0xf5bb('0x69')]({},_0x244f69,_0x31cea5['options']);return db[_0xf5bb('0x84')][_0xf5bb('0x24')]({'where':_0x244f69[_0xf5bb('0x57')]})[_0xf5bb('0x13')](function(_0x2da3e6){_0x428179[_0xf5bb('0x24')]=_0x2da3e6;if(_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0x244f69[_0xf5bb('0x6b')]=[{'model':db[_0xf5bb('0x88')],'as':'Contact','required':![]},{'model':db[_0xf5bb('0x89')],'as':_0xf5bb('0x8a'),'attributes':[_0xf5bb('0x2b'),_0xf5bb('0x8b'),_0xf5bb('0x8c')],'required':![]},{'model':db[_0xf5bb('0x8d')],'as':'Tags','attributes':['id',_0xf5bb('0x2b'),_0xf5bb('0x8e')],'where':_0x31cea5['query'][_0xf5bb('0x8f')]?{'id':_0x31cea5['query']['tag']}:undefined,'required':_0x31cea5[_0xf5bb('0x4b')][_0xf5bb('0x8f')]?!![]:![]}];}return db[_0xf5bb('0x84')][_0xf5bb('0x5a')](_0x244f69);})[_0xf5bb('0x13')](function(_0xaa66d6){_0x428179[_0xf5bb('0x5b')]=_0xaa66d6;return _0x428179;});}})[_0xf5bb('0x13')](respondWithFilteredResult(_0x381205,_0x244f69))[_0xf5bb('0x1d')](handleError(_0x381205,null));};exports['addApplications']=function addApplications(_0x525816,_0x51f6ba){var _0x2ea542=_0x525816[_0xf5bb('0x5c')]['id'];var _0x3de3e3=_0x525816['body'];var _0x5d2059=0xc8;var _0x25fa02=null;return db['sequelize'][_0xf5bb('0x90')]({'isolationLevel':db[_0xf5bb('0x91')][_0xf5bb('0x92')][_0xf5bb('0x93')][_0xf5bb('0x94')]},function(_0x1fe095){return db[_0xf5bb('0x48')]['findOne']({'where':{'id':_0x2ea542},'transaction':_0x1fe095})['then'](function(_0x2dc4bb){if(_0x2dc4bb){return db[_0xf5bb('0x95')][_0xf5bb('0x29')]({'where':{'MailAccountId':_0x2ea542},'transaction':_0x1fe095})['then'](function(){var _0x3953b8=_[_0xf5bb('0x47')](_0x3de3e3,function(_0x50d7f6){_0x50d7f6[_0xf5bb('0x65')]=_0x2ea542;return _0x50d7f6;});return db['MailApplication'][_0xf5bb('0x96')](_0x3953b8,{'transaction':_0x1fe095});});}else{_0x5d2059=0x194;_0x25fa02=[];}});})[_0xf5bb('0x13')](function(){if(_0x5d2059!==0x194){return db[_0xf5bb('0x95')]['findAndCountAll']({'where':{'MailAccountId':_0x2ea542},'order':_0xf5bb('0x97')})['then'](function(_0x1bfe62){_0x25fa02=_0x1bfe62;});}})['catch'](function(_0x4d698e){_0x5d2059=0x1f4;logger[_0xf5bb('0x1a')](_0x4d698e['stack']);if(_0x4d698e[_0xf5bb('0x2b')]){delete _0x4d698e[_0xf5bb('0x2b')];}_0x25fa02=_0x4d698e;})[_0xf5bb('0x98')](function(){if(_0x25fa02===null){_0x51f6ba[_0xf5bb('0x1e')](_0x5d2059);}else{if(_0x5d2059===0x1f4){_0x51f6ba[_0xf5bb('0x1f')](_0x5d2059)[_0xf5bb('0x2c')](_0x25fa02);}else{_0x51f6ba[_0xf5bb('0x1f')](_0x5d2059)[_0xf5bb('0x21')](_0x25fa02);}}});};exports['getApplications']=function(_0x30d77c,_0x1036cb){var _0x1d9916={};var _0x251a9b={};var _0xd93024;var _0x3d0f41;return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x30d77c[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1036cb,null))[_0xf5bb('0x13')](function(_0x516020){if(_0x516020){_0xd93024=_0x516020;_0x251a9b[_0xf5bb('0x4a')]=_['keys'](db[_0xf5bb('0x95')][_0xf5bb('0x5d')]);_0x251a9b[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x30d77c[_0xf5bb('0x4b')]);_0x251a9b[_0xf5bb('0x4d')]=_['intersection'](_0x251a9b['model'],_0x251a9b['query']);_0x1d9916[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x251a9b['model'],qs[_0xf5bb('0x50')](_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x1d9916[_0xf5bb('0x4e')]=_0x1d9916[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0x1d9916[_0xf5bb('0x4e')]:_0x251a9b[_0xf5bb('0x4a')];_0x1d9916['order']=qs['sort'](_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x54')]);_0x1d9916[_0xf5bb('0x57')]=qs[_0xf5bb('0x4d')](_['pick'](_0x30d77c[_0xf5bb('0x4b')],_0x251a9b[_0xf5bb('0x4d')]));if(_0x30d77c[_0xf5bb('0x4b')]['filter']){_0x1d9916[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0x1d9916[_0xf5bb('0x57')],{'$or':_[_0xf5bb('0x47')](_0x1d9916[_0xf5bb('0x4e')],function(_0x360d7a){var _0x173aa9={};_0x173aa9[_0x360d7a]={'$like':'%'+_0x30d77c[_0xf5bb('0x4b')]['filter']+'%'};return _0x173aa9;})});}_0x1d9916=_[_0xf5bb('0x69')]({},_0x1d9916,_0x30d77c[_0xf5bb('0x59')]);return _0xd93024['getApplications'](_0x1d9916);}})['then'](function(_0x2f2527){if(_0x2f2527){_0x3d0f41=_0x2f2527['length'];if(!_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x1d9916[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x30d77c[_0xf5bb('0x4b')][_0xf5bb('0x25')]);_0x1d9916['offset']=qs['offset'](_0x30d77c['query'][_0xf5bb('0x22')]);}return _0xd93024[_0xf5bb('0x99')](_0x1d9916);}})['then'](function(_0x54e95){if(_0x54e95){return _0x54e95?{'count':_0x3d0f41,'rows':_0x54e95}:null;}})[_0xf5bb('0x13')](respondWithResult(_0x1036cb,null))[_0xf5bb('0x1d')](handleError(_0x1036cb,null));};exports[_0xf5bb('0x9a')]=function(_0x30b649,_0x3adea4){var _0xd06798={'raw':!![],'where':{}};var _0x501e8b={};var _0x33f211={'count':0x0,'rows':[]};return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x30b649[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x3adea4,null))[_0xf5bb('0x13')](function(_0xbad438){if(_0xbad438){_0x501e8b[_0xf5bb('0x4a')]=_[_0xf5bb('0x4c')](db[_0xf5bb('0x9b')][_0xf5bb('0x5d')]);_0x501e8b[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x30b649['query']);_0x501e8b[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x501e8b[_0xf5bb('0x4a')],_0x501e8b[_0xf5bb('0x4b')]);_0xd06798[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x501e8b[_0xf5bb('0x4a')],qs['fields'](_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0xd06798['attributes']=_0xd06798[_0xf5bb('0x4e')][_0xf5bb('0x51')]?_0xd06798[_0xf5bb('0x4e')]:_0x501e8b[_0xf5bb('0x4a')];if(!_0x30b649[_0xf5bb('0x4b')]['hasOwnProperty'](_0xf5bb('0x52'))){_0xd06798[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x30b649[_0xf5bb('0x4b')]['limit']);_0xd06798[_0xf5bb('0x22')]=qs['offset'](_0x30b649['query'][_0xf5bb('0x22')]);}_0xd06798[_0xf5bb('0x53')]=qs[_0xf5bb('0x54')](_0x30b649[_0xf5bb('0x4b')]['sort']);_0xd06798[_0xf5bb('0x57')]=qs['filters'](_[_0xf5bb('0x55')](_0x30b649['query'],_0x501e8b[_0xf5bb('0x4d')]));_0xd06798[_0xf5bb('0x57')][_0xf5bb('0x65')]=_0xbad438['id'];if(_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0xd06798['where']=_['merge'](_0xd06798[_0xf5bb('0x57')],{'$or':_[_0xf5bb('0x47')](_0xd06798['attributes'],function(_0x9a39a1){var _0x4f6205={};_0x4f6205[_0x9a39a1]={'$like':'%'+_0x30b649[_0xf5bb('0x4b')]['filter']+'%'};return _0x4f6205;})});}if(_0x30b649['query'][_0xf5bb('0x9c')]){var _0x5a4bfa=_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x9c')][_0xf5bb('0x9d')](',');var _0x1e6c4d={};_0x1e6c4d[_0x5a4bfa[0x0]]={'$gte':moment(_0x5a4bfa[0x1])['format'](_0xf5bb('0x9e'))};_0xd06798[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0xd06798['where'],_0x1e6c4d);}_0xd06798=_['merge']({},_0xd06798,_0x30b649[_0xf5bb('0x59')]);return db[_0xf5bb('0x9b')][_0xf5bb('0x24')]({'where':_0xd06798['where']})[_0xf5bb('0x13')](function(_0x2ee0fa){_0x33f211[_0xf5bb('0x24')]=_0x2ee0fa;if(_0x30b649[_0xf5bb('0x4b')][_0xf5bb('0x6a')]){_0xd06798[_0xf5bb('0x6b')]=[{'all':!![]}];}return db[_0xf5bb('0x9b')][_0xf5bb('0x5a')](_0xd06798);})[_0xf5bb('0x13')](function(_0x4316d4){if(_0x30b649['query'][_0xf5bb('0x9f')]===_0xf5bb('0xa0')){for(var _0x2056f7=0x0;_0x2056f7<_0x4316d4[_0xf5bb('0x51')];_0x2056f7++){_0x4316d4[_0x2056f7]['body']=juice(_0x4316d4[_0x2056f7][_0xf5bb('0x5e')]);}}_0x33f211[_0xf5bb('0x5b')]=_0x4316d4;return _0x33f211;});}})[_0xf5bb('0x13')](respondWithFilteredResult(_0x3adea4,_0xd06798))[_0xf5bb('0x1d')](handleError(_0x3adea4,null));};exports[_0xf5bb('0x2c')]=function(_0x434769,_0x44bf30){var _0x15343a,_0x19980c={},_0x57d7b9;if(_0x434769['body']['to']){_0x57d7b9=_0x434769[_0xf5bb('0x5e')]['to']['split'](',')[0x0];}return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x434769[_0xf5bb('0x5c')]['id']},'include':[{'model':db[_0xf5bb('0xa1')],'as':'List','include':[{'model':db[_0xf5bb('0x88')],'as':'Contacts','where':{'email':_0x57d7b9},'limit':0x1,'order':[[_0xf5bb('0xa2'),_0xf5bb('0xa3')]]}]},{'model':db['MailServerOut'],'as':_0xf5bb('0x42'),'raw':!![],'include':[{'model':db[_0xf5bb('0xa4')],'as':_0xf5bb('0xa4'),'raw':!![]}]}]})[_0xf5bb('0x13')](handleEntityNotFound(_0x44bf30,null))[_0xf5bb('0x13')](function(_0x158685){if(!_0x158685)return;_0x15343a=_0x158685;if(!_0x158685['Smtp'])throw new Error(_0xf5bb('0xa5'));if(_['isNil'](_0x434769[_0xf5bb('0x5e')]['from'])){_0x434769['body']['from']=util[_0xf5bb('0xa6')](_0xf5bb('0xa7'),_0x158685[_0xf5bb('0x2b')],_0x158685['email']||_0x158685[_0xf5bb('0x42')][_0xf5bb('0x37')]);}if(_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')]&&_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0xf5bb('0x51')]){for(var _0x4fb8fe=0x0;_0x4fb8fe<_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0xf5bb('0x51')];_0x4fb8fe+=0x1){_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0x4fb8fe]={'filename':_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xa8')][_0x4fb8fe][_0xf5bb('0x2b')],'path':path[_0xf5bb('0xa9')](config[_0xf5bb('0xaa')],_0xf5bb('0xab'),_0x434769[_0xf5bb('0x5e')]['attachments'][_0x4fb8fe]['basename'])};}}var _0x102204=_0x158685[_0xf5bb('0xac')]();return respondWithRpcPromise(_0xf5bb('0xad'),_0xf5bb('0xae'),{'account':_0x102204,'message':_0x434769[_0xf5bb('0x5e')]});})[_0xf5bb('0x13')](function(_0x3dfe77){if(!_0x3dfe77)return;_0x19980c=_0x3dfe77;if(!_0x15343a['List'])throw new Error(_0xf5bb('0xaf'));if(_0x15343a['List'][_0xf5bb('0xb0')][_0xf5bb('0x51')])return _0x15343a[_0xf5bb('0xb1')][_0xf5bb('0xb0')][0x0];return db['CmContact'][_0xf5bb('0x72')](_[_0xf5bb('0xd')](_0x434769[_0xf5bb('0x5e')],{'firstName':_0x434769[_0xf5bb('0x5e')]['to'],'email':_0x434769['body']['to'],'phone':_0x434769[_0xf5bb('0x5e')]['to'],'ListId':_0x15343a[_0xf5bb('0x74')]}));})[_0xf5bb('0x13')](function(_0xb9d032){if(!_0xb9d032)return;var _0x4a54d5={'UserId':_0x434769[_0xf5bb('0x37')]['id'],'ContactId':_0xb9d032['id'],'MailAccountId':_0x15343a['id'],'inReplyTo':_0x19980c[_0xf5bb('0xb2')],'to':_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xb3')],'cc':_0x434769[_0xf5bb('0x5e')]['cc'],'subject':_0x434769['body'][_0xf5bb('0xb4')],'attach':_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xf5bb('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf5bb('0xb6'),'Messages':[_['merge'](_0x434769[_0xf5bb('0x5e')],{'messageId':_0x19980c['messageId'],'sentAt':moment()['format'](_0xf5bb('0x9e')),'read':!![],'MailAccountId':_0x15343a['id'],'UserId':_0x434769[_0xf5bb('0x37')]['id'],'ContactId':_0xb9d032['id']})]};if(_0x434769['body']['Interaction']){_0x4a54d5=_['merge'](_0x4a54d5,_0x434769[_0xf5bb('0x5e')][_0xf5bb('0xb7')]);}return db[_0xf5bb('0x84')][_0xf5bb('0x72')](_0x4a54d5,{'include':[{'model':db['MailMessage'],'as':_0xf5bb('0xb8')}]});})[_0xf5bb('0x13')](respondWithResult(_0x44bf30,null))[_0xf5bb('0x1d')](handleError(_0x44bf30,null));};exports['verifySmtp']=function(_0x291267,_0x4bcaeb){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x291267[_0xf5bb('0x5c')]['id']},'include':[{'model':db[_0xf5bb('0x44')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf5bb('0xa4')],'as':_0xf5bb('0xa4'),'raw':!![]}]}]})[_0xf5bb('0x13')](handleEntityNotFound(_0x4bcaeb,null))[_0xf5bb('0x13')](function(_0x23b04d){if(!_0x23b04d[_0xf5bb('0x42')])return;var _0x597403=_0x23b04d[_0xf5bb('0xac')]();return respondWithRpcPromise(_0xf5bb('0xb9'),_0xf5bb('0xba'),{'account':_0x597403});})['then'](respondWithResult(_0x4bcaeb,null))[_0xf5bb('0x1d')](handleError(_0x4bcaeb,null));};exports[_0xf5bb('0x29')]=function(_0x4c7673,_0x1026cb){return db[_0xf5bb('0x48')][_0xf5bb('0x6d')]({'where':{'id':_0x4c7673[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1026cb,null))[_0xf5bb('0x13')](function(_0x47b7b2){if(_0x47b7b2&&_0x47b7b2[_0xf5bb('0x3f')]){throw new db[(_0xf5bb('0xbb'))]['ValidationError'](_0xf5bb('0xbc'));}return _0x47b7b2;})[_0xf5bb('0x13')](removeEntity(_0x1026cb,null))[_0xf5bb('0x1d')](handleError(_0x1026cb,null));};exports[_0xf5bb('0xbd')]=function(_0x2277fb,_0xc8c134){return db[_0xf5bb('0x48')]['find']({'where':{'id':_0x2277fb['params']['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0xc8c134,null))[_0xf5bb('0x13')](function(_0x41757b){if(_0x41757b){return _0x41757b[_0xf5bb('0xbd')](_0x2277fb['body'][_0xf5bb('0x85')],_['omit'](_0x2277fb[_0xf5bb('0x5e')],[_0xf5bb('0x85'),'id'])||{})[_0xf5bb('0xbe')](function(_0x4ecb0a){for(var _0x455731=0x0;_0x455731<_0x2277fb[_0xf5bb('0x5e')][_0xf5bb('0x85')][_0xf5bb('0x51')];_0x455731+=0x1){socket[_0xf5bb('0xbf')](_0xf5bb('0xc0'),{'UserId':Number(_0x2277fb[_0xf5bb('0x5e')]['ids'][_0x455731]),'MailAccountId':Number(_0x2277fb[_0xf5bb('0x5c')]['id'])});}return _0x4ecb0a;});}})[_0xf5bb('0x13')](respondWithResult(_0xc8c134,null))['catch'](handleError(_0xc8c134,null));};exports[_0xf5bb('0xc1')]=function(_0x56718b,_0x1da3eb){return db['MailAccount'][_0xf5bb('0x6d')]({'where':{'id':_0x56718b[_0xf5bb('0x5c')]['id']}})[_0xf5bb('0x13')](handleEntityNotFound(_0x1da3eb,null))[_0xf5bb('0x13')](function(_0x4c5099){if(_0x4c5099){return _0x4c5099[_0xf5bb('0xc1')](_0x56718b['query'][_0xf5bb('0x85')])[_0xf5bb('0x13')](function(){if(_['isArray'](_0x56718b['query']['ids'])){for(var _0xa7ddfb=0x0;_0xa7ddfb<_0x56718b[_0xf5bb('0x4b')][_0xf5bb('0x85')][_0xf5bb('0x51')];_0xa7ddfb+=0x1){socket[_0xf5bb('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x56718b[_0xf5bb('0x4b')]['ids'][_0xa7ddfb]),'MailAccountId':Number(_0x56718b['params']['id'])});}}else{socket[_0xf5bb('0xbf')](_0xf5bb('0xc2'),{'UserId':Number(_0x56718b[_0xf5bb('0x4b')][_0xf5bb('0x85')]),'MailAccountId':Number(_0x56718b[_0xf5bb('0x5c')]['id'])});}});}})[_0xf5bb('0x13')](respondWithStatusCode(_0x1da3eb,null))[_0xf5bb('0x1d')](handleError(_0x1da3eb,null));};exports[_0xf5bb('0xc3')]=function(_0x519b7e,_0x342491){var _0x5e716a={};var _0x17e7e4={};var _0x5b8f0b;var _0x574231;return db[_0xf5bb('0x48')][_0xf5bb('0x68')]({'where':{'id':_0x519b7e[_0xf5bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x342491,null))[_0xf5bb('0x13')](function(_0xae7793){if(_0xae7793){_0x5b8f0b=_0xae7793;_0x17e7e4['model']=_[_0xf5bb('0x4c')](db[_0xf5bb('0x89')]['rawAttributes']);_0x17e7e4[_0xf5bb('0x4b')]=_[_0xf5bb('0x4c')](_0x519b7e[_0xf5bb('0x4b')]);_0x17e7e4[_0xf5bb('0x4d')]=_[_0xf5bb('0x4f')](_0x17e7e4[_0xf5bb('0x4a')],_0x17e7e4[_0xf5bb('0x4b')]);_0x5e716a[_0xf5bb('0x4e')]=_[_0xf5bb('0x4f')](_0x17e7e4[_0xf5bb('0x4a')],qs['fields'](_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x50')]));_0x5e716a[_0xf5bb('0x4e')]=_0x5e716a['attributes'][_0xf5bb('0x51')]?_0x5e716a[_0xf5bb('0x4e')]:_0x17e7e4[_0xf5bb('0x4a')];_0x5e716a[_0xf5bb('0x53')]=qs['sort'](_0x519b7e['query'][_0xf5bb('0x54')]);_0x5e716a[_0xf5bb('0x57')]=qs['filters'](_['pick'](_0x519b7e[_0xf5bb('0x4b')],_0x17e7e4[_0xf5bb('0x4d')]));if(_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x56')]){_0x5e716a[_0xf5bb('0x57')]=_[_0xf5bb('0x69')](_0x5e716a['where'],{'$or':_[_0xf5bb('0x47')](_0x5e716a[_0xf5bb('0x4e')],function(_0x3ab3da){var _0x25ff0f={};_0x25ff0f[_0x3ab3da]={'$like':'%'+_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x56')]+'%'};return _0x25ff0f;})});}_0x5e716a=_[_0xf5bb('0x69')]({},_0x5e716a,_0x519b7e[_0xf5bb('0x59')]);return _0x5b8f0b[_0xf5bb('0xc3')](_0x5e716a);}})[_0xf5bb('0x13')](function(_0xc0c35){if(_0xc0c35){_0x574231=_0xc0c35[_0xf5bb('0x51')];if(!_0x519b7e[_0xf5bb('0x4b')][_0xf5bb('0x70')](_0xf5bb('0x52'))){_0x5e716a[_0xf5bb('0x25')]=qs[_0xf5bb('0x25')](_0x519b7e[_0xf5bb('0x4b')]['limit']);_0x5e716a[_0xf5bb('0x22')]=qs['offset'](_0x519b7e[_0xf5bb('0x4b')]['offset']);}return _0x5b8f0b[_0xf5bb('0xc3')](_0x5e716a);}})[_0xf5bb('0x13')](function(_0x4f617b){if(_0x4f617b){return _0x4f617b?{'count':_0x574231,'rows':_0x4f617b}:null;}})['then'](respondWithResult(_0x342491,null))[_0xf5bb('0x1d')](handleError(_0x342491,null));}; \ No newline at end of file +var _0x6403=['destroy','stack','name','send','yahoo','imap.mail.yahoo.com','hotmail','outlook365','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','user','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','include','findAll','rows','params','includeAll','merge','find','update','body','custom','provider','addDisposition','MailAccountId','create','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','root','basename','SendMail','sendMail','List','messageId','subject','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','addAgents','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','get','MailAccounts','UserProfileResource'];(function(_0x86d9e1,_0x1b30ee){var _0x4a859c=function(_0x3f28ff){while(--_0x3f28ff){_0x86d9e1['push'](_0x86d9e1['shift']());}};_0x4a859c(++_0x1b30ee);}(_0x6403,0x15c));var _0x3640=function(_0xe24ec8,_0xe803bb){_0xe24ec8=_0xe24ec8-0x0;var _0x5b0bee=_0x6403[_0xe24ec8];return _0x5b0bee;};'use strict';var moment=require(_0x3640('0x0'));var BPromise=require(_0x3640('0x1'));var util=require(_0x3640('0x2'));var path=require(_0x3640('0x3'));var _=require(_0x3640('0x4'));var juice=require(_0x3640('0x5'));var Redis=require('ioredis');var qs=require(_0x3640('0x6'));var logger=require('../../config/logger')(_0x3640('0x7'));var config=require(_0x3640('0x8'));var db=require('../../mysqldb')['db'];config[_0x3640('0x9')]=_[_0x3640('0xa')](config[_0x3640('0x9')],{'host':_0x3640('0xb'),'port':0x18eb});var socket=require(_0x3640('0xc'))(new Redis(config[_0x3640('0x9')]));require(_0x3640('0xd'))['register'](socket);var jayson=require(_0x3640('0xe'));var client=jayson['client'][_0x3640('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x5f7a9,_0x144269,_0x4f7f40,_0x4fee74){return new BPromise(function(_0x2aa2d7,_0x303cbf){var _0x2eaeb6=_0x4fee74||client;return _0x2eaeb6[_0x3640('0x10')](_0x5f7a9,_0x4f7f40)[_0x3640('0x11')](function(_0x547d77){logger[_0x3640('0x12')](_0x3640('0x13'),_0x144269,_0x3640('0x14'));logger[_0x3640('0x15')](_0x3640('0x16'),_0x144269,_0x3640('0x14'),JSON['stringify'](_0x547d77));if(_0x547d77[_0x3640('0x17')]){if(_0x547d77[_0x3640('0x17')][_0x3640('0x18')]===0x1f4){logger[_0x3640('0x17')](_0x3640('0x13'),_0x144269,_0x547d77[_0x3640('0x17')][_0x3640('0x19')]);return _0x303cbf(_0x547d77[_0x3640('0x17')][_0x3640('0x19')]);}logger['error'](_0x3640('0x13'),_0x144269,_0x547d77['error'][_0x3640('0x19')]);return _0x2aa2d7(_0x547d77[_0x3640('0x17')][_0x3640('0x19')]);}else{logger[_0x3640('0x12')](_0x3640('0x13'),_0x144269,_0x3640('0x14'));_0x2aa2d7(_0x547d77[_0x3640('0x1a')][_0x3640('0x19')]);}})[_0x3640('0x1b')](function(_0x17df16){logger['error']('MailAccount,\x20%s,\x20%s',_0x144269,_0x17df16);_0x303cbf(_0x17df16);});});}function respondWithStatusCode(_0x1981b8,_0x3f9bd1){_0x3f9bd1=_0x3f9bd1||0xcc;return function(_0x595c30){if(_0x595c30){return _0x1981b8[_0x3640('0x1c')](_0x3f9bd1);}return _0x1981b8[_0x3640('0x1d')](_0x3f9bd1)[_0x3640('0x1e')]();};}function respondWithResult(_0x3bae38,_0xc8534f){_0xc8534f=_0xc8534f||0xc8;return function(_0x28b16a){if(_0x28b16a){return _0x3bae38[_0x3640('0x1d')](_0xc8534f)['json'](_0x28b16a);}};}function respondWithFilteredResult(_0x436c9e,_0x55c715){return function(_0x29d2b2){if(_0x29d2b2){var _0x27ffa3=typeof _0x55c715[_0x3640('0x1f')]==='undefined'&&typeof _0x55c715[_0x3640('0x20')]===_0x3640('0x21');var _0x100507=_0x29d2b2[_0x3640('0x22')];var _0x564247=_0x27ffa3?0x0:_0x55c715[_0x3640('0x1f')];var _0x1dcf78=_0x27ffa3?_0x29d2b2[_0x3640('0x22')]:_0x55c715[_0x3640('0x1f')]+_0x55c715[_0x3640('0x20')];var _0x5545c5;if(_0x1dcf78>=_0x100507){_0x1dcf78=_0x100507;_0x5545c5=0xc8;}else{_0x5545c5=0xce;}_0x436c9e[_0x3640('0x1d')](_0x5545c5);return _0x436c9e[_0x3640('0x23')](_0x3640('0x24'),_0x564247+'-'+_0x1dcf78+'/'+_0x100507)['json'](_0x29d2b2);}return null;};}function saveUpdates(_0x3a4bc1){return function(_0xc70496){if(_0xc70496){return _0xc70496['update'](_0x3a4bc1)[_0x3640('0x11')](function(_0x167f8b){return _0x167f8b;});}return null;};}function removeEntity(_0x81877f){return function(_0x52f26b){if(_0x52f26b){return _0x52f26b['destroy']()[_0x3640('0x11')](function(){var _0x16b78c=_0x52f26b[_0x3640('0x25')]({'plain':!![]});var _0x41856b=_0x3640('0x26');return db[_0x3640('0x27')][_0x3640('0x28')]({'where':{'type':_0x41856b,'resourceId':_0x16b78c['id']}})[_0x3640('0x11')](function(){return _0x52f26b;});})[_0x3640('0x11')](function(){_0x81877f[_0x3640('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4ec4){return function(_0x50b204){if(!_0x50b204){_0x1b4ec4[_0x3640('0x1c')](0x194);}return _0x50b204;};}function handleError(_0x508047,_0x187e4e){_0x187e4e=_0x187e4e||0x1f4;return function(_0x28ee0d){logger['error'](_0x28ee0d[_0x3640('0x29')]);if(_0x28ee0d[_0x3640('0x2a')]){delete _0x28ee0d[_0x3640('0x2a')];}_0x508047[_0x3640('0x1d')](_0x187e4e)[_0x3640('0x2b')](_0x28ee0d);};}function getImapHost(_0x1a4cfd){switch(_0x1a4cfd){case'gmail':return'imap.gmail.com';case _0x3640('0x2c'):return _0x3640('0x2d');case _0x3640('0x2e'):return'imap-mail.outlook.com';case _0x3640('0x2f'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x1a4cfd);}function getSmtpHost(_0x2cbef5){switch(_0x2cbef5){case _0x3640('0x30'):return _0x3640('0x31');case _0x3640('0x2c'):return _0x3640('0x32');case'hotmail':return _0x3640('0x33');case'outlook365':return _0x3640('0x34');}throw new Error(_0x3640('0x35'),_0x2cbef5);}function getAuthenticationOptions(_0x318500,_0x1487fb){var _0x54ad85={};var _0x2568b7={};if(_0x318500){_0x54ad85['user']=_0x2568b7['user']=_0x1487fb[_0x3640('0x36')];_0x54ad85[_0x3640('0x37')]=_0x2568b7[_0x3640('0x38')]=_0x1487fb[_0x3640('0x37')];if(_0x1487fb['modernAuthentication']){_0x54ad85['modernAuthentication']=_0x2568b7[_0x3640('0x39')]=!![];_0x54ad85[_0x3640('0x3a')]=_0x2568b7[_0x3640('0x3a')]=_0x1487fb[_0x3640('0x3a')];_0x54ad85[_0x3640('0x37')]=_0x2568b7[_0x3640('0x38')]=null;}else{_0x54ad85[_0x3640('0x3a')]=_0x2568b7['CloudProviderId']=null;}_0x54ad85['host']=getImapHost(_0x318500);_0x54ad85[_0x3640('0x3b')]=0x3e1;_0x2568b7[_0x3640('0x3c')]=getSmtpHost(_0x318500);_0x2568b7['port']=0x24b;_0x2568b7[_0x3640('0x3d')]=![];_0x54ad85[_0x3640('0x3e')]=_0x2568b7['service']=null;}else{if(_0x1487fb[_0x3640('0x3f')]){_0x54ad85[_0x3640('0x40')]=_0x2568b7[_0x3640('0x40')]=_0x1487fb[_0x3640('0x36')];_0x54ad85[_0x3640('0x37')]=_0x2568b7['pass']=_0x1487fb['password'];}else{_0x54ad85[_0x3640('0x3f')]=_0x2568b7[_0x3640('0x3f')]=![];_0x54ad85[_0x3640('0x40')]=_0x2568b7['user']=null;_0x54ad85[_0x3640('0x37')]=_0x2568b7['pass']=null;}_0x54ad85[_0x3640('0x3c')]=_0x1487fb[_0x3640('0x41')][_0x3640('0x3c')];_0x54ad85[_0x3640('0x3b')]=_0x1487fb[_0x3640('0x41')][_0x3640('0x3b')];_0x2568b7['host']=_0x1487fb[_0x3640('0x42')]['host'];_0x2568b7[_0x3640('0x3b')]=_0x1487fb[_0x3640('0x42')][_0x3640('0x3b')];}return{'Imap':_0x54ad85,'Smtp':_0x2568b7};}exports[_0x3640('0x43')]=function(_0x2aa9de,_0x173305){var _0x34ce66={'include':[{'model':db[_0x3640('0x44')],'as':'Imap'},{'model':db[_0x3640('0x45')],'as':_0x3640('0x42')},{'model':db[_0x3640('0x46')],'as':_0x3640('0x47')}]},_0xeda6f0={},_0x524ca9={'count':0x0,'rows':[]};var _0x20ab2c=_[_0x3640('0x48')](db[_0x3640('0x49')][_0x3640('0x4a')],function(_0x5408c9){return{'name':_0x5408c9[_0x3640('0x4b')],'type':_0x5408c9[_0x3640('0x4c')][_0x3640('0x4d')]};});_0xeda6f0['model']=_['map'](_0x20ab2c,'name');_0xeda6f0[_0x3640('0x4e')]=_[_0x3640('0x4f')](_0x2aa9de[_0x3640('0x4e')]);_0xeda6f0['filters']=_[_0x3640('0x50')](_0xeda6f0[_0x3640('0x51')],_0xeda6f0[_0x3640('0x4e')]);_0x34ce66[_0x3640('0x52')]=_['intersection'](_0xeda6f0[_0x3640('0x51')],qs['fields'](_0x2aa9de[_0x3640('0x4e')][_0x3640('0x53')]));_0x34ce66['attributes']=_0x34ce66[_0x3640('0x52')][_0x3640('0x54')]?_0x34ce66['attributes']:_0xeda6f0[_0x3640('0x51')];if(!_0x2aa9de[_0x3640('0x4e')][_0x3640('0x55')](_0x3640('0x56'))){_0x34ce66['limit']=qs[_0x3640('0x20')](_0x2aa9de[_0x3640('0x4e')][_0x3640('0x20')]);_0x34ce66['offset']=qs[_0x3640('0x1f')](_0x2aa9de['query'][_0x3640('0x1f')]);}_0x34ce66[_0x3640('0x57')]=qs[_0x3640('0x58')](_0x2aa9de[_0x3640('0x4e')]['sort']);_0x34ce66[_0x3640('0x59')]=qs[_0x3640('0x5a')](_[_0x3640('0x5b')](_0x2aa9de[_0x3640('0x4e')],_0xeda6f0[_0x3640('0x5a')]),_0x20ab2c);if(_0x2aa9de['query'][_0x3640('0x5c')]){_0x34ce66[_0x3640('0x59')]=_['merge'](_0x34ce66[_0x3640('0x59')],{'$or':_[_0x3640('0x48')](_0x20ab2c,function(_0x29502c){if(_0x29502c[_0x3640('0x4c')]!==_0x3640('0x5d')){var _0x1c30fb={};_0x1c30fb[_0x29502c[_0x3640('0x2a')]]={'$like':'%'+_0x2aa9de[_0x3640('0x4e')][_0x3640('0x5c')]+'%'};return _0x1c30fb;}})});}_0x34ce66=_['merge']({},_0x34ce66,_0x2aa9de[_0x3640('0x5e')]);var _0xe50f9c={'where':_0x34ce66[_0x3640('0x59')]};return db[_0x3640('0x49')][_0x3640('0x22')](_0xe50f9c)[_0x3640('0x11')](function(_0x17373a){_0x524ca9[_0x3640('0x22')]=_0x17373a;if(_0x2aa9de[_0x3640('0x4e')]['includeAll']){_0x34ce66[_0x3640('0x5f')]=[{'all':!![]}];}return db[_0x3640('0x49')][_0x3640('0x60')](_0x34ce66);})[_0x3640('0x11')](function(_0x58a9e1){_0x524ca9[_0x3640('0x61')]=_0x58a9e1;return _0x524ca9;})[_0x3640('0x11')](respondWithFilteredResult(_0x173305,_0x34ce66))[_0x3640('0x1b')](handleError(_0x173305,null));};exports['show']=function(_0x139bf8,_0x3887eb){var _0x2af19d={'raw':![],'where':{'id':_0x139bf8[_0x3640('0x62')]['id']},'include':[{'model':db[_0x3640('0x44')],'as':_0x3640('0x41')},{'model':db[_0x3640('0x45')],'as':_0x3640('0x42')},{'model':db[_0x3640('0x46')],'as':_0x3640('0x47')}]},_0xcb4fe6={};_0xcb4fe6[_0x3640('0x51')]=_[_0x3640('0x4f')](db['MailAccount'][_0x3640('0x4a')]);_0xcb4fe6['query']=_[_0x3640('0x4f')](_0x139bf8[_0x3640('0x4e')]);_0xcb4fe6['filters']=_[_0x3640('0x50')](_0xcb4fe6['model'],_0xcb4fe6[_0x3640('0x4e')]);_0x2af19d[_0x3640('0x52')]=_['intersection'](_0xcb4fe6[_0x3640('0x51')],qs[_0x3640('0x53')](_0x139bf8[_0x3640('0x4e')][_0x3640('0x53')]));_0x2af19d[_0x3640('0x52')]=_0x2af19d[_0x3640('0x52')][_0x3640('0x54')]?_0x2af19d[_0x3640('0x52')]:_0xcb4fe6[_0x3640('0x51')];if(_0x139bf8['query'][_0x3640('0x63')]){_0x2af19d[_0x3640('0x5f')]=[{'all':!![]}];}_0x2af19d=_[_0x3640('0x64')]({},_0x2af19d,_0x139bf8[_0x3640('0x5e')]);return db[_0x3640('0x49')][_0x3640('0x65')](_0x2af19d)[_0x3640('0x11')](handleEntityNotFound(_0x3887eb,null))['then'](respondWithResult(_0x3887eb,null))[_0x3640('0x1b')](handleError(_0x3887eb,null));};exports[_0x3640('0x66')]=function(_0x44156c,_0x5358ea){if(_0x44156c[_0x3640('0x67')]['id']){delete _0x44156c[_0x3640('0x67')]['id'];}var _0x529995=_0x44156c[_0x3640('0x67')]['provider']===_0x3640('0x68')?null:_0x44156c['body'][_0x3640('0x69')];var _0x78538e=_0x44156c['body'][_0x3640('0x41')]||{};var _0x549db4=_0x44156c[_0x3640('0x67')][_0x3640('0x42')]||{};if(_0x529995){_0x78538e['host']=getImapHost(_0x529995);_0x78538e[_0x3640('0x3b')]=0x3e1;_0x549db4[_0x3640('0x3c')]=getSmtpHost(_0x529995);_0x549db4[_0x3640('0x3b')]=0x24b;_0x549db4[_0x3640('0x3d')]=![];}if(_0x549db4[_0x3640('0x39')]){_0x549db4[_0x3640('0x3d')]=![];}else{_0x549db4[_0x3640('0x3a')]=null;}if(!_0x78538e['modernAuthentication'])_0x78538e['CloudProviderId']=null;_0x44156c[_0x3640('0x67')][_0x3640('0x41')]=_0x78538e;_0x44156c['body'][_0x3640('0x42')]=_0x549db4;return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x44156c[_0x3640('0x62')]['id']},'include':[{'model':db[_0x3640('0x44')],'as':'Imap'},{'model':db[_0x3640('0x45')],'as':'Smtp'},{'model':db[_0x3640('0x46')],'as':_0x3640('0x47')}]})[_0x3640('0x11')](handleEntityNotFound(_0x5358ea,null))[_0x3640('0x11')](function(_0x4fbdee){if(!_0x4fbdee)throw new Error('Mail\x20Account\x20not\x20found');if(_0x4fbdee['service'])delete _0x44156c['body'][_0x3640('0x41')];return _0x4fbdee;})[_0x3640('0x11')](saveUpdates(_0x44156c[_0x3640('0x67')],null))[_0x3640('0x11')](function(_0x30445f){if(!_0x44156c[_0x3640('0x67')][_0x3640('0x41')])return _0x30445f;return db[_0x3640('0x44')][_0x3640('0x66')](_0x44156c[_0x3640('0x67')][_0x3640('0x41')],{'where':{'MailAccountId':_0x30445f['id']}})[_0x3640('0x11')](function(){return _0x30445f;});})['then'](function(_0x252e1b){if(!_0x44156c['body'][_0x3640('0x42')])return _0x252e1b;return db[_0x3640('0x45')][_0x3640('0x66')](_0x44156c[_0x3640('0x67')][_0x3640('0x42')],{'where':{'MailAccountId':_0x252e1b['id']}})[_0x3640('0x11')](function(){return _0x252e1b;});})[_0x3640('0x11')](respondWithResult(_0x5358ea,null))[_0x3640('0x1b')](handleError(_0x5358ea,null));};exports['describe']=function(_0x4a51aa,_0x1d0370){return db[_0x3640('0x49')]['describe']()[_0x3640('0x11')](respondWithResult(_0x1d0370,null))['catch'](handleError(_0x1d0370,null));};exports[_0x3640('0x6a')]=function(_0x2c366e,_0x360a11){if(_0x2c366e[_0x3640('0x67')]['id']){delete _0x2c366e[_0x3640('0x67')]['id'];}return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x2c366e[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x360a11,null))[_0x3640('0x11')](function(_0x48defb){if(_0x48defb){_0x2c366e[_0x3640('0x67')][_0x3640('0x6b')]=_0x48defb['id'];return db['Disposition'][_0x3640('0x6c')](_0x2c366e[_0x3640('0x67')]);}})['then'](respondWithResult(_0x360a11,null))[_0x3640('0x1b')](handleError(_0x360a11,null));};exports['getDispositions']=function(_0x328955,_0x23015b){var _0x1849c6={'raw':![],'where':{}};var _0x2636ff={};var _0x158980={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x328955['params']['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x23015b,null))['then'](function(_0x4de112){if(_0x4de112){_0x2636ff[_0x3640('0x51')]=_['keys'](db[_0x3640('0x6d')][_0x3640('0x4a')]);_0x2636ff[_0x3640('0x4e')]=_[_0x3640('0x4f')](_0x328955[_0x3640('0x4e')]);_0x2636ff['filters']=_[_0x3640('0x50')](_0x2636ff[_0x3640('0x51')],_0x2636ff['query']);_0x1849c6[_0x3640('0x52')]=_[_0x3640('0x50')](_0x2636ff[_0x3640('0x51')],qs[_0x3640('0x53')](_0x328955[_0x3640('0x4e')][_0x3640('0x53')]));_0x1849c6[_0x3640('0x52')]=_0x1849c6[_0x3640('0x52')]['length']?_0x1849c6[_0x3640('0x52')]:_0x2636ff[_0x3640('0x51')];if(!_0x328955[_0x3640('0x4e')]['hasOwnProperty'](_0x3640('0x56'))){_0x1849c6['limit']=qs[_0x3640('0x20')](_0x328955[_0x3640('0x4e')][_0x3640('0x20')]);_0x1849c6[_0x3640('0x1f')]=qs[_0x3640('0x1f')](_0x328955[_0x3640('0x4e')]['offset']);}_0x1849c6[_0x3640('0x57')]=qs['sort'](_0x328955[_0x3640('0x4e')][_0x3640('0x58')]);_0x1849c6['where']=qs[_0x3640('0x5a')](_['pick'](_0x328955['query'],_0x2636ff[_0x3640('0x5a')]));_0x1849c6[_0x3640('0x59')]['MailAccountId']=_0x4de112['id'];if(_0x328955['query']['filter']){_0x1849c6[_0x3640('0x59')]=_[_0x3640('0x64')](_0x1849c6[_0x3640('0x59')],{'$or':_['map'](_0x1849c6[_0x3640('0x52')],function(_0x25535f){var _0x146d47={};_0x146d47[_0x25535f]={'$like':'%'+_0x328955[_0x3640('0x4e')][_0x3640('0x5c')]+'%'};return _0x146d47;})});}_0x1849c6=_['merge']({},_0x1849c6,_0x328955[_0x3640('0x5e')]);return db[_0x3640('0x6d')][_0x3640('0x22')]({'where':_0x1849c6[_0x3640('0x59')]})[_0x3640('0x11')](function(_0x402d80){_0x158980[_0x3640('0x22')]=_0x402d80;if(_0x328955[_0x3640('0x4e')][_0x3640('0x63')]){_0x1849c6['include']=[{'all':!![]}];}return db[_0x3640('0x6d')][_0x3640('0x60')](_0x1849c6);})[_0x3640('0x11')](function(_0x1c9692){_0x158980[_0x3640('0x61')]=_0x1c9692;return _0x158980;});}})[_0x3640('0x11')](respondWithFilteredResult(_0x23015b,_0x1849c6))[_0x3640('0x1b')](handleError(_0x23015b,null));};exports[_0x3640('0x6e')]=function(_0x3a43b6,_0x4716ef){return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x3a43b6['params']['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x4716ef,null))[_0x3640('0x11')](function(_0x418b24){if(_0x418b24){return _0x418b24[_0x3640('0x6e')](_0x3a43b6[_0x3640('0x4e')][_0x3640('0x6f')]);}})[_0x3640('0x11')](respondWithStatusCode(_0x4716ef,null))[_0x3640('0x1b')](handleError(_0x4716ef,null));};exports['addAnswer']=function(_0x450242,_0x202b54){if(_0x450242['body']['id']){delete _0x450242[_0x3640('0x67')]['id'];}return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x450242[_0x3640('0x62')]['id']}})['then'](handleEntityNotFound(_0x202b54,null))[_0x3640('0x11')](function(_0x5a48ed){if(_0x5a48ed){_0x450242[_0x3640('0x67')][_0x3640('0x6b')]=_0x5a48ed['id'];return db[_0x3640('0x70')][_0x3640('0x6c')](_0x450242[_0x3640('0x67')]);}})[_0x3640('0x11')](respondWithResult(_0x202b54,null))[_0x3640('0x1b')](handleError(_0x202b54,null));};exports[_0x3640('0x71')]=function(_0x18a4db,_0x5917c6){var _0x140d44={'raw':![],'where':{}};var _0x22b75f={};var _0x2d0ca5={'count':0x0,'rows':[]};return db[_0x3640('0x49')][_0x3640('0x72')]({'where':{'id':_0x18a4db[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x5917c6,null))[_0x3640('0x11')](function(_0x3669be){if(_0x3669be){_0x22b75f[_0x3640('0x51')]=_[_0x3640('0x4f')](db[_0x3640('0x70')][_0x3640('0x4a')]);_0x22b75f[_0x3640('0x4e')]=_['keys'](_0x18a4db['query']);_0x22b75f['filters']=_[_0x3640('0x50')](_0x22b75f['model'],_0x22b75f['query']);_0x140d44[_0x3640('0x52')]=_[_0x3640('0x50')](_0x22b75f['model'],qs[_0x3640('0x53')](_0x18a4db[_0x3640('0x4e')][_0x3640('0x53')]));_0x140d44['attributes']=_0x140d44[_0x3640('0x52')]['length']?_0x140d44[_0x3640('0x52')]:_0x22b75f[_0x3640('0x51')];if(!_0x18a4db[_0x3640('0x4e')]['hasOwnProperty']('nolimit')){_0x140d44[_0x3640('0x20')]=qs[_0x3640('0x20')](_0x18a4db['query'][_0x3640('0x20')]);_0x140d44[_0x3640('0x1f')]=qs[_0x3640('0x1f')](_0x18a4db[_0x3640('0x4e')][_0x3640('0x1f')]);}_0x140d44[_0x3640('0x57')]=qs[_0x3640('0x58')](_0x18a4db[_0x3640('0x4e')]['sort']);_0x140d44[_0x3640('0x59')]=qs[_0x3640('0x5a')](_[_0x3640('0x5b')](_0x18a4db[_0x3640('0x4e')],_0x22b75f[_0x3640('0x5a')]));_0x140d44[_0x3640('0x59')][_0x3640('0x6b')]=_0x3669be['id'];if(_0x18a4db['query'][_0x3640('0x5c')]){_0x140d44[_0x3640('0x59')]=_[_0x3640('0x64')](_0x140d44[_0x3640('0x59')],{'$or':_['map'](_0x140d44['attributes'],function(_0xb32ef0){var _0xeb5b88={};_0xeb5b88[_0xb32ef0]={'$like':'%'+_0x18a4db['query'][_0x3640('0x5c')]+'%'};return _0xeb5b88;})});}_0x140d44=_['merge']({},_0x140d44,_0x18a4db[_0x3640('0x5e')]);return db[_0x3640('0x70')][_0x3640('0x22')]({'where':_0x140d44['where']})[_0x3640('0x11')](function(_0x53b8ca){_0x2d0ca5[_0x3640('0x22')]=_0x53b8ca;if(_0x18a4db['query'][_0x3640('0x63')]){_0x140d44['include']=[{'all':!![]}];}return db[_0x3640('0x70')][_0x3640('0x60')](_0x140d44);})[_0x3640('0x11')](function(_0x8208c1){_0x2d0ca5[_0x3640('0x61')]=_0x8208c1;return _0x2d0ca5;});}})[_0x3640('0x11')](respondWithFilteredResult(_0x5917c6,_0x140d44))[_0x3640('0x1b')](handleError(_0x5917c6,null));};exports['removeAnswers']=function(_0x5a73b0,_0x225fb8){return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x5a73b0[_0x3640('0x62')]['id']}})['then'](handleEntityNotFound(_0x225fb8,null))[_0x3640('0x11')](function(_0x12959a){if(_0x12959a){return _0x12959a[_0x3640('0x73')](_0x5a73b0[_0x3640('0x4e')][_0x3640('0x6f')]);}})[_0x3640('0x11')](respondWithStatusCode(_0x225fb8,null))[_0x3640('0x1b')](handleError(_0x225fb8,null));};exports['create']=function(_0xb2ff9a,_0x3f6a7f){var _0x2241e1={'name':_0xb2ff9a[_0x3640('0x67')][_0x3640('0x2a')],'key':_0xb2ff9a['body'][_0x3640('0x4d')],'provider':_0xb2ff9a[_0x3640('0x67')][_0x3640('0x69')]==='custom'?null:_0xb2ff9a[_0x3640('0x67')]['provider'],'email':_0xb2ff9a[_0x3640('0x67')][_0x3640('0x74')],'ListId':_0xb2ff9a[_0x3640('0x67')][_0x3640('0x75')],'active':!_[_0x3640('0x76')](_0xb2ff9a[_0x3640('0x67')]['active'])?_0xb2ff9a[_0x3640('0x67')]['active']:!![],'description':_0xb2ff9a['body'][_0x3640('0x77')]||null};var _0x5ec764=getAuthenticationOptions(_0x2241e1[_0x3640('0x69')],_0xb2ff9a[_0x3640('0x67')]);_0x2241e1['Imap']=_0x5ec764['Imap'];_0x2241e1['Smtp']=_0x5ec764['Smtp'];return db[_0x3640('0x49')]['create'](_0x2241e1,{'include':[{'model':db['MailServerOut'],'as':_0x3640('0x42')},{'model':db[_0x3640('0x44')],'as':'Imap'}]})[_0x3640('0x11')](function(_0x3b8c2f){var _0x44b4b4=_0xb2ff9a[_0x3640('0x40')][_0x3640('0x25')]({'plain':!![]});if(!_0x44b4b4)throw new Error(_0x3640('0x78'));if(_0x44b4b4[_0x3640('0x79')]==='user'){var _0x2aa1d8=_0x3b8c2f[_0x3640('0x25')]({'plain':!![]});return db[_0x3640('0x7a')][_0x3640('0x65')]({'where':{'name':_0x3640('0x26'),'userProfileId':_0x44b4b4[_0x3640('0x7b')]},'raw':!![]})['then'](function(_0x39677d){if(_0x39677d&&_0x39677d[_0x3640('0x7c')]===0x0){return db['UserProfileResource'][_0x3640('0x6c')]({'name':_0x2aa1d8[_0x3640('0x2a')],'resourceId':_0x2aa1d8['id'],'type':_0x39677d[_0x3640('0x2a')],'sectionId':_0x39677d['id']},{})[_0x3640('0x11')](function(){return _0x3b8c2f;});}else{return _0x3b8c2f;}})['catch'](function(_0x1e2408){logger['error'](_0x3640('0x7d'),_0x1e2408);throw _0x1e2408;});}return _0x3b8c2f;})[_0x3640('0x11')](respondWithResult(_0x3f6a7f,0xc9))[_0x3640('0x1b')](handleError(_0x3f6a7f,null));};exports[_0x3640('0x7e')]=function(_0xbe53c,_0x5e7677){return db[_0x3640('0x49')][_0x3640('0x72')]({'where':{'id':_0xbe53c[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x5e7677,null))[_0x3640('0x11')](function(_0x17212f){if(_0x17212f){return _0x17212f[_0x3640('0x7e')]();}return null;})[_0x3640('0x11')](respondWithResult(_0x5e7677,null))[_0x3640('0x1b')](handleError(_0x5e7677,null));};exports[_0x3640('0x7f')]=function(_0x1a0930,_0x33f695){if(_0x1a0930[_0x3640('0x67')]['id']){delete _0x1a0930['body']['id'];}return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x1a0930['params']['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x33f695,null))['then'](function(_0x28a552){if(_0x28a552){_0x1a0930[_0x3640('0x67')][_0x3640('0x6b')]=_0x28a552['id'];return db[_0x3640('0x44')][_0x3640('0x6c')](_0x1a0930['body']);}})[_0x3640('0x11')](respondWithResult(_0x33f695,null))[_0x3640('0x1b')](handleError(_0x33f695,null));};exports[_0x3640('0x80')]=function(_0x18f532,_0x2b8075){return db[_0x3640('0x49')][_0x3640('0x72')]({'where':{'id':_0x18f532[_0x3640('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b8075,null))[_0x3640('0x11')](function(_0x148efc){if(_0x148efc){return _0x148efc[_0x3640('0x81')](null);}return null;})[_0x3640('0x11')](respondWithStatusCode(_0x2b8075,null))[_0x3640('0x1b')](handleError(_0x2b8075,null));};exports['getSmtp']=function(_0x1a96ed,_0x40560c){return db['MailAccount'][_0x3640('0x72')]({'where':{'id':_0x1a96ed['params']['id']}})['then'](handleEntityNotFound(_0x40560c,null))['then'](function(_0xa05b6b){if(_0xa05b6b){return _0xa05b6b['getSmtp']();}return null;})['then'](respondWithResult(_0x40560c,null))[_0x3640('0x1b')](handleError(_0x40560c,null));};exports[_0x3640('0x82')]=function(_0xaac7fe,_0x72f367){if(_0xaac7fe[_0x3640('0x67')]['id']){delete _0xaac7fe['body']['id'];}return db['MailAccount'][_0x3640('0x65')]({'where':{'id':_0xaac7fe[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x72f367,null))[_0x3640('0x11')](function(_0x10adad){if(_0x10adad){_0xaac7fe[_0x3640('0x67')][_0x3640('0x6b')]=_0x10adad['id'];return db[_0x3640('0x45')][_0x3640('0x6c')](_0xaac7fe[_0x3640('0x67')]);}})[_0x3640('0x11')](respondWithResult(_0x72f367,null))[_0x3640('0x1b')](handleError(_0x72f367,null));};exports[_0x3640('0x83')]=function(_0x1189b2,_0x16d345){return db[_0x3640('0x49')][_0x3640('0x72')]({'where':{'id':_0x1189b2[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x16d345,null))[_0x3640('0x11')](function(_0x207b03){if(_0x207b03){return _0x207b03[_0x3640('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x16d345,null))[_0x3640('0x1b')](handleError(_0x16d345,null));};exports['addInteraction']=function(_0x26dbde,_0x526d08){return db['MailInteraction'][_0x3640('0x65')]({'where':{'id':_0x26dbde[_0x3640('0x62')]['id']}})['then'](handleEntityNotFound(_0x526d08,null))['then'](function(_0x29c981){if(_0x29c981){return _0x29c981[_0x3640('0x85')](_0x26dbde[_0x3640('0x67')]['ids'],_[_0x3640('0x86')](_0x26dbde[_0x3640('0x67')],[_0x3640('0x6f'),'id'])||{});}})[_0x3640('0x11')](respondWithResult(_0x526d08,null))['catch'](handleError(_0x526d08,null));};exports[_0x3640('0x87')]=function(_0x5b1c05,_0x1b955d){var _0x22849e={'raw':![],'where':{}};var _0x292fed={};var _0x592378={'count':0x0,'rows':[]};return db['MailAccount'][_0x3640('0x72')]({'where':{'id':_0x5b1c05[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x1b955d,null))[_0x3640('0x11')](function(_0x5755d4){if(_0x5755d4){_0x292fed[_0x3640('0x51')]=_[_0x3640('0x4f')](db[_0x3640('0x88')]['rawAttributes']);_0x292fed['query']=_[_0x3640('0x4f')](_0x5b1c05[_0x3640('0x4e')]);_0x292fed['filters']=_[_0x3640('0x50')](_0x292fed['model'],_0x292fed[_0x3640('0x4e')]);_0x22849e[_0x3640('0x52')]=_[_0x3640('0x50')](_0x292fed['model'],qs[_0x3640('0x53')](_0x5b1c05[_0x3640('0x4e')][_0x3640('0x53')]));_0x22849e['attributes']=_0x22849e[_0x3640('0x52')]['length']?_0x22849e[_0x3640('0x52')]:_0x292fed['model'];if(!_0x5b1c05[_0x3640('0x4e')][_0x3640('0x55')](_0x3640('0x56'))){_0x22849e[_0x3640('0x20')]=qs[_0x3640('0x20')](_0x5b1c05[_0x3640('0x4e')]['limit']);_0x22849e['offset']=qs['offset'](_0x5b1c05[_0x3640('0x4e')][_0x3640('0x1f')]);}_0x22849e[_0x3640('0x57')]=qs[_0x3640('0x58')](_0x5b1c05[_0x3640('0x4e')][_0x3640('0x58')]);_0x22849e[_0x3640('0x59')]=qs['filters'](_[_0x3640('0x5b')](_0x5b1c05['query'],_0x292fed[_0x3640('0x5a')]));_0x22849e[_0x3640('0x59')][_0x3640('0x6b')]=_0x5755d4['id'];if(_0x5b1c05[_0x3640('0x4e')][_0x3640('0x5c')]){_0x22849e[_0x3640('0x59')]=_['merge'](_0x22849e[_0x3640('0x59')],{'$or':_['map'](_0x22849e[_0x3640('0x52')],function(_0x9dd295){var _0x1a0204={};_0x1a0204[_0x9dd295]={'$like':'%'+_0x5b1c05[_0x3640('0x4e')][_0x3640('0x5c')]+'%'};return _0x1a0204;})});}_0x22849e=_[_0x3640('0x64')]({},_0x22849e,_0x5b1c05[_0x3640('0x5e')]);return db[_0x3640('0x88')]['count']({'where':_0x22849e[_0x3640('0x59')]})[_0x3640('0x11')](function(_0x5eafcc){_0x592378[_0x3640('0x22')]=_0x5eafcc;if(_0x5b1c05['query']['includeAll']){_0x22849e[_0x3640('0x5f')]=[{'model':db[_0x3640('0x89')],'as':_0x3640('0x8a'),'required':![]},{'model':db[_0x3640('0x8b')],'as':_0x3640('0x8c'),'attributes':[_0x3640('0x2a'),_0x3640('0x8d'),'internal'],'required':![]},{'model':db[_0x3640('0x8e')],'as':_0x3640('0x8f'),'attributes':['id',_0x3640('0x2a'),'color'],'where':_0x5b1c05[_0x3640('0x4e')]['tag']?{'id':_0x5b1c05[_0x3640('0x4e')][_0x3640('0x90')]}:undefined,'required':_0x5b1c05['query']['tag']?!![]:![]}];}return db[_0x3640('0x88')][_0x3640('0x60')](_0x22849e);})['then'](function(_0x311666){_0x592378[_0x3640('0x61')]=_0x311666;return _0x592378;});}})[_0x3640('0x11')](respondWithFilteredResult(_0x1b955d,_0x22849e))[_0x3640('0x1b')](handleError(_0x1b955d,null));};exports[_0x3640('0x91')]=function addApplications(_0x28f481,_0x59216e){var _0x32449b=_0x28f481['params']['id'];var _0x56544d=_0x28f481[_0x3640('0x67')];var _0x1f39ac=0xc8;var _0x36882c=null;return db[_0x3640('0x92')][_0x3640('0x93')]({'isolationLevel':db[_0x3640('0x92')][_0x3640('0x94')][_0x3640('0x95')][_0x3640('0x96')]},function(_0x27b35d){return db[_0x3640('0x49')][_0x3640('0x72')]({'where':{'id':_0x32449b},'transaction':_0x27b35d})[_0x3640('0x11')](function(_0x59a99a){if(_0x59a99a){return db[_0x3640('0x97')][_0x3640('0x28')]({'where':{'MailAccountId':_0x32449b},'transaction':_0x27b35d})[_0x3640('0x11')](function(){var _0x1b1e83=_[_0x3640('0x48')](_0x56544d,function(_0x4331bb){_0x4331bb[_0x3640('0x6b')]=_0x32449b;return _0x4331bb;});return db[_0x3640('0x97')][_0x3640('0x98')](_0x1b1e83,{'transaction':_0x27b35d});});}else{_0x1f39ac=0x194;_0x36882c=[];}});})[_0x3640('0x11')](function(){if(_0x1f39ac!==0x194){return db[_0x3640('0x97')][_0x3640('0x99')]({'where':{'MailAccountId':_0x32449b},'order':_0x3640('0x9a')})[_0x3640('0x11')](function(_0x3d3a96){_0x36882c=_0x3d3a96;});}})[_0x3640('0x1b')](function(_0x1b1886){_0x1f39ac=0x1f4;logger[_0x3640('0x17')](_0x1b1886[_0x3640('0x29')]);if(_0x1b1886[_0x3640('0x2a')]){delete _0x1b1886[_0x3640('0x2a')];}_0x36882c=_0x1b1886;})[_0x3640('0x9b')](function(){if(_0x36882c===null){_0x59216e[_0x3640('0x1c')](_0x1f39ac);}else{if(_0x1f39ac===0x1f4){_0x59216e['status'](_0x1f39ac)[_0x3640('0x2b')](_0x36882c);}else{_0x59216e[_0x3640('0x1d')](_0x1f39ac)[_0x3640('0x9c')](_0x36882c);}}});};exports[_0x3640('0x9d')]=function(_0x1f8021,_0x31032f){var _0x3a8040={};var _0x55cd40={};var _0x8fb90;var _0x1c21af;return db['MailAccount'][_0x3640('0x72')]({'where':{'id':_0x1f8021[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x31032f,null))[_0x3640('0x11')](function(_0x4b1959){if(_0x4b1959){_0x8fb90=_0x4b1959;_0x55cd40[_0x3640('0x51')]=_[_0x3640('0x4f')](db[_0x3640('0x97')][_0x3640('0x4a')]);_0x55cd40[_0x3640('0x4e')]=_['keys'](_0x1f8021[_0x3640('0x4e')]);_0x55cd40[_0x3640('0x5a')]=_[_0x3640('0x50')](_0x55cd40['model'],_0x55cd40['query']);_0x3a8040['attributes']=_[_0x3640('0x50')](_0x55cd40[_0x3640('0x51')],qs[_0x3640('0x53')](_0x1f8021[_0x3640('0x4e')][_0x3640('0x53')]));_0x3a8040['attributes']=_0x3a8040[_0x3640('0x52')][_0x3640('0x54')]?_0x3a8040['attributes']:_0x55cd40[_0x3640('0x51')];_0x3a8040[_0x3640('0x57')]=qs[_0x3640('0x58')](_0x1f8021[_0x3640('0x4e')][_0x3640('0x58')]);_0x3a8040['where']=qs['filters'](_[_0x3640('0x5b')](_0x1f8021['query'],_0x55cd40[_0x3640('0x5a')]));if(_0x1f8021['query'][_0x3640('0x5c')]){_0x3a8040[_0x3640('0x59')]=_[_0x3640('0x64')](_0x3a8040[_0x3640('0x59')],{'$or':_[_0x3640('0x48')](_0x3a8040[_0x3640('0x52')],function(_0x4e2dac){var _0x2d9e9b={};_0x2d9e9b[_0x4e2dac]={'$like':'%'+_0x1f8021['query'][_0x3640('0x5c')]+'%'};return _0x2d9e9b;})});}_0x3a8040=_[_0x3640('0x64')]({},_0x3a8040,_0x1f8021['options']);return _0x8fb90[_0x3640('0x9d')](_0x3a8040);}})['then'](function(_0x4b2d44){if(_0x4b2d44){_0x1c21af=_0x4b2d44[_0x3640('0x54')];if(!_0x1f8021['query'][_0x3640('0x55')](_0x3640('0x56'))){_0x3a8040[_0x3640('0x20')]=qs['limit'](_0x1f8021[_0x3640('0x4e')]['limit']);_0x3a8040['offset']=qs[_0x3640('0x1f')](_0x1f8021[_0x3640('0x4e')][_0x3640('0x1f')]);}return _0x8fb90[_0x3640('0x9d')](_0x3a8040);}})[_0x3640('0x11')](function(_0xc3c618){if(_0xc3c618){return _0xc3c618?{'count':_0x1c21af,'rows':_0xc3c618}:null;}})['then'](respondWithResult(_0x31032f,null))[_0x3640('0x1b')](handleError(_0x31032f,null));};exports[_0x3640('0x9e')]=function(_0xa6a46f,_0x28cef0){var _0x575f4e={'raw':!![],'where':{}};var _0x1815c9={};var _0x35959f={'count':0x0,'rows':[]};return db[_0x3640('0x49')][_0x3640('0x72')]({'where':{'id':_0xa6a46f[_0x3640('0x62')]['id']}})['then'](handleEntityNotFound(_0x28cef0,null))[_0x3640('0x11')](function(_0x3f237d){if(_0x3f237d){_0x1815c9[_0x3640('0x51')]=_[_0x3640('0x4f')](db[_0x3640('0x9f')][_0x3640('0x4a')]);_0x1815c9[_0x3640('0x4e')]=_[_0x3640('0x4f')](_0xa6a46f['query']);_0x1815c9[_0x3640('0x5a')]=_['intersection'](_0x1815c9['model'],_0x1815c9[_0x3640('0x4e')]);_0x575f4e[_0x3640('0x52')]=_[_0x3640('0x50')](_0x1815c9[_0x3640('0x51')],qs['fields'](_0xa6a46f['query'][_0x3640('0x53')]));_0x575f4e[_0x3640('0x52')]=_0x575f4e['attributes']['length']?_0x575f4e[_0x3640('0x52')]:_0x1815c9[_0x3640('0x51')];if(!_0xa6a46f['query']['hasOwnProperty'](_0x3640('0x56'))){_0x575f4e[_0x3640('0x20')]=qs[_0x3640('0x20')](_0xa6a46f[_0x3640('0x4e')][_0x3640('0x20')]);_0x575f4e['offset']=qs['offset'](_0xa6a46f[_0x3640('0x4e')]['offset']);}_0x575f4e['order']=qs[_0x3640('0x58')](_0xa6a46f[_0x3640('0x4e')][_0x3640('0x58')]);_0x575f4e[_0x3640('0x59')]=qs['filters'](_[_0x3640('0x5b')](_0xa6a46f[_0x3640('0x4e')],_0x1815c9['filters']));_0x575f4e[_0x3640('0x59')][_0x3640('0x6b')]=_0x3f237d['id'];if(_0xa6a46f['query'][_0x3640('0x5c')]){_0x575f4e[_0x3640('0x59')]=_['merge'](_0x575f4e[_0x3640('0x59')],{'$or':_[_0x3640('0x48')](_0x575f4e[_0x3640('0x52')],function(_0x21849f){var _0x2ca508={};_0x2ca508[_0x21849f]={'$like':'%'+_0xa6a46f[_0x3640('0x4e')]['filter']+'%'};return _0x2ca508;})});}if(_0xa6a46f[_0x3640('0x4e')][_0x3640('0xa0')]){var _0xb1f698=_0xa6a46f[_0x3640('0x4e')][_0x3640('0xa0')][_0x3640('0xa1')](',');var _0x2abe60={};_0x2abe60[_0xb1f698[0x0]]={'$gte':moment(_0xb1f698[0x1])[_0x3640('0xa2')](_0x3640('0xa3'))};_0x575f4e[_0x3640('0x59')]=_['merge'](_0x575f4e['where'],_0x2abe60);}_0x575f4e=_['merge']({},_0x575f4e,_0xa6a46f['options']);return db[_0x3640('0x9f')][_0x3640('0x22')]({'where':_0x575f4e[_0x3640('0x59')]})['then'](function(_0xf18612){_0x35959f['count']=_0xf18612;if(_0xa6a46f[_0x3640('0x4e')][_0x3640('0x63')]){_0x575f4e['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x575f4e);})[_0x3640('0x11')](function(_0x3b722f){if(_0xa6a46f[_0x3640('0x4e')][_0x3640('0xa4')]===_0x3640('0xa5')){for(var _0x5b7978=0x0;_0x5b7978<_0x3b722f[_0x3640('0x54')];_0x5b7978++){_0x3b722f[_0x5b7978][_0x3640('0x67')]=juice(_0x3b722f[_0x5b7978][_0x3640('0x67')]);}}_0x35959f[_0x3640('0x61')]=_0x3b722f;return _0x35959f;});}})['then'](respondWithFilteredResult(_0x28cef0,_0x575f4e))[_0x3640('0x1b')](handleError(_0x28cef0,null));};exports['send']=function(_0x275afc,_0xfc76e0){var _0x520769,_0x14bac6={},_0x1874bb;if(_0x275afc[_0x3640('0x67')]['to']){_0x1874bb=_0x275afc[_0x3640('0x67')]['to'][_0x3640('0xa1')](',')[0x0];}return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x275afc[_0x3640('0x62')]['id']},'include':[{'model':db[_0x3640('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3640('0xa7'),'where':{'email':_0x1874bb},'limit':0x1,'order':[['updatedAt',_0x3640('0xa8')]]}]},{'model':db[_0x3640('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x3640('0xa9')],'as':'CloudProvider','raw':!![]}]}]})[_0x3640('0x11')](handleEntityNotFound(_0xfc76e0,null))[_0x3640('0x11')](function(_0x2282ef){if(!_0x2282ef)return;_0x520769=_0x2282ef;if(!_0x2282ef['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x3640('0x76')](_0x275afc[_0x3640('0x67')][_0x3640('0xaa')])){_0x275afc[_0x3640('0x67')][_0x3640('0xaa')]=util[_0x3640('0xa2')](_0x3640('0xab'),_0x2282ef[_0x3640('0x2a')],_0x2282ef[_0x3640('0x74')]||_0x2282ef[_0x3640('0x42')][_0x3640('0x40')]);}if(_0x275afc[_0x3640('0x67')]['attachments']&&_0x275afc[_0x3640('0x67')]['attachments'][_0x3640('0x54')]){for(var _0x3ae6f2=0x0;_0x3ae6f2<_0x275afc[_0x3640('0x67')]['attachments']['length'];_0x3ae6f2+=0x1){_0x275afc[_0x3640('0x67')][_0x3640('0xac')][_0x3ae6f2]={'filename':_0x275afc[_0x3640('0x67')][_0x3640('0xac')][_0x3ae6f2][_0x3640('0x2a')],'path':path[_0x3640('0xad')](config[_0x3640('0xae')],'server/files/attachments',_0x275afc['body'][_0x3640('0xac')][_0x3ae6f2][_0x3640('0xaf')])};}}var _0x495f38=_0x2282ef['getSmtpOptions']();return respondWithRpcPromise(_0x3640('0xb0'),_0x3640('0xb1'),{'account':_0x495f38,'message':_0x275afc['body']});})[_0x3640('0x11')](function(_0x28c339){if(!_0x28c339)return;_0x14bac6=_0x28c339;if(!_0x520769['List'])throw new Error('List\x20not\x20found');if(_0x520769[_0x3640('0xb2')][_0x3640('0xa7')][_0x3640('0x54')])return _0x520769[_0x3640('0xb2')][_0x3640('0xa7')][0x0];return db[_0x3640('0x89')]['create'](_[_0x3640('0xa')](_0x275afc[_0x3640('0x67')],{'firstName':_0x275afc[_0x3640('0x67')]['to'],'email':_0x275afc[_0x3640('0x67')]['to'],'phone':_0x275afc[_0x3640('0x67')]['to'],'ListId':_0x520769[_0x3640('0x75')]}));})['then'](function(_0x4d8949){if(!_0x4d8949)return;var _0x4eaf6c={'UserId':_0x275afc['user']['id'],'ContactId':_0x4d8949['id'],'MailAccountId':_0x520769['id'],'inReplyTo':_0x14bac6[_0x3640('0xb3')],'to':_0x275afc[_0x3640('0x67')][_0x3640('0xaa')],'cc':_0x275afc[_0x3640('0x67')]['cc'],'subject':_0x275afc[_0x3640('0x67')][_0x3640('0xb4')],'attach':_0x275afc[_0x3640('0x67')][_0x3640('0xb5')],'firstMsgDirection':_0x3640('0xb6'),'lastMsgAt':moment()[_0x3640('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x3640('0x64')](_0x275afc[_0x3640('0x67')],{'messageId':_0x14bac6['messageId'],'sentAt':moment()[_0x3640('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x520769['id'],'UserId':_0x275afc[_0x3640('0x40')]['id'],'ContactId':_0x4d8949['id']})]};if(_0x275afc['body'][_0x3640('0xb7')]){_0x4eaf6c=_[_0x3640('0x64')](_0x4eaf6c,_0x275afc[_0x3640('0x67')][_0x3640('0xb7')]);}return db[_0x3640('0x88')][_0x3640('0x6c')](_0x4eaf6c,{'include':[{'model':db[_0x3640('0x9f')],'as':_0x3640('0xb8')}]});})[_0x3640('0x11')](respondWithResult(_0xfc76e0,null))[_0x3640('0x1b')](handleError(_0xfc76e0,null));};exports[_0x3640('0xb9')]=function(_0xebec14,_0x58d09d){return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0xebec14['params']['id']},'include':[{'model':db[_0x3640('0x45')],'as':_0x3640('0x42'),'raw':!![],'include':[{'model':db[_0x3640('0xa9')],'as':_0x3640('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x58d09d,null))[_0x3640('0x11')](function(_0x23be15){if(!_0x23be15['Smtp'])return;var _0x1646db=_0x23be15[_0x3640('0xba')]();return respondWithRpcPromise(_0x3640('0xbb'),_0x3640('0xb9'),{'account':_0x1646db});})['then'](respondWithResult(_0x58d09d,null))[_0x3640('0x1b')](handleError(_0x58d09d,null));};exports['destroy']=function(_0x2ad887,_0x23300d){return db[_0x3640('0x49')]['find']({'where':{'id':_0x2ad887[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x23300d,null))['then'](function(_0x8a20ac){if(_0x8a20ac&&_0x8a20ac[_0x3640('0x3e')]){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x8a20ac;})[_0x3640('0x11')](removeEntity(_0x23300d,null))[_0x3640('0x1b')](handleError(_0x23300d,null));};exports['addAgents']=function(_0x281f5b,_0x327d36){return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x281f5b[_0x3640('0x62')]['id']}})['then'](handleEntityNotFound(_0x327d36,null))[_0x3640('0x11')](function(_0x105885){if(_0x105885){return _0x105885[_0x3640('0xbc')](_0x281f5b[_0x3640('0x67')][_0x3640('0x6f')],_[_0x3640('0x86')](_0x281f5b[_0x3640('0x67')],[_0x3640('0x6f'),'id'])||{})['spread'](function(_0xf9acc5){for(var _0x57e742=0x0;_0x57e742<_0x281f5b[_0x3640('0x67')][_0x3640('0x6f')][_0x3640('0x54')];_0x57e742+=0x1){socket['emit'](_0x3640('0xbd'),{'UserId':Number(_0x281f5b['body'][_0x3640('0x6f')][_0x57e742]),'MailAccountId':Number(_0x281f5b[_0x3640('0x62')]['id'])});}return _0xf9acc5;});}})[_0x3640('0x11')](respondWithResult(_0x327d36,null))[_0x3640('0x1b')](handleError(_0x327d36,null));};exports[_0x3640('0xbe')]=function(_0x5ee857,_0x3900b8){return db[_0x3640('0x49')][_0x3640('0x65')]({'where':{'id':_0x5ee857[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x3900b8,null))[_0x3640('0x11')](function(_0x4cdb95){if(_0x4cdb95){return _0x4cdb95['removeAgents'](_0x5ee857[_0x3640('0x4e')]['ids'])['then'](function(){if(_[_0x3640('0xbf')](_0x5ee857[_0x3640('0x4e')][_0x3640('0x6f')])){for(var _0x4baea1=0x0;_0x4baea1<_0x5ee857[_0x3640('0x4e')][_0x3640('0x6f')][_0x3640('0x54')];_0x4baea1+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x5ee857[_0x3640('0x4e')]['ids'][_0x4baea1]),'MailAccountId':Number(_0x5ee857[_0x3640('0x62')]['id'])});}}else{socket['emit'](_0x3640('0xc0'),{'UserId':Number(_0x5ee857[_0x3640('0x4e')][_0x3640('0x6f')]),'MailAccountId':Number(_0x5ee857[_0x3640('0x62')]['id'])});}});}})[_0x3640('0x11')](respondWithStatusCode(_0x3900b8,null))[_0x3640('0x1b')](handleError(_0x3900b8,null));};exports[_0x3640('0xc1')]=function(_0x1af3c6,_0x4d9815){var _0x37c229={};var _0x323c8c={};var _0x1cae30;var _0x420170;return db['MailAccount'][_0x3640('0x72')]({'where':{'id':_0x1af3c6[_0x3640('0x62')]['id']}})[_0x3640('0x11')](handleEntityNotFound(_0x4d9815,null))[_0x3640('0x11')](function(_0x22b255){if(_0x22b255){_0x1cae30=_0x22b255;_0x323c8c[_0x3640('0x51')]=_[_0x3640('0x4f')](db[_0x3640('0x8b')][_0x3640('0x4a')]);_0x323c8c[_0x3640('0x4e')]=_['keys'](_0x1af3c6[_0x3640('0x4e')]);_0x323c8c[_0x3640('0x5a')]=_['intersection'](_0x323c8c[_0x3640('0x51')],_0x323c8c[_0x3640('0x4e')]);_0x37c229['attributes']=_[_0x3640('0x50')](_0x323c8c['model'],qs[_0x3640('0x53')](_0x1af3c6[_0x3640('0x4e')][_0x3640('0x53')]));_0x37c229[_0x3640('0x52')]=_0x37c229[_0x3640('0x52')][_0x3640('0x54')]?_0x37c229[_0x3640('0x52')]:_0x323c8c[_0x3640('0x51')];_0x37c229['order']=qs[_0x3640('0x58')](_0x1af3c6['query']['sort']);_0x37c229[_0x3640('0x59')]=qs[_0x3640('0x5a')](_[_0x3640('0x5b')](_0x1af3c6[_0x3640('0x4e')],_0x323c8c[_0x3640('0x5a')]));if(_0x1af3c6[_0x3640('0x4e')][_0x3640('0x5c')]){_0x37c229['where']=_[_0x3640('0x64')](_0x37c229[_0x3640('0x59')],{'$or':_[_0x3640('0x48')](_0x37c229[_0x3640('0x52')],function(_0x2b41de){var _0x5579b3={};_0x5579b3[_0x2b41de]={'$like':'%'+_0x1af3c6['query']['filter']+'%'};return _0x5579b3;})});}_0x37c229=_[_0x3640('0x64')]({},_0x37c229,_0x1af3c6['options']);return _0x1cae30[_0x3640('0xc1')](_0x37c229);}})[_0x3640('0x11')](function(_0x3ac994){if(_0x3ac994){_0x420170=_0x3ac994['length'];if(!_0x1af3c6['query']['hasOwnProperty'](_0x3640('0x56'))){_0x37c229[_0x3640('0x20')]=qs[_0x3640('0x20')](_0x1af3c6['query']['limit']);_0x37c229[_0x3640('0x1f')]=qs[_0x3640('0x1f')](_0x1af3c6[_0x3640('0x4e')][_0x3640('0x1f')]);}return _0x1cae30[_0x3640('0xc1')](_0x37c229);}})[_0x3640('0x11')](function(_0x1e8303){if(_0x1e8303){return _0x1e8303?{'count':_0x420170,'rows':_0x1e8303}:null;}})['then'](respondWithResult(_0x4d9815,null))[_0x3640('0x1b')](handleError(_0x4d9815,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 94afc0c..b1fffdc 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 _0x273b=['../../mysqldb','MailAccount','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x32c78a,_0x13f562){var _0x112393=function(_0xa5be3a){while(--_0xa5be3a){_0x32c78a['push'](_0x32c78a['shift']());}};_0x112393(++_0x13f562);}(_0x273b,0xb8));var _0xb273=function(_0x42e8c4,_0x54233d){_0x42e8c4=_0x42e8c4-0x0;var _0x4d23e7=_0x273b[_0x42e8c4];return _0x4d23e7;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xb273('0x0'))['db'][_0xb273('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb273('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb273('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45ed16){return function(_0x205c79,_0x59ab96,_0x479103){MailAccountEvents[_0xb273('0x4')](_0x45ed16+':'+_0x205c79['id'],_0x205c79);MailAccountEvents[_0xb273('0x4')](_0x45ed16,_0x205c79);_0x479103(null);};}for(var e in events){if(events[_0xb273('0x5')](e)){var event=events[e];MailAccount[_0xb273('0x6')](e,emitEvent(event));}}module[_0xb273('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x72e4=['MailAccount','setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x217393,_0x5542f0){var _0x1d8ef0=function(_0x4811ed){while(--_0x4811ed){_0x217393['push'](_0x217393['shift']());}};_0x1d8ef0(++_0x5542f0);}(_0x72e4,0xae));var _0x472e=function(_0x268327,_0xffb028){_0x268327=_0x268327-0x0;var _0x51be91=_0x72e4[_0x268327];return _0x51be91;};'use strict';var EventEmitter=require(_0x472e('0x0'));var MailAccount=require(_0x472e('0x1'))['db'][_0x472e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x472e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x472e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cbb43){return function(_0x36162d,_0x53f7c1,_0x122fa5){MailAccountEvents[_0x472e('0x5')](_0x4cbb43+':'+_0x36162d['id'],_0x36162d);MailAccountEvents[_0x472e('0x5')](_0x4cbb43,_0x36162d);_0x122fa5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x472e('0x6')](e,emitEvent(event));}}module[_0x472e('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 fbf2f59..8a93fad 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 _0x2c44=['port','secure','modernAuthentication','CloudProvider','auth','user','data5','pass','define','MailAccount','provider','custom','service','host','Smtp'];(function(_0xf2ee83,_0x24c2c4){var _0x3263b7=function(_0x239eaf){while(--_0x239eaf){_0xf2ee83['push'](_0xf2ee83['shift']());}};_0x3263b7(++_0x24c2c4);}(_0x2c44,0xf8));var _0x42c4=function(_0x46eb62,_0x57f1a3){_0x46eb62=_0x46eb62-0x0;var _0x4446aa=_0x2c44[_0x46eb62];return _0x4446aa;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x353287){return _0x353287[_0x42c4('0x0')](_0x42c4('0x1'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x29c17b=this;var _0x85b88a={'id':_0x29c17b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x29c17b[_0x42c4('0x2')]!==_0x42c4('0x3')){_0x85b88a[_0x42c4('0x4')]=_0x29c17b[_0x42c4('0x2')];}else{_0x85b88a[_0x42c4('0x5')]=_0x29c17b[_0x42c4('0x6')][_0x42c4('0x5')];_0x85b88a['port']=_0x29c17b['Smtp'][_0x42c4('0x7')];_0x85b88a[_0x42c4('0x8')]=_0x29c17b[_0x42c4('0x6')][_0x42c4('0x8')];}if(_0x29c17b[_0x42c4('0x6')]['authentication']){if(_0x29c17b[_0x42c4('0x6')][_0x42c4('0x9')]){if(!_0x29c17b[_0x42c4('0x6')][_0x42c4('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x85b88a[_0x42c4('0xb')]={'type':'OAuth2','user':_0x29c17b[_0x42c4('0x6')][_0x42c4('0xc')],'accessToken':_0x29c17b[_0x42c4('0x6')][_0x42c4('0xa')][_0x42c4('0xd')]};}else{_0x85b88a[_0x42c4('0xb')]={'user':_0x29c17b['Smtp'][_0x42c4('0xc')],'pass':_0x29c17b[_0x42c4('0x6')][_0x42c4('0xe')]};}}return _0x85b88a;}}});}; \ No newline at end of file +var _0x655f=['user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x655f,0x145));var _0xf655=function(_0x12ec39,_0x2cd90e){_0x12ec39=_0x12ec39-0x0;var _0x54c1ef=_0x655f[_0x12ec39];return _0x54c1ef;};'use strict';var attributes=require(_0xf655('0x0'));module[_0xf655('0x1')]=function(_0x3997a9){return _0x3997a9[_0xf655('0x2')](_0xf655('0x3'),attributes,{'tableName':_0xf655('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x41a775=this;var _0x458d4a={'id':_0x41a775['id'],'tls':{'rejectUnauthorized':![]}};if(_0x41a775[_0xf655('0x5')]!==_0xf655('0x6')){_0x458d4a['service']=_0x41a775[_0xf655('0x5')];}else{_0x458d4a[_0xf655('0x7')]=_0x41a775[_0xf655('0x8')]['host'];_0x458d4a['port']=_0x41a775[_0xf655('0x8')][_0xf655('0x9')];_0x458d4a[_0xf655('0xa')]=_0x41a775['Smtp'][_0xf655('0xa')];}if(_0x41a775['Smtp'][_0xf655('0xb')]){if(_0x41a775[_0xf655('0x8')][_0xf655('0xc')]){if(!_0x41a775[_0xf655('0x8')][_0xf655('0xd')])throw new Error(_0xf655('0xe'));_0x458d4a[_0xf655('0xf')]={'type':_0xf655('0x10'),'user':_0x41a775[_0xf655('0x8')][_0xf655('0x11')],'accessToken':_0x41a775['Smtp'][_0xf655('0xd')]['data5']};}else{_0x458d4a['auth']={'user':_0x41a775[_0xf655('0x8')][_0xf655('0x11')],'pass':_0x41a775[_0xf655('0x8')][_0xf655('0x12')]};}}return _0x458d4a;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4231d22..f33accb 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 _0x6d38=['result','catch','findAll','options','raw','attributes','limit','map','include','model','then','GetMailAccount','debug','ShowMailAccount','find','smtp','setDataValue','smtpOptions','body','mail','difference','rawAttributes','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','get','account','omit','getSmtpOptions','list','applications','orderBy','autoclose','push','length','close','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','contact','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var moment=require(_0x86d3('0x0'));var BPromise=require(_0x86d3('0x1'));var rs=require(_0x86d3('0x2'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x86d3('0x3'))('rpc');var config=require(_0x86d3('0x4'));var jayson=require(_0x86d3('0x5'));var client=jayson[_0x86d3('0x6')]['http']({'port':0x232c});config[_0x86d3('0x7')]=_[_0x86d3('0x8')](config[_0x86d3('0x7')],{'host':_0x86d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x86d3('0xa'))[_0x86d3('0xb')](socket);function respondWithRpcPromise(_0xf273f5,_0x499640,_0x4a277e){return new BPromise(function(_0x3ed317,_0x555e6d){return client['request'](_0xf273f5,_0x4a277e)['then'](function(_0x4300e2){logger[_0x86d3('0xc')]('MailAccount,\x20%s,\x20%s',_0x499640,_0x86d3('0xd'));logger['debug'](_0x86d3('0xe'),_0x499640,_0x86d3('0xd'),JSON[_0x86d3('0xf')](_0x4300e2));if(_0x4300e2[_0x86d3('0x10')]){if(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x11')]===0x1f4){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2['error'][_0x86d3('0x13')]);return _0x555e6d(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);}logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);return _0x3ed317(_0x4300e2[_0x86d3('0x10')]['message']);}else{logger[_0x86d3('0xc')](_0x86d3('0x12'),_0x499640,_0x86d3('0xd'));_0x3ed317(_0x4300e2[_0x86d3('0x14')][_0x86d3('0x13')]);}})[_0x86d3('0x15')](function(_0x33e459){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x33e459);_0x555e6d(_0x33e459);});});}exports['GetMailAccount']=function(_0x191ba5){var _0x57c340=this;return new Promise(function(_0x6ced9e,_0x5c4d55){return db['MailAccount'][_0x86d3('0x16')]({'raw':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x18')]===undefined?!![]:![]:!![],'where':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')]['where']||null:null,'attributes':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'limit':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x1a')]||null:null,'include':_0x191ba5[_0x86d3('0x17')]?_0x191ba5['options']['include']?_[_0x86d3('0x1b')](_0x191ba5['options'][_0x86d3('0x1c')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x1d')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x19')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x1c')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x19')],'include':_0x611764['include']?_[_0x86d3('0x1b')](_0x611764[_0x86d3('0x1c')],function(_0x287b96){return{'model':db[_0x287b96[_0x86d3('0x1d')]],'as':_0x287b96['as'],'attributes':_0x287b96[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x1f203e){logger[_0x86d3('0xc')](_0x86d3('0x1f'),_0x191ba5);logger[_0x86d3('0x20')](_0x86d3('0x1f'),_0x191ba5,JSON[_0x86d3('0xf')](_0x1f203e));_0x6ced9e(_0x1f203e);})[_0x86d3('0x15')](function(_0x28c25e){logger['error'](_0x86d3('0x1f'),_0x28c25e[_0x86d3('0x13')],_0x191ba5);_0x5c4d55(_0x57c340[_0x86d3('0x10')](0x1f4,_0x28c25e[_0x86d3('0x13')]));});});};exports[_0x86d3('0x21')]=function(_0x245e39){var _0x4a5ff0=this;return new Promise(function(_0xba2f49,_0x5c71df){return db['MailAccount'][_0x86d3('0x22')]({'raw':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['where']||null:null,'attributes':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'include':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x245e39[_0x86d3('0x17')]['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x19')],'include':_0x4cdf45['include']?_[_0x86d3('0x1b')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x1d')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x19')],'include':_0x366943[_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x366943[_0x86d3('0x1c')],function(_0x2d15b9){return{'model':db[_0x2d15b9['model']],'as':_0x2d15b9['as'],'attributes':_0x2d15b9[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x5e2519){if(_0x245e39[_0x86d3('0x17')][_0x86d3('0x23')]===!![])_0x5e2519[_0x86d3('0x24')](_0x86d3('0x25'),_0x5e2519['getSmtpOptions']());logger[_0x86d3('0xc')](_0x86d3('0x21'),_0x245e39);logger[_0x86d3('0x20')]('ShowMailAccount',_0x245e39,JSON[_0x86d3('0xf')](_0x5e2519));_0xba2f49(_0x5e2519);})[_0x86d3('0x15')](function(_0x1a1c06){logger[_0x86d3('0x10')](_0x86d3('0x21'),_0x1a1c06[_0x86d3('0x13')],_0x245e39);_0x5c71df(_0x4a5ff0[_0x86d3('0x10')](0x1f4,_0x1a1c06[_0x86d3('0x13')]));});});};exports['NotifyMailAccount']=function(_0x22bc98){var _0x470978=this;return new Promise(function(_0x2bdc67,_0x461052){var _0x5ebb4d={'body':_0x22bc98[_0x86d3('0x26')],'channel':_0x86d3('0x27')};var _0x6f72be=_[_0x86d3('0x28')](_['keys'](db['CmContact'][_0x86d3('0x29')]),['createdAt','updatedAt',_0x86d3('0x2a'),_0x86d3('0x2b')]);var _0x43490a=![];if(_0x22bc98[_0x86d3('0x26')]['id']){delete _0x22bc98[_0x86d3('0x26')]['id'];}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x86d3('0x2d')](_0x22bc98[_0x86d3('0x26')]['body'])||_0x22bc98[_0x86d3('0x26')][_0x86d3('0x26')]===''){return _0x461052(_0x470978['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x2f')+_0x6f72be));}if(!_[_0x86d3('0x30')](_0x6f72be,_0x22bc98[_0x86d3('0x26')]['mapKey'])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x31')+_0x6f72be));}var _0x5d9dad={};_0x5d9dad[_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')]]=_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')];return db[_0x86d3('0x32')][_0x86d3('0x22')]({'where':{'id':_0x22bc98['account']['id']},'include':[{'model':db[_0x86d3('0x33')],'as':_0x86d3('0x34'),'include':[{'model':db['CmContact'],'as':_0x86d3('0x35'),'where':_0x5d9dad,'limit':0x1,'order':[[_0x86d3('0x36'),_0x86d3('0x37')]]}]},{'model':db[_0x86d3('0x38')],'as':_0x86d3('0x39')},{'model':db['MailServerOut'],'as':_0x86d3('0x3a'),'include':[{'model':db[_0x86d3('0x3b')],'as':_0x86d3('0x3b')}]}]})[_0x86d3('0x1e')](function(_0x369b75){if(_0x369b75&&_0x369b75[_0x86d3('0x34')]){var _0x1a4345=_0x369b75[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x1a4345,[_0x86d3('0x39'),_0x86d3('0x34')]);_0x5ebb4d['account'][_0x86d3('0x25')]=_0x369b75[_0x86d3('0x3f')]();_0x5ebb4d['applications']=_0x1a4345[_0x86d3('0x39')];_0x5ebb4d[_0x86d3('0x40')]=_0x1a4345[_0x86d3('0x34')];_0x5ebb4d[_0x86d3('0x41')]=_[_0x86d3('0x42')](_0x5ebb4d[_0x86d3('0x41')],['priority'],['asc']);if(_0x5ebb4d['account']&&_0x5ebb4d['account'][_0x86d3('0x43')]){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x44')]({'id':0x0,'priority':_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x45')]+0x1,'app':_0x86d3('0x46'),'appdata':_0x86d3('0x43'),'interval':'*,*,*,*'});}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')]){delete _0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')];}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x34')]){delete _0x5ebb4d[_0x86d3('0x3d')]['List'];}if(_0x1a4345[_0x86d3('0x34')]['Contacts'][_0x86d3('0x45')]){return _0x1a4345[_0x86d3('0x34')][_0x86d3('0x35')][0x0];}var _0x3ffd22=_[_0x86d3('0x8')](_0x22bc98['body'],{'firstName':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')],'ListId':_0x1a4345[_0x86d3('0x2b')]});_0x3ffd22[_0x22bc98['body']['mapKey']]=_0x22bc98['body'][_0x86d3('0x2c')];return db['CmContact'][_0x86d3('0x47')](_0x3ffd22);}else{throw new Error(_0x86d3('0x48'));}})[_0x86d3('0x1e')](function(_0x319ea0){_0x5ebb4d['contact']=_0x319ea0;if(_0x319ea0){if(!_0x22bc98['body']['message'][_0x86d3('0x49')]){_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')]=rs[_0x86d3('0x4a')]()+'\x20'+_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')];}var _0x5123fd={'ContactId':_0x319ea0['id'],'MailAccountId':_0x22bc98[_0x86d3('0x3d')]['id'],'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98['body'][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98['body'][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4c')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x86d3('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x22bc98['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x86d3('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x4f')]}}]})[_0x86d3('0x1e')](function(_0xa48003){if(_0xa48003){return[_0xa48003,![]];}return db['MailInteraction']['create'](_0x5123fd)[_0x86d3('0x1e')](function(_0xf2c179){return[_0xf2c179,!![]];});});}else{throw new Error(_0x86d3('0x50'));}})[_0x86d3('0x51')](function(_0x22d8eb,_0x1952af){if(_0x22d8eb){_0x43490a=_0x1952af;if(!_0x1952af){return _0x22d8eb[_0x86d3('0x52')]({'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22d8eb['attach']?_0x22d8eb[_0x86d3('0x4c')]:_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgDirection':'in'});}else{return _0x22d8eb;}}})['then'](function(_0x41d448){_0x5ebb4d['interaction']=_0x41d448[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x55')][_0x86d3('0x56')]=_0x43490a;return db[_0x86d3('0x57')][_0x86d3('0x47')]({'body':_0x22bc98['body'][_0x86d3('0x26')],'MailAccountId':_0x22bc98['account']['id'],'MailInteractionId':_0x41d448['id'],'direction':'in','ContactId':_0x5ebb4d[_0x86d3('0x58')]['id'],'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')],'from':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['to'],'cc':_0x22bc98[_0x86d3('0x26')]['message']['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'Attachments':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attachments'],'originTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x59')],'originCc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5a')],'bcc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5b')],'ChatWebsiteId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5c')]||null,'originChannel':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['originChannel']||_0x86d3('0x5d'),'ChatOfflineMessageId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x86d3('0x5f')}]});})[_0x86d3('0x1e')](function(_0x1a97f3){_0x5ebb4d[_0x86d3('0x13')]=_0x1a97f3;if(_0x5ebb4d['interaction']['UserId']){return db[_0x86d3('0x60')]['find']({'attributes':['id',_0x86d3('0x61')],'where':{'id':_0x5ebb4d['interaction']['UserId']}})[_0x86d3('0x1e')](function(_0x28bd40){if(_0x28bd40){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x62')]({'id':0x0,'priority':0x0,'app':_0x86d3('0x63'),'appdata':_0x28bd40['name']+','+(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x86d3('0x65'),_0x86d3('0x66'),_0x5ebb4d);});}return respondWithRpcPromise('Start',_0x86d3('0x66'),_0x5ebb4d);})['then'](function(_0x1867fc){_0x2bdc67(_0x1867fc);})['catch'](function(_0x5bb2e5){_0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x5bb2e5['message']));});});}; \ No newline at end of file +var _0x4975=['MailMessage','Messages','create','Contact\x20not\x20found','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','UserId','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','list','applications','orderBy','priority','asc','push','close','autoclose','*,*,*,*','length','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4975,0x86));var _0x5497=function(_0x431c0f,_0x178ffa){_0x431c0f=_0x431c0f-0x0;var _0x2159b9=_0x4975[_0x431c0f];return _0x2159b9;};'use strict';var _=require(_0x5497('0x0'));var moment=require('moment');var BPromise=require(_0x5497('0x1'));var rs=require(_0x5497('0x2'));var Redis=require(_0x5497('0x3'));var db=require(_0x5497('0x4'))['db'];var logger=require(_0x5497('0x5'))(_0x5497('0x6'));var config=require(_0x5497('0x7'));var jayson=require(_0x5497('0x8'));var client=jayson[_0x5497('0x9')][_0x5497('0xa')]({'port':0x232c});config['redis']=_[_0x5497('0xb')](config['redis'],{'host':_0x5497('0xc'),'port':0x18eb});var socket=require(_0x5497('0xd'))(new Redis(config[_0x5497('0xe')]));require('./mailAccount.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x49d94b,_0x1f63d8,_0x29c93f){return new BPromise(function(_0x2ec5a4,_0x32a8a2){return client[_0x5497('0x10')](_0x49d94b,_0x29c93f)[_0x5497('0x11')](function(_0x3e7886){logger[_0x5497('0x12')]('MailAccount,\x20%s,\x20%s',_0x1f63d8,'request\x20sent');logger['debug'](_0x5497('0x13'),_0x1f63d8,_0x5497('0x14'),JSON[_0x5497('0x15')](_0x3e7886));if(_0x3e7886[_0x5497('0x16')]){if(_0x3e7886[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x32a8a2(_0x3e7886['error'][_0x5497('0x19')]);}logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x2ec5a4(_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);}else{logger[_0x5497('0x12')](_0x5497('0x18'),_0x1f63d8,'request\x20sent');_0x2ec5a4(_0x3e7886['result'][_0x5497('0x19')]);}})[_0x5497('0x1a')](function(_0x3a47fd){logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3a47fd);_0x32a8a2(_0x3a47fd);});});}exports[_0x5497('0x1b')]=function(_0x18e8a8){var _0x43da2c=this;return new Promise(function(_0x1b1b43,_0x1f6f18){return db[_0x5497('0x1c')][_0x5497('0x1d')]({'raw':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x18e8a8['options']?_0x18e8a8[_0x5497('0x1e')]['where']||null:null,'attributes':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'limit':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x21')]||null:null,'include':_0x18e8a8['options']?_0x18e8a8['options'][_0x5497('0x22')]?_[_0x5497('0x23')](_0x18e8a8[_0x5497('0x1e')][_0x5497('0x22')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x24')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x22')]?_[_0x5497('0x23')](_0x5223b5[_0x5497('0x22')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x24')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x20')],'include':_0x34a1a5['include']?_[_0x5497('0x23')](_0x34a1a5['include'],function(_0x583d06){return{'model':db[_0x583d06['model']],'as':_0x583d06['as'],'attributes':_0x583d06[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9356){logger[_0x5497('0x12')](_0x5497('0x1b'),_0x18e8a8);logger[_0x5497('0x25')]('GetMailAccount',_0x18e8a8,JSON['stringify'](_0x5e9356));_0x1b1b43(_0x5e9356);})['catch'](function(_0x371874){logger[_0x5497('0x16')](_0x5497('0x1b'),_0x371874['message'],_0x18e8a8);_0x1f6f18(_0x43da2c['error'](0x1f4,_0x371874['message']));});});};exports[_0x5497('0x26')]=function(_0x572460){var _0x438ee4=this;return new Promise(function(_0x258c2d,_0x77c575){return db['MailAccount'][_0x5497('0x27')]({'raw':_0x572460[_0x5497('0x1e')]?_0x572460['options'][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['where']||null:null,'attributes':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'include':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['include']?_[_0x5497('0x23')](_0x572460[_0x5497('0x1e')]['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x24')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x20')],'include':_0x1ffc9b[_0x5497('0x22')]?_[_0x5497('0x23')](_0x1ffc9b[_0x5497('0x22')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x24')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes'],'include':_0x580e86[_0x5497('0x22')]?_[_0x5497('0x23')](_0x580e86[_0x5497('0x22')],function(_0x5ab18c){return{'model':db[_0x5ab18c['model']],'as':_0x5ab18c['as'],'attributes':_0x5ab18c[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5497('0x11')](function(_0x326d48){if(_0x572460[_0x5497('0x1e')][_0x5497('0x28')]===!![])_0x326d48[_0x5497('0x29')]('smtpOptions',_0x326d48[_0x5497('0x2a')]());logger[_0x5497('0x12')](_0x5497('0x26'),_0x572460);logger[_0x5497('0x25')](_0x5497('0x26'),_0x572460,JSON[_0x5497('0x15')](_0x326d48));_0x258c2d(_0x326d48);})[_0x5497('0x1a')](function(_0x179635){logger[_0x5497('0x16')]('ShowMailAccount',_0x179635[_0x5497('0x19')],_0x572460);_0x77c575(_0x438ee4[_0x5497('0x16')](0x1f4,_0x179635[_0x5497('0x19')]));});});};exports[_0x5497('0x2b')]=function(_0x15029d){var _0xa5ebe6=this;return new Promise(function(_0x4299be,_0x59ed13){var _0x3e5f7d={'body':_0x15029d[_0x5497('0x2c')],'channel':_0x5497('0x2d')};var _0x35993c=_[_0x5497('0x2e')](_[_0x5497('0x2f')](db[_0x5497('0x30')]['rawAttributes']),[_0x5497('0x31'),_0x5497('0x32'),_0x5497('0x33'),_0x5497('0x34')]);var _0x20e947=![];if(_0x15029d[_0x5497('0x2c')]['id']){delete _0x15029d[_0x5497('0x2c')]['id'];}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')][_0x5497('0x36')])){return _0x59ed13(_0xa5ebe6['error'](0x1f4,_0x5497('0x37')));}if(_['isNil'](_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')])||_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')]===''){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')]['mapKey'])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35993c));}if(!_[_0x5497('0x38')](_0x35993c,_0x15029d['body'][_0x5497('0x39')])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,_0x5497('0x3a')+_0x35993c));}var _0x3a852a={};_0x3a852a[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body']['from'];return db['MailAccount'][_0x5497('0x27')]({'where':{'id':_0x15029d[_0x5497('0x3b')]['id']},'include':[{'model':db[_0x5497('0x3c')],'as':_0x5497('0x3d'),'include':[{'model':db[_0x5497('0x30')],'as':_0x5497('0x3e'),'where':_0x3a852a,'limit':0x1,'order':[[_0x5497('0x32'),_0x5497('0x3f')]]}]},{'model':db[_0x5497('0x40')],'as':'Applications'},{'model':db[_0x5497('0x41')],'as':_0x5497('0x42'),'include':[{'model':db[_0x5497('0x43')],'as':'CloudProvider'}]}]})[_0x5497('0x11')](function(_0x530475){if(_0x530475&&_0x530475[_0x5497('0x3d')]){var _0x31f1ba=_0x530475[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d['account']=_[_0x5497('0x45')](_0x31f1ba,[_0x5497('0x46'),'List']);_0x3e5f7d[_0x5497('0x3b')]['smtpOptions']=_0x530475[_0x5497('0x2a')]();_0x3e5f7d['applications']=_0x31f1ba[_0x5497('0x46')];_0x3e5f7d[_0x5497('0x47')]=_0x31f1ba[_0x5497('0x3d')];_0x3e5f7d[_0x5497('0x48')]=_[_0x5497('0x49')](_0x3e5f7d[_0x5497('0x48')],[_0x5497('0x4a')],[_0x5497('0x4b')]);if(_0x3e5f7d['account']&&_0x3e5f7d[_0x5497('0x3b')]['autoclose']){_0x3e5f7d['applications'][_0x5497('0x4c')]({'id':0x0,'priority':_0x3e5f7d[_0x5497('0x48')]['length']+0x1,'app':_0x5497('0x4d'),'appdata':_0x5497('0x4e'),'interval':_0x5497('0x4f')});}if(_0x3e5f7d[_0x5497('0x3b')]['Applications']){delete _0x3e5f7d[_0x5497('0x3b')]['Applications'];}if(_0x3e5f7d['account'][_0x5497('0x3d')]){delete _0x3e5f7d[_0x5497('0x3b')][_0x5497('0x3d')];}if(_0x31f1ba['List']['Contacts'][_0x5497('0x50')]){return _0x31f1ba['List'][_0x5497('0x3e')][0x0];}var _0x530431=_[_0x5497('0xb')](_0x15029d['body'],{'firstName':_0x15029d[_0x5497('0x2c')][_0x5497('0x36')],'ListId':_0x31f1ba['ListId']});_0x530431[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body'][_0x5497('0x36')];return db[_0x5497('0x30')]['create'](_0x530431);}else{throw new Error(_0x5497('0x51'));}})[_0x5497('0x11')](function(_0x1dbab2){_0x3e5f7d[_0x5497('0x52')]=_0x1dbab2;if(_0x1dbab2){if(!_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId']){_0x15029d[_0x5497('0x2c')]['message']['messageId']=rs['generate']()+'\x20'+_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')];}var _0x544085={'ContactId':_0x1dbab2['id'],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'inReplyTo':_0x15029d['body']['message'][_0x5497('0x53')],'to':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['attach'],'lastMsgAt':moment()[_0x5497('0x55')](_0x5497('0x56')),'lastMsgDirection':'in'};return db[_0x5497('0x57')][_0x5497('0x27')]({'where':{'closed':![],'MailAccountId':_0x15029d['account']['id']},'include':[{'model':db[_0x5497('0x58')],'as':_0x5497('0x59'),'attributes':[_0x5497('0x53')],'where':{'messageId':_0x15029d['body'][_0x5497('0x19')]['inReplyTo']}}]})['then'](function(_0x53e050){if(_0x53e050){return[_0x53e050,![]];}return db[_0x5497('0x57')][_0x5497('0x5a')](_0x544085)[_0x5497('0x11')](function(_0x4e7d4c){return[_0x4e7d4c,!![]];});});}else{throw new Error(_0x5497('0x5b'));}})[_0x5497('0x5c')](function(_0x3cfebc,_0x35e75a){if(_0x3cfebc){_0x20e947=_0x35e75a;if(!_0x35e75a){return _0x3cfebc['update']({'inReplyTo':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x53')],'to':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x3cfebc['attach']?_0x3cfebc[_0x5497('0x5d')]:_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x5497('0x56')),'lastMsgDirection':'in'});}else{return _0x3cfebc;}}})[_0x5497('0x11')](function(_0x179bbc){_0x3e5f7d['interaction']=_0x179bbc[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x5f')]=_0x20e947;return db[_0x5497('0x58')][_0x5497('0x5a')]({'body':_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'MailInteractionId':_0x179bbc['id'],'direction':'in','ContactId':_0x3e5f7d[_0x5497('0x52')]['id'],'messageId':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId'],'from':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'to':_0x15029d['body'][_0x5497('0x19')]['to'],'cc':_0x15029d['body'][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'Attachments':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x60')],'originTo':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x61')],'originCc':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x62')],'bcc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['bcc'],'ChatWebsiteId':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x63')]||null,'originChannel':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x64')]||_0x5497('0x65'),'ChatOfflineMessageId':_0x15029d[_0x5497('0x2c')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5497('0x66')],'as':_0x5497('0x67')}]});})['then'](function(_0x15ca59){_0x3e5f7d[_0x5497('0x19')]=_0x15ca59;if(_0x3e5f7d[_0x5497('0x5e')]['UserId']){return db[_0x5497('0x68')][_0x5497('0x27')]({'attributes':['id','name'],'where':{'id':_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x69')]}})[_0x5497('0x11')](function(_0x42d745){if(_0x42d745){_0x3e5f7d[_0x5497('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5497('0x6a'),'appdata':_0x42d745[_0x5497('0x6b')]+','+(_0x3e5f7d[_0x5497('0x3b')][_0x5497('0x6c')]||0xa),'interval':_0x5497('0x4f')});}return respondWithRpcPromise('Start',_0x5497('0x6d'),_0x3e5f7d);});}return respondWithRpcPromise(_0x5497('0x6e'),_0x5497('0x6d'),_0x3e5f7d);})[_0x5497('0x11')](function(_0x521d74){_0x4299be(_0x521d74);})[_0x5497('0x1a')](function(_0x21fc4e){_0x59ed13(_0xa5ebe6['error'](0x1f4,_0x21fc4e[_0x5497('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 5452108..6372371 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 _0x57e6=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x4b6f81,_0x57fd87){var _0x2de203=function(_0x1162bb){while(--_0x1162bb){_0x4b6f81['push'](_0x4b6f81['shift']());}};_0x2de203(++_0x57fd87);}(_0x57e6,0x177));var _0x657e=function(_0xa8f24a,_0x48d7d3){_0xa8f24a=_0xa8f24a-0x0;var _0x3a1471=_0x57e6[_0xa8f24a];return _0x3a1471;};'use strict';var MailAccountEvents=require(_0x657e('0x0'));var events=[_0x657e('0x1'),_0x657e('0x2'),_0x657e('0x3')];function createListener(_0x520ec0,_0x7980e0){return function(_0x48a582){_0x7980e0[_0x657e('0x4')](_0x520ec0,_0x48a582);};}function removeListener(_0x773dd8,_0x3324d3){return function(){MailAccountEvents[_0x657e('0x5')](_0x773dd8,_0x3324d3);};}exports[_0x657e('0x6')]=function(_0x24708a){for(var _0x3521b1=0x0,_0x4358f1=events[_0x657e('0x7')];_0x3521b1<_0x4358f1;_0x3521b1++){var _0x440667=events[_0x3521b1];var _0x12807d=createListener(_0x657e('0x8')+_0x440667,_0x24708a);MailAccountEvents['on'](_0x440667,_0x12807d);}}; \ No newline at end of file +var _0xc20c=['remove','update','emit','register','mailAccount:','./mailAccount.events','save'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xc20c,0x139));var _0xcc20=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xc20c[_0x1c8c28];return _0x1f59b4;};'use strict';var MailAccountEvents=require(_0xcc20('0x0'));var events=[_0xcc20('0x1'),_0xcc20('0x2'),_0xcc20('0x3')];function createListener(_0x30b575,_0x8a0730){return function(_0x49da73){_0x8a0730[_0xcc20('0x4')](_0x30b575,_0x49da73);};}function removeListener(_0x51bf62,_0x117eb9){return function(){MailAccountEvents['removeListener'](_0x51bf62,_0x117eb9);};}exports[_0xcc20('0x5')]=function(_0x2f557b){for(var _0x43ddaf=0x0,_0x351d29=events['length'];_0x43ddaf<_0x351d29;_0x43ddaf++){var _0x3a9977=events[_0x43ddaf];var _0x3e78fa=createListener(_0xcc20('0x6')+_0x3a9977,_0x2f557b);MailAccountEvents['on'](_0x3a9977,_0x3e78fa);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index bd7a8b8..1eb52ac 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 _0x5931=['get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','../../components/auth/service','../../config/environment','./mailApplication.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5931,0x158));var _0x1593=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x5931[_0x35da42];return _0x370035;};'use strict';var multer=require(_0x1593('0x0'));var util=require(_0x1593('0x1'));var path=require(_0x1593('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1593('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1593('0x4'));var controller=require(_0x1593('0x5'));router[_0x1593('0x6')](_0x1593('0x7'),auth[_0x1593('0x8')](),controller[_0x1593('0x9')]);router[_0x1593('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1593('0xb')]);router[_0x1593('0xc')](_0x1593('0x7'),auth[_0x1593('0x8')](),controller[_0x1593('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd032=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','show','/:id','isAuthenticated','delete','destroy','exports','multer'];(function(_0x2740b1,_0x333eb8){var _0x116b49=function(_0x2c1c47){while(--_0x2c1c47){_0x2740b1['push'](_0x2740b1['shift']());}};_0x116b49(++_0x333eb8);}(_0xd032,0x13f));var _0x2d03=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xd032[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x2d03('0x0'));var util=require('util');var path=require(_0x2d03('0x1'));var timeout=require(_0x2d03('0x2'));var express=require(_0x2d03('0x3'));var router=express[_0x2d03('0x4')]();var fs_extra=require(_0x2d03('0x5'));var auth=require(_0x2d03('0x6'));var interaction=require(_0x2d03('0x7'));var config=require(_0x2d03('0x8'));var controller=require(_0x2d03('0x9'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x2d03('0xa')]);router['put'](_0x2d03('0xb'),auth[_0x2d03('0xc')](),controller['update']);router[_0x2d03('0xd')](_0x2d03('0xb'),auth[_0x2d03('0xc')](),controller[_0x2d03('0xe')]);module[_0x2d03('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index f48cf9e..2cb889a 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 _0xbfac=['TEXT','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x5cf09e,_0x266304){var _0x8d326e=function(_0x1eb3bd){while(--_0x1eb3bd){_0x5cf09e['push'](_0x5cf09e['shift']());}};_0x8d326e(++_0x266304);}(_0xbfac,0x122));var _0xcbfa=function(_0x4aabc6,_0x348818){_0x4aabc6=_0x4aabc6-0x0;var _0xf26471=_0xbfac[_0x4aabc6];return _0xf26471;};'use strict';var Sequelize=require(_0xcbfa('0x0'));module[_0xcbfa('0x1')]={'priority':{'type':Sequelize[_0xcbfa('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcbfa('0x3')},'appdata':{'type':Sequelize[_0xcbfa('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcbfa('0x5')}}; \ No newline at end of file +var _0x1c43=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x48f62f,_0x585cf7){var _0x158dfb=function(_0x2df350){while(--_0x2df350){_0x48f62f['push'](_0x48f62f['shift']());}};_0x158dfb(++_0x585cf7);}(_0x1c43,0x75));var _0x31c4=function(_0x44c285,_0x3ff073){_0x44c285=_0x44c285-0x0;var _0x39eb02=_0x1c43[_0x44c285];return _0x39eb02;};'use strict';var Sequelize=require(_0x31c4('0x0'));module[_0x31c4('0x1')]={'priority':{'type':Sequelize[_0x31c4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x31c4('0x3')],'allowNull':![],'defaultValue':_0x31c4('0x4')},'appdata':{'type':Sequelize[_0x31c4('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x31c4('0x3')],'defaultValue':_0x31c4('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a2364ab..92271f4 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x24c9d0,_0x4967b6){var _0x58c87f=function(_0x380793){while(--_0x380793){_0x24c9d0['push'](_0x24c9d0['shift']());}};_0x58c87f(++_0x4967b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x327d2d,_0x1bb4fd){var _0x93d154=function(_0xefcbb0){while(--_0xefcbb0){_0x327d2d['push'](_0x327d2d['shift']());}};_0x93d154(++_0x1bb4fd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 928265b..bfd0888 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 _0x33c5=['./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x33c5,0x141));var _0x533c=function(_0x282999,_0x4df660){_0x282999=_0x282999-0x0;var _0x30681f=_0x33c5[_0x282999];return _0x30681f;};'use strict';var _=require(_0x533c('0x0'));var util=require(_0x533c('0x1'));var logger=require(_0x533c('0x2'))(_0x533c('0x3'));var moment=require(_0x533c('0x4'));var BPromise=require(_0x533c('0x5'));var rp=require(_0x533c('0x6'));var fs=require('fs');var path=require(_0x533c('0x7'));var rimraf=require(_0x533c('0x8'));var config=require('../../config/environment');var attributes=require(_0x533c('0x9'));module[_0x533c('0xa')]=function(_0x2b366d,_0x4eab4e){return _0x2b366d[_0x533c('0xb')](_0x533c('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x533c('0xd'),'collate':_0x533c('0xe')});}; \ No newline at end of file +var _0xbb1a=['bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x4d156c,_0x20a98d){var _0xb67db4=function(_0x1bc072){while(--_0x1bc072){_0x4d156c['push'](_0x4d156c['shift']());}};_0xb67db4(++_0x20a98d);}(_0xbb1a,0x182));var _0xabb1=function(_0x107762,_0x1f8cda){_0x107762=_0x107762-0x0;var _0x1691a1=_0xbb1a[_0x107762];return _0x1691a1;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var logger=require(_0xabb1('0x2'))('api');var moment=require(_0xabb1('0x3'));var BPromise=require(_0xabb1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xabb1('0x5'));var config=require(_0xabb1('0x6'));var attributes=require(_0xabb1('0x7'));module[_0xabb1('0x8')]=function(_0x1f3906,_0x498e57){return _0x1f3906[_0xabb1('0x9')]('MailApplication',attributes,{'tableName':_0xabb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabb1('0xb'),'collate':_0xabb1('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 57012be..c449fcb 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 _0xf019=['jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailApplication','body','options','raw','where','attributes','limit','then','catch','UpdateMailApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf019,0x1f4));var _0x9f01=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf019[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x9f01('0x0'));var moment=require(_0x9f01('0x1'));var BPromise=require(_0x9f01('0x2'));var rs=require(_0x9f01('0x3'));var fs=require('fs');var Redis=require(_0x9f01('0x4'));var db=require(_0x9f01('0x5'))['db'];var utils=require(_0x9f01('0x6'));var logger=require(_0x9f01('0x7'))(_0x9f01('0x8'));var config=require(_0x9f01('0x9'));var jayson=require(_0x9f01('0xa'));var client=jayson[_0x9f01('0xb')][_0x9f01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c79d4,_0x3157fa,_0x39bec9){return new BPromise(function(_0x2baff5,_0x4248af){return client[_0x9f01('0xd')](_0x2c79d4,_0x39bec9)['then'](function(_0x343337){logger[_0x9f01('0xe')](_0x9f01('0xf'),_0x3157fa,_0x9f01('0x10'));logger[_0x9f01('0x11')](_0x9f01('0x12'),_0x3157fa,'request\x20sent',JSON[_0x9f01('0x13')](_0x343337));if(_0x343337['error']){if(_0x343337[_0x9f01('0x14')][_0x9f01('0x15')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x3157fa,_0x343337[_0x9f01('0x14')][_0x9f01('0x16')]);return _0x4248af(_0x343337['error'][_0x9f01('0x16')]);}logger[_0x9f01('0x14')](_0x9f01('0xf'),_0x3157fa,_0x343337[_0x9f01('0x14')][_0x9f01('0x16')]);return _0x2baff5(_0x343337[_0x9f01('0x14')][_0x9f01('0x16')]);}else{logger[_0x9f01('0xe')](_0x9f01('0xf'),_0x3157fa,_0x9f01('0x10'));_0x2baff5(_0x343337[_0x9f01('0x17')][_0x9f01('0x16')]);}})['catch'](function(_0x5c23e4){logger[_0x9f01('0x14')](_0x9f01('0xf'),_0x3157fa,_0x5c23e4);_0x4248af(_0x5c23e4);});});}exports['UpdateMailApplication']=function(_0x24721e){var _0x2981a4=this;return new Promise(function(_0x35b593,_0x58e951){return db[_0x9f01('0x18')]['update'](_0x24721e[_0x9f01('0x19')],{'raw':_0x24721e[_0x9f01('0x1a')]?_0x24721e[_0x9f01('0x1a')][_0x9f01('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24721e[_0x9f01('0x1a')]?_0x24721e['options'][_0x9f01('0x1c')]||null:null,'attributes':_0x24721e['options']?_0x24721e[_0x9f01('0x1a')][_0x9f01('0x1d')]||null:null,'limit':_0x24721e[_0x9f01('0x1a')]?_0x24721e[_0x9f01('0x1a')][_0x9f01('0x1e')]||null:null})[_0x9f01('0x1f')](function(_0x39516c){logger[_0x9f01('0xe')]('UpdateMailApplication',_0x24721e);logger[_0x9f01('0x11')]('UpdateMailApplication',_0x24721e,JSON['stringify'](_0x39516c));_0x35b593(_0x39516c);})[_0x9f01('0x20')](function(_0x3eccb2){logger[_0x9f01('0x14')](_0x9f01('0x21'),_0x3eccb2[_0x9f01('0x16')],_0x24721e);_0x58e951(_0x2981a4[_0x9f01('0x14')](0x1f4,_0x3eccb2[_0x9f01('0x16')]));});});}; \ No newline at end of file +var _0x6320=['MailApplication,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','where','attributes','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0x6320,0x6a));var _0x0632=function(_0x4b4d3c,_0x530823){_0x4b4d3c=_0x4b4d3c-0x0;var _0x45db11=_0x6320[_0x4b4d3c];return _0x45db11;};'use strict';var _=require(_0x0632('0x0'));var util=require(_0x0632('0x1'));var moment=require(_0x0632('0x2'));var BPromise=require(_0x0632('0x3'));var rs=require(_0x0632('0x4'));var fs=require('fs');var Redis=require(_0x0632('0x5'));var db=require(_0x0632('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0632('0x7'));var config=require(_0x0632('0x8'));var jayson=require(_0x0632('0x9'));var client=jayson[_0x0632('0xa')][_0x0632('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26fdd9,_0x1397c7,_0x36829e){return new BPromise(function(_0x288532,_0x384bdf){return client[_0x0632('0xc')](_0x26fdd9,_0x36829e)[_0x0632('0xd')](function(_0x4f40b7){logger['info'](_0x0632('0xe'),_0x1397c7,'request\x20sent');logger[_0x0632('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1397c7,_0x0632('0x10'),JSON['stringify'](_0x4f40b7));if(_0x4f40b7[_0x0632('0x11')]){if(_0x4f40b7[_0x0632('0x11')][_0x0632('0x12')]===0x1f4){logger[_0x0632('0x11')](_0x0632('0xe'),_0x1397c7,_0x4f40b7[_0x0632('0x11')][_0x0632('0x13')]);return _0x384bdf(_0x4f40b7[_0x0632('0x11')][_0x0632('0x13')]);}logger[_0x0632('0x11')](_0x0632('0xe'),_0x1397c7,_0x4f40b7[_0x0632('0x11')][_0x0632('0x13')]);return _0x288532(_0x4f40b7[_0x0632('0x11')][_0x0632('0x13')]);}else{logger['info'](_0x0632('0xe'),_0x1397c7,'request\x20sent');_0x288532(_0x4f40b7[_0x0632('0x14')][_0x0632('0x13')]);}})[_0x0632('0x15')](function(_0x2d03dc){logger[_0x0632('0x11')](_0x0632('0xe'),_0x1397c7,_0x2d03dc);_0x384bdf(_0x2d03dc);});});}exports[_0x0632('0x16')]=function(_0x310b17){var _0x31be5f=this;return new Promise(function(_0x4e68ef,_0x2f26b0){return db['MailApplication'][_0x0632('0x17')](_0x310b17[_0x0632('0x18')],{'raw':_0x310b17['options']?_0x310b17[_0x0632('0x19')][_0x0632('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310b17[_0x0632('0x19')]?_0x310b17[_0x0632('0x19')][_0x0632('0x1b')]||null:null,'attributes':_0x310b17[_0x0632('0x19')]?_0x310b17[_0x0632('0x19')][_0x0632('0x1c')]||null:null,'limit':_0x310b17[_0x0632('0x19')]?_0x310b17[_0x0632('0x19')]['limit']||null:null})[_0x0632('0xd')](function(_0x408f1a){logger[_0x0632('0x1d')]('UpdateMailApplication',_0x310b17);logger[_0x0632('0xf')](_0x0632('0x16'),_0x310b17,JSON['stringify'](_0x408f1a));_0x4e68ef(_0x408f1a);})[_0x0632('0x15')](function(_0xe5a7c0){logger['error'](_0x0632('0x16'),_0xe5a7c0[_0x0632('0x13')],_0x310b17);_0x2f26b0(_0x31be5f['error'](0x1f4,_0xe5a7c0[_0x0632('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 732782e..8c60b59 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 _0x25df=['destroy','exports','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','/:id','mailinteraction:update','delete','mailinteraction:destroy'];(function(_0x35e552,_0x107286){var _0x340707=function(_0x45d150){while(--_0x45d150){_0x35e552['push'](_0x35e552['shift']());}};_0x340707(++_0x107286);}(_0x25df,0x144));var _0xf25d=function(_0x52a1a9,_0x17632d){_0x52a1a9=_0x52a1a9-0x0;var _0x27fa73=_0x25df[_0x52a1a9];return _0x27fa73;};'use strict';var express=require(_0xf25d('0x0'));var router=express['Router']();var auth=require(_0xf25d('0x1'));var interaction=require(_0xf25d('0x2'));var controller=require('./mailInteraction.controller');router[_0xf25d('0x3')]('/',auth[_0xf25d('0x4')](),controller[_0xf25d('0x5')]);router[_0xf25d('0x3')](_0xf25d('0x6'),auth[_0xf25d('0x4')](),controller[_0xf25d('0x7')]);router[_0xf25d('0x3')]('/:id',auth[_0xf25d('0x4')](),controller[_0xf25d('0x8')]);router[_0xf25d('0x3')](_0xf25d('0x9'),auth[_0xf25d('0x4')](),controller[_0xf25d('0xa')]);router[_0xf25d('0x3')]('/:id/download',auth[_0xf25d('0x4')](),controller['download']);router[_0xf25d('0xb')]('/',auth[_0xf25d('0x4')](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xf25d('0xc')]);router[_0xf25d('0xb')](_0xf25d('0xd'),auth[_0xf25d('0x4')](),interaction[_0xf25d('0xe')](_0xf25d('0xf'),_0xf25d('0x10')),controller['addTags']);router['put'](_0xf25d('0x11'),auth['isAuthenticated'](),interaction['tracked']('mail',_0xf25d('0x12')),controller['update']);router[_0xf25d('0x13')](_0xf25d('0x11'),auth[_0xf25d('0x4')](),interaction[_0xf25d('0xe')](_0xf25d('0xf'),_0xf25d('0x14')),controller[_0xf25d('0x15')]);router[_0xf25d('0x13')](_0xf25d('0xd'),auth[_0xf25d('0x4')](),controller['removeTags']);module[_0xf25d('0x16')]=router; \ No newline at end of file +var _0x45a8=['express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports'];(function(_0x520d6d,_0x20ed47){var _0x17bd7b=function(_0x304c1a){while(--_0x304c1a){_0x520d6d['push'](_0x520d6d['shift']());}};_0x17bd7b(++_0x20ed47);}(_0x45a8,0x91));var _0x845a=function(_0x567380,_0x3c5b0b){_0x567380=_0x567380-0x0;var _0x4565a1=_0x45a8[_0x567380];return _0x4565a1;};'use strict';var express=require(_0x845a('0x0'));var router=express[_0x845a('0x1')]();var auth=require(_0x845a('0x2'));var interaction=require(_0x845a('0x3'));var controller=require(_0x845a('0x4'));router[_0x845a('0x5')]('/',auth[_0x845a('0x6')](),controller[_0x845a('0x7')]);router['get'](_0x845a('0x8'),auth['isAuthenticated'](),controller[_0x845a('0x9')]);router[_0x845a('0x5')](_0x845a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x845a('0x5')](_0x845a('0xb'),auth['isAuthenticated'](),controller[_0x845a('0xc')]);router[_0x845a('0x5')](_0x845a('0xd'),auth[_0x845a('0x6')](),controller[_0x845a('0xe')]);router[_0x845a('0xf')]('/',auth[_0x845a('0x6')](),controller[_0x845a('0x10')]);router[_0x845a('0xf')](_0x845a('0xb'),auth[_0x845a('0x6')](),controller['addMessage']);router['post'](_0x845a('0x11'),auth[_0x845a('0x6')](),interaction[_0x845a('0x12')](_0x845a('0x13'),'mailinteraction:addtags'),controller[_0x845a('0x14')]);router[_0x845a('0x15')](_0x845a('0xa'),auth[_0x845a('0x6')](),interaction[_0x845a('0x12')](_0x845a('0x13'),_0x845a('0x16')),controller[_0x845a('0x17')]);router[_0x845a('0x18')](_0x845a('0xa'),auth[_0x845a('0x6')](),interaction[_0x845a('0x12')](_0x845a('0x13'),_0x845a('0x19')),controller[_0x845a('0x1a')]);router[_0x845a('0x18')](_0x845a('0x11'),auth['isAuthenticated'](),controller[_0x845a('0x1b')]);module[_0x845a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 9974025..ee63e2d 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 _0x677f=['STRING','TEXT','long','ENUM','out','sequelize','iconv','BOOLEAN','DATE'];(function(_0x3d568b,_0x1430ae){var _0x194fed=function(_0x3849be){while(--_0x3849be){_0x3d568b['push'](_0x3d568b['shift']());}};_0x194fed(++_0x1430ae);}(_0x677f,0xf8));var _0xf677=function(_0x30adea,_0x18c1ec){_0x30adea=_0x30adea-0x0;var _0x1e5137=_0x677f[_0x30adea];return _0x1e5137;};'use strict';var Sequelize=require(_0xf677('0x0'));var iconv=require(_0xf677('0x1'));module['exports']={'closed':{'type':Sequelize[_0xf677('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf677('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf677('0x4')]},'note':{'type':Sequelize[_0xf677('0x4')]},'inReplyTo':{'type':Sequelize[_0xf677('0x4')](0x1fe)},'to':{'type':Sequelize[_0xf677('0x4')]},'cc':{'type':Sequelize[_0xf677('0x5')](_0xf677('0x6'))},'subject':{'type':Sequelize[_0xf677('0x5')]()},'attach':{'type':Sequelize[_0xf677('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xf677('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xf677('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf677('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf677('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf677('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9490=['TEXT','long','DATE','ENUM','out','BOOLEAN','STRING'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0x9490,0x15c));var _0x0949=function(_0x3f8767,_0x130f0f){_0x3f8767=_0x3f8767-0x0;var _0x40b9c2=_0x9490[_0x3f8767];return _0x40b9c2;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x0949('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0949('0x1')]},'secondDisposition':{'type':Sequelize[_0x0949('0x1')]},'thirdDisposition':{'type':Sequelize[_0x0949('0x1')]},'note':{'type':Sequelize[_0x0949('0x1')]},'inReplyTo':{'type':Sequelize[_0x0949('0x1')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0949('0x2')](_0x0949('0x3'))},'subject':{'type':Sequelize[_0x0949('0x2')]()},'attach':{'type':Sequelize[_0x0949('0x0')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0949('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x0949('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0949('0x5')]('in',_0x0949('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0949('0x5')]('in',_0x0949('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0949('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9ccb16b..3b590be 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 _0xba44=['rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','find','catch','create','body','describe','MailMessage','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','Tag','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','from','bcc','subject','createdAt','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','juice','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','limit','count','then','destroy','error','stack','name','send','index','map','fieldName','type','key','getOptions','mail','query','user','params','model','keys','MailInteraction'];(function(_0x51f8f9,_0x318840){var _0x4879a9=function(_0x561b65){while(--_0x561b65){_0x51f8f9['push'](_0x51f8f9['shift']());}};_0x4879a9(++_0x318840);}(_0xba44,0x109));var _0x4ba4=function(_0x26c63c,_0x5e92c8){_0x26c63c=_0x26c63c-0x0;var _0x462227=_0xba44[_0x26c63c];return _0x462227;};'use strict';var emlformat=require(_0x4ba4('0x0'));var rimraf=require(_0x4ba4('0x1'));var zipdir=require(_0x4ba4('0x2'));var moment=require(_0x4ba4('0x3'));var BPromise=require(_0x4ba4('0x4'));var util=require('util');var path=require(_0x4ba4('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0x4ba4('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x4ba4('0x7'))(_0x4ba4('0x8'));var config=require(_0x4ba4('0x9'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x4ba4('0xa'));config[_0x4ba4('0xb')]=_[_0x4ba4('0xc')](config[_0x4ba4('0xb')],{'host':_0x4ba4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4ba4('0xe'))['register'](socket);function respondWithStatusCode(_0x3b2c5e,_0x3657df){_0x3657df=_0x3657df||0xcc;return function(_0x329efb){if(_0x329efb){return _0x3b2c5e[_0x4ba4('0xf')](_0x3657df);}return _0x3b2c5e[_0x4ba4('0x10')](_0x3657df)[_0x4ba4('0x11')]();};}function respondWithResult(_0x2ada4b,_0x54d33c){_0x54d33c=_0x54d33c||0xc8;return function(_0x2a91f1){if(_0x2a91f1){return _0x2ada4b[_0x4ba4('0x10')](_0x54d33c)[_0x4ba4('0x12')](_0x2a91f1);}};}function respondWithFilteredResult(_0x82990b,_0x169f75){return function(_0xf92a7d){if(_0xf92a7d){var _0x314cdc=typeof _0x169f75[_0x4ba4('0x13')]==='undefined'&&typeof _0x169f75[_0x4ba4('0x14')]==='undefined';var _0xc5f93e=_0xf92a7d[_0x4ba4('0x15')];var _0x39f7d3=_0x314cdc?0x0:_0x169f75[_0x4ba4('0x13')];var _0x251b5a=_0x314cdc?_0xf92a7d[_0x4ba4('0x15')]:_0x169f75[_0x4ba4('0x13')]+_0x169f75['limit'];var _0x3bf3c8;if(_0x251b5a>=_0xc5f93e){_0x251b5a=_0xc5f93e;_0x3bf3c8=0xc8;}else{_0x3bf3c8=0xce;}_0x82990b[_0x4ba4('0x10')](_0x3bf3c8);return _0x82990b['set']('Content-Range',_0x39f7d3+'-'+_0x251b5a+'/'+_0xc5f93e)[_0x4ba4('0x12')](_0xf92a7d);}return null;};}function saveUpdates(_0x1dd502){return function(_0x27da1c){if(_0x27da1c){return _0x27da1c['update'](_0x1dd502)[_0x4ba4('0x16')](function(_0x26a349){return _0x26a349;});}return null;};}function removeEntity(_0x3ed670){return function(_0x891187){if(_0x891187){return _0x891187[_0x4ba4('0x17')]()['then'](function(){_0x3ed670[_0x4ba4('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58180a){return function(_0x2947fe){if(!_0x2947fe){_0x58180a[_0x4ba4('0xf')](0x194);}return _0x2947fe;};}function handleError(_0xdd8c7c,_0x4901ac){_0x4901ac=_0x4901ac||0x1f4;return function(_0x5745b9){logger[_0x4ba4('0x18')](_0x5745b9[_0x4ba4('0x19')]);if(_0x5745b9['name']){delete _0x5745b9[_0x4ba4('0x1a')];}_0xdd8c7c[_0x4ba4('0x10')](_0x4901ac)[_0x4ba4('0x1b')](_0x5745b9);};}exports[_0x4ba4('0x1c')]=function(_0x30ac95,_0x4ce8c9){var _0xdec2dd={};var _0x15deeb=_[_0x4ba4('0x1d')](db['MailInteraction']['rawAttributes'],function(_0x4962cb){return{'name':_0x4962cb[_0x4ba4('0x1e')],'type':_0x4962cb[_0x4ba4('0x1f')][_0x4ba4('0x20')]};});_0xdec2dd=qs[_0x4ba4('0x21')](_0x15deeb,_0x30ac95);return interaction['findAll'](_0x4ba4('0x22'),_0x30ac95[_0x4ba4('0x23')],_0x30ac95[_0x4ba4('0x24')],_0xdec2dd,_0x15deeb)[_0x4ba4('0x16')](respondWithFilteredResult(_0x4ce8c9,_0xdec2dd))['catch'](handleError(_0x4ce8c9,null));};exports['show']=function(_0x14d06a,_0x300da7){var _0x41aa68={'raw':![],'where':{'id':_0x14d06a[_0x4ba4('0x25')]['id']}},_0x52450b={};_0x52450b[_0x4ba4('0x26')]=_[_0x4ba4('0x27')](db[_0x4ba4('0x28')][_0x4ba4('0x29')]);_0x52450b[_0x4ba4('0x23')]=_['keys'](_0x14d06a[_0x4ba4('0x23')]);_0x52450b[_0x4ba4('0x2a')]=_[_0x4ba4('0x2b')](_0x52450b[_0x4ba4('0x26')],_0x52450b[_0x4ba4('0x23')]);_0x41aa68[_0x4ba4('0x2c')]=_['intersection'](_0x52450b['model'],qs[_0x4ba4('0x2d')](_0x14d06a[_0x4ba4('0x23')][_0x4ba4('0x2d')]));_0x41aa68[_0x4ba4('0x2c')]=_0x41aa68['attributes'][_0x4ba4('0x2e')]?_0x41aa68[_0x4ba4('0x2c')]:_0x52450b['model'];if(_0x14d06a[_0x4ba4('0x23')][_0x4ba4('0x2f')]){_0x41aa68['include']=[{'all':!![]}];}_0x41aa68=_['merge']({},_0x41aa68,_0x14d06a[_0x4ba4('0x30')]);return db[_0x4ba4('0x28')][_0x4ba4('0x31')](_0x41aa68)[_0x4ba4('0x16')](handleEntityNotFound(_0x300da7,null))[_0x4ba4('0x16')](respondWithResult(_0x300da7,null))[_0x4ba4('0x32')](handleError(_0x300da7,null));};exports[_0x4ba4('0x33')]=function(_0x574f9d,_0x31cdfd){return db['MailInteraction'][_0x4ba4('0x33')](_0x574f9d['body'],{})[_0x4ba4('0x16')](respondWithResult(_0x31cdfd,0xc9))[_0x4ba4('0x32')](handleError(_0x31cdfd,null));};exports['update']=function(_0x38d079,_0x2a68ab){if(_0x38d079[_0x4ba4('0x34')]['id']){delete _0x38d079[_0x4ba4('0x34')]['id'];}return db[_0x4ba4('0x28')]['find']({'where':{'id':_0x38d079[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x2a68ab,null))[_0x4ba4('0x16')](saveUpdates(_0x38d079[_0x4ba4('0x34')],null))['then'](respondWithResult(_0x2a68ab,null))[_0x4ba4('0x32')](handleError(_0x2a68ab,null));};exports[_0x4ba4('0x17')]=function(_0xb4d7ea,_0x44eff8){return db[_0x4ba4('0x28')]['find']({'where':{'id':_0xb4d7ea[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x44eff8,null))['then'](removeEntity(_0x44eff8,null))[_0x4ba4('0x32')](handleError(_0x44eff8,null));};exports[_0x4ba4('0x35')]=function(_0x37ae0d,_0x195520){return db[_0x4ba4('0x28')][_0x4ba4('0x35')]()[_0x4ba4('0x16')](respondWithResult(_0x195520,null))[_0x4ba4('0x32')](handleError(_0x195520,null));};exports['addMessage']=function(_0x416c09,_0x1a9c63){return db[_0x4ba4('0x36')]['find']({'where':{'id':_0x416c09[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x1a9c63,null))[_0x4ba4('0x16')](function(_0x22963d){if(_0x22963d){return _0x22963d[_0x4ba4('0x37')](_0x416c09[_0x4ba4('0x34')][_0x4ba4('0x38')],_[_0x4ba4('0x39')](_0x416c09[_0x4ba4('0x34')],['ids','id'])||{});}})[_0x4ba4('0x16')](respondWithResult(_0x1a9c63,null))['catch'](handleError(_0x1a9c63,null));};exports['getMessages']=function(_0x1dc505,_0x457c59){var _0x5f5573={'raw':![],'where':{}};var _0xdf152e={};var _0x51e08e={'count':0x0,'rows':[]};return db[_0x4ba4('0x28')]['findOne']({'where':{'id':_0x1dc505[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x457c59,null))[_0x4ba4('0x16')](function(_0x391f04){if(_0x391f04){_0xdf152e[_0x4ba4('0x26')]=_[_0x4ba4('0x27')](db[_0x4ba4('0x36')][_0x4ba4('0x29')]);_0xdf152e['query']=_[_0x4ba4('0x27')](_0x1dc505[_0x4ba4('0x23')]);_0xdf152e[_0x4ba4('0x2a')]=_['intersection'](_0xdf152e[_0x4ba4('0x26')],_0xdf152e[_0x4ba4('0x23')]);_0x5f5573[_0x4ba4('0x2c')]=_[_0x4ba4('0x2b')](_0xdf152e['model'],qs[_0x4ba4('0x2d')](_0x1dc505[_0x4ba4('0x23')]['fields']));_0x5f5573[_0x4ba4('0x2c')]=_0x5f5573[_0x4ba4('0x2c')][_0x4ba4('0x2e')]?_0x5f5573[_0x4ba4('0x2c')]:_0xdf152e[_0x4ba4('0x26')];if(!_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x3a')](_0x4ba4('0x3b'))){_0x5f5573[_0x4ba4('0x14')]=qs[_0x4ba4('0x14')](_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x14')]);_0x5f5573[_0x4ba4('0x13')]=qs['offset'](_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x13')]);}_0x5f5573[_0x4ba4('0x3c')]=qs[_0x4ba4('0x3d')](_0x1dc505['query'][_0x4ba4('0x3d')]);_0x5f5573[_0x4ba4('0x3e')]=qs['filters'](_['pick'](_0x1dc505['query'],_0xdf152e[_0x4ba4('0x2a')]));_0x5f5573['where']['MailInteractionId']=_0x391f04['id'];if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x3f')]){_0x5f5573['where']=_[_0x4ba4('0x40')](_0x5f5573[_0x4ba4('0x3e')],{'$or':_['map'](_0x5f5573[_0x4ba4('0x2c')],function(_0x9e0177){var _0x1eba39={};_0x1eba39[_0x9e0177]={'$like':'%'+_0x1dc505[_0x4ba4('0x23')]['filter']+'%'};return _0x1eba39;})});}if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x41')]){var _0x4dfea8=_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x41')][_0x4ba4('0x42')](',');var _0xd40b50={};_0xd40b50[_0x4dfea8[0x0]]={'$gte':moment(_0x4dfea8[0x1])[_0x4ba4('0x43')](_0x4ba4('0x44'))};_0x5f5573[_0x4ba4('0x3e')]=_[_0x4ba4('0x40')](_0x5f5573[_0x4ba4('0x3e')],_0xd40b50);}_0x5f5573=_[_0x4ba4('0x40')]({},_0x5f5573,_0x1dc505[_0x4ba4('0x30')]);return db[_0x4ba4('0x36')][_0x4ba4('0x15')]({'where':_0x5f5573[_0x4ba4('0x3e')]})[_0x4ba4('0x16')](function(_0x2b5ecf){_0x51e08e[_0x4ba4('0x15')]=_0x2b5ecf;if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x2f')]){_0x5f5573['include']=[{'all':!![]}];}return db[_0x4ba4('0x36')][_0x4ba4('0x45')](_0x5f5573);})[_0x4ba4('0x16')](function(_0x8d5f86){if(_0x1dc505[_0x4ba4('0x23')][_0x4ba4('0x46')]===_0x4ba4('0x47')){for(var _0x4fddfa=0x0;_0x4fddfa<_0x8d5f86[_0x4ba4('0x2e')];_0x4fddfa++){_0x8d5f86[_0x4fddfa]['body']=juice(_0x8d5f86[_0x4fddfa]['body']);}}_0x51e08e[_0x4ba4('0x48')]=_0x8d5f86;return _0x51e08e;});}})['then'](respondWithFilteredResult(_0x457c59,_0x5f5573))[_0x4ba4('0x32')](handleError(_0x457c59,null));};exports['addTags']=function(_0x29b08a,_0x58d66a){return db['MailInteraction'][_0x4ba4('0x31')]({'where':{'id':_0x29b08a['params']['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x58d66a,null))[_0x4ba4('0x16')](function(_0x14e589){if(_0x14e589){return _0x14e589['setTags'](_0x29b08a[_0x4ba4('0x34')][_0x4ba4('0x38')],_[_0x4ba4('0x39')](_0x29b08a[_0x4ba4('0x34')],['ids','id'])||{})['spread'](function(){return db[_0x4ba4('0x49')][_0x4ba4('0x45')]({'attributes':['id','name','color'],'where':{'id':_0x29b08a['body'][_0x4ba4('0x38')]}});})[_0x4ba4('0x16')](function(_0x422567){socket['emit']('mailInteractionTags:save',{'id':Number(_0x29b08a['params']['id']),'tags':_0x422567||[]});return{'id':Number(_0x29b08a[_0x4ba4('0x25')]['id']),'tags':_0x422567||[]};});}})[_0x4ba4('0x16')](respondWithResult(_0x58d66a,null))[_0x4ba4('0x32')](handleError(_0x58d66a,null));};exports[_0x4ba4('0x4a')]=function(_0x364a2f,_0x51bdcd){return db[_0x4ba4('0x28')][_0x4ba4('0x31')]({'where':{'id':_0x364a2f[_0x4ba4('0x25')]['id']}})[_0x4ba4('0x16')](handleEntityNotFound(_0x51bdcd,null))[_0x4ba4('0x16')](function(_0x20346f){if(_0x20346f){return _0x20346f[_0x4ba4('0x4a')](_0x364a2f[_0x4ba4('0x23')][_0x4ba4('0x38')]);}})[_0x4ba4('0x16')](respondWithStatusCode(_0x51bdcd,null))[_0x4ba4('0x32')](handleError(_0x51bdcd,null));};exports[_0x4ba4('0x4b')]=function(_0x498c1d,_0x17e7c1){var _0x3a6f75=moment()['unix']()[_0x4ba4('0x4c')]();var _0x179803=path[_0x4ba4('0x4d')](config[_0x4ba4('0x4e')],_0x4ba4('0x4f'),_0x4ba4('0x50'),_0x4ba4('0x51'));var _0x108238=path[_0x4ba4('0x4d')](config[_0x4ba4('0x4e')],_0x4ba4('0x4f'),'files',_0x4ba4('0x52'));var _0x1b291c=path[_0x4ba4('0x4d')](_0x179803,_0x3a6f75);var _0x39d94a=util[_0x4ba4('0x43')](_0x4ba4('0x53'),_0x498c1d['params']['id'],_0x3a6f75);var _0x5df72c=path['join'](_0x179803,_0x39d94a);var _0x4f086d=[];if(_0x498c1d['query']['attachments']){_0x4f086d['push']({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x3b8429=[{'model':db[_0x4ba4('0x36')],'as':_0x4ba4('0x54'),'attributes':['id',_0x4ba4('0x34'),_0x4ba4('0x55'),'to','cc',_0x4ba4('0x56'),_0x4ba4('0x57'),_0x4ba4('0x58')],'where':{'secret':![]},'order':qs[_0x4ba4('0x3d')]('id'),'include':_0x4f086d}];return db[_0x4ba4('0x28')]['find']({'where':{'id':_0x498c1d['params']['id']},'include':_0x3b8429})[_0x4ba4('0x16')](handleEntityNotFound(_0x17e7c1,null))[_0x4ba4('0x16')](function(_0xf775a9){if(_0xf775a9&&_0xf775a9[_0x4ba4('0x54')]){var _0xfa54e1=_0xf775a9['get']({'plain':!![]});fs[_0x4ba4('0x59')](_0x1b291c);return BPromise[_0x4ba4('0x5a')](_0xfa54e1[_0x4ba4('0x54')],function(_0x1a1f60,_0x4ebc94){var _0x50908={'from':_0x1a1f60['from'],'to':_0x1a1f60['to']||_0x4ba4('0x5b'),'subject':_0x1a1f60['subject'],'html':htmlEntities[_0x4ba4('0x5c')](_0x1a1f60[_0x4ba4('0x34')]),'headers':{'Date':moment(_0x1a1f60[_0x4ba4('0x58')])[_0x4ba4('0x43')](_0x4ba4('0x5d'))},'attachments':[]};if(_0x1a1f60['cc']){_0x50908['headers']['Cc']=_0x1a1f60['cc'];}if(_0x1a1f60['bcc']){_0x50908[_0x4ba4('0x5e')]['Bcc']=_0x1a1f60[_0x4ba4('0x56')];}return new BPromise(function(_0x43d56d,_0x3f7f61){if(_0x1a1f60['Attachments']){for(var _0x4e4ac0=0x0;_0x4e4ac0<_0x1a1f60[_0x4ba4('0x5f')][_0x4ba4('0x2e')];_0x4e4ac0++){var _0x383e1e=_0x1a1f60[_0x4ba4('0x5f')][_0x4e4ac0];var _0x17c00d=path[_0x4ba4('0x4d')](_0x108238,_0x383e1e['basename']);if(fs[_0x4ba4('0x60')](_0x17c00d)){_0x50908[_0x4ba4('0x52')][_0x4ba4('0x61')]({'name':_0x383e1e[_0x4ba4('0x1a')],'contentType':_0x383e1e[_0x4ba4('0x1f')],'data':fs[_0x4ba4('0x62')](_0x17c00d)});}}}emlformat['build'](_0x50908,function(_0xa5d07d,_0x364f21){if(_0xa5d07d)return _0x3f7f61(_0xa5d07d);fs[_0x4ba4('0x63')](path['join'](_0x1b291c,util[_0x4ba4('0x43')](_0x4ba4('0x64'),_0x4ebc94)),_0x364f21);return _0x43d56d(_0x364f21);});});})[_0x4ba4('0x16')](function(){return new BPromise(function(_0x327c61,_0x6dcd87){zipdir(_0x1b291c,{'saveTo':_0x5df72c},function(_0x384216,_0x4c9f40){if(_0x384216)return _0x6dcd87(_0x384216);return _0x327c61(_0x4c9f40);});})[_0x4ba4('0x16')](function(){return new BPromise(function(_0x29883f,_0x4181ec){rimraf(_0x1b291c,function(_0x2176df){if(_0x2176df)_0x4181ec(_0x2176df);return _0x29883f();});});})[_0x4ba4('0x16')](function(){return _0x17e7c1[_0x4ba4('0x4b')](_0x5df72c,_0x39d94a,function(_0x3f401f){if(!_0x3f401f)fs[_0x4ba4('0x65')](_0x5df72c);});});});}else{return _0x17e7c1[_0x4ba4('0xf')](0xc8);}})[_0x4ba4('0x32')](handleError(_0x17e7c1,null));}; \ No newline at end of file +var _0x6bc1=['merge','options','create','body','find','destroy','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','inlineCss','true','rows','addTags','setTags','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','join','transcript-%d-%s.zip','attachments','push','Attachment','Messages','from','bcc','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','offset','limit','undefined','count','set','json','update','then','end','error','stack','name','send','index','map','MailInteraction','fieldName','key','getOptions','query','user','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include'];(function(_0x399ad3,_0x249e0f){var _0x290fed=function(_0x2c9415){while(--_0x2c9415){_0x399ad3['push'](_0x399ad3['shift']());}};_0x290fed(++_0x249e0f);}(_0x6bc1,0x1aa));var _0x16bc=function(_0x26b3d1,_0x3782f6){_0x26b3d1=_0x26b3d1-0x0;var _0x49a9c9=_0x6bc1[_0x26b3d1];return _0x49a9c9;};'use strict';var emlformat=require(_0x16bc('0x0'));var rimraf=require(_0x16bc('0x1'));var zipdir=require(_0x16bc('0x2'));var moment=require(_0x16bc('0x3'));var BPromise=require(_0x16bc('0x4'));var util=require(_0x16bc('0x5'));var path=require(_0x16bc('0x6'));var fs=require('fs');var _=require(_0x16bc('0x7'));var juice=require(_0x16bc('0x8'));var Redis=require(_0x16bc('0x9'));var interaction=require(_0x16bc('0xa'));var qs=require(_0x16bc('0xb'));var logger=require(_0x16bc('0xc'))(_0x16bc('0xd'));var config=require(_0x16bc('0xe'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x16bc('0xf'));config['redis']=_['defaults'](config[_0x16bc('0x10')],{'host':_0x16bc('0x11'),'port':0x18eb});var socket=require(_0x16bc('0x12'))(new Redis(config['redis']));require(_0x16bc('0x13'))['register'](socket);function respondWithStatusCode(_0x1f56b3,_0x18fe6f){_0x18fe6f=_0x18fe6f||0xcc;return function(_0x3c2155){if(_0x3c2155){return _0x1f56b3[_0x16bc('0x14')](_0x18fe6f);}return _0x1f56b3[_0x16bc('0x15')](_0x18fe6f)['end']();};}function respondWithResult(_0x2fbf9b,_0x38e08e){_0x38e08e=_0x38e08e||0xc8;return function(_0x33e57f){if(_0x33e57f){return _0x2fbf9b[_0x16bc('0x15')](_0x38e08e)['json'](_0x33e57f);}};}function respondWithFilteredResult(_0xd115,_0x29634c){return function(_0x225f51){if(_0x225f51){var _0x69de5f=typeof _0x29634c[_0x16bc('0x16')]==='undefined'&&typeof _0x29634c[_0x16bc('0x17')]===_0x16bc('0x18');var _0x492c3c=_0x225f51['count'];var _0x26c15e=_0x69de5f?0x0:_0x29634c[_0x16bc('0x16')];var _0x3dcae0=_0x69de5f?_0x225f51[_0x16bc('0x19')]:_0x29634c['offset']+_0x29634c[_0x16bc('0x17')];var _0x3a6afe;if(_0x3dcae0>=_0x492c3c){_0x3dcae0=_0x492c3c;_0x3a6afe=0xc8;}else{_0x3a6afe=0xce;}_0xd115[_0x16bc('0x15')](_0x3a6afe);return _0xd115[_0x16bc('0x1a')]('Content-Range',_0x26c15e+'-'+_0x3dcae0+'/'+_0x492c3c)[_0x16bc('0x1b')](_0x225f51);}return null;};}function saveUpdates(_0x4be782){return function(_0x3a053c){if(_0x3a053c){return _0x3a053c[_0x16bc('0x1c')](_0x4be782)[_0x16bc('0x1d')](function(_0x2ad5b4){return _0x2ad5b4;});}return null;};}function removeEntity(_0x12a26d){return function(_0x35d5be){if(_0x35d5be){return _0x35d5be['destroy']()[_0x16bc('0x1d')](function(){_0x12a26d[_0x16bc('0x15')](0xcc)[_0x16bc('0x1e')]();});}};}function handleEntityNotFound(_0x321425){return function(_0x51dd93){if(!_0x51dd93){_0x321425[_0x16bc('0x14')](0x194);}return _0x51dd93;};}function handleError(_0x4d15f8,_0x14e490){_0x14e490=_0x14e490||0x1f4;return function(_0xe17267){logger[_0x16bc('0x1f')](_0xe17267[_0x16bc('0x20')]);if(_0xe17267[_0x16bc('0x21')]){delete _0xe17267[_0x16bc('0x21')];}_0x4d15f8[_0x16bc('0x15')](_0x14e490)[_0x16bc('0x22')](_0xe17267);};}exports[_0x16bc('0x23')]=function(_0x27d755,_0x27aa99){var _0x5051dc={};var _0x98a4ce=_[_0x16bc('0x24')](db[_0x16bc('0x25')]['rawAttributes'],function(_0x4add10){return{'name':_0x4add10[_0x16bc('0x26')],'type':_0x4add10['type'][_0x16bc('0x27')]};});_0x5051dc=qs[_0x16bc('0x28')](_0x98a4ce,_0x27d755);return interaction['findAll']('mail',_0x27d755[_0x16bc('0x29')],_0x27d755[_0x16bc('0x2a')],_0x5051dc,_0x98a4ce)['then'](respondWithFilteredResult(_0x27aa99,_0x5051dc))[_0x16bc('0x2b')](handleError(_0x27aa99,null));};exports['show']=function(_0x71c4d7,_0x1ea76c){var _0x3e4ef0={'raw':![],'where':{'id':_0x71c4d7[_0x16bc('0x2c')]['id']}},_0x585d1d={};_0x585d1d[_0x16bc('0x2d')]=_[_0x16bc('0x2e')](db[_0x16bc('0x25')][_0x16bc('0x2f')]);_0x585d1d[_0x16bc('0x29')]=_[_0x16bc('0x2e')](_0x71c4d7[_0x16bc('0x29')]);_0x585d1d[_0x16bc('0x30')]=_[_0x16bc('0x31')](_0x585d1d[_0x16bc('0x2d')],_0x585d1d[_0x16bc('0x29')]);_0x3e4ef0[_0x16bc('0x32')]=_[_0x16bc('0x31')](_0x585d1d[_0x16bc('0x2d')],qs[_0x16bc('0x33')](_0x71c4d7[_0x16bc('0x29')][_0x16bc('0x33')]));_0x3e4ef0['attributes']=_0x3e4ef0['attributes'][_0x16bc('0x34')]?_0x3e4ef0[_0x16bc('0x32')]:_0x585d1d[_0x16bc('0x2d')];if(_0x71c4d7['query']['includeAll']){_0x3e4ef0[_0x16bc('0x35')]=[{'all':!![]}];}_0x3e4ef0=_[_0x16bc('0x36')]({},_0x3e4ef0,_0x71c4d7[_0x16bc('0x37')]);return db[_0x16bc('0x25')]['find'](_0x3e4ef0)[_0x16bc('0x1d')](handleEntityNotFound(_0x1ea76c,null))[_0x16bc('0x1d')](respondWithResult(_0x1ea76c,null))[_0x16bc('0x2b')](handleError(_0x1ea76c,null));};exports['create']=function(_0x36b56d,_0x153b58){return db[_0x16bc('0x25')][_0x16bc('0x38')](_0x36b56d[_0x16bc('0x39')],{})[_0x16bc('0x1d')](respondWithResult(_0x153b58,0xc9))['catch'](handleError(_0x153b58,null));};exports[_0x16bc('0x1c')]=function(_0x11b357,_0x54fb68){if(_0x11b357[_0x16bc('0x39')]['id']){delete _0x11b357[_0x16bc('0x39')]['id'];}return db['MailInteraction'][_0x16bc('0x3a')]({'where':{'id':_0x11b357[_0x16bc('0x2c')]['id']}})[_0x16bc('0x1d')](handleEntityNotFound(_0x54fb68,null))[_0x16bc('0x1d')](saveUpdates(_0x11b357[_0x16bc('0x39')],null))['then'](respondWithResult(_0x54fb68,null))[_0x16bc('0x2b')](handleError(_0x54fb68,null));};exports[_0x16bc('0x3b')]=function(_0x22dba9,_0x381f20){return db[_0x16bc('0x25')][_0x16bc('0x3a')]({'where':{'id':_0x22dba9[_0x16bc('0x2c')]['id']}})[_0x16bc('0x1d')](handleEntityNotFound(_0x381f20,null))[_0x16bc('0x1d')](removeEntity(_0x381f20,null))[_0x16bc('0x2b')](handleError(_0x381f20,null));};exports[_0x16bc('0x3c')]=function(_0x44e504,_0x5d2c8f){return db['MailInteraction'][_0x16bc('0x3c')]()[_0x16bc('0x1d')](respondWithResult(_0x5d2c8f,null))[_0x16bc('0x2b')](handleError(_0x5d2c8f,null));};exports[_0x16bc('0x3d')]=function(_0xdf8c59,_0x281525){return db[_0x16bc('0x3e')][_0x16bc('0x3a')]({'where':{'id':_0xdf8c59[_0x16bc('0x2c')]['id']}})[_0x16bc('0x1d')](handleEntityNotFound(_0x281525,null))[_0x16bc('0x1d')](function(_0x25af2c){if(_0x25af2c){return _0x25af2c['addMessage'](_0xdf8c59[_0x16bc('0x39')][_0x16bc('0x3f')],_[_0x16bc('0x40')](_0xdf8c59['body'],['ids','id'])||{});}})[_0x16bc('0x1d')](respondWithResult(_0x281525,null))[_0x16bc('0x2b')](handleError(_0x281525,null));};exports['getMessages']=function(_0x474f4f,_0x42c8d1){var _0x552888={'raw':![],'where':{}};var _0x38ca40={};var _0x51e51e={'count':0x0,'rows':[]};return db['MailInteraction'][_0x16bc('0x41')]({'where':{'id':_0x474f4f[_0x16bc('0x2c')]['id']}})[_0x16bc('0x1d')](handleEntityNotFound(_0x42c8d1,null))[_0x16bc('0x1d')](function(_0x45bc97){if(_0x45bc97){_0x38ca40[_0x16bc('0x2d')]=_[_0x16bc('0x2e')](db[_0x16bc('0x3e')][_0x16bc('0x2f')]);_0x38ca40['query']=_[_0x16bc('0x2e')](_0x474f4f['query']);_0x38ca40[_0x16bc('0x30')]=_[_0x16bc('0x31')](_0x38ca40[_0x16bc('0x2d')],_0x38ca40[_0x16bc('0x29')]);_0x552888[_0x16bc('0x32')]=_['intersection'](_0x38ca40[_0x16bc('0x2d')],qs[_0x16bc('0x33')](_0x474f4f['query'][_0x16bc('0x33')]));_0x552888[_0x16bc('0x32')]=_0x552888['attributes']['length']?_0x552888[_0x16bc('0x32')]:_0x38ca40[_0x16bc('0x2d')];if(!_0x474f4f['query'][_0x16bc('0x42')](_0x16bc('0x43'))){_0x552888['limit']=qs[_0x16bc('0x17')](_0x474f4f[_0x16bc('0x29')][_0x16bc('0x17')]);_0x552888[_0x16bc('0x16')]=qs[_0x16bc('0x16')](_0x474f4f[_0x16bc('0x29')][_0x16bc('0x16')]);}_0x552888[_0x16bc('0x44')]=qs[_0x16bc('0x45')](_0x474f4f[_0x16bc('0x29')][_0x16bc('0x45')]);_0x552888[_0x16bc('0x46')]=qs[_0x16bc('0x30')](_['pick'](_0x474f4f[_0x16bc('0x29')],_0x38ca40['filters']));_0x552888[_0x16bc('0x46')]['MailInteractionId']=_0x45bc97['id'];if(_0x474f4f[_0x16bc('0x29')][_0x16bc('0x47')]){_0x552888[_0x16bc('0x46')]=_[_0x16bc('0x36')](_0x552888[_0x16bc('0x46')],{'$or':_[_0x16bc('0x24')](_0x552888['attributes'],function(_0x21381d){var _0x37bc12={};_0x37bc12[_0x21381d]={'$like':'%'+_0x474f4f['query'][_0x16bc('0x47')]+'%'};return _0x37bc12;})});}if(_0x474f4f['query'][_0x16bc('0x48')]){var _0x300234=_0x474f4f['query'][_0x16bc('0x48')][_0x16bc('0x49')](',');var _0x2203a6={};_0x2203a6[_0x300234[0x0]]={'$gte':moment(_0x300234[0x1])[_0x16bc('0x4a')](_0x16bc('0x4b'))};_0x552888['where']=_[_0x16bc('0x36')](_0x552888[_0x16bc('0x46')],_0x2203a6);}_0x552888=_[_0x16bc('0x36')]({},_0x552888,_0x474f4f[_0x16bc('0x37')]);return db[_0x16bc('0x3e')][_0x16bc('0x19')]({'where':_0x552888[_0x16bc('0x46')]})[_0x16bc('0x1d')](function(_0x51688a){_0x51e51e[_0x16bc('0x19')]=_0x51688a;if(_0x474f4f['query'][_0x16bc('0x4c')]){_0x552888[_0x16bc('0x35')]=[{'all':!![]}];}return db['MailMessage'][_0x16bc('0x4d')](_0x552888);})[_0x16bc('0x1d')](function(_0x486896){if(_0x474f4f['query'][_0x16bc('0x4e')]===_0x16bc('0x4f')){for(var _0x2df7d5=0x0;_0x2df7d5<_0x486896[_0x16bc('0x34')];_0x2df7d5++){_0x486896[_0x2df7d5][_0x16bc('0x39')]=juice(_0x486896[_0x2df7d5][_0x16bc('0x39')]);}}_0x51e51e[_0x16bc('0x50')]=_0x486896;return _0x51e51e;});}})[_0x16bc('0x1d')](respondWithFilteredResult(_0x42c8d1,_0x552888))[_0x16bc('0x2b')](handleError(_0x42c8d1,null));};exports[_0x16bc('0x51')]=function(_0x522c1a,_0x153a45){return db[_0x16bc('0x25')]['find']({'where':{'id':_0x522c1a[_0x16bc('0x2c')]['id']}})['then'](handleEntityNotFound(_0x153a45,null))[_0x16bc('0x1d')](function(_0x264c82){if(_0x264c82){return _0x264c82[_0x16bc('0x52')](_0x522c1a['body']['ids'],_['omit'](_0x522c1a[_0x16bc('0x39')],[_0x16bc('0x3f'),'id'])||{})['spread'](function(){return db[_0x16bc('0x53')]['findAll']({'attributes':['id',_0x16bc('0x21'),_0x16bc('0x54')],'where':{'id':_0x522c1a[_0x16bc('0x39')][_0x16bc('0x3f')]}});})['then'](function(_0x1d767c){socket[_0x16bc('0x55')](_0x16bc('0x56'),{'id':Number(_0x522c1a['params']['id']),'tags':_0x1d767c||[]});return{'id':Number(_0x522c1a[_0x16bc('0x2c')]['id']),'tags':_0x1d767c||[]};});}})[_0x16bc('0x1d')](respondWithResult(_0x153a45,null))[_0x16bc('0x2b')](handleError(_0x153a45,null));};exports[_0x16bc('0x57')]=function(_0x46771d,_0x4b8711){return db[_0x16bc('0x25')][_0x16bc('0x3a')]({'where':{'id':_0x46771d[_0x16bc('0x2c')]['id']}})[_0x16bc('0x1d')](handleEntityNotFound(_0x4b8711,null))[_0x16bc('0x1d')](function(_0xa7978f){if(_0xa7978f){return _0xa7978f[_0x16bc('0x57')](_0x46771d[_0x16bc('0x29')][_0x16bc('0x3f')]);}})[_0x16bc('0x1d')](respondWithStatusCode(_0x4b8711,null))[_0x16bc('0x2b')](handleError(_0x4b8711,null));};exports[_0x16bc('0x58')]=function(_0x266f4c,_0xe7930d){var _0x3b55d6=moment()[_0x16bc('0x59')]()[_0x16bc('0x5a')]();var _0x1aead5=path['join'](config[_0x16bc('0x5b')],_0x16bc('0x5c'),_0x16bc('0x5d'),'tmp');var _0x3b4ef5=path[_0x16bc('0x5e')](config['root'],_0x16bc('0x5c'),'files','attachments');var _0x46c18f=path['join'](_0x1aead5,_0x3b55d6);var _0x4376ad=util[_0x16bc('0x4a')](_0x16bc('0x5f'),_0x266f4c[_0x16bc('0x2c')]['id'],_0x3b55d6);var _0xf7c6d2=path['join'](_0x1aead5,_0x4376ad);var _0x180d43=[];if(_0x266f4c[_0x16bc('0x29')][_0x16bc('0x60')]){_0x180d43[_0x16bc('0x61')]({'model':db[_0x16bc('0x62')],'as':'Attachments','raw':!![]});}var _0x481939=[{'model':db[_0x16bc('0x3e')],'as':_0x16bc('0x63'),'attributes':['id','body',_0x16bc('0x64'),'to','cc',_0x16bc('0x65'),'subject',_0x16bc('0x66')],'where':{'secret':![]},'order':qs[_0x16bc('0x45')]('id'),'include':_0x180d43}];return db['MailInteraction']['find']({'where':{'id':_0x266f4c[_0x16bc('0x2c')]['id']},'include':_0x481939})[_0x16bc('0x1d')](handleEntityNotFound(_0xe7930d,null))[_0x16bc('0x1d')](function(_0x54af9a){if(_0x54af9a&&_0x54af9a[_0x16bc('0x63')]){var _0x37f74d=_0x54af9a[_0x16bc('0x67')]({'plain':!![]});fs[_0x16bc('0x68')](_0x46c18f);return BPromise[_0x16bc('0x69')](_0x37f74d[_0x16bc('0x63')],function(_0x3a5897,_0xe4385f){var _0x6bd091={'from':_0x3a5897['from'],'to':_0x3a5897['to']||_0x16bc('0x6a'),'subject':_0x3a5897[_0x16bc('0x6b')],'html':htmlEntities[_0x16bc('0x6c')](_0x3a5897['body']),'headers':{'Date':moment(_0x3a5897['createdAt'])[_0x16bc('0x4a')](_0x16bc('0x6d'))},'attachments':[]};if(_0x3a5897['cc']){_0x6bd091[_0x16bc('0x6e')]['Cc']=_0x3a5897['cc'];}if(_0x3a5897['bcc']){_0x6bd091[_0x16bc('0x6e')][_0x16bc('0x6f')]=_0x3a5897[_0x16bc('0x65')];}return new BPromise(function(_0x3a81a0,_0x19132d){if(_0x3a5897['Attachments']){for(var _0xe765e5=0x0;_0xe765e5<_0x3a5897['Attachments'][_0x16bc('0x34')];_0xe765e5++){var _0x4d70ac=_0x3a5897[_0x16bc('0x70')][_0xe765e5];var _0xe8b8eb=path[_0x16bc('0x5e')](_0x3b4ef5,_0x4d70ac[_0x16bc('0x71')]);if(fs[_0x16bc('0x72')](_0xe8b8eb)){_0x6bd091[_0x16bc('0x60')][_0x16bc('0x61')]({'name':_0x4d70ac['name'],'contentType':_0x4d70ac['type'],'data':fs[_0x16bc('0x73')](_0xe8b8eb)});}}}emlformat[_0x16bc('0x74')](_0x6bd091,function(_0x1ffcd9,_0x210ff1){if(_0x1ffcd9)return _0x19132d(_0x1ffcd9);fs[_0x16bc('0x75')](path['join'](_0x46c18f,util['format'](_0x16bc('0x76'),_0xe4385f)),_0x210ff1);return _0x3a81a0(_0x210ff1);});});})[_0x16bc('0x1d')](function(){return new BPromise(function(_0x39525a,_0x59751a){zipdir(_0x46c18f,{'saveTo':_0xf7c6d2},function(_0x16f28a,_0x314d3c){if(_0x16f28a)return _0x59751a(_0x16f28a);return _0x39525a(_0x314d3c);});})['then'](function(){return new BPromise(function(_0x3a09a3,_0x592ee0){rimraf(_0x46c18f,function(_0x5d0273){if(_0x5d0273)_0x592ee0(_0x5d0273);return _0x3a09a3();});});})[_0x16bc('0x1d')](function(){return _0xe7930d[_0x16bc('0x58')](_0xf7c6d2,_0x4376ad,function(_0x37928a){if(!_0x37928a)fs[_0x16bc('0x77')](_0xf7c6d2);});});});}else{return _0xe7930d[_0x16bc('0x14')](0xc8);}})[_0x16bc('0x2b')](handleError(_0xe7930d,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 22510a9..d8867ae 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 _0x310b=['save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hook','../../mysqldb','MailInteraction','MailMessage'];(function(_0x545b65,_0x314672){var _0x4cd3b0=function(_0x796de6){while(--_0x796de6){_0x545b65['push'](_0x545b65['shift']());}};_0x4cd3b0(++_0x314672);}(_0x310b,0x1ec));var _0xb310=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x310b[_0x5a79e2];return _0x266c45;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xb310('0x0'))['db'][_0xb310('0x1')];var MailMessage=require(_0xb310('0x0'))['db'][_0xb310('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb310('0x3'),'afterUpdate':_0xb310('0x4'),'afterDestroy':_0xb310('0x5')};function emitEvent(_0x4fb25a){return function(_0xcca054,_0x70c9ec,_0x39d004){_0xcca054[_0xb310('0x6')]({'attributes':['id'],'raw':!![]})[_0xb310('0x7')](function(_0x1cf0d7){_0xcca054[_0xb310('0x8')](_0xb310('0x9'),_0x1cf0d7['map'](function(_0x3b9abe){return{'id':_0x3b9abe['id']};}));return MailMessage[_0xb310('0xa')]({'where':{'MailInteractionId':_0xcca054['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb310('0x7')](function(_0x229ef0){_0xcca054[_0xb310('0x8')](_0xb310('0xb'),_0x229ef0[_0xb310('0xc')]);MailInteractionEvents[_0xb310('0xd')](_0x4fb25a+':'+_0xcca054['id'],_0xcca054);MailInteractionEvents[_0xb310('0xd')](_0x4fb25a,_0xcca054);_0x39d004(null);})['catch'](_0x39d004(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xb310('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x01de=['MailInteraction','MailMessage','save','update','remove','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1ef6ce,_0x2bf76c){var _0x239b77=function(_0x2f38b6){while(--_0x2f38b6){_0x1ef6ce['push'](_0x1ef6ce['shift']());}};_0x239b77(++_0x2bf76c);}(_0x01de,0x17e));var _0xe01d=function(_0x1ccd66,_0x35197d){_0x1ccd66=_0x1ccd66-0x0;var _0x2c7b85=_0x01de[_0x1ccd66];return _0x2c7b85;};'use strict';var EventEmitter=require(_0xe01d('0x0'));var MailInteraction=require(_0xe01d('0x1'))['db'][_0xe01d('0x2')];var MailMessage=require(_0xe01d('0x1'))['db'][_0xe01d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe01d('0x4'),'afterUpdate':_0xe01d('0x5'),'afterDestroy':_0xe01d('0x6')};function emitEvent(_0x340141){return function(_0x60e505,_0x3dd788,_0x4552a3){_0x60e505['getUsers']({'attributes':['id'],'raw':!![]})[_0xe01d('0x7')](function(_0x4f4f20){_0x60e505[_0xe01d('0x8')]('Users',_0x4f4f20[_0xe01d('0x9')](function(_0x470f7a){return{'id':_0x470f7a['id']};}));return MailMessage[_0xe01d('0xa')]({'where':{'MailInteractionId':_0x60e505['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe01d('0x7')](function(_0x3e1d33){_0x60e505[_0xe01d('0x8')]('unreadMessages',_0x3e1d33[_0xe01d('0xb')]);MailInteractionEvents[_0xe01d('0xc')](_0x340141+':'+_0x60e505['id'],_0x60e505);MailInteractionEvents[_0xe01d('0xc')](_0x340141,_0x60e505);_0x4552a3(null);})[_0xe01d('0xd')](_0x4552a3(null));};}for(var e in events){if(events[_0xe01d('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xe01d('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1082e68..a6c37a9 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 _0xb0d1=['closedAt','changed','get','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x5a52dc,_0x489162){var _0x220d23=function(_0x564fb4){while(--_0x564fb4){_0x5a52dc['push'](_0x5a52dc['shift']());}};_0x220d23(++_0x489162);}(_0xb0d1,0x19f));var _0x1b0d=function(_0x53f8a2,_0xae896f){_0x53f8a2=_0x53f8a2-0x0;var _0x808873=_0xb0d1[_0x53f8a2];return _0x808873;};'use strict';var _=require('lodash');var util=require(_0x1b0d('0x0'));var logger=require(_0x1b0d('0x1'))(_0x1b0d('0x2'));var moment=require('moment');var BPromise=require(_0x1b0d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b0d('0x4'));var rimraf=require(_0x1b0d('0x5'));var config=require(_0x1b0d('0x6'));var attributes=require(_0x1b0d('0x7'));module['exports']=function(_0x27ee67,_0x3c275c){return _0x27ee67[_0x1b0d('0x8')](_0x1b0d('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1b0d('0xa'),'to'],'type':_0x1b0d('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f1e0f,_0x242956,_0x4a90e4){if(_0x3f1e0f[_0x1b0d('0xc')]){_0x3f1e0f[_0x1b0d('0xd')]=moment()[_0x1b0d('0xe')](_0x1b0d('0xf'));}if(_0x3f1e0f[_0x1b0d('0x10')]){_0x3f1e0f[_0x1b0d('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4a90e4(null,_0x242956);},'beforeUpdate':function(_0x3101cd,_0xd74a31,_0x1f9079){if(_0x3101cd[_0x1b0d('0x12')](_0x1b0d('0xc'))){_0x3101cd[_0x1b0d('0xd')]=_0x3101cd[_0x1b0d('0xc')]?moment()['format'](_0x1b0d('0xf')):null;}if(_0x3101cd[_0x1b0d('0x12')]('closed')){_0x3101cd[_0x1b0d('0x11')]=moment()[_0x1b0d('0xe')](_0x1b0d('0xf'));_0x3101cd['substatus']=null;_0x3101cd[_0x1b0d('0xd')]=null;}_0x1f9079(null,_0x3101cd);},'afterUpdate':function(_0x30eec4,_0x1f3c06,_0x5b1c4e){var _0x4aae42=_0x27ee67['models'];var _0x2d4bd0=_0x30eec4[_0x1b0d('0x13')]({'plain':!![]});if(_0x2d4bd0[_0x1b0d('0x10')]){return _0x4aae42['MailMessage'][_0x1b0d('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x2d4bd0['id']}})[_0x1b0d('0x15')](function(){_0x5b1c4e();})['catch'](function(_0x140b92){_0x5b1c4e(_0x140b92);});}else{_0x5b1c4e();}}},'charset':_0x1b0d('0x16'),'collate':_0x1b0d('0x17')});}; \ No newline at end of file +var _0x87a5=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','closed','models','MailMessage','then','utf8mb4'];(function(_0x48512a,_0x4ef668){var _0x59445a=function(_0x44edf8){while(--_0x44edf8){_0x48512a['push'](_0x48512a['shift']());}};_0x59445a(++_0x4ef668);}(_0x87a5,0xb8));var _0x587a=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x87a5[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0x587a('0x0'));var util=require(_0x587a('0x1'));var logger=require('../../config/logger')(_0x587a('0x2'));var moment=require('moment');var BPromise=require(_0x587a('0x3'));var rp=require(_0x587a('0x4'));var fs=require('fs');var path=require(_0x587a('0x5'));var rimraf=require(_0x587a('0x6'));var config=require(_0x587a('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x587a('0x8')]=function(_0x249667,_0x29c2e7){return _0x249667[_0x587a('0x9')](_0x587a('0xa'),attributes,{'tableName':_0x587a('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x269d89,_0x1003ec,_0x46fe3e){if(_0x269d89['substatus']){_0x269d89[_0x587a('0xc')]=moment()[_0x587a('0xd')](_0x587a('0xe'));}if(_0x269d89['closed']){_0x269d89[_0x587a('0xf')]=moment()[_0x587a('0xd')](_0x587a('0xe'));}_0x46fe3e(null,_0x1003ec);},'beforeUpdate':function(_0x1d948b,_0x7f7474,_0x5e3d17){if(_0x1d948b[_0x587a('0x10')](_0x587a('0x11'))){_0x1d948b[_0x587a('0xc')]=_0x1d948b[_0x587a('0x11')]?moment()[_0x587a('0xd')](_0x587a('0xe')):null;}if(_0x1d948b[_0x587a('0x10')](_0x587a('0x12'))){_0x1d948b['closedAt']=moment()[_0x587a('0xd')](_0x587a('0xe'));_0x1d948b[_0x587a('0x11')]=null;_0x1d948b[_0x587a('0xc')]=null;}_0x5e3d17(null,_0x1d948b);},'afterUpdate':function(_0x3e5a06,_0x295a29,_0x158c58){var _0x24f8c1=_0x249667[_0x587a('0x13')];var _0x2fe7ae=_0x3e5a06['get']({'plain':!![]});if(_0x2fe7ae[_0x587a('0x12')]){return _0x24f8c1[_0x587a('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x2fe7ae['id']}})[_0x587a('0x15')](function(){_0x158c58();})['catch'](function(_0x3f7fa4){_0x158c58(_0x3f7fa4);});}else{_0x158c58();}}},'charset':_0x587a('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 960daad..83a0fa5 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 _0x9134=['request\x20sent','stringify','error','code','message','MailInteraction','body','options','raw','where','limit','info','UpdateMailInteraction','catch','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then','MailInteraction,\x20%s,\x20%s','debug'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x9134,0x87));var _0x4913=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9134[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x4913('0x0'));var moment=require(_0x4913('0x1'));var BPromise=require(_0x4913('0x2'));var rs=require(_0x4913('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4913('0x4'));var logger=require(_0x4913('0x5'))(_0x4913('0x6'));var config=require(_0x4913('0x7'));var jayson=require(_0x4913('0x8'));var client=jayson[_0x4913('0x9')]['http']({'port':0x232a});config[_0x4913('0xa')]=_[_0x4913('0xb')](config[_0x4913('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4913('0xc'))(new Redis(config[_0x4913('0xa')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4d9eb2,_0xae5842,_0x57260f){return new BPromise(function(_0x28f919,_0x1c08ac){return client[_0x4913('0xd')](_0x4d9eb2,_0x57260f)[_0x4913('0xe')](function(_0x3c3272){logger['info'](_0x4913('0xf'),_0xae5842,'request\x20sent');logger[_0x4913('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0xae5842,_0x4913('0x11'),JSON[_0x4913('0x12')](_0x3c3272));if(_0x3c3272[_0x4913('0x13')]){if(_0x3c3272['error'][_0x4913('0x14')]===0x1f4){logger[_0x4913('0x13')]('MailInteraction,\x20%s,\x20%s',_0xae5842,_0x3c3272['error'][_0x4913('0x15')]);return _0x1c08ac(_0x3c3272[_0x4913('0x13')][_0x4913('0x15')]);}logger[_0x4913('0x13')]('MailInteraction,\x20%s,\x20%s',_0xae5842,_0x3c3272[_0x4913('0x13')][_0x4913('0x15')]);return _0x28f919(_0x3c3272['error'][_0x4913('0x15')]);}else{logger['info'](_0x4913('0xf'),_0xae5842,_0x4913('0x11'));_0x28f919(_0x3c3272['result'][_0x4913('0x15')]);}})['catch'](function(_0x50584a){logger[_0x4913('0x13')](_0x4913('0xf'),_0xae5842,_0x50584a);_0x1c08ac(_0x50584a);});});}exports['UpdateMailInteraction']=function(_0x52fe67){var _0x13cb5b=this;return new Promise(function(_0x50b0ef,_0xcb1c7a){return db[_0x4913('0x16')]['update'](_0x52fe67[_0x4913('0x17')],{'raw':_0x52fe67[_0x4913('0x18')]?_0x52fe67[_0x4913('0x18')][_0x4913('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52fe67[_0x4913('0x18')]?_0x52fe67[_0x4913('0x18')][_0x4913('0x1a')]||null:null,'attributes':_0x52fe67['options']?_0x52fe67[_0x4913('0x18')]['attributes']||null:null,'limit':_0x52fe67[_0x4913('0x18')]?_0x52fe67[_0x4913('0x18')][_0x4913('0x1b')]||null:null})[_0x4913('0xe')](function(_0x458139){logger[_0x4913('0x1c')](_0x4913('0x1d'),_0x52fe67);logger[_0x4913('0x10')](_0x4913('0x1d'),_0x52fe67,JSON[_0x4913('0x12')](_0x458139));_0x50b0ef(_0x458139);})[_0x4913('0x1e')](function(_0x38a4a2){logger['error'](_0x4913('0x1d'),_0x38a4a2[_0x4913('0x15')],_0x52fe67);_0xcb1c7a(_0x13cb5b['error'](0x1f4,_0x38a4a2[_0x4913('0x15')]));});});};exports[_0x4913('0x1f')]=function(_0x592e1d){return new Promise(function(_0x4e656a,_0x115f54){return db[_0x4913('0x16')][_0x4913('0x20')]({'where':_0x592e1d['options']?_0x592e1d[_0x4913('0x18')][_0x4913('0x1a')]||null:null})[_0x4913('0xe')](function(_0x20fc86){if(_0x20fc86){return _0x20fc86[_0x4913('0x21')](_0x592e1d[_0x4913('0x17')][_0x4913('0x22')],_[_0x4913('0x23')](_0x592e1d[_0x4913('0x17')],[_0x4913('0x22'),'id'])||{});}})[_0x4913('0x24')](function(_0x3ab627){logger[_0x4913('0x1c')](_0x4913('0x25'),_0x592e1d);logger['debug'](_0x4913('0x25'),_0x592e1d,JSON['stringify'](_0x3ab627));_0x4e656a(_0x3ab627);})['catch'](function(_0x2aca59){logger[_0x4913('0x13')](_0x4913('0x25'),_0x2aca59[_0x4913('0x15')],_0x592e1d);_0x115f54(_this[_0x4913('0x13')](0x1f4,_0x2aca59[_0x4913('0x15')]));});});}; \ No newline at end of file +var _0x5bf4=['client','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','result','catch','UpdateMailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','find','where','addTags','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x48c45b,_0x3194f7){var _0x2becc1=function(_0x2ed208){while(--_0x2ed208){_0x48c45b['push'](_0x48c45b['shift']());}};_0x2becc1(++_0x3194f7);}(_0x5bf4,0x6c));var _0x45bf=function(_0x1dfb35,_0x581522){_0x1dfb35=_0x1dfb35-0x0;var _0x2b5756=_0x5bf4[_0x1dfb35];return _0x2b5756;};'use strict';var _=require(_0x45bf('0x0'));var util=require('util');var moment=require(_0x45bf('0x1'));var BPromise=require('bluebird');var rs=require(_0x45bf('0x2'));var fs=require('fs');var Redis=require(_0x45bf('0x3'));var db=require(_0x45bf('0x4'))['db'];var utils=require(_0x45bf('0x5'));var logger=require(_0x45bf('0x6'))('rpc');var config=require(_0x45bf('0x7'));var jayson=require(_0x45bf('0x8'));var client=jayson[_0x45bf('0x9')]['http']({'port':0x232a});config[_0x45bf('0xa')]=_['defaults'](config[_0x45bf('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x45bf('0xb'))(new Redis(config[_0x45bf('0xa')]));require('./mailInteraction.socket')[_0x45bf('0xc')](socket);function respondWithRpcPromise(_0x2cb6e6,_0x19b6ec,_0x1fd9cc){return new BPromise(function(_0x54b563,_0x2c6067){return client[_0x45bf('0xd')](_0x2cb6e6,_0x1fd9cc)[_0x45bf('0xe')](function(_0x21a1f3){logger[_0x45bf('0xf')]('MailInteraction,\x20%s,\x20%s',_0x19b6ec,_0x45bf('0x10'));logger[_0x45bf('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x19b6ec,'request\x20sent',JSON[_0x45bf('0x12')](_0x21a1f3));if(_0x21a1f3[_0x45bf('0x13')]){if(_0x21a1f3['error'][_0x45bf('0x14')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x19b6ec,_0x21a1f3[_0x45bf('0x13')][_0x45bf('0x15')]);return _0x2c6067(_0x21a1f3[_0x45bf('0x13')][_0x45bf('0x15')]);}logger[_0x45bf('0x13')](_0x45bf('0x16'),_0x19b6ec,_0x21a1f3[_0x45bf('0x13')][_0x45bf('0x15')]);return _0x54b563(_0x21a1f3[_0x45bf('0x13')]['message']);}else{logger['info'](_0x45bf('0x16'),_0x19b6ec,'request\x20sent');_0x54b563(_0x21a1f3[_0x45bf('0x17')][_0x45bf('0x15')]);}})[_0x45bf('0x18')](function(_0xf62281){logger[_0x45bf('0x13')](_0x45bf('0x16'),_0x19b6ec,_0xf62281);_0x2c6067(_0xf62281);});});}exports[_0x45bf('0x19')]=function(_0x36f3b3){var _0x396f7a=this;return new Promise(function(_0x29c8f1,_0x4a7eb7){return db['MailInteraction'][_0x45bf('0x1a')](_0x36f3b3[_0x45bf('0x1b')],{'raw':_0x36f3b3[_0x45bf('0x1c')]?_0x36f3b3[_0x45bf('0x1c')][_0x45bf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f3b3[_0x45bf('0x1c')]?_0x36f3b3['options']['where']||null:null,'attributes':_0x36f3b3[_0x45bf('0x1c')]?_0x36f3b3['options'][_0x45bf('0x1e')]||null:null,'limit':_0x36f3b3[_0x45bf('0x1c')]?_0x36f3b3[_0x45bf('0x1c')][_0x45bf('0x1f')]||null:null})[_0x45bf('0xe')](function(_0x3966b1){logger[_0x45bf('0xf')](_0x45bf('0x19'),_0x36f3b3);logger[_0x45bf('0x11')](_0x45bf('0x19'),_0x36f3b3,JSON[_0x45bf('0x12')](_0x3966b1));_0x29c8f1(_0x3966b1);})[_0x45bf('0x18')](function(_0x1c222c){logger[_0x45bf('0x13')](_0x45bf('0x19'),_0x1c222c[_0x45bf('0x15')],_0x36f3b3);_0x4a7eb7(_0x396f7a[_0x45bf('0x13')](0x1f4,_0x1c222c[_0x45bf('0x15')]));});});};exports[_0x45bf('0x20')]=function(_0x524615){return new Promise(function(_0x27c076,_0x41c913){return db['MailInteraction'][_0x45bf('0x21')]({'where':_0x524615[_0x45bf('0x1c')]?_0x524615['options'][_0x45bf('0x22')]||null:null})['then'](function(_0x467bf1){if(_0x467bf1){return _0x467bf1[_0x45bf('0x23')](_0x524615[_0x45bf('0x1b')][_0x45bf('0x24')],_[_0x45bf('0x25')](_0x524615[_0x45bf('0x1b')],[_0x45bf('0x24'),'id'])||{});}})['spread'](function(_0x50573b){logger['info'](_0x45bf('0x26'),_0x524615);logger[_0x45bf('0x11')](_0x45bf('0x26'),_0x524615,JSON['stringify'](_0x50573b));_0x27c076(_0x50573b);})['catch'](function(_0x5a9a03){logger['error'](_0x45bf('0x26'),_0x5a9a03[_0x45bf('0x15')],_0x524615);_0x41c913(_this[_0x45bf('0x13')](0x1f4,_0x5a9a03['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 485b26c..12ffc43 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 _0xb42f=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x45b47d,_0x38c6f6){var _0x4d4165=function(_0x1affd3){while(--_0x1affd3){_0x45b47d['push'](_0x45b47d['shift']());}};_0x4d4165(++_0x38c6f6);}(_0xb42f,0x129));var _0xfb42=function(_0x5adb4e,_0x4120ee){_0x5adb4e=_0x5adb4e-0x0;var _0x48a4c8=_0xb42f[_0x5adb4e];return _0x48a4c8;};'use strict';var MailInteractionEvents=require(_0xfb42('0x0'));var events=[_0xfb42('0x1'),_0xfb42('0x2'),_0xfb42('0x3')];function createListener(_0x3b33fe,_0x2b2f6f){return function(_0x4a3acb){_0x2b2f6f[_0xfb42('0x4')](_0x3b33fe,_0x4a3acb);};}function removeListener(_0x3c593e,_0x30be08){return function(){MailInteractionEvents[_0xfb42('0x5')](_0x3c593e,_0x30be08);};}exports[_0xfb42('0x6')]=function(_0x353d19){for(var _0x63a7a0=0x0,_0x241187=events[_0xfb42('0x7')];_0x63a7a0<_0x241187;_0x63a7a0++){var _0xdd2975=events[_0x63a7a0];var _0x5ca011=createListener(_0xfb42('0x8')+_0xdd2975,_0x353d19);MailInteractionEvents['on'](_0xdd2975,_0x5ca011);}}; \ No newline at end of file +var _0xaccd=['save','remove','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaccd,0xdf));var _0xdacc=function(_0x3704f7,_0x516b7a){_0x3704f7=_0x3704f7-0x0;var _0x40c400=_0xaccd[_0x3704f7];return _0x40c400;};'use strict';var MailInteractionEvents=require(_0xdacc('0x0'));var events=[_0xdacc('0x1'),_0xdacc('0x2'),'update'];function createListener(_0x253871,_0xb91fb2){return function(_0x5a2caa){_0xb91fb2['emit'](_0x253871,_0x5a2caa);};}function removeListener(_0xc206c2,_0x1f7cf1){return function(){MailInteractionEvents[_0xdacc('0x3')](_0xc206c2,_0x1f7cf1);};}exports[_0xdacc('0x4')]=function(_0x4ff88b){for(var _0x1c0198=0x0,_0x1ce6f9=events[_0xdacc('0x5')];_0x1c0198<_0x1ce6f9;_0x1c0198++){var _0x71b280=events[_0x1c0198];var _0x2ae403=createListener(_0xdacc('0x6')+_0x71b280,_0x4ff88b);MailInteractionEvents['on'](_0x71b280,_0x2ae403);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0075fc4..aff2603 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 _0x5525=['create','put','/:id','update','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','mail','mailmessage:create'];(function(_0x351684,_0x38b00a){var _0x5f8772=function(_0x7da17a){while(--_0x7da17a){_0x351684['push'](_0x351684['shift']());}};_0x5f8772(++_0x38b00a);}(_0x5525,0xd1));var _0x5552=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5525[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var path=require(_0x5552('0x2'));var timeout=require(_0x5552('0x3'));var express=require(_0x5552('0x4'));var router=express[_0x5552('0x5')]();var fs_extra=require(_0x5552('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5552('0x7'));var config=require(_0x5552('0x8'));var controller=require('./mailMessage.controller');router[_0x5552('0x9')]('/',auth[_0x5552('0xa')](),controller[_0x5552('0xb')]);router[_0x5552('0x9')](_0x5552('0xc'),auth[_0x5552('0xa')](),controller[_0x5552('0xd')]);router[_0x5552('0x9')]('/:id',auth[_0x5552('0xa')](),controller['show']);router[_0x5552('0x9')]('/:id/download',auth[_0x5552('0xa')](),controller['download']);router['post']('/',auth[_0x5552('0xa')](),interaction['tracked'](_0x5552('0xe'),_0x5552('0xf')),controller[_0x5552('0x10')]);router[_0x5552('0x11')](_0x5552('0x12'),auth['isAuthenticated'](),controller[_0x5552('0x13')]);router['put']('/:id/accept',auth[_0x5552('0xa')](),controller[_0x5552('0x14')]);router['put']('/:id/reject',auth[_0x5552('0xa')](),controller[_0x5552('0x15')]);router[_0x5552('0x16')](_0x5552('0x12'),auth[_0x5552('0xa')](),controller[_0x5552('0x17')]);module[_0x5552('0x18')]=router; \ No newline at end of file +var _0xaebe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','tracked','mail','create','put','/:id/accept','accept','/:id/reject','exports','multer','util','path'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xaebe,0xed));var _0xeaeb=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xaebe[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0xeaeb('0x0'));var util=require(_0xeaeb('0x1'));var path=require(_0xeaeb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeaeb('0x3')]();var fs_extra=require(_0xeaeb('0x4'));var auth=require(_0xeaeb('0x5'));var interaction=require(_0xeaeb('0x6'));var config=require('../../config/environment');var controller=require(_0xeaeb('0x7'));router[_0xeaeb('0x8')]('/',auth[_0xeaeb('0x9')](),controller[_0xeaeb('0xa')]);router[_0xeaeb('0x8')]('/describe',auth[_0xeaeb('0x9')](),controller['describe']);router['get'](_0xeaeb('0xb'),auth['isAuthenticated'](),controller[_0xeaeb('0xc')]);router['get'](_0xeaeb('0xd'),auth[_0xeaeb('0x9')](),controller[_0xeaeb('0xe')]);router[_0xeaeb('0xf')]('/',auth[_0xeaeb('0x9')](),interaction[_0xeaeb('0x10')](_0xeaeb('0x11'),'mailmessage:create'),controller[_0xeaeb('0x12')]);router['put']('/:id',auth[_0xeaeb('0x9')](),controller['update']);router[_0xeaeb('0x13')](_0xeaeb('0x14'),auth[_0xeaeb('0x9')](),controller[_0xeaeb('0x15')]);router['put'](_0xeaeb('0x16'),auth[_0xeaeb('0x9')](),controller['reject']);router['delete'](_0xeaeb('0xb'),auth[_0xeaeb('0x9')](),controller['destroy']);module[_0xeaeb('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 1420b0d..d334239 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 _0xb9ee=['Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb9ee,0x1b4));var _0xeb9e=function(_0x4c00ea,_0x1cf606){_0x4c00ea=_0x4c00ea-0x0;var _0x2754b6=_0xb9ee[_0x4c00ea];return _0x2754b6;};'use strict';var Sequelize=require(_0xeb9e('0x0'));var _=require(_0xeb9e('0x1'));module[_0xeb9e('0x2')]={'body':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x5'))},'read':{'type':Sequelize[_0xeb9e('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb9e('0x7')]('in',_0xeb9e('0x8')),'defaultValue':_0xeb9e('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeb9e('0x9')](0x1fe)},'from':{'type':Sequelize[_0xeb9e('0x9')]},'to':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'cc':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'bcc':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'subject':{'type':Sequelize[_0xeb9e('0x3')]},'sentAt':{'type':Sequelize[_0xeb9e('0xa')]},'attach':{'type':Sequelize[_0xeb9e('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xeb9e('0xa')]},'originTo':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'originCc':{'type':Sequelize[_0xeb9e('0x3')](_0xeb9e('0x4'))},'originChannel':{'type':Sequelize[_0xeb9e('0x7')](_0xeb9e('0xc'),_0xeb9e('0xd')),'defaultValue':_0xeb9e('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x00ea=['BOOLEAN','ENUM','out','STRING','DATE','Email','lodash','exports','long','TEXT','medium'];(function(_0x398f3d,_0x15a094){var _0x46b3c7=function(_0x363a5f){while(--_0x363a5f){_0x398f3d['push'](_0x398f3d['shift']());}};_0x46b3c7(++_0x15a094);}(_0x00ea,0x19d));var _0xa00e=function(_0xe57602,_0x157bab){_0xe57602=_0xe57602-0x0;var _0x174290=_0x00ea[_0xe57602];return _0x174290;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa00e('0x0'));module[_0xa00e('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa00e('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xa00e('0x3')](_0xa00e('0x4'))},'read':{'type':Sequelize[_0xa00e('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa00e('0x6')]('in',_0xa00e('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa00e('0x8')](0x1fe)},'from':{'type':Sequelize[_0xa00e('0x8')]},'to':{'type':Sequelize[_0xa00e('0x3')](_0xa00e('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xa00e('0x2'))},'bcc':{'type':Sequelize[_0xa00e('0x3')]('long')},'subject':{'type':Sequelize[_0xa00e('0x3')]},'sentAt':{'type':Sequelize[_0xa00e('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa00e('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa00e('0x9')]},'originTo':{'type':Sequelize[_0xa00e('0x3')]('long')},'originCc':{'type':Sequelize[_0xa00e('0x3')](_0xa00e('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0xa00e('0xa'),'Chat'),'defaultValue':_0xa00e('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e052a34..ae38769 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 _0xa293=['[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','fullname','email','interface','download','unix','toString','root','files','tmp','server','message-%s.eml','from','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','basename','existsSync','push','readFileSync','build','writeFileSync','join','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','status','json','offset','undefined','count','set','Content-Range','then','destroy','end','sendStatus','stack','name','index','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','update','body','find','params','describe','create','out','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','server/files/attachments','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','MailInteraction','MailInteractionId','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xa293,0xc0));var _0x3a29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa293[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x3a29('0x0'));var moment=require(_0x3a29('0x1'));var BPromise=require(_0x3a29('0x2'));var util=require(_0x3a29('0x3'));var path=require(_0x3a29('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x3a29('0x5'));var htmlToText=require(_0x3a29('0x6'));var qs=require(_0x3a29('0x7'));var logger=require('../../config/logger')(_0x3a29('0x8'));var interaction_log=require(_0x3a29('0x9'))(_0x3a29('0xa'));var config=require(_0x3a29('0xb'));var db=require('../../mysqldb')['db'];config[_0x3a29('0xc')]=_[_0x3a29('0xd')](config[_0x3a29('0xc')],{'host':_0x3a29('0xe'),'port':0x18eb});var socket=require(_0x3a29('0xf'))(new Redis(config[_0x3a29('0xc')]));var htmlEntities=require(_0x3a29('0x10'));require(_0x3a29('0x11'))[_0x3a29('0x12')](socket);var jayson=require(_0x3a29('0x13'));var client=jayson[_0x3a29('0x14')][_0x3a29('0x15')]({'port':0x232c});var client9003=jayson[_0x3a29('0x14')][_0x3a29('0x15')]({'port':0x232b});var client9002=jayson['client'][_0x3a29('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x4b5393,_0x574002,_0x1f6952,_0x30e7a0){return new BPromise(function(_0x51cd1f,_0x2b2962){var _0x22f707=_0x30e7a0||client;return _0x22f707['request'](_0x4b5393,_0x1f6952)['then'](function(_0x2aaa28){logger[_0x3a29('0x16')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x3a29('0x17'));logger[_0x3a29('0x18')](_0x3a29('0x19'),_0x574002,_0x3a29('0x17'),JSON[_0x3a29('0x1a')](_0x2aaa28));if(_0x2aaa28['error']){if(_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1c')]===0x1f4){logger[_0x3a29('0x1b')](_0x3a29('0x1d'),_0x574002,_0x2aaa28['error'][_0x3a29('0x1e')]);return _0x2b2962(_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1e')]);}logger[_0x3a29('0x1b')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1e')]);return _0x51cd1f(_0x2aaa28[_0x3a29('0x1b')][_0x3a29('0x1e')]);}else{logger[_0x3a29('0x16')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x3a29('0x17'));_0x51cd1f(_0x2aaa28['result'][_0x3a29('0x1e')]);}})[_0x3a29('0x1f')](function(_0x417dbc){logger[_0x3a29('0x1b')]('MailMessage,\x20%s,\x20%s',_0x574002,_0x417dbc);_0x2b2962(_0x417dbc);});});}function respondWithResult(_0x2d335a,_0x2b6c69){_0x2b6c69=_0x2b6c69||0xc8;return function(_0x450154){if(_0x450154){return _0x2d335a[_0x3a29('0x20')](_0x2b6c69)[_0x3a29('0x21')](_0x450154);}};}function respondWithFilteredResult(_0x26d8c2,_0x30bd2f){return function(_0x565a0a){if(_0x565a0a){var _0x2faadb=typeof _0x30bd2f[_0x3a29('0x22')]===_0x3a29('0x23')&&typeof _0x30bd2f['limit']===_0x3a29('0x23');var _0x41939c=_0x565a0a[_0x3a29('0x24')];var _0x323b1e=_0x2faadb?0x0:_0x30bd2f['offset'];var _0x576350=_0x2faadb?_0x565a0a['count']:_0x30bd2f[_0x3a29('0x22')]+_0x30bd2f['limit'];var _0x597cf4;if(_0x576350>=_0x41939c){_0x576350=_0x41939c;_0x597cf4=0xc8;}else{_0x597cf4=0xce;}_0x26d8c2[_0x3a29('0x20')](_0x597cf4);return _0x26d8c2[_0x3a29('0x25')](_0x3a29('0x26'),_0x323b1e+'-'+_0x576350+'/'+_0x41939c)[_0x3a29('0x21')](_0x565a0a);}return null;};}function saveUpdates(_0x121647){return function(_0x3c23af){if(_0x3c23af){return _0x3c23af['update'](_0x121647)[_0x3a29('0x27')](function(_0x4ce86f){return _0x4ce86f;});}return null;};}function removeEntity(_0x242452){return function(_0x2a99b1){if(_0x2a99b1){return _0x2a99b1[_0x3a29('0x28')]()[_0x3a29('0x27')](function(){_0x242452[_0x3a29('0x20')](0xcc)[_0x3a29('0x29')]();});}};}function handleEntityNotFound(_0x5da448){return function(_0xebdde2){if(!_0xebdde2){_0x5da448[_0x3a29('0x2a')](0x194);}return _0xebdde2;};}function handleError(_0x8547a,_0x4df6dc){_0x4df6dc=_0x4df6dc||0x1f4;return function(_0x145fa5){logger[_0x3a29('0x1b')](_0x145fa5[_0x3a29('0x2b')]);if(_0x145fa5[_0x3a29('0x2c')]){delete _0x145fa5[_0x3a29('0x2c')];}_0x8547a['status'](_0x4df6dc)['send'](_0x145fa5);};}exports[_0x3a29('0x2d')]=function(_0x2fe8c8,_0x51651e){var _0x4d5e5e={},_0xff42b0={},_0x3c5411={'count':0x0,'rows':[]};var _0x56cf15=_['map'](db[_0x3a29('0x2e')][_0x3a29('0x2f')],function(_0x3bf90b){return{'name':_0x3bf90b[_0x3a29('0x30')],'type':_0x3bf90b[_0x3a29('0x31')]['key']};});_0xff42b0[_0x3a29('0x32')]=_['map'](_0x56cf15,'name');_0xff42b0[_0x3a29('0x33')]=_[_0x3a29('0x34')](_0x2fe8c8[_0x3a29('0x33')]);_0xff42b0[_0x3a29('0x35')]=_[_0x3a29('0x36')](_0xff42b0[_0x3a29('0x32')],_0xff42b0[_0x3a29('0x33')]);_0x4d5e5e['attributes']=_[_0x3a29('0x36')](_0xff42b0[_0x3a29('0x32')],qs[_0x3a29('0x37')](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x37')]));_0x4d5e5e[_0x3a29('0x38')]=_0x4d5e5e[_0x3a29('0x38')][_0x3a29('0x39')]?_0x4d5e5e[_0x3a29('0x38')]:_0xff42b0[_0x3a29('0x32')];if(!_0x2fe8c8['query'][_0x3a29('0x3a')](_0x3a29('0x3b'))){_0x4d5e5e[_0x3a29('0x3c')]=qs[_0x3a29('0x3c')](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x3c')]);_0x4d5e5e[_0x3a29('0x22')]=qs['offset'](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x22')]);}_0x4d5e5e[_0x3a29('0x3d')]=qs['sort'](_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x3e')]);_0x4d5e5e['where']=qs[_0x3a29('0x35')](_['pick'](_0x2fe8c8[_0x3a29('0x33')],_0xff42b0[_0x3a29('0x35')]),_0x56cf15);if(_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x3f')]){_0x4d5e5e[_0x3a29('0x40')]=_[_0x3a29('0x41')](_0x4d5e5e[_0x3a29('0x40')],{'$or':_[_0x3a29('0x42')](_0x56cf15,function(_0x15b15d){if(_0x15b15d[_0x3a29('0x31')]!==_0x3a29('0x43')){var _0x2a93d6={};_0x2a93d6[_0x15b15d[_0x3a29('0x2c')]]={'$like':'%'+_0x2fe8c8['query'][_0x3a29('0x3f')]+'%'};return _0x2a93d6;}})});}_0x4d5e5e=_['merge']({},_0x4d5e5e,_0x2fe8c8[_0x3a29('0x44')]);var _0x232c50={'where':_0x4d5e5e['where']};return db[_0x3a29('0x2e')][_0x3a29('0x24')](_0x232c50)[_0x3a29('0x27')](function(_0x266a5b){_0x3c5411[_0x3a29('0x24')]=_0x266a5b;if(_0x2fe8c8[_0x3a29('0x33')][_0x3a29('0x45')]){_0x4d5e5e[_0x3a29('0x46')]=[{'all':!![]}];}return db[_0x3a29('0x2e')][_0x3a29('0x47')](_0x4d5e5e);})[_0x3a29('0x27')](function(_0x46befd){_0x3c5411[_0x3a29('0x48')]=_0x46befd;return _0x3c5411;})[_0x3a29('0x27')](respondWithFilteredResult(_0x51651e,_0x4d5e5e))[_0x3a29('0x1f')](handleError(_0x51651e,null));};exports['show']=function(_0x8b3fad,_0x1e3315){var _0x31ed9d={'raw':!![],'where':{'id':_0x8b3fad['params']['id']}},_0xd255b0={};_0xd255b0[_0x3a29('0x32')]=_['keys'](db['MailMessage'][_0x3a29('0x2f')]);_0xd255b0['query']=_['keys'](_0x8b3fad[_0x3a29('0x33')]);_0xd255b0[_0x3a29('0x35')]=_[_0x3a29('0x36')](_0xd255b0[_0x3a29('0x32')],_0xd255b0[_0x3a29('0x33')]);_0x31ed9d[_0x3a29('0x38')]=_[_0x3a29('0x36')](_0xd255b0[_0x3a29('0x32')],qs[_0x3a29('0x37')](_0x8b3fad['query'][_0x3a29('0x37')]));_0x31ed9d[_0x3a29('0x38')]=_0x31ed9d[_0x3a29('0x38')][_0x3a29('0x39')]?_0x31ed9d['attributes']:_0xd255b0[_0x3a29('0x32')];if(_0x8b3fad[_0x3a29('0x33')]['includeAll']){_0x31ed9d['include']=[{'all':!![]}];}_0x31ed9d=_[_0x3a29('0x41')]({},_0x31ed9d,_0x8b3fad[_0x3a29('0x44')]);return db[_0x3a29('0x2e')]['find'](_0x31ed9d)[_0x3a29('0x27')](handleEntityNotFound(_0x1e3315,null))['then'](respondWithResult(_0x1e3315,null))[_0x3a29('0x1f')](handleError(_0x1e3315,null));};exports[_0x3a29('0x49')]=function(_0xb6bce3,_0x22d116){if(_0xb6bce3[_0x3a29('0x4a')]['id']){delete _0xb6bce3[_0x3a29('0x4a')]['id'];}return db['MailMessage'][_0x3a29('0x4b')]({'where':{'id':_0xb6bce3[_0x3a29('0x4c')]['id']}})[_0x3a29('0x27')](handleEntityNotFound(_0x22d116,null))[_0x3a29('0x27')](saveUpdates(_0xb6bce3[_0x3a29('0x4a')],null))['then'](respondWithResult(_0x22d116,null))['catch'](handleError(_0x22d116,null));};exports['destroy']=function(_0x1697c3,_0x50783d){return db['MailMessage'][_0x3a29('0x4b')]({'where':{'id':_0x1697c3['params']['id']}})[_0x3a29('0x27')](handleEntityNotFound(_0x50783d,null))[_0x3a29('0x27')](removeEntity(_0x50783d,null))['catch'](handleError(_0x50783d,null));};exports[_0x3a29('0x4d')]=function(_0x5682e2,_0x418e92){return db[_0x3a29('0x2e')][_0x3a29('0x4d')]()[_0x3a29('0x27')](respondWithResult(_0x418e92,null))[_0x3a29('0x1f')](handleError(_0x418e92,null));};exports[_0x3a29('0x4e')]=function(_0x3237e9,_0x216c5e){return db['MailMessage']['create'](_0x3237e9[_0x3a29('0x4a')])[_0x3a29('0x27')](function(_0x55652d){if(_0x55652d){if(_0x55652d['direction']===_0x3a29('0x4f')&&!_0x55652d[_0x3a29('0x50')]){var _0x2bff3a,_0xf80d04,_0x4650f1;if(_0x3237e9[_0x3a29('0x4a')]['to']){_0xf80d04=_0x3237e9[_0x3a29('0x4a')]['to'][_0x3a29('0x51')](',')[0x0];}return db['MailAccount'][_0x3a29('0x52')]({'where':{'id':_0x55652d[_0x3a29('0x53')]},'include':[{'model':db[_0x3a29('0x54')],'as':'List','include':[{'model':db[_0x3a29('0x55')],'as':_0x3a29('0x56'),'where':{'email':_0xf80d04},'limit':0x1,'order':[[_0x3a29('0x57'),_0x3a29('0x58')]]}]},{'model':db[_0x3a29('0x59')],'as':_0x3a29('0x5a'),'raw':!![],'include':[{'model':db[_0x3a29('0x5b')],'as':_0x3a29('0x5b'),'raw':!![]}]}]})[_0x3a29('0x27')](function(_0x107a88){_0x2bff3a=_0x107a88;if(!_0x2bff3a||!_0x2bff3a[_0x3a29('0x5a')])return;var _0x207f8c=_0x2bff3a['getSmtpOptions']();if(_0x3237e9['body'][_0x3a29('0x5c')]&&_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x3a29('0x39')]){for(var _0x549c41=0x0;_0x549c41<_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x3a29('0x39')];_0x549c41+=0x1){_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x549c41]={'filename':_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x549c41][_0x3a29('0x2c')],'path':path['join'](config['root'],_0x3a29('0x5d'),_0x3237e9[_0x3a29('0x4a')][_0x3a29('0x5c')][_0x549c41]['basename'])};}}_0x4650f1={'account':_0x207f8c,'message':_0x3237e9[_0x3a29('0x4a')]};return;})[_0x3a29('0x27')](function(){if(_0x2bff3a[_0x3a29('0x5e')]){if(_0x2bff3a[_0x3a29('0x5e')][_0x3a29('0x56')][_0x3a29('0x39')]){return _0x2bff3a[_0x3a29('0x5e')][_0x3a29('0x56')][0x0];}else{return db[_0x3a29('0x55')][_0x3a29('0x4e')](_[_0x3a29('0xd')](_0x3237e9[_0x3a29('0x4a')],{'firstName':_0x3237e9[_0x3a29('0x4a')]['to'],'email':_0x3237e9[_0x3a29('0x4a')]['to'],'phone':_0x3237e9[_0x3a29('0x4a')]['to'],'ListId':_0x2bff3a[_0x3a29('0x5f')]}));}}else{throw new Error(_0x3a29('0x60'));}})[_0x3a29('0x27')](function(){if(_0x4650f1){return respondWithRpcPromise(_0x3a29('0x61'),_0x3a29('0x62'),_0x4650f1,client9003)[_0x3a29('0x27')](function(_0x4358d2){return _0x55652d['update']({'read':!![],'messageId':_0x4358d2[_0x3a29('0x63')],'sentAt':moment()[_0x3a29('0x64')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x2c54f3){logger[_0x3a29('0x1b')]('%s',JSON['stringify'](_0x2c54f3));return _0x55652d;});}return _0x55652d;});}return _0x55652d;}})['then'](respondWithResult(_0x216c5e,0xc9))[_0x3a29('0x1f')](handleError(_0x216c5e,null));};exports[_0x3a29('0x65')]=function(_0x2b9e01,_0x2b09da){var _0x40bd54={'agent':{},'channel':'mail'};if(_0x2b9e01[_0x3a29('0x4a')]['id']){delete _0x2b9e01[_0x3a29('0x4a')]['id'];}_0x2b9e01[_0x3a29('0x4a')]['read']=!![];_0x2b9e01['body']['readAt']=moment()[_0x3a29('0x64')](_0x3a29('0x66'));_0x2b9e01['body'][_0x3a29('0x67')]=_0x2b9e01[_0x3a29('0x4a')]['UserId']||_0x2b9e01[_0x3a29('0x68')]['id'];_0x40bd54[_0x3a29('0x69')]['id']=_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x67')];return db[_0x3a29('0x2e')][_0x3a29('0x4b')]({'where':{'id':_0x2b9e01[_0x3a29('0x4c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b09da,null))[_0x3a29('0x27')](saveUpdates(_0x2b9e01[_0x3a29('0x4a')],null))['then'](function(_0x26a5b6){if(_0x26a5b6){_0x40bd54[_0x3a29('0x1e')]=_0x26a5b6['get']({'plain':!![]});return db[_0x3a29('0x6a')][_0x3a29('0x4b')]({'where':{'id':_0x26a5b6[_0x3a29('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x2b09da,null))[_0x3a29('0x27')](function(_0x2f2f4b){if(_0x2f2f4b){return _0x2f2f4b[_0x3a29('0x49')]({'UserId':_0x2b9e01[_0x3a29('0x4a')]['UserId'],'read1stAt':_['isNil'](_0x2f2f4b['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3a29('0x27')](function(_0x2e77ac){if(_0x2e77ac){_0x40bd54[_0x3a29('0x6c')]=_0x2e77ac[_0x3a29('0x6d')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b9e01[_0x3a29('0x68')]['id'],_0x2b9e01[_0x3a29('0x68')][_0x3a29('0x2c')],_0x2b9e01['user'][_0x3a29('0x6e')],_0x40bd54['interaction']['id'],_0x2b9e01[_0x3a29('0x4a')]?JSON[_0x3a29('0x1a')](_0x2b9e01['body']):_0x3a29('0x6f'));return respondWithRpcPromise(_0x3a29('0x70'),_0x3a29('0x71'),_0x40bd54);}return null;})[_0x3a29('0x27')](function(_0x23867f){var _0x496188=_0x3a29('0x72')+_0x23867f[_0x3a29('0x1e')][_0x3a29('0x73')];return db['sequelize'][_0x3a29('0x33')](_0x496188,{'type':db[_0x3a29('0x74')][_0x3a29('0x75')]['SELECT'],'raw':!![]})[_0x3a29('0x27')](function(_0x132529){return _0x132529;});})[_0x3a29('0x27')](function(_0x31014d){if(_0x31014d){_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x76')]=_0x31014d[0x0];if(!_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x67')])return;return db['User'][_0x3a29('0x4b')]({'where':{'id':_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x67')],'role':'agent'},'attributes':['id','name','fullname','email',_0x3a29('0x77')],'raw':!![]});}return null;})[_0x3a29('0x27')](function(_0x91fa4b){if(!_0x91fa4b)return null;_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x69')]=_0x91fa4b;return _0x40bd54;})[_0x3a29('0x27')](function(_0xef14db){if(_0xef14db){if(_0x2b9e01[_0x3a29('0x4a')][_0x3a29('0x78')]){_0x40bd54['message']['interface']=util[_0x3a29('0x64')](_0x3a29('0x79'),_0x2b9e01[_0x3a29('0x68')][_0x3a29('0x2c')]);_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x7a')]=_0x40bd54[_0x3a29('0x7a')];_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x7b')]=_0x40bd54[_0x3a29('0x7a')];_0x40bd54[_0x3a29('0x1e')][_0x3a29('0x7c')]=_0x3a29('0x65');_0x40bd54['message'][_0x3a29('0x4a')]=htmlToText[_0x3a29('0x7d')](_0x40bd54[_0x3a29('0x1e')]['body']);return respondWithRpcPromise(_0x3a29('0x7e'),_0x3a29('0x7e'),{'event':'acceptmessage','message':_0x40bd54[_0x3a29('0x1e')]},client9002)[_0x3a29('0x27')](function(){return _0x40bd54;});}return _0x40bd54;}return null;})[_0x3a29('0x27')](respondWithResult(_0x2b09da,null))['catch'](handleError(_0x2b09da,null));};exports[_0x3a29('0x7f')]=function(_0x4fba39,_0x53862c){var _0x4314f7={'agent':{},'channel':'mail'};if(_0x4fba39[_0x3a29('0x4a')]['id']){delete _0x4fba39[_0x3a29('0x4a')]['id'];}_0x4fba39[_0x3a29('0x4a')]['UserId']=_0x4fba39[_0x3a29('0x4a')][_0x3a29('0x67')]||_0x4fba39[_0x3a29('0x68')]['id'];_0x4314f7[_0x3a29('0x69')]['id']=_0x4fba39[_0x3a29('0x4a')]['UserId'];return db[_0x3a29('0x2e')][_0x3a29('0x4b')]({'where':{'id':_0x4fba39['params']['id'],'UserId':null}})[_0x3a29('0x27')](handleEntityNotFound(_0x53862c,null))[_0x3a29('0x27')](function(_0x4fa937){if(_0x4fa937){_0x4314f7[_0x3a29('0x1e')]=_0x4fa937[_0x3a29('0x6d')]({'plain':!![]});return db[_0x3a29('0x6a')][_0x3a29('0x4b')]({'where':{'id':_0x4fa937[_0x3a29('0x6b')]}});}return null;})[_0x3a29('0x27')](handleEntityNotFound(_0x53862c,null))[_0x3a29('0x27')](function(_0x1ddcb0){if(_0x1ddcb0){_0x4314f7[_0x3a29('0x6c')]=_0x1ddcb0['get']({'plain':!![]});interaction_log['info'](_0x3a29('0x80'),_0x4fba39[_0x3a29('0x68')]['id'],_0x4fba39[_0x3a29('0x68')]['name'],_0x4fba39[_0x3a29('0x68')]['role'],_0x4314f7[_0x3a29('0x6c')]['id'],_0x4fba39[_0x3a29('0x4a')]?JSON[_0x3a29('0x1a')](_0x4fba39[_0x3a29('0x4a')]):'null');return respondWithRpcPromise(_0x3a29('0x81'),_0x3a29('0x82'),_0x4314f7);}return null;})[_0x3a29('0x27')](function(_0x536383){var _0x1c9431='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x536383[_0x3a29('0x1e')][_0x3a29('0x73')];return db['sequelize']['query'](_0x1c9431,{'type':db['Sequelize'][_0x3a29('0x75')][_0x3a29('0x83')],'raw':!![]})[_0x3a29('0x27')](function(_0xe7ea18){return _0xe7ea18;});})[_0x3a29('0x27')](function(_0x55e202){if(_0x55e202){_0x4314f7['message'][_0x3a29('0x76')]=_0x55e202[0x0];if(!_0x4fba39[_0x3a29('0x4a')]['UserId'])return;return db[_0x3a29('0x84')][_0x3a29('0x4b')]({'where':{'id':_0x4fba39[_0x3a29('0x4a')][_0x3a29('0x67')],'role':_0x3a29('0x69')},'attributes':['id',_0x3a29('0x2c'),_0x3a29('0x85'),_0x3a29('0x86'),'internal'],'raw':!![]});}return null;})['then'](function(_0xf5d6a0){if(!_0xf5d6a0)return null;_0x4314f7[_0x3a29('0x1e')][_0x3a29('0x69')]=_0xf5d6a0;return _0x4314f7;})[_0x3a29('0x27')](function(_0x2f18f8){if(_0x2f18f8){_0x2f18f8[_0x3a29('0x1e')][_0x3a29('0x87')]=util[_0x3a29('0x64')](_0x3a29('0x79'),_0x4fba39[_0x3a29('0x68')]['name']);_0x2f18f8['message'][_0x3a29('0x7a')]=_0x4314f7[_0x3a29('0x7a')];_0x2f18f8[_0x3a29('0x1e')][_0x3a29('0x7b')]=_0x4314f7[_0x3a29('0x7a')];_0x2f18f8[_0x3a29('0x1e')][_0x3a29('0x7c')]=_0x3a29('0x7f');_0x2f18f8['message']['body']=htmlToText[_0x3a29('0x7d')](_0x4314f7[_0x3a29('0x1e')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x2f18f8[_0x3a29('0x1e')]},client9002);return _0x4314f7;}return null;})[_0x3a29('0x27')](respondWithResult(_0x53862c,null))[_0x3a29('0x1f')](handleError(_0x53862c,null));};exports[_0x3a29('0x88')]=function(_0x5e2cf1,_0x15a8ec){var _0x426d9d=moment()[_0x3a29('0x89')]()[_0x3a29('0x8a')]();var _0x11e635=path['join'](config[_0x3a29('0x8b')],'server',_0x3a29('0x8c'),_0x3a29('0x8d'));var _0x2a4df2=path['join'](config[_0x3a29('0x8b')],_0x3a29('0x8e'),_0x3a29('0x8c'),_0x3a29('0x5c'));var _0x15fedd=util['format'](_0x3a29('0x8f'),_0x426d9d);return db[_0x3a29('0x2e')][_0x3a29('0x4b')]({'where':{'id':_0x5e2cf1[_0x3a29('0x4c')]['id']},'attributes':['id',_0x3a29('0x4a'),_0x3a29('0x90'),'to','cc','bcc','subject',_0x3a29('0x91')],'include':_0x5e2cf1['query'][_0x3a29('0x5c')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x15a8ec,null))[_0x3a29('0x27')](function(_0x270df6){if(_0x270df6){var _0x5029ff=_0x270df6;var _0x582afc={'from':_0x5029ff[_0x3a29('0x90')],'to':_0x5029ff['to'],'subject':_0x5029ff['subject'],'html':htmlEntities[_0x3a29('0x92')](_0x5029ff[_0x3a29('0x4a')]),'headers':{'Date':moment(_0x5029ff[_0x3a29('0x91')])['format'](_0x3a29('0x93'))},'attachments':[]};if(_0x270df6['cc']){_0x582afc[_0x3a29('0x94')]['Cc']=_0x270df6['cc'];}if(_0x270df6[_0x3a29('0x95')]){_0x582afc[_0x3a29('0x94')][_0x3a29('0x96')]=_0x270df6[_0x3a29('0x95')];}return new BPromise(function(_0x1f3753,_0x11b0e9){if(_0x270df6['Attachments']){for(var _0x52f665=0x0;_0x52f665<_0x270df6['Attachments'][_0x3a29('0x39')];_0x52f665++){var _0x398ef4=_0x270df6[_0x3a29('0x97')][_0x52f665];var _0x339480=path['join'](_0x2a4df2,_0x398ef4[_0x3a29('0x98')]);if(fs[_0x3a29('0x99')](_0x339480)){_0x582afc[_0x3a29('0x5c')][_0x3a29('0x9a')]({'name':_0x398ef4['name'],'contentType':_0x398ef4[_0x3a29('0x31')],'data':fs[_0x3a29('0x9b')](_0x339480)});}}}emlformat[_0x3a29('0x9c')](_0x582afc,function(_0x2c07ab,_0x41d2a7){if(_0x2c07ab)return _0x11b0e9(_0x2c07ab);fs[_0x3a29('0x9d')](path[_0x3a29('0x9e')](_0x11e635,_0x15fedd),_0x41d2a7);return _0x1f3753(_0x41d2a7);});});}})['then'](function(_0x9fa70d){if(_0x9fa70d){return _0x15a8ec[_0x3a29('0x88')](path[_0x3a29('0x9e')](_0x11e635,_0x15fedd),_0x15fedd,function(_0x2c2ab6){if(!_0x2c2ab6)fs[_0x3a29('0x9f')](path[_0x3a29('0x9e')](_0x11e635,_0x15fedd));});}})[_0x3a29('0x1f')](handleError(_0x15a8ec,null));}; \ No newline at end of file +var _0xb144=['readAt','UserId','agent','get','MailInteractionId','read1stAt','interaction','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT','contact','event','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','readFileSync','writeFileSync','eml-format','bluebird','util','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','register','client','http','request','then','request\x20sent','debug','stringify','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','count','limit','Content-Range','update','destroy','end','sendStatus','name','send','index','MailMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','length','attributes','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','find','body','describe','create','out','secret','split','MailAccount','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','read'];(function(_0x56e0e5,_0x2e3937){var _0x27bb15=function(_0x186336){while(--_0x186336){_0x56e0e5['push'](_0x56e0e5['shift']());}};_0x27bb15(++_0x2e3937);}(_0xb144,0x16a));var _0x4b14=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb144[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x4b14('0x0'));var moment=require('moment');var BPromise=require(_0x4b14('0x1'));var util=require(_0x4b14('0x2'));var path=require(_0x4b14('0x3'));var fs=require('fs');var _=require(_0x4b14('0x4'));var Redis=require(_0x4b14('0x5'));var htmlToText=require(_0x4b14('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4b14('0x7'));var interaction_log=require(_0x4b14('0x8'))(_0x4b14('0x9'));var config=require(_0x4b14('0xa'));var db=require(_0x4b14('0xb'))['db'];config[_0x4b14('0xc')]=_[_0x4b14('0xd')](config[_0x4b14('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b14('0xe'))(new Redis(config[_0x4b14('0xc')]));var htmlEntities=require(_0x4b14('0xf'));require('./mailMessage.socket')[_0x4b14('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4b14('0x11')][_0x4b14('0x12')]({'port':0x232c});var client9003=jayson[_0x4b14('0x11')][_0x4b14('0x12')]({'port':0x232b});var client9002=jayson[_0x4b14('0x11')][_0x4b14('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x23ded5,_0x3e53cd,_0x4a1c16,_0x1ad4cc){return new BPromise(function(_0x575ad6,_0x1d2088){var _0x2e1804=_0x1ad4cc||client;return _0x2e1804[_0x4b14('0x13')](_0x23ded5,_0x4a1c16)[_0x4b14('0x14')](function(_0x963791){logger['info']('MailMessage,\x20%s,\x20%s',_0x3e53cd,_0x4b14('0x15'));logger[_0x4b14('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x3e53cd,_0x4b14('0x15'),JSON[_0x4b14('0x17')](_0x963791));if(_0x963791[_0x4b14('0x18')]){if(_0x963791[_0x4b14('0x18')]['code']===0x1f4){logger[_0x4b14('0x18')](_0x4b14('0x19'),_0x3e53cd,_0x963791['error']['message']);return _0x1d2088(_0x963791['error'][_0x4b14('0x1a')]);}logger[_0x4b14('0x18')](_0x4b14('0x19'),_0x3e53cd,_0x963791[_0x4b14('0x18')][_0x4b14('0x1a')]);return _0x575ad6(_0x963791[_0x4b14('0x18')][_0x4b14('0x1a')]);}else{logger[_0x4b14('0x1b')](_0x4b14('0x19'),_0x3e53cd,_0x4b14('0x15'));_0x575ad6(_0x963791[_0x4b14('0x1c')][_0x4b14('0x1a')]);}})[_0x4b14('0x1d')](function(_0x17bc75){logger[_0x4b14('0x18')](_0x4b14('0x19'),_0x3e53cd,_0x17bc75);_0x1d2088(_0x17bc75);});});}function respondWithResult(_0x2f4f75,_0x41ffd8){_0x41ffd8=_0x41ffd8||0xc8;return function(_0x2d530a){if(_0x2d530a){return _0x2f4f75[_0x4b14('0x1e')](_0x41ffd8)[_0x4b14('0x1f')](_0x2d530a);}};}function respondWithFilteredResult(_0x63d54,_0x2a1b28){return function(_0x379e82){if(_0x379e82){var _0x1c631d=typeof _0x2a1b28[_0x4b14('0x20')]===_0x4b14('0x21')&&typeof _0x2a1b28['limit']===_0x4b14('0x21');var _0x4215bb=_0x379e82['count'];var _0x49b0cf=_0x1c631d?0x0:_0x2a1b28[_0x4b14('0x20')];var _0x389116=_0x1c631d?_0x379e82[_0x4b14('0x22')]:_0x2a1b28[_0x4b14('0x20')]+_0x2a1b28[_0x4b14('0x23')];var _0x4402;if(_0x389116>=_0x4215bb){_0x389116=_0x4215bb;_0x4402=0xc8;}else{_0x4402=0xce;}_0x63d54[_0x4b14('0x1e')](_0x4402);return _0x63d54['set'](_0x4b14('0x24'),_0x49b0cf+'-'+_0x389116+'/'+_0x4215bb)['json'](_0x379e82);}return null;};}function saveUpdates(_0x5cd548){return function(_0x274c66){if(_0x274c66){return _0x274c66[_0x4b14('0x25')](_0x5cd548)['then'](function(_0x17a74c){return _0x17a74c;});}return null;};}function removeEntity(_0x96f725){return function(_0x5160e4){if(_0x5160e4){return _0x5160e4[_0x4b14('0x26')]()[_0x4b14('0x14')](function(){_0x96f725['status'](0xcc)[_0x4b14('0x27')]();});}};}function handleEntityNotFound(_0x3f6a10){return function(_0x114dd3){if(!_0x114dd3){_0x3f6a10[_0x4b14('0x28')](0x194);}return _0x114dd3;};}function handleError(_0x51df3f,_0x28baa1){_0x28baa1=_0x28baa1||0x1f4;return function(_0x5b4114){logger['error'](_0x5b4114['stack']);if(_0x5b4114[_0x4b14('0x29')]){delete _0x5b4114[_0x4b14('0x29')];}_0x51df3f[_0x4b14('0x1e')](_0x28baa1)[_0x4b14('0x2a')](_0x5b4114);};}exports[_0x4b14('0x2b')]=function(_0xd4cd46,_0x2e7a89){var _0x52fcb0={},_0x52499d={},_0x405f13={'count':0x0,'rows':[]};var _0x52c33b=_['map'](db[_0x4b14('0x2c')][_0x4b14('0x2d')],function(_0x216bf1){return{'name':_0x216bf1[_0x4b14('0x2e')],'type':_0x216bf1[_0x4b14('0x2f')]['key']};});_0x52499d[_0x4b14('0x30')]=_['map'](_0x52c33b,'name');_0x52499d['query']=_[_0x4b14('0x31')](_0xd4cd46[_0x4b14('0x32')]);_0x52499d[_0x4b14('0x33')]=_[_0x4b14('0x34')](_0x52499d[_0x4b14('0x30')],_0x52499d[_0x4b14('0x32')]);_0x52fcb0['attributes']=_['intersection'](_0x52499d[_0x4b14('0x30')],qs[_0x4b14('0x35')](_0xd4cd46['query'][_0x4b14('0x35')]));_0x52fcb0['attributes']=_0x52fcb0['attributes'][_0x4b14('0x36')]?_0x52fcb0[_0x4b14('0x37')]:_0x52499d[_0x4b14('0x30')];if(!_0xd4cd46[_0x4b14('0x32')]['hasOwnProperty'](_0x4b14('0x38'))){_0x52fcb0[_0x4b14('0x23')]=qs[_0x4b14('0x23')](_0xd4cd46[_0x4b14('0x32')][_0x4b14('0x23')]);_0x52fcb0[_0x4b14('0x20')]=qs[_0x4b14('0x20')](_0xd4cd46[_0x4b14('0x32')][_0x4b14('0x20')]);}_0x52fcb0['order']=qs[_0x4b14('0x39')](_0xd4cd46[_0x4b14('0x32')]['sort']);_0x52fcb0[_0x4b14('0x3a')]=qs[_0x4b14('0x33')](_[_0x4b14('0x3b')](_0xd4cd46['query'],_0x52499d[_0x4b14('0x33')]),_0x52c33b);if(_0xd4cd46['query']['filter']){_0x52fcb0['where']=_[_0x4b14('0x3c')](_0x52fcb0[_0x4b14('0x3a')],{'$or':_[_0x4b14('0x3d')](_0x52c33b,function(_0x250dd4){if(_0x250dd4[_0x4b14('0x2f')]!==_0x4b14('0x3e')){var _0x4788b8={};_0x4788b8[_0x250dd4[_0x4b14('0x29')]]={'$like':'%'+_0xd4cd46[_0x4b14('0x32')][_0x4b14('0x3f')]+'%'};return _0x4788b8;}})});}_0x52fcb0=_['merge']({},_0x52fcb0,_0xd4cd46['options']);var _0xad2f3b={'where':_0x52fcb0[_0x4b14('0x3a')]};return db['MailMessage'][_0x4b14('0x22')](_0xad2f3b)[_0x4b14('0x14')](function(_0x2be400){_0x405f13[_0x4b14('0x22')]=_0x2be400;if(_0xd4cd46[_0x4b14('0x32')][_0x4b14('0x40')]){_0x52fcb0[_0x4b14('0x41')]=[{'all':!![]}];}return db['MailMessage'][_0x4b14('0x42')](_0x52fcb0);})[_0x4b14('0x14')](function(_0x2549a3){_0x405f13[_0x4b14('0x43')]=_0x2549a3;return _0x405f13;})[_0x4b14('0x14')](respondWithFilteredResult(_0x2e7a89,_0x52fcb0))[_0x4b14('0x1d')](handleError(_0x2e7a89,null));};exports['show']=function(_0x439ab8,_0x5fe18e){var _0x177e35={'raw':!![],'where':{'id':_0x439ab8[_0x4b14('0x44')]['id']}},_0x48018f={};_0x48018f[_0x4b14('0x30')]=_[_0x4b14('0x31')](db[_0x4b14('0x2c')]['rawAttributes']);_0x48018f[_0x4b14('0x32')]=_[_0x4b14('0x31')](_0x439ab8[_0x4b14('0x32')]);_0x48018f[_0x4b14('0x33')]=_[_0x4b14('0x34')](_0x48018f[_0x4b14('0x30')],_0x48018f[_0x4b14('0x32')]);_0x177e35[_0x4b14('0x37')]=_[_0x4b14('0x34')](_0x48018f[_0x4b14('0x30')],qs[_0x4b14('0x35')](_0x439ab8['query'][_0x4b14('0x35')]));_0x177e35[_0x4b14('0x37')]=_0x177e35[_0x4b14('0x37')]['length']?_0x177e35[_0x4b14('0x37')]:_0x48018f[_0x4b14('0x30')];if(_0x439ab8[_0x4b14('0x32')]['includeAll']){_0x177e35[_0x4b14('0x41')]=[{'all':!![]}];}_0x177e35=_['merge']({},_0x177e35,_0x439ab8[_0x4b14('0x45')]);return db[_0x4b14('0x2c')][_0x4b14('0x46')](_0x177e35)[_0x4b14('0x14')](handleEntityNotFound(_0x5fe18e,null))['then'](respondWithResult(_0x5fe18e,null))[_0x4b14('0x1d')](handleError(_0x5fe18e,null));};exports[_0x4b14('0x25')]=function(_0x331aa7,_0x10cc6a){if(_0x331aa7[_0x4b14('0x47')]['id']){delete _0x331aa7[_0x4b14('0x47')]['id'];}return db[_0x4b14('0x2c')][_0x4b14('0x46')]({'where':{'id':_0x331aa7[_0x4b14('0x44')]['id']}})['then'](handleEntityNotFound(_0x10cc6a,null))[_0x4b14('0x14')](saveUpdates(_0x331aa7[_0x4b14('0x47')],null))[_0x4b14('0x14')](respondWithResult(_0x10cc6a,null))[_0x4b14('0x1d')](handleError(_0x10cc6a,null));};exports[_0x4b14('0x26')]=function(_0x349c8e,_0xe410a7){return db[_0x4b14('0x2c')][_0x4b14('0x46')]({'where':{'id':_0x349c8e['params']['id']}})['then'](handleEntityNotFound(_0xe410a7,null))[_0x4b14('0x14')](removeEntity(_0xe410a7,null))[_0x4b14('0x1d')](handleError(_0xe410a7,null));};exports['describe']=function(_0x3a1f79,_0x47a3a1){return db[_0x4b14('0x2c')][_0x4b14('0x48')]()[_0x4b14('0x14')](respondWithResult(_0x47a3a1,null))[_0x4b14('0x1d')](handleError(_0x47a3a1,null));};exports['create']=function(_0x1e7318,_0x132e8e){return db['MailMessage'][_0x4b14('0x49')](_0x1e7318['body'])[_0x4b14('0x14')](function(_0x5cb0c2){if(_0x5cb0c2){if(_0x5cb0c2['direction']===_0x4b14('0x4a')&&!_0x5cb0c2[_0x4b14('0x4b')]){var _0x24c573,_0x306e02,_0x349616;if(_0x1e7318['body']['to']){_0x306e02=_0x1e7318[_0x4b14('0x47')]['to'][_0x4b14('0x4c')](',')[0x0];}return db[_0x4b14('0x4d')]['findOne']({'where':{'id':_0x5cb0c2['MailAccountId']},'include':[{'model':db[_0x4b14('0x4e')],'as':_0x4b14('0x4f'),'include':[{'model':db[_0x4b14('0x50')],'as':_0x4b14('0x51'),'where':{'email':_0x306e02},'limit':0x1,'order':[[_0x4b14('0x52'),_0x4b14('0x53')]]}]},{'model':db[_0x4b14('0x54')],'as':_0x4b14('0x55'),'raw':!![],'include':[{'model':db[_0x4b14('0x56')],'as':_0x4b14('0x56'),'raw':!![]}]}]})[_0x4b14('0x14')](function(_0x2a7af1){_0x24c573=_0x2a7af1;if(!_0x24c573||!_0x24c573[_0x4b14('0x55')])return;var _0x31cc0f=_0x24c573[_0x4b14('0x57')]();if(_0x1e7318[_0x4b14('0x47')][_0x4b14('0x58')]&&_0x1e7318['body'][_0x4b14('0x58')][_0x4b14('0x36')]){for(var _0x1c33de=0x0;_0x1c33de<_0x1e7318[_0x4b14('0x47')]['attachments'][_0x4b14('0x36')];_0x1c33de+=0x1){_0x1e7318[_0x4b14('0x47')][_0x4b14('0x58')][_0x1c33de]={'filename':_0x1e7318[_0x4b14('0x47')][_0x4b14('0x58')][_0x1c33de][_0x4b14('0x29')],'path':path['join'](config[_0x4b14('0x59')],_0x4b14('0x5a'),_0x1e7318[_0x4b14('0x47')][_0x4b14('0x58')][_0x1c33de][_0x4b14('0x5b')])};}}_0x349616={'account':_0x31cc0f,'message':_0x1e7318['body']};return;})[_0x4b14('0x14')](function(){if(_0x24c573['List']){if(_0x24c573[_0x4b14('0x4f')][_0x4b14('0x51')][_0x4b14('0x36')]){return _0x24c573['List']['Contacts'][0x0];}else{return db['CmContact'][_0x4b14('0x49')](_[_0x4b14('0xd')](_0x1e7318['body'],{'firstName':_0x1e7318['body']['to'],'email':_0x1e7318[_0x4b14('0x47')]['to'],'phone':_0x1e7318[_0x4b14('0x47')]['to'],'ListId':_0x24c573[_0x4b14('0x5c')]}));}}else{throw new Error(_0x4b14('0x5d'));}})[_0x4b14('0x14')](function(){if(_0x349616){return respondWithRpcPromise(_0x4b14('0x5e'),_0x4b14('0x5f'),_0x349616,client9003)[_0x4b14('0x14')](function(_0x49575b){return _0x5cb0c2['update']({'read':!![],'messageId':_0x49575b[_0x4b14('0x60')],'sentAt':moment()[_0x4b14('0x61')](_0x4b14('0x62'))});})[_0x4b14('0x1d')](function(_0x3d122f){logger[_0x4b14('0x18')]('%s',JSON[_0x4b14('0x17')](_0x3d122f));return _0x5cb0c2;});}return _0x5cb0c2;});}return _0x5cb0c2;}})[_0x4b14('0x14')](respondWithResult(_0x132e8e,0xc9))[_0x4b14('0x1d')](handleError(_0x132e8e,null));};exports['accept']=function(_0x55440f,_0x49477e){var _0x527237={'agent':{},'channel':'mail'};if(_0x55440f['body']['id']){delete _0x55440f[_0x4b14('0x47')]['id'];}_0x55440f['body'][_0x4b14('0x63')]=!![];_0x55440f[_0x4b14('0x47')][_0x4b14('0x64')]=moment()['format'](_0x4b14('0x62'));_0x55440f[_0x4b14('0x47')][_0x4b14('0x65')]=_0x55440f[_0x4b14('0x47')]['UserId']||_0x55440f['user']['id'];_0x527237[_0x4b14('0x66')]['id']=_0x55440f[_0x4b14('0x47')][_0x4b14('0x65')];return db['MailMessage']['find']({'where':{'id':_0x55440f[_0x4b14('0x44')]['id'],'UserId':null}})[_0x4b14('0x14')](handleEntityNotFound(_0x49477e,null))[_0x4b14('0x14')](saveUpdates(_0x55440f[_0x4b14('0x47')],null))['then'](function(_0x45fee0){if(_0x45fee0){_0x527237[_0x4b14('0x1a')]=_0x45fee0[_0x4b14('0x67')]({'plain':!![]});return db['MailInteraction'][_0x4b14('0x46')]({'where':{'id':_0x45fee0[_0x4b14('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x49477e,null))[_0x4b14('0x14')](function(_0xd5fe42){if(_0xd5fe42){return _0xd5fe42[_0x4b14('0x25')]({'UserId':_0x55440f[_0x4b14('0x47')]['UserId'],'read1stAt':_['isNil'](_0xd5fe42[_0x4b14('0x69')])?moment()[_0x4b14('0x61')](_0x4b14('0x62')):undefined});}return null;})[_0x4b14('0x14')](function(_0x1b5daf){if(_0x1b5daf){_0x527237[_0x4b14('0x6a')]=_0x1b5daf[_0x4b14('0x67')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55440f[_0x4b14('0x6b')]['id'],_0x55440f['user'][_0x4b14('0x29')],_0x55440f[_0x4b14('0x6b')][_0x4b14('0x6c')],_0x527237[_0x4b14('0x6a')]['id'],_0x55440f[_0x4b14('0x47')]?JSON[_0x4b14('0x17')](_0x55440f[_0x4b14('0x47')]):_0x4b14('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x4b14('0x6e'),_0x527237);}return null;})[_0x4b14('0x14')](function(_0x2a8308){var _0x191292=_0x4b14('0x6f')+_0x2a8308[_0x4b14('0x1a')]['ContactId'];return db[_0x4b14('0x70')][_0x4b14('0x32')](_0x191292,{'type':db[_0x4b14('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x4b14('0x14')](function(_0x292197){return _0x292197;});})[_0x4b14('0x14')](function(_0x2961b8){if(_0x2961b8){_0x527237[_0x4b14('0x1a')]['contact']=_0x2961b8[0x0];if(!_0x55440f[_0x4b14('0x47')][_0x4b14('0x65')])return;return db[_0x4b14('0x72')][_0x4b14('0x46')]({'where':{'id':_0x55440f[_0x4b14('0x47')][_0x4b14('0x65')],'role':_0x4b14('0x66')},'attributes':['id',_0x4b14('0x29'),_0x4b14('0x73'),_0x4b14('0x74'),_0x4b14('0x75')],'raw':!![]});}return null;})[_0x4b14('0x14')](function(_0x16cd58){if(!_0x16cd58)return null;_0x527237[_0x4b14('0x1a')]['agent']=_0x16cd58;return _0x527237;})[_0x4b14('0x14')](function(_0x6129e3){if(_0x6129e3){if(_0x55440f[_0x4b14('0x47')][_0x4b14('0x76')]){_0x527237[_0x4b14('0x1a')][_0x4b14('0x77')]=util[_0x4b14('0x61')](_0x4b14('0x78'),_0x55440f['user'][_0x4b14('0x29')]);_0x527237['message'][_0x4b14('0x79')]=_0x527237[_0x4b14('0x79')];_0x527237[_0x4b14('0x1a')][_0x4b14('0x7a')]=_0x527237[_0x4b14('0x79')];_0x527237[_0x4b14('0x1a')]['event']=_0x4b14('0x7b');_0x527237[_0x4b14('0x1a')][_0x4b14('0x47')]=htmlToText[_0x4b14('0x7c')](_0x527237['message']['body']);return respondWithRpcPromise(_0x4b14('0x7d'),_0x4b14('0x7d'),{'event':_0x4b14('0x7e'),'message':_0x527237[_0x4b14('0x1a')]},client9002)[_0x4b14('0x14')](function(){return _0x527237;});}return _0x527237;}return null;})['then'](respondWithResult(_0x49477e,null))[_0x4b14('0x1d')](handleError(_0x49477e,null));};exports[_0x4b14('0x7f')]=function(_0x141b93,_0x5255be){var _0x4a26e6={'agent':{},'channel':_0x4b14('0x80')};if(_0x141b93[_0x4b14('0x47')]['id']){delete _0x141b93[_0x4b14('0x47')]['id'];}_0x141b93['body']['UserId']=_0x141b93['body'][_0x4b14('0x65')]||_0x141b93[_0x4b14('0x6b')]['id'];_0x4a26e6[_0x4b14('0x66')]['id']=_0x141b93[_0x4b14('0x47')][_0x4b14('0x65')];return db[_0x4b14('0x2c')]['find']({'where':{'id':_0x141b93['params']['id'],'UserId':null}})[_0x4b14('0x14')](handleEntityNotFound(_0x5255be,null))[_0x4b14('0x14')](function(_0x4794c3){if(_0x4794c3){_0x4a26e6[_0x4b14('0x1a')]=_0x4794c3['get']({'plain':!![]});return db[_0x4b14('0x81')][_0x4b14('0x46')]({'where':{'id':_0x4794c3[_0x4b14('0x68')]}});}return null;})[_0x4b14('0x14')](handleEntityNotFound(_0x5255be,null))[_0x4b14('0x14')](function(_0x3f0d16){if(_0x3f0d16){_0x4a26e6[_0x4b14('0x6a')]=_0x3f0d16[_0x4b14('0x67')]({'plain':!![]});interaction_log[_0x4b14('0x1b')](_0x4b14('0x82'),_0x141b93['user']['id'],_0x141b93['user'][_0x4b14('0x29')],_0x141b93['user'][_0x4b14('0x6c')],_0x4a26e6[_0x4b14('0x6a')]['id'],_0x141b93['body']?JSON[_0x4b14('0x17')](_0x141b93[_0x4b14('0x47')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4a26e6);}return null;})[_0x4b14('0x14')](function(_0x5775c3){var _0x30d2d2=_0x4b14('0x6f')+_0x5775c3['message']['ContactId'];return db['sequelize'][_0x4b14('0x32')](_0x30d2d2,{'type':db[_0x4b14('0x71')]['QueryTypes'][_0x4b14('0x83')],'raw':!![]})[_0x4b14('0x14')](function(_0x5e86e6){return _0x5e86e6;});})[_0x4b14('0x14')](function(_0x1f07ea){if(_0x1f07ea){_0x4a26e6[_0x4b14('0x1a')][_0x4b14('0x84')]=_0x1f07ea[0x0];if(!_0x141b93[_0x4b14('0x47')][_0x4b14('0x65')])return;return db[_0x4b14('0x72')]['find']({'where':{'id':_0x141b93[_0x4b14('0x47')][_0x4b14('0x65')],'role':'agent'},'attributes':['id','name',_0x4b14('0x73'),_0x4b14('0x74'),_0x4b14('0x75')],'raw':!![]});}return null;})['then'](function(_0x1dda7b){if(!_0x1dda7b)return null;_0x4a26e6['message']['agent']=_0x1dda7b;return _0x4a26e6;})['then'](function(_0xf7554){if(_0xf7554){_0xf7554[_0x4b14('0x1a')]['interface']=util[_0x4b14('0x61')]('SIP/%s',_0x141b93[_0x4b14('0x6b')][_0x4b14('0x29')]);_0xf7554[_0x4b14('0x1a')][_0x4b14('0x79')]=_0x4a26e6[_0x4b14('0x79')];_0xf7554['message'][_0x4b14('0x7a')]=_0x4a26e6['channel'];_0xf7554['message'][_0x4b14('0x85')]=_0x4b14('0x7f');_0xf7554[_0x4b14('0x1a')][_0x4b14('0x47')]=htmlToText['fromString'](_0x4a26e6[_0x4b14('0x1a')][_0x4b14('0x47')]);respondWithRpcPromise(_0x4b14('0x7d'),_0x4b14('0x7d'),{'event':_0x4b14('0x86'),'message':_0xf7554[_0x4b14('0x1a')]},client9002);return _0x4a26e6;}return null;})[_0x4b14('0x14')](respondWithResult(_0x5255be,null))[_0x4b14('0x1d')](handleError(_0x5255be,null));};exports[_0x4b14('0x87')]=function(_0x1ba345,_0x1baed1){var _0x4355f7=moment()[_0x4b14('0x88')]()[_0x4b14('0x89')]();var _0x511a03=path[_0x4b14('0x8a')](config[_0x4b14('0x59')],_0x4b14('0x8b'),_0x4b14('0x8c'),_0x4b14('0x8d'));var _0x197b38=path[_0x4b14('0x8a')](config[_0x4b14('0x59')],'server',_0x4b14('0x8c'),'attachments');var _0x468f56=util['format'](_0x4b14('0x8e'),_0x4355f7);return db['MailMessage'][_0x4b14('0x46')]({'where':{'id':_0x1ba345[_0x4b14('0x44')]['id']},'attributes':['id',_0x4b14('0x47'),_0x4b14('0x8f'),'to','cc',_0x4b14('0x90'),'subject',_0x4b14('0x91')],'include':_0x1ba345[_0x4b14('0x32')]['attachments']?[{'model':db[_0x4b14('0x92')],'as':_0x4b14('0x93')}]:undefined})[_0x4b14('0x14')](handleEntityNotFound(_0x1baed1,null))[_0x4b14('0x14')](function(_0x30816f){if(_0x30816f){var _0x270522=_0x30816f;var _0x4fd3f6={'from':_0x270522[_0x4b14('0x8f')],'to':_0x270522['to'],'subject':_0x270522[_0x4b14('0x94')],'html':htmlEntities['decode'](_0x270522[_0x4b14('0x47')]),'headers':{'Date':moment(_0x270522[_0x4b14('0x91')])[_0x4b14('0x61')](_0x4b14('0x95'))},'attachments':[]};if(_0x30816f['cc']){_0x4fd3f6[_0x4b14('0x96')]['Cc']=_0x30816f['cc'];}if(_0x30816f[_0x4b14('0x90')]){_0x4fd3f6[_0x4b14('0x96')][_0x4b14('0x97')]=_0x30816f[_0x4b14('0x90')];}return new BPromise(function(_0x19078f,_0x67262){if(_0x30816f[_0x4b14('0x93')]){for(var _0x386179=0x0;_0x386179<_0x30816f[_0x4b14('0x93')]['length'];_0x386179++){var _0x1e4b9b=_0x30816f[_0x4b14('0x93')][_0x386179];var _0x4f90f2=path['join'](_0x197b38,_0x1e4b9b['basename']);if(fs['existsSync'](_0x4f90f2)){_0x4fd3f6[_0x4b14('0x58')]['push']({'name':_0x1e4b9b[_0x4b14('0x29')],'contentType':_0x1e4b9b[_0x4b14('0x2f')],'data':fs[_0x4b14('0x98')](_0x4f90f2)});}}}emlformat['build'](_0x4fd3f6,function(_0x1ba1e7,_0x501463){if(_0x1ba1e7)return _0x67262(_0x1ba1e7);fs[_0x4b14('0x99')](path[_0x4b14('0x8a')](_0x511a03,_0x468f56),_0x501463);return _0x19078f(_0x501463);});});}})[_0x4b14('0x14')](function(_0x35ec9d){if(_0x35ec9d){return _0x1baed1['download'](path['join'](_0x511a03,_0x468f56),_0x468f56,function(_0x40869e){if(!_0x40869e)fs['unlinkSync'](path[_0x4b14('0x8a')](_0x511a03,_0x468f56));});}})[_0x4b14('0x1d')](handleError(_0x1baed1,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 98cb7cd..f1f4be6 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 _0x9f5d=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','save','update','remove','emit'];(function(_0x24f743,_0x1df1e0){var _0x310b01=function(_0x18f69d){while(--_0x18f69d){_0x24f743['push'](_0x24f743['shift']());}};_0x310b01(++_0x1df1e0);}(_0x9f5d,0x1d6));var _0xd9f5=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x9f5d[_0x397cfb];return _0x15fed9;};'use strict';var EventEmitter=require(_0xd9f5('0x0'));var MailMessage=require(_0xd9f5('0x1'))['db'][_0xd9f5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9f5('0x3'),'afterUpdate':_0xd9f5('0x4'),'afterDestroy':_0xd9f5('0x5')};function emitEvent(_0x1e3a51){return function(_0x3dc9e2,_0x355d77,_0x1ac8ef){MailMessageEvents[_0xd9f5('0x6')](_0x1e3a51+':'+_0x3dc9e2['id'],_0x3dc9e2);MailMessageEvents['emit'](_0x1e3a51,_0x3dc9e2);_0x1ac8ef(null);};}for(var e in events){if(events[_0xd9f5('0x7')](e)){var event=events[e];MailMessage[_0xd9f5('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xcfdc=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcfdc,0x112));var _0xccfd=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcfdc[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xccfd('0x0'))['db'][_0xccfd('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xccfd('0x2')](0x0);var events={'afterCreate':_0xccfd('0x3'),'afterUpdate':_0xccfd('0x4'),'afterDestroy':_0xccfd('0x5')};function emitEvent(_0x2953e3){return function(_0x3f4f69,_0x58224c,_0x1f5a16){MailMessageEvents[_0xccfd('0x6')](_0x2953e3+':'+_0x3f4f69['id'],_0x3f4f69);MailMessageEvents['emit'](_0x2953e3,_0x3f4f69);_0x1f5a16(null);};}for(var e in events){if(events[_0xccfd('0x7')](e)){var event=events[e];MailMessage[_0xccfd('0x8')](e,emitEvent(event));}}module[_0xccfd('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 57ccaad..bb3a379 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 _0x8ead=['then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','MailInteractionId'];(function(_0x2f7bcf,_0x189c1e){var _0x52d257=function(_0x1671c9){while(--_0x1671c9){_0x2f7bcf['push'](_0x2f7bcf['shift']());}};_0x52d257(++_0x189c1e);}(_0x8ead,0x19e));var _0xd8ea=function(_0x3d10b7,_0x128e5f){_0x3d10b7=_0x3d10b7-0x0;var _0x4ecafe=_0x8ead[_0x3d10b7];return _0x4ecafe;};'use strict';var _=require(_0xd8ea('0x0'));var util=require('util');var logger=require(_0xd8ea('0x1'))('api');var moment=require(_0xd8ea('0x2'));var BPromise=require(_0xd8ea('0x3'));var rp=require(_0xd8ea('0x4'));var htmlToText=require(_0xd8ea('0x5'));var fs=require('fs');var path=require(_0xd8ea('0x6'));var rimraf=require('rimraf');var config=require(_0xd8ea('0x7'));var attributes=require(_0xd8ea('0x8'));module[_0xd8ea('0x9')]=function(_0x331690,_0x4a30ff){return _0x331690[_0xd8ea('0xa')](_0xd8ea('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xd8ea('0xc'),'fields':[_0xd8ea('0xc')]},{'name':'fti_mail_messages','fields':[_0xd8ea('0xd'),_0xd8ea('0xe')],'type':_0xd8ea('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36143c,_0x5773bb,_0x2ea88a){if(_0x36143c[_0xd8ea('0x10')]){_0x36143c[_0xd8ea('0xd')]=htmlToText[_0xd8ea('0x11')](_0x36143c[_0xd8ea('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2ea88a(null,_0x5773bb);},'afterCreate':function(_0x36560b,_0x16c7f6,_0x51198b){var _0x42ddec=_0x331690[_0xd8ea('0x12')];var _0x4dc9a6=_0x36560b[_0xd8ea('0x13')]({'plain':!![]});if(_0x4dc9a6['direction'][_0xd8ea('0x14')]()==='in'||_0x4dc9a6[_0xd8ea('0x15')][_0xd8ea('0x14')]()===_0xd8ea('0x16')&&!_0x4dc9a6[_0xd8ea('0x17')]&&!_[_0xd8ea('0x18')](_0x4dc9a6[_0xd8ea('0x19')])){_0x42ddec['MailInteraction'][_0xd8ea('0x1a')]({'where':{'id':_0x4dc9a6[_0xd8ea('0x1b')]}})[_0xd8ea('0x1c')](function(_0xe8b7a7){if(_0xe8b7a7){_0xe8b7a7[_0xd8ea('0x1d')]({'lastMsgAt':_0x4dc9a6[_0xd8ea('0x1e')],'lastMsgDirection':_0x4dc9a6[_0xd8ea('0x15')][_0xd8ea('0x14')]()});}})[_0xd8ea('0x1f')](function(_0x57c0ce){console[_0xd8ea('0x20')](_0x57c0ce);});}_0x51198b();}},'charset':'utf8mb4','collate':_0xd8ea('0x21')});}; \ No newline at end of file +var _0x31fe=['./mailMessage.attributes','exports','define','MailMessage','messageId','subject','FULLTEXT','fromString','models','get','toLowerCase','direction','out','isNil','UserId','findOne','MailInteractionId','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x456c7f,_0x239931){var _0x25c66e=function(_0x4f08fa){while(--_0x4f08fa){_0x456c7f['push'](_0x456c7f['shift']());}};_0x25c66e(++_0x239931);}(_0x31fe,0x110));var _0xe31f=function(_0x68a0e3,_0x2259dd){_0x68a0e3=_0x68a0e3-0x0;var _0x350fb1=_0x31fe[_0x68a0e3];return _0x350fb1;};'use strict';var _=require('lodash');var util=require(_0xe31f('0x0'));var logger=require(_0xe31f('0x1'))(_0xe31f('0x2'));var moment=require(_0xe31f('0x3'));var BPromise=require('bluebird');var rp=require(_0xe31f('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xe31f('0x5'));var rimraf=require(_0xe31f('0x6'));var config=require(_0xe31f('0x7'));var attributes=require(_0xe31f('0x8'));module[_0xe31f('0x9')]=function(_0x3bd67e,_0x4588e0){return _0x3bd67e[_0xe31f('0xa')](_0xe31f('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xe31f('0xc'),'fields':[_0xe31f('0xc')]},{'name':'fti_mail_messages','fields':['plainBody',_0xe31f('0xd')],'type':_0xe31f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36f22c,_0x144fa8,_0x2602ad){if(_0x36f22c['body']){_0x36f22c['plainBody']=htmlToText[_0xe31f('0xf')](_0x36f22c['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2602ad(null,_0x144fa8);},'afterCreate':function(_0x4b77c8,_0x4301e7,_0x3860c5){var _0x94533d=_0x3bd67e[_0xe31f('0x10')];var _0x54cb08=_0x4b77c8[_0xe31f('0x11')]({'plain':!![]});if(_0x54cb08['direction'][_0xe31f('0x12')]()==='in'||_0x54cb08[_0xe31f('0x13')][_0xe31f('0x12')]()===_0xe31f('0x14')&&!_0x54cb08['secret']&&!_[_0xe31f('0x15')](_0x54cb08[_0xe31f('0x16')])){_0x94533d['MailInteraction'][_0xe31f('0x17')]({'where':{'id':_0x54cb08[_0xe31f('0x18')]}})['then'](function(_0x2c994a){if(_0x2c994a){_0x2c994a['update']({'lastMsgAt':_0x54cb08[_0xe31f('0x19')],'lastMsgDirection':_0x54cb08[_0xe31f('0x13')][_0xe31f('0x12')]()});}})['catch'](function(_0x2a7e6f){console['error'](_0x2a7e6f);});}_0x3860c5();}},'charset':_0xe31f('0x1a'),'collate':_0xe31f('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index cf11dd3..c321629 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 _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xda2d,0x102));var _0xdda2=function(_0x2d85cf,_0x3a492d){_0x2d85cf=_0x2d85cf-0x0;var _0x346589=_0xda2d[_0x2d85cf];return _0x346589;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateMailMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file +var _0x3423=['./mailMessage.socket','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateMailMessage','MailMessage','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3ac132,_0x90a111){var _0x12d6ca=function(_0x595d73){while(--_0x595d73){_0x3ac132['push'](_0x3ac132['shift']());}};_0x12d6ca(++_0x90a111);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});config[_0x3342('0xc')]=_[_0x3342('0xd')](config[_0x3342('0xc')],{'host':_0x3342('0xe'),'port':0x18eb});var socket=require(_0x3342('0xf'))(new Redis(config[_0x3342('0xc')]));require(_0x3342('0x10'))['register'](socket);function respondWithRpcPromise(_0x582c37,_0x2d0cb0,_0x481a17){return new BPromise(function(_0x5a1fba,_0x51b276){return client['request'](_0x582c37,_0x481a17)[_0x3342('0x11')](function(_0x2f3c47){logger['info'](_0x3342('0x12'),_0x2d0cb0,'request\x20sent');logger[_0x3342('0x13')](_0x3342('0x14'),_0x2d0cb0,'request\x20sent',JSON[_0x3342('0x15')](_0x2f3c47));if(_0x2f3c47[_0x3342('0x16')]){if(_0x2f3c47[_0x3342('0x16')][_0x3342('0x17')]===0x1f4){logger[_0x3342('0x16')](_0x3342('0x12'),_0x2d0cb0,_0x2f3c47[_0x3342('0x16')]['message']);return _0x51b276(_0x2f3c47[_0x3342('0x16')][_0x3342('0x18')]);}logger['error'](_0x3342('0x12'),_0x2d0cb0,_0x2f3c47[_0x3342('0x16')]['message']);return _0x5a1fba(_0x2f3c47['error'][_0x3342('0x18')]);}else{logger[_0x3342('0x19')](_0x3342('0x12'),_0x2d0cb0,_0x3342('0x1a'));_0x5a1fba(_0x2f3c47[_0x3342('0x1b')][_0x3342('0x18')]);}})[_0x3342('0x1c')](function(_0x3ebf6b){logger[_0x3342('0x16')]('MailMessage,\x20%s,\x20%s',_0x2d0cb0,_0x3ebf6b);_0x51b276(_0x3ebf6b);});});}exports[_0x3342('0x1d')]=function(_0xda235a){var _0x2f6395=this;return new Promise(function(_0x5e05f5,_0x3cb86f){return db[_0x3342('0x1e')]['create'](_0xda235a[_0x3342('0x1f')],{'raw':_0xda235a[_0x3342('0x20')]?_0xda235a['options'][_0x3342('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x3f271c){logger[_0x3342('0x19')](_0x3342('0x1d'),_0xda235a);logger[_0x3342('0x13')](_0x3342('0x1d'),_0xda235a,JSON[_0x3342('0x15')](_0x3f271c));_0x5e05f5(_0x3f271c);})[_0x3342('0x1c')](function(_0x2d8622){logger['error'](_0x3342('0x1d'),_0x2d8622['message'],_0xda235a);_0x3cb86f(_0x2f6395['error'](0x1f4,_0x2d8622[_0x3342('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f811e8e..5558e0c 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 _0xb0c5=['removeListener','register','length','mailMessage:','./mailMessage.events','emit'];(function(_0x211fb5,_0x52efb0){var _0x221845=function(_0x3a29a0){while(--_0x3a29a0){_0x211fb5['push'](_0x211fb5['shift']());}};_0x221845(++_0x52efb0);}(_0xb0c5,0xfa));var _0x5b0c=function(_0x3280a3,_0x5b7451){_0x3280a3=_0x3280a3-0x0;var _0x490ee1=_0xb0c5[_0x3280a3];return _0x490ee1;};'use strict';var MailMessageEvents=require(_0x5b0c('0x0'));var events=['save','remove','update'];function createListener(_0x40049f,_0x40b292){return function(_0x113902){_0x40b292[_0x5b0c('0x1')](_0x40049f,_0x113902);};}function removeListener(_0x1c4de1,_0x425015){return function(){MailMessageEvents[_0x5b0c('0x2')](_0x1c4de1,_0x425015);};}exports[_0x5b0c('0x3')]=function(_0x48ad35){for(var _0x4ea937=0x0,_0x5b84a2=events[_0x5b0c('0x4')];_0x4ea937<_0x5b84a2;_0x4ea937++){var _0x28ea40=events[_0x4ea937];var _0x5162f8=createListener(_0x5b0c('0x5')+_0x28ea40,_0x48ad35);MailMessageEvents['on'](_0x28ea40,_0x5162f8);}}; \ No newline at end of file +var _0x28bc=['length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x560651,_0x1cf3d4){var _0x490340=function(_0x340d5e){while(--_0x340d5e){_0x560651['push'](_0x560651['shift']());}};_0x490340(++_0x1cf3d4);}(_0x28bc,0x79));var _0xc28b=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x28bc[_0x42bc91];return _0x3f5507;};'use strict';var MailMessageEvents=require(_0xc28b('0x0'));var events=[_0xc28b('0x1'),_0xc28b('0x2'),_0xc28b('0x3')];function createListener(_0x3b67f8,_0x51e32e){return function(_0x4bfc9c){_0x51e32e[_0xc28b('0x4')](_0x3b67f8,_0x4bfc9c);};}function removeListener(_0x432384,_0x2be744){return function(){MailMessageEvents['removeListener'](_0x432384,_0x2be744);};}exports['register']=function(_0x15c63a){for(var _0x55daa4=0x0,_0x1a581d=events[_0xc28b('0x5')];_0x55daa4<_0x1a581d;_0x55daa4++){var _0x387746=events[_0x55daa4];var _0x22a92a=createListener(_0xc28b('0x6')+_0x387746,_0x15c63a);MailMessageEvents['on'](_0x387746,_0x22a92a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index e470f84..7cf80c4 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 _0x2fae=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x2fae,0x191));var _0xe2fa=function(_0x3a8e52,_0x4554f9){_0x3a8e52=_0x3a8e52-0x0;var _0x3baea5=_0x2fae[_0x3a8e52];return _0x3baea5;};'use strict';var multer=require(_0xe2fa('0x0'));var util=require(_0xe2fa('0x1'));var path=require(_0xe2fa('0x2'));var timeout=require(_0xe2fa('0x3'));var express=require('express');var router=express[_0xe2fa('0x4')]();var fs_extra=require(_0xe2fa('0x5'));var auth=require(_0xe2fa('0x6'));var interaction=require(_0xe2fa('0x7'));var config=require(_0xe2fa('0x8'));var controller=require('./mailQueue.controller');router[_0xe2fa('0x9')]('/',auth[_0xe2fa('0xa')](),controller[_0xe2fa('0xb')]);router[_0xe2fa('0x9')](_0xe2fa('0xc'),auth['isAuthenticated'](),controller[_0xe2fa('0xd')]);router[_0xe2fa('0x9')](_0xe2fa('0xe'),auth[_0xe2fa('0xa')](),controller['show']);router[_0xe2fa('0x9')](_0xe2fa('0xf'),auth['isAuthenticated'](),controller[_0xe2fa('0x10')]);router[_0xe2fa('0x9')](_0xe2fa('0x11'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x12')]);router[_0xe2fa('0x9')](_0xe2fa('0x13'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x14')]);router[_0xe2fa('0x15')]('/',auth['isAuthenticated'](),controller[_0xe2fa('0x16')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xe2fa('0x17')]);router[_0xe2fa('0x15')](_0xe2fa('0x13'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x18')]);router[_0xe2fa('0x19')](_0xe2fa('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe2fa('0xe'),auth['isAuthenticated'](),controller[_0xe2fa('0x1a')]);router[_0xe2fa('0x1b')](_0xe2fa('0x11'),auth['isAuthenticated'](),controller[_0xe2fa('0x1c')]);router['delete'](_0xe2fa('0x13'),auth[_0xe2fa('0xa')](),controller[_0xe2fa('0x1d')]);module[_0xe2fa('0x1e')]=router; \ No newline at end of file +var _0xcf07=['/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0xffabc3,_0x7e117e){var _0x45166e=function(_0x15e2be){while(--_0x15e2be){_0xffabc3['push'](_0xffabc3['shift']());}};_0x45166e(++_0x7e117e);}(_0xcf07,0x176));var _0x7cf0=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xcf07[_0x1a8f86];return _0x20d876;};'use strict';var multer=require(_0x7cf0('0x0'));var util=require(_0x7cf0('0x1'));var path=require(_0x7cf0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7cf0('0x3')]();var fs_extra=require(_0x7cf0('0x4'));var auth=require(_0x7cf0('0x5'));var interaction=require(_0x7cf0('0x6'));var config=require(_0x7cf0('0x7'));var controller=require(_0x7cf0('0x8'));router[_0x7cf0('0x9')]('/',auth[_0x7cf0('0xa')](),controller[_0x7cf0('0xb')]);router[_0x7cf0('0x9')](_0x7cf0('0xc'),auth[_0x7cf0('0xa')](),controller[_0x7cf0('0xd')]);router[_0x7cf0('0x9')](_0x7cf0('0xe'),auth['isAuthenticated'](),controller[_0x7cf0('0xf')]);router[_0x7cf0('0x9')](_0x7cf0('0x10'),auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x11')]);router[_0x7cf0('0x9')](_0x7cf0('0x12'),auth[_0x7cf0('0xa')](),controller['getTeams']);router[_0x7cf0('0x9')]('/:id/users',auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x13')]);router[_0x7cf0('0x14')]('/',auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x15')]);router[_0x7cf0('0x14')](_0x7cf0('0x12'),auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x16')]);router[_0x7cf0('0x14')](_0x7cf0('0x17'),auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x18')]);router['put'](_0x7cf0('0xe'),auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x19')]);router[_0x7cf0('0x1a')](_0x7cf0('0xe'),auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x1b')]);router[_0x7cf0('0x1a')]('/:id/teams',auth[_0x7cf0('0xa')](),controller['removeTeams']);router[_0x7cf0('0x1a')]('/:id/users',auth[_0x7cf0('0xa')](),controller[_0x7cf0('0x1c')]);module[_0x7cf0('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 ba0072d..6697937 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 _0xc51a=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x4cd3f6,_0x1aa7f3){var _0x59aca9=function(_0x98eca){while(--_0x98eca){_0x4cd3f6['push'](_0x4cd3f6['shift']());}};_0x59aca9(++_0x1aa7f3);}(_0xc51a,0x1a5));var _0xac51=function(_0x208eb2,_0x8026d8){_0x208eb2=_0x208eb2-0x0;var _0x5e620f=_0xc51a[_0x208eb2];return _0x5e620f;};'use strict';var Sequelize=require(_0xac51('0x0'));module[_0xac51('0x1')]={'name':{'type':Sequelize[_0xac51('0x2')],'unique':_0xac51('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac51('0x2')]},'timeout':{'type':Sequelize[_0xac51('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac51('0x5')](_0xac51('0x6'),_0xac51('0x7'),_0xac51('0x8'))}}; \ No newline at end of file +var _0x6c7a=['sequelize','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x1a26d7,_0xb59032){var _0xa7c428=function(_0x504bb7){while(--_0x504bb7){_0x1a26d7['push'](_0x1a26d7['shift']());}};_0xa7c428(++_0xb59032);}(_0x6c7a,0xbd));var _0xa6c7=function(_0x4ee102,_0x4abf35){_0x4ee102=_0x4ee102-0x0;var _0x2d6c66=_0x6c7a[_0x4ee102];return _0x2d6c66;};'use strict';var Sequelize=require(_0xa6c7('0x0'));module['exports']={'name':{'type':Sequelize[_0xa6c7('0x1')],'unique':_0xa6c7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa6c7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa6c7('0x4')]('rrmemory',_0xa6c7('0x5'),_0xa6c7('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index e26a95d..c5a77b9 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 _0xb9f0=['updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','emit','userMailQueue:save','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','removeTeams','isEmpty','userMailQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','MailQueueId','options','UserMailQueue','User','UserId'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xb9f0,0x13f));var _0x0b9f=function(_0x1b6158,_0x1b7c2f){_0x1b6158=_0x1b6158-0x0;var _0x5c6338=_0xb9f0[_0x1b6158];return _0x5c6338;};'use strict';var emlformat=require(_0x0b9f('0x0'));var rimraf=require(_0x0b9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b9f('0x2'));var rp=require(_0x0b9f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0b9f('0x4'));var util=require(_0x0b9f('0x5'));var path=require(_0x0b9f('0x6'));var sox=require(_0x0b9f('0x7'));var csv=require(_0x0b9f('0x8'));var ejs=require(_0x0b9f('0x9'));var fs=require('fs');var fs_extra=require(_0x0b9f('0xa'));var _=require(_0x0b9f('0xb'));var squel=require(_0x0b9f('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b9f('0xd'));var deskjs=require(_0x0b9f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0b9f('0xf'));var Papa=require(_0x0b9f('0x10'));var Redis=require(_0x0b9f('0x11'));var authService=require(_0x0b9f('0x12'));var qs=require(_0x0b9f('0x13'));var as=require(_0x0b9f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b9f('0x15'))(_0x0b9f('0x16'));var utils=require(_0x0b9f('0x17'));var config=require(_0x0b9f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b9f('0x19'))['db'];config[_0x0b9f('0x1a')]=_[_0x0b9f('0x1b')](config[_0x0b9f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b9f('0x1c'))(new Redis(config[_0x0b9f('0x1a')]));require(_0x0b9f('0x1d'))[_0x0b9f('0x1e')](socket);function respondWithStatusCode(_0x535d0f,_0x29175b){_0x29175b=_0x29175b||0xcc;return function(_0x2185c2){if(_0x2185c2){return _0x535d0f[_0x0b9f('0x1f')](_0x29175b);}return _0x535d0f[_0x0b9f('0x20')](_0x29175b)['end']();};}function respondWithResult(_0x56137d,_0x29a911){_0x29a911=_0x29a911||0xc8;return function(_0x237672){if(_0x237672){return _0x56137d[_0x0b9f('0x20')](_0x29a911)['json'](_0x237672);}};}function respondWithFilteredResult(_0x401e37,_0x559670){return function(_0x2cee44){if(_0x2cee44){var _0x2563bd=typeof _0x559670[_0x0b9f('0x21')]==='undefined'&&typeof _0x559670[_0x0b9f('0x22')]==='undefined';var _0x214076=_0x2cee44[_0x0b9f('0x23')];var _0x2bbfc0=_0x2563bd?0x0:_0x559670[_0x0b9f('0x21')];var _0x4fb7bc=_0x2563bd?_0x2cee44[_0x0b9f('0x23')]:_0x559670[_0x0b9f('0x21')]+_0x559670[_0x0b9f('0x22')];var _0x30f5cc;if(_0x4fb7bc>=_0x214076){_0x4fb7bc=_0x214076;_0x30f5cc=0xc8;}else{_0x30f5cc=0xce;}_0x401e37[_0x0b9f('0x20')](_0x30f5cc);return _0x401e37[_0x0b9f('0x24')](_0x0b9f('0x25'),_0x2bbfc0+'-'+_0x4fb7bc+'/'+_0x214076)[_0x0b9f('0x26')](_0x2cee44);}return null;};}function patchUpdates(_0x317be5){return function(_0x29bba9){try{jsonpatch[_0x0b9f('0x27')](_0x29bba9,_0x317be5,!![]);}catch(_0x5b4af6){return BPromise[_0x0b9f('0x28')](_0x5b4af6);}return _0x29bba9[_0x0b9f('0x29')]();};}function saveUpdates(_0x452b75,_0x3dba4a){return function(_0x33d922){if(_0x33d922){return _0x33d922[_0x0b9f('0x2a')](_0x452b75)[_0x0b9f('0x2b')](function(_0xa0bdb0){return _0xa0bdb0;});}return null;};}function removeEntity(_0x145a08,_0x15fd8c){return function(_0x531749){if(_0x531749){return _0x531749[_0x0b9f('0x2c')]()[_0x0b9f('0x2b')](function(){var _0x5822d2=_0x531749['get']({'plain':!![]});var _0x143f4e=_0x0b9f('0x2d');return db[_0x0b9f('0x2e')]['destroy']({'where':{'type':_0x143f4e,'resourceId':_0x5822d2['id']}})[_0x0b9f('0x2b')](function(){return _0x531749;});})['then'](function(){_0x145a08[_0x0b9f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31ae3d,_0x337663){return function(_0x14c138){if(!_0x14c138){_0x31ae3d[_0x0b9f('0x1f')](0x194);}return _0x14c138;};}function handleError(_0x2022ee,_0x593a12){_0x593a12=_0x593a12||0x1f4;return function(_0x16f0da){logger[_0x0b9f('0x2f')](_0x16f0da[_0x0b9f('0x30')]);if(_0x16f0da[_0x0b9f('0x31')]){delete _0x16f0da['name'];}_0x2022ee[_0x0b9f('0x20')](_0x593a12)['send'](_0x16f0da);};}exports[_0x0b9f('0x32')]=function(_0x2b8f53,_0x235062){var _0x52db62={},_0xde0edb={},_0x18805c={'count':0x0,'rows':[]};var _0x300633=_[_0x0b9f('0x33')](db[_0x0b9f('0x34')][_0x0b9f('0x35')],function(_0x223900){return{'name':_0x223900['fieldName'],'type':_0x223900['type']['key']};});_0xde0edb['model']=_[_0x0b9f('0x33')](_0x300633,'name');_0xde0edb[_0x0b9f('0x36')]=_[_0x0b9f('0x37')](_0x2b8f53[_0x0b9f('0x36')]);_0xde0edb[_0x0b9f('0x38')]=_[_0x0b9f('0x39')](_0xde0edb[_0x0b9f('0x3a')],_0xde0edb[_0x0b9f('0x36')]);_0x52db62[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0xde0edb[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0x2b8f53[_0x0b9f('0x36')]['fields']));_0x52db62[_0x0b9f('0x3b')]=_0x52db62['attributes'][_0x0b9f('0x3d')]?_0x52db62[_0x0b9f('0x3b')]:_0xde0edb[_0x0b9f('0x3a')];if(!_0x2b8f53['query'][_0x0b9f('0x3e')]('nolimit')){_0x52db62[_0x0b9f('0x22')]=qs[_0x0b9f('0x22')](_0x2b8f53[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x52db62[_0x0b9f('0x21')]=qs[_0x0b9f('0x21')](_0x2b8f53[_0x0b9f('0x36')][_0x0b9f('0x21')]);}_0x52db62[_0x0b9f('0x3f')]=qs[_0x0b9f('0x40')](_0x2b8f53[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x52db62['where']=qs[_0x0b9f('0x38')](_[_0x0b9f('0x41')](_0x2b8f53[_0x0b9f('0x36')],_0xde0edb[_0x0b9f('0x38')]),_0x300633);if(_0x2b8f53['query'][_0x0b9f('0x42')]){_0x52db62['where']=_[_0x0b9f('0x43')](_0x52db62[_0x0b9f('0x44')],{'$or':_[_0x0b9f('0x33')](_0x300633,function(_0x4d5f6e){if(_0x4d5f6e['type']!==_0x0b9f('0x45')){var _0x34faa3={};_0x34faa3[_0x4d5f6e[_0x0b9f('0x31')]]={'$like':'%'+_0x2b8f53[_0x0b9f('0x36')]['filter']+'%'};return _0x34faa3;}})});}_0x52db62=_[_0x0b9f('0x43')]({},_0x52db62,_0x2b8f53['options']);var _0x573f6a={'where':_0x52db62[_0x0b9f('0x44')]};return db[_0x0b9f('0x34')]['count'](_0x573f6a)['then'](function(_0x4148ee){_0x18805c[_0x0b9f('0x23')]=_0x4148ee;if(_0x2b8f53[_0x0b9f('0x36')]['includeAll']){_0x52db62[_0x0b9f('0x46')]=[{'all':!![]}];}return db[_0x0b9f('0x34')][_0x0b9f('0x47')](_0x52db62);})[_0x0b9f('0x2b')](function(_0x699c34){_0x18805c[_0x0b9f('0x48')]=_0x699c34;return _0x18805c;})[_0x0b9f('0x2b')](respondWithFilteredResult(_0x235062,_0x52db62))[_0x0b9f('0x49')](handleError(_0x235062,null));};exports[_0x0b9f('0x4a')]=function(_0xbd6ca3,_0x167e9c){var _0x4f1087={'raw':!![],'where':{'id':_0xbd6ca3[_0x0b9f('0x4b')]['id']}},_0x206ff6={};_0x206ff6['model']=_[_0x0b9f('0x37')](db[_0x0b9f('0x34')][_0x0b9f('0x35')]);_0x206ff6['query']=_[_0x0b9f('0x37')](_0xbd6ca3[_0x0b9f('0x36')]);_0x206ff6['filters']=_['intersection'](_0x206ff6['model'],_0x206ff6[_0x0b9f('0x36')]);_0x4f1087[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0x206ff6[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0xbd6ca3[_0x0b9f('0x36')][_0x0b9f('0x3c')]));_0x4f1087[_0x0b9f('0x3b')]=_0x4f1087[_0x0b9f('0x3b')]['length']?_0x4f1087[_0x0b9f('0x3b')]:_0x206ff6[_0x0b9f('0x3a')];if(_0xbd6ca3[_0x0b9f('0x36')][_0x0b9f('0x4c')]){_0x4f1087[_0x0b9f('0x46')]=[{'all':!![]}];}_0x4f1087=_[_0x0b9f('0x43')]({},_0x4f1087,_0xbd6ca3['options']);return db[_0x0b9f('0x34')][_0x0b9f('0x4d')](_0x4f1087)[_0x0b9f('0x2b')](handleEntityNotFound(_0x167e9c,null))[_0x0b9f('0x2b')](respondWithResult(_0x167e9c,null))[_0x0b9f('0x49')](handleError(_0x167e9c,null));};exports['create']=function(_0x258a75,_0x2a7b16){return db['MailQueue'][_0x0b9f('0x4e')](_0x258a75[_0x0b9f('0x4f')],{})['then'](function(_0x9d60e7){var _0x493889=_0x258a75[_0x0b9f('0x50')][_0x0b9f('0x51')]({'plain':!![]});if(!_0x493889)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x493889[_0x0b9f('0x52')]===_0x0b9f('0x50')){var _0x1e8826=_0x9d60e7[_0x0b9f('0x51')]({'plain':!![]});var _0x550b53='MailQueues';return db['UserProfileSection'][_0x0b9f('0x4d')]({'where':{'name':_0x550b53,'userProfileId':_0x493889[_0x0b9f('0x53')]},'raw':!![]})[_0x0b9f('0x2b')](function(_0x200abd){if(_0x200abd&&_0x200abd[_0x0b9f('0x54')]===0x0){return db[_0x0b9f('0x2e')][_0x0b9f('0x4e')]({'name':_0x1e8826[_0x0b9f('0x31')],'resourceId':_0x1e8826['id'],'type':_0x200abd[_0x0b9f('0x31')],'sectionId':_0x200abd['id']},{})['then'](function(){return _0x9d60e7;});}else{return _0x9d60e7;}})[_0x0b9f('0x49')](function(_0x1be8ed){logger['error'](_0x0b9f('0x55'),_0x1be8ed);throw _0x1be8ed;});}return _0x9d60e7;})[_0x0b9f('0x2b')](respondWithResult(_0x2a7b16,0xc9))[_0x0b9f('0x49')](handleError(_0x2a7b16,null));};exports['update']=function(_0x118f11,_0x18d894){if(_0x118f11[_0x0b9f('0x4f')]['id']){delete _0x118f11[_0x0b9f('0x4f')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x118f11[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x18d894,null))['then'](saveUpdates(_0x118f11[_0x0b9f('0x4f')],null))[_0x0b9f('0x2b')](respondWithResult(_0x18d894,null))[_0x0b9f('0x49')](handleError(_0x18d894,null));};exports[_0x0b9f('0x2c')]=function(_0xe99121,_0x4e5363){return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0xe99121[_0x0b9f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e5363,null))[_0x0b9f('0x2b')](removeEntity(_0x4e5363,null))[_0x0b9f('0x49')](handleError(_0x4e5363,null));};exports[_0x0b9f('0x56')]=function(_0x5a08e6,_0x746947){return db[_0x0b9f('0x34')]['describe']()['then'](respondWithResult(_0x746947,null))['catch'](handleError(_0x746947,null));};exports[_0x0b9f('0x57')]=function(_0x39679e,_0x4107e7,_0x755f9){var _0x4cefa7={'raw':!![],'where':{}},_0x19cdce={},_0x17869e;return db[_0x0b9f('0x34')][_0x0b9f('0x58')]({'where':{'id':_0x39679e[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x4107e7,null))[_0x0b9f('0x2b')](function(_0x56dd7e){if(_0x56dd7e){_0x17869e=_0x56dd7e['get']({'plain':!![]});_0x19cdce[_0x0b9f('0x3a')]=_[_0x0b9f('0x37')](db['UserMailQueue'][_0x0b9f('0x35')]);_0x19cdce['query']=_['keys'](_0x39679e[_0x0b9f('0x36')]);_0x19cdce[_0x0b9f('0x38')]=_[_0x0b9f('0x39')](_0x19cdce[_0x0b9f('0x3a')],_0x19cdce['query']);_0x4cefa7['attributes']=_['intersection'](_0x19cdce[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x3c')]));_0x4cefa7[_0x0b9f('0x3b')]=_0x4cefa7[_0x0b9f('0x3b')][_0x0b9f('0x3d')]?_0x4cefa7[_0x0b9f('0x3b')]:_0x19cdce['model'];if(!_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x3e')](_0x0b9f('0x59'))){_0x4cefa7[_0x0b9f('0x22')]=qs['limit'](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x4cefa7[_0x0b9f('0x21')]=qs[_0x0b9f('0x21')](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x21')]);}_0x4cefa7[_0x0b9f('0x3f')]=qs[_0x0b9f('0x40')](_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x4cefa7[_0x0b9f('0x44')]=qs[_0x0b9f('0x38')](_[_0x0b9f('0x41')](_0x39679e[_0x0b9f('0x36')],_0x19cdce[_0x0b9f('0x38')]));_0x4cefa7[_0x0b9f('0x44')][_0x0b9f('0x5a')]=_0x56dd7e['id'];if(_0x39679e[_0x0b9f('0x36')]['filter']){_0x4cefa7['where']=_[_0x0b9f('0x43')](_0x4cefa7[_0x0b9f('0x44')],{'$or':_['map'](_0x4cefa7[_0x0b9f('0x3b')],function(_0x5800e3){var _0x36cc36={};_0x36cc36[_0x5800e3]={'$like':'%'+_0x39679e[_0x0b9f('0x36')][_0x0b9f('0x42')]+'%'};return _0x36cc36;})});}_0x4cefa7=_[_0x0b9f('0x43')]({},_0x4cefa7,_0x39679e[_0x0b9f('0x5b')]);return db[_0x0b9f('0x5c')][_0x0b9f('0x47')](_0x4cefa7);}})[_0x0b9f('0x2b')](function(_0x1bac68){if(_0x1bac68){return db[_0x0b9f('0x5d')]['findAndCountAll']({'where':{'id':_[_0x0b9f('0x33')](_0x1bac68,_0x0b9f('0x5e')),'role':'agent'},'attributes':['id',_0x0b9f('0x31'),'mailPause',_0x0b9f('0x5f'),_0x0b9f('0x60')]});}})[_0x0b9f('0x2b')](function(_0x281111){if(_0x281111){return{'count':_0x281111[_0x0b9f('0x23')],'rows':_['map'](_0x281111[_0x0b9f('0x48')],function(_0x2fae47){return{'membername':_0x2fae47[_0x0b9f('0x31')],'UserId':_0x2fae47['id'],'queue_name':_0x17869e[_0x0b9f('0x31')],'MailQueueId':_0x17869e['id'],'interface':util[_0x0b9f('0x61')](_0x0b9f('0x62'),_0x0b9f('0x63'),_0x2fae47[_0x0b9f('0x31')]),'penalty':0x0,'paused':_0x2fae47[_0x0b9f('0x64')],'createdAt':_0x2fae47['createdAt'],'updatedAt':_0x2fae47[_0x0b9f('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b9f('0x2b')](respondWithFilteredResult(_0x4107e7,_0x4cefa7))[_0x0b9f('0x49')](handleError(_0x4107e7,null));};exports[_0x0b9f('0x65')]=function(_0x3091a4,_0x352e40,_0x3cb920){var _0x30fd6a={};var _0x521627={};var _0x213ba9;var _0x28bdc6;return db['MailQueue']['findOne']({'where':{'id':_0x3091a4[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x352e40,null))[_0x0b9f('0x2b')](function(_0x413fbf){if(_0x413fbf){_0x213ba9=_0x413fbf;_0x521627[_0x0b9f('0x3a')]=_[_0x0b9f('0x37')](db[_0x0b9f('0x66')][_0x0b9f('0x35')]);_0x521627['query']=_[_0x0b9f('0x37')](_0x3091a4[_0x0b9f('0x36')]);_0x521627[_0x0b9f('0x38')]=_[_0x0b9f('0x39')](_0x521627[_0x0b9f('0x3a')],_0x521627[_0x0b9f('0x36')]);_0x30fd6a[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0x521627[_0x0b9f('0x3a')],qs[_0x0b9f('0x3c')](_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x3c')]));_0x30fd6a[_0x0b9f('0x3b')]=_0x30fd6a[_0x0b9f('0x3b')][_0x0b9f('0x3d')]?_0x30fd6a['attributes']:_0x521627[_0x0b9f('0x3a')];_0x30fd6a[_0x0b9f('0x3f')]=qs['sort'](_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x30fd6a[_0x0b9f('0x44')]=qs[_0x0b9f('0x38')](_['pick'](_0x3091a4['query'],_0x521627[_0x0b9f('0x38')]));if(_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x42')]){_0x30fd6a[_0x0b9f('0x44')]=_[_0x0b9f('0x43')](_0x30fd6a[_0x0b9f('0x44')],{'$or':_[_0x0b9f('0x33')](_0x30fd6a[_0x0b9f('0x3b')],function(_0x4131a4){var _0x3da730={};_0x3da730[_0x4131a4]={'$like':'%'+_0x3091a4['query'][_0x0b9f('0x42')]+'%'};return _0x3da730;})});}_0x30fd6a=_[_0x0b9f('0x43')]({},_0x30fd6a,_0x3091a4[_0x0b9f('0x5b')]);return _0x213ba9[_0x0b9f('0x65')](_0x30fd6a);}})[_0x0b9f('0x2b')](function(_0xbf2056){if(_0xbf2056){_0x28bdc6=_0xbf2056[_0x0b9f('0x3d')];if(!_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x3e')](_0x0b9f('0x59'))){_0x30fd6a[_0x0b9f('0x22')]=qs[_0x0b9f('0x22')](_0x3091a4[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x30fd6a[_0x0b9f('0x21')]=qs[_0x0b9f('0x21')](_0x3091a4[_0x0b9f('0x36')]['offset']);}return _0x213ba9[_0x0b9f('0x65')](_0x30fd6a);}})[_0x0b9f('0x2b')](function(_0x5d7ee2){if(_0x5d7ee2){return _0x5d7ee2?{'count':_0x28bdc6,'rows':_0x5d7ee2}:null;}})[_0x0b9f('0x2b')](respondWithResult(_0x352e40,null))[_0x0b9f('0x49')](handleError(_0x352e40,null));};exports[_0x0b9f('0x67')]=function(_0x1e7f18,_0x437b36,_0xa85640){var _0x17afb6=_0x1e7f18[_0x0b9f('0x4f')][_0x0b9f('0x68')];return db['Team'][_0x0b9f('0x47')]({'where':{'id':_0x17afb6},'attributes':['id'],'include':[{'model':db[_0x0b9f('0x5d')],'as':_0x0b9f('0x69'),'attributes':['id',_0x0b9f('0x31'),_0x0b9f('0x6a'),_0x0b9f('0x6b'),_0x0b9f('0x6c')],'raw':!![]}]})[_0x0b9f('0x2b')](function(_0x12c3a7){if(_0x12c3a7){var _0x1bd3af=_[_0x0b9f('0x6d')](_0x12c3a7,function(_0x27f5d6){var _0x41a09f=_0x27f5d6['get']({'plain':!![]});return _0x41a09f[_0x0b9f('0x69')];});return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0x1e7f18[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](function(_0x5a3b02){return db[_0x0b9f('0x6e')]['transaction'](function(_0x3c16e3){return _0x5a3b02[_0x0b9f('0x67')](_0x17afb6,{'transaction':_0x3c16e3})['then'](function(){return BPromise[_0x0b9f('0x6f')](_0x1bd3af,function(_0x358319){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x358319['id'],'MailQueueId':_0x1e7f18[_0x0b9f('0x4b')]['id']},'transaction':_0x3c16e3});});})['then'](function(){_0x1bd3af['forEach'](function(_0x351aeb){socket[_0x0b9f('0x70')](_0x0b9f('0x71'),{'UserId':_0x351aeb['id'],'MailQueueId':_0x5a3b02['id']});});});});});}})[_0x0b9f('0x2b')](respondWithStatusCode(_0x437b36,null))['catch'](handleError(_0x437b36,null));};exports['removeTeams']=function(_0x48cb05,_0x222b32,_0x2589a7){return db[_0x0b9f('0x66')][_0x0b9f('0x47')]({'where':{'id':_0x48cb05[_0x0b9f('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0b9f('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x222b32,null))[_0x0b9f('0x2b')](function(_0x434f9c){var _0x50513e=_[_0x0b9f('0x33')](_0x434f9c,'id');var _0x4355cd=[];var _0x3eed2f=[];var _0x4c2c60=squel[_0x0b9f('0x72')]();_0x4c2c60[_0x0b9f('0x73')](_0x0b9f('0x74'))['from']('team_has_mail_queues','tq')[_0x0b9f('0x75')]('user_has_teams','ut',_0x0b9f('0x76'))[_0x0b9f('0x44')](_0x0b9f('0x77'),_0x48cb05[_0x0b9f('0x4b')]['id']);for(var _0x103b25=0x0;_0x103b25<_0x434f9c[_0x0b9f('0x3d')];_0x103b25+=0x1){let _0x219d9c=_0x434f9c[_0x103b25];for(var _0x91c626=0x0;_0x91c626<_0x219d9c[_0x0b9f('0x69')]['length'];_0x91c626+=0x1){let _0x263f3b=_0x219d9c[_0x0b9f('0x69')][_0x91c626];var _0x4a5288=_0x4c2c60[_0x0b9f('0x78')]();_0x4a5288['where'](_0x0b9f('0x79'),_0x263f3b['id']);_0x3eed2f[_0x0b9f('0x7a')](db['sequelize'][_0x0b9f('0x36')](_0x4a5288[_0x0b9f('0x7b')](),{'type':db['sequelize'][_0x0b9f('0x7c')][_0x0b9f('0x7d')]})[_0x0b9f('0x2b')](function(_0x293e5c){if(_0x293e5c['length']===0x1){return _0x263f3b['id'];}else{var _0x374404=_['every'](_[_0x0b9f('0x33')](_0x293e5c,_0x0b9f('0x7e')),function(_0x304456){return _[_0x0b9f('0x7f')](_0x50513e,_0x304456);});if(_0x374404){return _0x263f3b['id'];}}}));}}return BPromise[_0x0b9f('0x80')](_0x3eed2f)[_0x0b9f('0x2b')](function(_0x7951b9){_0x4355cd=_(_0x4355cd)['union'](_0x7951b9)[_0x0b9f('0x81')]()[_0x0b9f('0x82')]();return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0x48cb05[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](function(_0x3b9b67){return db[_0x0b9f('0x6e')]['transaction'](function(_0x28fb66){return _0x3b9b67[_0x0b9f('0x83')](_0x48cb05[_0x0b9f('0x36')][_0x0b9f('0x68')],{'transaction':_0x28fb66})[_0x0b9f('0x2b')](function(){if(!_[_0x0b9f('0x84')](_0x4355cd)){return _0x3b9b67['removeAgents'](_0x4355cd,{'transaction':_0x28fb66});}})[_0x0b9f('0x2b')](function(){_0x4355cd['forEach'](function(_0x3c3d9e){socket[_0x0b9f('0x70')](_0x0b9f('0x85'),{'UserId':_0x3c3d9e,'MailQueueId':_0x3b9b67['id']});});});});});});})['then'](respondWithStatusCode(_0x222b32,null))['catch'](handleError(_0x222b32,null));};exports['addAgents']=function(_0x2af6cb,_0x297c5b,_0x2566ad){return db['MailQueue']['find']({'where':{'id':_0x2af6cb[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x297c5b,null))[_0x0b9f('0x2b')](function(_0x184a0a){if(_0x184a0a){return _0x184a0a[_0x0b9f('0x86')](_0x2af6cb['body'][_0x0b9f('0x68')],_['omit'](_0x2af6cb[_0x0b9f('0x4f')],[_0x0b9f('0x68'),'id'])||{})['spread'](function(_0x14b3d9){for(var _0x47220a=0x0;_0x47220a<_0x2af6cb['body'][_0x0b9f('0x68')][_0x0b9f('0x3d')];_0x47220a+=0x1){socket[_0x0b9f('0x70')](_0x0b9f('0x71'),{'UserId':Number(_0x2af6cb[_0x0b9f('0x4f')][_0x0b9f('0x68')][_0x47220a]),'MailQueueId':Number(_0x2af6cb[_0x0b9f('0x4b')]['id'])});}return _0x14b3d9;});}})[_0x0b9f('0x2b')](respondWithResult(_0x297c5b,null))[_0x0b9f('0x49')](handleError(_0x297c5b,null));};exports['removeAgents']=function(_0x2ef1f3,_0x18157a,_0x19264c){return db[_0x0b9f('0x34')][_0x0b9f('0x4d')]({'where':{'id':_0x2ef1f3[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x18157a,null))[_0x0b9f('0x2b')](function(_0x2ebbdb){if(_0x2ebbdb){return _0x2ebbdb[_0x0b9f('0x87')](_0x2ef1f3['query']['ids'])[_0x0b9f('0x2b')](function(){if(_[_0x0b9f('0x88')](_0x2ef1f3[_0x0b9f('0x36')]['ids'])){for(var _0x2f155a=0x0;_0x2f155a<_0x2ef1f3[_0x0b9f('0x36')]['ids'][_0x0b9f('0x3d')];_0x2f155a+=0x1){socket[_0x0b9f('0x70')]('userMailQueue:remove',{'UserId':Number(_0x2ef1f3[_0x0b9f('0x36')][_0x0b9f('0x68')][_0x2f155a]),'MailQueueId':Number(_0x2ef1f3[_0x0b9f('0x4b')]['id'])});}}else{socket[_0x0b9f('0x70')]('userMailQueue:remove',{'UserId':Number(_0x2ef1f3[_0x0b9f('0x36')]['ids']),'MailQueueId':Number(_0x2ef1f3['params']['id'])});}});}})[_0x0b9f('0x2b')](respondWithStatusCode(_0x18157a,null))[_0x0b9f('0x49')](handleError(_0x18157a,null));};exports[_0x0b9f('0x89')]=function(_0x29974e,_0x367d1b,_0x42661d){var _0x1eef00={};var _0x1e7ca2={};var _0x206602;var _0x26a3d2;return db[_0x0b9f('0x34')][_0x0b9f('0x58')]({'where':{'id':_0x29974e[_0x0b9f('0x4b')]['id']}})[_0x0b9f('0x2b')](handleEntityNotFound(_0x367d1b,null))['then'](function(_0x11b121){if(_0x11b121){_0x206602=_0x11b121;_0x1e7ca2[_0x0b9f('0x3a')]=_[_0x0b9f('0x37')](db[_0x0b9f('0x5d')]['rawAttributes']);_0x1e7ca2['query']=_[_0x0b9f('0x37')](_0x29974e[_0x0b9f('0x36')]);_0x1e7ca2[_0x0b9f('0x38')]=_['intersection'](_0x1e7ca2[_0x0b9f('0x3a')],_0x1e7ca2[_0x0b9f('0x36')]);_0x1eef00[_0x0b9f('0x3b')]=_[_0x0b9f('0x39')](_0x1e7ca2['model'],qs[_0x0b9f('0x3c')](_0x29974e[_0x0b9f('0x36')]['fields']));_0x1eef00['attributes']=_0x1eef00['attributes'][_0x0b9f('0x3d')]?_0x1eef00[_0x0b9f('0x3b')]:_0x1e7ca2[_0x0b9f('0x3a')];_0x1eef00[_0x0b9f('0x3f')]=qs['sort'](_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x40')]);_0x1eef00[_0x0b9f('0x44')]=qs[_0x0b9f('0x38')](_[_0x0b9f('0x41')](_0x29974e['query'],_0x1e7ca2[_0x0b9f('0x38')]));if(_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x42')]){_0x1eef00[_0x0b9f('0x44')]=_[_0x0b9f('0x43')](_0x1eef00[_0x0b9f('0x44')],{'$or':_[_0x0b9f('0x33')](_0x1eef00['attributes'],function(_0x45f2ae){var _0x569af9={};_0x569af9[_0x45f2ae]={'$like':'%'+_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x42')]+'%'};return _0x569af9;})});}_0x1eef00=_[_0x0b9f('0x43')]({},_0x1eef00,_0x29974e['options']);return _0x206602[_0x0b9f('0x89')](_0x1eef00);}})[_0x0b9f('0x2b')](function(_0x2bb0d8){if(_0x2bb0d8){_0x26a3d2=_0x2bb0d8['length'];if(!_0x29974e['query']['hasOwnProperty'](_0x0b9f('0x59'))){_0x1eef00[_0x0b9f('0x22')]=qs[_0x0b9f('0x22')](_0x29974e[_0x0b9f('0x36')][_0x0b9f('0x22')]);_0x1eef00['offset']=qs[_0x0b9f('0x21')](_0x29974e['query']['offset']);}return _0x206602[_0x0b9f('0x89')](_0x1eef00);}})[_0x0b9f('0x2b')](function(_0x29fda8){if(_0x29fda8){return _0x29fda8?{'count':_0x26a3d2,'rows':_0x29fda8}:null;}})[_0x0b9f('0x2b')](respondWithResult(_0x367d1b,null))[_0x0b9f('0x49')](handleError(_0x367d1b,null));}; \ No newline at end of file +var _0x7846=['save','update','then','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','type','key','model','query','keys','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','intersection','fields','length','options','find','create','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','User','field','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','value','userMailQueue:remove','addAgents','userMailQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7846,0xf4));var _0x6784=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x7846[_0x2e6c19];return _0x52885d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6784('0x0'));var zipdir=require(_0x6784('0x1'));var jsonpatch=require(_0x6784('0x2'));var rp=require(_0x6784('0x3'));var moment=require(_0x6784('0x4'));var BPromise=require(_0x6784('0x5'));var Mustache=require('mustache');var util=require(_0x6784('0x6'));var path=require(_0x6784('0x7'));var sox=require(_0x6784('0x8'));var csv=require(_0x6784('0x9'));var ejs=require(_0x6784('0xa'));var fs=require('fs');var fs_extra=require(_0x6784('0xb'));var _=require(_0x6784('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6784('0xd'));var deskjs=require(_0x6784('0xe'));var toCsv=require(_0x6784('0x9'));var querystring=require(_0x6784('0xf'));var Papa=require(_0x6784('0x10'));var Redis=require(_0x6784('0x11'));var authService=require(_0x6784('0x12'));var qs=require(_0x6784('0x13'));var as=require(_0x6784('0x14'));var hardwareService=require(_0x6784('0x15'));var logger=require(_0x6784('0x16'))(_0x6784('0x17'));var utils=require(_0x6784('0x18'));var config=require(_0x6784('0x19'));var licenseUtil=require(_0x6784('0x1a'));var db=require(_0x6784('0x1b'))['db'];config['redis']=_[_0x6784('0x1c')](config[_0x6784('0x1d')],{'host':_0x6784('0x1e'),'port':0x18eb});var socket=require(_0x6784('0x1f'))(new Redis(config['redis']));require(_0x6784('0x20'))[_0x6784('0x21')](socket);function respondWithStatusCode(_0x62426d,_0x2ecec4){_0x2ecec4=_0x2ecec4||0xcc;return function(_0xef56b5){if(_0xef56b5){return _0x62426d[_0x6784('0x22')](_0x2ecec4);}return _0x62426d[_0x6784('0x23')](_0x2ecec4)[_0x6784('0x24')]();};}function respondWithResult(_0x1db6be,_0x32c7a0){_0x32c7a0=_0x32c7a0||0xc8;return function(_0x3db21a){if(_0x3db21a){return _0x1db6be['status'](_0x32c7a0)[_0x6784('0x25')](_0x3db21a);}};}function respondWithFilteredResult(_0x575d8,_0x2be16f){return function(_0x2fd8a2){if(_0x2fd8a2){var _0x594ce9=typeof _0x2be16f[_0x6784('0x26')]===_0x6784('0x27')&&typeof _0x2be16f[_0x6784('0x28')]===_0x6784('0x27');var _0x338067=_0x2fd8a2['count'];var _0x19f415=_0x594ce9?0x0:_0x2be16f[_0x6784('0x26')];var _0x545fd4=_0x594ce9?_0x2fd8a2[_0x6784('0x29')]:_0x2be16f[_0x6784('0x26')]+_0x2be16f[_0x6784('0x28')];var _0x461ced;if(_0x545fd4>=_0x338067){_0x545fd4=_0x338067;_0x461ced=0xc8;}else{_0x461ced=0xce;}_0x575d8['status'](_0x461ced);return _0x575d8[_0x6784('0x2a')](_0x6784('0x2b'),_0x19f415+'-'+_0x545fd4+'/'+_0x338067)['json'](_0x2fd8a2);}return null;};}function patchUpdates(_0x37aea3){return function(_0x2d9f7e){try{jsonpatch[_0x6784('0x2c')](_0x2d9f7e,_0x37aea3,!![]);}catch(_0x305d64){return BPromise[_0x6784('0x2d')](_0x305d64);}return _0x2d9f7e[_0x6784('0x2e')]();};}function saveUpdates(_0x5452a8,_0x466331){return function(_0x345df5){if(_0x345df5){return _0x345df5[_0x6784('0x2f')](_0x5452a8)[_0x6784('0x30')](function(_0x4ac355){return _0x4ac355;});}return null;};}function removeEntity(_0x13598e,_0x4a1b2b){return function(_0x52716e){if(_0x52716e){return _0x52716e['destroy']()[_0x6784('0x30')](function(){var _0x543c14=_0x52716e['get']({'plain':!![]});var _0x51cbe4=_0x6784('0x31');return db[_0x6784('0x32')][_0x6784('0x33')]({'where':{'type':_0x51cbe4,'resourceId':_0x543c14['id']}})[_0x6784('0x30')](function(){return _0x52716e;});})[_0x6784('0x30')](function(){_0x13598e[_0x6784('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17537d,_0x4b296b){return function(_0x569e31){if(!_0x569e31){_0x17537d['sendStatus'](0x194);}return _0x569e31;};}function handleError(_0x2d9c04,_0xe781f8){_0xe781f8=_0xe781f8||0x1f4;return function(_0x461057){logger[_0x6784('0x34')](_0x461057[_0x6784('0x35')]);if(_0x461057['name']){delete _0x461057[_0x6784('0x36')];}_0x2d9c04[_0x6784('0x23')](_0xe781f8)[_0x6784('0x37')](_0x461057);};}exports[_0x6784('0x38')]=function(_0x3a57c6,_0xd9de69){var _0x4ac304={},_0x3dd59d={},_0x5755d6={'count':0x0,'rows':[]};var _0x590cce=_[_0x6784('0x39')](db[_0x6784('0x3a')][_0x6784('0x3b')],function(_0x33c6c8){return{'name':_0x33c6c8['fieldName'],'type':_0x33c6c8[_0x6784('0x3c')][_0x6784('0x3d')]};});_0x3dd59d[_0x6784('0x3e')]=_[_0x6784('0x39')](_0x590cce,_0x6784('0x36'));_0x3dd59d[_0x6784('0x3f')]=_[_0x6784('0x40')](_0x3a57c6[_0x6784('0x3f')]);_0x3dd59d['filters']=_['intersection'](_0x3dd59d[_0x6784('0x3e')],_0x3dd59d['query']);_0x4ac304[_0x6784('0x41')]=_['intersection'](_0x3dd59d[_0x6784('0x3e')],qs['fields'](_0x3a57c6[_0x6784('0x3f')]['fields']));_0x4ac304[_0x6784('0x41')]=_0x4ac304[_0x6784('0x41')]['length']?_0x4ac304['attributes']:_0x3dd59d[_0x6784('0x3e')];if(!_0x3a57c6[_0x6784('0x3f')][_0x6784('0x42')]('nolimit')){_0x4ac304['limit']=qs['limit'](_0x3a57c6[_0x6784('0x3f')][_0x6784('0x28')]);_0x4ac304[_0x6784('0x26')]=qs[_0x6784('0x26')](_0x3a57c6[_0x6784('0x3f')]['offset']);}_0x4ac304[_0x6784('0x43')]=qs[_0x6784('0x44')](_0x3a57c6[_0x6784('0x3f')][_0x6784('0x44')]);_0x4ac304[_0x6784('0x45')]=qs[_0x6784('0x46')](_['pick'](_0x3a57c6[_0x6784('0x3f')],_0x3dd59d[_0x6784('0x46')]),_0x590cce);if(_0x3a57c6[_0x6784('0x3f')][_0x6784('0x47')]){_0x4ac304[_0x6784('0x45')]=_[_0x6784('0x48')](_0x4ac304[_0x6784('0x45')],{'$or':_[_0x6784('0x39')](_0x590cce,function(_0x45a477){if(_0x45a477[_0x6784('0x3c')]!==_0x6784('0x49')){var _0x2059c7={};_0x2059c7[_0x45a477['name']]={'$like':'%'+_0x3a57c6['query'][_0x6784('0x47')]+'%'};return _0x2059c7;}})});}_0x4ac304=_[_0x6784('0x48')]({},_0x4ac304,_0x3a57c6['options']);var _0x208fa4={'where':_0x4ac304[_0x6784('0x45')]};return db[_0x6784('0x3a')][_0x6784('0x29')](_0x208fa4)[_0x6784('0x30')](function(_0x2ccb02){_0x5755d6['count']=_0x2ccb02;if(_0x3a57c6['query'][_0x6784('0x4a')]){_0x4ac304['include']=[{'all':!![]}];}return db[_0x6784('0x3a')][_0x6784('0x4b')](_0x4ac304);})[_0x6784('0x30')](function(_0x549dfb){_0x5755d6[_0x6784('0x4c')]=_0x549dfb;return _0x5755d6;})[_0x6784('0x30')](respondWithFilteredResult(_0xd9de69,_0x4ac304))[_0x6784('0x4d')](handleError(_0xd9de69,null));};exports[_0x6784('0x4e')]=function(_0x53ea27,_0x25b7ca){var _0x5a7c01={'raw':!![],'where':{'id':_0x53ea27[_0x6784('0x4f')]['id']}},_0x57ecc6={};_0x57ecc6[_0x6784('0x3e')]=_['keys'](db['MailQueue'][_0x6784('0x3b')]);_0x57ecc6[_0x6784('0x3f')]=_[_0x6784('0x40')](_0x53ea27['query']);_0x57ecc6[_0x6784('0x46')]=_[_0x6784('0x50')](_0x57ecc6['model'],_0x57ecc6[_0x6784('0x3f')]);_0x5a7c01[_0x6784('0x41')]=_[_0x6784('0x50')](_0x57ecc6['model'],qs[_0x6784('0x51')](_0x53ea27[_0x6784('0x3f')][_0x6784('0x51')]));_0x5a7c01[_0x6784('0x41')]=_0x5a7c01[_0x6784('0x41')][_0x6784('0x52')]?_0x5a7c01[_0x6784('0x41')]:_0x57ecc6[_0x6784('0x3e')];if(_0x53ea27[_0x6784('0x3f')][_0x6784('0x4a')]){_0x5a7c01['include']=[{'all':!![]}];}_0x5a7c01=_['merge']({},_0x5a7c01,_0x53ea27[_0x6784('0x53')]);return db[_0x6784('0x3a')][_0x6784('0x54')](_0x5a7c01)['then'](handleEntityNotFound(_0x25b7ca,null))[_0x6784('0x30')](respondWithResult(_0x25b7ca,null))['catch'](handleError(_0x25b7ca,null));};exports[_0x6784('0x55')]=function(_0x3482da,_0x553e8f){return db[_0x6784('0x3a')]['create'](_0x3482da['body'],{})[_0x6784('0x30')](function(_0x504f0f){var _0x2603f1=_0x3482da[_0x6784('0x56')]['get']({'plain':!![]});if(!_0x2603f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2603f1[_0x6784('0x57')]===_0x6784('0x56')){var _0x5b4801=_0x504f0f[_0x6784('0x58')]({'plain':!![]});var _0x453f09=_0x6784('0x31');return db[_0x6784('0x59')][_0x6784('0x54')]({'where':{'name':_0x453f09,'userProfileId':_0x2603f1[_0x6784('0x5a')]},'raw':!![]})[_0x6784('0x30')](function(_0x408763){if(_0x408763&&_0x408763[_0x6784('0x5b')]===0x0){return db[_0x6784('0x32')][_0x6784('0x55')]({'name':_0x5b4801['name'],'resourceId':_0x5b4801['id'],'type':_0x408763[_0x6784('0x36')],'sectionId':_0x408763['id']},{})[_0x6784('0x30')](function(){return _0x504f0f;});}else{return _0x504f0f;}})[_0x6784('0x4d')](function(_0x38f86a){logger[_0x6784('0x34')](_0x6784('0x5c'),_0x38f86a);throw _0x38f86a;});}return _0x504f0f;})[_0x6784('0x30')](respondWithResult(_0x553e8f,0xc9))[_0x6784('0x4d')](handleError(_0x553e8f,null));};exports['update']=function(_0x1f9569,_0x1b1bd4){if(_0x1f9569[_0x6784('0x5d')]['id']){delete _0x1f9569[_0x6784('0x5d')]['id'];}return db[_0x6784('0x3a')][_0x6784('0x54')]({'where':{'id':_0x1f9569[_0x6784('0x4f')]['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x1b1bd4,null))[_0x6784('0x30')](saveUpdates(_0x1f9569[_0x6784('0x5d')],null))[_0x6784('0x30')](respondWithResult(_0x1b1bd4,null))[_0x6784('0x4d')](handleError(_0x1b1bd4,null));};exports[_0x6784('0x33')]=function(_0x5d227c,_0x2043aa){return db[_0x6784('0x3a')][_0x6784('0x54')]({'where':{'id':_0x5d227c[_0x6784('0x4f')]['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x2043aa,null))['then'](removeEntity(_0x2043aa,null))['catch'](handleError(_0x2043aa,null));};exports['describe']=function(_0x2f65a1,_0x2bf541){return db[_0x6784('0x3a')][_0x6784('0x5e')]()[_0x6784('0x30')](respondWithResult(_0x2bf541,null))[_0x6784('0x4d')](handleError(_0x2bf541,null));};exports[_0x6784('0x5f')]=function(_0x476bfb,_0x2cc61d,_0x22e871){var _0x329bc9={'raw':!![],'where':{}},_0xd8a537={},_0x4cd72d;return db['MailQueue'][_0x6784('0x60')]({'where':{'id':_0x476bfb['params']['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x2cc61d,null))[_0x6784('0x30')](function(_0x21e987){if(_0x21e987){_0x4cd72d=_0x21e987['get']({'plain':!![]});_0xd8a537[_0x6784('0x3e')]=_['keys'](db[_0x6784('0x61')][_0x6784('0x3b')]);_0xd8a537[_0x6784('0x3f')]=_['keys'](_0x476bfb['query']);_0xd8a537[_0x6784('0x46')]=_[_0x6784('0x50')](_0xd8a537[_0x6784('0x3e')],_0xd8a537['query']);_0x329bc9[_0x6784('0x41')]=_[_0x6784('0x50')](_0xd8a537[_0x6784('0x3e')],qs[_0x6784('0x51')](_0x476bfb[_0x6784('0x3f')][_0x6784('0x51')]));_0x329bc9[_0x6784('0x41')]=_0x329bc9['attributes'][_0x6784('0x52')]?_0x329bc9[_0x6784('0x41')]:_0xd8a537[_0x6784('0x3e')];if(!_0x476bfb['query']['hasOwnProperty']('nolimit')){_0x329bc9[_0x6784('0x28')]=qs[_0x6784('0x28')](_0x476bfb[_0x6784('0x3f')][_0x6784('0x28')]);_0x329bc9[_0x6784('0x26')]=qs[_0x6784('0x26')](_0x476bfb[_0x6784('0x3f')][_0x6784('0x26')]);}_0x329bc9[_0x6784('0x43')]=qs[_0x6784('0x44')](_0x476bfb[_0x6784('0x3f')]['sort']);_0x329bc9[_0x6784('0x45')]=qs[_0x6784('0x46')](_[_0x6784('0x62')](_0x476bfb['query'],_0xd8a537[_0x6784('0x46')]));_0x329bc9[_0x6784('0x45')][_0x6784('0x63')]=_0x21e987['id'];if(_0x476bfb[_0x6784('0x3f')][_0x6784('0x47')]){_0x329bc9[_0x6784('0x45')]=_[_0x6784('0x48')](_0x329bc9[_0x6784('0x45')],{'$or':_[_0x6784('0x39')](_0x329bc9[_0x6784('0x41')],function(_0x2bf86a){var _0x1aab28={};_0x1aab28[_0x2bf86a]={'$like':'%'+_0x476bfb[_0x6784('0x3f')][_0x6784('0x47')]+'%'};return _0x1aab28;})});}_0x329bc9=_[_0x6784('0x48')]({},_0x329bc9,_0x476bfb['options']);return db['UserMailQueue'][_0x6784('0x4b')](_0x329bc9);}})[_0x6784('0x30')](function(_0x147926){if(_0x147926){return db['User']['findAndCountAll']({'where':{'id':_[_0x6784('0x39')](_0x147926,_0x6784('0x64')),'role':_0x6784('0x65')},'attributes':['id',_0x6784('0x36'),_0x6784('0x66'),_0x6784('0x67'),'createdAt']});}})[_0x6784('0x30')](function(_0x5bbeb5){if(_0x5bbeb5){return{'count':_0x5bbeb5['count'],'rows':_[_0x6784('0x39')](_0x5bbeb5['rows'],function(_0x1f82a4){return{'membername':_0x1f82a4[_0x6784('0x36')],'UserId':_0x1f82a4['id'],'queue_name':_0x4cd72d[_0x6784('0x36')],'MailQueueId':_0x4cd72d['id'],'interface':util[_0x6784('0x68')](_0x6784('0x69'),_0x6784('0x6a'),_0x1f82a4[_0x6784('0x36')]),'penalty':0x0,'paused':_0x1f82a4[_0x6784('0x66')],'createdAt':_0x1f82a4[_0x6784('0x6b')],'updatedAt':_0x1f82a4[_0x6784('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6784('0x30')](respondWithFilteredResult(_0x2cc61d,_0x329bc9))[_0x6784('0x4d')](handleError(_0x2cc61d,null));};exports['getTeams']=function(_0x3b6cb2,_0x3432da,_0x4c0530){var _0x5e744f={};var _0x2ca92d={};var _0x428dc1;var _0x5a04e6;return db['MailQueue']['findOne']({'where':{'id':_0x3b6cb2['params']['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x3432da,null))['then'](function(_0x4da141){if(_0x4da141){_0x428dc1=_0x4da141;_0x2ca92d[_0x6784('0x3e')]=_[_0x6784('0x40')](db[_0x6784('0x6c')]['rawAttributes']);_0x2ca92d['query']=_['keys'](_0x3b6cb2[_0x6784('0x3f')]);_0x2ca92d[_0x6784('0x46')]=_['intersection'](_0x2ca92d[_0x6784('0x3e')],_0x2ca92d['query']);_0x5e744f[_0x6784('0x41')]=_[_0x6784('0x50')](_0x2ca92d[_0x6784('0x3e')],qs[_0x6784('0x51')](_0x3b6cb2[_0x6784('0x3f')][_0x6784('0x51')]));_0x5e744f[_0x6784('0x41')]=_0x5e744f[_0x6784('0x41')][_0x6784('0x52')]?_0x5e744f[_0x6784('0x41')]:_0x2ca92d[_0x6784('0x3e')];_0x5e744f[_0x6784('0x43')]=qs[_0x6784('0x44')](_0x3b6cb2[_0x6784('0x3f')][_0x6784('0x44')]);_0x5e744f[_0x6784('0x45')]=qs[_0x6784('0x46')](_['pick'](_0x3b6cb2[_0x6784('0x3f')],_0x2ca92d[_0x6784('0x46')]));if(_0x3b6cb2[_0x6784('0x3f')]['filter']){_0x5e744f[_0x6784('0x45')]=_['merge'](_0x5e744f[_0x6784('0x45')],{'$or':_['map'](_0x5e744f['attributes'],function(_0x1e640b){var _0x4cb80c={};_0x4cb80c[_0x1e640b]={'$like':'%'+_0x3b6cb2[_0x6784('0x3f')][_0x6784('0x47')]+'%'};return _0x4cb80c;})});}_0x5e744f=_['merge']({},_0x5e744f,_0x3b6cb2['options']);return _0x428dc1[_0x6784('0x6d')](_0x5e744f);}})['then'](function(_0x115e5a){if(_0x115e5a){_0x5a04e6=_0x115e5a[_0x6784('0x52')];if(!_0x3b6cb2[_0x6784('0x3f')][_0x6784('0x42')](_0x6784('0x6e'))){_0x5e744f[_0x6784('0x28')]=qs[_0x6784('0x28')](_0x3b6cb2[_0x6784('0x3f')][_0x6784('0x28')]);_0x5e744f[_0x6784('0x26')]=qs[_0x6784('0x26')](_0x3b6cb2[_0x6784('0x3f')][_0x6784('0x26')]);}return _0x428dc1['getTeams'](_0x5e744f);}})[_0x6784('0x30')](function(_0x449f1f){if(_0x449f1f){return _0x449f1f?{'count':_0x5a04e6,'rows':_0x449f1f}:null;}})['then'](respondWithResult(_0x3432da,null))[_0x6784('0x4d')](handleError(_0x3432da,null));};exports[_0x6784('0x6f')]=function(_0x17c69e,_0x2a7cf5,_0x57e62f){var _0x35322d=_0x17c69e[_0x6784('0x5d')][_0x6784('0x70')];return db[_0x6784('0x6c')]['findAll']({'where':{'id':_0x35322d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6784('0x71'),'attributes':['id',_0x6784('0x36'),_0x6784('0x72'),_0x6784('0x73'),'interface'],'raw':!![]}]})[_0x6784('0x30')](function(_0x12467e){if(_0x12467e){var _0x3bab68=_[_0x6784('0x74')](_0x12467e,function(_0x388082){var _0x251316=_0x388082[_0x6784('0x58')]({'plain':!![]});return _0x251316[_0x6784('0x71')];});return db['MailQueue'][_0x6784('0x54')]({'where':{'id':_0x17c69e['params']['id']}})['then'](function(_0x1f3851){return db[_0x6784('0x75')][_0x6784('0x76')](function(_0x391194){return _0x1f3851[_0x6784('0x6f')](_0x35322d,{'transaction':_0x391194})[_0x6784('0x30')](function(){return BPromise[_0x6784('0x77')](_0x3bab68,function(_0x27f4c6){return db[_0x6784('0x61')]['findOrCreate']({'where':{'UserId':_0x27f4c6['id'],'MailQueueId':_0x17c69e[_0x6784('0x4f')]['id']},'transaction':_0x391194});});})[_0x6784('0x30')](function(){_0x3bab68[_0x6784('0x78')](function(_0x193b16){socket[_0x6784('0x79')]('userMailQueue:save',{'UserId':_0x193b16['id'],'MailQueueId':_0x1f3851['id']});});});});});}})[_0x6784('0x30')](respondWithStatusCode(_0x2a7cf5,null))[_0x6784('0x4d')](handleError(_0x2a7cf5,null));};exports[_0x6784('0x7a')]=function(_0x95afb0,_0x341eef,_0x538f9a){return db['Team']['findAll']({'where':{'id':_0x95afb0['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x6784('0x7b')],'as':_0x6784('0x71'),'attributes':['id'],'raw':!![]}]})[_0x6784('0x30')](handleEntityNotFound(_0x341eef,null))['then'](function(_0x25dd4c){var _0xca37e1=_[_0x6784('0x39')](_0x25dd4c,'id');var _0x2f91fd=[];var _0x492402=[];var _0x398e5c=squel['select']();_0x398e5c[_0x6784('0x7c')]('tq.TeamId')[_0x6784('0x7d')]('team_has_mail_queues','tq')[_0x6784('0x7e')](_0x6784('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6784('0x80'),_0x95afb0['params']['id']);for(var _0x37221c=0x0;_0x37221c<_0x25dd4c[_0x6784('0x52')];_0x37221c+=0x1){let _0x357cb6=_0x25dd4c[_0x37221c];for(var _0x1e4828=0x0;_0x1e4828<_0x357cb6[_0x6784('0x71')]['length'];_0x1e4828+=0x1){let _0x39af74=_0x357cb6['Agents'][_0x1e4828];var _0x518ec6=_0x398e5c[_0x6784('0x81')]();_0x518ec6[_0x6784('0x45')](_0x6784('0x82'),_0x39af74['id']);_0x492402['push'](db['sequelize'][_0x6784('0x3f')](_0x518ec6[_0x6784('0x83')](),{'type':db[_0x6784('0x75')]['QueryTypes'][_0x6784('0x84')]})[_0x6784('0x30')](function(_0xfb9da2){if(_0xfb9da2[_0x6784('0x52')]===0x1){return _0x39af74['id'];}else{var _0x2b6dd3=_[_0x6784('0x85')](_[_0x6784('0x39')](_0xfb9da2,_0x6784('0x86')),function(_0x5eb765){return _['includes'](_0xca37e1,_0x5eb765);});if(_0x2b6dd3){return _0x39af74['id'];}}}));}}return BPromise[_0x6784('0x87')](_0x492402)[_0x6784('0x30')](function(_0x22f5f2){_0x2f91fd=_(_0x2f91fd)[_0x6784('0x88')](_0x22f5f2)[_0x6784('0x89')]()[_0x6784('0x8a')]();return db[_0x6784('0x3a')]['find']({'where':{'id':_0x95afb0[_0x6784('0x4f')]['id']}})[_0x6784('0x30')](function(_0x2d90e9){return db['sequelize'][_0x6784('0x76')](function(_0xcbb2ab){return _0x2d90e9['removeTeams'](_0x95afb0[_0x6784('0x3f')][_0x6784('0x70')],{'transaction':_0xcbb2ab})[_0x6784('0x30')](function(){if(!_['isEmpty'](_0x2f91fd)){return _0x2d90e9['removeAgents'](_0x2f91fd,{'transaction':_0xcbb2ab});}})[_0x6784('0x30')](function(){_0x2f91fd[_0x6784('0x78')](function(_0x100b6a){socket[_0x6784('0x79')](_0x6784('0x8b'),{'UserId':_0x100b6a,'MailQueueId':_0x2d90e9['id']});});});});});});})[_0x6784('0x30')](respondWithStatusCode(_0x341eef,null))['catch'](handleError(_0x341eef,null));};exports['addAgents']=function(_0x404406,_0x423c2e,_0x4e028d){return db[_0x6784('0x3a')][_0x6784('0x54')]({'where':{'id':_0x404406[_0x6784('0x4f')]['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x423c2e,null))[_0x6784('0x30')](function(_0x43da5b){if(_0x43da5b){return _0x43da5b[_0x6784('0x8c')](_0x404406[_0x6784('0x5d')]['ids'],_['omit'](_0x404406[_0x6784('0x5d')],[_0x6784('0x70'),'id'])||{})['spread'](function(_0x28215c){for(var _0x12086b=0x0;_0x12086b<_0x404406[_0x6784('0x5d')][_0x6784('0x70')]['length'];_0x12086b+=0x1){socket[_0x6784('0x79')](_0x6784('0x8d'),{'UserId':Number(_0x404406[_0x6784('0x5d')]['ids'][_0x12086b]),'MailQueueId':Number(_0x404406['params']['id'])});}return _0x28215c;});}})[_0x6784('0x30')](respondWithResult(_0x423c2e,null))[_0x6784('0x4d')](handleError(_0x423c2e,null));};exports[_0x6784('0x8e')]=function(_0x399be1,_0x1ea275,_0x332f09){return db[_0x6784('0x3a')][_0x6784('0x54')]({'where':{'id':_0x399be1[_0x6784('0x4f')]['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x1ea275,null))[_0x6784('0x30')](function(_0x1bafc9){if(_0x1bafc9){return _0x1bafc9[_0x6784('0x8e')](_0x399be1[_0x6784('0x3f')][_0x6784('0x70')])['then'](function(){if(_[_0x6784('0x8f')](_0x399be1['query'][_0x6784('0x70')])){for(var _0x1b6799=0x0;_0x1b6799<_0x399be1[_0x6784('0x3f')][_0x6784('0x70')]['length'];_0x1b6799+=0x1){socket[_0x6784('0x79')](_0x6784('0x8b'),{'UserId':Number(_0x399be1[_0x6784('0x3f')]['ids'][_0x1b6799]),'MailQueueId':Number(_0x399be1[_0x6784('0x4f')]['id'])});}}else{socket[_0x6784('0x79')](_0x6784('0x8b'),{'UserId':Number(_0x399be1['query'][_0x6784('0x70')]),'MailQueueId':Number(_0x399be1[_0x6784('0x4f')]['id'])});}});}})[_0x6784('0x30')](respondWithStatusCode(_0x1ea275,null))[_0x6784('0x4d')](handleError(_0x1ea275,null));};exports['getAgents']=function(_0x322a0c,_0x2b1041,_0x344203){var _0x379436={};var _0xee4ca={};var _0x156129;var _0x253255;return db[_0x6784('0x3a')]['findOne']({'where':{'id':_0x322a0c[_0x6784('0x4f')]['id']}})[_0x6784('0x30')](handleEntityNotFound(_0x2b1041,null))[_0x6784('0x30')](function(_0x40281c){if(_0x40281c){_0x156129=_0x40281c;_0xee4ca[_0x6784('0x3e')]=_[_0x6784('0x40')](db[_0x6784('0x7b')][_0x6784('0x3b')]);_0xee4ca['query']=_[_0x6784('0x40')](_0x322a0c[_0x6784('0x3f')]);_0xee4ca[_0x6784('0x46')]=_['intersection'](_0xee4ca[_0x6784('0x3e')],_0xee4ca['query']);_0x379436[_0x6784('0x41')]=_[_0x6784('0x50')](_0xee4ca[_0x6784('0x3e')],qs[_0x6784('0x51')](_0x322a0c[_0x6784('0x3f')]['fields']));_0x379436[_0x6784('0x41')]=_0x379436[_0x6784('0x41')][_0x6784('0x52')]?_0x379436['attributes']:_0xee4ca[_0x6784('0x3e')];_0x379436['order']=qs[_0x6784('0x44')](_0x322a0c[_0x6784('0x3f')][_0x6784('0x44')]);_0x379436[_0x6784('0x45')]=qs['filters'](_[_0x6784('0x62')](_0x322a0c[_0x6784('0x3f')],_0xee4ca[_0x6784('0x46')]));if(_0x322a0c['query']['filter']){_0x379436[_0x6784('0x45')]=_[_0x6784('0x48')](_0x379436['where'],{'$or':_[_0x6784('0x39')](_0x379436[_0x6784('0x41')],function(_0x563fd8){var _0x34b676={};_0x34b676[_0x563fd8]={'$like':'%'+_0x322a0c['query'][_0x6784('0x47')]+'%'};return _0x34b676;})});}_0x379436=_[_0x6784('0x48')]({},_0x379436,_0x322a0c[_0x6784('0x53')]);return _0x156129[_0x6784('0x90')](_0x379436);}})[_0x6784('0x30')](function(_0x575b41){if(_0x575b41){_0x253255=_0x575b41['length'];if(!_0x322a0c[_0x6784('0x3f')][_0x6784('0x42')](_0x6784('0x6e'))){_0x379436[_0x6784('0x28')]=qs[_0x6784('0x28')](_0x322a0c['query']['limit']);_0x379436[_0x6784('0x26')]=qs[_0x6784('0x26')](_0x322a0c[_0x6784('0x3f')]['offset']);}return _0x156129[_0x6784('0x90')](_0x379436);}})[_0x6784('0x30')](function(_0x3f8d94){if(_0x3f8d94){return _0x3f8d94?{'count':_0x253255,'rows':_0x3f8d94}:null;}})[_0x6784('0x30')](respondWithResult(_0x2b1041,null))[_0x6784('0x4d')](handleError(_0x2b1041,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 0cb030a..b0da91b 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 _0x4b4a=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2d7836,_0x5a5412){var _0x491179=function(_0xaafd3){while(--_0xaafd3){_0x2d7836['push'](_0x2d7836['shift']());}};_0x491179(++_0x5a5412);}(_0x4b4a,0xef));var _0xa4b4=function(_0x783834,_0x38c810){_0x783834=_0x783834-0x0;var _0x22055f=_0x4b4a[_0x783834];return _0x22055f;};'use strict';var EventEmitter=require(_0xa4b4('0x0'));var MailQueue=require(_0xa4b4('0x1'))['db'][_0xa4b4('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa4b4('0x3')](0x0);var events={'afterCreate':_0xa4b4('0x4'),'afterUpdate':_0xa4b4('0x5'),'afterDestroy':_0xa4b4('0x6')};function emitEvent(_0x5749be){return function(_0x592e86,_0x288137,_0x12dc5b){MailQueueEvents[_0xa4b4('0x7')](_0x5749be+':'+_0x592e86['id'],_0x592e86);MailQueueEvents[_0xa4b4('0x7')](_0x5749be,_0x592e86);_0x12dc5b(null);};}for(var e in events){if(events[_0xa4b4('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xa4b4('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x84ef=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x84ef,0x1ec));var _0xf84e=function(_0x47b288,_0x18288a){_0x47b288=_0x47b288-0x0;var _0x2e488a=_0x84ef[_0x47b288];return _0x2e488a;};'use strict';var EventEmitter=require(_0xf84e('0x0'));var MailQueue=require(_0xf84e('0x1'))['db'][_0xf84e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf84e('0x3')](0x0);var events={'afterCreate':_0xf84e('0x4'),'afterUpdate':_0xf84e('0x5'),'afterDestroy':_0xf84e('0x6')};function emitEvent(_0x13b8a8){return function(_0x39e5d,_0x35a617,_0x39e0e3){MailQueueEvents['emit'](_0x13b8a8+':'+_0x39e5d['id'],_0x39e5d);MailQueueEvents[_0xf84e('0x7')](_0x13b8a8,_0x39e5d);_0x39e0e3(null);};}for(var e in events){if(events[_0xf84e('0x8')](e)){var event=events[e];MailQueue[_0xf84e('0x9')](e,emitEvent(event));}}module[_0xf84e('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f74bf6d..6a0ef1c 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 _0x3e7e=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e84ac,_0x3b7a03){var _0x20153f=function(_0x1a78a3){while(--_0x1a78a3){_0x2e84ac['push'](_0x2e84ac['shift']());}};_0x20153f(++_0x3b7a03);}(_0x3e7e,0x125));var _0xe3e7=function(_0x7260da,_0x4566e1){_0x7260da=_0x7260da-0x0;var _0x3d2eaf=_0x3e7e[_0x7260da];return _0x3d2eaf;};'use strict';var _=require(_0xe3e7('0x0'));var util=require(_0xe3e7('0x1'));var logger=require(_0xe3e7('0x2'))(_0xe3e7('0x3'));var moment=require(_0xe3e7('0x4'));var BPromise=require(_0xe3e7('0x5'));var rp=require(_0xe3e7('0x6'));var fs=require('fs');var path=require(_0xe3e7('0x7'));var rimraf=require(_0xe3e7('0x8'));var config=require(_0xe3e7('0x9'));var attributes=require(_0xe3e7('0xa'));module[_0xe3e7('0xb')]=function(_0x491a97,_0x589e8e){return _0x491a97['define'](_0xe3e7('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83a7=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x42f381,_0x519bce){var _0x40a6c4=function(_0x523327){while(--_0x523327){_0x42f381['push'](_0x42f381['shift']());}};_0x40a6c4(++_0x519bce);}(_0x83a7,0x67));var _0x783a=function(_0x47aeca,_0x38edea){_0x47aeca=_0x47aeca-0x0;var _0x3a2993=_0x83a7[_0x47aeca];return _0x3a2993;};'use strict';var _=require(_0x783a('0x0'));var util=require(_0x783a('0x1'));var logger=require(_0x783a('0x2'))(_0x783a('0x3'));var moment=require(_0x783a('0x4'));var BPromise=require(_0x783a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x783a('0x6'));var rimraf=require(_0x783a('0x7'));var config=require(_0x783a('0x8'));var attributes=require(_0x783a('0x9'));module[_0x783a('0xa')]=function(_0x84ea6d,_0x2fb026){return _0x84ea6d[_0x783a('0xb')](_0x783a('0xc'),attributes,{'tableName':_0x783a('0xd'),'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 8bc3195..942bfa5 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 _0x043d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailQueue.socket','register','request','then','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','model','map','info','debug','catch','ShowMailQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x043d,0x1ba));var _0xd043=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x043d[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0xd043('0x0'));var util=require(_0xd043('0x1'));var moment=require(_0xd043('0x2'));var BPromise=require(_0xd043('0x3'));var rs=require(_0xd043('0x4'));var fs=require('fs');var Redis=require(_0xd043('0x5'));var db=require(_0xd043('0x6'))['db'];var utils=require(_0xd043('0x7'));var logger=require(_0xd043('0x8'))(_0xd043('0x9'));var config=require(_0xd043('0xa'));var jayson=require(_0xd043('0xb'));var client=jayson[_0xd043('0xc')][_0xd043('0xd')]({'port':0x232a});config['redis']=_[_0xd043('0xe')](config[_0xd043('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xd043('0x10'))(new Redis(config['redis']));require(_0xd043('0x11'))[_0xd043('0x12')](socket);function respondWithRpcPromise(_0x23540a,_0x57b902,_0x447851){return new BPromise(function(_0x1c6fe8,_0x43973e){return client[_0xd043('0x13')](_0x23540a,_0x447851)[_0xd043('0x14')](function(_0x3d15fa){logger['info']('MailQueue,\x20%s,\x20%s',_0x57b902,_0xd043('0x15'));logger['debug'](_0xd043('0x16'),_0x57b902,_0xd043('0x15'),JSON[_0xd043('0x17')](_0x3d15fa));if(_0x3d15fa[_0xd043('0x18')]){if(_0x3d15fa[_0xd043('0x18')][_0xd043('0x19')]===0x1f4){logger[_0xd043('0x18')](_0xd043('0x1a'),_0x57b902,_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);return _0x43973e(_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);}logger[_0xd043('0x18')](_0xd043('0x1a'),_0x57b902,_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);return _0x1c6fe8(_0x3d15fa[_0xd043('0x18')][_0xd043('0x1b')]);}else{logger['info'](_0xd043('0x1a'),_0x57b902,_0xd043('0x15'));_0x1c6fe8(_0x3d15fa[_0xd043('0x1c')][_0xd043('0x1b')]);}})['catch'](function(_0x24cb8e){logger[_0xd043('0x18')](_0xd043('0x1a'),_0x57b902,_0x24cb8e);_0x43973e(_0x24cb8e);});});}exports[_0xd043('0x1d')]=function(_0x57bcd1){var _0x24a37a=this;return new Promise(function(_0x2681b9,_0x2d7758){return db[_0xd043('0x1e')][_0xd043('0x1f')]({'raw':_0x57bcd1['options']?_0x57bcd1[_0xd043('0x20')][_0xd043('0x21')]===undefined?!![]:![]:!![],'where':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1['options']['where']||null:null,'attributes':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1[_0xd043('0x20')][_0xd043('0x22')]||null:null,'limit':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1[_0xd043('0x20')][_0xd043('0x23')]||null:null,'include':_0x57bcd1[_0xd043('0x20')]?_0x57bcd1[_0xd043('0x20')][_0xd043('0x24')]?_['map'](_0x57bcd1[_0xd043('0x20')][_0xd043('0x24')],function(_0x5b7f50){return{'model':db[_0x5b7f50[_0xd043('0x25')]],'as':_0x5b7f50['as'],'attributes':_0x5b7f50[_0xd043('0x22')],'include':_0x5b7f50[_0xd043('0x24')]?_[_0xd043('0x26')](_0x5b7f50[_0xd043('0x24')],function(_0x5a004e){return{'model':db[_0x5a004e[_0xd043('0x25')]],'as':_0x5a004e['as'],'attributes':_0x5a004e[_0xd043('0x22')],'include':_0x5a004e['include']?_['map'](_0x5a004e['include'],function(_0x35cdfd){return{'model':db[_0x35cdfd[_0xd043('0x25')]],'as':_0x35cdfd['as'],'attributes':_0x35cdfd[_0xd043('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd043('0x14')](function(_0x583d5c){logger[_0xd043('0x27')](_0xd043('0x1d'),_0x57bcd1);logger[_0xd043('0x28')](_0xd043('0x1d'),_0x57bcd1,JSON[_0xd043('0x17')](_0x583d5c));_0x2681b9(_0x583d5c);})[_0xd043('0x29')](function(_0x4a6e7c){logger[_0xd043('0x18')](_0xd043('0x1d'),_0x4a6e7c[_0xd043('0x1b')],_0x57bcd1);_0x2d7758(_0x24a37a[_0xd043('0x18')](0x1f4,_0x4a6e7c['message']));});});};exports[_0xd043('0x2a')]=function(_0x566550){var _0x1f7bce=this;return new Promise(function(_0xb714a8,_0x3de8b1){return db['MailQueue'][_0xd043('0x2b')]({'raw':_0x566550[_0xd043('0x20')]?_0x566550['options'][_0xd043('0x21')]===undefined?!![]:![]:!![],'where':_0x566550[_0xd043('0x20')]?_0x566550[_0xd043('0x20')][_0xd043('0x2c')]||null:null,'attributes':_0x566550['options']?_0x566550[_0xd043('0x20')][_0xd043('0x22')]||null:null,'include':_0x566550[_0xd043('0x20')]?_0x566550[_0xd043('0x20')]['include']?_[_0xd043('0x26')](_0x566550[_0xd043('0x20')]['include'],function(_0x5ad3f3){return{'model':db[_0x5ad3f3[_0xd043('0x25')]],'as':_0x5ad3f3['as'],'attributes':_0x5ad3f3['attributes'],'include':_0x5ad3f3[_0xd043('0x24')]?_['map'](_0x5ad3f3[_0xd043('0x24')],function(_0x52a69d){return{'model':db[_0x52a69d[_0xd043('0x25')]],'as':_0x52a69d['as'],'attributes':_0x52a69d[_0xd043('0x22')],'include':_0x52a69d[_0xd043('0x24')]?_[_0xd043('0x26')](_0x52a69d[_0xd043('0x24')],function(_0x482397){return{'model':db[_0x482397[_0xd043('0x25')]],'as':_0x482397['as'],'attributes':_0x482397[_0xd043('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x413cb0){logger[_0xd043('0x27')](_0xd043('0x2a'),_0x566550);logger[_0xd043('0x28')](_0xd043('0x2a'),_0x566550,JSON[_0xd043('0x17')](_0x413cb0));_0xb714a8(_0x413cb0);})[_0xd043('0x29')](function(_0x259391){logger[_0xd043('0x18')](_0xd043('0x2a'),_0x259391[_0xd043('0x1b')],_0x566550);_0x3de8b1(_0x1f7bce[_0xd043('0x18')](0x1f4,_0x259391[_0xd043('0x1b')]));});});}; \ No newline at end of file +var _0x2488=['http','redis','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','GetMailQueue','MailQueue','options','where','attributes','limit','include','map','model','catch','ShowMailQueue','find','raw','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x443b4c,_0x1cfef3){var _0x439e97=function(_0x1fb51b){while(--_0x1fb51b){_0x443b4c['push'](_0x443b4c['shift']());}};_0x439e97(++_0x1cfef3);}(_0x2488,0xac));var _0x8248=function(_0x49aab7,_0x1d6397){_0x49aab7=_0x49aab7-0x0;var _0x587b6f=_0x2488[_0x49aab7];return _0x587b6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8248('0x0'));var rs=require(_0x8248('0x1'));var fs=require('fs');var Redis=require(_0x8248('0x2'));var db=require(_0x8248('0x3'))['db'];var utils=require(_0x8248('0x4'));var logger=require(_0x8248('0x5'))('rpc');var config=require(_0x8248('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8248('0x7')][_0x8248('0x8')]({'port':0x232a});config[_0x8248('0x9')]=_['defaults'](config[_0x8248('0x9')],{'host':_0x8248('0xa'),'port':0x18eb});var socket=require(_0x8248('0xb'))(new Redis(config['redis']));require(_0x8248('0xc'))['register'](socket);function respondWithRpcPromise(_0x593ddf,_0x45e8fb,_0x4d8f93){return new BPromise(function(_0x25ee62,_0x1dbac1){return client['request'](_0x593ddf,_0x4d8f93)[_0x8248('0xd')](function(_0x44c92f){logger[_0x8248('0xe')](_0x8248('0xf'),_0x45e8fb,_0x8248('0x10'));logger[_0x8248('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x45e8fb,_0x8248('0x10'),JSON['stringify'](_0x44c92f));if(_0x44c92f['error']){if(_0x44c92f['error'][_0x8248('0x12')]===0x1f4){logger['error'](_0x8248('0xf'),_0x45e8fb,_0x44c92f[_0x8248('0x13')]['message']);return _0x1dbac1(_0x44c92f[_0x8248('0x13')]['message']);}logger['error'](_0x8248('0xf'),_0x45e8fb,_0x44c92f[_0x8248('0x13')]['message']);return _0x25ee62(_0x44c92f[_0x8248('0x13')][_0x8248('0x14')]);}else{logger[_0x8248('0xe')](_0x8248('0xf'),_0x45e8fb,_0x8248('0x10'));_0x25ee62(_0x44c92f[_0x8248('0x15')][_0x8248('0x14')]);}})['catch'](function(_0x24ca7d){logger[_0x8248('0x13')](_0x8248('0xf'),_0x45e8fb,_0x24ca7d);_0x1dbac1(_0x24ca7d);});});}exports[_0x8248('0x16')]=function(_0x56c222){var _0x246fd1=this;return new Promise(function(_0x4c21b5,_0x3a9c4b){return db[_0x8248('0x17')]['findAll']({'raw':_0x56c222['options']?_0x56c222['options']['raw']===undefined?!![]:![]:!![],'where':_0x56c222[_0x8248('0x18')]?_0x56c222[_0x8248('0x18')][_0x8248('0x19')]||null:null,'attributes':_0x56c222[_0x8248('0x18')]?_0x56c222['options'][_0x8248('0x1a')]||null:null,'limit':_0x56c222[_0x8248('0x18')]?_0x56c222[_0x8248('0x18')][_0x8248('0x1b')]||null:null,'include':_0x56c222[_0x8248('0x18')]?_0x56c222[_0x8248('0x18')][_0x8248('0x1c')]?_[_0x8248('0x1d')](_0x56c222[_0x8248('0x18')][_0x8248('0x1c')],function(_0x4415e9){return{'model':db[_0x4415e9[_0x8248('0x1e')]],'as':_0x4415e9['as'],'attributes':_0x4415e9[_0x8248('0x1a')],'include':_0x4415e9[_0x8248('0x1c')]?_[_0x8248('0x1d')](_0x4415e9[_0x8248('0x1c')],function(_0xdf06d1){return{'model':db[_0xdf06d1['model']],'as':_0xdf06d1['as'],'attributes':_0xdf06d1[_0x8248('0x1a')],'include':_0xdf06d1[_0x8248('0x1c')]?_[_0x8248('0x1d')](_0xdf06d1[_0x8248('0x1c')],function(_0x50632b){return{'model':db[_0x50632b['model']],'as':_0x50632b['as'],'attributes':_0x50632b[_0x8248('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43d0b7){logger[_0x8248('0xe')](_0x8248('0x16'),_0x56c222);logger[_0x8248('0x11')](_0x8248('0x16'),_0x56c222,JSON['stringify'](_0x43d0b7));_0x4c21b5(_0x43d0b7);})[_0x8248('0x1f')](function(_0x586da5){logger[_0x8248('0x13')](_0x8248('0x16'),_0x586da5[_0x8248('0x14')],_0x56c222);_0x3a9c4b(_0x246fd1['error'](0x1f4,_0x586da5[_0x8248('0x14')]));});});};exports[_0x8248('0x20')]=function(_0x6c33dd){var _0x54a814=this;return new Promise(function(_0x40da0a,_0x5df84a){return db[_0x8248('0x17')][_0x8248('0x21')]({'raw':_0x6c33dd[_0x8248('0x18')]?_0x6c33dd[_0x8248('0x18')][_0x8248('0x22')]===undefined?!![]:![]:!![],'where':_0x6c33dd['options']?_0x6c33dd[_0x8248('0x18')][_0x8248('0x19')]||null:null,'attributes':_0x6c33dd[_0x8248('0x18')]?_0x6c33dd['options'][_0x8248('0x1a')]||null:null,'include':_0x6c33dd[_0x8248('0x18')]?_0x6c33dd[_0x8248('0x18')]['include']?_[_0x8248('0x1d')](_0x6c33dd['options'][_0x8248('0x1c')],function(_0x12ebb0){return{'model':db[_0x12ebb0['model']],'as':_0x12ebb0['as'],'attributes':_0x12ebb0[_0x8248('0x1a')],'include':_0x12ebb0[_0x8248('0x1c')]?_['map'](_0x12ebb0['include'],function(_0x518f5b){return{'model':db[_0x518f5b[_0x8248('0x1e')]],'as':_0x518f5b['as'],'attributes':_0x518f5b[_0x8248('0x1a')],'include':_0x518f5b[_0x8248('0x1c')]?_[_0x8248('0x1d')](_0x518f5b[_0x8248('0x1c')],function(_0x5aca12){return{'model':db[_0x5aca12['model']],'as':_0x5aca12['as'],'attributes':_0x5aca12['attributes']};}):[]};}):[]};}):[]:[]})[_0x8248('0xd')](function(_0x58a098){logger[_0x8248('0xe')](_0x8248('0x20'),_0x6c33dd);logger[_0x8248('0x11')]('ShowMailQueue',_0x6c33dd,JSON[_0x8248('0x23')](_0x58a098));_0x40da0a(_0x58a098);})[_0x8248('0x1f')](function(_0x5a7c3c){logger[_0x8248('0x13')]('ShowMailQueue',_0x5a7c3c[_0x8248('0x14')],_0x6c33dd);_0x5df84a(_0x54a814[_0x8248('0x13')](0x1f4,_0x5a7c3c[_0x8248('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index f403de1..f772a29 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 _0xc3d4=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3d4,0xd3));var _0x4c3d=function(_0x4976eb,_0x4b09d1){_0x4976eb=_0x4976eb-0x0;var _0x5dd7b2=_0xc3d4[_0x4976eb];return _0x5dd7b2;};'use strict';var MailQueueEvents=require(_0x4c3d('0x0'));var events=[_0x4c3d('0x1'),_0x4c3d('0x2'),_0x4c3d('0x3')];function createListener(_0x5b44ce,_0x20e0e6){return function(_0x2c63ee){_0x20e0e6[_0x4c3d('0x4')](_0x5b44ce,_0x2c63ee);};}function removeListener(_0x2d0e45,_0x57cc95){return function(){MailQueueEvents[_0x4c3d('0x5')](_0x2d0e45,_0x57cc95);};}exports[_0x4c3d('0x6')]=function(_0x3e42c5){for(var _0x2cd7c4=0x0,_0x403fef=events[_0x4c3d('0x7')];_0x2cd7c4<_0x403fef;_0x2cd7c4++){var _0x1f7686=events[_0x2cd7c4];var _0x4ed3e7=createListener(_0x4c3d('0x8')+_0x1f7686,_0x3e42c5);MailQueueEvents['on'](_0x1f7686,_0x4ed3e7);}}; \ No newline at end of file +var _0x9172=['update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x37e09b,_0x4c5ee9){var _0x26a1ed=function(_0x5c1d86){while(--_0x5c1d86){_0x37e09b['push'](_0x37e09b['shift']());}};_0x26a1ed(++_0x4c5ee9);}(_0x9172,0x19e));var _0x2917=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x9172[_0x46d0c9];return _0x174506;};'use strict';var MailQueueEvents=require(_0x2917('0x0'));var events=[_0x2917('0x1'),'remove',_0x2917('0x2')];function createListener(_0x4c4ccb,_0x3f6e15){return function(_0x2e2bc1){_0x3f6e15[_0x2917('0x3')](_0x4c4ccb,_0x2e2bc1);};}function removeListener(_0x577416,_0x24f059){return function(){MailQueueEvents[_0x2917('0x4')](_0x577416,_0x24f059);};}exports[_0x2917('0x5')]=function(_0x596251){for(var _0x371b85=0x0,_0x40c305=events[_0x2917('0x6')];_0x371b85<_0x40c305;_0x371b85++){var _0xfd38dc=events[_0x371b85];var _0x2a57a4=createListener(_0x2917('0x7')+_0xfd38dc,_0x596251);MailQueueEvents['on'](_0xfd38dc,_0x2a57a4);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 9505a3a..a0b920f 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 _0x0e81=['../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x17492f,_0x42650d){var _0x504e00=function(_0x24c221){while(--_0x24c221){_0x17492f['push'](_0x17492f['shift']());}};_0x504e00(++_0x42650d);}(_0x0e81,0x1f2));var _0x10e8=function(_0xc1fac2,_0x725358){_0xc1fac2=_0xc1fac2-0x0;var _0x1a31f8=_0x0e81[_0xc1fac2];return _0x1a31f8;};'use strict';var multer=require(_0x10e8('0x0'));var util=require(_0x10e8('0x1'));var path=require(_0x10e8('0x2'));var timeout=require(_0x10e8('0x3'));var express=require(_0x10e8('0x4'));var router=express['Router']();var fs_extra=require(_0x10e8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x10e8('0x6'));var config=require(_0x10e8('0x7'));var controller=require(_0x10e8('0x8'));router[_0x10e8('0x9')]('/',auth[_0x10e8('0xa')](),controller[_0x10e8('0xb')]);router['get'](_0x10e8('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x10e8('0xd'),auth[_0x10e8('0xa')](),controller[_0x10e8('0xe')]);router['post']('/',auth[_0x10e8('0xa')](),controller['create']);router[_0x10e8('0xf')](_0x10e8('0xd'),auth[_0x10e8('0xa')](),controller[_0x10e8('0x10')]);router['delete'](_0x10e8('0xd'),auth[_0x10e8('0xa')](),controller[_0x10e8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3a57=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer'];(function(_0x8ce594,_0x1bce01){var _0x338055=function(_0x118f0b){while(--_0x118f0b){_0x8ce594['push'](_0x8ce594['shift']());}};_0x338055(++_0x1bce01);}(_0x3a57,0x8b));var _0x73a5=function(_0x17898e,_0x179f2a){_0x17898e=_0x17898e-0x0;var _0x48308c=_0x3a57[_0x17898e];return _0x48308c;};'use strict';var multer=require(_0x73a5('0x0'));var util=require('util');var path=require(_0x73a5('0x1'));var timeout=require(_0x73a5('0x2'));var express=require(_0x73a5('0x3'));var router=express['Router']();var fs_extra=require(_0x73a5('0x4'));var auth=require(_0x73a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73a5('0x6'));var controller=require(_0x73a5('0x7'));router[_0x73a5('0x8')]('/',auth[_0x73a5('0x9')](),controller[_0x73a5('0xa')]);router[_0x73a5('0x8')](_0x73a5('0xb'),auth[_0x73a5('0x9')](),controller[_0x73a5('0xc')]);router[_0x73a5('0x8')](_0x73a5('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x73a5('0xe')]('/',auth['isAuthenticated'](),controller[_0x73a5('0xf')]);router[_0x73a5('0x10')](_0x73a5('0xd'),auth[_0x73a5('0x9')](),controller['update']);router[_0x73a5('0x11')](_0x73a5('0xd'),auth[_0x73a5('0x9')](),controller[_0x73a5('0x12')]);module[_0x73a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index d2e5932..b68512f 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 _0xc130=['sequelize','exports','STRING','DATE','moment'];(function(_0x1fa237,_0x1f7bad){var _0x1694a8=function(_0xdacacc){while(--_0xdacacc){_0x1fa237['push'](_0x1fa237['shift']());}};_0x1694a8(++_0x1f7bad);}(_0xc130,0x7c));var _0x0c13=function(_0x4b8cff,_0x3465b1){_0x4b8cff=_0x4b8cff-0x0;var _0x5c0eb2=_0xc130[_0x4b8cff];return _0x5c0eb2;};'use strict';var moment=require(_0x0c13('0x0'));var Sequelize=require(_0x0c13('0x1'));module[_0x0c13('0x2')]={'uniqueid':{'type':Sequelize[_0x0c13('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0c13('0x3')]},'joinAt':{'type':Sequelize[_0x0c13('0x4')]},'leaveAt':{'type':Sequelize[_0x0c13('0x4')]},'acceptAt':{'type':Sequelize[_0x0c13('0x4')]},'exitAt':{'type':Sequelize[_0x0c13('0x4')]},'reason':{'type':Sequelize[_0x0c13('0x3')]}}; \ No newline at end of file +var _0x98f7=['exports','STRING','DATE','moment'];(function(_0x14e6a1,_0x7611b4){var _0x2c1436=function(_0x48fdd4){while(--_0x48fdd4){_0x14e6a1['push'](_0x14e6a1['shift']());}};_0x2c1436(++_0x7611b4);}(_0x98f7,0xcb));var _0x798f=function(_0x5efa45,_0x4e6ea0){_0x5efa45=_0x5efa45-0x0;var _0x548ec6=_0x98f7[_0x5efa45];return _0x548ec6;};'use strict';var moment=require(_0x798f('0x0'));var Sequelize=require('sequelize');module[_0x798f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x798f('0x2')]},'joinAt':{'type':Sequelize[_0x798f('0x3')]},'leaveAt':{'type':Sequelize[_0x798f('0x3')]},'acceptAt':{'type':Sequelize[_0x798f('0x3')]},'exitAt':{'type':Sequelize[_0x798f('0x3')]},'reason':{'type':Sequelize[_0x798f('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1094c3b..cb5faef 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 _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','MailQueueReport','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x896e,0x1e9));var _0xe896=function(_0x2db139,_0x5bdc11){_0x2db139=_0x2db139-0x0;var _0x4f415e=_0x896e[_0x2db139];return _0x4f415e;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));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('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['MailQueueReport'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':!![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['MailQueueReport'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file +var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x8d695e,_0x394999){var _0x3d156e=function(_0x38cf6f){while(--_0x38cf6f){_0x8d695e['push'](_0x8d695e['shift']());}};_0x3d156e(++_0x394999);}(_0x430c,0x1a1));var _0xc430=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x430c[_0xa45395];return _0x3c83d2;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 79e9fa7..2b94938 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 _0x06cf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0xc375fe,_0x2a52bf){var _0x1b3f0a=function(_0x87380){while(--_0x87380){_0xc375fe['push'](_0xc375fe['shift']());}};_0x1b3f0a(++_0x2a52bf);}(_0x06cf,0xce));var _0xf06c=function(_0x37a1b8,_0xa6ce9){_0x37a1b8=_0x37a1b8-0x0;var _0x275aa8=_0x06cf[_0x37a1b8];return _0x275aa8;};'use strict';var _=require(_0xf06c('0x0'));var util=require(_0xf06c('0x1'));var logger=require(_0xf06c('0x2'))(_0xf06c('0x3'));var moment=require(_0xf06c('0x4'));var BPromise=require(_0xf06c('0x5'));var rp=require(_0xf06c('0x6'));var fs=require('fs');var path=require(_0xf06c('0x7'));var rimraf=require(_0xf06c('0x8'));var config=require(_0xf06c('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0xf06c('0xa')]=function(_0x4ccdc6,_0x43ac80){return _0x4ccdc6[_0xf06c('0xb')](_0xf06c('0xc'),attributes,{'tableName':_0xf06c('0xd'),'paranoid':![],'indexes':[{'name':_0xf06c('0xe'),'fields':[_0xf06c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b97=['api','moment','path','rimraf','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b97,0x1d6));var _0x75b9=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x5b97[_0xe1b5f6];return _0x44636e;};'use strict';var _=require(_0x75b9('0x0'));var util=require(_0x75b9('0x1'));var logger=require(_0x75b9('0x2'))(_0x75b9('0x3'));var moment=require(_0x75b9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75b9('0x5'));var rimraf=require(_0x75b9('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x75b9('0x7')]=function(_0x3fa29b,_0x10faca){return _0x3fa29b[_0x75b9('0x8')](_0x75b9('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x75b9('0xa'),'fields':[_0x75b9('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 8dfb5a5..37aa6d4 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x9c80f0,_0x59cc94){var _0x3baef5=function(_0x4ea254){while(--_0x4ea254){_0x9c80f0['push'](_0x9c80f0['shift']());}};_0x3baef5(++_0x59cc94);}(_0xadb5,0xad));var _0x5adb=function(_0xc9c04e,_0x202685){_0xc9c04e=_0xc9c04e-0x0;var _0x47aae4=_0xadb5[_0xc9c04e];return _0x47aae4;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x2ef3,0xba));var _0x32ef=function(_0x5528c9,_0x3ebbfd){_0x5528c9=_0x5528c9-0x0;var _0x5e3b72=_0x2ef3[_0x5528c9];return _0x5e3b72;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b8c0ff8..a87e079 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1fbe9e,_0x4bffbe){var _0x1b7bc7=function(_0x5347ce){while(--_0x5347ce){_0x1fbe9e['push'](_0x1fbe9e['shift']());}};_0x1b7bc7(++_0x4bffbe);}(_0xe706,0xa3));var _0x6e70=function(_0x3154a3,_0x45d16d){_0x3154a3=_0x3154a3-0x0;var _0x553af5=_0xe706[_0x3154a3];return _0x553af5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x479303,_0x94dc13){var _0x21b7e0=function(_0x45b5e2){while(--_0x45b5e2){_0x479303['push'](_0x479303['shift']());}};_0x21b7e0(++_0x94dc13);}(_0xe706,0xa3));var _0x6e70=function(_0x219143,_0x451ca3){_0x219143=_0x219143-0x0;var _0x501e6b=_0xe706[_0x219143];return _0x501e6b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 03ec8d9..c826b3d 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 _0xf9e9=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0xf9e9,0xe7));var _0x9f9e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf9e9[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x9f9e('0x0'));module[_0x9f9e('0x1')]={'description':{'type':Sequelize[_0x9f9e('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9f9e('0x2')]},'port':{'type':Sequelize[_0x9f9e('0x3')]},'tls':{'type':Sequelize[_0x9f9e('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x9f9e('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9f9e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9f9e('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7dc0=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x34b4b4,_0x26b2b2){var _0x2ec9f4=function(_0x24e486){while(--_0x24e486){_0x34b4b4['push'](_0x34b4b4['shift']());}};_0x2ec9f4(++_0x26b2b2);}(_0x7dc0,0x18a));var _0x07dc=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7dc0[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x07dc('0x0'));module['exports']={'description':{'type':Sequelize[_0x07dc('0x1')]},'host':{'type':Sequelize[_0x07dc('0x1')]},'authentication':{'type':Sequelize[_0x07dc('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x07dc('0x1')]},'password':{'type':Sequelize[_0x07dc('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x07dc('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x07dc('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x07dc('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x07dc('0x1')]},'modernAuthentication':{'type':Sequelize[_0x07dc('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1dc660b..eccfd7b 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 _0xb025=['moment','bluebird','request-promise','path','../../config/environment','exports','mail_servers_in','lodash','util','../../config/logger'];(function(_0x734df,_0x179dc8){var _0xc93759=function(_0xb11b9e){while(--_0xb11b9e){_0x734df['push'](_0x734df['shift']());}};_0xc93759(++_0x179dc8);}(_0xb025,0x7f));var _0x5b02=function(_0x18f729,_0x55e088){_0x18f729=_0x18f729-0x0;var _0x2f71e4=_0xb025[_0x18f729];return _0x2f71e4;};'use strict';var _=require(_0x5b02('0x0'));var util=require(_0x5b02('0x1'));var logger=require(_0x5b02('0x2'))('api');var moment=require(_0x5b02('0x3'));var BPromise=require(_0x5b02('0x4'));var rp=require(_0x5b02('0x5'));var fs=require('fs');var path=require(_0x5b02('0x6'));var rimraf=require('rimraf');var config=require(_0x5b02('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x5b02('0x8')]=function(_0x80597b,_0x1a6e0e){return _0x80597b['define']('MailServerIn',attributes,{'tableName':_0x5b02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa33e=['request-promise','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird'];(function(_0x140c88,_0x1110c0){var _0x1df963=function(_0x4e95c2){while(--_0x4e95c2){_0x140c88['push'](_0x140c88['shift']());}};_0x1df963(++_0x1110c0);}(_0xa33e,0x127));var _0xea33=function(_0x12d900,_0x1c27eb){_0x12d900=_0x12d900-0x0;var _0x3609b4=_0xa33e[_0x12d900];return _0x3609b4;};'use strict';var _=require(_0xea33('0x0'));var util=require('util');var logger=require(_0xea33('0x1'))(_0xea33('0x2'));var moment=require(_0xea33('0x3'));var BPromise=require(_0xea33('0x4'));var rp=require(_0xea33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea33('0x6'));var attributes=require(_0xea33('0x7'));module[_0xea33('0x8')]=function(_0x5102ad,_0x140395){return _0x5102ad[_0xea33('0x9')](_0xea33('0xa'),attributes,{'tableName':_0xea33('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 ae17e9a..d11cdf9 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 _0x6652=['raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options'];(function(_0x56e70d,_0x3c3504){var _0x41a615=function(_0x5db9cd){while(--_0x5db9cd){_0x56e70d['push'](_0x56e70d['shift']());}};_0x41a615(++_0x3c3504);}(_0x6652,0xf3));var _0x2665=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6652[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2665('0x0'));var util=require(_0x2665('0x1'));var moment=require(_0x2665('0x2'));var BPromise=require(_0x2665('0x3'));var rs=require(_0x2665('0x4'));var fs=require('fs');var Redis=require(_0x2665('0x5'));var db=require(_0x2665('0x6'))['db'];var utils=require(_0x2665('0x7'));var logger=require(_0x2665('0x8'))('rpc');var config=require(_0x2665('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2665('0xa')][_0x2665('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb5be6,_0x20a2c5,_0xf51be5){return new BPromise(function(_0x540a5c,_0x5bc4d9){return client[_0x2665('0xc')](_0xb5be6,_0xf51be5)[_0x2665('0xd')](function(_0x3164e0){logger[_0x2665('0xe')](_0x2665('0xf'),_0x20a2c5,_0x2665('0x10'));logger[_0x2665('0x11')](_0x2665('0x12'),_0x20a2c5,_0x2665('0x10'),JSON[_0x2665('0x13')](_0x3164e0));if(_0x3164e0[_0x2665('0x14')]){if(_0x3164e0[_0x2665('0x14')][_0x2665('0x15')]===0x1f4){logger[_0x2665('0x14')](_0x2665('0xf'),_0x20a2c5,_0x3164e0[_0x2665('0x14')][_0x2665('0x16')]);return _0x5bc4d9(_0x3164e0[_0x2665('0x14')][_0x2665('0x16')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x20a2c5,_0x3164e0[_0x2665('0x14')]['message']);return _0x540a5c(_0x3164e0[_0x2665('0x14')]['message']);}else{logger[_0x2665('0xe')]('MailServerIn,\x20%s,\x20%s',_0x20a2c5,'request\x20sent');_0x540a5c(_0x3164e0[_0x2665('0x17')][_0x2665('0x16')]);}})[_0x2665('0x18')](function(_0x42db54){logger[_0x2665('0x14')](_0x2665('0xf'),_0x20a2c5,_0x42db54);_0x5bc4d9(_0x42db54);});});}exports[_0x2665('0x19')]=function(_0x42fd74){var _0x5ac806=this;return new Promise(function(_0x4e56c9,_0x1b5190){return db[_0x2665('0x1a')][_0x2665('0x1b')]({'raw':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options'][_0x2665('0x1d')]===undefined?!![]:![]:!![],'where':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options']['where']||null:null,'attributes':_0x42fd74[_0x2665('0x1c')]?_0x42fd74[_0x2665('0x1c')][_0x2665('0x1e')]||null:null,'limit':_0x42fd74[_0x2665('0x1c')]?_0x42fd74[_0x2665('0x1c')]['limit']||null:null,'include':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options'][_0x2665('0x1f')]?_[_0x2665('0x20')](_0x42fd74[_0x2665('0x1c')][_0x2665('0x1f')],function(_0x59470b){return{'model':db[_0x59470b[_0x2665('0x21')]],'as':_0x59470b['as'],'attributes':_0x59470b[_0x2665('0x1e')],'include':_0x59470b[_0x2665('0x1f')]?_['map'](_0x59470b[_0x2665('0x1f')],function(_0x3eabd8){return{'model':db[_0x3eabd8['model']],'as':_0x3eabd8['as'],'attributes':_0x3eabd8[_0x2665('0x1e')],'include':_0x3eabd8['include']?_[_0x2665('0x20')](_0x3eabd8[_0x2665('0x1f')],function(_0x32eb3b){return{'model':db[_0x32eb3b[_0x2665('0x21')]],'as':_0x32eb3b['as'],'attributes':_0x32eb3b[_0x2665('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2665('0xd')](function(_0x2c9d1a){logger['info'](_0x2665('0x19'),_0x42fd74);logger[_0x2665('0x11')](_0x2665('0x19'),_0x42fd74,JSON[_0x2665('0x13')](_0x2c9d1a));_0x4e56c9(_0x2c9d1a);})[_0x2665('0x18')](function(_0x748b7b){logger['error']('GetMailServerIn',_0x748b7b[_0x2665('0x16')],_0x42fd74);_0x1b5190(_0x5ac806[_0x2665('0x14')](0x1f4,_0x748b7b['message']));});});}; \ No newline at end of file +var _0x86b6=['code','message','result','catch','GetMailServerIn','findAll','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2122f7,_0x2499fe){var _0x22d9b3=function(_0x4160bb){while(--_0x4160bb){_0x2122f7['push'](_0x2122f7['shift']());}};_0x22d9b3(++_0x2499fe);}(_0x86b6,0x157));var _0x686b=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x86b6[_0x7dbd65];return _0x33d551;};'use strict';var _=require(_0x686b('0x0'));var util=require(_0x686b('0x1'));var moment=require(_0x686b('0x2'));var BPromise=require(_0x686b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x686b('0x4'));var db=require(_0x686b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x686b('0x6'))(_0x686b('0x7'));var config=require('../../config/environment');var jayson=require(_0x686b('0x8'));var client=jayson[_0x686b('0x9')][_0x686b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cd47d,_0x4e66f9,_0x1dd04c){return new BPromise(function(_0x3d1388,_0x3b55e3){return client[_0x686b('0xb')](_0x4cd47d,_0x1dd04c)[_0x686b('0xc')](function(_0x1090d2){logger[_0x686b('0xd')](_0x686b('0xe'),_0x4e66f9,_0x686b('0xf'));logger[_0x686b('0x10')](_0x686b('0x11'),_0x4e66f9,_0x686b('0xf'),JSON[_0x686b('0x12')](_0x1090d2));if(_0x1090d2['error']){if(_0x1090d2[_0x686b('0x13')][_0x686b('0x14')]===0x1f4){logger['error'](_0x686b('0xe'),_0x4e66f9,_0x1090d2['error'][_0x686b('0x15')]);return _0x3b55e3(_0x1090d2['error'][_0x686b('0x15')]);}logger[_0x686b('0x13')](_0x686b('0xe'),_0x4e66f9,_0x1090d2[_0x686b('0x13')]['message']);return _0x3d1388(_0x1090d2['error'][_0x686b('0x15')]);}else{logger[_0x686b('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4e66f9,_0x686b('0xf'));_0x3d1388(_0x1090d2[_0x686b('0x16')][_0x686b('0x15')]);}})[_0x686b('0x17')](function(_0x46aa98){logger[_0x686b('0x13')](_0x686b('0xe'),_0x4e66f9,_0x46aa98);_0x3b55e3(_0x46aa98);});});}exports[_0x686b('0x18')]=function(_0x463f0c){var _0x4ea8d1=this;return new Promise(function(_0x438c38,_0x1fe7f6){return db['MailServerIn'][_0x686b('0x19')]({'raw':_0x463f0c[_0x686b('0x1a')]?_0x463f0c[_0x686b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x463f0c['options']?_0x463f0c[_0x686b('0x1a')][_0x686b('0x1b')]||null:null,'attributes':_0x463f0c[_0x686b('0x1a')]?_0x463f0c[_0x686b('0x1a')][_0x686b('0x1c')]||null:null,'limit':_0x463f0c[_0x686b('0x1a')]?_0x463f0c[_0x686b('0x1a')][_0x686b('0x1d')]||null:null,'include':_0x463f0c['options']?_0x463f0c['options'][_0x686b('0x1e')]?_[_0x686b('0x1f')](_0x463f0c[_0x686b('0x1a')][_0x686b('0x1e')],function(_0x427f04){return{'model':db[_0x427f04[_0x686b('0x20')]],'as':_0x427f04['as'],'attributes':_0x427f04[_0x686b('0x1c')],'include':_0x427f04[_0x686b('0x1e')]?_['map'](_0x427f04[_0x686b('0x1e')],function(_0x59cee2){return{'model':db[_0x59cee2[_0x686b('0x20')]],'as':_0x59cee2['as'],'attributes':_0x59cee2[_0x686b('0x1c')],'include':_0x59cee2[_0x686b('0x1e')]?_[_0x686b('0x1f')](_0x59cee2[_0x686b('0x1e')],function(_0x3643bf){return{'model':db[_0x3643bf['model']],'as':_0x3643bf['as'],'attributes':_0x3643bf[_0x686b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xafdbbf){logger[_0x686b('0xd')](_0x686b('0x18'),_0x463f0c);logger[_0x686b('0x10')](_0x686b('0x18'),_0x463f0c,JSON[_0x686b('0x12')](_0xafdbbf));_0x438c38(_0xafdbbf);})[_0x686b('0x17')](function(_0x33f247){logger[_0x686b('0x13')](_0x686b('0x18'),_0x33f247[_0x686b('0x15')],_0x463f0c);_0x1fe7f6(_0x4ea8d1['error'](0x1f4,_0x33f247[_0x686b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index df94f18..4dd79f4 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x327372,_0x581e63){_0x327372=_0x327372-0x0;var _0x2cb6bb=_0x7a54[_0x327372];return _0x2cb6bb;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index aad146e..5bce2d7 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 _0xfff0=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x50ca3a,_0x4a4e3a){var _0x2a3c6d=function(_0x15e7e7){while(--_0x15e7e7){_0x50ca3a['push'](_0x50ca3a['shift']());}};_0x2a3c6d(++_0x4a4e3a);}(_0xfff0,0x139));var _0x0fff=function(_0x52353b,_0x185d83){_0x52353b=_0x52353b-0x0;var _0x24de47=_0xfff0[_0x52353b];return _0x24de47;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'description':{'type':Sequelize[_0x0fff('0x1')]},'host':{'type':Sequelize[_0x0fff('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0fff('0x1')]},'port':{'type':Sequelize[_0x0fff('0x2')]},'secure':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xefda=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x8bd8bd,_0x44a177){var _0x1ef722=function(_0x395022){while(--_0x395022){_0x8bd8bd['push'](_0x8bd8bd['shift']());}};_0x1ef722(++_0x44a177);}(_0xefda,0x96));var _0xaefd=function(_0x21a4ad,_0x5ca2a3){_0x21a4ad=_0x21a4ad-0x0;var _0x13e20a=_0xefda[_0x21a4ad];return _0x13e20a;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xaefd('0x1')]},'user':{'type':Sequelize[_0xaefd('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaefd('0x2')]},'secure':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xaefd('0x1')]},'authentication':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaefd('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 9d1081d..4108210 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 _0xb319=['then','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','type','count','includeAll','include','findAll','rows','catch','show','fields','options','find','body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/util','sendStatus','status','end','offset','undefined','set','Content-Range','json','apply','save','update'];(function(_0x2ed594,_0x15dec1){var _0x4f1606=function(_0x44da23){while(--_0x44da23){_0x2ed594['push'](_0x2ed594['shift']());}};_0x4f1606(++_0x15dec1);}(_0xb319,0x1a5));var _0x9b31=function(_0x339e8c,_0x4a839f){_0x339e8c=_0x339e8c-0x0;var _0x4ad2b9=_0xb319[_0x339e8c];return _0x4ad2b9;};'use strict';var emlformat=require(_0x9b31('0x0'));var rimraf=require(_0x9b31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b31('0x2'));var rp=require(_0x9b31('0x3'));var moment=require(_0x9b31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b31('0x5'));var util=require(_0x9b31('0x6'));var path=require('path');var sox=require(_0x9b31('0x7'));var csv=require(_0x9b31('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b31('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b31('0x8'));var querystring=require(_0x9b31('0xa'));var Papa=require(_0x9b31('0xb'));var Redis=require(_0x9b31('0xc'));var authService=require(_0x9b31('0xd'));var qs=require(_0x9b31('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b31('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ebc3e,_0x33245c){_0x33245c=_0x33245c||0xcc;return function(_0x4b3a7d){if(_0x4b3a7d){return _0x1ebc3e[_0x9b31('0x10')](_0x33245c);}return _0x1ebc3e[_0x9b31('0x11')](_0x33245c)[_0x9b31('0x12')]();};}function respondWithResult(_0x5f3442,_0x3fd275){_0x3fd275=_0x3fd275||0xc8;return function(_0x1e4e13){if(_0x1e4e13){return _0x5f3442[_0x9b31('0x11')](_0x3fd275)['json'](_0x1e4e13);}};}function respondWithFilteredResult(_0x110248,_0x17660b){return function(_0x169103){if(_0x169103){var _0x4f2d0b=typeof _0x17660b[_0x9b31('0x13')]===_0x9b31('0x14')&&typeof _0x17660b['limit']==='undefined';var _0x216523=_0x169103['count'];var _0xec12a=_0x4f2d0b?0x0:_0x17660b[_0x9b31('0x13')];var _0x1bbfb7=_0x4f2d0b?_0x169103['count']:_0x17660b[_0x9b31('0x13')]+_0x17660b['limit'];var _0x34b205;if(_0x1bbfb7>=_0x216523){_0x1bbfb7=_0x216523;_0x34b205=0xc8;}else{_0x34b205=0xce;}_0x110248['status'](_0x34b205);return _0x110248[_0x9b31('0x15')](_0x9b31('0x16'),_0xec12a+'-'+_0x1bbfb7+'/'+_0x216523)[_0x9b31('0x17')](_0x169103);}return null;};}function patchUpdates(_0x24c8eb){return function(_0x172ce7){try{jsonpatch[_0x9b31('0x18')](_0x172ce7,_0x24c8eb,!![]);}catch(_0x4f82ff){return BPromise['reject'](_0x4f82ff);}return _0x172ce7[_0x9b31('0x19')]();};}function saveUpdates(_0xc0c3ff,_0x5476e2){return function(_0x5c4feb){if(_0x5c4feb){return _0x5c4feb[_0x9b31('0x1a')](_0xc0c3ff)[_0x9b31('0x1b')](function(_0x38912e){return _0x38912e;});}return null;};}function removeEntity(_0x54880d,_0x2c0f82){return function(_0x48a3){if(_0x48a3){return _0x48a3['destroy']()[_0x9b31('0x1b')](function(){_0x54880d['status'](0xcc)[_0x9b31('0x12')]();});}};}function handleEntityNotFound(_0x4d4e5e,_0x15496a){return function(_0x29ecdd){if(!_0x29ecdd){_0x4d4e5e[_0x9b31('0x10')](0x194);}return _0x29ecdd;};}function handleError(_0x5d667,_0xa8db41){_0xa8db41=_0xa8db41||0x1f4;return function(_0x318457){logger[_0x9b31('0x1c')](_0x318457['stack']);if(_0x318457[_0x9b31('0x1d')]){delete _0x318457[_0x9b31('0x1d')];}_0x5d667[_0x9b31('0x11')](_0xa8db41)[_0x9b31('0x1e')](_0x318457);};}exports[_0x9b31('0x1f')]=function(_0x6c7151,_0x3bc916){var _0x543481={},_0x42ef65={},_0x5dbf97={'count':0x0,'rows':[]};var _0x5c2b79=_[_0x9b31('0x20')](db[_0x9b31('0x21')][_0x9b31('0x22')],function(_0x2931a6){return{'name':_0x2931a6[_0x9b31('0x23')],'type':_0x2931a6['type']['key']};});_0x42ef65[_0x9b31('0x24')]=_['map'](_0x5c2b79,_0x9b31('0x1d'));_0x42ef65[_0x9b31('0x25')]=_[_0x9b31('0x26')](_0x6c7151['query']);_0x42ef65[_0x9b31('0x27')]=_[_0x9b31('0x28')](_0x42ef65[_0x9b31('0x24')],_0x42ef65['query']);_0x543481['attributes']=_[_0x9b31('0x28')](_0x42ef65[_0x9b31('0x24')],qs['fields'](_0x6c7151[_0x9b31('0x25')]['fields']));_0x543481[_0x9b31('0x29')]=_0x543481[_0x9b31('0x29')][_0x9b31('0x2a')]?_0x543481[_0x9b31('0x29')]:_0x42ef65['model'];if(!_0x6c7151[_0x9b31('0x25')][_0x9b31('0x2b')]('nolimit')){_0x543481['limit']=qs[_0x9b31('0x2c')](_0x6c7151['query'][_0x9b31('0x2c')]);_0x543481[_0x9b31('0x13')]=qs[_0x9b31('0x13')](_0x6c7151[_0x9b31('0x25')][_0x9b31('0x13')]);}_0x543481[_0x9b31('0x2d')]=qs[_0x9b31('0x2e')](_0x6c7151['query']['sort']);_0x543481[_0x9b31('0x2f')]=qs[_0x9b31('0x27')](_[_0x9b31('0x30')](_0x6c7151['query'],_0x42ef65[_0x9b31('0x27')]),_0x5c2b79);if(_0x6c7151[_0x9b31('0x25')]['filter']){_0x543481[_0x9b31('0x2f')]=_[_0x9b31('0x31')](_0x543481[_0x9b31('0x2f')],{'$or':_[_0x9b31('0x20')](_0x5c2b79,function(_0x599da1){if(_0x599da1[_0x9b31('0x32')]!=='VIRTUAL'){var _0x287d57={};_0x287d57[_0x599da1[_0x9b31('0x1d')]]={'$like':'%'+_0x6c7151[_0x9b31('0x25')]['filter']+'%'};return _0x287d57;}})});}_0x543481=_['merge']({},_0x543481,_0x6c7151['options']);var _0x59d237={'where':_0x543481[_0x9b31('0x2f')]};return db[_0x9b31('0x21')][_0x9b31('0x33')](_0x59d237)[_0x9b31('0x1b')](function(_0x954cdd){_0x5dbf97['count']=_0x954cdd;if(_0x6c7151[_0x9b31('0x25')][_0x9b31('0x34')]){_0x543481[_0x9b31('0x35')]=[{'all':!![]}];}return db[_0x9b31('0x21')][_0x9b31('0x36')](_0x543481);})[_0x9b31('0x1b')](function(_0x3caa1a){_0x5dbf97[_0x9b31('0x37')]=_0x3caa1a;return _0x5dbf97;})[_0x9b31('0x1b')](respondWithFilteredResult(_0x3bc916,_0x543481))[_0x9b31('0x38')](handleError(_0x3bc916,null));};exports[_0x9b31('0x39')]=function(_0x1747ca,_0x41f5b5){var _0x4eb3c5={'raw':!![],'where':{'id':_0x1747ca['params']['id']}},_0x106e7c={};_0x106e7c[_0x9b31('0x24')]=_[_0x9b31('0x26')](db[_0x9b31('0x21')]['rawAttributes']);_0x106e7c[_0x9b31('0x25')]=_[_0x9b31('0x26')](_0x1747ca[_0x9b31('0x25')]);_0x106e7c[_0x9b31('0x27')]=_['intersection'](_0x106e7c[_0x9b31('0x24')],_0x106e7c['query']);_0x4eb3c5['attributes']=_[_0x9b31('0x28')](_0x106e7c[_0x9b31('0x24')],qs['fields'](_0x1747ca[_0x9b31('0x25')][_0x9b31('0x3a')]));_0x4eb3c5[_0x9b31('0x29')]=_0x4eb3c5[_0x9b31('0x29')][_0x9b31('0x2a')]?_0x4eb3c5[_0x9b31('0x29')]:_0x106e7c[_0x9b31('0x24')];if(_0x1747ca[_0x9b31('0x25')][_0x9b31('0x34')]){_0x4eb3c5[_0x9b31('0x35')]=[{'all':!![]}];}_0x4eb3c5=_[_0x9b31('0x31')]({},_0x4eb3c5,_0x1747ca[_0x9b31('0x3b')]);return db[_0x9b31('0x21')][_0x9b31('0x3c')](_0x4eb3c5)[_0x9b31('0x1b')](handleEntityNotFound(_0x41f5b5,null))['then'](respondWithResult(_0x41f5b5,null))[_0x9b31('0x38')](handleError(_0x41f5b5,null));};exports['create']=function(_0x4609b8,_0x506650){return db['MailServerOut']['create'](_0x4609b8[_0x9b31('0x3d')],{})[_0x9b31('0x1b')](respondWithResult(_0x506650,0xc9))[_0x9b31('0x38')](handleError(_0x506650,null));};exports[_0x9b31('0x1a')]=function(_0x45f6a2,_0x44a1e7){if(_0x45f6a2['body']['id']){delete _0x45f6a2[_0x9b31('0x3d')]['id'];}return db['MailServerOut'][_0x9b31('0x3c')]({'where':{'id':_0x45f6a2['params']['id']}})['then'](handleEntityNotFound(_0x44a1e7,null))[_0x9b31('0x1b')](saveUpdates(_0x45f6a2[_0x9b31('0x3d')],null))['then'](respondWithResult(_0x44a1e7,null))[_0x9b31('0x38')](handleError(_0x44a1e7,null));};exports[_0x9b31('0x3e')]=function(_0x5b6f37,_0x3bedd3){return db[_0x9b31('0x21')][_0x9b31('0x3c')]({'where':{'id':_0x5b6f37[_0x9b31('0x3f')]['id']}})[_0x9b31('0x1b')](handleEntityNotFound(_0x3bedd3,null))[_0x9b31('0x1b')](removeEntity(_0x3bedd3,null))[_0x9b31('0x38')](handleError(_0x3bedd3,null));}; \ No newline at end of file +var _0xfd99=['save','update','then','destroy','end','error','name','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0x46a563,_0x586712){var _0x10aa22=function(_0x199db8){while(--_0x199db8){_0x46a563['push'](_0x46a563['shift']());}};_0x10aa22(++_0x586712);}(_0xfd99,0x70));var _0x9fd9=function(_0x3c0467,_0x458f2e){_0x3c0467=_0x3c0467-0x0;var _0x4707e8=_0xfd99[_0x3c0467];return _0x4707e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fd9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fd9('0x1'));var rp=require(_0x9fd9('0x2'));var moment=require(_0x9fd9('0x3'));var BPromise=require(_0x9fd9('0x4'));var Mustache=require(_0x9fd9('0x5'));var util=require(_0x9fd9('0x6'));var path=require('path');var sox=require(_0x9fd9('0x7'));var csv=require(_0x9fd9('0x8'));var ejs=require(_0x9fd9('0x9'));var fs=require('fs');var fs_extra=require(_0x9fd9('0xa'));var _=require(_0x9fd9('0xb'));var squel=require(_0x9fd9('0xc'));var crypto=require(_0x9fd9('0xd'));var jsforce=require(_0x9fd9('0xe'));var deskjs=require(_0x9fd9('0xf'));var toCsv=require(_0x9fd9('0x8'));var querystring=require('querystring');var Papa=require(_0x9fd9('0x10'));var Redis=require(_0x9fd9('0x11'));var authService=require(_0x9fd9('0x12'));var qs=require(_0x9fd9('0x13'));var as=require(_0x9fd9('0x14'));var hardwareService=require(_0x9fd9('0x15'));var logger=require(_0x9fd9('0x16'))(_0x9fd9('0x17'));var utils=require(_0x9fd9('0x18'));var config=require(_0x9fd9('0x19'));var licenseUtil=require(_0x9fd9('0x1a'));var db=require(_0x9fd9('0x1b'))['db'];function respondWithStatusCode(_0x497ecc,_0x252698){_0x252698=_0x252698||0xcc;return function(_0x5bcd18){if(_0x5bcd18){return _0x497ecc[_0x9fd9('0x1c')](_0x252698);}return _0x497ecc['status'](_0x252698)['end']();};}function respondWithResult(_0x1d0a68,_0x226dd9){_0x226dd9=_0x226dd9||0xc8;return function(_0x2223b4){if(_0x2223b4){return _0x1d0a68[_0x9fd9('0x1d')](_0x226dd9)[_0x9fd9('0x1e')](_0x2223b4);}};}function respondWithFilteredResult(_0x399e9b,_0x1e1fe2){return function(_0x10289e){if(_0x10289e){var _0xf72f5c=typeof _0x1e1fe2[_0x9fd9('0x1f')]===_0x9fd9('0x20')&&typeof _0x1e1fe2['limit']===_0x9fd9('0x20');var _0x580aa1=_0x10289e[_0x9fd9('0x21')];var _0x59e1ac=_0xf72f5c?0x0:_0x1e1fe2['offset'];var _0xf62857=_0xf72f5c?_0x10289e['count']:_0x1e1fe2[_0x9fd9('0x1f')]+_0x1e1fe2[_0x9fd9('0x22')];var _0x2bf47c;if(_0xf62857>=_0x580aa1){_0xf62857=_0x580aa1;_0x2bf47c=0xc8;}else{_0x2bf47c=0xce;}_0x399e9b[_0x9fd9('0x1d')](_0x2bf47c);return _0x399e9b[_0x9fd9('0x23')](_0x9fd9('0x24'),_0x59e1ac+'-'+_0xf62857+'/'+_0x580aa1)[_0x9fd9('0x1e')](_0x10289e);}return null;};}function patchUpdates(_0x5d66c3){return function(_0x250cec){try{jsonpatch['apply'](_0x250cec,_0x5d66c3,!![]);}catch(_0x5747bc){return BPromise[_0x9fd9('0x25')](_0x5747bc);}return _0x250cec[_0x9fd9('0x26')]();};}function saveUpdates(_0x3d84c2,_0x2839f0){return function(_0x2d99de){if(_0x2d99de){return _0x2d99de[_0x9fd9('0x27')](_0x3d84c2)[_0x9fd9('0x28')](function(_0x42af2d){return _0x42af2d;});}return null;};}function removeEntity(_0x2647a4,_0x328efc){return function(_0xbf475b){if(_0xbf475b){return _0xbf475b[_0x9fd9('0x29')]()[_0x9fd9('0x28')](function(){_0x2647a4[_0x9fd9('0x1d')](0xcc)[_0x9fd9('0x2a')]();});}};}function handleEntityNotFound(_0x131f6b,_0x4906f8){return function(_0x392257){if(!_0x392257){_0x131f6b[_0x9fd9('0x1c')](0x194);}return _0x392257;};}function handleError(_0x284ea9,_0x44ee5c){_0x44ee5c=_0x44ee5c||0x1f4;return function(_0x568598){logger[_0x9fd9('0x2b')](_0x568598['stack']);if(_0x568598[_0x9fd9('0x2c')]){delete _0x568598[_0x9fd9('0x2c')];}_0x284ea9['status'](_0x44ee5c)['send'](_0x568598);};}exports[_0x9fd9('0x2d')]=function(_0x478142,_0x1b9559){var _0x1af5a6={},_0x1fb14a={},_0x3fbe7f={'count':0x0,'rows':[]};var _0x2541cb=_[_0x9fd9('0x2e')](db[_0x9fd9('0x2f')][_0x9fd9('0x30')],function(_0x35a99c){return{'name':_0x35a99c['fieldName'],'type':_0x35a99c[_0x9fd9('0x31')][_0x9fd9('0x32')]};});_0x1fb14a[_0x9fd9('0x33')]=_[_0x9fd9('0x2e')](_0x2541cb,_0x9fd9('0x2c'));_0x1fb14a['query']=_[_0x9fd9('0x34')](_0x478142[_0x9fd9('0x35')]);_0x1fb14a[_0x9fd9('0x36')]=_[_0x9fd9('0x37')](_0x1fb14a['model'],_0x1fb14a[_0x9fd9('0x35')]);_0x1af5a6[_0x9fd9('0x38')]=_['intersection'](_0x1fb14a[_0x9fd9('0x33')],qs['fields'](_0x478142[_0x9fd9('0x35')][_0x9fd9('0x39')]));_0x1af5a6['attributes']=_0x1af5a6['attributes'][_0x9fd9('0x3a')]?_0x1af5a6[_0x9fd9('0x38')]:_0x1fb14a['model'];if(!_0x478142[_0x9fd9('0x35')][_0x9fd9('0x3b')](_0x9fd9('0x3c'))){_0x1af5a6[_0x9fd9('0x22')]=qs[_0x9fd9('0x22')](_0x478142['query'][_0x9fd9('0x22')]);_0x1af5a6[_0x9fd9('0x1f')]=qs['offset'](_0x478142[_0x9fd9('0x35')]['offset']);}_0x1af5a6[_0x9fd9('0x3d')]=qs[_0x9fd9('0x3e')](_0x478142['query'][_0x9fd9('0x3e')]);_0x1af5a6[_0x9fd9('0x3f')]=qs[_0x9fd9('0x36')](_[_0x9fd9('0x40')](_0x478142['query'],_0x1fb14a[_0x9fd9('0x36')]),_0x2541cb);if(_0x478142['query'][_0x9fd9('0x41')]){_0x1af5a6[_0x9fd9('0x3f')]=_[_0x9fd9('0x42')](_0x1af5a6[_0x9fd9('0x3f')],{'$or':_['map'](_0x2541cb,function(_0x482748){if(_0x482748[_0x9fd9('0x31')]!=='VIRTUAL'){var _0x2b1e83={};_0x2b1e83[_0x482748['name']]={'$like':'%'+_0x478142[_0x9fd9('0x35')][_0x9fd9('0x41')]+'%'};return _0x2b1e83;}})});}_0x1af5a6=_['merge']({},_0x1af5a6,_0x478142['options']);var _0x40cef1={'where':_0x1af5a6[_0x9fd9('0x3f')]};return db[_0x9fd9('0x2f')]['count'](_0x40cef1)['then'](function(_0x4291ac){_0x3fbe7f[_0x9fd9('0x21')]=_0x4291ac;if(_0x478142[_0x9fd9('0x35')][_0x9fd9('0x43')]){_0x1af5a6[_0x9fd9('0x44')]=[{'all':!![]}];}return db[_0x9fd9('0x2f')]['findAll'](_0x1af5a6);})['then'](function(_0x1613c9){_0x3fbe7f[_0x9fd9('0x45')]=_0x1613c9;return _0x3fbe7f;})['then'](respondWithFilteredResult(_0x1b9559,_0x1af5a6))[_0x9fd9('0x46')](handleError(_0x1b9559,null));};exports['show']=function(_0x462033,_0x14e43){var _0x1b6167={'raw':!![],'where':{'id':_0x462033[_0x9fd9('0x47')]['id']}},_0x6af571={};_0x6af571[_0x9fd9('0x33')]=_[_0x9fd9('0x34')](db[_0x9fd9('0x2f')]['rawAttributes']);_0x6af571[_0x9fd9('0x35')]=_[_0x9fd9('0x34')](_0x462033[_0x9fd9('0x35')]);_0x6af571['filters']=_[_0x9fd9('0x37')](_0x6af571[_0x9fd9('0x33')],_0x6af571[_0x9fd9('0x35')]);_0x1b6167['attributes']=_[_0x9fd9('0x37')](_0x6af571['model'],qs[_0x9fd9('0x39')](_0x462033['query'][_0x9fd9('0x39')]));_0x1b6167[_0x9fd9('0x38')]=_0x1b6167['attributes'][_0x9fd9('0x3a')]?_0x1b6167[_0x9fd9('0x38')]:_0x6af571[_0x9fd9('0x33')];if(_0x462033[_0x9fd9('0x35')][_0x9fd9('0x43')]){_0x1b6167['include']=[{'all':!![]}];}_0x1b6167=_['merge']({},_0x1b6167,_0x462033['options']);return db[_0x9fd9('0x2f')][_0x9fd9('0x48')](_0x1b6167)[_0x9fd9('0x28')](handleEntityNotFound(_0x14e43,null))[_0x9fd9('0x28')](respondWithResult(_0x14e43,null))[_0x9fd9('0x46')](handleError(_0x14e43,null));};exports[_0x9fd9('0x49')]=function(_0x18e6a2,_0x551b68){return db[_0x9fd9('0x2f')]['create'](_0x18e6a2['body'],{})[_0x9fd9('0x28')](respondWithResult(_0x551b68,0xc9))[_0x9fd9('0x46')](handleError(_0x551b68,null));};exports[_0x9fd9('0x27')]=function(_0x1b81a6,_0x47eac0){if(_0x1b81a6[_0x9fd9('0x4a')]['id']){delete _0x1b81a6[_0x9fd9('0x4a')]['id'];}return db[_0x9fd9('0x2f')]['find']({'where':{'id':_0x1b81a6[_0x9fd9('0x47')]['id']}})['then'](handleEntityNotFound(_0x47eac0,null))[_0x9fd9('0x28')](saveUpdates(_0x1b81a6[_0x9fd9('0x4a')],null))[_0x9fd9('0x28')](respondWithResult(_0x47eac0,null))[_0x9fd9('0x46')](handleError(_0x47eac0,null));};exports[_0x9fd9('0x29')]=function(_0x4f0e7f,_0xfb02a8){return db['MailServerOut'][_0x9fd9('0x48')]({'where':{'id':_0x4f0e7f[_0x9fd9('0x47')]['id']}})[_0x9fd9('0x28')](handleEntityNotFound(_0xfb02a8,null))['then'](removeEntity(_0xfb02a8,null))[_0x9fd9('0x46')](handleError(_0xfb02a8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 16fd197..6a0c960 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 _0x44dc=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0x44dc,0xa2));var _0xc44d=function(_0x32a22d,_0x17b134){_0x32a22d=_0x32a22d-0x0;var _0x302d10=_0x44dc[_0x32a22d];return _0x302d10;};'use strict';var _=require(_0xc44d('0x0'));var util=require(_0xc44d('0x1'));var logger=require(_0xc44d('0x2'))(_0xc44d('0x3'));var moment=require(_0xc44d('0x4'));var BPromise=require(_0xc44d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc44d('0x6'));var rimraf=require('rimraf');var config=require(_0xc44d('0x7'));var attributes=require(_0xc44d('0x8'));module[_0xc44d('0x9')]=function(_0x16c544,_0x524e57){return _0x16c544[_0xc44d('0xa')](_0xc44d('0xb'),attributes,{'tableName':_0xc44d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1805=['bluebird','path','rimraf','exports','define','mail_servers_out','lodash','util','api','moment'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x1805,0x7e));var _0x5180=function(_0x523f3d,_0x240caa){_0x523f3d=_0x523f3d-0x0;var _0x5123c4=_0x1805[_0x523f3d];return _0x5123c4;};'use strict';var _=require(_0x5180('0x0'));var util=require(_0x5180('0x1'));var logger=require('../../config/logger')(_0x5180('0x2'));var moment=require(_0x5180('0x3'));var BPromise=require(_0x5180('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5180('0x5'));var rimraf=require(_0x5180('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0x5180('0x7')]=function(_0x1f7e70,_0x5ce9ea){return _0x1f7e70[_0x5180('0x8')]('MailServerOut',attributes,{'tableName':_0x5180('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index c260866..ba69164 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1c1384,_0x443fdc){var _0x529ed5=function(_0x5d4bb1){while(--_0x5d4bb1){_0x1c1384['push'](_0x1c1384['shift']());}};_0x529ed5(++_0x443fdc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53deba,_0x5e6969){_0x53deba=_0x53deba-0x0;var _0x337b8e=_0x5f2f[_0x53deba];return _0x337b8e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x937ef5,_0x171bde){var _0xadfcab=function(_0x35db19){while(--_0x35db19){_0x937ef5['push'](_0x937ef5['shift']());}};_0xadfcab(++_0x171bde);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index acf1ef3..d7d3427 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 _0x5d0c=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x2688e5,_0x5c410e){var _0x9412f5=function(_0x24feb4){while(--_0x24feb4){_0x2688e5['push'](_0x2688e5['shift']());}};_0x9412f5(++_0x5c410e);}(_0x5d0c,0x17a));var _0xc5d0=function(_0x1720cb,_0x14f6c1){_0x1720cb=_0x1720cb-0x0;var _0x3a41c8=_0x5d0c[_0x1720cb];return _0x3a41c8;};'use strict';var multer=require(_0xc5d0('0x0'));var util=require(_0xc5d0('0x1'));var path=require('path');var timeout=require(_0xc5d0('0x2'));var express=require(_0xc5d0('0x3'));var router=express[_0xc5d0('0x4')]();var fs_extra=require(_0xc5d0('0x5'));var auth=require(_0xc5d0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5d0('0x7'));router['get']('/',auth[_0xc5d0('0x8')](),controller[_0xc5d0('0x9')]);router[_0xc5d0('0xa')](_0xc5d0('0xb'),auth['isAuthenticated'](),controller[_0xc5d0('0xc')]);router[_0xc5d0('0xa')](_0xc5d0('0xd'),auth[_0xc5d0('0x8')](),controller[_0xc5d0('0xe')]);router[_0xc5d0('0xf')]('/',auth[_0xc5d0('0x8')](),controller[_0xc5d0('0x10')]);router[_0xc5d0('0x11')](_0xc5d0('0xd'),auth[_0xc5d0('0x8')](),controller[_0xc5d0('0x12')]);router[_0xc5d0('0x13')](_0xc5d0('0xd'),auth['isAuthenticated'](),controller[_0xc5d0('0x14')]);module[_0xc5d0('0x15')]=router; \ No newline at end of file +var _0xfd71=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','post','put','/:id','update'];(function(_0x32fae0,_0x323087){var _0x2daa55=function(_0x3bd830){while(--_0x3bd830){_0x32fae0['push'](_0x32fae0['shift']());}};_0x2daa55(++_0x323087);}(_0xfd71,0xcb));var _0x1fd7=function(_0x15f6a8,_0x4cac5a){_0x15f6a8=_0x15f6a8-0x0;var _0x30cf05=_0xfd71[_0x15f6a8];return _0x30cf05;};'use strict';var multer=require('multer');var util=require(_0x1fd7('0x0'));var path=require(_0x1fd7('0x1'));var timeout=require(_0x1fd7('0x2'));var express=require('express');var router=express[_0x1fd7('0x3')]();var fs_extra=require(_0x1fd7('0x4'));var auth=require(_0x1fd7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fd7('0x6'));var controller=require(_0x1fd7('0x7'));router['get']('/',auth[_0x1fd7('0x8')](),controller[_0x1fd7('0x9')]);router[_0x1fd7('0xa')](_0x1fd7('0xb'),auth['isAuthenticated'](),controller[_0x1fd7('0xc')]);router[_0x1fd7('0xa')]('/:id',auth[_0x1fd7('0x8')](),controller['show']);router[_0x1fd7('0xd')]('/',auth[_0x1fd7('0x8')](),controller['create']);router[_0x1fd7('0xe')](_0x1fd7('0xf'),auth[_0x1fd7('0x8')](),controller[_0x1fd7('0x10')]);router[_0x1fd7('0x11')](_0x1fd7('0xf'),auth[_0x1fd7('0x8')](),controller[_0x1fd7('0x12')]);module[_0x1fd7('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index a7e5dd3..fbffadd 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 _0x6596=['exports','name','STRING','sequelize'];(function(_0x2a7609,_0xa6a866){var _0x25e456=function(_0x56c1dc){while(--_0x56c1dc){_0x2a7609['push'](_0x2a7609['shift']());}};_0x25e456(++_0xa6a866);}(_0x6596,0x1d3));var _0x6659=function(_0x426dc5,_0x169578){_0x426dc5=_0x426dc5-0x0;var _0x1d6fb7=_0x6596[_0x426dc5];return _0x1d6fb7;};'use strict';var Sequelize=require(_0x6659('0x0'));module[_0x6659('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6659('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6659('0x3')]}}; \ No newline at end of file +var _0x8ca9=['sequelize','exports','STRING','name'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x8ca9,0x9c));var _0x98ca=function(_0x13c67b,_0x4ef60c){_0x13c67b=_0x13c67b-0x0;var _0x2383af=_0x8ca9[_0x13c67b];return _0x2383af;};'use strict';var Sequelize=require(_0x98ca('0x0'));module[_0x98ca('0x1')]={'name':{'type':Sequelize[_0x98ca('0x2')],'unique':_0x98ca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x98ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 925f0cc..a63a376 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 _0xa79d=['pick','filter','merge','map','VIRTUAL','options','MailSubstatus','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','error','stack','name','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where'];(function(_0x2b4135,_0x1097af){var _0x4ee4f1=function(_0x36c907){while(--_0x36c907){_0x2b4135['push'](_0x2b4135['shift']());}};_0x4ee4f1(++_0x1097af);}(_0xa79d,0x1dd));var _0xda79=function(_0x582246,_0xa45179){_0x582246=_0x582246-0x0;var _0x2bcbcd=_0xa79d[_0x582246];return _0x2bcbcd;};'use strict';var emlformat=require(_0xda79('0x0'));var rimraf=require(_0xda79('0x1'));var zipdir=require(_0xda79('0x2'));var jsonpatch=require(_0xda79('0x3'));var rp=require('request-promise');var moment=require(_0xda79('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda79('0x5'));var path=require(_0xda79('0x6'));var sox=require(_0xda79('0x7'));var csv=require(_0xda79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda79('0x9'));var _=require(_0xda79('0xa'));var squel=require(_0xda79('0xb'));var crypto=require(_0xda79('0xc'));var jsforce=require(_0xda79('0xd'));var deskjs=require(_0xda79('0xe'));var toCsv=require(_0xda79('0x8'));var querystring=require('querystring');var Papa=require(_0xda79('0xf'));var Redis=require(_0xda79('0x10'));var authService=require(_0xda79('0x11'));var qs=require(_0xda79('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda79('0x13'));var logger=require(_0xda79('0x14'))(_0xda79('0x15'));var utils=require(_0xda79('0x16'));var config=require(_0xda79('0x17'));var licenseUtil=require(_0xda79('0x18'));var db=require(_0xda79('0x19'))['db'];function respondWithStatusCode(_0xeac40e,_0x44ad9f){_0x44ad9f=_0x44ad9f||0xcc;return function(_0x19c6ce){if(_0x19c6ce){return _0xeac40e[_0xda79('0x1a')](_0x44ad9f);}return _0xeac40e[_0xda79('0x1b')](_0x44ad9f)[_0xda79('0x1c')]();};}function respondWithResult(_0x46e21a,_0x20bb28){_0x20bb28=_0x20bb28||0xc8;return function(_0xb3f938){if(_0xb3f938){return _0x46e21a[_0xda79('0x1b')](_0x20bb28)[_0xda79('0x1d')](_0xb3f938);}};}function respondWithFilteredResult(_0x320e4d,_0x363742){return function(_0x5a230d){if(_0x5a230d){var _0x663136=typeof _0x363742[_0xda79('0x1e')]===_0xda79('0x1f')&&typeof _0x363742[_0xda79('0x20')]===_0xda79('0x1f');var _0x2a02a0=_0x5a230d[_0xda79('0x21')];var _0x1771e6=_0x663136?0x0:_0x363742[_0xda79('0x1e')];var _0x4b878b=_0x663136?_0x5a230d[_0xda79('0x21')]:_0x363742['offset']+_0x363742[_0xda79('0x20')];var _0x279e0b;if(_0x4b878b>=_0x2a02a0){_0x4b878b=_0x2a02a0;_0x279e0b=0xc8;}else{_0x279e0b=0xce;}_0x320e4d[_0xda79('0x1b')](_0x279e0b);return _0x320e4d[_0xda79('0x22')]('Content-Range',_0x1771e6+'-'+_0x4b878b+'/'+_0x2a02a0)['json'](_0x5a230d);}return null;};}function patchUpdates(_0x3e9d4d){return function(_0x5a8c3b){try{jsonpatch['apply'](_0x5a8c3b,_0x3e9d4d,!![]);}catch(_0x1c469f){return BPromise[_0xda79('0x23')](_0x1c469f);}return _0x5a8c3b[_0xda79('0x24')]();};}function saveUpdates(_0x5d7e5e,_0x31eb02){return function(_0x5c6f85){if(_0x5c6f85){return _0x5c6f85['update'](_0x5d7e5e)['then'](function(_0x5cf575){return _0x5cf575;});}return null;};}function removeEntity(_0x413b53,_0x1e5d83){return function(_0x2bcd3b){if(_0x2bcd3b){return _0x2bcd3b['destroy']()[_0xda79('0x25')](function(){_0x413b53['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x362543,_0x17564f){return function(_0x35b2f9){if(!_0x35b2f9){_0x362543[_0xda79('0x1a')](0x194);}return _0x35b2f9;};}function handleError(_0x1a6229,_0x1b387f){_0x1b387f=_0x1b387f||0x1f4;return function(_0x4d1e39){logger[_0xda79('0x26')](_0x4d1e39[_0xda79('0x27')]);if(_0x4d1e39['name']){delete _0x4d1e39[_0xda79('0x28')];}_0x1a6229[_0xda79('0x1b')](_0x1b387f)['send'](_0x4d1e39);};}exports[_0xda79('0x29')]=function(_0x1d0175,_0x4d0fab){var _0x17ebc1={},_0x1dde44={},_0x19ec8c={'count':0x0,'rows':[]};var _0x284dc5=_['map'](db['MailSubstatus'][_0xda79('0x2a')],function(_0x1c9343){return{'name':_0x1c9343[_0xda79('0x2b')],'type':_0x1c9343[_0xda79('0x2c')]['key']};});_0x1dde44['model']=_['map'](_0x284dc5,_0xda79('0x28'));_0x1dde44[_0xda79('0x2d')]=_[_0xda79('0x2e')](_0x1d0175[_0xda79('0x2d')]);_0x1dde44[_0xda79('0x2f')]=_[_0xda79('0x30')](_0x1dde44[_0xda79('0x31')],_0x1dde44['query']);_0x17ebc1[_0xda79('0x32')]=_[_0xda79('0x30')](_0x1dde44[_0xda79('0x31')],qs[_0xda79('0x33')](_0x1d0175[_0xda79('0x2d')][_0xda79('0x33')]));_0x17ebc1[_0xda79('0x32')]=_0x17ebc1[_0xda79('0x32')]['length']?_0x17ebc1[_0xda79('0x32')]:_0x1dde44[_0xda79('0x31')];if(!_0x1d0175[_0xda79('0x2d')][_0xda79('0x34')]('nolimit')){_0x17ebc1['limit']=qs[_0xda79('0x20')](_0x1d0175[_0xda79('0x2d')]['limit']);_0x17ebc1[_0xda79('0x1e')]=qs['offset'](_0x1d0175['query'][_0xda79('0x1e')]);}_0x17ebc1['order']=qs['sort'](_0x1d0175[_0xda79('0x2d')][_0xda79('0x35')]);_0x17ebc1[_0xda79('0x36')]=qs['filters'](_[_0xda79('0x37')](_0x1d0175['query'],_0x1dde44['filters']),_0x284dc5);if(_0x1d0175['query'][_0xda79('0x38')]){_0x17ebc1['where']=_[_0xda79('0x39')](_0x17ebc1[_0xda79('0x36')],{'$or':_[_0xda79('0x3a')](_0x284dc5,function(_0x175851){if(_0x175851['type']!==_0xda79('0x3b')){var _0x320552={};_0x320552[_0x175851[_0xda79('0x28')]]={'$like':'%'+_0x1d0175['query']['filter']+'%'};return _0x320552;}})});}_0x17ebc1=_['merge']({},_0x17ebc1,_0x1d0175[_0xda79('0x3c')]);var _0x2864d7={'where':_0x17ebc1[_0xda79('0x36')]};return db[_0xda79('0x3d')][_0xda79('0x21')](_0x2864d7)[_0xda79('0x25')](function(_0x39f1d1){_0x19ec8c[_0xda79('0x21')]=_0x39f1d1;if(_0x1d0175[_0xda79('0x2d')]['includeAll']){_0x17ebc1[_0xda79('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0xda79('0x3f')](_0x17ebc1);})[_0xda79('0x25')](function(_0x189855){_0x19ec8c[_0xda79('0x40')]=_0x189855;return _0x19ec8c;})[_0xda79('0x25')](respondWithFilteredResult(_0x4d0fab,_0x17ebc1))['catch'](handleError(_0x4d0fab,null));};exports[_0xda79('0x41')]=function(_0x368a1d,_0x468778){var _0xbd7ad={'raw':!![],'where':{'id':_0x368a1d[_0xda79('0x42')]['id']}},_0x322f19={};_0x322f19[_0xda79('0x31')]=_[_0xda79('0x2e')](db[_0xda79('0x3d')]['rawAttributes']);_0x322f19[_0xda79('0x2d')]=_[_0xda79('0x2e')](_0x368a1d[_0xda79('0x2d')]);_0x322f19[_0xda79('0x2f')]=_[_0xda79('0x30')](_0x322f19['model'],_0x322f19['query']);_0xbd7ad[_0xda79('0x32')]=_[_0xda79('0x30')](_0x322f19[_0xda79('0x31')],qs['fields'](_0x368a1d['query']['fields']));_0xbd7ad[_0xda79('0x32')]=_0xbd7ad[_0xda79('0x32')][_0xda79('0x43')]?_0xbd7ad[_0xda79('0x32')]:_0x322f19['model'];if(_0x368a1d[_0xda79('0x2d')][_0xda79('0x44')]){_0xbd7ad['include']=[{'all':!![]}];}_0xbd7ad=_[_0xda79('0x39')]({},_0xbd7ad,_0x368a1d['options']);return db[_0xda79('0x3d')][_0xda79('0x45')](_0xbd7ad)[_0xda79('0x25')](handleEntityNotFound(_0x468778,null))[_0xda79('0x25')](respondWithResult(_0x468778,null))[_0xda79('0x46')](handleError(_0x468778,null));};exports['create']=function(_0x3c9aac,_0x3450ab){return db[_0xda79('0x3d')][_0xda79('0x47')](_0x3c9aac[_0xda79('0x48')],{})[_0xda79('0x25')](respondWithResult(_0x3450ab,0xc9))[_0xda79('0x46')](handleError(_0x3450ab,null));};exports[_0xda79('0x49')]=function(_0x5b3939,_0x1dd567){if(_0x5b3939[_0xda79('0x48')]['id']){delete _0x5b3939[_0xda79('0x48')]['id'];}return db['MailSubstatus'][_0xda79('0x45')]({'where':{'id':_0x5b3939[_0xda79('0x42')]['id']}})[_0xda79('0x25')](handleEntityNotFound(_0x1dd567,null))[_0xda79('0x25')](saveUpdates(_0x5b3939[_0xda79('0x48')],null))[_0xda79('0x25')](respondWithResult(_0x1dd567,null))[_0xda79('0x46')](handleError(_0x1dd567,null));};exports[_0xda79('0x4a')]=function(_0x462fa2,_0x9b028a){return db[_0xda79('0x3d')][_0xda79('0x45')]({'where':{'id':_0x462fa2[_0xda79('0x42')]['id']}})['then'](handleEntityNotFound(_0x9b028a,null))['then'](removeEntity(_0x9b028a,null))['catch'](handleError(_0x9b028a,null));};exports[_0xda79('0x4b')]=function(_0x140f24,_0x16d3db){return db['MailSubstatus'][_0xda79('0x4b')]()[_0xda79('0x25')](respondWithResult(_0x16d3db,null))['catch'](handleError(_0x16d3db,null));}; \ No newline at end of file +var _0x76ed=['include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','MailSubstatus','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','where','VIRTUAL','filter','merge','options','count','includeAll'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x76ed,0x1e7));var _0xd76e=function(_0x4a3d7b,_0x1ca859){_0x4a3d7b=_0x4a3d7b-0x0;var _0x29cc24=_0x76ed[_0x4a3d7b];return _0x29cc24;};'use strict';var emlformat=require(_0xd76e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd76e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd76e('0x2'));var Mustache=require(_0xd76e('0x3'));var util=require('util');var path=require(_0xd76e('0x4'));var sox=require(_0xd76e('0x5'));var csv=require(_0xd76e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd76e('0x7'));var squel=require(_0xd76e('0x8'));var crypto=require('crypto');var jsforce=require(_0xd76e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd76e('0x6'));var querystring=require('querystring');var Papa=require(_0xd76e('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd76e('0xb'));var as=require(_0xd76e('0xc'));var hardwareService=require(_0xd76e('0xd'));var logger=require(_0xd76e('0xe'))(_0xd76e('0xf'));var utils=require(_0xd76e('0x10'));var config=require(_0xd76e('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xd76e('0x12'))['db'];function respondWithStatusCode(_0x53255b,_0x4097b4){_0x4097b4=_0x4097b4||0xcc;return function(_0x5dc896){if(_0x5dc896){return _0x53255b[_0xd76e('0x13')](_0x4097b4);}return _0x53255b[_0xd76e('0x14')](_0x4097b4)[_0xd76e('0x15')]();};}function respondWithResult(_0x450fe6,_0x229c31){_0x229c31=_0x229c31||0xc8;return function(_0x1ae0d3){if(_0x1ae0d3){return _0x450fe6[_0xd76e('0x14')](_0x229c31)['json'](_0x1ae0d3);}};}function respondWithFilteredResult(_0x5bd800,_0x17f6be){return function(_0xc6c046){if(_0xc6c046){var _0x30dc9d=typeof _0x17f6be['offset']===_0xd76e('0x16')&&typeof _0x17f6be[_0xd76e('0x17')]===_0xd76e('0x16');var _0x2bd3e6=_0xc6c046['count'];var _0x3747f5=_0x30dc9d?0x0:_0x17f6be[_0xd76e('0x18')];var _0x274c79=_0x30dc9d?_0xc6c046['count']:_0x17f6be[_0xd76e('0x18')]+_0x17f6be[_0xd76e('0x17')];var _0x345374;if(_0x274c79>=_0x2bd3e6){_0x274c79=_0x2bd3e6;_0x345374=0xc8;}else{_0x345374=0xce;}_0x5bd800[_0xd76e('0x14')](_0x345374);return _0x5bd800['set'](_0xd76e('0x19'),_0x3747f5+'-'+_0x274c79+'/'+_0x2bd3e6)['json'](_0xc6c046);}return null;};}function patchUpdates(_0x4bd10c){return function(_0x514c32){try{jsonpatch[_0xd76e('0x1a')](_0x514c32,_0x4bd10c,!![]);}catch(_0x34647b){return BPromise[_0xd76e('0x1b')](_0x34647b);}return _0x514c32[_0xd76e('0x1c')]();};}function saveUpdates(_0x48f00e,_0x128dba){return function(_0x31dbd9){if(_0x31dbd9){return _0x31dbd9[_0xd76e('0x1d')](_0x48f00e)[_0xd76e('0x1e')](function(_0x52f91c){return _0x52f91c;});}return null;};}function removeEntity(_0x104932,_0x4bd538){return function(_0x30bcc1){if(_0x30bcc1){return _0x30bcc1[_0xd76e('0x1f')]()[_0xd76e('0x1e')](function(){_0x104932['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x432770,_0x4e1682){return function(_0x411957){if(!_0x411957){_0x432770['sendStatus'](0x194);}return _0x411957;};}function handleError(_0x3ecc6a,_0x6338ce){_0x6338ce=_0x6338ce||0x1f4;return function(_0x31cfaa){logger['error'](_0x31cfaa[_0xd76e('0x20')]);if(_0x31cfaa[_0xd76e('0x21')]){delete _0x31cfaa['name'];}_0x3ecc6a[_0xd76e('0x14')](_0x6338ce)['send'](_0x31cfaa);};}exports[_0xd76e('0x22')]=function(_0x3684d5,_0x497c20){var _0x14dc69={},_0xf56efc={},_0x256100={'count':0x0,'rows':[]};var _0x356208=_['map'](db[_0xd76e('0x23')]['rawAttributes'],function(_0x1111b7){return{'name':_0x1111b7[_0xd76e('0x24')],'type':_0x1111b7[_0xd76e('0x25')]['key']};});_0xf56efc[_0xd76e('0x26')]=_[_0xd76e('0x27')](_0x356208,_0xd76e('0x21'));_0xf56efc[_0xd76e('0x28')]=_[_0xd76e('0x29')](_0x3684d5['query']);_0xf56efc['filters']=_[_0xd76e('0x2a')](_0xf56efc[_0xd76e('0x26')],_0xf56efc['query']);_0x14dc69[_0xd76e('0x2b')]=_[_0xd76e('0x2a')](_0xf56efc[_0xd76e('0x26')],qs[_0xd76e('0x2c')](_0x3684d5[_0xd76e('0x28')]['fields']));_0x14dc69['attributes']=_0x14dc69['attributes'][_0xd76e('0x2d')]?_0x14dc69[_0xd76e('0x2b')]:_0xf56efc[_0xd76e('0x26')];if(!_0x3684d5[_0xd76e('0x28')]['hasOwnProperty'](_0xd76e('0x2e'))){_0x14dc69[_0xd76e('0x17')]=qs[_0xd76e('0x17')](_0x3684d5[_0xd76e('0x28')][_0xd76e('0x17')]);_0x14dc69[_0xd76e('0x18')]=qs[_0xd76e('0x18')](_0x3684d5['query']['offset']);}_0x14dc69[_0xd76e('0x2f')]=qs[_0xd76e('0x30')](_0x3684d5[_0xd76e('0x28')][_0xd76e('0x30')]);_0x14dc69['where']=qs[_0xd76e('0x31')](_['pick'](_0x3684d5[_0xd76e('0x28')],_0xf56efc[_0xd76e('0x31')]),_0x356208);if(_0x3684d5['query']['filter']){_0x14dc69[_0xd76e('0x32')]=_['merge'](_0x14dc69[_0xd76e('0x32')],{'$or':_['map'](_0x356208,function(_0x1ceb8d){if(_0x1ceb8d[_0xd76e('0x25')]!==_0xd76e('0x33')){var _0x2f4cf5={};_0x2f4cf5[_0x1ceb8d[_0xd76e('0x21')]]={'$like':'%'+_0x3684d5[_0xd76e('0x28')][_0xd76e('0x34')]+'%'};return _0x2f4cf5;}})});}_0x14dc69=_[_0xd76e('0x35')]({},_0x14dc69,_0x3684d5[_0xd76e('0x36')]);var _0x8a0eed={'where':_0x14dc69[_0xd76e('0x32')]};return db['MailSubstatus'][_0xd76e('0x37')](_0x8a0eed)[_0xd76e('0x1e')](function(_0x567527){_0x256100[_0xd76e('0x37')]=_0x567527;if(_0x3684d5[_0xd76e('0x28')][_0xd76e('0x38')]){_0x14dc69[_0xd76e('0x39')]=[{'all':!![]}];}return db[_0xd76e('0x23')][_0xd76e('0x3a')](_0x14dc69);})['then'](function(_0x39216a){_0x256100[_0xd76e('0x3b')]=_0x39216a;return _0x256100;})[_0xd76e('0x1e')](respondWithFilteredResult(_0x497c20,_0x14dc69))[_0xd76e('0x3c')](handleError(_0x497c20,null));};exports[_0xd76e('0x3d')]=function(_0x46f524,_0x12de99){var _0x25d7c0={'raw':!![],'where':{'id':_0x46f524[_0xd76e('0x3e')]['id']}},_0x5f3672={};_0x5f3672[_0xd76e('0x26')]=_[_0xd76e('0x29')](db[_0xd76e('0x23')][_0xd76e('0x3f')]);_0x5f3672[_0xd76e('0x28')]=_[_0xd76e('0x29')](_0x46f524['query']);_0x5f3672[_0xd76e('0x31')]=_[_0xd76e('0x2a')](_0x5f3672[_0xd76e('0x26')],_0x5f3672[_0xd76e('0x28')]);_0x25d7c0[_0xd76e('0x2b')]=_[_0xd76e('0x2a')](_0x5f3672['model'],qs[_0xd76e('0x2c')](_0x46f524[_0xd76e('0x28')][_0xd76e('0x2c')]));_0x25d7c0['attributes']=_0x25d7c0['attributes'][_0xd76e('0x2d')]?_0x25d7c0['attributes']:_0x5f3672[_0xd76e('0x26')];if(_0x46f524['query']['includeAll']){_0x25d7c0[_0xd76e('0x39')]=[{'all':!![]}];}_0x25d7c0=_[_0xd76e('0x35')]({},_0x25d7c0,_0x46f524[_0xd76e('0x36')]);return db['MailSubstatus'][_0xd76e('0x40')](_0x25d7c0)[_0xd76e('0x1e')](handleEntityNotFound(_0x12de99,null))[_0xd76e('0x1e')](respondWithResult(_0x12de99,null))[_0xd76e('0x3c')](handleError(_0x12de99,null));};exports['create']=function(_0x49bbad,_0x42748c){return db[_0xd76e('0x23')][_0xd76e('0x41')](_0x49bbad['body'],{})[_0xd76e('0x1e')](respondWithResult(_0x42748c,0xc9))[_0xd76e('0x3c')](handleError(_0x42748c,null));};exports['update']=function(_0x8bb72f,_0x4d4919){if(_0x8bb72f[_0xd76e('0x42')]['id']){delete _0x8bb72f['body']['id'];}return db['MailSubstatus'][_0xd76e('0x40')]({'where':{'id':_0x8bb72f['params']['id']}})[_0xd76e('0x1e')](handleEntityNotFound(_0x4d4919,null))['then'](saveUpdates(_0x8bb72f['body'],null))['then'](respondWithResult(_0x4d4919,null))[_0xd76e('0x3c')](handleError(_0x4d4919,null));};exports['destroy']=function(_0x112055,_0xc7138a){return db[_0xd76e('0x23')][_0xd76e('0x40')]({'where':{'id':_0x112055[_0xd76e('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc7138a,null))['then'](removeEntity(_0xc7138a,null))[_0xd76e('0x3c')](handleError(_0xc7138a,null));};exports['describe']=function(_0xc8b6d1,_0x8f382e){return db[_0xd76e('0x23')][_0xd76e('0x43')]()['then'](respondWithResult(_0x8f382e,null))[_0xd76e('0x3c')](handleError(_0x8f382e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index ce5a8ab..aaad9e1 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1aff=['setMaxListeners','update','hook','exports','../../mysqldb'];(function(_0x262a91,_0x4d3739){var _0x5dcb6b=function(_0x5df927){while(--_0x5df927){_0x262a91['push'](_0x262a91['shift']());}};_0x5dcb6b(++_0x4d3739);}(_0x1aff,0x10d));var _0xf1af=function(_0x300f55,_0x54072c){_0x300f55=_0x300f55-0x0;var _0x4ebfff=_0x1aff[_0x300f55];return _0x4ebfff;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xf1af('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf1af('0x1')](0x0);var events={'afterUpdate':_0xf1af('0x2')};function emitEvent(_0x421734){return function(_0x236cc7,_0x36024c,_0x24c68f){MailSubstatusEvents['emit'](_0x421734+':'+_0x236cc7['id'],_0x236cc7);MailSubstatusEvents['emit'](_0x421734,_0x236cc7);_0x24c68f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xf1af('0x3')](e,emitEvent(event));}}module[_0xf1af('0x4')]=MailSubstatusEvents; \ No newline at end of file +var _0xf32f=['../../mysqldb','setMaxListeners','update','emit','hook','exports','events'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xf32f,0x141));var _0xff32=function(_0xc45d6a,_0x3fc066){_0xc45d6a=_0xc45d6a-0x0;var _0x6efdf7=_0xf32f[_0xc45d6a];return _0x6efdf7;};'use strict';var EventEmitter=require(_0xff32('0x0'));var MailSubstatus=require(_0xff32('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xff32('0x2')](0x0);var events={'afterUpdate':_0xff32('0x3')};function emitEvent(_0x41e5fc){return function(_0x13c03b,_0xd611c2,_0x726d3c){MailSubstatusEvents[_0xff32('0x4')](_0x41e5fc+':'+_0x13c03b['id'],_0x13c03b);MailSubstatusEvents[_0xff32('0x4')](_0x41e5fc,_0x13c03b);_0x726d3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xff32('0x5')](e,emitEvent(event));}}module[_0xff32('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index bf46991..9a8bde7 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 _0x5d8b=['MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name','then','catch','models'];(function(_0xb850d3,_0xa43ea6){var _0x53c961=function(_0x121d35){while(--_0x121d35){_0xb850d3['push'](_0xb850d3['shift']());}};_0x53c961(++_0xa43ea6);}(_0x5d8b,0x77));var _0xb5d8=function(_0xda3fbb,_0x40cc49){_0xda3fbb=_0xda3fbb-0x0;var _0x3b6716=_0x5d8b[_0xda3fbb];return _0x3b6716;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x1fe53f){var _0x548fb4=_0x1fe53f[_0xb5d8('0x0')];return _0x1fe53f['define'](_0xb5d8('0x1'),attributes,{'tableName':_0xb5d8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x12bc09,_0x2e5345,_0x4a27c0){return _0x548fb4[_0xb5d8('0x3')][_0xb5d8('0x4')]({'value':_0x12bc09['name']},{'where':{'field':_0xb5d8('0x5'),'value':_0x12bc09[_0xb5d8('0x6')][_0xb5d8('0x7')]}})[_0xb5d8('0x8')](function(){_0x4a27c0();})[_0xb5d8('0x9')](function(_0x462058){_0x4a27c0(_0x462058);});}}});}; \ No newline at end of file +var _0xe74c=['MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','catch','./mailSubstatus.attributes','exports','models','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe74c,0xf9));var _0xce74=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xe74c[_0x23e7c1];return _0x1add43;};'use strict';var attributes=require(_0xce74('0x0'));module[_0xce74('0x1')]=function(_0x52c524){var _0x451b7d=_0x52c524[_0xce74('0x2')];return _0x52c524[_0xce74('0x3')](_0xce74('0x4'),attributes,{'tableName':_0xce74('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x757641,_0x22b012,_0x4a8a2b){return _0x451b7d[_0xce74('0x6')][_0xce74('0x7')]({'value':_0x757641[_0xce74('0x8')]},{'where':{'field':'mailSubstatus','value':_0x757641[_0xce74('0x9')][_0xce74('0x8')]}})['then'](function(){_0x4a8a2b();})[_0xce74('0xa')](function(_0x1e48ff){_0x4a8a2b(_0x1e48ff);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e8d28f5..eaa87fa 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 _0x637a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4364bf,_0x266759){var _0x13b177=function(_0x4e60c3){while(--_0x4e60c3){_0x4364bf['push'](_0x4364bf['shift']());}};_0x13b177(++_0x266759);}(_0x637a,0x132));var _0xa637=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x637a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa637('0x0'));var util=require(_0xa637('0x1'));var moment=require(_0xa637('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa637('0x3'));var db=require(_0xa637('0x4'))['db'];var utils=require(_0xa637('0x5'));var logger=require(_0xa637('0x6'))(_0xa637('0x7'));var config=require(_0xa637('0x8'));var jayson=require(_0xa637('0x9'));var client=jayson[_0xa637('0xa')][_0xa637('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a4288,_0xc43f08,_0x5ab5a2){return new BPromise(function(_0x455bc2,_0x10798d){return client[_0xa637('0xc')](_0x5a4288,_0x5ab5a2)[_0xa637('0xd')](function(_0x4a7df4){logger[_0xa637('0xe')]('MailSubstatus,\x20%s,\x20%s',_0xc43f08,_0xa637('0xf'));logger['debug'](_0xa637('0x10'),_0xc43f08,_0xa637('0xf'),JSON[_0xa637('0x11')](_0x4a7df4));if(_0x4a7df4[_0xa637('0x12')]){if(_0x4a7df4['error'][_0xa637('0x13')]===0x1f4){logger[_0xa637('0x12')](_0xa637('0x14'),_0xc43f08,_0x4a7df4[_0xa637('0x12')][_0xa637('0x15')]);return _0x10798d(_0x4a7df4['error'][_0xa637('0x15')]);}logger[_0xa637('0x12')](_0xa637('0x14'),_0xc43f08,_0x4a7df4[_0xa637('0x12')][_0xa637('0x15')]);return _0x455bc2(_0x4a7df4[_0xa637('0x12')][_0xa637('0x15')]);}else{logger[_0xa637('0xe')]('MailSubstatus,\x20%s,\x20%s',_0xc43f08,'request\x20sent');_0x455bc2(_0x4a7df4[_0xa637('0x16')][_0xa637('0x15')]);}})[_0xa637('0x17')](function(_0x159fb2){logger['error'](_0xa637('0x14'),_0xc43f08,_0x159fb2);_0x10798d(_0x159fb2);});});} \ No newline at end of file +var _0x65b8=['util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0x65b8,0x1c1));var _0x865b=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x65b8[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x865b('0x0'));var util=require(_0x865b('0x1'));var moment=require(_0x865b('0x2'));var BPromise=require(_0x865b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x865b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x865b('0x5'))(_0x865b('0x6'));var config=require(_0x865b('0x7'));var jayson=require(_0x865b('0x8'));var client=jayson['client'][_0x865b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1415fd,_0x1a9562,_0x3af1f7){return new BPromise(function(_0x5d01f3,_0x4334d9){return client[_0x865b('0xa')](_0x1415fd,_0x3af1f7)['then'](function(_0x37aa14){logger[_0x865b('0xb')](_0x865b('0xc'),_0x1a9562,_0x865b('0xd'));logger[_0x865b('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1a9562,'request\x20sent',JSON['stringify'](_0x37aa14));if(_0x37aa14[_0x865b('0xf')]){if(_0x37aa14[_0x865b('0xf')][_0x865b('0x10')]===0x1f4){logger[_0x865b('0xf')](_0x865b('0xc'),_0x1a9562,_0x37aa14[_0x865b('0xf')][_0x865b('0x11')]);return _0x4334d9(_0x37aa14[_0x865b('0xf')][_0x865b('0x11')]);}logger[_0x865b('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x1a9562,_0x37aa14[_0x865b('0xf')][_0x865b('0x11')]);return _0x5d01f3(_0x37aa14[_0x865b('0xf')]['message']);}else{logger[_0x865b('0xb')](_0x865b('0xc'),_0x1a9562,_0x865b('0xd'));_0x5d01f3(_0x37aa14['result']['message']);}})['catch'](function(_0x1c2503){logger[_0x865b('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x1a9562,_0x1c2503);_0x4334d9(_0x1c2503);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3340a2f..ef0907c 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 _0x065b=['../../config/environment','get','isAuthenticated','index','describe','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x175a8c,_0x2d9212){var _0x37b0b0=function(_0x20ef5f){while(--_0x20ef5f){_0x175a8c['push'](_0x175a8c['shift']());}};_0x37b0b0(++_0x2d9212);}(_0x065b,0x110));var _0xb065=function(_0x330e77,_0x2dd3c0){_0x330e77=_0x330e77-0x0;var _0xdbadea=_0x065b[_0x330e77];return _0xdbadea;};'use strict';var multer=require(_0xb065('0x0'));var util=require(_0xb065('0x1'));var path=require('path');var timeout=require(_0xb065('0x2'));var express=require(_0xb065('0x3'));var router=express[_0xb065('0x4')]();var fs_extra=require(_0xb065('0x5'));var auth=require(_0xb065('0x6'));var interaction=require(_0xb065('0x7'));var config=require(_0xb065('0x8'));var controller=require('./mailTransferReport.controller');router[_0xb065('0x9')]('/',auth[_0xb065('0xa')](),controller[_0xb065('0xb')]);router[_0xb065('0x9')]('/describe',auth[_0xb065('0xa')](),controller[_0xb065('0xc')]);router[_0xb065('0x9')]('/:id',auth[_0xb065('0xa')](),controller['show']);router[_0xb065('0xd')]('/',auth[_0xb065('0xa')](),controller[_0xb065('0xe')]);router[_0xb065('0xf')](_0xb065('0x10'),auth[_0xb065('0xa')](),controller['update']);router[_0xb065('0x11')](_0xb065('0x10'),auth[_0xb065('0xa')](),controller[_0xb065('0x12')]);module[_0xb065('0x13')]=router; \ No newline at end of file +var _0xfc59=['post','create','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x94d66b,_0x328fa8){var _0x44cd18=function(_0x1aff3c){while(--_0x1aff3c){_0x94d66b['push'](_0x94d66b['shift']());}};_0x44cd18(++_0x328fa8);}(_0xfc59,0x159));var _0x9fc5=function(_0x717fc3,_0x4a4394){_0x717fc3=_0x717fc3-0x0;var _0x5ddcb1=_0xfc59[_0x717fc3];return _0x5ddcb1;};'use strict';var multer=require('multer');var util=require(_0x9fc5('0x0'));var path=require(_0x9fc5('0x1'));var timeout=require(_0x9fc5('0x2'));var express=require('express');var router=express[_0x9fc5('0x3')]();var fs_extra=require(_0x9fc5('0x4'));var auth=require(_0x9fc5('0x5'));var interaction=require(_0x9fc5('0x6'));var config=require(_0x9fc5('0x7'));var controller=require(_0x9fc5('0x8'));router[_0x9fc5('0x9')]('/',auth[_0x9fc5('0xa')](),controller[_0x9fc5('0xb')]);router[_0x9fc5('0x9')](_0x9fc5('0xc'),auth[_0x9fc5('0xa')](),controller[_0x9fc5('0xd')]);router[_0x9fc5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9fc5('0xe')]);router[_0x9fc5('0xf')]('/',auth[_0x9fc5('0xa')](),controller[_0x9fc5('0x10')]);router['put']('/:id',auth[_0x9fc5('0xa')](),controller[_0x9fc5('0x11')]);router['delete']('/:id',auth[_0x9fc5('0xa')](),controller[_0x9fc5('0x12')]);module[_0x9fc5('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 05bff8b..b1a4a51 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x54ef,0x112));var _0xf54e=function(_0x3a5676,_0x1dff02){_0x3a5676=_0x3a5676-0x0;var _0x1c6e62=_0x54ef[_0x3a5676];return _0x1c6e62;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2b3228,_0x1931b5){var _0x315840=function(_0x5c9385){while(--_0x5c9385){_0x2b3228['push'](_0x2b3228['shift']());}};_0x315840(++_0x1931b5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xf3cd[_0x2b0a86];return _0x955940;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a2e5e60..76b37c7 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 _0xc244=['reject','update','then','destroy','end','stack','name','send','index','map','MailTransferReport','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x12807b,_0x7c0dfb){var _0x5a676e=function(_0x2cb9d9){while(--_0x2cb9d9){_0x12807b['push'](_0x12807b['shift']());}};_0x5a676e(++_0x7c0dfb);}(_0xc244,0x147));var _0x4c24=function(_0x134bad,_0x3af822){_0x134bad=_0x134bad-0x0;var _0x17f6a6=_0xc244[_0x134bad];return _0x17f6a6;};'use strict';var emlformat=require(_0x4c24('0x0'));var rimraf=require(_0x4c24('0x1'));var zipdir=require(_0x4c24('0x2'));var jsonpatch=require(_0x4c24('0x3'));var rp=require(_0x4c24('0x4'));var moment=require('moment');var BPromise=require(_0x4c24('0x5'));var Mustache=require(_0x4c24('0x6'));var util=require('util');var path=require(_0x4c24('0x7'));var sox=require(_0x4c24('0x8'));var csv=require(_0x4c24('0x9'));var ejs=require(_0x4c24('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4c24('0xb'));var crypto=require(_0x4c24('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c24('0xd'));var Papa=require(_0x4c24('0xe'));var Redis=require(_0x4c24('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4c24('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c24('0x11'));var logger=require(_0x4c24('0x12'))('api');var utils=require(_0x4c24('0x13'));var config=require(_0x4c24('0x14'));var licenseUtil=require(_0x4c24('0x15'));var db=require(_0x4c24('0x16'))['db'];function respondWithStatusCode(_0x5106f3,_0x567878){_0x567878=_0x567878||0xcc;return function(_0xec0283){if(_0xec0283){return _0x5106f3[_0x4c24('0x17')](_0x567878);}return _0x5106f3[_0x4c24('0x18')](_0x567878)['end']();};}function respondWithResult(_0x59801f,_0x1a0f69){_0x1a0f69=_0x1a0f69||0xc8;return function(_0x3ecfa1){if(_0x3ecfa1){return _0x59801f[_0x4c24('0x18')](_0x1a0f69)[_0x4c24('0x19')](_0x3ecfa1);}};}function respondWithFilteredResult(_0x15e8bb,_0x125c0f){return function(_0x48d409){if(_0x48d409){var _0x462546=typeof _0x125c0f[_0x4c24('0x1a')]===_0x4c24('0x1b')&&typeof _0x125c0f['limit']===_0x4c24('0x1b');var _0x4b74d8=_0x48d409[_0x4c24('0x1c')];var _0x2b4565=_0x462546?0x0:_0x125c0f[_0x4c24('0x1a')];var _0x58d496=_0x462546?_0x48d409[_0x4c24('0x1c')]:_0x125c0f['offset']+_0x125c0f[_0x4c24('0x1d')];var _0x2c7c9f;if(_0x58d496>=_0x4b74d8){_0x58d496=_0x4b74d8;_0x2c7c9f=0xc8;}else{_0x2c7c9f=0xce;}_0x15e8bb['status'](_0x2c7c9f);return _0x15e8bb[_0x4c24('0x1e')](_0x4c24('0x1f'),_0x2b4565+'-'+_0x58d496+'/'+_0x4b74d8)[_0x4c24('0x19')](_0x48d409);}return null;};}function patchUpdates(_0x100211){return function(_0x118b6a){try{jsonpatch[_0x4c24('0x20')](_0x118b6a,_0x100211,!![]);}catch(_0x5870b5){return BPromise[_0x4c24('0x21')](_0x5870b5);}return _0x118b6a['save']();};}function saveUpdates(_0x296f61,_0x44644c){return function(_0x1bc4d9){if(_0x1bc4d9){return _0x1bc4d9[_0x4c24('0x22')](_0x296f61)[_0x4c24('0x23')](function(_0x43dbfc){return _0x43dbfc;});}return null;};}function removeEntity(_0x2a4b1e,_0x9d8102){return function(_0x847b61){if(_0x847b61){return _0x847b61[_0x4c24('0x24')]()[_0x4c24('0x23')](function(){_0x2a4b1e['status'](0xcc)[_0x4c24('0x25')]();});}};}function handleEntityNotFound(_0x2e2015,_0x451de4){return function(_0x24edda){if(!_0x24edda){_0x2e2015['sendStatus'](0x194);}return _0x24edda;};}function handleError(_0x1f6a1d,_0x18ef55){_0x18ef55=_0x18ef55||0x1f4;return function(_0x25c69c){logger['error'](_0x25c69c[_0x4c24('0x26')]);if(_0x25c69c[_0x4c24('0x27')]){delete _0x25c69c['name'];}_0x1f6a1d[_0x4c24('0x18')](_0x18ef55)[_0x4c24('0x28')](_0x25c69c);};}exports[_0x4c24('0x29')]=function(_0x2d6d33,_0x2fd724){var _0x3eb5ed={},_0x4400d8={},_0x4fd80f={'count':0x0,'rows':[]};var _0xc7e602=_[_0x4c24('0x2a')](db[_0x4c24('0x2b')][_0x4c24('0x2c')],function(_0x2e48bf){return{'name':_0x2e48bf['fieldName'],'type':_0x2e48bf[_0x4c24('0x2d')]['key']};});_0x4400d8[_0x4c24('0x2e')]=_[_0x4c24('0x2a')](_0xc7e602,_0x4c24('0x27'));_0x4400d8[_0x4c24('0x2f')]=_['keys'](_0x2d6d33[_0x4c24('0x2f')]);_0x4400d8[_0x4c24('0x30')]=_['intersection'](_0x4400d8[_0x4c24('0x2e')],_0x4400d8[_0x4c24('0x2f')]);_0x3eb5ed[_0x4c24('0x31')]=_[_0x4c24('0x32')](_0x4400d8[_0x4c24('0x2e')],qs[_0x4c24('0x33')](_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x33')]));_0x3eb5ed['attributes']=_0x3eb5ed[_0x4c24('0x31')][_0x4c24('0x34')]?_0x3eb5ed[_0x4c24('0x31')]:_0x4400d8[_0x4c24('0x2e')];if(!_0x2d6d33['query'][_0x4c24('0x35')](_0x4c24('0x36'))){_0x3eb5ed['limit']=qs['limit'](_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x1d')]);_0x3eb5ed[_0x4c24('0x1a')]=qs[_0x4c24('0x1a')](_0x2d6d33[_0x4c24('0x2f')]['offset']);}_0x3eb5ed['order']=qs[_0x4c24('0x37')](_0x2d6d33['query'][_0x4c24('0x37')]);_0x3eb5ed[_0x4c24('0x38')]=qs[_0x4c24('0x30')](_['pick'](_0x2d6d33[_0x4c24('0x2f')],_0x4400d8['filters']),_0xc7e602);if(_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x39')]){_0x3eb5ed[_0x4c24('0x38')]=_[_0x4c24('0x3a')](_0x3eb5ed['where'],{'$or':_[_0x4c24('0x2a')](_0xc7e602,function(_0x3d2481){if(_0x3d2481['type']!==_0x4c24('0x3b')){var _0x410d71={};_0x410d71[_0x3d2481[_0x4c24('0x27')]]={'$like':'%'+_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x39')]+'%'};return _0x410d71;}})});}_0x3eb5ed=_[_0x4c24('0x3a')]({},_0x3eb5ed,_0x2d6d33[_0x4c24('0x3c')]);var _0x54f64b={'where':_0x3eb5ed['where']};return db[_0x4c24('0x2b')][_0x4c24('0x1c')](_0x54f64b)[_0x4c24('0x23')](function(_0x3a4e97){_0x4fd80f[_0x4c24('0x1c')]=_0x3a4e97;if(_0x2d6d33[_0x4c24('0x2f')][_0x4c24('0x3d')]){_0x3eb5ed[_0x4c24('0x3e')]=[{'all':!![]}];}return db[_0x4c24('0x2b')]['findAll'](_0x3eb5ed);})[_0x4c24('0x23')](function(_0x291e73){_0x4fd80f[_0x4c24('0x3f')]=_0x291e73;return _0x4fd80f;})[_0x4c24('0x23')](respondWithFilteredResult(_0x2fd724,_0x3eb5ed))[_0x4c24('0x40')](handleError(_0x2fd724,null));};exports[_0x4c24('0x41')]=function(_0x301ce0,_0xfeca8a){var _0x369525={'raw':!![],'where':{'id':_0x301ce0[_0x4c24('0x42')]['id']}},_0x3f81d3={};_0x3f81d3[_0x4c24('0x2e')]=_['keys'](db[_0x4c24('0x2b')][_0x4c24('0x2c')]);_0x3f81d3[_0x4c24('0x2f')]=_[_0x4c24('0x43')](_0x301ce0[_0x4c24('0x2f')]);_0x3f81d3[_0x4c24('0x30')]=_[_0x4c24('0x32')](_0x3f81d3[_0x4c24('0x2e')],_0x3f81d3[_0x4c24('0x2f')]);_0x369525[_0x4c24('0x31')]=_[_0x4c24('0x32')](_0x3f81d3[_0x4c24('0x2e')],qs[_0x4c24('0x33')](_0x301ce0[_0x4c24('0x2f')]['fields']));_0x369525[_0x4c24('0x31')]=_0x369525[_0x4c24('0x31')][_0x4c24('0x34')]?_0x369525['attributes']:_0x3f81d3[_0x4c24('0x2e')];if(_0x301ce0[_0x4c24('0x2f')][_0x4c24('0x3d')]){_0x369525['include']=[{'all':!![]}];}_0x369525=_[_0x4c24('0x3a')]({},_0x369525,_0x301ce0[_0x4c24('0x3c')]);return db[_0x4c24('0x2b')]['find'](_0x369525)[_0x4c24('0x23')](handleEntityNotFound(_0xfeca8a,null))[_0x4c24('0x23')](respondWithResult(_0xfeca8a,null))[_0x4c24('0x40')](handleError(_0xfeca8a,null));};exports[_0x4c24('0x44')]=function(_0x32cac1,_0x41ae0a){return db[_0x4c24('0x2b')]['create'](_0x32cac1[_0x4c24('0x45')],{})[_0x4c24('0x23')](respondWithResult(_0x41ae0a,0xc9))['catch'](handleError(_0x41ae0a,null));};exports[_0x4c24('0x22')]=function(_0x2bd1fe,_0xa3a82){if(_0x2bd1fe['body']['id']){delete _0x2bd1fe['body']['id'];}return db[_0x4c24('0x2b')][_0x4c24('0x46')]({'where':{'id':_0x2bd1fe[_0x4c24('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3a82,null))[_0x4c24('0x23')](saveUpdates(_0x2bd1fe[_0x4c24('0x45')],null))['then'](respondWithResult(_0xa3a82,null))[_0x4c24('0x40')](handleError(_0xa3a82,null));};exports[_0x4c24('0x24')]=function(_0x2549ef,_0x6b208d){return db['MailTransferReport'][_0x4c24('0x46')]({'where':{'id':_0x2549ef['params']['id']}})[_0x4c24('0x23')](handleEntityNotFound(_0x6b208d,null))[_0x4c24('0x23')](removeEntity(_0x6b208d,null))[_0x4c24('0x40')](handleError(_0x6b208d,null));};exports[_0x4c24('0x47')]=function(_0x354b79,_0x246f99){return db['MailTransferReport'][_0x4c24('0x47')]()[_0x4c24('0x23')](respondWithResult(_0x246f99,null))[_0x4c24('0x40')](handleError(_0x246f99,null));}; \ No newline at end of file +var _0xe6ea=['index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send'];(function(_0x36a15f,_0x230479){var _0x2e85dd=function(_0x198ecd){while(--_0x198ecd){_0x36a15f['push'](_0x36a15f['shift']());}};_0x2e85dd(++_0x230479);}(_0xe6ea,0x1b2));var _0xae6e=function(_0x305753,_0x299ca1){_0x305753=_0x305753-0x0;var _0x3ad6ff=_0xe6ea[_0x305753];return _0x3ad6ff;};'use strict';var emlformat=require(_0xae6e('0x0'));var rimraf=require(_0xae6e('0x1'));var zipdir=require(_0xae6e('0x2'));var jsonpatch=require(_0xae6e('0x3'));var rp=require(_0xae6e('0x4'));var moment=require(_0xae6e('0x5'));var BPromise=require(_0xae6e('0x6'));var Mustache=require(_0xae6e('0x7'));var util=require(_0xae6e('0x8'));var path=require(_0xae6e('0x9'));var sox=require(_0xae6e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae6e('0xb'));var _=require(_0xae6e('0xc'));var squel=require(_0xae6e('0xd'));var crypto=require(_0xae6e('0xe'));var jsforce=require(_0xae6e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xae6e('0x10'));var querystring=require(_0xae6e('0x11'));var Papa=require(_0xae6e('0x12'));var Redis=require('ioredis');var authService=require(_0xae6e('0x13'));var qs=require(_0xae6e('0x14'));var as=require(_0xae6e('0x15'));var hardwareService=require(_0xae6e('0x16'));var logger=require(_0xae6e('0x17'))('api');var utils=require(_0xae6e('0x18'));var config=require(_0xae6e('0x19'));var licenseUtil=require(_0xae6e('0x1a'));var db=require(_0xae6e('0x1b'))['db'];function respondWithStatusCode(_0x519781,_0x1153aa){_0x1153aa=_0x1153aa||0xcc;return function(_0x32cdd8){if(_0x32cdd8){return _0x519781[_0xae6e('0x1c')](_0x1153aa);}return _0x519781['status'](_0x1153aa)[_0xae6e('0x1d')]();};}function respondWithResult(_0x34b703,_0xea8bca){_0xea8bca=_0xea8bca||0xc8;return function(_0xc24fdb){if(_0xc24fdb){return _0x34b703['status'](_0xea8bca)['json'](_0xc24fdb);}};}function respondWithFilteredResult(_0x188783,_0x43b96f){return function(_0x1c2823){if(_0x1c2823){var _0x1a3bb4=typeof _0x43b96f[_0xae6e('0x1e')]==='undefined'&&typeof _0x43b96f[_0xae6e('0x1f')]===_0xae6e('0x20');var _0x24d58d=_0x1c2823[_0xae6e('0x21')];var _0x34d7e1=_0x1a3bb4?0x0:_0x43b96f[_0xae6e('0x1e')];var _0x153827=_0x1a3bb4?_0x1c2823['count']:_0x43b96f['offset']+_0x43b96f[_0xae6e('0x1f')];var _0x3dddbf;if(_0x153827>=_0x24d58d){_0x153827=_0x24d58d;_0x3dddbf=0xc8;}else{_0x3dddbf=0xce;}_0x188783[_0xae6e('0x22')](_0x3dddbf);return _0x188783[_0xae6e('0x23')](_0xae6e('0x24'),_0x34d7e1+'-'+_0x153827+'/'+_0x24d58d)[_0xae6e('0x25')](_0x1c2823);}return null;};}function patchUpdates(_0x548346){return function(_0x3cace6){try{jsonpatch[_0xae6e('0x26')](_0x3cace6,_0x548346,!![]);}catch(_0x1bd9d6){return BPromise[_0xae6e('0x27')](_0x1bd9d6);}return _0x3cace6['save']();};}function saveUpdates(_0x4337a0,_0x2085e4){return function(_0x16f28e){if(_0x16f28e){return _0x16f28e[_0xae6e('0x28')](_0x4337a0)[_0xae6e('0x29')](function(_0x48b98f){return _0x48b98f;});}return null;};}function removeEntity(_0x1b7360,_0x13a959){return function(_0x230a6f){if(_0x230a6f){return _0x230a6f[_0xae6e('0x2a')]()[_0xae6e('0x29')](function(){_0x1b7360[_0xae6e('0x22')](0xcc)[_0xae6e('0x1d')]();});}};}function handleEntityNotFound(_0x50884d,_0x3a9b08){return function(_0x3b1b37){if(!_0x3b1b37){_0x50884d[_0xae6e('0x1c')](0x194);}return _0x3b1b37;};}function handleError(_0x1e82e7,_0x5e0cde){_0x5e0cde=_0x5e0cde||0x1f4;return function(_0x13d390){logger['error'](_0x13d390[_0xae6e('0x2b')]);if(_0x13d390[_0xae6e('0x2c')]){delete _0x13d390[_0xae6e('0x2c')];}_0x1e82e7[_0xae6e('0x22')](_0x5e0cde)[_0xae6e('0x2d')](_0x13d390);};}exports[_0xae6e('0x2e')]=function(_0xdc56b0,_0x1398a0){var _0x1cc02f={},_0x95f8d8={},_0x482a83={'count':0x0,'rows':[]};var _0x1b4000=_[_0xae6e('0x2f')](db[_0xae6e('0x30')][_0xae6e('0x31')],function(_0x3aec38){return{'name':_0x3aec38[_0xae6e('0x32')],'type':_0x3aec38['type'][_0xae6e('0x33')]};});_0x95f8d8[_0xae6e('0x34')]=_[_0xae6e('0x2f')](_0x1b4000,_0xae6e('0x2c'));_0x95f8d8[_0xae6e('0x35')]=_['keys'](_0xdc56b0[_0xae6e('0x35')]);_0x95f8d8[_0xae6e('0x36')]=_[_0xae6e('0x37')](_0x95f8d8[_0xae6e('0x34')],_0x95f8d8[_0xae6e('0x35')]);_0x1cc02f[_0xae6e('0x38')]=_[_0xae6e('0x37')](_0x95f8d8[_0xae6e('0x34')],qs[_0xae6e('0x39')](_0xdc56b0[_0xae6e('0x35')][_0xae6e('0x39')]));_0x1cc02f[_0xae6e('0x38')]=_0x1cc02f[_0xae6e('0x38')]['length']?_0x1cc02f[_0xae6e('0x38')]:_0x95f8d8[_0xae6e('0x34')];if(!_0xdc56b0[_0xae6e('0x35')][_0xae6e('0x3a')](_0xae6e('0x3b'))){_0x1cc02f['limit']=qs[_0xae6e('0x1f')](_0xdc56b0[_0xae6e('0x35')][_0xae6e('0x1f')]);_0x1cc02f[_0xae6e('0x1e')]=qs[_0xae6e('0x1e')](_0xdc56b0[_0xae6e('0x35')][_0xae6e('0x1e')]);}_0x1cc02f[_0xae6e('0x3c')]=qs[_0xae6e('0x3d')](_0xdc56b0['query'][_0xae6e('0x3d')]);_0x1cc02f[_0xae6e('0x3e')]=qs[_0xae6e('0x36')](_[_0xae6e('0x3f')](_0xdc56b0[_0xae6e('0x35')],_0x95f8d8[_0xae6e('0x36')]),_0x1b4000);if(_0xdc56b0[_0xae6e('0x35')][_0xae6e('0x40')]){_0x1cc02f[_0xae6e('0x3e')]=_[_0xae6e('0x41')](_0x1cc02f[_0xae6e('0x3e')],{'$or':_[_0xae6e('0x2f')](_0x1b4000,function(_0x232bde){if(_0x232bde['type']!==_0xae6e('0x42')){var _0x33e244={};_0x33e244[_0x232bde['name']]={'$like':'%'+_0xdc56b0[_0xae6e('0x35')][_0xae6e('0x40')]+'%'};return _0x33e244;}})});}_0x1cc02f=_[_0xae6e('0x41')]({},_0x1cc02f,_0xdc56b0[_0xae6e('0x43')]);var _0x1ba0d7={'where':_0x1cc02f['where']};return db[_0xae6e('0x30')]['count'](_0x1ba0d7)[_0xae6e('0x29')](function(_0x321c13){_0x482a83[_0xae6e('0x21')]=_0x321c13;if(_0xdc56b0[_0xae6e('0x35')]['includeAll']){_0x1cc02f[_0xae6e('0x44')]=[{'all':!![]}];}return db[_0xae6e('0x30')][_0xae6e('0x45')](_0x1cc02f);})['then'](function(_0x5e489f){_0x482a83[_0xae6e('0x46')]=_0x5e489f;return _0x482a83;})[_0xae6e('0x29')](respondWithFilteredResult(_0x1398a0,_0x1cc02f))['catch'](handleError(_0x1398a0,null));};exports[_0xae6e('0x47')]=function(_0x57bfe4,_0x3ee08c){var _0x3375ce={'raw':!![],'where':{'id':_0x57bfe4['params']['id']}},_0x3d4f8b={};_0x3d4f8b['model']=_[_0xae6e('0x48')](db[_0xae6e('0x30')]['rawAttributes']);_0x3d4f8b[_0xae6e('0x35')]=_[_0xae6e('0x48')](_0x57bfe4[_0xae6e('0x35')]);_0x3d4f8b[_0xae6e('0x36')]=_['intersection'](_0x3d4f8b[_0xae6e('0x34')],_0x3d4f8b[_0xae6e('0x35')]);_0x3375ce['attributes']=_[_0xae6e('0x37')](_0x3d4f8b['model'],qs[_0xae6e('0x39')](_0x57bfe4[_0xae6e('0x35')]['fields']));_0x3375ce['attributes']=_0x3375ce[_0xae6e('0x38')]['length']?_0x3375ce[_0xae6e('0x38')]:_0x3d4f8b[_0xae6e('0x34')];if(_0x57bfe4[_0xae6e('0x35')][_0xae6e('0x49')]){_0x3375ce[_0xae6e('0x44')]=[{'all':!![]}];}_0x3375ce=_[_0xae6e('0x41')]({},_0x3375ce,_0x57bfe4[_0xae6e('0x43')]);return db[_0xae6e('0x30')][_0xae6e('0x4a')](_0x3375ce)[_0xae6e('0x29')](handleEntityNotFound(_0x3ee08c,null))[_0xae6e('0x29')](respondWithResult(_0x3ee08c,null))[_0xae6e('0x4b')](handleError(_0x3ee08c,null));};exports[_0xae6e('0x4c')]=function(_0x4dff7d,_0xa88263){return db['MailTransferReport'][_0xae6e('0x4c')](_0x4dff7d[_0xae6e('0x4d')],{})[_0xae6e('0x29')](respondWithResult(_0xa88263,0xc9))['catch'](handleError(_0xa88263,null));};exports[_0xae6e('0x28')]=function(_0x604ad0,_0xf330b){if(_0x604ad0['body']['id']){delete _0x604ad0[_0xae6e('0x4d')]['id'];}return db[_0xae6e('0x30')][_0xae6e('0x4a')]({'where':{'id':_0x604ad0[_0xae6e('0x4e')]['id']}})[_0xae6e('0x29')](handleEntityNotFound(_0xf330b,null))['then'](saveUpdates(_0x604ad0[_0xae6e('0x4d')],null))[_0xae6e('0x29')](respondWithResult(_0xf330b,null))['catch'](handleError(_0xf330b,null));};exports['destroy']=function(_0x108123,_0x4c937c){return db[_0xae6e('0x30')][_0xae6e('0x4a')]({'where':{'id':_0x108123[_0xae6e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c937c,null))[_0xae6e('0x29')](removeEntity(_0x4c937c,null))[_0xae6e('0x4b')](handleError(_0x4c937c,null));};exports[_0xae6e('0x4f')]=function(_0xea499c,_0xabfad){return db['MailTransferReport'][_0xae6e('0x4f')]()[_0xae6e('0x29')](respondWithResult(_0xabfad,null))[_0xae6e('0x4b')](handleError(_0xabfad,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f9f50cd..beb7886 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 _0xa24e=['define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports'];(function(_0x30207d,_0x9a4466){var _0x282210=function(_0x3f0b7b){while(--_0x3f0b7b){_0x30207d['push'](_0x30207d['shift']());}};_0x282210(++_0x9a4466);}(_0xa24e,0x137));var _0xea24=function(_0x205ed2,_0x248ed0){_0x205ed2=_0x205ed2-0x0;var _0x540c3b=_0xa24e[_0x205ed2];return _0x540c3b;};'use strict';var _=require(_0xea24('0x0'));var util=require(_0xea24('0x1'));var logger=require(_0xea24('0x2'))(_0xea24('0x3'));var moment=require(_0xea24('0x4'));var BPromise=require(_0xea24('0x5'));var rp=require(_0xea24('0x6'));var fs=require('fs');var path=require(_0xea24('0x7'));var rimraf=require(_0xea24('0x8'));var config=require('../../config/environment');var attributes=require(_0xea24('0x9'));module[_0xea24('0xa')]=function(_0x36b376,_0x2534a6){return _0x36b376[_0xea24('0xb')]('MailTransferReport',attributes,{'tableName':_0xea24('0xc'),'paranoid':![],'indexes':[{'name':_0xea24('0xd'),'fields':[_0xea24('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfafb=['exports','define','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbfaf('0x0'));var util=require('util');var logger=require(_0xbfaf('0x1'))(_0xbfaf('0x2'));var moment=require(_0xbfaf('0x3'));var BPromise=require(_0xbfaf('0x4'));var rp=require(_0xbfaf('0x5'));var fs=require('fs');var path=require(_0xbfaf('0x6'));var rimraf=require(_0xbfaf('0x7'));var config=require(_0xbfaf('0x8'));var attributes=require(_0xbfaf('0x9'));module[_0xbfaf('0xa')]=function(_0x2a1938,_0x48b48c){return _0x2a1938[_0xbfaf('0xb')]('MailTransferReport',attributes,{'tableName':_0xbfaf('0xc'),'paranoid':![],'indexes':[{'name':_0xbfaf('0xd'),'fields':[_0xbfaf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8cea60b..b161b73 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 _0x74c0=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb'];(function(_0x5bf629,_0x3b0336){var _0x3880af=function(_0x2a287a){while(--_0x2a287a){_0x5bf629['push'](_0x5bf629['shift']());}};_0x3880af(++_0x3b0336);}(_0x74c0,0xcb));var _0x074c=function(_0x5e4e74,_0x53b7a5){_0x5e4e74=_0x5e4e74-0x0;var _0x217a4a=_0x74c0[_0x5e4e74];return _0x217a4a;};'use strict';var _=require('lodash');var util=require(_0x074c('0x0'));var moment=require(_0x074c('0x1'));var BPromise=require('bluebird');var rs=require(_0x074c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x074c('0x3'))['db'];var utils=require(_0x074c('0x4'));var logger=require(_0x074c('0x5'))(_0x074c('0x6'));var config=require(_0x074c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x074c('0x8')][_0x074c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f1fb7,_0x4c54e7,_0x25b264){return new BPromise(function(_0x5d7f72,_0xe414b9){return client[_0x074c('0xa')](_0x4f1fb7,_0x25b264)[_0x074c('0xb')](function(_0x56c926){logger[_0x074c('0xc')](_0x074c('0xd'),_0x4c54e7,_0x074c('0xe'));logger[_0x074c('0xf')](_0x074c('0x10'),_0x4c54e7,_0x074c('0xe'),JSON[_0x074c('0x11')](_0x56c926));if(_0x56c926[_0x074c('0x12')]){if(_0x56c926['error'][_0x074c('0x13')]===0x1f4){logger[_0x074c('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4c54e7,_0x56c926[_0x074c('0x12')][_0x074c('0x14')]);return _0xe414b9(_0x56c926[_0x074c('0x12')][_0x074c('0x14')]);}logger[_0x074c('0x12')](_0x074c('0xd'),_0x4c54e7,_0x56c926[_0x074c('0x12')][_0x074c('0x14')]);return _0x5d7f72(_0x56c926['error']['message']);}else{logger[_0x074c('0xc')](_0x074c('0xd'),_0x4c54e7,'request\x20sent');_0x5d7f72(_0x56c926[_0x074c('0x15')][_0x074c('0x14')]);}})[_0x074c('0x16')](function(_0x38e486){logger[_0x074c('0x12')](_0x074c('0xd'),_0x4c54e7,_0x38e486);_0xe414b9(_0x38e486);});});} \ No newline at end of file +var _0x70cf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','moment','bluebird','randomstring','ioredis'];(function(_0x5c31f6,_0x212612){var _0x3655a4=function(_0x1c0879){while(--_0x1c0879){_0x5c31f6['push'](_0x5c31f6['shift']());}};_0x3655a4(++_0x212612);}(_0x70cf,0x1ca));var _0xf70c=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x70cf[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf70c('0x0'));var BPromise=require(_0xf70c('0x1'));var rs=require(_0xf70c('0x2'));var fs=require('fs');var Redis=require(_0xf70c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf70c('0x4'));var logger=require(_0xf70c('0x5'))(_0xf70c('0x6'));var config=require(_0xf70c('0x7'));var jayson=require(_0xf70c('0x8'));var client=jayson[_0xf70c('0x9')][_0xf70c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfd01c4,_0x534e76,_0x3ab191){return new BPromise(function(_0x54a3c4,_0x13e01f){return client[_0xf70c('0xb')](_0xfd01c4,_0x3ab191)[_0xf70c('0xc')](function(_0x10b29d){logger['info'](_0xf70c('0xd'),_0x534e76,_0xf70c('0xe'));logger[_0xf70c('0xf')](_0xf70c('0x10'),_0x534e76,_0xf70c('0xe'),JSON[_0xf70c('0x11')](_0x10b29d));if(_0x10b29d[_0xf70c('0x12')]){if(_0x10b29d[_0xf70c('0x12')][_0xf70c('0x13')]===0x1f4){logger[_0xf70c('0x12')](_0xf70c('0xd'),_0x534e76,_0x10b29d[_0xf70c('0x12')]['message']);return _0x13e01f(_0x10b29d[_0xf70c('0x12')][_0xf70c('0x14')]);}logger[_0xf70c('0x12')](_0xf70c('0xd'),_0x534e76,_0x10b29d[_0xf70c('0x12')][_0xf70c('0x14')]);return _0x54a3c4(_0x10b29d[_0xf70c('0x12')][_0xf70c('0x14')]);}else{logger[_0xf70c('0x15')](_0xf70c('0xd'),_0x534e76,_0xf70c('0xe'));_0x54a3c4(_0x10b29d['result']['message']);}})['catch'](function(_0x141bde){logger[_0xf70c('0x12')](_0xf70c('0xd'),_0x534e76,_0x141bde);_0x13e01f(_0x141bde);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f270fd4..41bf16f 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 _0x6be3=['show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x21b2dd,_0x5118fc){var _0x2b40fa=function(_0x2a7f73){while(--_0x2a7f73){_0x21b2dd['push'](_0x21b2dd['shift']());}};_0x2b40fa(++_0x5118fc);}(_0x6be3,0x1e7));var _0x36be=function(_0x4e18bb,_0x2b28df){_0x4e18bb=_0x4e18bb-0x0;var _0x5ebf1f=_0x6be3[_0x4e18bb];return _0x5ebf1f;};'use strict';var multer=require(_0x36be('0x0'));var util=require(_0x36be('0x1'));var path=require('path');var timeout=require(_0x36be('0x2'));var express=require(_0x36be('0x3'));var router=express[_0x36be('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x36be('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x36be('0x6'));router[_0x36be('0x7')]('/',auth[_0x36be('0x8')](),controller[_0x36be('0x9')]);router['get'](_0x36be('0xa'),auth[_0x36be('0x8')](),controller[_0x36be('0xb')]);router[_0x36be('0x7')](_0x36be('0xc'),auth[_0x36be('0x8')](),controller[_0x36be('0xd')]);router[_0x36be('0xe')]('/',auth[_0x36be('0x8')](),controller[_0x36be('0xf')]);router[_0x36be('0x10')]('/:id',auth[_0x36be('0x8')](),controller[_0x36be('0x11')]);router[_0x36be('0x12')](_0x36be('0xc'),auth[_0x36be('0x8')](),controller['destroy']);module[_0x36be('0x13')]=router; \ No newline at end of file +var _0xbfcd=['./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','create','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3c9f7b,_0x1382ac){var _0x2ee471=function(_0x309205){while(--_0x309205){_0x3c9f7b['push'](_0x3c9f7b['shift']());}};_0x2ee471(++_0x1382ac);}(_0xbfcd,0xd7));var _0xdbfc=function(_0x3bc5c2,_0x114f89){_0x3bc5c2=_0x3bc5c2-0x0;var _0x4458ee=_0xbfcd[_0x3bc5c2];return _0x4458ee;};'use strict';var multer=require('multer');var util=require(_0xdbfc('0x0'));var path=require(_0xdbfc('0x1'));var timeout=require(_0xdbfc('0x2'));var express=require(_0xdbfc('0x3'));var router=express['Router']();var fs_extra=require(_0xdbfc('0x4'));var auth=require(_0xdbfc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdbfc('0x6'));router[_0xdbfc('0x7')]('/',auth['isAuthenticated'](),controller[_0xdbfc('0x8')]);router[_0xdbfc('0x7')](_0xdbfc('0x9'),auth[_0xdbfc('0xa')](),controller[_0xdbfc('0xb')]);router[_0xdbfc('0x7')](_0xdbfc('0xc'),auth[_0xdbfc('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdbfc('0xd')]);router[_0xdbfc('0xe')](_0xdbfc('0xc'),auth[_0xdbfc('0xa')](),controller['update']);router[_0xdbfc('0xf')](_0xdbfc('0xc'),auth[_0xdbfc('0xa')](),controller['destroy']);module[_0xdbfc('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 8535989..6965bb6 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 _0xdbb2=['sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','talk:[queue]','INTEGER'];(function(_0x422158,_0x4df38c){var _0x5ef9f9=function(_0x55dda0){while(--_0x55dda0){_0x422158['push'](_0x422158['shift']());}};_0x5ef9f9(++_0x4df38c);}(_0xdbb2,0x1c0));var _0x2dbb=function(_0x4f39fd,_0x36d85f){_0x4f39fd=_0x4f39fd-0x0;var _0x4ef809=_0xdbb2[_0x4f39fd];return _0x4ef809;};'use strict';var Sequelize=require(_0x2dbb('0x0'));var moment=require(_0x2dbb('0x1'));module[_0x2dbb('0x2')]={'channel':{'type':Sequelize[_0x2dbb('0x3')]},'membername':{'type':Sequelize[_0x2dbb('0x3')]},'interface':{'type':Sequelize[_0x2dbb('0x3')]},'type':{'type':Sequelize[_0x2dbb('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2dbb('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x2dbb('0x5')]},'exitAt':{'type':Sequelize[_0x2dbb('0x5')],'set':function(_0x1a5825){var _0x1df8dd=moment(_0x1a5825);var _0x19e106=moment(this['getDataValue'](_0x2dbb('0x6')));var _0x193197=_0x1df8dd[_0x2dbb('0x7')](_0x19e106,_0x2dbb('0x8'));this[_0x2dbb('0x9')](_0x2dbb('0xa'),_0x1a5825);this['setDataValue'](_0x2dbb('0xb'),_0x193197>=0x0?_0x193197:null);}},'data1':{'type':Sequelize[_0x2dbb('0x3')],'comment':_0x2dbb('0xc')},'data2':{'type':Sequelize[_0x2dbb('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2dbb('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2dbb('0x3')],'comment':_0x2dbb('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x2dbb('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x2dbb('0xf')]},'uniqueid':{'type':Sequelize[_0x2dbb('0x3')]}}; \ No newline at end of file +var _0x0347=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','seconds'];(function(_0x340756,_0xad31ae){var _0x2ef745=function(_0x59ffde){while(--_0x59ffde){_0x340756['push'](_0x340756['shift']());}};_0x2ef745(++_0xad31ae);}(_0x0347,0x15f));var _0x7034=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0347[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7034('0x0'));var moment=require(_0x7034('0x1'));module[_0x7034('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7034('0x3')]},'interface':{'type':Sequelize[_0x7034('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x7034('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x7034('0x5')]},'exitAt':{'type':Sequelize[_0x7034('0x5')],'set':function(_0x1e704a){var _0x3ce3bf=moment(_0x1e704a);var _0x110761=moment(this[_0x7034('0x6')](_0x7034('0x7')));var _0x5810ab=_0x3ce3bf['diff'](_0x110761,_0x7034('0x8'));this[_0x7034('0x9')](_0x7034('0xa'),_0x1e704a);this[_0x7034('0x9')](_0x7034('0xb'),_0x5810ab>=0x0?_0x5810ab:null);}},'data1':{'type':Sequelize[_0x7034('0x3')],'comment':_0x7034('0xc')},'data2':{'type':Sequelize[_0x7034('0x3')],'comment':_0x7034('0xd')},'data3':{'type':Sequelize[_0x7034('0x3')],'comment':_0x7034('0xe')},'data4':{'type':Sequelize[_0x7034('0x3')],'comment':_0x7034('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x7034('0x10')},'role':{'type':Sequelize[_0x7034('0x3')]},'internal':{'type':Sequelize[_0x7034('0x11')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c8c5dcf..99336ba 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0xb87f20,_0x4ae8f5){var _0x5e02bb=function(_0x2611ec){while(--_0x2611ec){_0xb87f20['push'](_0xb87f20['shift']());}};_0x5e02bb(++_0x4ae8f5);}(_0x008c,0x188));var _0xc008=function(_0x2c93a2,_0x1c1e3b){_0x2c93a2=_0x2c93a2-0x0;var _0x5bde6c=_0x008c[_0x2c93a2];return _0x5bde6c;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedd9,0xfc));var _0x9edd=function(_0x4372f9,_0x1c8338){_0x4372f9=_0x4372f9-0x0;var _0x2e57b8=_0xedd9[_0x4372f9];return _0x2e57b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 5a96a9c..3edc5eb 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 _0xf935=['../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1de125,_0x4fe551){var _0x44db47=function(_0xe70d0d){while(--_0xe70d0d){_0x1de125['push'](_0x1de125['shift']());}};_0x44db47(++_0x4fe551);}(_0xf935,0xbc));var _0x5f93=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf935[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5f93('0x0'));var util=require(_0x5f93('0x1'));var logger=require(_0x5f93('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5f93('0x3'));var rp=require(_0x5f93('0x4'));var fs=require('fs');var path=require(_0x5f93('0x5'));var rimraf=require(_0x5f93('0x6'));var config=require(_0x5f93('0x7'));var attributes=require(_0x5f93('0x8'));module[_0x5f93('0x9')]=function(_0x43e179,_0x307412){return _0x43e179['define'](_0x5f93('0xa'),attributes,{'tableName':_0x5f93('0xb'),'paranoid':![],'indexes':[{'name':_0x5f93('0xc'),'fields':[_0x5f93('0xd'),_0x5f93('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9cc=['request-promise','path','rimraf','exports','define','interface','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2c2519,_0x42bc88){var _0x24f10f=function(_0x6adc4d){while(--_0x6adc4d){_0x2c2519['push'](_0x2c2519['shift']());}};_0x24f10f(++_0x42bc88);}(_0xd9cc,0xed));var _0xcd9c=function(_0x400fe3,_0x352107){_0x400fe3=_0x400fe3-0x0;var _0x574ed3=_0xd9cc[_0x400fe3];return _0x574ed3;};'use strict';var _=require(_0xcd9c('0x0'));var util=require(_0xcd9c('0x1'));var logger=require(_0xcd9c('0x2'))('api');var moment=require(_0xcd9c('0x3'));var BPromise=require(_0xcd9c('0x4'));var rp=require(_0xcd9c('0x5'));var fs=require('fs');var path=require(_0xcd9c('0x6'));var rimraf=require(_0xcd9c('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0xcd9c('0x8')]=function(_0x38410b,_0x14eaa9){return _0x38410b[_0xcd9c('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xcd9c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 1c22a0f..2624e8d 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 _0x0eb2=['result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4fcbec,_0x90e467){var _0x275177=function(_0x1f706b){while(--_0x1f706b){_0x4fcbec['push'](_0x4fcbec['shift']());}};_0x275177(++_0x90e467);}(_0x0eb2,0x11c));var _0x20eb=function(_0x5cb326,_0x51c573){_0x5cb326=_0x5cb326-0x0;var _0x509f3d=_0x0eb2[_0x5cb326];return _0x509f3d;};'use strict';var _=require(_0x20eb('0x0'));var util=require('util');var moment=require(_0x20eb('0x1'));var BPromise=require(_0x20eb('0x2'));var rs=require(_0x20eb('0x3'));var fs=require('fs');var Redis=require(_0x20eb('0x4'));var db=require(_0x20eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20eb('0x7')][_0x20eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19940,_0x4a7e1a,_0x3dfc09){return new BPromise(function(_0x2093eb,_0x4443ea){return client[_0x20eb('0x9')](_0x19940,_0x3dfc09)[_0x20eb('0xa')](function(_0x20a0e0){logger[_0x20eb('0xb')](_0x20eb('0xc'),_0x4a7e1a,_0x20eb('0xd'));logger[_0x20eb('0xe')](_0x20eb('0xf'),_0x4a7e1a,_0x20eb('0xd'),JSON[_0x20eb('0x10')](_0x20a0e0));if(_0x20a0e0[_0x20eb('0x11')]){if(_0x20a0e0['error'][_0x20eb('0x12')]===0x1f4){logger['error'](_0x20eb('0xc'),_0x4a7e1a,_0x20a0e0['error'][_0x20eb('0x13')]);return _0x4443ea(_0x20a0e0[_0x20eb('0x11')][_0x20eb('0x13')]);}logger[_0x20eb('0x11')](_0x20eb('0xc'),_0x4a7e1a,_0x20a0e0[_0x20eb('0x11')][_0x20eb('0x13')]);return _0x2093eb(_0x20a0e0[_0x20eb('0x11')][_0x20eb('0x13')]);}else{logger[_0x20eb('0xb')](_0x20eb('0xc'),_0x4a7e1a,_0x20eb('0xd'));_0x2093eb(_0x20a0e0[_0x20eb('0x14')][_0x20eb('0x13')]);}})[_0x20eb('0x15')](function(_0x5a6d1d){logger[_0x20eb('0x11')]('MemberReport,\x20%s,\x20%s',_0x4a7e1a,_0x5a6d1d);_0x4443ea(_0x5a6d1d);});});}exports[_0x20eb('0x16')]=function(_0x21765e){var _0x28ae67=this;return new Promise(function(_0x3c083a,_0x4144c1){return db[_0x20eb('0x17')][_0x20eb('0x18')]({'raw':_0x21765e['options']?_0x21765e[_0x20eb('0x19')][_0x20eb('0x1a')]===undefined?!![]:![]:!![],'where':_0x21765e['options']?_0x21765e[_0x20eb('0x19')][_0x20eb('0x1b')]||null:null,'attributes':_0x21765e['options']?_0x21765e[_0x20eb('0x19')][_0x20eb('0x1c')]||null:null,'limit':_0x21765e[_0x20eb('0x19')]?_0x21765e['options'][_0x20eb('0x1d')]||null:null,'include':_0x21765e[_0x20eb('0x19')]?_0x21765e[_0x20eb('0x19')]['include']?_[_0x20eb('0x1e')](_0x21765e[_0x20eb('0x19')][_0x20eb('0x1f')],function(_0x5dc978){return{'model':db[_0x5dc978[_0x20eb('0x20')]],'as':_0x5dc978['as'],'attributes':_0x5dc978['attributes'],'include':_0x5dc978[_0x20eb('0x1f')]?_[_0x20eb('0x1e')](_0x5dc978[_0x20eb('0x1f')],function(_0x3b88b3){return{'model':db[_0x3b88b3[_0x20eb('0x20')]],'as':_0x3b88b3['as'],'attributes':_0x3b88b3[_0x20eb('0x1c')],'include':_0x3b88b3[_0x20eb('0x1f')]?_[_0x20eb('0x1e')](_0x3b88b3[_0x20eb('0x1f')],function(_0x58b8c3){return{'model':db[_0x58b8c3[_0x20eb('0x20')]],'as':_0x58b8c3['as'],'attributes':_0x58b8c3[_0x20eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x20eb('0xa')](function(_0x5117c7){logger['info']('GetMemberReport',_0x21765e);logger['debug'](_0x20eb('0x16'),_0x21765e,JSON[_0x20eb('0x10')](_0x5117c7));_0x3c083a(_0x5117c7);})['catch'](function(_0x155752){logger['error'](_0x20eb('0x16'),_0x155752['message'],_0x21765e);_0x4144c1(_0x28ae67['error'](0x1f4,_0x155752[_0x20eb('0x13')]));});});};exports[_0x20eb('0x21')]=function(_0x4fb803){var _0x5abe40=this;return new Promise(function(_0xfa014d,_0x3ae2b0){return db['MemberReport'][_0x20eb('0x22')](_0x4fb803[_0x20eb('0x23')],{'raw':_0x4fb803['options']?_0x4fb803[_0x20eb('0x19')][_0x20eb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xfd5c6b){logger['info'](_0x20eb('0x21'),_0x4fb803);logger[_0x20eb('0xe')](_0x20eb('0x21'),_0x4fb803,JSON['stringify'](_0xfd5c6b));_0xfa014d(_0xfd5c6b);})[_0x20eb('0x15')](function(_0x6d6920){logger[_0x20eb('0x11')](_0x20eb('0x21'),_0x6d6920['message'],_0x4fb803);_0x3ae2b0(_0x5abe40[_0x20eb('0x11')](0x1f4,_0x6d6920[_0x20eb('0x13')]));});});};exports[_0x20eb('0x24')]=function(_0x4546e8){var _0x20473b=this;return new Promise(function(_0x10cd8f,_0x62c876){return db[_0x20eb('0x17')][_0x20eb('0x25')](_0x4546e8[_0x20eb('0x23')],{'raw':_0x4546e8[_0x20eb('0x19')]?_0x4546e8['options'][_0x20eb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4546e8[_0x20eb('0x19')]?_0x4546e8[_0x20eb('0x19')][_0x20eb('0x1b')]||null:null,'attributes':_0x4546e8['options']?_0x4546e8[_0x20eb('0x19')][_0x20eb('0x1c')]||null:null,'limit':_0x4546e8[_0x20eb('0x19')]?_0x4546e8['options'][_0x20eb('0x1d')]||null:null})[_0x20eb('0xa')](function(_0x185c0c){logger[_0x20eb('0xb')](_0x20eb('0x24'),_0x4546e8);logger[_0x20eb('0xe')](_0x20eb('0x24'),_0x4546e8,JSON[_0x20eb('0x10')](_0x185c0c));_0x10cd8f(_0x185c0c);})[_0x20eb('0x15')](function(_0x193c9c){logger['error'](_0x20eb('0x24'),_0x193c9c['message'],_0x4546e8);_0x62c876(_0x20473b[_0x20eb('0x11')](0x1f4,_0x193c9c[_0x20eb('0x13')]));});});}; \ No newline at end of file +var _0x13f5=['lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','then','CreateMemberReport','create','body','UpdateMemberReport','update'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x13f5,0xc3));var _0x513f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x13f5[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var moment=require(_0x513f('0x2'));var BPromise=require(_0x513f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x513f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x513f('0x5'))(_0x513f('0x6'));var config=require(_0x513f('0x7'));var jayson=require(_0x513f('0x8'));var client=jayson[_0x513f('0x9')][_0x513f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2be368,_0x6e5b15,_0x2c75a3){return new BPromise(function(_0x42951f,_0x1975b5){return client[_0x513f('0xb')](_0x2be368,_0x2c75a3)['then'](function(_0x39c6df){logger[_0x513f('0xc')](_0x513f('0xd'),_0x6e5b15,_0x513f('0xe'));logger[_0x513f('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x6e5b15,_0x513f('0xe'),JSON[_0x513f('0x10')](_0x39c6df));if(_0x39c6df['error']){if(_0x39c6df[_0x513f('0x11')][_0x513f('0x12')]===0x1f4){logger[_0x513f('0x11')](_0x513f('0xd'),_0x6e5b15,_0x39c6df[_0x513f('0x11')][_0x513f('0x13')]);return _0x1975b5(_0x39c6df[_0x513f('0x11')][_0x513f('0x13')]);}logger[_0x513f('0x11')](_0x513f('0xd'),_0x6e5b15,_0x39c6df[_0x513f('0x11')][_0x513f('0x13')]);return _0x42951f(_0x39c6df[_0x513f('0x11')][_0x513f('0x13')]);}else{logger['info'](_0x513f('0xd'),_0x6e5b15,'request\x20sent');_0x42951f(_0x39c6df[_0x513f('0x14')][_0x513f('0x13')]);}})[_0x513f('0x15')](function(_0x3ea7b8){logger[_0x513f('0x11')]('MemberReport,\x20%s,\x20%s',_0x6e5b15,_0x3ea7b8);_0x1975b5(_0x3ea7b8);});});}exports[_0x513f('0x16')]=function(_0x73ac7d){var _0x54801f=this;return new Promise(function(_0x186121,_0x57904a){return db[_0x513f('0x17')][_0x513f('0x18')]({'raw':_0x73ac7d['options']?_0x73ac7d[_0x513f('0x19')][_0x513f('0x1a')]===undefined?!![]:![]:!![],'where':_0x73ac7d[_0x513f('0x19')]?_0x73ac7d[_0x513f('0x19')][_0x513f('0x1b')]||null:null,'attributes':_0x73ac7d[_0x513f('0x19')]?_0x73ac7d['options'][_0x513f('0x1c')]||null:null,'limit':_0x73ac7d[_0x513f('0x19')]?_0x73ac7d['options'][_0x513f('0x1d')]||null:null,'include':_0x73ac7d[_0x513f('0x19')]?_0x73ac7d[_0x513f('0x19')][_0x513f('0x1e')]?_[_0x513f('0x1f')](_0x73ac7d[_0x513f('0x19')]['include'],function(_0x560835){return{'model':db[_0x560835['model']],'as':_0x560835['as'],'attributes':_0x560835[_0x513f('0x1c')],'include':_0x560835[_0x513f('0x1e')]?_[_0x513f('0x1f')](_0x560835[_0x513f('0x1e')],function(_0x2191d4){return{'model':db[_0x2191d4[_0x513f('0x20')]],'as':_0x2191d4['as'],'attributes':_0x2191d4[_0x513f('0x1c')],'include':_0x2191d4[_0x513f('0x1e')]?_[_0x513f('0x1f')](_0x2191d4['include'],function(_0x509e63){return{'model':db[_0x509e63[_0x513f('0x20')]],'as':_0x509e63['as'],'attributes':_0x509e63[_0x513f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x513f('0x21')](function(_0x58c939){logger[_0x513f('0xc')](_0x513f('0x16'),_0x73ac7d);logger['debug'](_0x513f('0x16'),_0x73ac7d,JSON['stringify'](_0x58c939));_0x186121(_0x58c939);})['catch'](function(_0x24dc28){logger[_0x513f('0x11')](_0x513f('0x16'),_0x24dc28[_0x513f('0x13')],_0x73ac7d);_0x57904a(_0x54801f['error'](0x1f4,_0x24dc28[_0x513f('0x13')]));});});};exports[_0x513f('0x22')]=function(_0xd8023d){var _0x201cee=this;return new Promise(function(_0x495a01,_0x3a5bde){return db[_0x513f('0x17')][_0x513f('0x23')](_0xd8023d[_0x513f('0x24')],{'raw':_0xd8023d[_0x513f('0x19')]?_0xd8023d[_0x513f('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2f4b30){logger[_0x513f('0xc')]('CreateMemberReport',_0xd8023d);logger['debug'](_0x513f('0x22'),_0xd8023d,JSON[_0x513f('0x10')](_0x2f4b30));_0x495a01(_0x2f4b30);})[_0x513f('0x15')](function(_0x4c03d5){logger[_0x513f('0x11')](_0x513f('0x22'),_0x4c03d5['message'],_0xd8023d);_0x3a5bde(_0x201cee[_0x513f('0x11')](0x1f4,_0x4c03d5[_0x513f('0x13')]));});});};exports[_0x513f('0x25')]=function(_0x37aa71){var _0x3deb46=this;return new Promise(function(_0x20661b,_0x25f9aa){return db[_0x513f('0x17')][_0x513f('0x26')](_0x37aa71['body'],{'raw':_0x37aa71[_0x513f('0x19')]?_0x37aa71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37aa71[_0x513f('0x19')]?_0x37aa71['options'][_0x513f('0x1b')]||null:null,'attributes':_0x37aa71[_0x513f('0x19')]?_0x37aa71['options'][_0x513f('0x1c')]||null:null,'limit':_0x37aa71['options']?_0x37aa71['options'][_0x513f('0x1d')]||null:null})[_0x513f('0x21')](function(_0x223e2d){logger[_0x513f('0xc')](_0x513f('0x25'),_0x37aa71);logger['debug'](_0x513f('0x25'),_0x37aa71,JSON[_0x513f('0x10')](_0x223e2d));_0x20661b(_0x223e2d);})['catch'](function(_0x7b5096){logger[_0x513f('0x11')](_0x513f('0x25'),_0x7b5096[_0x513f('0x13')],_0x37aa71);_0x25f9aa(_0x3deb46[_0x513f('0x11')](0x1f4,_0x7b5096['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2b7a9e2..881a431 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 _0x0aae=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','multer','util','path','connect-timeout'];(function(_0x3b934f,_0x59dc45){var _0x136c82=function(_0x321a23){while(--_0x321a23){_0x3b934f['push'](_0x3b934f['shift']());}};_0x136c82(++_0x59dc45);}(_0x0aae,0xe0));var _0xe0aa=function(_0x27af35,_0x141c51){_0x27af35=_0x27af35-0x0;var _0x31c1ed=_0x0aae[_0x27af35];return _0x31c1ed;};'use strict';var multer=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var path=require(_0xe0aa('0x2'));var timeout=require(_0xe0aa('0x3'));var express=require(_0xe0aa('0x4'));var router=express[_0xe0aa('0x5')]();var fs_extra=require(_0xe0aa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var controller=require(_0xe0aa('0x9'));router['get']('/',controller[_0xe0aa('0xa')]);module[_0xe0aa('0xb')]=router; \ No newline at end of file +var _0x363b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','multer','util','path','connect-timeout'];(function(_0x525798,_0x77a707){var _0x57da9a=function(_0x20837b){while(--_0x20837b){_0x525798['push'](_0x525798['shift']());}};_0x57da9a(++_0x77a707);}(_0x363b,0x17c));var _0xb363=function(_0x2adac5,_0x38fea6){_0x2adac5=_0x2adac5-0x0;var _0x1661ab=_0x363b[_0x2adac5];return _0x1661ab;};'use strict';var multer=require(_0xb363('0x0'));var util=require(_0xb363('0x1'));var path=require(_0xb363('0x2'));var timeout=require(_0xb363('0x3'));var express=require(_0xb363('0x4'));var router=express[_0xb363('0x5')]();var fs_extra=require(_0xb363('0x6'));var auth=require(_0xb363('0x7'));var interaction=require(_0xb363('0x8'));var config=require(_0xb363('0x9'));var controller=require('./migration.controller');router[_0xb363('0xa')]('/',controller[_0xb363('0xb')]);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 b004b75..490f58c 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 _0x555c=['exports','STRING'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x555c,0x166));var _0xc555=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x555c[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require('sequelize');module[_0xc555('0x0')]={'version':{'type':Sequelize[_0xc555('0x1')],'unique':'version'}}; \ No newline at end of file +var _0x47f4=['STRING','version','sequelize','exports'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x47f4,0x8a));var _0x447f=function(_0x42d16a,_0x2339c8){_0x42d16a=_0x42d16a-0x0;var _0x4d6817=_0x47f4[_0x42d16a];return _0x4d6817;};'use strict';var Sequelize=require(_0x447f('0x0'));module[_0x447f('0x1')]={'version':{'type':Sequelize[_0x447f('0x2')],'unique':_0x447f('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index a9ac7f9..4d7c049 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 _0x57da=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Migration','type'];(function(_0x1bcd6f,_0x22aaf8){var _0x502397=function(_0x3e2cd0){while(--_0x3e2cd0){_0x1bcd6f['push'](_0x1bcd6f['shift']());}};_0x502397(++_0x22aaf8);}(_0x57da,0xdf));var _0xa57d=function(_0x552fd0,_0x2c2619){_0x552fd0=_0x552fd0-0x0;var _0x17b668=_0x57da[_0x552fd0];return _0x17b668;};'use strict';var emlformat=require(_0xa57d('0x0'));var rimraf=require(_0xa57d('0x1'));var zipdir=require(_0xa57d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57d('0x3'));var moment=require('moment');var BPromise=require(_0xa57d('0x4'));var Mustache=require(_0xa57d('0x5'));var util=require(_0xa57d('0x6'));var path=require(_0xa57d('0x7'));var sox=require('sox');var csv=require(_0xa57d('0x8'));var ejs=require(_0xa57d('0x9'));var fs=require('fs');var fs_extra=require(_0xa57d('0xa'));var _=require(_0xa57d('0xb'));var squel=require(_0xa57d('0xc'));var crypto=require(_0xa57d('0xd'));var jsforce=require(_0xa57d('0xe'));var deskjs=require(_0xa57d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa57d('0x10'));var Redis=require('ioredis');var authService=require(_0xa57d('0x11'));var qs=require(_0xa57d('0x12'));var as=require(_0xa57d('0x13'));var hardwareService=require(_0xa57d('0x14'));var logger=require(_0xa57d('0x15'))(_0xa57d('0x16'));var utils=require(_0xa57d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa57d('0x18'));var db=require(_0xa57d('0x19'))['db'];function respondWithStatusCode(_0x376f65,_0x93507a){_0x93507a=_0x93507a||0xcc;return function(_0x3d3d46){if(_0x3d3d46){return _0x376f65[_0xa57d('0x1a')](_0x93507a);}return _0x376f65[_0xa57d('0x1b')](_0x93507a)[_0xa57d('0x1c')]();};}function respondWithResult(_0x38ee59,_0x2f43e4){_0x2f43e4=_0x2f43e4||0xc8;return function(_0x3ef205){if(_0x3ef205){return _0x38ee59['status'](_0x2f43e4)[_0xa57d('0x1d')](_0x3ef205);}};}function respondWithFilteredResult(_0x1cc452,_0x4b088a){return function(_0xb914e3){if(_0xb914e3){var _0x3cc8aa=typeof _0x4b088a[_0xa57d('0x1e')]===_0xa57d('0x1f')&&typeof _0x4b088a[_0xa57d('0x20')]===_0xa57d('0x1f');var _0x407219=_0xb914e3['count'];var _0x21f18a=_0x3cc8aa?0x0:_0x4b088a[_0xa57d('0x1e')];var _0x20b4af=_0x3cc8aa?_0xb914e3[_0xa57d('0x21')]:_0x4b088a[_0xa57d('0x1e')]+_0x4b088a[_0xa57d('0x20')];var _0x20b6d5;if(_0x20b4af>=_0x407219){_0x20b4af=_0x407219;_0x20b6d5=0xc8;}else{_0x20b6d5=0xce;}_0x1cc452[_0xa57d('0x1b')](_0x20b6d5);return _0x1cc452[_0xa57d('0x22')](_0xa57d('0x23'),_0x21f18a+'-'+_0x20b4af+'/'+_0x407219)[_0xa57d('0x1d')](_0xb914e3);}return null;};}function patchUpdates(_0x2662dd){return function(_0x403edf){try{jsonpatch[_0xa57d('0x24')](_0x403edf,_0x2662dd,!![]);}catch(_0x2b6854){return BPromise['reject'](_0x2b6854);}return _0x403edf[_0xa57d('0x25')]();};}function saveUpdates(_0x147b71,_0x39e049){return function(_0x260d28){if(_0x260d28){return _0x260d28[_0xa57d('0x26')](_0x147b71)[_0xa57d('0x27')](function(_0x4f4836){return _0x4f4836;});}return null;};}function removeEntity(_0x26fb12,_0x5b4235){return function(_0x481668){if(_0x481668){return _0x481668[_0xa57d('0x28')]()['then'](function(){_0x26fb12[_0xa57d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f7b08,_0x2df7fc){return function(_0x4cac39){if(!_0x4cac39){_0x2f7b08[_0xa57d('0x1a')](0x194);}return _0x4cac39;};}function handleError(_0x2d4af0,_0x5c0007){_0x5c0007=_0x5c0007||0x1f4;return function(_0x467877){logger[_0xa57d('0x29')](_0x467877[_0xa57d('0x2a')]);if(_0x467877[_0xa57d('0x2b')]){delete _0x467877[_0xa57d('0x2b')];}_0x2d4af0[_0xa57d('0x1b')](_0x5c0007)[_0xa57d('0x2c')](_0x467877);};}exports[_0xa57d('0x2d')]=function(_0x59c099,_0x4d0efb){var _0x4cae4f={},_0x37822e={},_0xba62cd={'count':0x0,'rows':[]};var _0x2f7e42=_[_0xa57d('0x2e')](db[_0xa57d('0x2f')]['rawAttributes'],function(_0x4f106c){return{'name':_0x4f106c['fieldName'],'type':_0x4f106c[_0xa57d('0x30')]['key']};});_0x37822e[_0xa57d('0x31')]=_['map'](_0x2f7e42,_0xa57d('0x2b'));_0x37822e[_0xa57d('0x32')]=_[_0xa57d('0x33')](_0x59c099[_0xa57d('0x32')]);_0x37822e['filters']=_[_0xa57d('0x34')](_0x37822e[_0xa57d('0x31')],_0x37822e[_0xa57d('0x32')]);_0x4cae4f[_0xa57d('0x35')]=_[_0xa57d('0x34')](_0x37822e[_0xa57d('0x31')],qs[_0xa57d('0x36')](_0x59c099[_0xa57d('0x32')][_0xa57d('0x36')]));_0x4cae4f[_0xa57d('0x35')]=_0x4cae4f[_0xa57d('0x35')][_0xa57d('0x37')]?_0x4cae4f[_0xa57d('0x35')]:_0x37822e['model'];if(!_0x59c099[_0xa57d('0x32')][_0xa57d('0x38')]('nolimit')){_0x4cae4f['limit']=qs['limit'](_0x59c099[_0xa57d('0x32')][_0xa57d('0x20')]);_0x4cae4f[_0xa57d('0x1e')]=qs[_0xa57d('0x1e')](_0x59c099[_0xa57d('0x32')][_0xa57d('0x1e')]);}_0x4cae4f[_0xa57d('0x39')]=qs[_0xa57d('0x3a')](_0x59c099[_0xa57d('0x32')][_0xa57d('0x3a')]);_0x4cae4f[_0xa57d('0x3b')]=qs[_0xa57d('0x3c')](_[_0xa57d('0x3d')](_0x59c099['query'],_0x37822e[_0xa57d('0x3c')]),_0x2f7e42);if(_0x59c099['query'][_0xa57d('0x3e')]){_0x4cae4f[_0xa57d('0x3b')]=_[_0xa57d('0x3f')](_0x4cae4f[_0xa57d('0x3b')],{'$or':_['map'](_0x2f7e42,function(_0x55b90f){if(_0x55b90f[_0xa57d('0x30')]!==_0xa57d('0x40')){var _0x490dc5={};_0x490dc5[_0x55b90f[_0xa57d('0x2b')]]={'$like':'%'+_0x59c099[_0xa57d('0x32')][_0xa57d('0x3e')]+'%'};return _0x490dc5;}})});}_0x4cae4f=_[_0xa57d('0x3f')]({},_0x4cae4f,_0x59c099[_0xa57d('0x41')]);var _0x452866={'where':_0x4cae4f['where']};return db['Migration'][_0xa57d('0x21')](_0x452866)[_0xa57d('0x27')](function(_0x746d74){_0xba62cd[_0xa57d('0x21')]=_0x746d74;if(_0x59c099[_0xa57d('0x32')]['includeAll']){_0x4cae4f['include']=[{'all':!![]}];}return db[_0xa57d('0x2f')][_0xa57d('0x42')](_0x4cae4f);})[_0xa57d('0x27')](function(_0x503c40){_0xba62cd[_0xa57d('0x43')]=_0x503c40;return _0xba62cd;})[_0xa57d('0x27')](respondWithFilteredResult(_0x4d0efb,_0x4cae4f))['catch'](handleError(_0x4d0efb,null));}; \ No newline at end of file +var _0x08e0=['model','attributes','intersection','fields','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','status','stack','name','send','index','map','Migration','rawAttributes','key','query','keys'];(function(_0xd92f5,_0x13d650){var _0x55dc80=function(_0x5918ed){while(--_0x5918ed){_0xd92f5['push'](_0xd92f5['shift']());}};_0x55dc80(++_0x13d650);}(_0x08e0,0x19d));var _0x008e=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x08e0[_0x265aa2];return _0x447a3a;};'use strict';var emlformat=require(_0x008e('0x0'));var rimraf=require(_0x008e('0x1'));var zipdir=require(_0x008e('0x2'));var jsonpatch=require(_0x008e('0x3'));var rp=require(_0x008e('0x4'));var moment=require(_0x008e('0x5'));var BPromise=require(_0x008e('0x6'));var Mustache=require(_0x008e('0x7'));var util=require(_0x008e('0x8'));var path=require('path');var sox=require(_0x008e('0x9'));var csv=require(_0x008e('0xa'));var ejs=require(_0x008e('0xb'));var fs=require('fs');var fs_extra=require(_0x008e('0xc'));var _=require(_0x008e('0xd'));var squel=require(_0x008e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x008e('0xf'));var toCsv=require(_0x008e('0xa'));var querystring=require('querystring');var Papa=require(_0x008e('0x10'));var Redis=require(_0x008e('0x11'));var authService=require(_0x008e('0x12'));var qs=require(_0x008e('0x13'));var as=require(_0x008e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x008e('0x15'))(_0x008e('0x16'));var utils=require(_0x008e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x008e('0x18'));var db=require(_0x008e('0x19'))['db'];function respondWithStatusCode(_0x5eaf3b,_0xc2820d){_0xc2820d=_0xc2820d||0xcc;return function(_0x25ce43){if(_0x25ce43){return _0x5eaf3b[_0x008e('0x1a')](_0xc2820d);}return _0x5eaf3b['status'](_0xc2820d)[_0x008e('0x1b')]();};}function respondWithResult(_0x21cd2e,_0x2d4120){_0x2d4120=_0x2d4120||0xc8;return function(_0x1e6618){if(_0x1e6618){return _0x21cd2e['status'](_0x2d4120)[_0x008e('0x1c')](_0x1e6618);}};}function respondWithFilteredResult(_0x45b2c5,_0x42d191){return function(_0x5f5620){if(_0x5f5620){var _0x22512e=typeof _0x42d191['offset']===_0x008e('0x1d')&&typeof _0x42d191[_0x008e('0x1e')]===_0x008e('0x1d');var _0x35f1ba=_0x5f5620[_0x008e('0x1f')];var _0x375999=_0x22512e?0x0:_0x42d191['offset'];var _0x4b2509=_0x22512e?_0x5f5620[_0x008e('0x1f')]:_0x42d191['offset']+_0x42d191[_0x008e('0x1e')];var _0x44f1cd;if(_0x4b2509>=_0x35f1ba){_0x4b2509=_0x35f1ba;_0x44f1cd=0xc8;}else{_0x44f1cd=0xce;}_0x45b2c5['status'](_0x44f1cd);return _0x45b2c5[_0x008e('0x20')](_0x008e('0x21'),_0x375999+'-'+_0x4b2509+'/'+_0x35f1ba)['json'](_0x5f5620);}return null;};}function patchUpdates(_0x533fce){return function(_0x4b9d85){try{jsonpatch[_0x008e('0x22')](_0x4b9d85,_0x533fce,!![]);}catch(_0x5ea48b){return BPromise[_0x008e('0x23')](_0x5ea48b);}return _0x4b9d85['save']();};}function saveUpdates(_0x4d2b6c,_0x3702e3){return function(_0x562718){if(_0x562718){return _0x562718['update'](_0x4d2b6c)[_0x008e('0x24')](function(_0x60054e){return _0x60054e;});}return null;};}function removeEntity(_0x50e5fa,_0x369fcc){return function(_0x56d592){if(_0x56d592){return _0x56d592[_0x008e('0x25')]()[_0x008e('0x24')](function(){_0x50e5fa[_0x008e('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b257,_0x3d7e66){return function(_0x43b859){if(!_0x43b859){_0x35b257[_0x008e('0x1a')](0x194);}return _0x43b859;};}function handleError(_0x3027a2,_0x4e945e){_0x4e945e=_0x4e945e||0x1f4;return function(_0x412c25){logger['error'](_0x412c25[_0x008e('0x27')]);if(_0x412c25['name']){delete _0x412c25[_0x008e('0x28')];}_0x3027a2['status'](_0x4e945e)[_0x008e('0x29')](_0x412c25);};}exports[_0x008e('0x2a')]=function(_0x13d6f7,_0x25d8d8){var _0x35c033={},_0x52a70f={},_0x44eb53={'count':0x0,'rows':[]};var _0x5f17f6=_[_0x008e('0x2b')](db[_0x008e('0x2c')][_0x008e('0x2d')],function(_0x36025b){return{'name':_0x36025b['fieldName'],'type':_0x36025b['type'][_0x008e('0x2e')]};});_0x52a70f['model']=_[_0x008e('0x2b')](_0x5f17f6,_0x008e('0x28'));_0x52a70f[_0x008e('0x2f')]=_[_0x008e('0x30')](_0x13d6f7[_0x008e('0x2f')]);_0x52a70f['filters']=_['intersection'](_0x52a70f[_0x008e('0x31')],_0x52a70f[_0x008e('0x2f')]);_0x35c033[_0x008e('0x32')]=_[_0x008e('0x33')](_0x52a70f[_0x008e('0x31')],qs[_0x008e('0x34')](_0x13d6f7[_0x008e('0x2f')][_0x008e('0x34')]));_0x35c033[_0x008e('0x32')]=_0x35c033[_0x008e('0x32')]['length']?_0x35c033[_0x008e('0x32')]:_0x52a70f[_0x008e('0x31')];if(!_0x13d6f7[_0x008e('0x2f')]['hasOwnProperty'](_0x008e('0x35'))){_0x35c033[_0x008e('0x1e')]=qs['limit'](_0x13d6f7[_0x008e('0x2f')]['limit']);_0x35c033[_0x008e('0x36')]=qs[_0x008e('0x36')](_0x13d6f7['query']['offset']);}_0x35c033[_0x008e('0x37')]=qs[_0x008e('0x38')](_0x13d6f7['query'][_0x008e('0x38')]);_0x35c033[_0x008e('0x39')]=qs['filters'](_[_0x008e('0x3a')](_0x13d6f7['query'],_0x52a70f['filters']),_0x5f17f6);if(_0x13d6f7[_0x008e('0x2f')][_0x008e('0x3b')]){_0x35c033[_0x008e('0x39')]=_[_0x008e('0x3c')](_0x35c033['where'],{'$or':_[_0x008e('0x2b')](_0x5f17f6,function(_0x19a392){if(_0x19a392['type']!==_0x008e('0x3d')){var _0x23d2c9={};_0x23d2c9[_0x19a392['name']]={'$like':'%'+_0x13d6f7[_0x008e('0x2f')][_0x008e('0x3b')]+'%'};return _0x23d2c9;}})});}_0x35c033=_['merge']({},_0x35c033,_0x13d6f7['options']);var _0x4bea5c={'where':_0x35c033[_0x008e('0x39')]};return db[_0x008e('0x2c')]['count'](_0x4bea5c)['then'](function(_0x46946e){_0x44eb53[_0x008e('0x1f')]=_0x46946e;if(_0x13d6f7[_0x008e('0x2f')][_0x008e('0x3e')]){_0x35c033[_0x008e('0x3f')]=[{'all':!![]}];}return db[_0x008e('0x2c')][_0x008e('0x40')](_0x35c033);})[_0x008e('0x24')](function(_0xe97d6a){_0x44eb53[_0x008e('0x41')]=_0xe97d6a;return _0x44eb53;})[_0x008e('0x24')](respondWithFilteredResult(_0x25d8d8,_0x35c033))['catch'](handleError(_0x25d8d8,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 2dd57c4..6514861 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 _0x8fcd=['migrations','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','Migration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fcd,0x15f));var _0xd8fc=function(_0x4161eb,_0xce593a){_0x4161eb=_0x4161eb-0x0;var _0x1753dc=_0x8fcd[_0x4161eb];return _0x1753dc;};'use strict';var _=require(_0xd8fc('0x0'));var util=require('util');var logger=require(_0xd8fc('0x1'))('api');var moment=require(_0xd8fc('0x2'));var BPromise=require('bluebird');var rp=require(_0xd8fc('0x3'));var fs=require('fs');var path=require(_0xd8fc('0x4'));var rimraf=require(_0xd8fc('0x5'));var config=require(_0xd8fc('0x6'));var attributes=require('./migration.attributes');module[_0xd8fc('0x7')]=function(_0x575f00,_0x27ac6c){return _0x575f00['define'](_0xd8fc('0x8'),attributes,{'tableName':_0xd8fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9c7=['moment','bluebird','request-promise','path','migrations','util','../../config/logger','api'];(function(_0x3c47d3,_0x3d6aa6){var _0x16bd25=function(_0x517698){while(--_0x517698){_0x3c47d3['push'](_0x3c47d3['shift']());}};_0x16bd25(++_0x3d6aa6);}(_0xc9c7,0x16d));var _0x7c9c=function(_0x3333df,_0x301c11){_0x3333df=_0x3333df-0x0;var _0x7bc462=_0xc9c7[_0x3333df];return _0x7bc462;};'use strict';var _=require('lodash');var util=require(_0x7c9c('0x0'));var logger=require(_0x7c9c('0x1'))(_0x7c9c('0x2'));var moment=require(_0x7c9c('0x3'));var BPromise=require(_0x7c9c('0x4'));var rp=require(_0x7c9c('0x5'));var fs=require('fs');var path=require(_0x7c9c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x3ee85b,_0x23ef2d){return _0x3ee85b['define']('Migration',attributes,{'tableName':_0x7c9c('0x7'),'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 223d545..c50d0ec 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 _0x7eb9=['Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info'];(function(_0x1c782d,_0x5503d7){var _0x74693e=function(_0x8259ef){while(--_0x8259ef){_0x1c782d['push'](_0x1c782d['shift']());}};_0x74693e(++_0x5503d7);}(_0x7eb9,0xd9));var _0x97eb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7eb9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x97eb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97eb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97eb('0x2'));var db=require(_0x97eb('0x3'))['db'];var utils=require(_0x97eb('0x4'));var logger=require(_0x97eb('0x5'))('rpc');var config=require(_0x97eb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x97eb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44595e,_0x4a8f26,_0x5227f4){return new BPromise(function(_0x429ed6,_0x5af402){return client[_0x97eb('0x8')](_0x44595e,_0x5227f4)[_0x97eb('0x9')](function(_0x10eba2){logger[_0x97eb('0xa')](_0x97eb('0xb'),_0x4a8f26,'request\x20sent');logger['debug'](_0x97eb('0xc'),_0x4a8f26,_0x97eb('0xd'),JSON[_0x97eb('0xe')](_0x10eba2));if(_0x10eba2[_0x97eb('0xf')]){if(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x10')]===0x1f4){logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);return _0x5af402(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);}logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x10eba2['error'][_0x97eb('0x11')]);return _0x429ed6(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);}else{logger['info'](_0x97eb('0xb'),_0x4a8f26,_0x97eb('0xd'));_0x429ed6(_0x10eba2[_0x97eb('0x12')]['message']);}})['catch'](function(_0x42efe3){logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x42efe3);_0x5af402(_0x42efe3);});});} \ No newline at end of file +var _0xbe99=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0xd3e8bc,_0x418c77){var _0x398d1d=function(_0x1bbc71){while(--_0x1bbc71){_0xd3e8bc['push'](_0xd3e8bc['shift']());}};_0x398d1d(++_0x418c77);}(_0xbe99,0x196));var _0x9be9=function(_0x59e5cb,_0x2b209a){_0x59e5cb=_0x59e5cb-0x0;var _0x4e69c1=_0xbe99[_0x59e5cb];return _0x4e69c1;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var moment=require(_0x9be9('0x2'));var BPromise=require(_0x9be9('0x3'));var rs=require(_0x9be9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9be9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9be9('0x6'))(_0x9be9('0x7'));var config=require(_0x9be9('0x8'));var jayson=require(_0x9be9('0x9'));var client=jayson['client'][_0x9be9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eccd7,_0x4dc53f,_0x49694d){return new BPromise(function(_0x7e0cd,_0x33f952){return client[_0x9be9('0xb')](_0x1eccd7,_0x49694d)[_0x9be9('0xc')](function(_0x178a02){logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));logger[_0x9be9('0x10')](_0x9be9('0x11'),_0x4dc53f,_0x9be9('0xf'),JSON[_0x9be9('0x12')](_0x178a02));if(_0x178a02[_0x9be9('0x13')]){if(_0x178a02[_0x9be9('0x13')][_0x9be9('0x14')]===0x1f4){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x33f952(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x7e0cd(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}else{logger['info'](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));_0x7e0cd(_0x178a02[_0x9be9('0x16')][_0x9be9('0x15')]);}})[_0x9be9('0x17')](function(_0x5287d9){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x5287d9);_0x33f952(_0x5287d9);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 58e04f1..2c24744 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 _0x1ae7=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x393faf,_0xc6ae1a){var _0x3a5514=function(_0xc3ab5b){while(--_0xc3ab5b){_0x393faf['push'](_0x393faf['shift']());}};_0x3a5514(++_0xc6ae1a);}(_0x1ae7,0x150));var _0x71ae=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x1ae7[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x71ae('0x0'));var util=require(_0x71ae('0x1'));var path=require(_0x71ae('0x2'));var timeout=require(_0x71ae('0x3'));var express=require('express');var router=express[_0x71ae('0x4')]();var fs_extra=require(_0x71ae('0x5'));var auth=require(_0x71ae('0x6'));var interaction=require(_0x71ae('0x7'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x71ae('0x8')]('/',auth['isAuthenticated'](),controller[_0x71ae('0x9')]);router[_0x71ae('0x8')](_0x71ae('0xa'),auth[_0x71ae('0xb')](),controller[_0x71ae('0xc')]);router[_0x71ae('0xd')]('/',auth[_0x71ae('0xb')](),controller[_0x71ae('0xe')]);router[_0x71ae('0xf')](_0x71ae('0xa'),auth[_0x71ae('0xb')](),controller[_0x71ae('0x10')]);router['delete'](_0x71ae('0xa'),auth[_0x71ae('0xb')](),controller[_0x71ae('0x11')]);module[_0x71ae('0x12')]=router; \ No newline at end of file +var _0xf811=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x456b45,_0x273834){var _0xe3627d=function(_0x3a6f59){while(--_0x3a6f59){_0x456b45['push'](_0x456b45['shift']());}};_0xe3627d(++_0x273834);}(_0xf811,0x6f));var _0x1f81=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xf811[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var path=require(_0x1f81('0x2'));var timeout=require(_0x1f81('0x3'));var express=require(_0x1f81('0x4'));var router=express[_0x1f81('0x5')]();var fs_extra=require(_0x1f81('0x6'));var auth=require(_0x1f81('0x7'));var interaction=require(_0x1f81('0x8'));var config=require(_0x1f81('0x9'));var controller=require(_0x1f81('0xa'));router[_0x1f81('0xb')]('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0xd')]);router['get'](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0xf')]);router['post']('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0x10')]);router['put'](_0x1f81('0xe'),auth['isAuthenticated'](),controller[_0x1f81('0x11')]);router[_0x1f81('0x12')](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0x13')]);module[_0x1f81('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6e18dac..887e6d9 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 _0x4d06=['exports','localnet','STRING','sequelize'];(function(_0x2acfd3,_0x3ae9ec){var _0x552934=function(_0x59c060){while(--_0x59c060){_0x2acfd3['push'](_0x2acfd3['shift']());}};_0x552934(++_0x3ae9ec);}(_0x4d06,0x16b));var _0x64d0=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x4d06[_0x547ff4];return _0xe41057;};'use strict';var Sequelize=require(_0x64d0('0x0'));module[_0x64d0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x64d0('0x2'),'externip','stun','turn')},'value':{'type':Sequelize[_0x64d0('0x3')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd912=['stun','turn','STRING','exports','ENUM','localnet','externip'];(function(_0xb38e5d,_0x2b8e8c){var _0x1af7e4=function(_0x43353d){while(--_0x43353d){_0xb38e5d['push'](_0xb38e5d['shift']());}};_0x1af7e4(++_0x2b8e8c);}(_0xd912,0xab));var _0x2d91=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd912[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x2d91('0x0')]={'type':{'type':Sequelize[_0x2d91('0x1')](_0x2d91('0x2'),_0x2d91('0x3'),_0x2d91('0x4'),_0x2d91('0x5'))},'value':{'type':Sequelize[_0x2d91('0x6')]},'username':{'type':Sequelize[_0x2d91('0x6')]},'password':{'type':Sequelize[_0x2d91('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index da8bedd..a369cc1 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 _0x0196=['map','Network','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','intersection','length','options','find','create','body','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','params','STUN','/etc/asterisk/stun_xcally.conf','update','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','format','util','path','lodash','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','status','offset','undefined','count','limit','set','then','destroy','sendStatus','stack','name','send'];(function(_0x370b75,_0x1e8cf4){var _0x4605ed=function(_0x1de0c3){while(--_0x1de0c3){_0x370b75['push'](_0x370b75['shift']());}};_0x4605ed(++_0x1e8cf4);}(_0x0196,0x1c2));var _0x6019=function(_0x2bac83,_0x573f20){_0x2bac83=_0x2bac83-0x0;var _0xe6b05=_0x0196[_0x2bac83];return _0xe6b05;};'use strict';var util=require(_0x6019('0x0'));var path=require(_0x6019('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6019('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x6019('0x3'))('api');var config=require(_0x6019('0x4'));var db=require(_0x6019('0x5'))['db'];var jayson=require(_0x6019('0x6'));var client=jayson['client'][_0x6019('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22b69d,_0x1978ba,_0x54a0c7,_0xbf34ee){return new Promise(function(_0x42edd9,_0x13697e){var _0x39fa5b=_0xbf34ee||client;return _0x39fa5b[_0x6019('0x8')](_0x22b69d,_0x54a0c7)['then'](function(_0x54f496){logger['info'](_0x6019('0x9'),_0x1978ba,_0x6019('0xa'));logger[_0x6019('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x1978ba,_0x6019('0xa'),JSON['stringify'](_0x54f496));if(_0x54f496[_0x6019('0xc')]){if(_0x54f496[_0x6019('0xc')][_0x6019('0xd')]===0x1f4){logger[_0x6019('0xc')]('Network,\x20%s,\x20%s',_0x1978ba,_0x54f496[_0x6019('0xc')][_0x6019('0xe')]);return _0x13697e(_0x54f496[_0x6019('0xc')][_0x6019('0xe')]);}logger[_0x6019('0xc')](_0x6019('0x9'),_0x1978ba,_0x54f496[_0x6019('0xc')][_0x6019('0xe')]);return _0x42edd9(_0x54f496[_0x6019('0xc')]['message']);}else{logger[_0x6019('0xf')](_0x6019('0x9'),_0x1978ba,'request\x20sent');_0x42edd9(_0x54f496[_0x6019('0x10')][_0x6019('0xe')]);}})[_0x6019('0x11')](function(_0x25226e){logger[_0x6019('0xc')]('Network,\x20%s,\x20%s',_0x1978ba,_0x25226e);_0x13697e(_0x25226e);});});}function respondWithResult(_0x7e51a9,_0x207db6){_0x207db6=_0x207db6||0xc8;return function(_0x541771){if(_0x541771){return _0x7e51a9[_0x6019('0x12')](_0x207db6)['json'](_0x541771);}};}function respondWithFilteredResult(_0x23210b,_0x3d78df){return function(_0x43aebc){if(_0x43aebc){var _0x329562=typeof _0x3d78df[_0x6019('0x13')]===_0x6019('0x14')&&typeof _0x3d78df['limit']===_0x6019('0x14');var _0x365936=_0x43aebc[_0x6019('0x15')];var _0x4bdfde=_0x329562?0x0:_0x3d78df[_0x6019('0x13')];var _0x1a7bcc=_0x329562?_0x43aebc[_0x6019('0x15')]:_0x3d78df[_0x6019('0x13')]+_0x3d78df[_0x6019('0x16')];var _0x29651b;if(_0x1a7bcc>=_0x365936){_0x1a7bcc=_0x365936;_0x29651b=0xc8;}else{_0x29651b=0xce;}_0x23210b[_0x6019('0x12')](_0x29651b);return _0x23210b[_0x6019('0x17')]('Content-Range',_0x4bdfde+'-'+_0x1a7bcc+'/'+_0x365936)['json'](_0x43aebc);}return null;};}function saveUpdates(_0x54efb1){return function(_0x444281){if(_0x444281){return _0x444281['update'](_0x54efb1)[_0x6019('0x18')](function(_0x2767ad){return _0x2767ad;});}return null;};}function removeEntity(_0x471c3b){return function(_0x3399be){if(_0x3399be){return _0x3399be[_0x6019('0x19')]()[_0x6019('0x18')](function(){_0x471c3b[_0x6019('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5961d9){return function(_0x2da78b){if(!_0x2da78b){_0x5961d9[_0x6019('0x1a')](0x194);}return _0x2da78b;};}function handleError(_0x416f3c,_0x1055dc){_0x1055dc=_0x1055dc||0x1f4;return function(_0x145c88){logger[_0x6019('0xc')](_0x145c88[_0x6019('0x1b')]);if(_0x145c88[_0x6019('0x1c')]){delete _0x145c88['name'];}_0x416f3c[_0x6019('0x12')](_0x1055dc)[_0x6019('0x1d')](_0x145c88);};}exports['index']=function(_0x500539,_0x2c8b3c){var _0x385e85={},_0x5894cc={},_0x15e598={'count':0x0,'rows':[]};var _0x127d59=_[_0x6019('0x1e')](db[_0x6019('0x1f')][_0x6019('0x20')],function(_0x337c37){return{'name':_0x337c37[_0x6019('0x21')],'type':_0x337c37[_0x6019('0x22')][_0x6019('0x23')]};});_0x5894cc[_0x6019('0x24')]=_[_0x6019('0x1e')](_0x127d59,'name');_0x5894cc[_0x6019('0x25')]=_[_0x6019('0x26')](_0x500539['query']);_0x5894cc['filters']=_['intersection'](_0x5894cc[_0x6019('0x24')],_0x5894cc['query']);_0x385e85[_0x6019('0x27')]=_['intersection'](_0x5894cc['model'],qs[_0x6019('0x28')](_0x500539[_0x6019('0x25')][_0x6019('0x28')]));_0x385e85[_0x6019('0x27')]=_0x385e85['attributes']['length']?_0x385e85['attributes']:_0x5894cc[_0x6019('0x24')];if(!_0x500539[_0x6019('0x25')]['hasOwnProperty']('nolimit')){_0x385e85['limit']=qs[_0x6019('0x16')](_0x500539[_0x6019('0x25')][_0x6019('0x16')]);_0x385e85[_0x6019('0x13')]=qs[_0x6019('0x13')](_0x500539[_0x6019('0x25')]['offset']);}_0x385e85['order']=qs[_0x6019('0x29')](_0x500539['query'][_0x6019('0x29')]);_0x385e85[_0x6019('0x2a')]=qs[_0x6019('0x2b')](_[_0x6019('0x2c')](_0x500539['query'],_0x5894cc[_0x6019('0x2b')]),_0x127d59);if(_0x500539[_0x6019('0x25')][_0x6019('0x2d')]){_0x385e85[_0x6019('0x2a')]=_['merge'](_0x385e85[_0x6019('0x2a')],{'$or':_[_0x6019('0x1e')](_0x127d59,function(_0x96afec){if(_0x96afec['type']!==_0x6019('0x2e')){var _0x5cc89c={};_0x5cc89c[_0x96afec[_0x6019('0x1c')]]={'$like':'%'+_0x500539[_0x6019('0x25')]['filter']+'%'};return _0x5cc89c;}})});}_0x385e85=_[_0x6019('0x2f')]({},_0x385e85,_0x500539['options']);var _0x5b429c={'where':_0x385e85[_0x6019('0x2a')]};return db[_0x6019('0x1f')][_0x6019('0x15')](_0x5b429c)['then'](function(_0x9bbe66){_0x15e598[_0x6019('0x15')]=_0x9bbe66;if(_0x500539[_0x6019('0x25')][_0x6019('0x30')]){_0x385e85[_0x6019('0x31')]=[{'all':!![]}];}return db[_0x6019('0x1f')][_0x6019('0x32')](_0x385e85);})[_0x6019('0x18')](function(_0x4fa07c){_0x15e598[_0x6019('0x33')]=_0x4fa07c;return _0x15e598;})[_0x6019('0x18')](respondWithFilteredResult(_0x2c8b3c,_0x385e85))[_0x6019('0x11')](handleError(_0x2c8b3c,null));};exports['show']=function(_0x115119,_0x59f765){var _0x56409d={'raw':!![],'where':{'id':_0x115119['params']['id']}},_0x1354c6={};_0x1354c6[_0x6019('0x24')]=_[_0x6019('0x26')](db[_0x6019('0x1f')][_0x6019('0x20')]);_0x1354c6[_0x6019('0x25')]=_[_0x6019('0x26')](_0x115119['query']);_0x1354c6['filters']=_[_0x6019('0x34')](_0x1354c6[_0x6019('0x24')],_0x1354c6[_0x6019('0x25')]);_0x56409d[_0x6019('0x27')]=_[_0x6019('0x34')](_0x1354c6[_0x6019('0x24')],qs[_0x6019('0x28')](_0x115119[_0x6019('0x25')]['fields']));_0x56409d[_0x6019('0x27')]=_0x56409d['attributes'][_0x6019('0x35')]?_0x56409d[_0x6019('0x27')]:_0x1354c6[_0x6019('0x24')];if(_0x115119[_0x6019('0x25')]['includeAll']){_0x56409d[_0x6019('0x31')]=[{'all':!![]}];}_0x56409d=_[_0x6019('0x2f')]({},_0x56409d,_0x115119[_0x6019('0x36')]);return db[_0x6019('0x1f')][_0x6019('0x37')](_0x56409d)[_0x6019('0x18')](handleEntityNotFound(_0x59f765,null))['then'](respondWithResult(_0x59f765,null))[_0x6019('0x11')](handleError(_0x59f765,null));};exports['create']=function(_0x4d2442,_0x3ac0d6){var _0x573e66;return db[_0x6019('0x1f')][_0x6019('0x38')](_0x4d2442[_0x6019('0x39')],{'raw':!![]})['then'](function(_0xd256b4){_0x573e66=_0xd256b4;return db['Network'][_0x6019('0x32')]({'where':{'type':_0x4d2442['body']['type']},'raw':!![]});})[_0x6019('0x18')](function(_0x4671c2){if(_0x573e66[_0x6019('0x22')]['toUpperCase']()=='STUN'){var _0x203e16=fs['readFileSync'](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x3c')),'utf8');var _0x4d2f7f=ejs[_0x6019('0x3d')](_0x203e16,{'networks':_0x4671c2||[]});fs[_0x6019('0x3e')]('/etc/asterisk/stun_xcally.conf',_0x4d2f7f);return respondWithRpcPromise(_0x6019('0x3f'),'create',{'module':_0x6019('0x40')});}else if(_0x573e66['type'][_0x6019('0x41')]()==_0x6019('0x42')){var _0x33a937=fs[_0x6019('0x43')](path['join'](config[_0x6019('0x3b')],_0x6019('0x44')),_0x6019('0x45'));var _0x15b9b1=ejs[_0x6019('0x3d')](_0x33a937,{'networks':_0x4671c2||[]});fs[_0x6019('0x3e')](_0x6019('0x46'),_0x15b9b1);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x38'),{'module':'res_stun_monitor.so'});}else{var _0xf861d5=fs['readFileSync'](path['join'](config[_0x6019('0x3b')],_0x6019('0x47')),_0x6019('0x45'));var _0x9d7c20=ejs[_0x6019('0x3d')](_0xf861d5,{'networks':_0x4671c2||[]});fs[_0x6019('0x3e')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4d2442['body']['type']['toLowerCase']()),_0x9d7c20);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x38'),{'module':'chan_sip.so'});}})[_0x6019('0x18')](function(){return _0x573e66;})[_0x6019('0x18')](respondWithResult(_0x3ac0d6,0xc9))[_0x6019('0x11')](handleError(_0x3ac0d6,null));};exports['update']=function(_0x336eab,_0x3018f1){var _0x4aef10;return db['Network'][_0x6019('0x37')]({'where':{'id':_0x336eab[_0x6019('0x48')]['id']}})[_0x6019('0x18')](handleEntityNotFound(_0x3018f1,null))[_0x6019('0x18')](saveUpdates(_0x336eab[_0x6019('0x39')],null))['then'](function(_0x2bb205){if(_0x2bb205){_0x4aef10=_0x2bb205;return db['Network'][_0x6019('0x32')]({'where':{'type':_0x4aef10[_0x6019('0x22')]},'raw':!![]});}return null;})[_0x6019('0x18')](function(_0x2f674c){if(_0x4aef10['type']['toUpperCase']()==_0x6019('0x49')){var _0x5ea9fb=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config['root'],_0x6019('0x3c')),_0x6019('0x45'));var _0x39c9f5=ejs[_0x6019('0x3d')](_0x5ea9fb,{'networks':_0x2f674c||[]});fs[_0x6019('0x3e')](_0x6019('0x4a'),_0x39c9f5);return respondWithRpcPromise(_0x6019('0x3f'),'update',{'module':_0x6019('0x40')});}else if(_0x4aef10[_0x6019('0x22')][_0x6019('0x41')]()==_0x6019('0x42')){var _0x2b4435=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x44')),_0x6019('0x45'));var _0x31a5e3=ejs[_0x6019('0x3d')](_0x2b4435,{'networks':_0x2f674c||[]});fs[_0x6019('0x3e')](_0x6019('0x46'),_0x31a5e3);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x4b'),{'module':'res_stun_monitor.so'});}else{var _0x33491d=fs['readFileSync'](path['join'](config[_0x6019('0x3b')],_0x6019('0x47')),_0x6019('0x45'));var _0x173d9a=ejs['render'](_0x33491d,{'networks':_0x2f674c||[]});fs[_0x6019('0x3e')](util['format'](_0x6019('0x4c'),_0x336eab[_0x6019('0x39')]['type'][_0x6019('0x4d')]()),_0x173d9a);return respondWithRpcPromise('Reload','update',{'module':_0x6019('0x4e')});}})[_0x6019('0x18')](function(_0x55ba6c){if(_0x55ba6c){return _0x4aef10;}return null;})[_0x6019('0x18')](respondWithResult(_0x3018f1,null))['catch'](handleError(_0x3018f1,null));};exports[_0x6019('0x19')]=function(_0x3823bb,_0x450241){var _0x11cbe6;return db[_0x6019('0x1f')][_0x6019('0x37')]({'where':{'id':_0x3823bb['params']['id']}})[_0x6019('0x18')](function(_0x3087b7){_0x11cbe6=_0x3087b7;return _0x3087b7;})[_0x6019('0x18')](handleEntityNotFound(_0x450241,null))[_0x6019('0x18')](removeEntity(_0x450241,null))[_0x6019('0x18')](function(){if(_0x11cbe6){return db[_0x6019('0x1f')][_0x6019('0x32')]({'where':{'type':_0x11cbe6[_0x6019('0x22')]},'raw':!![]});}})[_0x6019('0x18')](function(_0x85acc3){if(_0x11cbe6[_0x6019('0x22')][_0x6019('0x41')]()=='STUN'){var _0x535058=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x3c')),_0x6019('0x45'));var _0x445cae=ejs['render'](_0x535058,{'networks':_0x85acc3||[]});fs['writeFileSync'](_0x6019('0x4a'),_0x445cae);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x19'),{'module':_0x6019('0x40')});}else if(_0x11cbe6[_0x6019('0x22')][_0x6019('0x41')]()==_0x6019('0x42')){var _0x309f45=fs[_0x6019('0x43')](path[_0x6019('0x3a')](config[_0x6019('0x3b')],_0x6019('0x44')),_0x6019('0x45'));var _0xbcd5e9=ejs[_0x6019('0x3d')](_0x309f45,{'networks':_0x85acc3||[]});fs[_0x6019('0x3e')](_0x6019('0x46'),_0xbcd5e9);return respondWithRpcPromise(_0x6019('0x3f'),_0x6019('0x19'),{'module':_0x6019('0x40')});}else{var _0x429fa5=fs[_0x6019('0x43')](path['join'](config[_0x6019('0x3b')],_0x6019('0x47')),_0x6019('0x45'));var _0xc9596b=ejs['render'](_0x429fa5,{'networks':_0x85acc3||[]});fs['writeFileSync'](util[_0x6019('0x4f')](_0x6019('0x4c'),_0x11cbe6['type'][_0x6019('0x4d')]()),_0xc9596b);return respondWithRpcPromise(_0x6019('0x3f'),'destroy',{'module':_0x6019('0x4e')});}})[_0x6019('0x11')](handleError(_0x450241,null));}; \ No newline at end of file +var _0xfa08=['create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','res_stun_monitor.so','chan_sip.so','destroy','util','ejs','lodash','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','Network,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','count','limit','set','update','sendStatus','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find'];(function(_0x1415ef,_0x5c219e){var _0x234acc=function(_0x2dbfca){while(--_0x2dbfca){_0x1415ef['push'](_0x1415ef['shift']());}};_0x234acc(++_0x5c219e);}(_0xfa08,0x1ca));var _0x8fa0=function(_0x196ac9,_0x1bf044){_0x196ac9=_0x196ac9-0x0;var _0xf0bf83=_0xfa08[_0x196ac9];return _0xf0bf83;};'use strict';var util=require(_0x8fa0('0x0'));var path=require('path');var ejs=require(_0x8fa0('0x1'));var fs=require('fs');var _=require(_0x8fa0('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x8fa0('0x3'))(_0x8fa0('0x4'));var config=require('../../config/environment');var db=require(_0x8fa0('0x5'))['db'];var jayson=require(_0x8fa0('0x6'));var client=jayson[_0x8fa0('0x7')][_0x8fa0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2705d2,_0x52690c,_0x6f65d9,_0x5e15c7){return new Promise(function(_0x49df6a,_0x4cf981){var _0x5bedaa=_0x5e15c7||client;return _0x5bedaa[_0x8fa0('0x9')](_0x2705d2,_0x6f65d9)[_0x8fa0('0xa')](function(_0x40e104){logger['info']('Network,\x20%s,\x20%s',_0x52690c,_0x8fa0('0xb'));logger[_0x8fa0('0xc')](_0x8fa0('0xd'),_0x52690c,'request\x20sent',JSON[_0x8fa0('0xe')](_0x40e104));if(_0x40e104['error']){if(_0x40e104['error'][_0x8fa0('0xf')]===0x1f4){logger[_0x8fa0('0x10')](_0x8fa0('0x11'),_0x52690c,_0x40e104[_0x8fa0('0x10')][_0x8fa0('0x12')]);return _0x4cf981(_0x40e104[_0x8fa0('0x10')]['message']);}logger[_0x8fa0('0x10')](_0x8fa0('0x11'),_0x52690c,_0x40e104[_0x8fa0('0x10')]['message']);return _0x49df6a(_0x40e104['error']['message']);}else{logger[_0x8fa0('0x13')]('Network,\x20%s,\x20%s',_0x52690c,_0x8fa0('0xb'));_0x49df6a(_0x40e104[_0x8fa0('0x14')]['message']);}})[_0x8fa0('0x15')](function(_0xa69c8c){logger[_0x8fa0('0x10')](_0x8fa0('0x11'),_0x52690c,_0xa69c8c);_0x4cf981(_0xa69c8c);});});}function respondWithResult(_0x29ec1b,_0x248d63){_0x248d63=_0x248d63||0xc8;return function(_0x2b294d){if(_0x2b294d){return _0x29ec1b[_0x8fa0('0x16')](_0x248d63)[_0x8fa0('0x17')](_0x2b294d);}};}function respondWithFilteredResult(_0x5565a4,_0x5b68ec){return function(_0x2f9648){if(_0x2f9648){var _0x3bd1e3=typeof _0x5b68ec[_0x8fa0('0x18')]===_0x8fa0('0x19')&&typeof _0x5b68ec['limit']===_0x8fa0('0x19');var _0x147954=_0x2f9648[_0x8fa0('0x1a')];var _0x1c9b74=_0x3bd1e3?0x0:_0x5b68ec[_0x8fa0('0x18')];var _0x539e56=_0x3bd1e3?_0x2f9648[_0x8fa0('0x1a')]:_0x5b68ec['offset']+_0x5b68ec[_0x8fa0('0x1b')];var _0x4ec10f;if(_0x539e56>=_0x147954){_0x539e56=_0x147954;_0x4ec10f=0xc8;}else{_0x4ec10f=0xce;}_0x5565a4[_0x8fa0('0x16')](_0x4ec10f);return _0x5565a4[_0x8fa0('0x1c')]('Content-Range',_0x1c9b74+'-'+_0x539e56+'/'+_0x147954)[_0x8fa0('0x17')](_0x2f9648);}return null;};}function saveUpdates(_0x4f59e4){return function(_0x5b0b00){if(_0x5b0b00){return _0x5b0b00[_0x8fa0('0x1d')](_0x4f59e4)['then'](function(_0x192af9){return _0x192af9;});}return null;};}function removeEntity(_0x4f340b){return function(_0x1e26f9){if(_0x1e26f9){return _0x1e26f9['destroy']()[_0x8fa0('0xa')](function(){_0x4f340b[_0x8fa0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5403ee){return function(_0xa1698f){if(!_0xa1698f){_0x5403ee[_0x8fa0('0x1e')](0x194);}return _0xa1698f;};}function handleError(_0x80f915,_0x5c0a8b){_0x5c0a8b=_0x5c0a8b||0x1f4;return function(_0x5302cc){logger[_0x8fa0('0x10')](_0x5302cc[_0x8fa0('0x1f')]);if(_0x5302cc[_0x8fa0('0x20')]){delete _0x5302cc[_0x8fa0('0x20')];}_0x80f915[_0x8fa0('0x16')](_0x5c0a8b)['send'](_0x5302cc);};}exports[_0x8fa0('0x21')]=function(_0x35aa46,_0x5acc94){var _0x43fa59={},_0x3545ef={},_0x48b988={'count':0x0,'rows':[]};var _0xfe7989=_[_0x8fa0('0x22')](db[_0x8fa0('0x23')][_0x8fa0('0x24')],function(_0x496df3){return{'name':_0x496df3[_0x8fa0('0x25')],'type':_0x496df3[_0x8fa0('0x26')][_0x8fa0('0x27')]};});_0x3545ef[_0x8fa0('0x28')]=_[_0x8fa0('0x22')](_0xfe7989,'name');_0x3545ef[_0x8fa0('0x29')]=_[_0x8fa0('0x2a')](_0x35aa46['query']);_0x3545ef['filters']=_[_0x8fa0('0x2b')](_0x3545ef[_0x8fa0('0x28')],_0x3545ef[_0x8fa0('0x29')]);_0x43fa59[_0x8fa0('0x2c')]=_[_0x8fa0('0x2b')](_0x3545ef[_0x8fa0('0x28')],qs[_0x8fa0('0x2d')](_0x35aa46['query'][_0x8fa0('0x2d')]));_0x43fa59[_0x8fa0('0x2c')]=_0x43fa59['attributes']['length']?_0x43fa59[_0x8fa0('0x2c')]:_0x3545ef[_0x8fa0('0x28')];if(!_0x35aa46['query'][_0x8fa0('0x2e')](_0x8fa0('0x2f'))){_0x43fa59[_0x8fa0('0x1b')]=qs[_0x8fa0('0x1b')](_0x35aa46['query'][_0x8fa0('0x1b')]);_0x43fa59[_0x8fa0('0x18')]=qs[_0x8fa0('0x18')](_0x35aa46['query'][_0x8fa0('0x18')]);}_0x43fa59[_0x8fa0('0x30')]=qs[_0x8fa0('0x31')](_0x35aa46[_0x8fa0('0x29')][_0x8fa0('0x31')]);_0x43fa59[_0x8fa0('0x32')]=qs[_0x8fa0('0x33')](_[_0x8fa0('0x34')](_0x35aa46[_0x8fa0('0x29')],_0x3545ef[_0x8fa0('0x33')]),_0xfe7989);if(_0x35aa46[_0x8fa0('0x29')][_0x8fa0('0x35')]){_0x43fa59[_0x8fa0('0x32')]=_[_0x8fa0('0x36')](_0x43fa59[_0x8fa0('0x32')],{'$or':_['map'](_0xfe7989,function(_0x7b2991){if(_0x7b2991[_0x8fa0('0x26')]!==_0x8fa0('0x37')){var _0x5b82f3={};_0x5b82f3[_0x7b2991[_0x8fa0('0x20')]]={'$like':'%'+_0x35aa46['query'][_0x8fa0('0x35')]+'%'};return _0x5b82f3;}})});}_0x43fa59=_['merge']({},_0x43fa59,_0x35aa46[_0x8fa0('0x38')]);var _0xf89f6d={'where':_0x43fa59[_0x8fa0('0x32')]};return db[_0x8fa0('0x23')][_0x8fa0('0x1a')](_0xf89f6d)['then'](function(_0x126c11){_0x48b988['count']=_0x126c11;if(_0x35aa46[_0x8fa0('0x29')][_0x8fa0('0x39')]){_0x43fa59[_0x8fa0('0x3a')]=[{'all':!![]}];}return db[_0x8fa0('0x23')][_0x8fa0('0x3b')](_0x43fa59);})[_0x8fa0('0xa')](function(_0x1b7c1b){_0x48b988[_0x8fa0('0x3c')]=_0x1b7c1b;return _0x48b988;})[_0x8fa0('0xa')](respondWithFilteredResult(_0x5acc94,_0x43fa59))[_0x8fa0('0x15')](handleError(_0x5acc94,null));};exports[_0x8fa0('0x3d')]=function(_0xff728,_0x16f5b2){var _0x53d7e8={'raw':!![],'where':{'id':_0xff728[_0x8fa0('0x3e')]['id']}},_0x87b2d={};_0x87b2d['model']=_['keys'](db[_0x8fa0('0x23')][_0x8fa0('0x24')]);_0x87b2d[_0x8fa0('0x29')]=_[_0x8fa0('0x2a')](_0xff728['query']);_0x87b2d[_0x8fa0('0x33')]=_[_0x8fa0('0x2b')](_0x87b2d[_0x8fa0('0x28')],_0x87b2d[_0x8fa0('0x29')]);_0x53d7e8['attributes']=_[_0x8fa0('0x2b')](_0x87b2d[_0x8fa0('0x28')],qs[_0x8fa0('0x2d')](_0xff728['query'][_0x8fa0('0x2d')]));_0x53d7e8[_0x8fa0('0x2c')]=_0x53d7e8[_0x8fa0('0x2c')]['length']?_0x53d7e8['attributes']:_0x87b2d['model'];if(_0xff728[_0x8fa0('0x29')][_0x8fa0('0x39')]){_0x53d7e8['include']=[{'all':!![]}];}_0x53d7e8=_[_0x8fa0('0x36')]({},_0x53d7e8,_0xff728['options']);return db['Network'][_0x8fa0('0x3f')](_0x53d7e8)[_0x8fa0('0xa')](handleEntityNotFound(_0x16f5b2,null))[_0x8fa0('0xa')](respondWithResult(_0x16f5b2,null))[_0x8fa0('0x15')](handleError(_0x16f5b2,null));};exports[_0x8fa0('0x40')]=function(_0x123830,_0x1c86ad){var _0x5a17da;return db[_0x8fa0('0x23')]['create'](_0x123830[_0x8fa0('0x41')],{'raw':!![]})['then'](function(_0x1ad6f9){_0x5a17da=_0x1ad6f9;return db[_0x8fa0('0x23')][_0x8fa0('0x3b')]({'where':{'type':_0x123830[_0x8fa0('0x41')][_0x8fa0('0x26')]},'raw':!![]});})[_0x8fa0('0xa')](function(_0x1eaf63){if(_0x5a17da['type'][_0x8fa0('0x42')]()==_0x8fa0('0x43')){var _0x2d6c1c=fs[_0x8fa0('0x44')](path[_0x8fa0('0x45')](config[_0x8fa0('0x46')],_0x8fa0('0x47')),_0x8fa0('0x48'));var _0x4c9ef5=ejs['render'](_0x2d6c1c,{'networks':_0x1eaf63||[]});fs[_0x8fa0('0x49')](_0x8fa0('0x4a'),_0x4c9ef5);return respondWithRpcPromise(_0x8fa0('0x4b'),_0x8fa0('0x40'),{'module':'res_stun_monitor.so'});}else if(_0x5a17da[_0x8fa0('0x26')][_0x8fa0('0x42')]()==_0x8fa0('0x4c')){var _0x420282=fs[_0x8fa0('0x44')](path['join'](config['root'],_0x8fa0('0x4d')),_0x8fa0('0x48'));var _0x2a711d=ejs[_0x8fa0('0x4e')](_0x420282,{'networks':_0x1eaf63||[]});fs['writeFileSync'](_0x8fa0('0x4f'),_0x2a711d);return respondWithRpcPromise(_0x8fa0('0x4b'),'create',{'module':'res_stun_monitor.so'});}else{var _0x48719b=fs[_0x8fa0('0x44')](path['join'](config['root'],_0x8fa0('0x50')),_0x8fa0('0x48'));var _0x34db85=ejs[_0x8fa0('0x4e')](_0x48719b,{'networks':_0x1eaf63||[]});fs[_0x8fa0('0x49')](util[_0x8fa0('0x51')](_0x8fa0('0x52'),_0x123830[_0x8fa0('0x41')]['type'][_0x8fa0('0x53')]()),_0x34db85);return respondWithRpcPromise(_0x8fa0('0x4b'),'create',{'module':'chan_sip.so'});}})[_0x8fa0('0xa')](function(){return _0x5a17da;})[_0x8fa0('0xa')](respondWithResult(_0x1c86ad,0xc9))[_0x8fa0('0x15')](handleError(_0x1c86ad,null));};exports['update']=function(_0x428d51,_0x54cc72){var _0x2d8d0b;return db[_0x8fa0('0x23')][_0x8fa0('0x3f')]({'where':{'id':_0x428d51[_0x8fa0('0x3e')]['id']}})[_0x8fa0('0xa')](handleEntityNotFound(_0x54cc72,null))[_0x8fa0('0xa')](saveUpdates(_0x428d51[_0x8fa0('0x41')],null))[_0x8fa0('0xa')](function(_0x27d7cf){if(_0x27d7cf){_0x2d8d0b=_0x27d7cf;return db[_0x8fa0('0x23')][_0x8fa0('0x3b')]({'where':{'type':_0x2d8d0b['type']},'raw':!![]});}return null;})[_0x8fa0('0xa')](function(_0x44d4fd){if(_0x2d8d0b[_0x8fa0('0x26')][_0x8fa0('0x42')]()==_0x8fa0('0x43')){var _0x364d28=fs['readFileSync'](path[_0x8fa0('0x45')](config[_0x8fa0('0x46')],_0x8fa0('0x47')),_0x8fa0('0x48'));var _0x4292ae=ejs[_0x8fa0('0x4e')](_0x364d28,{'networks':_0x44d4fd||[]});fs['writeFileSync'](_0x8fa0('0x4a'),_0x4292ae);return respondWithRpcPromise('Reload','update',{'module':_0x8fa0('0x54')});}else if(_0x2d8d0b[_0x8fa0('0x26')][_0x8fa0('0x42')]()=='TURN'){var _0x4d0766=fs[_0x8fa0('0x44')](path[_0x8fa0('0x45')](config[_0x8fa0('0x46')],_0x8fa0('0x4d')),_0x8fa0('0x48'));var _0xa5a627=ejs[_0x8fa0('0x4e')](_0x4d0766,{'networks':_0x44d4fd||[]});fs['writeFileSync'](_0x8fa0('0x4f'),_0xa5a627);return respondWithRpcPromise(_0x8fa0('0x4b'),'update',{'module':'res_stun_monitor.so'});}else{var _0x30e2cf=fs[_0x8fa0('0x44')](path[_0x8fa0('0x45')](config[_0x8fa0('0x46')],_0x8fa0('0x50')),'utf8');var _0x3dcd1b=ejs[_0x8fa0('0x4e')](_0x30e2cf,{'networks':_0x44d4fd||[]});fs['writeFileSync'](util[_0x8fa0('0x51')](_0x8fa0('0x52'),_0x428d51['body'][_0x8fa0('0x26')][_0x8fa0('0x53')]()),_0x3dcd1b);return respondWithRpcPromise(_0x8fa0('0x4b'),_0x8fa0('0x1d'),{'module':_0x8fa0('0x55')});}})['then'](function(_0x16602a){if(_0x16602a){return _0x2d8d0b;}return null;})[_0x8fa0('0xa')](respondWithResult(_0x54cc72,null))['catch'](handleError(_0x54cc72,null));};exports[_0x8fa0('0x56')]=function(_0x2ef09f,_0x5c3328){var _0x47163c;return db[_0x8fa0('0x23')][_0x8fa0('0x3f')]({'where':{'id':_0x2ef09f['params']['id']}})[_0x8fa0('0xa')](function(_0x29adcc){_0x47163c=_0x29adcc;return _0x29adcc;})['then'](handleEntityNotFound(_0x5c3328,null))[_0x8fa0('0xa')](removeEntity(_0x5c3328,null))[_0x8fa0('0xa')](function(){if(_0x47163c){return db[_0x8fa0('0x23')][_0x8fa0('0x3b')]({'where':{'type':_0x47163c[_0x8fa0('0x26')]},'raw':!![]});}})['then'](function(_0x5e6658){if(_0x47163c[_0x8fa0('0x26')]['toUpperCase']()=='STUN'){var _0x4aaaa6=fs['readFileSync'](path[_0x8fa0('0x45')](config[_0x8fa0('0x46')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x9194b3=ejs[_0x8fa0('0x4e')](_0x4aaaa6,{'networks':_0x5e6658||[]});fs[_0x8fa0('0x49')](_0x8fa0('0x4a'),_0x9194b3);return respondWithRpcPromise('Reload',_0x8fa0('0x56'),{'module':'res_stun_monitor.so'});}else if(_0x47163c[_0x8fa0('0x26')][_0x8fa0('0x42')]()=='TURN'){var _0x55f053=fs['readFileSync'](path[_0x8fa0('0x45')](config[_0x8fa0('0x46')],_0x8fa0('0x4d')),_0x8fa0('0x48'));var _0x36d555=ejs[_0x8fa0('0x4e')](_0x55f053,{'networks':_0x5e6658||[]});fs[_0x8fa0('0x49')]('/etc/asterisk/turn_xcally.conf',_0x36d555);return respondWithRpcPromise('Reload',_0x8fa0('0x56'),{'module':_0x8fa0('0x54')});}else{var _0x11014a=fs[_0x8fa0('0x44')](path['join'](config[_0x8fa0('0x46')],_0x8fa0('0x50')),_0x8fa0('0x48'));var _0x3cc391=ejs[_0x8fa0('0x4e')](_0x11014a,{'networks':_0x5e6658||[]});fs['writeFileSync'](util[_0x8fa0('0x51')]('/etc/asterisk/sip_xcally_%s.conf',_0x47163c[_0x8fa0('0x26')]['toLowerCase']()),_0x3cc391);return respondWithRpcPromise(_0x8fa0('0x4b'),_0x8fa0('0x56'),{'module':_0x8fa0('0x55')});}})[_0x8fa0('0x15')](handleError(_0x5c3328,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8aea07e..91329f1 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 _0x0565=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51d39f,_0x926583){var _0x2f25d2=function(_0x2a40f1){while(--_0x2a40f1){_0x51d39f['push'](_0x51d39f['shift']());}};_0x2f25d2(++_0x926583);}(_0x0565,0xf2));var _0x5056=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x0565[_0x576170];return _0x397c70;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var rp=require(_0x5056('0x6'));var fs=require('fs');var path=require(_0x5056('0x7'));var rimraf=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var attributes=require('./network.attributes');module[_0x5056('0xa')]=function(_0x105ea8,_0x1143df){return _0x105ea8[_0x5056('0xb')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad95=['../../config/environment','define','Network','network','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x3169cd,_0x1249f6){var _0x48f29c=function(_0x3b973f){while(--_0x3b973f){_0x3169cd['push'](_0x3169cd['shift']());}};_0x48f29c(++_0x1249f6);}(_0xad95,0x70));var _0x5ad9=function(_0x18cb3b,_0x421576){_0x18cb3b=_0x18cb3b-0x0;var _0x23d7ae=_0xad95[_0x18cb3b];return _0x23d7ae;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var logger=require(_0x5ad9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ad9('0x3'));var rp=require(_0x5ad9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ad9('0x5'));var attributes=require('./network.attributes');module['exports']=function(_0x5e4279,_0x5b81f9){return _0x5e4279[_0x5ad9('0x6')](_0x5ad9('0x7'),attributes,{'tableName':_0x5ad9('0x8'),'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 4e2a263..04320d2 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0xa4097e,_0x2e44fd){_0xa4097e=_0xa4097e-0x0;var _0x50007f=_0x7a54[_0xa4097e];return _0x50007f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x43af4e,_0x1b63de){var _0x45cb11=function(_0x270b7c){while(--_0x270b7c){_0x43af4e['push'](_0x43af4e['shift']());}};_0x45cb11(++_0x1b63de);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2d66d8c..f77976e 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 _0x1d66=['post','create','/:id/canned_answers','addAnswer','notify','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1d66,0x148));var _0x61d6=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1d66[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x61d6('0x0'));var util=require('util');var path=require(_0x61d6('0x1'));var timeout=require(_0x61d6('0x2'));var express=require(_0x61d6('0x3'));var router=express['Router']();var fs_extra=require(_0x61d6('0x4'));var auth=require(_0x61d6('0x5'));var interaction=require(_0x61d6('0x6'));var config=require('../../config/environment');var controller=require(_0x61d6('0x7'));router[_0x61d6('0x8')]('/',auth[_0x61d6('0x9')](),controller[_0x61d6('0xa')]);router[_0x61d6('0x8')](_0x61d6('0xb'),auth[_0x61d6('0x9')](),controller[_0x61d6('0xc')]);router[_0x61d6('0x8')](_0x61d6('0xd'),auth[_0x61d6('0x9')](),controller[_0x61d6('0xe')]);router[_0x61d6('0x8')](_0x61d6('0xf'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x10')]);router['get']('/:id/canned_answers',auth[_0x61d6('0x9')](),controller[_0x61d6('0x11')]);router[_0x61d6('0x8')](_0x61d6('0x12'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x13')]);router[_0x61d6('0x8')](_0x61d6('0x14'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x15')]);router[_0x61d6('0x8')]('/:id/users',auth[_0x61d6('0x9')](),controller[_0x61d6('0x16')]);router[_0x61d6('0x17')]('/',auth[_0x61d6('0x9')](),controller[_0x61d6('0x18')]);router[_0x61d6('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x61d6('0x17')](_0x61d6('0x19'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x1a')]);router[_0x61d6('0x17')]('/:id/notify',controller[_0x61d6('0x1b')]);router[_0x61d6('0x17')](_0x61d6('0x12'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x1c')]);router[_0x61d6('0x17')](_0x61d6('0x1d'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x1e')]);router[_0x61d6('0x17')](_0x61d6('0x1f'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x20')]);router['put'](_0x61d6('0xd'),auth['isAuthenticated'](),controller[_0x61d6('0x21')]);router[_0x61d6('0x22')](_0x61d6('0xd'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x23')]);router['delete'](_0x61d6('0xf'),auth[_0x61d6('0x9')](),controller['removeDispositions']);router['delete'](_0x61d6('0x19'),auth[_0x61d6('0x9')](),controller[_0x61d6('0x24')]);router[_0x61d6('0x22')](_0x61d6('0x1d'),auth['isAuthenticated'](),controller[_0x61d6('0x25')]);module[_0x61d6('0x26')]=router; \ No newline at end of file +var _0x0bba=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util'];(function(_0x420155,_0x4206a0){var _0x491e3d=function(_0x20a70b){while(--_0x20a70b){_0x420155['push'](_0x420155['shift']());}};_0x491e3d(++_0x4206a0);}(_0x0bba,0x198));var _0xa0bb=function(_0xf3214a,_0x4dbbcc){_0xf3214a=_0xf3214a-0x0;var _0x49d75f=_0x0bba[_0xf3214a];return _0x49d75f;};'use strict';var multer=require(_0xa0bb('0x0'));var util=require(_0xa0bb('0x1'));var path=require('path');var timeout=require(_0xa0bb('0x2'));var express=require(_0xa0bb('0x3'));var router=express[_0xa0bb('0x4')]();var fs_extra=require(_0xa0bb('0x5'));var auth=require(_0xa0bb('0x6'));var interaction=require(_0xa0bb('0x7'));var config=require(_0xa0bb('0x8'));var controller=require(_0xa0bb('0x9'));router[_0xa0bb('0xa')]('/',auth[_0xa0bb('0xb')](),controller[_0xa0bb('0xc')]);router['get'](_0xa0bb('0xd'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0xe')]);router['get'](_0xa0bb('0xf'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x10')]);router[_0xa0bb('0xa')](_0xa0bb('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xa0bb('0xa')](_0xa0bb('0x12'),auth['isAuthenticated'](),controller[_0xa0bb('0x13')]);router['get'](_0xa0bb('0x14'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x15')]);router[_0xa0bb('0xa')](_0xa0bb('0x16'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x17')]);router[_0xa0bb('0xa')](_0xa0bb('0x18'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x19')]);router['post']('/',auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x1a')]);router[_0xa0bb('0x1b')](_0xa0bb('0x11'),auth['isAuthenticated'](),controller[_0xa0bb('0x1c')]);router[_0xa0bb('0x1b')](_0xa0bb('0x12'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x1d')]);router[_0xa0bb('0x1b')](_0xa0bb('0x1e'),controller[_0xa0bb('0x1f')]);router[_0xa0bb('0x1b')](_0xa0bb('0x14'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x20')]);router[_0xa0bb('0x1b')]('/:id/users',auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x21')]);router[_0xa0bb('0x1b')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xa0bb('0x22')](_0xa0bb('0xf'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x23')]);router[_0xa0bb('0x24')]('/:id',auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x25')]);router['delete'](_0xa0bb('0x11'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x26')]);router[_0xa0bb('0x24')](_0xa0bb('0x12'),auth[_0xa0bb('0xb')](),controller[_0xa0bb('0x27')]);router[_0xa0bb('0x24')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xa0bb('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 439efe1..4b3a9fc 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 _0x9487=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x586c70,_0x5b5294){var _0x1fd79d=function(_0x18a928){while(--_0x18a928){_0x586c70['push'](_0x586c70['shift']());}};_0x1fd79d(++_0x5b5294);}(_0x9487,0x16d));var _0x7948=function(_0x2eabb4,_0x49fd57){_0x2eabb4=_0x2eabb4-0x0;var _0x43b45b=_0x9487[_0x2eabb4];return _0x43b45b;};'use strict';var Sequelize=require(_0x7948('0x0'));var rs=require(_0x7948('0x1'));module[_0x7948('0x2')]={'name':{'type':Sequelize[_0x7948('0x3')],'unique':_0x7948('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x7948('0x3')]},'token':{'type':Sequelize[_0x7948('0x3')],'defaultValue':function(){return rs[_0x7948('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7948('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7948('0x6')],'defaultValue':function(){return _0x7948('0x7');}},'notificationSound':{'type':Sequelize[_0x7948('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7948('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7948('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7948('0x3')]},'queueTransfer':{'type':Sequelize[_0x7948('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7948('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7948('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x7948('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x7948('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x37da09){if(!_0x37da09)this[_0x7948('0xb')]('mandatoryDispositionPauseId',null);this[_0x7948('0xb')](_0x7948('0xc'),_0x37da09);}}}; \ No newline at end of file +var _0x257f=['exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x55539f,_0x20870e){var _0x4b8110=function(_0x214c2f){while(--_0x214c2f){_0x55539f['push'](_0x55539f['shift']());}};_0x4b8110(++_0x20870e);}(_0x257f,0x12b));var _0xf257=function(_0x30804e,_0x39fa22){_0x30804e=_0x30804e-0x0;var _0x30e639=_0x257f[_0x30804e];return _0x30e639;};'use strict';var Sequelize=require(_0xf257('0x0'));var rs=require('randomstring');module[_0xf257('0x1')]={'name':{'type':Sequelize[_0xf257('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf257('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf257('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf257('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf257('0x4');}},'notificationSound':{'type':Sequelize[_0xf257('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf257('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf257('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf257('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf257('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xf257('0x5')],'defaultValue':![],'comment':_0xf257('0x8'),'set':function(_0x557d86){if(!_0x557d86)this[_0xf257('0x9')](_0xf257('0xa'),null);this['setDataValue'](_0xf257('0xb'),_0x557d86);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index cb186bb..4987de1 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 _0x8eeb=['DESC','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','Pause','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','body','describe','addDisposition','Disposition','findOne','pick','OpenchannelAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','CmContact','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','getAgents'];(function(_0x48580a,_0x363915){var _0x474421=function(_0x2c5b40){while(--_0x2c5b40){_0x48580a['push'](_0x48580a['shift']());}};_0x474421(++_0x363915);}(_0x8eeb,0x183));var _0xb8ee=function(_0x125219,_0x24ea79){_0x125219=_0x125219-0x0;var _0x4d0664=_0x8eeb[_0x125219];return _0x4d0664;};'use strict';var emlformat=require(_0xb8ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8ee('0x1'));var jsonpatch=require(_0xb8ee('0x2'));var rp=require('request-promise');var moment=require(_0xb8ee('0x3'));var BPromise=require(_0xb8ee('0x4'));var Mustache=require(_0xb8ee('0x5'));var util=require(_0xb8ee('0x6'));var path=require(_0xb8ee('0x7'));var sox=require('sox');var csv=require(_0xb8ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8ee('0x9'));var _=require(_0xb8ee('0xa'));var squel=require(_0xb8ee('0xb'));var crypto=require(_0xb8ee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb8ee('0xd'));var toCsv=require(_0xb8ee('0x8'));var querystring=require(_0xb8ee('0xe'));var Papa=require('papaparse');var Redis=require(_0xb8ee('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8ee('0x10'));var as=require(_0xb8ee('0x11'));var hardwareService=require(_0xb8ee('0x12'));var logger=require(_0xb8ee('0x13'))(_0xb8ee('0x14'));var utils=require(_0xb8ee('0x15'));var config=require(_0xb8ee('0x16'));var licenseUtil=require(_0xb8ee('0x17'));var db=require('../../mysqldb')['db'];config[_0xb8ee('0x18')]=_[_0xb8ee('0x19')](config[_0xb8ee('0x18')],{'host':_0xb8ee('0x1a'),'port':0x18eb});var socket=require(_0xb8ee('0x1b'))(new Redis(config[_0xb8ee('0x18')]));require('./openchannelAccount.socket')[_0xb8ee('0x1c')](socket);var jayson=require(_0xb8ee('0x1d'));var client=jayson[_0xb8ee('0x1e')][_0xb8ee('0x1f')]({'port':0x232c});var client9002=jayson[_0xb8ee('0x1e')][_0xb8ee('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x22b97b,_0x13b79c,_0x40be2d,_0x5a3f29){return new BPromise(function(_0x135d5d,_0x4e154d){var _0x5d382f=_0x5a3f29||client;return _0x5d382f[_0xb8ee('0x20')](_0x22b97b,_0x40be2d)[_0xb8ee('0x21')](function(_0x4d9a82){logger[_0xb8ee('0x22')](_0xb8ee('0x23'),_0x13b79c,'request\x20sent');logger[_0xb8ee('0x24')](_0xb8ee('0x25'),_0x13b79c,_0xb8ee('0x26'),JSON['stringify'](_0x4d9a82));if(_0x4d9a82[_0xb8ee('0x27')]){if(_0x4d9a82[_0xb8ee('0x27')][_0xb8ee('0x28')]===0x1f4){logger[_0xb8ee('0x27')](_0xb8ee('0x23'),_0x13b79c,_0x4d9a82['error'][_0xb8ee('0x29')]);return _0x4e154d(_0x4d9a82['error'][_0xb8ee('0x29')]);}logger[_0xb8ee('0x27')](_0xb8ee('0x23'),_0x13b79c,_0x4d9a82[_0xb8ee('0x27')][_0xb8ee('0x29')]);return _0x135d5d(_0x4d9a82[_0xb8ee('0x27')][_0xb8ee('0x29')]);}else{logger[_0xb8ee('0x22')](_0xb8ee('0x23'),_0x13b79c,_0xb8ee('0x26'));_0x135d5d(_0x4d9a82['result'][_0xb8ee('0x29')]);}})['catch'](function(_0x5d1218){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x13b79c,_0x5d1218);_0x4e154d(_0x5d1218);});});}function respondWithStatusCode(_0x2c5bd1,_0x47236a){_0x47236a=_0x47236a||0xcc;return function(_0x23ecd3){if(_0x23ecd3){return _0x2c5bd1[_0xb8ee('0x2a')](_0x47236a);}return _0x2c5bd1[_0xb8ee('0x2b')](_0x47236a)[_0xb8ee('0x2c')]();};}function respondWithResult(_0x1ac4e1,_0x295670){_0x295670=_0x295670||0xc8;return function(_0x4c5b3a){if(_0x4c5b3a){return _0x1ac4e1[_0xb8ee('0x2b')](_0x295670)[_0xb8ee('0x2d')](_0x4c5b3a);}};}function respondWithFilteredResult(_0x4500b7,_0x1f58a3){return function(_0x5af703){if(_0x5af703){var _0x35e844=typeof _0x1f58a3[_0xb8ee('0x2e')]==='undefined'&&typeof _0x1f58a3[_0xb8ee('0x2f')]===_0xb8ee('0x30');var _0x47d405=_0x5af703[_0xb8ee('0x31')];var _0x14a320=_0x35e844?0x0:_0x1f58a3[_0xb8ee('0x2e')];var _0x48715d=_0x35e844?_0x5af703[_0xb8ee('0x31')]:_0x1f58a3[_0xb8ee('0x2e')]+_0x1f58a3[_0xb8ee('0x2f')];var _0x57a4e6;if(_0x48715d>=_0x47d405){_0x48715d=_0x47d405;_0x57a4e6=0xc8;}else{_0x57a4e6=0xce;}_0x4500b7['status'](_0x57a4e6);return _0x4500b7[_0xb8ee('0x32')](_0xb8ee('0x33'),_0x14a320+'-'+_0x48715d+'/'+_0x47d405)['json'](_0x5af703);}return null;};}function patchUpdates(_0x22c46c){return function(_0x5589ed){try{jsonpatch[_0xb8ee('0x34')](_0x5589ed,_0x22c46c,!![]);}catch(_0x5da6d9){return BPromise[_0xb8ee('0x35')](_0x5da6d9);}return _0x5589ed[_0xb8ee('0x36')]();};}function saveUpdates(_0xb53334,_0x17b1ff){return function(_0x3d4c9d){if(_0x3d4c9d){return _0x3d4c9d['update'](_0xb53334)['then'](function(_0x3e1c77){return _0x3e1c77;});}return null;};}function removeEntity(_0x29333f,_0x2eadf6){return function(_0x37293b){if(_0x37293b){return _0x37293b[_0xb8ee('0x37')]()[_0xb8ee('0x21')](function(){var _0x46fb4f=_0x37293b[_0xb8ee('0x38')]({'plain':!![]});var _0xff20d2=_0xb8ee('0x39');return db[_0xb8ee('0x3a')][_0xb8ee('0x37')]({'where':{'type':_0xff20d2,'resourceId':_0x46fb4f['id']}})[_0xb8ee('0x21')](function(){return _0x37293b;});})[_0xb8ee('0x21')](function(){_0x29333f[_0xb8ee('0x2b')](0xcc)[_0xb8ee('0x2c')]();});}};}function handleEntityNotFound(_0x22b89a,_0x3c6324){return function(_0x4aaafe){if(!_0x4aaafe){_0x22b89a[_0xb8ee('0x2a')](0x194);}return _0x4aaafe;};}function handleError(_0x22042f,_0x22b68a){_0x22b68a=_0x22b68a||0x1f4;return function(_0x268b49){logger[_0xb8ee('0x27')](_0x268b49[_0xb8ee('0x3b')]);if(_0x268b49['name']){delete _0x268b49[_0xb8ee('0x3c')];}_0x22042f['status'](_0x22b68a)[_0xb8ee('0x3d')](_0x268b49);};}exports[_0xb8ee('0x3e')]=function(_0xe8ae38,_0x168534){var _0x343bb1={'include':[{'model':db['Pause'],'as':_0xb8ee('0x3f')}]},_0x50aeaf={},_0x53a84f={'count':0x0,'rows':[]};var _0x46c3f0=_['map'](db[_0xb8ee('0x40')][_0xb8ee('0x41')],function(_0x5ce2ab){return{'name':_0x5ce2ab[_0xb8ee('0x42')],'type':_0x5ce2ab['type'][_0xb8ee('0x43')]};});_0x50aeaf[_0xb8ee('0x44')]=_[_0xb8ee('0x45')](_0x46c3f0,'name');_0x50aeaf[_0xb8ee('0x46')]=_[_0xb8ee('0x47')](_0xe8ae38[_0xb8ee('0x46')]);_0x50aeaf['filters']=_['intersection'](_0x50aeaf['model'],_0x50aeaf[_0xb8ee('0x46')]);_0x343bb1[_0xb8ee('0x48')]=_['intersection'](_0x50aeaf[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0xe8ae38[_0xb8ee('0x46')]['fields']));_0x343bb1[_0xb8ee('0x48')]=_0x343bb1[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x343bb1[_0xb8ee('0x48')]:_0x50aeaf[_0xb8ee('0x44')];if(!_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x343bb1[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x2f')]);_0x343bb1['offset']=qs[_0xb8ee('0x2e')](_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x343bb1[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0xe8ae38[_0xb8ee('0x46')]['sort']);_0x343bb1[_0xb8ee('0x4f')]=qs[_0xb8ee('0x50')](_['pick'](_0xe8ae38[_0xb8ee('0x46')],_0x50aeaf['filters']),_0x46c3f0);if(_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x51')]){_0x343bb1['where']=_[_0xb8ee('0x52')](_0x343bb1[_0xb8ee('0x4f')],{'$or':_[_0xb8ee('0x45')](_0x46c3f0,function(_0x1f1f9c){if(_0x1f1f9c[_0xb8ee('0x53')]!==_0xb8ee('0x54')){var _0x5946e3={};_0x5946e3[_0x1f1f9c[_0xb8ee('0x3c')]]={'$like':'%'+_0xe8ae38[_0xb8ee('0x46')][_0xb8ee('0x51')]+'%'};return _0x5946e3;}})});}_0x343bb1=_[_0xb8ee('0x52')]({},_0x343bb1,_0xe8ae38[_0xb8ee('0x55')]);var _0x58123d={'where':_0x343bb1[_0xb8ee('0x4f')]};return db[_0xb8ee('0x40')][_0xb8ee('0x31')](_0x58123d)[_0xb8ee('0x21')](function(_0x1e3b4e){_0x53a84f[_0xb8ee('0x31')]=_0x1e3b4e;if(_0xe8ae38[_0xb8ee('0x46')]['includeAll']){_0x343bb1[_0xb8ee('0x56')]=[{'all':!![]}];}return db[_0xb8ee('0x40')][_0xb8ee('0x57')](_0x343bb1);})[_0xb8ee('0x21')](function(_0x315336){_0x53a84f[_0xb8ee('0x58')]=_0x315336;return _0x53a84f;})['then'](respondWithFilteredResult(_0x168534,_0x343bb1))[_0xb8ee('0x59')](handleError(_0x168534,null));};exports[_0xb8ee('0x5a')]=function(_0x2e9803,_0x329358){var _0x30bca7={'raw':![],'where':{'id':_0x2e9803[_0xb8ee('0x5b')]['id']},'include':[{'model':db[_0xb8ee('0x5c')],'as':_0xb8ee('0x3f')}]},_0x39d9c2={};_0x39d9c2['model']=_['keys'](db[_0xb8ee('0x40')]['rawAttributes']);_0x39d9c2['query']=_['keys'](_0x2e9803[_0xb8ee('0x46')]);_0x39d9c2[_0xb8ee('0x50')]=_[_0xb8ee('0x5d')](_0x39d9c2['model'],_0x39d9c2[_0xb8ee('0x46')]);_0x30bca7[_0xb8ee('0x48')]=_[_0xb8ee('0x5d')](_0x39d9c2[_0xb8ee('0x44')],qs['fields'](_0x2e9803[_0xb8ee('0x46')]['fields']));_0x30bca7['attributes']=_0x30bca7[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x30bca7[_0xb8ee('0x48')]:_0x39d9c2[_0xb8ee('0x44')];if(_0x2e9803['query']['includeAll']){_0x30bca7[_0xb8ee('0x56')]=[{'all':!![]}];}_0x30bca7=_[_0xb8ee('0x52')]({},_0x30bca7,_0x2e9803[_0xb8ee('0x55')]);return db[_0xb8ee('0x40')][_0xb8ee('0x5e')](_0x30bca7)[_0xb8ee('0x21')](handleEntityNotFound(_0x329358,null))[_0xb8ee('0x21')](respondWithResult(_0x329358,null))[_0xb8ee('0x59')](handleError(_0x329358,null));};exports[_0xb8ee('0x5f')]=function(_0x49a544,_0x529f92){return db['OpenchannelAccount'][_0xb8ee('0x5f')](_0x49a544['body'],{})[_0xb8ee('0x21')](function(_0x4d8173){var _0x163277=_0x49a544[_0xb8ee('0x60')]['get']({'plain':!![]});if(!_0x163277)throw new Error(_0xb8ee('0x61'));if(_0x163277[_0xb8ee('0x62')]===_0xb8ee('0x60')){var _0x3c2a44=_0x4d8173['get']({'plain':!![]});var _0x157cdd=_0xb8ee('0x39');return db['UserProfileSection'][_0xb8ee('0x5e')]({'where':{'name':_0x157cdd,'userProfileId':_0x163277[_0xb8ee('0x63')]},'raw':!![]})[_0xb8ee('0x21')](function(_0xd47a77){if(_0xd47a77&&_0xd47a77[_0xb8ee('0x64')]===0x0){return db['UserProfileResource'][_0xb8ee('0x5f')]({'name':_0x3c2a44['name'],'resourceId':_0x3c2a44['id'],'type':_0xd47a77[_0xb8ee('0x3c')],'sectionId':_0xd47a77['id']},{})[_0xb8ee('0x21')](function(){return _0x4d8173;});}else{return _0x4d8173;}})[_0xb8ee('0x59')](function(_0x455649){logger[_0xb8ee('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x455649);throw _0x455649;});}return _0x4d8173;})[_0xb8ee('0x21')](respondWithResult(_0x529f92,0xc9))[_0xb8ee('0x59')](handleError(_0x529f92,null));};exports[_0xb8ee('0x65')]=function(_0x1d3684,_0xf135ac){if(_0x1d3684['body']['id']){delete _0x1d3684[_0xb8ee('0x66')]['id'];}return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x1d3684[_0xb8ee('0x5b')]['id']},'include':[{'model':db[_0xb8ee('0x5c')],'as':'mandatoryDispositionPause'}]})[_0xb8ee('0x21')](handleEntityNotFound(_0xf135ac,null))['then'](saveUpdates(_0x1d3684[_0xb8ee('0x66')],null))[_0xb8ee('0x21')](respondWithResult(_0xf135ac,null))[_0xb8ee('0x59')](handleError(_0xf135ac,null));};exports[_0xb8ee('0x37')]=function(_0x2eec61,_0x5eeb11){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x2eec61[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x5eeb11,null))[_0xb8ee('0x21')](removeEntity(_0x5eeb11,null))[_0xb8ee('0x59')](handleError(_0x5eeb11,null));};exports[_0xb8ee('0x67')]=function(_0x3dbb0c,_0x40c1ec){return db['OpenchannelAccount'][_0xb8ee('0x67')]()[_0xb8ee('0x21')](respondWithResult(_0x40c1ec,null))[_0xb8ee('0x59')](handleError(_0x40c1ec,null));};exports[_0xb8ee('0x68')]=function(_0x487e57,_0x5a3c32,_0x5c5331){if(_0x487e57[_0xb8ee('0x66')]['id']){delete _0x487e57[_0xb8ee('0x66')]['id'];}return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x487e57[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5a3c32,null))[_0xb8ee('0x21')](function(_0x6995e1){if(_0x6995e1){_0x487e57['body']['OpenchannelAccountId']=_0x6995e1['id'];return db[_0xb8ee('0x69')][_0xb8ee('0x5f')](_0x487e57[_0xb8ee('0x66')]);}})[_0xb8ee('0x21')](respondWithResult(_0x5a3c32,null))[_0xb8ee('0x59')](handleError(_0x5a3c32,null));};exports['getDispositions']=function(_0x2fdc36,_0x48da30,_0x45f939){var _0x188895={'raw':![],'where':{}};var _0x2251ae={};var _0x9d79f1={'count':0x0,'rows':[]};return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0x2fdc36[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x48da30,null))['then'](function(_0x287724){if(_0x287724){_0x2251ae[_0xb8ee('0x44')]=_[_0xb8ee('0x47')](db[_0xb8ee('0x69')][_0xb8ee('0x41')]);_0x2251ae[_0xb8ee('0x46')]=_[_0xb8ee('0x47')](_0x2fdc36[_0xb8ee('0x46')]);_0x2251ae['filters']=_['intersection'](_0x2251ae[_0xb8ee('0x44')],_0x2251ae['query']);_0x188895[_0xb8ee('0x48')]=_[_0xb8ee('0x5d')](_0x2251ae[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0x2fdc36[_0xb8ee('0x46')]['fields']));_0x188895[_0xb8ee('0x48')]=_0x188895[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x188895[_0xb8ee('0x48')]:_0x2251ae[_0xb8ee('0x44')];if(!_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x188895[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x2fdc36[_0xb8ee('0x46')]['limit']);_0x188895[_0xb8ee('0x2e')]=qs[_0xb8ee('0x2e')](_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x188895[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0x2fdc36['query'][_0xb8ee('0x4e')]);_0x188895[_0xb8ee('0x4f')]=qs['filters'](_[_0xb8ee('0x6b')](_0x2fdc36[_0xb8ee('0x46')],_0x2251ae[_0xb8ee('0x50')]));_0x188895['where'][_0xb8ee('0x6c')]=_0x287724['id'];if(_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x51')]){_0x188895[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x188895['where'],{'$or':_[_0xb8ee('0x45')](_0x188895[_0xb8ee('0x48')],function(_0x576351){var _0x6bd8={};_0x6bd8[_0x576351]={'$like':'%'+_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x51')]+'%'};return _0x6bd8;})});}_0x188895=_[_0xb8ee('0x52')]({},_0x188895,_0x2fdc36[_0xb8ee('0x55')]);return db[_0xb8ee('0x69')][_0xb8ee('0x31')]({'where':_0x188895[_0xb8ee('0x4f')]})[_0xb8ee('0x21')](function(_0x20a8da){_0x9d79f1['count']=_0x20a8da;if(_0x2fdc36[_0xb8ee('0x46')][_0xb8ee('0x6d')]){_0x188895[_0xb8ee('0x56')]=[{'all':!![]}];}return db[_0xb8ee('0x69')][_0xb8ee('0x57')](_0x188895);})['then'](function(_0x546f8d){_0x9d79f1[_0xb8ee('0x58')]=_0x546f8d;return _0x9d79f1;});}})[_0xb8ee('0x21')](respondWithFilteredResult(_0x48da30,_0x188895))['catch'](handleError(_0x48da30,null));};exports[_0xb8ee('0x6e')]=function(_0x1836b0,_0x3b9ce5,_0x1364fd){return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x1836b0[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b9ce5,null))[_0xb8ee('0x21')](function(_0x938306){if(_0x938306){return _0x938306[_0xb8ee('0x6e')](_0x1836b0['query'][_0xb8ee('0x6f')]);}})[_0xb8ee('0x21')](respondWithStatusCode(_0x3b9ce5,null))[_0xb8ee('0x59')](handleError(_0x3b9ce5,null));};exports[_0xb8ee('0x70')]=function(_0x25ecd5,_0x4637b8,_0x54379e){if(_0x25ecd5['body']['id']){delete _0x25ecd5[_0xb8ee('0x66')]['id'];}return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x25ecd5['params']['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x4637b8,null))[_0xb8ee('0x21')](function(_0x1ad650){if(_0x1ad650){_0x25ecd5[_0xb8ee('0x66')][_0xb8ee('0x6c')]=_0x1ad650['id'];return db[_0xb8ee('0x71')][_0xb8ee('0x5f')](_0x25ecd5[_0xb8ee('0x66')]);}})[_0xb8ee('0x21')](respondWithResult(_0x4637b8,null))[_0xb8ee('0x59')](handleError(_0x4637b8,null));};exports[_0xb8ee('0x72')]=function(_0x34b9cc,_0x4d70e1,_0x16393b){var _0x2fa782={'raw':![],'where':{}};var _0x5d79c3={};var _0x683742={'count':0x0,'rows':[]};return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0x34b9cc[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d70e1,null))[_0xb8ee('0x21')](function(_0x43fa7d){if(_0x43fa7d){_0x5d79c3[_0xb8ee('0x44')]=_['keys'](db['CannedAnswer'][_0xb8ee('0x41')]);_0x5d79c3[_0xb8ee('0x46')]=_['keys'](_0x34b9cc['query']);_0x5d79c3[_0xb8ee('0x50')]=_['intersection'](_0x5d79c3[_0xb8ee('0x44')],_0x5d79c3[_0xb8ee('0x46')]);_0x2fa782[_0xb8ee('0x48')]=_['intersection'](_0x5d79c3[_0xb8ee('0x44')],qs['fields'](_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x49')]));_0x2fa782[_0xb8ee('0x48')]=_0x2fa782[_0xb8ee('0x48')][_0xb8ee('0x4a')]?_0x2fa782[_0xb8ee('0x48')]:_0x5d79c3[_0xb8ee('0x44')];if(!_0x34b9cc['query']['hasOwnProperty'](_0xb8ee('0x4c'))){_0x2fa782[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x2f')]);_0x2fa782[_0xb8ee('0x2e')]=qs[_0xb8ee('0x2e')](_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x2fa782[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0x34b9cc['query'][_0xb8ee('0x4e')]);_0x2fa782[_0xb8ee('0x4f')]=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x34b9cc[_0xb8ee('0x46')],_0x5d79c3['filters']));_0x2fa782['where'][_0xb8ee('0x6c')]=_0x43fa7d['id'];if(_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x51')]){_0x2fa782[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x2fa782[_0xb8ee('0x4f')],{'$or':_[_0xb8ee('0x45')](_0x2fa782['attributes'],function(_0x31cde5){var _0x4185b9={};_0x4185b9[_0x31cde5]={'$like':'%'+_0x34b9cc[_0xb8ee('0x46')]['filter']+'%'};return _0x4185b9;})});}_0x2fa782=_[_0xb8ee('0x52')]({},_0x2fa782,_0x34b9cc[_0xb8ee('0x55')]);return db['CannedAnswer'][_0xb8ee('0x31')]({'where':_0x2fa782[_0xb8ee('0x4f')]})[_0xb8ee('0x21')](function(_0x57e08b){_0x683742[_0xb8ee('0x31')]=_0x57e08b;if(_0x34b9cc[_0xb8ee('0x46')][_0xb8ee('0x6d')]){_0x2fa782[_0xb8ee('0x56')]=[{'all':!![]}];}return db[_0xb8ee('0x71')]['findAll'](_0x2fa782);})[_0xb8ee('0x21')](function(_0x272633){_0x683742[_0xb8ee('0x58')]=_0x272633;return _0x683742;});}})[_0xb8ee('0x21')](respondWithFilteredResult(_0x4d70e1,_0x2fa782))[_0xb8ee('0x59')](handleError(_0x4d70e1,null));};exports[_0xb8ee('0x73')]=function(_0x4c1d84,_0x5d68b5,_0x140181){return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x4c1d84[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d68b5,null))[_0xb8ee('0x21')](function(_0x18653f){if(_0x18653f){return _0x18653f[_0xb8ee('0x73')](_0x4c1d84['query'][_0xb8ee('0x6f')]);}})[_0xb8ee('0x21')](respondWithStatusCode(_0x5d68b5,null))[_0xb8ee('0x59')](handleError(_0x5d68b5,null));};exports['notify']=function(_0x26f2a6,_0x48d5f6,_0x138699){var _0x504d52={'body':_0x26f2a6[_0xb8ee('0x66')],'channel':'openchannel'};var _0x4b62ad=[];var _0x590222=[];var _0x84ea65={};var _0x3e574e=![];return db[_0xb8ee('0x74')][_0xb8ee('0x67')]()[_0xb8ee('0x21')](function(_0x335057){if(!_0x335057){throw new db['Sequelize'][(_0xb8ee('0x75'))](_0xb8ee('0x76'));}_0x4b62ad=_['difference'](_[_0xb8ee('0x47')](_0x335057),[_0xb8ee('0x77'),'updatedAt']);_0x590222=_[_0xb8ee('0x78')](_[_0xb8ee('0x47')](_0x335057),['createdAt',_0xb8ee('0x79'),'CompanyId',_0xb8ee('0x7a')]);if(_0x26f2a6['body']['id']){delete _0x26f2a6['body']['id'];}if(_[_0xb8ee('0x7b')](_0x26f2a6['body'][_0xb8ee('0x7c')])){throw new db['Sequelize'][(_0xb8ee('0x75'))](_0xb8ee('0x7d'));}if(_[_0xb8ee('0x7b')](_0x26f2a6['body'][_0xb8ee('0x66')])||_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x66')]===''){throw new db[(_0xb8ee('0x7e'))][(_0xb8ee('0x75'))](_0xb8ee('0x7f'));}if(_[_0xb8ee('0x7b')](_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x80')])){throw new db[(_0xb8ee('0x7e'))][(_0xb8ee('0x75'))](_0xb8ee('0x81')+_0x590222);}if(!_['includes'](_0x590222,_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x80')])){throw new db['Sequelize'][(_0xb8ee('0x75'))](_0xb8ee('0x82')+_0x590222);}_0x84ea65[_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x80')]]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x7c')];})['then'](function(){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x26f2a6[_0xb8ee('0x5b')]['id']},'include':[{'model':db[_0xb8ee('0x83')],'as':_0xb8ee('0x84'),'include':[{'model':db[_0xb8ee('0x74')],'as':_0xb8ee('0x85'),'where':_0x84ea65,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xb8ee('0x86')],'as':_0xb8ee('0x87')}]});})['then'](handleEntityNotFound(_0x48d5f6,null))[_0xb8ee('0x21')](function(_0x116170){if(_0x116170&&_0x116170[_0xb8ee('0x84')]){_0x504d52[_0xb8ee('0x88')]=_0x116170;_0x504d52[_0xb8ee('0x89')]=_0x116170[_0xb8ee('0x87')];_0x504d52[_0xb8ee('0x8a')]=_0x116170['List'];_0x504d52['applications']=_[_0xb8ee('0x8b')](_0x504d52[_0xb8ee('0x89')],[_0xb8ee('0x8c')],[_0xb8ee('0x8d')]);if(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0x87')]){delete _0x504d52['account'][_0xb8ee('0x87')];}if(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0x84')]&&_0x504d52['account']['List'][_0xb8ee('0x85')][_0xb8ee('0x4a')]){return _0x504d52[_0xb8ee('0x88')]['List'][_0xb8ee('0x85')][0x0];}var _0x3c0caa=_[_0xb8ee('0x19')](_0x26f2a6['body'],{'firstName':_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x7c')],'ListId':_0x116170[_0xb8ee('0x7a')]});_0x3c0caa[_0x26f2a6[_0xb8ee('0x66')]['mapKey']]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x7c')];return db[_0xb8ee('0x74')]['create'](_0x3c0caa,{'fields':_0x4b62ad,'raw':!![]});}})[_0xb8ee('0x21')](handleEntityNotFound(_0x48d5f6,null))['then'](function(_0x139e67){_0x504d52[_0xb8ee('0x8e')]=_0x139e67;if(_0x139e67){var _0x1431c7={'ContactId':_0x139e67['id'],'OpenchannelAccountId':_0x26f2a6[_0xb8ee('0x5b')]['id'],'from':(_0x139e67[_0xb8ee('0x8f')]||'')+'\x20'+(_0x139e67[_0xb8ee('0x90')]||'')};var _0x20ded6={'OpenchannelAccountId':_0x26f2a6['params']['id'],'closed':![]};if(_0x26f2a6[_0xb8ee('0x66')]['threadId']){_0x20ded6[_0xb8ee('0x91')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')];return db['OpenchannelInteraction']['find']({'where':_0x20ded6})['then'](function(_0x4076f8){if(_0x4076f8){return[_0x4076f8,![]];}_0x1431c7[_0xb8ee('0x91')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')];_0x1431c7[_0xb8ee('0x92')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x92')];return db[_0xb8ee('0x93')][_0xb8ee('0x5f')](_0x1431c7)[_0xb8ee('0x21')](function(_0x457a25){return[_0x457a25,!![]];});});}else{_0x20ded6['threadId']=null;}_0x20ded6[_0xb8ee('0x94')]=_0x139e67['id'];return db[_0xb8ee('0x93')][_0xb8ee('0x5e')]({'where':_0x20ded6})['then'](function(_0x156a57){if(_0x156a57){return[_0x156a57,![]];}return db[_0xb8ee('0x93')][_0xb8ee('0x5f')](_0x1431c7)[_0xb8ee('0x21')](function(_0x555aeb){return[_0x555aeb,!![]];});});}})[_0xb8ee('0x95')](function(_0xf2a7f6,_0x51295f){if(_0xf2a7f6){_0x3e574e=_0x51295f;if(!_0x51295f){var _0x337191={'from':(_0x504d52[_0xb8ee('0x8e')][_0xb8ee('0x8f')]||'')+'\x20'+(_0x504d52[_0xb8ee('0x8e')][_0xb8ee('0x90')]||'')};if(_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')]&&_0x26f2a6['body'][_0xb8ee('0x96')]&&_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x91')]!=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x96')]){_0x337191[_0xb8ee('0x91')]=_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x96')];}return _0xf2a7f6[_0xb8ee('0x65')](_0x337191);}else{return _0xf2a7f6;}}})['then'](function(_0x5de41a){_0x504d52[_0xb8ee('0x97')]=_0x5de41a[_0xb8ee('0x38')]({'plain':!![]});_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x98')]=_0x3e574e;if(_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x98')]){if(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0x99')]){_0x504d52[_0xb8ee('0x89')][_0xb8ee('0x9a')]({'id':0x0,'priority':_0x504d52[_0xb8ee('0x89')][_0xb8ee('0x4a')]+0x1,'app':'close','appdata':_0xb8ee('0x9b'),'interval':_0xb8ee('0x9c')});}}return db[_0xb8ee('0x9d')]['create']({'body':_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x66')],'OpenchannelAccountId':_0x26f2a6[_0xb8ee('0x5b')]['id'],'OpenchannelInteractionId':_0x5de41a['id'],'direction':'in','ContactId':_0x504d52[_0xb8ee('0x8e')]['id'],'AttachmentId':_0x26f2a6[_0xb8ee('0x66')][_0xb8ee('0x9e')]});})[_0xb8ee('0x21')](function(_0x2e3233){_0x504d52[_0xb8ee('0x29')]=_0x2e3233;if(_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x9f')]){return db[_0xb8ee('0xa0')][_0xb8ee('0x5e')]({'attributes':['id',_0xb8ee('0x3c')],'where':{'id':_0x504d52[_0xb8ee('0x97')][_0xb8ee('0x9f')]}})[_0xb8ee('0x21')](function(_0x235aa1){if(_0x235aa1){_0x504d52[_0xb8ee('0x89')][_0xb8ee('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x235aa1[_0xb8ee('0x3c')]+','+(_0x504d52[_0xb8ee('0x88')][_0xb8ee('0xa2')]||0xa),'interval':_0xb8ee('0x9c')});_0x504d52[_0xb8ee('0xa3')]=![];}return respondWithRpcPromise(_0xb8ee('0xa4'),'startRouting',_0x504d52);});}return respondWithRpcPromise(_0xb8ee('0xa4'),_0xb8ee('0xa5'),_0x504d52);})[_0xb8ee('0x21')](function(_0xa1eac6){respondWithRpcPromise(_0xb8ee('0xa6'),'EventManager',{'event':_0xb8ee('0xa7'),'message':_0xa1eac6},client9002);return _0xa1eac6;})[_0xb8ee('0x21')](respondWithResult(_0x48d5f6,null))[_0xb8ee('0x59')](handleError(_0x48d5f6,null));};exports[_0xb8ee('0xa8')]=function(_0x2046dc,_0x58a61b){var _0xf0a12f=_0x2046dc[_0xb8ee('0x5b')]['id'];var _0x118cfb=_0x2046dc['body'];var _0x1f98ef=0xc8;var _0x4a27d0=null;return db[_0xb8ee('0xa9')]['transaction']({'isolationLevel':db[_0xb8ee('0xa9')]['Transaction']['ISOLATION_LEVELS'][_0xb8ee('0xaa')]},function(_0x85eda4){return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0xf0a12f},'transaction':_0x85eda4})[_0xb8ee('0x21')](function(_0x1b3f55){if(_0x1b3f55){return db[_0xb8ee('0x86')][_0xb8ee('0x37')]({'where':{'OpenchannelAccountId':_0xf0a12f},'transaction':_0x85eda4})[_0xb8ee('0x21')](function(){var _0x344655=_[_0xb8ee('0x45')](_0x118cfb,function(_0x4bfd12){_0x4bfd12[_0xb8ee('0x6c')]=_0xf0a12f;return _0x4bfd12;});return db[_0xb8ee('0x86')][_0xb8ee('0xab')](_0x344655,{'transaction':_0x85eda4});});}else{_0x1f98ef=0x194;_0x4a27d0=[];}});})['then'](function(){if(_0x1f98ef!==0x194){return db[_0xb8ee('0x86')][_0xb8ee('0xac')]({'where':{'OpenchannelAccountId':_0xf0a12f},'order':'priority'})[_0xb8ee('0x21')](function(_0x2af66e){_0x4a27d0=_0x2af66e;});}})[_0xb8ee('0x59')](function(_0x2ea540){_0x1f98ef=0x1f4;logger[_0xb8ee('0x27')](_0x2ea540[_0xb8ee('0x3b')]);if(_0x2ea540[_0xb8ee('0x3c')]){delete _0x2ea540[_0xb8ee('0x3c')];}_0x4a27d0=_0x2ea540;})['finally'](function(){if(_0x4a27d0===null){_0x58a61b[_0xb8ee('0x2a')](_0x1f98ef);}else{if(_0x1f98ef===0x1f4){_0x58a61b[_0xb8ee('0x2b')](_0x1f98ef)['send'](_0x4a27d0);}else{_0x58a61b['status'](_0x1f98ef)[_0xb8ee('0x2d')](_0x4a27d0);}}});};exports[_0xb8ee('0xad')]=function(_0x4cd8ea,_0x5d3a7f,_0x254448){var _0x2d4a21={};var _0x18a05a={};var _0x5c355d;var _0x5d2cd0;return db['OpenchannelAccount'][_0xb8ee('0x6a')]({'where':{'id':_0x4cd8ea[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x5d3a7f,null))[_0xb8ee('0x21')](function(_0x3ad7e2){if(_0x3ad7e2){_0x5c355d=_0x3ad7e2;_0x18a05a['model']=_['keys'](db[_0xb8ee('0x86')]['rawAttributes']);_0x18a05a[_0xb8ee('0x46')]=_[_0xb8ee('0x47')](_0x4cd8ea[_0xb8ee('0x46')]);_0x18a05a[_0xb8ee('0x50')]=_[_0xb8ee('0x5d')](_0x18a05a[_0xb8ee('0x44')],_0x18a05a['query']);_0x2d4a21[_0xb8ee('0x48')]=_['intersection'](_0x18a05a[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0x4cd8ea[_0xb8ee('0x46')][_0xb8ee('0x49')]));_0x2d4a21[_0xb8ee('0x48')]=_0x2d4a21['attributes'][_0xb8ee('0x4a')]?_0x2d4a21['attributes']:_0x18a05a[_0xb8ee('0x44')];_0x2d4a21[_0xb8ee('0x4d')]=qs[_0xb8ee('0x4e')](_0x4cd8ea[_0xb8ee('0x46')][_0xb8ee('0x4e')]);_0x2d4a21[_0xb8ee('0x4f')]=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x4cd8ea[_0xb8ee('0x46')],_0x18a05a['filters']));if(_0x4cd8ea['query'][_0xb8ee('0x51')]){_0x2d4a21[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x2d4a21['where'],{'$or':_[_0xb8ee('0x45')](_0x2d4a21[_0xb8ee('0x48')],function(_0x107131){var _0x3187b0={};_0x3187b0[_0x107131]={'$like':'%'+_0x4cd8ea[_0xb8ee('0x46')]['filter']+'%'};return _0x3187b0;})});}_0x2d4a21=_['merge']({},_0x2d4a21,_0x4cd8ea['options']);return _0x5c355d[_0xb8ee('0xad')](_0x2d4a21);}})['then'](function(_0x9a6ad7){if(_0x9a6ad7){_0x5d2cd0=_0x9a6ad7['length'];if(!_0x4cd8ea[_0xb8ee('0x46')][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x2d4a21[_0xb8ee('0x2f')]=qs['limit'](_0x4cd8ea['query'][_0xb8ee('0x2f')]);_0x2d4a21['offset']=qs['offset'](_0x4cd8ea[_0xb8ee('0x46')]['offset']);}return _0x5c355d[_0xb8ee('0xad')](_0x2d4a21);}})['then'](function(_0x5a361c){if(_0x5a361c){return _0x5a361c?{'count':_0x5d2cd0,'rows':_0x5a361c}:null;}})[_0xb8ee('0x21')](respondWithResult(_0x5d3a7f,null))[_0xb8ee('0x59')](handleError(_0x5d3a7f,null));};exports[_0xb8ee('0xae')]=function(_0x2f2495,_0x3cd28c,_0xf1d352){var _0x141aee={'raw':![],'where':{}};var _0x1e6f6e={};var _0x1a00bc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb8ee('0x6a')]({'where':{'id':_0x2f2495[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x3cd28c,null))[_0xb8ee('0x21')](function(_0x177692){if(_0x177692){_0x1e6f6e[_0xb8ee('0x44')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x1e6f6e['query']=_[_0xb8ee('0x47')](_0x2f2495[_0xb8ee('0x46')]);_0x1e6f6e['filters']=_['intersection'](_0x1e6f6e[_0xb8ee('0x44')],_0x1e6f6e['query']);_0x141aee[_0xb8ee('0x48')]=_[_0xb8ee('0x5d')](_0x1e6f6e[_0xb8ee('0x44')],qs[_0xb8ee('0x49')](_0x2f2495[_0xb8ee('0x46')]['fields']));_0x141aee[_0xb8ee('0x48')]=_0x141aee[_0xb8ee('0x48')]['length']?_0x141aee['attributes']:_0x1e6f6e[_0xb8ee('0x44')];if(!_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0x4b')]('nolimit')){_0x141aee[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x2f2495['query'][_0xb8ee('0x2f')]);_0x141aee[_0xb8ee('0x2e')]=qs[_0xb8ee('0x2e')](_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0x2e')]);}_0x141aee[_0xb8ee('0x4d')]=qs['sort'](_0x2f2495[_0xb8ee('0x46')]['sort']);_0x141aee['where']=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x2f2495[_0xb8ee('0x46')],_0x1e6f6e[_0xb8ee('0x50')]));_0x141aee[_0xb8ee('0x4f')][_0xb8ee('0x6c')]=_0x177692['id'];if(_0x2f2495[_0xb8ee('0x46')]['filter']){_0x141aee[_0xb8ee('0x4f')]=_['merge'](_0x141aee[_0xb8ee('0x4f')],{'$or':_['map'](_0x141aee['attributes'],function(_0x75c277){var _0x1db8a6={};_0x1db8a6[_0x75c277]={'$like':'%'+_0x2f2495[_0xb8ee('0x46')]['filter']+'%'};return _0x1db8a6;})});}_0x141aee=_[_0xb8ee('0x52')]({},_0x141aee,_0x2f2495[_0xb8ee('0x55')]);return db['OpenchannelInteraction'][_0xb8ee('0x31')]({'where':_0x141aee[_0xb8ee('0x4f')]})[_0xb8ee('0x21')](function(_0x4914b9){_0x1a00bc[_0xb8ee('0x31')]=_0x4914b9;if(_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0x6d')]){_0x141aee['include']=[{'model':db[_0xb8ee('0x74')],'as':_0xb8ee('0xaf'),'required':![]},{'model':db[_0xb8ee('0xa0')],'as':_0xb8ee('0xb0'),'attributes':[_0xb8ee('0x3c'),_0xb8ee('0xb1'),_0xb8ee('0xb2')],'required':![]},{'model':db['Tag'],'as':_0xb8ee('0xb3'),'attributes':['id','name',_0xb8ee('0xb4')],'where':_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0xb5')]?{'id':_0x2f2495['query']['tag']}:undefined,'required':_0x2f2495[_0xb8ee('0x46')][_0xb8ee('0xb5')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xb8ee('0x57')](_0x141aee);})[_0xb8ee('0x21')](function(_0x59f7b7){_0x1a00bc[_0xb8ee('0x58')]=_0x59f7b7;return _0x1a00bc;});}})[_0xb8ee('0x21')](respondWithFilteredResult(_0x3cd28c,_0x141aee))[_0xb8ee('0x59')](handleError(_0x3cd28c,null));};exports[_0xb8ee('0xb6')]=function(_0x3e67d4,_0x4b7ec4,_0x52d360){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x3e67d4[_0xb8ee('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4b7ec4,null))[_0xb8ee('0x21')](function(_0x419a57){if(_0x419a57){return _0x419a57['addAgents'](_0x3e67d4[_0xb8ee('0x66')][_0xb8ee('0x6f')],_[_0xb8ee('0xb7')](_0x3e67d4['body'],[_0xb8ee('0x6f'),'id'])||{})[_0xb8ee('0x95')](function(_0x5c8b82){for(var _0x492836=0x0;_0x492836<_0x3e67d4['body'][_0xb8ee('0x6f')]['length'];_0x492836+=0x1){socket[_0xb8ee('0xb8')](_0xb8ee('0xb9'),{'UserId':Number(_0x3e67d4[_0xb8ee('0x66')][_0xb8ee('0x6f')][_0x492836]),'OpenchannelAccountId':Number(_0x3e67d4[_0xb8ee('0x5b')]['id'])});}return _0x5c8b82;});}})[_0xb8ee('0x21')](respondWithResult(_0x4b7ec4,null))[_0xb8ee('0x59')](handleError(_0x4b7ec4,null));};exports[_0xb8ee('0xba')]=function(_0x33e20a,_0x27b1ae,_0x45bcc0){return db[_0xb8ee('0x40')][_0xb8ee('0x5e')]({'where':{'id':_0x33e20a['params']['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x27b1ae,null))['then'](function(_0x252fcd){if(_0x252fcd){return _0x252fcd['removeAgents'](_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')])[_0xb8ee('0x21')](function(){if(_[_0xb8ee('0xbb')](_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')])){for(var _0x50eecb=0x0;_0x50eecb<_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')][_0xb8ee('0x4a')];_0x50eecb+=0x1){socket[_0xb8ee('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x33e20a[_0xb8ee('0x46')]['ids'][_0x50eecb]),'OpenchannelAccountId':Number(_0x33e20a[_0xb8ee('0x5b')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x33e20a[_0xb8ee('0x46')][_0xb8ee('0x6f')]),'OpenchannelAccountId':Number(_0x33e20a['params']['id'])});}});}})[_0xb8ee('0x21')](respondWithStatusCode(_0x27b1ae,null))[_0xb8ee('0x59')](handleError(_0x27b1ae,null));};exports[_0xb8ee('0xbc')]=function(_0x57f075,_0x3b576f,_0xd00b9b){var _0x52f711={};var _0x3dce35={};var _0x9ffa1c;var _0x25c90a;return db[_0xb8ee('0x40')][_0xb8ee('0x6a')]({'where':{'id':_0x57f075[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x3b576f,null))[_0xb8ee('0x21')](function(_0x572ad9){if(_0x572ad9){_0x9ffa1c=_0x572ad9;_0x3dce35[_0xb8ee('0x44')]=_['keys'](db[_0xb8ee('0xa0')][_0xb8ee('0x41')]);_0x3dce35['query']=_[_0xb8ee('0x47')](_0x57f075[_0xb8ee('0x46')]);_0x3dce35[_0xb8ee('0x50')]=_[_0xb8ee('0x5d')](_0x3dce35['model'],_0x3dce35[_0xb8ee('0x46')]);_0x52f711['attributes']=_[_0xb8ee('0x5d')](_0x3dce35['model'],qs[_0xb8ee('0x49')](_0x57f075['query'][_0xb8ee('0x49')]));_0x52f711[_0xb8ee('0x48')]=_0x52f711['attributes'][_0xb8ee('0x4a')]?_0x52f711['attributes']:_0x3dce35[_0xb8ee('0x44')];_0x52f711['order']=qs[_0xb8ee('0x4e')](_0x57f075[_0xb8ee('0x46')][_0xb8ee('0x4e')]);_0x52f711['where']=qs[_0xb8ee('0x50')](_[_0xb8ee('0x6b')](_0x57f075[_0xb8ee('0x46')],_0x3dce35[_0xb8ee('0x50')]));if(_0x57f075['query']['filter']){_0x52f711[_0xb8ee('0x4f')]=_[_0xb8ee('0x52')](_0x52f711[_0xb8ee('0x4f')],{'$or':_[_0xb8ee('0x45')](_0x52f711[_0xb8ee('0x48')],function(_0x2a1f43){var _0x2c2207={};_0x2c2207[_0x2a1f43]={'$like':'%'+_0x57f075['query'][_0xb8ee('0x51')]+'%'};return _0x2c2207;})});}_0x52f711=_[_0xb8ee('0x52')]({},_0x52f711,_0x57f075['options']);return _0x9ffa1c[_0xb8ee('0xbc')](_0x52f711);}})[_0xb8ee('0x21')](function(_0x3c6674){if(_0x3c6674){_0x25c90a=_0x3c6674[_0xb8ee('0x4a')];if(!_0x57f075['query'][_0xb8ee('0x4b')](_0xb8ee('0x4c'))){_0x52f711[_0xb8ee('0x2f')]=qs[_0xb8ee('0x2f')](_0x57f075[_0xb8ee('0x46')][_0xb8ee('0x2f')]);_0x52f711[_0xb8ee('0x2e')]=qs['offset'](_0x57f075[_0xb8ee('0x46')]['offset']);}return _0x9ffa1c[_0xb8ee('0xbc')](_0x52f711);}})[_0xb8ee('0x21')](function(_0x450981){if(_0x450981){return _0x450981?{'count':_0x25c90a,'rows':_0x450981}:null;}})[_0xb8ee('0x21')](respondWithResult(_0x3b576f,null))[_0xb8ee('0x59')](handleError(_0x3b576f,null));};exports[_0xb8ee('0x3d')]=function(_0x4a83b0,_0x19f9a1,_0x1ab202){var _0x5a3c1a,_0x12e840,_0x245c09;if(_['isNil'](_0x4a83b0[_0xb8ee('0x66')][_0xb8ee('0x66')])||_0x4a83b0[_0xb8ee('0x66')][_0xb8ee('0x66')]===''){throw new db[(_0xb8ee('0x7e'))]['ValidationError'](_0xb8ee('0x7f'));}if(_['isNil'](_0x4a83b0['body']['to'])){}_0x5a3c1a=_0x4a83b0['body']['to'];return db[_0xb8ee('0x40')]['findOne']({'where':{'id':_0x4a83b0[_0xb8ee('0x5b')]['id']}})[_0xb8ee('0x21')](handleEntityNotFound(_0x19f9a1,null))['then'](function(_0x230392){if(_0x230392){return db['OpenchannelAccount'][_0xb8ee('0x5e')]({'where':{'id':_0x230392['id']},'include':[{'model':db[_0xb8ee('0x83')],'as':_0xb8ee('0x84'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x230392[_0xb8ee('0x80')]]:_0x5a3c1a},'limit':0x1,'order':[[_0xb8ee('0x79'),_0xb8ee('0xbd')]]}]}]})[_0xb8ee('0x21')](handleEntityNotFound(_0x19f9a1,null))[_0xb8ee('0x21')](function(_0x3989cb){if(_0x3989cb&&_0x3989cb['List']){_0x12e840=_0x3989cb[_0xb8ee('0x38')]({'plain':!![]});if(_0x12e840[_0xb8ee('0x84')]&&_0x12e840[_0xb8ee('0x84')]['Contacts'][_0xb8ee('0x4a')]){return _0x12e840[_0xb8ee('0x84')][_0xb8ee('0x85')][0x0];}return db[_0xb8ee('0x74')]['create'](_['defaults'](_0x4a83b0[_0xb8ee('0x66')],{'firstName':_0x5a3c1a,[_0x3989cb[_0xb8ee('0x80')]]:_0x5a3c1a,'phone':_0x5a3c1a,'ListId':_0x12e840[_0xb8ee('0x7a')]}));}})[_0xb8ee('0x21')](handleEntityNotFound(_0x19f9a1,null))[_0xb8ee('0x21')](function(_0x32048f){if(_0x32048f){_0x245c09=_0x32048f;return db['OpenchannelInteraction'][_0xb8ee('0x5e')]({'where':{'ContactId':_0x245c09['id'],'closed':![],'OpenchannelAccountId':_0x12e840['id']}})[_0xb8ee('0x21')](function(_0x531e6a){if(_0x531e6a){return[_0x531e6a,![]];}return db[_0xb8ee('0x93')][_0xb8ee('0x5f')]({'UserId':_0x4a83b0[_0xb8ee('0x60')]['id'],'ContactId':_0x245c09['id'],'OpenchannelAccountId':_0x12e840['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_['merge'](_0x4a83b0[_0xb8ee('0x66')],{'read':![],'body':_0x4a83b0['body'][_0xb8ee('0x66')],'OpenchannelAccountId':_0x12e840['id'],'UserId':_0x4a83b0[_0xb8ee('0x60')]['id'],'ContactId':_0x245c09['id']})]},{'include':[{'model':db[_0xb8ee('0x9d')],'as':'Messages'}]})[_0xb8ee('0x21')](function(_0x4e6181){return[_0x4e6181,!![]];});});}})[_0xb8ee('0x95')](function(_0x2d4b26,_0x552e2e){if(_0x552e2e){return _0x2d4b26;}return db[_0xb8ee('0x9d')]['create'](_[_0xb8ee('0x52')](_0x4a83b0[_0xb8ee('0x66')],{'read':![],'body':_0x4a83b0['body'][_0xb8ee('0x66')],'OpenchannelAccountId':_0x12e840['id'],'OpenchannelInteractionId':_0x2d4b26['id'],'UserId':_0x4a83b0['user']['id'],'ContactId':_0x245c09['id']}))[_0xb8ee('0x21')](function(_0x2f2c9b){_0x2d4b26['dataValues'][_0xb8ee('0xbe')]=[];_0x2d4b26[_0xb8ee('0xbf')]['Messages']['push'](_0x2f2c9b[_0xb8ee('0xbf')]);return _0x2d4b26;});});}})['then'](respondWithResult(_0x19f9a1,null))[_0xb8ee('0x59')](handleError(_0x19f9a1,null));}; \ No newline at end of file +var _0xcf75=['map','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','rawAttributes','include','OpenchannelAccount','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','options','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','send','index','Pause','type','key'];(function(_0x177346,_0x5e4024){var _0x155669=function(_0x231ab4){while(--_0x231ab4){_0x177346['push'](_0x177346['shift']());}};_0x155669(++_0x5e4024);}(_0xcf75,0x83));var _0x5cf7=function(_0x11f392,_0x3a964d){_0x11f392=_0x11f392-0x0;var _0x4993a8=_0xcf75[_0x11f392];return _0x4993a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cf7('0x0'));var zipdir=require(_0x5cf7('0x1'));var jsonpatch=require(_0x5cf7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5cf7('0x3'));var Mustache=require(_0x5cf7('0x4'));var util=require('util');var path=require(_0x5cf7('0x5'));var sox=require(_0x5cf7('0x6'));var csv=require(_0x5cf7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cf7('0x8'));var _=require(_0x5cf7('0x9'));var squel=require('squel');var crypto=require(_0x5cf7('0xa'));var jsforce=require(_0x5cf7('0xb'));var deskjs=require(_0x5cf7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5cf7('0xd'));var Papa=require(_0x5cf7('0xe'));var Redis=require(_0x5cf7('0xf'));var authService=require(_0x5cf7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5cf7('0x11'));var hardwareService=require(_0x5cf7('0x12'));var logger=require(_0x5cf7('0x13'))('api');var utils=require(_0x5cf7('0x14'));var config=require(_0x5cf7('0x15'));var licenseUtil=require(_0x5cf7('0x16'));var db=require(_0x5cf7('0x17'))['db'];config[_0x5cf7('0x18')]=_[_0x5cf7('0x19')](config[_0x5cf7('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5cf7('0x1a'))(new Redis(config['redis']));require(_0x5cf7('0x1b'))[_0x5cf7('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5cf7('0x1d')][_0x5cf7('0x1e')]({'port':0x232c});var client9002=jayson[_0x5cf7('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1a34,_0x173334,_0x203307,_0x166469){return new BPromise(function(_0x43d644,_0x15657f){var _0x276e9a=_0x166469||client;return _0x276e9a[_0x5cf7('0x1f')](_0x3b1a34,_0x203307)[_0x5cf7('0x20')](function(_0x12b88b){logger[_0x5cf7('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x173334,_0x5cf7('0x22'));logger[_0x5cf7('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x173334,_0x5cf7('0x22'),JSON[_0x5cf7('0x24')](_0x12b88b));if(_0x12b88b[_0x5cf7('0x25')]){if(_0x12b88b[_0x5cf7('0x25')][_0x5cf7('0x26')]===0x1f4){logger['error'](_0x5cf7('0x27'),_0x173334,_0x12b88b[_0x5cf7('0x25')][_0x5cf7('0x28')]);return _0x15657f(_0x12b88b[_0x5cf7('0x25')][_0x5cf7('0x28')]);}logger['error'](_0x5cf7('0x27'),_0x173334,_0x12b88b[_0x5cf7('0x25')][_0x5cf7('0x28')]);return _0x43d644(_0x12b88b['error'][_0x5cf7('0x28')]);}else{logger[_0x5cf7('0x21')](_0x5cf7('0x27'),_0x173334,_0x5cf7('0x22'));_0x43d644(_0x12b88b[_0x5cf7('0x29')][_0x5cf7('0x28')]);}})['catch'](function(_0x3ba3aa){logger[_0x5cf7('0x25')](_0x5cf7('0x27'),_0x173334,_0x3ba3aa);_0x15657f(_0x3ba3aa);});});}function respondWithStatusCode(_0x3a28ef,_0xd444a6){_0xd444a6=_0xd444a6||0xcc;return function(_0x20560f){if(_0x20560f){return _0x3a28ef[_0x5cf7('0x2a')](_0xd444a6);}return _0x3a28ef['status'](_0xd444a6)[_0x5cf7('0x2b')]();};}function respondWithResult(_0x38f7fa,_0x556103){_0x556103=_0x556103||0xc8;return function(_0x28494d){if(_0x28494d){return _0x38f7fa['status'](_0x556103)['json'](_0x28494d);}};}function respondWithFilteredResult(_0x3abf5e,_0xfdbad4){return function(_0x22b9b7){if(_0x22b9b7){var _0x49de18=typeof _0xfdbad4[_0x5cf7('0x2c')]==='undefined'&&typeof _0xfdbad4[_0x5cf7('0x2d')]===_0x5cf7('0x2e');var _0x5dd808=_0x22b9b7['count'];var _0x268d68=_0x49de18?0x0:_0xfdbad4['offset'];var _0x5c33e0=_0x49de18?_0x22b9b7[_0x5cf7('0x2f')]:_0xfdbad4[_0x5cf7('0x2c')]+_0xfdbad4[_0x5cf7('0x2d')];var _0x1435ab;if(_0x5c33e0>=_0x5dd808){_0x5c33e0=_0x5dd808;_0x1435ab=0xc8;}else{_0x1435ab=0xce;}_0x3abf5e[_0x5cf7('0x30')](_0x1435ab);return _0x3abf5e[_0x5cf7('0x31')](_0x5cf7('0x32'),_0x268d68+'-'+_0x5c33e0+'/'+_0x5dd808)[_0x5cf7('0x33')](_0x22b9b7);}return null;};}function patchUpdates(_0x637e40){return function(_0x3cc6ce){try{jsonpatch[_0x5cf7('0x34')](_0x3cc6ce,_0x637e40,!![]);}catch(_0x21519f){return BPromise[_0x5cf7('0x35')](_0x21519f);}return _0x3cc6ce['save']();};}function saveUpdates(_0x1da1df,_0x186bf4){return function(_0x2a9ed8){if(_0x2a9ed8){return _0x2a9ed8[_0x5cf7('0x36')](_0x1da1df)[_0x5cf7('0x20')](function(_0x59e539){return _0x59e539;});}return null;};}function removeEntity(_0x53eaed,_0x231812){return function(_0x4cc74a){if(_0x4cc74a){return _0x4cc74a[_0x5cf7('0x37')]()[_0x5cf7('0x20')](function(){var _0x4d169b=_0x4cc74a[_0x5cf7('0x38')]({'plain':!![]});var _0x12176b=_0x5cf7('0x39');return db[_0x5cf7('0x3a')][_0x5cf7('0x37')]({'where':{'type':_0x12176b,'resourceId':_0x4d169b['id']}})[_0x5cf7('0x20')](function(){return _0x4cc74a;});})[_0x5cf7('0x20')](function(){_0x53eaed[_0x5cf7('0x30')](0xcc)[_0x5cf7('0x2b')]();});}};}function handleEntityNotFound(_0xc9dd2,_0x50dd07){return function(_0x7f264a){if(!_0x7f264a){_0xc9dd2[_0x5cf7('0x2a')](0x194);}return _0x7f264a;};}function handleError(_0x25e367,_0x4fb5d8){_0x4fb5d8=_0x4fb5d8||0x1f4;return function(_0xc27f6){logger[_0x5cf7('0x25')](_0xc27f6['stack']);if(_0xc27f6[_0x5cf7('0x3b')]){delete _0xc27f6[_0x5cf7('0x3b')];}_0x25e367[_0x5cf7('0x30')](_0x4fb5d8)[_0x5cf7('0x3c')](_0xc27f6);};}exports[_0x5cf7('0x3d')]=function(_0x238060,_0x3b3b09){var _0xce022={'include':[{'model':db[_0x5cf7('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2aa77c={},_0x593fd0={'count':0x0,'rows':[]};var _0x21cd30=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0xd3df9){return{'name':_0xd3df9['fieldName'],'type':_0xd3df9[_0x5cf7('0x3f')][_0x5cf7('0x40')]};});_0x2aa77c['model']=_[_0x5cf7('0x41')](_0x21cd30,_0x5cf7('0x3b'));_0x2aa77c[_0x5cf7('0x42')]=_['keys'](_0x238060[_0x5cf7('0x42')]);_0x2aa77c[_0x5cf7('0x43')]=_[_0x5cf7('0x44')](_0x2aa77c[_0x5cf7('0x45')],_0x2aa77c[_0x5cf7('0x42')]);_0xce022[_0x5cf7('0x46')]=_[_0x5cf7('0x44')](_0x2aa77c[_0x5cf7('0x45')],qs[_0x5cf7('0x47')](_0x238060[_0x5cf7('0x42')][_0x5cf7('0x47')]));_0xce022[_0x5cf7('0x46')]=_0xce022[_0x5cf7('0x46')][_0x5cf7('0x48')]?_0xce022[_0x5cf7('0x46')]:_0x2aa77c[_0x5cf7('0x45')];if(!_0x238060[_0x5cf7('0x42')]['hasOwnProperty']('nolimit')){_0xce022[_0x5cf7('0x2d')]=qs['limit'](_0x238060[_0x5cf7('0x42')][_0x5cf7('0x2d')]);_0xce022[_0x5cf7('0x2c')]=qs[_0x5cf7('0x2c')](_0x238060[_0x5cf7('0x42')][_0x5cf7('0x2c')]);}_0xce022[_0x5cf7('0x49')]=qs[_0x5cf7('0x4a')](_0x238060[_0x5cf7('0x42')][_0x5cf7('0x4a')]);_0xce022[_0x5cf7('0x4b')]=qs[_0x5cf7('0x43')](_[_0x5cf7('0x4c')](_0x238060['query'],_0x2aa77c[_0x5cf7('0x43')]),_0x21cd30);if(_0x238060[_0x5cf7('0x42')][_0x5cf7('0x4d')]){_0xce022[_0x5cf7('0x4b')]=_[_0x5cf7('0x4e')](_0xce022[_0x5cf7('0x4b')],{'$or':_[_0x5cf7('0x41')](_0x21cd30,function(_0x1ed89c){if(_0x1ed89c[_0x5cf7('0x3f')]!==_0x5cf7('0x4f')){var _0x592054={};_0x592054[_0x1ed89c[_0x5cf7('0x3b')]]={'$like':'%'+_0x238060['query'][_0x5cf7('0x4d')]+'%'};return _0x592054;}})});}_0xce022=_[_0x5cf7('0x4e')]({},_0xce022,_0x238060['options']);var _0x15dc95={'where':_0xce022['where']};return db['OpenchannelAccount'][_0x5cf7('0x2f')](_0x15dc95)['then'](function(_0x2c323c){_0x593fd0['count']=_0x2c323c;if(_0x238060[_0x5cf7('0x42')]['includeAll']){_0xce022['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x5cf7('0x50')](_0xce022);})[_0x5cf7('0x20')](function(_0x26e485){_0x593fd0[_0x5cf7('0x51')]=_0x26e485;return _0x593fd0;})['then'](respondWithFilteredResult(_0x3b3b09,_0xce022))[_0x5cf7('0x52')](handleError(_0x3b3b09,null));};exports[_0x5cf7('0x53')]=function(_0x621eda,_0x105ac1){var _0x4a3df7={'raw':![],'where':{'id':_0x621eda[_0x5cf7('0x54')]['id']},'include':[{'model':db[_0x5cf7('0x3e')],'as':_0x5cf7('0x55')}]},_0x59bdbd={};_0x59bdbd[_0x5cf7('0x45')]=_[_0x5cf7('0x56')](db['OpenchannelAccount'][_0x5cf7('0x57')]);_0x59bdbd[_0x5cf7('0x42')]=_[_0x5cf7('0x56')](_0x621eda[_0x5cf7('0x42')]);_0x59bdbd[_0x5cf7('0x43')]=_[_0x5cf7('0x44')](_0x59bdbd[_0x5cf7('0x45')],_0x59bdbd[_0x5cf7('0x42')]);_0x4a3df7[_0x5cf7('0x46')]=_['intersection'](_0x59bdbd[_0x5cf7('0x45')],qs[_0x5cf7('0x47')](_0x621eda[_0x5cf7('0x42')][_0x5cf7('0x47')]));_0x4a3df7[_0x5cf7('0x46')]=_0x4a3df7[_0x5cf7('0x46')][_0x5cf7('0x48')]?_0x4a3df7[_0x5cf7('0x46')]:_0x59bdbd[_0x5cf7('0x45')];if(_0x621eda['query']['includeAll']){_0x4a3df7[_0x5cf7('0x58')]=[{'all':!![]}];}_0x4a3df7=_['merge']({},_0x4a3df7,_0x621eda['options']);return db[_0x5cf7('0x59')][_0x5cf7('0x5a')](_0x4a3df7)[_0x5cf7('0x20')](handleEntityNotFound(_0x105ac1,null))['then'](respondWithResult(_0x105ac1,null))[_0x5cf7('0x52')](handleError(_0x105ac1,null));};exports['create']=function(_0x2ba2b9,_0x1232de){return db[_0x5cf7('0x59')][_0x5cf7('0x5b')](_0x2ba2b9[_0x5cf7('0x5c')],{})[_0x5cf7('0x20')](function(_0x4ed1e9){var _0x538bdc=_0x2ba2b9[_0x5cf7('0x5d')][_0x5cf7('0x38')]({'plain':!![]});if(!_0x538bdc)throw new Error(_0x5cf7('0x5e'));if(_0x538bdc['role']===_0x5cf7('0x5d')){var _0x4d7d93=_0x4ed1e9[_0x5cf7('0x38')]({'plain':!![]});var _0x362729=_0x5cf7('0x39');return db[_0x5cf7('0x5f')][_0x5cf7('0x5a')]({'where':{'name':_0x362729,'userProfileId':_0x538bdc[_0x5cf7('0x60')]},'raw':!![]})['then'](function(_0x251a6e){if(_0x251a6e&&_0x251a6e[_0x5cf7('0x61')]===0x0){return db[_0x5cf7('0x3a')][_0x5cf7('0x5b')]({'name':_0x4d7d93[_0x5cf7('0x3b')],'resourceId':_0x4d7d93['id'],'type':_0x251a6e[_0x5cf7('0x3b')],'sectionId':_0x251a6e['id']},{})[_0x5cf7('0x20')](function(){return _0x4ed1e9;});}else{return _0x4ed1e9;}})[_0x5cf7('0x52')](function(_0x2e68ed){logger[_0x5cf7('0x25')](_0x5cf7('0x62'),_0x2e68ed);throw _0x2e68ed;});}return _0x4ed1e9;})[_0x5cf7('0x20')](respondWithResult(_0x1232de,0xc9))[_0x5cf7('0x52')](handleError(_0x1232de,null));};exports[_0x5cf7('0x36')]=function(_0x1d89cc,_0xe0761){if(_0x1d89cc[_0x5cf7('0x5c')]['id']){delete _0x1d89cc[_0x5cf7('0x5c')]['id'];}return db['OpenchannelAccount'][_0x5cf7('0x5a')]({'where':{'id':_0x1d89cc[_0x5cf7('0x54')]['id']},'include':[{'model':db[_0x5cf7('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xe0761,null))[_0x5cf7('0x20')](saveUpdates(_0x1d89cc[_0x5cf7('0x5c')],null))[_0x5cf7('0x20')](respondWithResult(_0xe0761,null))[_0x5cf7('0x52')](handleError(_0xe0761,null));};exports[_0x5cf7('0x37')]=function(_0x2bb359,_0x35d1ab){return db[_0x5cf7('0x59')]['find']({'where':{'id':_0x2bb359['params']['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x35d1ab,null))[_0x5cf7('0x20')](removeEntity(_0x35d1ab,null))['catch'](handleError(_0x35d1ab,null));};exports[_0x5cf7('0x63')]=function(_0x62c115,_0x1e10a){return db['OpenchannelAccount'][_0x5cf7('0x63')]()[_0x5cf7('0x20')](respondWithResult(_0x1e10a,null))[_0x5cf7('0x52')](handleError(_0x1e10a,null));};exports[_0x5cf7('0x64')]=function(_0x591f97,_0x2c5345,_0x5e6f1c){if(_0x591f97[_0x5cf7('0x5c')]['id']){delete _0x591f97[_0x5cf7('0x5c')]['id'];}return db[_0x5cf7('0x59')]['find']({'where':{'id':_0x591f97['params']['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x2c5345,null))[_0x5cf7('0x20')](function(_0x251f89){if(_0x251f89){_0x591f97[_0x5cf7('0x5c')][_0x5cf7('0x65')]=_0x251f89['id'];return db[_0x5cf7('0x66')][_0x5cf7('0x5b')](_0x591f97[_0x5cf7('0x5c')]);}})[_0x5cf7('0x20')](respondWithResult(_0x2c5345,null))[_0x5cf7('0x52')](handleError(_0x2c5345,null));};exports[_0x5cf7('0x67')]=function(_0x4103b4,_0x336706,_0x1ad10f){var _0x326fb2={'raw':![],'where':{}};var _0x50167b={};var _0x402bfa={'count':0x0,'rows':[]};return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x4103b4[_0x5cf7('0x54')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x336706,null))[_0x5cf7('0x20')](function(_0x2802fe){if(_0x2802fe){_0x50167b[_0x5cf7('0x45')]=_[_0x5cf7('0x56')](db['Disposition'][_0x5cf7('0x57')]);_0x50167b[_0x5cf7('0x42')]=_[_0x5cf7('0x56')](_0x4103b4[_0x5cf7('0x42')]);_0x50167b['filters']=_[_0x5cf7('0x44')](_0x50167b[_0x5cf7('0x45')],_0x50167b['query']);_0x326fb2['attributes']=_[_0x5cf7('0x44')](_0x50167b[_0x5cf7('0x45')],qs['fields'](_0x4103b4['query'][_0x5cf7('0x47')]));_0x326fb2[_0x5cf7('0x46')]=_0x326fb2[_0x5cf7('0x46')][_0x5cf7('0x48')]?_0x326fb2[_0x5cf7('0x46')]:_0x50167b[_0x5cf7('0x45')];if(!_0x4103b4[_0x5cf7('0x42')][_0x5cf7('0x69')](_0x5cf7('0x6a'))){_0x326fb2['limit']=qs[_0x5cf7('0x2d')](_0x4103b4['query']['limit']);_0x326fb2[_0x5cf7('0x2c')]=qs[_0x5cf7('0x2c')](_0x4103b4[_0x5cf7('0x42')][_0x5cf7('0x2c')]);}_0x326fb2[_0x5cf7('0x49')]=qs[_0x5cf7('0x4a')](_0x4103b4[_0x5cf7('0x42')][_0x5cf7('0x4a')]);_0x326fb2[_0x5cf7('0x4b')]=qs[_0x5cf7('0x43')](_[_0x5cf7('0x4c')](_0x4103b4[_0x5cf7('0x42')],_0x50167b[_0x5cf7('0x43')]));_0x326fb2[_0x5cf7('0x4b')][_0x5cf7('0x65')]=_0x2802fe['id'];if(_0x4103b4[_0x5cf7('0x42')][_0x5cf7('0x4d')]){_0x326fb2[_0x5cf7('0x4b')]=_['merge'](_0x326fb2[_0x5cf7('0x4b')],{'$or':_[_0x5cf7('0x41')](_0x326fb2[_0x5cf7('0x46')],function(_0x597e80){var _0x310503={};_0x310503[_0x597e80]={'$like':'%'+_0x4103b4['query'][_0x5cf7('0x4d')]+'%'};return _0x310503;})});}_0x326fb2=_[_0x5cf7('0x4e')]({},_0x326fb2,_0x4103b4[_0x5cf7('0x6b')]);return db[_0x5cf7('0x66')]['count']({'where':_0x326fb2[_0x5cf7('0x4b')]})['then'](function(_0x3c8016){_0x402bfa['count']=_0x3c8016;if(_0x4103b4[_0x5cf7('0x42')][_0x5cf7('0x6c')]){_0x326fb2['include']=[{'all':!![]}];}return db[_0x5cf7('0x66')]['findAll'](_0x326fb2);})[_0x5cf7('0x20')](function(_0x56c14d){_0x402bfa[_0x5cf7('0x51')]=_0x56c14d;return _0x402bfa;});}})[_0x5cf7('0x20')](respondWithFilteredResult(_0x336706,_0x326fb2))[_0x5cf7('0x52')](handleError(_0x336706,null));};exports[_0x5cf7('0x6d')]=function(_0x1766d6,_0x27fa07,_0x2e0f5f){return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0x1766d6[_0x5cf7('0x54')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x27fa07,null))[_0x5cf7('0x20')](function(_0x21caf8){if(_0x21caf8){return _0x21caf8[_0x5cf7('0x6d')](_0x1766d6[_0x5cf7('0x42')]['ids']);}})[_0x5cf7('0x20')](respondWithStatusCode(_0x27fa07,null))[_0x5cf7('0x52')](handleError(_0x27fa07,null));};exports[_0x5cf7('0x6e')]=function(_0xfb7886,_0x18e9cd,_0xee3fb9){if(_0xfb7886[_0x5cf7('0x5c')]['id']){delete _0xfb7886[_0x5cf7('0x5c')]['id'];}return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0xfb7886[_0x5cf7('0x54')]['id']}})['then'](handleEntityNotFound(_0x18e9cd,null))['then'](function(_0x29e98a){if(_0x29e98a){_0xfb7886[_0x5cf7('0x5c')][_0x5cf7('0x65')]=_0x29e98a['id'];return db[_0x5cf7('0x6f')][_0x5cf7('0x5b')](_0xfb7886[_0x5cf7('0x5c')]);}})[_0x5cf7('0x20')](respondWithResult(_0x18e9cd,null))[_0x5cf7('0x52')](handleError(_0x18e9cd,null));};exports[_0x5cf7('0x70')]=function(_0x55faf3,_0x141744,_0x275171){var _0x492d4f={'raw':![],'where':{}};var _0x2807b0={};var _0x43967e={'count':0x0,'rows':[]};return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x55faf3[_0x5cf7('0x54')]['id']}})['then'](handleEntityNotFound(_0x141744,null))[_0x5cf7('0x20')](function(_0x21e69f){if(_0x21e69f){_0x2807b0[_0x5cf7('0x45')]=_['keys'](db['CannedAnswer'][_0x5cf7('0x57')]);_0x2807b0[_0x5cf7('0x42')]=_['keys'](_0x55faf3[_0x5cf7('0x42')]);_0x2807b0[_0x5cf7('0x43')]=_[_0x5cf7('0x44')](_0x2807b0['model'],_0x2807b0['query']);_0x492d4f[_0x5cf7('0x46')]=_[_0x5cf7('0x44')](_0x2807b0[_0x5cf7('0x45')],qs[_0x5cf7('0x47')](_0x55faf3[_0x5cf7('0x42')][_0x5cf7('0x47')]));_0x492d4f[_0x5cf7('0x46')]=_0x492d4f[_0x5cf7('0x46')]['length']?_0x492d4f[_0x5cf7('0x46')]:_0x2807b0[_0x5cf7('0x45')];if(!_0x55faf3[_0x5cf7('0x42')]['hasOwnProperty'](_0x5cf7('0x6a'))){_0x492d4f[_0x5cf7('0x2d')]=qs[_0x5cf7('0x2d')](_0x55faf3[_0x5cf7('0x42')][_0x5cf7('0x2d')]);_0x492d4f[_0x5cf7('0x2c')]=qs['offset'](_0x55faf3[_0x5cf7('0x42')][_0x5cf7('0x2c')]);}_0x492d4f[_0x5cf7('0x49')]=qs[_0x5cf7('0x4a')](_0x55faf3[_0x5cf7('0x42')][_0x5cf7('0x4a')]);_0x492d4f[_0x5cf7('0x4b')]=qs[_0x5cf7('0x43')](_[_0x5cf7('0x4c')](_0x55faf3[_0x5cf7('0x42')],_0x2807b0[_0x5cf7('0x43')]));_0x492d4f[_0x5cf7('0x4b')][_0x5cf7('0x65')]=_0x21e69f['id'];if(_0x55faf3['query']['filter']){_0x492d4f[_0x5cf7('0x4b')]=_[_0x5cf7('0x4e')](_0x492d4f[_0x5cf7('0x4b')],{'$or':_[_0x5cf7('0x41')](_0x492d4f['attributes'],function(_0x2842eb){var _0x39720e={};_0x39720e[_0x2842eb]={'$like':'%'+_0x55faf3[_0x5cf7('0x42')][_0x5cf7('0x4d')]+'%'};return _0x39720e;})});}_0x492d4f=_[_0x5cf7('0x4e')]({},_0x492d4f,_0x55faf3[_0x5cf7('0x6b')]);return db['CannedAnswer']['count']({'where':_0x492d4f[_0x5cf7('0x4b')]})[_0x5cf7('0x20')](function(_0x9f960d){_0x43967e['count']=_0x9f960d;if(_0x55faf3[_0x5cf7('0x42')][_0x5cf7('0x6c')]){_0x492d4f[_0x5cf7('0x58')]=[{'all':!![]}];}return db[_0x5cf7('0x6f')][_0x5cf7('0x50')](_0x492d4f);})[_0x5cf7('0x20')](function(_0x382e3a){_0x43967e['rows']=_0x382e3a;return _0x43967e;});}})[_0x5cf7('0x20')](respondWithFilteredResult(_0x141744,_0x492d4f))[_0x5cf7('0x52')](handleError(_0x141744,null));};exports[_0x5cf7('0x71')]=function(_0x518cdf,_0x103bf5,_0x19e9a1){return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0x518cdf[_0x5cf7('0x54')]['id']}})['then'](handleEntityNotFound(_0x103bf5,null))[_0x5cf7('0x20')](function(_0x593436){if(_0x593436){return _0x593436[_0x5cf7('0x71')](_0x518cdf[_0x5cf7('0x42')][_0x5cf7('0x72')]);}})[_0x5cf7('0x20')](respondWithStatusCode(_0x103bf5,null))[_0x5cf7('0x52')](handleError(_0x103bf5,null));};exports[_0x5cf7('0x73')]=function(_0x51db37,_0x4d1597,_0x28e4c3){var _0xaea996={'body':_0x51db37[_0x5cf7('0x5c')],'channel':_0x5cf7('0x74')};var _0xe4d510=[];var _0x242468=[];var _0x3a1d5c={};var _0xee907b=![];return db[_0x5cf7('0x75')][_0x5cf7('0x63')]()['then'](function(_0x47c53f){if(!_0x47c53f){throw new db[(_0x5cf7('0x76'))][(_0x5cf7('0x77'))](_0x5cf7('0x78'));}_0xe4d510=_[_0x5cf7('0x79')](_['keys'](_0x47c53f),[_0x5cf7('0x7a'),_0x5cf7('0x7b')]);_0x242468=_[_0x5cf7('0x79')](_[_0x5cf7('0x56')](_0x47c53f),[_0x5cf7('0x7a'),_0x5cf7('0x7b'),_0x5cf7('0x7c'),_0x5cf7('0x7d')]);if(_0x51db37[_0x5cf7('0x5c')]['id']){delete _0x51db37['body']['id'];}if(_[_0x5cf7('0x7e')](_0x51db37[_0x5cf7('0x5c')]['from'])){throw new db[(_0x5cf7('0x76'))]['ValidationError'](_0x5cf7('0x7f'));}if(_[_0x5cf7('0x7e')](_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x5c')])||_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0x5cf7('0x80'));}if(_[_0x5cf7('0x7e')](_0x51db37[_0x5cf7('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0x5cf7('0x77'))](_0x5cf7('0x81')+_0x242468);}if(!_[_0x5cf7('0x82')](_0x242468,_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x83')])){throw new db[(_0x5cf7('0x76'))][(_0x5cf7('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x242468);}_0x3a1d5c[_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x83')]]=_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x84')];})[_0x5cf7('0x20')](function(){return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0x51db37[_0x5cf7('0x54')]['id']},'include':[{'model':db[_0x5cf7('0x85')],'as':_0x5cf7('0x86'),'include':[{'model':db[_0x5cf7('0x75')],'as':_0x5cf7('0x87'),'where':_0x3a1d5c,'limit':0x1,'order':[[_0x5cf7('0x7b'),_0x5cf7('0x88')]]}]},{'model':db[_0x5cf7('0x89')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x4d1597,null))['then'](function(_0x1aa927){if(_0x1aa927&&_0x1aa927[_0x5cf7('0x86')]){_0xaea996[_0x5cf7('0x8a')]=_0x1aa927;_0xaea996[_0x5cf7('0x8b')]=_0x1aa927[_0x5cf7('0x8c')];_0xaea996[_0x5cf7('0x8d')]=_0x1aa927[_0x5cf7('0x86')];_0xaea996[_0x5cf7('0x8b')]=_[_0x5cf7('0x8e')](_0xaea996[_0x5cf7('0x8b')],[_0x5cf7('0x8f')],[_0x5cf7('0x90')]);if(_0xaea996[_0x5cf7('0x8a')][_0x5cf7('0x8c')]){delete _0xaea996[_0x5cf7('0x8a')]['Applications'];}if(_0xaea996[_0x5cf7('0x8a')][_0x5cf7('0x86')]&&_0xaea996[_0x5cf7('0x8a')]['List'][_0x5cf7('0x87')][_0x5cf7('0x48')]){return _0xaea996[_0x5cf7('0x8a')][_0x5cf7('0x86')]['Contacts'][0x0];}var _0x37605d=_[_0x5cf7('0x19')](_0x51db37['body'],{'firstName':_0x51db37['body'][_0x5cf7('0x84')],'ListId':_0x1aa927[_0x5cf7('0x7d')]});_0x37605d[_0x51db37[_0x5cf7('0x5c')]['mapKey']]=_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x84')];return db[_0x5cf7('0x75')]['create'](_0x37605d,{'fields':_0xe4d510,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d1597,null))[_0x5cf7('0x20')](function(_0x4125f7){_0xaea996[_0x5cf7('0x91')]=_0x4125f7;if(_0x4125f7){var _0x1a1714={'ContactId':_0x4125f7['id'],'OpenchannelAccountId':_0x51db37[_0x5cf7('0x54')]['id'],'from':(_0x4125f7['firstName']||'')+'\x20'+(_0x4125f7[_0x5cf7('0x92')]||'')};var _0x6ebe0e={'OpenchannelAccountId':_0x51db37[_0x5cf7('0x54')]['id'],'closed':![]};if(_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x93')]){_0x6ebe0e['threadId']=_0x51db37[_0x5cf7('0x5c')]['threadId'];return db[_0x5cf7('0x94')]['find']({'where':_0x6ebe0e})[_0x5cf7('0x20')](function(_0x472f2e){if(_0x472f2e){return[_0x472f2e,![]];}_0x1a1714[_0x5cf7('0x93')]=_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x93')];_0x1a1714[_0x5cf7('0x95')]=_0x51db37['body'][_0x5cf7('0x95')];return db['OpenchannelInteraction'][_0x5cf7('0x5b')](_0x1a1714)[_0x5cf7('0x20')](function(_0x4e8873){return[_0x4e8873,!![]];});});}else{_0x6ebe0e[_0x5cf7('0x93')]=null;}_0x6ebe0e[_0x5cf7('0x96')]=_0x4125f7['id'];return db[_0x5cf7('0x94')][_0x5cf7('0x5a')]({'where':_0x6ebe0e})[_0x5cf7('0x20')](function(_0x12c67f){if(_0x12c67f){return[_0x12c67f,![]];}return db[_0x5cf7('0x94')][_0x5cf7('0x5b')](_0x1a1714)[_0x5cf7('0x20')](function(_0xeed81){return[_0xeed81,!![]];});});}})[_0x5cf7('0x97')](function(_0x440b52,_0x5af954){if(_0x440b52){_0xee907b=_0x5af954;if(!_0x5af954){var _0x5f3881={'from':(_0xaea996[_0x5cf7('0x91')][_0x5cf7('0x98')]||'')+'\x20'+(_0xaea996['contact']['lastName']||'')};if(_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x93')]&&_0x51db37['body']['messageId']&&_0x51db37['body'][_0x5cf7('0x93')]!=_0x51db37[_0x5cf7('0x5c')]['messageId']){_0x5f3881[_0x5cf7('0x93')]=_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x99')];}return _0x440b52[_0x5cf7('0x36')](_0x5f3881);}else{return _0x440b52;}}})[_0x5cf7('0x20')](function(_0xdda97e){_0xaea996[_0x5cf7('0x9a')]=_0xdda97e[_0x5cf7('0x38')]({'plain':!![]});_0xaea996[_0x5cf7('0x9a')][_0x5cf7('0x9b')]=_0xee907b;if(_0xaea996[_0x5cf7('0x9a')][_0x5cf7('0x9b')]){if(_0xaea996[_0x5cf7('0x8a')][_0x5cf7('0x9c')]){_0xaea996[_0x5cf7('0x8b')]['push']({'id':0x0,'priority':_0xaea996[_0x5cf7('0x8b')][_0x5cf7('0x48')]+0x1,'app':_0x5cf7('0x9d'),'appdata':_0x5cf7('0x9e'),'interval':_0x5cf7('0x9f')});}}return db[_0x5cf7('0xa0')][_0x5cf7('0x5b')]({'body':_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0x5c')],'OpenchannelAccountId':_0x51db37[_0x5cf7('0x54')]['id'],'OpenchannelInteractionId':_0xdda97e['id'],'direction':'in','ContactId':_0xaea996[_0x5cf7('0x91')]['id'],'AttachmentId':_0x51db37[_0x5cf7('0x5c')][_0x5cf7('0xa1')]});})[_0x5cf7('0x20')](function(_0x40aa5f){_0xaea996[_0x5cf7('0x28')]=_0x40aa5f;if(_0xaea996[_0x5cf7('0x9a')][_0x5cf7('0xa2')]){return db[_0x5cf7('0xa3')]['find']({'attributes':['id','name'],'where':{'id':_0xaea996[_0x5cf7('0x9a')][_0x5cf7('0xa2')]}})['then'](function(_0x33fa02){if(_0x33fa02){_0xaea996[_0x5cf7('0x8b')][_0x5cf7('0xa4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x33fa02[_0x5cf7('0x3b')]+','+(_0xaea996[_0x5cf7('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0x5cf7('0x9f')});_0xaea996['forcedOwnership']=![];}return respondWithRpcPromise(_0x5cf7('0xa5'),_0x5cf7('0xa6'),_0xaea996);});}return respondWithRpcPromise(_0x5cf7('0xa5'),_0x5cf7('0xa6'),_0xaea996);})[_0x5cf7('0x20')](function(_0x1e2885){respondWithRpcPromise('EventManager',_0x5cf7('0xa7'),{'event':_0x5cf7('0x73'),'message':_0x1e2885},client9002);return _0x1e2885;})[_0x5cf7('0x20')](respondWithResult(_0x4d1597,null))[_0x5cf7('0x52')](handleError(_0x4d1597,null));};exports['addApplications']=function(_0x3f7974,_0xfd5b70){var _0x9ac50f=_0x3f7974[_0x5cf7('0x54')]['id'];var _0x2708e9=_0x3f7974[_0x5cf7('0x5c')];var _0x19ed15=0xc8;var _0x2359aa=null;return db[_0x5cf7('0xa8')][_0x5cf7('0xa9')]({'isolationLevel':db[_0x5cf7('0xa8')][_0x5cf7('0xaa')][_0x5cf7('0xab')]['READ_COMMITTED']},function(_0x124a4f){return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x9ac50f},'transaction':_0x124a4f})[_0x5cf7('0x20')](function(_0x413ff5){if(_0x413ff5){return db[_0x5cf7('0x89')][_0x5cf7('0x37')]({'where':{'OpenchannelAccountId':_0x9ac50f},'transaction':_0x124a4f})[_0x5cf7('0x20')](function(){var _0xfab8ca=_[_0x5cf7('0x41')](_0x2708e9,function(_0x57bdf1){_0x57bdf1[_0x5cf7('0x65')]=_0x9ac50f;return _0x57bdf1;});return db[_0x5cf7('0x89')][_0x5cf7('0xac')](_0xfab8ca,{'transaction':_0x124a4f});});}else{_0x19ed15=0x194;_0x2359aa=[];}});})[_0x5cf7('0x20')](function(){if(_0x19ed15!==0x194){return db[_0x5cf7('0x89')][_0x5cf7('0xad')]({'where':{'OpenchannelAccountId':_0x9ac50f},'order':'priority'})[_0x5cf7('0x20')](function(_0x182d55){_0x2359aa=_0x182d55;});}})['catch'](function(_0x106bde){_0x19ed15=0x1f4;logger[_0x5cf7('0x25')](_0x106bde[_0x5cf7('0xae')]);if(_0x106bde[_0x5cf7('0x3b')]){delete _0x106bde[_0x5cf7('0x3b')];}_0x2359aa=_0x106bde;})[_0x5cf7('0xaf')](function(){if(_0x2359aa===null){_0xfd5b70['sendStatus'](_0x19ed15);}else{if(_0x19ed15===0x1f4){_0xfd5b70[_0x5cf7('0x30')](_0x19ed15)[_0x5cf7('0x3c')](_0x2359aa);}else{_0xfd5b70[_0x5cf7('0x30')](_0x19ed15)['json'](_0x2359aa);}}});};exports[_0x5cf7('0xb0')]=function(_0x1b0ba5,_0x565027,_0x9f70d8){var _0x4bc1e1={};var _0x76a252={};var _0x51d4a9;var _0x1b3d94;return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x1b0ba5[_0x5cf7('0x54')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x565027,null))[_0x5cf7('0x20')](function(_0x156dbe){if(_0x156dbe){_0x51d4a9=_0x156dbe;_0x76a252[_0x5cf7('0x45')]=_['keys'](db[_0x5cf7('0x89')][_0x5cf7('0x57')]);_0x76a252[_0x5cf7('0x42')]=_['keys'](_0x1b0ba5[_0x5cf7('0x42')]);_0x76a252[_0x5cf7('0x43')]=_[_0x5cf7('0x44')](_0x76a252['model'],_0x76a252[_0x5cf7('0x42')]);_0x4bc1e1[_0x5cf7('0x46')]=_[_0x5cf7('0x44')](_0x76a252[_0x5cf7('0x45')],qs[_0x5cf7('0x47')](_0x1b0ba5[_0x5cf7('0x42')]['fields']));_0x4bc1e1[_0x5cf7('0x46')]=_0x4bc1e1['attributes'][_0x5cf7('0x48')]?_0x4bc1e1['attributes']:_0x76a252[_0x5cf7('0x45')];_0x4bc1e1[_0x5cf7('0x49')]=qs[_0x5cf7('0x4a')](_0x1b0ba5[_0x5cf7('0x42')][_0x5cf7('0x4a')]);_0x4bc1e1['where']=qs[_0x5cf7('0x43')](_['pick'](_0x1b0ba5['query'],_0x76a252[_0x5cf7('0x43')]));if(_0x1b0ba5['query'][_0x5cf7('0x4d')]){_0x4bc1e1[_0x5cf7('0x4b')]=_[_0x5cf7('0x4e')](_0x4bc1e1[_0x5cf7('0x4b')],{'$or':_[_0x5cf7('0x41')](_0x4bc1e1[_0x5cf7('0x46')],function(_0x51c0e7){var _0x429092={};_0x429092[_0x51c0e7]={'$like':'%'+_0x1b0ba5['query'][_0x5cf7('0x4d')]+'%'};return _0x429092;})});}_0x4bc1e1=_[_0x5cf7('0x4e')]({},_0x4bc1e1,_0x1b0ba5[_0x5cf7('0x6b')]);return _0x51d4a9[_0x5cf7('0xb0')](_0x4bc1e1);}})[_0x5cf7('0x20')](function(_0x860e85){if(_0x860e85){_0x1b3d94=_0x860e85[_0x5cf7('0x48')];if(!_0x1b0ba5[_0x5cf7('0x42')][_0x5cf7('0x69')]('nolimit')){_0x4bc1e1[_0x5cf7('0x2d')]=qs[_0x5cf7('0x2d')](_0x1b0ba5[_0x5cf7('0x42')][_0x5cf7('0x2d')]);_0x4bc1e1['offset']=qs[_0x5cf7('0x2c')](_0x1b0ba5[_0x5cf7('0x42')][_0x5cf7('0x2c')]);}return _0x51d4a9['getApplications'](_0x4bc1e1);}})['then'](function(_0x14d031){if(_0x14d031){return _0x14d031?{'count':_0x1b3d94,'rows':_0x14d031}:null;}})['then'](respondWithResult(_0x565027,null))['catch'](handleError(_0x565027,null));};exports[_0x5cf7('0xb1')]=function(_0x17c129,_0x4093a6,_0x4de51d){var _0x11ac60={'raw':![],'where':{}};var _0x291871={};var _0x3c3027={'count':0x0,'rows':[]};return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x17c129[_0x5cf7('0x54')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x4093a6,null))[_0x5cf7('0x20')](function(_0x9cb609){if(_0x9cb609){_0x291871[_0x5cf7('0x45')]=_[_0x5cf7('0x56')](db['OpenchannelInteraction'][_0x5cf7('0x57')]);_0x291871[_0x5cf7('0x42')]=_[_0x5cf7('0x56')](_0x17c129[_0x5cf7('0x42')]);_0x291871[_0x5cf7('0x43')]=_[_0x5cf7('0x44')](_0x291871['model'],_0x291871['query']);_0x11ac60[_0x5cf7('0x46')]=_[_0x5cf7('0x44')](_0x291871[_0x5cf7('0x45')],qs[_0x5cf7('0x47')](_0x17c129[_0x5cf7('0x42')][_0x5cf7('0x47')]));_0x11ac60[_0x5cf7('0x46')]=_0x11ac60[_0x5cf7('0x46')]['length']?_0x11ac60[_0x5cf7('0x46')]:_0x291871[_0x5cf7('0x45')];if(!_0x17c129[_0x5cf7('0x42')][_0x5cf7('0x69')](_0x5cf7('0x6a'))){_0x11ac60[_0x5cf7('0x2d')]=qs[_0x5cf7('0x2d')](_0x17c129[_0x5cf7('0x42')][_0x5cf7('0x2d')]);_0x11ac60['offset']=qs['offset'](_0x17c129['query'][_0x5cf7('0x2c')]);}_0x11ac60[_0x5cf7('0x49')]=qs[_0x5cf7('0x4a')](_0x17c129['query'][_0x5cf7('0x4a')]);_0x11ac60[_0x5cf7('0x4b')]=qs['filters'](_[_0x5cf7('0x4c')](_0x17c129[_0x5cf7('0x42')],_0x291871[_0x5cf7('0x43')]));_0x11ac60[_0x5cf7('0x4b')][_0x5cf7('0x65')]=_0x9cb609['id'];if(_0x17c129[_0x5cf7('0x42')][_0x5cf7('0x4d')]){_0x11ac60['where']=_['merge'](_0x11ac60['where'],{'$or':_[_0x5cf7('0x41')](_0x11ac60[_0x5cf7('0x46')],function(_0x389bf2){var _0xbafd11={};_0xbafd11[_0x389bf2]={'$like':'%'+_0x17c129['query'][_0x5cf7('0x4d')]+'%'};return _0xbafd11;})});}_0x11ac60=_[_0x5cf7('0x4e')]({},_0x11ac60,_0x17c129['options']);return db[_0x5cf7('0x94')]['count']({'where':_0x11ac60[_0x5cf7('0x4b')]})[_0x5cf7('0x20')](function(_0x15c99a){_0x3c3027[_0x5cf7('0x2f')]=_0x15c99a;if(_0x17c129[_0x5cf7('0x42')]['includeAll']){_0x11ac60[_0x5cf7('0x58')]=[{'model':db['CmContact'],'as':_0x5cf7('0xb2'),'required':![]},{'model':db[_0x5cf7('0xa3')],'as':_0x5cf7('0xb3'),'attributes':[_0x5cf7('0x3b'),_0x5cf7('0xb4'),_0x5cf7('0xb5')],'required':![]},{'model':db['Tag'],'as':_0x5cf7('0xb6'),'attributes':['id','name',_0x5cf7('0xb7')],'where':_0x17c129[_0x5cf7('0x42')]['tag']?{'id':_0x17c129['query']['tag']}:undefined,'required':_0x17c129[_0x5cf7('0x42')][_0x5cf7('0xb8')]?!![]:![]}];}return db[_0x5cf7('0x94')][_0x5cf7('0x50')](_0x11ac60);})[_0x5cf7('0x20')](function(_0x100abf){_0x3c3027['rows']=_0x100abf;return _0x3c3027;});}})[_0x5cf7('0x20')](respondWithFilteredResult(_0x4093a6,_0x11ac60))['catch'](handleError(_0x4093a6,null));};exports[_0x5cf7('0xb9')]=function(_0x5a2734,_0x4c2351,_0x10aed4){return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0x5a2734[_0x5cf7('0x54')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x4c2351,null))[_0x5cf7('0x20')](function(_0x1deb09){if(_0x1deb09){return _0x1deb09[_0x5cf7('0xb9')](_0x5a2734[_0x5cf7('0x5c')]['ids'],_['omit'](_0x5a2734[_0x5cf7('0x5c')],['ids','id'])||{})['spread'](function(_0x1c0949){for(var _0x478a4c=0x0;_0x478a4c<_0x5a2734[_0x5cf7('0x5c')]['ids'][_0x5cf7('0x48')];_0x478a4c+=0x1){socket['emit'](_0x5cf7('0xba'),{'UserId':Number(_0x5a2734[_0x5cf7('0x5c')][_0x5cf7('0x72')][_0x478a4c]),'OpenchannelAccountId':Number(_0x5a2734[_0x5cf7('0x54')]['id'])});}return _0x1c0949;});}})[_0x5cf7('0x20')](respondWithResult(_0x4c2351,null))[_0x5cf7('0x52')](handleError(_0x4c2351,null));};exports[_0x5cf7('0xbb')]=function(_0x51c259,_0x16d67a,_0x539495){return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0x51c259[_0x5cf7('0x54')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x16d67a,null))['then'](function(_0x4f8cd0){if(_0x4f8cd0){return _0x4f8cd0[_0x5cf7('0xbb')](_0x51c259[_0x5cf7('0x42')][_0x5cf7('0x72')])[_0x5cf7('0x20')](function(){if(_[_0x5cf7('0xbc')](_0x51c259['query'][_0x5cf7('0x72')])){for(var _0x4daa50=0x0;_0x4daa50<_0x51c259[_0x5cf7('0x42')][_0x5cf7('0x72')][_0x5cf7('0x48')];_0x4daa50+=0x1){socket[_0x5cf7('0xbd')](_0x5cf7('0xbe'),{'UserId':Number(_0x51c259[_0x5cf7('0x42')][_0x5cf7('0x72')][_0x4daa50]),'OpenchannelAccountId':Number(_0x51c259[_0x5cf7('0x54')]['id'])});}}else{socket[_0x5cf7('0xbd')](_0x5cf7('0xbe'),{'UserId':Number(_0x51c259[_0x5cf7('0x42')][_0x5cf7('0x72')]),'OpenchannelAccountId':Number(_0x51c259[_0x5cf7('0x54')]['id'])});}});}})[_0x5cf7('0x20')](respondWithStatusCode(_0x16d67a,null))['catch'](handleError(_0x16d67a,null));};exports['getAgents']=function(_0x49eb21,_0x1789be,_0x967d2b){var _0x282c95={};var _0x3cd3a0={};var _0x5317fc;var _0x4c8aa7;return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x49eb21['params']['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x1789be,null))[_0x5cf7('0x20')](function(_0x591b90){if(_0x591b90){_0x5317fc=_0x591b90;_0x3cd3a0[_0x5cf7('0x45')]=_[_0x5cf7('0x56')](db['User'][_0x5cf7('0x57')]);_0x3cd3a0[_0x5cf7('0x42')]=_[_0x5cf7('0x56')](_0x49eb21[_0x5cf7('0x42')]);_0x3cd3a0[_0x5cf7('0x43')]=_[_0x5cf7('0x44')](_0x3cd3a0[_0x5cf7('0x45')],_0x3cd3a0[_0x5cf7('0x42')]);_0x282c95[_0x5cf7('0x46')]=_[_0x5cf7('0x44')](_0x3cd3a0['model'],qs[_0x5cf7('0x47')](_0x49eb21[_0x5cf7('0x42')][_0x5cf7('0x47')]));_0x282c95[_0x5cf7('0x46')]=_0x282c95[_0x5cf7('0x46')][_0x5cf7('0x48')]?_0x282c95[_0x5cf7('0x46')]:_0x3cd3a0['model'];_0x282c95[_0x5cf7('0x49')]=qs['sort'](_0x49eb21['query'][_0x5cf7('0x4a')]);_0x282c95['where']=qs[_0x5cf7('0x43')](_['pick'](_0x49eb21[_0x5cf7('0x42')],_0x3cd3a0[_0x5cf7('0x43')]));if(_0x49eb21[_0x5cf7('0x42')][_0x5cf7('0x4d')]){_0x282c95[_0x5cf7('0x4b')]=_[_0x5cf7('0x4e')](_0x282c95[_0x5cf7('0x4b')],{'$or':_[_0x5cf7('0x41')](_0x282c95[_0x5cf7('0x46')],function(_0x493a32){var _0x2492d3={};_0x2492d3[_0x493a32]={'$like':'%'+_0x49eb21[_0x5cf7('0x42')][_0x5cf7('0x4d')]+'%'};return _0x2492d3;})});}_0x282c95=_[_0x5cf7('0x4e')]({},_0x282c95,_0x49eb21[_0x5cf7('0x6b')]);return _0x5317fc[_0x5cf7('0xbf')](_0x282c95);}})[_0x5cf7('0x20')](function(_0x2637e5){if(_0x2637e5){_0x4c8aa7=_0x2637e5[_0x5cf7('0x48')];if(!_0x49eb21[_0x5cf7('0x42')]['hasOwnProperty']('nolimit')){_0x282c95[_0x5cf7('0x2d')]=qs[_0x5cf7('0x2d')](_0x49eb21[_0x5cf7('0x42')]['limit']);_0x282c95[_0x5cf7('0x2c')]=qs[_0x5cf7('0x2c')](_0x49eb21['query'][_0x5cf7('0x2c')]);}return _0x5317fc['getAgents'](_0x282c95);}})[_0x5cf7('0x20')](function(_0x33cee0){if(_0x33cee0){return _0x33cee0?{'count':_0x4c8aa7,'rows':_0x33cee0}:null;}})[_0x5cf7('0x20')](respondWithResult(_0x1789be,null))[_0x5cf7('0x52')](handleError(_0x1789be,null));};exports[_0x5cf7('0x3c')]=function(_0x21f50a,_0x4bdcad,_0x184749){var _0x131540,_0x1e636b,_0x285531;if(_['isNil'](_0x21f50a[_0x5cf7('0x5c')][_0x5cf7('0x5c')])||_0x21f50a[_0x5cf7('0x5c')][_0x5cf7('0x5c')]===''){throw new db[(_0x5cf7('0x76'))][(_0x5cf7('0x77'))](_0x5cf7('0x80'));}if(_[_0x5cf7('0x7e')](_0x21f50a[_0x5cf7('0x5c')]['to'])){}_0x131540=_0x21f50a[_0x5cf7('0x5c')]['to'];return db[_0x5cf7('0x59')][_0x5cf7('0x68')]({'where':{'id':_0x21f50a['params']['id']}})['then'](handleEntityNotFound(_0x4bdcad,null))[_0x5cf7('0x20')](function(_0x5bef58){if(_0x5bef58){return db[_0x5cf7('0x59')][_0x5cf7('0x5a')]({'where':{'id':_0x5bef58['id']},'include':[{'model':db[_0x5cf7('0x85')],'as':_0x5cf7('0x86'),'include':[{'model':db[_0x5cf7('0x75')],'as':_0x5cf7('0x87'),'where':{[_0x5bef58[_0x5cf7('0x83')]]:_0x131540},'limit':0x1,'order':[[_0x5cf7('0x7b'),_0x5cf7('0x88')]]}]}]})[_0x5cf7('0x20')](handleEntityNotFound(_0x4bdcad,null))['then'](function(_0x168b62){if(_0x168b62&&_0x168b62[_0x5cf7('0x86')]){_0x1e636b=_0x168b62['get']({'plain':!![]});if(_0x1e636b[_0x5cf7('0x86')]&&_0x1e636b['List'][_0x5cf7('0x87')][_0x5cf7('0x48')]){return _0x1e636b[_0x5cf7('0x86')][_0x5cf7('0x87')][0x0];}return db[_0x5cf7('0x75')][_0x5cf7('0x5b')](_[_0x5cf7('0x19')](_0x21f50a[_0x5cf7('0x5c')],{'firstName':_0x131540,[_0x168b62[_0x5cf7('0x83')]]:_0x131540,'phone':_0x131540,'ListId':_0x1e636b[_0x5cf7('0x7d')]}));}})[_0x5cf7('0x20')](handleEntityNotFound(_0x4bdcad,null))[_0x5cf7('0x20')](function(_0x548e18){if(_0x548e18){_0x285531=_0x548e18;return db[_0x5cf7('0x94')][_0x5cf7('0x5a')]({'where':{'ContactId':_0x285531['id'],'closed':![],'OpenchannelAccountId':_0x1e636b['id']}})[_0x5cf7('0x20')](function(_0x294b6e){if(_0x294b6e){return[_0x294b6e,![]];}return db['OpenchannelInteraction'][_0x5cf7('0x5b')]({'UserId':_0x21f50a[_0x5cf7('0x5d')]['id'],'ContactId':_0x285531['id'],'OpenchannelAccountId':_0x1e636b['id'],'lastMsgDirection':_0x5cf7('0xc0'),'firstMsgDirection':_0x5cf7('0xc0'),'Messages':[_[_0x5cf7('0x4e')](_0x21f50a[_0x5cf7('0x5c')],{'read':![],'body':_0x21f50a[_0x5cf7('0x5c')][_0x5cf7('0x5c')],'OpenchannelAccountId':_0x1e636b['id'],'UserId':_0x21f50a[_0x5cf7('0x5d')]['id'],'ContactId':_0x285531['id']})]},{'include':[{'model':db[_0x5cf7('0xa0')],'as':_0x5cf7('0xc1')}]})[_0x5cf7('0x20')](function(_0x32e93b){return[_0x32e93b,!![]];});});}})[_0x5cf7('0x97')](function(_0x5a9f32,_0x1fb8e2){if(_0x1fb8e2){return _0x5a9f32;}return db['OpenchannelMessage']['create'](_[_0x5cf7('0x4e')](_0x21f50a[_0x5cf7('0x5c')],{'read':![],'body':_0x21f50a[_0x5cf7('0x5c')][_0x5cf7('0x5c')],'OpenchannelAccountId':_0x1e636b['id'],'OpenchannelInteractionId':_0x5a9f32['id'],'UserId':_0x21f50a[_0x5cf7('0x5d')]['id'],'ContactId':_0x285531['id']}))['then'](function(_0x5aa788){_0x5a9f32[_0x5cf7('0xc2')][_0x5cf7('0xc1')]=[];_0x5a9f32['dataValues'][_0x5cf7('0xc1')][_0x5cf7('0xc3')](_0x5aa788[_0x5cf7('0xc2')]);return _0x5a9f32;});});}})['then'](respondWithResult(_0x4bdcad,null))['catch'](handleError(_0x4bdcad,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 9c34e90..ec49b24 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 _0xb4e6=['update','remove','emit','hook','events','OpenchannelAccount','setMaxListeners','save'];(function(_0x567ad7,_0x4f55e0){var _0x338c0e=function(_0x44fd26){while(--_0x44fd26){_0x567ad7['push'](_0x567ad7['shift']());}};_0x338c0e(++_0x4f55e0);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0xb4e6[_0x406696];return _0x10e35c;};'use strict';var EventEmitter=require(_0x6b4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x6b4e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b4e('0x2')](0x0);var events={'afterCreate':_0x6b4e('0x3'),'afterUpdate':_0x6b4e('0x4'),'afterDestroy':_0x6b4e('0x5')};function emitEvent(_0x31e8ad){return function(_0x1929b8,_0x52313b,_0x40da90){OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad+':'+_0x1929b8['id'],_0x1929b8);OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad,_0x1929b8);_0x40da90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x6b4e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xf109=['OpenchannelAccount','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x54f1b9,_0x3e9cc4){var _0x4d70dc=function(_0x11bc50){while(--_0x11bc50){_0x54f1b9['push'](_0x54f1b9['shift']());}};_0x4d70dc(++_0x3e9cc4);}(_0xf109,0xce));var _0x9f10=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xf109[_0x20ef64];return _0x3707d8;};'use strict';var EventEmitter=require(_0x9f10('0x0'));var OpenchannelAccount=require(_0x9f10('0x1'))['db'][_0x9f10('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f10('0x3')};function emitEvent(_0x74f517){return function(_0x74d0ee,_0x26f01c,_0x4027f4){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517+':'+_0x74d0ee['id'],_0x74d0ee);OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517,_0x74d0ee);_0x4027f4(null);};}for(var e in events){if(events[_0x9f10('0x5')](e)){var event=events[e];OpenchannelAccount[_0x9f10('0x6')](e,emitEvent(event));}}module[_0x9f10('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index a8ef2e6..339f5ae 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x19b5c4,_0x1b3b25){var _0xfe1d55=function(_0x5eddcd){while(--_0x5eddcd){_0x19b5c4['push'](_0x19b5c4['shift']());}};_0xfe1d55(++_0x1b3b25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2e45a7,_0x3ccd6d){var _0x4fd8f8=function(_0x22bc45){while(--_0x22bc45){_0x2e45a7['push'](_0x2e45a7['shift']());}};_0x4fd8f8(++_0x3ccd6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index c171a31..9bc6382 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 _0x8580=['http','redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x13a8d6,_0x4e8ec9){var _0x23fed9=function(_0x1e430b){while(--_0x1e430b){_0x13a8d6['push'](_0x13a8d6['shift']());}};_0x23fed9(++_0x4e8ec9);}(_0x8580,0x1c7));var _0x0858=function(_0x44542e,_0x3fae75){_0x44542e=_0x44542e-0x0;var _0x4ff55c=_0x8580[_0x44542e];return _0x4ff55c;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});config[_0x0858('0x8')]=_[_0x0858('0x9')](config['redis'],{'host':_0x0858('0xa'),'port':0x18eb});var socket=require(_0x0858('0xb'))(new Redis(config[_0x0858('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x470459,_0x4b5072,_0x24996d){return new BPromise(function(_0x1c214c,_0x38371f){return client[_0x0858('0xc')](_0x470459,_0x24996d)[_0x0858('0xd')](function(_0x207cda){logger[_0x0858('0xe')](_0x0858('0xf'),_0x4b5072,'request\x20sent');logger['debug'](_0x0858('0x10'),_0x4b5072,'request\x20sent',JSON['stringify'](_0x207cda));if(_0x207cda['error']){if(_0x207cda[_0x0858('0x11')][_0x0858('0x12')]===0x1f4){logger['error'](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x38371f(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x1c214c(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}else{logger[_0x0858('0xe')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b5072,_0x0858('0x14'));_0x1c214c(_0x207cda['result'][_0x0858('0x13')]);}})[_0x0858('0x15')](function(_0x3a2d96){logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x3a2d96);_0x38371f(_0x3a2d96);});});} \ No newline at end of file +var _0x2f3a=['http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0xfd0a6c,_0x1dde68){var _0x3b6b05=function(_0x8e08be){while(--_0x8e08be){_0xfd0a6c['push'](_0xfd0a6c['shift']());}};_0x3b6b05(++_0x1dde68);}(_0x2f3a,0xfb));var _0xa2f3=function(_0xd6c8db,_0x55b5f3){_0xd6c8db=_0xd6c8db-0x0;var _0x58249f=_0x2f3a[_0xd6c8db];return _0x58249f;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require(_0xa2f3('0x6'))('rpc');var config=require(_0xa2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2f3('0x8')][_0xa2f3('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa2f3('0xa')],{'host':_0xa2f3('0xb'),'port':0x18eb});var socket=require(_0xa2f3('0xc'))(new Redis(config[_0xa2f3('0xa')]));require('./openchannelAccount.socket')[_0xa2f3('0xd')](socket);function respondWithRpcPromise(_0x6373f7,_0x1fce68,_0x41a90c){return new BPromise(function(_0x214f68,_0x55ff83){return client[_0xa2f3('0xe')](_0x6373f7,_0x41a90c)[_0xa2f3('0xf')](function(_0x52aabd){logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));logger['debug'](_0xa2f3('0x13'),_0x1fce68,_0xa2f3('0x12'),JSON[_0xa2f3('0x14')](_0x52aabd));if(_0x52aabd[_0xa2f3('0x15')]){if(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x16')]===0x1f4){logger[_0xa2f3('0x15')](_0xa2f3('0x11'),_0x1fce68,_0x52aabd[_0xa2f3('0x15')]['message']);return _0x55ff83(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);}logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);return _0x214f68(_0x52aabd['error']['message']);}else{logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));_0x214f68(_0x52aabd[_0xa2f3('0x18')][_0xa2f3('0x17')]);}})[_0xa2f3('0x19')](function(_0x30be69){logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x30be69);_0x55ff83(_0x30be69);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index cf730b4..c7ae29c 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 _0x8f37=['remove','emit','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x430a8f,_0x564bde){var _0x84904=function(_0x181ccf){while(--_0x181ccf){_0x430a8f['push'](_0x430a8f['shift']());}};_0x84904(++_0x564bde);}(_0x8f37,0x190));var _0x78f3=function(_0x1d16ff,_0x29e492){_0x1d16ff=_0x1d16ff-0x0;var _0x16cc62=_0x8f37[_0x1d16ff];return _0x16cc62;};'use strict';var OpenchannelAccountEvents=require(_0x78f3('0x0'));var events=[_0x78f3('0x1'),_0x78f3('0x2'),'update'];function createListener(_0x542bc0,_0x2a7d93){return function(_0x3c1fa6){_0x2a7d93[_0x78f3('0x3')](_0x542bc0,_0x3c1fa6);};}function removeListener(_0x539794,_0x1d59a5){return function(){OpenchannelAccountEvents['removeListener'](_0x539794,_0x1d59a5);};}exports[_0x78f3('0x4')]=function(_0x597b85){for(var _0x11c6ad=0x0,_0x3dc185=events['length'];_0x11c6ad<_0x3dc185;_0x11c6ad++){var _0x58bd73=events[_0x11c6ad];var _0x55e353=createListener(_0x78f3('0x5')+_0x58bd73,_0x597b85);OpenchannelAccountEvents['on'](_0x58bd73,_0x55e353);}}; \ No newline at end of file +var _0x35ba=['emit','removeListener','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x595a1c,_0xecacd2){var _0x520e92=function(_0x201f82){while(--_0x201f82){_0x595a1c['push'](_0x595a1c['shift']());}};_0x520e92(++_0xecacd2);}(_0x35ba,0x8c));var _0xa35b=function(_0x35639c,_0xfba17c){_0x35639c=_0x35639c-0x0;var _0x1ca47a=_0x35ba[_0x35639c];return _0x1ca47a;};'use strict';var OpenchannelAccountEvents=require(_0xa35b('0x0'));var events=[_0xa35b('0x1'),_0xa35b('0x2'),_0xa35b('0x3')];function createListener(_0x4b2e01,_0x1bd11e){return function(_0x1eb695){_0x1bd11e[_0xa35b('0x4')](_0x4b2e01,_0x1eb695);};}function removeListener(_0x1b54c1,_0x26742f){return function(){OpenchannelAccountEvents[_0xa35b('0x5')](_0x1b54c1,_0x26742f);};}exports['register']=function(_0x3b342a){for(var _0x5e6bf7=0x0,_0x7f0063=events[_0xa35b('0x6')];_0x5e6bf7<_0x7f0063;_0x5e6bf7++){var _0x2be599=events[_0x5e6bf7];var _0x42da91=createListener(_0xa35b('0x7')+_0x2be599,_0x3b342a);OpenchannelAccountEvents['on'](_0x2be599,_0x42da91);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 9d95428..7464d49 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 _0x0739=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x56be10,_0x33e759){var _0x548042=function(_0x16cf00){while(--_0x16cf00){_0x56be10['push'](_0x56be10['shift']());}};_0x548042(++_0x33e759);}(_0x0739,0xc8));var _0x9073=function(_0x1ffebf,_0x826bc3){_0x1ffebf=_0x1ffebf-0x0;var _0x12f424=_0x0739[_0x1ffebf];return _0x12f424;};'use strict';var multer=require(_0x9073('0x0'));var util=require(_0x9073('0x1'));var path=require('path');var timeout=require(_0x9073('0x2'));var express=require(_0x9073('0x3'));var router=express[_0x9073('0x4')]();var fs_extra=require(_0x9073('0x5'));var auth=require(_0x9073('0x6'));var interaction=require(_0x9073('0x7'));var config=require(_0x9073('0x8'));var controller=require(_0x9073('0x9'));router[_0x9073('0xa')]('/',auth[_0x9073('0xb')](),controller['index']);router[_0x9073('0xa')]('/:id',auth[_0x9073('0xb')](),controller[_0x9073('0xc')]);router[_0x9073('0xd')]('/',auth['isAuthenticated'](),controller[_0x9073('0xe')]);router[_0x9073('0xf')](_0x9073('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x9073('0x11')](_0x9073('0x10'),auth[_0x9073('0xb')](),controller[_0x9073('0x12')]);module[_0x9073('0x13')]=router; \ No newline at end of file +var _0x442d=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','show','create','put','update','delete','/:id','destroy','multer','util'];(function(_0x54ac9c,_0x20c635){var _0x565bf4=function(_0x52d1e8){while(--_0x52d1e8){_0x54ac9c['push'](_0x54ac9c['shift']());}};_0x565bf4(++_0x20c635);}(_0x442d,0xca));var _0xd442=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x442d[_0x541ea6];return _0x3c3e84;};'use strict';var multer=require(_0xd442('0x0'));var util=require(_0xd442('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd442('0x2'));var router=express['Router']();var fs_extra=require(_0xd442('0x3'));var auth=require(_0xd442('0x4'));var interaction=require(_0xd442('0x5'));var config=require(_0xd442('0x6'));var controller=require(_0xd442('0x7'));router['get']('/',auth[_0xd442('0x8')](),controller['index']);router[_0xd442('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd442('0xa')]);router['post']('/',auth[_0xd442('0x8')](),controller[_0xd442('0xb')]);router[_0xd442('0xc')]('/:id',auth[_0xd442('0x8')](),controller[_0xd442('0xd')]);router[_0xd442('0xe')](_0xd442('0xf'),auth[_0xd442('0x8')](),controller[_0xd442('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 0af703d..51e9433 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 _0x6209=['INTEGER','*,*,*,*','sequelize','exports'];(function(_0x21da4f,_0x2c5cc3){var _0x235284=function(_0x2339ed){while(--_0x2339ed){_0x21da4f['push'](_0x21da4f['shift']());}};_0x235284(++_0x2c5cc3);}(_0x6209,0x10e));var _0x9620=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6209[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9620('0x0'));module[_0x9620('0x1')]={'priority':{'type':Sequelize[_0x9620('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9620('0x3')}}; \ No newline at end of file +var _0xe8bf=['exports','noop','TEXT','STRING','*,*,*,*'];(function(_0x4299ac,_0x14138a){var _0x5ec9cb=function(_0x58bf20){while(--_0x58bf20){_0x4299ac['push'](_0x4299ac['shift']());}};_0x5ec9cb(++_0x14138a);}(_0xe8bf,0x113));var _0xfe8b=function(_0x4ce3c2,_0x519a6f){_0x4ce3c2=_0x4ce3c2-0x0;var _0x44a1d0=_0xe8bf[_0x4ce3c2];return _0x44a1d0;};'use strict';var Sequelize=require('sequelize');module[_0xfe8b('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfe8b('0x1')},'appdata':{'type':Sequelize[_0xfe8b('0x2')]()},'description':{'type':Sequelize[_0xfe8b('0x3')]},'interval':{'type':Sequelize[_0xfe8b('0x3')],'defaultValue':_0xfe8b('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b12232e..2ea1cf3 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 _0xd69f=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','eml-format'];(function(_0x5c62fc,_0x41431a){var _0x14c817=function(_0x34dd8a){while(--_0x34dd8a){_0x5c62fc['push'](_0x5c62fc['shift']());}};_0x14c817(++_0x41431a);}(_0xd69f,0x123));var _0xfd69=function(_0x294b9e,_0xf77b23){_0x294b9e=_0x294b9e-0x0;var _0x3079b4=_0xd69f[_0x294b9e];return _0x3079b4;};'use strict';var emlformat=require(_0xfd69('0x0'));var rimraf=require(_0xfd69('0x1'));var zipdir=require(_0xfd69('0x2'));var jsonpatch=require(_0xfd69('0x3'));var rp=require(_0xfd69('0x4'));var moment=require('moment');var BPromise=require(_0xfd69('0x5'));var Mustache=require('mustache');var util=require(_0xfd69('0x6'));var path=require(_0xfd69('0x7'));var sox=require(_0xfd69('0x8'));var csv=require(_0xfd69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd69('0xa'));var _=require(_0xfd69('0xb'));var squel=require('squel');var crypto=require(_0xfd69('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfd69('0x9'));var querystring=require(_0xfd69('0xd'));var Papa=require(_0xfd69('0xe'));var Redis=require('ioredis');var authService=require(_0xfd69('0xf'));var qs=require(_0xfd69('0x10'));var as=require(_0xfd69('0x11'));var hardwareService=require(_0xfd69('0x12'));var logger=require(_0xfd69('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd69('0x14'));var db=require(_0xfd69('0x15'))['db'];function respondWithStatusCode(_0x40f9f1,_0x221a7d){_0x221a7d=_0x221a7d||0xcc;return function(_0x437332){if(_0x437332){return _0x40f9f1['sendStatus'](_0x221a7d);}return _0x40f9f1['status'](_0x221a7d)[_0xfd69('0x16')]();};}function respondWithResult(_0x6fe277,_0xa88323){_0xa88323=_0xa88323||0xc8;return function(_0x2f3eae){if(_0x2f3eae){return _0x6fe277['status'](_0xa88323)[_0xfd69('0x17')](_0x2f3eae);}};}function respondWithFilteredResult(_0x35d3cb,_0x34300c){return function(_0xb86e77){if(_0xb86e77){var _0x1c9154=typeof _0x34300c[_0xfd69('0x18')]===_0xfd69('0x19')&&typeof _0x34300c['limit']==='undefined';var _0x5dd38c=_0xb86e77[_0xfd69('0x1a')];var _0x29140d=_0x1c9154?0x0:_0x34300c[_0xfd69('0x18')];var _0x5b8e8a=_0x1c9154?_0xb86e77['count']:_0x34300c['offset']+_0x34300c[_0xfd69('0x1b')];var _0x597828;if(_0x5b8e8a>=_0x5dd38c){_0x5b8e8a=_0x5dd38c;_0x597828=0xc8;}else{_0x597828=0xce;}_0x35d3cb[_0xfd69('0x1c')](_0x597828);return _0x35d3cb[_0xfd69('0x1d')](_0xfd69('0x1e'),_0x29140d+'-'+_0x5b8e8a+'/'+_0x5dd38c)[_0xfd69('0x17')](_0xb86e77);}return null;};}function patchUpdates(_0x2a888f){return function(_0x5b58ac){try{jsonpatch[_0xfd69('0x1f')](_0x5b58ac,_0x2a888f,!![]);}catch(_0x57d784){return BPromise[_0xfd69('0x20')](_0x57d784);}return _0x5b58ac[_0xfd69('0x21')]();};}function saveUpdates(_0x2d7c4e,_0xbe5cad){return function(_0x2dbb18){if(_0x2dbb18){return _0x2dbb18[_0xfd69('0x22')](_0x2d7c4e)[_0xfd69('0x23')](function(_0x16d78e){return _0x16d78e;});}return null;};}function removeEntity(_0x76f123,_0x378ada){return function(_0x125eef){if(_0x125eef){return _0x125eef['destroy']()[_0xfd69('0x23')](function(){_0x76f123[_0xfd69('0x1c')](0xcc)[_0xfd69('0x16')]();});}};}function handleEntityNotFound(_0x325e68,_0xa91584){return function(_0x979b35){if(!_0x979b35){_0x325e68[_0xfd69('0x24')](0x194);}return _0x979b35;};}function handleError(_0x1c29a5,_0x2237b7){_0x2237b7=_0x2237b7||0x1f4;return function(_0x429ef7){logger[_0xfd69('0x25')](_0x429ef7[_0xfd69('0x26')]);if(_0x429ef7[_0xfd69('0x27')]){delete _0x429ef7[_0xfd69('0x27')];}_0x1c29a5[_0xfd69('0x1c')](_0x2237b7)[_0xfd69('0x28')](_0x429ef7);};}exports[_0xfd69('0x29')]=function(_0x11de51,_0x5eee0d){var _0x2e6542={},_0x40b974={},_0x1d070d={'count':0x0,'rows':[]};var _0x4bed13=_[_0xfd69('0x2a')](db[_0xfd69('0x2b')][_0xfd69('0x2c')],function(_0x51edf1){return{'name':_0x51edf1['fieldName'],'type':_0x51edf1[_0xfd69('0x2d')][_0xfd69('0x2e')]};});_0x40b974[_0xfd69('0x2f')]=_[_0xfd69('0x2a')](_0x4bed13,_0xfd69('0x27'));_0x40b974[_0xfd69('0x30')]=_[_0xfd69('0x31')](_0x11de51[_0xfd69('0x30')]);_0x40b974[_0xfd69('0x32')]=_[_0xfd69('0x33')](_0x40b974['model'],_0x40b974[_0xfd69('0x30')]);_0x2e6542['attributes']=_['intersection'](_0x40b974[_0xfd69('0x2f')],qs[_0xfd69('0x34')](_0x11de51[_0xfd69('0x30')][_0xfd69('0x34')]));_0x2e6542[_0xfd69('0x35')]=_0x2e6542[_0xfd69('0x35')][_0xfd69('0x36')]?_0x2e6542[_0xfd69('0x35')]:_0x40b974[_0xfd69('0x2f')];if(!_0x11de51['query'][_0xfd69('0x37')]('nolimit')){_0x2e6542[_0xfd69('0x1b')]=qs[_0xfd69('0x1b')](_0x11de51[_0xfd69('0x30')][_0xfd69('0x1b')]);_0x2e6542[_0xfd69('0x18')]=qs[_0xfd69('0x18')](_0x11de51[_0xfd69('0x30')]['offset']);}_0x2e6542['order']=qs[_0xfd69('0x38')](_0x11de51[_0xfd69('0x30')][_0xfd69('0x38')]);_0x2e6542[_0xfd69('0x39')]=qs['filters'](_[_0xfd69('0x3a')](_0x11de51[_0xfd69('0x30')],_0x40b974[_0xfd69('0x32')]),_0x4bed13);if(_0x11de51[_0xfd69('0x30')]['filter']){_0x2e6542[_0xfd69('0x39')]=_[_0xfd69('0x3b')](_0x2e6542['where'],{'$or':_[_0xfd69('0x2a')](_0x4bed13,function(_0x57c14e){if(_0x57c14e[_0xfd69('0x2d')]!==_0xfd69('0x3c')){var _0x256afc={};_0x256afc[_0x57c14e[_0xfd69('0x27')]]={'$like':'%'+_0x11de51[_0xfd69('0x30')][_0xfd69('0x3d')]+'%'};return _0x256afc;}})});}_0x2e6542=_[_0xfd69('0x3b')]({},_0x2e6542,_0x11de51[_0xfd69('0x3e')]);var _0x1fe9e3={'where':_0x2e6542['where']};return db[_0xfd69('0x2b')][_0xfd69('0x1a')](_0x1fe9e3)['then'](function(_0x165f57){_0x1d070d[_0xfd69('0x1a')]=_0x165f57;if(_0x11de51['query'][_0xfd69('0x3f')]){_0x2e6542[_0xfd69('0x40')]=[{'all':!![]}];}return db[_0xfd69('0x2b')][_0xfd69('0x41')](_0x2e6542);})[_0xfd69('0x23')](function(_0x44b980){_0x1d070d[_0xfd69('0x42')]=_0x44b980;return _0x1d070d;})['then'](respondWithFilteredResult(_0x5eee0d,_0x2e6542))[_0xfd69('0x43')](handleError(_0x5eee0d,null));};exports[_0xfd69('0x44')]=function(_0xf6b29c,_0x692df2){var _0x1040da={'raw':!![],'where':{'id':_0xf6b29c[_0xfd69('0x45')]['id']}},_0x1e89d9={};_0x1e89d9['model']=_[_0xfd69('0x31')](db['OpenchannelApplication']['rawAttributes']);_0x1e89d9[_0xfd69('0x30')]=_[_0xfd69('0x31')](_0xf6b29c[_0xfd69('0x30')]);_0x1e89d9[_0xfd69('0x32')]=_['intersection'](_0x1e89d9['model'],_0x1e89d9[_0xfd69('0x30')]);_0x1040da[_0xfd69('0x35')]=_[_0xfd69('0x33')](_0x1e89d9[_0xfd69('0x2f')],qs['fields'](_0xf6b29c[_0xfd69('0x30')]['fields']));_0x1040da['attributes']=_0x1040da[_0xfd69('0x35')][_0xfd69('0x36')]?_0x1040da['attributes']:_0x1e89d9[_0xfd69('0x2f')];if(_0xf6b29c['query'][_0xfd69('0x3f')]){_0x1040da['include']=[{'all':!![]}];}_0x1040da=_[_0xfd69('0x3b')]({},_0x1040da,_0xf6b29c[_0xfd69('0x3e')]);return db['OpenchannelApplication'][_0xfd69('0x46')](_0x1040da)[_0xfd69('0x23')](handleEntityNotFound(_0x692df2,null))[_0xfd69('0x23')](respondWithResult(_0x692df2,null))[_0xfd69('0x43')](handleError(_0x692df2,null));};exports['create']=function(_0x42f67b,_0xe89be9){return db[_0xfd69('0x2b')]['create'](_0x42f67b[_0xfd69('0x47')],{})['then'](respondWithResult(_0xe89be9,0xc9))['catch'](handleError(_0xe89be9,null));};exports[_0xfd69('0x22')]=function(_0x418ecb,_0x164a85){if(_0x418ecb['body']['id']){delete _0x418ecb[_0xfd69('0x47')]['id'];}return db['OpenchannelApplication'][_0xfd69('0x46')]({'where':{'id':_0x418ecb[_0xfd69('0x45')]['id']}})[_0xfd69('0x23')](handleEntityNotFound(_0x164a85,null))[_0xfd69('0x23')](saveUpdates(_0x418ecb[_0xfd69('0x47')],null))[_0xfd69('0x23')](respondWithResult(_0x164a85,null))[_0xfd69('0x43')](handleError(_0x164a85,null));};exports[_0xfd69('0x48')]=function(_0x5bfee0,_0x13a806){return db[_0xfd69('0x2b')][_0xfd69('0x46')]({'where':{'id':_0x5bfee0[_0xfd69('0x45')]['id']}})['then'](handleEntityNotFound(_0x13a806,null))['then'](removeEntity(_0x13a806,null))[_0xfd69('0x43')](handleError(_0x13a806,null));}; \ No newline at end of file +var _0x9e04=['intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','query','keys','filters'];(function(_0x45db2d,_0x30b20b){var _0x40255c=function(_0x1bad41){while(--_0x1bad41){_0x45db2d['push'](_0x45db2d['shift']());}};_0x40255c(++_0x30b20b);}(_0x9e04,0x1d7));var _0x49e0=function(_0x4e01b7,_0x2ada88){_0x4e01b7=_0x4e01b7-0x0;var _0x4d78e9=_0x9e04[_0x4e01b7];return _0x4d78e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49e0('0x0'));var zipdir=require(_0x49e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49e0('0x2'));var moment=require(_0x49e0('0x3'));var BPromise=require(_0x49e0('0x4'));var Mustache=require(_0x49e0('0x5'));var util=require(_0x49e0('0x6'));var path=require('path');var sox=require(_0x49e0('0x7'));var csv=require(_0x49e0('0x8'));var ejs=require(_0x49e0('0x9'));var fs=require('fs');var fs_extra=require(_0x49e0('0xa'));var _=require(_0x49e0('0xb'));var squel=require(_0x49e0('0xc'));var crypto=require(_0x49e0('0xd'));var jsforce=require(_0x49e0('0xe'));var deskjs=require(_0x49e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x49e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x49e0('0x11'));var authService=require(_0x49e0('0x12'));var qs=require(_0x49e0('0x13'));var as=require(_0x49e0('0x14'));var hardwareService=require(_0x49e0('0x15'));var logger=require(_0x49e0('0x16'))(_0x49e0('0x17'));var utils=require('../../config/utils');var config=require(_0x49e0('0x18'));var licenseUtil=require(_0x49e0('0x19'));var db=require(_0x49e0('0x1a'))['db'];function respondWithStatusCode(_0x854174,_0x5e3348){_0x5e3348=_0x5e3348||0xcc;return function(_0x1864c7){if(_0x1864c7){return _0x854174['sendStatus'](_0x5e3348);}return _0x854174['status'](_0x5e3348)[_0x49e0('0x1b')]();};}function respondWithResult(_0x4e2483,_0x1ef879){_0x1ef879=_0x1ef879||0xc8;return function(_0x1b847b){if(_0x1b847b){return _0x4e2483['status'](_0x1ef879)[_0x49e0('0x1c')](_0x1b847b);}};}function respondWithFilteredResult(_0x8eb259,_0x947773){return function(_0x3bea72){if(_0x3bea72){var _0x93abcd=typeof _0x947773[_0x49e0('0x1d')]===_0x49e0('0x1e')&&typeof _0x947773['limit']==='undefined';var _0x2b2a87=_0x3bea72[_0x49e0('0x1f')];var _0x19572=_0x93abcd?0x0:_0x947773[_0x49e0('0x1d')];var _0x2739e4=_0x93abcd?_0x3bea72['count']:_0x947773[_0x49e0('0x1d')]+_0x947773[_0x49e0('0x20')];var _0x46d733;if(_0x2739e4>=_0x2b2a87){_0x2739e4=_0x2b2a87;_0x46d733=0xc8;}else{_0x46d733=0xce;}_0x8eb259[_0x49e0('0x21')](_0x46d733);return _0x8eb259[_0x49e0('0x22')](_0x49e0('0x23'),_0x19572+'-'+_0x2739e4+'/'+_0x2b2a87)[_0x49e0('0x1c')](_0x3bea72);}return null;};}function patchUpdates(_0x133243){return function(_0x2b3a4e){try{jsonpatch['apply'](_0x2b3a4e,_0x133243,!![]);}catch(_0x556e34){return BPromise['reject'](_0x556e34);}return _0x2b3a4e[_0x49e0('0x24')]();};}function saveUpdates(_0x1542c0,_0x245904){return function(_0x37e8dc){if(_0x37e8dc){return _0x37e8dc[_0x49e0('0x25')](_0x1542c0)[_0x49e0('0x26')](function(_0x4ab8fa){return _0x4ab8fa;});}return null;};}function removeEntity(_0xc67283,_0x20a6e0){return function(_0x35191f){if(_0x35191f){return _0x35191f[_0x49e0('0x27')]()[_0x49e0('0x26')](function(){_0xc67283[_0x49e0('0x21')](0xcc)[_0x49e0('0x1b')]();});}};}function handleEntityNotFound(_0x1a30a0,_0x38f003){return function(_0x440ba0){if(!_0x440ba0){_0x1a30a0[_0x49e0('0x28')](0x194);}return _0x440ba0;};}function handleError(_0x3789d3,_0x38cce4){_0x38cce4=_0x38cce4||0x1f4;return function(_0x135282){logger[_0x49e0('0x29')](_0x135282[_0x49e0('0x2a')]);if(_0x135282[_0x49e0('0x2b')]){delete _0x135282[_0x49e0('0x2b')];}_0x3789d3[_0x49e0('0x21')](_0x38cce4)[_0x49e0('0x2c')](_0x135282);};}exports[_0x49e0('0x2d')]=function(_0xd9c842,_0x3692d8){var _0xed0f5a={},_0x5b1d7f={},_0x4eeb8e={'count':0x0,'rows':[]};var _0x490f08=_[_0x49e0('0x2e')](db[_0x49e0('0x2f')][_0x49e0('0x30')],function(_0x1647a0){return{'name':_0x1647a0[_0x49e0('0x31')],'type':_0x1647a0[_0x49e0('0x32')]['key']};});_0x5b1d7f['model']=_[_0x49e0('0x2e')](_0x490f08,'name');_0x5b1d7f[_0x49e0('0x33')]=_[_0x49e0('0x34')](_0xd9c842['query']);_0x5b1d7f[_0x49e0('0x35')]=_[_0x49e0('0x36')](_0x5b1d7f[_0x49e0('0x37')],_0x5b1d7f['query']);_0xed0f5a[_0x49e0('0x38')]=_[_0x49e0('0x36')](_0x5b1d7f[_0x49e0('0x37')],qs[_0x49e0('0x39')](_0xd9c842[_0x49e0('0x33')][_0x49e0('0x39')]));_0xed0f5a[_0x49e0('0x38')]=_0xed0f5a[_0x49e0('0x38')][_0x49e0('0x3a')]?_0xed0f5a[_0x49e0('0x38')]:_0x5b1d7f[_0x49e0('0x37')];if(!_0xd9c842[_0x49e0('0x33')]['hasOwnProperty'](_0x49e0('0x3b'))){_0xed0f5a[_0x49e0('0x20')]=qs['limit'](_0xd9c842[_0x49e0('0x33')][_0x49e0('0x20')]);_0xed0f5a['offset']=qs['offset'](_0xd9c842[_0x49e0('0x33')][_0x49e0('0x1d')]);}_0xed0f5a[_0x49e0('0x3c')]=qs[_0x49e0('0x3d')](_0xd9c842['query'][_0x49e0('0x3d')]);_0xed0f5a[_0x49e0('0x3e')]=qs[_0x49e0('0x35')](_['pick'](_0xd9c842[_0x49e0('0x33')],_0x5b1d7f['filters']),_0x490f08);if(_0xd9c842['query'][_0x49e0('0x3f')]){_0xed0f5a[_0x49e0('0x3e')]=_[_0x49e0('0x40')](_0xed0f5a[_0x49e0('0x3e')],{'$or':_[_0x49e0('0x2e')](_0x490f08,function(_0x45e4a5){if(_0x45e4a5[_0x49e0('0x32')]!=='VIRTUAL'){var _0x5072a0={};_0x5072a0[_0x45e4a5[_0x49e0('0x2b')]]={'$like':'%'+_0xd9c842[_0x49e0('0x33')][_0x49e0('0x3f')]+'%'};return _0x5072a0;}})});}_0xed0f5a=_[_0x49e0('0x40')]({},_0xed0f5a,_0xd9c842[_0x49e0('0x41')]);var _0x58c75b={'where':_0xed0f5a['where']};return db[_0x49e0('0x2f')][_0x49e0('0x1f')](_0x58c75b)['then'](function(_0x55f24c){_0x4eeb8e[_0x49e0('0x1f')]=_0x55f24c;if(_0xd9c842[_0x49e0('0x33')][_0x49e0('0x42')]){_0xed0f5a[_0x49e0('0x43')]=[{'all':!![]}];}return db[_0x49e0('0x2f')]['findAll'](_0xed0f5a);})['then'](function(_0x54f42e){_0x4eeb8e[_0x49e0('0x44')]=_0x54f42e;return _0x4eeb8e;})[_0x49e0('0x26')](respondWithFilteredResult(_0x3692d8,_0xed0f5a))[_0x49e0('0x45')](handleError(_0x3692d8,null));};exports[_0x49e0('0x46')]=function(_0x2e8abd,_0x307bd2){var _0x507267={'raw':!![],'where':{'id':_0x2e8abd['params']['id']}},_0x453725={};_0x453725[_0x49e0('0x37')]=_[_0x49e0('0x34')](db[_0x49e0('0x2f')][_0x49e0('0x30')]);_0x453725[_0x49e0('0x33')]=_['keys'](_0x2e8abd[_0x49e0('0x33')]);_0x453725[_0x49e0('0x35')]=_[_0x49e0('0x36')](_0x453725[_0x49e0('0x37')],_0x453725[_0x49e0('0x33')]);_0x507267[_0x49e0('0x38')]=_[_0x49e0('0x36')](_0x453725[_0x49e0('0x37')],qs[_0x49e0('0x39')](_0x2e8abd[_0x49e0('0x33')][_0x49e0('0x39')]));_0x507267[_0x49e0('0x38')]=_0x507267['attributes']['length']?_0x507267[_0x49e0('0x38')]:_0x453725[_0x49e0('0x37')];if(_0x2e8abd['query'][_0x49e0('0x42')]){_0x507267[_0x49e0('0x43')]=[{'all':!![]}];}_0x507267=_[_0x49e0('0x40')]({},_0x507267,_0x2e8abd['options']);return db[_0x49e0('0x2f')][_0x49e0('0x47')](_0x507267)[_0x49e0('0x26')](handleEntityNotFound(_0x307bd2,null))[_0x49e0('0x26')](respondWithResult(_0x307bd2,null))[_0x49e0('0x45')](handleError(_0x307bd2,null));};exports[_0x49e0('0x48')]=function(_0x583880,_0x1745b2){return db['OpenchannelApplication'][_0x49e0('0x48')](_0x583880[_0x49e0('0x49')],{})[_0x49e0('0x26')](respondWithResult(_0x1745b2,0xc9))[_0x49e0('0x45')](handleError(_0x1745b2,null));};exports[_0x49e0('0x25')]=function(_0x3febd6,_0x2b94d6){if(_0x3febd6[_0x49e0('0x49')]['id']){delete _0x3febd6[_0x49e0('0x49')]['id'];}return db[_0x49e0('0x2f')][_0x49e0('0x47')]({'where':{'id':_0x3febd6[_0x49e0('0x4a')]['id']}})[_0x49e0('0x26')](handleEntityNotFound(_0x2b94d6,null))['then'](saveUpdates(_0x3febd6['body'],null))[_0x49e0('0x26')](respondWithResult(_0x2b94d6,null))[_0x49e0('0x45')](handleError(_0x2b94d6,null));};exports['destroy']=function(_0x16cf40,_0xd1da3f){return db[_0x49e0('0x2f')][_0x49e0('0x47')]({'where':{'id':_0x16cf40['params']['id']}})[_0x49e0('0x26')](handleEntityNotFound(_0xd1da3f,null))[_0x49e0('0x26')](removeEntity(_0xd1da3f,null))[_0x49e0('0x45')](handleError(_0xd1da3f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a6f0943..ae6d636 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 _0xaad1=['exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','./openchannelApplication.attributes'];(function(_0x4c5984,_0x4c3cae){var _0x33df91=function(_0x5b1f06){while(--_0x5b1f06){_0x4c5984['push'](_0x4c5984['shift']());}};_0x33df91(++_0x4c3cae);}(_0xaad1,0x1b2));var _0x1aad=function(_0x3d3b31,_0x567bc0){_0x3d3b31=_0x3d3b31-0x0;var _0x2f4792=_0xaad1[_0x3d3b31];return _0x2f4792;};'use strict';var _=require(_0x1aad('0x0'));var util=require(_0x1aad('0x1'));var logger=require(_0x1aad('0x2'))(_0x1aad('0x3'));var moment=require('moment');var BPromise=require(_0x1aad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1aad('0x5'));var rimraf=require(_0x1aad('0x6'));var config=require('../../config/environment');var attributes=require(_0x1aad('0x7'));module[_0x1aad('0x8')]=function(_0x42b363,_0x41444f){return _0x42b363[_0x1aad('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x1aad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1aad('0xb'),'collate':_0x1aad('0xc')});}; \ No newline at end of file +var _0xbb07=['bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3e7555,_0x442ce2){var _0x3719e9=function(_0x1825e1){while(--_0x1825e1){_0x3e7555['push'](_0x3e7555['shift']());}};_0x3719e9(++_0x442ce2);}(_0xbb07,0x1eb));var _0x7bb0=function(_0x2c1456,_0x2506c6){_0x2c1456=_0x2c1456-0x0;var _0x3bf6b8=_0xbb07[_0x2c1456];return _0x3bf6b8;};'use strict';var _=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var logger=require(_0x7bb0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7bb0('0x3'));var rp=require(_0x7bb0('0x4'));var fs=require('fs');var path=require(_0x7bb0('0x5'));var rimraf=require('rimraf');var config=require(_0x7bb0('0x6'));var attributes=require(_0x7bb0('0x7'));module[_0x7bb0('0x8')]=function(_0x6b99a2,_0x581ef5){return _0x6b99a2['define'](_0x7bb0('0x9'),attributes,{'tableName':_0x7bb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bb0('0xb'),'collate':_0x7bb0('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 559d9fd..2cfcc61 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 _0x9fd2=['raw','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options'];(function(_0x22835e,_0x14ffec){var _0xb85ef9=function(_0x358f09){while(--_0x358f09){_0x22835e['push'](_0x22835e['shift']());}};_0xb85ef9(++_0x14ffec);}(_0x9fd2,0x112));var _0x29fd=function(_0x468afb,_0x577de4){_0x468afb=_0x468afb-0x0;var _0x30e273=_0x9fd2[_0x468afb];return _0x30e273;};'use strict';var _=require(_0x29fd('0x0'));var util=require('util');var moment=require(_0x29fd('0x1'));var BPromise=require('bluebird');var rs=require(_0x29fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29fd('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29fd('0x4'));var config=require(_0x29fd('0x5'));var jayson=require(_0x29fd('0x6'));var client=jayson[_0x29fd('0x7')][_0x29fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65c69a,_0x2ecb44,_0x394ca9){return new BPromise(function(_0x4b1f4d,_0x415332){return client[_0x29fd('0x9')](_0x65c69a,_0x394ca9)[_0x29fd('0xa')](function(_0x5a33df){logger['info'](_0x29fd('0xb'),_0x2ecb44,_0x29fd('0xc'));logger[_0x29fd('0xd')](_0x29fd('0xe'),_0x2ecb44,_0x29fd('0xc'),JSON[_0x29fd('0xf')](_0x5a33df));if(_0x5a33df['error']){if(_0x5a33df[_0x29fd('0x10')][_0x29fd('0x11')]===0x1f4){logger[_0x29fd('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ecb44,_0x5a33df[_0x29fd('0x10')][_0x29fd('0x12')]);return _0x415332(_0x5a33df[_0x29fd('0x10')]['message']);}logger[_0x29fd('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ecb44,_0x5a33df[_0x29fd('0x10')]['message']);return _0x4b1f4d(_0x5a33df[_0x29fd('0x10')][_0x29fd('0x12')]);}else{logger[_0x29fd('0x13')](_0x29fd('0xb'),_0x2ecb44,'request\x20sent');_0x4b1f4d(_0x5a33df[_0x29fd('0x14')][_0x29fd('0x12')]);}})['catch'](function(_0x4da386){logger[_0x29fd('0x10')](_0x29fd('0xb'),_0x2ecb44,_0x4da386);_0x415332(_0x4da386);});});}exports[_0x29fd('0x15')]=function(_0x1b652a){var _0xe58adf=this;return new Promise(function(_0x12f9d5,_0x5c6bff){return db[_0x29fd('0x16')][_0x29fd('0x17')](_0x1b652a[_0x29fd('0x18')],{'raw':_0x1b652a['options']?_0x1b652a[_0x29fd('0x19')][_0x29fd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b652a[_0x29fd('0x19')]?_0x1b652a['options'][_0x29fd('0x1b')]||null:null,'attributes':_0x1b652a[_0x29fd('0x19')]?_0x1b652a[_0x29fd('0x19')][_0x29fd('0x1c')]||null:null,'limit':_0x1b652a[_0x29fd('0x19')]?_0x1b652a['options'][_0x29fd('0x1d')]||null:null})[_0x29fd('0xa')](function(_0x2a3f27){logger[_0x29fd('0x13')](_0x29fd('0x15'),_0x1b652a);logger[_0x29fd('0xd')]('UpdateOpenchannelApplication',_0x1b652a,JSON[_0x29fd('0xf')](_0x2a3f27));_0x12f9d5(_0x2a3f27);})['catch'](function(_0x4cb299){logger[_0x29fd('0x10')](_0x29fd('0x15'),_0x4cb299[_0x29fd('0x12')],_0x1b652a);_0x5c6bff(_0xe58adf[_0x29fd('0x10')](0x1f4,_0x4cb299[_0x29fd('0x12')]));});});}; \ No newline at end of file +var _0x1b1f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','options','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ec65c,_0x354923){var _0x5249c2=function(_0x451341){while(--_0x451341){_0x1ec65c['push'](_0x1ec65c['shift']());}};_0x5249c2(++_0x354923);}(_0x1b1f,0x110));var _0xf1b1=function(_0x2cd391,_0x2369c9){_0x2cd391=_0x2cd391-0x0;var _0x4688d9=_0x1b1f[_0x2cd391];return _0x4688d9;};'use strict';var _=require(_0xf1b1('0x0'));var util=require(_0xf1b1('0x1'));var moment=require(_0xf1b1('0x2'));var BPromise=require(_0xf1b1('0x3'));var rs=require(_0xf1b1('0x4'));var fs=require('fs');var Redis=require(_0xf1b1('0x5'));var db=require(_0xf1b1('0x6'))['db'];var utils=require(_0xf1b1('0x7'));var logger=require(_0xf1b1('0x8'))(_0xf1b1('0x9'));var config=require(_0xf1b1('0xa'));var jayson=require(_0xf1b1('0xb'));var client=jayson[_0xf1b1('0xc')][_0xf1b1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x44af59,_0x1a3a5f,_0x21c744){return new BPromise(function(_0x2fc052,_0x3079f5){return client['request'](_0x44af59,_0x21c744)[_0xf1b1('0xe')](function(_0x32753a){logger[_0xf1b1('0xf')](_0xf1b1('0x10'),_0x1a3a5f,_0xf1b1('0x11'));logger[_0xf1b1('0x12')](_0xf1b1('0x13'),_0x1a3a5f,_0xf1b1('0x11'),JSON['stringify'](_0x32753a));if(_0x32753a[_0xf1b1('0x14')]){if(_0x32753a[_0xf1b1('0x14')][_0xf1b1('0x15')]===0x1f4){logger[_0xf1b1('0x14')](_0xf1b1('0x10'),_0x1a3a5f,_0x32753a[_0xf1b1('0x14')]['message']);return _0x3079f5(_0x32753a[_0xf1b1('0x14')][_0xf1b1('0x16')]);}logger[_0xf1b1('0x14')](_0xf1b1('0x10'),_0x1a3a5f,_0x32753a[_0xf1b1('0x14')][_0xf1b1('0x16')]);return _0x2fc052(_0x32753a[_0xf1b1('0x14')][_0xf1b1('0x16')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x1a3a5f,_0xf1b1('0x11'));_0x2fc052(_0x32753a[_0xf1b1('0x17')][_0xf1b1('0x16')]);}})[_0xf1b1('0x18')](function(_0x17e333){logger[_0xf1b1('0x14')](_0xf1b1('0x10'),_0x1a3a5f,_0x17e333);_0x3079f5(_0x17e333);});});}exports[_0xf1b1('0x19')]=function(_0x3d0d24){var _0x3d3ca1=this;return new Promise(function(_0x19c587,_0x425d96){return db[_0xf1b1('0x1a')]['update'](_0x3d0d24['body'],{'raw':_0x3d0d24[_0xf1b1('0x1b')]?_0x3d0d24[_0xf1b1('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d0d24[_0xf1b1('0x1b')]?_0x3d0d24[_0xf1b1('0x1b')][_0xf1b1('0x1c')]||null:null,'attributes':_0x3d0d24[_0xf1b1('0x1b')]?_0x3d0d24['options'][_0xf1b1('0x1d')]||null:null,'limit':_0x3d0d24[_0xf1b1('0x1b')]?_0x3d0d24[_0xf1b1('0x1b')]['limit']||null:null})[_0xf1b1('0xe')](function(_0x142884){logger['info'](_0xf1b1('0x19'),_0x3d0d24);logger[_0xf1b1('0x12')]('UpdateOpenchannelApplication',_0x3d0d24,JSON[_0xf1b1('0x1e')](_0x142884));_0x19c587(_0x142884);})[_0xf1b1('0x18')](function(_0xc0cc24){logger[_0xf1b1('0x14')](_0xf1b1('0x19'),_0xc0cc24[_0xf1b1('0x16')],_0x3d0d24);_0x425d96(_0x3d3ca1[_0xf1b1('0x14')](0x1f4,_0xc0cc24[_0xf1b1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 8e5c9d1..eebe145 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 _0x88ba=['addMessage','tracked','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','/:id/tags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x88ba,0x12a));var _0xa88b=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x88ba[_0x19f9e6];return _0x45c862;};'use strict';var multer=require(_0xa88b('0x0'));var util=require(_0xa88b('0x1'));var path=require('path');var timeout=require(_0xa88b('0x2'));var express=require(_0xa88b('0x3'));var router=express[_0xa88b('0x4')]();var fs_extra=require(_0xa88b('0x5'));var auth=require(_0xa88b('0x6'));var interaction=require(_0xa88b('0x7'));var config=require(_0xa88b('0x8'));var controller=require(_0xa88b('0x9'));router[_0xa88b('0xa')]('/',auth[_0xa88b('0xb')](),controller[_0xa88b('0xc')]);router[_0xa88b('0xa')](_0xa88b('0xd'),auth['isAuthenticated'](),controller[_0xa88b('0xe')]);router[_0xa88b('0xa')](_0xa88b('0xf'),auth[_0xa88b('0xb')](),controller['show']);router[_0xa88b('0xa')]('/:id/messages',auth[_0xa88b('0xb')](),controller[_0xa88b('0x10')]);router['get'](_0xa88b('0x11'),auth[_0xa88b('0xb')](),controller[_0xa88b('0x12')]);router[_0xa88b('0x13')]('/',auth[_0xa88b('0xb')](),controller[_0xa88b('0x14')]);router[_0xa88b('0x13')](_0xa88b('0x15'),auth[_0xa88b('0xb')](),controller[_0xa88b('0x16')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xa88b('0x17')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0xa88b('0x18')](_0xa88b('0xf'),auth[_0xa88b('0xb')](),interaction[_0xa88b('0x17')](_0xa88b('0x19'),_0xa88b('0x1a')),controller[_0xa88b('0x1b')]);router[_0xa88b('0x1c')](_0xa88b('0xf'),auth[_0xa88b('0xb')](),interaction['tracked'](_0xa88b('0x19'),_0xa88b('0x1d')),controller['destroy']);router['delete'](_0xa88b('0x1e'),auth[_0xa88b('0xb')](),controller['removeTags']);module[_0xa88b('0x1f')]=router; \ No newline at end of file +var _0xdf9b=['show','/:id/messages','getMessages','/:id/download','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xdf9b,0x186));var _0xbdf9=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xdf9b[_0x4c445a];return _0x2f611c;};'use strict';var multer=require('multer');var util=require(_0xbdf9('0x0'));var path=require(_0xbdf9('0x1'));var timeout=require(_0xbdf9('0x2'));var express=require(_0xbdf9('0x3'));var router=express['Router']();var fs_extra=require(_0xbdf9('0x4'));var auth=require(_0xbdf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbdf9('0x6'));var controller=require('./openchannelInteraction.controller');router[_0xbdf9('0x7')]('/',auth[_0xbdf9('0x8')](),controller[_0xbdf9('0x9')]);router[_0xbdf9('0x7')](_0xbdf9('0xa'),auth[_0xbdf9('0x8')](),controller[_0xbdf9('0xb')]);router['get'](_0xbdf9('0xc'),auth[_0xbdf9('0x8')](),controller[_0xbdf9('0xd')]);router[_0xbdf9('0x7')](_0xbdf9('0xe'),auth['isAuthenticated'](),controller[_0xbdf9('0xf')]);router[_0xbdf9('0x7')](_0xbdf9('0x10'),auth[_0xbdf9('0x8')](),controller['download']);router['post']('/',auth[_0xbdf9('0x8')](),controller['create']);router['post'](_0xbdf9('0xe'),auth[_0xbdf9('0x8')](),controller[_0xbdf9('0x11')]);router['post'](_0xbdf9('0x12'),auth[_0xbdf9('0x8')](),interaction['tracked'](_0xbdf9('0x13'),_0xbdf9('0x14')),controller[_0xbdf9('0x15')]);router[_0xbdf9('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0xbdf9('0x17')](_0xbdf9('0x13'),_0xbdf9('0x18')),controller[_0xbdf9('0x19')]);router[_0xbdf9('0x1a')]('/:id',auth[_0xbdf9('0x8')](),interaction[_0xbdf9('0x17')](_0xbdf9('0x13'),_0xbdf9('0x1b')),controller[_0xbdf9('0x1c')]);router[_0xbdf9('0x1a')](_0xbdf9('0x12'),auth['isAuthenticated'](),controller[_0xbdf9('0x1d')]);module[_0xbdf9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 3a198d2..61edc6d 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 _0x6ae0=['sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0xb42ec7,_0x4a0132){var _0x5824d5=function(_0x3dfd6f){while(--_0x3dfd6f){_0xb42ec7['push'](_0xb42ec7['shift']());}};_0x5824d5(++_0x4a0132);}(_0x6ae0,0x192));var _0x06ae=function(_0x34e4c8,_0x3508e4){_0x34e4c8=_0x34e4c8-0x0;var _0x25ccc3=_0x6ae0[_0x34e4c8];return _0x25ccc3;};'use strict';var Sequelize=require(_0x06ae('0x0'));module[_0x06ae('0x1')]={'closed':{'type':Sequelize[_0x06ae('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x06ae('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x06ae('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x06ae('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x06ae('0x4')]},'lastMsgAt':{'type':Sequelize[_0x06ae('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x06ae('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x06ae('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x06ae('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa049=['exports','DATE','STRING','out','ENUM','BOOLEAN','sequelize'];(function(_0x1de46e,_0xd58bc9){var _0x2bb5ed=function(_0x4f62f6){while(--_0x4f62f6){_0x1de46e['push'](_0x1de46e['shift']());}};_0x2bb5ed(++_0xd58bc9);}(_0xa049,0x1db));var _0x9a04=function(_0x4a858b,_0x270c1c){_0x4a858b=_0x4a858b-0x0;var _0x5ae6a0=_0xa049[_0x4a858b];return _0x5ae6a0;};'use strict';var Sequelize=require(_0x9a04('0x0'));module[_0x9a04('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9a04('0x2')]},'disposition':{'type':Sequelize[_0x9a04('0x3')]},'secondDisposition':{'type':Sequelize[_0x9a04('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9a04('0x3')]},'note':{'type':Sequelize[_0x9a04('0x3')]},'read1stAt':{'type':Sequelize[_0x9a04('0x2')]},'threadId':{'type':Sequelize[_0x9a04('0x3')]},'externalUrl':{'type':Sequelize[_0x9a04('0x3')]},'lastMsgAt':{'type':Sequelize[_0x9a04('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9a04('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9a04('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9a04('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x9a04('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 1442127..b1771a9 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 _0x5990=['sort','pick','OpenchannelInteractionId','filter','where','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','rows','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','OpenchannelAccount','Account','Owner','fullname','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','existsSync','pipe','createWriteStream','out','System','basename','read','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','zip-dir','path','ejs','ioredis','../../config/logger','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','update','destroy','then','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','catch','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty'];(function(_0x399363,_0x1214e0){var _0x24c844=function(_0x2618d6){while(--_0x2618d6){_0x399363['push'](_0x399363['shift']());}};_0x24c844(++_0x1214e0);}(_0x5990,0xbc));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x0599('0x0'));var moment=require('moment');var util=require('util');var path=require(_0x0599('0x1'));var ejs=require(_0x0599('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0599('0x3'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x0599('0x4'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0599('0x5')]=_[_0x0599('0x6')](config[_0x0599('0x5')],{'host':_0x0599('0x7'),'port':0x18eb});var socket=require(_0x0599('0x8'))(new Redis(config[_0x0599('0x5')]));require(_0x0599('0x9'))[_0x0599('0xa')](socket);function respondWithStatusCode(_0xb5063b,_0x47a463){_0x47a463=_0x47a463||0xcc;return function(_0x520af1){if(_0x520af1){return _0xb5063b[_0x0599('0xb')](_0x47a463);}return _0xb5063b['status'](_0x47a463)[_0x0599('0xc')]();};}function respondWithResult(_0x226f2d,_0x4451bf){_0x4451bf=_0x4451bf||0xc8;return function(_0x5788e4){if(_0x5788e4){return _0x226f2d['status'](_0x4451bf)['json'](_0x5788e4);}};}function respondWithFilteredResult(_0x54c0c3,_0x1fa24c){return function(_0x5a7b4f){if(_0x5a7b4f){var _0x13c4e7=typeof _0x1fa24c[_0x0599('0xd')]===_0x0599('0xe')&&typeof _0x1fa24c[_0x0599('0xf')]===_0x0599('0xe');var _0x46df04=_0x5a7b4f[_0x0599('0x10')];var _0xd9acc2=_0x13c4e7?0x0:_0x1fa24c['offset'];var _0x41fd69=_0x13c4e7?_0x5a7b4f[_0x0599('0x10')]:_0x1fa24c['offset']+_0x1fa24c[_0x0599('0xf')];var _0x513e59;if(_0x41fd69>=_0x46df04){_0x41fd69=_0x46df04;_0x513e59=0xc8;}else{_0x513e59=0xce;}_0x54c0c3[_0x0599('0x11')](_0x513e59);return _0x54c0c3[_0x0599('0x12')](_0x0599('0x13'),_0xd9acc2+'-'+_0x41fd69+'/'+_0x46df04)[_0x0599('0x14')](_0x5a7b4f);}return null;};}function saveUpdates(_0x511bc2){return function(_0xabe67b){if(_0xabe67b){return _0xabe67b[_0x0599('0x15')](_0x511bc2)['then'](function(_0x1bd2f8){return _0x1bd2f8;});}return null;};}function removeEntity(_0x58cca0){return function(_0x5f3d57){if(_0x5f3d57){return _0x5f3d57[_0x0599('0x16')]()[_0x0599('0x17')](function(){_0x58cca0['status'](0xcc)[_0x0599('0xc')]();});}};}function handleEntityNotFound(_0x451efd){return function(_0x21a515){if(!_0x21a515){_0x451efd[_0x0599('0xb')](0x194);}return _0x21a515;};}function handleError(_0x2e0f71,_0x29ed83){_0x29ed83=_0x29ed83||0x1f4;return function(_0x28c7ed){logger['error'](_0x28c7ed[_0x0599('0x18')]);if(_0x28c7ed[_0x0599('0x19')]){delete _0x28c7ed[_0x0599('0x19')];}_0x2e0f71[_0x0599('0x11')](_0x29ed83)[_0x0599('0x1a')](_0x28c7ed);};}exports[_0x0599('0x1b')]=function(_0x52d81d,_0x58fd1f){var _0x482652={};var _0x43f345=_[_0x0599('0x1c')](db[_0x0599('0x1d')][_0x0599('0x1e')],function(_0x4bdc57){return{'name':_0x4bdc57[_0x0599('0x1f')],'type':_0x4bdc57[_0x0599('0x20')]['key']};});_0x482652=qs[_0x0599('0x21')](_0x43f345,_0x52d81d);return interaction[_0x0599('0x22')](_0x0599('0x23'),_0x52d81d[_0x0599('0x24')],_0x52d81d['user'],_0x482652,_0x43f345)[_0x0599('0x17')](respondWithFilteredResult(_0x58fd1f,_0x482652))[_0x0599('0x25')](handleError(_0x58fd1f,null));};exports['show']=function(_0x2b6863,_0x52a17c){var _0x25bd0c={};if(_0x2b6863['query']['type']&&_0x2b6863[_0x0599('0x24')][_0x0599('0x20')]===_0x0599('0x26')){_0x25bd0c['from']=_0x2b6863[_0x0599('0x27')]['id'];}else{_0x25bd0c['id']=_0x2b6863[_0x0599('0x27')]['id'];}var _0x1b53eb={'raw':![],'where':_0x25bd0c},_0x4cff55={};_0x4cff55[_0x0599('0x28')]=_[_0x0599('0x29')](db[_0x0599('0x1d')]['rawAttributes']);_0x4cff55[_0x0599('0x24')]=_[_0x0599('0x29')](_0x2b6863[_0x0599('0x24')]);_0x4cff55[_0x0599('0x2a')]=_[_0x0599('0x2b')](_0x4cff55[_0x0599('0x28')],_0x4cff55[_0x0599('0x24')]);_0x1b53eb[_0x0599('0x2c')]=_[_0x0599('0x2b')](_0x4cff55[_0x0599('0x28')],qs[_0x0599('0x2d')](_0x2b6863[_0x0599('0x24')][_0x0599('0x2d')]));_0x1b53eb[_0x0599('0x2c')]=_0x1b53eb[_0x0599('0x2c')][_0x0599('0x2e')]?_0x1b53eb['attributes']:_0x4cff55[_0x0599('0x28')];if(_0x2b6863['query'][_0x0599('0x2f')]){_0x1b53eb[_0x0599('0x30')]=[{'all':!![]}];}_0x1b53eb=_['merge']({},_0x1b53eb,_0x2b6863[_0x0599('0x31')]);return db[_0x0599('0x1d')][_0x0599('0x32')](_0x1b53eb)['then'](handleEntityNotFound(_0x52a17c,null))[_0x0599('0x17')](respondWithResult(_0x52a17c,null))[_0x0599('0x25')](handleError(_0x52a17c,null));};exports[_0x0599('0x33')]=function(_0x317968,_0x354802){return db[_0x0599('0x1d')][_0x0599('0x33')](_0x317968['body'],{})[_0x0599('0x17')](respondWithResult(_0x354802,0xc9))[_0x0599('0x25')](handleError(_0x354802,null));};exports[_0x0599('0x15')]=function(_0x5816b8,_0x2309cc){if(_0x5816b8[_0x0599('0x34')]['id']){delete _0x5816b8[_0x0599('0x34')]['id'];}return db['OpenchannelInteraction'][_0x0599('0x32')]({'where':{'id':_0x5816b8[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x2309cc,null))[_0x0599('0x17')](saveUpdates(_0x5816b8[_0x0599('0x34')],null))[_0x0599('0x17')](respondWithResult(_0x2309cc,null))[_0x0599('0x25')](handleError(_0x2309cc,null));};exports[_0x0599('0x16')]=function(_0x48b4cc,_0x1123a7){return db[_0x0599('0x1d')][_0x0599('0x32')]({'where':{'id':_0x48b4cc['params']['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x1123a7,null))[_0x0599('0x17')](removeEntity(_0x1123a7,null))['catch'](handleError(_0x1123a7,null));};exports['describe']=function(_0x26beeb,_0x271674){return db[_0x0599('0x1d')][_0x0599('0x35')]()[_0x0599('0x17')](respondWithResult(_0x271674,null))[_0x0599('0x25')](handleError(_0x271674,null));};exports[_0x0599('0x36')]=function(_0xcd3e18,_0x1a199f){return db['OpenchannelMessage'][_0x0599('0x32')]({'where':{'id':_0xcd3e18[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x1a199f,null))[_0x0599('0x17')](function(_0x3f5804){if(_0x3f5804){return _0x3f5804[_0x0599('0x36')](_0xcd3e18[_0x0599('0x34')][_0x0599('0x37')],_[_0x0599('0x38')](_0xcd3e18[_0x0599('0x34')],[_0x0599('0x37'),'id'])||{});}})['then'](respondWithResult(_0x1a199f,null))[_0x0599('0x25')](handleError(_0x1a199f,null));};exports[_0x0599('0x39')]=function(_0x728c8d,_0x25b4c1){var _0x2d3a23={'raw':![],'where':{}};var _0x361c5d={};var _0x559c0d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x0599('0x3a')]({'where':{'id':_0x728c8d[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x25b4c1,null))[_0x0599('0x17')](function(_0x3f670f){if(_0x3f670f){_0x361c5d[_0x0599('0x28')]=_['keys'](db['OpenchannelMessage'][_0x0599('0x1e')]);_0x361c5d['query']=_[_0x0599('0x29')](_0x728c8d[_0x0599('0x24')]);_0x361c5d[_0x0599('0x2a')]=_[_0x0599('0x2b')](_0x361c5d[_0x0599('0x28')],_0x361c5d[_0x0599('0x24')]);_0x2d3a23['attributes']=_[_0x0599('0x2b')](_0x361c5d[_0x0599('0x28')],qs[_0x0599('0x2d')](_0x728c8d[_0x0599('0x24')]['fields']));_0x2d3a23['attributes']=_0x2d3a23['attributes'][_0x0599('0x2e')]?_0x2d3a23['attributes']:_0x361c5d[_0x0599('0x28')];if(!_0x728c8d[_0x0599('0x24')][_0x0599('0x3b')]('nolimit')){_0x2d3a23['limit']=qs['limit'](_0x728c8d[_0x0599('0x24')][_0x0599('0xf')]);_0x2d3a23[_0x0599('0xd')]=qs[_0x0599('0xd')](_0x728c8d['query']['offset']);}_0x2d3a23['order']=qs[_0x0599('0x3c')](_0x728c8d[_0x0599('0x24')][_0x0599('0x3c')]);_0x2d3a23['where']=qs[_0x0599('0x2a')](_[_0x0599('0x3d')](_0x728c8d[_0x0599('0x24')],_0x361c5d[_0x0599('0x2a')]));_0x2d3a23['where'][_0x0599('0x3e')]=_0x3f670f['id'];if(_0x728c8d[_0x0599('0x24')][_0x0599('0x3f')]){_0x2d3a23[_0x0599('0x40')]=_[_0x0599('0x41')](_0x2d3a23['where'],{'$or':_[_0x0599('0x1c')](_0x2d3a23['attributes'],function(_0x1d96ce){var _0x13ddad={};_0x13ddad[_0x1d96ce]={'$like':'%'+_0x728c8d[_0x0599('0x24')][_0x0599('0x3f')]+'%'};return _0x13ddad;})});}if(_0x728c8d['query'][_0x0599('0x42')]){var _0x21fd8f=_0x728c8d[_0x0599('0x24')][_0x0599('0x42')]['split'](',');var _0x511435={};_0x511435[_0x21fd8f[0x0]]={'$gte':moment(_0x21fd8f[0x1])[_0x0599('0x43')](_0x0599('0x44'))};_0x2d3a23[_0x0599('0x40')]=_[_0x0599('0x41')](_0x2d3a23[_0x0599('0x40')],_0x511435);}_0x2d3a23=_[_0x0599('0x41')]({},_0x2d3a23,_0x728c8d[_0x0599('0x31')]);return db[_0x0599('0x45')]['count']({'where':_0x2d3a23['where']})[_0x0599('0x17')](function(_0xc788ee){_0x559c0d[_0x0599('0x10')]=_0xc788ee;if(_0x728c8d['query'][_0x0599('0x2f')]){_0x2d3a23['include']=[{'all':!![]}];}return db[_0x0599('0x45')][_0x0599('0x22')](_0x2d3a23);})['then'](function(_0x58fd1d){_0x559c0d[_0x0599('0x46')]=_0x58fd1d;return _0x559c0d;});}})['then'](respondWithFilteredResult(_0x25b4c1,_0x2d3a23))[_0x0599('0x25')](handleError(_0x25b4c1,null));};exports[_0x0599('0x47')]=function(_0x99b255,_0x341b0c){return db['OpenchannelInteraction'][_0x0599('0x32')]({'where':{'id':_0x99b255[_0x0599('0x27')]['id']}})[_0x0599('0x17')](handleEntityNotFound(_0x341b0c,null))[_0x0599('0x17')](function(_0x1755d8){if(_0x1755d8){return _0x1755d8[_0x0599('0x48')](_0x99b255[_0x0599('0x34')]['ids'],_[_0x0599('0x38')](_0x99b255[_0x0599('0x34')],[_0x0599('0x37'),'id'])||{})['spread'](function(){return db[_0x0599('0x49')]['findAll']({'attributes':['id',_0x0599('0x19'),_0x0599('0x4a')],'where':{'id':_0x99b255[_0x0599('0x34')][_0x0599('0x37')]}});})[_0x0599('0x17')](function(_0x1b47eb){socket[_0x0599('0x4b')](_0x0599('0x4c'),{'id':Number(_0x99b255[_0x0599('0x27')]['id']),'tags':_0x1b47eb||[]});return{'id':Number(_0x99b255[_0x0599('0x27')]['id']),'tags':_0x1b47eb||[]};});}})[_0x0599('0x17')](respondWithResult(_0x341b0c,null))['catch'](handleError(_0x341b0c,null));};exports['removeTags']=function(_0x1f1d86,_0x237714){return db[_0x0599('0x1d')][_0x0599('0x32')]({'where':{'id':_0x1f1d86[_0x0599('0x27')]['id']}})['then'](handleEntityNotFound(_0x237714,null))[_0x0599('0x17')](function(_0xdeda6d){if(_0xdeda6d){return _0xdeda6d[_0x0599('0x4d')](_0x1f1d86[_0x0599('0x24')][_0x0599('0x37')]);}})['then'](respondWithStatusCode(_0x237714,null))[_0x0599('0x25')](handleError(_0x237714,null));};exports[_0x0599('0x4e')]=function(_0xb4b72a,_0x813309){var _0x29f89d=moment()[_0x0599('0x4f')]()[_0x0599('0x50')]();var _0x121950=path[_0x0599('0x51')](config[_0x0599('0x52')],_0x0599('0x53'),_0x0599('0x54'),_0x0599('0x55'));var _0x58e0e9=path[_0x0599('0x51')](config['root'],'server',_0x0599('0x54'),_0x0599('0x56'));var _0x13a5ca=path['join'](_0x121950,_0x29f89d);var _0x487c83=util[_0x0599('0x43')](_0x0599('0x57'),_0xb4b72a[_0x0599('0x27')]['id'],_0x29f89d);var _0x5f4a93=path[_0x0599('0x51')](_0x121950,_0x487c83);var _0x50ca7f=[];_0x50ca7f[_0x0599('0x58')]({'model':db[_0x0599('0x59')],'as':_0x0599('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x50ca7f[_0x0599('0x58')]({'model':db[_0x0599('0x5a')],'as':_0x0599('0x5b'),'attributes':['id',_0x0599('0x5c'),_0x0599('0x5d')],'raw':!![]});if(_0xb4b72a[_0x0599('0x24')]['attachments']){_0x50ca7f[_0x0599('0x58')]({'model':db['Attachment'],'as':_0x0599('0x5e'),'raw':!![]});}var _0x5f23a5=[{'model':db[_0x0599('0x45')],'as':'Messages','attributes':['id',_0x0599('0x34'),_0x0599('0x5f'),_0x0599('0x60'),_0x0599('0x61'),'read'],'include':_0x50ca7f}];_0x5f23a5['push']({'model':db[_0x0599('0x62')],'as':_0x0599('0x63'),'attributes':['id',_0x0599('0x19')]});_0x5f23a5[_0x0599('0x58')]({'model':db[_0x0599('0x59')],'as':_0x0599('0x64'),'attributes':['id',_0x0599('0x65')]});return db['OpenchannelInteraction'][_0x0599('0x32')]({'where':{'id':_0xb4b72a[_0x0599('0x27')]['id']},'include':_0x5f23a5})[_0x0599('0x17')](handleEntityNotFound(_0x813309,null))[_0x0599('0x17')](function(_0x5d52fc){if(_0x5d52fc){var _0x1a4880=_0x5d52fc['get']({'plain':!![]});fs[_0x0599('0x66')](_0x13a5ca);var _0x390a0f={'channel':_0x0599('0x67'),'account':_0x1a4880[_0x0599('0x63')][_0x0599('0x19')],'agent':_0x1a4880[_0x0599('0x64')]?_0x1a4880[_0x0599('0x64')][_0x0599('0x65')]:_0x0599('0x68'),'createdAt':moment(_0x1a4880[_0x0599('0x5f')])[_0x0599('0x43')](_0x0599('0x44'))[_0x0599('0x50')](),'closedAt':_0x1a4880['closed']?moment(_0x1a4880[_0x0599('0x69')])[_0x0599('0x43')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0599('0x50')]():'','disposition':_0x1a4880[_0x0599('0x6a')],'visibility':_0x1a4880[_0x0599('0x6b')]?_0x0599('0x6c'):_0x0599('0x6d'),'messages':_(_0x1a4880['Messages'])['filter']({'secret':![]})[_0x0599('0x1c')](function(_0x5315c7){if(_0x5315c7['Attachment']){var _0x178a8a=path[_0x0599('0x51')](_0x58e0e9,_0x5315c7[_0x0599('0x5e')]['basename']);if(fs[_0x0599('0x6e')](_0x178a8a)){fs['createReadStream'](_0x178a8a)[_0x0599('0x6f')](fs[_0x0599('0x70')](path[_0x0599('0x51')](_0x13a5ca,_0x5315c7[_0x0599('0x5e')]['basename'])));}}return{'date':moment(_0x5315c7[_0x0599('0x5f')])[_0x0599('0x43')](_0x0599('0x44'))[_0x0599('0x50')](),'sender':_0x5315c7[_0x0599('0x60')]===_0x0599('0x71')?_0x5315c7[_0x0599('0x59')]?_0x5315c7['User'][_0x0599('0x65')]:_0x0599('0x72'):_0x5315c7[_0x0599('0x5b')]['firstName']+(_0x5315c7[_0x0599('0x5b')]['lastName']?'\x20'+_0x5315c7[_0x0599('0x5b')][_0x0599('0x5d')]:''),'body':_0x5315c7[_0x0599('0x5e')]?_0x5315c7[_0x0599('0x5e')][_0x0599('0x73')]:_0x5315c7['body'],'direction':_0x5315c7['direction']===_0x0599('0x71')?'A':'C','secret':_0x5315c7[_0x0599('0x61')],'read':_0x5315c7[_0x0599('0x74')],'attachment':_0x5315c7[_0x0599('0x5e')]};})['value']()};return ejs[_0x0599('0x75')](path[_0x0599('0x51')](config[_0x0599('0x52')],_0x0599('0x53'),_0x0599('0x76'),_0x0599('0x77')),{'interaction':_0x390a0f})['then'](function(_0x15d02a){var _0xa56c80=path['join'](_0x13a5ca,_0x0599('0x78')+_0x1a4880['id']+'-'+_0x29f89d+'.pdf');var _0x4b3c68={'path':_0xa56c80,'channel':'Openchannel','interactionId':_0x1a4880['id']};return pdf[_0x0599('0x79')](_0x15d02a,_0x4b3c68);})[_0x0599('0x17')](function(){return new Promise(function(_0x34f1e8,_0x1ab885){zipdir(_0x13a5ca,{'saveTo':_0x5f4a93},function(_0x1b2508,_0x19af0f){if(_0x1b2508)return _0x1ab885(_0x1b2508);return _0x34f1e8(_0x19af0f);});})[_0x0599('0x17')](function(){return new Promise(function(_0x3d38c6,_0x1e7d53){rimraf(_0x13a5ca,function(_0x1dc1f3){if(_0x1dc1f3)_0x1e7d53(_0x1dc1f3);return _0x3d38c6();});});})[_0x0599('0x17')](function(){return _0x813309[_0x0599('0x4e')](_0x5f4a93,_0x487c83,function(_0x5a66cd){if(_0x5a66cd){logger[_0x0599('0x7a')](_0x0599('0x7b'),_0x5a66cd);}else{fs['unlinkSync'](_0x5f4a93);}});});});}else{return _0x813309[_0x0599('0xb')](0xc8);}})['catch'](handleError(_0x813309,null));}; \ No newline at end of file +var _0xbf29=['model','length','includeAll','include','merge','update','body','find','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','filters','fields','hasOwnProperty','nolimit','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','count','rows','addTags','setTags','Tag','color','emit','download','unix','join','root','files','tmp','attachments','format','transcript-%d-%s.zip','User','fullname','CmContact','Contact','push','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','toString','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','System','lastName','value','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','then','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','from','params','keys','intersection','attributes'];(function(_0x34bf46,_0x25cbc4){var _0x401793=function(_0x40536c){while(--_0x40536c){_0x34bf46['push'](_0x34bf46['shift']());}};_0x401793(++_0x25cbc4);}(_0xbf29,0x151));var _0x9bf2=function(_0x55cd59,_0x28b4c6){_0x55cd59=_0x55cd59-0x0;var _0x10ab40=_0xbf29[_0x55cd59];return _0x10ab40;};'use strict';var rimraf=require(_0x9bf2('0x0'));var zipdir=require(_0x9bf2('0x1'));var moment=require(_0x9bf2('0x2'));var util=require(_0x9bf2('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x9bf2('0x4'));var qs=require(_0x9bf2('0x5'));var pdf=require(_0x9bf2('0x6'));var logger=require(_0x9bf2('0x7'))('api');var config=require(_0x9bf2('0x8'));var db=require(_0x9bf2('0x9'))['db'];config[_0x9bf2('0xa')]=_[_0x9bf2('0xb')](config[_0x9bf2('0xa')],{'host':_0x9bf2('0xc'),'port':0x18eb});var socket=require(_0x9bf2('0xd'))(new Redis(config['redis']));require(_0x9bf2('0xe'))[_0x9bf2('0xf')](socket);function respondWithStatusCode(_0x4f735a,_0x1cdd85){_0x1cdd85=_0x1cdd85||0xcc;return function(_0x4920a4){if(_0x4920a4){return _0x4f735a[_0x9bf2('0x10')](_0x1cdd85);}return _0x4f735a[_0x9bf2('0x11')](_0x1cdd85)[_0x9bf2('0x12')]();};}function respondWithResult(_0x4d85bf,_0x37398e){_0x37398e=_0x37398e||0xc8;return function(_0x126280){if(_0x126280){return _0x4d85bf[_0x9bf2('0x11')](_0x37398e)[_0x9bf2('0x13')](_0x126280);}};}function respondWithFilteredResult(_0x1e84db,_0x45efb3){return function(_0xeec40f){if(_0xeec40f){var _0x498e27=typeof _0x45efb3[_0x9bf2('0x14')]===_0x9bf2('0x15')&&typeof _0x45efb3[_0x9bf2('0x16')]===_0x9bf2('0x15');var _0x576fa5=_0xeec40f['count'];var _0xf2facb=_0x498e27?0x0:_0x45efb3[_0x9bf2('0x14')];var _0x33a37e=_0x498e27?_0xeec40f['count']:_0x45efb3[_0x9bf2('0x14')]+_0x45efb3[_0x9bf2('0x16')];var _0x5be9d3;if(_0x33a37e>=_0x576fa5){_0x33a37e=_0x576fa5;_0x5be9d3=0xc8;}else{_0x5be9d3=0xce;}_0x1e84db[_0x9bf2('0x11')](_0x5be9d3);return _0x1e84db['set'](_0x9bf2('0x17'),_0xf2facb+'-'+_0x33a37e+'/'+_0x576fa5)[_0x9bf2('0x13')](_0xeec40f);}return null;};}function saveUpdates(_0x47b22e){return function(_0x603c95){if(_0x603c95){return _0x603c95['update'](_0x47b22e)['then'](function(_0x265eb5){return _0x265eb5;});}return null;};}function removeEntity(_0x2e02a7){return function(_0x33d705){if(_0x33d705){return _0x33d705['destroy']()[_0x9bf2('0x18')](function(){_0x2e02a7[_0x9bf2('0x11')](0xcc)[_0x9bf2('0x12')]();});}};}function handleEntityNotFound(_0x16d485){return function(_0x5cdb3b){if(!_0x5cdb3b){_0x16d485['sendStatus'](0x194);}return _0x5cdb3b;};}function handleError(_0x225b8c,_0x3f9235){_0x3f9235=_0x3f9235||0x1f4;return function(_0x674127){logger[_0x9bf2('0x19')](_0x674127[_0x9bf2('0x1a')]);if(_0x674127['name']){delete _0x674127[_0x9bf2('0x1b')];}_0x225b8c[_0x9bf2('0x11')](_0x3f9235)[_0x9bf2('0x1c')](_0x674127);};}exports[_0x9bf2('0x1d')]=function(_0x393646,_0x511afd){var _0x2ee484={};var _0x26dbfc=_[_0x9bf2('0x1e')](db[_0x9bf2('0x1f')][_0x9bf2('0x20')],function(_0x1537b0){return{'name':_0x1537b0[_0x9bf2('0x21')],'type':_0x1537b0[_0x9bf2('0x22')][_0x9bf2('0x23')]};});_0x2ee484=qs[_0x9bf2('0x24')](_0x26dbfc,_0x393646);return interaction[_0x9bf2('0x25')](_0x9bf2('0x26'),_0x393646[_0x9bf2('0x27')],_0x393646[_0x9bf2('0x28')],_0x2ee484,_0x26dbfc)[_0x9bf2('0x18')](respondWithFilteredResult(_0x511afd,_0x2ee484))[_0x9bf2('0x29')](handleError(_0x511afd,null));};exports['show']=function(_0x2a1286,_0x32d82f){var _0xd282e3={};if(_0x2a1286['query'][_0x9bf2('0x22')]&&_0x2a1286[_0x9bf2('0x27')]['type']===_0x9bf2('0x2a')){_0xd282e3['from']=_0x2a1286[_0x9bf2('0x2b')]['id'];}else{_0xd282e3['id']=_0x2a1286[_0x9bf2('0x2b')]['id'];}var _0x51ac36={'raw':![],'where':_0xd282e3},_0x4a39b0={};_0x4a39b0['model']=_[_0x9bf2('0x2c')](db[_0x9bf2('0x1f')][_0x9bf2('0x20')]);_0x4a39b0[_0x9bf2('0x27')]=_['keys'](_0x2a1286[_0x9bf2('0x27')]);_0x4a39b0['filters']=_[_0x9bf2('0x2d')](_0x4a39b0['model'],_0x4a39b0[_0x9bf2('0x27')]);_0x51ac36[_0x9bf2('0x2e')]=_[_0x9bf2('0x2d')](_0x4a39b0[_0x9bf2('0x2f')],qs['fields'](_0x2a1286[_0x9bf2('0x27')]['fields']));_0x51ac36[_0x9bf2('0x2e')]=_0x51ac36['attributes'][_0x9bf2('0x30')]?_0x51ac36['attributes']:_0x4a39b0[_0x9bf2('0x2f')];if(_0x2a1286[_0x9bf2('0x27')][_0x9bf2('0x31')]){_0x51ac36[_0x9bf2('0x32')]=[{'all':!![]}];}_0x51ac36=_[_0x9bf2('0x33')]({},_0x51ac36,_0x2a1286['options']);return db[_0x9bf2('0x1f')]['find'](_0x51ac36)['then'](handleEntityNotFound(_0x32d82f,null))[_0x9bf2('0x18')](respondWithResult(_0x32d82f,null))[_0x9bf2('0x29')](handleError(_0x32d82f,null));};exports['create']=function(_0x1c36c5,_0x14171d){return db[_0x9bf2('0x1f')]['create'](_0x1c36c5['body'],{})[_0x9bf2('0x18')](respondWithResult(_0x14171d,0xc9))[_0x9bf2('0x29')](handleError(_0x14171d,null));};exports[_0x9bf2('0x34')]=function(_0x2e30bd,_0x473357){if(_0x2e30bd[_0x9bf2('0x35')]['id']){delete _0x2e30bd[_0x9bf2('0x35')]['id'];}return db[_0x9bf2('0x1f')][_0x9bf2('0x36')]({'where':{'id':_0x2e30bd['params']['id']}})['then'](handleEntityNotFound(_0x473357,null))['then'](saveUpdates(_0x2e30bd[_0x9bf2('0x35')],null))[_0x9bf2('0x18')](respondWithResult(_0x473357,null))['catch'](handleError(_0x473357,null));};exports[_0x9bf2('0x37')]=function(_0x30fbaf,_0x2cd98a){return db[_0x9bf2('0x1f')]['find']({'where':{'id':_0x30fbaf[_0x9bf2('0x2b')]['id']}})[_0x9bf2('0x18')](handleEntityNotFound(_0x2cd98a,null))['then'](removeEntity(_0x2cd98a,null))[_0x9bf2('0x29')](handleError(_0x2cd98a,null));};exports[_0x9bf2('0x38')]=function(_0x961676,_0x23a30c){return db[_0x9bf2('0x1f')][_0x9bf2('0x38')]()[_0x9bf2('0x18')](respondWithResult(_0x23a30c,null))[_0x9bf2('0x29')](handleError(_0x23a30c,null));};exports[_0x9bf2('0x39')]=function(_0x333bb4,_0x472d13){return db[_0x9bf2('0x3a')][_0x9bf2('0x36')]({'where':{'id':_0x333bb4[_0x9bf2('0x2b')]['id']}})[_0x9bf2('0x18')](handleEntityNotFound(_0x472d13,null))[_0x9bf2('0x18')](function(_0x484c52){if(_0x484c52){return _0x484c52[_0x9bf2('0x39')](_0x333bb4[_0x9bf2('0x35')][_0x9bf2('0x3b')],_['omit'](_0x333bb4[_0x9bf2('0x35')],[_0x9bf2('0x3b'),'id'])||{});}})[_0x9bf2('0x18')](respondWithResult(_0x472d13,null))['catch'](handleError(_0x472d13,null));};exports[_0x9bf2('0x3c')]=function(_0x201e30,_0x25d25c){var _0xf38e86={'raw':![],'where':{}};var _0x131b86={};var _0x1330f1={'count':0x0,'rows':[]};return db[_0x9bf2('0x1f')][_0x9bf2('0x3d')]({'where':{'id':_0x201e30[_0x9bf2('0x2b')]['id']}})[_0x9bf2('0x18')](handleEntityNotFound(_0x25d25c,null))[_0x9bf2('0x18')](function(_0xbea5fe){if(_0xbea5fe){_0x131b86[_0x9bf2('0x2f')]=_[_0x9bf2('0x2c')](db[_0x9bf2('0x3a')][_0x9bf2('0x20')]);_0x131b86['query']=_[_0x9bf2('0x2c')](_0x201e30[_0x9bf2('0x27')]);_0x131b86[_0x9bf2('0x3e')]=_[_0x9bf2('0x2d')](_0x131b86['model'],_0x131b86['query']);_0xf38e86[_0x9bf2('0x2e')]=_[_0x9bf2('0x2d')](_0x131b86[_0x9bf2('0x2f')],qs[_0x9bf2('0x3f')](_0x201e30['query']['fields']));_0xf38e86[_0x9bf2('0x2e')]=_0xf38e86['attributes'][_0x9bf2('0x30')]?_0xf38e86[_0x9bf2('0x2e')]:_0x131b86[_0x9bf2('0x2f')];if(!_0x201e30[_0x9bf2('0x27')][_0x9bf2('0x40')](_0x9bf2('0x41'))){_0xf38e86[_0x9bf2('0x16')]=qs['limit'](_0x201e30[_0x9bf2('0x27')][_0x9bf2('0x16')]);_0xf38e86[_0x9bf2('0x14')]=qs[_0x9bf2('0x14')](_0x201e30[_0x9bf2('0x27')]['offset']);}_0xf38e86[_0x9bf2('0x42')]=qs[_0x9bf2('0x43')](_0x201e30['query']['sort']);_0xf38e86['where']=qs['filters'](_[_0x9bf2('0x44')](_0x201e30[_0x9bf2('0x27')],_0x131b86['filters']));_0xf38e86[_0x9bf2('0x45')][_0x9bf2('0x46')]=_0xbea5fe['id'];if(_0x201e30[_0x9bf2('0x27')][_0x9bf2('0x47')]){_0xf38e86['where']=_[_0x9bf2('0x33')](_0xf38e86[_0x9bf2('0x45')],{'$or':_[_0x9bf2('0x1e')](_0xf38e86['attributes'],function(_0x17e3ce){var _0x10dcb8={};_0x10dcb8[_0x17e3ce]={'$like':'%'+_0x201e30[_0x9bf2('0x27')]['filter']+'%'};return _0x10dcb8;})});}if(_0x201e30[_0x9bf2('0x27')][_0x9bf2('0x48')]){var _0x2bd765=_0x201e30[_0x9bf2('0x27')][_0x9bf2('0x48')][_0x9bf2('0x49')](',');var _0x2def45={};_0x2def45[_0x2bd765[0x0]]={'$gte':moment(_0x2bd765[0x1])['format'](_0x9bf2('0x4a'))};_0xf38e86[_0x9bf2('0x45')]=_[_0x9bf2('0x33')](_0xf38e86[_0x9bf2('0x45')],_0x2def45);}_0xf38e86=_[_0x9bf2('0x33')]({},_0xf38e86,_0x201e30[_0x9bf2('0x4b')]);return db[_0x9bf2('0x3a')]['count']({'where':_0xf38e86[_0x9bf2('0x45')]})[_0x9bf2('0x18')](function(_0x5ce627){_0x1330f1[_0x9bf2('0x4c')]=_0x5ce627;if(_0x201e30[_0x9bf2('0x27')][_0x9bf2('0x31')]){_0xf38e86[_0x9bf2('0x32')]=[{'all':!![]}];}return db[_0x9bf2('0x3a')][_0x9bf2('0x25')](_0xf38e86);})['then'](function(_0x5b2eb7){_0x1330f1[_0x9bf2('0x4d')]=_0x5b2eb7;return _0x1330f1;});}})[_0x9bf2('0x18')](respondWithFilteredResult(_0x25d25c,_0xf38e86))[_0x9bf2('0x29')](handleError(_0x25d25c,null));};exports[_0x9bf2('0x4e')]=function(_0x5be1d7,_0x2a38b4){return db[_0x9bf2('0x1f')][_0x9bf2('0x36')]({'where':{'id':_0x5be1d7[_0x9bf2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2a38b4,null))['then'](function(_0x462b89){if(_0x462b89){return _0x462b89[_0x9bf2('0x4f')](_0x5be1d7[_0x9bf2('0x35')][_0x9bf2('0x3b')],_['omit'](_0x5be1d7['body'],[_0x9bf2('0x3b'),'id'])||{})['spread'](function(){return db[_0x9bf2('0x50')][_0x9bf2('0x25')]({'attributes':['id',_0x9bf2('0x1b'),_0x9bf2('0x51')],'where':{'id':_0x5be1d7['body'][_0x9bf2('0x3b')]}});})[_0x9bf2('0x18')](function(_0x55d88a){socket[_0x9bf2('0x52')]('openchannelInteractionTags:save',{'id':Number(_0x5be1d7[_0x9bf2('0x2b')]['id']),'tags':_0x55d88a||[]});return{'id':Number(_0x5be1d7[_0x9bf2('0x2b')]['id']),'tags':_0x55d88a||[]};});}})['then'](respondWithResult(_0x2a38b4,null))[_0x9bf2('0x29')](handleError(_0x2a38b4,null));};exports['removeTags']=function(_0x4a2662,_0x57963a){return db['OpenchannelInteraction'][_0x9bf2('0x36')]({'where':{'id':_0x4a2662[_0x9bf2('0x2b')]['id']}})[_0x9bf2('0x18')](handleEntityNotFound(_0x57963a,null))[_0x9bf2('0x18')](function(_0x5e3cc9){if(_0x5e3cc9){return _0x5e3cc9['removeTags'](_0x4a2662[_0x9bf2('0x27')][_0x9bf2('0x3b')]);}})['then'](respondWithStatusCode(_0x57963a,null))[_0x9bf2('0x29')](handleError(_0x57963a,null));};exports[_0x9bf2('0x53')]=function(_0x4b0902,_0x45cbc){var _0x6091c=moment()[_0x9bf2('0x54')]()['toString']();var _0x45ed8d=path[_0x9bf2('0x55')](config[_0x9bf2('0x56')],'server',_0x9bf2('0x57'),_0x9bf2('0x58'));var _0x5d9c1f=path[_0x9bf2('0x55')](config[_0x9bf2('0x56')],'server','files',_0x9bf2('0x59'));var _0xfa45e2=path[_0x9bf2('0x55')](_0x45ed8d,_0x6091c);var _0x17fe37=util[_0x9bf2('0x5a')](_0x9bf2('0x5b'),_0x4b0902[_0x9bf2('0x2b')]['id'],_0x6091c);var _0x23c5e5=path[_0x9bf2('0x55')](_0x45ed8d,_0x17fe37);var _0x126311=[];_0x126311['push']({'model':db[_0x9bf2('0x5c')],'as':_0x9bf2('0x5c'),'attributes':['id',_0x9bf2('0x5d')],'raw':!![]});_0x126311['push']({'model':db[_0x9bf2('0x5e')],'as':_0x9bf2('0x5f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4b0902[_0x9bf2('0x27')][_0x9bf2('0x59')]){_0x126311[_0x9bf2('0x60')]({'model':db[_0x9bf2('0x61')],'as':'Attachment','raw':!![]});}var _0x12350d=[{'model':db[_0x9bf2('0x3a')],'as':_0x9bf2('0x62'),'attributes':['id',_0x9bf2('0x35'),_0x9bf2('0x63'),_0x9bf2('0x64'),_0x9bf2('0x65'),_0x9bf2('0x66')],'include':_0x126311}];_0x12350d[_0x9bf2('0x60')]({'model':db[_0x9bf2('0x67')],'as':_0x9bf2('0x68'),'attributes':['id',_0x9bf2('0x1b')]});_0x12350d[_0x9bf2('0x60')]({'model':db['User'],'as':_0x9bf2('0x69'),'attributes':['id',_0x9bf2('0x5d')]});return db['OpenchannelInteraction'][_0x9bf2('0x36')]({'where':{'id':_0x4b0902['params']['id']},'include':_0x12350d})[_0x9bf2('0x18')](handleEntityNotFound(_0x45cbc,null))['then'](function(_0x199040){if(_0x199040){var _0x4f9578=_0x199040['get']({'plain':!![]});fs[_0x9bf2('0x6a')](_0xfa45e2);var _0x4b8f3d={'channel':_0x9bf2('0x6b'),'account':_0x4f9578[_0x9bf2('0x68')]['name'],'agent':_0x4f9578[_0x9bf2('0x69')]?_0x4f9578[_0x9bf2('0x69')][_0x9bf2('0x5d')]:_0x9bf2('0x6c'),'createdAt':moment(_0x4f9578[_0x9bf2('0x63')])[_0x9bf2('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4f9578[_0x9bf2('0x6d')]?moment(_0x4f9578['closedAt'])['format'](_0x9bf2('0x4a'))[_0x9bf2('0x6e')]():'','disposition':_0x4f9578['disposition'],'visibility':_0x4f9578[_0x9bf2('0x6f')]?_0x9bf2('0x70'):_0x9bf2('0x71'),'messages':_(_0x4f9578[_0x9bf2('0x62')])[_0x9bf2('0x47')]({'secret':![]})[_0x9bf2('0x1e')](function(_0x19617b){if(_0x19617b[_0x9bf2('0x61')]){var _0x1b9017=path[_0x9bf2('0x55')](_0x5d9c1f,_0x19617b['Attachment']['basename']);if(fs[_0x9bf2('0x72')](_0x1b9017)){fs[_0x9bf2('0x73')](_0x1b9017)[_0x9bf2('0x74')](fs[_0x9bf2('0x75')](path['join'](_0xfa45e2,_0x19617b[_0x9bf2('0x61')][_0x9bf2('0x76')])));}}return{'date':moment(_0x19617b[_0x9bf2('0x63')])['format'](_0x9bf2('0x4a'))[_0x9bf2('0x6e')](),'sender':_0x19617b[_0x9bf2('0x64')]==='out'?_0x19617b['User']?_0x19617b['User'][_0x9bf2('0x5d')]:_0x9bf2('0x77'):_0x19617b[_0x9bf2('0x5f')]['firstName']+(_0x19617b[_0x9bf2('0x5f')][_0x9bf2('0x78')]?'\x20'+_0x19617b[_0x9bf2('0x5f')][_0x9bf2('0x78')]:''),'body':_0x19617b[_0x9bf2('0x61')]?_0x19617b['Attachment'][_0x9bf2('0x76')]:_0x19617b['body'],'direction':_0x19617b[_0x9bf2('0x64')]==='out'?'A':'C','secret':_0x19617b['secret'],'read':_0x19617b[_0x9bf2('0x66')],'attachment':_0x19617b[_0x9bf2('0x61')]};})[_0x9bf2('0x79')]()};return ejs['renderFile'](path['join'](config[_0x9bf2('0x56')],_0x9bf2('0x7a'),_0x9bf2('0x7b'),_0x9bf2('0x7c')),{'interaction':_0x4b8f3d})[_0x9bf2('0x18')](function(_0x40a9a5){var _0xd640c7=path[_0x9bf2('0x55')](_0xfa45e2,'transcript-'+_0x4f9578['id']+'-'+_0x6091c+_0x9bf2('0x7d'));var _0x27766e={'path':_0xd640c7,'channel':_0x9bf2('0x6b'),'interactionId':_0x4f9578['id']};return pdf[_0x9bf2('0x7e')](_0x40a9a5,_0x27766e);})[_0x9bf2('0x18')](function(){return new Promise(function(_0x371f8a,_0x12e2e1){zipdir(_0xfa45e2,{'saveTo':_0x23c5e5},function(_0x2e9c8d,_0x5832b1){if(_0x2e9c8d)return _0x12e2e1(_0x2e9c8d);return _0x371f8a(_0x5832b1);});})[_0x9bf2('0x18')](function(){return new Promise(function(_0x45eb65,_0x1cb3a9){rimraf(_0xfa45e2,function(_0x14e2f5){if(_0x14e2f5)_0x1cb3a9(_0x14e2f5);return _0x45eb65();});});})[_0x9bf2('0x18')](function(){return _0x45cbc['download'](_0x23c5e5,_0x17fe37,function(_0x314df8){if(_0x314df8){logger[_0x9bf2('0x19')]('Unable\x20to\x20delete\x20zip\x20file',_0x314df8);}else{fs[_0x9bf2('0x7f')](_0x23c5e5);}});});});}else{return _0x45cbc[_0x9bf2('0x10')](0xc8);}})[_0x9bf2('0x29')](handleError(_0x45cbc,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 74d4cc2..e4160b6 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 _0x2243=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x2faca7,_0x1e11eb){var _0x5db575=function(_0x2caa30){while(--_0x2caa30){_0x2faca7['push'](_0x2faca7['shift']());}};_0x5db575(++_0x1e11eb);}(_0x2243,0x76));var _0x3224=function(_0x2db5f3,_0x5c0630){_0x2db5f3=_0x2db5f3-0x0;var _0x3e6188=_0x2243[_0x2db5f3];return _0x3e6188;};'use strict';var EventEmitter=require(_0x3224('0x0'));var OpenchannelInteraction=require(_0x3224('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x3224('0x1'))['db'][_0x3224('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3224('0x3')](0x0);var events={'afterCreate':_0x3224('0x4'),'afterUpdate':_0x3224('0x5'),'afterDestroy':_0x3224('0x6')};function emitEvent(_0x1eb4dc){return function(_0x59a0b0,_0x36f3ba,_0x161bf7){_0x59a0b0[_0x3224('0x7')]({'attributes':['id'],'raw':!![]})[_0x3224('0x8')](function(_0x4f5bc5){_0x59a0b0[_0x3224('0x9')](_0x3224('0xa'),_0x4f5bc5[_0x3224('0xb')](function(_0x52c68e){return{'id':_0x52c68e['id']};}));return OpenchannelMessage[_0x3224('0xc')]({'where':{'OpenchannelInteractionId':_0x59a0b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3224('0x8')](function(_0x533b01){_0x59a0b0[_0x3224('0x9')](_0x3224('0xd'),_0x533b01[_0x3224('0xe')]);OpenchannelInteractionEvents[_0x3224('0xf')](_0x1eb4dc+':'+_0x59a0b0['id'],_0x59a0b0);OpenchannelInteractionEvents[_0x3224('0xf')](_0x1eb4dc,_0x59a0b0);_0x161bf7(null);})['catch'](_0x161bf7(null));};}for(var e in events){if(events[_0x3224('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x3224('0x11')](e,emitEvent(event));}}module[_0x3224('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7cea=['exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','map','findAll','setDataValue','length','emit','catch'];(function(_0x348be5,_0x2d2e8c){var _0x106146=function(_0x47634c){while(--_0x47634c){_0x348be5['push'](_0x348be5['shift']());}};_0x106146(++_0x2d2e8c);}(_0x7cea,0x71));var _0xa7ce=function(_0x50440a,_0x522fcc){_0x50440a=_0x50440a-0x0;var _0x4770aa=_0x7cea[_0x50440a];return _0x4770aa;};'use strict';var EventEmitter=require(_0xa7ce('0x0'));var OpenchannelInteraction=require(_0xa7ce('0x1'))['db'][_0xa7ce('0x2')];var OpenchannelMessage=require(_0xa7ce('0x1'))['db'][_0xa7ce('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa7ce('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa7ce('0x5'),'afterDestroy':_0xa7ce('0x6')};function emitEvent(_0xcccef0){return function(_0x157aca,_0x3ce82a,_0x56a93c){_0x157aca[_0xa7ce('0x7')]({'attributes':['id'],'raw':!![]})[_0xa7ce('0x8')](function(_0xb3ffaf){_0x157aca['setDataValue']('Users',_0xb3ffaf[_0xa7ce('0x9')](function(_0x520174){return{'id':_0x520174['id']};}));return OpenchannelMessage[_0xa7ce('0xa')]({'where':{'OpenchannelInteractionId':_0x157aca['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b4067){_0x157aca[_0xa7ce('0xb')]('unreadMessages',_0x5b4067[_0xa7ce('0xc')]);OpenchannelInteractionEvents['emit'](_0xcccef0+':'+_0x157aca['id'],_0x157aca);OpenchannelInteractionEvents[_0xa7ce('0xd')](_0xcccef0,_0x157aca);_0x56a93c(null);})[_0xa7ce('0xe')](_0x56a93c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xa7ce('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5f52743..826cb2c 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 _0xd5a2=['rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x440b53,_0x41f9f7){var _0x5dfbd0=function(_0x366e27){while(--_0x366e27){_0x440b53['push'](_0x440b53['shift']());}};_0x5dfbd0(++_0x41f9f7);}(_0xd5a2,0x93));var _0x2d5a=function(_0x2efd1b,_0x5c384d){_0x2efd1b=_0x2efd1b-0x0;var _0x4444fc=_0xd5a2[_0x2efd1b];return _0x4444fc;};'use strict';var _=require(_0x2d5a('0x0'));var util=require(_0x2d5a('0x1'));var logger=require(_0x2d5a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2d5a('0x3'));var rp=require(_0x2d5a('0x4'));var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module['exports']=function(_0x484ab6,_0x444ec8){return _0x484ab6['define'](_0x2d5a('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d5a('0xa'),'collate':_0x2d5a('0xb'),'hooks':{'beforeUpdate':function(_0x58bfa8,_0x4bbf9e,_0x5bc144){if(_0x58bfa8[_0x2d5a('0xc')](_0x2d5a('0xd'))){_0x58bfa8[_0x2d5a('0xe')]=moment()[_0x2d5a('0xf')](_0x2d5a('0x10'));}_0x5bc144(null,_0x58bfa8);}}});}; \ No newline at end of file +var _0x6c25=['api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x6c25,0x9d));var _0x56c2=function(_0x47159c,_0x1c8216){_0x47159c=_0x47159c-0x0;var _0x454dbe=_0x6c25[_0x47159c];return _0x454dbe;};'use strict';var _=require(_0x56c2('0x0'));var util=require(_0x56c2('0x1'));var logger=require(_0x56c2('0x2'))(_0x56c2('0x3'));var moment=require('moment');var BPromise=require(_0x56c2('0x4'));var rp=require(_0x56c2('0x5'));var fs=require('fs');var path=require(_0x56c2('0x6'));var rimraf=require(_0x56c2('0x7'));var config=require(_0x56c2('0x8'));var attributes=require(_0x56c2('0x9'));module[_0x56c2('0xa')]=function(_0x1fceed,_0x19fe58){return _0x1fceed['define'](_0x56c2('0xb'),attributes,{'tableName':_0x56c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x56c2('0xd'),'collate':_0x56c2('0xe'),'hooks':{'beforeUpdate':function(_0x571b2d,_0x166447,_0x183b57){if(_0x571b2d[_0x56c2('0xf')](_0x56c2('0x10'))){_0x571b2d[_0x56c2('0x11')]=moment()[_0x56c2('0x12')](_0x56c2('0x13'));}_0x183b57(null,_0x571b2d);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 241ab42..b8dba9d 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 _0xbd5c=['limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where'];(function(_0x56e063,_0x453233){var _0x766fcf=function(_0x59415a){while(--_0x59415a){_0x56e063['push'](_0x56e063['shift']());}};_0x766fcf(++_0x453233);}(_0xbd5c,0x83));var _0xcbd5=function(_0x463cf9,_0x546da0){_0x463cf9=_0x463cf9-0x0;var _0x1f4bea=_0xbd5c[_0x463cf9];return _0x1f4bea;};'use strict';var _=require('lodash');var util=require(_0xcbd5('0x0'));var moment=require(_0xcbd5('0x1'));var BPromise=require(_0xcbd5('0x2'));var rs=require(_0xcbd5('0x3'));var fs=require('fs');var Redis=require(_0xcbd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbd5('0x5'));var logger=require('../../config/logger')(_0xcbd5('0x6'));var config=require(_0xcbd5('0x7'));var jayson=require(_0xcbd5('0x8'));var client=jayson['client'][_0xcbd5('0x9')]({'port':0x232a});config[_0xcbd5('0xa')]=_[_0xcbd5('0xb')](config[_0xcbd5('0xa')],{'host':_0xcbd5('0xc'),'port':0x18eb});var socket=require(_0xcbd5('0xd'))(new Redis(config[_0xcbd5('0xa')]));require(_0xcbd5('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f9bc6,_0x155505,_0x174a40){return new BPromise(function(_0x35ec04,_0x5320fd){return client[_0xcbd5('0xf')](_0x4f9bc6,_0x174a40)[_0xcbd5('0x10')](function(_0x45622c){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x155505,_0xcbd5('0x11'));logger[_0xcbd5('0x12')](_0xcbd5('0x13'),_0x155505,_0xcbd5('0x11'),JSON[_0xcbd5('0x14')](_0x45622c));if(_0x45622c[_0xcbd5('0x15')]){if(_0x45622c['error']['code']===0x1f4){logger[_0xcbd5('0x15')](_0xcbd5('0x16'),_0x155505,_0x45622c['error'][_0xcbd5('0x17')]);return _0x5320fd(_0x45622c[_0xcbd5('0x15')][_0xcbd5('0x17')]);}logger[_0xcbd5('0x15')](_0xcbd5('0x16'),_0x155505,_0x45622c[_0xcbd5('0x15')]['message']);return _0x35ec04(_0x45622c[_0xcbd5('0x15')][_0xcbd5('0x17')]);}else{logger[_0xcbd5('0x18')](_0xcbd5('0x16'),_0x155505,_0xcbd5('0x11'));_0x35ec04(_0x45622c[_0xcbd5('0x19')][_0xcbd5('0x17')]);}})[_0xcbd5('0x1a')](function(_0x2d3b97){logger[_0xcbd5('0x15')](_0xcbd5('0x16'),_0x155505,_0x2d3b97);_0x5320fd(_0x2d3b97);});});}exports[_0xcbd5('0x1b')]=function(_0x4797a9){var _0x3958ec=this;return new Promise(function(_0x38b3db,_0x4d421f){return db['OpenchannelInteraction'][_0xcbd5('0x1c')](_0x4797a9[_0xcbd5('0x1d')],{'raw':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9['options'][_0xcbd5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9[_0xcbd5('0x1e')][_0xcbd5('0x20')]||null:null,'attributes':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9['options']['attributes']||null:null,'limit':_0x4797a9[_0xcbd5('0x1e')]?_0x4797a9[_0xcbd5('0x1e')][_0xcbd5('0x21')]||null:null})[_0xcbd5('0x10')](function(_0x201834){logger[_0xcbd5('0x18')](_0xcbd5('0x1b'),_0x4797a9);logger['debug'](_0xcbd5('0x1b'),_0x4797a9,JSON['stringify'](_0x201834));_0x38b3db(_0x201834);})[_0xcbd5('0x1a')](function(_0x2169d4){logger[_0xcbd5('0x15')]('UpdateOpenchannelInteraction',_0x2169d4[_0xcbd5('0x17')],_0x4797a9);_0x4d421f(_0x3958ec['error'](0x1f4,_0x2169d4[_0xcbd5('0x17')]));});});};exports[_0xcbd5('0x22')]=function(_0x313081){return new Promise(function(_0x5a2520,_0x56d217){return db[_0xcbd5('0x23')][_0xcbd5('0x24')]({'where':_0x313081['options']?_0x313081[_0xcbd5('0x1e')][_0xcbd5('0x20')]||null:null})[_0xcbd5('0x10')](function(_0x20f6e0){if(_0x20f6e0){return _0x20f6e0[_0xcbd5('0x25')](_0x313081[_0xcbd5('0x1d')][_0xcbd5('0x26')],_[_0xcbd5('0x27')](_0x313081[_0xcbd5('0x1d')],[_0xcbd5('0x26'),'id'])||{});}})['spread'](function(_0x193ef8){logger[_0xcbd5('0x18')]('AddTags',_0x313081);logger[_0xcbd5('0x12')](_0xcbd5('0x28'),_0x313081,JSON[_0xcbd5('0x14')](_0x193ef8));_0x5a2520(_0x193ef8);})[_0xcbd5('0x1a')](function(_0x533c94){logger[_0xcbd5('0x15')](_0xcbd5('0x28'),_0x533c94[_0xcbd5('0x17')],_0x313081);_0x56d217(_this['error'](0x1f4,_0x533c94[_0xcbd5('0x17')]));});});}; \ No newline at end of file +var _0xe94a=['bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util'];(function(_0x2e27fa,_0x2ec2de){var _0x2fef95=function(_0x26e36d){while(--_0x26e36d){_0x2e27fa['push'](_0x2e27fa['shift']());}};_0x2fef95(++_0x2ec2de);}(_0xe94a,0x116));var _0xae94=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xe94a[_0x4cd690];return _0x4a74a9;};'use strict';var _=require(_0xae94('0x0'));var util=require(_0xae94('0x1'));var moment=require('moment');var BPromise=require(_0xae94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae94('0x3'));var logger=require(_0xae94('0x4'))('rpc');var config=require(_0xae94('0x5'));var jayson=require(_0xae94('0x6'));var client=jayson['client'][_0xae94('0x7')]({'port':0x232a});config[_0xae94('0x8')]=_[_0xae94('0x9')](config[_0xae94('0x8')],{'host':_0xae94('0xa'),'port':0x18eb});var socket=require(_0xae94('0xb'))(new Redis(config[_0xae94('0x8')]));require(_0xae94('0xc'))[_0xae94('0xd')](socket);function respondWithRpcPromise(_0x1e037f,_0x299e39,_0x781cc2){return new BPromise(function(_0x56d576,_0x525294){return client['request'](_0x1e037f,_0x781cc2)['then'](function(_0x3f4bf3){logger[_0xae94('0xe')](_0xae94('0xf'),_0x299e39,_0xae94('0x10'));logger[_0xae94('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x299e39,_0xae94('0x10'),JSON[_0xae94('0x12')](_0x3f4bf3));if(_0x3f4bf3['error']){if(_0x3f4bf3[_0xae94('0x13')]['code']===0x1f4){logger[_0xae94('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x299e39,_0x3f4bf3[_0xae94('0x13')][_0xae94('0x14')]);return _0x525294(_0x3f4bf3[_0xae94('0x13')]['message']);}logger['error'](_0xae94('0xf'),_0x299e39,_0x3f4bf3[_0xae94('0x13')][_0xae94('0x14')]);return _0x56d576(_0x3f4bf3['error']['message']);}else{logger[_0xae94('0xe')](_0xae94('0xf'),_0x299e39,_0xae94('0x10'));_0x56d576(_0x3f4bf3[_0xae94('0x15')][_0xae94('0x14')]);}})['catch'](function(_0x412eb5){logger[_0xae94('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x299e39,_0x412eb5);_0x525294(_0x412eb5);});});}exports[_0xae94('0x16')]=function(_0xe53dae){var _0x403974=this;return new Promise(function(_0x5879ce,_0x3af217){return db[_0xae94('0x17')][_0xae94('0x18')](_0xe53dae['body'],{'raw':_0xe53dae[_0xae94('0x19')]?_0xe53dae[_0xae94('0x19')][_0xae94('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe53dae['options']?_0xe53dae[_0xae94('0x19')][_0xae94('0x1b')]||null:null,'attributes':_0xe53dae['options']?_0xe53dae[_0xae94('0x19')][_0xae94('0x1c')]||null:null,'limit':_0xe53dae[_0xae94('0x19')]?_0xe53dae['options'][_0xae94('0x1d')]||null:null})[_0xae94('0x1e')](function(_0x479a7f){logger[_0xae94('0xe')](_0xae94('0x16'),_0xe53dae);logger[_0xae94('0x11')](_0xae94('0x16'),_0xe53dae,JSON[_0xae94('0x12')](_0x479a7f));_0x5879ce(_0x479a7f);})[_0xae94('0x1f')](function(_0x1b9afb){logger[_0xae94('0x13')](_0xae94('0x16'),_0x1b9afb['message'],_0xe53dae);_0x3af217(_0x403974[_0xae94('0x13')](0x1f4,_0x1b9afb[_0xae94('0x14')]));});});};exports[_0xae94('0x20')]=function(_0x3138b7){return new Promise(function(_0x47b19b,_0x1482c3){return db[_0xae94('0x17')][_0xae94('0x21')]({'where':_0x3138b7[_0xae94('0x19')]?_0x3138b7[_0xae94('0x19')][_0xae94('0x1b')]||null:null})['then'](function(_0x1713e6){if(_0x1713e6){return _0x1713e6[_0xae94('0x22')](_0x3138b7['body'][_0xae94('0x23')],_[_0xae94('0x24')](_0x3138b7[_0xae94('0x25')],[_0xae94('0x23'),'id'])||{});}})[_0xae94('0x26')](function(_0x5b84ab){logger[_0xae94('0xe')]('AddTags',_0x3138b7);logger[_0xae94('0x11')]('AddTags',_0x3138b7,JSON[_0xae94('0x12')](_0x5b84ab));_0x47b19b(_0x5b84ab);})[_0xae94('0x1f')](function(_0x91f1ef){logger['error'](_0xae94('0x27'),_0x91f1ef['message'],_0x3138b7);_0x1482c3(_this[_0xae94('0x13')](0x1f4,_0x91f1ef[_0xae94('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5fc5fd4..c281ed3 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 _0x8710=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x164e77,_0x37681c){var _0x325b37=function(_0x2b5c19){while(--_0x2b5c19){_0x164e77['push'](_0x164e77['shift']());}};_0x325b37(++_0x37681c);}(_0x8710,0xdc));var _0x0871=function(_0x4b6eca,_0x1af801){_0x4b6eca=_0x4b6eca-0x0;var _0x63734d=_0x8710[_0x4b6eca];return _0x63734d;};'use strict';var OpenchannelInteractionEvents=require(_0x0871('0x0'));var events=[_0x0871('0x1'),_0x0871('0x2'),_0x0871('0x3')];function createListener(_0x56cbd1,_0x14e929){return function(_0x1362be){_0x14e929[_0x0871('0x4')](_0x56cbd1,_0x1362be);};}function removeListener(_0x5ab60a,_0x1ff70d){return function(){OpenchannelInteractionEvents[_0x0871('0x5')](_0x5ab60a,_0x1ff70d);};}exports[_0x0871('0x6')]=function(_0x4949b4){for(var _0x4b2933=0x0,_0xdcd12a=events[_0x0871('0x7')];_0x4b2933<_0xdcd12a;_0x4b2933++){var _0x2e1fe5=events[_0x4b2933];var _0x415419=createListener(_0x0871('0x8')+_0x2e1fe5,_0x4949b4);OpenchannelInteractionEvents['on'](_0x2e1fe5,_0x415419);}}; \ No newline at end of file +var _0x3f89=['remove','emit','register','openchannelInteraction:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f89,0x150));var _0x93f8=function(_0x45a3fb,_0x218058){_0x45a3fb=_0x45a3fb-0x0;var _0x34dbaf=_0x3f89[_0x45a3fb];return _0x34dbaf;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x93f8('0x0'),'update'];function createListener(_0x111073,_0x5c9ffa){return function(_0x4a518b){_0x5c9ffa[_0x93f8('0x1')](_0x111073,_0x4a518b);};}function removeListener(_0x45fff5,_0x2b3974){return function(){OpenchannelInteractionEvents['removeListener'](_0x45fff5,_0x2b3974);};}exports[_0x93f8('0x2')]=function(_0x32ae2a){for(var _0x6dd7dc=0x0,_0x4c66cf=events['length'];_0x6dd7dc<_0x4c66cf;_0x6dd7dc++){var _0x26492b=events[_0x6dd7dc];var _0x43ba34=createListener(_0x93f8('0x3')+_0x26492b,_0x32ae2a);OpenchannelInteractionEvents['on'](_0x26492b,_0x43ba34);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6b49ee7..c41e850 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x49f626,_0x3667dd){var _0x109c63=function(_0x27e67e){while(--_0x27e67e){_0x49f626['push'](_0x49f626['shift']());}};_0x109c63(++_0x3667dd);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x50c9b7,_0x14f813){var _0x202f64=function(_0x2d426d){while(--_0x2d426d){_0x50c9b7['push'](_0x50c9b7['shift']());}};_0x202f64(++_0x14f813);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 88a6eec..374294b 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 _0xd523=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x2c881a,_0x20425c){var _0x247014=function(_0x1823a1){while(--_0x1823a1){_0x2c881a['push'](_0x2c881a['shift']());}};_0x247014(++_0x20425c);}(_0xd523,0x153));var _0x3d52=function(_0x583657,_0x3f2b91){_0x583657=_0x583657-0x0;var _0x193b72=_0xd523[_0x583657];return _0x193b72;};'use strict';var Sequelize=require(_0x3d52('0x0'));module[_0x3d52('0x1')]={'body':{'type':Sequelize[_0x3d52('0x2')](_0x3d52('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3d52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d52('0x5')]('in',_0x3d52('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3d52('0x7')]},'providerName':{'type':Sequelize[_0x3d52('0x8')]},'providerResponse':{'type':Sequelize[_0x3d52('0x2')]}}; \ No newline at end of file +var _0xda2d=['exports','TEXT','medium','BOOLEAN','DATE','STRING'];(function(_0x41a3c0,_0xb8ebd){var _0x11aaea=function(_0x4a70ce){while(--_0x4a70ce){_0x41a3c0['push'](_0x41a3c0['shift']());}};_0x11aaea(++_0xb8ebd);}(_0xda2d,0x102));var _0xdda2=function(_0x408e38,_0x332aa4){_0x408e38=_0x408e38-0x0;var _0x40efcd=_0xda2d[_0x408e38];return _0x40efcd;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdda2('0x4')]},'providerName':{'type':Sequelize[_0xdda2('0x5')]},'providerResponse':{'type':Sequelize[_0xdda2('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a435a4c..d6452ba 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 _0x75a2=['email','internal','manual','interface','channel','motionChannel','event','acceptmessage','get','RejectMessage','rejectMessage','User','EventManager','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','name','index','map','OpenchannelMessage','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','update','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x75a2,0x187));var _0x275a=function(_0x33fa39,_0x158d45){_0x33fa39=_0x33fa39-0x0;var _0x5c10f3=_0x75a2[_0x33fa39];return _0x5c10f3;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require(_0x275a('0x1'));var zipdir=require(_0x275a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require(_0x275a('0x5'));var Mustache=require(_0x275a('0x6'));var util=require('util');var path=require(_0x275a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x275a('0x8'));var squel=require(_0x275a('0x9'));var crypto=require(_0x275a('0xa'));var jsforce=require(_0x275a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x275a('0xc'));var Papa=require(_0x275a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x275a('0xe'));var hardwareService=require(_0x275a('0xf'));var logger=require(_0x275a('0x10'))(_0x275a('0x11'));var utils=require(_0x275a('0x12'));var config=require(_0x275a('0x13'));var licenseUtil=require(_0x275a('0x14'));var db=require(_0x275a('0x15'))['db'];config[_0x275a('0x16')]=_[_0x275a('0x17')](config[_0x275a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x275a('0x18'))(new Redis(config[_0x275a('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x275a('0x19'));var client=jayson[_0x275a('0x1a')][_0x275a('0x1b')]({'port':0x232c});var client9002=jayson[_0x275a('0x1a')][_0x275a('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x125348,_0x283865,_0x2a49c6,_0x222bac){return new BPromise(function(_0x58e54d,_0x538275){var _0x21cf70=_0x222bac||client;return _0x21cf70[_0x275a('0x1c')](_0x125348,_0x2a49c6)['then'](function(_0x127da5){logger['info'](_0x275a('0x1d'),_0x283865,_0x275a('0x1e'));logger['debug'](_0x275a('0x1f'),_0x283865,_0x275a('0x1e'),JSON['stringify'](_0x127da5));if(_0x127da5['error']){if(_0x127da5[_0x275a('0x20')][_0x275a('0x21')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x283865,_0x127da5['error'][_0x275a('0x22')]);return _0x538275(_0x127da5[_0x275a('0x20')][_0x275a('0x22')]);}logger[_0x275a('0x20')](_0x275a('0x1d'),_0x283865,_0x127da5['error'][_0x275a('0x22')]);return _0x58e54d(_0x127da5[_0x275a('0x20')][_0x275a('0x22')]);}else{logger[_0x275a('0x23')](_0x275a('0x1d'),_0x283865,'request\x20sent');_0x58e54d(_0x127da5[_0x275a('0x24')][_0x275a('0x22')]);}})[_0x275a('0x25')](function(_0x1441c3){logger[_0x275a('0x20')](_0x275a('0x1d'),_0x283865,_0x1441c3);_0x538275(_0x1441c3);});});}function respondWithStatusCode(_0x417397,_0x366002){_0x366002=_0x366002||0xcc;return function(_0x204f05){if(_0x204f05){return _0x417397[_0x275a('0x26')](_0x366002);}return _0x417397['status'](_0x366002)[_0x275a('0x27')]();};}function respondWithResult(_0x1e424f,_0x57c10b){_0x57c10b=_0x57c10b||0xc8;return function(_0x257f7e){if(_0x257f7e){return _0x1e424f[_0x275a('0x28')](_0x57c10b)[_0x275a('0x29')](_0x257f7e);}};}function respondWithFilteredResult(_0xa5048b,_0x5be632){return function(_0x265b1f){if(_0x265b1f){var _0x440157=typeof _0x5be632[_0x275a('0x2a')]===_0x275a('0x2b')&&typeof _0x5be632[_0x275a('0x2c')]===_0x275a('0x2b');var _0x3d0fa0=_0x265b1f[_0x275a('0x2d')];var _0xe22b72=_0x440157?0x0:_0x5be632[_0x275a('0x2a')];var _0x50d998=_0x440157?_0x265b1f[_0x275a('0x2d')]:_0x5be632[_0x275a('0x2a')]+_0x5be632['limit'];var _0xad876e;if(_0x50d998>=_0x3d0fa0){_0x50d998=_0x3d0fa0;_0xad876e=0xc8;}else{_0xad876e=0xce;}_0xa5048b[_0x275a('0x28')](_0xad876e);return _0xa5048b[_0x275a('0x2e')](_0x275a('0x2f'),_0xe22b72+'-'+_0x50d998+'/'+_0x3d0fa0)['json'](_0x265b1f);}return null;};}function patchUpdates(_0x281437){return function(_0xae2096){try{jsonpatch[_0x275a('0x30')](_0xae2096,_0x281437,!![]);}catch(_0x9e9180){return BPromise[_0x275a('0x31')](_0x9e9180);}return _0xae2096['save']();};}function saveUpdates(_0xb2e67f,_0x334403){return function(_0x33a166){if(_0x33a166){return _0x33a166['update'](_0xb2e67f)[_0x275a('0x32')](function(_0x4c33a7){return _0x4c33a7;});}return null;};}function removeEntity(_0x382fd3,_0x5a5401){return function(_0x4ea389){if(_0x4ea389){return _0x4ea389[_0x275a('0x33')]()[_0x275a('0x32')](function(){_0x382fd3[_0x275a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f98d4,_0x117ae6){return function(_0x2514d2){if(!_0x2514d2){_0x2f98d4[_0x275a('0x26')](0x194);}return _0x2514d2;};}function handleError(_0x25586c,_0x2c5f19){_0x2c5f19=_0x2c5f19||0x1f4;return function(_0x232e32){logger[_0x275a('0x20')](_0x232e32['stack']);if(_0x232e32[_0x275a('0x34')]){delete _0x232e32[_0x275a('0x34')];}_0x25586c[_0x275a('0x28')](_0x2c5f19)['send'](_0x232e32);};}exports[_0x275a('0x35')]=function(_0x136d4f,_0x1d068a){var _0x536949={},_0x2de81e={},_0x29a2be={'count':0x0,'rows':[]};var _0x593b3d=_[_0x275a('0x36')](db[_0x275a('0x37')]['rawAttributes'],function(_0x24d26b){return{'name':_0x24d26b['fieldName'],'type':_0x24d26b[_0x275a('0x38')][_0x275a('0x39')]};});_0x2de81e['model']=_['map'](_0x593b3d,_0x275a('0x34'));_0x2de81e[_0x275a('0x3a')]=_[_0x275a('0x3b')](_0x136d4f['query']);_0x2de81e[_0x275a('0x3c')]=_['intersection'](_0x2de81e[_0x275a('0x3d')],_0x2de81e[_0x275a('0x3a')]);_0x536949[_0x275a('0x3e')]=_[_0x275a('0x3f')](_0x2de81e[_0x275a('0x3d')],qs[_0x275a('0x40')](_0x136d4f[_0x275a('0x3a')][_0x275a('0x40')]));_0x536949[_0x275a('0x3e')]=_0x536949[_0x275a('0x3e')][_0x275a('0x41')]?_0x536949['attributes']:_0x2de81e[_0x275a('0x3d')];if(!_0x136d4f[_0x275a('0x3a')][_0x275a('0x42')]('nolimit')){_0x536949[_0x275a('0x2c')]=qs['limit'](_0x136d4f[_0x275a('0x3a')]['limit']);_0x536949[_0x275a('0x2a')]=qs[_0x275a('0x2a')](_0x136d4f[_0x275a('0x3a')][_0x275a('0x2a')]);}_0x536949[_0x275a('0x43')]=qs[_0x275a('0x44')](_0x136d4f[_0x275a('0x3a')][_0x275a('0x44')]);_0x536949[_0x275a('0x45')]=qs['filters'](_[_0x275a('0x46')](_0x136d4f[_0x275a('0x3a')],_0x2de81e[_0x275a('0x3c')]),_0x593b3d);if(_0x136d4f[_0x275a('0x3a')][_0x275a('0x47')]){_0x536949[_0x275a('0x45')]=_[_0x275a('0x48')](_0x536949[_0x275a('0x45')],{'$or':_[_0x275a('0x36')](_0x593b3d,function(_0x1e901e){if(_0x1e901e['type']!==_0x275a('0x49')){var _0xb58795={};_0xb58795[_0x1e901e[_0x275a('0x34')]]={'$like':'%'+_0x136d4f[_0x275a('0x3a')]['filter']+'%'};return _0xb58795;}})});}_0x536949=_['merge']({},_0x536949,_0x136d4f[_0x275a('0x4a')]);var _0x409abd={'where':_0x536949[_0x275a('0x45')]};return db[_0x275a('0x37')][_0x275a('0x2d')](_0x409abd)[_0x275a('0x32')](function(_0x443727){_0x29a2be[_0x275a('0x2d')]=_0x443727;if(_0x136d4f[_0x275a('0x3a')]['includeAll']){_0x536949[_0x275a('0x4b')]=[{'all':!![]}];}return db[_0x275a('0x37')][_0x275a('0x4c')](_0x536949);})['then'](function(_0xc7de2f){_0x29a2be[_0x275a('0x4d')]=_0xc7de2f;return _0x29a2be;})[_0x275a('0x32')](respondWithFilteredResult(_0x1d068a,_0x536949))[_0x275a('0x25')](handleError(_0x1d068a,null));};exports[_0x275a('0x4e')]=function(_0x94bcc3,_0x291c3f){var _0x9f43d1={'raw':!![],'where':{'id':_0x94bcc3[_0x275a('0x4f')]['id']}},_0x19a537={};_0x19a537[_0x275a('0x3d')]=_['keys'](db[_0x275a('0x37')][_0x275a('0x50')]);_0x19a537[_0x275a('0x3a')]=_[_0x275a('0x3b')](_0x94bcc3['query']);_0x19a537[_0x275a('0x3c')]=_[_0x275a('0x3f')](_0x19a537[_0x275a('0x3d')],_0x19a537[_0x275a('0x3a')]);_0x9f43d1['attributes']=_[_0x275a('0x3f')](_0x19a537['model'],qs[_0x275a('0x40')](_0x94bcc3['query'][_0x275a('0x40')]));_0x9f43d1[_0x275a('0x3e')]=_0x9f43d1[_0x275a('0x3e')][_0x275a('0x41')]?_0x9f43d1[_0x275a('0x3e')]:_0x19a537[_0x275a('0x3d')];if(_0x94bcc3[_0x275a('0x3a')][_0x275a('0x51')]){_0x9f43d1[_0x275a('0x4b')]=[{'all':!![]}];}_0x9f43d1=_['merge']({},_0x9f43d1,_0x94bcc3['options']);return db['OpenchannelMessage'][_0x275a('0x52')](_0x9f43d1)['then'](handleEntityNotFound(_0x291c3f,null))[_0x275a('0x32')](respondWithResult(_0x291c3f,null))[_0x275a('0x25')](handleError(_0x291c3f,null));};exports[_0x275a('0x53')]=function(_0x354aee,_0x3ed896){return db[_0x275a('0x37')]['create'](_0x354aee['body'],{})[_0x275a('0x32')](respondWithResult(_0x3ed896,0xc9))[_0x275a('0x25')](handleError(_0x3ed896,null));};exports[_0x275a('0x54')]=function(_0x2dedbd,_0x51599f){if(_0x2dedbd[_0x275a('0x55')]['id']){delete _0x2dedbd[_0x275a('0x55')]['id'];}return db[_0x275a('0x37')][_0x275a('0x52')]({'where':{'id':_0x2dedbd[_0x275a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x51599f,null))['then'](saveUpdates(_0x2dedbd[_0x275a('0x55')],null))['then'](respondWithResult(_0x51599f,null))['catch'](handleError(_0x51599f,null));};exports['destroy']=function(_0x2c2a84,_0x42b5e7){return db[_0x275a('0x37')]['find']({'where':{'id':_0x2c2a84[_0x275a('0x4f')]['id']}})[_0x275a('0x32')](handleEntityNotFound(_0x42b5e7,null))[_0x275a('0x32')](removeEntity(_0x42b5e7,null))[_0x275a('0x25')](handleError(_0x42b5e7,null));};exports[_0x275a('0x56')]=function(_0x360792,_0x52e489){return db[_0x275a('0x37')][_0x275a('0x56')]()['then'](respondWithResult(_0x52e489,null))[_0x275a('0x25')](handleError(_0x52e489,null));};var interaction_log=require(_0x275a('0x10'))(_0x275a('0x57'));exports[_0x275a('0x58')]=function(_0x119ee7,_0x358f1a,_0x4c54f1){var _0xe867de={'agent':{},'channel':_0x275a('0x59')};if(_0x119ee7[_0x275a('0x55')]['id']){delete _0x119ee7[_0x275a('0x55')]['id'];}_0x119ee7[_0x275a('0x55')][_0x275a('0x5a')]=!![];_0x119ee7[_0x275a('0x55')][_0x275a('0x5b')]=moment()[_0x275a('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x119ee7[_0x275a('0x55')][_0x275a('0x5d')]=_0x119ee7[_0x275a('0x55')][_0x275a('0x5d')]||_0x119ee7[_0x275a('0x5e')]['id'];_0xe867de[_0x275a('0x5f')]['id']=_0x119ee7[_0x275a('0x55')][_0x275a('0x5d')];return db['OpenchannelMessage'][_0x275a('0x52')]({'where':{'id':_0x119ee7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x358f1a,null))[_0x275a('0x32')](saveUpdates(_0x119ee7[_0x275a('0x55')],null))[_0x275a('0x32')](function(_0x558fee){if(_0x558fee){_0xe867de[_0x275a('0x22')]=_0x558fee['get']({'plain':!![]});return db[_0x275a('0x60')][_0x275a('0x52')]({'where':{'id':_0x558fee[_0x275a('0x61')]}});}return null;})[_0x275a('0x32')](handleEntityNotFound(_0x358f1a,null))['then'](function(_0x2dcb13){if(_0x2dcb13){return _0x2dcb13[_0x275a('0x54')]({'UserId':_0x119ee7[_0x275a('0x55')]['UserId'],'read1stAt':_[_0x275a('0x62')](_0x2dcb13[_0x275a('0x63')])?moment()[_0x275a('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x87694e){if(_0x87694e){_0xe867de[_0x275a('0x64')]=_0x87694e['get']({'plain':!![]});interaction_log[_0x275a('0x23')](_0x275a('0x65'),_0x119ee7[_0x275a('0x5e')]['id'],_0x119ee7[_0x275a('0x5e')][_0x275a('0x34')],_0x119ee7[_0x275a('0x5e')][_0x275a('0x66')],_0xe867de['interaction']['id'],_0x119ee7['body']?JSON[_0x275a('0x67')](_0x119ee7[_0x275a('0x55')]):_0x275a('0x68'));return respondWithRpcPromise(_0x275a('0x69'),'acceptMessage',_0xe867de);}return null;})['then'](function(_0x5af874){var _0x3c1897=_0x275a('0x6a')+_0x5af874['message'][_0x275a('0x6b')];return db[_0x275a('0x6c')][_0x275a('0x3a')](_0x3c1897,{'type':db['Sequelize'][_0x275a('0x6d')][_0x275a('0x6e')],'raw':!![]})[_0x275a('0x32')](function(_0x5a25db){return _0x5a25db;});})[_0x275a('0x32')](function(_0x887cbe){if(_0x887cbe){_0xe867de[_0x275a('0x22')][_0x275a('0x6f')]=_0x887cbe[0x0];if(!_0x119ee7['body'][_0x275a('0x5d')])return;return db['User'][_0x275a('0x52')]({'where':{'id':_0x119ee7['body']['UserId'],'role':'agent'},'attributes':['id',_0x275a('0x34'),_0x275a('0x70'),_0x275a('0x71'),_0x275a('0x72')],'raw':!![]});}return null;})[_0x275a('0x32')](function(_0x56d446){if(!_0x56d446)return null;_0xe867de[_0x275a('0x22')]['agent']=_0x56d446;return _0xe867de;})['then'](function(_0x170dd5){if(_0x170dd5){if(_0x119ee7[_0x275a('0x55')][_0x275a('0x73')]){_0xe867de[_0x275a('0x22')][_0x275a('0x74')]=util[_0x275a('0x5c')]('SIP/%s',_0x119ee7[_0x275a('0x5e')][_0x275a('0x34')]);_0xe867de['message'][_0x275a('0x75')]=_0xe867de[_0x275a('0x75')];_0xe867de[_0x275a('0x22')][_0x275a('0x76')]=_0xe867de[_0x275a('0x75')];_0xe867de[_0x275a('0x22')][_0x275a('0x77')]=_0x275a('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x275a('0x78'),'message':_0xe867de[_0x275a('0x22')]},client9002)['then'](function(){return _0xe867de;});}return _0xe867de;}return null;})[_0x275a('0x32')](respondWithResult(_0x358f1a,null))[_0x275a('0x25')](handleError(_0x358f1a,null));};var interaction_log=require(_0x275a('0x10'))(_0x275a('0x57'));exports['reject']=function(_0x38ef10,_0x42b8cb,_0x139ad1){var _0x5e4e22={'agent':{},'channel':'openchannel'};if(_0x38ef10[_0x275a('0x55')]['id']){delete _0x38ef10[_0x275a('0x55')]['id'];}_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')]=_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')]||_0x38ef10[_0x275a('0x5e')]['id'];_0x5e4e22['agent']['id']=_0x38ef10['body'][_0x275a('0x5d')];return db['OpenchannelMessage'][_0x275a('0x52')]({'where':{'id':_0x38ef10[_0x275a('0x4f')]['id'],'UserId':null}})[_0x275a('0x32')](handleEntityNotFound(_0x42b8cb,null))[_0x275a('0x32')](function(_0x2742b8){if(_0x2742b8){_0x5e4e22['message']=_0x2742b8[_0x275a('0x79')]({'plain':!![]});return db[_0x275a('0x60')]['find']({'where':{'id':_0x2742b8[_0x275a('0x61')]}});}return null;})[_0x275a('0x32')](handleEntityNotFound(_0x42b8cb,null))['then'](function(_0x1da7fe){if(_0x1da7fe){_0x5e4e22[_0x275a('0x64')]=_0x1da7fe['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x38ef10[_0x275a('0x5e')]['id'],_0x38ef10[_0x275a('0x5e')][_0x275a('0x34')],_0x38ef10[_0x275a('0x5e')][_0x275a('0x66')],_0x5e4e22[_0x275a('0x64')]['id'],_0x38ef10[_0x275a('0x55')]?JSON[_0x275a('0x67')](_0x38ef10[_0x275a('0x55')]):_0x275a('0x68'));return respondWithRpcPromise(_0x275a('0x7a'),_0x275a('0x7b'),_0x5e4e22);}return null;})[_0x275a('0x32')](function(_0x5943d6){var _0x571fde=_0x275a('0x6a')+_0x5943d6[_0x275a('0x22')][_0x275a('0x6b')];return db[_0x275a('0x6c')][_0x275a('0x3a')](_0x571fde,{'type':db['Sequelize'][_0x275a('0x6d')]['SELECT'],'raw':!![]})[_0x275a('0x32')](function(_0x3d7f2f){return _0x3d7f2f;});})[_0x275a('0x32')](function(_0x3552b4){if(_0x3552b4){_0x5e4e22['message'][_0x275a('0x6f')]=_0x3552b4[0x0];if(!_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')])return;return db[_0x275a('0x7c')]['find']({'where':{'id':_0x38ef10[_0x275a('0x55')][_0x275a('0x5d')],'role':'agent'},'attributes':['id',_0x275a('0x34'),_0x275a('0x70'),_0x275a('0x71'),_0x275a('0x72')],'raw':!![]});}return null;})[_0x275a('0x32')](function(_0x40c169){if(!_0x40c169)return null;_0x5e4e22[_0x275a('0x22')][_0x275a('0x5f')]=_0x40c169;return _0x5e4e22;})[_0x275a('0x32')](function(_0x47299a){if(_0x47299a){_0x47299a[_0x275a('0x22')][_0x275a('0x74')]=util[_0x275a('0x5c')]('SIP/%s',_0x38ef10[_0x275a('0x5e')]['name']);_0x47299a['message'][_0x275a('0x75')]=_0x5e4e22['channel'];_0x47299a[_0x275a('0x22')]['motionChannel']=_0x5e4e22[_0x275a('0x75')];_0x47299a[_0x275a('0x22')]['event']=_0x275a('0x31');respondWithRpcPromise('EventManager',_0x275a('0x7d'),{'event':'rejectmessage','message':_0x47299a[_0x275a('0x22')]},client9002);return _0x5e4e22;}return null;})[_0x275a('0x32')](respondWithResult(_0x42b8cb,null))[_0x275a('0x25')](handleError(_0x42b8cb,null));}; \ No newline at end of file +var _0xf130=['type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','keys','find','create','body','update','params','describe','../../config/logger','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','status','set','apply','reject','save','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName'];(function(_0xe6489a,_0x11ad57){var _0x3965cb=function(_0x555a47){while(--_0x555a47){_0xe6489a['push'](_0xe6489a['shift']());}};_0x3965cb(++_0x11ad57);}(_0xf130,0x149));var _0x0f13=function(_0x278704,_0xc0dc70){_0x278704=_0x278704-0x0;var _0x33efce=_0xf130[_0x278704];return _0x33efce;};'use strict';var emlformat=require(_0x0f13('0x0'));var rimraf=require(_0x0f13('0x1'));var zipdir=require(_0x0f13('0x2'));var jsonpatch=require(_0x0f13('0x3'));var rp=require(_0x0f13('0x4'));var moment=require(_0x0f13('0x5'));var BPromise=require(_0x0f13('0x6'));var Mustache=require(_0x0f13('0x7'));var util=require('util');var path=require(_0x0f13('0x8'));var sox=require(_0x0f13('0x9'));var csv=require(_0x0f13('0xa'));var ejs=require(_0x0f13('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f13('0xc'));var squel=require(_0x0f13('0xd'));var crypto=require(_0x0f13('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f13('0xf'));var toCsv=require(_0x0f13('0xa'));var querystring=require(_0x0f13('0x10'));var Papa=require(_0x0f13('0x11'));var Redis=require(_0x0f13('0x12'));var authService=require(_0x0f13('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f13('0x14'));var logger=require('../../config/logger')(_0x0f13('0x15'));var utils=require(_0x0f13('0x16'));var config=require(_0x0f13('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f13('0x18'))['db'];config[_0x0f13('0x19')]=_[_0x0f13('0x1a')](config[_0x0f13('0x19')],{'host':_0x0f13('0x1b'),'port':0x18eb});var socket=require(_0x0f13('0x1c'))(new Redis(config['redis']));require(_0x0f13('0x1d'))[_0x0f13('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0f13('0x1f')][_0x0f13('0x20')]({'port':0x232c});var client9002=jayson[_0x0f13('0x1f')][_0x0f13('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x187568,_0x308893,_0x154fe7,_0x21e952){return new BPromise(function(_0x5702c3,_0x2d3c7a){var _0x2b4f43=_0x21e952||client;return _0x2b4f43['request'](_0x187568,_0x154fe7)[_0x0f13('0x21')](function(_0x5d94c4){logger[_0x0f13('0x22')](_0x0f13('0x23'),_0x308893,_0x0f13('0x24'));logger[_0x0f13('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x308893,'request\x20sent',JSON[_0x0f13('0x26')](_0x5d94c4));if(_0x5d94c4[_0x0f13('0x27')]){if(_0x5d94c4[_0x0f13('0x27')][_0x0f13('0x28')]===0x1f4){logger[_0x0f13('0x27')](_0x0f13('0x23'),_0x308893,_0x5d94c4[_0x0f13('0x27')][_0x0f13('0x29')]);return _0x2d3c7a(_0x5d94c4[_0x0f13('0x27')][_0x0f13('0x29')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x308893,_0x5d94c4[_0x0f13('0x27')][_0x0f13('0x29')]);return _0x5702c3(_0x5d94c4[_0x0f13('0x27')][_0x0f13('0x29')]);}else{logger[_0x0f13('0x22')](_0x0f13('0x23'),_0x308893,'request\x20sent');_0x5702c3(_0x5d94c4[_0x0f13('0x2a')][_0x0f13('0x29')]);}})[_0x0f13('0x2b')](function(_0x68dffc){logger['error'](_0x0f13('0x23'),_0x308893,_0x68dffc);_0x2d3c7a(_0x68dffc);});});}function respondWithStatusCode(_0x53aad5,_0x1509d5){_0x1509d5=_0x1509d5||0xcc;return function(_0x4426fa){if(_0x4426fa){return _0x53aad5[_0x0f13('0x2c')](_0x1509d5);}return _0x53aad5['status'](_0x1509d5)[_0x0f13('0x2d')]();};}function respondWithResult(_0x378238,_0x25f4f5){_0x25f4f5=_0x25f4f5||0xc8;return function(_0x33664d){if(_0x33664d){return _0x378238['status'](_0x25f4f5)[_0x0f13('0x2e')](_0x33664d);}};}function respondWithFilteredResult(_0x57195c,_0x57b9ed){return function(_0x513eed){if(_0x513eed){var _0x3dfe41=typeof _0x57b9ed[_0x0f13('0x2f')]===_0x0f13('0x30')&&typeof _0x57b9ed['limit']===_0x0f13('0x30');var _0x234713=_0x513eed['count'];var _0x4eda76=_0x3dfe41?0x0:_0x57b9ed[_0x0f13('0x2f')];var _0x3e9f7c=_0x3dfe41?_0x513eed['count']:_0x57b9ed['offset']+_0x57b9ed[_0x0f13('0x31')];var _0x360d78;if(_0x3e9f7c>=_0x234713){_0x3e9f7c=_0x234713;_0x360d78=0xc8;}else{_0x360d78=0xce;}_0x57195c[_0x0f13('0x32')](_0x360d78);return _0x57195c[_0x0f13('0x33')]('Content-Range',_0x4eda76+'-'+_0x3e9f7c+'/'+_0x234713)[_0x0f13('0x2e')](_0x513eed);}return null;};}function patchUpdates(_0x1e4cac){return function(_0x59b683){try{jsonpatch[_0x0f13('0x34')](_0x59b683,_0x1e4cac,!![]);}catch(_0x2fcd24){return BPromise[_0x0f13('0x35')](_0x2fcd24);}return _0x59b683[_0x0f13('0x36')]();};}function saveUpdates(_0x369b55,_0x53c314){return function(_0x5030f7){if(_0x5030f7){return _0x5030f7['update'](_0x369b55)[_0x0f13('0x21')](function(_0x59e936){return _0x59e936;});}return null;};}function removeEntity(_0x39c4db,_0x3c0e49){return function(_0x34f850){if(_0x34f850){return _0x34f850[_0x0f13('0x37')]()['then'](function(){_0x39c4db[_0x0f13('0x32')](0xcc)[_0x0f13('0x2d')]();});}};}function handleEntityNotFound(_0x43acb1,_0x51a580){return function(_0x16a1d4){if(!_0x16a1d4){_0x43acb1[_0x0f13('0x2c')](0x194);}return _0x16a1d4;};}function handleError(_0xa31da5,_0x722465){_0x722465=_0x722465||0x1f4;return function(_0x1b3a93){logger['error'](_0x1b3a93[_0x0f13('0x38')]);if(_0x1b3a93[_0x0f13('0x39')]){delete _0x1b3a93['name'];}_0xa31da5['status'](_0x722465)[_0x0f13('0x3a')](_0x1b3a93);};}exports[_0x0f13('0x3b')]=function(_0x387960,_0x4c251b){var _0x54ef43={},_0x3ebae7={},_0x4cbc6a={'count':0x0,'rows':[]};var _0x188ac1=_[_0x0f13('0x3c')](db[_0x0f13('0x3d')][_0x0f13('0x3e')],function(_0x3eb593){return{'name':_0x3eb593[_0x0f13('0x3f')],'type':_0x3eb593[_0x0f13('0x40')]['key']};});_0x3ebae7['model']=_[_0x0f13('0x3c')](_0x188ac1,'name');_0x3ebae7[_0x0f13('0x41')]=_['keys'](_0x387960[_0x0f13('0x41')]);_0x3ebae7[_0x0f13('0x42')]=_[_0x0f13('0x43')](_0x3ebae7[_0x0f13('0x44')],_0x3ebae7['query']);_0x54ef43[_0x0f13('0x45')]=_[_0x0f13('0x43')](_0x3ebae7['model'],qs[_0x0f13('0x46')](_0x387960[_0x0f13('0x41')]['fields']));_0x54ef43['attributes']=_0x54ef43[_0x0f13('0x45')][_0x0f13('0x47')]?_0x54ef43[_0x0f13('0x45')]:_0x3ebae7[_0x0f13('0x44')];if(!_0x387960[_0x0f13('0x41')]['hasOwnProperty'](_0x0f13('0x48'))){_0x54ef43[_0x0f13('0x31')]=qs['limit'](_0x387960[_0x0f13('0x41')][_0x0f13('0x31')]);_0x54ef43[_0x0f13('0x2f')]=qs[_0x0f13('0x2f')](_0x387960[_0x0f13('0x41')]['offset']);}_0x54ef43[_0x0f13('0x49')]=qs[_0x0f13('0x4a')](_0x387960[_0x0f13('0x41')][_0x0f13('0x4a')]);_0x54ef43[_0x0f13('0x4b')]=qs[_0x0f13('0x42')](_[_0x0f13('0x4c')](_0x387960[_0x0f13('0x41')],_0x3ebae7[_0x0f13('0x42')]),_0x188ac1);if(_0x387960[_0x0f13('0x41')][_0x0f13('0x4d')]){_0x54ef43['where']=_[_0x0f13('0x4e')](_0x54ef43[_0x0f13('0x4b')],{'$or':_[_0x0f13('0x3c')](_0x188ac1,function(_0x1f210c){if(_0x1f210c['type']!==_0x0f13('0x4f')){var _0x36c1a={};_0x36c1a[_0x1f210c[_0x0f13('0x39')]]={'$like':'%'+_0x387960[_0x0f13('0x41')]['filter']+'%'};return _0x36c1a;}})});}_0x54ef43=_[_0x0f13('0x4e')]({},_0x54ef43,_0x387960[_0x0f13('0x50')]);var _0x1609b5={'where':_0x54ef43[_0x0f13('0x4b')]};return db['OpenchannelMessage'][_0x0f13('0x51')](_0x1609b5)[_0x0f13('0x21')](function(_0x53cafe){_0x4cbc6a['count']=_0x53cafe;if(_0x387960[_0x0f13('0x41')][_0x0f13('0x52')]){_0x54ef43[_0x0f13('0x53')]=[{'all':!![]}];}return db[_0x0f13('0x3d')][_0x0f13('0x54')](_0x54ef43);})[_0x0f13('0x21')](function(_0x35e291){_0x4cbc6a['rows']=_0x35e291;return _0x4cbc6a;})[_0x0f13('0x21')](respondWithFilteredResult(_0x4c251b,_0x54ef43))[_0x0f13('0x2b')](handleError(_0x4c251b,null));};exports[_0x0f13('0x55')]=function(_0x393076,_0x43109b){var _0x5e53d8={'raw':!![],'where':{'id':_0x393076['params']['id']}},_0x25b015={};_0x25b015[_0x0f13('0x44')]=_[_0x0f13('0x56')](db[_0x0f13('0x3d')][_0x0f13('0x3e')]);_0x25b015[_0x0f13('0x41')]=_[_0x0f13('0x56')](_0x393076[_0x0f13('0x41')]);_0x25b015['filters']=_[_0x0f13('0x43')](_0x25b015[_0x0f13('0x44')],_0x25b015[_0x0f13('0x41')]);_0x5e53d8[_0x0f13('0x45')]=_['intersection'](_0x25b015['model'],qs[_0x0f13('0x46')](_0x393076['query'][_0x0f13('0x46')]));_0x5e53d8[_0x0f13('0x45')]=_0x5e53d8['attributes'][_0x0f13('0x47')]?_0x5e53d8[_0x0f13('0x45')]:_0x25b015['model'];if(_0x393076[_0x0f13('0x41')]['includeAll']){_0x5e53d8[_0x0f13('0x53')]=[{'all':!![]}];}_0x5e53d8=_['merge']({},_0x5e53d8,_0x393076[_0x0f13('0x50')]);return db[_0x0f13('0x3d')][_0x0f13('0x57')](_0x5e53d8)[_0x0f13('0x21')](handleEntityNotFound(_0x43109b,null))['then'](respondWithResult(_0x43109b,null))[_0x0f13('0x2b')](handleError(_0x43109b,null));};exports[_0x0f13('0x58')]=function(_0x5b4f7f,_0x80cb01){return db[_0x0f13('0x3d')]['create'](_0x5b4f7f[_0x0f13('0x59')],{})[_0x0f13('0x21')](respondWithResult(_0x80cb01,0xc9))[_0x0f13('0x2b')](handleError(_0x80cb01,null));};exports[_0x0f13('0x5a')]=function(_0x36859a,_0x2177a4){if(_0x36859a[_0x0f13('0x59')]['id']){delete _0x36859a[_0x0f13('0x59')]['id'];}return db[_0x0f13('0x3d')]['find']({'where':{'id':_0x36859a[_0x0f13('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2177a4,null))[_0x0f13('0x21')](saveUpdates(_0x36859a[_0x0f13('0x59')],null))[_0x0f13('0x21')](respondWithResult(_0x2177a4,null))['catch'](handleError(_0x2177a4,null));};exports[_0x0f13('0x37')]=function(_0x15ff82,_0x4b3f7f){return db['OpenchannelMessage'][_0x0f13('0x57')]({'where':{'id':_0x15ff82[_0x0f13('0x5b')]['id']}})[_0x0f13('0x21')](handleEntityNotFound(_0x4b3f7f,null))[_0x0f13('0x21')](removeEntity(_0x4b3f7f,null))[_0x0f13('0x2b')](handleError(_0x4b3f7f,null));};exports['describe']=function(_0x23831a,_0x46330a){return db[_0x0f13('0x3d')][_0x0f13('0x5c')]()[_0x0f13('0x21')](respondWithResult(_0x46330a,null))[_0x0f13('0x2b')](handleError(_0x46330a,null));};var interaction_log=require(_0x0f13('0x5d'))('openchannel-interactions');exports['accept']=function(_0x18d8e3,_0x1332cb,_0x2f35b4){var _0x256306={'agent':{},'channel':'openchannel'};if(_0x18d8e3[_0x0f13('0x59')]['id']){delete _0x18d8e3[_0x0f13('0x59')]['id'];}_0x18d8e3[_0x0f13('0x59')][_0x0f13('0x5e')]=!![];_0x18d8e3[_0x0f13('0x59')]['readAt']=moment()[_0x0f13('0x5f')](_0x0f13('0x60'));_0x18d8e3['body'][_0x0f13('0x61')]=_0x18d8e3[_0x0f13('0x59')]['UserId']||_0x18d8e3[_0x0f13('0x62')]['id'];_0x256306[_0x0f13('0x63')]['id']=_0x18d8e3[_0x0f13('0x59')][_0x0f13('0x61')];return db['OpenchannelMessage'][_0x0f13('0x57')]({'where':{'id':_0x18d8e3[_0x0f13('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1332cb,null))[_0x0f13('0x21')](saveUpdates(_0x18d8e3[_0x0f13('0x59')],null))['then'](function(_0x27c076){if(_0x27c076){_0x256306[_0x0f13('0x29')]=_0x27c076[_0x0f13('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x0f13('0x57')]({'where':{'id':_0x27c076[_0x0f13('0x65')]}});}return null;})[_0x0f13('0x21')](handleEntityNotFound(_0x1332cb,null))[_0x0f13('0x21')](function(_0x372d56){if(_0x372d56){return _0x372d56[_0x0f13('0x5a')]({'UserId':_0x18d8e3[_0x0f13('0x59')]['UserId'],'read1stAt':_[_0x0f13('0x66')](_0x372d56[_0x0f13('0x67')])?moment()[_0x0f13('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0f13('0x21')](function(_0x4562f6){if(_0x4562f6){_0x256306['interaction']=_0x4562f6['get']({'plain':!![]});interaction_log[_0x0f13('0x22')](_0x0f13('0x68'),_0x18d8e3[_0x0f13('0x62')]['id'],_0x18d8e3[_0x0f13('0x62')][_0x0f13('0x39')],_0x18d8e3['user'][_0x0f13('0x69')],_0x256306[_0x0f13('0x6a')]['id'],_0x18d8e3[_0x0f13('0x59')]?JSON[_0x0f13('0x26')](_0x18d8e3[_0x0f13('0x59')]):_0x0f13('0x6b'));return respondWithRpcPromise(_0x0f13('0x6c'),_0x0f13('0x6d'),_0x256306);}return null;})['then'](function(_0x16fe44){var _0x522054=_0x0f13('0x6e')+_0x16fe44[_0x0f13('0x29')]['ContactId'];return db[_0x0f13('0x6f')]['query'](_0x522054,{'type':db[_0x0f13('0x70')][_0x0f13('0x71')][_0x0f13('0x72')],'raw':!![]})[_0x0f13('0x21')](function(_0x106f44){return _0x106f44;});})['then'](function(_0x1245e1){if(_0x1245e1){_0x256306['message'][_0x0f13('0x73')]=_0x1245e1[0x0];if(!_0x18d8e3[_0x0f13('0x59')][_0x0f13('0x61')])return;return db[_0x0f13('0x74')][_0x0f13('0x57')]({'where':{'id':_0x18d8e3[_0x0f13('0x59')][_0x0f13('0x61')],'role':_0x0f13('0x63')},'attributes':['id','name','fullname','email',_0x0f13('0x75')],'raw':!![]});}return null;})[_0x0f13('0x21')](function(_0x75c70d){if(!_0x75c70d)return null;_0x256306['message'][_0x0f13('0x63')]=_0x75c70d;return _0x256306;})[_0x0f13('0x21')](function(_0x4b64a9){if(_0x4b64a9){if(_0x18d8e3[_0x0f13('0x59')]['manual']){_0x256306['message'][_0x0f13('0x76')]=util[_0x0f13('0x5f')](_0x0f13('0x77'),_0x18d8e3[_0x0f13('0x62')][_0x0f13('0x39')]);_0x256306[_0x0f13('0x29')]['channel']=_0x256306[_0x0f13('0x78')];_0x256306[_0x0f13('0x29')][_0x0f13('0x79')]=_0x256306[_0x0f13('0x78')];_0x256306['message'][_0x0f13('0x7a')]=_0x0f13('0x7b');return respondWithRpcPromise(_0x0f13('0x7c'),_0x0f13('0x7c'),{'event':_0x0f13('0x7d'),'message':_0x256306[_0x0f13('0x29')]},client9002)[_0x0f13('0x21')](function(){return _0x256306;});}return _0x256306;}return null;})[_0x0f13('0x21')](respondWithResult(_0x1332cb,null))[_0x0f13('0x2b')](handleError(_0x1332cb,null));};var interaction_log=require(_0x0f13('0x5d'))('openchannel-interactions');exports[_0x0f13('0x35')]=function(_0x3dab4f,_0x294b8a,_0x538eaf){var _0x2af0b9={'agent':{},'channel':'openchannel'};if(_0x3dab4f['body']['id']){delete _0x3dab4f['body']['id'];}_0x3dab4f[_0x0f13('0x59')]['UserId']=_0x3dab4f[_0x0f13('0x59')]['UserId']||_0x3dab4f[_0x0f13('0x62')]['id'];_0x2af0b9['agent']['id']=_0x3dab4f[_0x0f13('0x59')][_0x0f13('0x61')];return db['OpenchannelMessage'][_0x0f13('0x57')]({'where':{'id':_0x3dab4f[_0x0f13('0x5b')]['id'],'UserId':null}})[_0x0f13('0x21')](handleEntityNotFound(_0x294b8a,null))[_0x0f13('0x21')](function(_0x1a1e31){if(_0x1a1e31){_0x2af0b9[_0x0f13('0x29')]=_0x1a1e31['get']({'plain':!![]});return db[_0x0f13('0x7e')][_0x0f13('0x57')]({'where':{'id':_0x1a1e31['OpenchannelInteractionId']}});}return null;})[_0x0f13('0x21')](handleEntityNotFound(_0x294b8a,null))[_0x0f13('0x21')](function(_0x209cec){if(_0x209cec){_0x2af0b9[_0x0f13('0x6a')]=_0x209cec[_0x0f13('0x64')]({'plain':!![]});interaction_log[_0x0f13('0x22')](_0x0f13('0x7f'),_0x3dab4f[_0x0f13('0x62')]['id'],_0x3dab4f['user']['name'],_0x3dab4f['user'][_0x0f13('0x69')],_0x2af0b9[_0x0f13('0x6a')]['id'],_0x3dab4f[_0x0f13('0x59')]?JSON[_0x0f13('0x26')](_0x3dab4f[_0x0f13('0x59')]):_0x0f13('0x6b'));return respondWithRpcPromise(_0x0f13('0x80'),_0x0f13('0x81'),_0x2af0b9);}return null;})[_0x0f13('0x21')](function(_0x20ca18){var _0x559060=_0x0f13('0x6e')+_0x20ca18[_0x0f13('0x29')]['ContactId'];return db[_0x0f13('0x6f')][_0x0f13('0x41')](_0x559060,{'type':db[_0x0f13('0x70')][_0x0f13('0x71')][_0x0f13('0x72')],'raw':!![]})[_0x0f13('0x21')](function(_0x56dddb){return _0x56dddb;});})[_0x0f13('0x21')](function(_0x5439ba){if(_0x5439ba){_0x2af0b9[_0x0f13('0x29')]['contact']=_0x5439ba[0x0];if(!_0x3dab4f[_0x0f13('0x59')][_0x0f13('0x61')])return;return db[_0x0f13('0x74')][_0x0f13('0x57')]({'where':{'id':_0x3dab4f[_0x0f13('0x59')][_0x0f13('0x61')],'role':_0x0f13('0x63')},'attributes':['id',_0x0f13('0x39'),'fullname','email',_0x0f13('0x75')],'raw':!![]});}return null;})[_0x0f13('0x21')](function(_0x2de1b5){if(!_0x2de1b5)return null;_0x2af0b9['message']['agent']=_0x2de1b5;return _0x2af0b9;})[_0x0f13('0x21')](function(_0x5ecc36){if(_0x5ecc36){_0x5ecc36['message'][_0x0f13('0x76')]=util['format']('SIP/%s',_0x3dab4f[_0x0f13('0x62')][_0x0f13('0x39')]);_0x5ecc36[_0x0f13('0x29')][_0x0f13('0x78')]=_0x2af0b9[_0x0f13('0x78')];_0x5ecc36[_0x0f13('0x29')]['motionChannel']=_0x2af0b9[_0x0f13('0x78')];_0x5ecc36[_0x0f13('0x29')]['event']=_0x0f13('0x35');respondWithRpcPromise('EventManager',_0x0f13('0x7c'),{'event':_0x0f13('0x82'),'message':_0x5ecc36[_0x0f13('0x29')]},client9002);return _0x2af0b9;}return null;})[_0x0f13('0x21')](respondWithResult(_0x294b8a,null))[_0x0f13('0x2b')](handleError(_0x294b8a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 7228d82..db4a6b8 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 _0x3b77=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3b77,0xe6));var _0x73b7=function(_0x4f8040,_0xe63343){_0x4f8040=_0x4f8040-0x0;var _0x4a6bbb=_0x3b77[_0x4f8040];return _0x4a6bbb;};'use strict';var EventEmitter=require(_0x73b7('0x0'));var OpenchannelMessage=require(_0x73b7('0x1'))['db'][_0x73b7('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x73b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73b7('0x4'),'afterDestroy':_0x73b7('0x5')};function emitEvent(_0x24c912){return function(_0x2996aa,_0x283c16,_0x1321b8){OpenchannelMessageEvents[_0x73b7('0x6')](_0x24c912+':'+_0x2996aa['id'],_0x2996aa);OpenchannelMessageEvents['emit'](_0x24c912,_0x2996aa);_0x1321b8(null);};}for(var e in events){if(events[_0x73b7('0x7')](e)){var event=events[e];OpenchannelMessage[_0x73b7('0x8')](e,emitEvent(event));}}module[_0x73b7('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x219f=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0x198b2f,_0x4aa795){var _0x166e41=function(_0x3a6bbb){while(--_0x3a6bbb){_0x198b2f['push'](_0x198b2f['shift']());}};_0x166e41(++_0x4aa795);}(_0x219f,0xf1));var _0xf219=function(_0x1e9d38,_0x4b10e4){_0x1e9d38=_0x1e9d38-0x0;var _0x1548d6=_0x219f[_0x1e9d38];return _0x1548d6;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xf219('0x0'))['db'][_0xf219('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf219('0x2')](0x0);var events={'afterCreate':_0xf219('0x3'),'afterUpdate':'update','afterDestroy':_0xf219('0x4')};function emitEvent(_0x2757ac){return function(_0x33e03a,_0x4915ce,_0x5b2756){OpenchannelMessageEvents[_0xf219('0x5')](_0x2757ac+':'+_0x33e03a['id'],_0x33e03a);OpenchannelMessageEvents['emit'](_0x2757ac,_0x33e03a);_0x5b2756(null);};}for(var e in events){if(events[_0xf219('0x6')](e)){var event=events[e];OpenchannelMessage[_0xf219('0x7')](e,emitEvent(event));}}module[_0xf219('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 2d0250d..90a4ba5 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 _0xe9b7=['describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','get','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact'];(function(_0xa3ff7e,_0x363b20){var _0x180f0b=function(_0x19cbd9){while(--_0x19cbd9){_0xa3ff7e['push'](_0xa3ff7e['shift']());}};_0x180f0b(++_0x363b20);}(_0xe9b7,0xe7));var _0x7e9b=function(_0x27ca80,_0x20a064){_0x27ca80=_0x27ca80-0x0;var _0x176f0a=_0xe9b7[_0x27ca80];return _0x176f0a;};'use strict';var _=require('lodash');var util=require(_0x7e9b('0x0'));var logger=require('../../config/logger')(_0x7e9b('0x1'));var moment=require(_0x7e9b('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e9b('0x3'));var fs=require('fs');var path=require(_0x7e9b('0x4'));var rimraf=require(_0x7e9b('0x5'));var config=require(_0x7e9b('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0x7e9b('0x7')]=function(_0x2f98aa,_0x21dbff){return _0x2f98aa[_0x7e9b('0x8')](_0x7e9b('0x9'),attributes,{'tableName':_0x7e9b('0xa'),'paranoid':![],'indexes':[{'name':_0x7e9b('0xb'),'fields':[_0x7e9b('0xc')],'type':_0x7e9b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x349c50,_0x3367fe,_0x573820){var _0x20ceb5=_0x2f98aa[_0x7e9b('0xe')];var _0xda824b=_0x349c50['get']({'plain':!![]});if(_0xda824b[_0x7e9b('0xf')][_0x7e9b('0x10')]()==='in'||_0xda824b[_0x7e9b('0xf')][_0x7e9b('0x10')]()===_0x7e9b('0x11')&&!_0xda824b[_0x7e9b('0x12')]&&!_[_0x7e9b('0x13')](_0xda824b[_0x7e9b('0x14')])){_0x20ceb5['OpenchannelInteraction'][_0x7e9b('0x15')]({'where':{'id':_0xda824b[_0x7e9b('0x16')]}})[_0x7e9b('0x17')](function(_0x2b2b36){if(_0x2b2b36){_0x2b2b36[_0x7e9b('0x18')]({'lastMsgAt':_0xda824b[_0x7e9b('0x19')],'lastMsgDirection':_0xda824b[_0x7e9b('0xf')][_0x7e9b('0x10')]()});}})[_0x7e9b('0x1a')](function(_0x491756){console[_0x7e9b('0x1b')](_0x491756);});}if(_0xda824b[_0x7e9b('0xf')]==='out'&&!_0xda824b[_0x7e9b('0x12')]){var _0x1fb889;_0x20ceb5[_0x7e9b('0x1c')][_0x7e9b('0x1d')]()['then'](function(_0x494da9){return _0x20ceb5[_0x7e9b('0x1e')][_0x7e9b('0x1f')]({'where':{'id':_0xda824b[_0x7e9b('0x20')]},'include':[{'model':_0x20ceb5[_0x7e9b('0x21')],'as':_0x7e9b('0x22'),'where':{'id':_0xda824b[_0x7e9b('0x16')]},'limit':0x1,'include':[{'model':_0x20ceb5[_0x7e9b('0x1c')],'as':_0x7e9b('0x23'),'attributes':_[_0x7e9b('0x24')](_0x494da9)}]}]});})[_0x7e9b('0x17')](function(_0x123a2f){_0x1fb889=_0x123a2f[_0x7e9b('0x25')]({'plain':!![]});if(_0x1fb889&&_0x1fb889[_0x7e9b('0x26')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x7e9b('0x27'),util[_0x7e9b('0x28')](_0x7e9b('0x29'),_0xda824b['id'],_0x1fb889[_0x7e9b('0x26')]));if(_0x1fb889[_0x7e9b('0x22')]&&_0x1fb889[_0x7e9b('0x22')][_0x7e9b('0x2a')]){_0xda824b['Interaction']=_[_0x7e9b('0x2b')](_0x1fb889['Interactions'][0x0],_0x7e9b('0x23'));_0xda824b[_0x7e9b('0x23')]=_0x1fb889[_0x7e9b('0x22')][0x0][_0x7e9b('0x23')];}var _0x3367fe={'method':_0x7e9b('0x2c'),'uri':encodeURI(_0x1fb889[_0x7e9b('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3367fe[_0x7e9b('0x2d')]){case _0x7e9b('0x2e'):_0x3367fe['qs']=_0xda824b;break;case'POST':_0x3367fe[_0x7e9b('0xc')]=_0xda824b;break;}return rp(_0x3367fe)[_0x7e9b('0x17')](function(_0x328edb){logger['info'](_0x7e9b('0x2f'),_0x7e9b('0x27'),util[_0x7e9b('0x28')](_0x7e9b('0x30'),_0xda824b['id'],_0x1fb889[_0x7e9b('0x26')]));if(_0x328edb['body'][_0x7e9b('0x31')]&&_0x328edb[_0x7e9b('0xc')][_0x7e9b('0x31')]!=_0xda824b['Interaction'][_0x7e9b('0x31')]){return _0x20ceb5[_0x7e9b('0x21')][_0x7e9b('0x18')]({'threadId':_0x328edb[_0x7e9b('0xc')][_0x7e9b('0x31')]},{'where':{'id':_0xda824b[_0x7e9b('0x32')]['id']}});}else{return;}})[_0x7e9b('0x17')](function(){return _0x349c50[_0x7e9b('0x18')]({'read':!![]});})[_0x7e9b('0x1a')](function(_0x3169f2){logger[_0x7e9b('0x1b')](_0x7e9b('0x2f'),_0x7e9b('0x27'),util['inspect'](_0x3169f2,{'showHidden':![],'depth':null}));_0x573820();});}else{_0x573820();}})['finally'](function(){_0x573820();});}else{_0x573820();}}},'charset':'utf8mb4','collate':_0x7e9b('0x33')});}; \ No newline at end of file +var _0x89cf=['createdAt','catch','error','secret','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','afterCreate','inspect','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','define','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update'];(function(_0x5396d5,_0x113f77){var _0x91e2ae=function(_0x3c818f){while(--_0x3c818f){_0x5396d5['push'](_0x5396d5['shift']());}};_0x91e2ae(++_0x113f77);}(_0x89cf,0xae));var _0xf89c=function(_0xe0b119,_0x46f3e1){_0xe0b119=_0xe0b119-0x0;var _0x5072f3=_0x89cf[_0xe0b119];return _0x5072f3;};'use strict';var _=require(_0xf89c('0x0'));var util=require('util');var logger=require(_0xf89c('0x1'))(_0xf89c('0x2'));var moment=require(_0xf89c('0x3'));var BPromise=require(_0xf89c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf89c('0x5'));var rimraf=require('rimraf');var config=require(_0xf89c('0x6'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x3c9d93,_0x3aedfd){return _0x3c9d93[_0xf89c('0x7')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xf89c('0x8'),'fields':[_0xf89c('0x9')],'type':_0xf89c('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57ccd0,_0x214c9c,_0x560b17){var _0x429e15=_0x3c9d93[_0xf89c('0xb')];var _0x3415f5=_0x57ccd0[_0xf89c('0xc')]({'plain':!![]});if(_0x3415f5['direction']['toLowerCase']()==='in'||_0x3415f5[_0xf89c('0xd')][_0xf89c('0xe')]()===_0xf89c('0xf')&&!_0x3415f5['secret']&&!_[_0xf89c('0x10')](_0x3415f5[_0xf89c('0x11')])){_0x429e15[_0xf89c('0x12')]['findOne']({'where':{'id':_0x3415f5[_0xf89c('0x13')]}})[_0xf89c('0x14')](function(_0x1962c7){if(_0x1962c7){_0x1962c7[_0xf89c('0x15')]({'lastMsgAt':_0x3415f5[_0xf89c('0x16')],'lastMsgDirection':_0x3415f5[_0xf89c('0xd')]['toLowerCase']()});}})[_0xf89c('0x17')](function(_0x4a4243){console[_0xf89c('0x18')](_0x4a4243);});}if(_0x3415f5[_0xf89c('0xd')]==='out'&&!_0x3415f5[_0xf89c('0x19')]){var _0x35208e;_0x429e15[_0xf89c('0x1a')][_0xf89c('0x1b')]()[_0xf89c('0x14')](function(_0x3bea12){return _0x429e15['OpenchannelAccount'][_0xf89c('0x1c')]({'where':{'id':_0x3415f5[_0xf89c('0x1d')]},'include':[{'model':_0x429e15[_0xf89c('0x12')],'as':_0xf89c('0x1e'),'where':{'id':_0x3415f5['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x429e15['CmContact'],'as':_0xf89c('0x1f'),'attributes':_['keys'](_0x3bea12)}]}]});})[_0xf89c('0x14')](function(_0x55fff7){_0x35208e=_0x55fff7['get']({'plain':!![]});if(_0x35208e&&_0x35208e[_0xf89c('0x20')]){logger[_0xf89c('0x21')](_0xf89c('0x22'),'afterCreate',util[_0xf89c('0x23')](_0xf89c('0x24'),_0x3415f5['id'],_0x35208e[_0xf89c('0x20')]));if(_0x35208e[_0xf89c('0x1e')]&&_0x35208e[_0xf89c('0x1e')][_0xf89c('0x25')]){_0x3415f5[_0xf89c('0x26')]=_[_0xf89c('0x27')](_0x35208e[_0xf89c('0x1e')][0x0],_0xf89c('0x1f'));_0x3415f5[_0xf89c('0x1f')]=_0x35208e[_0xf89c('0x1e')][0x0][_0xf89c('0x1f')];}var _0x214c9c={'method':_0xf89c('0x28'),'uri':encodeURI(_0x35208e['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x214c9c[_0xf89c('0x29')]){case _0xf89c('0x2a'):_0x214c9c['qs']=_0x3415f5;break;case _0xf89c('0x28'):_0x214c9c[_0xf89c('0x9')]=_0x3415f5;break;}return rp(_0x214c9c)[_0xf89c('0x14')](function(_0x2e4699){logger['info'](_0xf89c('0x22'),'afterCreate',util[_0xf89c('0x23')](_0xf89c('0x2b'),_0x3415f5['id'],_0x35208e[_0xf89c('0x20')]));if(_0x2e4699[_0xf89c('0x9')]['threadId']&&_0x2e4699[_0xf89c('0x9')][_0xf89c('0x2c')]!=_0x3415f5[_0xf89c('0x26')][_0xf89c('0x2c')]){return _0x429e15[_0xf89c('0x12')][_0xf89c('0x15')]({'threadId':_0x2e4699['body'][_0xf89c('0x2c')]},{'where':{'id':_0x3415f5['Interaction']['id']}});}else{return;}})['then'](function(){return _0x57ccd0[_0xf89c('0x15')]({'read':!![]});})[_0xf89c('0x17')](function(_0x278177){logger[_0xf89c('0x18')](_0xf89c('0x22'),_0xf89c('0x2d'),util[_0xf89c('0x2e')](_0x278177,{'showHidden':![],'depth':null}));_0x560b17();});}else{_0x560b17();}})[_0xf89c('0x2f')](function(){_0x560b17();});}else{_0x560b17();}}},'charset':_0xf89c('0x30'),'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 bc604c1..fa10046 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5315a5,_0x219771){var _0x203e77=function(_0x284c2f){while(--_0x284c2f){_0x5315a5['push'](_0x5315a5['shift']());}};_0x203e77(++_0x219771);}(_0x7a54,0x106));var _0x47a5=function(_0x31931e,_0x59331e){_0x31931e=_0x31931e-0x0;var _0x22d79d=_0x7a54[_0x31931e];return _0x22d79d;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x554be7,_0xae22ad){var _0x837a2b=function(_0xde3102){while(--_0xde3102){_0x554be7['push'](_0x554be7['shift']());}};_0x837a2b(++_0xae22ad);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 4dfd62c..c1a15a9 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 _0xb3d2=['./openchannelMessage.events','save','remove','update','emit','register','length','openchannelMessage:'];(function(_0x51903d,_0x2d65dd){var _0x2f5ee8=function(_0x302126){while(--_0x302126){_0x51903d['push'](_0x51903d['shift']());}};_0x2f5ee8(++_0x2d65dd);}(_0xb3d2,0x140));var _0x2b3d=function(_0x48ed49,_0x2ca889){_0x48ed49=_0x48ed49-0x0;var _0x859783=_0xb3d2[_0x48ed49];return _0x859783;};'use strict';var OpenchannelMessageEvents=require(_0x2b3d('0x0'));var events=[_0x2b3d('0x1'),_0x2b3d('0x2'),_0x2b3d('0x3')];function createListener(_0x36116d,_0x8763fd){return function(_0x5e1234){_0x8763fd[_0x2b3d('0x4')](_0x36116d,_0x5e1234);};}function removeListener(_0x7bf62c,_0x12797d){return function(){OpenchannelMessageEvents['removeListener'](_0x7bf62c,_0x12797d);};}exports[_0x2b3d('0x5')]=function(_0x3fe05e){for(var _0x560b8a=0x0,_0x1a1a3f=events[_0x2b3d('0x6')];_0x560b8a<_0x1a1a3f;_0x560b8a++){var _0x410e54=events[_0x560b8a];var _0x2ad7f5=createListener(_0x2b3d('0x7')+_0x410e54,_0x3fe05e);OpenchannelMessageEvents['on'](_0x410e54,_0x2ad7f5);}}; \ No newline at end of file +var _0x3a89=['save','update','removeListener','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x1c34e0,_0xc46204){var _0x23c4c2=function(_0x2643c3){while(--_0x2643c3){_0x1c34e0['push'](_0x1c34e0['shift']());}};_0x23c4c2(++_0xc46204);}(_0x3a89,0xc5));var _0x93a8=function(_0x1303aa,_0x459804){_0x1303aa=_0x1303aa-0x0;var _0x2dd944=_0x3a89[_0x1303aa];return _0x2dd944;};'use strict';var OpenchannelMessageEvents=require(_0x93a8('0x0'));var events=[_0x93a8('0x1'),'remove',_0x93a8('0x2')];function createListener(_0x3d01ea,_0x19a506){return function(_0x1ac03f){_0x19a506['emit'](_0x3d01ea,_0x1ac03f);};}function removeListener(_0x570cde,_0x5b0264){return function(){OpenchannelMessageEvents[_0x93a8('0x3')](_0x570cde,_0x5b0264);};}exports[_0x93a8('0x4')]=function(_0xefd9a9){for(var _0x108b3f=0x0,_0x1f6c88=events['length'];_0x108b3f<_0x1f6c88;_0x108b3f++){var _0x415dae=events[_0x108b3f];var _0x15dd19=createListener(_0x93a8('0x5')+_0x415dae,_0xefd9a9);OpenchannelMessageEvents['on'](_0x415dae,_0x15dd19);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index b1af329..0b5c159 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 _0x2e0a=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x462da4,_0x5832ef){var _0x3979eb=function(_0x46c60f){while(--_0x46c60f){_0x462da4['push'](_0x462da4['shift']());}};_0x3979eb(++_0x5832ef);}(_0x2e0a,0x7b));var _0xa2e0=function(_0x21e2f3,_0x1c85c4){_0x21e2f3=_0x21e2f3-0x0;var _0x5827c2=_0x2e0a[_0x21e2f3];return _0x5827c2;};'use strict';var multer=require(_0xa2e0('0x0'));var util=require(_0xa2e0('0x1'));var path=require(_0xa2e0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa2e0('0x3')]();var fs_extra=require(_0xa2e0('0x4'));var auth=require(_0xa2e0('0x5'));var interaction=require(_0xa2e0('0x6'));var config=require('../../config/environment');var controller=require(_0xa2e0('0x7'));router[_0xa2e0('0x8')]('/',auth['isAuthenticated'](),controller[_0xa2e0('0x9')]);router['get']('/describe',auth[_0xa2e0('0xa')](),controller[_0xa2e0('0xb')]);router[_0xa2e0('0x8')](_0xa2e0('0xc'),auth[_0xa2e0('0xa')](),controller[_0xa2e0('0xd')]);router[_0xa2e0('0x8')]('/:id/members',auth[_0xa2e0('0xa')](),controller['getMembers']);router[_0xa2e0('0x8')]('/:id/teams',auth[_0xa2e0('0xa')](),controller['getTeams']);router[_0xa2e0('0x8')](_0xa2e0('0xe'),auth['isAuthenticated'](),controller[_0xa2e0('0xf')]);router[_0xa2e0('0x10')]('/',auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x11')]);router[_0xa2e0('0x10')](_0xa2e0('0x12'),auth[_0xa2e0('0xa')](),controller['addTeams']);router[_0xa2e0('0x10')](_0xa2e0('0xe'),auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x13')]);router[_0xa2e0('0x14')](_0xa2e0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa2e0('0x15')](_0xa2e0('0xc'),auth[_0xa2e0('0xa')](),controller['destroy']);router[_0xa2e0('0x15')](_0xa2e0('0x12'),auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x16')]);router[_0xa2e0('0x15')]('/:id/users',auth[_0xa2e0('0xa')](),controller[_0xa2e0('0x17')]);module[_0xa2e0('0x18')]=router; \ No newline at end of file +var _0x460e=['delete','/:id','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','update'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x460e,0x16d));var _0xe460=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x460e[_0x5517c0];return _0x33803b;};'use strict';var multer=require(_0xe460('0x0'));var util=require(_0xe460('0x1'));var path=require(_0xe460('0x2'));var timeout=require(_0xe460('0x3'));var express=require(_0xe460('0x4'));var router=express[_0xe460('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe460('0x6'));var interaction=require(_0xe460('0x7'));var config=require(_0xe460('0x8'));var controller=require('./openchannelQueue.controller');router[_0xe460('0x9')]('/',auth[_0xe460('0xa')](),controller[_0xe460('0xb')]);router['get'](_0xe460('0xc'),auth[_0xe460('0xa')](),controller[_0xe460('0xd')]);router[_0xe460('0x9')]('/:id',auth[_0xe460('0xa')](),controller[_0xe460('0xe')]);router['get'](_0xe460('0xf'),auth[_0xe460('0xa')](),controller[_0xe460('0x10')]);router[_0xe460('0x9')]('/:id/teams',auth[_0xe460('0xa')](),controller[_0xe460('0x11')]);router[_0xe460('0x9')](_0xe460('0x12'),auth[_0xe460('0xa')](),controller['getAgents']);router[_0xe460('0x13')]('/',auth[_0xe460('0xa')](),controller[_0xe460('0x14')]);router['post'](_0xe460('0x15'),auth[_0xe460('0xa')](),controller[_0xe460('0x16')]);router['post'](_0xe460('0x12'),auth[_0xe460('0xa')](),controller[_0xe460('0x17')]);router['put']('/:id',auth[_0xe460('0xa')](),controller[_0xe460('0x18')]);router[_0xe460('0x19')](_0xe460('0x1a'),auth[_0xe460('0xa')](),controller[_0xe460('0x1b')]);router[_0xe460('0x19')](_0xe460('0x15'),auth[_0xe460('0xa')](),controller['removeTeams']);router[_0xe460('0x19')]('/:id/users',auth[_0xe460('0xa')](),controller[_0xe460('0x1c')]);module[_0xe460('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 724d205..d3f0184 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 _0xf846=['ENUM','beepall','name','STRING'];(function(_0x2306bc,_0x5b04bb){var _0xefab1b=function(_0x2b3556){while(--_0x2b3556){_0x2306bc['push'](_0x2306bc['shift']());}};_0xefab1b(++_0x5b04bb);}(_0xf846,0xfa));var _0x6f84=function(_0x2a7ea1,_0x4c8391){_0x2a7ea1=_0x2a7ea1-0x0;var _0x3abafd=_0xf846[_0x2a7ea1];return _0x3abafd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6f84('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f84('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6f84('0x2')]('rrmemory',_0x6f84('0x3'),'roundrobin')}}; \ No newline at end of file +var _0xa350=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x5030cb,_0x39c3d2){var _0x3fdee9=function(_0x1413a9){while(--_0x1413a9){_0x5030cb['push'](_0x5030cb['shift']());}};_0x3fdee9(++_0x39c3d2);}(_0xa350,0x1d4));var _0x0a35=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xa350[_0x616290];return _0x453879;};'use strict';var Sequelize=require(_0x0a35('0x0'));module[_0x0a35('0x1')]={'name':{'type':Sequelize[_0x0a35('0x2')],'unique':_0x0a35('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0a35('0x2')]},'timeout':{'type':Sequelize[_0x0a35('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0a35('0x5')](_0x0a35('0x6'),_0x0a35('0x7'),_0x0a35('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 8c27263..88a1e16 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 _0xe421=['updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','union','compact','value','removeAgents','omit','spread','isArray','userOpenchannelQueue:remove','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent','openchannelPause'];(function(_0x43606b,_0x2f2292){var _0xbfd21a=function(_0x2f28fa){while(--_0x2f28fa){_0x43606b['push'](_0x43606b['shift']());}};_0xbfd21a(++_0x2f2292);}(_0xe421,0x135));var _0x1e42=function(_0x279af0,_0x46274b){_0x279af0=_0x279af0-0x0;var _0x7ba67f=_0xe421[_0x279af0];return _0x7ba67f;};'use strict';var emlformat=require(_0x1e42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e42('0x1'));var moment=require(_0x1e42('0x2'));var BPromise=require(_0x1e42('0x3'));var Mustache=require(_0x1e42('0x4'));var util=require(_0x1e42('0x5'));var path=require('path');var sox=require(_0x1e42('0x6'));var csv=require(_0x1e42('0x7'));var ejs=require(_0x1e42('0x8'));var fs=require('fs');var fs_extra=require(_0x1e42('0x9'));var _=require(_0x1e42('0xa'));var squel=require(_0x1e42('0xb'));var crypto=require(_0x1e42('0xc'));var jsforce=require(_0x1e42('0xd'));var deskjs=require(_0x1e42('0xe'));var toCsv=require(_0x1e42('0x7'));var querystring=require(_0x1e42('0xf'));var Papa=require(_0x1e42('0x10'));var Redis=require(_0x1e42('0x11'));var authService=require(_0x1e42('0x12'));var qs=require(_0x1e42('0x13'));var as=require(_0x1e42('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1e42('0x15'));var config=require(_0x1e42('0x16'));var licenseUtil=require(_0x1e42('0x17'));var db=require(_0x1e42('0x18'))['db'];config[_0x1e42('0x19')]=_['defaults'](config[_0x1e42('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e42('0x1a'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x1e42('0x1b')](socket);function respondWithStatusCode(_0x4e9622,_0x2ec799){_0x2ec799=_0x2ec799||0xcc;return function(_0x3f7ec3){if(_0x3f7ec3){return _0x4e9622[_0x1e42('0x1c')](_0x2ec799);}return _0x4e9622[_0x1e42('0x1d')](_0x2ec799)['end']();};}function respondWithResult(_0x52c9dd,_0x3899d6){_0x3899d6=_0x3899d6||0xc8;return function(_0x26ed36){if(_0x26ed36){return _0x52c9dd['status'](_0x3899d6)['json'](_0x26ed36);}};}function respondWithFilteredResult(_0x270bfe,_0xf04292){return function(_0x4a4b73){if(_0x4a4b73){var _0x4bd075=typeof _0xf04292['offset']===_0x1e42('0x1e')&&typeof _0xf04292[_0x1e42('0x1f')]===_0x1e42('0x1e');var _0x3023c6=_0x4a4b73[_0x1e42('0x20')];var _0x3d68da=_0x4bd075?0x0:_0xf04292[_0x1e42('0x21')];var _0x35aa06=_0x4bd075?_0x4a4b73[_0x1e42('0x20')]:_0xf04292[_0x1e42('0x21')]+_0xf04292[_0x1e42('0x1f')];var _0x26e914;if(_0x35aa06>=_0x3023c6){_0x35aa06=_0x3023c6;_0x26e914=0xc8;}else{_0x26e914=0xce;}_0x270bfe[_0x1e42('0x1d')](_0x26e914);return _0x270bfe[_0x1e42('0x22')](_0x1e42('0x23'),_0x3d68da+'-'+_0x35aa06+'/'+_0x3023c6)[_0x1e42('0x24')](_0x4a4b73);}return null;};}function patchUpdates(_0x56c102){return function(_0x3dd4b4){try{jsonpatch[_0x1e42('0x25')](_0x3dd4b4,_0x56c102,!![]);}catch(_0x5108e7){return BPromise['reject'](_0x5108e7);}return _0x3dd4b4['save']();};}function saveUpdates(_0x23d88a,_0x5602df){return function(_0x2a2872){if(_0x2a2872){return _0x2a2872[_0x1e42('0x26')](_0x23d88a)[_0x1e42('0x27')](function(_0xa88f14){return _0xa88f14;});}return null;};}function removeEntity(_0x34f463,_0x1bb06d){return function(_0xe5c2b3){if(_0xe5c2b3){return _0xe5c2b3[_0x1e42('0x28')]()[_0x1e42('0x27')](function(){var _0x371a4a=_0xe5c2b3[_0x1e42('0x29')]({'plain':!![]});var _0x4b01bb=_0x1e42('0x2a');return db[_0x1e42('0x2b')][_0x1e42('0x28')]({'where':{'type':_0x4b01bb,'resourceId':_0x371a4a['id']}})[_0x1e42('0x27')](function(){return _0xe5c2b3;});})[_0x1e42('0x27')](function(){_0x34f463[_0x1e42('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e4848,_0x4668bb){return function(_0x372044){if(!_0x372044){_0x4e4848[_0x1e42('0x1c')](0x194);}return _0x372044;};}function handleError(_0x38df11,_0x5186f6){_0x5186f6=_0x5186f6||0x1f4;return function(_0xd6d926){logger[_0x1e42('0x2c')](_0xd6d926['stack']);if(_0xd6d926['name']){delete _0xd6d926[_0x1e42('0x2d')];}_0x38df11[_0x1e42('0x1d')](_0x5186f6)[_0x1e42('0x2e')](_0xd6d926);};}exports[_0x1e42('0x2f')]=function(_0x2cd380,_0x475c1d){var _0x250b77={},_0x4c5518={},_0x58741d={'count':0x0,'rows':[]};var _0x577820=_[_0x1e42('0x30')](db[_0x1e42('0x31')][_0x1e42('0x32')],function(_0xd1367b){return{'name':_0xd1367b['fieldName'],'type':_0xd1367b[_0x1e42('0x33')]['key']};});_0x4c5518[_0x1e42('0x34')]=_[_0x1e42('0x30')](_0x577820,_0x1e42('0x2d'));_0x4c5518[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x2cd380['query']);_0x4c5518['filters']=_[_0x1e42('0x37')](_0x4c5518[_0x1e42('0x34')],_0x4c5518['query']);_0x250b77[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x4c5518['model'],qs['fields'](_0x2cd380['query'][_0x1e42('0x39')]));_0x250b77[_0x1e42('0x38')]=_0x250b77['attributes'][_0x1e42('0x3a')]?_0x250b77[_0x1e42('0x38')]:_0x4c5518[_0x1e42('0x34')];if(!_0x2cd380[_0x1e42('0x35')][_0x1e42('0x3b')](_0x1e42('0x3c'))){_0x250b77[_0x1e42('0x1f')]=qs[_0x1e42('0x1f')](_0x2cd380[_0x1e42('0x35')][_0x1e42('0x1f')]);_0x250b77['offset']=qs['offset'](_0x2cd380['query']['offset']);}_0x250b77[_0x1e42('0x3d')]=qs[_0x1e42('0x3e')](_0x2cd380[_0x1e42('0x35')][_0x1e42('0x3e')]);_0x250b77[_0x1e42('0x3f')]=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x2cd380[_0x1e42('0x35')],_0x4c5518[_0x1e42('0x40')]),_0x577820);if(_0x2cd380[_0x1e42('0x35')][_0x1e42('0x42')]){_0x250b77[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x250b77[_0x1e42('0x3f')],{'$or':_['map'](_0x577820,function(_0xf1b757){if(_0xf1b757[_0x1e42('0x33')]!=='VIRTUAL'){var _0x17bb60={};_0x17bb60[_0xf1b757[_0x1e42('0x2d')]]={'$like':'%'+_0x2cd380[_0x1e42('0x35')][_0x1e42('0x42')]+'%'};return _0x17bb60;}})});}_0x250b77=_[_0x1e42('0x43')]({},_0x250b77,_0x2cd380[_0x1e42('0x44')]);var _0x228e50={'where':_0x250b77[_0x1e42('0x3f')]};return db[_0x1e42('0x31')]['count'](_0x228e50)['then'](function(_0x4db7b6){_0x58741d[_0x1e42('0x20')]=_0x4db7b6;if(_0x2cd380[_0x1e42('0x35')][_0x1e42('0x45')]){_0x250b77[_0x1e42('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x1e42('0x47')](_0x250b77);})[_0x1e42('0x27')](function(_0x1f3b96){_0x58741d[_0x1e42('0x48')]=_0x1f3b96;return _0x58741d;})['then'](respondWithFilteredResult(_0x475c1d,_0x250b77))[_0x1e42('0x49')](handleError(_0x475c1d,null));};exports[_0x1e42('0x4a')]=function(_0x39ae26,_0x3ddb5d){var _0x4e440f={'raw':!![],'where':{'id':_0x39ae26[_0x1e42('0x4b')]['id']}},_0x163c39={};_0x163c39[_0x1e42('0x34')]=_[_0x1e42('0x36')](db[_0x1e42('0x31')][_0x1e42('0x32')]);_0x163c39[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x39ae26['query']);_0x163c39[_0x1e42('0x40')]=_[_0x1e42('0x37')](_0x163c39[_0x1e42('0x34')],_0x163c39[_0x1e42('0x35')]);_0x4e440f[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x163c39[_0x1e42('0x34')],qs['fields'](_0x39ae26[_0x1e42('0x35')][_0x1e42('0x39')]));_0x4e440f[_0x1e42('0x38')]=_0x4e440f[_0x1e42('0x38')][_0x1e42('0x3a')]?_0x4e440f[_0x1e42('0x38')]:_0x163c39[_0x1e42('0x34')];if(_0x39ae26[_0x1e42('0x35')][_0x1e42('0x45')]){_0x4e440f[_0x1e42('0x46')]=[{'all':!![]}];}_0x4e440f=_[_0x1e42('0x43')]({},_0x4e440f,_0x39ae26['options']);return db[_0x1e42('0x31')][_0x1e42('0x4c')](_0x4e440f)[_0x1e42('0x27')](handleEntityNotFound(_0x3ddb5d,null))[_0x1e42('0x27')](respondWithResult(_0x3ddb5d,null))[_0x1e42('0x49')](handleError(_0x3ddb5d,null));};exports[_0x1e42('0x4d')]=function(_0x2aea5a,_0x62b90d){return db[_0x1e42('0x31')][_0x1e42('0x4d')](_0x2aea5a[_0x1e42('0x4e')],{})[_0x1e42('0x27')](function(_0xe0bdda){var _0xd676e9=_0x2aea5a['user'][_0x1e42('0x29')]({'plain':!![]});if(!_0xd676e9)throw new Error(_0x1e42('0x4f'));if(_0xd676e9[_0x1e42('0x50')]===_0x1e42('0x51')){var _0x5f1434=_0xe0bdda[_0x1e42('0x29')]({'plain':!![]});var _0x2b578c=_0x1e42('0x2a');return db[_0x1e42('0x52')][_0x1e42('0x4c')]({'where':{'name':_0x2b578c,'userProfileId':_0xd676e9['userProfileId']},'raw':!![]})[_0x1e42('0x27')](function(_0x2e8ff3){if(_0x2e8ff3&&_0x2e8ff3[_0x1e42('0x53')]===0x0){return db[_0x1e42('0x2b')]['create']({'name':_0x5f1434[_0x1e42('0x2d')],'resourceId':_0x5f1434['id'],'type':_0x2e8ff3[_0x1e42('0x2d')],'sectionId':_0x2e8ff3['id']},{})[_0x1e42('0x27')](function(){return _0xe0bdda;});}else{return _0xe0bdda;}})['catch'](function(_0xeb79bc){logger['error'](_0x1e42('0x54'),_0xeb79bc);throw _0xeb79bc;});}return _0xe0bdda;})['then'](respondWithResult(_0x62b90d,0xc9))['catch'](handleError(_0x62b90d,null));};exports[_0x1e42('0x26')]=function(_0x34a3c5,_0x2b3a4a){if(_0x34a3c5[_0x1e42('0x4e')]['id']){delete _0x34a3c5['body']['id'];}return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x34a3c5[_0x1e42('0x4b')]['id']}})[_0x1e42('0x27')](handleEntityNotFound(_0x2b3a4a,null))[_0x1e42('0x27')](saveUpdates(_0x34a3c5['body'],null))[_0x1e42('0x27')](respondWithResult(_0x2b3a4a,null))[_0x1e42('0x49')](handleError(_0x2b3a4a,null));};exports[_0x1e42('0x28')]=function(_0x233ae5,_0x5bb5cc){return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x233ae5[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bb5cc,null))[_0x1e42('0x27')](removeEntity(_0x5bb5cc,null))[_0x1e42('0x49')](handleError(_0x5bb5cc,null));};exports[_0x1e42('0x55')]=function(_0xfa7aa7,_0x106ba2){return db[_0x1e42('0x31')][_0x1e42('0x55')]()[_0x1e42('0x27')](respondWithResult(_0x106ba2,null))['catch'](handleError(_0x106ba2,null));};exports['getMembers']=function(_0x30aca7,_0x77c63a,_0x18cdbd){var _0x4e3361={'raw':!![],'where':{}},_0x93bcd8={},_0x242393;return db['OpenchannelQueue'][_0x1e42('0x56')]({'where':{'id':_0x30aca7['params']['id']}})[_0x1e42('0x27')](handleEntityNotFound(_0x77c63a,null))['then'](function(_0x35650){if(_0x35650){_0x242393=_0x35650[_0x1e42('0x29')]({'plain':!![]});_0x93bcd8['model']=_['keys'](db[_0x1e42('0x57')][_0x1e42('0x32')]);_0x93bcd8[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x30aca7['query']);_0x93bcd8['filters']=_[_0x1e42('0x37')](_0x93bcd8[_0x1e42('0x34')],_0x93bcd8[_0x1e42('0x35')]);_0x4e3361[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x93bcd8[_0x1e42('0x34')],qs['fields'](_0x30aca7[_0x1e42('0x35')][_0x1e42('0x39')]));_0x4e3361['attributes']=_0x4e3361[_0x1e42('0x38')]['length']?_0x4e3361['attributes']:_0x93bcd8[_0x1e42('0x34')];if(!_0x30aca7[_0x1e42('0x35')][_0x1e42('0x3b')](_0x1e42('0x3c'))){_0x4e3361['limit']=qs[_0x1e42('0x1f')](_0x30aca7[_0x1e42('0x35')]['limit']);_0x4e3361[_0x1e42('0x21')]=qs[_0x1e42('0x21')](_0x30aca7[_0x1e42('0x35')]['offset']);}_0x4e3361['order']=qs[_0x1e42('0x3e')](_0x30aca7[_0x1e42('0x35')][_0x1e42('0x3e')]);_0x4e3361[_0x1e42('0x3f')]=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x30aca7[_0x1e42('0x35')],_0x93bcd8['filters']));_0x4e3361[_0x1e42('0x3f')][_0x1e42('0x58')]=_0x35650['id'];if(_0x30aca7[_0x1e42('0x35')][_0x1e42('0x42')]){_0x4e3361[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x4e3361[_0x1e42('0x3f')],{'$or':_['map'](_0x4e3361['attributes'],function(_0x124f1c){var _0x568133={};_0x568133[_0x124f1c]={'$like':'%'+_0x30aca7[_0x1e42('0x35')][_0x1e42('0x42')]+'%'};return _0x568133;})});}_0x4e3361=_[_0x1e42('0x43')]({},_0x4e3361,_0x30aca7[_0x1e42('0x44')]);return db[_0x1e42('0x57')][_0x1e42('0x47')](_0x4e3361);}})[_0x1e42('0x27')](function(_0x655982){if(_0x655982){return db[_0x1e42('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x655982,_0x1e42('0x5a')),'role':_0x1e42('0x5b')},'attributes':['id',_0x1e42('0x2d'),_0x1e42('0x5c'),_0x1e42('0x5d'),'createdAt']});}})[_0x1e42('0x27')](function(_0x49eb13){if(_0x49eb13){return{'count':_0x49eb13[_0x1e42('0x20')],'rows':_['map'](_0x49eb13[_0x1e42('0x48')],function(_0x4d1c5c){return{'membername':_0x4d1c5c[_0x1e42('0x2d')],'UserId':_0x4d1c5c['id'],'queue_name':_0x242393[_0x1e42('0x2d')],'OpenchannelQueueId':_0x242393['id'],'interface':util[_0x1e42('0x5e')](_0x1e42('0x5f'),_0x1e42('0x60'),_0x4d1c5c[_0x1e42('0x2d')]),'penalty':0x0,'paused':_0x4d1c5c['openchannelPause'],'createdAt':_0x4d1c5c[_0x1e42('0x61')],'updatedAt':_0x4d1c5c[_0x1e42('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1e42('0x27')](respondWithFilteredResult(_0x77c63a,_0x4e3361))[_0x1e42('0x49')](handleError(_0x77c63a,null));};exports[_0x1e42('0x62')]=function(_0x49a2fd,_0x149a77,_0x4395e4){var _0x1a707e={};var _0x2b9eec={};var _0x4c55d5;var _0x1d8fcb;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x49a2fd[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x149a77,null))['then'](function(_0x48b567){if(_0x48b567){_0x4c55d5=_0x48b567;_0x2b9eec[_0x1e42('0x34')]=_[_0x1e42('0x36')](db[_0x1e42('0x63')][_0x1e42('0x32')]);_0x2b9eec[_0x1e42('0x35')]=_['keys'](_0x49a2fd['query']);_0x2b9eec['filters']=_[_0x1e42('0x37')](_0x2b9eec['model'],_0x2b9eec[_0x1e42('0x35')]);_0x1a707e[_0x1e42('0x38')]=_['intersection'](_0x2b9eec[_0x1e42('0x34')],qs[_0x1e42('0x39')](_0x49a2fd[_0x1e42('0x35')][_0x1e42('0x39')]));_0x1a707e[_0x1e42('0x38')]=_0x1a707e['attributes'][_0x1e42('0x3a')]?_0x1a707e[_0x1e42('0x38')]:_0x2b9eec[_0x1e42('0x34')];_0x1a707e[_0x1e42('0x3d')]=qs[_0x1e42('0x3e')](_0x49a2fd['query'][_0x1e42('0x3e')]);_0x1a707e['where']=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x49a2fd[_0x1e42('0x35')],_0x2b9eec[_0x1e42('0x40')]));if(_0x49a2fd[_0x1e42('0x35')]['filter']){_0x1a707e[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x1a707e[_0x1e42('0x3f')],{'$or':_[_0x1e42('0x30')](_0x1a707e['attributes'],function(_0x1f5c55){var _0x3f0775={};_0x3f0775[_0x1f5c55]={'$like':'%'+_0x49a2fd[_0x1e42('0x35')]['filter']+'%'};return _0x3f0775;})});}_0x1a707e=_[_0x1e42('0x43')]({},_0x1a707e,_0x49a2fd[_0x1e42('0x44')]);return _0x4c55d5[_0x1e42('0x62')](_0x1a707e);}})['then'](function(_0x16f8f8){if(_0x16f8f8){_0x1d8fcb=_0x16f8f8[_0x1e42('0x3a')];if(!_0x49a2fd[_0x1e42('0x35')]['hasOwnProperty'](_0x1e42('0x3c'))){_0x1a707e[_0x1e42('0x1f')]=qs[_0x1e42('0x1f')](_0x49a2fd['query'][_0x1e42('0x1f')]);_0x1a707e[_0x1e42('0x21')]=qs[_0x1e42('0x21')](_0x49a2fd[_0x1e42('0x35')]['offset']);}return _0x4c55d5['getTeams'](_0x1a707e);}})['then'](function(_0x5d10c2){if(_0x5d10c2){return _0x5d10c2?{'count':_0x1d8fcb,'rows':_0x5d10c2}:null;}})[_0x1e42('0x27')](respondWithResult(_0x149a77,null))[_0x1e42('0x49')](handleError(_0x149a77,null));};exports[_0x1e42('0x64')]=function(_0x3eba74,_0x20ae7f,_0x406ad7){var _0x20833d=_0x3eba74['body'][_0x1e42('0x65')];return db['Team'][_0x1e42('0x47')]({'where':{'id':_0x20833d},'attributes':['id'],'include':[{'model':db[_0x1e42('0x59')],'as':_0x1e42('0x66'),'attributes':['id',_0x1e42('0x2d'),'online',_0x1e42('0x67'),_0x1e42('0x68')],'raw':!![]}]})[_0x1e42('0x27')](function(_0x21c452){if(_0x21c452){var _0x371be7=_[_0x1e42('0x69')](_0x21c452,function(_0x51a9a7){var _0x33296f=_0x51a9a7[_0x1e42('0x29')]({'plain':!![]});return _0x33296f[_0x1e42('0x66')];});return db[_0x1e42('0x31')]['find']({'where':{'id':_0x3eba74[_0x1e42('0x4b')]['id']}})[_0x1e42('0x27')](function(_0x59ac83){return db['sequelize']['transaction'](function(_0x526870){return _0x59ac83[_0x1e42('0x64')](_0x20833d,{'transaction':_0x526870})[_0x1e42('0x27')](function(){return BPromise[_0x1e42('0x6a')](_0x371be7,function(_0x3d2f47){return db[_0x1e42('0x57')][_0x1e42('0x6b')]({'where':{'UserId':_0x3d2f47['id'],'OpenchannelQueueId':_0x3eba74['params']['id']},'transaction':_0x526870});});})[_0x1e42('0x27')](function(){_0x371be7[_0x1e42('0x6c')](function(_0x720d4e){socket[_0x1e42('0x6d')](_0x1e42('0x6e'),{'UserId':_0x720d4e['id'],'OpenchannelQueueId':_0x59ac83['id']});});});});});}})[_0x1e42('0x27')](respondWithStatusCode(_0x20ae7f,null))['catch'](handleError(_0x20ae7f,null));};exports[_0x1e42('0x6f')]=function(_0x1321d6,_0x2d95e6,_0x1102d2){return db['Team'][_0x1e42('0x47')]({'where':{'id':_0x1321d6[_0x1e42('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1e42('0x59')],'as':_0x1e42('0x66'),'attributes':['id'],'raw':!![]}]})[_0x1e42('0x27')](handleEntityNotFound(_0x2d95e6,null))[_0x1e42('0x27')](function(_0x48abc7){var _0x3aa094=_[_0x1e42('0x30')](_0x48abc7,'id');var _0x1588a3=[];var _0x21664d=[];var _0x5b4919=squel[_0x1e42('0x70')]();_0x5b4919['field'](_0x1e42('0x71'))['from'](_0x1e42('0x72'),'tq')[_0x1e42('0x73')](_0x1e42('0x74'),'ut',_0x1e42('0x75'))[_0x1e42('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x1321d6[_0x1e42('0x4b')]['id']);for(var _0x4cf373=0x0;_0x4cf373<_0x48abc7[_0x1e42('0x3a')];_0x4cf373+=0x1){let _0x2bf8ad=_0x48abc7[_0x4cf373];for(var _0x4acb15=0x0;_0x4acb15<_0x2bf8ad['Agents'][_0x1e42('0x3a')];_0x4acb15+=0x1){let _0x321ae0=_0x2bf8ad[_0x1e42('0x66')][_0x4acb15];var _0x44dc77=_0x5b4919[_0x1e42('0x76')]();_0x44dc77[_0x1e42('0x3f')]('ut.UserId\x20=\x20?',_0x321ae0['id']);_0x21664d[_0x1e42('0x77')](db[_0x1e42('0x78')]['query'](_0x44dc77[_0x1e42('0x79')](),{'type':db[_0x1e42('0x78')][_0x1e42('0x7a')]['SELECT']})[_0x1e42('0x27')](function(_0x1d5747){if(_0x1d5747['length']===0x1){return _0x321ae0['id'];}else{var _0x38c2ea=_[_0x1e42('0x7b')](_['map'](_0x1d5747,_0x1e42('0x7c')),function(_0xa5e7f2){return _[_0x1e42('0x7d')](_0x3aa094,_0xa5e7f2);});if(_0x38c2ea){return _0x321ae0['id'];}}}));}}return BPromise['all'](_0x21664d)[_0x1e42('0x27')](function(_0xed91fd){_0x1588a3=_(_0x1588a3)[_0x1e42('0x7e')](_0xed91fd)[_0x1e42('0x7f')]()[_0x1e42('0x80')]();return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x1321d6[_0x1e42('0x4b')]['id']}})['then'](function(_0x4ab047){return db[_0x1e42('0x78')]['transaction'](function(_0x963173){return _0x4ab047['removeTeams'](_0x1321d6['query'][_0x1e42('0x65')],{'transaction':_0x963173})[_0x1e42('0x27')](function(){if(!_['isEmpty'](_0x1588a3)){return _0x4ab047[_0x1e42('0x81')](_0x1588a3,{'transaction':_0x963173});}})[_0x1e42('0x27')](function(){_0x1588a3[_0x1e42('0x6c')](function(_0x458a69){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x458a69,'OpenchannelQueueId':_0x4ab047['id']});});});});});});})[_0x1e42('0x27')](respondWithStatusCode(_0x2d95e6,null))[_0x1e42('0x49')](handleError(_0x2d95e6,null));};exports['addAgents']=function(_0x521f65,_0x17fd2d,_0x1aeb56){return db['OpenchannelQueue'][_0x1e42('0x4c')]({'where':{'id':_0x521f65[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17fd2d,null))['then'](function(_0x32232d){if(_0x32232d){return _0x32232d['addAgents'](_0x521f65[_0x1e42('0x4e')]['ids'],_[_0x1e42('0x82')](_0x521f65[_0x1e42('0x4e')],[_0x1e42('0x65'),'id'])||{})[_0x1e42('0x83')](function(_0x574de0){for(var _0x1aa649=0x0;_0x1aa649<_0x521f65[_0x1e42('0x4e')]['ids'][_0x1e42('0x3a')];_0x1aa649+=0x1){socket[_0x1e42('0x6d')](_0x1e42('0x6e'),{'UserId':Number(_0x521f65[_0x1e42('0x4e')][_0x1e42('0x65')][_0x1aa649]),'OpenchannelQueueId':Number(_0x521f65[_0x1e42('0x4b')]['id'])});}return _0x574de0;});}})[_0x1e42('0x27')](respondWithResult(_0x17fd2d,null))['catch'](handleError(_0x17fd2d,null));};exports[_0x1e42('0x81')]=function(_0x30967b,_0x2cd3ba,_0x12db84){return db[_0x1e42('0x31')][_0x1e42('0x4c')]({'where':{'id':_0x30967b['params']['id']}})[_0x1e42('0x27')](handleEntityNotFound(_0x2cd3ba,null))[_0x1e42('0x27')](function(_0x9a1c09){if(_0x9a1c09){return _0x9a1c09[_0x1e42('0x81')](_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')])[_0x1e42('0x27')](function(){if(_[_0x1e42('0x84')](_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')])){for(var _0x3780a2=0x0;_0x3780a2<_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')][_0x1e42('0x3a')];_0x3780a2+=0x1){socket['emit'](_0x1e42('0x85'),{'UserId':Number(_0x30967b[_0x1e42('0x35')][_0x1e42('0x65')][_0x3780a2]),'OpenchannelQueueId':Number(_0x30967b[_0x1e42('0x4b')]['id'])});}}else{socket[_0x1e42('0x6d')](_0x1e42('0x85'),{'UserId':Number(_0x30967b['query']['ids']),'OpenchannelQueueId':Number(_0x30967b['params']['id'])});}});}})[_0x1e42('0x27')](respondWithStatusCode(_0x2cd3ba,null))[_0x1e42('0x49')](handleError(_0x2cd3ba,null));};exports['getAgents']=function(_0x37f003,_0x4358f2,_0x59f49a){var _0x4fb251={};var _0x247b57={};var _0x213cd6;var _0x3712b3;return db['OpenchannelQueue'][_0x1e42('0x56')]({'where':{'id':_0x37f003[_0x1e42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4358f2,null))[_0x1e42('0x27')](function(_0x56f5ac){if(_0x56f5ac){_0x213cd6=_0x56f5ac;_0x247b57[_0x1e42('0x34')]=_[_0x1e42('0x36')](db[_0x1e42('0x59')][_0x1e42('0x32')]);_0x247b57[_0x1e42('0x35')]=_[_0x1e42('0x36')](_0x37f003[_0x1e42('0x35')]);_0x247b57[_0x1e42('0x40')]=_[_0x1e42('0x37')](_0x247b57[_0x1e42('0x34')],_0x247b57[_0x1e42('0x35')]);_0x4fb251[_0x1e42('0x38')]=_[_0x1e42('0x37')](_0x247b57[_0x1e42('0x34')],qs['fields'](_0x37f003['query'][_0x1e42('0x39')]));_0x4fb251[_0x1e42('0x38')]=_0x4fb251[_0x1e42('0x38')][_0x1e42('0x3a')]?_0x4fb251[_0x1e42('0x38')]:_0x247b57['model'];_0x4fb251[_0x1e42('0x3d')]=qs[_0x1e42('0x3e')](_0x37f003[_0x1e42('0x35')]['sort']);_0x4fb251[_0x1e42('0x3f')]=qs[_0x1e42('0x40')](_[_0x1e42('0x41')](_0x37f003[_0x1e42('0x35')],_0x247b57['filters']));if(_0x37f003[_0x1e42('0x35')]['filter']){_0x4fb251[_0x1e42('0x3f')]=_[_0x1e42('0x43')](_0x4fb251[_0x1e42('0x3f')],{'$or':_['map'](_0x4fb251[_0x1e42('0x38')],function(_0x2f54e7){var _0x4631e6={};_0x4631e6[_0x2f54e7]={'$like':'%'+_0x37f003[_0x1e42('0x35')]['filter']+'%'};return _0x4631e6;})});}_0x4fb251=_[_0x1e42('0x43')]({},_0x4fb251,_0x37f003[_0x1e42('0x44')]);return _0x213cd6['getAgents'](_0x4fb251);}})[_0x1e42('0x27')](function(_0x12b254){if(_0x12b254){_0x3712b3=_0x12b254[_0x1e42('0x3a')];if(!_0x37f003['query'][_0x1e42('0x3b')]('nolimit')){_0x4fb251['limit']=qs['limit'](_0x37f003[_0x1e42('0x35')][_0x1e42('0x1f')]);_0x4fb251[_0x1e42('0x21')]=qs[_0x1e42('0x21')](_0x37f003['query']['offset']);}return _0x213cd6['getAgents'](_0x4fb251);}})[_0x1e42('0x27')](function(_0x4185ff){if(_0x4185ff){return _0x4185ff?{'count':_0x3712b3,'rows':_0x4185ff}:null;}})[_0x1e42('0x27')](respondWithResult(_0x4358f2,null))['catch'](handleError(_0x4358f2,null));}; \ No newline at end of file +var _0xf336=['isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','createdAt','format','%s/%s','SIP','openchannelPause','updatedAt','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','includes','union','value','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x177f5d,_0x34bb9e){var _0x465e9b=function(_0x5e31c0){while(--_0x5e31c0){_0x177f5d['push'](_0x177f5d['shift']());}};_0x465e9b(++_0x34bb9e);}(_0xf336,0x8c));var _0x6f33=function(_0x12f3c3,_0x1963ed){_0x12f3c3=_0x12f3c3-0x0;var _0x198071=_0xf336[_0x12f3c3];return _0x198071;};'use strict';var emlformat=require(_0x6f33('0x0'));var rimraf=require(_0x6f33('0x1'));var zipdir=require(_0x6f33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f33('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f33('0x4'));var path=require(_0x6f33('0x5'));var sox=require(_0x6f33('0x6'));var csv=require(_0x6f33('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f33('0x8'));var _=require('lodash');var squel=require(_0x6f33('0x9'));var crypto=require(_0x6f33('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f33('0x7'));var querystring=require(_0x6f33('0xb'));var Papa=require(_0x6f33('0xc'));var Redis=require('ioredis');var authService=require(_0x6f33('0xd'));var qs=require(_0x6f33('0xe'));var as=require(_0x6f33('0xf'));var hardwareService=require(_0x6f33('0x10'));var logger=require('../../config/logger')(_0x6f33('0x11'));var utils=require('../../config/utils');var config=require(_0x6f33('0x12'));var licenseUtil=require(_0x6f33('0x13'));var db=require(_0x6f33('0x14'))['db'];config[_0x6f33('0x15')]=_[_0x6f33('0x16')](config[_0x6f33('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f33('0x17'))(new Redis(config[_0x6f33('0x15')]));require(_0x6f33('0x18'))[_0x6f33('0x19')](socket);function respondWithStatusCode(_0x5265fe,_0x55ff45){_0x55ff45=_0x55ff45||0xcc;return function(_0x5dfa44){if(_0x5dfa44){return _0x5265fe[_0x6f33('0x1a')](_0x55ff45);}return _0x5265fe['status'](_0x55ff45)[_0x6f33('0x1b')]();};}function respondWithResult(_0x573818,_0x45020e){_0x45020e=_0x45020e||0xc8;return function(_0x5d3c33){if(_0x5d3c33){return _0x573818[_0x6f33('0x1c')](_0x45020e)['json'](_0x5d3c33);}};}function respondWithFilteredResult(_0x5ebe84,_0x3ddd6c){return function(_0x4b0e54){if(_0x4b0e54){var _0x56030e=typeof _0x3ddd6c[_0x6f33('0x1d')]===_0x6f33('0x1e')&&typeof _0x3ddd6c[_0x6f33('0x1f')]===_0x6f33('0x1e');var _0x5f04be=_0x4b0e54[_0x6f33('0x20')];var _0x32ede9=_0x56030e?0x0:_0x3ddd6c[_0x6f33('0x1d')];var _0x4982f2=_0x56030e?_0x4b0e54[_0x6f33('0x20')]:_0x3ddd6c[_0x6f33('0x1d')]+_0x3ddd6c[_0x6f33('0x1f')];var _0x22b975;if(_0x4982f2>=_0x5f04be){_0x4982f2=_0x5f04be;_0x22b975=0xc8;}else{_0x22b975=0xce;}_0x5ebe84[_0x6f33('0x1c')](_0x22b975);return _0x5ebe84[_0x6f33('0x21')](_0x6f33('0x22'),_0x32ede9+'-'+_0x4982f2+'/'+_0x5f04be)[_0x6f33('0x23')](_0x4b0e54);}return null;};}function patchUpdates(_0xcd707a){return function(_0x4c2b6f){try{jsonpatch[_0x6f33('0x24')](_0x4c2b6f,_0xcd707a,!![]);}catch(_0x520c75){return BPromise['reject'](_0x520c75);}return _0x4c2b6f['save']();};}function saveUpdates(_0x17f39e,_0x314cb4){return function(_0x11050c){if(_0x11050c){return _0x11050c[_0x6f33('0x25')](_0x17f39e)[_0x6f33('0x26')](function(_0x4011f0){return _0x4011f0;});}return null;};}function removeEntity(_0x311f31,_0xfc2c4c){return function(_0x3c908b){if(_0x3c908b){return _0x3c908b[_0x6f33('0x27')]()[_0x6f33('0x26')](function(){var _0x3f25df=_0x3c908b[_0x6f33('0x28')]({'plain':!![]});var _0xefe9d9='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xefe9d9,'resourceId':_0x3f25df['id']}})[_0x6f33('0x26')](function(){return _0x3c908b;});})[_0x6f33('0x26')](function(){_0x311f31[_0x6f33('0x1c')](0xcc)[_0x6f33('0x1b')]();});}};}function handleEntityNotFound(_0x4c22dd,_0x191d06){return function(_0x187c04){if(!_0x187c04){_0x4c22dd['sendStatus'](0x194);}return _0x187c04;};}function handleError(_0x5d22b0,_0x48846f){_0x48846f=_0x48846f||0x1f4;return function(_0x467415){logger[_0x6f33('0x29')](_0x467415[_0x6f33('0x2a')]);if(_0x467415[_0x6f33('0x2b')]){delete _0x467415['name'];}_0x5d22b0[_0x6f33('0x1c')](_0x48846f)[_0x6f33('0x2c')](_0x467415);};}exports[_0x6f33('0x2d')]=function(_0x3256e6,_0xf3875d){var _0x4bc0e5={},_0x53cf35={},_0x2caf81={'count':0x0,'rows':[]};var _0x3c29ba=_[_0x6f33('0x2e')](db[_0x6f33('0x2f')][_0x6f33('0x30')],function(_0x5d81e4){return{'name':_0x5d81e4[_0x6f33('0x31')],'type':_0x5d81e4[_0x6f33('0x32')][_0x6f33('0x33')]};});_0x53cf35[_0x6f33('0x34')]=_[_0x6f33('0x2e')](_0x3c29ba,_0x6f33('0x2b'));_0x53cf35[_0x6f33('0x35')]=_[_0x6f33('0x36')](_0x3256e6[_0x6f33('0x35')]);_0x53cf35[_0x6f33('0x37')]=_[_0x6f33('0x38')](_0x53cf35['model'],_0x53cf35[_0x6f33('0x35')]);_0x4bc0e5[_0x6f33('0x39')]=_['intersection'](_0x53cf35[_0x6f33('0x34')],qs[_0x6f33('0x3a')](_0x3256e6[_0x6f33('0x35')][_0x6f33('0x3a')]));_0x4bc0e5[_0x6f33('0x39')]=_0x4bc0e5[_0x6f33('0x39')][_0x6f33('0x3b')]?_0x4bc0e5[_0x6f33('0x39')]:_0x53cf35[_0x6f33('0x34')];if(!_0x3256e6[_0x6f33('0x35')][_0x6f33('0x3c')](_0x6f33('0x3d'))){_0x4bc0e5[_0x6f33('0x1f')]=qs[_0x6f33('0x1f')](_0x3256e6[_0x6f33('0x35')]['limit']);_0x4bc0e5[_0x6f33('0x1d')]=qs[_0x6f33('0x1d')](_0x3256e6[_0x6f33('0x35')]['offset']);}_0x4bc0e5[_0x6f33('0x3e')]=qs[_0x6f33('0x3f')](_0x3256e6['query'][_0x6f33('0x3f')]);_0x4bc0e5[_0x6f33('0x40')]=qs[_0x6f33('0x37')](_[_0x6f33('0x41')](_0x3256e6[_0x6f33('0x35')],_0x53cf35[_0x6f33('0x37')]),_0x3c29ba);if(_0x3256e6['query'][_0x6f33('0x42')]){_0x4bc0e5[_0x6f33('0x40')]=_['merge'](_0x4bc0e5[_0x6f33('0x40')],{'$or':_['map'](_0x3c29ba,function(_0x4c6762){if(_0x4c6762['type']!==_0x6f33('0x43')){var _0x23f287={};_0x23f287[_0x4c6762[_0x6f33('0x2b')]]={'$like':'%'+_0x3256e6[_0x6f33('0x35')][_0x6f33('0x42')]+'%'};return _0x23f287;}})});}_0x4bc0e5=_[_0x6f33('0x44')]({},_0x4bc0e5,_0x3256e6[_0x6f33('0x45')]);var _0x795089={'where':_0x4bc0e5['where']};return db['OpenchannelQueue'][_0x6f33('0x20')](_0x795089)[_0x6f33('0x26')](function(_0x3b79aa){_0x2caf81[_0x6f33('0x20')]=_0x3b79aa;if(_0x3256e6[_0x6f33('0x35')][_0x6f33('0x46')]){_0x4bc0e5['include']=[{'all':!![]}];}return db[_0x6f33('0x2f')][_0x6f33('0x47')](_0x4bc0e5);})[_0x6f33('0x26')](function(_0x1786d6){_0x2caf81[_0x6f33('0x48')]=_0x1786d6;return _0x2caf81;})[_0x6f33('0x26')](respondWithFilteredResult(_0xf3875d,_0x4bc0e5))[_0x6f33('0x49')](handleError(_0xf3875d,null));};exports[_0x6f33('0x4a')]=function(_0x9ce0e2,_0x1efffe){var _0x1f37ae={'raw':!![],'where':{'id':_0x9ce0e2['params']['id']}},_0x47b158={};_0x47b158['model']=_['keys'](db[_0x6f33('0x2f')][_0x6f33('0x30')]);_0x47b158[_0x6f33('0x35')]=_[_0x6f33('0x36')](_0x9ce0e2[_0x6f33('0x35')]);_0x47b158[_0x6f33('0x37')]=_[_0x6f33('0x38')](_0x47b158['model'],_0x47b158[_0x6f33('0x35')]);_0x1f37ae[_0x6f33('0x39')]=_[_0x6f33('0x38')](_0x47b158[_0x6f33('0x34')],qs['fields'](_0x9ce0e2[_0x6f33('0x35')][_0x6f33('0x3a')]));_0x1f37ae[_0x6f33('0x39')]=_0x1f37ae[_0x6f33('0x39')]['length']?_0x1f37ae['attributes']:_0x47b158[_0x6f33('0x34')];if(_0x9ce0e2[_0x6f33('0x35')][_0x6f33('0x46')]){_0x1f37ae[_0x6f33('0x4b')]=[{'all':!![]}];}_0x1f37ae=_[_0x6f33('0x44')]({},_0x1f37ae,_0x9ce0e2[_0x6f33('0x45')]);return db['OpenchannelQueue'][_0x6f33('0x4c')](_0x1f37ae)[_0x6f33('0x26')](handleEntityNotFound(_0x1efffe,null))[_0x6f33('0x26')](respondWithResult(_0x1efffe,null))[_0x6f33('0x49')](handleError(_0x1efffe,null));};exports[_0x6f33('0x4d')]=function(_0x4f217d,_0x2a7e35){return db[_0x6f33('0x2f')][_0x6f33('0x4d')](_0x4f217d[_0x6f33('0x4e')],{})[_0x6f33('0x26')](function(_0x42f4b8){var _0x48514b=_0x4f217d['user']['get']({'plain':!![]});if(!_0x48514b)throw new Error(_0x6f33('0x4f'));if(_0x48514b[_0x6f33('0x50')]==='user'){var _0x404450=_0x42f4b8[_0x6f33('0x28')]({'plain':!![]});var _0xe66496=_0x6f33('0x51');return db[_0x6f33('0x52')][_0x6f33('0x4c')]({'where':{'name':_0xe66496,'userProfileId':_0x48514b['userProfileId']},'raw':!![]})['then'](function(_0x43dda7){if(_0x43dda7&&_0x43dda7['autoAssociation']===0x0){return db[_0x6f33('0x53')][_0x6f33('0x4d')]({'name':_0x404450[_0x6f33('0x2b')],'resourceId':_0x404450['id'],'type':_0x43dda7[_0x6f33('0x2b')],'sectionId':_0x43dda7['id']},{})[_0x6f33('0x26')](function(){return _0x42f4b8;});}else{return _0x42f4b8;}})[_0x6f33('0x49')](function(_0x328652){logger[_0x6f33('0x29')](_0x6f33('0x54'),_0x328652);throw _0x328652;});}return _0x42f4b8;})[_0x6f33('0x26')](respondWithResult(_0x2a7e35,0xc9))['catch'](handleError(_0x2a7e35,null));};exports['update']=function(_0x52b6bd,_0x1f069f){if(_0x52b6bd[_0x6f33('0x4e')]['id']){delete _0x52b6bd[_0x6f33('0x4e')]['id'];}return db[_0x6f33('0x2f')][_0x6f33('0x4c')]({'where':{'id':_0x52b6bd[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](handleEntityNotFound(_0x1f069f,null))[_0x6f33('0x26')](saveUpdates(_0x52b6bd[_0x6f33('0x4e')],null))[_0x6f33('0x26')](respondWithResult(_0x1f069f,null))[_0x6f33('0x49')](handleError(_0x1f069f,null));};exports[_0x6f33('0x27')]=function(_0x142781,_0x401b42){return db[_0x6f33('0x2f')][_0x6f33('0x4c')]({'where':{'id':_0x142781[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](handleEntityNotFound(_0x401b42,null))['then'](removeEntity(_0x401b42,null))[_0x6f33('0x49')](handleError(_0x401b42,null));};exports[_0x6f33('0x56')]=function(_0x122c9b,_0x293541){return db[_0x6f33('0x2f')][_0x6f33('0x56')]()[_0x6f33('0x26')](respondWithResult(_0x293541,null))['catch'](handleError(_0x293541,null));};exports[_0x6f33('0x57')]=function(_0x7f2ceb,_0x2667f6,_0xb97575){var _0x18a702={'raw':!![],'where':{}},_0x3459c5={},_0x373fd8;return db[_0x6f33('0x2f')][_0x6f33('0x58')]({'where':{'id':_0x7f2ceb[_0x6f33('0x55')]['id']}})['then'](handleEntityNotFound(_0x2667f6,null))['then'](function(_0x4666e3){if(_0x4666e3){_0x373fd8=_0x4666e3[_0x6f33('0x28')]({'plain':!![]});_0x3459c5[_0x6f33('0x34')]=_['keys'](db[_0x6f33('0x59')]['rawAttributes']);_0x3459c5[_0x6f33('0x35')]=_[_0x6f33('0x36')](_0x7f2ceb[_0x6f33('0x35')]);_0x3459c5[_0x6f33('0x37')]=_[_0x6f33('0x38')](_0x3459c5['model'],_0x3459c5[_0x6f33('0x35')]);_0x18a702[_0x6f33('0x39')]=_[_0x6f33('0x38')](_0x3459c5[_0x6f33('0x34')],qs['fields'](_0x7f2ceb[_0x6f33('0x35')]['fields']));_0x18a702[_0x6f33('0x39')]=_0x18a702[_0x6f33('0x39')][_0x6f33('0x3b')]?_0x18a702[_0x6f33('0x39')]:_0x3459c5[_0x6f33('0x34')];if(!_0x7f2ceb[_0x6f33('0x35')][_0x6f33('0x3c')]('nolimit')){_0x18a702[_0x6f33('0x1f')]=qs[_0x6f33('0x1f')](_0x7f2ceb[_0x6f33('0x35')][_0x6f33('0x1f')]);_0x18a702[_0x6f33('0x1d')]=qs['offset'](_0x7f2ceb[_0x6f33('0x35')][_0x6f33('0x1d')]);}_0x18a702[_0x6f33('0x3e')]=qs['sort'](_0x7f2ceb['query']['sort']);_0x18a702[_0x6f33('0x40')]=qs[_0x6f33('0x37')](_[_0x6f33('0x41')](_0x7f2ceb['query'],_0x3459c5[_0x6f33('0x37')]));_0x18a702['where']['OpenchannelQueueId']=_0x4666e3['id'];if(_0x7f2ceb[_0x6f33('0x35')][_0x6f33('0x42')]){_0x18a702[_0x6f33('0x40')]=_[_0x6f33('0x44')](_0x18a702[_0x6f33('0x40')],{'$or':_[_0x6f33('0x2e')](_0x18a702['attributes'],function(_0x380525){var _0x72d2f2={};_0x72d2f2[_0x380525]={'$like':'%'+_0x7f2ceb[_0x6f33('0x35')]['filter']+'%'};return _0x72d2f2;})});}_0x18a702=_[_0x6f33('0x44')]({},_0x18a702,_0x7f2ceb['options']);return db[_0x6f33('0x59')][_0x6f33('0x47')](_0x18a702);}})[_0x6f33('0x26')](function(_0x2b4f3d){if(_0x2b4f3d){return db[_0x6f33('0x5a')][_0x6f33('0x5b')]({'where':{'id':_[_0x6f33('0x2e')](_0x2b4f3d,'UserId'),'role':'agent'},'attributes':['id','name','openchannelPause','updatedAt',_0x6f33('0x5c')]});}})[_0x6f33('0x26')](function(_0x45fa14){if(_0x45fa14){return{'count':_0x45fa14[_0x6f33('0x20')],'rows':_[_0x6f33('0x2e')](_0x45fa14['rows'],function(_0x3858b8){return{'membername':_0x3858b8[_0x6f33('0x2b')],'UserId':_0x3858b8['id'],'queue_name':_0x373fd8['name'],'OpenchannelQueueId':_0x373fd8['id'],'interface':util[_0x6f33('0x5d')](_0x6f33('0x5e'),_0x6f33('0x5f'),_0x3858b8[_0x6f33('0x2b')]),'penalty':0x0,'paused':_0x3858b8[_0x6f33('0x60')],'createdAt':_0x3858b8['createdAt'],'updatedAt':_0x3858b8[_0x6f33('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f33('0x26')](respondWithFilteredResult(_0x2667f6,_0x18a702))[_0x6f33('0x49')](handleError(_0x2667f6,null));};exports['getTeams']=function(_0xf8b7c3,_0x3e28e3,_0x239c3b){var _0x72ace5={};var _0x11aa87={};var _0x52e161;var _0x2282a9;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xf8b7c3[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](handleEntityNotFound(_0x3e28e3,null))[_0x6f33('0x26')](function(_0x2e291c){if(_0x2e291c){_0x52e161=_0x2e291c;_0x11aa87[_0x6f33('0x34')]=_[_0x6f33('0x36')](db['Team'][_0x6f33('0x30')]);_0x11aa87['query']=_[_0x6f33('0x36')](_0xf8b7c3[_0x6f33('0x35')]);_0x11aa87[_0x6f33('0x37')]=_[_0x6f33('0x38')](_0x11aa87['model'],_0x11aa87[_0x6f33('0x35')]);_0x72ace5[_0x6f33('0x39')]=_[_0x6f33('0x38')](_0x11aa87[_0x6f33('0x34')],qs[_0x6f33('0x3a')](_0xf8b7c3['query'][_0x6f33('0x3a')]));_0x72ace5[_0x6f33('0x39')]=_0x72ace5[_0x6f33('0x39')][_0x6f33('0x3b')]?_0x72ace5[_0x6f33('0x39')]:_0x11aa87[_0x6f33('0x34')];_0x72ace5[_0x6f33('0x3e')]=qs[_0x6f33('0x3f')](_0xf8b7c3[_0x6f33('0x35')][_0x6f33('0x3f')]);_0x72ace5[_0x6f33('0x40')]=qs[_0x6f33('0x37')](_[_0x6f33('0x41')](_0xf8b7c3[_0x6f33('0x35')],_0x11aa87[_0x6f33('0x37')]));if(_0xf8b7c3[_0x6f33('0x35')][_0x6f33('0x42')]){_0x72ace5[_0x6f33('0x40')]=_[_0x6f33('0x44')](_0x72ace5[_0x6f33('0x40')],{'$or':_[_0x6f33('0x2e')](_0x72ace5[_0x6f33('0x39')],function(_0x554258){var _0x487c70={};_0x487c70[_0x554258]={'$like':'%'+_0xf8b7c3[_0x6f33('0x35')]['filter']+'%'};return _0x487c70;})});}_0x72ace5=_[_0x6f33('0x44')]({},_0x72ace5,_0xf8b7c3[_0x6f33('0x45')]);return _0x52e161['getTeams'](_0x72ace5);}})[_0x6f33('0x26')](function(_0x287708){if(_0x287708){_0x2282a9=_0x287708['length'];if(!_0xf8b7c3[_0x6f33('0x35')][_0x6f33('0x3c')](_0x6f33('0x3d'))){_0x72ace5[_0x6f33('0x1f')]=qs[_0x6f33('0x1f')](_0xf8b7c3[_0x6f33('0x35')][_0x6f33('0x1f')]);_0x72ace5[_0x6f33('0x1d')]=qs['offset'](_0xf8b7c3['query']['offset']);}return _0x52e161['getTeams'](_0x72ace5);}})[_0x6f33('0x26')](function(_0x426b2a){if(_0x426b2a){return _0x426b2a?{'count':_0x2282a9,'rows':_0x426b2a}:null;}})[_0x6f33('0x26')](respondWithResult(_0x3e28e3,null))[_0x6f33('0x49')](handleError(_0x3e28e3,null));};exports[_0x6f33('0x62')]=function(_0x5d637d,_0x21853e,_0x2d2ff2){var _0x510305=_0x5d637d['body'][_0x6f33('0x63')];return db[_0x6f33('0x64')][_0x6f33('0x47')]({'where':{'id':_0x510305},'attributes':['id'],'include':[{'model':db[_0x6f33('0x5a')],'as':_0x6f33('0x65'),'attributes':['id',_0x6f33('0x2b'),_0x6f33('0x66'),_0x6f33('0x67'),_0x6f33('0x68')],'raw':!![]}]})[_0x6f33('0x26')](function(_0x33e450){if(_0x33e450){var _0x12b23c=_[_0x6f33('0x69')](_0x33e450,function(_0x3fc6ea){var _0x174141=_0x3fc6ea['get']({'plain':!![]});return _0x174141[_0x6f33('0x65')];});return db[_0x6f33('0x2f')][_0x6f33('0x4c')]({'where':{'id':_0x5d637d[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](function(_0x40e7fc){return db['sequelize'][_0x6f33('0x6a')](function(_0x2d5eac){return _0x40e7fc['addTeams'](_0x510305,{'transaction':_0x2d5eac})[_0x6f33('0x26')](function(){return BPromise[_0x6f33('0x6b')](_0x12b23c,function(_0x5a88b4){return db['UserOpenchannelQueue'][_0x6f33('0x6c')]({'where':{'UserId':_0x5a88b4['id'],'OpenchannelQueueId':_0x5d637d['params']['id']},'transaction':_0x2d5eac});});})[_0x6f33('0x26')](function(){_0x12b23c[_0x6f33('0x6d')](function(_0x46cb2b){socket[_0x6f33('0x6e')](_0x6f33('0x6f'),{'UserId':_0x46cb2b['id'],'OpenchannelQueueId':_0x40e7fc['id']});});});});});}})[_0x6f33('0x26')](respondWithStatusCode(_0x21853e,null))[_0x6f33('0x49')](handleError(_0x21853e,null));};exports['removeTeams']=function(_0x1d54e0,_0x19dfb1,_0x2cc9ae){return db[_0x6f33('0x64')]['findAll']({'where':{'id':_0x1d54e0[_0x6f33('0x35')][_0x6f33('0x63')]},'attributes':['id'],'include':[{'model':db[_0x6f33('0x5a')],'as':_0x6f33('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x19dfb1,null))['then'](function(_0x2e0004){var _0x313867=_['map'](_0x2e0004,'id');var _0x21d358=[];var _0x32b025=[];var _0x543588=squel[_0x6f33('0x70')]();_0x543588[_0x6f33('0x71')]('tq.TeamId')[_0x6f33('0x72')]('team_has_openchannel_queues','tq')[_0x6f33('0x73')](_0x6f33('0x74'),'ut',_0x6f33('0x75'))[_0x6f33('0x40')](_0x6f33('0x76'),_0x1d54e0[_0x6f33('0x55')]['id']);for(var _0x59aaa1=0x0;_0x59aaa1<_0x2e0004[_0x6f33('0x3b')];_0x59aaa1+=0x1){let _0x38d9c6=_0x2e0004[_0x59aaa1];for(var _0x37b877=0x0;_0x37b877<_0x38d9c6[_0x6f33('0x65')]['length'];_0x37b877+=0x1){let _0x37bc00=_0x38d9c6[_0x6f33('0x65')][_0x37b877];var _0x4430ad=_0x543588[_0x6f33('0x77')]();_0x4430ad['where'](_0x6f33('0x78'),_0x37bc00['id']);_0x32b025[_0x6f33('0x79')](db[_0x6f33('0x7a')][_0x6f33('0x35')](_0x4430ad[_0x6f33('0x7b')](),{'type':db[_0x6f33('0x7a')]['QueryTypes'][_0x6f33('0x7c')]})[_0x6f33('0x26')](function(_0x554bf7){if(_0x554bf7[_0x6f33('0x3b')]===0x1){return _0x37bc00['id'];}else{var _0x1300fb=_[_0x6f33('0x7d')](_[_0x6f33('0x2e')](_0x554bf7,'TeamId'),function(_0x4636dc){return _[_0x6f33('0x7e')](_0x313867,_0x4636dc);});if(_0x1300fb){return _0x37bc00['id'];}}}));}}return BPromise['all'](_0x32b025)[_0x6f33('0x26')](function(_0x5bcdaa){_0x21d358=_(_0x21d358)[_0x6f33('0x7f')](_0x5bcdaa)['compact']()[_0x6f33('0x80')]();return db[_0x6f33('0x2f')][_0x6f33('0x4c')]({'where':{'id':_0x1d54e0[_0x6f33('0x55')]['id']}})['then'](function(_0xad68aa){return db[_0x6f33('0x7a')][_0x6f33('0x6a')](function(_0x5221e5){return _0xad68aa[_0x6f33('0x81')](_0x1d54e0[_0x6f33('0x35')][_0x6f33('0x63')],{'transaction':_0x5221e5})[_0x6f33('0x26')](function(){if(!_[_0x6f33('0x82')](_0x21d358)){return _0xad68aa[_0x6f33('0x83')](_0x21d358,{'transaction':_0x5221e5});}})[_0x6f33('0x26')](function(){_0x21d358[_0x6f33('0x6d')](function(_0x45eebd){socket[_0x6f33('0x6e')](_0x6f33('0x84'),{'UserId':_0x45eebd,'OpenchannelQueueId':_0xad68aa['id']});});});});});});})[_0x6f33('0x26')](respondWithStatusCode(_0x19dfb1,null))[_0x6f33('0x49')](handleError(_0x19dfb1,null));};exports[_0x6f33('0x85')]=function(_0x53a88e,_0x3bf49d,_0x3dab3d){return db[_0x6f33('0x2f')][_0x6f33('0x4c')]({'where':{'id':_0x53a88e[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](handleEntityNotFound(_0x3bf49d,null))['then'](function(_0x483d70){if(_0x483d70){return _0x483d70[_0x6f33('0x85')](_0x53a88e[_0x6f33('0x4e')][_0x6f33('0x63')],_[_0x6f33('0x86')](_0x53a88e['body'],[_0x6f33('0x63'),'id'])||{})[_0x6f33('0x87')](function(_0x3f9934){for(var _0x2908e9=0x0;_0x2908e9<_0x53a88e['body'][_0x6f33('0x63')][_0x6f33('0x3b')];_0x2908e9+=0x1){socket['emit'](_0x6f33('0x6f'),{'UserId':Number(_0x53a88e['body'][_0x6f33('0x63')][_0x2908e9]),'OpenchannelQueueId':Number(_0x53a88e[_0x6f33('0x55')]['id'])});}return _0x3f9934;});}})['then'](respondWithResult(_0x3bf49d,null))[_0x6f33('0x49')](handleError(_0x3bf49d,null));};exports[_0x6f33('0x83')]=function(_0xdb26a6,_0x3d04b2,_0xbb46d5){return db[_0x6f33('0x2f')]['find']({'where':{'id':_0xdb26a6[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](handleEntityNotFound(_0x3d04b2,null))[_0x6f33('0x26')](function(_0x50171f){if(_0x50171f){return _0x50171f[_0x6f33('0x83')](_0xdb26a6[_0x6f33('0x35')][_0x6f33('0x63')])[_0x6f33('0x26')](function(){if(_[_0x6f33('0x88')](_0xdb26a6[_0x6f33('0x35')]['ids'])){for(var _0x3b8301=0x0;_0x3b8301<_0xdb26a6[_0x6f33('0x35')][_0x6f33('0x63')]['length'];_0x3b8301+=0x1){socket['emit'](_0x6f33('0x84'),{'UserId':Number(_0xdb26a6['query'][_0x6f33('0x63')][_0x3b8301]),'OpenchannelQueueId':Number(_0xdb26a6[_0x6f33('0x55')]['id'])});}}else{socket['emit'](_0x6f33('0x84'),{'UserId':Number(_0xdb26a6[_0x6f33('0x35')][_0x6f33('0x63')]),'OpenchannelQueueId':Number(_0xdb26a6[_0x6f33('0x55')]['id'])});}});}})[_0x6f33('0x26')](respondWithStatusCode(_0x3d04b2,null))['catch'](handleError(_0x3d04b2,null));};exports[_0x6f33('0x89')]=function(_0x1a5f6e,_0x55f3f3,_0x44acd6){var _0x410926={};var _0x23a208={};var _0x27e7fd;var _0x2c690f;return db[_0x6f33('0x2f')][_0x6f33('0x58')]({'where':{'id':_0x1a5f6e[_0x6f33('0x55')]['id']}})[_0x6f33('0x26')](handleEntityNotFound(_0x55f3f3,null))['then'](function(_0x3ac819){if(_0x3ac819){_0x27e7fd=_0x3ac819;_0x23a208[_0x6f33('0x34')]=_[_0x6f33('0x36')](db['User'][_0x6f33('0x30')]);_0x23a208[_0x6f33('0x35')]=_[_0x6f33('0x36')](_0x1a5f6e[_0x6f33('0x35')]);_0x23a208[_0x6f33('0x37')]=_['intersection'](_0x23a208['model'],_0x23a208[_0x6f33('0x35')]);_0x410926['attributes']=_['intersection'](_0x23a208[_0x6f33('0x34')],qs['fields'](_0x1a5f6e[_0x6f33('0x35')]['fields']));_0x410926[_0x6f33('0x39')]=_0x410926['attributes'][_0x6f33('0x3b')]?_0x410926[_0x6f33('0x39')]:_0x23a208['model'];_0x410926[_0x6f33('0x3e')]=qs[_0x6f33('0x3f')](_0x1a5f6e[_0x6f33('0x35')][_0x6f33('0x3f')]);_0x410926[_0x6f33('0x40')]=qs[_0x6f33('0x37')](_[_0x6f33('0x41')](_0x1a5f6e[_0x6f33('0x35')],_0x23a208[_0x6f33('0x37')]));if(_0x1a5f6e['query'][_0x6f33('0x42')]){_0x410926[_0x6f33('0x40')]=_[_0x6f33('0x44')](_0x410926[_0x6f33('0x40')],{'$or':_['map'](_0x410926[_0x6f33('0x39')],function(_0x5a238d){var _0x5e90a4={};_0x5e90a4[_0x5a238d]={'$like':'%'+_0x1a5f6e[_0x6f33('0x35')][_0x6f33('0x42')]+'%'};return _0x5e90a4;})});}_0x410926=_[_0x6f33('0x44')]({},_0x410926,_0x1a5f6e['options']);return _0x27e7fd['getAgents'](_0x410926);}})['then'](function(_0x18220d){if(_0x18220d){_0x2c690f=_0x18220d[_0x6f33('0x3b')];if(!_0x1a5f6e[_0x6f33('0x35')][_0x6f33('0x3c')](_0x6f33('0x3d'))){_0x410926[_0x6f33('0x1f')]=qs[_0x6f33('0x1f')](_0x1a5f6e[_0x6f33('0x35')][_0x6f33('0x1f')]);_0x410926['offset']=qs['offset'](_0x1a5f6e[_0x6f33('0x35')][_0x6f33('0x1d')]);}return _0x27e7fd['getAgents'](_0x410926);}})[_0x6f33('0x26')](function(_0x366d58){if(_0x366d58){return _0x366d58?{'count':_0x2c690f,'rows':_0x366d58}:null;}})['then'](respondWithResult(_0x55f3f3,null))[_0x6f33('0x49')](handleError(_0x55f3f3,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 01b1df6..387c7ff 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 _0x709a=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','hook','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x709a,0x90));var _0xa709=function(_0x1c4063,_0x31c873){_0x1c4063=_0x1c4063-0x0;var _0x2cf6aa=_0x709a[_0x1c4063];return _0x2cf6aa;};'use strict';var EventEmitter=require(_0xa709('0x0'));var OpenchannelQueue=require(_0xa709('0x1'))['db'][_0xa709('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa709('0x3')](0x0);var events={'afterCreate':_0xa709('0x4'),'afterUpdate':_0xa709('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc584ff){return function(_0x1b4878,_0x16e5ef,_0xecbc0d){OpenchannelQueueEvents[_0xa709('0x6')](_0xc584ff+':'+_0x1b4878['id'],_0x1b4878);OpenchannelQueueEvents[_0xa709('0x6')](_0xc584ff,_0x1b4878);_0xecbc0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xa709('0x7')](e,emitEvent(event));}}module[_0xa709('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x16b4=['emit','hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x423030,_0x1c22f5){var _0xe62c5c=function(_0x1ef613){while(--_0x1ef613){_0x423030['push'](_0x423030['shift']());}};_0xe62c5c(++_0x1c22f5);}(_0x16b4,0x13b));var _0x416b=function(_0x3510b2,_0x262162){_0x3510b2=_0x3510b2-0x0;var _0x31ef5d=_0x16b4[_0x3510b2];return _0x31ef5d;};'use strict';var EventEmitter=require(_0x416b('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x416b('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x416b('0x2')](0x0);var events={'afterCreate':_0x416b('0x3'),'afterUpdate':_0x416b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3853cc){return function(_0x5307a7,_0x1376ff,_0x380bdd){OpenchannelQueueEvents['emit'](_0x3853cc+':'+_0x5307a7['id'],_0x5307a7);OpenchannelQueueEvents[_0x416b('0x5')](_0x3853cc,_0x5307a7);_0x380bdd(null);};}for(var e in events){if(events[_0x416b('0x6')](e)){var event=events[e];OpenchannelQueue[_0x416b('0x7')](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 2423261..2b19afe 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 _0xa874=['api','moment','bluebird','request-promise','path','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x4ea24b,_0xa3260b){var _0x4b3ae5=function(_0x4071fd){while(--_0x4071fd){_0x4ea24b['push'](_0x4ea24b['shift']());}};_0x4b3ae5(++_0xa3260b);}(_0xa874,0xf4));var _0x4a87=function(_0x49d450,_0x21f810){_0x49d450=_0x49d450-0x0;var _0x4da56f=_0xa874[_0x49d450];return _0x4da56f;};'use strict';var _=require(_0x4a87('0x0'));var util=require(_0x4a87('0x1'));var logger=require(_0x4a87('0x2'))(_0x4a87('0x3'));var moment=require(_0x4a87('0x4'));var BPromise=require(_0x4a87('0x5'));var rp=require(_0x4a87('0x6'));var fs=require('fs');var path=require(_0x4a87('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4a87('0x8'));module[_0x4a87('0x9')]=function(_0x1c3d67,_0x52956d){return _0x1c3d67[_0x4a87('0xa')](_0x4a87('0xb'),attributes,{'tableName':_0x4a87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2347=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x40715f,_0x263c7a){var _0x3004ed=function(_0x5142c5){while(--_0x5142c5){_0x40715f['push'](_0x40715f['shift']());}};_0x3004ed(++_0x263c7a);}(_0x2347,0x1df));var _0x7234=function(_0x4d5c68,_0x325cb3){_0x4d5c68=_0x4d5c68-0x0;var _0x3e0ae7=_0x2347[_0x4d5c68];return _0x3e0ae7;};'use strict';var _=require(_0x7234('0x0'));var util=require(_0x7234('0x1'));var logger=require(_0x7234('0x2'))(_0x7234('0x3'));var moment=require(_0x7234('0x4'));var BPromise=require(_0x7234('0x5'));var rp=require(_0x7234('0x6'));var fs=require('fs');var path=require(_0x7234('0x7'));var rimraf=require(_0x7234('0x8'));var config=require(_0x7234('0x9'));var attributes=require(_0x7234('0xa'));module[_0x7234('0xb')]=function(_0x1e8177,_0x2f885d){return _0x1e8177[_0x7234('0xc')](_0x7234('0xd'),attributes,{'tableName':_0x7234('0xe'),'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 eb42c33..adf102c 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 _0xf416=['model','attributes','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','findAll','options','raw','limit','include','map'];(function(_0x14f55c,_0x2adaaf){var _0x513e7a=function(_0x1d8145){while(--_0x1d8145){_0x14f55c['push'](_0x14f55c['shift']());}};_0x513e7a(++_0x2adaaf);}(_0xf416,0xd4));var _0x6f41=function(_0x2ffb28,_0xf36357){_0x2ffb28=_0x2ffb28-0x0;var _0x2cf42e=_0xf416[_0x2ffb28];return _0x2cf42e;};'use strict';var _=require(_0x6f41('0x0'));var util=require('util');var moment=require(_0x6f41('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f41('0x2'));var fs=require('fs');var Redis=require(_0x6f41('0x3'));var db=require(_0x6f41('0x4'))['db'];var utils=require(_0x6f41('0x5'));var logger=require(_0x6f41('0x6'))(_0x6f41('0x7'));var config=require(_0x6f41('0x8'));var jayson=require(_0x6f41('0x9'));var client=jayson[_0x6f41('0xa')][_0x6f41('0xb')]({'port':0x232a});config[_0x6f41('0xc')]=_[_0x6f41('0xd')](config[_0x6f41('0xc')],{'host':_0x6f41('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6f41('0xf'))['register'](socket);function respondWithRpcPromise(_0x194028,_0x191cf4,_0x4b7bbf){return new BPromise(function(_0x38b00b,_0x5bbb58){return client[_0x6f41('0x10')](_0x194028,_0x4b7bbf)['then'](function(_0x38526c){logger[_0x6f41('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x191cf4,_0x6f41('0x12'));logger[_0x6f41('0x13')](_0x6f41('0x14'),_0x191cf4,'request\x20sent',JSON[_0x6f41('0x15')](_0x38526c));if(_0x38526c[_0x6f41('0x16')]){if(_0x38526c['error']['code']===0x1f4){logger['error'](_0x6f41('0x17'),_0x191cf4,_0x38526c[_0x6f41('0x16')][_0x6f41('0x18')]);return _0x5bbb58(_0x38526c[_0x6f41('0x16')]['message']);}logger[_0x6f41('0x16')](_0x6f41('0x17'),_0x191cf4,_0x38526c[_0x6f41('0x16')]['message']);return _0x38b00b(_0x38526c[_0x6f41('0x16')][_0x6f41('0x18')]);}else{logger[_0x6f41('0x11')](_0x6f41('0x17'),_0x191cf4,_0x6f41('0x12'));_0x38b00b(_0x38526c[_0x6f41('0x19')][_0x6f41('0x18')]);}})[_0x6f41('0x1a')](function(_0xad80b3){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x191cf4,_0xad80b3);_0x5bbb58(_0xad80b3);});});}exports['GetOpenchannelQueue']=function(_0x21d02a){var _0x2bae2a=this;return new Promise(function(_0x3fc234,_0x2401c1){return db[_0x6f41('0x1b')][_0x6f41('0x1c')]({'raw':_0x21d02a[_0x6f41('0x1d')]?_0x21d02a[_0x6f41('0x1d')][_0x6f41('0x1e')]===undefined?!![]:![]:!![],'where':_0x21d02a[_0x6f41('0x1d')]?_0x21d02a['options']['where']||null:null,'attributes':_0x21d02a['options']?_0x21d02a[_0x6f41('0x1d')]['attributes']||null:null,'limit':_0x21d02a['options']?_0x21d02a['options'][_0x6f41('0x1f')]||null:null,'include':_0x21d02a[_0x6f41('0x1d')]?_0x21d02a[_0x6f41('0x1d')][_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x21d02a[_0x6f41('0x1d')]['include'],function(_0xf85de8){return{'model':db[_0xf85de8[_0x6f41('0x22')]],'as':_0xf85de8['as'],'attributes':_0xf85de8[_0x6f41('0x23')],'include':_0xf85de8[_0x6f41('0x20')]?_[_0x6f41('0x21')](_0xf85de8['include'],function(_0x2903f4){return{'model':db[_0x2903f4['model']],'as':_0x2903f4['as'],'attributes':_0x2903f4[_0x6f41('0x23')],'include':_0x2903f4[_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x2903f4[_0x6f41('0x20')],function(_0x14bcd6){return{'model':db[_0x14bcd6[_0x6f41('0x22')]],'as':_0x14bcd6['as'],'attributes':_0x14bcd6[_0x6f41('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6f41('0x24')](function(_0x326ffd){logger[_0x6f41('0x11')]('GetOpenchannelQueue',_0x21d02a);logger[_0x6f41('0x13')](_0x6f41('0x25'),_0x21d02a,JSON[_0x6f41('0x15')](_0x326ffd));_0x3fc234(_0x326ffd);})[_0x6f41('0x1a')](function(_0x250025){logger['error'](_0x6f41('0x25'),_0x250025[_0x6f41('0x18')],_0x21d02a);_0x2401c1(_0x2bae2a[_0x6f41('0x16')](0x1f4,_0x250025[_0x6f41('0x18')]));});});};exports[_0x6f41('0x26')]=function(_0x51a0bb){var _0x52aaf6=this;return new Promise(function(_0x56c2dd,_0x4c87ac){return db['OpenchannelQueue'][_0x6f41('0x27')]({'raw':_0x51a0bb[_0x6f41('0x1d')]?_0x51a0bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x51a0bb[_0x6f41('0x1d')]?_0x51a0bb['options'][_0x6f41('0x28')]||null:null,'attributes':_0x51a0bb[_0x6f41('0x1d')]?_0x51a0bb['options'][_0x6f41('0x23')]||null:null,'include':_0x51a0bb['options']?_0x51a0bb[_0x6f41('0x1d')][_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x51a0bb[_0x6f41('0x1d')][_0x6f41('0x20')],function(_0x3e219b){return{'model':db[_0x3e219b[_0x6f41('0x22')]],'as':_0x3e219b['as'],'attributes':_0x3e219b[_0x6f41('0x23')],'include':_0x3e219b[_0x6f41('0x20')]?_['map'](_0x3e219b[_0x6f41('0x20')],function(_0x36278c){return{'model':db[_0x36278c['model']],'as':_0x36278c['as'],'attributes':_0x36278c['attributes'],'include':_0x36278c[_0x6f41('0x20')]?_[_0x6f41('0x21')](_0x36278c[_0x6f41('0x20')],function(_0x2f1a82){return{'model':db[_0x2f1a82[_0x6f41('0x22')]],'as':_0x2f1a82['as'],'attributes':_0x2f1a82['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f41('0x24')](function(_0x30f0d7){logger[_0x6f41('0x11')]('ShowOpenchannelQueue',_0x51a0bb);logger[_0x6f41('0x13')](_0x6f41('0x26'),_0x51a0bb,JSON[_0x6f41('0x15')](_0x30f0d7));_0x56c2dd(_0x30f0d7);})['catch'](function(_0x42c528){logger[_0x6f41('0x16')]('ShowOpenchannelQueue',_0x42c528['message'],_0x51a0bb);_0x4c87ac(_0x52aaf6[_0x6f41('0x16')](0x1f4,_0x42c528[_0x6f41('0x18')]));});});}; \ No newline at end of file +var _0xb9fa=['message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','then','info','stringify','ShowOpenchannelQueue','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xb9fa,0x11c));var _0xab9f=function(_0x5ccabf,_0x1ecf8d){_0x5ccabf=_0x5ccabf-0x0;var _0x4e372f=_0xb9fa[_0x5ccabf];return _0x4e372f;};'use strict';var _=require('lodash');var util=require(_0xab9f('0x0'));var moment=require('moment');var BPromise=require(_0xab9f('0x1'));var rs=require(_0xab9f('0x2'));var fs=require('fs');var Redis=require(_0xab9f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xab9f('0x4'));var logger=require('../../config/logger')(_0xab9f('0x5'));var config=require(_0xab9f('0x6'));var jayson=require(_0xab9f('0x7'));var client=jayson[_0xab9f('0x8')][_0xab9f('0x9')]({'port':0x232a});config[_0xab9f('0xa')]=_[_0xab9f('0xb')](config[_0xab9f('0xa')],{'host':_0xab9f('0xc'),'port':0x18eb});var socket=require(_0xab9f('0xd'))(new Redis(config['redis']));require(_0xab9f('0xe'))[_0xab9f('0xf')](socket);function respondWithRpcPromise(_0x49ec81,_0x42045e,_0x5b2cd0){return new BPromise(function(_0x21d247,_0x20cadb){return client['request'](_0x49ec81,_0x5b2cd0)['then'](function(_0x4b50ca){logger['info'](_0xab9f('0x10'),_0x42045e,_0xab9f('0x11'));logger[_0xab9f('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x42045e,_0xab9f('0x11'),JSON['stringify'](_0x4b50ca));if(_0x4b50ca[_0xab9f('0x13')]){if(_0x4b50ca[_0xab9f('0x13')]['code']===0x1f4){logger[_0xab9f('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x42045e,_0x4b50ca[_0xab9f('0x13')][_0xab9f('0x14')]);return _0x20cadb(_0x4b50ca[_0xab9f('0x13')][_0xab9f('0x14')]);}logger[_0xab9f('0x13')](_0xab9f('0x10'),_0x42045e,_0x4b50ca[_0xab9f('0x13')]['message']);return _0x21d247(_0x4b50ca[_0xab9f('0x13')][_0xab9f('0x14')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x42045e,_0xab9f('0x11'));_0x21d247(_0x4b50ca['result']['message']);}})[_0xab9f('0x15')](function(_0x43ac20){logger[_0xab9f('0x13')](_0xab9f('0x10'),_0x42045e,_0x43ac20);_0x20cadb(_0x43ac20);});});}exports[_0xab9f('0x16')]=function(_0xfb285d){var _0x3b6fe9=this;return new Promise(function(_0x47c5b3,_0x27acff){return db[_0xab9f('0x17')][_0xab9f('0x18')]({'raw':_0xfb285d['options']?_0xfb285d[_0xab9f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xfb285d[_0xab9f('0x19')]?_0xfb285d['options'][_0xab9f('0x1a')]||null:null,'attributes':_0xfb285d['options']?_0xfb285d[_0xab9f('0x19')][_0xab9f('0x1b')]||null:null,'limit':_0xfb285d[_0xab9f('0x19')]?_0xfb285d['options'][_0xab9f('0x1c')]||null:null,'include':_0xfb285d[_0xab9f('0x19')]?_0xfb285d[_0xab9f('0x19')][_0xab9f('0x1d')]?_[_0xab9f('0x1e')](_0xfb285d['options'][_0xab9f('0x1d')],function(_0x16a0db){return{'model':db[_0x16a0db[_0xab9f('0x1f')]],'as':_0x16a0db['as'],'attributes':_0x16a0db[_0xab9f('0x1b')],'include':_0x16a0db[_0xab9f('0x1d')]?_[_0xab9f('0x1e')](_0x16a0db[_0xab9f('0x1d')],function(_0x421266){return{'model':db[_0x421266[_0xab9f('0x1f')]],'as':_0x421266['as'],'attributes':_0x421266[_0xab9f('0x1b')],'include':_0x421266[_0xab9f('0x1d')]?_[_0xab9f('0x1e')](_0x421266[_0xab9f('0x1d')],function(_0x5b57d3){return{'model':db[_0x5b57d3['model']],'as':_0x5b57d3['as'],'attributes':_0x5b57d3[_0xab9f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xab9f('0x20')](function(_0x3f552f){logger[_0xab9f('0x21')](_0xab9f('0x16'),_0xfb285d);logger[_0xab9f('0x12')](_0xab9f('0x16'),_0xfb285d,JSON[_0xab9f('0x22')](_0x3f552f));_0x47c5b3(_0x3f552f);})[_0xab9f('0x15')](function(_0x5bd636){logger[_0xab9f('0x13')](_0xab9f('0x16'),_0x5bd636[_0xab9f('0x14')],_0xfb285d);_0x27acff(_0x3b6fe9[_0xab9f('0x13')](0x1f4,_0x5bd636[_0xab9f('0x14')]));});});};exports[_0xab9f('0x23')]=function(_0x4f9f83){var _0x29c8e6=this;return new Promise(function(_0x3e1135,_0x1cf607){return db['OpenchannelQueue'][_0xab9f('0x24')]({'raw':_0x4f9f83[_0xab9f('0x19')]?_0x4f9f83[_0xab9f('0x19')][_0xab9f('0x25')]===undefined?!![]:![]:!![],'where':_0x4f9f83['options']?_0x4f9f83[_0xab9f('0x19')][_0xab9f('0x1a')]||null:null,'attributes':_0x4f9f83['options']?_0x4f9f83['options'][_0xab9f('0x1b')]||null:null,'include':_0x4f9f83[_0xab9f('0x19')]?_0x4f9f83[_0xab9f('0x19')]['include']?_[_0xab9f('0x1e')](_0x4f9f83[_0xab9f('0x19')][_0xab9f('0x1d')],function(_0x267a4d){return{'model':db[_0x267a4d['model']],'as':_0x267a4d['as'],'attributes':_0x267a4d[_0xab9f('0x1b')],'include':_0x267a4d[_0xab9f('0x1d')]?_[_0xab9f('0x1e')](_0x267a4d[_0xab9f('0x1d')],function(_0x161c33){return{'model':db[_0x161c33['model']],'as':_0x161c33['as'],'attributes':_0x161c33[_0xab9f('0x1b')],'include':_0x161c33[_0xab9f('0x1d')]?_['map'](_0x161c33[_0xab9f('0x1d')],function(_0x4fe2a4){return{'model':db[_0x4fe2a4[_0xab9f('0x1f')]],'as':_0x4fe2a4['as'],'attributes':_0x4fe2a4[_0xab9f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xab9f('0x20')](function(_0x45b7f7){logger[_0xab9f('0x21')](_0xab9f('0x23'),_0x4f9f83);logger['debug'](_0xab9f('0x23'),_0x4f9f83,JSON[_0xab9f('0x22')](_0x45b7f7));_0x3e1135(_0x45b7f7);})[_0xab9f('0x15')](function(_0x207073){logger[_0xab9f('0x13')](_0xab9f('0x23'),_0x207073[_0xab9f('0x14')],_0x4f9f83);_0x1cf607(_0x29c8e6['error'](0x1f4,_0x207073[_0xab9f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 951ae77..078547d 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 _0xd030=['length','./openchannelQueue.events','save','remove','update','removeListener','register'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xd030,0x10b));var _0x0d03=function(_0x2d434c,_0x28c61c){_0x2d434c=_0x2d434c-0x0;var _0x1cca11=_0xd030[_0x2d434c];return _0x1cca11;};'use strict';var OpenchannelQueueEvents=require(_0x0d03('0x0'));var events=[_0x0d03('0x1'),_0x0d03('0x2'),_0x0d03('0x3')];function createListener(_0xf754da,_0x10dcd9){return function(_0x1dea15){_0x10dcd9['emit'](_0xf754da,_0x1dea15);};}function removeListener(_0x4580e4,_0x20b743){return function(){OpenchannelQueueEvents[_0x0d03('0x4')](_0x4580e4,_0x20b743);};}exports[_0x0d03('0x5')]=function(_0x10445e){for(var _0x3cda23=0x0,_0x28987e=events[_0x0d03('0x6')];_0x3cda23<_0x28987e;_0x3cda23++){var _0x3537d7=events[_0x3cda23];var _0x1c3f11=createListener('openchannelQueue:'+_0x3537d7,_0x10445e);OpenchannelQueueEvents['on'](_0x3537d7,_0x1c3f11);}}; \ No newline at end of file +var _0xe5e9=['removeListener','register','length','./openchannelQueue.events','emit'];(function(_0x57313a,_0x706d4e){var _0x4fdb87=function(_0x9fb6ff){while(--_0x9fb6ff){_0x57313a['push'](_0x57313a['shift']());}};_0x4fdb87(++_0x706d4e);}(_0xe5e9,0x152));var _0x9e5e=function(_0x4df33d,_0x580bd7){_0x4df33d=_0x4df33d-0x0;var _0x1705f0=_0xe5e9[_0x4df33d];return _0x1705f0;};'use strict';var OpenchannelQueueEvents=require(_0x9e5e('0x0'));var events=['save','remove','update'];function createListener(_0x290a43,_0x33f24e){return function(_0x185518){_0x33f24e[_0x9e5e('0x1')](_0x290a43,_0x185518);};}function removeListener(_0x2b0a72,_0x3fe59d){return function(){OpenchannelQueueEvents[_0x9e5e('0x2')](_0x2b0a72,_0x3fe59d);};}exports[_0x9e5e('0x3')]=function(_0x5e52b0){for(var _0x1f8131=0x0,_0x3de73f=events[_0x9e5e('0x4')];_0x1f8131<_0x3de73f;_0x1f8131++){var _0x35e0d5=events[_0x1f8131];var _0x3b0821=createListener('openchannelQueue:'+_0x35e0d5,_0x5e52b0);OpenchannelQueueEvents['on'](_0x35e0d5,_0x3b0821);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 19cdc57..3b3a73a 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 _0xd184=['/describe','/:id','show','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x5e6e41,_0x370503){var _0x2dba21=function(_0xf67ea6){while(--_0xf67ea6){_0x5e6e41['push'](_0x5e6e41['shift']());}};_0x2dba21(++_0x370503);}(_0xd184,0xa9));var _0x4d18=function(_0x29471c,_0x562bab){_0x29471c=_0x29471c-0x0;var _0x1be3aa=_0xd184[_0x29471c];return _0x1be3aa;};'use strict';var multer=require(_0x4d18('0x0'));var util=require(_0x4d18('0x1'));var path=require('path');var timeout=require(_0x4d18('0x2'));var express=require(_0x4d18('0x3'));var router=express[_0x4d18('0x4')]();var fs_extra=require(_0x4d18('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d18('0x6'));var controller=require(_0x4d18('0x7'));router[_0x4d18('0x8')]('/',auth[_0x4d18('0x9')](),controller[_0x4d18('0xa')]);router[_0x4d18('0x8')](_0x4d18('0xb'),auth[_0x4d18('0x9')](),controller['describe']);router[_0x4d18('0x8')](_0x4d18('0xc'),auth[_0x4d18('0x9')](),controller[_0x4d18('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4d18('0xe')]);router[_0x4d18('0xf')](_0x4d18('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4d18('0x10')](_0x4d18('0xc'),auth['isAuthenticated'](),controller[_0x4d18('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9406=['post','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x3c5461,_0x102b9b){var _0x5727db=function(_0x2a1e38){while(--_0x2a1e38){_0x3c5461['push'](_0x3c5461['shift']());}};_0x5727db(++_0x102b9b);}(_0x9406,0xe1));var _0x6940=function(_0x118da9,_0x21a9f8){_0x118da9=_0x118da9-0x0;var _0x31d18c=_0x9406[_0x118da9];return _0x31d18c;};'use strict';var multer=require(_0x6940('0x0'));var util=require(_0x6940('0x1'));var path=require('path');var timeout=require(_0x6940('0x2'));var express=require(_0x6940('0x3'));var router=express['Router']();var fs_extra=require(_0x6940('0x4'));var auth=require(_0x6940('0x5'));var interaction=require(_0x6940('0x6'));var config=require('../../config/environment');var controller=require(_0x6940('0x7'));router[_0x6940('0x8')]('/',auth[_0x6940('0x9')](),controller[_0x6940('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6940('0xb')]);router[_0x6940('0x8')](_0x6940('0xc'),auth[_0x6940('0x9')](),controller['show']);router[_0x6940('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6940('0xc'),auth[_0x6940('0x9')](),controller[_0x6940('0xe')]);router[_0x6940('0xf')]('/:id',auth[_0x6940('0x9')](),controller[_0x6940('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 9e64b34..22f75b4 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 _0x56aa=['STRING','DATE','moment','exports'];(function(_0x377afc,_0x146354){var _0x188857=function(_0x3701e7){while(--_0x3701e7){_0x377afc['push'](_0x377afc['shift']());}};_0x188857(++_0x146354);}(_0x56aa,0x126));var _0xa56a=function(_0x3b0042,_0x8e7550){_0x3b0042=_0x3b0042-0x0;var _0x41bf57=_0x56aa[_0x3b0042];return _0x41bf57;};'use strict';var moment=require(_0xa56a('0x0'));var Sequelize=require('sequelize');module[_0xa56a('0x1')]={'uniqueid':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa56a('0x2')]},'joinAt':{'type':Sequelize[_0xa56a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa56a('0x3')]},'exitAt':{'type':Sequelize[_0xa56a('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd2d0=['STRING','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd2d0,0x80));var _0x0d2d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd2d0[_0x465a0c];return _0x1e202e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0d2d('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0d2d('0x1')]},'leaveAt':{'type':Sequelize[_0x0d2d('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0d2d('0x1')]},'reason':{'type':Sequelize[_0x0d2d('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 91512ee..7bba003 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 _0xa993=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x457d61,_0x266a77){var _0x2204c8=function(_0x19b008){while(--_0x19b008){_0x457d61['push'](_0x457d61['shift']());}};_0x2204c8(++_0x266a77);}(_0xa993,0x161));var _0x3a99=function(_0x3b8565,_0x56dbaa){_0x3b8565=_0x3b8565-0x0;var _0x433f97=_0xa993[_0x3b8565];return _0x433f97;};'use strict';var emlformat=require(_0x3a99('0x0'));var rimraf=require(_0x3a99('0x1'));var zipdir=require(_0x3a99('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a99('0x3'));var moment=require('moment');var BPromise=require(_0x3a99('0x4'));var Mustache=require(_0x3a99('0x5'));var util=require('util');var path=require(_0x3a99('0x6'));var sox=require(_0x3a99('0x7'));var csv=require(_0x3a99('0x8'));var ejs=require(_0x3a99('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a99('0xa'));var squel=require(_0x3a99('0xb'));var crypto=require('crypto');var jsforce=require(_0x3a99('0xc'));var deskjs=require(_0x3a99('0xd'));var toCsv=require(_0x3a99('0x8'));var querystring=require('querystring');var Papa=require(_0x3a99('0xe'));var Redis=require('ioredis');var authService=require(_0x3a99('0xf'));var qs=require(_0x3a99('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a99('0x11'));var logger=require(_0x3a99('0x12'))(_0x3a99('0x13'));var utils=require(_0x3a99('0x14'));var config=require(_0x3a99('0x15'));var licenseUtil=require(_0x3a99('0x16'));var db=require(_0x3a99('0x17'))['db'];function respondWithStatusCode(_0x1c8355,_0x407cbf){_0x407cbf=_0x407cbf||0xcc;return function(_0x7a4321){if(_0x7a4321){return _0x1c8355[_0x3a99('0x18')](_0x407cbf);}return _0x1c8355['status'](_0x407cbf)['end']();};}function respondWithResult(_0x15b18a,_0x553d59){_0x553d59=_0x553d59||0xc8;return function(_0x51659b){if(_0x51659b){return _0x15b18a[_0x3a99('0x19')](_0x553d59)[_0x3a99('0x1a')](_0x51659b);}};}function respondWithFilteredResult(_0x2d6e4a,_0x423598){return function(_0x47d21c){if(_0x47d21c){var _0x233060=typeof _0x423598[_0x3a99('0x1b')]==='undefined'&&typeof _0x423598['limit']===_0x3a99('0x1c');var _0x1423a5=_0x47d21c[_0x3a99('0x1d')];var _0x125bb3=_0x233060?0x0:_0x423598['offset'];var _0x596f36=_0x233060?_0x47d21c[_0x3a99('0x1d')]:_0x423598['offset']+_0x423598[_0x3a99('0x1e')];var _0x452042;if(_0x596f36>=_0x1423a5){_0x596f36=_0x1423a5;_0x452042=0xc8;}else{_0x452042=0xce;}_0x2d6e4a[_0x3a99('0x19')](_0x452042);return _0x2d6e4a['set'](_0x3a99('0x1f'),_0x125bb3+'-'+_0x596f36+'/'+_0x1423a5)[_0x3a99('0x1a')](_0x47d21c);}return null;};}function patchUpdates(_0x5ec10f){return function(_0x18b4cc){try{jsonpatch[_0x3a99('0x20')](_0x18b4cc,_0x5ec10f,!![]);}catch(_0x3d628c){return BPromise[_0x3a99('0x21')](_0x3d628c);}return _0x18b4cc[_0x3a99('0x22')]();};}function saveUpdates(_0x180a9f,_0x1ac308){return function(_0x19cfda){if(_0x19cfda){return _0x19cfda['update'](_0x180a9f)[_0x3a99('0x23')](function(_0x598d2e){return _0x598d2e;});}return null;};}function removeEntity(_0x83db3a,_0x50145c){return function(_0x3d5c76){if(_0x3d5c76){return _0x3d5c76['destroy']()[_0x3a99('0x23')](function(){_0x83db3a[_0x3a99('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195bc0,_0x25fe84){return function(_0x4f1a82){if(!_0x4f1a82){_0x195bc0[_0x3a99('0x18')](0x194);}return _0x4f1a82;};}function handleError(_0x1a7160,_0x18ad24){_0x18ad24=_0x18ad24||0x1f4;return function(_0x5c2033){logger['error'](_0x5c2033[_0x3a99('0x24')]);if(_0x5c2033[_0x3a99('0x25')]){delete _0x5c2033[_0x3a99('0x25')];}_0x1a7160['status'](_0x18ad24)[_0x3a99('0x26')](_0x5c2033);};}exports['index']=function(_0x3c6a52,_0x690687){var _0x405243={},_0x4e1e67={},_0x382c70={'count':0x0,'rows':[]};var _0x2af20a=_[_0x3a99('0x27')](db[_0x3a99('0x28')][_0x3a99('0x29')],function(_0x3920a7){return{'name':_0x3920a7[_0x3a99('0x2a')],'type':_0x3920a7[_0x3a99('0x2b')]['key']};});_0x4e1e67[_0x3a99('0x2c')]=_[_0x3a99('0x27')](_0x2af20a,_0x3a99('0x25'));_0x4e1e67['query']=_[_0x3a99('0x2d')](_0x3c6a52[_0x3a99('0x2e')]);_0x4e1e67['filters']=_['intersection'](_0x4e1e67['model'],_0x4e1e67[_0x3a99('0x2e')]);_0x405243[_0x3a99('0x2f')]=_[_0x3a99('0x30')](_0x4e1e67[_0x3a99('0x2c')],qs['fields'](_0x3c6a52['query'][_0x3a99('0x31')]));_0x405243[_0x3a99('0x2f')]=_0x405243['attributes']['length']?_0x405243[_0x3a99('0x2f')]:_0x4e1e67['model'];if(!_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x32')]('nolimit')){_0x405243[_0x3a99('0x1e')]=qs[_0x3a99('0x1e')](_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x1e')]);_0x405243[_0x3a99('0x1b')]=qs[_0x3a99('0x1b')](_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x1b')]);}_0x405243[_0x3a99('0x33')]=qs[_0x3a99('0x34')](_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x34')]);_0x405243['where']=qs[_0x3a99('0x35')](_[_0x3a99('0x36')](_0x3c6a52[_0x3a99('0x2e')],_0x4e1e67[_0x3a99('0x35')]),_0x2af20a);if(_0x3c6a52['query'][_0x3a99('0x37')]){_0x405243['where']=_[_0x3a99('0x38')](_0x405243[_0x3a99('0x39')],{'$or':_['map'](_0x2af20a,function(_0x374f2a){if(_0x374f2a[_0x3a99('0x2b')]!==_0x3a99('0x3a')){var _0x51eb35={};_0x51eb35[_0x374f2a[_0x3a99('0x25')]]={'$like':'%'+_0x3c6a52['query'][_0x3a99('0x37')]+'%'};return _0x51eb35;}})});}_0x405243=_[_0x3a99('0x38')]({},_0x405243,_0x3c6a52[_0x3a99('0x3b')]);var _0x5cd996={'where':_0x405243[_0x3a99('0x39')]};return db[_0x3a99('0x28')][_0x3a99('0x1d')](_0x5cd996)['then'](function(_0x5808ab){_0x382c70['count']=_0x5808ab;if(_0x3c6a52[_0x3a99('0x2e')][_0x3a99('0x3c')]){_0x405243[_0x3a99('0x3d')]=[{'all':!![]}];}return db[_0x3a99('0x28')]['findAll'](_0x405243);})['then'](function(_0x5e1d93){_0x382c70[_0x3a99('0x3e')]=_0x5e1d93;return _0x382c70;})['then'](respondWithFilteredResult(_0x690687,_0x405243))[_0x3a99('0x3f')](handleError(_0x690687,null));};exports[_0x3a99('0x40')]=function(_0x517cb2,_0x1addb7){var _0xb5b9f7={'raw':!![],'where':{'id':_0x517cb2[_0x3a99('0x41')]['id']}},_0x4da27f={};_0x4da27f[_0x3a99('0x2c')]=_[_0x3a99('0x2d')](db['OpenchannelQueueReport'][_0x3a99('0x29')]);_0x4da27f['query']=_['keys'](_0x517cb2[_0x3a99('0x2e')]);_0x4da27f['filters']=_['intersection'](_0x4da27f['model'],_0x4da27f[_0x3a99('0x2e')]);_0xb5b9f7[_0x3a99('0x2f')]=_[_0x3a99('0x30')](_0x4da27f[_0x3a99('0x2c')],qs[_0x3a99('0x31')](_0x517cb2[_0x3a99('0x2e')][_0x3a99('0x31')]));_0xb5b9f7[_0x3a99('0x2f')]=_0xb5b9f7[_0x3a99('0x2f')][_0x3a99('0x42')]?_0xb5b9f7['attributes']:_0x4da27f[_0x3a99('0x2c')];if(_0x517cb2['query'][_0x3a99('0x3c')]){_0xb5b9f7[_0x3a99('0x3d')]=[{'all':!![]}];}_0xb5b9f7=_[_0x3a99('0x38')]({},_0xb5b9f7,_0x517cb2[_0x3a99('0x3b')]);return db[_0x3a99('0x28')][_0x3a99('0x43')](_0xb5b9f7)['then'](handleEntityNotFound(_0x1addb7,null))[_0x3a99('0x23')](respondWithResult(_0x1addb7,null))[_0x3a99('0x3f')](handleError(_0x1addb7,null));};exports[_0x3a99('0x44')]=function(_0x45c21b,_0x556b13){return db[_0x3a99('0x28')]['create'](_0x45c21b[_0x3a99('0x45')],{})[_0x3a99('0x23')](respondWithResult(_0x556b13,0xc9))['catch'](handleError(_0x556b13,null));};exports[_0x3a99('0x46')]=function(_0x3c525b,_0x5dcb43){if(_0x3c525b[_0x3a99('0x45')]['id']){delete _0x3c525b[_0x3a99('0x45')]['id'];}return db[_0x3a99('0x28')][_0x3a99('0x43')]({'where':{'id':_0x3c525b[_0x3a99('0x41')]['id']}})[_0x3a99('0x23')](handleEntityNotFound(_0x5dcb43,null))[_0x3a99('0x23')](saveUpdates(_0x3c525b[_0x3a99('0x45')],null))[_0x3a99('0x23')](respondWithResult(_0x5dcb43,null))[_0x3a99('0x3f')](handleError(_0x5dcb43,null));};exports[_0x3a99('0x47')]=function(_0x2aa641,_0x32b020){return db[_0x3a99('0x28')][_0x3a99('0x43')]({'where':{'id':_0x2aa641['params']['id']}})[_0x3a99('0x23')](handleEntityNotFound(_0x32b020,null))[_0x3a99('0x23')](removeEntity(_0x32b020,null))['catch'](handleError(_0x32b020,null));};exports[_0x3a99('0x48')]=function(_0x25a6f5,_0x494dcd){return db[_0x3a99('0x28')][_0x3a99('0x48')]()[_0x3a99('0x23')](respondWithResult(_0x494dcd,null))[_0x3a99('0x3f')](handleError(_0x494dcd,null));}; \ No newline at end of file +var _0xd56c=['send','index','map','OpenchannelQueueReport','rawAttributes','type','key','name','keys','intersection','model','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','includeAll','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','save','destroy','then','end','sendStatus','stack'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd56c,0x6b));var _0xcd56=function(_0x32631a,_0x51aa9b){_0x32631a=_0x32631a-0x0;var _0x3973a1=_0xd56c[_0x32631a];return _0x3973a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd56('0x0'));var zipdir=require(_0xcd56('0x1'));var jsonpatch=require(_0xcd56('0x2'));var rp=require('request-promise');var moment=require(_0xcd56('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcd56('0x4'));var util=require(_0xcd56('0x5'));var path=require(_0xcd56('0x6'));var sox=require('sox');var csv=require(_0xcd56('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd56('0x8'));var _=require(_0xcd56('0x9'));var squel=require('squel');var crypto=require(_0xcd56('0xa'));var jsforce=require(_0xcd56('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd56('0xc'));var Redis=require(_0xcd56('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcd56('0xe'));var as=require(_0xcd56('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd56('0x10'))(_0xcd56('0x11'));var utils=require(_0xcd56('0x12'));var config=require(_0xcd56('0x13'));var licenseUtil=require(_0xcd56('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5408aa,_0x6efdcf){_0x6efdcf=_0x6efdcf||0xcc;return function(_0x44f8c4){if(_0x44f8c4){return _0x5408aa['sendStatus'](_0x6efdcf);}return _0x5408aa['status'](_0x6efdcf)['end']();};}function respondWithResult(_0xb9dff1,_0x27e771){_0x27e771=_0x27e771||0xc8;return function(_0x4abd97){if(_0x4abd97){return _0xb9dff1[_0xcd56('0x15')](_0x27e771)[_0xcd56('0x16')](_0x4abd97);}};}function respondWithFilteredResult(_0x1c5257,_0x893c6d){return function(_0x1568d5){if(_0x1568d5){var _0x114c02=typeof _0x893c6d[_0xcd56('0x17')]==='undefined'&&typeof _0x893c6d[_0xcd56('0x18')]===_0xcd56('0x19');var _0x524ef6=_0x1568d5[_0xcd56('0x1a')];var _0x42585b=_0x114c02?0x0:_0x893c6d[_0xcd56('0x17')];var _0x5c2f80=_0x114c02?_0x1568d5[_0xcd56('0x1a')]:_0x893c6d['offset']+_0x893c6d[_0xcd56('0x18')];var _0x17f540;if(_0x5c2f80>=_0x524ef6){_0x5c2f80=_0x524ef6;_0x17f540=0xc8;}else{_0x17f540=0xce;}_0x1c5257['status'](_0x17f540);return _0x1c5257[_0xcd56('0x1b')]('Content-Range',_0x42585b+'-'+_0x5c2f80+'/'+_0x524ef6)[_0xcd56('0x16')](_0x1568d5);}return null;};}function patchUpdates(_0xd9de35){return function(_0x1108e8){try{jsonpatch[_0xcd56('0x1c')](_0x1108e8,_0xd9de35,!![]);}catch(_0x53c22c){return BPromise['reject'](_0x53c22c);}return _0x1108e8[_0xcd56('0x1d')]();};}function saveUpdates(_0x4e4ce0,_0x2d2531){return function(_0x37101a){if(_0x37101a){return _0x37101a['update'](_0x4e4ce0)['then'](function(_0x1181cf){return _0x1181cf;});}return null;};}function removeEntity(_0x29d68a,_0x3680f7){return function(_0x5a26fe){if(_0x5a26fe){return _0x5a26fe[_0xcd56('0x1e')]()[_0xcd56('0x1f')](function(){_0x29d68a[_0xcd56('0x15')](0xcc)[_0xcd56('0x20')]();});}};}function handleEntityNotFound(_0x40dde2,_0x1173d6){return function(_0x465e50){if(!_0x465e50){_0x40dde2[_0xcd56('0x21')](0x194);}return _0x465e50;};}function handleError(_0x45dd71,_0x451e20){_0x451e20=_0x451e20||0x1f4;return function(_0x3d952a){logger['error'](_0x3d952a[_0xcd56('0x22')]);if(_0x3d952a['name']){delete _0x3d952a['name'];}_0x45dd71[_0xcd56('0x15')](_0x451e20)[_0xcd56('0x23')](_0x3d952a);};}exports[_0xcd56('0x24')]=function(_0x59a335,_0x5423ed){var _0x4d38df={},_0x3201a3={},_0x5804d9={'count':0x0,'rows':[]};var _0x1f5267=_[_0xcd56('0x25')](db[_0xcd56('0x26')][_0xcd56('0x27')],function(_0x2e4d07){return{'name':_0x2e4d07['fieldName'],'type':_0x2e4d07[_0xcd56('0x28')][_0xcd56('0x29')]};});_0x3201a3['model']=_['map'](_0x1f5267,_0xcd56('0x2a'));_0x3201a3['query']=_[_0xcd56('0x2b')](_0x59a335['query']);_0x3201a3['filters']=_[_0xcd56('0x2c')](_0x3201a3[_0xcd56('0x2d')],_0x3201a3['query']);_0x4d38df['attributes']=_[_0xcd56('0x2c')](_0x3201a3[_0xcd56('0x2d')],qs[_0xcd56('0x2e')](_0x59a335[_0xcd56('0x2f')][_0xcd56('0x2e')]));_0x4d38df['attributes']=_0x4d38df[_0xcd56('0x30')][_0xcd56('0x31')]?_0x4d38df[_0xcd56('0x30')]:_0x3201a3[_0xcd56('0x2d')];if(!_0x59a335[_0xcd56('0x2f')][_0xcd56('0x32')](_0xcd56('0x33'))){_0x4d38df[_0xcd56('0x18')]=qs[_0xcd56('0x18')](_0x59a335[_0xcd56('0x2f')][_0xcd56('0x18')]);_0x4d38df['offset']=qs['offset'](_0x59a335[_0xcd56('0x2f')][_0xcd56('0x17')]);}_0x4d38df[_0xcd56('0x34')]=qs[_0xcd56('0x35')](_0x59a335[_0xcd56('0x2f')][_0xcd56('0x35')]);_0x4d38df[_0xcd56('0x36')]=qs[_0xcd56('0x37')](_[_0xcd56('0x38')](_0x59a335[_0xcd56('0x2f')],_0x3201a3[_0xcd56('0x37')]),_0x1f5267);if(_0x59a335['query'][_0xcd56('0x39')]){_0x4d38df[_0xcd56('0x36')]=_[_0xcd56('0x3a')](_0x4d38df['where'],{'$or':_[_0xcd56('0x25')](_0x1f5267,function(_0x506b7f){if(_0x506b7f[_0xcd56('0x28')]!=='VIRTUAL'){var _0x5248c4={};_0x5248c4[_0x506b7f[_0xcd56('0x2a')]]={'$like':'%'+_0x59a335[_0xcd56('0x2f')]['filter']+'%'};return _0x5248c4;}})});}_0x4d38df=_[_0xcd56('0x3a')]({},_0x4d38df,_0x59a335[_0xcd56('0x3b')]);var _0x59b599={'where':_0x4d38df[_0xcd56('0x36')]};return db[_0xcd56('0x26')][_0xcd56('0x1a')](_0x59b599)[_0xcd56('0x1f')](function(_0x135b57){_0x5804d9[_0xcd56('0x1a')]=_0x135b57;if(_0x59a335[_0xcd56('0x2f')]['includeAll']){_0x4d38df[_0xcd56('0x3c')]=[{'all':!![]}];}return db[_0xcd56('0x26')][_0xcd56('0x3d')](_0x4d38df);})['then'](function(_0x56056d){_0x5804d9[_0xcd56('0x3e')]=_0x56056d;return _0x5804d9;})[_0xcd56('0x1f')](respondWithFilteredResult(_0x5423ed,_0x4d38df))['catch'](handleError(_0x5423ed,null));};exports[_0xcd56('0x3f')]=function(_0x564318,_0x58783c){var _0x44a114={'raw':!![],'where':{'id':_0x564318['params']['id']}},_0x43e7f1={};_0x43e7f1['model']=_[_0xcd56('0x2b')](db[_0xcd56('0x26')]['rawAttributes']);_0x43e7f1[_0xcd56('0x2f')]=_[_0xcd56('0x2b')](_0x564318[_0xcd56('0x2f')]);_0x43e7f1[_0xcd56('0x37')]=_['intersection'](_0x43e7f1[_0xcd56('0x2d')],_0x43e7f1['query']);_0x44a114[_0xcd56('0x30')]=_[_0xcd56('0x2c')](_0x43e7f1['model'],qs[_0xcd56('0x2e')](_0x564318['query'][_0xcd56('0x2e')]));_0x44a114[_0xcd56('0x30')]=_0x44a114[_0xcd56('0x30')][_0xcd56('0x31')]?_0x44a114[_0xcd56('0x30')]:_0x43e7f1[_0xcd56('0x2d')];if(_0x564318[_0xcd56('0x2f')][_0xcd56('0x40')]){_0x44a114[_0xcd56('0x3c')]=[{'all':!![]}];}_0x44a114=_[_0xcd56('0x3a')]({},_0x44a114,_0x564318[_0xcd56('0x3b')]);return db[_0xcd56('0x26')][_0xcd56('0x41')](_0x44a114)[_0xcd56('0x1f')](handleEntityNotFound(_0x58783c,null))[_0xcd56('0x1f')](respondWithResult(_0x58783c,null))[_0xcd56('0x42')](handleError(_0x58783c,null));};exports[_0xcd56('0x43')]=function(_0xf7f154,_0x1bf8ed){return db[_0xcd56('0x26')]['create'](_0xf7f154[_0xcd56('0x44')],{})['then'](respondWithResult(_0x1bf8ed,0xc9))['catch'](handleError(_0x1bf8ed,null));};exports[_0xcd56('0x45')]=function(_0x421466,_0x5bdc0c){if(_0x421466['body']['id']){delete _0x421466[_0xcd56('0x44')]['id'];}return db[_0xcd56('0x26')]['find']({'where':{'id':_0x421466['params']['id']}})[_0xcd56('0x1f')](handleEntityNotFound(_0x5bdc0c,null))[_0xcd56('0x1f')](saveUpdates(_0x421466['body'],null))['then'](respondWithResult(_0x5bdc0c,null))['catch'](handleError(_0x5bdc0c,null));};exports[_0xcd56('0x1e')]=function(_0x4fbdb7,_0xe9e306){return db[_0xcd56('0x26')][_0xcd56('0x41')]({'where':{'id':_0x4fbdb7['params']['id']}})[_0xcd56('0x1f')](handleEntityNotFound(_0xe9e306,null))[_0xcd56('0x1f')](removeEntity(_0xe9e306,null))[_0xcd56('0x42')](handleError(_0xe9e306,null));};exports['describe']=function(_0x5c9038,_0xab6abd){return db[_0xcd56('0x26')][_0xcd56('0x46')]()[_0xcd56('0x1f')](respondWithResult(_0xab6abd,null))[_0xcd56('0x42')](handleError(_0xab6abd,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ea16bc8..083ff3b 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x1d0c0f,_0xaeaf3b){var _0x55a52a=function(_0x11bd39){while(--_0x11bd39){_0x1d0c0f['push'](_0x1d0c0f['shift']());}};_0x55a52a(++_0xaeaf3b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x5fc3[_0x4d7116];return _0x4593dc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x2d12fe,_0x2f641c){var _0x392414=function(_0x581caf){while(--_0x581caf){_0x2d12fe['push'](_0x2d12fe['shift']());}};_0x392414(++_0x2f641c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0x5fc3[_0x4b784d];return _0x2cdeaf;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 99dd0da..a9fa9d3 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 _0x253d=['lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','result','OpenchannelQueueReport,\x20%s,\x20%s','CreateOpenchannelQueueReport','create','options','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body','limit'];(function(_0x2b0307,_0x5718e3){var _0x414b2f=function(_0x594a3c){while(--_0x594a3c){_0x2b0307['push'](_0x2b0307['shift']());}};_0x414b2f(++_0x5718e3);}(_0x253d,0x1b3));var _0xd253=function(_0x37fa02,_0x5bd5e1){_0x37fa02=_0x37fa02-0x0;var _0x318956=_0x253d[_0x37fa02];return _0x318956;};'use strict';var _=require(_0xd253('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd253('0x1'));var db=require(_0xd253('0x2'))['db'];var utils=require(_0xd253('0x3'));var logger=require(_0xd253('0x4'))(_0xd253('0x5'));var config=require('../../config/environment');var jayson=require(_0xd253('0x6'));var client=jayson[_0xd253('0x7')][_0xd253('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17589a,_0xf4b457,_0x487f4e){return new BPromise(function(_0x2c4de4,_0x712c81){return client[_0xd253('0x9')](_0x17589a,_0x487f4e)[_0xd253('0xa')](function(_0x351047){logger[_0xd253('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,'request\x20sent');logger[_0xd253('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'),JSON[_0xd253('0xe')](_0x351047));if(_0x351047[_0xd253('0xf')]){if(_0x351047[_0xd253('0xf')][_0xd253('0x10')]===0x1f4){logger[_0xd253('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,_0x351047['error'][_0xd253('0x11')]);return _0x712c81(_0x351047[_0xd253('0xf')][_0xd253('0x11')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,_0x351047[_0xd253('0xf')][_0xd253('0x11')]);return _0x2c4de4(_0x351047[_0xd253('0xf')]['message']);}else{logger[_0xd253('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'));_0x2c4de4(_0x351047[_0xd253('0x12')][_0xd253('0x11')]);}})['catch'](function(_0x1b7ed1){logger['error'](_0xd253('0x13'),_0xf4b457,_0x1b7ed1);_0x712c81(_0x1b7ed1);});});}exports[_0xd253('0x14')]=function(_0x5e4051){var _0x2496cb=this;return new Promise(function(_0x2a2adc,_0x5b24ff){return db['OpenchannelQueueReport'][_0xd253('0x15')](_0x5e4051['body'],{'raw':_0x5e4051['options']?_0x5e4051[_0xd253('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd253('0xa')](function(_0x1e48c3){logger[_0xd253('0xb')](_0xd253('0x14'),_0x5e4051);logger['debug'](_0xd253('0x14'),_0x5e4051,JSON['stringify'](_0x1e48c3));_0x2a2adc(_0x1e48c3);})[_0xd253('0x17')](function(_0x50f8b5){logger[_0xd253('0xf')](_0xd253('0x14'),_0x50f8b5[_0xd253('0x11')],_0x5e4051);_0x5b24ff(_0x2496cb[_0xd253('0xf')](0x1f4,_0x50f8b5['message']));});});};exports[_0xd253('0x18')]=function(_0x34d98d){var _0x585c14=this;return new Promise(function(_0x27b0a1,_0x434be5){return db[_0xd253('0x19')][_0xd253('0x1a')](_0x34d98d[_0xd253('0x1b')],{'raw':_0x34d98d[_0xd253('0x16')]?_0x34d98d[_0xd253('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d98d[_0xd253('0x16')]?_0x34d98d['options']['where']||null:null,'attributes':_0x34d98d[_0xd253('0x16')]?_0x34d98d[_0xd253('0x16')]['attributes']||null:null,'limit':_0x34d98d['options']?_0x34d98d[_0xd253('0x16')][_0xd253('0x1c')]||null:null})['then'](function(_0x3955a0){logger[_0xd253('0xb')](_0xd253('0x18'),_0x34d98d);logger[_0xd253('0xc')](_0xd253('0x18'),_0x34d98d,JSON['stringify'](_0x3955a0));_0x27b0a1(_0x3955a0);})[_0xd253('0x17')](function(_0x31a217){logger[_0xd253('0xf')]('UpdateOpenchannelQueueReport',_0x31a217[_0xd253('0x11')],_0x34d98d);_0x434be5(_0x585c14['error'](0x1f4,_0x31a217[_0xd253('0x11')]));});});}; \ No newline at end of file +var _0xe2cf=['debug','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','info','UpdateOpenchannelQueueReport','update','where','attributes','limit'];(function(_0x5eeaff,_0x4090dd){var _0x4b3c5c=function(_0x36f83c){while(--_0x36f83c){_0x5eeaff['push'](_0x5eeaff['shift']());}};_0x4b3c5c(++_0x4090dd);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x16169b,_0x1fe209){_0x16169b=_0x16169b-0x0;var _0x7a7d78=_0xe2cf[_0x16169b];return _0x7a7d78;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}exports[_0xfe2c('0x13')]=function(_0x23242b){var _0x36aeec=this;return new Promise(function(_0x13f233,_0x4afea3){return db[_0xfe2c('0x14')][_0xfe2c('0x15')](_0x23242b[_0xfe2c('0x16')],{'raw':_0x23242b[_0xfe2c('0x17')]?_0x23242b['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4e9137){logger[_0xfe2c('0x19')](_0xfe2c('0x13'),_0x23242b);logger['debug'](_0xfe2c('0x13'),_0x23242b,JSON[_0xfe2c('0xd')](_0x4e9137));_0x13f233(_0x4e9137);})['catch'](function(_0x1bd50e){logger['error'](_0xfe2c('0x13'),_0x1bd50e[_0xfe2c('0x10')],_0x23242b);_0x4afea3(_0x36aeec[_0xfe2c('0xe')](0x1f4,_0x1bd50e[_0xfe2c('0x10')]));});});};exports[_0xfe2c('0x1a')]=function(_0x2ee3b3){var _0x57cd6d=this;return new Promise(function(_0x41a545,_0x45a722){return db[_0xfe2c('0x14')][_0xfe2c('0x1b')](_0x2ee3b3[_0xfe2c('0x16')],{'raw':_0x2ee3b3[_0xfe2c('0x17')]?_0x2ee3b3['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee3b3['options']?_0x2ee3b3[_0xfe2c('0x17')][_0xfe2c('0x1c')]||null:null,'attributes':_0x2ee3b3[_0xfe2c('0x17')]?_0x2ee3b3['options'][_0xfe2c('0x1d')]||null:null,'limit':_0x2ee3b3[_0xfe2c('0x17')]?_0x2ee3b3['options'][_0xfe2c('0x1e')]||null:null})[_0xfe2c('0x9')](function(_0x3352e8){logger[_0xfe2c('0x19')](_0xfe2c('0x1a'),_0x2ee3b3);logger[_0xfe2c('0x1f')]('UpdateOpenchannelQueueReport',_0x2ee3b3,JSON['stringify'](_0x3352e8));_0x41a545(_0x3352e8);})[_0xfe2c('0x12')](function(_0x13e9a9){logger[_0xfe2c('0xe')](_0xfe2c('0x1a'),_0x13e9a9[_0xfe2c('0x10')],_0x2ee3b3);_0x45a722(_0x57cd6d['error'](0x1f4,_0x13e9a9[_0xfe2c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1a52759..0aa833c 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 _0xaef0=['put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0xaef0,0x147));var _0x0aef=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xaef0[_0x5c6299];return _0x23b564;};'use strict';var multer=require(_0x0aef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0aef('0x1'));var express=require(_0x0aef('0x2'));var router=express[_0x0aef('0x3')]();var fs_extra=require(_0x0aef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0aef('0x5'));var config=require(_0x0aef('0x6'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x0aef('0x7')](),controller[_0x0aef('0x8')]);router[_0x0aef('0x9')](_0x0aef('0xa'),auth[_0x0aef('0x7')](),controller[_0x0aef('0xb')]);router[_0x0aef('0x9')](_0x0aef('0xc'),auth['isAuthenticated'](),controller[_0x0aef('0xd')]);router[_0x0aef('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0aef('0xf')](_0x0aef('0xc'),auth[_0x0aef('0x7')](),controller['update']);router[_0x0aef('0x10')](_0x0aef('0xc'),auth['isAuthenticated'](),controller[_0x0aef('0x11')]);module['exports']=router; \ No newline at end of file +var _0xeb35=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0xa09242,_0x13dfdc){var _0x411cd0=function(_0x88dbe4){while(--_0x88dbe4){_0xa09242['push'](_0xa09242['shift']());}};_0x411cd0(++_0x13dfdc);}(_0xeb35,0x6f));var _0x5eb3=function(_0x583935,_0x1ed28b){_0x583935=_0x583935-0x0;var _0x1384d8=_0xeb35[_0x583935];return _0x1384d8;};'use strict';var multer=require(_0x5eb3('0x0'));var util=require(_0x5eb3('0x1'));var path=require('path');var timeout=require(_0x5eb3('0x2'));var express=require(_0x5eb3('0x3'));var router=express['Router']();var fs_extra=require(_0x5eb3('0x4'));var auth=require(_0x5eb3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5eb3('0x6'));var controller=require(_0x5eb3('0x7'));router[_0x5eb3('0x8')]('/',auth[_0x5eb3('0x9')](),controller[_0x5eb3('0xa')]);router[_0x5eb3('0x8')](_0x5eb3('0xb'),auth[_0x5eb3('0x9')](),controller[_0x5eb3('0xc')]);router[_0x5eb3('0x8')](_0x5eb3('0xd'),auth[_0x5eb3('0x9')](),controller[_0x5eb3('0xe')]);router[_0x5eb3('0xf')]('/',auth[_0x5eb3('0x9')](),controller[_0x5eb3('0x10')]);router[_0x5eb3('0x11')](_0x5eb3('0xd'),auth[_0x5eb3('0x9')](),controller[_0x5eb3('0x12')]);router[_0x5eb3('0x13')](_0x5eb3('0xd'),auth[_0x5eb3('0x9')](),controller[_0x5eb3('0x14')]);module[_0x5eb3('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4c3a65f..b27c748 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xe9c8e4,_0x3aa2f6){var _0x2037fa=function(_0xcb43b1){while(--_0xcb43b1){_0xe9c8e4['push'](_0xe9c8e4['shift']());}};_0x2037fa(++_0x3aa2f6);}(_0x54ef,0x112));var _0xf54e=function(_0x43558b,_0xfe9dd0){_0x43558b=_0x43558b-0x0;var _0x32afe4=_0x54ef[_0x43558b];return _0x32afe4;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x24b532,_0x275e05){var _0x5f5d2c=function(_0x43d620){while(--_0x43d620){_0x24b532['push'](_0x24b532['shift']());}};_0x5f5d2c(++_0x275e05);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 690fcf5..969f5d9 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 _0x6137=['eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','count','offset','set','json','apply','reject','update','then','destroy','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','OpenchannelTransferReport','includeAll','include','rows','catch','show','params','options','body','find','describe'];(function(_0x47613c,_0x3c0c75){var _0x2ff301=function(_0x2c1630){while(--_0x2c1630){_0x47613c['push'](_0x47613c['shift']());}};_0x2ff301(++_0x3c0c75);}(_0x6137,0x1d5));var _0x7613=function(_0x3eecdc,_0x136fd1){_0x3eecdc=_0x3eecdc-0x0;var _0x56a550=_0x6137[_0x3eecdc];return _0x56a550;};'use strict';var emlformat=require(_0x7613('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7613('0x1'));var moment=require(_0x7613('0x2'));var BPromise=require(_0x7613('0x3'));var Mustache=require(_0x7613('0x4'));var util=require(_0x7613('0x5'));var path=require(_0x7613('0x6'));var sox=require(_0x7613('0x7'));var csv=require(_0x7613('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7613('0x9'));var _=require(_0x7613('0xa'));var squel=require('squel');var crypto=require(_0x7613('0xb'));var jsforce=require(_0x7613('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7613('0x8'));var querystring=require('querystring');var Papa=require(_0x7613('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7613('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7613('0xf'))(_0x7613('0x10'));var utils=require(_0x7613('0x11'));var config=require(_0x7613('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7613('0x13'))['db'];function respondWithStatusCode(_0x26bf68,_0x3bd536){_0x3bd536=_0x3bd536||0xcc;return function(_0xcf38ad){if(_0xcf38ad){return _0x26bf68[_0x7613('0x14')](_0x3bd536);}return _0x26bf68['status'](_0x3bd536)[_0x7613('0x15')]();};}function respondWithResult(_0x5da68b,_0x41f112){_0x41f112=_0x41f112||0xc8;return function(_0x3bb32c){if(_0x3bb32c){return _0x5da68b[_0x7613('0x16')](_0x41f112)['json'](_0x3bb32c);}};}function respondWithFilteredResult(_0x9eff65,_0x378992){return function(_0x4d7fc7){if(_0x4d7fc7){var _0x242ca3=typeof _0x378992['offset']==='undefined'&&typeof _0x378992[_0x7613('0x17')]==='undefined';var _0xef896=_0x4d7fc7[_0x7613('0x18')];var _0x379f52=_0x242ca3?0x0:_0x378992[_0x7613('0x19')];var _0xd94104=_0x242ca3?_0x4d7fc7[_0x7613('0x18')]:_0x378992[_0x7613('0x19')]+_0x378992[_0x7613('0x17')];var _0x250a07;if(_0xd94104>=_0xef896){_0xd94104=_0xef896;_0x250a07=0xc8;}else{_0x250a07=0xce;}_0x9eff65[_0x7613('0x16')](_0x250a07);return _0x9eff65[_0x7613('0x1a')]('Content-Range',_0x379f52+'-'+_0xd94104+'/'+_0xef896)[_0x7613('0x1b')](_0x4d7fc7);}return null;};}function patchUpdates(_0xc67e33){return function(_0x3245f2){try{jsonpatch[_0x7613('0x1c')](_0x3245f2,_0xc67e33,!![]);}catch(_0x3cc67f){return BPromise[_0x7613('0x1d')](_0x3cc67f);}return _0x3245f2['save']();};}function saveUpdates(_0x3ac31e,_0x2a41c6){return function(_0x5e04db){if(_0x5e04db){return _0x5e04db[_0x7613('0x1e')](_0x3ac31e)[_0x7613('0x1f')](function(_0xfa1a34){return _0xfa1a34;});}return null;};}function removeEntity(_0x3834c3,_0x56c27d){return function(_0x1b6ad5){if(_0x1b6ad5){return _0x1b6ad5[_0x7613('0x20')]()['then'](function(){_0x3834c3[_0x7613('0x16')](0xcc)[_0x7613('0x15')]();});}};}function handleEntityNotFound(_0x321404,_0x538e12){return function(_0x244c20){if(!_0x244c20){_0x321404[_0x7613('0x14')](0x194);}return _0x244c20;};}function handleError(_0x3f2bba,_0x5ecfd9){_0x5ecfd9=_0x5ecfd9||0x1f4;return function(_0x5f5c3a){logger[_0x7613('0x21')](_0x5f5c3a[_0x7613('0x22')]);if(_0x5f5c3a[_0x7613('0x23')]){delete _0x5f5c3a[_0x7613('0x23')];}_0x3f2bba[_0x7613('0x16')](_0x5ecfd9)[_0x7613('0x24')](_0x5f5c3a);};}exports['index']=function(_0x340191,_0x268586){var _0x348301={},_0x1678b7={},_0x3d33b1={'count':0x0,'rows':[]};var _0x4651c6=_[_0x7613('0x25')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x5cb758){return{'name':_0x5cb758[_0x7613('0x26')],'type':_0x5cb758['type'][_0x7613('0x27')]};});_0x1678b7[_0x7613('0x28')]=_[_0x7613('0x25')](_0x4651c6,_0x7613('0x23'));_0x1678b7[_0x7613('0x29')]=_[_0x7613('0x2a')](_0x340191[_0x7613('0x29')]);_0x1678b7[_0x7613('0x2b')]=_[_0x7613('0x2c')](_0x1678b7[_0x7613('0x28')],_0x1678b7[_0x7613('0x29')]);_0x348301[_0x7613('0x2d')]=_['intersection'](_0x1678b7[_0x7613('0x28')],qs[_0x7613('0x2e')](_0x340191['query'][_0x7613('0x2e')]));_0x348301[_0x7613('0x2d')]=_0x348301['attributes'][_0x7613('0x2f')]?_0x348301[_0x7613('0x2d')]:_0x1678b7['model'];if(!_0x340191[_0x7613('0x29')][_0x7613('0x30')]('nolimit')){_0x348301[_0x7613('0x17')]=qs[_0x7613('0x17')](_0x340191[_0x7613('0x29')]['limit']);_0x348301['offset']=qs['offset'](_0x340191[_0x7613('0x29')][_0x7613('0x19')]);}_0x348301['order']=qs[_0x7613('0x31')](_0x340191[_0x7613('0x29')][_0x7613('0x31')]);_0x348301[_0x7613('0x32')]=qs[_0x7613('0x2b')](_[_0x7613('0x33')](_0x340191[_0x7613('0x29')],_0x1678b7[_0x7613('0x2b')]),_0x4651c6);if(_0x340191[_0x7613('0x29')][_0x7613('0x34')]){_0x348301[_0x7613('0x32')]=_[_0x7613('0x35')](_0x348301[_0x7613('0x32')],{'$or':_[_0x7613('0x25')](_0x4651c6,function(_0x1344f2){if(_0x1344f2[_0x7613('0x36')]!==_0x7613('0x37')){var _0x202a0a={};_0x202a0a[_0x1344f2[_0x7613('0x23')]]={'$like':'%'+_0x340191[_0x7613('0x29')]['filter']+'%'};return _0x202a0a;}})});}_0x348301=_['merge']({},_0x348301,_0x340191['options']);var _0x3d28aa={'where':_0x348301['where']};return db[_0x7613('0x38')]['count'](_0x3d28aa)[_0x7613('0x1f')](function(_0x4897ef){_0x3d33b1[_0x7613('0x18')]=_0x4897ef;if(_0x340191[_0x7613('0x29')][_0x7613('0x39')]){_0x348301[_0x7613('0x3a')]=[{'all':!![]}];}return db[_0x7613('0x38')]['findAll'](_0x348301);})['then'](function(_0x3fe9bd){_0x3d33b1[_0x7613('0x3b')]=_0x3fe9bd;return _0x3d33b1;})['then'](respondWithFilteredResult(_0x268586,_0x348301))[_0x7613('0x3c')](handleError(_0x268586,null));};exports[_0x7613('0x3d')]=function(_0x2ca94d,_0xcdbcde){var _0x14b248={'raw':!![],'where':{'id':_0x2ca94d[_0x7613('0x3e')]['id']}},_0x7faaea={};_0x7faaea[_0x7613('0x28')]=_[_0x7613('0x2a')](db[_0x7613('0x38')]['rawAttributes']);_0x7faaea['query']=_[_0x7613('0x2a')](_0x2ca94d[_0x7613('0x29')]);_0x7faaea['filters']=_[_0x7613('0x2c')](_0x7faaea[_0x7613('0x28')],_0x7faaea['query']);_0x14b248[_0x7613('0x2d')]=_['intersection'](_0x7faaea[_0x7613('0x28')],qs[_0x7613('0x2e')](_0x2ca94d[_0x7613('0x29')]['fields']));_0x14b248[_0x7613('0x2d')]=_0x14b248[_0x7613('0x2d')]['length']?_0x14b248[_0x7613('0x2d')]:_0x7faaea['model'];if(_0x2ca94d['query'][_0x7613('0x39')]){_0x14b248[_0x7613('0x3a')]=[{'all':!![]}];}_0x14b248=_['merge']({},_0x14b248,_0x2ca94d[_0x7613('0x3f')]);return db[_0x7613('0x38')]['find'](_0x14b248)['then'](handleEntityNotFound(_0xcdbcde,null))[_0x7613('0x1f')](respondWithResult(_0xcdbcde,null))[_0x7613('0x3c')](handleError(_0xcdbcde,null));};exports['create']=function(_0xf7f2f1,_0x24517e){return db['OpenchannelTransferReport']['create'](_0xf7f2f1[_0x7613('0x40')],{})[_0x7613('0x1f')](respondWithResult(_0x24517e,0xc9))['catch'](handleError(_0x24517e,null));};exports[_0x7613('0x1e')]=function(_0x202b45,_0x71f37d){if(_0x202b45[_0x7613('0x40')]['id']){delete _0x202b45[_0x7613('0x40')]['id'];}return db[_0x7613('0x38')][_0x7613('0x41')]({'where':{'id':_0x202b45['params']['id']}})[_0x7613('0x1f')](handleEntityNotFound(_0x71f37d,null))[_0x7613('0x1f')](saveUpdates(_0x202b45[_0x7613('0x40')],null))['then'](respondWithResult(_0x71f37d,null))[_0x7613('0x3c')](handleError(_0x71f37d,null));};exports['destroy']=function(_0x2103c6,_0x85edd0){return db[_0x7613('0x38')][_0x7613('0x41')]({'where':{'id':_0x2103c6[_0x7613('0x3e')]['id']}})[_0x7613('0x1f')](handleEntityNotFound(_0x85edd0,null))['then'](removeEntity(_0x85edd0,null))[_0x7613('0x3c')](handleError(_0x85edd0,null));};exports[_0x7613('0x42')]=function(_0x5ae4e9,_0x48452c){return db[_0x7613('0x38')][_0x7613('0x42')]()[_0x7613('0x1f')](respondWithResult(_0x48452c,null))[_0x7613('0x3c')](handleError(_0x48452c,null));}; \ No newline at end of file +var _0x7114=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse'];(function(_0x587f2a,_0xf47df8){var _0x1c89f2=function(_0x37a261){while(--_0x37a261){_0x587f2a['push'](_0x587f2a['shift']());}};_0x1c89f2(++_0xf47df8);}(_0x7114,0xd1));var _0x4711=function(_0x118fad,_0x4a7930){_0x118fad=_0x118fad-0x0;var _0x4f48fe=_0x7114[_0x118fad];return _0x4f48fe;};'use strict';var emlformat=require(_0x4711('0x0'));var rimraf=require(_0x4711('0x1'));var zipdir=require(_0x4711('0x2'));var jsonpatch=require(_0x4711('0x3'));var rp=require(_0x4711('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4711('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4711('0x6'));var _=require(_0x4711('0x7'));var squel=require(_0x4711('0x8'));var crypto=require(_0x4711('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4711('0xa'));var toCsv=require(_0x4711('0xb'));var querystring=require('querystring');var Papa=require(_0x4711('0xc'));var Redis=require(_0x4711('0xd'));var authService=require(_0x4711('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4711('0xf'));var hardwareService=require(_0x4711('0x10'));var logger=require('../../config/logger')(_0x4711('0x11'));var utils=require(_0x4711('0x12'));var config=require(_0x4711('0x13'));var licenseUtil=require(_0x4711('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35efdd,_0xa63cad){_0xa63cad=_0xa63cad||0xcc;return function(_0x3275d1){if(_0x3275d1){return _0x35efdd[_0x4711('0x15')](_0xa63cad);}return _0x35efdd[_0x4711('0x16')](_0xa63cad)[_0x4711('0x17')]();};}function respondWithResult(_0x64a17b,_0x3d6813){_0x3d6813=_0x3d6813||0xc8;return function(_0x39fb90){if(_0x39fb90){return _0x64a17b[_0x4711('0x16')](_0x3d6813)[_0x4711('0x18')](_0x39fb90);}};}function respondWithFilteredResult(_0x4473b8,_0x3a4981){return function(_0x4ede31){if(_0x4ede31){var _0x71b871=typeof _0x3a4981['offset']==='undefined'&&typeof _0x3a4981[_0x4711('0x19')]===_0x4711('0x1a');var _0x385490=_0x4ede31[_0x4711('0x1b')];var _0x42b402=_0x71b871?0x0:_0x3a4981[_0x4711('0x1c')];var _0x9255f6=_0x71b871?_0x4ede31[_0x4711('0x1b')]:_0x3a4981[_0x4711('0x1c')]+_0x3a4981[_0x4711('0x19')];var _0x45209f;if(_0x9255f6>=_0x385490){_0x9255f6=_0x385490;_0x45209f=0xc8;}else{_0x45209f=0xce;}_0x4473b8['status'](_0x45209f);return _0x4473b8[_0x4711('0x1d')](_0x4711('0x1e'),_0x42b402+'-'+_0x9255f6+'/'+_0x385490)[_0x4711('0x18')](_0x4ede31);}return null;};}function patchUpdates(_0x1d4411){return function(_0xbc87df){try{jsonpatch[_0x4711('0x1f')](_0xbc87df,_0x1d4411,!![]);}catch(_0x5935a1){return BPromise[_0x4711('0x20')](_0x5935a1);}return _0xbc87df[_0x4711('0x21')]();};}function saveUpdates(_0x2083ae,_0x1fd26b){return function(_0x2f15e6){if(_0x2f15e6){return _0x2f15e6[_0x4711('0x22')](_0x2083ae)[_0x4711('0x23')](function(_0xffa81f){return _0xffa81f;});}return null;};}function removeEntity(_0x1b1f74,_0x3a9271){return function(_0x169241){if(_0x169241){return _0x169241['destroy']()[_0x4711('0x23')](function(){_0x1b1f74[_0x4711('0x16')](0xcc)[_0x4711('0x17')]();});}};}function handleEntityNotFound(_0x4cfc58,_0xd89acd){return function(_0x251796){if(!_0x251796){_0x4cfc58['sendStatus'](0x194);}return _0x251796;};}function handleError(_0x14fd7e,_0x4edf36){_0x4edf36=_0x4edf36||0x1f4;return function(_0x30c03e){logger[_0x4711('0x24')](_0x30c03e[_0x4711('0x25')]);if(_0x30c03e[_0x4711('0x26')]){delete _0x30c03e[_0x4711('0x26')];}_0x14fd7e[_0x4711('0x16')](_0x4edf36)['send'](_0x30c03e);};}exports['index']=function(_0x1d8e23,_0x4408bd){var _0x4b8b82={},_0x163fc6={},_0x2bd31d={'count':0x0,'rows':[]};var _0x348eb3=_[_0x4711('0x27')](db['OpenchannelTransferReport'][_0x4711('0x28')],function(_0x12564a){return{'name':_0x12564a[_0x4711('0x29')],'type':_0x12564a[_0x4711('0x2a')][_0x4711('0x2b')]};});_0x163fc6[_0x4711('0x2c')]=_['map'](_0x348eb3,_0x4711('0x26'));_0x163fc6['query']=_[_0x4711('0x2d')](_0x1d8e23[_0x4711('0x2e')]);_0x163fc6[_0x4711('0x2f')]=_['intersection'](_0x163fc6[_0x4711('0x2c')],_0x163fc6[_0x4711('0x2e')]);_0x4b8b82[_0x4711('0x30')]=_[_0x4711('0x31')](_0x163fc6[_0x4711('0x2c')],qs[_0x4711('0x32')](_0x1d8e23['query'][_0x4711('0x32')]));_0x4b8b82[_0x4711('0x30')]=_0x4b8b82[_0x4711('0x30')][_0x4711('0x33')]?_0x4b8b82[_0x4711('0x30')]:_0x163fc6[_0x4711('0x2c')];if(!_0x1d8e23[_0x4711('0x2e')][_0x4711('0x34')]('nolimit')){_0x4b8b82[_0x4711('0x19')]=qs[_0x4711('0x19')](_0x1d8e23['query'][_0x4711('0x19')]);_0x4b8b82['offset']=qs[_0x4711('0x1c')](_0x1d8e23[_0x4711('0x2e')][_0x4711('0x1c')]);}_0x4b8b82[_0x4711('0x35')]=qs['sort'](_0x1d8e23['query'][_0x4711('0x36')]);_0x4b8b82['where']=qs[_0x4711('0x2f')](_[_0x4711('0x37')](_0x1d8e23[_0x4711('0x2e')],_0x163fc6[_0x4711('0x2f')]),_0x348eb3);if(_0x1d8e23[_0x4711('0x2e')]['filter']){_0x4b8b82[_0x4711('0x38')]=_[_0x4711('0x39')](_0x4b8b82['where'],{'$or':_[_0x4711('0x27')](_0x348eb3,function(_0x513977){if(_0x513977[_0x4711('0x2a')]!==_0x4711('0x3a')){var _0x3a2ded={};_0x3a2ded[_0x513977[_0x4711('0x26')]]={'$like':'%'+_0x1d8e23['query'][_0x4711('0x3b')]+'%'};return _0x3a2ded;}})});}_0x4b8b82=_[_0x4711('0x39')]({},_0x4b8b82,_0x1d8e23[_0x4711('0x3c')]);var _0x1062b7={'where':_0x4b8b82[_0x4711('0x38')]};return db[_0x4711('0x3d')]['count'](_0x1062b7)[_0x4711('0x23')](function(_0x504824){_0x2bd31d[_0x4711('0x1b')]=_0x504824;if(_0x1d8e23[_0x4711('0x2e')][_0x4711('0x3e')]){_0x4b8b82[_0x4711('0x3f')]=[{'all':!![]}];}return db[_0x4711('0x3d')][_0x4711('0x40')](_0x4b8b82);})['then'](function(_0x1c2cd9){_0x2bd31d[_0x4711('0x41')]=_0x1c2cd9;return _0x2bd31d;})[_0x4711('0x23')](respondWithFilteredResult(_0x4408bd,_0x4b8b82))[_0x4711('0x42')](handleError(_0x4408bd,null));};exports[_0x4711('0x43')]=function(_0x2c4546,_0x381481){var _0x4ebc50={'raw':!![],'where':{'id':_0x2c4546['params']['id']}},_0x14c045={};_0x14c045[_0x4711('0x2c')]=_[_0x4711('0x2d')](db['OpenchannelTransferReport'][_0x4711('0x28')]);_0x14c045[_0x4711('0x2e')]=_['keys'](_0x2c4546['query']);_0x14c045[_0x4711('0x2f')]=_['intersection'](_0x14c045[_0x4711('0x2c')],_0x14c045[_0x4711('0x2e')]);_0x4ebc50[_0x4711('0x30')]=_['intersection'](_0x14c045[_0x4711('0x2c')],qs[_0x4711('0x32')](_0x2c4546['query'][_0x4711('0x32')]));_0x4ebc50['attributes']=_0x4ebc50[_0x4711('0x30')]['length']?_0x4ebc50['attributes']:_0x14c045[_0x4711('0x2c')];if(_0x2c4546['query'][_0x4711('0x3e')]){_0x4ebc50[_0x4711('0x3f')]=[{'all':!![]}];}_0x4ebc50=_[_0x4711('0x39')]({},_0x4ebc50,_0x2c4546[_0x4711('0x3c')]);return db[_0x4711('0x3d')][_0x4711('0x44')](_0x4ebc50)['then'](handleEntityNotFound(_0x381481,null))[_0x4711('0x23')](respondWithResult(_0x381481,null))[_0x4711('0x42')](handleError(_0x381481,null));};exports[_0x4711('0x45')]=function(_0x4495bb,_0x3c702c){return db[_0x4711('0x3d')][_0x4711('0x45')](_0x4495bb[_0x4711('0x46')],{})[_0x4711('0x23')](respondWithResult(_0x3c702c,0xc9))[_0x4711('0x42')](handleError(_0x3c702c,null));};exports[_0x4711('0x22')]=function(_0x4d9354,_0x584577){if(_0x4d9354['body']['id']){delete _0x4d9354['body']['id'];}return db[_0x4711('0x3d')][_0x4711('0x44')]({'where':{'id':_0x4d9354[_0x4711('0x47')]['id']}})[_0x4711('0x23')](handleEntityNotFound(_0x584577,null))[_0x4711('0x23')](saveUpdates(_0x4d9354['body'],null))['then'](respondWithResult(_0x584577,null))[_0x4711('0x42')](handleError(_0x584577,null));};exports[_0x4711('0x48')]=function(_0x3885e8,_0x255026){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3885e8[_0x4711('0x47')]['id']}})[_0x4711('0x23')](handleEntityNotFound(_0x255026,null))[_0x4711('0x23')](removeEntity(_0x255026,null))[_0x4711('0x42')](handleError(_0x255026,null));};exports[_0x4711('0x49')]=function(_0x28bd4f,_0x54ba9e){return db['OpenchannelTransferReport'][_0x4711('0x49')]()[_0x4711('0x23')](respondWithResult(_0x54ba9e,null))[_0x4711('0x42')](handleError(_0x54ba9e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index aa0a0c5..1121dc8 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 _0xe410=['OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xe410,0x161));var _0x0e41=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0xe410[_0x4a0e68];return _0x4fb274;};'use strict';var _=require(_0x0e41('0x0'));var util=require(_0x0e41('0x1'));var logger=require(_0x0e41('0x2'))(_0x0e41('0x3'));var moment=require(_0x0e41('0x4'));var BPromise=require(_0x0e41('0x5'));var rp=require(_0x0e41('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0e41('0x7'));var attributes=require(_0x0e41('0x8'));module[_0x0e41('0x9')]=function(_0x3ca398,_0x3d9e02){return _0x3ca398[_0x0e41('0xa')](_0x0e41('0xb'),attributes,{'tableName':_0x0e41('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d05=['report_openchannel_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x1b5ae9,_0x5caf98){var _0x2a1876=function(_0x5cdbcb){while(--_0x5cdbcb){_0x1b5ae9['push'](_0x1b5ae9['shift']());}};_0x2a1876(++_0x5caf98);}(_0x1d05,0x178));var _0x51d0=function(_0x4b32d5,_0xd28713){_0x4b32d5=_0x4b32d5-0x0;var _0x1ab2b6=_0x1d05[_0x4b32d5];return _0x1ab2b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51d0('0x0'))(_0x51d0('0x1'));var moment=require('moment');var BPromise=require(_0x51d0('0x2'));var rp=require(_0x51d0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51d0('0x4'));var config=require(_0x51d0('0x5'));var attributes=require(_0x51d0('0x6'));module[_0x51d0('0x7')]=function(_0x5b91a6,_0x13abea){return _0x5b91a6[_0x51d0('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x51d0('0x9'),'paranoid':![],'indexes':[{'name':_0x51d0('0xa'),'fields':[_0x51d0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 85c9836..e3b2c47 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 _0x19da=['error','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x19da,0x9f));var _0xa19d=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x19da[_0x49d19d];return _0x4ebef1;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var moment=require('moment');var BPromise=require(_0xa19d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19d('0x2'));var db=require(_0xa19d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa19d('0x4'))(_0xa19d('0x5'));var config=require('../../config/environment');var jayson=require(_0xa19d('0x6'));var client=jayson[_0xa19d('0x7')][_0xa19d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14dc68,_0x32da37,_0x4b4627){return new BPromise(function(_0x197c4e,_0x4e6638){return client[_0xa19d('0x9')](_0x14dc68,_0x4b4627)[_0xa19d('0xa')](function(_0x538dea){logger['info'](_0xa19d('0xb'),_0x32da37,_0xa19d('0xc'));logger[_0xa19d('0xd')](_0xa19d('0xe'),_0x32da37,_0xa19d('0xc'),JSON[_0xa19d('0xf')](_0x538dea));if(_0x538dea['error']){if(_0x538dea['error'][_0xa19d('0x10')]===0x1f4){logger[_0xa19d('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x32da37,_0x538dea['error'][_0xa19d('0x12')]);return _0x4e6638(_0x538dea[_0xa19d('0x11')]['message']);}logger[_0xa19d('0x11')](_0xa19d('0xb'),_0x32da37,_0x538dea[_0xa19d('0x11')]['message']);return _0x197c4e(_0x538dea[_0xa19d('0x11')]['message']);}else{logger[_0xa19d('0x13')](_0xa19d('0xb'),_0x32da37,_0xa19d('0xc'));_0x197c4e(_0x538dea[_0xa19d('0x14')][_0xa19d('0x12')]);}})[_0xa19d('0x15')](function(_0x2f2774){logger[_0xa19d('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x32da37,_0x2f2774);_0x4e6638(_0x2f2774);});});} \ No newline at end of file +var _0xc474=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x1ffb2c,_0x458b6d){var _0x2e5c82=function(_0x21eda2){while(--_0x21eda2){_0x1ffb2c['push'](_0x1ffb2c['shift']());}};_0x2e5c82(++_0x458b6d);}(_0xc474,0xfc));var _0x4c47=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc474[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var moment=require(_0x4c47('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c47('0x3'));var fs=require('fs');var Redis=require(_0x4c47('0x4'));var db=require(_0x4c47('0x5'))['db'];var utils=require(_0x4c47('0x6'));var logger=require(_0x4c47('0x7'))(_0x4c47('0x8'));var config=require(_0x4c47('0x9'));var jayson=require(_0x4c47('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6aeef8,_0x255b6e,_0x275a64){return new BPromise(function(_0x35a093,_0x2593c2){return client['request'](_0x6aeef8,_0x275a64)[_0x4c47('0xb')](function(_0x1d2f5c){logger['info'](_0x4c47('0xc'),_0x255b6e,_0x4c47('0xd'));logger[_0x4c47('0xe')](_0x4c47('0xf'),_0x255b6e,'request\x20sent',JSON[_0x4c47('0x10')](_0x1d2f5c));if(_0x1d2f5c['error']){if(_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x12')]===0x1f4){logger[_0x4c47('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x255b6e,_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x13')]);return _0x2593c2(_0x1d2f5c['error'][_0x4c47('0x13')]);}logger['error'](_0x4c47('0xc'),_0x255b6e,_0x1d2f5c[_0x4c47('0x11')][_0x4c47('0x13')]);return _0x35a093(_0x1d2f5c[_0x4c47('0x11')]['message']);}else{logger[_0x4c47('0x14')](_0x4c47('0xc'),_0x255b6e,_0x4c47('0xd'));_0x35a093(_0x1d2f5c[_0x4c47('0x15')]['message']);}})['catch'](function(_0x5afffc){logger[_0x4c47('0x11')](_0x4c47('0xc'),_0x255b6e,_0x5afffc);_0x2593c2(_0x5afffc);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 576c0ac..efcdd3f 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 _0xc382=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','/:id','isAuthenticated','show','put','delete','destroy','multer','path'];(function(_0x100d09,_0x3f1283){var _0x4626fb=function(_0xc3e63b){while(--_0xc3e63b){_0x100d09['push'](_0x100d09['shift']());}};_0x4626fb(++_0x3f1283);}(_0xc382,0x11b));var _0x2c38=function(_0x2d58e6,_0x55cb14){_0x2d58e6=_0x2d58e6-0x0;var _0x5bcd81=_0xc382[_0x2d58e6];return _0x5bcd81;};'use strict';var multer=require(_0x2c38('0x0'));var util=require('util');var path=require(_0x2c38('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c38('0x2')]();var fs_extra=require(_0x2c38('0x3'));var auth=require(_0x2c38('0x4'));var interaction=require(_0x2c38('0x5'));var config=require(_0x2c38('0x6'));var controller=require(_0x2c38('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c38('0x8')]);router['get'](_0x2c38('0x9'),auth[_0x2c38('0xa')](),controller[_0x2c38('0xb')]);router['post']('/',auth[_0x2c38('0xa')](),controller['create']);router[_0x2c38('0xc')](_0x2c38('0x9'),auth[_0x2c38('0xa')](),controller['update']);router[_0x2c38('0xd')](_0x2c38('0x9'),auth[_0x2c38('0xa')](),controller[_0x2c38('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2bbe=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','post','update','destroy'];(function(_0x1ced5b,_0x14f3c9){var _0x475048=function(_0x5312d4){while(--_0x5312d4){_0x1ced5b['push'](_0x1ced5b['shift']());}};_0x475048(++_0x14f3c9);}(_0x2bbe,0x1dd));var _0xe2bb=function(_0x171560,_0x3c37eb){_0x171560=_0x171560-0x0;var _0x41f412=_0x2bbe[_0x171560];return _0x41f412;};'use strict';var multer=require(_0xe2bb('0x0'));var util=require(_0xe2bb('0x1'));var path=require(_0xe2bb('0x2'));var timeout=require(_0xe2bb('0x3'));var express=require(_0xe2bb('0x4'));var router=express[_0xe2bb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe2bb('0x6'));var config=require('../../config/environment');var controller=require(_0xe2bb('0x7'));router[_0xe2bb('0x8')]('/',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0xa')]);router[_0xe2bb('0x8')](_0xe2bb('0xb'),auth[_0xe2bb('0x9')](),controller[_0xe2bb('0xc')]);router[_0xe2bb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe2bb('0xb'),auth[_0xe2bb('0x9')](),controller[_0xe2bb('0xe')]);router['delete'](_0xe2bb('0xb'),auth['isAuthenticated'](),controller[_0xe2bb('0xf')]);module[_0xe2bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 60c8fe1..c111f04 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 _0x689c=['STRING','sequelize','exports'];(function(_0x336081,_0x8bf806){var _0x4aafad=function(_0x351fb5){while(--_0x351fb5){_0x336081['push'](_0x336081['shift']());}};_0x4aafad(++_0x8bf806);}(_0x689c,0x1a5));var _0xc689=function(_0x4661d0,_0x7ab034){_0x4661d0=_0x4661d0-0x0;var _0x45b307=_0x689c[_0x4661d0];return _0x45b307;};'use strict';var Sequelize=require(_0xc689('0x0'));module[_0xc689('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc689('0x2')]}}; \ No newline at end of file +var _0x4390=['STRING','sequelize'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x4390,0xd7));var _0x0439=function(_0x537cf6,_0x4f21b7){_0x537cf6=_0x537cf6-0x0;var _0xd4bdd8=_0x4390[_0x537cf6];return _0xd4bdd8;};'use strict';var Sequelize=require(_0x0439('0x0'));module['exports']={'name':{'type':Sequelize[_0x0439('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0439('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index ad5220d..bf82213 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 _0x5c36=['fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','end','undefined','limit','count','json','apply','reject','update','destroy','then','get','Pauses','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c36,0xb7));var _0x65c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5c36[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x65c3('0x0'));var rimraf=require(_0x65c3('0x1'));var zipdir=require(_0x65c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x65c3('0x3'));var BPromise=require(_0x65c3('0x4'));var Mustache=require('mustache');var util=require(_0x65c3('0x5'));var path=require('path');var sox=require(_0x65c3('0x6'));var csv=require(_0x65c3('0x7'));var ejs=require(_0x65c3('0x8'));var fs=require('fs');var fs_extra=require(_0x65c3('0x9'));var _=require('lodash');var squel=require(_0x65c3('0xa'));var crypto=require(_0x65c3('0xb'));var jsforce=require(_0x65c3('0xc'));var deskjs=require(_0x65c3('0xd'));var toCsv=require(_0x65c3('0x7'));var querystring=require(_0x65c3('0xe'));var Papa=require(_0x65c3('0xf'));var Redis=require('ioredis');var authService=require(_0x65c3('0x10'));var qs=require(_0x65c3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x65c3('0x12'))(_0x65c3('0x13'));var utils=require(_0x65c3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22a30b,_0x1e8118){_0x1e8118=_0x1e8118||0xcc;return function(_0x567f50){if(_0x567f50){return _0x22a30b['sendStatus'](_0x1e8118);}return _0x22a30b[_0x65c3('0x15')](_0x1e8118)[_0x65c3('0x16')]();};}function respondWithResult(_0x367c1a,_0x34a2a5){_0x34a2a5=_0x34a2a5||0xc8;return function(_0x4a4a5d){if(_0x4a4a5d){return _0x367c1a[_0x65c3('0x15')](_0x34a2a5)['json'](_0x4a4a5d);}};}function respondWithFilteredResult(_0x5da1d9,_0x3bd552){return function(_0x193dd3){if(_0x193dd3){var _0x24af85=typeof _0x3bd552['offset']===_0x65c3('0x17')&&typeof _0x3bd552[_0x65c3('0x18')]===_0x65c3('0x17');var _0x26809d=_0x193dd3[_0x65c3('0x19')];var _0x392aee=_0x24af85?0x0:_0x3bd552['offset'];var _0x5d6eb3=_0x24af85?_0x193dd3['count']:_0x3bd552['offset']+_0x3bd552[_0x65c3('0x18')];var _0x19d1bc;if(_0x5d6eb3>=_0x26809d){_0x5d6eb3=_0x26809d;_0x19d1bc=0xc8;}else{_0x19d1bc=0xce;}_0x5da1d9[_0x65c3('0x15')](_0x19d1bc);return _0x5da1d9['set']('Content-Range',_0x392aee+'-'+_0x5d6eb3+'/'+_0x26809d)[_0x65c3('0x1a')](_0x193dd3);}return null;};}function patchUpdates(_0x5befcb){return function(_0x3ac618){try{jsonpatch[_0x65c3('0x1b')](_0x3ac618,_0x5befcb,!![]);}catch(_0x3e9e1){return BPromise[_0x65c3('0x1c')](_0x3e9e1);}return _0x3ac618['save']();};}function saveUpdates(_0x4e4856,_0x28eb84){return function(_0x5b0fb2){if(_0x5b0fb2){return _0x5b0fb2[_0x65c3('0x1d')](_0x4e4856)['then'](function(_0x1184ac){return _0x1184ac;});}return null;};}function removeEntity(_0x3e17b9,_0x110de1){return function(_0x12f6b6){if(_0x12f6b6){return _0x12f6b6[_0x65c3('0x1e')]()[_0x65c3('0x1f')](function(){var _0xce69cd=_0x12f6b6[_0x65c3('0x20')]({'plain':!![]});var _0x3eeba3=_0x65c3('0x21');return db['UserProfileResource'][_0x65c3('0x1e')]({'where':{'type':_0x3eeba3,'resourceId':_0xce69cd['id']}})[_0x65c3('0x1f')](function(){return _0x12f6b6;});})['then'](function(){_0x3e17b9['status'](0xcc)[_0x65c3('0x16')]();});}};}function handleEntityNotFound(_0x541b10,_0x46cc35){return function(_0x430a6c){if(!_0x430a6c){_0x541b10[_0x65c3('0x22')](0x194);}return _0x430a6c;};}function handleError(_0x1c96df,_0x59f0fb){_0x59f0fb=_0x59f0fb||0x1f4;return function(_0x36b7e3){logger[_0x65c3('0x23')](_0x36b7e3[_0x65c3('0x24')]);if(_0x36b7e3['name']){delete _0x36b7e3[_0x65c3('0x25')];}_0x1c96df[_0x65c3('0x15')](_0x59f0fb)[_0x65c3('0x26')](_0x36b7e3);};}exports[_0x65c3('0x27')]=function(_0x321434,_0x33d2ce){var _0x4aebee={},_0x8599d8={},_0x245c05={'count':0x0,'rows':[]};var _0x5e9a26=_[_0x65c3('0x28')](db[_0x65c3('0x29')][_0x65c3('0x2a')],function(_0x3a48e3){return{'name':_0x3a48e3[_0x65c3('0x2b')],'type':_0x3a48e3[_0x65c3('0x2c')][_0x65c3('0x2d')]};});_0x8599d8[_0x65c3('0x2e')]=_[_0x65c3('0x28')](_0x5e9a26,_0x65c3('0x25'));_0x8599d8[_0x65c3('0x2f')]=_[_0x65c3('0x30')](_0x321434['query']);_0x8599d8[_0x65c3('0x31')]=_[_0x65c3('0x32')](_0x8599d8['model'],_0x8599d8[_0x65c3('0x2f')]);_0x4aebee['attributes']=_['intersection'](_0x8599d8[_0x65c3('0x2e')],qs[_0x65c3('0x33')](_0x321434['query']['fields']));_0x4aebee[_0x65c3('0x34')]=_0x4aebee['attributes'][_0x65c3('0x35')]?_0x4aebee['attributes']:_0x8599d8['model'];if(!_0x321434[_0x65c3('0x2f')][_0x65c3('0x36')](_0x65c3('0x37'))){_0x4aebee[_0x65c3('0x18')]=qs[_0x65c3('0x18')](_0x321434[_0x65c3('0x2f')][_0x65c3('0x18')]);_0x4aebee[_0x65c3('0x38')]=qs[_0x65c3('0x38')](_0x321434[_0x65c3('0x2f')][_0x65c3('0x38')]);}_0x4aebee[_0x65c3('0x39')]=qs[_0x65c3('0x3a')](_0x321434[_0x65c3('0x2f')][_0x65c3('0x3a')]);_0x4aebee[_0x65c3('0x3b')]=qs[_0x65c3('0x31')](_[_0x65c3('0x3c')](_0x321434[_0x65c3('0x2f')],_0x8599d8[_0x65c3('0x31')]),_0x5e9a26);if(_0x321434['query']['filter']){_0x4aebee[_0x65c3('0x3b')]=_['merge'](_0x4aebee[_0x65c3('0x3b')],{'$or':_['map'](_0x5e9a26,function(_0x1eed81){if(_0x1eed81['type']!==_0x65c3('0x3d')){var _0x10f61c={};_0x10f61c[_0x1eed81['name']]={'$like':'%'+_0x321434[_0x65c3('0x2f')][_0x65c3('0x3e')]+'%'};return _0x10f61c;}})});}_0x4aebee=_[_0x65c3('0x3f')]({},_0x4aebee,_0x321434[_0x65c3('0x40')]);var _0x4b5d72={'where':_0x4aebee[_0x65c3('0x3b')]};return db[_0x65c3('0x29')][_0x65c3('0x19')](_0x4b5d72)[_0x65c3('0x1f')](function(_0x46fa6a){_0x245c05[_0x65c3('0x19')]=_0x46fa6a;if(_0x321434['query'][_0x65c3('0x41')]){_0x4aebee[_0x65c3('0x42')]=[{'all':!![]}];}return db[_0x65c3('0x29')][_0x65c3('0x43')](_0x4aebee);})[_0x65c3('0x1f')](function(_0x8e2abb){_0x245c05[_0x65c3('0x44')]=_0x8e2abb;return _0x245c05;})['then'](respondWithFilteredResult(_0x33d2ce,_0x4aebee))[_0x65c3('0x45')](handleError(_0x33d2ce,null));};exports[_0x65c3('0x46')]=function(_0x2d99b7,_0x2dfca8){var _0x174efc={'raw':!![],'where':{'id':_0x2d99b7[_0x65c3('0x47')]['id']}},_0x3207f1={};_0x3207f1[_0x65c3('0x2e')]=_['keys'](db[_0x65c3('0x29')][_0x65c3('0x2a')]);_0x3207f1['query']=_[_0x65c3('0x30')](_0x2d99b7['query']);_0x3207f1[_0x65c3('0x31')]=_[_0x65c3('0x32')](_0x3207f1[_0x65c3('0x2e')],_0x3207f1[_0x65c3('0x2f')]);_0x174efc[_0x65c3('0x34')]=_[_0x65c3('0x32')](_0x3207f1[_0x65c3('0x2e')],qs[_0x65c3('0x33')](_0x2d99b7[_0x65c3('0x2f')][_0x65c3('0x33')]));_0x174efc[_0x65c3('0x34')]=_0x174efc[_0x65c3('0x34')][_0x65c3('0x35')]?_0x174efc['attributes']:_0x3207f1['model'];if(_0x2d99b7[_0x65c3('0x2f')][_0x65c3('0x41')]){_0x174efc[_0x65c3('0x42')]=[{'all':!![]}];}_0x174efc=_[_0x65c3('0x3f')]({},_0x174efc,_0x2d99b7[_0x65c3('0x40')]);return db[_0x65c3('0x29')][_0x65c3('0x48')](_0x174efc)[_0x65c3('0x1f')](handleEntityNotFound(_0x2dfca8,null))[_0x65c3('0x1f')](respondWithResult(_0x2dfca8,null))['catch'](handleError(_0x2dfca8,null));};exports[_0x65c3('0x49')]=function(_0x5a8da3,_0x4d5cdf){return db['Pause'][_0x65c3('0x49')](_0x5a8da3[_0x65c3('0x4a')],{})[_0x65c3('0x1f')](function(_0x351904){var _0x91e863=_0x5a8da3['user']['get']({'plain':!![]});if(!_0x91e863)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x91e863['role']==='user'){var _0x1a1318=_0x351904[_0x65c3('0x20')]({'plain':!![]});var _0x5a21ce=_0x65c3('0x21');return db[_0x65c3('0x4b')]['find']({'where':{'name':_0x5a21ce,'userProfileId':_0x91e863[_0x65c3('0x4c')]},'raw':!![]})[_0x65c3('0x1f')](function(_0x575ea3){if(_0x575ea3&&_0x575ea3[_0x65c3('0x4d')]===0x0){return db['UserProfileResource'][_0x65c3('0x49')]({'name':_0x1a1318[_0x65c3('0x25')],'resourceId':_0x1a1318['id'],'type':_0x575ea3[_0x65c3('0x25')],'sectionId':_0x575ea3['id']},{})['then'](function(){return _0x351904;});}else{return _0x351904;}})[_0x65c3('0x45')](function(_0x3b5b6a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b5b6a);throw _0x3b5b6a;});}return _0x351904;})[_0x65c3('0x1f')](respondWithResult(_0x4d5cdf,0xc9))[_0x65c3('0x45')](handleError(_0x4d5cdf,null));};exports['update']=function(_0x41b319,_0x3070d2){if(_0x41b319['body']['id']){delete _0x41b319['body']['id'];}return db['Pause']['find']({'where':{'id':_0x41b319[_0x65c3('0x47')]['id']}})[_0x65c3('0x1f')](handleEntityNotFound(_0x3070d2,null))[_0x65c3('0x1f')](saveUpdates(_0x41b319[_0x65c3('0x4a')],null))['then'](respondWithResult(_0x3070d2,null))[_0x65c3('0x45')](handleError(_0x3070d2,null));};exports[_0x65c3('0x1e')]=function(_0x21abcc,_0x3b2fb1){return db[_0x65c3('0x29')]['find']({'where':{'id':_0x21abcc['params']['id']}})['then'](handleEntityNotFound(_0x3b2fb1,null))[_0x65c3('0x1f')](removeEntity(_0x3b2fb1,null))[_0x65c3('0x45')](handleError(_0x3b2fb1,null));}; \ No newline at end of file +var _0x3f75=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','lodash','squel','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','get','Pauses','UserProfileResource','destroy','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x272242,_0x3d8c75){var _0x584ae6=function(_0x34db3f){while(--_0x34db3f){_0x272242['push'](_0x272242['shift']());}};_0x584ae6(++_0x3d8c75);}(_0x3f75,0x105));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53f7('0x0'));var zipdir=require(_0x53f7('0x1'));var jsonpatch=require(_0x53f7('0x2'));var rp=require(_0x53f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x53f7('0x4'));var csv=require(_0x53f7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53f7('0x6'));var squel=require(_0x53f7('0x7'));var crypto=require(_0x53f7('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x53f7('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x53f7('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x53f7('0xa'));var as=require(_0x53f7('0xb'));var hardwareService=require(_0x53f7('0xc'));var logger=require(_0x53f7('0xd'))(_0x53f7('0xe'));var utils=require(_0x53f7('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x53f7('0x10'));var db=require(_0x53f7('0x11'))['db'];function respondWithStatusCode(_0x1dc88e,_0x460f8a){_0x460f8a=_0x460f8a||0xcc;return function(_0x37603c){if(_0x37603c){return _0x1dc88e['sendStatus'](_0x460f8a);}return _0x1dc88e[_0x53f7('0x12')](_0x460f8a)['end']();};}function respondWithResult(_0x3fdb7a,_0x4706d2){_0x4706d2=_0x4706d2||0xc8;return function(_0x417e66){if(_0x417e66){return _0x3fdb7a[_0x53f7('0x12')](_0x4706d2)[_0x53f7('0x13')](_0x417e66);}};}function respondWithFilteredResult(_0x3a6460,_0x4f6cf8){return function(_0x124e99){if(_0x124e99){var _0x3865dc=typeof _0x4f6cf8[_0x53f7('0x14')]==='undefined'&&typeof _0x4f6cf8[_0x53f7('0x15')]===_0x53f7('0x16');var _0x3f2a07=_0x124e99[_0x53f7('0x17')];var _0x318c81=_0x3865dc?0x0:_0x4f6cf8[_0x53f7('0x14')];var _0x50fab8=_0x3865dc?_0x124e99[_0x53f7('0x17')]:_0x4f6cf8[_0x53f7('0x14')]+_0x4f6cf8['limit'];var _0x3a93a5;if(_0x50fab8>=_0x3f2a07){_0x50fab8=_0x3f2a07;_0x3a93a5=0xc8;}else{_0x3a93a5=0xce;}_0x3a6460['status'](_0x3a93a5);return _0x3a6460[_0x53f7('0x18')](_0x53f7('0x19'),_0x318c81+'-'+_0x50fab8+'/'+_0x3f2a07)[_0x53f7('0x13')](_0x124e99);}return null;};}function patchUpdates(_0x3aee87){return function(_0x17a0d6){try{jsonpatch['apply'](_0x17a0d6,_0x3aee87,!![]);}catch(_0x35ff60){return BPromise[_0x53f7('0x1a')](_0x35ff60);}return _0x17a0d6[_0x53f7('0x1b')]();};}function saveUpdates(_0x4c7a62,_0x49420c){return function(_0x8575d3){if(_0x8575d3){return _0x8575d3['update'](_0x4c7a62)[_0x53f7('0x1c')](function(_0x1d2d77){return _0x1d2d77;});}return null;};}function removeEntity(_0x11f961,_0x1a4052){return function(_0x598309){if(_0x598309){return _0x598309['destroy']()[_0x53f7('0x1c')](function(){var _0x3c1184=_0x598309[_0x53f7('0x1d')]({'plain':!![]});var _0x3f1303=_0x53f7('0x1e');return db[_0x53f7('0x1f')][_0x53f7('0x20')]({'where':{'type':_0x3f1303,'resourceId':_0x3c1184['id']}})[_0x53f7('0x1c')](function(){return _0x598309;});})['then'](function(){_0x11f961[_0x53f7('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21aa1d,_0x1f8350){return function(_0x23ff9e){if(!_0x23ff9e){_0x21aa1d['sendStatus'](0x194);}return _0x23ff9e;};}function handleError(_0x5178d3,_0x444b22){_0x444b22=_0x444b22||0x1f4;return function(_0x91d8a8){logger['error'](_0x91d8a8[_0x53f7('0x21')]);if(_0x91d8a8[_0x53f7('0x22')]){delete _0x91d8a8[_0x53f7('0x22')];}_0x5178d3[_0x53f7('0x12')](_0x444b22)[_0x53f7('0x23')](_0x91d8a8);};}exports['index']=function(_0x384c25,_0x2b2fdd){var _0x53ff1c={},_0x644f02={},_0xae9640={'count':0x0,'rows':[]};var _0x168691=_[_0x53f7('0x24')](db[_0x53f7('0x25')][_0x53f7('0x26')],function(_0x310c82){return{'name':_0x310c82[_0x53f7('0x27')],'type':_0x310c82[_0x53f7('0x28')][_0x53f7('0x29')]};});_0x644f02[_0x53f7('0x2a')]=_[_0x53f7('0x24')](_0x168691,_0x53f7('0x22'));_0x644f02[_0x53f7('0x2b')]=_[_0x53f7('0x2c')](_0x384c25['query']);_0x644f02[_0x53f7('0x2d')]=_['intersection'](_0x644f02[_0x53f7('0x2a')],_0x644f02[_0x53f7('0x2b')]);_0x53ff1c['attributes']=_[_0x53f7('0x2e')](_0x644f02[_0x53f7('0x2a')],qs[_0x53f7('0x2f')](_0x384c25[_0x53f7('0x2b')][_0x53f7('0x2f')]));_0x53ff1c[_0x53f7('0x30')]=_0x53ff1c[_0x53f7('0x30')][_0x53f7('0x31')]?_0x53ff1c[_0x53f7('0x30')]:_0x644f02[_0x53f7('0x2a')];if(!_0x384c25['query'][_0x53f7('0x32')](_0x53f7('0x33'))){_0x53ff1c[_0x53f7('0x15')]=qs[_0x53f7('0x15')](_0x384c25['query']['limit']);_0x53ff1c[_0x53f7('0x14')]=qs[_0x53f7('0x14')](_0x384c25[_0x53f7('0x2b')][_0x53f7('0x14')]);}_0x53ff1c[_0x53f7('0x34')]=qs[_0x53f7('0x35')](_0x384c25[_0x53f7('0x2b')][_0x53f7('0x35')]);_0x53ff1c[_0x53f7('0x36')]=qs['filters'](_[_0x53f7('0x37')](_0x384c25[_0x53f7('0x2b')],_0x644f02[_0x53f7('0x2d')]),_0x168691);if(_0x384c25[_0x53f7('0x2b')][_0x53f7('0x38')]){_0x53ff1c[_0x53f7('0x36')]=_['merge'](_0x53ff1c[_0x53f7('0x36')],{'$or':_[_0x53f7('0x24')](_0x168691,function(_0x4ee349){if(_0x4ee349['type']!==_0x53f7('0x39')){var _0xb259a8={};_0xb259a8[_0x4ee349[_0x53f7('0x22')]]={'$like':'%'+_0x384c25[_0x53f7('0x2b')][_0x53f7('0x38')]+'%'};return _0xb259a8;}})});}_0x53ff1c=_[_0x53f7('0x3a')]({},_0x53ff1c,_0x384c25[_0x53f7('0x3b')]);var _0x18a540={'where':_0x53ff1c[_0x53f7('0x36')]};return db['Pause']['count'](_0x18a540)[_0x53f7('0x1c')](function(_0x62efec){_0xae9640[_0x53f7('0x17')]=_0x62efec;if(_0x384c25[_0x53f7('0x2b')][_0x53f7('0x3c')]){_0x53ff1c[_0x53f7('0x3d')]=[{'all':!![]}];}return db['Pause'][_0x53f7('0x3e')](_0x53ff1c);})[_0x53f7('0x1c')](function(_0x4e115e){_0xae9640['rows']=_0x4e115e;return _0xae9640;})[_0x53f7('0x1c')](respondWithFilteredResult(_0x2b2fdd,_0x53ff1c))[_0x53f7('0x3f')](handleError(_0x2b2fdd,null));};exports[_0x53f7('0x40')]=function(_0x94fb85,_0xea1751){var _0x614931={'raw':!![],'where':{'id':_0x94fb85[_0x53f7('0x41')]['id']}},_0x2c6c05={};_0x2c6c05['model']=_[_0x53f7('0x2c')](db['Pause']['rawAttributes']);_0x2c6c05[_0x53f7('0x2b')]=_['keys'](_0x94fb85[_0x53f7('0x2b')]);_0x2c6c05['filters']=_[_0x53f7('0x2e')](_0x2c6c05[_0x53f7('0x2a')],_0x2c6c05[_0x53f7('0x2b')]);_0x614931[_0x53f7('0x30')]=_[_0x53f7('0x2e')](_0x2c6c05[_0x53f7('0x2a')],qs[_0x53f7('0x2f')](_0x94fb85[_0x53f7('0x2b')][_0x53f7('0x2f')]));_0x614931[_0x53f7('0x30')]=_0x614931[_0x53f7('0x30')][_0x53f7('0x31')]?_0x614931[_0x53f7('0x30')]:_0x2c6c05[_0x53f7('0x2a')];if(_0x94fb85['query']['includeAll']){_0x614931[_0x53f7('0x3d')]=[{'all':!![]}];}_0x614931=_[_0x53f7('0x3a')]({},_0x614931,_0x94fb85[_0x53f7('0x3b')]);return db[_0x53f7('0x25')][_0x53f7('0x42')](_0x614931)[_0x53f7('0x1c')](handleEntityNotFound(_0xea1751,null))[_0x53f7('0x1c')](respondWithResult(_0xea1751,null))[_0x53f7('0x3f')](handleError(_0xea1751,null));};exports['create']=function(_0x52b01d,_0x3b1585){return db['Pause'][_0x53f7('0x43')](_0x52b01d['body'],{})[_0x53f7('0x1c')](function(_0x5c6bac){var _0x1a9289=_0x52b01d[_0x53f7('0x44')][_0x53f7('0x1d')]({'plain':!![]});if(!_0x1a9289)throw new Error(_0x53f7('0x45'));if(_0x1a9289[_0x53f7('0x46')]===_0x53f7('0x44')){var _0x6dba20=_0x5c6bac['get']({'plain':!![]});var _0x2d266f='Pauses';return db[_0x53f7('0x47')][_0x53f7('0x42')]({'where':{'name':_0x2d266f,'userProfileId':_0x1a9289[_0x53f7('0x48')]},'raw':!![]})[_0x53f7('0x1c')](function(_0x845239){if(_0x845239&&_0x845239[_0x53f7('0x49')]===0x0){return db[_0x53f7('0x1f')][_0x53f7('0x43')]({'name':_0x6dba20['name'],'resourceId':_0x6dba20['id'],'type':_0x845239[_0x53f7('0x22')],'sectionId':_0x845239['id']},{})[_0x53f7('0x1c')](function(){return _0x5c6bac;});}else{return _0x5c6bac;}})[_0x53f7('0x3f')](function(_0x2d50e4){logger[_0x53f7('0x4a')](_0x53f7('0x4b'),_0x2d50e4);throw _0x2d50e4;});}return _0x5c6bac;})[_0x53f7('0x1c')](respondWithResult(_0x3b1585,0xc9))[_0x53f7('0x3f')](handleError(_0x3b1585,null));};exports[_0x53f7('0x4c')]=function(_0x5c18e8,_0x5a859f){if(_0x5c18e8[_0x53f7('0x4d')]['id']){delete _0x5c18e8[_0x53f7('0x4d')]['id'];}return db[_0x53f7('0x25')][_0x53f7('0x42')]({'where':{'id':_0x5c18e8[_0x53f7('0x41')]['id']}})[_0x53f7('0x1c')](handleEntityNotFound(_0x5a859f,null))[_0x53f7('0x1c')](saveUpdates(_0x5c18e8[_0x53f7('0x4d')],null))[_0x53f7('0x1c')](respondWithResult(_0x5a859f,null))[_0x53f7('0x3f')](handleError(_0x5a859f,null));};exports[_0x53f7('0x20')]=function(_0x14c9f3,_0x50280f){return db[_0x53f7('0x25')][_0x53f7('0x42')]({'where':{'id':_0x14c9f3['params']['id']}})[_0x53f7('0x1c')](handleEntityNotFound(_0x50280f,null))[_0x53f7('0x1c')](removeEntity(_0x50280f,null))[_0x53f7('0x3f')](handleError(_0x50280f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ea87942..59a393c 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0x7fbe[_0x4045ff];return _0x5797ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x508abe,_0x37d20c){_0x508abe=_0x508abe-0x0;var _0x23d357=_0x7fbe[_0x508abe];return _0x23d357;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 85391ae..89fb756 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1a513b,_0x3322bf){var _0x808c94=function(_0x1dd825){while(--_0x1dd825){_0x1a513b['push'](_0x1a513b['shift']());}};_0x808c94(++_0x3322bf);}(_0x7a54,0x106));var _0x47a5=function(_0x4dc25d,_0x51bd15){_0x4dc25d=_0x4dc25d-0x0;var _0x3437a2=_0x7a54[_0x4dc25d];return _0x3437a2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3c11c8,_0x51dde9){var _0x4ce32f=function(_0x4646c9){while(--_0x4646c9){_0x3c11c8['push'](_0x3c11c8['shift']());}};_0x4ce32f(++_0x51dde9);}(_0x7a54,0x106));var _0x47a5=function(_0x2ca3f6,_0x537fd4){_0x2ca3f6=_0x2ca3f6-0x0;var _0x2f73f8=_0x7a54[_0x2ca3f6];return _0x2f73f8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8c14ca3..1e2ee17 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 _0xac31=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','single','file','upload','put','update','delete','exports','multer','util'];(function(_0xd90039,_0x37c137){var _0x486dd9=function(_0x502a44){while(--_0x502a44){_0xd90039['push'](_0xd90039['shift']());}};_0x486dd9(++_0x37c137);}(_0xac31,0xca));var _0x1ac3=function(_0x4692be,_0xb9367){_0x4692be=_0x4692be-0x0;var _0x23b278=_0xac31[_0x4692be];return _0x23b278;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var fs_extra=require(_0x1ac3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var controller=require('./plugin.controller');router['get']('/',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xa')]);router[_0x1ac3('0xb')](_0x1ac3('0xc'),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0xb')](_0x1ac3('0x10'),auth['isAuthenticated'](),controller[_0x1ac3('0x11')]);var upload=multer({'storage':multer[_0x1ac3('0x12')]({'destination':function(_0x3e835b,_0x24f0d2,_0x2a8dc7){_0x2a8dc7(null,path[_0x1ac3('0x13')](config['root'],_0x1ac3('0x14')));},'filename':function(_0x376814,_0x2eeabf,_0x2338b9){_0x2eeabf['originalname']=_0x2eeabf[_0x1ac3('0x15')][_0x1ac3('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2338b9(null,util[_0x1ac3('0x17')](_0x1ac3('0x18'),path['basename'](_0x2eeabf[_0x1ac3('0x15')],path[_0x1ac3('0x19')](_0x2eeabf['originalname'])),Date[_0x1ac3('0x1a')](),path[_0x1ac3('0x19')](_0x2eeabf[_0x1ac3('0x15')])));}})});router['post']('/',upload[_0x1ac3('0x1b')](_0x1ac3('0x1c')),controller[_0x1ac3('0x1d')]);router['post'](_0x1ac3('0xc'),controller['webhookPost']);router[_0x1ac3('0x1e')](_0x1ac3('0xe'),auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x1f')]);router[_0x1ac3('0x20')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x20')]);module[_0x1ac3('0x21')]=router; \ No newline at end of file +var _0xe5b3=['now','file','upload','/webhook','webhookPost','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','extname'];(function(_0xbade49,_0x4bf808){var _0x201463=function(_0x34f283){while(--_0x34f283){_0xbade49['push'](_0xbade49['shift']());}};_0x201463(++_0x4bf808);}(_0xe5b3,0x133));var _0x3e5b=function(_0x338f1f,_0x4cfd8d){_0x338f1f=_0x338f1f-0x0;var _0x140699=_0xe5b3[_0x338f1f];return _0x140699;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/webhook',controller[_0x3e5b('0xc')]);router[_0x3e5b('0xa')](_0x3e5b('0xd'),auth[_0x3e5b('0xe')](),controller['show']);router['get'](_0x3e5b('0xf'),auth[_0x3e5b('0xe')](),controller[_0x3e5b('0x10')]);var upload=multer({'storage':multer[_0x3e5b('0x11')]({'destination':function(_0xeeaabc,_0x522e9e,_0x3be027){_0x3be027(null,path['join'](config[_0x3e5b('0x12')],_0x3e5b('0x13')));},'filename':function(_0x4d69dd,_0x374068,_0x20b97b){_0x374068[_0x3e5b('0x14')]=_0x374068[_0x3e5b('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20b97b(null,util[_0x3e5b('0x15')]('%s-%s%s',path['basename'](_0x374068['originalname'],path[_0x3e5b('0x16')](_0x374068[_0x3e5b('0x14')])),Date[_0x3e5b('0x17')](),path['extname'](_0x374068[_0x3e5b('0x14')])));}})});router['post']('/',upload['single'](_0x3e5b('0x18')),controller[_0x3e5b('0x19')]);router['post'](_0x3e5b('0x1a'),controller[_0x3e5b('0x1b')]);router['put'](_0x3e5b('0xd'),auth[_0x3e5b('0xe')](),controller['update']);router['delete'](_0x3e5b('0xd'),auth[_0x3e5b('0xe')](),controller[_0x3e5b('0x1c')]);module[_0x3e5b('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 0746631..147c00d 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 _0x2754=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly'];(function(_0x20d944,_0x1a4bab){var _0x52c56c=function(_0x16a548){while(--_0x16a548){_0x20d944['push'](_0x20d944['shift']());}};_0x52c56c(++_0x1a4bab);}(_0x2754,0x1e4));var _0x4275=function(_0x548467,_0x5ef1f2){_0x548467=_0x548467-0x0;var _0x53c1b0=_0x2754[_0x548467];return _0x53c1b0;};'use strict';var Sequelize=require(_0x4275('0x0'));module['exports']={'name':{'type':Sequelize[_0x4275('0x1')]},'type':{'type':Sequelize['ENUM']('html',_0x4275('0x2'))},'description':{'type':Sequelize[_0x4275('0x3')]},'version':{'type':Sequelize[_0x4275('0x3')]},'path':{'type':Sequelize[_0x4275('0x1')],'comment':_0x4275('0x4')},'active':{'type':Sequelize[_0x4275('0x5')],'defaultValue':0x0,'comment':_0x4275('0x6')},'sidebar':{'type':Sequelize[_0x4275('0x7')](_0x4275('0x8'),_0x4275('0x9'),_0x4275('0xa'),_0x4275('0xb')),'defaultValue':_0x4275('0xa'),'comment':_0x4275('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x4275('0x1')]},'scriptName':{'type':Sequelize[_0x4275('0x1')]},'scriptPath':{'type':Sequelize[_0x4275('0x1')]}}; \ No newline at end of file +var _0x2bc9=['adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x31a5f3,_0x174dc2){var _0x2cf0e4=function(_0x2c0102){while(--_0x2c0102){_0x31a5f3['push'](_0x31a5f3['shift']());}};_0x2cf0e4(++_0x174dc2);}(_0x2bc9,0xb9));var _0x92bc=function(_0x2fdc1a,_0x2a0a5a){_0x2fdc1a=_0x2fdc1a-0x0;var _0x51fb16=_0x2bc9[_0x2fdc1a];return _0x51fb16;};'use strict';var Sequelize=require(_0x92bc('0x0'));module[_0x92bc('0x1')]={'name':{'type':Sequelize[_0x92bc('0x2')]},'type':{'type':Sequelize[_0x92bc('0x3')](_0x92bc('0x4'),_0x92bc('0x5'))},'description':{'type':Sequelize[_0x92bc('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x92bc('0x2')],'comment':_0x92bc('0x7')},'active':{'type':Sequelize[_0x92bc('0x8')],'defaultValue':0x0,'comment':_0x92bc('0x9')},'sidebar':{'type':Sequelize[_0x92bc('0x3')](_0x92bc('0xa'),_0x92bc('0xb'),'always',_0x92bc('0xc')),'defaultValue':_0x92bc('0xd'),'comment':_0x92bc('0xe')},'icon':{'type':Sequelize[_0x92bc('0x2')]},'adminUrl':{'type':Sequelize[_0x92bc('0x2')]},'agentUrl':{'type':Sequelize[_0x92bc('0x2')]},'scriptName':{'type':Sequelize[_0x92bc('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b92bb6e..9886f47 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 _0x7b13=['intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','filters','find','catch','download','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','format','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','UserProfileResource','create','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','headers','content-length','content-type','endsWith','statusCode','webhookPost','encoding','method','%s%s','set','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','end','offset','limit','undefined','count','apply','reject','save','update','then','get','destroy','status','sendStatus','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','model','query','keys'];(function(_0x3e0d41,_0x1d6589){var _0x1e879a=function(_0x31d49c){while(--_0x31d49c){_0x3e0d41['push'](_0x3e0d41['shift']());}};_0x1e879a(++_0x1d6589);}(_0x7b13,0x71));var _0x37b1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7b13[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x37b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x37b1('0x1'));var jsonpatch=require(_0x37b1('0x2'));var rp=require(_0x37b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37b1('0x4'));var util=require(_0x37b1('0x5'));var path=require(_0x37b1('0x6'));var sox=require(_0x37b1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37b1('0x8'));var _=require('lodash');var squel=require(_0x37b1('0x9'));var crypto=require('crypto');var jsforce=require(_0x37b1('0xa'));var deskjs=require(_0x37b1('0xb'));var toCsv=require(_0x37b1('0xc'));var querystring=require(_0x37b1('0xd'));var Papa=require(_0x37b1('0xe'));var extract=require(_0x37b1('0xf'));var rimraf=require('rimraf');var archiver=require(_0x37b1('0x10'));var Redis=require(_0x37b1('0x11'));var authService=require(_0x37b1('0x12'));var qs=require(_0x37b1('0x13'));var as=require(_0x37b1('0x14'));var hardwareService=require(_0x37b1('0x15'));var logger=require('../../config/logger')(_0x37b1('0x16'));var utils=require(_0x37b1('0x17'));var config=require(_0x37b1('0x18'));var licenseUtil=require(_0x37b1('0x19'));var db=require(_0x37b1('0x1a'))['db'];config[_0x37b1('0x1b')]=_[_0x37b1('0x1c')](config[_0x37b1('0x1b')],{'host':_0x37b1('0x1d'),'port':0x18eb});var socket=require(_0x37b1('0x1e'))(new Redis(config[_0x37b1('0x1b')]));require(_0x37b1('0x1f'))[_0x37b1('0x20')](socket);function respondWithStatusCode(_0x46c68a,_0x5989f8){_0x5989f8=_0x5989f8||0xcc;return function(_0x3b6bcc){if(_0x3b6bcc){return _0x46c68a['sendStatus'](_0x5989f8);}return _0x46c68a['status'](_0x5989f8)[_0x37b1('0x21')]();};}function respondWithResult(_0x226dc2,_0x2e8971){_0x2e8971=_0x2e8971||0xc8;return function(_0x3d8611){if(_0x3d8611){return _0x226dc2['status'](_0x2e8971)['json'](_0x3d8611);}};}function respondWithFilteredResult(_0x39fa68,_0x1f2e74){return function(_0x304b06){if(_0x304b06){var _0x4135ab=typeof _0x1f2e74[_0x37b1('0x22')]==='undefined'&&typeof _0x1f2e74[_0x37b1('0x23')]===_0x37b1('0x24');var _0x3ee528=_0x304b06[_0x37b1('0x25')];var _0x3d33d4=_0x4135ab?0x0:_0x1f2e74['offset'];var _0x3acc5a=_0x4135ab?_0x304b06[_0x37b1('0x25')]:_0x1f2e74[_0x37b1('0x22')]+_0x1f2e74[_0x37b1('0x23')];var _0x5b1b53;if(_0x3acc5a>=_0x3ee528){_0x3acc5a=_0x3ee528;_0x5b1b53=0xc8;}else{_0x5b1b53=0xce;}_0x39fa68['status'](_0x5b1b53);return _0x39fa68['set']('Content-Range',_0x3d33d4+'-'+_0x3acc5a+'/'+_0x3ee528)['json'](_0x304b06);}return null;};}function patchUpdates(_0x2f5ab4){return function(_0x5ab09a){try{jsonpatch[_0x37b1('0x26')](_0x5ab09a,_0x2f5ab4,!![]);}catch(_0x441264){return BPromise[_0x37b1('0x27')](_0x441264);}return _0x5ab09a[_0x37b1('0x28')]();};}function saveUpdates(_0x19e086,_0x10892c){return function(_0x2b9fd7){if(_0x2b9fd7){return _0x2b9fd7[_0x37b1('0x29')](_0x19e086)[_0x37b1('0x2a')](function(_0xb203fd){return _0xb203fd;});}return null;};}function removeEntity(_0x2969e0,_0x40587c){return function(_0x4e3325){if(_0x4e3325){return _0x4e3325['destroy']()[_0x37b1('0x2a')](function(){var _0x335d56=_0x4e3325[_0x37b1('0x2b')]({'plain':!![]});var _0x414eda='Plugins';return db['UserProfileResource'][_0x37b1('0x2c')]({'where':{'type':_0x414eda,'resourceId':_0x335d56['id']}})['then'](function(){return _0x4e3325;});})[_0x37b1('0x2a')](function(){_0x2969e0[_0x37b1('0x2d')](0xcc)[_0x37b1('0x21')]();});}};}function handleEntityNotFound(_0x34e74f,_0x3fd392){return function(_0x222b9f){if(!_0x222b9f){_0x34e74f[_0x37b1('0x2e')](0x194);}return _0x222b9f;};}function handleError(_0x3b0a4c,_0x276adf){_0x276adf=_0x276adf||0x1f4;return function(_0x4d6cec){logger[_0x37b1('0x2f')](_0x4d6cec[_0x37b1('0x30')]);if(_0x4d6cec[_0x37b1('0x31')]){delete _0x4d6cec[_0x37b1('0x31')];}_0x3b0a4c[_0x37b1('0x2d')](_0x276adf)[_0x37b1('0x32')](_0x4d6cec);};}exports['index']=function(_0x4ea1ce,_0x4ed266){var _0x388abe={},_0x38bbfa={},_0x362a0b={'count':0x0,'rows':[]};var _0x3b03bb=_[_0x37b1('0x33')](db[_0x37b1('0x34')][_0x37b1('0x35')],function(_0x2141bf){return{'name':_0x2141bf[_0x37b1('0x36')],'type':_0x2141bf[_0x37b1('0x37')]['key']};});_0x38bbfa[_0x37b1('0x38')]=_['map'](_0x3b03bb,_0x37b1('0x31'));_0x38bbfa[_0x37b1('0x39')]=_[_0x37b1('0x3a')](_0x4ea1ce[_0x37b1('0x39')]);_0x38bbfa['filters']=_[_0x37b1('0x3b')](_0x38bbfa[_0x37b1('0x38')],_0x38bbfa[_0x37b1('0x39')]);_0x388abe[_0x37b1('0x3c')]=_[_0x37b1('0x3b')](_0x38bbfa[_0x37b1('0x38')],qs[_0x37b1('0x3d')](_0x4ea1ce[_0x37b1('0x39')]['fields']));_0x388abe[_0x37b1('0x3c')]=_0x388abe['attributes'][_0x37b1('0x3e')]?_0x388abe['attributes']:_0x38bbfa[_0x37b1('0x38')];if(!_0x4ea1ce[_0x37b1('0x39')]['hasOwnProperty'](_0x37b1('0x3f'))){_0x388abe[_0x37b1('0x23')]=qs[_0x37b1('0x23')](_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x23')]);_0x388abe[_0x37b1('0x22')]=qs['offset'](_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x22')]);}_0x388abe[_0x37b1('0x40')]=qs['sort'](_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x41')]);_0x388abe[_0x37b1('0x42')]=qs['filters'](_[_0x37b1('0x43')](_0x4ea1ce[_0x37b1('0x39')],_0x38bbfa['filters']),_0x3b03bb);if(_0x4ea1ce['query']['filter']){_0x388abe[_0x37b1('0x42')]=_[_0x37b1('0x44')](_0x388abe[_0x37b1('0x42')],{'$or':_[_0x37b1('0x33')](_0x3b03bb,function(_0x350783){if(_0x350783[_0x37b1('0x37')]!==_0x37b1('0x45')){var _0x49ac25={};_0x49ac25[_0x350783['name']]={'$like':'%'+_0x4ea1ce[_0x37b1('0x39')][_0x37b1('0x46')]+'%'};return _0x49ac25;}})});}_0x388abe=_[_0x37b1('0x44')]({},_0x388abe,_0x4ea1ce[_0x37b1('0x47')]);var _0x118e3e={'where':_0x388abe[_0x37b1('0x42')]};return db[_0x37b1('0x34')][_0x37b1('0x25')](_0x118e3e)[_0x37b1('0x2a')](function(_0x316c2a){_0x362a0b[_0x37b1('0x25')]=_0x316c2a;if(_0x4ea1ce['query'][_0x37b1('0x48')]){_0x388abe[_0x37b1('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x37b1('0x4a')](_0x388abe);})[_0x37b1('0x2a')](function(_0x491e59){_0x362a0b['rows']=_0x491e59;return _0x362a0b;})[_0x37b1('0x2a')](respondWithFilteredResult(_0x4ed266,_0x388abe))['catch'](handleError(_0x4ed266,null));};exports['show']=function(_0xff84f7,_0x82eabc){var _0x290122={'raw':!![],'where':{'id':_0xff84f7[_0x37b1('0x4b')]['id']}},_0x44b1e2={};_0x44b1e2[_0x37b1('0x38')]=_[_0x37b1('0x3a')](db[_0x37b1('0x34')]['rawAttributes']);_0x44b1e2['query']=_[_0x37b1('0x3a')](_0xff84f7[_0x37b1('0x39')]);_0x44b1e2[_0x37b1('0x4c')]=_[_0x37b1('0x3b')](_0x44b1e2['model'],_0x44b1e2[_0x37b1('0x39')]);_0x290122['attributes']=_[_0x37b1('0x3b')](_0x44b1e2[_0x37b1('0x38')],qs[_0x37b1('0x3d')](_0xff84f7[_0x37b1('0x39')][_0x37b1('0x3d')]));_0x290122['attributes']=_0x290122['attributes']['length']?_0x290122['attributes']:_0x44b1e2[_0x37b1('0x38')];if(_0xff84f7[_0x37b1('0x39')]['includeAll']){_0x290122['include']=[{'all':!![]}];}_0x290122=_['merge']({},_0x290122,_0xff84f7[_0x37b1('0x47')]);return db[_0x37b1('0x34')][_0x37b1('0x4d')](_0x290122)[_0x37b1('0x2a')](handleEntityNotFound(_0x82eabc,null))[_0x37b1('0x2a')](respondWithResult(_0x82eabc,null))[_0x37b1('0x4e')](handleError(_0x82eabc,null));};exports[_0x37b1('0x4f')]=function(_0x565650,_0x3ba616,_0x3a8982){return db[_0x37b1('0x34')][_0x37b1('0x4d')]({'where':{'id':_0x565650['params']['id']},'attributes':[_0x37b1('0x31'),'path'],'raw':!![]})[_0x37b1('0x2a')](handleEntityNotFound(_0x3ba616,null))['then'](function(_0x2340c8){if(_0x2340c8){var _0x21f888=path[_0x37b1('0x50')](config[_0x37b1('0x51')],_0x37b1('0x52'),util['format'](_0x37b1('0x53'),path[_0x37b1('0x54')](_0x2340c8[_0x37b1('0x6')])));var _0xbfca55=fs['createWriteStream'](_0x21f888);var _0x7c910=archiver(_0x37b1('0x55'),{'zlib':{'level':0x9}});_0x7c910['on'](_0x37b1('0x56'),function(_0x503758){if(_0x503758[_0x37b1('0x57')]===_0x37b1('0x58')){logger[_0x37b1('0x2f')](_0x503758);}else{throw new db[(_0x37b1('0x59'))][(_0x37b1('0x5a'))](_0x37b1('0x5b'));}});_0x7c910['on'](_0x37b1('0x2f'),function(_0x57e076){throw new db[(_0x37b1('0x59'))][(_0x37b1('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x7c910[_0x37b1('0x5c')](_0xbfca55);_0x7c910[_0x37b1('0x5d')](_0x37b1('0x5e'),{'cwd':path[_0x37b1('0x50')](config[_0x37b1('0x51')],_0x37b1('0x52'),path[_0x37b1('0x5f')](_0x2340c8[_0x37b1('0x6')])),'ignore':[path[_0x37b1('0x50')](path[_0x37b1('0x54')](_0x2340c8['path']),_0x37b1('0x60')),path['join'](path[_0x37b1('0x54')](_0x2340c8['path']),_0x37b1('0x61'))],'nodir':!![]})[_0x37b1('0x62')]();_0xbfca55['on'](_0x37b1('0x63'),function(){if(!fs[_0x37b1('0x64')](_0x21f888)){throw new db['Sequelize'][(_0x37b1('0x5a'))]('Plugin\x20not\x20found');}return _0x3ba616[_0x37b1('0x4f')](_0x21f888,util[_0x37b1('0x65')](_0x37b1('0x53'),path['basename'](_0x2340c8[_0x37b1('0x6')])),function(_0x9b6d4f){if(_0x9b6d4f){throw new db['Sequelize']['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x37b1('0x66')](_0x21f888);logger[_0x37b1('0x67')](_0x37b1('0x68'));logger[_0x37b1('0x67')](_0x37b1('0x69'));});});}return null;})[_0x37b1('0x4e')](handleError(_0x3ba616,null));};exports['upload']=function(_0x5037da,_0x57e4e2,_0x35161c){var _0x264c3a=path[_0x37b1('0x54')](_0x5037da[_0x37b1('0x6a')][_0x37b1('0x6b')],path[_0x37b1('0x6c')](_0x5037da[_0x37b1('0x6a')][_0x37b1('0x6b')]));var _0x51be5e=path[_0x37b1('0x50')](config['root'],_0x37b1('0x52'),_0x5037da['file'][_0x37b1('0x6b')]);var _0x3aea43=path[_0x37b1('0x50')](config['root'],_0x37b1('0x52'),_0x264c3a);logger[_0x37b1('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x51be5e);logger[_0x37b1('0x67')](_0x37b1('0x6d'),_0x3aea43);try{fs[_0x37b1('0x6e')](_0x51be5e,parseInt('0777',0x8));extract(_0x51be5e,{'dir':_0x3aea43},function(_0x360846){if(_0x360846){logger[_0x37b1('0x2f')](_0x360846);handleError(_0x360846,!![]);};var _0x2b5e96=fs[_0x37b1('0x6f')](_0x3aea43);if(_0x2b5e96[_0x37b1('0x3e')]>0x1){removeReferences(_0x51be5e,_0x3aea43);logger['error'](_0x37b1('0x70'));return _0x35161c(new Error(_0x37b1('0x70')));}var _0x518b3c=fs[_0x37b1('0x71')](path['join'](_0x3aea43,_0x2b5e96[0x0]));if(_0x518b3c['isFile']()){removeReferences(_0x51be5e,_0x3aea43);logger[_0x37b1('0x2f')](_0x37b1('0x70'));return _0x35161c(new Error(_0x37b1('0x70')));}if(_0x518b3c['isDirectory']()){var _0x50ad32=fs[_0x37b1('0x6f')](path[_0x37b1('0x50')](_0x3aea43,_0x2b5e96[0x0]));if(_0x50ad32[_0x37b1('0x3e')]===0x0){removeReferences(_0x51be5e,_0x3aea43);logger[_0x37b1('0x2f')]('Invalid\x20plugin\x20structure');return _0x35161c(new Error(_0x37b1('0x70')));}var _0x4cf92c=_0x50ad32['some'](function(_0x3d961b){return _0x3d961b===_0x37b1('0x72');});if(!_0x4cf92c){return _0x35161c(new Error(_0x37b1('0x73')));}var _0x582281=fs[_0x37b1('0x74')](path[_0x37b1('0x50')](_0x3aea43,_0x2b5e96[0x0],_0x37b1('0x72')));var _0x3790c0=JSON[_0x37b1('0x75')](_0x582281);if(_0x37b1('0x24')==typeof _0x3790c0['name']){return _0x35161c(new Error(_0x37b1('0x76')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x37')]){return _0x35161c(new Error(_0x37b1('0x77')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x78')]){return _0x35161c(new Error(_0x37b1('0x79')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')]){return _0x35161c(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3790c0[_0x37b1('0x37')]==='html'){if(_0x37b1('0x24')==typeof _0x3790c0['parameters'][_0x37b1('0x7b')]){return _0x35161c(new Error(_0x37b1('0x7c')));}if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7d')]&&_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7e')]){return _0x35161c(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3790c0['type']==='script'){if(_0x37b1('0x24')==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7f')]){return _0x35161c(new Error(_0x37b1('0x80')));}if('undefined'==typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x81')]){return _0x35161c(new Error(_0x37b1('0x82')));}}else{return _0x35161c(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3b36aa=_0x3790c0['name'];var _0x204da7=_0x3790c0[_0x37b1('0x83')];var _0x546ada=_0x3790c0['type'];var _0x239a95=_0x3790c0[_0x37b1('0x84')]?_0x3790c0['sidebar']:_0x37b1('0x85');var _0x4f9d1a=_0x3790c0[_0x37b1('0x86')]?_0x3790c0[_0x37b1('0x86')]:_0x37b1('0x87');var _0x3a41a7='';var _0x3e30c1='';var _0x5ed035='';var _0x2b36b1='';var _0x3f7afa=_0x3790c0[_0x37b1('0x78')];if(_0x546ada===_0x37b1('0x88')){if(_0x37b1('0x24')!=typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')]['admin']){var _0x42ec10=_0x3790c0[_0x37b1('0x7a')]['views'][_0x37b1('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x42ec10)){_0x3a41a7=path[_0x37b1('0x50')](_0x37b1('0x8a'),_0x264c3a,_0x2b5e96[0x0],_0x42ec10);}else{_0x3a41a7=_0x42ec10;}}else{logger[_0x37b1('0x67')](_0x37b1('0x8b'));}if('undefined'!=typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7e')]){var _0x31e125=_0x3790c0['parameters'][_0x37b1('0x7b')][_0x37b1('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x31e125)){_0x3e30c1=path['join'](_0x37b1('0x8a'),_0x264c3a,_0x2b5e96[0x0],_0x31e125);}else{_0x3e30c1=_0x31e125;}}else{logger['info'](_0x37b1('0x8c'));}}else if(_0x546ada===_0x37b1('0x8d')){_0x5ed035=_0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7f')];_0x2b36b1=_0x3790c0[_0x37b1('0x7a')]['scriptPath'];if(_0x37b1('0x24')!=typeof _0x3790c0[_0x37b1('0x7a')]['views']){if(_0x37b1('0x24')!=typeof _0x3790c0['parameters'][_0x37b1('0x7b')][_0x37b1('0x7d')]){var _0x42ec10=_0x3790c0['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x42ec10)){_0x3a41a7=path['join'](_0x37b1('0x8a'),_0x264c3a,_0x2b5e96[0x0],_0x42ec10);}else{_0x3a41a7=_0x42ec10;}}if(_0x37b1('0x24')!=typeof _0x3790c0[_0x37b1('0x7a')][_0x37b1('0x7b')][_0x37b1('0x7e')]){var _0x31e125=_0x3790c0['parameters'][_0x37b1('0x7b')][_0x37b1('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x37b1('0x89')](_0x31e125)){_0x3e30c1=path[_0x37b1('0x50')]('plugins',_0x264c3a,_0x2b5e96[0x0],_0x31e125);}else{_0x3e30c1=_0x31e125;}}}}var _0x5a8681={'name':_0x3b36aa,'description':_0x204da7,'path':path['join'](_0x264c3a,_0x2b5e96[0x0]),'type':_0x546ada,'sidebar':_0x239a95,'icon':_0x4f9d1a,'adminUrl':_0x3a41a7,'agentUrl':_0x3e30c1,'scriptName':_0x5ed035,'scriptPath':_0x2b36b1,'version':_0x3f7afa};removeReferences(_0x51be5e,null);return db[_0x37b1('0x34')]['create'](_0x5a8681)[_0x37b1('0x2a')](function(_0x3abe08){var _0x5ecebf={'role':_0x5037da[_0x37b1('0x8e')][_0x37b1('0x8f')],'userProfileId':_0x5037da[_0x37b1('0x8e')]['userProfileId']};if(!_0x5ecebf)throw new Error(_0x37b1('0x90'));if(_0x5ecebf[_0x37b1('0x8f')]===_0x37b1('0x91')){var _0x5beca9=_0x3abe08[_0x37b1('0x2b')]({'plain':!![]});return db[_0x37b1('0x92')]['find']({'where':{'name':_0x37b1('0x93'),'userProfileId':_0x5ecebf[_0x37b1('0x94')]},'raw':!![]})[_0x37b1('0x2a')](function(_0x264c92){if(_0x264c92&&_0x264c92[_0x37b1('0x95')]===0x0){return db[_0x37b1('0x96')][_0x37b1('0x97')]({'name':_0x5beca9[_0x37b1('0x31')],'resourceId':_0x5beca9['id'],'type':_0x264c92[_0x37b1('0x31')],'sectionId':_0x264c92['id']},{})[_0x37b1('0x2a')](function(){return _0x3abe08;});}else{return _0x3abe08;}})[_0x37b1('0x4e')](function(_0x1a8930){logger[_0x37b1('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a8930);throw _0x1a8930;});}return _0x3abe08;})['then'](respondWithResult(_0x57e4e2,null))['catch'](handleError(_0x57e4e2,null));}});}catch(_0x28446e){_0x57e4e2[_0x37b1('0x2d')](0x1f4)[_0x37b1('0x32')](_0x28446e);}};function removeReferences(_0x14bad4,_0x153d8e){try{if(_0x14bad4){fs[_0x37b1('0x66')](_0x14bad4);logger['info'](_0x37b1('0x98'));}if(_0x153d8e){rimraf(_0x153d8e,function(){});logger[_0x37b1('0x67')]('Extracted\x20folder\x20removed');}}catch(_0x321a6d){logger[_0x37b1('0x2f')](_0x321a6d);}}exports[_0x37b1('0x29')]=function(_0x57b4f2,_0x5c8b64,_0x147589){return db[_0x37b1('0x34')][_0x37b1('0x4d')]({'where':{'id':_0x57b4f2[_0x37b1('0x4b')]['id']}})[_0x37b1('0x2a')](handleEntityNotFound(_0x5c8b64,null))[_0x37b1('0x2a')](saveUpdates(_0x57b4f2[_0x37b1('0x8e')],null))['then'](respondWithResult(_0x5c8b64,null))[_0x37b1('0x4e')](handleError(_0x5c8b64,null));};exports[_0x37b1('0x99')]=function(_0x150dac,_0x369809,_0x88b4b4){return db['Plugin'][_0x37b1('0x4d')]({'where':{'id':_0x150dac[_0x37b1('0x4b')]['id']}})[_0x37b1('0x2a')](function(_0x28c1aa){if(_0x28c1aa){return _0x28c1aa[_0x37b1('0x2c')]();}})[_0x37b1('0x2a')](function(_0x51d4b1){rimraf(path[_0x37b1('0x50')](config[_0x37b1('0x51')],_0x37b1('0x52'),path[_0x37b1('0x5f')](_0x51d4b1[_0x37b1('0x6')])),function(){});return _0x51d4b1;})[_0x37b1('0x2a')](handleEntityNotFound(_0x369809,null))[_0x37b1('0x2a')](respondWithStatusCode(_0x369809,null))[_0x37b1('0x4e')](handleError(_0x369809,null));};exports[_0x37b1('0x9a')]=function(_0xa5eec0,_0x5c5d15,_0xb94968){return BPromise[_0x37b1('0x9b')]()[_0x37b1('0x2a')](function(){if(!_0xa5eec0[_0x37b1('0x39')]['path']){throw new Error(_0x37b1('0x9c'));}if(!_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9d')]){throw new Error(_0x37b1('0x9e'));}var _0x47582b=_0xa5eec0[_0x37b1('0x39')]['hostname']?_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9f')]+':'+_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9d')]:_0x37b1('0xa0')+_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x9d')];var _0x13ee5c=_0xa5eec0[_0x37b1('0x39')][_0x37b1('0xa1')]?_0xa5eec0[_0x37b1('0x39')][_0x37b1('0xa1')]:!![];var _0x547a9c=_0xa5eec0[_0x37b1('0x39')]['encoding']?_0xa5eec0[_0x37b1('0x39')]['encoding']:null;var _0x1596e9={'method':_0xa5eec0['method'],'uri':util[_0x37b1('0x65')]('%s%s',_0x47582b,_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x6')]),'json':_0x13ee5c,'resolveWithFullResponse':!![],'encoding':_0x547a9c,'qs':_0xa5eec0[_0x37b1('0x39')]};if(_0xa5eec0[_0x37b1('0xa2')]){_0x1596e9[_0x37b1('0xa2')]=_0xa5eec0[_0x37b1('0xa2')];if(_0x1596e9['headers'][_0x37b1('0xa3')]){delete _0x1596e9['headers'][_0x37b1('0xa3')];}}if(_0x1596e9['headers'][_0x37b1('0xa4')]){delete _0x1596e9[_0x37b1('0xa2')][_0x37b1('0xa4')];}return rp(_0x1596e9);})[_0x37b1('0x2a')](function(_0x534fb0){if(_0x534fb0){_0x5c5d15['set'](_0x534fb0['headers']);logger['info'](_0x534fb0[_0x37b1('0x8e')]);if(_[_0x37b1('0xa5')](_0xa5eec0[_0x37b1('0x39')][_0x37b1('0x6')],'download')&&_0x534fb0[_0x37b1('0xa6')]==0x1f4){return _0x5c5d15['sendStatus'](_0x534fb0[_0x37b1('0xa6')]);}else{return _0x5c5d15[_0x37b1('0x2d')](_0x534fb0[_0x37b1('0xa6')])[_0x37b1('0x32')](_0x534fb0[_0x37b1('0x8e')]);}}else{return _0x5c5d15['sendStatus'](0xc8);}})['catch'](handleError(_0x5c5d15,null));};exports[_0x37b1('0xa7')]=function(_0x281ce4,_0x5ada51,_0x403b36){return BPromise['resolve']()[_0x37b1('0x2a')](function(){if(!_0x281ce4[_0x37b1('0x39')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x281ce4[_0x37b1('0x39')][_0x37b1('0x9d')]){throw new Error(_0x37b1('0x9e'));}var _0x28ed4b=_0x281ce4[_0x37b1('0x39')][_0x37b1('0x9f')]?_0x281ce4['query'][_0x37b1('0x9f')]+':'+_0x281ce4[_0x37b1('0x39')][_0x37b1('0x9d')]:_0x37b1('0xa0')+_0x281ce4[_0x37b1('0x39')]['port'];var _0x39a7f5=_0x281ce4['query'][_0x37b1('0xa1')]?_0x281ce4[_0x37b1('0x39')][_0x37b1('0xa1')]:!![];var _0x196ea1=_0x281ce4[_0x37b1('0x39')][_0x37b1('0xa8')]?_0x281ce4[_0x37b1('0x39')]['encoding']:null;var _0x4079f4={'method':_0x281ce4[_0x37b1('0xa9')],'uri':util[_0x37b1('0x65')](_0x37b1('0xaa'),_0x28ed4b,_0x281ce4[_0x37b1('0x39')][_0x37b1('0x6')]),'json':_0x39a7f5,'resolveWithFullResponse':!![],'encoding':_0x196ea1,'body':_0x281ce4[_0x37b1('0x8e')]};if(_0x281ce4[_0x37b1('0xa2')]){_0x4079f4['headers']=_0x281ce4[_0x37b1('0xa2')];if(_0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa3')]){delete _0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa3')];}}if(_0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa4')]){delete _0x4079f4[_0x37b1('0xa2')][_0x37b1('0xa4')];}return rp(_0x4079f4);})[_0x37b1('0x2a')](function(_0x41acc8){if(_0x41acc8){_0x5ada51[_0x37b1('0xab')](_0x41acc8['headers']);logger['info'](_0x41acc8[_0x37b1('0x8e')]);return _0x5ada51[_0x37b1('0x2d')](_0x41acc8[_0x37b1('0xa6')])['send'](_0x41acc8[_0x37b1('0x8e')]);}else{return _0x5ada51[_0x37b1('0x2e')](0xc8);}})[_0x37b1('0x4e')](handleError(_0x5ada51,null));}; \ No newline at end of file +var _0x77d0=['defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Plugins','UserProfileResource','destroy','error','stack','name','index','Plugin','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','download','join','root','server/files/plugins','format','basename','zip','warning','ENOENT','Error','Sequelize','glob','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','file','filename','extname','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','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x8eca22,_0x172a81){var _0x108523=function(_0x2fd5a4){while(--_0x2fd5a4){_0x8eca22['push'](_0x8eca22['shift']());}};_0x108523(++_0x172a81);}(_0x77d0,0x141));var _0x077d=function(_0x1b2b6b,_0x1f9045){_0x1b2b6b=_0x1b2b6b-0x0;var _0x3b8ce4=_0x77d0[_0x1b2b6b];return _0x3b8ce4;};'use strict';var emlformat=require(_0x077d('0x0'));var rimraf=require(_0x077d('0x1'));var zipdir=require(_0x077d('0x2'));var jsonpatch=require(_0x077d('0x3'));var rp=require(_0x077d('0x4'));var moment=require('moment');var BPromise=require(_0x077d('0x5'));var Mustache=require(_0x077d('0x6'));var util=require(_0x077d('0x7'));var path=require(_0x077d('0x8'));var sox=require(_0x077d('0x9'));var csv=require(_0x077d('0xa'));var ejs=require(_0x077d('0xb'));var fs=require('fs');var fs_extra=require(_0x077d('0xc'));var _=require(_0x077d('0xd'));var squel=require(_0x077d('0xe'));var crypto=require(_0x077d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x077d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x077d('0x11'));var extract=require(_0x077d('0x12'));var rimraf=require(_0x077d('0x1'));var archiver=require(_0x077d('0x13'));var Redis=require(_0x077d('0x14'));var authService=require(_0x077d('0x15'));var qs=require(_0x077d('0x16'));var as=require(_0x077d('0x17'));var hardwareService=require(_0x077d('0x18'));var logger=require('../../config/logger')(_0x077d('0x19'));var utils=require(_0x077d('0x1a'));var config=require(_0x077d('0x1b'));var licenseUtil=require(_0x077d('0x1c'));var db=require(_0x077d('0x1d'))['db'];config[_0x077d('0x1e')]=_[_0x077d('0x1f')](config[_0x077d('0x1e')],{'host':_0x077d('0x20'),'port':0x18eb});var socket=require(_0x077d('0x21'))(new Redis(config[_0x077d('0x1e')]));require(_0x077d('0x22'))[_0x077d('0x23')](socket);function respondWithStatusCode(_0x8228ee,_0x5430bf){_0x5430bf=_0x5430bf||0xcc;return function(_0x1b83c6){if(_0x1b83c6){return _0x8228ee[_0x077d('0x24')](_0x5430bf);}return _0x8228ee[_0x077d('0x25')](_0x5430bf)[_0x077d('0x26')]();};}function respondWithResult(_0x45c75e,_0x16109b){_0x16109b=_0x16109b||0xc8;return function(_0x479988){if(_0x479988){return _0x45c75e[_0x077d('0x25')](_0x16109b)[_0x077d('0x27')](_0x479988);}};}function respondWithFilteredResult(_0x316d39,_0x33b8a0){return function(_0x494e3a){if(_0x494e3a){var _0x5bac12=typeof _0x33b8a0['offset']==='undefined'&&typeof _0x33b8a0[_0x077d('0x28')]===_0x077d('0x29');var _0x5da545=_0x494e3a[_0x077d('0x2a')];var _0x56aed8=_0x5bac12?0x0:_0x33b8a0[_0x077d('0x2b')];var _0x22f5a5=_0x5bac12?_0x494e3a[_0x077d('0x2a')]:_0x33b8a0['offset']+_0x33b8a0[_0x077d('0x28')];var _0x3074bc;if(_0x22f5a5>=_0x5da545){_0x22f5a5=_0x5da545;_0x3074bc=0xc8;}else{_0x3074bc=0xce;}_0x316d39[_0x077d('0x25')](_0x3074bc);return _0x316d39[_0x077d('0x2c')](_0x077d('0x2d'),_0x56aed8+'-'+_0x22f5a5+'/'+_0x5da545)[_0x077d('0x27')](_0x494e3a);}return null;};}function patchUpdates(_0xb6838f){return function(_0x34e6f3){try{jsonpatch[_0x077d('0x2e')](_0x34e6f3,_0xb6838f,!![]);}catch(_0x530732){return BPromise[_0x077d('0x2f')](_0x530732);}return _0x34e6f3[_0x077d('0x30')]();};}function saveUpdates(_0x1fd046,_0x16a464){return function(_0xf22bb0){if(_0xf22bb0){return _0xf22bb0[_0x077d('0x31')](_0x1fd046)[_0x077d('0x32')](function(_0x4f4be2){return _0x4f4be2;});}return null;};}function removeEntity(_0x472209,_0x317530){return function(_0x47b11f){if(_0x47b11f){return _0x47b11f['destroy']()[_0x077d('0x32')](function(){var _0x55d037=_0x47b11f[_0x077d('0x33')]({'plain':!![]});var _0x2c0077=_0x077d('0x34');return db[_0x077d('0x35')][_0x077d('0x36')]({'where':{'type':_0x2c0077,'resourceId':_0x55d037['id']}})['then'](function(){return _0x47b11f;});})[_0x077d('0x32')](function(){_0x472209['status'](0xcc)[_0x077d('0x26')]();});}};}function handleEntityNotFound(_0x5c9914,_0x5ec64d){return function(_0xb5c73a){if(!_0xb5c73a){_0x5c9914['sendStatus'](0x194);}return _0xb5c73a;};}function handleError(_0x196eb8,_0x24506b){_0x24506b=_0x24506b||0x1f4;return function(_0x293f2a){logger[_0x077d('0x37')](_0x293f2a[_0x077d('0x38')]);if(_0x293f2a[_0x077d('0x39')]){delete _0x293f2a[_0x077d('0x39')];}_0x196eb8[_0x077d('0x25')](_0x24506b)['send'](_0x293f2a);};}exports[_0x077d('0x3a')]=function(_0x4291c1,_0x4782dd){var _0x2db32e={},_0x45be44={},_0x5cd793={'count':0x0,'rows':[]};var _0x39e192=_['map'](db[_0x077d('0x3b')]['rawAttributes'],function(_0x51981e){return{'name':_0x51981e[_0x077d('0x3c')],'type':_0x51981e[_0x077d('0x3d')][_0x077d('0x3e')]};});_0x45be44[_0x077d('0x3f')]=_[_0x077d('0x40')](_0x39e192,_0x077d('0x39'));_0x45be44[_0x077d('0x41')]=_[_0x077d('0x42')](_0x4291c1[_0x077d('0x41')]);_0x45be44[_0x077d('0x43')]=_[_0x077d('0x44')](_0x45be44[_0x077d('0x3f')],_0x45be44[_0x077d('0x41')]);_0x2db32e['attributes']=_[_0x077d('0x44')](_0x45be44[_0x077d('0x3f')],qs['fields'](_0x4291c1['query'][_0x077d('0x45')]));_0x2db32e[_0x077d('0x46')]=_0x2db32e[_0x077d('0x46')]['length']?_0x2db32e[_0x077d('0x46')]:_0x45be44[_0x077d('0x3f')];if(!_0x4291c1[_0x077d('0x41')][_0x077d('0x47')](_0x077d('0x48'))){_0x2db32e['limit']=qs[_0x077d('0x28')](_0x4291c1[_0x077d('0x41')][_0x077d('0x28')]);_0x2db32e[_0x077d('0x2b')]=qs[_0x077d('0x2b')](_0x4291c1['query'][_0x077d('0x2b')]);}_0x2db32e[_0x077d('0x49')]=qs[_0x077d('0x4a')](_0x4291c1[_0x077d('0x41')][_0x077d('0x4a')]);_0x2db32e[_0x077d('0x4b')]=qs[_0x077d('0x43')](_['pick'](_0x4291c1[_0x077d('0x41')],_0x45be44[_0x077d('0x43')]),_0x39e192);if(_0x4291c1[_0x077d('0x41')]['filter']){_0x2db32e[_0x077d('0x4b')]=_[_0x077d('0x4c')](_0x2db32e['where'],{'$or':_['map'](_0x39e192,function(_0x210bdd){if(_0x210bdd[_0x077d('0x3d')]!==_0x077d('0x4d')){var _0x53349e={};_0x53349e[_0x210bdd[_0x077d('0x39')]]={'$like':'%'+_0x4291c1[_0x077d('0x41')]['filter']+'%'};return _0x53349e;}})});}_0x2db32e=_[_0x077d('0x4c')]({},_0x2db32e,_0x4291c1['options']);var _0x24f96e={'where':_0x2db32e['where']};return db['Plugin'][_0x077d('0x2a')](_0x24f96e)[_0x077d('0x32')](function(_0x59d868){_0x5cd793['count']=_0x59d868;if(_0x4291c1[_0x077d('0x41')][_0x077d('0x4e')]){_0x2db32e['include']=[{'all':!![]}];}return db[_0x077d('0x3b')][_0x077d('0x4f')](_0x2db32e);})[_0x077d('0x32')](function(_0x2c6d3b){_0x5cd793[_0x077d('0x50')]=_0x2c6d3b;return _0x5cd793;})['then'](respondWithFilteredResult(_0x4782dd,_0x2db32e))[_0x077d('0x51')](handleError(_0x4782dd,null));};exports[_0x077d('0x52')]=function(_0x5ac9d8,_0x356111){var _0x45b33f={'raw':!![],'where':{'id':_0x5ac9d8[_0x077d('0x53')]['id']}},_0x22eaf0={};_0x22eaf0[_0x077d('0x3f')]=_[_0x077d('0x42')](db[_0x077d('0x3b')][_0x077d('0x54')]);_0x22eaf0[_0x077d('0x41')]=_[_0x077d('0x42')](_0x5ac9d8[_0x077d('0x41')]);_0x22eaf0['filters']=_['intersection'](_0x22eaf0[_0x077d('0x3f')],_0x22eaf0[_0x077d('0x41')]);_0x45b33f['attributes']=_[_0x077d('0x44')](_0x22eaf0['model'],qs['fields'](_0x5ac9d8['query']['fields']));_0x45b33f['attributes']=_0x45b33f[_0x077d('0x46')][_0x077d('0x55')]?_0x45b33f[_0x077d('0x46')]:_0x22eaf0['model'];if(_0x5ac9d8[_0x077d('0x41')]['includeAll']){_0x45b33f[_0x077d('0x56')]=[{'all':!![]}];}_0x45b33f=_[_0x077d('0x4c')]({},_0x45b33f,_0x5ac9d8[_0x077d('0x57')]);return db[_0x077d('0x3b')][_0x077d('0x58')](_0x45b33f)[_0x077d('0x32')](handleEntityNotFound(_0x356111,null))[_0x077d('0x32')](respondWithResult(_0x356111,null))[_0x077d('0x51')](handleError(_0x356111,null));};exports[_0x077d('0x59')]=function(_0x32f7ec,_0x5a18e7,_0x3f755d){return db['Plugin']['find']({'where':{'id':_0x32f7ec['params']['id']},'attributes':[_0x077d('0x39'),'path'],'raw':!![]})[_0x077d('0x32')](handleEntityNotFound(_0x5a18e7,null))[_0x077d('0x32')](function(_0x43290c){if(_0x43290c){var _0x5cd6dc=path[_0x077d('0x5a')](config[_0x077d('0x5b')],_0x077d('0x5c'),util[_0x077d('0x5d')]('%s.zip',path[_0x077d('0x5e')](_0x43290c[_0x077d('0x8')])));var _0x301a85=fs['createWriteStream'](_0x5cd6dc);var _0x2cddbd=archiver(_0x077d('0x5f'),{'zlib':{'level':0x9}});_0x2cddbd['on'](_0x077d('0x60'),function(_0x260aa4){if(_0x260aa4['code']===_0x077d('0x61')){logger[_0x077d('0x37')](_0x260aa4);}else{throw new db['Sequelize'][(_0x077d('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2cddbd['on'](_0x077d('0x37'),function(_0x14ae60){throw new db[(_0x077d('0x63'))][(_0x077d('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2cddbd['pipe'](_0x301a85);_0x2cddbd[_0x077d('0x64')]('**/*',{'cwd':path[_0x077d('0x5a')](config[_0x077d('0x5b')],_0x077d('0x5c'),path[_0x077d('0x65')](_0x43290c[_0x077d('0x8')])),'ignore':[path['join'](path[_0x077d('0x5e')](_0x43290c[_0x077d('0x8')]),_0x077d('0x66')),path['join'](path['basename'](_0x43290c[_0x077d('0x8')]),_0x077d('0x67'))],'nodir':!![]})[_0x077d('0x68')]();_0x301a85['on']('close',function(){if(!fs[_0x077d('0x69')](_0x5cd6dc)){throw new db[(_0x077d('0x63'))][(_0x077d('0x62'))](_0x077d('0x6a'));}return _0x5a18e7[_0x077d('0x59')](_0x5cd6dc,util[_0x077d('0x5d')](_0x077d('0x6b'),path[_0x077d('0x5e')](_0x43290c[_0x077d('0x8')])),function(_0x2d8daa){if(_0x2d8daa){throw new db[(_0x077d('0x63'))][(_0x077d('0x62'))](_0x077d('0x6c'));}fs[_0x077d('0x6d')](_0x5cd6dc);logger['info'](_0x077d('0x6e'));logger[_0x077d('0x6f')](_0x077d('0x70'));});});}return null;})[_0x077d('0x51')](handleError(_0x5a18e7,null));};exports['upload']=function(_0x134091,_0x585664,_0x21e709){var _0x103bae=path['basename'](_0x134091[_0x077d('0x71')][_0x077d('0x72')],path[_0x077d('0x73')](_0x134091['file'][_0x077d('0x72')]));var _0x587b12=path[_0x077d('0x5a')](config['root'],_0x077d('0x5c'),_0x134091[_0x077d('0x71')]['filename']);var _0x3d8df6=path['join'](config[_0x077d('0x5b')],_0x077d('0x5c'),_0x103bae);logger[_0x077d('0x6f')](_0x077d('0x74'),_0x587b12);logger[_0x077d('0x6f')](_0x077d('0x75'),_0x3d8df6);try{fs[_0x077d('0x76')](_0x587b12,parseInt(_0x077d('0x77'),0x8));extract(_0x587b12,{'dir':_0x3d8df6},function(_0x2ac601){if(_0x2ac601){logger[_0x077d('0x37')](_0x2ac601);handleError(_0x2ac601,!![]);};var _0x251fe0=fs[_0x077d('0x78')](_0x3d8df6);if(_0x251fe0[_0x077d('0x55')]>0x1){removeReferences(_0x587b12,_0x3d8df6);logger[_0x077d('0x37')](_0x077d('0x79'));return _0x21e709(new Error('Invalid\x20plugin\x20structure'));}var _0x51f013=fs[_0x077d('0x7a')](path[_0x077d('0x5a')](_0x3d8df6,_0x251fe0[0x0]));if(_0x51f013[_0x077d('0x7b')]()){removeReferences(_0x587b12,_0x3d8df6);logger['error'](_0x077d('0x79'));return _0x21e709(new Error(_0x077d('0x79')));}if(_0x51f013['isDirectory']()){var _0x5020f6=fs['readdirSync'](path[_0x077d('0x5a')](_0x3d8df6,_0x251fe0[0x0]));if(_0x5020f6[_0x077d('0x55')]===0x0){removeReferences(_0x587b12,_0x3d8df6);logger[_0x077d('0x37')](_0x077d('0x79'));return _0x21e709(new Error(_0x077d('0x79')));}var _0x5b8f18=_0x5020f6[_0x077d('0x7c')](function(_0x14d9b7){return _0x14d9b7===_0x077d('0x7d');});if(!_0x5b8f18){return _0x21e709(new Error(_0x077d('0x7e')));}var _0x5b97dc=fs[_0x077d('0x7f')](path[_0x077d('0x5a')](_0x3d8df6,_0x251fe0[0x0],_0x077d('0x7d')));var _0x55b774=JSON['parse'](_0x5b97dc);if(_0x077d('0x29')==typeof _0x55b774[_0x077d('0x39')]){return _0x21e709(new Error(_0x077d('0x80')));}if('undefined'==typeof _0x55b774[_0x077d('0x3d')]){return _0x21e709(new Error(_0x077d('0x81')));}if('undefined'==typeof _0x55b774[_0x077d('0x82')]){return _0x21e709(new Error(_0x077d('0x83')));}if('undefined'==typeof _0x55b774[_0x077d('0x84')]){return _0x21e709(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x55b774[_0x077d('0x3d')]===_0x077d('0x85')){if(_0x077d('0x29')==typeof _0x55b774[_0x077d('0x84')][_0x077d('0x86')]){return _0x21e709(new Error(_0x077d('0x87')));}if('undefined'==typeof _0x55b774['parameters']['views'][_0x077d('0x88')]&&_0x077d('0x29')==typeof _0x55b774[_0x077d('0x84')][_0x077d('0x86')][_0x077d('0x89')]){return _0x21e709(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x55b774[_0x077d('0x3d')]===_0x077d('0x8a')){if(_0x077d('0x29')==typeof _0x55b774[_0x077d('0x84')][_0x077d('0x8b')]){return _0x21e709(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x077d('0x29')==typeof _0x55b774[_0x077d('0x84')]['scriptPath']){return _0x21e709(new Error(_0x077d('0x8c')));}}else{return _0x21e709(new Error(_0x077d('0x8d')));}var _0x28ece3=_0x55b774[_0x077d('0x39')];var _0x39b745=_0x55b774[_0x077d('0x8e')];var _0x37aeb3=_0x55b774[_0x077d('0x3d')];var _0xf1b377=_0x55b774['sidebar']?_0x55b774['sidebar']:_0x077d('0x8f');var _0x552507=_0x55b774[_0x077d('0x90')]?_0x55b774['icon']:_0x077d('0x91');var _0x7f95fd='';var _0xd22107='';var _0x1e86cd='';var _0x57a86b='';var _0x47f6fb=_0x55b774[_0x077d('0x82')];if(_0x37aeb3==='html'){if('undefined'!=typeof _0x55b774[_0x077d('0x84')][_0x077d('0x86')]['admin']){var _0x47ffac=_0x55b774[_0x077d('0x84')]['views'][_0x077d('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x92')](_0x47ffac)){_0x7f95fd=path[_0x077d('0x5a')](_0x077d('0x93'),_0x103bae,_0x251fe0[0x0],_0x47ffac);}else{_0x7f95fd=_0x47ffac;}}else{logger[_0x077d('0x6f')](_0x077d('0x94'));}if(_0x077d('0x29')!=typeof _0x55b774['parameters'][_0x077d('0x86')][_0x077d('0x89')]){var _0xe6767c=_0x55b774[_0x077d('0x84')]['views'][_0x077d('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x92')](_0xe6767c)){_0xd22107=path[_0x077d('0x5a')](_0x077d('0x93'),_0x103bae,_0x251fe0[0x0],_0xe6767c);}else{_0xd22107=_0xe6767c;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x37aeb3===_0x077d('0x8a')){_0x1e86cd=_0x55b774[_0x077d('0x84')][_0x077d('0x8b')];_0x57a86b=_0x55b774['parameters']['scriptPath'];if(_0x077d('0x29')!=typeof _0x55b774[_0x077d('0x84')][_0x077d('0x86')]){if(_0x077d('0x29')!=typeof _0x55b774[_0x077d('0x84')][_0x077d('0x86')][_0x077d('0x88')]){var _0x47ffac=_0x55b774[_0x077d('0x84')][_0x077d('0x86')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x92')](_0x47ffac)){_0x7f95fd=path[_0x077d('0x5a')]('plugins',_0x103bae,_0x251fe0[0x0],_0x47ffac);}else{_0x7f95fd=_0x47ffac;}}if(_0x077d('0x29')!=typeof _0x55b774[_0x077d('0x84')][_0x077d('0x86')][_0x077d('0x89')]){var _0xe6767c=_0x55b774['parameters'][_0x077d('0x86')][_0x077d('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x92')](_0xe6767c)){_0xd22107=path['join'](_0x077d('0x93'),_0x103bae,_0x251fe0[0x0],_0xe6767c);}else{_0xd22107=_0xe6767c;}}}}var _0xcc86ef={'name':_0x28ece3,'description':_0x39b745,'path':path[_0x077d('0x5a')](_0x103bae,_0x251fe0[0x0]),'type':_0x37aeb3,'sidebar':_0xf1b377,'icon':_0x552507,'adminUrl':_0x7f95fd,'agentUrl':_0xd22107,'scriptName':_0x1e86cd,'scriptPath':_0x57a86b,'version':_0x47f6fb};removeReferences(_0x587b12,null);return db['Plugin'][_0x077d('0x95')](_0xcc86ef)['then'](function(_0x181621){var _0x1c352f={'role':_0x134091[_0x077d('0x96')]['role'],'userProfileId':_0x134091['body'][_0x077d('0x97')]};if(!_0x1c352f)throw new Error(_0x077d('0x98'));if(_0x1c352f[_0x077d('0x99')]===_0x077d('0x9a')){var _0x1059c1=_0x181621[_0x077d('0x33')]({'plain':!![]});return db[_0x077d('0x9b')][_0x077d('0x58')]({'where':{'name':_0x077d('0x34'),'userProfileId':_0x1c352f[_0x077d('0x97')]},'raw':!![]})[_0x077d('0x32')](function(_0x14ce31){if(_0x14ce31&&_0x14ce31['autoAssociation']===0x0){return db[_0x077d('0x35')][_0x077d('0x95')]({'name':_0x1059c1['name'],'resourceId':_0x1059c1['id'],'type':_0x14ce31['name'],'sectionId':_0x14ce31['id']},{})[_0x077d('0x32')](function(){return _0x181621;});}else{return _0x181621;}})['catch'](function(_0xbdd6e5){logger['error'](_0x077d('0x9c'),_0xbdd6e5);throw _0xbdd6e5;});}return _0x181621;})[_0x077d('0x32')](respondWithResult(_0x585664,null))[_0x077d('0x51')](handleError(_0x585664,null));}});}catch(_0xd5dbe1){_0x585664[_0x077d('0x25')](0x1f4)[_0x077d('0x9d')](_0xd5dbe1);}};function removeReferences(_0x26b2b9,_0x6815b){try{if(_0x26b2b9){fs[_0x077d('0x6d')](_0x26b2b9);logger[_0x077d('0x6f')](_0x077d('0x9e'));}if(_0x6815b){rimraf(_0x6815b,function(){});logger['info'](_0x077d('0x9f'));}}catch(_0x50996c){logger[_0x077d('0x37')](_0x50996c);}}exports[_0x077d('0x31')]=function(_0x38b2b3,_0x2a7eef,_0x88ad14){return db[_0x077d('0x3b')][_0x077d('0x58')]({'where':{'id':_0x38b2b3[_0x077d('0x53')]['id']}})[_0x077d('0x32')](handleEntityNotFound(_0x2a7eef,null))['then'](saveUpdates(_0x38b2b3[_0x077d('0x96')],null))[_0x077d('0x32')](respondWithResult(_0x2a7eef,null))[_0x077d('0x51')](handleError(_0x2a7eef,null));};exports['delete']=function(_0x35da41,_0x5e7cba,_0x2639f1){return db['Plugin'][_0x077d('0x58')]({'where':{'id':_0x35da41[_0x077d('0x53')]['id']}})[_0x077d('0x32')](function(_0x3afc29){if(_0x3afc29){return _0x3afc29[_0x077d('0x36')]();}})[_0x077d('0x32')](function(_0x17af16){rimraf(path[_0x077d('0x5a')](config['root'],_0x077d('0x5c'),path[_0x077d('0x65')](_0x17af16[_0x077d('0x8')])),function(){});return _0x17af16;})['then'](handleEntityNotFound(_0x5e7cba,null))[_0x077d('0x32')](respondWithStatusCode(_0x5e7cba,null))['catch'](handleError(_0x5e7cba,null));};exports[_0x077d('0xa0')]=function(_0x31f9a6,_0x30d176,_0x5bd706){return BPromise[_0x077d('0xa1')]()[_0x077d('0x32')](function(){if(!_0x31f9a6[_0x077d('0x41')][_0x077d('0x8')]){throw new Error(_0x077d('0xa2'));}if(!_0x31f9a6['query'][_0x077d('0xa3')]){throw new Error(_0x077d('0xa4'));}var _0x2ad1d6=_0x31f9a6['query'][_0x077d('0xa5')]?_0x31f9a6['query'][_0x077d('0xa5')]+':'+_0x31f9a6['query']['port']:'http://localhost:'+_0x31f9a6[_0x077d('0x41')]['port'];var _0x319715=_0x31f9a6[_0x077d('0x41')]['json']?_0x31f9a6[_0x077d('0x41')][_0x077d('0x27')]:!![];var _0x102946=_0x31f9a6[_0x077d('0x41')][_0x077d('0xa6')]?_0x31f9a6[_0x077d('0x41')]['encoding']:null;var _0x21982c={'method':_0x31f9a6[_0x077d('0xa7')],'uri':util[_0x077d('0x5d')]('%s%s',_0x2ad1d6,_0x31f9a6[_0x077d('0x41')][_0x077d('0x8')]),'json':_0x319715,'resolveWithFullResponse':!![],'encoding':_0x102946,'qs':_0x31f9a6['query']};if(_0x31f9a6[_0x077d('0xa8')]){_0x21982c[_0x077d('0xa8')]=_0x31f9a6[_0x077d('0xa8')];if(_0x21982c[_0x077d('0xa8')][_0x077d('0xa9')]){delete _0x21982c[_0x077d('0xa8')][_0x077d('0xa9')];}}if(_0x21982c[_0x077d('0xa8')]['content-type']){delete _0x21982c[_0x077d('0xa8')][_0x077d('0xaa')];}return rp(_0x21982c);})[_0x077d('0x32')](function(_0x5e901e){if(_0x5e901e){_0x30d176['set'](_0x5e901e[_0x077d('0xa8')]);logger[_0x077d('0x6f')](_0x5e901e['body']);if(_[_0x077d('0xab')](_0x31f9a6['query'][_0x077d('0x8')],_0x077d('0x59'))&&_0x5e901e[_0x077d('0xac')]==0x1f4){return _0x30d176[_0x077d('0x24')](_0x5e901e[_0x077d('0xac')]);}else{return _0x30d176['status'](_0x5e901e[_0x077d('0xac')])[_0x077d('0x9d')](_0x5e901e['body']);}}else{return _0x30d176['sendStatus'](0xc8);}})['catch'](handleError(_0x30d176,null));};exports[_0x077d('0xad')]=function(_0x538c75,_0x3b9e8e,_0x1cab91){return BPromise['resolve']()[_0x077d('0x32')](function(){if(!_0x538c75[_0x077d('0x41')][_0x077d('0x8')]){throw new Error(_0x077d('0xa2'));}if(!_0x538c75['query']['port']){throw new Error(_0x077d('0xa4'));}var _0x1ea55c=_0x538c75[_0x077d('0x41')][_0x077d('0xa5')]?_0x538c75[_0x077d('0x41')][_0x077d('0xa5')]+':'+_0x538c75[_0x077d('0x41')][_0x077d('0xa3')]:_0x077d('0xae')+_0x538c75['query'][_0x077d('0xa3')];var _0x453c81=_0x538c75['query'][_0x077d('0x27')]?_0x538c75[_0x077d('0x41')][_0x077d('0x27')]:!![];var _0x5b309e=_0x538c75[_0x077d('0x41')]['encoding']?_0x538c75[_0x077d('0x41')][_0x077d('0xa6')]:null;var _0x2ea3d2={'method':_0x538c75[_0x077d('0xa7')],'uri':util[_0x077d('0x5d')](_0x077d('0xaf'),_0x1ea55c,_0x538c75[_0x077d('0x41')][_0x077d('0x8')]),'json':_0x453c81,'resolveWithFullResponse':!![],'encoding':_0x5b309e,'body':_0x538c75[_0x077d('0x96')]};if(_0x538c75[_0x077d('0xa8')]){_0x2ea3d2['headers']=_0x538c75[_0x077d('0xa8')];if(_0x2ea3d2[_0x077d('0xa8')]['content-length']){delete _0x2ea3d2['headers'][_0x077d('0xa9')];}}if(_0x2ea3d2[_0x077d('0xa8')][_0x077d('0xaa')]){delete _0x2ea3d2['headers'][_0x077d('0xaa')];}return rp(_0x2ea3d2);})[_0x077d('0x32')](function(_0xd558c4){if(_0xd558c4){_0x3b9e8e[_0x077d('0x2c')](_0xd558c4[_0x077d('0xa8')]);logger['info'](_0xd558c4['body']);return _0x3b9e8e[_0x077d('0x25')](_0xd558c4[_0x077d('0xac')])[_0x077d('0x9d')](_0xd558c4[_0x077d('0x96')]);}else{return _0x3b9e8e[_0x077d('0x24')](0xc8);}})['catch'](handleError(_0x3b9e8e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 77c3a7a..d472e76 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 _0x86f4=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x86f4,0x18a));var _0x486f=function(_0x5b8897,_0x223d65){_0x5b8897=_0x5b8897-0x0;var _0x2b7143=_0x86f4[_0x5b8897];return _0x2b7143;};'use strict';var EventEmitter=require(_0x486f('0x0'));var Plugin=require(_0x486f('0x1'))['db'][_0x486f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x486f('0x3')](0x0);var events={'afterCreate':_0x486f('0x4'),'afterUpdate':_0x486f('0x5'),'afterDestroy':_0x486f('0x6')};function emitEvent(_0x53305d){return function(_0xf8d50f,_0x1539b1,_0x583729){PluginEvents[_0x486f('0x7')](_0x53305d+':'+_0xf8d50f['id'],_0xf8d50f);PluginEvents[_0x486f('0x7')](_0x53305d,_0xf8d50f);_0x583729(null);};}for(var e in events){if(events[_0x486f('0x8')](e)){var event=events[e];Plugin[_0x486f('0x9')](e,emitEvent(event));}}module[_0x486f('0xa')]=PluginEvents; \ No newline at end of file +var _0x195f=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x216696,_0x2e81c8){var _0x5170da=function(_0xcd2272){while(--_0xcd2272){_0x216696['push'](_0x216696['shift']());}};_0x5170da(++_0x2e81c8);}(_0x195f,0x113));var _0xf195=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x195f[_0x23b655];return _0x364b32;};'use strict';var EventEmitter=require(_0xf195('0x0'));var Plugin=require(_0xf195('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xf195('0x2')](0x0);var events={'afterCreate':_0xf195('0x3'),'afterUpdate':'update','afterDestroy':_0xf195('0x4')};function emitEvent(_0x52cf31){return function(_0x127a41,_0x349605,_0x189127){PluginEvents[_0xf195('0x5')](_0x52cf31+':'+_0x127a41['id'],_0x127a41);PluginEvents[_0xf195('0x5')](_0x52cf31,_0x127a41);_0x189127(null);};}for(var e in events){if(events[_0xf195('0x6')](e)){var event=events[e];Plugin[_0xf195('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 489c928..c652a91 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 _0xd5f5=['bluebird','path','rimraf','exports','define','Plugin','plugins','lodash','util','api','moment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd5f5,0x1ca));var _0x5d5f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd5f5[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5d5f('0x0'));var util=require(_0x5d5f('0x1'));var logger=require('../../config/logger')(_0x5d5f('0x2'));var moment=require(_0x5d5f('0x3'));var BPromise=require(_0x5d5f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d5f('0x5'));var rimraf=require(_0x5d5f('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x5d5f('0x7')]=function(_0x54f7c9,_0x73f2ac){return _0x54f7c9[_0x5d5f('0x8')](_0x5d5f('0x9'),attributes,{'tableName':_0x5d5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c96=['moment','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','Plugin','plugins','util','../../config/logger','api'];(function(_0x3868a2,_0x1acd86){var _0x2ed1df=function(_0x1ae007){while(--_0x1ae007){_0x3868a2['push'](_0x3868a2['shift']());}};_0x2ed1df(++_0x1acd86);}(_0x1c96,0x105));var _0x61c9=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x1c96[_0x1bbc08];return _0x5d825b;};'use strict';var _=require('lodash');var util=require(_0x61c9('0x0'));var logger=require(_0x61c9('0x1'))(_0x61c9('0x2'));var moment=require(_0x61c9('0x3'));var BPromise=require('bluebird');var rp=require(_0x61c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61c9('0x5'));var config=require(_0x61c9('0x6'));var attributes=require(_0x61c9('0x7'));module[_0x61c9('0x8')]=function(_0x349bef,_0x454540){return _0x349bef['define'](_0x61c9('0x9'),attributes,{'tableName':_0x61c9('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 609ba68..b30325d 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 _0x9d8c=['body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','create'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x9d8c,0x158));var _0xc9d8=function(_0x1b69d2,_0x5272ba){_0x1b69d2=_0x1b69d2-0x0;var _0x33161e=_0x9d8c[_0x1b69d2];return _0x33161e;};'use strict';var _=require(_0xc9d8('0x0'));var util=require('util');var moment=require(_0xc9d8('0x1'));var BPromise=require(_0xc9d8('0x2'));var rs=require(_0xc9d8('0x3'));var fs=require('fs');var Redis=require(_0xc9d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9d8('0x5'));var logger=require('../../config/logger')(_0xc9d8('0x6'));var config=require(_0xc9d8('0x7'));var jayson=require(_0xc9d8('0x8'));var client=jayson[_0xc9d8('0x9')][_0xc9d8('0xa')]({'port':0x232a});config[_0xc9d8('0xb')]=_['defaults'](config[_0xc9d8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9d8('0xc'))(new Redis(config[_0xc9d8('0xb')]));require('./plugin.socket')[_0xc9d8('0xd')](socket);function respondWithRpcPromise(_0x193a26,_0x5703fc,_0x5b3b80){return new BPromise(function(_0x51a489,_0x492f6e){return client[_0xc9d8('0xe')](_0x193a26,_0x5b3b80)[_0xc9d8('0xf')](function(_0x2b73fc){logger[_0xc9d8('0x10')](_0xc9d8('0x11'),_0x5703fc,_0xc9d8('0x12'));logger[_0xc9d8('0x13')](_0xc9d8('0x14'),_0x5703fc,_0xc9d8('0x12'),JSON[_0xc9d8('0x15')](_0x2b73fc));if(_0x2b73fc[_0xc9d8('0x16')]){if(_0x2b73fc['error'][_0xc9d8('0x17')]===0x1f4){logger[_0xc9d8('0x16')]('Plugin,\x20%s,\x20%s',_0x5703fc,_0x2b73fc[_0xc9d8('0x16')][_0xc9d8('0x18')]);return _0x492f6e(_0x2b73fc['error'][_0xc9d8('0x18')]);}logger[_0xc9d8('0x16')](_0xc9d8('0x11'),_0x5703fc,_0x2b73fc[_0xc9d8('0x16')][_0xc9d8('0x18')]);return _0x51a489(_0x2b73fc[_0xc9d8('0x16')][_0xc9d8('0x18')]);}else{logger[_0xc9d8('0x10')](_0xc9d8('0x11'),_0x5703fc,_0xc9d8('0x12'));_0x51a489(_0x2b73fc[_0xc9d8('0x19')][_0xc9d8('0x18')]);}})['catch'](function(_0x43cc0a){logger['error']('Plugin,\x20%s,\x20%s',_0x5703fc,_0x43cc0a);_0x492f6e(_0x43cc0a);});});}exports[_0xc9d8('0x1a')]=function(_0x55e404){var _0x292ba5=this;return new Promise(function(_0x44278f,_0x1b7ef2){return db['Plugin'][_0xc9d8('0x1b')](_0x55e404[_0xc9d8('0x1c')],{'raw':_0x55e404[_0xc9d8('0x1d')]?_0x55e404[_0xc9d8('0x1d')][_0xc9d8('0x1e')]===undefined?!![]:![]:!![]})[_0xc9d8('0xf')](function(_0x5b6547){logger['info'](_0xc9d8('0x1a'),_0x55e404);logger[_0xc9d8('0x13')](_0xc9d8('0x1a'),_0x55e404,JSON['stringify'](_0x5b6547));_0x44278f(_0x5b6547);})['catch'](function(_0x25462d){logger[_0xc9d8('0x16')]('CreatePlugin',_0x25462d[_0xc9d8('0x18')],_0x55e404);_0x1b7ef2(_0x292ba5['error'](0x1f4,_0x25462d[_0xc9d8('0x18')]));});});}; \ No newline at end of file +var _0x47bf=['create','body','options','raw','info','stringify','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','CreatePlugin','Plugin'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x47bf,0xfc));var _0xf47b=function(_0x33fa9f,_0x47a26a){_0x33fa9f=_0x33fa9f-0x0;var _0x3a6ad5=_0x47bf[_0x33fa9f];return _0x3a6ad5;};'use strict';var _=require(_0xf47b('0x0'));var util=require('util');var moment=require(_0xf47b('0x1'));var BPromise=require(_0xf47b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf47b('0x3'));var db=require(_0xf47b('0x4'))['db'];var utils=require(_0xf47b('0x5'));var logger=require('../../config/logger')(_0xf47b('0x6'));var config=require(_0xf47b('0x7'));var jayson=require(_0xf47b('0x8'));var client=jayson[_0xf47b('0x9')][_0xf47b('0xa')]({'port':0x232a});config[_0xf47b('0xb')]=_[_0xf47b('0xc')](config[_0xf47b('0xb')],{'host':_0xf47b('0xd'),'port':0x18eb});var socket=require(_0xf47b('0xe'))(new Redis(config['redis']));require(_0xf47b('0xf'))[_0xf47b('0x10')](socket);function respondWithRpcPromise(_0x436df4,_0xde0338,_0x1a6c5f){return new BPromise(function(_0x123c8f,_0x1f9c2e){return client[_0xf47b('0x11')](_0x436df4,_0x1a6c5f)[_0xf47b('0x12')](function(_0x43ca60){logger['info']('Plugin,\x20%s,\x20%s',_0xde0338,_0xf47b('0x13'));logger[_0xf47b('0x14')](_0xf47b('0x15'),_0xde0338,_0xf47b('0x13'),JSON['stringify'](_0x43ca60));if(_0x43ca60[_0xf47b('0x16')]){if(_0x43ca60[_0xf47b('0x16')][_0xf47b('0x17')]===0x1f4){logger[_0xf47b('0x16')](_0xf47b('0x18'),_0xde0338,_0x43ca60['error'][_0xf47b('0x19')]);return _0x1f9c2e(_0x43ca60[_0xf47b('0x16')][_0xf47b('0x19')]);}logger['error']('Plugin,\x20%s,\x20%s',_0xde0338,_0x43ca60[_0xf47b('0x16')][_0xf47b('0x19')]);return _0x123c8f(_0x43ca60[_0xf47b('0x16')][_0xf47b('0x19')]);}else{logger['info'](_0xf47b('0x18'),_0xde0338,_0xf47b('0x13'));_0x123c8f(_0x43ca60['result'][_0xf47b('0x19')]);}})['catch'](function(_0x34355e){logger[_0xf47b('0x16')](_0xf47b('0x18'),_0xde0338,_0x34355e);_0x1f9c2e(_0x34355e);});});}exports[_0xf47b('0x1a')]=function(_0x4cb156){var _0x1fafec=this;return new Promise(function(_0x583bfa,_0x598566){return db[_0xf47b('0x1b')][_0xf47b('0x1c')](_0x4cb156[_0xf47b('0x1d')],{'raw':_0x4cb156['options']?_0x4cb156[_0xf47b('0x1e')][_0xf47b('0x1f')]===undefined?!![]:![]:!![]})[_0xf47b('0x12')](function(_0x3752c){logger[_0xf47b('0x20')]('CreatePlugin',_0x4cb156);logger['debug'](_0xf47b('0x1a'),_0x4cb156,JSON[_0xf47b('0x21')](_0x3752c));_0x583bfa(_0x3752c);})[_0xf47b('0x22')](function(_0x16f700){logger['error'](_0xf47b('0x1a'),_0x16f700['message'],_0x4cb156);_0x598566(_0x1fafec['error'](0x1f4,_0x16f700[_0xf47b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5937f23..c415b12 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 _0xa910=['update','length','plugin:','./plugin.events','save'];(function(_0x5785f8,_0x1e9436){var _0x268976=function(_0x3c38b9){while(--_0x3c38b9){_0x5785f8['push'](_0x5785f8['shift']());}};_0x268976(++_0x1e9436);}(_0xa910,0xee));var _0x0a91=function(_0x5e0a43,_0xf13bbc){_0x5e0a43=_0x5e0a43-0x0;var _0x54e061=_0xa910[_0x5e0a43];return _0x54e061;};'use strict';var PluginEvents=require(_0x0a91('0x0'));var events=[_0x0a91('0x1'),'remove',_0x0a91('0x2')];function createListener(_0x3ed1aa,_0x8974e7){return function(_0x1b2b32){_0x8974e7['emit'](_0x3ed1aa,_0x1b2b32);};}function removeListener(_0x5e2479,_0x1ed2c7){return function(){PluginEvents['removeListener'](_0x5e2479,_0x1ed2c7);};}exports['register']=function(_0x6b023c){for(var _0x2c106c=0x0,_0x4aa5c6=events[_0x0a91('0x3')];_0x2c106c<_0x4aa5c6;_0x2c106c++){var _0x5c1a2a=events[_0x2c106c];var _0x476d79=createListener(_0x0a91('0x4')+_0x5c1a2a,_0x6b023c);PluginEvents['on'](_0x5c1a2a,_0x476d79);}}; \ No newline at end of file +var _0xceb9=['update','removeListener','plugin:','./plugin.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceb9,0x1dd));var _0x9ceb=function(_0x7469d8,_0x4fe4fd){_0x7469d8=_0x7469d8-0x0;var _0x53e829=_0xceb9[_0x7469d8];return _0x53e829;};'use strict';var PluginEvents=require(_0x9ceb('0x0'));var events=[_0x9ceb('0x1'),_0x9ceb('0x2'),_0x9ceb('0x3')];function createListener(_0x48f80f,_0x4ad153){return function(_0x4d8615){_0x4ad153['emit'](_0x48f80f,_0x4d8615);};}function removeListener(_0x3bc57b,_0xba77f4){return function(){PluginEvents[_0x9ceb('0x4')](_0x3bc57b,_0xba77f4);};}exports['register']=function(_0x3ab963){for(var _0x5a3b84=0x0,_0xd6967f=events['length'];_0x5a3b84<_0xd6967f;_0x5a3b84++){var _0x1bf1e3=events[_0x5a3b84];var _0x11d139=createListener(_0x9ceb('0x5')+_0x1bf1e3,_0x3ab963);PluginEvents['on'](_0x1bf1e3,_0x11d139);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 55270da..36e37de 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(_0x56489a,_0x1323f0){var _0x2b22c9=function(_0x165f67){while(--_0x165f67){_0x56489a['push'](_0x56489a['shift']());}};_0x2b22c9(++_0x1323f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x445abe,_0x204a9a){var _0x40be6c=function(_0x1b14d0){while(--_0x1b14d0){_0x445abe['push'](_0x445abe['shift']());}};_0x40be6c(++_0x204a9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 9b38ce6..95da994 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 _0xb43b=['stack','name','send','npm\x20install','info','index','list','express','then','describe','catch','create','body','script','join','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','status','json'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2614d3,_0x4b1d22){_0x2614d3=_0x2614d3-0x0;var _0x550b25=_0xb43b[_0x2614d3];return _0x550b25;};'use strict';var _=require(_0xbb43('0x0'));var pm2=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var path=require(_0xbb43('0x3'));var exec=require(_0xbb43('0x4'))['exec'];var BPromise=require(_0xbb43('0x5'));function handleEntityNotFound(_0x41aff6,_0x351254){return function(_0x16432a){if(!_0x16432a){_0x41aff6['sendStatus'](0x194);;}return _0x16432a;};}function respondWithResult(_0x491fb9,_0x378df5){_0x378df5=_0x378df5||0xc8;return function(_0x553520){if(_0x553520){return _0x491fb9[_0xbb43('0x6')](_0x378df5)[_0xbb43('0x7')](_0x553520);}return null;};}function handleError(_0x2a2f11,_0x29ae1a){_0x29ae1a=_0x29ae1a||0x1f4;return function(_0x364718){logger['error'](_0x364718[_0xbb43('0x8')]);if(_0x364718[_0xbb43('0x9')]){delete _0x364718['name'];}_0x2a2f11[_0xbb43('0x6')](_0x29ae1a)[_0xbb43('0xa')](_0x364718);};}function execChildProcess(){return new BPromise(function(_0xd37cdf,_0x5e3611){exec(_0xbb43('0xb'),function(_0x2bef86,_0x480cc2,_0x36a473){logger[_0xbb43('0xc')](_0x480cc2);logger['info'](_0x36a473);if(_0x2bef86){logger['error'](_0x2bef86);return _0x5e3611(_0x2bef86);}return _0xd37cdf(_0x480cc2);});});}exports[_0xbb43('0xd')]=function(_0x4a3714,_0x593d0b){return pm2[_0xbb43('0xe')]()['then'](function(_0x68d45d){if(_0x68d45d){var _0x43021d=_['reject'](_0x68d45d,function(_0x4a6e18){return _0x4a6e18['name']===_0xbb43('0xf')||_0x4a6e18[_0xbb43('0x9')]==='motion2';});return{'rows':_0x43021d,'count':_0x43021d['length']};}return null;})[_0xbb43('0x10')](respondWithResult(_0x593d0b,null))['catch'](handleError(_0x593d0b,null));};exports['show']=function(_0x2b0797,_0x8242ab){return pm2[_0xbb43('0x11')](_0x2b0797['params']['id'])[_0xbb43('0x10')](respondWithResult(_0x8242ab,null))['then'](handleEntityNotFound(_0x8242ab,null))[_0xbb43('0x12')](handleError(_0x8242ab,null));};exports[_0xbb43('0x13')]=function(_0x4dfc54,_0x5d765b){if(_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')]&&_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x15')]){var _0x5bcce7=path[_0xbb43('0x16')](__dirname,'../../files/plugins',_0x4dfc54[_0xbb43('0x14')]['script']);var _0x2f5e31=process['cwd']();process[_0xbb43('0x17')](path[_0xbb43('0x18')](_0x5bcce7));return execChildProcess()['then'](function(_0x1d0768){process['chdir'](_0x2f5e31);return pm2[_0xbb43('0x19')]({'name':_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')],'script':_0x5bcce7});})['then'](function(_0x53f0d5){pm2['dump']();return _0x53f0d5[0x0];})[_0xbb43('0x10')](respondWithResult(_0x5d765b,0xc9))[_0xbb43('0x12')](handleError(_0x5d765b,null));}else{return _0x5d765b['status'](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x1a')});}};exports[_0xbb43('0x1b')]=function(_0x3874fb,_0x4ed43f){if(_0x3874fb['body']['id']){delete _0x3874fb[_0xbb43('0x14')]['id'];}var _0x42800f={'online':_0xbb43('0x1c'),'stopped':_0xbb43('0x1d')};if(_0x42800f[_0xbb43('0x1e')](_0x3874fb[_0xbb43('0x14')][_0xbb43('0x6')])){return pm2[_0x42800f[_0x3874fb[_0xbb43('0x14')]['status']]](_0x3874fb[_0xbb43('0x1f')]['id'])['then'](respondWithResult(_0x4ed43f,0xc8))[_0xbb43('0x12')](handleError(_0x4ed43f,null));}else{return _0x4ed43f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x20')});}};exports['destroy']=function(_0x157d62,_0x547a6f){if(_0x157d62['body']['id']){delete _0x157d62['body']['id'];}if(_0x157d62[_0xbb43('0x1f')]['id']){return pm2['delete'](_0x157d62[_0xbb43('0x1f')]['id'])[_0xbb43('0x10')](function(_0xc577ac){pm2['dump']();return _0xc577ac[0x0];})[_0xbb43('0x10')](respondWithResult(_0x547a6f,null))[_0xbb43('0x12')](handleError(_0x547a6f,null));}else{return _0x547a6f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x21')});}}; \ No newline at end of file +var _0x6c76=['status','npm\x20install','info','error','index','list','then','reject','motion2','length','catch','params','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','send','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','sendStatus','stack','name'];(function(_0xd4cf32,_0x36069d){var _0x16c38f=function(_0x1d235f){while(--_0x1d235f){_0xd4cf32['push'](_0xd4cf32['shift']());}};_0x16c38f(++_0x36069d);}(_0x6c76,0x184));var _0x66c7=function(_0x5259bf,_0x2470ef){_0x5259bf=_0x5259bf-0x0;var _0x8f1a4b=_0x6c76[_0x5259bf];return _0x8f1a4b;};'use strict';var _=require(_0x66c7('0x0'));var pm2=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var path=require(_0x66c7('0x3'));var exec=require(_0x66c7('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x2f6db7,_0x2b7cf3){return function(_0x49d437){if(!_0x49d437){_0x2f6db7[_0x66c7('0x5')](0x194);;}return _0x49d437;};}function respondWithResult(_0x45b0a5,_0x52f71b){_0x52f71b=_0x52f71b||0xc8;return function(_0x23408c){if(_0x23408c){return _0x45b0a5['status'](_0x52f71b)['json'](_0x23408c);}return null;};}function handleError(_0x208d06,_0x2b0065){_0x2b0065=_0x2b0065||0x1f4;return function(_0x24349f){logger['error'](_0x24349f[_0x66c7('0x6')]);if(_0x24349f[_0x66c7('0x7')]){delete _0x24349f[_0x66c7('0x7')];}_0x208d06[_0x66c7('0x8')](_0x2b0065)['send'](_0x24349f);};}function execChildProcess(){return new BPromise(function(_0x464085,_0x45db57){exec(_0x66c7('0x9'),function(_0x187e00,_0x21fb64,_0x406e41){logger[_0x66c7('0xa')](_0x21fb64);logger['info'](_0x406e41);if(_0x187e00){logger[_0x66c7('0xb')](_0x187e00);return _0x45db57(_0x187e00);}return _0x464085(_0x21fb64);});});}exports[_0x66c7('0xc')]=function(_0x35cbc2,_0xea3f56){return pm2[_0x66c7('0xd')]()[_0x66c7('0xe')](function(_0x618bd7){if(_0x618bd7){var _0xf3b04=_[_0x66c7('0xf')](_0x618bd7,function(_0x5d44e1){return _0x5d44e1[_0x66c7('0x7')]==='express'||_0x5d44e1[_0x66c7('0x7')]===_0x66c7('0x10');});return{'rows':_0xf3b04,'count':_0xf3b04[_0x66c7('0x11')]};}return null;})[_0x66c7('0xe')](respondWithResult(_0xea3f56,null))[_0x66c7('0x12')](handleError(_0xea3f56,null));};exports['show']=function(_0x5cf913,_0x53fb36){return pm2['describe'](_0x5cf913[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](respondWithResult(_0x53fb36,null))['then'](handleEntityNotFound(_0x53fb36,null))['catch'](handleError(_0x53fb36,null));};exports[_0x66c7('0x14')]=function(_0x9b65cf,_0x4756f7){if(_0x9b65cf[_0x66c7('0x15')]['name']&&_0x9b65cf['body'][_0x66c7('0x16')]){var _0x237177=path[_0x66c7('0x17')](__dirname,_0x66c7('0x18'),_0x9b65cf[_0x66c7('0x15')][_0x66c7('0x16')]);var _0x4804cf=process[_0x66c7('0x19')]();process[_0x66c7('0x1a')](path['dirname'](_0x237177));return execChildProcess()[_0x66c7('0xe')](function(_0x8b96b1){process[_0x66c7('0x1a')](_0x4804cf);return pm2[_0x66c7('0x1b')]({'name':_0x9b65cf['body'][_0x66c7('0x7')],'script':_0x237177});})[_0x66c7('0xe')](function(_0x5b28e6){pm2[_0x66c7('0x1c')]();return _0x5b28e6[0x0];})[_0x66c7('0xe')](respondWithResult(_0x4756f7,0xc9))[_0x66c7('0x12')](handleError(_0x4756f7,null));}else{return _0x4756f7[_0x66c7('0x8')](0x1f4)[_0x66c7('0x1d')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x4e514a,_0x2dd131){if(_0x4e514a[_0x66c7('0x15')]['id']){delete _0x4e514a['body']['id'];}var _0x9afd50={'online':_0x66c7('0x1e'),'stopped':_0x66c7('0x1f')};if(_0x9afd50[_0x66c7('0x20')](_0x4e514a[_0x66c7('0x15')][_0x66c7('0x8')])){return pm2[_0x9afd50[_0x4e514a['body'][_0x66c7('0x8')]]](_0x4e514a[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](respondWithResult(_0x2dd131,0xc8))[_0x66c7('0x12')](handleError(_0x2dd131,null));}else{return _0x2dd131[_0x66c7('0x8')](0x1f4)['send']({'message':_0x66c7('0x21')});}};exports['destroy']=function(_0xfbd97,_0x543fbf){if(_0xfbd97[_0x66c7('0x15')]['id']){delete _0xfbd97[_0x66c7('0x15')]['id'];}if(_0xfbd97[_0x66c7('0x13')]['id']){return pm2[_0x66c7('0x22')](_0xfbd97[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](function(_0x559ab9){pm2['dump']();return _0x559ab9[0x0];})[_0x66c7('0xe')](respondWithResult(_0x543fbf,null))[_0x66c7('0x12')](handleError(_0x543fbf,null));}else{return _0x543fbf[_0x66c7('0x8')](0x1f4)[_0x66c7('0x1d')]({'message':_0x66c7('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 50d8608..0dd06d1 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfca=['exports','Router','../../components/auth/service','./realtime.controller','/agents','isAuthenticated','getAgents','get','/queues','getQueues'];(function(_0x24f2fc,_0x49769b){var _0x3fbcfa=function(_0x52e3da){while(--_0x52e3da){_0x24f2fc['push'](_0x24f2fc['shift']());}};_0x3fbcfa(++_0x49769b);}(_0xcfca,0x1af));var _0xacfc=function(_0x23a4cc,_0x1b83e7){_0x23a4cc=_0x23a4cc-0x0;var _0x5420cc=_0xcfca[_0x23a4cc];return _0x5420cc;};'use strict';var express=require('express');var router=express[_0xacfc('0x0')]();var auth=require(_0xacfc('0x1'));var controller=require(_0xacfc('0x2'));router['get'](_0xacfc('0x3'),auth[_0xacfc('0x4')](),controller[_0xacfc('0x5')]);router[_0xacfc('0x6')](_0xacfc('0x7'),auth[_0xacfc('0x4')](),controller[_0xacfc('0x8')]);module[_0xacfc('0x9')]=router; \ No newline at end of file +var _0xdd05=['/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents'];(function(_0x1dc337,_0x163446){var _0x2c4d04=function(_0x849e1){while(--_0x849e1){_0x1dc337['push'](_0x1dc337['shift']());}};_0x2c4d04(++_0x163446);}(_0xdd05,0x142));var _0x5dd0=function(_0x39e144,_0x4b4847){_0x39e144=_0x39e144-0x0;var _0x5ba205=_0xdd05[_0x39e144];return _0x5ba205;};'use strict';var express=require(_0x5dd0('0x0'));var router=express[_0x5dd0('0x1')]();var auth=require(_0x5dd0('0x2'));var controller=require(_0x5dd0('0x3'));router[_0x5dd0('0x4')](_0x5dd0('0x5'),auth[_0x5dd0('0x6')](),controller[_0x5dd0('0x7')]);router['get'](_0x5dd0('0x8'),auth[_0x5dd0('0x6')](),controller[_0x5dd0('0x9')]);module[_0x5dd0('0xa')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e91f06d..f3f8c6f 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0350=['merge','where','role','Agents','extraQueryConditions','UserProfile','findAndCountAll','find','getAgentStatus','Status','sortAgentsByStatus','split','getQueues','resolve','startCase','key','name','outbound','dialActive','dialMethod','join','user','userProfileId','voice','QueueCampaigns','Queues','filter','getResources','getRealtimeQueues','catch','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','*pause','then','channel','isValidChannel','format','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','type','agent','online','getOptions','raw','push','literal','FIELD(id,','order','forEach','Pause'];(function(_0x1fe56b,_0x3860ff){var _0x366c40=function(_0x29d3ea){while(--_0x29d3ea){_0x1fe56b['push'](_0x1fe56b['shift']());}};_0x366c40(++_0x3860ff);}(_0x0350,0x114));var _0x0035=function(_0x9c85da,_0x58ca5d){_0x9c85da=_0x9c85da-0x0;var _0x2b124b=_0x0350[_0x9c85da];return _0x2b124b;};'use strict';var _=require('lodash');var util=require(_0x0035('0x0'));var rta=require(_0x0035('0x1'));var rtq=require(_0x0035('0x2'));var qs=require(_0x0035('0x3'));var utils=require(_0x0035('0x4'));var db=require(_0x0035('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x0035('0x6')];var APIHandleError=require(_0x0035('0x7'))[_0x0035('0x8')];function respondWithFilteredResult(_0x3b9766,_0x28fba1){return function(_0x542321){if(_0x542321){var _0x13f769=typeof _0x28fba1[_0x0035('0x9')]===_0x0035('0xa')&&typeof _0x28fba1[_0x0035('0xb')]==='undefined';var _0x32217b=_0x542321[_0x0035('0xc')];var _0x2e1f59=_0x13f769?0x0:_0x28fba1[_0x0035('0x9')];var _0x5cf021=_0x13f769?_0x542321[_0x0035('0xc')]:_0x28fba1[_0x0035('0x9')]+_0x28fba1[_0x0035('0xb')];var _0x35d497;if(_0x5cf021>=_0x32217b){_0x5cf021=_0x32217b;_0x35d497=0xc8;}else{_0x35d497=0xce;}_0x3b9766[_0x0035('0xd')](_0x35d497);return _0x3b9766[_0x0035('0xe')](_0x0035('0xf'),_0x2e1f59+'-'+_0x5cf021+'/'+_0x32217b)[_0x0035('0x10')](_0x542321);}return null;};}exports[_0x0035('0x11')]=function(_0x35536d,_0x2aec01){var _0x149c37={'count':0x0,'rows':[]};var _0x15ac4f={};var _0x2f184c;var _0x54bfd2=utils[_0x0035('0x12')]();var _0x3cadc5;var _0x1ef20c;var _0x354c3b=_0x35536d[_0x0035('0x13')][_0x0035('0x14')];var _0x288fca=_0x35536d[_0x0035('0x13')]['globalStatusFilter'];var _0x34076b=_0x35536d['query'][_0x0035('0x15')];var _0x41301f=_0x288fca===_0x0035('0x16')||_0x288fca===_0x0035('0x17')?!![]:![];var _0x41d1f6=[];var _0x4c6c6f;var _0x44126f;Promise['resolve']()[_0x0035('0x18')](function(){if(_0x35536d[_0x0035('0x13')][_0x0035('0x19')]){if(!utils[_0x0035('0x1a')](_0x35536d[_0x0035('0x13')][_0x0035('0x19')])){throw new APIBadRequestError(util[_0x0035('0x1b')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x35536d[_0x0035('0x13')]['channel']));}_0x2f184c=_0x35536d[_0x0035('0x13')][_0x0035('0x19')][_0x0035('0x1c')]();}if(!_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]||!_0x35536d[_0x0035('0x13')][_0x0035('0x1d')][_0x0035('0x1e')](_0x0035('0x1f'))){_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]=rta[_0x0035('0x20')](_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]);return;}var _0x198309=rta[_0x0035('0x21')](_0x35536d[_0x0035('0x13')]['sort']);_0x35536d[_0x0035('0x13')][_0x0035('0x1d')]=_0x198309[_0x0035('0x22')]['join'](',');_0x4c6c6f=_0x198309['order'];})[_0x0035('0x18')](function(){if(!_0x354c3b){return[];}return rta['getAgentIdsByQueues'](_0x354c3b,_0x2f184c);})[_0x0035('0x18')](function(_0xc65877){_0x41d1f6=_0xc65877;return rta['getRealtimeAgents']();})[_0x0035('0x18')](function(_0x3743c1){_0x1ef20c=_0x3743c1[_0x0035('0x23')];if((!_0x288fca||_0x41301f)&&!_0x4c6c6f){return _0x41d1f6;}if(_0x4c6c6f&&!_0x288fca){return rta[_0x0035('0x24')](_0x1ef20c,_0x41d1f6,_0x4c6c6f);}else{return rta['getAgentIdsByStatus'](_0x1ef20c,_0x41d1f6,_0x288fca);}})[_0x0035('0x18')](function(_0x1b23f6){_0x41d1f6=_0x1b23f6;var _0x14c3ec=![];if(_0x41d1f6[_0x0035('0x25')]===0x0){if(_0x354c3b||_0x288fca){_0x14c3ec=!![];}if(_0x41301f){_0x14c3ec=![];}}if(_0x14c3ec){return _0x149c37;}var _0x4e9f1d=_[_0x0035('0x26')](db[_0x0035('0x27')][_0x0035('0x28')],function(_0x173437){return{'name':_0x173437['fieldName'],'type':_0x173437[_0x0035('0x29')]['key']};});_0x35536d[_0x0035('0x13')]['role']=_0x0035('0x2a');_0x35536d[_0x0035('0x13')][_0x0035('0x2b')]=!![];_0x15ac4f=qs[_0x0035('0x2c')](_0x4e9f1d,_0x35536d);_0x15ac4f[_0x0035('0x2d')]=!![];var _0x58595e=[];if(_0x41d1f6[_0x0035('0x25')]>0x0){_0x58595e[_0x0035('0x2e')]({'id':{'$in':_0x41d1f6}});if(_0x4c6c6f&&!_0x288fca){_0x44126f=[db['sequelize'][_0x0035('0x2f')](_0x0035('0x30')+_0x41d1f6+')')];_0x15ac4f[_0x0035('0x31')]=_0x44126f;}}if(_0x41301f){_0x54bfd2[_0x0035('0x32')](function(_0x1d946c){var _0x2a87db=!![];if(_0x288fca==='*pause'&&_0x2f184c!==_0x1d946c){_0x2a87db=![];}_0x58595e[_0x0035('0x2e')]({[_0x1d946c+'Pause']:_0x2a87db});});if(_0x34076b){_0x58595e['push']({'pauseType':_0x34076b});}}else if(_0x288fca){_0x54bfd2[_0x0035('0x32')](function(_0x2e2f52){_0x58595e[_0x0035('0x2e')]({[_0x2e2f52+_0x0035('0x33')]:![]});});}_0x15ac4f['where']=_[_0x0035('0x34')](_0x15ac4f[_0x0035('0x35')],{'$and':_0x58595e});if(_0x35536d['user'][_0x0035('0x36')]==='user'){var _0x1b48fc={'params':{'id':_0x35536d['user']['userProfileId']},'query':{'section':_0x0035('0x37'),'role':_0x0035('0x2a'),'online':!![],'raw':!![],'ids':_0x41d1f6,'customSorting':_0x44126f}};if(_0x41301f){_0x1b48fc[_0x0035('0x13')][_0x0035('0x38')]=_0x58595e;}_0x1b48fc[_0x0035('0x13')]=Object['assign'](_0x1b48fc[_0x0035('0x13')],_0x35536d[_0x0035('0x13')]);delete _0x1b48fc[_0x0035('0x13')]['id'];return db[_0x0035('0x39')]['getResources'](_0x1b48fc);}return db[_0x0035('0x27')][_0x0035('0x3a')](_0x15ac4f);})[_0x0035('0x18')](function(_0x2a48cd){_0x149c37[_0x0035('0xc')]=_0x2a48cd[_0x0035('0xc')];_0x3cadc5=_0x2a48cd[_0x0035('0x23')];return _0x3cadc5[_0x0035('0x26')](function(_0x8f184b){var _0x5df449=_[_0x0035('0x3b')](_0x1ef20c,['id',_0x8f184b['id']]);if(_0x5df449){var _0x19781b=rta['filterAgentAttributes'](_0x5df449);_['merge'](_0x8f184b,_0x19781b);}_0x8f184b['globalStatus']=rta[_0x0035('0x3c')](_0x8f184b);if(_0x8f184b['globalStatus'][_0x0035('0x1e')](_0x0035('0x16'))){_0x54bfd2['forEach'](function(_0x3ec0d2){if(_0x8f184b[_0x3ec0d2+_0x0035('0x33')]){_0x8f184b[_0x3ec0d2+_0x0035('0x3d')]=_0x0035('0x16');}});}return _0x8f184b;});})['then'](function(_0x491c57){if(!_0x4c6c6f||_0x44126f){return _0x491c57;}return rta[_0x0035('0x3e')](_0x491c57,_0x4c6c6f);})[_0x0035('0x18')](function(_0x2fb5cc){var _0x3fc8f6=null;if(_0x35536d[_0x0035('0x13')][_0x0035('0x22')]){var _0x588764=_0x35536d[_0x0035('0x13')]['fields'][_0x0035('0x3f')](',');_0x3fc8f6=_0x2fb5cc[_0x0035('0x26')](function(_0x3c4894){return _['pick'](_0x3c4894,_0x588764);});}_0x149c37[_0x0035('0x23')]=_0x3fc8f6||_0x2fb5cc;return _0x149c37;})[_0x0035('0x18')](respondWithFilteredResult(_0x2aec01,_0x15ac4f))['catch'](APIHandleError(_0x2aec01));};exports[_0x0035('0x40')]=function(_0x98a5f3,_0x45882c){var _0xbd9797={'count':0x0,'rows':[]};var _0x2716b5={};var _0x580f75;var _0x3f1530;var _0xf4ed44;Promise[_0x0035('0x41')]()['then'](function(){if(_0x98a5f3[_0x0035('0x13')][_0x0035('0x19')]){if(!utils[_0x0035('0x1a')](_0x98a5f3['query'][_0x0035('0x19')])){throw new APIBadRequestError(util[_0x0035('0x1b')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x98a5f3[_0x0035('0x13')]['channel']));}_0x580f75=_0x98a5f3['query'][_0x0035('0x19')][_0x0035('0x1c')]();}var _0xc9876c=_[_0x0035('0x42')](_0x580f75)+'Queue';var _0x3b1b73=_[_0x0035('0x26')](db[_0xc9876c]['rawAttributes'],function(_0x586bb3){return{'name':_0x586bb3['fieldName'],'type':_0x586bb3[_0x0035('0x29')][_0x0035('0x43')]};});if(!_0x98a5f3[_0x0035('0x13')][_0x0035('0x22')]){var _0x12976f=['id',_0x0035('0x44')];if(_0x580f75==='voice'){_0x12976f['push'](_0x0035('0x29'));if(_0x98a5f3[_0x0035('0x13')]['type']===_0x0035('0x45')){_0x12976f[_0x0035('0x2e')]([_0x0035('0x46'),_0x0035('0x47')]);}}_0x98a5f3[_0x0035('0x13')][_0x0035('0x22')]=_0x12976f[_0x0035('0x48')](',');}_0x2716b5=qs[_0x0035('0x2c')](_0x3b1b73,_0x98a5f3);if(_0x98a5f3['user']['role']===_0x0035('0x49')){var _0x3a2ecc={'params':{'id':_0x98a5f3[_0x0035('0x49')][_0x0035('0x4a')]},'query':{'section':_0x580f75===_0x0035('0x4b')&&_0x98a5f3[_0x0035('0x13')][_0x0035('0x29')]===_0x0035('0x45')?_0x0035('0x4c'):_[_0x0035('0x42')](_0x580f75)+_0x0035('0x4d'),'type':_0x98a5f3[_0x0035('0x13')][_0x0035('0x29')],'nolimit':!![],'sort':'name','filter':_0x98a5f3[_0x0035('0x13')][_0x0035('0x4e')]}};return db['UserProfile'][_0x0035('0x4f')](_0x3a2ecc);}return db[_0xc9876c][_0x0035('0x3a')](_0x2716b5);})[_0x0035('0x18')](function(_0x5a9385){_0xbd9797[_0x0035('0xc')]=_0x5a9385[_0x0035('0xc')];_0x3f1530=_0x5a9385[_0x0035('0x23')];return rtq[_0x0035('0x50')](_0x98a5f3,_0x580f75);})[_0x0035('0x18')](function(_0x576abf){_0xf4ed44=_0x576abf[_0x0035('0x23')];return rtq['initializeQueues'](_0x3f1530,_0xf4ed44,_0x580f75,_0x98a5f3[_0x0035('0x13')][_0x0035('0x29')]);})[_0x0035('0x18')](function(_0xe91194){_0xbd9797[_0x0035('0x23')]=_0xe91194;return _0xbd9797;})['then'](respondWithFilteredResult(_0x45882c,_0x2716b5))[_0x0035('0x51')](APIHandleError(_0x45882c));}; \ No newline at end of file +var _0x6a30=['util','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','undefined','limit','count','status','set','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','resolve','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','validateSortParameter','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','*pause','Pause','where','merge','user','role','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','getAgentStatus','Status','fields','split','pick','rows','catch','getQueues','toLowerCase','startCase','key','name','voice','dialMethod','outbound','QueueCampaigns','Queues','filter','initializeQueues','lodash'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x6a30,0xf8));var _0x06a3=function(_0x11bd55,_0x275827){_0x11bd55=_0x11bd55-0x0;var _0x3be4aa=_0x6a30[_0x11bd55];return _0x3be4aa;};'use strict';var _=require(_0x06a3('0x0'));var util=require(_0x06a3('0x1'));var rta=require(_0x06a3('0x2'));var rtq=require(_0x06a3('0x3'));var qs=require('../../components/parsers/qs');var utils=require(_0x06a3('0x4'));var db=require(_0x06a3('0x5'))['db'];var APIBadRequestError=require(_0x06a3('0x6'))[_0x06a3('0x7')];var APIHandleError=require('../../errors/api')['handleError'];function respondWithFilteredResult(_0x1803ba,_0x3de329){return function(_0x2ede65){if(_0x2ede65){var _0x21210a=typeof _0x3de329[_0x06a3('0x8')]===_0x06a3('0x9')&&typeof _0x3de329[_0x06a3('0xa')]===_0x06a3('0x9');var _0x3e15ae=_0x2ede65[_0x06a3('0xb')];var _0x1b311a=_0x21210a?0x0:_0x3de329['offset'];var _0x3b2067=_0x21210a?_0x2ede65[_0x06a3('0xb')]:_0x3de329['offset']+_0x3de329[_0x06a3('0xa')];var _0xc04a77;if(_0x3b2067>=_0x3e15ae){_0x3b2067=_0x3e15ae;_0xc04a77=0xc8;}else{_0xc04a77=0xce;}_0x1803ba[_0x06a3('0xc')](_0xc04a77);return _0x1803ba[_0x06a3('0xd')]('Content-Range',_0x1b311a+'-'+_0x3b2067+'/'+_0x3e15ae)[_0x06a3('0xe')](_0x2ede65);}return null;};}exports[_0x06a3('0xf')]=function(_0x85706,_0x3eebb9){var _0x46b0f6={'count':0x0,'rows':[]};var _0x388ed4={};var _0x39955d;var _0x2c56bc=utils[_0x06a3('0x10')]();var _0x255645;var _0x2319d9;var _0x1c78c8=_0x85706[_0x06a3('0x11')]['globalQueueFilter'];var _0x3c0c12=_0x85706[_0x06a3('0x11')][_0x06a3('0x12')];var _0x3bf381=_0x85706['query'][_0x06a3('0x13')];var _0x958d51=_0x3c0c12===_0x06a3('0x14')||_0x3c0c12==='*pause'?!![]:![];var _0x11b95d=[];var _0x55a2e0;var _0xc1f01a;Promise[_0x06a3('0x15')]()[_0x06a3('0x16')](function(){if(_0x85706[_0x06a3('0x11')]['channel']){if(!utils[_0x06a3('0x17')](_0x85706['query'][_0x06a3('0x18')])){throw new APIBadRequestError(util[_0x06a3('0x19')](_0x06a3('0x1a'),_0x85706['query'][_0x06a3('0x18')]));}_0x39955d=_0x85706[_0x06a3('0x11')][_0x06a3('0x18')]['toLowerCase']();}if(!_0x85706[_0x06a3('0x11')]['sort']||!_0x85706[_0x06a3('0x11')][_0x06a3('0x1b')][_0x06a3('0x1c')](_0x06a3('0x1d'))){_0x85706[_0x06a3('0x11')]['sort']=rta[_0x06a3('0x1e')](_0x85706[_0x06a3('0x11')][_0x06a3('0x1b')]);return;}var _0x1e3116=rta['getUpdatedSortOptions'](_0x85706['query']['sort']);_0x85706[_0x06a3('0x11')][_0x06a3('0x1b')]=_0x1e3116['fields'][_0x06a3('0x1f')](',');_0x55a2e0=_0x1e3116[_0x06a3('0x20')];})[_0x06a3('0x16')](function(){if(!_0x1c78c8){return[];}return rta[_0x06a3('0x21')](_0x1c78c8,_0x39955d);})[_0x06a3('0x16')](function(_0x88711d){_0x11b95d=_0x88711d;return rta[_0x06a3('0x22')]();})[_0x06a3('0x16')](function(_0x1e6110){_0x2319d9=_0x1e6110['rows'];if((!_0x3c0c12||_0x958d51)&&!_0x55a2e0){return _0x11b95d;}if(_0x55a2e0&&!_0x3c0c12){return rta[_0x06a3('0x23')](_0x2319d9,_0x11b95d,_0x55a2e0);}else{return rta[_0x06a3('0x24')](_0x2319d9,_0x11b95d,_0x3c0c12);}})[_0x06a3('0x16')](function(_0x380065){_0x11b95d=_0x380065;var _0xa34ad0=![];if(_0x11b95d[_0x06a3('0x25')]===0x0){if(_0x1c78c8||_0x3c0c12){_0xa34ad0=!![];}if(_0x958d51){_0xa34ad0=![];}}if(_0xa34ad0){return _0x46b0f6;}var _0xa89c76=_[_0x06a3('0x26')](db[_0x06a3('0x27')][_0x06a3('0x28')],function(_0x19440c){return{'name':_0x19440c[_0x06a3('0x29')],'type':_0x19440c[_0x06a3('0x2a')]['key']};});_0x85706['query']['role']=_0x06a3('0x2b');_0x85706[_0x06a3('0x11')]['online']=!![];_0x388ed4=qs[_0x06a3('0x2c')](_0xa89c76,_0x85706);_0x388ed4[_0x06a3('0x2d')]=!![];var _0x50048f=[];if(_0x11b95d[_0x06a3('0x25')]>0x0){_0x50048f[_0x06a3('0x2e')]({'id':{'$in':_0x11b95d}});if(_0x55a2e0&&!_0x3c0c12){_0xc1f01a=[db[_0x06a3('0x2f')][_0x06a3('0x30')](_0x06a3('0x31')+_0x11b95d+')')];_0x388ed4[_0x06a3('0x20')]=_0xc1f01a;}}if(_0x958d51){_0x2c56bc[_0x06a3('0x32')](function(_0x464acd){var _0x42a8a7=!![];if(_0x3c0c12===_0x06a3('0x33')&&_0x39955d!==_0x464acd){_0x42a8a7=![];}_0x50048f[_0x06a3('0x2e')]({[_0x464acd+_0x06a3('0x34')]:_0x42a8a7});});if(_0x3bf381){_0x50048f[_0x06a3('0x2e')]({'pauseType':_0x3bf381});}}else if(_0x3c0c12){_0x2c56bc[_0x06a3('0x32')](function(_0x2aecee){_0x50048f['push']({[_0x2aecee+_0x06a3('0x34')]:![]});});}_0x388ed4[_0x06a3('0x35')]=_[_0x06a3('0x36')](_0x388ed4[_0x06a3('0x35')],{'$and':_0x50048f});if(_0x85706[_0x06a3('0x37')][_0x06a3('0x38')]===_0x06a3('0x37')){var _0x1c9200={'params':{'id':_0x85706[_0x06a3('0x37')][_0x06a3('0x39')]},'query':{'section':'Agents','role':_0x06a3('0x2b'),'online':!![],'raw':!![],'ids':_0x11b95d,'customSorting':_0xc1f01a}};if(_0x958d51){_0x1c9200['query'][_0x06a3('0x3a')]=_0x50048f;}_0x1c9200[_0x06a3('0x11')]=Object[_0x06a3('0x3b')](_0x1c9200[_0x06a3('0x11')],_0x85706[_0x06a3('0x11')]);delete _0x1c9200[_0x06a3('0x11')]['id'];return db[_0x06a3('0x3c')][_0x06a3('0x3d')](_0x1c9200);}return db[_0x06a3('0x27')][_0x06a3('0x3e')](_0x388ed4);})[_0x06a3('0x16')](function(_0x1b05d3){_0x46b0f6['count']=_0x1b05d3[_0x06a3('0xb')];_0x255645=_0x1b05d3['rows'];return _0x255645['map'](function(_0x5d8f8a){var _0x3a061e=_[_0x06a3('0x3f')](_0x2319d9,['id',_0x5d8f8a['id']]);if(_0x3a061e){var _0x58dc1b=rta['filterAgentAttributes'](_0x3a061e);_[_0x06a3('0x36')](_0x5d8f8a,_0x58dc1b);}_0x5d8f8a['globalStatus']=rta[_0x06a3('0x40')](_0x5d8f8a);if(_0x5d8f8a[_0x06a3('0x1d')]['includes'](_0x06a3('0x14'))){_0x2c56bc['forEach'](function(_0x1bfc90){if(_0x5d8f8a[_0x1bfc90+_0x06a3('0x34')]){_0x5d8f8a[_0x1bfc90+_0x06a3('0x41')]=_0x06a3('0x14');}});}return _0x5d8f8a;});})['then'](function(_0x1d288f){if(!_0x55a2e0||_0xc1f01a){return _0x1d288f;}return rta['sortAgentsByStatus'](_0x1d288f,_0x55a2e0);})[_0x06a3('0x16')](function(_0x34b62c){var _0x4e02eb=null;if(_0x85706[_0x06a3('0x11')][_0x06a3('0x42')]){var _0x1c65c1=_0x85706[_0x06a3('0x11')][_0x06a3('0x42')][_0x06a3('0x43')](',');_0x4e02eb=_0x34b62c['map'](function(_0x1fd16e){return _[_0x06a3('0x44')](_0x1fd16e,_0x1c65c1);});}_0x46b0f6[_0x06a3('0x45')]=_0x4e02eb||_0x34b62c;return _0x46b0f6;})[_0x06a3('0x16')](respondWithFilteredResult(_0x3eebb9,_0x388ed4))[_0x06a3('0x46')](APIHandleError(_0x3eebb9));};exports[_0x06a3('0x47')]=function(_0x325a17,_0x2faffc){var _0xa547c9={'count':0x0,'rows':[]};var _0x18693f={};var _0x401d18;var _0x59ac18;var _0x3e356e;Promise['resolve']()[_0x06a3('0x16')](function(){if(_0x325a17[_0x06a3('0x11')][_0x06a3('0x18')]){if(!utils[_0x06a3('0x17')](_0x325a17[_0x06a3('0x11')][_0x06a3('0x18')])){throw new APIBadRequestError(util[_0x06a3('0x19')](_0x06a3('0x1a'),_0x325a17[_0x06a3('0x11')]['channel']));}_0x401d18=_0x325a17[_0x06a3('0x11')][_0x06a3('0x18')][_0x06a3('0x48')]();}var _0x384a28=_[_0x06a3('0x49')](_0x401d18)+'Queue';var _0x427e06=_[_0x06a3('0x26')](db[_0x384a28][_0x06a3('0x28')],function(_0x11ff27){return{'name':_0x11ff27[_0x06a3('0x29')],'type':_0x11ff27[_0x06a3('0x2a')][_0x06a3('0x4a')]};});if(!_0x325a17['query'][_0x06a3('0x42')]){var _0x41b295=['id',_0x06a3('0x4b')];if(_0x401d18===_0x06a3('0x4c')){_0x41b295[_0x06a3('0x2e')]('type');if(_0x325a17['query'][_0x06a3('0x2a')]==='outbound'){_0x41b295['push'](['dialActive',_0x06a3('0x4d')]);}}_0x325a17['query'][_0x06a3('0x42')]=_0x41b295[_0x06a3('0x1f')](',');}_0x18693f=qs[_0x06a3('0x2c')](_0x427e06,_0x325a17);if(_0x325a17[_0x06a3('0x37')]['role']==='user'){var _0x1c1772={'params':{'id':_0x325a17[_0x06a3('0x37')]['userProfileId']},'query':{'section':_0x401d18===_0x06a3('0x4c')&&_0x325a17[_0x06a3('0x11')]['type']===_0x06a3('0x4e')?_0x06a3('0x4f'):_[_0x06a3('0x49')](_0x401d18)+_0x06a3('0x50'),'type':_0x325a17[_0x06a3('0x11')]['type'],'nolimit':!![],'sort':'name','filter':_0x325a17[_0x06a3('0x11')][_0x06a3('0x51')]}};return db['UserProfile'][_0x06a3('0x3d')](_0x1c1772);}return db[_0x384a28][_0x06a3('0x3e')](_0x18693f);})[_0x06a3('0x16')](function(_0x3a3eb2){_0xa547c9[_0x06a3('0xb')]=_0x3a3eb2[_0x06a3('0xb')];_0x59ac18=_0x3a3eb2['rows'];return rtq['getRealtimeQueues'](_0x325a17,_0x401d18);})[_0x06a3('0x16')](function(_0x4e1e5d){_0x3e356e=_0x4e1e5d[_0x06a3('0x45')];return rtq[_0x06a3('0x52')](_0x59ac18,_0x3e356e,_0x401d18,_0x325a17[_0x06a3('0x11')][_0x06a3('0x2a')]);})['then'](function(_0x430aed){_0xa547c9[_0x06a3('0x45')]=_0x430aed;return _0xa547c9;})[_0x06a3('0x16')](respondWithFilteredResult(_0x2faffc,_0x18693f))[_0x06a3('0x46')](APIHandleError(_0x2faffc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 82a1c43..58587c6 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x45ebfc,_0x5be1b0){var _0x4aace6=function(_0x5c658e){while(--_0x5c658e){_0x45ebfc['push'](_0x45ebfc['shift']());}};_0x4aace6(++_0x5be1b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5e4633,_0x2cf0d0){var _0x3edbc0=function(_0x3d1b40){while(--_0x3d1b40){_0x5e4633['push'](_0x5e4633['shift']());}};_0x3edbc0(++_0x2cf0d0);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index a81c3c6..11fb189 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 _0x4c60=['STRING','sequelize','exports','INTEGER'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x4c60,0xc1));var _0x04c6=function(_0x278fc7,_0xf91f4a){_0x278fc7=_0x278fc7-0x0;var _0x115624=_0x4c60[_0x278fc7];return _0x115624;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'state':{'type':Sequelize[_0x04c6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x04c6('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x04c6('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x04c6('0x3')]},'membername':{'type':Sequelize[_0x04c6('0x3')]}}; \ No newline at end of file +var _0xea1c=['INTEGER','STRING','DATE'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xcea1('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xcea1('0x1')]},'scheduledat':{'type':Sequelize[_0xcea1('0x2')]},'uniqueid':{'type':Sequelize[_0xcea1('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xcea1('0x2')]},'ringtime':{'type':Sequelize[_0xcea1('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xcea1('0x1')]},'campaigntype':{'type':Sequelize[_0xcea1('0x1')]},'membername':{'type':Sequelize[_0xcea1('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b5c271d..261ebde 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 _0xb7de=['./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x46378d,_0x7ec891){var _0x464c58=function(_0xae6691){while(--_0xae6691){_0x46378d['push'](_0x46378d['shift']());}};_0x464c58(++_0x7ec891);}(_0xb7de,0x1d8));var _0xeb7d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xb7de[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))(_0xeb7d('0x3'));var moment=require(_0xeb7d('0x4'));var BPromise=require('bluebird');var rp=require(_0xeb7d('0x5'));var fs=require('fs');var path=require(_0xeb7d('0x6'));var rimraf=require(_0xeb7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7d('0x8'));module[_0xeb7d('0x9')]=function(_0x4847ea,_0x429914){return _0x4847ea['define'](_0xeb7d('0xa'),attributes,{'tableName':_0xeb7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8cc=['moment','bluebird','rimraf','./reportAgentPreview.attributes','exports','ReportAgentPreview','util','../../config/logger','api'];(function(_0x3fc334,_0x1e5df6){var _0x1a02d9=function(_0x269361){while(--_0x269361){_0x3fc334['push'](_0x3fc334['shift']());}};_0x1a02d9(++_0x1e5df6);}(_0xa8cc,0xf9));var _0xca8c=function(_0x4c0353,_0x91991d){_0x4c0353=_0x4c0353-0x0;var _0x279424=_0xa8cc[_0x4c0353];return _0x279424;};'use strict';var _=require('lodash');var util=require(_0xca8c('0x0'));var logger=require(_0xca8c('0x1'))(_0xca8c('0x2'));var moment=require(_0xca8c('0x3'));var BPromise=require(_0xca8c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xca8c('0x5'));var config=require('../../config/environment');var attributes=require(_0xca8c('0x6'));module[_0xca8c('0x7')]=function(_0x6b6721,_0x2d6095){return _0x6b6721['define'](_0xca8c('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 7e5c03e..ae72249 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 _0x66c7=['body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create'];(function(_0x3cf4e9,_0x4b7e91){var _0x1c6f5b=function(_0x2c8863){while(--_0x2c8863){_0x3cf4e9['push'](_0x3cf4e9['shift']());}};_0x1c6f5b(++_0x4b7e91);}(_0x66c7,0x1b4));var _0x766c=function(_0x5b0485,_0x1b273d){_0x5b0485=_0x5b0485-0x0;var _0x46fcdb=_0x66c7[_0x5b0485];return _0x46fcdb;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require(_0x766c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require(_0x766c('0x5'))['db'];var utils=require(_0x766c('0x6'));var logger=require('../../config/logger')(_0x766c('0x7'));var config=require(_0x766c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x766c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570881,_0x535e60,_0x428cae){return new BPromise(function(_0x583c84,_0x22133a){return client[_0x766c('0xa')](_0x570881,_0x428cae)[_0x766c('0xb')](function(_0x5db4a6){logger['info'](_0x766c('0xc'),_0x535e60,_0x766c('0xd'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x535e60,_0x766c('0xd'),JSON[_0x766c('0xe')](_0x5db4a6));if(_0x5db4a6[_0x766c('0xf')]){if(_0x5db4a6[_0x766c('0xf')][_0x766c('0x10')]===0x1f4){logger[_0x766c('0xf')](_0x766c('0xc'),_0x535e60,_0x5db4a6[_0x766c('0xf')][_0x766c('0x11')]);return _0x22133a(_0x5db4a6['error'][_0x766c('0x11')]);}logger[_0x766c('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x535e60,_0x5db4a6['error'][_0x766c('0x11')]);return _0x583c84(_0x5db4a6[_0x766c('0xf')]['message']);}else{logger[_0x766c('0x12')](_0x766c('0xc'),_0x535e60,_0x766c('0xd'));_0x583c84(_0x5db4a6[_0x766c('0x13')][_0x766c('0x11')]);}})['catch'](function(_0x2ee3a8){logger['error'](_0x766c('0xc'),_0x535e60,_0x2ee3a8);_0x22133a(_0x2ee3a8);});});}exports[_0x766c('0x14')]=function(_0x293c60){var _0x8a714c=this;return new Promise(function(_0x4fc1b3,_0x428513){return db[_0x766c('0x15')][_0x766c('0x16')](_0x293c60[_0x766c('0x17')],{'raw':_0x293c60[_0x766c('0x18')]?_0x293c60[_0x766c('0x18')][_0x766c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x51c5dc){logger[_0x766c('0x12')](_0x766c('0x14'),_0x293c60);logger['debug'](_0x766c('0x14'),_0x293c60,JSON[_0x766c('0xe')](_0x51c5dc));_0x4fc1b3(_0x51c5dc);})[_0x766c('0x1a')](function(_0x271a08){logger[_0x766c('0xf')](_0x766c('0x14'),_0x271a08[_0x766c('0x11')],_0x293c60);_0x428513(_0x8a714c[_0x766c('0xf')](0x1f4,_0x271a08[_0x766c('0x11')]));});});}; \ No newline at end of file +var _0xd449=['http','request','then','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','debug','lodash','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2e9593,_0x28fe7d){var _0x2ae162=function(_0x5d22e8){while(--_0x5d22e8){_0x2e9593['push'](_0x2e9593['shift']());}};_0x2ae162(++_0x28fe7d);}(_0xd449,0x153));var _0x9d44=function(_0x36f641,_0x1a3063){_0x36f641=_0x36f641-0x0;var _0x39b299=_0xd449[_0x36f641];return _0x39b299;};'use strict';var _=require(_0x9d44('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9d44('0x1'));var logger=require(_0x9d44('0x2'))(_0x9d44('0x3'));var config=require(_0x9d44('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9d44('0x5')][_0x9d44('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x333c78,_0x166c44,_0x158bb1){return new BPromise(function(_0x52df6c,_0x40439){return client[_0x9d44('0x7')](_0x333c78,_0x158bb1)[_0x9d44('0x8')](function(_0x1946fe){logger[_0x9d44('0x9')]('ReportAgentPreview,\x20%s,\x20%s',_0x166c44,_0x9d44('0xa'));logger['debug'](_0x9d44('0xb'),_0x166c44,'request\x20sent',JSON[_0x9d44('0xc')](_0x1946fe));if(_0x1946fe[_0x9d44('0xd')]){if(_0x1946fe[_0x9d44('0xd')][_0x9d44('0xe')]===0x1f4){logger[_0x9d44('0xd')](_0x9d44('0xf'),_0x166c44,_0x1946fe[_0x9d44('0xd')][_0x9d44('0x10')]);return _0x40439(_0x1946fe[_0x9d44('0xd')]['message']);}logger[_0x9d44('0xd')](_0x9d44('0xf'),_0x166c44,_0x1946fe[_0x9d44('0xd')]['message']);return _0x52df6c(_0x1946fe[_0x9d44('0xd')][_0x9d44('0x10')]);}else{logger['info'](_0x9d44('0xf'),_0x166c44,_0x9d44('0xa'));_0x52df6c(_0x1946fe['result'][_0x9d44('0x10')]);}})[_0x9d44('0x11')](function(_0x2bce68){logger[_0x9d44('0xd')](_0x9d44('0xf'),_0x166c44,_0x2bce68);_0x40439(_0x2bce68);});});}exports[_0x9d44('0x12')]=function(_0x4076bd){var _0xf5b60a=this;return new Promise(function(_0x5228f1,_0x55f602){return db[_0x9d44('0x13')][_0x9d44('0x14')](_0x4076bd[_0x9d44('0x15')],{'raw':_0x4076bd['options']?_0x4076bd['options']['raw']===undefined?!![]:![]:!![]})[_0x9d44('0x8')](function(_0x4c6cf8){logger['info'](_0x9d44('0x12'),_0x4076bd);logger[_0x9d44('0x16')](_0x9d44('0x12'),_0x4076bd,JSON['stringify'](_0x4c6cf8));_0x5228f1(_0x4c6cf8);})[_0x9d44('0x11')](function(_0x4e6d03){logger[_0x9d44('0xd')](_0x9d44('0x12'),_0x4e6d03[_0x9d44('0x10')],_0x4076bd);_0x55f602(_0xf5b60a[_0x9d44('0xd')](0x1f4,_0x4e6d03[_0x9d44('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index c070fe6..367c5ea 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 _0x4850=['voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','showMailQueues','queueNotify','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup'];(function(_0x589710,_0x14a1c5){var _0x20ff0b=function(_0x5041c7){while(--_0x5041c7){_0x589710['push'](_0x589710['shift']());}};_0x20ff0b(++_0x14a1c5);}(_0x4850,0xd3));var _0x0485=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4850[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x0485('0x0'));var util=require('util');var path=require(_0x0485('0x1'));var express=require(_0x0485('0x2'));var router=express[_0x0485('0x3')]();var auth=require(_0x0485('0x4'));var controller=require('./rpc.controller');router['get'](_0x0485('0x5'),auth[_0x0485('0x6')](),controller['voiceChannels']);router['get'](_0x0485('0x7'),auth[_0x0485('0x6')](),controller[_0x0485('0x8')]);router[_0x0485('0x9')](_0x0485('0xa'),auth['isAuthenticated'](),controller[_0x0485('0xb')]);router[_0x0485('0x9')](_0x0485('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x0485('0x9')](_0x0485('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router['get'](_0x0485('0xe'),auth[_0x0485('0x6')](),controller[_0x0485('0xf')]);router[_0x0485('0x9')](_0x0485('0x10'),auth[_0x0485('0x6')](),controller[_0x0485('0x11')]);router['get'](_0x0485('0x12'),auth[_0x0485('0x6')](),controller[_0x0485('0x13')]);router['get'](_0x0485('0x14'),auth[_0x0485('0x6')](),controller[_0x0485('0x15')]);router[_0x0485('0x9')](_0x0485('0x16'),auth['isAuthenticated'](),controller[_0x0485('0x17')]);router[_0x0485('0x9')]('/fax/queues',auth[_0x0485('0x6')](),controller[_0x0485('0x18')]);router[_0x0485('0x9')](_0x0485('0x19'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0x0485('0x1a'),auth[_0x0485('0x6')](),controller['voiceQueuesChannels']);router[_0x0485('0x9')](_0x0485('0x1b'),auth[_0x0485('0x6')](),controller['voiceQueuesChannel']);router[_0x0485('0x9')](_0x0485('0x1c'),auth[_0x0485('0x6')](),controller[_0x0485('0x1d')]);router[_0x0485('0x9')](_0x0485('0x1e'),auth[_0x0485('0x6')](),controller[_0x0485('0x1f')]);router[_0x0485('0x9')](_0x0485('0x20'),auth['isAuthenticated'](),controller[_0x0485('0x21')]);router['put'](_0x0485('0x20'),auth[_0x0485('0x6')](),controller[_0x0485('0x22')]);router[_0x0485('0x9')](_0x0485('0x23'),auth[_0x0485('0x6')](),controller[_0x0485('0x24')]);router[_0x0485('0x9')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x0485('0x25')]);router['get'](_0x0485('0x26'),auth[_0x0485('0x6')](),controller[_0x0485('0x27')]);router[_0x0485('0x28')]('/agents/:id/capacity',auth[_0x0485('0x6')](),controller[_0x0485('0x29')]);router[_0x0485('0x9')](_0x0485('0x2a'),auth[_0x0485('0x6')](),controller[_0x0485('0x2b')]);router[_0x0485('0x9')](_0x0485('0x2c'),auth['isAuthenticated'](),controller[_0x0485('0x2d')]);router[_0x0485('0x9')](_0x0485('0x2e'),auth[_0x0485('0x6')](),controller[_0x0485('0x2f')]);router[_0x0485('0x9')](_0x0485('0x30'),auth[_0x0485('0x6')](),controller['faxAccounts']);router[_0x0485('0x9')](_0x0485('0x31'),auth[_0x0485('0x6')](),controller[_0x0485('0x32')]);router[_0x0485('0x9')](_0x0485('0x33'),auth[_0x0485('0x6')](),controller[_0x0485('0x34')]);router['get'](_0x0485('0x35'),auth[_0x0485('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x0485('0x9')](_0x0485('0x36'),auth[_0x0485('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x0485('0x9')](_0x0485('0x37'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x0485('0x9')](_0x0485('0x38'),auth['isAuthenticated'](),controller[_0x0485('0x39')]);router[_0x0485('0x9')](_0x0485('0x3a'),auth[_0x0485('0x6')](),controller[_0x0485('0x3b')]);router[_0x0485('0x3c')](_0x0485('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x0485('0x3e')));router[_0x0485('0x9')]('/mail/queues/:id',auth[_0x0485('0x6')](),controller[_0x0485('0x3f')]);router['post']('/chat/queues/:id/notify',auth[_0x0485('0x6')](),controller[_0x0485('0x40')](_0x0485('0x41')));router['get']('/chat/queues/:id',auth[_0x0485('0x6')](),controller[_0x0485('0x42')]);router[_0x0485('0x3c')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0485('0x40')](_0x0485('0x43')));router[_0x0485('0x9')](_0x0485('0x44'),auth[_0x0485('0x6')](),controller[_0x0485('0x45')]);router['post'](_0x0485('0x46'),auth[_0x0485('0x6')](),controller[_0x0485('0x40')]('openchannel'));router[_0x0485('0x9')](_0x0485('0x47'),auth[_0x0485('0x6')](),controller[_0x0485('0x48')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0485('0x40')]('sms'));router[_0x0485('0x3c')](_0x0485('0x49'),auth[_0x0485('0x6')](),controller[_0x0485('0x40')](_0x0485('0x4a')));router[_0x0485('0x9')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x0485('0x4b')]);router[_0x0485('0x9')](_0x0485('0x4c'),auth['isAuthenticated'](),controller[_0x0485('0x4d')]);router[_0x0485('0x3c')]('/agents/:id/notify',auth[_0x0485('0x6')](),controller[_0x0485('0x4e')]);module[_0x0485('0x4f')]=router; \ No newline at end of file +var _0x7a60=['updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','util','path','express','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','put'];(function(_0x5cefaf,_0x3b7264){var _0x140bcd=function(_0x3533c5){while(--_0x3533c5){_0x5cefaf['push'](_0x5cefaf['shift']());}};_0x140bcd(++_0x3b7264);}(_0x7a60,0x11c));var _0x07a6=function(_0xe0141b,_0x323058){_0xe0141b=_0xe0141b-0x0;var _0x31943e=_0x7a60[_0xe0141b];return _0x31943e;};'use strict';var multer=require(_0x07a6('0x0'));var util=require(_0x07a6('0x1'));var path=require(_0x07a6('0x2'));var express=require(_0x07a6('0x3'));var router=express['Router']();var auth=require(_0x07a6('0x4'));var controller=require(_0x07a6('0x5'));router['get']('/voice/channels',auth[_0x07a6('0x6')](),controller[_0x07a6('0x7')]);router[_0x07a6('0x8')](_0x07a6('0x9'),auth[_0x07a6('0x6')](),controller[_0x07a6('0xa')]);router[_0x07a6('0x8')](_0x07a6('0xb'),auth[_0x07a6('0x6')](),controller[_0x07a6('0xc')]);router[_0x07a6('0x8')](_0x07a6('0xd'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x07a6('0x8')](_0x07a6('0xe'),auth['isAuthenticated'](),controller[_0x07a6('0xf')]);router[_0x07a6('0x8')](_0x07a6('0x10'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x11')]);router[_0x07a6('0x8')](_0x07a6('0x12'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x13')]);router[_0x07a6('0x8')](_0x07a6('0x14'),auth[_0x07a6('0x6')](),controller['openchannelQueues']);router[_0x07a6('0x8')]('/sms/queues',auth[_0x07a6('0x6')](),controller[_0x07a6('0x15')]);router[_0x07a6('0x8')](_0x07a6('0x16'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x17')]);router[_0x07a6('0x8')](_0x07a6('0x18'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x19')]);router[_0x07a6('0x8')](_0x07a6('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0x07a6('0x1b'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x1c')]);router[_0x07a6('0x8')](_0x07a6('0x1d'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x1e')]);router[_0x07a6('0x8')](_0x07a6('0x1f'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x20')]);router[_0x07a6('0x8')](_0x07a6('0x21'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x22')]);router['get']('/voice/queues/:id',auth[_0x07a6('0x6')](),controller['showVoiceQueues']);router[_0x07a6('0x23')]('/voice/queues/:id',auth[_0x07a6('0x6')](),controller[_0x07a6('0x24')]);router[_0x07a6('0x8')](_0x07a6('0x25'),auth[_0x07a6('0x6')](),controller['outbound']);router[_0x07a6('0x8')](_0x07a6('0x26'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x27')]);router[_0x07a6('0x8')](_0x07a6('0x28'),auth['isAuthenticated'](),controller[_0x07a6('0x29')]);router[_0x07a6('0x23')](_0x07a6('0x2a'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x2b')]);router[_0x07a6('0x8')](_0x07a6('0x2c'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x2d')]);router['get']('/trunks',auth[_0x07a6('0x6')](),controller[_0x07a6('0x2e')]);router['get'](_0x07a6('0x2f'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x30')]);router[_0x07a6('0x8')]('/fax/accounts',auth[_0x07a6('0x6')](),controller['faxAccounts']);router[_0x07a6('0x8')](_0x07a6('0x31'),auth['isAuthenticated'](),controller[_0x07a6('0x32')]);router[_0x07a6('0x8')](_0x07a6('0x33'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x34')]);router[_0x07a6('0x8')]('/openchannel/queues/waitinginteractions',auth[_0x07a6('0x6')](),controller[_0x07a6('0x35')]);router[_0x07a6('0x8')](_0x07a6('0x36'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x07a6('0x8')](_0x07a6('0x37'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x38')]);router[_0x07a6('0x8')](_0x07a6('0x39'),auth[_0x07a6('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x07a6('0x8')](_0x07a6('0x3a'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x3b')]);router[_0x07a6('0x3c')](_0x07a6('0x3d'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x3e')](_0x07a6('0x3f')));router[_0x07a6('0x8')](_0x07a6('0x40'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x07a6('0x3c')]('/chat/queues/:id/notify',auth[_0x07a6('0x6')](),controller['queueNotify'](_0x07a6('0x41')));router[_0x07a6('0x8')](_0x07a6('0x42'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x43')]);router[_0x07a6('0x3c')]('/fax/queues/:id/notify',auth[_0x07a6('0x6')](),controller[_0x07a6('0x3e')](_0x07a6('0x44')));router[_0x07a6('0x8')](_0x07a6('0x45'),auth['isAuthenticated'](),controller[_0x07a6('0x46')]);router[_0x07a6('0x3c')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x07a6('0x3e')]('openchannel'));router[_0x07a6('0x8')](_0x07a6('0x47'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x48')]);router['post'](_0x07a6('0x49'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x3e')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth[_0x07a6('0x6')](),controller[_0x07a6('0x3e')](_0x07a6('0x4a')));router[_0x07a6('0x8')](_0x07a6('0x4b'),auth['isAuthenticated'](),controller[_0x07a6('0x4c')]);router[_0x07a6('0x8')](_0x07a6('0x4d'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x07a6('0x3c')](_0x07a6('0x4e'),auth[_0x07a6('0x6')](),controller[_0x07a6('0x4f')]);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 e382deb..2fb60d6 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 _0x5075=['api','client','http','then','error','message','result','status','json','name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','queue','InteractionId','From','QueueId','TransferReport','create','Start','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Agent\x20not\x20found','MessageId','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger'];(function(_0x4a9f71,_0x1db1ce){var _0x1134cd=function(_0x3e456d){while(--_0x3e456d){_0x4a9f71['push'](_0x4a9f71['shift']());}};_0x1134cd(++_0x1db1ce);}(_0x5075,0x73));var _0x5507=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x5075[_0x5ce3c8];return _0xa76867;};'use strict';var BPromise=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));var _=require(_0x5507('0x2'));var util=require(_0x5507('0x3'));var db=require(_0x5507('0x4'))['db'];var logger=require(_0x5507('0x5'))(_0x5507('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x5507('0x7')][_0x5507('0x8')]({'port':0x232a});var mailClient=jayson[_0x5507('0x7')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x5507('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x773559,_0x4c2d6d,_0x42c232){return new BPromise(function(_0x7cc84c,_0xbf4b50){var _0x504e05=_0x42c232?_0x42c232:amiClient;return _0x504e05['request'](_0x773559,_0x4c2d6d)[_0x5507('0x9')](function(_0x441bdc){if(_0x441bdc[_0x5507('0xa')]){if(_0x441bdc[_0x5507('0xa')]['code']===0x1f4){return _0xbf4b50(_0x441bdc[_0x5507('0xa')][_0x5507('0xb')]);}return _0x7cc84c(_0x441bdc['error'][_0x5507('0xb')]);}else{_0x7cc84c(_0x441bdc[_0x5507('0xc')]);}})['catch'](function(_0x37a1de){_0xbf4b50(_0x37a1de);});});}function respondWithResult(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xc8;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0xd')](_0x32c872)[_0x5507('0xe')](_0x267f27);}return _0x2a2ea0['sendStatus'](0x194);};}function handleError(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0x1f4;return function(_0xc828e5){logger[_0x5507('0xa')](_0xc828e5['stack']);if(_0xc828e5[_0x5507('0xf')]){delete _0xc828e5[_0x5507('0xf')];}_0x9cc3f9[_0x5507('0xd')](_0x2b7c43)[_0x5507('0x10')](_0xc828e5);};}function findById(_0xa6e4b3){return function(_0x2ede34){if(!_[_0x5507('0x11')](_0xa6e4b3)&&!_[_0x5507('0x11')](_0x2ede34)&&!_[_0x5507('0x11')](_0x2ede34[_0x5507('0x12')])){return _[_0x5507('0x13')](_0x2ede34[_0x5507('0x12')],function(_0x3822dd){return _0x3822dd['id']==_0xa6e4b3;});}return null;};}exports['voiceChannels']=function(_0x14dab0,_0x276a81){return respondWithRpcPromise(_0x5507('0x14'),_0x14dab0[_0x5507('0x15')])['then'](respondWithResult(_0x276a81,null))[_0x5507('0x16')](handleError(_0x276a81,null));};exports[_0x5507('0x17')]=function(_0x1a54b0,_0x3ca1f7){return respondWithRpcPromise(_0x5507('0x18'),_[_0x5507('0x19')](_0x1a54b0['query'],_0x1a54b0[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x3ca1f7,null))[_0x5507('0x16')](handleError(_0x3ca1f7,null));};exports[_0x5507('0x1b')]=function(_0x141d22,_0x2de482){return respondWithRpcPromise(_0x5507('0x1c'),_[_0x5507('0x19')](_0x141d22[_0x5507('0x15')],_0x141d22[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x2de482,null))[_0x5507('0x16')](handleError(_0x2de482,null));};exports[_0x5507('0x1d')]=function(_0x2ee6ed,_0x1a2203){return respondWithRpcPromise('VoiceQueues',_0x2ee6ed[_0x5507('0x15')])['then'](respondWithResult(_0x1a2203,null))[_0x5507('0x16')](handleError(_0x1a2203,null));};exports['showVoiceQueues']=function(_0xa66a01,_0x24668b){return respondWithRpcPromise('VoiceQueues',_0xa66a01['query'])[_0x5507('0x9')](findById(_0xa66a01[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x24668b,null))[_0x5507('0x16')](handleError(_0x24668b,null));};exports[_0x5507('0x1e')]=function(_0x85d383,_0x38f4d9){return respondWithRpcPromise(_0x5507('0x1f'),_[_0x5507('0x19')](_0x85d383['body'],_0x85d383[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x38f4d9,null))[_0x5507('0x16')](handleError(_0x38f4d9,null));};exports[_0x5507('0x20')]=function(_0x29dd58,_0x495bbe){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x5507('0x19')](_0x29dd58[_0x5507('0x15')],_0x29dd58[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x495bbe,null))['catch'](handleError(_0x495bbe,null));};exports[_0x5507('0x21')]=function(_0x13b6e5,_0xab91bc){return respondWithRpcPromise(_0x5507('0x22'),_0x13b6e5[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xab91bc,null))[_0x5507('0x16')](handleError(_0xab91bc,null));};exports[_0x5507('0x23')]=function(_0x5ede36,_0xf61ba7){return respondWithRpcPromise(_0x5507('0x24'),_[_0x5507('0x19')](_0x5ede36['query'],_0x5ede36['params']))[_0x5507('0x9')](respondWithResult(_0xf61ba7,null))[_0x5507('0x16')](handleError(_0xf61ba7,null));};exports[_0x5507('0x25')]=function(_0x17d01c,_0x143d97){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x17d01c[_0x5507('0x15')],_0x17d01c[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x143d97,null))[_0x5507('0x16')](handleError(_0x143d97,null));};exports['voiceQueuesChannelRedirect']=function(_0x54e4bd,_0x23ea7c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x5507('0x19')](_0x54e4bd[_0x5507('0x15')],_0x54e4bd[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x23ea7c,null))[_0x5507('0x16')](handleError(_0x23ea7c,null));};exports[_0x5507('0x26')]=function(_0x1c8506,_0x2b962d){return respondWithRpcPromise(_0x5507('0x27'),_0x1c8506[_0x5507('0x15')])['then'](respondWithResult(_0x2b962d,null))['catch'](handleError(_0x2b962d,null));};exports['outboundChannels']=function(_0x570eee,_0x526022){return respondWithRpcPromise(_0x5507('0x28'),_0x570eee[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x526022,null))[_0x5507('0x16')](handleError(_0x526022,null));};exports[_0x5507('0x29')]=function(_0xbef058,_0x101de3){var _0xbc9f93;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058[_0x5507('0x15')])[_0x5507('0x9')](function(_0x2db0b2){_0xbc9f93=_0x2db0b2;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058['query'],routingClient);})['then'](function(_0x50eb32){return _[_0x5507('0x19')]({},_0x50eb32,_0xbc9f93);})[_0x5507('0x9')](respondWithResult(_0x101de3,null))[_0x5507('0x16')](handleError(_0x101de3,null));};exports[_0x5507('0x2b')]=function(_0xcd4df5,_0x17d7db){if(_0xcd4df5[_0x5507('0x2c')]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]&&_0xcd4df5[_0x5507('0x2e')]&&_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')]){for(var _0x24d7b5 in _0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]){if(_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x5507('0x2f')](_0x24d7b5)){db[_0x5507('0x30')]['findAll']({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xcd4df5['body'][_0x5507('0x2d')][_0x24d7b5]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x5507('0x31')]?{'$notIn':_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5]}:{'$ne':null}}})[_0x5507('0x9')](function(_0x39ac17){var _0x1dfc9c=moment()['format'](_0x5507('0x32'));for(var _0x33022e=0x0,_0xadea4c=_0x39ac17[_0x5507('0x31')];_0x33022e<_0xadea4c;_0x33022e+=0x1){_0x39ac17[_0x33022e][_0x5507('0x33')]({'exitAt':_0x1dfc9c});}});for(var _0x48d72b=0x0;_0x48d72b<_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5][_0x5507('0x31')];_0x48d72b+=0x1){db[_0x5507('0x30')][_0x5507('0x34')]({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':_0x5507('0x35'),'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b],'exitAt':null},'defaults':{'channel':_0x24d7b5,'membername':_0xcd4df5['user'][_0x5507('0xf')],'interface':_[_0x5507('0x11')](_0xcd4df5['user']['interface'])?util['format'](_0x5507('0x36'),_0xcd4df5['user'][_0x5507('0xf')]):_0xcd4df5['user'][_0x5507('0x37')],'type':'INTERACTION','enterAt':moment()['format'](_0x5507('0x32')),'role':_0x5507('0x38'),'internal':_0xcd4df5[_0x5507('0x2e')][_0x5507('0x39')],'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xcd4df5[_0x5507('0x1a')]['id'],'capacity':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x3a')]},routingClient)['then'](respondWithResult(_0x17d7db,null))[_0x5507('0x16')](handleError(_0x17d7db,null));};exports[_0x5507('0x3b')]=function(_0x505e71,_0x2e0cfc){return respondWithRpcPromise(_0x5507('0x3c'),_0x505e71[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x2e0cfc,null))[_0x5507('0x16')](handleError(_0x2e0cfc,null));};exports[_0x5507('0x3d')]=function(_0x245456,_0x1bb575){return respondWithRpcPromise('Trunks',_0x245456['query'])[_0x5507('0x9')](respondWithResult(_0x1bb575,null))[_0x5507('0x16')](handleError(_0x1bb575,null));};exports[_0x5507('0x3e')]=function(_0x1b34c8,_0xce851d){return respondWithRpcPromise(_0x5507('0x3f'),_0x1b34c8[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xce851d,null))[_0x5507('0x16')](handleError(_0xce851d,null));};exports[_0x5507('0x40')]=function(_0x40cda2,_0x13dc8b){return respondWithRpcPromise(_0x5507('0x41'),_0x40cda2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x13dc8b,null))[_0x5507('0x16')](handleError(_0x13dc8b,null));};exports['showChatQueues']=function(_0x3f47af,_0x56e0cd){return respondWithRpcPromise('ChatQueues',_0x3f47af[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x3f47af[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x56e0cd,null))['catch'](handleError(_0x56e0cd,null));};exports[_0x5507('0x42')]=function(_0x2f41a9,_0x314d4e){return respondWithRpcPromise(_0x5507('0x43'),_0x2f41a9[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x314d4e,null))['catch'](handleError(_0x314d4e,null));};exports[_0x5507('0x44')]=function(_0x46e589,_0x3a2f9f){return respondWithRpcPromise('MailQueues',_0x46e589['query'],routingClient)[_0x5507('0x9')](findById(_0x46e589['params']['id']))[_0x5507('0x9')](respondWithResult(_0x3a2f9f,null))[_0x5507('0x16')](handleError(_0x3a2f9f,null));};exports['mailAccounts']=function(_0x3e796d,_0x1b622f){return respondWithRpcPromise(_0x5507('0x45'),_0x3e796d[_0x5507('0x15')],mailClient)[_0x5507('0x9')](respondWithResult(_0x1b622f,null))[_0x5507('0x16')](handleError(_0x1b622f,null));};exports[_0x5507('0x46')]=function(_0x2928f2,_0x737d39){return respondWithRpcPromise(_0x5507('0x47'),_0x2928f2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x737d39,null))['catch'](handleError(_0x737d39,null));};exports[_0x5507('0x48')]=function(_0x2e904b,_0x219e34){return respondWithRpcPromise(_0x5507('0x47'),_0x2e904b[_0x5507('0x15')],routingClient)['then'](findById(_0x2e904b[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x219e34,null))[_0x5507('0x16')](handleError(_0x219e34,null));};exports[_0x5507('0x49')]=function(_0x241733,_0x54c009){return respondWithRpcPromise(_0x5507('0x4a'),_0x241733[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x54c009,null))['catch'](handleError(_0x54c009,null));};exports[_0x5507('0x4b')]=function(_0x5cfdb0,_0x3dca7d){return respondWithRpcPromise('SmsQueues',_0x5cfdb0['query'],routingClient)[_0x5507('0x9')](findById(_0x5cfdb0[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x3dca7d,null))[_0x5507('0x16')](handleError(_0x3dca7d,null));};exports[_0x5507('0x4c')]=function(_0x31cc0d,_0x4bf567){return respondWithRpcPromise('WhatsappQueues',_0x31cc0d[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4bf567,null))[_0x5507('0x16')](handleError(_0x4bf567,null));};exports[_0x5507('0x4d')]=function(_0x5e3e73,_0x388faa){return respondWithRpcPromise(_0x5507('0x4e'),_0x5e3e73[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x5e3e73[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x388faa,null))[_0x5507('0x16')](handleError(_0x388faa,null));};exports['faxQueues']=function(_0x3802dd,_0xfdbbe5){return respondWithRpcPromise(_0x5507('0x4f'),_0x3802dd['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xfdbbe5,null))['catch'](handleError(_0xfdbbe5,null));};exports['showFaxQueues']=function(_0x55c257,_0x1fef49){return respondWithRpcPromise(_0x5507('0x4f'),_0x55c257[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x55c257[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x1fef49,null))[_0x5507('0x16')](handleError(_0x1fef49,null));};exports['faxAccounts']=function(_0x1812d7,_0x48ed80){return respondWithRpcPromise(_0x5507('0x50'),_0x1812d7[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x48ed80,null))[_0x5507('0x16')](handleError(_0x48ed80,null));};exports[_0x5507('0x51')]=function(_0x120108,_0x4423a8){return respondWithRpcPromise(_0x5507('0x52'),_0x120108[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4423a8,null))[_0x5507('0x16')](handleError(_0x4423a8,null));};exports['mailQueuesWaitingInteractions']=function(_0x94b11c,_0xbb0a62){return respondWithRpcPromise(_0x5507('0x53'),_0x94b11c['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xbb0a62,null))[_0x5507('0x16')](handleError(_0xbb0a62,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x26e777,_0x5815fb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x26e777[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x5815fb,null))[_0x5507('0x16')](handleError(_0x5815fb,null));};exports[_0x5507('0x54')]=function(_0xfb59be,_0xda51d5){return respondWithRpcPromise(_0x5507('0x55'),_0xfb59be[_0x5507('0x15')],routingClient)['then'](function(_0x43fccf){if(_0xfb59be[_0x5507('0x15')][_0x5507('0x56')]!==undefined){var _0x75aa3c=_(_0x43fccf[_0x5507('0x12')])[_0x5507('0x57')]([_0xfb59be[_0x5507('0x15')][_0x5507('0x56')],_0xfb59be[_0x5507('0x1a')]['id']])[_0x5507('0x58')](_0x5507('0x59'))[_0x5507('0x5a')]()['value']();return _0x43fccf[_0x5507('0x12')][_0x5507('0x57')](function(_0x10f066){return _0x75aa3c[_0x5507('0x5b')](_0x10f066[_0x5507('0x59')])>-0x1;});}else{return _0x43fccf[_0x5507('0x12')]['filter'](function(_0x1dad83){return _0x1dad83['queue_id']===parseInt(_0xfb59be[_0x5507('0x1a')]['id']);});}})['then'](respondWithResult(_0xda51d5,null))['catch'](handleError(_0xda51d5,null));};exports[_0x5507('0x5c')]=function(_0x20274e,_0x2979b1){return respondWithRpcPromise(_0x5507('0x5d'),_0x20274e[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x2979b1,null))[_0x5507('0x16')](handleError(_0x2979b1,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x410c16,_0x471142){return respondWithRpcPromise(_0x5507('0x5e'),_0x410c16[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x471142,null))[_0x5507('0x16')](handleError(_0x471142,null));};exports[_0x5507('0x5f')]=function(_0x42bef4,_0x5a8a1b){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x42bef4[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x5a8a1b,null))[_0x5507('0x16')](handleError(_0x5a8a1b,null));};exports[_0x5507('0x60')]=function(_0x77a772){return function(_0x26f796,_0x3d7e21){var _0x10b62e,_0x18bed6;var _0x27265e=_[_0x5507('0x61')](_0x77a772);var _0x160e54=_0x77a772==='chat'?_0x5507('0x62'):_0x5507('0x63');return db[_0x27265e+_0x5507('0x64')][_0x5507('0x65')]({'raw':!![],'where':{'id':_0x26f796[_0x5507('0x1a')]['id']}})[_0x5507('0x9')](function(_0x33717e){if(_['isNil'](_0x33717e)){throw new Error(_0x27265e+_0x5507('0x66'));}_0x10b62e=_0x33717e;return db[_0x27265e+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x26f796[_0x5507('0x2c')]['messageId']},'include':[{'model':db[_0x27265e+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x27265e+_0x160e54],'as':_0x5507('0x63')}]});})[_0x5507('0x9')](function(_0x1a5d2e){if(_[_0x5507('0x11')](_0x1a5d2e)){throw new Error(_0x27265e+_0x5507('0x69'));}_0x18bed6=_0x1a5d2e;return _0x1a5d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x38144b={'uniqueid':_0x77a772+'.'+_0x18bed6['id']+'.'+_0x18bed6[_0x5507('0x68')]['id'],'FromUserId':_0x26f796[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a')};_0x38144b[_0x27265e+'MessageId']=_0x18bed6['id'];_0x38144b[_0x27265e+_0x5507('0x6b')]=_0x18bed6[_0x5507('0x68')]['id'];_0x38144b[_0x5507('0x6c')+_0x27265e+_0x160e54+'Id']=_0x18bed6[_0x5507('0x63')]['id'];_0x38144b['To'+_0x27265e+_0x5507('0x6d')]=_0x10b62e['id'];return db[_0x27265e+_0x5507('0x6e')][_0x5507('0x6f')](_0x38144b);})[_0x5507('0x9')](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x77a772,'interaction':_0x18bed6[_0x5507('0x68')],'message':_0x18bed6,'account':_0x18bed6[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5507('0x6a'),'appdata':_0x10b62e[_0x5507('0xf')]+','+(_0x18bed6['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x3d7e21,null))[_0x5507('0x16')](handleError(_0x3d7e21,null));};};exports[_0x5507('0x71')]=function(_0x3b04a7,_0x1e913a){var _0x4e1578,_0x2339c7;if(_[_0x5507('0x11')](_0x3b04a7[_0x5507('0x2c')]['channel'])){throw new Error(_0x5507('0x72'));}var _0x5808d9=_0x3b04a7['body'][_0x5507('0x73')];var _0x58b56c=_[_0x5507('0x61')](_0x5808d9);var _0x5c6043=_0x5808d9===_0x5507('0x74')?_0x5507('0x62'):_0x5507('0x63');return db['User']['findOne']({'raw':!![],'where':{'id':_0x3b04a7[_0x5507('0x1a')]['id'],'role':_0x5507('0x38')}})[_0x5507('0x9')](function(_0x51bec0){if(_[_0x5507('0x11')](_0x51bec0)){throw new Error(_0x5507('0x75'));}_0x4e1578=_0x51bec0;return db[_0x58b56c+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x3b04a7['body']['messageId']},'include':[{'model':db[_0x58b56c+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x58b56c+_0x5c6043],'as':'Account'}]});})[_0x5507('0x9')](function(_0x13c0f5){if(_[_0x5507('0x11')](_0x13c0f5)){throw new Error(_0x58b56c+_0x5507('0x69'));}_0x2339c7=_0x13c0f5;return _0x13c0f5['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x3a2b0f={'uniqueid':_0x5808d9+'.'+_0x2339c7['id']+'.'+_0x2339c7['Interaction']['id'],'FromUserId':_0x3b04a7[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a'),'ToUserId':_0x4e1578['id']};_0x3a2b0f[_0x58b56c+_0x5507('0x76')]=_0x2339c7['id'];_0x3a2b0f[_0x58b56c+'InteractionId']=_0x2339c7[_0x5507('0x68')]['id'];_0x3a2b0f[_0x5507('0x6c')+_0x58b56c+_0x5c6043+'Id']=_0x2339c7['Account']['id'];return db[_0x58b56c+_0x5507('0x6e')][_0x5507('0x6f')](_0x3a2b0f);})['then'](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x5808d9,'interaction':_0x2339c7[_0x5507('0x68')],'message':_0x2339c7,'account':_0x2339c7[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4e1578[_0x5507('0xf')]+','+(_0x2339c7[_0x5507('0x63')][_0x5507('0x77')]||0x12c),'interval':_0x5507('0x78')}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x1e913a,null))[_0x5507('0x16')](handleError(_0x1e913a,null));}; \ No newline at end of file +var _0xda19=['rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Message','TransferReport','moment','lodash','../../mysqldb','api','client','http','then','error','code','message','status','json','name','send','isNil'];(function(_0x1298ed,_0x39ba63){var _0x56b532=function(_0x46e1eb){while(--_0x46e1eb){_0x1298ed['push'](_0x1298ed['shift']());}};_0x56b532(++_0x39ba63);}(_0xda19,0xd5));var _0x9da1=function(_0x4810b2,_0x310196){_0x4810b2=_0x4810b2-0x0;var _0x2181b8=_0xda19[_0x4810b2];return _0x2181b8;};'use strict';var BPromise=require('bluebird');var moment=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));var util=require('util');var db=require(_0x9da1('0x2'))['db'];var logger=require('../../config/logger')(_0x9da1('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232a});var mailClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232b});var routingClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){var _0x55f66b=_0x1c24e6?_0x1c24e6:amiClient;return _0x55f66b['request'](_0x23e4f7,_0x2c3cdd)[_0x9da1('0x6')](function(_0x493d0b){if(_0x493d0b[_0x9da1('0x7')]){if(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x8')]===0x1f4){return _0x47df89(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x9')]);}return _0x5e2d18(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x9')]);}else{_0x5e2d18(_0x493d0b['result']);}})['catch'](function(_0x3114f7){_0x47df89(_0x3114f7);});});}function respondWithResult(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xc8;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0xa')](_0x4735c7)[_0x9da1('0xb')](_0x1d93f8);}return _0x596b6b['sendStatus'](0x194);};}function handleError(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0x1f4;return function(_0x4d17e1){logger[_0x9da1('0x7')](_0x4d17e1['stack']);if(_0x4d17e1[_0x9da1('0xc')]){delete _0x4d17e1[_0x9da1('0xc')];}_0x2837e3[_0x9da1('0xa')](_0x535a13)[_0x9da1('0xd')](_0x4d17e1);};}function findById(_0x7f1a64){return function(_0x514d8e){if(!_[_0x9da1('0xe')](_0x7f1a64)&&!_[_0x9da1('0xe')](_0x514d8e)&&!_[_0x9da1('0xe')](_0x514d8e[_0x9da1('0xf')])){return _[_0x9da1('0x10')](_0x514d8e[_0x9da1('0xf')],function(_0x497676){return _0x497676['id']==_0x7f1a64;});}return null;};}exports['voiceChannels']=function(_0x17205d,_0x8da712){return respondWithRpcPromise(_0x9da1('0x11'),_0x17205d[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x8da712,null))[_0x9da1('0x13')](handleError(_0x8da712,null));};exports[_0x9da1('0x14')]=function(_0x47e5cf,_0x1a459c){return respondWithRpcPromise(_0x9da1('0x15'),_[_0x9da1('0x16')](_0x47e5cf[_0x9da1('0x12')],_0x47e5cf[_0x9da1('0x17')]))['then'](respondWithResult(_0x1a459c,null))['catch'](handleError(_0x1a459c,null));};exports[_0x9da1('0x18')]=function(_0x3e6f85,_0x16ee0c){return respondWithRpcPromise(_0x9da1('0x19'),_[_0x9da1('0x16')](_0x3e6f85[_0x9da1('0x12')],_0x3e6f85['params']))[_0x9da1('0x6')](respondWithResult(_0x16ee0c,null))[_0x9da1('0x13')](handleError(_0x16ee0c,null));};exports['voiceQueues']=function(_0x45fcce,_0x3f5680){return respondWithRpcPromise('VoiceQueues',_0x45fcce[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x3f5680,null))['catch'](handleError(_0x3f5680,null));};exports[_0x9da1('0x1a')]=function(_0x1d6af5,_0x55cd3d){return respondWithRpcPromise('VoiceQueues',_0x1d6af5[_0x9da1('0x12')])[_0x9da1('0x6')](findById(_0x1d6af5['params']['id']))[_0x9da1('0x6')](respondWithResult(_0x55cd3d,null))['catch'](handleError(_0x55cd3d,null));};exports['updateVoiceQueue']=function(_0x5a59c2,_0x31b826){return respondWithRpcPromise(_0x9da1('0x1b'),_[_0x9da1('0x16')](_0x5a59c2[_0x9da1('0x1c')],_0x5a59c2[_0x9da1('0x17')]))['then'](respondWithResult(_0x31b826,null))[_0x9da1('0x13')](handleError(_0x31b826,null));};exports['voiceQueuesPreview']=function(_0x1feae0,_0x235ced){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x9da1('0x16')](_0x1feae0[_0x9da1('0x12')],_0x1feae0['params']))[_0x9da1('0x6')](respondWithResult(_0x235ced,null))[_0x9da1('0x13')](handleError(_0x235ced,null));};exports[_0x9da1('0x1d')]=function(_0x2b2b48,_0x581e9f){return respondWithRpcPromise('VoiceQueuesChannels',_0x2b2b48[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x581e9f,null))[_0x9da1('0x13')](handleError(_0x581e9f,null));};exports[_0x9da1('0x1e')]=function(_0x193273,_0x559645){return respondWithRpcPromise(_0x9da1('0x1f'),_[_0x9da1('0x16')](_0x193273[_0x9da1('0x12')],_0x193273[_0x9da1('0x17')]))[_0x9da1('0x6')](respondWithResult(_0x559645,null))[_0x9da1('0x13')](handleError(_0x559645,null));};exports['voiceQueuesChannelHangup']=function(_0xa43301,_0x5af570){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x9da1('0x16')](_0xa43301['query'],_0xa43301[_0x9da1('0x17')]))[_0x9da1('0x6')](respondWithResult(_0x5af570,null))[_0x9da1('0x13')](handleError(_0x5af570,null));};exports[_0x9da1('0x20')]=function(_0x98b294,_0x5efa40){return respondWithRpcPromise(_0x9da1('0x21'),_[_0x9da1('0x16')](_0x98b294['query'],_0x98b294[_0x9da1('0x17')]))['then'](respondWithResult(_0x5efa40,null))[_0x9da1('0x13')](handleError(_0x5efa40,null));};exports['outbound']=function(_0x5eaa7e,_0x1ce0f8){return respondWithRpcPromise('Outbound',_0x5eaa7e[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x1ce0f8,null))['catch'](handleError(_0x1ce0f8,null));};exports[_0x9da1('0x22')]=function(_0x1b750f,_0x390457){return respondWithRpcPromise(_0x9da1('0x23'),_0x1b750f['query'])[_0x9da1('0x6')](respondWithResult(_0x390457,null))['catch'](handleError(_0x390457,null));};exports[_0x9da1('0x24')]=function(_0x4bdaf1,_0x26e8d3){var _0x46c176;return respondWithRpcPromise('Agents',_0x4bdaf1[_0x9da1('0x12')])[_0x9da1('0x6')](function(_0x394acf){_0x46c176=_0x394acf;return respondWithRpcPromise('Agents',_0x4bdaf1['query'],routingClient);})['then'](function(_0x27e78c){return _['merge']({},_0x27e78c,_0x46c176);})[_0x9da1('0x6')](respondWithResult(_0x26e8d3,null))[_0x9da1('0x13')](handleError(_0x26e8d3,null));};exports[_0x9da1('0x25')]=function(_0x43c064,_0x54f188){if(_0x43c064[_0x9da1('0x1c')]&&_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')]&&_0x43c064[_0x9da1('0x27')]&&_0x43c064[_0x9da1('0x27')][_0x9da1('0xc')]){for(var _0x28e0b2 in _0x43c064['body'][_0x9da1('0x26')]){if(_0x43c064['body'][_0x9da1('0x26')]['hasOwnProperty'](_0x28e0b2)){db[_0x9da1('0x28')][_0x9da1('0x29')]({'where':{'channel':_0x28e0b2,'membername':_0x43c064['user'][_0x9da1('0xc')],'type':_0x9da1('0x2a'),'exitAt':null,'uniqueid':_0x43c064['body'][_0x9da1('0x26')][_0x28e0b2]&&_0x43c064['body'][_0x9da1('0x26')][_0x28e0b2][_0x9da1('0x2b')]?{'$notIn':_0x43c064['body']['interaction'][_0x28e0b2]}:{'$ne':null}}})[_0x9da1('0x6')](function(_0x3f3688){var _0x15bb24=moment()[_0x9da1('0x2c')](_0x9da1('0x2d'));for(var _0x15578d=0x0,_0x2d7003=_0x3f3688[_0x9da1('0x2b')];_0x15578d<_0x2d7003;_0x15578d+=0x1){_0x3f3688[_0x15578d]['updateAttributes']({'exitAt':_0x15bb24});}});for(var _0xd7fb0a=0x0;_0xd7fb0a<_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2]['length'];_0xd7fb0a+=0x1){db[_0x9da1('0x28')][_0x9da1('0x2e')]({'where':{'channel':_0x28e0b2,'membername':_0x43c064[_0x9da1('0x27')]['name'],'type':_0x9da1('0x2a'),'uniqueid':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2][_0xd7fb0a],'exitAt':null},'defaults':{'channel':_0x28e0b2,'membername':_0x43c064['user'][_0x9da1('0xc')],'interface':_['isNil'](_0x43c064['user'][_0x9da1('0x2f')])?util[_0x9da1('0x2c')]('SIP/%s',_0x43c064[_0x9da1('0x27')][_0x9da1('0xc')]):_0x43c064['user'][_0x9da1('0x2f')],'type':_0x9da1('0x2a'),'enterAt':moment()[_0x9da1('0x2c')](_0x9da1('0x2d')),'role':_0x9da1('0x30'),'internal':_0x43c064[_0x9da1('0x27')][_0x9da1('0x31')],'uniqueid':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2][_0xd7fb0a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x43c064[_0x9da1('0x17')]['id'],'capacity':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x32')]},routingClient)[_0x9da1('0x6')](respondWithResult(_0x54f188,null))['catch'](handleError(_0x54f188,null));};exports['telephones']=function(_0xf36078,_0x6ca1ac){return respondWithRpcPromise(_0x9da1('0x33'),_0xf36078[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x6ca1ac,null))[_0x9da1('0x13')](handleError(_0x6ca1ac,null));};exports[_0x9da1('0x34')]=function(_0x1b1148,_0x34327e){return respondWithRpcPromise(_0x9da1('0x35'),_0x1b1148[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x34327e,null))[_0x9da1('0x13')](handleError(_0x34327e,null));};exports[_0x9da1('0x36')]=function(_0x4c99e8,_0x26ecdb){return respondWithRpcPromise(_0x9da1('0x37'),_0x4c99e8['query'])[_0x9da1('0x6')](respondWithResult(_0x26ecdb,null))['catch'](handleError(_0x26ecdb,null));};exports[_0x9da1('0x38')]=function(_0x4f4980,_0x5df0d8){return respondWithRpcPromise(_0x9da1('0x39'),_0x4f4980[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x5df0d8,null))[_0x9da1('0x13')](handleError(_0x5df0d8,null));};exports[_0x9da1('0x3a')]=function(_0x2787e1,_0x343b05){return respondWithRpcPromise(_0x9da1('0x39'),_0x2787e1[_0x9da1('0x12')],routingClient)['then'](findById(_0x2787e1[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x343b05,null))[_0x9da1('0x13')](handleError(_0x343b05,null));};exports[_0x9da1('0x3b')]=function(_0x2aae1b,_0x4607a9){return respondWithRpcPromise(_0x9da1('0x3c'),_0x2aae1b[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x4607a9,null))[_0x9da1('0x13')](handleError(_0x4607a9,null));};exports['showMailQueues']=function(_0xdaa51b,_0x374a1a){return respondWithRpcPromise('MailQueues',_0xdaa51b[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0xdaa51b[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x374a1a,null))[_0x9da1('0x13')](handleError(_0x374a1a,null));};exports[_0x9da1('0x3d')]=function(_0x3081d7,_0x5d9ac7){return respondWithRpcPromise(_0x9da1('0x3e'),_0x3081d7[_0x9da1('0x12')],mailClient)[_0x9da1('0x6')](respondWithResult(_0x5d9ac7,null))[_0x9da1('0x13')](handleError(_0x5d9ac7,null));};exports['openchannelQueues']=function(_0x1a9df0,_0x5c236e){return respondWithRpcPromise(_0x9da1('0x3f'),_0x1a9df0[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x5c236e,null))[_0x9da1('0x13')](handleError(_0x5c236e,null));};exports[_0x9da1('0x40')]=function(_0x4445e2,_0x5e262c){return respondWithRpcPromise('OpenchannelQueues',_0x4445e2[_0x9da1('0x12')],routingClient)['then'](findById(_0x4445e2['params']['id']))['then'](respondWithResult(_0x5e262c,null))[_0x9da1('0x13')](handleError(_0x5e262c,null));};exports['smsQueues']=function(_0x1ee86e,_0x558602){return respondWithRpcPromise(_0x9da1('0x41'),_0x1ee86e[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x558602,null))[_0x9da1('0x13')](handleError(_0x558602,null));};exports[_0x9da1('0x42')]=function(_0x575a9b,_0x1a91c8){return respondWithRpcPromise(_0x9da1('0x41'),_0x575a9b['query'],routingClient)['then'](findById(_0x575a9b[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x1a91c8,null))[_0x9da1('0x13')](handleError(_0x1a91c8,null));};exports[_0x9da1('0x43')]=function(_0x236b01,_0x44d7fe){return respondWithRpcPromise('WhatsappQueues',_0x236b01[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x44d7fe,null))['catch'](handleError(_0x44d7fe,null));};exports[_0x9da1('0x44')]=function(_0x41717a,_0x2e4ea4){return respondWithRpcPromise(_0x9da1('0x45'),_0x41717a[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0x41717a[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x2e4ea4,null))[_0x9da1('0x13')](handleError(_0x2e4ea4,null));};exports['faxQueues']=function(_0x41283e,_0xbd54e){return respondWithRpcPromise(_0x9da1('0x46'),_0x41283e[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0xbd54e,null))['catch'](handleError(_0xbd54e,null));};exports[_0x9da1('0x47')]=function(_0x13fadd,_0x419f78){return respondWithRpcPromise(_0x9da1('0x46'),_0x13fadd[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0x13fadd['params']['id']))[_0x9da1('0x6')](respondWithResult(_0x419f78,null))['catch'](handleError(_0x419f78,null));};exports[_0x9da1('0x48')]=function(_0x5b6d9f,_0x7cfa7e){return respondWithRpcPromise(_0x9da1('0x49'),_0x5b6d9f[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x7cfa7e,null))['catch'](handleError(_0x7cfa7e,null));};exports['chatQueuesWaitingInteractions']=function(_0x4c832f,_0x73a2fc){return respondWithRpcPromise(_0x9da1('0x4a'),_0x4c832f[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x73a2fc,null))['catch'](handleError(_0x73a2fc,null));};exports['mailQueuesWaitingInteractions']=function(_0x35b782,_0x327bb4){return respondWithRpcPromise(_0x9da1('0x4b'),_0x35b782['query'],routingClient)['then'](respondWithResult(_0x327bb4,null))[_0x9da1('0x13')](handleError(_0x327bb4,null));};exports[_0x9da1('0x4c')]=function(_0x114093,_0x57f20c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x114093[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x57f20c,null))[_0x9da1('0x13')](handleError(_0x57f20c,null));};exports[_0x9da1('0x4d')]=function(_0x3cfe64,_0x5daa11){return respondWithRpcPromise(_0x9da1('0x4e'),_0x3cfe64[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](function(_0x1f0369){if(_0x3cfe64['query'][_0x9da1('0x4f')]!==undefined){var _0x244987=_(_0x1f0369[_0x9da1('0xf')])['filter']([_0x3cfe64[_0x9da1('0x12')][_0x9da1('0x4f')],_0x3cfe64[_0x9da1('0x17')]['id']])['map'](_0x9da1('0x50'))[_0x9da1('0x51')]()['value']();return _0x1f0369[_0x9da1('0xf')]['filter'](function(_0x247710){return _0x244987['indexOf'](_0x247710[_0x9da1('0x50')])>-0x1;});}else{return _0x1f0369[_0x9da1('0xf')][_0x9da1('0x52')](function(_0x2d3541){return _0x2d3541[_0x9da1('0x50')]===parseInt(_0x3cfe64[_0x9da1('0x17')]['id']);});}})[_0x9da1('0x6')](respondWithResult(_0x5daa11,null))[_0x9da1('0x13')](handleError(_0x5daa11,null));};exports[_0x9da1('0x53')]=function(_0x457b45,_0x323cae){return respondWithRpcPromise(_0x9da1('0x54'),_0x457b45[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x323cae,null))[_0x9da1('0x13')](handleError(_0x323cae,null));};exports[_0x9da1('0x55')]=function(_0x27cec6,_0x890b14){return respondWithRpcPromise(_0x9da1('0x56'),_0x27cec6['query'],routingClient)[_0x9da1('0x6')](respondWithResult(_0x890b14,null))[_0x9da1('0x13')](handleError(_0x890b14,null));};exports['faxQueuesWaitingInteractions']=function(_0x4a4cda,_0x84f8d8){return respondWithRpcPromise(_0x9da1('0x57'),_0x4a4cda[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x84f8d8,null))[_0x9da1('0x13')](handleError(_0x84f8d8,null));};exports[_0x9da1('0x58')]=function(_0x1e5b52){return function(_0x1eaaeb,_0x29c4e8){var _0x1d02ff,_0x21748e;var _0x48341a=_[_0x9da1('0x59')](_0x1e5b52);var _0x49a95c=_0x1e5b52===_0x9da1('0x5a')?_0x9da1('0x5b'):_0x9da1('0x5c');return db[_0x48341a+_0x9da1('0x5d')][_0x9da1('0x5e')]({'raw':!![],'where':{'id':_0x1eaaeb['params']['id']}})[_0x9da1('0x6')](function(_0x354c5a){if(_['isNil'](_0x354c5a)){throw new Error(_0x48341a+_0x9da1('0x5f'));}_0x1d02ff=_0x354c5a;return db[_0x48341a+'Message'][_0x9da1('0x5e')]({'where':{'id':_0x1eaaeb['body'][_0x9da1('0x60')]},'include':[{'model':db[_0x48341a+_0x9da1('0x61')],'as':_0x9da1('0x61')},{'model':db[_0x48341a+_0x49a95c],'as':_0x9da1('0x5c')}]});})[_0x9da1('0x6')](function(_0x3e331a){if(_[_0x9da1('0xe')](_0x3e331a)){throw new Error(_0x48341a+_0x9da1('0x62'));}_0x21748e=_0x3e331a;return _0x3e331a[_0x9da1('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9da1('0x6')](function(){var _0xbd3a16={'uniqueid':_0x1e5b52+'.'+_0x21748e['id']+'.'+_0x21748e[_0x9da1('0x61')]['id'],'FromUserId':_0x1eaaeb['user']['id'],'type':_0x9da1('0x64')};_0xbd3a16[_0x48341a+_0x9da1('0x65')]=_0x21748e['id'];_0xbd3a16[_0x48341a+_0x9da1('0x66')]=_0x21748e[_0x9da1('0x61')]['id'];_0xbd3a16[_0x9da1('0x67')+_0x48341a+_0x49a95c+'Id']=_0x21748e[_0x9da1('0x5c')]['id'];_0xbd3a16['To'+_0x48341a+'QueueId']=_0x1d02ff['id'];return db[_0x48341a+'TransferReport'][_0x9da1('0x68')](_0xbd3a16);})[_0x9da1('0x6')](function(){return respondWithRpcPromise(_0x9da1('0x69'),{'channel':_0x1e5b52,'interaction':_0x21748e['Interaction'],'message':_0x21748e,'account':_0x21748e[_0x9da1('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9da1('0x64'),'appdata':_0x1d02ff[_0x9da1('0xc')]+','+(_0x21748e[_0x9da1('0x5c')][_0x9da1('0x6a')]||0x12c),'interval':_0x9da1('0x6b')}]},routingClient);})[_0x9da1('0x6')](respondWithResult(_0x29c4e8,null))['catch'](handleError(_0x29c4e8,null));};};exports[_0x9da1('0x6c')]=function(_0x18fbc9,_0x5a64fd){var _0x56af13,_0x392d19;if(_['isNil'](_0x18fbc9['body'][_0x9da1('0x6d')])){throw new Error(_0x9da1('0x6e'));}var _0x3f9010=_0x18fbc9[_0x9da1('0x1c')][_0x9da1('0x6d')];var _0x30065d=_[_0x9da1('0x59')](_0x3f9010);var _0x39afa7=_0x3f9010==='chat'?'Website':_0x9da1('0x5c');return db[_0x9da1('0x6f')][_0x9da1('0x5e')]({'raw':!![],'where':{'id':_0x18fbc9[_0x9da1('0x17')]['id'],'role':_0x9da1('0x30')}})[_0x9da1('0x6')](function(_0x20a71f){if(_[_0x9da1('0xe')](_0x20a71f)){throw new Error('Agent\x20not\x20found');}_0x56af13=_0x20a71f;return db[_0x30065d+_0x9da1('0x70')]['findOne']({'where':{'id':_0x18fbc9[_0x9da1('0x1c')][_0x9da1('0x60')]},'include':[{'model':db[_0x30065d+_0x9da1('0x61')],'as':_0x9da1('0x61')},{'model':db[_0x30065d+_0x39afa7],'as':_0x9da1('0x5c')}]});})[_0x9da1('0x6')](function(_0xe59156){if(_['isNil'](_0xe59156)){throw new Error(_0x30065d+_0x9da1('0x62'));}_0x392d19=_0xe59156;return _0xe59156['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x9da1('0x6')](function(){var _0x35322c={'uniqueid':_0x3f9010+'.'+_0x392d19['id']+'.'+_0x392d19[_0x9da1('0x61')]['id'],'FromUserId':_0x18fbc9[_0x9da1('0x27')]['id'],'type':'queue','ToUserId':_0x56af13['id']};_0x35322c[_0x30065d+_0x9da1('0x65')]=_0x392d19['id'];_0x35322c[_0x30065d+_0x9da1('0x66')]=_0x392d19[_0x9da1('0x61')]['id'];_0x35322c[_0x9da1('0x67')+_0x30065d+_0x39afa7+'Id']=_0x392d19[_0x9da1('0x5c')]['id'];return db[_0x30065d+_0x9da1('0x71')][_0x9da1('0x68')](_0x35322c);})[_0x9da1('0x6')](function(){return respondWithRpcPromise(_0x9da1('0x69'),{'channel':_0x3f9010,'interaction':_0x392d19[_0x9da1('0x61')],'message':_0x392d19,'account':_0x392d19[_0x9da1('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9da1('0x30'),'appdata':_0x56af13[_0x9da1('0xc')]+','+(_0x392d19[_0x9da1('0x5c')]['agentTransferTimeout']||0x12c),'interval':_0x9da1('0x6b')}]},routingClient);})['then'](respondWithResult(_0x5a64fd,null))[_0x9da1('0x13')](handleError(_0x5a64fd,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 845c5fe..12e5c4f 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 _0x1fce=['./schedule.controller','index','get','/:id','isAuthenticated','/:id/run','run','post','create','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45d50a,_0x448513){var _0x3cef97=function(_0x2f3e43){while(--_0x2f3e43){_0x45d50a['push'](_0x45d50a['shift']());}};_0x3cef97(++_0x448513);}(_0x1fce,0x1ec));var _0xe1fc=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x1fce[_0xabfec4];return _0x7bafa2;};'use strict';var multer=require(_0xe1fc('0x0'));var util=require('util');var path=require(_0xe1fc('0x1'));var timeout=require(_0xe1fc('0x2'));var express=require(_0xe1fc('0x3'));var router=express[_0xe1fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe1fc('0x5'));var interaction=require(_0xe1fc('0x6'));var config=require(_0xe1fc('0x7'));var controller=require(_0xe1fc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe1fc('0x9')]);router[_0xe1fc('0xa')](_0xe1fc('0xb'),auth[_0xe1fc('0xc')](),controller['show']);router[_0xe1fc('0xa')](_0xe1fc('0xd'),auth[_0xe1fc('0xc')](),controller[_0xe1fc('0xe')]);router[_0xe1fc('0xf')]('/',auth[_0xe1fc('0xc')](),controller[_0xe1fc('0x10')]);router[_0xe1fc('0x11')](_0xe1fc('0xb'),auth[_0xe1fc('0xc')](),controller[_0xe1fc('0x12')]);router[_0xe1fc('0x13')](_0xe1fc('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x02f1=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./schedule.controller','isAuthenticated','index','get','show','/:id/run','run','create','put','/:id','update'];(function(_0x5941f9,_0x1261f1){var _0xbdc9f9=function(_0xcc6abe){while(--_0xcc6abe){_0x5941f9['push'](_0x5941f9['shift']());}};_0xbdc9f9(++_0x1261f1);}(_0x02f1,0x79));var _0x102f=function(_0x26f828,_0x1dfaf3){_0x26f828=_0x26f828-0x0;var _0x4d1573=_0x02f1[_0x26f828];return _0x4d1573;};'use strict';var multer=require(_0x102f('0x0'));var util=require(_0x102f('0x1'));var path=require(_0x102f('0x2'));var timeout=require(_0x102f('0x3'));var express=require(_0x102f('0x4'));var router=express[_0x102f('0x5')]();var fs_extra=require(_0x102f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x102f('0x7'));var controller=require(_0x102f('0x8'));router['get']('/',auth[_0x102f('0x9')](),controller[_0x102f('0xa')]);router[_0x102f('0xb')]('/:id',auth[_0x102f('0x9')](),controller[_0x102f('0xc')]);router[_0x102f('0xb')](_0x102f('0xd'),auth[_0x102f('0x9')](),controller[_0x102f('0xe')]);router['post']('/',auth[_0x102f('0x9')](),controller[_0x102f('0xf')]);router[_0x102f('0x10')](_0x102f('0x11'),auth[_0x102f('0x9')](),controller[_0x102f('0x12')]);router['delete'](_0x102f('0x11'),auth[_0x102f('0x9')](),controller['destroy']);module[_0x102f('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d4bf6a4..ca60356 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 _0xad75=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','years','months','weeks','days','hours','minutes','ENUM','csv','xlsx','custom','TEXT','sequelize'];(function(_0x17a2f5,_0xca92f9){var _0x59923d=function(_0x28c01e){while(--_0x28c01e){_0x17a2f5['push'](_0x17a2f5['shift']());}};_0x59923d(++_0xca92f9);}(_0xad75,0x1df));var _0x5ad7=function(_0x1e0f88,_0x35c776){_0x1e0f88=_0x1e0f88-0x0;var _0xc15e17=_0xad75[_0x1e0f88];return _0xc15e17;};'use strict';var Sequelize=require(_0x5ad7('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ad7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5ad7('0x1')]},'active':{'type':Sequelize[_0x5ad7('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5ad7('0x1')],'allowNull':![],'defaultValue':_0x5ad7('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x5ad7('0x4'),'quarters',_0x5ad7('0x5'),_0x5ad7('0x6'),_0x5ad7('0x7'),_0x5ad7('0x8'),_0x5ad7('0x9')),'allowNull':![],'defaultValue':_0x5ad7('0x7')},'output':{'type':Sequelize[_0x5ad7('0xa')](_0x5ad7('0xb'),'pdf',_0x5ad7('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x5ad7('0xa')]('custom','default'),'allowNull':![],'defaultValue':_0x5ad7('0xd')},'sendMail':{'type':Sequelize[_0x5ad7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x5ad7('0x1')]},'cc':{'type':Sequelize[_0x5ad7('0xe')]},'bcc':{'type':Sequelize[_0x5ad7('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x5ad7('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x180b=['INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','default','custom','BOOLEAN','TEXT','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x180b,0x8d));var _0xb180=function(_0x2f8109,_0x4a7164){_0x2f8109=_0x2f8109-0x0;var _0x3da199=_0x180b[_0x2f8109];return _0x3da199;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb180('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xb180('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb180('0x0')],'allowNull':![],'defaultValue':_0xb180('0x1')},'startAt':{'type':Sequelize[_0xb180('0x2')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb180('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb180('0x4')](_0xb180('0x5'),_0xb180('0x6'),_0xb180('0x7'),_0xb180('0x8'),_0xb180('0x9'),_0xb180('0xa'),_0xb180('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb180('0x4')](_0xb180('0xc'),_0xb180('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xb180('0xc')},'type':{'type':Sequelize['ENUM']('custom',_0xb180('0xe')),'allowNull':![],'defaultValue':_0xb180('0xf')},'sendMail':{'type':Sequelize[_0xb180('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0xb180('0x0')]},'cc':{'type':Sequelize[_0xb180('0x11')]},'bcc':{'type':Sequelize[_0xb180('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xb180('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index f6bd15a..65f5585 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 _0xfe5a=['limit','undefined','count','set','Content-Range','apply','reject','update','then','Scheduler','UserProfileResource','error','stack','name','index','Schedule','rawAttributes','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','get','role','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x2ffc3b,_0x1e7df6){var _0x52d672=function(_0x1dd727){while(--_0x1dd727){_0x2ffc3b['push'](_0x2ffc3b['shift']());}};_0x52d672(++_0x1e7df6);}(_0xfe5a,0x85));var _0xafe5=function(_0xea7b6a,_0xe01444){_0xea7b6a=_0xea7b6a-0x0;var _0x12849f=_0xfe5a[_0xea7b6a];return _0x12849f;};'use strict';var emlformat=require(_0xafe5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafe5('0x1'));var jsonpatch=require(_0xafe5('0x2'));var rp=require(_0xafe5('0x3'));var moment=require('moment');var BPromise=require(_0xafe5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xafe5('0x5'));var csv=require(_0xafe5('0x6'));var ejs=require(_0xafe5('0x7'));var fs=require('fs');var fs_extra=require(_0xafe5('0x8'));var _=require(_0xafe5('0x9'));var squel=require(_0xafe5('0xa'));var crypto=require(_0xafe5('0xb'));var jsforce=require(_0xafe5('0xc'));var deskjs=require(_0xafe5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafe5('0xe'));var Redis=require(_0xafe5('0xf'));var authService=require(_0xafe5('0x10'));var qs=require(_0xafe5('0x11'));var as=require(_0xafe5('0x12'));var hardwareService=require(_0xafe5('0x13'));var logger=require('../../config/logger')(_0xafe5('0x14'));var utils=require(_0xafe5('0x15'));var config=require(_0xafe5('0x16'));var licenseUtil=require(_0xafe5('0x17'));var db=require(_0xafe5('0x18'))['db'];function respondWithStatusCode(_0x3c32ef,_0x22a9bf){_0x22a9bf=_0x22a9bf||0xcc;return function(_0x2a0b48){if(_0x2a0b48){return _0x3c32ef[_0xafe5('0x19')](_0x22a9bf);}return _0x3c32ef[_0xafe5('0x1a')](_0x22a9bf)[_0xafe5('0x1b')]();};}function respondWithResult(_0x202a9b,_0x111397){_0x111397=_0x111397||0xc8;return function(_0x1e31ae){if(_0x1e31ae){return _0x202a9b['status'](_0x111397)['json'](_0x1e31ae);}};}function respondWithFilteredResult(_0xe075bf,_0x47e449){return function(_0x1a1eb0){if(_0x1a1eb0){var _0x4df60a=typeof _0x47e449[_0xafe5('0x1c')]==='undefined'&&typeof _0x47e449[_0xafe5('0x1d')]===_0xafe5('0x1e');var _0x2ea9d0=_0x1a1eb0[_0xafe5('0x1f')];var _0x67e0a8=_0x4df60a?0x0:_0x47e449[_0xafe5('0x1c')];var _0x1336fb=_0x4df60a?_0x1a1eb0[_0xafe5('0x1f')]:_0x47e449[_0xafe5('0x1c')]+_0x47e449[_0xafe5('0x1d')];var _0x3ac175;if(_0x1336fb>=_0x2ea9d0){_0x1336fb=_0x2ea9d0;_0x3ac175=0xc8;}else{_0x3ac175=0xce;}_0xe075bf[_0xafe5('0x1a')](_0x3ac175);return _0xe075bf[_0xafe5('0x20')](_0xafe5('0x21'),_0x67e0a8+'-'+_0x1336fb+'/'+_0x2ea9d0)['json'](_0x1a1eb0);}return null;};}function patchUpdates(_0x54edc8){return function(_0x184d6a){try{jsonpatch[_0xafe5('0x22')](_0x184d6a,_0x54edc8,!![]);}catch(_0x286746){return BPromise[_0xafe5('0x23')](_0x286746);}return _0x184d6a['save']();};}function saveUpdates(_0x2ddc8b,_0x2f8b91){return function(_0x4a50df){if(_0x4a50df){return _0x4a50df[_0xafe5('0x24')](_0x2ddc8b)[_0xafe5('0x25')](function(_0x3f01c5){return _0x3f01c5;});}return null;};}function removeEntity(_0x36893c,_0x1d3570){return function(_0x1b57f7){if(_0x1b57f7){return _0x1b57f7['destroy']()['then'](function(){var _0x21e787=_0x1b57f7['get']({'plain':!![]});var _0x49bd07=_0xafe5('0x26');return db[_0xafe5('0x27')]['destroy']({'where':{'type':_0x49bd07,'resourceId':_0x21e787['id']}})[_0xafe5('0x25')](function(){return _0x1b57f7;});})['then'](function(){_0x36893c['status'](0xcc)[_0xafe5('0x1b')]();});}};}function handleEntityNotFound(_0x26973d,_0x267bbb){return function(_0x211485){if(!_0x211485){_0x26973d[_0xafe5('0x19')](0x194);}return _0x211485;};}function handleError(_0x14b78f,_0x570ef3){_0x570ef3=_0x570ef3||0x1f4;return function(_0x578a6e){logger[_0xafe5('0x28')](_0x578a6e[_0xafe5('0x29')]);if(_0x578a6e['name']){delete _0x578a6e[_0xafe5('0x2a')];}_0x14b78f[_0xafe5('0x1a')](_0x570ef3)['send'](_0x578a6e);};}exports[_0xafe5('0x2b')]=function(_0x3ec154,_0x304d66){var _0x23ea40={},_0x8e45f8={},_0x5ecf83={'count':0x0,'rows':[]};var _0xeb2073=_['map'](db[_0xafe5('0x2c')][_0xafe5('0x2d')],function(_0xee8b56){return{'name':_0xee8b56['fieldName'],'type':_0xee8b56['type'][_0xafe5('0x2e')]};});_0x8e45f8[_0xafe5('0x2f')]=_['map'](_0xeb2073,_0xafe5('0x2a'));_0x8e45f8[_0xafe5('0x30')]=_['keys'](_0x3ec154[_0xafe5('0x30')]);_0x8e45f8['filters']=_[_0xafe5('0x31')](_0x8e45f8[_0xafe5('0x2f')],_0x8e45f8[_0xafe5('0x30')]);_0x23ea40['attributes']=_[_0xafe5('0x31')](_0x8e45f8['model'],qs[_0xafe5('0x32')](_0x3ec154[_0xafe5('0x30')][_0xafe5('0x32')]));_0x23ea40[_0xafe5('0x33')]=_0x23ea40[_0xafe5('0x33')][_0xafe5('0x34')]?_0x23ea40[_0xafe5('0x33')]:_0x8e45f8[_0xafe5('0x2f')];if(!_0x3ec154[_0xafe5('0x30')]['hasOwnProperty'](_0xafe5('0x35'))){_0x23ea40[_0xafe5('0x1d')]=qs[_0xafe5('0x1d')](_0x3ec154[_0xafe5('0x30')][_0xafe5('0x1d')]);_0x23ea40[_0xafe5('0x1c')]=qs[_0xafe5('0x1c')](_0x3ec154[_0xafe5('0x30')]['offset']);}_0x23ea40[_0xafe5('0x36')]=qs[_0xafe5('0x37')](_0x3ec154[_0xafe5('0x30')][_0xafe5('0x37')]);_0x23ea40[_0xafe5('0x38')]=qs['filters'](_[_0xafe5('0x39')](_0x3ec154['query'],_0x8e45f8[_0xafe5('0x3a')]),_0xeb2073);if(_0x3ec154[_0xafe5('0x30')]['filter']){_0x23ea40[_0xafe5('0x38')]=_[_0xafe5('0x3b')](_0x23ea40[_0xafe5('0x38')],{'$or':_[_0xafe5('0x3c')](_0xeb2073,function(_0x102671){if(_0x102671[_0xafe5('0x3d')]!==_0xafe5('0x3e')){var _0x411317={};_0x411317[_0x102671[_0xafe5('0x2a')]]={'$like':'%'+_0x3ec154[_0xafe5('0x30')]['filter']+'%'};return _0x411317;}})});}_0x23ea40=_['merge']({},_0x23ea40,_0x3ec154[_0xafe5('0x3f')]);var _0x4b4846={'where':_0x23ea40[_0xafe5('0x38')]};return db[_0xafe5('0x2c')][_0xafe5('0x1f')](_0x4b4846)['then'](function(_0x52c48c){_0x5ecf83[_0xafe5('0x1f')]=_0x52c48c;if(_0x3ec154['query'][_0xafe5('0x40')]){_0x23ea40[_0xafe5('0x41')]=[{'all':!![]}];}return db[_0xafe5('0x2c')][_0xafe5('0x42')](_0x23ea40);})[_0xafe5('0x25')](function(_0x53dc84){_0x5ecf83[_0xafe5('0x43')]=_0x53dc84;return _0x5ecf83;})[_0xafe5('0x25')](respondWithFilteredResult(_0x304d66,_0x23ea40))['catch'](handleError(_0x304d66,null));};exports[_0xafe5('0x44')]=function(_0x132dc2,_0x1493c2){var _0x3966d4={'raw':![],'where':{'id':_0x132dc2[_0xafe5('0x45')]['id']}},_0x2a0ec5={};_0x2a0ec5[_0xafe5('0x2f')]=_['keys'](db[_0xafe5('0x2c')]['rawAttributes']);_0x2a0ec5[_0xafe5('0x30')]=_['keys'](_0x132dc2[_0xafe5('0x30')]);_0x2a0ec5[_0xafe5('0x3a')]=_[_0xafe5('0x31')](_0x2a0ec5[_0xafe5('0x2f')],_0x2a0ec5[_0xafe5('0x30')]);_0x3966d4[_0xafe5('0x33')]=_[_0xafe5('0x31')](_0x2a0ec5[_0xafe5('0x2f')],qs['fields'](_0x132dc2[_0xafe5('0x30')][_0xafe5('0x32')]));_0x3966d4[_0xafe5('0x33')]=_0x3966d4['attributes'][_0xafe5('0x34')]?_0x3966d4[_0xafe5('0x33')]:_0x2a0ec5[_0xafe5('0x2f')];if(_0x132dc2['query'][_0xafe5('0x40')]){_0x3966d4[_0xafe5('0x41')]=[{'all':!![]}];}_0x3966d4=_['merge']({},_0x3966d4,_0x132dc2[_0xafe5('0x3f')]);return db['Schedule'][_0xafe5('0x46')](_0x3966d4)['then'](handleEntityNotFound(_0x1493c2,null))['then'](respondWithResult(_0x1493c2,null))['catch'](handleError(_0x1493c2,null));};exports['create']=function(_0x4d8c7c,_0x23ee56){return db[_0xafe5('0x2c')][_0xafe5('0x47')](_0x4d8c7c[_0xafe5('0x48')],{})[_0xafe5('0x25')](function(_0x2998fb){var _0x502adf=_0x4d8c7c[_0xafe5('0x49')][_0xafe5('0x4a')]({'plain':!![]});if(!_0x502adf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x502adf[_0xafe5('0x4b')]===_0xafe5('0x49')){var _0x39c46c=_0x2998fb[_0xafe5('0x4a')]({'plain':!![]});var _0x4f79b1=_0xafe5('0x26');return db['UserProfileSection'][_0xafe5('0x46')]({'where':{'name':_0x4f79b1,'userProfileId':_0x502adf[_0xafe5('0x4c')]},'raw':!![]})['then'](function(_0x46083a){if(_0x46083a&&_0x46083a['autoAssociation']===0x0){return db[_0xafe5('0x27')][_0xafe5('0x47')]({'name':_0x39c46c[_0xafe5('0x2a')],'resourceId':_0x39c46c['id'],'type':_0x46083a['name'],'sectionId':_0x46083a['id']},{})[_0xafe5('0x25')](function(){return _0x2998fb;});}else{return _0x2998fb;}})[_0xafe5('0x4d')](function(_0x1690a8){logger[_0xafe5('0x28')](_0xafe5('0x4e'),_0x1690a8);throw _0x1690a8;});}return _0x2998fb;})[_0xafe5('0x25')](respondWithResult(_0x23ee56,0xc9))[_0xafe5('0x4d')](handleError(_0x23ee56,null));};exports[_0xafe5('0x24')]=function(_0x5220a6,_0x1d975c){if(_0x5220a6[_0xafe5('0x48')]['id']){delete _0x5220a6[_0xafe5('0x48')]['id'];}return db[_0xafe5('0x2c')][_0xafe5('0x46')]({'where':{'id':_0x5220a6['params']['id']}})[_0xafe5('0x25')](handleEntityNotFound(_0x1d975c,null))[_0xafe5('0x25')](saveUpdates(_0x5220a6[_0xafe5('0x48')],null))[_0xafe5('0x25')](respondWithResult(_0x1d975c,null))[_0xafe5('0x4d')](handleError(_0x1d975c,null));};exports[_0xafe5('0x4f')]=function(_0xeac95e,_0x5b6c84){return db['Schedule'][_0xafe5('0x46')]({'where':{'id':_0xeac95e['params']['id']}})['then'](handleEntityNotFound(_0x5b6c84,null))['then'](removeEntity(_0x5b6c84,null))['catch'](handleError(_0x5b6c84,null));};exports[_0xafe5('0x50')]=function(_0x2ec1a3,_0x1844ed,_0x328c04){var _0x3871b5=require('../../config/schedule');return db[_0xafe5('0x2c')][_0xafe5('0x46')]({'where':{'id':_0x2ec1a3[_0xafe5('0x45')]['id']},'raw':!![]})[_0xafe5('0x25')](handleEntityNotFound(_0x1844ed,null))[_0xafe5('0x25')](function(){_0x3871b5[_0xafe5('0x50')](_0x2ec1a3['params']['id']);})[_0xafe5('0x25')](respondWithStatusCode(_0x1844ed,null))['catch'](handleError(_0x1844ed,null));}; \ No newline at end of file +var _0x6333=['where','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','get','role','user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','Scheduler','destroy','then','name','send','map','Schedule','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5d2a9d,_0x2a27dc){var _0x22db20=function(_0x3cb019){while(--_0x3cb019){_0x5d2a9d['push'](_0x5d2a9d['shift']());}};_0x22db20(++_0x2a27dc);}(_0x6333,0x118));var _0x3633=function(_0x264838,_0x2941ca){_0x264838=_0x264838-0x0;var _0x44585c=_0x6333[_0x264838];return _0x44585c;};'use strict';var emlformat=require(_0x3633('0x0'));var rimraf=require(_0x3633('0x1'));var zipdir=require(_0x3633('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3633('0x3'));var moment=require('moment');var BPromise=require(_0x3633('0x4'));var Mustache=require(_0x3633('0x5'));var util=require(_0x3633('0x6'));var path=require(_0x3633('0x7'));var sox=require('sox');var csv=require(_0x3633('0x8'));var ejs=require(_0x3633('0x9'));var fs=require('fs');var fs_extra=require(_0x3633('0xa'));var _=require(_0x3633('0xb'));var squel=require(_0x3633('0xc'));var crypto=require('crypto');var jsforce=require(_0x3633('0xd'));var deskjs=require(_0x3633('0xe'));var toCsv=require(_0x3633('0x8'));var querystring=require(_0x3633('0xf'));var Papa=require(_0x3633('0x10'));var Redis=require(_0x3633('0x11'));var authService=require(_0x3633('0x12'));var qs=require(_0x3633('0x13'));var as=require(_0x3633('0x14'));var hardwareService=require(_0x3633('0x15'));var logger=require(_0x3633('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3633('0x17'));var licenseUtil=require(_0x3633('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4598,_0x586784){_0x586784=_0x586784||0xcc;return function(_0x279183){if(_0x279183){return _0x3c4598[_0x3633('0x19')](_0x586784);}return _0x3c4598[_0x3633('0x1a')](_0x586784)[_0x3633('0x1b')]();};}function respondWithResult(_0x3c37d6,_0xfee07a){_0xfee07a=_0xfee07a||0xc8;return function(_0x3d4376){if(_0x3d4376){return _0x3c37d6[_0x3633('0x1a')](_0xfee07a)[_0x3633('0x1c')](_0x3d4376);}};}function respondWithFilteredResult(_0x1fd9ce,_0x463a02){return function(_0x426b0e){if(_0x426b0e){var _0x1b9d71=typeof _0x463a02['offset']===_0x3633('0x1d')&&typeof _0x463a02[_0x3633('0x1e')]===_0x3633('0x1d');var _0x160e8d=_0x426b0e[_0x3633('0x1f')];var _0x24e2ba=_0x1b9d71?0x0:_0x463a02[_0x3633('0x20')];var _0x324570=_0x1b9d71?_0x426b0e[_0x3633('0x1f')]:_0x463a02[_0x3633('0x20')]+_0x463a02['limit'];var _0x30f69d;if(_0x324570>=_0x160e8d){_0x324570=_0x160e8d;_0x30f69d=0xc8;}else{_0x30f69d=0xce;}_0x1fd9ce[_0x3633('0x1a')](_0x30f69d);return _0x1fd9ce[_0x3633('0x21')](_0x3633('0x22'),_0x24e2ba+'-'+_0x324570+'/'+_0x160e8d)['json'](_0x426b0e);}return null;};}function patchUpdates(_0x3c7cbb){return function(_0x569ede){try{jsonpatch[_0x3633('0x23')](_0x569ede,_0x3c7cbb,!![]);}catch(_0x1c08df){return BPromise[_0x3633('0x24')](_0x1c08df);}return _0x569ede[_0x3633('0x25')]();};}function saveUpdates(_0x4b3831,_0x203a6f){return function(_0x1dab7e){if(_0x1dab7e){return _0x1dab7e[_0x3633('0x26')](_0x4b3831)['then'](function(_0x3409ad){return _0x3409ad;});}return null;};}function removeEntity(_0x152679,_0x46161b){return function(_0x46ba95){if(_0x46ba95){return _0x46ba95['destroy']()['then'](function(){var _0x5cec26=_0x46ba95['get']({'plain':!![]});var _0x6c7bdd=_0x3633('0x27');return db['UserProfileResource'][_0x3633('0x28')]({'where':{'type':_0x6c7bdd,'resourceId':_0x5cec26['id']}})[_0x3633('0x29')](function(){return _0x46ba95;});})[_0x3633('0x29')](function(){_0x152679[_0x3633('0x1a')](0xcc)[_0x3633('0x1b')]();});}};}function handleEntityNotFound(_0x1e3da2,_0x3336cd){return function(_0x4345ed){if(!_0x4345ed){_0x1e3da2[_0x3633('0x19')](0x194);}return _0x4345ed;};}function handleError(_0x527920,_0x1de2c4){_0x1de2c4=_0x1de2c4||0x1f4;return function(_0x3f3691){logger['error'](_0x3f3691['stack']);if(_0x3f3691[_0x3633('0x2a')]){delete _0x3f3691[_0x3633('0x2a')];}_0x527920['status'](_0x1de2c4)[_0x3633('0x2b')](_0x3f3691);};}exports['index']=function(_0x40ec5d,_0x38d86c){var _0x263377={},_0x53b931={},_0x3b91d8={'count':0x0,'rows':[]};var _0x581d8f=_[_0x3633('0x2c')](db[_0x3633('0x2d')]['rawAttributes'],function(_0x1e0e55){return{'name':_0x1e0e55[_0x3633('0x2e')],'type':_0x1e0e55['type'][_0x3633('0x2f')]};});_0x53b931[_0x3633('0x30')]=_[_0x3633('0x2c')](_0x581d8f,'name');_0x53b931['query']=_[_0x3633('0x31')](_0x40ec5d[_0x3633('0x32')]);_0x53b931[_0x3633('0x33')]=_[_0x3633('0x34')](_0x53b931[_0x3633('0x30')],_0x53b931[_0x3633('0x32')]);_0x263377['attributes']=_[_0x3633('0x34')](_0x53b931['model'],qs[_0x3633('0x35')](_0x40ec5d[_0x3633('0x32')][_0x3633('0x35')]));_0x263377['attributes']=_0x263377[_0x3633('0x36')][_0x3633('0x37')]?_0x263377[_0x3633('0x36')]:_0x53b931[_0x3633('0x30')];if(!_0x40ec5d[_0x3633('0x32')][_0x3633('0x38')](_0x3633('0x39'))){_0x263377[_0x3633('0x1e')]=qs['limit'](_0x40ec5d['query'][_0x3633('0x1e')]);_0x263377['offset']=qs[_0x3633('0x20')](_0x40ec5d[_0x3633('0x32')]['offset']);}_0x263377[_0x3633('0x3a')]=qs['sort'](_0x40ec5d[_0x3633('0x32')][_0x3633('0x3b')]);_0x263377[_0x3633('0x3c')]=qs[_0x3633('0x33')](_['pick'](_0x40ec5d['query'],_0x53b931[_0x3633('0x33')]),_0x581d8f);if(_0x40ec5d[_0x3633('0x32')]['filter']){_0x263377[_0x3633('0x3c')]=_[_0x3633('0x3d')](_0x263377[_0x3633('0x3c')],{'$or':_['map'](_0x581d8f,function(_0x411e7c){if(_0x411e7c[_0x3633('0x3e')]!==_0x3633('0x3f')){var _0x4bbe7d={};_0x4bbe7d[_0x411e7c[_0x3633('0x2a')]]={'$like':'%'+_0x40ec5d[_0x3633('0x32')][_0x3633('0x40')]+'%'};return _0x4bbe7d;}})});}_0x263377=_[_0x3633('0x3d')]({},_0x263377,_0x40ec5d[_0x3633('0x41')]);var _0x10cee4={'where':_0x263377[_0x3633('0x3c')]};return db[_0x3633('0x2d')][_0x3633('0x1f')](_0x10cee4)['then'](function(_0x4c540b){_0x3b91d8[_0x3633('0x1f')]=_0x4c540b;if(_0x40ec5d[_0x3633('0x32')][_0x3633('0x42')]){_0x263377['include']=[{'all':!![]}];}return db[_0x3633('0x2d')][_0x3633('0x43')](_0x263377);})[_0x3633('0x29')](function(_0x1624b5){_0x3b91d8['rows']=_0x1624b5;return _0x3b91d8;})[_0x3633('0x29')](respondWithFilteredResult(_0x38d86c,_0x263377))[_0x3633('0x44')](handleError(_0x38d86c,null));};exports[_0x3633('0x45')]=function(_0x173994,_0x31f69c){var _0xab9a6b={'raw':![],'where':{'id':_0x173994[_0x3633('0x46')]['id']}},_0xdb26e1={};_0xdb26e1[_0x3633('0x30')]=_[_0x3633('0x31')](db[_0x3633('0x2d')][_0x3633('0x47')]);_0xdb26e1[_0x3633('0x32')]=_['keys'](_0x173994[_0x3633('0x32')]);_0xdb26e1[_0x3633('0x33')]=_[_0x3633('0x34')](_0xdb26e1['model'],_0xdb26e1[_0x3633('0x32')]);_0xab9a6b['attributes']=_[_0x3633('0x34')](_0xdb26e1[_0x3633('0x30')],qs[_0x3633('0x35')](_0x173994[_0x3633('0x32')]['fields']));_0xab9a6b['attributes']=_0xab9a6b['attributes'][_0x3633('0x37')]?_0xab9a6b['attributes']:_0xdb26e1[_0x3633('0x30')];if(_0x173994[_0x3633('0x32')][_0x3633('0x42')]){_0xab9a6b['include']=[{'all':!![]}];}_0xab9a6b=_[_0x3633('0x3d')]({},_0xab9a6b,_0x173994[_0x3633('0x41')]);return db['Schedule'][_0x3633('0x48')](_0xab9a6b)[_0x3633('0x29')](handleEntityNotFound(_0x31f69c,null))[_0x3633('0x29')](respondWithResult(_0x31f69c,null))['catch'](handleError(_0x31f69c,null));};exports['create']=function(_0xc3b8f3,_0x31d9e4){return db[_0x3633('0x2d')][_0x3633('0x49')](_0xc3b8f3[_0x3633('0x4a')],{})['then'](function(_0x28a0ef){var _0x204b91=_0xc3b8f3['user'][_0x3633('0x4b')]({'plain':!![]});if(!_0x204b91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x204b91[_0x3633('0x4c')]===_0x3633('0x4d')){var _0x536b61=_0x28a0ef[_0x3633('0x4b')]({'plain':!![]});var _0x574208=_0x3633('0x27');return db['UserProfileSection'][_0x3633('0x48')]({'where':{'name':_0x574208,'userProfileId':_0x204b91[_0x3633('0x4e')]},'raw':!![]})[_0x3633('0x29')](function(_0x33ec60){if(_0x33ec60&&_0x33ec60[_0x3633('0x4f')]===0x0){return db[_0x3633('0x50')][_0x3633('0x49')]({'name':_0x536b61[_0x3633('0x2a')],'resourceId':_0x536b61['id'],'type':_0x33ec60['name'],'sectionId':_0x33ec60['id']},{})[_0x3633('0x29')](function(){return _0x28a0ef;});}else{return _0x28a0ef;}})['catch'](function(_0x1b1caa){logger[_0x3633('0x51')](_0x3633('0x52'),_0x1b1caa);throw _0x1b1caa;});}return _0x28a0ef;})[_0x3633('0x29')](respondWithResult(_0x31d9e4,0xc9))[_0x3633('0x44')](handleError(_0x31d9e4,null));};exports[_0x3633('0x26')]=function(_0x515959,_0x21e69d){if(_0x515959[_0x3633('0x4a')]['id']){delete _0x515959[_0x3633('0x4a')]['id'];}return db[_0x3633('0x2d')][_0x3633('0x48')]({'where':{'id':_0x515959[_0x3633('0x46')]['id']}})['then'](handleEntityNotFound(_0x21e69d,null))['then'](saveUpdates(_0x515959[_0x3633('0x4a')],null))[_0x3633('0x29')](respondWithResult(_0x21e69d,null))['catch'](handleError(_0x21e69d,null));};exports[_0x3633('0x28')]=function(_0x235f8a,_0x5e9e96){return db[_0x3633('0x2d')][_0x3633('0x48')]({'where':{'id':_0x235f8a[_0x3633('0x46')]['id']}})[_0x3633('0x29')](handleEntityNotFound(_0x5e9e96,null))['then'](removeEntity(_0x5e9e96,null))[_0x3633('0x44')](handleError(_0x5e9e96,null));};exports[_0x3633('0x53')]=function(_0x4b1763,_0x4a3ef4,_0xcedc19){var _0x7ebec1=require(_0x3633('0x54'));return db[_0x3633('0x2d')]['find']({'where':{'id':_0x4b1763[_0x3633('0x46')]['id']},'raw':!![]})[_0x3633('0x29')](handleEntityNotFound(_0x4a3ef4,null))[_0x3633('0x29')](function(){_0x7ebec1[_0x3633('0x53')](_0x4b1763['params']['id']);})[_0x3633('0x29')](respondWithStatusCode(_0x4a3ef4,null))['catch'](handleError(_0x4a3ef4,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7c19dc9..c7dce57 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 _0x85c8=['../../config/environment','./schedule.attributes','exports','Schedule','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85c8,0x86));var _0x885c=function(_0x45d600,_0x596cfb){_0x45d600=_0x45d600-0x0;var _0x51b3b=_0x85c8[_0x45d600];return _0x51b3b;};'use strict';var _=require(_0x885c('0x0'));var util=require(_0x885c('0x1'));var logger=require(_0x885c('0x2'))(_0x885c('0x3'));var moment=require(_0x885c('0x4'));var BPromise=require(_0x885c('0x5'));var rp=require(_0x885c('0x6'));var fs=require('fs');var path=require(_0x885c('0x7'));var rimraf=require(_0x885c('0x8'));var config=require(_0x885c('0x9'));var attributes=require(_0x885c('0xa'));module[_0x885c('0xb')]=function(_0x181182,_0x577eed){return _0x181182['define'](_0x885c('0xc'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb51=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x233f4c,_0xbf0efa){var _0x1aa56a=function(_0x286702){while(--_0x286702){_0x233f4c['push'](_0x233f4c['shift']());}};_0x1aa56a(++_0xbf0efa);}(_0xcb51,0xc8));var _0x1cb5=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xcb51[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x1cb5('0x0'));var util=require('util');var logger=require(_0x1cb5('0x1'))(_0x1cb5('0x2'));var moment=require(_0x1cb5('0x3'));var BPromise=require('bluebird');var rp=require(_0x1cb5('0x4'));var fs=require('fs');var path=require(_0x1cb5('0x5'));var rimraf=require(_0x1cb5('0x6'));var config=require(_0x1cb5('0x7'));var attributes=require(_0x1cb5('0x8'));module[_0x1cb5('0x9')]=function(_0x4bef53,_0x4d9c24){return _0x4bef53[_0x1cb5('0xa')](_0x1cb5('0xb'),attributes,{'tableName':_0x1cb5('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 c1af1c9..7738ea6 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 _0xb21c=['Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x4a49da,_0x3325be){var _0x41aab2=function(_0x1387de){while(--_0x1387de){_0x4a49da['push'](_0x4a49da['shift']());}};_0x41aab2(++_0x3325be);}(_0xb21c,0x6d));var _0xcb21=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0xb21c[_0x29ce14];return _0x48f289;};'use strict';var _=require(_0xcb21('0x0'));var util=require(_0xcb21('0x1'));var moment=require('moment');var BPromise=require(_0xcb21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb21('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb21('0x4'));var logger=require(_0xcb21('0x5'))('rpc');var config=require(_0xcb21('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcb21('0x7')][_0xcb21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x459455,_0x30474c,_0x56bc75){return new BPromise(function(_0x5e6ccf,_0x1305c1){return client[_0xcb21('0x9')](_0x459455,_0x56bc75)[_0xcb21('0xa')](function(_0x564dc2){logger['info'](_0xcb21('0xb'),_0x30474c,_0xcb21('0xc'));logger[_0xcb21('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x30474c,'request\x20sent',JSON[_0xcb21('0xe')](_0x564dc2));if(_0x564dc2['error']){if(_0x564dc2[_0xcb21('0xf')]['code']===0x1f4){logger['error'](_0xcb21('0xb'),_0x30474c,_0x564dc2[_0xcb21('0xf')]['message']);return _0x1305c1(_0x564dc2[_0xcb21('0xf')][_0xcb21('0x10')]);}logger[_0xcb21('0xf')](_0xcb21('0xb'),_0x30474c,_0x564dc2[_0xcb21('0xf')][_0xcb21('0x10')]);return _0x5e6ccf(_0x564dc2[_0xcb21('0xf')][_0xcb21('0x10')]);}else{logger[_0xcb21('0x11')]('Schedule,\x20%s,\x20%s',_0x30474c,_0xcb21('0xc'));_0x5e6ccf(_0x564dc2[_0xcb21('0x12')]['message']);}})[_0xcb21('0x13')](function(_0x48daa8){logger[_0xcb21('0xf')]('Schedule,\x20%s,\x20%s',_0x30474c,_0x48daa8);_0x1305c1(_0x48daa8);});});} \ No newline at end of file +var _0x67f6=['../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x53b07e,_0x40a122){var _0x14776a=function(_0x32d8c5){while(--_0x32d8c5){_0x53b07e['push'](_0x53b07e['shift']());}};_0x14776a(++_0x40a122);}(_0x67f6,0x16f));var _0x667f=function(_0x516a6e,_0x3abade){_0x516a6e=_0x516a6e-0x0;var _0x353d41=_0x67f6[_0x516a6e];return _0x353d41;};'use strict';var _=require('lodash');var util=require(_0x667f('0x0'));var moment=require('moment');var BPromise=require(_0x667f('0x1'));var rs=require(_0x667f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x667f('0x3'))['db'];var utils=require(_0x667f('0x4'));var logger=require(_0x667f('0x5'))(_0x667f('0x6'));var config=require(_0x667f('0x7'));var jayson=require(_0x667f('0x8'));var client=jayson[_0x667f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x200218,_0x25342d,_0x4e244a){return new BPromise(function(_0xa506b6,_0x58bbdc){return client[_0x667f('0xa')](_0x200218,_0x4e244a)[_0x667f('0xb')](function(_0x3365b5){logger[_0x667f('0xc')](_0x667f('0xd'),_0x25342d,_0x667f('0xe'));logger[_0x667f('0xf')](_0x667f('0x10'),_0x25342d,_0x667f('0xe'),JSON[_0x667f('0x11')](_0x3365b5));if(_0x3365b5[_0x667f('0x12')]){if(_0x3365b5['error'][_0x667f('0x13')]===0x1f4){logger[_0x667f('0x12')](_0x667f('0xd'),_0x25342d,_0x3365b5['error'][_0x667f('0x14')]);return _0x58bbdc(_0x3365b5[_0x667f('0x12')][_0x667f('0x14')]);}logger['error'](_0x667f('0xd'),_0x25342d,_0x3365b5['error'][_0x667f('0x14')]);return _0xa506b6(_0x3365b5['error'][_0x667f('0x14')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x25342d,_0x667f('0xe'));_0xa506b6(_0x3365b5['result'][_0x667f('0x14')]);}})[_0x667f('0x15')](function(_0x433a00){logger[_0x667f('0x12')](_0x667f('0xd'),_0x25342d,_0x433a00);_0x58bbdc(_0x433a00);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 10313b5..eee798d 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 _0x2262=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','post','update','destroy','exports','multer','util','path'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x2262,0x66));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2226('0x0'));var util=require(_0x2226('0x1'));var path=require(_0x2226('0x2'));var timeout=require(_0x2226('0x3'));var express=require('express');var router=express[_0x2226('0x4')]();var fs_extra=require(_0x2226('0x5'));var auth=require(_0x2226('0x6'));var interaction=require(_0x2226('0x7'));var config=require(_0x2226('0x8'));var controller=require(_0x2226('0x9'));router[_0x2226('0xa')]('/',auth['isAuthenticated'](),controller[_0x2226('0xb')]);router[_0x2226('0xa')](_0x2226('0xc'),auth[_0x2226('0xd')](),controller[_0x2226('0xe')]);router[_0x2226('0xa')](_0x2226('0xf'),auth[_0x2226('0xd')](),controller['show']);router[_0x2226('0xa')](_0x2226('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x2226('0x11')]('/',auth[_0x2226('0xd')](),controller['create']);router['put'](_0x2226('0xf'),auth[_0x2226('0xd')](),controller[_0x2226('0x12')]);router['delete'](_0x2226('0xf'),auth[_0x2226('0xd')](),controller[_0x2226('0x13')]);module[_0x2226('0x14')]=router; \ No newline at end of file +var _0x6037=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x536659,_0x107b64){var _0x26ebde=function(_0x33b817){while(--_0x33b817){_0x536659['push'](_0x536659['shift']());}};_0x26ebde(++_0x107b64);}(_0x6037,0xd6));var _0x7603=function(_0x193650,_0x23aae3){_0x193650=_0x193650-0x0;var _0xab135b=_0x6037[_0x193650];return _0xab135b;};'use strict';var multer=require(_0x7603('0x0'));var util=require(_0x7603('0x1'));var path=require(_0x7603('0x2'));var timeout=require(_0x7603('0x3'));var express=require(_0x7603('0x4'));var router=express['Router']();var fs_extra=require(_0x7603('0x5'));var auth=require(_0x7603('0x6'));var interaction=require(_0x7603('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x7603('0x8')]('/',auth[_0x7603('0x9')](),controller[_0x7603('0xa')]);router['get'](_0x7603('0xb'),auth[_0x7603('0x9')](),controller[_0x7603('0xc')]);router[_0x7603('0x8')](_0x7603('0xd'),auth[_0x7603('0x9')](),controller[_0x7603('0xe')]);router[_0x7603('0x8')](_0x7603('0xf'),auth[_0x7603('0x9')](),controller['download']);router[_0x7603('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7603('0x11')]('/:id',auth[_0x7603('0x9')](),controller[_0x7603('0x12')]);router[_0x7603('0x13')](_0x7603('0xd'),auth['isAuthenticated'](),controller[_0x7603('0x14')]);module[_0x7603('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 3887e67..cf4683b 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 _0x0760=['path','getDataValue','value','extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','sequelize'];(function(_0x4b1b8c,_0x20557a){var _0x5a6012=function(_0x54cccc){while(--_0x54cccc){_0x4b1b8c['push'](_0x4b1b8c['shift']());}};_0x5a6012(++_0x20557a);}(_0x0760,0xa9));var _0x0076=function(_0x3cb429,_0x31d477){_0x3cb429=_0x3cb429-0x0;var _0x303568=_0x0760[_0x3cb429];return _0x303568;};'use strict';var Sequelize=require(_0x0076('0x0'));var moment=require('moment');var path=require(_0x0076('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0076('0x2')](_0x0076('0x3'))?path[_0x0076('0x4')](this[_0x0076('0x2')](_0x0076('0x3'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0076('0x5')]},'value':{'type':Sequelize[_0x0076('0x5')],'set':function(_0x1b7f29){var _0x9b8b1a=_0x1b7f29[_0x0076('0x6')](/\\/g,'/');this['setDataValue'](_0x0076('0x3'),_0x9b8b1a);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0076('0x7')],'set':function(_0x31ad28){this['setDataValue'](_0x0076('0x8'),moment()[_0x0076('0x9')](_0x31ad28,'ms'));this[_0x0076('0xa')](_0x0076('0xb'),moment());this[_0x0076('0xa')](_0x0076('0xc'),_0x31ad28);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0076('0x2')](_0x0076('0x8')))[_0x0076('0xd')](_0x0076('0xe'))[_0x0076('0xf')]();}},'closedAt':{'type':Sequelize[_0x0076('0x10')],'get':function(){return moment(this[_0x0076('0x2')](_0x0076('0xb')))[_0x0076('0xd')](_0x0076('0xe'))[_0x0076('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0076('0x2')]('createdAt'))['format'](_0x0076('0xe'))[_0x0076('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0076('0x2')]('updatedAt'))[_0x0076('0xd')](_0x0076('0xe'))['toString']();}}}; \ No newline at end of file +var _0x88c3=['subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','path','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x88c3,0x1ee));var _0x388c=function(_0x178825,_0x106fa3){_0x178825=_0x178825-0x0;var _0x45bf3f=_0x88c3[_0x178825];return _0x45bf3f;};'use strict';var Sequelize=require(_0x388c('0x0'));var moment=require('moment');var path=require(_0x388c('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x388c('0x2')],'get':function(){return this['getDataValue']('value')?path[_0x388c('0x3')](this[_0x388c('0x4')](_0x388c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x388c('0x6')]},'channel':{'type':Sequelize[_0x388c('0x6')]},'value':{'type':Sequelize[_0x388c('0x6')],'set':function(_0x5a1c0d){var _0x3e79d8=_0x5a1c0d[_0x388c('0x7')](/\\/g,'/');this[_0x388c('0x8')](_0x388c('0x5'),_0x3e79d8);}},'rating':{'type':Sequelize[_0x388c('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x388c('0x9')],'set':function(_0x2debe9){this[_0x388c('0x8')]('startedAt',moment()[_0x388c('0xa')](_0x2debe9,'ms'));this['setDataValue']('closedAt',moment());this[_0x388c('0x8')](_0x388c('0xb'),_0x2debe9);}},'startedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this[_0x388c('0x4')](_0x388c('0xd')))[_0x388c('0xe')](_0x388c('0xf'))[_0x388c('0x10')]();}},'closedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this['getDataValue']('closedAt'))['format'](_0x388c('0xf'))[_0x388c('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x388c('0x4')](_0x388c('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0x388c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this[_0x388c('0x4')]('updatedAt'))[_0x388c('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x388c('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b9a5ed4..5529932 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 _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x32a5f4,_0x338818){var _0x2200ef=function(_0x1d4e60){while(--_0x1d4e60){_0x32a5f4['push'](_0x32a5f4['shift']());}};_0x2200ef(++_0x338818);}(_0xbd50,0x196));var _0x0bd5=function(_0x23bcd4,_0xd3deb0){_0x23bcd4=_0x23bcd4-0x0;var _0x4cb792=_0xbd50[_0x23bcd4];return _0x4cb792;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));}; \ No newline at end of file +var _0xa41a=['unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','key','differenceBy','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','params','include','find','catch','create','body','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname'];(function(_0x2e712f,_0x60d75f){var _0x2fb152=function(_0x577196){while(--_0x577196){_0x2e712f['push'](_0x2e712f['shift']());}};_0x2fb152(++_0x60d75f);}(_0xa41a,0x6b));var _0xaa41=function(_0x2f6a08,_0x15370d){_0x2f6a08=_0x2f6a08-0x0;var _0x35c22d=_0xa41a[_0x2f6a08];return _0x35c22d;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){_0x43a85c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aec5,_0x527cac){return function(_0x493a10){if(!_0x493a10){_0x16aec5[_0xaa41('0x19')](0x194);}return _0x493a10;};}function handleError(_0x59707f,_0x536bed){_0x536bed=_0x536bed||0x1f4;return function(_0x2d0ac0){logger[_0xaa41('0x26')](_0x2d0ac0[_0xaa41('0x27')]);if(_0x2d0ac0[_0xaa41('0x28')]){delete _0x2d0ac0[_0xaa41('0x28')];}_0x59707f[_0xaa41('0x1a')](_0x536bed)['send'](_0x2d0ac0);};}exports[_0xaa41('0x29')]=function(_0x1f0275,_0x63c18c){var _0x9a16e3={},_0x1d8c2b={},_0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x2a')](db['ScreenRecording'][_0xaa41('0x2b')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x1d8c2b['model']=_[_0xaa41('0x2e')](_[_0xaa41('0x2a')](_0x30f88e,'name'),['format']);_0x1d8c2b['query']=_[_0xaa41('0x2f')](_0x1f0275[_0xaa41('0x30')]);_0x1d8c2b[_0xaa41('0x31')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],_0x1d8c2b[_0xaa41('0x30')]);_0x9a16e3[_0xaa41('0x33')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],qs[_0xaa41('0x34')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x34')]));_0x9a16e3['attributes']=_0x9a16e3[_0xaa41('0x33')][_0xaa41('0x35')]?_0x9a16e3['attributes']:_0x1d8c2b[_0xaa41('0x36')];if(!_0x1f0275[_0xaa41('0x30')][_0xaa41('0x37')]('nolimit')){_0x9a16e3[_0xaa41('0x1e')]=qs['limit'](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x1e')]);_0x9a16e3[_0xaa41('0x20')]=qs['offset'](_0x1f0275['query']['offset']);}_0x9a16e3[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x39')]);_0x9a16e3['where']=qs['filters'](_[_0xaa41('0x3a')](_0x1f0275[_0xaa41('0x30')],_0x1d8c2b[_0xaa41('0x31')]),_0x30f88e);if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]){_0x9a16e3[_0xaa41('0x3c')]=_[_0xaa41('0x3d')](_0x9a16e3['where'],{'$or':_[_0xaa41('0x2a')](_0x30f88e,function(_0x5cf689){if(_0x5cf689[_0xaa41('0x2c')]!==_0xaa41('0x3e')){var _0x57f1bf={};_0x57f1bf[_0x5cf689['name']]={'$like':'%'+_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]+'%'};return _0x57f1bf;}})});}_0x9a16e3=_['merge']({},_0x9a16e3,_0x1f0275[_0xaa41('0x3f')]);var _0x563687={'where':_0x9a16e3[_0xaa41('0x3c')]};return db[_0xaa41('0x40')][_0xaa41('0x1f')](_0x563687)[_0xaa41('0x25')](function(_0x3e6cac){_0x4466a3[_0xaa41('0x1f')]=_0x3e6cac;if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x41')]){_0x9a16e3['include']=[{'all':!![]}];}return db[_0xaa41('0x40')][_0xaa41('0x42')](_0x9a16e3);})[_0xaa41('0x25')](function(_0x398c35){_0x4466a3[_0xaa41('0x43')]=_0x398c35;return _0x4466a3;})[_0xaa41('0x25')](respondWithFilteredResult(_0x63c18c,_0x9a16e3))['catch'](handleError(_0x63c18c,null));};exports['show']=function(_0x87e2f4,_0x4f9086){var _0x1ed366={'raw':![],'where':{'id':_0x87e2f4[_0xaa41('0x44')]['id']}},_0x215896={};_0x215896[_0xaa41('0x36')]=_[_0xaa41('0x2f')](db[_0xaa41('0x40')][_0xaa41('0x2b')]);_0x215896['query']=_[_0xaa41('0x2f')](_0x87e2f4['query']);_0x215896['filters']=_[_0xaa41('0x32')](_0x215896['model'],_0x215896['query']);_0x1ed366['attributes']=_[_0xaa41('0x32')](_0x215896['model'],qs[_0xaa41('0x34')](_0x87e2f4[_0xaa41('0x30')]['fields']));_0x1ed366['attributes']=_0x1ed366[_0xaa41('0x33')][_0xaa41('0x35')]?_0x1ed366[_0xaa41('0x33')]:_0x215896[_0xaa41('0x36')];if(_0x87e2f4[_0xaa41('0x30')][_0xaa41('0x41')]){_0x1ed366[_0xaa41('0x45')]=[{'all':!![]}];}_0x1ed366=_[_0xaa41('0x3d')]({},_0x1ed366,_0x87e2f4[_0xaa41('0x3f')]);return db['ScreenRecording'][_0xaa41('0x46')](_0x1ed366)[_0xaa41('0x25')](handleEntityNotFound(_0x4f9086,null))[_0xaa41('0x25')](respondWithResult(_0x4f9086,null))[_0xaa41('0x47')](handleError(_0x4f9086,null));};exports[_0xaa41('0x48')]=function(_0x1d6112,_0x538b12){return db[_0xaa41('0x40')][_0xaa41('0x48')](_0x1d6112[_0xaa41('0x49')],{})[_0xaa41('0x25')](respondWithResult(_0x538b12,0xc9))['catch'](handleError(_0x538b12,null));};exports[_0xaa41('0x23')]=function(_0x5787f3,_0x49fedd){if(_0x5787f3[_0xaa41('0x49')]['id']){delete _0x5787f3[_0xaa41('0x49')]['id'];}delete _0x5787f3[_0xaa41('0x49')]['duration'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4a')];delete _0x5787f3[_0xaa41('0x49')]['closedAt'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4b')];return db[_0xaa41('0x40')][_0xaa41('0x46')]({'where':{'id':_0x5787f3[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x49fedd,null))[_0xaa41('0x25')](saveUpdates(_0x5787f3[_0xaa41('0x49')],null))['then'](respondWithResult(_0x49fedd,null))[_0xaa41('0x47')](handleError(_0x49fedd,null));};exports['describe']=function(_0x5ae65e,_0x1bdcd6){return db[_0xaa41('0x40')][_0xaa41('0x4c')]()[_0xaa41('0x25')](respondWithResult(_0x1bdcd6,null))[_0xaa41('0x47')](handleError(_0x1bdcd6,null));};exports[_0xaa41('0x4d')]=function(_0x48c4c7,_0x3c5082,_0x519e39){var _0xecb54=require(_0xaa41('0x4e'));var _0x1d518f=![];var _0x4f9e92={};if(_0x48c4c7[_0xaa41('0x30')][_0xaa41('0x2c')]&&_0x48c4c7['query'][_0xaa41('0x2c')]===_0xaa41('0x4f')){_0x4f9e92[_0xaa41('0x4f')]=_0x48c4c7['params']['id'];}else{_0x4f9e92['id']=_0x48c4c7[_0xaa41('0x44')]['id'];}return db[_0xaa41('0x40')]['find']({'where':_0x4f9e92,'attributes':['id','value'],'raw':!![]})[_0xaa41('0x25')](handleEntityNotFound(_0x3c5082,null))[_0xaa41('0x25')](function(_0x3a29d2){if(_0x3a29d2){var _0x4d20c6=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x3a29d2[_0xaa41('0x4b')]);var _0x2abb78=util['format'](_0xaa41('0x53'),_0x4d20c6);if(fs['existsSync'](_0x2abb78)){_0x1d518f=!![];return _0xecb54['decryptFile'](_0x2abb78,_0x4d20c6,config[_0xaa41('0x54')]['recording'])[_0xaa41('0x25')](function(){return _0x3a29d2;});}return _0x3a29d2;}})[_0xaa41('0x25')](function(_0x169ddf){if(_0x169ddf){var _0x5e83e1=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x169ddf[_0xaa41('0x4b')]);if(!fs[_0xaa41('0x55')](_0x5e83e1)){throw new db[(_0xaa41('0x56'))][(_0xaa41('0x57'))](_0xaa41('0x58'));}if(_0x169ddf[_0xaa41('0x59')]){return _0x3c5082['download'](_0x5e83e1,_0x169ddf[_0xaa41('0x59')]+path[_0xaa41('0x5a')](_0x5e83e1),function(){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}else{return _0x3c5082['download'](_0x5e83e1,function(_0x3fe47a){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}}})[_0xaa41('0x47')](function(_0x134579){if(_0x134579[_0xaa41('0x5c')]===_0xaa41('0x58')){_0x3c5082[_0xaa41('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c5082,null);}});};exports['destroy']=function(_0x540325,_0x4ec357){return db['ScreenRecording'][_0xaa41('0x46')]({'where':{'id':_0x540325['params']['id']}})['then'](function(_0x24c6f3){if(_[_0xaa41('0x5d')](_0x24c6f3)){throw new ReferenceError(_0xaa41('0x5e'));}return _0x24c6f3;})[_0xaa41('0x25')](function(_0x5cabc4){var _0x244d41=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x5cabc4[_0xaa41('0x4b')]);logger[_0xaa41('0x5f')](_0xaa41('0x60'),_0x244d41);if(!_[_0xaa41('0x5d')](_0x5cabc4[_0xaa41('0x4b')])&&fs['existsSync'](_0x244d41)){logger[_0xaa41('0x5f')](_0xaa41('0x61')+_0x244d41+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x244d41);}_0x244d41=_0x244d41+'.cypher';if(!_[_0xaa41('0x5d')](_0x5cabc4['value'])&&fs[_0xaa41('0x55')](_0x244d41)){logger['info'](_0xaa41('0x61')+_0x244d41+_0xaa41('0x62'));fs['unlinkSync'](_0x244d41);}return _0x5cabc4;})[_0xaa41('0x25')](function(_0x33efc5){if(!_0x33efc5)throw new InternalError();return _0x33efc5[_0xaa41('0x24')]();})[_0xaa41('0x25')](function(){_0x4ec357['status'](0xcc)['end']();})[_0xaa41('0x47')](handleError(_0x4ec357,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 91d44d7..df9860b 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 _0x9013=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b5199,_0x58a8e5){var _0x2f5736=function(_0x1f35ce){while(--_0x1f35ce){_0x5b5199['push'](_0x5b5199['shift']());}};_0x2f5736(++_0x58a8e5);}(_0x9013,0x1ad));var _0x3901=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9013[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x3901('0x0'));var util=require('util');var logger=require(_0x3901('0x1'))(_0x3901('0x2'));var moment=require(_0x3901('0x3'));var BPromise=require(_0x3901('0x4'));var rp=require(_0x3901('0x5'));var fs=require('fs');var path=require(_0x3901('0x6'));var rimraf=require(_0x3901('0x7'));var config=require(_0x3901('0x8'));var attributes=require(_0x3901('0x9'));module[_0x3901('0xa')]=function(_0x57d250,_0x47b04f){return _0x57d250[_0x3901('0xb')](_0x3901('0xc'),attributes,{'tableName':_0x3901('0xd'),'paranoid':![],'indexes':[{'name':_0x3901('0xe'),'fields':[_0x3901('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28a9=['define','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x594015,_0x4bc284){var _0x56da72=function(_0x29199d){while(--_0x29199d){_0x594015['push'](_0x594015['shift']());}};_0x56da72(++_0x4bc284);}(_0x28a9,0x1c3));var _0x928a=function(_0x50a44b,_0x2bea0a){_0x50a44b=_0x50a44b-0x0;var _0x372b56=_0x28a9[_0x50a44b];return _0x372b56;};'use strict';var _=require(_0x928a('0x0'));var util=require('util');var logger=require(_0x928a('0x1'))(_0x928a('0x2'));var moment=require(_0x928a('0x3'));var BPromise=require(_0x928a('0x4'));var rp=require(_0x928a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x928a('0x6'));var config=require(_0x928a('0x7'));var attributes=require('./screenRecording.attributes');module[_0x928a('0x8')]=function(_0x1e669c,_0x3c6c4c){return _0x1e669c[_0x928a('0x9')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4b024b0..c1042f3 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 _0xcdf6=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0xcdf6,0xe9));var _0x6cdf=function(_0x273e55,_0x3df4b2){_0x273e55=_0x273e55-0x0;var _0x23b8fa=_0xcdf6[_0x273e55];return _0x23b8fa;};'use strict';var _=require(_0x6cdf('0x0'));var util=require(_0x6cdf('0x1'));var moment=require('moment');var BPromise=require(_0x6cdf('0x2'));var rs=require(_0x6cdf('0x3'));var fs=require('fs');var Redis=require(_0x6cdf('0x4'));var db=require(_0x6cdf('0x5'))['db'];var utils=require(_0x6cdf('0x6'));var logger=require(_0x6cdf('0x7'))(_0x6cdf('0x8'));var config=require(_0x6cdf('0x9'));var jayson=require(_0x6cdf('0xa'));var client=jayson[_0x6cdf('0xb')][_0x6cdf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ea7b2,_0xca05ee,_0x59b2fd){return new BPromise(function(_0xa6320,_0xf5d32c){return client[_0x6cdf('0xd')](_0x5ea7b2,_0x59b2fd)['then'](function(_0x2104b3){logger['info'](_0x6cdf('0xe'),_0xca05ee,_0x6cdf('0xf'));logger[_0x6cdf('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xca05ee,_0x6cdf('0xf'),JSON[_0x6cdf('0x11')](_0x2104b3));if(_0x2104b3[_0x6cdf('0x12')]){if(_0x2104b3[_0x6cdf('0x12')][_0x6cdf('0x13')]===0x1f4){logger[_0x6cdf('0x12')](_0x6cdf('0xe'),_0xca05ee,_0x2104b3[_0x6cdf('0x12')]['message']);return _0xf5d32c(_0x2104b3['error']['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0xca05ee,_0x2104b3['error']['message']);return _0xa6320(_0x2104b3[_0x6cdf('0x12')][_0x6cdf('0x14')]);}else{logger['info'](_0x6cdf('0xe'),_0xca05ee,_0x6cdf('0xf'));_0xa6320(_0x2104b3[_0x6cdf('0x15')][_0x6cdf('0x14')]);}})[_0x6cdf('0x16')](function(_0xcbbf54){logger[_0x6cdf('0x12')](_0x6cdf('0xe'),_0xca05ee,_0xcbbf54);_0xf5d32c(_0xcbbf54);});});} \ No newline at end of file +var _0x44a9=['../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x195f71,_0x40c2bd){var _0x3bb3bc=function(_0x4827fb){while(--_0x4827fb){_0x195f71['push'](_0x195f71['shift']());}};_0x3bb3bc(++_0x40c2bd);}(_0x44a9,0x1c8));var _0x944a=function(_0x353d65,_0x2557a6){_0x353d65=_0x353d65-0x0;var _0x453be5=_0x44a9[_0x353d65];return _0x453be5;};'use strict';var _=require('lodash');var util=require(_0x944a('0x0'));var moment=require(_0x944a('0x1'));var BPromise=require('bluebird');var rs=require(_0x944a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x944a('0x3'))['db'];var utils=require(_0x944a('0x4'));var logger=require(_0x944a('0x5'))('rpc');var config=require(_0x944a('0x6'));var jayson=require(_0x944a('0x7'));var client=jayson[_0x944a('0x8')][_0x944a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27b16a,_0x41696b,_0xae996){return new BPromise(function(_0x338128,_0xd6f8b){return client[_0x944a('0xa')](_0x27b16a,_0xae996)['then'](function(_0x1a2844){logger[_0x944a('0xb')](_0x944a('0xc'),_0x41696b,_0x944a('0xd'));logger[_0x944a('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x41696b,_0x944a('0xd'),JSON[_0x944a('0xf')](_0x1a2844));if(_0x1a2844[_0x944a('0x10')]){if(_0x1a2844[_0x944a('0x10')][_0x944a('0x11')]===0x1f4){logger[_0x944a('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x41696b,_0x1a2844[_0x944a('0x10')][_0x944a('0x12')]);return _0xd6f8b(_0x1a2844[_0x944a('0x10')][_0x944a('0x12')]);}logger[_0x944a('0x10')](_0x944a('0xc'),_0x41696b,_0x1a2844['error']['message']);return _0x338128(_0x1a2844[_0x944a('0x10')][_0x944a('0x12')]);}else{logger['info'](_0x944a('0xc'),_0x41696b,_0x944a('0xd'));_0x338128(_0x1a2844[_0x944a('0x13')][_0x944a('0x12')]);}})[_0x944a('0x14')](function(_0x1defde){logger[_0x944a('0x10')](_0x944a('0xc'),_0x41696b,_0x1defde);_0xd6f8b(_0x1defde);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6ee06a7..5542669 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 _0x0538=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','%s%s','logo','extname','originalname','post','/:id/logo','single','file','join','server/files/images/logos/','format','logologin','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','exports','util','path','connect-timeout','express'];(function(_0x38f0ae,_0x1234e0){var _0x32b720=function(_0x23e64f){while(--_0x23e64f){_0x38f0ae['push'](_0x38f0ae['shift']());}};_0x32b720(++_0x1234e0);}(_0x0538,0x1aa));var _0x8053=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x0538[_0x4c8a8f];return _0x404500;};'use strict';var multer=require('multer');var util=require(_0x8053('0x0'));var path=require(_0x8053('0x1'));var timeout=require(_0x8053('0x2'));var express=require(_0x8053('0x3'));var router=express[_0x8053('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8053('0x5'));var interaction=require(_0x8053('0x6'));var config=require(_0x8053('0x7'));var controller=require(_0x8053('0x8'));router[_0x8053('0x9')]('/',auth[_0x8053('0xa')](),controller[_0x8053('0xb')]);router[_0x8053('0x9')]('/now',controller['getDate']);router['get'](_0x8053('0xc'),controller[_0x8053('0xd')]);router['get']('/:id/logo',controller[_0x8053('0xe')]);router['get'](_0x8053('0xf'),controller['getLogoLogin']);router[_0x8053('0x9')](_0x8053('0x10'),controller[_0x8053('0x11')]);router[_0x8053('0x9')](_0x8053('0x12'),controller[_0x8053('0x13')]);router['get'](_0x8053('0x14'),controller[_0x8053('0x15')]);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x2cab15,_0x1be7d2,_0x343982){_0x343982(null,path['join'](config[_0x8053('0x17')],'server/files/images/logos/'));},'filename':function(_0x12438c,_0x27f568,_0x2504bb){_0x2504bb(null,util['format'](_0x8053('0x18'),_0x8053('0x19'),path[_0x8053('0x1a')](_0x27f568[_0x8053('0x1b')])));}})});router[_0x8053('0x1c')](_0x8053('0x1d'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x20d7da,_0xd0cfba,_0x342c2e){_0x342c2e(null,path[_0x8053('0x20')](config[_0x8053('0x17')],_0x8053('0x21')));},'filename':function(_0x4861cf,_0x34fb16,_0xe47f94){_0xe47f94(null,util[_0x8053('0x22')](_0x8053('0x18'),_0x8053('0x23'),path[_0x8053('0x1a')](_0x34fb16['originalname'])));}})});router[_0x8053('0x1c')](_0x8053('0xf'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller[_0x8053('0x24')]);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x32b328,_0xa4861f,_0x398c49){_0x398c49(null,path[_0x8053('0x20')](config[_0x8053('0x17')],_0x8053('0x21')));},'filename':function(_0x92a55,_0x3d0452,_0x54a8cd){_0x54a8cd(null,util[_0x8053('0x22')](_0x8053('0x18'),_0x8053('0x25'),path[_0x8053('0x1a')](_0x3d0452[_0x8053('0x1b')])));}})});router[_0x8053('0x1c')](_0x8053('0x12'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller[_0x8053('0x26')]);var upload=multer({'storage':multer[_0x8053('0x16')]({'destination':function(_0x35b9d9,_0x45d6ce,_0x5b1654){_0x5b1654(null,path[_0x8053('0x20')](config[_0x8053('0x17')],'server/files/images/logos/'));},'filename':function(_0x431f7a,_0x312eb4,_0xcf5b2e){_0xcf5b2e(null,util[_0x8053('0x22')](_0x8053('0x18'),_0x8053('0x27'),path[_0x8053('0x1a')](_0x312eb4[_0x8053('0x1b')])));}})});router[_0x8053('0x1c')](_0x8053('0x14'),upload[_0x8053('0x1e')](_0x8053('0x1f')),controller[_0x8053('0x28')]);router[_0x8053('0x29')](_0x8053('0xc'),auth[_0x8053('0xa')](),controller['update']);module[_0x8053('0x2a')]=router; \ No newline at end of file +var _0xb00f=['getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','file','addLogo','logologin','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','/now','getDate','show','get','/:id/logo'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xb00f,0xd0));var _0xfb00=function(_0x1a1be0,_0x2d3cb7){_0x1a1be0=_0x1a1be0-0x0;var _0x1be824=_0xb00f[_0x1a1be0];return _0x1be824;};'use strict';var multer=require(_0xfb00('0x0'));var util=require(_0xfb00('0x1'));var path=require(_0xfb00('0x2'));var timeout=require(_0xfb00('0x3'));var express=require(_0xfb00('0x4'));var router=express[_0xfb00('0x5')]();var fs_extra=require(_0xfb00('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfb00('0x7'));var config=require(_0xfb00('0x8'));var controller=require(_0xfb00('0x9'));router['get']('/',auth[_0xfb00('0xa')](),controller[_0xfb00('0xb')]);router['get'](_0xfb00('0xc'),controller[_0xfb00('0xd')]);router['get']('/:id',controller[_0xfb00('0xe')]);router[_0xfb00('0xf')](_0xfb00('0x10'),controller[_0xfb00('0x11')]);router['get']('/:id/logo_login',controller[_0xfb00('0x12')]);router[_0xfb00('0xf')]('/:id/gdpr',controller[_0xfb00('0x13')]);router[_0xfb00('0xf')](_0xfb00('0x14'),controller[_0xfb00('0x15')]);router[_0xfb00('0xf')](_0xfb00('0x16'),controller[_0xfb00('0x17')]);var upload=multer({'storage':multer[_0xfb00('0x18')]({'destination':function(_0x50c24e,_0xe2e2dc,_0x2d5e72){_0x2d5e72(null,path[_0xfb00('0x19')](config[_0xfb00('0x1a')],_0xfb00('0x1b')));},'filename':function(_0x2b91cd,_0x521d99,_0x310b24){_0x310b24(null,util[_0xfb00('0x1c')](_0xfb00('0x1d'),'logo',path[_0xfb00('0x1e')](_0x521d99[_0xfb00('0x1f')])));}})});router[_0xfb00('0x20')]('/:id/logo',upload['single'](_0xfb00('0x21')),controller[_0xfb00('0x22')]);var upload=multer({'storage':multer[_0xfb00('0x18')]({'destination':function(_0x30c622,_0x54a04d,_0x38da6d){_0x38da6d(null,path['join'](config[_0xfb00('0x1a')],_0xfb00('0x1b')));},'filename':function(_0x53a91b,_0x2e3939,_0x18362c){_0x18362c(null,util[_0xfb00('0x1c')](_0xfb00('0x1d'),_0xfb00('0x23'),path[_0xfb00('0x1e')](_0x2e3939[_0xfb00('0x1f')])));}})});router[_0xfb00('0x20')]('/:id/logo_login',upload[_0xfb00('0x24')]('file'),controller[_0xfb00('0x25')]);var upload=multer({'storage':multer[_0xfb00('0x18')]({'destination':function(_0x874aff,_0x57e5c3,_0x28bc70){_0x28bc70(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x262c83,_0x13db8c,_0x1ae710){_0x1ae710(null,util[_0xfb00('0x1c')]('%s%s',_0xfb00('0x26'),path['extname'](_0x13db8c['originalname'])));}})});router[_0xfb00('0x20')](_0xfb00('0x14'),upload['single'](_0xfb00('0x21')),controller[_0xfb00('0x27')]);var upload=multer({'storage':multer[_0xfb00('0x18')]({'destination':function(_0x48ecb3,_0x36adb6,_0x2d4b37){_0x2d4b37(null,path[_0xfb00('0x19')](config['root'],_0xfb00('0x1b')));},'filename':function(_0x17332b,_0x411966,_0xa0a8d8){_0xa0a8d8(null,util[_0xfb00('0x1c')](_0xfb00('0x1d'),_0xfb00('0x28'),path[_0xfb00('0x1e')](_0x411966[_0xfb00('0x1f')])));}})});router[_0xfb00('0x20')](_0xfb00('0x16'),upload[_0xfb00('0x24')](_0xfb00('0x21')),controller[_0xfb00('0x29')]);router[_0xfb00('0x2a')](_0xfb00('0x2b'),auth[_0xfb00('0xa')](),controller['update']);module[_0xfb00('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index dabb75f..c2edeac 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x407869,_0x2bc3b3){var _0x3047d2=function(_0x11768f){while(--_0x11768f){_0x407869['push'](_0x407869['shift']());}};_0x3047d2(++_0x2bc3b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5ccdf1,_0x537ea4){var _0x42367a=function(_0x3a3edb){while(--_0x3a3edb){_0x5ccdf1['push'](_0x5ccdf1['shift']());}};_0x42367a(++_0x537ea4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index ccd322b..13ba1ed 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 _0x8daa=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','map','Setting','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','body','file','filename','loginLogo','../../config/license/util','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x4fb2a2,_0x39c111){var _0x54d389=function(_0x1574d1){while(--_0x1574d1){_0x4fb2a2['push'](_0x4fb2a2['shift']());}};_0x54d389(++_0x39c111);}(_0x8daa,0x67));var _0xa8da=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x8daa[_0x5b077b];return _0x16faf7;};'use strict';var emlformat=require(_0xa8da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8da('0x1'));var jsonpatch=require(_0xa8da('0x2'));var rp=require(_0xa8da('0x3'));var moment=require(_0xa8da('0x4'));var BPromise=require(_0xa8da('0x5'));var Mustache=require(_0xa8da('0x6'));var util=require('util');var path=require(_0xa8da('0x7'));var sox=require(_0xa8da('0x8'));var csv=require(_0xa8da('0x9'));var ejs=require(_0xa8da('0xa'));var fs=require('fs');var fs_extra=require(_0xa8da('0xb'));var _=require(_0xa8da('0xc'));var squel=require(_0xa8da('0xd'));var crypto=require('crypto');var jsforce=require(_0xa8da('0xe'));var deskjs=require(_0xa8da('0xf'));var toCsv=require(_0xa8da('0x9'));var querystring=require('querystring');var Papa=require(_0xa8da('0x10'));var Redis=require('ioredis');var authService=require(_0xa8da('0x11'));var qs=require(_0xa8da('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8da('0x13'));var logger=require(_0xa8da('0x14'))(_0xa8da('0x15'));var utils=require(_0xa8da('0x16'));var config=require(_0xa8da('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8da('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa8da('0x19')][_0xa8da('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x590325,_0x58ab44,_0x3e47a4,_0x33bdbe){return new BPromise(function(_0x5c2e2b,_0x4b06b1){var _0x8d3530=_0x33bdbe||client;return _0x8d3530[_0xa8da('0x1b')](_0x590325,_0x3e47a4)['then'](function(_0x80949e){logger[_0xa8da('0x1c')](_0xa8da('0x1d'),_0x58ab44,_0xa8da('0x1e'));logger['debug'](_0xa8da('0x1f'),_0x58ab44,_0xa8da('0x1e'),JSON[_0xa8da('0x20')](_0x80949e));if(_0x80949e[_0xa8da('0x21')]){if(_0x80949e[_0xa8da('0x21')][_0xa8da('0x22')]===0x1f4){logger[_0xa8da('0x21')](_0xa8da('0x1d'),_0x58ab44,_0x80949e[_0xa8da('0x21')][_0xa8da('0x23')]);return _0x4b06b1(_0x80949e[_0xa8da('0x21')]['message']);}logger[_0xa8da('0x21')](_0xa8da('0x1d'),_0x58ab44,_0x80949e[_0xa8da('0x21')][_0xa8da('0x23')]);return _0x5c2e2b(_0x80949e[_0xa8da('0x21')][_0xa8da('0x23')]);}else{logger[_0xa8da('0x1c')]('Setting,\x20%s,\x20%s',_0x58ab44,_0xa8da('0x1e'));_0x5c2e2b(_0x80949e[_0xa8da('0x24')][_0xa8da('0x23')]);}})['catch'](function(_0xc4a991){logger[_0xa8da('0x21')](_0xa8da('0x1d'),_0x58ab44,_0xc4a991);_0x4b06b1(_0xc4a991);});});}function respondWithStatusCode(_0x364de2,_0x5799ed){_0x5799ed=_0x5799ed||0xcc;return function(_0x5c0793){if(_0x5c0793){return _0x364de2['sendStatus'](_0x5799ed);}return _0x364de2[_0xa8da('0x25')](_0x5799ed)[_0xa8da('0x26')]();};}function respondWithResult(_0xc596f,_0x1935dd){_0x1935dd=_0x1935dd||0xc8;return function(_0x456e7d){if(_0x456e7d){return _0xc596f[_0xa8da('0x25')](_0x1935dd)[_0xa8da('0x27')](_0x456e7d);}};}function respondWithFilteredResult(_0x35dcf6,_0x429a72){return function(_0x37a8ff){if(_0x37a8ff){var _0x5d3aca=typeof _0x429a72['offset']===_0xa8da('0x28')&&typeof _0x429a72['limit']===_0xa8da('0x28');var _0x3cf711=_0x37a8ff[_0xa8da('0x29')];var _0x44d8cb=_0x5d3aca?0x0:_0x429a72[_0xa8da('0x2a')];var _0x29147c=_0x5d3aca?_0x37a8ff['count']:_0x429a72[_0xa8da('0x2a')]+_0x429a72[_0xa8da('0x2b')];var _0x3a4e82;if(_0x29147c>=_0x3cf711){_0x29147c=_0x3cf711;_0x3a4e82=0xc8;}else{_0x3a4e82=0xce;}_0x35dcf6[_0xa8da('0x25')](_0x3a4e82);return _0x35dcf6[_0xa8da('0x2c')](_0xa8da('0x2d'),_0x44d8cb+'-'+_0x29147c+'/'+_0x3cf711)[_0xa8da('0x27')](_0x37a8ff);}return null;};}function patchUpdates(_0x554256){return function(_0x43f888){try{jsonpatch[_0xa8da('0x2e')](_0x43f888,_0x554256,!![]);}catch(_0x1873ee){return BPromise[_0xa8da('0x2f')](_0x1873ee);}return _0x43f888[_0xa8da('0x30')]();};}function saveUpdates(_0x431d37,_0x1d019b){return function(_0x6f1a2c){if(_0x6f1a2c){return _0x6f1a2c[_0xa8da('0x31')](_0x431d37)[_0xa8da('0x32')](function(_0x428269){return _0x428269;});}return null;};}function removeEntity(_0x4e16ad,_0x1cf6e4){return function(_0x29f719){if(_0x29f719){return _0x29f719[_0xa8da('0x33')]()['then'](function(){_0x4e16ad['status'](0xcc)[_0xa8da('0x26')]();});}};}function handleEntityNotFound(_0x1ef411,_0x21a2af){return function(_0x2ee0ba){if(!_0x2ee0ba){_0x1ef411[_0xa8da('0x34')](0x194);}return _0x2ee0ba;};}function handleError(_0x45dd72,_0x20a0a5){_0x20a0a5=_0x20a0a5||0x1f4;return function(_0x305f9d){logger[_0xa8da('0x21')](_0x305f9d[_0xa8da('0x35')]);if(_0x305f9d[_0xa8da('0x36')]){delete _0x305f9d[_0xa8da('0x36')];}_0x45dd72['status'](_0x20a0a5)['send'](_0x305f9d);};}exports['index']=function(_0x52bdae,_0x6cff25){var _0x3b7a71={},_0x25ef1e={},_0x315161={'count':0x0,'rows':[]};var _0x46bad3=_[_0xa8da('0x37')](db[_0xa8da('0x38')]['rawAttributes'],function(_0x20cb47){return{'name':_0x20cb47[_0xa8da('0x39')],'type':_0x20cb47[_0xa8da('0x3a')]['key']};});_0x25ef1e[_0xa8da('0x3b')]=_[_0xa8da('0x37')](_0x46bad3,'name');_0x25ef1e[_0xa8da('0x3c')]=_['keys'](_0x52bdae[_0xa8da('0x3c')]);_0x25ef1e[_0xa8da('0x3d')]=_[_0xa8da('0x3e')](_0x25ef1e[_0xa8da('0x3b')],_0x25ef1e[_0xa8da('0x3c')]);_0x3b7a71[_0xa8da('0x3f')]=_[_0xa8da('0x3e')](_0x25ef1e['model'],qs['fields'](_0x52bdae['query'][_0xa8da('0x40')]));_0x3b7a71[_0xa8da('0x3f')]=_0x3b7a71['attributes'][_0xa8da('0x41')]?_0x3b7a71[_0xa8da('0x3f')]:_0x25ef1e['model'];if(!_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x42')](_0xa8da('0x43'))){_0x3b7a71[_0xa8da('0x2b')]=qs[_0xa8da('0x2b')](_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x2b')]);_0x3b7a71[_0xa8da('0x2a')]=qs[_0xa8da('0x2a')](_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x2a')]);}_0x3b7a71['order']=qs[_0xa8da('0x44')](_0x52bdae['query'][_0xa8da('0x44')]);_0x3b7a71[_0xa8da('0x45')]=qs[_0xa8da('0x3d')](_['pick'](_0x52bdae[_0xa8da('0x3c')],_0x25ef1e[_0xa8da('0x3d')]),_0x46bad3);if(_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x46')]){_0x3b7a71[_0xa8da('0x45')]=_[_0xa8da('0x47')](_0x3b7a71[_0xa8da('0x45')],{'$or':_[_0xa8da('0x37')](_0x46bad3,function(_0x4d5974){if(_0x4d5974[_0xa8da('0x3a')]!=='VIRTUAL'){var _0x28aca4={};_0x28aca4[_0x4d5974[_0xa8da('0x36')]]={'$like':'%'+_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x46')]+'%'};return _0x28aca4;}})});}_0x3b7a71=_[_0xa8da('0x47')]({},_0x3b7a71,_0x52bdae[_0xa8da('0x48')]);var _0x5d956d={'where':_0x3b7a71[_0xa8da('0x45')]};return db[_0xa8da('0x38')]['count'](_0x5d956d)[_0xa8da('0x32')](function(_0x50d684){_0x315161['count']=_0x50d684;if(_0x52bdae[_0xa8da('0x3c')][_0xa8da('0x49')]){_0x3b7a71[_0xa8da('0x4a')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x3b7a71);})['then'](function(_0x28378b){_0x315161[_0xa8da('0x4b')]=_0x28378b;return _0x315161;})[_0xa8da('0x32')](respondWithFilteredResult(_0x6cff25,_0x3b7a71))[_0xa8da('0x4c')](handleError(_0x6cff25,null));};exports[_0xa8da('0x4d')]=function(_0x497e03,_0x3c569c){var _0x4b2c43={'raw':![],'where':{'id':_0x497e03[_0xa8da('0x4e')]['id']}},_0x51801c={};_0x51801c[_0xa8da('0x3b')]=_['keys'](db[_0xa8da('0x38')][_0xa8da('0x4f')]);_0x51801c['query']=_[_0xa8da('0x50')](_0x497e03[_0xa8da('0x3c')]);_0x51801c[_0xa8da('0x3d')]=_[_0xa8da('0x3e')](_0x51801c[_0xa8da('0x3b')],_0x51801c[_0xa8da('0x3c')]);_0x4b2c43[_0xa8da('0x3f')]=_['intersection'](_0x51801c[_0xa8da('0x3b')],qs[_0xa8da('0x40')](_0x497e03['query'][_0xa8da('0x40')]));_0x4b2c43[_0xa8da('0x3f')]=_0x4b2c43['attributes'][_0xa8da('0x41')]?_0x4b2c43[_0xa8da('0x3f')]:_0x51801c[_0xa8da('0x3b')];if(_0x497e03[_0xa8da('0x3c')]['includeAll']){_0x4b2c43['include']=[{'all':!![]}];}_0x4b2c43=_[_0xa8da('0x47')]({},_0x4b2c43,_0x497e03[_0xa8da('0x48')]);return db['Setting'][_0xa8da('0x51')](_0x4b2c43)[_0xa8da('0x32')](handleEntityNotFound(_0x3c569c,null))[_0xa8da('0x32')](respondWithResult(_0x3c569c,null))['catch'](handleError(_0x3c569c,null));};exports['update']=function(_0x3c8fd,_0x19815f){if(_0x3c8fd[_0xa8da('0x52')]['id']){delete _0x3c8fd[_0xa8da('0x52')]['id'];}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x3c8fd[_0xa8da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x19815f,null))[_0xa8da('0x32')](saveUpdates(_0x3c8fd[_0xa8da('0x52')],null))[_0xa8da('0x32')](respondWithResult(_0x19815f,null))[_0xa8da('0x4c')](handleError(_0x19815f,null));};exports['addLogo']=function(_0xe7df16,_0x231261,_0x2c8b34){if(_0xe7df16[_0xa8da('0x53')]&&_0xe7df16[_0xa8da('0x53')][_0xa8da('0x54')]){_0xe7df16['body']['logo']=_0xe7df16[_0xa8da('0x53')][_0xa8da('0x54')];}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0xe7df16[_0xa8da('0x4e')]['id']}})[_0xa8da('0x32')](handleEntityNotFound(_0x231261,null))[_0xa8da('0x32')](saveUpdates(_0xe7df16[_0xa8da('0x52')],null))[_0xa8da('0x32')](respondWithResult(_0x231261,null))[_0xa8da('0x4c')](handleError(_0x231261,null));};exports['addLogoLogin']=function(_0x38fd48,_0x302be4,_0x50c4d7){if(_0x38fd48['file']&&_0x38fd48[_0xa8da('0x53')][_0xa8da('0x54')]){_0x38fd48[_0xa8da('0x52')][_0xa8da('0x55')]=_0x38fd48[_0xa8da('0x53')][_0xa8da('0x54')];}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x38fd48[_0xa8da('0x4e')]['id']}})[_0xa8da('0x32')](handleEntityNotFound(_0x302be4,null))[_0xa8da('0x32')](saveUpdates(_0x38fd48[_0xa8da('0x52')],null))['then'](respondWithResult(_0x302be4,null))[_0xa8da('0x4c')](handleError(_0x302be4,null));};var utilLicense=require(_0xa8da('0x56'));exports['getLogo']=function(_0x46ff16,_0x243298,_0x443e7b){var _0x51e437=_0xa8da('0x57');var _0x2b3adb={'custom':![]};return utilLicense['getLicense']()[_0xa8da('0x32')](function(_0xf3bcd7){if(_0xf3bcd7){_0x2b3adb=_0xf3bcd7;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x46ff16['params']['id']},'attributes':[_0xa8da('0x58'),_0xa8da('0x55'),_0xa8da('0x59'),_0xa8da('0x5a'),_0xa8da('0x5b'),_0xa8da('0x5c'),_0xa8da('0x5d'),_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0x243298,null))[_0xa8da('0x32')](function(_0x5d6bcd){if(_0x5d6bcd){var _0x115262=_0x5d6bcd['logo']&&fs[_0xa8da('0x5f')](path[_0xa8da('0x60')](config['root'],_0x51e437,_[_0xa8da('0x61')](_0x5d6bcd['logo'])))?path['join'](config[_0xa8da('0x62')],_0x51e437,_[_0xa8da('0x61')](_0x5d6bcd['logo'])):path['join'](config[_0xa8da('0x62')],_0x51e437,_[_0xa8da('0x61')]('default_logo.svg'));var _0xee0c6b=_0xa8da('0x63')+_[_0xa8da('0x64')]('logo');if(_0x5d6bcd[_0xee0c6b]||!_0x2b3adb[_0xa8da('0x65')]){_0x115262=path[_0xa8da('0x60')](config['root'],_0x51e437,_['toLower'](_0xa8da('0x66')));}if(!fs[_0xa8da('0x5f')](_0x115262)){throw new db[(_0xa8da('0x67'))][(_0xa8da('0x68'))](_[_0xa8da('0x64')](_0xa8da('0x58'))+_0xa8da('0x69'));}return _0x243298[_0xa8da('0x6a')](_0x115262);}})[_0xa8da('0x4c')](handleError(_0x243298,null));};var utilLicense=require(_0xa8da('0x56'));exports['getLogoLogin']=function(_0x3239c6,_0x33553b,_0x423fae){var _0x4b33e5=_0xa8da('0x57');var _0x103613={'custom':![]};return utilLicense[_0xa8da('0x6b')]()[_0xa8da('0x32')](function(_0x3e1121){if(_0x3e1121){_0x103613=_0x3e1121;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x3239c6['params']['id']},'attributes':[_0xa8da('0x58'),_0xa8da('0x55'),_0xa8da('0x59'),'favicon','defaultLogo',_0xa8da('0x5c'),'defaultPreferred',_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0x33553b,null))['then'](function(_0x40998a){if(_0x40998a){var _0x51a5e6=_0x40998a[_0xa8da('0x55')]&&fs['existsSync'](path[_0xa8da('0x60')](config['root'],_0x4b33e5,_[_0xa8da('0x61')](_0x40998a[_0xa8da('0x55')])))?path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x4b33e5,_[_0xa8da('0x61')](_0x40998a[_0xa8da('0x55')])):path['join'](config[_0xa8da('0x62')],_0x4b33e5,_[_0xa8da('0x61')](_0xa8da('0x6c')));var _0x729f7b=_0xa8da('0x63')+_['upperFirst']('loginLogo');if(_0x40998a[_0x729f7b]||!_0x103613[_0xa8da('0x65')]){_0x51a5e6=path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x4b33e5,_[_0xa8da('0x61')](_0xa8da('0x6c')));}if(!fs['existsSync'](_0x51a5e6)){throw new db['Sequelize']['ValidationError'](_[_0xa8da('0x64')](_0xa8da('0x55'))+'\x20not\x20found');}return _0x33553b['download'](_0x51a5e6);}})['catch'](handleError(_0x33553b,null));};exports[_0xa8da('0x6d')]=function(_0x2e5ecf,_0x40c398){return db[_0xa8da('0x38')]['find']({'where':{'id':_0x2e5ecf['params']['id']},'attributes':[_0xa8da('0x6e')]})['then'](respondWithResult(_0x40c398,null))[_0xa8da('0x4c')](handleError(_0x40c398,null));};exports[_0xa8da('0x6f')]=function(_0x147524,_0x467d5f,_0x5eb30f){if(_0x147524[_0xa8da('0x53')]&&_0x147524['file'][_0xa8da('0x54')]){_0x147524[_0xa8da('0x52')][_0xa8da('0x59')]=_0x147524[_0xa8da('0x53')][_0xa8da('0x54')];}return db['Setting']['find']({'where':{'id':_0x147524[_0xa8da('0x4e')]['id']}})[_0xa8da('0x32')](handleEntityNotFound(_0x467d5f,null))[_0xa8da('0x32')](saveUpdates(_0x147524[_0xa8da('0x52')],null))['then'](respondWithResult(_0x467d5f,null))['catch'](handleError(_0x467d5f,null));};var utilLicense=require(_0xa8da('0x56'));exports['getPreferred']=function(_0x2703de,_0xc86005,_0x3c6089){var _0x2ea730=_0xa8da('0x57');var _0xc65e07={'custom':![]};return utilLicense['getLicense']()[_0xa8da('0x32')](function(_0x2c1b03){if(_0x2c1b03){_0xc65e07=_0x2c1b03;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x2703de[_0xa8da('0x4e')]['id']},'attributes':[_0xa8da('0x58'),_0xa8da('0x55'),_0xa8da('0x59'),'favicon','defaultLogo',_0xa8da('0x5c'),_0xa8da('0x5d'),_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0xc86005,null))[_0xa8da('0x32')](function(_0x3fe1b7){if(_0x3fe1b7){var _0x5bbb3b=_0x3fe1b7[_0xa8da('0x59')]&&fs[_0xa8da('0x5f')](path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x2ea730,_[_0xa8da('0x61')](_0x3fe1b7[_0xa8da('0x59')])))?path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x2ea730,_[_0xa8da('0x61')](_0x3fe1b7[_0xa8da('0x59')])):path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x2ea730,_[_0xa8da('0x61')](_0xa8da('0x70')));var _0x1a1c58=_0xa8da('0x63')+_[_0xa8da('0x64')]('preferred');if(_0x3fe1b7[_0x1a1c58]||!_0xc65e07[_0xa8da('0x65')]||!_0xc65e07[_0xa8da('0x59')]){_0x5bbb3b=path['join'](config[_0xa8da('0x62')],_0x2ea730,_['toLower'](_0xa8da('0x70')));}if(!fs['existsSync'](_0x5bbb3b)){throw new db['Sequelize'][(_0xa8da('0x68'))](_['upperFirst'](_0xa8da('0x59'))+_0xa8da('0x69'));}return _0xc86005[_0xa8da('0x6a')](_0x5bbb3b);}})[_0xa8da('0x4c')](handleError(_0xc86005,null));};exports[_0xa8da('0x71')]=function(_0x3ff567,_0x1c8738,_0x5e3115){if(_0x3ff567[_0xa8da('0x53')]&&_0x3ff567[_0xa8da('0x53')][_0xa8da('0x54')]){_0x3ff567[_0xa8da('0x52')][_0xa8da('0x5a')]=_0x3ff567[_0xa8da('0x53')][_0xa8da('0x54')];}return db[_0xa8da('0x38')]['find']({'where':{'id':_0x3ff567[_0xa8da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1c8738,null))[_0xa8da('0x32')](saveUpdates(_0x3ff567[_0xa8da('0x52')],null))[_0xa8da('0x32')](respondWithResult(_0x1c8738,null))[_0xa8da('0x4c')](handleError(_0x1c8738,null));};var utilLicense=require(_0xa8da('0x56'));exports[_0xa8da('0x72')]=function(_0x2a00d3,_0x1f5020,_0x29cd5b){var _0x22104f=_0xa8da('0x57');var _0x19601c={'custom':![]};return utilLicense[_0xa8da('0x6b')]()['then'](function(_0x482854){if(_0x482854){_0x19601c=_0x482854;}return db[_0xa8da('0x38')][_0xa8da('0x51')]({'where':{'id':_0x2a00d3[_0xa8da('0x4e')]['id']},'attributes':['logo',_0xa8da('0x55'),_0xa8da('0x59'),_0xa8da('0x5a'),'defaultLogo','defaultLoginLogo',_0xa8da('0x5d'),_0xa8da('0x5e')],'raw':!![]});})[_0xa8da('0x32')](handleEntityNotFound(_0x1f5020,null))[_0xa8da('0x32')](function(_0x39174b){if(_0x39174b){var _0x81248=_0x39174b[_0xa8da('0x5a')]&&fs[_0xa8da('0x5f')](path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x22104f,_[_0xa8da('0x61')](_0x39174b[_0xa8da('0x5a')])))?path[_0xa8da('0x60')](config['root'],_0x22104f,_['toLower'](_0x39174b['favicon'])):path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x22104f,_[_0xa8da('0x61')]('default_favicon.ico'));var _0x154fee=_0xa8da('0x63')+_['upperFirst'](_0xa8da('0x5a'));if(_0x39174b[_0x154fee]||!_0x19601c['custom']){_0x81248=path[_0xa8da('0x60')](config[_0xa8da('0x62')],_0x22104f,_[_0xa8da('0x61')](_0xa8da('0x73')));}if(!fs[_0xa8da('0x5f')](_0x81248)){throw new db['Sequelize'][(_0xa8da('0x68'))](_[_0xa8da('0x64')]('favicon')+_0xa8da('0x69'));}return _0x1f5020[_0xa8da('0x6a')](_0x81248);}})[_0xa8da('0x4c')](handleError(_0x1f5020,null));};exports[_0xa8da('0x74')]=function(_0xa56abf,_0x1932b9){var _0x21a23c={'offset':moment()[_0xa8da('0x75')]()};_0x21a23c['now']=moment()[_0xa8da('0x75')](_0x21a23c['offset'])[_0xa8da('0x76')](_0xa8da('0x77'));return _0x1932b9[_0xa8da('0x25')](0xc8)['send'](_0x21a23c);}; \ No newline at end of file +var _0x77f8=['name','index','map','Setting','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','find','getLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','getLicense','default_loginLogo.svg','default','gdpr','securePassword','getPreferred','defaultLoginLogo','default_preferred.png','download','addFavicon','getFavicon','server/files/images/logos','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x4f0c2c,_0x25eb69){var _0x5b5c6e=function(_0x222e77){while(--_0x222e77){_0x4f0c2c['push'](_0x4f0c2c['shift']());}};_0x5b5c6e(++_0x25eb69);}(_0x77f8,0x14d));var _0x877f=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x77f8[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x877f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x877f('0x1'));var moment=require(_0x877f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x877f('0x3'));var util=require(_0x877f('0x4'));var path=require(_0x877f('0x5'));var sox=require(_0x877f('0x6'));var csv=require('to-csv');var ejs=require(_0x877f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x877f('0x8'));var squel=require(_0x877f('0x9'));var crypto=require(_0x877f('0xa'));var jsforce=require(_0x877f('0xb'));var deskjs=require(_0x877f('0xc'));var toCsv=require(_0x877f('0xd'));var querystring=require(_0x877f('0xe'));var Papa=require(_0x877f('0xf'));var Redis=require(_0x877f('0x10'));var authService=require(_0x877f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x877f('0x12'));var hardwareService=require(_0x877f('0x13'));var logger=require('../../config/logger')(_0x877f('0x14'));var utils=require(_0x877f('0x15'));var config=require(_0x877f('0x16'));var licenseUtil=require(_0x877f('0x17'));var db=require(_0x877f('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x877f('0x19')][_0x877f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x774d79,_0x1b4d7c,_0x48fb87,_0xa92c76){return new BPromise(function(_0x2d21e5,_0x11af9b){var _0x4a8e10=_0xa92c76||client;return _0x4a8e10['request'](_0x774d79,_0x48fb87)['then'](function(_0x4d9a2e){logger['info'](_0x877f('0x1b'),_0x1b4d7c,'request\x20sent');logger['debug'](_0x877f('0x1c'),_0x1b4d7c,_0x877f('0x1d'),JSON[_0x877f('0x1e')](_0x4d9a2e));if(_0x4d9a2e[_0x877f('0x1f')]){if(_0x4d9a2e[_0x877f('0x1f')][_0x877f('0x20')]===0x1f4){logger[_0x877f('0x1f')](_0x877f('0x1b'),_0x1b4d7c,_0x4d9a2e['error'][_0x877f('0x21')]);return _0x11af9b(_0x4d9a2e['error'][_0x877f('0x21')]);}logger['error']('Setting,\x20%s,\x20%s',_0x1b4d7c,_0x4d9a2e[_0x877f('0x1f')][_0x877f('0x21')]);return _0x2d21e5(_0x4d9a2e[_0x877f('0x1f')]['message']);}else{logger[_0x877f('0x22')](_0x877f('0x1b'),_0x1b4d7c,_0x877f('0x1d'));_0x2d21e5(_0x4d9a2e[_0x877f('0x23')][_0x877f('0x21')]);}})['catch'](function(_0x143126){logger['error'](_0x877f('0x1b'),_0x1b4d7c,_0x143126);_0x11af9b(_0x143126);});});}function respondWithStatusCode(_0x17b03f,_0x5b1135){_0x5b1135=_0x5b1135||0xcc;return function(_0x39abc4){if(_0x39abc4){return _0x17b03f['sendStatus'](_0x5b1135);}return _0x17b03f[_0x877f('0x24')](_0x5b1135)['end']();};}function respondWithResult(_0x1805b3,_0x33560c){_0x33560c=_0x33560c||0xc8;return function(_0x220b96){if(_0x220b96){return _0x1805b3['status'](_0x33560c)[_0x877f('0x25')](_0x220b96);}};}function respondWithFilteredResult(_0x2936c6,_0x13f702){return function(_0x527a3d){if(_0x527a3d){var _0x4564c0=typeof _0x13f702[_0x877f('0x26')]===_0x877f('0x27')&&typeof _0x13f702[_0x877f('0x28')]===_0x877f('0x27');var _0x2b5cb1=_0x527a3d[_0x877f('0x29')];var _0x34e402=_0x4564c0?0x0:_0x13f702[_0x877f('0x26')];var _0x11e661=_0x4564c0?_0x527a3d[_0x877f('0x29')]:_0x13f702[_0x877f('0x26')]+_0x13f702[_0x877f('0x28')];var _0x1ba1e8;if(_0x11e661>=_0x2b5cb1){_0x11e661=_0x2b5cb1;_0x1ba1e8=0xc8;}else{_0x1ba1e8=0xce;}_0x2936c6['status'](_0x1ba1e8);return _0x2936c6[_0x877f('0x2a')]('Content-Range',_0x34e402+'-'+_0x11e661+'/'+_0x2b5cb1)[_0x877f('0x25')](_0x527a3d);}return null;};}function patchUpdates(_0x2fe02b){return function(_0x5e8b40){try{jsonpatch[_0x877f('0x2b')](_0x5e8b40,_0x2fe02b,!![]);}catch(_0x130dc7){return BPromise[_0x877f('0x2c')](_0x130dc7);}return _0x5e8b40[_0x877f('0x2d')]();};}function saveUpdates(_0x5efdb9,_0x7a63d0){return function(_0x1ad104){if(_0x1ad104){return _0x1ad104[_0x877f('0x2e')](_0x5efdb9)[_0x877f('0x2f')](function(_0x23e0de){return _0x23e0de;});}return null;};}function removeEntity(_0x138863,_0x16e70b){return function(_0x2262cf){if(_0x2262cf){return _0x2262cf[_0x877f('0x30')]()[_0x877f('0x2f')](function(){_0x138863[_0x877f('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3589a0,_0x852f88){return function(_0x5a0502){if(!_0x5a0502){_0x3589a0[_0x877f('0x31')](0x194);}return _0x5a0502;};}function handleError(_0x4e7d8a,_0x527ce8){_0x527ce8=_0x527ce8||0x1f4;return function(_0x233fcc){logger[_0x877f('0x1f')](_0x233fcc[_0x877f('0x32')]);if(_0x233fcc[_0x877f('0x33')]){delete _0x233fcc[_0x877f('0x33')];}_0x4e7d8a[_0x877f('0x24')](_0x527ce8)['send'](_0x233fcc);};}exports[_0x877f('0x34')]=function(_0x2b6a25,_0x46d004){var _0x5b03a7={},_0x44d460={},_0x270196={'count':0x0,'rows':[]};var _0x41d782=_[_0x877f('0x35')](db[_0x877f('0x36')]['rawAttributes'],function(_0x3341dc){return{'name':_0x3341dc[_0x877f('0x37')],'type':_0x3341dc[_0x877f('0x38')][_0x877f('0x39')]};});_0x44d460['model']=_[_0x877f('0x35')](_0x41d782,_0x877f('0x33'));_0x44d460[_0x877f('0x3a')]=_[_0x877f('0x3b')](_0x2b6a25['query']);_0x44d460[_0x877f('0x3c')]=_['intersection'](_0x44d460['model'],_0x44d460['query']);_0x5b03a7[_0x877f('0x3d')]=_[_0x877f('0x3e')](_0x44d460['model'],qs[_0x877f('0x3f')](_0x2b6a25[_0x877f('0x3a')][_0x877f('0x3f')]));_0x5b03a7['attributes']=_0x5b03a7[_0x877f('0x3d')][_0x877f('0x40')]?_0x5b03a7['attributes']:_0x44d460[_0x877f('0x41')];if(!_0x2b6a25[_0x877f('0x3a')][_0x877f('0x42')](_0x877f('0x43'))){_0x5b03a7[_0x877f('0x28')]=qs[_0x877f('0x28')](_0x2b6a25[_0x877f('0x3a')][_0x877f('0x28')]);_0x5b03a7[_0x877f('0x26')]=qs[_0x877f('0x26')](_0x2b6a25[_0x877f('0x3a')][_0x877f('0x26')]);}_0x5b03a7[_0x877f('0x44')]=qs['sort'](_0x2b6a25[_0x877f('0x3a')][_0x877f('0x45')]);_0x5b03a7[_0x877f('0x46')]=qs['filters'](_[_0x877f('0x47')](_0x2b6a25[_0x877f('0x3a')],_0x44d460[_0x877f('0x3c')]),_0x41d782);if(_0x2b6a25[_0x877f('0x3a')]['filter']){_0x5b03a7['where']=_[_0x877f('0x48')](_0x5b03a7[_0x877f('0x46')],{'$or':_[_0x877f('0x35')](_0x41d782,function(_0x2b4d4e){if(_0x2b4d4e[_0x877f('0x38')]!==_0x877f('0x49')){var _0x4679ad={};_0x4679ad[_0x2b4d4e[_0x877f('0x33')]]={'$like':'%'+_0x2b6a25[_0x877f('0x3a')][_0x877f('0x4a')]+'%'};return _0x4679ad;}})});}_0x5b03a7=_[_0x877f('0x48')]({},_0x5b03a7,_0x2b6a25['options']);var _0x47364a={'where':_0x5b03a7[_0x877f('0x46')]};return db[_0x877f('0x36')][_0x877f('0x29')](_0x47364a)[_0x877f('0x2f')](function(_0x159411){_0x270196[_0x877f('0x29')]=_0x159411;if(_0x2b6a25[_0x877f('0x3a')][_0x877f('0x4b')]){_0x5b03a7[_0x877f('0x4c')]=[{'all':!![]}];}return db[_0x877f('0x36')][_0x877f('0x4d')](_0x5b03a7);})[_0x877f('0x2f')](function(_0x516350){_0x270196[_0x877f('0x4e')]=_0x516350;return _0x270196;})[_0x877f('0x2f')](respondWithFilteredResult(_0x46d004,_0x5b03a7))[_0x877f('0x4f')](handleError(_0x46d004,null));};exports[_0x877f('0x50')]=function(_0x2715ca,_0x261ec0){var _0x54157d={'raw':![],'where':{'id':_0x2715ca[_0x877f('0x51')]['id']}},_0x743157={};_0x743157[_0x877f('0x41')]=_['keys'](db[_0x877f('0x36')][_0x877f('0x52')]);_0x743157[_0x877f('0x3a')]=_['keys'](_0x2715ca[_0x877f('0x3a')]);_0x743157[_0x877f('0x3c')]=_['intersection'](_0x743157['model'],_0x743157[_0x877f('0x3a')]);_0x54157d['attributes']=_['intersection'](_0x743157[_0x877f('0x41')],qs[_0x877f('0x3f')](_0x2715ca[_0x877f('0x3a')]['fields']));_0x54157d['attributes']=_0x54157d[_0x877f('0x3d')][_0x877f('0x40')]?_0x54157d[_0x877f('0x3d')]:_0x743157['model'];if(_0x2715ca[_0x877f('0x3a')][_0x877f('0x4b')]){_0x54157d[_0x877f('0x4c')]=[{'all':!![]}];}_0x54157d=_['merge']({},_0x54157d,_0x2715ca[_0x877f('0x53')]);return db[_0x877f('0x36')]['find'](_0x54157d)[_0x877f('0x2f')](handleEntityNotFound(_0x261ec0,null))[_0x877f('0x2f')](respondWithResult(_0x261ec0,null))[_0x877f('0x4f')](handleError(_0x261ec0,null));};exports['update']=function(_0x3f85c6,_0x14a65a){if(_0x3f85c6[_0x877f('0x54')]['id']){delete _0x3f85c6['body']['id'];}return db[_0x877f('0x36')]['find']({'where':{'id':_0x3f85c6[_0x877f('0x51')]['id']}})[_0x877f('0x2f')](handleEntityNotFound(_0x14a65a,null))[_0x877f('0x2f')](saveUpdates(_0x3f85c6[_0x877f('0x54')],null))[_0x877f('0x2f')](respondWithResult(_0x14a65a,null))[_0x877f('0x4f')](handleError(_0x14a65a,null));};exports[_0x877f('0x55')]=function(_0x41c763,_0x930083,_0xfe4169){if(_0x41c763[_0x877f('0x56')]&&_0x41c763[_0x877f('0x56')]['filename']){_0x41c763[_0x877f('0x54')][_0x877f('0x57')]=_0x41c763[_0x877f('0x56')][_0x877f('0x58')];}return db[_0x877f('0x36')]['find']({'where':{'id':_0x41c763['params']['id']}})[_0x877f('0x2f')](handleEntityNotFound(_0x930083,null))[_0x877f('0x2f')](saveUpdates(_0x41c763['body'],null))[_0x877f('0x2f')](respondWithResult(_0x930083,null))[_0x877f('0x4f')](handleError(_0x930083,null));};exports[_0x877f('0x59')]=function(_0x383af0,_0x3f2daf,_0x4355c1){if(_0x383af0['file']&&_0x383af0[_0x877f('0x56')]['filename']){_0x383af0[_0x877f('0x54')][_0x877f('0x5a')]=_0x383af0[_0x877f('0x56')][_0x877f('0x58')];}return db[_0x877f('0x36')][_0x877f('0x5b')]({'where':{'id':_0x383af0['params']['id']}})[_0x877f('0x2f')](handleEntityNotFound(_0x3f2daf,null))[_0x877f('0x2f')](saveUpdates(_0x383af0[_0x877f('0x54')],null))['then'](respondWithResult(_0x3f2daf,null))[_0x877f('0x4f')](handleError(_0x3f2daf,null));};var utilLicense=require(_0x877f('0x17'));exports[_0x877f('0x5c')]=function(_0x317782,_0x37bd57,_0x4a8ed3){var _0x22d432='server/files/images/logos';var _0x1240ff={'custom':![]};return utilLicense['getLicense']()[_0x877f('0x2f')](function(_0x54e371){if(_0x54e371){_0x1240ff=_0x54e371;}return db['Setting']['find']({'where':{'id':_0x317782[_0x877f('0x51')]['id']},'attributes':[_0x877f('0x57'),_0x877f('0x5a'),_0x877f('0x5d'),_0x877f('0x5e'),_0x877f('0x5f'),'defaultLoginLogo',_0x877f('0x60'),_0x877f('0x61')],'raw':!![]});})[_0x877f('0x2f')](handleEntityNotFound(_0x37bd57,null))[_0x877f('0x2f')](function(_0x2986c8){if(_0x2986c8){var _0x54e311=_0x2986c8['logo']&&fs[_0x877f('0x62')](path[_0x877f('0x63')](config[_0x877f('0x64')],_0x22d432,_[_0x877f('0x65')](_0x2986c8[_0x877f('0x57')])))?path[_0x877f('0x63')](config[_0x877f('0x64')],_0x22d432,_[_0x877f('0x65')](_0x2986c8[_0x877f('0x57')])):path['join'](config[_0x877f('0x64')],_0x22d432,_[_0x877f('0x65')](_0x877f('0x66')));var _0x1b0152='default'+_[_0x877f('0x67')]('logo');if(_0x2986c8[_0x1b0152]||!_0x1240ff[_0x877f('0x68')]){_0x54e311=path[_0x877f('0x63')](config[_0x877f('0x64')],_0x22d432,_[_0x877f('0x65')](_0x877f('0x66')));}if(!fs[_0x877f('0x62')](_0x54e311)){throw new db[(_0x877f('0x69'))][(_0x877f('0x6a'))](_[_0x877f('0x67')](_0x877f('0x57'))+_0x877f('0x6b'));}return _0x37bd57['download'](_0x54e311);}})[_0x877f('0x4f')](handleError(_0x37bd57,null));};var utilLicense=require(_0x877f('0x17'));exports[_0x877f('0x6c')]=function(_0x367bae,_0x46c292,_0x2113b7){var _0x439fa0='server/files/images/logos';var _0x266181={'custom':![]};return utilLicense[_0x877f('0x6d')]()[_0x877f('0x2f')](function(_0x5181a7){if(_0x5181a7){_0x266181=_0x5181a7;}return db[_0x877f('0x36')]['find']({'where':{'id':_0x367bae[_0x877f('0x51')]['id']},'attributes':[_0x877f('0x57'),_0x877f('0x5a'),_0x877f('0x5d'),'favicon',_0x877f('0x5f'),'defaultLoginLogo','defaultPreferred',_0x877f('0x61')],'raw':!![]});})[_0x877f('0x2f')](handleEntityNotFound(_0x46c292,null))[_0x877f('0x2f')](function(_0x5339c1){if(_0x5339c1){var _0x66f47a=_0x5339c1[_0x877f('0x5a')]&&fs[_0x877f('0x62')](path[_0x877f('0x63')](config[_0x877f('0x64')],_0x439fa0,_[_0x877f('0x65')](_0x5339c1[_0x877f('0x5a')])))?path['join'](config[_0x877f('0x64')],_0x439fa0,_[_0x877f('0x65')](_0x5339c1[_0x877f('0x5a')])):path[_0x877f('0x63')](config['root'],_0x439fa0,_[_0x877f('0x65')](_0x877f('0x6e')));var _0x1ba455=_0x877f('0x6f')+_[_0x877f('0x67')](_0x877f('0x5a'));if(_0x5339c1[_0x1ba455]||!_0x266181[_0x877f('0x68')]){_0x66f47a=path[_0x877f('0x63')](config[_0x877f('0x64')],_0x439fa0,_[_0x877f('0x65')](_0x877f('0x6e')));}if(!fs['existsSync'](_0x66f47a)){throw new db[(_0x877f('0x69'))][(_0x877f('0x6a'))](_[_0x877f('0x67')](_0x877f('0x5a'))+_0x877f('0x6b'));}return _0x46c292['download'](_0x66f47a);}})[_0x877f('0x4f')](handleError(_0x46c292,null));};exports[_0x877f('0x70')]=function(_0x18e46c,_0x4ebbbc){return db[_0x877f('0x36')][_0x877f('0x5b')]({'where':{'id':_0x18e46c[_0x877f('0x51')]['id']},'attributes':[_0x877f('0x71')]})['then'](respondWithResult(_0x4ebbbc,null))[_0x877f('0x4f')](handleError(_0x4ebbbc,null));};exports['addPreferred']=function(_0xda6062,_0x590df6,_0x489efc){if(_0xda6062[_0x877f('0x56')]&&_0xda6062[_0x877f('0x56')][_0x877f('0x58')]){_0xda6062[_0x877f('0x54')]['preferred']=_0xda6062['file']['filename'];}return db[_0x877f('0x36')][_0x877f('0x5b')]({'where':{'id':_0xda6062['params']['id']}})[_0x877f('0x2f')](handleEntityNotFound(_0x590df6,null))['then'](saveUpdates(_0xda6062['body'],null))[_0x877f('0x2f')](respondWithResult(_0x590df6,null))[_0x877f('0x4f')](handleError(_0x590df6,null));};var utilLicense=require(_0x877f('0x17'));exports[_0x877f('0x72')]=function(_0x77e96d,_0x55be26,_0x2526a9){var _0x380f96='server/files/images/logos';var _0x19d44e={'custom':![]};return utilLicense[_0x877f('0x6d')]()[_0x877f('0x2f')](function(_0x4ce838){if(_0x4ce838){_0x19d44e=_0x4ce838;}return db['Setting'][_0x877f('0x5b')]({'where':{'id':_0x77e96d[_0x877f('0x51')]['id']},'attributes':[_0x877f('0x57'),_0x877f('0x5a'),'preferred',_0x877f('0x5e'),_0x877f('0x5f'),_0x877f('0x73'),_0x877f('0x60'),_0x877f('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x55be26,null))[_0x877f('0x2f')](function(_0x28fd10){if(_0x28fd10){var _0x379c5f=_0x28fd10['preferred']&&fs['existsSync'](path['join'](config[_0x877f('0x64')],_0x380f96,_[_0x877f('0x65')](_0x28fd10[_0x877f('0x5d')])))?path[_0x877f('0x63')](config[_0x877f('0x64')],_0x380f96,_[_0x877f('0x65')](_0x28fd10[_0x877f('0x5d')])):path['join'](config[_0x877f('0x64')],_0x380f96,_[_0x877f('0x65')](_0x877f('0x74')));var _0x17f172=_0x877f('0x6f')+_['upperFirst'](_0x877f('0x5d'));if(_0x28fd10[_0x17f172]||!_0x19d44e['custom']||!_0x19d44e[_0x877f('0x5d')]){_0x379c5f=path[_0x877f('0x63')](config['root'],_0x380f96,_[_0x877f('0x65')](_0x877f('0x74')));}if(!fs[_0x877f('0x62')](_0x379c5f)){throw new db['Sequelize'][(_0x877f('0x6a'))](_[_0x877f('0x67')](_0x877f('0x5d'))+_0x877f('0x6b'));}return _0x55be26[_0x877f('0x75')](_0x379c5f);}})[_0x877f('0x4f')](handleError(_0x55be26,null));};exports[_0x877f('0x76')]=function(_0x3004c8,_0x502f43,_0x29b440){if(_0x3004c8[_0x877f('0x56')]&&_0x3004c8[_0x877f('0x56')][_0x877f('0x58')]){_0x3004c8[_0x877f('0x54')][_0x877f('0x5e')]=_0x3004c8[_0x877f('0x56')][_0x877f('0x58')];}return db[_0x877f('0x36')][_0x877f('0x5b')]({'where':{'id':_0x3004c8[_0x877f('0x51')]['id']}})['then'](handleEntityNotFound(_0x502f43,null))[_0x877f('0x2f')](saveUpdates(_0x3004c8[_0x877f('0x54')],null))[_0x877f('0x2f')](respondWithResult(_0x502f43,null))['catch'](handleError(_0x502f43,null));};var utilLicense=require(_0x877f('0x17'));exports[_0x877f('0x77')]=function(_0x993f01,_0x167bca,_0x3801ac){var _0x26f4e0=_0x877f('0x78');var _0x561a59={'custom':![]};return utilLicense['getLicense']()[_0x877f('0x2f')](function(_0x125b22){if(_0x125b22){_0x561a59=_0x125b22;}return db['Setting'][_0x877f('0x5b')]({'where':{'id':_0x993f01[_0x877f('0x51')]['id']},'attributes':['logo',_0x877f('0x5a'),'preferred',_0x877f('0x5e'),_0x877f('0x5f'),_0x877f('0x73'),_0x877f('0x60'),_0x877f('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x167bca,null))[_0x877f('0x2f')](function(_0x140d8e){if(_0x140d8e){var _0x2210b1=_0x140d8e[_0x877f('0x5e')]&&fs[_0x877f('0x62')](path[_0x877f('0x63')](config['root'],_0x26f4e0,_[_0x877f('0x65')](_0x140d8e[_0x877f('0x5e')])))?path[_0x877f('0x63')](config[_0x877f('0x64')],_0x26f4e0,_[_0x877f('0x65')](_0x140d8e[_0x877f('0x5e')])):path[_0x877f('0x63')](config[_0x877f('0x64')],_0x26f4e0,_[_0x877f('0x65')](_0x877f('0x79')));var _0x1793d4='default'+_[_0x877f('0x67')](_0x877f('0x5e'));if(_0x140d8e[_0x1793d4]||!_0x561a59['custom']){_0x2210b1=path[_0x877f('0x63')](config[_0x877f('0x64')],_0x26f4e0,_[_0x877f('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0x2210b1)){throw new db[(_0x877f('0x69'))]['ValidationError'](_['upperFirst'](_0x877f('0x5e'))+_0x877f('0x6b'));}return _0x167bca[_0x877f('0x75')](_0x2210b1);}})[_0x877f('0x4f')](handleError(_0x167bca,null));};exports[_0x877f('0x7a')]=function(_0x3ced94,_0x447037){var _0x30be7e={'offset':moment()[_0x877f('0x7b')]()};_0x30be7e[_0x877f('0x7c')]=moment()[_0x877f('0x7b')](_0x30be7e[_0x877f('0x26')])[_0x877f('0x7d')](_0x877f('0x7e'));return _0x447037['status'](0xc8)[_0x877f('0x7f')](_0x30be7e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 2453ff3..f1330a1 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x7a2be3,_0x225052){var _0x1400b0=function(_0x35ee71){while(--_0x35ee71){_0x7a2be3['push'](_0x7a2be3['shift']());}};_0x1400b0(++_0x225052);}(_0xedd9,0xfc));var _0x9edd=function(_0x43fca9,_0x2c384b){_0x43fca9=_0x43fca9-0x0;var _0x3ba1ba=_0xedd9[_0x43fca9];return _0x3ba1ba;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0x008c,0x188));var _0xc008=function(_0x49aab7,_0x1d6397){_0x49aab7=_0x49aab7-0x0;var _0x587b6f=_0x008c[_0x49aab7];return _0x587b6f;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index a82052e..dabddbb 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 _0x489b=['Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSetting'];(function(_0xa38778,_0x109a31){var _0x452f64=function(_0x1cb914){while(--_0x1cb914){_0xa38778['push'](_0xa38778['shift']());}};_0x452f64(++_0x109a31);}(_0x489b,0xb7));var _0xb489=function(_0x10608d,_0x2a85aa){_0x10608d=_0x10608d-0x0;var _0xba3d23=_0x489b[_0x10608d];return _0xba3d23;};'use strict';var _=require(_0xb489('0x0'));var util=require(_0xb489('0x1'));var moment=require(_0xb489('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb489('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb489('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb489('0x5'));var client=jayson[_0xb489('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414d06,_0x8b3871,_0x5d83f9){return new BPromise(function(_0x3e1aa3,_0xc2a57f){return client['request'](_0x414d06,_0x5d83f9)[_0xb489('0x7')](function(_0xd3108d){logger[_0xb489('0x8')](_0xb489('0x9'),_0x8b3871,'request\x20sent');logger[_0xb489('0xa')](_0xb489('0xb'),_0x8b3871,'request\x20sent',JSON[_0xb489('0xc')](_0xd3108d));if(_0xd3108d[_0xb489('0xd')]){if(_0xd3108d[_0xb489('0xd')][_0xb489('0xe')]===0x1f4){logger[_0xb489('0xd')]('Setting,\x20%s,\x20%s',_0x8b3871,_0xd3108d['error']['message']);return _0xc2a57f(_0xd3108d['error'][_0xb489('0xf')]);}logger[_0xb489('0xd')](_0xb489('0x9'),_0x8b3871,_0xd3108d[_0xb489('0xd')][_0xb489('0xf')]);return _0x3e1aa3(_0xd3108d[_0xb489('0xd')]['message']);}else{logger[_0xb489('0x8')](_0xb489('0x9'),_0x8b3871,_0xb489('0x10'));_0x3e1aa3(_0xd3108d[_0xb489('0x11')]['message']);}})[_0xb489('0x12')](function(_0x250beb){logger[_0xb489('0xd')](_0xb489('0x9'),_0x8b3871,_0x250beb);_0xc2a57f(_0x250beb);});});}exports[_0xb489('0x13')]=function(_0x5ac908){var _0x3d650a=this;return new Promise(function(_0x212dd9,_0x27291b){return db[_0xb489('0x14')][_0xb489('0x15')]({'raw':_0x5ac908[_0xb489('0x16')]?_0x5ac908[_0xb489('0x16')][_0xb489('0x17')]===undefined?!![]:![]:!![],'where':_0x5ac908[_0xb489('0x16')]?_0x5ac908[_0xb489('0x16')][_0xb489('0x18')]||null:null,'attributes':_0x5ac908['options']?_0x5ac908[_0xb489('0x16')][_0xb489('0x19')]||null:null,'include':_0x5ac908[_0xb489('0x16')]?_0x5ac908['options'][_0xb489('0x1a')]?_[_0xb489('0x1b')](_0x5ac908[_0xb489('0x16')][_0xb489('0x1a')],function(_0x4fac3d){return{'model':db[_0x4fac3d['model']],'as':_0x4fac3d['as'],'attributes':_0x4fac3d['attributes'],'include':_0x4fac3d['include']?_['map'](_0x4fac3d[_0xb489('0x1a')],function(_0x39af77){return{'model':db[_0x39af77['model']],'as':_0x39af77['as'],'attributes':_0x39af77['attributes'],'include':_0x39af77[_0xb489('0x1a')]?_[_0xb489('0x1b')](_0x39af77[_0xb489('0x1a')],function(_0x5c3262){return{'model':db[_0x5c3262[_0xb489('0x1c')]],'as':_0x5c3262['as'],'attributes':_0x5c3262[_0xb489('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb489('0x7')](function(_0x461cc4){logger[_0xb489('0x8')](_0xb489('0x13'),_0x5ac908);logger[_0xb489('0xa')]('ShowSetting',_0x5ac908,JSON[_0xb489('0xc')](_0x461cc4));_0x212dd9(_0x461cc4);})[_0xb489('0x12')](function(_0x5450b7){logger['error']('ShowSetting',_0x5450b7[_0xb489('0xf')],_0x5ac908);_0x27291b(_0x3d650a[_0xb489('0xd')](0x1f4,_0x5450b7[_0xb489('0xf')]));});});}; \ No newline at end of file +var _0x679b=['../../config/logger','../../config/environment','jayson/promise','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4589fd,_0x2153fe){var _0x184689=function(_0x89b5f5){while(--_0x89b5f5){_0x4589fd['push'](_0x4589fd['shift']());}};_0x184689(++_0x2153fe);}(_0x679b,0x1bb));var _0xb679=function(_0x50228,_0x3fa3d1){_0x50228=_0x50228-0x0;var _0x51fcb7=_0x679b[_0x50228];return _0x51fcb7;};'use strict';var _=require('lodash');var util=require(_0xb679('0x0'));var moment=require('moment');var BPromise=require(_0xb679('0x1'));var rs=require(_0xb679('0x2'));var fs=require('fs');var Redis=require(_0xb679('0x3'));var db=require(_0xb679('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb679('0x5'))('rpc');var config=require(_0xb679('0x6'));var jayson=require(_0xb679('0x7'));var client=jayson['client'][_0xb679('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ef85e,_0x11f6e2,_0x62d80){return new BPromise(function(_0xbda002,_0x5eeeb8){return client['request'](_0x5ef85e,_0x62d80)['then'](function(_0x2dbc8c){logger[_0xb679('0x9')](_0xb679('0xa'),_0x11f6e2,_0xb679('0xb'));logger[_0xb679('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x11f6e2,'request\x20sent',JSON[_0xb679('0xd')](_0x2dbc8c));if(_0x2dbc8c[_0xb679('0xe')]){if(_0x2dbc8c[_0xb679('0xe')][_0xb679('0xf')]===0x1f4){logger[_0xb679('0xe')](_0xb679('0xa'),_0x11f6e2,_0x2dbc8c[_0xb679('0xe')][_0xb679('0x10')]);return _0x5eeeb8(_0x2dbc8c['error'][_0xb679('0x10')]);}logger[_0xb679('0xe')]('Setting,\x20%s,\x20%s',_0x11f6e2,_0x2dbc8c[_0xb679('0xe')]['message']);return _0xbda002(_0x2dbc8c[_0xb679('0xe')]['message']);}else{logger[_0xb679('0x9')](_0xb679('0xa'),_0x11f6e2,_0xb679('0xb'));_0xbda002(_0x2dbc8c['result'][_0xb679('0x10')]);}})[_0xb679('0x11')](function(_0x52d390){logger[_0xb679('0xe')](_0xb679('0xa'),_0x11f6e2,_0x52d390);_0x5eeeb8(_0x52d390);});});}exports[_0xb679('0x12')]=function(_0x14b680){var _0x3a702f=this;return new Promise(function(_0x3d4c3e,_0x344438){return db[_0xb679('0x13')][_0xb679('0x14')]({'raw':_0x14b680[_0xb679('0x15')]?_0x14b680[_0xb679('0x15')][_0xb679('0x16')]===undefined?!![]:![]:!![],'where':_0x14b680['options']?_0x14b680[_0xb679('0x15')][_0xb679('0x17')]||null:null,'attributes':_0x14b680[_0xb679('0x15')]?_0x14b680[_0xb679('0x15')][_0xb679('0x18')]||null:null,'include':_0x14b680[_0xb679('0x15')]?_0x14b680[_0xb679('0x15')][_0xb679('0x19')]?_[_0xb679('0x1a')](_0x14b680[_0xb679('0x15')]['include'],function(_0x2cbe3d){return{'model':db[_0x2cbe3d['model']],'as':_0x2cbe3d['as'],'attributes':_0x2cbe3d[_0xb679('0x18')],'include':_0x2cbe3d['include']?_[_0xb679('0x1a')](_0x2cbe3d[_0xb679('0x19')],function(_0x1a28e6){return{'model':db[_0x1a28e6[_0xb679('0x1b')]],'as':_0x1a28e6['as'],'attributes':_0x1a28e6[_0xb679('0x18')],'include':_0x1a28e6[_0xb679('0x19')]?_[_0xb679('0x1a')](_0x1a28e6['include'],function(_0xe7b606){return{'model':db[_0xe7b606['model']],'as':_0xe7b606['as'],'attributes':_0xe7b606[_0xb679('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8d9381){logger[_0xb679('0x9')](_0xb679('0x12'),_0x14b680);logger[_0xb679('0xc')](_0xb679('0x12'),_0x14b680,JSON[_0xb679('0xd')](_0x8d9381));_0x3d4c3e(_0x8d9381);})[_0xb679('0x11')](function(_0x20f74b){logger[_0xb679('0xe')](_0xb679('0x12'),_0x20f74b[_0xb679('0x10')],_0x14b680);_0x344438(_0x3a702f[_0xb679('0xe')](0x1f4,_0x20f74b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4271bd0..4432835 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x598e9c,_0x184844){var _0x5201a1=function(_0x4cf09c){while(--_0x4cf09c){_0x598e9c['push'](_0x598e9c['shift']());}};_0x5201a1(++_0x184844);}(_0x8ef6,0xf2));var _0x68ef=function(_0x493c86,_0x2496ea){_0x493c86=_0x493c86-0x0;var _0x2a9df8=_0x8ef6[_0x493c86];return _0x2a9df8;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x2d5def,_0xd83b8a){var _0x364af8=function(_0x1013e5){while(--_0x1013e5){_0x2d5def['push'](_0x2d5def['shift']());}};_0x364af8(++_0xd83b8a);}(_0x8ef6,0xf2));var _0x68ef=function(_0x43a185,_0x16152c){_0x43a185=_0x43a185-0x0;var _0x588bb7=_0x8ef6[_0x43a185];return _0x588bb7;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index e572c3a..8b30c69 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 _0x67f2=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','skebby','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x163639,_0x43541e){var _0x26cd25=function(_0x5e46f1){while(--_0x5e46f1){_0x163639['push'](_0x163639['shift']());}};_0x26cd25(++_0x43541e);}(_0x67f2,0x6c));var _0x267f=function(_0x1b1ae5,_0x5b75a6){_0x1b1ae5=_0x1b1ae5-0x0;var _0x413fc5=_0x67f2[_0x1b1ae5];return _0x413fc5;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x267f('0x0')],'unique':_0x267f('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x267f('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x267f('0x0')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x267f('0x0')]},'type':{'type':Sequelize[_0x267f('0x2')]('twilio',_0x267f('0x3'),'connectel','clicksend','plivo',_0x267f('0x4'),_0x267f('0x5'),_0x267f('0x6'),'infobip',_0x267f('0x7'))},'accountSid':{'type':Sequelize[_0x267f('0x0')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x267f('0x0')]},'smsMethod':{'type':Sequelize[_0x267f('0x2')]('SI','TI','GP')},'username':{'type':Sequelize[_0x267f('0x0')]},'password':{'type':Sequelize[_0x267f('0x0')]},'apiKey':{'type':Sequelize[_0x267f('0x0')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x267f('0x0')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![]},'description':{'type':Sequelize[_0x267f('0x0')]},'notificationTemplate':{'type':Sequelize[_0x267f('0x9')],'defaultValue':function(){return _0x267f('0xa');}},'notificationSound':{'type':Sequelize[_0x267f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x267f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x267f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x267f('0x0')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x267f('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x267f('0x8')],'defaultValue':![],'comment':_0x267f('0xd'),'set':function(_0x23c3ea){if(!_0x23c3ea)this[_0x267f('0xe')](_0x267f('0xf'),null);this[_0x267f('0xe')](_0x267f('0x10'),_0x23c3ea);}}}; \ No newline at end of file +var _0x846f=['ENUM','twilio','skebby','plivo','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','generate'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x846f,0xdd));var _0xf846=function(_0x333a29,_0x283fb7){_0x333a29=_0x333a29-0x0;var _0x28fac9=_0x846f[_0x333a29];return _0x28fac9;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xf846('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xf846('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf846('0x2')]();}},'phone':{'type':Sequelize[_0xf846('0x1')]},'type':{'type':Sequelize[_0xf846('0x3')](_0xf846('0x4'),_0xf846('0x5'),'connectel','clicksend',_0xf846('0x6'),'clickatell','bandwidth','csc','infobip',_0xf846('0x7'))},'accountSid':{'type':Sequelize[_0xf846('0x1')]},'authId':{'type':Sequelize[_0xf846('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xf846('0x1')]},'password':{'type':Sequelize[_0xf846('0x1')]},'apiKey':{'type':Sequelize[_0xf846('0x1')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xf846('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf846('0x1')]},'notificationTemplate':{'type':Sequelize[_0xf846('0x8')],'defaultValue':function(){return _0xf846('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf846('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf846('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf846('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf846('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf846('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf846('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf846('0xa')],'defaultValue':![],'comment':_0xf846('0xc'),'set':function(_0x4df69a){if(!_0x4df69a)this[_0xf846('0xd')](_0xf846('0xe'),null);this['setDataValue'](_0xf846('0xf'),_0x4df69a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index a6282e0..f0c52b2 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 _0xbd93=['offset','set','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','status','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','params','mandatoryDispositionPause','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','SmsAccountId','findOne','merge','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','replyMessageId','bandwidth','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','CmContact','contact','SmsInteraction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','AttachmentId','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','info','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','user','out','spread','dataValues','Messages','inspect','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','undefined','limit','count'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xbd93,0xb4));var _0x3bd9=function(_0x38055c,_0x37af4e){_0x38055c=_0x38055c-0x0;var _0x22696f=_0xbd93[_0x38055c];return _0x22696f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bd9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bd9('0x1'));var rp=require(_0x3bd9('0x2'));var moment=require(_0x3bd9('0x3'));var BPromise=require(_0x3bd9('0x4'));var Mustache=require('mustache');var util=require(_0x3bd9('0x5'));var path=require(_0x3bd9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bd9('0x7'));var fs=require('fs');var fs_extra=require(_0x3bd9('0x8'));var _=require(_0x3bd9('0x9'));var squel=require(_0x3bd9('0xa'));var crypto=require(_0x3bd9('0xb'));var jsforce=require(_0x3bd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bd9('0xd'));var querystring=require('querystring');var Papa=require(_0x3bd9('0xe'));var Redis=require('ioredis');var authService=require(_0x3bd9('0xf'));var qs=require(_0x3bd9('0x10'));var as=require(_0x3bd9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bd9('0x12'))(_0x3bd9('0x13'));var utils=require(_0x3bd9('0x14'));var config=require(_0x3bd9('0x15'));var licenseUtil=require(_0x3bd9('0x16'));var db=require(_0x3bd9('0x17'))['db'];config[_0x3bd9('0x18')]=_[_0x3bd9('0x19')](config[_0x3bd9('0x18')],{'host':_0x3bd9('0x1a'),'port':0x18eb});var socket=require(_0x3bd9('0x1b'))(new Redis(config[_0x3bd9('0x18')]));require(_0x3bd9('0x1c'))[_0x3bd9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3bd9('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4f2172,_0x2b5f95,_0x194349,_0xd2221d){return new BPromise(function(_0x483c05,_0x28de6d){var _0x7ec581=_0xd2221d||client;return _0x7ec581[_0x3bd9('0x1f')](_0x4f2172,_0x194349)[_0x3bd9('0x20')](function(_0x378ed9){logger['info'](_0x3bd9('0x21'),_0x2b5f95,_0x3bd9('0x22'));logger[_0x3bd9('0x23')](_0x3bd9('0x24'),_0x2b5f95,_0x3bd9('0x22'),JSON[_0x3bd9('0x25')](_0x378ed9));if(_0x378ed9['error']){if(_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x27')]===0x1f4){logger[_0x3bd9('0x26')]('SmsAccount,\x20%s,\x20%s',_0x2b5f95,_0x378ed9[_0x3bd9('0x26')]['message']);return _0x28de6d(_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x28')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x2b5f95,_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x28')]);return _0x483c05(_0x378ed9[_0x3bd9('0x26')][_0x3bd9('0x28')]);}else{logger['info'](_0x3bd9('0x21'),_0x2b5f95,_0x3bd9('0x22'));_0x483c05(_0x378ed9[_0x3bd9('0x29')][_0x3bd9('0x28')]);}})[_0x3bd9('0x2a')](function(_0x18a7f1){logger[_0x3bd9('0x26')](_0x3bd9('0x21'),_0x2b5f95,_0x18a7f1);_0x28de6d(_0x18a7f1);});});}function respondWithStatusCode(_0x59ba1a,_0x18de49){_0x18de49=_0x18de49||0xcc;return function(_0x2dcf66){if(_0x2dcf66){return _0x59ba1a[_0x3bd9('0x2b')](_0x18de49);}return _0x59ba1a['status'](_0x18de49)[_0x3bd9('0x2c')]();};}function respondWithResult(_0x5176df,_0x5d6c67){_0x5d6c67=_0x5d6c67||0xc8;return function(_0x2516b){if(_0x2516b){return _0x5176df['status'](_0x5d6c67)[_0x3bd9('0x2d')](_0x2516b);}};}function respondWithFilteredResult(_0x34b333,_0xd21fa8){return function(_0x3deec8){if(_0x3deec8){var _0x37efa5=typeof _0xd21fa8['offset']===_0x3bd9('0x2e')&&typeof _0xd21fa8[_0x3bd9('0x2f')]===_0x3bd9('0x2e');var _0x4a2d4c=_0x3deec8[_0x3bd9('0x30')];var _0x40b29f=_0x37efa5?0x0:_0xd21fa8[_0x3bd9('0x31')];var _0x29c798=_0x37efa5?_0x3deec8['count']:_0xd21fa8['offset']+_0xd21fa8[_0x3bd9('0x2f')];var _0x24595e;if(_0x29c798>=_0x4a2d4c){_0x29c798=_0x4a2d4c;_0x24595e=0xc8;}else{_0x24595e=0xce;}_0x34b333['status'](_0x24595e);return _0x34b333[_0x3bd9('0x32')](_0x3bd9('0x33'),_0x40b29f+'-'+_0x29c798+'/'+_0x4a2d4c)[_0x3bd9('0x2d')](_0x3deec8);}return null;};}function patchUpdates(_0x15e4c5){return function(_0x4a14aa){try{jsonpatch[_0x3bd9('0x34')](_0x4a14aa,_0x15e4c5,!![]);}catch(_0x21d373){return BPromise[_0x3bd9('0x35')](_0x21d373);}return _0x4a14aa[_0x3bd9('0x36')]();};}function saveUpdates(_0x5eeded,_0x243ea1){return function(_0x502e15){if(_0x502e15){return _0x502e15[_0x3bd9('0x37')](_0x5eeded)['then'](function(_0x2f1961){return _0x2f1961;});}return null;};}function removeEntity(_0x3fda89,_0x363326){return function(_0x5c51ea){if(_0x5c51ea){return _0x5c51ea['destroy']()[_0x3bd9('0x20')](function(){var _0x1e48a1=_0x5c51ea[_0x3bd9('0x38')]({'plain':!![]});var _0xc29eae=_0x3bd9('0x39');return db[_0x3bd9('0x3a')][_0x3bd9('0x3b')]({'where':{'type':_0xc29eae,'resourceId':_0x1e48a1['id']}})[_0x3bd9('0x20')](function(){return _0x5c51ea;});})['then'](function(){_0x3fda89[_0x3bd9('0x3c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c757a,_0x3aadba){return function(_0x5aa2e7){if(!_0x5aa2e7){_0x3c757a[_0x3bd9('0x2b')](0x194);}return _0x5aa2e7;};}function handleError(_0x5ee63a,_0x5eaff5){_0x5eaff5=_0x5eaff5||0x1f4;return function(_0x114ed1){logger['error'](_0x114ed1[_0x3bd9('0x3d')]);if(_0x114ed1[_0x3bd9('0x3e')]){delete _0x114ed1[_0x3bd9('0x3e')];}_0x5ee63a[_0x3bd9('0x3c')](_0x5eaff5)[_0x3bd9('0x3f')](_0x114ed1);};}exports[_0x3bd9('0x40')]=function(_0xcba711,_0x551af9){var _0x1dde7d={'include':[{'model':db[_0x3bd9('0x41')],'as':'mandatoryDispositionPause'}]},_0x23dd2e={},_0x565dc1={'count':0x0,'rows':[]};var _0x2e99de=_[_0x3bd9('0x42')](db[_0x3bd9('0x43')][_0x3bd9('0x44')],function(_0x55e73e){return{'name':_0x55e73e[_0x3bd9('0x45')],'type':_0x55e73e[_0x3bd9('0x46')]['key']};});_0x23dd2e[_0x3bd9('0x47')]=_[_0x3bd9('0x42')](_0x2e99de,_0x3bd9('0x3e'));_0x23dd2e['query']=_[_0x3bd9('0x48')](_0xcba711[_0x3bd9('0x49')]);_0x23dd2e[_0x3bd9('0x4a')]=_['intersection'](_0x23dd2e[_0x3bd9('0x47')],_0x23dd2e[_0x3bd9('0x49')]);_0x1dde7d[_0x3bd9('0x4b')]=_[_0x3bd9('0x4c')](_0x23dd2e[_0x3bd9('0x47')],qs['fields'](_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x4d')]));_0x1dde7d[_0x3bd9('0x4b')]=_0x1dde7d[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x1dde7d[_0x3bd9('0x4b')]:_0x23dd2e['model'];if(!_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x4f')](_0x3bd9('0x50'))){_0x1dde7d[_0x3bd9('0x2f')]=qs['limit'](_0xcba711[_0x3bd9('0x49')]['limit']);_0x1dde7d['offset']=qs[_0x3bd9('0x31')](_0xcba711[_0x3bd9('0x49')]['offset']);}_0x1dde7d[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0xcba711[_0x3bd9('0x49')]['sort']);_0x1dde7d['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0xcba711[_0x3bd9('0x49')],_0x23dd2e['filters']),_0x2e99de);if(_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x54')]){_0x1dde7d[_0x3bd9('0x55')]=_['merge'](_0x1dde7d[_0x3bd9('0x55')],{'$or':_['map'](_0x2e99de,function(_0x28378d){if(_0x28378d[_0x3bd9('0x46')]!==_0x3bd9('0x56')){var _0x5c684b={};_0x5c684b[_0x28378d[_0x3bd9('0x3e')]]={'$like':'%'+_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x5c684b;}})});}_0x1dde7d=_['merge']({},_0x1dde7d,_0xcba711['options']);var _0x48c50b={'where':_0x1dde7d[_0x3bd9('0x55')]};return db[_0x3bd9('0x43')][_0x3bd9('0x30')](_0x48c50b)[_0x3bd9('0x20')](function(_0x1630bd){_0x565dc1[_0x3bd9('0x30')]=_0x1630bd;if(_0xcba711[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x1dde7d[_0x3bd9('0x58')]=[{'all':!![]}];}return db[_0x3bd9('0x43')][_0x3bd9('0x59')](_0x1dde7d);})['then'](function(_0x1915ac){_0x565dc1[_0x3bd9('0x5a')]=_0x1915ac;return _0x565dc1;})[_0x3bd9('0x20')](respondWithFilteredResult(_0x551af9,_0x1dde7d))[_0x3bd9('0x2a')](handleError(_0x551af9,null));};exports['show']=function(_0x4b7fe0,_0x411a70){var _0x5bc5d5={'raw':![],'where':{'id':_0x4b7fe0[_0x3bd9('0x5b')]['id']},'include':[{'model':db[_0x3bd9('0x41')],'as':_0x3bd9('0x5c')}]},_0x490a2f={};_0x490a2f['model']=_[_0x3bd9('0x48')](db[_0x3bd9('0x43')][_0x3bd9('0x44')]);_0x490a2f[_0x3bd9('0x49')]=_['keys'](_0x4b7fe0[_0x3bd9('0x49')]);_0x490a2f[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x490a2f[_0x3bd9('0x47')],_0x490a2f['query']);_0x5bc5d5[_0x3bd9('0x4b')]=_['intersection'](_0x490a2f[_0x3bd9('0x47')],qs['fields'](_0x4b7fe0['query'][_0x3bd9('0x4d')]));_0x5bc5d5[_0x3bd9('0x4b')]=_0x5bc5d5[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x5bc5d5['attributes']:_0x490a2f[_0x3bd9('0x47')];if(_0x4b7fe0[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x5bc5d5[_0x3bd9('0x58')]=[{'all':!![]}];}_0x5bc5d5=_['merge']({},_0x5bc5d5,_0x4b7fe0[_0x3bd9('0x5d')]);return db[_0x3bd9('0x43')]['find'](_0x5bc5d5)[_0x3bd9('0x20')](handleEntityNotFound(_0x411a70,null))[_0x3bd9('0x20')](respondWithResult(_0x411a70,null))[_0x3bd9('0x2a')](handleError(_0x411a70,null));};exports[_0x3bd9('0x5e')]=function(_0x40a0dd,_0x51ecfa){return db[_0x3bd9('0x43')]['create'](_0x40a0dd[_0x3bd9('0x5f')],{})[_0x3bd9('0x20')](function(_0x220ca0){var _0x479bb9=_0x40a0dd['user']['get']({'plain':!![]});if(!_0x479bb9)throw new Error(_0x3bd9('0x60'));if(_0x479bb9[_0x3bd9('0x61')]==='user'){var _0x3b651b=_0x220ca0[_0x3bd9('0x38')]({'plain':!![]});var _0xde5e33=_0x3bd9('0x39');return db[_0x3bd9('0x62')]['find']({'where':{'name':_0xde5e33,'userProfileId':_0x479bb9[_0x3bd9('0x63')]},'raw':!![]})[_0x3bd9('0x20')](function(_0x2b7915){if(_0x2b7915&&_0x2b7915[_0x3bd9('0x64')]===0x0){return db[_0x3bd9('0x3a')][_0x3bd9('0x5e')]({'name':_0x3b651b['name'],'resourceId':_0x3b651b['id'],'type':_0x2b7915['name'],'sectionId':_0x2b7915['id']},{})[_0x3bd9('0x20')](function(){return _0x220ca0;});}else{return _0x220ca0;}})[_0x3bd9('0x2a')](function(_0x2accf9){logger['error'](_0x3bd9('0x65'),_0x2accf9);throw _0x2accf9;});}return _0x220ca0;})[_0x3bd9('0x20')](respondWithResult(_0x51ecfa,0xc9))[_0x3bd9('0x2a')](handleError(_0x51ecfa,null));};exports[_0x3bd9('0x37')]=function(_0x141a9d,_0x383755){if(_0x141a9d[_0x3bd9('0x5f')]['id']){delete _0x141a9d[_0x3bd9('0x5f')]['id'];}return db['SmsAccount'][_0x3bd9('0x66')]({'where':{'id':_0x141a9d[_0x3bd9('0x5b')]['id']},'include':[{'model':db[_0x3bd9('0x41')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x383755,null))[_0x3bd9('0x20')](saveUpdates(_0x141a9d[_0x3bd9('0x5f')],null))[_0x3bd9('0x20')](respondWithResult(_0x383755,null))[_0x3bd9('0x2a')](handleError(_0x383755,null));};exports[_0x3bd9('0x3b')]=function(_0x4a87bf,_0x5cf50a){return db[_0x3bd9('0x43')]['find']({'where':{'id':_0x4a87bf['params']['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x5cf50a,null))[_0x3bd9('0x20')](removeEntity(_0x5cf50a,null))[_0x3bd9('0x2a')](handleError(_0x5cf50a,null));};exports[_0x3bd9('0x67')]=function(_0x2c65df,_0x560f35){return db[_0x3bd9('0x43')]['describe']()[_0x3bd9('0x20')](respondWithResult(_0x560f35,null))[_0x3bd9('0x2a')](handleError(_0x560f35,null));};exports[_0x3bd9('0x68')]=function(_0x512711,_0x492b78,_0x401bf2){if(_0x512711[_0x3bd9('0x5f')]['id']){delete _0x512711[_0x3bd9('0x5f')]['id'];}return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x512711[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x492b78,null))[_0x3bd9('0x20')](function(_0x496102){if(_0x496102){_0x512711[_0x3bd9('0x5f')][_0x3bd9('0x69')]=_0x496102['id'];return db['Disposition'][_0x3bd9('0x5e')](_0x512711['body']);}})['then'](respondWithResult(_0x492b78,null))[_0x3bd9('0x2a')](handleError(_0x492b78,null));};exports['getDispositions']=function(_0x4929c8,_0x2573cf,_0x1fe82e){var _0x9d73dc={'raw':![],'where':{}};var _0xaa14b9={};var _0x20b5c9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3bd9('0x6a')]({'where':{'id':_0x4929c8[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x2573cf,null))[_0x3bd9('0x20')](function(_0x289568){if(_0x289568){_0xaa14b9[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db['Disposition'][_0x3bd9('0x44')]);_0xaa14b9[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x4929c8['query']);_0xaa14b9[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0xaa14b9['model'],_0xaa14b9[_0x3bd9('0x49')]);_0x9d73dc[_0x3bd9('0x4b')]=_['intersection'](_0xaa14b9[_0x3bd9('0x47')],qs[_0x3bd9('0x4d')](_0x4929c8['query']['fields']));_0x9d73dc[_0x3bd9('0x4b')]=_0x9d73dc[_0x3bd9('0x4b')]['length']?_0x9d73dc['attributes']:_0xaa14b9[_0x3bd9('0x47')];if(!_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x4f')]('nolimit')){_0x9d73dc['limit']=qs['limit'](_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x2f')]);_0x9d73dc[_0x3bd9('0x31')]=qs['offset'](_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x31')]);}_0x9d73dc[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x52')]);_0x9d73dc['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x4929c8[_0x3bd9('0x49')],_0xaa14b9[_0x3bd9('0x4a')]));_0x9d73dc[_0x3bd9('0x55')][_0x3bd9('0x69')]=_0x289568['id'];if(_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x54')]){_0x9d73dc[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x9d73dc[_0x3bd9('0x55')],{'$or':_[_0x3bd9('0x42')](_0x9d73dc['attributes'],function(_0xe44d3b){var _0x31ee00={};_0x31ee00[_0xe44d3b]={'$like':'%'+_0x4929c8['query']['filter']+'%'};return _0x31ee00;})});}_0x9d73dc=_[_0x3bd9('0x6b')]({},_0x9d73dc,_0x4929c8[_0x3bd9('0x5d')]);return db[_0x3bd9('0x6c')][_0x3bd9('0x30')]({'where':_0x9d73dc[_0x3bd9('0x55')]})[_0x3bd9('0x20')](function(_0x2dbefb){_0x20b5c9[_0x3bd9('0x30')]=_0x2dbefb;if(_0x4929c8[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x9d73dc[_0x3bd9('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x9d73dc);})[_0x3bd9('0x20')](function(_0x25104e){_0x20b5c9['rows']=_0x25104e;return _0x20b5c9;});}})['then'](respondWithFilteredResult(_0x2573cf,_0x9d73dc))['catch'](handleError(_0x2573cf,null));};exports[_0x3bd9('0x6d')]=function(_0x3f811b,_0x17a8c6,_0x34871c){return db[_0x3bd9('0x43')]['find']({'where':{'id':_0x3f811b[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x17a8c6,null))[_0x3bd9('0x20')](function(_0x168278){if(_0x168278){return _0x168278[_0x3bd9('0x6d')](_0x3f811b[_0x3bd9('0x49')][_0x3bd9('0x6e')]);}})[_0x3bd9('0x20')](respondWithStatusCode(_0x17a8c6,null))[_0x3bd9('0x2a')](handleError(_0x17a8c6,null));};exports['addAnswer']=function(_0x109dcc,_0x523fa3,_0xd6e10a){if(_0x109dcc['body']['id']){delete _0x109dcc[_0x3bd9('0x5f')]['id'];}return db['SmsAccount'][_0x3bd9('0x66')]({'where':{'id':_0x109dcc[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x523fa3,null))[_0x3bd9('0x20')](function(_0x16fcfb){if(_0x16fcfb){_0x109dcc[_0x3bd9('0x5f')]['SmsAccountId']=_0x16fcfb['id'];return db[_0x3bd9('0x6f')]['create'](_0x109dcc['body']);}})[_0x3bd9('0x20')](respondWithResult(_0x523fa3,null))['catch'](handleError(_0x523fa3,null));};exports[_0x3bd9('0x70')]=function(_0x33ab3f,_0x5bb485,_0x133c82){var _0x2ecac2={'raw':![],'where':{}};var _0x31f43e={};var _0x3db924={'count':0x0,'rows':[]};return db[_0x3bd9('0x43')][_0x3bd9('0x6a')]({'where':{'id':_0x33ab3f[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x5bb485,null))[_0x3bd9('0x20')](function(_0x503a90){if(_0x503a90){_0x31f43e[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db[_0x3bd9('0x6f')][_0x3bd9('0x44')]);_0x31f43e[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x33ab3f['query']);_0x31f43e[_0x3bd9('0x4a')]=_['intersection'](_0x31f43e[_0x3bd9('0x47')],_0x31f43e[_0x3bd9('0x49')]);_0x2ecac2['attributes']=_[_0x3bd9('0x4c')](_0x31f43e[_0x3bd9('0x47')],qs['fields'](_0x33ab3f['query']['fields']));_0x2ecac2['attributes']=_0x2ecac2[_0x3bd9('0x4b')]['length']?_0x2ecac2[_0x3bd9('0x4b')]:_0x31f43e[_0x3bd9('0x47')];if(!_0x33ab3f['query'][_0x3bd9('0x4f')](_0x3bd9('0x50'))){_0x2ecac2[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x33ab3f[_0x3bd9('0x49')]['limit']);_0x2ecac2[_0x3bd9('0x31')]=qs[_0x3bd9('0x31')](_0x33ab3f[_0x3bd9('0x49')][_0x3bd9('0x31')]);}_0x2ecac2[_0x3bd9('0x51')]=qs['sort'](_0x33ab3f[_0x3bd9('0x49')][_0x3bd9('0x52')]);_0x2ecac2['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x33ab3f['query'],_0x31f43e[_0x3bd9('0x4a')]));_0x2ecac2[_0x3bd9('0x55')]['SmsAccountId']=_0x503a90['id'];if(_0x33ab3f['query'][_0x3bd9('0x54')]){_0x2ecac2[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x2ecac2[_0x3bd9('0x55')],{'$or':_[_0x3bd9('0x42')](_0x2ecac2[_0x3bd9('0x4b')],function(_0xab32b){var _0x17dfb3={};_0x17dfb3[_0xab32b]={'$like':'%'+_0x33ab3f[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x17dfb3;})});}_0x2ecac2=_['merge']({},_0x2ecac2,_0x33ab3f[_0x3bd9('0x5d')]);return db['CannedAnswer'][_0x3bd9('0x30')]({'where':_0x2ecac2[_0x3bd9('0x55')]})[_0x3bd9('0x20')](function(_0xc6ddf7){_0x3db924[_0x3bd9('0x30')]=_0xc6ddf7;if(_0x33ab3f[_0x3bd9('0x49')]['includeAll']){_0x2ecac2['include']=[{'all':!![]}];}return db[_0x3bd9('0x6f')][_0x3bd9('0x59')](_0x2ecac2);})['then'](function(_0x2e7a4b){_0x3db924[_0x3bd9('0x5a')]=_0x2e7a4b;return _0x3db924;});}})[_0x3bd9('0x20')](respondWithFilteredResult(_0x5bb485,_0x2ecac2))[_0x3bd9('0x2a')](handleError(_0x5bb485,null));};exports[_0x3bd9('0x71')]=function(_0x37dade,_0x3c0c8a,_0xcebac2){return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x37dade[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x3c0c8a,null))[_0x3bd9('0x20')](function(_0x44bce6){if(_0x44bce6){return _0x44bce6[_0x3bd9('0x71')](_0x37dade['query'][_0x3bd9('0x6e')]);}})[_0x3bd9('0x20')](respondWithStatusCode(_0x3c0c8a,null))['catch'](handleError(_0x3c0c8a,null));};exports[_0x3bd9('0x72')]=function(_0xdd5be,_0x4bcf48,_0x4ef49d){var _0x39d260={'channel':'sms'};var _0x34e241=[];var _0x2e3f86=[];var _0x1e5f55={};return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0xdd5be['params']['id']},'include':[{'model':db[_0x3bd9('0x73')],'as':_0x3bd9('0x74')}]})['then'](handleEntityNotFound(_0x4bcf48,null))[_0x3bd9('0x20')](function(_0x5dccd0){_0x39d260[_0x3bd9('0x75')]=_0x5dccd0;_0x39d260[_0x3bd9('0x76')]=_[_0x3bd9('0x77')](_0x5dccd0[_0x3bd9('0x74')],['priority'],[_0x3bd9('0x78')]);if(_0x39d260['account']['Applications']){delete _0x39d260['account']['Applications'];}return db['CmContact'][_0x3bd9('0x67')]();})['then'](function(_0xb3ad63){if(!_0xb3ad63){throw new db['Sequelize'][(_0x3bd9('0x79'))](_0x3bd9('0x7a'));}_0x34e241=_[_0x3bd9('0x7b')](_[_0x3bd9('0x48')](_0xb3ad63),[_0x3bd9('0x7c'),_0x3bd9('0x7d')]);_0x2e3f86=_[_0x3bd9('0x7b')](_[_0x3bd9('0x48')](_0xb3ad63),[_0x3bd9('0x7c'),_0x3bd9('0x7d'),_0x3bd9('0x7e'),_0x3bd9('0x7f')]);_0x39d260[_0x3bd9('0x5f')]={'mapKey':_0x3bd9('0x80')};if(_0x39d260['account'][_0x3bd9('0x46')]){switch(_0x39d260['account'][_0x3bd9('0x46')]){case _0x3bd9('0x81'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x83')];_0x39d260[_0x3bd9('0x5f')]['body']=_0xdd5be['body'][_0x3bd9('0x84')];_0x39d260['body'][_0x3bd9('0x85')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x86')];break;case _0x3bd9('0x87'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]='+'+_0xdd5be['body']['sender'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x88')];break;case _0x3bd9('0x89'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x82')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')]['message'];break;case _0x3bd9('0x8a'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')]['from'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x5f')];_0x39d260['body'][_0x3bd9('0x85')]=_0xdd5be['body'][_0x3bd9('0x8b')];break;case'plivo':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')]['From'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be['body'][_0x3bd9('0x8c')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x85')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x8d')];break;case _0x3bd9('0x8e'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]='+'+_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0]['from'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be['body'][_0x3bd9('0x8f')][0x0][_0x3bd9('0x88')];_0x39d260[_0x3bd9('0x5f')]['messageId']=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0][_0x3bd9('0x85')];break;case _0x3bd9('0x90'):_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')]=_0xdd5be['body'][_0x3bd9('0x91')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')]['segmentedMessage'][_0x3bd9('0x28')];break;case _0x3bd9('0x92'):_0x39d260['body'][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')]['fromNumber'];_0x39d260['body'][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x88')];_0x39d260['body'][_0x3bd9('0x85')]=_0xdd5be['body'][_0x3bd9('0x93')];break;case _0x3bd9('0x94'):_0x39d260['body']['messageId']=_0xdd5be[_0x3bd9('0x5f')][0x0][_0x3bd9('0x28')]['id'];_0x39d260[_0x3bd9('0x5f')]['from']=_0xdd5be[_0x3bd9('0x5f')][0x0]['message']['from'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')][0x0]['message'][_0x3bd9('0x88')];break;case _0x3bd9('0x95'):_0x39d260['body'][_0x3bd9('0x82')]=_0xdd5be[_0x3bd9('0x5f')][_0x3bd9('0x82')];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x5f')]=_0xdd5be[_0x3bd9('0x5f')]['message'];_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x85')]=_0xdd5be[_0x3bd9('0x5f')]['refid'];break;}}if(_0x39d260[_0x3bd9('0x5f')]['id']){delete _0x39d260[_0x3bd9('0x5f')]['id'];}if(_[_0x3bd9('0x96')](_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))](_0x3bd9('0x98'));}if(_[_0x3bd9('0x96')](_0x39d260['body']['body'])||_0x39d260['body'][_0x3bd9('0x5f')]===''){throw new db[(_0x3bd9('0x97'))]['ValidationError'](_0x3bd9('0x99'));}if(_[_0x3bd9('0x96')](_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))](_0x3bd9('0x9b')+_0x2e3f86);}if(!_[_0x3bd9('0x9c')](_0x2e3f86,_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e3f86);}_0x1e5f55[_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')]]=_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')];return db[_0x3bd9('0x9d')][_0x3bd9('0x66')]({'where':{'id':_0x39d260['account'][_0x3bd9('0x7f')]},'include':[{'model':db['CmContact'],'as':_0x3bd9('0x9e'),'where':_0x1e5f55,'limit':0x1,'order':[[_0x3bd9('0x7d'),_0x3bd9('0x9f')]]}]});})[_0x3bd9('0x20')](handleEntityNotFound(_0x4bcf48,null))[_0x3bd9('0x20')](function(_0x22df3d){if(_0x22df3d){_0x39d260[_0x3bd9('0xa0')]=_[_0x3bd9('0xa1')](_0x22df3d,[_0x3bd9('0x9e')]);if(_0x22df3d[_0x3bd9('0x9e')]['length']){return _0x22df3d[_0x3bd9('0x9e')][0x0];}var _0x291968=_['defaults'](_0x39d260[_0x3bd9('0x5f')],{'firstName':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')],'ListId':_0x22df3d['id']});_0x291968[_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x9a')]]=_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')];return db[_0x3bd9('0xa2')][_0x3bd9('0x5e')](_0x291968,{'fields':_0x34e241,'raw':!![]});}})[_0x3bd9('0x20')](handleEntityNotFound(_0x4bcf48,null))[_0x3bd9('0x20')](function(_0x2b2d06){if(_0x2b2d06){_0x39d260[_0x3bd9('0xa3')]=_0x2b2d06;var _0xdf4d0e={'ContactId':_0x2b2d06['id'],'phone':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x82')],'SmsAccountId':_0xdd5be['params']['id']};var _0x25383c={'ContactId':_0x2b2d06['id'],'SmsAccountId':_0xdd5be[_0x3bd9('0x5b')]['id'],'closed':![]};return db[_0x3bd9('0xa4')]['find']({'where':_0x25383c})[_0x3bd9('0x20')](function(_0x3618f1){if(_0x3618f1){return[_0x3618f1,![]];}return db[_0x3bd9('0xa4')]['create'](_0xdf4d0e)[_0x3bd9('0x20')](function(_0x3ee190){return[_0x3ee190,!![]];});});}})['spread'](function(_0x5d6956,_0x57f53d){_0x39d260['interaction']=_0x5d6956['get']({'plain':!![]});_0x39d260['interaction']['created']=![];if(_0x57f53d){if(_0x39d260[_0x3bd9('0x75')][_0x3bd9('0xa5')]){_0x39d260[_0x3bd9('0x76')][_0x3bd9('0xa6')]({'id':0x0,'priority':_0x39d260[_0x3bd9('0x76')][_0x3bd9('0x4e')]+0x1,'app':_0x3bd9('0xa7'),'appdata':_0x3bd9('0xa8'),'interval':_0x3bd9('0xa9')});}_0x39d260['interaction'][_0x3bd9('0xaa')]=!![];}return db[_0x3bd9('0xab')][_0x3bd9('0x5e')]({'phone':_0x39d260['body'][_0x3bd9('0x82')],'messageId':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0x85')],'body':_0x39d260['body'][_0x3bd9('0x5f')],'SmsAccountId':_0xdd5be[_0x3bd9('0x5b')]['id'],'SmsInteractionId':_0x5d6956['id'],'direction':'in','ContactId':_0x5d6956['ContactId'],'AttachmentId':_0x39d260[_0x3bd9('0x5f')][_0x3bd9('0xac')]});})[_0x3bd9('0x20')](function(_0x5a0bc1){_0x39d260[_0x3bd9('0x28')]=_0x5a0bc1;if(_0x39d260[_0x3bd9('0xad')][_0x3bd9('0xae')]){return db[_0x3bd9('0xaf')]['find']({'attributes':['id',_0x3bd9('0x3e')],'where':{'id':_0x39d260[_0x3bd9('0xad')][_0x3bd9('0xae')]}})[_0x3bd9('0x20')](function(_0x2ecb7b){if(_0x2ecb7b){_0x39d260[_0x3bd9('0x76')][_0x3bd9('0xb0')]({'id':0x0,'priority':0x0,'app':_0x3bd9('0xb1'),'appdata':_0x2ecb7b[_0x3bd9('0x3e')]+','+(_0x39d260[_0x3bd9('0x75')][_0x3bd9('0xb2')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x3bd9('0xb3'),_0x39d260);});}return respondWithRpcPromise(_0x3bd9('0xb4'),_0x3bd9('0xb3'),_0x39d260);})[_0x3bd9('0x20')](function(_0xbaf4fb){if(_0xbaf4fb){var _0x380715=0xc8;var _0x14908e=_0x3bd9('0xb5');logger[_0x3bd9('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x14908e,_0x380715,_0x3bd9('0xb7'));logger[_0x3bd9('0x23')](_0x3bd9('0xb8'),_0x14908e,_0x380715,_0x3bd9('0xb7'),JSON['stringify'](_0xbaf4fb));if(_0x39d260['account'][_0x3bd9('0x46')]===_0x3bd9('0x81')){return _0x4bcf48['status'](_0x380715)['set'](_0x3bd9('0xb9'),_0x3bd9('0xba'))[_0x3bd9('0x3f')](_0x3bd9('0xbb'));}else{return _0x4bcf48['status'](_0x380715)[_0x3bd9('0x2d')](_0xbaf4fb);}}})['catch'](handleError(_0x4bcf48,null));};exports['addApplications']=function(_0x1e98fd,_0x16c032){var _0x2a2036=_0x1e98fd[_0x3bd9('0x5b')]['id'];var _0x9cc6f1=_0x1e98fd['body'];var _0x1e5b10=0xc8;var _0x6e9fbf=null;return db['sequelize'][_0x3bd9('0xbc')]({'isolationLevel':db[_0x3bd9('0xbd')][_0x3bd9('0xbe')]['ISOLATION_LEVELS'][_0x3bd9('0xbf')]},function(_0xff2482){return db[_0x3bd9('0x43')]['findOne']({'where':{'id':_0x2a2036},'transaction':_0xff2482})[_0x3bd9('0x20')](function(_0x352f7d){if(_0x352f7d){return db[_0x3bd9('0x73')]['destroy']({'where':{'SmsAccountId':_0x2a2036},'transaction':_0xff2482})[_0x3bd9('0x20')](function(){var _0xe5a53a=_[_0x3bd9('0x42')](_0x9cc6f1,function(_0x49749d){_0x49749d[_0x3bd9('0x69')]=_0x2a2036;return _0x49749d;});return db[_0x3bd9('0x73')][_0x3bd9('0xc0')](_0xe5a53a,{'transaction':_0xff2482});});}else{_0x1e5b10=0x194;_0x6e9fbf=[];}});})[_0x3bd9('0x20')](function(){if(_0x1e5b10!==0x194){return db['SmsApplication'][_0x3bd9('0xc1')]({'where':{'SmsAccountId':_0x2a2036},'order':_0x3bd9('0xc2')})[_0x3bd9('0x20')](function(_0xa2da2e){_0x6e9fbf=_0xa2da2e;});}})[_0x3bd9('0x2a')](function(_0x58c54f){_0x1e5b10=0x1f4;logger[_0x3bd9('0x26')](_0x58c54f[_0x3bd9('0x3d')]);if(_0x58c54f[_0x3bd9('0x3e')]){delete _0x58c54f[_0x3bd9('0x3e')];}_0x6e9fbf=_0x58c54f;})[_0x3bd9('0xc3')](function(){if(_0x6e9fbf===null){_0x16c032[_0x3bd9('0x2b')](_0x1e5b10);}else{if(_0x1e5b10===0x1f4){_0x16c032[_0x3bd9('0x3c')](_0x1e5b10)[_0x3bd9('0x3f')](_0x6e9fbf);}else{_0x16c032[_0x3bd9('0x3c')](_0x1e5b10)[_0x3bd9('0x2d')](_0x6e9fbf);}}});};exports[_0x3bd9('0xc4')]=function(_0x4800a8,_0x5ac55b,_0x45f34c){var _0x792439={};var _0x2455ff={};var _0x2e9724;var _0x27fec4;return db['SmsAccount'][_0x3bd9('0x6a')]({'where':{'id':_0x4800a8[_0x3bd9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ac55b,null))[_0x3bd9('0x20')](function(_0x548d54){if(_0x548d54){_0x2e9724=_0x548d54;_0x2455ff[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db['SmsApplication'][_0x3bd9('0x44')]);_0x2455ff[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x4800a8[_0x3bd9('0x49')]);_0x2455ff[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x2455ff[_0x3bd9('0x47')],_0x2455ff[_0x3bd9('0x49')]);_0x792439['attributes']=_[_0x3bd9('0x4c')](_0x2455ff[_0x3bd9('0x47')],qs[_0x3bd9('0x4d')](_0x4800a8[_0x3bd9('0x49')]['fields']));_0x792439[_0x3bd9('0x4b')]=_0x792439[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x792439[_0x3bd9('0x4b')]:_0x2455ff['model'];_0x792439[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0x4800a8[_0x3bd9('0x49')]['sort']);_0x792439['where']=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x4800a8[_0x3bd9('0x49')],_0x2455ff[_0x3bd9('0x4a')]));if(_0x4800a8[_0x3bd9('0x49')]['filter']){_0x792439[_0x3bd9('0x55')]=_['merge'](_0x792439['where'],{'$or':_['map'](_0x792439[_0x3bd9('0x4b')],function(_0x56e25c){var _0x18b30c={};_0x18b30c[_0x56e25c]={'$like':'%'+_0x4800a8[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x18b30c;})});}_0x792439=_[_0x3bd9('0x6b')]({},_0x792439,_0x4800a8[_0x3bd9('0x5d')]);return _0x2e9724['getApplications'](_0x792439);}})['then'](function(_0x15411f){if(_0x15411f){_0x27fec4=_0x15411f['length'];if(!_0x4800a8[_0x3bd9('0x49')][_0x3bd9('0x4f')](_0x3bd9('0x50'))){_0x792439[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x4800a8['query'][_0x3bd9('0x2f')]);_0x792439[_0x3bd9('0x31')]=qs[_0x3bd9('0x31')](_0x4800a8[_0x3bd9('0x49')][_0x3bd9('0x31')]);}return _0x2e9724[_0x3bd9('0xc4')](_0x792439);}})[_0x3bd9('0x20')](function(_0x3ee2b5){if(_0x3ee2b5){return _0x3ee2b5?{'count':_0x27fec4,'rows':_0x3ee2b5}:null;}})[_0x3bd9('0x20')](respondWithResult(_0x5ac55b,null))[_0x3bd9('0x2a')](handleError(_0x5ac55b,null));};exports['getInteractions']=function(_0x465836,_0x216917,_0x328ae1){var _0x55f2b7={'raw':![],'where':{}};var _0x26fdf5={};var _0x454315={'count':0x0,'rows':[]};return db[_0x3bd9('0x43')][_0x3bd9('0x6a')]({'where':{'id':_0x465836['params']['id']}})['then'](handleEntityNotFound(_0x216917,null))[_0x3bd9('0x20')](function(_0x111589){if(_0x111589){_0x26fdf5[_0x3bd9('0x47')]=_[_0x3bd9('0x48')](db[_0x3bd9('0xa4')]['rawAttributes']);_0x26fdf5[_0x3bd9('0x49')]=_[_0x3bd9('0x48')](_0x465836['query']);_0x26fdf5[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x26fdf5[_0x3bd9('0x47')],_0x26fdf5[_0x3bd9('0x49')]);_0x55f2b7[_0x3bd9('0x4b')]=_[_0x3bd9('0x4c')](_0x26fdf5[_0x3bd9('0x47')],qs[_0x3bd9('0x4d')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x4d')]));_0x55f2b7[_0x3bd9('0x4b')]=_0x55f2b7[_0x3bd9('0x4b')]['length']?_0x55f2b7[_0x3bd9('0x4b')]:_0x26fdf5['model'];if(!_0x465836[_0x3bd9('0x49')]['hasOwnProperty'](_0x3bd9('0x50'))){_0x55f2b7[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x2f')]);_0x55f2b7[_0x3bd9('0x31')]=qs[_0x3bd9('0x31')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x31')]);}_0x55f2b7['order']=qs[_0x3bd9('0x52')](_0x465836[_0x3bd9('0x49')][_0x3bd9('0x52')]);_0x55f2b7[_0x3bd9('0x55')]=qs[_0x3bd9('0x4a')](_[_0x3bd9('0x53')](_0x465836['query'],_0x26fdf5[_0x3bd9('0x4a')]));_0x55f2b7[_0x3bd9('0x55')][_0x3bd9('0x69')]=_0x111589['id'];if(_0x465836['query']['filter']){_0x55f2b7[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x55f2b7['where'],{'$or':_[_0x3bd9('0x42')](_0x55f2b7['attributes'],function(_0x5b84ad){var _0x2dd6ad={};_0x2dd6ad[_0x5b84ad]={'$like':'%'+_0x465836[_0x3bd9('0x49')]['filter']+'%'};return _0x2dd6ad;})});}_0x55f2b7=_['merge']({},_0x55f2b7,_0x465836[_0x3bd9('0x5d')]);return db[_0x3bd9('0xa4')][_0x3bd9('0x30')]({'where':_0x55f2b7[_0x3bd9('0x55')]})[_0x3bd9('0x20')](function(_0x546e0a){_0x454315[_0x3bd9('0x30')]=_0x546e0a;if(_0x465836[_0x3bd9('0x49')][_0x3bd9('0x57')]){_0x55f2b7[_0x3bd9('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3bd9('0xaf')],'as':'Owner','attributes':[_0x3bd9('0x3e'),_0x3bd9('0xc5'),_0x3bd9('0xc6')],'required':![]},{'model':db[_0x3bd9('0xc7')],'as':_0x3bd9('0xc8'),'attributes':['id',_0x3bd9('0x3e'),'color'],'where':_0x465836['query'][_0x3bd9('0xc9')]?{'id':_0x465836[_0x3bd9('0x49')][_0x3bd9('0xc9')]}:undefined,'required':_0x465836['query']['tag']?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x55f2b7);})[_0x3bd9('0x20')](function(_0x144e64){_0x454315['rows']=_0x144e64;return _0x454315;});}})[_0x3bd9('0x20')](respondWithFilteredResult(_0x216917,_0x55f2b7))[_0x3bd9('0x2a')](handleError(_0x216917,null));};exports[_0x3bd9('0x3f')]=function(_0x446fb5,_0x324727,_0x31028c){var _0x1e0ada,_0x94fc15,_0x888ddf;if(_['isNil'](_0x446fb5[_0x3bd9('0x5f')][_0x3bd9('0x5f')])||_0x446fb5[_0x3bd9('0x5f')]['body']===''){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3bd9('0x96')](_0x446fb5['body']['to'])){throw new db[(_0x3bd9('0x97'))][(_0x3bd9('0x79'))](_0x3bd9('0xca'));}_0x1e0ada=_0x446fb5[_0x3bd9('0x5f')]['to'];return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x446fb5[_0x3bd9('0x5b')]['id']},'include':[{'model':db[_0x3bd9('0x9d')],'as':_0x3bd9('0xcb'),'include':[{'model':db[_0x3bd9('0xa2')],'as':_0x3bd9('0x9e'),'where':{'mobile':_0x1e0ada},'limit':0x1,'order':[[_0x3bd9('0x7d'),_0x3bd9('0x9f')]]}]}]})[_0x3bd9('0x20')](handleEntityNotFound(_0x324727,null))[_0x3bd9('0x20')](function(_0x1a7d4d){if(_0x1a7d4d&&_0x1a7d4d[_0x3bd9('0xcb')]){_0x94fc15=_0x1a7d4d[_0x3bd9('0x38')]({'plain':!![]});if(_0x94fc15[_0x3bd9('0xcb')]&&_0x94fc15[_0x3bd9('0xcb')]['Contacts'][_0x3bd9('0x4e')]){return _0x94fc15['List'][_0x3bd9('0x9e')][0x0];}return db['CmContact'][_0x3bd9('0x5e')](_['defaults'](_0x446fb5[_0x3bd9('0x5f')],{'firstName':_0x1e0ada,'mobile':_0x1e0ada,'phone':_0x1e0ada,'ListId':_0x94fc15['ListId']}));}})['then'](handleEntityNotFound(_0x324727,null))['then'](function(_0xbf68eb){if(_0xbf68eb){_0x888ddf=_0xbf68eb;return db[_0x3bd9('0xa4')][_0x3bd9('0x66')]({'where':{'ContactId':_0x888ddf['id'],'closed':![],'SmsAccountId':_0x94fc15['id']}})[_0x3bd9('0x20')](function(_0x387f6d){if(_0x387f6d){return[_0x387f6d,![]];}return db[_0x3bd9('0xa4')][_0x3bd9('0x5e')]({'UserId':_0x446fb5[_0x3bd9('0xcc')]['id'],'ContactId':_0x888ddf['id'],'SmsAccountId':_0x94fc15['id'],'phone':_0x1e0ada,'firstMsgDirection':_0x3bd9('0xcd'),'Messages':[_[_0x3bd9('0x6b')](_0x446fb5['body'],{'read':![],'body':_0x446fb5[_0x3bd9('0x5f')]['body'],'phone':_0x1e0ada,'SmsAccountId':_0x94fc15['id'],'UserId':_0x446fb5[_0x3bd9('0xcc')]['id'],'ContactId':_0x888ddf['id']})]},{'include':[{'model':db[_0x3bd9('0xab')],'as':'Messages'}]})[_0x3bd9('0x20')](function(_0x6522cf){return[_0x6522cf,!![]];});});}})[_0x3bd9('0xce')](function(_0x4a2863,_0x373926){if(_0x373926){return _0x4a2863;}return db[_0x3bd9('0xab')][_0x3bd9('0x5e')](_[_0x3bd9('0x6b')](_0x446fb5['body'],{'read':![],'body':_0x446fb5[_0x3bd9('0x5f')][_0x3bd9('0x5f')],'phone':_0x1e0ada,'SmsAccountId':_0x94fc15['id'],'SmsInteractionId':_0x4a2863['id'],'UserId':_0x446fb5[_0x3bd9('0xcc')]['id'],'ContactId':_0x888ddf['id']}))[_0x3bd9('0x20')](function(_0x3c9efd){_0x4a2863[_0x3bd9('0xcf')][_0x3bd9('0xd0')]=[];_0x4a2863[_0x3bd9('0xcf')][_0x3bd9('0xd0')]['push'](_0x3c9efd[_0x3bd9('0xcf')]);return _0x4a2863;});})[_0x3bd9('0x20')](respondWithResult(_0x324727,null))['catch'](handleError(_0x324727,null));};exports['status']=function(_0x360285,_0x1e5322,_0x4b1f02){if(_0x360285['body']['id']){delete _0x360285[_0x3bd9('0x5f')]['id'];}var _0x158ac7,_0x408a85,_0x575df0;return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x360285[_0x3bd9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1e5322,null))[_0x3bd9('0x20')](function(_0x50b793){if(_0x50b793){_0x575df0=_0x50b793;logger['debug'](_0x3bd9('0x24'),_0x3bd9('0x3c'),'received\x20delivery\x20report\x20from',_0x50b793[_0x3bd9('0x46')],util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));switch(_0x50b793[_0x3bd9('0x46')]){case'skebby':if(_0x360285[_0x3bd9('0x5f')]['skebby_dispatch_id']&&_0x360285['body'][_0x3bd9('0x3c')]){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x3c')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x360285[_0x3bd9('0x5f')]['skebby_dispatch_id']}});}break;case _0x3bd9('0x89'):if(_0x360285['body'][_0x3bd9('0xd2')]&&_0x360285['body'][_0x3bd9('0xd3')]){_0x408a85=_0x360285[_0x3bd9('0x5f')]['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd2')]}});}break;case _0x3bd9('0x8a'):if(_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x8b')]&&_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd4')]){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd4')];return db['SmsMessage'][_0x3bd9('0x66')]({'where':{'messageId':_0x360285['body']['message_id']}});}break;case _0x3bd9('0x8e'):var _0x2756d2=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0];if(_0x2756d2[_0x3bd9('0x85')]&&_0x2756d2['status'][_0x3bd9('0xd5')]===_0x3bd9('0xd6')){_0x408a85=_0x2756d2['status'][_0x3bd9('0xd5')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x2756d2[_0x3bd9('0x85')]}});}break;case _0x3bd9('0x92'):if(_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x85')]&&_0x360285[_0x3bd9('0x5f')]['status']){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x3c')];return db['SmsMessage'][_0x3bd9('0x66')]({'where':{'messageId':_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x85')]}});}break;case'bandwidth':if(_0x360285[_0x3bd9('0x5f')][0x0][_0x3bd9('0x28')]['id']){_0x408a85=_0x360285[_0x3bd9('0x5f')][0x0]['type'];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x360285['body'][0x0][_0x3bd9('0x28')]['id']}});}break;case _0x3bd9('0x95'):if(_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd7')]&&_0x360285['body'][_0x3bd9('0x3c')]){_0x408a85=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x3c')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd7')]}});}break;}}})[_0x3bd9('0x20')](handleEntityNotFound(_0x1e5322,null))[_0x3bd9('0x20')](function(_0x37c6b8){if(_0x37c6b8){_0x158ac7=_0x37c6b8;switch(_0x575df0['type']){case _0x3bd9('0x87'):if(_0x408a85===_0x3bd9('0xd6')){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger['error'](_0x3bd9('0x24'),'status','skebby',util[_0x3bd9('0xd1')](_0x360285['body'],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x89'):if(_0x408a85==='1'){return _0x158ac7['update']({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),'status','skebby',util[_0x3bd9('0xd1')](_0x360285['body'],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x8a'):if(!_0x360285[_0x3bd9('0x5f')][_0x3bd9('0xd8')]&&_0x408a85>=0xc8&&_0x408a85<=0xce){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x8a'),util[_0x3bd9('0xd1')](_0x360285['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x399774=_0x360285[_0x3bd9('0x5f')][_0x3bd9('0x8f')][0x0];if(_0x399774[_0x3bd9('0x3c')][_0x3bd9('0xd5')]==='DELIVERED'){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger['error'](_0x3bd9('0x24'),'status','infobip',util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x408a85=='DELIVERED_TO_GATEWAY'||_0x408a85=='RECEIVED_BY_RECIPIENT'){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3bd9('0x3c'),_0x3bd9('0x92'),util['inspect'](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x94'):if(_0x408a85==_0x3bd9('0xd9')){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x94'),util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3bd9('0x95'):if(_0x408a85===_0x3bd9('0xda')||_0x408a85==='ACCEPTD'){return _0x158ac7[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x95'),util[_0x3bd9('0xd1')](_0x360285[_0x3bd9('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x158ac7;}})[_0x3bd9('0x20')](respondWithResult(_0x1e5322,null))[_0x3bd9('0x2a')](handleError(_0x1e5322,null));};exports[_0x3bd9('0xdb')]=function(_0x36f8e8,_0x2578ee,_0x1d175d){var _0x2f76c4,_0x1bcea8,_0x16b7d5;return db[_0x3bd9('0x43')]['find']({'where':{'id':_0x36f8e8['params']['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x2578ee,null))[_0x3bd9('0x20')](function(_0x2159d8){if(_0x2159d8){_0x16b7d5=_0x2159d8;logger[_0x3bd9('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x2159d8[_0x3bd9('0x46')],util['inspect'](_0x36f8e8[_0x3bd9('0x49')],{'showHidden':![],'depth':null}));switch(_0x2159d8[_0x3bd9('0x46')]){case _0x3bd9('0x90'):if(_0x36f8e8[_0x3bd9('0x49')][_0x3bd9('0xdc')]&&_0x36f8e8['query'][_0x3bd9('0xdd')]){_0x1bcea8=_0x36f8e8[_0x3bd9('0x49')][_0x3bd9('0xdd')];return db[_0x3bd9('0xab')][_0x3bd9('0x66')]({'where':{'messageId':_0x36f8e8[_0x3bd9('0x49')][_0x3bd9('0xdc')]}});}break;}}})[_0x3bd9('0x20')](handleEntityNotFound(_0x2578ee,null))[_0x3bd9('0x20')](function(_0x374fa5){if(_0x374fa5){_0x2f76c4=_0x374fa5;switch(_0x16b7d5['type']){case'csc':if(_0x1bcea8==='2'||_0x1bcea8==='6'){return _0x2f76c4[_0x3bd9('0x37')]({'read':!![]});}else{logger[_0x3bd9('0x26')](_0x3bd9('0x24'),_0x3bd9('0x3c'),_0x3bd9('0x90'),util[_0x3bd9('0xd1')](_0x36f8e8[_0x3bd9('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x2f76c4;}})[_0x3bd9('0x20')](respondWithResult(_0x2578ee,null))[_0x3bd9('0x2a')](handleError(_0x2578ee,null));};exports[_0x3bd9('0xde')]=function(_0x224317,_0x4a8d10,_0x1f1976){return db['SmsAccount'][_0x3bd9('0x66')]({'where':{'id':_0x224317[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x4a8d10,null))[_0x3bd9('0x20')](function(_0x17cb7b){if(_0x17cb7b){return _0x17cb7b['addAgents'](_0x224317[_0x3bd9('0x5f')]['ids'],_[_0x3bd9('0xa1')](_0x224317['body'],['ids','id'])||{})['spread'](function(_0x58305b){for(var _0x106f08=0x0;_0x106f08<_0x224317[_0x3bd9('0x5f')][_0x3bd9('0x6e')][_0x3bd9('0x4e')];_0x106f08+=0x1){socket[_0x3bd9('0xdf')](_0x3bd9('0xe0'),{'UserId':Number(_0x224317[_0x3bd9('0x5f')][_0x3bd9('0x6e')][_0x106f08]),'SmsAccountId':Number(_0x224317[_0x3bd9('0x5b')]['id'])});}return _0x58305b;});}})['then'](respondWithResult(_0x4a8d10,null))[_0x3bd9('0x2a')](handleError(_0x4a8d10,null));};exports[_0x3bd9('0xe1')]=function(_0x14f842,_0x52d78b,_0x31d1f6){return db[_0x3bd9('0x43')][_0x3bd9('0x66')]({'where':{'id':_0x14f842[_0x3bd9('0x5b')]['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x52d78b,null))['then'](function(_0x14fc81){if(_0x14fc81){return _0x14fc81[_0x3bd9('0xe1')](_0x14f842['query'][_0x3bd9('0x6e')])['then'](function(){if(_[_0x3bd9('0xe2')](_0x14f842['query']['ids'])){for(var _0x169d8c=0x0;_0x169d8c<_0x14f842[_0x3bd9('0x49')][_0x3bd9('0x6e')][_0x3bd9('0x4e')];_0x169d8c+=0x1){socket['emit'](_0x3bd9('0xe3'),{'UserId':Number(_0x14f842[_0x3bd9('0x49')][_0x3bd9('0x6e')][_0x169d8c]),'SmsAccountId':Number(_0x14f842[_0x3bd9('0x5b')]['id'])});}}else{socket[_0x3bd9('0xdf')](_0x3bd9('0xe3'),{'UserId':Number(_0x14f842[_0x3bd9('0x49')][_0x3bd9('0x6e')]),'SmsAccountId':Number(_0x14f842[_0x3bd9('0x5b')]['id'])});}});}})[_0x3bd9('0x20')](respondWithStatusCode(_0x52d78b,null))[_0x3bd9('0x2a')](handleError(_0x52d78b,null));};exports['getAgents']=function(_0x2f920b,_0x5e6d06,_0x473095){var _0x3ecbd1={};var _0x256c57={};var _0x332da0;var _0x5d3f83;return db['SmsAccount'][_0x3bd9('0x6a')]({'where':{'id':_0x2f920b['params']['id']}})[_0x3bd9('0x20')](handleEntityNotFound(_0x5e6d06,null))[_0x3bd9('0x20')](function(_0x1eb3ac){if(_0x1eb3ac){_0x332da0=_0x1eb3ac;_0x256c57[_0x3bd9('0x47')]=_['keys'](db[_0x3bd9('0xaf')]['rawAttributes']);_0x256c57['query']=_[_0x3bd9('0x48')](_0x2f920b[_0x3bd9('0x49')]);_0x256c57[_0x3bd9('0x4a')]=_[_0x3bd9('0x4c')](_0x256c57[_0x3bd9('0x47')],_0x256c57[_0x3bd9('0x49')]);_0x3ecbd1[_0x3bd9('0x4b')]=_[_0x3bd9('0x4c')](_0x256c57['model'],qs[_0x3bd9('0x4d')](_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x4d')]));_0x3ecbd1[_0x3bd9('0x4b')]=_0x3ecbd1[_0x3bd9('0x4b')][_0x3bd9('0x4e')]?_0x3ecbd1[_0x3bd9('0x4b')]:_0x256c57['model'];_0x3ecbd1[_0x3bd9('0x51')]=qs[_0x3bd9('0x52')](_0x2f920b['query'][_0x3bd9('0x52')]);_0x3ecbd1['where']=qs['filters'](_[_0x3bd9('0x53')](_0x2f920b[_0x3bd9('0x49')],_0x256c57['filters']));if(_0x2f920b[_0x3bd9('0x49')]['filter']){_0x3ecbd1[_0x3bd9('0x55')]=_[_0x3bd9('0x6b')](_0x3ecbd1['where'],{'$or':_['map'](_0x3ecbd1['attributes'],function(_0x5e57bd){var _0x35d6d6={};_0x35d6d6[_0x5e57bd]={'$like':'%'+_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x54')]+'%'};return _0x35d6d6;})});}_0x3ecbd1=_[_0x3bd9('0x6b')]({},_0x3ecbd1,_0x2f920b['options']);return _0x332da0[_0x3bd9('0xe4')](_0x3ecbd1);}})[_0x3bd9('0x20')](function(_0x39399a){if(_0x39399a){_0x5d3f83=_0x39399a[_0x3bd9('0x4e')];if(!_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x4f')]('nolimit')){_0x3ecbd1[_0x3bd9('0x2f')]=qs[_0x3bd9('0x2f')](_0x2f920b[_0x3bd9('0x49')][_0x3bd9('0x2f')]);_0x3ecbd1['offset']=qs[_0x3bd9('0x31')](_0x2f920b['query']['offset']);}return _0x332da0[_0x3bd9('0xe4')](_0x3ecbd1);}})[_0x3bd9('0x20')](function(_0x3decc7){if(_0x3decc7){return _0x3decc7?{'count':_0x5d3f83,'rows':_0x3decc7}:null;}})[_0x3bd9('0x20')](respondWithResult(_0x5e6d06,null))[_0x3bd9('0x2a')](handleError(_0x5e6d06,null));}; \ No newline at end of file +var _0xfe90=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','includeAll','include','SmsAccount','findAll','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','where','rows','removeDispositions','ids','addAnswer','SmsAccountId','findOne','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','sender','text','connectel','clicksend','message_id','plivo','infobip','results','csc','clickatell','fromNumber','replyMessageId','bandwidth','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','send','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe90,0x1b9));var _0x0fe9=function(_0x4b043a,_0x243672){_0x4b043a=_0x4b043a-0x0;var _0x1de4de=_0xfe90[_0x4b043a];return _0x1de4de;};'use strict';var emlformat=require(_0x0fe9('0x0'));var rimraf=require(_0x0fe9('0x1'));var zipdir=require(_0x0fe9('0x2'));var jsonpatch=require(_0x0fe9('0x3'));var rp=require(_0x0fe9('0x4'));var moment=require('moment');var BPromise=require(_0x0fe9('0x5'));var Mustache=require(_0x0fe9('0x6'));var util=require(_0x0fe9('0x7'));var path=require(_0x0fe9('0x8'));var sox=require(_0x0fe9('0x9'));var csv=require(_0x0fe9('0xa'));var ejs=require(_0x0fe9('0xb'));var fs=require('fs');var fs_extra=require(_0x0fe9('0xc'));var _=require(_0x0fe9('0xd'));var squel=require(_0x0fe9('0xe'));var crypto=require('crypto');var jsforce=require(_0x0fe9('0xf'));var deskjs=require(_0x0fe9('0x10'));var toCsv=require(_0x0fe9('0xa'));var querystring=require(_0x0fe9('0x11'));var Papa=require(_0x0fe9('0x12'));var Redis=require(_0x0fe9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0fe9('0x14'));var as=require(_0x0fe9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fe9('0x16'))(_0x0fe9('0x17'));var utils=require(_0x0fe9('0x18'));var config=require(_0x0fe9('0x19'));var licenseUtil=require(_0x0fe9('0x1a'));var db=require(_0x0fe9('0x1b'))['db'];config[_0x0fe9('0x1c')]=_[_0x0fe9('0x1d')](config[_0x0fe9('0x1c')],{'host':_0x0fe9('0x1e'),'port':0x18eb});var socket=require(_0x0fe9('0x1f'))(new Redis(config[_0x0fe9('0x1c')]));require(_0x0fe9('0x20'))[_0x0fe9('0x21')](socket);var jayson=require(_0x0fe9('0x22'));var client=jayson[_0x0fe9('0x23')][_0x0fe9('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x370c5b,_0x402f02,_0x211815,_0x5af206){return new BPromise(function(_0x83a70f,_0x1e62f5){var _0x2f32fe=_0x5af206||client;return _0x2f32fe[_0x0fe9('0x25')](_0x370c5b,_0x211815)[_0x0fe9('0x26')](function(_0x35270c){logger[_0x0fe9('0x27')]('SmsAccount,\x20%s,\x20%s',_0x402f02,_0x0fe9('0x28'));logger['debug'](_0x0fe9('0x29'),_0x402f02,_0x0fe9('0x28'),JSON[_0x0fe9('0x2a')](_0x35270c));if(_0x35270c['error']){if(_0x35270c[_0x0fe9('0x2b')]['code']===0x1f4){logger[_0x0fe9('0x2b')](_0x0fe9('0x2c'),_0x402f02,_0x35270c[_0x0fe9('0x2b')][_0x0fe9('0x2d')]);return _0x1e62f5(_0x35270c[_0x0fe9('0x2b')][_0x0fe9('0x2d')]);}logger[_0x0fe9('0x2b')]('SmsAccount,\x20%s,\x20%s',_0x402f02,_0x35270c[_0x0fe9('0x2b')][_0x0fe9('0x2d')]);return _0x83a70f(_0x35270c['error']['message']);}else{logger[_0x0fe9('0x27')](_0x0fe9('0x2c'),_0x402f02,_0x0fe9('0x28'));_0x83a70f(_0x35270c['result'][_0x0fe9('0x2d')]);}})['catch'](function(_0x139e15){logger[_0x0fe9('0x2b')](_0x0fe9('0x2c'),_0x402f02,_0x139e15);_0x1e62f5(_0x139e15);});});}function respondWithStatusCode(_0x47f41a,_0x47c8fa){_0x47c8fa=_0x47c8fa||0xcc;return function(_0x1b3546){if(_0x1b3546){return _0x47f41a['sendStatus'](_0x47c8fa);}return _0x47f41a[_0x0fe9('0x2e')](_0x47c8fa)[_0x0fe9('0x2f')]();};}function respondWithResult(_0x500c18,_0x78ab37){_0x78ab37=_0x78ab37||0xc8;return function(_0x5af0cd){if(_0x5af0cd){return _0x500c18[_0x0fe9('0x2e')](_0x78ab37)['json'](_0x5af0cd);}};}function respondWithFilteredResult(_0x3db0a7,_0x53a4e2){return function(_0x2b0027){if(_0x2b0027){var _0x42ceae=typeof _0x53a4e2[_0x0fe9('0x30')]===_0x0fe9('0x31')&&typeof _0x53a4e2['limit']==='undefined';var _0x24501a=_0x2b0027[_0x0fe9('0x32')];var _0x447349=_0x42ceae?0x0:_0x53a4e2[_0x0fe9('0x30')];var _0x3061b2=_0x42ceae?_0x2b0027[_0x0fe9('0x32')]:_0x53a4e2[_0x0fe9('0x30')]+_0x53a4e2[_0x0fe9('0x33')];var _0x3adf0d;if(_0x3061b2>=_0x24501a){_0x3061b2=_0x24501a;_0x3adf0d=0xc8;}else{_0x3adf0d=0xce;}_0x3db0a7[_0x0fe9('0x2e')](_0x3adf0d);return _0x3db0a7[_0x0fe9('0x34')](_0x0fe9('0x35'),_0x447349+'-'+_0x3061b2+'/'+_0x24501a)[_0x0fe9('0x36')](_0x2b0027);}return null;};}function patchUpdates(_0x35f64e){return function(_0x3b2536){try{jsonpatch[_0x0fe9('0x37')](_0x3b2536,_0x35f64e,!![]);}catch(_0x1c9470){return BPromise[_0x0fe9('0x38')](_0x1c9470);}return _0x3b2536[_0x0fe9('0x39')]();};}function saveUpdates(_0x149dbe,_0x5894c8){return function(_0x25e336){if(_0x25e336){return _0x25e336[_0x0fe9('0x3a')](_0x149dbe)[_0x0fe9('0x26')](function(_0x371ba7){return _0x371ba7;});}return null;};}function removeEntity(_0x25f237,_0x45768c){return function(_0x331e3f){if(_0x331e3f){return _0x331e3f[_0x0fe9('0x3b')]()[_0x0fe9('0x26')](function(){var _0x94873f=_0x331e3f[_0x0fe9('0x3c')]({'plain':!![]});var _0x33c470='SmsAccounts';return db[_0x0fe9('0x3d')]['destroy']({'where':{'type':_0x33c470,'resourceId':_0x94873f['id']}})[_0x0fe9('0x26')](function(){return _0x331e3f;});})[_0x0fe9('0x26')](function(){_0x25f237[_0x0fe9('0x2e')](0xcc)[_0x0fe9('0x2f')]();});}};}function handleEntityNotFound(_0x59de60,_0x1d6cbf){return function(_0x253a73){if(!_0x253a73){_0x59de60[_0x0fe9('0x3e')](0x194);}return _0x253a73;};}function handleError(_0x45874f,_0x411404){_0x411404=_0x411404||0x1f4;return function(_0x38252e){logger[_0x0fe9('0x2b')](_0x38252e['stack']);if(_0x38252e[_0x0fe9('0x3f')]){delete _0x38252e[_0x0fe9('0x3f')];}_0x45874f[_0x0fe9('0x2e')](_0x411404)['send'](_0x38252e);};}exports[_0x0fe9('0x40')]=function(_0x146faa,_0x317ee6){var _0x34bbe5={'include':[{'model':db[_0x0fe9('0x41')],'as':_0x0fe9('0x42')}]},_0x36ee8={},_0x4707b3={'count':0x0,'rows':[]};var _0x37cae1=_[_0x0fe9('0x43')](db['SmsAccount'][_0x0fe9('0x44')],function(_0x222aaf){return{'name':_0x222aaf[_0x0fe9('0x45')],'type':_0x222aaf[_0x0fe9('0x46')][_0x0fe9('0x47')]};});_0x36ee8[_0x0fe9('0x48')]=_[_0x0fe9('0x43')](_0x37cae1,_0x0fe9('0x3f'));_0x36ee8[_0x0fe9('0x49')]=_[_0x0fe9('0x4a')](_0x146faa[_0x0fe9('0x49')]);_0x36ee8[_0x0fe9('0x4b')]=_[_0x0fe9('0x4c')](_0x36ee8[_0x0fe9('0x48')],_0x36ee8[_0x0fe9('0x49')]);_0x34bbe5[_0x0fe9('0x4d')]=_[_0x0fe9('0x4c')](_0x36ee8[_0x0fe9('0x48')],qs[_0x0fe9('0x4e')](_0x146faa[_0x0fe9('0x49')]['fields']));_0x34bbe5[_0x0fe9('0x4d')]=_0x34bbe5[_0x0fe9('0x4d')][_0x0fe9('0x4f')]?_0x34bbe5[_0x0fe9('0x4d')]:_0x36ee8['model'];if(!_0x146faa[_0x0fe9('0x49')][_0x0fe9('0x50')](_0x0fe9('0x51'))){_0x34bbe5[_0x0fe9('0x33')]=qs[_0x0fe9('0x33')](_0x146faa[_0x0fe9('0x49')]['limit']);_0x34bbe5['offset']=qs[_0x0fe9('0x30')](_0x146faa[_0x0fe9('0x49')][_0x0fe9('0x30')]);}_0x34bbe5[_0x0fe9('0x52')]=qs[_0x0fe9('0x53')](_0x146faa[_0x0fe9('0x49')][_0x0fe9('0x53')]);_0x34bbe5['where']=qs['filters'](_[_0x0fe9('0x54')](_0x146faa[_0x0fe9('0x49')],_0x36ee8[_0x0fe9('0x4b')]),_0x37cae1);if(_0x146faa[_0x0fe9('0x49')][_0x0fe9('0x55')]){_0x34bbe5['where']=_[_0x0fe9('0x56')](_0x34bbe5['where'],{'$or':_[_0x0fe9('0x43')](_0x37cae1,function(_0x193368){if(_0x193368[_0x0fe9('0x46')]!==_0x0fe9('0x57')){var _0x33983c={};_0x33983c[_0x193368[_0x0fe9('0x3f')]]={'$like':'%'+_0x146faa['query']['filter']+'%'};return _0x33983c;}})});}_0x34bbe5=_[_0x0fe9('0x56')]({},_0x34bbe5,_0x146faa['options']);var _0x266177={'where':_0x34bbe5['where']};return db['SmsAccount'][_0x0fe9('0x32')](_0x266177)['then'](function(_0x4cccc5){_0x4707b3[_0x0fe9('0x32')]=_0x4cccc5;if(_0x146faa[_0x0fe9('0x49')][_0x0fe9('0x58')]){_0x34bbe5[_0x0fe9('0x59')]=[{'all':!![]}];}return db[_0x0fe9('0x5a')][_0x0fe9('0x5b')](_0x34bbe5);})[_0x0fe9('0x26')](function(_0x259161){_0x4707b3['rows']=_0x259161;return _0x4707b3;})[_0x0fe9('0x26')](respondWithFilteredResult(_0x317ee6,_0x34bbe5))[_0x0fe9('0x5c')](handleError(_0x317ee6,null));};exports[_0x0fe9('0x5d')]=function(_0x381820,_0x465ded){var _0x1c4cb7={'raw':![],'where':{'id':_0x381820[_0x0fe9('0x5e')]['id']},'include':[{'model':db[_0x0fe9('0x41')],'as':_0x0fe9('0x42')}]},_0x34ddc3={};_0x34ddc3['model']=_['keys'](db['SmsAccount'][_0x0fe9('0x44')]);_0x34ddc3[_0x0fe9('0x49')]=_[_0x0fe9('0x4a')](_0x381820[_0x0fe9('0x49')]);_0x34ddc3[_0x0fe9('0x4b')]=_['intersection'](_0x34ddc3[_0x0fe9('0x48')],_0x34ddc3[_0x0fe9('0x49')]);_0x1c4cb7[_0x0fe9('0x4d')]=_['intersection'](_0x34ddc3[_0x0fe9('0x48')],qs[_0x0fe9('0x4e')](_0x381820[_0x0fe9('0x49')]['fields']));_0x1c4cb7[_0x0fe9('0x4d')]=_0x1c4cb7[_0x0fe9('0x4d')]['length']?_0x1c4cb7[_0x0fe9('0x4d')]:_0x34ddc3[_0x0fe9('0x48')];if(_0x381820[_0x0fe9('0x49')][_0x0fe9('0x58')]){_0x1c4cb7[_0x0fe9('0x59')]=[{'all':!![]}];}_0x1c4cb7=_['merge']({},_0x1c4cb7,_0x381820[_0x0fe9('0x5f')]);return db['SmsAccount'][_0x0fe9('0x60')](_0x1c4cb7)[_0x0fe9('0x26')](handleEntityNotFound(_0x465ded,null))['then'](respondWithResult(_0x465ded,null))[_0x0fe9('0x5c')](handleError(_0x465ded,null));};exports[_0x0fe9('0x61')]=function(_0x2116d0,_0x24f725){return db[_0x0fe9('0x5a')][_0x0fe9('0x61')](_0x2116d0[_0x0fe9('0x62')],{})[_0x0fe9('0x26')](function(_0x1eab81){var _0x4ef4db=_0x2116d0[_0x0fe9('0x63')]['get']({'plain':!![]});if(!_0x4ef4db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ef4db[_0x0fe9('0x64')]===_0x0fe9('0x63')){var _0x1fda4c=_0x1eab81[_0x0fe9('0x3c')]({'plain':!![]});var _0xb11505='SmsAccounts';return db[_0x0fe9('0x65')]['find']({'where':{'name':_0xb11505,'userProfileId':_0x4ef4db[_0x0fe9('0x66')]},'raw':!![]})[_0x0fe9('0x26')](function(_0x4f4b8f){if(_0x4f4b8f&&_0x4f4b8f['autoAssociation']===0x0){return db['UserProfileResource'][_0x0fe9('0x61')]({'name':_0x1fda4c[_0x0fe9('0x3f')],'resourceId':_0x1fda4c['id'],'type':_0x4f4b8f[_0x0fe9('0x3f')],'sectionId':_0x4f4b8f['id']},{})[_0x0fe9('0x26')](function(){return _0x1eab81;});}else{return _0x1eab81;}})['catch'](function(_0x2110ab){logger['error'](_0x0fe9('0x67'),_0x2110ab);throw _0x2110ab;});}return _0x1eab81;})[_0x0fe9('0x26')](respondWithResult(_0x24f725,0xc9))[_0x0fe9('0x5c')](handleError(_0x24f725,null));};exports['update']=function(_0x198be3,_0x2f16cb){if(_0x198be3[_0x0fe9('0x62')]['id']){delete _0x198be3['body']['id'];}return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x198be3[_0x0fe9('0x5e')]['id']},'include':[{'model':db[_0x0fe9('0x41')],'as':_0x0fe9('0x42')}]})[_0x0fe9('0x26')](handleEntityNotFound(_0x2f16cb,null))[_0x0fe9('0x26')](saveUpdates(_0x198be3['body'],null))[_0x0fe9('0x26')](respondWithResult(_0x2f16cb,null))['catch'](handleError(_0x2f16cb,null));};exports[_0x0fe9('0x3b')]=function(_0x32a43a,_0x45ac20){return db['SmsAccount']['find']({'where':{'id':_0x32a43a[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x45ac20,null))[_0x0fe9('0x26')](removeEntity(_0x45ac20,null))[_0x0fe9('0x5c')](handleError(_0x45ac20,null));};exports['describe']=function(_0x12ac53,_0x1f4d46){return db[_0x0fe9('0x5a')][_0x0fe9('0x68')]()[_0x0fe9('0x26')](respondWithResult(_0x1f4d46,null))[_0x0fe9('0x5c')](handleError(_0x1f4d46,null));};exports[_0x0fe9('0x69')]=function(_0x57c03f,_0x109849,_0xe7f7b9){if(_0x57c03f[_0x0fe9('0x62')]['id']){delete _0x57c03f[_0x0fe9('0x62')]['id'];}return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x57c03f[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x109849,null))[_0x0fe9('0x26')](function(_0x495100){if(_0x495100){_0x57c03f[_0x0fe9('0x62')]['SmsAccountId']=_0x495100['id'];return db[_0x0fe9('0x6a')]['create'](_0x57c03f['body']);}})[_0x0fe9('0x26')](respondWithResult(_0x109849,null))['catch'](handleError(_0x109849,null));};exports[_0x0fe9('0x6b')]=function(_0x198bc2,_0x1f8c48,_0x137041){var _0x185409={'raw':![],'where':{}};var _0x252179={};var _0xe5470a={'count':0x0,'rows':[]};return db[_0x0fe9('0x5a')]['findOne']({'where':{'id':_0x198bc2[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x1f8c48,null))['then'](function(_0x28fae5){if(_0x28fae5){_0x252179['model']=_['keys'](db[_0x0fe9('0x6a')][_0x0fe9('0x44')]);_0x252179['query']=_[_0x0fe9('0x4a')](_0x198bc2[_0x0fe9('0x49')]);_0x252179[_0x0fe9('0x4b')]=_['intersection'](_0x252179['model'],_0x252179[_0x0fe9('0x49')]);_0x185409[_0x0fe9('0x4d')]=_[_0x0fe9('0x4c')](_0x252179[_0x0fe9('0x48')],qs[_0x0fe9('0x4e')](_0x198bc2[_0x0fe9('0x49')][_0x0fe9('0x4e')]));_0x185409[_0x0fe9('0x4d')]=_0x185409[_0x0fe9('0x4d')]['length']?_0x185409[_0x0fe9('0x4d')]:_0x252179[_0x0fe9('0x48')];if(!_0x198bc2[_0x0fe9('0x49')][_0x0fe9('0x50')](_0x0fe9('0x51'))){_0x185409['limit']=qs['limit'](_0x198bc2[_0x0fe9('0x49')][_0x0fe9('0x33')]);_0x185409[_0x0fe9('0x30')]=qs[_0x0fe9('0x30')](_0x198bc2[_0x0fe9('0x49')]['offset']);}_0x185409[_0x0fe9('0x52')]=qs[_0x0fe9('0x53')](_0x198bc2[_0x0fe9('0x49')][_0x0fe9('0x53')]);_0x185409[_0x0fe9('0x6c')]=qs[_0x0fe9('0x4b')](_[_0x0fe9('0x54')](_0x198bc2['query'],_0x252179['filters']));_0x185409['where']['SmsAccountId']=_0x28fae5['id'];if(_0x198bc2[_0x0fe9('0x49')]['filter']){_0x185409['where']=_[_0x0fe9('0x56')](_0x185409[_0x0fe9('0x6c')],{'$or':_[_0x0fe9('0x43')](_0x185409[_0x0fe9('0x4d')],function(_0x31aedc){var _0x58e591={};_0x58e591[_0x31aedc]={'$like':'%'+_0x198bc2[_0x0fe9('0x49')][_0x0fe9('0x55')]+'%'};return _0x58e591;})});}_0x185409=_['merge']({},_0x185409,_0x198bc2['options']);return db[_0x0fe9('0x6a')]['count']({'where':_0x185409[_0x0fe9('0x6c')]})[_0x0fe9('0x26')](function(_0x390ff7){_0xe5470a[_0x0fe9('0x32')]=_0x390ff7;if(_0x198bc2[_0x0fe9('0x49')][_0x0fe9('0x58')]){_0x185409[_0x0fe9('0x59')]=[{'all':!![]}];}return db[_0x0fe9('0x6a')][_0x0fe9('0x5b')](_0x185409);})[_0x0fe9('0x26')](function(_0x1e9fec){_0xe5470a[_0x0fe9('0x6d')]=_0x1e9fec;return _0xe5470a;});}})[_0x0fe9('0x26')](respondWithFilteredResult(_0x1f8c48,_0x185409))[_0x0fe9('0x5c')](handleError(_0x1f8c48,null));};exports[_0x0fe9('0x6e')]=function(_0x50e1f2,_0x392ef7,_0x4ce825){return db[_0x0fe9('0x5a')]['find']({'where':{'id':_0x50e1f2['params']['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x392ef7,null))['then'](function(_0x833f96){if(_0x833f96){return _0x833f96[_0x0fe9('0x6e')](_0x50e1f2[_0x0fe9('0x49')][_0x0fe9('0x6f')]);}})['then'](respondWithStatusCode(_0x392ef7,null))['catch'](handleError(_0x392ef7,null));};exports[_0x0fe9('0x70')]=function(_0x290cb2,_0x46ed41,_0x5a22ac){if(_0x290cb2[_0x0fe9('0x62')]['id']){delete _0x290cb2[_0x0fe9('0x62')]['id'];}return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x290cb2['params']['id']}})['then'](handleEntityNotFound(_0x46ed41,null))[_0x0fe9('0x26')](function(_0x3ce292){if(_0x3ce292){_0x290cb2[_0x0fe9('0x62')][_0x0fe9('0x71')]=_0x3ce292['id'];return db['CannedAnswer']['create'](_0x290cb2[_0x0fe9('0x62')]);}})[_0x0fe9('0x26')](respondWithResult(_0x46ed41,null))[_0x0fe9('0x5c')](handleError(_0x46ed41,null));};exports['getAnswers']=function(_0x4379c7,_0x3fe616,_0x79e590){var _0x46755c={'raw':![],'where':{}};var _0x324ee5={};var _0x6df5b5={'count':0x0,'rows':[]};return db[_0x0fe9('0x5a')][_0x0fe9('0x72')]({'where':{'id':_0x4379c7['params']['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x3fe616,null))[_0x0fe9('0x26')](function(_0x51929c){if(_0x51929c){_0x324ee5['model']=_[_0x0fe9('0x4a')](db['CannedAnswer'][_0x0fe9('0x44')]);_0x324ee5[_0x0fe9('0x49')]=_['keys'](_0x4379c7['query']);_0x324ee5[_0x0fe9('0x4b')]=_[_0x0fe9('0x4c')](_0x324ee5[_0x0fe9('0x48')],_0x324ee5[_0x0fe9('0x49')]);_0x46755c[_0x0fe9('0x4d')]=_[_0x0fe9('0x4c')](_0x324ee5[_0x0fe9('0x48')],qs[_0x0fe9('0x4e')](_0x4379c7['query'][_0x0fe9('0x4e')]));_0x46755c[_0x0fe9('0x4d')]=_0x46755c[_0x0fe9('0x4d')][_0x0fe9('0x4f')]?_0x46755c[_0x0fe9('0x4d')]:_0x324ee5[_0x0fe9('0x48')];if(!_0x4379c7[_0x0fe9('0x49')][_0x0fe9('0x50')](_0x0fe9('0x51'))){_0x46755c[_0x0fe9('0x33')]=qs['limit'](_0x4379c7[_0x0fe9('0x49')]['limit']);_0x46755c[_0x0fe9('0x30')]=qs[_0x0fe9('0x30')](_0x4379c7['query'][_0x0fe9('0x30')]);}_0x46755c[_0x0fe9('0x52')]=qs['sort'](_0x4379c7[_0x0fe9('0x49')][_0x0fe9('0x53')]);_0x46755c[_0x0fe9('0x6c')]=qs[_0x0fe9('0x4b')](_[_0x0fe9('0x54')](_0x4379c7[_0x0fe9('0x49')],_0x324ee5[_0x0fe9('0x4b')]));_0x46755c[_0x0fe9('0x6c')][_0x0fe9('0x71')]=_0x51929c['id'];if(_0x4379c7[_0x0fe9('0x49')][_0x0fe9('0x55')]){_0x46755c['where']=_[_0x0fe9('0x56')](_0x46755c[_0x0fe9('0x6c')],{'$or':_['map'](_0x46755c['attributes'],function(_0x308cb5){var _0x2cc6e9={};_0x2cc6e9[_0x308cb5]={'$like':'%'+_0x4379c7[_0x0fe9('0x49')][_0x0fe9('0x55')]+'%'};return _0x2cc6e9;})});}_0x46755c=_['merge']({},_0x46755c,_0x4379c7['options']);return db[_0x0fe9('0x73')][_0x0fe9('0x32')]({'where':_0x46755c[_0x0fe9('0x6c')]})['then'](function(_0x429024){_0x6df5b5[_0x0fe9('0x32')]=_0x429024;if(_0x4379c7['query'][_0x0fe9('0x58')]){_0x46755c['include']=[{'all':!![]}];}return db[_0x0fe9('0x73')][_0x0fe9('0x5b')](_0x46755c);})['then'](function(_0x1499c4){_0x6df5b5[_0x0fe9('0x6d')]=_0x1499c4;return _0x6df5b5;});}})[_0x0fe9('0x26')](respondWithFilteredResult(_0x3fe616,_0x46755c))[_0x0fe9('0x5c')](handleError(_0x3fe616,null));};exports[_0x0fe9('0x74')]=function(_0x2e55db,_0x3eeaaa,_0x15560c){return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x2e55db[_0x0fe9('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3eeaaa,null))['then'](function(_0x55027f){if(_0x55027f){return _0x55027f[_0x0fe9('0x74')](_0x2e55db[_0x0fe9('0x49')][_0x0fe9('0x6f')]);}})[_0x0fe9('0x26')](respondWithStatusCode(_0x3eeaaa,null))[_0x0fe9('0x5c')](handleError(_0x3eeaaa,null));};exports[_0x0fe9('0x75')]=function(_0x35a783,_0x41ba54,_0x2248fa){var _0x44859f={'channel':'sms'};var _0x5574d7=[];var _0x40b444=[];var _0x347a87={};return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x35a783[_0x0fe9('0x5e')]['id']},'include':[{'model':db[_0x0fe9('0x76')],'as':_0x0fe9('0x77')}]})[_0x0fe9('0x26')](handleEntityNotFound(_0x41ba54,null))[_0x0fe9('0x26')](function(_0x3653e8){_0x44859f[_0x0fe9('0x78')]=_0x3653e8;_0x44859f[_0x0fe9('0x79')]=_['orderBy'](_0x3653e8['Applications'],[_0x0fe9('0x7a')],[_0x0fe9('0x7b')]);if(_0x44859f[_0x0fe9('0x78')][_0x0fe9('0x77')]){delete _0x44859f[_0x0fe9('0x78')]['Applications'];}return db[_0x0fe9('0x7c')][_0x0fe9('0x68')]();})[_0x0fe9('0x26')](function(_0x587ea2){if(!_0x587ea2){throw new db[(_0x0fe9('0x7d'))][(_0x0fe9('0x7e'))](_0x0fe9('0x7f'));}_0x5574d7=_[_0x0fe9('0x80')](_[_0x0fe9('0x4a')](_0x587ea2),[_0x0fe9('0x81'),'updatedAt']);_0x40b444=_[_0x0fe9('0x80')](_['keys'](_0x587ea2),[_0x0fe9('0x81'),_0x0fe9('0x82'),_0x0fe9('0x83'),_0x0fe9('0x84')]);_0x44859f[_0x0fe9('0x62')]={'mapKey':_0x0fe9('0x85')};if(_0x44859f['account'][_0x0fe9('0x46')]){switch(_0x44859f[_0x0fe9('0x78')][_0x0fe9('0x46')]){case _0x0fe9('0x86'):_0x44859f['body'][_0x0fe9('0x87')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x88')];_0x44859f['body'][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')]['Body'];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x89')]=_0x35a783['body'][_0x0fe9('0x8a')];break;case'skebby':_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')]='+'+_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x8b')];_0x44859f['body'][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x8c')];break;case _0x0fe9('0x8d'):_0x44859f['body'][_0x0fe9('0x87')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x87')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x2d')];break;case _0x0fe9('0x8e'):_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x87')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x62')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x89')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x8f')];break;case _0x0fe9('0x90'):_0x44859f['body'][_0x0fe9('0x87')]=_0x35a783[_0x0fe9('0x62')]['From'];_0x44859f[_0x0fe9('0x62')]['body']=_0x35a783[_0x0fe9('0x62')]['Text'];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x89')]=_0x35a783[_0x0fe9('0x62')]['MessageUUID'];break;case _0x0fe9('0x91'):_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')]='+'+_0x35a783[_0x0fe9('0x62')]['results'][0x0][_0x0fe9('0x87')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x92')][0x0][_0x0fe9('0x8c')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x89')]=_0x35a783[_0x0fe9('0x62')]['results'][0x0][_0x0fe9('0x89')];break;case _0x0fe9('0x93'):_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')]=_0x35a783[_0x0fe9('0x62')]['originatingAddress'];_0x44859f['body'][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')]['segmentedMessage'][_0x0fe9('0x2d')];break;case _0x0fe9('0x94'):_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x95')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x62')]=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x8c')];_0x44859f['body']['messageId']=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x96')];break;case _0x0fe9('0x97'):_0x44859f['body']['messageId']=_0x35a783['body'][0x0][_0x0fe9('0x2d')]['id'];_0x44859f[_0x0fe9('0x62')]['from']=_0x35a783[_0x0fe9('0x62')][0x0][_0x0fe9('0x2d')][_0x0fe9('0x87')];_0x44859f['body'][_0x0fe9('0x62')]=_0x35a783['body'][0x0][_0x0fe9('0x2d')][_0x0fe9('0x8c')];break;case'intelepeer':_0x44859f[_0x0fe9('0x62')]['from']=_0x35a783[_0x0fe9('0x62')][_0x0fe9('0x87')];_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x62')]=_0x35a783['body'][_0x0fe9('0x2d')];_0x44859f['body']['messageId']=_0x35a783['body']['refid'];break;}}if(_0x44859f[_0x0fe9('0x62')]['id']){delete _0x44859f[_0x0fe9('0x62')]['id'];}if(_[_0x0fe9('0x98')](_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')])){throw new db['Sequelize'][(_0x0fe9('0x7e'))](_0x0fe9('0x99'));}if(_[_0x0fe9('0x98')](_0x44859f[_0x0fe9('0x62')]['body'])||_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x62')]===''){throw new db[(_0x0fe9('0x7d'))][(_0x0fe9('0x7e'))](_0x0fe9('0x9a'));}if(_[_0x0fe9('0x98')](_0x44859f[_0x0fe9('0x62')]['mapKey'])){throw new db[(_0x0fe9('0x7d'))][(_0x0fe9('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x40b444);}if(!_[_0x0fe9('0x9b')](_0x40b444,_0x44859f['body'][_0x0fe9('0x9c')])){throw new db[(_0x0fe9('0x7d'))][(_0x0fe9('0x7e'))](_0x0fe9('0x9d')+_0x40b444);}_0x347a87[_0x44859f['body'][_0x0fe9('0x9c')]]=_0x44859f[_0x0fe9('0x62')]['from'];return db[_0x0fe9('0x9e')][_0x0fe9('0x60')]({'where':{'id':_0x44859f['account'][_0x0fe9('0x84')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x347a87,'limit':0x1,'order':[[_0x0fe9('0x82'),'DESC']]}]});})['then'](handleEntityNotFound(_0x41ba54,null))[_0x0fe9('0x26')](function(_0x11ccec){if(_0x11ccec){_0x44859f['list']=_[_0x0fe9('0x9f')](_0x11ccec,[_0x0fe9('0xa0')]);if(_0x11ccec[_0x0fe9('0xa0')][_0x0fe9('0x4f')]){return _0x11ccec[_0x0fe9('0xa0')][0x0];}var _0x18dddf=_[_0x0fe9('0x1d')](_0x44859f[_0x0fe9('0x62')],{'firstName':_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x87')],'ListId':_0x11ccec['id']});_0x18dddf[_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x9c')]]=_0x44859f['body'][_0x0fe9('0x87')];return db['CmContact'][_0x0fe9('0x61')](_0x18dddf,{'fields':_0x5574d7,'raw':!![]});}})[_0x0fe9('0x26')](handleEntityNotFound(_0x41ba54,null))[_0x0fe9('0x26')](function(_0xeb883e){if(_0xeb883e){_0x44859f[_0x0fe9('0xa1')]=_0xeb883e;var _0x31a550={'ContactId':_0xeb883e['id'],'phone':_0x44859f[_0x0fe9('0x62')]['from'],'SmsAccountId':_0x35a783['params']['id']};var _0x5b81c4={'ContactId':_0xeb883e['id'],'SmsAccountId':_0x35a783['params']['id'],'closed':![]};return db[_0x0fe9('0xa2')][_0x0fe9('0x60')]({'where':_0x5b81c4})['then'](function(_0x5c700a){if(_0x5c700a){return[_0x5c700a,![]];}return db[_0x0fe9('0xa2')][_0x0fe9('0x61')](_0x31a550)[_0x0fe9('0x26')](function(_0x5bc342){return[_0x5bc342,!![]];});});}})[_0x0fe9('0xa3')](function(_0x337faa,_0x3fb6ef){_0x44859f[_0x0fe9('0xa4')]=_0x337faa[_0x0fe9('0x3c')]({'plain':!![]});_0x44859f[_0x0fe9('0xa4')][_0x0fe9('0xa5')]=![];if(_0x3fb6ef){if(_0x44859f[_0x0fe9('0x78')][_0x0fe9('0xa6')]){_0x44859f[_0x0fe9('0x79')][_0x0fe9('0xa7')]({'id':0x0,'priority':_0x44859f[_0x0fe9('0x79')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x0fe9('0xa8')});}_0x44859f[_0x0fe9('0xa4')][_0x0fe9('0xa5')]=!![];}return db[_0x0fe9('0xa9')]['create']({'phone':_0x44859f[_0x0fe9('0x62')]['from'],'messageId':_0x44859f[_0x0fe9('0x62')][_0x0fe9('0x89')],'body':_0x44859f['body'][_0x0fe9('0x62')],'SmsAccountId':_0x35a783[_0x0fe9('0x5e')]['id'],'SmsInteractionId':_0x337faa['id'],'direction':'in','ContactId':_0x337faa[_0x0fe9('0xaa')],'AttachmentId':_0x44859f['body'][_0x0fe9('0xab')]});})[_0x0fe9('0x26')](function(_0x552c85){_0x44859f['message']=_0x552c85;if(_0x44859f['interaction']['UserId']){return db[_0x0fe9('0xac')][_0x0fe9('0x60')]({'attributes':['id',_0x0fe9('0x3f')],'where':{'id':_0x44859f[_0x0fe9('0xa4')]['UserId']}})[_0x0fe9('0x26')](function(_0x18fdc9){if(_0x18fdc9){_0x44859f[_0x0fe9('0x79')][_0x0fe9('0xad')]({'id':0x0,'priority':0x0,'app':_0x0fe9('0xae'),'appdata':_0x18fdc9['name']+','+(_0x44859f['account'][_0x0fe9('0xaf')]||0xa),'interval':_0x0fe9('0xa8')});}return respondWithRpcPromise(_0x0fe9('0xb0'),'startRouting',_0x44859f);});}return respondWithRpcPromise(_0x0fe9('0xb0'),_0x0fe9('0xb1'),_0x44859f);})['then'](function(_0x170519){if(_0x170519){var _0x4233d4=0xc8;var _0x220e55=_0x0fe9('0xb2');logger[_0x0fe9('0x27')](_0x0fe9('0x29'),_0x220e55,_0x4233d4,_0x0fe9('0xb3'));logger[_0x0fe9('0xb4')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x220e55,_0x4233d4,_0x0fe9('0xb3'),JSON['stringify'](_0x170519));if(_0x44859f[_0x0fe9('0x78')][_0x0fe9('0x46')]==='twilio'){return _0x41ba54[_0x0fe9('0x2e')](_0x4233d4)[_0x0fe9('0x34')](_0x0fe9('0xb5'),_0x0fe9('0xb6'))[_0x0fe9('0xb7')](_0x0fe9('0xb8'));}else{return _0x41ba54[_0x0fe9('0x2e')](_0x4233d4)[_0x0fe9('0x36')](_0x170519);}}})[_0x0fe9('0x5c')](handleError(_0x41ba54,null));};exports[_0x0fe9('0xb9')]=function(_0x4c20ce,_0x4fe06b){var _0x3a1de4=_0x4c20ce[_0x0fe9('0x5e')]['id'];var _0x4c0e0f=_0x4c20ce[_0x0fe9('0x62')];var _0x20e1ce=0xc8;var _0x2395a6=null;return db['sequelize'][_0x0fe9('0xba')]({'isolationLevel':db[_0x0fe9('0xbb')][_0x0fe9('0xbc')][_0x0fe9('0xbd')][_0x0fe9('0xbe')]},function(_0x395d40){return db[_0x0fe9('0x5a')]['findOne']({'where':{'id':_0x3a1de4},'transaction':_0x395d40})[_0x0fe9('0x26')](function(_0x3efebb){if(_0x3efebb){return db[_0x0fe9('0x76')][_0x0fe9('0x3b')]({'where':{'SmsAccountId':_0x3a1de4},'transaction':_0x395d40})[_0x0fe9('0x26')](function(){var _0x50acc1=_[_0x0fe9('0x43')](_0x4c0e0f,function(_0x4282f4){_0x4282f4['SmsAccountId']=_0x3a1de4;return _0x4282f4;});return db[_0x0fe9('0x76')]['bulkCreate'](_0x50acc1,{'transaction':_0x395d40});});}else{_0x20e1ce=0x194;_0x2395a6=[];}});})[_0x0fe9('0x26')](function(){if(_0x20e1ce!==0x194){return db[_0x0fe9('0x76')][_0x0fe9('0xbf')]({'where':{'SmsAccountId':_0x3a1de4},'order':_0x0fe9('0x7a')})[_0x0fe9('0x26')](function(_0x3c8df1){_0x2395a6=_0x3c8df1;});}})[_0x0fe9('0x5c')](function(_0x28cf36){_0x20e1ce=0x1f4;logger[_0x0fe9('0x2b')](_0x28cf36[_0x0fe9('0xc0')]);if(_0x28cf36[_0x0fe9('0x3f')]){delete _0x28cf36[_0x0fe9('0x3f')];}_0x2395a6=_0x28cf36;})[_0x0fe9('0xc1')](function(){if(_0x2395a6===null){_0x4fe06b['sendStatus'](_0x20e1ce);}else{if(_0x20e1ce===0x1f4){_0x4fe06b[_0x0fe9('0x2e')](_0x20e1ce)[_0x0fe9('0xb7')](_0x2395a6);}else{_0x4fe06b[_0x0fe9('0x2e')](_0x20e1ce)[_0x0fe9('0x36')](_0x2395a6);}}});};exports[_0x0fe9('0xc2')]=function(_0x509729,_0x472773,_0x3a4fea){var _0x6f614c={};var _0xd0f4ea={};var _0x1798af;var _0x18c673;return db['SmsAccount'][_0x0fe9('0x72')]({'where':{'id':_0x509729[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x472773,null))[_0x0fe9('0x26')](function(_0x36266c){if(_0x36266c){_0x1798af=_0x36266c;_0xd0f4ea[_0x0fe9('0x48')]=_[_0x0fe9('0x4a')](db[_0x0fe9('0x76')][_0x0fe9('0x44')]);_0xd0f4ea[_0x0fe9('0x49')]=_[_0x0fe9('0x4a')](_0x509729[_0x0fe9('0x49')]);_0xd0f4ea[_0x0fe9('0x4b')]=_[_0x0fe9('0x4c')](_0xd0f4ea['model'],_0xd0f4ea[_0x0fe9('0x49')]);_0x6f614c[_0x0fe9('0x4d')]=_['intersection'](_0xd0f4ea[_0x0fe9('0x48')],qs[_0x0fe9('0x4e')](_0x509729[_0x0fe9('0x49')][_0x0fe9('0x4e')]));_0x6f614c[_0x0fe9('0x4d')]=_0x6f614c[_0x0fe9('0x4d')][_0x0fe9('0x4f')]?_0x6f614c['attributes']:_0xd0f4ea[_0x0fe9('0x48')];_0x6f614c[_0x0fe9('0x52')]=qs[_0x0fe9('0x53')](_0x509729[_0x0fe9('0x49')][_0x0fe9('0x53')]);_0x6f614c[_0x0fe9('0x6c')]=qs[_0x0fe9('0x4b')](_[_0x0fe9('0x54')](_0x509729[_0x0fe9('0x49')],_0xd0f4ea[_0x0fe9('0x4b')]));if(_0x509729['query'][_0x0fe9('0x55')]){_0x6f614c[_0x0fe9('0x6c')]=_[_0x0fe9('0x56')](_0x6f614c[_0x0fe9('0x6c')],{'$or':_['map'](_0x6f614c[_0x0fe9('0x4d')],function(_0x48488e){var _0x37eae3={};_0x37eae3[_0x48488e]={'$like':'%'+_0x509729[_0x0fe9('0x49')]['filter']+'%'};return _0x37eae3;})});}_0x6f614c=_[_0x0fe9('0x56')]({},_0x6f614c,_0x509729['options']);return _0x1798af[_0x0fe9('0xc2')](_0x6f614c);}})[_0x0fe9('0x26')](function(_0x490b27){if(_0x490b27){_0x18c673=_0x490b27[_0x0fe9('0x4f')];if(!_0x509729['query'][_0x0fe9('0x50')](_0x0fe9('0x51'))){_0x6f614c['limit']=qs[_0x0fe9('0x33')](_0x509729[_0x0fe9('0x49')][_0x0fe9('0x33')]);_0x6f614c['offset']=qs[_0x0fe9('0x30')](_0x509729[_0x0fe9('0x49')][_0x0fe9('0x30')]);}return _0x1798af[_0x0fe9('0xc2')](_0x6f614c);}})[_0x0fe9('0x26')](function(_0x1588fd){if(_0x1588fd){return _0x1588fd?{'count':_0x18c673,'rows':_0x1588fd}:null;}})['then'](respondWithResult(_0x472773,null))[_0x0fe9('0x5c')](handleError(_0x472773,null));};exports['getInteractions']=function(_0x3691ad,_0x424b44,_0x3900dd){var _0x6001df={'raw':![],'where':{}};var _0xc3b4fb={};var _0x21f48b={'count':0x0,'rows':[]};return db[_0x0fe9('0x5a')][_0x0fe9('0x72')]({'where':{'id':_0x3691ad[_0x0fe9('0x5e')]['id']}})['then'](handleEntityNotFound(_0x424b44,null))['then'](function(_0x3dd359){if(_0x3dd359){_0xc3b4fb[_0x0fe9('0x48')]=_[_0x0fe9('0x4a')](db[_0x0fe9('0xa2')][_0x0fe9('0x44')]);_0xc3b4fb[_0x0fe9('0x49')]=_['keys'](_0x3691ad[_0x0fe9('0x49')]);_0xc3b4fb[_0x0fe9('0x4b')]=_['intersection'](_0xc3b4fb[_0x0fe9('0x48')],_0xc3b4fb['query']);_0x6001df[_0x0fe9('0x4d')]=_['intersection'](_0xc3b4fb[_0x0fe9('0x48')],qs[_0x0fe9('0x4e')](_0x3691ad[_0x0fe9('0x49')][_0x0fe9('0x4e')]));_0x6001df[_0x0fe9('0x4d')]=_0x6001df[_0x0fe9('0x4d')][_0x0fe9('0x4f')]?_0x6001df[_0x0fe9('0x4d')]:_0xc3b4fb['model'];if(!_0x3691ad['query'][_0x0fe9('0x50')]('nolimit')){_0x6001df['limit']=qs[_0x0fe9('0x33')](_0x3691ad[_0x0fe9('0x49')][_0x0fe9('0x33')]);_0x6001df[_0x0fe9('0x30')]=qs['offset'](_0x3691ad['query']['offset']);}_0x6001df['order']=qs['sort'](_0x3691ad[_0x0fe9('0x49')][_0x0fe9('0x53')]);_0x6001df[_0x0fe9('0x6c')]=qs['filters'](_[_0x0fe9('0x54')](_0x3691ad[_0x0fe9('0x49')],_0xc3b4fb[_0x0fe9('0x4b')]));_0x6001df[_0x0fe9('0x6c')]['SmsAccountId']=_0x3dd359['id'];if(_0x3691ad['query'][_0x0fe9('0x55')]){_0x6001df[_0x0fe9('0x6c')]=_[_0x0fe9('0x56')](_0x6001df[_0x0fe9('0x6c')],{'$or':_[_0x0fe9('0x43')](_0x6001df[_0x0fe9('0x4d')],function(_0x2799aa){var _0x444f68={};_0x444f68[_0x2799aa]={'$like':'%'+_0x3691ad[_0x0fe9('0x49')]['filter']+'%'};return _0x444f68;})});}_0x6001df=_[_0x0fe9('0x56')]({},_0x6001df,_0x3691ad[_0x0fe9('0x5f')]);return db[_0x0fe9('0xa2')][_0x0fe9('0x32')]({'where':_0x6001df['where']})[_0x0fe9('0x26')](function(_0x4a4543){_0x21f48b['count']=_0x4a4543;if(_0x3691ad[_0x0fe9('0x49')]['includeAll']){_0x6001df['include']=[{'model':db[_0x0fe9('0x7c')],'as':_0x0fe9('0xc3'),'required':![]},{'model':db[_0x0fe9('0xac')],'as':_0x0fe9('0xc4'),'attributes':['name',_0x0fe9('0xc5'),_0x0fe9('0xc6')],'required':![]},{'model':db['Tag'],'as':_0x0fe9('0xc7'),'attributes':['id',_0x0fe9('0x3f'),_0x0fe9('0xc8')],'where':_0x3691ad[_0x0fe9('0x49')][_0x0fe9('0xc9')]?{'id':_0x3691ad['query'][_0x0fe9('0xc9')]}:undefined,'required':_0x3691ad['query'][_0x0fe9('0xc9')]?!![]:![]}];}return db[_0x0fe9('0xa2')]['findAll'](_0x6001df);})[_0x0fe9('0x26')](function(_0x3e7c20){_0x21f48b['rows']=_0x3e7c20;return _0x21f48b;});}})[_0x0fe9('0x26')](respondWithFilteredResult(_0x424b44,_0x6001df))['catch'](handleError(_0x424b44,null));};exports[_0x0fe9('0xb7')]=function(_0x5ac9ab,_0x3fc3ed,_0x15ebb7){var _0x43913c,_0x1d8ec5,_0x5ec3c6;if(_['isNil'](_0x5ac9ab['body'][_0x0fe9('0x62')])||_0x5ac9ab['body'][_0x0fe9('0x62')]===''){throw new db[(_0x0fe9('0x7d'))][(_0x0fe9('0x7e'))](_0x0fe9('0x9a'));}if(_['isNil'](_0x5ac9ab[_0x0fe9('0x62')]['to'])){throw new db[(_0x0fe9('0x7d'))][(_0x0fe9('0x7e'))]('to\x20is\x20mandatory');}_0x43913c=_0x5ac9ab[_0x0fe9('0x62')]['to'];return db[_0x0fe9('0x5a')]['find']({'where':{'id':_0x5ac9ab['params']['id']},'include':[{'model':db[_0x0fe9('0x9e')],'as':_0x0fe9('0xca'),'include':[{'model':db[_0x0fe9('0x7c')],'as':_0x0fe9('0xa0'),'where':{'mobile':_0x43913c},'limit':0x1,'order':[['updatedAt',_0x0fe9('0xcb')]]}]}]})[_0x0fe9('0x26')](handleEntityNotFound(_0x3fc3ed,null))[_0x0fe9('0x26')](function(_0x1b4ba1){if(_0x1b4ba1&&_0x1b4ba1[_0x0fe9('0xca')]){_0x1d8ec5=_0x1b4ba1['get']({'plain':!![]});if(_0x1d8ec5[_0x0fe9('0xca')]&&_0x1d8ec5[_0x0fe9('0xca')][_0x0fe9('0xa0')]['length']){return _0x1d8ec5[_0x0fe9('0xca')]['Contacts'][0x0];}return db[_0x0fe9('0x7c')][_0x0fe9('0x61')](_[_0x0fe9('0x1d')](_0x5ac9ab[_0x0fe9('0x62')],{'firstName':_0x43913c,'mobile':_0x43913c,'phone':_0x43913c,'ListId':_0x1d8ec5[_0x0fe9('0x84')]}));}})[_0x0fe9('0x26')](handleEntityNotFound(_0x3fc3ed,null))[_0x0fe9('0x26')](function(_0x374425){if(_0x374425){_0x5ec3c6=_0x374425;return db['SmsInteraction'][_0x0fe9('0x60')]({'where':{'ContactId':_0x5ec3c6['id'],'closed':![],'SmsAccountId':_0x1d8ec5['id']}})[_0x0fe9('0x26')](function(_0x518d69){if(_0x518d69){return[_0x518d69,![]];}return db[_0x0fe9('0xa2')][_0x0fe9('0x61')]({'UserId':_0x5ac9ab[_0x0fe9('0x63')]['id'],'ContactId':_0x5ec3c6['id'],'SmsAccountId':_0x1d8ec5['id'],'phone':_0x43913c,'firstMsgDirection':_0x0fe9('0xcc'),'Messages':[_[_0x0fe9('0x56')](_0x5ac9ab[_0x0fe9('0x62')],{'read':![],'body':_0x5ac9ab['body'][_0x0fe9('0x62')],'phone':_0x43913c,'SmsAccountId':_0x1d8ec5['id'],'UserId':_0x5ac9ab[_0x0fe9('0x63')]['id'],'ContactId':_0x5ec3c6['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x0fe9('0xcd')}]})[_0x0fe9('0x26')](function(_0x68149b){return[_0x68149b,!![]];});});}})['spread'](function(_0x4787a6,_0x469587){if(_0x469587){return _0x4787a6;}return db[_0x0fe9('0xa9')][_0x0fe9('0x61')](_[_0x0fe9('0x56')](_0x5ac9ab[_0x0fe9('0x62')],{'read':![],'body':_0x5ac9ab[_0x0fe9('0x62')][_0x0fe9('0x62')],'phone':_0x43913c,'SmsAccountId':_0x1d8ec5['id'],'SmsInteractionId':_0x4787a6['id'],'UserId':_0x5ac9ab['user']['id'],'ContactId':_0x5ec3c6['id']}))[_0x0fe9('0x26')](function(_0x13f611){_0x4787a6['dataValues'][_0x0fe9('0xcd')]=[];_0x4787a6[_0x0fe9('0xce')]['Messages'][_0x0fe9('0xa7')](_0x13f611[_0x0fe9('0xce')]);return _0x4787a6;});})[_0x0fe9('0x26')](respondWithResult(_0x3fc3ed,null))['catch'](handleError(_0x3fc3ed,null));};exports[_0x0fe9('0x2e')]=function(_0x52b17d,_0x40594c,_0x309243){if(_0x52b17d['body']['id']){delete _0x52b17d[_0x0fe9('0x62')]['id'];}var _0x3377d9,_0xe2cde,_0x56ecc3;return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x52b17d[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x40594c,null))[_0x0fe9('0x26')](function(_0x1f52a1){if(_0x1f52a1){_0x56ecc3=_0x1f52a1;logger[_0x0fe9('0xb4')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0fe9('0xcf'),_0x1f52a1['type'],util['inspect'](_0x52b17d[_0x0fe9('0x62')],{'showHidden':![],'depth':null}));switch(_0x1f52a1[_0x0fe9('0x46')]){case _0x0fe9('0xd0'):if(_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0xd1')]&&_0x52b17d['body']['status']){_0xe2cde=_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0x2e')];return db[_0x0fe9('0xa9')][_0x0fe9('0x60')]({'where':{'messageId':_0x52b17d[_0x0fe9('0x62')]['skebby_dispatch_id']}});}break;case _0x0fe9('0x8d'):if(_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0xd2')]&&_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0xd3')]){_0xe2cde=_0x52b17d[_0x0fe9('0x62')]['statusInt'];return db[_0x0fe9('0xa9')]['find']({'where':{'messageId':_0x52b17d['body'][_0x0fe9('0xd2')]}});}break;case _0x0fe9('0x8e'):if(_0x52b17d[_0x0fe9('0x62')]['message_id']&&_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0xd4')]){_0xe2cde=_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0xd4')];return db['SmsMessage'][_0x0fe9('0x60')]({'where':{'messageId':_0x52b17d[_0x0fe9('0x62')]['message_id']}});}break;case _0x0fe9('0x91'):var _0x2ede13=_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0x92')][0x0];if(_0x2ede13[_0x0fe9('0x89')]&&_0x2ede13[_0x0fe9('0x2e')]['groupName']===_0x0fe9('0xd5')){_0xe2cde=_0x2ede13[_0x0fe9('0x2e')][_0x0fe9('0xd6')];return db[_0x0fe9('0xa9')][_0x0fe9('0x60')]({'where':{'messageId':_0x2ede13[_0x0fe9('0x89')]}});}break;case _0x0fe9('0x94'):if(_0x52b17d['body'][_0x0fe9('0x89')]&&_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0x2e')]){_0xe2cde=_0x52b17d[_0x0fe9('0x62')]['status'];return db[_0x0fe9('0xa9')][_0x0fe9('0x60')]({'where':{'messageId':_0x52b17d['body'][_0x0fe9('0x89')]}});}break;case _0x0fe9('0x97'):if(_0x52b17d[_0x0fe9('0x62')][0x0][_0x0fe9('0x2d')]['id']){_0xe2cde=_0x52b17d[_0x0fe9('0x62')][0x0][_0x0fe9('0x46')];return db[_0x0fe9('0xa9')][_0x0fe9('0x60')]({'where':{'messageId':_0x52b17d[_0x0fe9('0x62')][0x0][_0x0fe9('0x2d')]['id']}});}break;case'intelepeer':if(_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0xd7')]&&_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0x2e')]){_0xe2cde=_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0x2e')];return db[_0x0fe9('0xa9')][_0x0fe9('0x60')]({'where':{'messageId':_0x52b17d[_0x0fe9('0x62')]['redif']}});}break;}}})[_0x0fe9('0x26')](handleEntityNotFound(_0x40594c,null))['then'](function(_0x39a998){if(_0x39a998){_0x3377d9=_0x39a998;switch(_0x56ecc3['type']){case'skebby':if(_0xe2cde===_0x0fe9('0xd5')){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger[_0x0fe9('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fe9('0x2e'),_0x0fe9('0xd0'),util[_0x0fe9('0xd8')](_0x52b17d[_0x0fe9('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0fe9('0x8d'):if(_0xe2cde==='1'){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger[_0x0fe9('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fe9('0x2e'),_0x0fe9('0xd0'),util['inspect'](_0x52b17d[_0x0fe9('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0fe9('0x8e'):if(!_0x52b17d[_0x0fe9('0x62')]['error_code']&&_0xe2cde>=0xc8&&_0xe2cde<=0xce){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger[_0x0fe9('0x2b')](_0x0fe9('0x29'),_0x0fe9('0x2e'),_0x0fe9('0x8e'),util[_0x0fe9('0xd8')](_0x52b17d['body'],{'showHidden':![],'depth':null}));}break;case _0x0fe9('0x91'):var _0x78465b=_0x52b17d[_0x0fe9('0x62')][_0x0fe9('0x92')][0x0];if(_0x78465b[_0x0fe9('0x2e')][_0x0fe9('0xd6')]===_0x0fe9('0xd5')){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger[_0x0fe9('0x2b')](_0x0fe9('0x29'),_0x0fe9('0x2e'),_0x0fe9('0x91'),util[_0x0fe9('0xd8')](_0x52b17d[_0x0fe9('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0fe9('0x94'):if(_0xe2cde==_0x0fe9('0xd9')||_0xe2cde==_0x0fe9('0xda')){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger[_0x0fe9('0x2b')](_0x0fe9('0x29'),_0x0fe9('0x2e'),_0x0fe9('0x94'),util[_0x0fe9('0xd8')](_0x52b17d[_0x0fe9('0x62')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0xe2cde==_0x0fe9('0xdb')){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger['error'](_0x0fe9('0x29'),'status',_0x0fe9('0x97'),util[_0x0fe9('0xd8')](_0x52b17d['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0xe2cde===_0x0fe9('0xdc')||_0xe2cde===_0x0fe9('0xdd')){return _0x3377d9[_0x0fe9('0x3a')]({'read':!![]});}else{logger[_0x0fe9('0x2b')](_0x0fe9('0x29'),_0x0fe9('0x2e'),'intelepeer',util['inspect'](_0x52b17d[_0x0fe9('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x3377d9;}})['then'](respondWithResult(_0x40594c,null))[_0x0fe9('0x5c')](handleError(_0x40594c,null));};exports[_0x0fe9('0xde')]=function(_0x6a490c,_0x3ba51d,_0x13a00f){var _0x2de9e0,_0x4ec89d,_0x2b9dfa;return db[_0x0fe9('0x5a')][_0x0fe9('0x60')]({'where':{'id':_0x6a490c[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x3ba51d,null))[_0x0fe9('0x26')](function(_0x129aab){if(_0x129aab){_0x2b9dfa=_0x129aab;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fe9('0x2e'),'received\x20delivery\x20report\x20from',_0x129aab[_0x0fe9('0x46')],util['inspect'](_0x6a490c[_0x0fe9('0x49')],{'showHidden':![],'depth':null}));switch(_0x129aab[_0x0fe9('0x46')]){case _0x0fe9('0x93'):if(_0x6a490c[_0x0fe9('0x49')][_0x0fe9('0xdf')]&&_0x6a490c['query'][_0x0fe9('0xe0')]){_0x4ec89d=_0x6a490c[_0x0fe9('0x49')][_0x0fe9('0xe0')];return db[_0x0fe9('0xa9')]['find']({'where':{'messageId':_0x6a490c[_0x0fe9('0x49')][_0x0fe9('0xdf')]}});}break;}}})[_0x0fe9('0x26')](handleEntityNotFound(_0x3ba51d,null))[_0x0fe9('0x26')](function(_0x1d7f8a){if(_0x1d7f8a){_0x2de9e0=_0x1d7f8a;switch(_0x2b9dfa[_0x0fe9('0x46')]){case _0x0fe9('0x93'):if(_0x4ec89d==='2'||_0x4ec89d==='6'){return _0x2de9e0[_0x0fe9('0x3a')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fe9('0x2e'),'csc',util[_0x0fe9('0xd8')](_0x6a490c[_0x0fe9('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x2de9e0;}})[_0x0fe9('0x26')](respondWithResult(_0x3ba51d,null))[_0x0fe9('0x5c')](handleError(_0x3ba51d,null));};exports[_0x0fe9('0xe1')]=function(_0x1f9dc7,_0x2a3eda,_0x140b88){return db['SmsAccount'][_0x0fe9('0x60')]({'where':{'id':_0x1f9dc7[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x2a3eda,null))['then'](function(_0x43d08a){if(_0x43d08a){return _0x43d08a[_0x0fe9('0xe1')](_0x1f9dc7[_0x0fe9('0x62')][_0x0fe9('0x6f')],_[_0x0fe9('0x9f')](_0x1f9dc7['body'],[_0x0fe9('0x6f'),'id'])||{})[_0x0fe9('0xa3')](function(_0x131e66){for(var _0x4ff5db=0x0;_0x4ff5db<_0x1f9dc7[_0x0fe9('0x62')][_0x0fe9('0x6f')]['length'];_0x4ff5db+=0x1){socket[_0x0fe9('0xe2')](_0x0fe9('0xe3'),{'UserId':Number(_0x1f9dc7[_0x0fe9('0x62')][_0x0fe9('0x6f')][_0x4ff5db]),'SmsAccountId':Number(_0x1f9dc7['params']['id'])});}return _0x131e66;});}})['then'](respondWithResult(_0x2a3eda,null))['catch'](handleError(_0x2a3eda,null));};exports[_0x0fe9('0xe4')]=function(_0x5e1aa2,_0x2ad5bf,_0x557599){return db[_0x0fe9('0x5a')]['find']({'where':{'id':_0x5e1aa2[_0x0fe9('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2ad5bf,null))[_0x0fe9('0x26')](function(_0x3cd7a5){if(_0x3cd7a5){return _0x3cd7a5['removeAgents'](_0x5e1aa2['query'][_0x0fe9('0x6f')])[_0x0fe9('0x26')](function(){if(_['isArray'](_0x5e1aa2[_0x0fe9('0x49')]['ids'])){for(var _0x3e9cd5=0x0;_0x3e9cd5<_0x5e1aa2[_0x0fe9('0x49')][_0x0fe9('0x6f')][_0x0fe9('0x4f')];_0x3e9cd5+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5e1aa2[_0x0fe9('0x49')][_0x0fe9('0x6f')][_0x3e9cd5]),'SmsAccountId':Number(_0x5e1aa2[_0x0fe9('0x5e')]['id'])});}}else{socket[_0x0fe9('0xe2')](_0x0fe9('0xe5'),{'UserId':Number(_0x5e1aa2[_0x0fe9('0x49')][_0x0fe9('0x6f')]),'SmsAccountId':Number(_0x5e1aa2[_0x0fe9('0x5e')]['id'])});}});}})[_0x0fe9('0x26')](respondWithStatusCode(_0x2ad5bf,null))[_0x0fe9('0x5c')](handleError(_0x2ad5bf,null));};exports[_0x0fe9('0xe6')]=function(_0x558bd5,_0x3f5f87,_0x4ddef3){var _0x326256={};var _0x28f004={};var _0x2a8ddb;var _0x258f61;return db['SmsAccount'][_0x0fe9('0x72')]({'where':{'id':_0x558bd5[_0x0fe9('0x5e')]['id']}})[_0x0fe9('0x26')](handleEntityNotFound(_0x3f5f87,null))['then'](function(_0x13f370){if(_0x13f370){_0x2a8ddb=_0x13f370;_0x28f004['model']=_[_0x0fe9('0x4a')](db[_0x0fe9('0xac')]['rawAttributes']);_0x28f004['query']=_[_0x0fe9('0x4a')](_0x558bd5['query']);_0x28f004[_0x0fe9('0x4b')]=_[_0x0fe9('0x4c')](_0x28f004[_0x0fe9('0x48')],_0x28f004['query']);_0x326256[_0x0fe9('0x4d')]=_[_0x0fe9('0x4c')](_0x28f004[_0x0fe9('0x48')],qs['fields'](_0x558bd5['query'][_0x0fe9('0x4e')]));_0x326256[_0x0fe9('0x4d')]=_0x326256[_0x0fe9('0x4d')][_0x0fe9('0x4f')]?_0x326256['attributes']:_0x28f004[_0x0fe9('0x48')];_0x326256[_0x0fe9('0x52')]=qs[_0x0fe9('0x53')](_0x558bd5[_0x0fe9('0x49')][_0x0fe9('0x53')]);_0x326256[_0x0fe9('0x6c')]=qs['filters'](_[_0x0fe9('0x54')](_0x558bd5[_0x0fe9('0x49')],_0x28f004[_0x0fe9('0x4b')]));if(_0x558bd5['query']['filter']){_0x326256[_0x0fe9('0x6c')]=_[_0x0fe9('0x56')](_0x326256['where'],{'$or':_[_0x0fe9('0x43')](_0x326256['attributes'],function(_0x391008){var _0x149274={};_0x149274[_0x391008]={'$like':'%'+_0x558bd5['query'][_0x0fe9('0x55')]+'%'};return _0x149274;})});}_0x326256=_[_0x0fe9('0x56')]({},_0x326256,_0x558bd5[_0x0fe9('0x5f')]);return _0x2a8ddb[_0x0fe9('0xe6')](_0x326256);}})['then'](function(_0x3326fa){if(_0x3326fa){_0x258f61=_0x3326fa[_0x0fe9('0x4f')];if(!_0x558bd5['query'][_0x0fe9('0x50')](_0x0fe9('0x51'))){_0x326256[_0x0fe9('0x33')]=qs[_0x0fe9('0x33')](_0x558bd5['query'][_0x0fe9('0x33')]);_0x326256[_0x0fe9('0x30')]=qs['offset'](_0x558bd5[_0x0fe9('0x49')]['offset']);}return _0x2a8ddb['getAgents'](_0x326256);}})[_0x0fe9('0x26')](function(_0x404c31){if(_0x404c31){return _0x404c31?{'count':_0x258f61,'rows':_0x404c31}:null;}})[_0x0fe9('0x26')](respondWithResult(_0x3f5f87,null))[_0x0fe9('0x5c')](handleError(_0x3f5f87,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index df382ec..396217e 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 _0x91b2=['emit','hook','exports','events','setMaxListeners','save','remove'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0x91b2,0x1d8));var _0x291b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x91b2[_0x9df060];return _0x338dfe;};'use strict';var EventEmitter=require(_0x291b('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x291b('0x1')](0x0);var events={'afterCreate':_0x291b('0x2'),'afterUpdate':'update','afterDestroy':_0x291b('0x3')};function emitEvent(_0x920df9){return function(_0x20c83f,_0x492254,_0x3e9046){SmsAccountEvents[_0x291b('0x4')](_0x920df9+':'+_0x20c83f['id'],_0x20c83f);SmsAccountEvents[_0x291b('0x4')](_0x920df9,_0x20c83f);_0x3e9046(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x291b('0x5')](e,emitEvent(event));}}module[_0x291b('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x1df7=['setMaxListeners','save','update','remove','emit','hook','../../mysqldb','SmsAccount'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0x1df7,0x6e));var _0x71df=function(_0x4c2bc0,_0x426b8c){_0x4c2bc0=_0x4c2bc0-0x0;var _0x2db85b=_0x1df7[_0x4c2bc0];return _0x2db85b;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x71df('0x0'))['db'][_0x71df('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x71df('0x2')](0x0);var events={'afterCreate':_0x71df('0x3'),'afterUpdate':_0x71df('0x4'),'afterDestroy':_0x71df('0x5')};function emitEvent(_0x362298){return function(_0x3e3a06,_0x20c662,_0x2b8342){SmsAccountEvents[_0x71df('0x6')](_0x362298+':'+_0x3e3a06['id'],_0x3e3a06);SmsAccountEvents[_0x71df('0x6')](_0x362298,_0x3e3a06);_0x2b8342(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x71df('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d07d294..aa5dfe8 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 _0xda5b=['sms_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount'];(function(_0xfb885a,_0x538ad0){var _0x248965=function(_0x322548){while(--_0x322548){_0xfb885a['push'](_0xfb885a['shift']());}};_0x248965(++_0x538ad0);}(_0xda5b,0x12d));var _0xbda5=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0xda5b[_0x334f9a];return _0x2b219d;};'use strict';var _=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var logger=require(_0xbda5('0x2'))(_0xbda5('0x3'));var moment=require('moment');var BPromise=require(_0xbda5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbda5('0x5'));var rimraf=require(_0xbda5('0x6'));var config=require(_0xbda5('0x7'));var attributes=require(_0xbda5('0x8'));module['exports']=function(_0x201ebf,_0x496fd0){return _0x201ebf[_0xbda5('0x9')](_0xbda5('0xa'),attributes,{'tableName':_0xbda5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5226=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts'];(function(_0x526a88,_0x5e5e55){var _0x378677=function(_0x2b0537){while(--_0x2b0537){_0x526a88['push'](_0x526a88['shift']());}};_0x378677(++_0x5e5e55);}(_0x5226,0x16c));var _0x6522=function(_0x938168,_0x262cb8){_0x938168=_0x938168-0x0;var _0x4cc502=_0x5226[_0x938168];return _0x4cc502;};'use strict';var _=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var logger=require(_0x6522('0x2'))(_0x6522('0x3'));var moment=require(_0x6522('0x4'));var BPromise=require('bluebird');var rp=require(_0x6522('0x5'));var fs=require('fs');var path=require(_0x6522('0x6'));var rimraf=require(_0x6522('0x7'));var config=require('../../config/environment');var attributes=require(_0x6522('0x8'));module[_0x6522('0x9')]=function(_0x2eeda9,_0x3a6cd0){return _0x2eeda9[_0x6522('0xa')](_0x6522('0xb'),attributes,{'tableName':_0x6522('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 cdd6432..4619b51 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 _0xc8f8=['request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','model','map','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x381306,_0x4a3435){var _0x4a8256=function(_0x39d4bf){while(--_0x39d4bf){_0x381306['push'](_0x381306['shift']());}};_0x4a8256(++_0x4a3435);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc8f8[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x8c8f('0x0'));var moment=require(_0x8c8f('0x1'));var BPromise=require(_0x8c8f('0x2'));var rs=require(_0x8c8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c8f('0x4'))['db'];var utils=require(_0x8c8f('0x5'));var logger=require(_0x8c8f('0x6'))(_0x8c8f('0x7'));var config=require(_0x8c8f('0x8'));var jayson=require(_0x8c8f('0x9'));var client=jayson['client'][_0x8c8f('0xa')]({'port':0x232a});config[_0x8c8f('0xb')]=_['defaults'](config[_0x8c8f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c8f('0xc'))(new Redis(config[_0x8c8f('0xb')]));require(_0x8c8f('0xd'))[_0x8c8f('0xe')](socket);function respondWithRpcPromise(_0x3d2806,_0x2ad4f3,_0x3633fa){return new BPromise(function(_0x70df11,_0x3afb34){return client[_0x8c8f('0xf')](_0x3d2806,_0x3633fa)[_0x8c8f('0x10')](function(_0x4ea06a){logger[_0x8c8f('0x11')](_0x8c8f('0x12'),_0x2ad4f3,'request\x20sent');logger[_0x8c8f('0x13')](_0x8c8f('0x14'),_0x2ad4f3,_0x8c8f('0x15'),JSON[_0x8c8f('0x16')](_0x4ea06a));if(_0x4ea06a[_0x8c8f('0x17')]){if(_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x18')]===0x1f4){logger[_0x8c8f('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2ad4f3,_0x4ea06a['error']['message']);return _0x3afb34(_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x19')]);}logger['error'](_0x8c8f('0x12'),_0x2ad4f3,_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x19')]);return _0x70df11(_0x4ea06a[_0x8c8f('0x17')][_0x8c8f('0x19')]);}else{logger[_0x8c8f('0x11')](_0x8c8f('0x12'),_0x2ad4f3,_0x8c8f('0x15'));_0x70df11(_0x4ea06a[_0x8c8f('0x1a')][_0x8c8f('0x19')]);}})[_0x8c8f('0x1b')](function(_0x2b3bfe){logger[_0x8c8f('0x17')](_0x8c8f('0x12'),_0x2ad4f3,_0x2b3bfe);_0x3afb34(_0x2b3bfe);});});}exports[_0x8c8f('0x1c')]=function(_0x31038c){var _0x1c843a=this;return new Promise(function(_0x5667f4,_0x5887a0){return db[_0x8c8f('0x1d')]['find']({'raw':_0x31038c[_0x8c8f('0x1e')]?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x1f')]===undefined?!![]:![]:!![],'where':_0x31038c['options']?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x20')]||null:null,'attributes':_0x31038c[_0x8c8f('0x1e')]?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x21')]||null:null,'include':_0x31038c[_0x8c8f('0x1e')]?_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x22')]?_['map'](_0x31038c[_0x8c8f('0x1e')][_0x8c8f('0x22')],function(_0x4625ae){return{'model':db[_0x4625ae[_0x8c8f('0x23')]],'as':_0x4625ae['as'],'attributes':_0x4625ae[_0x8c8f('0x21')],'include':_0x4625ae['include']?_['map'](_0x4625ae[_0x8c8f('0x22')],function(_0x5824a1){return{'model':db[_0x5824a1['model']],'as':_0x5824a1['as'],'attributes':_0x5824a1[_0x8c8f('0x21')],'include':_0x5824a1[_0x8c8f('0x22')]?_[_0x8c8f('0x24')](_0x5824a1[_0x8c8f('0x22')],function(_0x32d2cb){return{'model':db[_0x32d2cb[_0x8c8f('0x23')]],'as':_0x32d2cb['as'],'attributes':_0x32d2cb[_0x8c8f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fd9bb){logger[_0x8c8f('0x11')]('ShowSmsAccount',_0x31038c);logger[_0x8c8f('0x13')](_0x8c8f('0x1c'),_0x31038c,JSON['stringify'](_0x3fd9bb));_0x5667f4(_0x3fd9bb);})['catch'](function(_0x524d03){logger[_0x8c8f('0x17')](_0x8c8f('0x1c'),_0x524d03[_0x8c8f('0x19')],_0x31038c);_0x5887a0(_0x1c843a['error'](0x1f4,_0x524d03['message']));});});}; \ No newline at end of file +var _0x65a4=['SmsAccount','find','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','request','then','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount'];(function(_0x28d4d1,_0x230d35){var _0x260ce4=function(_0xde4afc){while(--_0xde4afc){_0x28d4d1['push'](_0x28d4d1['shift']());}};_0x260ce4(++_0x230d35);}(_0x65a4,0x118));var _0x465a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x65a4[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x465a('0x0'));var util=require(_0x465a('0x1'));var moment=require(_0x465a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x465a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x465a('0x4'))(_0x465a('0x5'));var config=require(_0x465a('0x6'));var jayson=require(_0x465a('0x7'));var client=jayson[_0x465a('0x8')][_0x465a('0x9')]({'port':0x232a});config[_0x465a('0xa')]=_[_0x465a('0xb')](config[_0x465a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x465a('0xc'))(new Redis(config['redis']));require(_0x465a('0xd'))['register'](socket);function respondWithRpcPromise(_0x1647f5,_0x339aa3,_0x20cf52){return new BPromise(function(_0x257b39,_0x25f311){return client[_0x465a('0xe')](_0x1647f5,_0x20cf52)[_0x465a('0xf')](function(_0xf3e3ca){logger[_0x465a('0x10')]('SmsAccount,\x20%s,\x20%s',_0x339aa3,_0x465a('0x11'));logger[_0x465a('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x339aa3,'request\x20sent',JSON[_0x465a('0x13')](_0xf3e3ca));if(_0xf3e3ca[_0x465a('0x14')]){if(_0xf3e3ca[_0x465a('0x14')]['code']===0x1f4){logger[_0x465a('0x14')](_0x465a('0x15'),_0x339aa3,_0xf3e3ca[_0x465a('0x14')]['message']);return _0x25f311(_0xf3e3ca['error'][_0x465a('0x16')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x339aa3,_0xf3e3ca[_0x465a('0x14')][_0x465a('0x16')]);return _0x257b39(_0xf3e3ca[_0x465a('0x14')][_0x465a('0x16')]);}else{logger['info'](_0x465a('0x15'),_0x339aa3,_0x465a('0x11'));_0x257b39(_0xf3e3ca[_0x465a('0x17')]['message']);}})[_0x465a('0x18')](function(_0x38e64c){logger[_0x465a('0x14')]('SmsAccount,\x20%s,\x20%s',_0x339aa3,_0x38e64c);_0x25f311(_0x38e64c);});});}exports[_0x465a('0x19')]=function(_0x3f9d4c){var _0x1a5b4e=this;return new Promise(function(_0x222a11,_0x1649da){return db[_0x465a('0x1a')][_0x465a('0x1b')]({'raw':_0x3f9d4c[_0x465a('0x1c')]?_0x3f9d4c[_0x465a('0x1c')][_0x465a('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f9d4c[_0x465a('0x1c')]?_0x3f9d4c[_0x465a('0x1c')]['where']||null:null,'attributes':_0x3f9d4c[_0x465a('0x1c')]?_0x3f9d4c[_0x465a('0x1c')][_0x465a('0x1e')]||null:null,'include':_0x3f9d4c[_0x465a('0x1c')]?_0x3f9d4c[_0x465a('0x1c')][_0x465a('0x1f')]?_[_0x465a('0x20')](_0x3f9d4c[_0x465a('0x1c')][_0x465a('0x1f')],function(_0x35bb45){return{'model':db[_0x35bb45[_0x465a('0x21')]],'as':_0x35bb45['as'],'attributes':_0x35bb45[_0x465a('0x1e')],'include':_0x35bb45[_0x465a('0x1f')]?_['map'](_0x35bb45['include'],function(_0x3ad7e7){return{'model':db[_0x3ad7e7[_0x465a('0x21')]],'as':_0x3ad7e7['as'],'attributes':_0x3ad7e7['attributes'],'include':_0x3ad7e7[_0x465a('0x1f')]?_[_0x465a('0x20')](_0x3ad7e7[_0x465a('0x1f')],function(_0x39bd8c){return{'model':db[_0x39bd8c[_0x465a('0x21')]],'as':_0x39bd8c['as'],'attributes':_0x39bd8c[_0x465a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x465a('0xf')](function(_0x4156cf){logger[_0x465a('0x10')](_0x465a('0x19'),_0x3f9d4c);logger['debug'](_0x465a('0x19'),_0x3f9d4c,JSON[_0x465a('0x13')](_0x4156cf));_0x222a11(_0x4156cf);})[_0x465a('0x18')](function(_0x3b5a6e){logger['error'](_0x465a('0x19'),_0x3b5a6e['message'],_0x3f9d4c);_0x1649da(_0x1a5b4e['error'](0x1f4,_0x3b5a6e[_0x465a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d52116d..e1fb55c 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index c8ce457..fe8f1e2 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 94aaed1..83a8d9f 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 _0x1353=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x5d718c,_0x14527e){var _0x2a2706=function(_0x2efb1b){while(--_0x2efb1b){_0x5d718c['push'](_0x5d718c['shift']());}};_0x2a2706(++_0x14527e);}(_0x1353,0x164));var _0x3135=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1353[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x3135('0x0'));module[_0x3135('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3135('0x2')],'allowNull':![],'defaultValue':_0x3135('0x3')},'appdata':{'type':Sequelize[_0x3135('0x4')]()},'description':{'type':Sequelize[_0x3135('0x2')]},'interval':{'type':Sequelize[_0x3135('0x2')],'defaultValue':_0x3135('0x5')}}; \ No newline at end of file +var _0x047c=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4c48be,_0x34a82b){var _0x1228d7=function(_0xf52fb3){while(--_0xf52fb3){_0x4c48be['push'](_0x4c48be['shift']());}};_0x1228d7(++_0x34a82b);}(_0x047c,0x1b8));var _0xc047=function(_0xe3ffce,_0x349228){_0xe3ffce=_0xe3ffce-0x0;var _0x486c3b=_0x047c[_0xe3ffce];return _0x486c3b;};'use strict';var Sequelize=require(_0xc047('0x0'));module[_0xc047('0x1')]={'priority':{'type':Sequelize[_0xc047('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc047('0x3')],'allowNull':![],'defaultValue':_0xc047('0x4')},'appdata':{'type':Sequelize[_0xc047('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc047('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6eb0d02..6f10a32 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 _0x6209=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x58bd59,_0x5dca02){var _0x4a6eeb=function(_0x10e9df){while(--_0x10e9df){_0x58bd59['push'](_0x58bd59['shift']());}};_0x4a6eeb(++_0x5dca02);}(_0x6209,0x1b6));var _0x9620=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6209[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0x9620('0x0'));var rimraf=require(_0x9620('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9620('0x2'));var rp=require('request-promise');var moment=require(_0x9620('0x3'));var BPromise=require(_0x9620('0x4'));var Mustache=require(_0x9620('0x5'));var util=require(_0x9620('0x6'));var path=require(_0x9620('0x7'));var sox=require(_0x9620('0x8'));var csv=require(_0x9620('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9620('0xa'));var _=require(_0x9620('0xb'));var squel=require(_0x9620('0xc'));var crypto=require(_0x9620('0xd'));var jsforce=require(_0x9620('0xe'));var deskjs=require(_0x9620('0xf'));var toCsv=require(_0x9620('0x9'));var querystring=require(_0x9620('0x10'));var Papa=require('papaparse');var Redis=require(_0x9620('0x11'));var authService=require(_0x9620('0x12'));var qs=require(_0x9620('0x13'));var as=require(_0x9620('0x14'));var hardwareService=require(_0x9620('0x15'));var logger=require(_0x9620('0x16'))('api');var utils=require(_0x9620('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9620('0x18'));var db=require(_0x9620('0x19'))['db'];function respondWithStatusCode(_0x37dbc9,_0x4144b8){_0x4144b8=_0x4144b8||0xcc;return function(_0x2db506){if(_0x2db506){return _0x37dbc9['sendStatus'](_0x4144b8);}return _0x37dbc9[_0x9620('0x1a')](_0x4144b8)[_0x9620('0x1b')]();};}function respondWithResult(_0x487ef0,_0xea3f4b){_0xea3f4b=_0xea3f4b||0xc8;return function(_0x5c3d73){if(_0x5c3d73){return _0x487ef0[_0x9620('0x1a')](_0xea3f4b)[_0x9620('0x1c')](_0x5c3d73);}};}function respondWithFilteredResult(_0x5e78e5,_0x504a7b){return function(_0x4b08b0){if(_0x4b08b0){var _0x24a222=typeof _0x504a7b[_0x9620('0x1d')]===_0x9620('0x1e')&&typeof _0x504a7b[_0x9620('0x1f')]===_0x9620('0x1e');var _0x6b85af=_0x4b08b0['count'];var _0x1d176c=_0x24a222?0x0:_0x504a7b[_0x9620('0x1d')];var _0x4f5781=_0x24a222?_0x4b08b0[_0x9620('0x20')]:_0x504a7b[_0x9620('0x1d')]+_0x504a7b[_0x9620('0x1f')];var _0x5d642;if(_0x4f5781>=_0x6b85af){_0x4f5781=_0x6b85af;_0x5d642=0xc8;}else{_0x5d642=0xce;}_0x5e78e5[_0x9620('0x1a')](_0x5d642);return _0x5e78e5[_0x9620('0x21')](_0x9620('0x22'),_0x1d176c+'-'+_0x4f5781+'/'+_0x6b85af)[_0x9620('0x1c')](_0x4b08b0);}return null;};}function patchUpdates(_0x5cff5d){return function(_0xeb1bbc){try{jsonpatch[_0x9620('0x23')](_0xeb1bbc,_0x5cff5d,!![]);}catch(_0x1a27d4){return BPromise[_0x9620('0x24')](_0x1a27d4);}return _0xeb1bbc[_0x9620('0x25')]();};}function saveUpdates(_0x39a4f2,_0x48fb65){return function(_0x45c253){if(_0x45c253){return _0x45c253[_0x9620('0x26')](_0x39a4f2)[_0x9620('0x27')](function(_0x4ddef5){return _0x4ddef5;});}return null;};}function removeEntity(_0xccf1cc,_0x36582f){return function(_0x1811c4){if(_0x1811c4){return _0x1811c4[_0x9620('0x28')]()[_0x9620('0x27')](function(){_0xccf1cc[_0x9620('0x1a')](0xcc)[_0x9620('0x1b')]();});}};}function handleEntityNotFound(_0x26b400,_0xf1579c){return function(_0x2dae6f){if(!_0x2dae6f){_0x26b400['sendStatus'](0x194);}return _0x2dae6f;};}function handleError(_0x318342,_0x181b0f){_0x181b0f=_0x181b0f||0x1f4;return function(_0x35f01c){logger['error'](_0x35f01c[_0x9620('0x29')]);if(_0x35f01c[_0x9620('0x2a')]){delete _0x35f01c['name'];}_0x318342[_0x9620('0x1a')](_0x181b0f)[_0x9620('0x2b')](_0x35f01c);};}exports[_0x9620('0x2c')]=function(_0x506d4f,_0x29a957){var _0x3f442b={},_0x4c950e={},_0x270179={'count':0x0,'rows':[]};var _0x50858f=_[_0x9620('0x2d')](db[_0x9620('0x2e')][_0x9620('0x2f')],function(_0x566c57){return{'name':_0x566c57[_0x9620('0x30')],'type':_0x566c57[_0x9620('0x31')]['key']};});_0x4c950e['model']=_[_0x9620('0x2d')](_0x50858f,_0x9620('0x2a'));_0x4c950e['query']=_[_0x9620('0x32')](_0x506d4f['query']);_0x4c950e['filters']=_['intersection'](_0x4c950e[_0x9620('0x33')],_0x4c950e[_0x9620('0x34')]);_0x3f442b[_0x9620('0x35')]=_[_0x9620('0x36')](_0x4c950e[_0x9620('0x33')],qs['fields'](_0x506d4f[_0x9620('0x34')][_0x9620('0x37')]));_0x3f442b[_0x9620('0x35')]=_0x3f442b[_0x9620('0x35')][_0x9620('0x38')]?_0x3f442b[_0x9620('0x35')]:_0x4c950e['model'];if(!_0x506d4f[_0x9620('0x34')][_0x9620('0x39')](_0x9620('0x3a'))){_0x3f442b[_0x9620('0x1f')]=qs[_0x9620('0x1f')](_0x506d4f[_0x9620('0x34')][_0x9620('0x1f')]);_0x3f442b[_0x9620('0x1d')]=qs[_0x9620('0x1d')](_0x506d4f[_0x9620('0x34')][_0x9620('0x1d')]);}_0x3f442b[_0x9620('0x3b')]=qs['sort'](_0x506d4f[_0x9620('0x34')]['sort']);_0x3f442b['where']=qs[_0x9620('0x3c')](_[_0x9620('0x3d')](_0x506d4f[_0x9620('0x34')],_0x4c950e[_0x9620('0x3c')]),_0x50858f);if(_0x506d4f[_0x9620('0x34')][_0x9620('0x3e')]){_0x3f442b[_0x9620('0x3f')]=_[_0x9620('0x40')](_0x3f442b['where'],{'$or':_['map'](_0x50858f,function(_0x1b885a){if(_0x1b885a[_0x9620('0x31')]!==_0x9620('0x41')){var _0x1894e4={};_0x1894e4[_0x1b885a['name']]={'$like':'%'+_0x506d4f[_0x9620('0x34')]['filter']+'%'};return _0x1894e4;}})});}_0x3f442b=_['merge']({},_0x3f442b,_0x506d4f['options']);var _0x261f25={'where':_0x3f442b[_0x9620('0x3f')]};return db[_0x9620('0x2e')]['count'](_0x261f25)[_0x9620('0x27')](function(_0xe0d724){_0x270179['count']=_0xe0d724;if(_0x506d4f['query']['includeAll']){_0x3f442b[_0x9620('0x42')]=[{'all':!![]}];}return db[_0x9620('0x2e')][_0x9620('0x43')](_0x3f442b);})['then'](function(_0x2d904b){_0x270179[_0x9620('0x44')]=_0x2d904b;return _0x270179;})['then'](respondWithFilteredResult(_0x29a957,_0x3f442b))[_0x9620('0x45')](handleError(_0x29a957,null));};exports[_0x9620('0x46')]=function(_0x1c027b,_0x21e4ae){var _0x2159ef={'raw':!![],'where':{'id':_0x1c027b[_0x9620('0x47')]['id']}},_0x539897={};_0x539897[_0x9620('0x33')]=_['keys'](db[_0x9620('0x2e')][_0x9620('0x2f')]);_0x539897['query']=_[_0x9620('0x32')](_0x1c027b[_0x9620('0x34')]);_0x539897['filters']=_[_0x9620('0x36')](_0x539897[_0x9620('0x33')],_0x539897['query']);_0x2159ef[_0x9620('0x35')]=_[_0x9620('0x36')](_0x539897['model'],qs[_0x9620('0x37')](_0x1c027b['query'][_0x9620('0x37')]));_0x2159ef[_0x9620('0x35')]=_0x2159ef[_0x9620('0x35')][_0x9620('0x38')]?_0x2159ef[_0x9620('0x35')]:_0x539897[_0x9620('0x33')];if(_0x1c027b[_0x9620('0x34')][_0x9620('0x48')]){_0x2159ef[_0x9620('0x42')]=[{'all':!![]}];}_0x2159ef=_[_0x9620('0x40')]({},_0x2159ef,_0x1c027b['options']);return db[_0x9620('0x2e')][_0x9620('0x49')](_0x2159ef)[_0x9620('0x27')](handleEntityNotFound(_0x21e4ae,null))[_0x9620('0x27')](respondWithResult(_0x21e4ae,null))[_0x9620('0x45')](handleError(_0x21e4ae,null));};exports[_0x9620('0x4a')]=function(_0x420faf,_0x3b86dd){return db[_0x9620('0x2e')]['create'](_0x420faf['body'],{})[_0x9620('0x27')](respondWithResult(_0x3b86dd,0xc9))[_0x9620('0x45')](handleError(_0x3b86dd,null));};exports[_0x9620('0x26')]=function(_0x5e94b5,_0x33a56d){if(_0x5e94b5[_0x9620('0x4b')]['id']){delete _0x5e94b5[_0x9620('0x4b')]['id'];}return db[_0x9620('0x2e')][_0x9620('0x49')]({'where':{'id':_0x5e94b5[_0x9620('0x47')]['id']}})[_0x9620('0x27')](handleEntityNotFound(_0x33a56d,null))['then'](saveUpdates(_0x5e94b5[_0x9620('0x4b')],null))['then'](respondWithResult(_0x33a56d,null))[_0x9620('0x45')](handleError(_0x33a56d,null));};exports[_0x9620('0x28')]=function(_0x37c620,_0x5712c7){return db[_0x9620('0x2e')][_0x9620('0x49')]({'where':{'id':_0x37c620['params']['id']}})['then'](handleEntityNotFound(_0x5712c7,null))[_0x9620('0x27')](removeEntity(_0x5712c7,null))[_0x9620('0x45')](handleError(_0x5712c7,null));}; \ No newline at end of file +var _0xc828=['stack','name','send','index','map','SmsApplication','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x4b1255,_0x399abe){var _0x2cab4c=function(_0x555d24){while(--_0x555d24){_0x4b1255['push'](_0x4b1255['shift']());}};_0x2cab4c(++_0x399abe);}(_0xc828,0x1a4));var _0x8c82=function(_0x56ac2e,_0xd833e1){_0x56ac2e=_0x56ac2e-0x0;var _0x2b26d8=_0xc828[_0x56ac2e];return _0x2b26d8;};'use strict';var emlformat=require(_0x8c82('0x0'));var rimraf=require(_0x8c82('0x1'));var zipdir=require(_0x8c82('0x2'));var jsonpatch=require(_0x8c82('0x3'));var rp=require(_0x8c82('0x4'));var moment=require(_0x8c82('0x5'));var BPromise=require(_0x8c82('0x6'));var Mustache=require('mustache');var util=require(_0x8c82('0x7'));var path=require(_0x8c82('0x8'));var sox=require(_0x8c82('0x9'));var csv=require('to-csv');var ejs=require(_0x8c82('0xa'));var fs=require('fs');var fs_extra=require(_0x8c82('0xb'));var _=require('lodash');var squel=require(_0x8c82('0xc'));var crypto=require(_0x8c82('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c82('0xe'));var toCsv=require(_0x8c82('0xf'));var querystring=require(_0x8c82('0x10'));var Papa=require(_0x8c82('0x11'));var Redis=require('ioredis');var authService=require(_0x8c82('0x12'));var qs=require(_0x8c82('0x13'));var as=require(_0x8c82('0x14'));var hardwareService=require(_0x8c82('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8c82('0x16'));var config=require(_0x8c82('0x17'));var licenseUtil=require(_0x8c82('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f0f40,_0xee4e40){_0xee4e40=_0xee4e40||0xcc;return function(_0x315ca9){if(_0x315ca9){return _0x2f0f40['sendStatus'](_0xee4e40);}return _0x2f0f40[_0x8c82('0x19')](_0xee4e40)[_0x8c82('0x1a')]();};}function respondWithResult(_0x39ff55,_0x320f50){_0x320f50=_0x320f50||0xc8;return function(_0x5526ea){if(_0x5526ea){return _0x39ff55['status'](_0x320f50)['json'](_0x5526ea);}};}function respondWithFilteredResult(_0x161a2f,_0x19c65e){return function(_0x4d09c4){if(_0x4d09c4){var _0xb3dde8=typeof _0x19c65e[_0x8c82('0x1b')]===_0x8c82('0x1c')&&typeof _0x19c65e[_0x8c82('0x1d')]===_0x8c82('0x1c');var _0x44d0ba=_0x4d09c4['count'];var _0x2d77b6=_0xb3dde8?0x0:_0x19c65e[_0x8c82('0x1b')];var _0x504cf2=_0xb3dde8?_0x4d09c4[_0x8c82('0x1e')]:_0x19c65e[_0x8c82('0x1b')]+_0x19c65e['limit'];var _0x473f88;if(_0x504cf2>=_0x44d0ba){_0x504cf2=_0x44d0ba;_0x473f88=0xc8;}else{_0x473f88=0xce;}_0x161a2f[_0x8c82('0x19')](_0x473f88);return _0x161a2f[_0x8c82('0x1f')](_0x8c82('0x20'),_0x2d77b6+'-'+_0x504cf2+'/'+_0x44d0ba)[_0x8c82('0x21')](_0x4d09c4);}return null;};}function patchUpdates(_0x76d045){return function(_0xeceeee){try{jsonpatch[_0x8c82('0x22')](_0xeceeee,_0x76d045,!![]);}catch(_0x3704cb){return BPromise[_0x8c82('0x23')](_0x3704cb);}return _0xeceeee[_0x8c82('0x24')]();};}function saveUpdates(_0x326855,_0x49bc4a){return function(_0x40965f){if(_0x40965f){return _0x40965f[_0x8c82('0x25')](_0x326855)[_0x8c82('0x26')](function(_0xa90325){return _0xa90325;});}return null;};}function removeEntity(_0xa353ed,_0x329fdb){return function(_0x29d448){if(_0x29d448){return _0x29d448[_0x8c82('0x27')]()[_0x8c82('0x26')](function(){_0xa353ed[_0x8c82('0x19')](0xcc)[_0x8c82('0x1a')]();});}};}function handleEntityNotFound(_0x5e69b1,_0x4fbbe6){return function(_0x56bf27){if(!_0x56bf27){_0x5e69b1[_0x8c82('0x28')](0x194);}return _0x56bf27;};}function handleError(_0xeb871d,_0x22e003){_0x22e003=_0x22e003||0x1f4;return function(_0x53d04e){logger[_0x8c82('0x29')](_0x53d04e[_0x8c82('0x2a')]);if(_0x53d04e[_0x8c82('0x2b')]){delete _0x53d04e[_0x8c82('0x2b')];}_0xeb871d[_0x8c82('0x19')](_0x22e003)[_0x8c82('0x2c')](_0x53d04e);};}exports[_0x8c82('0x2d')]=function(_0x3e42ec,_0x56d739){var _0x2b79c2={},_0x1a271f={},_0x2ba524={'count':0x0,'rows':[]};var _0x5c7686=_[_0x8c82('0x2e')](db[_0x8c82('0x2f')]['rawAttributes'],function(_0x5ad449){return{'name':_0x5ad449['fieldName'],'type':_0x5ad449['type'][_0x8c82('0x30')]};});_0x1a271f[_0x8c82('0x31')]=_[_0x8c82('0x2e')](_0x5c7686,_0x8c82('0x2b'));_0x1a271f[_0x8c82('0x32')]=_[_0x8c82('0x33')](_0x3e42ec[_0x8c82('0x32')]);_0x1a271f[_0x8c82('0x34')]=_[_0x8c82('0x35')](_0x1a271f[_0x8c82('0x31')],_0x1a271f[_0x8c82('0x32')]);_0x2b79c2[_0x8c82('0x36')]=_[_0x8c82('0x35')](_0x1a271f[_0x8c82('0x31')],qs[_0x8c82('0x37')](_0x3e42ec['query'][_0x8c82('0x37')]));_0x2b79c2['attributes']=_0x2b79c2[_0x8c82('0x36')][_0x8c82('0x38')]?_0x2b79c2[_0x8c82('0x36')]:_0x1a271f[_0x8c82('0x31')];if(!_0x3e42ec[_0x8c82('0x32')][_0x8c82('0x39')](_0x8c82('0x3a'))){_0x2b79c2['limit']=qs[_0x8c82('0x1d')](_0x3e42ec[_0x8c82('0x32')]['limit']);_0x2b79c2['offset']=qs[_0x8c82('0x1b')](_0x3e42ec['query']['offset']);}_0x2b79c2[_0x8c82('0x3b')]=qs[_0x8c82('0x3c')](_0x3e42ec['query']['sort']);_0x2b79c2[_0x8c82('0x3d')]=qs[_0x8c82('0x34')](_[_0x8c82('0x3e')](_0x3e42ec[_0x8c82('0x32')],_0x1a271f[_0x8c82('0x34')]),_0x5c7686);if(_0x3e42ec[_0x8c82('0x32')]['filter']){_0x2b79c2[_0x8c82('0x3d')]=_[_0x8c82('0x3f')](_0x2b79c2[_0x8c82('0x3d')],{'$or':_[_0x8c82('0x2e')](_0x5c7686,function(_0x1d8d73){if(_0x1d8d73[_0x8c82('0x40')]!==_0x8c82('0x41')){var _0x1ad140={};_0x1ad140[_0x1d8d73[_0x8c82('0x2b')]]={'$like':'%'+_0x3e42ec[_0x8c82('0x32')][_0x8c82('0x42')]+'%'};return _0x1ad140;}})});}_0x2b79c2=_[_0x8c82('0x3f')]({},_0x2b79c2,_0x3e42ec['options']);var _0x50b39e={'where':_0x2b79c2[_0x8c82('0x3d')]};return db[_0x8c82('0x2f')][_0x8c82('0x1e')](_0x50b39e)[_0x8c82('0x26')](function(_0x103692){_0x2ba524[_0x8c82('0x1e')]=_0x103692;if(_0x3e42ec[_0x8c82('0x32')][_0x8c82('0x43')]){_0x2b79c2[_0x8c82('0x44')]=[{'all':!![]}];}return db[_0x8c82('0x2f')][_0x8c82('0x45')](_0x2b79c2);})[_0x8c82('0x26')](function(_0x59aa2a){_0x2ba524['rows']=_0x59aa2a;return _0x2ba524;})['then'](respondWithFilteredResult(_0x56d739,_0x2b79c2))['catch'](handleError(_0x56d739,null));};exports[_0x8c82('0x46')]=function(_0x491cda,_0x31d68f){var _0x20b942={'raw':!![],'where':{'id':_0x491cda[_0x8c82('0x47')]['id']}},_0x4b354f={};_0x4b354f['model']=_[_0x8c82('0x33')](db[_0x8c82('0x2f')]['rawAttributes']);_0x4b354f[_0x8c82('0x32')]=_[_0x8c82('0x33')](_0x491cda['query']);_0x4b354f[_0x8c82('0x34')]=_[_0x8c82('0x35')](_0x4b354f[_0x8c82('0x31')],_0x4b354f[_0x8c82('0x32')]);_0x20b942[_0x8c82('0x36')]=_[_0x8c82('0x35')](_0x4b354f['model'],qs[_0x8c82('0x37')](_0x491cda[_0x8c82('0x32')]['fields']));_0x20b942['attributes']=_0x20b942[_0x8c82('0x36')][_0x8c82('0x38')]?_0x20b942[_0x8c82('0x36')]:_0x4b354f[_0x8c82('0x31')];if(_0x491cda[_0x8c82('0x32')]['includeAll']){_0x20b942[_0x8c82('0x44')]=[{'all':!![]}];}_0x20b942=_[_0x8c82('0x3f')]({},_0x20b942,_0x491cda[_0x8c82('0x48')]);return db[_0x8c82('0x2f')][_0x8c82('0x49')](_0x20b942)['then'](handleEntityNotFound(_0x31d68f,null))['then'](respondWithResult(_0x31d68f,null))['catch'](handleError(_0x31d68f,null));};exports[_0x8c82('0x4a')]=function(_0x234212,_0x504395){return db[_0x8c82('0x2f')][_0x8c82('0x4a')](_0x234212[_0x8c82('0x4b')],{})['then'](respondWithResult(_0x504395,0xc9))['catch'](handleError(_0x504395,null));};exports[_0x8c82('0x25')]=function(_0x4dc7a2,_0x468b79){if(_0x4dc7a2[_0x8c82('0x4b')]['id']){delete _0x4dc7a2[_0x8c82('0x4b')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x4dc7a2[_0x8c82('0x47')]['id']}})[_0x8c82('0x26')](handleEntityNotFound(_0x468b79,null))[_0x8c82('0x26')](saveUpdates(_0x4dc7a2[_0x8c82('0x4b')],null))[_0x8c82('0x26')](respondWithResult(_0x468b79,null))[_0x8c82('0x4c')](handleError(_0x468b79,null));};exports[_0x8c82('0x27')]=function(_0x551e2d,_0x365a41){return db[_0x8c82('0x2f')][_0x8c82('0x49')]({'where':{'id':_0x551e2d[_0x8c82('0x47')]['id']}})['then'](handleEntityNotFound(_0x365a41,null))[_0x8c82('0x26')](removeEntity(_0x365a41,null))['catch'](handleError(_0x365a41,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index fb0da33..182546e 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 _0xc95c=['./smsApplication.attributes','exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1d5c5f,_0x5efc79){var _0x258f02=function(_0x438167){while(--_0x438167){_0x1d5c5f['push'](_0x1d5c5f['shift']());}};_0x258f02(++_0x5efc79);}(_0xc95c,0x130));var _0xcc95=function(_0x5d3768,_0x162a40){_0x5d3768=_0x5d3768-0x0;var _0x190fbc=_0xc95c[_0x5d3768];return _0x190fbc;};'use strict';var _=require(_0xcc95('0x0'));var util=require(_0xcc95('0x1'));var logger=require(_0xcc95('0x2'))(_0xcc95('0x3'));var moment=require(_0xcc95('0x4'));var BPromise=require(_0xcc95('0x5'));var rp=require(_0xcc95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc95('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc95('0x8'));module[_0xcc95('0x9')]=function(_0x4eccb6,_0x5a3f89){return _0x4eccb6[_0xcc95('0xa')](_0xcc95('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc95('0xc')});}; \ No newline at end of file +var _0xa71f=['util','../../config/logger','request-promise','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x2e78fd,_0x474e23){var _0x1f2d6a=function(_0x20357d){while(--_0x20357d){_0x2e78fd['push'](_0x2e78fd['shift']());}};_0x1f2d6a(++_0x474e23);}(_0xa71f,0xb4));var _0xfa71=function(_0xc09d51,_0x23889a){_0xc09d51=_0xc09d51-0x0;var _0x4fd34c=_0xa71f[_0xc09d51];return _0x4fd34c;};'use strict';var _=require('lodash');var util=require(_0xfa71('0x0'));var logger=require(_0xfa71('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa71('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa71('0x3'));var config=require(_0xfa71('0x4'));var attributes=require(_0xfa71('0x5'));module['exports']=function(_0xbb55cb,_0xe974dd){return _0xbb55cb[_0xfa71('0x6')](_0xfa71('0x7'),attributes,{'tableName':_0xfa71('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa71('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index aa9a075..6610f78 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 _0xd878=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4661b9,_0x1d96a7){var _0x2063f8=function(_0x1aa772){while(--_0x1aa772){_0x4661b9['push'](_0x4661b9['shift']());}};_0x2063f8(++_0x1d96a7);}(_0xd878,0x118));var _0x8d87=function(_0x5706dc,_0x281158){_0x5706dc=_0x5706dc-0x0;var _0x725bc9=_0xd878[_0x5706dc];return _0x725bc9;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var moment=require(_0x8d87('0x2'));var BPromise=require(_0x8d87('0x3'));var rs=require(_0x8d87('0x4'));var fs=require('fs');var Redis=require(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8d87('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b504e,_0xcb4dae,_0x1eba92){return new BPromise(function(_0x38fded,_0x2c1bd0){return client[_0x8d87('0x9')](_0x1b504e,_0x1eba92)[_0x8d87('0xa')](function(_0xf6aa49){logger['info'](_0x8d87('0xb'),_0xcb4dae,'request\x20sent');logger['debug'](_0x8d87('0xc'),_0xcb4dae,_0x8d87('0xd'),JSON[_0x8d87('0xe')](_0xf6aa49));if(_0xf6aa49[_0x8d87('0xf')]){if(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x10')]===0x1f4){logger['error'](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x2c1bd0(_0xf6aa49['error'][_0x8d87('0x11')]);}logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x38fded(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x11')]);}else{logger[_0x8d87('0x12')](_0x8d87('0xb'),_0xcb4dae,_0x8d87('0xd'));_0x38fded(_0xf6aa49[_0x8d87('0x13')][_0x8d87('0x11')]);}})[_0x8d87('0x14')](function(_0x520df5){logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0x520df5);_0x2c1bd0(_0x520df5);});});} \ No newline at end of file +var _0x3149=['stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x333b08,_0x432878){var _0x2d1fdf=function(_0x257d9d){while(--_0x257d9d){_0x333b08['push'](_0x333b08['shift']());}};_0x2d1fdf(++_0x432878);}(_0x3149,0x181));var _0x9314=function(_0x1906aa,_0x2e4885){_0x1906aa=_0x1906aa-0x0;var _0x56a751=_0x3149[_0x1906aa];return _0x56a751;};'use strict';var _=require(_0x9314('0x0'));var util=require('util');var moment=require(_0x9314('0x1'));var BPromise=require(_0x9314('0x2'));var rs=require(_0x9314('0x3'));var fs=require('fs');var Redis=require(_0x9314('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9314('0x5'));var logger=require(_0x9314('0x6'))(_0x9314('0x7'));var config=require(_0x9314('0x8'));var jayson=require(_0x9314('0x9'));var client=jayson['client'][_0x9314('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bb49e,_0x37d3f6,_0xf24d0c){return new BPromise(function(_0x341882,_0x51f785){return client[_0x9314('0xb')](_0x3bb49e,_0xf24d0c)['then'](function(_0x2d6cb8){logger['info'](_0x9314('0xc'),_0x37d3f6,_0x9314('0xd'));logger['debug'](_0x9314('0xe'),_0x37d3f6,'request\x20sent',JSON[_0x9314('0xf')](_0x2d6cb8));if(_0x2d6cb8[_0x9314('0x10')]){if(_0x2d6cb8[_0x9314('0x10')]['code']===0x1f4){logger[_0x9314('0x10')](_0x9314('0xc'),_0x37d3f6,_0x2d6cb8[_0x9314('0x10')][_0x9314('0x11')]);return _0x51f785(_0x2d6cb8[_0x9314('0x10')][_0x9314('0x11')]);}logger[_0x9314('0x10')]('SmsApplication,\x20%s,\x20%s',_0x37d3f6,_0x2d6cb8[_0x9314('0x10')][_0x9314('0x11')]);return _0x341882(_0x2d6cb8[_0x9314('0x10')]['message']);}else{logger[_0x9314('0x12')](_0x9314('0xc'),_0x37d3f6,_0x9314('0xd'));_0x341882(_0x2d6cb8['result'][_0x9314('0x11')]);}})[_0x9314('0x13')](function(_0x5b7e6a){logger[_0x9314('0x10')](_0x9314('0xc'),_0x37d3f6,_0x5b7e6a);_0x51f785(_0x5b7e6a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 79f76ed..582cd93 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 _0xf7b4=['/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0xa6939f,_0x20054f){var _0x3c39ba=function(_0x1fa0bf){while(--_0x1fa0bf){_0xa6939f['push'](_0xa6939f['shift']());}};_0x3c39ba(++_0x20054f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1c8317,_0x10ba0e){_0x1c8317=_0x1c8317-0x0;var _0x58c0ac=_0xf7b4[_0x1c8317];return _0x58c0ac;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/messages',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0x7')](_0x4f7b('0xf'),auth[_0x4f7b('0x8')](),controller['download']);router[_0x4f7b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['post'](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x16')),controller[_0x4f7b('0x17')]);router[_0x4f7b('0x18')](_0x4f7b('0xc'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x19')),controller['update']);router[_0x4f7b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),'smsinteraction:destroy'),controller[_0x4f7b('0x1b')]);router[_0x4f7b('0x1a')](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),controller['removeTags']);module[_0x4f7b('0x1c')]=router; \ No newline at end of file +var _0xb03e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags'];(function(_0x585221,_0xb7e318){var _0x17111b=function(_0x5c9de0){while(--_0x5c9de0){_0x585221['push'](_0x585221['shift']());}};_0x17111b(++_0xb7e318);}(_0xb03e,0x1eb));var _0xeb03=function(_0x40d49a,_0x49cd8c){_0x40d49a=_0x40d49a-0x0;var _0xff778e=_0xb03e[_0x40d49a];return _0xff778e;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth['isAuthenticated'](),controller[_0xeb03('0xf')]);router[_0xeb03('0xa')](_0xeb03('0x10'),auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router['get'](_0xeb03('0x12'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x13')]);router[_0xeb03('0x14')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x15')]);router[_0xeb03('0x14')](_0xeb03('0x10'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);router[_0xeb03('0x14')](_0xeb03('0x17'),auth['isAuthenticated'](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1a')),controller[_0xeb03('0x1b')]);router['put'](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')]('sms',_0xeb03('0x1c')),controller[_0xeb03('0x1d')]);router[_0xeb03('0x1e')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1f')),controller[_0xeb03('0x20')]);router[_0xeb03('0x1e')](_0xeb03('0x17'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x21')]);module[_0xeb03('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 4b62368..51d98ea 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 _0x0c42=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2a15e6,_0xc937e5){var _0x16fec3=function(_0x2dce22){while(--_0x2dce22){_0x2a15e6['push'](_0x2a15e6['shift']());}};_0x16fec3(++_0xc937e5);}(_0x0c42,0x191));var _0x20c4=function(_0x519f6f,_0x1af590){_0x519f6f=_0x519f6f-0x0;var _0x495c3e=_0x0c42[_0x519f6f];return _0x495c3e;};'use strict';var Sequelize=require(_0x20c4('0x0'));var moment=require(_0x20c4('0x1'));module[_0x20c4('0x2')]={'closed':{'type':Sequelize[_0x20c4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20c4('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x20c4('0x5')]},'note':{'type':Sequelize[_0x20c4('0x5')]},'phone':{'type':Sequelize[_0x20c4('0x5')]},'read1stAt':{'type':Sequelize[_0x20c4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x20c4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x20c4('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x20c4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa1aa=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x505d67,_0x158a94){var _0x3c516a=function(_0x3f2cb7){while(--_0x3f2cb7){_0x505d67['push'](_0x505d67['shift']());}};_0x3c516a(++_0x158a94);}(_0xa1aa,0x88));var _0xaa1a=function(_0x32def6,_0x1f4bbd){_0x32def6=_0x32def6-0x0;var _0x30954d=_0xa1aa[_0x32def6];return _0x30954d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xaa1a('0x0')]={'closed':{'type':Sequelize[_0xaa1a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaa1a('0x2')]},'disposition':{'type':Sequelize[_0xaa1a('0x3')]},'secondDisposition':{'type':Sequelize[_0xaa1a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xaa1a('0x3')]},'note':{'type':Sequelize[_0xaa1a('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xaa1a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xaa1a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaa1a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xaa1a('0x4')]('in',_0xaa1a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xaa1a('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 81bd1b3..853fd63 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 _0x18ff=['setTags','omit','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','Messages','createdAt','direction','secret','read','Owner','mkdirSync','Sms','Account','N.A.','closed','disposition','out','System','lastName','value','renderFile','downloadInteraction.ejs','join','log','err','rimraf','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','user','catch','show','params','model','keys','filters','query','attributes','intersection','fields','length','include','merge','find','create','body','describe','addMessage','SmsMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0x18ff,0x113));var _0xf18f=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x18ff[_0xae7c2f];return _0x5d7001;};'use strict';var rimraf=require(_0xf18f('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf18f('0x1'));var BPromise=require('bluebird');var util=require(_0xf18f('0x2'));var path=require(_0xf18f('0x3'));var ejs=require(_0xf18f('0x4'));var fs=require('fs');var _=require(_0xf18f('0x5'));var Redis=require('ioredis');var interaction=require(_0xf18f('0x6'));var qs=require(_0xf18f('0x7'));var pdf=require(_0xf18f('0x8'));var logger=require(_0xf18f('0x9'))(_0xf18f('0xa'));var config=require(_0xf18f('0xb'));var db=require(_0xf18f('0xc'))['db'];config[_0xf18f('0xd')]=_[_0xf18f('0xe')](config['redis'],{'host':_0xf18f('0xf'),'port':0x18eb});var socket=require(_0xf18f('0x10'))(new Redis(config[_0xf18f('0xd')]));require(_0xf18f('0x11'))[_0xf18f('0x12')](socket);function respondWithStatusCode(_0x2f37e2,_0x592f5f){_0x592f5f=_0x592f5f||0xcc;return function(_0x107354){if(_0x107354){return _0x2f37e2[_0xf18f('0x13')](_0x592f5f);}return _0x2f37e2[_0xf18f('0x14')](_0x592f5f)[_0xf18f('0x15')]();};}function respondWithResult(_0x3f3b07,_0x8a0a1c){_0x8a0a1c=_0x8a0a1c||0xc8;return function(_0x5cbe5c){if(_0x5cbe5c){return _0x3f3b07['status'](_0x8a0a1c)[_0xf18f('0x16')](_0x5cbe5c);}};}function respondWithFilteredResult(_0x1102cd,_0x46135d){return function(_0x59c595){if(_0x59c595){var _0x4c88bc=typeof _0x46135d[_0xf18f('0x17')]===_0xf18f('0x18')&&typeof _0x46135d[_0xf18f('0x19')]===_0xf18f('0x18');var _0x467bbb=_0x59c595[_0xf18f('0x1a')];var _0x3066ab=_0x4c88bc?0x0:_0x46135d[_0xf18f('0x17')];var _0x853cdf=_0x4c88bc?_0x59c595[_0xf18f('0x1a')]:_0x46135d[_0xf18f('0x17')]+_0x46135d[_0xf18f('0x19')];var _0x356934;if(_0x853cdf>=_0x467bbb){_0x853cdf=_0x467bbb;_0x356934=0xc8;}else{_0x356934=0xce;}_0x1102cd[_0xf18f('0x14')](_0x356934);return _0x1102cd[_0xf18f('0x1b')](_0xf18f('0x1c'),_0x3066ab+'-'+_0x853cdf+'/'+_0x467bbb)['json'](_0x59c595);}return null;};}function saveUpdates(_0xa5ede4){return function(_0x412c48){if(_0x412c48){return _0x412c48[_0xf18f('0x1d')](_0xa5ede4)['then'](function(_0x1e304a){return _0x1e304a;});}return null;};}function removeEntity(_0x1afe95){return function(_0x7c2009){if(_0x7c2009){return _0x7c2009[_0xf18f('0x1e')]()[_0xf18f('0x1f')](function(){_0x1afe95[_0xf18f('0x14')](0xcc)[_0xf18f('0x15')]();});}};}function handleEntityNotFound(_0x19db31){return function(_0x269345){if(!_0x269345){_0x19db31[_0xf18f('0x13')](0x194);}return _0x269345;};}function handleError(_0x5ce601,_0x355a3a){_0x355a3a=_0x355a3a||0x1f4;return function(_0x3c1002){logger[_0xf18f('0x20')](_0x3c1002[_0xf18f('0x21')]);if(_0x3c1002[_0xf18f('0x22')]){delete _0x3c1002[_0xf18f('0x22')];}_0x5ce601[_0xf18f('0x14')](_0x355a3a)[_0xf18f('0x23')](_0x3c1002);};}exports['index']=function(_0x26a6f4,_0x403452){var _0x33669b={};var _0x24fd0f=_['map'](db[_0xf18f('0x24')][_0xf18f('0x25')],function(_0x3d6039){return{'name':_0x3d6039[_0xf18f('0x26')],'type':_0x3d6039[_0xf18f('0x27')]['key']};});_0x33669b=qs[_0xf18f('0x28')](_0x24fd0f,_0x26a6f4);return interaction[_0xf18f('0x29')](_0xf18f('0x2a'),_0x26a6f4['query'],_0x26a6f4[_0xf18f('0x2b')],_0x33669b,_0x24fd0f)[_0xf18f('0x1f')](respondWithFilteredResult(_0x403452,_0x33669b))[_0xf18f('0x2c')](handleError(_0x403452,null));};exports[_0xf18f('0x2d')]=function(_0x507945,_0x2dc501){var _0x39db56={'raw':![],'where':{'id':_0x507945[_0xf18f('0x2e')]['id']}},_0x1846b5={};_0x1846b5[_0xf18f('0x2f')]=_[_0xf18f('0x30')](db['SmsInteraction'][_0xf18f('0x25')]);_0x1846b5['query']=_[_0xf18f('0x30')](_0x507945['query']);_0x1846b5[_0xf18f('0x31')]=_['intersection'](_0x1846b5[_0xf18f('0x2f')],_0x1846b5[_0xf18f('0x32')]);_0x39db56[_0xf18f('0x33')]=_[_0xf18f('0x34')](_0x1846b5[_0xf18f('0x2f')],qs[_0xf18f('0x35')](_0x507945[_0xf18f('0x32')][_0xf18f('0x35')]));_0x39db56[_0xf18f('0x33')]=_0x39db56[_0xf18f('0x33')][_0xf18f('0x36')]?_0x39db56[_0xf18f('0x33')]:_0x1846b5[_0xf18f('0x2f')];if(_0x507945[_0xf18f('0x32')]['includeAll']){_0x39db56[_0xf18f('0x37')]=[{'all':!![]}];}_0x39db56=_[_0xf18f('0x38')]({},_0x39db56,_0x507945['options']);return db[_0xf18f('0x24')][_0xf18f('0x39')](_0x39db56)[_0xf18f('0x1f')](handleEntityNotFound(_0x2dc501,null))[_0xf18f('0x1f')](respondWithResult(_0x2dc501,null))['catch'](handleError(_0x2dc501,null));};exports[_0xf18f('0x3a')]=function(_0x37ca27,_0x479600){return db[_0xf18f('0x24')][_0xf18f('0x3a')](_0x37ca27['body'],{})[_0xf18f('0x1f')](respondWithResult(_0x479600,0xc9))[_0xf18f('0x2c')](handleError(_0x479600,null));};exports[_0xf18f('0x1d')]=function(_0x1715b2,_0xff820e){if(_0x1715b2['body']['id']){delete _0x1715b2[_0xf18f('0x3b')]['id'];}return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x1715b2[_0xf18f('0x2e')]['id']}})['then'](handleEntityNotFound(_0xff820e,null))[_0xf18f('0x1f')](saveUpdates(_0x1715b2[_0xf18f('0x3b')],null))[_0xf18f('0x1f')](respondWithResult(_0xff820e,null))[_0xf18f('0x2c')](handleError(_0xff820e,null));};exports['destroy']=function(_0x1a946c,_0x4edd9e){return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x1a946c['params']['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x4edd9e,null))[_0xf18f('0x1f')](removeEntity(_0x4edd9e,null))[_0xf18f('0x2c')](handleError(_0x4edd9e,null));};exports[_0xf18f('0x3c')]=function(_0x4a2374,_0x1a43a3){return db['SmsInteraction']['describe']()[_0xf18f('0x1f')](respondWithResult(_0x1a43a3,null))['catch'](handleError(_0x1a43a3,null));};exports[_0xf18f('0x3d')]=function(_0x246115,_0x3db934){return db[_0xf18f('0x3e')][_0xf18f('0x39')]({'where':{'id':_0x246115[_0xf18f('0x2e')]['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x3db934,null))[_0xf18f('0x1f')](function(_0xa808cd){if(_0xa808cd){return _0xa808cd[_0xf18f('0x3d')](_0x246115['body'][_0xf18f('0x3f')],_['omit'](_0x246115[_0xf18f('0x3b')],[_0xf18f('0x3f'),'id'])||{});}})[_0xf18f('0x1f')](respondWithResult(_0x3db934,null))[_0xf18f('0x2c')](handleError(_0x3db934,null));};exports[_0xf18f('0x40')]=function(_0x56b69c,_0x53bb3c){var _0x22cb96={'raw':![],'where':{}};var _0x3b56af={};var _0x145931={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x56b69c[_0xf18f('0x2e')]['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x53bb3c,null))['then'](function(_0x14c4f6){if(_0x14c4f6){_0x3b56af['model']=_[_0xf18f('0x30')](db[_0xf18f('0x3e')][_0xf18f('0x25')]);_0x3b56af['query']=_['keys'](_0x56b69c[_0xf18f('0x32')]);_0x3b56af[_0xf18f('0x31')]=_['intersection'](_0x3b56af[_0xf18f('0x2f')],_0x3b56af['query']);_0x22cb96[_0xf18f('0x33')]=_[_0xf18f('0x34')](_0x3b56af['model'],qs[_0xf18f('0x35')](_0x56b69c['query']['fields']));_0x22cb96[_0xf18f('0x33')]=_0x22cb96[_0xf18f('0x33')]['length']?_0x22cb96['attributes']:_0x3b56af[_0xf18f('0x2f')];if(!_0x56b69c['query'][_0xf18f('0x41')](_0xf18f('0x42'))){_0x22cb96['limit']=qs[_0xf18f('0x19')](_0x56b69c[_0xf18f('0x32')][_0xf18f('0x19')]);_0x22cb96[_0xf18f('0x17')]=qs[_0xf18f('0x17')](_0x56b69c[_0xf18f('0x32')][_0xf18f('0x17')]);}_0x22cb96[_0xf18f('0x43')]=qs['sort'](_0x56b69c[_0xf18f('0x32')][_0xf18f('0x44')]);_0x22cb96[_0xf18f('0x45')]=qs['filters'](_[_0xf18f('0x46')](_0x56b69c[_0xf18f('0x32')],_0x3b56af['filters']));_0x22cb96[_0xf18f('0x45')]['SmsInteractionId']=_0x14c4f6['id'];if(_0x56b69c['query']['filter']){_0x22cb96[_0xf18f('0x45')]=_[_0xf18f('0x38')](_0x22cb96[_0xf18f('0x45')],{'$or':_['map'](_0x22cb96[_0xf18f('0x33')],function(_0xda671e){var _0x3dc7c1={};_0x3dc7c1[_0xda671e]={'$like':'%'+_0x56b69c['query'][_0xf18f('0x47')]+'%'};return _0x3dc7c1;})});}if(_0x56b69c[_0xf18f('0x32')]['$gte']){var _0x485ae3=_0x56b69c[_0xf18f('0x32')][_0xf18f('0x48')]['split'](',');var _0x465f40={};_0x465f40[_0x485ae3[0x0]]={'$gte':moment(_0x485ae3[0x1])['format'](_0xf18f('0x49'))};_0x22cb96[_0xf18f('0x45')]=_[_0xf18f('0x38')](_0x22cb96['where'],_0x465f40);}_0x22cb96=_['merge']({},_0x22cb96,_0x56b69c[_0xf18f('0x4a')]);return db[_0xf18f('0x3e')][_0xf18f('0x1a')]({'where':_0x22cb96[_0xf18f('0x45')]})[_0xf18f('0x1f')](function(_0x1ca97c){_0x145931['count']=_0x1ca97c;if(_0x56b69c['query']['includeAll']){_0x22cb96[_0xf18f('0x37')]=[{'all':!![]}];}return db[_0xf18f('0x3e')][_0xf18f('0x29')](_0x22cb96);})[_0xf18f('0x1f')](function(_0x2d7f72){_0x145931[_0xf18f('0x4b')]=_0x2d7f72;return _0x145931;});}})[_0xf18f('0x1f')](respondWithFilteredResult(_0x53bb3c,_0x22cb96))['catch'](handleError(_0x53bb3c,null));};exports['addTags']=function(_0x14ac8a,_0x24945f){return db[_0xf18f('0x24')]['find']({'where':{'id':_0x14ac8a[_0xf18f('0x2e')]['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x24945f,null))[_0xf18f('0x1f')](function(_0x53af58){if(_0x53af58){return _0x53af58[_0xf18f('0x4c')](_0x14ac8a[_0xf18f('0x3b')][_0xf18f('0x3f')],_[_0xf18f('0x4d')](_0x14ac8a['body'],[_0xf18f('0x3f'),'id'])||{})[_0xf18f('0x4e')](function(){return db['Tag'][_0xf18f('0x29')]({'attributes':['id','name',_0xf18f('0x4f')],'where':{'id':_0x14ac8a[_0xf18f('0x3b')][_0xf18f('0x3f')]}});})[_0xf18f('0x1f')](function(_0x229202){socket[_0xf18f('0x50')](_0xf18f('0x51'),{'id':Number(_0x14ac8a['params']['id']),'tags':_0x229202||[]});return{'id':Number(_0x14ac8a['params']['id']),'tags':_0x229202||[]};});}})[_0xf18f('0x1f')](respondWithResult(_0x24945f,null))[_0xf18f('0x2c')](handleError(_0x24945f,null));};exports['removeTags']=function(_0x5507cb,_0x22125b){return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x5507cb['params']['id']}})[_0xf18f('0x1f')](handleEntityNotFound(_0x22125b,null))[_0xf18f('0x1f')](function(_0x159c13){if(_0x159c13){return _0x159c13[_0xf18f('0x52')](_0x5507cb[_0xf18f('0x32')][_0xf18f('0x3f')]);}})[_0xf18f('0x1f')](respondWithStatusCode(_0x22125b,null))[_0xf18f('0x2c')](handleError(_0x22125b,null));};exports[_0xf18f('0x53')]=function(_0x175789,_0x25e4ef){var _0x256791=moment()[_0xf18f('0x54')]()[_0xf18f('0x55')]();var _0x2af3fd=path['join'](config[_0xf18f('0x56')],_0xf18f('0x57'),'files',_0xf18f('0x58'));var _0x33b5b6=path['join'](_0x2af3fd,_0x256791);var _0x595185=util[_0xf18f('0x59')](_0xf18f('0x5a'),_0x175789[_0xf18f('0x2e')]['id'],_0x256791);var _0x5dd808=path['join'](_0x2af3fd,_0x595185);var _0x5508b8=[];_0x5508b8[_0xf18f('0x5b')]({'model':db[_0xf18f('0x5c')],'as':'User','attributes':['id',_0xf18f('0x5d')],'raw':!![]});_0x5508b8[_0xf18f('0x5b')]({'model':db['CmContact'],'as':_0xf18f('0x5e'),'attributes':['id',_0xf18f('0x5f'),'lastName'],'raw':!![]});var _0x2cd467=[{'model':db[_0xf18f('0x3e')],'as':_0xf18f('0x60'),'attributes':['id','body',_0xf18f('0x61'),_0xf18f('0x62'),_0xf18f('0x63'),_0xf18f('0x64')],'include':_0x5508b8}];_0x2cd467[_0xf18f('0x5b')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xf18f('0x22')]});_0x2cd467['push']({'model':db[_0xf18f('0x5c')],'as':_0xf18f('0x65'),'attributes':['id',_0xf18f('0x5d')]});return db[_0xf18f('0x24')][_0xf18f('0x39')]({'where':{'id':_0x175789[_0xf18f('0x2e')]['id']},'include':_0x2cd467})[_0xf18f('0x1f')](handleEntityNotFound(_0x25e4ef,null))[_0xf18f('0x1f')](function(_0x57501f){if(_0x57501f){var _0x520c29=_0x57501f['get']({'plain':!![]});fs[_0xf18f('0x66')](_0x33b5b6);var _0x4e1b68={'channel':_0xf18f('0x67'),'account':_0x520c29[_0xf18f('0x68')][_0xf18f('0x22')],'agent':_0x520c29[_0xf18f('0x65')]?_0x520c29[_0xf18f('0x65')][_0xf18f('0x5d')]:_0xf18f('0x69'),'createdAt':moment(_0x520c29[_0xf18f('0x61')])[_0xf18f('0x59')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf18f('0x55')](),'closedAt':_0x520c29[_0xf18f('0x6a')]?moment(_0x520c29['closedAt'])[_0xf18f('0x59')](_0xf18f('0x49'))['toString']():'','disposition':_0x520c29[_0xf18f('0x6b')],'messages':_(_0x520c29[_0xf18f('0x60')])[_0xf18f('0x47')]({'secret':![]})['map'](function(_0x240082){return{'date':moment(_0x240082[_0xf18f('0x61')])[_0xf18f('0x59')](_0xf18f('0x49'))['toString'](),'sender':_0x240082[_0xf18f('0x62')]===_0xf18f('0x6c')?_0x240082[_0xf18f('0x5c')]?_0x240082[_0xf18f('0x5c')][_0xf18f('0x5d')]:_0xf18f('0x6d'):_0x240082[_0xf18f('0x5e')][_0xf18f('0x5f')]+(_0x240082[_0xf18f('0x5e')][_0xf18f('0x6e')]?'\x20'+_0x240082[_0xf18f('0x5e')][_0xf18f('0x6e')]:''),'body':_0x240082['body'],'direction':_0x240082[_0xf18f('0x62')]==='out'?'A':'C','secret':_0x240082[_0xf18f('0x63')],'read':_0x240082[_0xf18f('0x64')]};})[_0xf18f('0x6f')]()};return ejs[_0xf18f('0x70')](path['join'](config[_0xf18f('0x56')],'server','views',_0xf18f('0x71')),{'interaction':_0x4e1b68})[_0xf18f('0x1f')](function(_0x547d34){var _0x1241c1=path[_0xf18f('0x72')](_0x33b5b6,'transcript-'+_0x520c29['id']+'-'+_0x256791+'.pdf');var _0x26d14a={'path':_0x1241c1,'channel':_0xf18f('0x67'),'interactionId':_0x520c29['id']};return pdf['createPdfFromHTML'](_0x547d34,_0x26d14a);})[_0xf18f('0x1f')](function(){return new BPromise(function(_0x4e4f69,_0x79238c){zipdir(_0x33b5b6,{'saveTo':_0x5dd808},function(_0xbf1cbb,_0x321a45){if(_0xbf1cbb)return _0x79238c(_0xbf1cbb);return _0x4e4f69(_0x321a45);});})[_0xf18f('0x1f')](function(){return new BPromise(function(_0x5ab5b0,_0x497cdb){rimraf(_0x33b5b6,function(_0x2e7b99){if(_0x2e7b99)_0x497cdb(_0x2e7b99);return _0x5ab5b0();});});})['then'](function(){return _0x25e4ef[_0xf18f('0x53')](_0x5dd808,_0x595185,function(_0x29a516){if(_0x29a516){console[_0xf18f('0x73')](_0xf18f('0x74'),_0x29a516);}else{fs['unlinkSync'](_0x5dd808);}});});});}else{return _0x25e4ef['sendStatus'](0xc8);}})[_0xf18f('0x2c')](handleError(_0x25e4ef,null));}; \ No newline at end of file +var _0x21ee=['join','views','downloadInteraction.ejs','transcript-','.pdf','err','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','limit','offset','count','set','Content-Range','update','destroy','then','error','stack','name','index','map','SmsInteraction','fieldName','key','findAll','sms','query','catch','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','addMessage','SmsMessage','ids','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','rows','addTags','setTags','omit','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','createdAt','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','Messages','out','System','read','renderFile'];(function(_0x5a10a1,_0x1b9d9f){var _0xbf0f8c=function(_0x36c837){while(--_0x36c837){_0x5a10a1['push'](_0x5a10a1['shift']());}};_0xbf0f8c(++_0x1b9d9f);}(_0x21ee,0x1ea));var _0xe21e=function(_0x304c81,_0xdca0){_0x304c81=_0x304c81-0x0;var _0xc866bc=_0x21ee[_0x304c81];return _0xc866bc;};'use strict';var rimraf=require(_0xe21e('0x0'));var zipdir=require(_0xe21e('0x1'));var moment=require(_0xe21e('0x2'));var BPromise=require(_0xe21e('0x3'));var util=require(_0xe21e('0x4'));var path=require(_0xe21e('0x5'));var ejs=require(_0xe21e('0x6'));var fs=require('fs');var _=require(_0xe21e('0x7'));var Redis=require('ioredis');var interaction=require(_0xe21e('0x8'));var qs=require(_0xe21e('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xe21e('0xa'))(_0xe21e('0xb'));var config=require(_0xe21e('0xc'));var db=require(_0xe21e('0xd'))['db'];config['redis']=_[_0xe21e('0xe')](config['redis'],{'host':_0xe21e('0xf'),'port':0x18eb});var socket=require(_0xe21e('0x10'))(new Redis(config['redis']));require(_0xe21e('0x11'))[_0xe21e('0x12')](socket);function respondWithStatusCode(_0x5c56bb,_0xf64111){_0xf64111=_0xf64111||0xcc;return function(_0x820210){if(_0x820210){return _0x5c56bb[_0xe21e('0x13')](_0xf64111);}return _0x5c56bb[_0xe21e('0x14')](_0xf64111)[_0xe21e('0x15')]();};}function respondWithResult(_0x3ff845,_0x3096d9){_0x3096d9=_0x3096d9||0xc8;return function(_0x5c3c48){if(_0x5c3c48){return _0x3ff845[_0xe21e('0x14')](_0x3096d9)[_0xe21e('0x16')](_0x5c3c48);}};}function respondWithFilteredResult(_0x15cea0,_0xea27ce){return function(_0x24c771){if(_0x24c771){var _0x1d79ad=typeof _0xea27ce['offset']==='undefined'&&typeof _0xea27ce[_0xe21e('0x17')]==='undefined';var _0x392b52=_0x24c771['count'];var _0x4cba93=_0x1d79ad?0x0:_0xea27ce[_0xe21e('0x18')];var _0x31e569=_0x1d79ad?_0x24c771[_0xe21e('0x19')]:_0xea27ce[_0xe21e('0x18')]+_0xea27ce[_0xe21e('0x17')];var _0x1ee819;if(_0x31e569>=_0x392b52){_0x31e569=_0x392b52;_0x1ee819=0xc8;}else{_0x1ee819=0xce;}_0x15cea0['status'](_0x1ee819);return _0x15cea0[_0xe21e('0x1a')](_0xe21e('0x1b'),_0x4cba93+'-'+_0x31e569+'/'+_0x392b52)[_0xe21e('0x16')](_0x24c771);}return null;};}function saveUpdates(_0x1be9e2){return function(_0x5d4829){if(_0x5d4829){return _0x5d4829[_0xe21e('0x1c')](_0x1be9e2)['then'](function(_0x49dcf5){return _0x49dcf5;});}return null;};}function removeEntity(_0xc7e507){return function(_0x3035db){if(_0x3035db){return _0x3035db[_0xe21e('0x1d')]()[_0xe21e('0x1e')](function(){_0xc7e507[_0xe21e('0x14')](0xcc)[_0xe21e('0x15')]();});}};}function handleEntityNotFound(_0x165b87){return function(_0xf1723d){if(!_0xf1723d){_0x165b87['sendStatus'](0x194);}return _0xf1723d;};}function handleError(_0x19b4ba,_0x4ac1a8){_0x4ac1a8=_0x4ac1a8||0x1f4;return function(_0x3a6603){logger[_0xe21e('0x1f')](_0x3a6603[_0xe21e('0x20')]);if(_0x3a6603[_0xe21e('0x21')]){delete _0x3a6603[_0xe21e('0x21')];}_0x19b4ba['status'](_0x4ac1a8)['send'](_0x3a6603);};}exports[_0xe21e('0x22')]=function(_0x426313,_0x4ad177){var _0x47cd0c={};var _0x14b887=_[_0xe21e('0x23')](db[_0xe21e('0x24')]['rawAttributes'],function(_0x17af91){return{'name':_0x17af91[_0xe21e('0x25')],'type':_0x17af91['type'][_0xe21e('0x26')]};});_0x47cd0c=qs['getOptions'](_0x14b887,_0x426313);return interaction[_0xe21e('0x27')](_0xe21e('0x28'),_0x426313[_0xe21e('0x29')],_0x426313['user'],_0x47cd0c,_0x14b887)['then'](respondWithFilteredResult(_0x4ad177,_0x47cd0c))[_0xe21e('0x2a')](handleError(_0x4ad177,null));};exports[_0xe21e('0x2b')]=function(_0x3bb95a,_0x2ba36d){var _0x1ecc96={'raw':![],'where':{'id':_0x3bb95a[_0xe21e('0x2c')]['id']}},_0xa6b11={};_0xa6b11[_0xe21e('0x2d')]=_[_0xe21e('0x2e')](db[_0xe21e('0x24')]['rawAttributes']);_0xa6b11[_0xe21e('0x29')]=_[_0xe21e('0x2e')](_0x3bb95a[_0xe21e('0x29')]);_0xa6b11[_0xe21e('0x2f')]=_[_0xe21e('0x30')](_0xa6b11[_0xe21e('0x2d')],_0xa6b11[_0xe21e('0x29')]);_0x1ecc96[_0xe21e('0x31')]=_[_0xe21e('0x30')](_0xa6b11['model'],qs[_0xe21e('0x32')](_0x3bb95a[_0xe21e('0x29')][_0xe21e('0x32')]));_0x1ecc96[_0xe21e('0x31')]=_0x1ecc96[_0xe21e('0x31')]['length']?_0x1ecc96[_0xe21e('0x31')]:_0xa6b11[_0xe21e('0x2d')];if(_0x3bb95a[_0xe21e('0x29')][_0xe21e('0x33')]){_0x1ecc96[_0xe21e('0x34')]=[{'all':!![]}];}_0x1ecc96=_[_0xe21e('0x35')]({},_0x1ecc96,_0x3bb95a[_0xe21e('0x36')]);return db[_0xe21e('0x24')][_0xe21e('0x37')](_0x1ecc96)[_0xe21e('0x1e')](handleEntityNotFound(_0x2ba36d,null))[_0xe21e('0x1e')](respondWithResult(_0x2ba36d,null))[_0xe21e('0x2a')](handleError(_0x2ba36d,null));};exports[_0xe21e('0x38')]=function(_0x3bb58f,_0x544457){return db[_0xe21e('0x24')][_0xe21e('0x38')](_0x3bb58f[_0xe21e('0x39')],{})['then'](respondWithResult(_0x544457,0xc9))[_0xe21e('0x2a')](handleError(_0x544457,null));};exports[_0xe21e('0x1c')]=function(_0x11da6c,_0x33946d){if(_0x11da6c[_0xe21e('0x39')]['id']){delete _0x11da6c[_0xe21e('0x39')]['id'];}return db[_0xe21e('0x24')][_0xe21e('0x37')]({'where':{'id':_0x11da6c['params']['id']}})['then'](handleEntityNotFound(_0x33946d,null))['then'](saveUpdates(_0x11da6c[_0xe21e('0x39')],null))[_0xe21e('0x1e')](respondWithResult(_0x33946d,null))[_0xe21e('0x2a')](handleError(_0x33946d,null));};exports[_0xe21e('0x1d')]=function(_0x227901,_0x125d0d){return db[_0xe21e('0x24')][_0xe21e('0x37')]({'where':{'id':_0x227901[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1e')](handleEntityNotFound(_0x125d0d,null))['then'](removeEntity(_0x125d0d,null))['catch'](handleError(_0x125d0d,null));};exports['describe']=function(_0x15134c,_0x300aab){return db[_0xe21e('0x24')]['describe']()[_0xe21e('0x1e')](respondWithResult(_0x300aab,null))['catch'](handleError(_0x300aab,null));};exports[_0xe21e('0x3a')]=function(_0x5f3f52,_0x3531e0){return db[_0xe21e('0x3b')][_0xe21e('0x37')]({'where':{'id':_0x5f3f52[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1e')](handleEntityNotFound(_0x3531e0,null))[_0xe21e('0x1e')](function(_0x591054){if(_0x591054){return _0x591054[_0xe21e('0x3a')](_0x5f3f52[_0xe21e('0x39')][_0xe21e('0x3c')],_['omit'](_0x5f3f52[_0xe21e('0x39')],[_0xe21e('0x3c'),'id'])||{});}})[_0xe21e('0x1e')](respondWithResult(_0x3531e0,null))[_0xe21e('0x2a')](handleError(_0x3531e0,null));};exports[_0xe21e('0x3d')]=function(_0x80d80f,_0x4e50ca){var _0x2e599c={'raw':![],'where':{}};var _0x51574e={};var _0x2eadb2={'count':0x0,'rows':[]};return db[_0xe21e('0x24')][_0xe21e('0x3e')]({'where':{'id':_0x80d80f[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1e')](handleEntityNotFound(_0x4e50ca,null))[_0xe21e('0x1e')](function(_0x4121c8){if(_0x4121c8){_0x51574e[_0xe21e('0x2d')]=_[_0xe21e('0x2e')](db['SmsMessage']['rawAttributes']);_0x51574e[_0xe21e('0x29')]=_[_0xe21e('0x2e')](_0x80d80f[_0xe21e('0x29')]);_0x51574e['filters']=_['intersection'](_0x51574e[_0xe21e('0x2d')],_0x51574e[_0xe21e('0x29')]);_0x2e599c['attributes']=_['intersection'](_0x51574e['model'],qs[_0xe21e('0x32')](_0x80d80f['query']['fields']));_0x2e599c[_0xe21e('0x31')]=_0x2e599c[_0xe21e('0x31')][_0xe21e('0x3f')]?_0x2e599c[_0xe21e('0x31')]:_0x51574e[_0xe21e('0x2d')];if(!_0x80d80f[_0xe21e('0x29')][_0xe21e('0x40')](_0xe21e('0x41'))){_0x2e599c['limit']=qs['limit'](_0x80d80f[_0xe21e('0x29')][_0xe21e('0x17')]);_0x2e599c['offset']=qs['offset'](_0x80d80f[_0xe21e('0x29')][_0xe21e('0x18')]);}_0x2e599c[_0xe21e('0x42')]=qs[_0xe21e('0x43')](_0x80d80f[_0xe21e('0x29')]['sort']);_0x2e599c[_0xe21e('0x44')]=qs[_0xe21e('0x2f')](_['pick'](_0x80d80f['query'],_0x51574e[_0xe21e('0x2f')]));_0x2e599c[_0xe21e('0x44')][_0xe21e('0x45')]=_0x4121c8['id'];if(_0x80d80f[_0xe21e('0x29')]['filter']){_0x2e599c['where']=_['merge'](_0x2e599c['where'],{'$or':_[_0xe21e('0x23')](_0x2e599c['attributes'],function(_0x1ea4d9){var _0x5efa4c={};_0x5efa4c[_0x1ea4d9]={'$like':'%'+_0x80d80f[_0xe21e('0x29')][_0xe21e('0x46')]+'%'};return _0x5efa4c;})});}if(_0x80d80f[_0xe21e('0x29')][_0xe21e('0x47')]){var _0x580d66=_0x80d80f['query'][_0xe21e('0x47')][_0xe21e('0x48')](',');var _0x39ffa5={};_0x39ffa5[_0x580d66[0x0]]={'$gte':moment(_0x580d66[0x1])[_0xe21e('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2e599c['where']=_[_0xe21e('0x35')](_0x2e599c[_0xe21e('0x44')],_0x39ffa5);}_0x2e599c=_['merge']({},_0x2e599c,_0x80d80f[_0xe21e('0x36')]);return db[_0xe21e('0x3b')][_0xe21e('0x19')]({'where':_0x2e599c[_0xe21e('0x44')]})[_0xe21e('0x1e')](function(_0x4371f4){_0x2eadb2['count']=_0x4371f4;if(_0x80d80f[_0xe21e('0x29')][_0xe21e('0x33')]){_0x2e599c[_0xe21e('0x34')]=[{'all':!![]}];}return db[_0xe21e('0x3b')][_0xe21e('0x27')](_0x2e599c);})[_0xe21e('0x1e')](function(_0x4850e4){_0x2eadb2[_0xe21e('0x4a')]=_0x4850e4;return _0x2eadb2;});}})[_0xe21e('0x1e')](respondWithFilteredResult(_0x4e50ca,_0x2e599c))[_0xe21e('0x2a')](handleError(_0x4e50ca,null));};exports[_0xe21e('0x4b')]=function(_0x2f55d1,_0x475372){return db['SmsInteraction']['find']({'where':{'id':_0x2f55d1[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1e')](handleEntityNotFound(_0x475372,null))[_0xe21e('0x1e')](function(_0x42621d){if(_0x42621d){return _0x42621d[_0xe21e('0x4c')](_0x2f55d1[_0xe21e('0x39')][_0xe21e('0x3c')],_[_0xe21e('0x4d')](_0x2f55d1[_0xe21e('0x39')],[_0xe21e('0x3c'),'id'])||{})['spread'](function(){return db[_0xe21e('0x4e')][_0xe21e('0x27')]({'attributes':['id',_0xe21e('0x21'),_0xe21e('0x4f')],'where':{'id':_0x2f55d1[_0xe21e('0x39')]['ids']}});})[_0xe21e('0x1e')](function(_0x561324){socket[_0xe21e('0x50')](_0xe21e('0x51'),{'id':Number(_0x2f55d1[_0xe21e('0x2c')]['id']),'tags':_0x561324||[]});return{'id':Number(_0x2f55d1['params']['id']),'tags':_0x561324||[]};});}})[_0xe21e('0x1e')](respondWithResult(_0x475372,null))[_0xe21e('0x2a')](handleError(_0x475372,null));};exports[_0xe21e('0x52')]=function(_0x3fb9a5,_0x1c860f){return db[_0xe21e('0x24')][_0xe21e('0x37')]({'where':{'id':_0x3fb9a5[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1e')](handleEntityNotFound(_0x1c860f,null))[_0xe21e('0x1e')](function(_0x1837c8){if(_0x1837c8){return _0x1837c8[_0xe21e('0x52')](_0x3fb9a5['query'][_0xe21e('0x3c')]);}})[_0xe21e('0x1e')](respondWithStatusCode(_0x1c860f,null))[_0xe21e('0x2a')](handleError(_0x1c860f,null));};exports[_0xe21e('0x53')]=function(_0x2227c7,_0x20d0f3){var _0x3a92f8=moment()[_0xe21e('0x54')]()[_0xe21e('0x55')]();var _0x5a527a=path['join'](config[_0xe21e('0x56')],_0xe21e('0x57'),_0xe21e('0x58'),_0xe21e('0x59'));var _0x5bc496=path['join'](_0x5a527a,_0x3a92f8);var _0x1cfe50=util[_0xe21e('0x49')](_0xe21e('0x5a'),_0x2227c7[_0xe21e('0x2c')]['id'],_0x3a92f8);var _0x1c6b92=path['join'](_0x5a527a,_0x1cfe50);var _0x49ecb9=[];_0x49ecb9[_0xe21e('0x5b')]({'model':db['User'],'as':_0xe21e('0x5c'),'attributes':['id',_0xe21e('0x5d')],'raw':!![]});_0x49ecb9['push']({'model':db[_0xe21e('0x5e')],'as':_0xe21e('0x5f'),'attributes':['id','firstName',_0xe21e('0x60')],'raw':!![]});var _0x5115eb=[{'model':db[_0xe21e('0x3b')],'as':'Messages','attributes':['id',_0xe21e('0x39'),'createdAt',_0xe21e('0x61'),_0xe21e('0x62'),'read'],'include':_0x49ecb9}];_0x5115eb[_0xe21e('0x5b')]({'model':db[_0xe21e('0x63')],'as':_0xe21e('0x64'),'attributes':['id','name']});_0x5115eb['push']({'model':db[_0xe21e('0x5c')],'as':_0xe21e('0x65'),'attributes':['id',_0xe21e('0x5d')]});return db[_0xe21e('0x24')][_0xe21e('0x37')]({'where':{'id':_0x2227c7['params']['id']},'include':_0x5115eb})['then'](handleEntityNotFound(_0x20d0f3,null))[_0xe21e('0x1e')](function(_0x1fefb4){if(_0x1fefb4){var _0x16939f=_0x1fefb4[_0xe21e('0x66')]({'plain':!![]});fs['mkdirSync'](_0x5bc496);var _0x244149={'channel':_0xe21e('0x67'),'account':_0x16939f[_0xe21e('0x64')][_0xe21e('0x21')],'agent':_0x16939f[_0xe21e('0x65')]?_0x16939f[_0xe21e('0x65')][_0xe21e('0x5d')]:_0xe21e('0x68'),'createdAt':moment(_0x16939f[_0xe21e('0x69')])[_0xe21e('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe21e('0x55')](),'closedAt':_0x16939f[_0xe21e('0x6a')]?moment(_0x16939f[_0xe21e('0x6b')])[_0xe21e('0x49')](_0xe21e('0x6c'))[_0xe21e('0x55')]():'','disposition':_0x16939f[_0xe21e('0x6d')],'messages':_(_0x16939f[_0xe21e('0x6e')])['filter']({'secret':![]})[_0xe21e('0x23')](function(_0x4a484e){return{'date':moment(_0x4a484e[_0xe21e('0x69')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe21e('0x55')](),'sender':_0x4a484e[_0xe21e('0x61')]===_0xe21e('0x6f')?_0x4a484e['User']?_0x4a484e[_0xe21e('0x5c')][_0xe21e('0x5d')]:_0xe21e('0x70'):_0x4a484e[_0xe21e('0x5f')]['firstName']+(_0x4a484e[_0xe21e('0x5f')][_0xe21e('0x60')]?'\x20'+_0x4a484e['Contact']['lastName']:''),'body':_0x4a484e['body'],'direction':_0x4a484e[_0xe21e('0x61')]===_0xe21e('0x6f')?'A':'C','secret':_0x4a484e['secret'],'read':_0x4a484e[_0xe21e('0x71')]};})['value']()};return ejs[_0xe21e('0x72')](path[_0xe21e('0x73')](config[_0xe21e('0x56')],_0xe21e('0x57'),_0xe21e('0x74'),_0xe21e('0x75')),{'interaction':_0x244149})[_0xe21e('0x1e')](function(_0x2f8ef3){var _0xef1479=path['join'](_0x5bc496,_0xe21e('0x76')+_0x16939f['id']+'-'+_0x3a92f8+_0xe21e('0x77'));var _0x47c86e={'path':_0xef1479,'channel':_0xe21e('0x67'),'interactionId':_0x16939f['id']};return pdf['createPdfFromHTML'](_0x2f8ef3,_0x47c86e);})[_0xe21e('0x1e')](function(){return new BPromise(function(_0x1ee661,_0x9fefad){zipdir(_0x5bc496,{'saveTo':_0x1c6b92},function(_0x200f1f,_0x34f916){if(_0x200f1f)return _0x9fefad(_0x200f1f);return _0x1ee661(_0x34f916);});})[_0xe21e('0x1e')](function(){return new BPromise(function(_0x2884aa,_0x3366b7){rimraf(_0x5bc496,function(_0x4e94a8){if(_0x4e94a8)_0x3366b7(_0x4e94a8);return _0x2884aa();});});})[_0xe21e('0x1e')](function(){return _0x20d0f3[_0xe21e('0x53')](_0x1c6b92,_0x1cfe50,function(_0xce0cb7){if(_0xce0cb7){console['log'](_0xe21e('0x78'),_0xce0cb7);}else{fs['unlinkSync'](_0x1c6b92);}});});});}else{return _0x20d0f3['sendStatus'](0xc8);}})[_0xe21e('0x2a')](handleError(_0x20d0f3,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 98e6785..39f143a 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 _0xea28=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xea28,0x13a));var _0x8ea2=function(_0x38773d,_0x2fd5d7){_0x38773d=_0x38773d-0x0;var _0x2eeb1f=_0xea28[_0x38773d];return _0x2eeb1f;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var SmsInteraction=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var SmsMessage=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8ea2('0x4')](0x0);var events={'afterCreate':_0x8ea2('0x5'),'afterUpdate':_0x8ea2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x9b45ab){return function(_0x23aaf1,_0x1ccf12,_0x513a0d){_0x23aaf1[_0x8ea2('0x7')]({'attributes':['id'],'raw':!![]})[_0x8ea2('0x8')](function(_0xb7f278){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xa'),_0xb7f278[_0x8ea2('0xb')](function(_0x19bd6c){return{'id':_0x19bd6c['id']};}));return SmsMessage[_0x8ea2('0xc')]({'where':{'SmsInteractionId':_0x23aaf1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8ea2('0x8')](function(_0x3000f9){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xd'),_0x3000f9['length']);SmsInteractionEvents['emit'](_0x9b45ab+':'+_0x23aaf1['id'],_0x23aaf1);SmsInteractionEvents[_0x8ea2('0xe')](_0x9b45ab,_0x23aaf1);_0x513a0d(null);})[_0x8ea2('0xf')](_0x513a0d(null));};}for(var e in events){if(events[_0x8ea2('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x8ea2('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x1ce9f1,_0x318abb){var _0xc2df0a=function(_0x1ea671){while(--_0x1ea671){_0x1ce9f1['push'](_0x1ce9f1['shift']());}};_0xc2df0a(++_0x318abb);}(_0x236c,0x155));var _0xc236=function(_0x39678d,_0xb0e3e4){_0x39678d=_0x39678d-0x0;var _0x2eb0a2=_0x236c[_0x39678d];return _0x2eb0a2;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0b03a49..6adee17 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 _0x612a=['define','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x612a,0xd6));var _0xa612=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x612a[_0x1073ad];return _0x528474;};'use strict';var _=require(_0xa612('0x0'));var util=require(_0xa612('0x1'));var logger=require(_0xa612('0x2'))(_0xa612('0x3'));var moment=require('moment');var BPromise=require(_0xa612('0x4'));var rp=require(_0xa612('0x5'));var fs=require('fs');var path=require(_0xa612('0x6'));var rimraf=require(_0xa612('0x7'));var config=require(_0xa612('0x8'));var attributes=require('./smsInteraction.attributes');module[_0xa612('0x9')]=function(_0x57157d,_0x2605be){return _0x57157d[_0xa612('0xa')]('SmsInteraction',attributes,{'tableName':_0xa612('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbe567e,_0x4eacce,_0x24aee4){if(_0xbe567e[_0xa612('0xc')](_0xa612('0xd'))){_0xbe567e[_0xa612('0xe')]=moment()['format'](_0xa612('0xf'));}_0x24aee4(null,_0xbe567e);}}});}; \ No newline at end of file +var _0x01d7=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed'];(function(_0x3f7e37,_0x5974dd){var _0x222bcf=function(_0x3c57a0){while(--_0x3c57a0){_0x3f7e37['push'](_0x3f7e37['shift']());}};_0x222bcf(++_0x5974dd);}(_0x01d7,0x145));var _0x701d=function(_0x33e669,_0x5f7da6){_0x33e669=_0x33e669-0x0;var _0x1c27a7=_0x01d7[_0x33e669];return _0x1c27a7;};'use strict';var _=require(_0x701d('0x0'));var util=require(_0x701d('0x1'));var logger=require(_0x701d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x701d('0x3'));var rp=require(_0x701d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x701d('0x5'));module[_0x701d('0x6')]=function(_0xe56c25,_0x153ba4){return _0xe56c25[_0x701d('0x7')](_0x701d('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24b12d,_0x4f4023,_0x411684){if(_0x24b12d[_0x701d('0x9')](_0x701d('0xa'))){_0x24b12d[_0x701d('0xb')]=moment()[_0x701d('0xc')](_0x701d('0xd'));}_0x411684(null,_0x24b12d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2a77cfb..da0a4e7 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 _0xbb47=['limit','catch','find','addTags','body','ids','omit','spread','AddTags','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes'];(function(_0x141e11,_0x38f0a7){var _0x5135e9=function(_0x39a007){while(--_0x39a007){_0x141e11['push'](_0x141e11['shift']());}};_0x5135e9(++_0x38f0a7);}(_0xbb47,0xc7));var _0x7bb4=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0xbb47[_0x207d2f];return _0x3c3498;};'use strict';var _=require('lodash');var util=require(_0x7bb4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7bb4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7bb4('0x2'))(_0x7bb4('0x3'));var config=require(_0x7bb4('0x4'));var jayson=require(_0x7bb4('0x5'));var client=jayson[_0x7bb4('0x6')][_0x7bb4('0x7')]({'port':0x232a});config[_0x7bb4('0x8')]=_['defaults'](config[_0x7bb4('0x8')],{'host':_0x7bb4('0x9'),'port':0x18eb});var socket=require(_0x7bb4('0xa'))(new Redis(config['redis']));require(_0x7bb4('0xb'))[_0x7bb4('0xc')](socket);function respondWithRpcPromise(_0x4d4813,_0x27f23e,_0x5694c0){return new BPromise(function(_0x346867,_0x1f2b97){return client[_0x7bb4('0xd')](_0x4d4813,_0x5694c0)[_0x7bb4('0xe')](function(_0x2dcdc6){logger[_0x7bb4('0xf')](_0x7bb4('0x10'),_0x27f23e,_0x7bb4('0x11'));logger[_0x7bb4('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x27f23e,'request\x20sent',JSON[_0x7bb4('0x13')](_0x2dcdc6));if(_0x2dcdc6[_0x7bb4('0x14')]){if(_0x2dcdc6['error']['code']===0x1f4){logger[_0x7bb4('0x14')](_0x7bb4('0x10'),_0x27f23e,_0x2dcdc6[_0x7bb4('0x14')][_0x7bb4('0x15')]);return _0x1f2b97(_0x2dcdc6[_0x7bb4('0x14')][_0x7bb4('0x15')]);}logger['error'](_0x7bb4('0x10'),_0x27f23e,_0x2dcdc6['error'][_0x7bb4('0x15')]);return _0x346867(_0x2dcdc6[_0x7bb4('0x14')][_0x7bb4('0x15')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x27f23e,'request\x20sent');_0x346867(_0x2dcdc6[_0x7bb4('0x16')][_0x7bb4('0x15')]);}})['catch'](function(_0x163abe){logger[_0x7bb4('0x14')](_0x7bb4('0x10'),_0x27f23e,_0x163abe);_0x1f2b97(_0x163abe);});});}exports[_0x7bb4('0x17')]=function(_0x4ed554){var _0x32b75c=this;return new Promise(function(_0x1afc0a,_0x443779){return db[_0x7bb4('0x18')]['update'](_0x4ed554['body'],{'raw':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554['options'][_0x7bb4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554[_0x7bb4('0x19')][_0x7bb4('0x1b')]||null:null,'attributes':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554[_0x7bb4('0x19')][_0x7bb4('0x1c')]||null:null,'limit':_0x4ed554[_0x7bb4('0x19')]?_0x4ed554[_0x7bb4('0x19')][_0x7bb4('0x1d')]||null:null})[_0x7bb4('0xe')](function(_0x593389){logger[_0x7bb4('0xf')](_0x7bb4('0x17'),_0x4ed554);logger[_0x7bb4('0x12')]('UpdateSmsInteraction',_0x4ed554,JSON[_0x7bb4('0x13')](_0x593389));_0x1afc0a(_0x593389);})[_0x7bb4('0x1e')](function(_0x599f8a){logger[_0x7bb4('0x14')]('UpdateSmsInteraction',_0x599f8a[_0x7bb4('0x15')],_0x4ed554);_0x443779(_0x32b75c[_0x7bb4('0x14')](0x1f4,_0x599f8a[_0x7bb4('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0x36e865){return new Promise(function(_0x5c268f,_0x1a892f){return db[_0x7bb4('0x18')][_0x7bb4('0x1f')]({'where':_0x36e865[_0x7bb4('0x19')]?_0x36e865['options'][_0x7bb4('0x1b')]||null:null})['then'](function(_0xbadc06){if(_0xbadc06){return _0xbadc06[_0x7bb4('0x20')](_0x36e865[_0x7bb4('0x21')][_0x7bb4('0x22')],_[_0x7bb4('0x23')](_0x36e865[_0x7bb4('0x21')],['ids','id'])||{});}})[_0x7bb4('0x24')](function(_0xce3d3){logger[_0x7bb4('0xf')](_0x7bb4('0x25'),_0x36e865);logger[_0x7bb4('0x12')](_0x7bb4('0x25'),_0x36e865,JSON[_0x7bb4('0x13')](_0xce3d3));_0x5c268f(_0xce3d3);})['catch'](function(_0x58691f){logger[_0x7bb4('0x14')](_0x7bb4('0x25'),_0x58691f['message'],_0x36e865);_0x1a892f(_this[_0x7bb4('0x14')](0x1f4,_0x58691f['message']));});});}; \ No newline at end of file +var _0xd578=['find','addTags','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','update','body','options','raw','where','attributes','UpdateSmsInteraction','stringify','AddTagsToSmsInteraction'];(function(_0x505ce2,_0x487acf){var _0xdb8a8c=function(_0xf3b364){while(--_0xf3b364){_0x505ce2['push'](_0x505ce2['shift']());}};_0xdb8a8c(++_0x487acf);}(_0xd578,0x165));var _0x8d57=function(_0x14f86d,_0x365920){_0x14f86d=_0x14f86d-0x0;var _0x576c2e=_0xd578[_0x14f86d];return _0x576c2e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8d57('0x0'));var BPromise=require(_0x8d57('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d57('0x2'));var db=require(_0x8d57('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8d57('0x4'));var config=require(_0x8d57('0x5'));var jayson=require(_0x8d57('0x6'));var client=jayson['client'][_0x8d57('0x7')]({'port':0x232a});config[_0x8d57('0x8')]=_[_0x8d57('0x9')](config[_0x8d57('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d57('0xa'))(new Redis(config[_0x8d57('0x8')]));require(_0x8d57('0xb'))[_0x8d57('0xc')](socket);function respondWithRpcPromise(_0x1e2359,_0xb394d2,_0x3a9a2c){return new BPromise(function(_0x354e8e,_0x3b1964){return client[_0x8d57('0xd')](_0x1e2359,_0x3a9a2c)[_0x8d57('0xe')](function(_0x5399ac){logger[_0x8d57('0xf')](_0x8d57('0x10'),_0xb394d2,_0x8d57('0x11'));logger[_0x8d57('0x12')](_0x8d57('0x13'),_0xb394d2,_0x8d57('0x11'),JSON['stringify'](_0x5399ac));if(_0x5399ac[_0x8d57('0x14')]){if(_0x5399ac['error'][_0x8d57('0x15')]===0x1f4){logger['error'](_0x8d57('0x10'),_0xb394d2,_0x5399ac[_0x8d57('0x14')][_0x8d57('0x16')]);return _0x3b1964(_0x5399ac[_0x8d57('0x14')][_0x8d57('0x16')]);}logger[_0x8d57('0x14')](_0x8d57('0x10'),_0xb394d2,_0x5399ac[_0x8d57('0x14')]['message']);return _0x354e8e(_0x5399ac['error'][_0x8d57('0x16')]);}else{logger['info'](_0x8d57('0x10'),_0xb394d2,_0x8d57('0x11'));_0x354e8e(_0x5399ac[_0x8d57('0x17')][_0x8d57('0x16')]);}})['catch'](function(_0x1f258e){logger['error'](_0x8d57('0x10'),_0xb394d2,_0x1f258e);_0x3b1964(_0x1f258e);});});}exports['UpdateSmsInteraction']=function(_0x3f6c9e){var _0x4ddafc=this;return new Promise(function(_0x4ccb83,_0x6eca5){return db['SmsInteraction'][_0x8d57('0x18')](_0x3f6c9e[_0x8d57('0x19')],{'raw':_0x3f6c9e['options']?_0x3f6c9e[_0x8d57('0x1a')][_0x8d57('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6c9e[_0x8d57('0x1a')]?_0x3f6c9e[_0x8d57('0x1a')][_0x8d57('0x1c')]||null:null,'attributes':_0x3f6c9e[_0x8d57('0x1a')]?_0x3f6c9e[_0x8d57('0x1a')][_0x8d57('0x1d')]||null:null,'limit':_0x3f6c9e[_0x8d57('0x1a')]?_0x3f6c9e['options']['limit']||null:null})[_0x8d57('0xe')](function(_0x405220){logger[_0x8d57('0xf')](_0x8d57('0x1e'),_0x3f6c9e);logger[_0x8d57('0x12')](_0x8d57('0x1e'),_0x3f6c9e,JSON[_0x8d57('0x1f')](_0x405220));_0x4ccb83(_0x405220);})['catch'](function(_0x424242){logger[_0x8d57('0x14')](_0x8d57('0x1e'),_0x424242[_0x8d57('0x16')],_0x3f6c9e);_0x6eca5(_0x4ddafc[_0x8d57('0x14')](0x1f4,_0x424242['message']));});});};exports[_0x8d57('0x20')]=function(_0x2bdd16){return new Promise(function(_0x401e48,_0x22a265){return db['SmsInteraction'][_0x8d57('0x21')]({'where':_0x2bdd16[_0x8d57('0x1a')]?_0x2bdd16[_0x8d57('0x1a')][_0x8d57('0x1c')]||null:null})[_0x8d57('0xe')](function(_0x352e32){if(_0x352e32){return _0x352e32[_0x8d57('0x22')](_0x2bdd16[_0x8d57('0x19')][_0x8d57('0x23')],_[_0x8d57('0x24')](_0x2bdd16['body'],[_0x8d57('0x23'),'id'])||{});}})[_0x8d57('0x25')](function(_0x47927d){logger[_0x8d57('0xf')](_0x8d57('0x26'),_0x2bdd16);logger[_0x8d57('0x12')](_0x8d57('0x26'),_0x2bdd16,JSON[_0x8d57('0x1f')](_0x47927d));_0x401e48(_0x47927d);})['catch'](function(_0x3273cd){logger[_0x8d57('0x14')]('AddTags',_0x3273cd[_0x8d57('0x16')],_0x2bdd16);_0x22a265(_this['error'](0x1f4,_0x3273cd[_0x8d57('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e32b605..b9b5fbd 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 _0xe7ef=['update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe7ef,0x106));var _0xfe7e=function(_0x407b1a,_0x558fa4){_0x407b1a=_0x407b1a-0x0;var _0x580980=_0xe7ef[_0x407b1a];return _0x580980;};'use strict';var SmsInteractionEvents=require(_0xfe7e('0x0'));var events=[_0xfe7e('0x1'),'remove',_0xfe7e('0x2')];function createListener(_0x44def6,_0x2e5662){return function(_0x1655a3){_0x2e5662[_0xfe7e('0x3')](_0x44def6,_0x1655a3);};}function removeListener(_0x1dac07,_0x8f2b0){return function(){SmsInteractionEvents[_0xfe7e('0x4')](_0x1dac07,_0x8f2b0);};}exports[_0xfe7e('0x5')]=function(_0x120b1f){for(var _0x4f22cf=0x0,_0x4081da=events[_0xfe7e('0x6')];_0x4f22cf<_0x4081da;_0x4f22cf++){var _0x4cbdfa=events[_0x4f22cf];var _0xfdf7d7=createListener(_0xfe7e('0x7')+_0x4cbdfa,_0x120b1f);SmsInteractionEvents['on'](_0x4cbdfa,_0xfdf7d7);}}; \ No newline at end of file +var _0x2e5b=['./smsInteraction.events','update','emit','removeListener','smsInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e5b,0x64));var _0xb2e5=function(_0x36d69e,_0x192502){_0x36d69e=_0x36d69e-0x0;var _0x57ae21=_0x2e5b[_0x36d69e];return _0x57ae21;};'use strict';var SmsInteractionEvents=require(_0xb2e5('0x0'));var events=['save','remove',_0xb2e5('0x1')];function createListener(_0x4fbd0d,_0x78a47f){return function(_0x454fae){_0x78a47f[_0xb2e5('0x2')](_0x4fbd0d,_0x454fae);};}function removeListener(_0x5b5552,_0x35e1a0){return function(){SmsInteractionEvents[_0xb2e5('0x3')](_0x5b5552,_0x35e1a0);};}exports['register']=function(_0x2afb2e){for(var _0x304826=0x0,_0x55fec1=events['length'];_0x304826<_0x55fec1;_0x304826++){var _0x23e3ae=events[_0x304826];var _0x157ea4=createListener(_0xb2e5('0x4')+_0x23e3ae,_0x2afb2e);SmsInteractionEvents['on'](_0x23e3ae,_0x157ea4);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 4ab9a92..6f29c87 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 _0x9ed4=['isAuthenticated','index','get','/describe','describe','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller'];(function(_0x3ea47c,_0x522e1d){var _0x25092c=function(_0x8c6338){while(--_0x8c6338){_0x3ea47c['push'](_0x3ea47c['shift']());}};_0x25092c(++_0x522e1d);}(_0x9ed4,0x1a7));var _0x49ed=function(_0x9fe7aa,_0x92dcf2){_0x9fe7aa=_0x9fe7aa-0x0;var _0x21c804=_0x9ed4[_0x9fe7aa];return _0x21c804;};'use strict';var multer=require(_0x49ed('0x0'));var util=require(_0x49ed('0x1'));var path=require(_0x49ed('0x2'));var timeout=require(_0x49ed('0x3'));var express=require(_0x49ed('0x4'));var router=express[_0x49ed('0x5')]();var fs_extra=require(_0x49ed('0x6'));var auth=require(_0x49ed('0x7'));var interaction=require(_0x49ed('0x8'));var config=require(_0x49ed('0x9'));var controller=require(_0x49ed('0xa'));router['get']('/',auth[_0x49ed('0xb')](),controller[_0x49ed('0xc')]);router[_0x49ed('0xd')](_0x49ed('0xe'),auth[_0x49ed('0xb')](),controller[_0x49ed('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x49ed('0x10')]);router['post']('/',auth[_0x49ed('0xb')](),interaction[_0x49ed('0x11')](_0x49ed('0x12'),_0x49ed('0x13')),controller[_0x49ed('0x14')]);router[_0x49ed('0x15')](_0x49ed('0x16'),controller[_0x49ed('0x17')]);router[_0x49ed('0x18')](_0x49ed('0x19'),auth[_0x49ed('0xb')](),controller[_0x49ed('0x1a')]);router[_0x49ed('0x18')](_0x49ed('0x1b'),auth['isAuthenticated'](),controller[_0x49ed('0x1c')]);router[_0x49ed('0x18')](_0x49ed('0x1d'),auth[_0x49ed('0xb')](),controller['reject']);router['delete'](_0x49ed('0x19'),auth['isAuthenticated'](),controller['destroy']);module[_0x49ed('0x1e')]=router; \ No newline at end of file +var _0x7461=['/:id/status','put','update','accept','/:id/reject','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','smsmessage:create'];(function(_0xe9c2a8,_0x4bdfc5){var _0x1e4eb1=function(_0x48d2a3){while(--_0x48d2a3){_0xe9c2a8['push'](_0xe9c2a8['shift']());}};_0x1e4eb1(++_0x4bdfc5);}(_0x7461,0x177));var _0x1746=function(_0xb5179e,_0x67e31d){_0xb5179e=_0xb5179e-0x0;var _0x423511=_0x7461[_0xb5179e];return _0x423511;};'use strict';var multer=require(_0x1746('0x0'));var util=require(_0x1746('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1746('0x2'));var router=express[_0x1746('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1746('0x4'));var interaction=require(_0x1746('0x5'));var config=require(_0x1746('0x6'));var controller=require(_0x1746('0x7'));router[_0x1746('0x8')]('/',auth[_0x1746('0x9')](),controller[_0x1746('0xa')]);router[_0x1746('0x8')](_0x1746('0xb'),auth[_0x1746('0x9')](),controller['describe']);router[_0x1746('0x8')]('/:id',auth[_0x1746('0x9')](),controller[_0x1746('0xc')]);router[_0x1746('0xd')]('/',auth[_0x1746('0x9')](),interaction[_0x1746('0xe')]('sms',_0x1746('0xf')),controller['create']);router['post'](_0x1746('0x10'),controller['status']);router[_0x1746('0x11')]('/:id',auth[_0x1746('0x9')](),controller[_0x1746('0x12')]);router[_0x1746('0x11')]('/:id/accept',auth[_0x1746('0x9')](),controller[_0x1746('0x13')]);router[_0x1746('0x11')](_0x1746('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x1746('0x15')]('/:id',auth[_0x1746('0x9')](),controller['destroy']);module[_0x1746('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 4f224a5..1d416f5 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 _0x6cd0=['STRING','BOOLEAN','sequelize','medium','out'];(function(_0x3f24b1,_0x5018d0){var _0x360542=function(_0x447bf9){while(--_0x447bf9){_0x3f24b1['push'](_0x3f24b1['shift']());}};_0x360542(++_0x5018d0);}(_0x6cd0,0x1ce));var _0x06cd=function(_0x3be8f7,_0xc946b7){_0x3be8f7=_0x3be8f7-0x0;var _0x430179=_0x6cd0[_0x3be8f7];return _0x430179;};'use strict';var Sequelize=require(_0x06cd('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x06cd('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x06cd('0x2')),'defaultValue':_0x06cd('0x2'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x06cd('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x06cd('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x06cd('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x91ea=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x743701,_0x3e67bb){var _0x5a141d=function(_0x4b198d){while(--_0x4b198d){_0x743701['push'](_0x743701['shift']());}};_0x5a141d(++_0x3e67bb);}(_0x91ea,0x92));var _0xa91e=function(_0x30affb,_0x136d02){_0x30affb=_0x30affb-0x0;var _0x205f8d=_0x91ea[_0x30affb];return _0x205f8d;};'use strict';var Sequelize=require(_0xa91e('0x0'));module[_0xa91e('0x1')]={'body':{'type':Sequelize[_0xa91e('0x2')](_0xa91e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa91e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa91e('0x5')]('in',_0xa91e('0x6')),'defaultValue':_0xa91e('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa91e('0x7')]},'readAt':{'type':Sequelize[_0xa91e('0x8')]},'secret':{'type':Sequelize[_0xa91e('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa91e('0x7')]},'providerResponse':{'type':Sequelize[_0xa91e('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 187ab75..5e2bd95 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 _0x18c9=['sequelize','QueryTypes','SELECT','internal','interface','motionChannel','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','SmsMessage','findAll','rows','show','create','body','params','destroy','find','describe','sms-interactions','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','User','fullname','email','manual','SIP/%s','channel','event','accept','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId'];(function(_0x5a2f36,_0x26d664){var _0x1956ec=function(_0xad0b6f){while(--_0xad0b6f){_0x5a2f36['push'](_0x5a2f36['shift']());}};_0x1956ec(++_0x26d664);}(_0x18c9,0x13c));var _0x918c=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x18c9[_0x16771d];return _0x386f11;};'use strict';var emlformat=require(_0x918c('0x0'));var rimraf=require(_0x918c('0x1'));var zipdir=require(_0x918c('0x2'));var jsonpatch=require(_0x918c('0x3'));var rp=require(_0x918c('0x4'));var moment=require(_0x918c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x918c('0x6'));var util=require(_0x918c('0x7'));var path=require('path');var sox=require(_0x918c('0x8'));var csv=require('to-csv');var ejs=require(_0x918c('0x9'));var fs=require('fs');var fs_extra=require(_0x918c('0xa'));var _=require(_0x918c('0xb'));var squel=require(_0x918c('0xc'));var crypto=require(_0x918c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x918c('0xf'));var Redis=require(_0x918c('0x10'));var authService=require(_0x918c('0x11'));var qs=require(_0x918c('0x12'));var as=require(_0x918c('0x13'));var hardwareService=require(_0x918c('0x14'));var logger=require(_0x918c('0x15'))(_0x918c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x918c('0x17'));var db=require(_0x918c('0x18'))['db'];config[_0x918c('0x19')]=_[_0x918c('0x1a')](config[_0x918c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x918c('0x1b'))(new Redis(config[_0x918c('0x19')]));require(_0x918c('0x1c'))[_0x918c('0x1d')](socket);var jayson=require(_0x918c('0x1e'));var client=jayson[_0x918c('0x1f')][_0x918c('0x20')]({'port':0x232c});var client9002=jayson[_0x918c('0x1f')][_0x918c('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x50d54d,_0x51b1bd,_0x50f880,_0x5baa51){return new BPromise(function(_0x4fa363,_0x19d3eb){var _0x54f9fa=_0x5baa51||client;return _0x54f9fa[_0x918c('0x21')](_0x50d54d,_0x50f880)[_0x918c('0x22')](function(_0x215eb8){logger['info']('SmsMessage,\x20%s,\x20%s',_0x51b1bd,_0x918c('0x23'));logger[_0x918c('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x51b1bd,_0x918c('0x23'),JSON[_0x918c('0x25')](_0x215eb8));if(_0x215eb8[_0x918c('0x26')]){if(_0x215eb8[_0x918c('0x26')]['code']===0x1f4){logger[_0x918c('0x26')](_0x918c('0x27'),_0x51b1bd,_0x215eb8['error']['message']);return _0x19d3eb(_0x215eb8[_0x918c('0x26')]['message']);}logger['error'](_0x918c('0x27'),_0x51b1bd,_0x215eb8['error'][_0x918c('0x28')]);return _0x4fa363(_0x215eb8[_0x918c('0x26')]['message']);}else{logger[_0x918c('0x29')](_0x918c('0x27'),_0x51b1bd,_0x918c('0x23'));_0x4fa363(_0x215eb8[_0x918c('0x2a')]['message']);}})[_0x918c('0x2b')](function(_0x8577fe){logger[_0x918c('0x26')](_0x918c('0x27'),_0x51b1bd,_0x8577fe);_0x19d3eb(_0x8577fe);});});}function respondWithStatusCode(_0x124e3d,_0xebf958){_0xebf958=_0xebf958||0xcc;return function(_0x4cf95c){if(_0x4cf95c){return _0x124e3d[_0x918c('0x2c')](_0xebf958);}return _0x124e3d[_0x918c('0x2d')](_0xebf958)[_0x918c('0x2e')]();};}function respondWithResult(_0x11e8bf,_0x481fd7){_0x481fd7=_0x481fd7||0xc8;return function(_0x194e7e){if(_0x194e7e){return _0x11e8bf[_0x918c('0x2d')](_0x481fd7)['json'](_0x194e7e);}};}function respondWithFilteredResult(_0x2af472,_0x2ffb5f){return function(_0x1f4f17){if(_0x1f4f17){var _0x146579=typeof _0x2ffb5f[_0x918c('0x2f')]===_0x918c('0x30')&&typeof _0x2ffb5f[_0x918c('0x31')]===_0x918c('0x30');var _0x1372a1=_0x1f4f17[_0x918c('0x32')];var _0x48d5da=_0x146579?0x0:_0x2ffb5f[_0x918c('0x2f')];var _0x38c253=_0x146579?_0x1f4f17['count']:_0x2ffb5f['offset']+_0x2ffb5f[_0x918c('0x31')];var _0x2cba74;if(_0x38c253>=_0x1372a1){_0x38c253=_0x1372a1;_0x2cba74=0xc8;}else{_0x2cba74=0xce;}_0x2af472[_0x918c('0x2d')](_0x2cba74);return _0x2af472['set'](_0x918c('0x33'),_0x48d5da+'-'+_0x38c253+'/'+_0x1372a1)['json'](_0x1f4f17);}return null;};}function patchUpdates(_0x1d5a3c){return function(_0x133e7b){try{jsonpatch[_0x918c('0x34')](_0x133e7b,_0x1d5a3c,!![]);}catch(_0x2c7693){return BPromise[_0x918c('0x35')](_0x2c7693);}return _0x133e7b['save']();};}function saveUpdates(_0x18b46a,_0x593c0e){return function(_0x46555a){if(_0x46555a){return _0x46555a[_0x918c('0x36')](_0x18b46a)[_0x918c('0x22')](function(_0x1cff82){return _0x1cff82;});}return null;};}function removeEntity(_0x57271a,_0x5f4a85){return function(_0x1ca273){if(_0x1ca273){return _0x1ca273['destroy']()[_0x918c('0x22')](function(){_0x57271a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19658d,_0x2d8aea){return function(_0x8e6fdd){if(!_0x8e6fdd){_0x19658d['sendStatus'](0x194);}return _0x8e6fdd;};}function handleError(_0x511fb1,_0x415122){_0x415122=_0x415122||0x1f4;return function(_0x29c3a3){logger['error'](_0x29c3a3[_0x918c('0x37')]);if(_0x29c3a3[_0x918c('0x38')]){delete _0x29c3a3[_0x918c('0x38')];}_0x511fb1[_0x918c('0x2d')](_0x415122)[_0x918c('0x39')](_0x29c3a3);};}exports['index']=function(_0x270b4d,_0x330223){var _0x5ed510={},_0x41feaa={},_0x581b93={'count':0x0,'rows':[]};var _0x6b753e=_[_0x918c('0x3a')](db['SmsMessage'][_0x918c('0x3b')],function(_0x459caa){return{'name':_0x459caa[_0x918c('0x3c')],'type':_0x459caa[_0x918c('0x3d')][_0x918c('0x3e')]};});_0x41feaa[_0x918c('0x3f')]=_[_0x918c('0x3a')](_0x6b753e,_0x918c('0x38'));_0x41feaa[_0x918c('0x40')]=_[_0x918c('0x41')](_0x270b4d['query']);_0x41feaa[_0x918c('0x42')]=_[_0x918c('0x43')](_0x41feaa[_0x918c('0x3f')],_0x41feaa[_0x918c('0x40')]);_0x5ed510[_0x918c('0x44')]=_['intersection'](_0x41feaa[_0x918c('0x3f')],qs[_0x918c('0x45')](_0x270b4d[_0x918c('0x40')][_0x918c('0x45')]));_0x5ed510[_0x918c('0x44')]=_0x5ed510['attributes'][_0x918c('0x46')]?_0x5ed510[_0x918c('0x44')]:_0x41feaa[_0x918c('0x3f')];if(!_0x270b4d['query'][_0x918c('0x47')]('nolimit')){_0x5ed510[_0x918c('0x31')]=qs[_0x918c('0x31')](_0x270b4d[_0x918c('0x40')][_0x918c('0x31')]);_0x5ed510['offset']=qs[_0x918c('0x2f')](_0x270b4d[_0x918c('0x40')][_0x918c('0x2f')]);}_0x5ed510[_0x918c('0x48')]=qs['sort'](_0x270b4d[_0x918c('0x40')][_0x918c('0x49')]);_0x5ed510[_0x918c('0x4a')]=qs['filters'](_[_0x918c('0x4b')](_0x270b4d['query'],_0x41feaa[_0x918c('0x42')]),_0x6b753e);if(_0x270b4d[_0x918c('0x40')][_0x918c('0x4c')]){_0x5ed510[_0x918c('0x4a')]=_[_0x918c('0x4d')](_0x5ed510[_0x918c('0x4a')],{'$or':_[_0x918c('0x3a')](_0x6b753e,function(_0x1ec06d){if(_0x1ec06d[_0x918c('0x3d')]!=='VIRTUAL'){var _0x1a84ce={};_0x1a84ce[_0x1ec06d[_0x918c('0x38')]]={'$like':'%'+_0x270b4d[_0x918c('0x40')][_0x918c('0x4c')]+'%'};return _0x1a84ce;}})});}_0x5ed510=_[_0x918c('0x4d')]({},_0x5ed510,_0x270b4d[_0x918c('0x4e')]);var _0x5b92c3={'where':_0x5ed510[_0x918c('0x4a')]};return db['SmsMessage'][_0x918c('0x32')](_0x5b92c3)[_0x918c('0x22')](function(_0x1450ec){_0x581b93[_0x918c('0x32')]=_0x1450ec;if(_0x270b4d[_0x918c('0x40')][_0x918c('0x4f')]){_0x5ed510[_0x918c('0x50')]=[{'all':!![]}];}return db[_0x918c('0x51')][_0x918c('0x52')](_0x5ed510);})[_0x918c('0x22')](function(_0x5d3194){_0x581b93[_0x918c('0x53')]=_0x5d3194;return _0x581b93;})[_0x918c('0x22')](respondWithFilteredResult(_0x330223,_0x5ed510))['catch'](handleError(_0x330223,null));};exports[_0x918c('0x54')]=function(_0x926a62,_0x3601c9){var _0x22603a={'raw':!![],'where':{'id':_0x926a62['params']['id']}},_0x2f131f={};_0x2f131f['model']=_[_0x918c('0x41')](db[_0x918c('0x51')][_0x918c('0x3b')]);_0x2f131f[_0x918c('0x40')]=_['keys'](_0x926a62[_0x918c('0x40')]);_0x2f131f[_0x918c('0x42')]=_[_0x918c('0x43')](_0x2f131f[_0x918c('0x3f')],_0x2f131f['query']);_0x22603a[_0x918c('0x44')]=_['intersection'](_0x2f131f['model'],qs[_0x918c('0x45')](_0x926a62['query'][_0x918c('0x45')]));_0x22603a[_0x918c('0x44')]=_0x22603a['attributes']['length']?_0x22603a[_0x918c('0x44')]:_0x2f131f['model'];if(_0x926a62[_0x918c('0x40')]['includeAll']){_0x22603a[_0x918c('0x50')]=[{'all':!![]}];}_0x22603a=_[_0x918c('0x4d')]({},_0x22603a,_0x926a62[_0x918c('0x4e')]);return db[_0x918c('0x51')]['find'](_0x22603a)[_0x918c('0x22')](handleEntityNotFound(_0x3601c9,null))[_0x918c('0x22')](respondWithResult(_0x3601c9,null))['catch'](handleError(_0x3601c9,null));};exports[_0x918c('0x55')]=function(_0x442810,_0x3d7b93){return db[_0x918c('0x51')]['create'](_0x442810[_0x918c('0x56')],{})[_0x918c('0x22')](respondWithResult(_0x3d7b93,0xc9))[_0x918c('0x2b')](handleError(_0x3d7b93,null));};exports[_0x918c('0x36')]=function(_0x469a46,_0x3566fa){if(_0x469a46[_0x918c('0x56')]['id']){delete _0x469a46[_0x918c('0x56')]['id'];}return db[_0x918c('0x51')]['find']({'where':{'id':_0x469a46[_0x918c('0x57')]['id']}})[_0x918c('0x22')](handleEntityNotFound(_0x3566fa,null))[_0x918c('0x22')](saveUpdates(_0x469a46['body'],null))[_0x918c('0x22')](respondWithResult(_0x3566fa,null))[_0x918c('0x2b')](handleError(_0x3566fa,null));};exports[_0x918c('0x58')]=function(_0x214fb3,_0x1be1b0){return db[_0x918c('0x51')][_0x918c('0x59')]({'where':{'id':_0x214fb3['params']['id']}})[_0x918c('0x22')](handleEntityNotFound(_0x1be1b0,null))['then'](removeEntity(_0x1be1b0,null))['catch'](handleError(_0x1be1b0,null));};exports[_0x918c('0x5a')]=function(_0x1d317e,_0x39ef96){return db['SmsMessage'][_0x918c('0x5a')]()[_0x918c('0x22')](respondWithResult(_0x39ef96,null))['catch'](handleError(_0x39ef96,null));};var interaction_log=require(_0x918c('0x15'))(_0x918c('0x5b'));exports['accept']=function(_0x31fd14,_0x14a0de,_0xba4df4){var _0x39f98={'agent':{},'channel':'sms'};if(_0x31fd14[_0x918c('0x56')]['id']){delete _0x31fd14[_0x918c('0x56')]['id'];}_0x31fd14[_0x918c('0x56')][_0x918c('0x5c')]=!![];_0x31fd14[_0x918c('0x56')]['readAt']=moment()['format'](_0x918c('0x5d'));_0x31fd14['body'][_0x918c('0x5e')]=_0x31fd14[_0x918c('0x56')][_0x918c('0x5e')]||_0x31fd14[_0x918c('0x5f')]['id'];_0x39f98[_0x918c('0x60')]['id']=_0x31fd14['body'][_0x918c('0x5e')];return db['SmsMessage'][_0x918c('0x59')]({'where':{'id':_0x31fd14[_0x918c('0x57')]['id'],'UserId':null}})[_0x918c('0x22')](handleEntityNotFound(_0x14a0de,null))[_0x918c('0x22')](saveUpdates(_0x31fd14[_0x918c('0x56')],null))['then'](function(_0x5bce7f){if(_0x5bce7f){_0x39f98[_0x918c('0x28')]=_0x5bce7f['get']({'plain':!![]});return db[_0x918c('0x61')]['find']({'where':{'id':_0x5bce7f[_0x918c('0x62')]}});}return null;})[_0x918c('0x22')](handleEntityNotFound(_0x14a0de,null))[_0x918c('0x22')](function(_0xb0eec2){if(_0xb0eec2){return _0xb0eec2[_0x918c('0x36')]({'UserId':_0x31fd14[_0x918c('0x56')][_0x918c('0x5e')],'read1stAt':_[_0x918c('0x63')](_0xb0eec2[_0x918c('0x64')])?moment()[_0x918c('0x65')](_0x918c('0x5d')):undefined});}return null;})[_0x918c('0x22')](function(_0x5edfbb){if(_0x5edfbb){_0x39f98['interaction']=_0x5edfbb[_0x918c('0x66')]({'plain':!![]});interaction_log[_0x918c('0x29')](_0x918c('0x67'),_0x31fd14['user']['id'],_0x31fd14[_0x918c('0x5f')][_0x918c('0x38')],_0x31fd14[_0x918c('0x5f')][_0x918c('0x68')],_0x39f98[_0x918c('0x69')]['id'],_0x31fd14[_0x918c('0x56')]?JSON[_0x918c('0x25')](_0x31fd14['body']):_0x918c('0x6a'));return respondWithRpcPromise(_0x918c('0x6b'),_0x918c('0x6c'),_0x39f98);}return null;})['then'](function(_0x3870b1){var _0x15fa08=_0x918c('0x6d')+_0x3870b1[_0x918c('0x28')]['ContactId'];return db['sequelize'][_0x918c('0x40')](_0x15fa08,{'type':db[_0x918c('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1931c5){return _0x1931c5;});})[_0x918c('0x22')](function(_0x4e8263){if(_0x4e8263){_0x39f98[_0x918c('0x28')][_0x918c('0x6f')]=_0x4e8263[0x0];if(!_0x31fd14[_0x918c('0x56')][_0x918c('0x5e')])return;return db[_0x918c('0x70')][_0x918c('0x59')]({'where':{'id':_0x31fd14['body'][_0x918c('0x5e')],'role':'agent'},'attributes':['id','name',_0x918c('0x71'),_0x918c('0x72'),'internal'],'raw':!![]});}return null;})[_0x918c('0x22')](function(_0x4b99ca){if(!_0x4b99ca)return null;_0x39f98[_0x918c('0x28')][_0x918c('0x60')]=_0x4b99ca;return _0x39f98;})[_0x918c('0x22')](function(_0x24cac0){if(_0x24cac0){if(_0x31fd14[_0x918c('0x56')][_0x918c('0x73')]){_0x39f98[_0x918c('0x28')]['interface']=util[_0x918c('0x65')](_0x918c('0x74'),_0x31fd14[_0x918c('0x5f')][_0x918c('0x38')]);_0x39f98[_0x918c('0x28')][_0x918c('0x75')]=_0x39f98[_0x918c('0x75')];_0x39f98[_0x918c('0x28')]['motionChannel']=_0x39f98[_0x918c('0x75')];_0x39f98[_0x918c('0x28')][_0x918c('0x76')]=_0x918c('0x77');return respondWithRpcPromise(_0x918c('0x78'),_0x918c('0x78'),{'event':'acceptmessage','message':_0x39f98[_0x918c('0x28')]},client9002)[_0x918c('0x22')](function(){return _0x39f98;});}return _0x39f98;}return null;})[_0x918c('0x22')](respondWithResult(_0x14a0de,null))[_0x918c('0x2b')](handleError(_0x14a0de,null));};var interaction_log=require('../../config/logger')(_0x918c('0x5b'));exports[_0x918c('0x35')]=function(_0x3ca6bd,_0x3ad580,_0x10ae97){var _0x43bbd1={'agent':{},'channel':'sms'};if(_0x3ca6bd['body']['id']){delete _0x3ca6bd[_0x918c('0x56')]['id'];}_0x3ca6bd['body'][_0x918c('0x5e')]=_0x3ca6bd[_0x918c('0x56')][_0x918c('0x5e')]||_0x3ca6bd['user']['id'];_0x43bbd1[_0x918c('0x60')]['id']=_0x3ca6bd[_0x918c('0x56')][_0x918c('0x5e')];return db['SmsMessage'][_0x918c('0x59')]({'where':{'id':_0x3ca6bd[_0x918c('0x57')]['id'],'UserId':null}})[_0x918c('0x22')](handleEntityNotFound(_0x3ad580,null))[_0x918c('0x22')](function(_0x3b1b6f){if(_0x3b1b6f){_0x43bbd1[_0x918c('0x28')]=_0x3b1b6f['get']({'plain':!![]});return db[_0x918c('0x61')]['find']({'where':{'id':_0x3b1b6f[_0x918c('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3ad580,null))[_0x918c('0x22')](function(_0x39f8b9){if(_0x39f8b9){_0x43bbd1[_0x918c('0x69')]=_0x39f8b9['get']({'plain':!![]});interaction_log['info'](_0x918c('0x79'),_0x3ca6bd[_0x918c('0x5f')]['id'],_0x3ca6bd['user']['name'],_0x3ca6bd[_0x918c('0x5f')][_0x918c('0x68')],_0x43bbd1[_0x918c('0x69')]['id'],_0x3ca6bd[_0x918c('0x56')]?JSON['stringify'](_0x3ca6bd[_0x918c('0x56')]):_0x918c('0x6a'));return respondWithRpcPromise(_0x918c('0x7a'),_0x918c('0x7b'),_0x43bbd1);}return null;})[_0x918c('0x22')](function(_0x4ba9b6){var _0x1ca78d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ba9b6[_0x918c('0x28')][_0x918c('0x7c')];return db[_0x918c('0x7d')]['query'](_0x1ca78d,{'type':db['Sequelize'][_0x918c('0x7e')][_0x918c('0x7f')],'raw':!![]})[_0x918c('0x22')](function(_0x47ed1d){return _0x47ed1d;});})[_0x918c('0x22')](function(_0x194154){if(_0x194154){_0x43bbd1[_0x918c('0x28')][_0x918c('0x6f')]=_0x194154[0x0];if(!_0x3ca6bd[_0x918c('0x56')][_0x918c('0x5e')])return;return db['User']['find']({'where':{'id':_0x3ca6bd[_0x918c('0x56')]['UserId'],'role':_0x918c('0x60')},'attributes':['id',_0x918c('0x38'),'fullname',_0x918c('0x72'),_0x918c('0x80')],'raw':!![]});}return null;})[_0x918c('0x22')](function(_0xafc667){if(!_0xafc667)return null;_0x43bbd1[_0x918c('0x28')][_0x918c('0x60')]=_0xafc667;return _0x43bbd1;})[_0x918c('0x22')](function(_0x4e6cae){if(_0x4e6cae){_0x4e6cae[_0x918c('0x28')][_0x918c('0x81')]=util[_0x918c('0x65')](_0x918c('0x74'),_0x3ca6bd[_0x918c('0x5f')][_0x918c('0x38')]);_0x4e6cae[_0x918c('0x28')][_0x918c('0x75')]=_0x43bbd1[_0x918c('0x75')];_0x4e6cae[_0x918c('0x28')][_0x918c('0x82')]=_0x43bbd1['channel'];_0x4e6cae[_0x918c('0x28')][_0x918c('0x76')]='reject';respondWithRpcPromise(_0x918c('0x78'),_0x918c('0x78'),{'event':'rejectmessage','message':_0x4e6cae[_0x918c('0x28')]},client9002);return _0x43bbd1;}return null;})[_0x918c('0x22')](respondWithResult(_0x3ad580,null))[_0x918c('0x2b')](handleError(_0x3ad580,null));};exports['status']=function(_0x3b9e96,_0x4a74aa,_0x53a648){if(_0x3b9e96['body']['id']){delete _0x3b9e96[_0x918c('0x56')]['id'];}var _0x1d5756;return db[_0x918c('0x51')]['find']({'where':{'id':_0x3b9e96['params']['id']}})[_0x918c('0x22')](handleEntityNotFound(_0x4a74aa,null))[_0x918c('0x22')](function(_0x3c6e56){if(_0x3c6e56){_0x1d5756=_0x3c6e56;return db[_0x918c('0x83')][_0x918c('0x59')]({'where':{'id':_0x3c6e56[_0x918c('0x84')]}});}})[_0x918c('0x22')](handleEntityNotFound(_0x4a74aa,null))[_0x918c('0x22')](function(_0x3b7b9d){if(_0x3b7b9d){logger[_0x918c('0x24')](_0x918c('0x85'),_0x918c('0x2d'),_0x918c('0x86'),_0x3b7b9d[_0x918c('0x3d')],util['inspect'](_0x3b9e96[_0x918c('0x56')],{'showHidden':![],'depth':null}));switch(_0x3b7b9d['type']){case _0x918c('0x87'):if(_0x3b9e96[_0x918c('0x56')][_0x918c('0x88')]&&_0x3b9e96[_0x918c('0x56')][_0x918c('0x88')]===_0x1d5756[_0x918c('0x89')]){return _0x1d5756[_0x918c('0x36')]({'read':!![]});}else{logger[_0x918c('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x918c('0x2d'),_0x918c('0x87'),util['inspect'](_0x3b9e96['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3b9e96[_0x918c('0x56')][_0x918c('0x8a')]&&_0x3b9e96[_0x918c('0x56')]['MessageUUID']===_0x1d5756['messageId']&&_[_0x918c('0x8b')]([_0x918c('0x8c'),_0x918c('0x8d')],_0x3b9e96[_0x918c('0x56')]['Status'])>=0x0){return _0x1d5756['update']({'read':!![]});}else{logger['error'](_0x918c('0x8e'),_0x918c('0x2d'),_0x918c('0x8f'),util['inspect'](_0x3b9e96[_0x918c('0x56')],{'showHidden':![],'depth':null}));}break;case _0x918c('0x90'):var _0x5a71d4=_0x3b9e96[_0x918c('0x56')]['results'][0x0];if(_0x5a71d4[_0x918c('0x2d')][_0x918c('0x91')]===_0x918c('0x92')){return _0x1d5756[_0x918c('0x36')]({'read':!![]});}else{logger[_0x918c('0x26')](_0x918c('0x8e'),_0x918c('0x2d'),_0x918c('0x90'),util['inspect'](_0x3b9e96[_0x918c('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x1d5756;}})[_0x918c('0x22')](respondWithResult(_0x4a74aa,null))[_0x918c('0x2b')](handleError(_0x4a74aa,null));}; \ No newline at end of file +var _0x434b=['offset','limit','reject','save','then','destroy','end','sendStatus','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','find','create','body','params','describe','sms-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','update','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','sms','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','QueryTypes','format','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','Status','plivio','inspect','infobip','results','DELIVERED','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','status','undefined','count'];(function(_0x1b8b76,_0x2e3f62){var _0x5d934c=function(_0x2de940){while(--_0x2de940){_0x1b8b76['push'](_0x1b8b76['shift']());}};_0x5d934c(++_0x2e3f62);}(_0x434b,0x17f));var _0xb434=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0x434b[_0x3dfeb9];return _0x412314;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb434('0x0'));var jsonpatch=require(_0xb434('0x1'));var rp=require('request-promise');var moment=require(_0xb434('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb434('0x3'));var util=require(_0xb434('0x4'));var path=require(_0xb434('0x5'));var sox=require(_0xb434('0x6'));var csv=require(_0xb434('0x7'));var ejs=require(_0xb434('0x8'));var fs=require('fs');var fs_extra=require(_0xb434('0x9'));var _=require(_0xb434('0xa'));var squel=require(_0xb434('0xb'));var crypto=require('crypto');var jsforce=require(_0xb434('0xc'));var deskjs=require(_0xb434('0xd'));var toCsv=require(_0xb434('0x7'));var querystring=require(_0xb434('0xe'));var Papa=require(_0xb434('0xf'));var Redis=require(_0xb434('0x10'));var authService=require(_0xb434('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb434('0x12'));var logger=require(_0xb434('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb434('0x14'));var licenseUtil=require(_0xb434('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb434('0x16')](config[_0xb434('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb434('0x18'))(new Redis(config[_0xb434('0x17')]));require(_0xb434('0x19'))[_0xb434('0x1a')](socket);var jayson=require(_0xb434('0x1b'));var client=jayson[_0xb434('0x1c')][_0xb434('0x1d')]({'port':0x232c});var client9002=jayson[_0xb434('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b13a1,_0x1ef9d2,_0x166166,_0x445df3){return new BPromise(function(_0x46b43c,_0x10a29e){var _0x7255f4=_0x445df3||client;return _0x7255f4[_0xb434('0x1e')](_0x3b13a1,_0x166166)['then'](function(_0x5a14ac){logger['info']('SmsMessage,\x20%s,\x20%s',_0x1ef9d2,_0xb434('0x1f'));logger[_0xb434('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1ef9d2,_0xb434('0x1f'),JSON['stringify'](_0x5a14ac));if(_0x5a14ac[_0xb434('0x21')]){if(_0x5a14ac[_0xb434('0x21')][_0xb434('0x22')]===0x1f4){logger[_0xb434('0x21')](_0xb434('0x23'),_0x1ef9d2,_0x5a14ac[_0xb434('0x21')][_0xb434('0x24')]);return _0x10a29e(_0x5a14ac[_0xb434('0x21')][_0xb434('0x24')]);}logger[_0xb434('0x21')](_0xb434('0x23'),_0x1ef9d2,_0x5a14ac['error'][_0xb434('0x24')]);return _0x46b43c(_0x5a14ac['error'][_0xb434('0x24')]);}else{logger[_0xb434('0x25')](_0xb434('0x23'),_0x1ef9d2,_0xb434('0x1f'));_0x46b43c(_0x5a14ac[_0xb434('0x26')][_0xb434('0x24')]);}})[_0xb434('0x27')](function(_0x32d79a){logger[_0xb434('0x21')]('SmsMessage,\x20%s,\x20%s',_0x1ef9d2,_0x32d79a);_0x10a29e(_0x32d79a);});});}function respondWithStatusCode(_0x197e42,_0x2fea05){_0x2fea05=_0x2fea05||0xcc;return function(_0x47d51e){if(_0x47d51e){return _0x197e42['sendStatus'](_0x2fea05);}return _0x197e42[_0xb434('0x28')](_0x2fea05)['end']();};}function respondWithResult(_0x25fb5f,_0x3ec9c2){_0x3ec9c2=_0x3ec9c2||0xc8;return function(_0x5a2595){if(_0x5a2595){return _0x25fb5f[_0xb434('0x28')](_0x3ec9c2)['json'](_0x5a2595);}};}function respondWithFilteredResult(_0x49e6ef,_0xc93a5c){return function(_0x2790dd){if(_0x2790dd){var _0x296a66=typeof _0xc93a5c['offset']===_0xb434('0x29')&&typeof _0xc93a5c['limit']===_0xb434('0x29');var _0x36c2f2=_0x2790dd[_0xb434('0x2a')];var _0x24aa91=_0x296a66?0x0:_0xc93a5c[_0xb434('0x2b')];var _0x498587=_0x296a66?_0x2790dd[_0xb434('0x2a')]:_0xc93a5c[_0xb434('0x2b')]+_0xc93a5c[_0xb434('0x2c')];var _0x392833;if(_0x498587>=_0x36c2f2){_0x498587=_0x36c2f2;_0x392833=0xc8;}else{_0x392833=0xce;}_0x49e6ef[_0xb434('0x28')](_0x392833);return _0x49e6ef['set']('Content-Range',_0x24aa91+'-'+_0x498587+'/'+_0x36c2f2)['json'](_0x2790dd);}return null;};}function patchUpdates(_0x4ced5c){return function(_0x20010e){try{jsonpatch['apply'](_0x20010e,_0x4ced5c,!![]);}catch(_0x6c8b36){return BPromise[_0xb434('0x2d')](_0x6c8b36);}return _0x20010e[_0xb434('0x2e')]();};}function saveUpdates(_0x25a45b,_0x33e8a8){return function(_0x2abe3c){if(_0x2abe3c){return _0x2abe3c['update'](_0x25a45b)[_0xb434('0x2f')](function(_0x58ab42){return _0x58ab42;});}return null;};}function removeEntity(_0x229c20,_0x35e89b){return function(_0x1eef55){if(_0x1eef55){return _0x1eef55[_0xb434('0x30')]()[_0xb434('0x2f')](function(){_0x229c20[_0xb434('0x28')](0xcc)[_0xb434('0x31')]();});}};}function handleEntityNotFound(_0x51c593,_0x6a6501){return function(_0x368a42){if(!_0x368a42){_0x51c593[_0xb434('0x32')](0x194);}return _0x368a42;};}function handleError(_0x1bf40c,_0x442c0c){_0x442c0c=_0x442c0c||0x1f4;return function(_0x2e26f2){logger[_0xb434('0x21')](_0x2e26f2['stack']);if(_0x2e26f2[_0xb434('0x33')]){delete _0x2e26f2['name'];}_0x1bf40c[_0xb434('0x28')](_0x442c0c)[_0xb434('0x34')](_0x2e26f2);};}exports['index']=function(_0x43bf99,_0x420ac1){var _0x2d085d={},_0x3d73d8={},_0x349db9={'count':0x0,'rows':[]};var _0x3c359f=_[_0xb434('0x35')](db[_0xb434('0x36')][_0xb434('0x37')],function(_0x36b5dd){return{'name':_0x36b5dd[_0xb434('0x38')],'type':_0x36b5dd[_0xb434('0x39')][_0xb434('0x3a')]};});_0x3d73d8[_0xb434('0x3b')]=_[_0xb434('0x35')](_0x3c359f,_0xb434('0x33'));_0x3d73d8[_0xb434('0x3c')]=_[_0xb434('0x3d')](_0x43bf99[_0xb434('0x3c')]);_0x3d73d8[_0xb434('0x3e')]=_[_0xb434('0x3f')](_0x3d73d8[_0xb434('0x3b')],_0x3d73d8[_0xb434('0x3c')]);_0x2d085d[_0xb434('0x40')]=_['intersection'](_0x3d73d8[_0xb434('0x3b')],qs[_0xb434('0x41')](_0x43bf99[_0xb434('0x3c')][_0xb434('0x41')]));_0x2d085d[_0xb434('0x40')]=_0x2d085d[_0xb434('0x40')][_0xb434('0x42')]?_0x2d085d['attributes']:_0x3d73d8[_0xb434('0x3b')];if(!_0x43bf99[_0xb434('0x3c')][_0xb434('0x43')](_0xb434('0x44'))){_0x2d085d[_0xb434('0x2c')]=qs[_0xb434('0x2c')](_0x43bf99[_0xb434('0x3c')][_0xb434('0x2c')]);_0x2d085d[_0xb434('0x2b')]=qs[_0xb434('0x2b')](_0x43bf99[_0xb434('0x3c')][_0xb434('0x2b')]);}_0x2d085d[_0xb434('0x45')]=qs['sort'](_0x43bf99[_0xb434('0x3c')]['sort']);_0x2d085d[_0xb434('0x46')]=qs['filters'](_[_0xb434('0x47')](_0x43bf99[_0xb434('0x3c')],_0x3d73d8[_0xb434('0x3e')]),_0x3c359f);if(_0x43bf99[_0xb434('0x3c')][_0xb434('0x48')]){_0x2d085d['where']=_[_0xb434('0x49')](_0x2d085d['where'],{'$or':_[_0xb434('0x35')](_0x3c359f,function(_0x1340f3){if(_0x1340f3[_0xb434('0x39')]!==_0xb434('0x4a')){var _0x1125d3={};_0x1125d3[_0x1340f3[_0xb434('0x33')]]={'$like':'%'+_0x43bf99[_0xb434('0x3c')][_0xb434('0x48')]+'%'};return _0x1125d3;}})});}_0x2d085d=_[_0xb434('0x49')]({},_0x2d085d,_0x43bf99[_0xb434('0x4b')]);var _0x555a99={'where':_0x2d085d[_0xb434('0x46')]};return db[_0xb434('0x36')][_0xb434('0x2a')](_0x555a99)[_0xb434('0x2f')](function(_0x5abe53){_0x349db9[_0xb434('0x2a')]=_0x5abe53;if(_0x43bf99['query'][_0xb434('0x4c')]){_0x2d085d[_0xb434('0x4d')]=[{'all':!![]}];}return db[_0xb434('0x36')]['findAll'](_0x2d085d);})[_0xb434('0x2f')](function(_0x57f678){_0x349db9[_0xb434('0x4e')]=_0x57f678;return _0x349db9;})['then'](respondWithFilteredResult(_0x420ac1,_0x2d085d))[_0xb434('0x27')](handleError(_0x420ac1,null));};exports['show']=function(_0x340984,_0x14d762){var _0x3faa7c={'raw':!![],'where':{'id':_0x340984['params']['id']}},_0x307739={};_0x307739['model']=_[_0xb434('0x3d')](db[_0xb434('0x36')]['rawAttributes']);_0x307739[_0xb434('0x3c')]=_['keys'](_0x340984[_0xb434('0x3c')]);_0x307739[_0xb434('0x3e')]=_[_0xb434('0x3f')](_0x307739['model'],_0x307739['query']);_0x3faa7c[_0xb434('0x40')]=_[_0xb434('0x3f')](_0x307739['model'],qs['fields'](_0x340984[_0xb434('0x3c')]['fields']));_0x3faa7c['attributes']=_0x3faa7c[_0xb434('0x40')][_0xb434('0x42')]?_0x3faa7c[_0xb434('0x40')]:_0x307739[_0xb434('0x3b')];if(_0x340984[_0xb434('0x3c')][_0xb434('0x4c')]){_0x3faa7c[_0xb434('0x4d')]=[{'all':!![]}];}_0x3faa7c=_[_0xb434('0x49')]({},_0x3faa7c,_0x340984[_0xb434('0x4b')]);return db[_0xb434('0x36')][_0xb434('0x4f')](_0x3faa7c)[_0xb434('0x2f')](handleEntityNotFound(_0x14d762,null))['then'](respondWithResult(_0x14d762,null))[_0xb434('0x27')](handleError(_0x14d762,null));};exports[_0xb434('0x50')]=function(_0x593213,_0xf7ed79){return db[_0xb434('0x36')][_0xb434('0x50')](_0x593213[_0xb434('0x51')],{})[_0xb434('0x2f')](respondWithResult(_0xf7ed79,0xc9))[_0xb434('0x27')](handleError(_0xf7ed79,null));};exports['update']=function(_0x3b55c7,_0x3a1745){if(_0x3b55c7[_0xb434('0x51')]['id']){delete _0x3b55c7['body']['id'];}return db[_0xb434('0x36')][_0xb434('0x4f')]({'where':{'id':_0x3b55c7[_0xb434('0x52')]['id']}})[_0xb434('0x2f')](handleEntityNotFound(_0x3a1745,null))[_0xb434('0x2f')](saveUpdates(_0x3b55c7[_0xb434('0x51')],null))[_0xb434('0x2f')](respondWithResult(_0x3a1745,null))[_0xb434('0x27')](handleError(_0x3a1745,null));};exports[_0xb434('0x30')]=function(_0x124ef3,_0xb97869){return db[_0xb434('0x36')]['find']({'where':{'id':_0x124ef3['params']['id']}})[_0xb434('0x2f')](handleEntityNotFound(_0xb97869,null))[_0xb434('0x2f')](removeEntity(_0xb97869,null))['catch'](handleError(_0xb97869,null));};exports[_0xb434('0x53')]=function(_0x34cf2a,_0x53e420){return db[_0xb434('0x36')][_0xb434('0x53')]()['then'](respondWithResult(_0x53e420,null))['catch'](handleError(_0x53e420,null));};var interaction_log=require('../../config/logger')(_0xb434('0x54'));exports['accept']=function(_0x414cce,_0x5e6d14,_0x5bd133){var _0x53de42={'agent':{},'channel':'sms'};if(_0x414cce[_0xb434('0x51')]['id']){delete _0x414cce[_0xb434('0x51')]['id'];}_0x414cce[_0xb434('0x51')][_0xb434('0x55')]=!![];_0x414cce[_0xb434('0x51')][_0xb434('0x56')]=moment()['format'](_0xb434('0x57'));_0x414cce[_0xb434('0x51')][_0xb434('0x58')]=_0x414cce[_0xb434('0x51')][_0xb434('0x58')]||_0x414cce[_0xb434('0x59')]['id'];_0x53de42[_0xb434('0x5a')]['id']=_0x414cce['body'][_0xb434('0x58')];return db[_0xb434('0x36')][_0xb434('0x4f')]({'where':{'id':_0x414cce[_0xb434('0x52')]['id'],'UserId':null}})[_0xb434('0x2f')](handleEntityNotFound(_0x5e6d14,null))[_0xb434('0x2f')](saveUpdates(_0x414cce['body'],null))[_0xb434('0x2f')](function(_0x292499){if(_0x292499){_0x53de42[_0xb434('0x24')]=_0x292499['get']({'plain':!![]});return db[_0xb434('0x5b')][_0xb434('0x4f')]({'where':{'id':_0x292499[_0xb434('0x5c')]}});}return null;})[_0xb434('0x2f')](handleEntityNotFound(_0x5e6d14,null))[_0xb434('0x2f')](function(_0x57ae72){if(_0x57ae72){return _0x57ae72[_0xb434('0x5d')]({'UserId':_0x414cce[_0xb434('0x51')][_0xb434('0x58')],'read1stAt':_[_0xb434('0x5e')](_0x57ae72[_0xb434('0x5f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb434('0x2f')](function(_0x564d87){if(_0x564d87){_0x53de42['interaction']=_0x564d87['get']({'plain':!![]});interaction_log[_0xb434('0x25')](_0xb434('0x60'),_0x414cce[_0xb434('0x59')]['id'],_0x414cce['user']['name'],_0x414cce['user'][_0xb434('0x61')],_0x53de42[_0xb434('0x62')]['id'],_0x414cce[_0xb434('0x51')]?JSON[_0xb434('0x63')](_0x414cce['body']):'null');return respondWithRpcPromise(_0xb434('0x64'),'acceptMessage',_0x53de42);}return null;})[_0xb434('0x2f')](function(_0x440da0){var _0x412ef6=_0xb434('0x65')+_0x440da0[_0xb434('0x24')][_0xb434('0x66')];return db['sequelize'][_0xb434('0x3c')](_0x412ef6,{'type':db[_0xb434('0x67')]['QueryTypes'][_0xb434('0x68')],'raw':!![]})[_0xb434('0x2f')](function(_0xceb21e){return _0xceb21e;});})['then'](function(_0x568b01){if(_0x568b01){_0x53de42[_0xb434('0x24')][_0xb434('0x69')]=_0x568b01[0x0];if(!_0x414cce[_0xb434('0x51')][_0xb434('0x58')])return;return db['User'][_0xb434('0x4f')]({'where':{'id':_0x414cce[_0xb434('0x51')][_0xb434('0x58')],'role':'agent'},'attributes':['id',_0xb434('0x33'),_0xb434('0x6a'),_0xb434('0x6b'),_0xb434('0x6c')],'raw':!![]});}return null;})['then'](function(_0x21bbf6){if(!_0x21bbf6)return null;_0x53de42[_0xb434('0x24')]['agent']=_0x21bbf6;return _0x53de42;})['then'](function(_0x1fa651){if(_0x1fa651){if(_0x414cce[_0xb434('0x51')][_0xb434('0x6d')]){_0x53de42[_0xb434('0x24')][_0xb434('0x6e')]=util['format'](_0xb434('0x6f'),_0x414cce[_0xb434('0x59')]['name']);_0x53de42[_0xb434('0x24')][_0xb434('0x70')]=_0x53de42[_0xb434('0x70')];_0x53de42[_0xb434('0x24')][_0xb434('0x71')]=_0x53de42['channel'];_0x53de42['message'][_0xb434('0x72')]=_0xb434('0x73');return respondWithRpcPromise(_0xb434('0x74'),'EventManager',{'event':_0xb434('0x75'),'message':_0x53de42['message']},client9002)['then'](function(){return _0x53de42;});}return _0x53de42;}return null;})[_0xb434('0x2f')](respondWithResult(_0x5e6d14,null))[_0xb434('0x27')](handleError(_0x5e6d14,null));};var interaction_log=require('../../config/logger')(_0xb434('0x54'));exports[_0xb434('0x2d')]=function(_0x2c008e,_0x366494,_0x6d287f){var _0x2c1709={'agent':{},'channel':_0xb434('0x76')};if(_0x2c008e['body']['id']){delete _0x2c008e[_0xb434('0x51')]['id'];}_0x2c008e['body'][_0xb434('0x58')]=_0x2c008e[_0xb434('0x51')][_0xb434('0x58')]||_0x2c008e[_0xb434('0x59')]['id'];_0x2c1709['agent']['id']=_0x2c008e[_0xb434('0x51')][_0xb434('0x58')];return db[_0xb434('0x36')][_0xb434('0x4f')]({'where':{'id':_0x2c008e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x366494,null))[_0xb434('0x2f')](function(_0x38514b){if(_0x38514b){_0x2c1709[_0xb434('0x24')]=_0x38514b[_0xb434('0x77')]({'plain':!![]});return db['SmsInteraction'][_0xb434('0x4f')]({'where':{'id':_0x38514b[_0xb434('0x5c')]}});}return null;})[_0xb434('0x2f')](handleEntityNotFound(_0x366494,null))['then'](function(_0x256ddd){if(_0x256ddd){_0x2c1709[_0xb434('0x62')]=_0x256ddd[_0xb434('0x77')]({'plain':!![]});interaction_log['info'](_0xb434('0x78'),_0x2c008e[_0xb434('0x59')]['id'],_0x2c008e[_0xb434('0x59')][_0xb434('0x33')],_0x2c008e[_0xb434('0x59')][_0xb434('0x61')],_0x2c1709[_0xb434('0x62')]['id'],_0x2c008e[_0xb434('0x51')]?JSON[_0xb434('0x63')](_0x2c008e[_0xb434('0x51')]):'null');return respondWithRpcPromise('RejectMessage',_0xb434('0x79'),_0x2c1709);}return null;})[_0xb434('0x2f')](function(_0x1f731d){var _0x7c00ce=_0xb434('0x65')+_0x1f731d['message'][_0xb434('0x66')];return db[_0xb434('0x7a')][_0xb434('0x3c')](_0x7c00ce,{'type':db['Sequelize'][_0xb434('0x7b')][_0xb434('0x68')],'raw':!![]})[_0xb434('0x2f')](function(_0x4d5942){return _0x4d5942;});})['then'](function(_0x39e2a2){if(_0x39e2a2){_0x2c1709['message'][_0xb434('0x69')]=_0x39e2a2[0x0];if(!_0x2c008e[_0xb434('0x51')][_0xb434('0x58')])return;return db['User'][_0xb434('0x4f')]({'where':{'id':_0x2c008e[_0xb434('0x51')]['UserId'],'role':_0xb434('0x5a')},'attributes':['id',_0xb434('0x33'),_0xb434('0x6a'),_0xb434('0x6b'),'internal'],'raw':!![]});}return null;})[_0xb434('0x2f')](function(_0x18d4a6){if(!_0x18d4a6)return null;_0x2c1709[_0xb434('0x24')][_0xb434('0x5a')]=_0x18d4a6;return _0x2c1709;})[_0xb434('0x2f')](function(_0x31206d){if(_0x31206d){_0x31206d['message'][_0xb434('0x6e')]=util[_0xb434('0x7c')](_0xb434('0x6f'),_0x2c008e[_0xb434('0x59')]['name']);_0x31206d[_0xb434('0x24')]['channel']=_0x2c1709['channel'];_0x31206d[_0xb434('0x24')]['motionChannel']=_0x2c1709[_0xb434('0x70')];_0x31206d['message'][_0xb434('0x72')]=_0xb434('0x2d');respondWithRpcPromise('EventManager',_0xb434('0x74'),{'event':_0xb434('0x7d'),'message':_0x31206d[_0xb434('0x24')]},client9002);return _0x2c1709;}return null;})[_0xb434('0x2f')](respondWithResult(_0x366494,null))[_0xb434('0x27')](handleError(_0x366494,null));};exports[_0xb434('0x28')]=function(_0x4cfaa2,_0x371240,_0x2c4ce1){if(_0x4cfaa2['body']['id']){delete _0x4cfaa2[_0xb434('0x51')]['id'];}var _0xfd12ad;return db[_0xb434('0x36')][_0xb434('0x4f')]({'where':{'id':_0x4cfaa2['params']['id']}})[_0xb434('0x2f')](handleEntityNotFound(_0x371240,null))[_0xb434('0x2f')](function(_0x428b6c){if(_0x428b6c){_0xfd12ad=_0x428b6c;return db[_0xb434('0x7e')][_0xb434('0x4f')]({'where':{'id':_0x428b6c['SmsAccountId']}});}})[_0xb434('0x2f')](handleEntityNotFound(_0x371240,null))[_0xb434('0x2f')](function(_0x5eb1e0){if(_0x5eb1e0){logger[_0xb434('0x20')](_0xb434('0x7f'),_0xb434('0x28'),'received\x20delivery\x20report\x20from',_0x5eb1e0[_0xb434('0x39')],util['inspect'](_0x4cfaa2[_0xb434('0x51')],{'showHidden':![],'depth':null}));switch(_0x5eb1e0['type']){case _0xb434('0x80'):if(_0x4cfaa2['body'][_0xb434('0x81')]&&_0x4cfaa2['body']['MessageSid']===_0xfd12ad['messageId']){return _0xfd12ad[_0xb434('0x5d')]({'read':!![]});}else{logger['error'](_0xb434('0x82'),'status',_0xb434('0x80'),util['inspect'](_0x4cfaa2[_0xb434('0x51')],{'showHidden':![],'depth':null}));}break;case _0xb434('0x83'):if(_0x4cfaa2[_0xb434('0x51')]['MessageUUID']&&_0x4cfaa2['body'][_0xb434('0x84')]===_0xfd12ad[_0xb434('0x85')]&&_[_0xb434('0x86')]([_0xb434('0x87'),'delivered'],_0x4cfaa2[_0xb434('0x51')][_0xb434('0x88')])>=0x0){return _0xfd12ad[_0xb434('0x5d')]({'read':!![]});}else{logger['error'](_0xb434('0x82'),_0xb434('0x28'),_0xb434('0x89'),util[_0xb434('0x8a')](_0x4cfaa2[_0xb434('0x51')],{'showHidden':![],'depth':null}));}break;case _0xb434('0x8b'):var _0x533235=_0x4cfaa2[_0xb434('0x51')][_0xb434('0x8c')][0x0];if(_0x533235[_0xb434('0x28')]['groupName']===_0xb434('0x8d')){return _0xfd12ad[_0xb434('0x5d')]({'read':!![]});}else{logger[_0xb434('0x21')](_0xb434('0x82'),_0xb434('0x28'),_0xb434('0x8b'),util[_0xb434('0x8a')](_0x4cfaa2[_0xb434('0x51')],{'showHidden':![],'depth':null}));}break;}return _0xfd12ad;}})[_0xb434('0x2f')](respondWithResult(_0x371240,null))[_0xb434('0x27')](handleError(_0x371240,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4fc18b0..26501de 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 _0x6532=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x6532,0xf8));var _0x2653=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x6532[_0x32e264];return _0x1d7175;};'use strict';var EventEmitter=require(_0x2653('0x0'));var SmsMessage=require(_0x2653('0x1'))['db'][_0x2653('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2653('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2653('0x4'),'afterDestroy':_0x2653('0x5')};function emitEvent(_0x576a93){return function(_0x118d0b,_0x4c6ff9,_0xd624ca){SmsMessageEvents[_0x2653('0x6')](_0x576a93+':'+_0x118d0b['id'],_0x118d0b);SmsMessageEvents[_0x2653('0x6')](_0x576a93,_0x118d0b);_0xd624ca(null);};}for(var e in events){if(events[_0x2653('0x7')](e)){var event=events[e];SmsMessage[_0x2653('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x57bc=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x57f78e,_0x119ef4){var _0x9dc043=function(_0x483cb9){while(--_0x483cb9){_0x57f78e['push'](_0x57f78e['shift']());}};_0x9dc043(++_0x119ef4);}(_0x57bc,0x1bf));var _0xc57b=function(_0x1e08b9,_0x12a551){_0x1e08b9=_0x1e08b9-0x0;var _0x5faaff=_0x57bc[_0x1e08b9];return _0x5faaff;};'use strict';var EventEmitter=require(_0xc57b('0x0'));var SmsMessage=require(_0xc57b('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc57b('0x2'),'afterUpdate':_0xc57b('0x3'),'afterDestroy':_0xc57b('0x4')};function emitEvent(_0x1ef97b){return function(_0x361c9c,_0x260091,_0x3640b8){SmsMessageEvents[_0xc57b('0x5')](_0x1ef97b+':'+_0x361c9c['id'],_0x361c9c);SmsMessageEvents[_0xc57b('0x5')](_0x1ef97b,_0x361c9c);_0x3640b8(null);};}for(var e in events){if(events[_0xc57b('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xc57b('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 bf8f520..65dcd85 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 _0xc069=['authId','format','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','csc','crypto','login','text','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','toString','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','models','toLowerCase','direction','secret','UserId','SmsInteraction','findOne','SmsInteractionId','update','catch','error','out','SmsAccount','then','type','twilio','accountSid','authToken','messages','create','body','phone','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','POST','user_key','session_key','internal_order_id','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo'];(function(_0x33f586,_0x29fffd){var _0x3bf7bc=function(_0x11a209){while(--_0x11a209){_0x33f586['push'](_0x33f586['shift']());}};_0x3bf7bc(++_0x29fffd);}(_0xc069,0xab));var _0x9c06=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc069[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9c06('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c06('0x1'));var moment=require(_0x9c06('0x2'));var BPromise=require('bluebird');var rp=require(_0x9c06('0x3'));var fs=require('fs');var path=require(_0x9c06('0x4'));var rimraf=require(_0x9c06('0x5'));var config=require(_0x9c06('0x6'));var attributes=require(_0x9c06('0x7'));module[_0x9c06('0x8')]=function(_0x1038e3,_0x556265){return _0x1038e3['define'](_0x9c06('0x9'),attributes,{'tableName':_0x9c06('0xa'),'paranoid':![],'indexes':[{'name':_0x9c06('0xb'),'fields':[_0x9c06('0xb')]},{'name':_0x9c06('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d75af,_0x2431c7,_0x23f1dc){var _0x292060=_0x1038e3[_0x9c06('0xd')];var _0x202897=_0x2d75af['get']({'plain':!![]});if(_0x202897['direction'][_0x9c06('0xe')]()==='in'||_0x202897[_0x9c06('0xf')][_0x9c06('0xe')]()==='out'&&!_0x202897[_0x9c06('0x10')]&&!_['isNil'](_0x202897[_0x9c06('0x11')])&&!_['isNil'](_0x202897['SmsInteractionId'])){_0x292060[_0x9c06('0x12')][_0x9c06('0x13')]({'where':{'id':_0x202897[_0x9c06('0x14')]}})['then'](function(_0x16a17e){if(_0x16a17e){_0x16a17e[_0x9c06('0x15')]({'lastMsgAt':_0x202897['createdAt'],'lastMsgDirection':_0x202897[_0x9c06('0xf')][_0x9c06('0xe')]()});}})[_0x9c06('0x16')](function(_0x390e2a){console[_0x9c06('0x17')](_0x390e2a);});}if(_0x202897[_0x9c06('0xf')]===_0x9c06('0x18')&&!_0x202897[_0x9c06('0x10')]){var _0x30d6d3;_0x292060[_0x9c06('0x19')]['find']({'where':{'id':_0x202897['SmsAccountId']},'raw':!![]})[_0x9c06('0x1a')](function(_0x42db03){_0x30d6d3=_0x42db03;if(_0x30d6d3&&_0x30d6d3['type']){switch(_0x30d6d3[_0x9c06('0x1b')]){case _0x9c06('0x1c'):var _0x9d6f75=require(_0x9c06('0x1c'));if(_0x30d6d3[_0x9c06('0x1d')]&&_0x30d6d3['authToken']&&_0x30d6d3['phone']){var _0x552d4c=new _0x9d6f75(_0x30d6d3[_0x9c06('0x1d')],_0x30d6d3[_0x9c06('0x1e')]);_0x552d4c[_0x9c06('0x1f')][_0x9c06('0x20')]({'body':_0x202897[_0x9c06('0x21')],'to':_0x202897[_0x9c06('0x22')],'from':_0x30d6d3[_0x9c06('0x22')],'statusCallback':_0x30d6d3[_0x9c06('0x23')]+_0x9c06('0x24')+_0x202897['id']+_0x9c06('0x25')+_0x30d6d3[_0x9c06('0x26')]})['then'](function(_0x5d2023){if(_0x5d2023['sid']){return _0x2d75af[_0x9c06('0x15')]({'messageId':_0x5d2023[_0x9c06('0x27')]});}})['catch'](function(_0x189f27){logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x1c'),util[_0x9c06('0x29')](_0x189f27,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x9c06('0x2b'):var _0x25ff6b=_0x9c06('0x2c');if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3[_0x9c06('0x2e')]){var _0x1bf455={'recipient':[_0x202897[_0x9c06('0x22')]],'message':_0x202897[_0x9c06('0x21')],'message_type':_0x30d6d3[_0x9c06('0x2f')]};if(_0x30d6d3[_0x9c06('0x2f')]&&_0x30d6d3[_0x9c06('0x2f')]!=='SI'){_0x1bf455[_0x9c06('0x30')]=_0x30d6d3['phone'];}var _0x3712a5={'url':_0x25ff6b+'login?username='+_0x30d6d3[_0x9c06('0x2d')]+_0x9c06('0x31')+_0x30d6d3[_0x9c06('0x2e')],'method':_0x9c06('0x32')};rp(_0x3712a5)[_0x9c06('0x1a')](function(_0x29d513){var _0x29e833=_0x29d513['split'](';');var _0x58a3e9={'user_key':_0x29e833[0x0],'session_key':_0x29e833[0x1]};_0x3712a5={'url':_0x25ff6b+'sms','method':_0x9c06('0x33'),'headers':{'user_key':_0x58a3e9[_0x9c06('0x34')],'Session_key':_0x58a3e9[_0x9c06('0x35')]},'json':!![],'body':_0x1bf455};return rp(_0x3712a5);})[_0x9c06('0x1a')](function(_0x4c90e0){if(_0x4c90e0['total_sent']>=0x1){var _0x2b6228={'messageId':_0x4c90e0[_0x9c06('0x36')]};if(_0x30d6d3[_0x9c06('0x2f')]!=='GP'||!_0x30d6d3['deliveryReport']){_0x2b6228[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x2b6228);}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x2b'),util[_0x9c06('0x29')](_0x4c90e0,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x5906e5){return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x2b'),util[_0x9c06('0x29')](_0x5906e5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x9c06('0x38'):if(_0x30d6d3[_0x9c06('0x1e')]){var _0x2f6c17={'recipient':_0x202897['phone'],'message':_0x202897[_0x9c06('0x21')],'sender':_0x30d6d3[_0x9c06('0x39')]||_0x30d6d3[_0x9c06('0x22')],'authorization':_0x30d6d3[_0x9c06('0x1e')]};var _0x2431c7={'method':_0x9c06('0x33'),'uri':_0x9c06('0x3a'),'body':_0x2f6c17,'json':!![]};rp(_0x2431c7)[_0x9c06('0x1a')](function(_0x2a8b0b){var _0x11e6b5={'messageId':_0x2a8b0b[_0x9c06('0x3b')]};if(!_0x30d6d3[_0x9c06('0x3c')]){_0x11e6b5[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x11e6b5);})[_0x9c06('0x16')](function(_0x5a7ac5){logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),'connectel',util[_0x9c06('0x29')](_0x5a7ac5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x9c06('0x3d'):if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3[_0x9c06('0x2e')]){var _0x2f6c17={'messages':[{'source':_0x9c06('0x3e'),'to':_0x202897['phone'],'body':_0x202897['body'],'from':_0x30d6d3['senderString']||_0x30d6d3['phone']}]};var _0x144921=util['format'](_0x9c06('0x3f'),_0x30d6d3[_0x9c06('0x2d')],_0x30d6d3[_0x9c06('0x2e')]);var _0x2431c7={'method':_0x9c06('0x33'),'uri':_0x9c06('0x40'),'body':_0x2f6c17,'headers':{'Authorization':util['format'](_0x9c06('0x41'),new Buffer(_0x144921)['toString'](_0x9c06('0x42')))},'json':!![]};rp(_0x2431c7)['then'](function(_0xbbdab8){if(_0xbbdab8[_0x9c06('0x43')]>=0xc8&&_0xbbdab8[_0x9c06('0x43')]<=0xce){if(_0xbbdab8[_0x9c06('0x44')]&&_0xbbdab8['data'][_0x9c06('0x45')]>0x0){var _0x1fb89b=_[_0x9c06('0x46')](_0xbbdab8[_0x9c06('0x44')][_0x9c06('0x1f')]);var _0x3f71e8={'messageId':_0x1fb89b[_0x9c06('0x47')]};if(!_0x30d6d3['deliveryReport']){_0x3f71e8[_0x9c06('0x37')]=!![];}return _0x2d75af['update'](_0x3f71e8);}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x48'),util[_0x9c06('0x29')](_0xbbdab8,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x48'),util[_0x9c06('0x29')](_0xbbdab8,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x82f0f9){logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x48'),util[_0x9c06('0x29')](_0x82f0f9,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x48'),_0x9c06('0x49'));}break;case _0x9c06('0x4a'):if(_0x30d6d3[_0x9c06('0x4b')]&&_0x30d6d3[_0x9c06('0x1e')]){var _0x2f6c17={'dst':_0x202897['phone'],'text':_0x202897[_0x9c06('0x21')],'src':_0x30d6d3[_0x9c06('0x39')]||_0x30d6d3[_0x9c06('0x22')],'url':_0x30d6d3[_0x9c06('0x23')]+_0x9c06('0x24')+_0x202897['id']+_0x9c06('0x25')+_0x30d6d3[_0x9c06('0x26')]};var _0x144921=util['format'](_0x9c06('0x3f'),_0x30d6d3[_0x9c06('0x4b')],_0x30d6d3[_0x9c06('0x1e')]);var _0x2431c7={'method':_0x9c06('0x33'),'uri':util[_0x9c06('0x4c')](_0x9c06('0x4d'),_0x30d6d3[_0x9c06('0x4b')]),'body':_0x2f6c17,'headers':{'Authorization':util[_0x9c06('0x4c')](_0x9c06('0x41'),new Buffer(_0x144921)['toString'](_0x9c06('0x42')))},'json':!![]};rp(_0x2431c7)[_0x9c06('0x1a')](function(_0xb5fed){var _0x1acb5b={'messageId':_0xb5fed['message_uuid'][0x0]};return _0x2d75af[_0x9c06('0x15')](_0x1acb5b);})['catch'](function(_0x39f0fe){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x4a'),util['inspect'](_0x39f0fe,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x4a'),_0x9c06('0x4e'));}break;case'infobip':if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3['password']){if(_0x30d6d3[_0x9c06('0x4f')]){var _0x45cec2={'method':_0x9c06('0x33'),'uri':_0x30d6d3[_0x9c06('0x4f')]+_0x9c06('0x50'),'body':{'username':_0x30d6d3[_0x9c06('0x2d')],'password':_0x30d6d3[_0x9c06('0x2e')]},'json':!![]};return rp(_0x45cec2)['then'](function(_0xf0fb5a){var _0x35d3a6={'method':_0x9c06('0x33'),'uri':_0x30d6d3['baseUrl']+_0x9c06('0x51'),'body':{'messages':[{'from':_0x30d6d3[_0x9c06('0x22')],'destinations':[{'to':_0x202897[_0x9c06('0x22')]}],'text':_0x202897[_0x9c06('0x21')],'notifyUrl':_0x30d6d3[_0x9c06('0x23')]+'/api/sms/messages/'+_0x202897['id']+_0x9c06('0x25')+_0x30d6d3[_0x9c06('0x26')],'notifyContentType':_0x9c06('0x52'),'callbackData':_0x30d6d3[_0x9c06('0x22')]+';'+_0x202897['body']}]},'headers':{'Authorization':_0x9c06('0x53')+_0xf0fb5a['token']},'json':!![]};return rp(_0x35d3a6)[_0x9c06('0x1a')](function(_0x3f253d){if(_0x3f253d[_0x9c06('0x1f')]){var _0x1b89f3={'messageId':_0x3f253d[_0x9c06('0x1f')][0x0][_0x9c06('0xb')]};if(!_0x30d6d3['deliveryReport']){_0x1b89f3[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x1b89f3);}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x54'),util['inspect'](_0x3f253d,{'showHidden':![],'depth':null}));}});})[_0x9c06('0x16')](function(_0x5b999d){return logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x54'),util['inspect'](_0x5b999d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9c06('0x55'):var _0x13656a=require(_0x9c06('0x56'));if(_0x30d6d3['apiKey']){var _0x1ad12e={};_0x1ad12e[_0x9c06('0x57')]=_0x30d6d3[_0x9c06('0x2d')];_0x1ad12e[_0x9c06('0x22')]=_0x202897[_0x9c06('0x22')];_0x1ad12e['sender']=_0x30d6d3[_0x9c06('0x22')];_0x1ad12e[_0x9c06('0x58')]=_0x202897[_0x9c06('0x21')];_0x1ad12e['timestamp']=+new Date();var _0xd5add3='';var _0x50dc1f='';var _0x4cf766=Object[_0x9c06('0x59')](_0x1ad12e);_0x4cf766[_0x9c06('0x5a')]();for(var _0x2ce275=0x0;_0x2ce275<_0x4cf766[_0x9c06('0x5b')];_0x2ce275++){if(_0xd5add3!=''){_0xd5add3+='&';}_0xd5add3+=_0x4cf766[_0x2ce275]+'='+encodeURIComponent(_0x1ad12e[_0x4cf766[_0x2ce275]]);_0x50dc1f+=_0x1ad12e[_0x4cf766[_0x2ce275]];}_0x50dc1f+=_0x30d6d3[_0x9c06('0x5c')];_0x50dc1f=_0x13656a[_0x9c06('0x5d')](_0x9c06('0x5e'))[_0x9c06('0x15')](_0x50dc1f)[_0x9c06('0x5f')](_0x9c06('0x60'));if(_0xd5add3!==''){_0xd5add3+='&';}_0xd5add3+=_0x9c06('0x61')+_0x50dc1f;var _0x3712a5={'method':_0x9c06('0x32'),'uri':_0x30d6d3['baseUrl']+_0x9c06('0x62')+_0xd5add3,'json':!![]};return rp(_0x3712a5)[_0x9c06('0x1a')](function(_0x7d46d){var _0x52d461=Object['keys'](_0x7d46d);if(_0x7d46d[_0x52d461[0x0]][_0x9c06('0x17')]&&parseInt(_0x7d46d[_0x52d461[0x0]][_0x9c06('0x17')])===0x0){var _0x330e3a={'messageId':_0x7d46d[_0x52d461[0x0]][_0x9c06('0x63')]};if(!_0x30d6d3[_0x9c06('0x3c')]){_0x330e3a[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x330e3a);}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),'afterCreate',_0x9c06('0x55'),util[_0x9c06('0x29')](_0x7d46d[_0x9c06('0x17')],{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x722549){return logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x55'),util[_0x9c06('0x29')](_0x722549,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),'csc',_0x9c06('0x64'));}break;case'clickatell':if(_0x30d6d3[_0x9c06('0x5c')]){var _0x22e5e6={'method':_0x9c06('0x33'),'uri':_0x9c06('0x65'),'headers':{'Authorization':_0x30d6d3[_0x9c06('0x5c')]},'body':{'content':_0x202897['body'],'to':[_0x202897[_0x9c06('0x22')]],'from':_0x30d6d3['phone'],'binary':![],'clientMessageId':_0x9c06('0x66'),'charset':_0x9c06('0x67')},'json':!![]};rp(_0x22e5e6)['then'](function(_0x329d50){if(!_0x329d50[_0x9c06('0x17')]){var _0x140abe={'messageId':_0x329d50[_0x9c06('0x1f')][0x0][_0x9c06('0x68')]};if(!_0x30d6d3['deliveryReport']){_0x140abe[_0x9c06('0x37')]=!![];}return _0x2d75af[_0x9c06('0x15')](_0x140abe);}else{return logger['error'](_0x9c06('0x2a'),'afterCreate',_0x9c06('0x69'),util['inspect'](_0x329d50[_0x9c06('0x17')],{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x418df0){return logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),'clickatell',util[_0x9c06('0x29')](_0x418df0,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')](_0x9c06('0x2a'),'afterCreate',_0x9c06('0x69'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x30d6d3[_0x9c06('0x2d')]&&_0x30d6d3[_0x9c06('0x2e')]){var _0x144921=util[_0x9c06('0x4c')]('%s:%s',_0x30d6d3[_0x9c06('0x2d')],_0x30d6d3[_0x9c06('0x2e')]);var _0x2431c7={'method':_0x9c06('0x33'),'uri':_0x9c06('0x6a')+_0x30d6d3[_0x9c06('0x6b')]+_0x9c06('0x6c'),'body':{'to':[_0x202897[_0x9c06('0x22')]],'text':_0x202897[_0x9c06('0x21')],'from':_0x30d6d3[_0x9c06('0x22')],'applicationId':_0x30d6d3['applicationId']},'headers':{'Authorization':util['format'](_0x9c06('0x41'),new Buffer(_0x144921)[_0x9c06('0x6d')]('base64'))},'json':!![]};rp(_0x2431c7)[_0x9c06('0x1a')](function(_0x1c45bb){if(_0x1c45bb['id']){var _0x1d1dd4={'messageId':_0x1c45bb['id']};return _0x2d75af[_0x9c06('0x15')](_0x1d1dd4);}else{logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6e'),util['inspect'](_0x1c45bb,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0x4a91bd){logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6e'),util[_0x9c06('0x29')](_0x4a91bd,{'showHidden':![],'depth':null}));});}else{logger[_0x9c06('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c06('0x28'),_0x9c06('0x6e'),_0x9c06('0x49'));}break;case _0x9c06('0x6f'):if(_0x30d6d3['apiKey']){var _0x19eab5={};var _0x3712a5={'method':_0x9c06('0x33'),'uri':_0x9c06('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x30d6d3[_0x9c06('0x5c')],'Content-Type':_0x9c06('0x52')},'body':{'from':_0x30d6d3[_0x9c06('0x22')],'to':_0x202897[_0x9c06('0x22')],'text':_0x202897[_0x9c06('0x21')]},'json':!![]};return rp(_0x3712a5)[_0x9c06('0x1a')](function(_0x3c9cf4){if(_0x3c9cf4[_0x9c06('0x71')]==0xca){_0x19eab5[_0x9c06('0x72')]=_0x3c9cf4;var _0x1c9ff1={'method':_0x9c06('0x33'),'uri':_0x9c06('0x73'),'headers':{'Authorization':_0x9c06('0x74')+_0x30d6d3[_0x9c06('0x5c')],'Content-Type':_0x9c06('0x52')},'body':{'refid':_0x19eab5[_0x9c06('0x72')][_0x9c06('0x75')]},'json':!![]};return rp(_0x1c9ff1)[_0x9c06('0x1a')](function(_0x24c7ed){_0x19eab5[_0x9c06('0x76')]=_0x24c7ed;var _0x3ccfbc={'messageId':_0x19eab5[_0x9c06('0x72')]['refid'],'read':!![]};return _0x2d75af[_0x9c06('0x15')](_0x3ccfbc);});}else{return logger['error'](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6f'),util[_0x9c06('0x29')](_0x3c9cf4,{'showHidden':![],'depth':null}));}})[_0x9c06('0x16')](function(_0xd19eb5){return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),_0x9c06('0x6f'),util[_0x9c06('0x29')](_0xd19eb5,{'showHidden':![],'depth':null}));});}else{return logger[_0x9c06('0x17')](_0x9c06('0x2a'),_0x9c06('0x28'),'intelepeer',_0x9c06('0x77'));}break;}}})[_0x9c06('0x78')](function(){_0x23f1dc();});}else{_0x23f1dc();}}},'charset':_0x9c06('0x79'),'collate':_0x9c06('0x7a')});}; \ No newline at end of file +var _0x3c8a=['toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','deliveryReport','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','login','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','apiKey','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','Bearer\x20','code','message','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','createdAt','error','SmsAccount','find','then','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','token','sid','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','login?username=','GET','split','sms','POST','session_key','total_sent','internal_order_id','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s'];(function(_0x3d9b53,_0x3eefd3){var _0xa1140f=function(_0x5e5b63){while(--_0x5e5b63){_0x3d9b53['push'](_0x3d9b53['shift']());}};_0xa1140f(++_0x3eefd3);}(_0x3c8a,0x1b7));var _0xa3c8=function(_0x4fe993,_0x3c4b7b){_0x4fe993=_0x4fe993-0x0;var _0x3d5be6=_0x3c8a[_0x4fe993];return _0x3d5be6;};'use strict';var _=require(_0xa3c8('0x0'));var util=require(_0xa3c8('0x1'));var logger=require(_0xa3c8('0x2'))(_0xa3c8('0x3'));var moment=require(_0xa3c8('0x4'));var BPromise=require(_0xa3c8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3c8('0x6'));var rimraf=require(_0xa3c8('0x7'));var config=require(_0xa3c8('0x8'));var attributes=require('./smsMessage.attributes');module[_0xa3c8('0x9')]=function(_0x3d82eb,_0x1b3c53){return _0x3d82eb['define'](_0xa3c8('0xa'),attributes,{'tableName':_0xa3c8('0xb'),'paranoid':![],'indexes':[{'name':_0xa3c8('0xc'),'fields':[_0xa3c8('0xc')]},{'name':_0xa3c8('0xd'),'fields':[_0xa3c8('0xe')],'type':_0xa3c8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cd9cd,_0x23bd53,_0x76a7a0){var _0x25c17b=_0x3d82eb[_0xa3c8('0x10')];var _0x4b97a6=_0x1cd9cd['get']({'plain':!![]});if(_0x4b97a6[_0xa3c8('0x11')][_0xa3c8('0x12')]()==='in'||_0x4b97a6[_0xa3c8('0x11')]['toLowerCase']()===_0xa3c8('0x13')&&!_0x4b97a6[_0xa3c8('0x14')]&&!_[_0xa3c8('0x15')](_0x4b97a6[_0xa3c8('0x16')])&&!_['isNil'](_0x4b97a6[_0xa3c8('0x17')])){_0x25c17b[_0xa3c8('0x18')][_0xa3c8('0x19')]({'where':{'id':_0x4b97a6[_0xa3c8('0x17')]}})['then'](function(_0x4ec8dd){if(_0x4ec8dd){_0x4ec8dd[_0xa3c8('0x1a')]({'lastMsgAt':_0x4b97a6[_0xa3c8('0x1b')],'lastMsgDirection':_0x4b97a6['direction'][_0xa3c8('0x12')]()});}})['catch'](function(_0x526902){console[_0xa3c8('0x1c')](_0x526902);});}if(_0x4b97a6[_0xa3c8('0x11')]===_0xa3c8('0x13')&&!_0x4b97a6[_0xa3c8('0x14')]){var _0x3aa609;_0x25c17b[_0xa3c8('0x1d')][_0xa3c8('0x1e')]({'where':{'id':_0x4b97a6['SmsAccountId']},'raw':!![]})[_0xa3c8('0x1f')](function(_0x3ecb07){_0x3aa609=_0x3ecb07;if(_0x3aa609&&_0x3aa609[_0xa3c8('0x20')]){switch(_0x3aa609[_0xa3c8('0x20')]){case _0xa3c8('0x21'):var _0x2a40c3=require(_0xa3c8('0x21'));if(_0x3aa609[_0xa3c8('0x22')]&&_0x3aa609['authToken']&&_0x3aa609[_0xa3c8('0x23')]){var _0x32f035=new _0x2a40c3(_0x3aa609[_0xa3c8('0x22')],_0x3aa609[_0xa3c8('0x24')]);_0x32f035[_0xa3c8('0x25')][_0xa3c8('0x26')]({'body':_0x4b97a6[_0xa3c8('0xe')],'to':_0x4b97a6[_0xa3c8('0x23')],'from':_0x3aa609[_0xa3c8('0x23')],'statusCallback':_0x3aa609[_0xa3c8('0x27')]+_0xa3c8('0x28')+_0x4b97a6['id']+'/status?token='+_0x3aa609[_0xa3c8('0x29')]})[_0xa3c8('0x1f')](function(_0x7147f2){if(_0x7147f2['sid']){return _0x1cd9cd[_0xa3c8('0x1a')]({'messageId':_0x7147f2[_0xa3c8('0x2a')]});}})[_0xa3c8('0x2b')](function(_0x11a5db){logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x21'),util[_0xa3c8('0x2e')](_0x11a5db,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),'afterCreate','twilio',_0xa3c8('0x2f'));}break;case _0xa3c8('0x30'):var _0x126de0=_0xa3c8('0x31');if(_0x3aa609[_0xa3c8('0x32')]&&_0x3aa609[_0xa3c8('0x33')]){var _0x3df084={'recipient':[_0x4b97a6[_0xa3c8('0x23')]],'message':_0x4b97a6[_0xa3c8('0xe')],'message_type':_0x3aa609[_0xa3c8('0x34')]};if(_0x3aa609[_0xa3c8('0x34')]&&_0x3aa609['smsMethod']!=='SI'){_0x3df084[_0xa3c8('0x35')]=_0x3aa609['phone'];}var _0x560ae9={'url':_0x126de0+_0xa3c8('0x36')+_0x3aa609['username']+'&password='+_0x3aa609[_0xa3c8('0x33')],'method':_0xa3c8('0x37')};rp(_0x560ae9)[_0xa3c8('0x1f')](function(_0x2cea24){var _0x1797c4=_0x2cea24[_0xa3c8('0x38')](';');var _0x245d0a={'user_key':_0x1797c4[0x0],'session_key':_0x1797c4[0x1]};_0x560ae9={'url':_0x126de0+_0xa3c8('0x39'),'method':_0xa3c8('0x3a'),'headers':{'user_key':_0x245d0a['user_key'],'Session_key':_0x245d0a[_0xa3c8('0x3b')]},'json':!![],'body':_0x3df084};return rp(_0x560ae9);})[_0xa3c8('0x1f')](function(_0x3b294d){if(_0x3b294d[_0xa3c8('0x3c')]>=0x1){var _0x1384e6={'messageId':_0x3b294d[_0xa3c8('0x3d')]};if(_0x3aa609['smsMethod']!=='GP'||!_0x3aa609['deliveryReport']){_0x1384e6[_0xa3c8('0x3e')]=!![];}return _0x1cd9cd[_0xa3c8('0x1a')](_0x1384e6);}else{return logger[_0xa3c8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa3c8('0x2d'),_0xa3c8('0x30'),util['inspect'](_0x3b294d,{'showHidden':![],'depth':null}));}})[_0xa3c8('0x2b')](function(_0x218bfb){return logger['error'](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x30'),util[_0xa3c8('0x2e')](_0x218bfb,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa3c8('0x2d'),_0xa3c8('0x30'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xa3c8('0x3f'):if(_0x3aa609[_0xa3c8('0x24')]){var _0x603d52={'recipient':_0x4b97a6[_0xa3c8('0x23')],'message':_0x4b97a6['body'],'sender':_0x3aa609[_0xa3c8('0x40')]||_0x3aa609[_0xa3c8('0x23')],'authorization':_0x3aa609[_0xa3c8('0x24')]};var _0x23bd53={'method':_0xa3c8('0x3a'),'uri':_0xa3c8('0x41'),'body':_0x603d52,'json':!![]};rp(_0x23bd53)['then'](function(_0x22a7b5){var _0x79dca1={'messageId':_0x22a7b5[_0xa3c8('0x42')]};if(!_0x3aa609['deliveryReport']){_0x79dca1[_0xa3c8('0x3e')]=!![];}return _0x1cd9cd[_0xa3c8('0x1a')](_0x79dca1);})[_0xa3c8('0x2b')](function(_0x3159b2){logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x3f'),util[_0xa3c8('0x2e')](_0x3159b2,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x3f'),_0xa3c8('0x43'));}break;case _0xa3c8('0x44'):if(_0x3aa609['username']&&_0x3aa609[_0xa3c8('0x33')]){var _0x603d52={'messages':[{'source':_0xa3c8('0x45'),'to':_0x4b97a6['phone'],'body':_0x4b97a6[_0xa3c8('0xe')],'from':_0x3aa609['senderString']||_0x3aa609[_0xa3c8('0x23')]}]};var _0x4593b6=util[_0xa3c8('0x46')]('%s:%s',_0x3aa609[_0xa3c8('0x32')],_0x3aa609['password']);var _0x23bd53={'method':_0xa3c8('0x3a'),'uri':_0xa3c8('0x47'),'body':_0x603d52,'headers':{'Authorization':util[_0xa3c8('0x46')](_0xa3c8('0x48'),new Buffer(_0x4593b6)[_0xa3c8('0x49')](_0xa3c8('0x4a')))},'json':!![]};rp(_0x23bd53)[_0xa3c8('0x1f')](function(_0x1d621a){if(_0x1d621a[_0xa3c8('0x4b')]>=0xc8&&_0x1d621a['http_code']<=0xce){if(_0x1d621a[_0xa3c8('0x4c')]&&_0x1d621a[_0xa3c8('0x4c')][_0xa3c8('0x4d')]>0x0){var _0x3b20d2=_[_0xa3c8('0x4e')](_0x1d621a[_0xa3c8('0x4c')]['messages']);var _0x536ce0={'messageId':_0x3b20d2[_0xa3c8('0x4f')]};if(!_0x3aa609['deliveryReport']){_0x536ce0[_0xa3c8('0x3e')]=!![];}return _0x1cd9cd[_0xa3c8('0x1a')](_0x536ce0);}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),'clickSend',util[_0xa3c8('0x2e')](_0x1d621a,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xa3c8('0x2c'),_0xa3c8('0x2d'),'clickSend',util[_0xa3c8('0x2e')](_0x1d621a,{'showHidden':![],'depth':null}));}})[_0xa3c8('0x2b')](function(_0x3476f4){logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x50'),util[_0xa3c8('0x2e')](_0x3476f4,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xa3c8('0x51'):if(_0x3aa609[_0xa3c8('0x52')]&&_0x3aa609['authToken']){var _0x603d52={'dst':_0x4b97a6[_0xa3c8('0x23')],'text':_0x4b97a6[_0xa3c8('0xe')],'src':_0x3aa609[_0xa3c8('0x40')]||_0x3aa609[_0xa3c8('0x23')],'url':_0x3aa609['remote']+'/api/sms/messages/'+_0x4b97a6['id']+_0xa3c8('0x53')+_0x3aa609[_0xa3c8('0x29')]};var _0x4593b6=util[_0xa3c8('0x46')]('%s:%s',_0x3aa609[_0xa3c8('0x52')],_0x3aa609['authToken']);var _0x23bd53={'method':_0xa3c8('0x3a'),'uri':util[_0xa3c8('0x46')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3aa609[_0xa3c8('0x52')]),'body':_0x603d52,'headers':{'Authorization':util[_0xa3c8('0x46')]('Basic\x20%s',new Buffer(_0x4593b6)[_0xa3c8('0x49')]('base64'))},'json':!![]};rp(_0x23bd53)[_0xa3c8('0x1f')](function(_0x5378f0){var _0x551dfa={'messageId':_0x5378f0[_0xa3c8('0x54')][0x0]};return _0x1cd9cd[_0xa3c8('0x1a')](_0x551dfa);})[_0xa3c8('0x2b')](function(_0x3c3bd6){logger['error'](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x51'),util['inspect'](_0x3c3bd6,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa3c8('0x2d'),_0xa3c8('0x51'),_0xa3c8('0x55'));}break;case _0xa3c8('0x56'):if(_0x3aa609[_0xa3c8('0x32')]&&_0x3aa609[_0xa3c8('0x33')]){if(_0x3aa609[_0xa3c8('0x57')]){var _0x479b71={'method':_0xa3c8('0x3a'),'uri':_0x3aa609[_0xa3c8('0x57')]+_0xa3c8('0x58'),'body':{'username':_0x3aa609[_0xa3c8('0x32')],'password':_0x3aa609[_0xa3c8('0x33')]},'json':!![]};return rp(_0x479b71)[_0xa3c8('0x1f')](function(_0x4ecdf0){var _0x346fb7={'method':_0xa3c8('0x3a'),'uri':_0x3aa609[_0xa3c8('0x57')]+_0xa3c8('0x59'),'body':{'messages':[{'from':_0x3aa609[_0xa3c8('0x23')],'destinations':[{'to':_0x4b97a6['phone']}],'text':_0x4b97a6[_0xa3c8('0xe')],'notifyUrl':_0x3aa609[_0xa3c8('0x27')]+_0xa3c8('0x28')+_0x4b97a6['id']+_0xa3c8('0x53')+_0x3aa609[_0xa3c8('0x29')],'notifyContentType':_0xa3c8('0x5a'),'callbackData':_0x3aa609[_0xa3c8('0x23')]+';'+_0x4b97a6[_0xa3c8('0xe')]}]},'headers':{'Authorization':_0xa3c8('0x5b')+_0x4ecdf0[_0xa3c8('0x29')]},'json':!![]};return rp(_0x346fb7)[_0xa3c8('0x1f')](function(_0x3e3441){if(_0x3e3441[_0xa3c8('0x25')]){var _0x3cd143={'messageId':_0x3e3441[_0xa3c8('0x25')][0x0][_0xa3c8('0xc')]};if(!_0x3aa609[_0xa3c8('0x5c')]){_0x3cd143['read']=!![];}return _0x1cd9cd[_0xa3c8('0x1a')](_0x3cd143);}else{return logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x56'),util[_0xa3c8('0x2e')](_0x3e3441,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x6cf773){return logger['error'](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x56'),util['inspect'](_0x6cf773,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x56'),_0xa3c8('0x5d'));}}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x56'),_0xa3c8('0x5e'));}break;case _0xa3c8('0x5f'):var _0x32a5c5=require(_0xa3c8('0x60'));if(_0x3aa609['apiKey']){var _0x1d0af0={};_0x1d0af0[_0xa3c8('0x61')]=_0x3aa609[_0xa3c8('0x32')];_0x1d0af0[_0xa3c8('0x23')]=_0x4b97a6[_0xa3c8('0x23')];_0x1d0af0[_0xa3c8('0x35')]=_0x3aa609[_0xa3c8('0x23')];_0x1d0af0['text']=_0x4b97a6['body'];_0x1d0af0[_0xa3c8('0x62')]=+new Date();var _0x2b191e='';var _0x58d044='';var _0x129eb1=Object[_0xa3c8('0x63')](_0x1d0af0);_0x129eb1[_0xa3c8('0x64')]();for(var _0x2dc448=0x0;_0x2dc448<_0x129eb1[_0xa3c8('0x65')];_0x2dc448++){if(_0x2b191e!=''){_0x2b191e+='&';}_0x2b191e+=_0x129eb1[_0x2dc448]+'='+encodeURIComponent(_0x1d0af0[_0x129eb1[_0x2dc448]]);_0x58d044+=_0x1d0af0[_0x129eb1[_0x2dc448]];}_0x58d044+=_0x3aa609['apiKey'];_0x58d044=_0x32a5c5[_0xa3c8('0x66')](_0xa3c8('0x67'))[_0xa3c8('0x1a')](_0x58d044)[_0xa3c8('0x68')](_0xa3c8('0x69'));if(_0x2b191e!==''){_0x2b191e+='&';}_0x2b191e+=_0xa3c8('0x6a')+_0x58d044;var _0x560ae9={'method':_0xa3c8('0x37'),'uri':_0x3aa609[_0xa3c8('0x57')]+_0xa3c8('0x6b')+_0x2b191e,'json':!![]};return rp(_0x560ae9)[_0xa3c8('0x1f')](function(_0x51c8ab){var _0x56669d=Object[_0xa3c8('0x63')](_0x51c8ab);if(_0x51c8ab[_0x56669d[0x0]]['error']&&parseInt(_0x51c8ab[_0x56669d[0x0]][_0xa3c8('0x1c')])===0x0){var _0x1f0515={'messageId':_0x51c8ab[_0x56669d[0x0]]['id_sms']};if(!_0x3aa609['deliveryReport']){_0x1f0515[_0xa3c8('0x3e')]=!![];}return _0x1cd9cd['update'](_0x1f0515);}else{return logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x5f'),util[_0xa3c8('0x2e')](_0x51c8ab[_0xa3c8('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3fda25){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa3c8('0x5f'),util['inspect'](_0x3fda25,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x5f'),'Missing\x20parameters:\x20apiKey');}break;case _0xa3c8('0x6c'):if(_0x3aa609['apiKey']){var _0x3649cf={'method':_0xa3c8('0x3a'),'uri':_0xa3c8('0x6d'),'headers':{'Authorization':_0x3aa609[_0xa3c8('0x6e')]},'body':{'content':_0x4b97a6[_0xa3c8('0xe')],'to':[_0x4b97a6['phone']],'from':_0x3aa609['phone'],'binary':![],'clientMessageId':_0xa3c8('0x6f'),'charset':'UTF-8'},'json':!![]};rp(_0x3649cf)['then'](function(_0x238bec){if(!_0x238bec[_0xa3c8('0x1c')]){var _0x501603={'messageId':_0x238bec['messages'][0x0][_0xa3c8('0x70')]};if(!_0x3aa609[_0xa3c8('0x5c')]){_0x501603[_0xa3c8('0x3e')]=!![];}return _0x1cd9cd[_0xa3c8('0x1a')](_0x501603);}else{return logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x6c'),util[_0xa3c8('0x2e')](_0x238bec[_0xa3c8('0x1c')],{'showHidden':![],'depth':null}));}})[_0xa3c8('0x2b')](function(_0x10d89a){return logger['error'](_0xa3c8('0x2c'),'afterCreate',_0xa3c8('0x6c'),util[_0xa3c8('0x2e')](_0x10d89a,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x6c'),_0xa3c8('0x71'));}break;case _0xa3c8('0x72'):if(_0x3aa609['username']&&_0x3aa609[_0xa3c8('0x33')]){var _0x4593b6=util[_0xa3c8('0x46')](_0xa3c8('0x73'),_0x3aa609['username'],_0x3aa609[_0xa3c8('0x33')]);var _0x23bd53={'method':'POST','uri':_0xa3c8('0x74')+_0x3aa609[_0xa3c8('0x75')]+'/messages','body':{'to':[_0x4b97a6[_0xa3c8('0x23')]],'text':_0x4b97a6[_0xa3c8('0xe')],'from':_0x3aa609[_0xa3c8('0x23')],'applicationId':_0x3aa609[_0xa3c8('0x76')]},'headers':{'Authorization':util[_0xa3c8('0x46')]('Basic\x20%s',new Buffer(_0x4593b6)['toString'](_0xa3c8('0x4a')))},'json':!![]};rp(_0x23bd53)['then'](function(_0x1b4f0c){if(_0x1b4f0c['id']){var _0x42073c={'messageId':_0x1b4f0c['id']};return _0x1cd9cd[_0xa3c8('0x1a')](_0x42073c);}else{logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),'afterCreate',_0xa3c8('0x72'),util[_0xa3c8('0x2e')](_0x1b4f0c,{'showHidden':![],'depth':null}));}})[_0xa3c8('0x2b')](function(_0x9b0d98){logger[_0xa3c8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa3c8('0x2d'),_0xa3c8('0x72'),util['inspect'](_0x9b0d98,{'showHidden':![],'depth':null}));});}else{logger[_0xa3c8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa3c8('0x2d'),'bandwidth',_0xa3c8('0x5e'));}break;case _0xa3c8('0x77'):if(_0x3aa609[_0xa3c8('0x6e')]){var _0x227d2d={};var _0x560ae9={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xa3c8('0x78')+_0x3aa609['apiKey'],'Content-Type':_0xa3c8('0x5a')},'body':{'from':_0x3aa609[_0xa3c8('0x23')],'to':_0x4b97a6['phone'],'text':_0x4b97a6[_0xa3c8('0xe')]},'json':!![]};return rp(_0x560ae9)['then'](function(_0x3e8640){if(_0x3e8640[_0xa3c8('0x79')]==0xca){_0x227d2d[_0xa3c8('0x7a')]=_0x3e8640;var _0x2a4a4f={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xa3c8('0x78')+_0x3aa609[_0xa3c8('0x6e')],'Content-Type':_0xa3c8('0x5a')},'body':{'refid':_0x227d2d[_0xa3c8('0x7a')][_0xa3c8('0x7b')]},'json':!![]};return rp(_0x2a4a4f)[_0xa3c8('0x1f')](function(_0x15b272){_0x227d2d[_0xa3c8('0x7c')]=_0x15b272;var _0x4df6be={'messageId':_0x227d2d['message'][_0xa3c8('0x7b')],'read':!![]};return _0x1cd9cd['update'](_0x4df6be);});}else{return logger[_0xa3c8('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa3c8('0x2d'),_0xa3c8('0x77'),util[_0xa3c8('0x2e')](_0x3e8640,{'showHidden':![],'depth':null}));}})[_0xa3c8('0x2b')](function(_0x17dce9){return logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x77'),util[_0xa3c8('0x2e')](_0x17dce9,{'showHidden':![],'depth':null}));});}else{return logger[_0xa3c8('0x1c')](_0xa3c8('0x2c'),_0xa3c8('0x2d'),_0xa3c8('0x77'),_0xa3c8('0x7d'));}break;}}})[_0xa3c8('0x7e')](function(){_0x76a7a0();});}else{_0x76a7a0();}}},'charset':_0xa3c8('0x7f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8cd0528..79e2dda 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 _0x4867=['info','result','CreateSmsMessage','SmsMessage','create','options','then','debug','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2f85e9,_0x32efbc){var _0x295444=function(_0x4be5b8){while(--_0x4be5b8){_0x2f85e9['push'](_0x2f85e9['shift']());}};_0x295444(++_0x32efbc);}(_0x4867,0xc3));var _0x7486=function(_0x2863e7,_0x2e4167){_0x2863e7=_0x2863e7-0x0;var _0xf4870f=_0x4867[_0x2863e7];return _0xf4870f;};'use strict';var _=require('lodash');var util=require(_0x7486('0x0'));var moment=require(_0x7486('0x1'));var BPromise=require('bluebird');var rs=require(_0x7486('0x2'));var fs=require('fs');var Redis=require(_0x7486('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7486('0x4'));var logger=require(_0x7486('0x5'))(_0x7486('0x6'));var config=require(_0x7486('0x7'));var jayson=require(_0x7486('0x8'));var client=jayson[_0x7486('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7486('0xa')],{'host':_0x7486('0xb'),'port':0x18eb});var socket=require(_0x7486('0xc'))(new Redis(config['redis']));require(_0x7486('0xd'))[_0x7486('0xe')](socket);function respondWithRpcPromise(_0x540eb8,_0x228e04,_0x2a77d8){return new BPromise(function(_0x5f4677,_0x150c4e){return client[_0x7486('0xf')](_0x540eb8,_0x2a77d8)['then'](function(_0x4797e4){logger['info'](_0x7486('0x10'),_0x228e04,'request\x20sent');logger['debug'](_0x7486('0x11'),_0x228e04,_0x7486('0x12'),JSON['stringify'](_0x4797e4));if(_0x4797e4[_0x7486('0x13')]){if(_0x4797e4[_0x7486('0x13')][_0x7486('0x14')]===0x1f4){logger[_0x7486('0x13')](_0x7486('0x10'),_0x228e04,_0x4797e4['error'][_0x7486('0x15')]);return _0x150c4e(_0x4797e4[_0x7486('0x13')][_0x7486('0x15')]);}logger['error'](_0x7486('0x10'),_0x228e04,_0x4797e4[_0x7486('0x13')]['message']);return _0x5f4677(_0x4797e4[_0x7486('0x13')][_0x7486('0x15')]);}else{logger[_0x7486('0x16')]('SmsMessage,\x20%s,\x20%s',_0x228e04,_0x7486('0x12'));_0x5f4677(_0x4797e4[_0x7486('0x17')][_0x7486('0x15')]);}})['catch'](function(_0x17f694){logger[_0x7486('0x13')](_0x7486('0x10'),_0x228e04,_0x17f694);_0x150c4e(_0x17f694);});});}exports[_0x7486('0x18')]=function(_0x11f1c5){var _0x962820=this;return new Promise(function(_0x3cdf99,_0x2ca33d){return db[_0x7486('0x19')][_0x7486('0x1a')](_0x11f1c5['body'],{'raw':_0x11f1c5['options']?_0x11f1c5[_0x7486('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x7486('0x1c')](function(_0x122487){logger[_0x7486('0x16')](_0x7486('0x18'),_0x11f1c5);logger[_0x7486('0x1d')](_0x7486('0x18'),_0x11f1c5,JSON[_0x7486('0x1e')](_0x122487));_0x3cdf99(_0x122487);})['catch'](function(_0x41d507){logger[_0x7486('0x13')]('CreateSmsMessage',_0x41d507['message'],_0x11f1c5);_0x2ca33d(_0x962820[_0x7486('0x13')](0x1f4,_0x41d507[_0x7486('0x15')]));});});}; \ No newline at end of file +var _0x9dda=['jayson/promise','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x51aabe,_0xabd258){var _0x1c7334=function(_0x2a0f54){while(--_0x2a0f54){_0x51aabe['push'](_0x51aabe['shift']());}};_0x1c7334(++_0xabd258);}(_0x9dda,0x184));var _0xa9dd=function(_0x4a9a3f,_0x34ced5){_0x4a9a3f=_0x4a9a3f-0x0;var _0x4b4dd3=_0x9dda[_0x4a9a3f];return _0x4b4dd3;};'use strict';var _=require(_0xa9dd('0x0'));var util=require(_0xa9dd('0x1'));var moment=require(_0xa9dd('0x2'));var BPromise=require(_0xa9dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9dd('0x4'));var db=require(_0xa9dd('0x5'))['db'];var utils=require(_0xa9dd('0x6'));var logger=require('../../config/logger')(_0xa9dd('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9dd('0x8'));var client=jayson['client'][_0xa9dd('0x9')]({'port':0x232a});config[_0xa9dd('0xa')]=_[_0xa9dd('0xb')](config[_0xa9dd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa9dd('0xc'))(new Redis(config[_0xa9dd('0xa')]));require(_0xa9dd('0xd'))[_0xa9dd('0xe')](socket);function respondWithRpcPromise(_0x4217a2,_0x525e76,_0x2e2c8f){return new BPromise(function(_0x5f26a9,_0x29cd99){return client[_0xa9dd('0xf')](_0x4217a2,_0x2e2c8f)[_0xa9dd('0x10')](function(_0x3bd992){logger['info'](_0xa9dd('0x11'),_0x525e76,'request\x20sent');logger[_0xa9dd('0x12')](_0xa9dd('0x13'),_0x525e76,'request\x20sent',JSON[_0xa9dd('0x14')](_0x3bd992));if(_0x3bd992[_0xa9dd('0x15')]){if(_0x3bd992['error'][_0xa9dd('0x16')]===0x1f4){logger[_0xa9dd('0x15')](_0xa9dd('0x11'),_0x525e76,_0x3bd992[_0xa9dd('0x15')]['message']);return _0x29cd99(_0x3bd992[_0xa9dd('0x15')][_0xa9dd('0x17')]);}logger['error'](_0xa9dd('0x11'),_0x525e76,_0x3bd992[_0xa9dd('0x15')][_0xa9dd('0x17')]);return _0x5f26a9(_0x3bd992[_0xa9dd('0x15')][_0xa9dd('0x17')]);}else{logger[_0xa9dd('0x18')](_0xa9dd('0x11'),_0x525e76,_0xa9dd('0x19'));_0x5f26a9(_0x3bd992[_0xa9dd('0x1a')][_0xa9dd('0x17')]);}})[_0xa9dd('0x1b')](function(_0x26b392){logger['error'](_0xa9dd('0x11'),_0x525e76,_0x26b392);_0x29cd99(_0x26b392);});});}exports[_0xa9dd('0x1c')]=function(_0x380537){var _0x46f19a=this;return new Promise(function(_0x2a0ba9,_0x4a2292){return db[_0xa9dd('0x1d')]['create'](_0x380537[_0xa9dd('0x1e')],{'raw':_0x380537[_0xa9dd('0x1f')]?_0x380537['options'][_0xa9dd('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4370b0){logger[_0xa9dd('0x18')](_0xa9dd('0x1c'),_0x380537);logger[_0xa9dd('0x12')]('CreateSmsMessage',_0x380537,JSON[_0xa9dd('0x14')](_0x4370b0));_0x2a0ba9(_0x4370b0);})[_0xa9dd('0x1b')](function(_0x42aa8f){logger[_0xa9dd('0x15')](_0xa9dd('0x1c'),_0x42aa8f[_0xa9dd('0x17')],_0x380537);_0x4a2292(_0x46f19a[_0xa9dd('0x15')](0x1f4,_0x42aa8f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 14cacc5..d2be11c 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 _0x2c13=['remove','update','emit','removeListener','register','length','smsMessage:','save'];(function(_0xf61a76,_0x249781){var _0x168c51=function(_0x1e2bac){while(--_0x1e2bac){_0xf61a76['push'](_0xf61a76['shift']());}};_0x168c51(++_0x249781);}(_0x2c13,0x1b7));var _0x32c1=function(_0x2e0216,_0xd90f87){_0x2e0216=_0x2e0216-0x0;var _0x1ab498=_0x2c13[_0x2e0216];return _0x1ab498;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x32c1('0x0'),_0x32c1('0x1'),_0x32c1('0x2')];function createListener(_0x167573,_0x422cf4){return function(_0x1bfb0a){_0x422cf4[_0x32c1('0x3')](_0x167573,_0x1bfb0a);};}function removeListener(_0x1545af,_0x3e7a1f){return function(){SmsMessageEvents[_0x32c1('0x4')](_0x1545af,_0x3e7a1f);};}exports[_0x32c1('0x5')]=function(_0x2ef858){for(var _0x36e891=0x0,_0x824ee=events[_0x32c1('0x6')];_0x36e891<_0x824ee;_0x36e891++){var _0x2b8df7=events[_0x36e891];var _0x3a240c=createListener(_0x32c1('0x7')+_0x2b8df7,_0x2ef858);SmsMessageEvents['on'](_0x2b8df7,_0x3a240c);}}; \ No newline at end of file +var _0x8c0f=['save','update','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x35ff05,_0x42c284){var _0x5e52e7=function(_0xc4ec21){while(--_0xc4ec21){_0x35ff05['push'](_0x35ff05['shift']());}};_0x5e52e7(++_0x42c284);}(_0x8c0f,0x14f));var _0xf8c0=function(_0x567ac1,_0xfa0ffc){_0x567ac1=_0x567ac1-0x0;var _0x95f8d4=_0x8c0f[_0x567ac1];return _0x95f8d4;};'use strict';var SmsMessageEvents=require(_0xf8c0('0x0'));var events=[_0xf8c0('0x1'),'remove',_0xf8c0('0x2')];function createListener(_0x22913a,_0x16c82b){return function(_0x2c906d){_0x16c82b['emit'](_0x22913a,_0x2c906d);};}function removeListener(_0x5f2137,_0x5a45df){return function(){SmsMessageEvents[_0xf8c0('0x3')](_0x5f2137,_0x5a45df);};}exports[_0xf8c0('0x4')]=function(_0x44124a){for(var _0xb2213=0x0,_0xcf36e9=events[_0xf8c0('0x5')];_0xb2213<_0xcf36e9;_0xb2213++){var _0x3216e5=events[_0xb2213];var _0x36cdaf=createListener(_0xf8c0('0x6')+_0x3216e5,_0x44124a);SmsMessageEvents['on'](_0x3216e5,_0x36cdaf);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 198bbcf..97a32ea 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 _0x0ee3=['/describe','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index'];(function(_0x3472e7,_0x71f00c){var _0x4db011=function(_0x7887d5){while(--_0x7887d5){_0x3472e7['push'](_0x3472e7['shift']());}};_0x4db011(++_0x71f00c);}(_0x0ee3,0x160));var _0x30ee=function(_0x5ed155,_0x283365){_0x5ed155=_0x5ed155-0x0;var _0x241ca3=_0x0ee3[_0x5ed155];return _0x241ca3;};'use strict';var multer=require(_0x30ee('0x0'));var util=require(_0x30ee('0x1'));var path=require(_0x30ee('0x2'));var timeout=require(_0x30ee('0x3'));var express=require(_0x30ee('0x4'));var router=express[_0x30ee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x30ee('0x6'));var interaction=require(_0x30ee('0x7'));var config=require(_0x30ee('0x8'));var controller=require(_0x30ee('0x9'));router[_0x30ee('0xa')]('/',auth['isAuthenticated'](),controller[_0x30ee('0xb')]);router[_0x30ee('0xa')](_0x30ee('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x30ee('0xa')]('/:id',auth[_0x30ee('0xd')](),controller[_0x30ee('0xe')]);router[_0x30ee('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x30ee('0xf')]);router[_0x30ee('0xa')](_0x30ee('0x10'),auth['isAuthenticated'](),controller[_0x30ee('0x11')]);router[_0x30ee('0xa')](_0x30ee('0x12'),auth['isAuthenticated'](),controller[_0x30ee('0x13')]);router[_0x30ee('0x14')]('/',auth[_0x30ee('0xd')](),controller[_0x30ee('0x15')]);router[_0x30ee('0x14')](_0x30ee('0x10'),auth[_0x30ee('0xd')](),controller[_0x30ee('0x16')]);router[_0x30ee('0x14')](_0x30ee('0x12'),auth['isAuthenticated'](),controller[_0x30ee('0x17')]);router[_0x30ee('0x18')](_0x30ee('0x19'),auth[_0x30ee('0xd')](),controller['update']);router[_0x30ee('0x1a')](_0x30ee('0x19'),auth[_0x30ee('0xd')](),controller[_0x30ee('0x1b')]);router[_0x30ee('0x1a')](_0x30ee('0x10'),auth[_0x30ee('0xd')](),controller['removeTeams']);router[_0x30ee('0x1a')](_0x30ee('0x12'),auth[_0x30ee('0xd')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x373d=['/describe','describe','/:id','/:id/members','/:id/teams','/:id/users','post','create','addAgents','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index'];(function(_0x1bf69a,_0x413dac){var _0x4e0ceb=function(_0x1b92d9){while(--_0x1b92d9){_0x1bf69a['push'](_0x1bf69a['shift']());}};_0x4e0ceb(++_0x413dac);}(_0x373d,0x1ae));var _0xd373=function(_0x283b7c,_0x53bb1f){_0x283b7c=_0x283b7c-0x0;var _0x2a26ea=_0x373d[_0x283b7c];return _0x2a26ea;};'use strict';var multer=require(_0xd373('0x0'));var util=require(_0xd373('0x1'));var path=require(_0xd373('0x2'));var timeout=require('connect-timeout');var express=require(_0xd373('0x3'));var router=express['Router']();var fs_extra=require(_0xd373('0x4'));var auth=require(_0xd373('0x5'));var interaction=require(_0xd373('0x6'));var config=require(_0xd373('0x7'));var controller=require(_0xd373('0x8'));router[_0xd373('0x9')]('/',auth[_0xd373('0xa')](),controller[_0xd373('0xb')]);router[_0xd373('0x9')](_0xd373('0xc'),auth[_0xd373('0xa')](),controller[_0xd373('0xd')]);router[_0xd373('0x9')](_0xd373('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xd373('0x9')](_0xd373('0xf'),auth[_0xd373('0xa')](),controller['getMembers']);router['get'](_0xd373('0x10'),auth[_0xd373('0xa')](),controller['getTeams']);router[_0xd373('0x9')](_0xd373('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd373('0x12')]('/',auth[_0xd373('0xa')](),controller[_0xd373('0x13')]);router[_0xd373('0x12')](_0xd373('0x10'),auth[_0xd373('0xa')](),controller['addTeams']);router[_0xd373('0x12')](_0xd373('0x11'),auth[_0xd373('0xa')](),controller[_0xd373('0x14')]);router[_0xd373('0x15')](_0xd373('0xe'),auth[_0xd373('0xa')](),controller[_0xd373('0x16')]);router[_0xd373('0x17')](_0xd373('0xe'),auth[_0xd373('0xa')](),controller[_0xd373('0x18')]);router['delete'](_0xd373('0x10'),auth[_0xd373('0xa')](),controller['removeTeams']);router['delete'](_0xd373('0x11'),auth[_0xd373('0xa')](),controller['removeAgents']);module[_0xd373('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 3b9515d..9543012 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 _0x05f1=['ENUM','sequelize','exports','STRING','INTEGER'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0x05f1,0x1c3));var _0x105f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x05f1[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x105f('0x0'));module[_0x105f('0x1')]={'name':{'type':Sequelize[_0x105f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x105f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x105f('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x6734=['INTEGER','ENUM','beepall','roundrobin','exports','STRING','name'];(function(_0x295a3d,_0x56d487){var _0x23a732=function(_0x15cfc2){while(--_0x15cfc2){_0x295a3d['push'](_0x295a3d['shift']());}};_0x23a732(++_0x56d487);}(_0x6734,0x169));var _0x4673=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x6734[_0x318840];return _0x223da4;};'use strict';var Sequelize=require('sequelize');module[_0x4673('0x0')]={'name':{'type':Sequelize[_0x4673('0x1')],'unique':_0x4673('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4673('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4673('0x4')]('rrmemory',_0x4673('0x5'),_0x4673('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3f8a5d0..a2b0cfb 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 _0x184c=['forEach','emit','userSmsQueue:save','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','removeTeams','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','type','model','query','filters','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','then','include','findAll','catch','show','keys','attributes','length','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','find','describe','findOne','UserSmsQueue','nolimit','User','findAndCountAll','UserId','agent','smsPause','rows','format','%s/%s','createdAt','updatedAt','getTeams','Agents','voicePause','sequelize','transaction','each'];(function(_0x2678c9,_0x5e330f){var _0x495a2a=function(_0x511700){while(--_0x511700){_0x2678c9['push'](_0x2678c9['shift']());}};_0x495a2a(++_0x5e330f);}(_0x184c,0x1c3));var _0xc184=function(_0x57a124,_0x2787b4){_0x57a124=_0x57a124-0x0;var _0x171bb8=_0x184c[_0x57a124];return _0x171bb8;};'use strict';var emlformat=require(_0xc184('0x0'));var rimraf=require(_0xc184('0x1'));var zipdir=require(_0xc184('0x2'));var jsonpatch=require(_0xc184('0x3'));var rp=require(_0xc184('0x4'));var moment=require(_0xc184('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc184('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc184('0x7'));var csv=require('to-csv');var ejs=require(_0xc184('0x8'));var fs=require('fs');var fs_extra=require(_0xc184('0x9'));var _=require(_0xc184('0xa'));var squel=require('squel');var crypto=require(_0xc184('0xb'));var jsforce=require(_0xc184('0xc'));var deskjs=require(_0xc184('0xd'));var toCsv=require(_0xc184('0xe'));var querystring=require('querystring');var Papa=require(_0xc184('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc184('0x10'));var as=require(_0xc184('0x11'));var hardwareService=require(_0xc184('0x12'));var logger=require(_0xc184('0x13'))(_0xc184('0x14'));var utils=require(_0xc184('0x15'));var config=require(_0xc184('0x16'));var licenseUtil=require(_0xc184('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc184('0x18')](config[_0xc184('0x19')],{'host':_0xc184('0x1a'),'port':0x18eb});var socket=require(_0xc184('0x1b'))(new Redis(config[_0xc184('0x19')]));require(_0xc184('0x1c'))[_0xc184('0x1d')](socket);function respondWithStatusCode(_0x38bbbe,_0x52b8ca){_0x52b8ca=_0x52b8ca||0xcc;return function(_0x2a926f){if(_0x2a926f){return _0x38bbbe[_0xc184('0x1e')](_0x52b8ca);}return _0x38bbbe['status'](_0x52b8ca)[_0xc184('0x1f')]();};}function respondWithResult(_0x1b95cd,_0x22a9af){_0x22a9af=_0x22a9af||0xc8;return function(_0x461144){if(_0x461144){return _0x1b95cd['status'](_0x22a9af)[_0xc184('0x20')](_0x461144);}};}function respondWithFilteredResult(_0x4add75,_0x34f9f9){return function(_0x48e252){if(_0x48e252){var _0x5821b2=typeof _0x34f9f9[_0xc184('0x21')]===_0xc184('0x22')&&typeof _0x34f9f9[_0xc184('0x23')]===_0xc184('0x22');var _0x1f8620=_0x48e252[_0xc184('0x24')];var _0x591f7e=_0x5821b2?0x0:_0x34f9f9[_0xc184('0x21')];var _0x21cb0d=_0x5821b2?_0x48e252['count']:_0x34f9f9['offset']+_0x34f9f9[_0xc184('0x23')];var _0x4afb66;if(_0x21cb0d>=_0x1f8620){_0x21cb0d=_0x1f8620;_0x4afb66=0xc8;}else{_0x4afb66=0xce;}_0x4add75[_0xc184('0x25')](_0x4afb66);return _0x4add75[_0xc184('0x26')](_0xc184('0x27'),_0x591f7e+'-'+_0x21cb0d+'/'+_0x1f8620)[_0xc184('0x20')](_0x48e252);}return null;};}function patchUpdates(_0x200277){return function(_0x1bb6af){try{jsonpatch[_0xc184('0x28')](_0x1bb6af,_0x200277,!![]);}catch(_0x21c643){return BPromise[_0xc184('0x29')](_0x21c643);}return _0x1bb6af[_0xc184('0x2a')]();};}function saveUpdates(_0x55b55d,_0x288de4){return function(_0x39f0f7){if(_0x39f0f7){return _0x39f0f7[_0xc184('0x2b')](_0x55b55d)['then'](function(_0x1704ff){return _0x1704ff;});}return null;};}function removeEntity(_0x545de6,_0x3271ca){return function(_0xe7931){if(_0xe7931){return _0xe7931['destroy']()['then'](function(){var _0x4dde0b=_0xe7931['get']({'plain':!![]});var _0xcf69da=_0xc184('0x2c');return db[_0xc184('0x2d')]['destroy']({'where':{'type':_0xcf69da,'resourceId':_0x4dde0b['id']}})['then'](function(){return _0xe7931;});})['then'](function(){_0x545de6[_0xc184('0x25')](0xcc)[_0xc184('0x1f')]();});}};}function handleEntityNotFound(_0x923d5e,_0x246718){return function(_0x3c6bd4){if(!_0x3c6bd4){_0x923d5e[_0xc184('0x1e')](0x194);}return _0x3c6bd4;};}function handleError(_0x2848f3,_0x498bd3){_0x498bd3=_0x498bd3||0x1f4;return function(_0x3e9c0f){logger[_0xc184('0x2e')](_0x3e9c0f[_0xc184('0x2f')]);if(_0x3e9c0f[_0xc184('0x30')]){delete _0x3e9c0f[_0xc184('0x30')];}_0x2848f3[_0xc184('0x25')](_0x498bd3)[_0xc184('0x31')](_0x3e9c0f);};}exports[_0xc184('0x32')]=function(_0xc1c90b,_0x4953b2){var _0x572da2={},_0x2f205a={},_0x179989={'count':0x0,'rows':[]};var _0x550739=_[_0xc184('0x33')](db[_0xc184('0x34')]['rawAttributes'],function(_0x1c0c6d){return{'name':_0x1c0c6d[_0xc184('0x35')],'type':_0x1c0c6d[_0xc184('0x36')]['key']};});_0x2f205a[_0xc184('0x37')]=_['map'](_0x550739,'name');_0x2f205a[_0xc184('0x38')]=_['keys'](_0xc1c90b[_0xc184('0x38')]);_0x2f205a[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x2f205a[_0xc184('0x37')],_0x2f205a[_0xc184('0x38')]);_0x572da2['attributes']=_['intersection'](_0x2f205a[_0xc184('0x37')],qs[_0xc184('0x3b')](_0xc1c90b[_0xc184('0x38')][_0xc184('0x3b')]));_0x572da2['attributes']=_0x572da2['attributes']['length']?_0x572da2['attributes']:_0x2f205a[_0xc184('0x37')];if(!_0xc1c90b[_0xc184('0x38')][_0xc184('0x3c')]('nolimit')){_0x572da2['limit']=qs[_0xc184('0x23')](_0xc1c90b[_0xc184('0x38')]['limit']);_0x572da2[_0xc184('0x21')]=qs[_0xc184('0x21')](_0xc1c90b['query'][_0xc184('0x21')]);}_0x572da2[_0xc184('0x3d')]=qs[_0xc184('0x3e')](_0xc1c90b['query'][_0xc184('0x3e')]);_0x572da2[_0xc184('0x3f')]=qs[_0xc184('0x39')](_[_0xc184('0x40')](_0xc1c90b[_0xc184('0x38')],_0x2f205a['filters']),_0x550739);if(_0xc1c90b[_0xc184('0x38')][_0xc184('0x41')]){_0x572da2['where']=_[_0xc184('0x42')](_0x572da2[_0xc184('0x3f')],{'$or':_[_0xc184('0x33')](_0x550739,function(_0x3aea9c){if(_0x3aea9c[_0xc184('0x36')]!==_0xc184('0x43')){var _0xf3c34d={};_0xf3c34d[_0x3aea9c[_0xc184('0x30')]]={'$like':'%'+_0xc1c90b['query'][_0xc184('0x41')]+'%'};return _0xf3c34d;}})});}_0x572da2=_['merge']({},_0x572da2,_0xc1c90b['options']);var _0x2194c3={'where':_0x572da2[_0xc184('0x3f')]};return db[_0xc184('0x34')][_0xc184('0x24')](_0x2194c3)[_0xc184('0x44')](function(_0x4d5ce0){_0x179989[_0xc184('0x24')]=_0x4d5ce0;if(_0xc1c90b[_0xc184('0x38')]['includeAll']){_0x572da2[_0xc184('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0xc184('0x46')](_0x572da2);})[_0xc184('0x44')](function(_0x24059e){_0x179989['rows']=_0x24059e;return _0x179989;})[_0xc184('0x44')](respondWithFilteredResult(_0x4953b2,_0x572da2))[_0xc184('0x47')](handleError(_0x4953b2,null));};exports[_0xc184('0x48')]=function(_0x56c2c3,_0x4a4563){var _0x4de24d={'raw':!![],'where':{'id':_0x56c2c3['params']['id']}},_0x167b4c={};_0x167b4c[_0xc184('0x37')]=_[_0xc184('0x49')](db[_0xc184('0x34')]['rawAttributes']);_0x167b4c[_0xc184('0x38')]=_[_0xc184('0x49')](_0x56c2c3[_0xc184('0x38')]);_0x167b4c[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x167b4c[_0xc184('0x37')],_0x167b4c[_0xc184('0x38')]);_0x4de24d[_0xc184('0x4a')]=_[_0xc184('0x3a')](_0x167b4c[_0xc184('0x37')],qs[_0xc184('0x3b')](_0x56c2c3['query'][_0xc184('0x3b')]));_0x4de24d['attributes']=_0x4de24d[_0xc184('0x4a')][_0xc184('0x4b')]?_0x4de24d[_0xc184('0x4a')]:_0x167b4c[_0xc184('0x37')];if(_0x56c2c3[_0xc184('0x38')][_0xc184('0x4c')]){_0x4de24d['include']=[{'all':!![]}];}_0x4de24d=_[_0xc184('0x42')]({},_0x4de24d,_0x56c2c3[_0xc184('0x4d')]);return db[_0xc184('0x34')]['find'](_0x4de24d)[_0xc184('0x44')](handleEntityNotFound(_0x4a4563,null))[_0xc184('0x44')](respondWithResult(_0x4a4563,null))[_0xc184('0x47')](handleError(_0x4a4563,null));};exports[_0xc184('0x4e')]=function(_0x1031e6,_0x487435){return db[_0xc184('0x34')][_0xc184('0x4e')](_0x1031e6[_0xc184('0x4f')],{})[_0xc184('0x44')](function(_0xc8d73e){var _0xb9ccae=_0x1031e6[_0xc184('0x50')][_0xc184('0x51')]({'plain':!![]});if(!_0xb9ccae)throw new Error(_0xc184('0x52'));if(_0xb9ccae['role']===_0xc184('0x50')){var _0x2212ba=_0xc8d73e[_0xc184('0x51')]({'plain':!![]});var _0x265ed0='SmsQueues';return db[_0xc184('0x53')]['find']({'where':{'name':_0x265ed0,'userProfileId':_0xb9ccae['userProfileId']},'raw':!![]})[_0xc184('0x44')](function(_0x4aecc9){if(_0x4aecc9&&_0x4aecc9[_0xc184('0x54')]===0x0){return db[_0xc184('0x2d')][_0xc184('0x4e')]({'name':_0x2212ba[_0xc184('0x30')],'resourceId':_0x2212ba['id'],'type':_0x4aecc9[_0xc184('0x30')],'sectionId':_0x4aecc9['id']},{})[_0xc184('0x44')](function(){return _0xc8d73e;});}else{return _0xc8d73e;}})[_0xc184('0x47')](function(_0x356773){logger[_0xc184('0x2e')](_0xc184('0x55'),_0x356773);throw _0x356773;});}return _0xc8d73e;})[_0xc184('0x44')](respondWithResult(_0x487435,0xc9))[_0xc184('0x47')](handleError(_0x487435,null));};exports['update']=function(_0x234953,_0x175755){if(_0x234953[_0xc184('0x4f')]['id']){delete _0x234953[_0xc184('0x4f')]['id'];}return db[_0xc184('0x34')]['find']({'where':{'id':_0x234953[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x175755,null))[_0xc184('0x44')](saveUpdates(_0x234953[_0xc184('0x4f')],null))[_0xc184('0x44')](respondWithResult(_0x175755,null))[_0xc184('0x47')](handleError(_0x175755,null));};exports[_0xc184('0x57')]=function(_0x2ad5bc,_0x14557a){return db['SmsQueue'][_0xc184('0x58')]({'where':{'id':_0x2ad5bc[_0xc184('0x56')]['id']}})['then'](handleEntityNotFound(_0x14557a,null))[_0xc184('0x44')](removeEntity(_0x14557a,null))['catch'](handleError(_0x14557a,null));};exports[_0xc184('0x59')]=function(_0x5f124d,_0x3bab49){return db[_0xc184('0x34')][_0xc184('0x59')]()['then'](respondWithResult(_0x3bab49,null))[_0xc184('0x47')](handleError(_0x3bab49,null));};exports['getMembers']=function(_0xcd08a7,_0x308284,_0x231993){var _0x52b58c={'raw':!![],'where':{}},_0x5e9ebc={},_0x1d9b80;return db[_0xc184('0x34')][_0xc184('0x5a')]({'where':{'id':_0xcd08a7[_0xc184('0x56')]['id']}})['then'](handleEntityNotFound(_0x308284,null))[_0xc184('0x44')](function(_0x59ba0d){if(_0x59ba0d){_0x1d9b80=_0x59ba0d[_0xc184('0x51')]({'plain':!![]});_0x5e9ebc[_0xc184('0x37')]=_[_0xc184('0x49')](db[_0xc184('0x5b')]['rawAttributes']);_0x5e9ebc[_0xc184('0x38')]=_[_0xc184('0x49')](_0xcd08a7[_0xc184('0x38')]);_0x5e9ebc[_0xc184('0x39')]=_['intersection'](_0x5e9ebc[_0xc184('0x37')],_0x5e9ebc[_0xc184('0x38')]);_0x52b58c['attributes']=_[_0xc184('0x3a')](_0x5e9ebc[_0xc184('0x37')],qs[_0xc184('0x3b')](_0xcd08a7[_0xc184('0x38')][_0xc184('0x3b')]));_0x52b58c[_0xc184('0x4a')]=_0x52b58c[_0xc184('0x4a')][_0xc184('0x4b')]?_0x52b58c[_0xc184('0x4a')]:_0x5e9ebc[_0xc184('0x37')];if(!_0xcd08a7[_0xc184('0x38')]['hasOwnProperty'](_0xc184('0x5c'))){_0x52b58c[_0xc184('0x23')]=qs[_0xc184('0x23')](_0xcd08a7[_0xc184('0x38')]['limit']);_0x52b58c['offset']=qs[_0xc184('0x21')](_0xcd08a7['query']['offset']);}_0x52b58c[_0xc184('0x3d')]=qs[_0xc184('0x3e')](_0xcd08a7['query']['sort']);_0x52b58c['where']=qs['filters'](_[_0xc184('0x40')](_0xcd08a7[_0xc184('0x38')],_0x5e9ebc[_0xc184('0x39')]));_0x52b58c[_0xc184('0x3f')]['SmsQueueId']=_0x59ba0d['id'];if(_0xcd08a7[_0xc184('0x38')][_0xc184('0x41')]){_0x52b58c['where']=_['merge'](_0x52b58c['where'],{'$or':_['map'](_0x52b58c[_0xc184('0x4a')],function(_0x1bf593){var _0xe84e12={};_0xe84e12[_0x1bf593]={'$like':'%'+_0xcd08a7[_0xc184('0x38')]['filter']+'%'};return _0xe84e12;})});}_0x52b58c=_[_0xc184('0x42')]({},_0x52b58c,_0xcd08a7[_0xc184('0x4d')]);return db[_0xc184('0x5b')][_0xc184('0x46')](_0x52b58c);}})[_0xc184('0x44')](function(_0x30747e){if(_0x30747e){return db[_0xc184('0x5d')][_0xc184('0x5e')]({'where':{'id':_[_0xc184('0x33')](_0x30747e,_0xc184('0x5f')),'role':_0xc184('0x60')},'attributes':['id',_0xc184('0x30'),_0xc184('0x61'),'updatedAt','createdAt']});}})['then'](function(_0x1c9da4){if(_0x1c9da4){return{'count':_0x1c9da4['count'],'rows':_[_0xc184('0x33')](_0x1c9da4[_0xc184('0x62')],function(_0x165819){return{'membername':_0x165819[_0xc184('0x30')],'UserId':_0x165819['id'],'queue_name':_0x1d9b80[_0xc184('0x30')],'SmsQueueId':_0x1d9b80['id'],'interface':util[_0xc184('0x63')](_0xc184('0x64'),'SIP',_0x165819[_0xc184('0x30')]),'penalty':0x0,'paused':_0x165819[_0xc184('0x61')],'createdAt':_0x165819[_0xc184('0x65')],'updatedAt':_0x165819[_0xc184('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x308284,_0x52b58c))[_0xc184('0x47')](handleError(_0x308284,null));};exports['getTeams']=function(_0x212390,_0x56b55d,_0x368ea4){var _0x2e33ca={};var _0x5baa0f={};var _0x3e68ae;var _0x5aff31;return db[_0xc184('0x34')][_0xc184('0x5a')]({'where':{'id':_0x212390[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x56b55d,null))['then'](function(_0x3847d4){if(_0x3847d4){_0x3e68ae=_0x3847d4;_0x5baa0f['model']=_['keys'](db['Team']['rawAttributes']);_0x5baa0f[_0xc184('0x38')]=_['keys'](_0x212390[_0xc184('0x38')]);_0x5baa0f[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x5baa0f[_0xc184('0x37')],_0x5baa0f[_0xc184('0x38')]);_0x2e33ca[_0xc184('0x4a')]=_[_0xc184('0x3a')](_0x5baa0f['model'],qs[_0xc184('0x3b')](_0x212390[_0xc184('0x38')][_0xc184('0x3b')]));_0x2e33ca[_0xc184('0x4a')]=_0x2e33ca[_0xc184('0x4a')][_0xc184('0x4b')]?_0x2e33ca[_0xc184('0x4a')]:_0x5baa0f['model'];_0x2e33ca[_0xc184('0x3d')]=qs['sort'](_0x212390[_0xc184('0x38')][_0xc184('0x3e')]);_0x2e33ca['where']=qs['filters'](_[_0xc184('0x40')](_0x212390[_0xc184('0x38')],_0x5baa0f[_0xc184('0x39')]));if(_0x212390['query'][_0xc184('0x41')]){_0x2e33ca[_0xc184('0x3f')]=_[_0xc184('0x42')](_0x2e33ca['where'],{'$or':_[_0xc184('0x33')](_0x2e33ca[_0xc184('0x4a')],function(_0x261d58){var _0x3bb911={};_0x3bb911[_0x261d58]={'$like':'%'+_0x212390[_0xc184('0x38')][_0xc184('0x41')]+'%'};return _0x3bb911;})});}_0x2e33ca=_['merge']({},_0x2e33ca,_0x212390['options']);return _0x3e68ae[_0xc184('0x67')](_0x2e33ca);}})['then'](function(_0x264aed){if(_0x264aed){_0x5aff31=_0x264aed[_0xc184('0x4b')];if(!_0x212390['query'][_0xc184('0x3c')](_0xc184('0x5c'))){_0x2e33ca['limit']=qs['limit'](_0x212390[_0xc184('0x38')][_0xc184('0x23')]);_0x2e33ca[_0xc184('0x21')]=qs[_0xc184('0x21')](_0x212390[_0xc184('0x38')][_0xc184('0x21')]);}return _0x3e68ae[_0xc184('0x67')](_0x2e33ca);}})[_0xc184('0x44')](function(_0x3356dc){if(_0x3356dc){return _0x3356dc?{'count':_0x5aff31,'rows':_0x3356dc}:null;}})['then'](respondWithResult(_0x56b55d,null))[_0xc184('0x47')](handleError(_0x56b55d,null));};exports['addTeams']=function(_0xe1c66d,_0x1bf265,_0x5a3372){var _0x367b55=_0xe1c66d[_0xc184('0x4f')]['ids'];return db['Team']['findAll']({'where':{'id':_0x367b55},'attributes':['id'],'include':[{'model':db[_0xc184('0x5d')],'as':_0xc184('0x68'),'attributes':['id','name','online',_0xc184('0x69'),'interface'],'raw':!![]}]})['then'](function(_0x4c39d0){if(_0x4c39d0){var _0x3e21c4=_['flatMap'](_0x4c39d0,function(_0x5725d8){var _0x20d7dc=_0x5725d8[_0xc184('0x51')]({'plain':!![]});return _0x20d7dc[_0xc184('0x68')];});return db[_0xc184('0x34')][_0xc184('0x58')]({'where':{'id':_0xe1c66d[_0xc184('0x56')]['id']}})[_0xc184('0x44')](function(_0x2d919e){return db[_0xc184('0x6a')][_0xc184('0x6b')](function(_0x235234){return _0x2d919e['addTeams'](_0x367b55,{'transaction':_0x235234})[_0xc184('0x44')](function(){return BPromise[_0xc184('0x6c')](_0x3e21c4,function(_0xe261e8){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0xe261e8['id'],'SmsQueueId':_0xe1c66d['params']['id']},'transaction':_0x235234});});})['then'](function(){_0x3e21c4[_0xc184('0x6d')](function(_0x3ca67c){socket[_0xc184('0x6e')](_0xc184('0x6f'),{'UserId':_0x3ca67c['id'],'SmsQueueId':_0x2d919e['id']});});});});});}})['then'](respondWithStatusCode(_0x1bf265,null))[_0xc184('0x47')](handleError(_0x1bf265,null));};exports['removeTeams']=function(_0x20e135,_0x2d690f,_0x357bd1){return db['Team'][_0xc184('0x46')]({'where':{'id':_0x20e135[_0xc184('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc184('0x68'),'attributes':['id'],'raw':!![]}]})[_0xc184('0x44')](handleEntityNotFound(_0x2d690f,null))[_0xc184('0x44')](function(_0x56455f){var _0x6e05ce=_[_0xc184('0x33')](_0x56455f,'id');var _0x46059e=[];var _0x1b05e0=[];var _0x1bb8c6=squel[_0xc184('0x70')]();_0x1bb8c6['field'](_0xc184('0x71'))[_0xc184('0x72')](_0xc184('0x73'),'tq')[_0xc184('0x74')](_0xc184('0x75'),'ut',_0xc184('0x76'))['where']('SmsQueueId\x20=\x20?',_0x20e135[_0xc184('0x56')]['id']);for(var _0x178cb3=0x0;_0x178cb3<_0x56455f[_0xc184('0x4b')];_0x178cb3+=0x1){let _0x3ce05b=_0x56455f[_0x178cb3];for(var _0x23da4c=0x0;_0x23da4c<_0x3ce05b[_0xc184('0x68')][_0xc184('0x4b')];_0x23da4c+=0x1){let _0x39c780=_0x3ce05b[_0xc184('0x68')][_0x23da4c];var _0xbe8129=_0x1bb8c6[_0xc184('0x77')]();_0xbe8129[_0xc184('0x3f')](_0xc184('0x78'),_0x39c780['id']);_0x1b05e0[_0xc184('0x79')](db[_0xc184('0x6a')][_0xc184('0x38')](_0xbe8129[_0xc184('0x7a')](),{'type':db['sequelize'][_0xc184('0x7b')][_0xc184('0x7c')]})[_0xc184('0x44')](function(_0x176a1f){if(_0x176a1f[_0xc184('0x4b')]===0x1){return _0x39c780['id'];}else{var _0x64e6e1=_[_0xc184('0x7d')](_[_0xc184('0x33')](_0x176a1f,'TeamId'),function(_0x4eb2ee){return _['includes'](_0x6e05ce,_0x4eb2ee);});if(_0x64e6e1){return _0x39c780['id'];}}}));}}return BPromise[_0xc184('0x7e')](_0x1b05e0)[_0xc184('0x44')](function(_0x28236d){_0x46059e=_(_0x46059e)[_0xc184('0x7f')](_0x28236d)[_0xc184('0x80')]()['value']();return db[_0xc184('0x34')][_0xc184('0x58')]({'where':{'id':_0x20e135[_0xc184('0x56')]['id']}})['then'](function(_0x264ed8){return db[_0xc184('0x6a')][_0xc184('0x6b')](function(_0x277829){return _0x264ed8[_0xc184('0x81')](_0x20e135['query'][_0xc184('0x82')],{'transaction':_0x277829})[_0xc184('0x44')](function(){if(!_[_0xc184('0x83')](_0x46059e)){return _0x264ed8[_0xc184('0x84')](_0x46059e,{'transaction':_0x277829});}})[_0xc184('0x44')](function(){_0x46059e[_0xc184('0x6d')](function(_0x3c6565){socket['emit'](_0xc184('0x85'),{'UserId':_0x3c6565,'SmsQueueId':_0x264ed8['id']});});});});});});})[_0xc184('0x44')](respondWithStatusCode(_0x2d690f,null))['catch'](handleError(_0x2d690f,null));};exports['addAgents']=function(_0x4ccea8,_0x41dc48,_0x267020){return db[_0xc184('0x34')]['find']({'where':{'id':_0x4ccea8[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x41dc48,null))[_0xc184('0x44')](function(_0x2350c7){if(_0x2350c7){return _0x2350c7[_0xc184('0x86')](_0x4ccea8[_0xc184('0x4f')][_0xc184('0x82')],_[_0xc184('0x87')](_0x4ccea8[_0xc184('0x4f')],[_0xc184('0x82'),'id'])||{})[_0xc184('0x88')](function(_0x3920f0){for(var _0x50b1a6=0x0;_0x50b1a6<_0x4ccea8[_0xc184('0x4f')][_0xc184('0x82')]['length'];_0x50b1a6+=0x1){socket[_0xc184('0x6e')](_0xc184('0x6f'),{'UserId':Number(_0x4ccea8[_0xc184('0x4f')][_0xc184('0x82')][_0x50b1a6]),'SmsQueueId':Number(_0x4ccea8['params']['id'])});}return _0x3920f0;});}})['then'](respondWithResult(_0x41dc48,null))[_0xc184('0x47')](handleError(_0x41dc48,null));};exports[_0xc184('0x84')]=function(_0x15c7f8,_0xfcd682,_0x378ccb){return db['SmsQueue'][_0xc184('0x58')]({'where':{'id':_0x15c7f8[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0xfcd682,null))['then'](function(_0x30134e){if(_0x30134e){return _0x30134e['removeAgents'](_0x15c7f8[_0xc184('0x38')][_0xc184('0x82')])[_0xc184('0x44')](function(){if(_[_0xc184('0x89')](_0x15c7f8[_0xc184('0x38')][_0xc184('0x82')])){for(var _0x59b75f=0x0;_0x59b75f<_0x15c7f8[_0xc184('0x38')][_0xc184('0x82')][_0xc184('0x4b')];_0x59b75f+=0x1){socket['emit'](_0xc184('0x85'),{'UserId':Number(_0x15c7f8[_0xc184('0x38')]['ids'][_0x59b75f]),'SmsQueueId':Number(_0x15c7f8[_0xc184('0x56')]['id'])});}}else{socket[_0xc184('0x6e')](_0xc184('0x85'),{'UserId':Number(_0x15c7f8[_0xc184('0x38')]['ids']),'SmsQueueId':Number(_0x15c7f8[_0xc184('0x56')]['id'])});}});}})[_0xc184('0x44')](respondWithStatusCode(_0xfcd682,null))['catch'](handleError(_0xfcd682,null));};exports[_0xc184('0x8a')]=function(_0x23d676,_0x346760,_0x5c18c5){var _0x304f25={};var _0x5aa3ba={};var _0x15428a;var _0x5cb38f;return db[_0xc184('0x34')][_0xc184('0x5a')]({'where':{'id':_0x23d676[_0xc184('0x56')]['id']}})[_0xc184('0x44')](handleEntityNotFound(_0x346760,null))[_0xc184('0x44')](function(_0x3bd6b2){if(_0x3bd6b2){_0x15428a=_0x3bd6b2;_0x5aa3ba['model']=_['keys'](db[_0xc184('0x5d')][_0xc184('0x8b')]);_0x5aa3ba[_0xc184('0x38')]=_[_0xc184('0x49')](_0x23d676[_0xc184('0x38')]);_0x5aa3ba[_0xc184('0x39')]=_[_0xc184('0x3a')](_0x5aa3ba[_0xc184('0x37')],_0x5aa3ba['query']);_0x304f25[_0xc184('0x4a')]=_[_0xc184('0x3a')](_0x5aa3ba[_0xc184('0x37')],qs[_0xc184('0x3b')](_0x23d676[_0xc184('0x38')][_0xc184('0x3b')]));_0x304f25[_0xc184('0x4a')]=_0x304f25[_0xc184('0x4a')]['length']?_0x304f25[_0xc184('0x4a')]:_0x5aa3ba[_0xc184('0x37')];_0x304f25[_0xc184('0x3d')]=qs[_0xc184('0x3e')](_0x23d676[_0xc184('0x38')][_0xc184('0x3e')]);_0x304f25[_0xc184('0x3f')]=qs[_0xc184('0x39')](_[_0xc184('0x40')](_0x23d676[_0xc184('0x38')],_0x5aa3ba[_0xc184('0x39')]));if(_0x23d676[_0xc184('0x38')]['filter']){_0x304f25[_0xc184('0x3f')]=_[_0xc184('0x42')](_0x304f25[_0xc184('0x3f')],{'$or':_[_0xc184('0x33')](_0x304f25[_0xc184('0x4a')],function(_0x5c6df6){var _0x491910={};_0x491910[_0x5c6df6]={'$like':'%'+_0x23d676[_0xc184('0x38')]['filter']+'%'};return _0x491910;})});}_0x304f25=_['merge']({},_0x304f25,_0x23d676[_0xc184('0x4d')]);return _0x15428a[_0xc184('0x8a')](_0x304f25);}})[_0xc184('0x44')](function(_0x15369d){if(_0x15369d){_0x5cb38f=_0x15369d[_0xc184('0x4b')];if(!_0x23d676['query']['hasOwnProperty'](_0xc184('0x5c'))){_0x304f25[_0xc184('0x23')]=qs[_0xc184('0x23')](_0x23d676['query'][_0xc184('0x23')]);_0x304f25[_0xc184('0x21')]=qs[_0xc184('0x21')](_0x23d676[_0xc184('0x38')][_0xc184('0x21')]);}return _0x15428a[_0xc184('0x8a')](_0x304f25);}})['then'](function(_0x583c9){if(_0x583c9){return _0x583c9?{'count':_0x5cb38f,'rows':_0x583c9}:null;}})[_0xc184('0x44')](respondWithResult(_0x346760,null))['catch'](handleError(_0x346760,null));}; \ No newline at end of file +var _0xf491=['ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','emit','userSmsQueue:save','removeTeams','findAll','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','clone','push','TeamId','includes','compact','value','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','User','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','Team','getTeams'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xf491,0x137));var _0x1f49=function(_0x47361c,_0x5ea3a1){_0x47361c=_0x47361c-0x0;var _0x18cdf4=_0xf491[_0x47361c];return _0x18cdf4;};'use strict';var emlformat=require(_0x1f49('0x0'));var rimraf=require(_0x1f49('0x1'));var zipdir=require(_0x1f49('0x2'));var jsonpatch=require(_0x1f49('0x3'));var rp=require(_0x1f49('0x4'));var moment=require('moment');var BPromise=require(_0x1f49('0x5'));var Mustache=require('mustache');var util=require(_0x1f49('0x6'));var path=require(_0x1f49('0x7'));var sox=require(_0x1f49('0x8'));var csv=require('to-csv');var ejs=require(_0x1f49('0x9'));var fs=require('fs');var fs_extra=require(_0x1f49('0xa'));var _=require(_0x1f49('0xb'));var squel=require('squel');var crypto=require(_0x1f49('0xc'));var jsforce=require(_0x1f49('0xd'));var deskjs=require(_0x1f49('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1f49('0xf'));var Papa=require(_0x1f49('0x10'));var Redis=require(_0x1f49('0x11'));var authService=require(_0x1f49('0x12'));var qs=require(_0x1f49('0x13'));var as=require(_0x1f49('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1f49('0x15'));var utils=require(_0x1f49('0x16'));var config=require(_0x1f49('0x17'));var licenseUtil=require(_0x1f49('0x18'));var db=require(_0x1f49('0x19'))['db'];config[_0x1f49('0x1a')]=_[_0x1f49('0x1b')](config['redis'],{'host':_0x1f49('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f49('0x1a')]));require(_0x1f49('0x1d'))['register'](socket);function respondWithStatusCode(_0x1eb9ec,_0x402289){_0x402289=_0x402289||0xcc;return function(_0x182d4a){if(_0x182d4a){return _0x1eb9ec[_0x1f49('0x1e')](_0x402289);}return _0x1eb9ec['status'](_0x402289)[_0x1f49('0x1f')]();};}function respondWithResult(_0x103e91,_0x2ec014){_0x2ec014=_0x2ec014||0xc8;return function(_0xb8a2ef){if(_0xb8a2ef){return _0x103e91[_0x1f49('0x20')](_0x2ec014)[_0x1f49('0x21')](_0xb8a2ef);}};}function respondWithFilteredResult(_0x250504,_0x16f7f4){return function(_0x37a750){if(_0x37a750){var _0x3c502a=typeof _0x16f7f4['offset']===_0x1f49('0x22')&&typeof _0x16f7f4[_0x1f49('0x23')]==='undefined';var _0x5d1944=_0x37a750[_0x1f49('0x24')];var _0x302a99=_0x3c502a?0x0:_0x16f7f4['offset'];var _0x1fe1ed=_0x3c502a?_0x37a750[_0x1f49('0x24')]:_0x16f7f4[_0x1f49('0x25')]+_0x16f7f4['limit'];var _0x4ea78e;if(_0x1fe1ed>=_0x5d1944){_0x1fe1ed=_0x5d1944;_0x4ea78e=0xc8;}else{_0x4ea78e=0xce;}_0x250504[_0x1f49('0x20')](_0x4ea78e);return _0x250504[_0x1f49('0x26')](_0x1f49('0x27'),_0x302a99+'-'+_0x1fe1ed+'/'+_0x5d1944)[_0x1f49('0x21')](_0x37a750);}return null;};}function patchUpdates(_0x200fee){return function(_0x49f828){try{jsonpatch[_0x1f49('0x28')](_0x49f828,_0x200fee,!![]);}catch(_0x4dd324){return BPromise[_0x1f49('0x29')](_0x4dd324);}return _0x49f828['save']();};}function saveUpdates(_0x2ddf72,_0x46640b){return function(_0x473171){if(_0x473171){return _0x473171[_0x1f49('0x2a')](_0x2ddf72)[_0x1f49('0x2b')](function(_0x45de98){return _0x45de98;});}return null;};}function removeEntity(_0x28b76c,_0x1687a4){return function(_0x8448be){if(_0x8448be){return _0x8448be[_0x1f49('0x2c')]()['then'](function(){var _0x215897=_0x8448be[_0x1f49('0x2d')]({'plain':!![]});var _0x223e18='SmsQueues';return db['UserProfileResource'][_0x1f49('0x2c')]({'where':{'type':_0x223e18,'resourceId':_0x215897['id']}})[_0x1f49('0x2b')](function(){return _0x8448be;});})[_0x1f49('0x2b')](function(){_0x28b76c[_0x1f49('0x20')](0xcc)[_0x1f49('0x1f')]();});}};}function handleEntityNotFound(_0xbfc1dc,_0x57d2ff){return function(_0x4f0c1e){if(!_0x4f0c1e){_0xbfc1dc[_0x1f49('0x1e')](0x194);}return _0x4f0c1e;};}function handleError(_0xeb01e9,_0x532216){_0x532216=_0x532216||0x1f4;return function(_0x4d8c92){logger[_0x1f49('0x2e')](_0x4d8c92[_0x1f49('0x2f')]);if(_0x4d8c92[_0x1f49('0x30')]){delete _0x4d8c92[_0x1f49('0x30')];}_0xeb01e9[_0x1f49('0x20')](_0x532216)['send'](_0x4d8c92);};}exports[_0x1f49('0x31')]=function(_0x545e9a,_0x1bdd8a){var _0x56b1d1={},_0x19f2e1={},_0x19bc67={'count':0x0,'rows':[]};var _0x4d0f11=_[_0x1f49('0x32')](db[_0x1f49('0x33')][_0x1f49('0x34')],function(_0xdf75c9){return{'name':_0xdf75c9[_0x1f49('0x35')],'type':_0xdf75c9[_0x1f49('0x36')][_0x1f49('0x37')]};});_0x19f2e1[_0x1f49('0x38')]=_[_0x1f49('0x32')](_0x4d0f11,_0x1f49('0x30'));_0x19f2e1[_0x1f49('0x39')]=_[_0x1f49('0x3a')](_0x545e9a['query']);_0x19f2e1[_0x1f49('0x3b')]=_[_0x1f49('0x3c')](_0x19f2e1['model'],_0x19f2e1['query']);_0x56b1d1[_0x1f49('0x3d')]=_[_0x1f49('0x3c')](_0x19f2e1[_0x1f49('0x38')],qs[_0x1f49('0x3e')](_0x545e9a[_0x1f49('0x39')][_0x1f49('0x3e')]));_0x56b1d1[_0x1f49('0x3d')]=_0x56b1d1[_0x1f49('0x3d')]['length']?_0x56b1d1['attributes']:_0x19f2e1['model'];if(!_0x545e9a[_0x1f49('0x39')][_0x1f49('0x3f')](_0x1f49('0x40'))){_0x56b1d1['limit']=qs[_0x1f49('0x23')](_0x545e9a['query']['limit']);_0x56b1d1[_0x1f49('0x25')]=qs[_0x1f49('0x25')](_0x545e9a[_0x1f49('0x39')][_0x1f49('0x25')]);}_0x56b1d1[_0x1f49('0x41')]=qs[_0x1f49('0x42')](_0x545e9a[_0x1f49('0x39')][_0x1f49('0x42')]);_0x56b1d1['where']=qs['filters'](_[_0x1f49('0x43')](_0x545e9a[_0x1f49('0x39')],_0x19f2e1[_0x1f49('0x3b')]),_0x4d0f11);if(_0x545e9a[_0x1f49('0x39')][_0x1f49('0x44')]){_0x56b1d1['where']=_[_0x1f49('0x45')](_0x56b1d1[_0x1f49('0x46')],{'$or':_[_0x1f49('0x32')](_0x4d0f11,function(_0x57e3f8){if(_0x57e3f8[_0x1f49('0x36')]!=='VIRTUAL'){var _0x35c339={};_0x35c339[_0x57e3f8[_0x1f49('0x30')]]={'$like':'%'+_0x545e9a[_0x1f49('0x39')][_0x1f49('0x44')]+'%'};return _0x35c339;}})});}_0x56b1d1=_['merge']({},_0x56b1d1,_0x545e9a['options']);var _0x3361d1={'where':_0x56b1d1['where']};return db[_0x1f49('0x33')][_0x1f49('0x24')](_0x3361d1)[_0x1f49('0x2b')](function(_0x58997c){_0x19bc67[_0x1f49('0x24')]=_0x58997c;if(_0x545e9a[_0x1f49('0x39')][_0x1f49('0x47')]){_0x56b1d1['include']=[{'all':!![]}];}return db[_0x1f49('0x33')]['findAll'](_0x56b1d1);})[_0x1f49('0x2b')](function(_0x3418b9){_0x19bc67[_0x1f49('0x48')]=_0x3418b9;return _0x19bc67;})[_0x1f49('0x2b')](respondWithFilteredResult(_0x1bdd8a,_0x56b1d1))[_0x1f49('0x49')](handleError(_0x1bdd8a,null));};exports[_0x1f49('0x4a')]=function(_0x1ad368,_0x4775f9){var _0x1d6458={'raw':!![],'where':{'id':_0x1ad368[_0x1f49('0x4b')]['id']}},_0x95bedd={};_0x95bedd[_0x1f49('0x38')]=_[_0x1f49('0x3a')](db[_0x1f49('0x33')][_0x1f49('0x34')]);_0x95bedd[_0x1f49('0x39')]=_['keys'](_0x1ad368[_0x1f49('0x39')]);_0x95bedd['filters']=_['intersection'](_0x95bedd[_0x1f49('0x38')],_0x95bedd['query']);_0x1d6458[_0x1f49('0x3d')]=_[_0x1f49('0x3c')](_0x95bedd['model'],qs[_0x1f49('0x3e')](_0x1ad368[_0x1f49('0x39')][_0x1f49('0x3e')]));_0x1d6458[_0x1f49('0x3d')]=_0x1d6458['attributes'][_0x1f49('0x4c')]?_0x1d6458['attributes']:_0x95bedd[_0x1f49('0x38')];if(_0x1ad368[_0x1f49('0x39')][_0x1f49('0x47')]){_0x1d6458['include']=[{'all':!![]}];}_0x1d6458=_[_0x1f49('0x45')]({},_0x1d6458,_0x1ad368[_0x1f49('0x4d')]);return db[_0x1f49('0x33')][_0x1f49('0x4e')](_0x1d6458)[_0x1f49('0x2b')](handleEntityNotFound(_0x4775f9,null))[_0x1f49('0x2b')](respondWithResult(_0x4775f9,null))[_0x1f49('0x49')](handleError(_0x4775f9,null));};exports[_0x1f49('0x4f')]=function(_0x5add97,_0x5bce4d){return db[_0x1f49('0x33')][_0x1f49('0x4f')](_0x5add97['body'],{})[_0x1f49('0x2b')](function(_0x49a229){var _0x287c9d=_0x5add97[_0x1f49('0x50')][_0x1f49('0x2d')]({'plain':!![]});if(!_0x287c9d)throw new Error(_0x1f49('0x51'));if(_0x287c9d['role']===_0x1f49('0x50')){var _0x3b69f9=_0x49a229[_0x1f49('0x2d')]({'plain':!![]});var _0x1b114b=_0x1f49('0x52');return db[_0x1f49('0x53')][_0x1f49('0x4e')]({'where':{'name':_0x1b114b,'userProfileId':_0x287c9d[_0x1f49('0x54')]},'raw':!![]})[_0x1f49('0x2b')](function(_0x1f9cab){if(_0x1f9cab&&_0x1f9cab[_0x1f49('0x55')]===0x0){return db[_0x1f49('0x56')][_0x1f49('0x4f')]({'name':_0x3b69f9[_0x1f49('0x30')],'resourceId':_0x3b69f9['id'],'type':_0x1f9cab['name'],'sectionId':_0x1f9cab['id']},{})['then'](function(){return _0x49a229;});}else{return _0x49a229;}})[_0x1f49('0x49')](function(_0x2a2bd3){logger[_0x1f49('0x2e')](_0x1f49('0x57'),_0x2a2bd3);throw _0x2a2bd3;});}return _0x49a229;})[_0x1f49('0x2b')](respondWithResult(_0x5bce4d,0xc9))[_0x1f49('0x49')](handleError(_0x5bce4d,null));};exports[_0x1f49('0x2a')]=function(_0x5c47f2,_0x436112){if(_0x5c47f2[_0x1f49('0x58')]['id']){delete _0x5c47f2[_0x1f49('0x58')]['id'];}return db[_0x1f49('0x33')][_0x1f49('0x4e')]({'where':{'id':_0x5c47f2['params']['id']}})[_0x1f49('0x2b')](handleEntityNotFound(_0x436112,null))[_0x1f49('0x2b')](saveUpdates(_0x5c47f2[_0x1f49('0x58')],null))[_0x1f49('0x2b')](respondWithResult(_0x436112,null))[_0x1f49('0x49')](handleError(_0x436112,null));};exports[_0x1f49('0x2c')]=function(_0x59c0db,_0x3865cc){return db[_0x1f49('0x33')]['find']({'where':{'id':_0x59c0db[_0x1f49('0x4b')]['id']}})[_0x1f49('0x2b')](handleEntityNotFound(_0x3865cc,null))[_0x1f49('0x2b')](removeEntity(_0x3865cc,null))['catch'](handleError(_0x3865cc,null));};exports[_0x1f49('0x59')]=function(_0x37ba8c,_0x3ebbff){return db['SmsQueue'][_0x1f49('0x59')]()[_0x1f49('0x2b')](respondWithResult(_0x3ebbff,null))[_0x1f49('0x49')](handleError(_0x3ebbff,null));};exports[_0x1f49('0x5a')]=function(_0x5423bd,_0x566c38,_0x423dda){var _0x4810bb={'raw':!![],'where':{}},_0x7fb2f3={},_0x3d1206;return db[_0x1f49('0x33')][_0x1f49('0x5b')]({'where':{'id':_0x5423bd[_0x1f49('0x4b')]['id']}})[_0x1f49('0x2b')](handleEntityNotFound(_0x566c38,null))['then'](function(_0x538901){if(_0x538901){_0x3d1206=_0x538901[_0x1f49('0x2d')]({'plain':!![]});_0x7fb2f3['model']=_[_0x1f49('0x3a')](db[_0x1f49('0x5c')][_0x1f49('0x34')]);_0x7fb2f3['query']=_['keys'](_0x5423bd[_0x1f49('0x39')]);_0x7fb2f3['filters']=_[_0x1f49('0x3c')](_0x7fb2f3[_0x1f49('0x38')],_0x7fb2f3[_0x1f49('0x39')]);_0x4810bb['attributes']=_[_0x1f49('0x3c')](_0x7fb2f3['model'],qs[_0x1f49('0x3e')](_0x5423bd[_0x1f49('0x39')][_0x1f49('0x3e')]));_0x4810bb['attributes']=_0x4810bb[_0x1f49('0x3d')]['length']?_0x4810bb[_0x1f49('0x3d')]:_0x7fb2f3['model'];if(!_0x5423bd[_0x1f49('0x39')]['hasOwnProperty']('nolimit')){_0x4810bb[_0x1f49('0x23')]=qs[_0x1f49('0x23')](_0x5423bd[_0x1f49('0x39')][_0x1f49('0x23')]);_0x4810bb[_0x1f49('0x25')]=qs[_0x1f49('0x25')](_0x5423bd[_0x1f49('0x39')][_0x1f49('0x25')]);}_0x4810bb['order']=qs[_0x1f49('0x42')](_0x5423bd[_0x1f49('0x39')]['sort']);_0x4810bb[_0x1f49('0x46')]=qs[_0x1f49('0x3b')](_[_0x1f49('0x43')](_0x5423bd[_0x1f49('0x39')],_0x7fb2f3['filters']));_0x4810bb[_0x1f49('0x46')]['SmsQueueId']=_0x538901['id'];if(_0x5423bd[_0x1f49('0x39')]['filter']){_0x4810bb[_0x1f49('0x46')]=_[_0x1f49('0x45')](_0x4810bb[_0x1f49('0x46')],{'$or':_[_0x1f49('0x32')](_0x4810bb[_0x1f49('0x3d')],function(_0x35b3ed){var _0x424b51={};_0x424b51[_0x35b3ed]={'$like':'%'+_0x5423bd[_0x1f49('0x39')][_0x1f49('0x44')]+'%'};return _0x424b51;})});}_0x4810bb=_[_0x1f49('0x45')]({},_0x4810bb,_0x5423bd['options']);return db[_0x1f49('0x5c')]['findAll'](_0x4810bb);}})['then'](function(_0x71fbc1){if(_0x71fbc1){return db[_0x1f49('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x71fbc1,_0x1f49('0x5e')),'role':_0x1f49('0x5f')},'attributes':['id',_0x1f49('0x30'),_0x1f49('0x60'),_0x1f49('0x61'),_0x1f49('0x62')]});}})[_0x1f49('0x2b')](function(_0x3bf86a){if(_0x3bf86a){return{'count':_0x3bf86a['count'],'rows':_[_0x1f49('0x32')](_0x3bf86a['rows'],function(_0xa84de7){return{'membername':_0xa84de7[_0x1f49('0x30')],'UserId':_0xa84de7['id'],'queue_name':_0x3d1206[_0x1f49('0x30')],'SmsQueueId':_0x3d1206['id'],'interface':util[_0x1f49('0x63')](_0x1f49('0x64'),'SIP',_0xa84de7['name']),'penalty':0x0,'paused':_0xa84de7[_0x1f49('0x60')],'createdAt':_0xa84de7[_0x1f49('0x62')],'updatedAt':_0xa84de7[_0x1f49('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1f49('0x2b')](respondWithFilteredResult(_0x566c38,_0x4810bb))['catch'](handleError(_0x566c38,null));};exports['getTeams']=function(_0x512e0c,_0x335293,_0x56b558){var _0x1f6f6a={};var _0x154cf7={};var _0x3c2d20;var _0x5bca0a;return db[_0x1f49('0x33')][_0x1f49('0x5b')]({'where':{'id':_0x512e0c['params']['id']}})[_0x1f49('0x2b')](handleEntityNotFound(_0x335293,null))[_0x1f49('0x2b')](function(_0x4630ba){if(_0x4630ba){_0x3c2d20=_0x4630ba;_0x154cf7['model']=_[_0x1f49('0x3a')](db[_0x1f49('0x65')][_0x1f49('0x34')]);_0x154cf7[_0x1f49('0x39')]=_[_0x1f49('0x3a')](_0x512e0c[_0x1f49('0x39')]);_0x154cf7['filters']=_[_0x1f49('0x3c')](_0x154cf7[_0x1f49('0x38')],_0x154cf7[_0x1f49('0x39')]);_0x1f6f6a[_0x1f49('0x3d')]=_[_0x1f49('0x3c')](_0x154cf7[_0x1f49('0x38')],qs[_0x1f49('0x3e')](_0x512e0c['query'][_0x1f49('0x3e')]));_0x1f6f6a[_0x1f49('0x3d')]=_0x1f6f6a[_0x1f49('0x3d')][_0x1f49('0x4c')]?_0x1f6f6a[_0x1f49('0x3d')]:_0x154cf7[_0x1f49('0x38')];_0x1f6f6a[_0x1f49('0x41')]=qs[_0x1f49('0x42')](_0x512e0c[_0x1f49('0x39')][_0x1f49('0x42')]);_0x1f6f6a['where']=qs['filters'](_['pick'](_0x512e0c[_0x1f49('0x39')],_0x154cf7[_0x1f49('0x3b')]));if(_0x512e0c['query'][_0x1f49('0x44')]){_0x1f6f6a[_0x1f49('0x46')]=_[_0x1f49('0x45')](_0x1f6f6a[_0x1f49('0x46')],{'$or':_[_0x1f49('0x32')](_0x1f6f6a[_0x1f49('0x3d')],function(_0x4a5a5d){var _0x34aafc={};_0x34aafc[_0x4a5a5d]={'$like':'%'+_0x512e0c['query'][_0x1f49('0x44')]+'%'};return _0x34aafc;})});}_0x1f6f6a=_[_0x1f49('0x45')]({},_0x1f6f6a,_0x512e0c['options']);return _0x3c2d20[_0x1f49('0x66')](_0x1f6f6a);}})[_0x1f49('0x2b')](function(_0x3b2588){if(_0x3b2588){_0x5bca0a=_0x3b2588['length'];if(!_0x512e0c[_0x1f49('0x39')][_0x1f49('0x3f')](_0x1f49('0x40'))){_0x1f6f6a[_0x1f49('0x23')]=qs[_0x1f49('0x23')](_0x512e0c[_0x1f49('0x39')]['limit']);_0x1f6f6a[_0x1f49('0x25')]=qs[_0x1f49('0x25')](_0x512e0c[_0x1f49('0x39')]['offset']);}return _0x3c2d20[_0x1f49('0x66')](_0x1f6f6a);}})[_0x1f49('0x2b')](function(_0x50a419){if(_0x50a419){return _0x50a419?{'count':_0x5bca0a,'rows':_0x50a419}:null;}})[_0x1f49('0x2b')](respondWithResult(_0x335293,null))[_0x1f49('0x49')](handleError(_0x335293,null));};exports['addTeams']=function(_0x253c58,_0xcaf2c2,_0x29a688){var _0x4b7a4f=_0x253c58[_0x1f49('0x58')][_0x1f49('0x67')];return db[_0x1f49('0x65')]['findAll']({'where':{'id':_0x4b7a4f},'attributes':['id'],'include':[{'model':db[_0x1f49('0x5d')],'as':_0x1f49('0x68'),'attributes':['id',_0x1f49('0x30'),_0x1f49('0x69'),_0x1f49('0x6a'),_0x1f49('0x6b')],'raw':!![]}]})['then'](function(_0x1d17e2){if(_0x1d17e2){var _0x250522=_[_0x1f49('0x6c')](_0x1d17e2,function(_0x289404){var _0x1966a8=_0x289404[_0x1f49('0x2d')]({'plain':!![]});return _0x1966a8[_0x1f49('0x68')];});return db[_0x1f49('0x33')]['find']({'where':{'id':_0x253c58[_0x1f49('0x4b')]['id']}})[_0x1f49('0x2b')](function(_0x372409){return db[_0x1f49('0x6d')][_0x1f49('0x6e')](function(_0x4cb660){return _0x372409[_0x1f49('0x6f')](_0x4b7a4f,{'transaction':_0x4cb660})[_0x1f49('0x2b')](function(){return BPromise[_0x1f49('0x70')](_0x250522,function(_0x114f63){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x114f63['id'],'SmsQueueId':_0x253c58[_0x1f49('0x4b')]['id']},'transaction':_0x4cb660});});})[_0x1f49('0x2b')](function(){_0x250522['forEach'](function(_0x39221d){socket[_0x1f49('0x71')](_0x1f49('0x72'),{'UserId':_0x39221d['id'],'SmsQueueId':_0x372409['id']});});});});});}})['then'](respondWithStatusCode(_0xcaf2c2,null))[_0x1f49('0x49')](handleError(_0xcaf2c2,null));};exports[_0x1f49('0x73')]=function(_0x310510,_0x104eb5,_0x15f877){return db[_0x1f49('0x65')][_0x1f49('0x74')]({'where':{'id':_0x310510[_0x1f49('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1f49('0x5d')],'as':_0x1f49('0x68'),'attributes':['id'],'raw':!![]}]})[_0x1f49('0x2b')](handleEntityNotFound(_0x104eb5,null))['then'](function(_0x4b505a){var _0x32576c=_['map'](_0x4b505a,'id');var _0x22a15c=[];var _0x6dc416=[];var _0xb9d0e9=squel[_0x1f49('0x75')]();_0xb9d0e9[_0x1f49('0x76')](_0x1f49('0x77'))[_0x1f49('0x78')](_0x1f49('0x79'),'tq')[_0x1f49('0x7a')](_0x1f49('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1f49('0x46')]('SmsQueueId\x20=\x20?',_0x310510[_0x1f49('0x4b')]['id']);for(var _0x2b4b0c=0x0;_0x2b4b0c<_0x4b505a[_0x1f49('0x4c')];_0x2b4b0c+=0x1){let _0x539004=_0x4b505a[_0x2b4b0c];for(var _0x10fa72=0x0;_0x10fa72<_0x539004[_0x1f49('0x68')][_0x1f49('0x4c')];_0x10fa72+=0x1){let _0xcabe73=_0x539004[_0x1f49('0x68')][_0x10fa72];var _0x3098c8=_0xb9d0e9[_0x1f49('0x7c')]();_0x3098c8[_0x1f49('0x46')]('ut.UserId\x20=\x20?',_0xcabe73['id']);_0x6dc416[_0x1f49('0x7d')](db[_0x1f49('0x6d')][_0x1f49('0x39')](_0x3098c8['toString'](),{'type':db[_0x1f49('0x6d')]['QueryTypes']['SELECT']})['then'](function(_0x3e9e87){if(_0x3e9e87[_0x1f49('0x4c')]===0x1){return _0xcabe73['id'];}else{var _0x451d39=_['every'](_['map'](_0x3e9e87,_0x1f49('0x7e')),function(_0x189fe2){return _[_0x1f49('0x7f')](_0x32576c,_0x189fe2);});if(_0x451d39){return _0xcabe73['id'];}}}));}}return BPromise['all'](_0x6dc416)['then'](function(_0x1fdee5){_0x22a15c=_(_0x22a15c)['union'](_0x1fdee5)[_0x1f49('0x80')]()[_0x1f49('0x81')]();return db['SmsQueue'][_0x1f49('0x4e')]({'where':{'id':_0x310510[_0x1f49('0x4b')]['id']}})[_0x1f49('0x2b')](function(_0x36ef92){return db[_0x1f49('0x6d')]['transaction'](function(_0x44e822){return _0x36ef92['removeTeams'](_0x310510[_0x1f49('0x39')]['ids'],{'transaction':_0x44e822})[_0x1f49('0x2b')](function(){if(!_[_0x1f49('0x82')](_0x22a15c)){return _0x36ef92['removeAgents'](_0x22a15c,{'transaction':_0x44e822});}})[_0x1f49('0x2b')](function(){_0x22a15c[_0x1f49('0x83')](function(_0xa782ee){socket[_0x1f49('0x71')](_0x1f49('0x84'),{'UserId':_0xa782ee,'SmsQueueId':_0x36ef92['id']});});});});});});})[_0x1f49('0x2b')](respondWithStatusCode(_0x104eb5,null))[_0x1f49('0x49')](handleError(_0x104eb5,null));};exports[_0x1f49('0x85')]=function(_0x588237,_0x497b12,_0x22e876){return db[_0x1f49('0x33')]['find']({'where':{'id':_0x588237['params']['id']}})[_0x1f49('0x2b')](handleEntityNotFound(_0x497b12,null))[_0x1f49('0x2b')](function(_0x336a6a){if(_0x336a6a){return _0x336a6a[_0x1f49('0x85')](_0x588237['body']['ids'],_[_0x1f49('0x86')](_0x588237[_0x1f49('0x58')],[_0x1f49('0x67'),'id'])||{})['spread'](function(_0x4a449f){for(var _0x997b7b=0x0;_0x997b7b<_0x588237[_0x1f49('0x58')][_0x1f49('0x67')][_0x1f49('0x4c')];_0x997b7b+=0x1){socket[_0x1f49('0x71')](_0x1f49('0x72'),{'UserId':Number(_0x588237[_0x1f49('0x58')][_0x1f49('0x67')][_0x997b7b]),'SmsQueueId':Number(_0x588237[_0x1f49('0x4b')]['id'])});}return _0x4a449f;});}})[_0x1f49('0x2b')](respondWithResult(_0x497b12,null))['catch'](handleError(_0x497b12,null));};exports[_0x1f49('0x87')]=function(_0x504955,_0x41e70e,_0xcda0fb){return db[_0x1f49('0x33')]['find']({'where':{'id':_0x504955[_0x1f49('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e70e,null))['then'](function(_0x3fcada){if(_0x3fcada){return _0x3fcada[_0x1f49('0x87')](_0x504955[_0x1f49('0x39')]['ids'])[_0x1f49('0x2b')](function(){if(_[_0x1f49('0x88')](_0x504955[_0x1f49('0x39')]['ids'])){for(var _0x1db260=0x0;_0x1db260<_0x504955[_0x1f49('0x39')][_0x1f49('0x67')][_0x1f49('0x4c')];_0x1db260+=0x1){socket[_0x1f49('0x71')]('userSmsQueue:remove',{'UserId':Number(_0x504955[_0x1f49('0x39')][_0x1f49('0x67')][_0x1db260]),'SmsQueueId':Number(_0x504955[_0x1f49('0x4b')]['id'])});}}else{socket['emit'](_0x1f49('0x84'),{'UserId':Number(_0x504955['query'][_0x1f49('0x67')]),'SmsQueueId':Number(_0x504955[_0x1f49('0x4b')]['id'])});}});}})[_0x1f49('0x2b')](respondWithStatusCode(_0x41e70e,null))[_0x1f49('0x49')](handleError(_0x41e70e,null));};exports[_0x1f49('0x89')]=function(_0x17a359,_0x313092,_0x1861a3){var _0x4b4719={};var _0x147668={};var _0x2033a6;var _0x2ccda7;return db[_0x1f49('0x33')][_0x1f49('0x5b')]({'where':{'id':_0x17a359[_0x1f49('0x4b')]['id']}})[_0x1f49('0x2b')](handleEntityNotFound(_0x313092,null))[_0x1f49('0x2b')](function(_0x585641){if(_0x585641){_0x2033a6=_0x585641;_0x147668['model']=_[_0x1f49('0x3a')](db['User'][_0x1f49('0x34')]);_0x147668[_0x1f49('0x39')]=_['keys'](_0x17a359[_0x1f49('0x39')]);_0x147668[_0x1f49('0x3b')]=_[_0x1f49('0x3c')](_0x147668['model'],_0x147668[_0x1f49('0x39')]);_0x4b4719[_0x1f49('0x3d')]=_['intersection'](_0x147668['model'],qs[_0x1f49('0x3e')](_0x17a359['query'][_0x1f49('0x3e')]));_0x4b4719['attributes']=_0x4b4719[_0x1f49('0x3d')][_0x1f49('0x4c')]?_0x4b4719[_0x1f49('0x3d')]:_0x147668[_0x1f49('0x38')];_0x4b4719[_0x1f49('0x41')]=qs['sort'](_0x17a359[_0x1f49('0x39')][_0x1f49('0x42')]);_0x4b4719['where']=qs[_0x1f49('0x3b')](_[_0x1f49('0x43')](_0x17a359[_0x1f49('0x39')],_0x147668['filters']));if(_0x17a359['query'][_0x1f49('0x44')]){_0x4b4719[_0x1f49('0x46')]=_[_0x1f49('0x45')](_0x4b4719['where'],{'$or':_['map'](_0x4b4719[_0x1f49('0x3d')],function(_0x2885dc){var _0x592d76={};_0x592d76[_0x2885dc]={'$like':'%'+_0x17a359[_0x1f49('0x39')][_0x1f49('0x44')]+'%'};return _0x592d76;})});}_0x4b4719=_[_0x1f49('0x45')]({},_0x4b4719,_0x17a359[_0x1f49('0x4d')]);return _0x2033a6[_0x1f49('0x89')](_0x4b4719);}})['then'](function(_0x4ce7b7){if(_0x4ce7b7){_0x2ccda7=_0x4ce7b7[_0x1f49('0x4c')];if(!_0x17a359['query'][_0x1f49('0x3f')](_0x1f49('0x40'))){_0x4b4719[_0x1f49('0x23')]=qs[_0x1f49('0x23')](_0x17a359[_0x1f49('0x39')][_0x1f49('0x23')]);_0x4b4719[_0x1f49('0x25')]=qs[_0x1f49('0x25')](_0x17a359[_0x1f49('0x39')][_0x1f49('0x25')]);}return _0x2033a6[_0x1f49('0x89')](_0x4b4719);}})['then'](function(_0x13c8fb){if(_0x13c8fb){return _0x13c8fb?{'count':_0x2ccda7,'rows':_0x13c8fb}:null;}})[_0x1f49('0x2b')](respondWithResult(_0x313092,null))[_0x1f49('0x49')](handleError(_0x313092,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 025ec0e..aaabef4 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 _0x4eea=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hook'];(function(_0x43e172,_0x560b2f){var _0x13f811=function(_0x3f87ca){while(--_0x3f87ca){_0x43e172['push'](_0x43e172['shift']());}};_0x13f811(++_0x560b2f);}(_0x4eea,0x184));var _0xa4ee=function(_0x2bbd11,_0x155c1d){_0x2bbd11=_0x2bbd11-0x0;var _0x1cf67c=_0x4eea[_0x2bbd11];return _0x1cf67c;};'use strict';var EventEmitter=require(_0xa4ee('0x0'));var SmsQueue=require(_0xa4ee('0x1'))['db'][_0xa4ee('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa4ee('0x3')](0x0);var events={'afterCreate':_0xa4ee('0x4'),'afterUpdate':_0xa4ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x212ab9){return function(_0x1189d0,_0x121c16,_0x2832bf){SmsQueueEvents[_0xa4ee('0x6')](_0x212ab9+':'+_0x1189d0['id'],_0x1189d0);SmsQueueEvents['emit'](_0x212ab9,_0x1189d0);_0x2832bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xa4ee('0x7')](e,emitEvent(event));}}module[_0xa4ee('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x37f6=['emit','hasOwnProperty','events','../../mysqldb','SmsQueue','save','remove'];(function(_0x353cd6,_0xc795f6){var _0x55712a=function(_0x3b83e1){while(--_0x3b83e1){_0x353cd6['push'](_0x353cd6['shift']());}};_0x55712a(++_0xc795f6);}(_0x37f6,0x1e5));var _0x637f=function(_0xe16fcf,_0x2b5918){_0xe16fcf=_0xe16fcf-0x0;var _0x5981e9=_0x37f6[_0xe16fcf];return _0x5981e9;};'use strict';var EventEmitter=require(_0x637f('0x0'));var SmsQueue=require(_0x637f('0x1'))['db'][_0x637f('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x637f('0x3'),'afterUpdate':'update','afterDestroy':_0x637f('0x4')};function emitEvent(_0x1dd152){return function(_0x1d9cd5,_0x58aa1c,_0x181867){SmsQueueEvents[_0x637f('0x5')](_0x1dd152+':'+_0x1d9cd5['id'],_0x1d9cd5);SmsQueueEvents['emit'](_0x1dd152,_0x1d9cd5);_0x181867(null);};}for(var e in events){if(events[_0x637f('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index accac21..ede7b62 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 _0x3776=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','../../config/logger'];(function(_0x93b411,_0x4263ca){var _0x14ce11=function(_0x3f71c4){while(--_0x3f71c4){_0x93b411['push'](_0x93b411['shift']());}};_0x14ce11(++_0x4263ca);}(_0x3776,0x16a));var _0x6377=function(_0x1a3fe2,_0x553b71){_0x1a3fe2=_0x1a3fe2-0x0;var _0x490ee2=_0x3776[_0x1a3fe2];return _0x490ee2;};'use strict';var _=require(_0x6377('0x0'));var util=require('util');var logger=require(_0x6377('0x1'))(_0x6377('0x2'));var moment=require(_0x6377('0x3'));var BPromise=require(_0x6377('0x4'));var rp=require(_0x6377('0x5'));var fs=require('fs');var path=require(_0x6377('0x6'));var rimraf=require(_0x6377('0x7'));var config=require(_0x6377('0x8'));var attributes=require(_0x6377('0x9'));module[_0x6377('0xa')]=function(_0xa68aea,_0x1a4748){return _0xa68aea['define'](_0x6377('0xb'),attributes,{'tableName':_0x6377('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeecc=['bluebird','path','rimraf','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeecc,0x146));var _0xceec=function(_0x3bdebc,_0x46504a){_0x3bdebc=_0x3bdebc-0x0;var _0x3cf200=_0xeecc[_0x3bdebc];return _0x3cf200;};'use strict';var _=require(_0xceec('0x0'));var util=require('util');var logger=require(_0xceec('0x1'))(_0xceec('0x2'));var moment=require(_0xceec('0x3'));var BPromise=require(_0xceec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xceec('0x5'));var rimraf=require(_0xceec('0x6'));var config=require('../../config/environment');var attributes=require(_0xceec('0x7'));module[_0xceec('0x8')]=function(_0x34766b,_0x1452e1){return _0x34766b['define'](_0xceec('0x9'),attributes,{'tableName':_0xceec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 056b524..740ea5c 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 _0x2499=['request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','model','map','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0x2499,0x108));var _0x9249=function(_0x1f6cf6,_0x7ebb5){_0x1f6cf6=_0x1f6cf6-0x0;var _0x157182=_0x2499[_0x1f6cf6];return _0x157182;};'use strict';var _=require(_0x9249('0x0'));var util=require(_0x9249('0x1'));var moment=require(_0x9249('0x2'));var BPromise=require(_0x9249('0x3'));var rs=require(_0x9249('0x4'));var fs=require('fs');var Redis=require(_0x9249('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9249('0x6'));var logger=require('../../config/logger')(_0x9249('0x7'));var config=require(_0x9249('0x8'));var jayson=require(_0x9249('0x9'));var client=jayson[_0x9249('0xa')][_0x9249('0xb')]({'port':0x232a});config[_0x9249('0xc')]=_[_0x9249('0xd')](config[_0x9249('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9249('0xe'))(new Redis(config[_0x9249('0xc')]));require(_0x9249('0xf'))[_0x9249('0x10')](socket);function respondWithRpcPromise(_0x3ba37b,_0x1a3e44,_0x1124cc){return new BPromise(function(_0xdf6272,_0x32bced){return client[_0x9249('0x11')](_0x3ba37b,_0x1124cc)[_0x9249('0x12')](function(_0x395765){logger[_0x9249('0x13')](_0x9249('0x14'),_0x1a3e44,'request\x20sent');logger[_0x9249('0x15')](_0x9249('0x16'),_0x1a3e44,_0x9249('0x17'),JSON[_0x9249('0x18')](_0x395765));if(_0x395765[_0x9249('0x19')]){if(_0x395765[_0x9249('0x19')]['code']===0x1f4){logger[_0x9249('0x19')](_0x9249('0x14'),_0x1a3e44,_0x395765[_0x9249('0x19')][_0x9249('0x1a')]);return _0x32bced(_0x395765[_0x9249('0x19')][_0x9249('0x1a')]);}logger[_0x9249('0x19')](_0x9249('0x14'),_0x1a3e44,_0x395765['error']['message']);return _0xdf6272(_0x395765[_0x9249('0x19')][_0x9249('0x1a')]);}else{logger[_0x9249('0x13')](_0x9249('0x14'),_0x1a3e44,_0x9249('0x17'));_0xdf6272(_0x395765[_0x9249('0x1b')]['message']);}})[_0x9249('0x1c')](function(_0x647fef){logger[_0x9249('0x19')](_0x9249('0x14'),_0x1a3e44,_0x647fef);_0x32bced(_0x647fef);});});}exports[_0x9249('0x1d')]=function(_0x23af74){var _0x5a4988=this;return new Promise(function(_0x220453,_0x88a615){return db[_0x9249('0x1e')][_0x9249('0x1f')]({'raw':_0x23af74[_0x9249('0x20')]?_0x23af74['options'][_0x9249('0x21')]===undefined?!![]:![]:!![],'where':_0x23af74[_0x9249('0x20')]?_0x23af74['options'][_0x9249('0x22')]||null:null,'attributes':_0x23af74[_0x9249('0x20')]?_0x23af74[_0x9249('0x20')][_0x9249('0x23')]||null:null,'limit':_0x23af74[_0x9249('0x20')]?_0x23af74['options']['limit']||null:null,'include':_0x23af74[_0x9249('0x20')]?_0x23af74[_0x9249('0x20')][_0x9249('0x24')]?_['map'](_0x23af74[_0x9249('0x20')][_0x9249('0x24')],function(_0x29a32c){return{'model':db[_0x29a32c[_0x9249('0x25')]],'as':_0x29a32c['as'],'attributes':_0x29a32c[_0x9249('0x23')],'include':_0x29a32c[_0x9249('0x24')]?_[_0x9249('0x26')](_0x29a32c[_0x9249('0x24')],function(_0x5db669){return{'model':db[_0x5db669[_0x9249('0x25')]],'as':_0x5db669['as'],'attributes':_0x5db669[_0x9249('0x23')],'include':_0x5db669[_0x9249('0x24')]?_[_0x9249('0x26')](_0x5db669[_0x9249('0x24')],function(_0x52db31){return{'model':db[_0x52db31[_0x9249('0x25')]],'as':_0x52db31['as'],'attributes':_0x52db31[_0x9249('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9249('0x12')](function(_0x43683e){logger['info'](_0x9249('0x1d'),_0x23af74);logger[_0x9249('0x15')](_0x9249('0x1d'),_0x23af74,JSON[_0x9249('0x18')](_0x43683e));_0x220453(_0x43683e);})[_0x9249('0x1c')](function(_0x2ea0cc){logger[_0x9249('0x19')](_0x9249('0x1d'),_0x2ea0cc['message'],_0x23af74);_0x88a615(_0x5a4988['error'](0x1f4,_0x2ea0cc[_0x9249('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x182dbf){var _0x976926=this;return new Promise(function(_0x37ad8c,_0x1d0ffd){return db[_0x9249('0x1e')][_0x9249('0x27')]({'raw':_0x182dbf[_0x9249('0x20')]?_0x182dbf['options'][_0x9249('0x21')]===undefined?!![]:![]:!![],'where':_0x182dbf[_0x9249('0x20')]?_0x182dbf['options']['where']||null:null,'attributes':_0x182dbf[_0x9249('0x20')]?_0x182dbf['options'][_0x9249('0x23')]||null:null,'include':_0x182dbf['options']?_0x182dbf['options'][_0x9249('0x24')]?_[_0x9249('0x26')](_0x182dbf['options'][_0x9249('0x24')],function(_0x197f39){return{'model':db[_0x197f39[_0x9249('0x25')]],'as':_0x197f39['as'],'attributes':_0x197f39[_0x9249('0x23')],'include':_0x197f39[_0x9249('0x24')]?_[_0x9249('0x26')](_0x197f39[_0x9249('0x24')],function(_0x1fbfd0){return{'model':db[_0x1fbfd0[_0x9249('0x25')]],'as':_0x1fbfd0['as'],'attributes':_0x1fbfd0[_0x9249('0x23')],'include':_0x1fbfd0['include']?_[_0x9249('0x26')](_0x1fbfd0[_0x9249('0x24')],function(_0x2a6f0f){return{'model':db[_0x2a6f0f[_0x9249('0x25')]],'as':_0x2a6f0f['as'],'attributes':_0x2a6f0f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8483b1){logger[_0x9249('0x13')](_0x9249('0x28'),_0x182dbf);logger[_0x9249('0x15')]('ShowSmsQueue',_0x182dbf,JSON[_0x9249('0x18')](_0x8483b1));_0x37ad8c(_0x8483b1);})['catch'](function(_0x54b4d3){logger[_0x9249('0x19')](_0x9249('0x28'),_0x54b4d3[_0x9249('0x1a')],_0x182dbf);_0x1d0ffd(_0x976926[_0x9249('0x19')](0x1f4,_0x54b4d3['message']));});});}; \ No newline at end of file +var _0x551a=['include','debug','find','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','map','model','attributes'];(function(_0x34cbb8,_0x4ce1a6){var _0xc32267=function(_0x357631){while(--_0x357631){_0x34cbb8['push'](_0x34cbb8['shift']());}};_0xc32267(++_0x4ce1a6);}(_0x551a,0x115));var _0xa551=function(_0x13eaf1,_0x512dbe){_0x13eaf1=_0x13eaf1-0x0;var _0x3d7b44=_0x551a[_0x13eaf1];return _0x3d7b44;};'use strict';var _=require(_0xa551('0x0'));var util=require(_0xa551('0x1'));var moment=require('moment');var BPromise=require(_0xa551('0x2'));var rs=require(_0xa551('0x3'));var fs=require('fs');var Redis=require(_0xa551('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa551('0x5'));var logger=require('../../config/logger')(_0xa551('0x6'));var config=require('../../config/environment');var jayson=require(_0xa551('0x7'));var client=jayson[_0xa551('0x8')][_0xa551('0x9')]({'port':0x232a});config[_0xa551('0xa')]=_[_0xa551('0xb')](config[_0xa551('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa551('0xc'))(new Redis(config[_0xa551('0xa')]));require('./smsQueue.socket')[_0xa551('0xd')](socket);function respondWithRpcPromise(_0x19caf9,_0xa10471,_0x5b132a){return new BPromise(function(_0x470493,_0x269adb){return client[_0xa551('0xe')](_0x19caf9,_0x5b132a)[_0xa551('0xf')](function(_0x4bba12){logger[_0xa551('0x10')](_0xa551('0x11'),_0xa10471,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0xa10471,'request\x20sent',JSON[_0xa551('0x12')](_0x4bba12));if(_0x4bba12[_0xa551('0x13')]){if(_0x4bba12[_0xa551('0x13')][_0xa551('0x14')]===0x1f4){logger[_0xa551('0x13')]('SmsQueue,\x20%s,\x20%s',_0xa10471,_0x4bba12[_0xa551('0x13')][_0xa551('0x15')]);return _0x269adb(_0x4bba12[_0xa551('0x13')][_0xa551('0x15')]);}logger[_0xa551('0x13')](_0xa551('0x11'),_0xa10471,_0x4bba12[_0xa551('0x13')][_0xa551('0x15')]);return _0x470493(_0x4bba12[_0xa551('0x13')]['message']);}else{logger[_0xa551('0x10')](_0xa551('0x11'),_0xa10471,_0xa551('0x16'));_0x470493(_0x4bba12[_0xa551('0x17')][_0xa551('0x15')]);}})[_0xa551('0x18')](function(_0x496a8f){logger[_0xa551('0x13')]('SmsQueue,\x20%s,\x20%s',_0xa10471,_0x496a8f);_0x269adb(_0x496a8f);});});}exports[_0xa551('0x19')]=function(_0x1b8575){var _0xd122b1=this;return new Promise(function(_0x276d79,_0x27c2a0){return db[_0xa551('0x1a')][_0xa551('0x1b')]({'raw':_0x1b8575[_0xa551('0x1c')]?_0x1b8575[_0xa551('0x1c')][_0xa551('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b8575[_0xa551('0x1c')]?_0x1b8575['options'][_0xa551('0x1e')]||null:null,'attributes':_0x1b8575[_0xa551('0x1c')]?_0x1b8575[_0xa551('0x1c')]['attributes']||null:null,'limit':_0x1b8575[_0xa551('0x1c')]?_0x1b8575[_0xa551('0x1c')][_0xa551('0x1f')]||null:null,'include':_0x1b8575[_0xa551('0x1c')]?_0x1b8575[_0xa551('0x1c')]['include']?_[_0xa551('0x20')](_0x1b8575['options']['include'],function(_0x333f2d){return{'model':db[_0x333f2d[_0xa551('0x21')]],'as':_0x333f2d['as'],'attributes':_0x333f2d[_0xa551('0x22')],'include':_0x333f2d[_0xa551('0x23')]?_[_0xa551('0x20')](_0x333f2d[_0xa551('0x23')],function(_0x38b0b2){return{'model':db[_0x38b0b2['model']],'as':_0x38b0b2['as'],'attributes':_0x38b0b2['attributes'],'include':_0x38b0b2['include']?_['map'](_0x38b0b2[_0xa551('0x23')],function(_0x2f1cfc){return{'model':db[_0x2f1cfc[_0xa551('0x21')]],'as':_0x2f1cfc['as'],'attributes':_0x2f1cfc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc8dfe){logger[_0xa551('0x10')](_0xa551('0x19'),_0x1b8575);logger[_0xa551('0x24')](_0xa551('0x19'),_0x1b8575,JSON[_0xa551('0x12')](_0xbc8dfe));_0x276d79(_0xbc8dfe);})['catch'](function(_0x1b550c){logger[_0xa551('0x13')](_0xa551('0x19'),_0x1b550c['message'],_0x1b8575);_0x27c2a0(_0xd122b1[_0xa551('0x13')](0x1f4,_0x1b550c[_0xa551('0x15')]));});});};exports['ShowSmsQueue']=function(_0x3f6a38){var _0x31e092=this;return new Promise(function(_0x55dafd,_0x47edb2){return db[_0xa551('0x1a')][_0xa551('0x25')]({'raw':_0x3f6a38['options']?_0x3f6a38[_0xa551('0x1c')][_0xa551('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f6a38[_0xa551('0x1c')]?_0x3f6a38['options'][_0xa551('0x1e')]||null:null,'attributes':_0x3f6a38[_0xa551('0x1c')]?_0x3f6a38[_0xa551('0x1c')][_0xa551('0x22')]||null:null,'include':_0x3f6a38['options']?_0x3f6a38[_0xa551('0x1c')][_0xa551('0x23')]?_['map'](_0x3f6a38['options'][_0xa551('0x23')],function(_0x2bdb53){return{'model':db[_0x2bdb53[_0xa551('0x21')]],'as':_0x2bdb53['as'],'attributes':_0x2bdb53[_0xa551('0x22')],'include':_0x2bdb53[_0xa551('0x23')]?_[_0xa551('0x20')](_0x2bdb53[_0xa551('0x23')],function(_0x795601){return{'model':db[_0x795601['model']],'as':_0x795601['as'],'attributes':_0x795601[_0xa551('0x22')],'include':_0x795601['include']?_['map'](_0x795601[_0xa551('0x23')],function(_0x3a1708){return{'model':db[_0x3a1708['model']],'as':_0x3a1708['as'],'attributes':_0x3a1708[_0xa551('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa551('0xf')](function(_0x1927ae){logger[_0xa551('0x10')](_0xa551('0x26'),_0x3f6a38);logger[_0xa551('0x24')](_0xa551('0x26'),_0x3f6a38,JSON[_0xa551('0x12')](_0x1927ae));_0x55dafd(_0x1927ae);})[_0xa551('0x18')](function(_0xb9742b){logger[_0xa551('0x13')](_0xa551('0x26'),_0xb9742b[_0xa551('0x15')],_0x3f6a38);_0x47edb2(_0x31e092[_0xa551('0x13')](0x1f4,_0xb9742b[_0xa551('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 15012a4..e80d019 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 _0x36bf=['./smsQueue.events','update','removeListener','register','length'];(function(_0x48eba1,_0x1dc374){var _0x201de6=function(_0x5982ba){while(--_0x5982ba){_0x48eba1['push'](_0x48eba1['shift']());}};_0x201de6(++_0x1dc374);}(_0x36bf,0x14f));var _0xf36b=function(_0xb434e2,_0x563d4a){_0xb434e2=_0xb434e2-0x0;var _0x487e47=_0x36bf[_0xb434e2];return _0x487e47;};'use strict';var SmsQueueEvents=require(_0xf36b('0x0'));var events=['save','remove',_0xf36b('0x1')];function createListener(_0x174d42,_0x56e8d3){return function(_0x433699){_0x56e8d3['emit'](_0x174d42,_0x433699);};}function removeListener(_0x1a918d,_0x2d818a){return function(){SmsQueueEvents[_0xf36b('0x2')](_0x1a918d,_0x2d818a);};}exports[_0xf36b('0x3')]=function(_0x238195){for(var _0x33e051=0x0,_0x154f73=events[_0xf36b('0x4')];_0x33e051<_0x154f73;_0x33e051++){var _0x4efa6a=events[_0x33e051];var _0x4656d0=createListener('smsQueue:'+_0x4efa6a,_0x238195);SmsQueueEvents['on'](_0x4efa6a,_0x4656d0);}}; \ No newline at end of file +var _0xd835=['length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x4de96c,_0x486ead){var _0x2ea1c5=function(_0x5e1ba3){while(--_0x5e1ba3){_0x4de96c['push'](_0x4de96c['shift']());}};_0x2ea1c5(++_0x486ead);}(_0xd835,0xf5));var _0x5d83=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0xd835[_0x585d81];return _0x1aca0d;};'use strict';var SmsQueueEvents=require(_0x5d83('0x0'));var events=[_0x5d83('0x1'),_0x5d83('0x2'),_0x5d83('0x3')];function createListener(_0x4171ae,_0x231c26){return function(_0x610af5){_0x231c26[_0x5d83('0x4')](_0x4171ae,_0x610af5);};}function removeListener(_0x4119d7,_0x2bbbd5){return function(){SmsQueueEvents[_0x5d83('0x5')](_0x4119d7,_0x2bbbd5);};}exports[_0x5d83('0x6')]=function(_0x5a5e74){for(var _0x4b92bb=0x0,_0x1e786a=events[_0x5d83('0x7')];_0x4b92bb<_0x1e786a;_0x4b92bb++){var _0x53064a=events[_0x4b92bb];var _0x51e9e3=createListener(_0x5d83('0x8')+_0x53064a,_0x5a5e74);SmsQueueEvents['on'](_0x53064a,_0x51e9e3);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 4315adc..3c72c26 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 _0x5004=['show','post','create','put','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','describe','/:id','isAuthenticated'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5004,0x84));var _0x4500=function(_0x10cb99,_0x5d712f){_0x10cb99=_0x10cb99-0x0;var _0x1c3a90=_0x5004[_0x10cb99];return _0x1c3a90;};'use strict';var multer=require('multer');var util=require(_0x4500('0x0'));var path=require(_0x4500('0x1'));var timeout=require('connect-timeout');var express=require(_0x4500('0x2'));var router=express[_0x4500('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4500('0x4'));var interaction=require(_0x4500('0x5'));var config=require(_0x4500('0x6'));var controller=require(_0x4500('0x7'));router[_0x4500('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4500('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x4500('0x9')]);router[_0x4500('0x8')](_0x4500('0xa'),auth[_0x4500('0xb')](),controller[_0x4500('0xc')]);router[_0x4500('0xd')]('/',auth[_0x4500('0xb')](),controller[_0x4500('0xe')]);router[_0x4500('0xf')](_0x4500('0xa'),auth[_0x4500('0xb')](),controller['update']);router[_0x4500('0x10')](_0x4500('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4500('0x11')]=router; \ No newline at end of file +var _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x3d1a34,_0x3de0f0){var _0x430b6d=function(_0x2897cd){while(--_0x2897cd){_0x3d1a34['push'](_0x3d1a34['shift']());}};_0x430b6d(++_0x3de0f0);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 277b8ec..049e8fb 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 _0x134d=['moment','exports','STRING','DATE'];(function(_0x42cfab,_0x1634ce){var _0x5666dc=function(_0xb9a0dd){while(--_0xb9a0dd){_0x42cfab['push'](_0x42cfab['shift']());}};_0x5666dc(++_0x1634ce);}(_0x134d,0xfc));var _0xd134=function(_0x41793b,_0x3e438d){_0x41793b=_0x41793b-0x0;var _0x37d52d=_0x134d[_0x41793b];return _0x37d52d;};'use strict';var moment=require(_0xd134('0x0'));var Sequelize=require('sequelize');module[_0xd134('0x1')]={'uniqueid':{'type':Sequelize[_0xd134('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd134('0x2')]},'joinAt':{'type':Sequelize[_0xd134('0x3')]},'leaveAt':{'type':Sequelize[_0xd134('0x3')]},'acceptAt':{'type':Sequelize[_0xd134('0x3')]},'exitAt':{'type':Sequelize[_0xd134('0x3')]},'reason':{'type':Sequelize[_0xd134('0x2')]}}; \ No newline at end of file +var _0x4517=['sequelize','exports','STRING','DATE'];(function(_0x4bdfc3,_0x2824ef){var _0x10de85=function(_0x2337dc){while(--_0x2337dc){_0x4bdfc3['push'](_0x4bdfc3['shift']());}};_0x10de85(++_0x2824ef);}(_0x4517,0x19c));var _0x7451=function(_0x21b4a1,_0x340f40){_0x21b4a1=_0x21b4a1-0x0;var _0x22fc81=_0x4517[_0x21b4a1];return _0x22fc81;};'use strict';var moment=require('moment');var Sequelize=require(_0x7451('0x0'));module[_0x7451('0x1')]={'uniqueid':{'type':Sequelize[_0x7451('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7451('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7451('0x3')]},'acceptAt':{'type':Sequelize[_0x7451('0x3')]},'exitAt':{'type':Sequelize[_0x7451('0x3')]},'reason':{'type':Sequelize[_0x7451('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 52fa403..e2c1d29 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 _0x415e=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0xbf663b,_0x4c5443){var _0x597703=function(_0x2c5de1){while(--_0x2c5de1){_0xbf663b['push'](_0xbf663b['shift']());}};_0x597703(++_0x4c5443);}(_0x415e,0x11f));var _0xe415=function(_0x309616,_0x5a9ee8){_0x309616=_0x309616-0x0;var _0x32bf33=_0x415e[_0x309616];return _0x32bf33;};'use strict';var emlformat=require(_0xe415('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe415('0x1'));var moment=require('moment');var BPromise=require(_0xe415('0x2'));var Mustache=require('mustache');var util=require(_0xe415('0x3'));var path=require(_0xe415('0x4'));var sox=require(_0xe415('0x5'));var csv=require('to-csv');var ejs=require(_0xe415('0x6'));var fs=require('fs');var fs_extra=require(_0xe415('0x7'));var _=require(_0xe415('0x8'));var squel=require(_0xe415('0x9'));var crypto=require(_0xe415('0xa'));var jsforce=require(_0xe415('0xb'));var deskjs=require(_0xe415('0xc'));var toCsv=require(_0xe415('0xd'));var querystring=require(_0xe415('0xe'));var Papa=require(_0xe415('0xf'));var Redis=require(_0xe415('0x10'));var authService=require(_0xe415('0x11'));var qs=require(_0xe415('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe415('0x13'));var logger=require(_0xe415('0x14'))(_0xe415('0x15'));var utils=require(_0xe415('0x16'));var config=require(_0xe415('0x17'));var licenseUtil=require(_0xe415('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ed1fc,_0x306c0a){_0x306c0a=_0x306c0a||0xcc;return function(_0x2d0836){if(_0x2d0836){return _0x5ed1fc[_0xe415('0x19')](_0x306c0a);}return _0x5ed1fc[_0xe415('0x1a')](_0x306c0a)[_0xe415('0x1b')]();};}function respondWithResult(_0x393fbf,_0x33a19b){_0x33a19b=_0x33a19b||0xc8;return function(_0x523700){if(_0x523700){return _0x393fbf['status'](_0x33a19b)[_0xe415('0x1c')](_0x523700);}};}function respondWithFilteredResult(_0xcf4ccb,_0xb1e112){return function(_0x12bc2e){if(_0x12bc2e){var _0x198ed8=typeof _0xb1e112[_0xe415('0x1d')]===_0xe415('0x1e')&&typeof _0xb1e112[_0xe415('0x1f')]===_0xe415('0x1e');var _0x392538=_0x12bc2e[_0xe415('0x20')];var _0x53c6e7=_0x198ed8?0x0:_0xb1e112[_0xe415('0x1d')];var _0x1212f6=_0x198ed8?_0x12bc2e['count']:_0xb1e112[_0xe415('0x1d')]+_0xb1e112[_0xe415('0x1f')];var _0x6debf0;if(_0x1212f6>=_0x392538){_0x1212f6=_0x392538;_0x6debf0=0xc8;}else{_0x6debf0=0xce;}_0xcf4ccb[_0xe415('0x1a')](_0x6debf0);return _0xcf4ccb[_0xe415('0x21')]('Content-Range',_0x53c6e7+'-'+_0x1212f6+'/'+_0x392538)[_0xe415('0x1c')](_0x12bc2e);}return null;};}function patchUpdates(_0x222135){return function(_0x289586){try{jsonpatch[_0xe415('0x22')](_0x289586,_0x222135,!![]);}catch(_0x287c87){return BPromise[_0xe415('0x23')](_0x287c87);}return _0x289586[_0xe415('0x24')]();};}function saveUpdates(_0x168a02,_0x59bb4f){return function(_0x34790f){if(_0x34790f){return _0x34790f[_0xe415('0x25')](_0x168a02)[_0xe415('0x26')](function(_0x2f1040){return _0x2f1040;});}return null;};}function removeEntity(_0x20164f,_0x46b1c9){return function(_0x517299){if(_0x517299){return _0x517299[_0xe415('0x27')]()['then'](function(){_0x20164f[_0xe415('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1e64,_0x310d93){return function(_0x2c0b56){if(!_0x2c0b56){_0x4e1e64[_0xe415('0x19')](0x194);}return _0x2c0b56;};}function handleError(_0x5ae63c,_0x2c57af){_0x2c57af=_0x2c57af||0x1f4;return function(_0x54532d){logger['error'](_0x54532d[_0xe415('0x28')]);if(_0x54532d[_0xe415('0x29')]){delete _0x54532d[_0xe415('0x29')];}_0x5ae63c[_0xe415('0x1a')](_0x2c57af)['send'](_0x54532d);};}exports[_0xe415('0x2a')]=function(_0x7babe8,_0x34f79c){var _0x46b5cc={},_0x1c1779={},_0x3e40c5={'count':0x0,'rows':[]};var _0x1a551e=_[_0xe415('0x2b')](db[_0xe415('0x2c')][_0xe415('0x2d')],function(_0x27e952){return{'name':_0x27e952['fieldName'],'type':_0x27e952[_0xe415('0x2e')][_0xe415('0x2f')]};});_0x1c1779[_0xe415('0x30')]=_[_0xe415('0x2b')](_0x1a551e,_0xe415('0x29'));_0x1c1779[_0xe415('0x31')]=_[_0xe415('0x32')](_0x7babe8[_0xe415('0x31')]);_0x1c1779[_0xe415('0x33')]=_[_0xe415('0x34')](_0x1c1779[_0xe415('0x30')],_0x1c1779[_0xe415('0x31')]);_0x46b5cc[_0xe415('0x35')]=_[_0xe415('0x34')](_0x1c1779[_0xe415('0x30')],qs[_0xe415('0x36')](_0x7babe8[_0xe415('0x31')][_0xe415('0x36')]));_0x46b5cc[_0xe415('0x35')]=_0x46b5cc[_0xe415('0x35')][_0xe415('0x37')]?_0x46b5cc[_0xe415('0x35')]:_0x1c1779['model'];if(!_0x7babe8[_0xe415('0x31')]['hasOwnProperty'](_0xe415('0x38'))){_0x46b5cc[_0xe415('0x1f')]=qs['limit'](_0x7babe8['query'][_0xe415('0x1f')]);_0x46b5cc[_0xe415('0x1d')]=qs[_0xe415('0x1d')](_0x7babe8['query'][_0xe415('0x1d')]);}_0x46b5cc[_0xe415('0x39')]=qs[_0xe415('0x3a')](_0x7babe8['query'][_0xe415('0x3a')]);_0x46b5cc[_0xe415('0x3b')]=qs[_0xe415('0x33')](_[_0xe415('0x3c')](_0x7babe8['query'],_0x1c1779[_0xe415('0x33')]),_0x1a551e);if(_0x7babe8[_0xe415('0x31')][_0xe415('0x3d')]){_0x46b5cc[_0xe415('0x3b')]=_[_0xe415('0x3e')](_0x46b5cc[_0xe415('0x3b')],{'$or':_[_0xe415('0x2b')](_0x1a551e,function(_0x1dfbaa){if(_0x1dfbaa[_0xe415('0x2e')]!==_0xe415('0x3f')){var _0x5a448c={};_0x5a448c[_0x1dfbaa[_0xe415('0x29')]]={'$like':'%'+_0x7babe8['query'][_0xe415('0x3d')]+'%'};return _0x5a448c;}})});}_0x46b5cc=_['merge']({},_0x46b5cc,_0x7babe8[_0xe415('0x40')]);var _0x1fd56d={'where':_0x46b5cc['where']};return db['SmsQueueReport'][_0xe415('0x20')](_0x1fd56d)['then'](function(_0xd00ebb){_0x3e40c5[_0xe415('0x20')]=_0xd00ebb;if(_0x7babe8['query'][_0xe415('0x41')]){_0x46b5cc[_0xe415('0x42')]=[{'all':!![]}];}return db[_0xe415('0x2c')][_0xe415('0x43')](_0x46b5cc);})[_0xe415('0x26')](function(_0x22a5a2){_0x3e40c5[_0xe415('0x44')]=_0x22a5a2;return _0x3e40c5;})[_0xe415('0x26')](respondWithFilteredResult(_0x34f79c,_0x46b5cc))[_0xe415('0x45')](handleError(_0x34f79c,null));};exports[_0xe415('0x46')]=function(_0x95fbf5,_0x5e3a4d){var _0x52db76={'raw':!![],'where':{'id':_0x95fbf5[_0xe415('0x47')]['id']}},_0x56247e={};_0x56247e['model']=_[_0xe415('0x32')](db[_0xe415('0x2c')][_0xe415('0x2d')]);_0x56247e[_0xe415('0x31')]=_[_0xe415('0x32')](_0x95fbf5[_0xe415('0x31')]);_0x56247e[_0xe415('0x33')]=_['intersection'](_0x56247e[_0xe415('0x30')],_0x56247e[_0xe415('0x31')]);_0x52db76[_0xe415('0x35')]=_[_0xe415('0x34')](_0x56247e[_0xe415('0x30')],qs[_0xe415('0x36')](_0x95fbf5[_0xe415('0x31')]['fields']));_0x52db76['attributes']=_0x52db76[_0xe415('0x35')][_0xe415('0x37')]?_0x52db76[_0xe415('0x35')]:_0x56247e[_0xe415('0x30')];if(_0x95fbf5[_0xe415('0x31')][_0xe415('0x41')]){_0x52db76['include']=[{'all':!![]}];}_0x52db76=_[_0xe415('0x3e')]({},_0x52db76,_0x95fbf5[_0xe415('0x40')]);return db[_0xe415('0x2c')]['find'](_0x52db76)[_0xe415('0x26')](handleEntityNotFound(_0x5e3a4d,null))['then'](respondWithResult(_0x5e3a4d,null))['catch'](handleError(_0x5e3a4d,null));};exports['create']=function(_0x25b233,_0x49c6e4){return db[_0xe415('0x2c')][_0xe415('0x48')](_0x25b233[_0xe415('0x49')],{})[_0xe415('0x26')](respondWithResult(_0x49c6e4,0xc9))[_0xe415('0x45')](handleError(_0x49c6e4,null));};exports[_0xe415('0x25')]=function(_0x23993a,_0x204d1f){if(_0x23993a[_0xe415('0x49')]['id']){delete _0x23993a[_0xe415('0x49')]['id'];}return db[_0xe415('0x2c')][_0xe415('0x4a')]({'where':{'id':_0x23993a[_0xe415('0x47')]['id']}})[_0xe415('0x26')](handleEntityNotFound(_0x204d1f,null))[_0xe415('0x26')](saveUpdates(_0x23993a[_0xe415('0x49')],null))['then'](respondWithResult(_0x204d1f,null))[_0xe415('0x45')](handleError(_0x204d1f,null));};exports[_0xe415('0x27')]=function(_0xd960f0,_0x5886e6){return db[_0xe415('0x2c')][_0xe415('0x4a')]({'where':{'id':_0xd960f0[_0xe415('0x47')]['id']}})[_0xe415('0x26')](handleEntityNotFound(_0x5886e6,null))[_0xe415('0x26')](removeEntity(_0x5886e6,null))[_0xe415('0x45')](handleError(_0x5886e6,null));};exports[_0xe415('0x4b')]=function(_0x5806c5,_0x3e28a2){return db[_0xe415('0x2c')][_0xe415('0x4b')]()['then'](respondWithResult(_0x3e28a2,null))[_0xe415('0x45')](handleError(_0x3e28a2,null));}; \ No newline at end of file +var _0x332b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','params','includeAll','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x11d301,_0x1a8010){var _0x27a0fe=function(_0x43bba7){while(--_0x43bba7){_0x11d301['push'](_0x11d301['shift']());}};_0x27a0fe(++_0x1a8010);}(_0x332b,0x1f0));var _0xb332=function(_0x1a5567,_0xc956cf){_0x1a5567=_0x1a5567-0x0;var _0x239dd8=_0x332b[_0x1a5567];return _0x239dd8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb332('0x0'));var zipdir=require(_0xb332('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb332('0x2'));var moment=require(_0xb332('0x3'));var BPromise=require(_0xb332('0x4'));var Mustache=require(_0xb332('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb332('0x6'));var csv=require(_0xb332('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb332('0x8'));var squel=require(_0xb332('0x9'));var crypto=require(_0xb332('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb332('0xb'));var toCsv=require(_0xb332('0x7'));var querystring=require(_0xb332('0xc'));var Papa=require(_0xb332('0xd'));var Redis=require(_0xb332('0xe'));var authService=require(_0xb332('0xf'));var qs=require(_0xb332('0x10'));var as=require(_0xb332('0x11'));var hardwareService=require(_0xb332('0x12'));var logger=require(_0xb332('0x13'))('api');var utils=require(_0xb332('0x14'));var config=require(_0xb332('0x15'));var licenseUtil=require(_0xb332('0x16'));var db=require(_0xb332('0x17'))['db'];function respondWithStatusCode(_0x7205bb,_0x179165){_0x179165=_0x179165||0xcc;return function(_0x2d24ab){if(_0x2d24ab){return _0x7205bb[_0xb332('0x18')](_0x179165);}return _0x7205bb[_0xb332('0x19')](_0x179165)[_0xb332('0x1a')]();};}function respondWithResult(_0x32f41b,_0xadea8e){_0xadea8e=_0xadea8e||0xc8;return function(_0x3efc7b){if(_0x3efc7b){return _0x32f41b[_0xb332('0x19')](_0xadea8e)[_0xb332('0x1b')](_0x3efc7b);}};}function respondWithFilteredResult(_0x388c37,_0x1fce5c){return function(_0xf15264){if(_0xf15264){var _0x143087=typeof _0x1fce5c[_0xb332('0x1c')]===_0xb332('0x1d')&&typeof _0x1fce5c['limit']===_0xb332('0x1d');var _0x1cc1cf=_0xf15264['count'];var _0x2f44fe=_0x143087?0x0:_0x1fce5c['offset'];var _0x4b2c73=_0x143087?_0xf15264[_0xb332('0x1e')]:_0x1fce5c[_0xb332('0x1c')]+_0x1fce5c[_0xb332('0x1f')];var _0x595837;if(_0x4b2c73>=_0x1cc1cf){_0x4b2c73=_0x1cc1cf;_0x595837=0xc8;}else{_0x595837=0xce;}_0x388c37['status'](_0x595837);return _0x388c37[_0xb332('0x20')](_0xb332('0x21'),_0x2f44fe+'-'+_0x4b2c73+'/'+_0x1cc1cf)[_0xb332('0x1b')](_0xf15264);}return null;};}function patchUpdates(_0x31c9ef){return function(_0x1a84c0){try{jsonpatch['apply'](_0x1a84c0,_0x31c9ef,!![]);}catch(_0x512a98){return BPromise[_0xb332('0x22')](_0x512a98);}return _0x1a84c0[_0xb332('0x23')]();};}function saveUpdates(_0x6c5379,_0x22a6b2){return function(_0x5f0304){if(_0x5f0304){return _0x5f0304[_0xb332('0x24')](_0x6c5379)[_0xb332('0x25')](function(_0x59ba45){return _0x59ba45;});}return null;};}function removeEntity(_0x26873b,_0x316491){return function(_0x4d9caa){if(_0x4d9caa){return _0x4d9caa[_0xb332('0x26')]()[_0xb332('0x25')](function(){_0x26873b[_0xb332('0x19')](0xcc)[_0xb332('0x1a')]();});}};}function handleEntityNotFound(_0x5a9ba5,_0x7224a){return function(_0x1688fe){if(!_0x1688fe){_0x5a9ba5[_0xb332('0x18')](0x194);}return _0x1688fe;};}function handleError(_0x227711,_0x273313){_0x273313=_0x273313||0x1f4;return function(_0x11d7d4){logger[_0xb332('0x27')](_0x11d7d4[_0xb332('0x28')]);if(_0x11d7d4[_0xb332('0x29')]){delete _0x11d7d4[_0xb332('0x29')];}_0x227711[_0xb332('0x19')](_0x273313)['send'](_0x11d7d4);};}exports[_0xb332('0x2a')]=function(_0x420665,_0x27d5a5){var _0x493d98={},_0x5f346b={},_0x1248c5={'count':0x0,'rows':[]};var _0x505b3a=_[_0xb332('0x2b')](db[_0xb332('0x2c')][_0xb332('0x2d')],function(_0x22e1fe){return{'name':_0x22e1fe[_0xb332('0x2e')],'type':_0x22e1fe['type']['key']};});_0x5f346b[_0xb332('0x2f')]=_[_0xb332('0x2b')](_0x505b3a,_0xb332('0x29'));_0x5f346b['query']=_[_0xb332('0x30')](_0x420665[_0xb332('0x31')]);_0x5f346b[_0xb332('0x32')]=_[_0xb332('0x33')](_0x5f346b[_0xb332('0x2f')],_0x5f346b[_0xb332('0x31')]);_0x493d98[_0xb332('0x34')]=_[_0xb332('0x33')](_0x5f346b[_0xb332('0x2f')],qs[_0xb332('0x35')](_0x420665[_0xb332('0x31')]['fields']));_0x493d98[_0xb332('0x34')]=_0x493d98['attributes'][_0xb332('0x36')]?_0x493d98[_0xb332('0x34')]:_0x5f346b[_0xb332('0x2f')];if(!_0x420665[_0xb332('0x31')][_0xb332('0x37')]('nolimit')){_0x493d98[_0xb332('0x1f')]=qs['limit'](_0x420665[_0xb332('0x31')][_0xb332('0x1f')]);_0x493d98[_0xb332('0x1c')]=qs[_0xb332('0x1c')](_0x420665[_0xb332('0x31')]['offset']);}_0x493d98[_0xb332('0x38')]=qs[_0xb332('0x39')](_0x420665[_0xb332('0x31')][_0xb332('0x39')]);_0x493d98[_0xb332('0x3a')]=qs[_0xb332('0x32')](_[_0xb332('0x3b')](_0x420665[_0xb332('0x31')],_0x5f346b[_0xb332('0x32')]),_0x505b3a);if(_0x420665['query'][_0xb332('0x3c')]){_0x493d98['where']=_[_0xb332('0x3d')](_0x493d98[_0xb332('0x3a')],{'$or':_[_0xb332('0x2b')](_0x505b3a,function(_0x1fd16f){if(_0x1fd16f[_0xb332('0x3e')]!==_0xb332('0x3f')){var _0x62249b={};_0x62249b[_0x1fd16f['name']]={'$like':'%'+_0x420665[_0xb332('0x31')]['filter']+'%'};return _0x62249b;}})});}_0x493d98=_[_0xb332('0x3d')]({},_0x493d98,_0x420665['options']);var _0x3edc24={'where':_0x493d98[_0xb332('0x3a')]};return db[_0xb332('0x2c')]['count'](_0x3edc24)[_0xb332('0x25')](function(_0x3b1bd7){_0x1248c5[_0xb332('0x1e')]=_0x3b1bd7;if(_0x420665[_0xb332('0x31')]['includeAll']){_0x493d98[_0xb332('0x40')]=[{'all':!![]}];}return db[_0xb332('0x2c')][_0xb332('0x41')](_0x493d98);})[_0xb332('0x25')](function(_0x1622ad){_0x1248c5[_0xb332('0x42')]=_0x1622ad;return _0x1248c5;})[_0xb332('0x25')](respondWithFilteredResult(_0x27d5a5,_0x493d98))[_0xb332('0x43')](handleError(_0x27d5a5,null));};exports['show']=function(_0x4bb50e,_0xd1bfbf){var _0x1b5057={'raw':!![],'where':{'id':_0x4bb50e[_0xb332('0x44')]['id']}},_0x29df86={};_0x29df86[_0xb332('0x2f')]=_[_0xb332('0x30')](db['SmsQueueReport'][_0xb332('0x2d')]);_0x29df86[_0xb332('0x31')]=_[_0xb332('0x30')](_0x4bb50e[_0xb332('0x31')]);_0x29df86[_0xb332('0x32')]=_[_0xb332('0x33')](_0x29df86[_0xb332('0x2f')],_0x29df86['query']);_0x1b5057[_0xb332('0x34')]=_['intersection'](_0x29df86[_0xb332('0x2f')],qs['fields'](_0x4bb50e[_0xb332('0x31')][_0xb332('0x35')]));_0x1b5057[_0xb332('0x34')]=_0x1b5057['attributes'][_0xb332('0x36')]?_0x1b5057[_0xb332('0x34')]:_0x29df86[_0xb332('0x2f')];if(_0x4bb50e[_0xb332('0x31')][_0xb332('0x45')]){_0x1b5057[_0xb332('0x40')]=[{'all':!![]}];}_0x1b5057=_[_0xb332('0x3d')]({},_0x1b5057,_0x4bb50e['options']);return db[_0xb332('0x2c')]['find'](_0x1b5057)[_0xb332('0x25')](handleEntityNotFound(_0xd1bfbf,null))[_0xb332('0x25')](respondWithResult(_0xd1bfbf,null))['catch'](handleError(_0xd1bfbf,null));};exports[_0xb332('0x46')]=function(_0x43accc,_0x314da5){return db[_0xb332('0x2c')][_0xb332('0x46')](_0x43accc[_0xb332('0x47')],{})[_0xb332('0x25')](respondWithResult(_0x314da5,0xc9))[_0xb332('0x43')](handleError(_0x314da5,null));};exports[_0xb332('0x24')]=function(_0x3ab538,_0x401eff){if(_0x3ab538[_0xb332('0x47')]['id']){delete _0x3ab538[_0xb332('0x47')]['id'];}return db[_0xb332('0x2c')][_0xb332('0x48')]({'where':{'id':_0x3ab538[_0xb332('0x44')]['id']}})['then'](handleEntityNotFound(_0x401eff,null))[_0xb332('0x25')](saveUpdates(_0x3ab538['body'],null))[_0xb332('0x25')](respondWithResult(_0x401eff,null))[_0xb332('0x43')](handleError(_0x401eff,null));};exports[_0xb332('0x26')]=function(_0x1b9ae9,_0x4aece2){return db[_0xb332('0x2c')]['find']({'where':{'id':_0x1b9ae9[_0xb332('0x44')]['id']}})[_0xb332('0x25')](handleEntityNotFound(_0x4aece2,null))[_0xb332('0x25')](removeEntity(_0x4aece2,null))[_0xb332('0x43')](handleError(_0x4aece2,null));};exports[_0xb332('0x49')]=function(_0xae8184,_0x2df64c){return db[_0xb332('0x2c')][_0xb332('0x49')]()[_0xb332('0x25')](respondWithResult(_0x2df64c,null))[_0xb332('0x43')](handleError(_0x2df64c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b8da22d..0c48911 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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x5efc65,_0x2aa00d){var _0x475e4d=function(_0x3d9e61){while(--_0x3d9e61){_0x5efc65['push'](_0x5efc65['shift']());}};_0x475e4d(++_0x2aa00d);}(_0x70e0,0x17b));var _0x070e=function(_0x393337,_0x1f9b3a){_0x393337=_0x393337-0x0;var _0x4cfe87=_0x70e0[_0x393337];return _0x4cfe87;};'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']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xe706,0xa3));var _0x6e70=function(_0x3763da,_0x58158b){_0x3763da=_0x3763da-0x0;var _0x5d192f=_0xe706[_0x3763da];return _0x5d192f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 59537a4..42d830c 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 _0x3dcd=['result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','body','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x318b97,_0x3e0753){var _0x56c589=function(_0x4eb285){while(--_0x4eb285){_0x318b97['push'](_0x318b97['shift']());}};_0x56c589(++_0x3e0753);}(_0x3dcd,0x1bd));var _0xd3dc=function(_0xe66e24,_0x3688c1){_0xe66e24=_0xe66e24-0x0;var _0x586475=_0x3dcd[_0xe66e24];return _0x586475;};'use strict';var _=require(_0xd3dc('0x0'));var util=require('util');var moment=require(_0xd3dc('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3dc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3dc('0x3'))['db'];var utils=require(_0xd3dc('0x4'));var logger=require(_0xd3dc('0x5'))('rpc');var config=require(_0xd3dc('0x6'));var jayson=require(_0xd3dc('0x7'));var client=jayson[_0xd3dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x223932,_0x170912,_0x15194c){return new BPromise(function(_0x2e7000,_0x36a895){return client['request'](_0x223932,_0x15194c)[_0xd3dc('0x9')](function(_0x507954){logger[_0xd3dc('0xa')](_0xd3dc('0xb'),_0x170912,'request\x20sent');logger[_0xd3dc('0xc')](_0xd3dc('0xd'),_0x170912,_0xd3dc('0xe'),JSON[_0xd3dc('0xf')](_0x507954));if(_0x507954[_0xd3dc('0x10')]){if(_0x507954[_0xd3dc('0x10')][_0xd3dc('0x11')]===0x1f4){logger[_0xd3dc('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x170912,_0x507954[_0xd3dc('0x10')][_0xd3dc('0x12')]);return _0x36a895(_0x507954[_0xd3dc('0x10')][_0xd3dc('0x12')]);}logger[_0xd3dc('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x170912,_0x507954['error']['message']);return _0x2e7000(_0x507954[_0xd3dc('0x10')]['message']);}else{logger['info'](_0xd3dc('0xb'),_0x170912,_0xd3dc('0xe'));_0x2e7000(_0x507954[_0xd3dc('0x13')]['message']);}})[_0xd3dc('0x14')](function(_0x1d8dd7){logger['error'](_0xd3dc('0xb'),_0x170912,_0x1d8dd7);_0x36a895(_0x1d8dd7);});});}exports[_0xd3dc('0x15')]=function(_0x42a310){var _0x588827=this;return new Promise(function(_0x2513c0,_0xb40b96){return db[_0xd3dc('0x16')][_0xd3dc('0x17')](_0x42a310['body'],{'raw':_0x42a310['options']?_0x42a310[_0xd3dc('0x18')][_0xd3dc('0x19')]===undefined?!![]:![]:!![]})[_0xd3dc('0x9')](function(_0x450300){logger[_0xd3dc('0xa')](_0xd3dc('0x15'),_0x42a310);logger[_0xd3dc('0xc')](_0xd3dc('0x15'),_0x42a310,JSON[_0xd3dc('0xf')](_0x450300));_0x2513c0(_0x450300);})[_0xd3dc('0x14')](function(_0x36b721){logger['error'](_0xd3dc('0x15'),_0x36b721[_0xd3dc('0x12')],_0x42a310);_0xb40b96(_0x588827[_0xd3dc('0x10')](0x1f4,_0x36b721[_0xd3dc('0x12')]));});});};exports[_0xd3dc('0x1a')]=function(_0x1ad4e4){var _0x2e84cf=this;return new Promise(function(_0x56ee07,_0x3b7fe9){return db[_0xd3dc('0x16')]['update'](_0x1ad4e4[_0xd3dc('0x1b')],{'raw':_0x1ad4e4[_0xd3dc('0x18')]?_0x1ad4e4[_0xd3dc('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad4e4['options']?_0x1ad4e4[_0xd3dc('0x18')]['where']||null:null,'attributes':_0x1ad4e4[_0xd3dc('0x18')]?_0x1ad4e4[_0xd3dc('0x18')][_0xd3dc('0x1c')]||null:null,'limit':_0x1ad4e4[_0xd3dc('0x18')]?_0x1ad4e4[_0xd3dc('0x18')]['limit']||null:null})[_0xd3dc('0x9')](function(_0x53a78e){logger[_0xd3dc('0xa')](_0xd3dc('0x1a'),_0x1ad4e4);logger[_0xd3dc('0xc')](_0xd3dc('0x1a'),_0x1ad4e4,JSON[_0xd3dc('0xf')](_0x53a78e));_0x56ee07(_0x53a78e);})[_0xd3dc('0x14')](function(_0x405ace){logger[_0xd3dc('0x10')](_0xd3dc('0x1a'),_0x405ace['message'],_0x1ad4e4);_0x3b7fe9(_0x2e84cf['error'](0x1f4,_0x405ace[_0xd3dc('0x12')]));});});}; \ No newline at end of file +var _0xfe64=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSmsQueueReport','body','options','SmsQueueReport','update','where','attributes','limit','UpdateSmsQueueReport','lodash','bluebird'];(function(_0x86ba06,_0x2e50d9){var _0xafb44a=function(_0x1dd5cd){while(--_0x1dd5cd){_0x86ba06['push'](_0x86ba06['shift']());}};_0xafb44a(++_0x2e50d9);}(_0xfe64,0x1cf));var _0x4fe6=function(_0x5739ed,_0x4dd400){_0x5739ed=_0x5739ed-0x0;var _0x54a634=_0xfe64[_0x5739ed];return _0x54a634;};'use strict';var _=require(_0x4fe6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4fe6('0x1'));var rs=require(_0x4fe6('0x2'));var fs=require('fs');var Redis=require(_0x4fe6('0x3'));var db=require(_0x4fe6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fe6('0x5'))('rpc');var config=require(_0x4fe6('0x6'));var jayson=require(_0x4fe6('0x7'));var client=jayson[_0x4fe6('0x8')][_0x4fe6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c82c5,_0x3eff7e,_0x15123f){return new BPromise(function(_0xe66a13,_0xb5c424){return client[_0x4fe6('0xa')](_0x1c82c5,_0x15123f)[_0x4fe6('0xb')](function(_0xeea0de){logger[_0x4fe6('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x3eff7e,'request\x20sent');logger[_0x4fe6('0xd')](_0x4fe6('0xe'),_0x3eff7e,'request\x20sent',JSON[_0x4fe6('0xf')](_0xeea0de));if(_0xeea0de[_0x4fe6('0x10')]){if(_0xeea0de[_0x4fe6('0x10')]['code']===0x1f4){logger[_0x4fe6('0x10')](_0x4fe6('0x11'),_0x3eff7e,_0xeea0de[_0x4fe6('0x10')][_0x4fe6('0x12')]);return _0xb5c424(_0xeea0de['error'][_0x4fe6('0x12')]);}logger[_0x4fe6('0x10')](_0x4fe6('0x11'),_0x3eff7e,_0xeea0de['error'][_0x4fe6('0x12')]);return _0xe66a13(_0xeea0de[_0x4fe6('0x10')][_0x4fe6('0x12')]);}else{logger[_0x4fe6('0xc')](_0x4fe6('0x11'),_0x3eff7e,_0x4fe6('0x13'));_0xe66a13(_0xeea0de[_0x4fe6('0x14')][_0x4fe6('0x12')]);}})[_0x4fe6('0x15')](function(_0x1f59e4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x3eff7e,_0x1f59e4);_0xb5c424(_0x1f59e4);});});}exports[_0x4fe6('0x16')]=function(_0x33be9d){var _0x174eed=this;return new Promise(function(_0x5d49ad,_0x1fc941){return db['SmsQueueReport']['create'](_0x33be9d[_0x4fe6('0x17')],{'raw':_0x33be9d['options']?_0x33be9d[_0x4fe6('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4fe6('0xb')](function(_0x2aefce){logger['info'](_0x4fe6('0x16'),_0x33be9d);logger[_0x4fe6('0xd')](_0x4fe6('0x16'),_0x33be9d,JSON[_0x4fe6('0xf')](_0x2aefce));_0x5d49ad(_0x2aefce);})[_0x4fe6('0x15')](function(_0x49e8b8){logger[_0x4fe6('0x10')](_0x4fe6('0x16'),_0x49e8b8['message'],_0x33be9d);_0x1fc941(_0x174eed[_0x4fe6('0x10')](0x1f4,_0x49e8b8[_0x4fe6('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x41a7d3){var _0x2483e7=this;return new Promise(function(_0x5e834c,_0x1be8e0){return db[_0x4fe6('0x19')][_0x4fe6('0x1a')](_0x41a7d3[_0x4fe6('0x17')],{'raw':_0x41a7d3['options']?_0x41a7d3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41a7d3[_0x4fe6('0x18')]?_0x41a7d3['options'][_0x4fe6('0x1b')]||null:null,'attributes':_0x41a7d3[_0x4fe6('0x18')]?_0x41a7d3['options'][_0x4fe6('0x1c')]||null:null,'limit':_0x41a7d3[_0x4fe6('0x18')]?_0x41a7d3[_0x4fe6('0x18')][_0x4fe6('0x1d')]||null:null})[_0x4fe6('0xb')](function(_0x1bf53c){logger['info'](_0x4fe6('0x1e'),_0x41a7d3);logger[_0x4fe6('0xd')](_0x4fe6('0x1e'),_0x41a7d3,JSON[_0x4fe6('0xf')](_0x1bf53c));_0x5e834c(_0x1bf53c);})[_0x4fe6('0x15')](function(_0x363105){logger[_0x4fe6('0x10')](_0x4fe6('0x1e'),_0x363105['message'],_0x41a7d3);_0x1be8e0(_0x2483e7['error'](0x1f4,_0x363105[_0x4fe6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 93b2569..c05cdfc 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 _0x4300=['describe','/:id','show','post','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x4300,0x1a6));var _0x0430=function(_0x131895,_0x5b9ab8){_0x131895=_0x131895-0x0;var _0x1cae94=_0x4300[_0x131895];return _0x1cae94;};'use strict';var multer=require(_0x0430('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0430('0x1')]();var fs_extra=require(_0x0430('0x2'));var auth=require(_0x0430('0x3'));var interaction=require(_0x0430('0x4'));var config=require(_0x0430('0x5'));var controller=require('./smsTransferReport.controller');router[_0x0430('0x6')]('/',auth['isAuthenticated'](),controller[_0x0430('0x7')]);router['get'](_0x0430('0x8'),auth[_0x0430('0x9')](),controller[_0x0430('0xa')]);router[_0x0430('0x6')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xc')]);router[_0x0430('0xd')]('/',auth[_0x0430('0x9')](),controller['create']);router[_0x0430('0xe')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xf')]);router[_0x0430('0x10')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0xcca7,0x1aa));var _0x7cca=function(_0x3c5fd8,_0x25457d){_0x3c5fd8=_0x3c5fd8-0x0;var _0x4130bb=_0xcca7[_0x3c5fd8];return _0x4130bb;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index f13811e..dab5cd9 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x2eebfa,_0x2b23fd){var _0xdb8044=function(_0x3f11e0){while(--_0x3f11e0){_0x2eebfa['push'](_0x2eebfa['shift']());}};_0xdb8044(++_0x2b23fd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x4b84[_0x12e073];return _0x267748;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x21cbdd,_0x4175e3){_0x21cbdd=_0x21cbdd-0x0;var _0x381c0a=_0xb43b[_0x21cbdd];return _0x381c0a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9718c23..b968607 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 _0x354a=['count','offset','set','apply','save','update','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x264ef7,_0x581221){var _0x8e0109=function(_0x472196){while(--_0x472196){_0x264ef7['push'](_0x264ef7['shift']());}};_0x8e0109(++_0x581221);}(_0x354a,0x1ec));var _0xa354=function(_0x1cb455,_0x183114){_0x1cb455=_0x1cb455-0x0;var _0x5f1d53=_0x354a[_0x1cb455];return _0x5f1d53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa354('0x0'));var zipdir=require(_0xa354('0x1'));var jsonpatch=require(_0xa354('0x2'));var rp=require(_0xa354('0x3'));var moment=require(_0xa354('0x4'));var BPromise=require(_0xa354('0x5'));var Mustache=require(_0xa354('0x6'));var util=require(_0xa354('0x7'));var path=require(_0xa354('0x8'));var sox=require(_0xa354('0x9'));var csv=require(_0xa354('0xa'));var ejs=require(_0xa354('0xb'));var fs=require('fs');var fs_extra=require(_0xa354('0xc'));var _=require(_0xa354('0xd'));var squel=require('squel');var crypto=require(_0xa354('0xe'));var jsforce=require(_0xa354('0xf'));var deskjs=require(_0xa354('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa354('0x11'));var Papa=require(_0xa354('0x12'));var Redis=require(_0xa354('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa354('0x14'));var as=require(_0xa354('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa354('0x16'))(_0xa354('0x17'));var utils=require(_0xa354('0x18'));var config=require(_0xa354('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa354('0x1a'))['db'];function respondWithStatusCode(_0x54507c,_0x16d943){_0x16d943=_0x16d943||0xcc;return function(_0x317082){if(_0x317082){return _0x54507c[_0xa354('0x1b')](_0x16d943);}return _0x54507c[_0xa354('0x1c')](_0x16d943)[_0xa354('0x1d')]();};}function respondWithResult(_0x19d4e6,_0x1250c5){_0x1250c5=_0x1250c5||0xc8;return function(_0x18c18e){if(_0x18c18e){return _0x19d4e6[_0xa354('0x1c')](_0x1250c5)[_0xa354('0x1e')](_0x18c18e);}};}function respondWithFilteredResult(_0x186c8d,_0x10aa3d){return function(_0x1dcd7e){if(_0x1dcd7e){var _0x53e296=typeof _0x10aa3d['offset']===_0xa354('0x1f')&&typeof _0x10aa3d[_0xa354('0x20')]===_0xa354('0x1f');var _0x57ed2c=_0x1dcd7e[_0xa354('0x21')];var _0x5ed803=_0x53e296?0x0:_0x10aa3d[_0xa354('0x22')];var _0x316b53=_0x53e296?_0x1dcd7e[_0xa354('0x21')]:_0x10aa3d['offset']+_0x10aa3d[_0xa354('0x20')];var _0x1fd39d;if(_0x316b53>=_0x57ed2c){_0x316b53=_0x57ed2c;_0x1fd39d=0xc8;}else{_0x1fd39d=0xce;}_0x186c8d[_0xa354('0x1c')](_0x1fd39d);return _0x186c8d[_0xa354('0x23')]('Content-Range',_0x5ed803+'-'+_0x316b53+'/'+_0x57ed2c)['json'](_0x1dcd7e);}return null;};}function patchUpdates(_0x1e524e){return function(_0x5bdedc){try{jsonpatch[_0xa354('0x24')](_0x5bdedc,_0x1e524e,!![]);}catch(_0x428d9c){return BPromise['reject'](_0x428d9c);}return _0x5bdedc[_0xa354('0x25')]();};}function saveUpdates(_0x14f6f2,_0x55af7d){return function(_0x44da9e){if(_0x44da9e){return _0x44da9e[_0xa354('0x26')](_0x14f6f2)[_0xa354('0x27')](function(_0x5cb9cb){return _0x5cb9cb;});}return null;};}function removeEntity(_0x1dce82,_0x20fcae){return function(_0x2f56ed){if(_0x2f56ed){return _0x2f56ed[_0xa354('0x28')]()['then'](function(){_0x1dce82[_0xa354('0x1c')](0xcc)[_0xa354('0x1d')]();});}};}function handleEntityNotFound(_0x4f3a1b,_0x2842d8){return function(_0x526f3b){if(!_0x526f3b){_0x4f3a1b[_0xa354('0x1b')](0x194);}return _0x526f3b;};}function handleError(_0xe7ae5b,_0x254cca){_0x254cca=_0x254cca||0x1f4;return function(_0x25c81f){logger[_0xa354('0x29')](_0x25c81f[_0xa354('0x2a')]);if(_0x25c81f['name']){delete _0x25c81f[_0xa354('0x2b')];}_0xe7ae5b[_0xa354('0x1c')](_0x254cca)['send'](_0x25c81f);};}exports['index']=function(_0x1269c9,_0x625f55){var _0x99e03={},_0x4c616c={},_0x38a440={'count':0x0,'rows':[]};var _0x2dcd39=_[_0xa354('0x2c')](db[_0xa354('0x2d')][_0xa354('0x2e')],function(_0x3a26e3){return{'name':_0x3a26e3[_0xa354('0x2f')],'type':_0x3a26e3[_0xa354('0x30')][_0xa354('0x31')]};});_0x4c616c[_0xa354('0x32')]=_['map'](_0x2dcd39,'name');_0x4c616c[_0xa354('0x33')]=_[_0xa354('0x34')](_0x1269c9[_0xa354('0x33')]);_0x4c616c[_0xa354('0x35')]=_['intersection'](_0x4c616c['model'],_0x4c616c[_0xa354('0x33')]);_0x99e03[_0xa354('0x36')]=_[_0xa354('0x37')](_0x4c616c[_0xa354('0x32')],qs[_0xa354('0x38')](_0x1269c9[_0xa354('0x33')][_0xa354('0x38')]));_0x99e03[_0xa354('0x36')]=_0x99e03[_0xa354('0x36')][_0xa354('0x39')]?_0x99e03[_0xa354('0x36')]:_0x4c616c[_0xa354('0x32')];if(!_0x1269c9[_0xa354('0x33')][_0xa354('0x3a')]('nolimit')){_0x99e03[_0xa354('0x20')]=qs['limit'](_0x1269c9['query']['limit']);_0x99e03[_0xa354('0x22')]=qs['offset'](_0x1269c9[_0xa354('0x33')][_0xa354('0x22')]);}_0x99e03[_0xa354('0x3b')]=qs[_0xa354('0x3c')](_0x1269c9[_0xa354('0x33')]['sort']);_0x99e03['where']=qs[_0xa354('0x35')](_[_0xa354('0x3d')](_0x1269c9['query'],_0x4c616c[_0xa354('0x35')]),_0x2dcd39);if(_0x1269c9[_0xa354('0x33')][_0xa354('0x3e')]){_0x99e03['where']=_[_0xa354('0x3f')](_0x99e03[_0xa354('0x40')],{'$or':_['map'](_0x2dcd39,function(_0x43eccb){if(_0x43eccb[_0xa354('0x30')]!==_0xa354('0x41')){var _0x4fdc61={};_0x4fdc61[_0x43eccb[_0xa354('0x2b')]]={'$like':'%'+_0x1269c9[_0xa354('0x33')][_0xa354('0x3e')]+'%'};return _0x4fdc61;}})});}_0x99e03=_['merge']({},_0x99e03,_0x1269c9['options']);var _0x47577e={'where':_0x99e03[_0xa354('0x40')]};return db[_0xa354('0x2d')][_0xa354('0x21')](_0x47577e)['then'](function(_0x26bcee){_0x38a440[_0xa354('0x21')]=_0x26bcee;if(_0x1269c9[_0xa354('0x33')][_0xa354('0x42')]){_0x99e03['include']=[{'all':!![]}];}return db[_0xa354('0x2d')][_0xa354('0x43')](_0x99e03);})['then'](function(_0x509fca){_0x38a440['rows']=_0x509fca;return _0x38a440;})[_0xa354('0x27')](respondWithFilteredResult(_0x625f55,_0x99e03))[_0xa354('0x44')](handleError(_0x625f55,null));};exports[_0xa354('0x45')]=function(_0x462124,_0x2e16d6){var _0x4f2d9f={'raw':!![],'where':{'id':_0x462124[_0xa354('0x46')]['id']}},_0x5111bc={};_0x5111bc[_0xa354('0x32')]=_[_0xa354('0x34')](db[_0xa354('0x2d')][_0xa354('0x2e')]);_0x5111bc['query']=_[_0xa354('0x34')](_0x462124[_0xa354('0x33')]);_0x5111bc[_0xa354('0x35')]=_[_0xa354('0x37')](_0x5111bc[_0xa354('0x32')],_0x5111bc[_0xa354('0x33')]);_0x4f2d9f[_0xa354('0x36')]=_[_0xa354('0x37')](_0x5111bc[_0xa354('0x32')],qs['fields'](_0x462124['query']['fields']));_0x4f2d9f[_0xa354('0x36')]=_0x4f2d9f[_0xa354('0x36')][_0xa354('0x39')]?_0x4f2d9f['attributes']:_0x5111bc['model'];if(_0x462124[_0xa354('0x33')]['includeAll']){_0x4f2d9f['include']=[{'all':!![]}];}_0x4f2d9f=_['merge']({},_0x4f2d9f,_0x462124['options']);return db['SmsTransferReport'][_0xa354('0x47')](_0x4f2d9f)['then'](handleEntityNotFound(_0x2e16d6,null))[_0xa354('0x27')](respondWithResult(_0x2e16d6,null))[_0xa354('0x44')](handleError(_0x2e16d6,null));};exports[_0xa354('0x48')]=function(_0x5e5602,_0x2ab123){return db[_0xa354('0x2d')][_0xa354('0x48')](_0x5e5602[_0xa354('0x49')],{})[_0xa354('0x27')](respondWithResult(_0x2ab123,0xc9))['catch'](handleError(_0x2ab123,null));};exports[_0xa354('0x26')]=function(_0xf22461,_0x13a760){if(_0xf22461['body']['id']){delete _0xf22461[_0xa354('0x49')]['id'];}return db[_0xa354('0x2d')][_0xa354('0x47')]({'where':{'id':_0xf22461[_0xa354('0x46')]['id']}})['then'](handleEntityNotFound(_0x13a760,null))[_0xa354('0x27')](saveUpdates(_0xf22461['body'],null))['then'](respondWithResult(_0x13a760,null))[_0xa354('0x44')](handleError(_0x13a760,null));};exports[_0xa354('0x28')]=function(_0x46bf83,_0x4f17eb){return db[_0xa354('0x2d')][_0xa354('0x47')]({'where':{'id':_0x46bf83[_0xa354('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f17eb,null))[_0xa354('0x27')](removeEntity(_0x4f17eb,null))[_0xa354('0x44')](handleError(_0x4f17eb,null));};exports['describe']=function(_0x182d9c,_0x341bf7){return db[_0xa354('0x2d')][_0xa354('0x4a')]()[_0xa354('0x27')](respondWithResult(_0x341bf7,null))[_0xa354('0x44')](handleError(_0x341bf7,null));}; \ No newline at end of file +var _0x2d66=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','order','filter','VIRTUAL','where','count','include','findAll','rows','show','params','includeAll','merge','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3ff842,_0x5d4dae){var _0xd11117=function(_0x50e170){while(--_0x50e170){_0x3ff842['push'](_0x3ff842['shift']());}};_0xd11117(++_0x5d4dae);}(_0x2d66,0x1b3));var _0x62d6=function(_0x4b0166,_0x30d150){_0x4b0166=_0x4b0166-0x0;var _0x250473=_0x2d66[_0x4b0166];return _0x250473;};'use strict';var emlformat=require(_0x62d6('0x0'));var rimraf=require(_0x62d6('0x1'));var zipdir=require(_0x62d6('0x2'));var jsonpatch=require(_0x62d6('0x3'));var rp=require(_0x62d6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62d6('0x5'));var util=require(_0x62d6('0x6'));var path=require(_0x62d6('0x7'));var sox=require(_0x62d6('0x8'));var csv=require(_0x62d6('0x9'));var ejs=require(_0x62d6('0xa'));var fs=require('fs');var fs_extra=require(_0x62d6('0xb'));var _=require(_0x62d6('0xc'));var squel=require(_0x62d6('0xd'));var crypto=require(_0x62d6('0xe'));var jsforce=require(_0x62d6('0xf'));var deskjs=require(_0x62d6('0x10'));var toCsv=require(_0x62d6('0x9'));var querystring=require(_0x62d6('0x11'));var Papa=require(_0x62d6('0x12'));var Redis=require(_0x62d6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x62d6('0x14'));var as=require(_0x62d6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62d6('0x16'))(_0x62d6('0x17'));var utils=require('../../config/utils');var config=require(_0x62d6('0x18'));var licenseUtil=require(_0x62d6('0x19'));var db=require(_0x62d6('0x1a'))['db'];function respondWithStatusCode(_0x3c16ab,_0x36847b){_0x36847b=_0x36847b||0xcc;return function(_0x4ce527){if(_0x4ce527){return _0x3c16ab[_0x62d6('0x1b')](_0x36847b);}return _0x3c16ab[_0x62d6('0x1c')](_0x36847b)[_0x62d6('0x1d')]();};}function respondWithResult(_0x4a2844,_0x220163){_0x220163=_0x220163||0xc8;return function(_0x4d2ba4){if(_0x4d2ba4){return _0x4a2844[_0x62d6('0x1c')](_0x220163)[_0x62d6('0x1e')](_0x4d2ba4);}};}function respondWithFilteredResult(_0x522cba,_0x401989){return function(_0xaa5319){if(_0xaa5319){var _0x18b2a4=typeof _0x401989['offset']===_0x62d6('0x1f')&&typeof _0x401989[_0x62d6('0x20')]==='undefined';var _0x43bcc5=_0xaa5319['count'];var _0x34f21d=_0x18b2a4?0x0:_0x401989[_0x62d6('0x21')];var _0x359d50=_0x18b2a4?_0xaa5319['count']:_0x401989[_0x62d6('0x21')]+_0x401989[_0x62d6('0x20')];var _0x44efff;if(_0x359d50>=_0x43bcc5){_0x359d50=_0x43bcc5;_0x44efff=0xc8;}else{_0x44efff=0xce;}_0x522cba[_0x62d6('0x1c')](_0x44efff);return _0x522cba[_0x62d6('0x22')](_0x62d6('0x23'),_0x34f21d+'-'+_0x359d50+'/'+_0x43bcc5)[_0x62d6('0x1e')](_0xaa5319);}return null;};}function patchUpdates(_0x3091c4){return function(_0x526ee7){try{jsonpatch[_0x62d6('0x24')](_0x526ee7,_0x3091c4,!![]);}catch(_0x5e687b){return BPromise[_0x62d6('0x25')](_0x5e687b);}return _0x526ee7[_0x62d6('0x26')]();};}function saveUpdates(_0x571db7,_0xeee6b8){return function(_0x4f3a64){if(_0x4f3a64){return _0x4f3a64[_0x62d6('0x27')](_0x571db7)[_0x62d6('0x28')](function(_0x17b92f){return _0x17b92f;});}return null;};}function removeEntity(_0x93ad01,_0x2c231f){return function(_0x2092c0){if(_0x2092c0){return _0x2092c0['destroy']()[_0x62d6('0x28')](function(){_0x93ad01['status'](0xcc)[_0x62d6('0x1d')]();});}};}function handleEntityNotFound(_0x2024bb,_0x557810){return function(_0x4ddbc4){if(!_0x4ddbc4){_0x2024bb[_0x62d6('0x1b')](0x194);}return _0x4ddbc4;};}function handleError(_0x36edc7,_0x35b882){_0x35b882=_0x35b882||0x1f4;return function(_0x2f48ba){logger[_0x62d6('0x29')](_0x2f48ba[_0x62d6('0x2a')]);if(_0x2f48ba['name']){delete _0x2f48ba[_0x62d6('0x2b')];}_0x36edc7[_0x62d6('0x1c')](_0x35b882)[_0x62d6('0x2c')](_0x2f48ba);};}exports[_0x62d6('0x2d')]=function(_0x40edb3,_0x43a88a){var _0x4457f1={},_0x18909e={},_0x338ceb={'count':0x0,'rows':[]};var _0x50901e=_[_0x62d6('0x2e')](db[_0x62d6('0x2f')][_0x62d6('0x30')],function(_0x57a412){return{'name':_0x57a412['fieldName'],'type':_0x57a412['type'][_0x62d6('0x31')]};});_0x18909e[_0x62d6('0x32')]=_[_0x62d6('0x2e')](_0x50901e,'name');_0x18909e[_0x62d6('0x33')]=_[_0x62d6('0x34')](_0x40edb3[_0x62d6('0x33')]);_0x18909e[_0x62d6('0x35')]=_['intersection'](_0x18909e[_0x62d6('0x32')],_0x18909e['query']);_0x4457f1[_0x62d6('0x36')]=_[_0x62d6('0x37')](_0x18909e['model'],qs[_0x62d6('0x38')](_0x40edb3['query'][_0x62d6('0x38')]));_0x4457f1[_0x62d6('0x36')]=_0x4457f1[_0x62d6('0x36')][_0x62d6('0x39')]?_0x4457f1[_0x62d6('0x36')]:_0x18909e[_0x62d6('0x32')];if(!_0x40edb3[_0x62d6('0x33')]['hasOwnProperty']('nolimit')){_0x4457f1['limit']=qs[_0x62d6('0x20')](_0x40edb3['query'][_0x62d6('0x20')]);_0x4457f1[_0x62d6('0x21')]=qs[_0x62d6('0x21')](_0x40edb3[_0x62d6('0x33')][_0x62d6('0x21')]);}_0x4457f1[_0x62d6('0x3a')]=qs['sort'](_0x40edb3[_0x62d6('0x33')]['sort']);_0x4457f1['where']=qs['filters'](_['pick'](_0x40edb3[_0x62d6('0x33')],_0x18909e[_0x62d6('0x35')]),_0x50901e);if(_0x40edb3['query'][_0x62d6('0x3b')]){_0x4457f1['where']=_['merge'](_0x4457f1['where'],{'$or':_['map'](_0x50901e,function(_0x4a03f9){if(_0x4a03f9['type']!==_0x62d6('0x3c')){var _0x15295b={};_0x15295b[_0x4a03f9[_0x62d6('0x2b')]]={'$like':'%'+_0x40edb3[_0x62d6('0x33')][_0x62d6('0x3b')]+'%'};return _0x15295b;}})});}_0x4457f1=_['merge']({},_0x4457f1,_0x40edb3['options']);var _0xbd8153={'where':_0x4457f1[_0x62d6('0x3d')]};return db[_0x62d6('0x2f')][_0x62d6('0x3e')](_0xbd8153)[_0x62d6('0x28')](function(_0x3c4759){_0x338ceb['count']=_0x3c4759;if(_0x40edb3[_0x62d6('0x33')]['includeAll']){_0x4457f1[_0x62d6('0x3f')]=[{'all':!![]}];}return db[_0x62d6('0x2f')][_0x62d6('0x40')](_0x4457f1);})[_0x62d6('0x28')](function(_0x2e304b){_0x338ceb[_0x62d6('0x41')]=_0x2e304b;return _0x338ceb;})[_0x62d6('0x28')](respondWithFilteredResult(_0x43a88a,_0x4457f1))['catch'](handleError(_0x43a88a,null));};exports[_0x62d6('0x42')]=function(_0xffc040,_0x36d879){var _0xf59d06={'raw':!![],'where':{'id':_0xffc040[_0x62d6('0x43')]['id']}},_0x164ba6={};_0x164ba6[_0x62d6('0x32')]=_[_0x62d6('0x34')](db[_0x62d6('0x2f')][_0x62d6('0x30')]);_0x164ba6[_0x62d6('0x33')]=_[_0x62d6('0x34')](_0xffc040['query']);_0x164ba6[_0x62d6('0x35')]=_[_0x62d6('0x37')](_0x164ba6[_0x62d6('0x32')],_0x164ba6[_0x62d6('0x33')]);_0xf59d06['attributes']=_[_0x62d6('0x37')](_0x164ba6[_0x62d6('0x32')],qs['fields'](_0xffc040[_0x62d6('0x33')][_0x62d6('0x38')]));_0xf59d06[_0x62d6('0x36')]=_0xf59d06[_0x62d6('0x36')]['length']?_0xf59d06[_0x62d6('0x36')]:_0x164ba6[_0x62d6('0x32')];if(_0xffc040[_0x62d6('0x33')][_0x62d6('0x44')]){_0xf59d06[_0x62d6('0x3f')]=[{'all':!![]}];}_0xf59d06=_[_0x62d6('0x45')]({},_0xf59d06,_0xffc040[_0x62d6('0x46')]);return db[_0x62d6('0x2f')]['find'](_0xf59d06)[_0x62d6('0x28')](handleEntityNotFound(_0x36d879,null))['then'](respondWithResult(_0x36d879,null))[_0x62d6('0x47')](handleError(_0x36d879,null));};exports[_0x62d6('0x48')]=function(_0x320ad8,_0x38832e){return db[_0x62d6('0x2f')]['create'](_0x320ad8[_0x62d6('0x49')],{})[_0x62d6('0x28')](respondWithResult(_0x38832e,0xc9))[_0x62d6('0x47')](handleError(_0x38832e,null));};exports[_0x62d6('0x27')]=function(_0x5bbebb,_0x2048fd){if(_0x5bbebb[_0x62d6('0x49')]['id']){delete _0x5bbebb[_0x62d6('0x49')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x5bbebb[_0x62d6('0x43')]['id']}})[_0x62d6('0x28')](handleEntityNotFound(_0x2048fd,null))['then'](saveUpdates(_0x5bbebb['body'],null))['then'](respondWithResult(_0x2048fd,null))[_0x62d6('0x47')](handleError(_0x2048fd,null));};exports['destroy']=function(_0x10abdb,_0x3d00ca){return db[_0x62d6('0x2f')][_0x62d6('0x4a')]({'where':{'id':_0x10abdb['params']['id']}})['then'](handleEntityNotFound(_0x3d00ca,null))[_0x62d6('0x28')](removeEntity(_0x3d00ca,null))[_0x62d6('0x47')](handleError(_0x3d00ca,null));};exports[_0x62d6('0x4b')]=function(_0x592fa8,_0x20d3b7){return db[_0x62d6('0x2f')][_0x62d6('0x4b')]()[_0x62d6('0x28')](respondWithResult(_0x20d3b7,null))['catch'](handleError(_0x20d3b7,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 90aadb7..2f39f9f 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 _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x37fb3a,_0x5a14ee){var _0x1e5c8f=function(_0x4e79d1){while(--_0x4e79d1){_0x37fb3a['push'](_0x37fb3a['shift']());}};_0x1e5c8f(++_0x5a14ee);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x763056,_0x180be3){_0x763056=_0x763056-0x0;var _0x4aa4c9=_0x4fdb[_0x763056];return _0x4aa4c9;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[{'name':_0xb4fd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe57e=['report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xe57e,0xf2));var _0xee57=function(_0x25b49c,_0x3346c5){_0x25b49c=_0x25b49c-0x0;var _0x4c9d46=_0xe57e[_0x25b49c];return _0x4c9d46;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var logger=require(_0xee57('0x1'))(_0xee57('0x2'));var moment=require(_0xee57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee57('0x4'));var rimraf=require('rimraf');var config=require(_0xee57('0x5'));var attributes=require(_0xee57('0x6'));module[_0xee57('0x7')]=function(_0x4e21c4,_0x491334){return _0x4e21c4[_0xee57('0x8')](_0xee57('0x9'),attributes,{'tableName':_0xee57('0xa'),'paranoid':![],'indexes':[{'name':_0xee57('0xb'),'fields':[_0xee57('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 6907c14..6f2abf2 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 _0x7fbe=['request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x155b37,_0x4008c9){var _0x566704=function(_0x18125e){while(--_0x18125e){_0x155b37['push'](_0x155b37['shift']());}};_0x566704(++_0x4008c9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x7fbe[_0x3932eb];return _0x5316e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x21d1=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment'];(function(_0x32ee25,_0x7a0c1f){var _0xd9ea12=function(_0x13493e){while(--_0x13493e){_0x32ee25['push'](_0x32ee25['shift']());}};_0xd9ea12(++_0x7a0c1f);}(_0x21d1,0x1c9));var _0x121d=function(_0x39458b,_0x3d561e){_0x39458b=_0x39458b-0x0;var _0x2c59ef=_0x21d1[_0x39458b];return _0x2c59ef;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var moment=require(_0x121d('0x2'));var BPromise=require(_0x121d('0x3'));var rs=require(_0x121d('0x4'));var fs=require('fs');var Redis=require(_0x121d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x121d('0x6'))(_0x121d('0x7'));var config=require(_0x121d('0x8'));var jayson=require(_0x121d('0x9'));var client=jayson[_0x121d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226625,_0x2bd1e8,_0x47b50b){return new BPromise(function(_0x2d4d7e,_0x242f0c){return client[_0x121d('0xb')](_0x226625,_0x47b50b)[_0x121d('0xc')](function(_0x8b07c2){logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,'request\x20sent');logger[_0x121d('0xf')](_0x121d('0x10'),_0x2bd1e8,_0x121d('0x11'),JSON['stringify'](_0x8b07c2));if(_0x8b07c2['error']){if(_0x8b07c2[_0x121d('0x12')][_0x121d('0x13')]===0x1f4){logger[_0x121d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x242f0c(_0x8b07c2['error'][_0x121d('0x14')]);}logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x2d4d7e(_0x8b07c2[_0x121d('0x12')][_0x121d('0x14')]);}else{logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,_0x121d('0x11'));_0x2d4d7e(_0x8b07c2[_0x121d('0x15')][_0x121d('0x14')]);}})[_0x121d('0x16')](function(_0x475541){logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x475541);_0x242f0c(_0x475541);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 60e62e5..26937cd 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 _0xe0a4=['update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','now','extname','post','file','create','put'];(function(_0x58fd6c,_0x5a15d2){var _0xf979ab=function(_0x2c42c5){while(--_0x2c42c5){_0x58fd6c['push'](_0x58fd6c['shift']());}};_0xf979ab(++_0x5a15d2);}(_0xe0a4,0x17c));var _0x4e0a=function(_0x5b58f0,_0xefc43c){_0x5b58f0=_0x5b58f0-0x0;var _0x181cd5=_0xe0a4[_0x5b58f0];return _0x181cd5;};'use strict';var multer=require(_0x4e0a('0x0'));var util=require('util');var path=require(_0x4e0a('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e0a('0x2'));var router=express[_0x4e0a('0x3')]();var fs_extra=require(_0x4e0a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e0a('0x5'));var config=require('../../config/environment');var controller=require(_0x4e0a('0x6'));router[_0x4e0a('0x7')]('/',auth[_0x4e0a('0x8')](),controller[_0x4e0a('0x9')]);router['get'](_0x4e0a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4e0a('0x7')](_0x4e0a('0xb'),auth[_0x4e0a('0x8')](),controller[_0x4e0a('0xc')]);var upload=multer({'storage':multer[_0x4e0a('0xd')]({'destination':function(_0x186182,_0x3cad37,_0x120efb){_0x120efb(null,path['join'](config[_0x4e0a('0xe')],'server/files/sounds/original/'));},'filename':function(_0x37c2c4,_0x54853c,_0x392977){_0x54853c[_0x4e0a('0xf')]=_0x54853c[_0x4e0a('0xf')][_0x4e0a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x392977(null,util[_0x4e0a('0x11')](_0x4e0a('0x12'),path[_0x4e0a('0x13')](_0x54853c[_0x4e0a('0xf')],path['extname'](_0x54853c[_0x4e0a('0xf')])),Date[_0x4e0a('0x14')](),path[_0x4e0a('0x15')](_0x54853c[_0x4e0a('0xf')])));}})});router[_0x4e0a('0x16')]('/',upload['single'](_0x4e0a('0x17')),controller[_0x4e0a('0x18')]);router[_0x4e0a('0x19')]('/:id',auth[_0x4e0a('0x8')](),controller[_0x4e0a('0x1a')]);router['delete'](_0x4e0a('0xa'),auth[_0x4e0a('0x8')](),controller[_0x4e0a('0x1b')]);module[_0x4e0a('0x1c')]=router; \ No newline at end of file +var _0x8bb9=['replace','format','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0x8bb9,0x1bf));var _0x98bb=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x8bb9[_0x49bdc4];return _0x1f7437;};'use strict';var multer=require(_0x98bb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x98bb('0x1'));var express=require(_0x98bb('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x98bb('0x3'));var interaction=require(_0x98bb('0x4'));var config=require(_0x98bb('0x5'));var controller=require(_0x98bb('0x6'));router[_0x98bb('0x7')]('/',auth[_0x98bb('0x8')](),controller['index']);router[_0x98bb('0x7')](_0x98bb('0x9'),auth[_0x98bb('0x8')](),controller[_0x98bb('0xa')]);router[_0x98bb('0x7')](_0x98bb('0xb'),auth['isAuthenticated'](),controller[_0x98bb('0xc')]);var upload=multer({'storage':multer[_0x98bb('0xd')]({'destination':function(_0x524b74,_0x5b6ded,_0x41c548){_0x41c548(null,path[_0x98bb('0xe')](config[_0x98bb('0xf')],_0x98bb('0x10')));},'filename':function(_0x2ca0db,_0x53ee05,_0x596554){_0x53ee05[_0x98bb('0x11')]=_0x53ee05['originalname'][_0x98bb('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x596554(null,util[_0x98bb('0x13')](_0x98bb('0x14'),path[_0x98bb('0x15')](_0x53ee05[_0x98bb('0x11')],path[_0x98bb('0x16')](_0x53ee05['originalname'])),Date[_0x98bb('0x17')](),path[_0x98bb('0x16')](_0x53ee05[_0x98bb('0x11')])));}})});router[_0x98bb('0x18')]('/',upload[_0x98bb('0x19')](_0x98bb('0x1a')),controller['create']);router[_0x98bb('0x1b')]('/:id',auth[_0x98bb('0x8')](),controller[_0x98bb('0x1c')]);router[_0x98bb('0x1d')](_0x98bb('0x9'),auth['isAuthenticated'](),controller[_0x98bb('0x1d')]);module[_0x98bb('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index d051d56..23866e8 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 _0x6f20=['INTEGER','FLOAT','exports','name','STRING','BIGINT'];(function(_0x4f8ee2,_0x1a1748){var _0x4ea4e2=function(_0x2a0bf9){while(--_0x2a0bf9){_0x4f8ee2['push'](_0x4f8ee2['shift']());}};_0x4ea4e2(++_0x1a1748);}(_0x6f20,0x1d0));var _0x06f2=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x6f20[_0x513047];return _0x15b779;};'use strict';var Sequelize=require('sequelize');module[_0x06f2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x06f2('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x06f2('0x2')]},'display_name':{'type':Sequelize[_0x06f2('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x06f2('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x06f2('0x3')]},'original_sampleRate':{'type':Sequelize[_0x06f2('0x4')]},'converted_format':{'type':Sequelize[_0x06f2('0x2')]},'converted_duration':{'type':Sequelize[_0x06f2('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x06f2('0x3')]},'converted_channelCount':{'type':Sequelize[_0x06f2('0x4')]},'converted_bitRate':{'type':Sequelize[_0x06f2('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x06f2('0x4')]}}; \ No newline at end of file +var _0x1a14=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x3ce7dd,_0x25c2b1){var _0x22a02c=function(_0x30c14c){while(--_0x30c14c){_0x3ce7dd['push'](_0x3ce7dd['shift']());}};_0x22a02c(++_0x25c2b1);}(_0x1a14,0x106));var _0x41a1=function(_0x45104b,_0x2a080c){_0x45104b=_0x45104b-0x0;var _0x357209=_0x1a14[_0x45104b];return _0x357209;};'use strict';var Sequelize=require(_0x41a1('0x0'));module[_0x41a1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x41a1('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x41a1('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x41a1('0x3')]},'original_sampleCount':{'type':Sequelize[_0x41a1('0x4')]},'original_channelCount':{'type':Sequelize[_0x41a1('0x5')]},'original_bitRate':{'type':Sequelize[_0x41a1('0x4')]},'original_sampleRate':{'type':Sequelize[_0x41a1('0x5')]},'converted_format':{'type':Sequelize[_0x41a1('0x2')]},'converted_duration':{'type':Sequelize[_0x41a1('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x41a1('0x4')]},'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 a3e9c3f..5882dd5 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 _0x21f5=['delete','server/files/sounds/original','original_format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','json','apply','reject','save','destroy','then','get','name','index','map','Sound','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','options','count','includeAll','include','catch','show','params','merge','find','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sound\x20not\x20found','download','format','%s.%s','basename','file','extname','originalname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','send','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','end','0777','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description'];(function(_0x224728,_0x1a2564){var _0xd3bc1c=function(_0x28338d){while(--_0x28338d){_0x224728['push'](_0x224728['shift']());}};_0xd3bc1c(++_0x1a2564);}(_0x21f5,0x1eb));var _0x521f=function(_0x3765ba,_0xbc65e6){_0x3765ba=_0x3765ba-0x0;var _0xecc48=_0x21f5[_0x3765ba];return _0xecc48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x521f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x521f('0x1'));var rp=require(_0x521f('0x2'));var moment=require(_0x521f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x521f('0x4'));var util=require(_0x521f('0x5'));var path=require(_0x521f('0x6'));var sox=require(_0x521f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x521f('0x8'));var _=require('lodash');var squel=require(_0x521f('0x9'));var crypto=require('crypto');var jsforce=require(_0x521f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x521f('0xb'));var querystring=require(_0x521f('0xc'));var Papa=require(_0x521f('0xd'));var Redis=require(_0x521f('0xe'));var authService=require(_0x521f('0xf'));var qs=require(_0x521f('0x10'));var as=require(_0x521f('0x11'));var hardwareService=require(_0x521f('0x12'));var logger=require(_0x521f('0x13'))(_0x521f('0x14'));var utils=require(_0x521f('0x15'));var config=require(_0x521f('0x16'));var licenseUtil=require(_0x521f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2af993,_0x5296e9){_0x5296e9=_0x5296e9||0xcc;return function(_0x4b40b5){if(_0x4b40b5){return _0x2af993[_0x521f('0x18')](_0x5296e9);}return _0x2af993[_0x521f('0x19')](_0x5296e9)['end']();};}function respondWithResult(_0x6ec6ad,_0x2a2402){_0x2a2402=_0x2a2402||0xc8;return function(_0x51e007){if(_0x51e007){return _0x6ec6ad[_0x521f('0x19')](_0x2a2402)['json'](_0x51e007);}};}function respondWithFilteredResult(_0x274de7,_0x23f4cd){return function(_0x195240){if(_0x195240){var _0x5bc450=typeof _0x23f4cd[_0x521f('0x1a')]===_0x521f('0x1b')&&typeof _0x23f4cd[_0x521f('0x1c')]==='undefined';var _0x4e3278=_0x195240['count'];var _0x43569d=_0x5bc450?0x0:_0x23f4cd[_0x521f('0x1a')];var _0xd9d38e=_0x5bc450?_0x195240['count']:_0x23f4cd[_0x521f('0x1a')]+_0x23f4cd[_0x521f('0x1c')];var _0x4a8c99;if(_0xd9d38e>=_0x4e3278){_0xd9d38e=_0x4e3278;_0x4a8c99=0xc8;}else{_0x4a8c99=0xce;}_0x274de7[_0x521f('0x19')](_0x4a8c99);return _0x274de7[_0x521f('0x1d')]('Content-Range',_0x43569d+'-'+_0xd9d38e+'/'+_0x4e3278)[_0x521f('0x1e')](_0x195240);}return null;};}function patchUpdates(_0x517f87){return function(_0x2866e9){try{jsonpatch[_0x521f('0x1f')](_0x2866e9,_0x517f87,!![]);}catch(_0x2b3ca9){return BPromise[_0x521f('0x20')](_0x2b3ca9);}return _0x2866e9[_0x521f('0x21')]();};}function saveUpdates(_0x4d918f,_0x4bac39){return function(_0x21e2dc){if(_0x21e2dc){return _0x21e2dc['update'](_0x4d918f)['then'](function(_0x36f06f){return _0x36f06f;});}return null;};}function removeEntity(_0x550233,_0x5c71c6){return function(_0x6fa681){if(_0x6fa681){return _0x6fa681[_0x521f('0x22')]()[_0x521f('0x23')](function(){var _0x353e22=_0x6fa681[_0x521f('0x24')]({'plain':!![]});var _0xc6cdb5='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0xc6cdb5,'resourceId':_0x353e22['id']}})[_0x521f('0x23')](function(){return _0x6fa681;});})[_0x521f('0x23')](function(){_0x550233[_0x521f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a295,_0x40684b){return function(_0x2446f0){if(!_0x2446f0){_0x49a295['sendStatus'](0x194);}return _0x2446f0;};}function handleError(_0x4b68b6,_0x2c019e){_0x2c019e=_0x2c019e||0x1f4;return function(_0xabd68e){logger['error'](_0xabd68e['stack']);if(_0xabd68e['name']){delete _0xabd68e[_0x521f('0x25')];}_0x4b68b6[_0x521f('0x19')](_0x2c019e)['send'](_0xabd68e);};}exports[_0x521f('0x26')]=function(_0x51ef39,_0x138ae2){var _0x3c737={},_0x483b8e={},_0x590118={'count':0x0,'rows':[]};var _0xa1a0e0=_[_0x521f('0x27')](db[_0x521f('0x28')][_0x521f('0x29')],function(_0x381684){return{'name':_0x381684[_0x521f('0x2a')],'type':_0x381684['type'][_0x521f('0x2b')]};});_0x483b8e[_0x521f('0x2c')]=_[_0x521f('0x27')](_0xa1a0e0,_0x521f('0x25'));_0x483b8e[_0x521f('0x2d')]=_[_0x521f('0x2e')](_0x51ef39[_0x521f('0x2d')]);_0x483b8e[_0x521f('0x2f')]=_[_0x521f('0x30')](_0x483b8e[_0x521f('0x2c')],_0x483b8e[_0x521f('0x2d')]);_0x3c737[_0x521f('0x31')]=_[_0x521f('0x30')](_0x483b8e[_0x521f('0x2c')],qs['fields'](_0x51ef39[_0x521f('0x2d')]['fields']));_0x3c737[_0x521f('0x31')]=_0x3c737[_0x521f('0x31')][_0x521f('0x32')]?_0x3c737[_0x521f('0x31')]:_0x483b8e['model'];if(!_0x51ef39[_0x521f('0x2d')][_0x521f('0x33')](_0x521f('0x34'))){_0x3c737[_0x521f('0x1c')]=qs[_0x521f('0x1c')](_0x51ef39[_0x521f('0x2d')][_0x521f('0x1c')]);_0x3c737[_0x521f('0x1a')]=qs[_0x521f('0x1a')](_0x51ef39['query'][_0x521f('0x1a')]);}_0x3c737[_0x521f('0x35')]=qs['sort'](_0x51ef39['query']['sort']);_0x3c737['where']=qs[_0x521f('0x2f')](_[_0x521f('0x36')](_0x51ef39[_0x521f('0x2d')],_0x483b8e[_0x521f('0x2f')]),_0xa1a0e0);if(_0x51ef39['query'][_0x521f('0x37')]){_0x3c737[_0x521f('0x38')]=_['merge'](_0x3c737[_0x521f('0x38')],{'$or':_[_0x521f('0x27')](_0xa1a0e0,function(_0x5abacd){if(_0x5abacd['type']!==_0x521f('0x39')){var _0x470563={};_0x470563[_0x5abacd[_0x521f('0x25')]]={'$like':'%'+_0x51ef39[_0x521f('0x2d')][_0x521f('0x37')]+'%'};return _0x470563;}})});}_0x3c737=_['merge']({},_0x3c737,_0x51ef39[_0x521f('0x3a')]);var _0x1dcfdc={'where':_0x3c737[_0x521f('0x38')]};return db[_0x521f('0x28')][_0x521f('0x3b')](_0x1dcfdc)[_0x521f('0x23')](function(_0x2c54d3){_0x590118[_0x521f('0x3b')]=_0x2c54d3;if(_0x51ef39[_0x521f('0x2d')][_0x521f('0x3c')]){_0x3c737[_0x521f('0x3d')]=[{'all':!![]}];}return db[_0x521f('0x28')]['findAll'](_0x3c737);})['then'](function(_0x5b1b47){_0x590118['rows']=_0x5b1b47;return _0x590118;})[_0x521f('0x23')](respondWithFilteredResult(_0x138ae2,_0x3c737))[_0x521f('0x3e')](handleError(_0x138ae2,null));};exports[_0x521f('0x3f')]=function(_0x58e81c,_0x476556){var _0x2dd55f={'raw':!![],'where':{'id':_0x58e81c[_0x521f('0x40')]['id']}},_0x2bb013={};_0x2bb013[_0x521f('0x2c')]=_[_0x521f('0x2e')](db[_0x521f('0x28')][_0x521f('0x29')]);_0x2bb013[_0x521f('0x2d')]=_[_0x521f('0x2e')](_0x58e81c[_0x521f('0x2d')]);_0x2bb013[_0x521f('0x2f')]=_[_0x521f('0x30')](_0x2bb013[_0x521f('0x2c')],_0x2bb013['query']);_0x2dd55f['attributes']=_[_0x521f('0x30')](_0x2bb013[_0x521f('0x2c')],qs['fields'](_0x58e81c[_0x521f('0x2d')]['fields']));_0x2dd55f[_0x521f('0x31')]=_0x2dd55f[_0x521f('0x31')][_0x521f('0x32')]?_0x2dd55f[_0x521f('0x31')]:_0x2bb013[_0x521f('0x2c')];if(_0x58e81c[_0x521f('0x2d')]['includeAll']){_0x2dd55f['include']=[{'all':!![]}];}_0x2dd55f=_[_0x521f('0x41')]({},_0x2dd55f,_0x58e81c[_0x521f('0x3a')]);return db[_0x521f('0x28')][_0x521f('0x42')](_0x2dd55f)[_0x521f('0x23')](handleEntityNotFound(_0x476556,null))[_0x521f('0x23')](respondWithResult(_0x476556,null))[_0x521f('0x3e')](handleError(_0x476556,null));};exports['download']=function(_0x2bf0e7,_0x3d8002,_0x2bab17){return db[_0x521f('0x28')][_0x521f('0x42')]({'where':{'id':_0x2bf0e7[_0x521f('0x40')]['id']},'attributes':['name','save_name',_0x521f('0x43')],'raw':!![]})['then'](handleEntityNotFound(_0x3d8002,null))[_0x521f('0x23')](function(_0x173997){if(_0x173997){if(!fs[_0x521f('0x44')](path[_0x521f('0x45')](config[_0x521f('0x46')],_0x521f('0x47'),_0x173997[_0x521f('0x48')]+'.'+_0x173997[_0x521f('0x43')]))){throw new db['Sequelize']['ValidationError'](_0x521f('0x49'));}return _0x3d8002[_0x521f('0x4a')](path[_0x521f('0x45')](config['root'],_0x521f('0x47'),util[_0x521f('0x4b')](_0x521f('0x4c'),_0x173997['save_name'],_0x173997[_0x521f('0x43')])),util['format']('%s.%s',_0x173997[_0x521f('0x25')],_0x173997[_0x521f('0x43')]));}return null;})[_0x521f('0x3e')](handleError(_0x3d8002,null));};exports['create']=function(_0x83ec55,_0x265f10,_0x1655bf){var _0x237f1f={'name':path[_0x521f('0x4d')](_0x83ec55[_0x521f('0x4e')]['originalname'],path[_0x521f('0x4f')](_0x83ec55[_0x521f('0x4e')][_0x521f('0x50')])),'save_name':path['basename'](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')],path[_0x521f('0x4f')](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')])),'original_format':path['extname'](_0x83ec55['file']['originalname'])[_0x521f('0x52')](0x1),'converted_format':_0x521f('0x53')};var _0x1bfa7d=path[_0x521f('0x45')](config[_0x521f('0x46')],'server/files/sounds/original',_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')]);var _0x7112b8=path['join'](config['root'],_0x521f('0x47'),util['format']('%s.%s',path['basename'](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')],path[_0x521f('0x4f')](_0x83ec55[_0x521f('0x4e')][_0x521f('0x51')])),_0x237f1f[_0x521f('0x43')]));logger[_0x521f('0x54')](_0x521f('0x55'),_0x1bfa7d);logger[_0x521f('0x54')](_0x521f('0x56'),_0x7112b8);try{fs[_0x521f('0x57')](_0x1bfa7d,parseInt('0777',0x8));var _0x1fb12a=sox[_0x521f('0x58')](_0x1bfa7d,_0x7112b8,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1fb12a['on']('error',function(_0x2aba64){fs[_0x521f('0x59')](_0x1bfa7d);_0x265f10[_0x521f('0x19')](0x1f4)[_0x521f('0x5a')](_0x2aba64);});_0x1fb12a['on'](_0x521f('0x5b'),function(_0x2f82f6){_0x237f1f['original_duration']=isNaN(_0x2f82f6[_0x521f('0x5c')])?null:_0x2f82f6['duration']*0x3e8;_0x237f1f['original_sampleCount']=isNaN(_0x2f82f6['sampleCount'])?null:_0x2f82f6[_0x521f('0x5d')];_0x237f1f[_0x521f('0x5e')]=isNaN(_0x2f82f6[_0x521f('0x5f')])?null:_0x2f82f6[_0x521f('0x5f')];_0x237f1f[_0x521f('0x60')]=isNaN(_0x2f82f6['bitRate'])?null:_0x2f82f6[_0x521f('0x61')];_0x237f1f[_0x521f('0x62')]=isNaN(_0x2f82f6[_0x521f('0x63')])?null:_0x2f82f6['sampleRate'];});_0x1fb12a['on'](_0x521f('0x64'),function(_0x47c70f){_0x237f1f[_0x521f('0x65')]=isNaN(_0x47c70f[_0x521f('0x5c')])?null:_0x47c70f[_0x521f('0x5c')]*0x3e8;_0x237f1f[_0x521f('0x66')]=isNaN(_0x47c70f[_0x521f('0x5d')])?null:_0x47c70f[_0x521f('0x5d')];_0x237f1f['converted_channelCount']=isNaN(_0x47c70f['channelCount'])?null:_0x47c70f[_0x521f('0x5f')];_0x237f1f[_0x521f('0x67')]=isNaN(_0x47c70f[_0x521f('0x61')])?null:_0x47c70f[_0x521f('0x61')];_0x237f1f[_0x521f('0x68')]=isNaN(_0x47c70f['sampleRate'])?null:_0x47c70f[_0x521f('0x63')];});_0x1fb12a['on'](_0x521f('0x69'),function(){fs[_0x521f('0x57')](_0x7112b8,parseInt(_0x521f('0x6a'),0x8));return db['Sound'][_0x521f('0x6b')](_0x237f1f)[_0x521f('0x23')](function(_0x1ec3a9){var _0x1312e4={'role':_0x83ec55[_0x521f('0x6c')][_0x521f('0x6d')],'userProfileId':_0x83ec55['body'][_0x521f('0x6e')]};if(!_0x1312e4)throw new Error(_0x521f('0x6f'));if(_0x1312e4[_0x521f('0x6d')]==='user'){var _0x2bfbc1=_0x1ec3a9[_0x521f('0x24')]({'plain':!![]});return db[_0x521f('0x70')][_0x521f('0x42')]({'where':{'name':'Sounds','userProfileId':_0x1312e4['userProfileId']},'raw':!![]})[_0x521f('0x23')](function(_0x242201){if(_0x242201&&_0x242201[_0x521f('0x71')]===0x0){return db[_0x521f('0x72')][_0x521f('0x6b')]({'name':_0x2bfbc1[_0x521f('0x25')],'resourceId':_0x2bfbc1['id'],'type':_0x242201[_0x521f('0x25')],'sectionId':_0x242201['id']},{})[_0x521f('0x23')](function(){return _0x1ec3a9;});}else{return _0x1ec3a9;}})[_0x521f('0x3e')](function(_0x221ba1){logger[_0x521f('0x73')](_0x521f('0x74'),_0x221ba1);throw _0x221ba1;});}return _0x1ec3a9;})[_0x521f('0x23')](respondWithResult(_0x265f10,null))['catch'](handleError(_0x265f10,null));});_0x1fb12a['start']();}catch(_0x123204){_0x265f10['status'](0x1f4)['send'](_0x123204);}};exports[_0x521f('0x75')]=function(_0x314166,_0x3579f8,_0x59009c){return db[_0x521f('0x28')][_0x521f('0x42')]({'where':{'id':_0x314166[_0x521f('0x40')]['id']}})[_0x521f('0x23')](handleEntityNotFound(_0x3579f8,null))[_0x521f('0x23')](saveUpdates(_[_0x521f('0x36')](_0x314166[_0x521f('0x6c')],[_0x521f('0x25'),_0x521f('0x76')]),null))[_0x521f('0x23')](respondWithResult(_0x3579f8,null))[_0x521f('0x3e')](handleError(_0x3579f8,null));};exports[_0x521f('0x77')]=function(_0x335e8e,_0x4d4982,_0x465b9f){return db[_0x521f('0x28')][_0x521f('0x42')]({'where':{'id':_0x335e8e[_0x521f('0x40')]['id']}})[_0x521f('0x23')](function(_0x383424){if(_0x383424){return _0x383424['destroy']();}})[_0x521f('0x23')](function(_0x265c18){var _0x20357f=path['join'](config[_0x521f('0x46')],_0x521f('0x78'),util['format'](_0x521f('0x4c'),_0x265c18[_0x521f('0x48')],_0x265c18[_0x521f('0x79')]));var _0xb9e3d=path[_0x521f('0x45')](config[_0x521f('0x46')],_0x521f('0x47'),util['format'](_0x521f('0x4c'),_0x265c18[_0x521f('0x48')],_0x265c18[_0x521f('0x43')]));fs[_0x521f('0x59')](_0x20357f);fs[_0x521f('0x59')](_0xb9e3d);return _0x265c18;})[_0x521f('0x23')](function(_0x1050a3){if(_0x1050a3){return _0x4d4982['status'](0xcc)[_0x521f('0x69')]();}})[_0x521f('0x23')](handleEntityNotFound(_0x4d4982,null))[_0x521f('0x3e')](handleError(_0x4d4982,null));}; \ No newline at end of file +var _0xf6f8=['fields','length','hasOwnProperty','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','converted_format','existsSync','join','server/files/sounds/converted','save_name','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','originalname','extname','file','basename','filename','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','start','update','pick','body','server/files/sounds/original','original_format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x4c5b3f,_0x31f080){var _0x2a104b=function(_0x4fcd8d){while(--_0x4fcd8d){_0x4c5b3f['push'](_0x4c5b3f['shift']());}};_0x2a104b(++_0x31f080);}(_0xf6f8,0xb8));var _0x8f6f=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xf6f8[_0x166742];return _0xb7814a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f6f('0x0'));var zipdir=require(_0x8f6f('0x1'));var jsonpatch=require(_0x8f6f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f6f('0x3'));var Mustache=require(_0x8f6f('0x4'));var util=require('util');var path=require(_0x8f6f('0x5'));var sox=require('sox');var csv=require(_0x8f6f('0x6'));var ejs=require(_0x8f6f('0x7'));var fs=require('fs');var fs_extra=require(_0x8f6f('0x8'));var _=require('lodash');var squel=require(_0x8f6f('0x9'));var crypto=require(_0x8f6f('0xa'));var jsforce=require(_0x8f6f('0xb'));var deskjs=require(_0x8f6f('0xc'));var toCsv=require(_0x8f6f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8f6f('0xd'));var authService=require(_0x8f6f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8f6f('0xf'));var hardwareService=require(_0x8f6f('0x10'));var logger=require('../../config/logger')(_0x8f6f('0x11'));var utils=require(_0x8f6f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8f6f('0x13'));var db=require(_0x8f6f('0x14'))['db'];function respondWithStatusCode(_0x14b5a7,_0x367a06){_0x367a06=_0x367a06||0xcc;return function(_0x1c4882){if(_0x1c4882){return _0x14b5a7[_0x8f6f('0x15')](_0x367a06);}return _0x14b5a7[_0x8f6f('0x16')](_0x367a06)[_0x8f6f('0x17')]();};}function respondWithResult(_0x3b6202,_0x194443){_0x194443=_0x194443||0xc8;return function(_0x4e40bb){if(_0x4e40bb){return _0x3b6202[_0x8f6f('0x16')](_0x194443)[_0x8f6f('0x18')](_0x4e40bb);}};}function respondWithFilteredResult(_0xeeac00,_0x4cb753){return function(_0x13a01c){if(_0x13a01c){var _0x3583d4=typeof _0x4cb753[_0x8f6f('0x19')]==='undefined'&&typeof _0x4cb753[_0x8f6f('0x1a')]===_0x8f6f('0x1b');var _0x3f6a60=_0x13a01c[_0x8f6f('0x1c')];var _0xe0b750=_0x3583d4?0x0:_0x4cb753['offset'];var _0x31d89a=_0x3583d4?_0x13a01c[_0x8f6f('0x1c')]:_0x4cb753['offset']+_0x4cb753[_0x8f6f('0x1a')];var _0x32af7a;if(_0x31d89a>=_0x3f6a60){_0x31d89a=_0x3f6a60;_0x32af7a=0xc8;}else{_0x32af7a=0xce;}_0xeeac00[_0x8f6f('0x16')](_0x32af7a);return _0xeeac00['set']('Content-Range',_0xe0b750+'-'+_0x31d89a+'/'+_0x3f6a60)[_0x8f6f('0x18')](_0x13a01c);}return null;};}function patchUpdates(_0x57826a){return function(_0x142298){try{jsonpatch[_0x8f6f('0x1d')](_0x142298,_0x57826a,!![]);}catch(_0x5cffea){return BPromise[_0x8f6f('0x1e')](_0x5cffea);}return _0x142298[_0x8f6f('0x1f')]();};}function saveUpdates(_0x392ee0,_0xe8487f){return function(_0x3e96be){if(_0x3e96be){return _0x3e96be['update'](_0x392ee0)[_0x8f6f('0x20')](function(_0x36970a){return _0x36970a;});}return null;};}function removeEntity(_0x5de0a9,_0x28c987){return function(_0x457835){if(_0x457835){return _0x457835[_0x8f6f('0x21')]()[_0x8f6f('0x20')](function(){var _0x163f68=_0x457835[_0x8f6f('0x22')]({'plain':!![]});var _0x63593b=_0x8f6f('0x23');return db[_0x8f6f('0x24')][_0x8f6f('0x21')]({'where':{'type':_0x63593b,'resourceId':_0x163f68['id']}})[_0x8f6f('0x20')](function(){return _0x457835;});})[_0x8f6f('0x20')](function(){_0x5de0a9[_0x8f6f('0x16')](0xcc)[_0x8f6f('0x17')]();});}};}function handleEntityNotFound(_0x4a66dc,_0x451517){return function(_0x58ccd6){if(!_0x58ccd6){_0x4a66dc[_0x8f6f('0x15')](0x194);}return _0x58ccd6;};}function handleError(_0x122b05,_0x5da189){_0x5da189=_0x5da189||0x1f4;return function(_0x3282fd){logger[_0x8f6f('0x25')](_0x3282fd[_0x8f6f('0x26')]);if(_0x3282fd[_0x8f6f('0x27')]){delete _0x3282fd[_0x8f6f('0x27')];}_0x122b05[_0x8f6f('0x16')](_0x5da189)[_0x8f6f('0x28')](_0x3282fd);};}exports[_0x8f6f('0x29')]=function(_0x31c767,_0x4c6592){var _0x20979f={},_0x16b09e={},_0x2bfa5d={'count':0x0,'rows':[]};var _0x1ad910=_[_0x8f6f('0x2a')](db[_0x8f6f('0x2b')]['rawAttributes'],function(_0x4834bb){return{'name':_0x4834bb[_0x8f6f('0x2c')],'type':_0x4834bb[_0x8f6f('0x2d')][_0x8f6f('0x2e')]};});_0x16b09e[_0x8f6f('0x2f')]=_[_0x8f6f('0x2a')](_0x1ad910,_0x8f6f('0x27'));_0x16b09e[_0x8f6f('0x30')]=_[_0x8f6f('0x31')](_0x31c767[_0x8f6f('0x30')]);_0x16b09e['filters']=_[_0x8f6f('0x32')](_0x16b09e[_0x8f6f('0x2f')],_0x16b09e[_0x8f6f('0x30')]);_0x20979f[_0x8f6f('0x33')]=_[_0x8f6f('0x32')](_0x16b09e[_0x8f6f('0x2f')],qs[_0x8f6f('0x34')](_0x31c767['query'][_0x8f6f('0x34')]));_0x20979f[_0x8f6f('0x33')]=_0x20979f[_0x8f6f('0x33')][_0x8f6f('0x35')]?_0x20979f['attributes']:_0x16b09e[_0x8f6f('0x2f')];if(!_0x31c767['query'][_0x8f6f('0x36')]('nolimit')){_0x20979f[_0x8f6f('0x1a')]=qs[_0x8f6f('0x1a')](_0x31c767[_0x8f6f('0x30')][_0x8f6f('0x1a')]);_0x20979f[_0x8f6f('0x19')]=qs['offset'](_0x31c767[_0x8f6f('0x30')][_0x8f6f('0x19')]);}_0x20979f['order']=qs['sort'](_0x31c767[_0x8f6f('0x30')][_0x8f6f('0x37')]);_0x20979f['where']=qs[_0x8f6f('0x38')](_['pick'](_0x31c767[_0x8f6f('0x30')],_0x16b09e[_0x8f6f('0x38')]),_0x1ad910);if(_0x31c767[_0x8f6f('0x30')][_0x8f6f('0x39')]){_0x20979f[_0x8f6f('0x3a')]=_[_0x8f6f('0x3b')](_0x20979f[_0x8f6f('0x3a')],{'$or':_['map'](_0x1ad910,function(_0x5ee86f){if(_0x5ee86f[_0x8f6f('0x2d')]!==_0x8f6f('0x3c')){var _0x3fb1a1={};_0x3fb1a1[_0x5ee86f['name']]={'$like':'%'+_0x31c767[_0x8f6f('0x30')]['filter']+'%'};return _0x3fb1a1;}})});}_0x20979f=_['merge']({},_0x20979f,_0x31c767[_0x8f6f('0x3d')]);var _0x23800d={'where':_0x20979f[_0x8f6f('0x3a')]};return db[_0x8f6f('0x2b')]['count'](_0x23800d)[_0x8f6f('0x20')](function(_0x5e138a){_0x2bfa5d[_0x8f6f('0x1c')]=_0x5e138a;if(_0x31c767[_0x8f6f('0x30')][_0x8f6f('0x3e')]){_0x20979f[_0x8f6f('0x3f')]=[{'all':!![]}];}return db['Sound'][_0x8f6f('0x40')](_0x20979f);})['then'](function(_0xcc6e7f){_0x2bfa5d['rows']=_0xcc6e7f;return _0x2bfa5d;})[_0x8f6f('0x20')](respondWithFilteredResult(_0x4c6592,_0x20979f))['catch'](handleError(_0x4c6592,null));};exports[_0x8f6f('0x41')]=function(_0x512383,_0x38a1b1){var _0x278f0d={'raw':!![],'where':{'id':_0x512383[_0x8f6f('0x42')]['id']}},_0x262c67={};_0x262c67[_0x8f6f('0x2f')]=_[_0x8f6f('0x31')](db[_0x8f6f('0x2b')]['rawAttributes']);_0x262c67[_0x8f6f('0x30')]=_[_0x8f6f('0x31')](_0x512383[_0x8f6f('0x30')]);_0x262c67['filters']=_[_0x8f6f('0x32')](_0x262c67['model'],_0x262c67[_0x8f6f('0x30')]);_0x278f0d[_0x8f6f('0x33')]=_['intersection'](_0x262c67[_0x8f6f('0x2f')],qs[_0x8f6f('0x34')](_0x512383[_0x8f6f('0x30')][_0x8f6f('0x34')]));_0x278f0d['attributes']=_0x278f0d[_0x8f6f('0x33')]['length']?_0x278f0d[_0x8f6f('0x33')]:_0x262c67[_0x8f6f('0x2f')];if(_0x512383[_0x8f6f('0x30')][_0x8f6f('0x3e')]){_0x278f0d[_0x8f6f('0x3f')]=[{'all':!![]}];}_0x278f0d=_[_0x8f6f('0x3b')]({},_0x278f0d,_0x512383[_0x8f6f('0x3d')]);return db[_0x8f6f('0x2b')][_0x8f6f('0x43')](_0x278f0d)[_0x8f6f('0x20')](handleEntityNotFound(_0x38a1b1,null))[_0x8f6f('0x20')](respondWithResult(_0x38a1b1,null))[_0x8f6f('0x44')](handleError(_0x38a1b1,null));};exports['download']=function(_0x43bab6,_0x1b61ad,_0x2b946d){return db[_0x8f6f('0x2b')][_0x8f6f('0x43')]({'where':{'id':_0x43bab6[_0x8f6f('0x42')]['id']},'attributes':[_0x8f6f('0x27'),'save_name',_0x8f6f('0x45')],'raw':!![]})['then'](handleEntityNotFound(_0x1b61ad,null))[_0x8f6f('0x20')](function(_0x2e0729){if(_0x2e0729){if(!fs[_0x8f6f('0x46')](path[_0x8f6f('0x47')](config['root'],_0x8f6f('0x48'),_0x2e0729[_0x8f6f('0x49')]+'.'+_0x2e0729[_0x8f6f('0x45')]))){throw new db['Sequelize'][(_0x8f6f('0x4a'))](_0x8f6f('0x4b'));}return _0x1b61ad['download'](path[_0x8f6f('0x47')](config[_0x8f6f('0x4c')],_0x8f6f('0x48'),util[_0x8f6f('0x4d')](_0x8f6f('0x4e'),_0x2e0729[_0x8f6f('0x49')],_0x2e0729[_0x8f6f('0x45')])),util['format'](_0x8f6f('0x4e'),_0x2e0729[_0x8f6f('0x27')],_0x2e0729[_0x8f6f('0x45')]));}return null;})['catch'](handleError(_0x1b61ad,null));};exports[_0x8f6f('0x4f')]=function(_0x1ec464,_0x268e6a,_0x4d82b){var _0x5d6f25={'name':path['basename'](_0x1ec464['file'][_0x8f6f('0x50')],path[_0x8f6f('0x51')](_0x1ec464[_0x8f6f('0x52')][_0x8f6f('0x50')])),'save_name':path[_0x8f6f('0x53')](_0x1ec464[_0x8f6f('0x52')][_0x8f6f('0x54')],path[_0x8f6f('0x51')](_0x1ec464[_0x8f6f('0x52')][_0x8f6f('0x54')])),'original_format':path[_0x8f6f('0x51')](_0x1ec464[_0x8f6f('0x52')]['originalname'])['substring'](0x1),'converted_format':_0x8f6f('0x55')};var _0x10bd67=path[_0x8f6f('0x47')](config['root'],'server/files/sounds/original',_0x1ec464[_0x8f6f('0x52')][_0x8f6f('0x54')]);var _0x13d581=path[_0x8f6f('0x47')](config[_0x8f6f('0x4c')],_0x8f6f('0x48'),util[_0x8f6f('0x4d')](_0x8f6f('0x4e'),path[_0x8f6f('0x53')](_0x1ec464[_0x8f6f('0x52')][_0x8f6f('0x54')],path[_0x8f6f('0x51')](_0x1ec464[_0x8f6f('0x52')][_0x8f6f('0x54')])),_0x5d6f25[_0x8f6f('0x45')]));logger[_0x8f6f('0x56')](_0x8f6f('0x57'),_0x10bd67);logger[_0x8f6f('0x56')](_0x8f6f('0x58'),_0x13d581);try{fs['chmodSync'](_0x10bd67,parseInt(_0x8f6f('0x59'),0x8));var _0x447b91=sox[_0x8f6f('0x5a')](_0x10bd67,_0x13d581,{'sampleRate':0x1f40,'format':_0x8f6f('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x447b91['on'](_0x8f6f('0x25'),function(_0x2c3bcf){fs[_0x8f6f('0x5b')](_0x10bd67);_0x268e6a[_0x8f6f('0x16')](0x1f4)['send'](_0x2c3bcf);});_0x447b91['on']('src',function(_0x3b0ed3){_0x5d6f25['original_duration']=isNaN(_0x3b0ed3[_0x8f6f('0x5c')])?null:_0x3b0ed3['duration']*0x3e8;_0x5d6f25[_0x8f6f('0x5d')]=isNaN(_0x3b0ed3[_0x8f6f('0x5e')])?null:_0x3b0ed3[_0x8f6f('0x5e')];_0x5d6f25[_0x8f6f('0x5f')]=isNaN(_0x3b0ed3[_0x8f6f('0x60')])?null:_0x3b0ed3['channelCount'];_0x5d6f25[_0x8f6f('0x61')]=isNaN(_0x3b0ed3[_0x8f6f('0x62')])?null:_0x3b0ed3[_0x8f6f('0x62')];_0x5d6f25[_0x8f6f('0x63')]=isNaN(_0x3b0ed3[_0x8f6f('0x64')])?null:_0x3b0ed3[_0x8f6f('0x64')];});_0x447b91['on'](_0x8f6f('0x65'),function(_0x302893){_0x5d6f25['converted_duration']=isNaN(_0x302893[_0x8f6f('0x5c')])?null:_0x302893[_0x8f6f('0x5c')]*0x3e8;_0x5d6f25[_0x8f6f('0x66')]=isNaN(_0x302893['sampleCount'])?null:_0x302893[_0x8f6f('0x5e')];_0x5d6f25[_0x8f6f('0x67')]=isNaN(_0x302893[_0x8f6f('0x60')])?null:_0x302893[_0x8f6f('0x60')];_0x5d6f25[_0x8f6f('0x68')]=isNaN(_0x302893[_0x8f6f('0x62')])?null:_0x302893[_0x8f6f('0x62')];_0x5d6f25[_0x8f6f('0x69')]=isNaN(_0x302893[_0x8f6f('0x64')])?null:_0x302893[_0x8f6f('0x64')];});_0x447b91['on'](_0x8f6f('0x17'),function(){fs[_0x8f6f('0x6a')](_0x13d581,parseInt(_0x8f6f('0x59'),0x8));return db['Sound'][_0x8f6f('0x4f')](_0x5d6f25)[_0x8f6f('0x20')](function(_0x3b4a54){var _0x29d11f={'role':_0x1ec464['body'][_0x8f6f('0x6b')],'userProfileId':_0x1ec464['body']['userProfileId']};if(!_0x29d11f)throw new Error(_0x8f6f('0x6c'));if(_0x29d11f['role']===_0x8f6f('0x6d')){var _0xc13aac=_0x3b4a54[_0x8f6f('0x22')]({'plain':!![]});return db[_0x8f6f('0x6e')][_0x8f6f('0x43')]({'where':{'name':_0x8f6f('0x23'),'userProfileId':_0x29d11f[_0x8f6f('0x6f')]},'raw':!![]})[_0x8f6f('0x20')](function(_0x58716c){if(_0x58716c&&_0x58716c['autoAssociation']===0x0){return db['UserProfileResource'][_0x8f6f('0x4f')]({'name':_0xc13aac[_0x8f6f('0x27')],'resourceId':_0xc13aac['id'],'type':_0x58716c[_0x8f6f('0x27')],'sectionId':_0x58716c['id']},{})[_0x8f6f('0x20')](function(){return _0x3b4a54;});}else{return _0x3b4a54;}})[_0x8f6f('0x44')](function(_0x44dfa2){logger[_0x8f6f('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44dfa2);throw _0x44dfa2;});}return _0x3b4a54;})[_0x8f6f('0x20')](respondWithResult(_0x268e6a,null))['catch'](handleError(_0x268e6a,null));});_0x447b91[_0x8f6f('0x70')]();}catch(_0x120d59){_0x268e6a[_0x8f6f('0x16')](0x1f4)['send'](_0x120d59);}};exports[_0x8f6f('0x71')]=function(_0x4eb5e5,_0x4b8c45,_0x4d734f){return db[_0x8f6f('0x2b')][_0x8f6f('0x43')]({'where':{'id':_0x4eb5e5[_0x8f6f('0x42')]['id']}})[_0x8f6f('0x20')](handleEntityNotFound(_0x4b8c45,null))['then'](saveUpdates(_[_0x8f6f('0x72')](_0x4eb5e5[_0x8f6f('0x73')],[_0x8f6f('0x27'),'description']),null))[_0x8f6f('0x20')](respondWithResult(_0x4b8c45,null))[_0x8f6f('0x44')](handleError(_0x4b8c45,null));};exports['delete']=function(_0x4479c3,_0x4a4cf6,_0x30f047){return db['Sound'][_0x8f6f('0x43')]({'where':{'id':_0x4479c3['params']['id']}})[_0x8f6f('0x20')](function(_0x3d835a){if(_0x3d835a){return _0x3d835a[_0x8f6f('0x21')]();}})[_0x8f6f('0x20')](function(_0x40f9f6){var _0x8ad4b9=path[_0x8f6f('0x47')](config[_0x8f6f('0x4c')],_0x8f6f('0x74'),util[_0x8f6f('0x4d')]('%s.%s',_0x40f9f6[_0x8f6f('0x49')],_0x40f9f6[_0x8f6f('0x75')]));var _0x2f640a=path['join'](config[_0x8f6f('0x4c')],_0x8f6f('0x48'),util[_0x8f6f('0x4d')]('%s.%s',_0x40f9f6['save_name'],_0x40f9f6[_0x8f6f('0x45')]));fs['unlinkSync'](_0x8ad4b9);fs[_0x8f6f('0x5b')](_0x2f640a);return _0x40f9f6;})['then'](function(_0x1c5244){if(_0x1c5244){return _0x4a4cf6[_0x8f6f('0x16')](0xcc)[_0x8f6f('0x17')]();}})[_0x8f6f('0x20')](handleEntityNotFound(_0x4a4cf6,null))[_0x8f6f('0x44')](handleError(_0x4a4cf6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c46a5da..27c941d 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 _0x5993=['request-promise','path','./sound.attributes','define','Sound','tools_sounds','util','../../config/logger','moment','bluebird'];(function(_0x16631c,_0x152fc8){var _0x258256=function(_0x4841d2){while(--_0x4841d2){_0x16631c['push'](_0x16631c['shift']());}};_0x258256(++_0x152fc8);}(_0x5993,0x1f0));var _0x3599=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x5993[_0x266618];return _0x54dbf5;};'use strict';var _=require('lodash');var util=require(_0x3599('0x0'));var logger=require(_0x3599('0x1'))('api');var moment=require(_0x3599('0x2'));var BPromise=require(_0x3599('0x3'));var rp=require(_0x3599('0x4'));var fs=require('fs');var path=require(_0x3599('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3599('0x6'));module['exports']=function(_0x3e2205,_0x324dff){return _0x3e2205[_0x3599('0x7')](_0x3599('0x8'),attributes,{'tableName':_0x3599('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4afb=['moment','rimraf','define','Sound','tools_sounds','lodash','util','api'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0x4afb,0xa5));var _0xb4af=function(_0x1a44bb,_0x3a17eb){_0x1a44bb=_0x1a44bb-0x0;var _0x232e18=_0x4afb[_0x1a44bb];return _0x232e18;};'use strict';var _=require(_0xb4af('0x0'));var util=require(_0xb4af('0x1'));var logger=require('../../config/logger')(_0xb4af('0x2'));var moment=require(_0xb4af('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb4af('0x4'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module['exports']=function(_0x43dbd1,_0x18fdf2){return _0x43dbd1[_0xb4af('0x5')](_0xb4af('0x6'),attributes,{'tableName':_0xb4af('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index ef18681..5293dcb 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 _0xcc78=['jayson/promise','client','http','request','then','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','options','raw','where','attributes','include','map','model','info','stringify','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x21b4d6,_0x53c476){var _0x5d50f8=function(_0x2ff446){while(--_0x2ff446){_0x21b4d6['push'](_0x21b4d6['shift']());}};_0x5d50f8(++_0x53c476);}(_0xcc78,0x1da));var _0x8cc7=function(_0x36987b,_0x49a49f){_0x36987b=_0x36987b-0x0;var _0x38f317=_0xcc78[_0x36987b];return _0x38f317;};'use strict';var _=require(_0x8cc7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cc7('0x1'));var rs=require(_0x8cc7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8cc7('0x3'));var logger=require(_0x8cc7('0x4'))(_0x8cc7('0x5'));var config=require('../../config/environment');var jayson=require(_0x8cc7('0x6'));var client=jayson[_0x8cc7('0x7')][_0x8cc7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b4cd9,_0x348358,_0x217081){return new BPromise(function(_0x39b2ed,_0x16a08e){return client[_0x8cc7('0x9')](_0x2b4cd9,_0x217081)[_0x8cc7('0xa')](function(_0x4da772){logger['info']('Sound,\x20%s,\x20%s',_0x348358,_0x8cc7('0xb'));logger[_0x8cc7('0xc')](_0x8cc7('0xd'),_0x348358,_0x8cc7('0xb'),JSON['stringify'](_0x4da772));if(_0x4da772[_0x8cc7('0xe')]){if(_0x4da772['error']['code']===0x1f4){logger['error'](_0x8cc7('0xf'),_0x348358,_0x4da772[_0x8cc7('0xe')][_0x8cc7('0x10')]);return _0x16a08e(_0x4da772[_0x8cc7('0xe')][_0x8cc7('0x10')]);}logger[_0x8cc7('0xe')](_0x8cc7('0xf'),_0x348358,_0x4da772[_0x8cc7('0xe')]['message']);return _0x39b2ed(_0x4da772[_0x8cc7('0xe')]['message']);}else{logger['info']('Sound,\x20%s,\x20%s',_0x348358,_0x8cc7('0xb'));_0x39b2ed(_0x4da772[_0x8cc7('0x11')][_0x8cc7('0x10')]);}})['catch'](function(_0x61e468){logger[_0x8cc7('0xe')](_0x8cc7('0xf'),_0x348358,_0x61e468);_0x16a08e(_0x61e468);});});}exports[_0x8cc7('0x12')]=function(_0xe6c9bf){var _0x50a649=this;return new Promise(function(_0xee4467,_0x388f62){return db[_0x8cc7('0x13')]['find']({'raw':_0xe6c9bf['options']?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x15')]===undefined?!![]:![]:!![],'where':_0xe6c9bf['options']?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x16')]||null:null,'attributes':_0xe6c9bf[_0x8cc7('0x14')]?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x17')]||null:null,'include':_0xe6c9bf[_0x8cc7('0x14')]?_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x18')]?_[_0x8cc7('0x19')](_0xe6c9bf[_0x8cc7('0x14')][_0x8cc7('0x18')],function(_0x78b277){return{'model':db[_0x78b277[_0x8cc7('0x1a')]],'as':_0x78b277['as'],'attributes':_0x78b277['attributes'],'include':_0x78b277[_0x8cc7('0x18')]?_[_0x8cc7('0x19')](_0x78b277[_0x8cc7('0x18')],function(_0x54ba46){return{'model':db[_0x54ba46[_0x8cc7('0x1a')]],'as':_0x54ba46['as'],'attributes':_0x54ba46[_0x8cc7('0x17')],'include':_0x54ba46[_0x8cc7('0x18')]?_[_0x8cc7('0x19')](_0x54ba46[_0x8cc7('0x18')],function(_0x1a8e7c){return{'model':db[_0x1a8e7c[_0x8cc7('0x1a')]],'as':_0x1a8e7c['as'],'attributes':_0x1a8e7c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7d0524){logger[_0x8cc7('0x1b')](_0x8cc7('0x12'),_0xe6c9bf);logger['debug'](_0x8cc7('0x12'),_0xe6c9bf,JSON[_0x8cc7('0x1c')](_0x7d0524));_0xee4467(_0x7d0524);})[_0x8cc7('0x1d')](function(_0x5e36e5){logger['error'](_0x8cc7('0x12'),_0x5e36e5[_0x8cc7('0x10')],_0xe6c9bf);_0x388f62(_0x50a649['error'](0x1f4,_0x5e36e5[_0x8cc7('0x10')]));});});}; \ No newline at end of file +var _0xc35b=['model','map','attributes','ShowSound','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','Sound','find','options','raw','include'];(function(_0x1b2baf,_0x120c94){var _0x478e2d=function(_0x44965b){while(--_0x44965b){_0x1b2baf['push'](_0x1b2baf['shift']());}};_0x478e2d(++_0x120c94);}(_0xc35b,0x78));var _0xbc35=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xc35b[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xbc35('0x0'));var util=require('util');var moment=require(_0xbc35('0x1'));var BPromise=require(_0xbc35('0x2'));var rs=require(_0xbc35('0x3'));var fs=require('fs');var Redis=require(_0xbc35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc35('0x5'));var logger=require('../../config/logger')(_0xbc35('0x6'));var config=require('../../config/environment');var jayson=require(_0xbc35('0x7'));var client=jayson['client'][_0xbc35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x127c40,_0x111cf8,_0x389977){return new BPromise(function(_0x3cd1f2,_0x5ec561){return client[_0xbc35('0x9')](_0x127c40,_0x389977)[_0xbc35('0xa')](function(_0x3644e1){logger['info'](_0xbc35('0xb'),_0x111cf8,'request\x20sent');logger[_0xbc35('0xc')]('Sound,\x20%s,\x20%s,\x20%s',_0x111cf8,_0xbc35('0xd'),JSON[_0xbc35('0xe')](_0x3644e1));if(_0x3644e1['error']){if(_0x3644e1[_0xbc35('0xf')]['code']===0x1f4){logger[_0xbc35('0xf')]('Sound,\x20%s,\x20%s',_0x111cf8,_0x3644e1['error'][_0xbc35('0x10')]);return _0x5ec561(_0x3644e1['error']['message']);}logger['error'](_0xbc35('0xb'),_0x111cf8,_0x3644e1['error'][_0xbc35('0x10')]);return _0x3cd1f2(_0x3644e1[_0xbc35('0xf')][_0xbc35('0x10')]);}else{logger[_0xbc35('0x11')]('Sound,\x20%s,\x20%s',_0x111cf8,'request\x20sent');_0x3cd1f2(_0x3644e1[_0xbc35('0x12')]['message']);}})[_0xbc35('0x13')](function(_0x1188ac){logger[_0xbc35('0xf')](_0xbc35('0xb'),_0x111cf8,_0x1188ac);_0x5ec561(_0x1188ac);});});}exports['ShowSound']=function(_0x4b5af5){var _0x13bf3f=this;return new Promise(function(_0x3faad8,_0x3a2643){return db[_0xbc35('0x14')][_0xbc35('0x15')]({'raw':_0x4b5af5[_0xbc35('0x16')]?_0x4b5af5[_0xbc35('0x16')][_0xbc35('0x17')]===undefined?!![]:![]:!![],'where':_0x4b5af5[_0xbc35('0x16')]?_0x4b5af5[_0xbc35('0x16')]['where']||null:null,'attributes':_0x4b5af5[_0xbc35('0x16')]?_0x4b5af5[_0xbc35('0x16')]['attributes']||null:null,'include':_0x4b5af5['options']?_0x4b5af5['options']['include']?_['map'](_0x4b5af5[_0xbc35('0x16')][_0xbc35('0x18')],function(_0x2c013c){return{'model':db[_0x2c013c[_0xbc35('0x19')]],'as':_0x2c013c['as'],'attributes':_0x2c013c['attributes'],'include':_0x2c013c[_0xbc35('0x18')]?_[_0xbc35('0x1a')](_0x2c013c[_0xbc35('0x18')],function(_0x3c06f8){return{'model':db[_0x3c06f8[_0xbc35('0x19')]],'as':_0x3c06f8['as'],'attributes':_0x3c06f8[_0xbc35('0x1b')],'include':_0x3c06f8[_0xbc35('0x18')]?_['map'](_0x3c06f8[_0xbc35('0x18')],function(_0x506070){return{'model':db[_0x506070[_0xbc35('0x19')]],'as':_0x506070['as'],'attributes':_0x506070[_0xbc35('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbc35('0xa')](function(_0x4cb907){logger['info']('ShowSound',_0x4b5af5);logger['debug'](_0xbc35('0x1c'),_0x4b5af5,JSON[_0xbc35('0xe')](_0x4cb907));_0x3faad8(_0x4cb907);})[_0xbc35('0x13')](function(_0x177d71){logger[_0xbc35('0xf')]('ShowSound',_0x177d71[_0xbc35('0x10')],_0x4b5af5);_0x3a2643(_0x13bf3f[_0xbc35('0xf')](0x1f4,_0x177d71[_0xbc35('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 6e80adf..b3bf244 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0xda2d,0x102));var _0xdda2=function(_0x3ed8b4,_0x255c5e){_0x3ed8b4=_0x3ed8b4-0x0;var _0x5ea042=_0xda2d[_0x3ed8b4];return _0x5ea042;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x516b08,_0x4e46b0){var _0x4aa7c6=function(_0x1acf2b){while(--_0x1acf2b){_0x516b08['push'](_0x516b08['shift']());}};_0x4aa7c6(++_0x4e46b0);}(_0x14a0,0x8e));var _0x014a=function(_0xf970ae,_0x3f974f){_0xf970ae=_0xf970ae-0x0;var _0x351fc2=_0x14a0[_0xf970ae];return _0x351fc2;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 52ada0b..b3a4167 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 _0xcb52=['medium','ENUM','out','STRING','TEXT'];(function(_0x2ff022,_0x183a9c){var _0x1cbaa5=function(_0x342bd9){while(--_0x342bd9){_0x2ff022['push'](_0x2ff022['shift']());}};_0x1cbaa5(++_0x183a9c);}(_0xcb52,0xc2));var _0x2cb5=function(_0x5c5995,_0x2e14e1){_0x5c5995=_0x5c5995-0x0;var _0x38d223=_0xcb52[_0x5c5995];return _0x38d223;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x2cb5('0x0')](_0x2cb5('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x2cb5('0x2')]('in',_0x2cb5('0x3')),'defaultValue':_0x2cb5('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2cb5('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdd37=['medium','ENUM','out','sequelize','exports'];(function(_0x4146e8,_0x18ed67){var _0x23c9e1=function(_0x326013){while(--_0x326013){_0x4146e8['push'](_0x4146e8['shift']());}};_0x23c9e1(++_0x18ed67);}(_0xdd37,0x148));var _0x7dd3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xdd37[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7dd3('0x0'));module[_0x7dd3('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x7dd3('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x7dd3('0x3')]('in',_0x7dd3('0x4')),'defaultValue':_0x7dd3('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 31255cc..1691dc0 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 _0x8374=['options','includeAll','findAll','rows','show','params','keys','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','sort','where','pick','filter','merge'];(function(_0x3efbd6,_0x3723ee){var _0x4f06e4=function(_0x325eff){while(--_0x325eff){_0x3efbd6['push'](_0x3efbd6['shift']());}};_0x4f06e4(++_0x3723ee);}(_0x8374,0x174));var _0x4837=function(_0xd208aa,_0x3c2ce3){_0xd208aa=_0xd208aa-0x0;var _0x3de95f=_0x8374[_0xd208aa];return _0x3de95f;};'use strict';var emlformat=require(_0x4837('0x0'));var rimraf=require(_0x4837('0x1'));var zipdir=require(_0x4837('0x2'));var jsonpatch=require(_0x4837('0x3'));var rp=require(_0x4837('0x4'));var moment=require(_0x4837('0x5'));var BPromise=require(_0x4837('0x6'));var Mustache=require(_0x4837('0x7'));var util=require(_0x4837('0x8'));var path=require(_0x4837('0x9'));var sox=require(_0x4837('0xa'));var csv=require(_0x4837('0xb'));var ejs=require(_0x4837('0xc'));var fs=require('fs');var fs_extra=require(_0x4837('0xd'));var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xb'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4837('0x19'));var db=require(_0x4837('0x1a'))['db'];function respondWithStatusCode(_0x5338cf,_0x55c6da){_0x55c6da=_0x55c6da||0xcc;return function(_0x4fdb97){if(_0x4fdb97){return _0x5338cf[_0x4837('0x1b')](_0x55c6da);}return _0x5338cf[_0x4837('0x1c')](_0x55c6da)[_0x4837('0x1d')]();};}function respondWithResult(_0x1a31d8,_0x4b18c5){_0x4b18c5=_0x4b18c5||0xc8;return function(_0x3609d5){if(_0x3609d5){return _0x1a31d8[_0x4837('0x1c')](_0x4b18c5)[_0x4837('0x1e')](_0x3609d5);}};}function respondWithFilteredResult(_0x52a82c,_0x1685ee){return function(_0xae4f01){if(_0xae4f01){var _0x5d49b6=typeof _0x1685ee[_0x4837('0x1f')]===_0x4837('0x20')&&typeof _0x1685ee[_0x4837('0x21')]===_0x4837('0x20');var _0x27460b=_0xae4f01[_0x4837('0x22')];var _0x48b61b=_0x5d49b6?0x0:_0x1685ee[_0x4837('0x1f')];var _0x1cb24a=_0x5d49b6?_0xae4f01[_0x4837('0x22')]:_0x1685ee[_0x4837('0x1f')]+_0x1685ee[_0x4837('0x21')];var _0x2c1ddf;if(_0x1cb24a>=_0x27460b){_0x1cb24a=_0x27460b;_0x2c1ddf=0xc8;}else{_0x2c1ddf=0xce;}_0x52a82c[_0x4837('0x1c')](_0x2c1ddf);return _0x52a82c['set']('Content-Range',_0x48b61b+'-'+_0x1cb24a+'/'+_0x27460b)[_0x4837('0x1e')](_0xae4f01);}return null;};}function patchUpdates(_0x133e9d){return function(_0x36603e){try{jsonpatch[_0x4837('0x23')](_0x36603e,_0x133e9d,!![]);}catch(_0x5e8f16){return BPromise[_0x4837('0x24')](_0x5e8f16);}return _0x36603e['save']();};}function saveUpdates(_0x208943,_0x5f5631){return function(_0x55d6fa){if(_0x55d6fa){return _0x55d6fa[_0x4837('0x25')](_0x208943)['then'](function(_0x4988f5){return _0x4988f5;});}return null;};}function removeEntity(_0x57d48a,_0x40bebd){return function(_0x2d820a){if(_0x2d820a){return _0x2d820a['destroy']()[_0x4837('0x26')](function(){_0x57d48a[_0x4837('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa5ad,_0x127ab9){return function(_0x4d4278){if(!_0x4d4278){_0x3fa5ad[_0x4837('0x1b')](0x194);}return _0x4d4278;};}function handleError(_0x1e7f7e,_0x1a8871){_0x1a8871=_0x1a8871||0x1f4;return function(_0x22ca2b){logger[_0x4837('0x27')](_0x22ca2b['stack']);if(_0x22ca2b[_0x4837('0x28')]){delete _0x22ca2b[_0x4837('0x28')];}_0x1e7f7e[_0x4837('0x1c')](_0x1a8871)[_0x4837('0x29')](_0x22ca2b);};}exports[_0x4837('0x2a')]=function(_0x17266c,_0x215858){var _0x107a5f={},_0x55f82b={},_0x18f95c={'count':0x0,'rows':[]};var _0x35c602=_[_0x4837('0x2b')](db[_0x4837('0x2c')][_0x4837('0x2d')],function(_0x18c7a7){return{'name':_0x18c7a7[_0x4837('0x2e')],'type':_0x18c7a7[_0x4837('0x2f')][_0x4837('0x30')]};});_0x55f82b['model']=_[_0x4837('0x2b')](_0x35c602,'name');_0x55f82b[_0x4837('0x31')]=_['keys'](_0x17266c[_0x4837('0x31')]);_0x55f82b[_0x4837('0x32')]=_[_0x4837('0x33')](_0x55f82b['model'],_0x55f82b['query']);_0x107a5f[_0x4837('0x34')]=_[_0x4837('0x33')](_0x55f82b[_0x4837('0x35')],qs[_0x4837('0x36')](_0x17266c[_0x4837('0x31')]['fields']));_0x107a5f[_0x4837('0x34')]=_0x107a5f[_0x4837('0x34')]['length']?_0x107a5f[_0x4837('0x34')]:_0x55f82b['model'];if(!_0x17266c[_0x4837('0x31')]['hasOwnProperty']('nolimit')){_0x107a5f[_0x4837('0x21')]=qs[_0x4837('0x21')](_0x17266c[_0x4837('0x31')]['limit']);_0x107a5f[_0x4837('0x1f')]=qs[_0x4837('0x1f')](_0x17266c['query'][_0x4837('0x1f')]);}_0x107a5f['order']=qs[_0x4837('0x37')](_0x17266c[_0x4837('0x31')][_0x4837('0x37')]);_0x107a5f[_0x4837('0x38')]=qs['filters'](_[_0x4837('0x39')](_0x17266c[_0x4837('0x31')],_0x55f82b[_0x4837('0x32')]),_0x35c602);if(_0x17266c[_0x4837('0x31')][_0x4837('0x3a')]){_0x107a5f[_0x4837('0x38')]=_['merge'](_0x107a5f[_0x4837('0x38')],{'$or':_['map'](_0x35c602,function(_0x465737){if(_0x465737[_0x4837('0x2f')]!=='VIRTUAL'){var _0x5eb13b={};_0x5eb13b[_0x465737[_0x4837('0x28')]]={'$like':'%'+_0x17266c[_0x4837('0x31')][_0x4837('0x3a')]+'%'};return _0x5eb13b;}})});}_0x107a5f=_[_0x4837('0x3b')]({},_0x107a5f,_0x17266c[_0x4837('0x3c')]);var _0x2d70c3={'where':_0x107a5f[_0x4837('0x38')]};return db[_0x4837('0x2c')][_0x4837('0x22')](_0x2d70c3)[_0x4837('0x26')](function(_0x43d57a){_0x18f95c[_0x4837('0x22')]=_0x43d57a;if(_0x17266c[_0x4837('0x31')][_0x4837('0x3d')]){_0x107a5f['include']=[{'all':!![]}];}return db['SquareMessage'][_0x4837('0x3e')](_0x107a5f);})[_0x4837('0x26')](function(_0x4d2b7e){_0x18f95c[_0x4837('0x3f')]=_0x4d2b7e;return _0x18f95c;})['then'](respondWithFilteredResult(_0x215858,_0x107a5f))['catch'](handleError(_0x215858,null));};exports[_0x4837('0x40')]=function(_0x5870f6,_0x5409e4){var _0x11a818={'raw':!![],'where':{'id':_0x5870f6[_0x4837('0x41')]['id']}},_0x230f85={};_0x230f85['model']=_[_0x4837('0x42')](db[_0x4837('0x2c')]['rawAttributes']);_0x230f85[_0x4837('0x31')]=_[_0x4837('0x42')](_0x5870f6[_0x4837('0x31')]);_0x230f85[_0x4837('0x32')]=_[_0x4837('0x33')](_0x230f85[_0x4837('0x35')],_0x230f85[_0x4837('0x31')]);_0x11a818[_0x4837('0x34')]=_[_0x4837('0x33')](_0x230f85[_0x4837('0x35')],qs[_0x4837('0x36')](_0x5870f6[_0x4837('0x31')][_0x4837('0x36')]));_0x11a818[_0x4837('0x34')]=_0x11a818[_0x4837('0x34')]['length']?_0x11a818[_0x4837('0x34')]:_0x230f85[_0x4837('0x35')];if(_0x5870f6[_0x4837('0x31')][_0x4837('0x3d')]){_0x11a818['include']=[{'all':!![]}];}_0x11a818=_[_0x4837('0x3b')]({},_0x11a818,_0x5870f6[_0x4837('0x3c')]);return db['SquareMessage']['find'](_0x11a818)[_0x4837('0x26')](handleEntityNotFound(_0x5409e4,null))[_0x4837('0x26')](respondWithResult(_0x5409e4,null))[_0x4837('0x43')](handleError(_0x5409e4,null));};exports['create']=function(_0x37df13,_0x130441){return db[_0x4837('0x2c')][_0x4837('0x44')](_0x37df13[_0x4837('0x45')],{})[_0x4837('0x26')](respondWithResult(_0x130441,0xc9))[_0x4837('0x43')](handleError(_0x130441,null));};exports[_0x4837('0x25')]=function(_0x38d55e,_0x5aa7cf){if(_0x38d55e['body']['id']){delete _0x38d55e[_0x4837('0x45')]['id'];}return db['SquareMessage'][_0x4837('0x46')]({'where':{'id':_0x38d55e[_0x4837('0x41')]['id']}})[_0x4837('0x26')](handleEntityNotFound(_0x5aa7cf,null))[_0x4837('0x26')](saveUpdates(_0x38d55e[_0x4837('0x45')],null))[_0x4837('0x26')](respondWithResult(_0x5aa7cf,null))['catch'](handleError(_0x5aa7cf,null));};exports[_0x4837('0x47')]=function(_0x1be48b,_0x14f353){return db[_0x4837('0x2c')]['find']({'where':{'id':_0x1be48b[_0x4837('0x41')]['id']}})[_0x4837('0x26')](handleEntityNotFound(_0x14f353,null))[_0x4837('0x26')](removeEntity(_0x14f353,null))[_0x4837('0x43')](handleError(_0x14f353,null));}; \ No newline at end of file +var _0x6a95=['name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','SquareMessage','includeAll','include','findAll','rows','show','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6a95,0x1db));var _0x56a9=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x6a95[_0x21aec3];return _0x288bbc;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2c7f,_0x4552ce){_0x4552ce=_0x4552ce||0xcc;return function(_0x420667){if(_0x420667){return _0x2b2c7f[_0x56a9('0x19')](_0x4552ce);}return _0x2b2c7f[_0x56a9('0x1a')](_0x4552ce)[_0x56a9('0x1b')]();};}function respondWithResult(_0x124ab8,_0x1a2eb4){_0x1a2eb4=_0x1a2eb4||0xc8;return function(_0x40b2cb){if(_0x40b2cb){return _0x124ab8['status'](_0x1a2eb4)['json'](_0x40b2cb);}};}function respondWithFilteredResult(_0x2e0dfd,_0x2a0714){return function(_0x42007b){if(_0x42007b){var _0x46f854=typeof _0x2a0714['offset']===_0x56a9('0x1c')&&typeof _0x2a0714['limit']==='undefined';var _0x4e292f=_0x42007b[_0x56a9('0x1d')];var _0x576bdf=_0x46f854?0x0:_0x2a0714[_0x56a9('0x1e')];var _0x105fe5=_0x46f854?_0x42007b[_0x56a9('0x1d')]:_0x2a0714[_0x56a9('0x1e')]+_0x2a0714[_0x56a9('0x1f')];var _0xbfeb1a;if(_0x105fe5>=_0x4e292f){_0x105fe5=_0x4e292f;_0xbfeb1a=0xc8;}else{_0xbfeb1a=0xce;}_0x2e0dfd[_0x56a9('0x1a')](_0xbfeb1a);return _0x2e0dfd[_0x56a9('0x20')](_0x56a9('0x21'),_0x576bdf+'-'+_0x105fe5+'/'+_0x4e292f)[_0x56a9('0x22')](_0x42007b);}return null;};}function patchUpdates(_0x5f145f){return function(_0x5bc03a){try{jsonpatch[_0x56a9('0x23')](_0x5bc03a,_0x5f145f,!![]);}catch(_0x16f9de){return BPromise[_0x56a9('0x24')](_0x16f9de);}return _0x5bc03a[_0x56a9('0x25')]();};}function saveUpdates(_0x4a09e5,_0x6100fe){return function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x56a9('0x26')](_0x4a09e5)[_0x56a9('0x27')](function(_0x5a82e0){return _0x5a82e0;});}return null;};}function removeEntity(_0x44762e,_0x32839b){return function(_0x21ab38){if(_0x21ab38){return _0x21ab38[_0x56a9('0x28')]()[_0x56a9('0x27')](function(){_0x44762e['status'](0xcc)[_0x56a9('0x1b')]();});}};}function handleEntityNotFound(_0x217bda,_0x35fe6d){return function(_0x5e3052){if(!_0x5e3052){_0x217bda[_0x56a9('0x19')](0x194);}return _0x5e3052;};}function handleError(_0x583b22,_0x22744f){_0x22744f=_0x22744f||0x1f4;return function(_0x8d41d6){logger[_0x56a9('0x29')](_0x8d41d6[_0x56a9('0x2a')]);if(_0x8d41d6[_0x56a9('0x2b')]){delete _0x8d41d6[_0x56a9('0x2b')];}_0x583b22[_0x56a9('0x1a')](_0x22744f)[_0x56a9('0x2c')](_0x8d41d6);};}exports['index']=function(_0x437ccf,_0x2bb1eb){var _0x5f23e1={},_0x4441ce={},_0x4f9be1={'count':0x0,'rows':[]};var _0x54a343=_[_0x56a9('0x2d')](db['SquareMessage'][_0x56a9('0x2e')],function(_0x11002a){return{'name':_0x11002a[_0x56a9('0x2f')],'type':_0x11002a[_0x56a9('0x30')]['key']};});_0x4441ce[_0x56a9('0x31')]=_[_0x56a9('0x2d')](_0x54a343,_0x56a9('0x2b'));_0x4441ce[_0x56a9('0x32')]=_[_0x56a9('0x33')](_0x437ccf[_0x56a9('0x32')]);_0x4441ce[_0x56a9('0x34')]=_[_0x56a9('0x35')](_0x4441ce[_0x56a9('0x31')],_0x4441ce[_0x56a9('0x32')]);_0x5f23e1[_0x56a9('0x36')]=_[_0x56a9('0x35')](_0x4441ce['model'],qs[_0x56a9('0x37')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x37')]));_0x5f23e1['attributes']=_0x5f23e1[_0x56a9('0x36')]['length']?_0x5f23e1['attributes']:_0x4441ce['model'];if(!_0x437ccf[_0x56a9('0x32')][_0x56a9('0x38')]('nolimit')){_0x5f23e1['limit']=qs[_0x56a9('0x1f')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x1f')]);_0x5f23e1[_0x56a9('0x1e')]=qs[_0x56a9('0x1e')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x1e')]);}_0x5f23e1[_0x56a9('0x39')]=qs[_0x56a9('0x3a')](_0x437ccf[_0x56a9('0x32')]['sort']);_0x5f23e1['where']=qs['filters'](_['pick'](_0x437ccf[_0x56a9('0x32')],_0x4441ce[_0x56a9('0x34')]),_0x54a343);if(_0x437ccf['query'][_0x56a9('0x3b')]){_0x5f23e1[_0x56a9('0x3c')]=_[_0x56a9('0x3d')](_0x5f23e1[_0x56a9('0x3c')],{'$or':_[_0x56a9('0x2d')](_0x54a343,function(_0x38932){if(_0x38932[_0x56a9('0x30')]!=='VIRTUAL'){var _0x4630c7={};_0x4630c7[_0x38932[_0x56a9('0x2b')]]={'$like':'%'+_0x437ccf['query']['filter']+'%'};return _0x4630c7;}})});}_0x5f23e1=_[_0x56a9('0x3d')]({},_0x5f23e1,_0x437ccf[_0x56a9('0x3e')]);var _0x1534d7={'where':_0x5f23e1[_0x56a9('0x3c')]};return db[_0x56a9('0x3f')][_0x56a9('0x1d')](_0x1534d7)[_0x56a9('0x27')](function(_0x26b251){_0x4f9be1[_0x56a9('0x1d')]=_0x26b251;if(_0x437ccf[_0x56a9('0x32')][_0x56a9('0x40')]){_0x5f23e1[_0x56a9('0x41')]=[{'all':!![]}];}return db[_0x56a9('0x3f')][_0x56a9('0x42')](_0x5f23e1);})[_0x56a9('0x27')](function(_0xe57cfb){_0x4f9be1[_0x56a9('0x43')]=_0xe57cfb;return _0x4f9be1;})[_0x56a9('0x27')](respondWithFilteredResult(_0x2bb1eb,_0x5f23e1))['catch'](handleError(_0x2bb1eb,null));};exports[_0x56a9('0x44')]=function(_0x43acf6,_0xfc1800){var _0x5ce001={'raw':!![],'where':{'id':_0x43acf6['params']['id']}},_0x1f8b30={};_0x1f8b30[_0x56a9('0x31')]=_['keys'](db[_0x56a9('0x3f')][_0x56a9('0x2e')]);_0x1f8b30[_0x56a9('0x32')]=_[_0x56a9('0x33')](_0x43acf6['query']);_0x1f8b30['filters']=_['intersection'](_0x1f8b30[_0x56a9('0x31')],_0x1f8b30[_0x56a9('0x32')]);_0x5ce001[_0x56a9('0x36')]=_[_0x56a9('0x35')](_0x1f8b30[_0x56a9('0x31')],qs[_0x56a9('0x37')](_0x43acf6[_0x56a9('0x32')][_0x56a9('0x37')]));_0x5ce001[_0x56a9('0x36')]=_0x5ce001[_0x56a9('0x36')][_0x56a9('0x45')]?_0x5ce001[_0x56a9('0x36')]:_0x1f8b30[_0x56a9('0x31')];if(_0x43acf6[_0x56a9('0x32')]['includeAll']){_0x5ce001[_0x56a9('0x41')]=[{'all':!![]}];}_0x5ce001=_[_0x56a9('0x3d')]({},_0x5ce001,_0x43acf6[_0x56a9('0x3e')]);return db['SquareMessage'][_0x56a9('0x46')](_0x5ce001)[_0x56a9('0x27')](handleEntityNotFound(_0xfc1800,null))['then'](respondWithResult(_0xfc1800,null))[_0x56a9('0x47')](handleError(_0xfc1800,null));};exports[_0x56a9('0x48')]=function(_0x4186e0,_0x208452){return db['SquareMessage'][_0x56a9('0x48')](_0x4186e0[_0x56a9('0x49')],{})[_0x56a9('0x27')](respondWithResult(_0x208452,0xc9))[_0x56a9('0x47')](handleError(_0x208452,null));};exports[_0x56a9('0x26')]=function(_0x3942d8,_0x31aaf5){if(_0x3942d8[_0x56a9('0x49')]['id']){delete _0x3942d8[_0x56a9('0x49')]['id'];}return db[_0x56a9('0x3f')][_0x56a9('0x46')]({'where':{'id':_0x3942d8['params']['id']}})['then'](handleEntityNotFound(_0x31aaf5,null))[_0x56a9('0x27')](saveUpdates(_0x3942d8[_0x56a9('0x49')],null))[_0x56a9('0x27')](respondWithResult(_0x31aaf5,null))[_0x56a9('0x47')](handleError(_0x31aaf5,null));};exports['destroy']=function(_0x1986f2,_0x942bee){return db[_0x56a9('0x3f')][_0x56a9('0x46')]({'where':{'id':_0x1986f2['params']['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x942bee,null))[_0x56a9('0x27')](removeEntity(_0x942bee,null))['catch'](handleError(_0x942bee,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index fd8b99f..594080f 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 _0xdbe0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash'];(function(_0x2a99a8,_0x32619e){var _0x5f03ad=function(_0xf5ae36){while(--_0xf5ae36){_0x2a99a8['push'](_0x2a99a8['shift']());}};_0x5f03ad(++_0x32619e);}(_0xdbe0,0xa7));var _0x0dbe=function(_0x4d08a1,_0x11aed1){_0x4d08a1=_0x4d08a1-0x0;var _0x167faa=_0xdbe0[_0x4d08a1];return _0x167faa;};'use strict';var _=require(_0x0dbe('0x0'));var util=require(_0x0dbe('0x1'));var logger=require(_0x0dbe('0x2'))(_0x0dbe('0x3'));var moment=require(_0x0dbe('0x4'));var BPromise=require(_0x0dbe('0x5'));var rp=require(_0x0dbe('0x6'));var fs=require('fs');var path=require(_0x0dbe('0x7'));var rimraf=require(_0x0dbe('0x8'));var config=require(_0x0dbe('0x9'));var attributes=require(_0x0dbe('0xa'));module['exports']=function(_0x47d6d5,_0x25f615){return _0x47d6d5[_0x0dbe('0xb')](_0x0dbe('0xc'),attributes,{'tableName':_0x0dbe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c4c=['api','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages'];(function(_0x6322f,_0x4056e1){var _0x10c09a=function(_0x332999){while(--_0x332999){_0x6322f['push'](_0x6322f['shift']());}};_0x10c09a(++_0x4056e1);}(_0x3c4c,0x1c2));var _0xc3c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x3c4c[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc3c4('0x0'));var moment=require('moment');var BPromise=require(_0xc3c4('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3c4('0x2'));var rimraf=require(_0xc3c4('0x3'));var config=require(_0xc3c4('0x4'));var attributes=require(_0xc3c4('0x5'));module['exports']=function(_0xe5f2b4,_0x38fef2){return _0xe5f2b4[_0xc3c4('0x6')](_0xc3c4('0x7'),attributes,{'tableName':_0xc3c4('0x8'),'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 39f3532..1acf144 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 _0x6ccd=['raw','CreateSquareMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SquareMessage','body','options'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6ccd,0x147));var _0xd6cc=function(_0x1aca28,_0x48cc28){_0x1aca28=_0x1aca28-0x0;var _0x58f781=_0x6ccd[_0x1aca28];return _0x58f781;};'use strict';var _=require('lodash');var util=require(_0xd6cc('0x0'));var moment=require(_0xd6cc('0x1'));var BPromise=require(_0xd6cc('0x2'));var rs=require(_0xd6cc('0x3'));var fs=require('fs');var Redis=require(_0xd6cc('0x4'));var db=require(_0xd6cc('0x5'))['db'];var utils=require(_0xd6cc('0x6'));var logger=require('../../config/logger')(_0xd6cc('0x7'));var config=require(_0xd6cc('0x8'));var jayson=require(_0xd6cc('0x9'));var client=jayson['client'][_0xd6cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f1f60,_0x2b569d,_0x5cb7d9){return new BPromise(function(_0x5977ce,_0x5a28b0){return client['request'](_0x1f1f60,_0x5cb7d9)[_0xd6cc('0xb')](function(_0x55b015){logger[_0xd6cc('0xc')](_0xd6cc('0xd'),_0x2b569d,'request\x20sent');logger[_0xd6cc('0xe')](_0xd6cc('0xf'),_0x2b569d,_0xd6cc('0x10'),JSON[_0xd6cc('0x11')](_0x55b015));if(_0x55b015[_0xd6cc('0x12')]){if(_0x55b015['error']['code']===0x1f4){logger[_0xd6cc('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2b569d,_0x55b015[_0xd6cc('0x12')][_0xd6cc('0x13')]);return _0x5a28b0(_0x55b015[_0xd6cc('0x12')][_0xd6cc('0x13')]);}logger[_0xd6cc('0x12')](_0xd6cc('0xd'),_0x2b569d,_0x55b015[_0xd6cc('0x12')]['message']);return _0x5977ce(_0x55b015['error'][_0xd6cc('0x13')]);}else{logger['info'](_0xd6cc('0xd'),_0x2b569d,_0xd6cc('0x10'));_0x5977ce(_0x55b015['result'][_0xd6cc('0x13')]);}})['catch'](function(_0x5744d8){logger[_0xd6cc('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2b569d,_0x5744d8);_0x5a28b0(_0x5744d8);});});}exports['CreateSquareMessage']=function(_0xc2ea38){var _0x58fdd0=this;return new Promise(function(_0x5b43ba,_0x5a3222){return db[_0xd6cc('0x14')]['create'](_0xc2ea38[_0xd6cc('0x15')],{'raw':_0xc2ea38[_0xd6cc('0x16')]?_0xc2ea38['options'][_0xd6cc('0x17')]===undefined?!![]:![]:!![]})[_0xd6cc('0xb')](function(_0x1f27d4){logger['info']('CreateSquareMessage',_0xc2ea38);logger['debug']('CreateSquareMessage',_0xc2ea38,JSON['stringify'](_0x1f27d4));_0x5b43ba(_0x1f27d4);})['catch'](function(_0x2144d7){logger[_0xd6cc('0x12')](_0xd6cc('0x18'),_0x2144d7['message'],_0xc2ea38);_0x5a3222(_0x58fdd0['error'](0x1f4,_0x2144d7[_0xd6cc('0x13')]));});});}; \ No newline at end of file +var _0xa4a1=['then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x427bb2,_0x4ea7e8){var _0x271bbc=function(_0x16e353){while(--_0x16e353){_0x427bb2['push'](_0x427bb2['shift']());}};_0x271bbc(++_0x4ea7e8);}(_0xa4a1,0x1c4));var _0x1a4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa4a1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1a4a('0x0'));var util=require(_0x1a4a('0x1'));var moment=require(_0x1a4a('0x2'));var BPromise=require(_0x1a4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a4a('0x4'));var db=require(_0x1a4a('0x5'))['db'];var utils=require(_0x1a4a('0x6'));var logger=require(_0x1a4a('0x7'))(_0x1a4a('0x8'));var config=require(_0x1a4a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1a4a('0xa')][_0x1a4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x505a5b,_0x359d92,_0x19ec23){return new BPromise(function(_0x30ec2d,_0x17c282){return client['request'](_0x505a5b,_0x19ec23)[_0x1a4a('0xc')](function(_0x433ae5){logger[_0x1a4a('0xd')](_0x1a4a('0xe'),_0x359d92,_0x1a4a('0xf'));logger[_0x1a4a('0x10')](_0x1a4a('0x11'),_0x359d92,_0x1a4a('0xf'),JSON[_0x1a4a('0x12')](_0x433ae5));if(_0x433ae5[_0x1a4a('0x13')]){if(_0x433ae5[_0x1a4a('0x13')][_0x1a4a('0x14')]===0x1f4){logger[_0x1a4a('0x13')]('SquareMessage,\x20%s,\x20%s',_0x359d92,_0x433ae5[_0x1a4a('0x13')][_0x1a4a('0x15')]);return _0x17c282(_0x433ae5[_0x1a4a('0x13')][_0x1a4a('0x15')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x359d92,_0x433ae5[_0x1a4a('0x13')][_0x1a4a('0x15')]);return _0x30ec2d(_0x433ae5['error'][_0x1a4a('0x15')]);}else{logger['info'](_0x1a4a('0xe'),_0x359d92,_0x1a4a('0xf'));_0x30ec2d(_0x433ae5[_0x1a4a('0x16')]['message']);}})[_0x1a4a('0x17')](function(_0x3b5fc5){logger['error'](_0x1a4a('0xe'),_0x359d92,_0x3b5fc5);_0x17c282(_0x3b5fc5);});});}exports[_0x1a4a('0x18')]=function(_0x105d8a){var _0xa99d8c=this;return new Promise(function(_0x2842a0,_0x2c751f){return db['SquareMessage'][_0x1a4a('0x19')](_0x105d8a[_0x1a4a('0x1a')],{'raw':_0x105d8a['options']?_0x105d8a[_0x1a4a('0x1b')][_0x1a4a('0x1c')]===undefined?!![]:![]:!![]})[_0x1a4a('0xc')](function(_0x43b0e2){logger[_0x1a4a('0xd')](_0x1a4a('0x18'),_0x105d8a);logger[_0x1a4a('0x10')]('CreateSquareMessage',_0x105d8a,JSON['stringify'](_0x43b0e2));_0x2842a0(_0x43b0e2);})[_0x1a4a('0x17')](function(_0x5c07fc){logger['error'](_0x1a4a('0x18'),_0x5c07fc[_0x1a4a('0x15')],_0x105d8a);_0x2c751f(_0xa99d8c[_0x1a4a('0x13')](0x1f4,_0x5c07fc[_0x1a4a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9f93992..9a20032 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 _0xd380=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/test','15s','test','post','/:id','update','delete'];(function(_0x4d9fc,_0x865376){var _0x1b47ce=function(_0x2b6ffb){while(--_0x2b6ffb){_0x4d9fc['push'](_0x4d9fc['shift']());}};_0x1b47ce(++_0x865376);}(_0xd380,0x156));var _0x0d38=function(_0x39bf92,_0x134911){_0x39bf92=_0x39bf92-0x0;var _0x4043ff=_0xd380[_0x39bf92];return _0x4043ff;};'use strict';var multer=require('multer');var util=require(_0x0d38('0x0'));var path=require(_0x0d38('0x1'));var timeout=require(_0x0d38('0x2'));var express=require(_0x0d38('0x3'));var router=express['Router']();var fs_extra=require(_0x0d38('0x4'));var auth=require(_0x0d38('0x5'));var interaction=require(_0x0d38('0x6'));var config=require(_0x0d38('0x7'));var controller=require('./squareOdbc.controller');router[_0x0d38('0x8')]('/',auth[_0x0d38('0x9')](),controller['index']);router[_0x0d38('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0d38('0xa')]);router[_0x0d38('0x8')](_0x0d38('0xb'),auth[_0x0d38('0x9')](),timeout(_0x0d38('0xc')),controller[_0x0d38('0xd')]);router[_0x0d38('0xe')]('/',auth[_0x0d38('0x9')](),controller['create']);router['put'](_0x0d38('0xf'),auth[_0x0d38('0x9')](),controller[_0x0d38('0x10')]);router[_0x0d38('0x11')]('/:id',auth[_0x0d38('0x9')](),controller[_0x0d38('0x12')]);module[_0x0d38('0x13')]=router; \ No newline at end of file +var _0x6501=['isAuthenticated','update','delete','destroy','util','connect-timeout','fs-extra','../../config/environment','get','/:id','/:id/test','15s','test','post','put'];(function(_0x15f908,_0x19d8b9){var _0x51b9d3=function(_0x2ec918){while(--_0x2ec918){_0x15f908['push'](_0x15f908['shift']());}};_0x51b9d3(++_0x19d8b9);}(_0x6501,0x8b));var _0x1650=function(_0x4dd1ec,_0x3cfc58){_0x4dd1ec=_0x4dd1ec-0x0;var _0x186d28=_0x6501[_0x4dd1ec];return _0x186d28;};'use strict';var multer=require('multer');var util=require(_0x1650('0x0'));var path=require('path');var timeout=require(_0x1650('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1650('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1650('0x3'));var controller=require('./squareOdbc.controller');router[_0x1650('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1650('0x5'),auth['isAuthenticated'](),controller['show']);router[_0x1650('0x4')](_0x1650('0x6'),auth['isAuthenticated'](),timeout(_0x1650('0x7')),controller[_0x1650('0x8')]);router[_0x1650('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1650('0xa')]('/:id',auth[_0x1650('0xb')](),controller[_0x1650('0xc')]);router[_0x1650('0xd')](_0x1650('0x5'),auth[_0x1650('0xb')](),controller[_0x1650('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index eb5d34e..67e1fdb 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 _0x3abe=['name','sequelize','STRING'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0x3abe,0x1cc));var _0xe3ab=function(_0x5c52f7,_0x123409){_0x5c52f7=_0x5c52f7-0x0;var _0x167068=_0x3abe[_0x5c52f7];return _0x167068;};'use strict';var Sequelize=require(_0xe3ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3ab('0x1')],'unique':_0xe3ab('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe3ab('0x1')]},'description':{'type':Sequelize[_0xe3ab('0x1')]}}; \ No newline at end of file +var _0x26f3=['STRING','name','exports'];(function(_0x49c008,_0x15dfd1){var _0x2626e4=function(_0xc1bfbd){while(--_0xc1bfbd){_0x49c008['push'](_0x49c008['shift']());}};_0x2626e4(++_0x15dfd1);}(_0x26f3,0x1df));var _0x326f=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x26f3[_0x55d829];return _0x52163b;};'use strict';var Sequelize=require('sequelize');module[_0x326f('0x0')]={'name':{'type':Sequelize[_0x326f('0x1')],'unique':_0x326f('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x326f('0x1')]},'description':{'type':Sequelize[_0x326f('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e053cf7..13d61ac 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 _0xa9d9=['catch','show','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9d9,0x122));var _0x9a9d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9d9[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x9a9d('0x0'));var rimraf=require(_0x9a9d('0x1'));var zipdir=require(_0x9a9d('0x2'));var jsonpatch=require(_0x9a9d('0x3'));var rp=require(_0x9a9d('0x4'));var moment=require(_0x9a9d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a9d('0x6'));var path=require(_0x9a9d('0x7'));var sox=require(_0x9a9d('0x8'));var csv=require(_0x9a9d('0x9'));var ejs=require(_0x9a9d('0xa'));var fs=require('fs');var fs_extra=require(_0x9a9d('0xb'));var _=require(_0x9a9d('0xc'));var squel=require(_0x9a9d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a9d('0xe'));var toCsv=require(_0x9a9d('0x9'));var querystring=require('querystring');var Papa=require(_0x9a9d('0xf'));var Redis=require(_0x9a9d('0x10'));var authService=require(_0x9a9d('0x11'));var qs=require(_0x9a9d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a9d('0x13'));var logger=require('../../config/logger')(_0x9a9d('0x14'));var utils=require('../../config/utils');var config=require(_0x9a9d('0x15'));var licenseUtil=require(_0x9a9d('0x16'));var db=require(_0x9a9d('0x17'))['db'];function respondWithStatusCode(_0x26745d,_0x40cdc5){_0x40cdc5=_0x40cdc5||0xcc;return function(_0x418ee3){if(_0x418ee3){return _0x26745d[_0x9a9d('0x18')](_0x40cdc5);}return _0x26745d['status'](_0x40cdc5)[_0x9a9d('0x19')]();};}function respondWithResult(_0x187a6b,_0x5ad4c5){_0x5ad4c5=_0x5ad4c5||0xc8;return function(_0x451210){if(_0x451210){return _0x187a6b[_0x9a9d('0x1a')](_0x5ad4c5)[_0x9a9d('0x1b')](_0x451210);}};}function respondWithFilteredResult(_0x3bccda,_0x3c8da8){return function(_0x31213d){if(_0x31213d){var _0x173f23=typeof _0x3c8da8[_0x9a9d('0x1c')]===_0x9a9d('0x1d')&&typeof _0x3c8da8['limit']===_0x9a9d('0x1d');var _0x584cba=_0x31213d[_0x9a9d('0x1e')];var _0x5d6779=_0x173f23?0x0:_0x3c8da8[_0x9a9d('0x1c')];var _0x7dffbe=_0x173f23?_0x31213d[_0x9a9d('0x1e')]:_0x3c8da8[_0x9a9d('0x1c')]+_0x3c8da8[_0x9a9d('0x1f')];var _0x886e1c;if(_0x7dffbe>=_0x584cba){_0x7dffbe=_0x584cba;_0x886e1c=0xc8;}else{_0x886e1c=0xce;}_0x3bccda[_0x9a9d('0x1a')](_0x886e1c);return _0x3bccda[_0x9a9d('0x20')](_0x9a9d('0x21'),_0x5d6779+'-'+_0x7dffbe+'/'+_0x584cba)[_0x9a9d('0x1b')](_0x31213d);}return null;};}function patchUpdates(_0x25bcfc){return function(_0x84e52){try{jsonpatch[_0x9a9d('0x22')](_0x84e52,_0x25bcfc,!![]);}catch(_0x2c978d){return BPromise[_0x9a9d('0x23')](_0x2c978d);}return _0x84e52[_0x9a9d('0x24')]();};}function saveUpdates(_0x4adf12,_0x3ac763){return function(_0x4de336){if(_0x4de336){return _0x4de336[_0x9a9d('0x25')](_0x4adf12)[_0x9a9d('0x26')](function(_0x30cfec){return _0x30cfec;});}return null;};}function removeEntity(_0x47a9dc,_0x5ede64){return function(_0x3e76d6){if(_0x3e76d6){return _0x3e76d6['destroy']()[_0x9a9d('0x26')](function(){var _0x5e27bf=_0x3e76d6[_0x9a9d('0x27')]({'plain':!![]});var _0x5d7ca8=_0x9a9d('0x28');return db[_0x9a9d('0x29')][_0x9a9d('0x2a')]({'where':{'type':_0x5d7ca8,'resourceId':_0x5e27bf['id']}})[_0x9a9d('0x26')](function(){return _0x3e76d6;});})[_0x9a9d('0x26')](function(){_0x47a9dc[_0x9a9d('0x1a')](0xcc)[_0x9a9d('0x19')]();});}};}function handleEntityNotFound(_0x5a9605,_0xc91381){return function(_0x1c94fd){if(!_0x1c94fd){_0x5a9605[_0x9a9d('0x18')](0x194);}return _0x1c94fd;};}function handleError(_0x44cee0,_0x2663f3){_0x2663f3=_0x2663f3||0x1f4;return function(_0x433668){logger[_0x9a9d('0x2b')](_0x433668[_0x9a9d('0x2c')]);if(_0x433668[_0x9a9d('0x2d')]){delete _0x433668['name'];}_0x44cee0['status'](_0x2663f3)[_0x9a9d('0x2e')](_0x433668);};}exports[_0x9a9d('0x2f')]=function(_0x814d76,_0x121553){var _0x247056={},_0x4647bc={},_0x56e1b3={'count':0x0,'rows':[]};var _0x2f0c0c=_[_0x9a9d('0x30')](db[_0x9a9d('0x31')][_0x9a9d('0x32')],function(_0x1995de){return{'name':_0x1995de[_0x9a9d('0x33')],'type':_0x1995de[_0x9a9d('0x34')]['key']};});_0x4647bc[_0x9a9d('0x35')]=_[_0x9a9d('0x30')](_0x2f0c0c,_0x9a9d('0x2d'));_0x4647bc['query']=_[_0x9a9d('0x36')](_0x814d76[_0x9a9d('0x37')]);_0x4647bc['filters']=_[_0x9a9d('0x38')](_0x4647bc['model'],_0x4647bc[_0x9a9d('0x37')]);_0x247056[_0x9a9d('0x39')]=_[_0x9a9d('0x38')](_0x4647bc['model'],qs[_0x9a9d('0x3a')](_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x3a')]));_0x247056[_0x9a9d('0x39')]=_0x247056[_0x9a9d('0x39')][_0x9a9d('0x3b')]?_0x247056[_0x9a9d('0x39')]:_0x4647bc[_0x9a9d('0x35')];if(!_0x814d76['query'][_0x9a9d('0x3c')](_0x9a9d('0x3d'))){_0x247056['limit']=qs['limit'](_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x1f')]);_0x247056[_0x9a9d('0x1c')]=qs[_0x9a9d('0x1c')](_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x1c')]);}_0x247056[_0x9a9d('0x3e')]=qs[_0x9a9d('0x3f')](_0x814d76['query'][_0x9a9d('0x3f')]);_0x247056[_0x9a9d('0x40')]=qs['filters'](_[_0x9a9d('0x41')](_0x814d76['query'],_0x4647bc[_0x9a9d('0x42')]),_0x2f0c0c);if(_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x43')]){_0x247056[_0x9a9d('0x40')]=_[_0x9a9d('0x44')](_0x247056[_0x9a9d('0x40')],{'$or':_[_0x9a9d('0x30')](_0x2f0c0c,function(_0x3861ab){if(_0x3861ab[_0x9a9d('0x34')]!==_0x9a9d('0x45')){var _0x32615c={};_0x32615c[_0x3861ab[_0x9a9d('0x2d')]]={'$like':'%'+_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x43')]+'%'};return _0x32615c;}})});}_0x247056=_[_0x9a9d('0x44')]({},_0x247056,_0x814d76['options']);var _0x2479dd={'where':_0x247056[_0x9a9d('0x40')]};return db[_0x9a9d('0x31')][_0x9a9d('0x1e')](_0x2479dd)[_0x9a9d('0x26')](function(_0x49170b){_0x56e1b3[_0x9a9d('0x1e')]=_0x49170b;if(_0x814d76[_0x9a9d('0x37')][_0x9a9d('0x46')]){_0x247056[_0x9a9d('0x47')]=[{'all':!![]}];}return db[_0x9a9d('0x31')][_0x9a9d('0x48')](_0x247056);})[_0x9a9d('0x26')](function(_0x46a1b1){_0x56e1b3[_0x9a9d('0x49')]=_0x46a1b1;return _0x56e1b3;})[_0x9a9d('0x26')](respondWithFilteredResult(_0x121553,_0x247056))[_0x9a9d('0x4a')](handleError(_0x121553,null));};exports[_0x9a9d('0x4b')]=function(_0x46f7b5,_0x3913b8){var _0x2f31fb={'raw':!![],'where':{'id':_0x46f7b5[_0x9a9d('0x4c')]['id']}},_0x9e9bc7={};_0x9e9bc7['model']=_[_0x9a9d('0x36')](db['SquareOdbc'][_0x9a9d('0x32')]);_0x9e9bc7['query']=_[_0x9a9d('0x36')](_0x46f7b5['query']);_0x9e9bc7[_0x9a9d('0x42')]=_[_0x9a9d('0x38')](_0x9e9bc7[_0x9a9d('0x35')],_0x9e9bc7[_0x9a9d('0x37')]);_0x2f31fb[_0x9a9d('0x39')]=_[_0x9a9d('0x38')](_0x9e9bc7[_0x9a9d('0x35')],qs[_0x9a9d('0x3a')](_0x46f7b5['query'][_0x9a9d('0x3a')]));_0x2f31fb[_0x9a9d('0x39')]=_0x2f31fb[_0x9a9d('0x39')]['length']?_0x2f31fb[_0x9a9d('0x39')]:_0x9e9bc7[_0x9a9d('0x35')];if(_0x46f7b5[_0x9a9d('0x37')][_0x9a9d('0x46')]){_0x2f31fb['include']=[{'all':!![]}];}_0x2f31fb=_[_0x9a9d('0x44')]({},_0x2f31fb,_0x46f7b5[_0x9a9d('0x4d')]);return db[_0x9a9d('0x31')][_0x9a9d('0x4e')](_0x2f31fb)[_0x9a9d('0x26')](handleEntityNotFound(_0x3913b8,null))[_0x9a9d('0x26')](respondWithResult(_0x3913b8,null))[_0x9a9d('0x4a')](handleError(_0x3913b8,null));};exports['create']=function(_0x198c42,_0x4baa02){return db['SquareOdbc'][_0x9a9d('0x4f')](_0x198c42['body'],{})[_0x9a9d('0x26')](function(_0x2a7304){var _0x417466=_0x198c42['user'][_0x9a9d('0x27')]({'plain':!![]});if(!_0x417466)throw new Error(_0x9a9d('0x50'));if(_0x417466[_0x9a9d('0x51')]===_0x9a9d('0x52')){var _0x4a9e15=_0x2a7304['get']({'plain':!![]});var _0x496478=_0x9a9d('0x28');return db[_0x9a9d('0x53')]['find']({'where':{'name':_0x496478,'userProfileId':_0x417466[_0x9a9d('0x54')]},'raw':!![]})[_0x9a9d('0x26')](function(_0x116e3e){if(_0x116e3e&&_0x116e3e[_0x9a9d('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a9e15[_0x9a9d('0x2d')],'resourceId':_0x4a9e15['id'],'type':_0x116e3e[_0x9a9d('0x2d')],'sectionId':_0x116e3e['id']},{})[_0x9a9d('0x26')](function(){return _0x2a7304;});}else{return _0x2a7304;}})[_0x9a9d('0x4a')](function(_0x1a4ed4){logger[_0x9a9d('0x2b')](_0x9a9d('0x56'),_0x1a4ed4);throw _0x1a4ed4;});}return _0x2a7304;})[_0x9a9d('0x26')](respondWithResult(_0x4baa02,0xc9))[_0x9a9d('0x4a')](handleError(_0x4baa02,null));};exports[_0x9a9d('0x25')]=function(_0x1765e9,_0x4aa4fe){if(_0x1765e9['body']['id']){delete _0x1765e9[_0x9a9d('0x57')]['id'];}return db[_0x9a9d('0x31')][_0x9a9d('0x4e')]({'where':{'id':_0x1765e9[_0x9a9d('0x4c')]['id']}})[_0x9a9d('0x26')](handleEntityNotFound(_0x4aa4fe,null))[_0x9a9d('0x26')](saveUpdates(_0x1765e9[_0x9a9d('0x57')],null))[_0x9a9d('0x26')](respondWithResult(_0x4aa4fe,null))[_0x9a9d('0x4a')](handleError(_0x4aa4fe,null));};exports[_0x9a9d('0x2a')]=function(_0x1d3a00,_0xa9249){return db[_0x9a9d('0x31')][_0x9a9d('0x4e')]({'where':{'id':_0x1d3a00[_0x9a9d('0x4c')]['id']}})[_0x9a9d('0x26')](handleEntityNotFound(_0xa9249,null))[_0x9a9d('0x26')](removeEntity(_0xa9249,null))[_0x9a9d('0x4a')](handleError(_0xa9249,null));};exports[_0x9a9d('0x58')]=function(_0x51bb5f,_0x3df679,_0x3caaac){var _0x4df4af;return db[_0x9a9d('0x31')][_0x9a9d('0x4e')]({'where':{'id':_0x51bb5f[_0x9a9d('0x4c')]['id']},'attributes':['id',_0x9a9d('0x59')]})[_0x9a9d('0x26')](handleEntityNotFound(_0x3df679,null))[_0x9a9d('0x26')](function(_0xfe8d3e){if(_0xfe8d3e){var _0x4b2faa=require('odbc')();_0x4b2faa[_0x9a9d('0x5a')](_0xfe8d3e[_0x9a9d('0x59')]);_0x4b2faa['closeSync']();return _0xfe8d3e;}})[_0x9a9d('0x26')](respondWithResult(_0x3df679,null))[_0x9a9d('0x4a')](handleError(_0x3df679,null));}; \ No newline at end of file +var _0x906b=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','params','test','dsn','openSync','closeSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','limit','count','offset','set','apply','reject','save','destroy','then','get','ODBC','UserProfileResource','status','end','error','send','index','SquareOdbc','fieldName','type','key','model','map','name','keys'];(function(_0x2a5a73,_0x27570f){var _0x4703da=function(_0x4f04af){while(--_0x4f04af){_0x2a5a73['push'](_0x2a5a73['shift']());}};_0x4703da(++_0x27570f);}(_0x906b,0x128));var _0xb906=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x906b[_0x48e1ec];return _0x3b33eb;};'use strict';var emlformat=require(_0xb906('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb906('0x1'));var rp=require(_0xb906('0x2'));var moment=require(_0xb906('0x3'));var BPromise=require(_0xb906('0x4'));var Mustache=require(_0xb906('0x5'));var util=require(_0xb906('0x6'));var path=require('path');var sox=require(_0xb906('0x7'));var csv=require(_0xb906('0x8'));var ejs=require(_0xb906('0x9'));var fs=require('fs');var fs_extra=require(_0xb906('0xa'));var _=require(_0xb906('0xb'));var squel=require(_0xb906('0xc'));var crypto=require(_0xb906('0xd'));var jsforce=require(_0xb906('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb906('0x8'));var querystring=require(_0xb906('0xf'));var Papa=require(_0xb906('0x10'));var Redis=require(_0xb906('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb906('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb906('0x13'));var logger=require(_0xb906('0x14'))(_0xb906('0x15'));var utils=require(_0xb906('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb906('0x17'));var db=require(_0xb906('0x18'))['db'];function respondWithStatusCode(_0x1c628e,_0x7f2266){_0x7f2266=_0x7f2266||0xcc;return function(_0xa61a54){if(_0xa61a54){return _0x1c628e[_0xb906('0x19')](_0x7f2266);}return _0x1c628e['status'](_0x7f2266)['end']();};}function respondWithResult(_0x325e08,_0x4c58f8){_0x4c58f8=_0x4c58f8||0xc8;return function(_0x4c7893){if(_0x4c7893){return _0x325e08['status'](_0x4c58f8)[_0xb906('0x1a')](_0x4c7893);}};}function respondWithFilteredResult(_0x2d0c2f,_0x1a26db){return function(_0xe76ccd){if(_0xe76ccd){var _0x41542b=typeof _0x1a26db['offset']==='undefined'&&typeof _0x1a26db[_0xb906('0x1b')]==='undefined';var _0xedf17e=_0xe76ccd[_0xb906('0x1c')];var _0x5a1a80=_0x41542b?0x0:_0x1a26db[_0xb906('0x1d')];var _0x21378c=_0x41542b?_0xe76ccd[_0xb906('0x1c')]:_0x1a26db[_0xb906('0x1d')]+_0x1a26db['limit'];var _0x5c997b;if(_0x21378c>=_0xedf17e){_0x21378c=_0xedf17e;_0x5c997b=0xc8;}else{_0x5c997b=0xce;}_0x2d0c2f['status'](_0x5c997b);return _0x2d0c2f[_0xb906('0x1e')]('Content-Range',_0x5a1a80+'-'+_0x21378c+'/'+_0xedf17e)['json'](_0xe76ccd);}return null;};}function patchUpdates(_0xbc7e16){return function(_0x479cee){try{jsonpatch[_0xb906('0x1f')](_0x479cee,_0xbc7e16,!![]);}catch(_0x389533){return BPromise[_0xb906('0x20')](_0x389533);}return _0x479cee[_0xb906('0x21')]();};}function saveUpdates(_0x5e4fe3,_0x5916b3){return function(_0x41537f){if(_0x41537f){return _0x41537f['update'](_0x5e4fe3)['then'](function(_0x457656){return _0x457656;});}return null;};}function removeEntity(_0x53df26,_0x48c42f){return function(_0x2b190e){if(_0x2b190e){return _0x2b190e[_0xb906('0x22')]()[_0xb906('0x23')](function(){var _0x5170ab=_0x2b190e[_0xb906('0x24')]({'plain':!![]});var _0x440a79=_0xb906('0x25');return db[_0xb906('0x26')][_0xb906('0x22')]({'where':{'type':_0x440a79,'resourceId':_0x5170ab['id']}})[_0xb906('0x23')](function(){return _0x2b190e;});})[_0xb906('0x23')](function(){_0x53df26[_0xb906('0x27')](0xcc)[_0xb906('0x28')]();});}};}function handleEntityNotFound(_0x5e7b07,_0x273e20){return function(_0x556ac5){if(!_0x556ac5){_0x5e7b07[_0xb906('0x19')](0x194);}return _0x556ac5;};}function handleError(_0x1afa9b,_0x4a1f4b){_0x4a1f4b=_0x4a1f4b||0x1f4;return function(_0x1000a3){logger[_0xb906('0x29')](_0x1000a3['stack']);if(_0x1000a3['name']){delete _0x1000a3['name'];}_0x1afa9b[_0xb906('0x27')](_0x4a1f4b)[_0xb906('0x2a')](_0x1000a3);};}exports[_0xb906('0x2b')]=function(_0x2403bc,_0x134fee){var _0xfc2126={},_0xf585dc={},_0x28a9e9={'count':0x0,'rows':[]};var _0x1fdafc=_['map'](db[_0xb906('0x2c')]['rawAttributes'],function(_0x2643fd){return{'name':_0x2643fd[_0xb906('0x2d')],'type':_0x2643fd[_0xb906('0x2e')][_0xb906('0x2f')]};});_0xf585dc[_0xb906('0x30')]=_[_0xb906('0x31')](_0x1fdafc,_0xb906('0x32'));_0xf585dc['query']=_[_0xb906('0x33')](_0x2403bc[_0xb906('0x34')]);_0xf585dc[_0xb906('0x35')]=_[_0xb906('0x36')](_0xf585dc[_0xb906('0x30')],_0xf585dc[_0xb906('0x34')]);_0xfc2126['attributes']=_[_0xb906('0x36')](_0xf585dc[_0xb906('0x30')],qs['fields'](_0x2403bc[_0xb906('0x34')][_0xb906('0x37')]));_0xfc2126[_0xb906('0x38')]=_0xfc2126[_0xb906('0x38')][_0xb906('0x39')]?_0xfc2126[_0xb906('0x38')]:_0xf585dc[_0xb906('0x30')];if(!_0x2403bc[_0xb906('0x34')][_0xb906('0x3a')](_0xb906('0x3b'))){_0xfc2126['limit']=qs[_0xb906('0x1b')](_0x2403bc[_0xb906('0x34')][_0xb906('0x1b')]);_0xfc2126['offset']=qs[_0xb906('0x1d')](_0x2403bc[_0xb906('0x34')][_0xb906('0x1d')]);}_0xfc2126['order']=qs[_0xb906('0x3c')](_0x2403bc[_0xb906('0x34')]['sort']);_0xfc2126['where']=qs[_0xb906('0x35')](_['pick'](_0x2403bc[_0xb906('0x34')],_0xf585dc['filters']),_0x1fdafc);if(_0x2403bc['query'][_0xb906('0x3d')]){_0xfc2126[_0xb906('0x3e')]=_['merge'](_0xfc2126[_0xb906('0x3e')],{'$or':_[_0xb906('0x31')](_0x1fdafc,function(_0x1faa17){if(_0x1faa17[_0xb906('0x2e')]!==_0xb906('0x3f')){var _0x1aa82a={};_0x1aa82a[_0x1faa17[_0xb906('0x32')]]={'$like':'%'+_0x2403bc[_0xb906('0x34')][_0xb906('0x3d')]+'%'};return _0x1aa82a;}})});}_0xfc2126=_[_0xb906('0x40')]({},_0xfc2126,_0x2403bc[_0xb906('0x41')]);var _0x4b261d={'where':_0xfc2126[_0xb906('0x3e')]};return db['SquareOdbc'][_0xb906('0x1c')](_0x4b261d)[_0xb906('0x23')](function(_0x46128c){_0x28a9e9[_0xb906('0x1c')]=_0x46128c;if(_0x2403bc[_0xb906('0x34')][_0xb906('0x42')]){_0xfc2126[_0xb906('0x43')]=[{'all':!![]}];}return db[_0xb906('0x2c')][_0xb906('0x44')](_0xfc2126);})[_0xb906('0x23')](function(_0x19d87c){_0x28a9e9[_0xb906('0x45')]=_0x19d87c;return _0x28a9e9;})[_0xb906('0x23')](respondWithFilteredResult(_0x134fee,_0xfc2126))['catch'](handleError(_0x134fee,null));};exports[_0xb906('0x46')]=function(_0x293cb7,_0x31a309){var _0x26bc28={'raw':!![],'where':{'id':_0x293cb7['params']['id']}},_0x4f0f53={};_0x4f0f53[_0xb906('0x30')]=_[_0xb906('0x33')](db[_0xb906('0x2c')][_0xb906('0x47')]);_0x4f0f53[_0xb906('0x34')]=_[_0xb906('0x33')](_0x293cb7['query']);_0x4f0f53[_0xb906('0x35')]=_[_0xb906('0x36')](_0x4f0f53['model'],_0x4f0f53[_0xb906('0x34')]);_0x26bc28['attributes']=_[_0xb906('0x36')](_0x4f0f53[_0xb906('0x30')],qs[_0xb906('0x37')](_0x293cb7[_0xb906('0x34')]['fields']));_0x26bc28[_0xb906('0x38')]=_0x26bc28['attributes']['length']?_0x26bc28[_0xb906('0x38')]:_0x4f0f53[_0xb906('0x30')];if(_0x293cb7[_0xb906('0x34')][_0xb906('0x42')]){_0x26bc28['include']=[{'all':!![]}];}_0x26bc28=_[_0xb906('0x40')]({},_0x26bc28,_0x293cb7[_0xb906('0x41')]);return db[_0xb906('0x2c')][_0xb906('0x48')](_0x26bc28)[_0xb906('0x23')](handleEntityNotFound(_0x31a309,null))[_0xb906('0x23')](respondWithResult(_0x31a309,null))[_0xb906('0x49')](handleError(_0x31a309,null));};exports[_0xb906('0x4a')]=function(_0x1761c1,_0x15584b){return db[_0xb906('0x2c')][_0xb906('0x4a')](_0x1761c1[_0xb906('0x4b')],{})[_0xb906('0x23')](function(_0xd9f809){var _0x27963a=_0x1761c1[_0xb906('0x4c')][_0xb906('0x24')]({'plain':!![]});if(!_0x27963a)throw new Error(_0xb906('0x4d'));if(_0x27963a[_0xb906('0x4e')]===_0xb906('0x4c')){var _0x437696=_0xd9f809['get']({'plain':!![]});var _0x1704d3=_0xb906('0x25');return db[_0xb906('0x4f')][_0xb906('0x48')]({'where':{'name':_0x1704d3,'userProfileId':_0x27963a[_0xb906('0x50')]},'raw':!![]})[_0xb906('0x23')](function(_0x290d23){if(_0x290d23&&_0x290d23['autoAssociation']===0x0){return db[_0xb906('0x26')][_0xb906('0x4a')]({'name':_0x437696[_0xb906('0x32')],'resourceId':_0x437696['id'],'type':_0x290d23['name'],'sectionId':_0x290d23['id']},{})['then'](function(){return _0xd9f809;});}else{return _0xd9f809;}})[_0xb906('0x49')](function(_0x2ff300){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ff300);throw _0x2ff300;});}return _0xd9f809;})[_0xb906('0x23')](respondWithResult(_0x15584b,0xc9))[_0xb906('0x49')](handleError(_0x15584b,null));};exports[_0xb906('0x51')]=function(_0x549281,_0x47ee17){if(_0x549281['body']['id']){delete _0x549281[_0xb906('0x4b')]['id'];}return db[_0xb906('0x2c')][_0xb906('0x48')]({'where':{'id':_0x549281[_0xb906('0x52')]['id']}})[_0xb906('0x23')](handleEntityNotFound(_0x47ee17,null))['then'](saveUpdates(_0x549281[_0xb906('0x4b')],null))[_0xb906('0x23')](respondWithResult(_0x47ee17,null))['catch'](handleError(_0x47ee17,null));};exports[_0xb906('0x22')]=function(_0x3265c0,_0x534641){return db['SquareOdbc'][_0xb906('0x48')]({'where':{'id':_0x3265c0[_0xb906('0x52')]['id']}})[_0xb906('0x23')](handleEntityNotFound(_0x534641,null))['then'](removeEntity(_0x534641,null))[_0xb906('0x49')](handleError(_0x534641,null));};exports[_0xb906('0x53')]=function(_0x26a09d,_0x6321c9,_0x5733b5){var _0x3bc5fe;return db[_0xb906('0x2c')][_0xb906('0x48')]({'where':{'id':_0x26a09d[_0xb906('0x52')]['id']},'attributes':['id',_0xb906('0x54')]})[_0xb906('0x23')](handleEntityNotFound(_0x6321c9,null))['then'](function(_0xb736c4){if(_0xb736c4){var _0x2a2419=require('odbc')();_0x2a2419[_0xb906('0x55')](_0xb736c4['dsn']);_0x2a2419[_0xb906('0x56')]();return _0xb736c4;}})[_0xb906('0x23')](respondWithResult(_0x6321c9,null))['catch'](handleError(_0x6321c9,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 09dda11..94249e0 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 _0xd72b=['exports','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x1fb6ff,_0x474709){var _0x339f61=function(_0x424713){while(--_0x424713){_0x1fb6ff['push'](_0x1fb6ff['shift']());}};_0x339f61(++_0x474709);}(_0xd72b,0x176));var _0xbd72=function(_0xfe437e,_0x54557e){_0xfe437e=_0xfe437e-0x0;var _0x70f17e=_0xd72b[_0xfe437e];return _0x70f17e;};'use strict';var _=require(_0xbd72('0x0'));var util=require(_0xbd72('0x1'));var logger=require(_0xbd72('0x2'))(_0xbd72('0x3'));var moment=require(_0xbd72('0x4'));var BPromise=require(_0xbd72('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd72('0x6'));var rimraf=require(_0xbd72('0x7'));var config=require(_0xbd72('0x8'));var attributes=require(_0xbd72('0x9'));module[_0xbd72('0xa')]=function(_0x510657,_0x124b84){return _0x510657['define'](_0xbd72('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a8c=['exports','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes'];(function(_0xe3b82e,_0x53bc13){var _0x48204c=function(_0xc18e20){while(--_0xc18e20){_0xe3b82e['push'](_0xe3b82e['shift']());}};_0x48204c(++_0x53bc13);}(_0x7a8c,0xaa));var _0xc7a8=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7a8c[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xc7a8('0x0'));var util=require(_0xc7a8('0x1'));var logger=require(_0xc7a8('0x2'))(_0xc7a8('0x3'));var moment=require(_0xc7a8('0x4'));var BPromise=require(_0xc7a8('0x5'));var rp=require(_0xc7a8('0x6'));var fs=require('fs');var path=require(_0xc7a8('0x7'));var rimraf=require(_0xc7a8('0x8'));var config=require('../../config/environment');var attributes=require(_0xc7a8('0x9'));module[_0xc7a8('0xa')]=function(_0xa37a3d,_0x14db59){return _0xa37a3d['define']('SquareOdbc',attributes,{'tableName':_0xc7a8('0xb'),'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 f8c4499..b0fdf19 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 _0xd667=['where','include','map','model','attributes','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSquareOdbc','find','options'];(function(_0x57ac66,_0x528cf6){var _0x42d12f=function(_0x5da7c9){while(--_0x5da7c9){_0x57ac66['push'](_0x57ac66['shift']());}};_0x42d12f(++_0x528cf6);}(_0xd667,0x16e));var _0x7d66=function(_0x5f04bf,_0x12854f){_0x5f04bf=_0x5f04bf-0x0;var _0x288ea1=_0xd667[_0x5f04bf];return _0x288ea1;};'use strict';var _=require(_0x7d66('0x0'));var util=require('util');var moment=require(_0x7d66('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d66('0x2'));var fs=require('fs');var Redis=require(_0x7d66('0x3'));var db=require(_0x7d66('0x4'))['db'];var utils=require(_0x7d66('0x5'));var logger=require(_0x7d66('0x6'))(_0x7d66('0x7'));var config=require(_0x7d66('0x8'));var jayson=require(_0x7d66('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11f684,_0x597ba8,_0x303b3){return new BPromise(function(_0x305e8d,_0x2addd4){return client[_0x7d66('0xa')](_0x11f684,_0x303b3)[_0x7d66('0xb')](function(_0x50e518){logger['info'](_0x7d66('0xc'),_0x597ba8,_0x7d66('0xd'));logger[_0x7d66('0xe')](_0x7d66('0xf'),_0x597ba8,_0x7d66('0xd'),JSON[_0x7d66('0x10')](_0x50e518));if(_0x50e518[_0x7d66('0x11')]){if(_0x50e518[_0x7d66('0x11')]['code']===0x1f4){logger[_0x7d66('0x11')](_0x7d66('0xc'),_0x597ba8,_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);return _0x2addd4(_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);}logger[_0x7d66('0x11')](_0x7d66('0xc'),_0x597ba8,_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);return _0x305e8d(_0x50e518[_0x7d66('0x11')][_0x7d66('0x12')]);}else{logger[_0x7d66('0x13')](_0x7d66('0xc'),_0x597ba8,_0x7d66('0xd'));_0x305e8d(_0x50e518[_0x7d66('0x14')][_0x7d66('0x12')]);}})['catch'](function(_0xe11bde){logger[_0x7d66('0x11')](_0x7d66('0xc'),_0x597ba8,_0xe11bde);_0x2addd4(_0xe11bde);});});}exports[_0x7d66('0x15')]=function(_0x1ab7f4){var _0x251758=this;return new Promise(function(_0x2d4039,_0x1c82d5){return db['SquareOdbc'][_0x7d66('0x16')]({'raw':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4['options'][_0x7d66('0x18')]||null:null,'attributes':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4[_0x7d66('0x17')]['attributes']||null:null,'include':_0x1ab7f4[_0x7d66('0x17')]?_0x1ab7f4[_0x7d66('0x17')][_0x7d66('0x19')]?_[_0x7d66('0x1a')](_0x1ab7f4[_0x7d66('0x17')][_0x7d66('0x19')],function(_0x5c70ad){return{'model':db[_0x5c70ad[_0x7d66('0x1b')]],'as':_0x5c70ad['as'],'attributes':_0x5c70ad[_0x7d66('0x1c')],'include':_0x5c70ad[_0x7d66('0x19')]?_[_0x7d66('0x1a')](_0x5c70ad[_0x7d66('0x19')],function(_0x26f122){return{'model':db[_0x26f122[_0x7d66('0x1b')]],'as':_0x26f122['as'],'attributes':_0x26f122[_0x7d66('0x1c')],'include':_0x26f122[_0x7d66('0x19')]?_[_0x7d66('0x1a')](_0x26f122[_0x7d66('0x19')],function(_0x29033f){return{'model':db[_0x29033f[_0x7d66('0x1b')]],'as':_0x29033f['as'],'attributes':_0x29033f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58c746){logger[_0x7d66('0x13')](_0x7d66('0x15'),_0x1ab7f4);logger[_0x7d66('0xe')](_0x7d66('0x15'),_0x1ab7f4,JSON[_0x7d66('0x10')](_0x58c746));_0x2d4039(_0x58c746);})[_0x7d66('0x1d')](function(_0x54f290){logger[_0x7d66('0x11')](_0x7d66('0x15'),_0x54f290['message'],_0x1ab7f4);_0x1c82d5(_0x251758[_0x7d66('0x11')](0x1f4,_0x54f290['message']));});});}; \ No newline at end of file +var _0xc9b5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','find','options','raw','where','attributes','map','include','model','then','ShowSquareOdbc','stringify','lodash','util'];(function(_0x11aa48,_0x566e75){var _0x5587d6=function(_0x16d3f5){while(--_0x16d3f5){_0x11aa48['push'](_0x11aa48['shift']());}};_0x5587d6(++_0x566e75);}(_0xc9b5,0x1cc));var _0x5c9b=function(_0xf85781,_0x443952){_0xf85781=_0xf85781-0x0;var _0x57a21f=_0xc9b5[_0xf85781];return _0x57a21f;};'use strict';var _=require(_0x5c9b('0x0'));var util=require(_0x5c9b('0x1'));var moment=require(_0x5c9b('0x2'));var BPromise=require(_0x5c9b('0x3'));var rs=require(_0x5c9b('0x4'));var fs=require('fs');var Redis=require(_0x5c9b('0x5'));var db=require(_0x5c9b('0x6'))['db'];var utils=require(_0x5c9b('0x7'));var logger=require(_0x5c9b('0x8'))('rpc');var config=require(_0x5c9b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5c9b('0xa')][_0x5c9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1aa062,_0x5a3ea7,_0x178460){return new BPromise(function(_0x1b7fe2,_0xe1a75){return client[_0x5c9b('0xc')](_0x1aa062,_0x178460)['then'](function(_0x49fdb9){logger['info'](_0x5c9b('0xd'),_0x5a3ea7,_0x5c9b('0xe'));logger[_0x5c9b('0xf')](_0x5c9b('0x10'),_0x5a3ea7,_0x5c9b('0xe'),JSON['stringify'](_0x49fdb9));if(_0x49fdb9[_0x5c9b('0x11')]){if(_0x49fdb9[_0x5c9b('0x11')][_0x5c9b('0x12')]===0x1f4){logger[_0x5c9b('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x5a3ea7,_0x49fdb9[_0x5c9b('0x11')][_0x5c9b('0x13')]);return _0xe1a75(_0x49fdb9[_0x5c9b('0x11')]['message']);}logger[_0x5c9b('0x11')](_0x5c9b('0xd'),_0x5a3ea7,_0x49fdb9[_0x5c9b('0x11')][_0x5c9b('0x13')]);return _0x1b7fe2(_0x49fdb9[_0x5c9b('0x11')][_0x5c9b('0x13')]);}else{logger[_0x5c9b('0x14')](_0x5c9b('0xd'),_0x5a3ea7,_0x5c9b('0xe'));_0x1b7fe2(_0x49fdb9['result'][_0x5c9b('0x13')]);}})[_0x5c9b('0x15')](function(_0x715c82){logger['error'](_0x5c9b('0xd'),_0x5a3ea7,_0x715c82);_0xe1a75(_0x715c82);});});}exports['ShowSquareOdbc']=function(_0xa5e3c1){var _0x55170f=this;return new Promise(function(_0x1e8eb5,_0x50cd9a){return db['SquareOdbc'][_0x5c9b('0x16')]({'raw':_0xa5e3c1[_0x5c9b('0x17')]?_0xa5e3c1['options'][_0x5c9b('0x18')]===undefined?!![]:![]:!![],'where':_0xa5e3c1[_0x5c9b('0x17')]?_0xa5e3c1[_0x5c9b('0x17')][_0x5c9b('0x19')]||null:null,'attributes':_0xa5e3c1[_0x5c9b('0x17')]?_0xa5e3c1[_0x5c9b('0x17')][_0x5c9b('0x1a')]||null:null,'include':_0xa5e3c1['options']?_0xa5e3c1[_0x5c9b('0x17')]['include']?_[_0x5c9b('0x1b')](_0xa5e3c1['options'][_0x5c9b('0x1c')],function(_0x63d637){return{'model':db[_0x63d637[_0x5c9b('0x1d')]],'as':_0x63d637['as'],'attributes':_0x63d637[_0x5c9b('0x1a')],'include':_0x63d637[_0x5c9b('0x1c')]?_['map'](_0x63d637['include'],function(_0x4c88f9){return{'model':db[_0x4c88f9[_0x5c9b('0x1d')]],'as':_0x4c88f9['as'],'attributes':_0x4c88f9[_0x5c9b('0x1a')],'include':_0x4c88f9[_0x5c9b('0x1c')]?_['map'](_0x4c88f9[_0x5c9b('0x1c')],function(_0x5009f3){return{'model':db[_0x5009f3[_0x5c9b('0x1d')]],'as':_0x5009f3['as'],'attributes':_0x5009f3[_0x5c9b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5c9b('0x1e')](function(_0x1cd9d0){logger[_0x5c9b('0x14')](_0x5c9b('0x1f'),_0xa5e3c1);logger[_0x5c9b('0xf')](_0x5c9b('0x1f'),_0xa5e3c1,JSON[_0x5c9b('0x20')](_0x1cd9d0));_0x1e8eb5(_0x1cd9d0);})[_0x5c9b('0x15')](function(_0x341d8c){logger[_0x5c9b('0x11')](_0x5c9b('0x1f'),_0x341d8c[_0x5c9b('0x13')],_0xa5e3c1);_0x50cd9a(_0x55170f[_0x5c9b('0x11')](0x1f4,_0x341d8c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 15f3aab..22c6605 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 _0x1021=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','put','delete','exports','multer'];(function(_0x4a3acd,_0x4bf641){var _0x3efdaa=function(_0x32842d){while(--_0x32842d){_0x4a3acd['push'](_0x4a3acd['shift']());}};_0x3efdaa(++_0x4bf641);}(_0x1021,0x125));var _0x1102=function(_0xc212b6,_0x4d69ec){_0xc212b6=_0xc212b6-0x0;var _0x3f7c10=_0x1021[_0xc212b6];return _0x3f7c10;};'use strict';var multer=require(_0x1102('0x0'));var util=require('util');var path=require(_0x1102('0x1'));var timeout=require(_0x1102('0x2'));var express=require(_0x1102('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1102('0x4'));var interaction=require(_0x1102('0x5'));var config=require(_0x1102('0x6'));var controller=require(_0x1102('0x7'));router[_0x1102('0x8')]('/',auth[_0x1102('0x9')](),controller['index']);router['get'](_0x1102('0xa'),auth[_0x1102('0x9')](),controller['show']);router['post']('/',auth[_0x1102('0x9')](),controller['create']);router[_0x1102('0xb')](_0x1102('0xa'),auth[_0x1102('0x9')](),controller['update']);router[_0x1102('0xc')](_0x1102('0xa'),auth[_0x1102('0x9')](),controller['destroy']);module[_0x1102('0xd')]=router; \ No newline at end of file +var _0x37ad=['show','post','create','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x37ad,0x9f));var _0xd37a=function(_0x192b52,_0x265fd6){_0x192b52=_0x192b52-0x0;var _0x529a4a=_0x37ad[_0x192b52];return _0x529a4a;};'use strict';var multer=require('multer');var util=require(_0xd37a('0x0'));var path=require(_0xd37a('0x1'));var timeout=require(_0xd37a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd37a('0x3'));var auth=require(_0xd37a('0x4'));var interaction=require(_0xd37a('0x5'));var config=require(_0xd37a('0x6'));var controller=require(_0xd37a('0x7'));router[_0xd37a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd37a('0x9'),auth[_0xd37a('0xa')](),controller[_0xd37a('0xb')]);router[_0xd37a('0xc')]('/',auth[_0xd37a('0xa')](),controller[_0xd37a('0xd')]);router['put'](_0xd37a('0x9'),auth[_0xd37a('0xa')](),controller[_0xd37a('0xe')]);router[_0xd37a('0xf')](_0xd37a('0x9'),auth['isAuthenticated'](),controller[_0xd37a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2faaa85..ad4965c 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 _0xd09b=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','BLOB','long'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd09b,0x1da));var _0xbd09=function(_0x43e43b,_0x3a4f80){_0x43e43b=_0x43e43b-0x0;var _0x2c306d=_0xd09b[_0x43e43b];return _0x2c306d;};'use strict';var Sequelize=require(_0xbd09('0x0'));module[_0xbd09('0x1')]={'name':{'type':Sequelize[_0xbd09('0x2')],'unique':_0xbd09('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbd09('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xbd09('0x4')](_0xbd09('0x5')),'get':function(){if(this[_0xbd09('0x6')](_0xbd09('0x7'))){return this[_0xbd09('0x6')](_0xbd09('0x7'))[_0xbd09('0x8')](_0xbd09('0x9'));}}},'production':{'type':Sequelize[_0xbd09('0x4')](_0xbd09('0x5')),'get':function(){if(this[_0xbd09('0x6')](_0xbd09('0xa'))){return this[_0xbd09('0x6')](_0xbd09('0xa'))[_0xbd09('0x8')](_0xbd09('0x9'));}}},'savedAt':{'type':Sequelize[_0xbd09('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xa24e=['DATE','STRING','BLOB','getDataValue','toString','utf8'];(function(_0x906096,_0x5489e5){var _0x444621=function(_0x3b9980){while(--_0x3b9980){_0x906096['push'](_0x906096['shift']());}};_0x444621(++_0x5489e5);}(_0xa24e,0x14b));var _0xea24=function(_0x202939,_0x4a1063){_0x202939=_0x202939-0x0;var _0x243aec=_0xa24e[_0x202939];return _0x243aec;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xea24('0x0')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xea24('0x1')]('long'),'get':function(){if(this[_0xea24('0x2')]('preproduction')){return this['getDataValue']('preproduction')[_0xea24('0x3')](_0xea24('0x4'));}}},'production':{'type':Sequelize[_0xea24('0x1')]('long'),'get':function(){if(this[_0xea24('0x2')]('production')){return this['getDataValue']('production')[_0xea24('0x3')](_0xea24('0x4'));}}},'savedAt':{'type':Sequelize[_0xea24('0x5')]},'publishedAt':{'type':Sequelize[_0xea24('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index d0ff5d1..0d343e3 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 _0xafca=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','json','offset','undefined','limit','count','status','then','destroy','get','UserProfileResource','publish','agi','stringify','end','sendStatus','name','index','map','SquareProject','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','production','lodash','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xafca,0x148));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaafc('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xaafc('0x1'));var db=require('../../mysqldb')['db'];config[_0xaafc('0x2')]=_[_0xaafc('0x3')](config[_0xaafc('0x2')],{'host':_0xaafc('0x4'),'port':0x18eb});var socket=require(_0xaafc('0x5'))(new Redis(config['redis']));require(_0xaafc('0x6'))[_0xaafc('0x7')](socket);function respondWithResult(_0x291161,_0xe5f782){_0xe5f782=_0xe5f782||0xc8;return function(_0x9fc4b7){if(_0x9fc4b7){return _0x291161['status'](_0xe5f782)[_0xaafc('0x8')](_0x9fc4b7);}};}function respondWithFilteredResult(_0x1c959b,_0x47f521){return function(_0x1be8a3){if(_0x1be8a3){var _0x151db4=typeof _0x47f521[_0xaafc('0x9')]===_0xaafc('0xa')&&typeof _0x47f521[_0xaafc('0xb')]===_0xaafc('0xa');var _0x2fdef9=_0x1be8a3[_0xaafc('0xc')];var _0x4caca0=_0x151db4?0x0:_0x47f521[_0xaafc('0x9')];var _0x4dd854=_0x151db4?_0x1be8a3['count']:_0x47f521[_0xaafc('0x9')]+_0x47f521['limit'];var _0x395704;if(_0x4dd854>=_0x2fdef9){_0x4dd854=_0x2fdef9;_0x395704=0xc8;}else{_0x395704=0xce;}_0x1c959b[_0xaafc('0xd')](_0x395704);return _0x1c959b['set']('Content-Range',_0x4caca0+'-'+_0x4dd854+'/'+_0x2fdef9)[_0xaafc('0x8')](_0x1be8a3);}return null;};}function saveUpdates(_0x324674){return function(_0x47ee88){if(_0x47ee88){return _0x47ee88['update'](_0x324674)[_0xaafc('0xe')](function(_0x499255){return _0x499255;});}return null;};}function removeEntity(_0xfb5590){return function(_0x1efc6b){if(_0x1efc6b){return _0x1efc6b[_0xaafc('0xf')]()[_0xaafc('0xe')](function(){var _0x334e1d=_0x1efc6b[_0xaafc('0x10')]({'plain':!![]});var _0x4a6639='SquareProjects';return db[_0xaafc('0x11')][_0xaafc('0xf')]({'where':{'type':_0x4a6639,'resourceId':_0x334e1d['id']}})[_0xaafc('0xe')](function(){return _0x1efc6b;});})[_0xaafc('0xe')](function(){var _0x423839=new Redis(config[_0xaafc('0x2')]);_0x423839[_0xaafc('0x12')](_0xaafc('0x13'),JSON[_0xaafc('0x14')]({'id':_0x1efc6b['id'],'deleted':!![]}));})[_0xaafc('0xe')](function(){_0xfb5590[_0xaafc('0xd')](0xcc)[_0xaafc('0x15')]();});}};}function handleEntityNotFound(_0x4af52b){return function(_0x414f84){if(!_0x414f84){_0x4af52b[_0xaafc('0x16')](0x194);}return _0x414f84;};}function handleError(_0x1f5d0f,_0x2d3d24){_0x2d3d24=_0x2d3d24||0x1f4;return function(_0x5c87ee){logger['error'](_0x5c87ee['stack']);if(_0x5c87ee[_0xaafc('0x17')]){delete _0x5c87ee[_0xaafc('0x17')];}_0x1f5d0f['status'](_0x2d3d24)['send'](_0x5c87ee);};}exports[_0xaafc('0x18')]=function(_0x27c1af,_0x5f53fc){var _0x393c78={},_0x48f1be={},_0x39f1f3={'count':0x0,'rows':[]};var _0x4f4cd4=_[_0xaafc('0x19')](db[_0xaafc('0x1a')]['rawAttributes'],function(_0x4143d6){return{'name':_0x4143d6[_0xaafc('0x1b')],'type':_0x4143d6['type'][_0xaafc('0x1c')]};});_0x48f1be['model']=_[_0xaafc('0x19')](_0x4f4cd4,_0xaafc('0x17'));_0x48f1be[_0xaafc('0x1d')]=_[_0xaafc('0x1e')](_0x27c1af[_0xaafc('0x1d')]);_0x48f1be[_0xaafc('0x1f')]=_['intersection'](_0x48f1be['model'],_0x48f1be[_0xaafc('0x1d')]);_0x393c78['attributes']=_[_0xaafc('0x20')](_0x48f1be[_0xaafc('0x21')],qs[_0xaafc('0x22')](_0x27c1af['query']['fields']));_0x393c78['attributes']=_0x393c78[_0xaafc('0x23')][_0xaafc('0x24')]?_0x393c78['attributes']:_0x48f1be[_0xaafc('0x21')];if(!_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x25')](_0xaafc('0x26'))){_0x393c78[_0xaafc('0xb')]=qs[_0xaafc('0xb')](_0x27c1af[_0xaafc('0x1d')][_0xaafc('0xb')]);_0x393c78[_0xaafc('0x9')]=qs[_0xaafc('0x9')](_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x9')]);}_0x393c78[_0xaafc('0x27')]=qs[_0xaafc('0x28')](_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x28')]);_0x393c78['where']=qs[_0xaafc('0x1f')](_[_0xaafc('0x29')](_0x27c1af[_0xaafc('0x1d')],_0x48f1be[_0xaafc('0x1f')]),_0x4f4cd4);if(_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x2a')]){_0x393c78[_0xaafc('0x2b')]=_[_0xaafc('0x2c')](_0x393c78[_0xaafc('0x2b')],{'$or':_[_0xaafc('0x19')](_0x4f4cd4,function(_0x229f9b){if(_0x229f9b['type']!==_0xaafc('0x2d')){var _0xb30bfb={};_0xb30bfb[_0x229f9b[_0xaafc('0x17')]]={'$like':'%'+_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x2a')]+'%'};return _0xb30bfb;}})});}_0x393c78=_[_0xaafc('0x2c')]({},_0x393c78,_0x27c1af[_0xaafc('0x2e')]);var _0xc958a8={'where':_0x393c78[_0xaafc('0x2b')]};return db[_0xaafc('0x1a')][_0xaafc('0xc')](_0xc958a8)['then'](function(_0x1c5186){_0x39f1f3[_0xaafc('0xc')]=_0x1c5186;if(_0x27c1af[_0xaafc('0x1d')][_0xaafc('0x2f')]){_0x393c78[_0xaafc('0x30')]=[{'all':!![]}];}return db[_0xaafc('0x1a')][_0xaafc('0x31')](_0x393c78);})[_0xaafc('0xe')](function(_0x38c315){_0x39f1f3[_0xaafc('0x32')]=_0x38c315;return _0x39f1f3;})['then'](respondWithFilteredResult(_0x5f53fc,_0x393c78))[_0xaafc('0x33')](handleError(_0x5f53fc,null));};exports[_0xaafc('0x34')]=function(_0x406e54,_0x346949){var _0x443b47={'raw':![],'where':{'id':_0x406e54[_0xaafc('0x35')]['id']}},_0x247dfb={};_0x247dfb['model']=_[_0xaafc('0x1e')](db[_0xaafc('0x1a')][_0xaafc('0x36')]);_0x247dfb['query']=_['keys'](_0x406e54[_0xaafc('0x1d')]);_0x247dfb[_0xaafc('0x1f')]=_[_0xaafc('0x20')](_0x247dfb[_0xaafc('0x21')],_0x247dfb['query']);_0x443b47['attributes']=_[_0xaafc('0x20')](_0x247dfb[_0xaafc('0x21')],qs['fields'](_0x406e54[_0xaafc('0x1d')][_0xaafc('0x22')]));_0x443b47[_0xaafc('0x23')]=_0x443b47[_0xaafc('0x23')]['length']?_0x443b47['attributes']:_0x247dfb[_0xaafc('0x21')];if(_0x406e54[_0xaafc('0x1d')][_0xaafc('0x2f')]){_0x443b47[_0xaafc('0x30')]=[{'all':!![]}];}_0x443b47=_[_0xaafc('0x2c')]({},_0x443b47,_0x406e54['options']);return db[_0xaafc('0x1a')][_0xaafc('0x37')](_0x443b47)[_0xaafc('0xe')](handleEntityNotFound(_0x346949,null))[_0xaafc('0xe')](respondWithResult(_0x346949,null))[_0xaafc('0x33')](handleError(_0x346949,null));};exports[_0xaafc('0x38')]=function(_0x5b020c,_0x3fbaf3){return db['SquareProject'][_0xaafc('0x38')](_0x5b020c['body'],{})[_0xaafc('0xe')](function(_0x595152){var _0x272a32=_0x5b020c[_0xaafc('0x39')][_0xaafc('0x10')]({'plain':!![]});if(!_0x272a32)throw new Error(_0xaafc('0x3a'));if(_0x272a32['role']===_0xaafc('0x39')){var _0x2a347=_0x595152[_0xaafc('0x10')]({'plain':!![]});var _0xaa59b5=_0xaafc('0x3b');return db[_0xaafc('0x3c')]['find']({'where':{'name':_0xaa59b5,'userProfileId':_0x272a32['userProfileId']},'raw':!![]})[_0xaafc('0xe')](function(_0x24726b){if(_0x24726b&&_0x24726b['autoAssociation']===0x0){return db[_0xaafc('0x11')]['create']({'name':_0x2a347[_0xaafc('0x17')],'resourceId':_0x2a347['id'],'type':_0x24726b[_0xaafc('0x17')],'sectionId':_0x24726b['id']},{})[_0xaafc('0xe')](function(){return _0x595152;});}else{return _0x595152;}})[_0xaafc('0x33')](function(_0x541a1f){logger[_0xaafc('0x3d')](_0xaafc('0x3e'),_0x541a1f);throw _0x541a1f;});}return _0x595152;})[_0xaafc('0xe')](respondWithResult(_0x3fbaf3,0xc9))[_0xaafc('0x33')](handleError(_0x3fbaf3,null));};exports[_0xaafc('0x3f')]=function(_0x133496,_0x3973b4){if(_0x133496[_0xaafc('0x40')]['id']){delete _0x133496['body']['id'];}return db[_0xaafc('0x1a')][_0xaafc('0x37')]({'where':{'id':_0x133496[_0xaafc('0x35')]['id']}})['then'](handleEntityNotFound(_0x3973b4,null))[_0xaafc('0xe')](saveUpdates(_0x133496[_0xaafc('0x40')],null))[_0xaafc('0xe')](function(_0x4dd941){if(!_0x4dd941)return;var _0xf707b0=_0x4dd941[_0xaafc('0x10')]({'plain':!![]});return _0xf707b0;})[_0xaafc('0xe')](function(_0x6a5200){var _0x4e96c7=new Redis(config[_0xaafc('0x2')]);_0x4e96c7[_0xaafc('0x12')](_0xaafc('0x13'),JSON[_0xaafc('0x14')](_[_0xaafc('0x29')](_0x6a5200,['id',_0xaafc('0x17'),_0xaafc('0x41')])));return _0x6a5200;})['then'](respondWithResult(_0x3973b4,null))[_0xaafc('0x33')](handleError(_0x3973b4,null));};exports[_0xaafc('0xf')]=function(_0x291a3d,_0x4eaac2){return db[_0xaafc('0x1a')][_0xaafc('0x37')]({'where':{'id':_0x291a3d['params']['id']}})[_0xaafc('0xe')](handleEntityNotFound(_0x4eaac2,null))[_0xaafc('0xe')](removeEntity(_0x4eaac2,null))['catch'](handleError(_0x4eaac2,null));}; \ No newline at end of file +var _0x3cba=['filters','attributes','fields','length','sort','pick','filter','where','merge','type','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','undefined','limit','offset','count','set','Content-Range','update','then','destroy','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys'];(function(_0x2c3b9c,_0xda0da3){var _0x2beaf8=function(_0x2199b6){while(--_0x2199b6){_0x2c3b9c['push'](_0x2c3b9c['shift']());}};_0x2beaf8(++_0xda0da3);}(_0x3cba,0xb1));var _0xa3cb=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x3cba[_0x35c5a8];return _0x34782c;};'use strict';var _=require(_0xa3cb('0x0'));var Redis=require(_0xa3cb('0x1'));var qs=require(_0xa3cb('0x2'));var logger=require(_0xa3cb('0x3'))(_0xa3cb('0x4'));var config=require(_0xa3cb('0x5'));var db=require(_0xa3cb('0x6'))['db'];config['redis']=_[_0xa3cb('0x7')](config[_0xa3cb('0x8')],{'host':_0xa3cb('0x9'),'port':0x18eb});var socket=require(_0xa3cb('0xa'))(new Redis(config[_0xa3cb('0x8')]));require(_0xa3cb('0xb'))[_0xa3cb('0xc')](socket);function respondWithResult(_0x653003,_0x5560f8){_0x5560f8=_0x5560f8||0xc8;return function(_0x49b73a){if(_0x49b73a){return _0x653003[_0xa3cb('0xd')](_0x5560f8)['json'](_0x49b73a);}};}function respondWithFilteredResult(_0x635375,_0xbb2d8e){return function(_0x228298){if(_0x228298){var _0x39085a=typeof _0xbb2d8e['offset']===_0xa3cb('0xe')&&typeof _0xbb2d8e[_0xa3cb('0xf')]===_0xa3cb('0xe');var _0x1fcc27=_0x228298['count'];var _0x3bbb36=_0x39085a?0x0:_0xbb2d8e[_0xa3cb('0x10')];var _0xb68801=_0x39085a?_0x228298[_0xa3cb('0x11')]:_0xbb2d8e[_0xa3cb('0x10')]+_0xbb2d8e[_0xa3cb('0xf')];var _0x38589b;if(_0xb68801>=_0x1fcc27){_0xb68801=_0x1fcc27;_0x38589b=0xc8;}else{_0x38589b=0xce;}_0x635375[_0xa3cb('0xd')](_0x38589b);return _0x635375[_0xa3cb('0x12')](_0xa3cb('0x13'),_0x3bbb36+'-'+_0xb68801+'/'+_0x1fcc27)['json'](_0x228298);}return null;};}function saveUpdates(_0x5719d2){return function(_0x6755c){if(_0x6755c){return _0x6755c[_0xa3cb('0x14')](_0x5719d2)[_0xa3cb('0x15')](function(_0x7ee09e){return _0x7ee09e;});}return null;};}function removeEntity(_0x420857){return function(_0x43b211){if(_0x43b211){return _0x43b211[_0xa3cb('0x16')]()['then'](function(){var _0x540d98=_0x43b211['get']({'plain':!![]});var _0x454e20=_0xa3cb('0x17');return db[_0xa3cb('0x18')][_0xa3cb('0x16')]({'where':{'type':_0x454e20,'resourceId':_0x540d98['id']}})['then'](function(){return _0x43b211;});})['then'](function(){var _0x1c1c50=new Redis(config[_0xa3cb('0x8')]);_0x1c1c50[_0xa3cb('0x19')](_0xa3cb('0x1a'),JSON[_0xa3cb('0x1b')]({'id':_0x43b211['id'],'deleted':!![]}));})[_0xa3cb('0x15')](function(){_0x420857[_0xa3cb('0xd')](0xcc)[_0xa3cb('0x1c')]();});}};}function handleEntityNotFound(_0x5918ed){return function(_0x121661){if(!_0x121661){_0x5918ed[_0xa3cb('0x1d')](0x194);}return _0x121661;};}function handleError(_0x1bc544,_0x1b4981){_0x1b4981=_0x1b4981||0x1f4;return function(_0x264919){logger[_0xa3cb('0x1e')](_0x264919[_0xa3cb('0x1f')]);if(_0x264919['name']){delete _0x264919[_0xa3cb('0x20')];}_0x1bc544[_0xa3cb('0xd')](_0x1b4981)[_0xa3cb('0x21')](_0x264919);};}exports[_0xa3cb('0x22')]=function(_0x105a2d,_0x128857){var _0x298597={},_0x2b0360={},_0xad98d8={'count':0x0,'rows':[]};var _0x51c855=_[_0xa3cb('0x23')](db['SquareProject'][_0xa3cb('0x24')],function(_0x46efde){return{'name':_0x46efde[_0xa3cb('0x25')],'type':_0x46efde['type'][_0xa3cb('0x26')]};});_0x2b0360[_0xa3cb('0x27')]=_[_0xa3cb('0x23')](_0x51c855,'name');_0x2b0360[_0xa3cb('0x28')]=_[_0xa3cb('0x29')](_0x105a2d['query']);_0x2b0360[_0xa3cb('0x2a')]=_['intersection'](_0x2b0360['model'],_0x2b0360[_0xa3cb('0x28')]);_0x298597[_0xa3cb('0x2b')]=_['intersection'](_0x2b0360[_0xa3cb('0x27')],qs[_0xa3cb('0x2c')](_0x105a2d['query'][_0xa3cb('0x2c')]));_0x298597['attributes']=_0x298597['attributes'][_0xa3cb('0x2d')]?_0x298597['attributes']:_0x2b0360[_0xa3cb('0x27')];if(!_0x105a2d[_0xa3cb('0x28')]['hasOwnProperty']('nolimit')){_0x298597['limit']=qs[_0xa3cb('0xf')](_0x105a2d[_0xa3cb('0x28')][_0xa3cb('0xf')]);_0x298597[_0xa3cb('0x10')]=qs[_0xa3cb('0x10')](_0x105a2d[_0xa3cb('0x28')][_0xa3cb('0x10')]);}_0x298597['order']=qs['sort'](_0x105a2d[_0xa3cb('0x28')][_0xa3cb('0x2e')]);_0x298597['where']=qs['filters'](_[_0xa3cb('0x2f')](_0x105a2d[_0xa3cb('0x28')],_0x2b0360[_0xa3cb('0x2a')]),_0x51c855);if(_0x105a2d[_0xa3cb('0x28')][_0xa3cb('0x30')]){_0x298597[_0xa3cb('0x31')]=_[_0xa3cb('0x32')](_0x298597[_0xa3cb('0x31')],{'$or':_[_0xa3cb('0x23')](_0x51c855,function(_0x284f91){if(_0x284f91[_0xa3cb('0x33')]!==_0xa3cb('0x34')){var _0x1adb64={};_0x1adb64[_0x284f91[_0xa3cb('0x20')]]={'$like':'%'+_0x105a2d[_0xa3cb('0x28')]['filter']+'%'};return _0x1adb64;}})});}_0x298597=_[_0xa3cb('0x32')]({},_0x298597,_0x105a2d[_0xa3cb('0x35')]);var _0x226915={'where':_0x298597[_0xa3cb('0x31')]};return db[_0xa3cb('0x36')][_0xa3cb('0x11')](_0x226915)[_0xa3cb('0x15')](function(_0x43ce26){_0xad98d8[_0xa3cb('0x11')]=_0x43ce26;if(_0x105a2d['query'][_0xa3cb('0x37')]){_0x298597[_0xa3cb('0x38')]=[{'all':!![]}];}return db['SquareProject'][_0xa3cb('0x39')](_0x298597);})[_0xa3cb('0x15')](function(_0x49d6e2){_0xad98d8[_0xa3cb('0x3a')]=_0x49d6e2;return _0xad98d8;})[_0xa3cb('0x15')](respondWithFilteredResult(_0x128857,_0x298597))['catch'](handleError(_0x128857,null));};exports[_0xa3cb('0x3b')]=function(_0x2e6608,_0x21ca1e){var _0x51ed38={'raw':![],'where':{'id':_0x2e6608[_0xa3cb('0x3c')]['id']}},_0x4670f2={};_0x4670f2[_0xa3cb('0x27')]=_[_0xa3cb('0x29')](db[_0xa3cb('0x36')]['rawAttributes']);_0x4670f2[_0xa3cb('0x28')]=_[_0xa3cb('0x29')](_0x2e6608['query']);_0x4670f2[_0xa3cb('0x2a')]=_[_0xa3cb('0x3d')](_0x4670f2[_0xa3cb('0x27')],_0x4670f2[_0xa3cb('0x28')]);_0x51ed38[_0xa3cb('0x2b')]=_['intersection'](_0x4670f2[_0xa3cb('0x27')],qs['fields'](_0x2e6608[_0xa3cb('0x28')][_0xa3cb('0x2c')]));_0x51ed38[_0xa3cb('0x2b')]=_0x51ed38[_0xa3cb('0x2b')][_0xa3cb('0x2d')]?_0x51ed38[_0xa3cb('0x2b')]:_0x4670f2['model'];if(_0x2e6608[_0xa3cb('0x28')][_0xa3cb('0x37')]){_0x51ed38[_0xa3cb('0x38')]=[{'all':!![]}];}_0x51ed38=_[_0xa3cb('0x32')]({},_0x51ed38,_0x2e6608[_0xa3cb('0x35')]);return db[_0xa3cb('0x36')][_0xa3cb('0x3e')](_0x51ed38)[_0xa3cb('0x15')](handleEntityNotFound(_0x21ca1e,null))[_0xa3cb('0x15')](respondWithResult(_0x21ca1e,null))[_0xa3cb('0x3f')](handleError(_0x21ca1e,null));};exports[_0xa3cb('0x40')]=function(_0x5bde95,_0x24feed){return db['SquareProject'][_0xa3cb('0x40')](_0x5bde95['body'],{})[_0xa3cb('0x15')](function(_0x3dfa65){var _0x33b7cf=_0x5bde95[_0xa3cb('0x41')][_0xa3cb('0x42')]({'plain':!![]});if(!_0x33b7cf)throw new Error(_0xa3cb('0x43'));if(_0x33b7cf[_0xa3cb('0x44')]===_0xa3cb('0x41')){var _0x4246f2=_0x3dfa65[_0xa3cb('0x42')]({'plain':!![]});var _0x5388c6=_0xa3cb('0x17');return db[_0xa3cb('0x45')]['find']({'where':{'name':_0x5388c6,'userProfileId':_0x33b7cf[_0xa3cb('0x46')]},'raw':!![]})[_0xa3cb('0x15')](function(_0x4358d3){if(_0x4358d3&&_0x4358d3['autoAssociation']===0x0){return db['UserProfileResource'][_0xa3cb('0x40')]({'name':_0x4246f2[_0xa3cb('0x20')],'resourceId':_0x4246f2['id'],'type':_0x4358d3[_0xa3cb('0x20')],'sectionId':_0x4358d3['id']},{})[_0xa3cb('0x15')](function(){return _0x3dfa65;});}else{return _0x3dfa65;}})[_0xa3cb('0x3f')](function(_0x33245f){logger[_0xa3cb('0x1e')](_0xa3cb('0x47'),_0x33245f);throw _0x33245f;});}return _0x3dfa65;})[_0xa3cb('0x15')](respondWithResult(_0x24feed,0xc9))['catch'](handleError(_0x24feed,null));};exports[_0xa3cb('0x14')]=function(_0x2cd444,_0x2befa0){if(_0x2cd444[_0xa3cb('0x48')]['id']){delete _0x2cd444[_0xa3cb('0x48')]['id'];}return db[_0xa3cb('0x36')]['find']({'where':{'id':_0x2cd444[_0xa3cb('0x3c')]['id']}})[_0xa3cb('0x15')](handleEntityNotFound(_0x2befa0,null))[_0xa3cb('0x15')](saveUpdates(_0x2cd444[_0xa3cb('0x48')],null))['then'](function(_0x439e24){if(!_0x439e24)return;var _0x4c4a5b=_0x439e24[_0xa3cb('0x42')]({'plain':!![]});return _0x4c4a5b;})[_0xa3cb('0x15')](function(_0x3a9e39){var _0x17afd2=new Redis(config['redis']);_0x17afd2[_0xa3cb('0x19')](_0xa3cb('0x1a'),JSON['stringify'](_[_0xa3cb('0x2f')](_0x3a9e39,['id','name','production'])));return _0x3a9e39;})[_0xa3cb('0x15')](respondWithResult(_0x2befa0,null))['catch'](handleError(_0x2befa0,null));};exports[_0xa3cb('0x16')]=function(_0xa97a0,_0x23bf3d){return db['SquareProject'][_0xa3cb('0x3e')]({'where':{'id':_0xa97a0['params']['id']}})[_0xa3cb('0x15')](handleEntityNotFound(_0x23bf3d,null))[_0xa3cb('0x15')](removeEntity(_0x23bf3d,null))[_0xa3cb('0x3f')](handleError(_0x23bf3d,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6c1fda6..906207d 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 _0x3f9b=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','SquareProject'];(function(_0x32db24,_0x31bfa0){var _0x36cf93=function(_0x45fb35){while(--_0x45fb35){_0x32db24['push'](_0x32db24['shift']());}};_0x36cf93(++_0x31bfa0);}(_0x3f9b,0x156));var _0xb3f9=function(_0x1be648,_0x1e8622){_0x1be648=_0x1be648-0x0;var _0x281bd1=_0x3f9b[_0x1be648];return _0x281bd1;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb3f9('0x0'))['db'][_0xb3f9('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb3f9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb3f9('0x3'),'afterDestroy':_0xb3f9('0x4')};function emitEvent(_0x3cf4a4){return function(_0x3e49cd,_0x1bd263,_0x512989){SquareProjectEvents[_0xb3f9('0x5')](_0x3cf4a4+':'+_0x3e49cd['id'],_0x3e49cd);SquareProjectEvents['emit'](_0x3cf4a4,_0x3e49cd);_0x512989(null);};}for(var e in events){if(events[_0xb3f9('0x6')](e)){var event=events[e];SquareProject[_0xb3f9('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xd9a9=['emit','hasOwnProperty','hook','exports','events','SquareProject','setMaxListeners','save','update','remove'];(function(_0xe16645,_0x91e47c){var _0x27f758=function(_0x16af9b){while(--_0x16af9b){_0xe16645['push'](_0xe16645['shift']());}};_0x27f758(++_0x91e47c);}(_0xd9a9,0x16c));var _0x9d9a=function(_0x2d8fc9,_0x4bbcd5){_0x2d8fc9=_0x2d8fc9-0x0;var _0x33941d=_0xd9a9[_0x2d8fc9];return _0x33941d;};'use strict';var EventEmitter=require(_0x9d9a('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x9d9a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9d9a('0x2')](0x0);var events={'afterCreate':_0x9d9a('0x3'),'afterUpdate':_0x9d9a('0x4'),'afterDestroy':_0x9d9a('0x5')};function emitEvent(_0x4f8bfd){return function(_0x3261e9,_0x489751,_0x325147){SquareProjectEvents[_0x9d9a('0x6')](_0x4f8bfd+':'+_0x3261e9['id'],_0x3261e9);SquareProjectEvents['emit'](_0x4f8bfd,_0x3261e9);_0x325147(null);};}for(var e in events){if(events[_0x9d9a('0x7')](e)){var event=events[e];SquareProject[_0x9d9a('0x8')](e,emitEvent(event));}}module[_0x9d9a('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index f157c1e..e3ee422 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 _0x9e4d=['../../config/environment','./squareProject.attributes','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x444fe3,_0x49a537){var _0x316f20=function(_0x5bcb02){while(--_0x5bcb02){_0x444fe3['push'](_0x444fe3['shift']());}};_0x316f20(++_0x49a537);}(_0x9e4d,0x129));var _0xd9e4=function(_0x179f07,_0x4763dc){_0x179f07=_0x179f07-0x0;var _0x12d6d1=_0x9e4d[_0x179f07];return _0x12d6d1;};'use strict';var _=require('lodash');var util=require(_0xd9e4('0x0'));var logger=require('../../config/logger')(_0xd9e4('0x1'));var moment=require(_0xd9e4('0x2'));var BPromise=require(_0xd9e4('0x3'));var rp=require(_0xd9e4('0x4'));var fs=require('fs');var path=require(_0xd9e4('0x5'));var rimraf=require(_0xd9e4('0x6'));var config=require(_0xd9e4('0x7'));var attributes=require(_0xd9e4('0x8'));module['exports']=function(_0x14d651,_0x274ef2){return _0x14d651['define'](_0xd9e4('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x115220,_0xda86db,_0x526e66){if(_0x115220[_0xd9e4('0xa')](_0xd9e4('0xb'))){_0x115220[_0xd9e4('0xc')]=moment()[_0xd9e4('0xd')](_0xd9e4('0xe'));}if(_0x115220[_0xd9e4('0xa')]('production')){_0x115220[_0xd9e4('0xf')]=moment()[_0xd9e4('0xd')](_0xd9e4('0xe'));}_0x526e66(null,_0x115220);}}});}; \ No newline at end of file +var _0x84e3=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','moment'];(function(_0x4d5f36,_0x2a878b){var _0x2f2993=function(_0x4e8aee){while(--_0x4e8aee){_0x4d5f36['push'](_0x4d5f36['shift']());}};_0x2f2993(++_0x2a878b);}(_0x84e3,0x1b1));var _0x384e=function(_0x1101c9,_0x56ece2){_0x1101c9=_0x1101c9-0x0;var _0x3fef5d=_0x84e3[_0x1101c9];return _0x3fef5d;};'use strict';var _=require(_0x384e('0x0'));var util=require(_0x384e('0x1'));var logger=require(_0x384e('0x2'))('api');var moment=require(_0x384e('0x3'));var BPromise=require(_0x384e('0x4'));var rp=require(_0x384e('0x5'));var fs=require('fs');var path=require(_0x384e('0x6'));var rimraf=require(_0x384e('0x7'));var config=require(_0x384e('0x8'));var attributes=require('./squareProject.attributes');module[_0x384e('0x9')]=function(_0x2db42b,_0x407b7e){return _0x2db42b[_0x384e('0xa')](_0x384e('0xb'),attributes,{'tableName':_0x384e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x342b18,_0x1eac41,_0x3a9427){if(_0x342b18[_0x384e('0xd')](_0x384e('0xe'))){_0x342b18[_0x384e('0xf')]=moment()[_0x384e('0x10')](_0x384e('0x11'));}if(_0x342b18[_0x384e('0xd')](_0x384e('0x12'))){_0x342b18['publishedAt']=moment()['format'](_0x384e('0x11'));}_0x3a9427(null,_0x342b18);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 37fc145..47eb4e8 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 _0x7de4=['catch','lodash','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','map','model','include','then','info','stringify','message','ShowSquareProject','find','where','debug'];(function(_0x1547db,_0x25815e){var _0x124414=function(_0x57ea82){while(--_0x57ea82){_0x1547db['push'](_0x1547db['shift']());}};_0x124414(++_0x25815e);}(_0x7de4,0x92));var _0x47de=function(_0x99e31b,_0x1b91ff){_0x99e31b=_0x99e31b-0x0;var _0x4c765b=_0x7de4[_0x99e31b];return _0x4c765b;};'use strict';var _=require(_0x47de('0x0'));var Redis=require(_0x47de('0x1'));var db=require(_0x47de('0x2'))['db'];var logger=require('../../config/logger')(_0x47de('0x3'));var config=require(_0x47de('0x4'));config[_0x47de('0x5')]=_[_0x47de('0x6')](config[_0x47de('0x5')],{'host':_0x47de('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47de('0x5')]));require(_0x47de('0x8'))[_0x47de('0x9')](socket);exports[_0x47de('0xa')]=function(_0x309deb){var _0x64b9aa=this;return new Promise(function(_0x131a6b,_0x34c1b8){return db[_0x47de('0xb')][_0x47de('0xc')]({'raw':_0x309deb[_0x47de('0xd')]?_0x309deb['options'][_0x47de('0xe')]===undefined?!![]:![]:!![],'where':_0x309deb['options']?_0x309deb[_0x47de('0xd')]['where']||null:null,'attributes':_0x309deb[_0x47de('0xd')]?_0x309deb['options'][_0x47de('0xf')]||null:null,'limit':_0x309deb[_0x47de('0xd')]?_0x309deb[_0x47de('0xd')][_0x47de('0x10')]||null:null,'include':_0x309deb[_0x47de('0xd')]?_0x309deb[_0x47de('0xd')]['include']?_[_0x47de('0x11')](_0x309deb[_0x47de('0xd')]['include'],function(_0x54cd1d){return{'model':db[_0x54cd1d[_0x47de('0x12')]],'as':_0x54cd1d['as'],'attributes':_0x54cd1d[_0x47de('0xf')],'include':_0x54cd1d['include']?_[_0x47de('0x11')](_0x54cd1d[_0x47de('0x13')],function(_0x3090eb){return{'model':db[_0x3090eb[_0x47de('0x12')]],'as':_0x3090eb['as'],'attributes':_0x3090eb[_0x47de('0xf')],'include':_0x3090eb[_0x47de('0x13')]?_['map'](_0x3090eb['include'],function(_0x1ad6cf){return{'model':db[_0x1ad6cf[_0x47de('0x12')]],'as':_0x1ad6cf['as'],'attributes':_0x1ad6cf[_0x47de('0xf')]};}):[]};}):[]};}):[]:[]})[_0x47de('0x14')](function(_0x2c9c6e){logger[_0x47de('0x15')]('GetSquareProjects',_0x309deb);logger['debug'](_0x47de('0xa'),_0x309deb,JSON[_0x47de('0x16')](_0x2c9c6e));_0x131a6b(_0x2c9c6e);})['catch'](function(_0x54b7f9){logger['error']('GetSquareProjects',_0x54b7f9[_0x47de('0x17')],_0x309deb);_0x34c1b8(_0x64b9aa['error'](0x1f4,_0x54b7f9[_0x47de('0x17')]));});});};exports[_0x47de('0x18')]=function(_0x568bb5){var _0x2b878c=this;return new Promise(function(_0x4dc1b0,_0x4083ce){return db[_0x47de('0xb')][_0x47de('0x19')]({'raw':_0x568bb5[_0x47de('0xd')]?_0x568bb5[_0x47de('0xd')][_0x47de('0xe')]===undefined?!![]:![]:!![],'where':_0x568bb5[_0x47de('0xd')]?_0x568bb5[_0x47de('0xd')][_0x47de('0x1a')]||null:null,'attributes':_0x568bb5[_0x47de('0xd')]?_0x568bb5[_0x47de('0xd')]['attributes']||null:null,'include':_0x568bb5[_0x47de('0xd')]?_0x568bb5['options'][_0x47de('0x13')]?_[_0x47de('0x11')](_0x568bb5[_0x47de('0xd')]['include'],function(_0x1aeaa1){return{'model':db[_0x1aeaa1[_0x47de('0x12')]],'as':_0x1aeaa1['as'],'attributes':_0x1aeaa1['attributes'],'include':_0x1aeaa1[_0x47de('0x13')]?_[_0x47de('0x11')](_0x1aeaa1[_0x47de('0x13')],function(_0x19f7bd){return{'model':db[_0x19f7bd[_0x47de('0x12')]],'as':_0x19f7bd['as'],'attributes':_0x19f7bd['attributes'],'include':_0x19f7bd['include']?_[_0x47de('0x11')](_0x19f7bd['include'],function(_0x53a398){return{'model':db[_0x53a398[_0x47de('0x12')]],'as':_0x53a398['as'],'attributes':_0x53a398[_0x47de('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fe957){logger[_0x47de('0x15')](_0x47de('0x18'),_0x568bb5);logger[_0x47de('0x1b')](_0x47de('0x18'),_0x568bb5,JSON[_0x47de('0x16')](_0x4fe957));_0x4dc1b0(_0x4fe957);})[_0x47de('0x1c')](function(_0x2c6fd8){logger['error'](_0x47de('0x18'),_0x2c6fd8['message'],_0x568bb5);_0x4083ce(_0x2b878c['error'](0x1f4,_0x2c6fd8[_0x47de('0x17')]));});});}; \ No newline at end of file +var _0xd9f9=['info','stringify','catch','error','SquareProject','debug','ShowSquareProject','message','lodash','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','GetSquareProjects','findAll','options','raw','where','attributes','include','map','model','then'];(function(_0x35db89,_0x259f69){var _0x227771=function(_0x4c33e3){while(--_0x4c33e3){_0x35db89['push'](_0x35db89['shift']());}};_0x227771(++_0x259f69);}(_0xd9f9,0x128));var _0x9d9f=function(_0x1a4b31,_0x53b682){_0x1a4b31=_0x1a4b31-0x0;var _0x29567=_0xd9f9[_0x1a4b31];return _0x29567;};'use strict';var _=require(_0x9d9f('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x9d9f('0x1'))('rpc');var config=require(_0x9d9f('0x2'));config[_0x9d9f('0x3')]=_[_0x9d9f('0x4')](config[_0x9d9f('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d9f('0x5'))(new Redis(config[_0x9d9f('0x3')]));require('./squareProject.socket')['register'](socket);exports[_0x9d9f('0x6')]=function(_0x586020){var _0x43b073=this;return new Promise(function(_0x525b6b,_0x4249d0){return db['SquareProject'][_0x9d9f('0x7')]({'raw':_0x586020[_0x9d9f('0x8')]?_0x586020[_0x9d9f('0x8')][_0x9d9f('0x9')]===undefined?!![]:![]:!![],'where':_0x586020['options']?_0x586020[_0x9d9f('0x8')][_0x9d9f('0xa')]||null:null,'attributes':_0x586020[_0x9d9f('0x8')]?_0x586020[_0x9d9f('0x8')][_0x9d9f('0xb')]||null:null,'limit':_0x586020[_0x9d9f('0x8')]?_0x586020[_0x9d9f('0x8')]['limit']||null:null,'include':_0x586020[_0x9d9f('0x8')]?_0x586020[_0x9d9f('0x8')][_0x9d9f('0xc')]?_[_0x9d9f('0xd')](_0x586020['options'][_0x9d9f('0xc')],function(_0x1de605){return{'model':db[_0x1de605[_0x9d9f('0xe')]],'as':_0x1de605['as'],'attributes':_0x1de605[_0x9d9f('0xb')],'include':_0x1de605[_0x9d9f('0xc')]?_[_0x9d9f('0xd')](_0x1de605[_0x9d9f('0xc')],function(_0x436b3d){return{'model':db[_0x436b3d['model']],'as':_0x436b3d['as'],'attributes':_0x436b3d[_0x9d9f('0xb')],'include':_0x436b3d[_0x9d9f('0xc')]?_[_0x9d9f('0xd')](_0x436b3d[_0x9d9f('0xc')],function(_0x58c24b){return{'model':db[_0x58c24b[_0x9d9f('0xe')]],'as':_0x58c24b['as'],'attributes':_0x58c24b[_0x9d9f('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9d9f('0xf')](function(_0x3a4edf){logger[_0x9d9f('0x10')](_0x9d9f('0x6'),_0x586020);logger['debug'](_0x9d9f('0x6'),_0x586020,JSON[_0x9d9f('0x11')](_0x3a4edf));_0x525b6b(_0x3a4edf);})[_0x9d9f('0x12')](function(_0x578a8c){logger['error'](_0x9d9f('0x6'),_0x578a8c['message'],_0x586020);_0x4249d0(_0x43b073[_0x9d9f('0x13')](0x1f4,_0x578a8c['message']));});});};exports['ShowSquareProject']=function(_0x45dec9){var _0x1d60b3=this;return new Promise(function(_0x3a98fa,_0x4e8c44){return db[_0x9d9f('0x14')]['find']({'raw':_0x45dec9[_0x9d9f('0x8')]?_0x45dec9[_0x9d9f('0x8')][_0x9d9f('0x9')]===undefined?!![]:![]:!![],'where':_0x45dec9[_0x9d9f('0x8')]?_0x45dec9[_0x9d9f('0x8')]['where']||null:null,'attributes':_0x45dec9[_0x9d9f('0x8')]?_0x45dec9[_0x9d9f('0x8')]['attributes']||null:null,'include':_0x45dec9[_0x9d9f('0x8')]?_0x45dec9[_0x9d9f('0x8')]['include']?_[_0x9d9f('0xd')](_0x45dec9[_0x9d9f('0x8')][_0x9d9f('0xc')],function(_0x524b12){return{'model':db[_0x524b12[_0x9d9f('0xe')]],'as':_0x524b12['as'],'attributes':_0x524b12['attributes'],'include':_0x524b12[_0x9d9f('0xc')]?_[_0x9d9f('0xd')](_0x524b12['include'],function(_0x492627){return{'model':db[_0x492627[_0x9d9f('0xe')]],'as':_0x492627['as'],'attributes':_0x492627['attributes'],'include':_0x492627[_0x9d9f('0xc')]?_[_0x9d9f('0xd')](_0x492627[_0x9d9f('0xc')],function(_0x3529d9){return{'model':db[_0x3529d9[_0x9d9f('0xe')]],'as':_0x3529d9['as'],'attributes':_0x3529d9[_0x9d9f('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9d9f('0xf')](function(_0xcc9ba6){logger[_0x9d9f('0x10')]('ShowSquareProject',_0x45dec9);logger[_0x9d9f('0x15')](_0x9d9f('0x16'),_0x45dec9,JSON[_0x9d9f('0x11')](_0xcc9ba6));_0x3a98fa(_0xcc9ba6);})['catch'](function(_0x26a362){logger[_0x9d9f('0x13')]('ShowSquareProject',_0x26a362[_0x9d9f('0x17')],_0x45dec9);_0x4e8c44(_0x1d60b3[_0x9d9f('0x13')](0x1f4,_0x26a362[_0x9d9f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 283c80d..9e8644c 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 _0x41e4=['removeListener','register','length','squareProject:','remove','emit'];(function(_0x4c70ca,_0x55b405){var _0x26a3b1=function(_0x277b2d){while(--_0x277b2d){_0x4c70ca['push'](_0x4c70ca['shift']());}};_0x26a3b1(++_0x55b405);}(_0x41e4,0x166));var _0x441e=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x41e4[_0x3c8e9a];return _0x2d4c57;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x441e('0x0'),'update'];function createListener(_0x53d5d4,_0x2421da){return function(_0x28069b){_0x2421da[_0x441e('0x1')](_0x53d5d4,_0x28069b);};}function removeListener(_0x4c6faa,_0x143344){return function(){SquareProjectEvents[_0x441e('0x2')](_0x4c6faa,_0x143344);};}exports[_0x441e('0x3')]=function(_0x594857){for(var _0x345243=0x0,_0x1d5616=events[_0x441e('0x4')];_0x345243<_0x1d5616;_0x345243++){var _0x3c19a4=events[_0x345243];var _0x34bd93=createListener(_0x441e('0x5')+_0x3c19a4,_0x594857);SquareProjectEvents['on'](_0x3c19a4,_0x34bd93);}}; \ No newline at end of file +var _0x22aa=['removeListener','./squareProject.events','save','remove'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x22aa,0xbd));var _0xa22a=function(_0x33389a,_0x11709c){_0x33389a=_0x33389a-0x0;var _0x3a83f6=_0x22aa[_0x33389a];return _0x3a83f6;};'use strict';var SquareProjectEvents=require(_0xa22a('0x0'));var events=[_0xa22a('0x1'),_0xa22a('0x2'),'update'];function createListener(_0x482831,_0x4cf83e){return function(_0x3ec8fd){_0x4cf83e['emit'](_0x482831,_0x3ec8fd);};}function removeListener(_0x195c98,_0x2f1fc8){return function(){SquareProjectEvents[_0xa22a('0x3')](_0x195c98,_0x2f1fc8);};}exports['register']=function(_0x1673e5){for(var _0x5dc973=0x0,_0x47a09a=events['length'];_0x5dc973<_0x47a09a;_0x5dc973++){var _0x4e247d=events[_0x5dc973];var _0x34f21e=createListener('squareProject:'+_0x4e247d,_0x1673e5);SquareProjectEvents['on'](_0x4e247d,_0x34f21e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e6274d9..f93b148 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x202164,_0x370423){var _0x35aa4d=function(_0xc5414c){while(--_0xc5414c){_0x202164['push'](_0x202164['shift']());}};_0x35aa4d(++_0x370423);}(_0x5fc3,0xa8));var _0x35fc=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x5fc3[_0x402c8f];return _0x11e809;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x5788df,_0x5076db){var _0x163f6e=function(_0x1858e2){while(--_0x1858e2){_0x5788df['push'](_0x5788df['shift']());}};_0x163f6e(++_0x5076db);}(_0xe14b,0x93));var _0xbe14=function(_0x42968e,_0x3bea04){_0x42968e=_0x42968e-0x0;var _0xe76974=_0xe14b[_0x42968e];return _0xe76974;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index ff338b3..4733de3 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 _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x5d94f9,_0x354c31){var _0x60c9d=function(_0x14326c){while(--_0x14326c){_0x5d94f9['push'](_0x5d94f9['shift']());}};_0x60c9d(++_0x354c31);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0xeec6[_0x3403d5];return _0xf9df4f;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file +var _0xf2ca=['getDataValue','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x4eb6df,_0x3ecbaf){var _0x1747bc=function(_0x519ae5){while(--_0x519ae5){_0x4eb6df['push'](_0x4eb6df['shift']());}};_0x1747bc(++_0x3ecbaf);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf2ca[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'extension':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'dnid':{'type':Sequelize[_0xaf2c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xaf2c('0x2')]},'filename':{'type':Sequelize[_0xaf2c('0x2')]},'savePath':{'type':Sequelize[_0xaf2c('0x2')]},'format':{'type':Sequelize[_0xaf2c('0x3')],'get':function(){var _0x58351f='';var _0x37fedd=this[_0xaf2c('0x4')]('savePath');if(_0x37fedd){_0x58351f=_0x37fedd[_0xaf2c('0x5')](_0x37fedd['lastIndexOf']('.'));}return _0x58351f;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index aa44e64..919acc0 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 _0x49a8=['filters','pick','filter','merge','VIRTUAL','includeAll','include','SquareRecording','findAll','rows','catch','show','params','rawAttributes','keys','options','find','create','body','download','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','destroy','then','error','stack','name','send','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x49a8,0x13f));var _0x849a=function(_0xe8e2f5,_0xd84b9f){_0xe8e2f5=_0xe8e2f5-0x0;var _0x162e2b=_0x49a8[_0xe8e2f5];return _0x162e2b;};'use strict';var emlformat=require(_0x849a('0x0'));var rimraf=require(_0x849a('0x1'));var zipdir=require(_0x849a('0x2'));var jsonpatch=require(_0x849a('0x3'));var rp=require(_0x849a('0x4'));var moment=require(_0x849a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x849a('0x6'));var util=require(_0x849a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x849a('0x8'));var ejs=require(_0x849a('0x9'));var fs=require('fs');var fs_extra=require(_0x849a('0xa'));var _=require(_0x849a('0xb'));var squel=require(_0x849a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x849a('0x8'));var querystring=require(_0x849a('0xd'));var Papa=require(_0x849a('0xe'));var Redis=require(_0x849a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x849a('0x10'));var as=require(_0x849a('0x11'));var hardwareService=require(_0x849a('0x12'));var logger=require(_0x849a('0x13'))(_0x849a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x849a('0x15'));var db=require(_0x849a('0x16'))['db'];function respondWithStatusCode(_0x12f426,_0x5c98fe){_0x5c98fe=_0x5c98fe||0xcc;return function(_0x44cbce){if(_0x44cbce){return _0x12f426[_0x849a('0x17')](_0x5c98fe);}return _0x12f426[_0x849a('0x18')](_0x5c98fe)[_0x849a('0x19')]();};}function respondWithResult(_0x596588,_0x5ceaea){_0x5ceaea=_0x5ceaea||0xc8;return function(_0x4778df){if(_0x4778df){return _0x596588[_0x849a('0x18')](_0x5ceaea)[_0x849a('0x1a')](_0x4778df);}};}function respondWithFilteredResult(_0x3d5f0a,_0x1cca72){return function(_0x16f778){if(_0x16f778){var _0x5c286d=typeof _0x1cca72[_0x849a('0x1b')]==='undefined'&&typeof _0x1cca72[_0x849a('0x1c')]==='undefined';var _0x100334=_0x16f778[_0x849a('0x1d')];var _0x450380=_0x5c286d?0x0:_0x1cca72['offset'];var _0x4f9824=_0x5c286d?_0x16f778[_0x849a('0x1d')]:_0x1cca72[_0x849a('0x1b')]+_0x1cca72[_0x849a('0x1c')];var _0xdde1a;if(_0x4f9824>=_0x100334){_0x4f9824=_0x100334;_0xdde1a=0xc8;}else{_0xdde1a=0xce;}_0x3d5f0a['status'](_0xdde1a);return _0x3d5f0a[_0x849a('0x1e')]('Content-Range',_0x450380+'-'+_0x4f9824+'/'+_0x100334)[_0x849a('0x1a')](_0x16f778);}return null;};}function patchUpdates(_0x43cfde){return function(_0x4d18e1){try{jsonpatch[_0x849a('0x1f')](_0x4d18e1,_0x43cfde,!![]);}catch(_0x3fe09a){return BPromise['reject'](_0x3fe09a);}return _0x4d18e1[_0x849a('0x20')]();};}function saveUpdates(_0x1092fb,_0x3c5f47){return function(_0x6a50aa){if(_0x6a50aa){return _0x6a50aa['update'](_0x1092fb)['then'](function(_0xd98a7f){return _0xd98a7f;});}return null;};}function removeEntity(_0x5c4f69,_0xb14fae){return function(_0x101038){if(_0x101038){return _0x101038[_0x849a('0x21')]()[_0x849a('0x22')](function(){_0x5c4f69[_0x849a('0x18')](0xcc)[_0x849a('0x19')]();});}};}function handleEntityNotFound(_0x35f65d,_0x395c7e){return function(_0x229a34){if(!_0x229a34){_0x35f65d['sendStatus'](0x194);}return _0x229a34;};}function handleError(_0x5750ad,_0x1c1753){_0x1c1753=_0x1c1753||0x1f4;return function(_0x456e32){logger[_0x849a('0x23')](_0x456e32[_0x849a('0x24')]);if(_0x456e32[_0x849a('0x25')]){delete _0x456e32['name'];}_0x5750ad[_0x849a('0x18')](_0x1c1753)[_0x849a('0x26')](_0x456e32);};}exports[_0x849a('0x27')]=function(_0x3c025e,_0x276cee){var _0x5691c1={},_0x49ed48={},_0x4d2eac={'count':0x0,'rows':[]};var _0x283a1a=_[_0x849a('0x28')](db['SquareRecording']['rawAttributes'],function(_0x19a20b){return{'name':_0x19a20b[_0x849a('0x29')],'type':_0x19a20b[_0x849a('0x2a')]['key']};});_0x49ed48[_0x849a('0x2b')]=_[_0x849a('0x28')](_0x283a1a,_0x849a('0x25'));_0x49ed48[_0x849a('0x2c')]=_['keys'](_0x3c025e['query']);_0x49ed48['filters']=_[_0x849a('0x2d')](_0x49ed48[_0x849a('0x2b')],_0x49ed48[_0x849a('0x2c')]);_0x5691c1[_0x849a('0x2e')]=_[_0x849a('0x2d')](_0x49ed48['model'],qs[_0x849a('0x2f')](_0x3c025e[_0x849a('0x2c')]['fields']));_0x5691c1[_0x849a('0x2e')]=_0x5691c1[_0x849a('0x2e')][_0x849a('0x30')]?_0x5691c1[_0x849a('0x2e')]:_0x49ed48[_0x849a('0x2b')];if(!_0x3c025e['query'][_0x849a('0x31')](_0x849a('0x32'))){_0x5691c1[_0x849a('0x1c')]=qs[_0x849a('0x1c')](_0x3c025e[_0x849a('0x2c')]['limit']);_0x5691c1[_0x849a('0x1b')]=qs[_0x849a('0x1b')](_0x3c025e[_0x849a('0x2c')]['offset']);}_0x5691c1['order']=qs[_0x849a('0x33')](_0x3c025e[_0x849a('0x2c')][_0x849a('0x33')]);_0x5691c1[_0x849a('0x34')]=qs[_0x849a('0x35')](_[_0x849a('0x36')](_0x3c025e[_0x849a('0x2c')],_0x49ed48[_0x849a('0x35')]),_0x283a1a);if(_0x3c025e['query'][_0x849a('0x37')]){_0x5691c1['where']=_[_0x849a('0x38')](_0x5691c1[_0x849a('0x34')],{'$or':_[_0x849a('0x28')](_0x283a1a,function(_0x4c0f98){if(_0x4c0f98['type']!==_0x849a('0x39')){var _0x1d7a58={};_0x1d7a58[_0x4c0f98[_0x849a('0x25')]]={'$like':'%'+_0x3c025e['query'][_0x849a('0x37')]+'%'};return _0x1d7a58;}})});}_0x5691c1=_[_0x849a('0x38')]({},_0x5691c1,_0x3c025e['options']);var _0xe052={'where':_0x5691c1[_0x849a('0x34')]};return db['SquareRecording'][_0x849a('0x1d')](_0xe052)[_0x849a('0x22')](function(_0x10a147){_0x4d2eac[_0x849a('0x1d')]=_0x10a147;if(_0x3c025e[_0x849a('0x2c')][_0x849a('0x3a')]){_0x5691c1[_0x849a('0x3b')]=[{'all':!![]}];}return db[_0x849a('0x3c')][_0x849a('0x3d')](_0x5691c1);})[_0x849a('0x22')](function(_0xc779c0){_0x4d2eac[_0x849a('0x3e')]=_0xc779c0;return _0x4d2eac;})[_0x849a('0x22')](respondWithFilteredResult(_0x276cee,_0x5691c1))[_0x849a('0x3f')](handleError(_0x276cee,null));};exports[_0x849a('0x40')]=function(_0x58b93b,_0x482069){var _0x397305={'raw':!![],'where':{'id':_0x58b93b[_0x849a('0x41')]['id']}},_0x172be7={};_0x172be7[_0x849a('0x2b')]=_['keys'](db[_0x849a('0x3c')][_0x849a('0x42')]);_0x172be7['query']=_[_0x849a('0x43')](_0x58b93b[_0x849a('0x2c')]);_0x172be7[_0x849a('0x35')]=_['intersection'](_0x172be7[_0x849a('0x2b')],_0x172be7['query']);_0x397305[_0x849a('0x2e')]=_[_0x849a('0x2d')](_0x172be7[_0x849a('0x2b')],qs[_0x849a('0x2f')](_0x58b93b[_0x849a('0x2c')][_0x849a('0x2f')]));_0x397305[_0x849a('0x2e')]=_0x397305[_0x849a('0x2e')][_0x849a('0x30')]?_0x397305[_0x849a('0x2e')]:_0x172be7[_0x849a('0x2b')];if(_0x58b93b[_0x849a('0x2c')][_0x849a('0x3a')]){_0x397305[_0x849a('0x3b')]=[{'all':!![]}];}_0x397305=_[_0x849a('0x38')]({},_0x397305,_0x58b93b[_0x849a('0x44')]);return db[_0x849a('0x3c')][_0x849a('0x45')](_0x397305)['then'](handleEntityNotFound(_0x482069,null))[_0x849a('0x22')](respondWithResult(_0x482069,null))[_0x849a('0x3f')](handleError(_0x482069,null));};exports[_0x849a('0x46')]=function(_0x51afe2,_0x5a6589){return db[_0x849a('0x3c')][_0x849a('0x46')](_0x51afe2['body'],{})[_0x849a('0x22')](respondWithResult(_0x5a6589,0xc9))[_0x849a('0x3f')](handleError(_0x5a6589,null));};exports['update']=function(_0xd4e478,_0x5851ed){if(_0xd4e478[_0x849a('0x47')]['id']){delete _0xd4e478['body']['id'];}return db[_0x849a('0x3c')]['find']({'where':{'id':_0xd4e478[_0x849a('0x41')]['id']}})[_0x849a('0x22')](handleEntityNotFound(_0x5851ed,null))['then'](saveUpdates(_0xd4e478[_0x849a('0x47')],null))[_0x849a('0x22')](respondWithResult(_0x5851ed,null))[_0x849a('0x3f')](handleError(_0x5851ed,null));};exports[_0x849a('0x48')]=function(_0x334daf,_0x8b754c,_0x562c1a){var _0x371685=require('../../components/encryptor');var _0x166618=![];var _0x105564={};if(_0x334daf['query'][_0x849a('0x2a')]&&_0x334daf[_0x849a('0x2c')]['type']===_0x849a('0x49')){_0x105564[_0x849a('0x49')]=_0x334daf['params']['id'];}else{_0x105564['id']=_0x334daf[_0x849a('0x41')]['id'];}return db[_0x849a('0x3c')][_0x849a('0x45')]({'where':_0x105564,'attributes':['id',_0x849a('0x4a'),_0x849a('0x4b')],'raw':!![]})[_0x849a('0x22')](handleEntityNotFound(_0x8b754c,null))[_0x849a('0x22')](function(_0x15caa6){if(_0x15caa6){var _0x5cda27=_0x15caa6[_0x849a('0x4a')];var _0x2e7bf3=util[_0x849a('0x4c')]('%s.cypher',_0x5cda27);if(fs[_0x849a('0x4d')](_0x2e7bf3)){_0x166618=!![];return _0x371685[_0x849a('0x4e')](_0x2e7bf3,_0x5cda27,config[_0x849a('0x4f')]['recording'])[_0x849a('0x22')](function(){return _0x15caa6;});}return _0x15caa6;}})['then'](function(_0x2e1c34){if(_0x2e1c34){var _0x33ed39=_0x2e1c34['savePath'];if(!fs[_0x849a('0x4d')](_0x33ed39)){throw new db[(_0x849a('0x50'))][(_0x849a('0x51'))]('SquareRecording\x20not\x20found');}if(_0x2e1c34[_0x849a('0x4b')]){return _0x8b754c[_0x849a('0x48')](_0x33ed39,_0x2e1c34[_0x849a('0x4b')]+path[_0x849a('0x52')](_0x33ed39),function(){if(_0x166618){fs['unlink'](_0x33ed39);}});}else{return _0x8b754c['download'](_0x33ed39,function(_0x31cd91){if(_0x166618){fs[_0x849a('0x53')](_0x33ed39);}});}}})[_0x849a('0x3f')](function(_0xf0d667){if(_0xf0d667[_0x849a('0x54')]===_0x849a('0x55')){_0x8b754c['status'](0x194)[_0x849a('0x26')](_0x849a('0x56'));}else{return handleError(_0x8b754c,null);}});};exports[_0x849a('0x21')]=function(_0x994f66,_0x4a8e7f){return db[_0x849a('0x3c')][_0x849a('0x45')]({'where':{'id':_0x994f66[_0x849a('0x41')]['id']}})[_0x849a('0x22')](function(_0x5782c7){if(_[_0x849a('0x57')](_0x5782c7)){throw new ReferenceError(_0x849a('0x58'));}return _0x5782c7;})[_0x849a('0x22')](function(_0x2d077c){var _0x1e7111=_0x2d077c['savePath'];logger[_0x849a('0x59')](_0x849a('0x5a'),_0x1e7111);if(!_[_0x849a('0x57')](_0x2d077c[_0x849a('0x4a')])&&fs['existsSync'](_0x1e7111)){logger[_0x849a('0x59')](_0x849a('0x5b')+_0x1e7111+_0x849a('0x5c'));fs['unlinkSync'](_0x1e7111);}_0x1e7111=_0x1e7111+'.cypher';if(!_[_0x849a('0x57')](_0x2d077c[_0x849a('0x4a')])&&fs[_0x849a('0x4d')](_0x1e7111)){logger[_0x849a('0x59')](_0x849a('0x5b')+_0x1e7111+_0x849a('0x5c'));fs['unlinkSync'](_0x1e7111);}return _0x2d077c;})[_0x849a('0x22')](function(_0x5aa83e){if(!_0x5aa83e)throw new InternalError();return _0x5aa83e[_0x849a('0x21')]();})[_0x849a('0x22')](function(){_0x4a8e7f['status'](0xcc)[_0x849a('0x19')]();})[_0x849a('0x3f')](handleError(_0x4a8e7f,null));}; \ No newline at end of file +var _0xb35d=['fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SquareRecording','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb35d,0xc1));var _0xdb35=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0xb35d[_0x40df5f];return _0x1573f1;};'use strict';var emlformat=require(_0xdb35('0x0'));var rimraf=require(_0xdb35('0x1'));var zipdir=require(_0xdb35('0x2'));var jsonpatch=require(_0xdb35('0x3'));var rp=require(_0xdb35('0x4'));var moment=require(_0xdb35('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb35('0x6'));var util=require('util');var path=require(_0xdb35('0x7'));var sox=require(_0xdb35('0x8'));var csv=require(_0xdb35('0x9'));var ejs=require(_0xdb35('0xa'));var fs=require('fs');var fs_extra=require(_0xdb35('0xb'));var _=require(_0xdb35('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb35('0xd'));var deskjs=require(_0xdb35('0xe'));var toCsv=require(_0xdb35('0x9'));var querystring=require('querystring');var Papa=require(_0xdb35('0xf'));var Redis=require('ioredis');var authService=require(_0xdb35('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdb35('0x11'));var hardwareService=require(_0xdb35('0x12'));var logger=require(_0xdb35('0x13'))(_0xdb35('0x14'));var utils=require(_0xdb35('0x15'));var config=require(_0xdb35('0x16'));var licenseUtil=require(_0xdb35('0x17'));var db=require(_0xdb35('0x18'))['db'];function respondWithStatusCode(_0x19e96c,_0x62c24){_0x62c24=_0x62c24||0xcc;return function(_0x1d36b4){if(_0x1d36b4){return _0x19e96c['sendStatus'](_0x62c24);}return _0x19e96c[_0xdb35('0x19')](_0x62c24)[_0xdb35('0x1a')]();};}function respondWithResult(_0x5ec9cd,_0x5af9fb){_0x5af9fb=_0x5af9fb||0xc8;return function(_0x54f0ad){if(_0x54f0ad){return _0x5ec9cd[_0xdb35('0x19')](_0x5af9fb)[_0xdb35('0x1b')](_0x54f0ad);}};}function respondWithFilteredResult(_0x5e4147,_0x122f96){return function(_0x279262){if(_0x279262){var _0x53418e=typeof _0x122f96['offset']==='undefined'&&typeof _0x122f96[_0xdb35('0x1c')]===_0xdb35('0x1d');var _0x16290b=_0x279262[_0xdb35('0x1e')];var _0x2fe1a1=_0x53418e?0x0:_0x122f96[_0xdb35('0x1f')];var _0xabd7b5=_0x53418e?_0x279262[_0xdb35('0x1e')]:_0x122f96[_0xdb35('0x1f')]+_0x122f96[_0xdb35('0x1c')];var _0x8ecc56;if(_0xabd7b5>=_0x16290b){_0xabd7b5=_0x16290b;_0x8ecc56=0xc8;}else{_0x8ecc56=0xce;}_0x5e4147[_0xdb35('0x19')](_0x8ecc56);return _0x5e4147[_0xdb35('0x20')]('Content-Range',_0x2fe1a1+'-'+_0xabd7b5+'/'+_0x16290b)[_0xdb35('0x1b')](_0x279262);}return null;};}function patchUpdates(_0x4b2a3d){return function(_0x367c82){try{jsonpatch[_0xdb35('0x21')](_0x367c82,_0x4b2a3d,!![]);}catch(_0x263072){return BPromise[_0xdb35('0x22')](_0x263072);}return _0x367c82[_0xdb35('0x23')]();};}function saveUpdates(_0x112830,_0x4d8885){return function(_0xd6e5a1){if(_0xd6e5a1){return _0xd6e5a1[_0xdb35('0x24')](_0x112830)[_0xdb35('0x25')](function(_0x5380c7){return _0x5380c7;});}return null;};}function removeEntity(_0x53eead,_0x2a3f4e){return function(_0x3cb352){if(_0x3cb352){return _0x3cb352['destroy']()[_0xdb35('0x25')](function(){_0x53eead[_0xdb35('0x19')](0xcc)[_0xdb35('0x1a')]();});}};}function handleEntityNotFound(_0x1677a4,_0x38d342){return function(_0x547578){if(!_0x547578){_0x1677a4[_0xdb35('0x26')](0x194);}return _0x547578;};}function handleError(_0x22efd2,_0x1f3faa){_0x1f3faa=_0x1f3faa||0x1f4;return function(_0x573c5b){logger[_0xdb35('0x27')](_0x573c5b[_0xdb35('0x28')]);if(_0x573c5b[_0xdb35('0x29')]){delete _0x573c5b[_0xdb35('0x29')];}_0x22efd2['status'](_0x1f3faa)[_0xdb35('0x2a')](_0x573c5b);};}exports[_0xdb35('0x2b')]=function(_0x5021d1,_0x53faf4){var _0x26f3ad={},_0x30dd49={},_0x19c78e={'count':0x0,'rows':[]};var _0x557b30=_[_0xdb35('0x2c')](db[_0xdb35('0x2d')]['rawAttributes'],function(_0x1354bb){return{'name':_0x1354bb[_0xdb35('0x2e')],'type':_0x1354bb['type'][_0xdb35('0x2f')]};});_0x30dd49['model']=_[_0xdb35('0x2c')](_0x557b30,_0xdb35('0x29'));_0x30dd49[_0xdb35('0x30')]=_[_0xdb35('0x31')](_0x5021d1[_0xdb35('0x30')]);_0x30dd49[_0xdb35('0x32')]=_[_0xdb35('0x33')](_0x30dd49[_0xdb35('0x34')],_0x30dd49['query']);_0x26f3ad['attributes']=_[_0xdb35('0x33')](_0x30dd49[_0xdb35('0x34')],qs[_0xdb35('0x35')](_0x5021d1['query']['fields']));_0x26f3ad['attributes']=_0x26f3ad[_0xdb35('0x36')][_0xdb35('0x37')]?_0x26f3ad[_0xdb35('0x36')]:_0x30dd49[_0xdb35('0x34')];if(!_0x5021d1[_0xdb35('0x30')][_0xdb35('0x38')](_0xdb35('0x39'))){_0x26f3ad['limit']=qs['limit'](_0x5021d1['query'][_0xdb35('0x1c')]);_0x26f3ad[_0xdb35('0x1f')]=qs[_0xdb35('0x1f')](_0x5021d1[_0xdb35('0x30')][_0xdb35('0x1f')]);}_0x26f3ad[_0xdb35('0x3a')]=qs['sort'](_0x5021d1[_0xdb35('0x30')][_0xdb35('0x3b')]);_0x26f3ad[_0xdb35('0x3c')]=qs[_0xdb35('0x32')](_[_0xdb35('0x3d')](_0x5021d1[_0xdb35('0x30')],_0x30dd49[_0xdb35('0x32')]),_0x557b30);if(_0x5021d1[_0xdb35('0x30')]['filter']){_0x26f3ad[_0xdb35('0x3c')]=_[_0xdb35('0x3e')](_0x26f3ad[_0xdb35('0x3c')],{'$or':_[_0xdb35('0x2c')](_0x557b30,function(_0x5d2885){if(_0x5d2885[_0xdb35('0x3f')]!==_0xdb35('0x40')){var _0x776068={};_0x776068[_0x5d2885[_0xdb35('0x29')]]={'$like':'%'+_0x5021d1[_0xdb35('0x30')][_0xdb35('0x41')]+'%'};return _0x776068;}})});}_0x26f3ad=_['merge']({},_0x26f3ad,_0x5021d1[_0xdb35('0x42')]);var _0x3abec8={'where':_0x26f3ad[_0xdb35('0x3c')]};return db[_0xdb35('0x2d')]['count'](_0x3abec8)[_0xdb35('0x25')](function(_0x3bff2d){_0x19c78e[_0xdb35('0x1e')]=_0x3bff2d;if(_0x5021d1[_0xdb35('0x30')][_0xdb35('0x43')]){_0x26f3ad['include']=[{'all':!![]}];}return db[_0xdb35('0x2d')][_0xdb35('0x44')](_0x26f3ad);})['then'](function(_0x1757ef){_0x19c78e['rows']=_0x1757ef;return _0x19c78e;})[_0xdb35('0x25')](respondWithFilteredResult(_0x53faf4,_0x26f3ad))[_0xdb35('0x45')](handleError(_0x53faf4,null));};exports[_0xdb35('0x46')]=function(_0x406c45,_0xb43916){var _0x37adc8={'raw':!![],'where':{'id':_0x406c45[_0xdb35('0x47')]['id']}},_0x24b22c={};_0x24b22c[_0xdb35('0x34')]=_[_0xdb35('0x31')](db[_0xdb35('0x2d')][_0xdb35('0x48')]);_0x24b22c[_0xdb35('0x30')]=_['keys'](_0x406c45[_0xdb35('0x30')]);_0x24b22c[_0xdb35('0x32')]=_[_0xdb35('0x33')](_0x24b22c[_0xdb35('0x34')],_0x24b22c[_0xdb35('0x30')]);_0x37adc8['attributes']=_[_0xdb35('0x33')](_0x24b22c[_0xdb35('0x34')],qs['fields'](_0x406c45['query']['fields']));_0x37adc8['attributes']=_0x37adc8['attributes']['length']?_0x37adc8[_0xdb35('0x36')]:_0x24b22c['model'];if(_0x406c45[_0xdb35('0x30')][_0xdb35('0x43')]){_0x37adc8[_0xdb35('0x49')]=[{'all':!![]}];}_0x37adc8=_[_0xdb35('0x3e')]({},_0x37adc8,_0x406c45[_0xdb35('0x42')]);return db[_0xdb35('0x2d')][_0xdb35('0x4a')](_0x37adc8)[_0xdb35('0x25')](handleEntityNotFound(_0xb43916,null))[_0xdb35('0x25')](respondWithResult(_0xb43916,null))['catch'](handleError(_0xb43916,null));};exports[_0xdb35('0x4b')]=function(_0x479819,_0x4d2222){return db['SquareRecording'][_0xdb35('0x4b')](_0x479819[_0xdb35('0x4c')],{})[_0xdb35('0x25')](respondWithResult(_0x4d2222,0xc9))[_0xdb35('0x45')](handleError(_0x4d2222,null));};exports[_0xdb35('0x24')]=function(_0x3fab55,_0x343312){if(_0x3fab55[_0xdb35('0x4c')]['id']){delete _0x3fab55[_0xdb35('0x4c')]['id'];}return db[_0xdb35('0x2d')][_0xdb35('0x4a')]({'where':{'id':_0x3fab55[_0xdb35('0x47')]['id']}})[_0xdb35('0x25')](handleEntityNotFound(_0x343312,null))[_0xdb35('0x25')](saveUpdates(_0x3fab55[_0xdb35('0x4c')],null))[_0xdb35('0x25')](respondWithResult(_0x343312,null))['catch'](handleError(_0x343312,null));};exports[_0xdb35('0x4d')]=function(_0x5a7c33,_0x585a01,_0x4baaca){var _0x4a473f=require(_0xdb35('0x4e'));var _0x2658e4=![];var _0x2162f6={};if(_0x5a7c33[_0xdb35('0x30')][_0xdb35('0x3f')]&&_0x5a7c33[_0xdb35('0x30')][_0xdb35('0x3f')]===_0xdb35('0x4f')){_0x2162f6[_0xdb35('0x4f')]=_0x5a7c33[_0xdb35('0x47')]['id'];}else{_0x2162f6['id']=_0x5a7c33['params']['id'];}return db[_0xdb35('0x2d')]['find']({'where':_0x2162f6,'attributes':['id',_0xdb35('0x50'),_0xdb35('0x51')],'raw':!![]})[_0xdb35('0x25')](handleEntityNotFound(_0x585a01,null))[_0xdb35('0x25')](function(_0x2895b2){if(_0x2895b2){var _0x1f55a3=_0x2895b2[_0xdb35('0x50')];var _0x336349=util[_0xdb35('0x52')](_0xdb35('0x53'),_0x1f55a3);if(fs['existsSync'](_0x336349)){_0x2658e4=!![];return _0x4a473f[_0xdb35('0x54')](_0x336349,_0x1f55a3,config[_0xdb35('0x55')][_0xdb35('0x56')])[_0xdb35('0x25')](function(){return _0x2895b2;});}return _0x2895b2;}})[_0xdb35('0x25')](function(_0x58acdd){if(_0x58acdd){var _0x10b5ce=_0x58acdd['savePath'];if(!fs[_0xdb35('0x57')](_0x10b5ce)){throw new db[(_0xdb35('0x58'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x58acdd[_0xdb35('0x51')]){return _0x585a01[_0xdb35('0x4d')](_0x10b5ce,_0x58acdd['filename']+path[_0xdb35('0x59')](_0x10b5ce),function(){if(_0x2658e4){fs[_0xdb35('0x5a')](_0x10b5ce);}});}else{return _0x585a01[_0xdb35('0x4d')](_0x10b5ce,function(_0x4a67fc){if(_0x2658e4){fs['unlink'](_0x10b5ce);}});}}})['catch'](function(_0x181022){if(_0x181022[_0xdb35('0x5b')]===_0xdb35('0x5c')){_0x585a01[_0xdb35('0x19')](0x194)['send'](_0xdb35('0x5d'));}else{return handleError(_0x585a01,null);}});};exports[_0xdb35('0x5e')]=function(_0x4d15f2,_0x465400){return db[_0xdb35('0x2d')]['find']({'where':{'id':_0x4d15f2['params']['id']}})[_0xdb35('0x25')](function(_0x165e9a){if(_[_0xdb35('0x5f')](_0x165e9a)){throw new ReferenceError(_0xdb35('0x60'));}return _0x165e9a;})[_0xdb35('0x25')](function(_0x40fcc0){var _0x39556b=_0x40fcc0[_0xdb35('0x50')];logger[_0xdb35('0x61')](_0xdb35('0x62'),_0x39556b);if(!_['isNil'](_0x40fcc0[_0xdb35('0x50')])&&fs[_0xdb35('0x57')](_0x39556b)){logger[_0xdb35('0x61')](_0xdb35('0x63')+_0x39556b+_0xdb35('0x64'));fs[_0xdb35('0x65')](_0x39556b);}_0x39556b=_0x39556b+'.cypher';if(!_[_0xdb35('0x5f')](_0x40fcc0['savePath'])&&fs['existsSync'](_0x39556b)){logger[_0xdb35('0x61')](_0xdb35('0x63')+_0x39556b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdb35('0x65')](_0x39556b);}return _0x40fcc0;})['then'](function(_0x18fe26){if(!_0x18fe26)throw new InternalError();return _0x18fe26[_0xdb35('0x5e')]();})[_0xdb35('0x25')](function(){_0x465400[_0xdb35('0x19')](0xcc)[_0xdb35('0x1a')]();})[_0xdb35('0x45')](handleError(_0x465400,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e08620a..544a2a6 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 _0x1751=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1fafff,_0x47783e){var _0x4c4332=function(_0x1f43e7){while(--_0x1f43e7){_0x1fafff['push'](_0x1fafff['shift']());}};_0x4c4332(++_0x47783e);}(_0x1751,0x76));var _0x1175=function(_0x52301d,_0x43e269){_0x52301d=_0x52301d-0x0;var _0xe2c669=_0x1751[_0x52301d];return _0xe2c669;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));module[_0x1175('0xa')]=function(_0x171756,_0x3f99ca){return _0x171756[_0x1175('0xb')](_0x1175('0xc'),attributes,{'tableName':_0x1175('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a83=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x5c812f,_0x790971){var _0x39f134=function(_0xed4b9c){while(--_0xed4b9c){_0x5c812f['push'](_0x5c812f['shift']());}};_0x39f134(++_0x790971);}(_0x6a83,0xd2));var _0x36a8=function(_0x13a190,_0x5779a8){_0x13a190=_0x13a190-0x0;var _0x252eb9=_0x6a83[_0x13a190];return _0x252eb9;};'use strict';var _=require(_0x36a8('0x0'));var util=require(_0x36a8('0x1'));var logger=require(_0x36a8('0x2'))(_0x36a8('0x3'));var moment=require(_0x36a8('0x4'));var BPromise=require(_0x36a8('0x5'));var rp=require(_0x36a8('0x6'));var fs=require('fs');var path=require(_0x36a8('0x7'));var rimraf=require(_0x36a8('0x8'));var config=require(_0x36a8('0x9'));var attributes=require(_0x36a8('0xa'));module[_0x36a8('0xb')]=function(_0x360b47,_0x60d79a){return _0x360b47[_0x36a8('0xc')](_0x36a8('0xd'),attributes,{'tableName':_0x36a8('0xe'),'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 3dbe558..f056543 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 _0xc358=['then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x1d8d01,_0xdc4a05){var _0x311e40=function(_0x5f093f){while(--_0x5f093f){_0x1d8d01['push'](_0x1d8d01['shift']());}};_0x311e40(++_0xdc4a05);}(_0xc358,0x1f4));var _0x8c35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc358[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8c35('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c35('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c35('0x2'))(_0x8c35('0x3'));var config=require(_0x8c35('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8c35('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18ef96,_0x16a961,_0x4a5fd0){return new BPromise(function(_0x516aa3,_0x4bc85c){return client['request'](_0x18ef96,_0x4a5fd0)[_0x8c35('0x6')](function(_0x547962){logger[_0x8c35('0x7')](_0x8c35('0x8'),_0x16a961,'request\x20sent');logger[_0x8c35('0x9')](_0x8c35('0xa'),_0x16a961,'request\x20sent',JSON[_0x8c35('0xb')](_0x547962));if(_0x547962[_0x8c35('0xc')]){if(_0x547962[_0x8c35('0xc')]['code']===0x1f4){logger['error'](_0x8c35('0x8'),_0x16a961,_0x547962[_0x8c35('0xc')]['message']);return _0x4bc85c(_0x547962[_0x8c35('0xc')][_0x8c35('0xd')]);}logger[_0x8c35('0xc')](_0x8c35('0x8'),_0x16a961,_0x547962[_0x8c35('0xc')]['message']);return _0x516aa3(_0x547962[_0x8c35('0xc')]['message']);}else{logger[_0x8c35('0x7')](_0x8c35('0x8'),_0x16a961,_0x8c35('0xe'));_0x516aa3(_0x547962[_0x8c35('0xf')]['message']);}})['catch'](function(_0x3ce542){logger['error'](_0x8c35('0x8'),_0x16a961,_0x3ce542);_0x4bc85c(_0x3ce542);});});}exports[_0x8c35('0x10')]=function(_0x37b38f){var _0x2be3a=this;return new Promise(function(_0x36a9c9,_0x2863f6){return db[_0x8c35('0x11')][_0x8c35('0x12')](_0x37b38f[_0x8c35('0x13')],{'raw':_0x37b38f['options']?_0x37b38f[_0x8c35('0x14')][_0x8c35('0x15')]===undefined?!![]:![]:!![]})[_0x8c35('0x6')](function(_0x16121c){logger[_0x8c35('0x7')](_0x8c35('0x10'),_0x37b38f);logger[_0x8c35('0x9')](_0x8c35('0x10'),_0x37b38f,JSON[_0x8c35('0xb')](_0x16121c));_0x36a9c9(_0x16121c);})[_0x8c35('0x16')](function(_0x5544be){logger['error']('CreateSquareRecording',_0x5544be[_0x8c35('0xd')],_0x37b38f);_0x2863f6(_0x2be3a[_0x8c35('0xc')](0x1f4,_0x5544be[_0x8c35('0xd')]));});});}; \ No newline at end of file +var _0x1abd=['CreateSquareRecording','SquareRecording','create','body','options','raw','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x25e38b,_0x312270){var _0x2f1a4b=function(_0x4d76bf){while(--_0x4d76bf){_0x25e38b['push'](_0x25e38b['shift']());}};_0x2f1a4b(++_0x312270);}(_0x1abd,0xb5));var _0xd1ab=function(_0x53d729,_0x1a2198){_0x53d729=_0x53d729-0x0;var _0x568f90=_0x1abd[_0x53d729];return _0x568f90;};'use strict';var _=require(_0xd1ab('0x0'));var util=require(_0xd1ab('0x1'));var moment=require(_0xd1ab('0x2'));var BPromise=require(_0xd1ab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1ab('0x4'))['db'];var utils=require(_0xd1ab('0x5'));var logger=require(_0xd1ab('0x6'))(_0xd1ab('0x7'));var config=require('../../config/environment');var jayson=require(_0xd1ab('0x8'));var client=jayson[_0xd1ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x137db9,_0x5c933e,_0x34c6a9){return new BPromise(function(_0x48e3e2,_0x5e5dda){return client[_0xd1ab('0xa')](_0x137db9,_0x34c6a9)[_0xd1ab('0xb')](function(_0x2213f9){logger['info'](_0xd1ab('0xc'),_0x5c933e,_0xd1ab('0xd'));logger[_0xd1ab('0xe')](_0xd1ab('0xf'),_0x5c933e,_0xd1ab('0xd'),JSON[_0xd1ab('0x10')](_0x2213f9));if(_0x2213f9['error']){if(_0x2213f9[_0xd1ab('0x11')][_0xd1ab('0x12')]===0x1f4){logger[_0xd1ab('0x11')](_0xd1ab('0xc'),_0x5c933e,_0x2213f9[_0xd1ab('0x11')][_0xd1ab('0x13')]);return _0x5e5dda(_0x2213f9[_0xd1ab('0x11')][_0xd1ab('0x13')]);}logger[_0xd1ab('0x11')](_0xd1ab('0xc'),_0x5c933e,_0x2213f9[_0xd1ab('0x11')]['message']);return _0x48e3e2(_0x2213f9[_0xd1ab('0x11')]['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x5c933e,_0xd1ab('0xd'));_0x48e3e2(_0x2213f9[_0xd1ab('0x14')][_0xd1ab('0x13')]);}})[_0xd1ab('0x15')](function(_0x5d246a){logger[_0xd1ab('0x11')](_0xd1ab('0xc'),_0x5c933e,_0x5d246a);_0x5e5dda(_0x5d246a);});});}exports[_0xd1ab('0x16')]=function(_0x2ddbc6){var _0x41c415=this;return new Promise(function(_0x537437,_0x356537){return db[_0xd1ab('0x17')][_0xd1ab('0x18')](_0x2ddbc6[_0xd1ab('0x19')],{'raw':_0x2ddbc6['options']?_0x2ddbc6[_0xd1ab('0x1a')][_0xd1ab('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x21fada){logger[_0xd1ab('0x1c')]('CreateSquareRecording',_0x2ddbc6);logger[_0xd1ab('0xe')](_0xd1ab('0x16'),_0x2ddbc6,JSON[_0xd1ab('0x10')](_0x21fada));_0x537437(_0x21fada);})[_0xd1ab('0x15')](function(_0x1a853f){logger[_0xd1ab('0x11')]('CreateSquareRecording',_0x1a853f[_0xd1ab('0x13')],_0x2ddbc6);_0x356537(_0x41c415[_0xd1ab('0x11')](0x1f4,_0x1a853f[_0xd1ab('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 11635b1..31f2cb8 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x38750a,_0x316de4){var _0x92e34a=function(_0x4f83e1){while(--_0x4f83e1){_0x38750a['push'](_0x38750a['shift']());}};_0x92e34a(++_0x316de4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xa59345,_0x86f01c){var _0x22fc32=function(_0x1c5423){while(--_0x1c5423){_0xa59345['push'](_0xa59345['shift']());}};_0x22fc32(++_0x86f01c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 8773f4a..25b97f7 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 _0x31c8=['exports','STRING','DATE','sequelize'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0x31c8,0xf3));var _0x831c=function(_0x478e34,_0x4960b4){_0x478e34=_0x478e34-0x0;var _0x2d96f0=_0x31c8[_0x478e34];return _0x2d96f0;};'use strict';var Sequelize=require(_0x831c('0x0'));module[_0x831c('0x1')]={'network':{'type':Sequelize[_0x831c('0x2')]},'network_script':{'type':Sequelize[_0x831c('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x831c('0x2')]},'language':{'type':Sequelize[_0x831c('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x831c('0x2')]},'version':{'type':Sequelize[_0x831c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x831c('0x2')]},'callingpres':{'type':Sequelize[_0x831c('0x2')]},'callingani2':{'type':Sequelize[_0x831c('0x2')]},'callington':{'type':Sequelize[_0x831c('0x2')]},'callingtns':{'type':Sequelize[_0x831c('0x2')]},'dnid':{'type':Sequelize[_0x831c('0x2')]},'rdnis':{'type':Sequelize[_0x831c('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x831c('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x831c('0x2')]},'accountcode':{'type':Sequelize[_0x831c('0x2')]},'threadid':{'type':Sequelize[_0x831c('0x2')]},'project_name':{'type':Sequelize[_0x831c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x831c('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x371c=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x371c,0xe4));var _0xc371=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x371c[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xc371('0x0'));module[_0xc371('0x1')]={'network':{'type':Sequelize[_0xc371('0x2')]},'network_script':{'type':Sequelize[_0xc371('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc371('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc371('0x2')]},'version':{'type':Sequelize[_0xc371('0x2')]},'callerid':{'type':Sequelize[_0xc371('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xc371('0x2')]},'callingani2':{'type':Sequelize[_0xc371('0x2')]},'callington':{'type':Sequelize[_0xc371('0x2')]},'callingtns':{'type':Sequelize[_0xc371('0x2')]},'dnid':{'type':Sequelize[_0xc371('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc371('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xc371('0x2')]},'accountcode':{'type':Sequelize[_0xc371('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xc371('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc371('0x3')]},'bot':{'type':Sequelize[_0xc371('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 7806b36..2757ddf 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 _0x6c47=['to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','options','SquareReport','includeAll','include','catch','params','filters','merge','find','create','body','describe','eml-format','zip-dir','bluebird','util','path','sox'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0x6c47,0x1b0));var _0x76c4=function(_0x43df6e,_0x4b1cf4){_0x43df6e=_0x43df6e-0x0;var _0x17fceb=_0x6c47[_0x43df6e];return _0x17fceb;};'use strict';var emlformat=require(_0x76c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x76c4('0x2'));var Mustache=require('mustache');var util=require(_0x76c4('0x3'));var path=require(_0x76c4('0x4'));var sox=require(_0x76c4('0x5'));var csv=require(_0x76c4('0x6'));var ejs=require(_0x76c4('0x7'));var fs=require('fs');var fs_extra=require(_0x76c4('0x8'));var _=require(_0x76c4('0x9'));var squel=require(_0x76c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x76c4('0x6'));var querystring=require(_0x76c4('0xc'));var Papa=require(_0x76c4('0xd'));var Redis=require(_0x76c4('0xe'));var authService=require(_0x76c4('0xf'));var qs=require(_0x76c4('0x10'));var as=require(_0x76c4('0x11'));var hardwareService=require(_0x76c4('0x12'));var logger=require('../../config/logger')(_0x76c4('0x13'));var utils=require(_0x76c4('0x14'));var config=require(_0x76c4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x76c4('0x16'))['db'];function respondWithStatusCode(_0x25b48c,_0x5c570e){_0x5c570e=_0x5c570e||0xcc;return function(_0x35bb4c){if(_0x35bb4c){return _0x25b48c[_0x76c4('0x17')](_0x5c570e);}return _0x25b48c[_0x76c4('0x18')](_0x5c570e)[_0x76c4('0x19')]();};}function respondWithResult(_0x28f8a2,_0x272e93){_0x272e93=_0x272e93||0xc8;return function(_0x47796f){if(_0x47796f){return _0x28f8a2[_0x76c4('0x18')](_0x272e93)[_0x76c4('0x1a')](_0x47796f);}};}function respondWithFilteredResult(_0x2c3611,_0x398c47){return function(_0x500034){if(_0x500034){var _0xa45836=typeof _0x398c47[_0x76c4('0x1b')]==='undefined'&&typeof _0x398c47[_0x76c4('0x1c')]===_0x76c4('0x1d');var _0x1c52b8=_0x500034['count'];var _0x49d77f=_0xa45836?0x0:_0x398c47[_0x76c4('0x1b')];var _0x42a8dc=_0xa45836?_0x500034[_0x76c4('0x1e')]:_0x398c47['offset']+_0x398c47[_0x76c4('0x1c')];var _0x558f39;if(_0x42a8dc>=_0x1c52b8){_0x42a8dc=_0x1c52b8;_0x558f39=0xc8;}else{_0x558f39=0xce;}_0x2c3611[_0x76c4('0x18')](_0x558f39);return _0x2c3611[_0x76c4('0x1f')](_0x76c4('0x20'),_0x49d77f+'-'+_0x42a8dc+'/'+_0x1c52b8)[_0x76c4('0x1a')](_0x500034);}return null;};}function patchUpdates(_0x247b76){return function(_0x13f018){try{jsonpatch[_0x76c4('0x21')](_0x13f018,_0x247b76,!![]);}catch(_0x37a672){return BPromise[_0x76c4('0x22')](_0x37a672);}return _0x13f018[_0x76c4('0x23')]();};}function saveUpdates(_0x589374,_0x3ecb83){return function(_0x577e6b){if(_0x577e6b){return _0x577e6b[_0x76c4('0x24')](_0x589374)['then'](function(_0x300a26){return _0x300a26;});}return null;};}function removeEntity(_0x4b775c,_0x1ee11d){return function(_0x58717e){if(_0x58717e){return _0x58717e[_0x76c4('0x25')]()[_0x76c4('0x26')](function(){_0x4b775c['status'](0xcc)[_0x76c4('0x19')]();});}};}function handleEntityNotFound(_0x21c1f5,_0x2a0380){return function(_0x138b59){if(!_0x138b59){_0x21c1f5[_0x76c4('0x17')](0x194);}return _0x138b59;};}function handleError(_0x33d65f,_0x36f6b0){_0x36f6b0=_0x36f6b0||0x1f4;return function(_0x3e182d){logger[_0x76c4('0x27')](_0x3e182d[_0x76c4('0x28')]);if(_0x3e182d[_0x76c4('0x29')]){delete _0x3e182d[_0x76c4('0x29')];}_0x33d65f[_0x76c4('0x18')](_0x36f6b0)[_0x76c4('0x2a')](_0x3e182d);};}exports[_0x76c4('0x2b')]=function(_0x17e958,_0x40c241){var _0x3d91ce={},_0x48890d={},_0x3d7cbf={'count':0x0,'rows':[]};var _0x1038b7=_[_0x76c4('0x2c')](db['SquareReport'][_0x76c4('0x2d')],function(_0x30e814){return{'name':_0x30e814['fieldName'],'type':_0x30e814[_0x76c4('0x2e')][_0x76c4('0x2f')]};});_0x48890d[_0x76c4('0x30')]=_[_0x76c4('0x2c')](_0x1038b7,_0x76c4('0x29'));_0x48890d[_0x76c4('0x31')]=_[_0x76c4('0x32')](_0x17e958[_0x76c4('0x31')]);_0x48890d['filters']=_[_0x76c4('0x33')](_0x48890d[_0x76c4('0x30')],_0x48890d[_0x76c4('0x31')]);_0x3d91ce['attributes']=_['intersection'](_0x48890d['model'],qs[_0x76c4('0x34')](_0x17e958[_0x76c4('0x31')][_0x76c4('0x34')]));_0x3d91ce[_0x76c4('0x35')]=_0x3d91ce['attributes'][_0x76c4('0x36')]?_0x3d91ce['attributes']:_0x48890d[_0x76c4('0x30')];if(!_0x17e958[_0x76c4('0x31')][_0x76c4('0x37')]('nolimit')){_0x3d91ce['limit']=qs['limit'](_0x17e958['query'][_0x76c4('0x1c')]);_0x3d91ce[_0x76c4('0x1b')]=qs[_0x76c4('0x1b')](_0x17e958[_0x76c4('0x31')]['offset']);}_0x3d91ce[_0x76c4('0x38')]=qs[_0x76c4('0x39')](_0x17e958[_0x76c4('0x31')][_0x76c4('0x39')]);_0x3d91ce[_0x76c4('0x3a')]=qs['filters'](_[_0x76c4('0x3b')](_0x17e958['query'],_0x48890d['filters']),_0x1038b7);if(_0x17e958[_0x76c4('0x31')][_0x76c4('0x3c')]){_0x3d91ce['where']=_['merge'](_0x3d91ce[_0x76c4('0x3a')],{'$or':_[_0x76c4('0x2c')](_0x1038b7,function(_0x5509f6){if(_0x5509f6[_0x76c4('0x2e')]!=='VIRTUAL'){var _0x43ec3d={};_0x43ec3d[_0x5509f6[_0x76c4('0x29')]]={'$like':'%'+_0x17e958[_0x76c4('0x31')][_0x76c4('0x3c')]+'%'};return _0x43ec3d;}})});}_0x3d91ce=_['merge']({},_0x3d91ce,_0x17e958[_0x76c4('0x3d')]);var _0x1513fb={'where':_0x3d91ce[_0x76c4('0x3a')]};return db[_0x76c4('0x3e')][_0x76c4('0x1e')](_0x1513fb)[_0x76c4('0x26')](function(_0x397aa3){_0x3d7cbf[_0x76c4('0x1e')]=_0x397aa3;if(_0x17e958[_0x76c4('0x31')][_0x76c4('0x3f')]){_0x3d91ce[_0x76c4('0x40')]=[{'all':!![]}];}return db[_0x76c4('0x3e')]['findAll'](_0x3d91ce);})[_0x76c4('0x26')](function(_0x15ad3a){_0x3d7cbf['rows']=_0x15ad3a;return _0x3d7cbf;})[_0x76c4('0x26')](respondWithFilteredResult(_0x40c241,_0x3d91ce))[_0x76c4('0x41')](handleError(_0x40c241,null));};exports['show']=function(_0x3de586,_0x4d591d){var _0x298d43={'raw':!![],'where':{'id':_0x3de586[_0x76c4('0x42')]['id']}},_0x5cdd26={};_0x5cdd26[_0x76c4('0x30')]=_[_0x76c4('0x32')](db['SquareReport'][_0x76c4('0x2d')]);_0x5cdd26['query']=_[_0x76c4('0x32')](_0x3de586['query']);_0x5cdd26[_0x76c4('0x43')]=_['intersection'](_0x5cdd26[_0x76c4('0x30')],_0x5cdd26[_0x76c4('0x31')]);_0x298d43[_0x76c4('0x35')]=_[_0x76c4('0x33')](_0x5cdd26[_0x76c4('0x30')],qs[_0x76c4('0x34')](_0x3de586['query'][_0x76c4('0x34')]));_0x298d43['attributes']=_0x298d43[_0x76c4('0x35')][_0x76c4('0x36')]?_0x298d43[_0x76c4('0x35')]:_0x5cdd26[_0x76c4('0x30')];if(_0x3de586[_0x76c4('0x31')]['includeAll']){_0x298d43[_0x76c4('0x40')]=[{'all':!![]}];}_0x298d43=_[_0x76c4('0x44')]({},_0x298d43,_0x3de586[_0x76c4('0x3d')]);return db['SquareReport'][_0x76c4('0x45')](_0x298d43)['then'](handleEntityNotFound(_0x4d591d,null))['then'](respondWithResult(_0x4d591d,null))[_0x76c4('0x41')](handleError(_0x4d591d,null));};exports[_0x76c4('0x46')]=function(_0x58e6f4,_0x3391d0){return db['SquareReport'][_0x76c4('0x46')](_0x58e6f4[_0x76c4('0x47')],{})['then'](respondWithResult(_0x3391d0,0xc9))[_0x76c4('0x41')](handleError(_0x3391d0,null));};exports[_0x76c4('0x24')]=function(_0x4802bd,_0x93b74){if(_0x4802bd[_0x76c4('0x47')]['id']){delete _0x4802bd[_0x76c4('0x47')]['id'];}return db[_0x76c4('0x3e')][_0x76c4('0x45')]({'where':{'id':_0x4802bd[_0x76c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x93b74,null))[_0x76c4('0x26')](saveUpdates(_0x4802bd[_0x76c4('0x47')],null))[_0x76c4('0x26')](respondWithResult(_0x93b74,null))[_0x76c4('0x41')](handleError(_0x93b74,null));};exports[_0x76c4('0x25')]=function(_0x5ebf83,_0x253713){return db[_0x76c4('0x3e')][_0x76c4('0x45')]({'where':{'id':_0x5ebf83[_0x76c4('0x42')]['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x253713,null))['then'](removeEntity(_0x253713,null))[_0x76c4('0x41')](handleError(_0x253713,null));};exports[_0x76c4('0x48')]=function(_0x1df82b,_0x4ecb26){return db['SquareReport'][_0x76c4('0x48')]()[_0x76c4('0x26')](respondWithResult(_0x4ecb26,null))[_0x76c4('0x41')](handleError(_0x4ecb26,null));}; \ No newline at end of file +var _0x8631=['options','includeAll','include','SquareReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','error','stack','name','send','map','key','model','query','keys','intersection','attributes','fields','length','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x3ad595,_0x26454b){var _0x5ddab2=function(_0x130754){while(--_0x130754){_0x3ad595['push'](_0x3ad595['shift']());}};_0x5ddab2(++_0x26454b);}(_0x8631,0x99));var _0x1863=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8631[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x1863('0x0'));var rimraf=require(_0x1863('0x1'));var zipdir=require(_0x1863('0x2'));var jsonpatch=require(_0x1863('0x3'));var rp=require('request-promise');var moment=require(_0x1863('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1863('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1863('0x6'));var csv=require(_0x1863('0x7'));var ejs=require(_0x1863('0x8'));var fs=require('fs');var fs_extra=require(_0x1863('0x9'));var _=require(_0x1863('0xa'));var squel=require(_0x1863('0xb'));var crypto=require(_0x1863('0xc'));var jsforce=require(_0x1863('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1863('0x7'));var querystring=require(_0x1863('0xe'));var Papa=require(_0x1863('0xf'));var Redis=require(_0x1863('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1863('0x11'));var as=require(_0x1863('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1863('0x13'))(_0x1863('0x14'));var utils=require('../../config/utils');var config=require(_0x1863('0x15'));var licenseUtil=require(_0x1863('0x16'));var db=require(_0x1863('0x17'))['db'];function respondWithStatusCode(_0x41d352,_0x465b39){_0x465b39=_0x465b39||0xcc;return function(_0x55f320){if(_0x55f320){return _0x41d352['sendStatus'](_0x465b39);}return _0x41d352['status'](_0x465b39)[_0x1863('0x18')]();};}function respondWithResult(_0x25f69d,_0x5dab88){_0x5dab88=_0x5dab88||0xc8;return function(_0x191721){if(_0x191721){return _0x25f69d[_0x1863('0x19')](_0x5dab88)[_0x1863('0x1a')](_0x191721);}};}function respondWithFilteredResult(_0x12545f,_0x35689f){return function(_0x4726f5){if(_0x4726f5){var _0x3ec2ea=typeof _0x35689f[_0x1863('0x1b')]===_0x1863('0x1c')&&typeof _0x35689f[_0x1863('0x1d')]===_0x1863('0x1c');var _0x12ca4a=_0x4726f5[_0x1863('0x1e')];var _0x5f247a=_0x3ec2ea?0x0:_0x35689f[_0x1863('0x1b')];var _0x1c42c2=_0x3ec2ea?_0x4726f5[_0x1863('0x1e')]:_0x35689f[_0x1863('0x1b')]+_0x35689f[_0x1863('0x1d')];var _0x522689;if(_0x1c42c2>=_0x12ca4a){_0x1c42c2=_0x12ca4a;_0x522689=0xc8;}else{_0x522689=0xce;}_0x12545f[_0x1863('0x19')](_0x522689);return _0x12545f['set']('Content-Range',_0x5f247a+'-'+_0x1c42c2+'/'+_0x12ca4a)[_0x1863('0x1a')](_0x4726f5);}return null;};}function patchUpdates(_0x13afda){return function(_0xe642cd){try{jsonpatch['apply'](_0xe642cd,_0x13afda,!![]);}catch(_0x29f00f){return BPromise['reject'](_0x29f00f);}return _0xe642cd[_0x1863('0x1f')]();};}function saveUpdates(_0x141bbb,_0x57316f){return function(_0x5e5123){if(_0x5e5123){return _0x5e5123[_0x1863('0x20')](_0x141bbb)[_0x1863('0x21')](function(_0x5d9676){return _0x5d9676;});}return null;};}function removeEntity(_0x16ca92,_0x4572ad){return function(_0x6542ea){if(_0x6542ea){return _0x6542ea['destroy']()[_0x1863('0x21')](function(){_0x16ca92['status'](0xcc)[_0x1863('0x18')]();});}};}function handleEntityNotFound(_0x5606f6,_0x27ca69){return function(_0x4d1e37){if(!_0x4d1e37){_0x5606f6['sendStatus'](0x194);}return _0x4d1e37;};}function handleError(_0x38d5e5,_0x3dba7f){_0x3dba7f=_0x3dba7f||0x1f4;return function(_0x4d199e){logger[_0x1863('0x22')](_0x4d199e[_0x1863('0x23')]);if(_0x4d199e[_0x1863('0x24')]){delete _0x4d199e['name'];}_0x38d5e5[_0x1863('0x19')](_0x3dba7f)[_0x1863('0x25')](_0x4d199e);};}exports['index']=function(_0x5ace31,_0x1c8817){var _0x9c24ac={},_0x156bd3={},_0x4de53c={'count':0x0,'rows':[]};var _0x9dc6a4=_[_0x1863('0x26')](db['SquareReport']['rawAttributes'],function(_0x14faea){return{'name':_0x14faea['fieldName'],'type':_0x14faea['type'][_0x1863('0x27')]};});_0x156bd3[_0x1863('0x28')]=_['map'](_0x9dc6a4,_0x1863('0x24'));_0x156bd3[_0x1863('0x29')]=_[_0x1863('0x2a')](_0x5ace31[_0x1863('0x29')]);_0x156bd3['filters']=_[_0x1863('0x2b')](_0x156bd3[_0x1863('0x28')],_0x156bd3[_0x1863('0x29')]);_0x9c24ac[_0x1863('0x2c')]=_['intersection'](_0x156bd3['model'],qs['fields'](_0x5ace31[_0x1863('0x29')][_0x1863('0x2d')]));_0x9c24ac['attributes']=_0x9c24ac[_0x1863('0x2c')][_0x1863('0x2e')]?_0x9c24ac[_0x1863('0x2c')]:_0x156bd3[_0x1863('0x28')];if(!_0x5ace31[_0x1863('0x29')]['hasOwnProperty']('nolimit')){_0x9c24ac[_0x1863('0x1d')]=qs['limit'](_0x5ace31[_0x1863('0x29')]['limit']);_0x9c24ac[_0x1863('0x1b')]=qs[_0x1863('0x1b')](_0x5ace31[_0x1863('0x29')][_0x1863('0x1b')]);}_0x9c24ac[_0x1863('0x2f')]=qs[_0x1863('0x30')](_0x5ace31[_0x1863('0x29')]['sort']);_0x9c24ac['where']=qs[_0x1863('0x31')](_['pick'](_0x5ace31[_0x1863('0x29')],_0x156bd3[_0x1863('0x31')]),_0x9dc6a4);if(_0x5ace31[_0x1863('0x29')][_0x1863('0x32')]){_0x9c24ac[_0x1863('0x33')]=_['merge'](_0x9c24ac[_0x1863('0x33')],{'$or':_[_0x1863('0x26')](_0x9dc6a4,function(_0x2e2593){if(_0x2e2593['type']!==_0x1863('0x34')){var _0x44e298={};_0x44e298[_0x2e2593[_0x1863('0x24')]]={'$like':'%'+_0x5ace31[_0x1863('0x29')][_0x1863('0x32')]+'%'};return _0x44e298;}})});}_0x9c24ac=_[_0x1863('0x35')]({},_0x9c24ac,_0x5ace31[_0x1863('0x36')]);var _0x36b97f={'where':_0x9c24ac[_0x1863('0x33')]};return db['SquareReport'][_0x1863('0x1e')](_0x36b97f)[_0x1863('0x21')](function(_0x4d8df7){_0x4de53c[_0x1863('0x1e')]=_0x4d8df7;if(_0x5ace31[_0x1863('0x29')][_0x1863('0x37')]){_0x9c24ac[_0x1863('0x38')]=[{'all':!![]}];}return db[_0x1863('0x39')][_0x1863('0x3a')](_0x9c24ac);})[_0x1863('0x21')](function(_0x3bd751){_0x4de53c[_0x1863('0x3b')]=_0x3bd751;return _0x4de53c;})[_0x1863('0x21')](respondWithFilteredResult(_0x1c8817,_0x9c24ac))[_0x1863('0x3c')](handleError(_0x1c8817,null));};exports[_0x1863('0x3d')]=function(_0x2e27ec,_0x5501d4){var _0x58dc44={'raw':!![],'where':{'id':_0x2e27ec[_0x1863('0x3e')]['id']}},_0x99a63={};_0x99a63[_0x1863('0x28')]=_[_0x1863('0x2a')](db[_0x1863('0x39')][_0x1863('0x3f')]);_0x99a63[_0x1863('0x29')]=_[_0x1863('0x2a')](_0x2e27ec[_0x1863('0x29')]);_0x99a63[_0x1863('0x31')]=_[_0x1863('0x2b')](_0x99a63[_0x1863('0x28')],_0x99a63[_0x1863('0x29')]);_0x58dc44['attributes']=_['intersection'](_0x99a63['model'],qs[_0x1863('0x2d')](_0x2e27ec['query'][_0x1863('0x2d')]));_0x58dc44['attributes']=_0x58dc44[_0x1863('0x2c')][_0x1863('0x2e')]?_0x58dc44[_0x1863('0x2c')]:_0x99a63[_0x1863('0x28')];if(_0x2e27ec['query']['includeAll']){_0x58dc44[_0x1863('0x38')]=[{'all':!![]}];}_0x58dc44=_[_0x1863('0x35')]({},_0x58dc44,_0x2e27ec['options']);return db['SquareReport'][_0x1863('0x40')](_0x58dc44)[_0x1863('0x21')](handleEntityNotFound(_0x5501d4,null))['then'](respondWithResult(_0x5501d4,null))[_0x1863('0x3c')](handleError(_0x5501d4,null));};exports['create']=function(_0x5e6c6d,_0x249e39){return db[_0x1863('0x39')][_0x1863('0x41')](_0x5e6c6d[_0x1863('0x42')],{})[_0x1863('0x21')](respondWithResult(_0x249e39,0xc9))['catch'](handleError(_0x249e39,null));};exports[_0x1863('0x20')]=function(_0x203bbb,_0x17f902){if(_0x203bbb['body']['id']){delete _0x203bbb[_0x1863('0x42')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x203bbb['params']['id']}})[_0x1863('0x21')](handleEntityNotFound(_0x17f902,null))['then'](saveUpdates(_0x203bbb[_0x1863('0x42')],null))['then'](respondWithResult(_0x17f902,null))[_0x1863('0x3c')](handleError(_0x17f902,null));};exports[_0x1863('0x43')]=function(_0x4c389d,_0x1bf6bf){return db['SquareReport'][_0x1863('0x40')]({'where':{'id':_0x4c389d[_0x1863('0x3e')]['id']}})[_0x1863('0x21')](handleEntityNotFound(_0x1bf6bf,null))[_0x1863('0x21')](removeEntity(_0x1bf6bf,null))[_0x1863('0x3c')](handleError(_0x1bf6bf,null));};exports[_0x1863('0x44')]=function(_0x5397d0,_0x4ae894){return db[_0x1863('0x39')][_0x1863('0x44')]()['then'](respondWithResult(_0x4ae894,null))[_0x1863('0x3c')](handleError(_0x4ae894,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 682d5e8..5907318 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 _0xdc30=['bluebird','path','exports','SquareReport','report_square','project_name','leaveAt','util','../../config/logger','api','moment'];(function(_0x458285,_0x2132d0){var _0x311be0=function(_0x46d466){while(--_0x46d466){_0x458285['push'](_0x458285['shift']());}};_0x311be0(++_0x2132d0);}(_0xdc30,0x80));var _0x0dc3=function(_0xda6ad1,_0x5f09e3){_0xda6ad1=_0xda6ad1-0x0;var _0xedc3a5=_0xdc30[_0xda6ad1];return _0xedc3a5;};'use strict';var _=require('lodash');var util=require(_0x0dc3('0x0'));var logger=require(_0x0dc3('0x1'))(_0x0dc3('0x2'));var moment=require(_0x0dc3('0x3'));var BPromise=require(_0x0dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0dc3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x0dc3('0x6')]=function(_0xd979da,_0x2964d2){return _0xd979da['define'](_0x0dc3('0x7'),attributes,{'tableName':_0x0dc3('0x8'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x0dc3('0x9')]},{'name':_0x0dc3('0xa'),'fields':[_0x0dc3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f9=['./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1850ba,_0x55e013){var _0x2045e8=function(_0x5a5b09){while(--_0x5a5b09){_0x1850ba['push'](_0x1850ba['shift']());}};_0x2045e8(++_0x55e013);}(_0xb3f9,0x19d));var _0x9b3f=function(_0x1591c1,_0x2514cf){_0x1591c1=_0x1591c1-0x0;var _0x4559ac=_0xb3f9[_0x1591c1];return _0x4559ac;};'use strict';var _=require(_0x9b3f('0x0'));var util=require(_0x9b3f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b3f('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b3f('0x3'));var fs=require('fs');var path=require(_0x9b3f('0x4'));var rimraf=require(_0x9b3f('0x5'));var config=require(_0x9b3f('0x6'));var attributes=require(_0x9b3f('0x7'));module[_0x9b3f('0x8')]=function(_0x32c2f1,_0x1b21ec){return _0x32c2f1[_0x9b3f('0x9')]('SquareReport',attributes,{'tableName':_0x9b3f('0xa'),'paranoid':![],'indexes':[{'name':_0x9b3f('0xb'),'fields':[_0x9b3f('0xc'),_0x9b3f('0xd')]},{'name':'leaveAt','fields':[_0x9b3f('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 c982da6..a60d97f 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 _0x6112=['raw','UpdateSquareReport','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareReport','SquareReport','create','body','options'];(function(_0x3d6d2c,_0x194844){var _0x3a9bf5=function(_0x257c7e){while(--_0x257c7e){_0x3d6d2c['push'](_0x3d6d2c['shift']());}};_0x3a9bf5(++_0x194844);}(_0x6112,0x138));var _0x2611=function(_0x1ac58d,_0x4e1034){_0x1ac58d=_0x1ac58d-0x0;var _0x4489ac=_0x6112[_0x1ac58d];return _0x4489ac;};'use strict';var _=require(_0x2611('0x0'));var util=require(_0x2611('0x1'));var moment=require(_0x2611('0x2'));var BPromise=require(_0x2611('0x3'));var rs=require(_0x2611('0x4'));var fs=require('fs');var Redis=require(_0x2611('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2611('0x6'));var logger=require(_0x2611('0x7'))(_0x2611('0x8'));var config=require(_0x2611('0x9'));var jayson=require(_0x2611('0xa'));var client=jayson['client'][_0x2611('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dd1e3,_0x4ff8f7,_0x204333){return new BPromise(function(_0x1ef052,_0x939d92){return client['request'](_0x1dd1e3,_0x204333)[_0x2611('0xc')](function(_0x53316f){logger[_0x2611('0xd')](_0x2611('0xe'),_0x4ff8f7,'request\x20sent');logger['debug'](_0x2611('0xf'),_0x4ff8f7,'request\x20sent',JSON[_0x2611('0x10')](_0x53316f));if(_0x53316f[_0x2611('0x11')]){if(_0x53316f[_0x2611('0x11')][_0x2611('0x12')]===0x1f4){logger['error'](_0x2611('0xe'),_0x4ff8f7,_0x53316f[_0x2611('0x11')][_0x2611('0x13')]);return _0x939d92(_0x53316f['error'][_0x2611('0x13')]);}logger[_0x2611('0x11')](_0x2611('0xe'),_0x4ff8f7,_0x53316f[_0x2611('0x11')][_0x2611('0x13')]);return _0x1ef052(_0x53316f[_0x2611('0x11')][_0x2611('0x13')]);}else{logger[_0x2611('0xd')](_0x2611('0xe'),_0x4ff8f7,_0x2611('0x14'));_0x1ef052(_0x53316f[_0x2611('0x15')][_0x2611('0x13')]);}})[_0x2611('0x16')](function(_0x7c60d1){logger[_0x2611('0x11')](_0x2611('0xe'),_0x4ff8f7,_0x7c60d1);_0x939d92(_0x7c60d1);});});}exports[_0x2611('0x17')]=function(_0xa055c6){var _0x4cac3e=this;return new Promise(function(_0x133f8d,_0x21a5b3){return db[_0x2611('0x18')][_0x2611('0x19')](_0xa055c6[_0x2611('0x1a')],{'raw':_0xa055c6[_0x2611('0x1b')]?_0xa055c6[_0x2611('0x1b')][_0x2611('0x1c')]===undefined?!![]:![]:!![]})[_0x2611('0xc')](function(_0x26e926){logger[_0x2611('0xd')](_0x2611('0x17'),_0xa055c6);logger['debug'](_0x2611('0x17'),_0xa055c6,JSON['stringify'](_0x26e926));_0x133f8d(_0x26e926);})[_0x2611('0x16')](function(_0x426b4c){logger['error'](_0x2611('0x17'),_0x426b4c[_0x2611('0x13')],_0xa055c6);_0x21a5b3(_0x4cac3e['error'](0x1f4,_0x426b4c[_0x2611('0x13')]));});});};exports[_0x2611('0x1d')]=function(_0x248fa2){var _0x2000c0=this;return new Promise(function(_0x1f8d33,_0x21d57c){return db[_0x2611('0x18')]['update'](_0x248fa2['body'],{'raw':_0x248fa2[_0x2611('0x1b')]?_0x248fa2['options'][_0x2611('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x248fa2[_0x2611('0x1b')]?_0x248fa2[_0x2611('0x1b')][_0x2611('0x1e')]||null:null,'attributes':_0x248fa2[_0x2611('0x1b')]?_0x248fa2[_0x2611('0x1b')][_0x2611('0x1f')]||null:null,'limit':_0x248fa2['options']?_0x248fa2[_0x2611('0x1b')][_0x2611('0x20')]||null:null})[_0x2611('0xc')](function(_0xf45b39){logger[_0x2611('0xd')](_0x2611('0x1d'),_0x248fa2);logger[_0x2611('0x21')](_0x2611('0x1d'),_0x248fa2,JSON['stringify'](_0xf45b39));_0x1f8d33(_0xf45b39);})[_0x2611('0x16')](function(_0x5397f3){logger[_0x2611('0x11')]('UpdateSquareReport',_0x5397f3[_0x2611('0x13')],_0x248fa2);_0x21d57c(_0x2000c0['error'](0x1f4,_0x5397f3[_0x2611('0x13')]));});});}; \ No newline at end of file +var _0x6a7c=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareReport','SquareReport','create','options','info','catch','UpdateSquareReport','update','body','raw','where','attributes','limit','lodash','util','moment','bluebird','ioredis'];(function(_0x299995,_0x54a9c4){var _0x2cc68b=function(_0x4e8705){while(--_0x4e8705){_0x299995['push'](_0x299995['shift']());}};_0x2cc68b(++_0x54a9c4);}(_0x6a7c,0xc1));var _0xc6a7=function(_0x44ccdb,_0x108410){_0x44ccdb=_0x44ccdb-0x0;var _0x1a44a9=_0x6a7c[_0x44ccdb];return _0x1a44a9;};'use strict';var _=require(_0xc6a7('0x0'));var util=require(_0xc6a7('0x1'));var moment=require(_0xc6a7('0x2'));var BPromise=require(_0xc6a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a7('0x4'));var db=require(_0xc6a7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6a7('0x6'))(_0xc6a7('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6a7('0x8'));var client=jayson[_0xc6a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x178eb1,_0x27334b,_0x2dd0c3){return new BPromise(function(_0x4e9160,_0x146574){return client[_0xc6a7('0xa')](_0x178eb1,_0x2dd0c3)[_0xc6a7('0xb')](function(_0x1ccaf6){logger['info'](_0xc6a7('0xc'),_0x27334b,_0xc6a7('0xd'));logger[_0xc6a7('0xe')](_0xc6a7('0xf'),_0x27334b,_0xc6a7('0xd'),JSON[_0xc6a7('0x10')](_0x1ccaf6));if(_0x1ccaf6[_0xc6a7('0x11')]){if(_0x1ccaf6[_0xc6a7('0x11')]['code']===0x1f4){logger['error'](_0xc6a7('0xc'),_0x27334b,_0x1ccaf6[_0xc6a7('0x11')][_0xc6a7('0x12')]);return _0x146574(_0x1ccaf6['error'][_0xc6a7('0x12')]);}logger[_0xc6a7('0x11')](_0xc6a7('0xc'),_0x27334b,_0x1ccaf6[_0xc6a7('0x11')]['message']);return _0x4e9160(_0x1ccaf6[_0xc6a7('0x11')][_0xc6a7('0x12')]);}else{logger['info'](_0xc6a7('0xc'),_0x27334b,'request\x20sent');_0x4e9160(_0x1ccaf6[_0xc6a7('0x13')][_0xc6a7('0x12')]);}})['catch'](function(_0x49f5e4){logger[_0xc6a7('0x11')](_0xc6a7('0xc'),_0x27334b,_0x49f5e4);_0x146574(_0x49f5e4);});});}exports[_0xc6a7('0x14')]=function(_0x1e690a){var _0x3920a7=this;return new Promise(function(_0x36e86c,_0x3d6ee0){return db[_0xc6a7('0x15')][_0xc6a7('0x16')](_0x1e690a['body'],{'raw':_0x1e690a[_0xc6a7('0x17')]?_0x1e690a['options']['raw']===undefined?!![]:![]:!![]})[_0xc6a7('0xb')](function(_0x3cb5a9){logger[_0xc6a7('0x18')](_0xc6a7('0x14'),_0x1e690a);logger[_0xc6a7('0xe')](_0xc6a7('0x14'),_0x1e690a,JSON[_0xc6a7('0x10')](_0x3cb5a9));_0x36e86c(_0x3cb5a9);})[_0xc6a7('0x19')](function(_0x23ea03){logger[_0xc6a7('0x11')](_0xc6a7('0x14'),_0x23ea03['message'],_0x1e690a);_0x3d6ee0(_0x3920a7[_0xc6a7('0x11')](0x1f4,_0x23ea03[_0xc6a7('0x12')]));});});};exports[_0xc6a7('0x1a')]=function(_0x3cf106){var _0xca44cf=this;return new Promise(function(_0x37fa56,_0x1bc20d){return db[_0xc6a7('0x15')][_0xc6a7('0x1b')](_0x3cf106[_0xc6a7('0x1c')],{'raw':_0x3cf106[_0xc6a7('0x17')]?_0x3cf106[_0xc6a7('0x17')][_0xc6a7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cf106[_0xc6a7('0x17')]?_0x3cf106[_0xc6a7('0x17')][_0xc6a7('0x1e')]||null:null,'attributes':_0x3cf106[_0xc6a7('0x17')]?_0x3cf106['options'][_0xc6a7('0x1f')]||null:null,'limit':_0x3cf106[_0xc6a7('0x17')]?_0x3cf106[_0xc6a7('0x17')][_0xc6a7('0x20')]||null:null})[_0xc6a7('0xb')](function(_0x535059){logger[_0xc6a7('0x18')](_0xc6a7('0x1a'),_0x3cf106);logger[_0xc6a7('0xe')](_0xc6a7('0x1a'),_0x3cf106,JSON['stringify'](_0x535059));_0x37fa56(_0x535059);})[_0xc6a7('0x19')](function(_0x35062d){logger[_0xc6a7('0x11')](_0xc6a7('0x1a'),_0x35062d['message'],_0x3cf106);_0x1bc20d(_0xca44cf[_0xc6a7('0x11')](0x1f4,_0x35062d['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 8ebef51..613c885 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 _0x129a=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x129a,0x192));var _0xa129=function(_0x5b2200,_0x51c58a){_0x5b2200=_0x5b2200-0x0;var _0x446082=_0x129a[_0x5b2200];return _0x446082;};'use strict';var multer=require(_0xa129('0x0'));var util=require(_0xa129('0x1'));var path=require(_0xa129('0x2'));var timeout=require(_0xa129('0x3'));var express=require(_0xa129('0x4'));var router=express[_0xa129('0x5')]();var fs_extra=require(_0xa129('0x6'));var auth=require(_0xa129('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa129('0x8'));var controller=require(_0xa129('0x9'));router['get']('/',auth[_0xa129('0xa')](),controller[_0xa129('0xb')]);router[_0xa129('0xc')](_0xa129('0xd'),auth[_0xa129('0xa')](),controller['describe']);router[_0xa129('0xc')](_0xa129('0xe'),auth[_0xa129('0xa')](),controller[_0xa129('0xf')]);router[_0xa129('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa129('0x11')](_0xa129('0xe'),auth[_0xa129('0xa')](),controller[_0xa129('0x12')]);router[_0xa129('0x13')](_0xa129('0xe'),auth[_0xa129('0xa')](),controller[_0xa129('0x14')]);module[_0xa129('0x15')]=router; \ No newline at end of file +var _0x1101=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','describe','get','/:id','create','put','update','delete','destroy','exports','util','path'];(function(_0x69c1d4,_0x2386e4){var _0x2f4f27=function(_0x4857ba){while(--_0x4857ba){_0x69c1d4['push'](_0x69c1d4['shift']());}};_0x2f4f27(++_0x2386e4);}(_0x1101,0xfa));var _0x1110=function(_0x21ef30,_0x45b319){_0x21ef30=_0x21ef30-0x0;var _0x5c42ed=_0x1101[_0x21ef30];return _0x5c42ed;};'use strict';var multer=require('multer');var util=require(_0x1110('0x0'));var path=require(_0x1110('0x1'));var timeout=require(_0x1110('0x2'));var express=require(_0x1110('0x3'));var router=express[_0x1110('0x4')]();var fs_extra=require(_0x1110('0x5'));var auth=require(_0x1110('0x6'));var interaction=require(_0x1110('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0x1110('0x8')](),controller['index']);router['get']('/describe',auth[_0x1110('0x8')](),controller[_0x1110('0x9')]);router[_0x1110('0xa')](_0x1110('0xb'),auth[_0x1110('0x8')](),controller['show']);router['post']('/',auth[_0x1110('0x8')](),controller[_0x1110('0xc')]);router[_0x1110('0xd')](_0x1110('0xb'),auth[_0x1110('0x8')](),controller[_0x1110('0xe')]);router[_0x1110('0xf')](_0x1110('0xb'),auth['isAuthenticated'](),controller[_0x1110('0x10')]);module[_0x1110('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 91a5ac1..76f64b0 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 _0x124f=['sequelize','exports','STRING','TEXT'];(function(_0x7654ab,_0x599afb){var _0x223e77=function(_0x38c768){while(--_0x38c768){_0x7654ab['push'](_0x7654ab['shift']());}};_0x223e77(++_0x599afb);}(_0x124f,0x1a8));var _0xf124=function(_0x16d583,_0x5adfc6){_0x16d583=_0x16d583-0x0;var _0x303695=_0x124f[_0x16d583];return _0x303695;};'use strict';var Sequelize=require(_0xf124('0x0'));module[_0xf124('0x1')]={'uniqueid':{'type':Sequelize[_0xf124('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf124('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf124('0x2')]}}; \ No newline at end of file +var _0xb8e0=['TEXT','sequelize','exports','STRING'];(function(_0x10cc44,_0x38cc4b){var _0x4607fd=function(_0x2c9c10){while(--_0x2c9c10){_0x10cc44['push'](_0x10cc44['shift']());}};_0x4607fd(++_0x38cc4b);}(_0xb8e0,0x155));var _0x0b8e=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xb8e0[_0x4a8418];return _0x390174;};'use strict';var Sequelize=require(_0x0b8e('0x0'));module[_0x0b8e('0x1')]={'uniqueid':{'type':Sequelize[_0x0b8e('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x0b8e('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e19173b..9d6ff1c 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 _0x91cd=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring'];(function(_0x32109b,_0x5319c0){var _0xfa3430=function(_0xae5e9d){while(--_0xae5e9d){_0x32109b['push'](_0x32109b['shift']());}};_0xfa3430(++_0x5319c0);}(_0x91cd,0x118));var _0xd91c=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x91cd[_0x3e69ae];return _0x3d7f42;};'use strict';var emlformat=require(_0xd91c('0x0'));var rimraf=require(_0xd91c('0x1'));var zipdir=require(_0xd91c('0x2'));var jsonpatch=require(_0xd91c('0x3'));var rp=require(_0xd91c('0x4'));var moment=require(_0xd91c('0x5'));var BPromise=require(_0xd91c('0x6'));var Mustache=require(_0xd91c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd91c('0x8'));var csv=require('to-csv');var ejs=require(_0xd91c('0x9'));var fs=require('fs');var fs_extra=require(_0xd91c('0xa'));var _=require(_0xd91c('0xb'));var squel=require(_0xd91c('0xc'));var crypto=require(_0xd91c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd91c('0xe'));var querystring=require(_0xd91c('0xf'));var Papa=require('papaparse');var Redis=require(_0xd91c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd91c('0x11'));var as=require(_0xd91c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd91c('0x13'))(_0xd91c('0x14'));var utils=require(_0xd91c('0x15'));var config=require(_0xd91c('0x16'));var licenseUtil=require(_0xd91c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f9e76,_0x59171a){_0x59171a=_0x59171a||0xcc;return function(_0xd8d583){if(_0xd8d583){return _0x1f9e76[_0xd91c('0x18')](_0x59171a);}return _0x1f9e76['status'](_0x59171a)[_0xd91c('0x19')]();};}function respondWithResult(_0x2bbc4f,_0x1b0164){_0x1b0164=_0x1b0164||0xc8;return function(_0x4135ef){if(_0x4135ef){return _0x2bbc4f['status'](_0x1b0164)[_0xd91c('0x1a')](_0x4135ef);}};}function respondWithFilteredResult(_0x390543,_0x87126d){return function(_0x304c6c){if(_0x304c6c){var _0x1c3519=typeof _0x87126d['offset']===_0xd91c('0x1b')&&typeof _0x87126d[_0xd91c('0x1c')]===_0xd91c('0x1b');var _0x1177dc=_0x304c6c[_0xd91c('0x1d')];var _0x2f804c=_0x1c3519?0x0:_0x87126d[_0xd91c('0x1e')];var _0x5898fb=_0x1c3519?_0x304c6c[_0xd91c('0x1d')]:_0x87126d[_0xd91c('0x1e')]+_0x87126d['limit'];var _0x401488;if(_0x5898fb>=_0x1177dc){_0x5898fb=_0x1177dc;_0x401488=0xc8;}else{_0x401488=0xce;}_0x390543[_0xd91c('0x1f')](_0x401488);return _0x390543[_0xd91c('0x20')]('Content-Range',_0x2f804c+'-'+_0x5898fb+'/'+_0x1177dc)[_0xd91c('0x1a')](_0x304c6c);}return null;};}function patchUpdates(_0x1bb3b1){return function(_0x2882fe){try{jsonpatch[_0xd91c('0x21')](_0x2882fe,_0x1bb3b1,!![]);}catch(_0xaef65d){return BPromise[_0xd91c('0x22')](_0xaef65d);}return _0x2882fe[_0xd91c('0x23')]();};}function saveUpdates(_0x26d820,_0x5cea2f){return function(_0x4ecd11){if(_0x4ecd11){return _0x4ecd11[_0xd91c('0x24')](_0x26d820)['then'](function(_0x52075c){return _0x52075c;});}return null;};}function removeEntity(_0x2f9708,_0x1d5ad5){return function(_0xa07289){if(_0xa07289){return _0xa07289['destroy']()[_0xd91c('0x25')](function(){_0x2f9708[_0xd91c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15fc4b,_0x3a330d){return function(_0x5226ba){if(!_0x5226ba){_0x15fc4b[_0xd91c('0x18')](0x194);}return _0x5226ba;};}function handleError(_0x49338,_0x384a44){_0x384a44=_0x384a44||0x1f4;return function(_0x500786){logger[_0xd91c('0x26')](_0x500786['stack']);if(_0x500786[_0xd91c('0x27')]){delete _0x500786['name'];}_0x49338[_0xd91c('0x1f')](_0x384a44)[_0xd91c('0x28')](_0x500786);};}exports[_0xd91c('0x29')]=function(_0x1d732c,_0x135c7c){var _0x335b84={},_0x4658f1={},_0x3cc9fe={'count':0x0,'rows':[]};var _0x1502a3=_[_0xd91c('0x2a')](db[_0xd91c('0x2b')][_0xd91c('0x2c')],function(_0x574045){return{'name':_0x574045[_0xd91c('0x2d')],'type':_0x574045[_0xd91c('0x2e')][_0xd91c('0x2f')]};});_0x4658f1[_0xd91c('0x30')]=_[_0xd91c('0x2a')](_0x1502a3,_0xd91c('0x27'));_0x4658f1[_0xd91c('0x31')]=_[_0xd91c('0x32')](_0x1d732c['query']);_0x4658f1[_0xd91c('0x33')]=_[_0xd91c('0x34')](_0x4658f1[_0xd91c('0x30')],_0x4658f1[_0xd91c('0x31')]);_0x335b84[_0xd91c('0x35')]=_[_0xd91c('0x34')](_0x4658f1['model'],qs['fields'](_0x1d732c[_0xd91c('0x31')][_0xd91c('0x36')]));_0x335b84[_0xd91c('0x35')]=_0x335b84['attributes'][_0xd91c('0x37')]?_0x335b84['attributes']:_0x4658f1['model'];if(!_0x1d732c[_0xd91c('0x31')][_0xd91c('0x38')](_0xd91c('0x39'))){_0x335b84['limit']=qs['limit'](_0x1d732c[_0xd91c('0x31')][_0xd91c('0x1c')]);_0x335b84[_0xd91c('0x1e')]=qs['offset'](_0x1d732c[_0xd91c('0x31')]['offset']);}_0x335b84[_0xd91c('0x3a')]=qs['sort'](_0x1d732c[_0xd91c('0x31')][_0xd91c('0x3b')]);_0x335b84[_0xd91c('0x3c')]=qs[_0xd91c('0x33')](_['pick'](_0x1d732c['query'],_0x4658f1[_0xd91c('0x33')]),_0x1502a3);if(_0x1d732c[_0xd91c('0x31')]['filter']){_0x335b84[_0xd91c('0x3c')]=_[_0xd91c('0x3d')](_0x335b84[_0xd91c('0x3c')],{'$or':_[_0xd91c('0x2a')](_0x1502a3,function(_0x35393c){if(_0x35393c[_0xd91c('0x2e')]!==_0xd91c('0x3e')){var _0x402aae={};_0x402aae[_0x35393c[_0xd91c('0x27')]]={'$like':'%'+_0x1d732c[_0xd91c('0x31')]['filter']+'%'};return _0x402aae;}})});}_0x335b84=_[_0xd91c('0x3d')]({},_0x335b84,_0x1d732c['options']);var _0x4411e7={'where':_0x335b84['where']};return db[_0xd91c('0x2b')]['count'](_0x4411e7)[_0xd91c('0x25')](function(_0x1704f0){_0x3cc9fe[_0xd91c('0x1d')]=_0x1704f0;if(_0x1d732c[_0xd91c('0x31')][_0xd91c('0x3f')]){_0x335b84['include']=[{'all':!![]}];}return db[_0xd91c('0x2b')]['findAll'](_0x335b84);})[_0xd91c('0x25')](function(_0x38ab4d){_0x3cc9fe[_0xd91c('0x40')]=_0x38ab4d;return _0x3cc9fe;})[_0xd91c('0x25')](respondWithFilteredResult(_0x135c7c,_0x335b84))[_0xd91c('0x41')](handleError(_0x135c7c,null));};exports[_0xd91c('0x42')]=function(_0x432889,_0x49f759){var _0x2cbd49={'raw':!![],'where':{'id':_0x432889[_0xd91c('0x43')]['id']}},_0x4d0683={};_0x4d0683[_0xd91c('0x30')]=_[_0xd91c('0x32')](db[_0xd91c('0x2b')][_0xd91c('0x2c')]);_0x4d0683['query']=_['keys'](_0x432889[_0xd91c('0x31')]);_0x4d0683[_0xd91c('0x33')]=_[_0xd91c('0x34')](_0x4d0683[_0xd91c('0x30')],_0x4d0683['query']);_0x2cbd49[_0xd91c('0x35')]=_[_0xd91c('0x34')](_0x4d0683[_0xd91c('0x30')],qs[_0xd91c('0x36')](_0x432889[_0xd91c('0x31')]['fields']));_0x2cbd49[_0xd91c('0x35')]=_0x2cbd49['attributes']['length']?_0x2cbd49['attributes']:_0x4d0683[_0xd91c('0x30')];if(_0x432889[_0xd91c('0x31')][_0xd91c('0x3f')]){_0x2cbd49[_0xd91c('0x44')]=[{'all':!![]}];}_0x2cbd49=_['merge']({},_0x2cbd49,_0x432889[_0xd91c('0x45')]);return db[_0xd91c('0x2b')][_0xd91c('0x46')](_0x2cbd49)[_0xd91c('0x25')](handleEntityNotFound(_0x49f759,null))[_0xd91c('0x25')](respondWithResult(_0x49f759,null))[_0xd91c('0x41')](handleError(_0x49f759,null));};exports[_0xd91c('0x47')]=function(_0x3ffc0d,_0x338c66){return db[_0xd91c('0x2b')][_0xd91c('0x47')](_0x3ffc0d['body'],{})[_0xd91c('0x25')](respondWithResult(_0x338c66,0xc9))['catch'](handleError(_0x338c66,null));};exports[_0xd91c('0x24')]=function(_0x1c7196,_0x1cbe5b){if(_0x1c7196['body']['id']){delete _0x1c7196[_0xd91c('0x48')]['id'];}return db[_0xd91c('0x2b')][_0xd91c('0x46')]({'where':{'id':_0x1c7196[_0xd91c('0x43')]['id']}})[_0xd91c('0x25')](handleEntityNotFound(_0x1cbe5b,null))['then'](saveUpdates(_0x1c7196['body'],null))[_0xd91c('0x25')](respondWithResult(_0x1cbe5b,null))['catch'](handleError(_0x1cbe5b,null));};exports['destroy']=function(_0x44b6a8,_0xf1257c){return db[_0xd91c('0x2b')][_0xd91c('0x46')]({'where':{'id':_0x44b6a8[_0xd91c('0x43')]['id']}})[_0xd91c('0x25')](handleEntityNotFound(_0xf1257c,null))[_0xd91c('0x25')](removeEntity(_0xf1257c,null))[_0xd91c('0x41')](handleError(_0xf1257c,null));};exports[_0xd91c('0x49')]=function(_0x22733b,_0x5e3094){return db[_0xd91c('0x2b')][_0xd91c('0x49')]()[_0xd91c('0x25')](respondWithResult(_0x5e3094,null))[_0xd91c('0x41')](handleError(_0x5e3094,null));}; \ No newline at end of file +var _0x09cd=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','SquareDetailsReport','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status'];(function(_0x370497,_0x1c1b55){var _0x235e4b=function(_0x32af89){while(--_0x32af89){_0x370497['push'](_0x370497['shift']());}};_0x235e4b(++_0x1c1b55);}(_0x09cd,0x7c));var _0xd09c=function(_0x3b5d9a,_0x439bd6){_0x3b5d9a=_0x3b5d9a-0x0;var _0x1d258a=_0x09cd[_0x3b5d9a];return _0x1d258a;};'use strict';var emlformat=require(_0xd09c('0x0'));var rimraf=require(_0xd09c('0x1'));var zipdir=require(_0xd09c('0x2'));var jsonpatch=require(_0xd09c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd09c('0x4'));var Mustache=require(_0xd09c('0x5'));var util=require(_0xd09c('0x6'));var path=require('path');var sox=require(_0xd09c('0x7'));var csv=require(_0xd09c('0x8'));var ejs=require(_0xd09c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd09c('0xa'));var deskjs=require(_0xd09c('0xb'));var toCsv=require(_0xd09c('0x8'));var querystring=require(_0xd09c('0xc'));var Papa=require('papaparse');var Redis=require(_0xd09c('0xd'));var authService=require(_0xd09c('0xe'));var qs=require(_0xd09c('0xf'));var as=require(_0xd09c('0x10'));var hardwareService=require(_0xd09c('0x11'));var logger=require(_0xd09c('0x12'))(_0xd09c('0x13'));var utils=require(_0xd09c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd09c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eeae1,_0xedef83){_0xedef83=_0xedef83||0xcc;return function(_0x409403){if(_0x409403){return _0x3eeae1['sendStatus'](_0xedef83);}return _0x3eeae1['status'](_0xedef83)[_0xd09c('0x16')]();};}function respondWithResult(_0x550b28,_0x1ccd4c){_0x1ccd4c=_0x1ccd4c||0xc8;return function(_0xfc6882){if(_0xfc6882){return _0x550b28[_0xd09c('0x17')](_0x1ccd4c)[_0xd09c('0x18')](_0xfc6882);}};}function respondWithFilteredResult(_0x23e420,_0x4a5984){return function(_0x153c5b){if(_0x153c5b){var _0x519759=typeof _0x4a5984[_0xd09c('0x19')]===_0xd09c('0x1a')&&typeof _0x4a5984[_0xd09c('0x1b')]===_0xd09c('0x1a');var _0x2d2595=_0x153c5b[_0xd09c('0x1c')];var _0x32dce6=_0x519759?0x0:_0x4a5984[_0xd09c('0x19')];var _0x1a8d37=_0x519759?_0x153c5b[_0xd09c('0x1c')]:_0x4a5984[_0xd09c('0x19')]+_0x4a5984[_0xd09c('0x1b')];var _0x515b18;if(_0x1a8d37>=_0x2d2595){_0x1a8d37=_0x2d2595;_0x515b18=0xc8;}else{_0x515b18=0xce;}_0x23e420[_0xd09c('0x17')](_0x515b18);return _0x23e420[_0xd09c('0x1d')](_0xd09c('0x1e'),_0x32dce6+'-'+_0x1a8d37+'/'+_0x2d2595)[_0xd09c('0x18')](_0x153c5b);}return null;};}function patchUpdates(_0x1305ec){return function(_0x25ecff){try{jsonpatch[_0xd09c('0x1f')](_0x25ecff,_0x1305ec,!![]);}catch(_0x48686b){return BPromise[_0xd09c('0x20')](_0x48686b);}return _0x25ecff['save']();};}function saveUpdates(_0x5ccf2b,_0x4d4e7a){return function(_0x2332a0){if(_0x2332a0){return _0x2332a0[_0xd09c('0x21')](_0x5ccf2b)[_0xd09c('0x22')](function(_0x5f3faf){return _0x5f3faf;});}return null;};}function removeEntity(_0x5a0ac1,_0x1e785d){return function(_0x35ec79){if(_0x35ec79){return _0x35ec79[_0xd09c('0x23')]()[_0xd09c('0x22')](function(){_0x5a0ac1[_0xd09c('0x17')](0xcc)[_0xd09c('0x16')]();});}};}function handleEntityNotFound(_0x34bb4b,_0x24338f){return function(_0x4f6c38){if(!_0x4f6c38){_0x34bb4b['sendStatus'](0x194);}return _0x4f6c38;};}function handleError(_0x36c741,_0x181bb1){_0x181bb1=_0x181bb1||0x1f4;return function(_0x4bb3c5){logger[_0xd09c('0x24')](_0x4bb3c5[_0xd09c('0x25')]);if(_0x4bb3c5[_0xd09c('0x26')]){delete _0x4bb3c5[_0xd09c('0x26')];}_0x36c741['status'](_0x181bb1)['send'](_0x4bb3c5);};}exports[_0xd09c('0x27')]=function(_0x937e2d,_0x5fd6c6){var _0x5ec2d6={},_0x5e5c30={},_0x244cd6={'count':0x0,'rows':[]};var _0x412154=_['map'](db[_0xd09c('0x28')]['rawAttributes'],function(_0x1bf99a){return{'name':_0x1bf99a[_0xd09c('0x29')],'type':_0x1bf99a[_0xd09c('0x2a')][_0xd09c('0x2b')]};});_0x5e5c30[_0xd09c('0x2c')]=_[_0xd09c('0x2d')](_0x412154,'name');_0x5e5c30[_0xd09c('0x2e')]=_[_0xd09c('0x2f')](_0x937e2d[_0xd09c('0x2e')]);_0x5e5c30['filters']=_['intersection'](_0x5e5c30[_0xd09c('0x2c')],_0x5e5c30[_0xd09c('0x2e')]);_0x5ec2d6['attributes']=_[_0xd09c('0x30')](_0x5e5c30[_0xd09c('0x2c')],qs[_0xd09c('0x31')](_0x937e2d[_0xd09c('0x2e')][_0xd09c('0x31')]));_0x5ec2d6[_0xd09c('0x32')]=_0x5ec2d6[_0xd09c('0x32')][_0xd09c('0x33')]?_0x5ec2d6[_0xd09c('0x32')]:_0x5e5c30[_0xd09c('0x2c')];if(!_0x937e2d['query'][_0xd09c('0x34')](_0xd09c('0x35'))){_0x5ec2d6[_0xd09c('0x1b')]=qs['limit'](_0x937e2d[_0xd09c('0x2e')]['limit']);_0x5ec2d6[_0xd09c('0x19')]=qs[_0xd09c('0x19')](_0x937e2d[_0xd09c('0x2e')][_0xd09c('0x19')]);}_0x5ec2d6[_0xd09c('0x36')]=qs[_0xd09c('0x37')](_0x937e2d['query'][_0xd09c('0x37')]);_0x5ec2d6[_0xd09c('0x38')]=qs[_0xd09c('0x39')](_[_0xd09c('0x3a')](_0x937e2d['query'],_0x5e5c30['filters']),_0x412154);if(_0x937e2d['query'][_0xd09c('0x3b')]){_0x5ec2d6['where']=_[_0xd09c('0x3c')](_0x5ec2d6[_0xd09c('0x38')],{'$or':_[_0xd09c('0x2d')](_0x412154,function(_0x3fa706){if(_0x3fa706[_0xd09c('0x2a')]!==_0xd09c('0x3d')){var _0x12d178={};_0x12d178[_0x3fa706[_0xd09c('0x26')]]={'$like':'%'+_0x937e2d[_0xd09c('0x2e')][_0xd09c('0x3b')]+'%'};return _0x12d178;}})});}_0x5ec2d6=_[_0xd09c('0x3c')]({},_0x5ec2d6,_0x937e2d[_0xd09c('0x3e')]);var _0x52153e={'where':_0x5ec2d6[_0xd09c('0x38')]};return db['SquareDetailsReport'][_0xd09c('0x1c')](_0x52153e)['then'](function(_0x214029){_0x244cd6[_0xd09c('0x1c')]=_0x214029;if(_0x937e2d[_0xd09c('0x2e')][_0xd09c('0x3f')]){_0x5ec2d6[_0xd09c('0x40')]=[{'all':!![]}];}return db[_0xd09c('0x28')][_0xd09c('0x41')](_0x5ec2d6);})[_0xd09c('0x22')](function(_0x53359a){_0x244cd6[_0xd09c('0x42')]=_0x53359a;return _0x244cd6;})[_0xd09c('0x22')](respondWithFilteredResult(_0x5fd6c6,_0x5ec2d6))['catch'](handleError(_0x5fd6c6,null));};exports['show']=function(_0x5d6e1f,_0x49df1c){var _0x30bb1e={'raw':!![],'where':{'id':_0x5d6e1f['params']['id']}},_0x35847a={};_0x35847a['model']=_[_0xd09c('0x2f')](db[_0xd09c('0x28')][_0xd09c('0x43')]);_0x35847a['query']=_[_0xd09c('0x2f')](_0x5d6e1f['query']);_0x35847a[_0xd09c('0x39')]=_['intersection'](_0x35847a[_0xd09c('0x2c')],_0x35847a[_0xd09c('0x2e')]);_0x30bb1e[_0xd09c('0x32')]=_[_0xd09c('0x30')](_0x35847a['model'],qs[_0xd09c('0x31')](_0x5d6e1f[_0xd09c('0x2e')][_0xd09c('0x31')]));_0x30bb1e[_0xd09c('0x32')]=_0x30bb1e['attributes'][_0xd09c('0x33')]?_0x30bb1e[_0xd09c('0x32')]:_0x35847a[_0xd09c('0x2c')];if(_0x5d6e1f[_0xd09c('0x2e')][_0xd09c('0x3f')]){_0x30bb1e[_0xd09c('0x40')]=[{'all':!![]}];}_0x30bb1e=_[_0xd09c('0x3c')]({},_0x30bb1e,_0x5d6e1f['options']);return db[_0xd09c('0x28')][_0xd09c('0x44')](_0x30bb1e)[_0xd09c('0x22')](handleEntityNotFound(_0x49df1c,null))['then'](respondWithResult(_0x49df1c,null))[_0xd09c('0x45')](handleError(_0x49df1c,null));};exports[_0xd09c('0x46')]=function(_0x113565,_0x34b24d){return db[_0xd09c('0x28')][_0xd09c('0x46')](_0x113565['body'],{})[_0xd09c('0x22')](respondWithResult(_0x34b24d,0xc9))['catch'](handleError(_0x34b24d,null));};exports[_0xd09c('0x21')]=function(_0x2c9053,_0x388bff){if(_0x2c9053[_0xd09c('0x47')]['id']){delete _0x2c9053[_0xd09c('0x47')]['id'];}return db[_0xd09c('0x28')]['find']({'where':{'id':_0x2c9053[_0xd09c('0x48')]['id']}})[_0xd09c('0x22')](handleEntityNotFound(_0x388bff,null))[_0xd09c('0x22')](saveUpdates(_0x2c9053[_0xd09c('0x47')],null))[_0xd09c('0x22')](respondWithResult(_0x388bff,null))['catch'](handleError(_0x388bff,null));};exports['destroy']=function(_0x1f8721,_0x1ee018){return db[_0xd09c('0x28')]['find']({'where':{'id':_0x1f8721['params']['id']}})[_0xd09c('0x22')](handleEntityNotFound(_0x1ee018,null))[_0xd09c('0x22')](removeEntity(_0x1ee018,null))['catch'](handleError(_0x1ee018,null));};exports[_0xd09c('0x49')]=function(_0x262096,_0x9bcea4){return db[_0xd09c('0x28')][_0xd09c('0x49')]()[_0xd09c('0x22')](respondWithResult(_0x9bcea4,null))['catch'](handleError(_0x9bcea4,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 4a41562..a1976bc 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 _0x3ce6=['path','rimraf','../../config/environment','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x5df0ad,_0x24c80b){var _0x20d061=function(_0x4fa747){while(--_0x4fa747){_0x5df0ad['push'](_0x5df0ad['shift']());}};_0x20d061(++_0x24c80b);}(_0x3ce6,0x1d4));var _0x63ce=function(_0x208f29,_0x2c10ab){_0x208f29=_0x208f29-0x0;var _0x2b5440=_0x3ce6[_0x208f29];return _0x2b5440;};'use strict';var _=require(_0x63ce('0x0'));var util=require(_0x63ce('0x1'));var logger=require(_0x63ce('0x2'))(_0x63ce('0x3'));var moment=require(_0x63ce('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ce('0x5'));var rimraf=require(_0x63ce('0x6'));var config=require(_0x63ce('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x63ce('0x8')]=function(_0x6b75a9,_0x344d19){return _0x6b75a9['define'](_0x63ce('0x9'),attributes,{'tableName':_0x63ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8732=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_square_details'];(function(_0x336ee3,_0xfaa3e4){var _0x36eb0b=function(_0x41d058){while(--_0x41d058){_0x336ee3['push'](_0x336ee3['shift']());}};_0x36eb0b(++_0xfaa3e4);}(_0x8732,0xd1));var _0x2873=function(_0x5497d3,_0x193adf){_0x5497d3=_0x5497d3-0x0;var _0x42f1ef=_0x8732[_0x5497d3];return _0x42f1ef;};'use strict';var _=require(_0x2873('0x0'));var util=require(_0x2873('0x1'));var logger=require(_0x2873('0x2'))(_0x2873('0x3'));var moment=require('moment');var BPromise=require(_0x2873('0x4'));var rp=require(_0x2873('0x5'));var fs=require('fs');var path=require(_0x2873('0x6'));var rimraf=require(_0x2873('0x7'));var config=require(_0x2873('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x2873('0x9')]=function(_0xfdd4e3,_0x1e83f2){return _0xfdd4e3['define']('SquareDetailsReport',attributes,{'tableName':_0x2873('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 658969f..8a8fd5e 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 _0x5423=['options','raw','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5423,0xe3));var _0x3542=function(_0x17392e,_0x425148){_0x17392e=_0x17392e-0x0;var _0x16514a=_0x5423[_0x17392e];return _0x16514a;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var moment=require('moment');var BPromise=require(_0x3542('0x2'));var rs=require(_0x3542('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3542('0x4'))['db'];var utils=require(_0x3542('0x5'));var logger=require(_0x3542('0x6'))(_0x3542('0x7'));var config=require('../../config/environment');var jayson=require(_0x3542('0x8'));var client=jayson[_0x3542('0x9')][_0x3542('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c3fa,_0x2e1a62,_0x55413c){return new BPromise(function(_0x4cdc86,_0xbc51ab){return client[_0x3542('0xb')](_0x29c3fa,_0x55413c)['then'](function(_0x681195){logger[_0x3542('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'));logger[_0x3542('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'),JSON[_0x3542('0xf')](_0x681195));if(_0x681195[_0x3542('0x10')]){if(_0x681195[_0x3542('0x10')][_0x3542('0x11')]===0x1f4){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195[_0x3542('0x10')][_0x3542('0x13')]);return _0xbc51ab(_0x681195[_0x3542('0x10')][_0x3542('0x13')]);}logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195['error'][_0x3542('0x13')]);return _0x4cdc86(_0x681195['error'][_0x3542('0x13')]);}else{logger[_0x3542('0xc')](_0x3542('0x12'),_0x2e1a62,'request\x20sent');_0x4cdc86(_0x681195[_0x3542('0x14')][_0x3542('0x13')]);}})[_0x3542('0x15')](function(_0x5726af){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x5726af);_0xbc51ab(_0x5726af);});});}exports[_0x3542('0x16')]=function(_0x3d5199){var _0x493d95=this;return new Promise(function(_0x32df3f,_0x53d4aa){return db[_0x3542('0x17')][_0x3542('0x18')](_0x3d5199['body'],{'raw':_0x3d5199[_0x3542('0x19')]?_0x3d5199[_0x3542('0x19')][_0x3542('0x1a')]===undefined?!![]:![]:!![]})[_0x3542('0x1b')](function(_0x212950){logger['info']('CreateSquareDetailsReport',_0x3d5199);logger['debug'](_0x3542('0x16'),_0x3d5199,JSON['stringify'](_0x212950));_0x32df3f(_0x212950);})[_0x3542('0x15')](function(_0x551645){logger[_0x3542('0x10')]('CreateSquareDetailsReport',_0x551645['message'],_0x3d5199);_0x53d4aa(_0x493d95[_0x3542('0x10')](0x1f4,_0x551645[_0x3542('0x13')]));});});}; \ No newline at end of file +var _0x3423=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','catch'];(function(_0x488056,_0x727c33){var _0x66f226=function(_0x539cff){while(--_0x539cff){_0x488056['push'](_0x488056['shift']());}};_0x66f226(++_0x727c33);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateSquareDetailsReport',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e3d5cf8..86d6743 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 _0x3640=['/process/:pid/kill','killProcess','exports','express','get','isAuthenticated','index'];(function(_0x401b20,_0x53de7f){var _0x27f818=function(_0x56f60d){while(--_0x56f60d){_0x401b20['push'](_0x401b20['shift']());}};_0x27f818(++_0x53de7f);}(_0x3640,0x1df));var _0x0364=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x3640[_0x2a6809];return _0x11c371;};'use strict';var express=require(_0x0364('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x0364('0x1')]('/',auth[_0x0364('0x2')](),controller[_0x0364('0x3')]);router[_0x0364('0x1')](_0x0364('0x4'),auth[_0x0364('0x2')](),controller[_0x0364('0x5')]);module[_0x0364('0x6')]=router; \ No newline at end of file +var _0xee1e=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','./system.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee1e,0x9e));var _0xeee1=function(_0x3bb45b,_0x2dcc0b){_0x3bb45b=_0x3bb45b-0x0;var _0x513162=_0xee1e[_0x3bb45b];return _0x513162;};'use strict';var express=require(_0xeee1('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xeee1('0x1'));router[_0xeee1('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeee1('0x2')](_0xeee1('0x3'),auth[_0xeee1('0x4')](),controller[_0xeee1('0x5')]);module[_0xeee1('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 fec7a9d..d4c8ce3 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 _0x098a=['indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x098a,0x8b));var _0xa098=function(_0x51f68e,_0x2494f0){_0x51f68e=_0x51f68e-0x0;var _0xc3e7c0=_0x098a[_0x51f68e];return _0xc3e7c0;};'use strict';var info=require(_0xa098('0x0'));var exec=require(_0xa098('0x1'))[_0xa098('0x2')];var logger=require('../../config/logger')(_0xa098('0x3'));var util=require(_0xa098('0x4'));var BPromise=require('bluebird');var _=require(_0xa098('0x5'));function handleError(_0x1ddff6,_0x240125,_0x3ab91e){_0x240125=_0x240125||0x1f4;return function(_0x1cb041){logger[_0xa098('0x6')](_0xa098('0x7'),_0x3ab91e,_0x240125,util[_0xa098('0x8')](_0x1cb041,{'showHidden':![],'depth':null}));delete _0x1cb041[_0xa098('0x9')];_0x1ddff6[_0xa098('0xa')](_0x240125)['send'](_0x1cb041);};}exports[_0xa098('0xb')]=function(_0x2cf06c,_0x437e42){return info[_0xa098('0xc')]()[_0xa098('0xd')](function(_0x3ddb4a){return _0x437e42['status'](0xc8)[_0xa098('0xe')](_0x3ddb4a);})[_0xa098('0xf')](function(_0x178679){return _0x437e42[_0xa098('0xa')](0x1f4)[_0xa098('0xe')](_0x178679);});};exports['killProcess']=function(_0x531bff,_0x3743a5){var _0x37c6e3=[_0xa098('0x10')];return new BPromise(function(_0x198b8f,_0x4e0028){return exec(util[_0xa098('0x11')](_0xa098('0x12'),_0x531bff[_0xa098('0x13')][_0xa098('0x14')]),function(_0x5e9eca,_0x29e330,_0x396255){if(_0x5e9eca){return _0x4e0028(_0x5e9eca);}return _0x198b8f(_0x29e330);});})[_0xa098('0xd')](function(_0x1795d9){var _0x1b04a3=![];var _0x2aea75=_0x1795d9[_0xa098('0x15')](/\n/);for(var _0x1a6c94=0x0,_0x293ca2=_0x37c6e3[_0xa098('0x16')];_0x1a6c94<_0x293ca2,_0x1b04a3===![];_0x1a6c94+=0x1){if(_0x1795d9[_0xa098('0x17')](_0x37c6e3[_0x1a6c94])>=0x0){_0x1b04a3=!![];}}if(!_0x1b04a3){throw new Error(util[_0xa098('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x531bff[_0xa098('0x13')][_0xa098('0x14')]));}process['kill'](_0x531bff['params'][_0xa098('0x14')],_0xa098('0x18'));return _0x3743a5['status'](0xc8)[_0xa098('0xe')]({'message':util[_0xa098('0x11')](_0xa098('0x19'),_0x531bff[_0xa098('0x13')]['pid'])});})[_0xa098('0xf')](handleError(_0x3743a5,null,_0xa098('0x1a')));}; \ No newline at end of file +var _0x6e4a=['then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20killed\x20correctly','params','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','inspect','name','status'];(function(_0x1acaad,_0x4d21da){var _0x4b08ce=function(_0x21cf26){while(--_0x21cf26){_0x1acaad['push'](_0x1acaad['shift']());}};_0x4b08ce(++_0x4d21da);}(_0x6e4a,0xa3));var _0xa6e4=function(_0x1e1b6b,_0x23ce74){_0x1e1b6b=_0x1e1b6b-0x0;var _0x3acaed=_0x6e4a[_0x1e1b6b];return _0x3acaed;};'use strict';var info=require(_0xa6e4('0x0'));var exec=require(_0xa6e4('0x1'))[_0xa6e4('0x2')];var logger=require(_0xa6e4('0x3'))(_0xa6e4('0x4'));var util=require(_0xa6e4('0x5'));var BPromise=require(_0xa6e4('0x6'));var _=require(_0xa6e4('0x7'));function handleError(_0x575b43,_0x96d00f,_0x3bcb91){_0x96d00f=_0x96d00f||0x1f4;return function(_0x5c1c17){logger[_0xa6e4('0x8')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3bcb91,_0x96d00f,util[_0xa6e4('0x9')](_0x5c1c17,{'showHidden':![],'depth':null}));delete _0x5c1c17[_0xa6e4('0xa')];_0x575b43[_0xa6e4('0xb')](_0x96d00f)['send'](_0x5c1c17);};}exports['index']=function(_0x340588,_0x393ccb){return info['getAllData']()[_0xa6e4('0xc')](function(_0xe6e98){return _0x393ccb[_0xa6e4('0xb')](0xc8)[_0xa6e4('0xd')](_0xe6e98);})[_0xa6e4('0xe')](function(_0x4fdadf){return _0x393ccb[_0xa6e4('0xb')](0x1f4)[_0xa6e4('0xd')](_0x4fdadf);});};exports[_0xa6e4('0xf')]=function(_0x404f7f,_0x9f6666){var _0x32122e=[_0xa6e4('0x10')];return new BPromise(function(_0x3da136,_0xb79a87){return exec(util[_0xa6e4('0x11')](_0xa6e4('0x12'),_0x404f7f['params'][_0xa6e4('0x13')]),function(_0x2f20a4,_0x24547e,_0x2fa5bd){if(_0x2f20a4){return _0xb79a87(_0x2f20a4);}return _0x3da136(_0x24547e);});})[_0xa6e4('0xc')](function(_0x32a609){var _0x1f7cf7=![];var _0x3bb073=_0x32a609[_0xa6e4('0x14')](/\n/);for(var _0x1ff1da=0x0,_0x3c83ea=_0x32122e[_0xa6e4('0x15')];_0x1ff1da<_0x3c83ea,_0x1f7cf7===![];_0x1ff1da+=0x1){if(_0x32a609[_0xa6e4('0x16')](_0x32122e[_0x1ff1da])>=0x0){_0x1f7cf7=!![];}}if(!_0x1f7cf7){throw new Error(util[_0xa6e4('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x404f7f['params'][_0xa6e4('0x13')]));}process['kill'](_0x404f7f['params']['pid'],'SIGINT');return _0x9f6666['status'](0xc8)[_0xa6e4('0xd')]({'message':util['format'](_0xa6e4('0x17'),_0x404f7f[_0xa6e4('0x18')][_0xa6e4('0x13')])});})[_0xa6e4('0xe')](handleError(_0x9f6666,null,_0xa6e4('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6057420..b2549e8 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 _0x9aa8=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','express'];(function(_0x2f452c,_0x45498e){var _0x5130ff=function(_0x46c6f4){while(--_0x46c6f4){_0x2f452c['push'](_0x2f452c['shift']());}};_0x5130ff(++_0x45498e);}(_0x9aa8,0x155));var _0x89aa=function(_0x108e18,_0x2b7aab){_0x108e18=_0x108e18-0x0;var _0x1f4710=_0x9aa8[_0x108e18];return _0x1f4710;};'use strict';var multer=require(_0x89aa('0x0'));var util=require(_0x89aa('0x1'));var path=require(_0x89aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x89aa('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x89aa('0x4'));var config=require(_0x89aa('0x5'));var controller=require('./tag.controller');router[_0x89aa('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x89aa('0x6')](_0x89aa('0x7'),auth[_0x89aa('0x8')](),controller[_0x89aa('0x9')]);router[_0x89aa('0xa')]('/',auth[_0x89aa('0x8')](),controller[_0x89aa('0xb')]);router[_0x89aa('0xc')](_0x89aa('0x7'),auth[_0x89aa('0x8')](),controller[_0x89aa('0xd')]);router[_0x89aa('0xe')](_0x89aa('0x7'),auth[_0x89aa('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xeff4=['isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get'];(function(_0x4a705a,_0x13c990){var _0x37e5bd=function(_0x90517f){while(--_0x90517f){_0x4a705a['push'](_0x4a705a['shift']());}};_0x37e5bd(++_0x13c990);}(_0xeff4,0xe5));var _0x4eff=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0xeff4[_0x2caaef];return _0xd011f8;};'use strict';var multer=require(_0x4eff('0x0'));var util=require(_0x4eff('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4eff('0x2'));var router=express[_0x4eff('0x3')]();var fs_extra=require(_0x4eff('0x4'));var auth=require(_0x4eff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4eff('0x6'));var controller=require(_0x4eff('0x7'));router[_0x4eff('0x8')]('/',auth[_0x4eff('0x9')](),controller['index']);router[_0x4eff('0x8')](_0x4eff('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4eff('0xb')]('/',auth[_0x4eff('0x9')](),controller[_0x4eff('0xc')]);router[_0x4eff('0xd')](_0x4eff('0xa'),auth[_0x4eff('0x9')](),controller['update']);router[_0x4eff('0xe')](_0x4eff('0xa'),auth[_0x4eff('0x9')](),controller[_0x4eff('0xf')]);module[_0x4eff('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 404e3ac..3e45ef6 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 _0x1399=['exports','name','#0091EA','STRING','sequelize'];(function(_0xf390de,_0x55fa16){var _0x1c005c=function(_0x151cb4){while(--_0x151cb4){_0xf390de['push'](_0xf390de['shift']());}};_0x1c005c(++_0x55fa16);}(_0x1399,0x16c));var _0x9139=function(_0x1113dc,_0x188e4b){_0x1113dc=_0x1113dc-0x0;var _0x1ebf6e=_0x1399[_0x1113dc];return _0x1ebf6e;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9139('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x9139('0x3')},'description':{'type':Sequelize[_0x9139('0x4')]}}; \ No newline at end of file +var _0x20d8=['STRING','#0091EA','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x20d8,0xee));var _0x820d=function(_0x442bdf,_0x2846b8){_0x442bdf=_0x442bdf-0x0;var _0x20001d=_0x20d8[_0x442bdf];return _0x20001d;};'use strict';var Sequelize=require(_0x820d('0x0'));module[_0x820d('0x1')]={'name':{'type':Sequelize[_0x820d('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x820d('0x3')},'description':{'type':Sequelize[_0x820d('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7a699ed..4a37896 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 _0xb332=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','options','count','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','find','body','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0x106b3d,_0x2fb530){var _0x597454=function(_0x1e017d){while(--_0x1e017d){_0x106b3d['push'](_0x106b3d['shift']());}};_0x597454(++_0x2fb530);}(_0xb332,0xd9));var _0x2b33=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb332[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x2b33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b33('0x1'));var jsonpatch=require(_0x2b33('0x2'));var rp=require('request-promise');var moment=require(_0x2b33('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b33('0x4'));var util=require('util');var path=require(_0x2b33('0x5'));var sox=require('sox');var csv=require(_0x2b33('0x6'));var ejs=require(_0x2b33('0x7'));var fs=require('fs');var fs_extra=require(_0x2b33('0x8'));var _=require(_0x2b33('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b33('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2b33('0x6'));var querystring=require(_0x2b33('0xb'));var Papa=require(_0x2b33('0xc'));var Redis=require(_0x2b33('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2b33('0xe'));var as=require(_0x2b33('0xf'));var hardwareService=require(_0x2b33('0x10'));var logger=require(_0x2b33('0x11'))(_0x2b33('0x12'));var utils=require(_0x2b33('0x13'));var config=require(_0x2b33('0x14'));var licenseUtil=require(_0x2b33('0x15'));var db=require(_0x2b33('0x16'))['db'];function respondWithStatusCode(_0x3969cb,_0xca2248){_0xca2248=_0xca2248||0xcc;return function(_0x4df129){if(_0x4df129){return _0x3969cb[_0x2b33('0x17')](_0xca2248);}return _0x3969cb[_0x2b33('0x18')](_0xca2248)[_0x2b33('0x19')]();};}function respondWithResult(_0x4ef886,_0x173c75){_0x173c75=_0x173c75||0xc8;return function(_0x4d39db){if(_0x4d39db){return _0x4ef886[_0x2b33('0x18')](_0x173c75)[_0x2b33('0x1a')](_0x4d39db);}};}function respondWithFilteredResult(_0x233cd9,_0x57aea7){return function(_0x52693f){if(_0x52693f){var _0x1d8e75=typeof _0x57aea7[_0x2b33('0x1b')]===_0x2b33('0x1c')&&typeof _0x57aea7[_0x2b33('0x1d')]===_0x2b33('0x1c');var _0x4d69d0=_0x52693f['count'];var _0x59f0b6=_0x1d8e75?0x0:_0x57aea7[_0x2b33('0x1b')];var _0x4f10c4=_0x1d8e75?_0x52693f['count']:_0x57aea7[_0x2b33('0x1b')]+_0x57aea7[_0x2b33('0x1d')];var _0x205d8f;if(_0x4f10c4>=_0x4d69d0){_0x4f10c4=_0x4d69d0;_0x205d8f=0xc8;}else{_0x205d8f=0xce;}_0x233cd9['status'](_0x205d8f);return _0x233cd9[_0x2b33('0x1e')]('Content-Range',_0x59f0b6+'-'+_0x4f10c4+'/'+_0x4d69d0)[_0x2b33('0x1a')](_0x52693f);}return null;};}function patchUpdates(_0x2565be){return function(_0x8c8dc2){try{jsonpatch[_0x2b33('0x1f')](_0x8c8dc2,_0x2565be,!![]);}catch(_0x233ba6){return BPromise[_0x2b33('0x20')](_0x233ba6);}return _0x8c8dc2[_0x2b33('0x21')]();};}function saveUpdates(_0x4fb725,_0x23024c){return function(_0x1d9c98){if(_0x1d9c98){return _0x1d9c98[_0x2b33('0x22')](_0x4fb725)[_0x2b33('0x23')](function(_0x58998e){return _0x58998e;});}return null;};}function removeEntity(_0x1c27d4,_0x27f1b8){return function(_0x2605e6){if(_0x2605e6){return _0x2605e6['destroy']()[_0x2b33('0x23')](function(){var _0x1b9a48=_0x2605e6[_0x2b33('0x24')]({'plain':!![]});var _0x32b835='Tags';return db[_0x2b33('0x25')]['destroy']({'where':{'type':_0x32b835,'resourceId':_0x1b9a48['id']}})[_0x2b33('0x23')](function(){return _0x2605e6;});})['then'](function(){_0x1c27d4[_0x2b33('0x18')](0xcc)[_0x2b33('0x19')]();});}};}function handleEntityNotFound(_0x5d8d05,_0x195aa2){return function(_0x53c2ad){if(!_0x53c2ad){_0x5d8d05[_0x2b33('0x17')](0x194);}return _0x53c2ad;};}function handleError(_0x5b16a8,_0x315ebd){_0x315ebd=_0x315ebd||0x1f4;return function(_0xa109f4){logger[_0x2b33('0x26')](_0xa109f4[_0x2b33('0x27')]);if(_0xa109f4[_0x2b33('0x28')]){delete _0xa109f4[_0x2b33('0x28')];}_0x5b16a8[_0x2b33('0x18')](_0x315ebd)[_0x2b33('0x29')](_0xa109f4);};}exports[_0x2b33('0x2a')]=function(_0x203c43,_0x4cf72f){var _0x5b6527={},_0x106ea0={},_0x2a081c={'count':0x0,'rows':[]};var _0x3282bf=_[_0x2b33('0x2b')](db[_0x2b33('0x2c')]['rawAttributes'],function(_0x570765){return{'name':_0x570765[_0x2b33('0x2d')],'type':_0x570765[_0x2b33('0x2e')][_0x2b33('0x2f')]};});_0x106ea0[_0x2b33('0x30')]=_[_0x2b33('0x2b')](_0x3282bf,_0x2b33('0x28'));_0x106ea0['query']=_[_0x2b33('0x31')](_0x203c43['query']);_0x106ea0[_0x2b33('0x32')]=_[_0x2b33('0x33')](_0x106ea0[_0x2b33('0x30')],_0x106ea0[_0x2b33('0x34')]);_0x5b6527[_0x2b33('0x35')]=_[_0x2b33('0x33')](_0x106ea0[_0x2b33('0x30')],qs[_0x2b33('0x36')](_0x203c43[_0x2b33('0x34')][_0x2b33('0x36')]));_0x5b6527[_0x2b33('0x35')]=_0x5b6527[_0x2b33('0x35')][_0x2b33('0x37')]?_0x5b6527[_0x2b33('0x35')]:_0x106ea0[_0x2b33('0x30')];if(!_0x203c43[_0x2b33('0x34')]['hasOwnProperty']('nolimit')){_0x5b6527['limit']=qs[_0x2b33('0x1d')](_0x203c43[_0x2b33('0x34')][_0x2b33('0x1d')]);_0x5b6527[_0x2b33('0x1b')]=qs[_0x2b33('0x1b')](_0x203c43['query']['offset']);}_0x5b6527[_0x2b33('0x38')]=qs['sort'](_0x203c43[_0x2b33('0x34')][_0x2b33('0x39')]);_0x5b6527[_0x2b33('0x3a')]=qs[_0x2b33('0x32')](_[_0x2b33('0x3b')](_0x203c43[_0x2b33('0x34')],_0x106ea0[_0x2b33('0x32')]),_0x3282bf);if(_0x203c43[_0x2b33('0x34')][_0x2b33('0x3c')]){_0x5b6527[_0x2b33('0x3a')]=_['merge'](_0x5b6527[_0x2b33('0x3a')],{'$or':_[_0x2b33('0x2b')](_0x3282bf,function(_0x1f0160){if(_0x1f0160['type']!=='VIRTUAL'){var _0x3afaa5={};_0x3afaa5[_0x1f0160['name']]={'$like':'%'+_0x203c43[_0x2b33('0x34')][_0x2b33('0x3c')]+'%'};return _0x3afaa5;}})});}_0x5b6527=_['merge']({},_0x5b6527,_0x203c43[_0x2b33('0x3d')]);var _0x13874a={'where':_0x5b6527['where']};return db[_0x2b33('0x2c')][_0x2b33('0x3e')](_0x13874a)['then'](function(_0x2168b6){_0x2a081c[_0x2b33('0x3e')]=_0x2168b6;if(_0x203c43[_0x2b33('0x34')]['includeAll']){_0x5b6527[_0x2b33('0x3f')]=[{'all':!![]}];}return db[_0x2b33('0x2c')][_0x2b33('0x40')](_0x5b6527);})[_0x2b33('0x23')](function(_0x22ce0c){_0x2a081c['rows']=_0x22ce0c;return _0x2a081c;})[_0x2b33('0x23')](respondWithFilteredResult(_0x4cf72f,_0x5b6527))[_0x2b33('0x41')](handleError(_0x4cf72f,null));};exports[_0x2b33('0x42')]=function(_0x5ad3b2,_0x1fd4b2){var _0x2ac846={'raw':!![],'where':{'id':_0x5ad3b2[_0x2b33('0x43')]['id']}},_0x3c61d6={};_0x3c61d6['model']=_[_0x2b33('0x31')](db[_0x2b33('0x2c')]['rawAttributes']);_0x3c61d6['query']=_['keys'](_0x5ad3b2[_0x2b33('0x34')]);_0x3c61d6['filters']=_[_0x2b33('0x33')](_0x3c61d6[_0x2b33('0x30')],_0x3c61d6[_0x2b33('0x34')]);_0x2ac846[_0x2b33('0x35')]=_[_0x2b33('0x33')](_0x3c61d6[_0x2b33('0x30')],qs[_0x2b33('0x36')](_0x5ad3b2[_0x2b33('0x34')]['fields']));_0x2ac846[_0x2b33('0x35')]=_0x2ac846[_0x2b33('0x35')][_0x2b33('0x37')]?_0x2ac846[_0x2b33('0x35')]:_0x3c61d6[_0x2b33('0x30')];if(_0x5ad3b2[_0x2b33('0x34')]['includeAll']){_0x2ac846['include']=[{'all':!![]}];}_0x2ac846=_['merge']({},_0x2ac846,_0x5ad3b2['options']);return db[_0x2b33('0x2c')]['find'](_0x2ac846)[_0x2b33('0x23')](handleEntityNotFound(_0x1fd4b2,null))['then'](respondWithResult(_0x1fd4b2,null))['catch'](handleError(_0x1fd4b2,null));};exports[_0x2b33('0x44')]=function(_0xd15da9,_0x357724){return db['Tag'][_0x2b33('0x44')](_0xd15da9['body'],{})[_0x2b33('0x23')](function(_0x27d3b6){var _0x2a20a4=_0xd15da9[_0x2b33('0x45')][_0x2b33('0x24')]({'plain':!![]});if(!_0x2a20a4)throw new Error(_0x2b33('0x46'));if(_0x2a20a4['role']===_0x2b33('0x45')){var _0x27f766=_0x27d3b6[_0x2b33('0x24')]({'plain':!![]});var _0x4e8c21=_0x2b33('0x47');return db[_0x2b33('0x48')][_0x2b33('0x49')]({'where':{'name':_0x4e8c21,'userProfileId':_0x2a20a4['userProfileId']},'raw':!![]})[_0x2b33('0x23')](function(_0x4cffe9){if(_0x4cffe9&&_0x4cffe9['autoAssociation']===0x0){return db[_0x2b33('0x25')][_0x2b33('0x44')]({'name':_0x27f766[_0x2b33('0x28')],'resourceId':_0x27f766['id'],'type':_0x4cffe9[_0x2b33('0x28')],'sectionId':_0x4cffe9['id']},{})[_0x2b33('0x23')](function(){return _0x27d3b6;});}else{return _0x27d3b6;}})[_0x2b33('0x41')](function(_0x1982aa){logger[_0x2b33('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1982aa);throw _0x1982aa;});}return _0x27d3b6;})[_0x2b33('0x23')](respondWithResult(_0x357724,0xc9))[_0x2b33('0x41')](handleError(_0x357724,null));};exports['update']=function(_0x28e75b,_0x45a939){if(_0x28e75b['body']['id']){delete _0x28e75b[_0x2b33('0x4a')]['id'];}return db[_0x2b33('0x2c')][_0x2b33('0x49')]({'where':{'id':_0x28e75b[_0x2b33('0x43')]['id']}})['then'](handleEntityNotFound(_0x45a939,null))[_0x2b33('0x23')](saveUpdates(_0x28e75b[_0x2b33('0x4a')],null))['then'](respondWithResult(_0x45a939,null))[_0x2b33('0x41')](handleError(_0x45a939,null));};exports[_0x2b33('0x4b')]=function(_0x1ce316,_0x26e0ca){return db[_0x2b33('0x2c')][_0x2b33('0x49')]({'where':{'id':_0x1ce316[_0x2b33('0x43')]['id']}})['then'](handleEntityNotFound(_0x26e0ca,null))['then'](removeEntity(_0x26e0ca,null))[_0x2b33('0x41')](handleError(_0x26e0ca,null));}; \ No newline at end of file +var _0xf403=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','index','Tag','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0x2b9eb2,_0x5e212d){var _0x251869=function(_0xdebedf){while(--_0xdebedf){_0x2b9eb2['push'](_0x2b9eb2['shift']());}};_0x251869(++_0x5e212d);}(_0xf403,0x1d3));var _0x3f40=function(_0x19189b,_0x178489){_0x19189b=_0x19189b-0x0;var _0x637834=_0xf403[_0x19189b];return _0x637834;};'use strict';var emlformat=require(_0x3f40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f40('0x1'));var jsonpatch=require(_0x3f40('0x2'));var rp=require(_0x3f40('0x3'));var moment=require(_0x3f40('0x4'));var BPromise=require(_0x3f40('0x5'));var Mustache=require(_0x3f40('0x6'));var util=require(_0x3f40('0x7'));var path=require(_0x3f40('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f40('0x9'));var fs=require('fs');var fs_extra=require(_0x3f40('0xa'));var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f40('0x11'));var hardwareService=require(_0x3f40('0x12'));var logger=require(_0x3f40('0x13'))('api');var utils=require(_0x3f40('0x14'));var config=require(_0x3f40('0x15'));var licenseUtil=require(_0x3f40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332635,_0x509c02){_0x509c02=_0x509c02||0xcc;return function(_0x116460){if(_0x116460){return _0x332635[_0x3f40('0x17')](_0x509c02);}return _0x332635[_0x3f40('0x18')](_0x509c02)[_0x3f40('0x19')]();};}function respondWithResult(_0x569c6e,_0x2b2bfe){_0x2b2bfe=_0x2b2bfe||0xc8;return function(_0x308e97){if(_0x308e97){return _0x569c6e[_0x3f40('0x18')](_0x2b2bfe)[_0x3f40('0x1a')](_0x308e97);}};}function respondWithFilteredResult(_0x232241,_0x4e28b9){return function(_0x2e51ed){if(_0x2e51ed){var _0x3d11c9=typeof _0x4e28b9['offset']==='undefined'&&typeof _0x4e28b9['limit']===_0x3f40('0x1b');var _0x13b950=_0x2e51ed[_0x3f40('0x1c')];var _0x131e55=_0x3d11c9?0x0:_0x4e28b9[_0x3f40('0x1d')];var _0x5b4ebc=_0x3d11c9?_0x2e51ed[_0x3f40('0x1c')]:_0x4e28b9[_0x3f40('0x1d')]+_0x4e28b9[_0x3f40('0x1e')];var _0x29405a;if(_0x5b4ebc>=_0x13b950){_0x5b4ebc=_0x13b950;_0x29405a=0xc8;}else{_0x29405a=0xce;}_0x232241[_0x3f40('0x18')](_0x29405a);return _0x232241['set'](_0x3f40('0x1f'),_0x131e55+'-'+_0x5b4ebc+'/'+_0x13b950)['json'](_0x2e51ed);}return null;};}function patchUpdates(_0x12aabf){return function(_0x32b945){try{jsonpatch[_0x3f40('0x20')](_0x32b945,_0x12aabf,!![]);}catch(_0x113293){return BPromise[_0x3f40('0x21')](_0x113293);}return _0x32b945['save']();};}function saveUpdates(_0x27f5a5,_0x379b4e){return function(_0x117823){if(_0x117823){return _0x117823[_0x3f40('0x22')](_0x27f5a5)[_0x3f40('0x23')](function(_0xa1f39d){return _0xa1f39d;});}return null;};}function removeEntity(_0x4e1f47,_0x31fc91){return function(_0x59eb32){if(_0x59eb32){return _0x59eb32[_0x3f40('0x24')]()['then'](function(){var _0x2bc437=_0x59eb32['get']({'plain':!![]});var _0x37b47e='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x37b47e,'resourceId':_0x2bc437['id']}})[_0x3f40('0x23')](function(){return _0x59eb32;});})[_0x3f40('0x23')](function(){_0x4e1f47[_0x3f40('0x18')](0xcc)[_0x3f40('0x19')]();});}};}function handleEntityNotFound(_0x5b1079,_0x300665){return function(_0x47ec1c){if(!_0x47ec1c){_0x5b1079[_0x3f40('0x17')](0x194);}return _0x47ec1c;};}function handleError(_0xbaf5d4,_0xbd4333){_0xbd4333=_0xbd4333||0x1f4;return function(_0x5e0f25){logger[_0x3f40('0x25')](_0x5e0f25['stack']);if(_0x5e0f25[_0x3f40('0x26')]){delete _0x5e0f25['name'];}_0xbaf5d4['status'](_0xbd4333)[_0x3f40('0x27')](_0x5e0f25);};}exports[_0x3f40('0x28')]=function(_0x14fdfd,_0xb23186){var _0x357396={},_0x1056d0={},_0x40cd76={'count':0x0,'rows':[]};var _0xe70e64=_['map'](db[_0x3f40('0x29')][_0x3f40('0x2a')],function(_0x18dbb3){return{'name':_0x18dbb3[_0x3f40('0x2b')],'type':_0x18dbb3[_0x3f40('0x2c')]['key']};});_0x1056d0[_0x3f40('0x2d')]=_[_0x3f40('0x2e')](_0xe70e64,_0x3f40('0x26'));_0x1056d0['query']=_[_0x3f40('0x2f')](_0x14fdfd[_0x3f40('0x30')]);_0x1056d0[_0x3f40('0x31')]=_[_0x3f40('0x32')](_0x1056d0[_0x3f40('0x2d')],_0x1056d0[_0x3f40('0x30')]);_0x357396[_0x3f40('0x33')]=_[_0x3f40('0x32')](_0x1056d0[_0x3f40('0x2d')],qs[_0x3f40('0x34')](_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x34')]));_0x357396[_0x3f40('0x33')]=_0x357396[_0x3f40('0x33')][_0x3f40('0x35')]?_0x357396[_0x3f40('0x33')]:_0x1056d0[_0x3f40('0x2d')];if(!_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x36')](_0x3f40('0x37'))){_0x357396[_0x3f40('0x1e')]=qs[_0x3f40('0x1e')](_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x1e')]);_0x357396[_0x3f40('0x1d')]=qs[_0x3f40('0x1d')](_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x1d')]);}_0x357396[_0x3f40('0x38')]=qs[_0x3f40('0x39')](_0x14fdfd['query']['sort']);_0x357396[_0x3f40('0x3a')]=qs[_0x3f40('0x31')](_[_0x3f40('0x3b')](_0x14fdfd[_0x3f40('0x30')],_0x1056d0[_0x3f40('0x31')]),_0xe70e64);if(_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x3c')]){_0x357396['where']=_[_0x3f40('0x3d')](_0x357396['where'],{'$or':_[_0x3f40('0x2e')](_0xe70e64,function(_0x3bec11){if(_0x3bec11[_0x3f40('0x2c')]!=='VIRTUAL'){var _0x37a83d={};_0x37a83d[_0x3bec11[_0x3f40('0x26')]]={'$like':'%'+_0x14fdfd['query'][_0x3f40('0x3c')]+'%'};return _0x37a83d;}})});}_0x357396=_[_0x3f40('0x3d')]({},_0x357396,_0x14fdfd['options']);var _0x192839={'where':_0x357396['where']};return db[_0x3f40('0x29')]['count'](_0x192839)['then'](function(_0x8e89a){_0x40cd76['count']=_0x8e89a;if(_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x3e')]){_0x357396[_0x3f40('0x3f')]=[{'all':!![]}];}return db[_0x3f40('0x29')]['findAll'](_0x357396);})[_0x3f40('0x23')](function(_0x5b0eaa){_0x40cd76[_0x3f40('0x40')]=_0x5b0eaa;return _0x40cd76;})[_0x3f40('0x23')](respondWithFilteredResult(_0xb23186,_0x357396))[_0x3f40('0x41')](handleError(_0xb23186,null));};exports['show']=function(_0x4a198d,_0x21ba95){var _0xfddbd9={'raw':!![],'where':{'id':_0x4a198d[_0x3f40('0x42')]['id']}},_0x41bd93={};_0x41bd93[_0x3f40('0x2d')]=_[_0x3f40('0x2f')](db[_0x3f40('0x29')][_0x3f40('0x2a')]);_0x41bd93['query']=_[_0x3f40('0x2f')](_0x4a198d['query']);_0x41bd93['filters']=_[_0x3f40('0x32')](_0x41bd93[_0x3f40('0x2d')],_0x41bd93[_0x3f40('0x30')]);_0xfddbd9[_0x3f40('0x33')]=_[_0x3f40('0x32')](_0x41bd93[_0x3f40('0x2d')],qs[_0x3f40('0x34')](_0x4a198d[_0x3f40('0x30')][_0x3f40('0x34')]));_0xfddbd9[_0x3f40('0x33')]=_0xfddbd9[_0x3f40('0x33')][_0x3f40('0x35')]?_0xfddbd9[_0x3f40('0x33')]:_0x41bd93[_0x3f40('0x2d')];if(_0x4a198d['query'][_0x3f40('0x3e')]){_0xfddbd9['include']=[{'all':!![]}];}_0xfddbd9=_[_0x3f40('0x3d')]({},_0xfddbd9,_0x4a198d[_0x3f40('0x43')]);return db['Tag'][_0x3f40('0x44')](_0xfddbd9)[_0x3f40('0x23')](handleEntityNotFound(_0x21ba95,null))[_0x3f40('0x23')](respondWithResult(_0x21ba95,null))[_0x3f40('0x41')](handleError(_0x21ba95,null));};exports[_0x3f40('0x45')]=function(_0x268ae4,_0x851bfc){return db[_0x3f40('0x29')][_0x3f40('0x45')](_0x268ae4[_0x3f40('0x46')],{})[_0x3f40('0x23')](function(_0x364773){var _0x1cfe4f=_0x268ae4[_0x3f40('0x47')][_0x3f40('0x48')]({'plain':!![]});if(!_0x1cfe4f)throw new Error(_0x3f40('0x49'));if(_0x1cfe4f[_0x3f40('0x4a')]===_0x3f40('0x47')){var _0x32bd05=_0x364773[_0x3f40('0x48')]({'plain':!![]});var _0xca7210='Tags';return db[_0x3f40('0x4b')][_0x3f40('0x44')]({'where':{'name':_0xca7210,'userProfileId':_0x1cfe4f[_0x3f40('0x4c')]},'raw':!![]})[_0x3f40('0x23')](function(_0x3bfb89){if(_0x3bfb89&&_0x3bfb89['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32bd05[_0x3f40('0x26')],'resourceId':_0x32bd05['id'],'type':_0x3bfb89[_0x3f40('0x26')],'sectionId':_0x3bfb89['id']},{})['then'](function(){return _0x364773;});}else{return _0x364773;}})[_0x3f40('0x41')](function(_0x1e0af6){logger['error'](_0x3f40('0x4d'),_0x1e0af6);throw _0x1e0af6;});}return _0x364773;})['then'](respondWithResult(_0x851bfc,0xc9))[_0x3f40('0x41')](handleError(_0x851bfc,null));};exports[_0x3f40('0x22')]=function(_0x24ae66,_0x3a39c6){if(_0x24ae66[_0x3f40('0x46')]['id']){delete _0x24ae66[_0x3f40('0x46')]['id'];}return db[_0x3f40('0x29')][_0x3f40('0x44')]({'where':{'id':_0x24ae66[_0x3f40('0x42')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x3a39c6,null))[_0x3f40('0x23')](saveUpdates(_0x24ae66[_0x3f40('0x46')],null))[_0x3f40('0x23')](respondWithResult(_0x3a39c6,null))['catch'](handleError(_0x3a39c6,null));};exports[_0x3f40('0x24')]=function(_0x22beb7,_0x1c94a1){return db[_0x3f40('0x29')][_0x3f40('0x44')]({'where':{'id':_0x22beb7['params']['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x1c94a1,null))[_0x3f40('0x23')](removeEntity(_0x1c94a1,null))[_0x3f40('0x41')](handleError(_0x1c94a1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 86ca159..59f75f8 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 _0x93da=['define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','../../config/environment','./tag.attributes','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x93da,0x92));var _0xa93d=function(_0x10c81b,_0x3b7d25){_0x10c81b=_0x10c81b-0x0;var _0x13a8f4=_0x93da[_0x10c81b];return _0x13a8f4;};'use strict';var _=require(_0xa93d('0x0'));var util=require('util');var logger=require(_0xa93d('0x1'))(_0xa93d('0x2'));var moment=require(_0xa93d('0x3'));var BPromise=require(_0xa93d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa93d('0x5'));var attributes=require(_0xa93d('0x6'));module[_0xa93d('0x7')]=function(_0x425437,_0x179156){return _0x425437[_0xa93d('0x8')](_0xa93d('0x9'),attributes,{'tableName':_0xa93d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf99=['moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger'];(function(_0x151e48,_0xb5f995){var _0x13729d=function(_0x4d793d){while(--_0x4d793d){_0x151e48['push'](_0x151e48['shift']());}};_0x13729d(++_0xb5f995);}(_0xbf99,0x8e));var _0x9bf9=function(_0x112e99,_0x4af2bd){_0x112e99=_0x112e99-0x0;var _0x586c46=_0xbf99[_0x112e99];return _0x586c46;};'use strict';var _=require(_0x9bf9('0x0'));var util=require('util');var logger=require(_0x9bf9('0x1'))('api');var moment=require(_0x9bf9('0x2'));var BPromise=require(_0x9bf9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bf9('0x4'));var rimraf=require(_0x9bf9('0x5'));var config=require(_0x9bf9('0x6'));var attributes=require(_0x9bf9('0x7'));module[_0x9bf9('0x8')]=function(_0x2baeb3,_0x43bff2){return _0x2baeb3[_0x9bf9('0x9')](_0x9bf9('0xa'),attributes,{'tableName':_0x9bf9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 0fabf2f..252fa7b 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 _0x2123=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Tag,\x20%s,\x20%s','message','catch'];(function(_0x4776cc,_0x3a715e){var _0x427bda=function(_0x36b1c7){while(--_0x36b1c7){_0x4776cc['push'](_0x4776cc['shift']());}};_0x427bda(++_0x3a715e);}(_0x2123,0x190));var _0x3212=function(_0x47d393,_0x109ffb){_0x47d393=_0x47d393-0x0;var _0x5df3bf=_0x2123[_0x47d393];return _0x5df3bf;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b1302,_0x1fec5d,_0x4b35e9){return new BPromise(function(_0x3e17a3,_0x56c38f){return client[_0x3212('0xd')](_0x2b1302,_0x4b35e9)[_0x3212('0xe')](function(_0x8ca483){logger[_0x3212('0xf')]('Tag,\x20%s,\x20%s',_0x1fec5d,'request\x20sent');logger[_0x3212('0x10')](_0x3212('0x11'),_0x1fec5d,_0x3212('0x12'),JSON[_0x3212('0x13')](_0x8ca483));if(_0x8ca483[_0x3212('0x14')]){if(_0x8ca483[_0x3212('0x14')][_0x3212('0x15')]===0x1f4){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x56c38f(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x3e17a3(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}else{logger[_0x3212('0xf')](_0x3212('0x16'),_0x1fec5d,_0x3212('0x12'));_0x3e17a3(_0x8ca483['result'][_0x3212('0x17')]);}})[_0x3212('0x18')](function(_0x2720c6){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x2720c6);_0x56c38f(_0x2720c6);});});} \ No newline at end of file +var _0xeec6=['then','info','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xeec6,0x1c2));var _0x6eec=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0xeec6[_0x366e99];return _0x180bbe;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('Tag,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index aa3d967..d5919fb 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 83561a6..888904f 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 _0xe706=['STRING','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe706,0xa3));var _0x6e70=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xe706[_0x17784a];return _0x41aded;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index ff6c273..9792118 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 _0x5a5e=['removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','Team','rawAttributes','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','length','options','create','body','user','get','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','channel','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','isArray','Voice','Chat','Mail','Sms','Openchannel','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','spread','Queue:remove'];(function(_0x1d0992,_0x19c94e){var _0x129b92=function(_0x3ccfed){while(--_0x3ccfed){_0x1d0992['push'](_0x1d0992['shift']());}};_0x129b92(++_0x19c94e);}(_0x5a5e,0x9a));var _0xe5a5=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x5a5e[_0x34232c];return _0x4d4f4e;};'use strict';var emlformat=require(_0xe5a5('0x0'));var rimraf=require(_0xe5a5('0x1'));var zipdir=require(_0xe5a5('0x2'));var jsonpatch=require(_0xe5a5('0x3'));var rp=require(_0xe5a5('0x4'));var moment=require('moment');var BPromise=require(_0xe5a5('0x5'));var Mustache=require(_0xe5a5('0x6'));var util=require(_0xe5a5('0x7'));var path=require(_0xe5a5('0x8'));var sox=require(_0xe5a5('0x9'));var csv=require(_0xe5a5('0xa'));var ejs=require(_0xe5a5('0xb'));var fs=require('fs');var fs_extra=require(_0xe5a5('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe5a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe5a5('0xe'));var Papa=require('papaparse');var Redis=require(_0xe5a5('0xf'));var authService=require(_0xe5a5('0x10'));var qs=require(_0xe5a5('0x11'));var as=require(_0xe5a5('0x12'));var hardwareService=require(_0xe5a5('0x13'));var logger=require(_0xe5a5('0x14'))(_0xe5a5('0x15'));var utils=require(_0xe5a5('0x16'));var config=require(_0xe5a5('0x17'));var licenseUtil=require(_0xe5a5('0x18'));var db=require(_0xe5a5('0x19'))['db'];config[_0xe5a5('0x1a')]=_[_0xe5a5('0x1b')](config[_0xe5a5('0x1a')],{'host':_0xe5a5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5a5('0x1a')]));require(_0xe5a5('0x1d'))[_0xe5a5('0x1e')](socket);function respondWithStatusCode(_0x393c8c,_0x5d6398){_0x5d6398=_0x5d6398||0xcc;return function(_0x16b7a1){if(_0x16b7a1){return _0x393c8c[_0xe5a5('0x1f')](_0x5d6398);}return _0x393c8c[_0xe5a5('0x20')](_0x5d6398)[_0xe5a5('0x21')]();};}function respondWithResult(_0x189131,_0xfdbc0f){_0xfdbc0f=_0xfdbc0f||0xc8;return function(_0x18b4da){if(_0x18b4da){return _0x189131[_0xe5a5('0x20')](_0xfdbc0f)['json'](_0x18b4da);}};}function respondWithFilteredResult(_0x2b7219,_0x4f1133){return function(_0x511998){if(_0x511998){var _0x516a15=typeof _0x4f1133[_0xe5a5('0x22')]==='undefined'&&typeof _0x4f1133['limit']===_0xe5a5('0x23');var _0x4121ba=_0x511998[_0xe5a5('0x24')];var _0x178c6e=_0x516a15?0x0:_0x4f1133[_0xe5a5('0x22')];var _0x3a848e=_0x516a15?_0x511998[_0xe5a5('0x24')]:_0x4f1133[_0xe5a5('0x22')]+_0x4f1133[_0xe5a5('0x25')];var _0x3db6c4;if(_0x3a848e>=_0x4121ba){_0x3a848e=_0x4121ba;_0x3db6c4=0xc8;}else{_0x3db6c4=0xce;}_0x2b7219[_0xe5a5('0x20')](_0x3db6c4);return _0x2b7219[_0xe5a5('0x26')](_0xe5a5('0x27'),_0x178c6e+'-'+_0x3a848e+'/'+_0x4121ba)[_0xe5a5('0x28')](_0x511998);}return null;};}function patchUpdates(_0x351847){return function(_0x35945a){try{jsonpatch[_0xe5a5('0x29')](_0x35945a,_0x351847,!![]);}catch(_0x505acb){return BPromise[_0xe5a5('0x2a')](_0x505acb);}return _0x35945a['save']();};}function saveUpdates(_0x4f01f0,_0xe07049){return function(_0xa0cb6e){if(_0xa0cb6e){return _0xa0cb6e[_0xe5a5('0x2b')](_0x4f01f0)[_0xe5a5('0x2c')](function(_0x50a374){return _0x50a374;});}return null;};}function handleEntityNotFound(_0x46fff5,_0x17dd1c){return function(_0x4e2e67){if(!_0x4e2e67){_0x46fff5[_0xe5a5('0x1f')](0x194);}return _0x4e2e67;};}function handleError(_0x295832,_0x45ab0a){_0x45ab0a=_0x45ab0a||0x1f4;return function(_0x88cca2){logger[_0xe5a5('0x2d')](_0x88cca2[_0xe5a5('0x2e')]);if(_0x88cca2[_0xe5a5('0x2f')]){delete _0x88cca2[_0xe5a5('0x2f')];}_0x295832[_0xe5a5('0x20')](_0x45ab0a)[_0xe5a5('0x30')](_0x88cca2);};}exports[_0xe5a5('0x31')]=function(_0x257f03,_0x2be026){var _0xf5b26={},_0xf9b70b={},_0x246931={'count':0x0,'rows':[]};var _0x1c287f=_[_0xe5a5('0x32')](db[_0xe5a5('0x33')][_0xe5a5('0x34')],function(_0x4d04fc){return{'name':_0x4d04fc['fieldName'],'type':_0x4d04fc['type'][_0xe5a5('0x35')]};});_0xf9b70b['model']=_['map'](_0x1c287f,_0xe5a5('0x2f'));_0xf9b70b['query']=_['keys'](_0x257f03[_0xe5a5('0x36')]);_0xf9b70b[_0xe5a5('0x37')]=_[_0xe5a5('0x38')](_0xf9b70b['model'],_0xf9b70b[_0xe5a5('0x36')]);_0xf5b26[_0xe5a5('0x39')]=_[_0xe5a5('0x38')](_0xf9b70b[_0xe5a5('0x3a')],qs['fields'](_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x3b')]));_0xf5b26[_0xe5a5('0x39')]=_0xf5b26[_0xe5a5('0x39')]['length']?_0xf5b26[_0xe5a5('0x39')]:_0xf9b70b[_0xe5a5('0x3a')];if(!_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x3c')](_0xe5a5('0x3d'))){_0xf5b26[_0xe5a5('0x25')]=qs['limit'](_0x257f03['query']['limit']);_0xf5b26['offset']=qs[_0xe5a5('0x22')](_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x22')]);}_0xf5b26[_0xe5a5('0x3e')]=qs[_0xe5a5('0x3f')](_0x257f03[_0xe5a5('0x36')]['sort']);_0xf5b26[_0xe5a5('0x40')]=qs[_0xe5a5('0x37')](_[_0xe5a5('0x41')](_0x257f03[_0xe5a5('0x36')],_0xf9b70b[_0xe5a5('0x37')]),_0x1c287f);if(_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x42')]){_0xf5b26[_0xe5a5('0x40')]=_[_0xe5a5('0x43')](_0xf5b26[_0xe5a5('0x40')],{'$or':_[_0xe5a5('0x32')](_0x1c287f,function(_0x2ae93e){if(_0x2ae93e[_0xe5a5('0x44')]!==_0xe5a5('0x45')){var _0x4336f5={};_0x4336f5[_0x2ae93e[_0xe5a5('0x2f')]]={'$like':'%'+_0x257f03[_0xe5a5('0x36')][_0xe5a5('0x42')]+'%'};return _0x4336f5;}})});}_0xf5b26=_[_0xe5a5('0x43')]({},_0xf5b26,_0x257f03['options']);var _0x3d3945={'where':_0xf5b26[_0xe5a5('0x40')]};return db[_0xe5a5('0x33')]['count'](_0x3d3945)[_0xe5a5('0x2c')](function(_0x3536bc){_0x246931[_0xe5a5('0x24')]=_0x3536bc;if(_0x257f03[_0xe5a5('0x36')]['includeAll']){_0xf5b26[_0xe5a5('0x46')]=[{'all':!![]}];}return db['Team'][_0xe5a5('0x47')](_0xf5b26);})[_0xe5a5('0x2c')](function(_0x47fbcf){_0x246931[_0xe5a5('0x48')]=_0x47fbcf;return _0x246931;})[_0xe5a5('0x2c')](respondWithFilteredResult(_0x2be026,_0xf5b26))[_0xe5a5('0x49')](handleError(_0x2be026,null));};exports[_0xe5a5('0x4a')]=function(_0x185492,_0x1f5ece){var _0x194446={'raw':![],'where':{'id':_0x185492[_0xe5a5('0x4b')]['id']}},_0x33ca38={};_0x33ca38[_0xe5a5('0x3a')]=_[_0xe5a5('0x4c')](db[_0xe5a5('0x33')]['rawAttributes']);_0x33ca38[_0xe5a5('0x36')]=_['keys'](_0x185492['query']);_0x33ca38[_0xe5a5('0x37')]=_[_0xe5a5('0x38')](_0x33ca38['model'],_0x33ca38[_0xe5a5('0x36')]);_0x194446['attributes']=_[_0xe5a5('0x38')](_0x33ca38[_0xe5a5('0x3a')],qs[_0xe5a5('0x3b')](_0x185492[_0xe5a5('0x36')]['fields']));_0x194446['attributes']=_0x194446[_0xe5a5('0x39')][_0xe5a5('0x4d')]?_0x194446[_0xe5a5('0x39')]:_0x33ca38[_0xe5a5('0x3a')];if(_0x185492[_0xe5a5('0x36')]['includeAll']){_0x194446[_0xe5a5('0x46')]=[{'all':!![]}];}_0x194446=_[_0xe5a5('0x43')]({},_0x194446,_0x185492[_0xe5a5('0x4e')]);return db[_0xe5a5('0x33')]['find'](_0x194446)[_0xe5a5('0x2c')](handleEntityNotFound(_0x1f5ece,null))[_0xe5a5('0x2c')](respondWithResult(_0x1f5ece,null))[_0xe5a5('0x49')](handleError(_0x1f5ece,null));};exports[_0xe5a5('0x4f')]=function(_0x5c9772,_0x476b78){return db['Team'][_0xe5a5('0x4f')](_0x5c9772[_0xe5a5('0x50')],{})[_0xe5a5('0x2c')](function(_0xc8b94f){var _0x2a5478=_0x5c9772[_0xe5a5('0x51')][_0xe5a5('0x52')]({'plain':!![]});if(!_0x2a5478)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a5478[_0xe5a5('0x53')]===_0xe5a5('0x51')){var _0x2b2f63=_0xc8b94f[_0xe5a5('0x52')]({'plain':!![]});var _0x33eed6=_0xe5a5('0x54');return db[_0xe5a5('0x55')]['find']({'where':{'name':_0x33eed6,'userProfileId':_0x2a5478[_0xe5a5('0x56')]},'raw':!![]})[_0xe5a5('0x2c')](function(_0x44909f){if(_0x44909f&&_0x44909f['autoAssociation']===0x0){return db[_0xe5a5('0x57')][_0xe5a5('0x4f')]({'name':_0x2b2f63[_0xe5a5('0x2f')],'resourceId':_0x2b2f63['id'],'type':_0x44909f[_0xe5a5('0x2f')],'sectionId':_0x44909f['id']},{})['then'](function(){return _0xc8b94f;});}else{return _0xc8b94f;}})[_0xe5a5('0x49')](function(_0x5dc20f){logger[_0xe5a5('0x2d')](_0xe5a5('0x58'),_0x5dc20f);throw _0x5dc20f;});}return _0xc8b94f;})[_0xe5a5('0x2c')](respondWithResult(_0x476b78,0xc9))['catch'](handleError(_0x476b78,null));};exports[_0xe5a5('0x2b')]=function(_0x5f5159,_0x408dd2){if(_0x5f5159[_0xe5a5('0x50')]['id']){delete _0x5f5159['body']['id'];}return db[_0xe5a5('0x33')][_0xe5a5('0x59')]({'where':{'id':_0x5f5159[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x408dd2,null))[_0xe5a5('0x2c')](saveUpdates(_0x5f5159['body'],null))[_0xe5a5('0x2c')](respondWithResult(_0x408dd2,null))[_0xe5a5('0x49')](handleError(_0x408dd2,null));};exports[_0xe5a5('0x5a')]=function(_0x537251,_0xa626f4){var _0xea480f=_0x537251['params']['id'];var _0x5700eb=[];return db[_0xe5a5('0x5b')]['transaction'](function(_0x23869e){var _0x2762a2=_0xe5a5('0x5c')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x2762a2,{'type':db[_0xe5a5('0x5d')][_0xe5a5('0x5e')][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e})[_0xe5a5('0x2c')](function(_0x2049ae){_0x5700eb=_[_0xe5a5('0x32')](_0x2049ae,function(_0x3049c8){return Number(_0x3049c8['UserId']);});})[_0xe5a5('0x2c')](function(){var _0xe94d43=_0xe5a5('0x60')+_0xea480f;return db[_0xe5a5('0x5b')]['query'](_0xe94d43,{'type':db[_0xe5a5('0x5d')]['QueryTypes'][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x568fd1){var _0x2c7724=_[_0xe5a5('0x32')](_0x568fd1,function(_0xd6885d){return Number(_0xd6885d[_0xe5a5('0x61')]);});return db[_0xe5a5('0x62')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'VoiceQueueId':{'$in':_0x2c7724}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x137d40=_0xe5a5('0x63')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x137d40,{'type':db[_0xe5a5('0x5d')][_0xe5a5('0x5e')][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x1b3083){var _0x522e15=_[_0xe5a5('0x32')](_0x1b3083,function(_0x1b906e){return Number(_0x1b906e['MailQueueId']);});return db[_0xe5a5('0x64')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'MailQueueId':{'$in':_0x522e15}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x15e8f5=_0xe5a5('0x65')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x15e8f5,{'type':db['Sequelize'][_0xe5a5('0x5e')]['SELECT'],'raw':!![],'transaction':_0x23869e});})['then'](function(_0x35557c){var _0x40d418=_['map'](_0x35557c,function(_0xc5735f){return Number(_0xc5735f[_0xe5a5('0x66')]);});return db[_0xe5a5('0x67')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'SmsQueueId':{'$in':_0x40d418}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x5806e1='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x5806e1,{'type':db[_0xe5a5('0x5d')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x1179e6){var _0x2da34e=_[_0xe5a5('0x32')](_0x1179e6,function(_0x280508){return Number(_0x280508[_0xe5a5('0x68')]);});return db['UserChatQueue'][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'ChatQueueId':{'$in':_0x2da34e}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0xbab02b=_0xe5a5('0x69')+_0xea480f;return db[_0xe5a5('0x5b')]['query'](_0xbab02b,{'type':db[_0xe5a5('0x5d')][_0xe5a5('0x5e')][_0xe5a5('0x5f')],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x4bb6f8){var _0x550cee=_[_0xe5a5('0x32')](_0x4bb6f8,function(_0xc4f124){return Number(_0xc4f124[_0xe5a5('0x6a')]);});return db['UserFaxQueue'][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'FaxQueueId':{'$in':_0x550cee}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x3644b5=_0xe5a5('0x6b')+_0xea480f;return db[_0xe5a5('0x5b')][_0xe5a5('0x36')](_0x3644b5,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x341454){var _0x4befe7=_[_0xe5a5('0x32')](_0x341454,function(_0x9ed9e5){return Number(_0x9ed9e5[_0xe5a5('0x6c')]);});return db['UserOpenchannelQueue'][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'OpenchannelQueueId':{'$in':_0x4befe7}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){var _0x2c610f='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0xea480f;return db['sequelize'][_0xe5a5('0x36')](_0x2c610f,{'type':db[_0xe5a5('0x5d')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(_0x3dc904){var _0x242a25=_[_0xe5a5('0x32')](_0x3dc904,function(_0x216686){return Number(_0x216686[_0xe5a5('0x6d')]);});return db[_0xe5a5('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x5700eb},'WhatsappQueueId':{'$in':_0x242a25}},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){return db[_0xe5a5('0x6f')][_0xe5a5('0x59')]({'where':{'TeamId':_0xea480f}});})[_0xe5a5('0x2c')](function(_0x553992){if(_0x553992===null){return;}return db[_0xe5a5('0x70')][_0xe5a5('0x5a')]({'where':{'UserId':{'$in':_0x5700eb},'VoicePrefixId':_0x553992[_0xe5a5('0x71')]},'transaction':_0x23869e});})[_0xe5a5('0x2c')](function(){return db[_0xe5a5('0x33')][_0xe5a5('0x5a')]({'where':{'id':_0xea480f},'cascade':!![],'transaction':_0x23869e});})['then'](function(_0x63fcd){if(_0x63fcd===0x0){_0xa626f4['sendStatus'](0x194);}else{return db[_0xe5a5('0x57')][_0xe5a5('0x5a')]({'where':{'type':'Teams','resourceId':_0xea480f},'cascade':!![],'transaction':_0x23869e})[_0xe5a5('0x2c')](function(){_0xa626f4[_0xe5a5('0x20')](0xcc)[_0xe5a5('0x21')]();});}})[_0xe5a5('0x49')](function(_0x4e3d1a){_0xa626f4['status'](0x1f4)[_0xe5a5('0x30')](_0x4e3d1a);});});};exports[_0xe5a5('0x72')]=function(_0x547462,_0x3c722c,_0x5db0f7){return db['Team'][_0xe5a5('0x73')]({'where':{'id':_0x547462[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x3c722c,null))[_0xe5a5('0x2c')](function(_0x31af60){if(!_0x547462[_0xe5a5('0x36')]['channel']||!utils[_0xe5a5('0x74')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x75')])){throw new db['Sequelize'][(_0xe5a5('0x76'))]('Unknown\x20channel');}var _0x3312b5={};var _0xf1dfd1={};_0xf1dfd1[_0xe5a5('0x3a')]=_[_0xe5a5('0x4c')](db[_[_0xe5a5('0x77')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x75')][_0xe5a5('0x78')]())+_0xe5a5('0x79')]['rawAttributes']);_0xf1dfd1[_0xe5a5('0x36')]=_[_0xe5a5('0x4c')](_0x547462[_0xe5a5('0x36')]);_0xf1dfd1[_0xe5a5('0x37')]=_['intersection'](_0xf1dfd1[_0xe5a5('0x3a')],_0xf1dfd1[_0xe5a5('0x36')]);_0x3312b5[_0xe5a5('0x39')]=_[_0xe5a5('0x38')](_0xf1dfd1['model'],qs[_0xe5a5('0x3b')](_0x547462[_0xe5a5('0x36')]['fields']));_0x3312b5[_0xe5a5('0x39')]=_0x3312b5['attributes'][_0xe5a5('0x4d')]?_0x3312b5['attributes']:_0xf1dfd1[_0xe5a5('0x3a')];_0x3312b5['limit']=qs[_0xe5a5('0x25')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x25')]);_0x3312b5[_0xe5a5('0x22')]=qs[_0xe5a5('0x22')](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x22')]);_0x3312b5[_0xe5a5('0x3e')]=qs['sort'](_0x547462[_0xe5a5('0x36')][_0xe5a5('0x3f')]);_0x3312b5[_0xe5a5('0x40')]=qs[_0xe5a5('0x37')](_[_0xe5a5('0x41')](_0x547462['query'],_0xf1dfd1[_0xe5a5('0x37')]));_0x3312b5=_[_0xe5a5('0x43')]({},_0x3312b5,_0x547462[_0xe5a5('0x4e')]);return _0x31af60[_0xe5a5('0x52')+_[_0xe5a5('0x77')](_0x547462['query']['channel'][_0xe5a5('0x78')]())+_0xe5a5('0x7a')](_0x3312b5);})[_0xe5a5('0x2c')](respondWithResult(_0x3c722c,null))[_0xe5a5('0x49')](handleError(_0x3c722c,null));};exports[_0xe5a5('0x7b')]=function(_0xb62f7e,_0x144333,_0x349901){return db[_0xe5a5('0x33')][_0xe5a5('0x73')]({'where':{'id':_0xb62f7e[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](function(_0x332fd7){if(_0x332fd7){if(!_0xb62f7e[_0xe5a5('0x50')]['channel']||!utils[_0xe5a5('0x74')](_0xb62f7e['body'][_0xe5a5('0x75')])){throw new db[(_0xe5a5('0x5d'))]['ValidationError']('Unknown\x20channel');}return _0x332fd7[_0xe5a5('0x7c')+_[_0xe5a5('0x77')](_0xb62f7e[_0xe5a5('0x50')]['channel']['toLowerCase']())+_0xe5a5('0x7a')](_0xb62f7e[_0xe5a5('0x50')][_0xe5a5('0x7d')]);}return null;})[_0xe5a5('0x2c')](handleEntityNotFound(_0x144333,null))['then'](respondWithStatusCode(_0x144333,null))['catch'](handleError(_0x144333,null));};exports['removeQueues']=function(_0x39ec01,_0x5703f8,_0x294076){return db[_0xe5a5('0x33')]['findOne']({'where':{'id':_0x39ec01['params']['id']}})['then'](function(_0x46d302){if(_0x46d302){if(!_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x75')]||!utils['isValidChannel'](_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x75')])){throw new db[(_0xe5a5('0x5d'))][(_0xe5a5('0x76'))]('Unknown\x20channel');}return _0x46d302['remove'+_[_0xe5a5('0x77')](_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x75')][_0xe5a5('0x78')]())+_0xe5a5('0x7a')](_0x39ec01[_0xe5a5('0x36')][_0xe5a5('0x7d')]);}return null;})[_0xe5a5('0x2c')](handleEntityNotFound(_0x5703f8,null))[_0xe5a5('0x2c')](respondWithStatusCode(_0x5703f8,null))[_0xe5a5('0x49')](handleError(_0x5703f8,null));};exports['addAgents']=function(_0x65a89e,_0x1efc08){var _0x9d24c7=_[_0xe5a5('0x7e')](_0x65a89e[_0xe5a5('0x50')][_0xe5a5('0x7d')])?_0x65a89e[_0xe5a5('0x50')][_0xe5a5('0x7d')]:[_0x65a89e[_0xe5a5('0x50')][_0xe5a5('0x7d')]];var _0x49d0a9=_0x65a89e[_0xe5a5('0x4b')]['id'];return db['Team']['find']({'where':{'id':_0x49d0a9}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x1efc08,null))[_0xe5a5('0x2c')](function(_0x424f0b){if(_0x424f0b){var _0x50bf61=[_0xe5a5('0x7f'),_0xe5a5('0x80'),_0xe5a5('0x81'),_0xe5a5('0x82'),'Fax',_0xe5a5('0x83'),'Whatsapp'];return db[_0xe5a5('0x5b')][_0xe5a5('0x84')](function(_0x1036cd){var _0xedffa8=_[_0xe5a5('0x32')](_0x50bf61,function(_0xebd66f){var _0x1688fc={'attributes':['id',_0xe5a5('0x2f')]};if(_0xebd66f===_0xe5a5('0x7f')){_0x1688fc[_0xe5a5('0x85')]={'attributes':[_0xe5a5('0x86')]};}return _0x424f0b[_0xe5a5('0x52')+_0xebd66f+'Queues'](_0x1688fc)[_0xe5a5('0x2c')](function(_0x28557d){var _0x4b3fbe=_[_0xe5a5('0x32')](_0x28557d,function(_0xc8f918){var _0xe0042c=_['map'](_0x9d24c7,function(_0x4dda07){var _0x5a0e83={'where':{'UserId':_0x4dda07,[_0xebd66f+_0xe5a5('0x87')]:_0xc8f918['id']},'transaction':_0x1036cd};if(_0xebd66f==='Voice'){_0x5a0e83[_0xe5a5('0x1b')]={'penalty':_0xc8f918[_0xe5a5('0x88')][_0xe5a5('0x86')]};}return db[_0xe5a5('0x89')+_0xebd66f+'Queue'][_0xe5a5('0x8a')](_0x5a0e83)[_0xe5a5('0x2c')](function(){socket[_0xe5a5('0x8b')]('user'+_0xebd66f+'Queue:save',{'UserId':_0x4dda07,[_0xebd66f+_0xe5a5('0x87')]:_0xc8f918['id']});if(_0xebd66f!=='Voice'){return;}return db[_0xe5a5('0x89')]['findAll']({'where':{'id':_0x9d24c7,'online':0x1},'attributes':['id','name',_0xe5a5('0x8c'),_0xe5a5('0x8d'),_0xe5a5('0x8e')],'raw':!![]})[_0xe5a5('0x2c')](function(_0xbae6cb){var _0x1859f1=_[_0xe5a5('0x32')](_0xbae6cb,function(_0x4cdf4d){return db[_0xe5a5('0x8f')][_0xe5a5('0x90')]({'membername':_0x4cdf4d['name'],'UserId':_0x4cdf4d['id'],'queue_name':_0xc8f918[_0xe5a5('0x2f')],'VoiceQueueId':_0xc8f918['id'],'interface':_[_0xe5a5('0x91')](_0x4cdf4d[_0xe5a5('0x8e')])?util['format'](_0xe5a5('0x92'),_0x4cdf4d[_0xe5a5('0x2f')]):_0x4cdf4d[_0xe5a5('0x8e')],'paused':_0x4cdf4d[_0xe5a5('0x8d')]||![],'penalty':_0xc8f918[_0xe5a5('0x88')][_0xe5a5('0x86')]},{'transaction':_0x1036cd});});return Promise[_0xe5a5('0x93')](_0x1859f1);});});});return Promise[_0xe5a5('0x93')](_0xe0042c);});return Promise['all'](_0x4b3fbe);})[_0xe5a5('0x2c')](function(){return db[_0xe5a5('0x6f')][_0xe5a5('0x73')]({'where':{'teamId':_0x49d0a9}})[_0xe5a5('0x2c')](function(_0x488f97){if(_0x488f97){var _0x2ef72b=_[_0xe5a5('0x32')](_0x9d24c7,function(_0x1ca1ad){db[_0xe5a5('0x70')]['upsert']({'UserId':_0x1ca1ad,'VoicePrefixId':_0x488f97[_0xe5a5('0x71')]});});return Promise[_0xe5a5('0x93')](_0x2ef72b);}});});});return Promise[_0xe5a5('0x93')](_0xedffa8)[_0xe5a5('0x2c')](function(){return _0x424f0b['addAgents'](_0x9d24c7,{'transaction':_0x1036cd})[_0xe5a5('0x94')](function(_0x359ebe){return _0x359ebe;});});});}})[_0xe5a5('0x2c')](respondWithResult(_0x1efc08,null))[_0xe5a5('0x49')](handleError(_0x1efc08,null));};exports['removeAgents']=function(_0x381433,_0x1748c3){var _0x4fb665=_[_0xe5a5('0x7e')](_0x381433['query']['ids'])?_0x381433['query'][_0xe5a5('0x7d')]:[_0x381433['query'][_0xe5a5('0x7d')]];var _0x4c5d91=_0x381433[_0xe5a5('0x4b')]['id'];return db[_0xe5a5('0x33')][_0xe5a5('0x59')]({'where':{'id':_0x4c5d91}})[_0xe5a5('0x2c')](handleEntityNotFound(_0x1748c3,null))['then'](function(_0x21e940){if(_0x21e940){var _0x4a4c73=[_0xe5a5('0x7f'),_0xe5a5('0x80'),_0xe5a5('0x81'),_0xe5a5('0x82'),'Fax',_0xe5a5('0x83'),'Whatsapp'];return db[_0xe5a5('0x5b')][_0xe5a5('0x84')](function(_0xe9398b){var _0x2b8030=_[_0xe5a5('0x32')](_0x4a4c73,function(_0x171b4a){var _0x520289={'attributes':['id','name']};return _0x21e940[_0xe5a5('0x52')+_0x171b4a+_0xe5a5('0x7a')](_0x520289)['then'](function(_0x1a6d58){var _0x11c66e=_['map'](_0x1a6d58,function(_0x1773ea){return _0x1773ea['removeAgents'](_0x4fb665,{'transaction':_0xe9398b})['then'](function(){var _0x25cf45=_[_0xe5a5('0x32')](_0x4fb665,function(_0x2f1794){socket[_0xe5a5('0x8b')](_0xe5a5('0x51')+_0x171b4a+_0xe5a5('0x95'),{'UserId':Number(_0x2f1794),[_0x171b4a+_0xe5a5('0x87')]:_0x1773ea['id']});if(_0x171b4a!==_0xe5a5('0x7f')){return;}return db[_0xe5a5('0x8f')][_0xe5a5('0x5a')]({'where':{'VoiceQueueId':_0x1773ea['id'],'UserId':_0x2f1794},'transaction':_0xe9398b});});return Promise[_0xe5a5('0x93')](_0x25cf45);});});return Promise[_0xe5a5('0x93')](_0x11c66e);});});return Promise['all'](_0x2b8030)[_0xe5a5('0x2c')](function(){return _0x21e940[_0xe5a5('0x96')](_0x4fb665,{'transaction':_0xe9398b});})['then'](function(){return db[_0xe5a5('0x6f')][_0xe5a5('0x73')]({'where':{'teamId':_0x4c5d91}})[_0xe5a5('0x2c')](function(_0x3b49f8){if(_0x3b49f8){var _0x3a4ca7=_[_0xe5a5('0x32')](_0x4fb665,function(_0x5eb39f){db[_0xe5a5('0x70')][_0xe5a5('0x5a')]({'where':{'UserId':_0x5eb39f,'VoicePrefixId':_0x3b49f8['VoicePrefixId']}});});return Promise['all'](_0x3a4ca7);}});});});}})[_0xe5a5('0x2c')](respondWithStatusCode(_0x1748c3,null))[_0xe5a5('0x49')](handleError(_0x1748c3,null));};exports[_0xe5a5('0x97')]=function(_0x4c0aea,_0xc4cff5,_0x508729){var _0x59dad8={};var _0x1b272={};var _0x299649;var _0x3293ec;return db[_0xe5a5('0x33')][_0xe5a5('0x73')]({'where':{'id':_0x4c0aea[_0xe5a5('0x4b')]['id']}})[_0xe5a5('0x2c')](handleEntityNotFound(_0xc4cff5,null))[_0xe5a5('0x2c')](function(_0x467a28){if(_0x467a28){_0x299649=_0x467a28;_0x1b272['model']=_[_0xe5a5('0x4c')](db[_0xe5a5('0x89')][_0xe5a5('0x34')]);_0x1b272['query']=_['keys'](_0x4c0aea[_0xe5a5('0x36')]);_0x1b272[_0xe5a5('0x37')]=_['intersection'](_0x1b272['model'],_0x1b272[_0xe5a5('0x36')]);_0x59dad8[_0xe5a5('0x39')]=_[_0xe5a5('0x38')](_0x1b272[_0xe5a5('0x3a')],qs['fields'](_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x3b')]));_0x59dad8[_0xe5a5('0x39')]=_0x59dad8[_0xe5a5('0x39')][_0xe5a5('0x4d')]?_0x59dad8[_0xe5a5('0x39')]:_0x1b272['model'];_0x59dad8['order']=qs[_0xe5a5('0x3f')](_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x3f')]);_0x59dad8[_0xe5a5('0x40')]=qs['filters'](_['pick'](_0x4c0aea[_0xe5a5('0x36')],_0x1b272['filters']));if(_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x42')]){_0x59dad8[_0xe5a5('0x40')]=_[_0xe5a5('0x43')](_0x59dad8['where'],{'$or':_['map'](_0x59dad8[_0xe5a5('0x39')],function(_0xe68874){var _0xa86030={};_0xa86030[_0xe68874]={'$like':'%'+_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x42')]+'%'};return _0xa86030;})});}_0x59dad8=_[_0xe5a5('0x43')]({},_0x59dad8,_0x4c0aea[_0xe5a5('0x4e')]);return _0x299649[_0xe5a5('0x97')](_0x59dad8);}})['then'](function(_0xb49d46){if(_0xb49d46){_0x3293ec=_0xb49d46['length'];if(!_0x4c0aea[_0xe5a5('0x36')]['hasOwnProperty'](_0xe5a5('0x3d'))){_0x59dad8[_0xe5a5('0x25')]=qs[_0xe5a5('0x25')](_0x4c0aea[_0xe5a5('0x36')]['limit']);_0x59dad8[_0xe5a5('0x22')]=qs[_0xe5a5('0x22')](_0x4c0aea[_0xe5a5('0x36')][_0xe5a5('0x22')]);}return _0x299649[_0xe5a5('0x97')](_0x59dad8);}})[_0xe5a5('0x2c')](function(_0x5e607b){if(_0x5e607b){return _0x5e607b?{'count':_0x3293ec,'rows':_0x5e607b}:null;}})[_0xe5a5('0x2c')](respondWithResult(_0xc4cff5,null))[_0xe5a5('0x49')](handleError(_0xc4cff5,null));}; \ No newline at end of file +var _0xb732=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','name','send','index','Team','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','find','UserProfileResource','error','destroy','sequelize','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','getQueues','findOne','channel','ValidationError','capitalize','toLowerCase','Queues','addQueues','Unknown\x20channel','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','get','Queue','findOrCreate','emit','QueueId','online','voicePause','interface','upsert','isNil','TeamVoiceQueue','all','UserVoicePrefix','removeAgents','transaction','Queue:remove','UserVoiceQueueRt','getAgents','hasOwnProperty','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xb732,0x1b0));var _0x2b73=function(_0x275d6f,_0x52254d){_0x275d6f=_0x275d6f-0x0;var _0x3cd3e7=_0xb732[_0x275d6f];return _0x3cd3e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b73('0x0'));var zipdir=require(_0x2b73('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b73('0x2'));var moment=require(_0x2b73('0x3'));var BPromise=require(_0x2b73('0x4'));var Mustache=require(_0x2b73('0x5'));var util=require(_0x2b73('0x6'));var path=require(_0x2b73('0x7'));var sox=require(_0x2b73('0x8'));var csv=require(_0x2b73('0x9'));var ejs=require(_0x2b73('0xa'));var fs=require('fs');var fs_extra=require(_0x2b73('0xb'));var _=require(_0x2b73('0xc'));var squel=require(_0x2b73('0xd'));var crypto=require(_0x2b73('0xe'));var jsforce=require(_0x2b73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2b73('0x9'));var querystring=require(_0x2b73('0x10'));var Papa=require('papaparse');var Redis=require(_0x2b73('0x11'));var authService=require(_0x2b73('0x12'));var qs=require(_0x2b73('0x13'));var as=require(_0x2b73('0x14'));var hardwareService=require(_0x2b73('0x15'));var logger=require(_0x2b73('0x16'))('api');var utils=require(_0x2b73('0x17'));var config=require(_0x2b73('0x18'));var licenseUtil=require(_0x2b73('0x19'));var db=require(_0x2b73('0x1a'))['db'];config['redis']=_[_0x2b73('0x1b')](config['redis'],{'host':_0x2b73('0x1c'),'port':0x18eb});var socket=require(_0x2b73('0x1d'))(new Redis(config['redis']));require(_0x2b73('0x1e'))['register'](socket);function respondWithStatusCode(_0x5394c1,_0x26bda8){_0x26bda8=_0x26bda8||0xcc;return function(_0x5b88e8){if(_0x5b88e8){return _0x5394c1[_0x2b73('0x1f')](_0x26bda8);}return _0x5394c1['status'](_0x26bda8)[_0x2b73('0x20')]();};}function respondWithResult(_0x3b3197,_0x5f1c11){_0x5f1c11=_0x5f1c11||0xc8;return function(_0x160bfc){if(_0x160bfc){return _0x3b3197[_0x2b73('0x21')](_0x5f1c11)[_0x2b73('0x22')](_0x160bfc);}};}function respondWithFilteredResult(_0x1c4d43,_0x4c059e){return function(_0x18b0c0){if(_0x18b0c0){var _0x370dfd=typeof _0x4c059e[_0x2b73('0x23')]===_0x2b73('0x24')&&typeof _0x4c059e[_0x2b73('0x25')]===_0x2b73('0x24');var _0x454b6f=_0x18b0c0[_0x2b73('0x26')];var _0x5bf989=_0x370dfd?0x0:_0x4c059e[_0x2b73('0x23')];var _0xece6fe=_0x370dfd?_0x18b0c0[_0x2b73('0x26')]:_0x4c059e[_0x2b73('0x23')]+_0x4c059e[_0x2b73('0x25')];var _0x528e1e;if(_0xece6fe>=_0x454b6f){_0xece6fe=_0x454b6f;_0x528e1e=0xc8;}else{_0x528e1e=0xce;}_0x1c4d43[_0x2b73('0x21')](_0x528e1e);return _0x1c4d43[_0x2b73('0x27')](_0x2b73('0x28'),_0x5bf989+'-'+_0xece6fe+'/'+_0x454b6f)[_0x2b73('0x22')](_0x18b0c0);}return null;};}function patchUpdates(_0x4b1846){return function(_0x1617ae){try{jsonpatch['apply'](_0x1617ae,_0x4b1846,!![]);}catch(_0x1bcc92){return BPromise[_0x2b73('0x29')](_0x1bcc92);}return _0x1617ae[_0x2b73('0x2a')]();};}function saveUpdates(_0x50dd3f,_0x5c6c3f){return function(_0x2d1a71){if(_0x2d1a71){return _0x2d1a71[_0x2b73('0x2b')](_0x50dd3f)[_0x2b73('0x2c')](function(_0x5a5c56){return _0x5a5c56;});}return null;};}function handleEntityNotFound(_0xcc5b89,_0x490f85){return function(_0x167484){if(!_0x167484){_0xcc5b89[_0x2b73('0x1f')](0x194);}return _0x167484;};}function handleError(_0x5efe09,_0x35b6af){_0x35b6af=_0x35b6af||0x1f4;return function(_0x2bf7be){logger['error'](_0x2bf7be['stack']);if(_0x2bf7be['name']){delete _0x2bf7be[_0x2b73('0x2d')];}_0x5efe09['status'](_0x35b6af)[_0x2b73('0x2e')](_0x2bf7be);};}exports[_0x2b73('0x2f')]=function(_0x350a0a,_0x2c2b2c){var _0x2b6767={},_0x2baabd={},_0x39881a={'count':0x0,'rows':[]};var _0x1c6fc7=_['map'](db[_0x2b73('0x30')][_0x2b73('0x31')],function(_0x533b86){return{'name':_0x533b86['fieldName'],'type':_0x533b86[_0x2b73('0x32')]['key']};});_0x2baabd[_0x2b73('0x33')]=_[_0x2b73('0x34')](_0x1c6fc7,'name');_0x2baabd[_0x2b73('0x35')]=_['keys'](_0x350a0a[_0x2b73('0x35')]);_0x2baabd[_0x2b73('0x36')]=_[_0x2b73('0x37')](_0x2baabd[_0x2b73('0x33')],_0x2baabd['query']);_0x2b6767[_0x2b73('0x38')]=_[_0x2b73('0x37')](_0x2baabd[_0x2b73('0x33')],qs[_0x2b73('0x39')](_0x350a0a['query'][_0x2b73('0x39')]));_0x2b6767[_0x2b73('0x38')]=_0x2b6767['attributes'][_0x2b73('0x3a')]?_0x2b6767[_0x2b73('0x38')]:_0x2baabd[_0x2b73('0x33')];if(!_0x350a0a['query']['hasOwnProperty'](_0x2b73('0x3b'))){_0x2b6767[_0x2b73('0x25')]=qs[_0x2b73('0x25')](_0x350a0a[_0x2b73('0x35')]['limit']);_0x2b6767[_0x2b73('0x23')]=qs[_0x2b73('0x23')](_0x350a0a[_0x2b73('0x35')][_0x2b73('0x23')]);}_0x2b6767[_0x2b73('0x3c')]=qs[_0x2b73('0x3d')](_0x350a0a[_0x2b73('0x35')][_0x2b73('0x3d')]);_0x2b6767['where']=qs['filters'](_[_0x2b73('0x3e')](_0x350a0a[_0x2b73('0x35')],_0x2baabd[_0x2b73('0x36')]),_0x1c6fc7);if(_0x350a0a['query'][_0x2b73('0x3f')]){_0x2b6767[_0x2b73('0x40')]=_[_0x2b73('0x41')](_0x2b6767[_0x2b73('0x40')],{'$or':_[_0x2b73('0x34')](_0x1c6fc7,function(_0x58dd8f){if(_0x58dd8f[_0x2b73('0x32')]!=='VIRTUAL'){var _0x4cc26f={};_0x4cc26f[_0x58dd8f[_0x2b73('0x2d')]]={'$like':'%'+_0x350a0a[_0x2b73('0x35')][_0x2b73('0x3f')]+'%'};return _0x4cc26f;}})});}_0x2b6767=_['merge']({},_0x2b6767,_0x350a0a[_0x2b73('0x42')]);var _0x57b91b={'where':_0x2b6767[_0x2b73('0x40')]};return db[_0x2b73('0x30')]['count'](_0x57b91b)[_0x2b73('0x2c')](function(_0x36c121){_0x39881a[_0x2b73('0x26')]=_0x36c121;if(_0x350a0a[_0x2b73('0x35')][_0x2b73('0x43')]){_0x2b6767[_0x2b73('0x44')]=[{'all':!![]}];}return db[_0x2b73('0x30')][_0x2b73('0x45')](_0x2b6767);})[_0x2b73('0x2c')](function(_0x1161fb){_0x39881a[_0x2b73('0x46')]=_0x1161fb;return _0x39881a;})[_0x2b73('0x2c')](respondWithFilteredResult(_0x2c2b2c,_0x2b6767))[_0x2b73('0x47')](handleError(_0x2c2b2c,null));};exports['show']=function(_0x363348,_0x5bca5b){var _0x4f710c={'raw':![],'where':{'id':_0x363348[_0x2b73('0x48')]['id']}},_0x3d3d8b={};_0x3d3d8b['model']=_[_0x2b73('0x49')](db[_0x2b73('0x30')]['rawAttributes']);_0x3d3d8b[_0x2b73('0x35')]=_[_0x2b73('0x49')](_0x363348[_0x2b73('0x35')]);_0x3d3d8b['filters']=_[_0x2b73('0x37')](_0x3d3d8b['model'],_0x3d3d8b[_0x2b73('0x35')]);_0x4f710c[_0x2b73('0x38')]=_[_0x2b73('0x37')](_0x3d3d8b[_0x2b73('0x33')],qs[_0x2b73('0x39')](_0x363348[_0x2b73('0x35')][_0x2b73('0x39')]));_0x4f710c[_0x2b73('0x38')]=_0x4f710c[_0x2b73('0x38')]['length']?_0x4f710c[_0x2b73('0x38')]:_0x3d3d8b[_0x2b73('0x33')];if(_0x363348[_0x2b73('0x35')][_0x2b73('0x43')]){_0x4f710c['include']=[{'all':!![]}];}_0x4f710c=_[_0x2b73('0x41')]({},_0x4f710c,_0x363348['options']);return db['Team']['find'](_0x4f710c)[_0x2b73('0x2c')](handleEntityNotFound(_0x5bca5b,null))['then'](respondWithResult(_0x5bca5b,null))[_0x2b73('0x47')](handleError(_0x5bca5b,null));};exports[_0x2b73('0x4a')]=function(_0x1e54ba,_0x2cac7d){return db[_0x2b73('0x30')][_0x2b73('0x4a')](_0x1e54ba[_0x2b73('0x4b')],{})['then'](function(_0x31eba6){var _0x2dd7a5=_0x1e54ba[_0x2b73('0x4c')]['get']({'plain':!![]});if(!_0x2dd7a5)throw new Error(_0x2b73('0x4d'));if(_0x2dd7a5['role']===_0x2b73('0x4c')){var _0x3c064f=_0x31eba6['get']({'plain':!![]});var _0x4ac676=_0x2b73('0x4e');return db['UserProfileSection'][_0x2b73('0x4f')]({'where':{'name':_0x4ac676,'userProfileId':_0x2dd7a5['userProfileId']},'raw':!![]})[_0x2b73('0x2c')](function(_0x67c53){if(_0x67c53&&_0x67c53['autoAssociation']===0x0){return db[_0x2b73('0x50')]['create']({'name':_0x3c064f[_0x2b73('0x2d')],'resourceId':_0x3c064f['id'],'type':_0x67c53[_0x2b73('0x2d')],'sectionId':_0x67c53['id']},{})['then'](function(){return _0x31eba6;});}else{return _0x31eba6;}})['catch'](function(_0x53ba68){logger[_0x2b73('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53ba68);throw _0x53ba68;});}return _0x31eba6;})[_0x2b73('0x2c')](respondWithResult(_0x2cac7d,0xc9))[_0x2b73('0x47')](handleError(_0x2cac7d,null));};exports['update']=function(_0x153aa8,_0x477f7f){if(_0x153aa8[_0x2b73('0x4b')]['id']){delete _0x153aa8[_0x2b73('0x4b')]['id'];}return db[_0x2b73('0x30')]['find']({'where':{'id':_0x153aa8[_0x2b73('0x48')]['id']}})['then'](handleEntityNotFound(_0x477f7f,null))[_0x2b73('0x2c')](saveUpdates(_0x153aa8[_0x2b73('0x4b')],null))[_0x2b73('0x2c')](respondWithResult(_0x477f7f,null))[_0x2b73('0x47')](handleError(_0x477f7f,null));};exports[_0x2b73('0x52')]=function(_0x42890e,_0x4c3a4d){var _0x54cf35=_0x42890e[_0x2b73('0x48')]['id'];var _0x4fd819=[];return db[_0x2b73('0x53')]['transaction'](function(_0x27067a){var _0x5ce80b='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x5ce80b,{'type':db[_0x2b73('0x54')][_0x2b73('0x55')][_0x2b73('0x56')],'raw':!![],'transaction':_0x27067a})[_0x2b73('0x2c')](function(_0x41e182){_0x4fd819=_[_0x2b73('0x34')](_0x41e182,function(_0x1ae7fa){return Number(_0x1ae7fa['UserId']);});})['then'](function(){var _0x58bbc6=_0x2b73('0x57')+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x58bbc6,{'type':db[_0x2b73('0x54')][_0x2b73('0x55')][_0x2b73('0x56')],'raw':!![],'transaction':_0x27067a});})[_0x2b73('0x2c')](function(_0x2c8fb3){var _0x3e7d68=_[_0x2b73('0x34')](_0x2c8fb3,function(_0x13b09a){return Number(_0x13b09a[_0x2b73('0x58')]);});return db[_0x2b73('0x59')]['destroy']({'where':{'UserId':{'$in':_0x4fd819},'VoiceQueueId':{'$in':_0x3e7d68}},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){var _0x1e8522=_0x2b73('0x5a')+_0x54cf35;return db['sequelize']['query'](_0x1e8522,{'type':db[_0x2b73('0x54')][_0x2b73('0x55')]['SELECT'],'raw':!![],'transaction':_0x27067a});})['then'](function(_0x5d69fb){var _0x26fc1f=_['map'](_0x5d69fb,function(_0x34d724){return Number(_0x34d724[_0x2b73('0x5b')]);});return db[_0x2b73('0x5c')][_0x2b73('0x52')]({'where':{'UserId':{'$in':_0x4fd819},'MailQueueId':{'$in':_0x26fc1f}},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){var _0x4ea6e8=_0x2b73('0x5d')+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x4ea6e8,{'type':db[_0x2b73('0x54')][_0x2b73('0x55')][_0x2b73('0x56')],'raw':!![],'transaction':_0x27067a});})['then'](function(_0x109821){var _0x1a8215=_[_0x2b73('0x34')](_0x109821,function(_0x4140a3){return Number(_0x4140a3[_0x2b73('0x5e')]);});return db['UserSmsQueue'][_0x2b73('0x52')]({'where':{'UserId':{'$in':_0x4fd819},'SmsQueueId':{'$in':_0x1a8215}},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){var _0x474412=_0x2b73('0x5f')+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x474412,{'type':db['Sequelize'][_0x2b73('0x55')]['SELECT'],'raw':!![],'transaction':_0x27067a});})[_0x2b73('0x2c')](function(_0x3bd321){var _0x3965b9=_[_0x2b73('0x34')](_0x3bd321,function(_0x18f55d){return Number(_0x18f55d[_0x2b73('0x60')]);});return db['UserChatQueue'][_0x2b73('0x52')]({'where':{'UserId':{'$in':_0x4fd819},'ChatQueueId':{'$in':_0x3965b9}},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){var _0x19eb87='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x19eb87,{'type':db[_0x2b73('0x54')][_0x2b73('0x55')][_0x2b73('0x56')],'raw':!![],'transaction':_0x27067a});})[_0x2b73('0x2c')](function(_0x2a93de){var _0x32d929=_[_0x2b73('0x34')](_0x2a93de,function(_0x4b352c){return Number(_0x4b352c[_0x2b73('0x61')]);});return db[_0x2b73('0x62')][_0x2b73('0x52')]({'where':{'UserId':{'$in':_0x4fd819},'FaxQueueId':{'$in':_0x32d929}},'transaction':_0x27067a});})['then'](function(){var _0x5a221b=_0x2b73('0x63')+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x5a221b,{'type':db['Sequelize'][_0x2b73('0x55')][_0x2b73('0x56')],'raw':!![],'transaction':_0x27067a});})[_0x2b73('0x2c')](function(_0x553dd0){var _0x2732f2=_[_0x2b73('0x34')](_0x553dd0,function(_0x7b95b){return Number(_0x7b95b[_0x2b73('0x64')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x4fd819},'OpenchannelQueueId':{'$in':_0x2732f2}},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){var _0x2daf18=_0x2b73('0x65')+_0x54cf35;return db[_0x2b73('0x53')][_0x2b73('0x35')](_0x2daf18,{'type':db[_0x2b73('0x54')][_0x2b73('0x55')]['SELECT'],'raw':!![],'transaction':_0x27067a});})['then'](function(_0xbf92be){var _0x19b194=_[_0x2b73('0x34')](_0xbf92be,function(_0x3d23c5){return Number(_0x3d23c5[_0x2b73('0x66')]);});return db[_0x2b73('0x67')][_0x2b73('0x52')]({'where':{'UserId':{'$in':_0x4fd819},'WhatsappQueueId':{'$in':_0x19b194}},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){return db[_0x2b73('0x68')][_0x2b73('0x4f')]({'where':{'TeamId':_0x54cf35}});})[_0x2b73('0x2c')](function(_0x246137){if(_0x246137===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x4fd819},'VoicePrefixId':_0x246137[_0x2b73('0x69')]},'transaction':_0x27067a});})[_0x2b73('0x2c')](function(){return db['Team']['destroy']({'where':{'id':_0x54cf35},'cascade':!![],'transaction':_0x27067a});})[_0x2b73('0x2c')](function(_0x1f6d8b){if(_0x1f6d8b===0x0){_0x4c3a4d[_0x2b73('0x1f')](0x194);}else{return db[_0x2b73('0x50')][_0x2b73('0x52')]({'where':{'type':_0x2b73('0x4e'),'resourceId':_0x54cf35},'cascade':!![],'transaction':_0x27067a})[_0x2b73('0x2c')](function(){_0x4c3a4d[_0x2b73('0x21')](0xcc)[_0x2b73('0x20')]();});}})[_0x2b73('0x47')](function(_0x415df7){_0x4c3a4d[_0x2b73('0x21')](0x1f4)[_0x2b73('0x2e')](_0x415df7);});});};exports[_0x2b73('0x6a')]=function(_0x2002da,_0x1e586a,_0x458e49){return db['Team'][_0x2b73('0x6b')]({'where':{'id':_0x2002da[_0x2b73('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e586a,null))[_0x2b73('0x2c')](function(_0xe46f81){if(!_0x2002da[_0x2b73('0x35')][_0x2b73('0x6c')]||!utils['isValidChannel'](_0x2002da[_0x2b73('0x35')][_0x2b73('0x6c')])){throw new db[(_0x2b73('0x54'))][(_0x2b73('0x6d'))]('Unknown\x20channel');}var _0x6ef3fe={};var _0x463a8c={};_0x463a8c[_0x2b73('0x33')]=_[_0x2b73('0x49')](db[_[_0x2b73('0x6e')](_0x2002da[_0x2b73('0x35')][_0x2b73('0x6c')][_0x2b73('0x6f')]())+'Queue']['rawAttributes']);_0x463a8c['query']=_[_0x2b73('0x49')](_0x2002da[_0x2b73('0x35')]);_0x463a8c['filters']=_[_0x2b73('0x37')](_0x463a8c[_0x2b73('0x33')],_0x463a8c['query']);_0x6ef3fe['attributes']=_['intersection'](_0x463a8c[_0x2b73('0x33')],qs[_0x2b73('0x39')](_0x2002da[_0x2b73('0x35')][_0x2b73('0x39')]));_0x6ef3fe[_0x2b73('0x38')]=_0x6ef3fe[_0x2b73('0x38')][_0x2b73('0x3a')]?_0x6ef3fe[_0x2b73('0x38')]:_0x463a8c['model'];_0x6ef3fe[_0x2b73('0x25')]=qs['limit'](_0x2002da[_0x2b73('0x35')][_0x2b73('0x25')]);_0x6ef3fe['offset']=qs[_0x2b73('0x23')](_0x2002da['query']['offset']);_0x6ef3fe[_0x2b73('0x3c')]=qs[_0x2b73('0x3d')](_0x2002da[_0x2b73('0x35')]['sort']);_0x6ef3fe['where']=qs['filters'](_[_0x2b73('0x3e')](_0x2002da[_0x2b73('0x35')],_0x463a8c[_0x2b73('0x36')]));_0x6ef3fe=_[_0x2b73('0x41')]({},_0x6ef3fe,_0x2002da[_0x2b73('0x42')]);return _0xe46f81['get'+_[_0x2b73('0x6e')](_0x2002da[_0x2b73('0x35')][_0x2b73('0x6c')][_0x2b73('0x6f')]())+_0x2b73('0x70')](_0x6ef3fe);})[_0x2b73('0x2c')](respondWithResult(_0x1e586a,null))[_0x2b73('0x47')](handleError(_0x1e586a,null));};exports[_0x2b73('0x71')]=function(_0x1fd8b8,_0x19ef73,_0x1ba1cd){return db['Team'][_0x2b73('0x6b')]({'where':{'id':_0x1fd8b8[_0x2b73('0x48')]['id']}})[_0x2b73('0x2c')](function(_0x37099c){if(_0x37099c){if(!_0x1fd8b8['body'][_0x2b73('0x6c')]||!utils['isValidChannel'](_0x1fd8b8['body'][_0x2b73('0x6c')])){throw new db[(_0x2b73('0x54'))]['ValidationError'](_0x2b73('0x72'));}return _0x37099c['add'+_['capitalize'](_0x1fd8b8[_0x2b73('0x4b')][_0x2b73('0x6c')][_0x2b73('0x6f')]())+_0x2b73('0x70')](_0x1fd8b8[_0x2b73('0x4b')][_0x2b73('0x73')]);}return null;})[_0x2b73('0x2c')](handleEntityNotFound(_0x19ef73,null))[_0x2b73('0x2c')](respondWithStatusCode(_0x19ef73,null))[_0x2b73('0x47')](handleError(_0x19ef73,null));};exports[_0x2b73('0x74')]=function(_0x4b2e9b,_0x22b033,_0x269ee5){return db[_0x2b73('0x30')][_0x2b73('0x6b')]({'where':{'id':_0x4b2e9b['params']['id']}})['then'](function(_0x293e61){if(_0x293e61){if(!_0x4b2e9b[_0x2b73('0x35')][_0x2b73('0x6c')]||!utils['isValidChannel'](_0x4b2e9b[_0x2b73('0x35')][_0x2b73('0x6c')])){throw new db[(_0x2b73('0x54'))][(_0x2b73('0x6d'))](_0x2b73('0x72'));}return _0x293e61[_0x2b73('0x75')+_[_0x2b73('0x6e')](_0x4b2e9b[_0x2b73('0x35')][_0x2b73('0x6c')][_0x2b73('0x6f')]())+_0x2b73('0x70')](_0x4b2e9b[_0x2b73('0x35')][_0x2b73('0x73')]);}return null;})[_0x2b73('0x2c')](handleEntityNotFound(_0x22b033,null))['then'](respondWithStatusCode(_0x22b033,null))[_0x2b73('0x47')](handleError(_0x22b033,null));};exports[_0x2b73('0x76')]=function(_0x20ddb4,_0x15420b){var _0xe19531=_[_0x2b73('0x77')](_0x20ddb4[_0x2b73('0x4b')][_0x2b73('0x73')])?_0x20ddb4['body'][_0x2b73('0x73')]:[_0x20ddb4[_0x2b73('0x4b')][_0x2b73('0x73')]];var _0x4d6aff=_0x20ddb4[_0x2b73('0x48')]['id'];return db[_0x2b73('0x30')]['find']({'where':{'id':_0x4d6aff}})['then'](handleEntityNotFound(_0x15420b,null))[_0x2b73('0x2c')](function(_0x1c3bf9){if(_0x1c3bf9){var _0x2882b8=[_0x2b73('0x78'),_0x2b73('0x79'),_0x2b73('0x7a'),_0x2b73('0x7b'),_0x2b73('0x7c'),_0x2b73('0x7d'),_0x2b73('0x7e')];return db['sequelize']['transaction'](function(_0x543e46){var _0x5598cf=_[_0x2b73('0x34')](_0x2882b8,function(_0x2b0857){var _0xd2e358={'attributes':['id',_0x2b73('0x2d')]};if(_0x2b0857==='Voice'){_0xd2e358[_0x2b73('0x7f')]={'attributes':[_0x2b73('0x80')]};}return _0x1c3bf9[_0x2b73('0x81')+_0x2b0857+_0x2b73('0x70')](_0xd2e358)[_0x2b73('0x2c')](function(_0x3ffbc5){var _0x5095d2=_[_0x2b73('0x34')](_0x3ffbc5,function(_0x501143){var _0x3f5003=_[_0x2b73('0x34')](_0xe19531,function(_0x46f97d){var _0x44c85b={'where':{'UserId':_0x46f97d,[_0x2b0857+'QueueId']:_0x501143['id']},'transaction':_0x543e46};if(_0x2b0857===_0x2b73('0x78')){_0x44c85b[_0x2b73('0x1b')]={'penalty':_0x501143['TeamVoiceQueue'][_0x2b73('0x80')]};}return db['User'+_0x2b0857+_0x2b73('0x82')][_0x2b73('0x83')](_0x44c85b)[_0x2b73('0x2c')](function(){socket[_0x2b73('0x84')](_0x2b73('0x4c')+_0x2b0857+'Queue:save',{'UserId':_0x46f97d,[_0x2b0857+_0x2b73('0x85')]:_0x501143['id']});if(_0x2b0857!==_0x2b73('0x78')){return;}return db['User'][_0x2b73('0x45')]({'where':{'id':_0xe19531,'online':0x1},'attributes':['id',_0x2b73('0x2d'),_0x2b73('0x86'),_0x2b73('0x87'),_0x2b73('0x88')],'raw':!![]})[_0x2b73('0x2c')](function(_0x4a1689){var _0x1b8027=_[_0x2b73('0x34')](_0x4a1689,function(_0x30855d){return db['UserVoiceQueueRt'][_0x2b73('0x89')]({'membername':_0x30855d[_0x2b73('0x2d')],'UserId':_0x30855d['id'],'queue_name':_0x501143[_0x2b73('0x2d')],'VoiceQueueId':_0x501143['id'],'interface':_[_0x2b73('0x8a')](_0x30855d[_0x2b73('0x88')])?util['format']('SIP/%s',_0x30855d['name']):_0x30855d[_0x2b73('0x88')],'paused':_0x30855d['voicePause']||![],'penalty':_0x501143[_0x2b73('0x8b')][_0x2b73('0x80')]},{'transaction':_0x543e46});});return Promise['all'](_0x1b8027);});});});return Promise[_0x2b73('0x8c')](_0x3f5003);});return Promise[_0x2b73('0x8c')](_0x5095d2);})[_0x2b73('0x2c')](function(){return db[_0x2b73('0x68')][_0x2b73('0x6b')]({'where':{'teamId':_0x4d6aff}})['then'](function(_0x27973b){if(_0x27973b){var _0x1e9dd9=_[_0x2b73('0x34')](_0xe19531,function(_0x3fe48c){db[_0x2b73('0x8d')]['upsert']({'UserId':_0x3fe48c,'VoicePrefixId':_0x27973b[_0x2b73('0x69')]});});return Promise[_0x2b73('0x8c')](_0x1e9dd9);}});});});return Promise[_0x2b73('0x8c')](_0x5598cf)['then'](function(){return _0x1c3bf9[_0x2b73('0x76')](_0xe19531,{'transaction':_0x543e46})['spread'](function(_0x42ddd1){return _0x42ddd1;});});});}})[_0x2b73('0x2c')](respondWithResult(_0x15420b,null))[_0x2b73('0x47')](handleError(_0x15420b,null));};exports[_0x2b73('0x8e')]=function(_0x4aa274,_0xeca738){var _0xc4d7fd=_[_0x2b73('0x77')](_0x4aa274[_0x2b73('0x35')][_0x2b73('0x73')])?_0x4aa274['query'][_0x2b73('0x73')]:[_0x4aa274[_0x2b73('0x35')][_0x2b73('0x73')]];var _0x49f19b=_0x4aa274[_0x2b73('0x48')]['id'];return db['Team']['find']({'where':{'id':_0x49f19b}})[_0x2b73('0x2c')](handleEntityNotFound(_0xeca738,null))['then'](function(_0x163bb8){if(_0x163bb8){var _0x3feb8f=[_0x2b73('0x78'),_0x2b73('0x79'),_0x2b73('0x7a'),_0x2b73('0x7b'),_0x2b73('0x7c'),_0x2b73('0x7d'),_0x2b73('0x7e')];return db[_0x2b73('0x53')][_0x2b73('0x8f')](function(_0x20c814){var _0x18b0ba=_[_0x2b73('0x34')](_0x3feb8f,function(_0x42fcca){var _0xbe388={'attributes':['id',_0x2b73('0x2d')]};return _0x163bb8[_0x2b73('0x81')+_0x42fcca+_0x2b73('0x70')](_0xbe388)['then'](function(_0x2d0f65){var _0x3039c0=_[_0x2b73('0x34')](_0x2d0f65,function(_0x2970d3){return _0x2970d3[_0x2b73('0x8e')](_0xc4d7fd,{'transaction':_0x20c814})['then'](function(){var _0x238f1c=_['map'](_0xc4d7fd,function(_0x2ba9b0){socket[_0x2b73('0x84')](_0x2b73('0x4c')+_0x42fcca+_0x2b73('0x90'),{'UserId':Number(_0x2ba9b0),[_0x42fcca+_0x2b73('0x85')]:_0x2970d3['id']});if(_0x42fcca!==_0x2b73('0x78')){return;}return db[_0x2b73('0x91')][_0x2b73('0x52')]({'where':{'VoiceQueueId':_0x2970d3['id'],'UserId':_0x2ba9b0},'transaction':_0x20c814});});return Promise[_0x2b73('0x8c')](_0x238f1c);});});return Promise[_0x2b73('0x8c')](_0x3039c0);});});return Promise['all'](_0x18b0ba)[_0x2b73('0x2c')](function(){return _0x163bb8[_0x2b73('0x8e')](_0xc4d7fd,{'transaction':_0x20c814});})['then'](function(){return db['TeamVoicePrefix'][_0x2b73('0x6b')]({'where':{'teamId':_0x49f19b}})[_0x2b73('0x2c')](function(_0x4002dc){if(_0x4002dc){var _0x295573=_[_0x2b73('0x34')](_0xc4d7fd,function(_0x5860be){db[_0x2b73('0x8d')][_0x2b73('0x52')]({'where':{'UserId':_0x5860be,'VoicePrefixId':_0x4002dc[_0x2b73('0x69')]}});});return Promise['all'](_0x295573);}});});});}})[_0x2b73('0x2c')](respondWithStatusCode(_0xeca738,null))[_0x2b73('0x47')](handleError(_0xeca738,null));};exports['getAgents']=function(_0x622158,_0x1c172c,_0x28c58c){var _0x4d5062={};var _0x281397={};var _0x25e008;var _0x41f4e4;return db['Team']['findOne']({'where':{'id':_0x622158[_0x2b73('0x48')]['id']}})[_0x2b73('0x2c')](handleEntityNotFound(_0x1c172c,null))[_0x2b73('0x2c')](function(_0x2a5f39){if(_0x2a5f39){_0x25e008=_0x2a5f39;_0x281397[_0x2b73('0x33')]=_[_0x2b73('0x49')](db['User'][_0x2b73('0x31')]);_0x281397[_0x2b73('0x35')]=_[_0x2b73('0x49')](_0x622158[_0x2b73('0x35')]);_0x281397[_0x2b73('0x36')]=_[_0x2b73('0x37')](_0x281397[_0x2b73('0x33')],_0x281397[_0x2b73('0x35')]);_0x4d5062[_0x2b73('0x38')]=_[_0x2b73('0x37')](_0x281397['model'],qs[_0x2b73('0x39')](_0x622158[_0x2b73('0x35')][_0x2b73('0x39')]));_0x4d5062[_0x2b73('0x38')]=_0x4d5062[_0x2b73('0x38')]['length']?_0x4d5062[_0x2b73('0x38')]:_0x281397[_0x2b73('0x33')];_0x4d5062[_0x2b73('0x3c')]=qs[_0x2b73('0x3d')](_0x622158[_0x2b73('0x35')][_0x2b73('0x3d')]);_0x4d5062[_0x2b73('0x40')]=qs['filters'](_[_0x2b73('0x3e')](_0x622158['query'],_0x281397[_0x2b73('0x36')]));if(_0x622158[_0x2b73('0x35')][_0x2b73('0x3f')]){_0x4d5062[_0x2b73('0x40')]=_[_0x2b73('0x41')](_0x4d5062[_0x2b73('0x40')],{'$or':_[_0x2b73('0x34')](_0x4d5062[_0x2b73('0x38')],function(_0x57a80c){var _0x3fb62b={};_0x3fb62b[_0x57a80c]={'$like':'%'+_0x622158[_0x2b73('0x35')][_0x2b73('0x3f')]+'%'};return _0x3fb62b;})});}_0x4d5062=_['merge']({},_0x4d5062,_0x622158[_0x2b73('0x42')]);return _0x25e008[_0x2b73('0x92')](_0x4d5062);}})[_0x2b73('0x2c')](function(_0x47ed98){if(_0x47ed98){_0x41f4e4=_0x47ed98[_0x2b73('0x3a')];if(!_0x622158[_0x2b73('0x35')][_0x2b73('0x93')](_0x2b73('0x3b'))){_0x4d5062[_0x2b73('0x25')]=qs[_0x2b73('0x25')](_0x622158[_0x2b73('0x35')]['limit']);_0x4d5062[_0x2b73('0x23')]=qs[_0x2b73('0x23')](_0x622158[_0x2b73('0x35')][_0x2b73('0x23')]);}return _0x25e008[_0x2b73('0x92')](_0x4d5062);}})[_0x2b73('0x2c')](function(_0x2c91e1){if(_0x2c91e1){return _0x2c91e1?{'count':_0x41f4e4,'rows':_0x2c91e1}:null;}})[_0x2b73('0x2c')](respondWithResult(_0x1c172c,null))[_0x2b73('0x47')](handleError(_0x1c172c,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 9df69dd..c51d632 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 _0x1ba8=['hasOwnProperty','hook','events','../../mysqldb','Team','setMaxListeners','save','remove','emit'];(function(_0x542b6b,_0x4eee55){var _0x17dddc=function(_0x2389ed){while(--_0x2389ed){_0x542b6b['push'](_0x542b6b['shift']());}};_0x17dddc(++_0x4eee55);}(_0x1ba8,0x89));var _0x81ba=function(_0x9b1a2,_0x4fc8c1){_0x9b1a2=_0x9b1a2-0x0;var _0x2feb67=_0x1ba8[_0x9b1a2];return _0x2feb67;};'use strict';var EventEmitter=require(_0x81ba('0x0'));var Team=require(_0x81ba('0x1'))['db'][_0x81ba('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x81ba('0x3')](0x0);var events={'afterCreate':_0x81ba('0x4'),'afterUpdate':'update','afterDestroy':_0x81ba('0x5')};function emitEvent(_0x770930){return function(_0x15c750,_0x193024,_0x2a9aa4){TeamEvents[_0x81ba('0x6')](_0x770930+':'+_0x15c750['id'],_0x15c750);TeamEvents[_0x81ba('0x6')](_0x770930,_0x15c750);_0x2a9aa4(null);};}for(var e in events){if(events[_0x81ba('0x7')](e)){var event=events[e];Team[_0x81ba('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xc141=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team'];(function(_0x72c92b,_0x3246fa){var _0x260995=function(_0x4b6e3c){while(--_0x4b6e3c){_0x72c92b['push'](_0x72c92b['shift']());}};_0x260995(++_0x3246fa);}(_0xc141,0x6b));var _0x1c14=function(_0x1c63a9,_0x49726c){_0x1c63a9=_0x1c63a9-0x0;var _0x4a3b03=_0xc141[_0x1c63a9];return _0x4a3b03;};'use strict';var EventEmitter=require(_0x1c14('0x0'));var Team=require(_0x1c14('0x1'))['db'][_0x1c14('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x1c14('0x3')](0x0);var events={'afterCreate':_0x1c14('0x4'),'afterUpdate':_0x1c14('0x5'),'afterDestroy':_0x1c14('0x6')};function emitEvent(_0x404c69){return function(_0x344e0f,_0x4b8b82,_0x3ba320){TeamEvents['emit'](_0x404c69+':'+_0x344e0f['id'],_0x344e0f);TeamEvents[_0x1c14('0x7')](_0x404c69,_0x344e0f);_0x3ba320(null);};}for(var e in events){if(events[_0x1c14('0x8')](e)){var event=events[e];Team[_0x1c14('0x9')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0ca5706..591e2a5 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 _0xdda5=['catch','exports','define','Team','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','map','all','./team.attributes','get','Queues','then','setDataValue'];(function(_0x4f23a5,_0x59b1f6){var _0x8d6574=function(_0x4b97ee){while(--_0x4b97ee){_0x4f23a5['push'](_0x4f23a5['shift']());}};_0x8d6574(++_0x59b1f6);}(_0xdda5,0xc1));var _0x5dda=function(_0x5beb1e,_0x5e9d6c){_0x5beb1e=_0x5beb1e-0x0;var _0x4d034b=_0xdda5[_0x5beb1e];return _0x4d034b;};'use strict';var _=require('lodash');var attributes=require(_0x5dda('0x0'));function getQueuesByChannel(_0x8ea1df,_0x40d02b){var _0xeefb49=_0x5dda('0x1')+_0x40d02b+_0x5dda('0x2');return _0x8ea1df[_0xeefb49]()[_0x5dda('0x3')](function(_0x48c249){return _['map'](_0x48c249,function(_0x2c907a){_0x2c907a[_0x5dda('0x4')]('channel',_0x40d02b);return _0x2c907a;});})[_0x5dda('0x5')](function(_0xb9919c){throw _0xb9919c;});}module[_0x5dda('0x6')]=function(_0x40efd3){return _0x40efd3[_0x5dda('0x7')](_0x5dda('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4d5b0b=this;var _0x576de1=[_0x5dda('0x9'),_0x5dda('0xa'),_0x5dda('0xb'),_0x5dda('0xc'),_0x5dda('0xd'),_0x5dda('0xe'),_0x5dda('0xf')];return Promise['resolve']()[_0x5dda('0x3')](function(){var _0x71e578=_[_0x5dda('0x10')](_0x576de1,function(_0x4ec920){return getQueuesByChannel(_0x4d5b0b,_0x4ec920);});return Promise[_0x5dda('0x11')](_0x71e578);})[_0x5dda('0x5')](function(_0x54ddf0){throw _0x54ddf0;});}}});}; \ No newline at end of file +var _0x30c7=['exports','define','Team','teams','Fax','Mail','Sms','Voice','Whatsapp','resolve','then','all','catch','lodash','get','map','setDataValue','channel'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x30c7,0x1f3));var _0x730c=function(_0x4a2daa,_0x3dfebd){_0x4a2daa=_0x4a2daa-0x0;var _0x5358cc=_0x30c7[_0x4a2daa];return _0x5358cc;};'use strict';var _=require(_0x730c('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x19ad55,_0x290b99){var _0x2fc945=_0x730c('0x1')+_0x290b99+'Queues';return _0x19ad55[_0x2fc945]()['then'](function(_0xdc5a15){return _[_0x730c('0x2')](_0xdc5a15,function(_0xf9b4cd){_0xf9b4cd[_0x730c('0x3')](_0x730c('0x4'),_0x290b99);return _0xf9b4cd;});})['catch'](function(_0x59b622){throw _0x59b622;});}module[_0x730c('0x5')]=function(_0x13a3ca){return _0x13a3ca[_0x730c('0x6')](_0x730c('0x7'),attributes,{'tableName':_0x730c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2b66dd=this;var _0x475a59=['Chat',_0x730c('0x9'),_0x730c('0xa'),'Openchannel',_0x730c('0xb'),_0x730c('0xc'),_0x730c('0xd')];return Promise[_0x730c('0xe')]()[_0x730c('0xf')](function(){var _0x54d831=_[_0x730c('0x2')](_0x475a59,function(_0x1595b1){return getQueuesByChannel(_0x2b66dd,_0x1595b1);});return Promise[_0x730c('0x10')](_0x54d831);})[_0x730c('0x11')](function(_0x316de1){throw _0x316de1;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 4cea48c..18af9bf 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 _0xb498=['localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/logger','jayson/promise','http','redis'];(function(_0x133ee2,_0x1365ff){var _0x28e86f=function(_0x162938){while(--_0x162938){_0x133ee2['push'](_0x133ee2['shift']());}};_0x28e86f(++_0x1365ff);}(_0xb498,0x6b));var _0x8b49=function(_0x3f081d,_0x59d70b){_0x3f081d=_0x3f081d-0x0;var _0xfb386a=_0xb498[_0x3f081d];return _0xfb386a;};'use strict';var _=require(_0x8b49('0x0'));var util=require(_0x8b49('0x1'));var moment=require('moment');var BPromise=require(_0x8b49('0x2'));var rs=require(_0x8b49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b49('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b49('0x5'));var client=jayson['client'][_0x8b49('0x6')]({'port':0x232a});config[_0x8b49('0x7')]=_['defaults'](config[_0x8b49('0x7')],{'host':_0x8b49('0x8'),'port':0x18eb});var socket=require(_0x8b49('0x9'))(new Redis(config[_0x8b49('0x7')]));require(_0x8b49('0xa'))[_0x8b49('0xb')](socket);function respondWithRpcPromise(_0x56b8dd,_0x1d5b22,_0x5f5abd){return new BPromise(function(_0x31f30d,_0x21d65a){return client[_0x8b49('0xc')](_0x56b8dd,_0x5f5abd)[_0x8b49('0xd')](function(_0x4ea323){logger[_0x8b49('0xe')]('Team,\x20%s,\x20%s',_0x1d5b22,'request\x20sent');logger['debug'](_0x8b49('0xf'),_0x1d5b22,_0x8b49('0x10'),JSON['stringify'](_0x4ea323));if(_0x4ea323['error']){if(_0x4ea323[_0x8b49('0x11')][_0x8b49('0x12')]===0x1f4){logger[_0x8b49('0x11')](_0x8b49('0x13'),_0x1d5b22,_0x4ea323[_0x8b49('0x11')][_0x8b49('0x14')]);return _0x21d65a(_0x4ea323[_0x8b49('0x11')][_0x8b49('0x14')]);}logger[_0x8b49('0x11')](_0x8b49('0x13'),_0x1d5b22,_0x4ea323['error'][_0x8b49('0x14')]);return _0x31f30d(_0x4ea323[_0x8b49('0x11')][_0x8b49('0x14')]);}else{logger['info'](_0x8b49('0x13'),_0x1d5b22,_0x8b49('0x10'));_0x31f30d(_0x4ea323[_0x8b49('0x15')]['message']);}})[_0x8b49('0x16')](function(_0x3390bd){logger[_0x8b49('0x11')](_0x8b49('0x13'),_0x1d5b22,_0x3390bd);_0x21d65a(_0x3390bd);});});} \ No newline at end of file +var _0x2c38=['lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./team.socket','register','request','then','info','stringify','error','code','Team,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x4b3e49,_0x9e566c){var _0x57e339=function(_0x1430e9){while(--_0x1430e9){_0x4b3e49['push'](_0x4b3e49['shift']());}};_0x57e339(++_0x9e566c);}(_0x2c38,0x177));var _0x82c3=function(_0x50ae21,_0x4cecaf){_0x50ae21=_0x50ae21-0x0;var _0x164e2a=_0x2c38[_0x50ae21];return _0x164e2a;};'use strict';var _=require(_0x82c3('0x0'));var util=require(_0x82c3('0x1'));var moment=require(_0x82c3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82c3('0x3'));var db=require(_0x82c3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82c3('0x5'))(_0x82c3('0x6'));var config=require(_0x82c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x82c3('0x8')][_0x82c3('0x9')]({'port':0x232a});config[_0x82c3('0xa')]=_['defaults'](config[_0x82c3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x82c3('0xb'))(new Redis(config['redis']));require(_0x82c3('0xc'))[_0x82c3('0xd')](socket);function respondWithRpcPromise(_0x3bab8a,_0x4cd674,_0xff46db){return new BPromise(function(_0x492c85,_0x1ddb0e){return client[_0x82c3('0xe')](_0x3bab8a,_0xff46db)[_0x82c3('0xf')](function(_0x447d27){logger[_0x82c3('0x10')]('Team,\x20%s,\x20%s',_0x4cd674,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x4cd674,'request\x20sent',JSON[_0x82c3('0x11')](_0x447d27));if(_0x447d27[_0x82c3('0x12')]){if(_0x447d27[_0x82c3('0x12')][_0x82c3('0x13')]===0x1f4){logger[_0x82c3('0x12')](_0x82c3('0x14'),_0x4cd674,_0x447d27[_0x82c3('0x12')][_0x82c3('0x15')]);return _0x1ddb0e(_0x447d27[_0x82c3('0x12')][_0x82c3('0x15')]);}logger[_0x82c3('0x12')](_0x82c3('0x14'),_0x4cd674,_0x447d27['error'][_0x82c3('0x15')]);return _0x492c85(_0x447d27[_0x82c3('0x12')][_0x82c3('0x15')]);}else{logger[_0x82c3('0x10')](_0x82c3('0x14'),_0x4cd674,_0x82c3('0x16'));_0x492c85(_0x447d27[_0x82c3('0x17')][_0x82c3('0x15')]);}})[_0x82c3('0x18')](function(_0x2e6707){logger[_0x82c3('0x12')](_0x82c3('0x14'),_0x4cd674,_0x2e6707);_0x1ddb0e(_0x2e6707);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0f35cfa..9fc10ae 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 _0x361a=['register','length','./team.events','save','remove','update','emit','removeListener'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x361a,0x102));var _0xa361=function(_0x3ed744,_0x57df1b){_0x3ed744=_0x3ed744-0x0;var _0x455407=_0x361a[_0x3ed744];return _0x455407;};'use strict';var TeamEvents=require(_0xa361('0x0'));var events=[_0xa361('0x1'),_0xa361('0x2'),_0xa361('0x3')];function createListener(_0x531e30,_0x2ea24f){return function(_0x2d53cf){_0x2ea24f[_0xa361('0x4')](_0x531e30,_0x2d53cf);};}function removeListener(_0x4ed762,_0x1a8ad1){return function(){TeamEvents[_0xa361('0x5')](_0x4ed762,_0x1a8ad1);};}exports[_0xa361('0x6')]=function(_0x2df977){for(var _0x2145de=0x0,_0x5ec147=events[_0xa361('0x7')];_0x2145de<_0x5ec147;_0x2145de++){var _0x10541a=events[_0x2145de];var _0x383d1f=createListener('team:'+_0x10541a,_0x2df977);TeamEvents['on'](_0x10541a,_0x383d1f);}}; \ No newline at end of file +var _0x5a36=['register','./team.events','save','remove','update','emit'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5a36,0x133));var _0x65a3=function(_0xf4e030,_0x131199){_0xf4e030=_0xf4e030-0x0;var _0x30f392=_0x5a36[_0xf4e030];return _0x30f392;};'use strict';var TeamEvents=require(_0x65a3('0x0'));var events=[_0x65a3('0x1'),_0x65a3('0x2'),_0x65a3('0x3')];function createListener(_0x2495f8,_0x5188bb){return function(_0x5ed140){_0x5188bb[_0x65a3('0x4')](_0x2495f8,_0x5ed140);};}function removeListener(_0x1a018b,_0x431d44){return function(){TeamEvents['removeListener'](_0x1a018b,_0x431d44);};}exports[_0x65a3('0x5')]=function(_0x3d1b8c){for(var _0x3b61e4=0x0,_0x326c4e=events['length'];_0x3b61e4<_0x326c4e;_0x3b61e4++){var _0x2e4464=events[_0x3b61e4];var _0x19614f=createListener('team:'+_0x2e4464,_0x3d1b8c);TeamEvents['on'](_0x2e4464,_0x19614f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 0ad097c..9c29ef3 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x534d=['INTEGER','sequelize','exports'];(function(_0x2d8c36,_0x49ac28){var _0x4b04af=function(_0x10ba19){while(--_0x10ba19){_0x2d8c36['push'](_0x2d8c36['shift']());}};_0x4b04af(++_0x49ac28);}(_0x534d,0x79));var _0xd534=function(_0x49b75f,_0x150ea3){_0x49b75f=_0x49b75f-0x0;var _0x10c316=_0x534d[_0x49b75f];return _0x10c316;};'use strict';var Sequelize=require(_0xd534('0x0'));module[_0xd534('0x1')]={'TeamId':{'type':Sequelize[_0xd534('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd534('0x2')]}}; \ No newline at end of file +var _0x377e=['exports','INTEGER','sequelize'];(function(_0x3d7404,_0x3e3f0f){var _0x583a47=function(_0x5074a7){while(--_0x5074a7){_0x3d7404['push'](_0x3d7404['shift']());}};_0x583a47(++_0x3e3f0f);}(_0x377e,0x1e2));var _0xe377=function(_0x164b9b,_0x20c789){_0x164b9b=_0x164b9b-0x0;var _0x592932=_0x377e[_0x164b9b];return _0x592932;};'use strict';var Sequelize=require(_0xe377('0x0'));module[_0xe377('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xe377('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index a065814..8722c81 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf972=['moment','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xf972,0x171));var _0x2f97=function(_0x774ed9,_0x53533c){_0x774ed9=_0x774ed9-0x0;var _0x1e0394=_0xf972[_0x774ed9];return _0x1e0394;};'use strict';var _=require(_0x2f97('0x0'));var util=require('util');var logger=require(_0x2f97('0x1'))(_0x2f97('0x2'));var moment=require(_0x2f97('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f97('0x4'));var fs=require('fs');var path=require(_0x2f97('0x5'));var rimraf=require('rimraf');var config=require(_0x2f97('0x6'));var attributes=require(_0x2f97('0x7'));module[_0x2f97('0x8')]=function(_0x14b139,_0x37482e){return _0x14b139[_0x2f97('0x9')](_0x2f97('0xa'),attributes,{'tableName':_0x2f97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4123=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4123,0x87));var _0x3412=function(_0x157f32,_0x385930){_0x157f32=_0x157f32-0x0;var _0x29021c=_0x4123[_0x157f32];return _0x29021c;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var logger=require(_0x3412('0x2'))(_0x3412('0x3'));var moment=require(_0x3412('0x4'));var BPromise=require(_0x3412('0x5'));var rp=require(_0x3412('0x6'));var fs=require('fs');var path=require(_0x3412('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3412('0x8'));module[_0x3412('0x9')]=function(_0x48eb88,_0x11aa67){return _0x48eb88[_0x3412('0xa')](_0x3412('0xb'),attributes,{'tableName':_0x3412('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index abced1e..ef72267 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1ccb4b,_0x1c5bdc){var _0x2fd92c=function(_0x1a0286){while(--_0x1a0286){_0x1ccb4b['push'](_0x1ccb4b['shift']());}};_0x2fd92c(++_0x1c5bdc);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x65fe8d,_0x183aa5){var _0x5502f6=function(_0x490d69){while(--_0x490d69){_0x65fe8d['push'](_0x65fe8d['shift']());}};_0x5502f6(++_0x183aa5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0xcb91[_0x39cd3c];return _0x47a0ae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 349d698..2d3d5e9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ddc=['exports','INTEGER','sequelize'];(function(_0x40ef6a,_0x3b52ec){var _0x58d0c4=function(_0x3166bc){while(--_0x3166bc){_0x40ef6a['push'](_0x40ef6a['shift']());}};_0x58d0c4(++_0x3b52ec);}(_0x8ddc,0x13d));var _0xc8dd=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8ddc[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xc8dd('0x0'));module[_0xc8dd('0x1')]={'penalty':{'type':Sequelize[_0xc8dd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf944=['exports','INTEGER'];(function(_0x36a454,_0x1859eb){var _0x57cd66=function(_0xf71aaf){while(--_0xf71aaf){_0x36a454['push'](_0x36a454['shift']());}};_0x57cd66(++_0x1859eb);}(_0xf944,0x9a));var _0x4f94=function(_0x4827db,_0x5d13ca){_0x4827db=_0x4827db-0x0;var _0x13b6b1=_0xf944[_0x4827db];return _0x13b6b1;};'use strict';var Sequelize=require('sequelize');module[_0x4f94('0x0')]={'penalty':{'type':Sequelize[_0x4f94('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index bda44a1..5bd38c1 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba6c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0xc81fc5,_0xd232c0){var _0x1308f6=function(_0x3de09f){while(--_0x3de09f){_0xc81fc5['push'](_0xc81fc5['shift']());}};_0x1308f6(++_0xd232c0);}(_0xba6c,0x113));var _0xcba6=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xba6c[_0x48999d];return _0x1ad0d1;};'use strict';var _=require(_0xcba6('0x0'));var util=require('util');var logger=require(_0xcba6('0x1'))(_0xcba6('0x2'));var moment=require(_0xcba6('0x3'));var BPromise=require(_0xcba6('0x4'));var rp=require(_0xcba6('0x5'));var fs=require('fs');var path=require(_0xcba6('0x6'));var rimraf=require(_0xcba6('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0xcba6('0x8')]=function(_0x1fd901,_0x34d35d){return _0x1fd901[_0xcba6('0x9')](_0xcba6('0xa'),attributes,{'tableName':_0xcba6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fed=['exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','./teamVoiceQueue.attributes'];(function(_0x2c768d,_0x5b3efb){var _0x2e0941=function(_0x3caae9){while(--_0x3caae9){_0x2c768d['push'](_0x2c768d['shift']());}};_0x2e0941(++_0x5b3efb);}(_0x2fed,0x7c));var _0xd2fe=function(_0x1ced5a,_0x5850c2){_0x1ced5a=_0x1ced5a-0x0;var _0x516838=_0x2fed[_0x1ced5a];return _0x516838;};'use strict';var _=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var logger=require(_0xd2fe('0x2'))(_0xd2fe('0x3'));var moment=require(_0xd2fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xd2fe('0x5'));var fs=require('fs');var path=require(_0xd2fe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2fe('0x7'));module[_0xd2fe('0x8')]=function(_0xd85f89,_0x5be4d3){return _0xd85f89[_0xd2fe('0x9')](_0xd2fe('0xa'),attributes,{'tableName':_0xd2fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 80f66a6..e8b6d21 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c9=['code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','stringify','error'];(function(_0x1cc4dc,_0x3deedd){var _0x1805b8=function(_0x1a0dde){while(--_0x1a0dde){_0x1cc4dc['push'](_0x1cc4dc['shift']());}};_0x1805b8(++_0x3deedd);}(_0x81c9,0xf7));var _0x981c=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x81c9[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x981c('0x0'));var util=require(_0x981c('0x1'));var moment=require(_0x981c('0x2'));var BPromise=require(_0x981c('0x3'));var rs=require(_0x981c('0x4'));var fs=require('fs');var Redis=require(_0x981c('0x5'));var db=require(_0x981c('0x6'))['db'];var utils=require(_0x981c('0x7'));var logger=require('../../config/logger')(_0x981c('0x8'));var config=require(_0x981c('0x9'));var jayson=require(_0x981c('0xa'));var client=jayson[_0x981c('0xb')][_0x981c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ee362,_0x14d2dd,_0x1805f4){return new BPromise(function(_0xdfd42c,_0x1ff25a){return client['request'](_0x4ee362,_0x1805f4)['then'](function(_0x4f3ae3){logger[_0x981c('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x14d2dd,_0x981c('0xe'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x14d2dd,_0x981c('0xe'),JSON[_0x981c('0xf')](_0x4f3ae3));if(_0x4f3ae3[_0x981c('0x10')]){if(_0x4f3ae3['error'][_0x981c('0x11')]===0x1f4){logger[_0x981c('0x10')](_0x981c('0x12'),_0x14d2dd,_0x4f3ae3[_0x981c('0x10')][_0x981c('0x13')]);return _0x1ff25a(_0x4f3ae3['error']['message']);}logger[_0x981c('0x10')](_0x981c('0x12'),_0x14d2dd,_0x4f3ae3['error']['message']);return _0xdfd42c(_0x4f3ae3[_0x981c('0x10')]['message']);}else{logger[_0x981c('0xd')](_0x981c('0x12'),_0x14d2dd,_0x981c('0xe'));_0xdfd42c(_0x4f3ae3[_0x981c('0x14')][_0x981c('0x13')]);}})[_0x981c('0x15')](function(_0x3da1ca){logger['error'](_0x981c('0x12'),_0x14d2dd,_0x3da1ca);_0x1ff25a(_0x3da1ca);});});} \ No newline at end of file +var _0x340c=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc340('0x0'));var util=require(_0xc340('0x1'));var moment=require(_0xc340('0x2'));var BPromise=require(_0xc340('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc340('0x4'));var db=require(_0xc340('0x5'))['db'];var utils=require(_0xc340('0x6'));var logger=require(_0xc340('0x7'))('rpc');var config=require(_0xc340('0x8'));var jayson=require(_0xc340('0x9'));var client=jayson[_0xc340('0xa')][_0xc340('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35b8e6,_0x4c3a04,_0x4c33db){return new BPromise(function(_0x59a213,_0x4726ff){return client[_0xc340('0xc')](_0x35b8e6,_0x4c33db)['then'](function(_0x388873){logger[_0xc340('0xd')](_0xc340('0xe'),_0x4c3a04,_0xc340('0xf'));logger[_0xc340('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4c3a04,_0xc340('0xf'),JSON[_0xc340('0x11')](_0x388873));if(_0x388873[_0xc340('0x12')]){if(_0x388873['error'][_0xc340('0x13')]===0x1f4){logger[_0xc340('0x12')](_0xc340('0xe'),_0x4c3a04,_0x388873[_0xc340('0x12')][_0xc340('0x14')]);return _0x4726ff(_0x388873['error'][_0xc340('0x14')]);}logger[_0xc340('0x12')](_0xc340('0xe'),_0x4c3a04,_0x388873[_0xc340('0x12')][_0xc340('0x14')]);return _0x59a213(_0x388873['error'][_0xc340('0x14')]);}else{logger[_0xc340('0xd')](_0xc340('0xe'),_0x4c3a04,_0xc340('0xf'));_0x59a213(_0x388873[_0xc340('0x15')]['message']);}})[_0xc340('0x16')](function(_0x3b05bb){logger[_0xc340('0x12')](_0xc340('0xe'),_0x4c3a04,_0x3b05bb);_0x4726ff(_0x3b05bb);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index a21688e..9875e15 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 _0x79a3=['isAuthenticated','index','show','post','create','put','/:id','exports','multer','path','connect-timeout','Router','../../config/environment','./template.controller','get'];(function(_0x439614,_0x4b1191){var _0x2fdbec=function(_0xc29793){while(--_0xc29793){_0x439614['push'](_0x439614['shift']());}};_0x2fdbec(++_0x4b1191);}(_0x79a3,0x80));var _0x379a=function(_0x590874,_0x1fdfe7){_0x590874=_0x590874-0x0;var _0x584cf1=_0x79a3[_0x590874];return _0x584cf1;};'use strict';var multer=require(_0x379a('0x0'));var util=require('util');var path=require(_0x379a('0x1'));var timeout=require(_0x379a('0x2'));var express=require('express');var router=express[_0x379a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x379a('0x4'));var controller=require(_0x379a('0x5'));router[_0x379a('0x6')]('/',auth[_0x379a('0x7')](),controller[_0x379a('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x379a('0x9')]);router[_0x379a('0xa')]('/',auth[_0x379a('0x7')](),controller[_0x379a('0xb')]);router[_0x379a('0xc')](_0x379a('0xd'),auth[_0x379a('0x7')](),controller['update']);router['delete'](_0x379a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x379a('0xe')]=router; \ No newline at end of file +var _0x6000=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy'];(function(_0xe520e0,_0x110a5d){var _0x28d7fa=function(_0x1f9ff5){while(--_0x1f9ff5){_0xe520e0['push'](_0xe520e0['shift']());}};_0x28d7fa(++_0x110a5d);}(_0x6000,0x17c));var _0x0600=function(_0x2597b6,_0x35ab54){_0x2597b6=_0x2597b6-0x0;var _0x417f91=_0x6000[_0x2597b6];return _0x417f91;};'use strict';var multer=require(_0x0600('0x0'));var util=require(_0x0600('0x1'));var path=require(_0x0600('0x2'));var timeout=require(_0x0600('0x3'));var express=require(_0x0600('0x4'));var router=express[_0x0600('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0600('0x6'));var interaction=require(_0x0600('0x7'));var config=require('../../config/environment');var controller=require(_0x0600('0x8'));router['get']('/',auth[_0x0600('0x9')](),controller[_0x0600('0xa')]);router[_0x0600('0xb')]('/:id',auth[_0x0600('0x9')](),controller['show']);router[_0x0600('0xc')]('/',auth[_0x0600('0x9')](),controller[_0x0600('0xd')]);router[_0x0600('0xe')](_0x0600('0xf'),auth[_0x0600('0x9')](),controller[_0x0600('0x10')]);router[_0x0600('0x11')]('/:id',auth[_0x0600('0x9')](),controller[_0x0600('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 7063f27..164ef9d 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 _0xc876=['sequelize','exports','STRING','TEXT'];(function(_0x1f3591,_0x5688f1){var _0x2339f1=function(_0x2f6460){while(--_0x2f6460){_0x1f3591['push'](_0x1f3591['shift']());}};_0x2339f1(++_0x5688f1);}(_0xc876,0x198));var _0x6c87=function(_0x546413,_0x2c9fae){_0x546413=_0x546413-0x0;var _0x4d446b=_0xc876[_0x546413];return _0x4d446b;};'use strict';var Sequelize=require(_0x6c87('0x0'));module[_0x6c87('0x1')]={'name':{'type':Sequelize[_0x6c87('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x6c87('0x3')]}}; \ No newline at end of file +var _0x2ab1=['TEXT','exports','STRING'];(function(_0x48fe11,_0x10168a){var _0x4bb717=function(_0x4ddfac){while(--_0x4ddfac){_0x48fe11['push'](_0x48fe11['shift']());}};_0x4bb717(++_0x10168a);}(_0x2ab1,0x64));var _0x12ab=function(_0x4384ed,_0x5d2a14){_0x4384ed=_0x4384ed-0x0;var _0x5060e8=_0x2ab1[_0x4384ed];return _0x5060e8;};'use strict';var Sequelize=require('sequelize');module[_0x12ab('0x0')]={'name':{'type':Sequelize[_0x12ab('0x1')]},'description':{'type':Sequelize[_0x12ab('0x1')]},'html':{'type':Sequelize[_0x12ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b212fe3..7bda6ca 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 _0x0a4e=['pick','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','create','body','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x0a4e,0x67));var _0xe0a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a4e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe0a4('0x0'));var rimraf=require(_0xe0a4('0x1'));var zipdir=require(_0xe0a4('0x2'));var jsonpatch=require(_0xe0a4('0x3'));var rp=require('request-promise');var moment=require(_0xe0a4('0x4'));var BPromise=require(_0xe0a4('0x5'));var Mustache=require(_0xe0a4('0x6'));var util=require(_0xe0a4('0x7'));var path=require(_0xe0a4('0x8'));var sox=require(_0xe0a4('0x9'));var csv=require('to-csv');var ejs=require(_0xe0a4('0xa'));var fs=require('fs');var fs_extra=require(_0xe0a4('0xb'));var _=require(_0xe0a4('0xc'));var squel=require(_0xe0a4('0xd'));var crypto=require(_0xe0a4('0xe'));var jsforce=require(_0xe0a4('0xf'));var deskjs=require(_0xe0a4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe0a4('0x11'));var Redis=require(_0xe0a4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe0a4('0x13'));var as=require(_0xe0a4('0x14'));var hardwareService=require(_0xe0a4('0x15'));var logger=require('../../config/logger')(_0xe0a4('0x16'));var utils=require('../../config/utils');var config=require(_0xe0a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x96031b,_0x2be2e0){_0x2be2e0=_0x2be2e0||0xcc;return function(_0x128f0c){if(_0x128f0c){return _0x96031b[_0xe0a4('0x18')](_0x2be2e0);}return _0x96031b['status'](_0x2be2e0)[_0xe0a4('0x19')]();};}function respondWithResult(_0x169f69,_0x4611c9){_0x4611c9=_0x4611c9||0xc8;return function(_0x1205fd){if(_0x1205fd){return _0x169f69['status'](_0x4611c9)['json'](_0x1205fd);}};}function respondWithFilteredResult(_0x5bc4f2,_0x1344e5){return function(_0x5e5b3a){if(_0x5e5b3a){var _0x39f085=typeof _0x1344e5[_0xe0a4('0x1a')]===_0xe0a4('0x1b')&&typeof _0x1344e5[_0xe0a4('0x1c')]==='undefined';var _0x176f2d=_0x5e5b3a[_0xe0a4('0x1d')];var _0x4fd4f5=_0x39f085?0x0:_0x1344e5[_0xe0a4('0x1a')];var _0x11e67e=_0x39f085?_0x5e5b3a[_0xe0a4('0x1d')]:_0x1344e5['offset']+_0x1344e5[_0xe0a4('0x1c')];var _0x334d16;if(_0x11e67e>=_0x176f2d){_0x11e67e=_0x176f2d;_0x334d16=0xc8;}else{_0x334d16=0xce;}_0x5bc4f2[_0xe0a4('0x1e')](_0x334d16);return _0x5bc4f2[_0xe0a4('0x1f')](_0xe0a4('0x20'),_0x4fd4f5+'-'+_0x11e67e+'/'+_0x176f2d)[_0xe0a4('0x21')](_0x5e5b3a);}return null;};}function patchUpdates(_0x467cce){return function(_0x3d35b4){try{jsonpatch[_0xe0a4('0x22')](_0x3d35b4,_0x467cce,!![]);}catch(_0x5a20a8){return BPromise[_0xe0a4('0x23')](_0x5a20a8);}return _0x3d35b4[_0xe0a4('0x24')]();};}function saveUpdates(_0x437c93,_0x539bdc){return function(_0x45586c){if(_0x45586c){return _0x45586c[_0xe0a4('0x25')](_0x437c93)['then'](function(_0x212ba0){return _0x212ba0;});}return null;};}function removeEntity(_0x5c64e9,_0x3b700c){return function(_0x29e469){if(_0x29e469){return _0x29e469[_0xe0a4('0x26')]()[_0xe0a4('0x27')](function(){var _0x1cdcaf=_0x29e469[_0xe0a4('0x28')]({'plain':!![]});var _0x163bbc=_0xe0a4('0x29');return db[_0xe0a4('0x2a')][_0xe0a4('0x26')]({'where':{'type':_0x163bbc,'resourceId':_0x1cdcaf['id']}})[_0xe0a4('0x27')](function(){return _0x29e469;});})[_0xe0a4('0x27')](function(){_0x5c64e9[_0xe0a4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407a05,_0xdcec49){return function(_0x25fc39){if(!_0x25fc39){_0x407a05[_0xe0a4('0x18')](0x194);}return _0x25fc39;};}function handleError(_0x4ac417,_0x14c931){_0x14c931=_0x14c931||0x1f4;return function(_0x1da411){logger[_0xe0a4('0x2b')](_0x1da411[_0xe0a4('0x2c')]);if(_0x1da411[_0xe0a4('0x2d')]){delete _0x1da411['name'];}_0x4ac417['status'](_0x14c931)[_0xe0a4('0x2e')](_0x1da411);};}exports[_0xe0a4('0x2f')]=function(_0x5c0769,_0x36d741){var _0x225fe9={},_0x38ac24={},_0x2f1374={'count':0x0,'rows':[]};var _0x1d6e3b=_[_0xe0a4('0x30')](db[_0xe0a4('0x31')][_0xe0a4('0x32')],function(_0x4ad1d8){return{'name':_0x4ad1d8[_0xe0a4('0x33')],'type':_0x4ad1d8[_0xe0a4('0x34')][_0xe0a4('0x35')]};});_0x38ac24[_0xe0a4('0x36')]=_[_0xe0a4('0x30')](_0x1d6e3b,'name');_0x38ac24[_0xe0a4('0x37')]=_[_0xe0a4('0x38')](_0x5c0769['query']);_0x38ac24[_0xe0a4('0x39')]=_[_0xe0a4('0x3a')](_0x38ac24['model'],_0x38ac24[_0xe0a4('0x37')]);_0x225fe9[_0xe0a4('0x3b')]=_[_0xe0a4('0x3a')](_0x38ac24[_0xe0a4('0x36')],qs[_0xe0a4('0x3c')](_0x5c0769[_0xe0a4('0x37')]['fields']));_0x225fe9[_0xe0a4('0x3b')]=_0x225fe9[_0xe0a4('0x3b')][_0xe0a4('0x3d')]?_0x225fe9[_0xe0a4('0x3b')]:_0x38ac24['model'];if(!_0x5c0769[_0xe0a4('0x37')]['hasOwnProperty'](_0xe0a4('0x3e'))){_0x225fe9[_0xe0a4('0x1c')]=qs[_0xe0a4('0x1c')](_0x5c0769[_0xe0a4('0x37')][_0xe0a4('0x1c')]);_0x225fe9[_0xe0a4('0x1a')]=qs[_0xe0a4('0x1a')](_0x5c0769[_0xe0a4('0x37')][_0xe0a4('0x1a')]);}_0x225fe9['order']=qs[_0xe0a4('0x3f')](_0x5c0769['query']['sort']);_0x225fe9[_0xe0a4('0x40')]=qs[_0xe0a4('0x39')](_[_0xe0a4('0x41')](_0x5c0769[_0xe0a4('0x37')],_0x38ac24[_0xe0a4('0x39')]),_0x1d6e3b);if(_0x5c0769['query'][_0xe0a4('0x42')]){_0x225fe9[_0xe0a4('0x40')]=_[_0xe0a4('0x43')](_0x225fe9['where'],{'$or':_[_0xe0a4('0x30')](_0x1d6e3b,function(_0x221bc6){if(_0x221bc6[_0xe0a4('0x34')]!==_0xe0a4('0x44')){var _0x4e091e={};_0x4e091e[_0x221bc6[_0xe0a4('0x2d')]]={'$like':'%'+_0x5c0769['query']['filter']+'%'};return _0x4e091e;}})});}_0x225fe9=_[_0xe0a4('0x43')]({},_0x225fe9,_0x5c0769['options']);var _0x1475c9={'where':_0x225fe9[_0xe0a4('0x40')]};return db['Template'][_0xe0a4('0x1d')](_0x1475c9)[_0xe0a4('0x27')](function(_0x3324b8){_0x2f1374[_0xe0a4('0x1d')]=_0x3324b8;if(_0x5c0769['query']['includeAll']){_0x225fe9['include']=[{'all':!![]}];}return db[_0xe0a4('0x31')][_0xe0a4('0x45')](_0x225fe9);})[_0xe0a4('0x27')](function(_0x18c16b){_0x2f1374['rows']=_0x18c16b;return _0x2f1374;})[_0xe0a4('0x27')](respondWithFilteredResult(_0x36d741,_0x225fe9))[_0xe0a4('0x46')](handleError(_0x36d741,null));};exports[_0xe0a4('0x47')]=function(_0x5f42a4,_0x3a4326){var _0x395f41={'raw':!![],'where':{'id':_0x5f42a4[_0xe0a4('0x48')]['id']}},_0x79ae69={};_0x79ae69['model']=_[_0xe0a4('0x38')](db['Template'][_0xe0a4('0x32')]);_0x79ae69[_0xe0a4('0x37')]=_['keys'](_0x5f42a4[_0xe0a4('0x37')]);_0x79ae69['filters']=_[_0xe0a4('0x3a')](_0x79ae69[_0xe0a4('0x36')],_0x79ae69['query']);_0x395f41[_0xe0a4('0x3b')]=_[_0xe0a4('0x3a')](_0x79ae69[_0xe0a4('0x36')],qs[_0xe0a4('0x3c')](_0x5f42a4[_0xe0a4('0x37')][_0xe0a4('0x3c')]));_0x395f41['attributes']=_0x395f41[_0xe0a4('0x3b')][_0xe0a4('0x3d')]?_0x395f41[_0xe0a4('0x3b')]:_0x79ae69['model'];if(_0x5f42a4['query'][_0xe0a4('0x49')]){_0x395f41[_0xe0a4('0x4a')]=[{'all':!![]}];}_0x395f41=_[_0xe0a4('0x43')]({},_0x395f41,_0x5f42a4[_0xe0a4('0x4b')]);return db['Template']['find'](_0x395f41)['then'](handleEntityNotFound(_0x3a4326,null))[_0xe0a4('0x27')](respondWithResult(_0x3a4326,null))[_0xe0a4('0x46')](handleError(_0x3a4326,null));};exports[_0xe0a4('0x4c')]=function(_0x515899,_0x40d47d){return db[_0xe0a4('0x31')][_0xe0a4('0x4c')](_0x515899[_0xe0a4('0x4d')],{})[_0xe0a4('0x27')](function(_0x2d962e){var _0xff1e46=_0x515899['user']['get']({'plain':!![]});if(!_0xff1e46)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xff1e46[_0xe0a4('0x4e')]===_0xe0a4('0x4f')){var _0x1f7139=_0x2d962e[_0xe0a4('0x28')]({'plain':!![]});var _0x55f116=_0xe0a4('0x29');return db[_0xe0a4('0x50')][_0xe0a4('0x51')]({'where':{'name':_0x55f116,'userProfileId':_0xff1e46['userProfileId']},'raw':!![]})[_0xe0a4('0x27')](function(_0x319d6e){if(_0x319d6e&&_0x319d6e[_0xe0a4('0x52')]===0x0){return db['UserProfileResource'][_0xe0a4('0x4c')]({'name':_0x1f7139[_0xe0a4('0x2d')],'resourceId':_0x1f7139['id'],'type':_0x319d6e[_0xe0a4('0x2d')],'sectionId':_0x319d6e['id']},{})[_0xe0a4('0x27')](function(){return _0x2d962e;});}else{return _0x2d962e;}})[_0xe0a4('0x46')](function(_0x18ea16){logger[_0xe0a4('0x2b')](_0xe0a4('0x53'),_0x18ea16);throw _0x18ea16;});}return _0x2d962e;})[_0xe0a4('0x27')](respondWithResult(_0x40d47d,0xc9))['catch'](handleError(_0x40d47d,null));};exports['update']=function(_0x73b0d2,_0x188c14){if(_0x73b0d2[_0xe0a4('0x4d')]['id']){delete _0x73b0d2[_0xe0a4('0x4d')]['id'];}return db[_0xe0a4('0x31')][_0xe0a4('0x51')]({'where':{'id':_0x73b0d2[_0xe0a4('0x48')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x188c14,null))[_0xe0a4('0x27')](saveUpdates(_0x73b0d2[_0xe0a4('0x4d')],null))['then'](respondWithResult(_0x188c14,null))['catch'](handleError(_0x188c14,null));};exports[_0xe0a4('0x26')]=function(_0x13de4e,_0x5ed413){return db[_0xe0a4('0x31')][_0xe0a4('0x51')]({'where':{'id':_0x13de4e[_0xe0a4('0x48')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x5ed413,null))[_0xe0a4('0x27')](removeEntity(_0x5ed413,null))['catch'](handleError(_0x5ed413,null));}; \ No newline at end of file +var _0x6920=['offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','Template','includeAll','rows','catch','show','params','include','find','create','body','user','UserProfileSection','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x6920,0x1b8));var _0x0692=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x6920[_0x2e76a7];return _0x454cde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0692('0x0'));var zipdir=require(_0x0692('0x1'));var jsonpatch=require(_0x0692('0x2'));var rp=require(_0x0692('0x3'));var moment=require(_0x0692('0x4'));var BPromise=require(_0x0692('0x5'));var Mustache=require('mustache');var util=require(_0x0692('0x6'));var path=require(_0x0692('0x7'));var sox=require(_0x0692('0x8'));var csv=require(_0x0692('0x9'));var ejs=require(_0x0692('0xa'));var fs=require('fs');var fs_extra=require(_0x0692('0xb'));var _=require(_0x0692('0xc'));var squel=require(_0x0692('0xd'));var crypto=require('crypto');var jsforce=require(_0x0692('0xe'));var deskjs=require(_0x0692('0xf'));var toCsv=require(_0x0692('0x9'));var querystring=require(_0x0692('0x10'));var Papa=require(_0x0692('0x11'));var Redis=require(_0x0692('0x12'));var authService=require(_0x0692('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0692('0x14'));var hardwareService=require(_0x0692('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0692('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0692('0x17'))['db'];function respondWithStatusCode(_0x4cb111,_0x2a054c){_0x2a054c=_0x2a054c||0xcc;return function(_0x3f254a){if(_0x3f254a){return _0x4cb111[_0x0692('0x18')](_0x2a054c);}return _0x4cb111[_0x0692('0x19')](_0x2a054c)[_0x0692('0x1a')]();};}function respondWithResult(_0x1c28bd,_0x335ec8){_0x335ec8=_0x335ec8||0xc8;return function(_0x4d3443){if(_0x4d3443){return _0x1c28bd['status'](_0x335ec8)[_0x0692('0x1b')](_0x4d3443);}};}function respondWithFilteredResult(_0x4a1344,_0xf7d492){return function(_0x261c88){if(_0x261c88){var _0x4ad974=typeof _0xf7d492[_0x0692('0x1c')]==='undefined'&&typeof _0xf7d492['limit']===_0x0692('0x1d');var _0x2b4409=_0x261c88[_0x0692('0x1e')];var _0x1e371e=_0x4ad974?0x0:_0xf7d492['offset'];var _0x8c59e3=_0x4ad974?_0x261c88[_0x0692('0x1e')]:_0xf7d492['offset']+_0xf7d492[_0x0692('0x1f')];var _0x28a2ef;if(_0x8c59e3>=_0x2b4409){_0x8c59e3=_0x2b4409;_0x28a2ef=0xc8;}else{_0x28a2ef=0xce;}_0x4a1344[_0x0692('0x19')](_0x28a2ef);return _0x4a1344[_0x0692('0x20')](_0x0692('0x21'),_0x1e371e+'-'+_0x8c59e3+'/'+_0x2b4409)[_0x0692('0x1b')](_0x261c88);}return null;};}function patchUpdates(_0x5060ae){return function(_0x4308b0){try{jsonpatch[_0x0692('0x22')](_0x4308b0,_0x5060ae,!![]);}catch(_0x4f549c){return BPromise['reject'](_0x4f549c);}return _0x4308b0['save']();};}function saveUpdates(_0x510527,_0x382b05){return function(_0x52095c){if(_0x52095c){return _0x52095c[_0x0692('0x23')](_0x510527)[_0x0692('0x24')](function(_0x5ac8c){return _0x5ac8c;});}return null;};}function removeEntity(_0x50bf0a,_0x3844d3){return function(_0x23390e){if(_0x23390e){return _0x23390e[_0x0692('0x25')]()['then'](function(){var _0x57134b=_0x23390e[_0x0692('0x26')]({'plain':!![]});var _0x728107=_0x0692('0x27');return db[_0x0692('0x28')][_0x0692('0x25')]({'where':{'type':_0x728107,'resourceId':_0x57134b['id']}})[_0x0692('0x24')](function(){return _0x23390e;});})[_0x0692('0x24')](function(){_0x50bf0a[_0x0692('0x19')](0xcc)[_0x0692('0x1a')]();});}};}function handleEntityNotFound(_0x25e7ad,_0x4885da){return function(_0x345b71){if(!_0x345b71){_0x25e7ad[_0x0692('0x18')](0x194);}return _0x345b71;};}function handleError(_0x1bb50c,_0xc1f13b){_0xc1f13b=_0xc1f13b||0x1f4;return function(_0x18fbfd){logger[_0x0692('0x29')](_0x18fbfd[_0x0692('0x2a')]);if(_0x18fbfd['name']){delete _0x18fbfd[_0x0692('0x2b')];}_0x1bb50c['status'](_0xc1f13b)[_0x0692('0x2c')](_0x18fbfd);};}exports[_0x0692('0x2d')]=function(_0x4f4d37,_0x54adea){var _0x5c164d={},_0x454d16={},_0x2a8caf={'count':0x0,'rows':[]};var _0xb600bc=_[_0x0692('0x2e')](db['Template'][_0x0692('0x2f')],function(_0x31ae7d){return{'name':_0x31ae7d[_0x0692('0x30')],'type':_0x31ae7d[_0x0692('0x31')]['key']};});_0x454d16[_0x0692('0x32')]=_[_0x0692('0x2e')](_0xb600bc,_0x0692('0x2b'));_0x454d16[_0x0692('0x33')]=_[_0x0692('0x34')](_0x4f4d37[_0x0692('0x33')]);_0x454d16[_0x0692('0x35')]=_[_0x0692('0x36')](_0x454d16[_0x0692('0x32')],_0x454d16[_0x0692('0x33')]);_0x5c164d[_0x0692('0x37')]=_[_0x0692('0x36')](_0x454d16['model'],qs[_0x0692('0x38')](_0x4f4d37[_0x0692('0x33')][_0x0692('0x38')]));_0x5c164d[_0x0692('0x37')]=_0x5c164d[_0x0692('0x37')][_0x0692('0x39')]?_0x5c164d[_0x0692('0x37')]:_0x454d16[_0x0692('0x32')];if(!_0x4f4d37[_0x0692('0x33')][_0x0692('0x3a')](_0x0692('0x3b'))){_0x5c164d[_0x0692('0x1f')]=qs[_0x0692('0x1f')](_0x4f4d37[_0x0692('0x33')][_0x0692('0x1f')]);_0x5c164d['offset']=qs[_0x0692('0x1c')](_0x4f4d37[_0x0692('0x33')][_0x0692('0x1c')]);}_0x5c164d[_0x0692('0x3c')]=qs['sort'](_0x4f4d37['query'][_0x0692('0x3d')]);_0x5c164d[_0x0692('0x3e')]=qs[_0x0692('0x35')](_[_0x0692('0x3f')](_0x4f4d37['query'],_0x454d16[_0x0692('0x35')]),_0xb600bc);if(_0x4f4d37[_0x0692('0x33')]['filter']){_0x5c164d[_0x0692('0x3e')]=_[_0x0692('0x40')](_0x5c164d[_0x0692('0x3e')],{'$or':_[_0x0692('0x2e')](_0xb600bc,function(_0x1fc432){if(_0x1fc432[_0x0692('0x31')]!=='VIRTUAL'){var _0x3d9197={};_0x3d9197[_0x1fc432[_0x0692('0x2b')]]={'$like':'%'+_0x4f4d37[_0x0692('0x33')]['filter']+'%'};return _0x3d9197;}})});}_0x5c164d=_[_0x0692('0x40')]({},_0x5c164d,_0x4f4d37['options']);var _0xed6eb6={'where':_0x5c164d[_0x0692('0x3e')]};return db[_0x0692('0x41')][_0x0692('0x1e')](_0xed6eb6)['then'](function(_0x923a5a){_0x2a8caf[_0x0692('0x1e')]=_0x923a5a;if(_0x4f4d37['query'][_0x0692('0x42')]){_0x5c164d['include']=[{'all':!![]}];}return db[_0x0692('0x41')]['findAll'](_0x5c164d);})[_0x0692('0x24')](function(_0x20b5a9){_0x2a8caf[_0x0692('0x43')]=_0x20b5a9;return _0x2a8caf;})[_0x0692('0x24')](respondWithFilteredResult(_0x54adea,_0x5c164d))[_0x0692('0x44')](handleError(_0x54adea,null));};exports[_0x0692('0x45')]=function(_0x33e71f,_0x22ba6){var _0x679523={'raw':!![],'where':{'id':_0x33e71f[_0x0692('0x46')]['id']}},_0xfd0893={};_0xfd0893[_0x0692('0x32')]=_[_0x0692('0x34')](db['Template'][_0x0692('0x2f')]);_0xfd0893['query']=_[_0x0692('0x34')](_0x33e71f[_0x0692('0x33')]);_0xfd0893['filters']=_[_0x0692('0x36')](_0xfd0893['model'],_0xfd0893[_0x0692('0x33')]);_0x679523[_0x0692('0x37')]=_[_0x0692('0x36')](_0xfd0893[_0x0692('0x32')],qs['fields'](_0x33e71f[_0x0692('0x33')][_0x0692('0x38')]));_0x679523[_0x0692('0x37')]=_0x679523[_0x0692('0x37')][_0x0692('0x39')]?_0x679523[_0x0692('0x37')]:_0xfd0893[_0x0692('0x32')];if(_0x33e71f[_0x0692('0x33')][_0x0692('0x42')]){_0x679523[_0x0692('0x47')]=[{'all':!![]}];}_0x679523=_[_0x0692('0x40')]({},_0x679523,_0x33e71f['options']);return db[_0x0692('0x41')][_0x0692('0x48')](_0x679523)[_0x0692('0x24')](handleEntityNotFound(_0x22ba6,null))[_0x0692('0x24')](respondWithResult(_0x22ba6,null))['catch'](handleError(_0x22ba6,null));};exports[_0x0692('0x49')]=function(_0x341724,_0x33d867){return db[_0x0692('0x41')][_0x0692('0x49')](_0x341724[_0x0692('0x4a')],{})[_0x0692('0x24')](function(_0xf49f55){var _0x3df79b=_0x341724[_0x0692('0x4b')][_0x0692('0x26')]({'plain':!![]});if(!_0x3df79b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3df79b['role']==='user'){var _0x10ea35=_0xf49f55['get']({'plain':!![]});var _0x2fdc9e=_0x0692('0x27');return db[_0x0692('0x4c')][_0x0692('0x48')]({'where':{'name':_0x2fdc9e,'userProfileId':_0x3df79b['userProfileId']},'raw':!![]})[_0x0692('0x24')](function(_0x3e8bb6){if(_0x3e8bb6&&_0x3e8bb6[_0x0692('0x4d')]===0x0){return db[_0x0692('0x28')][_0x0692('0x49')]({'name':_0x10ea35['name'],'resourceId':_0x10ea35['id'],'type':_0x3e8bb6[_0x0692('0x2b')],'sectionId':_0x3e8bb6['id']},{})[_0x0692('0x24')](function(){return _0xf49f55;});}else{return _0xf49f55;}})[_0x0692('0x44')](function(_0x553c84){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x553c84);throw _0x553c84;});}return _0xf49f55;})[_0x0692('0x24')](respondWithResult(_0x33d867,0xc9))[_0x0692('0x44')](handleError(_0x33d867,null));};exports[_0x0692('0x23')]=function(_0x28be0a,_0x5e8f65){if(_0x28be0a[_0x0692('0x4a')]['id']){delete _0x28be0a[_0x0692('0x4a')]['id'];}return db[_0x0692('0x41')][_0x0692('0x48')]({'where':{'id':_0x28be0a[_0x0692('0x46')]['id']}})[_0x0692('0x24')](handleEntityNotFound(_0x5e8f65,null))[_0x0692('0x24')](saveUpdates(_0x28be0a[_0x0692('0x4a')],null))[_0x0692('0x24')](respondWithResult(_0x5e8f65,null))[_0x0692('0x44')](handleError(_0x5e8f65,null));};exports[_0x0692('0x25')]=function(_0x10e953,_0x32e539){return db[_0x0692('0x41')][_0x0692('0x48')]({'where':{'id':_0x10e953[_0x0692('0x46')]['id']}})[_0x0692('0x24')](handleEntityNotFound(_0x32e539,null))[_0x0692('0x24')](removeEntity(_0x32e539,null))[_0x0692('0x44')](handleError(_0x32e539,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3907322..a450a55 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 _0xbfde=['define','Template','tools_templates','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x465e3e,_0x5680de){var _0x8b895f=function(_0x3f6bff){while(--_0x3f6bff){_0x465e3e['push'](_0x465e3e['shift']());}};_0x8b895f(++_0x5680de);}(_0xbfde,0x87));var _0xebfd=function(_0x4ffa55,_0x4babc3){_0x4ffa55=_0x4ffa55-0x0;var _0x2ad5b8=_0xbfde[_0x4ffa55];return _0x2ad5b8;};'use strict';var _=require('lodash');var util=require(_0xebfd('0x0'));var logger=require(_0xebfd('0x1'))(_0xebfd('0x2'));var moment=require('moment');var BPromise=require(_0xebfd('0x3'));var rp=require(_0xebfd('0x4'));var fs=require('fs');var path=require(_0xebfd('0x5'));var rimraf=require('rimraf');var config=require(_0xebfd('0x6'));var attributes=require(_0xebfd('0x7'));module['exports']=function(_0x2e5487,_0x16280b){return _0x2e5487[_0xebfd('0x8')](_0xebfd('0x9'),attributes,{'tableName':_0xebfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9516=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates'];(function(_0x56fa9a,_0xba91f3){var _0x23b1f8=function(_0x4f5cf7){while(--_0x4f5cf7){_0x56fa9a['push'](_0x56fa9a['shift']());}};_0x23b1f8(++_0xba91f3);}(_0x9516,0x1b0));var _0x6951=function(_0x3a50ae,_0x4a505b){_0x3a50ae=_0x3a50ae-0x0;var _0x3a16f4=_0x9516[_0x3a50ae];return _0x3a16f4;};'use strict';var _=require('lodash');var util=require(_0x6951('0x0'));var logger=require(_0x6951('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6951('0x2'));var rp=require(_0x6951('0x3'));var fs=require('fs');var path=require(_0x6951('0x4'));var rimraf=require(_0x6951('0x5'));var config=require(_0x6951('0x6'));var attributes=require(_0x6951('0x7'));module[_0x6951('0x8')]=function(_0x32cc66,_0x47a949){return _0x32cc66[_0x6951('0x9')](_0x6951('0xa'),attributes,{'tableName':_0x6951('0xb'),'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 5c03f21..a930ad7 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 _0xf54a=['GetTemplate','Template','findAll','options','where','limit','include','model','attributes','map','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Template,\x20%s,\x20%s','message','catch'];(function(_0x2a134b,_0x43fbb7){var _0x457ae8=function(_0x940fcd){while(--_0x940fcd){_0x2a134b['push'](_0x2a134b['shift']());}};_0x457ae8(++_0x43fbb7);}(_0xf54a,0xa1));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaf54('0x0'));var rs=require(_0xaf54('0x1'));var fs=require('fs');var Redis=require(_0xaf54('0x2'));var db=require(_0xaf54('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf54('0x4'))(_0xaf54('0x5'));var config=require(_0xaf54('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf54('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a016c,_0x289e73,_0x4a7c48){return new BPromise(function(_0x47b07a,_0x15e963){return client[_0xaf54('0x8')](_0x3a016c,_0x4a7c48)[_0xaf54('0x9')](function(_0x31e386){logger[_0xaf54('0xa')]('Template,\x20%s,\x20%s',_0x289e73,'request\x20sent');logger[_0xaf54('0xb')](_0xaf54('0xc'),_0x289e73,_0xaf54('0xd'),JSON['stringify'](_0x31e386));if(_0x31e386[_0xaf54('0xe')]){if(_0x31e386[_0xaf54('0xe')][_0xaf54('0xf')]===0x1f4){logger['error'](_0xaf54('0x10'),_0x289e73,_0x31e386['error'][_0xaf54('0x11')]);return _0x15e963(_0x31e386[_0xaf54('0xe')]['message']);}logger[_0xaf54('0xe')]('Template,\x20%s,\x20%s',_0x289e73,_0x31e386['error']['message']);return _0x47b07a(_0x31e386[_0xaf54('0xe')][_0xaf54('0x11')]);}else{logger['info'](_0xaf54('0x10'),_0x289e73,_0xaf54('0xd'));_0x47b07a(_0x31e386['result'][_0xaf54('0x11')]);}})[_0xaf54('0x12')](function(_0x5c2326){logger['error'](_0xaf54('0x10'),_0x289e73,_0x5c2326);_0x15e963(_0x5c2326);});});}exports[_0xaf54('0x13')]=function(_0xce6493){var _0x12be55=this;return new Promise(function(_0x4e255a,_0xe9bf72){return db[_0xaf54('0x14')][_0xaf54('0x15')]({'raw':_0xce6493['options']?_0xce6493[_0xaf54('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')][_0xaf54('0x17')]||null:null,'attributes':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')]['attributes']||null:null,'limit':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')][_0xaf54('0x18')]||null:null,'include':_0xce6493[_0xaf54('0x16')]?_0xce6493[_0xaf54('0x16')]['include']?_['map'](_0xce6493[_0xaf54('0x16')][_0xaf54('0x19')],function(_0x6b77a5){return{'model':db[_0x6b77a5[_0xaf54('0x1a')]],'as':_0x6b77a5['as'],'attributes':_0x6b77a5[_0xaf54('0x1b')],'include':_0x6b77a5[_0xaf54('0x19')]?_[_0xaf54('0x1c')](_0x6b77a5['include'],function(_0x5448e6){return{'model':db[_0x5448e6[_0xaf54('0x1a')]],'as':_0x5448e6['as'],'attributes':_0x5448e6[_0xaf54('0x1b')],'include':_0x5448e6['include']?_[_0xaf54('0x1c')](_0x5448e6[_0xaf54('0x19')],function(_0x21324e){return{'model':db[_0x21324e[_0xaf54('0x1a')]],'as':_0x21324e['as'],'attributes':_0x21324e[_0xaf54('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaf54('0x9')](function(_0x20ccf8){logger[_0xaf54('0xa')](_0xaf54('0x13'),_0xce6493);logger['debug'](_0xaf54('0x13'),_0xce6493,JSON[_0xaf54('0x1d')](_0x20ccf8));_0x4e255a(_0x20ccf8);})[_0xaf54('0x12')](function(_0x2bf191){logger[_0xaf54('0xe')](_0xaf54('0x13'),_0x2bf191[_0xaf54('0x11')],_0xce6493);_0xe9bf72(_0x12be55[_0xaf54('0xe')](0x1f4,_0x2bf191[_0xaf54('0x11')]));});});}; \ No newline at end of file +var _0xbcff=['message','info','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','map','model','include','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s'];(function(_0x751c8f,_0x10c20e){var _0x6f1121=function(_0x2d3bdf){while(--_0x2d3bdf){_0x751c8f['push'](_0x751c8f['shift']());}};_0x6f1121(++_0x10c20e);}(_0xbcff,0x12e));var _0xfbcf=function(_0x4eb630,_0x3bbfba){_0x4eb630=_0x4eb630-0x0;var _0x46f747=_0xbcff[_0x4eb630];return _0x46f747;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b87de,_0x51ee67,_0x470fa8){return new BPromise(function(_0x520d5f,_0x1481ba){return client['request'](_0x4b87de,_0x470fa8)[_0xfbcf('0xb')](function(_0xc63f23){logger['info']('Template,\x20%s,\x20%s',_0x51ee67,_0xfbcf('0xc'));logger[_0xfbcf('0xd')](_0xfbcf('0xe'),_0x51ee67,_0xfbcf('0xc'),JSON['stringify'](_0xc63f23));if(_0xc63f23[_0xfbcf('0xf')]){if(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x10')]===0x1f4){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x1481ba(_0xc63f23['error'][_0xfbcf('0x12')]);}logger['error'](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x520d5f(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);}else{logger[_0xfbcf('0x13')](_0xfbcf('0x11'),_0x51ee67,_0xfbcf('0xc'));_0x520d5f(_0xc63f23[_0xfbcf('0x14')]['message']);}})[_0xfbcf('0x15')](function(_0xdb7a6a){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xdb7a6a);_0x1481ba(_0xdb7a6a);});});}exports[_0xfbcf('0x16')]=function(_0x2994db){var _0xe4b7f3=this;return new Promise(function(_0x3b029c,_0x239138){return db[_0xfbcf('0x17')][_0xfbcf('0x18')]({'raw':_0x2994db['options']?_0x2994db[_0xfbcf('0x19')][_0xfbcf('0x1a')]===undefined?!![]:![]:!![],'where':_0x2994db['options']?_0x2994db[_0xfbcf('0x19')][_0xfbcf('0x1b')]||null:null,'attributes':_0x2994db[_0xfbcf('0x19')]?_0x2994db[_0xfbcf('0x19')][_0xfbcf('0x1c')]||null:null,'limit':_0x2994db[_0xfbcf('0x19')]?_0x2994db[_0xfbcf('0x19')]['limit']||null:null,'include':_0x2994db[_0xfbcf('0x19')]?_0x2994db[_0xfbcf('0x19')]['include']?_[_0xfbcf('0x1d')](_0x2994db[_0xfbcf('0x19')]['include'],function(_0x409ac5){return{'model':db[_0x409ac5[_0xfbcf('0x1e')]],'as':_0x409ac5['as'],'attributes':_0x409ac5[_0xfbcf('0x1c')],'include':_0x409ac5[_0xfbcf('0x1f')]?_[_0xfbcf('0x1d')](_0x409ac5['include'],function(_0x186d99){return{'model':db[_0x186d99[_0xfbcf('0x1e')]],'as':_0x186d99['as'],'attributes':_0x186d99[_0xfbcf('0x1c')],'include':_0x186d99['include']?_['map'](_0x186d99[_0xfbcf('0x1f')],function(_0x23358b){return{'model':db[_0x23358b['model']],'as':_0x23358b['as'],'attributes':_0x23358b[_0xfbcf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfbcf('0xb')](function(_0x5da572){logger[_0xfbcf('0x13')](_0xfbcf('0x16'),_0x2994db);logger[_0xfbcf('0xd')]('GetTemplate',_0x2994db,JSON['stringify'](_0x5da572));_0x3b029c(_0x5da572);})[_0xfbcf('0x15')](function(_0x3de6e0){logger[_0xfbcf('0xf')](_0xfbcf('0x16'),_0x3de6e0[_0xfbcf('0x12')],_0x2994db);_0x239138(_0xe4b7f3[_0xfbcf('0xf')](0x1f4,_0x3de6e0[_0xfbcf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 5291f7c..59803e6 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 _0xf4e9=['fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','addAllCondition','post','addAnyCondition','addAction','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1a7c9f,_0x495a57){var _0x54bcaf=function(_0x274992){while(--_0x274992){_0x1a7c9f['push'](_0x1a7c9f['shift']());}};_0x54bcaf(++_0x495a57);}(_0xf4e9,0x174));var _0x9f4e=function(_0x3b9c2c,_0x3168fd){_0x3b9c2c=_0x3b9c2c-0x0;var _0x3e283c=_0xf4e9[_0x3b9c2c];return _0x3e283c;};'use strict';var multer=require(_0x9f4e('0x0'));var util=require(_0x9f4e('0x1'));var path=require(_0x9f4e('0x2'));var timeout=require(_0x9f4e('0x3'));var express=require(_0x9f4e('0x4'));var router=express[_0x9f4e('0x5')]();var fs_extra=require(_0x9f4e('0x6'));var auth=require(_0x9f4e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9f4e('0x8'));var controller=require(_0x9f4e('0x9'));router['get']('/',auth[_0x9f4e('0xa')](),controller[_0x9f4e('0xb')]);router[_0x9f4e('0xc')](_0x9f4e('0xd'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0xe')]);router[_0x9f4e('0xc')](_0x9f4e('0xf'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x9f4e('0xc')](_0x9f4e('0x10'),auth[_0x9f4e('0xa')](),controller['getAnyConditions']);router[_0x9f4e('0xc')](_0x9f4e('0x11'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9f4e('0xf'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x13')]);router[_0x9f4e('0x14')](_0x9f4e('0x10'),auth['isAuthenticated'](),controller[_0x9f4e('0x15')]);router[_0x9f4e('0x14')](_0x9f4e('0x11'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x16')]);router[_0x9f4e('0x17')](_0x9f4e('0xd'),auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x18')]);router[_0x9f4e('0x19')]('/:id',auth[_0x9f4e('0xa')](),controller[_0x9f4e('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xccef=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAction','put','update','delete','destroy','exports'];(function(_0xb13420,_0x5870fd){var _0x3d91c0=function(_0x9a9c8){while(--_0x9a9c8){_0xb13420['push'](_0xb13420['shift']());}};_0x3d91c0(++_0x5870fd);}(_0xccef,0x1d4));var _0xfcce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccef[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xfcce('0x0'));var path=require('path');var timeout=require(_0xfcce('0x1'));var express=require(_0xfcce('0x2'));var router=express[_0xfcce('0x3')]();var fs_extra=require(_0xfcce('0x4'));var auth=require(_0xfcce('0x5'));var interaction=require(_0xfcce('0x6'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xfcce('0x7')]('/',auth['isAuthenticated'](),controller[_0xfcce('0x8')]);router[_0xfcce('0x7')](_0xfcce('0x9'),auth[_0xfcce('0xa')](),controller[_0xfcce('0xb')]);router[_0xfcce('0x7')](_0xfcce('0xc'),auth['isAuthenticated'](),controller[_0xfcce('0xd')]);router[_0xfcce('0x7')](_0xfcce('0xe'),auth[_0xfcce('0xa')](),controller[_0xfcce('0xf')]);router[_0xfcce('0x7')](_0xfcce('0x10'),auth[_0xfcce('0xa')](),controller[_0xfcce('0x11')]);router[_0xfcce('0x12')]('/',auth[_0xfcce('0xa')](),controller['create']);router[_0xfcce('0x12')](_0xfcce('0xc'),auth[_0xfcce('0xa')](),controller[_0xfcce('0x13')]);router['post'](_0xfcce('0xe'),auth[_0xfcce('0xa')](),controller['addAnyCondition']);router['post'](_0xfcce('0x10'),auth[_0xfcce('0xa')](),controller[_0xfcce('0x14')]);router[_0xfcce('0x15')](_0xfcce('0x9'),auth[_0xfcce('0xa')](),controller[_0xfcce('0x16')]);router[_0xfcce('0x17')](_0xfcce('0x9'),auth[_0xfcce('0xa')](),controller[_0xfcce('0x18')]);module[_0xfcce('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ef44bc0..b3efe1b 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 _0x1ff6=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1ae4e5,_0x2b5181){var _0x4e4861=function(_0x20772a){while(--_0x20772a){_0x1ae4e5['push'](_0x1ae4e5['shift']());}};_0x4e4861(++_0x2b5181);}(_0x1ff6,0x68));var _0x61ff=function(_0x5cdb0f,_0xa8c789){_0x5cdb0f=_0x5cdb0f-0x0;var _0x1a6403=_0x1ff6[_0x5cdb0f];return _0x1a6403;};'use strict';var Sequelize=require(_0x61ff('0x0'));module[_0x61ff('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x61ff('0x2')]},'status':{'type':Sequelize[_0x61ff('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xaa1d=['exports','STRING','BOOLEAN'];(function(_0x49946e,_0x41da5f){var _0x474265=function(_0x5de39b){while(--_0x5de39b){_0x49946e['push'](_0x49946e['shift']());}};_0x474265(++_0x41da5f);}(_0xaa1d,0xb7));var _0xdaa1=function(_0x21b00c,_0x45df31){_0x21b00c=_0x21b00c-0x0;var _0x558aa3=_0xaa1d[_0x21b00c];return _0x558aa3;};'use strict';var Sequelize=require('sequelize');module[_0xdaa1('0x0')]={'name':{'type':Sequelize[_0xdaa1('0x1')]},'channel':{'type':Sequelize[_0xdaa1('0x1')]},'description':{'type':Sequelize[_0xdaa1('0x1')]},'status':{'type':Sequelize[_0xdaa1('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 627cabd..7d7a097 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 _0xd620=['merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','TriggerAnyId','Condition','findOne','getAllConditions','getAnyConditions','pick','length','addAction','TriggerId','getActions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','Triggers','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','filter'];(function(_0x51432c,_0x19aa29){var _0x52fa27=function(_0x501c7a){while(--_0x501c7a){_0x51432c['push'](_0x51432c['shift']());}};_0x52fa27(++_0x19aa29);}(_0xd620,0x135));var _0x0d62=function(_0x3d2fc3,_0x49d9cc){_0x3d2fc3=_0x3d2fc3-0x0;var _0x5885ce=_0xd620[_0x3d2fc3];return _0x5885ce;};'use strict';var emlformat=require(_0x0d62('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d62('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d62('0x2'));var moment=require(_0x0d62('0x3'));var BPromise=require(_0x0d62('0x4'));var Mustache=require(_0x0d62('0x5'));var util=require(_0x0d62('0x6'));var path=require('path');var sox=require(_0x0d62('0x7'));var csv=require(_0x0d62('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d62('0x9'));var _=require('lodash');var squel=require(_0x0d62('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d62('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d62('0x8'));var querystring=require(_0x0d62('0xc'));var Papa=require('papaparse');var Redis=require(_0x0d62('0xd'));var authService=require(_0x0d62('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0d62('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0d62('0x10'));var utils=require(_0x0d62('0x11'));var config=require(_0x0d62('0x12'));var licenseUtil=require(_0x0d62('0x13'));var db=require(_0x0d62('0x14'))['db'];function respondWithStatusCode(_0x14393d,_0x262323){_0x262323=_0x262323||0xcc;return function(_0xa72272){if(_0xa72272){return _0x14393d['sendStatus'](_0x262323);}return _0x14393d['status'](_0x262323)[_0x0d62('0x15')]();};}function respondWithResult(_0x3b08fd,_0xd156ad){_0xd156ad=_0xd156ad||0xc8;return function(_0x4e495b){if(_0x4e495b){return _0x3b08fd[_0x0d62('0x16')](_0xd156ad)[_0x0d62('0x17')](_0x4e495b);}};}function respondWithFilteredResult(_0x5903a6,_0x266794){return function(_0x50e776){if(_0x50e776){var _0x335d75=typeof _0x266794[_0x0d62('0x18')]===_0x0d62('0x19')&&typeof _0x266794['limit']===_0x0d62('0x19');var _0x3e3c7e=_0x50e776[_0x0d62('0x1a')];var _0x4db055=_0x335d75?0x0:_0x266794[_0x0d62('0x18')];var _0x3ff63d=_0x335d75?_0x50e776['count']:_0x266794[_0x0d62('0x18')]+_0x266794['limit'];var _0x5a4d88;if(_0x3ff63d>=_0x3e3c7e){_0x3ff63d=_0x3e3c7e;_0x5a4d88=0xc8;}else{_0x5a4d88=0xce;}_0x5903a6[_0x0d62('0x16')](_0x5a4d88);return _0x5903a6[_0x0d62('0x1b')](_0x0d62('0x1c'),_0x4db055+'-'+_0x3ff63d+'/'+_0x3e3c7e)[_0x0d62('0x17')](_0x50e776);}return null;};}function patchUpdates(_0x42bd86){return function(_0x5f1e74){try{jsonpatch[_0x0d62('0x1d')](_0x5f1e74,_0x42bd86,!![]);}catch(_0x1baac6){return BPromise['reject'](_0x1baac6);}return _0x5f1e74[_0x0d62('0x1e')]();};}function saveUpdates(_0x30751a,_0x47bfcc){return function(_0x37462a){if(_0x37462a){return _0x37462a[_0x0d62('0x1f')](_0x30751a)['then'](function(_0x37d3d5){return _0x37d3d5;});}return null;};}function removeEntity(_0x3c99f4,_0x4c0a30){return function(_0xf216c2){if(_0xf216c2){return _0xf216c2['destroy']()[_0x0d62('0x20')](function(){var _0x5e4cc8=_0xf216c2['get']({'plain':!![]});var _0x3257e2=_0x0d62('0x21');return db[_0x0d62('0x22')][_0x0d62('0x23')]({'where':{'type':_0x3257e2,'resourceId':_0x5e4cc8['id']}})[_0x0d62('0x20')](function(){return _0xf216c2;});})[_0x0d62('0x20')](function(){_0x3c99f4['status'](0xcc)[_0x0d62('0x15')]();});}};}function handleEntityNotFound(_0x3f75e5,_0x4fb8d7){return function(_0x36fcf1){if(!_0x36fcf1){_0x3f75e5['sendStatus'](0x194);}return _0x36fcf1;};}function handleError(_0x2cac7c,_0x1908d6){_0x1908d6=_0x1908d6||0x1f4;return function(_0x5d5680){logger[_0x0d62('0x24')](_0x5d5680[_0x0d62('0x25')]);if(_0x5d5680['name']){delete _0x5d5680[_0x0d62('0x26')];}_0x2cac7c[_0x0d62('0x16')](_0x1908d6)[_0x0d62('0x27')](_0x5d5680);};}exports[_0x0d62('0x28')]=function(_0x4516b9,_0x5c9e97){var _0x17b063={},_0x42bee5={},_0x331002={'count':0x0,'rows':[]};var _0x2c3dea=_[_0x0d62('0x29')](db[_0x0d62('0x2a')]['rawAttributes'],function(_0xa32d5c){return{'name':_0xa32d5c[_0x0d62('0x2b')],'type':_0xa32d5c[_0x0d62('0x2c')][_0x0d62('0x2d')]};});_0x42bee5[_0x0d62('0x2e')]=_['map'](_0x2c3dea,'name');_0x42bee5[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x4516b9[_0x0d62('0x2f')]);_0x42bee5[_0x0d62('0x31')]=_['intersection'](_0x42bee5[_0x0d62('0x2e')],_0x42bee5['query']);_0x17b063[_0x0d62('0x32')]=_[_0x0d62('0x33')](_0x42bee5['model'],qs['fields'](_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x34')]));_0x17b063['attributes']=_0x17b063[_0x0d62('0x32')]['length']?_0x17b063[_0x0d62('0x32')]:_0x42bee5[_0x0d62('0x2e')];if(!_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x35')]('nolimit')){_0x17b063[_0x0d62('0x36')]=qs[_0x0d62('0x36')](_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x36')]);_0x17b063['offset']=qs['offset'](_0x4516b9['query']['offset']);}_0x17b063[_0x0d62('0x37')]=qs['sort'](_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x38')]);_0x17b063[_0x0d62('0x39')]=qs[_0x0d62('0x31')](_['pick'](_0x4516b9[_0x0d62('0x2f')],_0x42bee5['filters']),_0x2c3dea);if(_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x3a')]){_0x17b063[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x17b063['where'],{'$or':_['map'](_0x2c3dea,function(_0x37a4c1){if(_0x37a4c1[_0x0d62('0x2c')]!==_0x0d62('0x3c')){var _0x563b4f={};_0x563b4f[_0x37a4c1[_0x0d62('0x26')]]={'$like':'%'+_0x4516b9[_0x0d62('0x2f')][_0x0d62('0x3a')]+'%'};return _0x563b4f;}})});}_0x17b063=_[_0x0d62('0x3b')]({},_0x17b063,_0x4516b9[_0x0d62('0x3d')]);var _0x9d3bd={'where':_0x17b063[_0x0d62('0x39')]};return db[_0x0d62('0x2a')][_0x0d62('0x1a')](_0x9d3bd)['then'](function(_0x34e75f){_0x331002[_0x0d62('0x1a')]=_0x34e75f;if(_0x4516b9['query']['includeAll']){_0x17b063[_0x0d62('0x3e')]=[{'all':!![]}];}return db[_0x0d62('0x2a')][_0x0d62('0x3f')](_0x17b063);})['then'](function(_0x1131c8){_0x331002[_0x0d62('0x40')]=_0x1131c8;return _0x331002;})[_0x0d62('0x20')](respondWithFilteredResult(_0x5c9e97,_0x17b063))[_0x0d62('0x41')](handleError(_0x5c9e97,null));};exports['show']=function(_0x8d3f7,_0x3c4192){var _0xe32583={'raw':![],'where':{'id':_0x8d3f7[_0x0d62('0x42')]['id']}},_0x55b7d2={};_0x55b7d2[_0x0d62('0x2e')]=_['keys'](db[_0x0d62('0x2a')][_0x0d62('0x43')]);_0x55b7d2[_0x0d62('0x2f')]=_['keys'](_0x8d3f7['query']);_0x55b7d2[_0x0d62('0x31')]=_[_0x0d62('0x33')](_0x55b7d2['model'],_0x55b7d2[_0x0d62('0x2f')]);_0xe32583['attributes']=_[_0x0d62('0x33')](_0x55b7d2[_0x0d62('0x2e')],qs['fields'](_0x8d3f7[_0x0d62('0x2f')][_0x0d62('0x34')]));_0xe32583['attributes']=_0xe32583[_0x0d62('0x32')]['length']?_0xe32583[_0x0d62('0x32')]:_0x55b7d2[_0x0d62('0x2e')];if(_0x8d3f7[_0x0d62('0x2f')][_0x0d62('0x44')]){_0xe32583[_0x0d62('0x3e')]=[{'all':!![]}];}_0xe32583=_[_0x0d62('0x3b')]({},_0xe32583,_0x8d3f7['options']);return db[_0x0d62('0x2a')][_0x0d62('0x45')](_0xe32583)[_0x0d62('0x20')](handleEntityNotFound(_0x3c4192,null))[_0x0d62('0x20')](respondWithResult(_0x3c4192,null))['catch'](handleError(_0x3c4192,null));};exports[_0x0d62('0x46')]=function(_0x7ca4ca,_0x210808){return db[_0x0d62('0x2a')][_0x0d62('0x46')](_0x7ca4ca[_0x0d62('0x47')],{})[_0x0d62('0x20')](function(_0x463ddb){var _0x1344b5=_0x7ca4ca[_0x0d62('0x48')][_0x0d62('0x49')]({'plain':!![]});if(!_0x1344b5)throw new Error(_0x0d62('0x4a'));if(_0x1344b5[_0x0d62('0x4b')]==='user'){var _0x4b770e=_0x463ddb['get']({'plain':!![]});var _0x2c9ae0=_0x0d62('0x21');return db[_0x0d62('0x4c')][_0x0d62('0x45')]({'where':{'name':_0x2c9ae0,'userProfileId':_0x1344b5[_0x0d62('0x4d')]},'raw':!![]})['then'](function(_0x50e6c1){if(_0x50e6c1&&_0x50e6c1[_0x0d62('0x4e')]===0x0){return db[_0x0d62('0x22')][_0x0d62('0x46')]({'name':_0x4b770e['name'],'resourceId':_0x4b770e['id'],'type':_0x50e6c1[_0x0d62('0x26')],'sectionId':_0x50e6c1['id']},{})[_0x0d62('0x20')](function(){return _0x463ddb;});}else{return _0x463ddb;}})[_0x0d62('0x41')](function(_0x5ef5ae){logger[_0x0d62('0x24')](_0x0d62('0x4f'),_0x5ef5ae);throw _0x5ef5ae;});}return _0x463ddb;})[_0x0d62('0x20')](respondWithResult(_0x210808,0xc9))[_0x0d62('0x41')](handleError(_0x210808,null));};exports['update']=function(_0x8796ad,_0x10f84c){if(_0x8796ad[_0x0d62('0x47')]['id']){delete _0x8796ad[_0x0d62('0x47')]['id'];}return db[_0x0d62('0x2a')][_0x0d62('0x45')]({'where':{'id':_0x8796ad[_0x0d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x10f84c,null))[_0x0d62('0x20')](saveUpdates(_0x8796ad['body'],null))[_0x0d62('0x20')](respondWithResult(_0x10f84c,null))['catch'](handleError(_0x10f84c,null));};exports[_0x0d62('0x23')]=function(_0x489067,_0x5da671){return db['Trigger'][_0x0d62('0x45')]({'where':{'id':_0x489067[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x5da671,null))[_0x0d62('0x20')](removeEntity(_0x5da671,null))['catch'](handleError(_0x5da671,null));};exports[_0x0d62('0x50')]=function(_0x2bc102,_0x2523df,_0x2fef65){if(_0x2bc102['body']['id']){delete _0x2bc102['body']['id'];}return db[_0x0d62('0x2a')][_0x0d62('0x45')]({'where':{'id':_0x2bc102[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x2523df,null))[_0x0d62('0x20')](function(_0x3ba28f){if(_0x3ba28f){_0x2bc102[_0x0d62('0x47')][_0x0d62('0x51')]=_0x3ba28f['id'];return db['Condition']['create'](_0x2bc102[_0x0d62('0x47')]);}})[_0x0d62('0x20')](respondWithResult(_0x2523df,null))[_0x0d62('0x41')](handleError(_0x2523df,null));};exports['addAnyCondition']=function(_0x8e4dba,_0x490f28,_0x4372b1){if(_0x8e4dba[_0x0d62('0x47')]['id']){delete _0x8e4dba['body']['id'];}return db['Trigger'][_0x0d62('0x45')]({'where':{'id':_0x8e4dba[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x490f28,null))[_0x0d62('0x20')](function(_0x3fc810){if(_0x3fc810){_0x8e4dba['body'][_0x0d62('0x52')]=_0x3fc810['id'];return db[_0x0d62('0x53')]['create'](_0x8e4dba[_0x0d62('0x47')]);}})[_0x0d62('0x20')](respondWithResult(_0x490f28,null))[_0x0d62('0x41')](handleError(_0x490f28,null));};exports['getAllConditions']=function(_0x44aa13,_0x9e0503,_0x4aff98){var _0x42e3cf={};var _0x13bcd8={};var _0x3f0256;var _0xf493dd;return db['Trigger'][_0x0d62('0x54')]({'where':{'id':_0x44aa13[_0x0d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x9e0503,null))[_0x0d62('0x20')](function(_0x580ce0){if(_0x580ce0){_0x3f0256=_0x580ce0;_0x13bcd8[_0x0d62('0x2e')]=_[_0x0d62('0x30')](db[_0x0d62('0x53')][_0x0d62('0x43')]);_0x13bcd8[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x44aa13[_0x0d62('0x2f')]);_0x13bcd8[_0x0d62('0x31')]=_[_0x0d62('0x33')](_0x13bcd8[_0x0d62('0x2e')],_0x13bcd8[_0x0d62('0x2f')]);_0x42e3cf[_0x0d62('0x32')]=_[_0x0d62('0x33')](_0x13bcd8[_0x0d62('0x2e')],qs[_0x0d62('0x34')](_0x44aa13[_0x0d62('0x2f')]['fields']));_0x42e3cf[_0x0d62('0x32')]=_0x42e3cf['attributes']['length']?_0x42e3cf['attributes']:_0x13bcd8[_0x0d62('0x2e')];_0x42e3cf[_0x0d62('0x37')]=qs['sort'](_0x44aa13['query'][_0x0d62('0x38')]);_0x42e3cf[_0x0d62('0x39')]=qs[_0x0d62('0x31')](_['pick'](_0x44aa13[_0x0d62('0x2f')],_0x13bcd8['filters']));if(_0x44aa13[_0x0d62('0x2f')][_0x0d62('0x3a')]){_0x42e3cf[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x42e3cf[_0x0d62('0x39')],{'$or':_[_0x0d62('0x29')](_0x42e3cf['attributes'],function(_0x580036){var _0x3e3963={};_0x3e3963[_0x580036]={'$like':'%'+_0x44aa13[_0x0d62('0x2f')][_0x0d62('0x3a')]+'%'};return _0x3e3963;})});}_0x42e3cf=_[_0x0d62('0x3b')]({},_0x42e3cf,_0x44aa13[_0x0d62('0x3d')]);return _0x3f0256[_0x0d62('0x55')](_0x42e3cf);}})[_0x0d62('0x20')](function(_0x15d059){if(_0x15d059){_0xf493dd=_0x15d059['length'];if(!_0x44aa13[_0x0d62('0x2f')][_0x0d62('0x35')]('nolimit')){_0x42e3cf[_0x0d62('0x36')]=qs[_0x0d62('0x36')](_0x44aa13['query'][_0x0d62('0x36')]);_0x42e3cf['offset']=qs[_0x0d62('0x18')](_0x44aa13[_0x0d62('0x2f')]['offset']);}return _0x3f0256[_0x0d62('0x55')](_0x42e3cf);}})[_0x0d62('0x20')](function(_0x2a8389){if(_0x2a8389){return _0x2a8389?{'count':_0xf493dd,'rows':_0x2a8389}:null;}})[_0x0d62('0x20')](respondWithResult(_0x9e0503,null))[_0x0d62('0x41')](handleError(_0x9e0503,null));};exports[_0x0d62('0x56')]=function(_0x40c022,_0x504477,_0x145bdc){var _0x17770d={};var _0x348d89={};var _0x67e396;var _0x112fb6;return db[_0x0d62('0x2a')][_0x0d62('0x54')]({'where':{'id':_0x40c022[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x504477,null))[_0x0d62('0x20')](function(_0x14d1a6){if(_0x14d1a6){_0x67e396=_0x14d1a6;_0x348d89['model']=_[_0x0d62('0x30')](db[_0x0d62('0x53')]['rawAttributes']);_0x348d89[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x40c022[_0x0d62('0x2f')]);_0x348d89[_0x0d62('0x31')]=_['intersection'](_0x348d89[_0x0d62('0x2e')],_0x348d89[_0x0d62('0x2f')]);_0x17770d['attributes']=_[_0x0d62('0x33')](_0x348d89['model'],qs['fields'](_0x40c022[_0x0d62('0x2f')][_0x0d62('0x34')]));_0x17770d['attributes']=_0x17770d[_0x0d62('0x32')]['length']?_0x17770d[_0x0d62('0x32')]:_0x348d89[_0x0d62('0x2e')];_0x17770d[_0x0d62('0x37')]=qs[_0x0d62('0x38')](_0x40c022[_0x0d62('0x2f')]['sort']);_0x17770d[_0x0d62('0x39')]=qs[_0x0d62('0x31')](_[_0x0d62('0x57')](_0x40c022[_0x0d62('0x2f')],_0x348d89[_0x0d62('0x31')]));if(_0x40c022[_0x0d62('0x2f')]['filter']){_0x17770d[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x17770d[_0x0d62('0x39')],{'$or':_[_0x0d62('0x29')](_0x17770d[_0x0d62('0x32')],function(_0x24c1fa){var _0x11b66a={};_0x11b66a[_0x24c1fa]={'$like':'%'+_0x40c022['query']['filter']+'%'};return _0x11b66a;})});}_0x17770d=_[_0x0d62('0x3b')]({},_0x17770d,_0x40c022['options']);return _0x67e396['getAnyConditions'](_0x17770d);}})[_0x0d62('0x20')](function(_0x2ae973){if(_0x2ae973){_0x112fb6=_0x2ae973[_0x0d62('0x58')];if(!_0x40c022['query'][_0x0d62('0x35')]('nolimit')){_0x17770d[_0x0d62('0x36')]=qs['limit'](_0x40c022[_0x0d62('0x2f')][_0x0d62('0x36')]);_0x17770d['offset']=qs['offset'](_0x40c022[_0x0d62('0x2f')][_0x0d62('0x18')]);}return _0x67e396[_0x0d62('0x56')](_0x17770d);}})[_0x0d62('0x20')](function(_0x4178d8){if(_0x4178d8){return _0x4178d8?{'count':_0x112fb6,'rows':_0x4178d8}:null;}})['then'](respondWithResult(_0x504477,null))['catch'](handleError(_0x504477,null));};exports[_0x0d62('0x59')]=function(_0x2ea59f,_0x265478,_0x4e3ef5){if(_0x2ea59f['body']['id']){delete _0x2ea59f[_0x0d62('0x47')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2ea59f[_0x0d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x265478,null))['then'](function(_0x2eea28){if(_0x2eea28){_0x2ea59f[_0x0d62('0x47')][_0x0d62('0x5a')]=_0x2eea28['id'];return db['Action'][_0x0d62('0x46')](_0x2ea59f[_0x0d62('0x47')]);}})[_0x0d62('0x20')](respondWithResult(_0x265478,null))[_0x0d62('0x41')](handleError(_0x265478,null));};exports['getActions']=function(_0x7c0462,_0x5455ef,_0x2f4804){var _0x2b45c3={};var _0x2bfa96={};var _0x149630;var _0x144677;return db[_0x0d62('0x2a')][_0x0d62('0x54')]({'where':{'id':_0x7c0462[_0x0d62('0x42')]['id']}})[_0x0d62('0x20')](handleEntityNotFound(_0x5455ef,null))[_0x0d62('0x20')](function(_0x30c6f6){if(_0x30c6f6){_0x149630=_0x30c6f6;_0x2bfa96['model']=_['keys'](db['Action'][_0x0d62('0x43')]);_0x2bfa96[_0x0d62('0x2f')]=_[_0x0d62('0x30')](_0x7c0462[_0x0d62('0x2f')]);_0x2bfa96[_0x0d62('0x31')]=_[_0x0d62('0x33')](_0x2bfa96[_0x0d62('0x2e')],_0x2bfa96['query']);_0x2b45c3['attributes']=_[_0x0d62('0x33')](_0x2bfa96['model'],qs[_0x0d62('0x34')](_0x7c0462[_0x0d62('0x2f')][_0x0d62('0x34')]));_0x2b45c3['attributes']=_0x2b45c3['attributes'][_0x0d62('0x58')]?_0x2b45c3[_0x0d62('0x32')]:_0x2bfa96[_0x0d62('0x2e')];_0x2b45c3[_0x0d62('0x37')]=qs['sort'](_0x7c0462['query'][_0x0d62('0x38')]);_0x2b45c3['where']=qs[_0x0d62('0x31')](_['pick'](_0x7c0462[_0x0d62('0x2f')],_0x2bfa96[_0x0d62('0x31')]));if(_0x7c0462[_0x0d62('0x2f')][_0x0d62('0x3a')]){_0x2b45c3[_0x0d62('0x39')]=_[_0x0d62('0x3b')](_0x2b45c3[_0x0d62('0x39')],{'$or':_[_0x0d62('0x29')](_0x2b45c3[_0x0d62('0x32')],function(_0x4b3979){var _0x4dabfe={};_0x4dabfe[_0x4b3979]={'$like':'%'+_0x7c0462['query'][_0x0d62('0x3a')]+'%'};return _0x4dabfe;})});}_0x2b45c3=_[_0x0d62('0x3b')]({},_0x2b45c3,_0x7c0462['options']);return _0x149630[_0x0d62('0x5b')](_0x2b45c3);}})['then'](function(_0x4a08e2){if(_0x4a08e2){_0x144677=_0x4a08e2[_0x0d62('0x58')];if(!_0x7c0462[_0x0d62('0x2f')][_0x0d62('0x35')]('nolimit')){_0x2b45c3[_0x0d62('0x36')]=qs[_0x0d62('0x36')](_0x7c0462[_0x0d62('0x2f')]['limit']);_0x2b45c3['offset']=qs[_0x0d62('0x18')](_0x7c0462['query'][_0x0d62('0x18')]);}return _0x149630[_0x0d62('0x5b')](_0x2b45c3);}})[_0x0d62('0x20')](function(_0x4a6794){if(_0x4a6794){return _0x4a6794?{'count':_0x144677,'rows':_0x4a6794}:null;}})['then'](respondWithResult(_0x5455ef,null))['catch'](handleError(_0x5455ef,null));}; \ No newline at end of file +var _0x2ebe=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','count','set','apply','save','update','then','get','Triggers','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','options','includeAll','Trigger','rows','catch','show','params','include','merge','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','create','addAnyCondition','order','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x364c9e,_0x18be8e){var _0x1004a0=function(_0x5641ca){while(--_0x5641ca){_0x364c9e['push'](_0x364c9e['shift']());}};_0x1004a0(++_0x18be8e);}(_0x2ebe,0xa7));var _0xe2eb=function(_0x4c926a,_0x116e51){_0x4c926a=_0x4c926a-0x0;var _0x3a6eec=_0x2ebe[_0x4c926a];return _0x3a6eec;};'use strict';var emlformat=require(_0xe2eb('0x0'));var rimraf=require(_0xe2eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2eb('0x2'));var rp=require('request-promise');var moment=require(_0xe2eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2eb('0x4'));var util=require(_0xe2eb('0x5'));var path=require(_0xe2eb('0x6'));var sox=require(_0xe2eb('0x7'));var csv=require(_0xe2eb('0x8'));var ejs=require(_0xe2eb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe2eb('0xa'));var jsforce=require(_0xe2eb('0xb'));var deskjs=require(_0xe2eb('0xc'));var toCsv=require(_0xe2eb('0x8'));var querystring=require(_0xe2eb('0xd'));var Papa=require(_0xe2eb('0xe'));var Redis=require('ioredis');var authService=require(_0xe2eb('0xf'));var qs=require(_0xe2eb('0x10'));var as=require(_0xe2eb('0x11'));var hardwareService=require(_0xe2eb('0x12'));var logger=require(_0xe2eb('0x13'))(_0xe2eb('0x14'));var utils=require('../../config/utils');var config=require(_0xe2eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2eb('0x16'))['db'];function respondWithStatusCode(_0x1c9764,_0xe00ce7){_0xe00ce7=_0xe00ce7||0xcc;return function(_0x186d68){if(_0x186d68){return _0x1c9764['sendStatus'](_0xe00ce7);}return _0x1c9764[_0xe2eb('0x17')](_0xe00ce7)['end']();};}function respondWithResult(_0x4e3bf7,_0x5979ab){_0x5979ab=_0x5979ab||0xc8;return function(_0x43dd10){if(_0x43dd10){return _0x4e3bf7[_0xe2eb('0x17')](_0x5979ab)['json'](_0x43dd10);}};}function respondWithFilteredResult(_0x1570a1,_0x566fb1){return function(_0x20c168){if(_0x20c168){var _0x6ff548=typeof _0x566fb1[_0xe2eb('0x18')]===_0xe2eb('0x19')&&typeof _0x566fb1['limit']===_0xe2eb('0x19');var _0x57ca09=_0x20c168[_0xe2eb('0x1a')];var _0x13dfeb=_0x6ff548?0x0:_0x566fb1[_0xe2eb('0x18')];var _0x3e069d=_0x6ff548?_0x20c168[_0xe2eb('0x1a')]:_0x566fb1[_0xe2eb('0x18')]+_0x566fb1['limit'];var _0x40da6f;if(_0x3e069d>=_0x57ca09){_0x3e069d=_0x57ca09;_0x40da6f=0xc8;}else{_0x40da6f=0xce;}_0x1570a1[_0xe2eb('0x17')](_0x40da6f);return _0x1570a1[_0xe2eb('0x1b')]('Content-Range',_0x13dfeb+'-'+_0x3e069d+'/'+_0x57ca09)['json'](_0x20c168);}return null;};}function patchUpdates(_0x5b662d){return function(_0xd90fb9){try{jsonpatch[_0xe2eb('0x1c')](_0xd90fb9,_0x5b662d,!![]);}catch(_0x5f5cb2){return BPromise['reject'](_0x5f5cb2);}return _0xd90fb9[_0xe2eb('0x1d')]();};}function saveUpdates(_0x2ee495,_0x175f2b){return function(_0x155e06){if(_0x155e06){return _0x155e06[_0xe2eb('0x1e')](_0x2ee495)[_0xe2eb('0x1f')](function(_0x30d62c){return _0x30d62c;});}return null;};}function removeEntity(_0x36788f,_0x39b2c1){return function(_0x583a2d){if(_0x583a2d){return _0x583a2d['destroy']()[_0xe2eb('0x1f')](function(){var _0x1320e6=_0x583a2d[_0xe2eb('0x20')]({'plain':!![]});var _0x342639=_0xe2eb('0x21');return db[_0xe2eb('0x22')][_0xe2eb('0x23')]({'where':{'type':_0x342639,'resourceId':_0x1320e6['id']}})['then'](function(){return _0x583a2d;});})[_0xe2eb('0x1f')](function(){_0x36788f[_0xe2eb('0x17')](0xcc)[_0xe2eb('0x24')]();});}};}function handleEntityNotFound(_0x181093,_0x247033){return function(_0x262eb9){if(!_0x262eb9){_0x181093[_0xe2eb('0x25')](0x194);}return _0x262eb9;};}function handleError(_0x1cae6a,_0x8eba10){_0x8eba10=_0x8eba10||0x1f4;return function(_0x107343){logger[_0xe2eb('0x26')](_0x107343[_0xe2eb('0x27')]);if(_0x107343[_0xe2eb('0x28')]){delete _0x107343['name'];}_0x1cae6a[_0xe2eb('0x17')](_0x8eba10)[_0xe2eb('0x29')](_0x107343);};}exports[_0xe2eb('0x2a')]=function(_0x232023,_0xf600a3){var _0x386528={},_0x4b7f03={},_0x451a3c={'count':0x0,'rows':[]};var _0x9e308f=_[_0xe2eb('0x2b')](db['Trigger'][_0xe2eb('0x2c')],function(_0x192a3c){return{'name':_0x192a3c[_0xe2eb('0x2d')],'type':_0x192a3c[_0xe2eb('0x2e')][_0xe2eb('0x2f')]};});_0x4b7f03[_0xe2eb('0x30')]=_['map'](_0x9e308f,_0xe2eb('0x28'));_0x4b7f03[_0xe2eb('0x31')]=_[_0xe2eb('0x32')](_0x232023[_0xe2eb('0x31')]);_0x4b7f03['filters']=_[_0xe2eb('0x33')](_0x4b7f03[_0xe2eb('0x30')],_0x4b7f03['query']);_0x386528[_0xe2eb('0x34')]=_[_0xe2eb('0x33')](_0x4b7f03[_0xe2eb('0x30')],qs[_0xe2eb('0x35')](_0x232023[_0xe2eb('0x31')][_0xe2eb('0x35')]));_0x386528[_0xe2eb('0x34')]=_0x386528[_0xe2eb('0x34')][_0xe2eb('0x36')]?_0x386528[_0xe2eb('0x34')]:_0x4b7f03[_0xe2eb('0x30')];if(!_0x232023[_0xe2eb('0x31')][_0xe2eb('0x37')](_0xe2eb('0x38'))){_0x386528[_0xe2eb('0x39')]=qs['limit'](_0x232023[_0xe2eb('0x31')][_0xe2eb('0x39')]);_0x386528[_0xe2eb('0x18')]=qs[_0xe2eb('0x18')](_0x232023[_0xe2eb('0x31')][_0xe2eb('0x18')]);}_0x386528['order']=qs[_0xe2eb('0x3a')](_0x232023[_0xe2eb('0x31')][_0xe2eb('0x3a')]);_0x386528[_0xe2eb('0x3b')]=qs[_0xe2eb('0x3c')](_[_0xe2eb('0x3d')](_0x232023[_0xe2eb('0x31')],_0x4b7f03[_0xe2eb('0x3c')]),_0x9e308f);if(_0x232023['query'][_0xe2eb('0x3e')]){_0x386528[_0xe2eb('0x3b')]=_['merge'](_0x386528['where'],{'$or':_['map'](_0x9e308f,function(_0x140b35){if(_0x140b35[_0xe2eb('0x2e')]!=='VIRTUAL'){var _0x408cd6={};_0x408cd6[_0x140b35['name']]={'$like':'%'+_0x232023[_0xe2eb('0x31')][_0xe2eb('0x3e')]+'%'};return _0x408cd6;}})});}_0x386528=_['merge']({},_0x386528,_0x232023[_0xe2eb('0x3f')]);var _0x54a488={'where':_0x386528[_0xe2eb('0x3b')]};return db['Trigger'][_0xe2eb('0x1a')](_0x54a488)[_0xe2eb('0x1f')](function(_0x3247ad){_0x451a3c['count']=_0x3247ad;if(_0x232023[_0xe2eb('0x31')][_0xe2eb('0x40')]){_0x386528['include']=[{'all':!![]}];}return db[_0xe2eb('0x41')]['findAll'](_0x386528);})[_0xe2eb('0x1f')](function(_0x3ebacc){_0x451a3c[_0xe2eb('0x42')]=_0x3ebacc;return _0x451a3c;})[_0xe2eb('0x1f')](respondWithFilteredResult(_0xf600a3,_0x386528))[_0xe2eb('0x43')](handleError(_0xf600a3,null));};exports[_0xe2eb('0x44')]=function(_0x339fd8,_0x3a7abc){var _0x580208={'raw':![],'where':{'id':_0x339fd8[_0xe2eb('0x45')]['id']}},_0x3c54fe={};_0x3c54fe['model']=_[_0xe2eb('0x32')](db[_0xe2eb('0x41')]['rawAttributes']);_0x3c54fe[_0xe2eb('0x31')]=_['keys'](_0x339fd8[_0xe2eb('0x31')]);_0x3c54fe[_0xe2eb('0x3c')]=_[_0xe2eb('0x33')](_0x3c54fe[_0xe2eb('0x30')],_0x3c54fe['query']);_0x580208[_0xe2eb('0x34')]=_[_0xe2eb('0x33')](_0x3c54fe[_0xe2eb('0x30')],qs[_0xe2eb('0x35')](_0x339fd8[_0xe2eb('0x31')][_0xe2eb('0x35')]));_0x580208[_0xe2eb('0x34')]=_0x580208[_0xe2eb('0x34')][_0xe2eb('0x36')]?_0x580208['attributes']:_0x3c54fe[_0xe2eb('0x30')];if(_0x339fd8[_0xe2eb('0x31')][_0xe2eb('0x40')]){_0x580208[_0xe2eb('0x46')]=[{'all':!![]}];}_0x580208=_[_0xe2eb('0x47')]({},_0x580208,_0x339fd8[_0xe2eb('0x3f')]);return db['Trigger']['find'](_0x580208)['then'](handleEntityNotFound(_0x3a7abc,null))[_0xe2eb('0x1f')](respondWithResult(_0x3a7abc,null))[_0xe2eb('0x43')](handleError(_0x3a7abc,null));};exports['create']=function(_0x4a7475,_0x985bca){return db[_0xe2eb('0x41')]['create'](_0x4a7475[_0xe2eb('0x48')],{})[_0xe2eb('0x1f')](function(_0x124339){var _0xbfae37=_0x4a7475[_0xe2eb('0x49')][_0xe2eb('0x20')]({'plain':!![]});if(!_0xbfae37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbfae37['role']===_0xe2eb('0x49')){var _0x3a3321=_0x124339[_0xe2eb('0x20')]({'plain':!![]});var _0x44cd4d=_0xe2eb('0x21');return db[_0xe2eb('0x4a')][_0xe2eb('0x4b')]({'where':{'name':_0x44cd4d,'userProfileId':_0xbfae37[_0xe2eb('0x4c')]},'raw':!![]})[_0xe2eb('0x1f')](function(_0x28355d){if(_0x28355d&&_0x28355d[_0xe2eb('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x3a3321[_0xe2eb('0x28')],'resourceId':_0x3a3321['id'],'type':_0x28355d[_0xe2eb('0x28')],'sectionId':_0x28355d['id']},{})['then'](function(){return _0x124339;});}else{return _0x124339;}})[_0xe2eb('0x43')](function(_0x2cdcf3){logger[_0xe2eb('0x26')](_0xe2eb('0x4e'),_0x2cdcf3);throw _0x2cdcf3;});}return _0x124339;})[_0xe2eb('0x1f')](respondWithResult(_0x985bca,0xc9))[_0xe2eb('0x43')](handleError(_0x985bca,null));};exports[_0xe2eb('0x1e')]=function(_0x24f329,_0x455940){if(_0x24f329['body']['id']){delete _0x24f329[_0xe2eb('0x48')]['id'];}return db[_0xe2eb('0x41')]['find']({'where':{'id':_0x24f329[_0xe2eb('0x45')]['id']}})[_0xe2eb('0x1f')](handleEntityNotFound(_0x455940,null))[_0xe2eb('0x1f')](saveUpdates(_0x24f329[_0xe2eb('0x48')],null))['then'](respondWithResult(_0x455940,null))['catch'](handleError(_0x455940,null));};exports[_0xe2eb('0x23')]=function(_0x99c654,_0x1bd324){return db[_0xe2eb('0x41')][_0xe2eb('0x4b')]({'where':{'id':_0x99c654[_0xe2eb('0x45')]['id']}})[_0xe2eb('0x1f')](handleEntityNotFound(_0x1bd324,null))['then'](removeEntity(_0x1bd324,null))[_0xe2eb('0x43')](handleError(_0x1bd324,null));};exports[_0xe2eb('0x4f')]=function(_0x1805cd,_0x57ae29,_0x555010){if(_0x1805cd[_0xe2eb('0x48')]['id']){delete _0x1805cd[_0xe2eb('0x48')]['id'];}return db['Trigger'][_0xe2eb('0x4b')]({'where':{'id':_0x1805cd[_0xe2eb('0x45')]['id']}})[_0xe2eb('0x1f')](handleEntityNotFound(_0x57ae29,null))['then'](function(_0x17e82e){if(_0x17e82e){_0x1805cd[_0xe2eb('0x48')]['TriggerAllId']=_0x17e82e['id'];return db[_0xe2eb('0x50')][_0xe2eb('0x51')](_0x1805cd['body']);}})[_0xe2eb('0x1f')](respondWithResult(_0x57ae29,null))[_0xe2eb('0x43')](handleError(_0x57ae29,null));};exports[_0xe2eb('0x52')]=function(_0xc6a307,_0x29d9a9,_0x249a12){if(_0xc6a307[_0xe2eb('0x48')]['id']){delete _0xc6a307['body']['id'];}return db[_0xe2eb('0x41')]['find']({'where':{'id':_0xc6a307['params']['id']}})[_0xe2eb('0x1f')](handleEntityNotFound(_0x29d9a9,null))['then'](function(_0x14ac68){if(_0x14ac68){_0xc6a307[_0xe2eb('0x48')]['TriggerAnyId']=_0x14ac68['id'];return db[_0xe2eb('0x50')][_0xe2eb('0x51')](_0xc6a307[_0xe2eb('0x48')]);}})[_0xe2eb('0x1f')](respondWithResult(_0x29d9a9,null))['catch'](handleError(_0x29d9a9,null));};exports['getAllConditions']=function(_0x134a0b,_0x59e57a,_0x135cf7){var _0x17bafc={};var _0x1f651e={};var _0xb1b008;var _0x1eee3a;return db['Trigger']['findOne']({'where':{'id':_0x134a0b[_0xe2eb('0x45')]['id']}})[_0xe2eb('0x1f')](handleEntityNotFound(_0x59e57a,null))[_0xe2eb('0x1f')](function(_0x3ba261){if(_0x3ba261){_0xb1b008=_0x3ba261;_0x1f651e['model']=_[_0xe2eb('0x32')](db['Condition'][_0xe2eb('0x2c')]);_0x1f651e[_0xe2eb('0x31')]=_[_0xe2eb('0x32')](_0x134a0b['query']);_0x1f651e['filters']=_['intersection'](_0x1f651e[_0xe2eb('0x30')],_0x1f651e[_0xe2eb('0x31')]);_0x17bafc[_0xe2eb('0x34')]=_[_0xe2eb('0x33')](_0x1f651e[_0xe2eb('0x30')],qs[_0xe2eb('0x35')](_0x134a0b[_0xe2eb('0x31')][_0xe2eb('0x35')]));_0x17bafc[_0xe2eb('0x34')]=_0x17bafc[_0xe2eb('0x34')][_0xe2eb('0x36')]?_0x17bafc['attributes']:_0x1f651e['model'];_0x17bafc[_0xe2eb('0x53')]=qs[_0xe2eb('0x3a')](_0x134a0b[_0xe2eb('0x31')][_0xe2eb('0x3a')]);_0x17bafc[_0xe2eb('0x3b')]=qs[_0xe2eb('0x3c')](_[_0xe2eb('0x3d')](_0x134a0b[_0xe2eb('0x31')],_0x1f651e[_0xe2eb('0x3c')]));if(_0x134a0b[_0xe2eb('0x31')][_0xe2eb('0x3e')]){_0x17bafc[_0xe2eb('0x3b')]=_[_0xe2eb('0x47')](_0x17bafc['where'],{'$or':_[_0xe2eb('0x2b')](_0x17bafc[_0xe2eb('0x34')],function(_0x1035f0){var _0x5d559d={};_0x5d559d[_0x1035f0]={'$like':'%'+_0x134a0b[_0xe2eb('0x31')][_0xe2eb('0x3e')]+'%'};return _0x5d559d;})});}_0x17bafc=_[_0xe2eb('0x47')]({},_0x17bafc,_0x134a0b[_0xe2eb('0x3f')]);return _0xb1b008[_0xe2eb('0x54')](_0x17bafc);}})[_0xe2eb('0x1f')](function(_0x43b25){if(_0x43b25){_0x1eee3a=_0x43b25[_0xe2eb('0x36')];if(!_0x134a0b[_0xe2eb('0x31')]['hasOwnProperty'](_0xe2eb('0x38'))){_0x17bafc[_0xe2eb('0x39')]=qs[_0xe2eb('0x39')](_0x134a0b[_0xe2eb('0x31')][_0xe2eb('0x39')]);_0x17bafc['offset']=qs['offset'](_0x134a0b[_0xe2eb('0x31')]['offset']);}return _0xb1b008[_0xe2eb('0x54')](_0x17bafc);}})[_0xe2eb('0x1f')](function(_0x3ca891){if(_0x3ca891){return _0x3ca891?{'count':_0x1eee3a,'rows':_0x3ca891}:null;}})[_0xe2eb('0x1f')](respondWithResult(_0x59e57a,null))[_0xe2eb('0x43')](handleError(_0x59e57a,null));};exports[_0xe2eb('0x55')]=function(_0x591d38,_0x41760e,_0x36cc58){var _0x5b049f={};var _0x564b82={};var _0x2bd2ea;var _0x43ccf1;return db['Trigger'][_0xe2eb('0x56')]({'where':{'id':_0x591d38[_0xe2eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x41760e,null))[_0xe2eb('0x1f')](function(_0x5663c3){if(_0x5663c3){_0x2bd2ea=_0x5663c3;_0x564b82[_0xe2eb('0x30')]=_[_0xe2eb('0x32')](db['Condition'][_0xe2eb('0x2c')]);_0x564b82['query']=_['keys'](_0x591d38[_0xe2eb('0x31')]);_0x564b82[_0xe2eb('0x3c')]=_[_0xe2eb('0x33')](_0x564b82[_0xe2eb('0x30')],_0x564b82[_0xe2eb('0x31')]);_0x5b049f['attributes']=_[_0xe2eb('0x33')](_0x564b82[_0xe2eb('0x30')],qs['fields'](_0x591d38[_0xe2eb('0x31')][_0xe2eb('0x35')]));_0x5b049f[_0xe2eb('0x34')]=_0x5b049f[_0xe2eb('0x34')][_0xe2eb('0x36')]?_0x5b049f[_0xe2eb('0x34')]:_0x564b82['model'];_0x5b049f[_0xe2eb('0x53')]=qs[_0xe2eb('0x3a')](_0x591d38[_0xe2eb('0x31')][_0xe2eb('0x3a')]);_0x5b049f['where']=qs[_0xe2eb('0x3c')](_[_0xe2eb('0x3d')](_0x591d38[_0xe2eb('0x31')],_0x564b82[_0xe2eb('0x3c')]));if(_0x591d38['query'][_0xe2eb('0x3e')]){_0x5b049f['where']=_[_0xe2eb('0x47')](_0x5b049f['where'],{'$or':_['map'](_0x5b049f[_0xe2eb('0x34')],function(_0x2354a6){var _0x46b1ec={};_0x46b1ec[_0x2354a6]={'$like':'%'+_0x591d38['query'][_0xe2eb('0x3e')]+'%'};return _0x46b1ec;})});}_0x5b049f=_['merge']({},_0x5b049f,_0x591d38[_0xe2eb('0x3f')]);return _0x2bd2ea[_0xe2eb('0x55')](_0x5b049f);}})[_0xe2eb('0x1f')](function(_0xc351a1){if(_0xc351a1){_0x43ccf1=_0xc351a1[_0xe2eb('0x36')];if(!_0x591d38[_0xe2eb('0x31')][_0xe2eb('0x37')](_0xe2eb('0x38'))){_0x5b049f['limit']=qs[_0xe2eb('0x39')](_0x591d38[_0xe2eb('0x31')][_0xe2eb('0x39')]);_0x5b049f[_0xe2eb('0x18')]=qs[_0xe2eb('0x18')](_0x591d38[_0xe2eb('0x31')][_0xe2eb('0x18')]);}return _0x2bd2ea['getAnyConditions'](_0x5b049f);}})[_0xe2eb('0x1f')](function(_0x4b9af8){if(_0x4b9af8){return _0x4b9af8?{'count':_0x43ccf1,'rows':_0x4b9af8}:null;}})['then'](respondWithResult(_0x41760e,null))[_0xe2eb('0x43')](handleError(_0x41760e,null));};exports[_0xe2eb('0x57')]=function(_0x2a66ef,_0x217f01,_0x56ac3c){if(_0x2a66ef['body']['id']){delete _0x2a66ef[_0xe2eb('0x48')]['id'];}return db[_0xe2eb('0x41')][_0xe2eb('0x4b')]({'where':{'id':_0x2a66ef[_0xe2eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x217f01,null))['then'](function(_0x4b188f){if(_0x4b188f){_0x2a66ef[_0xe2eb('0x48')][_0xe2eb('0x58')]=_0x4b188f['id'];return db[_0xe2eb('0x59')][_0xe2eb('0x51')](_0x2a66ef[_0xe2eb('0x48')]);}})[_0xe2eb('0x1f')](respondWithResult(_0x217f01,null))[_0xe2eb('0x43')](handleError(_0x217f01,null));};exports['getActions']=function(_0x384c0e,_0x3cc978,_0x54f6ae){var _0x4c29d3={};var _0x258a51={};var _0xac4eb9;var _0x1a942d;return db[_0xe2eb('0x41')]['findOne']({'where':{'id':_0x384c0e[_0xe2eb('0x45')]['id']}})[_0xe2eb('0x1f')](handleEntityNotFound(_0x3cc978,null))[_0xe2eb('0x1f')](function(_0x4f05b4){if(_0x4f05b4){_0xac4eb9=_0x4f05b4;_0x258a51[_0xe2eb('0x30')]=_[_0xe2eb('0x32')](db['Action'][_0xe2eb('0x2c')]);_0x258a51[_0xe2eb('0x31')]=_[_0xe2eb('0x32')](_0x384c0e[_0xe2eb('0x31')]);_0x258a51['filters']=_[_0xe2eb('0x33')](_0x258a51['model'],_0x258a51['query']);_0x4c29d3[_0xe2eb('0x34')]=_[_0xe2eb('0x33')](_0x258a51['model'],qs[_0xe2eb('0x35')](_0x384c0e[_0xe2eb('0x31')][_0xe2eb('0x35')]));_0x4c29d3[_0xe2eb('0x34')]=_0x4c29d3['attributes'][_0xe2eb('0x36')]?_0x4c29d3[_0xe2eb('0x34')]:_0x258a51[_0xe2eb('0x30')];_0x4c29d3['order']=qs[_0xe2eb('0x3a')](_0x384c0e['query'][_0xe2eb('0x3a')]);_0x4c29d3['where']=qs[_0xe2eb('0x3c')](_['pick'](_0x384c0e[_0xe2eb('0x31')],_0x258a51['filters']));if(_0x384c0e[_0xe2eb('0x31')][_0xe2eb('0x3e')]){_0x4c29d3[_0xe2eb('0x3b')]=_['merge'](_0x4c29d3[_0xe2eb('0x3b')],{'$or':_[_0xe2eb('0x2b')](_0x4c29d3[_0xe2eb('0x34')],function(_0x12b5ee){var _0xb985f2={};_0xb985f2[_0x12b5ee]={'$like':'%'+_0x384c0e[_0xe2eb('0x31')][_0xe2eb('0x3e')]+'%'};return _0xb985f2;})});}_0x4c29d3=_[_0xe2eb('0x47')]({},_0x4c29d3,_0x384c0e[_0xe2eb('0x3f')]);return _0xac4eb9[_0xe2eb('0x5a')](_0x4c29d3);}})[_0xe2eb('0x1f')](function(_0x2c8262){if(_0x2c8262){_0x1a942d=_0x2c8262[_0xe2eb('0x36')];if(!_0x384c0e[_0xe2eb('0x31')][_0xe2eb('0x37')](_0xe2eb('0x38'))){_0x4c29d3['limit']=qs['limit'](_0x384c0e[_0xe2eb('0x31')][_0xe2eb('0x39')]);_0x4c29d3['offset']=qs['offset'](_0x384c0e[_0xe2eb('0x31')]['offset']);}return _0xac4eb9[_0xe2eb('0x5a')](_0x4c29d3);}})[_0xe2eb('0x1f')](function(_0x5b8111){if(_0x5b8111){return _0x5b8111?{'count':_0x1a942d,'rows':_0x5b8111}:null;}})[_0xe2eb('0x1f')](respondWithResult(_0x3cc978,null))[_0xe2eb('0x43')](handleError(_0x3cc978,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index fc38148..a7a62c4 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 _0x7579=['define','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x5e7c7e,_0x41fbb1){var _0x4e85de=function(_0xac92bc){while(--_0xac92bc){_0x5e7c7e['push'](_0x5e7c7e['shift']());}};_0x4e85de(++_0x41fbb1);}(_0x7579,0x1e2));var _0x9757=function(_0x1cf913,_0x1f32c3){_0x1cf913=_0x1cf913-0x0;var _0x45f562=_0x7579[_0x1cf913];return _0x45f562;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('Trigger',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x9a19,0x114));var _0x99a1=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x9a19[_0xd09668];return _0x68726;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index fef8983..afeed97 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 _0x85c9=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','options','where','attributes','limit','map','include','model','debug','Trigger','find','raw','ShowTrigger','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x246233,_0x322137){var _0x48f431=function(_0x2f41e4){while(--_0x2f41e4){_0x246233['push'](_0x246233['shift']());}};_0x48f431(++_0x322137);}(_0x85c9,0x167));var _0x985c=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x85c9[_0x2d364e];return _0x1b9312;};'use strict';var _=require('lodash');var util=require(_0x985c('0x0'));var moment=require('moment');var BPromise=require(_0x985c('0x1'));var rs=require(_0x985c('0x2'));var fs=require('fs');var Redis=require(_0x985c('0x3'));var db=require(_0x985c('0x4'))['db'];var utils=require(_0x985c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x985c('0x6'));var jayson=require(_0x985c('0x7'));var client=jayson[_0x985c('0x8')][_0x985c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32ab7b,_0x372404,_0x4d16b1){return new BPromise(function(_0x119c1a,_0xe9956d){return client[_0x985c('0xa')](_0x32ab7b,_0x4d16b1)[_0x985c('0xb')](function(_0x27c58c){logger[_0x985c('0xc')](_0x985c('0xd'),_0x372404,_0x985c('0xe'));logger['debug'](_0x985c('0xf'),_0x372404,_0x985c('0xe'),JSON[_0x985c('0x10')](_0x27c58c));if(_0x27c58c[_0x985c('0x11')]){if(_0x27c58c[_0x985c('0x11')][_0x985c('0x12')]===0x1f4){logger[_0x985c('0x11')](_0x985c('0xd'),_0x372404,_0x27c58c[_0x985c('0x11')][_0x985c('0x13')]);return _0xe9956d(_0x27c58c[_0x985c('0x11')]['message']);}logger[_0x985c('0x11')](_0x985c('0xd'),_0x372404,_0x27c58c[_0x985c('0x11')][_0x985c('0x13')]);return _0x119c1a(_0x27c58c[_0x985c('0x11')][_0x985c('0x13')]);}else{logger[_0x985c('0xc')](_0x985c('0xd'),_0x372404,_0x985c('0xe'));_0x119c1a(_0x27c58c['result'][_0x985c('0x13')]);}})[_0x985c('0x14')](function(_0x34ad16){logger[_0x985c('0x11')](_0x985c('0xd'),_0x372404,_0x34ad16);_0xe9956d(_0x34ad16);});});}exports[_0x985c('0x15')]=function(_0x2e700d){var _0x1981de=this;return new Promise(function(_0x1e0c57,_0x169bf4){return db['Trigger']['findAll']({'raw':_0x2e700d[_0x985c('0x16')]?_0x2e700d[_0x985c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2e700d[_0x985c('0x16')]?_0x2e700d['options'][_0x985c('0x17')]||null:null,'attributes':_0x2e700d[_0x985c('0x16')]?_0x2e700d[_0x985c('0x16')][_0x985c('0x18')]||null:null,'limit':_0x2e700d['options']?_0x2e700d[_0x985c('0x16')][_0x985c('0x19')]||null:null,'include':_0x2e700d[_0x985c('0x16')]?_0x2e700d['options']['include']?_[_0x985c('0x1a')](_0x2e700d[_0x985c('0x16')][_0x985c('0x1b')],function(_0x33c3eb){return{'model':db[_0x33c3eb[_0x985c('0x1c')]],'as':_0x33c3eb['as'],'attributes':_0x33c3eb[_0x985c('0x18')],'include':_0x33c3eb[_0x985c('0x1b')]?_[_0x985c('0x1a')](_0x33c3eb['include'],function(_0x15507f){return{'model':db[_0x15507f[_0x985c('0x1c')]],'as':_0x15507f['as'],'attributes':_0x15507f[_0x985c('0x18')],'include':_0x15507f['include']?_[_0x985c('0x1a')](_0x15507f[_0x985c('0x1b')],function(_0xe0b91c){return{'model':db[_0xe0b91c['model']],'as':_0xe0b91c['as'],'attributes':_0xe0b91c[_0x985c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295753){logger[_0x985c('0xc')]('GetTrigger',_0x2e700d);logger[_0x985c('0x1d')](_0x985c('0x15'),_0x2e700d,JSON[_0x985c('0x10')](_0x295753));_0x1e0c57(_0x295753);})[_0x985c('0x14')](function(_0x169e84){logger[_0x985c('0x11')](_0x985c('0x15'),_0x169e84['message'],_0x2e700d);_0x169bf4(_0x1981de['error'](0x1f4,_0x169e84[_0x985c('0x13')]));});});};exports['ShowTrigger']=function(_0x539cec){var _0x2945e6=this;return new Promise(function(_0x21f60e,_0xdeaaaa){return db[_0x985c('0x1e')][_0x985c('0x1f')]({'raw':_0x539cec['options']?_0x539cec[_0x985c('0x16')][_0x985c('0x20')]===undefined?!![]:![]:!![],'where':_0x539cec[_0x985c('0x16')]?_0x539cec['options'][_0x985c('0x17')]||null:null,'attributes':_0x539cec[_0x985c('0x16')]?_0x539cec[_0x985c('0x16')]['attributes']||null:null,'include':_0x539cec['options']?_0x539cec[_0x985c('0x16')][_0x985c('0x1b')]?_[_0x985c('0x1a')](_0x539cec['options'][_0x985c('0x1b')],function(_0x378efb){return{'model':db[_0x378efb[_0x985c('0x1c')]],'as':_0x378efb['as'],'attributes':_0x378efb[_0x985c('0x18')],'include':_0x378efb[_0x985c('0x1b')]?_[_0x985c('0x1a')](_0x378efb['include'],function(_0xd19ebd){return{'model':db[_0xd19ebd[_0x985c('0x1c')]],'as':_0xd19ebd['as'],'attributes':_0xd19ebd[_0x985c('0x18')],'include':_0xd19ebd[_0x985c('0x1b')]?_[_0x985c('0x1a')](_0xd19ebd[_0x985c('0x1b')],function(_0x40a370){return{'model':db[_0x40a370[_0x985c('0x1c')]],'as':_0x40a370['as'],'attributes':_0x40a370[_0x985c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x985c('0xb')](function(_0x3dd9ce){logger['info'](_0x985c('0x21'),_0x539cec);logger[_0x985c('0x1d')]('ShowTrigger',_0x539cec,JSON[_0x985c('0x10')](_0x3dd9ce));_0x21f60e(_0x3dd9ce);})[_0x985c('0x14')](function(_0x21e3a2){logger[_0x985c('0x11')]('ShowTrigger',_0x21e3a2[_0x985c('0x13')],_0x539cec);_0xdeaaaa(_0x2945e6['error'](0x1f4,_0x21e3a2[_0x985c('0x13')]));});});}; \ No newline at end of file +var _0xe02c=['stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrigger','ShowTrigger','Trigger','find'];(function(_0x3f7c1b,_0x20c6f7){var _0x4ee89a=function(_0x17090a){while(--_0x17090a){_0x3f7c1b['push'](_0x3f7c1b['shift']());}};_0x4ee89a(++_0x20c6f7);}(_0xe02c,0xb5));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce02('0x0'));var util=require(_0xce02('0x1'));var moment=require(_0xce02('0x2'));var BPromise=require('bluebird');var rs=require(_0xce02('0x3'));var fs=require('fs');var Redis=require(_0xce02('0x4'));var db=require(_0xce02('0x5'))['db'];var utils=require(_0xce02('0x6'));var logger=require(_0xce02('0x7'))(_0xce02('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce02('0x9')][_0xce02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x490c8e,_0xfde358,_0x5623e8){return new BPromise(function(_0x31d9be,_0x64202a){return client[_0xce02('0xb')](_0x490c8e,_0x5623e8)['then'](function(_0x48ffbf){logger[_0xce02('0xc')](_0xce02('0xd'),_0xfde358,_0xce02('0xe'));logger[_0xce02('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0xfde358,_0xce02('0xe'),JSON['stringify'](_0x48ffbf));if(_0x48ffbf[_0xce02('0x10')]){if(_0x48ffbf['error'][_0xce02('0x11')]===0x1f4){logger[_0xce02('0x10')]('Trigger,\x20%s,\x20%s',_0xfde358,_0x48ffbf[_0xce02('0x10')]['message']);return _0x64202a(_0x48ffbf[_0xce02('0x10')][_0xce02('0x12')]);}logger[_0xce02('0x10')](_0xce02('0xd'),_0xfde358,_0x48ffbf['error'][_0xce02('0x12')]);return _0x31d9be(_0x48ffbf[_0xce02('0x10')]['message']);}else{logger[_0xce02('0xc')]('Trigger,\x20%s,\x20%s',_0xfde358,_0xce02('0xe'));_0x31d9be(_0x48ffbf[_0xce02('0x13')]['message']);}})[_0xce02('0x14')](function(_0x16937d){logger[_0xce02('0x10')](_0xce02('0xd'),_0xfde358,_0x16937d);_0x64202a(_0x16937d);});});}exports['GetTrigger']=function(_0x34dbc0){var _0x93edcf=this;return new Promise(function(_0x5f3171,_0x22410e){return db['Trigger'][_0xce02('0x15')]({'raw':_0x34dbc0[_0xce02('0x16')]?_0x34dbc0[_0xce02('0x16')][_0xce02('0x17')]===undefined?!![]:![]:!![],'where':_0x34dbc0[_0xce02('0x16')]?_0x34dbc0[_0xce02('0x16')][_0xce02('0x18')]||null:null,'attributes':_0x34dbc0['options']?_0x34dbc0['options'][_0xce02('0x19')]||null:null,'limit':_0x34dbc0[_0xce02('0x16')]?_0x34dbc0[_0xce02('0x16')][_0xce02('0x1a')]||null:null,'include':_0x34dbc0[_0xce02('0x16')]?_0x34dbc0[_0xce02('0x16')][_0xce02('0x1b')]?_[_0xce02('0x1c')](_0x34dbc0[_0xce02('0x16')][_0xce02('0x1b')],function(_0x1e3b41){return{'model':db[_0x1e3b41[_0xce02('0x1d')]],'as':_0x1e3b41['as'],'attributes':_0x1e3b41[_0xce02('0x19')],'include':_0x1e3b41['include']?_['map'](_0x1e3b41['include'],function(_0x4e0e24){return{'model':db[_0x4e0e24[_0xce02('0x1d')]],'as':_0x4e0e24['as'],'attributes':_0x4e0e24['attributes'],'include':_0x4e0e24[_0xce02('0x1b')]?_[_0xce02('0x1c')](_0x4e0e24[_0xce02('0x1b')],function(_0x3c627e){return{'model':db[_0x3c627e[_0xce02('0x1d')]],'as':_0x3c627e['as'],'attributes':_0x3c627e[_0xce02('0x19')]};}):[]};}):[]};}):[]:[]})[_0xce02('0x1e')](function(_0x3fcec1){logger[_0xce02('0xc')]('GetTrigger',_0x34dbc0);logger[_0xce02('0xf')]('GetTrigger',_0x34dbc0,JSON['stringify'](_0x3fcec1));_0x5f3171(_0x3fcec1);})[_0xce02('0x14')](function(_0x14727f){logger[_0xce02('0x10')](_0xce02('0x1f'),_0x14727f['message'],_0x34dbc0);_0x22410e(_0x93edcf['error'](0x1f4,_0x14727f[_0xce02('0x12')]));});});};exports[_0xce02('0x20')]=function(_0x5a74bb){var _0x51c4db=this;return new Promise(function(_0x5f5362,_0x4614b5){return db[_0xce02('0x21')][_0xce02('0x22')]({'raw':_0x5a74bb[_0xce02('0x16')]?_0x5a74bb[_0xce02('0x16')][_0xce02('0x17')]===undefined?!![]:![]:!![],'where':_0x5a74bb['options']?_0x5a74bb[_0xce02('0x16')][_0xce02('0x18')]||null:null,'attributes':_0x5a74bb['options']?_0x5a74bb[_0xce02('0x16')]['attributes']||null:null,'include':_0x5a74bb[_0xce02('0x16')]?_0x5a74bb['options'][_0xce02('0x1b')]?_[_0xce02('0x1c')](_0x5a74bb['options']['include'],function(_0x3cd4e5){return{'model':db[_0x3cd4e5[_0xce02('0x1d')]],'as':_0x3cd4e5['as'],'attributes':_0x3cd4e5[_0xce02('0x19')],'include':_0x3cd4e5[_0xce02('0x1b')]?_[_0xce02('0x1c')](_0x3cd4e5[_0xce02('0x1b')],function(_0x2ea951){return{'model':db[_0x2ea951['model']],'as':_0x2ea951['as'],'attributes':_0x2ea951[_0xce02('0x19')],'include':_0x2ea951[_0xce02('0x1b')]?_[_0xce02('0x1c')](_0x2ea951[_0xce02('0x1b')],function(_0x15302e){return{'model':db[_0x15302e['model']],'as':_0x15302e['as'],'attributes':_0x15302e[_0xce02('0x19')]};}):[]};}):[]};}):[]:[]})[_0xce02('0x1e')](function(_0x27fa70){logger[_0xce02('0xc')](_0xce02('0x20'),_0x5a74bb);logger['debug'](_0xce02('0x20'),_0x5a74bb,JSON[_0xce02('0x23')](_0x27fa70));_0x5f5362(_0x27fa70);})[_0xce02('0x14')](function(_0x377521){logger['error'](_0xce02('0x20'),_0x377521['message'],_0x5a74bb);_0x4614b5(_0x51c4db['error'](0x1f4,_0x377521['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index efc0712..fb3e750 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 _0xbed7=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','clone','post','create','update','destroy','exports','multer'];(function(_0x57b335,_0x141fee){var _0x283495=function(_0x1a9d10){while(--_0x1a9d10){_0x57b335['push'](_0x57b335['shift']());}};_0x283495(++_0x141fee);}(_0xbed7,0x1da));var _0x7bed=function(_0xd882e8,_0x5eb1a4){_0xd882e8=_0xd882e8-0x0;var _0x33a76a=_0xbed7[_0xd882e8];return _0x33a76a;};'use strict';var multer=require(_0x7bed('0x0'));var util=require(_0x7bed('0x1'));var path=require(_0x7bed('0x2'));var timeout=require('connect-timeout');var express=require(_0x7bed('0x3'));var router=express[_0x7bed('0x4')]();var fs_extra=require(_0x7bed('0x5'));var auth=require(_0x7bed('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bed('0x7'));var controller=require(_0x7bed('0x8'));router['get']('/',auth[_0x7bed('0x9')](),controller[_0x7bed('0xa')]);router[_0x7bed('0xb')](_0x7bed('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/:id/clone',auth[_0x7bed('0x9')](),controller[_0x7bed('0xd')]);router[_0x7bed('0xe')]('/',auth['isAuthenticated'](),controller[_0x7bed('0xf')]);router['put'](_0x7bed('0xc'),auth[_0x7bed('0x9')](),controller[_0x7bed('0x10')]);router['delete'](_0x7bed('0xc'),auth[_0x7bed('0x9')](),controller[_0x7bed('0x11')]);module[_0x7bed('0x12')]=router; \ No newline at end of file +var _0x0c78=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','/:id/clone','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3d1861,_0x118ab2){var _0x357686=function(_0x11eb06){while(--_0x11eb06){_0x3d1861['push'](_0x3d1861['shift']());}};_0x357686(++_0x118ab2);}(_0x0c78,0x1c8));var _0x80c7=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x0c78[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x80c7('0x0'));var util=require(_0x80c7('0x1'));var path=require(_0x80c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x80c7('0x3'));var router=express['Router']();var fs_extra=require(_0x80c7('0x4'));var auth=require(_0x80c7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x80c7('0x6'));var controller=require('./trunk.controller');router[_0x80c7('0x7')]('/',auth[_0x80c7('0x8')](),controller[_0x80c7('0x9')]);router[_0x80c7('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x80c7('0xa')](_0x80c7('0xb'),auth[_0x80c7('0x8')](),controller['clone']);router[_0x80c7('0xa')]('/',auth['isAuthenticated'](),controller[_0x80c7('0xc')]);router[_0x80c7('0xd')]('/:id',auth[_0x80c7('0x8')](),controller['update']);router[_0x80c7('0xe')]('/:id',auth[_0x80c7('0x8')](),controller[_0x80c7('0xf')]);module[_0x80c7('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index ea29279..06c671a 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 _0x4e3c=['nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','dynamic'];(function(_0x1aaaed,_0x15a650){var _0xf044a1=function(_0x348fd9){while(--_0x348fd9){_0x1aaaed['push'](_0x1aaaed['shift']());}};_0xf044a1(++_0x15a650);}(_0x4e3c,0x1df));var _0xc4e3=function(_0x44a9c8,_0x19facb){_0x44a9c8=_0x44a9c8-0x0;var _0x3a3d70=_0x4e3c[_0x44a9c8];return _0x3a3d70;};'use strict';var Sequelize=require(_0xc4e3('0x0'));module[_0xc4e3('0x1')]={'name':{'type':Sequelize[_0xc4e3('0x2')],'allowNull':![],'unique':_0xc4e3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x5'),_0xc4e3('0x6'),_0xc4e3('0x7')),'allowNull':![],'defaultValue':_0xc4e3('0x5')},'context':{'type':Sequelize[_0xc4e3('0x2')],'allowNull':![],'defaultValue':_0xc4e3('0x8')},'callingpres':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x9'),_0xc4e3('0xa'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xc4e3('0xb'),_0xc4e3('0xc'),_0xc4e3('0xd'),_0xc4e3('0xe'))},'deny':{'type':Sequelize[_0xc4e3('0x2')]},'permit':{'type':Sequelize[_0xc4e3('0x2')]},'secret':{'type':Sequelize[_0xc4e3('0x2')]},'md5secret':{'type':Sequelize[_0xc4e3('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':'udp','set':function(_0x4c59b7){this[_0xc4e3('0xf')](_0xc4e3('0x10'),_0x4c59b7?_0x4c59b7[_0xc4e3('0x11')](','):null);},'get':function(){return this[_0xc4e3('0x12')](_0xc4e3('0x10'))?this[_0xc4e3('0x12')]('transport')[_0xc4e3('0x13')](','):null;},'comment':_0xc4e3('0x14')},'dtmfmode':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x15'),_0xc4e3('0x16'),_0xc4e3('0x17'),_0xc4e3('0x18'),_0xc4e3('0x19')),'defaultValue':_0xc4e3('0x15')},'directmedia':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc4e3('0x2')]},'directmediadeny':{'type':Sequelize[_0xc4e3('0x2')]},'nat':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':_0xc4e3('0x1b'),'set':function(_0x3ba647){this['setDataValue']('nat',_0x3ba647?_0x3ba647[_0xc4e3('0x11')](','):null);},'get':function(){return this[_0xc4e3('0x12')](_0xc4e3('0x1c'))?this[_0xc4e3('0x12')]('nat')['split'](','):null;},'comment':_0xc4e3('0x1d')},'callgroup':{'type':Sequelize[_0xc4e3('0x2')]},'namedcallgroup':{'type':Sequelize[_0xc4e3('0x2')]},'pickupgroup':{'type':Sequelize[_0xc4e3('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xc4e3('0x2')]},'language':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':_0xc4e3('0x1e')},'allow':{'type':Sequelize[_0xc4e3('0x2')],'allowNull':![],'defaultValue':_0xc4e3('0x1f'),'set':function(_0x690d7c){this[_0xc4e3('0xf')](_0xc4e3('0x20'),_0x690d7c?_0x690d7c[_0xc4e3('0x11')](';'):_0xc4e3('0x1f'));},'get':function(){return this['getDataValue'](_0xc4e3('0x20'))?this[_0xc4e3('0x12')]('allow')[_0xc4e3('0x13')](';'):null;},'comment':_0xc4e3('0x21')},'autoframing':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'insecure':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':'port,invite','set':function(_0x2f7976){this['setDataValue'](_0xc4e3('0x22'),_0x2f7976?_0x2f7976[_0xc4e3('0x11')](','):null);},'get':function(){return this[_0xc4e3('0x12')](_0xc4e3('0x22'))?this['getDataValue'](_0xc4e3('0x22'))[_0xc4e3('0x13')](','):null;},'comment':_0xc4e3('0x23')},'trustrpid':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc4e3('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc4e3('0x4')]('yes','no',_0xc4e3('0x24'))},'promiscredir':{'type':Sequelize[_0xc4e3('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'setvar':{'type':Sequelize[_0xc4e3('0x2')]},'callerid':{'type':Sequelize[_0xc4e3('0x2')],'defaultValue':_0xc4e3('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':_0xc4e3('0x1a')},'busylevel':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc4e3('0x1a'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xc4e3('0x2')]},'videosupport':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no',_0xc4e3('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xc4e3('0x2')]},'session_timers':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x28'),_0xc4e3('0x29'),_0xc4e3('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x2b'),_0xc4e3('0x2c')),'defaultValue':_0xc4e3('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xc4e3('0x2')]},'regexten':{'type':Sequelize[_0xc4e3('0x2')]},'fromdomain':{'type':Sequelize[_0xc4e3('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc4e3('0x25')](0x5)},'qualify':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xc4e3('0x2')]},'rtptimeout':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no',_0xc4e3('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc4e3('0x2')]},'callbackextension':{'type':Sequelize[_0xc4e3('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xc4e3('0x2')]},'contactdeny':{'type':Sequelize[_0xc4e3('0x2')]},'contactacl':{'type':Sequelize[_0xc4e3('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xc4e3('0x2')]},'use_q850_reason':{'type':Sequelize[_0xc4e3('0x2')]},'maxforwards':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'encryption':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no','fingerprint',_0xc4e3('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xc4e3('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xc4e3('0x2')]},'dtlscafile':{'type':Sequelize[_0xc4e3('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x2f'),_0xc4e3('0x30'),_0xc4e3('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc4e3('0x2')]},'usereqphone':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc4e3('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xc4e3('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xc4e3('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xc4e3('0x2')]},'mohsuggest':{'type':Sequelize[_0xc4e3('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc4e3('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xc4e3('0x32')},'canreinvite':{'type':Sequelize[_0xc4e3('0x4')](_0xc4e3('0x1a'),'no',_0xc4e3('0x33'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc4e3('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc4e3('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x88ab=['ENUM','friend','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','update','outgoing','force_rport,comedia','nat','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','uas','pai','fingerprint','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0x88ab,0x1eb));var _0xb88a=function(_0x5761e4,_0x28bec2){_0x5761e4=_0x5761e4-0x0;var _0x33fc7f=_0x88ab[_0x5761e4];return _0x33fc7f;};'use strict';var Sequelize=require(_0xb88a('0x0'));module[_0xb88a('0x1')]={'name':{'type':Sequelize[_0xb88a('0x2')],'allowNull':![],'unique':_0xb88a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x5'),'user',_0xb88a('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xb88a('0x2')],'allowNull':![],'defaultValue':_0xb88a('0x7')},'callingpres':{'type':Sequelize[_0xb88a('0x4')]('ALLOWED_NOT_SCREENED',_0xb88a('0x8'),_0xb88a('0x9'),_0xb88a('0xa'),_0xb88a('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xb88a('0xc'))},'deny':{'type':Sequelize[_0xb88a('0x2')]},'permit':{'type':Sequelize[_0xb88a('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xb88a('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x295fcc){this[_0xb88a('0xd')](_0xb88a('0xe'),_0x295fcc?_0x295fcc[_0xb88a('0xf')](','):null);},'get':function(){return this[_0xb88a('0x10')]('transport')?this[_0xb88a('0x10')]('transport')[_0xb88a('0x11')](','):null;},'comment':_0xb88a('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0xb88a('0x13'),_0xb88a('0x14'),_0xb88a('0x15'),_0xb88a('0x16'),'auto'),'defaultValue':_0xb88a('0x13')},'directmedia':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no','nonat',_0xb88a('0x18'),_0xb88a('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb88a('0x2')]},'directmediadeny':{'type':Sequelize[_0xb88a('0x2')]},'nat':{'type':Sequelize[_0xb88a('0x2')],'defaultValue':_0xb88a('0x1a'),'set':function(_0x5ce6fb){this[_0xb88a('0xd')](_0xb88a('0x1b'),_0x5ce6fb?_0x5ce6fb['join'](','):null);},'get':function(){return this[_0xb88a('0x10')](_0xb88a('0x1b'))?this['getDataValue']('nat')[_0xb88a('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xb88a('0x2')]},'namedcallgroup':{'type':Sequelize[_0xb88a('0x2')]},'pickupgroup':{'type':Sequelize[_0xb88a('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xb88a('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xb88a('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4401a3){this[_0xb88a('0xd')](_0xb88a('0x1c'),_0x4401a3?_0x4401a3[_0xb88a('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xb88a('0x10')](_0xb88a('0x1c'))?this[_0xb88a('0x10')](_0xb88a('0x1c'))[_0xb88a('0x11')](';'):null;},'comment':_0xb88a('0x1d')},'autoframing':{'type':Sequelize['ENUM'](_0xb88a('0x17'),'no')},'insecure':{'type':Sequelize[_0xb88a('0x2')],'defaultValue':'port,invite','set':function(_0x2c7405){this['setDataValue'](_0xb88a('0x1e'),_0x2c7405?_0x2c7405[_0xb88a('0xf')](','):null);},'get':function(){return this[_0xb88a('0x10')](_0xb88a('0x1e'))?this['getDataValue'](_0xb88a('0x1e'))[_0xb88a('0x11')](','):null;},'comment':_0xb88a('0x1f')},'trustrpid':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no',_0xb88a('0x20'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'accountcode':{'type':Sequelize[_0xb88a('0x21')](0xb)},'setvar':{'type':Sequelize[_0xb88a('0x2')]},'callerid':{'type':Sequelize[_0xb88a('0x2')],'defaultValue':_0xb88a('0x22')},'amaflags':{'type':Sequelize[_0xb88a('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xb88a('0x17')},'busylevel':{'type':Sequelize[_0xb88a('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xb88a('0x2')]},'template':{'type':Sequelize[_0xb88a('0x2')]},'videosupport':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no',_0xb88a('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb88a('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xb88a('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xb88a('0x4')]('accept',_0xb88a('0x24'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xb88a('0x4')]('uac',_0xb88a('0x25')),'defaultValue':_0xb88a('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0xb88a('0x2')]},'regexten':{'type':Sequelize[_0xb88a('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb88a('0x21')](0x5)},'qualify':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no'),'defaultValue':_0xb88a('0x17')},'keepalive':{'type':Sequelize[_0xb88a('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xb88a('0x2')]},'defaultuser':{'type':Sequelize[_0xb88a('0x2')]},'rtptimeout':{'type':Sequelize[_0xb88a('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb88a('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb88a('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no',_0xb88a('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb88a('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xb88a('0x21')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xb88a('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xb88a('0x2')]},'contactacl':{'type':Sequelize[_0xb88a('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xb88a('0x2')]},'use_q850_reason':{'type':Sequelize[_0xb88a('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb88a('0x4')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xb88a('0x17'),'no')},'icesupport':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xb88a('0x4')]('yes','no',_0xb88a('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xb88a('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb88a('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xb88a('0x2')]},'dtlscipher':{'type':Sequelize[_0xb88a('0x2')]},'dtlscafile':{'type':Sequelize[_0xb88a('0x2')]},'dtlscapath':{'type':Sequelize[_0xb88a('0x2')]},'dtlssetup':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x28'),_0xb88a('0x29'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb88a('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xb88a('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xb88a('0x2')]},'call_limit':{'type':Sequelize[_0xb88a('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xb88a('0x17'),'no')},'vmexten':{'type':Sequelize[_0xb88a('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb88a('0x2')]},'host':{'type':Sequelize[_0xb88a('0x2')],'defaultValue':_0xb88a('0x2a')},'canreinvite':{'type':Sequelize[_0xb88a('0x4')](_0xb88a('0x17'),'no','nonat',_0xb88a('0x18'),_0xb88a('0x2b')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xb88a('0x2')]},'active':{'type':Sequelize[_0xb88a('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb88a('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 478e457..fb67a13 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 _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x14ec6e,_0x2b637e){var _0x2de3dd=function(_0x915cb9){while(--_0x915cb9){_0x14ec6e['push'](_0x14ec6e['shift']());}};_0x2de3dd(++_0x2b637e);}(_0x54ef,0x112));var _0xf54e=function(_0x5ad8cf,_0x66d2af){_0x5ad8cf=_0x5ad8cf-0x0;var _0x46b92b=_0x54ef[_0x5ad8cf];return _0x46b92b;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file +var _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index e155f01..f64d801 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 _0xd9d5=['path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','api','moment','request-promise'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xd9d5,0xf9));var _0x5d9d=function(_0x3fc8b4,_0xf14b34){_0x3fc8b4=_0x3fc8b4-0x0;var _0x137d9b=_0xd9d5[_0x3fc8b4];return _0x137d9b;};'use strict';var _=require(_0x5d9d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5d9d('0x1'));var moment=require(_0x5d9d('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d9d('0x3'));var fs=require('fs');var path=require(_0x5d9d('0x4'));var rimraf=require('rimraf');var config=require(_0x5d9d('0x5'));var attributes=require(_0x5d9d('0x6'));module[_0x5d9d('0x7')]=function(_0x47a182,_0x82a9ad){return _0x47a182[_0x5d9d('0x8')](_0x5d9d('0x9'),attributes,{'tableName':_0x5d9d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ce0=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util'];(function(_0x29ea0e,_0x466369){var _0x54248b=function(_0x1b41c0){while(--_0x1b41c0){_0x29ea0e['push'](_0x29ea0e['shift']());}};_0x54248b(++_0x466369);}(_0x1ce0,0x1ab));var _0x01ce=function(_0x5a0cb2,_0x43a6e4){_0x5a0cb2=_0x5a0cb2-0x0;var _0x32b526=_0x1ce0[_0x5a0cb2];return _0x32b526;};'use strict';var _=require(_0x01ce('0x0'));var util=require(_0x01ce('0x1'));var logger=require(_0x01ce('0x2'))(_0x01ce('0x3'));var moment=require(_0x01ce('0x4'));var BPromise=require(_0x01ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01ce('0x6'));var rimraf=require(_0x01ce('0x7'));var config=require(_0x01ce('0x8'));var attributes=require(_0x01ce('0x9'));module[_0x01ce('0xa')]=function(_0x3aad4e,_0x563091){return _0x3aad4e[_0x01ce('0xb')](_0x01ce('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 61bf579..1db12e7 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 _0x96b3=['message','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowTrunk','Trunk','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x58dc32,_0x4c5ff2){var _0x36cb8b=function(_0x22d1b9){while(--_0x22d1b9){_0x58dc32['push'](_0x58dc32['shift']());}};_0x36cb8b(++_0x4c5ff2);}(_0x96b3,0x131));var _0x396b=function(_0x24e641,_0x3d4d74){_0x24e641=_0x24e641-0x0;var _0x5dedb3=_0x96b3[_0x24e641];return _0x5dedb3;};'use strict';var _=require(_0x396b('0x0'));var util=require(_0x396b('0x1'));var moment=require(_0x396b('0x2'));var BPromise=require('bluebird');var rs=require(_0x396b('0x3'));var fs=require('fs');var Redis=require(_0x396b('0x4'));var db=require(_0x396b('0x5'))['db'];var utils=require(_0x396b('0x6'));var logger=require(_0x396b('0x7'))(_0x396b('0x8'));var config=require(_0x396b('0x9'));var jayson=require(_0x396b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e213f,_0x5f3ead,_0x59c86b){return new BPromise(function(_0x147a01,_0x291082){return client[_0x396b('0xb')](_0x3e213f,_0x59c86b)[_0x396b('0xc')](function(_0x55f27d){logger[_0x396b('0xd')](_0x396b('0xe'),_0x5f3ead,_0x396b('0xf'));logger['debug'](_0x396b('0x10'),_0x5f3ead,'request\x20sent',JSON['stringify'](_0x55f27d));if(_0x55f27d[_0x396b('0x11')]){if(_0x55f27d[_0x396b('0x11')][_0x396b('0x12')]===0x1f4){logger[_0x396b('0x11')](_0x396b('0xe'),_0x5f3ead,_0x55f27d[_0x396b('0x11')][_0x396b('0x13')]);return _0x291082(_0x55f27d[_0x396b('0x11')][_0x396b('0x13')]);}logger[_0x396b('0x11')](_0x396b('0xe'),_0x5f3ead,_0x55f27d['error'][_0x396b('0x13')]);return _0x147a01(_0x55f27d[_0x396b('0x11')]['message']);}else{logger['info'](_0x396b('0xe'),_0x5f3ead,_0x396b('0xf'));_0x147a01(_0x55f27d['result'][_0x396b('0x13')]);}})[_0x396b('0x14')](function(_0x2223d8){logger[_0x396b('0x11')](_0x396b('0xe'),_0x5f3ead,_0x2223d8);_0x291082(_0x2223d8);});});}exports[_0x396b('0x15')]=function(_0x1cae7b){var _0x55727a=this;return new Promise(function(_0x3d23a8,_0x1f69a3){return db['Trunk'][_0x396b('0x16')]({'raw':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b[_0x396b('0x17')][_0x396b('0x18')]===undefined?!![]:![]:!![],'where':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b['options'][_0x396b('0x19')]||null:null,'attributes':_0x1cae7b['options']?_0x1cae7b[_0x396b('0x17')][_0x396b('0x1a')]||null:null,'limit':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b[_0x396b('0x17')][_0x396b('0x1b')]||null:null,'include':_0x1cae7b[_0x396b('0x17')]?_0x1cae7b['options'][_0x396b('0x1c')]?_['map'](_0x1cae7b['options'][_0x396b('0x1c')],function(_0x55caed){return{'model':db[_0x55caed['model']],'as':_0x55caed['as'],'attributes':_0x55caed[_0x396b('0x1a')],'include':_0x55caed['include']?_[_0x396b('0x1d')](_0x55caed['include'],function(_0x4d5a8b){return{'model':db[_0x4d5a8b[_0x396b('0x1e')]],'as':_0x4d5a8b['as'],'attributes':_0x4d5a8b[_0x396b('0x1a')],'include':_0x4d5a8b[_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x4d5a8b[_0x396b('0x1c')],function(_0x1f3318){return{'model':db[_0x1f3318[_0x396b('0x1e')]],'as':_0x1f3318['as'],'attributes':_0x1f3318[_0x396b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x396b('0xc')](function(_0x162682){logger['info'](_0x396b('0x15'),_0x1cae7b);logger[_0x396b('0x1f')](_0x396b('0x15'),_0x1cae7b,JSON[_0x396b('0x20')](_0x162682));_0x3d23a8(_0x162682);})[_0x396b('0x14')](function(_0x30ff4b){logger['error']('GetTrunk',_0x30ff4b[_0x396b('0x13')],_0x1cae7b);_0x1f69a3(_0x55727a[_0x396b('0x11')](0x1f4,_0x30ff4b[_0x396b('0x13')]));});});};exports[_0x396b('0x21')]=function(_0x1007b6){var _0x56f818=this;return new Promise(function(_0x4c9aae,_0x5f11a2){return db[_0x396b('0x22')][_0x396b('0x23')]({'raw':_0x1007b6['options']?_0x1007b6[_0x396b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1007b6[_0x396b('0x17')]?_0x1007b6[_0x396b('0x17')][_0x396b('0x19')]||null:null,'attributes':_0x1007b6[_0x396b('0x17')]?_0x1007b6['options'][_0x396b('0x1a')]||null:null,'include':_0x1007b6['options']?_0x1007b6['options'][_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x1007b6[_0x396b('0x17')][_0x396b('0x1c')],function(_0x48ee15){return{'model':db[_0x48ee15[_0x396b('0x1e')]],'as':_0x48ee15['as'],'attributes':_0x48ee15[_0x396b('0x1a')],'include':_0x48ee15[_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x48ee15['include'],function(_0x3f9b73){return{'model':db[_0x3f9b73['model']],'as':_0x3f9b73['as'],'attributes':_0x3f9b73['attributes'],'include':_0x3f9b73[_0x396b('0x1c')]?_[_0x396b('0x1d')](_0x3f9b73[_0x396b('0x1c')],function(_0x1b1a4b){return{'model':db[_0x1b1a4b[_0x396b('0x1e')]],'as':_0x1b1a4b['as'],'attributes':_0x1b1a4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x396b('0xc')](function(_0x25fa61){logger[_0x396b('0xd')](_0x396b('0x21'),_0x1007b6);logger['debug']('ShowTrunk',_0x1007b6,JSON[_0x396b('0x20')](_0x25fa61));_0x4c9aae(_0x25fa61);})[_0x396b('0x14')](function(_0xfbba44){logger[_0x396b('0x11')]('ShowTrunk',_0xfbba44['message'],_0x1007b6);_0x5f11a2(_0x56f818[_0x396b('0x11')](0x1f4,_0xfbba44[_0x396b('0x13')]));});});}; \ No newline at end of file +var _0x0b85=['stringify','error','message','result','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','Trunk','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0b85,0x1b1));var _0x50b8=function(_0x3a613c,_0x32b1f1){_0x3a613c=_0x3a613c-0x0;var _0x4e48ab=_0x0b85[_0x3a613c];return _0x4e48ab;};'use strict';var _=require(_0x50b8('0x0'));var util=require(_0x50b8('0x1'));var moment=require(_0x50b8('0x2'));var BPromise=require(_0x50b8('0x3'));var rs=require(_0x50b8('0x4'));var fs=require('fs');var Redis=require(_0x50b8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x50b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x50b8('0x7')][_0x50b8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4658b5,_0x15dbec,_0x439f9a){return new BPromise(function(_0x33cd82,_0x3c4119){return client[_0x50b8('0x9')](_0x4658b5,_0x439f9a)[_0x50b8('0xa')](function(_0x2c0d94){logger[_0x50b8('0xb')](_0x50b8('0xc'),_0x15dbec,_0x50b8('0xd'));logger[_0x50b8('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x15dbec,_0x50b8('0xd'),JSON[_0x50b8('0xf')](_0x2c0d94));if(_0x2c0d94[_0x50b8('0x10')]){if(_0x2c0d94[_0x50b8('0x10')]['code']===0x1f4){logger[_0x50b8('0x10')](_0x50b8('0xc'),_0x15dbec,_0x2c0d94[_0x50b8('0x10')][_0x50b8('0x11')]);return _0x3c4119(_0x2c0d94[_0x50b8('0x10')][_0x50b8('0x11')]);}logger[_0x50b8('0x10')](_0x50b8('0xc'),_0x15dbec,_0x2c0d94[_0x50b8('0x10')][_0x50b8('0x11')]);return _0x33cd82(_0x2c0d94['error']['message']);}else{logger[_0x50b8('0xb')]('Trunk,\x20%s,\x20%s',_0x15dbec,_0x50b8('0xd'));_0x33cd82(_0x2c0d94[_0x50b8('0x12')][_0x50b8('0x11')]);}})[_0x50b8('0x13')](function(_0x3e4418){logger[_0x50b8('0x10')](_0x50b8('0xc'),_0x15dbec,_0x3e4418);_0x3c4119(_0x3e4418);});});}exports[_0x50b8('0x14')]=function(_0x12a569){var _0x1e4b8d=this;return new Promise(function(_0x17b118,_0x1cf97e){return db['Trunk'][_0x50b8('0x15')]({'raw':_0x12a569[_0x50b8('0x16')]?_0x12a569[_0x50b8('0x16')][_0x50b8('0x17')]===undefined?!![]:![]:!![],'where':_0x12a569[_0x50b8('0x16')]?_0x12a569[_0x50b8('0x16')][_0x50b8('0x18')]||null:null,'attributes':_0x12a569['options']?_0x12a569['options'][_0x50b8('0x19')]||null:null,'limit':_0x12a569['options']?_0x12a569[_0x50b8('0x16')][_0x50b8('0x1a')]||null:null,'include':_0x12a569[_0x50b8('0x16')]?_0x12a569['options'][_0x50b8('0x1b')]?_[_0x50b8('0x1c')](_0x12a569[_0x50b8('0x16')][_0x50b8('0x1b')],function(_0x50bc0c){return{'model':db[_0x50bc0c[_0x50b8('0x1d')]],'as':_0x50bc0c['as'],'attributes':_0x50bc0c[_0x50b8('0x19')],'include':_0x50bc0c['include']?_[_0x50b8('0x1c')](_0x50bc0c['include'],function(_0xe75586){return{'model':db[_0xe75586[_0x50b8('0x1d')]],'as':_0xe75586['as'],'attributes':_0xe75586['attributes'],'include':_0xe75586['include']?_['map'](_0xe75586[_0x50b8('0x1b')],function(_0x8ad697){return{'model':db[_0x8ad697[_0x50b8('0x1d')]],'as':_0x8ad697['as'],'attributes':_0x8ad697[_0x50b8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x50b8('0xa')](function(_0xca980a){logger[_0x50b8('0xb')](_0x50b8('0x14'),_0x12a569);logger[_0x50b8('0xe')](_0x50b8('0x14'),_0x12a569,JSON[_0x50b8('0xf')](_0xca980a));_0x17b118(_0xca980a);})['catch'](function(_0x2f45fb){logger['error'](_0x50b8('0x14'),_0x2f45fb[_0x50b8('0x11')],_0x12a569);_0x1cf97e(_0x1e4b8d[_0x50b8('0x10')](0x1f4,_0x2f45fb[_0x50b8('0x11')]));});});};exports[_0x50b8('0x1e')]=function(_0x1dd03e){var _0x523459=this;return new Promise(function(_0x2a76f0,_0x1574b8){return db[_0x50b8('0x1f')]['find']({'raw':_0x1dd03e[_0x50b8('0x16')]?_0x1dd03e[_0x50b8('0x16')][_0x50b8('0x17')]===undefined?!![]:![]:!![],'where':_0x1dd03e['options']?_0x1dd03e[_0x50b8('0x16')][_0x50b8('0x18')]||null:null,'attributes':_0x1dd03e['options']?_0x1dd03e[_0x50b8('0x16')]['attributes']||null:null,'include':_0x1dd03e['options']?_0x1dd03e[_0x50b8('0x16')][_0x50b8('0x1b')]?_[_0x50b8('0x1c')](_0x1dd03e[_0x50b8('0x16')][_0x50b8('0x1b')],function(_0x5c8912){return{'model':db[_0x5c8912[_0x50b8('0x1d')]],'as':_0x5c8912['as'],'attributes':_0x5c8912[_0x50b8('0x19')],'include':_0x5c8912[_0x50b8('0x1b')]?_['map'](_0x5c8912[_0x50b8('0x1b')],function(_0x4bc643){return{'model':db[_0x4bc643[_0x50b8('0x1d')]],'as':_0x4bc643['as'],'attributes':_0x4bc643[_0x50b8('0x19')],'include':_0x4bc643[_0x50b8('0x1b')]?_[_0x50b8('0x1c')](_0x4bc643['include'],function(_0x1e9dcf){return{'model':db[_0x1e9dcf['model']],'as':_0x1e9dcf['as'],'attributes':_0x1e9dcf[_0x50b8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x50b8('0xa')](function(_0x55dd34){logger[_0x50b8('0xb')]('ShowTrunk',_0x1dd03e);logger['debug'](_0x50b8('0x1e'),_0x1dd03e,JSON[_0x50b8('0xf')](_0x55dd34));_0x2a76f0(_0x55dd34);})['catch'](function(_0x231947){logger[_0x50b8('0x10')](_0x50b8('0x1e'),_0x231947['message'],_0x1dd03e);_0x1574b8(_0x523459[_0x50b8('0x10')](0x1f4,_0x231947[_0x50b8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 1ab485f..ff3ef86 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1041=['update','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x4c2537,_0x20afdf){var _0x94fb5c=function(_0x49e2f3){while(--_0x49e2f3){_0x4c2537['push'](_0x4c2537['shift']());}};_0x94fb5c(++_0x20afdf);}(_0x1041,0x159));var _0x1104=function(_0x5c2e65,_0x20e630){_0x5c2e65=_0x5c2e65-0x0;var _0x445359=_0x1041[_0x5c2e65];return _0x445359;};'use strict';var express=require(_0x1104('0x0'));var router=express[_0x1104('0x1')]();var auth=require(_0x1104('0x2'));var controller=require(_0x1104('0x3'));router[_0x1104('0x4')](_0x1104('0x5'),auth[_0x1104('0x6')](),controller[_0x1104('0x7')]);module['exports']=router; \ No newline at end of file +var _0x680a=['Router','../../components/auth/service','./user-setting.controller','put','isAuthenticated','update','express'];(function(_0x57fa25,_0x18a0e4){var _0x9a9e07=function(_0x577938){while(--_0x577938){_0x57fa25['push'](_0x57fa25['shift']());}};_0x9a9e07(++_0x18a0e4);}(_0x680a,0x117));var _0xa680=function(_0x41ed0b,_0x2f4e8){_0x41ed0b=_0x41ed0b-0x0;var _0x83496b=_0x680a[_0x41ed0b];return _0x83496b;};'use strict';var express=require(_0xa680('0x0'));var router=express[_0xa680('0x1')]();var auth=require(_0xa680('0x2'));var controller=require(_0xa680('0x3'));router[_0xa680('0x4')]('/:id',auth[_0xa680('0x5')](),controller[_0xa680('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 16be5e5..b82edf3 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf224=['BOOLEAN','TEXT','DATE','sequelize','error','warning','info','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf224,0x1a3));var _0x4f22=function(_0x4c13d8,_0x7362d6){_0x4c13d8=_0x4c13d8-0x0;var _0x3ecbb2=_0xf224[_0x4c13d8];return _0x3ecbb2;};'use strict';var Sequelize=require(_0x4f22('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4f22('0x1'),_0x4f22('0x2'),_0x4f22('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x4f22('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4f22('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4f22('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4f22('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x4f22('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x59ca=['UserId','sequelize','error','info','debug','BOOLEAN','TEXT','INTEGER'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x59ca,0x149));var _0xa59c=function(_0x5b921f,_0x7017ac){_0x5b921f=_0x5b921f-0x0;var _0x2bff01=_0x59ca[_0x5b921f];return _0x2bff01;};'use strict';var Sequelize=require(_0xa59c('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xa59c('0x1'),'warning',_0xa59c('0x2'),_0xa59c('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xa59c('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xa59c('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xa59c('0x6')],'unique':_0xa59c('0x7')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 630ec0a..5f29512 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x175e=['Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','lodash','ioredis','../../config/logger','api','../../config/environment','redis','./user-setting.socket','register','defaults','localhost','status','json','update','sendStatus','name','send','user','admin','Unauthorized','params'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x175e,0xe6));var _0xe175=function(_0x512375,_0x53e0db){_0x512375=_0x512375-0x0;var _0x2bb4db=_0x175e[_0x512375];return _0x2bb4db;};'use strict';var _=require(_0xe175('0x0'));var Redis=require(_0xe175('0x1'));var logger=require(_0xe175('0x2'))(_0xe175('0x3'));var config=require(_0xe175('0x4'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xe175('0x5')]));require(_0xe175('0x6'))[_0xe175('0x7')](socket);config[_0xe175('0x5')]=_[_0xe175('0x8')](config[_0xe175('0x5')],{'host':_0xe175('0x9'),'port':0x18eb});function respondWithResult(_0xbe8cd,_0x470c64){_0x470c64=_0x470c64||0xc8;return function(_0x2e1356){if(_0x2e1356){return _0xbe8cd[_0xe175('0xa')](_0x470c64)[_0xe175('0xb')](_0x2e1356);}};}function saveUpdates(_0xbc5f3b){return function(_0x18b677){if(_0x18b677){return _0x18b677[_0xe175('0xc')](_0xbc5f3b)['then'](function(_0x52850e){return _0x52850e;});}return null;};}function handleEntityNotFound(_0x2b3755){return function(_0x591ec3){if(!_0x591ec3){_0x2b3755[_0xe175('0xd')](0x194);}return _0x591ec3;};}function handleError(_0x1e1d7c,_0x2cc353){_0x2cc353=_0x2cc353||0x1f4;return function(_0x1a71dc){logger['error'](_0x1a71dc['stack']);if(_0x1a71dc[_0xe175('0xe')]){delete _0x1a71dc['name'];}_0x1e1d7c['status'](_0x2cc353)[_0xe175('0xf')](_0x1a71dc);};}exports[_0xe175('0xc')]=function(_0xf92dec,_0x36ee94){if(_0xf92dec[_0xe175('0x10')]['role']!==_0xe175('0x11'))throw new Error(_0xe175('0x12'));if(isNaN(Number(_0xf92dec[_0xe175('0x13')]['id'])))throw new Error(_0xe175('0x14'));return db[_0xe175('0x15')][_0xe175('0x16')]({'where':{'id':_0xf92dec[_0xe175('0x13')]['id']}})['then'](handleEntityNotFound(_0x36ee94,null))[_0xe175('0x17')](saveUpdates(_0xf92dec[_0xe175('0x18')],null))[_0xe175('0x17')](respondWithResult(_0x36ee94,null))['catch'](handleError(_0x36ee94,null));}; \ No newline at end of file +var _0x0f69=['then','sendStatus','stack','user','admin','Invalid\x20user\x20setting\x20id','find','params','body','catch','../../config/logger','../../config/environment','../../mysqldb','redis','./user-setting.socket','localhost','status','json','update'];(function(_0x1d80b6,_0x305bba){var _0x51bcd0=function(_0x1fc8c2){while(--_0x1fc8c2){_0x1d80b6['push'](_0x1d80b6['shift']());}};_0x51bcd0(++_0x305bba);}(_0x0f69,0x173));var _0x90f6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0f69[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x90f6('0x0'))('api');var config=require(_0x90f6('0x1'));var db=require(_0x90f6('0x2'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x90f6('0x3')]));require(_0x90f6('0x4'))['register'](socket);config[_0x90f6('0x3')]=_['defaults'](config[_0x90f6('0x3')],{'host':_0x90f6('0x5'),'port':0x18eb});function respondWithResult(_0x45657d,_0x3b35a0){_0x3b35a0=_0x3b35a0||0xc8;return function(_0x3bc2eb){if(_0x3bc2eb){return _0x45657d[_0x90f6('0x6')](_0x3b35a0)[_0x90f6('0x7')](_0x3bc2eb);}};}function saveUpdates(_0x33c6f8){return function(_0x39421f){if(_0x39421f){return _0x39421f[_0x90f6('0x8')](_0x33c6f8)[_0x90f6('0x9')](function(_0x2db1dc){return _0x2db1dc;});}return null;};}function handleEntityNotFound(_0x2c7664){return function(_0x53e671){if(!_0x53e671){_0x2c7664[_0x90f6('0xa')](0x194);}return _0x53e671;};}function handleError(_0x324005,_0x51930c){_0x51930c=_0x51930c||0x1f4;return function(_0x36b4db){logger['error'](_0x36b4db[_0x90f6('0xb')]);if(_0x36b4db['name']){delete _0x36b4db['name'];}_0x324005[_0x90f6('0x6')](_0x51930c)['send'](_0x36b4db);};}exports[_0x90f6('0x8')]=function(_0xa72a43,_0x45794b){if(_0xa72a43[_0x90f6('0xc')]['role']!==_0x90f6('0xd'))throw new Error('Unauthorized');if(isNaN(Number(_0xa72a43['params']['id'])))throw new Error(_0x90f6('0xe'));return db['UserSetting'][_0x90f6('0xf')]({'where':{'id':_0xa72a43[_0x90f6('0x10')]['id']}})[_0x90f6('0x9')](handleEntityNotFound(_0x45794b,null))[_0x90f6('0x9')](saveUpdates(_0xa72a43[_0x90f6('0x11')],null))[_0x90f6('0x9')](respondWithResult(_0x45794b,null))[_0x90f6('0x12')](handleError(_0x45794b,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 0eed00d..8f95a7d 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6351=['hook','exports','../../mysqldb','UserSetting','setMaxListeners','save','remove','emit'];(function(_0x40dde3,_0x384a6f){var _0x45d18b=function(_0x365d53){while(--_0x365d53){_0x40dde3['push'](_0x40dde3['shift']());}};_0x45d18b(++_0x384a6f);}(_0x6351,0x1ba));var _0x1635=function(_0x4d2552,_0x560684){_0x4d2552=_0x4d2552-0x0;var _0x56761b=_0x6351[_0x4d2552];return _0x56761b;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x1635('0x0'))['db'][_0x1635('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1635('0x2')](0x0);var events={'afterCreate':_0x1635('0x3'),'afterUpdate':'update','afterDestroy':_0x1635('0x4')};function emitEvent(_0x2e65c1){return function(_0x2d7cfe,_0x617214,_0x4e36ee){UserSettingEvents[_0x1635('0x5')](_0x2e65c1+':'+_0x2d7cfe['id'],_0x2d7cfe);UserSettingEvents['emit'](_0x2e65c1,_0x2d7cfe);_0x4e36ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x1635('0x6')](e,emitEvent(event));}}module[_0x1635('0x7')]=UserSettingEvents; \ No newline at end of file +var _0x78f9=['exports','events','UserSetting','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0x78f9,0x88));var _0x978f=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x78f9[_0x3635ce];return _0x97ecd0;};'use strict';var EventEmitter=require(_0x978f('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x978f('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x978f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x978f('0x3'),'afterDestroy':_0x978f('0x4')};function emitEvent(_0xaecf31){return function(_0x5786f9,_0x53fae6,_0x2f1721){UserSettingEvents[_0x978f('0x5')](_0xaecf31+':'+_0x5786f9['id'],_0x5786f9);UserSettingEvents[_0x978f('0x5')](_0xaecf31,_0x5786f9);_0x2f1721(null);};}for(var e in events){if(events[_0x978f('0x6')](e)){var event=events[e];UserSetting[_0x978f('0x7')](e,emitEvent(event));}}module[_0x978f('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 5fdcc5d..048c217 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x594d=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting','user_settings'];(function(_0x54c77a,_0x5d06f4){var _0xf0b45b=function(_0x413cdf){while(--_0x413cdf){_0x54c77a['push'](_0x54c77a['shift']());}};_0xf0b45b(++_0x5d06f4);}(_0x594d,0x92));var _0xd594=function(_0x476e92,_0x5e7872){_0x476e92=_0x476e92-0x0;var _0x4bd9df=_0x594d[_0x476e92];return _0x4bd9df;};'use strict';var attributes=require(_0xd594('0x0'));module['exports']=function(_0x4a7d4b){return _0x4a7d4b[_0xd594('0x1')](_0xd594('0x2'),attributes,{'tableName':_0xd594('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x496b6a){if(!_0x496b6a[_0xd594('0x4')])_0x496b6a[_0xd594('0x5')]=null;else if(_0x496b6a[_0xd594('0x5')]===null)_0x496b6a[_0xd594('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xaaa2=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xaaa2,0xac));var _0x2aaa=function(_0x347983,_0x415590){_0x347983=_0x347983-0x0;var _0x1ce093=_0xaaa2[_0x347983];return _0x1ce093;};'use strict';var attributes=require(_0x2aaa('0x0'));module[_0x2aaa('0x1')]=function(_0x21def1){return _0x21def1[_0x2aaa('0x2')](_0x2aaa('0x3'),attributes,{'tableName':_0x2aaa('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49eef3){if(!_0x49eef3[_0x2aaa('0x5')])_0x49eef3['clientSideLoggingEnabledSince']=null;else if(_0x49eef3[_0x2aaa('0x6')]===null)_0x49eef3[_0x2aaa('0x6')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 5de5e47..9ecb543 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1239=['user-setting:update','register','length','user-setting:','./user-setting.events','save','remove','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1239,0xd3));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var UserSettingEvents=require(_0x9123('0x0'));var events=[_0x9123('0x1'),_0x9123('0x2'),_0x9123('0x3')];function createListener(_0x334dbc,_0x2e09c1){return function(_0x40eb05){_0x2e09c1[_0x9123('0x4')](_0x334dbc,_0x40eb05);if(_0x334dbc===_0x9123('0x5')){_0x2e09c1[_0x9123('0x4')]('user-setting:update:user-'+_0x40eb05['UserId'],_0x40eb05);}};}exports[_0x9123('0x6')]=function(_0x3ece9d){for(var _0x4639c3=0x0,_0x28efdd=events[_0x9123('0x7')];_0x4639c3<_0x28efdd;_0x4639c3++){var _0x19f959=events[_0x4639c3];var _0x22a7ca=createListener(_0x9123('0x8')+_0x19f959,_0x3ece9d);UserSettingEvents['on'](_0x19f959,_0x22a7ca);}}; \ No newline at end of file +var _0x3916=['length','user-setting:','./user-setting.events','update','emit','user-setting:update','user-setting:update:user-','register'];(function(_0x4c67b8,_0x571e13){var _0xbc26e=function(_0x16e9ac){while(--_0x16e9ac){_0x4c67b8['push'](_0x4c67b8['shift']());}};_0xbc26e(++_0x571e13);}(_0x3916,0x1e2));var _0x6391=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x3916[_0x79cd47];return _0x3b9484;};'use strict';var UserSettingEvents=require(_0x6391('0x0'));var events=['save','remove',_0x6391('0x1')];function createListener(_0x54673a,_0x33af90){return function(_0x46d2a6){_0x33af90[_0x6391('0x2')](_0x54673a,_0x46d2a6);if(_0x54673a===_0x6391('0x3')){_0x33af90[_0x6391('0x2')](_0x6391('0x4')+_0x46d2a6['UserId'],_0x46d2a6);}};}exports[_0x6391('0x5')]=function(_0x5b962f){for(var _0x3ca8db=0x0,_0x431fa8=events[_0x6391('0x6')];_0x3ca8db<_0x431fa8;_0x3ca8db++){var _0x39e166=events[_0x3ca8db];var _0x4737b4=createListener(_0x6391('0x7')+_0x39e166,_0x5b962f);UserSettingEvents['on'](_0x39e166,_0x4737b4);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 880823c..1620982 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 _0x1123=['getOpenTabs','/:id/contacts','/:id/queues_rt','/:id/groups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getAgents','/:id/prefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','/:id/api_key','post','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','server/files/images/','format','now','originalname','file','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','addSmsAccounts','addWhatsappAccounts','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','path','express','Router','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar'];(function(_0x191f81,_0x18ea6d){var _0x11b627=function(_0x534255){while(--_0x534255){_0x191f81['push'](_0x191f81['shift']());}};_0x11b627(++_0x18ea6d);}(_0x1123,0x118));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3112('0x0'));var timeout=require('connect-timeout');var express=require(_0x3112('0x1'));var router=express[_0x3112('0x2')]();var fs_extra=require(_0x3112('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3112('0x4'));var controller=require(_0x3112('0x5'));router[_0x3112('0x6')]('/',auth[_0x3112('0x7')](),controller[_0x3112('0x8')]);router[_0x3112('0x6')](_0x3112('0x9'),auth[_0x3112('0x7')](),controller[_0x3112('0xa')]);router['get'](_0x3112('0xb'),auth[_0x3112('0x7')](),controller[_0x3112('0xc')]);router[_0x3112('0x6')](_0x3112('0xd'),auth[_0x3112('0x7')](),controller['getPresence']);router['get'](_0x3112('0xe'),auth[_0x3112('0x7')](),controller[_0x3112('0xf')]);router[_0x3112('0x6')](_0x3112('0x10'),controller['getAvatar']);router[_0x3112('0x6')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x3112('0x11')]);router[_0x3112('0x6')](_0x3112('0x12'),auth['isAuthenticated'](),controller['getContacts']);router[_0x3112('0x6')]('/:id/queues',auth[_0x3112('0x7')](),controller['getQueues']);router['get'](_0x3112('0x13'),auth[_0x3112('0x7')](),controller['getVoiceQueuesRt']);router[_0x3112('0x6')](_0x3112('0x14'),auth['isAuthenticated'](),controller['getGroups']);router[_0x3112('0x6')]('/:id/recordings',auth[_0x3112('0x7')](),controller[_0x3112('0x15')]);router['get']('/:id/screen_recordings',auth[_0x3112('0x7')](),controller[_0x3112('0x16')]);router[_0x3112('0x6')](_0x3112('0x17'),auth[_0x3112('0x7')](),controller[_0x3112('0x18')]);router['get'](_0x3112('0x19'),auth['isAuthenticated'](),controller[_0x3112('0x1a')]);router[_0x3112('0x6')](_0x3112('0x1b'),auth[_0x3112('0x7')](),controller[_0x3112('0x1c')]);router['get'](_0x3112('0x1d'),auth['isAuthenticated'](),controller[_0x3112('0x1e')]);router['get']('/:id/fax/interactions',auth[_0x3112('0x7')](),controller['getFaxInteractions']);router[_0x3112('0x6')](_0x3112('0x1f'),auth[_0x3112('0x7')](),controller['getWhatsappInteractions']);router[_0x3112('0x6')](_0x3112('0x20'),auth[_0x3112('0x7')](),controller[_0x3112('0x21')]);router['get'](_0x3112('0x22'),auth[_0x3112('0x7')](),controller['getLists']);router[_0x3112('0x6')]('/:id/agents',auth[_0x3112('0x7')](),controller[_0x3112('0x23')]);router[_0x3112('0x6')](_0x3112('0x24'),auth[_0x3112('0x7')](),controller['getVoicePrefixes']);router[_0x3112('0x6')]('/:id/fax_accounts',auth[_0x3112('0x7')](),controller['getFaxAccounts']);router[_0x3112('0x6')](_0x3112('0x25'),auth[_0x3112('0x7')](),controller[_0x3112('0x26')]);router[_0x3112('0x6')](_0x3112('0x27'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x3112('0x6')](_0x3112('0x28'),auth[_0x3112('0x7')](),controller[_0x3112('0x29')]);router[_0x3112('0x6')](_0x3112('0x2a'),auth['isAuthenticated'](),controller[_0x3112('0x2b')]);router[_0x3112('0x6')](_0x3112('0x2c'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x3112('0x6')](_0x3112('0x2d'),auth[_0x3112('0x7')](),controller['getScheduledCalls']);router[_0x3112('0x6')](_0x3112('0x2e'),auth[_0x3112('0x7')](),controller['getApiKey']);router[_0x3112('0x2f')](_0x3112('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0x3112('0x2f')]('/',auth[_0x3112('0x7')](),controller[_0x3112('0x30')]);router['post'](_0x3112('0x31'),auth[_0x3112('0x7')](),controller[_0x3112('0x32')]);router[_0x3112('0x2f')](_0x3112('0x33'),auth[_0x3112('0x7')](),controller[_0x3112('0x34')]);var upload=multer({'storage':multer[_0x3112('0x35')]({'destination':function(_0x1ab660,_0x2ed34f,_0x19f18c){_0x19f18c(null,path[_0x3112('0x36')](config['root'],_0x3112('0x37')));},'filename':function(_0x6b9d73,_0x32764c,_0x4d044c){_0x4d044c(null,util[_0x3112('0x38')]('%s-%s',Date[_0x3112('0x39')](),_0x32764c[_0x3112('0x3a')]));}})});router[_0x3112('0x2f')](_0x3112('0x10'),upload['single'](_0x3112('0x3b')),controller['addAvatar']);router[_0x3112('0x2f')](_0x3112('0x3c'),auth[_0x3112('0x7')](),controller['login']);router[_0x3112('0x2f')](_0x3112('0x3d'),auth[_0x3112('0x7')](),controller['logout']);router[_0x3112('0x2f')](_0x3112('0x3e'),auth[_0x3112('0x7')](),controller[_0x3112('0x3f')]);router[_0x3112('0x2f')](_0x3112('0x40'),auth[_0x3112('0x7')](),controller['unpause']);router[_0x3112('0x2f')](_0x3112('0x20'),auth[_0x3112('0x7')](),controller[_0x3112('0x41')]);router[_0x3112('0x2f')](_0x3112('0x42'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x3112('0x2f')](_0x3112('0x43'),auth[_0x3112('0x7')](),controller[_0x3112('0x44')]);router[_0x3112('0x2f')](_0x3112('0x45'),auth['isAuthenticated'](),controller[_0x3112('0x46')]);router[_0x3112('0x2f')](_0x3112('0x47'),auth[_0x3112('0x7')](),controller[_0x3112('0x48')]);router[_0x3112('0x2f')](_0x3112('0x49'),auth[_0x3112('0x7')](),controller['addOpenchannelInteractions']);router[_0x3112('0x2f')](_0x3112('0x4a'),auth['isAuthenticated'](),controller[_0x3112('0x4b')]);router['post'](_0x3112('0x4c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x3112('0x2f')]('/:id/mail_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x4d')]);router['post'](_0x3112('0x27'),auth[_0x3112('0x7')](),controller['addOpenchannelAccounts']);router['post'](_0x3112('0x28'),auth[_0x3112('0x7')](),controller[_0x3112('0x4e')]);router['post'](_0x3112('0x2a'),auth[_0x3112('0x7')](),controller['addChatWebsites']);router[_0x3112('0x2f')]('/:id/whatsapp_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x4f')]);router[_0x3112('0x2f')](_0x3112('0x2e'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x3112('0x50')](_0x3112('0xe'),auth[_0x3112('0x7')](),controller['update']);router[_0x3112('0x50')](_0x3112('0x51'),auth[_0x3112('0x7')](),controller[_0x3112('0x52')]);router['delete'](_0x3112('0x33'),auth[_0x3112('0x7')](),controller[_0x3112('0x53')]);router[_0x3112('0x54')](_0x3112('0x20'),auth[_0x3112('0x7')](),controller[_0x3112('0x55')]);router[_0x3112('0x54')]('/:id',auth[_0x3112('0x7')](),controller[_0x3112('0x56')]);router['delete'](_0x3112('0x42'),auth[_0x3112('0x7')](),controller[_0x3112('0x57')]);router[_0x3112('0x54')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x3112('0x58')]);router[_0x3112('0x54')](_0x3112('0x45'),auth[_0x3112('0x7')](),controller[_0x3112('0x59')]);router['delete'](_0x3112('0x47'),auth[_0x3112('0x7')](),controller[_0x3112('0x5a')]);router[_0x3112('0x54')](_0x3112('0x49'),auth[_0x3112('0x7')](),controller['removeOpenchannelInteractions']);router['delete'](_0x3112('0x4a'),auth[_0x3112('0x7')](),controller[_0x3112('0x5b')]);router[_0x3112('0x54')]('/:id/fax_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x5c')]);router[_0x3112('0x54')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x3112('0x5d')]);router['delete'](_0x3112('0x27'),auth['isAuthenticated'](),controller[_0x3112('0x5e')]);router[_0x3112('0x54')]('/:id/sms_accounts',auth[_0x3112('0x7')](),controller[_0x3112('0x5f')]);router[_0x3112('0x54')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x3112('0x60')]);router['delete'](_0x3112('0x2c'),auth[_0x3112('0x7')](),controller[_0x3112('0x61')]);router['delete'](_0x3112('0x2e'),auth[_0x3112('0x7')](),controller[_0x3112('0x62')]);module['exports']=router; \ No newline at end of file +var _0xb910=['addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','bulkCreate'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0xb910,0x12b));var _0x0b91=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb910[_0x164eca];return _0x2ce562;};'use strict';var multer=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var path=require(_0x0b91('0x2'));var timeout=require(_0x0b91('0x3'));var express=require(_0x0b91('0x4'));var router=express[_0x0b91('0x5')]();var fs_extra=require(_0x0b91('0x6'));var auth=require(_0x0b91('0x7'));var interaction=require(_0x0b91('0x8'));var config=require(_0x0b91('0x9'));var controller=require(_0x0b91('0xa'));router[_0x0b91('0xb')]('/',auth[_0x0b91('0xc')](),controller[_0x0b91('0xd')]);router['get'](_0x0b91('0xe'),auth[_0x0b91('0xc')](),controller[_0x0b91('0xf')]);router[_0x0b91('0xb')](_0x0b91('0x10'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x11')]);router[_0x0b91('0xb')](_0x0b91('0x12'),auth['isAuthenticated'](),controller[_0x0b91('0x13')]);router['get'](_0x0b91('0x14'),auth['isAuthenticated'](),controller['show']);router[_0x0b91('0xb')](_0x0b91('0x15'),controller[_0x0b91('0x16')]);router[_0x0b91('0xb')]('/:id/open_tabs',auth[_0x0b91('0xc')](),controller[_0x0b91('0x17')]);router[_0x0b91('0xb')](_0x0b91('0x18'),auth['isAuthenticated'](),controller[_0x0b91('0x19')]);router[_0x0b91('0xb')](_0x0b91('0x1a'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x1b')]);router[_0x0b91('0xb')]('/:id/queues_rt',auth[_0x0b91('0xc')](),controller[_0x0b91('0x1c')]);router[_0x0b91('0xb')](_0x0b91('0x1d'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x1e')]);router[_0x0b91('0xb')](_0x0b91('0x1f'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x20')]);router[_0x0b91('0xb')](_0x0b91('0x21'),auth['isAuthenticated'](),controller[_0x0b91('0x22')]);router['get']('/:id/chat/interactions',auth[_0x0b91('0xc')](),controller[_0x0b91('0x23')]);router[_0x0b91('0xb')](_0x0b91('0x24'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x25')]);router[_0x0b91('0xb')](_0x0b91('0x26'),auth[_0x0b91('0xc')](),controller['getMailInteractions']);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x0b91('0x27')]);router[_0x0b91('0xb')](_0x0b91('0x28'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x29')]);router[_0x0b91('0xb')](_0x0b91('0x2a'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x2b')]);router[_0x0b91('0xb')](_0x0b91('0x2c'),auth[_0x0b91('0xc')](),controller['getTeams']);router[_0x0b91('0xb')]('/:id/lists',auth['isAuthenticated'](),controller[_0x0b91('0x2d')]);router['get'](_0x0b91('0x2e'),auth['isAuthenticated'](),controller[_0x0b91('0x2f')]);router[_0x0b91('0xb')]('/:id/prefixes',auth[_0x0b91('0xc')](),controller[_0x0b91('0x30')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0b91('0x31')]);router[_0x0b91('0xb')](_0x0b91('0x32'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x33')]);router[_0x0b91('0xb')](_0x0b91('0x34'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x35')]);router[_0x0b91('0xb')](_0x0b91('0x36'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x0b91('0xb')](_0x0b91('0x37'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x38')]);router[_0x0b91('0xb')](_0x0b91('0x39'),auth['isAuthenticated'](),controller[_0x0b91('0x3a')]);router[_0x0b91('0xb')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x0b91('0x3b')]);router[_0x0b91('0xb')](_0x0b91('0x3c'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x3d')]);router['post']('/:id/contacts',auth[_0x0b91('0xc')](),controller[_0x0b91('0x3e')]);router[_0x0b91('0x3f')]('/',auth[_0x0b91('0xc')](),controller[_0x0b91('0x40')]);router['post'](_0x0b91('0x41'),auth['isAuthenticated'](),controller[_0x0b91('0x42')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0x0b91('0x43')]);var upload=multer({'storage':multer[_0x0b91('0x44')]({'destination':function(_0x51657e,_0x55841c,_0x2497cd){_0x2497cd(null,path[_0x0b91('0x45')](config[_0x0b91('0x46')],_0x0b91('0x47')));},'filename':function(_0x4cd9ac,_0x421bfe,_0x498b7a){_0x498b7a(null,util[_0x0b91('0x48')](_0x0b91('0x49'),Date[_0x0b91('0x4a')](),_0x421bfe[_0x0b91('0x4b')]));}})});router[_0x0b91('0x3f')]('/:id/avatar',upload[_0x0b91('0x4c')](_0x0b91('0x4d')),controller['addAvatar']);router['post'](_0x0b91('0x4e'),auth[_0x0b91('0xc')](),controller['login']);router[_0x0b91('0x3f')](_0x0b91('0x4f'),auth[_0x0b91('0xc')](),controller['logout']);router['post'](_0x0b91('0x50'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x51')]);router[_0x0b91('0x3f')](_0x0b91('0x52'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x53')]);router['post'](_0x0b91('0x2c'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x54')]);router[_0x0b91('0x3f')]('/:id/chat_interactions',auth[_0x0b91('0xc')](),controller[_0x0b91('0x55')]);router[_0x0b91('0x3f')](_0x0b91('0x56'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x57')]);router['post'](_0x0b91('0x58'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x59')]);router[_0x0b91('0x3f')]('/:id/sms_interactions',auth[_0x0b91('0xc')](),controller[_0x0b91('0x5a')]);router['post'](_0x0b91('0x5b'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x5c')]);router['post'](_0x0b91('0x5d'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x5e')]);router[_0x0b91('0x3f')](_0x0b91('0x5f'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x60')]);router[_0x0b91('0x3f')](_0x0b91('0x32'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x61')]);router[_0x0b91('0x3f')](_0x0b91('0x34'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x62')]);router['post'](_0x0b91('0x36'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x63')]);router[_0x0b91('0x3f')](_0x0b91('0x37'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x64')]);router[_0x0b91('0x3f')](_0x0b91('0x39'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x65')]);router[_0x0b91('0x3f')](_0x0b91('0x3c'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x0b91('0x66')](_0x0b91('0x14'),auth[_0x0b91('0xc')](),controller['update']);router['put'](_0x0b91('0x67'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x68')]);router[_0x0b91('0x69')](_0x0b91('0x1a'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x6a')]);router['delete'](_0x0b91('0x2c'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x6b')]);router[_0x0b91('0x69')]('/:id',auth[_0x0b91('0xc')](),controller[_0x0b91('0x6c')]);router['delete'](_0x0b91('0x6d'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x6e')]);router[_0x0b91('0x69')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x0b91('0x6f')]);router[_0x0b91('0x69')](_0x0b91('0x58'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x70')]);router[_0x0b91('0x69')]('/:id/sms_interactions',auth[_0x0b91('0xc')](),controller[_0x0b91('0x71')]);router[_0x0b91('0x69')](_0x0b91('0x5b'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x72')]);router[_0x0b91('0x69')]('/:id/whatsapp_interactions',auth[_0x0b91('0xc')](),controller[_0x0b91('0x73')]);router[_0x0b91('0x69')](_0x0b91('0x5f'),auth['isAuthenticated'](),controller[_0x0b91('0x74')]);router[_0x0b91('0x69')](_0x0b91('0x32'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x0b91('0x69')](_0x0b91('0x34'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x75')]);router[_0x0b91('0x69')](_0x0b91('0x36'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x0b91('0x69')]('/:id/chat_websites',auth[_0x0b91('0xc')](),controller[_0x0b91('0x76')]);router['delete'](_0x0b91('0x39'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x77')]);router[_0x0b91('0x69')]('/:id/api_key',auth[_0x0b91('0xc')](),controller[_0x0b91('0x78')]);module[_0x0b91('0x79')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 94f2afc..156ac92 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 _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x429f32,_0xdd2362){var _0x15b912=function(_0x28db62){while(--_0x28db62){_0x429f32['push'](_0x429f32['shift']());}};_0x15b912(++_0xdd2362);}(_0x34e8,0x12c));var _0x834e=function(_0x2a0cfc,_0x130449){_0x2a0cfc=_0x2a0cfc-0x0;var _0x234b87=_0x34e8[_0x2a0cfc];return _0x234b87;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 625ddce..57d66eb 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 _0x5336=['flattenDeep','addAgent','getDataValue','UserVoicePrefix','VoicePrefixId','Queue:save','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','Voice','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','firstName','lastName','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','inbound','flatten','getAgents','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','ringing','voiceStatus','slice','charAt','select','field','ui.','user_has_','toString','OpenTabs','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','register','redis','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','undefined','limit','count','offset','set','agent','emit','userNotification:recalc:','destroy','get','role','admin','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','sendStatus','stack','send','index','User','rawAttributes','type','salt','getOptions','where','query','include','UserSetting','attributes','push','findAll','openTabs','rows','length','chat','sms','fax','dataValues','mail','openchannel','all','show','params','differenceBy','keys','password','filters','intersection','model','fields','includeAll','userSetting','true','merge','whatsapp','body','describe','addContacts','omit','ids','internal','Setting','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','105','106','107','108','109','114','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','compact','changePassword','oldPassword','newPassword','Sequelize','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','toLowerCase','voice','VoiceQueue','online','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','remove','Queue:remove','QueueId','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','options','hasOwnProperty','CmList','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','update','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','PAUSE','MemberReport','LOGININPAUSE','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','getAssociatedQueues'];(function(_0x36c4e0,_0x2497a5){var _0x4e2391=function(_0x339cfe){while(--_0x339cfe){_0x36c4e0['push'](_0x36c4e0['shift']());}};_0x4e2391(++_0x2497a5);}(_0x5336,0x76));var _0x6533=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x5336[_0x40a825];return _0x273a54;};'use strict';var moment=require('moment');var util=require(_0x6533('0x0'));var path=require(_0x6533('0x1'));var fs=require('fs');var _=require(_0x6533('0x2'));var squel=require(_0x6533('0x3'));var jayson=require(_0x6533('0x4'));var Redis=require(_0x6533('0x5'));var authService=require(_0x6533('0x6'));var qs=require(_0x6533('0x7'));var logger=require(_0x6533('0x8'))(_0x6533('0x9'));var utils=require(_0x6533('0xa'));var config=require(_0x6533('0xb'));var licenseUtil=require(_0x6533('0xc'));var APIBadRequestError=require(_0x6533('0xd'))[_0x6533('0xe')];var APINotFoundError=require(_0x6533('0xd'))[_0x6533('0xf')];var APIHandleError=require(_0x6533('0xd'))['handleError'];var db=require(_0x6533('0x10'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x6533('0x11')](socket);config[_0x6533('0x12')]=_[_0x6533('0x13')](config[_0x6533('0x12')],{'host':_0x6533('0x14'),'port':0x18eb});var amiClient=jayson[_0x6533('0x15')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x300e66,_0x85ff52,_0x7754bd,_0x271fb1){return new Promise(function(_0x4dc193,_0x1c06ea){var _0x1c2f83=_0x271fb1||amiClient;return _0x1c2f83[_0x6533('0x16')](_0x300e66,_0x7754bd)[_0x6533('0x17')](function(_0x47d527){logger[_0x6533('0x18')](_0x6533('0x19'),_0x85ff52,_0x6533('0x1a'));logger[_0x6533('0x1b')](_0x6533('0x1c'),_0x85ff52,_0x6533('0x1a'),JSON[_0x6533('0x1d')](_0x47d527));if(_0x47d527[_0x6533('0x1e')]){if(_0x47d527[_0x6533('0x1e')][_0x6533('0x1f')]===0x1f4){logger[_0x6533('0x1e')](_0x6533('0x19'),_0x85ff52,_0x47d527['error'][_0x6533('0x20')]);return _0x1c06ea(_0x47d527[_0x6533('0x1e')][_0x6533('0x20')]);}logger[_0x6533('0x1e')](_0x6533('0x19'),_0x85ff52,_0x47d527[_0x6533('0x1e')][_0x6533('0x20')]);return _0x4dc193(_0x47d527[_0x6533('0x1e')]['message']);}else{logger['info']('User,\x20%s,\x20%s',_0x85ff52,_0x6533('0x1a'));_0x4dc193(_0x47d527[_0x6533('0x21')]['message']);}})[_0x6533('0x22')](function(_0x2c135a){logger['error'](_0x6533('0x19'),_0x85ff52,_0x2c135a);_0x1c06ea(_0x2c135a);});});}function respondWithStatusCode(_0x4ec818,_0x336cd6){_0x336cd6=_0x336cd6||0xcc;return function(_0x105d47){if(_0x105d47){return _0x4ec818['sendStatus'](_0x336cd6);}return _0x4ec818['status'](_0x336cd6)[_0x6533('0x23')]();};}function respondWithResult(_0x245ec0,_0x162a06){_0x162a06=_0x162a06||0xc8;return function(_0x4340a8){if(_0x4340a8){return _0x245ec0[_0x6533('0x24')](_0x162a06)[_0x6533('0x25')](_0x4340a8);}};}function respondWithFilteredResult(_0x1a5e4b,_0x2acb97){return function(_0x2ac25c){if(_0x2ac25c){var _0x2a5d12=typeof _0x2acb97['offset']===_0x6533('0x26')&&typeof _0x2acb97[_0x6533('0x27')]===_0x6533('0x26');var _0xe09f3=_0x2ac25c[_0x6533('0x28')];var _0xbabd0c=_0x2a5d12?0x0:_0x2acb97[_0x6533('0x29')];var _0x332cac=_0x2a5d12?_0x2ac25c[_0x6533('0x28')]:_0x2acb97[_0x6533('0x29')]+_0x2acb97[_0x6533('0x27')];var _0x66b5da;if(_0x332cac>=_0xe09f3){_0x332cac=_0xe09f3;_0x66b5da=0xc8;}else{_0x66b5da=0xce;}_0x1a5e4b['status'](_0x66b5da);return _0x1a5e4b[_0x6533('0x2a')]('Content-Range',_0xbabd0c+'-'+_0x332cac+'/'+_0xe09f3)['json'](_0x2ac25c);}return null;};}function saveUpdates(_0x51efac){return function(_0x426f39){if(_0x426f39){return _0x426f39['update'](_0x51efac)[_0x6533('0x17')](function(_0x5c5367){if(_0x5c5367['role']===_0x6533('0x2b')){socket[_0x6533('0x2c')](_0x6533('0x2d')+_0x5c5367['id'],_0x5c5367);}return _0x5c5367;});}return null;};}function removeEntity(_0x2d4f4f){return function(_0xe9b8f9){if(_0xe9b8f9){return _0xe9b8f9[_0x6533('0x2e')]()['then'](function(){var _0x390e87=_0xe9b8f9[_0x6533('0x2f')]({'plain':!![]});if(_0x390e87[_0x6533('0x30')]===_0x6533('0x31'))return;var _0x3a74c3=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':_0x6533('0x2b'),'ignore':![]},{'name':_0x6533('0x32'),'value':_0x6533('0x33'),'ignore':![]}];var _0x2585c8=_(_0x3a74c3)[_0x6533('0x34')](_0x6533('0x35'))[_0x6533('0x36')]('value')[_0x6533('0x37')]();if(_[_0x6533('0x38')](_0x2585c8,_0x390e87[_0x6533('0x30')])){return;}var _0x574bf6=_[_0x6533('0x39')](_0x3a74c3,[_0x6533('0x37'),_0x390e87['role']])[_0x6533('0x3a')];return db[_0x6533('0x3b')]['destroy']({'where':{'type':_0x574bf6,'resourceId':_0x390e87['id']}})['then'](function(){return _0xe9b8f9;});})[_0x6533('0x17')](function(){_0x2d4f4f['status'](0xcc)[_0x6533('0x23')]();});}};}function handleEntityNotFound(_0x33e1c4){return function(_0x4529a3){if(!_0x4529a3){_0x33e1c4[_0x6533('0x3c')](0x194);}return _0x4529a3;};}function handleError(_0x3d680a,_0x149f50){_0x149f50=_0x149f50||0x1f4;return function(_0x65f7f2){logger[_0x6533('0x1e')](_0x65f7f2[_0x6533('0x3d')]);if(_0x65f7f2[_0x6533('0x3a')]){delete _0x65f7f2[_0x6533('0x3a')];}_0x3d680a[_0x6533('0x24')](_0x149f50)[_0x6533('0x3e')](_0x65f7f2);};}exports[_0x6533('0x3f')]=function(_0x4c584a,_0x5855e4){var _0x276d1a={},_0x588b94={'count':0x0,'rows':[]};var _0xe70ea8=_(db[_0x6533('0x40')][_0x6533('0x41')])[_0x6533('0x36')](function(_0x46c1ad){return{'name':_0x46c1ad['fieldName'],'type':_0x46c1ad[_0x6533('0x42')]['key']};})[_0x6533('0x34')](function(_0x4313cd){return!_[_0x6533('0x38')](['password',_0x6533('0x43')],_0x4313cd['name']);})[_0x6533('0x37')]();_0x276d1a=qs[_0x6533('0x44')](_0xe70ea8,_0x4c584a);var _0x3dfa13={'where':_0x276d1a[_0x6533('0x45')]};return db['User'][_0x6533('0x28')](_0x3dfa13)['then'](function(_0xe41918){_0x588b94[_0x6533('0x28')]=_0xe41918;if(_0x4c584a[_0x6533('0x46')]['includeAll']){_0x276d1a[_0x6533('0x47')]=[{'all':!![]}];}if(_0x4c584a['query']['userSetting']==='true'){_0x276d1a[_0x6533('0x47')]=[{'model':db[_0x6533('0x48')],'as':'userSetting'}];}if(!_[_0x6533('0x38')](_0x276d1a[_0x6533('0x49')],'id')){_0x276d1a[_0x6533('0x49')][_0x6533('0x4a')]('id');}return db[_0x6533('0x40')][_0x6533('0x4b')](_0x276d1a);})[_0x6533('0x17')](function(_0x455b56){_0x588b94['rows']=_0x455b56;if(_0x4c584a['query'][_0x6533('0x4c')]==='true'){var _0x53d496=[];for(var _0x4870fd=0x0;_0x4870fd<_0x588b94[_0x6533('0x4d')][_0x6533('0x4e')];_0x4870fd++){_0x53d496[_0x6533('0x4a')](get_open_tabs(_0x6533('0x4f'),_0x588b94[_0x6533('0x4d')][_0x4870fd]['dataValues']));_0x53d496[_0x6533('0x4a')](get_open_tabs(_0x6533('0x50'),_0x588b94[_0x6533('0x4d')][_0x4870fd]['dataValues']));_0x53d496['push'](get_open_tabs(_0x6533('0x51'),_0x588b94['rows'][_0x4870fd][_0x6533('0x52')]));_0x53d496['push'](get_open_tabs(_0x6533('0x53'),_0x588b94[_0x6533('0x4d')][_0x4870fd][_0x6533('0x52')]));_0x53d496[_0x6533('0x4a')](get_open_tabs(_0x6533('0x54'),_0x588b94[_0x6533('0x4d')][_0x4870fd][_0x6533('0x52')]));_0x53d496[_0x6533('0x4a')](get_open_tabs('whatsapp',_0x588b94[_0x6533('0x4d')][_0x4870fd][_0x6533('0x52')]));}return Promise[_0x6533('0x55')](_0x53d496)[_0x6533('0x17')](function(){return _0x588b94;});}else{return _0x588b94;}})[_0x6533('0x17')](respondWithFilteredResult(_0x5855e4,_0x276d1a))[_0x6533('0x22')](handleError(_0x5855e4,null));};exports[_0x6533('0x56')]=function(_0x55f9ae,_0x470fb2){var _0x3dbf97={'raw':![],'where':{'id':_0x55f9ae[_0x6533('0x57')]['id']}},_0x5b4fc5={};_0x5b4fc5['model']=_[_0x6533('0x58')](_[_0x6533('0x59')](db[_0x6533('0x40')]['rawAttributes']),[_0x6533('0x5a'),_0x6533('0x43')]);_0x5b4fc5[_0x6533('0x46')]=_[_0x6533('0x59')](_0x55f9ae[_0x6533('0x46')]);_0x5b4fc5[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x5b4fc5[_0x6533('0x5d')],_0x5b4fc5['query']);_0x3dbf97[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x5b4fc5[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x55f9ae[_0x6533('0x46')][_0x6533('0x5e')]));_0x3dbf97[_0x6533('0x49')]=_0x3dbf97[_0x6533('0x49')][_0x6533('0x4e')]?_0x3dbf97['attributes']:_0x5b4fc5['model'];if(_0x55f9ae[_0x6533('0x46')][_0x6533('0x5f')]){_0x3dbf97[_0x6533('0x47')]=[{'all':!![]}];}if(_0x55f9ae[_0x6533('0x46')][_0x6533('0x60')]===_0x6533('0x61')){_0x3dbf97[_0x6533('0x47')]=[{'model':db[_0x6533('0x48')],'as':_0x6533('0x60')}];}_0x3dbf97=_[_0x6533('0x62')]({},_0x3dbf97,_0x55f9ae['options']);if(!_[_0x6533('0x38')](_0x3dbf97[_0x6533('0x49')],'id')){_0x3dbf97[_0x6533('0x49')][_0x6533('0x4a')]('id');}return db[_0x6533('0x40')][_0x6533('0x39')](_0x3dbf97)[_0x6533('0x17')](handleEntityNotFound(_0x470fb2,null))['then'](function(_0x3bf882){var _0x4dbf8d=[];values=_0x3bf882;if(_0x55f9ae[_0x6533('0x46')][_0x6533('0x4c')]==='true'){_0x4dbf8d[_0x6533('0x4a')](get_open_tabs(_0x6533('0x4f'),_0x3bf882[_0x6533('0x52')]));_0x4dbf8d['push'](get_open_tabs(_0x6533('0x50'),_0x3bf882[_0x6533('0x52')]));_0x4dbf8d[_0x6533('0x4a')](get_open_tabs('openchannel',_0x3bf882[_0x6533('0x52')]));_0x4dbf8d['push'](get_open_tabs(_0x6533('0x63'),_0x3bf882[_0x6533('0x52')]));_0x4dbf8d[_0x6533('0x4a')](get_open_tabs('fax',_0x3bf882[_0x6533('0x52')]));_0x4dbf8d[_0x6533('0x4a')](get_open_tabs('mail',_0x3bf882[_0x6533('0x52')]));return Promise[_0x6533('0x55')](_0x4dbf8d);}else{return values;}})[_0x6533('0x17')](function(){return values;})[_0x6533('0x17')](respondWithResult(_0x470fb2,null))[_0x6533('0x22')](handleError(_0x470fb2,null));};exports['update']=function(_0x35312a,_0x2d51fd){if(_0x35312a[_0x6533('0x64')]['id']){delete _0x35312a[_0x6533('0x64')]['id'];}delete _0x35312a[_0x6533('0x64')][_0x6533('0x30')];return db['User'][_0x6533('0x39')]({'where':{'id':_0x35312a[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d51fd,null))[_0x6533('0x17')](saveUpdates(_0x35312a[_0x6533('0x64')],null))[_0x6533('0x17')](respondWithResult(_0x2d51fd,null))['catch'](handleError(_0x2d51fd,null));};exports[_0x6533('0x65')]=function(_0x463b09,_0x4d70db){return db['User'][_0x6533('0x65')]()[_0x6533('0x17')](respondWithResult(_0x4d70db,null))['catch'](handleError(_0x4d70db,null));};exports[_0x6533('0x66')]=function(_0x42690c,_0x58d84d){return db['User'][_0x6533('0x39')]({'where':{'id':_0x42690c[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x58d84d,null))[_0x6533('0x17')](function(_0x4e559a){if(_0x4e559a){return _0x4e559a['addContacts'](_0x42690c[_0x6533('0x64')]['ids'],_[_0x6533('0x67')](_0x42690c[_0x6533('0x64')],[_0x6533('0x68'),'id'])||{});}})[_0x6533('0x17')](respondWithResult(_0x58d84d,null))[_0x6533('0x22')](handleError(_0x58d84d,null));};function validateUser(_0x1a6cee){return new Promise(function(_0x27f55b,_0x335d59){if(_0x1a6cee[_0x6533('0x69')])return _0x27f55b(_0x1a6cee);return db[_0x6533('0x6a')]['findById'](0x1)[_0x6533('0x17')](function(_0x3b47c5){if(_0x3b47c5[_0x6533('0x6b')])authService[_0x6533('0x6c')](_0x1a6cee[_0x6533('0x5a')]);db[_0x6533('0x40')][_0x6533('0x6d')](_0x6533('0x69'))[_0x6533('0x17')](function(_0x8f5e23){if(_['isNil'](_0x8f5e23)){_0x1a6cee[_0x6533('0x69')]=_0x3b47c5['min_internal']||0x1;return;}if(_[_0x6533('0x6e')](_0x3b47c5[_0x6533('0x6f')])||_0x3b47c5[_0x6533('0x6f')]===_0x8f5e23){_0x1a6cee[_0x6533('0x69')]=_0x8f5e23+0x1;return;}if(_0x3b47c5[_0x6533('0x6f')]>_0x8f5e23){_0x1a6cee[_0x6533('0x69')]=_0x3b47c5[_0x6533('0x6f')];return;}return db['sequelize'][_0x6533('0x46')]('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)',{'type':db[_0x6533('0x70')][_0x6533('0x71')][_0x6533('0x72')]})[_0x6533('0x17')](function(_0x3c6147){if(_0x3c6147&&_0x3c6147[_0x6533('0x4e')]){for(var _0x3002cf=0x0,_0x4ff857=_0x3c6147[_0x6533('0x4e')];_0x3002cf<_0x4ff857&&_[_0x6533('0x6e')](_0x1a6cee[_0x6533('0x69')]);_0x3002cf++){if(_0x3b47c5[_0x6533('0x6f')]<=_0x3c6147[_0x3002cf][_0x6533('0x73')]){_0x1a6cee['internal']=_0x3c6147[_0x3002cf][_0x6533('0x73')];}else if(_0x3b47c5[_0x6533('0x6f')]>_0x3c6147[_0x3002cf][_0x6533('0x73')]&&_0x3b47c5[_0x6533('0x6f')]<=_0x3c6147[_0x3002cf]['to']){_0x1a6cee[_0x6533('0x69')]=_0x3b47c5[_0x6533('0x6f')];}}}if(_[_0x6533('0x6e')](_0x1a6cee[_0x6533('0x69')])){_0x1a6cee[_0x6533('0x69')]=_0x8f5e23+0x1;}return _0x27f55b(_0x1a6cee);});});})[_0x6533('0x22')](function(_0x52980a){_0x335d59(_0x52980a);});});}function updateUser(_0x1d649d){return new Promise(function(_0xa0075c,_0x48ac4a){try{if(_0x1d649d[_0x6533('0x74')]){_0x1d649d[_0x6533('0x75')]=_0x1d649d[_0x6533('0x69')];_0x1d649d[_0x6533('0x76')]={'mailbox':_0x1d649d[_0x6533('0x69')],'password':_0x1d649d[_0x6533('0x5a')],'fullname':_0x1d649d[_0x6533('0x77')],'email':_0x1d649d[_0x6533('0x78')]};}if(_0x1d649d[_0x6533('0x30')]==='agent'){if(!_0x1d649d['permissions'])_0x1d649d[_0x6533('0x79')]=[_0x6533('0x7a'),_0x6533('0x7b'),_0x6533('0x7c'),'113',_0x6533('0x7d'),_0x6533('0x7e'),_0x6533('0x7f'),_0x6533('0x80'),_0x6533('0x81'),_0x6533('0x82'),_0x6533('0x83'),'100','111',_0x6533('0x84'),'115'];}_0xa0075c(_0x1d649d);}catch(_0x2525d6){_0x48ac4a(_0x2525d6);}});}exports[_0x6533('0x85')]=function(_0xb40e9b,_0x438889){if(_0xb40e9b[_0x6533('0x86')][_0x6533('0x30')]===_0x6533('0x2b'))throw new Error(_0x6533('0x87'));if(_0xb40e9b['body'][_0x6533('0x30')]==='user'&&_0xb40e9b[_0x6533('0x86')][_0x6533('0x30')]!==_0x6533('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xb40e9b[_0x6533('0x64')]['role']==='admin'&&_0xb40e9b[_0x6533('0x86')]['role']!==_0x6533('0x31')){throw new Error(_0x6533('0x88'));}return licenseUtil[_0x6533('0x89')]([_0xb40e9b[_0x6533('0x64')]])[_0x6533('0x17')](function(){return validateUser(_0xb40e9b['body']);})[_0x6533('0x17')](function(_0xf96371){return updateUser(_0xf96371)['then'](function(_0x1e6f43){if(_0x1e6f43[_0x6533('0x30')]===_0x6533('0x31')){_0x1e6f43[_0x6533('0x8a')]=_0xb40e9b[_0x6533('0x86')][_0x6533('0x8a')];delete _0x1e6f43[_0x6533('0x8b')];}return _0x1e6f43;});})[_0x6533('0x17')](function(_0x5e89a6){return db[_0x6533('0x40')]['create'](_0x5e89a6,{'include':[{'model':db[_0x6533('0x76')],'as':'VoiceMail'}]});})[_0x6533('0x17')](function(_0x32a19a){if(_0xb40e9b[_0x6533('0x64')][_0x6533('0x30')]===_0x6533('0x86'))return _0x32a19a;if(_0xb40e9b[_0x6533('0x86')][_0x6533('0x30')]!==_0x6533('0x86'))return _0x32a19a;return db[_0x6533('0x8c')]['find']({'where':{'name':_0x32a19a[_0x6533('0x30')]==='agent'?_0x6533('0x8d'):'Telephones','userProfileId':_0xb40e9b[_0x6533('0x86')]['userProfileId']},'raw':!![]})[_0x6533('0x17')](function(_0x55d2d4){if(!_0x55d2d4||_0x55d2d4[_0x6533('0x8e')]!=0x0)return _0x32a19a;return db[_0x6533('0x3b')][_0x6533('0x85')]({'name':_0x32a19a[_0x6533('0x3a')],'resourceId':_0x32a19a['id'],'type':_0x55d2d4['name'],'sectionId':_0x55d2d4['id']},{})[_0x6533('0x17')](function(){return _0x32a19a;});})[_0x6533('0x22')](function(_0x361ccf){logger[_0x6533('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x361ccf);throw _0x361ccf;});})[_0x6533('0x17')](respondWithResult(_0x438889,0xc9))[_0x6533('0x22')](handleError(_0x438889,null));};exports[_0x6533('0x8f')]=function(_0xbfafd1,_0x49e063){var _0x29a0e2=_0xbfafd1['body'];var _0x19034a=[];if(_0xbfafd1['user'][_0x6533('0x30')]===_0x6533('0x2b'))throw new Error(_0x6533('0x87'));if(_[_0x6533('0x90')](_0x29a0e2,[_0x6533('0x30'),'user'])&&_0xbfafd1['user'][_0x6533('0x30')]!==_0x6533('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6533('0x90')](_0x29a0e2,['role',_0x6533('0x31')])&&_0xbfafd1[_0x6533('0x86')]['role']!==_0x6533('0x31')){throw new Error(_0x6533('0x91'));}return licenseUtil['checkUserLimits'](_0x29a0e2)[_0x6533('0x17')](function(){return validateUser(_0x29a0e2[0x0]);})['then'](function(){for(var _0x2d1c14=0x1;_0x2d1c14<_0x29a0e2[_0x6533('0x4e')];_0x2d1c14++){var _0x32785b=_0x29a0e2[_0x2d1c14-0x1][_0x6533('0x69')];if(!_0x29a0e2[_0x2d1c14]['internal'])_0x29a0e2[_0x2d1c14][_0x6533('0x69')]=_0x32785b+0x1;_0x19034a[_0x6533('0x4a')](validateUser(_0x29a0e2[_0x2d1c14]));}return Promise[_0x6533('0x55')](_0x19034a);})[_0x6533('0x17')](function(){_0x19034a=[];for(var _0x391d8f=0x0;_0x391d8f<_0x29a0e2['length'];_0x391d8f++){_0x19034a['push'](updateUser(_0x29a0e2[_0x391d8f]));}return Promise[_0x6533('0x55')](_0x19034a);})[_0x6533('0x17')](function(){_0x19034a=_0x29a0e2['map'](function(_0x1ee76f){return db[_0x6533('0x40')][_0x6533('0x85')](_0x1ee76f,{'include':[{'model':db[_0x6533('0x76')],'as':'VoiceMail'}]})[_0x6533('0x17')](function(_0x220fc2){_0x1ee76f['id']=_0x220fc2['id'];return _0x1ee76f;});});return Promise[_0x6533('0x55')](_0x19034a);})['then'](function(_0x2d25f7){if(_0xbfafd1[_0x6533('0x64')]['role']===_0x6533('0x86'))return _0x2d25f7;if(_0xbfafd1[_0x6533('0x86')]['role']!==_0x6533('0x86'))return _0x2d25f7;var _0x61ca1a=_[_0x6533('0x90')](_0x2d25f7,function(_0x2f30e5){return _0x2f30e5[_0x6533('0x30')]===_0x6533('0x2b')||_0x2f30e5['role']===_0x6533('0x33');});if(!_0x61ca1a)return _0x2d25f7;return db[_0x6533('0x8c')][_0x6533('0x4b')]({'where':{'name':{'$or':['Agents',_0x6533('0x32')]},'userProfileId':_0xbfafd1['user'][_0x6533('0x8b')]},'raw':!![]})[_0x6533('0x17')](function(_0x330e2f){if(_['isEmpty'](_0x330e2f)||!_[_0x6533('0x90')](_0x330e2f,[_0x6533('0x8e'),0x0]))return _0x2d25f7;_0x19034a=[];var _0x33fafc=_(_0x330e2f)[_0x6533('0x36')](function(_0x2a7918){if(_0x2a7918[_0x6533('0x8e')]===0x1)return;return _0x2a7918[_0x6533('0x3a')]===_0x6533('0x8d')?_0x6533('0x2b'):_0x6533('0x33');})[_0x6533('0x92')]()[_0x6533('0x37')]();for(var _0x3f2c4b=0x0;_0x3f2c4b<_0x2d25f7[_0x6533('0x4e')];_0x3f2c4b++){if(!_[_0x6533('0x38')](_0x33fafc,_0x2d25f7[_0x3f2c4b][_0x6533('0x30')]))return;var _0x486a43=_0x2d25f7[_0x3f2c4b]['role']===_0x6533('0x2b')?_0x6533('0x8d'):'Telephones';_0x19034a[_0x6533('0x4a')](db[_0x6533('0x3b')][_0x6533('0x85')]({'name':_0x2d25f7[_0x3f2c4b]['name'],'resourceId':_0x2d25f7[_0x3f2c4b]['id'],'type':_0x486a43,'sectionId':_[_0x6533('0x39')](_0x330e2f,[_0x6533('0x3a'),_0x486a43])['id']},{}));}return Promise['all'](_0x19034a);});})['then'](respondWithResult(_0x49e063,0xc9))[_0x6533('0x22')](handleError(_0x49e063,null));};exports[_0x6533('0x93')]=function(_0xcfa099,_0x5006e7){if(_0xcfa099[_0x6533('0x64')]['id']){delete _0xcfa099[_0x6533('0x64')]['id'];}return db[_0x6533('0x40')]['find']({'where':{'id':_0xcfa099['params']['id']}})[_0x6533('0x17')](function(_0x11ac00){if(!_0x11ac00)return null;if(_0x11ac00['id']===_0xcfa099[_0x6533('0x86')]['id']){if(!_0xcfa099['body'][_0x6533('0x94')]||!_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db[(_0x6533('0x96'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x11ac00[_0x6533('0x97')](_0xcfa099[_0x6533('0x64')]['oldPassword'])){throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0x99'));}if(_0xcfa099[_0x6533('0x64')][_0x6533('0x94')]===_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0x9a'));}}else if(_0xcfa099[_0x6533('0x86')]['role']===_0x6533('0x31')){if(!_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0x9b'));}}else if(_0xcfa099[_0x6533('0x86')][_0x6533('0x30')]===_0x6533('0x86')){if(!_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]){throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0x9b'));}if(_0x11ac00[_0x6533('0x30')]!==_0x6533('0x2b')){throw new db[(_0x6533('0x96'))]['ValidationError'](_0x6533('0x87'));}}else{throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0x87'));}return _0x11ac00;})[_0x6533('0x17')](handleEntityNotFound(_0x5006e7,null))[_0x6533('0x17')](function(_0x2ba6db){return db[_0x6533('0x6a')][_0x6533('0x9c')]({'attributes':['id',_0x6533('0x6b'),_0x6533('0x9d'),'passwordHistoryLimit']})[_0x6533('0x17')](function(_0x2c7d78){if(_0x2c7d78[_0x6533('0x6b')])authService[_0x6533('0x6c')](_0xcfa099[_0x6533('0x64')][_0x6533('0x95')]);if(!_0x2c7d78['enforcePasswordHistory']||!_0x2ba6db[_0x6533('0x9e')])return _0x2ba6db;authService[_0x6533('0x9f')](_0xcfa099[_0x6533('0x64')][_0x6533('0x95')],_0x2ba6db[_0x6533('0x9e')],_0x2c7d78['passwordHistoryLimit']);return _0x2ba6db;})[_0x6533('0x17')](saveUpdates({'password':_0xcfa099['body']['newPassword'],'passwordResetAt':_0xcfa099[_0x6533('0x86')]['id']==_0xcfa099[_0x6533('0x57')]['id']?moment():null,'previousPasswords':authService[_0x6533('0xa0')](_0xcfa099[_0x6533('0x64')][_0x6533('0x95')],_0x2ba6db['previousPasswords'])},null));})[_0x6533('0x17')](respondWithResult(_0x5006e7,null))['catch'](handleError(_0x5006e7,null));};exports[_0x6533('0xa1')]=function(_0x2b6f44,_0x30e34f){var _0x425878=_0x2b6f44[_0x6533('0x64')][_0x6533('0xa2')];return db[_0x6533('0x40')]['find']({'where':{'id':_0x2b6f44[_0x6533('0x57')]['id']},'attributes':['id','name',_0x6533('0x30'),'online',_0x6533('0xa3'),_0x6533('0xa4'),_0x6533('0xa5')]})[_0x6533('0x17')](handleEntityNotFound(_0x30e34f,null))[_0x6533('0x17')](function(_0x4bdab9){if(_0x4bdab9){if(!utils[_0x6533('0xa6')](_0x425878)){throw new db[(_0x6533('0x96'))]['ValidationError'](_0x6533('0xa7'));}return _0x4bdab9[_0x6533('0xa8')+_[_0x6533('0xa9')](_0x425878['toLowerCase']())+_0x6533('0xaa')](_0x2b6f44[_0x6533('0x64')][_0x6533('0x68')],{'penalty':_0x2b6f44['body']['penalty']||0x0})['spread'](function(_0x54cbac){for(var _0x2cd105=0x0;_0x2cd105<_0x2b6f44[_0x6533('0x64')]['ids'][_0x6533('0x4e')];_0x2cd105+=0x1){var _0x47cdb6={'UserId':Number(_0x2b6f44[_0x6533('0x57')]['id'])};_0x47cdb6[_['capitalize'](_0x425878[_0x6533('0xab')]())+'QueueId']=Number(_0x2b6f44['body']['ids'][_0x2cd105]);socket[_0x6533('0x2c')]('user'+_[_0x6533('0xa9')](_0x425878[_0x6533('0xab')]())+'Queue:save',_0x47cdb6);}return _0x54cbac;})[_0x6533('0x17')](function(){if(_0x425878===_0x6533('0xac')){return db[_0x6533('0xad')]['findAll']({'where':{'id':_0x2b6f44[_0x6533('0x64')][_0x6533('0x68')]||[]},'raw':!![],'attributes':['id',_0x6533('0x3a')]});}})[_0x6533('0x17')](function(_0x48a7b8){var _0x116ee5=_0x4bdab9[_0x6533('0x2f')]({'plain':!![]});var _0x4d42db=[];if(_0x425878==='voice'&&_0x116ee5[_0x6533('0x30')]==='agent'&&_0x116ee5[_0x6533('0xae')]){for(let _0x1dc8de=0x0;_0x1dc8de<_0x48a7b8[_0x6533('0x4e')];_0x1dc8de+=0x1){_0x4d42db['push']({'membername':_0x116ee5[_0x6533('0x3a')],'UserId':_0x116ee5['id'],'queue_name':_0x48a7b8[_0x1dc8de]['name'],'VoiceQueueId':_0x48a7b8[_0x1dc8de]['id'],'interface':_[_0x6533('0x6e')](_0x116ee5[_0x6533('0xa5')])?util[_0x6533('0xaf')](_0x6533('0xb0'),_0x116ee5[_0x6533('0x3a')]):_0x116ee5['interface'],'paused':_0x116ee5['voicePause']||![],'penalty':_0x2b6f44['body'][_0x6533('0xb1')]||0x0});}return Promise[_0x6533('0x55')](_0x4d42db[_0x6533('0x36')](function(_0x1b47a9){return db[_0x6533('0xb2')][_0x6533('0xb3')](_0x1b47a9);}));}return _0x4bdab9;});}})[_0x6533('0x17')](respondWithStatusCode(_0x30e34f,null))['catch'](handleError(_0x30e34f,null));};exports['removeQueues']=function(_0x2fccd1,_0x1e3d5a){var _0x2933c7,_0x15fe8d;return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x2fccd1['params']['id']},'attributes':['id','name',_0x6533('0x30')]})[_0x6533('0x17')](handleEntityNotFound(_0x1e3d5a,null))[_0x6533('0x17')](function(_0x30d2af){if(_0x30d2af){_0x2933c7=_0x30d2af;if(!_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]||!utils[_0x6533('0xa6')](_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')])){throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0xa7'));}return _0x30d2af[_0x6533('0xb4')+_['capitalize'](_0x2fccd1[_0x6533('0x46')]['channel'][_0x6533('0xab')]())+_0x6533('0xaa')](_0x2fccd1[_0x6533('0x46')]['ids']);}})[_0x6533('0x17')](function(_0x50d6e9){if(_['isArray'](_0x2fccd1[_0x6533('0x46')][_0x6533('0x68')])){for(var _0x4614b7=0x0;_0x4614b7<_0x2fccd1[_0x6533('0x46')][_0x6533('0x68')]['length'];_0x4614b7+=0x1){_0x15fe8d={'UserId':Number(_0x2fccd1[_0x6533('0x57')]['id'])};_0x15fe8d[_['capitalize'](_0x2fccd1['query'][_0x6533('0xa2')][_0x6533('0xab')]())+'QueueId']=Number(_0x2fccd1[_0x6533('0x46')][_0x6533('0x68')][_0x4614b7]);socket[_0x6533('0x2c')]('user'+_[_0x6533('0xa9')](_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]['toLowerCase']())+_0x6533('0xb5'),_0x15fe8d);}}else{_0x15fe8d={'UserId':Number(_0x2fccd1[_0x6533('0x57')]['id'])};_0x15fe8d[_[_0x6533('0xa9')](_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]['toLowerCase']())+_0x6533('0xb6')]=Number(_0x2fccd1['query']['ids']);socket[_0x6533('0x2c')]('user'+_[_0x6533('0xa9')](_0x2fccd1[_0x6533('0x46')]['channel']['toLowerCase']())+_0x6533('0xb5'),_0x15fe8d);}return _0x50d6e9;})[_0x6533('0x17')](function(){if(_0x2fccd1[_0x6533('0x46')][_0x6533('0xa2')]===_0x6533('0xac')){return db[_0x6533('0xb2')]['destroy']({'where':{'UserId':_0x2fccd1[_0x6533('0x57')]['id'],'VoiceQueueId':_0x2fccd1['query'][_0x6533('0x68')]},'individualHooks':!![]})[_0x6533('0x17')](function(){return _0x2933c7;});}return _0x2933c7;})[_0x6533('0x17')](respondWithStatusCode(_0x1e3d5a,null))[_0x6533('0x22')](handleError(_0x1e3d5a,null));};exports[_0x6533('0xb7')]=function(_0x3fb4cc,_0x4ce585){_0x3fb4cc[_0x6533('0x64')][_0x6533('0xb8')]=_0x3fb4cc[_0x6533('0xb9')][_0x6533('0xba')];return db[_0x6533('0x40')]['find']({'where':{'id':_0x3fb4cc['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x4ce585,null))['then'](saveUpdates(_0x3fb4cc['body'],null))['then'](respondWithResult(_0x4ce585,null))[_0x6533('0x22')](handleError(_0x4ce585,null));};exports[_0x6533('0xbb')]=function(_0xb1723f,_0x58e9fa){var _0x319f72=path[_0x6533('0xbc')](config['root'],_0x6533('0xbd'));return db['User'][_0x6533('0x39')]({'where':{'id':_0xb1723f['params']['id']},'attributes':['id',_0x6533('0xb8')],'raw':!![]})[_0x6533('0x17')](handleEntityNotFound(_0x58e9fa,null))[_0x6533('0x17')](function(_0x210ae7){if(_0x210ae7){if(_[_0x6533('0x6e')](_0x210ae7[_0x6533('0xb8')])){return _0x58e9fa[_0x6533('0xbe')](_0x319f72);}else{if(!fs[_0x6533('0xbf')](path[_0x6533('0xbc')](config[_0x6533('0xc0')],_0x6533('0xc1'),_0x210ae7['userpic']))){return _0x58e9fa[_0x6533('0xbe')](_0x319f72);}return _0x58e9fa['download'](path[_0x6533('0xbc')](config[_0x6533('0xc0')],_0x6533('0xc1'),_0x210ae7['userpic']));}}})[_0x6533('0x22')](handleError(_0x58e9fa,null));};exports[_0x6533('0xc2')]=function(_0x335dc5,_0x72c7f6){return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x335dc5[_0x6533('0x57')]['id']},'attributes':['id']})[_0x6533('0x17')](handleEntityNotFound(_0x72c7f6,null))['then'](function(_0x55ebf2){var _0x2afd1c=[];values=_0x55ebf2['dataValues'];_0x2afd1c['push'](get_open_tabs(_0x6533('0x4f'),_0x55ebf2[_0x6533('0x52')]));_0x2afd1c['push'](get_open_tabs(_0x6533('0x50'),_0x55ebf2[_0x6533('0x52')]));_0x2afd1c['push'](get_open_tabs(_0x6533('0x54'),_0x55ebf2[_0x6533('0x52')]));_0x2afd1c[_0x6533('0x4a')](get_open_tabs('whatsapp',_0x55ebf2['dataValues']));_0x2afd1c[_0x6533('0x4a')](get_open_tabs('fax',_0x55ebf2[_0x6533('0x52')]));_0x2afd1c['push'](get_open_tabs(_0x6533('0x53'),_0x55ebf2[_0x6533('0x52')]));return Promise[_0x6533('0x55')](_0x2afd1c);})[_0x6533('0x17')](function(_0x4ac963){if(_0x4ac963){var _0x3ed8a9=_[_0x6533('0x36')](values[_0x6533('0xc3')],function(_0x22c1e1){return{'channel':_0x6533('0xc4'),'id':_0x22c1e1['id'],'createdAt':_0x22c1e1[_0x6533('0xc5')]};});var _0x48bada=_[_0x6533('0x36')](values[_0x6533('0xc6')],function(_0x2f2465){return{'channel':_0x6533('0xc7'),'id':_0x2f2465['id'],'createdAt':_0x2f2465[_0x6533('0xc5')]};});var _0x2838bd=_['map'](values['OpenchannelOpenTabs'],function(_0x5a1599){return{'channel':_0x6533('0xc8'),'id':_0x5a1599['id'],'createdAt':_0x5a1599['createdAt']};});var _0x1b8dc3=_[_0x6533('0x36')](values[_0x6533('0xc9')],function(_0x51b301){return{'channel':_0x6533('0xca'),'id':_0x51b301['id'],'createdAt':_0x51b301[_0x6533('0xc5')]};});var _0x434a22=_[_0x6533('0x36')](values[_0x6533('0xcb')],function(_0x5be762){return{'channel':_0x6533('0xcc'),'id':_0x5be762['id'],'createdAt':_0x5be762[_0x6533('0xc5')]};});var _0x3c0a7f=_['map'](values['WhatsappOpenTabs'],function(_0x1f61b6){return{'channel':_0x6533('0xcd'),'id':_0x1f61b6['id'],'createdAt':_0x1f61b6[_0x6533('0xc5')]};});var _0x5e416d=_[_0x6533('0xce')](_0x3ed8a9,_0x48bada,_0x2838bd,_0x1b8dc3,_0x434a22,_0x3c0a7f);var _0x5ea056={'count':_0x5e416d[_0x6533('0x4e')],'rows':_0x5e416d};return _0x5ea056;}else return null;})[_0x6533('0x17')](respondWithResult(_0x72c7f6,null))[_0x6533('0x22')](handleError(_0x72c7f6,null));};exports[_0x6533('0xcf')]=function(_0x28523b,_0xc0e1f2){var _0x4f000c={};var _0x4176d9={};var _0x483665;var _0x3122c0;return db['User'][_0x6533('0x9c')]({'where':{'id':_0x28523b['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0xc0e1f2,null))[_0x6533('0x17')](function(_0x1f0720){if(_0x1f0720){_0x483665=_0x1f0720;_0x4176d9[_0x6533('0x5d')]=_['keys'](db[_0x6533('0xd0')][_0x6533('0x41')]);_0x4176d9['query']=_['keys'](_0x28523b[_0x6533('0x46')]);_0x4176d9[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x4176d9[_0x6533('0x5d')],_0x4176d9[_0x6533('0x46')]);_0x4f000c[_0x6533('0x49')]=_['intersection'](_0x4176d9[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x28523b[_0x6533('0x46')]['fields']));_0x4f000c[_0x6533('0x49')]=_0x4f000c[_0x6533('0x49')][_0x6533('0x4e')]?_0x4f000c[_0x6533('0x49')]:_0x4176d9[_0x6533('0x5d')];_0x4f000c[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x28523b[_0x6533('0x46')]['sort']);_0x4f000c['where']=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x28523b[_0x6533('0x46')],_0x4176d9[_0x6533('0x5b')]));if(_0x28523b['query'][_0x6533('0x34')]){_0x4f000c[_0x6533('0x45')]=_['merge'](_0x4f000c[_0x6533('0x45')],{'$or':_['map'](_0x4f000c[_0x6533('0x49')],function(_0x38e3d0){var _0xe92cfb={};_0xe92cfb[_0x38e3d0]={'$like':'%'+_0x28523b[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0xe92cfb;})});}_0x4f000c=_[_0x6533('0x62')]({},_0x4f000c,_0x28523b[_0x6533('0xd4')]);return _0x483665[_0x6533('0xcf')](_0x4f000c);}})[_0x6533('0x17')](function(_0x455397){if(_0x455397){_0x3122c0=_0x455397['length'];if(_0x28523b['query'][_0x6533('0xd5')](_0x6533('0x5f'))){_0x4f000c[_0x6533('0x47')]=[{'model':db[_0x6533('0xd6')],'as':'List','required':![]},{'model':db[_0x6533('0xd7')],'as':_0x6533('0xd8'),'attributes':['id',_0x6533('0x3a'),_0x6533('0xd9')],'where':_0x28523b[_0x6533('0x46')][_0x6533('0xda')]?{'id':_0x28523b[_0x6533('0x46')][_0x6533('0xda')]}:undefined,'required':_0x28523b[_0x6533('0x46')][_0x6533('0xda')]?!![]:![]}];}if(!_0x28523b[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x4f000c[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x28523b[_0x6533('0x46')][_0x6533('0x27')]);_0x4f000c[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x28523b[_0x6533('0x46')][_0x6533('0x29')]);}return _0x483665[_0x6533('0xcf')](_0x4f000c);}})[_0x6533('0x17')](function(_0x3cf386){if(_0x3cf386){return _0x3cf386?{'count':_0x3122c0,'rows':_0x3cf386}:null;}})[_0x6533('0x17')](respondWithResult(_0xc0e1f2,null))[_0x6533('0x22')](handleError(_0xc0e1f2,null));};exports[_0x6533('0xdb')]=function(_0x267a1c,_0x3c25d7){var _0x556cb7;var _0x2593b8={};var _0x3a9256;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x267a1c['params']['id']},'attributes':['id',_0x6533('0x3a'),'role']})[_0x6533('0x17')](handleEntityNotFound(_0x3c25d7,null))[_0x6533('0x17')](function(_0x55e79e){if(!utils[_0x6533('0xa6')](_0x267a1c[_0x6533('0x46')][_0x6533('0xa2')])){throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0xa7'));}_0x556cb7=_0x55e79e;var _0x1401ad={};_0x1401ad[_0x6533('0x5d')]=_['keys'](db[_['capitalize'](_0x267a1c['query'][_0x6533('0xa2')])+_0x6533('0xdc')][_0x6533('0x41')]);_0x1401ad[_0x6533('0x46')]=_['keys'](_0x267a1c[_0x6533('0x46')]);_0x1401ad[_0x6533('0x5b')]=_['intersection'](_0x1401ad[_0x6533('0x5d')],_0x1401ad[_0x6533('0x46')]);_0x2593b8[_0x6533('0x49')]=_['intersection'](_0x1401ad[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x267a1c[_0x6533('0x46')][_0x6533('0x5e')]));_0x2593b8[_0x6533('0x49')]=_0x2593b8[_0x6533('0x49')]['length']?_0x2593b8[_0x6533('0x49')]:_0x1401ad[_0x6533('0x5d')];_0x2593b8[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x267a1c[_0x6533('0x46')]['sort']);_0x2593b8[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x267a1c[_0x6533('0x46')],_0x1401ad['filters']));if(_0x267a1c[_0x6533('0x46')][_0x6533('0x34')]){_0x2593b8[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2593b8[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2593b8[_0x6533('0x49')],function(_0x4fce39){var _0x4117cb={};_0x4117cb[_0x4fce39]={'$like':'%'+_0x267a1c['query']['filter']+'%'};return _0x4117cb;})});}_0x2593b8=_[_0x6533('0x62')]({},_0x2593b8,_0x267a1c[_0x6533('0xd4')]);switch(_0x556cb7[_0x6533('0x30')]){case _0x6533('0x31'):return db[_[_0x6533('0xa9')](_0x267a1c[_0x6533('0x46')]['channel'])+_0x6533('0xdc')]['findAll'](_0x2593b8);case _0x6533('0x86'):case _0x6533('0x2b'):return _0x556cb7[_0x6533('0x2f')+_[_0x6533('0xa9')](_0x267a1c[_0x6533('0x46')][_0x6533('0xa2')])+'Queues'](_0x2593b8);default:throw new db[(_0x6533('0x96'))][(_0x6533('0x98'))](_0x6533('0xdd'));}})[_0x6533('0x17')](function(_0x2a5782){_0x3a9256=_0x2a5782['length'];if(!_0x267a1c[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x2593b8['limit']=qs[_0x6533('0x27')](_0x267a1c[_0x6533('0x46')][_0x6533('0x27')]);_0x2593b8[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x267a1c['query'][_0x6533('0x29')]);}switch(_0x556cb7[_0x6533('0x30')]){case'admin':return db[_['capitalize'](_0x267a1c['query'][_0x6533('0xa2')])+_0x6533('0xdc')][_0x6533('0x4b')](_0x2593b8);case _0x6533('0x86'):case'agent':return _0x556cb7[_0x6533('0x2f')+_['capitalize'](_0x267a1c[_0x6533('0x46')][_0x6533('0xa2')])+_0x6533('0xaa')](_0x2593b8);}})[_0x6533('0x17')](function(_0x180fbb){return{'count':_0x3a9256,'rows':_0x180fbb};})[_0x6533('0x17')](respondWithResult(_0x3c25d7,null))['catch'](handleError(_0x3c25d7,null));};exports[_0x6533('0xdf')]=function(_0x4fabae,_0x5b07e9){var _0x2421a8={};var _0x18bcf9={};var _0x4d1af6;var _0x5224aa;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x4fabae[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b07e9,null))[_0x6533('0x17')](function(_0x5a0496){if(_0x5a0496){_0x4d1af6=_0x5a0496;_0x18bcf9[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xb2')][_0x6533('0x41')]);_0x18bcf9[_0x6533('0x46')]=_['keys'](_0x4fabae[_0x6533('0x46')]);_0x18bcf9[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x18bcf9[_0x6533('0x5d')],_0x18bcf9[_0x6533('0x46')]);_0x2421a8['attributes']=_[_0x6533('0x5c')](_0x18bcf9[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x4fabae['query'][_0x6533('0x5e')]));_0x2421a8[_0x6533('0x49')]=_0x2421a8[_0x6533('0x49')][_0x6533('0x4e')]?_0x2421a8[_0x6533('0x49')]:_0x18bcf9[_0x6533('0x5d')];_0x2421a8[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x4fabae[_0x6533('0x46')][_0x6533('0xd2')]);_0x2421a8[_0x6533('0x45')]=qs['filters'](_[_0x6533('0xd3')](_0x4fabae['query'],_0x18bcf9[_0x6533('0x5b')]));if(_0x4fabae[_0x6533('0x46')][_0x6533('0x34')]){_0x2421a8[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2421a8[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2421a8[_0x6533('0x49')],function(_0x254eb5){var _0x1c0b19={};_0x1c0b19[_0x254eb5]={'$like':'%'+_0x4fabae[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1c0b19;})});}_0x2421a8=_[_0x6533('0x62')]({},_0x2421a8,_0x4fabae[_0x6533('0xd4')]);return _0x4d1af6[_0x6533('0xdf')](_0x2421a8);}})[_0x6533('0x17')](function(_0x37ce20){if(_0x37ce20){_0x5224aa=_0x37ce20[_0x6533('0x4e')];if(!_0x4fabae[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x2421a8[_0x6533('0x27')]=qs['limit'](_0x4fabae[_0x6533('0x46')][_0x6533('0x27')]);_0x2421a8[_0x6533('0x29')]=qs['offset'](_0x4fabae['query'][_0x6533('0x29')]);}return _0x4d1af6[_0x6533('0xdf')](_0x2421a8);}})[_0x6533('0x17')](function(_0xd90962){if(_0xd90962){return _0xd90962?{'count':_0x5224aa,'rows':_0xd90962}:null;}})[_0x6533('0x17')](respondWithResult(_0x5b07e9,null))[_0x6533('0x22')](handleError(_0x5b07e9,null));};exports[_0x6533('0xe0')]=function(_0x330ef6,_0x45ea6b){var _0x2835a6={};var _0x59fee5={};var _0x251c85;var _0x4f5d98;return db['User']['findOne']({'where':{'id':_0x330ef6[_0x6533('0x57')]['id']}})['then'](handleEntityNotFound(_0x45ea6b,null))[_0x6533('0x17')](function(_0x123f44){if(_0x123f44){_0x251c85=_0x123f44;_0x59fee5[_0x6533('0x5d')]=_['keys'](db['ChatGroup'][_0x6533('0x41')]);_0x59fee5[_0x6533('0x46')]=_['keys'](_0x330ef6[_0x6533('0x46')]);_0x59fee5['filters']=_[_0x6533('0x5c')](_0x59fee5[_0x6533('0x5d')],_0x59fee5['query']);_0x2835a6[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x59fee5[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x330ef6['query'][_0x6533('0x5e')]));_0x2835a6[_0x6533('0x49')]=_0x2835a6[_0x6533('0x49')][_0x6533('0x4e')]?_0x2835a6[_0x6533('0x49')]:_0x59fee5[_0x6533('0x5d')];_0x2835a6[_0x6533('0xd1')]=qs['sort'](_0x330ef6[_0x6533('0x46')][_0x6533('0xd2')]);_0x2835a6[_0x6533('0x45')]=qs['filters'](_['pick'](_0x330ef6[_0x6533('0x46')],_0x59fee5[_0x6533('0x5b')]));if(_0x330ef6[_0x6533('0x46')][_0x6533('0x34')]){_0x2835a6[_0x6533('0x45')]=_['merge'](_0x2835a6[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2835a6[_0x6533('0x49')],function(_0x5bb076){var _0x3decb1={};_0x3decb1[_0x5bb076]={'$like':'%'+_0x330ef6['query'][_0x6533('0x34')]+'%'};return _0x3decb1;})});}_0x2835a6=_['merge']({},_0x2835a6,_0x330ef6['options']);return _0x251c85['getGroups'](_0x2835a6);}})['then'](function(_0x43298d){if(_0x43298d){_0x4f5d98=_0x43298d[_0x6533('0x4e')];if(!_0x330ef6[_0x6533('0x46')][_0x6533('0xd5')](_0x6533('0xde'))){_0x2835a6[_0x6533('0x27')]=qs['limit'](_0x330ef6['query'][_0x6533('0x27')]);_0x2835a6[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x330ef6[_0x6533('0x46')][_0x6533('0x29')]);}return _0x251c85[_0x6533('0xe0')](_0x2835a6);}})[_0x6533('0x17')](function(_0x298992){if(_0x298992){return _0x298992?{'count':_0x4f5d98,'rows':_0x298992}:null;}})[_0x6533('0x17')](respondWithResult(_0x45ea6b,null))[_0x6533('0x22')](handleError(_0x45ea6b,null));};exports[_0x6533('0xe1')]=function(_0x4a45d1,_0xe99189){var _0x410403={'raw':!![],'where':{}};var _0x24efdb={};var _0x5353b6={'count':0x0,'rows':[]};return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x4a45d1['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0xe99189,null))[_0x6533('0x17')](function(_0x5b59be){if(_0x5b59be){_0x24efdb[_0x6533('0x5d')]=_['keys'](db[_0x6533('0xe2')]['rawAttributes']);_0x24efdb['query']=_[_0x6533('0x59')](_0x4a45d1['query']);_0x24efdb[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x24efdb[_0x6533('0x5d')],_0x24efdb['query']);_0x410403[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x24efdb[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x4a45d1[_0x6533('0x46')][_0x6533('0x5e')]));_0x410403['attributes']=_0x410403[_0x6533('0x49')][_0x6533('0x4e')]?_0x410403['attributes']:_0x24efdb[_0x6533('0x5d')];if(!_0x4a45d1[_0x6533('0x46')][_0x6533('0xd5')](_0x6533('0xde'))){_0x410403[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x4a45d1['query'][_0x6533('0x27')]);_0x410403[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x4a45d1['query']['offset']);}_0x410403[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x4a45d1[_0x6533('0x46')][_0x6533('0xd2')]);_0x410403['where']=qs[_0x6533('0x5b')](_['pick'](_0x4a45d1['query'],_0x24efdb[_0x6533('0x5b')]));_0x410403[_0x6533('0x45')]['UserId']=_0x5b59be['id'];if(_0x4a45d1['query'][_0x6533('0x34')]){_0x410403[_0x6533('0x45')]=_[_0x6533('0x62')](_0x410403[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x410403[_0x6533('0x49')],function(_0x4d2eb5){var _0x410ded={};_0x410ded[_0x4d2eb5]={'$like':'%'+_0x4a45d1['query'][_0x6533('0x34')]+'%'};return _0x410ded;})});}_0x410403=_[_0x6533('0x62')]({},_0x410403,_0x4a45d1[_0x6533('0xd4')]);return db[_0x6533('0xe2')][_0x6533('0x28')]({'where':_0x410403['where']})['then'](function(_0x38b42e){_0x5353b6[_0x6533('0x28')]=_0x38b42e;if(_0x4a45d1['query'][_0x6533('0x5f')]){_0x410403[_0x6533('0x47')]=[{'all':!![]}];}return db[_0x6533('0xe2')][_0x6533('0x4b')](_0x410403);})[_0x6533('0x17')](function(_0x839209){_0x5353b6['rows']=_0x839209;return _0x5353b6;});}})[_0x6533('0x17')](respondWithFilteredResult(_0xe99189,_0x410403))[_0x6533('0x22')](handleError(_0xe99189,null));};exports[_0x6533('0xe3')]=function(_0x12093c,_0x472a45){var _0x2a1b62={'raw':!![],'where':{}};var _0xba4a39={};var _0x12f1b6={'count':0x0,'rows':[]};return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x12093c[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x472a45,null))[_0x6533('0x17')](function(_0x5b0530){if(_0x5b0530){_0xba4a39['model']=_[_0x6533('0x59')](db[_0x6533('0xe4')][_0x6533('0x41')]);_0xba4a39[_0x6533('0x46')]=_[_0x6533('0x59')](_0x12093c[_0x6533('0x46')]);_0xba4a39['filters']=_[_0x6533('0x5c')](_0xba4a39[_0x6533('0x5d')],_0xba4a39[_0x6533('0x46')]);_0x2a1b62[_0x6533('0x49')]=_[_0x6533('0x5c')](_0xba4a39[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x12093c[_0x6533('0x46')][_0x6533('0x5e')]));_0x2a1b62[_0x6533('0x49')]=_0x2a1b62[_0x6533('0x49')]['length']?_0x2a1b62[_0x6533('0x49')]:_0xba4a39[_0x6533('0x5d')];if(!_0x12093c[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x2a1b62[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x12093c[_0x6533('0x46')][_0x6533('0x27')]);_0x2a1b62[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x12093c[_0x6533('0x46')][_0x6533('0x29')]);}_0x2a1b62[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x12093c[_0x6533('0x46')][_0x6533('0xd2')]);_0x2a1b62['where']=qs[_0x6533('0x5b')](_['pick'](_0x12093c['query'],_0xba4a39[_0x6533('0x5b')]));_0x2a1b62['where']['UserId']=_0x5b0530['id'];if(_0x12093c[_0x6533('0x46')]['filter']){_0x2a1b62[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2a1b62[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2a1b62['attributes'],function(_0x505224){var _0x51f9f4={};_0x51f9f4[_0x505224]={'$like':'%'+_0x12093c[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x51f9f4;})});}_0x2a1b62=_[_0x6533('0x62')]({},_0x2a1b62,_0x12093c['options']);return db[_0x6533('0xe4')][_0x6533('0x28')]({'where':_0x2a1b62[_0x6533('0x45')]})[_0x6533('0x17')](function(_0x265911){_0x12f1b6[_0x6533('0x28')]=_0x265911;if(_0x12093c['query'][_0x6533('0x5f')]){_0x2a1b62['include']=[{'all':!![]}];}return db[_0x6533('0xe4')][_0x6533('0x4b')](_0x2a1b62);})['then'](function(_0x45305b){_0x12f1b6[_0x6533('0x4d')]=_0x45305b;return _0x12f1b6;});}})[_0x6533('0x17')](respondWithFilteredResult(_0x472a45,_0x2a1b62))['catch'](handleError(_0x472a45,null));};exports[_0x6533('0xe5')]=function(_0x469a14,_0x495fab){var _0x2ead12={};var _0x1dbac1={};var _0x4509eb;var _0x5dcd10;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x469a14[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x495fab,null))[_0x6533('0x17')](function(_0xfe52df){if(_0xfe52df){_0x4509eb=_0xfe52df;_0x1dbac1[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xe6')][_0x6533('0x41')]);_0x1dbac1['query']=_[_0x6533('0x59')](_0x469a14[_0x6533('0x46')]);_0x1dbac1['filters']=_[_0x6533('0x5c')](_0x1dbac1[_0x6533('0x5d')],_0x1dbac1['query']);_0x2ead12[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x1dbac1[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x469a14[_0x6533('0x46')]['fields']));_0x2ead12[_0x6533('0x49')]=_0x2ead12['attributes']['length']?_0x2ead12[_0x6533('0x49')]:_0x1dbac1['model'];_0x2ead12[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x469a14[_0x6533('0x46')][_0x6533('0xd2')]);_0x2ead12[_0x6533('0x45')]=qs['filters'](_[_0x6533('0xd3')](_0x469a14[_0x6533('0x46')],_0x1dbac1['filters']));if(_0x469a14[_0x6533('0x46')][_0x6533('0x34')]){_0x2ead12[_0x6533('0x45')]=_[_0x6533('0x62')](_0x2ead12[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x2ead12[_0x6533('0x49')],function(_0x349074){var _0xb7da4f={};_0xb7da4f[_0x349074]={'$like':'%'+_0x469a14[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0xb7da4f;})});}_0x2ead12=_[_0x6533('0x62')]({},_0x2ead12,_0x469a14['options']);return _0x4509eb[_0x6533('0xe5')](_0x2ead12);}})[_0x6533('0x17')](function(_0x3a55d0){if(_0x3a55d0){_0x5dcd10=_0x3a55d0[_0x6533('0x4e')];if(!_0x469a14['query'][_0x6533('0xd5')](_0x6533('0xde'))){_0x2ead12[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x469a14['query']['limit']);_0x2ead12['offset']=qs['offset'](_0x469a14[_0x6533('0x46')][_0x6533('0x29')]);}return _0x4509eb[_0x6533('0xe5')](_0x2ead12);}})['then'](function(_0x306ec1){if(_0x306ec1){return _0x306ec1?{'count':_0x5dcd10,'rows':_0x306ec1}:null;}})[_0x6533('0x17')](respondWithResult(_0x495fab,null))[_0x6533('0x22')](handleError(_0x495fab,null));};exports[_0x6533('0xe7')]=function(_0x1466a6,_0x126f8b){var _0x1e5745={};var _0x4412ee={};var _0x39c72e;var _0x502b5e;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x1466a6[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x126f8b,null))[_0x6533('0x17')](function(_0x62fcc2){if(_0x62fcc2){_0x39c72e=_0x62fcc2;_0x4412ee['model']=_[_0x6533('0x59')](db[_0x6533('0xe8')][_0x6533('0x41')]);_0x4412ee[_0x6533('0x46')]=_[_0x6533('0x59')](_0x1466a6[_0x6533('0x46')]);_0x4412ee[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x4412ee[_0x6533('0x5d')],_0x4412ee[_0x6533('0x46')]);_0x1e5745[_0x6533('0x49')]=_['intersection'](_0x4412ee['model'],qs['fields'](_0x1466a6[_0x6533('0x46')]['fields']));_0x1e5745[_0x6533('0x49')]=_0x1e5745[_0x6533('0x49')][_0x6533('0x4e')]?_0x1e5745[_0x6533('0x49')]:_0x4412ee['model'];_0x1e5745['order']=qs[_0x6533('0xd2')](_0x1466a6[_0x6533('0x46')]['sort']);_0x1e5745['where']=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x1466a6[_0x6533('0x46')],_0x4412ee[_0x6533('0x5b')]));if(_0x1466a6['query']['filter']){_0x1e5745[_0x6533('0x45')]=_[_0x6533('0x62')](_0x1e5745[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x1e5745[_0x6533('0x49')],function(_0x5eaa74){var _0x1663f6={};_0x1663f6[_0x5eaa74]={'$like':'%'+_0x1466a6[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1663f6;})});}_0x1e5745=_['merge']({},_0x1e5745,_0x1466a6[_0x6533('0xd4')]);return _0x39c72e[_0x6533('0xe7')](_0x1e5745);}})[_0x6533('0x17')](function(_0x2244a4){if(_0x2244a4){_0x502b5e=_0x2244a4['length'];if(!_0x1466a6[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x1e5745[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x1466a6[_0x6533('0x46')]['limit']);_0x1e5745['offset']=qs[_0x6533('0x29')](_0x1466a6[_0x6533('0x46')]['offset']);}return _0x39c72e[_0x6533('0xe7')](_0x1e5745);}})[_0x6533('0x17')](function(_0x39341e){if(_0x39341e){return _0x39341e?{'count':_0x502b5e,'rows':_0x39341e}:null;}})[_0x6533('0x17')](respondWithResult(_0x126f8b,null))[_0x6533('0x22')](handleError(_0x126f8b,null));};exports[_0x6533('0xe9')]=function(_0x2801e2,_0x4f480d){var _0x4ce4e2={'raw':!![],'where':{}};var _0x430959={};var _0x9ffe05={'count':0x0,'rows':[]};return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x2801e2['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x4f480d,null))['then'](function(_0x1b97dd){if(_0x1b97dd){_0x430959[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xea')][_0x6533('0x41')]);_0x430959[_0x6533('0x46')]=_['keys'](_0x2801e2[_0x6533('0x46')]);_0x430959['filters']=_[_0x6533('0x5c')](_0x430959[_0x6533('0x5d')],_0x430959[_0x6533('0x46')]);_0x4ce4e2[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x430959[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2801e2['query'][_0x6533('0x5e')]));_0x4ce4e2[_0x6533('0x49')]=_0x4ce4e2[_0x6533('0x49')][_0x6533('0x4e')]?_0x4ce4e2[_0x6533('0x49')]:_0x430959[_0x6533('0x5d')];if(!_0x2801e2[_0x6533('0x46')]['hasOwnProperty'](_0x6533('0xde'))){_0x4ce4e2[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x2801e2[_0x6533('0x46')][_0x6533('0x27')]);_0x4ce4e2[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x2801e2['query'][_0x6533('0x29')]);}_0x4ce4e2[_0x6533('0xd1')]=qs['sort'](_0x2801e2[_0x6533('0x46')][_0x6533('0xd2')]);_0x4ce4e2['where']=qs['filters'](_[_0x6533('0xd3')](_0x2801e2[_0x6533('0x46')],_0x430959['filters']));_0x4ce4e2['where']['UserId']=_0x1b97dd['id'];if(_0x2801e2[_0x6533('0x46')][_0x6533('0x34')]){_0x4ce4e2[_0x6533('0x45')]=_[_0x6533('0x62')](_0x4ce4e2[_0x6533('0x45')],{'$or':_['map'](_0x4ce4e2[_0x6533('0x49')],function(_0xf3ff8){var _0xb7e4d0={};_0xb7e4d0[_0xf3ff8]={'$like':'%'+_0x2801e2['query']['filter']+'%'};return _0xb7e4d0;})});}_0x4ce4e2=_[_0x6533('0x62')]({},_0x4ce4e2,_0x2801e2[_0x6533('0xd4')]);return db[_0x6533('0xea')][_0x6533('0x28')]({'where':_0x4ce4e2[_0x6533('0x45')]})[_0x6533('0x17')](function(_0x4f14ff){_0x9ffe05[_0x6533('0x28')]=_0x4f14ff;if(_0x2801e2[_0x6533('0x46')][_0x6533('0x5f')]){_0x4ce4e2[_0x6533('0x47')]=[{'all':!![]}];}return db[_0x6533('0xea')][_0x6533('0x4b')](_0x4ce4e2);})[_0x6533('0x17')](function(_0x1deafb){_0x9ffe05[_0x6533('0x4d')]=_0x1deafb;return _0x9ffe05;});}})[_0x6533('0x17')](respondWithFilteredResult(_0x4f480d,_0x4ce4e2))[_0x6533('0x22')](handleError(_0x4f480d,null));};exports[_0x6533('0xeb')]=function(_0x5eb68d,_0x29231e){var _0x4c8107={};var _0x29dc5c={};var _0x3b6d03;var _0x566fc4;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x5eb68d[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x29231e,null))[_0x6533('0x17')](function(_0x17c817){if(_0x17c817){_0x3b6d03=_0x17c817;_0x29dc5c['model']=_[_0x6533('0x59')](db[_0x6533('0xec')][_0x6533('0x41')]);_0x29dc5c[_0x6533('0x46')]=_[_0x6533('0x59')](_0x5eb68d[_0x6533('0x46')]);_0x29dc5c[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x29dc5c[_0x6533('0x5d')],_0x29dc5c['query']);_0x4c8107[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x29dc5c[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x5eb68d[_0x6533('0x46')][_0x6533('0x5e')]));_0x4c8107[_0x6533('0x49')]=_0x4c8107[_0x6533('0x49')][_0x6533('0x4e')]?_0x4c8107[_0x6533('0x49')]:_0x29dc5c[_0x6533('0x5d')];_0x4c8107[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x5eb68d[_0x6533('0x46')][_0x6533('0xd2')]);_0x4c8107[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x5eb68d['query'],_0x29dc5c['filters']));if(_0x5eb68d['query']['filter']){_0x4c8107[_0x6533('0x45')]=_[_0x6533('0x62')](_0x4c8107[_0x6533('0x45')],{'$or':_['map'](_0x4c8107[_0x6533('0x49')],function(_0x4c38e4){var _0x34d2ca={};_0x34d2ca[_0x4c38e4]={'$like':'%'+_0x5eb68d[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x34d2ca;})});}_0x4c8107=_[_0x6533('0x62')]({},_0x4c8107,_0x5eb68d[_0x6533('0xd4')]);return _0x3b6d03[_0x6533('0xeb')](_0x4c8107);}})[_0x6533('0x17')](function(_0x63b9de){if(_0x63b9de){_0x566fc4=_0x63b9de['length'];if(!_0x5eb68d[_0x6533('0x46')][_0x6533('0xd5')](_0x6533('0xde'))){_0x4c8107[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x5eb68d[_0x6533('0x46')]['limit']);_0x4c8107[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x5eb68d['query'][_0x6533('0x29')]);}return _0x3b6d03[_0x6533('0xeb')](_0x4c8107);}})[_0x6533('0x17')](function(_0x4fdd66){if(_0x4fdd66){return _0x4fdd66?{'count':_0x566fc4,'rows':_0x4fdd66}:null;}})[_0x6533('0x17')](respondWithResult(_0x29231e,null))[_0x6533('0x22')](handleError(_0x29231e,null));};exports[_0x6533('0xed')]=function(_0x5e2921,_0x3c70f9){var _0x4e8453={};var _0x10342b={};var _0x4509e4;var _0xd1a1dd;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x5e2921[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x3c70f9,null))[_0x6533('0x17')](function(_0x4e4e2f){if(_0x4e4e2f){_0x4509e4=_0x4e4e2f;_0x10342b[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xee')][_0x6533('0x41')]);_0x10342b['query']=_[_0x6533('0x59')](_0x5e2921[_0x6533('0x46')]);_0x10342b[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x10342b['model'],_0x10342b['query']);_0x4e8453[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x10342b['model'],qs[_0x6533('0x5e')](_0x5e2921[_0x6533('0x46')][_0x6533('0x5e')]));_0x4e8453[_0x6533('0x49')]=_0x4e8453[_0x6533('0x49')][_0x6533('0x4e')]?_0x4e8453[_0x6533('0x49')]:_0x10342b['model'];_0x4e8453[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x5e2921[_0x6533('0x46')][_0x6533('0xd2')]);_0x4e8453[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x5e2921[_0x6533('0x46')],_0x10342b[_0x6533('0x5b')]));if(_0x5e2921[_0x6533('0x46')]['filter']){_0x4e8453[_0x6533('0x45')]=_[_0x6533('0x62')](_0x4e8453['where'],{'$or':_[_0x6533('0x36')](_0x4e8453['attributes'],function(_0xbb8ce3){var _0x1b729d={};_0x1b729d[_0xbb8ce3]={'$like':'%'+_0x5e2921[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1b729d;})});}_0x4e8453=_['merge']({},_0x4e8453,_0x5e2921['options']);return _0x4509e4[_0x6533('0xed')](_0x4e8453);}})[_0x6533('0x17')](function(_0x25dc9e){if(_0x25dc9e){_0xd1a1dd=_0x25dc9e[_0x6533('0x4e')];if(!_0x5e2921[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x4e8453[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x5e2921['query'][_0x6533('0x27')]);_0x4e8453[_0x6533('0x29')]=qs['offset'](_0x5e2921[_0x6533('0x46')]['offset']);}return _0x4509e4['getFaxInteractions'](_0x4e8453);}})[_0x6533('0x17')](function(_0x44153f){if(_0x44153f){return _0x44153f?{'count':_0xd1a1dd,'rows':_0x44153f}:null;}})[_0x6533('0x17')](respondWithResult(_0x3c70f9,null))[_0x6533('0x22')](handleError(_0x3c70f9,null));};exports[_0x6533('0xef')]=function(_0x2beb65,_0x23e1dc){var _0x577dbf={};var _0x3d7880={};var _0x24efdd;var _0x18c202;return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x2beb65[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x23e1dc,null))[_0x6533('0x17')](function(_0x8f138){if(_0x8f138){_0x24efdd=_0x8f138;_0x3d7880[_0x6533('0x5d')]=_[_0x6533('0x59')](db[_0x6533('0xf0')][_0x6533('0x41')]);_0x3d7880['query']=_[_0x6533('0x59')](_0x2beb65[_0x6533('0x46')]);_0x3d7880[_0x6533('0x5b')]=_['intersection'](_0x3d7880[_0x6533('0x5d')],_0x3d7880[_0x6533('0x46')]);_0x577dbf[_0x6533('0x49')]=_[_0x6533('0x5c')](_0x3d7880[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2beb65[_0x6533('0x46')]['fields']));_0x577dbf[_0x6533('0x49')]=_0x577dbf[_0x6533('0x49')][_0x6533('0x4e')]?_0x577dbf[_0x6533('0x49')]:_0x3d7880[_0x6533('0x5d')];_0x577dbf[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2beb65[_0x6533('0x46')][_0x6533('0xd2')]);_0x577dbf[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x2beb65['query'],_0x3d7880['filters']));if(_0x2beb65[_0x6533('0x46')][_0x6533('0x34')]){_0x577dbf[_0x6533('0x45')]=_['merge'](_0x577dbf[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x577dbf[_0x6533('0x49')],function(_0x494647){var _0x4d7a8f={};_0x4d7a8f[_0x494647]={'$like':'%'+_0x2beb65[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x4d7a8f;})});}_0x577dbf=_['merge']({},_0x577dbf,_0x2beb65[_0x6533('0xd4')]);return _0x24efdd[_0x6533('0xef')](_0x577dbf);}})[_0x6533('0x17')](function(_0x518121){if(_0x518121){_0x18c202=_0x518121[_0x6533('0x4e')];if(!_0x2beb65['query'][_0x6533('0xd5')](_0x6533('0xde'))){_0x577dbf[_0x6533('0x27')]=qs['limit'](_0x2beb65[_0x6533('0x46')][_0x6533('0x27')]);_0x577dbf[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x2beb65[_0x6533('0x46')]['offset']);}return _0x24efdd[_0x6533('0xef')](_0x577dbf);}})[_0x6533('0x17')](function(_0x535f96){if(_0x535f96){return _0x535f96?{'count':_0x18c202,'rows':_0x535f96}:null;}})['then'](respondWithResult(_0x23e1dc,null))['catch'](handleError(_0x23e1dc,null));};exports[_0x6533('0xf1')]=function(_0x19b21b,_0x338dca,_0x358139){var _0x21df42;var _0x3676bf;var _0x1cb1f8;var _0x113233=!_[_0x6533('0x6e')](_0x19b21b[_0x6533('0x57')]['id'])?_0x19b21b[_0x6533('0x57')]['id']:!_['isNil'](_0x19b21b['user']['id'])?_0x19b21b[_0x6533('0x86')]['id']:null;return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x113233,'role':{'$or':[_0x6533('0x31'),_0x6533('0x86'),_0x6533('0x2b')]}},'attributes':['id',_0x6533('0x3a'),_0x6533('0xf2'),_0x6533('0xf3'),'role',_0x6533('0x69'),'loginInPause']})[_0x6533('0x17')](function(_0x106c96){if(_0x106c96){if(_0x106c96[_0x6533('0x30')]===_0x6533('0x2b')){_0x21df42=_0x106c96;if(_0x19b21b[_0x6533('0x64')][_0x6533('0xa5')]){_0x1cb1f8=util['format'](_0x6533('0xf4'),_0x21df42[_0x19b21b[_0x6533('0x64')]['interface']]);}else if(_0x19b21b[_0x6533('0x64')][_0x6533('0xf5')]){_0x1cb1f8=util[_0x6533('0xaf')](_0x6533('0xb0'),_0x19b21b[_0x6533('0x64')]['intrf']);}else{_0x1cb1f8=util[_0x6533('0xaf')]('SIP/%s',_0x21df42[_0x6533('0x3a')]);}socket['to'](util[_0x6533('0xaf')](_0x6533('0xf6'),_0x21df42[_0x6533('0x3a')]))[_0x6533('0x2c')](_0x6533('0xf7'),{'user':{'id':_0x21df42['id'],'name':_0x21df42[_0x6533('0x3a')]},'ip':_0x19b21b[_0x6533('0xf8')]['x-forwarded-for']||_0x19b21b['connection'][_0x6533('0xf9')]||_0x19b21b[_0x6533('0xfa')][_0x6533('0xf9')]||_0x19b21b[_0x6533('0xfb')]['socket'][_0x6533('0xf9')]});return db[_0x6533('0xb2')][_0x6533('0x2e')]({'where':{'membername':_0x21df42[_0x6533('0x3a')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x6533('0x98'))](_0x6533('0xfc'));}})[_0x6533('0x17')](function(){if(_0x21df42){return _0x21df42[_0x6533('0xfd')]({'raw':!![]});}})[_0x6533('0x17')](function(_0xdc78b){if(_0x21df42){if(_0xdc78b){_0x3676bf=_0xdc78b;if(_0x3676bf[_0x6533('0x4e')]){var _0x5af95a=_0x3676bf[_0x6533('0x36')](function(_0x3908fb){var _0x34adb5={'membername':_0x21df42['name'],'UserId':_0x21df42['id'],'queue_name':_0x3908fb[_0x6533('0x3a')],'VoiceQueueId':_0x3908fb['id'],'interface':_0x1cb1f8,'paused':_0x21df42[_0x6533('0xa3')]||![],'penalty':_0x3908fb['UserVoiceQueue.penalty']||0x0};return db[_0x6533('0xb2')]['upsert'](_0x34adb5);});return Promise['all'](_0x5af95a);}}}})[_0x6533('0x17')](function(){if(_0x21df42){return db['MemberReport'][_0x6533('0x4b')]({'where':{'membername':_0x21df42[_0x6533('0x3a')],'exitAt':null}});}})[_0x6533('0x17')](function(_0x99c169){if(_0x21df42){var _0x90d8b3=[];_0x99c169['forEach'](function(_0x1e1779){_0x90d8b3['push'](_0x1e1779[_0x6533('0xfe')]({'exitAt':moment()[_0x6533('0xaf')](_0x6533('0xff'))}));});return Promise[_0x6533('0x55')](_0x90d8b3);}})['then'](function(){if(_0x21df42){var _0x1814c7=[];var _0x128eb6=[];var _0x2b7bd6=utils['getChannels']();var _0x4bf6e4={'membername':_0x21df42[_0x6533('0x3a')],'interface':_0x1cb1f8,'enterAt':moment()[_0x6533('0xaf')](_0x6533('0xff')),'role':_0x21df42[_0x6533('0x30')],'internal':_0x21df42[_0x6533('0x69')]};_0x2b7bd6[_0x6533('0x100')](function(_0x581c2f){_0x1814c7[_0x6533('0x4a')](_[_0x6533('0x62')]({'channel':_0x581c2f,'type':_0x6533('0x101'),'data1':_0x19b21b[_0x6533('0x64')]['device'],'data2':_0x1cb1f8},_0x4bf6e4));if(_0x21df42[_0x6533('0xa3')]){_0x128eb6[_0x6533('0x4a')](_[_0x6533('0x62')]({'channel':_0x581c2f,'type':_0x6533('0x102'),'data1':'LOGININPAUSE'},_0x4bf6e4));}});return db[_0x6533('0x103')][_0x6533('0x8f')](_0x1814c7[_0x6533('0xce')](_0x128eb6),{'individualHooks':!![]});}})[_0x6533('0x17')](function(){if(_0x21df42){return _0x21df42[_0x6533('0xfe')]({'online':!![],'lastLoginAt':moment()[_0x6533('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x21df42['loginInPause']||![],'mailPause':_0x21df42['loginInPause']||![],'chatPause':_0x21df42['loginInPause']||![],'faxPause':_0x21df42[_0x6533('0xa3')]||![],'smsPause':_0x21df42[_0x6533('0xa3')]||![],'openchannelPause':_0x21df42[_0x6533('0xa3')]||![],'whatsappPause':_0x21df42[_0x6533('0xa3')]||![],'pauseType':_0x21df42[_0x6533('0xa3')]?_0x6533('0x104'):null,'interface':_0x1cb1f8,'lastPauseAt':moment()[_0x6533('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x6533('0x17')](function(_0xda1a52){if(_0x19b21b['isMiddleware']){return _0x358139();}else{return Promise[_0x6533('0x105')](_0xda1a52)['then'](respondWithResult(_0x338dca,null));}})['catch'](handleError(_0x338dca,null));};exports[_0x6533('0x106')]=function(_0x5524b2,_0x456ac9){var _0x3a13d6;return db[_0x6533('0x40')][_0x6533('0x39')]({'where':{'id':_0x5524b2['params']['id'],'role':_0x6533('0x2b')},'attributes':['id',_0x6533('0x3a'),_0x6533('0x30')]})[_0x6533('0x17')](handleEntityNotFound(_0x456ac9,null))[_0x6533('0x17')](function(_0x2ba68e){if(_0x2ba68e){_0x3a13d6=_0x2ba68e;return db[_0x6533('0xb2')]['destroy']({'where':{'membername':_0x3a13d6[_0x6533('0x3a')]},'individualHooks':!![]});}})['then'](function(){return db[_0x6533('0x103')][_0x6533('0x4b')]({'where':{'membername':_0x3a13d6[_0x6533('0x3a')],'exitAt':null}});})[_0x6533('0x17')](function(_0x56bd1a){var _0xb3637f=[];_0x56bd1a[_0x6533('0x100')](function(_0x217696){_0xb3637f[_0x6533('0x4a')](_0x217696[_0x6533('0xfe')]({'exitAt':moment()[_0x6533('0xaf')](_0x6533('0xff'))}));});return Promise[_0x6533('0x55')](_0xb3637f);})[_0x6533('0x17')](function(){return _0x3a13d6[_0x6533('0xfe')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6533('0x17')](respondWithResult(_0x456ac9,null))['catch'](handleError(_0x456ac9,null));};exports[_0x6533('0x107')]=function(_0x2164ff,_0x5c9c11){var _0x5ef067;return db[_0x6533('0xb2')][_0x6533('0xfe')]({'paused':0x1},{'where':{'UserId':_0x2164ff[_0x6533('0x57')]['id']},'individualHooks':!![]})[_0x6533('0x17')](function(){return db['User']['find']({'where':{'id':_0x2164ff[_0x6533('0x57')]['id'],'role':_0x6533('0x2b')},'attributes':['id',_0x6533('0x3a'),_0x6533('0x30'),'internal',_0x6533('0xa5'),_0x6533('0xae')]});})[_0x6533('0x17')](handleEntityNotFound(_0x5c9c11,null))[_0x6533('0x17')](function(_0x5a7d5e){if(_0x5a7d5e){_0x5ef067=_0x5a7d5e;return respondWithRpcPromise(_0x6533('0x108'),_0x6533('0x107'),{'id':_0x5ef067['id'],'name':_0x5ef067[_0x6533('0x3a')],'pause':!![]});}})['then'](function(){if(_0x5ef067){return db[_0x6533('0x103')][_0x6533('0x4b')]({'where':{'membername':_0x5ef067[_0x6533('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x6533('0x17')](function(_0x3105ae){if(_0x3105ae[_0x6533('0x4e')]){var _0x2ce07f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x25bf07=0x0,_0x107f5f=_0x3105ae[_0x6533('0x4e')];_0x25bf07<_0x107f5f;_0x25bf07++){_0x3105ae[_0x25bf07][_0x6533('0x109')]({'exitAt':_0x2ce07f});}}})[_0x6533('0x17')](function(){var _0x1a2fd6=[];var _0x411086=utils[_0x6533('0x10a')]();_0x411086[_0x6533('0x100')](function(_0x4b1b80){_0x1a2fd6[_0x6533('0x4a')]({'channel':_0x4b1b80,'membername':_0x5ef067[_0x6533('0x3a')],'interface':_[_0x6533('0x6e')](_0x5ef067[_0x6533('0xa5')])?util[_0x6533('0xaf')](_0x6533('0xb0'),_0x5ef067[_0x6533('0x3a')]):_0x5ef067['interface'],'type':_0x6533('0x102'),'enterAt':moment()[_0x6533('0xaf')](_0x6533('0xff')),'data1':_0x2164ff[_0x6533('0x64')][_0x6533('0x42')]||'DEFAULT\x20PAUSE','role':_0x5ef067[_0x6533('0x30')],'internal':_0x5ef067[_0x6533('0x69')]});});return db[_0x6533('0x103')][_0x6533('0x8f')](_0x1a2fd6,{'individualHooks':!![]});})[_0x6533('0x17')](function(){return _0x5ef067[_0x6533('0xfe')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2164ff[_0x6533('0x64')][_0x6533('0x42')]||_0x6533('0x10b'),'lastPauseAt':moment()[_0x6533('0xaf')](_0x6533('0xff'))});})[_0x6533('0x17')](respondWithResult(_0x5c9c11,null))['catch'](handleError(_0x5c9c11,null));};exports[_0x6533('0x10c')]=function(_0x16f1ba,_0x4d5744){if(_0x16f1ba['body'][_0x6533('0xa2')]&&!utils[_0x6533('0xa6')](_0x16f1ba['body']['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x16f1ba[_0x6533('0x64')][_0x6533('0xa2')]));}return db['User'][_0x6533('0x39')]({'where':{'id':_0x16f1ba[_0x6533('0x57')]['id']},'attributes':['id',_0x6533('0x3a'),_0x6533('0x30'),'internal','interface',_0x6533('0xae'),'voicePause',_0x6533('0x10d'),_0x6533('0x10e'),_0x6533('0x10f'),_0x6533('0x110'),_0x6533('0x111'),_0x6533('0x112'),_0x6533('0x113'),_0x6533('0x114')]})[_0x6533('0x17')](function(_0x36c7f0){if(!_0x36c7f0){throw new APINotFoundError(util['format'](_0x6533('0x115'),_0x16f1ba[_0x6533('0x57')]['id']));}return _0x36c7f0[_0x6533('0x10c')](_0x16f1ba[_0x6533('0x64')][_0x6533('0xa2')]);})[_0x6533('0x17')](respondWithResult(_0x4d5744,null))[_0x6533('0x22')](APIHandleError(_0x4d5744));};exports['getTeams']=function(_0x2759a8,_0x369814){var _0x6a4c42={};var _0x165756={};var _0x1ab092;var _0x41b854;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x2759a8['params']['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x369814,null))['then'](function(_0xfcddac){if(_0xfcddac){_0x1ab092=_0xfcddac;_0x165756['model']=_[_0x6533('0x59')](db['Team'][_0x6533('0x41')]);_0x165756[_0x6533('0x46')]=_[_0x6533('0x59')](_0x2759a8[_0x6533('0x46')]);_0x165756[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x165756[_0x6533('0x5d')],_0x165756[_0x6533('0x46')]);_0x6a4c42['attributes']=_[_0x6533('0x5c')](_0x165756[_0x6533('0x5d')],qs['fields'](_0x2759a8['query'][_0x6533('0x5e')]));_0x6a4c42[_0x6533('0x49')]=_0x6a4c42[_0x6533('0x49')]['length']?_0x6a4c42[_0x6533('0x49')]:_0x165756['model'];_0x6a4c42[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2759a8[_0x6533('0x46')]['sort']);_0x6a4c42[_0x6533('0x45')]=qs[_0x6533('0x5b')](_['pick'](_0x2759a8[_0x6533('0x46')],_0x165756[_0x6533('0x5b')]));if(_0x2759a8[_0x6533('0x46')][_0x6533('0x34')]){_0x6a4c42['where']=_[_0x6533('0x62')](_0x6a4c42['where'],{'$or':_[_0x6533('0x36')](_0x6a4c42[_0x6533('0x49')],function(_0x1779df){var _0x74674={};_0x74674[_0x1779df]={'$like':'%'+_0x2759a8[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x74674;})});}_0x6a4c42=_['merge']({},_0x6a4c42,_0x2759a8[_0x6533('0xd4')]);return _0x1ab092[_0x6533('0x116')](_0x6a4c42);}})[_0x6533('0x17')](function(_0xc22c41){if(_0xc22c41){_0x41b854=_0xc22c41[_0x6533('0x4e')];if(!_0x2759a8[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x6a4c42['limit']=qs[_0x6533('0x27')](_0x2759a8[_0x6533('0x46')]['limit']);_0x6a4c42[_0x6533('0x29')]=qs[_0x6533('0x29')](_0x2759a8[_0x6533('0x46')][_0x6533('0x29')]);}return _0x1ab092[_0x6533('0x116')](_0x6a4c42);}})[_0x6533('0x17')](function(_0x2b09db){if(_0x2b09db){return _0x2b09db?{'count':_0x41b854,'rows':_0x2b09db}:null;}})[_0x6533('0x17')](respondWithResult(_0x369814,null))[_0x6533('0x22')](handleError(_0x369814,null));};exports[_0x6533('0x117')]=function(_0x1b276b,_0x4b1bf4){var _0x4e1d03=_0x1b276b[_0x6533('0x57')]['id'];var _0x59c97e=_0x1b276b[_0x6533('0x64')]?_0x1b276b[_0x6533('0x64')]['ids']:null;var _0x5ca793=[];return Promise[_0x6533('0x105')]()[_0x6533('0x17')](function(){if(!_0x59c97e)throw new APIBadRequestError(_0x6533('0x118'));})[_0x6533('0x17')](function(){return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x4e1d03}});})[_0x6533('0x17')](function(_0x31dee3){if(!_0x31dee3)throw new APINotFoundError(util[_0x6533('0xaf')](_0x6533('0x115'),_0x1b276b[_0x6533('0x57')]['id']));return db[_0x6533('0x70')][_0x6533('0x119')](function(_0x4752a4){return _0x31dee3[_0x6533('0x117')](_0x59c97e,{'transaction':_0x4752a4})[_0x6533('0x17')](function(){return db[_0x6533('0x11a')]['findAll']({'where':{'id':{'$in':_0x59c97e}}});})[_0x6533('0x17')](function(_0x56ffa8){var _0x3d03fd=_[_0x6533('0x36')](_0x56ffa8,function(_0x49609e){return _0x49609e[_0x6533('0x11b')]();});return Promise[_0x6533('0x55')](_0x3d03fd);})['then'](function(_0x4ef393){_0x5ca793=_[_0x6533('0x11c')](_0x4ef393);var _0x48df05=_['map'](_0x5ca793,function(_0x3cbc87){return _0x3cbc87[_0x6533('0x11d')](_0x31dee3['id'],{'transaction':_0x4752a4});});return Promise[_0x6533('0x55')](_0x48df05);})[_0x6533('0x17')](function(){if(!_0x31dee3['online'])return;var _0x42962b=_['filter'](_0x5ca793,function(_0x1985d9){return _0x1985d9[_0x6533('0x11e')](_0x6533('0xa2'))==='Voice';});var _0x5e27ad=_['map'](_0x42962b,function(_0x31c9f5){return db[_0x6533('0xb2')][_0x6533('0xb3')]({'membername':_0x31dee3['name'],'UserId':_0x31dee3['id'],'queue_name':_0x31c9f5[_0x6533('0x3a')],'VoiceQueueId':_0x31c9f5['id'],'interface':_[_0x6533('0x6e')](_0x31dee3[_0x6533('0xa5')])?util[_0x6533('0xaf')](_0x6533('0xb0'),_0x31dee3[_0x6533('0x3a')]):_0x31dee3[_0x6533('0xa5')],'paused':_0x31dee3[_0x6533('0xa4')]||![],'penalty':_0x31dee3['penalty']},{'transaction':_0x4752a4});});return Promise[_0x6533('0x55')](_0x5e27ad);})['then'](function(){return db['TeamVoicePrefix'][_0x6533('0x4b')]({'where':{'teamId':{'$in':_0x59c97e}}});})['then'](function(_0x50434f){var _0x4bf1c6=_['map'](_0x50434f,function(_0x5d1464){return db[_0x6533('0x11f')][_0x6533('0x85')]({'UserId':_0x31dee3['id'],'VoicePrefixId':_0x5d1464[_0x6533('0x120')]},{'transaction':_0x4752a4});});return Promise['all'](_0x4bf1c6);});});})[_0x6533('0x17')](function(){for(var _0x4b0836=0x0;_0x4b0836<_0x5ca793[_0x6533('0x4e')];_0x4b0836++){var _0x3904b3=_0x5ca793[_0x4b0836][_0x6533('0x11e')](_0x6533('0xa2'));var _0x38a9f4=_0x3904b3+'QueueId';socket[_0x6533('0x2c')]('user'+_0x3904b3+_0x6533('0x121'),{'UserId':_0x4e1d03,['queueField']:_0x5ca793[_0x4b0836]['id']});}})['then'](respondWithStatusCode(_0x4b1bf4,null))[_0x6533('0x22')](APIHandleError(_0x4b1bf4));};exports[_0x6533('0x122')]=function(_0x4a4d12,_0x307bbb){var _0x745d50=_0x4a4d12[_0x6533('0x57')]['id'];var _0x8dc49f=null;if(_0x4a4d12[_0x6533('0x46')][_0x6533('0x68')]){_0x8dc49f=_[_0x6533('0x123')](_0x4a4d12['query']['ids'])?_0x4a4d12[_0x6533('0x46')][_0x6533('0x68')]:[_0x4a4d12[_0x6533('0x46')][_0x6533('0x68')]];}var _0x5ac142=[];return Promise[_0x6533('0x105')]()[_0x6533('0x17')](function(){if(!_0x8dc49f)throw new APIBadRequestError(_0x6533('0x124'));})['then'](function(){return db[_0x6533('0x40')]['findOne']({'where':{'id':_0x745d50}});})[_0x6533('0x17')](function(_0x4ff083){if(!_0x4ff083)throw new APINotFoundError(util[_0x6533('0xaf')](_0x6533('0x115'),_0x4a4d12['params']['id']));return db[_0x6533('0x70')][_0x6533('0x119')](function(_0x46bb1d){return _0x4ff083[_0x6533('0x122')](_0x8dc49f,{'transaction':_0x46bb1d})['then'](function(){return db[_0x6533('0x11a')]['findAll']({'where':{'id':{'$in':_0x8dc49f}}});})['then'](function(_0x43104c){var _0x3aa05f=_[_0x6533('0x36')](_0x43104c,function(_0x64cd62){return _0x64cd62[_0x6533('0x11b')]();});return Promise[_0x6533('0x55')](_0x3aa05f);})[_0x6533('0x17')](function(_0x4074ac){_0x5ac142=_[_0x6533('0x11c')](_0x4074ac);var _0x3f249e=_['map'](_0x5ac142,function(_0x2fa954){return _0x2fa954[_0x6533('0x125')](_0x4ff083['id'],{'transaction':_0x46bb1d});});return Promise[_0x6533('0x55')](_0x3f249e);})[_0x6533('0x17')](function(){if(!_0x4ff083[_0x6533('0xae')])return;var _0x29fd9c=_[_0x6533('0x34')](_0x5ac142,function(_0x1b1966){return _0x1b1966['getDataValue'](_0x6533('0xa2'))===_0x6533('0x126');});var _0x71bc71=_[_0x6533('0x36')](_0x29fd9c,function(_0x19d343){return db['UserVoiceQueueRt'][_0x6533('0x2e')]({'where':{'VoiceQueueId':_0x19d343['id'],'UserId':_0x4ff083['id']},'transaction':_0x46bb1d});});return Promise['all'](_0x71bc71);})['then'](function(){return db['TeamVoicePrefix'][_0x6533('0x4b')]({'where':{'teamId':{'$in':_0x8dc49f}}});})[_0x6533('0x17')](function(_0x1d078f){var _0x5b5365=_['map'](_0x1d078f,function(_0x298bff){return db[_0x6533('0x11f')][_0x6533('0x2e')]({'where':{'UserId':_0x4ff083['id'],'VoicePrefixId':_0x298bff[_0x6533('0x120')]}},{'transaction':_0x46bb1d});});return Promise['all'](_0x5b5365);});});})[_0x6533('0x17')](function(){for(var _0x46820a=0x0;_0x46820a<_0x5ac142[_0x6533('0x4e')];_0x46820a++){var _0x28d950=_0x5ac142[_0x46820a][_0x6533('0x11e')](_0x6533('0xa2'));var _0x15bd0b=_0x28d950+'QueueId';socket['emit'](_0x6533('0x86')+_0x28d950+_0x6533('0xb5'),{'UserId':_0x745d50,['queueField']:_0x5ac142[_0x46820a]['id']});}})[_0x6533('0x17')](respondWithStatusCode(_0x307bbb,null))['catch'](APIHandleError(_0x307bbb));};exports[_0x6533('0x127')]=function(_0x2657c9,_0xb6c515){var _0x43776d={};var _0x39b69e={};var _0x19fcd7;var _0x2b4570;return db['User'][_0x6533('0x9c')]({'where':{'id':_0x2657c9[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0xb6c515,null))[_0x6533('0x17')](function(_0x102a24){if(_0x102a24){_0x19fcd7=_0x102a24;_0x39b69e['model']=_[_0x6533('0x59')](db[_0x6533('0xd6')]['rawAttributes']);_0x39b69e[_0x6533('0x46')]=_['keys'](_0x2657c9[_0x6533('0x46')]);_0x39b69e[_0x6533('0x5b')]=_[_0x6533('0x5c')](_0x39b69e['model'],_0x39b69e[_0x6533('0x46')]);_0x43776d['attributes']=_[_0x6533('0x5c')](_0x39b69e[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2657c9[_0x6533('0x46')][_0x6533('0x5e')]));_0x43776d[_0x6533('0x49')]=_0x43776d['attributes'][_0x6533('0x4e')]?_0x43776d[_0x6533('0x49')]:_0x39b69e[_0x6533('0x5d')];_0x43776d[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2657c9[_0x6533('0x46')][_0x6533('0xd2')]);_0x43776d[_0x6533('0x45')]=qs[_0x6533('0x5b')](_[_0x6533('0xd3')](_0x2657c9[_0x6533('0x46')],_0x39b69e['filters']));if(_0x2657c9[_0x6533('0x46')][_0x6533('0x34')]){_0x43776d[_0x6533('0x45')]=_[_0x6533('0x62')](_0x43776d[_0x6533('0x45')],{'$or':_['map'](_0x43776d[_0x6533('0x49')],function(_0x1db7b1){var _0x19e65b={};_0x19e65b[_0x1db7b1]={'$like':'%'+_0x2657c9[_0x6533('0x46')]['filter']+'%'};return _0x19e65b;})});}_0x43776d=_[_0x6533('0x62')]({},_0x43776d,_0x2657c9[_0x6533('0xd4')]);return _0x19fcd7[_0x6533('0x127')](_0x43776d);}})[_0x6533('0x17')](function(_0x4607b1){if(_0x4607b1){_0x2b4570=_0x4607b1['length'];if(!_0x2657c9[_0x6533('0x46')][_0x6533('0xd5')]('nolimit')){_0x43776d[_0x6533('0x27')]=qs[_0x6533('0x27')](_0x2657c9['query'][_0x6533('0x27')]);_0x43776d['offset']=qs[_0x6533('0x29')](_0x2657c9[_0x6533('0x46')][_0x6533('0x29')]);}return _0x19fcd7['getLists'](_0x43776d);}})[_0x6533('0x17')](function(_0x2563a4){if(_0x2563a4){return _0x2563a4?{'count':_0x2b4570,'rows':_0x2563a4}:null;}})[_0x6533('0x17')](respondWithResult(_0xb6c515,null))[_0x6533('0x22')](handleError(_0xb6c515,null));};exports['getAgents']=function(_0x2106c9,_0x3d62a0){var _0x33876c={};var _0x492831={};var _0x2fadf9;return db[_0x6533('0x40')][_0x6533('0x9c')]({'where':{'id':_0x2106c9[_0x6533('0x57')]['id']}})[_0x6533('0x17')](handleEntityNotFound(_0x3d62a0,null))[_0x6533('0x17')](function(_0x258c25){if(_0x258c25){_0x2fadf9=_0x258c25;_0x492831['model']=_[_0x6533('0x59')](db['User'][_0x6533('0x41')]);_0x492831[_0x6533('0x46')]=_[_0x6533('0x59')](_0x2106c9['query']);_0x492831[_0x6533('0x5b')]=_['intersection'](_0x492831['model'],_0x492831['query']);_0x33876c[_0x6533('0x49')]=_['intersection'](_0x492831[_0x6533('0x5d')],qs[_0x6533('0x5e')](_0x2106c9[_0x6533('0x46')][_0x6533('0x5e')]));_0x33876c[_0x6533('0x49')]=_0x33876c[_0x6533('0x49')]['length']?_0x33876c[_0x6533('0x49')]:_0x492831[_0x6533('0x5d')];_0x33876c[_0x6533('0xd1')]=qs[_0x6533('0xd2')](_0x2106c9[_0x6533('0x46')]['sort']);_0x33876c[_0x6533('0x45')]=qs[_0x6533('0x5b')](_['pick'](_0x2106c9['query'],_0x492831[_0x6533('0x5b')]));if(_0x2106c9[_0x6533('0x46')][_0x6533('0x34')]){_0x33876c['where']=_['merge'](_0x33876c[_0x6533('0x45')],{'$or':_[_0x6533('0x36')](_0x33876c[_0x6533('0x49')],function(_0x235868){var _0x1853bb={};_0x1853bb[_0x235868]={'$like':'%'+_0x2106c9[_0x6533('0x46')][_0x6533('0x34')]+'%'};return _0x1853bb;})});}_0x33876c[_0x6533('0x5d')]=db['User'];_0x33876c['as']=_0x6533('0x8d');_0x33876c=_['merge']({},_0x33876c,_0x2106c9[_0x6533('0xd4')]);return _0x2fadf9[_0x6533('0xfd')]({'include':[_0x33876c]});}})['then'](function(_0x2697a){if(_0x2697a){var _0x5ef4ee={},_0x4eb909=[];for(var _0x39c6a1=0x0;_0x39c6a1<_0x2697a['length'];_0x39c6a1+=0x1){for(var _0x2cd4e3=0x0,_0x5ad59f;_0x2cd4e3<_0x2697a[_0x39c6a1][_0x6533('0x8d')][_0x6533('0x4e')];_0x2cd4e3+=0x1){_0x5ad59f=_0x2697a[_0x39c6a1][_0x6533('0x8d')][_0x2cd4e3][_0x6533('0x2f')]({'plain':!![]});_0x5ef4ee[_0x5ad59f['id']]=_0x5ad59f;}}_0x5ef4ee=_['values'](_0x5ef4ee);for(var _0x52458d=qs[_0x6533('0x29')](_0x2106c9['query']['offset']);_0x52458d<_0x5ef4ee[_0x6533('0x4e')]&&_0x4eb909[_0x6533('0x4e')]=_0x55cde2){_0x220fd9=_0x55cde2;_0x1b6e2b=0xc8;}else{_0x1b6e2b=0xce;}_0x3c09c5[_0x9452('0x22')](_0x1b6e2b);return _0x3c09c5[_0x9452('0x27')](_0x9452('0x28'),_0x5d606b+'-'+_0x220fd9+'/'+_0x55cde2)[_0x9452('0x29')](_0x3d246c);}return null;};}function saveUpdates(_0x45ac67){return function(_0x4dd94a){if(_0x4dd94a){return _0x4dd94a[_0x9452('0x2a')](_0x45ac67)[_0x9452('0x17')](function(_0x289478){if(_0x289478[_0x9452('0x2b')]===_0x9452('0x2c')){socket['emit'](_0x9452('0x2d')+_0x289478['id'],_0x289478);}return _0x289478;});}return null;};}function removeEntity(_0xc294d7){return function(_0x4031d0){if(_0x4031d0){return _0x4031d0[_0x9452('0x2e')]()[_0x9452('0x17')](function(){var _0x1e358c=_0x4031d0[_0x9452('0x2f')]({'plain':!![]});if(_0x1e358c['role']==='admin')return;var _0x2bb569=[{'name':_0x9452('0x30'),'value':_0x9452('0x31'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x9452('0x32'),'value':'telephone','ignore':![]}];var _0x3c1a99=_(_0x2bb569)['filter'](_0x9452('0x33'))[_0x9452('0x34')]('value')['value']();if(_['includes'](_0x3c1a99,_0x1e358c[_0x9452('0x2b')])){return;}var _0x4ada88=_['find'](_0x2bb569,[_0x9452('0x35'),_0x1e358c['role']])[_0x9452('0x36')];return db[_0x9452('0x37')][_0x9452('0x2e')]({'where':{'type':_0x4ada88,'resourceId':_0x1e358c['id']}})[_0x9452('0x17')](function(){return _0x4031d0;});})[_0x9452('0x17')](function(){_0xc294d7[_0x9452('0x22')](0xcc)[_0x9452('0x23')]();});}};}function handleEntityNotFound(_0x17ca33){return function(_0x3d403f){if(!_0x3d403f){_0x17ca33[_0x9452('0x21')](0x194);}return _0x3d403f;};}function handleError(_0x3fdcdd,_0x1351d6){_0x1351d6=_0x1351d6||0x1f4;return function(_0x1cbd84){logger['error'](_0x1cbd84[_0x9452('0x38')]);if(_0x1cbd84[_0x9452('0x36')]){delete _0x1cbd84[_0x9452('0x36')];}_0x3fdcdd[_0x9452('0x22')](_0x1351d6)[_0x9452('0x39')](_0x1cbd84);};}exports[_0x9452('0x3a')]=function(_0x46f96c,_0x50b050){var _0x1d480d={},_0x5d306f={'count':0x0,'rows':[]};var _0x1d7767=_(db[_0x9452('0x3b')][_0x9452('0x3c')])[_0x9452('0x34')](function(_0x33ec0a){return{'name':_0x33ec0a[_0x9452('0x3d')],'type':_0x33ec0a[_0x9452('0x3e')]['key']};})[_0x9452('0x3f')](function(_0x363aeb){return!_[_0x9452('0x40')]([_0x9452('0x41'),_0x9452('0x42')],_0x363aeb['name']);})['value']();_0x1d480d=qs[_0x9452('0x43')](_0x1d7767,_0x46f96c);var _0x35b6dc={'where':_0x1d480d[_0x9452('0x44')]};return db[_0x9452('0x3b')][_0x9452('0x26')](_0x35b6dc)[_0x9452('0x17')](function(_0x320c08){_0x5d306f[_0x9452('0x26')]=_0x320c08;if(_0x46f96c[_0x9452('0x45')][_0x9452('0x46')]){_0x1d480d[_0x9452('0x47')]=[{'all':!![]}];}if(_0x46f96c['query']['userSetting']===_0x9452('0x48')){_0x1d480d[_0x9452('0x47')]=[{'model':db[_0x9452('0x49')],'as':_0x9452('0x4a')}];}if(!_[_0x9452('0x40')](_0x1d480d[_0x9452('0x4b')],'id')){_0x1d480d['attributes']['push']('id');}return db['User']['findAll'](_0x1d480d);})[_0x9452('0x17')](function(_0x1b4a2d){_0x5d306f[_0x9452('0x4c')]=_0x1b4a2d;if(_0x46f96c['query'][_0x9452('0x4d')]===_0x9452('0x48')){var _0x5b0e38=[];for(var _0x41d876=0x0;_0x41d876<_0x5d306f[_0x9452('0x4c')][_0x9452('0x4e')];_0x41d876++){_0x5b0e38[_0x9452('0x4f')](get_open_tabs(_0x9452('0x50'),_0x5d306f['rows'][_0x41d876][_0x9452('0x51')]));_0x5b0e38['push'](get_open_tabs(_0x9452('0x52'),_0x5d306f[_0x9452('0x4c')][_0x41d876]['dataValues']));_0x5b0e38[_0x9452('0x4f')](get_open_tabs(_0x9452('0x53'),_0x5d306f['rows'][_0x41d876][_0x9452('0x51')]));_0x5b0e38[_0x9452('0x4f')](get_open_tabs('mail',_0x5d306f[_0x9452('0x4c')][_0x41d876]['dataValues']));_0x5b0e38['push'](get_open_tabs(_0x9452('0x54'),_0x5d306f['rows'][_0x41d876]['dataValues']));_0x5b0e38[_0x9452('0x4f')](get_open_tabs(_0x9452('0x55'),_0x5d306f['rows'][_0x41d876][_0x9452('0x51')]));}return Promise[_0x9452('0x56')](_0x5b0e38)[_0x9452('0x17')](function(){return _0x5d306f;});}else{return _0x5d306f;}})['then'](respondWithFilteredResult(_0x50b050,_0x1d480d))[_0x9452('0x57')](handleError(_0x50b050,null));};exports[_0x9452('0x58')]=function(_0x315787,_0x81c883){var _0x4d33f2={'raw':![],'where':{'id':_0x315787[_0x9452('0x59')]['id']}},_0x4fdeac={};_0x4fdeac[_0x9452('0x5a')]=_[_0x9452('0x5b')](_[_0x9452('0x5c')](db[_0x9452('0x3b')][_0x9452('0x3c')]),[_0x9452('0x41'),'salt']);_0x4fdeac['query']=_['keys'](_0x315787[_0x9452('0x45')]);_0x4fdeac[_0x9452('0x5d')]=_[_0x9452('0x5e')](_0x4fdeac[_0x9452('0x5a')],_0x4fdeac[_0x9452('0x45')]);_0x4d33f2[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x4fdeac[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x315787[_0x9452('0x45')]['fields']));_0x4d33f2[_0x9452('0x4b')]=_0x4d33f2[_0x9452('0x4b')]['length']?_0x4d33f2[_0x9452('0x4b')]:_0x4fdeac[_0x9452('0x5a')];if(_0x315787['query']['includeAll']){_0x4d33f2[_0x9452('0x47')]=[{'all':!![]}];}if(_0x315787['query'][_0x9452('0x4a')]===_0x9452('0x48')){_0x4d33f2[_0x9452('0x47')]=[{'model':db[_0x9452('0x49')],'as':'userSetting'}];}_0x4d33f2=_['merge']({},_0x4d33f2,_0x315787[_0x9452('0x60')]);if(!_['includes'](_0x4d33f2[_0x9452('0x4b')],'id')){_0x4d33f2[_0x9452('0x4b')][_0x9452('0x4f')]('id');}return db[_0x9452('0x3b')][_0x9452('0x61')](_0x4d33f2)[_0x9452('0x17')](handleEntityNotFound(_0x81c883,null))[_0x9452('0x17')](function(_0x2bb2bc){var _0x1540d0=[];values=_0x2bb2bc;if(_0x315787[_0x9452('0x45')]['openTabs']==='true'){_0x1540d0[_0x9452('0x4f')](get_open_tabs(_0x9452('0x50'),_0x2bb2bc['dataValues']));_0x1540d0[_0x9452('0x4f')](get_open_tabs('sms',_0x2bb2bc[_0x9452('0x51')]));_0x1540d0[_0x9452('0x4f')](get_open_tabs(_0x9452('0x54'),_0x2bb2bc[_0x9452('0x51')]));_0x1540d0[_0x9452('0x4f')](get_open_tabs('whatsapp',_0x2bb2bc[_0x9452('0x51')]));_0x1540d0[_0x9452('0x4f')](get_open_tabs(_0x9452('0x53'),_0x2bb2bc[_0x9452('0x51')]));_0x1540d0['push'](get_open_tabs('mail',_0x2bb2bc[_0x9452('0x51')]));return Promise['all'](_0x1540d0);}else{return values;}})[_0x9452('0x17')](function(){return values;})[_0x9452('0x17')](respondWithResult(_0x81c883,null))['catch'](handleError(_0x81c883,null));};exports[_0x9452('0x2a')]=function(_0x17d9fd,_0x41d815){if(_0x17d9fd[_0x9452('0x62')]['id']){delete _0x17d9fd[_0x9452('0x62')]['id'];}delete _0x17d9fd[_0x9452('0x62')][_0x9452('0x2b')];return db[_0x9452('0x3b')]['find']({'where':{'id':_0x17d9fd['params']['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x41d815,null))[_0x9452('0x17')](saveUpdates(_0x17d9fd[_0x9452('0x62')],null))[_0x9452('0x17')](respondWithResult(_0x41d815,null))[_0x9452('0x57')](handleError(_0x41d815,null));};exports[_0x9452('0x63')]=function(_0x39d4be,_0x4dc0c8){return db[_0x9452('0x3b')][_0x9452('0x63')]()[_0x9452('0x17')](respondWithResult(_0x4dc0c8,null))[_0x9452('0x57')](handleError(_0x4dc0c8,null));};exports[_0x9452('0x64')]=function(_0xe1db4f,_0x1cc95b){return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0xe1db4f[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x1cc95b,null))[_0x9452('0x17')](function(_0x548d70){if(_0x548d70){return _0x548d70[_0x9452('0x64')](_0xe1db4f[_0x9452('0x62')]['ids'],_[_0x9452('0x65')](_0xe1db4f[_0x9452('0x62')],[_0x9452('0x66'),'id'])||{});}})['then'](respondWithResult(_0x1cc95b,null))['catch'](handleError(_0x1cc95b,null));};function validateUser(_0x6cefdd){return new Promise(function(_0x7d564b,_0x2f98cd){if(_0x6cefdd[_0x9452('0x67')])return _0x7d564b(_0x6cefdd);return db[_0x9452('0x68')]['findById'](0x1)[_0x9452('0x17')](function(_0x360192){if(_0x360192[_0x9452('0x69')])authService['validatePasswordPattern'](_0x6cefdd['password']);db[_0x9452('0x3b')][_0x9452('0x6a')](_0x9452('0x67'))[_0x9452('0x17')](function(_0x1dfc04){if(_['isNil'](_0x1dfc04)){_0x6cefdd[_0x9452('0x67')]=_0x360192[_0x9452('0x6b')]||0x1;return;}if(_['isNil'](_0x360192[_0x9452('0x6b')])||_0x360192['min_internal']===_0x1dfc04){_0x6cefdd[_0x9452('0x67')]=_0x1dfc04+0x1;return;}if(_0x360192[_0x9452('0x6b')]>_0x1dfc04){_0x6cefdd[_0x9452('0x67')]=_0x360192[_0x9452('0x6b')];return;}return db[_0x9452('0x6c')]['query']('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)',{'type':db[_0x9452('0x6c')][_0x9452('0x6d')][_0x9452('0x6e')]})[_0x9452('0x17')](function(_0x217d63){if(_0x217d63&&_0x217d63['length']){for(var _0x469be4=0x0,_0x47ec7f=_0x217d63[_0x9452('0x4e')];_0x469be4<_0x47ec7f&&_[_0x9452('0x6f')](_0x6cefdd['internal']);_0x469be4++){if(_0x360192[_0x9452('0x6b')]<=_0x217d63[_0x469be4][_0x9452('0x70')]){_0x6cefdd[_0x9452('0x67')]=_0x217d63[_0x469be4][_0x9452('0x70')];}else if(_0x360192[_0x9452('0x6b')]>_0x217d63[_0x469be4][_0x9452('0x70')]&&_0x360192['min_internal']<=_0x217d63[_0x469be4]['to']){_0x6cefdd['internal']=_0x360192[_0x9452('0x6b')];}}}if(_[_0x9452('0x6f')](_0x6cefdd[_0x9452('0x67')])){_0x6cefdd[_0x9452('0x67')]=_0x1dfc04+0x1;}return _0x7d564b(_0x6cefdd);});});})[_0x9452('0x57')](function(_0x42894e){_0x2f98cd(_0x42894e);});});}function updateUser(_0x548ce8){return new Promise(function(_0x995920,_0xe6e41e){try{if(_0x548ce8['voicemail']){_0x548ce8['mailbox']=_0x548ce8['internal'];_0x548ce8[_0x9452('0x71')]={'mailbox':_0x548ce8[_0x9452('0x67')],'password':_0x548ce8[_0x9452('0x41')],'fullname':_0x548ce8[_0x9452('0x72')],'email':_0x548ce8['email']};}if(_0x548ce8[_0x9452('0x2b')]===_0x9452('0x2c')){if(!_0x548ce8['permissions'])_0x548ce8[_0x9452('0x73')]=[_0x9452('0x74'),'102',_0x9452('0x75'),_0x9452('0x76'),_0x9452('0x77'),_0x9452('0x78'),_0x9452('0x79'),'106',_0x9452('0x7a'),_0x9452('0x7b'),_0x9452('0x7c'),_0x9452('0x7d'),_0x9452('0x7e'),_0x9452('0x7f'),_0x9452('0x80')];}_0x995920(_0x548ce8);}catch(_0x414b14){_0xe6e41e(_0x414b14);}});}exports[_0x9452('0x81')]=function(_0x3138ae,_0x197367){if(_0x3138ae['user']['role']===_0x9452('0x2c'))throw new Error(_0x9452('0x82'));if(_0x3138ae[_0x9452('0x62')][_0x9452('0x2b')]===_0x9452('0x31')&&_0x3138ae[_0x9452('0x31')][_0x9452('0x2b')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3138ae['body'][_0x9452('0x2b')]===_0x9452('0x83')&&_0x3138ae[_0x9452('0x31')][_0x9452('0x2b')]!=='admin'){throw new Error(_0x9452('0x84'));}return licenseUtil[_0x9452('0x85')]([_0x3138ae[_0x9452('0x62')]])[_0x9452('0x17')](function(){return validateUser(_0x3138ae[_0x9452('0x62')]);})['then'](function(_0x5987dd){return updateUser(_0x5987dd)[_0x9452('0x17')](function(_0x26527a){if(_0x26527a[_0x9452('0x2b')]===_0x9452('0x83')){_0x26527a[_0x9452('0x86')]=_0x3138ae['user'][_0x9452('0x86')];delete _0x26527a[_0x9452('0x87')];}return _0x26527a;});})[_0x9452('0x17')](function(_0x1849ee){return db['User']['create'](_0x1849ee,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x25313d){if(_0x3138ae[_0x9452('0x62')]['role']==='user')return _0x25313d;if(_0x3138ae[_0x9452('0x31')][_0x9452('0x2b')]!==_0x9452('0x31'))return _0x25313d;return db[_0x9452('0x88')][_0x9452('0x61')]({'where':{'name':_0x25313d[_0x9452('0x2b')]==='agent'?_0x9452('0x89'):'Telephones','userProfileId':_0x3138ae[_0x9452('0x31')][_0x9452('0x87')]},'raw':!![]})[_0x9452('0x17')](function(_0x3517bd){if(!_0x3517bd||_0x3517bd[_0x9452('0x8a')]!=0x0)return _0x25313d;return db['UserProfileResource'][_0x9452('0x81')]({'name':_0x25313d[_0x9452('0x36')],'resourceId':_0x25313d['id'],'type':_0x3517bd[_0x9452('0x36')],'sectionId':_0x3517bd['id']},{})[_0x9452('0x17')](function(){return _0x25313d;});})[_0x9452('0x57')](function(_0x5b1d8){logger[_0x9452('0x1d')](_0x9452('0x8b'),_0x5b1d8);throw _0x5b1d8;});})['then'](respondWithResult(_0x197367,0xc9))['catch'](handleError(_0x197367,null));};exports[_0x9452('0x8c')]=function(_0x4ebbce,_0x525359){var _0x1b844a=_0x4ebbce[_0x9452('0x62')];var _0x19f81e=[];if(_0x4ebbce[_0x9452('0x31')]['role']===_0x9452('0x2c'))throw new Error(_0x9452('0x82'));if(_[_0x9452('0x8d')](_0x1b844a,['role',_0x9452('0x31')])&&_0x4ebbce[_0x9452('0x31')][_0x9452('0x2b')]!==_0x9452('0x83')){throw new Error(_0x9452('0x8e'));}if(_[_0x9452('0x8d')](_0x1b844a,[_0x9452('0x2b'),'admin'])&&_0x4ebbce[_0x9452('0x31')][_0x9452('0x2b')]!==_0x9452('0x83')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x1b844a)[_0x9452('0x17')](function(){return validateUser(_0x1b844a[0x0]);})['then'](function(){for(var _0x30f830=0x1;_0x30f830<_0x1b844a['length'];_0x30f830++){var _0x4f772e=_0x1b844a[_0x30f830-0x1][_0x9452('0x67')];if(!_0x1b844a[_0x30f830][_0x9452('0x67')])_0x1b844a[_0x30f830]['internal']=_0x4f772e+0x1;_0x19f81e[_0x9452('0x4f')](validateUser(_0x1b844a[_0x30f830]));}return Promise[_0x9452('0x56')](_0x19f81e);})[_0x9452('0x17')](function(){_0x19f81e=[];for(var _0x2736ef=0x0;_0x2736ef<_0x1b844a['length'];_0x2736ef++){_0x19f81e[_0x9452('0x4f')](updateUser(_0x1b844a[_0x2736ef]));}return Promise[_0x9452('0x56')](_0x19f81e);})['then'](function(){_0x19f81e=_0x1b844a['map'](function(_0x3b3f89){return db[_0x9452('0x3b')][_0x9452('0x81')](_0x3b3f89,{'include':[{'model':db[_0x9452('0x71')],'as':_0x9452('0x71')}]})[_0x9452('0x17')](function(_0x35edbc){_0x3b3f89['id']=_0x35edbc['id'];return _0x3b3f89;});});return Promise[_0x9452('0x56')](_0x19f81e);})[_0x9452('0x17')](function(_0x36d6c4){if(_0x4ebbce[_0x9452('0x62')]['role']===_0x9452('0x31'))return _0x36d6c4;if(_0x4ebbce[_0x9452('0x31')][_0x9452('0x2b')]!==_0x9452('0x31'))return _0x36d6c4;var _0x2e2297=_[_0x9452('0x8d')](_0x36d6c4,function(_0x1cb4d9){return _0x1cb4d9['role']===_0x9452('0x2c')||_0x1cb4d9[_0x9452('0x2b')]===_0x9452('0x8f');});if(!_0x2e2297)return _0x36d6c4;return db[_0x9452('0x88')][_0x9452('0x90')]({'where':{'name':{'$or':[_0x9452('0x89'),_0x9452('0x32')]},'userProfileId':_0x4ebbce['user'][_0x9452('0x87')]},'raw':!![]})[_0x9452('0x17')](function(_0x357251){if(_[_0x9452('0x91')](_0x357251)||!_[_0x9452('0x8d')](_0x357251,[_0x9452('0x8a'),0x0]))return _0x36d6c4;_0x19f81e=[];var _0x3ce106=_(_0x357251)[_0x9452('0x34')](function(_0xb51bf3){if(_0xb51bf3[_0x9452('0x8a')]===0x1)return;return _0xb51bf3[_0x9452('0x36')]===_0x9452('0x89')?_0x9452('0x2c'):_0x9452('0x8f');})[_0x9452('0x92')]()[_0x9452('0x35')]();for(var _0x55c2ac=0x0;_0x55c2ac<_0x36d6c4[_0x9452('0x4e')];_0x55c2ac++){if(!_[_0x9452('0x40')](_0x3ce106,_0x36d6c4[_0x55c2ac][_0x9452('0x2b')]))return;var _0x5f1be7=_0x36d6c4[_0x55c2ac]['role']===_0x9452('0x2c')?_0x9452('0x89'):_0x9452('0x32');_0x19f81e['push'](db[_0x9452('0x37')][_0x9452('0x81')]({'name':_0x36d6c4[_0x55c2ac][_0x9452('0x36')],'resourceId':_0x36d6c4[_0x55c2ac]['id'],'type':_0x5f1be7,'sectionId':_[_0x9452('0x61')](_0x357251,[_0x9452('0x36'),_0x5f1be7])['id']},{}));}return Promise[_0x9452('0x56')](_0x19f81e);});})[_0x9452('0x17')](respondWithResult(_0x525359,0xc9))[_0x9452('0x57')](handleError(_0x525359,null));};exports[_0x9452('0x93')]=function(_0x30f54f,_0x54acbd){if(_0x30f54f[_0x9452('0x62')]['id']){delete _0x30f54f[_0x9452('0x62')]['id'];}return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x30f54f[_0x9452('0x59')]['id']}})[_0x9452('0x17')](function(_0x442916){if(!_0x442916)return null;if(_0x442916['id']===_0x30f54f['user']['id']){if(!_0x30f54f[_0x9452('0x62')][_0x9452('0x94')]||!_0x30f54f[_0x9452('0x62')][_0x9452('0x95')]){throw new db[(_0x9452('0x96'))][(_0x9452('0x97'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x442916[_0x9452('0x98')](_0x30f54f[_0x9452('0x62')][_0x9452('0x94')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x30f54f[_0x9452('0x62')]['oldPassword']===_0x30f54f[_0x9452('0x62')][_0x9452('0x95')]){throw new db['Sequelize'][(_0x9452('0x97'))](_0x9452('0x99'));}}else if(_0x30f54f[_0x9452('0x31')]['role']===_0x9452('0x83')){if(!_0x30f54f[_0x9452('0x62')][_0x9452('0x95')]){throw new db['Sequelize'][(_0x9452('0x97'))](_0x9452('0x9a'));}}else if(_0x30f54f[_0x9452('0x31')][_0x9452('0x2b')]==='user'){if(!_0x30f54f[_0x9452('0x62')][_0x9452('0x95')]){throw new db['Sequelize'][(_0x9452('0x97'))](_0x9452('0x9a'));}if(_0x442916[_0x9452('0x2b')]!==_0x9452('0x2c')){throw new db[(_0x9452('0x96'))][(_0x9452('0x97'))](_0x9452('0x82'));}}else{throw new db[(_0x9452('0x96'))][(_0x9452('0x97'))](_0x9452('0x82'));}return _0x442916;})[_0x9452('0x17')](handleEntityNotFound(_0x54acbd,null))[_0x9452('0x17')](function(_0xd69e4c){return db[_0x9452('0x68')][_0x9452('0x9b')]({'attributes':['id',_0x9452('0x69'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x801463){if(_0x801463[_0x9452('0x69')])authService[_0x9452('0x9c')](_0x30f54f[_0x9452('0x62')][_0x9452('0x95')]);if(!_0x801463[_0x9452('0x9d')]||!_0xd69e4c[_0x9452('0x9e')])return _0xd69e4c;authService[_0x9452('0x9f')](_0x30f54f[_0x9452('0x62')][_0x9452('0x95')],_0xd69e4c[_0x9452('0x9e')],_0x801463[_0x9452('0xa0')]);return _0xd69e4c;})[_0x9452('0x17')](saveUpdates({'password':_0x30f54f[_0x9452('0x62')][_0x9452('0x95')],'passwordResetAt':_0x30f54f['user']['id']==_0x30f54f[_0x9452('0x59')]['id']?moment():null,'previousPasswords':authService[_0x9452('0xa1')](_0x30f54f[_0x9452('0x62')][_0x9452('0x95')],_0xd69e4c[_0x9452('0x9e')])},null));})[_0x9452('0x17')](respondWithResult(_0x54acbd,null))[_0x9452('0x57')](handleError(_0x54acbd,null));};exports[_0x9452('0xa2')]=function(_0x175cbf,_0x55b2e6){var _0x5ac3e0=_0x175cbf[_0x9452('0x62')]['channel'];return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x175cbf[_0x9452('0x59')]['id']},'attributes':['id',_0x9452('0x36'),_0x9452('0x2b'),_0x9452('0xa3'),'loginInPause','voicePause',_0x9452('0xa4')]})['then'](handleEntityNotFound(_0x55b2e6,null))[_0x9452('0x17')](function(_0x5ab380){if(_0x5ab380){if(!utils['isValidChannel'](_0x5ac3e0)){throw new db['Sequelize'][(_0x9452('0x97'))]('Unknown\x20channel');}return _0x5ab380['add'+_['capitalize'](_0x5ac3e0[_0x9452('0xa5')]())+_0x9452('0xa6')](_0x175cbf[_0x9452('0x62')][_0x9452('0x66')],{'penalty':_0x175cbf[_0x9452('0x62')][_0x9452('0xa7')]||0x0})[_0x9452('0xa8')](function(_0x5e68c6){for(var _0x249385=0x0;_0x249385<_0x175cbf[_0x9452('0x62')][_0x9452('0x66')]['length'];_0x249385+=0x1){var _0xc11313={'UserId':Number(_0x175cbf['params']['id'])};_0xc11313[_[_0x9452('0xa9')](_0x5ac3e0['toLowerCase']())+_0x9452('0xaa')]=Number(_0x175cbf[_0x9452('0x62')][_0x9452('0x66')][_0x249385]);socket[_0x9452('0xab')]('user'+_[_0x9452('0xa9')](_0x5ac3e0[_0x9452('0xa5')]())+_0x9452('0xac'),_0xc11313);}return _0x5e68c6;})[_0x9452('0x17')](function(){if(_0x5ac3e0==='voice'){return db[_0x9452('0xad')][_0x9452('0x90')]({'where':{'id':_0x175cbf['body'][_0x9452('0x66')]||[]},'raw':!![],'attributes':['id',_0x9452('0x36')]});}})[_0x9452('0x17')](function(_0x2f0b3c){var _0x5ddec2=_0x5ab380[_0x9452('0x2f')]({'plain':!![]});var _0x4e6a6e=[];if(_0x5ac3e0===_0x9452('0xae')&&_0x5ddec2[_0x9452('0x2b')]===_0x9452('0x2c')&&_0x5ddec2[_0x9452('0xa3')]){for(let _0x5b3722=0x0;_0x5b3722<_0x2f0b3c[_0x9452('0x4e')];_0x5b3722+=0x1){_0x4e6a6e['push']({'membername':_0x5ddec2[_0x9452('0x36')],'UserId':_0x5ddec2['id'],'queue_name':_0x2f0b3c[_0x5b3722][_0x9452('0x36')],'VoiceQueueId':_0x2f0b3c[_0x5b3722]['id'],'interface':_[_0x9452('0x6f')](_0x5ddec2[_0x9452('0xa4')])?util['format'](_0x9452('0xaf'),_0x5ddec2[_0x9452('0x36')]):_0x5ddec2[_0x9452('0xa4')],'paused':_0x5ddec2[_0x9452('0xb0')]||![],'penalty':_0x175cbf[_0x9452('0x62')]['penalty']||0x0});}return Promise[_0x9452('0x56')](_0x4e6a6e[_0x9452('0x34')](function(_0x386a9d){return db['UserVoiceQueueRt']['upsert'](_0x386a9d);}));}return _0x5ab380;});}})[_0x9452('0x17')](respondWithStatusCode(_0x55b2e6,null))[_0x9452('0x57')](handleError(_0x55b2e6,null));};exports[_0x9452('0xb1')]=function(_0x211c7c,_0x303418){var _0x3018f2,_0x4df656;return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x211c7c[_0x9452('0x59')]['id']},'attributes':['id',_0x9452('0x36'),_0x9452('0x2b')]})[_0x9452('0x17')](handleEntityNotFound(_0x303418,null))[_0x9452('0x17')](function(_0x45ed7b){if(_0x45ed7b){_0x3018f2=_0x45ed7b;if(!_0x211c7c[_0x9452('0x45')][_0x9452('0xb2')]||!utils['isValidChannel'](_0x211c7c[_0x9452('0x45')]['channel'])){throw new db['Sequelize'][(_0x9452('0x97'))](_0x9452('0xb3'));}return _0x45ed7b[_0x9452('0xb4')+_['capitalize'](_0x211c7c[_0x9452('0x45')][_0x9452('0xb2')][_0x9452('0xa5')]())+_0x9452('0xa6')](_0x211c7c[_0x9452('0x45')][_0x9452('0x66')]);}})['then'](function(_0x2b130b){if(_[_0x9452('0xb5')](_0x211c7c[_0x9452('0x45')][_0x9452('0x66')])){for(var _0x443570=0x0;_0x443570<_0x211c7c[_0x9452('0x45')][_0x9452('0x66')][_0x9452('0x4e')];_0x443570+=0x1){_0x4df656={'UserId':Number(_0x211c7c['params']['id'])};_0x4df656[_[_0x9452('0xa9')](_0x211c7c[_0x9452('0x45')]['channel'][_0x9452('0xa5')]())+'QueueId']=Number(_0x211c7c[_0x9452('0x45')][_0x9452('0x66')][_0x443570]);socket[_0x9452('0xab')](_0x9452('0x31')+_[_0x9452('0xa9')](_0x211c7c['query']['channel'][_0x9452('0xa5')]())+_0x9452('0xb6'),_0x4df656);}}else{_0x4df656={'UserId':Number(_0x211c7c['params']['id'])};_0x4df656[_[_0x9452('0xa9')](_0x211c7c[_0x9452('0x45')]['channel'][_0x9452('0xa5')]())+'QueueId']=Number(_0x211c7c[_0x9452('0x45')]['ids']);socket['emit']('user'+_['capitalize'](_0x211c7c[_0x9452('0x45')][_0x9452('0xb2')][_0x9452('0xa5')]())+_0x9452('0xb6'),_0x4df656);}return _0x2b130b;})[_0x9452('0x17')](function(){if(_0x211c7c[_0x9452('0x45')][_0x9452('0xb2')]===_0x9452('0xae')){return db[_0x9452('0xb7')][_0x9452('0x2e')]({'where':{'UserId':_0x211c7c[_0x9452('0x59')]['id'],'VoiceQueueId':_0x211c7c['query'][_0x9452('0x66')]},'individualHooks':!![]})[_0x9452('0x17')](function(){return _0x3018f2;});}return _0x3018f2;})[_0x9452('0x17')](respondWithStatusCode(_0x303418,null))[_0x9452('0x57')](handleError(_0x303418,null));};exports['addAvatar']=function(_0x266c6f,_0x279124){_0x266c6f[_0x9452('0x62')]['userpic']=_0x266c6f[_0x9452('0xb8')][_0x9452('0xb9')];return db['User'][_0x9452('0x61')]({'where':{'id':_0x266c6f[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x279124,null))[_0x9452('0x17')](saveUpdates(_0x266c6f[_0x9452('0x62')],null))[_0x9452('0x17')](respondWithResult(_0x279124,null))[_0x9452('0x57')](handleError(_0x279124,null));};exports[_0x9452('0xba')]=function(_0x108099,_0x34c8fc){var _0x4711d5=path[_0x9452('0xbb')](config[_0x9452('0xbc')],_0x9452('0xbd'));return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x108099[_0x9452('0x59')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x9452('0x17')](handleEntityNotFound(_0x34c8fc,null))[_0x9452('0x17')](function(_0x5e8605){if(_0x5e8605){if(_[_0x9452('0x6f')](_0x5e8605[_0x9452('0xbe')])){return _0x34c8fc[_0x9452('0xbf')](_0x4711d5);}else{if(!fs[_0x9452('0xc0')](path['join'](config[_0x9452('0xbc')],'server/files/images/',_0x5e8605[_0x9452('0xbe')]))){return _0x34c8fc[_0x9452('0xbf')](_0x4711d5);}return _0x34c8fc['download'](path[_0x9452('0xbb')](config[_0x9452('0xbc')],_0x9452('0xc1'),_0x5e8605[_0x9452('0xbe')]));}}})[_0x9452('0x57')](handleError(_0x34c8fc,null));};exports[_0x9452('0xc2')]=function(_0x4309e4,_0x2ae969){return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x4309e4[_0x9452('0x59')]['id']},'attributes':['id']})[_0x9452('0x17')](handleEntityNotFound(_0x2ae969,null))[_0x9452('0x17')](function(_0x637683){var _0x286694=[];values=_0x637683[_0x9452('0x51')];_0x286694[_0x9452('0x4f')](get_open_tabs(_0x9452('0x50'),_0x637683[_0x9452('0x51')]));_0x286694[_0x9452('0x4f')](get_open_tabs(_0x9452('0x52'),_0x637683[_0x9452('0x51')]));_0x286694[_0x9452('0x4f')](get_open_tabs('openchannel',_0x637683[_0x9452('0x51')]));_0x286694[_0x9452('0x4f')](get_open_tabs(_0x9452('0x55'),_0x637683[_0x9452('0x51')]));_0x286694[_0x9452('0x4f')](get_open_tabs(_0x9452('0x53'),_0x637683[_0x9452('0x51')]));_0x286694[_0x9452('0x4f')](get_open_tabs('mail',_0x637683[_0x9452('0x51')]));return Promise['all'](_0x286694);})[_0x9452('0x17')](function(_0x43239f){if(_0x43239f){var _0x42dad4=_['map'](values[_0x9452('0xc3')],function(_0xd1e7d2){return{'channel':_0x9452('0xc4'),'id':_0xd1e7d2['id'],'createdAt':_0xd1e7d2['createdAt']};});var _0x520e40=_[_0x9452('0x34')](values[_0x9452('0xc5')],function(_0x527bd4){return{'channel':_0x9452('0xc6'),'id':_0x527bd4['id'],'createdAt':_0x527bd4['createdAt']};});var _0x445fa5=_['map'](values[_0x9452('0xc7')],function(_0x33e7a2){return{'channel':_0x9452('0xc8'),'id':_0x33e7a2['id'],'createdAt':_0x33e7a2['createdAt']};});var _0x200878=_[_0x9452('0x34')](values[_0x9452('0xc9')],function(_0x25ca29){return{'channel':_0x9452('0xca'),'id':_0x25ca29['id'],'createdAt':_0x25ca29[_0x9452('0xcb')]};});var _0x201d53=_['map'](values[_0x9452('0xcc')],function(_0x126844){return{'channel':_0x9452('0xcd'),'id':_0x126844['id'],'createdAt':_0x126844[_0x9452('0xcb')]};});var _0x2b4c02=_[_0x9452('0x34')](values['WhatsappOpenTabs'],function(_0x225869){return{'channel':_0x9452('0xce'),'id':_0x225869['id'],'createdAt':_0x225869[_0x9452('0xcb')]};});var _0x3a3ae3=_[_0x9452('0xcf')](_0x42dad4,_0x520e40,_0x445fa5,_0x200878,_0x201d53,_0x2b4c02);var _0x180152={'count':_0x3a3ae3[_0x9452('0x4e')],'rows':_0x3a3ae3};return _0x180152;}else return null;})[_0x9452('0x17')](respondWithResult(_0x2ae969,null))[_0x9452('0x57')](handleError(_0x2ae969,null));};exports['getContacts']=function(_0x1041d6,_0x57d718){var _0x4fd98e={};return db[_0x9452('0x3b')]['findOne']({'where':{'id':_0x1041d6[_0x9452('0x59')]['id']}})[_0x9452('0x17')](function(_0x31d979){if(!_0x31d979){throw new APINotFoundError(util[_0x9452('0xd0')](_0x9452('0xd1'),_0x1041d6['params']['id']));}return contacts[_0x9452('0x63')]();})[_0x9452('0x17')](function(_0x337ec4){_0x1041d6[_0x9452('0x45')][_0x9452('0x3b')]=_0x1041d6[_0x9452('0x59')]['id'];_0x4fd98e=qs['getOptions'](_0x337ec4,_0x1041d6);if(_0x1041d6[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0x46'))){_0x4fd98e[_0x9452('0x47')]=[{'model':db[_0x9452('0xd3')],'as':_0x9452('0xd4'),'required':![]},{'model':db['Tag'],'as':_0x9452('0xd5'),'attributes':['id','name',_0x9452('0xd6')],'where':_0x1041d6[_0x9452('0x45')][_0x9452('0xd7')]?{'id':_0x1041d6[_0x9452('0x45')][_0x9452('0xd7')]}:undefined,'required':_0x1041d6['query']['tag']?!![]:![]}];}return contacts[_0x9452('0x90')](_0x1041d6[_0x9452('0x45')],_0x1041d6['user'],_0x4fd98e,_0x337ec4);})[_0x9452('0x17')](respondWithFilteredResult(_0x57d718,_0x4fd98e))[_0x9452('0x57')](APIHandleError(_0x57d718));};exports[_0x9452('0xd8')]=function(_0x5a4628,_0x9de405){var _0x439e68;var _0x1a8371={};var _0x539227;return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x5a4628['params']['id']},'attributes':['id',_0x9452('0x36'),_0x9452('0x2b')]})[_0x9452('0x17')](handleEntityNotFound(_0x9de405,null))[_0x9452('0x17')](function(_0x1e995a){if(!utils[_0x9452('0xd9')](_0x5a4628[_0x9452('0x45')][_0x9452('0xb2')])){throw new db[(_0x9452('0x96'))][(_0x9452('0x97'))]('Unknown\x20channel');}_0x439e68=_0x1e995a;var _0x5a4529={};_0x5a4529[_0x9452('0x5a')]=_[_0x9452('0x5c')](db[_[_0x9452('0xa9')](_0x5a4628[_0x9452('0x45')][_0x9452('0xb2')])+_0x9452('0xda')][_0x9452('0x3c')]);_0x5a4529[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x5a4628[_0x9452('0x45')]);_0x5a4529['filters']=_[_0x9452('0x5e')](_0x5a4529[_0x9452('0x5a')],_0x5a4529['query']);_0x1a8371[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x5a4529['model'],qs[_0x9452('0x5f')](_0x5a4628[_0x9452('0x45')][_0x9452('0x5f')]));_0x1a8371[_0x9452('0x4b')]=_0x1a8371[_0x9452('0x4b')][_0x9452('0x4e')]?_0x1a8371[_0x9452('0x4b')]:_0x5a4529[_0x9452('0x5a')];_0x1a8371[_0x9452('0xdb')]=qs['sort'](_0x5a4628['query'][_0x9452('0xdc')]);_0x1a8371['where']=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x5a4628[_0x9452('0x45')],_0x5a4529[_0x9452('0x5d')]));if(_0x5a4628['query'][_0x9452('0x3f')]){_0x1a8371['where']=_[_0x9452('0xde')](_0x1a8371[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x1a8371['attributes'],function(_0x2c81c0){var _0x254425={};_0x254425[_0x2c81c0]={'$like':'%'+_0x5a4628['query'][_0x9452('0x3f')]+'%'};return _0x254425;})});}_0x1a8371=_['merge']({},_0x1a8371,_0x5a4628[_0x9452('0x60')]);switch(_0x439e68[_0x9452('0x2b')]){case'admin':return db[_[_0x9452('0xa9')](_0x5a4628['query'][_0x9452('0xb2')])+'Queue'][_0x9452('0x90')](_0x1a8371);case _0x9452('0x31'):case _0x9452('0x2c'):return _0x439e68['get'+_[_0x9452('0xa9')](_0x5a4628[_0x9452('0x45')][_0x9452('0xb2')])+_0x9452('0xa6')](_0x1a8371);default:throw new db[(_0x9452('0x96'))][(_0x9452('0x97'))](_0x9452('0xdf'));}})[_0x9452('0x17')](function(_0x2766f3){_0x539227=_0x2766f3[_0x9452('0x4e')];if(!_0x5a4628[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0xe0'))){_0x1a8371['limit']=qs[_0x9452('0xe1')](_0x5a4628[_0x9452('0x45')][_0x9452('0xe1')]);_0x1a8371[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x5a4628[_0x9452('0x45')]['offset']);}switch(_0x439e68[_0x9452('0x2b')]){case _0x9452('0x83'):return db[_[_0x9452('0xa9')](_0x5a4628[_0x9452('0x45')][_0x9452('0xb2')])+_0x9452('0xda')][_0x9452('0x90')](_0x1a8371);case _0x9452('0x31'):case _0x9452('0x2c'):return _0x439e68[_0x9452('0x2f')+_[_0x9452('0xa9')](_0x5a4628[_0x9452('0x45')]['channel'])+'Queues'](_0x1a8371);}})[_0x9452('0x17')](function(_0x2d80e2){return{'count':_0x539227,'rows':_0x2d80e2};})[_0x9452('0x17')](respondWithResult(_0x9de405,null))['catch'](handleError(_0x9de405,null));};exports[_0x9452('0xe2')]=function(_0x422125,_0x1f097f){var _0x4a7ea5={};var _0x1ad737={};var _0x244ee7;var _0x10c911;return db['User'][_0x9452('0x9b')]({'where':{'id':_0x422125[_0x9452('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f097f,null))[_0x9452('0x17')](function(_0x53d458){if(_0x53d458){_0x244ee7=_0x53d458;_0x1ad737['model']=_[_0x9452('0x5c')](db[_0x9452('0xb7')]['rawAttributes']);_0x1ad737[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x422125[_0x9452('0x45')]);_0x1ad737[_0x9452('0x5d')]=_['intersection'](_0x1ad737[_0x9452('0x5a')],_0x1ad737[_0x9452('0x45')]);_0x4a7ea5[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x1ad737['model'],qs[_0x9452('0x5f')](_0x422125[_0x9452('0x45')][_0x9452('0x5f')]));_0x4a7ea5[_0x9452('0x4b')]=_0x4a7ea5[_0x9452('0x4b')]['length']?_0x4a7ea5['attributes']:_0x1ad737[_0x9452('0x5a')];_0x4a7ea5[_0x9452('0xdb')]=qs['sort'](_0x422125[_0x9452('0x45')][_0x9452('0xdc')]);_0x4a7ea5[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x422125[_0x9452('0x45')],_0x1ad737[_0x9452('0x5d')]));if(_0x422125[_0x9452('0x45')]['filter']){_0x4a7ea5[_0x9452('0x44')]=_['merge'](_0x4a7ea5[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x4a7ea5[_0x9452('0x4b')],function(_0x13c55c){var _0x3ea730={};_0x3ea730[_0x13c55c]={'$like':'%'+_0x422125['query'][_0x9452('0x3f')]+'%'};return _0x3ea730;})});}_0x4a7ea5=_[_0x9452('0xde')]({},_0x4a7ea5,_0x422125['options']);return _0x244ee7[_0x9452('0xe2')](_0x4a7ea5);}})['then'](function(_0x44f225){if(_0x44f225){_0x10c911=_0x44f225[_0x9452('0x4e')];if(!_0x422125[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0xe0'))){_0x4a7ea5[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x422125[_0x9452('0x45')]['limit']);_0x4a7ea5[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x422125[_0x9452('0x45')][_0x9452('0x24')]);}return _0x244ee7[_0x9452('0xe2')](_0x4a7ea5);}})[_0x9452('0x17')](function(_0x730b2a){if(_0x730b2a){return _0x730b2a?{'count':_0x10c911,'rows':_0x730b2a}:null;}})['then'](respondWithResult(_0x1f097f,null))[_0x9452('0x57')](handleError(_0x1f097f,null));};exports[_0x9452('0xe3')]=function(_0x3b924e,_0x56e565){var _0x26ddd7={};var _0x1ee074={};var _0x2dc355;var _0x29d92f;return db[_0x9452('0x3b')]['findOne']({'where':{'id':_0x3b924e[_0x9452('0x59')]['id']}})['then'](handleEntityNotFound(_0x56e565,null))[_0x9452('0x17')](function(_0xd21aa4){if(_0xd21aa4){_0x2dc355=_0xd21aa4;_0x1ee074[_0x9452('0x5a')]=_[_0x9452('0x5c')](db[_0x9452('0xe4')][_0x9452('0x3c')]);_0x1ee074[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x3b924e[_0x9452('0x45')]);_0x1ee074[_0x9452('0x5d')]=_[_0x9452('0x5e')](_0x1ee074['model'],_0x1ee074['query']);_0x26ddd7['attributes']=_[_0x9452('0x5e')](_0x1ee074[_0x9452('0x5a')],qs['fields'](_0x3b924e['query'][_0x9452('0x5f')]));_0x26ddd7[_0x9452('0x4b')]=_0x26ddd7[_0x9452('0x4b')]['length']?_0x26ddd7[_0x9452('0x4b')]:_0x1ee074[_0x9452('0x5a')];_0x26ddd7['order']=qs[_0x9452('0xdc')](_0x3b924e[_0x9452('0x45')][_0x9452('0xdc')]);_0x26ddd7[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x3b924e[_0x9452('0x45')],_0x1ee074[_0x9452('0x5d')]));if(_0x3b924e[_0x9452('0x45')][_0x9452('0x3f')]){_0x26ddd7['where']=_[_0x9452('0xde')](_0x26ddd7['where'],{'$or':_[_0x9452('0x34')](_0x26ddd7[_0x9452('0x4b')],function(_0x1635af){var _0x395885={};_0x395885[_0x1635af]={'$like':'%'+_0x3b924e[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x395885;})});}_0x26ddd7=_[_0x9452('0xde')]({},_0x26ddd7,_0x3b924e[_0x9452('0x60')]);return _0x2dc355[_0x9452('0xe3')](_0x26ddd7);}})[_0x9452('0x17')](function(_0x25a541){if(_0x25a541){_0x29d92f=_0x25a541[_0x9452('0x4e')];if(!_0x3b924e[_0x9452('0x45')][_0x9452('0xd2')]('nolimit')){_0x26ddd7[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x3b924e[_0x9452('0x45')]['limit']);_0x26ddd7['offset']=qs[_0x9452('0x24')](_0x3b924e[_0x9452('0x45')][_0x9452('0x24')]);}return _0x2dc355[_0x9452('0xe3')](_0x26ddd7);}})[_0x9452('0x17')](function(_0x443c61){if(_0x443c61){return _0x443c61?{'count':_0x29d92f,'rows':_0x443c61}:null;}})['then'](respondWithResult(_0x56e565,null))['catch'](handleError(_0x56e565,null));};exports[_0x9452('0xe5')]=function(_0x231f7d,_0x56a833){var _0x2ed938={'raw':!![],'where':{}};var _0x594858={};var _0x418f4e={'count':0x0,'rows':[]};return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x231f7d[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x56a833,null))[_0x9452('0x17')](function(_0x48227d){if(_0x48227d){_0x594858[_0x9452('0x5a')]=_[_0x9452('0x5c')](db[_0x9452('0xe6')][_0x9452('0x3c')]);_0x594858[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x231f7d[_0x9452('0x45')]);_0x594858[_0x9452('0x5d')]=_[_0x9452('0x5e')](_0x594858['model'],_0x594858['query']);_0x2ed938[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x594858[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x231f7d[_0x9452('0x45')][_0x9452('0x5f')]));_0x2ed938['attributes']=_0x2ed938['attributes']['length']?_0x2ed938[_0x9452('0x4b')]:_0x594858[_0x9452('0x5a')];if(!_0x231f7d['query'][_0x9452('0xd2')](_0x9452('0xe0'))){_0x2ed938[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x231f7d['query'][_0x9452('0xe1')]);_0x2ed938[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x231f7d['query']['offset']);}_0x2ed938['order']=qs['sort'](_0x231f7d[_0x9452('0x45')]['sort']);_0x2ed938[_0x9452('0x44')]=qs['filters'](_[_0x9452('0xdd')](_0x231f7d['query'],_0x594858['filters']));_0x2ed938['where'][_0x9452('0xe7')]=_0x48227d['id'];if(_0x231f7d['query'][_0x9452('0x3f')]){_0x2ed938[_0x9452('0x44')]=_['merge'](_0x2ed938[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x2ed938[_0x9452('0x4b')],function(_0xe98582){var _0x4deb90={};_0x4deb90[_0xe98582]={'$like':'%'+_0x231f7d['query'][_0x9452('0x3f')]+'%'};return _0x4deb90;})});}_0x2ed938=_[_0x9452('0xde')]({},_0x2ed938,_0x231f7d['options']);return db[_0x9452('0xe6')]['count']({'where':_0x2ed938[_0x9452('0x44')]})[_0x9452('0x17')](function(_0x40e1b9){_0x418f4e[_0x9452('0x26')]=_0x40e1b9;if(_0x231f7d['query'][_0x9452('0x46')]){_0x2ed938[_0x9452('0x47')]=[{'all':!![]}];}return db[_0x9452('0xe6')][_0x9452('0x90')](_0x2ed938);})['then'](function(_0x55362d){_0x418f4e['rows']=_0x55362d;return _0x418f4e;});}})['then'](respondWithFilteredResult(_0x56a833,_0x2ed938))[_0x9452('0x57')](handleError(_0x56a833,null));};exports[_0x9452('0xe8')]=function(_0x416761,_0x379d00){var _0x4ffa4c={'raw':!![],'where':{}};var _0xd2e2e1={};var _0x40495c={'count':0x0,'rows':[]};return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x416761['params']['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x379d00,null))[_0x9452('0x17')](function(_0x381901){if(_0x381901){_0xd2e2e1[_0x9452('0x5a')]=_[_0x9452('0x5c')](db['ScreenRecording']['rawAttributes']);_0xd2e2e1[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x416761['query']);_0xd2e2e1['filters']=_[_0x9452('0x5e')](_0xd2e2e1[_0x9452('0x5a')],_0xd2e2e1[_0x9452('0x45')]);_0x4ffa4c[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0xd2e2e1[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x416761[_0x9452('0x45')][_0x9452('0x5f')]));_0x4ffa4c['attributes']=_0x4ffa4c[_0x9452('0x4b')]['length']?_0x4ffa4c[_0x9452('0x4b')]:_0xd2e2e1[_0x9452('0x5a')];if(!_0x416761[_0x9452('0x45')]['hasOwnProperty']('nolimit')){_0x4ffa4c[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x416761[_0x9452('0x45')]['limit']);_0x4ffa4c['offset']=qs[_0x9452('0x24')](_0x416761['query'][_0x9452('0x24')]);}_0x4ffa4c[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x416761[_0x9452('0x45')][_0x9452('0xdc')]);_0x4ffa4c[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x416761['query'],_0xd2e2e1['filters']));_0x4ffa4c[_0x9452('0x44')]['UserId']=_0x381901['id'];if(_0x416761[_0x9452('0x45')][_0x9452('0x3f')]){_0x4ffa4c[_0x9452('0x44')]=_[_0x9452('0xde')](_0x4ffa4c[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x4ffa4c[_0x9452('0x4b')],function(_0x3f058d){var _0x49823d={};_0x49823d[_0x3f058d]={'$like':'%'+_0x416761[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x49823d;})});}_0x4ffa4c=_[_0x9452('0xde')]({},_0x4ffa4c,_0x416761[_0x9452('0x60')]);return db[_0x9452('0xe9')][_0x9452('0x26')]({'where':_0x4ffa4c[_0x9452('0x44')]})[_0x9452('0x17')](function(_0x16d1fa){_0x40495c[_0x9452('0x26')]=_0x16d1fa;if(_0x416761[_0x9452('0x45')]['includeAll']){_0x4ffa4c[_0x9452('0x47')]=[{'all':!![]}];}return db[_0x9452('0xe9')][_0x9452('0x90')](_0x4ffa4c);})[_0x9452('0x17')](function(_0x3c19c5){_0x40495c[_0x9452('0x4c')]=_0x3c19c5;return _0x40495c;});}})[_0x9452('0x17')](respondWithFilteredResult(_0x379d00,_0x4ffa4c))[_0x9452('0x57')](handleError(_0x379d00,null));};exports[_0x9452('0xea')]=function(_0x27d8fc,_0x1f6e30){var _0x46977f={};var _0x15f744={};var _0x2dac61;var _0x32b328;return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x27d8fc[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x1f6e30,null))[_0x9452('0x17')](function(_0x1c5dc1){if(_0x1c5dc1){_0x2dac61=_0x1c5dc1;_0x15f744[_0x9452('0x5a')]=_[_0x9452('0x5c')](db['ChatInteraction'][_0x9452('0x3c')]);_0x15f744['query']=_[_0x9452('0x5c')](_0x27d8fc[_0x9452('0x45')]);_0x15f744['filters']=_[_0x9452('0x5e')](_0x15f744[_0x9452('0x5a')],_0x15f744['query']);_0x46977f['attributes']=_[_0x9452('0x5e')](_0x15f744[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x27d8fc['query'][_0x9452('0x5f')]));_0x46977f[_0x9452('0x4b')]=_0x46977f[_0x9452('0x4b')][_0x9452('0x4e')]?_0x46977f[_0x9452('0x4b')]:_0x15f744['model'];_0x46977f['order']=qs[_0x9452('0xdc')](_0x27d8fc[_0x9452('0x45')][_0x9452('0xdc')]);_0x46977f[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x27d8fc[_0x9452('0x45')],_0x15f744[_0x9452('0x5d')]));if(_0x27d8fc[_0x9452('0x45')][_0x9452('0x3f')]){_0x46977f[_0x9452('0x44')]=_[_0x9452('0xde')](_0x46977f['where'],{'$or':_[_0x9452('0x34')](_0x46977f[_0x9452('0x4b')],function(_0x34d5c9){var _0x4e2553={};_0x4e2553[_0x34d5c9]={'$like':'%'+_0x27d8fc[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x4e2553;})});}_0x46977f=_['merge']({},_0x46977f,_0x27d8fc['options']);return _0x2dac61['getChatInteractions'](_0x46977f);}})['then'](function(_0x3032d8){if(_0x3032d8){_0x32b328=_0x3032d8[_0x9452('0x4e')];if(!_0x27d8fc[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0xe0'))){_0x46977f[_0x9452('0xe1')]=qs['limit'](_0x27d8fc[_0x9452('0x45')][_0x9452('0xe1')]);_0x46977f[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x27d8fc[_0x9452('0x45')][_0x9452('0x24')]);}return _0x2dac61[_0x9452('0xea')](_0x46977f);}})[_0x9452('0x17')](function(_0xb1f6ae){if(_0xb1f6ae){return _0xb1f6ae?{'count':_0x32b328,'rows':_0xb1f6ae}:null;}})['then'](respondWithResult(_0x1f6e30,null))[_0x9452('0x57')](handleError(_0x1f6e30,null));};exports[_0x9452('0xeb')]=function(_0x42915e,_0x54b37e){var _0x3a27c9={};var _0x10f117={};var _0x411cde;var _0x49a2f7;return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x42915e[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x54b37e,null))['then'](function(_0x2803eb){if(_0x2803eb){_0x411cde=_0x2803eb;_0x10f117[_0x9452('0x5a')]=_['keys'](db[_0x9452('0xec')][_0x9452('0x3c')]);_0x10f117[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x42915e[_0x9452('0x45')]);_0x10f117[_0x9452('0x5d')]=_['intersection'](_0x10f117[_0x9452('0x5a')],_0x10f117['query']);_0x3a27c9[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x10f117[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x42915e[_0x9452('0x45')][_0x9452('0x5f')]));_0x3a27c9['attributes']=_0x3a27c9[_0x9452('0x4b')][_0x9452('0x4e')]?_0x3a27c9[_0x9452('0x4b')]:_0x10f117['model'];_0x3a27c9[_0x9452('0xdb')]=qs['sort'](_0x42915e['query'][_0x9452('0xdc')]);_0x3a27c9['where']=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x42915e['query'],_0x10f117[_0x9452('0x5d')]));if(_0x42915e['query'][_0x9452('0x3f')]){_0x3a27c9['where']=_[_0x9452('0xde')](_0x3a27c9['where'],{'$or':_[_0x9452('0x34')](_0x3a27c9[_0x9452('0x4b')],function(_0x28e2cc){var _0x2d2c7f={};_0x2d2c7f[_0x28e2cc]={'$like':'%'+_0x42915e[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x2d2c7f;})});}_0x3a27c9=_[_0x9452('0xde')]({},_0x3a27c9,_0x42915e[_0x9452('0x60')]);return _0x411cde[_0x9452('0xeb')](_0x3a27c9);}})['then'](function(_0xc8457f){if(_0xc8457f){_0x49a2f7=_0xc8457f[_0x9452('0x4e')];if(!_0x42915e[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0xe0'))){_0x3a27c9[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x42915e[_0x9452('0x45')][_0x9452('0xe1')]);_0x3a27c9[_0x9452('0x24')]=qs['offset'](_0x42915e['query'][_0x9452('0x24')]);}return _0x411cde[_0x9452('0xeb')](_0x3a27c9);}})['then'](function(_0x29df45){if(_0x29df45){return _0x29df45?{'count':_0x49a2f7,'rows':_0x29df45}:null;}})['then'](respondWithResult(_0x54b37e,null))['catch'](handleError(_0x54b37e,null));};exports[_0x9452('0xed')]=function(_0x363f1c,_0x460c84){var _0x4fae2a={'raw':!![],'where':{}};var _0x5bd7fa={};var _0x149d86={'count':0x0,'rows':[]};return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x363f1c[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x460c84,null))[_0x9452('0x17')](function(_0x5c3eff){if(_0x5c3eff){_0x5bd7fa[_0x9452('0x5a')]=_['keys'](db[_0x9452('0xee')]['rawAttributes']);_0x5bd7fa[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x363f1c[_0x9452('0x45')]);_0x5bd7fa['filters']=_[_0x9452('0x5e')](_0x5bd7fa['model'],_0x5bd7fa[_0x9452('0x45')]);_0x4fae2a[_0x9452('0x4b')]=_['intersection'](_0x5bd7fa['model'],qs['fields'](_0x363f1c[_0x9452('0x45')]['fields']));_0x4fae2a[_0x9452('0x4b')]=_0x4fae2a['attributes'][_0x9452('0x4e')]?_0x4fae2a['attributes']:_0x5bd7fa[_0x9452('0x5a')];if(!_0x363f1c[_0x9452('0x45')][_0x9452('0xd2')]('nolimit')){_0x4fae2a['limit']=qs[_0x9452('0xe1')](_0x363f1c[_0x9452('0x45')][_0x9452('0xe1')]);_0x4fae2a[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x363f1c[_0x9452('0x45')][_0x9452('0x24')]);}_0x4fae2a[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x363f1c[_0x9452('0x45')][_0x9452('0xdc')]);_0x4fae2a[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x363f1c[_0x9452('0x45')],_0x5bd7fa[_0x9452('0x5d')]));_0x4fae2a[_0x9452('0x44')]['UserId']=_0x5c3eff['id'];if(_0x363f1c[_0x9452('0x45')][_0x9452('0x3f')]){_0x4fae2a['where']=_[_0x9452('0xde')](_0x4fae2a[_0x9452('0x44')],{'$or':_['map'](_0x4fae2a[_0x9452('0x4b')],function(_0x52336c){var _0x420dc2={};_0x420dc2[_0x52336c]={'$like':'%'+_0x363f1c[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x420dc2;})});}_0x4fae2a=_[_0x9452('0xde')]({},_0x4fae2a,_0x363f1c[_0x9452('0x60')]);return db[_0x9452('0xee')][_0x9452('0x26')]({'where':_0x4fae2a[_0x9452('0x44')]})['then'](function(_0x27492a){_0x149d86[_0x9452('0x26')]=_0x27492a;if(_0x363f1c[_0x9452('0x45')][_0x9452('0x46')]){_0x4fae2a[_0x9452('0x47')]=[{'all':!![]}];}return db[_0x9452('0xee')][_0x9452('0x90')](_0x4fae2a);})[_0x9452('0x17')](function(_0x273532){_0x149d86[_0x9452('0x4c')]=_0x273532;return _0x149d86;});}})['then'](respondWithFilteredResult(_0x460c84,_0x4fae2a))[_0x9452('0x57')](handleError(_0x460c84,null));};exports[_0x9452('0xef')]=function(_0x2f07b0,_0x437df4){var _0x4370f0={};var _0x1fecbc={};var _0x399ac6;var _0xee7fd5;return db['User']['findOne']({'where':{'id':_0x2f07b0[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x437df4,null))[_0x9452('0x17')](function(_0x32ab9c){if(_0x32ab9c){_0x399ac6=_0x32ab9c;_0x1fecbc['model']=_['keys'](db[_0x9452('0xf0')][_0x9452('0x3c')]);_0x1fecbc['query']=_[_0x9452('0x5c')](_0x2f07b0['query']);_0x1fecbc[_0x9452('0x5d')]=_[_0x9452('0x5e')](_0x1fecbc[_0x9452('0x5a')],_0x1fecbc['query']);_0x4370f0[_0x9452('0x4b')]=_['intersection'](_0x1fecbc[_0x9452('0x5a')],qs['fields'](_0x2f07b0[_0x9452('0x45')]['fields']));_0x4370f0['attributes']=_0x4370f0[_0x9452('0x4b')]['length']?_0x4370f0[_0x9452('0x4b')]:_0x1fecbc[_0x9452('0x5a')];_0x4370f0[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x2f07b0[_0x9452('0x45')][_0x9452('0xdc')]);_0x4370f0[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x2f07b0[_0x9452('0x45')],_0x1fecbc[_0x9452('0x5d')]));if(_0x2f07b0['query'][_0x9452('0x3f')]){_0x4370f0[_0x9452('0x44')]=_[_0x9452('0xde')](_0x4370f0[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x4370f0['attributes'],function(_0x59817d){var _0x1e8015={};_0x1e8015[_0x59817d]={'$like':'%'+_0x2f07b0[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x1e8015;})});}_0x4370f0=_[_0x9452('0xde')]({},_0x4370f0,_0x2f07b0['options']);return _0x399ac6[_0x9452('0xef')](_0x4370f0);}})[_0x9452('0x17')](function(_0x4eb2a8){if(_0x4eb2a8){_0xee7fd5=_0x4eb2a8[_0x9452('0x4e')];if(!_0x2f07b0['query'][_0x9452('0xd2')]('nolimit')){_0x4370f0[_0x9452('0xe1')]=qs['limit'](_0x2f07b0[_0x9452('0x45')][_0x9452('0xe1')]);_0x4370f0[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x2f07b0['query']['offset']);}return _0x399ac6[_0x9452('0xef')](_0x4370f0);}})[_0x9452('0x17')](function(_0x43cc8a){if(_0x43cc8a){return _0x43cc8a?{'count':_0xee7fd5,'rows':_0x43cc8a}:null;}})[_0x9452('0x17')](respondWithResult(_0x437df4,null))[_0x9452('0x57')](handleError(_0x437df4,null));};exports[_0x9452('0xf1')]=function(_0x1b156f,_0xee256c){var _0x5dbe3c={};var _0x3b8284={};var _0x3106cf;var _0x274825;return db['User'][_0x9452('0x9b')]({'where':{'id':_0x1b156f['params']['id']}})[_0x9452('0x17')](handleEntityNotFound(_0xee256c,null))['then'](function(_0x348dda){if(_0x348dda){_0x3106cf=_0x348dda;_0x3b8284[_0x9452('0x5a')]=_['keys'](db[_0x9452('0xf2')][_0x9452('0x3c')]);_0x3b8284[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x1b156f[_0x9452('0x45')]);_0x3b8284[_0x9452('0x5d')]=_[_0x9452('0x5e')](_0x3b8284[_0x9452('0x5a')],_0x3b8284[_0x9452('0x45')]);_0x5dbe3c[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x3b8284['model'],qs[_0x9452('0x5f')](_0x1b156f[_0x9452('0x45')][_0x9452('0x5f')]));_0x5dbe3c[_0x9452('0x4b')]=_0x5dbe3c[_0x9452('0x4b')][_0x9452('0x4e')]?_0x5dbe3c[_0x9452('0x4b')]:_0x3b8284['model'];_0x5dbe3c['order']=qs[_0x9452('0xdc')](_0x1b156f[_0x9452('0x45')][_0x9452('0xdc')]);_0x5dbe3c[_0x9452('0x44')]=qs[_0x9452('0x5d')](_['pick'](_0x1b156f[_0x9452('0x45')],_0x3b8284[_0x9452('0x5d')]));if(_0x1b156f[_0x9452('0x45')][_0x9452('0x3f')]){_0x5dbe3c[_0x9452('0x44')]=_[_0x9452('0xde')](_0x5dbe3c[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x5dbe3c[_0x9452('0x4b')],function(_0x5ebb7d){var _0x4c546b={};_0x4c546b[_0x5ebb7d]={'$like':'%'+_0x1b156f[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x4c546b;})});}_0x5dbe3c=_['merge']({},_0x5dbe3c,_0x1b156f[_0x9452('0x60')]);return _0x3106cf[_0x9452('0xf1')](_0x5dbe3c);}})[_0x9452('0x17')](function(_0x1be6c3){if(_0x1be6c3){_0x274825=_0x1be6c3[_0x9452('0x4e')];if(!_0x1b156f[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0xe0'))){_0x5dbe3c[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x1b156f[_0x9452('0x45')][_0x9452('0xe1')]);_0x5dbe3c['offset']=qs[_0x9452('0x24')](_0x1b156f[_0x9452('0x45')][_0x9452('0x24')]);}return _0x3106cf[_0x9452('0xf1')](_0x5dbe3c);}})[_0x9452('0x17')](function(_0x9252fe){if(_0x9252fe){return _0x9252fe?{'count':_0x274825,'rows':_0x9252fe}:null;}})[_0x9452('0x17')](respondWithResult(_0xee256c,null))['catch'](handleError(_0xee256c,null));};exports['getWhatsappInteractions']=function(_0x480a18,_0x1822dc){var _0x500146={};var _0x1d4d03={};var _0x5bfed3;var _0x1a9719;return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x480a18[_0x9452('0x59')]['id']}})['then'](handleEntityNotFound(_0x1822dc,null))[_0x9452('0x17')](function(_0x51bf8a){if(_0x51bf8a){_0x5bfed3=_0x51bf8a;_0x1d4d03[_0x9452('0x5a')]=_[_0x9452('0x5c')](db[_0x9452('0xf3')][_0x9452('0x3c')]);_0x1d4d03['query']=_['keys'](_0x480a18[_0x9452('0x45')]);_0x1d4d03['filters']=_['intersection'](_0x1d4d03[_0x9452('0x5a')],_0x1d4d03[_0x9452('0x45')]);_0x500146['attributes']=_[_0x9452('0x5e')](_0x1d4d03[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x480a18['query'][_0x9452('0x5f')]));_0x500146[_0x9452('0x4b')]=_0x500146['attributes']['length']?_0x500146[_0x9452('0x4b')]:_0x1d4d03[_0x9452('0x5a')];_0x500146[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x480a18[_0x9452('0x45')][_0x9452('0xdc')]);_0x500146[_0x9452('0x44')]=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x480a18[_0x9452('0x45')],_0x1d4d03[_0x9452('0x5d')]));if(_0x480a18[_0x9452('0x45')]['filter']){_0x500146[_0x9452('0x44')]=_[_0x9452('0xde')](_0x500146[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x500146[_0x9452('0x4b')],function(_0x1ad3b0){var _0x6ff79={};_0x6ff79[_0x1ad3b0]={'$like':'%'+_0x480a18[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x6ff79;})});}_0x500146=_[_0x9452('0xde')]({},_0x500146,_0x480a18[_0x9452('0x60')]);return _0x5bfed3[_0x9452('0xf4')](_0x500146);}})[_0x9452('0x17')](function(_0x1e66dc){if(_0x1e66dc){_0x1a9719=_0x1e66dc[_0x9452('0x4e')];if(!_0x480a18[_0x9452('0x45')][_0x9452('0xd2')]('nolimit')){_0x500146[_0x9452('0xe1')]=qs['limit'](_0x480a18[_0x9452('0x45')][_0x9452('0xe1')]);_0x500146['offset']=qs[_0x9452('0x24')](_0x480a18[_0x9452('0x45')][_0x9452('0x24')]);}return _0x5bfed3[_0x9452('0xf4')](_0x500146);}})[_0x9452('0x17')](function(_0x34522c){if(_0x34522c){return _0x34522c?{'count':_0x1a9719,'rows':_0x34522c}:null;}})['then'](respondWithResult(_0x1822dc,null))[_0x9452('0x57')](handleError(_0x1822dc,null));};exports[_0x9452('0xf5')]=function(_0xf781d,_0x22533d,_0x673276){var _0x2dc21e;var _0x47f88d;var _0x444b14;var _0x88a172=!_[_0x9452('0x6f')](_0xf781d[_0x9452('0x59')]['id'])?_0xf781d[_0x9452('0x59')]['id']:!_['isNil'](_0xf781d['user']['id'])?_0xf781d[_0x9452('0x31')]['id']:null;return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x88a172,'role':{'$or':[_0x9452('0x83'),_0x9452('0x31'),_0x9452('0x2c')]}},'attributes':['id',_0x9452('0x36'),_0x9452('0xf6'),'mobile',_0x9452('0x2b'),_0x9452('0x67'),_0x9452('0xf7')]})['then'](function(_0x334c0b){if(_0x334c0b){if(_0x334c0b['role']===_0x9452('0x2c')){_0x2dc21e=_0x334c0b;if(_0xf781d[_0x9452('0x62')][_0x9452('0xa4')]){_0x444b14=util[_0x9452('0xd0')](_0x9452('0xf8'),_0x2dc21e[_0xf781d[_0x9452('0x62')][_0x9452('0xa4')]]);}else if(_0xf781d[_0x9452('0x62')][_0x9452('0xf9')]){_0x444b14=util[_0x9452('0xd0')]('SIP/%s',_0xf781d[_0x9452('0x62')][_0x9452('0xf9')]);}else{_0x444b14=util[_0x9452('0xd0')](_0x9452('0xaf'),_0x2dc21e[_0x9452('0x36')]);}socket['to'](util['format']('user:%s',_0x2dc21e['name']))['emit'](_0x9452('0xfa'),{'user':{'id':_0x2dc21e['id'],'name':_0x2dc21e[_0x9452('0x36')]},'ip':_0xf781d['headers'][_0x9452('0xfb')]||_0xf781d['connection'][_0x9452('0xfc')]||_0xf781d[_0x9452('0xfd')]['remoteAddress']||_0xf781d[_0x9452('0xfe')]['socket'][_0x9452('0xfc')]});return db[_0x9452('0xb7')][_0x9452('0x2e')]({'where':{'membername':_0x2dc21e[_0x9452('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x9452('0x96'))][(_0x9452('0x97'))](_0x9452('0xff'));}})[_0x9452('0x17')](function(){if(_0x2dc21e){return _0x2dc21e[_0x9452('0x100')]({'raw':!![]});}})[_0x9452('0x17')](function(_0x402899){if(_0x2dc21e){if(_0x402899){_0x47f88d=_0x402899;if(_0x47f88d[_0x9452('0x4e')]){var _0x229084=_0x47f88d['map'](function(_0x1d6bfc){var _0x106421={'membername':_0x2dc21e[_0x9452('0x36')],'UserId':_0x2dc21e['id'],'queue_name':_0x1d6bfc[_0x9452('0x36')],'VoiceQueueId':_0x1d6bfc['id'],'interface':_0x444b14,'paused':_0x2dc21e[_0x9452('0xf7')]||![],'penalty':_0x1d6bfc[_0x9452('0x101')]||0x0};return db[_0x9452('0xb7')][_0x9452('0x102')](_0x106421);});return Promise[_0x9452('0x56')](_0x229084);}}}})['then'](function(){if(_0x2dc21e){return db[_0x9452('0x103')][_0x9452('0x90')]({'where':{'membername':_0x2dc21e[_0x9452('0x36')],'exitAt':null}});}})[_0x9452('0x17')](function(_0xa93346){if(_0x2dc21e){var _0x42cd6d=[];_0xa93346['forEach'](function(_0x4897d3){_0x42cd6d[_0x9452('0x4f')](_0x4897d3[_0x9452('0x2a')]({'exitAt':moment()[_0x9452('0xd0')](_0x9452('0x104'))}));});return Promise[_0x9452('0x56')](_0x42cd6d);}})[_0x9452('0x17')](function(){if(_0x2dc21e){var _0x549161=[];var _0x29ab7d=[];var _0x1ff2a6=utils[_0x9452('0x105')]();var _0x414319={'membername':_0x2dc21e[_0x9452('0x36')],'interface':_0x444b14,'enterAt':moment()['format'](_0x9452('0x104')),'role':_0x2dc21e['role'],'internal':_0x2dc21e[_0x9452('0x67')]};_0x1ff2a6['forEach'](function(_0x5361da){_0x549161[_0x9452('0x4f')](_['merge']({'channel':_0x5361da,'type':'LOGIN','data1':_0xf781d[_0x9452('0x62')][_0x9452('0x106')],'data2':_0x444b14},_0x414319));if(_0x2dc21e[_0x9452('0xf7')]){_0x29ab7d[_0x9452('0x4f')](_[_0x9452('0xde')]({'channel':_0x5361da,'type':_0x9452('0x107'),'data1':_0x9452('0x108')},_0x414319));}});return db[_0x9452('0x103')][_0x9452('0x8c')](_0x549161[_0x9452('0xcf')](_0x29ab7d),{'individualHooks':!![]});}})[_0x9452('0x17')](function(){if(_0x2dc21e){return _0x2dc21e[_0x9452('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x9452('0xd0')](_0x9452('0x104')),'voicePause':_0x2dc21e[_0x9452('0xf7')]||![],'mailPause':_0x2dc21e['loginInPause']||![],'chatPause':_0x2dc21e[_0x9452('0xf7')]||![],'faxPause':_0x2dc21e[_0x9452('0xf7')]||![],'smsPause':_0x2dc21e[_0x9452('0xf7')]||![],'openchannelPause':_0x2dc21e[_0x9452('0xf7')]||![],'whatsappPause':_0x2dc21e[_0x9452('0xf7')]||![],'pauseType':_0x2dc21e['loginInPause']?_0x9452('0x108'):null,'interface':_0x444b14,'lastPauseAt':moment()[_0x9452('0xd0')](_0x9452('0x104'))});}})['then'](function(_0x1059c4){if(_0xf781d['isMiddleware']){return _0x673276();}else{return Promise[_0x9452('0x109')](_0x1059c4)[_0x9452('0x17')](respondWithResult(_0x22533d,null));}})[_0x9452('0x57')](handleError(_0x22533d,null));};exports['logout']=function(_0x1d0865,_0xf8ccda){var _0x3a76a3;return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x1d0865[_0x9452('0x59')]['id'],'role':_0x9452('0x2c')},'attributes':['id',_0x9452('0x36'),_0x9452('0x2b')]})[_0x9452('0x17')](handleEntityNotFound(_0xf8ccda,null))[_0x9452('0x17')](function(_0x250b9e){if(_0x250b9e){_0x3a76a3=_0x250b9e;return db['UserVoiceQueueRt'][_0x9452('0x2e')]({'where':{'membername':_0x3a76a3['name']},'individualHooks':!![]});}})[_0x9452('0x17')](function(){return db[_0x9452('0x103')]['findAll']({'where':{'membername':_0x3a76a3['name'],'exitAt':null}});})['then'](function(_0x405d45){var _0x4950cc=[];_0x405d45[_0x9452('0x10a')](function(_0x2d33e9){_0x4950cc[_0x9452('0x4f')](_0x2d33e9['update']({'exitAt':moment()['format'](_0x9452('0x104'))}));});return Promise[_0x9452('0x56')](_0x4950cc);})['then'](function(){return _0x3a76a3['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9452('0x17')](respondWithResult(_0xf8ccda,null))['catch'](handleError(_0xf8ccda,null));};exports[_0x9452('0x10b')]=function(_0x296f38,_0x13d5c1){var _0x59ff64;return db[_0x9452('0xb7')][_0x9452('0x2a')]({'paused':0x1},{'where':{'UserId':_0x296f38[_0x9452('0x59')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x9452('0x61')]({'where':{'id':_0x296f38[_0x9452('0x59')]['id'],'role':_0x9452('0x2c')},'attributes':['id',_0x9452('0x36'),_0x9452('0x2b'),'internal',_0x9452('0xa4'),_0x9452('0xa3')]});})[_0x9452('0x17')](handleEntityNotFound(_0x13d5c1,null))['then'](function(_0x40d51d){if(_0x40d51d){_0x59ff64=_0x40d51d;return respondWithRpcPromise('QueuePause','pause',{'id':_0x59ff64['id'],'name':_0x59ff64['name'],'pause':!![]});}})['then'](function(){if(_0x59ff64){return db['MemberReport']['findAll']({'where':{'membername':_0x59ff64[_0x9452('0x36')],'type':_0x9452('0x107'),'exitAt':null}});}})[_0x9452('0x17')](function(_0x47a64f){if(_0x47a64f[_0x9452('0x4e')]){var _0x4f8f1d=moment()[_0x9452('0xd0')](_0x9452('0x104'));for(var _0x41edfa=0x0,_0x3dc5f3=_0x47a64f[_0x9452('0x4e')];_0x41edfa<_0x3dc5f3;_0x41edfa++){_0x47a64f[_0x41edfa][_0x9452('0x10c')]({'exitAt':_0x4f8f1d});}}})[_0x9452('0x17')](function(){var _0x177843=[];var _0x726c3c=utils[_0x9452('0x105')]();_0x726c3c[_0x9452('0x10a')](function(_0x4af16f){_0x177843[_0x9452('0x4f')]({'channel':_0x4af16f,'membername':_0x59ff64[_0x9452('0x36')],'interface':_[_0x9452('0x6f')](_0x59ff64[_0x9452('0xa4')])?util['format']('SIP/%s',_0x59ff64[_0x9452('0x36')]):_0x59ff64[_0x9452('0xa4')],'type':'PAUSE','enterAt':moment()[_0x9452('0xd0')](_0x9452('0x104')),'data1':_0x296f38[_0x9452('0x62')][_0x9452('0x3e')]||'DEFAULT\x20PAUSE','role':_0x59ff64['role'],'internal':_0x59ff64['internal']});});return db['MemberReport'][_0x9452('0x8c')](_0x177843,{'individualHooks':!![]});})[_0x9452('0x17')](function(){return _0x59ff64[_0x9452('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x296f38['body'][_0x9452('0x3e')]||_0x9452('0x10d'),'lastPauseAt':moment()[_0x9452('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9452('0x17')](respondWithResult(_0x13d5c1,null))[_0x9452('0x57')](handleError(_0x13d5c1,null));};exports[_0x9452('0x10e')]=function(_0x33e212,_0x15fb2d){if(_0x33e212['body'][_0x9452('0xb2')]&&!utils['isValidChannel'](_0x33e212[_0x9452('0x62')]['channel'])){throw new APIBadRequestError(util[_0x9452('0xd0')](_0x9452('0x10f'),_0x33e212[_0x9452('0x62')][_0x9452('0xb2')]));}return db[_0x9452('0x3b')][_0x9452('0x61')]({'where':{'id':_0x33e212[_0x9452('0x59')]['id']},'attributes':['id',_0x9452('0x36'),_0x9452('0x2b'),_0x9452('0x67'),_0x9452('0xa4'),'online',_0x9452('0xb0'),_0x9452('0x110'),_0x9452('0x111'),_0x9452('0x112'),_0x9452('0x113'),_0x9452('0x114'),_0x9452('0x115'),'pauseType',_0x9452('0x116')]})[_0x9452('0x17')](function(_0x18a664){if(!_0x18a664){throw new APINotFoundError(util['format'](_0x9452('0xd1'),_0x33e212[_0x9452('0x59')]['id']));}return _0x18a664[_0x9452('0x10e')](_0x33e212[_0x9452('0x62')]['channel']);})[_0x9452('0x17')](respondWithResult(_0x15fb2d,null))[_0x9452('0x57')](APIHandleError(_0x15fb2d));};exports[_0x9452('0x117')]=function(_0x28d51b,_0x4535cb){var _0x5bc66b={};var _0x20ee93={};var _0x2440b5;var _0x266317;return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x28d51b['params']['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x4535cb,null))[_0x9452('0x17')](function(_0x2f31a5){if(_0x2f31a5){_0x2440b5=_0x2f31a5;_0x20ee93[_0x9452('0x5a')]=_[_0x9452('0x5c')](db['Team'][_0x9452('0x3c')]);_0x20ee93['query']=_[_0x9452('0x5c')](_0x28d51b[_0x9452('0x45')]);_0x20ee93[_0x9452('0x5d')]=_['intersection'](_0x20ee93[_0x9452('0x5a')],_0x20ee93['query']);_0x5bc66b['attributes']=_[_0x9452('0x5e')](_0x20ee93[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x28d51b[_0x9452('0x45')][_0x9452('0x5f')]));_0x5bc66b[_0x9452('0x4b')]=_0x5bc66b[_0x9452('0x4b')][_0x9452('0x4e')]?_0x5bc66b[_0x9452('0x4b')]:_0x20ee93[_0x9452('0x5a')];_0x5bc66b[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x28d51b[_0x9452('0x45')]['sort']);_0x5bc66b[_0x9452('0x44')]=qs['filters'](_[_0x9452('0xdd')](_0x28d51b[_0x9452('0x45')],_0x20ee93[_0x9452('0x5d')]));if(_0x28d51b[_0x9452('0x45')][_0x9452('0x3f')]){_0x5bc66b[_0x9452('0x44')]=_[_0x9452('0xde')](_0x5bc66b[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x5bc66b[_0x9452('0x4b')],function(_0x4cf477){var _0x16e567={};_0x16e567[_0x4cf477]={'$like':'%'+_0x28d51b[_0x9452('0x45')]['filter']+'%'};return _0x16e567;})});}_0x5bc66b=_[_0x9452('0xde')]({},_0x5bc66b,_0x28d51b[_0x9452('0x60')]);return _0x2440b5[_0x9452('0x117')](_0x5bc66b);}})[_0x9452('0x17')](function(_0x506ef8){if(_0x506ef8){_0x266317=_0x506ef8['length'];if(!_0x28d51b[_0x9452('0x45')]['hasOwnProperty'](_0x9452('0xe0'))){_0x5bc66b[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x28d51b[_0x9452('0x45')][_0x9452('0xe1')]);_0x5bc66b['offset']=qs[_0x9452('0x24')](_0x28d51b[_0x9452('0x45')][_0x9452('0x24')]);}return _0x2440b5[_0x9452('0x117')](_0x5bc66b);}})['then'](function(_0x109014){if(_0x109014){return _0x109014?{'count':_0x266317,'rows':_0x109014}:null;}})[_0x9452('0x17')](respondWithResult(_0x4535cb,null))[_0x9452('0x57')](handleError(_0x4535cb,null));};exports[_0x9452('0x118')]=function(_0x23c154,_0x4e5366){var _0x4b587d=_0x23c154[_0x9452('0x59')]['id'];var _0x5c0e6e=_0x23c154[_0x9452('0x62')]?_0x23c154['body'][_0x9452('0x66')]:null;var _0x4f925e=[];return Promise['resolve']()[_0x9452('0x17')](function(){if(!_0x5c0e6e)throw new APIBadRequestError(_0x9452('0x119'));})['then'](function(){return db['User'][_0x9452('0x9b')]({'where':{'id':_0x4b587d}});})[_0x9452('0x17')](function(_0x301c65){if(!_0x301c65)throw new APINotFoundError(util['format'](_0x9452('0xd1'),_0x23c154[_0x9452('0x59')]['id']));return db[_0x9452('0x6c')]['transaction'](function(_0x5d41ad){return _0x301c65[_0x9452('0x118')](_0x5c0e6e,{'transaction':_0x5d41ad})[_0x9452('0x17')](function(){return db[_0x9452('0x11a')][_0x9452('0x90')]({'where':{'id':{'$in':_0x5c0e6e}}});})['then'](function(_0x3ec258){var _0x3b2fbd=_[_0x9452('0x34')](_0x3ec258,function(_0x35f193){return _0x35f193[_0x9452('0x11b')]();});return Promise[_0x9452('0x56')](_0x3b2fbd);})[_0x9452('0x17')](function(_0x11e50e){_0x4f925e=_['flattenDeep'](_0x11e50e);var _0x3eedc6=_[_0x9452('0x34')](_0x4f925e,function(_0x345821){return _0x345821[_0x9452('0x11c')](_0x301c65['id'],{'transaction':_0x5d41ad});});return Promise[_0x9452('0x56')](_0x3eedc6);})[_0x9452('0x17')](function(){if(!_0x301c65[_0x9452('0xa3')])return;var _0x33be5d=_[_0x9452('0x3f')](_0x4f925e,function(_0x2c7591){return _0x2c7591[_0x9452('0x11d')](_0x9452('0xb2'))===_0x9452('0x11e');});var _0x5a0046=_[_0x9452('0x34')](_0x33be5d,function(_0x14f3ce){return db[_0x9452('0xb7')][_0x9452('0x102')]({'membername':_0x301c65['name'],'UserId':_0x301c65['id'],'queue_name':_0x14f3ce[_0x9452('0x36')],'VoiceQueueId':_0x14f3ce['id'],'interface':_[_0x9452('0x6f')](_0x301c65[_0x9452('0xa4')])?util[_0x9452('0xd0')](_0x9452('0xaf'),_0x301c65['name']):_0x301c65['interface'],'paused':_0x301c65[_0x9452('0xb0')]||![],'penalty':_0x301c65[_0x9452('0xa7')]},{'transaction':_0x5d41ad});});return Promise['all'](_0x5a0046);})[_0x9452('0x17')](function(){return db['TeamVoicePrefix'][_0x9452('0x90')]({'where':{'teamId':{'$in':_0x5c0e6e}}});})[_0x9452('0x17')](function(_0x4fc5bd){var _0x2f0ebc=_[_0x9452('0x34')](_0x4fc5bd,function(_0x34ff80){return db[_0x9452('0x11f')][_0x9452('0x81')]({'UserId':_0x301c65['id'],'VoicePrefixId':_0x34ff80[_0x9452('0x120')]},{'transaction':_0x5d41ad});});return Promise[_0x9452('0x56')](_0x2f0ebc);});});})['then'](function(){for(var _0x1a2d18=0x0;_0x1a2d18<_0x4f925e[_0x9452('0x4e')];_0x1a2d18++){var _0x5d2e33=_0x4f925e[_0x1a2d18][_0x9452('0x11d')](_0x9452('0xb2'));var _0x2f42c7=_0x5d2e33+_0x9452('0xaa');socket[_0x9452('0xab')](_0x9452('0x31')+_0x5d2e33+_0x9452('0xac'),{'UserId':_0x4b587d,['queueField']:_0x4f925e[_0x1a2d18]['id']});}})['then'](respondWithStatusCode(_0x4e5366,null))[_0x9452('0x57')](APIHandleError(_0x4e5366));};exports[_0x9452('0x121')]=function(_0x4dd38f,_0x564924){var _0xc941e0=_0x4dd38f['params']['id'];var _0x21626f=null;if(_0x4dd38f[_0x9452('0x45')][_0x9452('0x66')]){_0x21626f=_[_0x9452('0xb5')](_0x4dd38f['query'][_0x9452('0x66')])?_0x4dd38f[_0x9452('0x45')][_0x9452('0x66')]:[_0x4dd38f[_0x9452('0x45')]['ids']];}var _0x104a51=[];return Promise[_0x9452('0x109')]()[_0x9452('0x17')](function(){if(!_0x21626f)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0xc941e0}});})[_0x9452('0x17')](function(_0x53760e){if(!_0x53760e)throw new APINotFoundError(util[_0x9452('0xd0')](_0x9452('0xd1'),_0x4dd38f[_0x9452('0x59')]['id']));return db[_0x9452('0x6c')]['transaction'](function(_0x5a08c2){return _0x53760e[_0x9452('0x121')](_0x21626f,{'transaction':_0x5a08c2})[_0x9452('0x17')](function(){return db[_0x9452('0x11a')][_0x9452('0x90')]({'where':{'id':{'$in':_0x21626f}}});})['then'](function(_0x1b56c2){var _0x15da0e=_[_0x9452('0x34')](_0x1b56c2,function(_0x5cac6e){return _0x5cac6e[_0x9452('0x11b')]();});return Promise[_0x9452('0x56')](_0x15da0e);})['then'](function(_0x3130b9){_0x104a51=_[_0x9452('0x122')](_0x3130b9);var _0x40484f=_[_0x9452('0x34')](_0x104a51,function(_0x1b0dab){return _0x1b0dab[_0x9452('0x123')](_0x53760e['id'],{'transaction':_0x5a08c2});});return Promise['all'](_0x40484f);})['then'](function(){if(!_0x53760e[_0x9452('0xa3')])return;var _0x151647=_[_0x9452('0x3f')](_0x104a51,function(_0x57e9ac){return _0x57e9ac[_0x9452('0x11d')](_0x9452('0xb2'))===_0x9452('0x11e');});var _0x1dfc5b=_[_0x9452('0x34')](_0x151647,function(_0x21f227){return db[_0x9452('0xb7')][_0x9452('0x2e')]({'where':{'VoiceQueueId':_0x21f227['id'],'UserId':_0x53760e['id']},'transaction':_0x5a08c2});});return Promise[_0x9452('0x56')](_0x1dfc5b);})[_0x9452('0x17')](function(){return db[_0x9452('0x124')][_0x9452('0x90')]({'where':{'teamId':{'$in':_0x21626f}}});})[_0x9452('0x17')](function(_0x509def){var _0x4ee003=_[_0x9452('0x34')](_0x509def,function(_0x26ca01){return db[_0x9452('0x11f')][_0x9452('0x2e')]({'where':{'UserId':_0x53760e['id'],'VoicePrefixId':_0x26ca01[_0x9452('0x120')]}},{'transaction':_0x5a08c2});});return Promise['all'](_0x4ee003);});});})[_0x9452('0x17')](function(){for(var _0x1f8480=0x0;_0x1f8480<_0x104a51['length'];_0x1f8480++){var _0x49325e=_0x104a51[_0x1f8480][_0x9452('0x11d')](_0x9452('0xb2'));var _0xd9bcba=_0x49325e+'QueueId';socket[_0x9452('0xab')]('user'+_0x49325e+_0x9452('0xb6'),{'UserId':_0xc941e0,['queueField']:_0x104a51[_0x1f8480]['id']});}})[_0x9452('0x17')](respondWithStatusCode(_0x564924,null))[_0x9452('0x57')](APIHandleError(_0x564924));};exports[_0x9452('0x125')]=function(_0x5a3eaf,_0x5c2d20){var _0x5040ae={};var _0x898df={};var _0x1cca8c;var _0x3f0146;return db['User']['findOne']({'where':{'id':_0x5a3eaf[_0x9452('0x59')]['id']}})[_0x9452('0x17')](handleEntityNotFound(_0x5c2d20,null))[_0x9452('0x17')](function(_0x3223f2){if(_0x3223f2){_0x1cca8c=_0x3223f2;_0x898df[_0x9452('0x5a')]=_[_0x9452('0x5c')](db[_0x9452('0xd3')][_0x9452('0x3c')]);_0x898df[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x5a3eaf['query']);_0x898df[_0x9452('0x5d')]=_[_0x9452('0x5e')](_0x898df[_0x9452('0x5a')],_0x898df[_0x9452('0x45')]);_0x5040ae['attributes']=_[_0x9452('0x5e')](_0x898df[_0x9452('0x5a')],qs[_0x9452('0x5f')](_0x5a3eaf[_0x9452('0x45')][_0x9452('0x5f')]));_0x5040ae[_0x9452('0x4b')]=_0x5040ae[_0x9452('0x4b')][_0x9452('0x4e')]?_0x5040ae[_0x9452('0x4b')]:_0x898df[_0x9452('0x5a')];_0x5040ae[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x5a3eaf[_0x9452('0x45')][_0x9452('0xdc')]);_0x5040ae['where']=qs[_0x9452('0x5d')](_[_0x9452('0xdd')](_0x5a3eaf[_0x9452('0x45')],_0x898df[_0x9452('0x5d')]));if(_0x5a3eaf[_0x9452('0x45')]['filter']){_0x5040ae[_0x9452('0x44')]=_[_0x9452('0xde')](_0x5040ae[_0x9452('0x44')],{'$or':_[_0x9452('0x34')](_0x5040ae[_0x9452('0x4b')],function(_0x20f61f){var _0x34e528={};_0x34e528[_0x20f61f]={'$like':'%'+_0x5a3eaf[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x34e528;})});}_0x5040ae=_[_0x9452('0xde')]({},_0x5040ae,_0x5a3eaf['options']);return _0x1cca8c['getLists'](_0x5040ae);}})[_0x9452('0x17')](function(_0x3ddf66){if(_0x3ddf66){_0x3f0146=_0x3ddf66[_0x9452('0x4e')];if(!_0x5a3eaf[_0x9452('0x45')][_0x9452('0xd2')](_0x9452('0xe0'))){_0x5040ae[_0x9452('0xe1')]=qs[_0x9452('0xe1')](_0x5a3eaf[_0x9452('0x45')][_0x9452('0xe1')]);_0x5040ae[_0x9452('0x24')]=qs[_0x9452('0x24')](_0x5a3eaf[_0x9452('0x45')][_0x9452('0x24')]);}return _0x1cca8c[_0x9452('0x125')](_0x5040ae);}})[_0x9452('0x17')](function(_0xedae9d){if(_0xedae9d){return _0xedae9d?{'count':_0x3f0146,'rows':_0xedae9d}:null;}})[_0x9452('0x17')](respondWithResult(_0x5c2d20,null))[_0x9452('0x57')](handleError(_0x5c2d20,null));};exports[_0x9452('0x126')]=function(_0x100f8f,_0x4f2e01){var _0x5a7e0d={};var _0x24c728={};var _0x62deba;return db[_0x9452('0x3b')][_0x9452('0x9b')]({'where':{'id':_0x100f8f[_0x9452('0x59')]['id']}})['then'](handleEntityNotFound(_0x4f2e01,null))[_0x9452('0x17')](function(_0x5f2717){if(_0x5f2717){_0x62deba=_0x5f2717;_0x24c728[_0x9452('0x5a')]=_[_0x9452('0x5c')](db['User']['rawAttributes']);_0x24c728[_0x9452('0x45')]=_[_0x9452('0x5c')](_0x100f8f['query']);_0x24c728[_0x9452('0x5d')]=_['intersection'](_0x24c728[_0x9452('0x5a')],_0x24c728['query']);_0x5a7e0d[_0x9452('0x4b')]=_[_0x9452('0x5e')](_0x24c728['model'],qs[_0x9452('0x5f')](_0x100f8f[_0x9452('0x45')][_0x9452('0x5f')]));_0x5a7e0d[_0x9452('0x4b')]=_0x5a7e0d[_0x9452('0x4b')][_0x9452('0x4e')]?_0x5a7e0d[_0x9452('0x4b')]:_0x24c728[_0x9452('0x5a')];_0x5a7e0d[_0x9452('0xdb')]=qs[_0x9452('0xdc')](_0x100f8f[_0x9452('0x45')][_0x9452('0xdc')]);_0x5a7e0d['where']=qs[_0x9452('0x5d')](_['pick'](_0x100f8f[_0x9452('0x45')],_0x24c728[_0x9452('0x5d')]));if(_0x100f8f[_0x9452('0x45')][_0x9452('0x3f')]){_0x5a7e0d[_0x9452('0x44')]=_[_0x9452('0xde')](_0x5a7e0d[_0x9452('0x44')],{'$or':_['map'](_0x5a7e0d[_0x9452('0x4b')],function(_0x422d96){var _0x34d469={};_0x34d469[_0x422d96]={'$like':'%'+_0x100f8f[_0x9452('0x45')][_0x9452('0x3f')]+'%'};return _0x34d469;})});}_0x5a7e0d[_0x9452('0x5a')]=db[_0x9452('0x3b')];_0x5a7e0d['as']=_0x9452('0x89');_0x5a7e0d=_['merge']({},_0x5a7e0d,_0x100f8f[_0x9452('0x60')]);return _0x62deba[_0x9452('0x100')]({'include':[_0x5a7e0d]});}})[_0x9452('0x17')](function(_0x3e00d0){if(_0x3e00d0){var _0x10126c={},_0x2a1669=[];for(var _0x493313=0x0;_0x493313<_0x3e00d0[_0x9452('0x4e')];_0x493313+=0x1){for(var _0x3c4e98=0x0,_0x2e74ab;_0x3c4e98<_0x3e00d0[_0x493313][_0x9452('0x89')][_0x9452('0x4e')];_0x3c4e98+=0x1){_0x2e74ab=_0x3e00d0[_0x493313][_0x9452('0x89')][_0x3c4e98]['get']({'plain':!![]});_0x10126c[_0x2e74ab['id']]=_0x2e74ab;}}_0x10126c=_[_0x9452('0x127')](_0x10126c);for(var _0x2b75f8=qs[_0x9452('0x24')](_0x100f8f[_0x9452('0x45')][_0x9452('0x24')]);_0x2b75f8<_0x10126c[_0x9452('0x4e')]&&_0x2a1669[_0x9452('0x4e')]=_0x5f362c['agents']){throw new Error(_0xd13f('0x4b'));}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return db[_0xd13f('0x27')][_0xd13f('0x42')]({'where':{'membername':_0x45eabd[_0xd13f('0x20')]},'individualHooks':!![]});}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return _0x45eabd[_0xd13f('0x4c')]({'raw':!![]});}})['then'](function(_0x201b72){if(_0x45eabd){if(_0x201b72){var _0x38b28a=[];_0x8c3ee4=_0x201b72;if(_0x8c3ee4[_0xd13f('0x2b')]){for(var _0x2ebc2d=0x0;_0x2ebc2d<_0x8c3ee4[_0xd13f('0x2b')];_0x2ebc2d++){_0x38b28a[_0xd13f('0x2d')](db[_0xd13f('0x27')][_0xd13f('0x4d')]({'membername':_0x45eabd[_0xd13f('0x20')],'UserId':_0x45eabd['id'],'queue_name':_0x8c3ee4[_0x2ebc2d]['name'],'VoiceQueueId':_0x8c3ee4[_0x2ebc2d]['id'],'interface':_0x5d7780,'paused':_0x45eabd['loginInPause']||![],'penalty':_0x8c3ee4[_0x2ebc2d][_0xd13f('0x4e')]||0x0}));}return BPromise[_0xd13f('0x44')](_0x38b28a);}}}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return db[_0xd13f('0x29')][_0xd13f('0xe')]({'where':{'membername':_0x45eabd[_0xd13f('0x20')],'exitAt':null}});}})['then'](function(_0xaa0906){if(_0x45eabd){if(_0xaa0906&&_0xaa0906[_0xd13f('0x2b')]){var _0x4f2313=[];_0xaa0906['forEach'](function(_0x1c9180){_0x4f2313[_0xd13f('0x2d')](_0x1c9180[_0xd13f('0x28')]({'exitAt':moment()[_0xd13f('0x24')](_0xd13f('0x34'))}));});return BPromise[_0xd13f('0x44')](_0x4f2313);}}})[_0xd13f('0x1d')](function(){if(_0x45eabd){var _0x339b8b=[];var _0x1ddcbd=[];var _0x1e5f76=utils[_0xd13f('0x4f')]();var _0x361389={'membername':_0x45eabd[_0xd13f('0x20')],'interface':_0x5d7780,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x45eabd[_0xd13f('0x21')],'internal':_0x45eabd[_0xd13f('0x22')]};_0x1e5f76[_0xd13f('0x43')](function(_0x1a2650){_0x339b8b['push'](_['merge']({'channel':_0x1a2650,'type':_0xd13f('0x50'),'data1':'callysquare','data2':_0x5d7780},_0x361389));if(_0x45eabd[_0xd13f('0x48')]){_0x1ddcbd['push'](_['merge']({'channel':_0x1a2650,'type':_0xd13f('0x2a'),'data1':_0xd13f('0x51')},_0x361389));}});return db['MemberReport']['bulkCreate'](_0x339b8b['concat'](_0x1ddcbd),{'individualHooks':!![]});}})[_0xd13f('0x1d')](function(){if(_0x45eabd){return _0x45eabd[_0xd13f('0x28')]({'online':!![],'lastLoginAt':moment()[_0xd13f('0x24')](_0xd13f('0x34')),'voicePause':_0x45eabd[_0xd13f('0x48')]||![],'mailPause':_0x45eabd[_0xd13f('0x48')]||![],'chatPause':_0x45eabd[_0xd13f('0x48')]||![],'faxPause':_0x45eabd['loginInPause']||![],'smsPause':_0x45eabd[_0xd13f('0x48')]||![],'openchannelPause':_0x45eabd[_0xd13f('0x48')]||![],'pauseType':_0x45eabd[_0xd13f('0x48')]?_0xd13f('0x51'):null,'lastPauseAt':moment()[_0xd13f('0x24')](_0xd13f('0x34')),'interface':_0x5d7780});}})[_0xd13f('0x1d')](function(_0x369b06){_0x56781a(_0x369b06);})[_0xd13f('0x18')](function(_0x59aecd){_0x92fd34(_0x5c256c[_0xd13f('0x1a')](0x1f4,_0x59aecd[_0xd13f('0x19')]));});});}; \ No newline at end of file +var _0x07a2=['options','where','attributes','limit','map','include','model','GetUser','debug','stringify','error','message','ShowUser','raw','then','catch','PauseUser','find','name','role','internal','interface','format','params','UserVoiceQueueRt','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','DEFAULT\x20PAUSE','uniqueid','bulkCreate','body','type','UnpauseUser','resolve','channel','isValidChannel','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastPauseAt','unpause','system','findOne','destroy','update','all','mobile','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','defaults','redis','./user.socket','User','findAll'];(function(_0x1e650b,_0x541c8b){var _0x4568ce=function(_0x53b2f8){while(--_0x53b2f8){_0x1e650b['push'](_0x1e650b['shift']());}};_0x4568ce(++_0x541c8b);}(_0x07a2,0x19c));var _0x207a=function(_0x308bc6,_0x564ec7){_0x308bc6=_0x308bc6-0x0;var _0x422fcf=_0x07a2[_0x308bc6];return _0x422fcf;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var moment=require('moment');var BPromise=require(_0x207a('0x2'));var Redis=require(_0x207a('0x3'));var db=require(_0x207a('0x4'))['db'];var utils=require(_0x207a('0x5'));var logger=require(_0x207a('0x6'))(_0x207a('0x7'));var config=require('../../config/environment');config['redis']=_[_0x207a('0x8')](config[_0x207a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x207a('0x9')]));require(_0x207a('0xa'))['register'](socket);exports['GetUser']=function(_0x11568e){var _0x2d21aa=this;return new Promise(function(_0x1ae908,_0x119525){return db[_0x207a('0xb')][_0x207a('0xc')]({'raw':_0x11568e[_0x207a('0xd')]?_0x11568e[_0x207a('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x11568e[_0x207a('0xd')]?_0x11568e['options'][_0x207a('0xe')]||null:null,'attributes':_0x11568e[_0x207a('0xd')]?_0x11568e[_0x207a('0xd')][_0x207a('0xf')]||null:null,'limit':_0x11568e[_0x207a('0xd')]?_0x11568e['options'][_0x207a('0x10')]||null:null,'include':_0x11568e[_0x207a('0xd')]?_0x11568e[_0x207a('0xd')]['include']?_[_0x207a('0x11')](_0x11568e['options'][_0x207a('0x12')],function(_0x4b01fb){return{'model':db[_0x4b01fb['model']],'as':_0x4b01fb['as'],'attributes':_0x4b01fb[_0x207a('0xf')],'include':_0x4b01fb[_0x207a('0x12')]?_[_0x207a('0x11')](_0x4b01fb[_0x207a('0x12')],function(_0x4605e1){return{'model':db[_0x4605e1[_0x207a('0x13')]],'as':_0x4605e1['as'],'attributes':_0x4605e1['attributes'],'include':_0x4605e1[_0x207a('0x12')]?_['map'](_0x4605e1[_0x207a('0x12')],function(_0x4d17c6){return{'model':db[_0x4d17c6[_0x207a('0x13')]],'as':_0x4d17c6['as'],'attributes':_0x4d17c6[_0x207a('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x269c88){logger['info'](_0x207a('0x14'),_0x11568e);logger[_0x207a('0x15')]('GetUser',_0x11568e,JSON[_0x207a('0x16')](_0x269c88));_0x1ae908(_0x269c88);})['catch'](function(_0x5128c7){logger[_0x207a('0x17')](_0x207a('0x14'),_0x5128c7[_0x207a('0x18')],_0x11568e);_0x119525(_0x2d21aa['error'](0x1f4,_0x5128c7[_0x207a('0x18')]));});});};exports[_0x207a('0x19')]=function(_0x2214ca){var _0x2e63c4=this;return new Promise(function(_0x17d2c0,_0x57aa1b){return db[_0x207a('0xb')]['find']({'raw':_0x2214ca['options']?_0x2214ca[_0x207a('0xd')][_0x207a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2214ca[_0x207a('0xd')]?_0x2214ca['options'][_0x207a('0xe')]||null:null,'attributes':_0x2214ca['options']?_0x2214ca['options'][_0x207a('0xf')]||null:null,'include':_0x2214ca['options']?_0x2214ca['options'][_0x207a('0x12')]?_[_0x207a('0x11')](_0x2214ca['options'][_0x207a('0x12')],function(_0x232dc5){return{'model':db[_0x232dc5[_0x207a('0x13')]],'as':_0x232dc5['as'],'attributes':_0x232dc5[_0x207a('0xf')],'include':_0x232dc5[_0x207a('0x12')]?_[_0x207a('0x11')](_0x232dc5[_0x207a('0x12')],function(_0x236cd6){return{'model':db[_0x236cd6[_0x207a('0x13')]],'as':_0x236cd6['as'],'attributes':_0x236cd6[_0x207a('0xf')],'include':_0x236cd6['include']?_['map'](_0x236cd6[_0x207a('0x12')],function(_0x401786){return{'model':db[_0x401786[_0x207a('0x13')]],'as':_0x401786['as'],'attributes':_0x401786['attributes']};}):[]};}):[]};}):[]:[]})[_0x207a('0x1b')](function(_0x59de8f){logger['info'](_0x207a('0x19'),_0x2214ca);logger[_0x207a('0x15')](_0x207a('0x19'),_0x2214ca,JSON['stringify'](_0x59de8f));_0x17d2c0(_0x59de8f);})[_0x207a('0x1c')](function(_0x555a6c){logger[_0x207a('0x17')](_0x207a('0x19'),_0x555a6c[_0x207a('0x18')],_0x2214ca);_0x57aa1b(_0x2e63c4[_0x207a('0x17')](0x1f4,_0x555a6c[_0x207a('0x18')]));});});};exports[_0x207a('0x1d')]=function(_0x56464f){var _0x1f1244;return db[_0x207a('0xb')][_0x207a('0x1e')]({'where':_0x56464f[_0x207a('0xd')][_0x207a('0xe')]||{},'attributes':['id',_0x207a('0x1f'),_0x207a('0x20'),_0x207a('0x21'),_0x207a('0x22')]})[_0x207a('0x1b')](function(_0x1731ee){if(!_0x1731ee){throw new Error(util[_0x207a('0x23')]('User\x20with\x20id\x20%s\x20not\x20found',_0x56464f[_0x207a('0x24')]['id']));}_0x1f1244=_0x1731ee;return db[_0x207a('0x25')]['update']({'paused':0x1},{'where':{'UserId':_0x1f1244['id']},'individualHooks':!![]});})['then'](function(){return db[_0x207a('0x26')]['findAll']({'where':{'membername':_0x1f1244[_0x207a('0x1f')],'type':_0x207a('0x27'),'exitAt':null}});})[_0x207a('0x1b')](function(_0x690db3){if(_0x690db3&&_0x690db3[_0x207a('0x28')]){var _0x482a8d=moment()[_0x207a('0x23')](_0x207a('0x29'));for(var _0x1c4cd4=0x0,_0xa114e3=_0x690db3['length'];_0x1c4cd4<_0xa114e3;_0x1c4cd4++){_0x690db3[_0x1c4cd4][_0x207a('0x2a')]({'exitAt':_0x482a8d});}}})[_0x207a('0x1b')](function(){var _0x34fc3a=[];var _0x3141de=utils[_0x207a('0x2b')]();_0x3141de[_0x207a('0x2c')](function(_0x5c42fc){_0x34fc3a[_0x207a('0x2d')]({'channel':_0x5c42fc,'membername':_0x1f1244['name'],'interface':_[_0x207a('0x2e')](_0x1f1244[_0x207a('0x22')])?util[_0x207a('0x23')](_0x207a('0x2f'),_0x1f1244[_0x207a('0x1f')]):_0x1f1244[_0x207a('0x22')],'type':_0x207a('0x27'),'enterAt':moment()[_0x207a('0x23')](_0x207a('0x29')),'data1':_0x56464f['body']['type']||_0x207a('0x30'),'role':_0x1f1244[_0x207a('0x20')],'internal':_0x1f1244[_0x207a('0x21')],'uniqueid':_0x56464f['body'][_0x207a('0x31')]||null});});return db[_0x207a('0x26')][_0x207a('0x32')](_0x34fc3a,{'individualHooks':!![]});})[_0x207a('0x1b')](function(){return _0x1f1244['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x56464f[_0x207a('0x33')][_0x207a('0x34')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x207a('0x23')](_0x207a('0x29'))});})[_0x207a('0x1c')](function(_0x5b20d4){throw _0x5b20d4;});};exports[_0x207a('0x35')]=function(_0x151eb0){return Promise[_0x207a('0x36')]()[_0x207a('0x1b')](function(){if(_0x151eb0['body'][_0x207a('0x37')]&&!utils[_0x207a('0x38')](_0x151eb0[_0x207a('0x33')][_0x207a('0x37')])){throw new Error(util[_0x207a('0x23')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x151eb0[_0x207a('0x33')][_0x207a('0x37')]));}return db['User']['findOne']({'where':_0x151eb0[_0x207a('0xd')][_0x207a('0xe')]||{},'attributes':['id',_0x207a('0x1f'),'role',_0x207a('0x21'),'interface','online',_0x207a('0x39'),'mailPause',_0x207a('0x3a'),_0x207a('0x3b'),_0x207a('0x3c'),'smsPause','whatsappPause',_0x207a('0x3d'),_0x207a('0x3e')]});})[_0x207a('0x1b')](function(_0x1480b0){if(!_0x1480b0){throw new Error(util[_0x207a('0x23')]('User\x20with\x20id\x20%s\x20not\x20found',_0x151eb0[_0x207a('0x24')]['id']));}return _0x1480b0[_0x207a('0x3f')](_0x151eb0[_0x207a('0x33')]['channel'],_0x207a('0x40'));})[_0x207a('0x1c')](function(_0xd1b835){throw _0xd1b835;});};exports['LogoutUser']=function(_0x12ecdd){var _0x586e92=this;return new Promise(function(_0x8de469,_0x382525){var _0x47a36c;return db[_0x207a('0xb')][_0x207a('0x41')]({'where':_0x12ecdd[_0x207a('0xd')][_0x207a('0xe')]||{},'attributes':['id',_0x207a('0x1f')]})[_0x207a('0x1b')](function(_0x592d8e){if(_0x592d8e){_0x47a36c=_0x592d8e;return db[_0x207a('0x25')][_0x207a('0x42')]({'where':{'membername':_0x47a36c[_0x207a('0x1f')]},'individualHooks':!![]});}})[_0x207a('0x1b')](function(){if(_0x47a36c){return db[_0x207a('0x26')]['findAll']({'where':{'membername':_0x47a36c[_0x207a('0x1f')],'exitAt':null}});}})[_0x207a('0x1b')](function(_0x58d920){if(_0x47a36c){if(_0x58d920&&_0x58d920[_0x207a('0x28')]){var _0x5cb5d6=[];_0x58d920[_0x207a('0x2c')](function(_0x2c9506){_0x5cb5d6[_0x207a('0x2d')](_0x2c9506[_0x207a('0x43')]({'exitAt':moment()['format'](_0x207a('0x29'))}));});return BPromise[_0x207a('0x44')](_0x5cb5d6);}}})[_0x207a('0x1b')](function(){if(_0x47a36c){return _0x47a36c[_0x207a('0x43')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2ec377){_0x8de469(_0x2ec377);})['catch'](function(_0x577cca){_0x382525(_0x586e92['error'](0x1f4,_0x577cca[_0x207a('0x18')]));});});};exports['LoginUser']=function(_0x392d06){var _0x140d84=this;return new Promise(function(_0x558675,_0x5d8337){var _0x48aaf1;var _0x42f47d;var _0x3238e1;var _0x1392de;return db[_0x207a('0xb')][_0x207a('0x41')]({'where':_0x392d06[_0x207a('0xd')][_0x207a('0xe')]||{},'attributes':['id',_0x207a('0x1f'),_0x207a('0x20'),_0x207a('0x45'),_0x207a('0x46'),'internal','loginInPause',_0x207a('0x22')]})[_0x207a('0x1b')](function(_0x4b7524){if(_0x4b7524){_0x48aaf1=_0x4b7524;_0x1392de=_0x392d06[_0x207a('0x33')][_0x207a('0x22')]?_0x392d06[_0x207a('0x33')]['interface']:util['format'](_0x207a('0x2f'),_0x48aaf1['name']);return db['User'][_0x207a('0x47')]({'where':{'role':_0x207a('0x48'),'online':!![],'id':{'$ne':_0x48aaf1['id']}}});}})['then'](function(_0x254860){if(_0x254860){_0x3238e1=_0x254860;return require(_0x207a('0x49'))[_0x207a('0x4a')]();}})[_0x207a('0x1b')](function(_0x539bfb){if(_0x539bfb&&_0x539bfb[_0x207a('0x4b')]&&_0x3238e1>=_0x539bfb[_0x207a('0x4b')]){throw new Error(_0x207a('0x4c'));}})[_0x207a('0x1b')](function(){if(_0x48aaf1){return db[_0x207a('0x25')][_0x207a('0x42')]({'where':{'membername':_0x48aaf1[_0x207a('0x1f')]},'individualHooks':!![]});}})[_0x207a('0x1b')](function(){if(_0x48aaf1){return _0x48aaf1[_0x207a('0x4d')]({'raw':!![]});}})['then'](function(_0x3ad384){if(_0x48aaf1){if(_0x3ad384){var _0x3fa361=[];_0x42f47d=_0x3ad384;if(_0x42f47d[_0x207a('0x28')]){for(var _0x339b02=0x0;_0x339b02<_0x42f47d[_0x207a('0x28')];_0x339b02++){_0x3fa361['push'](db[_0x207a('0x25')]['upsert']({'membername':_0x48aaf1[_0x207a('0x1f')],'UserId':_0x48aaf1['id'],'queue_name':_0x42f47d[_0x339b02][_0x207a('0x1f')],'VoiceQueueId':_0x42f47d[_0x339b02]['id'],'interface':_0x1392de,'paused':_0x48aaf1[_0x207a('0x4e')]||![],'penalty':_0x42f47d[_0x339b02][_0x207a('0x4f')]||0x0}));}return BPromise[_0x207a('0x44')](_0x3fa361);}}}})[_0x207a('0x1b')](function(){if(_0x48aaf1){return db['MemberReport']['findAll']({'where':{'membername':_0x48aaf1[_0x207a('0x1f')],'exitAt':null}});}})['then'](function(_0x5a6688){if(_0x48aaf1){if(_0x5a6688&&_0x5a6688[_0x207a('0x28')]){var _0x569b9c=[];_0x5a6688[_0x207a('0x2c')](function(_0x31312c){_0x569b9c[_0x207a('0x2d')](_0x31312c['update']({'exitAt':moment()[_0x207a('0x23')](_0x207a('0x29'))}));});return BPromise[_0x207a('0x44')](_0x569b9c);}}})['then'](function(){if(_0x48aaf1){var _0x4acdd8=[];var _0x478603=[];var _0xc46fbd=utils['getChannels']();var _0x47fb7c={'membername':_0x48aaf1[_0x207a('0x1f')],'interface':_0x1392de,'enterAt':moment()[_0x207a('0x23')](_0x207a('0x29')),'role':_0x48aaf1[_0x207a('0x20')],'internal':_0x48aaf1['internal']};_0xc46fbd['forEach'](function(_0x3c12f3){_0x4acdd8['push'](_[_0x207a('0x50')]({'channel':_0x3c12f3,'type':_0x207a('0x51'),'data1':_0x207a('0x52'),'data2':_0x1392de},_0x47fb7c));if(_0x48aaf1[_0x207a('0x4e')]){_0x478603[_0x207a('0x2d')](_['merge']({'channel':_0x3c12f3,'type':_0x207a('0x27'),'data1':_0x207a('0x53')},_0x47fb7c));}});return db['MemberReport'][_0x207a('0x32')](_0x4acdd8[_0x207a('0x54')](_0x478603),{'individualHooks':!![]});}})['then'](function(){if(_0x48aaf1){return _0x48aaf1['update']({'online':!![],'lastLoginAt':moment()[_0x207a('0x23')](_0x207a('0x29')),'voicePause':_0x48aaf1[_0x207a('0x4e')]||![],'mailPause':_0x48aaf1['loginInPause']||![],'chatPause':_0x48aaf1[_0x207a('0x4e')]||![],'faxPause':_0x48aaf1[_0x207a('0x4e')]||![],'smsPause':_0x48aaf1['loginInPause']||![],'openchannelPause':_0x48aaf1['loginInPause']||![],'pauseType':_0x48aaf1[_0x207a('0x4e')]?_0x207a('0x53'):null,'lastPauseAt':moment()[_0x207a('0x23')](_0x207a('0x29')),'interface':_0x1392de});}})[_0x207a('0x1b')](function(_0x16567e){_0x558675(_0x16567e);})[_0x207a('0x1c')](function(_0x3c879f){_0x5d8337(_0x140d84[_0x207a('0x17')](0x1f4,_0x3c879f['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a0a4c40..2347daa 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 _0x9232=['length','user:','save','remove','update','removeListener'];(function(_0x24c135,_0x5c78ae){var _0x3cc0b7=function(_0x5cd68b){while(--_0x5cd68b){_0x24c135['push'](_0x24c135['shift']());}};_0x3cc0b7(++_0x5c78ae);}(_0x9232,0x1d0));var _0x2923=function(_0x7b5ee0,_0x32bbcc){_0x7b5ee0=_0x7b5ee0-0x0;var _0x3c995a=_0x9232[_0x7b5ee0];return _0x3c995a;};'use strict';var UserEvents=require('./user.events');var events=[_0x2923('0x0'),_0x2923('0x1'),_0x2923('0x2')];function createListener(_0x53b517,_0x2d6638){return function(_0x9b4f5c){_0x2d6638['emit'](_0x53b517,_0x9b4f5c);};}function removeListener(_0x5d622d,_0x3eae48){return function(){UserEvents[_0x2923('0x3')](_0x5d622d,_0x3eae48);};}exports['register']=function(_0x1f7f76){for(var _0xf588c6=0x0,_0xef60b9=events[_0x2923('0x4')];_0xf588c6<_0xef60b9;_0xf588c6++){var _0x4684f0=events[_0xf588c6];var _0xdadcec=createListener(_0x2923('0x5')+_0x4684f0,_0x1f7f76);UserEvents['on'](_0x4684f0,_0xdadcec);}}; \ No newline at end of file +var _0x142a=['register','length','user:','./user.events','save','remove','update','removeListener'];(function(_0x213543,_0x4b91e3){var _0x238b2e=function(_0xc42d7){while(--_0xc42d7){_0x213543['push'](_0x213543['shift']());}};_0x238b2e(++_0x4b91e3);}(_0x142a,0x1eb));var _0xa142=function(_0x2d7043,_0x3e666d){_0x2d7043=_0x2d7043-0x0;var _0x30b07e=_0x142a[_0x2d7043];return _0x30b07e;};'use strict';var UserEvents=require(_0xa142('0x0'));var events=[_0xa142('0x1'),_0xa142('0x2'),_0xa142('0x3')];function createListener(_0x3a7d85,_0x5e161b){return function(_0xb2e1d2){_0x5e161b['emit'](_0x3a7d85,_0xb2e1d2);};}function removeListener(_0xa9c312,_0x13d883){return function(){UserEvents[_0xa142('0x4')](_0xa9c312,_0x13d883);};}exports[_0xa142('0x5')]=function(_0x39d346){for(var _0x2db346=0x0,_0x2f1dea=events[_0xa142('0x6')];_0x2db346<_0x2f1dea;_0x2db346++){var _0x2c3cbb=events[_0x2db346];var _0x4f3ee8=createListener(_0xa142('0x7')+_0x2c3cbb,_0x39d346);UserEvents['on'](_0x2c3cbb,_0x4f3ee8);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index c7f362a..890c40e 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x521897,_0x37a068){var _0x371b73=function(_0x289d71){while(--_0x289d71){_0x521897['push'](_0x521897['shift']());}};_0x371b73(++_0x37a068);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x596c95,_0x3c6e57){var _0x45484a=function(_0x3b7bd9){while(--_0x3b7bd9){_0x596c95['push'](_0x596c95['shift']());}};_0x45484a(++_0x3c6e57);}(_0xe706,0xa3));var _0x6e70=function(_0xfec4f2,_0x27b2aa){_0xfec4f2=_0xfec4f2-0x0;var _0x4ee052=_0xe706[_0xfec4f2];return _0x4ee052;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f4bbc5b..db673d6 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 _0xb99d=['sequelize','INTEGER'];(function(_0x1af420,_0x4ad7c5){var _0x572d5f=function(_0x21f872){while(--_0x21f872){_0x1af420['push'](_0x1af420['shift']());}};_0x572d5f(++_0x4ad7c5);}(_0xb99d,0xb8));var _0xdb99=function(_0x23bf40,_0xf05f78){_0x23bf40=_0x23bf40-0x0;var _0x33ca5c=_0xb99d[_0x23bf40];return _0x33ca5c;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdb99('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x574b=['exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x574b,0xea));var _0xb574=function(_0xf67170,_0x476e08){_0xf67170=_0xf67170-0x0;var _0x22156b=_0x574b[_0xf67170];return _0x22156b;};'use strict';var Sequelize=require('sequelize');module[_0xb574('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 8de9c0b..b10d95c 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 _0x0a7c=['rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','lodash','api','bluebird','request-promise','path'];(function(_0x2736e0,_0x248150){var _0x23f8de=function(_0x182b17){while(--_0x182b17){_0x2736e0['push'](_0x2736e0['shift']());}};_0x23f8de(++_0x248150);}(_0x0a7c,0xcd));var _0xc0a7=function(_0x291b8f,_0x3b8484){_0x291b8f=_0x291b8f-0x0;var _0x3b504b=_0x0a7c[_0x291b8f];return _0x3b504b;};'use strict';var _=require(_0xc0a7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0a7('0x1'));var moment=require('moment');var BPromise=require(_0xc0a7('0x2'));var rp=require(_0xc0a7('0x3'));var fs=require('fs');var path=require(_0xc0a7('0x4'));var rimraf=require(_0xc0a7('0x5'));var config=require(_0xc0a7('0x6'));var attributes=require(_0xc0a7('0x7'));module[_0xc0a7('0x8')]=function(_0xf752b,_0x1ffd74){return _0xf752b['define']('UserChatQueue',attributes,{'tableName':_0xc0a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1670=['rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment'];(function(_0xca3b3a,_0x16ee26){var _0x15801e=function(_0x1705f9){while(--_0x1705f9){_0xca3b3a['push'](_0xca3b3a['shift']());}};_0x15801e(++_0x16ee26);}(_0x1670,0x9c));var _0x0167=function(_0x2418c2,_0x2f4e19){_0x2418c2=_0x2418c2-0x0;var _0x4e700c=_0x1670[_0x2418c2];return _0x4e700c;};'use strict';var _=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var logger=require('../../config/logger')(_0x0167('0x2'));var moment=require(_0x0167('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0167('0x4'));var config=require(_0x0167('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x0167('0x6')]=function(_0x3b7ace,_0x3b1031){return _0x3b7ace[_0x0167('0x7')](_0x0167('0x8'),attributes,{'tableName':_0x0167('0x9'),'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 ecc5c99..79e71f0 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 _0xf00a=['result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0xf00a,0x86));var _0xaf00=function(_0x320d18,_0x7a06d9){_0x320d18=_0x320d18-0x0;var _0x18166f=_0xf00a[_0x320d18];return _0x18166f;};'use strict';var _=require(_0xaf00('0x0'));var util=require(_0xaf00('0x1'));var moment=require(_0xaf00('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf00('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf00('0x4'));var logger=require(_0xaf00('0x5'))(_0xaf00('0x6'));var config=require(_0xaf00('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf00('0x8')][_0xaf00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ed38,_0x32faf3,_0x5eba50){return new BPromise(function(_0xd4b83c,_0x55a5f5){return client[_0xaf00('0xa')](_0x29ed38,_0x5eba50)['then'](function(_0x5a3e15){logger[_0xaf00('0xb')](_0xaf00('0xc'),_0x32faf3,_0xaf00('0xd'));logger[_0xaf00('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x32faf3,_0xaf00('0xd'),JSON['stringify'](_0x5a3e15));if(_0x5a3e15[_0xaf00('0xf')]){if(_0x5a3e15[_0xaf00('0xf')][_0xaf00('0x10')]===0x1f4){logger[_0xaf00('0xf')](_0xaf00('0xc'),_0x32faf3,_0x5a3e15['error'][_0xaf00('0x11')]);return _0x55a5f5(_0x5a3e15['error'][_0xaf00('0x11')]);}logger[_0xaf00('0xf')](_0xaf00('0xc'),_0x32faf3,_0x5a3e15[_0xaf00('0xf')][_0xaf00('0x11')]);return _0xd4b83c(_0x5a3e15[_0xaf00('0xf')]['message']);}else{logger[_0xaf00('0xb')](_0xaf00('0xc'),_0x32faf3,'request\x20sent');_0xd4b83c(_0x5a3e15[_0xaf00('0x12')][_0xaf00('0x11')]);}})['catch'](function(_0x1d5156){logger[_0xaf00('0xf')](_0xaf00('0xc'),_0x32faf3,_0x1d5156);_0x55a5f5(_0x1d5156);});});} \ No newline at end of file +var _0x28c1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x20d9b5,_0x42960c){var _0x15bfdd=function(_0x3a65c7){while(--_0x3a65c7){_0x20d9b5['push'](_0x20d9b5['shift']());}};_0x15bfdd(++_0x42960c);}(_0x28c1,0x16c));var _0x128c=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x28c1[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x128c('0x0'));var util=require(_0x128c('0x1'));var moment=require(_0x128c('0x2'));var BPromise=require(_0x128c('0x3'));var rs=require(_0x128c('0x4'));var fs=require('fs');var Redis=require(_0x128c('0x5'));var db=require(_0x128c('0x6'))['db'];var utils=require(_0x128c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x128c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x128c('0x9')][_0x128c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c2e88,_0x229112,_0x286251){return new BPromise(function(_0x39cd4c,_0x50c16d){return client[_0x128c('0xb')](_0x3c2e88,_0x286251)[_0x128c('0xc')](function(_0x34cb01){logger['info'](_0x128c('0xd'),_0x229112,'request\x20sent');logger[_0x128c('0xe')](_0x128c('0xf'),_0x229112,_0x128c('0x10'),JSON[_0x128c('0x11')](_0x34cb01));if(_0x34cb01['error']){if(_0x34cb01[_0x128c('0x12')][_0x128c('0x13')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x229112,_0x34cb01[_0x128c('0x12')][_0x128c('0x14')]);return _0x50c16d(_0x34cb01[_0x128c('0x12')]['message']);}logger[_0x128c('0x12')](_0x128c('0xd'),_0x229112,_0x34cb01[_0x128c('0x12')][_0x128c('0x14')]);return _0x39cd4c(_0x34cb01['error'][_0x128c('0x14')]);}else{logger[_0x128c('0x15')](_0x128c('0xd'),_0x229112,'request\x20sent');_0x39cd4c(_0x34cb01['result']['message']);}})[_0x128c('0x16')](function(_0x180a63){logger[_0x128c('0x12')](_0x128c('0xd'),_0x229112,_0x180a63);_0x50c16d(_0x180a63);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 5fc4092..88537d2 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26f0da,_0xb6c33f){var _0x2df5dd=function(_0x4ec383){while(--_0x4ec383){_0x26f0da['push'](_0x26f0da['shift']());}};_0x2df5dd(++_0xb6c33f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3dc5e1,_0xe6cf18){var _0x442407=function(_0x224cb5){while(--_0x224cb5){_0x3dc5e1['push'](_0x3dc5e1['shift']());}};_0x442407(++_0xe6cf18);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 54a02d0..72c0c57 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 _0xe1e3=['sequelize','exports','INTEGER','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe1e3,0x94));var _0x3e1e=function(_0x52c45c,_0x4d74e2){_0x52c45c=_0x52c45c-0x0;var _0x5b633c=_0xe1e3[_0x52c45c];return _0x5b633c;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3e1e('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3e1e('0x3')]}}; \ No newline at end of file +var _0xbba2=['sequelize','exports','INTEGER','STRING'];(function(_0x5dd7dd,_0x564f42){var _0x4b655e=function(_0x43bb45){while(--_0x43bb45){_0x5dd7dd['push'](_0x5dd7dd['shift']());}};_0x4b655e(++_0x564f42);}(_0xbba2,0x1e8));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2bba('0x0'));module[_0x2bba('0x1')]={'penalty':{'type':Sequelize[_0x2bba('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2bba('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2bba('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 45cc48e..eda19d8 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 _0xa936=['rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa936,0xde));var _0x6a93=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xa936[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x6a93('0x0'));var util=require(_0x6a93('0x1'));var logger=require(_0x6a93('0x2'))('api');var moment=require(_0x6a93('0x3'));var BPromise=require(_0x6a93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a93('0x5'));var rimraf=require(_0x6a93('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a93('0x7'));module[_0x6a93('0x8')]=function(_0x30e7a0,_0x4ef69b){return _0x30e7a0[_0x6a93('0x9')](_0x6a93('0xa'),attributes,{'tableName':_0x6a93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6ed=['rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','lodash','util','../../config/logger','request-promise'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xf6ed,0x16c));var _0xdf6e=function(_0x1faa76,_0x500b3d){_0x1faa76=_0x1faa76-0x0;var _0x182d57=_0xf6ed[_0x1faa76];return _0x182d57;};'use strict';var _=require(_0xdf6e('0x0'));var util=require(_0xdf6e('0x1'));var logger=require(_0xdf6e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdf6e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf6e('0x4'));var config=require('../../config/environment');var attributes=require(_0xdf6e('0x5'));module[_0xdf6e('0x6')]=function(_0x19e857,_0x408488){return _0x19e857['define'](_0xdf6e('0x7'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 768ef39..0491967 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 _0x200c=['jayson/promise','http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x200c,0x11f));var _0xc200=function(_0x593581,_0x44b77d){_0x593581=_0x593581-0x0;var _0x436585=_0x200c[_0x593581];return _0x436585;};'use strict';var _=require(_0xc200('0x0'));var util=require(_0xc200('0x1'));var moment=require('moment');var BPromise=require(_0xc200('0x2'));var rs=require(_0xc200('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc200('0x4'))['db'];var utils=require(_0xc200('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc200('0x6'));var jayson=require(_0xc200('0x7'));var client=jayson['client'][_0xc200('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3eee42,_0x2f948f,_0x5d9053){return new BPromise(function(_0x9ee309,_0x37bf40){return client[_0xc200('0x9')](_0x3eee42,_0x5d9053)[_0xc200('0xa')](function(_0x4fde4d){logger[_0xc200('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x2f948f,_0xc200('0xc'));logger[_0xc200('0xd')](_0xc200('0xe'),_0x2f948f,_0xc200('0xc'),JSON[_0xc200('0xf')](_0x4fde4d));if(_0x4fde4d[_0xc200('0x10')]){if(_0x4fde4d[_0xc200('0x10')][_0xc200('0x11')]===0x1f4){logger['error'](_0xc200('0x12'),_0x2f948f,_0x4fde4d[_0xc200('0x10')]['message']);return _0x37bf40(_0x4fde4d['error']['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x2f948f,_0x4fde4d[_0xc200('0x10')][_0xc200('0x13')]);return _0x9ee309(_0x4fde4d[_0xc200('0x10')][_0xc200('0x13')]);}else{logger[_0xc200('0xb')](_0xc200('0x12'),_0x2f948f,_0xc200('0xc'));_0x9ee309(_0x4fde4d['result'][_0xc200('0x13')]);}})[_0xc200('0x14')](function(_0x1cf685){logger[_0xc200('0x10')](_0xc200('0x12'),_0x2f948f,_0x1cf685);_0x37bf40(_0x1cf685);});});} \ No newline at end of file +var _0xd467=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x16566d,_0x547bb9){var _0x10c9ff=function(_0x238bab){while(--_0x238bab){_0x16566d['push'](_0x16566d['shift']());}};_0x10c9ff(++_0x547bb9);}(_0xd467,0x100));var _0x7d46=function(_0xc5ddea,_0x42871d){_0xc5ddea=_0xc5ddea-0x0;var _0x10c6d5=_0xd467[_0xc5ddea];return _0x10c6d5;};'use strict';var _=require('lodash');var util=require(_0x7d46('0x0'));var moment=require(_0x7d46('0x1'));var BPromise=require(_0x7d46('0x2'));var rs=require(_0x7d46('0x3'));var fs=require('fs');var Redis=require(_0x7d46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d46('0x5'));var logger=require(_0x7d46('0x6'))(_0x7d46('0x7'));var config=require('../../config/environment');var jayson=require(_0x7d46('0x8'));var client=jayson['client'][_0x7d46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151c73,_0x226f79,_0x102058){return new BPromise(function(_0x1216e9,_0x3572fa){return client['request'](_0x151c73,_0x102058)[_0x7d46('0xa')](function(_0x5789c5){logger[_0x7d46('0xb')](_0x7d46('0xc'),_0x226f79,_0x7d46('0xd'));logger['debug'](_0x7d46('0xe'),_0x226f79,_0x7d46('0xd'),JSON['stringify'](_0x5789c5));if(_0x5789c5[_0x7d46('0xf')]){if(_0x5789c5[_0x7d46('0xf')][_0x7d46('0x10')]===0x1f4){logger[_0x7d46('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x226f79,_0x5789c5[_0x7d46('0xf')][_0x7d46('0x11')]);return _0x3572fa(_0x5789c5[_0x7d46('0xf')]['message']);}logger['error'](_0x7d46('0xc'),_0x226f79,_0x5789c5[_0x7d46('0xf')]['message']);return _0x1216e9(_0x5789c5['error'][_0x7d46('0x11')]);}else{logger['info'](_0x7d46('0xc'),_0x226f79,'request\x20sent');_0x1216e9(_0x5789c5[_0x7d46('0x12')][_0x7d46('0x11')]);}})[_0x7d46('0x13')](function(_0x4abe4d){logger[_0x7d46('0xf')](_0x7d46('0xc'),_0x226f79,_0x4abe4d);_0x3572fa(_0x4abe4d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2641d53..4584002 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3cc82b,_0x259747){var _0x4d2e83=function(_0x485795){while(--_0x485795){_0x3cc82b['push'](_0x3cc82b['shift']());}};_0x4d2e83(++_0x259747);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 42d23c4..e98b939 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 _0xef4b=['sequelize','INTEGER'];(function(_0x1f7dab,_0x437d18){var _0x1fe57f=function(_0x293530){while(--_0x293530){_0x1f7dab['push'](_0x1f7dab['shift']());}};_0x1fe57f(++_0x437d18);}(_0xef4b,0x128));var _0xbef4=function(_0x20a791,_0x49718f){_0x20a791=_0x20a791-0x0;var _0xe0f198=_0xef4b[_0x20a791];return _0xe0f198;};'use strict';var Sequelize=require(_0xbef4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbef4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbd8c=['INTEGER','exports'];(function(_0x3127bd,_0xa7228c){var _0x5dbeb9=function(_0x1c57b0){while(--_0x1c57b0){_0x3127bd['push'](_0x3127bd['shift']());}};_0x5dbeb9(++_0xa7228c);}(_0xbd8c,0xfd));var _0xcbd8=function(_0x23b048,_0x5596c7){_0x23b048=_0x23b048-0x0;var _0x585866=_0xbd8c[_0x23b048];return _0x585866;};'use strict';var Sequelize=require('sequelize');module[_0xcbd8('0x0')]={'penalty':{'type':Sequelize[_0xcbd8('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 1899943..193c707 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 _0x0703=['user_has_mail_queues','lodash','util','api','bluebird','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue'];(function(_0x5986ba,_0x39cfb6){var _0x4f07ed=function(_0x1bd455){while(--_0x1bd455){_0x5986ba['push'](_0x5986ba['shift']());}};_0x4f07ed(++_0x39cfb6);}(_0x0703,0x160));var _0x3070=function(_0x31b2a5,_0x2480b4){_0x31b2a5=_0x31b2a5-0x0;var _0x198fa4=_0x0703[_0x31b2a5];return _0x198fa4;};'use strict';var _=require(_0x3070('0x0'));var util=require(_0x3070('0x1'));var logger=require('../../config/logger')(_0x3070('0x2'));var moment=require('moment');var BPromise=require(_0x3070('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3070('0x4'));var attributes=require(_0x3070('0x5'));module[_0x3070('0x6')]=function(_0x2ac960,_0x489619){return _0x2ac960['define'](_0x3070('0x7'),attributes,{'tableName':_0x3070('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe491=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x3ad557,_0x59bde0){var _0x5eeb8e=function(_0x37509e){while(--_0x37509e){_0x3ad557['push'](_0x3ad557['shift']());}};_0x5eeb8e(++_0x59bde0);}(_0xe491,0x147));var _0x1e49=function(_0x31dd76,_0x3f2925){_0x31dd76=_0x31dd76-0x0;var _0x12a65e=_0xe491[_0x31dd76];return _0x12a65e;};'use strict';var _=require(_0x1e49('0x0'));var util=require(_0x1e49('0x1'));var logger=require(_0x1e49('0x2'))(_0x1e49('0x3'));var moment=require(_0x1e49('0x4'));var BPromise=require(_0x1e49('0x5'));var rp=require(_0x1e49('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e49('0x7'));var attributes=require(_0x1e49('0x8'));module[_0x1e49('0x9')]=function(_0x10157a,_0x30f400){return _0x10157a[_0x1e49('0xa')](_0x1e49('0xb'),attributes,{'tableName':_0x1e49('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 4bea40d..ad68ebc 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x32d414,_0x4d23da){_0x32d414=_0x32d414-0x0;var _0x4e0bca=_0x008c[_0x32d414];return _0x4e0bca;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ddb1e,_0x306fe6){var _0x3cb8c3=function(_0x55235d){while(--_0x55235d){_0x1ddb1e['push'](_0x1ddb1e['shift']());}};_0x3cb8c3(++_0x306fe6);}(_0xa41a,0x6b));var _0xaa41=function(_0x464b91,_0x3a705c){_0x464b91=_0x464b91-0x0;var _0x5cffbd=_0xa41a[_0x464b91];return _0x5cffbd;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 46bceab..30404fd 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0644=['../../config/environment','./userNotification.controller','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0644,0x1b2));var _0x4064=function(_0x2ef327,_0x5630c3){_0x2ef327=_0x2ef327-0x0;var _0x34e298=_0x0644[_0x2ef327];return _0x34e298;};'use strict';var multer=require(_0x4064('0x0'));var util=require(_0x4064('0x1'));var path=require(_0x4064('0x2'));var timeout=require(_0x4064('0x3'));var express=require(_0x4064('0x4'));var router=express['Router']();var fs_extra=require(_0x4064('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4064('0x6'));var config=require(_0x4064('0x7'));var controller=require(_0x4064('0x8'));router['post']('/',auth['isAuthenticated'](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0x5621=['post','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0x2a448d,_0x1b2502){var _0x1db1fa=function(_0x28a203){while(--_0x28a203){_0x2a448d['push'](_0x2a448d['shift']());}};_0x1db1fa(++_0x1b2502);}(_0x5621,0x1b0));var _0x1562=function(_0x563c9a,_0x47d62b){_0x563c9a=_0x563c9a-0x0;var _0x24163a=_0x5621[_0x563c9a];return _0x24163a;};'use strict';var multer=require(_0x1562('0x0'));var util=require('util');var path=require(_0x1562('0x1'));var timeout=require(_0x1562('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1562('0x3'));var auth=require(_0x1562('0x4'));var interaction=require(_0x1562('0x5'));var config=require(_0x1562('0x6'));var controller=require(_0x1562('0x7'));router[_0x1562('0x8')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0x1562('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 43a1243..3d2b4ba 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe400=['STRING','sequelize','exports','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe400,0x135));var _0x0e40=function(_0x5db7b2,_0x5f38c3){_0x5db7b2=_0x5db7b2-0x0;var _0x35d2e9=_0xe400[_0x5db7b2];return _0x35d2e9;};'use strict';var Sequelize=require(_0x0e40('0x0'));module[_0x0e40('0x1')]={'body':{'type':Sequelize[_0x0e40('0x2')]},'senderName':{'type':Sequelize[_0x0e40('0x3')]},'recipientsId':{'type':Sequelize[_0x0e40('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0e40('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x262f=['STRING','TEXT','BOOLEAN','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x262f,0xc3));var _0xf262=function(_0x557055,_0x1fa087){_0x557055=_0x557055-0x0;var _0x1abcfa=_0x262f[_0x557055];return _0x1abcfa;};'use strict';var Sequelize=require(_0xf262('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xf262('0x1')]},'recipientsId':{'type':Sequelize[_0xf262('0x2')]},'recipientsDescription':{'type':Sequelize[_0xf262('0x1')]},'beep':{'type':Sequelize[_0xf262('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 2b7b12e..405c1b8 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c0=['Template','render','startCase','toLowerCase','ids','replace','queue','Queue','push','all','union','flatten','getAgents','map','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','save','update','then','error','stack','name','send','sendUserNotification','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','whatsappqueue','team','some','includes','model','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch'];(function(_0x5addae,_0x33677b){var _0x5efeda=function(_0x294e1b){while(--_0x294e1b){_0x5addae['push'](_0x5addae['shift']());}};_0x5efeda(++_0x33677b);}(_0x50c0,0x192));var _0x050c=function(_0x438434,_0x36f21f){_0x438434=_0x438434-0x0;var _0x3b97c9=_0x50c0[_0x438434];return _0x3b97c9;};'use strict';var emlformat=require(_0x050c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x050c('0x1'));var jsonpatch=require(_0x050c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x050c('0x3'));var Mustache=require(_0x050c('0x4'));var util=require(_0x050c('0x5'));var path=require(_0x050c('0x6'));var sox=require(_0x050c('0x7'));var csv=require(_0x050c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x050c('0x9'));var _=require(_0x050c('0xa'));var squel=require(_0x050c('0xb'));var crypto=require(_0x050c('0xc'));var jsforce=require(_0x050c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x050c('0x8'));var querystring=require(_0x050c('0xe'));var Papa=require(_0x050c('0xf'));var Redis=require(_0x050c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x050c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x050c('0x12'));var logger=require(_0x050c('0x13'))(_0x050c('0x14'));var utils=require('../../config/utils');var config=require(_0x050c('0x15'));var licenseUtil=require(_0x050c('0x16'));var db=require(_0x050c('0x17'))['db'];config[_0x050c('0x18')]=_['defaults'](config[_0x050c('0x18')],{'host':_0x050c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x050c('0x18')]));require('./userNotification.socket')[_0x050c('0x1a')](socket);function respondWithStatusCode(_0x10a1e1,_0x21ee21){_0x21ee21=_0x21ee21||0xcc;return function(_0x4eb2b7){if(_0x4eb2b7){return _0x10a1e1[_0x050c('0x1b')](_0x21ee21);}return _0x10a1e1[_0x050c('0x1c')](_0x21ee21)[_0x050c('0x1d')]();};}function respondWithResult(_0x1b0c9b,_0x4aff21){_0x4aff21=_0x4aff21||0xc8;return function(_0x1c15ef){if(_0x1c15ef){return _0x1b0c9b[_0x050c('0x1c')](_0x4aff21)['json'](_0x1c15ef);}};}function respondWithFilteredResult(_0x2f4fd1,_0x6188d3){return function(_0x195317){if(_0x195317){var _0xfb898b=typeof _0x6188d3['offset']===_0x050c('0x1e')&&typeof _0x6188d3[_0x050c('0x1f')]===_0x050c('0x1e');var _0xd0d084=_0x195317['count'];var _0x4ab646=_0xfb898b?0x0:_0x6188d3[_0x050c('0x20')];var _0x49f7d5=_0xfb898b?_0x195317[_0x050c('0x21')]:_0x6188d3[_0x050c('0x20')]+_0x6188d3[_0x050c('0x1f')];var _0x17a523;if(_0x49f7d5>=_0xd0d084){_0x49f7d5=_0xd0d084;_0x17a523=0xc8;}else{_0x17a523=0xce;}_0x2f4fd1[_0x050c('0x1c')](_0x17a523);return _0x2f4fd1['set'](_0x050c('0x22'),_0x4ab646+'-'+_0x49f7d5+'/'+_0xd0d084)[_0x050c('0x23')](_0x195317);}return null;};}function patchUpdates(_0x302799){return function(_0x2d80be){try{jsonpatch[_0x050c('0x24')](_0x2d80be,_0x302799,!![]);}catch(_0x20b8f1){return BPromise['reject'](_0x20b8f1);}return _0x2d80be[_0x050c('0x25')]();};}function saveUpdates(_0x417289,_0x2dca3f){return function(_0x323ac4){if(_0x323ac4){return _0x323ac4[_0x050c('0x26')](_0x417289)[_0x050c('0x27')](function(_0x21ee08){return _0x21ee08;});}return null;};}function removeEntity(_0x2a350d,_0x46c202){return function(_0x22fa2c){if(_0x22fa2c){return _0x22fa2c['destroy']()['then'](function(){_0x2a350d[_0x050c('0x1c')](0xcc)[_0x050c('0x1d')]();});}};}function handleEntityNotFound(_0x3f5837,_0x311783){return function(_0x407a42){if(!_0x407a42){_0x3f5837[_0x050c('0x1b')](0x194);}return _0x407a42;};}function handleError(_0x598841,_0x1bef71){_0x1bef71=_0x1bef71||0x1f4;return function(_0x549dec){logger[_0x050c('0x28')](_0x549dec[_0x050c('0x29')]);if(_0x549dec[_0x050c('0x2a')]){delete _0x549dec[_0x050c('0x2a')];}_0x598841[_0x050c('0x1c')](_0x1bef71)[_0x050c('0x2b')](_0x549dec);};}exports[_0x050c('0x2c')]=function(_0x180eb1,_0x47aedb,_0x48efc5){if(!_0x180eb1['body'][_0x050c('0x2d')](_0x050c('0x2e'))&&!_0x180eb1['body'][_0x050c('0x2d')](_0x050c('0x2f'))){throw new db[(_0x050c('0x30'))]['ValidationError'](_0x050c('0x31'));}else{if(_0x180eb1['body']['hasOwnProperty'](_0x050c('0x2f'))&&!_0x180eb1[_0x050c('0x32')]['hasOwnProperty'](_0x050c('0x33'))){throw new db[(_0x050c('0x30'))][(_0x050c('0x34'))](_0x050c('0x35'));}if(!_0x180eb1[_0x050c('0x32')][_0x050c('0x2d')](_0x050c('0x36'))){throw new db[(_0x050c('0x30'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x3ded90=JSON[_0x050c('0x37')](_0x180eb1[_0x050c('0x32')][_0x050c('0x36')]);}catch(_0x2ea05e){logger[_0x050c('0x28')](_0x2ea05e);throw new db['Sequelize']['ValidationError'](_0x050c('0x38'));}var _0x53cb93=[_0x050c('0x39'),_0x050c('0x3a'),'mailqueue','openchannelqueue','smsqueue','voicequeue',_0x050c('0x3b'),_0x050c('0x3c'),'user'];if(_[_0x050c('0x3d')](_0x3ded90,function(_0x409170){return!_[_0x050c('0x3e')](_0x53cb93,_0x409170[_0x050c('0x3f')]['toLowerCase']());})){throw new db[(_0x050c('0x30'))][(_0x050c('0x34'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x39f6bb={};_0x39f6bb['senderName']=_0x180eb1['body'][_0x050c('0x2d')](_0x050c('0x40'))?_0x180eb1[_0x050c('0x32')][_0x050c('0x40')]:_0x180eb1[_0x050c('0x41')][_0x050c('0x42')];_0x39f6bb[_0x050c('0x43')]=_[_0x050c('0x44')](_0x180eb1[_0x050c('0x32')][_0x050c('0x43')])?null:_0x180eb1[_0x050c('0x32')][_0x050c('0x43')];_0x39f6bb[_0x050c('0x45')]=_0x180eb1['body'][_0x050c('0x45')]||![];_0x39f6bb[_0x050c('0x46')]=_0x180eb1[_0x050c('0x41')]['id'];return getContent(_0x180eb1[_0x050c('0x32')])[_0x050c('0x27')](function(_0x1fb16d){_0x39f6bb[_0x050c('0x32')]=_0x1fb16d;return getRecipients(_0x3ded90);})[_0x050c('0x27')](function(_0x29ad8b){_0x39f6bb[_0x050c('0x47')]=_[_0x050c('0x48')](_0x29ad8b)[_0x050c('0x49')](',');return db[_0x050c('0x4a')][_0x050c('0x4b')](function(_0x3ff4da){return db[_0x050c('0x4c')][_0x050c('0x4d')](_0x39f6bb,{'raw':!![],'transaction':_0x3ff4da})[_0x050c('0x27')](function(_0x492717){var _0x40b0b3={'sender':_0x39f6bb[_0x050c('0x40')],'description':_0x39f6bb[_0x050c('0x43')],'content':_0x39f6bb[_0x050c('0x32')],'beep':_0x39f6bb[_0x050c('0x45')]};_0x29ad8b[_0x050c('0x4e')](function(_0x292b93){_0x40b0b3[_0x050c('0x4f')]=_0x292b93;socket[_0x050c('0x50')](_0x050c('0x51'),_0x40b0b3);});return _0x492717;});});})[_0x050c('0x27')](respondWithResult(_0x47aedb,0xc9))[_0x050c('0x52')](handleError(_0x47aedb,null));};function getContent(_0x4d6fbf){return new BPromise(function(_0x49cd14,_0x21d5c8){if(_0x4d6fbf[_0x050c('0x2e')]){_0x49cd14(_0x4d6fbf[_0x050c('0x2e')]);return;}return db[_0x050c('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x4d6fbf['TemplateId']},'raw':!![]})[_0x050c('0x27')](function(_0x49eb7f){if(!_0x49eb7f)throw new db[(_0x050c('0x30'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x28fafd=Mustache[_0x050c('0x54')](_0x49eb7f['html'],_0x4d6fbf[_0x050c('0x33')]);_0x49cd14(_0x28fafd);})[_0x050c('0x52')](function(_0xaf11a8){_0x21d5c8(_0xaf11a8);});});}function getRecipients(_0x14879f){return new BPromise(function(_0x3dd9e0,_0x33c924){var _0x3cda1c=[];var _0x27eb35=[];_0x14879f[_0x050c('0x4e')](function(_0x1e71c5){var _0x4109fe=_[_0x050c('0x55')](_0x1e71c5['model'][_0x050c('0x56')]());if(_0x4109fe==='User'){_0x3cda1c=_['union'](_0x3cda1c,_0x1e71c5[_0x050c('0x57')]);}else{if(_['includes'](_0x4109fe,'queue'))_0x4109fe=_0x4109fe[_0x050c('0x58')](_0x050c('0x59'),_0x050c('0x5a'));_0x1e71c5[_0x050c('0x57')][_0x050c('0x4e')](function(_0x200989){_0x27eb35[_0x050c('0x5b')](getAgents(_0x4109fe,_0x200989));});}});return BPromise[_0x050c('0x5c')](_0x27eb35)['then'](function(_0x2dbdb7){_0x3cda1c=_[_0x050c('0x5d')](_0x3cda1c,_[_0x050c('0x5e')](_0x2dbdb7));_0x3dd9e0(_0x3cda1c);})['catch'](function(_0x1f7c79){_0x33c924(_0x1f7c79);});});}function getAgents(_0x547cac,_0x3757b4){return new BPromise(function(_0xe5dabf,_0x3bdbae){return db[_0x547cac]['findOne']({'where':{'id':_0x3757b4}})[_0x050c('0x27')](function(_0x43704f){return _0x43704f[_0x050c('0x5f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49d070){var _0x11933d=_[_0x050c('0x60')](_0x49d070,'id');_0xe5dabf(_0x11933d);});})[_0x050c('0x52')](function(_0x46584b){_0x3bdbae(_0x46584b);});});} \ No newline at end of file +var _0xd493=['beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','catch','Template','findOne','html','view','startCase','User','union','queue','replace','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription'];(function(_0x5945d3,_0x42c4a1){var _0xe3819a=function(_0x41c155){while(--_0x41c155){_0x5945d3['push'](_0x5945d3['shift']());}};_0xe3819a(++_0x42c4a1);}(_0xd493,0x13b));var _0x3d49=function(_0x4d6735,_0x36eaeb){_0x4d6735=_0x4d6735-0x0;var _0x1bca3e=_0xd493[_0x4d6735];return _0x1bca3e;};'use strict';var emlformat=require(_0x3d49('0x0'));var rimraf=require(_0x3d49('0x1'));var zipdir=require(_0x3d49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d49('0x3'));var Mustache=require(_0x3d49('0x4'));var util=require('util');var path=require(_0x3d49('0x5'));var sox=require('sox');var csv=require(_0x3d49('0x6'));var ejs=require(_0x3d49('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d49('0x8'));var squel=require(_0x3d49('0x9'));var crypto=require(_0x3d49('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3d49('0xb'));var toCsv=require(_0x3d49('0x6'));var querystring=require(_0x3d49('0xc'));var Papa=require(_0x3d49('0xd'));var Redis=require(_0x3d49('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d49('0xf'));var as=require(_0x3d49('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d49('0x11'))(_0x3d49('0x12'));var utils=require(_0x3d49('0x13'));var config=require(_0x3d49('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x3d49('0x15')](config[_0x3d49('0x16')],{'host':_0x3d49('0x17'),'port':0x18eb});var socket=require(_0x3d49('0x18'))(new Redis(config['redis']));require(_0x3d49('0x19'))[_0x3d49('0x1a')](socket);function respondWithStatusCode(_0x258037,_0x38c592){_0x38c592=_0x38c592||0xcc;return function(_0x724406){if(_0x724406){return _0x258037[_0x3d49('0x1b')](_0x38c592);}return _0x258037[_0x3d49('0x1c')](_0x38c592)[_0x3d49('0x1d')]();};}function respondWithResult(_0x89ce2c,_0x33ec82){_0x33ec82=_0x33ec82||0xc8;return function(_0x4b61c1){if(_0x4b61c1){return _0x89ce2c['status'](_0x33ec82)[_0x3d49('0x1e')](_0x4b61c1);}};}function respondWithFilteredResult(_0x2fa087,_0x5ba256){return function(_0x264211){if(_0x264211){var _0x1b283f=typeof _0x5ba256[_0x3d49('0x1f')]===_0x3d49('0x20')&&typeof _0x5ba256[_0x3d49('0x21')]===_0x3d49('0x20');var _0x4e4f1b=_0x264211['count'];var _0x3c3110=_0x1b283f?0x0:_0x5ba256[_0x3d49('0x1f')];var _0x541436=_0x1b283f?_0x264211[_0x3d49('0x22')]:_0x5ba256[_0x3d49('0x1f')]+_0x5ba256[_0x3d49('0x21')];var _0x2b075f;if(_0x541436>=_0x4e4f1b){_0x541436=_0x4e4f1b;_0x2b075f=0xc8;}else{_0x2b075f=0xce;}_0x2fa087[_0x3d49('0x1c')](_0x2b075f);return _0x2fa087[_0x3d49('0x23')]('Content-Range',_0x3c3110+'-'+_0x541436+'/'+_0x4e4f1b)[_0x3d49('0x1e')](_0x264211);}return null;};}function patchUpdates(_0x59b5ca){return function(_0x2afa60){try{jsonpatch[_0x3d49('0x24')](_0x2afa60,_0x59b5ca,!![]);}catch(_0x43fad2){return BPromise[_0x3d49('0x25')](_0x43fad2);}return _0x2afa60['save']();};}function saveUpdates(_0x1d2f00,_0x3bbf97){return function(_0x420d38){if(_0x420d38){return _0x420d38[_0x3d49('0x26')](_0x1d2f00)[_0x3d49('0x27')](function(_0x4433fe){return _0x4433fe;});}return null;};}function removeEntity(_0x4523b6,_0x3b2737){return function(_0x869b90){if(_0x869b90){return _0x869b90[_0x3d49('0x28')]()['then'](function(){_0x4523b6[_0x3d49('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf874,_0x4f7124){return function(_0xe36e4b){if(!_0xe36e4b){_0x5cf874[_0x3d49('0x1b')](0x194);}return _0xe36e4b;};}function handleError(_0x41cda3,_0x5a73d1){_0x5a73d1=_0x5a73d1||0x1f4;return function(_0x350a16){logger[_0x3d49('0x29')](_0x350a16[_0x3d49('0x2a')]);if(_0x350a16[_0x3d49('0x2b')]){delete _0x350a16[_0x3d49('0x2b')];}_0x41cda3['status'](_0x5a73d1)[_0x3d49('0x2c')](_0x350a16);};}exports[_0x3d49('0x2d')]=function(_0x44b453,_0x2bdd11,_0x4e9e56){if(!_0x44b453[_0x3d49('0x2e')]['hasOwnProperty'](_0x3d49('0x2f'))&&!_0x44b453[_0x3d49('0x2e')][_0x3d49('0x30')](_0x3d49('0x31'))){throw new db[(_0x3d49('0x32'))][(_0x3d49('0x33'))](_0x3d49('0x34'));}else{if(_0x44b453[_0x3d49('0x2e')]['hasOwnProperty'](_0x3d49('0x31'))&&!_0x44b453[_0x3d49('0x2e')]['hasOwnProperty']('view')){throw new db[(_0x3d49('0x32'))][(_0x3d49('0x33'))](_0x3d49('0x35'));}if(!_0x44b453[_0x3d49('0x2e')]['hasOwnProperty'](_0x3d49('0x36'))){throw new db[(_0x3d49('0x32'))][(_0x3d49('0x33'))](_0x3d49('0x37'));}else{try{var _0x45a178=JSON[_0x3d49('0x38')](_0x44b453[_0x3d49('0x2e')]['recipients']);}catch(_0x1700c6){logger[_0x3d49('0x29')](_0x1700c6);throw new db[(_0x3d49('0x32'))][(_0x3d49('0x33'))](_0x3d49('0x39'));}var _0x46c423=['chatqueue',_0x3d49('0x3a'),_0x3d49('0x3b'),_0x3d49('0x3c'),_0x3d49('0x3d'),_0x3d49('0x3e'),_0x3d49('0x3f'),_0x3d49('0x40'),_0x3d49('0x41')];if(_[_0x3d49('0x42')](_0x45a178,function(_0x4b3147){return!_[_0x3d49('0x43')](_0x46c423,_0x4b3147[_0x3d49('0x44')][_0x3d49('0x45')]());})){throw new db[(_0x3d49('0x32'))][(_0x3d49('0x33'))](_0x3d49('0x46'));}}}var _0x1827e4={};_0x1827e4[_0x3d49('0x47')]=_0x44b453[_0x3d49('0x2e')][_0x3d49('0x30')](_0x3d49('0x47'))?_0x44b453[_0x3d49('0x2e')][_0x3d49('0x47')]:_0x44b453[_0x3d49('0x41')]['fullname'];_0x1827e4[_0x3d49('0x48')]=_['isEmpty'](_0x44b453['body']['recipientsDescription'])?null:_0x44b453['body'][_0x3d49('0x48')];_0x1827e4[_0x3d49('0x49')]=_0x44b453[_0x3d49('0x2e')][_0x3d49('0x49')]||![];_0x1827e4[_0x3d49('0x4a')]=_0x44b453[_0x3d49('0x41')]['id'];return getContent(_0x44b453[_0x3d49('0x2e')])[_0x3d49('0x27')](function(_0x4991de){_0x1827e4[_0x3d49('0x2e')]=_0x4991de;return getRecipients(_0x45a178);})[_0x3d49('0x27')](function(_0x57cd51){_0x1827e4[_0x3d49('0x4b')]=_[_0x3d49('0x4c')](_0x57cd51)[_0x3d49('0x4d')](',');return db[_0x3d49('0x4e')][_0x3d49('0x4f')](function(_0x345a80){return db[_0x3d49('0x50')]['create'](_0x1827e4,{'raw':!![],'transaction':_0x345a80})['then'](function(_0x296248){var _0x55bb6c={'sender':_0x1827e4[_0x3d49('0x47')],'description':_0x1827e4[_0x3d49('0x48')],'content':_0x1827e4[_0x3d49('0x2e')],'beep':_0x1827e4['beep']};_0x57cd51[_0x3d49('0x51')](function(_0x3ae0dd){_0x55bb6c[_0x3d49('0x52')]=_0x3ae0dd;socket['emit']('userNotification:send',_0x55bb6c);});return _0x296248;});});})[_0x3d49('0x27')](respondWithResult(_0x2bdd11,0xc9))[_0x3d49('0x53')](handleError(_0x2bdd11,null));};function getContent(_0x284843){return new BPromise(function(_0x4b9382,_0x1dbb40){if(_0x284843['text']){_0x4b9382(_0x284843[_0x3d49('0x2f')]);return;}return db[_0x3d49('0x54')][_0x3d49('0x55')]({'attributes':[_0x3d49('0x56')],'where':{'id':_0x284843['TemplateId']},'raw':!![]})[_0x3d49('0x27')](function(_0x664276){if(!_0x664276)throw new db[(_0x3d49('0x32'))][(_0x3d49('0x33'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x36b95c=Mustache['render'](_0x664276[_0x3d49('0x56')],_0x284843[_0x3d49('0x57')]);_0x4b9382(_0x36b95c);})[_0x3d49('0x53')](function(_0x466ba1){_0x1dbb40(_0x466ba1);});});}function getRecipients(_0x23c8e5){return new BPromise(function(_0x531ec1,_0x8e6f32){var _0x860def=[];var _0x53853c=[];_0x23c8e5['forEach'](function(_0x84f748){var _0x91da68=_[_0x3d49('0x58')](_0x84f748['model'][_0x3d49('0x45')]());if(_0x91da68===_0x3d49('0x59')){_0x860def=_[_0x3d49('0x5a')](_0x860def,_0x84f748['ids']);}else{if(_['includes'](_0x91da68,_0x3d49('0x5b')))_0x91da68=_0x91da68[_0x3d49('0x5c')](_0x3d49('0x5b'),'Queue');_0x84f748['ids']['forEach'](function(_0x356c58){_0x53853c[_0x3d49('0x5d')](getAgents(_0x91da68,_0x356c58));});}});return BPromise['all'](_0x53853c)['then'](function(_0x910e6b){_0x860def=_[_0x3d49('0x5a')](_0x860def,_[_0x3d49('0x5e')](_0x910e6b));_0x531ec1(_0x860def);})[_0x3d49('0x53')](function(_0x45d801){_0x8e6f32(_0x45d801);});});}function getAgents(_0x340a7b,_0x6d5ef8){return new BPromise(function(_0x51ee35,_0x3dc75a){return db[_0x340a7b][_0x3d49('0x55')]({'where':{'id':_0x6d5ef8}})[_0x3d49('0x27')](function(_0x290ac6){return _0x290ac6[_0x3d49('0x5f')]({'attributes':['id'],'raw':!![]})[_0x3d49('0x27')](function(_0x33865e){var _0x5aa3d2=_[_0x3d49('0x60')](_0x33865e,'id');_0x51ee35(_0x5aa3d2);});})['catch'](function(_0x4c852c){_0x3dc75a(_0x4c852c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 53b4495..426c67c 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1a6=['remove','emit','events','../../mysqldb','setMaxListeners','save'];(function(_0x5640c1,_0x3f1926){var _0x5de860=function(_0x5aacd1){while(--_0x5aacd1){_0x5640c1['push'](_0x5640c1['shift']());}};_0x5de860(++_0x3f1926);}(_0xf1a6,0x1be));var _0x6f1a=function(_0x5fe167,_0x11426d){_0x5fe167=_0x5fe167-0x0;var _0x28560b=_0xf1a6[_0x5fe167];return _0x28560b;};'use strict';var EventEmitter=require(_0x6f1a('0x0'));var UserNotification=require(_0x6f1a('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6f1a('0x2')](0x0);var events={'afterCreate':_0x6f1a('0x3'),'afterUpdate':'update','afterDestroy':_0x6f1a('0x4')};function emitEvent(_0x353c45){return function(_0x537830,_0x4db7bc,_0x489df5){UserNotificationEvents[_0x6f1a('0x5')](_0x353c45+':'+_0x537830['id'],_0x537830);UserNotificationEvents[_0x6f1a('0x5')](_0x353c45,_0x537830);_0x489df5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x48f8=['update','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0xc07480,_0x4e0a24){var _0x22b524=function(_0x50273f){while(--_0x50273f){_0xc07480['push'](_0xc07480['shift']());}};_0x22b524(++_0x4e0a24);}(_0x48f8,0xdc));var _0x848f=function(_0x35ebd0,_0xb3e1f3){_0x35ebd0=_0x35ebd0-0x0;var _0x3687b0=_0x48f8[_0x35ebd0];return _0x3687b0;};'use strict';var EventEmitter=require(_0x848f('0x0'));var UserNotification=require(_0x848f('0x1'))['db'][_0x848f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x848f('0x3')](0x0);var events={'afterCreate':_0x848f('0x4'),'afterUpdate':_0x848f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3192dc){return function(_0x9acc04,_0x499aa5,_0x28fb60){UserNotificationEvents[_0x848f('0x6')](_0x3192dc+':'+_0x9acc04['id'],_0x9acc04);UserNotificationEvents[_0x848f('0x6')](_0x3192dc,_0x9acc04);_0x28fb60(null);};}for(var e in events){if(events[_0x848f('0x7')](e)){var event=events[e];UserNotification[_0x848f('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index b36bc99..7d2ff64 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38c9=['UserNotification','userNotifications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x2147e6,_0x36e82a){var _0x2d3c52=function(_0x3a6bc2){while(--_0x3a6bc2){_0x2147e6['push'](_0x2147e6['shift']());}};_0x2d3c52(++_0x36e82a);}(_0x38c9,0x199));var _0x938c=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x38c9[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var logger=require(_0x938c('0x2'))('api');var moment=require(_0x938c('0x3'));var BPromise=require(_0x938c('0x4'));var rp=require(_0x938c('0x5'));var fs=require('fs');var path=require(_0x938c('0x6'));var rimraf=require('rimraf');var config=require(_0x938c('0x7'));var attributes=require(_0x938c('0x8'));module[_0x938c('0x9')]=function(_0x15a858,_0x4dae36){return _0x15a858[_0x938c('0xa')](_0x938c('0xb'),attributes,{'tableName':_0x938c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x938c('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1b25=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x1b25,0x1aa));var _0x51b2=function(_0x5c0b14,_0x383089){_0x5c0b14=_0x5c0b14-0x0;var _0x2f4b18=_0x1b25[_0x5c0b14];return _0x2f4b18;};'use strict';var _=require(_0x51b2('0x0'));var util=require(_0x51b2('0x1'));var logger=require(_0x51b2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x51b2('0x3'));var rp=require(_0x51b2('0x4'));var fs=require('fs');var path=require(_0x51b2('0x5'));var rimraf=require(_0x51b2('0x6'));var config=require(_0x51b2('0x7'));var attributes=require(_0x51b2('0x8'));module[_0x51b2('0x9')]=function(_0x30bb17,_0x4ea9b8){return _0x30bb17[_0x51b2('0xa')](_0x51b2('0xb'),attributes,{'tableName':_0x51b2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x51b2('0xd'),'collate':_0x51b2('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index e4824ef..67b7d27 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1ab=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf1ab,0x159));var _0xbf1a=function(_0x1b2341,_0x11e599){_0x1b2341=_0x1b2341-0x0;var _0x94fca0=_0xf1ab[_0x1b2341];return _0x94fca0;};'use strict';var _=require(_0xbf1a('0x0'));var util=require(_0xbf1a('0x1'));var moment=require(_0xbf1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf1a('0x3'));var fs=require('fs');var Redis=require(_0xbf1a('0x4'));var db=require(_0xbf1a('0x5'))['db'];var utils=require(_0xbf1a('0x6'));var logger=require('../../config/logger')(_0xbf1a('0x7'));var config=require(_0xbf1a('0x8'));var jayson=require(_0xbf1a('0x9'));var client=jayson[_0xbf1a('0xa')]['http']({'port':0x232a});config[_0xbf1a('0xb')]=_[_0xbf1a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf1a('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x2d45a8,_0x1d15be,_0x399dd6){return new BPromise(function(_0x32b2d9,_0x4da7fd){return client[_0xbf1a('0xd')](_0x2d45a8,_0x399dd6)[_0xbf1a('0xe')](function(_0x387601){logger[_0xbf1a('0xf')](_0xbf1a('0x10'),_0x1d15be,'request\x20sent');logger[_0xbf1a('0x11')](_0xbf1a('0x12'),_0x1d15be,_0xbf1a('0x13'),JSON[_0xbf1a('0x14')](_0x387601));if(_0x387601[_0xbf1a('0x15')]){if(_0x387601[_0xbf1a('0x15')][_0xbf1a('0x16')]===0x1f4){logger['error'](_0xbf1a('0x10'),_0x1d15be,_0x387601[_0xbf1a('0x15')][_0xbf1a('0x17')]);return _0x4da7fd(_0x387601[_0xbf1a('0x15')][_0xbf1a('0x17')]);}logger[_0xbf1a('0x15')](_0xbf1a('0x10'),_0x1d15be,_0x387601['error'][_0xbf1a('0x17')]);return _0x32b2d9(_0x387601[_0xbf1a('0x15')][_0xbf1a('0x17')]);}else{logger[_0xbf1a('0xf')](_0xbf1a('0x10'),_0x1d15be,_0xbf1a('0x13'));_0x32b2d9(_0x387601['result']['message']);}})[_0xbf1a('0x18')](function(_0x1ea6a6){logger['error'](_0xbf1a('0x10'),_0x1d15be,_0x1ea6a6);_0x4da7fd(_0x1ea6a6);});});} \ No newline at end of file +var _0x18a9=['socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x1db2d9,_0x39d89b){var _0x13d52c=function(_0x37a1ac){while(--_0x37a1ac){_0x1db2d9['push'](_0x1db2d9['shift']());}};_0x13d52c(++_0x39d89b);}(_0x18a9,0xf6));var _0x918a=function(_0x435511,_0x132453){_0x435511=_0x435511-0x0;var _0xbfce45=_0x18a9[_0x435511];return _0xbfce45;};'use strict';var _=require('lodash');var util=require(_0x918a('0x0'));var moment=require(_0x918a('0x1'));var BPromise=require(_0x918a('0x2'));var rs=require(_0x918a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});config[_0x918a('0xc')]=_[_0x918a('0xd')](config[_0x918a('0xc')],{'host':_0x918a('0xe'),'port':0x18eb});var socket=require(_0x918a('0xf'))(new Redis(config[_0x918a('0xc')]));require(_0x918a('0x10'))[_0x918a('0x11')](socket);function respondWithRpcPromise(_0x482385,_0x51c0a2,_0x3a34a1){return new BPromise(function(_0x3ebf88,_0x338c62){return client[_0x918a('0x12')](_0x482385,_0x3a34a1)[_0x918a('0x13')](function(_0x3392aa){logger['info'](_0x918a('0x14'),_0x51c0a2,_0x918a('0x15'));logger['debug'](_0x918a('0x16'),_0x51c0a2,_0x918a('0x15'),JSON[_0x918a('0x17')](_0x3392aa));if(_0x3392aa['error']){if(_0x3392aa[_0x918a('0x18')][_0x918a('0x19')]===0x1f4){logger['error'](_0x918a('0x14'),_0x51c0a2,_0x3392aa[_0x918a('0x18')][_0x918a('0x1a')]);return _0x338c62(_0x3392aa[_0x918a('0x18')]['message']);}logger[_0x918a('0x18')](_0x918a('0x14'),_0x51c0a2,_0x3392aa[_0x918a('0x18')]['message']);return _0x3ebf88(_0x3392aa[_0x918a('0x18')][_0x918a('0x1a')]);}else{logger[_0x918a('0x1b')](_0x918a('0x14'),_0x51c0a2,_0x918a('0x15'));_0x3ebf88(_0x3392aa[_0x918a('0x1c')]['message']);}})['catch'](function(_0x5dd4ea){logger[_0x918a('0x18')](_0x918a('0x14'),_0x51c0a2,_0x5dd4ea);_0x338c62(_0x5dd4ea);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 8dc92ff..283f90c 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b58=['removeListener','length','userNotification:','./userNotification.events','save','remove','update','emit'];(function(_0x155cc7,_0x4b3884){var _0x545006=function(_0x21e727){while(--_0x21e727){_0x155cc7['push'](_0x155cc7['shift']());}};_0x545006(++_0x4b3884);}(_0x7b58,0x10b));var _0x87b5=function(_0x4692a1,_0x41f54f){_0x4692a1=_0x4692a1-0x0;var _0x128700=_0x7b58[_0x4692a1];return _0x128700;};'use strict';var UserNotificationEvents=require(_0x87b5('0x0'));var events=[_0x87b5('0x1'),_0x87b5('0x2'),_0x87b5('0x3')];function createListener(_0x2159b4,_0xd15b23){return function(_0x234847){_0xd15b23[_0x87b5('0x4')](_0x2159b4,_0x234847);};}function removeListener(_0xbb146,_0x298bc2){return function(){UserNotificationEvents[_0x87b5('0x5')](_0xbb146,_0x298bc2);};}exports['register']=function(_0x50487a){for(var _0x3d8033=0x0,_0x11bd61=events[_0x87b5('0x6')];_0x3d8033<_0x11bd61;_0x3d8033++){var _0xadde90=events[_0x3d8033];var _0x134a7e=createListener(_0x87b5('0x7')+_0xadde90,_0x50487a);UserNotificationEvents['on'](_0xadde90,_0x134a7e);}}; \ No newline at end of file +var _0xc587=['userNotification:','save','remove','emit','removeListener','length'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc587,0x133));var _0x7c58=function(_0x545363,_0x268d45){_0x545363=_0x545363-0x0;var _0x4580fb=_0xc587[_0x545363];return _0x4580fb;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x7c58('0x0'),_0x7c58('0x1'),'update'];function createListener(_0x431029,_0x16c973){return function(_0xbea00c){_0x16c973[_0x7c58('0x2')](_0x431029,_0xbea00c);};}function removeListener(_0x131e3c,_0x47cff2){return function(){UserNotificationEvents[_0x7c58('0x3')](_0x131e3c,_0x47cff2);};}exports['register']=function(_0x30141b){for(var _0x22614f=0x0,_0x5aa91b=events[_0x7c58('0x4')];_0x22614f<_0x5aa91b;_0x22614f++){var _0x19f757=events[_0x22614f];var _0x34e504=createListener(_0x7c58('0x5')+_0x19f757,_0x30141b);UserNotificationEvents['on'](_0x19f757,_0x34e504);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6292c14..4973be7 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1da52d,_0x223882){var _0x5b1b6d=function(_0x1d189a){while(--_0x1d189a){_0x1da52d['push'](_0x1da52d['shift']());}};_0x5b1b6d(++_0x223882);}(_0x70e0,0x17b));var _0x070e=function(_0x294b06,_0xdf0995){_0x294b06=_0x294b06-0x0;var _0x2b7daf=_0x70e0[_0x294b06];return _0x2b7daf;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x348687,_0x40de9a){var _0x5cc47a=function(_0x238d40){while(--_0x238d40){_0x348687['push'](_0x348687['shift']());}};_0x5cc47a(++_0x40de9a);}(_0xedd9,0xfc));var _0x9edd=function(_0x504317,_0x170ddc){_0x504317=_0x504317-0x0;var _0x6e09a0=_0xedd9[_0x504317];return _0x6e09a0;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 559605c..ca64c81 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 _0xcb6a=['INTEGER','sequelize','exports'];(function(_0x12fc6d,_0x1b2dc1){var _0x2929f0=function(_0x406001){while(--_0x406001){_0x12fc6d['push'](_0x12fc6d['shift']());}};_0x2929f0(++_0x1b2dc1);}(_0xcb6a,0x1b1));var _0xacb6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xcb6a[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0xacb6('0x0'));module[_0xacb6('0x1')]={'penalty':{'type':Sequelize[_0xacb6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa4d1=['INTEGER','sequelize'];(function(_0x4a23dd,_0x2e44d5){var _0xd6312d=function(_0x497c15){while(--_0x497c15){_0x4a23dd['push'](_0x4a23dd['shift']());}};_0xd6312d(++_0x2e44d5);}(_0xa4d1,0x1d3));var _0x1a4d=function(_0x4c96de,_0x233a3f){_0x4c96de=_0x4c96de-0x0;var _0x3e150a=_0xa4d1[_0x4c96de];return _0x3e150a;};'use strict';var Sequelize=require(_0x1a4d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1a4d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 7a61770..9ab99ad 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 _0x11ca=['../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','api','moment','bluebird','request-promise','path'];(function(_0x47b54b,_0x54ff19){var _0x150c7f=function(_0x582b9c){while(--_0x582b9c){_0x47b54b['push'](_0x47b54b['shift']());}};_0x150c7f(++_0x54ff19);}(_0x11ca,0x19c));var _0xa11c=function(_0x4f4555,_0x441fd0){_0x4f4555=_0x4f4555-0x0;var _0x595df5=_0x11ca[_0x4f4555];return _0x595df5;};'use strict';var _=require('lodash');var util=require(_0xa11c('0x0'));var logger=require('../../config/logger')(_0xa11c('0x1'));var moment=require(_0xa11c('0x2'));var BPromise=require(_0xa11c('0x3'));var rp=require(_0xa11c('0x4'));var fs=require('fs');var path=require(_0xa11c('0x5'));var rimraf=require('rimraf');var config=require(_0xa11c('0x6'));var attributes=require(_0xa11c('0x7'));module[_0xa11c('0x8')]=function(_0x380fc6,_0x553756){return _0x380fc6['define'](_0xa11c('0x9'),attributes,{'tableName':_0xa11c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d60=['path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2d60,0xfe));var _0x02d6=function(_0x2d730d,_0xb53a5e){_0x2d730d=_0x2d730d-0x0;var _0x4084e0=_0x2d60[_0x2d730d];return _0x4084e0;};'use strict';var _=require(_0x02d6('0x0'));var util=require(_0x02d6('0x1'));var logger=require(_0x02d6('0x2'))(_0x02d6('0x3'));var moment=require(_0x02d6('0x4'));var BPromise=require('bluebird');var rp=require(_0x02d6('0x5'));var fs=require('fs');var path=require(_0x02d6('0x6'));var rimraf=require('rimraf');var config=require(_0x02d6('0x7'));var attributes=require(_0x02d6('0x8'));module[_0x02d6('0x9')]=function(_0x56778b,_0x11c210){return _0x56778b[_0x02d6('0xa')](_0x02d6('0xb'),attributes,{'tableName':_0x02d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index dd6af2e..85f520f 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 _0xece6=['../../config/logger','rpc','../../config/environment','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2daea7,_0x41e7da){var _0x1f01bd=function(_0x39417b){while(--_0x39417b){_0x2daea7['push'](_0x2daea7['shift']());}};_0x1f01bd(++_0x41e7da);}(_0xece6,0x1c8));var _0x6ece=function(_0x5a28ed,_0x2bcf10){_0x5a28ed=_0x5a28ed-0x0;var _0x4d4f6a=_0xece6[_0x5a28ed];return _0x4d4f6a;};'use strict';var _=require(_0x6ece('0x0'));var util=require(_0x6ece('0x1'));var moment=require(_0x6ece('0x2'));var BPromise=require(_0x6ece('0x3'));var rs=require(_0x6ece('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ece('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ece('0x6'))(_0x6ece('0x7'));var config=require(_0x6ece('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ece('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e058d,_0xc45887,_0x2e8edc){return new BPromise(function(_0x3c85c3,_0x233fc5){return client[_0x6ece('0xa')](_0x4e058d,_0x2e8edc)[_0x6ece('0xb')](function(_0x19cc32){logger['info'](_0x6ece('0xc'),_0xc45887,_0x6ece('0xd'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xc45887,'request\x20sent',JSON[_0x6ece('0xe')](_0x19cc32));if(_0x19cc32['error']){if(_0x19cc32[_0x6ece('0xf')][_0x6ece('0x10')]===0x1f4){logger[_0x6ece('0xf')](_0x6ece('0xc'),_0xc45887,_0x19cc32[_0x6ece('0xf')]['message']);return _0x233fc5(_0x19cc32[_0x6ece('0xf')][_0x6ece('0x11')]);}logger[_0x6ece('0xf')](_0x6ece('0xc'),_0xc45887,_0x19cc32['error'][_0x6ece('0x11')]);return _0x3c85c3(_0x19cc32[_0x6ece('0xf')][_0x6ece('0x11')]);}else{logger[_0x6ece('0x12')](_0x6ece('0xc'),_0xc45887,_0x6ece('0xd'));_0x3c85c3(_0x19cc32[_0x6ece('0x13')][_0x6ece('0x11')]);}})[_0x6ece('0x14')](function(_0x290fec){logger[_0x6ece('0xf')](_0x6ece('0xc'),_0xc45887,_0x290fec);_0x233fc5(_0x290fec);});});} \ No newline at end of file +var _0x2c5c=['jayson/promise','client','request','then','request\x20sent','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x3bdd40,_0x414ee6){var _0x216370=function(_0x3e6252){while(--_0x3e6252){_0x3bdd40['push'](_0x3bdd40['shift']());}};_0x216370(++_0x414ee6);}(_0x2c5c,0x1b1));var _0xc2c5=function(_0x540f53,_0x431afd){_0x540f53=_0x540f53-0x0;var _0x2bb84f=_0x2c5c[_0x540f53];return _0x2bb84f;};'use strict';var _=require(_0xc2c5('0x0'));var util=require(_0xc2c5('0x1'));var moment=require(_0xc2c5('0x2'));var BPromise=require(_0xc2c5('0x3'));var rs=require(_0xc2c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc2c5('0x6'))(_0xc2c5('0x7'));var config=require('../../config/environment');var jayson=require(_0xc2c5('0x8'));var client=jayson[_0xc2c5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb2bb01,_0x3cb299,_0x3f4e2f){return new BPromise(function(_0x528641,_0x14ae80){return client[_0xc2c5('0xa')](_0xb2bb01,_0x3f4e2f)[_0xc2c5('0xb')](function(_0x251474){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x3cb299,_0xc2c5('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3cb299,_0xc2c5('0xc'),JSON[_0xc2c5('0xd')](_0x251474));if(_0x251474[_0xc2c5('0xe')]){if(_0x251474[_0xc2c5('0xe')][_0xc2c5('0xf')]===0x1f4){logger[_0xc2c5('0xe')](_0xc2c5('0x10'),_0x3cb299,_0x251474[_0xc2c5('0xe')][_0xc2c5('0x11')]);return _0x14ae80(_0x251474['error'][_0xc2c5('0x11')]);}logger['error'](_0xc2c5('0x10'),_0x3cb299,_0x251474['error'][_0xc2c5('0x11')]);return _0x528641(_0x251474[_0xc2c5('0xe')]['message']);}else{logger[_0xc2c5('0x12')](_0xc2c5('0x10'),_0x3cb299,_0xc2c5('0xc'));_0x528641(_0x251474[_0xc2c5('0x13')][_0xc2c5('0x11')]);}})[_0xc2c5('0x14')](function(_0x4536a7){logger['error'](_0xc2c5('0x10'),_0x3cb299,_0x4536a7);_0x14ae80(_0x4536a7);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 54346e7..91127bb 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 _0x2c78=['./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe4d94d,_0xcc9b88){var _0xbd5374=function(_0x386d41){while(--_0x386d41){_0xe4d94d['push'](_0xe4d94d['shift']());}};_0xbd5374(++_0xcc9b88);}(_0x2c78,0xa4));var _0x82c7=function(_0x369a41,_0x5ed95c){_0x369a41=_0x369a41-0x0;var _0x16807d=_0x2c78[_0x369a41];return _0x16807d;};'use strict';var multer=require('multer');var util=require(_0x82c7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x82c7('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x82c7('0x2'));var interaction=require(_0x82c7('0x3'));var config=require('../../config/environment');var controller=require(_0x82c7('0x4'));router[_0x82c7('0x5')]('/',auth['isAuthenticated'](),controller[_0x82c7('0x6')]);router['get'](_0x82c7('0x7'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x9')]);router[_0x82c7('0x5')](_0x82c7('0xa'),auth[_0x82c7('0x8')](),controller[_0x82c7('0xb')]);router[_0x82c7('0x5')](_0x82c7('0xc'),auth[_0x82c7('0x8')](),controller[_0x82c7('0xd')]);router[_0x82c7('0x5')](_0x82c7('0xe'),auth[_0x82c7('0x8')](),controller[_0x82c7('0xf')]);router[_0x82c7('0x10')]('/',auth['isAuthenticated'](),controller[_0x82c7('0x11')]);router[_0x82c7('0x10')](_0x82c7('0x12'),auth['isAuthenticated'](),controller[_0x82c7('0x13')]);router[_0x82c7('0x10')](_0x82c7('0xc'),auth['isAuthenticated'](),controller[_0x82c7('0x14')]);router[_0x82c7('0x10')](_0x82c7('0xe'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x15')]);router[_0x82c7('0x16')](_0x82c7('0xa'),auth['isAuthenticated'](),controller[_0x82c7('0x17')]);router[_0x82c7('0x18')](_0x82c7('0xa'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x19')]);router[_0x82c7('0x18')](_0x82c7('0xc'),auth[_0x82c7('0x8')](),controller[_0x82c7('0x1a')]);router[_0x82c7('0x18')](_0x82c7('0xe'),auth['isAuthenticated'](),controller[_0x82c7('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x1fde=['isAuthenticated','index','get','/:id','show','/:id/sections','getSections','post','clone','/:id/resources','addResources','put','update','delete','removeSections','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller'];(function(_0x46f41c,_0x19341e){var _0x50c38e=function(_0x5c2f15){while(--_0x5c2f15){_0x46f41c['push'](_0x46f41c['shift']());}};_0x50c38e(++_0x19341e);}(_0x1fde,0x74));var _0xe1fd=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x1fde[_0x295a3d];return _0x23a732;};'use strict';var multer=require(_0xe1fd('0x0'));var util=require(_0xe1fd('0x1'));var path=require(_0xe1fd('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1fd('0x3'));var router=express[_0xe1fd('0x4')]();var fs_extra=require(_0xe1fd('0x5'));var auth=require(_0xe1fd('0x6'));var interaction=require(_0xe1fd('0x7'));var config=require('../../config/environment');var controller=require(_0xe1fd('0x8'));router['get']('/',auth[_0xe1fd('0x9')](),controller[_0xe1fd('0xa')]);router[_0xe1fd('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe1fd('0xb')](_0xe1fd('0xc'),auth[_0xe1fd('0x9')](),controller[_0xe1fd('0xd')]);router['get'](_0xe1fd('0xe'),auth[_0xe1fd('0x9')](),controller[_0xe1fd('0xf')]);router[_0xe1fd('0xb')]('/:id/resources',auth[_0xe1fd('0x9')](),controller['getResources']);router[_0xe1fd('0x10')]('/',auth[_0xe1fd('0x9')](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xe1fd('0x11')]);router[_0xe1fd('0x10')](_0xe1fd('0xe'),auth[_0xe1fd('0x9')](),controller['addSections']);router[_0xe1fd('0x10')](_0xe1fd('0x12'),auth[_0xe1fd('0x9')](),controller[_0xe1fd('0x13')]);router[_0xe1fd('0x14')](_0xe1fd('0xc'),auth[_0xe1fd('0x9')](),controller[_0xe1fd('0x15')]);router[_0xe1fd('0x16')](_0xe1fd('0xc'),auth[_0xe1fd('0x9')](),controller['destroy']);router['delete'](_0xe1fd('0xe'),auth[_0xe1fd('0x9')](),controller[_0xe1fd('0x17')]);router[_0xe1fd('0x16')](_0xe1fd('0x12'),auth['isAuthenticated'](),controller['removeResources']);module[_0xe1fd('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 9dc592e..68cf590 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 _0x0ebd=['exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0ebd,0x1df));var _0xd0eb=function(_0xf670e1,_0x207ae1){_0xf670e1=_0xf670e1-0x0;var _0x59d7c9=_0x0ebd[_0xf670e1];return _0x59d7c9;};'use strict';var Sequelize=require(_0xd0eb('0x0'));module[_0xd0eb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd0eb('0x2')},'crudPermissions':{'type':Sequelize[_0xd0eb('0x3')],'set':function(_0x807e0e){this[_0xd0eb('0x4')](_0xd0eb('0x5'),_0x807e0e?_0x807e0e[_0xd0eb('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xd0eb('0x5'))?this[_0xd0eb('0x7')](_0xd0eb('0x5'))[_0xd0eb('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd0eb('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5d91=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x5d91,0x180));var _0x15d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5d91[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x15d9('0x0'));module[_0x15d9('0x1')]={'name':{'type':Sequelize[_0x15d9('0x2')],'allowNull':![],'unique':_0x15d9('0x3')},'crudPermissions':{'type':Sequelize[_0x15d9('0x2')],'set':function(_0x146e31){this[_0x15d9('0x4')](_0x15d9('0x5'),_0x146e31?_0x146e31[_0x15d9('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x15d9('0x5'))?this[_0x15d9('0x7')](_0x15d9('0x5'))[_0x15d9('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x15d9('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x15d9('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x15d9('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x15d9('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x15d9('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x15d9('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x15d9('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index cc8a012..e9b3eb8 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 _0x7f2f=['order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','get','createdAt','updatedAt','crudPermissions','omit','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','sequelize','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0xcec785,_0x126335){var _0x557953=function(_0x5e250e){while(--_0x5e250e){_0xcec785['push'](_0xcec785['shift']());}};_0x557953(++_0x126335);}(_0x7f2f,0x198));var _0xf7f2=function(_0x26a515,_0x286339){_0x26a515=_0x26a515-0x0;var _0x314682=_0x7f2f[_0x26a515];return _0x314682;};'use strict';var emlformat=require(_0xf7f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7f2('0x1'));var jsonpatch=require(_0xf7f2('0x2'));var rp=require(_0xf7f2('0x3'));var moment=require(_0xf7f2('0x4'));var BPromise=require(_0xf7f2('0x5'));var Mustache=require('mustache');var util=require(_0xf7f2('0x6'));var path=require('path');var sox=require(_0xf7f2('0x7'));var csv=require(_0xf7f2('0x8'));var ejs=require(_0xf7f2('0x9'));var fs=require('fs');var fs_extra=require(_0xf7f2('0xa'));var _=require(_0xf7f2('0xb'));var squel=require(_0xf7f2('0xc'));var crypto=require(_0xf7f2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf7f2('0xe'));var toCsv=require(_0xf7f2('0x8'));var querystring=require('querystring');var Papa=require(_0xf7f2('0xf'));var Redis=require(_0xf7f2('0x10'));var authService=require(_0xf7f2('0x11'));var qs=require(_0xf7f2('0x12'));var as=require(_0xf7f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7f2('0x14'))(_0xf7f2('0x15'));var utils=require(_0xf7f2('0x16'));var config=require(_0xf7f2('0x17'));var licenseUtil=require(_0xf7f2('0x18'));var db=require(_0xf7f2('0x19'))['db'];config[_0xf7f2('0x1a')]=_['defaults'](config['redis'],{'host':_0xf7f2('0x1b'),'port':0x18eb});var socket=require(_0xf7f2('0x1c'))(new Redis(config['redis']));require(_0xf7f2('0x1d'))[_0xf7f2('0x1e')](socket);function respondWithStatusCode(_0x316c18,_0x28190b){_0x28190b=_0x28190b||0xcc;return function(_0x49212c){if(_0x49212c){return _0x316c18[_0xf7f2('0x1f')](_0x28190b);}return _0x316c18[_0xf7f2('0x20')](_0x28190b)[_0xf7f2('0x21')]();};}function respondWithResult(_0x48ac89,_0x10921d){_0x10921d=_0x10921d||0xc8;return function(_0x219b10){if(_0x219b10){return _0x48ac89[_0xf7f2('0x20')](_0x10921d)['json'](_0x219b10);}};}function respondWithFilteredResult(_0x3609e5,_0x2343f8){return function(_0x3c08e1){if(_0x3c08e1){var _0x3806ca=typeof _0x2343f8['offset']===_0xf7f2('0x22')&&typeof _0x2343f8['limit']===_0xf7f2('0x22');var _0x4f637b=_0x3c08e1[_0xf7f2('0x23')];var _0x474328=_0x3806ca?0x0:_0x2343f8[_0xf7f2('0x24')];var _0x397bd2=_0x3806ca?_0x3c08e1[_0xf7f2('0x23')]:_0x2343f8[_0xf7f2('0x24')]+_0x2343f8[_0xf7f2('0x25')];var _0x2351cc;if(_0x397bd2>=_0x4f637b){_0x397bd2=_0x4f637b;_0x2351cc=0xc8;}else{_0x2351cc=0xce;}_0x3609e5['status'](_0x2351cc);return _0x3609e5[_0xf7f2('0x26')](_0xf7f2('0x27'),_0x474328+'-'+_0x397bd2+'/'+_0x4f637b)['json'](_0x3c08e1);}return null;};}function patchUpdates(_0x563c39){return function(_0x3f2aa4){try{jsonpatch[_0xf7f2('0x28')](_0x3f2aa4,_0x563c39,!![]);}catch(_0x43b942){return BPromise[_0xf7f2('0x29')](_0x43b942);}return _0x3f2aa4['save']();};}function saveUpdates(_0x50bba5,_0x4583b6){return function(_0x41ec91){if(_0x41ec91){return _0x41ec91[_0xf7f2('0x2a')](_0x50bba5)[_0xf7f2('0x2b')](function(_0x306acc){return _0x306acc;});}return null;};}function removeEntity(_0x59839b,_0x33f1b5){return function(_0x4a76aa){if(_0x4a76aa){return _0x4a76aa[_0xf7f2('0x2c')]()[_0xf7f2('0x2b')](function(){_0x59839b[_0xf7f2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2d94,_0x33542a){return function(_0x518274){if(!_0x518274){_0xb2d94[_0xf7f2('0x1f')](0x194);}return _0x518274;};}function handleError(_0x17f913,_0x1f5a33){_0x1f5a33=_0x1f5a33||0x1f4;return function(_0x172487){logger[_0xf7f2('0x2d')](_0x172487[_0xf7f2('0x2e')]);if(_0x172487[_0xf7f2('0x2f')]){delete _0x172487[_0xf7f2('0x2f')];}_0x17f913[_0xf7f2('0x20')](_0x1f5a33)[_0xf7f2('0x30')](_0x172487);};}exports[_0xf7f2('0x31')]=function(_0x11e4f9,_0x5d3ea2){var _0x436bf7={},_0x28e113={},_0x475db6={'count':0x0,'rows':[]};var _0x249114=_[_0xf7f2('0x32')](db[_0xf7f2('0x33')][_0xf7f2('0x34')],function(_0x58f044){return{'name':_0x58f044[_0xf7f2('0x35')],'type':_0x58f044[_0xf7f2('0x36')][_0xf7f2('0x37')]};});_0x28e113[_0xf7f2('0x38')]=_[_0xf7f2('0x32')](_0x249114,'name');_0x28e113[_0xf7f2('0x39')]=_[_0xf7f2('0x3a')](_0x11e4f9[_0xf7f2('0x39')]);_0x28e113[_0xf7f2('0x3b')]=_[_0xf7f2('0x3c')](_0x28e113[_0xf7f2('0x38')],_0x28e113[_0xf7f2('0x39')]);_0x436bf7[_0xf7f2('0x3d')]=_[_0xf7f2('0x3c')](_0x28e113[_0xf7f2('0x38')],qs[_0xf7f2('0x3e')](_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x3e')]));_0x436bf7['attributes']=_0x436bf7[_0xf7f2('0x3d')][_0xf7f2('0x3f')]?_0x436bf7['attributes']:_0x28e113['model'];if(!_0x11e4f9[_0xf7f2('0x39')]['hasOwnProperty']('nolimit')){_0x436bf7[_0xf7f2('0x25')]=qs['limit'](_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x25')]);_0x436bf7[_0xf7f2('0x24')]=qs['offset'](_0x11e4f9['query'][_0xf7f2('0x24')]);}_0x436bf7[_0xf7f2('0x40')]=qs['sort'](_0x11e4f9['query']['sort']);_0x436bf7['where']=qs[_0xf7f2('0x3b')](_[_0xf7f2('0x41')](_0x11e4f9[_0xf7f2('0x39')],_0x28e113[_0xf7f2('0x3b')]),_0x249114);if(_0x11e4f9['query'][_0xf7f2('0x42')]){_0x436bf7['where']=_[_0xf7f2('0x43')](_0x436bf7[_0xf7f2('0x44')],{'$or':_[_0xf7f2('0x32')](_0x249114,function(_0x5acfc2){if(_0x5acfc2['type']!==_0xf7f2('0x45')){var _0x5084f9={};_0x5084f9[_0x5acfc2[_0xf7f2('0x2f')]]={'$like':'%'+_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x42')]+'%'};return _0x5084f9;}})});}_0x436bf7=_[_0xf7f2('0x43')]({},_0x436bf7,_0x11e4f9[_0xf7f2('0x46')]);var _0x56eb92={'where':_0x436bf7[_0xf7f2('0x44')]};return db[_0xf7f2('0x33')][_0xf7f2('0x23')](_0x56eb92)['then'](function(_0x4e5515){_0x475db6[_0xf7f2('0x23')]=_0x4e5515;if(_0x11e4f9[_0xf7f2('0x39')][_0xf7f2('0x47')]){_0x436bf7[_0xf7f2('0x48')]=[{'all':!![]}];}return db[_0xf7f2('0x33')][_0xf7f2('0x49')](_0x436bf7);})[_0xf7f2('0x2b')](function(_0x193827){_0x475db6[_0xf7f2('0x4a')]=_0x193827;return _0x475db6;})['then'](respondWithFilteredResult(_0x5d3ea2,_0x436bf7))[_0xf7f2('0x4b')](handleError(_0x5d3ea2,null));};exports[_0xf7f2('0x4c')]=function(_0x569561,_0x97ad0){var _0x4e7dae={'raw':![],'where':{'id':_0x569561[_0xf7f2('0x4d')]['id']}},_0xd0cc00={};_0xd0cc00[_0xf7f2('0x38')]=_[_0xf7f2('0x3a')](db['UserProfile']['rawAttributes']);_0xd0cc00[_0xf7f2('0x39')]=_[_0xf7f2('0x3a')](_0x569561[_0xf7f2('0x39')]);_0xd0cc00[_0xf7f2('0x3b')]=_[_0xf7f2('0x3c')](_0xd0cc00['model'],_0xd0cc00['query']);_0x4e7dae[_0xf7f2('0x3d')]=_[_0xf7f2('0x3c')](_0xd0cc00['model'],qs[_0xf7f2('0x3e')](_0x569561[_0xf7f2('0x39')][_0xf7f2('0x3e')]));_0x4e7dae[_0xf7f2('0x3d')]=_0x4e7dae[_0xf7f2('0x3d')]['length']?_0x4e7dae[_0xf7f2('0x3d')]:_0xd0cc00[_0xf7f2('0x38')];if(_0x569561[_0xf7f2('0x39')][_0xf7f2('0x47')]){_0x4e7dae[_0xf7f2('0x48')]=[{'all':!![]}];}_0x4e7dae=_[_0xf7f2('0x43')]({},_0x4e7dae,_0x569561[_0xf7f2('0x46')]);return db[_0xf7f2('0x33')][_0xf7f2('0x4e')](_0x4e7dae)[_0xf7f2('0x2b')](handleEntityNotFound(_0x97ad0,null))[_0xf7f2('0x2b')](respondWithResult(_0x97ad0,null))[_0xf7f2('0x4b')](handleError(_0x97ad0,null));};exports[_0xf7f2('0x4f')]=function(_0x5de7c2,_0x5d69ec){return db['UserProfile']['create'](_0x5de7c2[_0xf7f2('0x50')],{})[_0xf7f2('0x2b')](respondWithResult(_0x5d69ec,0xc9))['catch'](handleError(_0x5d69ec,null));};exports[_0xf7f2('0x51')]=function(_0x56377a,_0x2d71cb){var _0x3deed0={'where':{'id':_0x56377a[_0xf7f2('0x4d')]['id']}},_0xb92dcf={};_0xb92dcf[_0xf7f2('0x38')]=_['keys'](db[_0xf7f2('0x33')][_0xf7f2('0x34')]);_0x3deed0[_0xf7f2('0x3d')]=_[_0xf7f2('0x3c')](_0xb92dcf[_0xf7f2('0x38')],qs[_0xf7f2('0x3e')](_0x56377a['query']['fields']));_0x3deed0[_0xf7f2('0x3d')]=_0x3deed0[_0xf7f2('0x3d')][_0xf7f2('0x3f')]?_0x3deed0[_0xf7f2('0x3d')]:_0xb92dcf['model'];if(_0x56377a['query'][_0xf7f2('0x47')]){_0x3deed0[_0xf7f2('0x48')]=[{'all':!![]}];}_0x3deed0=_[_0xf7f2('0x43')]({},_0x3deed0,_0x56377a[_0xf7f2('0x46')]);return db['UserProfile']['find'](_0x3deed0)[_0xf7f2('0x2b')](handleEntityNotFound(_0x2d71cb,null))[_0xf7f2('0x2b')](function(_0x1479a6){if(_0x1479a6){var _0x270815=_0x1479a6[_0xf7f2('0x52')]({'plain':!![]});_0x270815=qs['omit'](_0x270815,['id',_0xf7f2('0x53'),_0xf7f2('0x54'),_0xf7f2('0x55')]);_0x56377a['body']=_[_0xf7f2('0x56')](_0x56377a[_0xf7f2('0x50')],['id',_0xf7f2('0x53'),'updatedAt']);return db['sequelize'][_0xf7f2('0x57')](function(_0x3af47b){return db[_0xf7f2('0x33')]['create'](_[_0xf7f2('0x43')](_0x270815,_0x56377a[_0xf7f2('0x50')]),{'include':_0x56377a['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3af47b})['then'](function(_0x4ec067){var _0x281ba7=_0x4ec067[_0xf7f2('0x52')]({'plain':!![]});return db['UserProfileSection'][_0xf7f2('0x49')]({'where':{'userProfileId':_0x56377a['params']['id']},'raw':!![]})['then'](function(_0x331916){if(_0x331916){return BPromise[_0xf7f2('0x58')](_0x331916,function(_0x343128){return new BPromise(function(_0x2e797e,_0x3fd62e){if(_0x343128['autoAssociation']===null||_0x343128[_0xf7f2('0x59')]===0x1)_0x2e797e(null);return db[_0xf7f2('0x5a')][_0xf7f2('0x49')]({'where':{'sectionId':_0x343128['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x92da48){var _0x18246b=_[_0xf7f2('0x32')](_0x92da48,function(_0x132135){return qs[_0xf7f2('0x56')](_0x132135,['id',_0xf7f2('0x53'),_0xf7f2('0x54'),_0xf7f2('0x5b')]);});_0x2e797e(_0x18246b);})[_0xf7f2('0x4b')](function(_0x21d858){_0x3fd62e(_0x21d858);});})[_0xf7f2('0x2b')](function(_0x13f5b0){var _0x5e8a8d=qs[_0xf7f2('0x56')](_0x343128,['id',_0xf7f2('0x53'),_0xf7f2('0x54')]);_0x5e8a8d[_0xf7f2('0x5c')]=_0x281ba7['id'];if(_0x13f5b0)_0x5e8a8d[_0xf7f2('0x5d')]=_0x13f5b0;return _0x5e8a8d;})['then'](function(_0x225467){return db[_0xf7f2('0x5e')][_0xf7f2('0x4f')](_0x225467,{'include':[{'model':db[_0xf7f2('0x5a')],'as':_0xf7f2('0x5d')}],'raw':!![],'transaction':_0x3af47b});});})[_0xf7f2('0x2b')](function(){return _0x281ba7;});}});});});}})[_0xf7f2('0x2b')](respondWithResult(_0x2d71cb,0xc9))[_0xf7f2('0x4b')](handleError(_0x2d71cb,null));};exports[_0xf7f2('0x2a')]=function(_0xc096d,_0x36fab3){if(_0xc096d[_0xf7f2('0x50')]['id']){delete _0xc096d[_0xf7f2('0x50')]['id'];}return db['UserProfile']['find']({'where':{'id':_0xc096d['params']['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x36fab3,null))[_0xf7f2('0x2b')](saveUpdates(_0xc096d[_0xf7f2('0x50')],null))[_0xf7f2('0x2b')](respondWithResult(_0x36fab3,null))[_0xf7f2('0x4b')](handleError(_0x36fab3,null));};exports[_0xf7f2('0x2c')]=function(_0x5ddb53,_0x5aba52){return db['UserProfile'][_0xf7f2('0x4e')]({'where':{'id':_0x5ddb53[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x5aba52,null))[_0xf7f2('0x2b')](removeEntity(_0x5aba52,null))[_0xf7f2('0x4b')](handleError(_0x5aba52,null));};exports[_0xf7f2('0x5f')]=function(_0x53f15d,_0x282b4b){return db[_0xf7f2('0x33')]['describe']()[_0xf7f2('0x2b')](respondWithResult(_0x282b4b,null))['catch'](handleError(_0x282b4b,null));};exports[_0xf7f2('0x60')]=function(_0x55bd13,_0x147b2c){var _0x1e7dd4=_0x55bd13['body'];return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x55bd13[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x147b2c,null))[_0xf7f2('0x2b')](function(_0x4d26d8){if(_0x4d26d8){return db[_0xf7f2('0x61')][_0xf7f2('0x57')](function(_0x169b47){return db[_0xf7f2('0x5e')][_0xf7f2('0x2c')]({'where':{'userProfileId':_0x55bd13[_0xf7f2('0x4d')]['id'],'sectionId':_[_0xf7f2('0x32')](_0x1e7dd4,function(_0x8515eb){return _0x8515eb[_0xf7f2('0x5b')];})},'transaction':_0x169b47})[_0xf7f2('0x2b')](function(){var _0x26862b=_[_0xf7f2('0x32')](_0x1e7dd4,function(_0x408eaf){_0x408eaf['userProfileId']=_0x55bd13[_0xf7f2('0x4d')]['id'];return _0x408eaf;});var _0x1e271e=[];return BPromise[_0xf7f2('0x58')](_0x26862b,function(_0x277a82){return db[_0xf7f2('0x5e')][_0xf7f2('0x4f')](_0x277a82,{'include':[{'model':db[_0xf7f2('0x5a')],'as':_0xf7f2('0x5d')}],'raw':!![],'transaction':_0x169b47})[_0xf7f2('0x2b')](function(_0x120c8){_0x1e271e[_0xf7f2('0x62')](_0x120c8[_0xf7f2('0x52')]({'plain':!![]}));});})[_0xf7f2('0x2b')](function(){return _0x1e271e;});});});}})[_0xf7f2('0x2b')](function(_0x41feee){return _0x41feee;})[_0xf7f2('0x2b')](respondWithResult(_0x147b2c,null))[_0xf7f2('0x4b')](handleError(_0x147b2c,null));};exports[_0xf7f2('0x63')]=function(_0x5d0a50,_0x2442c0){var _0x3f623d;return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x5d0a50[_0xf7f2('0x4d')]['id']},'attributes':['id',_0xf7f2('0x2f')]})[_0xf7f2('0x2b')](handleEntityNotFound(_0x2442c0,null))['then'](function(_0x573bf2){if(_0x573bf2){_0x3f623d=_0x573bf2;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x5d0a50[_0xf7f2('0x4d')]['id'],'sectionId':_0x5d0a50['query'][_0xf7f2('0x64')]}});}})['then'](function(){return _0x3f623d;})[_0xf7f2('0x2b')](respondWithStatusCode(_0x2442c0,null))[_0xf7f2('0x4b')](handleError(_0x2442c0,null));};exports['getSections']=function(_0x22ad61,_0x4e8258){var _0x25b958=[];var _0x1145ca=[];return db[_0xf7f2('0x5e')]['findAll']({'where':{'userProfileId':_0x22ad61['params']['id']},'raw':!![]})['then'](function(_0xe1c7d5){_0x25b958=_[_0xf7f2('0x42')](_0xe1c7d5,function(_0x585bf9){return _0x585bf9[_0xf7f2('0x65')]===0x1||_[_0xf7f2('0x66')]([0x3eb,0x709],_0x585bf9[_0xf7f2('0x5b')]);});if(!_[_0xf7f2('0x67')](_0x25b958)){return _[_0xf7f2('0x32')](_0x25b958,function(_0x24fb1d){return _0x24fb1d['sectionId'];});}else{return;}})[_0xf7f2('0x2b')](function(_0x4a1e02){if(_0x4a1e02)_0x1145ca=_0x4a1e02;if(_[_0xf7f2('0x66')](_0x1145ca,0x64)){var _0x1b5d7f=_['find'](_0x25b958,{'sectionId':0x64});return hasDefaultDashboard(_0x1b5d7f)['then'](function(_0x41329e){return _[_0xf7f2('0x32')](_0x25b958,function(_0x4a579c){if(_0x4a579c[_0xf7f2('0x5b')]===0x64){_0x4a579c[_0xf7f2('0x68')]=_0x41329e;}return _0x4a579c;});});}else{return;}})['then'](function(_0x3a026d){if(_0x3a026d)_0x25b958=_0x3a026d;if(_[_0xf7f2('0x66')](_0x1145ca,0x3eb)){var _0x44986b=_[_0xf7f2('0x4e')](_0x25b958,{'sectionId':0x3eb});return getCustomDashboards(_0x44986b)[_0xf7f2('0x2b')](function(_0xedf1af){return _[_0xf7f2('0x32')](_0x25b958,function(_0x2c295b){if(_0x44986b[_0xf7f2('0x65')]){if(_0x2c295b[_0xf7f2('0x5b')]===0x3eb){_0x2c295b[_0xf7f2('0x68')]=_0xedf1af;}}else{if(_0x2c295b[_0xf7f2('0x5b')]===0x64){if(!_0x2c295b[_0xf7f2('0x68')]){_0x2c295b['subsections']=[];}_0x2c295b[_0xf7f2('0x68')]=_0x2c295b[_0xf7f2('0x68')][_0xf7f2('0x69')](_0xedf1af);}}return _0x2c295b;});});}else{return;}})[_0xf7f2('0x2b')](function(_0x56a365){if(_0x56a365)_0x25b958=_0x56a365;if(_[_0xf7f2('0x66')](_0x1145ca,0x709)){var _0x39a3aa=_[_0xf7f2('0x4e')](_0x25b958,{'sectionId':0x709});return getPlugins(_0x39a3aa)[_0xf7f2('0x2b')](function(_0x2dcf33){if(_0x39a3aa[_0xf7f2('0x65')]){return _[_0xf7f2('0x32')](_0x25b958,function(_0x2c3d25){if(_0x2c3d25[_0xf7f2('0x5b')]===0x709){_0x2c3d25[_0xf7f2('0x68')]=_0x2dcf33;}return _0x2c3d25;});}else{var _0x2aa5c6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2dcf33};var _0x1cb034=_[_0xf7f2('0x32')](_0x25b958);_0x1cb034[_0xf7f2('0x62')](_0x2aa5c6);return _0x1cb034;}});}else{return;}})[_0xf7f2('0x2b')](function(_0x1e0953){if(_0x1e0953)_0x25b958=_0x1e0953;return _['filter'](_0x25b958,[_0xf7f2('0x65'),0x1]);})[_0xf7f2('0x2b')](respondWithResult(_0x4e8258,null))['catch'](handleError(_0x4e8258,null));};function hasDefaultDashboard(_0x2c69c2){var _0x11cc43=[0x65];return new BPromise(function(_0x11822b,_0x36c6cf){try{if(_0x2c69c2[_0xf7f2('0x59')]){_0x11822b(_0x11cc43);}else{return db[_0xf7f2('0x5a')][_0xf7f2('0x6a')]({'where':{'sectionId':_0x2c69c2['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x7c6477){_0x7c6477?_0x11822b(_0x11cc43):_0x11822b();});}}catch(_0xee0fb5){_0x36c6cf(_0xee0fb5);}});}function getCustomDashboards(_0x230ed5){var _0x43c1ce=[];return new BPromise(function(_0x59eb2c,_0x3a5f00){try{if(_0x230ed5[_0xf7f2('0x59')]){return db['Dashboard'][_0xf7f2('0x49')]({'raw':!![]})['then'](function(_0x403295){_0x403295[_0xf7f2('0x6b')](function(_0x839737){_0x43c1ce[_0xf7f2('0x62')](_0x839737['id']+0x1869f);});_0x59eb2c(_0x43c1ce);});}else{return db['UserProfileResource'][_0xf7f2('0x49')]({'where':{'sectionId':_0x230ed5['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x184cea){_0x184cea[_0xf7f2('0x6b')](function(_0x36417e){_0x43c1ce[_0xf7f2('0x62')](_0x36417e[_0xf7f2('0x6c')]+0x1869f);});_0x59eb2c(_0x43c1ce);});}}catch(_0x51c926){_0x3a5f00(_0x51c926);}});}function getPlugins(_0x4f3b74){var _0x553e6c=[];return new BPromise(function(_0x5cd576,_0x2aaa02){try{if(_0x4f3b74['autoAssociation']){return db[_0xf7f2('0x6d')][_0xf7f2('0x49')]({'raw':!![]})['then'](function(_0x53c44b){_0x53c44b[_0xf7f2('0x6b')](function(_0x5ff483){_0x553e6c[_0xf7f2('0x62')](_0x5ff483['id']+0x15b38);});_0x5cd576(_0x553e6c);});}else{return db['UserProfileResource'][_0xf7f2('0x49')]({'where':{'sectionId':_0x4f3b74['id']},'raw':!![]})[_0xf7f2('0x2b')](function(_0x3073c7){_0x3073c7[_0xf7f2('0x6b')](function(_0x564d99){_0x553e6c[_0xf7f2('0x62')](_0x564d99[_0xf7f2('0x6c')]+0x15b38);});_0x5cd576(_0x553e6c);});}}catch(_0x25e01e){_0x2aaa02(_0x25e01e);}});}exports[_0xf7f2('0x6e')]=function(_0x3b7cb7,_0xc10c99){return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x3b7cb7['params']['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0xc10c99,null))[_0xf7f2('0x2b')](function(_0x595d12){if(_0x595d12){return db['sequelize'][_0xf7f2('0x57')](function(_0x283d59){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3b7cb7['params']['id']},'attributes':['id'],'raw':!![]})[_0xf7f2('0x2b')](function(_0x3a1c7d){if(_0x3a1c7d){return db[_0xf7f2('0x5e')][_0xf7f2('0x2c')]({'where':{'userProfileId':_0x3b7cb7[_0xf7f2('0x4d')]['id'],'id':_[_0xf7f2('0x32')](_0x3a1c7d,function(_0x4236d4){return _0x4236d4['id'];})},'transaction':_0x283d59});}})[_0xf7f2('0x2b')](function(_0x58f421){var _0x54b76d=_['map'](_0x3b7cb7[_0xf7f2('0x50')],function(_0x28ddd9){_0x28ddd9[_0xf7f2('0x5c')]=_0x3b7cb7['params']['id'];return _0x28ddd9;});return db[_0xf7f2('0x5e')][_0xf7f2('0x6f')](_0x54b76d,{'raw':!![],'transaction':_0x283d59});})[_0xf7f2('0x2b')](function(_0x2dba6e){var _0x55fea0=_[_0xf7f2('0x42')](_[_0xf7f2('0x32')](_0x2dba6e,function(_0x1c5cce){return _0x1c5cce[_0xf7f2('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x55fea0){return db[_0xf7f2('0x5e')][_0xf7f2('0x49')]({'where':{'userProfileId':_0x3b7cb7['params']['id'],'sectionId':_[_0xf7f2('0x32')](_0x55fea0,function(_0x51d8d7){return _0x51d8d7[_0xf7f2('0x5b')];})},'attributes':['id',_0xf7f2('0x5b')],'raw':!![]})['then'](function(_0x2430ce){var _0x2f9b2b=_[_0xf7f2('0x32')](_0x3b7cb7[_0xf7f2('0x50')],function(_0x5debe0){_0x5debe0[_0xf7f2('0x5c')]=_0x3b7cb7['params']['id'];return _0x5debe0;});return db[_0xf7f2('0x5a')][_0xf7f2('0x6f')](_0x2f9b2b,{'raw':!![],'transaction':_0x283d59});});}})[_0xf7f2('0x4b')](handleError(_0xc10c99,null));});}})[_0xf7f2('0x2b')](function(_0x3812cf){var _0x14c886=_['map'](_0x3812cf,function(_0x3a82c5){return _0x3a82c5[_0xf7f2('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0xc10c99,null))[_0xf7f2('0x4b')](handleError(_0xc10c99,null));};exports[_0xf7f2('0x70')]=function(_0x4e89e1,_0x4731f2,_0x3ab7c9){return db[_0xf7f2('0x33')][_0xf7f2('0x4e')]({'where':{'id':_0x4e89e1[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](handleEntityNotFound(_0x4731f2,null))['then'](function(_0x48e5e4){if(_0x48e5e4){return _0x48e5e4[_0xf7f2('0x70')](_0x4e89e1[_0xf7f2('0x39')][_0xf7f2('0x64')]);}})[_0xf7f2('0x2b')](respondWithStatusCode(_0x4731f2,null))[_0xf7f2('0x4b')](handleError(_0x4731f2,null));};exports[_0xf7f2('0x71')]=function(_0x48c20f,_0x4a21fd){var _0x1d5a8c={};if(!_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x72')])throw new Error(_0xf7f2('0x73'));if(!_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x74')](_0xf7f2('0x75'))){_0x1d5a8c[_0xf7f2('0x25')]=qs[_0xf7f2('0x25')](_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x25')]);_0x1d5a8c[_0xf7f2('0x24')]=qs[_0xf7f2('0x24')](_0x48c20f[_0xf7f2('0x39')][_0xf7f2('0x24')]);}return db['UserProfile'][_0xf7f2('0x4e')]({'where':{'id':_0x48c20f[_0xf7f2('0x4d')]['id']}})[_0xf7f2('0x2b')](function(_0x440d42){if(!_0x440d42)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x48c20f[_0xf7f2('0x4d')]['id']);return db['UserProfile'][_0xf7f2('0x71')](_0x48c20f);})[_0xf7f2('0x2b')](respondWithFilteredResult(_0x4a21fd,_0x1d5a8c))[_0xf7f2('0x4b')](handleError(_0x4a21fd,null));}; \ No newline at end of file +var _0x9ec7=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','map','UserProfile','fieldName','type','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','options','find','create','body','rawAttributes','get','omit','createdAt','updatedAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','status'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9ec7,0x123));var _0x79ec=function(_0x22bf3a,_0x40d3cf){_0x22bf3a=_0x22bf3a-0x0;var _0x3511a9=_0x9ec7[_0x22bf3a];return _0x3511a9;};'use strict';var emlformat=require(_0x79ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x79ec('0x1'));var rp=require(_0x79ec('0x2'));var moment=require(_0x79ec('0x3'));var BPromise=require(_0x79ec('0x4'));var Mustache=require(_0x79ec('0x5'));var util=require(_0x79ec('0x6'));var path=require('path');var sox=require(_0x79ec('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79ec('0x8'));var _=require(_0x79ec('0x9'));var squel=require(_0x79ec('0xa'));var crypto=require(_0x79ec('0xb'));var jsforce=require(_0x79ec('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79ec('0xd'));var Papa=require(_0x79ec('0xe'));var Redis=require('ioredis');var authService=require(_0x79ec('0xf'));var qs=require(_0x79ec('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79ec('0x11'));var logger=require(_0x79ec('0x12'))('api');var utils=require(_0x79ec('0x13'));var config=require(_0x79ec('0x14'));var licenseUtil=require(_0x79ec('0x15'));var db=require(_0x79ec('0x16'))['db'];config[_0x79ec('0x17')]=_[_0x79ec('0x18')](config[_0x79ec('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79ec('0x17')]));require(_0x79ec('0x19'))['register'](socket);function respondWithStatusCode(_0x2131e2,_0x316999){_0x316999=_0x316999||0xcc;return function(_0x45c472){if(_0x45c472){return _0x2131e2['sendStatus'](_0x316999);}return _0x2131e2[_0x79ec('0x1a')](_0x316999)[_0x79ec('0x1b')]();};}function respondWithResult(_0x178214,_0x147309){_0x147309=_0x147309||0xc8;return function(_0x386d17){if(_0x386d17){return _0x178214[_0x79ec('0x1a')](_0x147309)[_0x79ec('0x1c')](_0x386d17);}};}function respondWithFilteredResult(_0x3c9e57,_0x158109){return function(_0x28b837){if(_0x28b837){var _0x154b41=typeof _0x158109[_0x79ec('0x1d')]===_0x79ec('0x1e')&&typeof _0x158109[_0x79ec('0x1f')]===_0x79ec('0x1e');var _0x3d2c4d=_0x28b837[_0x79ec('0x20')];var _0x59d18e=_0x154b41?0x0:_0x158109[_0x79ec('0x1d')];var _0x11b3d6=_0x154b41?_0x28b837[_0x79ec('0x20')]:_0x158109['offset']+_0x158109[_0x79ec('0x1f')];var _0x2474e0;if(_0x11b3d6>=_0x3d2c4d){_0x11b3d6=_0x3d2c4d;_0x2474e0=0xc8;}else{_0x2474e0=0xce;}_0x3c9e57[_0x79ec('0x1a')](_0x2474e0);return _0x3c9e57[_0x79ec('0x21')](_0x79ec('0x22'),_0x59d18e+'-'+_0x11b3d6+'/'+_0x3d2c4d)[_0x79ec('0x1c')](_0x28b837);}return null;};}function patchUpdates(_0x34570b){return function(_0x4b67e7){try{jsonpatch[_0x79ec('0x23')](_0x4b67e7,_0x34570b,!![]);}catch(_0x1f2f3c){return BPromise['reject'](_0x1f2f3c);}return _0x4b67e7[_0x79ec('0x24')]();};}function saveUpdates(_0x2264cd,_0x32c5c1){return function(_0x5549b7){if(_0x5549b7){return _0x5549b7[_0x79ec('0x25')](_0x2264cd)[_0x79ec('0x26')](function(_0x91a407){return _0x91a407;});}return null;};}function removeEntity(_0x416ebb,_0x462e7a){return function(_0x4f4f1c){if(_0x4f4f1c){return _0x4f4f1c[_0x79ec('0x27')]()[_0x79ec('0x26')](function(){_0x416ebb['status'](0xcc)[_0x79ec('0x1b')]();});}};}function handleEntityNotFound(_0x128a84,_0x3dece3){return function(_0x12bb06){if(!_0x12bb06){_0x128a84[_0x79ec('0x28')](0x194);}return _0x12bb06;};}function handleError(_0x5b9cd6,_0x53dcd5){_0x53dcd5=_0x53dcd5||0x1f4;return function(_0x37ce9f){logger[_0x79ec('0x29')](_0x37ce9f['stack']);if(_0x37ce9f[_0x79ec('0x2a')]){delete _0x37ce9f[_0x79ec('0x2a')];}_0x5b9cd6[_0x79ec('0x1a')](_0x53dcd5)['send'](_0x37ce9f);};}exports[_0x79ec('0x2b')]=function(_0x51c40b,_0x349a4e){var _0x513f7e={},_0x28b4c1={},_0x3b43c4={'count':0x0,'rows':[]};var _0x5201f1=_[_0x79ec('0x2c')](db[_0x79ec('0x2d')]['rawAttributes'],function(_0x61d0d2){return{'name':_0x61d0d2[_0x79ec('0x2e')],'type':_0x61d0d2[_0x79ec('0x2f')]['key']};});_0x28b4c1['model']=_[_0x79ec('0x2c')](_0x5201f1,_0x79ec('0x2a'));_0x28b4c1['query']=_[_0x79ec('0x30')](_0x51c40b['query']);_0x28b4c1[_0x79ec('0x31')]=_[_0x79ec('0x32')](_0x28b4c1[_0x79ec('0x33')],_0x28b4c1[_0x79ec('0x34')]);_0x513f7e['attributes']=_['intersection'](_0x28b4c1[_0x79ec('0x33')],qs[_0x79ec('0x35')](_0x51c40b[_0x79ec('0x34')]['fields']));_0x513f7e['attributes']=_0x513f7e[_0x79ec('0x36')][_0x79ec('0x37')]?_0x513f7e[_0x79ec('0x36')]:_0x28b4c1[_0x79ec('0x33')];if(!_0x51c40b[_0x79ec('0x34')][_0x79ec('0x38')]('nolimit')){_0x513f7e[_0x79ec('0x1f')]=qs[_0x79ec('0x1f')](_0x51c40b[_0x79ec('0x34')][_0x79ec('0x1f')]);_0x513f7e['offset']=qs[_0x79ec('0x1d')](_0x51c40b[_0x79ec('0x34')]['offset']);}_0x513f7e[_0x79ec('0x39')]=qs[_0x79ec('0x3a')](_0x51c40b[_0x79ec('0x34')][_0x79ec('0x3a')]);_0x513f7e[_0x79ec('0x3b')]=qs['filters'](_[_0x79ec('0x3c')](_0x51c40b[_0x79ec('0x34')],_0x28b4c1[_0x79ec('0x31')]),_0x5201f1);if(_0x51c40b['query'][_0x79ec('0x3d')]){_0x513f7e[_0x79ec('0x3b')]=_[_0x79ec('0x3e')](_0x513f7e['where'],{'$or':_[_0x79ec('0x2c')](_0x5201f1,function(_0x33f068){if(_0x33f068[_0x79ec('0x2f')]!==_0x79ec('0x3f')){var _0x3305a1={};_0x3305a1[_0x33f068[_0x79ec('0x2a')]]={'$like':'%'+_0x51c40b['query']['filter']+'%'};return _0x3305a1;}})});}_0x513f7e=_['merge']({},_0x513f7e,_0x51c40b['options']);var _0x45e0ee={'where':_0x513f7e[_0x79ec('0x3b')]};return db[_0x79ec('0x2d')][_0x79ec('0x20')](_0x45e0ee)[_0x79ec('0x26')](function(_0x2b108e){_0x3b43c4[_0x79ec('0x20')]=_0x2b108e;if(_0x51c40b[_0x79ec('0x34')]['includeAll']){_0x513f7e['include']=[{'all':!![]}];}return db[_0x79ec('0x2d')][_0x79ec('0x40')](_0x513f7e);})[_0x79ec('0x26')](function(_0xc49a36){_0x3b43c4[_0x79ec('0x41')]=_0xc49a36;return _0x3b43c4;})[_0x79ec('0x26')](respondWithFilteredResult(_0x349a4e,_0x513f7e))[_0x79ec('0x42')](handleError(_0x349a4e,null));};exports[_0x79ec('0x43')]=function(_0x426862,_0x57dd63){var _0x2079bb={'raw':![],'where':{'id':_0x426862[_0x79ec('0x44')]['id']}},_0x1bcda8={};_0x1bcda8[_0x79ec('0x33')]=_[_0x79ec('0x30')](db[_0x79ec('0x2d')]['rawAttributes']);_0x1bcda8[_0x79ec('0x34')]=_['keys'](_0x426862[_0x79ec('0x34')]);_0x1bcda8[_0x79ec('0x31')]=_[_0x79ec('0x32')](_0x1bcda8['model'],_0x1bcda8[_0x79ec('0x34')]);_0x2079bb[_0x79ec('0x36')]=_['intersection'](_0x1bcda8[_0x79ec('0x33')],qs[_0x79ec('0x35')](_0x426862['query'][_0x79ec('0x35')]));_0x2079bb['attributes']=_0x2079bb[_0x79ec('0x36')][_0x79ec('0x37')]?_0x2079bb[_0x79ec('0x36')]:_0x1bcda8['model'];if(_0x426862[_0x79ec('0x34')][_0x79ec('0x45')]){_0x2079bb['include']=[{'all':!![]}];}_0x2079bb=_['merge']({},_0x2079bb,_0x426862[_0x79ec('0x46')]);return db[_0x79ec('0x2d')][_0x79ec('0x47')](_0x2079bb)[_0x79ec('0x26')](handleEntityNotFound(_0x57dd63,null))[_0x79ec('0x26')](respondWithResult(_0x57dd63,null))[_0x79ec('0x42')](handleError(_0x57dd63,null));};exports[_0x79ec('0x48')]=function(_0x5bb304,_0x59efcc){return db[_0x79ec('0x2d')][_0x79ec('0x48')](_0x5bb304[_0x79ec('0x49')],{})[_0x79ec('0x26')](respondWithResult(_0x59efcc,0xc9))[_0x79ec('0x42')](handleError(_0x59efcc,null));};exports['clone']=function(_0x531836,_0x27226c){var _0x5c59c2={'where':{'id':_0x531836['params']['id']}},_0x82b29={};_0x82b29[_0x79ec('0x33')]=_[_0x79ec('0x30')](db[_0x79ec('0x2d')][_0x79ec('0x4a')]);_0x5c59c2['attributes']=_[_0x79ec('0x32')](_0x82b29[_0x79ec('0x33')],qs[_0x79ec('0x35')](_0x531836['query'][_0x79ec('0x35')]));_0x5c59c2['attributes']=_0x5c59c2[_0x79ec('0x36')][_0x79ec('0x37')]?_0x5c59c2[_0x79ec('0x36')]:_0x82b29['model'];if(_0x531836[_0x79ec('0x34')][_0x79ec('0x45')]){_0x5c59c2['include']=[{'all':!![]}];}_0x5c59c2=_[_0x79ec('0x3e')]({},_0x5c59c2,_0x531836[_0x79ec('0x46')]);return db['UserProfile'][_0x79ec('0x47')](_0x5c59c2)[_0x79ec('0x26')](handleEntityNotFound(_0x27226c,null))[_0x79ec('0x26')](function(_0x1cfdf0){if(_0x1cfdf0){var _0x41b377=_0x1cfdf0[_0x79ec('0x4b')]({'plain':!![]});_0x41b377=qs[_0x79ec('0x4c')](_0x41b377,['id',_0x79ec('0x4d'),_0x79ec('0x4e'),'crudPermissions']);_0x531836[_0x79ec('0x49')]=_[_0x79ec('0x4c')](_0x531836['body'],['id',_0x79ec('0x4d'),_0x79ec('0x4e')]);return db['sequelize'][_0x79ec('0x4f')](function(_0x2723bc){return db[_0x79ec('0x2d')]['create'](_[_0x79ec('0x3e')](_0x41b377,_0x531836['body']),{'include':_0x531836[_0x79ec('0x34')][_0x79ec('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x2723bc})[_0x79ec('0x26')](function(_0x1fd7b8){var _0x179404=_0x1fd7b8[_0x79ec('0x4b')]({'plain':!![]});return db[_0x79ec('0x50')][_0x79ec('0x40')]({'where':{'userProfileId':_0x531836['params']['id']},'raw':!![]})[_0x79ec('0x26')](function(_0x4643b5){if(_0x4643b5){return BPromise[_0x79ec('0x51')](_0x4643b5,function(_0x8ddac2){return new BPromise(function(_0x574f9f,_0x100ac1){if(_0x8ddac2[_0x79ec('0x52')]===null||_0x8ddac2[_0x79ec('0x52')]===0x1)_0x574f9f(null);return db[_0x79ec('0x53')][_0x79ec('0x40')]({'where':{'sectionId':_0x8ddac2['id']},'raw':!![]})[_0x79ec('0x26')](function(_0x2d8095){var _0x2597ae=_['map'](_0x2d8095,function(_0x10f82f){return qs[_0x79ec('0x4c')](_0x10f82f,['id',_0x79ec('0x4d'),'updatedAt',_0x79ec('0x54')]);});_0x574f9f(_0x2597ae);})[_0x79ec('0x42')](function(_0x3469cf){_0x100ac1(_0x3469cf);});})[_0x79ec('0x26')](function(_0x7e6922){var _0x15ff28=qs[_0x79ec('0x4c')](_0x8ddac2,['id',_0x79ec('0x4d'),_0x79ec('0x4e')]);_0x15ff28[_0x79ec('0x55')]=_0x179404['id'];if(_0x7e6922)_0x15ff28[_0x79ec('0x56')]=_0x7e6922;return _0x15ff28;})[_0x79ec('0x26')](function(_0x4e045b){return db[_0x79ec('0x50')][_0x79ec('0x48')](_0x4e045b,{'include':[{'model':db[_0x79ec('0x53')],'as':_0x79ec('0x56')}],'raw':!![],'transaction':_0x2723bc});});})[_0x79ec('0x26')](function(){return _0x179404;});}});});});}})[_0x79ec('0x26')](respondWithResult(_0x27226c,0xc9))[_0x79ec('0x42')](handleError(_0x27226c,null));};exports[_0x79ec('0x25')]=function(_0x3cfa57,_0x3eda42){if(_0x3cfa57[_0x79ec('0x49')]['id']){delete _0x3cfa57[_0x79ec('0x49')]['id'];}return db[_0x79ec('0x2d')][_0x79ec('0x47')]({'where':{'id':_0x3cfa57['params']['id']}})['then'](handleEntityNotFound(_0x3eda42,null))['then'](saveUpdates(_0x3cfa57[_0x79ec('0x49')],null))[_0x79ec('0x26')](respondWithResult(_0x3eda42,null))[_0x79ec('0x42')](handleError(_0x3eda42,null));};exports['destroy']=function(_0x3eaea1,_0x3d5299){return db[_0x79ec('0x2d')][_0x79ec('0x47')]({'where':{'id':_0x3eaea1['params']['id']}})[_0x79ec('0x26')](handleEntityNotFound(_0x3d5299,null))[_0x79ec('0x26')](removeEntity(_0x3d5299,null))['catch'](handleError(_0x3d5299,null));};exports[_0x79ec('0x57')]=function(_0x1a2131,_0x444007){return db[_0x79ec('0x2d')][_0x79ec('0x57')]()[_0x79ec('0x26')](respondWithResult(_0x444007,null))[_0x79ec('0x42')](handleError(_0x444007,null));};exports[_0x79ec('0x58')]=function(_0x2b4acd,_0x2e745b){var _0x16e52c=_0x2b4acd[_0x79ec('0x49')];return db[_0x79ec('0x2d')][_0x79ec('0x47')]({'where':{'id':_0x2b4acd[_0x79ec('0x44')]['id']}})[_0x79ec('0x26')](handleEntityNotFound(_0x2e745b,null))[_0x79ec('0x26')](function(_0x36b910){if(_0x36b910){return db['sequelize'][_0x79ec('0x4f')](function(_0x283270){return db[_0x79ec('0x50')][_0x79ec('0x27')]({'where':{'userProfileId':_0x2b4acd[_0x79ec('0x44')]['id'],'sectionId':_[_0x79ec('0x2c')](_0x16e52c,function(_0x190188){return _0x190188[_0x79ec('0x54')];})},'transaction':_0x283270})[_0x79ec('0x26')](function(){var _0x38a834=_['map'](_0x16e52c,function(_0x5f203a){_0x5f203a[_0x79ec('0x55')]=_0x2b4acd[_0x79ec('0x44')]['id'];return _0x5f203a;});var _0x2f4ec7=[];return BPromise[_0x79ec('0x51')](_0x38a834,function(_0x499618){return db[_0x79ec('0x50')][_0x79ec('0x48')](_0x499618,{'include':[{'model':db[_0x79ec('0x53')],'as':_0x79ec('0x56')}],'raw':!![],'transaction':_0x283270})[_0x79ec('0x26')](function(_0x47f744){_0x2f4ec7[_0x79ec('0x59')](_0x47f744[_0x79ec('0x4b')]({'plain':!![]}));});})['then'](function(){return _0x2f4ec7;});});});}})[_0x79ec('0x26')](function(_0x193291){return _0x193291;})[_0x79ec('0x26')](respondWithResult(_0x2e745b,null))[_0x79ec('0x42')](handleError(_0x2e745b,null));};exports['removeSections']=function(_0x27a229,_0x524de0){var _0x449e2e;return db[_0x79ec('0x2d')][_0x79ec('0x47')]({'where':{'id':_0x27a229[_0x79ec('0x44')]['id']},'attributes':['id',_0x79ec('0x2a')]})['then'](handleEntityNotFound(_0x524de0,null))[_0x79ec('0x26')](function(_0x253968){if(_0x253968){_0x449e2e=_0x253968;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x27a229['params']['id'],'sectionId':_0x27a229[_0x79ec('0x34')][_0x79ec('0x5a')]}});}})[_0x79ec('0x26')](function(){return _0x449e2e;})[_0x79ec('0x26')](respondWithStatusCode(_0x524de0,null))['catch'](handleError(_0x524de0,null));};exports[_0x79ec('0x5b')]=function(_0x4c07b7,_0x10f096){var _0x313b3d=[];var _0x21fec6=[];return db[_0x79ec('0x50')][_0x79ec('0x40')]({'where':{'userProfileId':_0x4c07b7[_0x79ec('0x44')]['id']},'raw':!![]})[_0x79ec('0x26')](function(_0x2523ed){_0x313b3d=_[_0x79ec('0x3d')](_0x2523ed,function(_0x1db3da){return _0x1db3da[_0x79ec('0x5c')]===0x1||_[_0x79ec('0x5d')]([0x3eb,0x709],_0x1db3da['sectionId']);});if(!_[_0x79ec('0x5e')](_0x313b3d)){return _[_0x79ec('0x2c')](_0x313b3d,function(_0x392fdb){return _0x392fdb[_0x79ec('0x54')];});}else{return;}})[_0x79ec('0x26')](function(_0x33165e){if(_0x33165e)_0x21fec6=_0x33165e;if(_['includes'](_0x21fec6,0x64)){var _0x37999e=_[_0x79ec('0x47')](_0x313b3d,{'sectionId':0x64});return hasDefaultDashboard(_0x37999e)[_0x79ec('0x26')](function(_0x48b847){return _[_0x79ec('0x2c')](_0x313b3d,function(_0x3565d8){if(_0x3565d8[_0x79ec('0x54')]===0x64){_0x3565d8[_0x79ec('0x5f')]=_0x48b847;}return _0x3565d8;});});}else{return;}})[_0x79ec('0x26')](function(_0x167552){if(_0x167552)_0x313b3d=_0x167552;if(_[_0x79ec('0x5d')](_0x21fec6,0x3eb)){var _0x2c9eff=_[_0x79ec('0x47')](_0x313b3d,{'sectionId':0x3eb});return getCustomDashboards(_0x2c9eff)[_0x79ec('0x26')](function(_0x18343e){return _['map'](_0x313b3d,function(_0x1aee28){if(_0x2c9eff[_0x79ec('0x5c')]){if(_0x1aee28[_0x79ec('0x54')]===0x3eb){_0x1aee28[_0x79ec('0x5f')]=_0x18343e;}}else{if(_0x1aee28[_0x79ec('0x54')]===0x64){if(!_0x1aee28['subsections']){_0x1aee28[_0x79ec('0x5f')]=[];}_0x1aee28[_0x79ec('0x5f')]=_0x1aee28['subsections'][_0x79ec('0x60')](_0x18343e);}}return _0x1aee28;});});}else{return;}})[_0x79ec('0x26')](function(_0x4d38e5){if(_0x4d38e5)_0x313b3d=_0x4d38e5;if(_[_0x79ec('0x5d')](_0x21fec6,0x709)){var _0x1ad903=_[_0x79ec('0x47')](_0x313b3d,{'sectionId':0x709});return getPlugins(_0x1ad903)[_0x79ec('0x26')](function(_0x3f9b7d){if(_0x1ad903['enabled']){return _[_0x79ec('0x2c')](_0x313b3d,function(_0x4a306a){if(_0x4a306a[_0x79ec('0x54')]===0x709){_0x4a306a[_0x79ec('0x5f')]=_0x3f9b7d;}return _0x4a306a;});}else{var _0x729924={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3f9b7d};var _0x529d9d=_['map'](_0x313b3d);_0x529d9d['push'](_0x729924);return _0x529d9d;}});}else{return;}})[_0x79ec('0x26')](function(_0x1022df){if(_0x1022df)_0x313b3d=_0x1022df;return _['filter'](_0x313b3d,['enabled',0x1]);})[_0x79ec('0x26')](respondWithResult(_0x10f096,null))[_0x79ec('0x42')](handleError(_0x10f096,null));};function hasDefaultDashboard(_0x5adaac){var _0x5c83a2=[0x65];return new BPromise(function(_0x19d160,_0x10586a){try{if(_0x5adaac[_0x79ec('0x52')]){_0x19d160(_0x5c83a2);}else{return db['UserProfileResource'][_0x79ec('0x61')]({'where':{'sectionId':_0x5adaac['id']},'raw':!![]})[_0x79ec('0x26')](function(_0x2fccfe){_0x2fccfe?_0x19d160(_0x5c83a2):_0x19d160();});}}catch(_0x2d4a7f){_0x10586a(_0x2d4a7f);}});}function getCustomDashboards(_0x31f587){var _0x1e70fe=[];return new BPromise(function(_0x3a03d2,_0x2f7383){try{if(_0x31f587[_0x79ec('0x52')]){return db[_0x79ec('0x62')]['findAll']({'raw':!![]})[_0x79ec('0x26')](function(_0x5acbc2){_0x5acbc2[_0x79ec('0x63')](function(_0x294e9c){_0x1e70fe[_0x79ec('0x59')](_0x294e9c['id']+0x1869f);});_0x3a03d2(_0x1e70fe);});}else{return db[_0x79ec('0x53')][_0x79ec('0x40')]({'where':{'sectionId':_0x31f587['id']},'raw':!![]})[_0x79ec('0x26')](function(_0x8e271c){_0x8e271c[_0x79ec('0x63')](function(_0x4812bf){_0x1e70fe['push'](_0x4812bf[_0x79ec('0x64')]+0x1869f);});_0x3a03d2(_0x1e70fe);});}}catch(_0x252b62){_0x2f7383(_0x252b62);}});}function getPlugins(_0xd63f80){var _0xada265=[];return new BPromise(function(_0x176bb6,_0x2e8238){try{if(_0xd63f80[_0x79ec('0x52')]){return db['Plugin'][_0x79ec('0x40')]({'raw':!![]})[_0x79ec('0x26')](function(_0x260af9){_0x260af9[_0x79ec('0x63')](function(_0x465e59){_0xada265['push'](_0x465e59['id']+0x15b38);});_0x176bb6(_0xada265);});}else{return db[_0x79ec('0x53')][_0x79ec('0x40')]({'where':{'sectionId':_0xd63f80['id']},'raw':!![]})[_0x79ec('0x26')](function(_0x1ad472){_0x1ad472[_0x79ec('0x63')](function(_0x17682c){_0xada265['push'](_0x17682c[_0x79ec('0x64')]+0x15b38);});_0x176bb6(_0xada265);});}}catch(_0x524332){_0x2e8238(_0x524332);}});}exports[_0x79ec('0x65')]=function(_0x11b28f,_0x20ce20){return db[_0x79ec('0x2d')]['find']({'where':{'id':_0x11b28f[_0x79ec('0x44')]['id']}})[_0x79ec('0x26')](handleEntityNotFound(_0x20ce20,null))[_0x79ec('0x26')](function(_0x5ed39e){if(_0x5ed39e){return db['sequelize'][_0x79ec('0x4f')](function(_0x5bb20f){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x11b28f[_0x79ec('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x79ec('0x26')](function(_0x13ec63){if(_0x13ec63){return db[_0x79ec('0x50')][_0x79ec('0x27')]({'where':{'userProfileId':_0x11b28f[_0x79ec('0x44')]['id'],'id':_['map'](_0x13ec63,function(_0x30b642){return _0x30b642['id'];})},'transaction':_0x5bb20f});}})[_0x79ec('0x26')](function(_0x5edb46){var _0x24f9f4=_['map'](_0x11b28f[_0x79ec('0x49')],function(_0xc5e650){_0xc5e650[_0x79ec('0x55')]=_0x11b28f[_0x79ec('0x44')]['id'];return _0xc5e650;});return db['UserProfileSection']['bulkCreate'](_0x24f9f4,{'raw':!![],'transaction':_0x5bb20f});})['then'](function(_0x4e8481){var _0x48eef4=_[_0x79ec('0x3d')](_[_0x79ec('0x2c')](_0x4e8481,function(_0x566e50){return _0x566e50[_0x79ec('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x48eef4){return db['UserProfileSection'][_0x79ec('0x40')]({'where':{'userProfileId':_0x11b28f['params']['id'],'sectionId':_[_0x79ec('0x2c')](_0x48eef4,function(_0x3b84d5){return _0x3b84d5[_0x79ec('0x54')];})},'attributes':['id',_0x79ec('0x54')],'raw':!![]})['then'](function(_0x431237){var _0x47dd9c=_['map'](_0x11b28f[_0x79ec('0x49')],function(_0x26aba0){_0x26aba0[_0x79ec('0x55')]=_0x11b28f[_0x79ec('0x44')]['id'];return _0x26aba0;});return db[_0x79ec('0x53')][_0x79ec('0x66')](_0x47dd9c,{'raw':!![],'transaction':_0x5bb20f});});}})[_0x79ec('0x42')](handleError(_0x20ce20,null));});}})[_0x79ec('0x26')](function(_0x5c828c){var _0x296bf3=_[_0x79ec('0x2c')](_0x5c828c,function(_0x243274){return _0x243274['get']({'plain':!![]});});})[_0x79ec('0x26')](respondWithResult(_0x20ce20,null))['catch'](handleError(_0x20ce20,null));};exports[_0x79ec('0x67')]=function(_0x234df8,_0x481144,_0x45aad5){return db[_0x79ec('0x2d')]['find']({'where':{'id':_0x234df8['params']['id']}})[_0x79ec('0x26')](handleEntityNotFound(_0x481144,null))[_0x79ec('0x26')](function(_0x291f8a){if(_0x291f8a){return _0x291f8a[_0x79ec('0x67')](_0x234df8[_0x79ec('0x34')][_0x79ec('0x5a')]);}})[_0x79ec('0x26')](respondWithStatusCode(_0x481144,null))['catch'](handleError(_0x481144,null));};exports[_0x79ec('0x68')]=function(_0x57aa9a,_0x4bbeb7){var _0x185c93={};if(!_0x57aa9a['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x57aa9a[_0x79ec('0x34')][_0x79ec('0x38')](_0x79ec('0x69'))){_0x185c93[_0x79ec('0x1f')]=qs[_0x79ec('0x1f')](_0x57aa9a['query']['limit']);_0x185c93[_0x79ec('0x1d')]=qs[_0x79ec('0x1d')](_0x57aa9a[_0x79ec('0x34')][_0x79ec('0x1d')]);}return db['UserProfile']['find']({'where':{'id':_0x57aa9a[_0x79ec('0x44')]['id']}})['then'](function(_0x453e12){if(!_0x453e12)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x57aa9a[_0x79ec('0x44')]['id']);return db[_0x79ec('0x2d')][_0x79ec('0x68')](_0x57aa9a);})[_0x79ec('0x26')](respondWithFilteredResult(_0x4bbeb7,_0x185c93))[_0x79ec('0x42')](handleError(_0x4bbeb7,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 2f68548..b1e5418 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 _0xfcf0=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x13dd37,_0x1a62d7){var _0x4018ef=function(_0x24f017){while(--_0x24f017){_0x13dd37['push'](_0x13dd37['shift']());}};_0x4018ef(++_0x1a62d7);}(_0xfcf0,0x138));var _0x0fcf=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0xfcf0[_0x37c8ef];return _0x5eaee9;};'use strict';var EventEmitter=require(_0x0fcf('0x0'));var UserProfile=require(_0x0fcf('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0fcf('0x2')](0x0);var events={'afterCreate':_0x0fcf('0x3'),'afterUpdate':_0x0fcf('0x4'),'afterDestroy':_0x0fcf('0x5')};function emitEvent(_0x5c865e){return function(_0x2fe6d8,_0x265968,_0x3bd34d){UserProfileEvents[_0x0fcf('0x6')](_0x5c865e+':'+_0x2fe6d8['id'],_0x2fe6d8);UserProfileEvents[_0x0fcf('0x6')](_0x5c865e,_0x2fe6d8);_0x3bd34d(null);};}for(var e in events){if(events[_0x0fcf('0x7')](e)){var event=events[e];UserProfile[_0x0fcf('0x8')](e,emitEvent(event));}}module[_0x0fcf('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x794b=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x794b,0x1c2));var _0xb794=function(_0x3e5f69,_0x1eb2b1){_0x3e5f69=_0x3e5f69-0x0;var _0x55df21=_0x794b[_0x3e5f69];return _0x55df21;};'use strict';var EventEmitter=require(_0xb794('0x0'));var UserProfile=require(_0xb794('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb794('0x2')](0x0);var events={'afterCreate':_0xb794('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf9af2a){return function(_0x241c85,_0x4d00a4,_0x5dc6dc){UserProfileEvents[_0xb794('0x4')](_0xf9af2a+':'+_0x241c85['id'],_0x241c85);UserProfileEvents[_0xb794('0x4')](_0xf9af2a,_0x241c85);_0x5dc6dc(null);};}for(var e in events){if(events[_0xb794('0x5')](e)){var event=events[e];UserProfile[_0xb794('0x6')](e,emitEvent(event));}}module[_0xb794('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8698203..4948ae4 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 _0x91b4=['internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','params','isEmpty','union','find','ignore','autoAssociation','model','all','rawAttributes','keys','filters','intersection','fields','attributes','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','options','includeAll','include','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tags','color','tag','true','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','exports','models','filter','field','value','findAll','then','associatedResources','map','name','catch','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','parentSections','ListId','lists','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x91b4,0x9a));var _0x491b=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0x91b4[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x491b('0x0'));var attributes=require(_0x491b('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x491b('0x2')]=function(_0x23148d){var _0x315335=_0x23148d[_0x491b('0x3')];function _0x29bf15(_0x58075b,_0x589bd7){return new Promise(function(_0x441345,_0x21ea1c){if(!_0x589bd7)return _0x441345(null);var _0x12a3d6=_0x589bd7['filter']?{[_0x589bd7[_0x491b('0x4')][_0x491b('0x5')]]:_0x589bd7[_0x491b('0x4')][_0x491b('0x6')]}:undefined;return _0x315335[_0x58075b][_0x491b('0x7')]({'where':_0x12a3d6,'raw':!![]})[_0x491b('0x8')](function(_0x3034a3){_0x589bd7[_0x491b('0x9')]=_[_0x491b('0xa')](_0x3034a3,'id');_0x441345(_0x589bd7);})['catch'](function(_0x113cd5){_0x21ea1c(_0x113cd5);});});}function _0x3ffacc(_0x297d53,_0x1695f4){return new Promise(function(_0x11af4f,_0x25c247){var _0x3dc2ae=_0x297d53[_0x491b('0x4')]?{[_0x297d53[_0x491b('0x4')][_0x491b('0x5')]]:_0x297d53['filter']['value']}:undefined;return _0x315335[_0x297d53['model']][_0x491b('0x7')]({'where':_0x3dc2ae,'raw':!![]})[_0x491b('0x8')](function(_0x460d64){_0x1695f4[_0x491b('0x9')]=_[_0x491b('0xa')](_0x460d64,function(_0x3ab08c){return _0x3ab08c[_0x491b('0xb')];});_0x11af4f(_0x1695f4);})[_0x491b('0xc')](function(_0x262fd7){_0x25c247(_0x262fd7);});});}function _0x167937(_0xbfe088,_0x40ce37,_0x9c8007){if(!_0x40ce37)return Promise[_0x491b('0xd')](null);return new Promise(function(_0xde903f,_0x2e73b9){return _0x315335['UserProfileResource'][_0x491b('0x7')]({'where':{'sectionId':_0x40ce37['id']},'raw':!![]})['then'](function(_0x3416ba){if(_0xbfe088['field']&&_0xbfe088['field']!=='id'){_0x40ce37[_0x491b('0x9')]=_['map'](_0x3416ba,function(_0x16add4){return _0x16add4[_0xbfe088['field']];});}else{if(_0x9c8007===_0x491b('0xe')){_0x40ce37['associatedResources']=_[_0x491b('0xa')](_0x3416ba,function(_0x532eac){return{'id':_0x532eac[_0x491b('0xf')],'type':_0x532eac[_0x491b('0x10')]};});}else{_0x40ce37[_0x491b('0x9')]=_['map'](_0x3416ba,function(_0x1e2449){return _0x1e2449[_0x491b('0xf')];});}}_0xde903f(_0x40ce37);})[_0x491b('0xc')](function(_0x25c54b){_0x2e73b9(_0x25c54b);});});}function _0x41ac11(_0x5af327,_0x587d3e){var _0x395efb={'parentSections':[]};switch(_0x5af327[_0x491b('0x11')]()){case'squareprojects':_0x395efb[_0x491b('0x12')]=_0x491b('0x13');break;case _0x491b('0x14'):_0x395efb['childModel']=_0x491b('0x15');break;case _0x491b('0x16'):_0x395efb[_0x491b('0x12')]=_0x491b('0x17');_0x395efb['parentSections']=[{'name':_0x491b('0x18'),'field':_0x491b('0xb'),'foreignKey':_0x491b('0x19')}];break;case'projects':_0x395efb[_0x491b('0x12')]=_0x491b('0x1a');break;case'contacts':_0x395efb[_0x491b('0x12')]='CmContact';_0x395efb[_0x491b('0x1b')]=[{'name':'Lists','field':'id','foreignKey':_0x491b('0x1c')}];break;case _0x491b('0x1d'):_0x395efb[_0x491b('0x12')]='CmList';break;case _0x491b('0x1e'):_0x395efb[_0x491b('0x12')]='CmCompany';break;case _0x491b('0x1f'):_0x395efb['childModel']='CmCustomField';break;case _0x491b('0x20'):_0x395efb[_0x491b('0x12')]=_0x491b('0x21');break;case _0x491b('0x22'):_0x395efb[_0x491b('0x12')]=_0x491b('0x23');break;case _0x491b('0x24'):_0x395efb['childModel']='FaxQueue';break;case _0x491b('0x25'):_0x395efb[_0x491b('0x12')]=_0x491b('0x26');break;case'inboundroutes':case _0x491b('0x27'):case _0x491b('0x28'):_0x395efb[_0x491b('0x12')]='VoiceExtension';break;case _0x491b('0x29'):_0x395efb['childModel']=_0x491b('0x2a');break;case _0x491b('0x2b'):_0x395efb['childModel']=_0x491b('0x2c');break;case'voicerecordings':_0x395efb[_0x491b('0x12')]=_0x491b('0x2d');_0x395efb[_0x491b('0x1b')]=[{'name':_0x491b('0x2e'),'field':_0x491b('0xb'),'foreignKey':_0x491b('0x2f'),'model':_0x491b('0x30'),'filter':{'field':_0x491b('0x31'),'value':[_0x491b('0x32')]}},{'name':'Telephones','field':_0x491b('0xb'),'foreignKey':_0x491b('0x2f'),'model':'User','filter':{'field':_0x491b('0x31'),'value':[_0x491b('0x33')]}},{'name':_0x491b('0x34'),'field':'name','foreignKey':'queue','model':_0x491b('0x35'),'filter':{'field':_0x491b('0x10'),'value':[_0x491b('0x36')]}},{'name':_0x491b('0x37'),'field':'name','foreignKey':_0x491b('0x38'),'model':_0x491b('0x35'),'filter':{'field':_0x491b('0x10'),'value':[_0x491b('0x39')]}}];break;case _0x491b('0x3a'):_0x395efb[_0x491b('0x12')]=_0x491b('0x3b');break;case _0x491b('0x3c'):_0x395efb[_0x491b('0x12')]='VoiceChanSpy';break;case _0x491b('0x3d'):_0x395efb[_0x491b('0x12')]=_0x491b('0x3e');break;case _0x491b('0x3f'):_0x395efb[_0x491b('0x12')]='Campaign';break;case _0x491b('0x40'):_0x395efb['childModel']=_0x491b('0x41');break;case _0x491b('0x42'):_0x395efb['childModel']=_0x491b('0x43');break;case _0x491b('0x44'):_0x395efb[_0x491b('0x12')]=_0x491b('0x45');break;case _0x491b('0x46'):_0x395efb['childModel']=_0x491b('0x47');break;case _0x491b('0x48'):_0x395efb[_0x491b('0x12')]=_0x491b('0x49');break;case'smsqueues':_0x395efb['childModel']='SmsQueue';break;case _0x491b('0x4a'):_0x395efb['childModel']=_0x491b('0x4b');break;case _0x491b('0x4c'):_0x395efb[_0x491b('0x12')]=_0x491b('0x4d');break;case _0x491b('0x4e'):_0x395efb[_0x491b('0x12')]=_0x491b('0x4f');break;case _0x491b('0x50'):_0x395efb[_0x491b('0x12')]='Team';break;case _0x491b('0x51'):case _0x491b('0x52'):_0x395efb['childModel']=_0x491b('0x35');if(_0x587d3e){_0x395efb[_0x491b('0x1b')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x491b('0x53'):case _0x491b('0x54'):case _0x491b('0x55'):_0x395efb[_0x491b('0x12')]=_0x491b('0x30');if(_0x587d3e){_0x395efb['parentSections']=[{'name':_0x491b('0x56'),'filter':{'field':_0x491b('0x31'),'value':['admin',_0x491b('0x57')]},'ignore':!![]},{'name':_0x491b('0x2e')},{'name':_0x491b('0x58')}];}break;case _0x491b('0x59'):_0x395efb[_0x491b('0x12')]=_0x491b('0x5a');break;case _0x491b('0x5b'):_0x395efb[_0x491b('0x12')]=_0x491b('0x5c');break;case'freshdeskaccounts':_0x395efb[_0x491b('0x12')]=_0x491b('0x5d');break;case _0x491b('0x5e'):_0x395efb[_0x491b('0x12')]=_0x491b('0x5f');break;case _0x491b('0x60'):_0x395efb[_0x491b('0x12')]=_0x491b('0x61');break;case'zohoaccounts':_0x395efb['childModel']=_0x491b('0x62');break;case _0x491b('0x63'):_0x395efb[_0x491b('0x12')]='User';break;case _0x491b('0x64'):_0x395efb[_0x491b('0x12')]=_0x491b('0x65');break;case'dispositions':_0x395efb['childModel']=_0x491b('0x66');break;case _0x491b('0x67'):_0x395efb['childModel']=_0x491b('0x68');break;case _0x491b('0x69'):_0x395efb[_0x491b('0x12')]='Interval';break;case _0x491b('0x6a'):_0x395efb[_0x491b('0x12')]=_0x491b('0x6b');break;case'scheduler':_0x395efb[_0x491b('0x12')]=_0x491b('0x6c');break;case _0x491b('0x6d'):_0x395efb['childModel']=_0x491b('0x6e');break;case _0x491b('0x6f'):_0x395efb['childModel']=_0x491b('0x70');break;case'templates':_0x395efb[_0x491b('0x12')]=_0x491b('0x71');break;case _0x491b('0x72'):_0x395efb[_0x491b('0x12')]=_0x491b('0x73');break;case _0x491b('0x74'):_0x395efb[_0x491b('0x12')]=_0x491b('0x75');break;case _0x491b('0x76'):_0x395efb[_0x491b('0x12')]=_0x491b('0x77');break;case _0x491b('0x78'):_0x395efb['childModel']=_0x491b('0x79');break;case _0x491b('0x7a'):_0x395efb['childModel']=_0x491b('0xe');_0x395efb[_0x491b('0x1b')]=[{'name':'Reports','field':'id','foreignKey':_0x491b('0x7b')}];break;case _0x491b('0x7c'):_0x395efb[_0x491b('0x12')]=_0x491b('0x7d');break;}return _0x395efb;}function _0x284c5b(_0x36ac46,_0x57f6e6){var _0x4d4cf0=_0x36ac46[_0x491b('0x7e')](0x0)['toUpperCase']()+_0x36ac46['slice'](0x1);var _0xff9c4a={'type':_0x315335['Sequelize'][_0x491b('0x7f')][_0x491b('0x80')],'raw':!![]};return new Promise(function(_0x811b4e,_0x43b0ad){var _0xc60bae=squel['select']()[_0x491b('0x5')](_0x491b('0x81')+_0x4d4cf0+_0x491b('0x82'),'id')[_0x491b('0x5')](_0x491b('0x83'))[_0x491b('0x84')](_0x491b('0x85')+_0x36ac46+_0x491b('0x86'),'ui')[_0x491b('0x87')]('ui.UserId\x20=\x20?',_0x57f6e6['id']);return _0x315335['sequelize'][_0x491b('0x88')](_0xc60bae[_0x491b('0x89')](),_0xff9c4a)['then'](function(_0x8d04b7){_0x57f6e6[_0x4d4cf0+_0x491b('0x8a')]=_0x8d04b7;_0x811b4e(_0x8d04b7);})[_0x491b('0xc')](function(_0x2c7f50){_0x43b0ad(_0x2c7f50);});});}return _0x23148d[_0x491b('0x8b')](_0x491b('0x8c'),attributes,{'tableName':_0x491b('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2bb2d0){var _0x4000cd={'raw':_0x2bb2d0[_0x491b('0x88')][_0x491b('0x8e')],'where':{}};var _0xd971ac={};var _0x686af8={'count':0x0,'rows':[]};var _0x5bd74d=_0x2bb2d0[_0x491b('0x88')][_0x491b('0x8f')];var _0x45d807=_0x2bb2d0['query'][_0x491b('0x90')]||![];var _0x65b8d=_0x41ac11(_0x5bd74d,_0x45d807);if(!_0x65b8d[_0x491b('0x12')])throw new Error(_0x491b('0x91')+_0x5bd74d+'\x27');var _0x5ba647=[{'name':_0x5bd74d}];if(!_['isEmpty'](_0x65b8d[_0x491b('0x1b')]))_0x5ba647=_0x65b8d['parentSections'];var _0x27839b=[];for(var _0x35e9da=0x0;_0x35e9da<_0x5ba647[_0x491b('0x92')];_0x35e9da++){_0x27839b[_0x491b('0x93')](_0x315335['UserProfileSection']['find']({'where':{'userProfileId':_0x2bb2d0[_0x491b('0x94')]['id'],'name':_0x5ba647[_0x35e9da][_0x491b('0xb')]},'raw':!![]}));}return Promise['all'](_0x27839b)['then'](function(_0x422360){var _0x4c8bc7=_[_0x491b('0x4')](_0x422360,function(_0x4f61a1){return _0x4f61a1?_0x4f61a1:undefined;});var _0x30e97e=_['filter'](_0x5ba647,['ignore',!![]]);var _0x3702e3=_[_0x491b('0x95')](_0x4c8bc7)&&_[_0x491b('0x95')](_0x30e97e)?null:_[_0x491b('0x96')](_0x30e97e,_0x4c8bc7);if(!_0x3702e3)return null;var _0x22564a=[];for(var _0x21164e=0x0;_0x21164e<_0x3702e3[_0x491b('0x92')];_0x21164e++){var _0x3d4448=_[_0x491b('0x97')](_0x5ba647,function(_0x3f39ed){return _0x3702e3[_0x21164e]?_0x3f39ed[_0x491b('0xb')]===_0x3702e3[_0x21164e]['name']:null;});if(_0x3d4448){if(_0x3702e3[_0x21164e][_0x491b('0x98')]){_0x22564a[_0x491b('0x93')](_0x29bf15(_0x65b8d['childModel'],_0x3702e3[_0x21164e]));}else{if(!_0x3702e3[_0x21164e][_0x491b('0x99')]){_0x22564a[_0x491b('0x93')](_0x167937(_0x3d4448,_0x3702e3[_0x21164e],_0x65b8d[_0x491b('0x12')]));}else{if(_0x3d4448[_0x491b('0x9a')]){_0x22564a[_0x491b('0x93')](_0x3ffacc(_0x3d4448,_0x3702e3[_0x21164e]));}}}}}return Promise[_0x491b('0x9b')](_0x22564a);})[_0x491b('0x8')](function(_0x9b2382){var _0xdff40b=_0x9b2382;var _0x1979f6=null;if(_0xdff40b){_0x1979f6=_0xdff40b['length']===0x1?_0xdff40b[0x0]:null;}if(!_0x1979f6&&!_0xdff40b)return _0x686af8;var _0x2fa8d5=_0x315335[_0x65b8d['childModel']][_0x491b('0x9c')];_0xd971ac['model']=_[_0x491b('0x9d')](_0x2fa8d5);_0xd971ac[_0x491b('0x88')]=_['keys'](_0x2bb2d0['query']);_0xd971ac[_0x491b('0x9e')]=_[_0x491b('0x9f')](_0xd971ac[_0x491b('0x9a')],_0xd971ac[_0x491b('0x88')]);_0x4000cd['attributes']=_[_0x491b('0x9f')](_0xd971ac[_0x491b('0x9a')],qs[_0x491b('0xa0')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xa0')]));_0x4000cd['attributes']=_0x4000cd['attributes'][_0x491b('0x92')]?_0x4000cd[_0x491b('0xa1')]:_0xd971ac[_0x491b('0x9a')];if(!_0x2bb2d0['query']['hasOwnProperty'](_0x491b('0xa2'))){_0x4000cd[_0x491b('0xa3')]=qs[_0x491b('0xa3')](_0x2bb2d0[_0x491b('0x88')]['limit']);_0x4000cd['offset']=qs[_0x491b('0xa4')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xa4')]);}_0x4000cd[_0x491b('0xa5')]=qs[_0x491b('0xa6')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xa6')]);_0x4000cd[_0x491b('0x87')]=qs[_0x491b('0x9e')](_[_0x491b('0xa7')](_0x2bb2d0['query'],_0xd971ac[_0x491b('0x9e')]));if(_0x2bb2d0['query'][_0x491b('0x4')]){_0x4000cd[_0x491b('0x87')]=_[_0x491b('0xa8')](_0x4000cd[_0x491b('0x87')],{'$or':_[_0x491b('0xa')](_0x2fa8d5,function(_0xe69380){if(_0xe69380['type'][_0x491b('0xa9')]!=='VIRTUAL'){var _0x1f3cc7={};_0x1f3cc7[_0xe69380[_0x491b('0x5')]]={'$like':'%'+_0x2bb2d0[_0x491b('0x88')][_0x491b('0x4')]+'%'};return _0x1f3cc7;}})});}var _0x171a03=[];var _0x156cd2=null;var _0x459259={};if(_0x1979f6){_0x156cd2=_['find'](_0x5ba647,[_0x491b('0xb'),_0x1979f6[_0x491b('0xb')]]);if(_0x156cd2[_0x491b('0x5')]){_0x459259={};if(_0x65b8d[_0x491b('0x12')]===_0x491b('0xe')){_0x459259[_0x156cd2[_0x491b('0xaa')]]=_[_0x491b('0xa')](_0x1979f6['associatedResources'],'id');}else{_0x459259[_0x156cd2[_0x491b('0xaa')]]=_0x1979f6[_0x491b('0x9')];}_0x171a03[_0x491b('0x93')](_0x459259);}else{_0x4000cd['where']['id']=_0x1979f6[_0x491b('0x9')];}}else{for(var _0x46310e=0x0;_0x46310e<_0xdff40b['length'];_0x46310e++){_0x156cd2=_[_0x491b('0x97')](_0x5ba647,[_0x491b('0xb'),_0xdff40b[_0x46310e][_0x491b('0xb')]]);if(_0x156cd2['field']){_0x459259={};_0x459259[_0x156cd2['foreignKey']]=_0xdff40b[_0x46310e]['associatedResources'];_0x171a03[_0x491b('0x93')](_0x459259);}else{if(!_0x4000cd[_0x491b('0x87')]['id'])_0x4000cd[_0x491b('0x87')]['id']=[];_0xdff40b[_0x46310e]['associatedResources']['forEach'](function(_0x10f1db){_0x4000cd[_0x491b('0x87')]['id'][_0x491b('0x93')](_0x10f1db);});}}}if(!_[_0x491b('0x95')](_0x171a03)){_0x4000cd[_0x491b('0x87')]=_[_0x491b('0xa8')](_0x4000cd[_0x491b('0x87')],{'$and':{'$or':_0x171a03}});}_0x4000cd=_[_0x491b('0xa8')]({},_0x4000cd,_0x2bb2d0[_0x491b('0xab')]);if(_0x1979f6&&!_0x1979f6['autoAssociation']&&_0x65b8d['childModel']===_0x491b('0xe')){if(_0x2bb2d0[_0x491b('0x88')][_0x491b('0xac')]){_0x4000cd[_0x491b('0xad')]=[{'all':!![]}];}return _0x315335[_0x65b8d[_0x491b('0x12')]][_0x491b('0x7')](_0x4000cd)[_0x491b('0x8')](function(_0x14fbe2){var _0x5d95d4=[];_0x14fbe2['forEach'](function(_0x44f6d7){var _0x1c95c3;switch(_0x44f6d7['reportType']){case _0x491b('0xae'):_0x1c95c3=_[_0x491b('0x97')](_0x1979f6[_0x491b('0x9')],function(_0x45b16d){return _0x45b16d['id']===_0x44f6d7[_0x491b('0x7b')]&&_0x45b16d[_0x491b('0x10')]===_0x491b('0xaf');});break;case _0x491b('0xb0'):_0x1c95c3=_[_0x491b('0x97')](_0x1979f6[_0x491b('0x9')],function(_0x496383){return _0x496383['id']===_0x44f6d7[_0x491b('0x7b')]&&_0x496383[_0x491b('0x10')]===_0x491b('0xb1');});break;}if(_0x1c95c3)_0x5d95d4['push'](_0x44f6d7);});_0x686af8[_0x491b('0xb2')]=_0x5d95d4[_0x491b('0x92')];_0x686af8[_0x491b('0xb3')]=_0x5d95d4;return _0x686af8;});}else{if(!_[_0x491b('0x95')](_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb4')])){_0x4000cd['where']['id']=_0x4000cd[_0x491b('0x87')]['id']?_[_0x491b('0x9f')](_0x4000cd[_0x491b('0x87')]['id'],_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb4')]):_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb4')];if(_0x2bb2d0[_0x491b('0x88')]['customSorting']){_0x4000cd[_0x491b('0xa5')]=_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb5')];}}if(_0x2bb2d0[_0x491b('0x88')][_0x491b('0xb6')]){_0x4000cd[_0x491b('0x87')]=_[_0x491b('0xa8')](_0x4000cd['where'],{'$and':_0x2bb2d0['query']['extraQueryConditions']});}return _0x315335[_0x65b8d[_0x491b('0x12')]][_0x491b('0xb2')]({'where':_0x4000cd[_0x491b('0x87')]})['then'](function(_0x2d34ac){_0x686af8['count']=_0x2d34ac;if(_0x2bb2d0[_0x491b('0x88')][_0x491b('0xac')]){if(_0x65b8d['childModel']===_0x491b('0xb7')){_0x4000cd[_0x491b('0xad')]=[{'model':_0x315335[_0x491b('0x70')],'as':_0x491b('0xb8'),'attributes':['id',_0x491b('0xb'),_0x491b('0xb9')],'required':_0x2bb2d0[_0x491b('0x88')]['tag']?!![]:![]},{'model':_0x315335[_0x491b('0x70')],'as':'ThroughTags','attributes':['id',_0x491b('0xb'),_0x491b('0xb9')],'through':_0x2bb2d0['query']['tag']?{'attributes':[],'where':{'TagId':_0x2bb2d0[_0x491b('0x88')][_0x491b('0xba')]||undefined}}:{},'required':_0x2bb2d0[_0x491b('0x88')][_0x491b('0xba')]?!![]:![]}];}else{_0x4000cd[_0x491b('0xad')]=[{'all':!![]}];}}return _0x315335[_0x65b8d[_0x491b('0x12')]][_0x491b('0x7')](_0x4000cd);})[_0x491b('0x8')](function(_0x3c4ba1){_0x686af8[_0x491b('0xb3')]=_0x3c4ba1;if(_0x5bd74d===_0x491b('0x2e')&&_0x2bb2d0[_0x491b('0x88')]['openTabs']===_0x491b('0xbb')){var _0x40960e=[];for(var _0x54d313=0x0;_0x54d313<_0x686af8[_0x491b('0xb3')]['length'];_0x54d313++){_0x40960e['push'](_0x284c5b(_0x491b('0xbc'),_0x686af8[_0x491b('0xb3')][_0x54d313][_0x491b('0xbd')]));_0x40960e[_0x491b('0x93')](_0x284c5b('sms',_0x686af8[_0x491b('0xb3')][_0x54d313]['dataValues']));_0x40960e[_0x491b('0x93')](_0x284c5b(_0x491b('0xbe'),_0x686af8[_0x491b('0xb3')][_0x54d313][_0x491b('0xbd')]));_0x40960e[_0x491b('0x93')](_0x284c5b(_0x491b('0xbf'),_0x686af8[_0x491b('0xb3')][_0x54d313][_0x491b('0xbd')]));_0x40960e[_0x491b('0x93')](_0x284c5b(_0x491b('0xc0'),_0x686af8[_0x491b('0xb3')][_0x54d313]['dataValues']));_0x40960e['push'](_0x284c5b('whatsapp',_0x686af8['rows'][_0x54d313][_0x491b('0xbd')]));}return Promise['all'](_0x40960e)[_0x491b('0x8')](function(){return _0x686af8;});}return _0x686af8;});}});}}});}; \ No newline at end of file +var _0x180d=['associatedResources','catch','model','map','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','ListId','lists','CmList','companies','CmCompany','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','name','membername','agent','Telephones','User','role','telephone','VoiceQueues','queue','type','inbound','QueueCampaigns','VoiceQueue','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','Template','triggers','Trigger','trunks','Trunk','variables','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','raw','section','mergeResources','length','UserProfileSection','find','params','all','ignore','isEmpty','union','push','autoAssociation','rawAttributes','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','key','VIRTUAL','foreignKey','forEach','options','include','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','includeAll','color','tag','ThroughTags','true','chat','sms','dataValues','fax','openchannel','whatsapp','lodash','squel','exports','models','filter','field','value','then'];(function(_0xd42127,_0x3abecf){var _0x2fa235=function(_0x5e596c){while(--_0x5e596c){_0xd42127['push'](_0xd42127['shift']());}};_0x2fa235(++_0x3abecf);}(_0x180d,0x174));var _0xd180=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x180d[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xd180('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require(_0xd180('0x1'));module[_0xd180('0x2')]=function(_0x55bec2){var _0x240232=_0x55bec2[_0xd180('0x3')];function _0x553e63(_0x5c3070,_0x37aac5){return new Promise(function(_0x4906b5,_0x22800c){if(!_0x37aac5)return _0x4906b5(null);var _0x4f812a=_0x37aac5[_0xd180('0x4')]?{[_0x37aac5[_0xd180('0x4')][_0xd180('0x5')]]:_0x37aac5[_0xd180('0x4')][_0xd180('0x6')]}:undefined;return _0x240232[_0x5c3070]['findAll']({'where':_0x4f812a,'raw':!![]})[_0xd180('0x7')](function(_0xe6edb2){_0x37aac5[_0xd180('0x8')]=_['map'](_0xe6edb2,'id');_0x4906b5(_0x37aac5);})[_0xd180('0x9')](function(_0xaedf77){_0x22800c(_0xaedf77);});});}function _0x11c112(_0x8d7f45,_0x2cb27c){return new Promise(function(_0x2b46be,_0x2845c0){var _0x1100cc=_0x8d7f45[_0xd180('0x4')]?{[_0x8d7f45[_0xd180('0x4')]['field']]:_0x8d7f45[_0xd180('0x4')]['value']}:undefined;return _0x240232[_0x8d7f45[_0xd180('0xa')]]['findAll']({'where':_0x1100cc,'raw':!![]})[_0xd180('0x7')](function(_0x293cb5){_0x2cb27c[_0xd180('0x8')]=_[_0xd180('0xb')](_0x293cb5,function(_0x3725d7){return _0x3725d7['name'];});_0x2b46be(_0x2cb27c);})[_0xd180('0x9')](function(_0x251769){_0x2845c0(_0x251769);});});}function _0x27042b(_0x5a680f,_0x24c9da,_0x51756e){if(!_0x24c9da)return Promise[_0xd180('0xc')](null);return new Promise(function(_0x1ad878,_0x4de7c6){return _0x240232[_0xd180('0xd')][_0xd180('0xe')]({'where':{'sectionId':_0x24c9da['id']},'raw':!![]})[_0xd180('0x7')](function(_0x542bc3){if(_0x5a680f[_0xd180('0x5')]&&_0x5a680f[_0xd180('0x5')]!=='id'){_0x24c9da['associatedResources']=_[_0xd180('0xb')](_0x542bc3,function(_0x38e924){return _0x38e924[_0x5a680f[_0xd180('0x5')]];});}else{if(_0x51756e===_0xd180('0xf')){_0x24c9da[_0xd180('0x8')]=_[_0xd180('0xb')](_0x542bc3,function(_0x1539ab){return{'id':_0x1539ab['resourceId'],'type':_0x1539ab['type']};});}else{_0x24c9da[_0xd180('0x8')]=_[_0xd180('0xb')](_0x542bc3,function(_0x174320){return _0x174320[_0xd180('0x10')];});}}_0x1ad878(_0x24c9da);})[_0xd180('0x9')](function(_0x331e29){_0x4de7c6(_0x331e29);});});}function _0x3d9c00(_0x3e419a,_0x3d8863){var _0x110aeb={'parentSections':[]};switch(_0x3e419a['toLowerCase']()){case _0xd180('0x11'):_0x110aeb[_0xd180('0x12')]='SquareProject';break;case _0xd180('0x13'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x14');break;case _0xd180('0x15'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x16');_0x110aeb[_0xd180('0x17')]=[{'name':_0xd180('0x18'),'field':'name','foreignKey':_0xd180('0x19')}];break;case _0xd180('0x1a'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x1b');break;case'contacts':_0x110aeb[_0xd180('0x12')]=_0xd180('0x1c');_0x110aeb[_0xd180('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0xd180('0x1d')}];break;case _0xd180('0x1e'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x1f');break;case _0xd180('0x20'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x21');break;case'globalcustomfields':_0x110aeb[_0xd180('0x12')]='CmCustomField';break;case'chatqueues':_0x110aeb['childModel']=_0xd180('0x22');break;case _0xd180('0x23'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x24');break;case'faxqueues':_0x110aeb[_0xd180('0x12')]=_0xd180('0x25');break;case'faxaccounts':_0x110aeb[_0xd180('0x12')]=_0xd180('0x26');break;case _0xd180('0x27'):case _0xd180('0x28'):case _0xd180('0x29'):_0x110aeb[_0xd180('0x12')]='VoiceExtension';break;case _0xd180('0x2a'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x2b');break;case _0xd180('0x2c'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x2d');break;case _0xd180('0x2e'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x2f');_0x110aeb['parentSections']=[{'name':_0xd180('0x30'),'field':_0xd180('0x31'),'foreignKey':_0xd180('0x32'),'model':'User','filter':{'field':'role','value':[_0xd180('0x33')]}},{'name':_0xd180('0x34'),'field':'name','foreignKey':'membername','model':_0xd180('0x35'),'filter':{'field':_0xd180('0x36'),'value':[_0xd180('0x37')]}},{'name':_0xd180('0x38'),'field':_0xd180('0x31'),'foreignKey':_0xd180('0x39'),'model':'VoiceQueue','filter':{'field':_0xd180('0x3a'),'value':[_0xd180('0x3b')]}},{'name':_0xd180('0x3c'),'field':_0xd180('0x31'),'foreignKey':_0xd180('0x39'),'model':_0xd180('0x3d'),'filter':{'field':_0xd180('0x3a'),'value':['outbound']}}];break;case _0xd180('0x3e'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x3f');break;case _0xd180('0x40'):_0x110aeb[_0xd180('0x12')]='VoiceChanSpy';break;case _0xd180('0x41'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x42');break;case _0xd180('0x43'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x44');break;case _0xd180('0x45'):_0x110aeb['childModel']=_0xd180('0x46');break;case _0xd180('0x47'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x48');break;case'mailsubstatuses':_0x110aeb['childModel']=_0xd180('0x49');break;case'openchannelqueues':_0x110aeb[_0xd180('0x12')]=_0xd180('0x4a');break;case _0xd180('0x4b'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x4c');break;case _0xd180('0x4d'):_0x110aeb[_0xd180('0x12')]='SmsQueue';break;case _0xd180('0x4e'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x4f');break;case _0xd180('0x50'):_0x110aeb[_0xd180('0x12')]='WhatsappQueue';break;case'whatsappaccounts':_0x110aeb[_0xd180('0x12')]='WhatsappAccount';break;case _0xd180('0x51'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x52');break;case _0xd180('0x53'):case'queuecampaigns':_0x110aeb[_0xd180('0x12')]=_0xd180('0x3d');if(_0x3d8863){_0x110aeb[_0xd180('0x17')]=[{'name':_0xd180('0x38')},{'name':_0xd180('0x3c')}];}break;case _0xd180('0x54'):case _0xd180('0x55'):case _0xd180('0x56'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x35');if(_0x3d8863){_0x110aeb[_0xd180('0x17')]=[{'name':_0xd180('0x57'),'filter':{'field':_0xd180('0x36'),'value':[_0xd180('0x58'),_0xd180('0x59')]},'ignore':!![]},{'name':_0xd180('0x30')},{'name':_0xd180('0x34')}];}break;case _0xd180('0x5a'):_0x110aeb['childModel']=_0xd180('0x5b');break;case _0xd180('0x5c'):_0x110aeb[_0xd180('0x12')]='SalesforceAccount';break;case _0xd180('0x5d'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x5e');break;case _0xd180('0x5f'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x60');break;case _0xd180('0x61'):_0x110aeb[_0xd180('0x12')]='DeskAccount';break;case'zohoaccounts':_0x110aeb[_0xd180('0x12')]='ZohoAccount';break;case'vtigeraccounts':_0x110aeb[_0xd180('0x12')]='User';break;case _0xd180('0x62'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x63');break;case _0xd180('0x64'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x65');break;case _0xd180('0x66'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x67');break;case _0xd180('0x68'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x69');break;case _0xd180('0x6a'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x6b');break;case _0xd180('0x6c'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x6d');break;case _0xd180('0x6e'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x6f');break;case'tags':_0x110aeb[_0xd180('0x12')]=_0xd180('0x70');break;case'templates':_0x110aeb[_0xd180('0x12')]=_0xd180('0x71');break;case _0xd180('0x72'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x73');break;case _0xd180('0x74'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x75');break;case _0xd180('0x76'):_0x110aeb[_0xd180('0x12')]='Variable';break;case'plugins':_0x110aeb[_0xd180('0x12')]='Plugin';break;case _0xd180('0x77'):_0x110aeb[_0xd180('0x12')]=_0xd180('0xf');_0x110aeb[_0xd180('0x17')]=[{'name':_0xd180('0x78'),'field':'id','foreignKey':_0xd180('0x79')}];break;case _0xd180('0x7a'):_0x110aeb[_0xd180('0x12')]=_0xd180('0x7b');break;}return _0x110aeb;}function _0x58ff53(_0xf3fcd5,_0x25f4ce){var _0x1463d9=_0xf3fcd5[_0xd180('0x7c')](0x0)['toUpperCase']()+_0xf3fcd5[_0xd180('0x7d')](0x1);var _0x599dc8={'type':_0x240232[_0xd180('0x7e')]['QueryTypes'][_0xd180('0x7f')],'raw':!![]};return new Promise(function(_0x205cfa,_0x286be4){var _0x452046=squel[_0xd180('0x80')]()[_0xd180('0x5')](_0xd180('0x81')+_0x1463d9+_0xd180('0x82'),'id')['field']('ui.createdAt')[_0xd180('0x83')](_0xd180('0x84')+_0xf3fcd5+_0xd180('0x85'),'ui')['where'](_0xd180('0x86'),_0x25f4ce['id']);return _0x240232[_0xd180('0x87')][_0xd180('0x88')](_0x452046['toString'](),_0x599dc8)[_0xd180('0x7')](function(_0x14c9e5){_0x25f4ce[_0x1463d9+_0xd180('0x89')]=_0x14c9e5;_0x205cfa(_0x14c9e5);})[_0xd180('0x9')](function(_0x2d59f5){_0x286be4(_0x2d59f5);});});}return _0x55bec2['define'](_0xd180('0x8a'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2423a7){var _0x429c0c={'raw':_0x2423a7[_0xd180('0x88')][_0xd180('0x8b')],'where':{}};var _0x444e36={};var _0x254b14={'count':0x0,'rows':[]};var _0x2c8c0e=_0x2423a7[_0xd180('0x88')][_0xd180('0x8c')];var _0x14dae9=_0x2423a7['query'][_0xd180('0x8d')]||![];var _0x5a8219=_0x3d9c00(_0x2c8c0e,_0x14dae9);if(!_0x5a8219[_0xd180('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0x2c8c0e+'\x27');var _0x4ccdae=[{'name':_0x2c8c0e}];if(!_['isEmpty'](_0x5a8219[_0xd180('0x17')]))_0x4ccdae=_0x5a8219[_0xd180('0x17')];var _0x45330d=[];for(var _0x2576fb=0x0;_0x2576fb<_0x4ccdae[_0xd180('0x8e')];_0x2576fb++){_0x45330d['push'](_0x240232[_0xd180('0x8f')][_0xd180('0x90')]({'where':{'userProfileId':_0x2423a7[_0xd180('0x91')]['id'],'name':_0x4ccdae[_0x2576fb][_0xd180('0x31')]},'raw':!![]}));}return Promise[_0xd180('0x92')](_0x45330d)[_0xd180('0x7')](function(_0x5aa8f7){var _0x31da85=_[_0xd180('0x4')](_0x5aa8f7,function(_0x41b525){return _0x41b525?_0x41b525:undefined;});var _0x5865e6=_[_0xd180('0x4')](_0x4ccdae,[_0xd180('0x93'),!![]]);var _0x35488a=_[_0xd180('0x94')](_0x31da85)&&_[_0xd180('0x94')](_0x5865e6)?null:_[_0xd180('0x95')](_0x5865e6,_0x31da85);if(!_0x35488a)return null;var _0x2df55d=[];for(var _0x34a2ef=0x0;_0x34a2ef<_0x35488a['length'];_0x34a2ef++){var _0x317011=_[_0xd180('0x90')](_0x4ccdae,function(_0x18549f){return _0x35488a[_0x34a2ef]?_0x18549f[_0xd180('0x31')]===_0x35488a[_0x34a2ef][_0xd180('0x31')]:null;});if(_0x317011){if(_0x35488a[_0x34a2ef][_0xd180('0x93')]){_0x2df55d[_0xd180('0x96')](_0x553e63(_0x5a8219['childModel'],_0x35488a[_0x34a2ef]));}else{if(!_0x35488a[_0x34a2ef][_0xd180('0x97')]){_0x2df55d[_0xd180('0x96')](_0x27042b(_0x317011,_0x35488a[_0x34a2ef],_0x5a8219[_0xd180('0x12')]));}else{if(_0x317011[_0xd180('0xa')]){_0x2df55d[_0xd180('0x96')](_0x11c112(_0x317011,_0x35488a[_0x34a2ef]));}}}}}return Promise[_0xd180('0x92')](_0x2df55d);})[_0xd180('0x7')](function(_0x16c8d4){var _0x31befa=_0x16c8d4;var _0x41eb60=null;if(_0x31befa){_0x41eb60=_0x31befa['length']===0x1?_0x31befa[0x0]:null;}if(!_0x41eb60&&!_0x31befa)return _0x254b14;var _0x55a141=_0x240232[_0x5a8219[_0xd180('0x12')]][_0xd180('0x98')];_0x444e36[_0xd180('0xa')]=_['keys'](_0x55a141);_0x444e36[_0xd180('0x88')]=_['keys'](_0x2423a7[_0xd180('0x88')]);_0x444e36[_0xd180('0x99')]=_[_0xd180('0x9a')](_0x444e36[_0xd180('0xa')],_0x444e36[_0xd180('0x88')]);_0x429c0c[_0xd180('0x9b')]=_[_0xd180('0x9a')](_0x444e36[_0xd180('0xa')],qs[_0xd180('0x9c')](_0x2423a7[_0xd180('0x88')][_0xd180('0x9c')]));_0x429c0c[_0xd180('0x9b')]=_0x429c0c['attributes'][_0xd180('0x8e')]?_0x429c0c[_0xd180('0x9b')]:_0x444e36['model'];if(!_0x2423a7['query'][_0xd180('0x9d')](_0xd180('0x9e'))){_0x429c0c[_0xd180('0x9f')]=qs['limit'](_0x2423a7[_0xd180('0x88')][_0xd180('0x9f')]);_0x429c0c[_0xd180('0xa0')]=qs['offset'](_0x2423a7[_0xd180('0x88')][_0xd180('0xa0')]);}_0x429c0c[_0xd180('0xa1')]=qs[_0xd180('0xa2')](_0x2423a7[_0xd180('0x88')][_0xd180('0xa2')]);_0x429c0c[_0xd180('0xa3')]=qs[_0xd180('0x99')](_['pick'](_0x2423a7[_0xd180('0x88')],_0x444e36[_0xd180('0x99')]));if(_0x2423a7['query']['filter']){_0x429c0c['where']=_[_0xd180('0xa4')](_0x429c0c[_0xd180('0xa3')],{'$or':_[_0xd180('0xb')](_0x55a141,function(_0x381f92){if(_0x381f92[_0xd180('0x3a')][_0xd180('0xa5')]!==_0xd180('0xa6')){var _0x53723c={};_0x53723c[_0x381f92[_0xd180('0x5')]]={'$like':'%'+_0x2423a7[_0xd180('0x88')][_0xd180('0x4')]+'%'};return _0x53723c;}})});}var _0x3466b6=[];var _0x2880a2=null;var _0x334c47={};if(_0x41eb60){_0x2880a2=_[_0xd180('0x90')](_0x4ccdae,['name',_0x41eb60['name']]);if(_0x2880a2['field']){_0x334c47={};if(_0x5a8219[_0xd180('0x12')]===_0xd180('0xf')){_0x334c47[_0x2880a2[_0xd180('0xa7')]]=_[_0xd180('0xb')](_0x41eb60[_0xd180('0x8')],'id');}else{_0x334c47[_0x2880a2[_0xd180('0xa7')]]=_0x41eb60[_0xd180('0x8')];}_0x3466b6[_0xd180('0x96')](_0x334c47);}else{_0x429c0c[_0xd180('0xa3')]['id']=_0x41eb60[_0xd180('0x8')];}}else{for(var _0xede0ec=0x0;_0xede0ec<_0x31befa[_0xd180('0x8e')];_0xede0ec++){_0x2880a2=_[_0xd180('0x90')](_0x4ccdae,['name',_0x31befa[_0xede0ec][_0xd180('0x31')]]);if(_0x2880a2[_0xd180('0x5')]){_0x334c47={};_0x334c47[_0x2880a2[_0xd180('0xa7')]]=_0x31befa[_0xede0ec]['associatedResources'];_0x3466b6[_0xd180('0x96')](_0x334c47);}else{if(!_0x429c0c['where']['id'])_0x429c0c[_0xd180('0xa3')]['id']=[];_0x31befa[_0xede0ec][_0xd180('0x8')][_0xd180('0xa8')](function(_0x261e38){_0x429c0c[_0xd180('0xa3')]['id'][_0xd180('0x96')](_0x261e38);});}}}if(!_[_0xd180('0x94')](_0x3466b6)){_0x429c0c[_0xd180('0xa3')]=_['merge'](_0x429c0c['where'],{'$and':{'$or':_0x3466b6}});}_0x429c0c=_[_0xd180('0xa4')]({},_0x429c0c,_0x2423a7[_0xd180('0xa9')]);if(_0x41eb60&&!_0x41eb60['autoAssociation']&&_0x5a8219['childModel']===_0xd180('0xf')){if(_0x2423a7[_0xd180('0x88')]['includeAll']){_0x429c0c[_0xd180('0xaa')]=[{'all':!![]}];}return _0x240232[_0x5a8219[_0xd180('0x12')]][_0xd180('0xe')](_0x429c0c)[_0xd180('0x7')](function(_0x1adc08){var _0x5d678a=[];_0x1adc08['forEach'](function(_0x21bf0d){var _0x384039;switch(_0x21bf0d['reportType']){case _0xd180('0xab'):_0x384039=_[_0xd180('0x90')](_0x41eb60[_0xd180('0x8')],function(_0x111d3b){return _0x111d3b['id']===_0x21bf0d[_0xd180('0x79')]&&_0x111d3b['type']===_0xd180('0xac');});break;case _0xd180('0xad'):_0x384039=_[_0xd180('0x90')](_0x41eb60[_0xd180('0x8')],function(_0x38daa6){return _0x38daa6['id']===_0x21bf0d['reportId']&&_0x38daa6[_0xd180('0x3a')]===_0xd180('0xae');});break;}if(_0x384039)_0x5d678a[_0xd180('0x96')](_0x21bf0d);});_0x254b14['count']=_0x5d678a[_0xd180('0x8e')];_0x254b14[_0xd180('0xaf')]=_0x5d678a;return _0x254b14;});}else{if(!_[_0xd180('0x94')](_0x2423a7[_0xd180('0x88')]['ids'])){_0x429c0c[_0xd180('0xa3')]['id']=_0x429c0c[_0xd180('0xa3')]['id']?_[_0xd180('0x9a')](_0x429c0c[_0xd180('0xa3')]['id'],_0x2423a7[_0xd180('0x88')][_0xd180('0xb0')]):_0x2423a7[_0xd180('0x88')]['ids'];if(_0x2423a7['query'][_0xd180('0xb1')]){_0x429c0c[_0xd180('0xa1')]=_0x2423a7[_0xd180('0x88')]['customSorting'];}}if(_0x2423a7[_0xd180('0x88')][_0xd180('0xb2')]){_0x429c0c[_0xd180('0xa3')]=_['merge'](_0x429c0c['where'],{'$and':_0x2423a7[_0xd180('0x88')][_0xd180('0xb2')]});}return _0x240232[_0x5a8219[_0xd180('0x12')]]['count']({'where':_0x429c0c[_0xd180('0xa3')]})['then'](function(_0xf6f414){_0x254b14['count']=_0xf6f414;if(_0x2423a7['query'][_0xd180('0xb3')]){if(_0x5a8219[_0xd180('0x12')]===_0xd180('0x1c')){_0x429c0c[_0xd180('0xaa')]=[{'model':_0x240232['Tag'],'as':'Tags','attributes':['id',_0xd180('0x31'),_0xd180('0xb4')],'required':_0x2423a7[_0xd180('0x88')][_0xd180('0xb5')]?!![]:![]},{'model':_0x240232['Tag'],'as':_0xd180('0xb6'),'attributes':['id',_0xd180('0x31'),_0xd180('0xb4')],'through':_0x2423a7[_0xd180('0x88')]['tag']?{'attributes':[],'where':{'TagId':_0x2423a7['query'][_0xd180('0xb5')]||undefined}}:{},'required':_0x2423a7[_0xd180('0x88')][_0xd180('0xb5')]?!![]:![]}];}else{_0x429c0c[_0xd180('0xaa')]=[{'all':!![]}];}}return _0x240232[_0x5a8219[_0xd180('0x12')]][_0xd180('0xe')](_0x429c0c);})[_0xd180('0x7')](function(_0x2c9665){_0x254b14[_0xd180('0xaf')]=_0x2c9665;if(_0x2c8c0e===_0xd180('0x30')&&_0x2423a7[_0xd180('0x88')]['openTabs']===_0xd180('0xb7')){var _0x5664e1=[];for(var _0x23982f=0x0;_0x23982f<_0x254b14[_0xd180('0xaf')]['length'];_0x23982f++){_0x5664e1[_0xd180('0x96')](_0x58ff53(_0xd180('0xb8'),_0x254b14[_0xd180('0xaf')][_0x23982f]['dataValues']));_0x5664e1['push'](_0x58ff53(_0xd180('0xb9'),_0x254b14['rows'][_0x23982f][_0xd180('0xba')]));_0x5664e1['push'](_0x58ff53(_0xd180('0xbb'),_0x254b14[_0xd180('0xaf')][_0x23982f]['dataValues']));_0x5664e1['push'](_0x58ff53('mail',_0x254b14[_0xd180('0xaf')][_0x23982f][_0xd180('0xba')]));_0x5664e1[_0xd180('0x96')](_0x58ff53(_0xd180('0xbc'),_0x254b14[_0xd180('0xaf')][_0x23982f][_0xd180('0xba')]));_0x5664e1[_0xd180('0x96')](_0x58ff53(_0xd180('0xbd'),_0x254b14[_0xd180('0xaf')][_0x23982f][_0xd180('0xba')]));}return Promise[_0xd180('0x92')](_0x5664e1)['then'](function(){return _0x254b14;});}return _0x254b14;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 2f715e9..39d37f3 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 _0x8af6=['then','info','debug','stringify','error','message','request\x20sent','result','catch','UserProfile,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x4c5c41,_0x723137){var _0x3d8943=function(_0x13a75c){while(--_0x13a75c){_0x4c5c41['push'](_0x4c5c41['shift']());}};_0x3d8943(++_0x723137);}(_0x8af6,0x76));var _0x68af=function(_0x3ed82e,_0x532f8c){_0x3ed82e=_0x3ed82e-0x0;var _0x25c537=_0x8af6[_0x3ed82e];return _0x25c537;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var moment=require(_0x68af('0x2'));var BPromise=require(_0x68af('0x3'));var rs=require(_0x68af('0x4'));var fs=require('fs');var Redis=require(_0x68af('0x5'));var db=require(_0x68af('0x6'))['db'];var utils=require(_0x68af('0x7'));var logger=require(_0x68af('0x8'))(_0x68af('0x9'));var config=require('../../config/environment');var jayson=require(_0x68af('0xa'));var client=jayson['client'][_0x68af('0xb')]({'port':0x232a});config[_0x68af('0xc')]=_[_0x68af('0xd')](config[_0x68af('0xc')],{'host':_0x68af('0xe'),'port':0x18eb});var socket=require(_0x68af('0xf'))(new Redis(config[_0x68af('0xc')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x449f3f,_0x33ddae,_0x4a3c97){return new BPromise(function(_0x227485,_0x21b83b){return client[_0x68af('0x10')](_0x449f3f,_0x4a3c97)[_0x68af('0x11')](function(_0x407d44){logger[_0x68af('0x12')]('UserProfile,\x20%s,\x20%s',_0x33ddae,'request\x20sent');logger[_0x68af('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x33ddae,'request\x20sent',JSON[_0x68af('0x14')](_0x407d44));if(_0x407d44[_0x68af('0x15')]){if(_0x407d44[_0x68af('0x15')]['code']===0x1f4){logger[_0x68af('0x15')]('UserProfile,\x20%s,\x20%s',_0x33ddae,_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);return _0x21b83b(_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);}logger[_0x68af('0x15')]('UserProfile,\x20%s,\x20%s',_0x33ddae,_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);return _0x227485(_0x407d44[_0x68af('0x15')][_0x68af('0x16')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x33ddae,_0x68af('0x17'));_0x227485(_0x407d44[_0x68af('0x18')]['message']);}})[_0x68af('0x19')](function(_0x452c9d){logger[_0x68af('0x15')](_0x68af('0x1a'),_0x33ddae,_0x452c9d);_0x21b83b(_0x452c9d);});});} \ No newline at end of file +var _0x7c1a=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x580c07,_0x12bab8){var _0x3b910e=function(_0x340852){while(--_0x340852){_0x580c07['push'](_0x580c07['shift']());}};_0x3b910e(++_0x12bab8);}(_0x7c1a,0x159));var _0xa7c1=function(_0x3950f0,_0x3587db){_0x3950f0=_0x3950f0-0x0;var _0x3b30a9=_0x7c1a[_0x3950f0];return _0x3b30a9;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var moment=require(_0xa7c1('0x2'));var BPromise=require(_0xa7c1('0x3'));var rs=require(_0xa7c1('0x4'));var fs=require('fs');var Redis=require(_0xa7c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7c1('0x6'));var logger=require(_0xa7c1('0x7'))('rpc');var config=require(_0xa7c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7c1('0x9')][_0xa7c1('0xa')]({'port':0x232a});config[_0xa7c1('0xb')]=_[_0xa7c1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c1('0xd'))(new Redis(config[_0xa7c1('0xb')]));require(_0xa7c1('0xe'))['register'](socket);function respondWithRpcPromise(_0x3cdeaa,_0x16bf94,_0x359454){return new BPromise(function(_0x4f2957,_0x169d72){return client[_0xa7c1('0xf')](_0x3cdeaa,_0x359454)['then'](function(_0x309790){logger[_0xa7c1('0x10')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));logger[_0xa7c1('0x12')](_0xa7c1('0x13'),_0x16bf94,_0xa7c1('0x11'),JSON[_0xa7c1('0x14')](_0x309790));if(_0x309790[_0xa7c1('0x15')]){if(_0x309790[_0xa7c1('0x15')][_0xa7c1('0x16')]===0x1f4){logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x169d72(_0x309790[_0xa7c1('0x15')]['message']);}logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x4f2957(_0x309790[_0xa7c1('0x15')]['message']);}else{logger[_0xa7c1('0x10')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));_0x4f2957(_0x309790[_0xa7c1('0x19')]['message']);}})[_0xa7c1('0x1a')](function(_0x19198b){logger[_0xa7c1('0x15')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0x19198b);_0x169d72(_0x19198b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 62a1223..cf52aee 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 _0x0781=['./userProfile.events','remove','update','removeListener','register','length','userProfile:'];(function(_0x31e3e4,_0x5c795a){var _0x4ee39e=function(_0x21ee01){while(--_0x21ee01){_0x31e3e4['push'](_0x31e3e4['shift']());}};_0x4ee39e(++_0x5c795a);}(_0x0781,0x181));var _0x1078=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0781[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x1078('0x0'));var events=['save',_0x1078('0x1'),_0x1078('0x2')];function createListener(_0x41509b,_0x133285){return function(_0x262585){_0x133285['emit'](_0x41509b,_0x262585);};}function removeListener(_0xe5ea4a,_0x29b67a){return function(){UserProfileEvents[_0x1078('0x3')](_0xe5ea4a,_0x29b67a);};}exports[_0x1078('0x4')]=function(_0x1b237b){for(var _0x202b2e=0x0,_0x3e4bad=events[_0x1078('0x5')];_0x202b2e<_0x3e4bad;_0x202b2e++){var _0x7598a7=events[_0x202b2e];var _0x343936=createListener(_0x1078('0x6')+_0x7598a7,_0x1b237b);UserProfileEvents['on'](_0x7598a7,_0x343936);}}; \ No newline at end of file +var _0x9f2b=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x126175,_0x42bd8d){var _0x5c5527=function(_0x5b262e){while(--_0x5b262e){_0x126175['push'](_0x126175['shift']());}};_0x5c5527(++_0x42bd8d);}(_0x9f2b,0x187));var _0xb9f2=function(_0x1315a0,_0x236c82){_0x1315a0=_0x1315a0-0x0;var _0x93f46a=_0x9f2b[_0x1315a0];return _0x93f46a;};'use strict';var UserProfileEvents=require(_0xb9f2('0x0'));var events=[_0xb9f2('0x1'),_0xb9f2('0x2'),_0xb9f2('0x3')];function createListener(_0xaf3e7a,_0x1af1c4){return function(_0x1ab554){_0x1af1c4[_0xb9f2('0x4')](_0xaf3e7a,_0x1ab554);};}function removeListener(_0x498fe4,_0x55d7ea){return function(){UserProfileEvents[_0xb9f2('0x5')](_0x498fe4,_0x55d7ea);};}exports[_0xb9f2('0x6')]=function(_0x2b5004){for(var _0x7f68ab=0x0,_0x24ab52=events[_0xb9f2('0x7')];_0x7f68ab<_0x24ab52;_0x7f68ab++){var _0x32f67a=events[_0x7f68ab];var _0x326571=createListener(_0xb9f2('0x8')+_0x32f67a,_0x2b5004);UserProfileEvents['on'](_0x32f67a,_0x326571);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c7280b0..a953065 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 _0xd16e=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./userProfileResource.controller','isAuthenticated','describe','get','post','create','put','/:id','update','delete'];(function(_0x347cad,_0x557129){var _0x2412ec=function(_0x509885){while(--_0x509885){_0x347cad['push'](_0x347cad['shift']());}};_0x2412ec(++_0x557129);}(_0xd16e,0xef));var _0xed16=function(_0x3cb742,_0x13cba1){_0x3cb742=_0x3cb742-0x0;var _0x4c7e34=_0xd16e[_0x3cb742];return _0x4c7e34;};'use strict';var multer=require(_0xed16('0x0'));var util=require(_0xed16('0x1'));var path=require(_0xed16('0x2'));var timeout=require(_0xed16('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xed16('0x4'));var auth=require(_0xed16('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xed16('0x6'));router['get']('/',auth[_0xed16('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xed16('0x8')]);router[_0xed16('0x9')]('/:id',auth[_0xed16('0x7')](),controller['show']);router[_0xed16('0xa')]('/',auth[_0xed16('0x7')](),controller[_0xed16('0xb')]);router[_0xed16('0xc')](_0xed16('0xd'),auth['isAuthenticated'](),controller[_0xed16('0xe')]);router[_0xed16('0xf')](_0xed16('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xed16('0x10')]=router; \ No newline at end of file +var _0x3756=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe','isAuthenticated','describe','show','create','update','delete','/:id','destroy','multer','util','express'];(function(_0x28e04b,_0x2e4445){var _0x591457=function(_0x5e01d2){while(--_0x5e01d2){_0x28e04b['push'](_0x28e04b['shift']());}};_0x591457(++_0x2e4445);}(_0x3756,0x9f));var _0x6375=function(_0x50ed23,_0x5cbfaf){_0x50ed23=_0x50ed23-0x0;var _0x2b1a8b=_0x3756[_0x50ed23];return _0x2b1a8b;};'use strict';var multer=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6375('0x2'));var router=express[_0x6375('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6375('0x4'));var interaction=require(_0x6375('0x5'));var config=require(_0x6375('0x6'));var controller=require(_0x6375('0x7'));router[_0x6375('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6375('0x8')](_0x6375('0x9'),auth[_0x6375('0xa')](),controller[_0x6375('0xb')]);router[_0x6375('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6375('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6375('0xd')]);router['put']('/:id',auth[_0x6375('0xa')](),controller[_0x6375('0xe')]);router[_0x6375('0xf')](_0x6375('0x10'),auth['isAuthenticated'](),controller[_0x6375('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 88017d3..8114fad 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 _0x76f7=['sequelize','STRING','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x76f7,0x135));var _0x776f=function(_0x413dbe,_0x559c49){_0x413dbe=_0x413dbe-0x0;var _0x5f0b9f=_0x76f7[_0x413dbe];return _0x5f0b9f;};'use strict';var Sequelize=require(_0x776f('0x0'));module['exports']={'name':{'type':Sequelize[_0x776f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x776f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x776f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x72cc=['INTEGER','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x72cc,0x18d));var _0xc72c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72cc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc72c('0x0')]={'name':{'type':Sequelize[_0xc72c('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc72c('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 1bec8e5..644d3cd 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 _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4118f4,_0x357ed8){var _0x4b65c1=function(_0x58c17e){while(--_0x58c17e){_0x4118f4['push'](_0x4118f4['shift']());}};_0x4b65c1(++_0x357ed8);}(_0x57ca,0x108));var _0xa57c=function(_0x8cc34e,_0x362b58){_0x8cc34e=_0x8cc34e-0x0;var _0x2a0364=_0x57ca[_0x8cc34e];return _0x2a0364;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0xb76b58,_0x4b71db){var _0x24c57d=function(_0x25f17b){while(--_0x25f17b){_0xb76b58['push'](_0xb76b58['shift']());}};_0x24c57d(++_0x4b71db);}(_0x47c5,0x165));var _0x547c=function(_0x3ee76e,_0x3c76da){_0x3ee76e=_0x3ee76e-0x0;var _0x389187=_0x47c5[_0x3ee76e];return _0x389187;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 31fcc17..5631917 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 _0xd50e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','sectionId','lodash','util'];(function(_0x5cba47,_0x51b940){var _0x2129b0=function(_0x296d4b){while(--_0x296d4b){_0x5cba47['push'](_0x5cba47['shift']());}};_0x2129b0(++_0x51b940);}(_0xd50e,0x139));var _0xed50=function(_0x10c12f,_0x59e653){_0x10c12f=_0x10c12f-0x0;var _0x5260d9=_0xd50e[_0x10c12f];return _0x5260d9;};'use strict';var _=require(_0xed50('0x0'));var util=require(_0xed50('0x1'));var logger=require(_0xed50('0x2'))(_0xed50('0x3'));var moment=require(_0xed50('0x4'));var BPromise=require(_0xed50('0x5'));var rp=require(_0xed50('0x6'));var fs=require('fs');var path=require(_0xed50('0x7'));var rimraf=require(_0xed50('0x8'));var config=require(_0xed50('0x9'));var attributes=require(_0xed50('0xa'));module[_0xed50('0xb')]=function(_0x52bf71,_0x4e7150){return _0x52bf71['define'](_0xed50('0xc'),attributes,{'tableName':_0xed50('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xed50('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f32=['exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','util','../../config/logger','bluebird','path','../../config/environment','./userProfileResource.attributes'];(function(_0x2cd368,_0x4a8c24){var _0x363036=function(_0x41f907){while(--_0x41f907){_0x2cd368['push'](_0x2cd368['shift']());}};_0x363036(++_0x4a8c24);}(_0x0f32,0xde));var _0x20f3=function(_0x4b9763,_0x521ffd){_0x4b9763=_0x4b9763-0x0;var _0x7f3174=_0x0f32[_0x4b9763];return _0x7f3174;};'use strict';var _=require('lodash');var util=require(_0x20f3('0x0'));var logger=require(_0x20f3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x20f3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20f3('0x3'));var rimraf=require('rimraf');var config=require(_0x20f3('0x4'));var attributes=require(_0x20f3('0x5'));module[_0x20f3('0x6')]=function(_0xd8dc97,_0x2ef91f){return _0xd8dc97[_0x20f3('0x7')](_0x20f3('0x8'),attributes,{'tableName':_0x20f3('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x20f3('0xa'),_0x20f3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 59a6c6f..d6ec4cf 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 _0x9d6d=['UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x9d6d,0xe4));var _0xd9d6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9d6d[_0x432682];return _0x463d05;};'use strict';var _=require(_0xd9d6('0x0'));var util=require(_0xd9d6('0x1'));var moment=require(_0xd9d6('0x2'));var BPromise=require(_0xd9d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9d6('0x4'));var db=require(_0xd9d6('0x5'))['db'];var utils=require(_0xd9d6('0x6'));var logger=require(_0xd9d6('0x7'))('rpc');var config=require(_0xd9d6('0x8'));var jayson=require(_0xd9d6('0x9'));var client=jayson[_0xd9d6('0xa')][_0xd9d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cc464,_0x356315,_0x420cc0){return new BPromise(function(_0x4aca34,_0x50b0a7){return client[_0xd9d6('0xc')](_0x1cc464,_0x420cc0)['then'](function(_0x2f1fb2){logger[_0xd9d6('0xd')](_0xd9d6('0xe'),_0x356315,'request\x20sent');logger[_0xd9d6('0xf')](_0xd9d6('0x10'),_0x356315,_0xd9d6('0x11'),JSON[_0xd9d6('0x12')](_0x2f1fb2));if(_0x2f1fb2['error']){if(_0x2f1fb2['error']['code']===0x1f4){logger[_0xd9d6('0x13')](_0xd9d6('0xe'),_0x356315,_0x2f1fb2['error']['message']);return _0x50b0a7(_0x2f1fb2[_0xd9d6('0x13')][_0xd9d6('0x14')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x356315,_0x2f1fb2['error'][_0xd9d6('0x14')]);return _0x4aca34(_0x2f1fb2['error'][_0xd9d6('0x14')]);}else{logger[_0xd9d6('0xd')](_0xd9d6('0xe'),_0x356315,'request\x20sent');_0x4aca34(_0x2f1fb2['result']['message']);}})[_0xd9d6('0x15')](function(_0x3aa75c){logger['error'](_0xd9d6('0xe'),_0x356315,_0x3aa75c);_0x50b0a7(_0x3aa75c);});});} \ No newline at end of file +var _0xb4ed=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xf61db1,_0x1e1108){var _0x202b9=function(_0x3161d5){while(--_0x3161d5){_0xf61db1['push'](_0xf61db1['shift']());}};_0x202b9(++_0x1e1108);}(_0xb4ed,0x9d));var _0xdb4e=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0xb4ed[_0x267d8d];return _0x11a98f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb4e('0x0'));var BPromise=require(_0xdb4e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb4e('0x2'));var db=require(_0xdb4e('0x3'))['db'];var utils=require(_0xdb4e('0x4'));var logger=require('../../config/logger')(_0xdb4e('0x5'));var config=require(_0xdb4e('0x6'));var jayson=require(_0xdb4e('0x7'));var client=jayson[_0xdb4e('0x8')][_0xdb4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x159bd0,_0x1532ee,_0x5f40f1){return new BPromise(function(_0x42c10e,_0x4d681){return client[_0xdb4e('0xa')](_0x159bd0,_0x5f40f1)[_0xdb4e('0xb')](function(_0x586e00){logger[_0xdb4e('0xc')](_0xdb4e('0xd'),_0x1532ee,_0xdb4e('0xe'));logger[_0xdb4e('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x1532ee,_0xdb4e('0xe'),JSON[_0xdb4e('0x10')](_0x586e00));if(_0x586e00['error']){if(_0x586e00[_0xdb4e('0x11')]['code']===0x1f4){logger[_0xdb4e('0x11')](_0xdb4e('0xd'),_0x1532ee,_0x586e00['error']['message']);return _0x4d681(_0x586e00['error'][_0xdb4e('0x12')]);}logger['error'](_0xdb4e('0xd'),_0x1532ee,_0x586e00[_0xdb4e('0x11')][_0xdb4e('0x12')]);return _0x42c10e(_0x586e00['error']['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1532ee,_0xdb4e('0xe'));_0x42c10e(_0x586e00[_0xdb4e('0x13')]['message']);}})[_0xdb4e('0x14')](function(_0x27cbf6){logger[_0xdb4e('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x1532ee,_0x27cbf6);_0x4d681(_0x27cbf6);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c3cb09a..29059f5 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 _0x1333=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x31fd0d,_0x15fcc8){var _0x51f693=function(_0x5472fe){while(--_0x5472fe){_0x31fd0d['push'](_0x31fd0d['shift']());}};_0x51f693(++_0x15fcc8);}(_0x1333,0x7d));var _0x3133=function(_0x3a8054,_0xd6927d){_0x3a8054=_0x3a8054-0x0;var _0x2b3157=_0x1333[_0x3a8054];return _0x2b3157;};'use strict';var multer=require(_0x3133('0x0'));var util=require(_0x3133('0x1'));var path=require(_0x3133('0x2'));var timeout=require('connect-timeout');var express=require(_0x3133('0x3'));var router=express[_0x3133('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3133('0x5'));var interaction=require(_0x3133('0x6'));var config=require(_0x3133('0x7'));var controller=require(_0x3133('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3133('0x9')]);router[_0x3133('0xa')]('/describe',auth[_0x3133('0xb')](),controller['describe']);router[_0x3133('0xa')](_0x3133('0xc'),auth['isAuthenticated'](),controller[_0x3133('0xd')]);router[_0x3133('0xe')]('/',auth[_0x3133('0xb')](),controller[_0x3133('0xf')]);router[_0x3133('0x10')](_0x3133('0xc'),auth[_0x3133('0xb')](),controller[_0x3133('0x11')]);router[_0x3133('0x12')](_0x3133('0xc'),auth[_0x3133('0xb')](),controller[_0x3133('0x13')]);module[_0x3133('0x14')]=router; \ No newline at end of file +var _0x8802=['../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x150663,_0x42f05b){var _0x426e08=function(_0x34c6a2){while(--_0x34c6a2){_0x150663['push'](_0x150663['shift']());}};_0x426e08(++_0x42f05b);}(_0x8802,0x86));var _0x2880=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0x8802[_0xcdf809];return _0x4d4d70;};'use strict';var multer=require('multer');var util=require(_0x2880('0x0'));var path=require(_0x2880('0x1'));var timeout=require(_0x2880('0x2'));var express=require(_0x2880('0x3'));var router=express[_0x2880('0x4')]();var fs_extra=require(_0x2880('0x5'));var auth=require(_0x2880('0x6'));var interaction=require(_0x2880('0x7'));var config=require('../../config/environment');var controller=require(_0x2880('0x8'));router[_0x2880('0x9')]('/',auth[_0x2880('0xa')](),controller[_0x2880('0xb')]);router[_0x2880('0x9')](_0x2880('0xc'),auth[_0x2880('0xa')](),controller[_0x2880('0xd')]);router[_0x2880('0x9')]('/:id',auth[_0x2880('0xa')](),controller[_0x2880('0xe')]);router[_0x2880('0xf')]('/',auth[_0x2880('0xa')](),controller['create']);router['put'](_0x2880('0x10'),auth[_0x2880('0xa')](),controller[_0x2880('0x11')]);router[_0x2880('0x12')](_0x2880('0x10'),auth['isAuthenticated'](),controller[_0x2880('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 7f8438e..31fadc8 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 _0x3266=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','crudPermissions'];(function(_0x4be1fa,_0xe5d3eb){var _0x37a98b=function(_0x1b37d5){while(--_0x1b37d5){_0x4be1fa['push'](_0x4be1fa['shift']());}};_0x37a98b(++_0xe5d3eb);}(_0x3266,0x6a));var _0x6326=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x3266[_0x382e89];return _0x3a1318;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x6326('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6326('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6326('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6326('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6326('0x2')],'set':function(_0x265264){this['setDataValue'](_0x6326('0x5'),_0x265264?_0x265264['join'](''):[]);},'get':function(){return this[_0x6326('0x6')](_0x6326('0x5'))?this[_0x6326('0x6')]('crudPermissions')[_0x6326('0x7')](''):[];}}}; \ No newline at end of file +var _0xd914=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x53c40c,_0x5e3a0e){var _0x40cf3b=function(_0x5846a9){while(--_0x5846a9){_0x53c40c['push'](_0x53c40c['shift']());}};_0x40cf3b(++_0x5e3a0e);}(_0xd914,0x17f));var _0x4d91=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xd914[_0x4a9beb];return _0x2d4c58;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4d91('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4d91('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4d91('0x2')],'set':function(_0x2db8c5){this['setDataValue'](_0x4d91('0x5'),_0x2db8c5?_0x2db8c5['join'](''):[]);},'get':function(){return this[_0x4d91('0x6')](_0x4d91('0x5'))?this[_0x4d91('0x6')](_0x4d91('0x5'))[_0x4d91('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 66a037e..39b15bd 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 _0xf421=['UserProfileSection','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','status','error','stack','name','send','map','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xf421,0x187));var _0x1f42=function(_0x5cf93c,_0x2b5075){_0x5cf93c=_0x5cf93c-0x0;var _0x56aa24=_0xf421[_0x5cf93c];return _0x56aa24;};'use strict';var emlformat=require(_0x1f42('0x0'));var rimraf=require(_0x1f42('0x1'));var zipdir=require(_0x1f42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f42('0x3'));var moment=require(_0x1f42('0x4'));var BPromise=require(_0x1f42('0x5'));var Mustache=require(_0x1f42('0x6'));var util=require('util');var path=require(_0x1f42('0x7'));var sox=require(_0x1f42('0x8'));var csv=require('to-csv');var ejs=require(_0x1f42('0x9'));var fs=require('fs');var fs_extra=require(_0x1f42('0xa'));var _=require(_0x1f42('0xb'));var squel=require(_0x1f42('0xc'));var crypto=require(_0x1f42('0xd'));var jsforce=require(_0x1f42('0xe'));var deskjs=require(_0x1f42('0xf'));var toCsv=require(_0x1f42('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f42('0x11'));var authService=require(_0x1f42('0x12'));var qs=require(_0x1f42('0x13'));var as=require(_0x1f42('0x14'));var hardwareService=require(_0x1f42('0x15'));var logger=require(_0x1f42('0x16'))(_0x1f42('0x17'));var utils=require('../../config/utils');var config=require(_0x1f42('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f42('0x19'))['db'];function respondWithStatusCode(_0x48c1b6,_0x51c209){_0x51c209=_0x51c209||0xcc;return function(_0x460bcb){if(_0x460bcb){return _0x48c1b6[_0x1f42('0x1a')](_0x51c209);}return _0x48c1b6['status'](_0x51c209)[_0x1f42('0x1b')]();};}function respondWithResult(_0x2703de,_0x288e85){_0x288e85=_0x288e85||0xc8;return function(_0x4401bf){if(_0x4401bf){return _0x2703de['status'](_0x288e85)['json'](_0x4401bf);}};}function respondWithFilteredResult(_0x114af6,_0x44ffa6){return function(_0x56454b){if(_0x56454b){var _0x4efd7b=typeof _0x44ffa6[_0x1f42('0x1c')]===_0x1f42('0x1d')&&typeof _0x44ffa6['limit']==='undefined';var _0x464b79=_0x56454b[_0x1f42('0x1e')];var _0x257b2f=_0x4efd7b?0x0:_0x44ffa6[_0x1f42('0x1c')];var _0x35f2ba=_0x4efd7b?_0x56454b[_0x1f42('0x1e')]:_0x44ffa6[_0x1f42('0x1c')]+_0x44ffa6[_0x1f42('0x1f')];var _0x144aa8;if(_0x35f2ba>=_0x464b79){_0x35f2ba=_0x464b79;_0x144aa8=0xc8;}else{_0x144aa8=0xce;}_0x114af6['status'](_0x144aa8);return _0x114af6[_0x1f42('0x20')](_0x1f42('0x21'),_0x257b2f+'-'+_0x35f2ba+'/'+_0x464b79)[_0x1f42('0x22')](_0x56454b);}return null;};}function patchUpdates(_0x27b958){return function(_0x47b60b){try{jsonpatch[_0x1f42('0x23')](_0x47b60b,_0x27b958,!![]);}catch(_0x5de478){return BPromise[_0x1f42('0x24')](_0x5de478);}return _0x47b60b[_0x1f42('0x25')]();};}function saveUpdates(_0x2f51e8,_0x22bcd1){return function(_0x541351){if(_0x541351){return _0x541351[_0x1f42('0x26')](_0x2f51e8)[_0x1f42('0x27')](function(_0x204353){return _0x204353;});}return null;};}function removeEntity(_0x5c8e19,_0x4a8804){return function(_0x27e4bd){if(_0x27e4bd){return _0x27e4bd[_0x1f42('0x28')]()[_0x1f42('0x27')](function(){_0x5c8e19[_0x1f42('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18cbc8,_0x15a936){return function(_0x103945){if(!_0x103945){_0x18cbc8[_0x1f42('0x1a')](0x194);}return _0x103945;};}function handleError(_0x3c6bd3,_0x4bf3f8){_0x4bf3f8=_0x4bf3f8||0x1f4;return function(_0x28c073){logger[_0x1f42('0x2a')](_0x28c073[_0x1f42('0x2b')]);if(_0x28c073[_0x1f42('0x2c')]){delete _0x28c073[_0x1f42('0x2c')];}_0x3c6bd3['status'](_0x4bf3f8)[_0x1f42('0x2d')](_0x28c073);};}exports['index']=function(_0x2f3039,_0x4d9c17){var _0x493289={},_0x4e93d5={},_0x4b7aed={'count':0x0,'rows':[]};var _0x16b668=_[_0x1f42('0x2e')](db['UserProfileSection']['rawAttributes'],function(_0xb0af3f){return{'name':_0xb0af3f['fieldName'],'type':_0xb0af3f[_0x1f42('0x2f')][_0x1f42('0x30')]};});_0x4e93d5['model']=_[_0x1f42('0x2e')](_0x16b668,_0x1f42('0x2c'));_0x4e93d5[_0x1f42('0x31')]=_['keys'](_0x2f3039[_0x1f42('0x31')]);_0x4e93d5[_0x1f42('0x32')]=_[_0x1f42('0x33')](_0x4e93d5['model'],_0x4e93d5['query']);_0x493289[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x4e93d5[_0x1f42('0x35')],qs[_0x1f42('0x36')](_0x2f3039[_0x1f42('0x31')][_0x1f42('0x36')]));_0x493289[_0x1f42('0x34')]=_0x493289[_0x1f42('0x34')]['length']?_0x493289[_0x1f42('0x34')]:_0x4e93d5[_0x1f42('0x35')];if(!_0x2f3039[_0x1f42('0x31')][_0x1f42('0x37')](_0x1f42('0x38'))){_0x493289[_0x1f42('0x1f')]=qs[_0x1f42('0x1f')](_0x2f3039['query'][_0x1f42('0x1f')]);_0x493289[_0x1f42('0x1c')]=qs[_0x1f42('0x1c')](_0x2f3039[_0x1f42('0x31')]['offset']);}_0x493289[_0x1f42('0x39')]=qs[_0x1f42('0x3a')](_0x2f3039[_0x1f42('0x31')][_0x1f42('0x3a')]);_0x493289[_0x1f42('0x3b')]=qs['filters'](_[_0x1f42('0x3c')](_0x2f3039['query'],_0x4e93d5[_0x1f42('0x32')]),_0x16b668);if(_0x2f3039[_0x1f42('0x31')][_0x1f42('0x3d')]){_0x493289[_0x1f42('0x3b')]=_[_0x1f42('0x3e')](_0x493289[_0x1f42('0x3b')],{'$or':_['map'](_0x16b668,function(_0x3c98e3){if(_0x3c98e3[_0x1f42('0x2f')]!==_0x1f42('0x3f')){var _0x343cde={};_0x343cde[_0x3c98e3[_0x1f42('0x2c')]]={'$like':'%'+_0x2f3039[_0x1f42('0x31')][_0x1f42('0x3d')]+'%'};return _0x343cde;}})});}_0x493289=_['merge']({},_0x493289,_0x2f3039[_0x1f42('0x40')]);var _0x346f26={'where':_0x493289[_0x1f42('0x3b')]};return db[_0x1f42('0x41')][_0x1f42('0x1e')](_0x346f26)[_0x1f42('0x27')](function(_0x414f07){_0x4b7aed[_0x1f42('0x1e')]=_0x414f07;if(_0x2f3039['query'][_0x1f42('0x42')]){_0x493289['include']=[{'all':!![]}];}return db[_0x1f42('0x41')]['findAll'](_0x493289);})[_0x1f42('0x27')](function(_0x37fc31){_0x4b7aed['rows']=_0x37fc31;return _0x4b7aed;})[_0x1f42('0x27')](respondWithFilteredResult(_0x4d9c17,_0x493289))[_0x1f42('0x43')](handleError(_0x4d9c17,null));};exports[_0x1f42('0x44')]=function(_0x26ad72,_0x5a71b6){var _0x184ea6={'raw':![],'where':{'id':_0x26ad72[_0x1f42('0x45')]['id']}},_0x3b7366={};_0x3b7366[_0x1f42('0x35')]=_[_0x1f42('0x46')](db[_0x1f42('0x41')]['rawAttributes']);_0x3b7366[_0x1f42('0x31')]=_[_0x1f42('0x46')](_0x26ad72[_0x1f42('0x31')]);_0x3b7366[_0x1f42('0x32')]=_[_0x1f42('0x33')](_0x3b7366[_0x1f42('0x35')],_0x3b7366[_0x1f42('0x31')]);_0x184ea6['attributes']=_['intersection'](_0x3b7366['model'],qs[_0x1f42('0x36')](_0x26ad72['query']['fields']));_0x184ea6['attributes']=_0x184ea6['attributes']['length']?_0x184ea6['attributes']:_0x3b7366['model'];if(_0x26ad72[_0x1f42('0x31')][_0x1f42('0x42')]){_0x184ea6[_0x1f42('0x47')]=[{'all':!![]}];}_0x184ea6=_[_0x1f42('0x3e')]({},_0x184ea6,_0x26ad72[_0x1f42('0x40')]);return db[_0x1f42('0x41')][_0x1f42('0x48')](_0x184ea6)[_0x1f42('0x27')](handleEntityNotFound(_0x5a71b6,null))[_0x1f42('0x27')](respondWithResult(_0x5a71b6,null))['catch'](handleError(_0x5a71b6,null));};exports[_0x1f42('0x49')]=function(_0x3be562,_0x2286b9){return db[_0x1f42('0x41')][_0x1f42('0x49')](_0x3be562[_0x1f42('0x4a')],{})[_0x1f42('0x27')](respondWithResult(_0x2286b9,0xc9))['catch'](handleError(_0x2286b9,null));};exports[_0x1f42('0x26')]=function(_0x39d05f,_0x38bd77){if(_0x39d05f[_0x1f42('0x4a')]['id']){delete _0x39d05f[_0x1f42('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x39d05f['params']['id']}})[_0x1f42('0x27')](handleEntityNotFound(_0x38bd77,null))['then'](saveUpdates(_0x39d05f[_0x1f42('0x4a')],null))['then'](respondWithResult(_0x38bd77,null))[_0x1f42('0x43')](handleError(_0x38bd77,null));};exports[_0x1f42('0x28')]=function(_0xd11f2c,_0x5ae2fe){return db[_0x1f42('0x41')][_0x1f42('0x48')]({'where':{'id':_0xd11f2c[_0x1f42('0x45')]['id']}})[_0x1f42('0x27')](handleEntityNotFound(_0x5ae2fe,null))[_0x1f42('0x27')](removeEntity(_0x5ae2fe,null))[_0x1f42('0x43')](handleError(_0x5ae2fe,null));};exports[_0x1f42('0x4b')]=function(_0x5695cf,_0x34186e){return db['UserProfileSection'][_0x1f42('0x4b')]()[_0x1f42('0x27')](respondWithResult(_0x34186e,null))['catch'](handleError(_0x34186e,null));}; \ No newline at end of file +var _0x2ea7=['offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','UserProfileSection','then','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x43764a,_0x25074e){var _0x5f4f05=function(_0x47b12e){while(--_0x47b12e){_0x43764a['push'](_0x43764a['shift']());}};_0x5f4f05(++_0x25074e);}(_0x2ea7,0x81));var _0x72ea=function(_0x27c0f8,_0xd1bd2f){_0x27c0f8=_0x27c0f8-0x0;var _0x426b4e=_0x2ea7[_0x27c0f8];return _0x426b4e;};'use strict';var emlformat=require(_0x72ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72ea('0x1'));var jsonpatch=require(_0x72ea('0x2'));var rp=require(_0x72ea('0x3'));var moment=require('moment');var BPromise=require(_0x72ea('0x4'));var Mustache=require(_0x72ea('0x5'));var util=require(_0x72ea('0x6'));var path=require(_0x72ea('0x7'));var sox=require('sox');var csv=require(_0x72ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72ea('0x9'));var _=require(_0x72ea('0xa'));var squel=require(_0x72ea('0xb'));var crypto=require(_0x72ea('0xc'));var jsforce=require(_0x72ea('0xd'));var deskjs=require(_0x72ea('0xe'));var toCsv=require(_0x72ea('0x8'));var querystring=require('querystring');var Papa=require(_0x72ea('0xf'));var Redis=require(_0x72ea('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x72ea('0x11'));var as=require(_0x72ea('0x12'));var hardwareService=require(_0x72ea('0x13'));var logger=require('../../config/logger')(_0x72ea('0x14'));var utils=require(_0x72ea('0x15'));var config=require(_0x72ea('0x16'));var licenseUtil=require(_0x72ea('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d414a,_0x3b6f4b){_0x3b6f4b=_0x3b6f4b||0xcc;return function(_0x335037){if(_0x335037){return _0x1d414a['sendStatus'](_0x3b6f4b);}return _0x1d414a[_0x72ea('0x18')](_0x3b6f4b)['end']();};}function respondWithResult(_0x111d96,_0x2eae44){_0x2eae44=_0x2eae44||0xc8;return function(_0x453c0e){if(_0x453c0e){return _0x111d96[_0x72ea('0x18')](_0x2eae44)['json'](_0x453c0e);}};}function respondWithFilteredResult(_0x15e1ba,_0x146659){return function(_0x14e56a){if(_0x14e56a){var _0x563c60=typeof _0x146659[_0x72ea('0x19')]==='undefined'&&typeof _0x146659[_0x72ea('0x1a')]===_0x72ea('0x1b');var _0x70b2ba=_0x14e56a[_0x72ea('0x1c')];var _0x12efa7=_0x563c60?0x0:_0x146659['offset'];var _0x2500c2=_0x563c60?_0x14e56a['count']:_0x146659['offset']+_0x146659[_0x72ea('0x1a')];var _0x56eb6c;if(_0x2500c2>=_0x70b2ba){_0x2500c2=_0x70b2ba;_0x56eb6c=0xc8;}else{_0x56eb6c=0xce;}_0x15e1ba[_0x72ea('0x18')](_0x56eb6c);return _0x15e1ba[_0x72ea('0x1d')](_0x72ea('0x1e'),_0x12efa7+'-'+_0x2500c2+'/'+_0x70b2ba)[_0x72ea('0x1f')](_0x14e56a);}return null;};}function patchUpdates(_0x51cc0d){return function(_0x2171ba){try{jsonpatch[_0x72ea('0x20')](_0x2171ba,_0x51cc0d,!![]);}catch(_0x7c5616){return BPromise[_0x72ea('0x21')](_0x7c5616);}return _0x2171ba[_0x72ea('0x22')]();};}function saveUpdates(_0x27f0a0,_0x5ac666){return function(_0x116709){if(_0x116709){return _0x116709['update'](_0x27f0a0)['then'](function(_0x2dfe6e){return _0x2dfe6e;});}return null;};}function removeEntity(_0x4fdd3a,_0xc2336e){return function(_0x3780ac){if(_0x3780ac){return _0x3780ac['destroy']()['then'](function(){_0x4fdd3a['status'](0xcc)[_0x72ea('0x23')]();});}};}function handleEntityNotFound(_0x15d1b5,_0xa2fa3e){return function(_0x52fdac){if(!_0x52fdac){_0x15d1b5[_0x72ea('0x24')](0x194);}return _0x52fdac;};}function handleError(_0x470af6,_0x16c3dc){_0x16c3dc=_0x16c3dc||0x1f4;return function(_0x49260a){logger[_0x72ea('0x25')](_0x49260a[_0x72ea('0x26')]);if(_0x49260a[_0x72ea('0x27')]){delete _0x49260a[_0x72ea('0x27')];}_0x470af6[_0x72ea('0x18')](_0x16c3dc)[_0x72ea('0x28')](_0x49260a);};}exports[_0x72ea('0x29')]=function(_0x5026a8,_0x4775a7){var _0x640e17={},_0x140d5d={},_0x34ef3c={'count':0x0,'rows':[]};var _0x3ced02=_['map'](db['UserProfileSection'][_0x72ea('0x2a')],function(_0x12e036){return{'name':_0x12e036[_0x72ea('0x2b')],'type':_0x12e036[_0x72ea('0x2c')][_0x72ea('0x2d')]};});_0x140d5d[_0x72ea('0x2e')]=_[_0x72ea('0x2f')](_0x3ced02,_0x72ea('0x27'));_0x140d5d[_0x72ea('0x30')]=_[_0x72ea('0x31')](_0x5026a8[_0x72ea('0x30')]);_0x140d5d['filters']=_[_0x72ea('0x32')](_0x140d5d[_0x72ea('0x2e')],_0x140d5d[_0x72ea('0x30')]);_0x640e17[_0x72ea('0x33')]=_['intersection'](_0x140d5d[_0x72ea('0x2e')],qs[_0x72ea('0x34')](_0x5026a8['query'][_0x72ea('0x34')]));_0x640e17['attributes']=_0x640e17[_0x72ea('0x33')][_0x72ea('0x35')]?_0x640e17[_0x72ea('0x33')]:_0x140d5d[_0x72ea('0x2e')];if(!_0x5026a8['query']['hasOwnProperty'](_0x72ea('0x36'))){_0x640e17[_0x72ea('0x1a')]=qs['limit'](_0x5026a8[_0x72ea('0x30')][_0x72ea('0x1a')]);_0x640e17[_0x72ea('0x19')]=qs[_0x72ea('0x19')](_0x5026a8[_0x72ea('0x30')][_0x72ea('0x19')]);}_0x640e17[_0x72ea('0x37')]=qs[_0x72ea('0x38')](_0x5026a8['query']['sort']);_0x640e17[_0x72ea('0x39')]=qs[_0x72ea('0x3a')](_['pick'](_0x5026a8['query'],_0x140d5d[_0x72ea('0x3a')]),_0x3ced02);if(_0x5026a8['query']['filter']){_0x640e17[_0x72ea('0x39')]=_[_0x72ea('0x3b')](_0x640e17[_0x72ea('0x39')],{'$or':_[_0x72ea('0x2f')](_0x3ced02,function(_0x478e97){if(_0x478e97[_0x72ea('0x2c')]!==_0x72ea('0x3c')){var _0x8071b9={};_0x8071b9[_0x478e97[_0x72ea('0x27')]]={'$like':'%'+_0x5026a8[_0x72ea('0x30')][_0x72ea('0x3d')]+'%'};return _0x8071b9;}})});}_0x640e17=_[_0x72ea('0x3b')]({},_0x640e17,_0x5026a8[_0x72ea('0x3e')]);var _0x4300d6={'where':_0x640e17['where']};return db[_0x72ea('0x3f')]['count'](_0x4300d6)[_0x72ea('0x40')](function(_0x413c3d){_0x34ef3c[_0x72ea('0x1c')]=_0x413c3d;if(_0x5026a8[_0x72ea('0x30')][_0x72ea('0x41')]){_0x640e17[_0x72ea('0x42')]=[{'all':!![]}];}return db['UserProfileSection'][_0x72ea('0x43')](_0x640e17);})[_0x72ea('0x40')](function(_0x35f0d4){_0x34ef3c['rows']=_0x35f0d4;return _0x34ef3c;})['then'](respondWithFilteredResult(_0x4775a7,_0x640e17))[_0x72ea('0x44')](handleError(_0x4775a7,null));};exports[_0x72ea('0x45')]=function(_0xd0e82,_0x39d76f){var _0x52e3ac={'raw':![],'where':{'id':_0xd0e82['params']['id']}},_0x4bbb9f={};_0x4bbb9f[_0x72ea('0x2e')]=_[_0x72ea('0x31')](db['UserProfileSection']['rawAttributes']);_0x4bbb9f[_0x72ea('0x30')]=_[_0x72ea('0x31')](_0xd0e82[_0x72ea('0x30')]);_0x4bbb9f[_0x72ea('0x3a')]=_[_0x72ea('0x32')](_0x4bbb9f['model'],_0x4bbb9f[_0x72ea('0x30')]);_0x52e3ac[_0x72ea('0x33')]=_[_0x72ea('0x32')](_0x4bbb9f['model'],qs['fields'](_0xd0e82[_0x72ea('0x30')]['fields']));_0x52e3ac['attributes']=_0x52e3ac[_0x72ea('0x33')][_0x72ea('0x35')]?_0x52e3ac['attributes']:_0x4bbb9f['model'];if(_0xd0e82[_0x72ea('0x30')][_0x72ea('0x41')]){_0x52e3ac[_0x72ea('0x42')]=[{'all':!![]}];}_0x52e3ac=_['merge']({},_0x52e3ac,_0xd0e82[_0x72ea('0x3e')]);return db['UserProfileSection'][_0x72ea('0x46')](_0x52e3ac)[_0x72ea('0x40')](handleEntityNotFound(_0x39d76f,null))[_0x72ea('0x40')](respondWithResult(_0x39d76f,null))['catch'](handleError(_0x39d76f,null));};exports[_0x72ea('0x47')]=function(_0x131562,_0x2fc23a){return db[_0x72ea('0x3f')][_0x72ea('0x47')](_0x131562[_0x72ea('0x48')],{})[_0x72ea('0x40')](respondWithResult(_0x2fc23a,0xc9))[_0x72ea('0x44')](handleError(_0x2fc23a,null));};exports[_0x72ea('0x49')]=function(_0x52dcfe,_0x256522){if(_0x52dcfe['body']['id']){delete _0x52dcfe[_0x72ea('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x52dcfe[_0x72ea('0x4a')]['id']}})['then'](handleEntityNotFound(_0x256522,null))[_0x72ea('0x40')](saveUpdates(_0x52dcfe[_0x72ea('0x48')],null))[_0x72ea('0x40')](respondWithResult(_0x256522,null))[_0x72ea('0x44')](handleError(_0x256522,null));};exports[_0x72ea('0x4b')]=function(_0x27890b,_0x2b329a){return db[_0x72ea('0x3f')][_0x72ea('0x46')]({'where':{'id':_0x27890b[_0x72ea('0x4a')]['id']}})[_0x72ea('0x40')](handleEntityNotFound(_0x2b329a,null))[_0x72ea('0x40')](removeEntity(_0x2b329a,null))['catch'](handleError(_0x2b329a,null));};exports['describe']=function(_0x29a099,_0x3a5def){return db['UserProfileSection'][_0x72ea('0x4c')]()[_0x72ea('0x40')](respondWithResult(_0x3a5def,null))['catch'](handleError(_0x3a5def,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ff46de8..d6395d2 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 _0x808d=['request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0xa70e08,_0x4528cc){var _0x1acaf7=function(_0x5560fa){while(--_0x5560fa){_0xa70e08['push'](_0xa70e08['shift']());}};_0x1acaf7(++_0x4528cc);}(_0x808d,0x175));var _0xd808=function(_0x4914be,_0x4aa589){_0x4914be=_0x4914be-0x0;var _0x377e99=_0x808d[_0x4914be];return _0x377e99;};'use strict';var _=require(_0xd808('0x0'));var util=require(_0xd808('0x1'));var logger=require(_0xd808('0x2'))('api');var moment=require(_0xd808('0x3'));var BPromise=require(_0xd808('0x4'));var rp=require(_0xd808('0x5'));var fs=require('fs');var path=require(_0xd808('0x6'));var rimraf=require(_0xd808('0x7'));var config=require('../../config/environment');var attributes=require(_0xd808('0x8'));module[_0xd808('0x9')]=function(_0x30b1f1,_0x1118fd){return _0x30b1f1[_0xd808('0xa')](_0xd808('0xb'),attributes,{'tableName':_0xd808('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xd808('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x58ab=['rimraf','../../config/environment','./userProfileSection.attributes','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x58ab,0x1c7));var _0xb58a=function(_0x118573,_0x4ff58c){_0x118573=_0x118573-0x0;var _0x25a587=_0x58ab[_0x118573];return _0x25a587;};'use strict';var _=require(_0xb58a('0x0'));var util=require(_0xb58a('0x1'));var logger=require(_0xb58a('0x2'))('api');var moment=require(_0xb58a('0x3'));var BPromise=require(_0xb58a('0x4'));var rp=require(_0xb58a('0x5'));var fs=require('fs');var path=require(_0xb58a('0x6'));var rimraf=require(_0xb58a('0x7'));var config=require(_0xb58a('0x8'));var attributes=require(_0xb58a('0x9'));module['exports']=function(_0x5e291b,_0xcb9b4f){return _0x5e291b['define']('UserProfileSection',attributes,{'tableName':_0xb58a('0xa'),'paranoid':![],'indexes':[{'name':_0xb58a('0xb'),'fields':[_0xb58a('0xc'),_0xb58a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index c58fcd9..efa9c99 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 _0xa1aa=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','moment','bluebird','randomstring','ioredis'];(function(_0x24d5dd,_0x10cc27){var _0x2df5d5=function(_0x4d8398){while(--_0x4d8398){_0x24d5dd['push'](_0x24d5dd['shift']());}};_0x2df5d5(++_0x10cc27);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3d7144,_0x5c817a){_0x3d7144=_0x3d7144-0x0;var _0x36c8d4=_0xa1aa[_0x3d7144];return _0x36c8d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa1a('0x0'));var BPromise=require(_0xaa1a('0x1'));var rs=require(_0xaa1a('0x2'));var fs=require('fs');var Redis=require(_0xaa1a('0x3'));var db=require(_0xaa1a('0x4'))['db'];var utils=require(_0xaa1a('0x5'));var logger=require(_0xaa1a('0x6'))('rpc');var config=require(_0xaa1a('0x7'));var jayson=require(_0xaa1a('0x8'));var client=jayson['client'][_0xaa1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15b767,_0x3e2ff3,_0x1a289d){return new BPromise(function(_0x253dc7,_0x413732){return client[_0xaa1a('0xa')](_0x15b767,_0x1a289d)[_0xaa1a('0xb')](function(_0x2220ec){logger['info'](_0xaa1a('0xc'),_0x3e2ff3,'request\x20sent');logger[_0xaa1a('0xd')](_0xaa1a('0xe'),_0x3e2ff3,_0xaa1a('0xf'),JSON[_0xaa1a('0x10')](_0x2220ec));if(_0x2220ec[_0xaa1a('0x11')]){if(_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x12')]===0x1f4){logger[_0xaa1a('0x11')](_0xaa1a('0xc'),_0x3e2ff3,_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x13')]);return _0x413732(_0x2220ec['error']['message']);}logger[_0xaa1a('0x11')](_0xaa1a('0xc'),_0x3e2ff3,_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x13')]);return _0x253dc7(_0x2220ec[_0xaa1a('0x11')][_0xaa1a('0x13')]);}else{logger['info'](_0xaa1a('0xc'),_0x3e2ff3,_0xaa1a('0xf'));_0x253dc7(_0x2220ec['result'][_0xaa1a('0x13')]);}})['catch'](function(_0x4f2807){logger[_0xaa1a('0x11')](_0xaa1a('0xc'),_0x3e2ff3,_0x4f2807);_0x413732(_0x4f2807);});});} \ No newline at end of file +var _0x0094=['info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4b622a,_0x19a8cb){var _0x19e734=function(_0x349035){while(--_0x349035){_0x4b622a['push'](_0x4b622a['shift']());}};_0x19e734(++_0x19a8cb);}(_0x0094,0x184));var _0x4009=function(_0x55d922,_0x28113b){_0x55d922=_0x55d922-0x0;var _0x3143cf=_0x0094[_0x55d922];return _0x3143cf;};'use strict';var _=require(_0x4009('0x0'));var util=require(_0x4009('0x1'));var moment=require('moment');var BPromise=require(_0x4009('0x2'));var rs=require(_0x4009('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4009('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4009('0x5'))(_0x4009('0x6'));var config=require(_0x4009('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4009('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1990cf,_0x100e3b,_0x1a3d94){return new BPromise(function(_0x211603,_0x147b24){return client[_0x4009('0x9')](_0x1990cf,_0x1a3d94)[_0x4009('0xa')](function(_0x374682){logger[_0x4009('0xb')](_0x4009('0xc'),_0x100e3b,'request\x20sent');logger['debug'](_0x4009('0xd'),_0x100e3b,'request\x20sent',JSON[_0x4009('0xe')](_0x374682));if(_0x374682['error']){if(_0x374682['error'][_0x4009('0xf')]===0x1f4){logger[_0x4009('0x10')](_0x4009('0xc'),_0x100e3b,_0x374682[_0x4009('0x10')][_0x4009('0x11')]);return _0x147b24(_0x374682[_0x4009('0x10')]['message']);}logger['error'](_0x4009('0xc'),_0x100e3b,_0x374682[_0x4009('0x10')][_0x4009('0x11')]);return _0x211603(_0x374682[_0x4009('0x10')][_0x4009('0x11')]);}else{logger['info'](_0x4009('0xc'),_0x100e3b,_0x4009('0x12'));_0x211603(_0x374682[_0x4009('0x13')][_0x4009('0x11')]);}})[_0x4009('0x14')](function(_0x3392e0){logger[_0x4009('0x10')](_0x4009('0xc'),_0x100e3b,_0x3392e0);_0x147b24(_0x3392e0);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 3afd0ca..2fac873 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1de7d3,_0x50fb04){var _0x10de57=function(_0x4647d1){while(--_0x4647d1){_0x1de7d3['push'](_0x1de7d3['shift']());}};_0x10de57(++_0x50fb04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e13a19f..76e0e1b 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 _0x562f=['exports','INTEGER','sequelize'];(function(_0x530245,_0x1541ab){var _0x22506d=function(_0x395400){while(--_0x395400){_0x530245['push'](_0x530245['shift']());}};_0x22506d(++_0x1541ab);}(_0x562f,0x1d6));var _0xf562=function(_0x44e827,_0x145ed8){_0x44e827=_0x44e827-0x0;var _0xa19d97=_0x562f[_0x44e827];return _0xa19d97;};'use strict';var Sequelize=require(_0xf562('0x0'));module[_0xf562('0x1')]={'penalty':{'type':Sequelize[_0xf562('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x93a6=['INTEGER','sequelize','exports'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x93a6,0x1ab));var _0x693a=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0x93a6[_0x5de967];return _0x5b07a3;};'use strict';var Sequelize=require(_0x693a('0x0'));module[_0x693a('0x1')]={'penalty':{'type':Sequelize[_0x693a('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 838a1ad..e1e5999 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 _0xdf55=['util','api','moment','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xdf55,0x83));var _0x5df5=function(_0x195f3f,_0x9b2710){_0x195f3f=_0x195f3f-0x0;var _0x3c36b3=_0xdf55[_0x195f3f];return _0x3c36b3;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));module[_0x5df5('0x8')]=function(_0x27ec86,_0x476e21){return _0x27ec86[_0x5df5('0x9')](_0x5df5('0xa'),attributes,{'tableName':_0x5df5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa37=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash'];(function(_0x6d9525,_0x164096){var _0x279795=function(_0x26f35c){while(--_0x26f35c){_0x6d9525['push'](_0x6d9525['shift']());}};_0x279795(++_0x164096);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xaa37[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var logger=require(_0x7aa3('0x2'))(_0x7aa3('0x3'));var moment=require('moment');var BPromise=require(_0x7aa3('0x4'));var rp=require(_0x7aa3('0x5'));var fs=require('fs');var path=require(_0x7aa3('0x6'));var rimraf=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var attributes=require(_0x7aa3('0x9'));module[_0x7aa3('0xa')]=function(_0x5b738a,_0x437b90){return _0x5b738a[_0x7aa3('0xb')]('UserSmsQueue',attributes,{'tableName':_0x7aa3('0xc'),'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 9271d7a..b1c46a4 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 _0x0e20=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0e20,0x1c9));var _0x00e2=function(_0x161b06,_0x99a554){_0x161b06=_0x161b06-0x0;var _0x2468dc=_0x0e20[_0x161b06];return _0x2468dc;};'use strict';var _=require('lodash');var util=require(_0x00e2('0x0'));var moment=require(_0x00e2('0x1'));var BPromise=require(_0x00e2('0x2'));var rs=require(_0x00e2('0x3'));var fs=require('fs');var Redis=require(_0x00e2('0x4'));var db=require(_0x00e2('0x5'))['db'];var utils=require(_0x00e2('0x6'));var logger=require(_0x00e2('0x7'))(_0x00e2('0x8'));var config=require(_0x00e2('0x9'));var jayson=require(_0x00e2('0xa'));var client=jayson[_0x00e2('0xb')][_0x00e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22b412,_0x360559,_0x3cb0d7){return new BPromise(function(_0x4f06d8,_0x3d0120){return client[_0x00e2('0xd')](_0x22b412,_0x3cb0d7)[_0x00e2('0xe')](function(_0x2f293b){logger[_0x00e2('0xf')](_0x00e2('0x10'),_0x360559,'request\x20sent');logger['debug'](_0x00e2('0x11'),_0x360559,_0x00e2('0x12'),JSON[_0x00e2('0x13')](_0x2f293b));if(_0x2f293b['error']){if(_0x2f293b['error'][_0x00e2('0x14')]===0x1f4){logger['error'](_0x00e2('0x10'),_0x360559,_0x2f293b['error'][_0x00e2('0x15')]);return _0x3d0120(_0x2f293b[_0x00e2('0x16')][_0x00e2('0x15')]);}logger[_0x00e2('0x16')]('UserSmsQueue,\x20%s,\x20%s',_0x360559,_0x2f293b[_0x00e2('0x16')][_0x00e2('0x15')]);return _0x4f06d8(_0x2f293b['error']['message']);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x360559,_0x00e2('0x12'));_0x4f06d8(_0x2f293b['result'][_0x00e2('0x15')]);}})[_0x00e2('0x17')](function(_0x11cbb5){logger['error'](_0x00e2('0x10'),_0x360559,_0x11cbb5);_0x3d0120(_0x11cbb5);});});} \ No newline at end of file +var _0x9f51=['code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2eabb4,_0x49fd57){var _0x43b45b=function(_0x5b2704){while(--_0x5b2704){_0x2eabb4['push'](_0x2eabb4['shift']());}};_0x43b45b(++_0x49fd57);}(_0x9f51,0x15d));var _0x19f5=function(_0x5e3a1f,_0x24c078){_0x5e3a1f=_0x5e3a1f-0x0;var _0x3c27fd=_0x9f51[_0x5e3a1f];return _0x3c27fd;};'use strict';var _=require(_0x19f5('0x0'));var util=require(_0x19f5('0x1'));var moment=require('moment');var BPromise=require(_0x19f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19f5('0x3'));var db=require(_0x19f5('0x4'))['db'];var utils=require(_0x19f5('0x5'));var logger=require(_0x19f5('0x6'))(_0x19f5('0x7'));var config=require(_0x19f5('0x8'));var jayson=require(_0x19f5('0x9'));var client=jayson[_0x19f5('0xa')][_0x19f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b53f3,_0x43d347,_0x1fed30){return new BPromise(function(_0x3b8385,_0x2b39f4){return client['request'](_0x4b53f3,_0x1fed30)[_0x19f5('0xc')](function(_0x217a80){logger['info'](_0x19f5('0xd'),_0x43d347,_0x19f5('0xe'));logger[_0x19f5('0xf')](_0x19f5('0x10'),_0x43d347,_0x19f5('0xe'),JSON[_0x19f5('0x11')](_0x217a80));if(_0x217a80['error']){if(_0x217a80[_0x19f5('0x12')][_0x19f5('0x13')]===0x1f4){logger[_0x19f5('0x12')](_0x19f5('0xd'),_0x43d347,_0x217a80['error'][_0x19f5('0x14')]);return _0x2b39f4(_0x217a80[_0x19f5('0x12')][_0x19f5('0x14')]);}logger[_0x19f5('0x12')](_0x19f5('0xd'),_0x43d347,_0x217a80[_0x19f5('0x12')][_0x19f5('0x14')]);return _0x3b8385(_0x217a80['error']['message']);}else{logger[_0x19f5('0x15')](_0x19f5('0xd'),_0x43d347,'request\x20sent');_0x3b8385(_0x217a80[_0x19f5('0x16')][_0x19f5('0x14')]);}})['catch'](function(_0x36a900){logger[_0x19f5('0x12')](_0x19f5('0xd'),_0x43d347,_0x36a900);_0x2b39f4(_0x36a900);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index fc0f97e..0cf6061 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ee6=['sequelize','INTEGER'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9ee6,0x14e));var _0x69ee=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x9ee6[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0x69ee('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x69ee('0x1')]}}; \ No newline at end of file +var _0x8529=['exports','INTEGER','sequelize'];(function(_0x18216a,_0x570c18){var _0x25fefe=function(_0x386f6c){while(--_0x386f6c){_0x18216a['push'](_0x18216a['shift']());}};_0x25fefe(++_0x570c18);}(_0x8529,0x18b));var _0x9852=function(_0x48bd29,_0x31b393){_0x48bd29=_0x48bd29-0x0;var _0x1edbea=_0x8529[_0x48bd29];return _0x1edbea;};'use strict';var Sequelize=require(_0x9852('0x0'));module[_0x9852('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x9852('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b5848c7..e9a90ff 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x276001,_0x1755e3){var _0xd823df=function(_0x58e4fb){while(--_0x58e4fb){_0x276001['push'](_0x276001['shift']());}};_0xd823df(++_0x1755e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5eeefc,_0x246247){var _0x587f3f=function(_0x3f2153){while(--_0x3f2153){_0x5eeefc['push'](_0x5eeefc['shift']());}};_0x587f3f(++_0x246247);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index e15afec..da6aaad 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x29976b,_0x13a2dd){var _0x2780de=function(_0x1208e7){while(--_0x1208e7){_0x29976b['push'](_0x29976b['shift']());}};_0x2780de(++_0x13a2dd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x47019c,_0xb68c8a){var _0x1c51a7=function(_0x5d02bc){while(--_0x5d02bc){_0x47019c['push'](_0x47019c['shift']());}};_0x1c51a7(++_0xb68c8a);}(_0xe706,0xa3));var _0x6e70=function(_0x4c1eec,_0x515aa1){_0x4c1eec=_0x4c1eec-0x0;var _0x5d8475=_0xe706[_0x4c1eec];return _0x5d8475;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 6a1074f..b810301 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 _0x37c3=['exports','INTEGER','sequelize'];(function(_0x22d045,_0x13fd64){var _0x2460b1=function(_0x3e0ddf){while(--_0x3e0ddf){_0x22d045['push'](_0x22d045['shift']());}};_0x2460b1(++_0x13fd64);}(_0x37c3,0xd1));var _0x337c=function(_0x54b45c,_0xbfb39b){_0x54b45c=_0x54b45c-0x0;var _0x101941=_0x37c3[_0x54b45c];return _0x101941;};'use strict';var Sequelize=require(_0x337c('0x0'));module[_0x337c('0x1')]={'penalty':{'type':Sequelize[_0x337c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x51cd=['exports','sequelize'];(function(_0x3708e7,_0x3bb487){var _0x3e1f15=function(_0x2c9f41){while(--_0x2c9f41){_0x3708e7['push'](_0x3708e7['shift']());}};_0x3e1f15(++_0x3bb487);}(_0x51cd,0x141));var _0xd51c=function(_0x47b634,_0x37dce3){_0x47b634=_0x47b634-0x0;var _0x1c4051=_0x51cd[_0x47b634];return _0x1c4051;};'use strict';var Sequelize=require(_0xd51c('0x0'));module[_0xd51c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 81d1f00..4a03216 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 _0xc63c=['../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x52caac,_0x286dea){var _0x192a9f=function(_0x307d04){while(--_0x307d04){_0x52caac['push'](_0x52caac['shift']());}};_0x192a9f(++_0x286dea);}(_0xc63c,0x139));var _0xcc63=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xc63c[_0x49c68e];return _0x33032b;};'use strict';var _=require(_0xcc63('0x0'));var util=require('util');var logger=require(_0xcc63('0x1'))(_0xcc63('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc63('0x3'));var fs=require('fs');var path=require(_0xcc63('0x4'));var rimraf=require(_0xcc63('0x5'));var config=require(_0xcc63('0x6'));var attributes=require(_0xcc63('0x7'));module['exports']=function(_0x4561eb,_0x1d10a3){return _0x4561eb[_0xcc63('0x8')](_0xcc63('0x9'),attributes,{'tableName':_0xcc63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eb0=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userVoiceQueue.attributes','exports','define'];(function(_0x5ceee3,_0x5e5297){var _0x3a8590=function(_0x1e82b1){while(--_0x1e82b1){_0x5ceee3['push'](_0x5ceee3['shift']());}};_0x3a8590(++_0x5e5297);}(_0x0eb0,0x122));var _0x00eb=function(_0x1820b5,_0x1cf8e4){_0x1820b5=_0x1820b5-0x0;var _0x50d588=_0x0eb0[_0x1820b5];return _0x50d588;};'use strict';var _=require(_0x00eb('0x0'));var util=require(_0x00eb('0x1'));var logger=require(_0x00eb('0x2'))(_0x00eb('0x3'));var moment=require(_0x00eb('0x4'));var BPromise=require(_0x00eb('0x5'));var rp=require(_0x00eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x00eb('0x7'));module[_0x00eb('0x8')]=function(_0x3be264,_0xe0c691){return _0x3be264[_0x00eb('0x9')](_0x00eb('0xa'),attributes,{'tableName':_0x00eb('0xb'),'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 9987342..cb8b0a0 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 _0x5cbb=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x491380,_0x10a568){var _0x3daab3=function(_0x2c329f){while(--_0x2c329f){_0x491380['push'](_0x491380['shift']());}};_0x3daab3(++_0x10a568);}(_0x5cbb,0xa9));var _0xb5cb=function(_0xcdaac,_0xa83386){_0xcdaac=_0xcdaac-0x0;var _0x573db8=_0x5cbb[_0xcdaac];return _0x573db8;};'use strict';var _=require(_0xb5cb('0x0'));var util=require(_0xb5cb('0x1'));var moment=require(_0xb5cb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5cb('0x3'));var db=require(_0xb5cb('0x4'))['db'];var utils=require(_0xb5cb('0x5'));var logger=require(_0xb5cb('0x6'))(_0xb5cb('0x7'));var config=require('../../config/environment');var jayson=require(_0xb5cb('0x8'));var client=jayson['client'][_0xb5cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x393567,_0x2b1c81,_0x3d36b9){return new BPromise(function(_0x42f6b3,_0x591a08){return client[_0xb5cb('0xa')](_0x393567,_0x3d36b9)[_0xb5cb('0xb')](function(_0x4b7adb){logger[_0xb5cb('0xc')](_0xb5cb('0xd'),_0x2b1c81,_0xb5cb('0xe'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2b1c81,_0xb5cb('0xe'),JSON[_0xb5cb('0xf')](_0x4b7adb));if(_0x4b7adb[_0xb5cb('0x10')]){if(_0x4b7adb[_0xb5cb('0x10')]['code']===0x1f4){logger[_0xb5cb('0x10')](_0xb5cb('0xd'),_0x2b1c81,_0x4b7adb[_0xb5cb('0x10')][_0xb5cb('0x11')]);return _0x591a08(_0x4b7adb['error'][_0xb5cb('0x11')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2b1c81,_0x4b7adb[_0xb5cb('0x10')][_0xb5cb('0x11')]);return _0x42f6b3(_0x4b7adb['error']['message']);}else{logger['info'](_0xb5cb('0xd'),_0x2b1c81,'request\x20sent');_0x42f6b3(_0x4b7adb['result'][_0xb5cb('0x11')]);}})[_0xb5cb('0x12')](function(_0xb66112){logger[_0xb5cb('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2b1c81,_0xb66112);_0x591a08(_0xb66112);});});} \ No newline at end of file +var _0xc07f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x5bdca1,_0x320f78){var _0x4394c1=function(_0x58111e){while(--_0x58111e){_0x5bdca1['push'](_0x5bdca1['shift']());}};_0x4394c1(++_0x320f78);}(_0xc07f,0xd8));var _0xfc07=function(_0x198427,_0x245257){_0x198427=_0x198427-0x0;var _0xc881ee=_0xc07f[_0x198427];return _0xc881ee;};'use strict';var _=require(_0xfc07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfc07('0x1'));var fs=require('fs');var Redis=require(_0xfc07('0x2'));var db=require(_0xfc07('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc07('0x4'))(_0xfc07('0x5'));var config=require(_0xfc07('0x6'));var jayson=require(_0xfc07('0x7'));var client=jayson[_0xfc07('0x8')][_0xfc07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59ba9a,_0x5ed1ae,_0x24f297){return new BPromise(function(_0x4e6615,_0x12aaf1){return client[_0xfc07('0xa')](_0x59ba9a,_0x24f297)[_0xfc07('0xb')](function(_0x9d7089){logger[_0xfc07('0xc')](_0xfc07('0xd'),_0x5ed1ae,_0xfc07('0xe'));logger[_0xfc07('0xf')](_0xfc07('0x10'),_0x5ed1ae,_0xfc07('0xe'),JSON['stringify'](_0x9d7089));if(_0x9d7089[_0xfc07('0x11')]){if(_0x9d7089[_0xfc07('0x11')][_0xfc07('0x12')]===0x1f4){logger['error'](_0xfc07('0xd'),_0x5ed1ae,_0x9d7089[_0xfc07('0x11')][_0xfc07('0x13')]);return _0x12aaf1(_0x9d7089['error'][_0xfc07('0x13')]);}logger['error'](_0xfc07('0xd'),_0x5ed1ae,_0x9d7089[_0xfc07('0x11')]['message']);return _0x4e6615(_0x9d7089[_0xfc07('0x11')][_0xfc07('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x5ed1ae,_0xfc07('0xe'));_0x4e6615(_0x9d7089[_0xfc07('0x14')]['message']);}})[_0xfc07('0x15')](function(_0xf88db4){logger['error'](_0xfc07('0xd'),_0x5ed1ae,_0xf88db4);_0x12aaf1(_0xf88db4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b8eec17..09b4a5f 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x198f3a,_0x3fc081){var _0x230ad5=function(_0x21c98d){while(--_0x21c98d){_0x198f3a['push'](_0x198f3a['shift']());}};_0x230ad5(++_0x3fc081);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1ae661,_0x3a7e42){var _0x11edfb=function(_0xe8870f){while(--_0xe8870f){_0x1ae661['push'](_0x1ae661['shift']());}};_0x11edfb(++_0x3a7e42);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 07e2a64..2c785ce 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 _0x3c2f=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x2ab9b7,_0x550eec){var _0x5e1c81=function(_0x2b3901){while(--_0x2b3901){_0x2ab9b7['push'](_0x2ab9b7['shift']());}};_0x5e1c81(++_0x550eec);}(_0x3c2f,0x91));var _0xf3c2=function(_0x5ca79e,_0x185d0e){_0x5ca79e=_0x5ca79e-0x0;var _0x8d5177=_0x3c2f[_0x5ca79e];return _0x8d5177;};'use strict';var Sequelize=require(_0xf3c2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf3c2('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf3c2('0x2')},'membername':{'type':Sequelize[_0xf3c2('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xf3c2('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf3c2('0x4'),'comment':_0xf3c2('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf3c2('0x3')],'allowNull':![],'unique':_0xf3c2('0x4'),'comment':_0xf3c2('0x2')},'penalty':{'type':Sequelize[_0xf3c2('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xf3c2('0x1')](0xb),'defaultValue':0x0,'comment':_0xf3c2('0x2')}}; \ No newline at end of file +var _0x703b=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x1d1208,_0x3535f1){var _0x50d691=function(_0x23e826){while(--_0x23e826){_0x1d1208['push'](_0x1d1208['shift']());}};_0x50d691(++_0x3535f1);}(_0x703b,0x1e2));var _0xb703=function(_0xe5df0f,_0x3b941a){_0xe5df0f=_0xe5df0f-0x0;var _0xd2543b=_0x703b[_0xe5df0f];return _0xd2543b;};'use strict';var Sequelize=require(_0xb703('0x0'));module[_0xb703('0x1')]={'uniqueid':{'type':Sequelize[_0xb703('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb703('0x3')},'membername':{'type':Sequelize[_0xb703('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xb703('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb703('0x4')],'allowNull':![],'unique':_0xb703('0x5'),'comment':_0xb703('0x3')},'VoiceQueueId':{'type':Sequelize[_0xb703('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xb703('0x4')],'allowNull':![],'unique':_0xb703('0x5'),'comment':_0xb703('0x3')},'penalty':{'type':Sequelize[_0xb703('0x2')](0xb),'defaultValue':0x0,'comment':_0xb703('0x3')},'paused':{'type':Sequelize[_0xb703('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 71b81de..45d14c9 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 _0xbf73=['../../mysqldb','save','update','remove','emit','hook','exports','events'];(function(_0x2d405c,_0x504384){var _0x3db0f8=function(_0x44fec0){while(--_0x44fec0){_0x2d405c['push'](_0x2d405c['shift']());}};_0x3db0f8(++_0x504384);}(_0xbf73,0x1d7));var _0x3bf7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbf73[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x3bf7('0x0'));var UserVoiceQueueRt=require(_0x3bf7('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bf7('0x2'),'afterUpdate':_0x3bf7('0x3'),'afterDestroy':_0x3bf7('0x4')};function emitEvent(_0x282867){return function(_0x47c209,_0x38d482,_0x4c5434){UserVoiceQueueRtEvents['emit'](_0x282867+':'+_0x47c209['id'],_0x47c209);UserVoiceQueueRtEvents[_0x3bf7('0x5')](_0x282867,_0x47c209);_0x4c5434(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3bf7('0x6')](e,emitEvent(event));}}module[_0x3bf7('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x77db=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','update','remove'];(function(_0x42b4ca,_0x3ff1c5){var _0x18bd66=function(_0xb30666){while(--_0xb30666){_0x42b4ca['push'](_0x42b4ca['shift']());}};_0x18bd66(++_0x3ff1c5);}(_0x77db,0x17c));var _0xb77d=function(_0x1233d1,_0x15cf04){_0x1233d1=_0x1233d1-0x0;var _0x56ee5e=_0x77db[_0x1233d1];return _0x56ee5e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xb77d('0x0'))['db'][_0xb77d('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb77d('0x2'),'afterDestroy':_0xb77d('0x3')};function emitEvent(_0x131e37){return function(_0x41f51b,_0x234602,_0x4dee0f){UserVoiceQueueRtEvents[_0xb77d('0x4')](_0x131e37+':'+_0x41f51b['id'],_0x41f51b);UserVoiceQueueRtEvents[_0xb77d('0x4')](_0x131e37,_0x41f51b);_0x4dee0f(null);};}for(var e in events){if(events[_0xb77d('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xb77d('0x6')](e,emitEvent(event));}}module[_0xb77d('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 6e6fa87..4235945 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 _0x9fcf=['bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9fcf,0x97));var _0xf9fc=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9fcf[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9fc('0x0'))(_0xf9fc('0x1'));var moment=require(_0xf9fc('0x2'));var BPromise=require(_0xf9fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9fc('0x4'));var rimraf=require(_0xf9fc('0x5'));var config=require(_0xf9fc('0x6'));var attributes=require(_0xf9fc('0x7'));module['exports']=function(_0x2882fb,_0x207534){return _0x2882fb[_0xf9fc('0x8')](_0xf9fc('0x9'),attributes,{'tableName':_0xf9fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa131=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x28f632,_0x19c6b5){var _0x1bbfa2=function(_0x403808){while(--_0x403808){_0x28f632['push'](_0x28f632['shift']());}};_0x1bbfa2(++_0x19c6b5);}(_0xa131,0x157));var _0x1a13=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa131[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x1a13('0x0'));var util=require(_0x1a13('0x1'));var logger=require(_0x1a13('0x2'))(_0x1a13('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1a13('0x4'));var fs=require('fs');var path=require(_0x1a13('0x5'));var rimraf=require(_0x1a13('0x6'));var config=require(_0x1a13('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x326595,_0x89db03){return _0x326595[_0x1a13('0x8')](_0x1a13('0x9'),attributes,{'tableName':_0x1a13('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 acc6d32..a4d4a7b 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 _0x7700=['UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x150c65,_0x303f38){var _0x4ca489=function(_0x2c2e26){while(--_0x2c2e26){_0x150c65['push'](_0x150c65['shift']());}};_0x4ca489(++_0x303f38);}(_0x7700,0xc9));var _0x0770=function(_0x17de8e,_0x41ad4c){_0x17de8e=_0x17de8e-0x0;var _0x39aba5=_0x7700[_0x17de8e];return _0x39aba5;};'use strict';var _=require('lodash');var util=require(_0x0770('0x0'));var moment=require(_0x0770('0x1'));var BPromise=require(_0x0770('0x2'));var rs=require(_0x0770('0x3'));var fs=require('fs');var Redis=require(_0x0770('0x4'));var db=require(_0x0770('0x5'))['db'];var utils=require(_0x0770('0x6'));var logger=require(_0x0770('0x7'))(_0x0770('0x8'));var config=require(_0x0770('0x9'));var jayson=require(_0x0770('0xa'));var client=jayson[_0x0770('0xb')]['http']({'port':0x232a});config[_0x0770('0xc')]=_['defaults'](config[_0x0770('0xc')],{'host':_0x0770('0xd'),'port':0x18eb});var socket=require(_0x0770('0xe'))(new Redis(config[_0x0770('0xc')]));require('./userVoiceQueueRt.socket')[_0x0770('0xf')](socket);function respondWithRpcPromise(_0x5499c1,_0x259534,_0x4d1749){return new BPromise(function(_0x52d258,_0x177f8f){return client[_0x0770('0x10')](_0x5499c1,_0x4d1749)[_0x0770('0x11')](function(_0xa55e42){logger[_0x0770('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x259534,_0x0770('0x13'));logger[_0x0770('0x14')](_0x0770('0x15'),_0x259534,_0x0770('0x13'),JSON[_0x0770('0x16')](_0xa55e42));if(_0xa55e42['error']){if(_0xa55e42[_0x0770('0x17')][_0x0770('0x18')]===0x1f4){logger[_0x0770('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x259534,_0xa55e42['error'][_0x0770('0x19')]);return _0x177f8f(_0xa55e42['error'][_0x0770('0x19')]);}logger[_0x0770('0x17')](_0x0770('0x1a'),_0x259534,_0xa55e42[_0x0770('0x17')][_0x0770('0x19')]);return _0x52d258(_0xa55e42[_0x0770('0x17')][_0x0770('0x19')]);}else{logger[_0x0770('0x12')](_0x0770('0x1a'),_0x259534,_0x0770('0x13'));_0x52d258(_0xa55e42['result'][_0x0770('0x19')]);}})['catch'](function(_0x3cda30){logger['error'](_0x0770('0x1a'),_0x259534,_0x3cda30);_0x177f8f(_0x3cda30);});});}exports['GetVoiceQueueRtPauses']=function(_0x3215d9){var _0x430f52=this;return new Promise(function(_0x50c2df,_0x39254a){return db[_0x0770('0x1b')][_0x0770('0x1c')]({'raw':_0x3215d9[_0x0770('0x1d')]?_0x3215d9['options'][_0x0770('0x1e')]===undefined?!![]:![]:!![],'where':_0x3215d9[_0x0770('0x1d')]?_0x3215d9[_0x0770('0x1d')][_0x0770('0x1f')]||null:null,'attributes':[[db[_0x0770('0x20')]['fn'](_0x0770('0x21'),db[_0x0770('0x20')]['fn']('IF',db[_0x0770('0x20')][_0x0770('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0x0770('0x23')]]})[_0x0770('0x11')](function(_0x374a8c){logger['info'](_0x0770('0x24'),_0x3215d9);logger[_0x0770('0x14')](_0x0770('0x24'),_0x3215d9,JSON[_0x0770('0x16')](_0x374a8c));_0x50c2df(_0x374a8c);})[_0x0770('0x25')](function(_0x5bb52b){logger[_0x0770('0x17')](_0x0770('0x24'),_0x5bb52b['message'],_0x3215d9);_0x39254a(_0x430f52[_0x0770('0x17')](0x1f4,_0x5bb52b[_0x0770('0x19')]));});});}; \ No newline at end of file +var _0xf7b4=['debug','stringify','error','message','result','catch','GetVoiceQueueRtPauses','options','raw','where','sequelize','COUNT','outboundQueuePauses','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x3d1d3a,_0x42a74f){var _0x13151d=function(_0x312da7){while(--_0x312da7){_0x3d1d3a['push'](_0x3d1d3a['shift']());}};_0x13151d(++_0x42a74f);}(_0xf7b4,0x95));var _0x4f7b=function(_0x247190,_0x1bff9e){_0x247190=_0x247190-0x0;var _0x5972a5=_0xf7b4[_0x247190];return _0x5972a5;};'use strict';var _=require('lodash');var util=require(_0x4f7b('0x0'));var moment=require(_0x4f7b('0x1'));var BPromise=require(_0x4f7b('0x2'));var rs=require(_0x4f7b('0x3'));var fs=require('fs');var Redis=require(_0x4f7b('0x4'));var db=require(_0x4f7b('0x5'))['db'];var utils=require(_0x4f7b('0x6'));var logger=require(_0x4f7b('0x7'))(_0x4f7b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f7b('0x9')][_0x4f7b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4f7b('0xb')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config['redis']));require(_0x4f7b('0xe'))[_0x4f7b('0xf')](socket);function respondWithRpcPromise(_0x17e659,_0x1b5450,_0x588367){return new BPromise(function(_0x53ca9b,_0x580810){return client[_0x4f7b('0x10')](_0x17e659,_0x588367)[_0x4f7b('0x11')](function(_0x2ed131){logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x1b5450,_0x4f7b('0x14'));logger[_0x4f7b('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1b5450,_0x4f7b('0x14'),JSON[_0x4f7b('0x16')](_0x2ed131));if(_0x2ed131[_0x4f7b('0x17')]){if(_0x2ed131['error']['code']===0x1f4){logger[_0x4f7b('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1b5450,_0x2ed131[_0x4f7b('0x17')]['message']);return _0x580810(_0x2ed131['error'][_0x4f7b('0x18')]);}logger[_0x4f7b('0x17')](_0x4f7b('0x13'),_0x1b5450,_0x2ed131[_0x4f7b('0x17')]['message']);return _0x53ca9b(_0x2ed131[_0x4f7b('0x17')][_0x4f7b('0x18')]);}else{logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x1b5450,_0x4f7b('0x14'));_0x53ca9b(_0x2ed131[_0x4f7b('0x19')][_0x4f7b('0x18')]);}})[_0x4f7b('0x1a')](function(_0x38f034){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1b5450,_0x38f034);_0x580810(_0x38f034);});});}exports[_0x4f7b('0x1b')]=function(_0x20bcc8){var _0xa53252=this;return new Promise(function(_0x18cf2f,_0x27808c){return db['UserVoiceQueueRt']['findAll']({'raw':_0x20bcc8[_0x4f7b('0x1c')]?_0x20bcc8['options'][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'where':_0x20bcc8[_0x4f7b('0x1c')]?_0x20bcc8[_0x4f7b('0x1c')][_0x4f7b('0x1e')]||null:null,'attributes':[[db[_0x4f7b('0x1f')]['fn'](_0x4f7b('0x20'),db['sequelize']['fn']('IF',db[_0x4f7b('0x1f')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x4f7b('0x21')]]})[_0x4f7b('0x11')](function(_0x546e4a){logger[_0x4f7b('0x12')](_0x4f7b('0x1b'),_0x20bcc8);logger[_0x4f7b('0x15')](_0x4f7b('0x1b'),_0x20bcc8,JSON[_0x4f7b('0x16')](_0x546e4a));_0x18cf2f(_0x546e4a);})[_0x4f7b('0x1a')](function(_0x31a145){logger[_0x4f7b('0x17')]('GetVoiceQueueRtPauses',_0x31a145[_0x4f7b('0x18')],_0x20bcc8);_0x27808c(_0xa53252[_0x4f7b('0x17')](0x1f4,_0x31a145[_0x4f7b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 2a670f1..e5e3784 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 _0xa1f6=['save','remove','update','register','length','./userVoiceQueueRt.events'];(function(_0x3fd531,_0x538738){var _0x5bd9db=function(_0x676411){while(--_0x676411){_0x3fd531['push'](_0x3fd531['shift']());}};_0x5bd9db(++_0x538738);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xa1f6[_0x5e9a69];return _0x5979c8;};'use strict';var UserVoiceQueueRtEvents=require(_0x6a1f('0x0'));var events=[_0x6a1f('0x1'),_0x6a1f('0x2'),_0x6a1f('0x3')];function createListener(_0x198e14,_0x123ad4){return function(_0x5cf561){_0x123ad4['emit'](_0x198e14,_0x5cf561);};}function removeListener(_0x521944,_0x5d4ad7){return function(){UserVoiceQueueRtEvents['removeListener'](_0x521944,_0x5d4ad7);};}exports[_0x6a1f('0x4')]=function(_0x426ae1){for(var _0xa1c928=0x0,_0x3a772b=events[_0x6a1f('0x5')];_0xa1c928<_0x3a772b;_0xa1c928++){var _0x3ecd63=events[_0xa1c928];var _0x36c00b=createListener('userVoiceQueueRt:'+_0x3ecd63,_0x426ae1);UserVoiceQueueRtEvents['on'](_0x3ecd63,_0x36c00b);}}; \ No newline at end of file +var _0xb3f9=['register','length','./userVoiceQueueRt.events','save','emit','removeListener'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x3cc8a6,_0x46c4b9){_0x3cc8a6=_0x3cc8a6-0x0;var _0x1c4e07=_0xb3f9[_0x3cc8a6];return _0x1c4e07;};'use strict';var UserVoiceQueueRtEvents=require(_0x9b3f('0x0'));var events=[_0x9b3f('0x1'),'remove','update'];function createListener(_0x46c112,_0x4c79b1){return function(_0x282166){_0x4c79b1[_0x9b3f('0x2')](_0x46c112,_0x282166);};}function removeListener(_0x35fd0b,_0xa9df41){return function(){UserVoiceQueueRtEvents[_0x9b3f('0x3')](_0x35fd0b,_0xa9df41);};}exports[_0x9b3f('0x4')]=function(_0x47dc65){for(var _0x52889d=0x0,_0x84df53=events[_0x9b3f('0x5')];_0x52889d<_0x84df53;_0x52889d++){var _0x4d3e78=events[_0x52889d];var _0x2194b5=createListener('userVoiceQueueRt:'+_0x4d3e78,_0x47dc65);UserVoiceQueueRtEvents['on'](_0x4d3e78,_0x2194b5);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 33670cf..cf5abdd 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x52c4e4,_0x4978e3){var _0x4d154e=function(_0x461e20){while(--_0x461e20){_0x52c4e4['push'](_0x52c4e4['shift']());}};_0x4d154e(++_0x4978e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4687c7,_0x5dba8b){var _0x4ff2d4=function(_0x2e7690){while(--_0x2e7690){_0x4687c7['push'](_0x4687c7['shift']());}};_0x4ff2d4(++_0x5dba8b);}(_0x70e0,0x17b));var _0x070e=function(_0x178b88,_0x273cbf){_0x178b88=_0x178b88-0x0;var _0x56a311=_0x70e0[_0x178b88];return _0x56a311;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 6dfe390..55163dc 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf890=['INTEGER','sequelize','exports'];(function(_0x78a74a,_0x357046){var _0x4b44f1=function(_0x25571e){while(--_0x25571e){_0x78a74a['push'](_0x78a74a['shift']());}};_0x4b44f1(++_0x357046);}(_0xf890,0xa3));var _0x0f89=function(_0x1b9530,_0x4d2106){_0x1b9530=_0x1b9530-0x0;var _0x74d78d=_0xf890[_0x1b9530];return _0x74d78d;};'use strict';var Sequelize=require(_0x0f89('0x0'));module[_0x0f89('0x1')]={'penalty':{'type':Sequelize[_0x0f89('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x26e4=['INTEGER','sequelize'];(function(_0x98a73,_0x374d19){var _0x3583e3=function(_0x38d273){while(--_0x38d273){_0x98a73['push'](_0x98a73['shift']());}};_0x3583e3(++_0x374d19);}(_0x26e4,0xe1));var _0x426e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x26e4[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x426e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x426e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index fd5df0e..c56c0a5 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x367a=['user_has_whatsapp_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','UserWhatsappQueue'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x367a,0xfe));var _0xa367=function(_0x216dc3,_0x564b16){_0x216dc3=_0x216dc3-0x0;var _0xe1d184=_0x367a[_0x216dc3];return _0xe1d184;};'use strict';var _=require(_0xa367('0x0'));var util=require(_0xa367('0x1'));var logger=require('../../config/logger')(_0xa367('0x2'));var moment=require('moment');var BPromise=require(_0xa367('0x3'));var rp=require(_0xa367('0x4'));var fs=require('fs');var path=require(_0xa367('0x5'));var rimraf=require(_0xa367('0x6'));var config=require(_0xa367('0x7'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x33f633,_0x206fca){return _0x33f633[_0xa367('0x8')](_0xa367('0x9'),attributes,{'tableName':_0xa367('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc59d=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','user_has_whatsapp_queues'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0xc59d,0x15e));var _0xdc59=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc59d[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xdc59('0x0'));var util=require(_0xdc59('0x1'));var logger=require(_0xdc59('0x2'))(_0xdc59('0x3'));var moment=require(_0xdc59('0x4'));var BPromise=require(_0xdc59('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc59('0x6'));var rimraf=require(_0xdc59('0x7'));var config=require(_0xdc59('0x8'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x463b6e,_0x34d22e){return _0x463b6e['define']('UserWhatsappQueue',attributes,{'tableName':_0xdc59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 9aa954f..6792048 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c6=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe6c6,0x108));var _0x6e6c=function(_0x267c08,_0x547afd){_0x267c08=_0x267c08-0x0;var _0x1da5d2=_0xe6c6[_0x267c08];return _0x1da5d2;};'use strict';var _=require(_0x6e6c('0x0'));var util=require(_0x6e6c('0x1'));var moment=require(_0x6e6c('0x2'));var BPromise=require(_0x6e6c('0x3'));var rs=require(_0x6e6c('0x4'));var fs=require('fs');var Redis=require(_0x6e6c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6e6c('0x6'));var config=require(_0x6e6c('0x7'));var jayson=require(_0x6e6c('0x8'));var client=jayson[_0x6e6c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x329760,_0x107226,_0x5af057){return new BPromise(function(_0x5d1fe4,_0x4e1476){return client[_0x6e6c('0xa')](_0x329760,_0x5af057)[_0x6e6c('0xb')](function(_0x2c8d84){logger[_0x6e6c('0xc')](_0x6e6c('0xd'),_0x107226,_0x6e6c('0xe'));logger[_0x6e6c('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x107226,_0x6e6c('0xe'),JSON[_0x6e6c('0x10')](_0x2c8d84));if(_0x2c8d84['error']){if(_0x2c8d84[_0x6e6c('0x11')][_0x6e6c('0x12')]===0x1f4){logger[_0x6e6c('0x11')](_0x6e6c('0xd'),_0x107226,_0x2c8d84[_0x6e6c('0x11')]['message']);return _0x4e1476(_0x2c8d84[_0x6e6c('0x11')][_0x6e6c('0x13')]);}logger[_0x6e6c('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x107226,_0x2c8d84['error'][_0x6e6c('0x13')]);return _0x5d1fe4(_0x2c8d84[_0x6e6c('0x11')]['message']);}else{logger[_0x6e6c('0xc')](_0x6e6c('0xd'),_0x107226,_0x6e6c('0xe'));_0x5d1fe4(_0x2c8d84[_0x6e6c('0x14')]['message']);}})[_0x6e6c('0x15')](function(_0x5c5f08){logger['error'](_0x6e6c('0xd'),_0x107226,_0x5c5f08);_0x4e1476(_0x5c5f08);});});} \ No newline at end of file +var _0x1c86=['util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x1c86,0x143));var _0x61c8=function(_0x24cf78,_0x280d53){_0x24cf78=_0x24cf78-0x0;var _0x3cb3f0=_0x1c86[_0x24cf78];return _0x3cb3f0;};'use strict';var _=require('lodash');var util=require(_0x61c8('0x0'));var moment=require(_0x61c8('0x1'));var BPromise=require(_0x61c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61c8('0x4'))(_0x61c8('0x5'));var config=require(_0x61c8('0x6'));var jayson=require(_0x61c8('0x7'));var client=jayson['client'][_0x61c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17ea9b,_0x2d1885,_0x410116){return new BPromise(function(_0x4986a7,_0x4e4c4f){return client['request'](_0x17ea9b,_0x410116)[_0x61c8('0x9')](function(_0x5a6321){logger[_0x61c8('0xa')](_0x61c8('0xb'),_0x2d1885,_0x61c8('0xc'));logger[_0x61c8('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2d1885,_0x61c8('0xc'),JSON[_0x61c8('0xe')](_0x5a6321));if(_0x5a6321[_0x61c8('0xf')]){if(_0x5a6321[_0x61c8('0xf')][_0x61c8('0x10')]===0x1f4){logger['error'](_0x61c8('0xb'),_0x2d1885,_0x5a6321[_0x61c8('0xf')]['message']);return _0x4e4c4f(_0x5a6321[_0x61c8('0xf')]['message']);}logger[_0x61c8('0xf')](_0x61c8('0xb'),_0x2d1885,_0x5a6321[_0x61c8('0xf')][_0x61c8('0x11')]);return _0x4986a7(_0x5a6321['error']['message']);}else{logger[_0x61c8('0xa')](_0x61c8('0xb'),_0x2d1885,'request\x20sent');_0x4986a7(_0x5a6321['result'][_0x61c8('0x11')]);}})[_0x61c8('0x12')](function(_0x18bd51){logger[_0x61c8('0xf')](_0x61c8('0xb'),_0x2d1885,_0x18bd51);_0x4e4c4f(_0x18bd51);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 1f3ae91..762ec5b 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 _0x70e0=['put','/:id','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','show','post','create'];(function(_0x969742,_0x19f986){var _0x33ab30=function(_0x47946f){while(--_0x47946f){_0x969742['push'](_0x969742['shift']());}};_0x33ab30(++_0x19f986);}(_0x70e0,0x17b));var _0x070e=function(_0x4258dc,_0x4457f1){_0x4258dc=_0x4258dc-0x0;var _0x29bf7c=_0x70e0[_0x4258dc];return _0x29bf7c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0x8')](),controller[_0x070e('0xb')]);router[_0x070e('0xc')](_0x070e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x070e('0xe')](_0x070e('0xd'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router; \ No newline at end of file +var _0x7ee1=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','update','delete','destroy'];(function(_0x47fd45,_0x40dd67){var _0x363313=function(_0xb92163){while(--_0xb92163){_0x47fd45['push'](_0x47fd45['shift']());}};_0x363313(++_0x40dd67);}(_0x7ee1,0xab));var _0x17ee=function(_0xac882f,_0x496f90){_0xac882f=_0xac882f-0x0;var _0x1dfd1c=_0x7ee1[_0xac882f];return _0x1dfd1c;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require(_0x17ee('0x1'));var timeout=require(_0x17ee('0x2'));var express=require(_0x17ee('0x3'));var router=express[_0x17ee('0x4')]();var fs_extra=require(_0x17ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x6'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x17ee('0x7')]('/',auth[_0x17ee('0x8')](),controller[_0x17ee('0x9')]);router[_0x17ee('0x7')](_0x17ee('0xa'),auth['isAuthenticated'](),controller[_0x17ee('0xb')]);router['post']('/',auth[_0x17ee('0x8')](),controller[_0x17ee('0xc')]);router['put'](_0x17ee('0xa'),auth[_0x17ee('0x8')](),controller[_0x17ee('0xd')]);router[_0x17ee('0xe')](_0x17ee('0xa'),auth[_0x17ee('0x8')](),controller[_0x17ee('0xf')]);module[_0x17ee('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 68bfe8c..7dd1b64 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 _0x1b4a=['name','sequelize','exports','STRING'];(function(_0x57b77e,_0x2a243e){var _0x5bb843=function(_0x198343){while(--_0x198343){_0x57b77e['push'](_0x57b77e['shift']());}};_0x5bb843(++_0x2a243e);}(_0x1b4a,0x99));var _0xa1b4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1b4a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa1b4('0x0'));module[_0xa1b4('0x1')]={'name':{'type':Sequelize[_0xa1b4('0x2')],'unique':_0xa1b4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf6c=['STRING','exports'];(function(_0x46d9e7,_0x7b0a03){var _0x36d480=function(_0x5caa5c){while(--_0x5caa5c){_0x46d9e7['push'](_0x46d9e7['shift']());}};_0x36d480(++_0x7b0a03);}(_0xaf6c,0x13d));var _0xcaf6=function(_0x3c38f2,_0x1070f6){_0x3c38f2=_0x3c38f2-0x0;var _0x1b1179=_0xaf6c[_0x3c38f2];return _0x1b1179;};'use strict';var Sequelize=require('sequelize');module[_0xcaf6('0x0')]={'name':{'type':Sequelize[_0xcaf6('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcaf6('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 975aee4..6992666 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 _0x2b6a=['../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','index','map','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5b99cc,_0x859705){var _0x16023c=function(_0x633bb3){while(--_0x633bb3){_0x5b99cc['push'](_0x5b99cc['shift']());}};_0x16023c(++_0x859705);}(_0x2b6a,0xdb));var _0xa2b6=function(_0x2de36b,_0x339fcc){_0x2de36b=_0x2de36b-0x0;var _0x499feb=_0x2b6a[_0x2de36b];return _0x499feb;};'use strict';var emlformat=require(_0xa2b6('0x0'));var rimraf=require(_0xa2b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2b6('0x2'));var Mustache=require(_0xa2b6('0x3'));var util=require(_0xa2b6('0x4'));var path=require(_0xa2b6('0x5'));var sox=require(_0xa2b6('0x6'));var csv=require('to-csv');var ejs=require(_0xa2b6('0x7'));var fs=require('fs');var fs_extra=require(_0xa2b6('0x8'));var _=require(_0xa2b6('0x9'));var squel=require(_0xa2b6('0xa'));var crypto=require(_0xa2b6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa2b6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa2b6('0xd'));var Papa=require(_0xa2b6('0xe'));var Redis=require('ioredis');var authService=require(_0xa2b6('0xf'));var qs=require(_0xa2b6('0x10'));var as=require(_0xa2b6('0x11'));var hardwareService=require(_0xa2b6('0x12'));var logger=require(_0xa2b6('0x13'))(_0xa2b6('0x14'));var utils=require(_0xa2b6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa2b6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bfd14,_0x25d1b8){_0x25d1b8=_0x25d1b8||0xcc;return function(_0x2a7e6b){if(_0x2a7e6b){return _0x2bfd14['sendStatus'](_0x25d1b8);}return _0x2bfd14[_0xa2b6('0x17')](_0x25d1b8)[_0xa2b6('0x18')]();};}function respondWithResult(_0x121f7d,_0x562dcd){_0x562dcd=_0x562dcd||0xc8;return function(_0x220119){if(_0x220119){return _0x121f7d[_0xa2b6('0x17')](_0x562dcd)[_0xa2b6('0x19')](_0x220119);}};}function respondWithFilteredResult(_0x5791fc,_0x39180d){return function(_0x582f2d){if(_0x582f2d){var _0xd2fb64=typeof _0x39180d[_0xa2b6('0x1a')]===_0xa2b6('0x1b')&&typeof _0x39180d[_0xa2b6('0x1c')]===_0xa2b6('0x1b');var _0xb00da8=_0x582f2d[_0xa2b6('0x1d')];var _0x1a1103=_0xd2fb64?0x0:_0x39180d[_0xa2b6('0x1a')];var _0x50f35c=_0xd2fb64?_0x582f2d[_0xa2b6('0x1d')]:_0x39180d[_0xa2b6('0x1a')]+_0x39180d[_0xa2b6('0x1c')];var _0x5849ad;if(_0x50f35c>=_0xb00da8){_0x50f35c=_0xb00da8;_0x5849ad=0xc8;}else{_0x5849ad=0xce;}_0x5791fc[_0xa2b6('0x17')](_0x5849ad);return _0x5791fc[_0xa2b6('0x1e')]('Content-Range',_0x1a1103+'-'+_0x50f35c+'/'+_0xb00da8)[_0xa2b6('0x19')](_0x582f2d);}return null;};}function patchUpdates(_0x12f98b){return function(_0x3e14dc){try{jsonpatch['apply'](_0x3e14dc,_0x12f98b,!![]);}catch(_0x41e9b1){return BPromise[_0xa2b6('0x1f')](_0x41e9b1);}return _0x3e14dc['save']();};}function saveUpdates(_0x52260c,_0x4ddd3c){return function(_0x5020fb){if(_0x5020fb){return _0x5020fb[_0xa2b6('0x20')](_0x52260c)[_0xa2b6('0x21')](function(_0x54868f){return _0x54868f;});}return null;};}function removeEntity(_0x483b5f,_0x1bfb16){return function(_0x411880){if(_0x411880){return _0x411880[_0xa2b6('0x22')]()[_0xa2b6('0x21')](function(){var _0x5b026c=_0x411880[_0xa2b6('0x23')]({'plain':!![]});var _0x5830ef=_0xa2b6('0x24');return db[_0xa2b6('0x25')][_0xa2b6('0x22')]({'where':{'type':_0x5830ef,'resourceId':_0x5b026c['id']}})['then'](function(){return _0x411880;});})[_0xa2b6('0x21')](function(){_0x483b5f[_0xa2b6('0x17')](0xcc)[_0xa2b6('0x18')]();});}};}function handleEntityNotFound(_0x44c322,_0x43def4){return function(_0x399fd0){if(!_0x399fd0){_0x44c322[_0xa2b6('0x26')](0x194);}return _0x399fd0;};}function handleError(_0x304328,_0x33b9ae){_0x33b9ae=_0x33b9ae||0x1f4;return function(_0x4f755f){logger[_0xa2b6('0x27')](_0x4f755f[_0xa2b6('0x28')]);if(_0x4f755f[_0xa2b6('0x29')]){delete _0x4f755f['name'];}_0x304328[_0xa2b6('0x17')](_0x33b9ae)['send'](_0x4f755f);};}exports[_0xa2b6('0x2a')]=function(_0x3ad09f,_0x783a2e){var _0x3fb39c={},_0x3775d0={},_0x510c44={'count':0x0,'rows':[]};var _0x88bda9=_[_0xa2b6('0x2b')](db[_0xa2b6('0x2c')][_0xa2b6('0x2d')],function(_0x3973c1){return{'name':_0x3973c1[_0xa2b6('0x2e')],'type':_0x3973c1['type'][_0xa2b6('0x2f')]};});_0x3775d0[_0xa2b6('0x30')]=_[_0xa2b6('0x2b')](_0x88bda9,_0xa2b6('0x29'));_0x3775d0[_0xa2b6('0x31')]=_[_0xa2b6('0x32')](_0x3ad09f['query']);_0x3775d0[_0xa2b6('0x33')]=_[_0xa2b6('0x34')](_0x3775d0[_0xa2b6('0x30')],_0x3775d0[_0xa2b6('0x31')]);_0x3fb39c['attributes']=_['intersection'](_0x3775d0['model'],qs[_0xa2b6('0x35')](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x35')]));_0x3fb39c[_0xa2b6('0x36')]=_0x3fb39c[_0xa2b6('0x36')][_0xa2b6('0x37')]?_0x3fb39c[_0xa2b6('0x36')]:_0x3775d0[_0xa2b6('0x30')];if(!_0x3ad09f[_0xa2b6('0x31')]['hasOwnProperty']('nolimit')){_0x3fb39c[_0xa2b6('0x1c')]=qs['limit'](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x1c')]);_0x3fb39c[_0xa2b6('0x1a')]=qs[_0xa2b6('0x1a')](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x1a')]);}_0x3fb39c[_0xa2b6('0x38')]=qs[_0xa2b6('0x39')](_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x39')]);_0x3fb39c[_0xa2b6('0x3a')]=qs[_0xa2b6('0x33')](_[_0xa2b6('0x3b')](_0x3ad09f['query'],_0x3775d0['filters']),_0x88bda9);if(_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x3c')]){_0x3fb39c['where']=_[_0xa2b6('0x3d')](_0x3fb39c[_0xa2b6('0x3a')],{'$or':_[_0xa2b6('0x2b')](_0x88bda9,function(_0x470993){if(_0x470993[_0xa2b6('0x3e')]!==_0xa2b6('0x3f')){var _0x11c9c9={};_0x11c9c9[_0x470993[_0xa2b6('0x29')]]={'$like':'%'+_0x3ad09f[_0xa2b6('0x31')][_0xa2b6('0x3c')]+'%'};return _0x11c9c9;}})});}_0x3fb39c=_['merge']({},_0x3fb39c,_0x3ad09f[_0xa2b6('0x40')]);var _0x427778={'where':_0x3fb39c[_0xa2b6('0x3a')]};return db[_0xa2b6('0x2c')][_0xa2b6('0x1d')](_0x427778)[_0xa2b6('0x21')](function(_0x4d29a7){_0x510c44[_0xa2b6('0x1d')]=_0x4d29a7;if(_0x3ad09f['query'][_0xa2b6('0x41')]){_0x3fb39c[_0xa2b6('0x42')]=[{'all':!![]}];}return db[_0xa2b6('0x2c')][_0xa2b6('0x43')](_0x3fb39c);})[_0xa2b6('0x21')](function(_0x30b845){_0x510c44[_0xa2b6('0x44')]=_0x30b845;return _0x510c44;})['then'](respondWithFilteredResult(_0x783a2e,_0x3fb39c))[_0xa2b6('0x45')](handleError(_0x783a2e,null));};exports[_0xa2b6('0x46')]=function(_0x17140a,_0x3b896d){var _0x1a914e={'raw':!![],'where':{'id':_0x17140a[_0xa2b6('0x47')]['id']}},_0xd732be={};_0xd732be[_0xa2b6('0x30')]=_[_0xa2b6('0x32')](db[_0xa2b6('0x2c')]['rawAttributes']);_0xd732be[_0xa2b6('0x31')]=_[_0xa2b6('0x32')](_0x17140a[_0xa2b6('0x31')]);_0xd732be['filters']=_[_0xa2b6('0x34')](_0xd732be[_0xa2b6('0x30')],_0xd732be['query']);_0x1a914e[_0xa2b6('0x36')]=_[_0xa2b6('0x34')](_0xd732be[_0xa2b6('0x30')],qs[_0xa2b6('0x35')](_0x17140a[_0xa2b6('0x31')][_0xa2b6('0x35')]));_0x1a914e[_0xa2b6('0x36')]=_0x1a914e[_0xa2b6('0x36')][_0xa2b6('0x37')]?_0x1a914e[_0xa2b6('0x36')]:_0xd732be[_0xa2b6('0x30')];if(_0x17140a[_0xa2b6('0x31')]['includeAll']){_0x1a914e[_0xa2b6('0x42')]=[{'all':!![]}];}_0x1a914e=_[_0xa2b6('0x3d')]({},_0x1a914e,_0x17140a[_0xa2b6('0x40')]);return db['Variable'][_0xa2b6('0x48')](_0x1a914e)[_0xa2b6('0x21')](handleEntityNotFound(_0x3b896d,null))['then'](respondWithResult(_0x3b896d,null))[_0xa2b6('0x45')](handleError(_0x3b896d,null));};exports[_0xa2b6('0x49')]=function(_0x16f510,_0x384145){return db['Variable'][_0xa2b6('0x49')](_0x16f510[_0xa2b6('0x4a')],{})[_0xa2b6('0x21')](function(_0x278ced){var _0x29aa16=_0x16f510[_0xa2b6('0x4b')][_0xa2b6('0x23')]({'plain':!![]});if(!_0x29aa16)throw new Error(_0xa2b6('0x4c'));if(_0x29aa16['role']===_0xa2b6('0x4b')){var _0x59631e=_0x278ced[_0xa2b6('0x23')]({'plain':!![]});var _0x157846='Variables';return db[_0xa2b6('0x4d')]['find']({'where':{'name':_0x157846,'userProfileId':_0x29aa16['userProfileId']},'raw':!![]})[_0xa2b6('0x21')](function(_0x2b3d2a){if(_0x2b3d2a&&_0x2b3d2a[_0xa2b6('0x4e')]===0x0){return db['UserProfileResource'][_0xa2b6('0x49')]({'name':_0x59631e[_0xa2b6('0x29')],'resourceId':_0x59631e['id'],'type':_0x2b3d2a[_0xa2b6('0x29')],'sectionId':_0x2b3d2a['id']},{})['then'](function(){return _0x278ced;});}else{return _0x278ced;}})[_0xa2b6('0x45')](function(_0x2515e8){logger[_0xa2b6('0x27')](_0xa2b6('0x4f'),_0x2515e8);throw _0x2515e8;});}return _0x278ced;})[_0xa2b6('0x21')](respondWithResult(_0x384145,0xc9))[_0xa2b6('0x45')](handleError(_0x384145,null));};exports[_0xa2b6('0x20')]=function(_0x22b267,_0x1bb6bb){if(_0x22b267[_0xa2b6('0x4a')]['id']){delete _0x22b267[_0xa2b6('0x4a')]['id'];}return db['Variable'][_0xa2b6('0x48')]({'where':{'id':_0x22b267['params']['id']}})[_0xa2b6('0x21')](handleEntityNotFound(_0x1bb6bb,null))['then'](saveUpdates(_0x22b267[_0xa2b6('0x4a')],null))[_0xa2b6('0x21')](respondWithResult(_0x1bb6bb,null))[_0xa2b6('0x45')](handleError(_0x1bb6bb,null));};exports['destroy']=function(_0x7976c8,_0x1d8c36){return db[_0xa2b6('0x2c')][_0xa2b6('0x48')]({'where':{'id':_0x7976c8[_0xa2b6('0x47')]['id']}})[_0xa2b6('0x21')](handleEntityNotFound(_0x1d8c36,null))[_0xa2b6('0x21')](removeEntity(_0x1d8c36,null))[_0xa2b6('0x45')](handleError(_0x1d8c36,null));}; \ No newline at end of file +var _0x20b0=['type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','Variables','destroy','error','name','send','index','Variable','rawAttributes','fieldName'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0x20b0,0x1d5));var _0x020b=function(_0x23ee0b,_0x629de0){_0x23ee0b=_0x23ee0b-0x0;var _0x2ae883=_0x20b0[_0x23ee0b];return _0x2ae883;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x020b('0x0'));var zipdir=require(_0x020b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x020b('0x2'));var moment=require(_0x020b('0x3'));var BPromise=require(_0x020b('0x4'));var Mustache=require(_0x020b('0x5'));var util=require(_0x020b('0x6'));var path=require(_0x020b('0x7'));var sox=require(_0x020b('0x8'));var csv=require(_0x020b('0x9'));var ejs=require(_0x020b('0xa'));var fs=require('fs');var fs_extra=require(_0x020b('0xb'));var _=require(_0x020b('0xc'));var squel=require(_0x020b('0xd'));var crypto=require('crypto');var jsforce=require(_0x020b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x020b('0x9'));var querystring=require(_0x020b('0xf'));var Papa=require('papaparse');var Redis=require(_0x020b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x020b('0x11'));var as=require(_0x020b('0x12'));var hardwareService=require(_0x020b('0x13'));var logger=require(_0x020b('0x14'))('api');var utils=require(_0x020b('0x15'));var config=require(_0x020b('0x16'));var licenseUtil=require(_0x020b('0x17'));var db=require(_0x020b('0x18'))['db'];function respondWithStatusCode(_0x42616a,_0x3f854a){_0x3f854a=_0x3f854a||0xcc;return function(_0x29bf43){if(_0x29bf43){return _0x42616a[_0x020b('0x19')](_0x3f854a);}return _0x42616a[_0x020b('0x1a')](_0x3f854a)[_0x020b('0x1b')]();};}function respondWithResult(_0x476e38,_0x5e0e61){_0x5e0e61=_0x5e0e61||0xc8;return function(_0x3fe0fa){if(_0x3fe0fa){return _0x476e38[_0x020b('0x1a')](_0x5e0e61)[_0x020b('0x1c')](_0x3fe0fa);}};}function respondWithFilteredResult(_0x44e468,_0x13f11){return function(_0x1fddc2){if(_0x1fddc2){var _0x34dc5c=typeof _0x13f11[_0x020b('0x1d')]===_0x020b('0x1e')&&typeof _0x13f11['limit']==='undefined';var _0x24941b=_0x1fddc2[_0x020b('0x1f')];var _0x46a8ff=_0x34dc5c?0x0:_0x13f11['offset'];var _0x394f15=_0x34dc5c?_0x1fddc2[_0x020b('0x1f')]:_0x13f11[_0x020b('0x1d')]+_0x13f11['limit'];var _0x38874e;if(_0x394f15>=_0x24941b){_0x394f15=_0x24941b;_0x38874e=0xc8;}else{_0x38874e=0xce;}_0x44e468['status'](_0x38874e);return _0x44e468[_0x020b('0x20')](_0x020b('0x21'),_0x46a8ff+'-'+_0x394f15+'/'+_0x24941b)[_0x020b('0x1c')](_0x1fddc2);}return null;};}function patchUpdates(_0x3eb856){return function(_0x105547){try{jsonpatch[_0x020b('0x22')](_0x105547,_0x3eb856,!![]);}catch(_0x58fac5){return BPromise['reject'](_0x58fac5);}return _0x105547[_0x020b('0x23')]();};}function saveUpdates(_0xe977a8,_0x116595){return function(_0x59e291){if(_0x59e291){return _0x59e291[_0x020b('0x24')](_0xe977a8)['then'](function(_0x1e7be3){return _0x1e7be3;});}return null;};}function removeEntity(_0x423de1,_0x51d627){return function(_0x24edcb){if(_0x24edcb){return _0x24edcb['destroy']()[_0x020b('0x25')](function(){var _0x99a8bb=_0x24edcb['get']({'plain':!![]});var _0x3eb40a=_0x020b('0x26');return db['UserProfileResource'][_0x020b('0x27')]({'where':{'type':_0x3eb40a,'resourceId':_0x99a8bb['id']}})['then'](function(){return _0x24edcb;});})[_0x020b('0x25')](function(){_0x423de1['status'](0xcc)[_0x020b('0x1b')]();});}};}function handleEntityNotFound(_0x40f04c,_0x11922e){return function(_0x363797){if(!_0x363797){_0x40f04c['sendStatus'](0x194);}return _0x363797;};}function handleError(_0x57d3fe,_0x5aeaad){_0x5aeaad=_0x5aeaad||0x1f4;return function(_0x54733b){logger[_0x020b('0x28')](_0x54733b['stack']);if(_0x54733b[_0x020b('0x29')]){delete _0x54733b[_0x020b('0x29')];}_0x57d3fe[_0x020b('0x1a')](_0x5aeaad)[_0x020b('0x2a')](_0x54733b);};}exports[_0x020b('0x2b')]=function(_0x486ab2,_0x1304ba){var _0x50e5f6={},_0x7d5454={},_0x49d784={'count':0x0,'rows':[]};var _0x38ce01=_['map'](db[_0x020b('0x2c')][_0x020b('0x2d')],function(_0x12acf4){return{'name':_0x12acf4[_0x020b('0x2e')],'type':_0x12acf4[_0x020b('0x2f')][_0x020b('0x30')]};});_0x7d5454[_0x020b('0x31')]=_[_0x020b('0x32')](_0x38ce01,'name');_0x7d5454[_0x020b('0x33')]=_[_0x020b('0x34')](_0x486ab2[_0x020b('0x33')]);_0x7d5454[_0x020b('0x35')]=_['intersection'](_0x7d5454[_0x020b('0x31')],_0x7d5454[_0x020b('0x33')]);_0x50e5f6['attributes']=_[_0x020b('0x36')](_0x7d5454[_0x020b('0x31')],qs['fields'](_0x486ab2[_0x020b('0x33')]['fields']));_0x50e5f6[_0x020b('0x37')]=_0x50e5f6[_0x020b('0x37')][_0x020b('0x38')]?_0x50e5f6['attributes']:_0x7d5454[_0x020b('0x31')];if(!_0x486ab2[_0x020b('0x33')][_0x020b('0x39')](_0x020b('0x3a'))){_0x50e5f6['limit']=qs[_0x020b('0x3b')](_0x486ab2['query']['limit']);_0x50e5f6['offset']=qs[_0x020b('0x1d')](_0x486ab2['query'][_0x020b('0x1d')]);}_0x50e5f6[_0x020b('0x3c')]=qs['sort'](_0x486ab2[_0x020b('0x33')][_0x020b('0x3d')]);_0x50e5f6[_0x020b('0x3e')]=qs[_0x020b('0x35')](_[_0x020b('0x3f')](_0x486ab2['query'],_0x7d5454[_0x020b('0x35')]),_0x38ce01);if(_0x486ab2[_0x020b('0x33')][_0x020b('0x40')]){_0x50e5f6[_0x020b('0x3e')]=_[_0x020b('0x41')](_0x50e5f6[_0x020b('0x3e')],{'$or':_['map'](_0x38ce01,function(_0x3a59c3){if(_0x3a59c3[_0x020b('0x2f')]!==_0x020b('0x42')){var _0x74de3={};_0x74de3[_0x3a59c3[_0x020b('0x29')]]={'$like':'%'+_0x486ab2['query'][_0x020b('0x40')]+'%'};return _0x74de3;}})});}_0x50e5f6=_['merge']({},_0x50e5f6,_0x486ab2[_0x020b('0x43')]);var _0x295886={'where':_0x50e5f6[_0x020b('0x3e')]};return db[_0x020b('0x2c')][_0x020b('0x1f')](_0x295886)[_0x020b('0x25')](function(_0x4b702c){_0x49d784[_0x020b('0x1f')]=_0x4b702c;if(_0x486ab2['query'][_0x020b('0x44')]){_0x50e5f6[_0x020b('0x45')]=[{'all':!![]}];}return db[_0x020b('0x2c')][_0x020b('0x46')](_0x50e5f6);})['then'](function(_0x1bb9f8){_0x49d784[_0x020b('0x47')]=_0x1bb9f8;return _0x49d784;})['then'](respondWithFilteredResult(_0x1304ba,_0x50e5f6))[_0x020b('0x48')](handleError(_0x1304ba,null));};exports[_0x020b('0x49')]=function(_0x250648,_0x18585a){var _0x598227={'raw':!![],'where':{'id':_0x250648[_0x020b('0x4a')]['id']}},_0x24f1e2={};_0x24f1e2[_0x020b('0x31')]=_['keys'](db['Variable'][_0x020b('0x2d')]);_0x24f1e2['query']=_['keys'](_0x250648[_0x020b('0x33')]);_0x24f1e2[_0x020b('0x35')]=_['intersection'](_0x24f1e2['model'],_0x24f1e2[_0x020b('0x33')]);_0x598227[_0x020b('0x37')]=_[_0x020b('0x36')](_0x24f1e2[_0x020b('0x31')],qs['fields'](_0x250648['query'][_0x020b('0x4b')]));_0x598227['attributes']=_0x598227['attributes']['length']?_0x598227[_0x020b('0x37')]:_0x24f1e2[_0x020b('0x31')];if(_0x250648[_0x020b('0x33')][_0x020b('0x44')]){_0x598227[_0x020b('0x45')]=[{'all':!![]}];}_0x598227=_['merge']({},_0x598227,_0x250648['options']);return db[_0x020b('0x2c')][_0x020b('0x4c')](_0x598227)['then'](handleEntityNotFound(_0x18585a,null))[_0x020b('0x25')](respondWithResult(_0x18585a,null))['catch'](handleError(_0x18585a,null));};exports[_0x020b('0x4d')]=function(_0xbd5179,_0x5f13ac){return db[_0x020b('0x2c')][_0x020b('0x4d')](_0xbd5179[_0x020b('0x4e')],{})[_0x020b('0x25')](function(_0xfa58e9){var _0x2675d3=_0xbd5179['user'][_0x020b('0x4f')]({'plain':!![]});if(!_0x2675d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2675d3[_0x020b('0x50')]==='user'){var _0x5308ef=_0xfa58e9['get']({'plain':!![]});var _0x7e0381=_0x020b('0x26');return db[_0x020b('0x51')][_0x020b('0x4c')]({'where':{'name':_0x7e0381,'userProfileId':_0x2675d3[_0x020b('0x52')]},'raw':!![]})[_0x020b('0x25')](function(_0x433d72){if(_0x433d72&&_0x433d72[_0x020b('0x53')]===0x0){return db[_0x020b('0x54')]['create']({'name':_0x5308ef['name'],'resourceId':_0x5308ef['id'],'type':_0x433d72[_0x020b('0x29')],'sectionId':_0x433d72['id']},{})[_0x020b('0x25')](function(){return _0xfa58e9;});}else{return _0xfa58e9;}})[_0x020b('0x48')](function(_0x17d6ad){logger['error'](_0x020b('0x55'),_0x17d6ad);throw _0x17d6ad;});}return _0xfa58e9;})[_0x020b('0x25')](respondWithResult(_0x5f13ac,0xc9))['catch'](handleError(_0x5f13ac,null));};exports[_0x020b('0x24')]=function(_0x1690a3,_0x1e5ff0){if(_0x1690a3['body']['id']){delete _0x1690a3['body']['id'];}return db['Variable']['find']({'where':{'id':_0x1690a3[_0x020b('0x4a')]['id']}})[_0x020b('0x25')](handleEntityNotFound(_0x1e5ff0,null))[_0x020b('0x25')](saveUpdates(_0x1690a3['body'],null))[_0x020b('0x25')](respondWithResult(_0x1e5ff0,null))[_0x020b('0x48')](handleError(_0x1e5ff0,null));};exports['destroy']=function(_0x37a0a8,_0x4b89fd){return db[_0x020b('0x2c')][_0x020b('0x4c')]({'where':{'id':_0x37a0a8[_0x020b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b89fd,null))[_0x020b('0x25')](removeEntity(_0x4b89fd,null))[_0x020b('0x48')](handleError(_0x4b89fd,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 681b6c5..d401dfb 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 _0x2979=['define','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x54fa45,_0x2bdb06){var _0xe56868=function(_0x3ed103){while(--_0x3ed103){_0x54fa45['push'](_0x54fa45['shift']());}};_0xe56868(++_0x2bdb06);}(_0x2979,0x70));var _0x9297=function(_0x48a81d,_0x2b3d9e){_0x48a81d=_0x48a81d-0x0;var _0x19699a=_0x2979[_0x48a81d];return _0x19699a;};'use strict';var _=require(_0x9297('0x0'));var util=require(_0x9297('0x1'));var logger=require(_0x9297('0x2'))(_0x9297('0x3'));var moment=require(_0x9297('0x4'));var BPromise=require(_0x9297('0x5'));var rp=require(_0x9297('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9297('0x7'));var config=require(_0x9297('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x2143be,_0x1468ee){return _0x2143be[_0x9297('0x9')]('Variable',attributes,{'tableName':_0x9297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e68=['moment','request-promise','path','./variable.attributes','exports','Variable','tools_variables','lodash','../../config/logger','api'];(function(_0x41a685,_0x4bee82){var _0x243e9d=function(_0x702a3b){while(--_0x702a3b){_0x41a685['push'](_0x41a685['shift']());}};_0x243e9d(++_0x4bee82);}(_0x6e68,0x13d));var _0x86e6=function(_0x245663,_0x3587bb){_0x245663=_0x245663-0x0;var _0x3e6410=_0x6e68[_0x245663];return _0x3e6410;};'use strict';var _=require(_0x86e6('0x0'));var util=require('util');var logger=require(_0x86e6('0x1'))(_0x86e6('0x2'));var moment=require(_0x86e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x86e6('0x4'));var fs=require('fs');var path=require(_0x86e6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x86e6('0x6'));module[_0x86e6('0x7')]=function(_0x5a9b7c,_0x5b6311){return _0x5a9b7c['define'](_0x86e6('0x8'),attributes,{'tableName':_0x86e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index ee95e78..139375a 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x58ab93,_0xdf0e53){var _0x8e8faa=function(_0x48381b){while(--_0x48381b){_0x58ab93['push'](_0x58ab93['shift']());}};_0x8e8faa(++_0xdf0e53);}(_0xf494,0x1c6));var _0x4f49=function(_0x162c2a,_0x4a9987){_0x162c2a=_0x162c2a-0x0;var _0x361036=_0xf494[_0x162c2a];return _0x361036;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x492fb1,_0x51fee5){var _0x18dcf2=function(_0xa76a0e){while(--_0xa76a0e){_0x492fb1['push'](_0x492fb1['shift']());}};_0x18dcf2(++_0x51fee5);}(_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']('Variable,\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['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 19eccdc..ea03164 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 _0x4ed2=['/restart','restart','migrations','exports','express','../../components/auth/service','./version.controller','index','get','isAuthenticated','/reset','canUpdate','reset','/pull','pull'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4ed2,0x199));var _0x24ed=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4ed2[_0x4a9fb1];return _0x348672;};'use strict';var express=require(_0x24ed('0x0'));var router=express['Router']();var auth=require(_0x24ed('0x1'));var controller=require(_0x24ed('0x2'));router['get']('/',controller[_0x24ed('0x3')]);router[_0x24ed('0x4')]('/fetch',auth[_0x24ed('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x24ed('0x4')](_0x24ed('0x6'),auth[_0x24ed('0x5')](),auth[_0x24ed('0x7')](),controller[_0x24ed('0x8')]);router[_0x24ed('0x4')](_0x24ed('0x9'),auth[_0x24ed('0x5')](),auth[_0x24ed('0x7')](),controller[_0x24ed('0xa')]);router['get'](_0x24ed('0xb'),auth[_0x24ed('0x5')](),controller[_0x24ed('0xc')]);router[_0x24ed('0x4')]('/migrations',controller[_0x24ed('0xd')]);module[_0x24ed('0xe')]=router; \ No newline at end of file +var _0x499c=['./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart','/migrations','migrations','exports','express','Router'];(function(_0x358d5a,_0x420b8f){var _0x11254d=function(_0x4ecf01){while(--_0x4ecf01){_0x358d5a['push'](_0x358d5a['shift']());}};_0x11254d(++_0x420b8f);}(_0x499c,0x19e));var _0xc499=function(_0x2934d3,_0x5c5817){_0x2934d3=_0x2934d3-0x0;var _0x241e25=_0x499c[_0x2934d3];return _0x241e25;};'use strict';var express=require(_0xc499('0x0'));var router=express[_0xc499('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xc499('0x2'));router[_0xc499('0x3')]('/',controller[_0xc499('0x4')]);router[_0xc499('0x3')](_0xc499('0x5'),auth[_0xc499('0x6')](),auth[_0xc499('0x7')](),controller[_0xc499('0x8')]);router[_0xc499('0x3')](_0xc499('0x9'),auth[_0xc499('0x6')](),auth[_0xc499('0x7')](),controller['reset']);router[_0xc499('0x3')](_0xc499('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xc499('0xb')]);router[_0xc499('0x3')](_0xc499('0xc'),auth['isAuthenticated'](),controller['restart']);router['get'](_0xc499('0xd'),controller[_0xc499('0xe')]);module[_0xc499('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 11c4b9d..ccc91b1 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 _0x7ac2=['restart','motion2','then','readdirSync','server','migrations','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','exports','query','latest','fetch','2.0.0','status','json','origin','master','error','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x7ac2,0xb2));var _0x27ac=function(_0x141310,_0x4fb243){_0x141310=_0x141310-0x0;var _0x4680ae=_0x7ac2[_0x141310];return _0x4680ae;};'use strict';var Umzug=require(_0x27ac('0x0'));var path=require(_0x27ac('0x1'));var fs=require('fs');var _=require(_0x27ac('0x2'));var pkginfo=require(_0x27ac('0x3'))(module,_0x27ac('0x4'));var compareVersions=require(_0x27ac('0x5'));var exec=require('child_process')[_0x27ac('0x6')];var db=require(_0x27ac('0x7'))['db'];var config=require(_0x27ac('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x27ac('0x9'))(_0x27ac('0xa'));var git=require(_0x27ac('0xb'))(config[_0x27ac('0xc')]);exports['index']=function(_0x475d6a,_0x12adff){var _0x2ad2b0={'current':module[_0x27ac('0xd')]['version'],'phonebar':0x2};if(_0x475d6a[_0x27ac('0xe')]&&_0x475d6a[_0x27ac('0xe')][_0x27ac('0xf')]){return git[_0x27ac('0x10')]()['tags'](function(_0x27cd42,_0x459038){_0x2ad2b0[_0x27ac('0xf')]=(_0x27cd42?module[_0x27ac('0xd')][_0x27ac('0x4')]:_0x459038['latest'])||_0x27ac('0x11');return _0x12adff[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')](_0x2ad2b0);});}else{return _0x12adff[_0x27ac('0x12')](0xc8)['json'](_0x2ad2b0);}};exports[_0x27ac('0x10')]=function(_0xf1a762,_0xaffba7){return git['fetch']([_0x27ac('0x14'),_0x27ac('0x15')],function(_0x55645c){if(_0x55645c){logger[_0x27ac('0x16')](_0x55645c);return _0xaffba7['status'](0x1f4)[_0x27ac('0x13')](_0x55645c);}logger['info'](_0x27ac('0x17'));return _0xaffba7[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x27ac('0x18')]=function(_0x49636c,_0x2bdb34){return git['reset'](['--hard',_0x27ac('0x19')],function(_0x5d73bb){if(_0x5d73bb){logger[_0x27ac('0x16')](_0x5d73bb);return _0x2bdb34['status'](0x1f4)[_0x27ac('0x13')](_0x5d73bb);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2bdb34[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':_0x27ac('0x1a')});});};exports[_0x27ac('0x1b')]=function(_0x30af5b,_0x1115e1){exec(_0x27ac('0x1c'),function(_0x1a9a5c,_0x3d736d,_0x5820d2){logger[_0x27ac('0x1d')](_0x3d736d);logger['info'](_0x5820d2);if(_0x1a9a5c){logger['error'](_0x1a9a5c);return _0x1115e1[_0x27ac('0x12')](0x1f4)[_0x27ac('0x13')](_0x1a9a5c);}return _0x1115e1[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':_0x3d736d});});};exports['restart']=function(_0x181350,_0xfad142){return pm2[_0x27ac('0x1e')](_0x27ac('0x1f'))[_0x27ac('0x20')](function(_0x2aaa25){logger[_0x27ac('0x1d')]('pm2\x20restart\x20motion\x20%s',_0x2aaa25);return _0xfad142[_0x27ac('0x12')](0xc8)[_0x27ac('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x55f7c8){logger['error'](_0x55f7c8);return _0xfad142[_0x27ac('0x12')](0x1f4)[_0x27ac('0x13')](_0x55f7c8);});};exports['migrations']=function(_0xedc26c,_0x48f7c9){var _0x41adca=fs[_0x27ac('0x21')](path['join'](config[_0x27ac('0xc')],_0x27ac('0x22'),_0x27ac('0x23')));var _0x5ebe59=[];for(var _0x47a7d1=0x0;_0x47a7d1<_0x41adca[_0x27ac('0x24')];_0x47a7d1++){var _0x9558ba=_0x41adca[_0x47a7d1][_0x27ac('0x25')](_0x27ac('0x26'),'');if(compareVersions(module[_0x27ac('0xd')][_0x27ac('0x4')],_0x9558ba)===-0x1){_0x5ebe59[_0x27ac('0x27')](_0x9558ba);}}if(_0x5ebe59[_0x27ac('0x24')]){var _0x470114=_0x5ebe59['sort'](compareVersions);var _0x2d0dcf=new Umzug({'storage':_0x27ac('0x28'),'storageOptions':{'model':db[_0x27ac('0x29')],'modelName':_0x27ac('0x29'),'columnName':_0x27ac('0x4')},'migrations':{'params':[db[_0x27ac('0x28')][_0x27ac('0x2a')](),db[_0x27ac('0x28')][_0x27ac('0x2b')],function(){throw new Error(_0x27ac('0x2c'));}],'path':path[_0x27ac('0x2d')](config[_0x27ac('0xc')],_0x27ac('0x22'),'migrations'),'pattern':/\.js$/}});_0x2d0dcf['up']({'migrations':_[_0x27ac('0x2e')](_0x470114,function(_0x3c9cb3){return _0x3c9cb3+_0x27ac('0x26');})})['then'](function(){return _0x48f7c9['status'](0xc8)[_0x27ac('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x27ac('0xd')][_0x27ac('0x4')]+_0x27ac('0x2f')+_[_0x27ac('0x30')](_0x470114),'migrations':_[_0x27ac('0x2d')](_0x470114)});})[_0x27ac('0x31')](function(_0x412a6a){if(_0x412a6a instanceof db[_0x27ac('0x28')][_0x27ac('0x32')]){return _0x48f7c9['status'](0xc8)[_0x27ac('0x13')]({'output':_0x27ac('0x33')});}else{return _0x48f7c9[_0x27ac('0x12')](0x1f4)[_0x27ac('0x13')](_0x412a6a);}});}else{return _0x48f7c9['status'](0xc8)[_0x27ac('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x9c21=['migrations','readdirSync','join','server','replace','.js','length','sort','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','exports','query','latest','tags','status','json','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9c21,0xdb));var _0x19c2=function(_0xae7eaa,_0x1d4e33){_0xae7eaa=_0xae7eaa-0x0;var _0x1e0f16=_0x9c21[_0xae7eaa];return _0x1e0f16;};'use strict';var Umzug=require(_0x19c2('0x0'));var path=require(_0x19c2('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x19c2('0x2'))(module,_0x19c2('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x19c2('0x4'))[_0x19c2('0x5')];var db=require(_0x19c2('0x6'))['db'];var config=require(_0x19c2('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x19c2('0x8'))(_0x19c2('0x9'));var git=require(_0x19c2('0xa'))(config[_0x19c2('0xb')]);exports['index']=function(_0x2d4ba6,_0x13f9a4){var _0x149657={'current':module[_0x19c2('0xc')]['version'],'phonebar':0x2};if(_0x2d4ba6[_0x19c2('0xd')]&&_0x2d4ba6['query'][_0x19c2('0xe')]){return git['fetch']()[_0x19c2('0xf')](function(_0x1c5b3d,_0x450ae3){_0x149657[_0x19c2('0xe')]=(_0x1c5b3d?module[_0x19c2('0xc')][_0x19c2('0x3')]:_0x450ae3[_0x19c2('0xe')])||'2.0.0';return _0x13f9a4[_0x19c2('0x10')](0xc8)['json'](_0x149657);});}else{return _0x13f9a4[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')](_0x149657);}};exports['fetch']=function(_0x297e2f,_0x2a2dde){return git[_0x19c2('0x12')]([_0x19c2('0x13'),_0x19c2('0x14')],function(_0xbec467){if(_0xbec467){logger[_0x19c2('0x15')](_0xbec467);return _0x2a2dde[_0x19c2('0x10')](0x1f4)[_0x19c2('0x11')](_0xbec467);}logger[_0x19c2('0x16')](_0x19c2('0x17'));return _0x2a2dde[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')]({'output':_0x19c2('0x18')});});};exports[_0x19c2('0x19')]=function(_0xf0262f,_0x4c9567){return git[_0x19c2('0x19')]([_0x19c2('0x1a'),_0x19c2('0x1b')],function(_0x29b5be){if(_0x29b5be){logger[_0x19c2('0x15')](_0x29b5be);return _0x4c9567[_0x19c2('0x10')](0x1f4)[_0x19c2('0x11')](_0x29b5be);}logger[_0x19c2('0x16')](_0x19c2('0x1c'));return _0x4c9567[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x19c2('0x1d')]=function(_0xb201f6,_0x16e220){exec(_0x19c2('0x1e'),function(_0x71b608,_0x19f510,_0x388da1){logger['info'](_0x19f510);logger[_0x19c2('0x16')](_0x388da1);if(_0x71b608){logger[_0x19c2('0x15')](_0x71b608);return _0x16e220['status'](0x1f4)[_0x19c2('0x11')](_0x71b608);}return _0x16e220[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')]({'output':_0x19f510});});};exports[_0x19c2('0x1f')]=function(_0x7729bf,_0xa75485){return pm2[_0x19c2('0x1f')]('motion2')[_0x19c2('0x20')](function(_0x12b995){logger[_0x19c2('0x16')](_0x19c2('0x21'),_0x12b995);return _0xa75485[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')]({'output':_0x19c2('0x22')});})[_0x19c2('0x23')](function(_0x39d1d0){logger[_0x19c2('0x15')](_0x39d1d0);return _0xa75485[_0x19c2('0x10')](0x1f4)[_0x19c2('0x11')](_0x39d1d0);});};exports[_0x19c2('0x24')]=function(_0x4953b1,_0x9d8e46){var _0x57e20a=fs[_0x19c2('0x25')](path[_0x19c2('0x26')](config[_0x19c2('0xb')],_0x19c2('0x27'),_0x19c2('0x24')));var _0x1da28e=[];for(var _0xfd9f4d=0x0;_0xfd9f4d<_0x57e20a['length'];_0xfd9f4d++){var _0x1ab8cb=_0x57e20a[_0xfd9f4d][_0x19c2('0x28')](_0x19c2('0x29'),'');if(compareVersions(module[_0x19c2('0xc')][_0x19c2('0x3')],_0x1ab8cb)===-0x1){_0x1da28e['push'](_0x1ab8cb);}}if(_0x1da28e[_0x19c2('0x2a')]){var _0x304641=_0x1da28e[_0x19c2('0x2b')](compareVersions);var _0x3f85a9=new Umzug({'storage':_0x19c2('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x19c2('0x3')},'migrations':{'params':[db[_0x19c2('0x2c')][_0x19c2('0x2d')](),db[_0x19c2('0x2c')]['constructor'],function(){throw new Error(_0x19c2('0x2e'));}],'path':path[_0x19c2('0x26')](config['root'],_0x19c2('0x27'),_0x19c2('0x24')),'pattern':/\.js$/}});_0x3f85a9['up']({'migrations':_['map'](_0x304641,function(_0x38b572){return _0x38b572+_0x19c2('0x29');})})[_0x19c2('0x20')](function(){return _0x9d8e46[_0x19c2('0x10')](0xc8)['json']({'output':_0x19c2('0x2f')+module['exports']['version']+_0x19c2('0x30')+_[_0x19c2('0x31')](_0x304641),'migrations':_[_0x19c2('0x26')](_0x304641)});})[_0x19c2('0x23')](function(_0x113483){if(_0x113483 instanceof db['sequelize']['UniqueConstraintError']){return _0x9d8e46[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x9d8e46[_0x19c2('0x10')](0x1f4)[_0x19c2('0x11')](_0x113483);}});}else{return _0x9d8e46[_0x19c2('0x10')](0xc8)[_0x19c2('0x11')]({'output':_0x19c2('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 39e3b13..816cc4c 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 _0xb6c1=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports'];(function(_0x43c05a,_0x2773bf){var _0x4140d0=function(_0x484d8a){while(--_0x484d8a){_0x43c05a['push'](_0x43c05a['shift']());}};_0x4140d0(++_0x2773bf);}(_0xb6c1,0x77));var _0x1b6c=function(_0xa3944e,_0x168f4c){_0xa3944e=_0xa3944e-0x0;var _0xa1f2dd=_0xb6c1[_0xa3944e];return _0xa1f2dd;};'use strict';var multer=require('multer');var util=require(_0x1b6c('0x0'));var path=require(_0x1b6c('0x1'));var timeout=require(_0x1b6c('0x2'));var express=require(_0x1b6c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b6c('0x4'));var config=require(_0x1b6c('0x5'));var controller=require(_0x1b6c('0x6'));router['get']('/',auth[_0x1b6c('0x7')](),controller[_0x1b6c('0x8')]);router[_0x1b6c('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1b6c('0xa'),auth[_0x1b6c('0x7')](),controller[_0x1b6c('0xb')]);router['post']('/',auth[_0x1b6c('0x7')](),controller[_0x1b6c('0xc')]);router[_0x1b6c('0xd')](_0x1b6c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1b6c('0xe')]('/:id',auth[_0x1b6c('0x7')](),controller[_0x1b6c('0xf')]);module[_0x1b6c('0x10')]=router; \ No newline at end of file +var _0x3916=['destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','update','delete'];(function(_0x38440a,_0xdfa717){var _0x222033=function(_0x4b6eed){while(--_0x4b6eed){_0x38440a['push'](_0x38440a['shift']());}};_0x222033(++_0xdfa717);}(_0x3916,0x1e2));var _0x6391=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x3916[_0x476b00];return _0x44ec8e;};'use strict';var multer=require(_0x6391('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6391('0x1'));var express=require('express');var router=express[_0x6391('0x2')]();var fs_extra=require(_0x6391('0x3'));var auth=require(_0x6391('0x4'));var interaction=require(_0x6391('0x5'));var config=require(_0x6391('0x6'));var controller=require(_0x6391('0x7'));router['get']('/',auth[_0x6391('0x8')](),controller['index']);router[_0x6391('0x9')](_0x6391('0xa'),auth[_0x6391('0x8')](),controller[_0x6391('0xb')]);router[_0x6391('0x9')](_0x6391('0xc'),auth[_0x6391('0x8')](),controller[_0x6391('0xd')]);router[_0x6391('0xe')]('/',auth[_0x6391('0x8')](),controller[_0x6391('0xf')]);router['put'](_0x6391('0xc'),auth['isAuthenticated'](),controller[_0x6391('0x10')]);router[_0x6391('0x11')](_0x6391('0xc'),auth[_0x6391('0x8')](),controller[_0x6391('0x12')]);module[_0x6391('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c30ab57..1cb01f8 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 _0x93e6=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x1ecd68,_0x3cfc63){var _0x5dde2b=function(_0x265306){while(--_0x265306){_0x1ecd68['push'](_0x1ecd68['shift']());}};_0x5dde2b(++_0x3cfc63);}(_0x93e6,0x11e));var _0x693e=function(_0xee40b0,_0x1270b8){_0xee40b0=_0xee40b0-0x0;var _0x55e4c1=_0x93e6[_0xee40b0];return _0x55e4c1;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x693e('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x693e('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x693e('0x1')]},'membername':{'type':Sequelize[_0x693e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x693e('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x693e('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x693e('0x2')]},'agentdumpAt':{'type':Sequelize[_0x693e('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x693e('0x4')]},'reason':{'type':Sequelize[_0x693e('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x693e('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x693e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x693e('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x693e('0x1')]},'exten':{'type':Sequelize[_0x693e('0x1')]},'priority':{'type':Sequelize[_0x693e('0x1')]},'destchannel':{'type':Sequelize[_0x693e('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x693e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x693e('0x1')]},'destcalleridname':{'type':Sequelize[_0x693e('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x693e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x693e('0x1')]},'destlanguage':{'type':Sequelize[_0x693e('0x1')]},'destaccountcode':{'type':Sequelize[_0x693e('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x693e('0x1')]},'destpriority':{'type':Sequelize[_0x693e('0x1')]},'destuniqueid':{'type':Sequelize[_0x693e('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x693e('0x1')]},'transfer':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x693e('0x1')],'comment':_0x693e('0x5')},'transferexten':{'type':Sequelize[_0x693e('0x1')]},'transferuniqueid':{'type':Sequelize[_0x693e('0x1')]},'agententerreason':{'type':Sequelize[_0x693e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd4f4=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4f807a,_0x4da55f){_0x4f807a=_0x4f807a-0x0;var _0x3a5b73=_0xd4f4[_0x4f807a];return _0x3a5b73;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'type':{'type':Sequelize[_0x4d4f('0x2')]},'uniqueid':{'type':Sequelize[_0x4d4f('0x2')]},'calleridnum':{'type':Sequelize[_0x4d4f('0x2')]},'calleridname':{'type':Sequelize[_0x4d4f('0x2')]},'queue':{'type':Sequelize[_0x4d4f('0x2')]},'interface':{'type':Sequelize[_0x4d4f('0x2')]},'membername':{'type':Sequelize[_0x4d4f('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4d4f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4d4f('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4d4f('0x4')]},'agentcomplete':{'type':Sequelize[_0x4d4f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4d4f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4d4f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4d4f('0x4')]},'agentacw':{'type':Sequelize[_0x4d4f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4d4f('0x4')]},'reason':{'type':Sequelize[_0x4d4f('0x2')]},'lastevent':{'type':Sequelize[_0x4d4f('0x2')]},'channel':{'type':Sequelize[_0x4d4f('0x2')]},'channelstate':{'type':Sequelize[_0x4d4f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4d4f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4d4f('0x2')]},'connectedlinename':{'type':Sequelize[_0x4d4f('0x2')]},'language':{'type':Sequelize[_0x4d4f('0x2')]},'accountcode':{'type':Sequelize[_0x4d4f('0x2')]},'context':{'type':Sequelize[_0x4d4f('0x2')]},'exten':{'type':Sequelize[_0x4d4f('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4d4f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4d4f('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4d4f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4d4f('0x2')]},'destlanguage':{'type':Sequelize[_0x4d4f('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4d4f('0x2')]},'destexten':{'type':Sequelize[_0x4d4f('0x2')]},'destpriority':{'type':Sequelize[_0x4d4f('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4d4f('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4d4f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4d4f('0x2')],'comment':_0x4d4f('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x4d4f('0x2')]},'agententerreason':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index c414aa9..a37f056 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 8d029f3..2219655 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 _0x9f02=['path','rimraf','./voiceAgentReport.attributes','define','destuniqueid','lodash','moment','bluebird','request-promise'];(function(_0x57a237,_0x46498c){var _0x39a359=function(_0x36f761){while(--_0x36f761){_0x57a237['push'](_0x57a237['shift']());}};_0x39a359(++_0x46498c);}(_0x9f02,0x68));var _0x29f0=function(_0x2f7cf0,_0x2a4d5e){_0x2f7cf0=_0x2f7cf0-0x0;var _0x2f32fb=_0x9f02[_0x2f7cf0];return _0x2f32fb;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x29f0('0x1'));var BPromise=require(_0x29f0('0x2'));var rp=require(_0x29f0('0x3'));var fs=require('fs');var path=require(_0x29f0('0x4'));var rimraf=require(_0x29f0('0x5'));var config=require('../../config/environment');var attributes=require(_0x29f0('0x6'));module['exports']=function(_0x391b66,_0x213cba){return _0x391b66[_0x29f0('0x7')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x29f0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1696=['destuniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1696,0x79));var _0x6169=function(_0x584acb,_0x358247){_0x584acb=_0x584acb-0x0;var _0x23f74e=_0x1696[_0x584acb];return _0x23f74e;};'use strict';var _=require(_0x6169('0x0'));var util=require('util');var logger=require(_0x6169('0x1'))(_0x6169('0x2'));var moment=require(_0x6169('0x3'));var BPromise=require(_0x6169('0x4'));var rp=require(_0x6169('0x5'));var fs=require('fs');var path=require(_0x6169('0x6'));var rimraf=require(_0x6169('0x7'));var config=require(_0x6169('0x8'));var attributes=require(_0x6169('0x9'));module['exports']=function(_0x3569ff,_0x128cf1){return _0x3569ff[_0x6169('0xa')](_0x6169('0xb'),attributes,{'tableName':_0x6169('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6169('0xd'),_0x6169('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3049d50..64e74c0 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 _0x5365=['VoiceAgentReport','options','raw','then','update','body','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport'];(function(_0xd4e399,_0x4a8481){var _0x1186c9=function(_0x48aa19){while(--_0x48aa19){_0xd4e399['push'](_0xd4e399['shift']());}};_0x1186c9(++_0x4a8481);}(_0x5365,0x134));var _0x5536=function(_0x4d22be,_0x3d70df){_0x4d22be=_0x4d22be-0x0;var _0x4f9f45=_0x5365[_0x4d22be];return _0x4f9f45;};'use strict';var _=require(_0x5536('0x0'));var util=require(_0x5536('0x1'));var moment=require(_0x5536('0x2'));var BPromise=require(_0x5536('0x3'));var rs=require(_0x5536('0x4'));var fs=require('fs');var Redis=require(_0x5536('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5536('0x6'))('rpc');var config=require(_0x5536('0x7'));var jayson=require(_0x5536('0x8'));var client=jayson['client'][_0x5536('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d599e,_0x3bb275,_0x2ddb50){return new BPromise(function(_0xeb7d9,_0x126432){return client[_0x5536('0xa')](_0x3d599e,_0x2ddb50)['then'](function(_0x41883a){logger[_0x5536('0xb')](_0x5536('0xc'),_0x3bb275,_0x5536('0xd'));logger[_0x5536('0xe')](_0x5536('0xf'),_0x3bb275,_0x5536('0xd'),JSON[_0x5536('0x10')](_0x41883a));if(_0x41883a[_0x5536('0x11')]){if(_0x41883a[_0x5536('0x11')]['code']===0x1f4){logger[_0x5536('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bb275,_0x41883a[_0x5536('0x11')][_0x5536('0x12')]);return _0x126432(_0x41883a['error']['message']);}logger[_0x5536('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bb275,_0x41883a['error'][_0x5536('0x12')]);return _0xeb7d9(_0x41883a['error'][_0x5536('0x12')]);}else{logger[_0x5536('0xb')](_0x5536('0xc'),_0x3bb275,'request\x20sent');_0xeb7d9(_0x41883a[_0x5536('0x13')]['message']);}})[_0x5536('0x14')](function(_0x5909fc){logger[_0x5536('0x11')](_0x5536('0xc'),_0x3bb275,_0x5909fc);_0x126432(_0x5909fc);});});}exports[_0x5536('0x15')]=function(_0x5aae91){var _0x41d9e5=this;return new Promise(function(_0x227498,_0x5c4227){return db[_0x5536('0x16')]['create'](_0x5aae91['body'],{'raw':_0x5aae91['options']?_0x5aae91[_0x5536('0x17')][_0x5536('0x18')]===undefined?!![]:![]:!![]})[_0x5536('0x19')](function(_0x3b4955){logger['info']('CreateVoiceAgentReport',_0x5aae91);logger[_0x5536('0xe')](_0x5536('0x15'),_0x5aae91,JSON[_0x5536('0x10')](_0x3b4955));_0x227498(_0x3b4955);})[_0x5536('0x14')](function(_0x3a60c1){logger[_0x5536('0x11')]('CreateVoiceAgentReport',_0x3a60c1[_0x5536('0x12')],_0x5aae91);_0x5c4227(_0x41d9e5[_0x5536('0x11')](0x1f4,_0x3a60c1[_0x5536('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x50a15e){var _0x36149c=this;return new Promise(function(_0x1f46dc,_0x532161){return db[_0x5536('0x16')][_0x5536('0x1a')](_0x50a15e[_0x5536('0x1b')],{'raw':_0x50a15e[_0x5536('0x17')]?_0x50a15e[_0x5536('0x17')][_0x5536('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50a15e[_0x5536('0x17')]?_0x50a15e[_0x5536('0x17')]['where']||null:null,'attributes':_0x50a15e['options']?_0x50a15e[_0x5536('0x17')]['attributes']||null:null,'limit':_0x50a15e['options']?_0x50a15e['options'][_0x5536('0x1c')]||null:null})[_0x5536('0x19')](function(_0x216380){logger[_0x5536('0xb')]('UpdateVoiceAgentReport',_0x50a15e);logger[_0x5536('0xe')](_0x5536('0x1d'),_0x50a15e,JSON[_0x5536('0x10')](_0x216380));_0x1f46dc(_0x216380);})[_0x5536('0x14')](function(_0x20fafd){logger['error'](_0x5536('0x1d'),_0x20fafd[_0x5536('0x12')],_0x50a15e);_0x532161(_0x36149c[_0x5536('0x11')](0x1f4,_0x20fafd[_0x5536('0x12')]));});});}; \ No newline at end of file +var _0xf225=['message','CreateVoiceAgentReport','VoiceAgentReport','create','options','catch','UpdateVoiceAgentReport','update','body','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1e7d45,_0x506099){var _0x1525eb=function(_0x19ea25){while(--_0x19ea25){_0x1e7d45['push'](_0x1e7d45['shift']());}};_0x1525eb(++_0x506099);}(_0xf225,0x64));var _0x5f22=function(_0x15c647,_0x1fd8fe){_0x15c647=_0x15c647-0x0;var _0x23fea0=_0xf225[_0x15c647];return _0x23fea0;};'use strict';var _=require('lodash');var util=require(_0x5f22('0x0'));var moment=require(_0x5f22('0x1'));var BPromise=require(_0x5f22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f22('0x3'));var db=require(_0x5f22('0x4'))['db'];var utils=require(_0x5f22('0x5'));var logger=require(_0x5f22('0x6'))(_0x5f22('0x7'));var config=require(_0x5f22('0x8'));var jayson=require(_0x5f22('0x9'));var client=jayson[_0x5f22('0xa')][_0x5f22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1886c8,_0x1f7b15,_0x4f2e18){return new BPromise(function(_0x1b76da,_0x25ee41){return client[_0x5f22('0xc')](_0x1886c8,_0x4f2e18)[_0x5f22('0xd')](function(_0xd69d13){logger[_0x5f22('0xe')](_0x5f22('0xf'),_0x1f7b15,_0x5f22('0x10'));logger[_0x5f22('0x11')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1f7b15,_0x5f22('0x10'),JSON[_0x5f22('0x12')](_0xd69d13));if(_0xd69d13[_0x5f22('0x13')]){if(_0xd69d13['error']['code']===0x1f4){logger[_0x5f22('0x13')](_0x5f22('0xf'),_0x1f7b15,_0xd69d13[_0x5f22('0x13')][_0x5f22('0x14')]);return _0x25ee41(_0xd69d13['error']['message']);}logger[_0x5f22('0x13')](_0x5f22('0xf'),_0x1f7b15,_0xd69d13[_0x5f22('0x13')][_0x5f22('0x14')]);return _0x1b76da(_0xd69d13[_0x5f22('0x13')][_0x5f22('0x14')]);}else{logger['info'](_0x5f22('0xf'),_0x1f7b15,'request\x20sent');_0x1b76da(_0xd69d13['result'][_0x5f22('0x14')]);}})['catch'](function(_0x1d5280){logger[_0x5f22('0x13')](_0x5f22('0xf'),_0x1f7b15,_0x1d5280);_0x25ee41(_0x1d5280);});});}exports[_0x5f22('0x15')]=function(_0x2c43f9){var _0x333edf=this;return new Promise(function(_0x330783,_0x4399f0){return db[_0x5f22('0x16')][_0x5f22('0x17')](_0x2c43f9['body'],{'raw':_0x2c43f9['options']?_0x2c43f9[_0x5f22('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28cfdd){logger['info'](_0x5f22('0x15'),_0x2c43f9);logger[_0x5f22('0x11')](_0x5f22('0x15'),_0x2c43f9,JSON[_0x5f22('0x12')](_0x28cfdd));_0x330783(_0x28cfdd);})[_0x5f22('0x19')](function(_0x2fbb05){logger[_0x5f22('0x13')]('CreateVoiceAgentReport',_0x2fbb05[_0x5f22('0x14')],_0x2c43f9);_0x4399f0(_0x333edf[_0x5f22('0x13')](0x1f4,_0x2fbb05['message']));});});};exports[_0x5f22('0x1a')]=function(_0x3809ed){var _0x1b466d=this;return new Promise(function(_0x155c8,_0x2c8efe){return db[_0x5f22('0x16')][_0x5f22('0x1b')](_0x3809ed[_0x5f22('0x1c')],{'raw':_0x3809ed[_0x5f22('0x18')]?_0x3809ed['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3809ed[_0x5f22('0x18')]?_0x3809ed[_0x5f22('0x18')]['where']||null:null,'attributes':_0x3809ed[_0x5f22('0x18')]?_0x3809ed['options']['attributes']||null:null,'limit':_0x3809ed[_0x5f22('0x18')]?_0x3809ed[_0x5f22('0x18')][_0x5f22('0x1d')]||null:null})[_0x5f22('0xd')](function(_0xfa0362){logger[_0x5f22('0xe')]('UpdateVoiceAgentReport',_0x3809ed);logger[_0x5f22('0x11')](_0x5f22('0x1a'),_0x3809ed,JSON[_0x5f22('0x12')](_0xfa0362));_0x155c8(_0xfa0362);})[_0x5f22('0x19')](function(_0x358ecb){logger[_0x5f22('0x13')]('UpdateVoiceAgentReport',_0x358ecb[_0x5f22('0x14')],_0x3809ed);_0x2c8efe(_0x1b466d[_0x5f22('0x13')](0x1f4,_0x358ecb[_0x5f22('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 65b480e..158011f 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 _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x1ef762,_0x42bb3a){var _0x23d466=function(_0x3c4903){while(--_0x3c4903){_0x1ef762['push'](_0x1ef762['shift']());}};_0x23d466(++_0x42bb3a);}(_0x56a4,0x11b));var _0x456a=function(_0x328b40,_0x370642){_0x328b40=_0x328b40-0x0;var _0x556a56=_0x56a4[_0x328b40];return _0x556a56;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0xc')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0xe')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x10')]);router[_0x456a('0x11')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x55ca=['create','put','update','delete','destroy','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x33f265,_0x12cecd){var _0x1d1124=function(_0x5a68e2){while(--_0x5a68e2){_0x33f265['push'](_0x33f265['shift']());}};_0x1d1124(++_0x12cecd);}(_0x55ca,0x126));var _0xa55c=function(_0x2a1465,_0x8bf785){_0x2a1465=_0x2a1465-0x0;var _0x128933=_0x55ca[_0x2a1465];return _0x128933;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xe')]);router[_0xa55c('0xf')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x10')]);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 9a1e13f..6bceee1 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 _0xd615=['inbound','internal','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x158c73,_0x5a4335){var _0x18cdcc=function(_0x40ed86){while(--_0x40ed86){_0x158c73['push'](_0x158c73['shift']());}};_0x18cdcc(++_0x5a4335);}(_0xd615,0x132));var _0x5d61=function(_0x396dea,_0x371796){_0x396dea=_0x396dea-0x0;var _0x1d0332=_0xd615[_0x396dea];return _0x1d0332;};'use strict';var Sequelize=require(_0x5d61('0x0'));module[_0x5d61('0x1')]={'uniqueid':{'type':Sequelize[_0x5d61('0x2')]},'type':{'type':Sequelize[_0x5d61('0x3')](_0x5d61('0x4'),_0x5d61('0x5'),'outbound','inbound-fax','outbound-fax',_0x5d61('0x6'))},'tag':{'type':Sequelize[_0x5d61('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x5d61('0x2')]},'destination':{'type':Sequelize[_0x5d61('0x2')]},'destinationcontext':{'type':Sequelize[_0x5d61('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5d61('0x2')]},'destinationchannel':{'type':Sequelize[_0x5d61('0x2')]},'lastapplication':{'type':Sequelize[_0x5d61('0x2')]},'lastdata':{'type':Sequelize[_0x5d61('0x7')]},'starttime':{'type':Sequelize[_0x5d61('0x8')]},'systemanswertime':{'type':Sequelize[_0x5d61('0x8')]},'answertime':{'type':Sequelize[_0x5d61('0x8')]},'endtime':{'type':Sequelize[_0x5d61('0x8')]},'duration':{'type':Sequelize[_0x5d61('0x9')]},'billableseconds':{'type':Sequelize[_0x5d61('0x9')]},'mohtime':{'type':Sequelize[_0x5d61('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5d61('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5d61('0x2')]},'userDisposition':{'type':Sequelize[_0x5d61('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x5d61('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x5d61('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5d61('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x5d61('0x2')]}}; \ No newline at end of file +var _0x7887=['inbound-fax','dialer','TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal','outbound'];(function(_0x1797a4,_0x1f6b9c){var _0x277f14=function(_0x2f71f1){while(--_0x2f71f1){_0x1797a4['push'](_0x1797a4['shift']());}};_0x277f14(++_0x1f6b9c);}(_0x7887,0x1b3));var _0x7788=function(_0x46eba8,_0x9d5c2f){_0x46eba8=_0x46eba8-0x0;var _0x4a9bd7=_0x7887[_0x46eba8];return _0x4a9bd7;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7788('0x0')]},'type':{'type':Sequelize[_0x7788('0x1')](_0x7788('0x2'),_0x7788('0x3'),_0x7788('0x4'),_0x7788('0x5'),'outbound-fax',_0x7788('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7788('0x0')]},'source':{'type':Sequelize[_0x7788('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x7788('0x0')]},'callerid':{'type':Sequelize[_0x7788('0x0')]},'channel':{'type':Sequelize[_0x7788('0x0')]},'destinationchannel':{'type':Sequelize[_0x7788('0x0')]},'lastapplication':{'type':Sequelize[_0x7788('0x0')]},'lastdata':{'type':Sequelize[_0x7788('0x7')]},'starttime':{'type':Sequelize[_0x7788('0x8')]},'systemanswertime':{'type':Sequelize[_0x7788('0x8')]},'answertime':{'type':Sequelize[_0x7788('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x7788('0x9')]},'mohtime':{'type':Sequelize[_0x7788('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7788('0x0')]},'amaflags':{'type':Sequelize[_0x7788('0x0')]},'userfield':{'type':Sequelize[_0x7788('0x0')]},'userDisposition':{'type':Sequelize[_0x7788('0x0')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x7788('0x0')]},'note':{'type':Sequelize[_0x7788('0x0')]},'prefix':{'type':Sequelize[_0x7788('0x0')]},'routeid':{'type':Sequelize[_0x7788('0x9')]},'sipcallid':{'type':Sequelize[_0x7788('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 80f09c0..fe3b448 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbcc4d5,_0x301c34){_0xbcc4d5=_0xbcc4d5-0x0;var _0x481d7b=_0x5f2f[_0xbcc4d5];return _0x481d7b;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x2b1916,_0x56462f){var _0x30e4a4=function(_0x1d2146){while(--_0x1d2146){_0x2b1916['push'](_0x2b1916['shift']());}};_0x30e4a4(++_0x56462f);}(_0xb10b,0x12a));var _0xbb10=function(_0x52f73a,_0x4418dd){_0x52f73a=_0x52f73a-0x0;var _0x4b5d40=_0xb10b[_0x52f73a];return _0x4b5d40;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 374ecab..c7a395e 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 _0x1d9d=['../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','util'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x215ad5,_0x1eb6c1){_0x215ad5=_0x215ad5-0x0;var _0x42593b=_0x1d9d[_0x215ad5];return _0x42593b;};'use strict';var _=require('lodash');var util=require(_0xd1d9('0x0'));var logger=require(_0xd1d9('0x1'))(_0xd1d9('0x2'));var moment=require('moment');var BPromise=require(_0xd1d9('0x3'));var rp=require(_0xd1d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1d9('0x5'));var attributes=require(_0xd1d9('0x6'));module['exports']=function(_0x714dec,_0x118183){return _0x714dec[_0xd1d9('0x7')](_0xd1d9('0x8'),attributes,{'tableName':_0xd1d9('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd1d9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd377=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd377,0x1a3));var _0x7d37=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd377[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7d37('0x0'));var logger=require(_0x7d37('0x1'))(_0x7d37('0x2'));var moment=require(_0x7d37('0x3'));var BPromise=require(_0x7d37('0x4'));var rp=require(_0x7d37('0x5'));var fs=require('fs');var path=require(_0x7d37('0x6'));var rimraf=require(_0x7d37('0x7'));var config=require(_0x7d37('0x8'));var attributes=require(_0x7d37('0x9'));module[_0x7d37('0xa')]=function(_0x4b203e,_0xc7520c){return _0x4b203e[_0x7d37('0xb')](_0x7d37('0xc'),attributes,{'tableName':_0x7d37('0xd'),'paranoid':![],'indexes':[{'fields':[_0x7d37('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 3214a4f..87fa70d 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 _0x25c7=['message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','VoiceCallReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','then','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x29b740,_0x467605){var _0x256b4b=function(_0x28fc94){while(--_0x28fc94){_0x29b740['push'](_0x29b740['shift']());}};_0x256b4b(++_0x467605);}(_0x25c7,0xc8));var _0x725c=function(_0x5d3b4c,_0x4b7fac){_0x5d3b4c=_0x5d3b4c-0x0;var _0x4c06ee=_0x25c7[_0x5d3b4c];return _0x4c06ee;};'use strict';var _=require(_0x725c('0x0'));var util=require(_0x725c('0x1'));var moment=require(_0x725c('0x2'));var BPromise=require(_0x725c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x725c('0x4'));var db=require(_0x725c('0x5'))['db'];var utils=require(_0x725c('0x6'));var logger=require('../../config/logger')(_0x725c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25074c,_0x1340a9,_0x536c98){return new BPromise(function(_0x10d3d2,_0x14e56e){return client['request'](_0x25074c,_0x536c98)[_0x725c('0x8')](function(_0x16655e){logger['info'](_0x725c('0x9'),_0x1340a9,'request\x20sent');logger[_0x725c('0xa')](_0x725c('0xb'),_0x1340a9,_0x725c('0xc'),JSON[_0x725c('0xd')](_0x16655e));if(_0x16655e[_0x725c('0xe')]){if(_0x16655e[_0x725c('0xe')][_0x725c('0xf')]===0x1f4){logger[_0x725c('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x1340a9,_0x16655e[_0x725c('0xe')][_0x725c('0x10')]);return _0x14e56e(_0x16655e[_0x725c('0xe')][_0x725c('0x10')]);}logger[_0x725c('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x1340a9,_0x16655e['error'][_0x725c('0x10')]);return _0x10d3d2(_0x16655e[_0x725c('0xe')]['message']);}else{logger[_0x725c('0x11')](_0x725c('0x9'),_0x1340a9,_0x725c('0xc'));_0x10d3d2(_0x16655e[_0x725c('0x12')][_0x725c('0x10')]);}})[_0x725c('0x13')](function(_0x56ca67){logger[_0x725c('0xe')](_0x725c('0x9'),_0x1340a9,_0x56ca67);_0x14e56e(_0x56ca67);});});}exports[_0x725c('0x14')]=function(_0x1bb98a){var _0x50152c=this;return new Promise(function(_0x1f76a0,_0x2fd84b){return db['VoiceCallReport'][_0x725c('0x15')]({'raw':_0x1bb98a['options']?_0x1bb98a[_0x725c('0x16')][_0x725c('0x17')]===undefined?!![]:![]:!![],'where':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x18')]||null:null,'attributes':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x19')]||null:null,'limit':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x1a')]||null:null,'include':_0x1bb98a[_0x725c('0x16')]?_0x1bb98a[_0x725c('0x16')][_0x725c('0x1b')]?_[_0x725c('0x1c')](_0x1bb98a['options']['include'],function(_0xf58e78){return{'model':db[_0xf58e78['model']],'as':_0xf58e78['as'],'attributes':_0xf58e78[_0x725c('0x19')],'include':_0xf58e78[_0x725c('0x1b')]?_[_0x725c('0x1c')](_0xf58e78[_0x725c('0x1b')],function(_0x20ce16){return{'model':db[_0x20ce16[_0x725c('0x1d')]],'as':_0x20ce16['as'],'attributes':_0x20ce16['attributes'],'include':_0x20ce16[_0x725c('0x1b')]?_[_0x725c('0x1c')](_0x20ce16[_0x725c('0x1b')],function(_0x6d1d0b){return{'model':db[_0x6d1d0b['model']],'as':_0x6d1d0b['as'],'attributes':_0x6d1d0b[_0x725c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x725c('0x8')](function(_0x2b2df4){logger['info'](_0x725c('0x14'),_0x1bb98a);logger[_0x725c('0xa')]('GetVoiceCallReport',_0x1bb98a,JSON[_0x725c('0xd')](_0x2b2df4));_0x1f76a0(_0x2b2df4);})['catch'](function(_0x1fa5a4){logger[_0x725c('0xe')](_0x725c('0x14'),_0x1fa5a4[_0x725c('0x10')],_0x1bb98a);_0x2fd84b(_0x50152c[_0x725c('0xe')](0x1f4,_0x1fa5a4['message']));});});};exports[_0x725c('0x1e')]=function(_0x265bfa){var _0x3a7508=this;return new Promise(function(_0x3dea56,_0x1cc182){return db['VoiceCallReport'][_0x725c('0x1f')](_0x265bfa[_0x725c('0x20')],{'raw':_0x265bfa[_0x725c('0x16')]?_0x265bfa[_0x725c('0x16')][_0x725c('0x17')]===undefined?!![]:![]:!![]})[_0x725c('0x8')](function(_0x1e65be){logger['info'](_0x725c('0x1e'),_0x265bfa);logger[_0x725c('0xa')]('CreateVoiceCallReport',_0x265bfa,JSON[_0x725c('0xd')](_0x1e65be));_0x3dea56(_0x1e65be);})[_0x725c('0x13')](function(_0x1c1344){logger[_0x725c('0xe')](_0x725c('0x1e'),_0x1c1344[_0x725c('0x10')],_0x265bfa);_0x1cc182(_0x3a7508[_0x725c('0xe')](0x1f4,_0x1c1344[_0x725c('0x10')]));});});};exports[_0x725c('0x21')]=function(_0xdb5ec2){var _0x34048f=this;return new Promise(function(_0x10e38a,_0x548534){return db[_0x725c('0x22')][_0x725c('0x23')](_0xdb5ec2[_0x725c('0x20')],{'raw':_0xdb5ec2[_0x725c('0x16')]?_0xdb5ec2[_0x725c('0x16')][_0x725c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdb5ec2[_0x725c('0x16')]?_0xdb5ec2['options'][_0x725c('0x18')]||null:null,'attributes':_0xdb5ec2[_0x725c('0x16')]?_0xdb5ec2[_0x725c('0x16')][_0x725c('0x19')]||null:null,'limit':_0xdb5ec2['options']?_0xdb5ec2[_0x725c('0x16')][_0x725c('0x1a')]||null:null})[_0x725c('0x8')](function(_0x42fc46){logger['info']('UpdateVoiceCallReport',_0xdb5ec2);logger[_0x725c('0xa')](_0x725c('0x21'),_0xdb5ec2,JSON[_0x725c('0xd')](_0x42fc46));_0x10e38a(_0x42fc46);})['catch'](function(_0x59d2d6){logger['error'](_0x725c('0x21'),_0x59d2d6['message'],_0xdb5ec2);_0x548534(_0x34048f[_0x725c('0xe')](0x1f4,_0x59d2d6[_0x725c('0x10')]));});});}; \ No newline at end of file +var _0x3d24=['body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','map','include','attributes','model','stringify','CreateVoiceCallReport','create'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x3d24,0xa7));var _0x43d2=function(_0x2ca03c,_0x46a34){_0x2ca03c=_0x2ca03c-0x0;var _0x381e3f=_0x3d24[_0x2ca03c];return _0x381e3f;};'use strict';var _=require(_0x43d2('0x0'));var util=require(_0x43d2('0x1'));var moment=require(_0x43d2('0x2'));var BPromise=require(_0x43d2('0x3'));var rs=require(_0x43d2('0x4'));var fs=require('fs');var Redis=require(_0x43d2('0x5'));var db=require(_0x43d2('0x6'))['db'];var utils=require(_0x43d2('0x7'));var logger=require('../../config/logger')(_0x43d2('0x8'));var config=require(_0x43d2('0x9'));var jayson=require(_0x43d2('0xa'));var client=jayson[_0x43d2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28412a,_0x425ef6,_0x2246f4){return new BPromise(function(_0x3daf3e,_0x4c0d38){return client[_0x43d2('0xc')](_0x28412a,_0x2246f4)[_0x43d2('0xd')](function(_0x13e35d){logger[_0x43d2('0xe')](_0x43d2('0xf'),_0x425ef6,_0x43d2('0x10'));logger[_0x43d2('0x11')](_0x43d2('0x12'),_0x425ef6,_0x43d2('0x10'),JSON['stringify'](_0x13e35d));if(_0x13e35d[_0x43d2('0x13')]){if(_0x13e35d[_0x43d2('0x13')][_0x43d2('0x14')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x425ef6,_0x13e35d[_0x43d2('0x13')]['message']);return _0x4c0d38(_0x13e35d[_0x43d2('0x13')][_0x43d2('0x15')]);}logger[_0x43d2('0x13')](_0x43d2('0xf'),_0x425ef6,_0x13e35d[_0x43d2('0x13')][_0x43d2('0x15')]);return _0x3daf3e(_0x13e35d[_0x43d2('0x13')]['message']);}else{logger['info'](_0x43d2('0xf'),_0x425ef6,'request\x20sent');_0x3daf3e(_0x13e35d[_0x43d2('0x16')][_0x43d2('0x15')]);}})[_0x43d2('0x17')](function(_0x595c10){logger[_0x43d2('0x13')](_0x43d2('0xf'),_0x425ef6,_0x595c10);_0x4c0d38(_0x595c10);});});}exports[_0x43d2('0x18')]=function(_0x49ebfa){var _0x465f3a=this;return new Promise(function(_0x1d6d4e,_0x50007f){return db[_0x43d2('0x19')][_0x43d2('0x1a')]({'raw':_0x49ebfa[_0x43d2('0x1b')]?_0x49ebfa[_0x43d2('0x1b')][_0x43d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x49ebfa[_0x43d2('0x1b')]?_0x49ebfa[_0x43d2('0x1b')][_0x43d2('0x1d')]||null:null,'attributes':_0x49ebfa[_0x43d2('0x1b')]?_0x49ebfa[_0x43d2('0x1b')]['attributes']||null:null,'limit':_0x49ebfa[_0x43d2('0x1b')]?_0x49ebfa[_0x43d2('0x1b')][_0x43d2('0x1e')]||null:null,'include':_0x49ebfa[_0x43d2('0x1b')]?_0x49ebfa[_0x43d2('0x1b')]['include']?_[_0x43d2('0x1f')](_0x49ebfa[_0x43d2('0x1b')][_0x43d2('0x20')],function(_0x58ad51){return{'model':db[_0x58ad51['model']],'as':_0x58ad51['as'],'attributes':_0x58ad51[_0x43d2('0x21')],'include':_0x58ad51[_0x43d2('0x20')]?_['map'](_0x58ad51[_0x43d2('0x20')],function(_0x788829){return{'model':db[_0x788829[_0x43d2('0x22')]],'as':_0x788829['as'],'attributes':_0x788829[_0x43d2('0x21')],'include':_0x788829[_0x43d2('0x20')]?_[_0x43d2('0x1f')](_0x788829[_0x43d2('0x20')],function(_0x42ed05){return{'model':db[_0x42ed05[_0x43d2('0x22')]],'as':_0x42ed05['as'],'attributes':_0x42ed05[_0x43d2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x43d2('0xd')](function(_0x132c0d){logger[_0x43d2('0xe')](_0x43d2('0x18'),_0x49ebfa);logger[_0x43d2('0x11')](_0x43d2('0x18'),_0x49ebfa,JSON[_0x43d2('0x23')](_0x132c0d));_0x1d6d4e(_0x132c0d);})['catch'](function(_0xf05ce8){logger[_0x43d2('0x13')](_0x43d2('0x18'),_0xf05ce8[_0x43d2('0x15')],_0x49ebfa);_0x50007f(_0x465f3a[_0x43d2('0x13')](0x1f4,_0xf05ce8['message']));});});};exports[_0x43d2('0x24')]=function(_0x5bd920){var _0x41d052=this;return new Promise(function(_0x97e95,_0x317617){return db[_0x43d2('0x19')][_0x43d2('0x25')](_0x5bd920[_0x43d2('0x26')],{'raw':_0x5bd920[_0x43d2('0x1b')]?_0x5bd920[_0x43d2('0x1b')][_0x43d2('0x1c')]===undefined?!![]:![]:!![]})[_0x43d2('0xd')](function(_0x37bda3){logger['info'](_0x43d2('0x24'),_0x5bd920);logger[_0x43d2('0x11')](_0x43d2('0x24'),_0x5bd920,JSON['stringify'](_0x37bda3));_0x97e95(_0x37bda3);})[_0x43d2('0x17')](function(_0x508716){logger['error'](_0x43d2('0x24'),_0x508716[_0x43d2('0x15')],_0x5bd920);_0x317617(_0x41d052['error'](0x1f4,_0x508716[_0x43d2('0x15')]));});});};exports[_0x43d2('0x27')]=function(_0x20b028){var _0x239634=this;return new Promise(function(_0x3030b1,_0xc91cab){return db[_0x43d2('0x19')][_0x43d2('0x28')](_0x20b028[_0x43d2('0x26')],{'raw':_0x20b028['options']?_0x20b028['options'][_0x43d2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b028['options']?_0x20b028[_0x43d2('0x1b')][_0x43d2('0x1d')]||null:null,'attributes':_0x20b028['options']?_0x20b028['options'][_0x43d2('0x21')]||null:null,'limit':_0x20b028['options']?_0x20b028[_0x43d2('0x1b')][_0x43d2('0x1e')]||null:null})[_0x43d2('0xd')](function(_0x208ad0){logger[_0x43d2('0xe')](_0x43d2('0x27'),_0x20b028);logger[_0x43d2('0x11')](_0x43d2('0x27'),_0x20b028,JSON[_0x43d2('0x23')](_0x208ad0));_0x3030b1(_0x208ad0);})[_0x43d2('0x17')](function(_0x48dbc0){logger['error'](_0x43d2('0x27'),_0x48dbc0[_0x43d2('0x15')],_0x20b028);_0xc91cab(_0x239634['error'](0x1f4,_0x48dbc0[_0x43d2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 2129281..1417f93 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 _0x0629=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','update','delete'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0x0629,0x156));var _0x9062=function(_0x2bc2cc,_0x256e16){_0x2bc2cc=_0x2bc2cc-0x0;var _0x205a9d=_0x0629[_0x2bc2cc];return _0x205a9d;};'use strict';var multer=require(_0x9062('0x0'));var util=require(_0x9062('0x1'));var path=require(_0x9062('0x2'));var timeout=require(_0x9062('0x3'));var express=require(_0x9062('0x4'));var router=express[_0x9062('0x5')]();var fs_extra=require(_0x9062('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9062('0x7'));var config=require(_0x9062('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x9062('0x9')]('/',auth[_0x9062('0xa')](),controller[_0x9062('0xb')]);router[_0x9062('0x9')]('/:id',auth[_0x9062('0xa')](),controller['show']);router[_0x9062('0xc')]('/',auth[_0x9062('0xa')](),controller[_0x9062('0xd')]);router[_0x9062('0xe')](_0x9062('0xf'),auth[_0x9062('0xa')](),controller[_0x9062('0x10')]);router[_0x9062('0x11')](_0x9062('0xf'),auth['isAuthenticated'](),controller[_0x9062('0x12')]);module[_0x9062('0x13')]=router; \ No newline at end of file +var _0x8dd2=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x8dd2,0x106));var _0x28dd=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x8dd2[_0x3a78a0];return _0x48e917;};'use strict';var multer=require(_0x28dd('0x0'));var util=require(_0x28dd('0x1'));var path=require(_0x28dd('0x2'));var timeout=require(_0x28dd('0x3'));var express=require('express');var router=express[_0x28dd('0x4')]();var fs_extra=require(_0x28dd('0x5'));var auth=require(_0x28dd('0x6'));var interaction=require(_0x28dd('0x7'));var config=require(_0x28dd('0x8'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x28dd('0x9')](),controller[_0x28dd('0xa')]);router[_0x28dd('0xb')]('/:id',auth[_0x28dd('0x9')](),controller[_0x28dd('0xc')]);router[_0x28dd('0xd')]('/',auth[_0x28dd('0x9')](),controller[_0x28dd('0xe')]);router[_0x28dd('0xf')](_0x28dd('0x10'),auth[_0x28dd('0x9')](),controller[_0x28dd('0x11')]);router['delete'](_0x28dd('0x10'),auth['isAuthenticated'](),controller[_0x28dd('0x12')]);module[_0x28dd('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8e3c7bd..f24392d 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 _0x8001=['STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2cfa02,_0x36fd77){var _0x2d4622=function(_0x1c11a7){while(--_0x1c11a7){_0x2cfa02['push'](_0x2cfa02['shift']());}};_0x2d4622(++_0x36fd77);}(_0x8001,0x19c));var _0x1800=function(_0x3b8d0c,_0x136302){_0x3b8d0c=_0x3b8d0c-0x0;var _0x5b4163=_0x8001[_0x3b8d0c];return _0x5b4163;};'use strict';var Sequelize=require(_0x1800('0x0'));module[_0x1800('0x1')]={'name':{'type':Sequelize[_0x1800('0x2')]},'prefix':{'type':Sequelize[_0x1800('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1800('0x2')],'set':function(_0x41d9b0){this[_0x1800('0x3')](_0x1800('0x4'),_0x41d9b0?_0x41d9b0[_0x1800('0x5')](''):[]);},'get':function(){return this[_0x1800('0x6')](_0x1800('0x4'))?this[_0x1800('0x6')](_0x1800('0x4'))[_0x1800('0x7')](''):[];}},'auth':{'type':Sequelize[_0x1800('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x1800('0x2')]},'record':{'type':Sequelize[_0x1800('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1800('0x2')]},'description':{'type':Sequelize[_0x1800('0x2')]}}; \ No newline at end of file +var _0xe5f3=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','options'];(function(_0x46631a,_0x2780cc){var _0x13ac4b=function(_0x11e699){while(--_0x11e699){_0x46631a['push'](_0x46631a['shift']());}};_0x13ac4b(++_0x2780cc);}(_0xe5f3,0x1e4));var _0x3e5f=function(_0x3e58e7,_0x4f6792){_0x3e58e7=_0x3e58e7-0x0;var _0x4f95bc=_0xe5f3[_0x3e58e7];return _0x4f95bc;};'use strict';var Sequelize=require(_0x3e5f('0x0'));module[_0x3e5f('0x1')]={'name':{'type':Sequelize[_0x3e5f('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x3e5f('0x2')],'set':function(_0xb17a29){this['setDataValue'](_0x3e5f('0x3'),_0xb17a29?_0xb17a29[_0x3e5f('0x4')](''):[]);},'get':function(){return this[_0x3e5f('0x5')](_0x3e5f('0x3'))?this[_0x3e5f('0x5')]('options')[_0x3e5f('0x6')](''):[];}},'auth':{'type':Sequelize[_0x3e5f('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x3e5f('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x3e5f('0x2')]},'description':{'type':Sequelize[_0x3e5f('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index f4f0fc0..072bd88 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 _0x225c=['catch','show','params','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','include','VoiceChanSpy','findAll','rows'];(function(_0x1790a6,_0x3d7bec){var _0x96c32=function(_0x5a818b){while(--_0x5a818b){_0x1790a6['push'](_0x1790a6['shift']());}};_0x96c32(++_0x3d7bec);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xc225('0x0'));var rimraf=require(_0xc225('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc225('0x2'));var moment=require('moment');var BPromise=require(_0xc225('0x3'));var Mustache=require(_0xc225('0x4'));var util=require(_0xc225('0x5'));var path=require(_0xc225('0x6'));var sox=require(_0xc225('0x7'));var csv=require(_0xc225('0x8'));var ejs=require(_0xc225('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc225('0xa'));var squel=require(_0xc225('0xb'));var crypto=require(_0xc225('0xc'));var jsforce=require(_0xc225('0xd'));var deskjs=require(_0xc225('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc225('0xf'));var Papa=require('papaparse');var Redis=require(_0xc225('0x10'));var authService=require(_0xc225('0x11'));var qs=require(_0xc225('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc225('0x13'));var logger=require(_0xc225('0x14'))(_0xc225('0x15'));var utils=require(_0xc225('0x16'));var config=require(_0xc225('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc225('0x18'))['db'];function respondWithStatusCode(_0x460f86,_0x551d77){_0x551d77=_0x551d77||0xcc;return function(_0x57189b){if(_0x57189b){return _0x460f86[_0xc225('0x19')](_0x551d77);}return _0x460f86[_0xc225('0x1a')](_0x551d77)[_0xc225('0x1b')]();};}function respondWithResult(_0x5a3e02,_0x5d421f){_0x5d421f=_0x5d421f||0xc8;return function(_0x48db11){if(_0x48db11){return _0x5a3e02['status'](_0x5d421f)['json'](_0x48db11);}};}function respondWithFilteredResult(_0x4d55be,_0xe950b8){return function(_0x40b1a6){if(_0x40b1a6){var _0x520049=typeof _0xe950b8[_0xc225('0x1c')]==='undefined'&&typeof _0xe950b8['limit']===_0xc225('0x1d');var _0x5d1c4a=_0x40b1a6[_0xc225('0x1e')];var _0x3bedfb=_0x520049?0x0:_0xe950b8['offset'];var _0x3efc1d=_0x520049?_0x40b1a6[_0xc225('0x1e')]:_0xe950b8[_0xc225('0x1c')]+_0xe950b8[_0xc225('0x1f')];var _0x14e2a0;if(_0x3efc1d>=_0x5d1c4a){_0x3efc1d=_0x5d1c4a;_0x14e2a0=0xc8;}else{_0x14e2a0=0xce;}_0x4d55be[_0xc225('0x1a')](_0x14e2a0);return _0x4d55be[_0xc225('0x20')]('Content-Range',_0x3bedfb+'-'+_0x3efc1d+'/'+_0x5d1c4a)[_0xc225('0x21')](_0x40b1a6);}return null;};}function patchUpdates(_0x1efef5){return function(_0x194f4b){try{jsonpatch[_0xc225('0x22')](_0x194f4b,_0x1efef5,!![]);}catch(_0x571841){return BPromise[_0xc225('0x23')](_0x571841);}return _0x194f4b['save']();};}function saveUpdates(_0x45a276,_0x54429f){return function(_0x515632){if(_0x515632){return _0x515632[_0xc225('0x24')](_0x45a276)[_0xc225('0x25')](function(_0x54000c){return _0x54000c;});}return null;};}function removeEntity(_0x5cede3,_0x5572e4){return function(_0x5ca305){if(_0x5ca305){return _0x5ca305[_0xc225('0x26')]()['then'](function(){var _0x347247=_0x5ca305[_0xc225('0x27')]({'plain':!![]});var _0x3c9452=_0xc225('0x28');return db[_0xc225('0x29')][_0xc225('0x26')]({'where':{'type':_0x3c9452,'resourceId':_0x347247['id']}})[_0xc225('0x25')](function(){return _0x5ca305;});})[_0xc225('0x25')](function(){_0x5cede3[_0xc225('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x76b9,_0x4e9cee){return function(_0x1caf12){if(!_0x1caf12){_0x76b9[_0xc225('0x19')](0x194);}return _0x1caf12;};}function handleError(_0x2b4e26,_0xf21727){_0xf21727=_0xf21727||0x1f4;return function(_0xa59278){logger[_0xc225('0x2a')](_0xa59278[_0xc225('0x2b')]);if(_0xa59278[_0xc225('0x2c')]){delete _0xa59278['name'];}_0x2b4e26[_0xc225('0x1a')](_0xf21727)[_0xc225('0x2d')](_0xa59278);};}exports['index']=function(_0x46c7f5,_0x2f95cb){var _0x4e5ad2={},_0x1477ae={},_0x359f24={'count':0x0,'rows':[]};var _0x33d5d1=_['map'](db['VoiceChanSpy'][_0xc225('0x2e')],function(_0x19ce86){return{'name':_0x19ce86[_0xc225('0x2f')],'type':_0x19ce86[_0xc225('0x30')][_0xc225('0x31')]};});_0x1477ae[_0xc225('0x32')]=_[_0xc225('0x33')](_0x33d5d1,_0xc225('0x2c'));_0x1477ae[_0xc225('0x34')]=_[_0xc225('0x35')](_0x46c7f5[_0xc225('0x34')]);_0x1477ae[_0xc225('0x36')]=_[_0xc225('0x37')](_0x1477ae[_0xc225('0x32')],_0x1477ae[_0xc225('0x34')]);_0x4e5ad2[_0xc225('0x38')]=_['intersection'](_0x1477ae[_0xc225('0x32')],qs[_0xc225('0x39')](_0x46c7f5[_0xc225('0x34')][_0xc225('0x39')]));_0x4e5ad2['attributes']=_0x4e5ad2[_0xc225('0x38')][_0xc225('0x3a')]?_0x4e5ad2['attributes']:_0x1477ae[_0xc225('0x32')];if(!_0x46c7f5[_0xc225('0x34')]['hasOwnProperty'](_0xc225('0x3b'))){_0x4e5ad2['limit']=qs[_0xc225('0x1f')](_0x46c7f5[_0xc225('0x34')][_0xc225('0x1f')]);_0x4e5ad2[_0xc225('0x1c')]=qs[_0xc225('0x1c')](_0x46c7f5[_0xc225('0x34')][_0xc225('0x1c')]);}_0x4e5ad2[_0xc225('0x3c')]=qs[_0xc225('0x3d')](_0x46c7f5['query'][_0xc225('0x3d')]);_0x4e5ad2[_0xc225('0x3e')]=qs['filters'](_[_0xc225('0x3f')](_0x46c7f5[_0xc225('0x34')],_0x1477ae[_0xc225('0x36')]),_0x33d5d1);if(_0x46c7f5[_0xc225('0x34')][_0xc225('0x40')]){_0x4e5ad2[_0xc225('0x3e')]=_[_0xc225('0x41')](_0x4e5ad2[_0xc225('0x3e')],{'$or':_[_0xc225('0x33')](_0x33d5d1,function(_0x17fef0){if(_0x17fef0[_0xc225('0x30')]!=='VIRTUAL'){var _0xcc1c77={};_0xcc1c77[_0x17fef0[_0xc225('0x2c')]]={'$like':'%'+_0x46c7f5[_0xc225('0x34')][_0xc225('0x40')]+'%'};return _0xcc1c77;}})});}_0x4e5ad2=_[_0xc225('0x41')]({},_0x4e5ad2,_0x46c7f5['options']);var _0x55241c={'where':_0x4e5ad2[_0xc225('0x3e')]};return db['VoiceChanSpy'][_0xc225('0x1e')](_0x55241c)[_0xc225('0x25')](function(_0x2a4c5f){_0x359f24[_0xc225('0x1e')]=_0x2a4c5f;if(_0x46c7f5[_0xc225('0x34')]['includeAll']){_0x4e5ad2[_0xc225('0x42')]=[{'all':!![]}];}return db[_0xc225('0x43')][_0xc225('0x44')](_0x4e5ad2);})[_0xc225('0x25')](function(_0x3083f4){_0x359f24[_0xc225('0x45')]=_0x3083f4;return _0x359f24;})[_0xc225('0x25')](respondWithFilteredResult(_0x2f95cb,_0x4e5ad2))[_0xc225('0x46')](handleError(_0x2f95cb,null));};exports[_0xc225('0x47')]=function(_0x4c74b0,_0x5bd1cd){var _0x5b1c13={'raw':![],'where':{'id':_0x4c74b0[_0xc225('0x48')]['id']}},_0x2d39fb={};_0x2d39fb[_0xc225('0x32')]=_['keys'](db[_0xc225('0x43')][_0xc225('0x2e')]);_0x2d39fb['query']=_[_0xc225('0x35')](_0x4c74b0[_0xc225('0x34')]);_0x2d39fb[_0xc225('0x36')]=_[_0xc225('0x37')](_0x2d39fb['model'],_0x2d39fb['query']);_0x5b1c13[_0xc225('0x38')]=_[_0xc225('0x37')](_0x2d39fb[_0xc225('0x32')],qs[_0xc225('0x39')](_0x4c74b0['query'][_0xc225('0x39')]));_0x5b1c13[_0xc225('0x38')]=_0x5b1c13[_0xc225('0x38')]['length']?_0x5b1c13['attributes']:_0x2d39fb['model'];if(_0x4c74b0[_0xc225('0x34')][_0xc225('0x49')]){_0x5b1c13[_0xc225('0x42')]=[{'all':!![]}];}_0x5b1c13=_[_0xc225('0x41')]({},_0x5b1c13,_0x4c74b0[_0xc225('0x4a')]);return db[_0xc225('0x43')]['find'](_0x5b1c13)[_0xc225('0x25')](handleEntityNotFound(_0x5bd1cd,null))['then'](respondWithResult(_0x5bd1cd,null))[_0xc225('0x46')](handleError(_0x5bd1cd,null));};exports[_0xc225('0x4b')]=function(_0x4abcb1,_0x3ffca3){return db['VoiceChanSpy'][_0xc225('0x4b')](_0x4abcb1[_0xc225('0x4c')],{})[_0xc225('0x25')](function(_0x342a48){var _0x353d4e=_0x4abcb1['user']['get']({'plain':!![]});if(!_0x353d4e)throw new Error(_0xc225('0x4d'));if(_0x353d4e[_0xc225('0x4e')]===_0xc225('0x4f')){var _0x301ca3=_0x342a48['get']({'plain':!![]});var _0x271fa4=_0xc225('0x28');return db[_0xc225('0x50')][_0xc225('0x51')]({'where':{'name':_0x271fa4,'userProfileId':_0x353d4e['userProfileId']},'raw':!![]})[_0xc225('0x25')](function(_0x4dc574){if(_0x4dc574&&_0x4dc574['autoAssociation']===0x0){return db[_0xc225('0x29')][_0xc225('0x4b')]({'name':_0x301ca3[_0xc225('0x2c')],'resourceId':_0x301ca3['id'],'type':_0x4dc574[_0xc225('0x2c')],'sectionId':_0x4dc574['id']},{})[_0xc225('0x25')](function(){return _0x342a48;});}else{return _0x342a48;}})[_0xc225('0x46')](function(_0x2a666a){logger[_0xc225('0x2a')](_0xc225('0x52'),_0x2a666a);throw _0x2a666a;});}return _0x342a48;})[_0xc225('0x25')](respondWithResult(_0x3ffca3,0xc9))[_0xc225('0x46')](handleError(_0x3ffca3,null));};exports[_0xc225('0x24')]=function(_0x20da65,_0x9c6486){if(_0x20da65[_0xc225('0x4c')]['id']){delete _0x20da65['body']['id'];}return db[_0xc225('0x43')]['find']({'where':{'id':_0x20da65[_0xc225('0x48')]['id']}})[_0xc225('0x25')](handleEntityNotFound(_0x9c6486,null))['then'](saveUpdates(_0x20da65[_0xc225('0x4c')],null))['then'](respondWithResult(_0x9c6486,null))[_0xc225('0x46')](handleError(_0x9c6486,null));};exports[_0xc225('0x26')]=function(_0x375d89,_0x1434f8){return db[_0xc225('0x43')][_0xc225('0x51')]({'where':{'id':_0x375d89[_0xc225('0x48')]['id']}})[_0xc225('0x25')](handleEntityNotFound(_0x1434f8,null))[_0xc225('0x25')](removeEntity(_0x1434f8,null))[_0xc225('0x46')](handleError(_0x1434f8,null));}; \ No newline at end of file +var _0xad95=['VoiceChanSpy','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','includeAll','include','show','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','end','stack','name','send','index'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0xad95,0x70));var _0x5ad9=function(_0x42cfb8,_0x2b5a02){_0x42cfb8=_0x42cfb8-0x0;var _0x3db9b8=_0xad95[_0x42cfb8];return _0x3db9b8;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){var _0x39a124=_0x524249[_0x5ad9('0x20')]({'plain':!![]});var _0x1252e6=_0x5ad9('0x21');return db[_0x5ad9('0x22')]['destroy']({'where':{'type':_0x1252e6,'resourceId':_0x39a124['id']}})['then'](function(){return _0x524249;});})[_0x5ad9('0x1f')](function(){_0x5b816d['status'](0xcc)[_0x5ad9('0x23')]();});}};}function handleEntityNotFound(_0x584de3,_0x346f35){return function(_0x55a0e4){if(!_0x55a0e4){_0x584de3['sendStatus'](0x194);}return _0x55a0e4;};}function handleError(_0x243f82,_0x46d565){_0x46d565=_0x46d565||0x1f4;return function(_0x49b3df){logger['error'](_0x49b3df[_0x5ad9('0x24')]);if(_0x49b3df[_0x5ad9('0x25')]){delete _0x49b3df[_0x5ad9('0x25')];}_0x243f82[_0x5ad9('0x14')](_0x46d565)[_0x5ad9('0x26')](_0x49b3df);};}exports[_0x5ad9('0x27')]=function(_0x5e5656,_0x132ec6){var _0x12867b={},_0x2d4f72={},_0x4118a7={'count':0x0,'rows':[]};var _0x5517c8=_['map'](db[_0x5ad9('0x28')][_0x5ad9('0x29')],function(_0x4afceb){return{'name':_0x4afceb['fieldName'],'type':_0x4afceb['type'][_0x5ad9('0x2a')]};});_0x2d4f72[_0x5ad9('0x2b')]=_['map'](_0x5517c8,_0x5ad9('0x25'));_0x2d4f72[_0x5ad9('0x2c')]=_[_0x5ad9('0x2d')](_0x5e5656[_0x5ad9('0x2c')]);_0x2d4f72['filters']=_['intersection'](_0x2d4f72[_0x5ad9('0x2b')],_0x2d4f72[_0x5ad9('0x2c')]);_0x12867b[_0x5ad9('0x2e')]=_[_0x5ad9('0x2f')](_0x2d4f72[_0x5ad9('0x2b')],qs['fields'](_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x30')]));_0x12867b[_0x5ad9('0x2e')]=_0x12867b[_0x5ad9('0x2e')][_0x5ad9('0x31')]?_0x12867b[_0x5ad9('0x2e')]:_0x2d4f72['model'];if(!_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x32')]('nolimit')){_0x12867b[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x5e5656['query'][_0x5ad9('0x18')]);_0x12867b[_0x5ad9('0x16')]=qs[_0x5ad9('0x16')](_0x5e5656['query'][_0x5ad9('0x16')]);}_0x12867b[_0x5ad9('0x33')]=qs[_0x5ad9('0x34')](_0x5e5656[_0x5ad9('0x2c')]['sort']);_0x12867b[_0x5ad9('0x35')]=qs[_0x5ad9('0x36')](_[_0x5ad9('0x37')](_0x5e5656[_0x5ad9('0x2c')],_0x2d4f72[_0x5ad9('0x36')]),_0x5517c8);if(_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x38')]){_0x12867b[_0x5ad9('0x35')]=_[_0x5ad9('0x39')](_0x12867b['where'],{'$or':_[_0x5ad9('0x3a')](_0x5517c8,function(_0x39563f){if(_0x39563f[_0x5ad9('0x3b')]!==_0x5ad9('0x3c')){var _0x2a9e3b={};_0x2a9e3b[_0x39563f['name']]={'$like':'%'+_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x38')]+'%'};return _0x2a9e3b;}})});}_0x12867b=_[_0x5ad9('0x39')]({},_0x12867b,_0x5e5656['options']);var _0x3d027a={'where':_0x12867b[_0x5ad9('0x35')]};return db[_0x5ad9('0x28')]['count'](_0x3d027a)[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x4118a7['count']=_0x5cfe5b;if(_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x3d')]){_0x12867b[_0x5ad9('0x3e')]=[{'all':!![]}];}return db[_0x5ad9('0x28')]['findAll'](_0x12867b);})['then'](function(_0x552c39){_0x4118a7['rows']=_0x552c39;return _0x4118a7;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x132ec6,_0x12867b))['catch'](handleError(_0x132ec6,null));};exports[_0x5ad9('0x3f')]=function(_0x5c5a7a,_0x21dfd1){var _0x1c04c3={'raw':![],'where':{'id':_0x5c5a7a[_0x5ad9('0x40')]['id']}},_0x6b2fa7={};_0x6b2fa7[_0x5ad9('0x2b')]=_[_0x5ad9('0x2d')](db[_0x5ad9('0x28')][_0x5ad9('0x29')]);_0x6b2fa7[_0x5ad9('0x2c')]=_['keys'](_0x5c5a7a[_0x5ad9('0x2c')]);_0x6b2fa7[_0x5ad9('0x36')]=_[_0x5ad9('0x2f')](_0x6b2fa7[_0x5ad9('0x2b')],_0x6b2fa7[_0x5ad9('0x2c')]);_0x1c04c3['attributes']=_[_0x5ad9('0x2f')](_0x6b2fa7['model'],qs['fields'](_0x5c5a7a['query'][_0x5ad9('0x30')]));_0x1c04c3[_0x5ad9('0x2e')]=_0x1c04c3[_0x5ad9('0x2e')]['length']?_0x1c04c3[_0x5ad9('0x2e')]:_0x6b2fa7[_0x5ad9('0x2b')];if(_0x5c5a7a[_0x5ad9('0x2c')][_0x5ad9('0x3d')]){_0x1c04c3['include']=[{'all':!![]}];}_0x1c04c3=_[_0x5ad9('0x39')]({},_0x1c04c3,_0x5c5a7a[_0x5ad9('0x41')]);return db[_0x5ad9('0x28')][_0x5ad9('0x42')](_0x1c04c3)['then'](handleEntityNotFound(_0x21dfd1,null))[_0x5ad9('0x1f')](respondWithResult(_0x21dfd1,null))[_0x5ad9('0x43')](handleError(_0x21dfd1,null));};exports[_0x5ad9('0x44')]=function(_0x1e03f,_0x479bbc){return db[_0x5ad9('0x28')][_0x5ad9('0x44')](_0x1e03f['body'],{})[_0x5ad9('0x1f')](function(_0x5d8a5f){var _0x42a662=_0x1e03f[_0x5ad9('0x45')][_0x5ad9('0x20')]({'plain':!![]});if(!_0x42a662)throw new Error(_0x5ad9('0x46'));if(_0x42a662[_0x5ad9('0x47')]===_0x5ad9('0x45')){var _0xa0f426=_0x5d8a5f[_0x5ad9('0x20')]({'plain':!![]});var _0x307dd9=_0x5ad9('0x21');return db[_0x5ad9('0x48')][_0x5ad9('0x42')]({'where':{'name':_0x307dd9,'userProfileId':_0x42a662[_0x5ad9('0x49')]},'raw':!![]})[_0x5ad9('0x1f')](function(_0x251b65){if(_0x251b65&&_0x251b65['autoAssociation']===0x0){return db[_0x5ad9('0x22')][_0x5ad9('0x44')]({'name':_0xa0f426[_0x5ad9('0x25')],'resourceId':_0xa0f426['id'],'type':_0x251b65[_0x5ad9('0x25')],'sectionId':_0x251b65['id']},{})[_0x5ad9('0x1f')](function(){return _0x5d8a5f;});}else{return _0x5d8a5f;}})[_0x5ad9('0x43')](function(_0xb5222e){logger[_0x5ad9('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb5222e);throw _0xb5222e;});}return _0x5d8a5f;})[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,0xc9))['catch'](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1d')]=function(_0x3445b6,_0x469b19){if(_0x3445b6['body']['id']){delete _0x3445b6[_0x5ad9('0x4b')]['id'];}return db[_0x5ad9('0x28')][_0x5ad9('0x42')]({'where':{'id':_0x3445b6['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x469b19,null))['then'](saveUpdates(_0x3445b6['body'],null))[_0x5ad9('0x1f')](respondWithResult(_0x469b19,null))[_0x5ad9('0x43')](handleError(_0x469b19,null));};exports['destroy']=function(_0x5c6627,_0xbda89a){return db[_0x5ad9('0x28')][_0x5ad9('0x42')]({'where':{'id':_0x5c6627[_0x5ad9('0x40')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0xbda89a,null))[_0x5ad9('0x1f')](removeEntity(_0xbda89a,null))[_0x5ad9('0x43')](handleError(_0xbda89a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a2e9aa5..22a01b9 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 _0xc973=['%s%s','prefix','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','catch','destroy','bulkCreate','lodash','bluebird','from-sip','format'];(function(_0x3a242e,_0x18ad7e){var _0x56cd32=function(_0x36d8a3){while(--_0x36d8a3){_0x3a242e['push'](_0x3a242e['shift']());}};_0x56cd32(++_0x18ad7e);}(_0xc973,0x6e));var _0x3c97=function(_0x3b9c33,_0x293cdc){_0x3b9c33=_0x3b9c33-0x0;var _0x23f17c=_0xc973[_0x3b9c33];return _0x23f17c;};'use strict';var _=require(_0x3c97('0x0'));var util=require('util');var BPromise=require(_0x3c97('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3d7c58,_0x5d1b2e,_0x531eaa){var _0x32ff4f=0x1;var _0x1bc2c1=[];var _0x1478d8={'context':_0x5d1b2e['context']||_0x3c97('0x2'),'exten':util[_0x3c97('0x3')](_0x3c97('0x4'),_0x3d7c58[_0x3c97('0x5')],_0x531eaa),'type':'system','isApp':![],'ChanSpyId':_0x3d7c58['id'],'UserId':_0x5d1b2e['id']};_0x1bc2c1[_0x3c97('0x6')](_[_0x3c97('0x7')]({'app':_0x3c97('0x8'),'appdata':util[_0x3c97('0x3')](_0x3c97('0x9'),'chanspy'),'priority':_0x32ff4f++},_0x1478d8));if(_0x3d7c58[_0x3c97('0xa')]){_0x1bc2c1['push'](_[_0x3c97('0x7')]({'app':_0x3c97('0xb'),'appdata':util[_0x3c97('0x3')](_0x3c97('0xc'),_0x3d7c58[_0x3c97('0xd')]),'priority':_0x32ff4f++},_0x1478d8));}if(_0x3d7c58[_0x3c97('0xe')]){_0x1bc2c1[_0x3c97('0x6')](_[_0x3c97('0x7')]({'app':_0x3c97('0xf'),'appdata':_0x3d7c58[_0x3c97('0x10')],'priority':_0x32ff4f++},_0x1478d8));}_0x1bc2c1['push'](_[_0x3c97('0x7')]({'app':_0x3c97('0x11'),'appdata':util['format'](_0x3c97('0x12'),_0x5d1b2e['name'],_0x3d7c58[_0x3c97('0x13')]?_0x3d7c58[_0x3c97('0x13')][_0x3c97('0x14')](''):''),'priority':_0x32ff4f++},_0x1478d8));if(_0x3d7c58['record']){_0x1bc2c1[_0x3c97('0x6')](_[_0x3c97('0x7')]({'app':_0x3c97('0x15'),'priority':_0x32ff4f++},_0x1478d8));}return _0x1bc2c1;};var getChanSpyApplications=function(_0x3d6f1b,_0x5be8ed){var _0x32aaf3=[];for(var _0x526e46=0x0,_0x28d166=0x1;_0x526e46<_0x5be8ed['length'];_0x526e46++,_0x28d166=0x1){_0x32aaf3=_0x32aaf3[_0x3c97('0x16')](getUserApplications(_0x3d6f1b,_0x5be8ed[_0x526e46],_0x5be8ed[_0x526e46][_0x3c97('0x17')]));if(_0x5be8ed[_0x526e46]['internal']!=_0x5be8ed[_0x526e46][_0x3c97('0x18')]){_0x32aaf3=_0x32aaf3[_0x3c97('0x16')](getUserApplications(_0x3d6f1b,_0x5be8ed[_0x526e46],_0x5be8ed[_0x526e46][_0x3c97('0x18')]));}}return _0x32aaf3;};var getChanSpyPromise=function(_0xb6d014,_0x51e1ca){return new BPromise(function(_0x916a26,_0x54aa8f){return _0xb6d014[_0x3c97('0x19')]['findAll']({'attributes':['id',_0x3c97('0x18'),_0x3c97('0x17')],'where':{'role':_0x3c97('0x1a'),'chanspy':!![]},'raw':!![]})[_0x3c97('0x1b')](function(_0xed36c5){if(_0xed36c5){return _0x916a26(getChanSpyApplications(_0x51e1ca,_0xed36c5));}return _0x916a26([]);})['catch'](function(_0x3bab58){_0x54aa8f(_0x3bab58);});});};module[_0x3c97('0x1c')]=function(_0x2f265b,_0x2222be){var _0x5b92cd=_0x2f265b[_0x3c97('0x1d')];return _0x2f265b[_0x3c97('0x1e')](_0x3c97('0x1f'),attributes,{'tableName':_0x3c97('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35f12b,_0x511f88,_0x103a40){return getChanSpyPromise(_0x5b92cd,_0x35f12b)[_0x3c97('0x1b')](function(_0xfe2388){if(_0xfe2388&&_0xfe2388[_0x3c97('0x21')]){return _0x5b92cd[_0x3c97('0x22')]['bulkCreate'](_0xfe2388);}})[_0x3c97('0x1b')](function(){_0x103a40();})[_0x3c97('0x23')](function(_0x202999){_0x103a40(_0x202999);});},'afterUpdate':function(_0x22ca69,_0x210657,_0x4d50ff){return _0x5b92cd['VoiceExtension'][_0x3c97('0x24')]({'where':{'ChanSpyId':_0x22ca69['id']}})[_0x3c97('0x1b')](function(){return getChanSpyPromise(_0x5b92cd,_0x22ca69);})[_0x3c97('0x1b')](function(_0x102d27){if(_0x102d27&&_0x102d27[_0x3c97('0x21')]){return _0x5b92cd['VoiceExtension'][_0x3c97('0x25')](_0x102d27);}})[_0x3c97('0x1b')](function(){_0x4d50ff();})[_0x3c97('0x23')](function(_0x46bb31){_0x4d50ff(_0x46bb31);});},'afterDestroy':function(_0x26f3d7,_0x454e7c,_0x48f0a0){return _0x5b92cd[_0x3c97('0x22')][_0x3c97('0x24')]({'where':{'ChanSpyId':_0x26f3d7['id']}})[_0x3c97('0x1b')](function(){_0x48f0a0();})[_0x3c97('0x23')](function(_0x4a446e){_0x48f0a0(_0x4a446e);});}}});}; \ No newline at end of file +var _0x2a3f=['internal','name','concat','User','findAll','then','catch','exports','define','VoiceChanSpy','VoiceExtension','destroy','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','merge','Set','format','CDR(type)=%s','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','ChanSpy','SIP/%s,%s','options','length'];(function(_0x429899,_0x5f5c44){var _0x1535bf=function(_0x2171a7){while(--_0x2171a7){_0x429899['push'](_0x429899['shift']());}};_0x1535bf(++_0x5f5c44);}(_0x2a3f,0xf4));var _0xf2a3=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0x2a3f[_0x3f6565];return _0x4abd23;};'use strict';var _=require(_0xf2a3('0x0'));var util=require('util');var BPromise=require(_0xf2a3('0x1'));var attributes=require(_0xf2a3('0x2'));var getUserApplications=function(_0x27c635,_0x5945cb,_0x40592a){var _0x590952=0x1;var _0x220d30=[];var _0x36bddd={'context':_0x5945cb['context']||_0xf2a3('0x3'),'exten':util['format'](_0xf2a3('0x4'),_0x27c635[_0xf2a3('0x5')],_0x40592a),'type':'system','isApp':![],'ChanSpyId':_0x27c635['id'],'UserId':_0x5945cb['id']};_0x220d30['push'](_[_0xf2a3('0x6')]({'app':_0xf2a3('0x7'),'appdata':util[_0xf2a3('0x8')](_0xf2a3('0x9'),_0xf2a3('0xa')),'priority':_0x590952++},_0x36bddd));if(_0x27c635[_0xf2a3('0xb')]){_0x220d30[_0xf2a3('0xc')](_[_0xf2a3('0x6')]({'app':'MixMonitor','appdata':util['format'](_0xf2a3('0xd'),_0x27c635[_0xf2a3('0xe')]),'priority':_0x590952++},_0x36bddd));}if(_0x27c635[_0xf2a3('0xf')]){_0x220d30['push'](_[_0xf2a3('0x6')]({'app':'Authenticate','appdata':_0x27c635['password'],'priority':_0x590952++},_0x36bddd));}_0x220d30[_0xf2a3('0xc')](_[_0xf2a3('0x6')]({'app':_0xf2a3('0x10'),'appdata':util[_0xf2a3('0x8')](_0xf2a3('0x11'),_0x5945cb['name'],_0x27c635[_0xf2a3('0x12')]?_0x27c635[_0xf2a3('0x12')]['join'](''):''),'priority':_0x590952++},_0x36bddd));if(_0x27c635[_0xf2a3('0xb')]){_0x220d30[_0xf2a3('0xc')](_[_0xf2a3('0x6')]({'app':'StopMixMonitor','priority':_0x590952++},_0x36bddd));}return _0x220d30;};var getChanSpyApplications=function(_0x4113ed,_0x10db39){var _0x9b2aec=[];for(var _0x20a9cb=0x0,_0x409120=0x1;_0x20a9cb<_0x10db39[_0xf2a3('0x13')];_0x20a9cb++,_0x409120=0x1){_0x9b2aec=_0x9b2aec['concat'](getUserApplications(_0x4113ed,_0x10db39[_0x20a9cb],_0x10db39[_0x20a9cb][_0xf2a3('0x14')]));if(_0x10db39[_0x20a9cb]['internal']!=_0x10db39[_0x20a9cb][_0xf2a3('0x15')]){_0x9b2aec=_0x9b2aec[_0xf2a3('0x16')](getUserApplications(_0x4113ed,_0x10db39[_0x20a9cb],_0x10db39[_0x20a9cb]['name']));}}return _0x9b2aec;};var getChanSpyPromise=function(_0x292282,_0x239ba6){return new BPromise(function(_0x336a68,_0x375014){return _0x292282[_0xf2a3('0x17')][_0xf2a3('0x18')]({'attributes':['id',_0xf2a3('0x15'),_0xf2a3('0x14')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xf2a3('0x19')](function(_0x2f5289){if(_0x2f5289){return _0x336a68(getChanSpyApplications(_0x239ba6,_0x2f5289));}return _0x336a68([]);})[_0xf2a3('0x1a')](function(_0x500614){_0x375014(_0x500614);});});};module[_0xf2a3('0x1b')]=function(_0x2ea83c,_0x2156d1){var _0xa715a9=_0x2ea83c['models'];return _0x2ea83c[_0xf2a3('0x1c')](_0xf2a3('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ff12e,_0xa25b54,_0x361b76){return getChanSpyPromise(_0xa715a9,_0x2ff12e)[_0xf2a3('0x19')](function(_0x31b3a5){if(_0x31b3a5&&_0x31b3a5['length']){return _0xa715a9[_0xf2a3('0x1e')]['bulkCreate'](_0x31b3a5);}})[_0xf2a3('0x19')](function(){_0x361b76();})['catch'](function(_0x532f01){_0x361b76(_0x532f01);});},'afterUpdate':function(_0x592290,_0x21be7d,_0x51e838){return _0xa715a9[_0xf2a3('0x1e')][_0xf2a3('0x1f')]({'where':{'ChanSpyId':_0x592290['id']}})[_0xf2a3('0x19')](function(){return getChanSpyPromise(_0xa715a9,_0x592290);})[_0xf2a3('0x19')](function(_0x2f1c5d){if(_0x2f1c5d&&_0x2f1c5d['length']){return _0xa715a9['VoiceExtension'][_0xf2a3('0x20')](_0x2f1c5d);}})[_0xf2a3('0x19')](function(){_0x51e838();})[_0xf2a3('0x1a')](function(_0x31dfad){_0x51e838(_0x31dfad);});},'afterDestroy':function(_0x32a72e,_0x2cb6fd,_0x377a3e){return _0xa715a9[_0xf2a3('0x1e')]['destroy']({'where':{'ChanSpyId':_0x32a72e['id']}})['then'](function(){_0x377a3e();})[_0xf2a3('0x1a')](function(_0x5cfcc8){_0x377a3e(_0x5cfcc8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index bea84b4..1d3f412 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 _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1918a8,_0x56f70a){var _0x194237=function(_0x38337c){while(--_0x38337c){_0x1918a8['push'](_0x1918a8['shift']());}};_0x194237(++_0x56f70a);}(_0x9348,0x10d));var _0x8934=function(_0x3f8fa2,_0x2173f7){_0x3f8fa2=_0x3f8fa2-0x0;var _0x4d4574=_0x9348[_0x3f8fa2];return _0x4d4574;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});} \ No newline at end of file +var _0x5b02=['client','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xbed8a2,_0x578ae3){var _0x11d4f2=function(_0x49e846){while(--_0x49e846){_0xbed8a2['push'](_0xbed8a2['shift']());}};_0x11d4f2(++_0x578ae3);}(_0x5b02,0xe9));var _0x25b0=function(_0x38101e,_0x31801b){_0x38101e=_0x38101e-0x0;var _0x166c79=_0x5b02[_0x38101e];return _0x166c79;};'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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\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 diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index dbfea6c..4f68f51 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 _0xdd2a=['show','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xdd2a,0xdf));var _0xadd2=function(_0xccdcc5,_0x24fcf7){_0xccdcc5=_0xccdcc5-0x0;var _0x58a9bb=_0xdd2a[_0xccdcc5];return _0x58a9bb;};'use strict';var multer=require(_0xadd2('0x0'));var util=require(_0xadd2('0x1'));var path=require(_0xadd2('0x2'));var timeout=require(_0xadd2('0x3'));var express=require(_0xadd2('0x4'));var router=express[_0xadd2('0x5')]();var fs_extra=require(_0xadd2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xadd2('0x7'));var controller=require('./voiceContext.controller');router[_0xadd2('0x8')]('/',auth[_0xadd2('0x9')](),controller[_0xadd2('0xa')]);router['get']('/:id',auth[_0xadd2('0x9')](),controller[_0xadd2('0xb')]);router[_0xadd2('0xc')]('/',auth[_0xadd2('0x9')](),controller[_0xadd2('0xd')]);router['put'](_0xadd2('0xe'),auth[_0xadd2('0x9')](),controller[_0xadd2('0xf')]);router[_0xadd2('0x10')](_0xadd2('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xadd2('0x11')]=router; \ No newline at end of file +var _0xee85=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','/:id','isAuthenticated','show','create','delete','destroy'];(function(_0x5a452e,_0x355a90){var _0x2c4c43=function(_0x2d9e3f){while(--_0x2d9e3f){_0x5a452e['push'](_0x5a452e['shift']());}};_0x2c4c43(++_0x355a90);}(_0xee85,0x70));var _0x5ee8=function(_0x1e896c,_0x3f9948){_0x1e896c=_0x1e896c-0x0;var _0xd149d9=_0xee85[_0x1e896c];return _0xd149d9;};'use strict';var multer=require('multer');var util=require(_0x5ee8('0x0'));var path=require(_0x5ee8('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ee8('0x2'));var router=express[_0x5ee8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5ee8('0x4'));var interaction=require(_0x5ee8('0x5'));var config=require('../../config/environment');var controller=require(_0x5ee8('0x6'));router[_0x5ee8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ee8('0x7')](_0x5ee8('0x8'),auth[_0x5ee8('0x9')](),controller[_0x5ee8('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5ee8('0xb')]);router['put'](_0x5ee8('0x8'),auth[_0x5ee8('0x9')](),controller['update']);router[_0x5ee8('0xc')](_0x5ee8('0x8'),auth['isAuthenticated'](),controller[_0x5ee8('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 12826f7..ef86eb2 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 _0xe5f5=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x2db409,_0x2a0d27){var _0x5748bb=function(_0x32d8a6){while(--_0x32d8a6){_0x2db409['push'](_0x2db409['shift']());}};_0x5748bb(++_0x2a0d27);}(_0xe5f5,0xf3));var _0x5e5f=function(_0x3d2f86,_0x47d904){_0x3d2f86=_0x3d2f86-0x0;var _0x23b0c2=_0xe5f5[_0x3d2f86];return _0x23b0c2;};'use strict';var Sequelize=require(_0x5e5f('0x0'));module[_0x5e5f('0x1')]={'name':{'type':Sequelize[_0x5e5f('0x2')],'unique':_0x5e5f('0x3')},'description':{'type':Sequelize[_0x5e5f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5e5f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c02=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x9b9423,_0x5999f5){var _0x50494d=function(_0x361135){while(--_0x361135){_0x9b9423['push'](_0x9b9423['shift']());}};_0x50494d(++_0x5999f5);}(_0x5c02,0x9c));var _0x25c0=function(_0x580eef,_0x5cb11c){_0x580eef=_0x580eef-0x0;var _0x51b339=_0x5c02[_0x580eef];return _0x51b339;};'use strict';var Sequelize=require(_0x25c0('0x0'));module[_0x25c0('0x1')]={'name':{'type':Sequelize[_0x25c0('0x2')],'unique':_0x25c0('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x25c0('0x4')],'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 47de41b..883ebd3 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 _0xc7a8=['/etc/asterisk/extensions_xcally_contexts.conf','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','length','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync'];(function(_0x3bf8cc,_0x13d6f2){var _0x3fe553=function(_0x219def){while(--_0x219def){_0x3bf8cc['push'](_0x3bf8cc['shift']());}};_0x3fe553(++_0x13d6f2);}(_0xc7a8,0x13e));var _0x8c7a=function(_0x2b9828,_0x50c0a6){_0x2b9828=_0x2b9828-0x0;var _0x381948=_0xc7a8[_0x2b9828];return _0x381948;};'use strict';var emlformat=require(_0x8c7a('0x0'));var rimraf=require(_0x8c7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c7a('0x2'));var rp=require(_0x8c7a('0x3'));var moment=require('moment');var BPromise=require(_0x8c7a('0x4'));var Mustache=require('mustache');var util=require(_0x8c7a('0x5'));var path=require('path');var sox=require(_0x8c7a('0x6'));var csv=require(_0x8c7a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c7a('0x8'));var _=require('lodash');var squel=require(_0x8c7a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c7a('0xa'));var toCsv=require(_0x8c7a('0x7'));var querystring=require(_0x8c7a('0xb'));var Papa=require(_0x8c7a('0xc'));var Redis=require(_0x8c7a('0xd'));var authService=require(_0x8c7a('0xe'));var qs=require(_0x8c7a('0xf'));var as=require(_0x8c7a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8c7a('0x11'));var utils=require(_0x8c7a('0x12'));var config=require(_0x8c7a('0x13'));var licenseUtil=require(_0x8c7a('0x14'));var db=require(_0x8c7a('0x15'))['db'];var jayson=require(_0x8c7a('0x16'));var client=jayson[_0x8c7a('0x17')][_0x8c7a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x39194d,_0x4282df,_0x4b6ef3,_0x207407){return new BPromise(function(_0x139c8a,_0x4b3323){var _0x3f3c26=_0x207407||client;return _0x3f3c26[_0x8c7a('0x19')](_0x39194d,_0x4b6ef3)[_0x8c7a('0x1a')](function(_0x47ac53){logger['info'](_0x8c7a('0x1b'),_0x4282df,_0x8c7a('0x1c'));logger[_0x8c7a('0x1d')](_0x8c7a('0x1e'),_0x4282df,_0x8c7a('0x1c'),JSON[_0x8c7a('0x1f')](_0x47ac53));if(_0x47ac53[_0x8c7a('0x20')]){if(_0x47ac53['error'][_0x8c7a('0x21')]===0x1f4){logger[_0x8c7a('0x20')](_0x8c7a('0x1b'),_0x4282df,_0x47ac53['error'][_0x8c7a('0x22')]);return _0x4b3323(_0x47ac53[_0x8c7a('0x20')][_0x8c7a('0x22')]);}logger[_0x8c7a('0x20')](_0x8c7a('0x1b'),_0x4282df,_0x47ac53[_0x8c7a('0x20')][_0x8c7a('0x22')]);return _0x139c8a(_0x47ac53[_0x8c7a('0x20')]['message']);}else{logger[_0x8c7a('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4282df,_0x8c7a('0x1c'));_0x139c8a(_0x47ac53[_0x8c7a('0x24')][_0x8c7a('0x22')]);}})[_0x8c7a('0x25')](function(_0x1d9cd3){logger[_0x8c7a('0x20')](_0x8c7a('0x1b'),_0x4282df,_0x1d9cd3);_0x4b3323(_0x1d9cd3);});});}function respondWithStatusCode(_0x332793,_0x521209){_0x521209=_0x521209||0xcc;return function(_0x2890e3){if(_0x2890e3){return _0x332793[_0x8c7a('0x26')](_0x521209);}return _0x332793[_0x8c7a('0x27')](_0x521209)[_0x8c7a('0x28')]();};}function respondWithResult(_0x143495,_0xba13a6){_0xba13a6=_0xba13a6||0xc8;return function(_0x35929d){if(_0x35929d){return _0x143495[_0x8c7a('0x27')](_0xba13a6)[_0x8c7a('0x29')](_0x35929d);}};}function respondWithFilteredResult(_0x3ad0a3,_0x923d5f){return function(_0x5b8697){if(_0x5b8697){var _0x2d67c6=typeof _0x923d5f[_0x8c7a('0x2a')]===_0x8c7a('0x2b')&&typeof _0x923d5f[_0x8c7a('0x2c')]===_0x8c7a('0x2b');var _0x3f304d=_0x5b8697['count'];var _0x4812c7=_0x2d67c6?0x0:_0x923d5f[_0x8c7a('0x2a')];var _0x4d5ca1=_0x2d67c6?_0x5b8697[_0x8c7a('0x2d')]:_0x923d5f[_0x8c7a('0x2a')]+_0x923d5f[_0x8c7a('0x2c')];var _0x15e11a;if(_0x4d5ca1>=_0x3f304d){_0x4d5ca1=_0x3f304d;_0x15e11a=0xc8;}else{_0x15e11a=0xce;}_0x3ad0a3[_0x8c7a('0x27')](_0x15e11a);return _0x3ad0a3[_0x8c7a('0x2e')](_0x8c7a('0x2f'),_0x4812c7+'-'+_0x4d5ca1+'/'+_0x3f304d)[_0x8c7a('0x29')](_0x5b8697);}return null;};}function patchUpdates(_0x2aa16c){return function(_0x487d48){try{jsonpatch[_0x8c7a('0x30')](_0x487d48,_0x2aa16c,!![]);}catch(_0xda6263){return BPromise['reject'](_0xda6263);}return _0x487d48[_0x8c7a('0x31')]();};}function saveUpdates(_0x13e58a,_0x1f3ee6){return function(_0x237585){if(_0x237585){return _0x237585[_0x8c7a('0x32')](_0x13e58a)['then'](function(_0x2d3554){return _0x2d3554;});}return null;};}function removeEntity(_0x1e5970,_0x1a7d5f){return function(_0x7e7e4d){if(_0x7e7e4d){return _0x7e7e4d[_0x8c7a('0x33')]()['then'](function(){var _0x1d35f9=_0x7e7e4d['get']({'plain':!![]});var _0x26e35f=_0x8c7a('0x34');return db[_0x8c7a('0x35')][_0x8c7a('0x33')]({'where':{'type':_0x26e35f,'resourceId':_0x1d35f9['id']}})[_0x8c7a('0x1a')](function(){return _0x7e7e4d;});})[_0x8c7a('0x1a')](function(){_0x1e5970[_0x8c7a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38af3d,_0x39a5dc){return function(_0x3b43bd){if(!_0x3b43bd){_0x38af3d[_0x8c7a('0x26')](0x194);}return _0x3b43bd;};}function handleError(_0xb56bc3,_0x363d90){_0x363d90=_0x363d90||0x1f4;return function(_0x3aaaf4){logger[_0x8c7a('0x20')](_0x3aaaf4[_0x8c7a('0x36')]);if(_0x3aaaf4[_0x8c7a('0x37')]){delete _0x3aaaf4[_0x8c7a('0x37')];}_0xb56bc3[_0x8c7a('0x27')](_0x363d90)[_0x8c7a('0x38')](_0x3aaaf4);};}exports[_0x8c7a('0x39')]=function(_0x384556,_0x5b9179){var _0x7c3481={},_0x20b766={},_0x4066ed={'count':0x0,'rows':[]};var _0x5e3428=_['map'](db[_0x8c7a('0x3a')][_0x8c7a('0x3b')],function(_0x8d5397){return{'name':_0x8d5397['fieldName'],'type':_0x8d5397[_0x8c7a('0x3c')][_0x8c7a('0x3d')]};});_0x20b766['model']=_[_0x8c7a('0x3e')](_0x5e3428,_0x8c7a('0x37'));_0x20b766[_0x8c7a('0x3f')]=_[_0x8c7a('0x40')](_0x384556['query']);_0x20b766[_0x8c7a('0x41')]=_[_0x8c7a('0x42')](_0x20b766[_0x8c7a('0x43')],_0x20b766[_0x8c7a('0x3f')]);_0x7c3481[_0x8c7a('0x44')]=_[_0x8c7a('0x42')](_0x20b766[_0x8c7a('0x43')],qs[_0x8c7a('0x45')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x45')]));_0x7c3481[_0x8c7a('0x44')]=_0x7c3481[_0x8c7a('0x44')]['length']?_0x7c3481[_0x8c7a('0x44')]:_0x20b766[_0x8c7a('0x43')];if(!_0x384556[_0x8c7a('0x3f')]['hasOwnProperty'](_0x8c7a('0x46'))){_0x7c3481[_0x8c7a('0x2c')]=qs[_0x8c7a('0x2c')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x2c')]);_0x7c3481[_0x8c7a('0x2a')]=qs[_0x8c7a('0x2a')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x2a')]);}_0x7c3481[_0x8c7a('0x47')]=qs[_0x8c7a('0x48')](_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x48')]);_0x7c3481['where']=qs['filters'](_['pick'](_0x384556['query'],_0x20b766[_0x8c7a('0x41')]),_0x5e3428);if(_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x49')]){_0x7c3481[_0x8c7a('0x4a')]=_[_0x8c7a('0x4b')](_0x7c3481[_0x8c7a('0x4a')],{'$or':_['map'](_0x5e3428,function(_0x2d52be){if(_0x2d52be[_0x8c7a('0x3c')]!==_0x8c7a('0x4c')){var _0x155fe2={};_0x155fe2[_0x2d52be[_0x8c7a('0x37')]]={'$like':'%'+_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x49')]+'%'};return _0x155fe2;}})});}_0x7c3481=_['merge']({},_0x7c3481,_0x384556[_0x8c7a('0x4d')]);var _0x1595d1={'where':_0x7c3481[_0x8c7a('0x4a')]};return db['VoiceContext'][_0x8c7a('0x2d')](_0x1595d1)['then'](function(_0x3a1cf8){_0x4066ed[_0x8c7a('0x2d')]=_0x3a1cf8;if(_0x384556[_0x8c7a('0x3f')][_0x8c7a('0x4e')]){_0x7c3481[_0x8c7a('0x4f')]=[{'all':!![]}];}return db[_0x8c7a('0x3a')]['findAll'](_0x7c3481);})['then'](function(_0x1a0811){_0x4066ed['rows']=_0x1a0811;return _0x4066ed;})[_0x8c7a('0x1a')](respondWithFilteredResult(_0x5b9179,_0x7c3481))[_0x8c7a('0x25')](handleError(_0x5b9179,null));};exports[_0x8c7a('0x50')]=function(_0x1324a3,_0x587215){var _0xe0f2f5={'raw':![],'where':{'id':_0x1324a3[_0x8c7a('0x51')]['id']}},_0x360ee6={};_0x360ee6[_0x8c7a('0x43')]=_['keys'](db[_0x8c7a('0x3a')][_0x8c7a('0x3b')]);_0x360ee6[_0x8c7a('0x3f')]=_['keys'](_0x1324a3[_0x8c7a('0x3f')]);_0x360ee6[_0x8c7a('0x41')]=_['intersection'](_0x360ee6[_0x8c7a('0x43')],_0x360ee6[_0x8c7a('0x3f')]);_0xe0f2f5[_0x8c7a('0x44')]=_[_0x8c7a('0x42')](_0x360ee6['model'],qs[_0x8c7a('0x45')](_0x1324a3[_0x8c7a('0x3f')][_0x8c7a('0x45')]));_0xe0f2f5[_0x8c7a('0x44')]=_0xe0f2f5[_0x8c7a('0x44')][_0x8c7a('0x52')]?_0xe0f2f5[_0x8c7a('0x44')]:_0x360ee6['model'];if(_0x1324a3[_0x8c7a('0x3f')]['includeAll']){_0xe0f2f5[_0x8c7a('0x4f')]=[{'all':!![]}];}_0xe0f2f5=_[_0x8c7a('0x4b')]({},_0xe0f2f5,_0x1324a3[_0x8c7a('0x4d')]);return db[_0x8c7a('0x3a')][_0x8c7a('0x53')](_0xe0f2f5)[_0x8c7a('0x1a')](handleEntityNotFound(_0x587215,null))[_0x8c7a('0x1a')](respondWithResult(_0x587215,null))[_0x8c7a('0x25')](handleError(_0x587215,null));};exports[_0x8c7a('0x54')]=function(_0x5a5975,_0x340e21,_0xf76a33){var _0x131fc6;return db[_0x8c7a('0x3a')]['create'](_0x5a5975[_0x8c7a('0x55')],{'raw':!![]})[_0x8c7a('0x1a')](function(_0x31734e){_0x131fc6=_0x31734e;return db['VoiceContext'][_0x8c7a('0x56')]({'raw':!![]});})[_0x8c7a('0x1a')](function(_0xeb5a57){var _0x366e4d=fs[_0x8c7a('0x57')](path[_0x8c7a('0x58')](config[_0x8c7a('0x59')],_0x8c7a('0x5a')),_0x8c7a('0x5b'));var _0x4aa456=ejs[_0x8c7a('0x5c')](_0x366e4d,{'contexts':_0xeb5a57||[]});fs[_0x8c7a('0x5d')](_0x8c7a('0x5e'),_0x4aa456);})['then'](function(){return respondWithRpcPromise('Reload',_0x8c7a('0x54'),{'module':'chan_sip.so'});})[_0x8c7a('0x1a')](function(){var _0x3eabf5=_0x5a5975['user'][_0x8c7a('0x5f')]({'plain':!![]});if(!_0x3eabf5)throw new Error(_0x8c7a('0x60'));if(_0x3eabf5['role']===_0x8c7a('0x61')){var _0x56d163=_0x131fc6[_0x8c7a('0x5f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Contexts','userProfileId':_0x3eabf5[_0x8c7a('0x62')]},'raw':!![]})[_0x8c7a('0x1a')](function(_0x56c180){if(_0x56c180&&_0x56c180[_0x8c7a('0x63')]===0x0){return db[_0x8c7a('0x35')][_0x8c7a('0x54')]({'name':_0x56d163['name'],'resourceId':_0x56d163['id'],'type':_0x56c180[_0x8c7a('0x37')],'sectionId':_0x56c180['id']},{})[_0x8c7a('0x1a')](function(){return _0x131fc6;});}else{return _0x131fc6;}})['catch'](function(_0x1e514e){logger['error'](_0x8c7a('0x64'),_0x1e514e);throw _0x1e514e;});}return _0x131fc6;})[_0x8c7a('0x1a')](respondWithResult(_0x340e21,0xc9))[_0x8c7a('0x25')](handleError(_0x340e21,null));};exports['update']=function(_0x2ae2f7,_0x244a6d,_0x56d33c){var _0x222e2e;return db[_0x8c7a('0x3a')][_0x8c7a('0x53')]({'where':{'id':_0x2ae2f7['params']['id']}})[_0x8c7a('0x1a')](handleEntityNotFound(_0x244a6d,null))[_0x8c7a('0x1a')](saveUpdates(_0x2ae2f7['body'],null))['then'](function(_0x4a1a8d){if(_0x4a1a8d){_0x222e2e=_0x4a1a8d;return db[_0x8c7a('0x3a')][_0x8c7a('0x56')]({'raw':!![]});}})[_0x8c7a('0x1a')](function(_0x35f3f9){var _0xbb22ee=fs[_0x8c7a('0x57')](path[_0x8c7a('0x58')](config[_0x8c7a('0x59')],_0x8c7a('0x5a')),_0x8c7a('0x5b'));var _0xae936a=ejs[_0x8c7a('0x5c')](_0xbb22ee,{'contexts':_0x35f3f9||[]});fs[_0x8c7a('0x5d')](_0x8c7a('0x5e'),_0xae936a);})[_0x8c7a('0x1a')](function(){return respondWithRpcPromise(_0x8c7a('0x65'),'update',{'module':_0x8c7a('0x66')});})[_0x8c7a('0x1a')](function(){return _0x222e2e;})['then'](respondWithResult(_0x244a6d,null))[_0x8c7a('0x25')](handleError(_0x244a6d,null));};exports[_0x8c7a('0x33')]=function(_0x1cde8b,_0x2b7efd,_0x4a2b2a){var _0xed5ad2;return db['VoiceContext']['find']({'where':{'id':_0x1cde8b[_0x8c7a('0x51')]['id']}})[_0x8c7a('0x1a')](handleEntityNotFound(_0x2b7efd,null))[_0x8c7a('0x1a')](removeEntity(_0x2b7efd,null))[_0x8c7a('0x1a')](function(){return db[_0x8c7a('0x3a')]['findAll']({'raw':!![]});})[_0x8c7a('0x1a')](function(_0x54fe95){var _0x1b9c1a=fs[_0x8c7a('0x57')](path['join'](config[_0x8c7a('0x59')],'server/files/templates/context.ejs'),_0x8c7a('0x5b'));var _0x4df33c=ejs[_0x8c7a('0x5c')](_0x1b9c1a,{'contexts':_0x54fe95});fs[_0x8c7a('0x5d')](_0x8c7a('0x5e'),_0x4df33c);return respondWithRpcPromise(_0x8c7a('0x65'),_0x8c7a('0x33'),{'module':_0x8c7a('0x66')});})[_0x8c7a('0x25')](handleError(_0x2b7efd,null));}; \ No newline at end of file +var _0xff71=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','join','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','root','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','request','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','Contexts','UserProfileResource','stack','name','map','VoiceContext','rawAttributes','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xff71,0x19f));var _0x1ff7=function(_0x4d9242,_0x385b6e){_0x4d9242=_0x4d9242-0x0;var _0x59301e=_0xff71[_0x4d9242];return _0x59301e;};'use strict';var emlformat=require(_0x1ff7('0x0'));var rimraf=require(_0x1ff7('0x1'));var zipdir=require(_0x1ff7('0x2'));var jsonpatch=require(_0x1ff7('0x3'));var rp=require(_0x1ff7('0x4'));var moment=require(_0x1ff7('0x5'));var BPromise=require(_0x1ff7('0x6'));var Mustache=require(_0x1ff7('0x7'));var util=require(_0x1ff7('0x8'));var path=require(_0x1ff7('0x9'));var sox=require(_0x1ff7('0xa'));var csv=require(_0x1ff7('0xb'));var ejs=require(_0x1ff7('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1ff7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ff7('0xe'));var toCsv=require(_0x1ff7('0xb'));var querystring=require(_0x1ff7('0xf'));var Papa=require(_0x1ff7('0x10'));var Redis=require('ioredis');var authService=require(_0x1ff7('0x11'));var qs=require(_0x1ff7('0x12'));var as=require(_0x1ff7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1ff7('0x14'));var config=require(_0x1ff7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ff7('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dc7d6,_0x1a9cf2,_0x32b54d,_0x2cbaac){return new BPromise(function(_0x5ba1f1,_0x3258db){var _0x325a72=_0x2cbaac||client;return _0x325a72[_0x1ff7('0x17')](_0x2dc7d6,_0x32b54d)[_0x1ff7('0x18')](function(_0x315df4){logger[_0x1ff7('0x19')](_0x1ff7('0x1a'),_0x1a9cf2,'request\x20sent');logger[_0x1ff7('0x1b')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1a9cf2,_0x1ff7('0x1c'),JSON[_0x1ff7('0x1d')](_0x315df4));if(_0x315df4[_0x1ff7('0x1e')]){if(_0x315df4[_0x1ff7('0x1e')]['code']===0x1f4){logger[_0x1ff7('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x1a9cf2,_0x315df4[_0x1ff7('0x1e')][_0x1ff7('0x1f')]);return _0x3258db(_0x315df4['error'][_0x1ff7('0x1f')]);}logger[_0x1ff7('0x1e')](_0x1ff7('0x1a'),_0x1a9cf2,_0x315df4[_0x1ff7('0x1e')]['message']);return _0x5ba1f1(_0x315df4[_0x1ff7('0x1e')]['message']);}else{logger[_0x1ff7('0x19')](_0x1ff7('0x1a'),_0x1a9cf2,_0x1ff7('0x1c'));_0x5ba1f1(_0x315df4[_0x1ff7('0x20')][_0x1ff7('0x1f')]);}})[_0x1ff7('0x21')](function(_0x334f7b){logger[_0x1ff7('0x1e')](_0x1ff7('0x1a'),_0x1a9cf2,_0x334f7b);_0x3258db(_0x334f7b);});});}function respondWithStatusCode(_0x1f50ce,_0x28dba1){_0x28dba1=_0x28dba1||0xcc;return function(_0x596e39){if(_0x596e39){return _0x1f50ce[_0x1ff7('0x22')](_0x28dba1);}return _0x1f50ce[_0x1ff7('0x23')](_0x28dba1)[_0x1ff7('0x24')]();};}function respondWithResult(_0x3de039,_0x56e5b6){_0x56e5b6=_0x56e5b6||0xc8;return function(_0x383bab){if(_0x383bab){return _0x3de039[_0x1ff7('0x23')](_0x56e5b6)[_0x1ff7('0x25')](_0x383bab);}};}function respondWithFilteredResult(_0x228430,_0x75ddf2){return function(_0x972050){if(_0x972050){var _0x59c97b=typeof _0x75ddf2[_0x1ff7('0x26')]===_0x1ff7('0x27')&&typeof _0x75ddf2[_0x1ff7('0x28')]===_0x1ff7('0x27');var _0x57b5f2=_0x972050[_0x1ff7('0x29')];var _0x55bc6d=_0x59c97b?0x0:_0x75ddf2[_0x1ff7('0x26')];var _0x3345dc=_0x59c97b?_0x972050[_0x1ff7('0x29')]:_0x75ddf2[_0x1ff7('0x26')]+_0x75ddf2[_0x1ff7('0x28')];var _0x46329f;if(_0x3345dc>=_0x57b5f2){_0x3345dc=_0x57b5f2;_0x46329f=0xc8;}else{_0x46329f=0xce;}_0x228430['status'](_0x46329f);return _0x228430['set'](_0x1ff7('0x2a'),_0x55bc6d+'-'+_0x3345dc+'/'+_0x57b5f2)[_0x1ff7('0x25')](_0x972050);}return null;};}function patchUpdates(_0x130f80){return function(_0x1f1312){try{jsonpatch[_0x1ff7('0x2b')](_0x1f1312,_0x130f80,!![]);}catch(_0x2fb449){return BPromise['reject'](_0x2fb449);}return _0x1f1312[_0x1ff7('0x2c')]();};}function saveUpdates(_0x2240dd,_0x460e23){return function(_0x533d88){if(_0x533d88){return _0x533d88[_0x1ff7('0x2d')](_0x2240dd)['then'](function(_0x2e4f2f){return _0x2e4f2f;});}return null;};}function removeEntity(_0x48f306,_0xf79d5a){return function(_0x27c5f9){if(_0x27c5f9){return _0x27c5f9[_0x1ff7('0x2e')]()[_0x1ff7('0x18')](function(){var _0x8d072a=_0x27c5f9['get']({'plain':!![]});var _0x10190d=_0x1ff7('0x2f');return db[_0x1ff7('0x30')][_0x1ff7('0x2e')]({'where':{'type':_0x10190d,'resourceId':_0x8d072a['id']}})[_0x1ff7('0x18')](function(){return _0x27c5f9;});})[_0x1ff7('0x18')](function(){_0x48f306[_0x1ff7('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30febb,_0x507217){return function(_0xc59a74){if(!_0xc59a74){_0x30febb['sendStatus'](0x194);}return _0xc59a74;};}function handleError(_0x2b1091,_0x3b8304){_0x3b8304=_0x3b8304||0x1f4;return function(_0x3583da){logger[_0x1ff7('0x1e')](_0x3583da[_0x1ff7('0x31')]);if(_0x3583da['name']){delete _0x3583da[_0x1ff7('0x32')];}_0x2b1091[_0x1ff7('0x23')](_0x3b8304)['send'](_0x3583da);};}exports['index']=function(_0x20f21d,_0xaad9f7){var _0x1f74a5={},_0xfabc56={},_0x246b76={'count':0x0,'rows':[]};var _0x8b0950=_[_0x1ff7('0x33')](db[_0x1ff7('0x34')][_0x1ff7('0x35')],function(_0x5181c7){return{'name':_0x5181c7['fieldName'],'type':_0x5181c7[_0x1ff7('0x36')]['key']};});_0xfabc56[_0x1ff7('0x37')]=_['map'](_0x8b0950,_0x1ff7('0x32'));_0xfabc56['query']=_[_0x1ff7('0x38')](_0x20f21d[_0x1ff7('0x39')]);_0xfabc56[_0x1ff7('0x3a')]=_[_0x1ff7('0x3b')](_0xfabc56[_0x1ff7('0x37')],_0xfabc56[_0x1ff7('0x39')]);_0x1f74a5[_0x1ff7('0x3c')]=_[_0x1ff7('0x3b')](_0xfabc56[_0x1ff7('0x37')],qs['fields'](_0x20f21d['query']['fields']));_0x1f74a5['attributes']=_0x1f74a5[_0x1ff7('0x3c')][_0x1ff7('0x3d')]?_0x1f74a5[_0x1ff7('0x3c')]:_0xfabc56[_0x1ff7('0x37')];if(!_0x20f21d['query'][_0x1ff7('0x3e')](_0x1ff7('0x3f'))){_0x1f74a5['limit']=qs[_0x1ff7('0x28')](_0x20f21d[_0x1ff7('0x39')][_0x1ff7('0x28')]);_0x1f74a5[_0x1ff7('0x26')]=qs[_0x1ff7('0x26')](_0x20f21d[_0x1ff7('0x39')][_0x1ff7('0x26')]);}_0x1f74a5[_0x1ff7('0x40')]=qs['sort'](_0x20f21d['query'][_0x1ff7('0x41')]);_0x1f74a5[_0x1ff7('0x42')]=qs['filters'](_[_0x1ff7('0x43')](_0x20f21d[_0x1ff7('0x39')],_0xfabc56['filters']),_0x8b0950);if(_0x20f21d['query'][_0x1ff7('0x44')]){_0x1f74a5[_0x1ff7('0x42')]=_[_0x1ff7('0x45')](_0x1f74a5[_0x1ff7('0x42')],{'$or':_['map'](_0x8b0950,function(_0x8b424f){if(_0x8b424f[_0x1ff7('0x36')]!==_0x1ff7('0x46')){var _0x489b6d={};_0x489b6d[_0x8b424f['name']]={'$like':'%'+_0x20f21d[_0x1ff7('0x39')][_0x1ff7('0x44')]+'%'};return _0x489b6d;}})});}_0x1f74a5=_[_0x1ff7('0x45')]({},_0x1f74a5,_0x20f21d[_0x1ff7('0x47')]);var _0xe9fa71={'where':_0x1f74a5['where']};return db['VoiceContext'][_0x1ff7('0x29')](_0xe9fa71)[_0x1ff7('0x18')](function(_0x1a8778){_0x246b76[_0x1ff7('0x29')]=_0x1a8778;if(_0x20f21d[_0x1ff7('0x39')][_0x1ff7('0x48')]){_0x1f74a5[_0x1ff7('0x49')]=[{'all':!![]}];}return db[_0x1ff7('0x34')][_0x1ff7('0x4a')](_0x1f74a5);})[_0x1ff7('0x18')](function(_0x2b134d){_0x246b76[_0x1ff7('0x4b')]=_0x2b134d;return _0x246b76;})['then'](respondWithFilteredResult(_0xaad9f7,_0x1f74a5))[_0x1ff7('0x21')](handleError(_0xaad9f7,null));};exports[_0x1ff7('0x4c')]=function(_0x5524cd,_0xa56805){var _0x3f0ad0={'raw':![],'where':{'id':_0x5524cd[_0x1ff7('0x4d')]['id']}},_0x595394={};_0x595394[_0x1ff7('0x37')]=_[_0x1ff7('0x38')](db[_0x1ff7('0x34')][_0x1ff7('0x35')]);_0x595394['query']=_[_0x1ff7('0x38')](_0x5524cd[_0x1ff7('0x39')]);_0x595394['filters']=_['intersection'](_0x595394[_0x1ff7('0x37')],_0x595394['query']);_0x3f0ad0['attributes']=_[_0x1ff7('0x3b')](_0x595394[_0x1ff7('0x37')],qs['fields'](_0x5524cd[_0x1ff7('0x39')]['fields']));_0x3f0ad0['attributes']=_0x3f0ad0[_0x1ff7('0x3c')][_0x1ff7('0x3d')]?_0x3f0ad0[_0x1ff7('0x3c')]:_0x595394[_0x1ff7('0x37')];if(_0x5524cd[_0x1ff7('0x39')][_0x1ff7('0x48')]){_0x3f0ad0['include']=[{'all':!![]}];}_0x3f0ad0=_[_0x1ff7('0x45')]({},_0x3f0ad0,_0x5524cd['options']);return db['VoiceContext'][_0x1ff7('0x4e')](_0x3f0ad0)[_0x1ff7('0x18')](handleEntityNotFound(_0xa56805,null))[_0x1ff7('0x18')](respondWithResult(_0xa56805,null))[_0x1ff7('0x21')](handleError(_0xa56805,null));};exports['create']=function(_0x5d50d7,_0x580b34,_0x401324){var _0x3056b0;return db[_0x1ff7('0x34')][_0x1ff7('0x4f')](_0x5d50d7[_0x1ff7('0x50')],{'raw':!![]})[_0x1ff7('0x18')](function(_0x5894c4){_0x3056b0=_0x5894c4;return db[_0x1ff7('0x34')][_0x1ff7('0x4a')]({'raw':!![]});})[_0x1ff7('0x18')](function(_0x19eeaa){var _0x4b52ad=fs[_0x1ff7('0x51')](path[_0x1ff7('0x52')](config['root'],'server/files/templates/context.ejs'),_0x1ff7('0x53'));var _0x51ac9d=ejs[_0x1ff7('0x54')](_0x4b52ad,{'contexts':_0x19eeaa||[]});fs[_0x1ff7('0x55')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x51ac9d);})[_0x1ff7('0x18')](function(){return respondWithRpcPromise(_0x1ff7('0x56'),_0x1ff7('0x4f'),{'module':_0x1ff7('0x57')});})[_0x1ff7('0x18')](function(){var _0x4f7ab8=_0x5d50d7[_0x1ff7('0x58')]['get']({'plain':!![]});if(!_0x4f7ab8)throw new Error(_0x1ff7('0x59'));if(_0x4f7ab8[_0x1ff7('0x5a')]===_0x1ff7('0x58')){var _0x4f68da=_0x3056b0[_0x1ff7('0x5b')]({'plain':!![]});return db[_0x1ff7('0x5c')][_0x1ff7('0x4e')]({'where':{'name':_0x1ff7('0x2f'),'userProfileId':_0x4f7ab8['userProfileId']},'raw':!![]})['then'](function(_0x331967){if(_0x331967&&_0x331967[_0x1ff7('0x5d')]===0x0){return db[_0x1ff7('0x30')][_0x1ff7('0x4f')]({'name':_0x4f68da[_0x1ff7('0x32')],'resourceId':_0x4f68da['id'],'type':_0x331967[_0x1ff7('0x32')],'sectionId':_0x331967['id']},{})[_0x1ff7('0x18')](function(){return _0x3056b0;});}else{return _0x3056b0;}})[_0x1ff7('0x21')](function(_0x353c5f){logger[_0x1ff7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353c5f);throw _0x353c5f;});}return _0x3056b0;})['then'](respondWithResult(_0x580b34,0xc9))['catch'](handleError(_0x580b34,null));};exports['update']=function(_0x562d65,_0x3d6eaf,_0x5a012d){var _0x3fa099;return db[_0x1ff7('0x34')][_0x1ff7('0x4e')]({'where':{'id':_0x562d65['params']['id']}})['then'](handleEntityNotFound(_0x3d6eaf,null))[_0x1ff7('0x18')](saveUpdates(_0x562d65[_0x1ff7('0x50')],null))[_0x1ff7('0x18')](function(_0x36fabf){if(_0x36fabf){_0x3fa099=_0x36fabf;return db[_0x1ff7('0x34')]['findAll']({'raw':!![]});}})[_0x1ff7('0x18')](function(_0xbfce40){var _0x5a2f37=fs[_0x1ff7('0x51')](path[_0x1ff7('0x52')](config[_0x1ff7('0x5e')],_0x1ff7('0x5f')),_0x1ff7('0x53'));var _0x2f451a=ejs[_0x1ff7('0x54')](_0x5a2f37,{'contexts':_0xbfce40||[]});fs[_0x1ff7('0x55')](_0x1ff7('0x60'),_0x2f451a);})[_0x1ff7('0x18')](function(){return respondWithRpcPromise(_0x1ff7('0x56'),_0x1ff7('0x2d'),{'module':'chan_sip.so'});})[_0x1ff7('0x18')](function(){return _0x3fa099;})['then'](respondWithResult(_0x3d6eaf,null))['catch'](handleError(_0x3d6eaf,null));};exports['destroy']=function(_0x2a4331,_0x50bb3a,_0x461595){var _0x200d03;return db[_0x1ff7('0x34')]['find']({'where':{'id':_0x2a4331[_0x1ff7('0x4d')]['id']}})[_0x1ff7('0x18')](handleEntityNotFound(_0x50bb3a,null))['then'](removeEntity(_0x50bb3a,null))['then'](function(){return db[_0x1ff7('0x34')][_0x1ff7('0x4a')]({'raw':!![]});})[_0x1ff7('0x18')](function(_0x1f7260){var _0x3308ed=fs[_0x1ff7('0x51')](path['join'](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x4e88c4=ejs[_0x1ff7('0x54')](_0x3308ed,{'contexts':_0x1f7260});fs['writeFileSync'](_0x1ff7('0x60'),_0x4e88c4);return respondWithRpcPromise(_0x1ff7('0x56'),_0x1ff7('0x2e'),{'module':_0x1ff7('0x57')});})['catch'](handleError(_0x50bb3a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 29965be..a38da31 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 _0x4367=['../../config/environment','./voiceContext.attributes','exports','define','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x58d373,_0x440d26){var _0x4f27b2=function(_0x4b6420){while(--_0x4b6420){_0x58d373['push'](_0x58d373['shift']());}};_0x4f27b2(++_0x440d26);}(_0x4367,0x1f3));var _0x7436=function(_0x157559,_0x3e1b99){_0x157559=_0x157559-0x0;var _0x165e17=_0x4367[_0x157559];return _0x165e17;};'use strict';var _=require('lodash');var util=require(_0x7436('0x0'));var logger=require(_0x7436('0x1'))(_0x7436('0x2'));var moment=require(_0x7436('0x3'));var BPromise=require('bluebird');var rp=require(_0x7436('0x4'));var fs=require('fs');var path=require(_0x7436('0x5'));var rimraf=require(_0x7436('0x6'));var config=require(_0x7436('0x7'));var attributes=require(_0x7436('0x8'));module[_0x7436('0x9')]=function(_0xb90e60,_0x5083f5){return _0xb90e60[_0x7436('0xa')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1eb4=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceContext','voice_contexts','util','../../config/logger','api','moment'];(function(_0x36cf8d,_0x235c95){var _0x27e514=function(_0x3515cc){while(--_0x3515cc){_0x36cf8d['push'](_0x36cf8d['shift']());}};_0x27e514(++_0x235c95);}(_0x1eb4,0x158));var _0x41eb=function(_0x4b080a,_0x35b79c){_0x4b080a=_0x4b080a-0x0;var _0x3c95d7=_0x1eb4[_0x4b080a];return _0x3c95d7;};'use strict';var _=require('lodash');var util=require(_0x41eb('0x0'));var logger=require(_0x41eb('0x1'))(_0x41eb('0x2'));var moment=require(_0x41eb('0x3'));var BPromise=require(_0x41eb('0x4'));var rp=require(_0x41eb('0x5'));var fs=require('fs');var path=require(_0x41eb('0x6'));var rimraf=require(_0x41eb('0x7'));var config=require(_0x41eb('0x8'));var attributes=require('./voiceContext.attributes');module[_0x41eb('0x9')]=function(_0x56a695,_0x43c280){return _0x56a695['define'](_0x41eb('0xa'),attributes,{'tableName':_0x41eb('0xb'),'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 b5139fe..dfd1c00 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 _0x6cb4=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','VoiceContext,\x20%s,\x20%s'];(function(_0x51c30c,_0x1b39f4){var _0x3f57bc=function(_0x227874){while(--_0x227874){_0x51c30c['push'](_0x51c30c['shift']());}};_0x3f57bc(++_0x1b39f4);}(_0x6cb4,0xff));var _0x46cb=function(_0x1e0f80,_0x3f3355){_0x1e0f80=_0x1e0f80-0x0;var _0x1e1749=_0x6cb4[_0x1e0f80];return _0x1e1749;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('VoiceContext,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('VoiceContext,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});} \ No newline at end of file +var _0x82df=['message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x23f46c,_0x4f032f){var _0x486357=function(_0x109446){while(--_0x109446){_0x23f46c['push'](_0x23f46c['shift']());}};_0x486357(++_0x4f032f);}(_0x82df,0x164));var _0xf82d=function(_0x3b320e,_0x232e26){_0x3b320e=_0x3b320e-0x0;var _0x25108c=_0x82df[_0x3b320e];return _0x25108c;};'use strict';var _=require(_0xf82d('0x0'));var util=require(_0xf82d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf82d('0x2'));var fs=require('fs');var Redis=require(_0xf82d('0x3'));var db=require(_0xf82d('0x4'))['db'];var utils=require(_0xf82d('0x5'));var logger=require(_0xf82d('0x6'))('rpc');var config=require(_0xf82d('0x7'));var jayson=require(_0xf82d('0x8'));var client=jayson[_0xf82d('0x9')][_0xf82d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4816b2,_0xbe3838,_0x1360c3){return new BPromise(function(_0x3c06ed,_0x53afc5){return client[_0xf82d('0xb')](_0x4816b2,_0x1360c3)[_0xf82d('0xc')](function(_0x19db0d){logger['info'](_0xf82d('0xd'),_0xbe3838,_0xf82d('0xe'));logger[_0xf82d('0xf')](_0xf82d('0x10'),_0xbe3838,'request\x20sent',JSON['stringify'](_0x19db0d));if(_0x19db0d[_0xf82d('0x11')]){if(_0x19db0d[_0xf82d('0x11')]['code']===0x1f4){logger[_0xf82d('0x11')](_0xf82d('0xd'),_0xbe3838,_0x19db0d['error']['message']);return _0x53afc5(_0x19db0d[_0xf82d('0x11')][_0xf82d('0x12')]);}logger['error'](_0xf82d('0xd'),_0xbe3838,_0x19db0d[_0xf82d('0x11')][_0xf82d('0x12')]);return _0x3c06ed(_0x19db0d[_0xf82d('0x11')][_0xf82d('0x12')]);}else{logger[_0xf82d('0x13')](_0xf82d('0xd'),_0xbe3838,_0xf82d('0xe'));_0x3c06ed(_0x19db0d[_0xf82d('0x14')][_0xf82d('0x12')]);}})[_0xf82d('0x15')](function(_0x17d3ea){logger[_0xf82d('0x11')](_0xf82d('0xd'),_0xbe3838,_0x17d3ea);_0x53afc5(_0x17d3ea);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index bbac24b..71ec519 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 _0xd4f2=['/:id','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','delete'];(function(_0x28ef41,_0x53f780){var _0x2da854=function(_0x3798a5){while(--_0x3798a5){_0x28ef41['push'](_0x28ef41['shift']());}};_0x2da854(++_0x53f780);}(_0xd4f2,0x132));var _0x2d4f=function(_0x3e627e,_0x94e430){_0x3e627e=_0x3e627e-0x0;var _0x157c8e=_0xd4f2[_0x3e627e];return _0x157c8e;};'use strict';var multer=require(_0x2d4f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4f('0x1'));var express=require('express');var router=express[_0x2d4f('0x2')]();var fs_extra=require(_0x2d4f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2d4f('0x4'));var config=require(_0x2d4f('0x5'));var controller=require(_0x2d4f('0x6'));router[_0x2d4f('0x7')]('/',auth[_0x2d4f('0x8')](),controller[_0x2d4f('0x9')]);router['get'](_0x2d4f('0xa'),auth[_0x2d4f('0x8')](),controller[_0x2d4f('0xb')]);router['get']('/:id',auth[_0x2d4f('0x8')](),controller[_0x2d4f('0xc')]);router[_0x2d4f('0xd')]('/',auth[_0x2d4f('0x8')](),controller['create']);router[_0x2d4f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2d4f('0xf')]);router[_0x2d4f('0x10')](_0x2d4f('0x11'),auth[_0x2d4f('0x8')](),controller['destroy']);module[_0x2d4f('0x12')]=router; \ No newline at end of file +var _0xe0a0=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4dad60,_0x4f064d){var _0x53176c=function(_0x490afb){while(--_0x490afb){_0x4dad60['push'](_0x4dad60['shift']());}};_0x53176c(++_0x4f064d);}(_0xe0a0,0x13a));var _0x0e0a=function(_0xe2dc70,_0x4db8ec){_0xe2dc70=_0xe2dc70-0x0;var _0x12ef4b=_0xe0a0[_0xe2dc70];return _0x12ef4b;};'use strict';var multer=require(_0x0e0a('0x0'));var util=require(_0x0e0a('0x1'));var path=require('path');var timeout=require(_0x0e0a('0x2'));var express=require(_0x0e0a('0x3'));var router=express[_0x0e0a('0x4')]();var fs_extra=require(_0x0e0a('0x5'));var auth=require(_0x0e0a('0x6'));var interaction=require(_0x0e0a('0x7'));var config=require(_0x0e0a('0x8'));var controller=require('./voiceDialReport.controller');router[_0x0e0a('0x9')]('/',auth[_0x0e0a('0xa')](),controller['index']);router[_0x0e0a('0x9')](_0x0e0a('0xb'),auth[_0x0e0a('0xa')](),controller[_0x0e0a('0xc')]);router[_0x0e0a('0x9')]('/:id',auth[_0x0e0a('0xa')](),controller['show']);router[_0x0e0a('0xd')]('/',auth[_0x0e0a('0xa')](),controller[_0x0e0a('0xe')]);router[_0x0e0a('0xf')](_0x0e0a('0x10'),auth['isAuthenticated'](),controller[_0x0e0a('0x11')]);router[_0x0e0a('0x12')](_0x0e0a('0x10'),auth['isAuthenticated'](),controller[_0x0e0a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ea55d3c..d0502f1 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 _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4b05c8,_0x498886){var _0x4363b0=function(_0x2419bb){while(--_0x2419bb){_0x4b05c8['push'](_0x4b05c8['shift']());}};_0x4363b0(++_0x498886);}(_0x34e8,0x12c));var _0x834e=function(_0x44629c,_0x237a77){_0x44629c=_0x44629c-0x0;var _0xa1befb=_0x34e8[_0x44629c];return _0xa1befb;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file +var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x152364,_0x4e1997){var _0x585fdd=function(_0x2ff8fd){while(--_0x2ff8fd){_0x152364['push'](_0x152364['shift']());}};_0x585fdd(++_0x4e1997);}(_0x81bd,0x7c));var _0xd81b=function(_0x4bfab7,_0x1f92fc){_0x4bfab7=_0x4bfab7-0x0;var _0x232fd7=_0x81bd[_0x4bfab7];return _0x232fd7;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8b0c0fd..2254878 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 _0xdaf7=['pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','VoiceDialReport','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x6be187,_0x5b2394){var _0x18a47d=function(_0x4a4b1e){while(--_0x4a4b1e){_0x6be187['push'](_0x6be187['shift']());}};_0x18a47d(++_0x5b2394);}(_0xdaf7,0x135));var _0x7daf=function(_0x197e1b,_0x4a58b6){_0x197e1b=_0x197e1b-0x0;var _0x422afe=_0xdaf7[_0x197e1b];return _0x422afe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7daf('0x0'));var zipdir=require(_0x7daf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7daf('0x2'));var moment=require(_0x7daf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7daf('0x4'));var path=require('path');var sox=require(_0x7daf('0x5'));var csv=require(_0x7daf('0x6'));var ejs=require(_0x7daf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7daf('0x8'));var squel=require(_0x7daf('0x9'));var crypto=require('crypto');var jsforce=require(_0x7daf('0xa'));var deskjs=require(_0x7daf('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7daf('0xc'));var Papa=require(_0x7daf('0xd'));var Redis=require(_0x7daf('0xe'));var authService=require(_0x7daf('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7daf('0x10'));var hardwareService=require(_0x7daf('0x11'));var logger=require(_0x7daf('0x12'))('api');var utils=require(_0x7daf('0x13'));var config=require(_0x7daf('0x14'));var licenseUtil=require(_0x7daf('0x15'));var db=require(_0x7daf('0x16'))['db'];function respondWithStatusCode(_0x345bbd,_0x34ca0b){_0x34ca0b=_0x34ca0b||0xcc;return function(_0x113553){if(_0x113553){return _0x345bbd[_0x7daf('0x17')](_0x34ca0b);}return _0x345bbd[_0x7daf('0x18')](_0x34ca0b)[_0x7daf('0x19')]();};}function respondWithResult(_0x2b420a,_0x3ad427){_0x3ad427=_0x3ad427||0xc8;return function(_0x42e855){if(_0x42e855){return _0x2b420a[_0x7daf('0x18')](_0x3ad427)[_0x7daf('0x1a')](_0x42e855);}};}function respondWithFilteredResult(_0x9ceb72,_0x2e44b9){return function(_0x3c0018){if(_0x3c0018){var _0x38f56e=typeof _0x2e44b9[_0x7daf('0x1b')]===_0x7daf('0x1c')&&typeof _0x2e44b9[_0x7daf('0x1d')]===_0x7daf('0x1c');var _0x37b334=_0x3c0018[_0x7daf('0x1e')];var _0x36508f=_0x38f56e?0x0:_0x2e44b9[_0x7daf('0x1b')];var _0x2425b0=_0x38f56e?_0x3c0018['count']:_0x2e44b9['offset']+_0x2e44b9[_0x7daf('0x1d')];var _0x53b563;if(_0x2425b0>=_0x37b334){_0x2425b0=_0x37b334;_0x53b563=0xc8;}else{_0x53b563=0xce;}_0x9ceb72[_0x7daf('0x18')](_0x53b563);return _0x9ceb72['set'](_0x7daf('0x1f'),_0x36508f+'-'+_0x2425b0+'/'+_0x37b334)['json'](_0x3c0018);}return null;};}function patchUpdates(_0x3a5f93){return function(_0x257a03){try{jsonpatch[_0x7daf('0x20')](_0x257a03,_0x3a5f93,!![]);}catch(_0x3866b5){return BPromise[_0x7daf('0x21')](_0x3866b5);}return _0x257a03[_0x7daf('0x22')]();};}function saveUpdates(_0x4a021c,_0x4be5ba){return function(_0x351785){if(_0x351785){return _0x351785['update'](_0x4a021c)[_0x7daf('0x23')](function(_0x36f8e1){return _0x36f8e1;});}return null;};}function removeEntity(_0x28a975,_0x37340e){return function(_0xa84136){if(_0xa84136){return _0xa84136[_0x7daf('0x24')]()[_0x7daf('0x23')](function(){_0x28a975[_0x7daf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40a8fc,_0x34cfdf){return function(_0x472314){if(!_0x472314){_0x40a8fc[_0x7daf('0x17')](0x194);}return _0x472314;};}function handleError(_0x34f5b1,_0x565de1){_0x565de1=_0x565de1||0x1f4;return function(_0x10c43f){logger[_0x7daf('0x25')](_0x10c43f['stack']);if(_0x10c43f['name']){delete _0x10c43f[_0x7daf('0x26')];}_0x34f5b1[_0x7daf('0x18')](_0x565de1)[_0x7daf('0x27')](_0x10c43f);};}exports['index']=function(_0x26483c,_0x132e4e){var _0x32628f={},_0xd0e4e5={},_0x3cd1ef={'count':0x0,'rows':[]};var _0x1ee97d=_['map'](db[_0x7daf('0x28')]['rawAttributes'],function(_0x27f6ca){return{'name':_0x27f6ca[_0x7daf('0x29')],'type':_0x27f6ca[_0x7daf('0x2a')][_0x7daf('0x2b')]};});_0xd0e4e5[_0x7daf('0x2c')]=_[_0x7daf('0x2d')](_0x1ee97d,_0x7daf('0x26'));_0xd0e4e5[_0x7daf('0x2e')]=_['keys'](_0x26483c[_0x7daf('0x2e')]);_0xd0e4e5[_0x7daf('0x2f')]=_['intersection'](_0xd0e4e5[_0x7daf('0x2c')],_0xd0e4e5[_0x7daf('0x2e')]);_0x32628f[_0x7daf('0x30')]=_[_0x7daf('0x31')](_0xd0e4e5[_0x7daf('0x2c')],qs[_0x7daf('0x32')](_0x26483c[_0x7daf('0x2e')][_0x7daf('0x32')]));_0x32628f['attributes']=_0x32628f[_0x7daf('0x30')][_0x7daf('0x33')]?_0x32628f[_0x7daf('0x30')]:_0xd0e4e5[_0x7daf('0x2c')];if(!_0x26483c[_0x7daf('0x2e')][_0x7daf('0x34')](_0x7daf('0x35'))){_0x32628f['limit']=qs['limit'](_0x26483c[_0x7daf('0x2e')][_0x7daf('0x1d')]);_0x32628f[_0x7daf('0x1b')]=qs[_0x7daf('0x1b')](_0x26483c[_0x7daf('0x2e')][_0x7daf('0x1b')]);}_0x32628f[_0x7daf('0x36')]=qs['sort'](_0x26483c[_0x7daf('0x2e')]['sort']);_0x32628f[_0x7daf('0x37')]=qs[_0x7daf('0x2f')](_[_0x7daf('0x38')](_0x26483c[_0x7daf('0x2e')],_0xd0e4e5[_0x7daf('0x2f')]),_0x1ee97d);if(_0x26483c[_0x7daf('0x2e')][_0x7daf('0x39')]){_0x32628f['where']=_['merge'](_0x32628f[_0x7daf('0x37')],{'$or':_[_0x7daf('0x2d')](_0x1ee97d,function(_0x404c7f){if(_0x404c7f['type']!==_0x7daf('0x3a')){var _0x2474a3={};_0x2474a3[_0x404c7f['name']]={'$like':'%'+_0x26483c[_0x7daf('0x2e')][_0x7daf('0x39')]+'%'};return _0x2474a3;}})});}_0x32628f=_[_0x7daf('0x3b')]({},_0x32628f,_0x26483c[_0x7daf('0x3c')]);var _0x2abdb4={'where':_0x32628f['where']};return db[_0x7daf('0x28')][_0x7daf('0x1e')](_0x2abdb4)[_0x7daf('0x23')](function(_0x5b5758){_0x3cd1ef[_0x7daf('0x1e')]=_0x5b5758;if(_0x26483c['query']['includeAll']){_0x32628f['include']=[{'all':!![]}];}return db[_0x7daf('0x28')][_0x7daf('0x3d')](_0x32628f);})[_0x7daf('0x23')](function(_0x4985a2){_0x3cd1ef[_0x7daf('0x3e')]=_0x4985a2;return _0x3cd1ef;})[_0x7daf('0x23')](respondWithFilteredResult(_0x132e4e,_0x32628f))[_0x7daf('0x3f')](handleError(_0x132e4e,null));};exports[_0x7daf('0x40')]=function(_0x4ecff,_0x426ec8){var _0x4ece6d={'raw':!![],'where':{'id':_0x4ecff[_0x7daf('0x41')]['id']}},_0xda102f={};_0xda102f[_0x7daf('0x2c')]=_[_0x7daf('0x42')](db['VoiceDialReport']['rawAttributes']);_0xda102f['query']=_[_0x7daf('0x42')](_0x4ecff[_0x7daf('0x2e')]);_0xda102f[_0x7daf('0x2f')]=_[_0x7daf('0x31')](_0xda102f[_0x7daf('0x2c')],_0xda102f['query']);_0x4ece6d[_0x7daf('0x30')]=_[_0x7daf('0x31')](_0xda102f['model'],qs['fields'](_0x4ecff[_0x7daf('0x2e')][_0x7daf('0x32')]));_0x4ece6d['attributes']=_0x4ece6d['attributes'][_0x7daf('0x33')]?_0x4ece6d[_0x7daf('0x30')]:_0xda102f[_0x7daf('0x2c')];if(_0x4ecff[_0x7daf('0x2e')][_0x7daf('0x43')]){_0x4ece6d[_0x7daf('0x44')]=[{'all':!![]}];}_0x4ece6d=_[_0x7daf('0x3b')]({},_0x4ece6d,_0x4ecff['options']);return db[_0x7daf('0x28')][_0x7daf('0x45')](_0x4ece6d)[_0x7daf('0x23')](handleEntityNotFound(_0x426ec8,null))[_0x7daf('0x23')](respondWithResult(_0x426ec8,null))['catch'](handleError(_0x426ec8,null));};exports[_0x7daf('0x46')]=function(_0xbd2ec0,_0x42394f){return db[_0x7daf('0x28')][_0x7daf('0x46')](_0xbd2ec0[_0x7daf('0x47')],{})[_0x7daf('0x23')](respondWithResult(_0x42394f,0xc9))[_0x7daf('0x3f')](handleError(_0x42394f,null));};exports['update']=function(_0x3dd376,_0x1d7f34){if(_0x3dd376['body']['id']){delete _0x3dd376[_0x7daf('0x47')]['id'];}return db[_0x7daf('0x28')][_0x7daf('0x45')]({'where':{'id':_0x3dd376[_0x7daf('0x41')]['id']}})[_0x7daf('0x23')](handleEntityNotFound(_0x1d7f34,null))[_0x7daf('0x23')](saveUpdates(_0x3dd376[_0x7daf('0x47')],null))['then'](respondWithResult(_0x1d7f34,null))[_0x7daf('0x3f')](handleError(_0x1d7f34,null));};exports[_0x7daf('0x24')]=function(_0x4b8090,_0x35d38c){return db[_0x7daf('0x28')][_0x7daf('0x45')]({'where':{'id':_0x4b8090['params']['id']}})[_0x7daf('0x23')](handleEntityNotFound(_0x35d38c,null))['then'](removeEntity(_0x35d38c,null))['catch'](handleError(_0x35d38c,null));};exports[_0x7daf('0x48')]=function(_0x2d5be1,_0x15368d){return db[_0x7daf('0x28')]['describe']()[_0x7daf('0x23')](respondWithResult(_0x15368d,null))[_0x7daf('0x3f')](handleError(_0x15368d,null));}; \ No newline at end of file +var _0x04f3=['end','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','VoiceDialReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x32d0f2,_0x3e12a3){var _0x571ca6=function(_0x56cefb){while(--_0x56cefb){_0x32d0f2['push'](_0x32d0f2['shift']());}};_0x571ca6(++_0x3e12a3);}(_0x04f3,0x79));var _0x304f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x04f3[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x304f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x304f('0x1'));var jsonpatch=require(_0x304f('0x2'));var rp=require('request-promise');var moment=require(_0x304f('0x3'));var BPromise=require(_0x304f('0x4'));var Mustache=require(_0x304f('0x5'));var util=require(_0x304f('0x6'));var path=require('path');var sox=require(_0x304f('0x7'));var csv=require(_0x304f('0x8'));var ejs=require(_0x304f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x304f('0xa'));var squel=require(_0x304f('0xb'));var crypto=require(_0x304f('0xc'));var jsforce=require(_0x304f('0xd'));var deskjs=require(_0x304f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x304f('0xf'));var Papa=require('papaparse');var Redis=require(_0x304f('0x10'));var authService=require(_0x304f('0x11'));var qs=require(_0x304f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x304f('0x13'));var logger=require(_0x304f('0x14'))(_0x304f('0x15'));var utils=require(_0x304f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x304f('0x17'));var db=require(_0x304f('0x18'))['db'];function respondWithStatusCode(_0x30b3f8,_0x52b8ef){_0x52b8ef=_0x52b8ef||0xcc;return function(_0x4f02d7){if(_0x4f02d7){return _0x30b3f8[_0x304f('0x19')](_0x52b8ef);}return _0x30b3f8[_0x304f('0x1a')](_0x52b8ef)[_0x304f('0x1b')]();};}function respondWithResult(_0xeb0910,_0x416ec3){_0x416ec3=_0x416ec3||0xc8;return function(_0x5738d0){if(_0x5738d0){return _0xeb0910['status'](_0x416ec3)['json'](_0x5738d0);}};}function respondWithFilteredResult(_0x188c33,_0x35b6c9){return function(_0x243559){if(_0x243559){var _0x9314b7=typeof _0x35b6c9['offset']==='undefined'&&typeof _0x35b6c9[_0x304f('0x1c')]===_0x304f('0x1d');var _0x42ed8f=_0x243559[_0x304f('0x1e')];var _0x5739e1=_0x9314b7?0x0:_0x35b6c9[_0x304f('0x1f')];var _0x289e3c=_0x9314b7?_0x243559[_0x304f('0x1e')]:_0x35b6c9[_0x304f('0x1f')]+_0x35b6c9[_0x304f('0x1c')];var _0x3791d7;if(_0x289e3c>=_0x42ed8f){_0x289e3c=_0x42ed8f;_0x3791d7=0xc8;}else{_0x3791d7=0xce;}_0x188c33[_0x304f('0x1a')](_0x3791d7);return _0x188c33[_0x304f('0x20')](_0x304f('0x21'),_0x5739e1+'-'+_0x289e3c+'/'+_0x42ed8f)['json'](_0x243559);}return null;};}function patchUpdates(_0x13252c){return function(_0x23572a){try{jsonpatch['apply'](_0x23572a,_0x13252c,!![]);}catch(_0x45f89b){return BPromise[_0x304f('0x22')](_0x45f89b);}return _0x23572a[_0x304f('0x23')]();};}function saveUpdates(_0x17d9c5,_0x23e6b0){return function(_0x870c9c){if(_0x870c9c){return _0x870c9c[_0x304f('0x24')](_0x17d9c5)['then'](function(_0x2f4257){return _0x2f4257;});}return null;};}function removeEntity(_0x30730f,_0x38175d){return function(_0x31ef61){if(_0x31ef61){return _0x31ef61['destroy']()[_0x304f('0x25')](function(){_0x30730f[_0x304f('0x1a')](0xcc)[_0x304f('0x1b')]();});}};}function handleEntityNotFound(_0x517245,_0x27a894){return function(_0xe1f0){if(!_0xe1f0){_0x517245[_0x304f('0x19')](0x194);}return _0xe1f0;};}function handleError(_0x274ef5,_0x24428f){_0x24428f=_0x24428f||0x1f4;return function(_0x40b9a5){logger['error'](_0x40b9a5[_0x304f('0x26')]);if(_0x40b9a5[_0x304f('0x27')]){delete _0x40b9a5[_0x304f('0x27')];}_0x274ef5[_0x304f('0x1a')](_0x24428f)['send'](_0x40b9a5);};}exports[_0x304f('0x28')]=function(_0xdd290e,_0x5768fc){var _0x19a244={},_0xd007c2={},_0x7565c7={'count':0x0,'rows':[]};var _0x3d4ce4=_[_0x304f('0x29')](db['VoiceDialReport'][_0x304f('0x2a')],function(_0x10db94){return{'name':_0x10db94[_0x304f('0x2b')],'type':_0x10db94[_0x304f('0x2c')][_0x304f('0x2d')]};});_0xd007c2[_0x304f('0x2e')]=_[_0x304f('0x29')](_0x3d4ce4,'name');_0xd007c2['query']=_[_0x304f('0x2f')](_0xdd290e[_0x304f('0x30')]);_0xd007c2[_0x304f('0x31')]=_[_0x304f('0x32')](_0xd007c2[_0x304f('0x2e')],_0xd007c2[_0x304f('0x30')]);_0x19a244[_0x304f('0x33')]=_['intersection'](_0xd007c2[_0x304f('0x2e')],qs[_0x304f('0x34')](_0xdd290e[_0x304f('0x30')][_0x304f('0x34')]));_0x19a244[_0x304f('0x33')]=_0x19a244[_0x304f('0x33')][_0x304f('0x35')]?_0x19a244[_0x304f('0x33')]:_0xd007c2[_0x304f('0x2e')];if(!_0xdd290e[_0x304f('0x30')][_0x304f('0x36')](_0x304f('0x37'))){_0x19a244[_0x304f('0x1c')]=qs[_0x304f('0x1c')](_0xdd290e['query'][_0x304f('0x1c')]);_0x19a244[_0x304f('0x1f')]=qs['offset'](_0xdd290e[_0x304f('0x30')]['offset']);}_0x19a244['order']=qs['sort'](_0xdd290e[_0x304f('0x30')][_0x304f('0x38')]);_0x19a244[_0x304f('0x39')]=qs[_0x304f('0x31')](_[_0x304f('0x3a')](_0xdd290e[_0x304f('0x30')],_0xd007c2[_0x304f('0x31')]),_0x3d4ce4);if(_0xdd290e[_0x304f('0x30')]['filter']){_0x19a244[_0x304f('0x39')]=_['merge'](_0x19a244[_0x304f('0x39')],{'$or':_[_0x304f('0x29')](_0x3d4ce4,function(_0x3cb746){if(_0x3cb746[_0x304f('0x2c')]!==_0x304f('0x3b')){var _0xf40096={};_0xf40096[_0x3cb746[_0x304f('0x27')]]={'$like':'%'+_0xdd290e[_0x304f('0x30')][_0x304f('0x3c')]+'%'};return _0xf40096;}})});}_0x19a244=_['merge']({},_0x19a244,_0xdd290e[_0x304f('0x3d')]);var _0x394c1a={'where':_0x19a244[_0x304f('0x39')]};return db[_0x304f('0x3e')][_0x304f('0x1e')](_0x394c1a)[_0x304f('0x25')](function(_0x5e446a){_0x7565c7[_0x304f('0x1e')]=_0x5e446a;if(_0xdd290e['query'][_0x304f('0x3f')]){_0x19a244['include']=[{'all':!![]}];}return db[_0x304f('0x3e')][_0x304f('0x40')](_0x19a244);})[_0x304f('0x25')](function(_0x535ce4){_0x7565c7[_0x304f('0x41')]=_0x535ce4;return _0x7565c7;})[_0x304f('0x25')](respondWithFilteredResult(_0x5768fc,_0x19a244))[_0x304f('0x42')](handleError(_0x5768fc,null));};exports[_0x304f('0x43')]=function(_0x1646a7,_0x4a14f1){var _0x544521={'raw':!![],'where':{'id':_0x1646a7[_0x304f('0x44')]['id']}},_0x527f9a={};_0x527f9a[_0x304f('0x2e')]=_[_0x304f('0x2f')](db[_0x304f('0x3e')]['rawAttributes']);_0x527f9a[_0x304f('0x30')]=_[_0x304f('0x2f')](_0x1646a7[_0x304f('0x30')]);_0x527f9a[_0x304f('0x31')]=_[_0x304f('0x32')](_0x527f9a[_0x304f('0x2e')],_0x527f9a[_0x304f('0x30')]);_0x544521[_0x304f('0x33')]=_[_0x304f('0x32')](_0x527f9a[_0x304f('0x2e')],qs['fields'](_0x1646a7[_0x304f('0x30')][_0x304f('0x34')]));_0x544521[_0x304f('0x33')]=_0x544521[_0x304f('0x33')][_0x304f('0x35')]?_0x544521[_0x304f('0x33')]:_0x527f9a[_0x304f('0x2e')];if(_0x1646a7[_0x304f('0x30')][_0x304f('0x3f')]){_0x544521[_0x304f('0x45')]=[{'all':!![]}];}_0x544521=_['merge']({},_0x544521,_0x1646a7[_0x304f('0x3d')]);return db[_0x304f('0x3e')][_0x304f('0x46')](_0x544521)['then'](handleEntityNotFound(_0x4a14f1,null))[_0x304f('0x25')](respondWithResult(_0x4a14f1,null))[_0x304f('0x42')](handleError(_0x4a14f1,null));};exports['create']=function(_0x418bd7,_0x2d98eb){return db[_0x304f('0x3e')][_0x304f('0x47')](_0x418bd7['body'],{})['then'](respondWithResult(_0x2d98eb,0xc9))[_0x304f('0x42')](handleError(_0x2d98eb,null));};exports[_0x304f('0x24')]=function(_0x5a19fb,_0x549ebd){if(_0x5a19fb['body']['id']){delete _0x5a19fb[_0x304f('0x48')]['id'];}return db[_0x304f('0x3e')][_0x304f('0x46')]({'where':{'id':_0x5a19fb[_0x304f('0x44')]['id']}})[_0x304f('0x25')](handleEntityNotFound(_0x549ebd,null))[_0x304f('0x25')](saveUpdates(_0x5a19fb[_0x304f('0x48')],null))[_0x304f('0x25')](respondWithResult(_0x549ebd,null))['catch'](handleError(_0x549ebd,null));};exports['destroy']=function(_0x2abfb3,_0x4827e8){return db[_0x304f('0x3e')][_0x304f('0x46')]({'where':{'id':_0x2abfb3[_0x304f('0x44')]['id']}})[_0x304f('0x25')](handleEntityNotFound(_0x4827e8,null))[_0x304f('0x25')](removeEntity(_0x4827e8,null))[_0x304f('0x42')](handleError(_0x4827e8,null));};exports[_0x304f('0x49')]=function(_0x268965,_0x36a323){return db[_0x304f('0x3e')]['describe']()['then'](respondWithResult(_0x36a323,null))[_0x304f('0x42')](handleError(_0x36a323,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1e6a56c..0332d71 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 _0x8075=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport','uniqueid','lodash','util'];(function(_0xd6476f,_0x1c0cab){var _0x3db90b=function(_0x28b4ba){while(--_0x28b4ba){_0xd6476f['push'](_0xd6476f['shift']());}};_0x3db90b(++_0x1c0cab);}(_0x8075,0x191));var _0x5807=function(_0x4707f9,_0xe64a59){_0x4707f9=_0x4707f9-0x0;var _0x906324=_0x8075[_0x4707f9];return _0x906324;};'use strict';var _=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var logger=require('../../config/logger')(_0x5807('0x2'));var moment=require(_0x5807('0x3'));var BPromise=require(_0x5807('0x4'));var rp=require(_0x5807('0x5'));var fs=require('fs');var path=require(_0x5807('0x6'));var rimraf=require(_0x5807('0x7'));var config=require(_0x5807('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x5807('0x9')]=function(_0x4e22e5,_0x5ad700){return _0x4e22e5[_0x5807('0xa')](_0x5807('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x5807('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb94=['moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','util','../../config/logger'];(function(_0x37e31b,_0x415eb2){var _0x5e6dd5=function(_0x47310c){while(--_0x47310c){_0x37e31b['push'](_0x37e31b['shift']());}};_0x5e6dd5(++_0x415eb2);}(_0xdb94,0xe5));var _0x4db9=function(_0x1168f5,_0x528704){_0x1168f5=_0x1168f5-0x0;var _0x1157c6=_0xdb94[_0x1168f5];return _0x1157c6;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var logger=require(_0x4db9('0x1'))('api');var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var fs=require('fs');var path=require(_0x4db9('0x5'));var rimraf=require(_0x4db9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x1d21a8,_0xc76bc1){return _0x1d21a8[_0x4db9('0x8')](_0x4db9('0x9'),attributes,{'tableName':_0x4db9('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6e66805..2ab3811 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 _0x7658=['attributes','limit','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','stringify','UpdateVoiceDialReport','raw','where'];(function(_0x434ca4,_0x2127c8){var _0x20a5de=function(_0x105e60){while(--_0x105e60){_0x434ca4['push'](_0x434ca4['shift']());}};_0x20a5de(++_0x2127c8);}(_0x7658,0x16a));var _0x8765=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7658[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x8765('0x0'));var moment=require(_0x8765('0x1'));var BPromise=require(_0x8765('0x2'));var rs=require(_0x8765('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8765('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8765('0x5'));var client=jayson[_0x8765('0x6')][_0x8765('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f48c7,_0x6c198e,_0x4bcad7){return new BPromise(function(_0x5291f5,_0x451d2d){return client[_0x8765('0x8')](_0x5f48c7,_0x4bcad7)[_0x8765('0x9')](function(_0x30abf5){logger[_0x8765('0xa')](_0x8765('0xb'),_0x6c198e,_0x8765('0xc'));logger[_0x8765('0xd')](_0x8765('0xe'),_0x6c198e,_0x8765('0xc'),JSON['stringify'](_0x30abf5));if(_0x30abf5[_0x8765('0xf')]){if(_0x30abf5[_0x8765('0xf')][_0x8765('0x10')]===0x1f4){logger[_0x8765('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x6c198e,_0x30abf5['error'][_0x8765('0x11')]);return _0x451d2d(_0x30abf5[_0x8765('0xf')][_0x8765('0x11')]);}logger['error'](_0x8765('0xb'),_0x6c198e,_0x30abf5[_0x8765('0xf')][_0x8765('0x11')]);return _0x5291f5(_0x30abf5[_0x8765('0xf')][_0x8765('0x11')]);}else{logger[_0x8765('0xa')](_0x8765('0xb'),_0x6c198e,'request\x20sent');_0x5291f5(_0x30abf5[_0x8765('0x12')][_0x8765('0x11')]);}})[_0x8765('0x13')](function(_0x558794){logger['error'](_0x8765('0xb'),_0x6c198e,_0x558794);_0x451d2d(_0x558794);});});}exports[_0x8765('0x14')]=function(_0x1ee72a){var _0x18f1da=this;return new Promise(function(_0x3e5b71,_0x3aefed){return db[_0x8765('0x15')]['create'](_0x1ee72a[_0x8765('0x16')],{'raw':_0x1ee72a['options']?_0x1ee72a[_0x8765('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x58928e){logger[_0x8765('0xa')](_0x8765('0x14'),_0x1ee72a);logger[_0x8765('0xd')]('CreateVoiceDialReport',_0x1ee72a,JSON[_0x8765('0x18')](_0x58928e));_0x3e5b71(_0x58928e);})[_0x8765('0x13')](function(_0x54e9bf){logger[_0x8765('0xf')](_0x8765('0x14'),_0x54e9bf[_0x8765('0x11')],_0x1ee72a);_0x3aefed(_0x18f1da['error'](0x1f4,_0x54e9bf['message']));});});};exports[_0x8765('0x19')]=function(_0x2dca00){var _0x924fd4=this;return new Promise(function(_0xb81539,_0x54cc65){return db[_0x8765('0x15')]['update'](_0x2dca00[_0x8765('0x16')],{'raw':_0x2dca00[_0x8765('0x17')]?_0x2dca00[_0x8765('0x17')][_0x8765('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dca00[_0x8765('0x17')]?_0x2dca00[_0x8765('0x17')][_0x8765('0x1b')]||null:null,'attributes':_0x2dca00[_0x8765('0x17')]?_0x2dca00[_0x8765('0x17')][_0x8765('0x1c')]||null:null,'limit':_0x2dca00['options']?_0x2dca00[_0x8765('0x17')][_0x8765('0x1d')]||null:null})['then'](function(_0x4c8fbe){logger[_0x8765('0xa')](_0x8765('0x19'),_0x2dca00);logger[_0x8765('0xd')](_0x8765('0x19'),_0x2dca00,JSON['stringify'](_0x4c8fbe));_0xb81539(_0x4c8fbe);})[_0x8765('0x13')](function(_0x262200){logger[_0x8765('0xf')](_0x8765('0x19'),_0x262200[_0x8765('0x11')],_0x2dca00);_0x54cc65(_0x924fd4[_0x8765('0xf')](0x1f4,_0x262200[_0x8765('0x11')]));});});}; \ No newline at end of file +var _0xd40e=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','then','UpdateVoiceDialReport','update','where','attributes','moment'];(function(_0x2d3037,_0x33a244){var _0x538b92=function(_0x594119){while(--_0x594119){_0x2d3037['push'](_0x2d3037['shift']());}};_0x538b92(++_0x33a244);}(_0xd40e,0x1bf));var _0xed40=function(_0x218756,_0x419c39){_0x218756=_0x218756-0x0;var _0x1b90ec=_0xd40e[_0x218756];return _0x1b90ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed40('0x0'));var BPromise=require('bluebird');var rs=require(_0xed40('0x1'));var fs=require('fs');var Redis=require(_0xed40('0x2'));var db=require(_0xed40('0x3'))['db'];var utils=require(_0xed40('0x4'));var logger=require('../../config/logger')(_0xed40('0x5'));var config=require(_0xed40('0x6'));var jayson=require(_0xed40('0x7'));var client=jayson[_0xed40('0x8')][_0xed40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39cb2f,_0x2b8cfe,_0x2e3410){return new BPromise(function(_0x307cf2,_0x98c807){return client[_0xed40('0xa')](_0x39cb2f,_0x2e3410)['then'](function(_0x4e3ded){logger[_0xed40('0xb')](_0xed40('0xc'),_0x2b8cfe,_0xed40('0xd'));logger[_0xed40('0xe')](_0xed40('0xf'),_0x2b8cfe,_0xed40('0xd'),JSON[_0xed40('0x10')](_0x4e3ded));if(_0x4e3ded[_0xed40('0x11')]){if(_0x4e3ded[_0xed40('0x11')][_0xed40('0x12')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2b8cfe,_0x4e3ded[_0xed40('0x11')][_0xed40('0x13')]);return _0x98c807(_0x4e3ded[_0xed40('0x11')][_0xed40('0x13')]);}logger[_0xed40('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x2b8cfe,_0x4e3ded[_0xed40('0x11')][_0xed40('0x13')]);return _0x307cf2(_0x4e3ded[_0xed40('0x11')]['message']);}else{logger[_0xed40('0xb')](_0xed40('0xc'),_0x2b8cfe,'request\x20sent');_0x307cf2(_0x4e3ded[_0xed40('0x14')][_0xed40('0x13')]);}})[_0xed40('0x15')](function(_0x17ccde){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2b8cfe,_0x17ccde);_0x98c807(_0x17ccde);});});}exports[_0xed40('0x16')]=function(_0x1436b6){var _0x18f10e=this;return new Promise(function(_0x391624,_0x8708f8){return db[_0xed40('0x17')]['create'](_0x1436b6[_0xed40('0x18')],{'raw':_0x1436b6[_0xed40('0x19')]?_0x1436b6['options'][_0xed40('0x1a')]===undefined?!![]:![]:!![]})[_0xed40('0x1b')](function(_0x211aff){logger[_0xed40('0xb')](_0xed40('0x16'),_0x1436b6);logger[_0xed40('0xe')](_0xed40('0x16'),_0x1436b6,JSON[_0xed40('0x10')](_0x211aff));_0x391624(_0x211aff);})[_0xed40('0x15')](function(_0x5dfc0e){logger[_0xed40('0x11')](_0xed40('0x16'),_0x5dfc0e[_0xed40('0x13')],_0x1436b6);_0x8708f8(_0x18f10e['error'](0x1f4,_0x5dfc0e[_0xed40('0x13')]));});});};exports[_0xed40('0x1c')]=function(_0x420e93){var _0x1a511f=this;return new Promise(function(_0x51d27b,_0x55368e){return db[_0xed40('0x17')][_0xed40('0x1d')](_0x420e93[_0xed40('0x18')],{'raw':_0x420e93[_0xed40('0x19')]?_0x420e93[_0xed40('0x19')][_0xed40('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420e93['options']?_0x420e93[_0xed40('0x19')][_0xed40('0x1e')]||null:null,'attributes':_0x420e93[_0xed40('0x19')]?_0x420e93['options'][_0xed40('0x1f')]||null:null,'limit':_0x420e93[_0xed40('0x19')]?_0x420e93['options']['limit']||null:null})[_0xed40('0x1b')](function(_0x3f4cc8){logger[_0xed40('0xb')](_0xed40('0x1c'),_0x420e93);logger[_0xed40('0xe')](_0xed40('0x1c'),_0x420e93,JSON[_0xed40('0x10')](_0x3f4cc8));_0x51d27b(_0x3f4cc8);})['catch'](function(_0x58f351){logger[_0xed40('0x11')](_0xed40('0x1c'),_0x58f351[_0xed40('0x13')],_0x420e93);_0x55368e(_0x1a511f[_0xed40('0x11')](0x1f4,_0x58f351[_0xed40('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 05c7a88..d6472ea 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 _0x6aa2=['delete','destroy','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','/:id/applications','put','update'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x6aa2,0x1ab));var _0x26aa=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x6aa2[_0x27c068];return _0xe5a67f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x26aa('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x26aa('0x1'));var auth=require(_0x26aa('0x2'));var interaction=require(_0x26aa('0x3'));var config=require(_0x26aa('0x4'));var controller=require(_0x26aa('0x5'));router[_0x26aa('0x6')]('/',auth['isAuthenticated'](),controller[_0x26aa('0x7')]);router[_0x26aa('0x6')](_0x26aa('0x8'),auth[_0x26aa('0x9')](),controller[_0x26aa('0xa')]);router[_0x26aa('0xb')]('/',auth[_0x26aa('0x9')](),controller['create']);router[_0x26aa('0xb')](_0x26aa('0xc'),auth['isAuthenticated'](),controller['addApplications']);router[_0x26aa('0xd')](_0x26aa('0x8'),auth[_0x26aa('0x9')](),controller[_0x26aa('0xe')]);router[_0x26aa('0xf')](_0x26aa('0x8'),auth[_0x26aa('0x9')](),controller[_0x26aa('0x10')]);module['exports']=router; \ No newline at end of file +var _0x747e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path'];(function(_0xa4d76e,_0xb2f159){var _0x2ec8df=function(_0x2e542a){while(--_0x2e542a){_0xa4d76e['push'](_0xa4d76e['shift']());}};_0x2ec8df(++_0xb2f159);}(_0x747e,0xe3));var _0xe747=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x747e[_0x1b6c6d];return _0x290d9d;};'use strict';var multer=require(_0xe747('0x0'));var util=require(_0xe747('0x1'));var path=require(_0xe747('0x2'));var timeout=require(_0xe747('0x3'));var express=require('express');var router=express[_0xe747('0x4')]();var fs_extra=require(_0xe747('0x5'));var auth=require(_0xe747('0x6'));var interaction=require(_0xe747('0x7'));var config=require(_0xe747('0x8'));var controller=require(_0xe747('0x9'));router[_0xe747('0xa')]('/',auth[_0xe747('0xb')](),controller[_0xe747('0xc')]);router[_0xe747('0xa')](_0xe747('0xd'),auth['isAuthenticated'](),controller[_0xe747('0xe')]);router[_0xe747('0xf')]('/',auth[_0xe747('0xb')](),controller[_0xe747('0x10')]);router[_0xe747('0xf')](_0xe747('0x11'),auth[_0xe747('0xb')](),controller[_0xe747('0x12')]);router[_0xe747('0x13')]('/:id',auth[_0xe747('0xb')](),controller[_0xe747('0x14')]);router[_0xe747('0x15')]('/:id',auth[_0xe747('0xb')](),controller[_0xe747('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d6ee4f8..d822944 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 _0x25c8=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','outbound-fax','system'];(function(_0xf1a005,_0x361fee){var _0x5313f6=function(_0x3753f8){while(--_0x3753f8){_0xf1a005['push'](_0xf1a005['shift']());}};_0x5313f6(++_0x361fee);}(_0x25c8,0x68));var _0x825c=function(_0x5cfdf1,_0x1754fd){_0x5cfdf1=_0x5cfdf1-0x0;var _0x1413e0=_0x25c8[_0x5cfdf1];return _0x1413e0;};'use strict';var Sequelize=require(_0x825c('0x0'));module[_0x825c('0x1')]={'context':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'unique':_0x825c('0x3')},'priority':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'defaultValue':_0x825c('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x825c('0x5'),'internal','inbound-fax',_0x825c('0x6'),_0x825c('0x7'),_0x825c('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x825c('0x2')]},'interval':{'type':Sequelize[_0x825c('0x2')],'allowNull':![],'defaultValue':_0x825c('0x9')},'IntervalId':{'type':Sequelize[_0x825c('0xa')]},'isApp':{'type':Sequelize[_0x825c('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x825c('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x825c('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x825c('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x825c('0xc')},'answer':{'type':Sequelize[_0x825c('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x825c('0xd')],'get':function(_0x3a0860){return this[_0x825c('0xe')](_0x825c('0xf'));}},'alias':{'type':Sequelize[_0x825c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xaee6=['inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0xb00a6,_0x752809){var _0x12ded8=function(_0x2179f9){while(--_0x2179f9){_0xb00a6['push'](_0xb00a6['shift']());}};_0x12ded8(++_0x752809);}(_0xaee6,0x1d6));var _0x6aee=function(_0x5dc2e1,_0x199ace){_0x5dc2e1=_0x5dc2e1-0x0;var _0x5ae63c=_0xaee6[_0x5dc2e1];return _0x5ae63c;};'use strict';var Sequelize=require(_0x6aee('0x0'));module[_0x6aee('0x1')]={'context':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'unique':_0x6aee('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'defaultValue':_0x6aee('0x4')},'appdata':{'type':Sequelize[_0x6aee('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6aee('0x5')](_0x6aee('0x6'),'outbound',_0x6aee('0x7'),_0x6aee('0x8'),_0x6aee('0x9'),_0x6aee('0xa'),_0x6aee('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x6aee('0x2')]},'interval':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'defaultValue':_0x6aee('0xc')},'IntervalId':{'type':Sequelize[_0x6aee('0xd')]},'isApp':{'type':Sequelize[_0x6aee('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6aee('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6aee('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x6aee('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6aee('0xd')]},'recordingFormat':{'type':Sequelize[_0x6aee('0x2')],'defaultValue':_0x6aee('0xf')},'answer':{'type':Sequelize[_0x6aee('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c98c2){return this['getDataValue'](_0x6aee('0x10'));}},'alias':{'type':Sequelize[_0x6aee('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 45d4ef8..368b424 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 _0x2f21=['register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','type','find','then','stack','name','send','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','include','findAll','rows','catch','show','length','includeAll','body','exten','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','context','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceExtension.socket'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2f21,0x1ba));var _0x12f2=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x2f21[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x12f2('0x0'));var Redis=require(_0x12f2('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x12f2('0x2'))('api');var config=require(_0x12f2('0x3'));var db=require(_0x12f2('0x4'))['db'];config[_0x12f2('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x12f2('0x6'))(new Redis(config[_0x12f2('0x5')]));require(_0x12f2('0x7'))[_0x12f2('0x8')](socket);function respondWithStatusCode(_0x4ef2b2,_0x23be91){_0x23be91=_0x23be91||0xcc;return function(_0x1df92d){if(_0x1df92d){return _0x4ef2b2[_0x12f2('0x9')](_0x23be91);}return _0x4ef2b2[_0x12f2('0xa')](_0x23be91)[_0x12f2('0xb')]();};}function respondWithResult(_0x74c730,_0x3b6474){_0x3b6474=_0x3b6474||0xc8;return function(_0x9116a7){if(_0x9116a7){return _0x74c730[_0x12f2('0xa')](_0x3b6474)[_0x12f2('0xc')](_0x9116a7);}};}function respondWithFilteredResult(_0x186996,_0xedd76b){return function(_0x1d903a){if(_0x1d903a){var _0x10c23a=typeof _0xedd76b[_0x12f2('0xd')]===_0x12f2('0xe')&&typeof _0xedd76b['limit']==='undefined';var _0x5c6d1c=_0x1d903a[_0x12f2('0xf')];var _0x107f1e=_0x10c23a?0x0:_0xedd76b[_0x12f2('0xd')];var _0x3db9a9=_0x10c23a?_0x1d903a[_0x12f2('0xf')]:_0xedd76b['offset']+_0xedd76b[_0x12f2('0x10')];var _0xa205b8;if(_0x3db9a9>=_0x5c6d1c){_0x3db9a9=_0x5c6d1c;_0xa205b8=0xc8;}else{_0xa205b8=0xce;}_0x186996[_0x12f2('0xa')](_0xa205b8);return _0x186996['set'](_0x12f2('0x11'),_0x107f1e+'-'+_0x3db9a9+'/'+_0x5c6d1c)[_0x12f2('0xc')](_0x1d903a);}return null;};}function removeEntity(_0x2ac424){return function(_0x150f3e){if(_0x150f3e){return _0x150f3e[_0x12f2('0x12')]()['then'](function(){var _0x25f774=_0x150f3e['get']({'plain':!![]});var _0x2659f8=[{'name':'InboundRoutes','value':_0x12f2('0x13'),'ignore':![]},{'name':_0x12f2('0x14'),'value':'outbound','ignore':![]},{'name':_0x12f2('0x15'),'value':_0x12f2('0x16'),'ignore':![]}];var _0x5e5c10=_(_0x2659f8)[_0x12f2('0x17')](_0x12f2('0x18'))[_0x12f2('0x19')](_0x12f2('0x1a'))[_0x12f2('0x1a')]();if(_['includes'](_0x5e5c10,_0x25f774[_0x12f2('0x1b')])){return;}var _0x12c309=_[_0x12f2('0x1c')](_0x2659f8,[_0x12f2('0x1a'),_0x25f774[_0x12f2('0x1b')]])['name'];return db['UserProfileResource'][_0x12f2('0x12')]({'where':{'type':_0x12c309,'resourceId':_0x25f774['id']}})[_0x12f2('0x1d')](function(){return _0x150f3e;});})[_0x12f2('0x1d')](function(){_0x2ac424['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b739e){return function(_0x572e07){if(!_0x572e07){_0x5b739e[_0x12f2('0x9')](0x194);}return _0x572e07;};}function handleError(_0x35dcb9,_0x105c10){_0x105c10=_0x105c10||0x1f4;return function(_0x4d44d6){logger['error'](_0x4d44d6[_0x12f2('0x1e')]);if(_0x4d44d6['name']){delete _0x4d44d6[_0x12f2('0x1f')];}_0x35dcb9[_0x12f2('0xa')](_0x105c10)[_0x12f2('0x20')](_0x4d44d6);};}exports[_0x12f2('0x21')]=function(_0x5120cf,_0x434c8c){var _0x520d7b={},_0x1264e7={},_0x17d383={'count':0x0,'rows':[]};var _0x58a88c=_[_0x12f2('0x19')](db['VoiceExtension'][_0x12f2('0x22')],function(_0x3f2a01){return{'name':_0x3f2a01[_0x12f2('0x23')],'type':_0x3f2a01[_0x12f2('0x1b')]['key']};});_0x1264e7[_0x12f2('0x24')]=_[_0x12f2('0x19')](_0x58a88c,'name');_0x1264e7[_0x12f2('0x25')]=_[_0x12f2('0x26')](_0x5120cf['query']);_0x1264e7[_0x12f2('0x27')]=_[_0x12f2('0x28')](_0x1264e7['model'],_0x1264e7[_0x12f2('0x25')]);_0x520d7b[_0x12f2('0x29')]=_[_0x12f2('0x28')](_0x1264e7[_0x12f2('0x24')],qs['fields'](_0x5120cf[_0x12f2('0x25')][_0x12f2('0x2a')]));_0x520d7b[_0x12f2('0x29')]=_0x520d7b[_0x12f2('0x29')]['length']?_0x520d7b[_0x12f2('0x29')]:_0x1264e7[_0x12f2('0x24')];if(!_0x5120cf[_0x12f2('0x25')][_0x12f2('0x2b')]('nolimit')){_0x520d7b['limit']=qs[_0x12f2('0x10')](_0x5120cf['query']['limit']);_0x520d7b[_0x12f2('0xd')]=qs['offset'](_0x5120cf[_0x12f2('0x25')]['offset']);}_0x520d7b[_0x12f2('0x2c')]=qs[_0x12f2('0x2d')](_0x5120cf['query'][_0x12f2('0x2d')]);_0x520d7b[_0x12f2('0x2e')]=qs[_0x12f2('0x27')](_[_0x12f2('0x2f')](_0x5120cf['query'],_0x1264e7[_0x12f2('0x27')]),_0x58a88c);if(_0x5120cf[_0x12f2('0x25')][_0x12f2('0x17')]){_0x520d7b[_0x12f2('0x2e')]=_[_0x12f2('0x30')](_0x520d7b['where'],{'$or':_[_0x12f2('0x19')](_0x58a88c,function(_0x325e7b){if(_0x325e7b[_0x12f2('0x1b')]!==_0x12f2('0x31')){var _0x5ee567={};_0x5ee567[_0x325e7b[_0x12f2('0x1f')]]={'$like':'%'+_0x5120cf['query'][_0x12f2('0x17')]+'%'};return _0x5ee567;}})});}_0x520d7b=_[_0x12f2('0x30')]({},_0x520d7b,_0x5120cf[_0x12f2('0x32')]);var _0x562907={'where':_0x520d7b[_0x12f2('0x2e')]};return db[_0x12f2('0x33')]['count'](_0x562907)[_0x12f2('0x1d')](function(_0x5f46c7){_0x17d383[_0x12f2('0xf')]=_0x5f46c7;if(_0x5120cf['query']['includeAll']){_0x520d7b[_0x12f2('0x34')]=[{'all':!![]}];}return db['VoiceExtension'][_0x12f2('0x35')](_0x520d7b);})['then'](function(_0xefc053){_0x17d383[_0x12f2('0x36')]=_0xefc053;return _0x17d383;})[_0x12f2('0x1d')](respondWithFilteredResult(_0x434c8c,_0x520d7b))[_0x12f2('0x37')](handleError(_0x434c8c,null));};exports[_0x12f2('0x38')]=function(_0x17042e,_0x5a9252){var _0x4ff6f5={'raw':![],'where':{'id':_0x17042e['params']['id']}},_0x5a3bc1={};_0x5a3bc1['model']=_[_0x12f2('0x26')](db[_0x12f2('0x33')][_0x12f2('0x22')]);_0x5a3bc1[_0x12f2('0x25')]=_['keys'](_0x17042e['query']);_0x5a3bc1[_0x12f2('0x27')]=_[_0x12f2('0x28')](_0x5a3bc1[_0x12f2('0x24')],_0x5a3bc1[_0x12f2('0x25')]);_0x4ff6f5[_0x12f2('0x29')]=_['intersection'](_0x5a3bc1[_0x12f2('0x24')],qs[_0x12f2('0x2a')](_0x17042e[_0x12f2('0x25')][_0x12f2('0x2a')]));_0x4ff6f5['attributes']=_0x4ff6f5[_0x12f2('0x29')][_0x12f2('0x39')]?_0x4ff6f5[_0x12f2('0x29')]:_0x5a3bc1['model'];if(_0x17042e[_0x12f2('0x25')][_0x12f2('0x3a')]){_0x4ff6f5[_0x12f2('0x34')]=[{'all':!![]}];}_0x4ff6f5=_[_0x12f2('0x30')]({},_0x4ff6f5,_0x17042e[_0x12f2('0x32')]);return db['VoiceExtension']['find'](_0x4ff6f5)[_0x12f2('0x1d')](handleEntityNotFound(_0x5a9252,null))[_0x12f2('0x1d')](respondWithResult(_0x5a9252,null))[_0x12f2('0x37')](handleError(_0x5a9252,null));};exports['destroy']=function(_0x50159d,_0x1c96dc){return db[_0x12f2('0x33')]['find']({'where':{'id':_0x50159d['params']['id']}})['then'](handleEntityNotFound(_0x1c96dc,null))['then'](removeEntity(_0x1c96dc,null))['catch'](handleError(_0x1c96dc,null));};exports['create']=function(_0xc9317a,_0x1f5595){if(_0xc9317a[_0x12f2('0x3b')][_0x12f2('0x1b')]==='outbound'&&!_['startsWith'](_0xc9317a[_0x12f2('0x3b')]['exten'],'_')){_0xc9317a[_0x12f2('0x3b')][_0x12f2('0x3c')]='_'['concat'](_0xc9317a[_0x12f2('0x3b')]['exten']);}return db['VoiceExtension'][_0x12f2('0x3d')](_0xc9317a[_0x12f2('0x3b')],{'raw':![]})[_0x12f2('0x1d')](function(_0x4729d6){var _0x2ace71=_0xc9317a[_0x12f2('0x3e')][_0x12f2('0x3f')]({'plain':!![]});if(!_0x2ace71)throw new Error(_0x12f2('0x40'));if(_0x2ace71[_0x12f2('0x41')]===_0x12f2('0x3e')){var _0x26bd18=_0x4729d6[_0x12f2('0x3f')]({'plain':!![]});var _0x107ded=[{'name':_0x12f2('0x42'),'value':_0x12f2('0x13')},{'name':_0x12f2('0x14'),'value':_0x12f2('0x43')},{'name':'InternalRoutes','value':_0x12f2('0x16')}];var _0x25d262=_[_0x12f2('0x1c')](_0x107ded,[_0x12f2('0x1a'),_0x26bd18['type']])[_0x12f2('0x1f')];return db[_0x12f2('0x44')][_0x12f2('0x1c')]({'where':{'name':_0x25d262,'userProfileId':_0x2ace71[_0x12f2('0x45')]},'raw':!![]})[_0x12f2('0x1d')](function(_0x2144bf){if(_0x2144bf&&_0x2144bf[_0x12f2('0x46')]===0x0){return db[_0x12f2('0x47')][_0x12f2('0x3d')]({'name':_0x26bd18[_0x12f2('0x1f')],'resourceId':_0x26bd18['id'],'type':_0x2144bf[_0x12f2('0x1f')],'sectionId':_0x2144bf['id']},{})[_0x12f2('0x1d')](function(){return _0x4729d6;});}else{return _0x4729d6;}})[_0x12f2('0x37')](function(_0x263fba){logger[_0x12f2('0x48')](_0x12f2('0x49'),_0x263fba);throw _0x263fba;});}return _0x4729d6;})[_0x12f2('0x1d')](respondWithResult(_0x1f5595,0xc9))[_0x12f2('0x37')](handleError(_0x1f5595,null));};exports[_0x12f2('0x4a')]=function(_0xccef76,_0x47a6fe){if(_0xccef76[_0x12f2('0x3b')]['id']){delete _0xccef76[_0x12f2('0x3b')]['id'];}return db['VoiceExtension'][_0x12f2('0x1c')]({'where':{'id':_0xccef76[_0x12f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47a6fe,null))['then'](function(_0x882d5a){if(_0x882d5a){return db[_0x12f2('0x33')][_0x12f2('0x4a')](_[_0x12f2('0x2f')](_0xccef76['body'],[_0x12f2('0x3c'),_0x12f2('0x4c'),'description','recordingFormat',_0x12f2('0x4d'),_0x12f2('0x4e'),_0x12f2('0x4f')]),{'where':{'context':_0x882d5a[_0x12f2('0x4c')],'exten':_0x882d5a[_0x12f2('0x3c')]},'individualHooks':!![]})[_0x12f2('0x1d')](function(_0x193452){return _0x193452;});}return null;})['then'](respondWithStatusCode(_0x47a6fe,null))['catch'](handleError(_0x47a6fe,null));};exports[_0x12f2('0x50')]=function(_0x54df87,_0x478f48){var _0x4fcfb6=_0x54df87[_0x12f2('0x4b')]['id'];var _0x3c9caa=_0x54df87['body'];var _0x54646e=0xc8;var _0x287fd1=null;return db[_0x12f2('0x51')][_0x12f2('0x52')]({'isolationLevel':db[_0x12f2('0x51')][_0x12f2('0x53')][_0x12f2('0x54')][_0x12f2('0x55')]},function(_0xcf8086){return db[_0x12f2('0x33')]['findOne']({'where':{'id':_0x4fcfb6},'transaction':_0xcf8086})['then'](function(_0x3d0adf){if(_0x3d0adf){return db['VoiceExtension'][_0x12f2('0x12')]({'where':{'VoiceExtensionId':_0x4fcfb6},'transaction':_0xcf8086})['then'](function(){var _0x2ce54e=_[_0x12f2('0x19')](_0x3c9caa,function(_0x3c89ad){_0x3c89ad[_0x12f2('0x56')]=_0x4fcfb6;_0x3c89ad['isApp']=!![];return _0x3c89ad;});return _0x3d0adf[_0x12f2('0x57')](_0x2ce54e);})[_0x12f2('0x1d')](function(_0x9d450a){return db['VoiceExtension']['bulkCreate'](_0x9d450a,{'transaction':_0xcf8086});});}else{_0x54646e=0x194;_0x287fd1=[];}});})[_0x12f2('0x1d')](function(){if(_0x54646e!==0x194){return db[_0x12f2('0x33')][_0x12f2('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4fcfb6},'order':_0x12f2('0x59')})['then'](function(_0x560513){_0x287fd1=_0x560513;});}})[_0x12f2('0x37')](function(_0x144e7a){_0x54646e=0x1f4;logger[_0x12f2('0x48')](_0x144e7a[_0x12f2('0x1e')]);if(_0x144e7a['name']){delete _0x144e7a[_0x12f2('0x1f')];}_0x287fd1=_0x144e7a;})['finally'](function(){if(_0x287fd1===null){_0x478f48[_0x12f2('0x9')](_0x54646e);}else{if(_0x54646e===0x1f4){_0x478f48[_0x12f2('0xa')](_0x54646e)[_0x12f2('0x20')](_0x287fd1);}else{_0x478f48['status'](_0x54646e)[_0x12f2('0xc')](_0x287fd1);}}});}; \ No newline at end of file +var _0xfaa9=['show','params','intersection','create','body','outbound','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','cast(priority\x20as\x20unsigned)','error','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','get','InboundRoutes','OutboundRoutes','InternalRoutes','internal','filter','ignore','value','includes','type','find','UserProfileResource','name','send','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch'];(function(_0x24b8ec,_0x3c8c5b){var _0x1d1b63=function(_0x316c98){while(--_0x316c98){_0x24b8ec['push'](_0x24b8ec['shift']());}};_0x1d1b63(++_0x3c8c5b);}(_0xfaa9,0x13a));var _0x9faa=function(_0x325022,_0x3b06fa){_0x325022=_0x325022-0x0;var _0x604986=_0xfaa9[_0x325022];return _0x604986;};'use strict';var _=require(_0x9faa('0x0'));var Redis=require(_0x9faa('0x1'));var qs=require(_0x9faa('0x2'));var logger=require(_0x9faa('0x3'))(_0x9faa('0x4'));var config=require(_0x9faa('0x5'));var db=require(_0x9faa('0x6'))['db'];config[_0x9faa('0x7')]=_[_0x9faa('0x8')](config[_0x9faa('0x7')],{'host':_0x9faa('0x9'),'port':0x18eb});var socket=require(_0x9faa('0xa'))(new Redis(config[_0x9faa('0x7')]));require(_0x9faa('0xb'))[_0x9faa('0xc')](socket);function respondWithStatusCode(_0x44be21,_0x4f076c){_0x4f076c=_0x4f076c||0xcc;return function(_0x332789){if(_0x332789){return _0x44be21[_0x9faa('0xd')](_0x4f076c);}return _0x44be21[_0x9faa('0xe')](_0x4f076c)[_0x9faa('0xf')]();};}function respondWithResult(_0x36d9d2,_0x44d95e){_0x44d95e=_0x44d95e||0xc8;return function(_0x212154){if(_0x212154){return _0x36d9d2['status'](_0x44d95e)[_0x9faa('0x10')](_0x212154);}};}function respondWithFilteredResult(_0xef5d0,_0x3689ca){return function(_0x6e5009){if(_0x6e5009){var _0x3a9db4=typeof _0x3689ca[_0x9faa('0x11')]===_0x9faa('0x12')&&typeof _0x3689ca[_0x9faa('0x13')]===_0x9faa('0x12');var _0x15364b=_0x6e5009[_0x9faa('0x14')];var _0x22841a=_0x3a9db4?0x0:_0x3689ca['offset'];var _0x83792c=_0x3a9db4?_0x6e5009[_0x9faa('0x14')]:_0x3689ca[_0x9faa('0x11')]+_0x3689ca[_0x9faa('0x13')];var _0x26cd47;if(_0x83792c>=_0x15364b){_0x83792c=_0x15364b;_0x26cd47=0xc8;}else{_0x26cd47=0xce;}_0xef5d0[_0x9faa('0xe')](_0x26cd47);return _0xef5d0[_0x9faa('0x15')]('Content-Range',_0x22841a+'-'+_0x83792c+'/'+_0x15364b)['json'](_0x6e5009);}return null;};}function removeEntity(_0x42f5b7){return function(_0x9eb6bb){if(_0x9eb6bb){return _0x9eb6bb[_0x9faa('0x16')]()[_0x9faa('0x17')](function(){var _0x4850b2=_0x9eb6bb[_0x9faa('0x18')]({'plain':!![]});var _0x55568e=[{'name':_0x9faa('0x19'),'value':'inbound','ignore':![]},{'name':_0x9faa('0x1a'),'value':'outbound','ignore':![]},{'name':_0x9faa('0x1b'),'value':_0x9faa('0x1c'),'ignore':![]}];var _0x265551=_(_0x55568e)[_0x9faa('0x1d')](_0x9faa('0x1e'))['map'](_0x9faa('0x1f'))[_0x9faa('0x1f')]();if(_[_0x9faa('0x20')](_0x265551,_0x4850b2[_0x9faa('0x21')])){return;}var _0x2155c0=_[_0x9faa('0x22')](_0x55568e,[_0x9faa('0x1f'),_0x4850b2[_0x9faa('0x21')]])['name'];return db[_0x9faa('0x23')][_0x9faa('0x16')]({'where':{'type':_0x2155c0,'resourceId':_0x4850b2['id']}})[_0x9faa('0x17')](function(){return _0x9eb6bb;});})['then'](function(){_0x42f5b7[_0x9faa('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425dd9){return function(_0x55835d){if(!_0x55835d){_0x425dd9['sendStatus'](0x194);}return _0x55835d;};}function handleError(_0x25bf66,_0x1a62ce){_0x1a62ce=_0x1a62ce||0x1f4;return function(_0x4fdf0a){logger['error'](_0x4fdf0a['stack']);if(_0x4fdf0a[_0x9faa('0x24')]){delete _0x4fdf0a[_0x9faa('0x24')];}_0x25bf66[_0x9faa('0xe')](_0x1a62ce)[_0x9faa('0x25')](_0x4fdf0a);};}exports[_0x9faa('0x26')]=function(_0x3f46d5,_0x49ee3d){var _0x10606b={},_0xdd1c5f={},_0x40f55c={'count':0x0,'rows':[]};var _0x402f3b=_[_0x9faa('0x27')](db[_0x9faa('0x28')][_0x9faa('0x29')],function(_0x23a28d){return{'name':_0x23a28d[_0x9faa('0x2a')],'type':_0x23a28d[_0x9faa('0x21')][_0x9faa('0x2b')]};});_0xdd1c5f[_0x9faa('0x2c')]=_['map'](_0x402f3b,_0x9faa('0x24'));_0xdd1c5f[_0x9faa('0x2d')]=_[_0x9faa('0x2e')](_0x3f46d5['query']);_0xdd1c5f[_0x9faa('0x2f')]=_['intersection'](_0xdd1c5f[_0x9faa('0x2c')],_0xdd1c5f[_0x9faa('0x2d')]);_0x10606b['attributes']=_['intersection'](_0xdd1c5f['model'],qs[_0x9faa('0x30')](_0x3f46d5[_0x9faa('0x2d')][_0x9faa('0x30')]));_0x10606b[_0x9faa('0x31')]=_0x10606b[_0x9faa('0x31')][_0x9faa('0x32')]?_0x10606b[_0x9faa('0x31')]:_0xdd1c5f['model'];if(!_0x3f46d5[_0x9faa('0x2d')][_0x9faa('0x33')]('nolimit')){_0x10606b[_0x9faa('0x13')]=qs[_0x9faa('0x13')](_0x3f46d5[_0x9faa('0x2d')][_0x9faa('0x13')]);_0x10606b[_0x9faa('0x11')]=qs[_0x9faa('0x11')](_0x3f46d5[_0x9faa('0x2d')][_0x9faa('0x11')]);}_0x10606b[_0x9faa('0x34')]=qs[_0x9faa('0x35')](_0x3f46d5[_0x9faa('0x2d')][_0x9faa('0x35')]);_0x10606b[_0x9faa('0x36')]=qs[_0x9faa('0x2f')](_[_0x9faa('0x37')](_0x3f46d5[_0x9faa('0x2d')],_0xdd1c5f[_0x9faa('0x2f')]),_0x402f3b);if(_0x3f46d5[_0x9faa('0x2d')][_0x9faa('0x1d')]){_0x10606b['where']=_[_0x9faa('0x38')](_0x10606b[_0x9faa('0x36')],{'$or':_[_0x9faa('0x27')](_0x402f3b,function(_0x2ba001){if(_0x2ba001['type']!==_0x9faa('0x39')){var _0xe5bbd7={};_0xe5bbd7[_0x2ba001[_0x9faa('0x24')]]={'$like':'%'+_0x3f46d5[_0x9faa('0x2d')]['filter']+'%'};return _0xe5bbd7;}})});}_0x10606b=_[_0x9faa('0x38')]({},_0x10606b,_0x3f46d5[_0x9faa('0x3a')]);var _0x1e158d={'where':_0x10606b[_0x9faa('0x36')]};return db['VoiceExtension'][_0x9faa('0x14')](_0x1e158d)['then'](function(_0x4a6677){_0x40f55c[_0x9faa('0x14')]=_0x4a6677;if(_0x3f46d5['query'][_0x9faa('0x3b')]){_0x10606b[_0x9faa('0x3c')]=[{'all':!![]}];}return db[_0x9faa('0x28')]['findAll'](_0x10606b);})[_0x9faa('0x17')](function(_0x20f807){_0x40f55c['rows']=_0x20f807;return _0x40f55c;})[_0x9faa('0x17')](respondWithFilteredResult(_0x49ee3d,_0x10606b))[_0x9faa('0x3d')](handleError(_0x49ee3d,null));};exports[_0x9faa('0x3e')]=function(_0x591927,_0x50c9e3){var _0x2781fc={'raw':![],'where':{'id':_0x591927[_0x9faa('0x3f')]['id']}},_0x738c59={};_0x738c59[_0x9faa('0x2c')]=_[_0x9faa('0x2e')](db[_0x9faa('0x28')][_0x9faa('0x29')]);_0x738c59[_0x9faa('0x2d')]=_[_0x9faa('0x2e')](_0x591927[_0x9faa('0x2d')]);_0x738c59[_0x9faa('0x2f')]=_[_0x9faa('0x40')](_0x738c59[_0x9faa('0x2c')],_0x738c59[_0x9faa('0x2d')]);_0x2781fc['attributes']=_[_0x9faa('0x40')](_0x738c59[_0x9faa('0x2c')],qs[_0x9faa('0x30')](_0x591927[_0x9faa('0x2d')]['fields']));_0x2781fc[_0x9faa('0x31')]=_0x2781fc['attributes'][_0x9faa('0x32')]?_0x2781fc[_0x9faa('0x31')]:_0x738c59[_0x9faa('0x2c')];if(_0x591927[_0x9faa('0x2d')][_0x9faa('0x3b')]){_0x2781fc[_0x9faa('0x3c')]=[{'all':!![]}];}_0x2781fc=_['merge']({},_0x2781fc,_0x591927[_0x9faa('0x3a')]);return db[_0x9faa('0x28')][_0x9faa('0x22')](_0x2781fc)[_0x9faa('0x17')](handleEntityNotFound(_0x50c9e3,null))[_0x9faa('0x17')](respondWithResult(_0x50c9e3,null))[_0x9faa('0x3d')](handleError(_0x50c9e3,null));};exports[_0x9faa('0x16')]=function(_0x4937c6,_0x33a334){return db[_0x9faa('0x28')]['find']({'where':{'id':_0x4937c6['params']['id']}})[_0x9faa('0x17')](handleEntityNotFound(_0x33a334,null))[_0x9faa('0x17')](removeEntity(_0x33a334,null))[_0x9faa('0x3d')](handleError(_0x33a334,null));};exports[_0x9faa('0x41')]=function(_0x5b5477,_0x5e2f1b){if(_0x5b5477[_0x9faa('0x42')][_0x9faa('0x21')]===_0x9faa('0x43')&&!_[_0x9faa('0x44')](_0x5b5477[_0x9faa('0x42')][_0x9faa('0x45')],'_')){_0x5b5477[_0x9faa('0x42')][_0x9faa('0x45')]='_'['concat'](_0x5b5477[_0x9faa('0x42')][_0x9faa('0x45')]);}return db['VoiceExtension'][_0x9faa('0x41')](_0x5b5477[_0x9faa('0x42')],{'raw':![]})['then'](function(_0x4b4198){var _0x2c67d0=_0x5b5477[_0x9faa('0x46')][_0x9faa('0x18')]({'plain':!![]});if(!_0x2c67d0)throw new Error(_0x9faa('0x47'));if(_0x2c67d0[_0x9faa('0x48')]===_0x9faa('0x46')){var _0x3d9bc2=_0x4b4198[_0x9faa('0x18')]({'plain':!![]});var _0x36aa5b=[{'name':_0x9faa('0x19'),'value':'inbound'},{'name':_0x9faa('0x1a'),'value':_0x9faa('0x43')},{'name':_0x9faa('0x1b'),'value':_0x9faa('0x1c')}];var _0x5b3894=_[_0x9faa('0x22')](_0x36aa5b,['value',_0x3d9bc2['type']])[_0x9faa('0x24')];return db['UserProfileSection'][_0x9faa('0x22')]({'where':{'name':_0x5b3894,'userProfileId':_0x2c67d0[_0x9faa('0x49')]},'raw':!![]})['then'](function(_0x4132ee){if(_0x4132ee&&_0x4132ee['autoAssociation']===0x0){return db[_0x9faa('0x23')][_0x9faa('0x41')]({'name':_0x3d9bc2[_0x9faa('0x24')],'resourceId':_0x3d9bc2['id'],'type':_0x4132ee['name'],'sectionId':_0x4132ee['id']},{})[_0x9faa('0x17')](function(){return _0x4b4198;});}else{return _0x4b4198;}})[_0x9faa('0x3d')](function(_0x15dffa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15dffa);throw _0x15dffa;});}return _0x4b4198;})['then'](respondWithResult(_0x5e2f1b,0xc9))['catch'](handleError(_0x5e2f1b,null));};exports[_0x9faa('0x4a')]=function(_0x143d9b,_0x1f1b1a){if(_0x143d9b['body']['id']){delete _0x143d9b[_0x9faa('0x42')]['id'];}return db[_0x9faa('0x28')]['find']({'where':{'id':_0x143d9b[_0x9faa('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1f1b1a,null))['then'](function(_0x406c64){if(_0x406c64){return db['VoiceExtension'][_0x9faa('0x4a')](_[_0x9faa('0x37')](_0x143d9b[_0x9faa('0x42')],[_0x9faa('0x45'),_0x9faa('0x4b'),_0x9faa('0x4c'),_0x9faa('0x4d'),_0x9faa('0x4e'),_0x9faa('0x4f'),'alias']),{'where':{'context':_0x406c64[_0x9faa('0x4b')],'exten':_0x406c64['exten']},'individualHooks':!![]})[_0x9faa('0x17')](function(_0x5c5a83){return _0x5c5a83;});}return null;})[_0x9faa('0x17')](respondWithStatusCode(_0x1f1b1a,null))[_0x9faa('0x3d')](handleError(_0x1f1b1a,null));};exports[_0x9faa('0x50')]=function(_0x329665,_0x2ddd86){var _0x2152b7=_0x329665[_0x9faa('0x3f')]['id'];var _0x5e7622=_0x329665[_0x9faa('0x42')];var _0x4fc5aa=0xc8;var _0x3a47d8=null;return db[_0x9faa('0x51')][_0x9faa('0x52')]({'isolationLevel':db[_0x9faa('0x51')][_0x9faa('0x53')][_0x9faa('0x54')][_0x9faa('0x55')]},function(_0x5bcadd){return db[_0x9faa('0x28')][_0x9faa('0x56')]({'where':{'id':_0x2152b7},'transaction':_0x5bcadd})[_0x9faa('0x17')](function(_0x2e3c9a){if(_0x2e3c9a){return db[_0x9faa('0x28')][_0x9faa('0x16')]({'where':{'VoiceExtensionId':_0x2152b7},'transaction':_0x5bcadd})[_0x9faa('0x17')](function(){var _0x27c036=_[_0x9faa('0x27')](_0x5e7622,function(_0x583ab4){_0x583ab4[_0x9faa('0x57')]=_0x2152b7;_0x583ab4[_0x9faa('0x58')]=!![];return _0x583ab4;});return _0x2e3c9a[_0x9faa('0x59')](_0x27c036);})[_0x9faa('0x17')](function(_0x2424f1){return db[_0x9faa('0x28')]['bulkCreate'](_0x2424f1,{'transaction':_0x5bcadd});});}else{_0x4fc5aa=0x194;_0x3a47d8=[];}});})[_0x9faa('0x17')](function(){if(_0x4fc5aa!==0x194){return db[_0x9faa('0x28')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2152b7},'order':_0x9faa('0x5a')})[_0x9faa('0x17')](function(_0x525f48){_0x3a47d8=_0x525f48;});}})[_0x9faa('0x3d')](function(_0x204368){_0x4fc5aa=0x1f4;logger[_0x9faa('0x5b')](_0x204368[_0x9faa('0x5c')]);if(_0x204368[_0x9faa('0x24')]){delete _0x204368[_0x9faa('0x24')];}_0x3a47d8=_0x204368;})[_0x9faa('0x5d')](function(){if(_0x3a47d8===null){_0x2ddd86[_0x9faa('0xd')](_0x4fc5aa);}else{if(_0x4fc5aa===0x1f4){_0x2ddd86[_0x9faa('0xe')](_0x4fc5aa)[_0x9faa('0x25')](_0x3a47d8);}else{_0x2ddd86['status'](_0x4fc5aa)[_0x9faa('0x10')](_0x3a47d8);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 822abf3..7d53ff2 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 _0x0abb=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0abb,0x7a));var _0xb0ab=function(_0x41ee09,_0x756735){_0x41ee09=_0x41ee09-0x0;var _0xa9af5c=_0x0abb[_0x41ee09];return _0xa9af5c;};'use strict';var EventEmitter=require(_0xb0ab('0x0'));var VoiceExtension=require(_0xb0ab('0x1'))['db'][_0xb0ab('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb0ab('0x3')](0x0);var events={'afterCreate':_0xb0ab('0x4'),'afterUpdate':_0xb0ab('0x5'),'afterDestroy':_0xb0ab('0x6')};function emitEvent(_0x24e652){return function(_0x13ec94,_0x4381b2,_0x3bd607){VoiceExtensionEvents[_0xb0ab('0x7')](_0x24e652+':'+_0x13ec94['id'],_0x13ec94);VoiceExtensionEvents['emit'](_0x24e652,_0x13ec94);_0x3bd607(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xb0ab('0x8')](e,emitEvent(event));}}module[_0xb0ab('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x2582=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x2582,0x96));var _0x2258=function(_0x52c3c3,_0x5af662){_0x52c3c3=_0x52c3c3-0x0;var _0x34389a=_0x2582[_0x52c3c3];return _0x34389a;};'use strict';var EventEmitter=require(_0x2258('0x0'));var VoiceExtension=require(_0x2258('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2258('0x2')](0x0);var events={'afterCreate':_0x2258('0x3'),'afterUpdate':_0x2258('0x4'),'afterDestroy':_0x2258('0x5')};function emitEvent(_0x36c6fa){return function(_0x65d42b,_0x1a79ad,_0x5122db){VoiceExtensionEvents['emit'](_0x36c6fa+':'+_0x65d42b['id'],_0x65d42b);VoiceExtensionEvents[_0x2258('0x6')](_0x36c6fa,_0x65d42b);_0x5122db(null);};}for(var e in events){if(events[_0x2258('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x2258('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 6e1a3e9..21ee269 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 _0x5fc3=['queue','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','get','lodash','./voiceExtension.attributes','models','type','Set','context','alias','NoOp','CDR(routeAlias)=','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','length','name','split','param','prefix','phone','SIP','trunk','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer'];(function(_0x21b283,_0x46d64a){var _0x14631a=function(_0x4d2432){while(--_0x4d2432){_0x21b283['push'](_0x21b283['shift']());}};_0x14631a(++_0x46d64a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x5fc3[_0x102977];return _0x15c466;};'use strict';var _=require(_0x35fc('0x0'));var attributes=require(_0x35fc('0x1'));module['exports']=function(_0x253d6e){var _0x2ac6da=_0x253d6e[_0x35fc('0x2')];function _0x91d024(_0xb4f9ce){var _0x5e75e6=0x2;var _0x2d1404=[{'type':_0xb4f9ce[_0x35fc('0x3')],'app':_0x35fc('0x4'),'appdata':'CDR(type)='+_0xb4f9ce['type'],'context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce['exten'],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']},{'type':_0xb4f9ce[_0x35fc('0x3')],'app':_0xb4f9ce[_0x35fc('0x6')]?_0x35fc('0x4'):_0x35fc('0x7'),'appdata':_0xb4f9ce[_0x35fc('0x6')]?_0x35fc('0x8')+_0xb4f9ce[_0x35fc('0x6')]:'No\x20alias\x20set','context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce[_0x35fc('0x9')],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']}];if(_0xb4f9ce['type']===_0x35fc('0xa')){_0x2d1404[_0x35fc('0xb')]({'type':'inbound','app':_0x35fc('0x4'),'appdata':_0x35fc('0xc')+_0xb4f9ce['id'],'context':_0xb4f9ce['context'],'exten':_0xb4f9ce['exten'],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']});}_0x2d1404[_0x35fc('0xb')]({'type':_0xb4f9ce['type'],'app':_0x35fc('0x4'),'appdata':_0x35fc('0xd'),'context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce[_0x35fc('0x9')],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']},{'type':_0xb4f9ce[_0x35fc('0x3')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xb4f9ce['context'],'exten':_0xb4f9ce['exten'],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']},{'type':_0xb4f9ce[_0x35fc('0x3')],'app':_0x35fc('0x4'),'appdata':_0x35fc('0xe'),'context':_0xb4f9ce[_0x35fc('0x5')],'exten':_0xb4f9ce[_0x35fc('0x9')],'priority':_0x5e75e6++,'VoiceExtensionId':_0xb4f9ce['id']});return _0x2d1404;}function _0x1121fa(_0x480851){var _0x26ba54=0x2;var _0x45c8b7=[{'type':'outbound','app':_0x35fc('0x4'),'appdata':_0x35fc('0xf'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x480851[_0x35fc('0x6')]?_0x35fc('0x4'):'NoOp','appdata':_0x480851[_0x35fc('0x6')]?_0x35fc('0x8')+_0x480851[_0x35fc('0x6')]:_0x35fc('0x11'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x12')+(_0x480851[_0x35fc('0x13')]?'${EXTEN:'+_0x480851[_0x35fc('0x13')]+'}':_0x35fc('0x14')),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':'Set','appdata':_0x35fc('0xc')+_0x480851['id'],'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x15'),'appdata':_0x35fc('0x16')+(_0x26ba54+0x2)+'):Goto('+(_0x26ba54+0x1)+')','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x480851['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x480851[_0x35fc('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':'outbound','app':_0x35fc('0x4'),'appdata':_0x35fc('0xd'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x17'),'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851['exten'],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0xe'),'context':_0x480851['context'],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x18')+_0x480851['id'],'context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']}];if(_0x480851[_0x35fc('0x19')](_0x35fc('0x1a'))&&_0x480851[_0x35fc('0x1a')]!==_0x35fc('0x1b')){_0x45c8b7['push']({'type':'outbound','app':_0x35fc('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']},{'type':_0x35fc('0x10'),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x1c')+_0x480851[_0x35fc('0x1a')]||'wav','context':_0x480851[_0x35fc('0x5')],'exten':_0x480851[_0x35fc('0x9')],'priority':_0x26ba54++,'VoiceExtensionId':_0x480851['id']});}return _0x45c8b7;}function _0x46b9ef(_0x4441d8,_0x2bbd36){var _0x2f823b=[{'name':'trunk','param':0x0},{'name':_0x35fc('0x1d'),'param':0x1},{'name':_0x35fc('0x1e'),'param':0x2},{'name':_0x35fc('0x1f'),'param':0x3}];var _0x52f53d={};var _0x2c657d=_0x2bbd36['split'](',');var _0x2ecb2e=[];for(var _0x33a377=0x0;_0x33a377<_0x2f823b[_0x35fc('0x20')];_0x33a377++){switch(_0x2f823b[_0x33a377][_0x35fc('0x21')]){case'trunk':_0x52f53d['trunk']=_0x2c657d[_0x2f823b[_0x33a377]['param']][_0x35fc('0x22')]('/')[0x1];_0x52f53d['phone']=_0x2c657d[_0x2f823b[_0x33a377][_0x35fc('0x23')]]['split']('/')[0x2];_0x52f53d[_0x35fc('0x24')]=_0x52f53d[_0x35fc('0x25')]?_0x52f53d[_0x35fc('0x25')][_0x35fc('0x22')]('$')[0x0]:undefined;_0x52f53d[_0x35fc('0x25')]=_0x4441d8[_0x35fc('0x13')]?(_0x52f53d[_0x35fc('0x24')]||'')+'${EXTEN:'+_0x4441d8[_0x35fc('0x13')]+'}':(_0x52f53d[_0x35fc('0x24')]||'')+'${EXTEN}';_0x2ecb2e[_0x2f823b[_0x33a377][_0x35fc('0x23')]]=[_0x35fc('0x26'),_0x52f53d[_0x35fc('0x27')],_0x52f53d[_0x35fc('0x25')]][_0x35fc('0x28')]('/');break;case _0x35fc('0x1e'):_0x52f53d['options']=_0x2c657d[_0x2f823b[_0x33a377][_0x35fc('0x23')]];if(_0x4441d8[_0x35fc('0x1a')]!==_0x35fc('0x1b')){if(_0x52f53d['options'][_0x35fc('0x29')](_0x35fc('0x2a'))<0x0){_0x52f53d['options']+=_0x35fc('0x2a');}}else{_0x52f53d[_0x35fc('0x1e')]=_0x52f53d[_0x35fc('0x1e')][_0x35fc('0x2b')](_0x35fc('0x2a'),'');}_0x2ecb2e[_0x2f823b[_0x33a377][_0x35fc('0x23')]]=_0x52f53d[_0x35fc('0x1e')];break;default:_0x2ecb2e[_0x2f823b[_0x33a377][_0x35fc('0x23')]]=_0x2c657d[_0x2f823b[_0x33a377]['param']];}}return _0x2ecb2e['join'](',');}function _0x210d5d(_0x36fcf9,_0x4fdc6d,_0x5c2e5c){return new Promise(function(_0x4ff202,_0x79677d){var _0x10f98b=[];if(_['isEmpty'](_0x4fdc6d))return _0x4ff202(_0x10f98b);_0x2ac6da[_0x35fc('0x2c')][_0x35fc('0x2d')]({'attributes':['id',_0x35fc('0x2e'),_0x35fc('0x2f')],'raw':!![]})['then'](function(_0x57105c){for(var _0x5bf2f4=0x0,_0x539157=0x0;_0x5bf2f4<_0x4fdc6d['length'];_0x5bf2f4++,_0x539157=0x0){var _0xb26e3f=_0x4fdc6d[_0x5bf2f4];var _0x27eabf=[];var _0x4fc5bc=[];delete _0xb26e3f['id'];if(_0xb26e3f[_0x35fc('0x2e')]!=='*,*,*,*'){_0xb26e3f[_0x35fc('0x30')]=[_0xb26e3f[_0x35fc('0x2e')]];}else{_0xb26e3f[_0x35fc('0x30')]=_0xb26e3f[_0x35fc('0x2f')]?_[_0x35fc('0x31')](_['filter'](_0x57105c,{'IntervalId':_0xb26e3f[_0x35fc('0x2f')]}),_0x35fc('0x2e')):[];}_0xb26e3f['context']=_0x36fcf9[_0x35fc('0x5')];_0xb26e3f[_0x35fc('0x9')]=_0x36fcf9[_0x35fc('0x9')];if(_0xb26e3f[_0x35fc('0x3')])_0xb26e3f['type']=_0xb26e3f[_0x35fc('0x3')]['toLowerCase']();if(_0x36fcf9['type']===_0x35fc('0x10')){if(_0xb26e3f[_0x35fc('0x19')](_0x35fc('0x32'))&&_0xb26e3f[_0x35fc('0x32')]&&_0xb26e3f[_0x35fc('0x32')]!=='--'){_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')][_0x35fc('0x33')](),'app':'Set','appdata':_0x35fc('0x34')+_0xb26e3f[_0x35fc('0x32')],'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')][_0x35fc('0x33')](),'app':_0x35fc('0x15'),'appdata':_0x35fc('0x35')+(_0xb26e3f[_0x35fc('0x36')]?_0x35fc('0x37')+_0xb26e3f[_0x35fc('0x36')]+')':'NoOp(No\x20number\x20available)'),'context':_0x36fcf9['context'],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}else{if(_0xb26e3f[_0x35fc('0x19')](_0x35fc('0x38'))){if([_0x35fc('0x39'),'playback']['includes'](_0xb26e3f[_0x35fc('0x3a')][_0x35fc('0x33')]())&&_0xb26e3f[_0x35fc('0x3b')]!==_0x35fc('0x3c')){if(_0xb26e3f['answer']){_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')]['toLowerCase'](),'app':_0x35fc('0x15'),'appdata':_0x35fc('0x3d'),'context':_0x36fcf9['context'],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f['type']['toLowerCase'](),'app':'Set','appdata':_0x35fc('0x3e'),'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9['exten'],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}else{_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f[_0x35fc('0x3')][_0x35fc('0x33')](),'app':'ExecIf','appdata':_0x35fc('0x3f'),'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f['intervals'][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});_0x27eabf[_0x35fc('0xb')]({'type':_0xb26e3f['type'][_0x35fc('0x33')](),'app':_0x35fc('0x4'),'appdata':_0x35fc('0x40'),'context':_0x36fcf9[_0x35fc('0x5')],'exten':_0x36fcf9[_0x35fc('0x9')],'priority':_0xb26e3f[_0x35fc('0x30')][_0x35fc('0x20')]+_0x5c2e5c+_0x539157++,'VoiceExtensionId':_0x36fcf9['id']});}}}}for(var _0x998fd9=0x0;_0x998fd9<_0xb26e3f['intervals'][_0x35fc('0x20')];_0x998fd9++){var _0x2c9c9a=_0x5c2e5c+_0xb26e3f[_0x35fc('0x30')]['length'];var _0x243871=_0x998fd9===_0xb26e3f['intervals']['length']-0x1?_0x5c2e5c+_0x27eabf['length']+_0x4fc5bc[_0x35fc('0x20')]+0x2:_0x5c2e5c+_0x998fd9+0x1;_0x27eabf[_0x35fc('0x41')](_0x998fd9,0x0,{'type':_0x36fcf9[_0x35fc('0x3')],'app':_0x35fc('0x42'),'appdata':_0xb26e3f[_0x35fc('0x30')][_0x998fd9]+'?'+_0x36fcf9['context']+',${EXTEN},'+_0x2c9c9a+':'+_0x36fcf9['context']+',${EXTEN},'+_0x243871,'exten':_0x36fcf9['exten'],'context':_0x36fcf9[_0x35fc('0x5')],'priority':_0x5c2e5c+_0x998fd9,'VoiceExtensionId':_0x36fcf9['id']});}if(_0xb26e3f[_0x35fc('0x3b')]===_0x35fc('0x43'))_0xb26e3f[_0x35fc('0x44')]=_0x46b9ef(_0x36fcf9,_0xb26e3f['appdata']);_0xb26e3f[_0x35fc('0x45')]=_0x27eabf[_0x35fc('0x20')]?_[_0x35fc('0x46')](_0x27eabf)[_0x35fc('0x45')]+0x1:_0x5c2e5c;_0x10f98b=_[_0x35fc('0x47')](_0x10f98b,_0x27eabf,[_0xb26e3f],_0x4fc5bc);_0x5c2e5c=_[_0x35fc('0x46')](_0x10f98b)[_0x35fc('0x45')]+0x1;}return _0x4ff202(_0x10f98b);})[_0x35fc('0x48')](function(_0x462ceb){_0x79677d(_0x462ceb);});});}return _0x253d6e['define'](_0x35fc('0x49'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xfbd737){var _0x9029e3=this[_0x35fc('0x4a')]({'plain':!![]});var _0x2bc76c=_0x9029e3['type']===_0x35fc('0x10')?_0x1121fa(_0x9029e3):_0x91d024(_0x9029e3);return _0x210d5d(_0x9029e3,_0xfbd737,_['last'](_0x2bc76c)['priority']+0x1)['then'](function(_0x10dd1a){var _0x5dfeb7=_[_0x35fc('0x47')](_0x2bc76c,_0x10dd1a);_0x5dfeb7['push']({'type':_0x9029e3[_0x35fc('0x3')],'app':'Hangup','exten':_0x9029e3[_0x35fc('0x9')],'context':_0x9029e3[_0x35fc('0x5')],'priority':_[_0x35fc('0x46')](_0x5dfeb7)[_0x35fc('0x45')]+0x1,'VoiceExtensionId':_0x9029e3['id']});return _0x5dfeb7;});}}});}; \ No newline at end of file +var _0x3975=['get','last','lodash','./voiceExtension.attributes','type','Set','CDR(type)=','context','exten','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','NoOp','No\x20alias\x20set','outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','split','length','name','param','prefix','phone','${EXTEN}','SIP','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','queue','playback','includes','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','VoiceExtension','voice_extensions'];(function(_0xfbb88b,_0x2458b2){var _0x4c486c=function(_0x5f3ac3){while(--_0x5f3ac3){_0xfbb88b['push'](_0xfbb88b['shift']());}};_0x4c486c(++_0x2458b2);}(_0x3975,0x197));var _0x5397=function(_0x41c590,_0x478b25){_0x41c590=_0x41c590-0x0;var _0x59871e=_0x3975[_0x41c590];return _0x59871e;};'use strict';var _=require(_0x5397('0x0'));var attributes=require(_0x5397('0x1'));module['exports']=function(_0x30e982){var _0x5d2737=_0x30e982['models'];function _0xee7ee0(_0x3278e5){var _0x5529f4=0x2;var _0x428db9=[{'type':_0x3278e5[_0x5397('0x2')],'app':_0x5397('0x3'),'appdata':_0x5397('0x4')+_0x3278e5[_0x5397('0x2')],'context':_0x3278e5[_0x5397('0x5')],'exten':_0x3278e5[_0x5397('0x6')],'priority':_0x5529f4++,'VoiceExtensionId':_0x3278e5['id']},{'type':_0x3278e5[_0x5397('0x2')],'app':_0x3278e5[_0x5397('0x7')]?'Set':'NoOp','appdata':_0x3278e5[_0x5397('0x7')]?'CDR(routeAlias)='+_0x3278e5[_0x5397('0x7')]:'No\x20alias\x20set','context':_0x3278e5[_0x5397('0x5')],'exten':_0x3278e5[_0x5397('0x6')],'priority':_0x5529f4++,'VoiceExtensionId':_0x3278e5['id']}];if(_0x3278e5[_0x5397('0x2')]===_0x5397('0x8')){_0x428db9[_0x5397('0x9')]({'type':_0x5397('0x8'),'app':_0x5397('0x3'),'appdata':_0x5397('0xa')+_0x3278e5['id'],'context':_0x3278e5[_0x5397('0x5')],'exten':_0x3278e5[_0x5397('0x6')],'priority':_0x5529f4++,'VoiceExtensionId':_0x3278e5['id']});}_0x428db9[_0x5397('0x9')]({'type':_0x3278e5['type'],'app':_0x5397('0x3'),'appdata':_0x5397('0xb'),'context':_0x3278e5['context'],'exten':_0x3278e5[_0x5397('0x6')],'priority':_0x5529f4++,'VoiceExtensionId':_0x3278e5['id']},{'type':_0x3278e5['type'],'app':_0x5397('0x3'),'appdata':_0x5397('0xc'),'context':_0x3278e5['context'],'exten':_0x3278e5[_0x5397('0x6')],'priority':_0x5529f4++,'VoiceExtensionId':_0x3278e5['id']},{'type':_0x3278e5[_0x5397('0x2')],'app':_0x5397('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3278e5[_0x5397('0x5')],'exten':_0x3278e5[_0x5397('0x6')],'priority':_0x5529f4++,'VoiceExtensionId':_0x3278e5['id']});return _0x428db9;}function _0x1972bc(_0x394b86){var _0x46888a=0x2;var _0x3bd11f=[{'type':'outbound','app':_0x5397('0x3'),'appdata':_0x5397('0xd'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':'outbound','app':_0x394b86[_0x5397('0x7')]?_0x5397('0x3'):_0x5397('0xe'),'appdata':_0x394b86[_0x5397('0x7')]?'CDR(routeAlias)='+_0x394b86[_0x5397('0x7')]:_0x5397('0xf'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':_0x5397('0x10'),'app':_0x5397('0x3'),'appdata':'CDR(destination)='+(_0x394b86[_0x5397('0x11')]?_0x5397('0x12')+_0x394b86[_0x5397('0x11')]+'}':'${EXTEN}'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86['exten'],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':_0x5397('0x10'),'app':'Set','appdata':_0x5397('0xa')+_0x394b86['id'],'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':'outbound','app':_0x5397('0x13'),'appdata':_0x5397('0x14')+(_0x46888a+0x2)+_0x5397('0x15')+(_0x46888a+0x1)+')','context':_0x394b86['context'],'exten':_0x394b86['exten'],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':_0x5397('0x10'),'app':_0x5397('0x3'),'appdata':_0x394b86[_0x5397('0x11')]?_0x5397('0x16')+_0x394b86[_0x5397('0x11')]+'}':_0x5397('0x17'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':_0x5397('0x10'),'app':_0x5397('0x3'),'appdata':_0x5397('0xb'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':_0x5397('0x10'),'app':_0x5397('0x3'),'appdata':_0x5397('0xc'),'context':_0x394b86['context'],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':'outbound','app':_0x5397('0x3'),'appdata':_0x5397('0x18'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':'outbound','app':_0x5397('0x3'),'appdata':_0x5397('0x19')+_0x394b86['id'],'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']}];if(_0x394b86['hasOwnProperty']('recordingFormat')&&_0x394b86['recordingFormat']!==_0x5397('0x1a')){_0x3bd11f['push']({'type':_0x5397('0x10'),'app':_0x5397('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']},{'type':_0x5397('0x10'),'app':_0x5397('0x3'),'appdata':_0x5397('0x1b')+_0x394b86[_0x5397('0x1c')]||_0x5397('0x1d'),'context':_0x394b86[_0x5397('0x5')],'exten':_0x394b86[_0x5397('0x6')],'priority':_0x46888a++,'VoiceExtensionId':_0x394b86['id']});}return _0x3bd11f;}function _0x90e3f7(_0x3b9f92,_0x283836){var _0x232eb5=[{'name':_0x5397('0x1e'),'param':0x0},{'name':_0x5397('0x1f'),'param':0x1},{'name':_0x5397('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x1ead6e={};var _0x38c4de=_0x283836[_0x5397('0x21')](',');var _0x411196=[];for(var _0x40b80a=0x0;_0x40b80a<_0x232eb5[_0x5397('0x22')];_0x40b80a++){switch(_0x232eb5[_0x40b80a][_0x5397('0x23')]){case'trunk':_0x1ead6e[_0x5397('0x1e')]=_0x38c4de[_0x232eb5[_0x40b80a][_0x5397('0x24')]][_0x5397('0x21')]('/')[0x1];_0x1ead6e['phone']=_0x38c4de[_0x232eb5[_0x40b80a][_0x5397('0x24')]][_0x5397('0x21')]('/')[0x2];_0x1ead6e[_0x5397('0x25')]=_0x1ead6e[_0x5397('0x26')]?_0x1ead6e['phone'][_0x5397('0x21')]('$')[0x0]:undefined;_0x1ead6e['phone']=_0x3b9f92[_0x5397('0x11')]?(_0x1ead6e[_0x5397('0x25')]||'')+_0x5397('0x12')+_0x3b9f92['cutdigits']+'}':(_0x1ead6e[_0x5397('0x25')]||'')+_0x5397('0x27');_0x411196[_0x232eb5[_0x40b80a][_0x5397('0x24')]]=[_0x5397('0x28'),_0x1ead6e[_0x5397('0x1e')],_0x1ead6e['phone']]['join']('/');break;case'options':_0x1ead6e[_0x5397('0x20')]=_0x38c4de[_0x232eb5[_0x40b80a][_0x5397('0x24')]];if(_0x3b9f92[_0x5397('0x1c')]!==_0x5397('0x1a')){if(_0x1ead6e[_0x5397('0x20')][_0x5397('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x1ead6e[_0x5397('0x20')]+=_0x5397('0x2a');}}else{_0x1ead6e['options']=_0x1ead6e[_0x5397('0x20')]['replace'](_0x5397('0x2a'),'');}_0x411196[_0x232eb5[_0x40b80a][_0x5397('0x24')]]=_0x1ead6e[_0x5397('0x20')];break;default:_0x411196[_0x232eb5[_0x40b80a][_0x5397('0x24')]]=_0x38c4de[_0x232eb5[_0x40b80a][_0x5397('0x24')]];}}return _0x411196['join'](',');}function _0x15d163(_0x350792,_0x24793c,_0x4d7c90){return new Promise(function(_0x6a8a8a,_0x1ff194){var _0x1249b1=[];if(_[_0x5397('0x2b')](_0x24793c))return _0x6a8a8a(_0x1249b1);_0x5d2737[_0x5397('0x2c')][_0x5397('0x2d')]({'attributes':['id','interval',_0x5397('0x2e')],'raw':!![]})[_0x5397('0x2f')](function(_0x27928c){for(var _0x35e9d0=0x0,_0x399627=0x0;_0x35e9d0<_0x24793c[_0x5397('0x22')];_0x35e9d0++,_0x399627=0x0){var _0x1ac424=_0x24793c[_0x35e9d0];var _0x21cb92=[];var _0x53f7fd=[];delete _0x1ac424['id'];if(_0x1ac424[_0x5397('0x30')]!==_0x5397('0x31')){_0x1ac424[_0x5397('0x32')]=[_0x1ac424[_0x5397('0x30')]];}else{_0x1ac424[_0x5397('0x32')]=_0x1ac424[_0x5397('0x2e')]?_[_0x5397('0x33')](_[_0x5397('0x34')](_0x27928c,{'IntervalId':_0x1ac424['IntervalId']}),_0x5397('0x30')):[];}_0x1ac424[_0x5397('0x5')]=_0x350792[_0x5397('0x5')];_0x1ac424[_0x5397('0x6')]=_0x350792[_0x5397('0x6')];if(_0x1ac424[_0x5397('0x2')])_0x1ac424[_0x5397('0x2')]=_0x1ac424[_0x5397('0x2')][_0x5397('0x35')]();if(_0x350792[_0x5397('0x2')]===_0x5397('0x10')){if(_0x1ac424['hasOwnProperty']('tag')&&_0x1ac424[_0x5397('0x36')]&&_0x1ac424[_0x5397('0x36')]!=='--'){_0x21cb92[_0x5397('0x9')]({'type':_0x1ac424[_0x5397('0x2')][_0x5397('0x35')](),'app':'Set','appdata':_0x5397('0x37')+_0x1ac424['tag'],'context':_0x350792[_0x5397('0x5')],'exten':_0x350792[_0x5397('0x6')],'priority':_0x1ac424[_0x5397('0x32')]['length']+_0x4d7c90+_0x399627++,'VoiceExtensionId':_0x350792['id']});}_0x21cb92['push']({'type':_0x1ac424['type']['toLowerCase'](),'app':_0x5397('0x13'),'appdata':_0x5397('0x38')+(_0x1ac424[_0x5397('0x39')]?'Set(CALLERID(all)='+_0x1ac424[_0x5397('0x39')]+')':_0x5397('0x3a')),'context':_0x350792[_0x5397('0x5')],'exten':_0x350792[_0x5397('0x6')],'priority':_0x1ac424[_0x5397('0x32')][_0x5397('0x22')]+_0x4d7c90+_0x399627++,'VoiceExtensionId':_0x350792['id']});}else{if(_0x1ac424[_0x5397('0x3b')]('answer')){if([_0x5397('0x3c'),_0x5397('0x3d')][_0x5397('0x3e')](_0x1ac424[_0x5397('0x3f')]['toLowerCase']())&&_0x1ac424[_0x5397('0x40')]!==_0x5397('0x41')){if(_0x1ac424[_0x5397('0x42')]){_0x21cb92[_0x5397('0x9')]({'type':_0x1ac424['type'][_0x5397('0x35')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x350792[_0x5397('0x5')],'exten':_0x350792[_0x5397('0x6')],'priority':_0x1ac424[_0x5397('0x32')][_0x5397('0x22')]+_0x4d7c90+_0x399627++,'VoiceExtensionId':_0x350792['id']});_0x21cb92[_0x5397('0x9')]({'type':_0x1ac424['type'][_0x5397('0x35')](),'app':_0x5397('0x3'),'appdata':_0x5397('0x43'),'context':_0x350792['context'],'exten':_0x350792['exten'],'priority':_0x1ac424['intervals'][_0x5397('0x22')]+_0x4d7c90+_0x399627++,'VoiceExtensionId':_0x350792['id']});}else{_0x21cb92['push']({'type':_0x1ac424[_0x5397('0x2')][_0x5397('0x35')](),'app':_0x5397('0x13'),'appdata':_0x5397('0x44'),'context':_0x350792['context'],'exten':_0x350792[_0x5397('0x6')],'priority':_0x1ac424[_0x5397('0x32')][_0x5397('0x22')]+_0x4d7c90+_0x399627++,'VoiceExtensionId':_0x350792['id']});_0x21cb92[_0x5397('0x9')]({'type':_0x1ac424[_0x5397('0x2')][_0x5397('0x35')](),'app':_0x5397('0x3'),'appdata':_0x5397('0x45'),'context':_0x350792[_0x5397('0x5')],'exten':_0x350792[_0x5397('0x6')],'priority':_0x1ac424['intervals'][_0x5397('0x22')]+_0x4d7c90+_0x399627++,'VoiceExtensionId':_0x350792['id']});}}}}for(var _0x21b19a=0x0;_0x21b19a<_0x1ac424[_0x5397('0x32')]['length'];_0x21b19a++){var _0x130d84=_0x4d7c90+_0x1ac424[_0x5397('0x32')][_0x5397('0x22')];var _0x6dbf43=_0x21b19a===_0x1ac424['intervals'][_0x5397('0x22')]-0x1?_0x4d7c90+_0x21cb92[_0x5397('0x22')]+_0x53f7fd[_0x5397('0x22')]+0x2:_0x4d7c90+_0x21b19a+0x1;_0x21cb92[_0x5397('0x46')](_0x21b19a,0x0,{'type':_0x350792[_0x5397('0x2')],'app':_0x5397('0x47'),'appdata':_0x1ac424[_0x5397('0x32')][_0x21b19a]+'?'+_0x350792[_0x5397('0x5')]+_0x5397('0x48')+_0x130d84+':'+_0x350792[_0x5397('0x5')]+_0x5397('0x48')+_0x6dbf43,'exten':_0x350792['exten'],'context':_0x350792[_0x5397('0x5')],'priority':_0x4d7c90+_0x21b19a,'VoiceExtensionId':_0x350792['id']});}if(_0x1ac424['appType']===_0x5397('0x49'))_0x1ac424[_0x5397('0x4a')]=_0x90e3f7(_0x350792,_0x1ac424[_0x5397('0x4a')]);_0x1ac424['priority']=_0x21cb92['length']?_['last'](_0x21cb92)[_0x5397('0x4b')]+0x1:_0x4d7c90;_0x1249b1=_[_0x5397('0x4c')](_0x1249b1,_0x21cb92,[_0x1ac424],_0x53f7fd);_0x4d7c90=_['last'](_0x1249b1)[_0x5397('0x4b')]+0x1;}return _0x6a8a8a(_0x1249b1);})['catch'](function(_0x236937){_0x1ff194(_0x236937);});});}return _0x30e982['define'](_0x5397('0x4d'),attributes,{'tableName':_0x5397('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x406ce4){var _0x4fb65d=this[_0x5397('0x4f')]({'plain':!![]});var _0x67f368=_0x4fb65d[_0x5397('0x2')]===_0x5397('0x10')?_0x1972bc(_0x4fb65d):_0xee7ee0(_0x4fb65d);return _0x15d163(_0x4fb65d,_0x406ce4,_['last'](_0x67f368)['priority']+0x1)[_0x5397('0x2f')](function(_0x3d4161){var _0x15b28a=_[_0x5397('0x4c')](_0x67f368,_0x3d4161);_0x15b28a[_0x5397('0x9')]({'type':_0x4fb65d[_0x5397('0x2')],'app':'Hangup','exten':_0x4fb65d[_0x5397('0x6')],'context':_0x4fb65d['context'],'priority':_[_0x5397('0x50')](_0x15b28a)['priority']+0x1,'VoiceExtensionId':_0x4fb65d['id']});return _0x15b28a;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 1762c39..a5d63f3 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 _0x38d3=['then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0xd93063,_0x49b618){var _0xf1841=function(_0x1c9b35){while(--_0x1c9b35){_0xd93063['push'](_0xd93063['shift']());}};_0xf1841(++_0x49b618);}(_0x38d3,0x1a7));var _0x338d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x38d3[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});config[_0x338d('0xc')]=_[_0x338d('0xd')](config[_0x338d('0xc')],{'host':_0x338d('0xe'),'port':0x18eb});var socket=require(_0x338d('0xf'))(new Redis(config[_0x338d('0xc')]));require('./voiceExtension.socket')[_0x338d('0x10')](socket);function respondWithRpcPromise(_0x46b524,_0x3c9b82,_0x4733ad){return new BPromise(function(_0x111c22,_0x3d7647){return client['request'](_0x46b524,_0x4733ad)[_0x338d('0x11')](function(_0x261217){logger[_0x338d('0x12')](_0x338d('0x13'),_0x3c9b82,_0x338d('0x14'));logger[_0x338d('0x15')](_0x338d('0x16'),_0x3c9b82,_0x338d('0x14'),JSON['stringify'](_0x261217));if(_0x261217['error']){if(_0x261217['error'][_0x338d('0x17')]===0x1f4){logger[_0x338d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,_0x261217[_0x338d('0x18')]['message']);return _0x3d7647(_0x261217[_0x338d('0x18')][_0x338d('0x19')]);}logger[_0x338d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,_0x261217['error']['message']);return _0x111c22(_0x261217[_0x338d('0x18')]['message']);}else{logger[_0x338d('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,'request\x20sent');_0x111c22(_0x261217[_0x338d('0x1a')][_0x338d('0x19')]);}})[_0x338d('0x1b')](function(_0x2c1e24){logger[_0x338d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c9b82,_0x2c1e24);_0x3d7647(_0x2c1e24);});});}exports[_0x338d('0x1c')]=function(_0x27527d){var _0x4698b8=this;return new Promise(function(_0x51d50f,_0x4213b0){return db[_0x338d('0x1d')][_0x338d('0x1e')]({'raw':_0x27527d[_0x338d('0x1f')]?_0x27527d[_0x338d('0x1f')][_0x338d('0x20')]===undefined?!![]:![]:!![],'where':_0x27527d[_0x338d('0x1f')]?_0x27527d[_0x338d('0x1f')][_0x338d('0x21')]||null:null,'attributes':_0x27527d[_0x338d('0x1f')]?_0x27527d[_0x338d('0x1f')][_0x338d('0x22')]||null:null,'limit':_0x27527d['options']?_0x27527d[_0x338d('0x1f')][_0x338d('0x23')]||null:null,'include':_0x27527d[_0x338d('0x1f')]?_0x27527d['options']['include']?_['map'](_0x27527d['options'][_0x338d('0x24')],function(_0x1fb38f){return{'model':db[_0x1fb38f[_0x338d('0x25')]],'as':_0x1fb38f['as'],'attributes':_0x1fb38f[_0x338d('0x22')],'include':_0x1fb38f[_0x338d('0x24')]?_[_0x338d('0x26')](_0x1fb38f[_0x338d('0x24')],function(_0x2e50ec){return{'model':db[_0x2e50ec[_0x338d('0x25')]],'as':_0x2e50ec['as'],'attributes':_0x2e50ec[_0x338d('0x22')],'include':_0x2e50ec['include']?_[_0x338d('0x26')](_0x2e50ec[_0x338d('0x24')],function(_0x6e99c4){return{'model':db[_0x6e99c4['model']],'as':_0x6e99c4['as'],'attributes':_0x6e99c4[_0x338d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x338d('0x11')](function(_0x4bb176){logger[_0x338d('0x12')]('GetVoiceExtension',_0x27527d);logger[_0x338d('0x15')](_0x338d('0x1c'),_0x27527d,JSON[_0x338d('0x27')](_0x4bb176));_0x51d50f(_0x4bb176);})[_0x338d('0x1b')](function(_0x3055a7){logger[_0x338d('0x18')]('GetVoiceExtension',_0x3055a7[_0x338d('0x19')],_0x27527d);_0x4213b0(_0x4698b8[_0x338d('0x18')](0x1f4,_0x3055a7['message']));});});}; \ No newline at end of file +var _0x29eb=['where','limit','include','map','model','attributes','GetVoiceExtension','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceExtension','options','raw'];(function(_0x5edc27,_0x24d721){var _0x47ea49=function(_0x380cf3){while(--_0x380cf3){_0x5edc27['push'](_0x5edc27['shift']());}};_0x47ea49(++_0x24d721);}(_0x29eb,0x1c5));var _0xb29e=function(_0x209497,_0x311317){_0x209497=_0x209497-0x0;var _0x4882d4=_0x29eb[_0x209497];return _0x4882d4;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var moment=require(_0xb29e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb29e('0x3'));var fs=require('fs');var Redis=require(_0xb29e('0x4'));var db=require(_0xb29e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb29e('0x6'))('rpc');var config=require(_0xb29e('0x7'));var jayson=require(_0xb29e('0x8'));var client=jayson[_0xb29e('0x9')][_0xb29e('0xa')]({'port':0x232a});config[_0xb29e('0xb')]=_[_0xb29e('0xc')](config['redis'],{'host':_0xb29e('0xd'),'port':0x18eb});var socket=require(_0xb29e('0xe'))(new Redis(config[_0xb29e('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x12eebb,_0x521d07,_0x57d868){return new BPromise(function(_0x3844ef,_0x449db2){return client['request'](_0x12eebb,_0x57d868)[_0xb29e('0xf')](function(_0x2dc3d7){logger[_0xb29e('0x10')](_0xb29e('0x11'),_0x521d07,_0xb29e('0x12'));logger['debug'](_0xb29e('0x13'),_0x521d07,'request\x20sent',JSON['stringify'](_0x2dc3d7));if(_0x2dc3d7['error']){if(_0x2dc3d7[_0xb29e('0x14')][_0xb29e('0x15')]===0x1f4){logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x2dc3d7[_0xb29e('0x14')][_0xb29e('0x16')]);return _0x449db2(_0x2dc3d7['error'][_0xb29e('0x16')]);}logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x2dc3d7[_0xb29e('0x14')]['message']);return _0x3844ef(_0x2dc3d7['error'][_0xb29e('0x16')]);}else{logger[_0xb29e('0x10')](_0xb29e('0x11'),_0x521d07,_0xb29e('0x12'));_0x3844ef(_0x2dc3d7[_0xb29e('0x17')][_0xb29e('0x16')]);}})[_0xb29e('0x18')](function(_0x33f51f){logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x33f51f);_0x449db2(_0x33f51f);});});}exports['GetVoiceExtension']=function(_0x112e4f){var _0x4652d3=this;return new Promise(function(_0x467923,_0x53d71f){return db[_0xb29e('0x19')]['findAll']({'raw':_0x112e4f[_0xb29e('0x1a')]?_0x112e4f[_0xb29e('0x1a')][_0xb29e('0x1b')]===undefined?!![]:![]:!![],'where':_0x112e4f[_0xb29e('0x1a')]?_0x112e4f[_0xb29e('0x1a')][_0xb29e('0x1c')]||null:null,'attributes':_0x112e4f[_0xb29e('0x1a')]?_0x112e4f['options']['attributes']||null:null,'limit':_0x112e4f[_0xb29e('0x1a')]?_0x112e4f[_0xb29e('0x1a')][_0xb29e('0x1d')]||null:null,'include':_0x112e4f[_0xb29e('0x1a')]?_0x112e4f[_0xb29e('0x1a')][_0xb29e('0x1e')]?_[_0xb29e('0x1f')](_0x112e4f['options']['include'],function(_0xedd5b3){return{'model':db[_0xedd5b3[_0xb29e('0x20')]],'as':_0xedd5b3['as'],'attributes':_0xedd5b3[_0xb29e('0x21')],'include':_0xedd5b3['include']?_['map'](_0xedd5b3['include'],function(_0x9840cc){return{'model':db[_0x9840cc[_0xb29e('0x20')]],'as':_0x9840cc['as'],'attributes':_0x9840cc[_0xb29e('0x21')],'include':_0x9840cc[_0xb29e('0x1e')]?_[_0xb29e('0x1f')](_0x9840cc[_0xb29e('0x1e')],function(_0x375abe){return{'model':db[_0x375abe[_0xb29e('0x20')]],'as':_0x375abe['as'],'attributes':_0x375abe[_0xb29e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb29e('0xf')](function(_0x525a54){logger[_0xb29e('0x10')](_0xb29e('0x22'),_0x112e4f);logger[_0xb29e('0x23')]('GetVoiceExtension',_0x112e4f,JSON[_0xb29e('0x24')](_0x525a54));_0x467923(_0x525a54);})[_0xb29e('0x18')](function(_0xc0d1f){logger[_0xb29e('0x14')]('GetVoiceExtension',_0xc0d1f[_0xb29e('0x16')],_0x112e4f);_0x53d71f(_0x4652d3[_0xb29e('0x14')](0x1f4,_0xc0d1f[_0xb29e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 04334a4..65aa09a 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x586d68,_0x25fc92){_0x586d68=_0x586d68-0x0;var _0x2d66f4=_0x1cb9[_0x586d68];return _0x2d66f4;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x22775e,_0x54a4ab){var _0x46b090=function(_0x43151e){while(--_0x43151e){_0x22775e['push'](_0x22775e['shift']());}};_0x46b090(++_0x54a4ab);}(_0x326f,0xd1));var _0xf326=function(_0x50184d,_0x342f7d){_0x50184d=_0x50184d-0x0;var _0x572d11=_0x326f[_0x50184d];return _0x572d11;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 93f1609..492a285 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 _0xb016=['get','isAuthenticated','index','show','getMessages','post','create','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x68c4d9,_0x419b3c){var _0x62da93=function(_0x51ae9a){while(--_0x51ae9a){_0x68c4d9['push'](_0x68c4d9['shift']());}};_0x62da93(++_0x419b3c);}(_0xb016,0x159));var _0x6b01=function(_0x14492d,_0x20ef09){_0x14492d=_0x14492d-0x0;var _0x511683=_0xb016[_0x14492d];return _0x511683;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./voiceMail.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id/messages',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0xd')]);router['put']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth[_0x6b01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post'];(function(_0x5a1ccd,_0x214934){var _0x2e6710=function(_0x43790c){while(--_0x43790c){_0x5a1ccd['push'](_0x5a1ccd['shift']());}};_0x2e6710(++_0x214934);}(_0x2542,0x169));var _0x2254=function(_0x515fb1,_0x4204a3){_0x515fb1=_0x515fb1-0x0;var _0x364731=_0x2542[_0x515fb1];return _0x364731;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index b88d02f..6638cc3 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 _0xbab3=['exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','getDataValue','fullname','\x20-\x20','mailbox','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbab3,0x10f));var _0x3bab=function(_0x18959e,_0x24e830){_0x18959e=_0x18959e-0x0;var _0x308aba=_0xbab3[_0x18959e];return _0x308aba;};'use strict';var Sequelize=require(_0x3bab('0x0'));module[_0x3bab('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3bab('0x2'),'unique':_0x3bab('0x3')},'mailbox':{'type':Sequelize[_0x3bab('0x4')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3bab('0x4')]},'fullname':{'type':Sequelize[_0x3bab('0x4')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x19d92){this[_0x3bab('0x5')](_0x3bab('0x6'),typeof _0x19d92===_0x3bab('0x7')&&_0x19d92['trim']()?_0x19d92[_0x3bab('0x8')]():null);}},'pager':{'type':Sequelize[_0x3bab('0x4')]},'tz':{'type':Sequelize[_0x3bab('0x4')],'defaultValue':_0x3bab('0x9')},'attach':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3bab('0x4')]},'callback':{'type':Sequelize[_0x3bab('0x4')]},'review':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3bab('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3bab('0xa')](_0x3bab('0xb'),'no'),'defaultValue':_0x3bab('0xb'),'allowNull':![]},'stamp':{'type':_0x3bab('0xc')},'emailsubject':{'type':Sequelize[_0x3bab('0x4')]},'emailbody':{'type':Sequelize[_0x3bab('0x4')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3bab('0xd')](_0x3bab('0xe'))+_0x3bab('0xf')+this['getDataValue'](_0x3bab('0x10'));}}}; \ No newline at end of file +var _0xe7e4=['\x20-\x20','mailbox','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','string','trim','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','fullname'];(function(_0x250beb,_0x90803a){var _0x3438b0=function(_0x43ba4a){while(--_0x43ba4a){_0x250beb['push'](_0x250beb['shift']());}};_0x3438b0(++_0x90803a);}(_0xe7e4,0x1e2));var _0x4e7e=function(_0x3e70d0,_0x1fdc23){_0x3e70d0=_0x3e70d0-0x0;var _0x3399fe=_0xe7e4[_0x3e70d0];return _0x3399fe;};'use strict';var Sequelize=require(_0x4e7e('0x0'));module[_0x4e7e('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x4e7e('0x2'),'unique':_0x4e7e('0x3')},'mailbox':{'type':Sequelize[_0x4e7e('0x4')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x4e7e('0x4')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4e7e('0x4')],'validate':{'isEmail':!![]},'set':function(_0x5bd0e4){this[_0x4e7e('0x5')]('email',typeof _0x5bd0e4===_0x4e7e('0x6')&&_0x5bd0e4[_0x4e7e('0x7')]()?_0x5bd0e4['trim']():null);}},'pager':{'type':Sequelize[_0x4e7e('0x4')]},'tz':{'type':Sequelize[_0x4e7e('0x4')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x4e7e('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x4e7e('0x8')](_0x4e7e('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x4e7e('0x8')](_0x4e7e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x4e7e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4e7e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4e7e('0x8')](_0x4e7e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4e7e('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4e7e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4e7e('0x8')]('yes','no'),'defaultValue':_0x4e7e('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4e7e('0x8')](_0x4e7e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4e7e('0x8')](_0x4e7e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4e7e('0x8')](_0x4e7e('0x9'),'no'),'defaultValue':_0x4e7e('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x4e7e('0x4')]},'emailbody':{'type':Sequelize[_0x4e7e('0x4')]},'maxsecs':{'type':Sequelize[_0x4e7e('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4e7e('0xc')],'get':function(){return this['getDataValue'](_0x4e7e('0xd'))+_0x4e7e('0xe')+this['getDataValue'](_0x4e7e('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 8226bb3..2360262 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 _0xeffd=['create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','nolimit','order','pick','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','options','find'];(function(_0x5cf217,_0x5bbb33){var _0x8835bc=function(_0x37043d){while(--_0x37043d){_0x5cf217['push'](_0x5cf217['shift']());}};_0x8835bc(++_0x5bbb33);}(_0xeffd,0x6b));var _0xdeff=function(_0x4fee9a,_0x2883f3){_0x4fee9a=_0x4fee9a-0x0;var _0x23ec7b=_0xeffd[_0x4fee9a];return _0x23ec7b;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461699,_0x116bf9){_0x116bf9=_0x116bf9||0xcc;return function(_0x4952f2){if(_0x4952f2){return _0x461699[_0xdeff('0x1d')](_0x116bf9);}return _0x461699['status'](_0x116bf9)['end']();};}function respondWithResult(_0x3e56a1,_0x47410f){_0x47410f=_0x47410f||0xc8;return function(_0x1585e8){if(_0x1585e8){return _0x3e56a1[_0xdeff('0x1e')](_0x47410f)['json'](_0x1585e8);}};}function respondWithFilteredResult(_0x826132,_0x314ded){return function(_0xea6c4){if(_0xea6c4){var _0x391633=typeof _0x314ded[_0xdeff('0x1f')]===_0xdeff('0x20')&&typeof _0x314ded['limit']==='undefined';var _0x7440af=_0xea6c4['count'];var _0x5c9837=_0x391633?0x0:_0x314ded[_0xdeff('0x1f')];var _0x369e13=_0x391633?_0xea6c4['count']:_0x314ded[_0xdeff('0x1f')]+_0x314ded[_0xdeff('0x21')];var _0x1ab1fa;if(_0x369e13>=_0x7440af){_0x369e13=_0x7440af;_0x1ab1fa=0xc8;}else{_0x1ab1fa=0xce;}_0x826132[_0xdeff('0x1e')](_0x1ab1fa);return _0x826132[_0xdeff('0x22')](_0xdeff('0x23'),_0x5c9837+'-'+_0x369e13+'/'+_0x7440af)[_0xdeff('0x24')](_0xea6c4);}return null;};}function patchUpdates(_0x919c93){return function(_0x488faa){try{jsonpatch['apply'](_0x488faa,_0x919c93,!![]);}catch(_0x56cb84){return BPromise[_0xdeff('0x25')](_0x56cb84);}return _0x488faa['save']();};}function saveUpdates(_0x189627,_0x91c0b4){return function(_0x543653){if(_0x543653){return _0x543653[_0xdeff('0x26')](_0x189627)[_0xdeff('0x27')](function(_0x4eb2a8){return _0x4eb2a8;});}return null;};}function removeEntity(_0x5dbe96,_0x3b2554){return function(_0x15c425){if(_0x15c425){return _0x15c425[_0xdeff('0x28')]()[_0xdeff('0x27')](function(){var _0x32add9=_0x15c425['get']({'plain':!![]});var _0xb08f19=_0xdeff('0x29');return db[_0xdeff('0x2a')][_0xdeff('0x28')]({'where':{'type':_0xb08f19,'resourceId':_0x32add9['id']}})[_0xdeff('0x27')](function(){return _0x15c425;});})[_0xdeff('0x27')](function(){_0x5dbe96[_0xdeff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb72,_0x1a546c){return function(_0x53b168){if(!_0x53b168){_0x31bb72['sendStatus'](0x194);}return _0x53b168;};}function handleError(_0x830be4,_0x2ea8e9){_0x2ea8e9=_0x2ea8e9||0x1f4;return function(_0x16b2d0){logger[_0xdeff('0x2b')](_0x16b2d0[_0xdeff('0x2c')]);if(_0x16b2d0[_0xdeff('0x2d')]){delete _0x16b2d0[_0xdeff('0x2d')];}_0x830be4['status'](_0x2ea8e9)[_0xdeff('0x2e')](_0x16b2d0);};}exports[_0xdeff('0x2f')]=function(_0x34e258,_0x5045b8){var _0x59f7a0={},_0x346743={},_0x505e3f={'count':0x0,'rows':[]};var _0x69842a=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x189a51){return{'name':_0x189a51['fieldName'],'type':_0x189a51['type'][_0xdeff('0x32')]};});_0x346743[_0xdeff('0x33')]=_[_0xdeff('0x30')](_0x69842a,_0xdeff('0x2d'));_0x346743['query']=_[_0xdeff('0x34')](_0x34e258[_0xdeff('0x35')]);_0x346743[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x346743[_0xdeff('0x33')],_0x346743[_0xdeff('0x35')]);_0x59f7a0[_0xdeff('0x38')]=_['intersection'](_0x346743[_0xdeff('0x33')],qs['fields'](_0x34e258[_0xdeff('0x35')][_0xdeff('0x39')]));_0x59f7a0[_0xdeff('0x38')]=_0x59f7a0[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x59f7a0[_0xdeff('0x38')]:_0x346743['model'];if(!_0x34e258[_0xdeff('0x35')][_0xdeff('0x3b')]('nolimit')){_0x59f7a0[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x21')]);_0x59f7a0[_0xdeff('0x1f')]=qs[_0xdeff('0x1f')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x1f')]);}_0x59f7a0['order']=qs[_0xdeff('0x3c')](_0x34e258['query'][_0xdeff('0x3c')]);_0x59f7a0[_0xdeff('0x3d')]=qs[_0xdeff('0x36')](_['pick'](_0x34e258[_0xdeff('0x35')],_0x346743[_0xdeff('0x36')]),_0x69842a);if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x59f7a0[_0xdeff('0x3d')]=_['merge'](_0x59f7a0[_0xdeff('0x3d')],{'$or':_['map'](_0x69842a,function(_0x393d75){if(_0x393d75[_0xdeff('0x3f')]!=='VIRTUAL'){var _0x30609b={};_0x30609b[_0x393d75[_0xdeff('0x2d')]]={'$like':'%'+_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x30609b;}})});}_0x59f7a0=_[_0xdeff('0x40')]({},_0x59f7a0,_0x34e258['options']);var _0x3d8a33={'where':_0x59f7a0[_0xdeff('0x3d')]};return db[_0xdeff('0x31')][_0xdeff('0x41')](_0x3d8a33)[_0xdeff('0x27')](function(_0x5dfbb3){_0x505e3f['count']=_0x5dfbb3;if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x42')]){_0x59f7a0[_0xdeff('0x43')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x44')](_0x59f7a0);})[_0xdeff('0x27')](function(_0x2cd68a){_0x505e3f['rows']=_0x2cd68a;return _0x505e3f;})[_0xdeff('0x27')](respondWithFilteredResult(_0x5045b8,_0x59f7a0))[_0xdeff('0x45')](handleError(_0x5045b8,null));};exports[_0xdeff('0x46')]=function(_0x54fa5b,_0x1c3532){var _0x2c5eee={'raw':!![],'where':{'id':_0x54fa5b[_0xdeff('0x47')]['id']}},_0x14dc7b={};_0x14dc7b['model']=_[_0xdeff('0x34')](db[_0xdeff('0x31')][_0xdeff('0x48')]);_0x14dc7b[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x54fa5b[_0xdeff('0x35')]);_0x14dc7b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x14dc7b['model'],_0x14dc7b[_0xdeff('0x35')]);_0x2c5eee[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x14dc7b[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x54fa5b['query'][_0xdeff('0x39')]));_0x2c5eee[_0xdeff('0x38')]=_0x2c5eee[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x2c5eee[_0xdeff('0x38')]:_0x14dc7b['model'];if(_0x54fa5b[_0xdeff('0x35')]['includeAll']){_0x2c5eee[_0xdeff('0x43')]=[{'all':!![]}];}_0x2c5eee=_[_0xdeff('0x40')]({},_0x2c5eee,_0x54fa5b[_0xdeff('0x49')]);return db[_0xdeff('0x31')][_0xdeff('0x4a')](_0x2c5eee)[_0xdeff('0x27')](handleEntityNotFound(_0x1c3532,null))['then'](respondWithResult(_0x1c3532,null))['catch'](handleError(_0x1c3532,null));};exports[_0xdeff('0x4b')]=function(_0xf91a72,_0x3dc206){return db['VoiceMail']['create'](_0xf91a72[_0xdeff('0x4c')],{})[_0xdeff('0x27')](function(_0x497d9f){var _0x23f17d=_0xf91a72[_0xdeff('0x4d')][_0xdeff('0x4e')]({'plain':!![]});if(!_0x23f17d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f17d[_0xdeff('0x4f')]===_0xdeff('0x4d')){var _0x1ca376=_0x497d9f['get']({'plain':!![]});var _0xce8379=_0xdeff('0x29');return db[_0xdeff('0x50')][_0xdeff('0x4a')]({'where':{'name':_0xce8379,'userProfileId':_0x23f17d[_0xdeff('0x51')]},'raw':!![]})[_0xdeff('0x27')](function(_0x2c7fa4){if(_0x2c7fa4&&_0x2c7fa4['autoAssociation']===0x0){return db[_0xdeff('0x2a')][_0xdeff('0x4b')]({'name':_0x1ca376['name'],'resourceId':_0x1ca376['id'],'type':_0x2c7fa4[_0xdeff('0x2d')],'sectionId':_0x2c7fa4['id']},{})[_0xdeff('0x27')](function(){return _0x497d9f;});}else{return _0x497d9f;}})[_0xdeff('0x45')](function(_0x33482b){logger[_0xdeff('0x2b')](_0xdeff('0x52'),_0x33482b);throw _0x33482b;});}return _0x497d9f;})[_0xdeff('0x27')](respondWithResult(_0x3dc206,0xc9))[_0xdeff('0x45')](handleError(_0x3dc206,null));};exports['update']=function(_0x1b7eb3,_0x3a518d){if(_0x1b7eb3[_0xdeff('0x4c')]['id']){delete _0x1b7eb3['body']['id'];}return db['VoiceMail'][_0xdeff('0x4a')]({'where':{'id':_0x1b7eb3[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x3a518d,null))[_0xdeff('0x27')](saveUpdates(_0x1b7eb3[_0xdeff('0x4c')],null))[_0xdeff('0x27')](respondWithResult(_0x3a518d,null))['catch'](handleError(_0x3a518d,null));};exports['destroy']=function(_0x38338b,_0x1cc2c1){return db['VoiceMail']['find']({'where':{'id':_0x38338b[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x1cc2c1,null))['then'](removeEntity(_0x1cc2c1,null))[_0xdeff('0x45')](handleError(_0x1cc2c1,null));};exports[_0xdeff('0x53')]=function(_0x577fa8,_0x14fa7f,_0xe731d8){return db['VoiceMail'][_0xdeff('0x54')]({'where':{'id':_0x577fa8[_0xdeff('0x47')]['id']}})['then'](handleEntityNotFound(_0x14fa7f,null))[_0xdeff('0x27')](function(_0x152187){var _0x2a83ac;var _0x592ea6={},_0x47e86d={};_0x47e86d[_0xdeff('0x33')]=_['keys'](db[_0xdeff('0x55')][_0xdeff('0x48')]);_0x47e86d[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x577fa8[_0xdeff('0x35')]);_0x47e86d['filters']=_['intersection'](_0x47e86d[_0xdeff('0x33')],_0x47e86d[_0xdeff('0x35')]);_0x592ea6[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x47e86d[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x577fa8['query'][_0xdeff('0x39')]));_0x592ea6['attributes']=_0x592ea6[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x592ea6[_0xdeff('0x38')]:_0x47e86d[_0xdeff('0x33')];if(!_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3b')](_0xdeff('0x56'))){_0x592ea6[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x577fa8['query'][_0xdeff('0x21')]);_0x592ea6['offset']=qs[_0xdeff('0x1f')](_0x577fa8[_0xdeff('0x35')]['offset']);}_0x592ea6[_0xdeff('0x57')]=qs['sort'](_0x577fa8[_0xdeff('0x35')]['sort']);_0x592ea6['where']=qs[_0xdeff('0x36')](_[_0xdeff('0x58')](_0x577fa8['query'],_0x47e86d[_0xdeff('0x36')]));if(_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x592ea6[_0xdeff('0x3d')]=_[_0xdeff('0x40')](_0x592ea6[_0xdeff('0x3d')],{'$or':_[_0xdeff('0x30')](_0x592ea6[_0xdeff('0x38')],function(_0x46046a){var _0x517ca7={};_0x517ca7[_0x46046a]={'$like':'%'+_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x517ca7;})});}_0x592ea6['where']=_['merge'](_0x592ea6[_0xdeff('0x3d')],{'mailboxuser':_0x152187[_0xdeff('0x59')]});_0x592ea6=_['merge']({},_0x592ea6,_0x577fa8[_0xdeff('0x49')]);return db[_0xdeff('0x55')][_0xdeff('0x5a')](_0x592ea6)[_0xdeff('0x27')](respondWithFilteredResult(_0x14fa7f,_0x592ea6));})[_0xdeff('0x45')](handleError(_0x14fa7f,null));}; \ No newline at end of file +var _0x750a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceMail','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','body','getMessages','findOne','VoiceMailMessage','length','findAndCountAll','rimraf','request-promise','moment','bluebird'];(function(_0x316efa,_0x20a1e1){var _0x4d96cc=function(_0x4a0648){while(--_0x4a0648){_0x316efa['push'](_0x316efa['shift']());}};_0x4d96cc(++_0x20a1e1);}(_0x750a,0x140));var _0xa750=function(_0x12b08d,_0x5dfe1a){_0x12b08d=_0x12b08d-0x0;var _0x2398d8=_0x750a[_0x12b08d];return _0x2398d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){var _0x1b80a5=_0x2ec6c4[_0xa750('0x1e')]({'plain':!![]});var _0x3001bc=_0xa750('0x1f');return db[_0xa750('0x20')][_0xa750('0x1c')]({'where':{'type':_0x3001bc,'resourceId':_0x1b80a5['id']}})[_0xa750('0x1d')](function(){return _0x2ec6c4;});})[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x310e2d,_0x4ffff4){return function(_0x3d3923){if(!_0x3d3923){_0x310e2d[_0xa750('0x21')](0x194);}return _0x3d3923;};}function handleError(_0x21cd2c,_0x4cceee){_0x4cceee=_0x4cceee||0x1f4;return function(_0x35ab53){logger[_0xa750('0x22')](_0x35ab53[_0xa750('0x23')]);if(_0x35ab53[_0xa750('0x24')]){delete _0x35ab53['name'];}_0x21cd2c[_0xa750('0x15')](_0x4cceee)[_0xa750('0x25')](_0x35ab53);};}exports[_0xa750('0x26')]=function(_0x2aef3a,_0x2c5253){var _0x59ab33={},_0x46cc11={},_0x4c2c9e={'count':0x0,'rows':[]};var _0x2d0e93=_[_0xa750('0x27')](db['VoiceMail'][_0xa750('0x28')],function(_0x6bc25d){return{'name':_0x6bc25d[_0xa750('0x29')],'type':_0x6bc25d[_0xa750('0x2a')][_0xa750('0x2b')]};});_0x46cc11[_0xa750('0x2c')]=_[_0xa750('0x27')](_0x2d0e93,_0xa750('0x24'));_0x46cc11['query']=_[_0xa750('0x2d')](_0x2aef3a['query']);_0x46cc11[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],_0x46cc11[_0xa750('0x30')]);_0x59ab33['attributes']=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],qs['fields'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x31')]));_0x59ab33[_0xa750('0x32')]=_0x59ab33[_0xa750('0x32')]['length']?_0x59ab33[_0xa750('0x32')]:_0x46cc11['model'];if(!_0x2aef3a['query'][_0xa750('0x33')](_0xa750('0x34'))){_0x59ab33[_0xa750('0x35')]=qs['limit'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x35')]);_0x59ab33[_0xa750('0x17')]=qs['offset'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x17')]);}_0x59ab33[_0xa750('0x36')]=qs['sort'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x37')]);_0x59ab33[_0xa750('0x38')]=qs['filters'](_[_0xa750('0x39')](_0x2aef3a[_0xa750('0x30')],_0x46cc11[_0xa750('0x2e')]),_0x2d0e93);if(_0x2aef3a[_0xa750('0x30')]['filter']){_0x59ab33['where']=_[_0xa750('0x3a')](_0x59ab33[_0xa750('0x38')],{'$or':_['map'](_0x2d0e93,function(_0x43dc3a){if(_0x43dc3a[_0xa750('0x2a')]!==_0xa750('0x3b')){var _0x1166ff={};_0x1166ff[_0x43dc3a[_0xa750('0x24')]]={'$like':'%'+_0x2aef3a['query'][_0xa750('0x3c')]+'%'};return _0x1166ff;}})});}_0x59ab33=_[_0xa750('0x3a')]({},_0x59ab33,_0x2aef3a[_0xa750('0x3d')]);var _0x134874={'where':_0x59ab33[_0xa750('0x38')]};return db[_0xa750('0x3e')][_0xa750('0x19')](_0x134874)['then'](function(_0x3daa38){_0x4c2c9e['count']=_0x3daa38;if(_0x2aef3a[_0xa750('0x30')]['includeAll']){_0x59ab33[_0xa750('0x3f')]=[{'all':!![]}];}return db[_0xa750('0x3e')][_0xa750('0x40')](_0x59ab33);})[_0xa750('0x1d')](function(_0x430d60){_0x4c2c9e[_0xa750('0x41')]=_0x430d60;return _0x4c2c9e;})[_0xa750('0x1d')](respondWithFilteredResult(_0x2c5253,_0x59ab33))[_0xa750('0x42')](handleError(_0x2c5253,null));};exports[_0xa750('0x43')]=function(_0x108a1a,_0x36a8d6){var _0x1458f1={'raw':!![],'where':{'id':_0x108a1a[_0xa750('0x44')]['id']}},_0x3ec860={};_0x3ec860[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x3e')][_0xa750('0x28')]);_0x3ec860[_0xa750('0x30')]=_[_0xa750('0x2d')](_0x108a1a['query']);_0x3ec860[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],_0x3ec860[_0xa750('0x30')]);_0x1458f1[_0xa750('0x32')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x108a1a[_0xa750('0x30')]['fields']));_0x1458f1[_0xa750('0x32')]=_0x1458f1[_0xa750('0x32')]['length']?_0x1458f1[_0xa750('0x32')]:_0x3ec860[_0xa750('0x2c')];if(_0x108a1a[_0xa750('0x30')][_0xa750('0x45')]){_0x1458f1[_0xa750('0x3f')]=[{'all':!![]}];}_0x1458f1=_[_0xa750('0x3a')]({},_0x1458f1,_0x108a1a[_0xa750('0x3d')]);return db[_0xa750('0x3e')][_0xa750('0x46')](_0x1458f1)[_0xa750('0x1d')](handleEntityNotFound(_0x36a8d6,null))['then'](respondWithResult(_0x36a8d6,null))[_0xa750('0x42')](handleError(_0x36a8d6,null));};exports[_0xa750('0x47')]=function(_0x58afd2,_0x93e49f){return db[_0xa750('0x3e')][_0xa750('0x47')](_0x58afd2['body'],{})[_0xa750('0x1d')](function(_0x3fc623){var _0x1e5a9a=_0x58afd2[_0xa750('0x48')]['get']({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0xa750('0x49'));if(_0x1e5a9a[_0xa750('0x4a')]===_0xa750('0x48')){var _0xed4f88=_0x3fc623['get']({'plain':!![]});var _0x203f2a=_0xa750('0x1f');return db['UserProfileSection'][_0xa750('0x46')]({'where':{'name':_0x203f2a,'userProfileId':_0x1e5a9a['userProfileId']},'raw':!![]})[_0xa750('0x1d')](function(_0x69995b){if(_0x69995b&&_0x69995b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xed4f88[_0xa750('0x24')],'resourceId':_0xed4f88['id'],'type':_0x69995b[_0xa750('0x24')],'sectionId':_0x69995b['id']},{})['then'](function(){return _0x3fc623;});}else{return _0x3fc623;}})[_0xa750('0x42')](function(_0x1a79a9){logger[_0xa750('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79a9);throw _0x1a79a9;});}return _0x3fc623;})['then'](respondWithResult(_0x93e49f,0xc9))['catch'](handleError(_0x93e49f,null));};exports['update']=function(_0x3c34d4,_0x4a1b5d){if(_0x3c34d4[_0xa750('0x4b')]['id']){delete _0x3c34d4[_0xa750('0x4b')]['id'];}return db['VoiceMail'][_0xa750('0x46')]({'where':{'id':_0x3c34d4['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4a1b5d,null))['then'](saveUpdates(_0x3c34d4['body'],null))['then'](respondWithResult(_0x4a1b5d,null))['catch'](handleError(_0x4a1b5d,null));};exports[_0xa750('0x1c')]=function(_0x40dac2,_0x5f1313){return db['VoiceMail']['find']({'where':{'id':_0x40dac2[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x5f1313,null))[_0xa750('0x1d')](removeEntity(_0x5f1313,null))[_0xa750('0x42')](handleError(_0x5f1313,null));};exports[_0xa750('0x4c')]=function(_0x13528a,_0x599e7e,_0x590b1c){return db[_0xa750('0x3e')][_0xa750('0x4d')]({'where':{'id':_0x13528a[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x599e7e,null))[_0xa750('0x1d')](function(_0x5a3cd5){var _0x4030b3;var _0xaa63be={},_0x2c7dd0={};_0x2c7dd0[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x4e')][_0xa750('0x28')]);_0x2c7dd0[_0xa750('0x30')]=_['keys'](_0x13528a[_0xa750('0x30')]);_0x2c7dd0[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],_0x2c7dd0[_0xa750('0x30')]);_0xaa63be['attributes']=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x13528a[_0xa750('0x30')][_0xa750('0x31')]));_0xaa63be[_0xa750('0x32')]=_0xaa63be[_0xa750('0x32')][_0xa750('0x4f')]?_0xaa63be[_0xa750('0x32')]:_0x2c7dd0[_0xa750('0x2c')];if(!_0x13528a[_0xa750('0x30')][_0xa750('0x33')](_0xa750('0x34'))){_0xaa63be[_0xa750('0x35')]=qs[_0xa750('0x35')](_0x13528a[_0xa750('0x30')]['limit']);_0xaa63be[_0xa750('0x17')]=qs['offset'](_0x13528a[_0xa750('0x30')][_0xa750('0x17')]);}_0xaa63be[_0xa750('0x36')]=qs['sort'](_0x13528a[_0xa750('0x30')][_0xa750('0x37')]);_0xaa63be[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x39')](_0x13528a[_0xa750('0x30')],_0x2c7dd0['filters']));if(_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]){_0xaa63be['where']=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'$or':_[_0xa750('0x27')](_0xaa63be[_0xa750('0x32')],function(_0x3255c7){var _0x1b7597={};_0x1b7597[_0x3255c7]={'$like':'%'+_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]+'%'};return _0x1b7597;})});}_0xaa63be[_0xa750('0x38')]=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'mailboxuser':_0x5a3cd5['mailbox']});_0xaa63be=_['merge']({},_0xaa63be,_0x13528a[_0xa750('0x3d')]);return db[_0xa750('0x4e')][_0xa750('0x50')](_0xaa63be)[_0xa750('0x1d')](respondWithFilteredResult(_0x599e7e,_0xaa63be));})['catch'](handleError(_0x599e7e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 6b89e69..a4870fa 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 _0xb14b=['mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context'];(function(_0x414a4e,_0x181824){var _0x13025f=function(_0x395d93){while(--_0x395d93){_0x414a4e['push'](_0x414a4e['shift']());}};_0x13025f(++_0x181824);}(_0xb14b,0x167));var _0xbb14=function(_0x418b74,_0x4c4385){_0x418b74=_0x418b74-0x0;var _0x1e01ba=_0xb14b[_0x418b74];return _0x1e01ba;};'use strict';var _=require(_0xbb14('0x0'));var util=require(_0xbb14('0x1'));var logger=require(_0xbb14('0x2'))(_0xbb14('0x3'));var moment=require(_0xbb14('0x4'));var BPromise=require(_0xbb14('0x5'));var rp=require(_0xbb14('0x6'));var fs=require('fs');var path=require(_0xbb14('0x7'));var rimraf=require(_0xbb14('0x8'));var config=require(_0xbb14('0x9'));var attributes=require(_0xbb14('0xa'));module[_0xbb14('0xb')]=function(_0x5dc6b9,_0x1af803){return _0x5dc6b9[_0xbb14('0xc')]('VoiceMail',attributes,{'tableName':_0xbb14('0xd'),'paranoid':![],'indexes':[{'name':_0xbb14('0xe'),'fields':[_0xbb14('0xf'),_0xbb14('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3fc=['exports','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','../../config/environment','./voiceMail.attributes'];(function(_0x3ca794,_0x288f28){var _0x3a8a64=function(_0x5136fd){while(--_0x5136fd){_0x3ca794['push'](_0x3ca794['shift']());}};_0x3a8a64(++_0x288f28);}(_0xa3fc,0x94));var _0xca3f=function(_0x2efb31,_0x2c0882){_0x2efb31=_0x2efb31-0x0;var _0x893d76=_0xa3fc[_0x2efb31];return _0x893d76;};'use strict';var _=require(_0xca3f('0x0'));var util=require(_0xca3f('0x1'));var logger=require(_0xca3f('0x2'))(_0xca3f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xca3f('0x4'));var attributes=require(_0xca3f('0x5'));module[_0xca3f('0x6')]=function(_0x43818f,_0x3a2a97){return _0x43818f['define'](_0xca3f('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xca3f('0x8'),'fields':[_0xca3f('0x9'),_0xca3f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index c92e0c8..3598b22 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 _0x7fb0=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x1ea8bf,_0x11701c){var _0x95d57a=function(_0x39d83a){while(--_0x39d83a){_0x1ea8bf['push'](_0x1ea8bf['shift']());}};_0x95d57a(++_0x11701c);}(_0x7fb0,0x1e2));var _0x07fb=function(_0x520bf2,_0xb4e8c3){_0x520bf2=_0x520bf2-0x0;var _0x1603ca=_0x7fb0[_0x520bf2];return _0x1603ca;};'use strict';var _=require(_0x07fb('0x0'));var util=require(_0x07fb('0x1'));var moment=require(_0x07fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x07fb('0x3'));var fs=require('fs');var Redis=require(_0x07fb('0x4'));var db=require(_0x07fb('0x5'))['db'];var utils=require(_0x07fb('0x6'));var logger=require(_0x07fb('0x7'))(_0x07fb('0x8'));var config=require('../../config/environment');var jayson=require(_0x07fb('0x9'));var client=jayson['client'][_0x07fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2111ca,_0x2794af,_0x107940){return new BPromise(function(_0x308054,_0x674645){return client[_0x07fb('0xb')](_0x2111ca,_0x107940)[_0x07fb('0xc')](function(_0xa0e0a8){logger['info']('VoiceMail,\x20%s,\x20%s',_0x2794af,_0x07fb('0xd'));logger[_0x07fb('0xe')](_0x07fb('0xf'),_0x2794af,'request\x20sent',JSON[_0x07fb('0x10')](_0xa0e0a8));if(_0xa0e0a8[_0x07fb('0x11')]){if(_0xa0e0a8['error']['code']===0x1f4){logger[_0x07fb('0x11')](_0x07fb('0x12'),_0x2794af,_0xa0e0a8[_0x07fb('0x11')][_0x07fb('0x13')]);return _0x674645(_0xa0e0a8[_0x07fb('0x11')][_0x07fb('0x13')]);}logger[_0x07fb('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2794af,_0xa0e0a8[_0x07fb('0x11')][_0x07fb('0x13')]);return _0x308054(_0xa0e0a8[_0x07fb('0x11')]['message']);}else{logger[_0x07fb('0x14')](_0x07fb('0x12'),_0x2794af,'request\x20sent');_0x308054(_0xa0e0a8[_0x07fb('0x15')][_0x07fb('0x13')]);}})[_0x07fb('0x16')](function(_0x5ac059){logger[_0x07fb('0x11')](_0x07fb('0x12'),_0x2794af,_0x5ac059);_0x674645(_0x5ac059);});});} \ No newline at end of file +var _0x26fd=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x39c5fe,_0x5bfad0){var _0x1e7e44=function(_0x4f5dea){while(--_0x4f5dea){_0x39c5fe['push'](_0x39c5fe['shift']());}};_0x1e7e44(++_0x5bfad0);}(_0x26fd,0x107));var _0xd26f=function(_0x54e217,_0x243297){_0x54e217=_0x54e217-0x0;var _0x590ead=_0x26fd[_0x54e217];return _0x590ead;};'use strict';var _=require(_0xd26f('0x0'));var util=require(_0xd26f('0x1'));var moment=require(_0xd26f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd26f('0x3'));var fs=require('fs');var Redis=require(_0xd26f('0x4'));var db=require(_0xd26f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd26f('0x6'))(_0xd26f('0x7'));var config=require(_0xd26f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd26f('0x9')][_0xd26f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37e4c4,_0x5cc3d4,_0x13441c){return new BPromise(function(_0x22c6c0,_0x254140){return client['request'](_0x37e4c4,_0x13441c)['then'](function(_0x194ab0){logger[_0xd26f('0xb')](_0xd26f('0xc'),_0x5cc3d4,'request\x20sent');logger['debug'](_0xd26f('0xd'),_0x5cc3d4,'request\x20sent',JSON['stringify'](_0x194ab0));if(_0x194ab0[_0xd26f('0xe')]){if(_0x194ab0[_0xd26f('0xe')][_0xd26f('0xf')]===0x1f4){logger['error'](_0xd26f('0xc'),_0x5cc3d4,_0x194ab0[_0xd26f('0xe')]['message']);return _0x254140(_0x194ab0['error'][_0xd26f('0x10')]);}logger['error'](_0xd26f('0xc'),_0x5cc3d4,_0x194ab0[_0xd26f('0xe')]['message']);return _0x22c6c0(_0x194ab0[_0xd26f('0xe')][_0xd26f('0x10')]);}else{logger[_0xd26f('0xb')](_0xd26f('0xc'),_0x5cc3d4,'request\x20sent');_0x22c6c0(_0x194ab0[_0xd26f('0x11')][_0xd26f('0x10')]);}})[_0xd26f('0x12')](function(_0x2397e4){logger['error'](_0xd26f('0xc'),_0x5cc3d4,_0x2397e4);_0x254140(_0x2397e4);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 3ce726a..a847153 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 _0x549d=['../../components/auth/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x50272d,_0x4a0f39){var _0x276c4c=function(_0x4e44d5){while(--_0x4e44d5){_0x50272d['push'](_0x50272d['shift']());}};_0x276c4c(++_0x4a0f39);}(_0x549d,0x155));var _0xd549=function(_0x1fc6cf,_0xa47f14){_0x1fc6cf=_0x1fc6cf-0x0;var _0x4772cb=_0x549d[_0x1fc6cf];return _0x4772cb;};'use strict';var multer=require('multer');var util=require(_0xd549('0x0'));var path=require('path');var timeout=require(_0xd549('0x1'));var express=require(_0xd549('0x2'));var router=express['Router']();var fs_extra=require(_0xd549('0x3'));var auth=require(_0xd549('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd549('0x5'));router[_0xd549('0x6')]('/',auth[_0xd549('0x7')](),controller[_0xd549('0x8')]);router[_0xd549('0x6')](_0xd549('0x9'),auth['isAuthenticated'](),controller[_0xd549('0xa')]);router[_0xd549('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xd549('0x7')](),controller[_0xd549('0xb')]);router['put'](_0xd549('0x9'),auth['isAuthenticated'](),controller[_0xd549('0xc')]);router['delete'](_0xd549('0x9'),auth[_0xd549('0x7')](),controller[_0xd549('0xd')]);module[_0xd549('0xe')]=router; \ No newline at end of file +var _0xd83e=['get','isAuthenticated','/:id','download','post','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd83e,0x107));var _0xed83=function(_0x7c6b3f,_0x35086f){_0x7c6b3f=_0x7c6b3f-0x0;var _0x5d3f0b=_0xd83e[_0x7c6b3f];return _0x5d3f0b;};'use strict';var multer=require('multer');var util=require(_0xed83('0x0'));var path=require(_0xed83('0x1'));var timeout=require(_0xed83('0x2'));var express=require('express');var router=express[_0xed83('0x3')]();var fs_extra=require(_0xed83('0x4'));var auth=require(_0xed83('0x5'));var interaction=require(_0xed83('0x6'));var config=require(_0xed83('0x7'));var controller=require(_0xed83('0x8'));router[_0xed83('0x9')]('/',auth[_0xed83('0xa')](),controller['index']);router[_0xed83('0x9')](_0xed83('0xb'),auth[_0xed83('0xa')](),controller['show']);router[_0xed83('0x9')]('/:id/download',auth[_0xed83('0xa')](),controller[_0xed83('0xc')]);router[_0xed83('0xd')]('/',auth[_0xed83('0xa')](),controller['create']);router['put'](_0xed83('0xb'),auth['isAuthenticated'](),controller[_0xed83('0xe')]);router[_0xed83('0xf')]('/:id',auth[_0xed83('0xa')](),controller[_0xed83('0x10')]);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 3d0c4dd..8ba871d 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 _0x215b=['INTEGER','STRING','BLOB','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x215b,0x14d));var _0xb215=function(_0x3c0854,_0x4222ac){_0x3c0854=_0x3c0854-0x0;var _0x379312=_0x215b[_0x3c0854];return _0x379312;};'use strict';var Sequelize=require('sequelize');module[_0xb215('0x0')]={'name':{'type':Sequelize[_0xb215('0x1')],'get':function(_0x53c770){return this[_0xb215('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb215('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb215('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xb215('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xb215('0x6'),'defaultValue':Sequelize['literal'](_0xb215('0x7'))}}; \ No newline at end of file +var _0xa455=['exports','getDataValue','INTEGER','STRING','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3cafb8,_0x32860e){var _0x4b7f85=function(_0x31b11d){while(--_0x31b11d){_0x3cafb8['push'](_0x3cafb8['shift']());}};_0x4b7f85(++_0x32860e);}(_0xa455,0x1d5));var _0x5a45=function(_0x3a0e8b,_0x5d9e49){_0x3a0e8b=_0x3a0e8b-0x0;var _0x24f111=_0xa455[_0x3a0e8b];return _0x24f111;};'use strict';var Sequelize=require('sequelize');module[_0x5a45('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x233e7e){return this[_0x5a45('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x5a45('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5a45('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x5a45('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5a45('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x5a45('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x5a45('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x5a45('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5a45('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x5a45('0x5')](_0x5a45('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c2df5e1..914d90a 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 _0x3797=['attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','reject','update','then','error','stack','name','send','VoiceMailMessage','fieldName','key','model','differenceBy','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','rows','show','params','rawAttributes','fields','include','find','create','body','catch','destroy','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav'];(function(_0x57ca25,_0x746af0){var _0x3afd27=function(_0x1828fe){while(--_0x1828fe){_0x57ca25['push'](_0x57ca25['shift']());}};_0x3afd27(++_0x746af0);}(_0x3797,0x1a2));var _0x7379=function(_0x2e2d04,_0x549042){_0x2e2d04=_0x2e2d04-0x0;var _0x4b3c77=_0x3797[_0x2e2d04];return _0x4b3c77;};'use strict';var emlformat=require(_0x7379('0x0'));var rimraf=require(_0x7379('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7379('0x2'));var rp=require('request-promise');var moment=require(_0x7379('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7379('0x4'));var util=require('util');var path=require(_0x7379('0x5'));var sox=require('sox');var csv=require(_0x7379('0x6'));var ejs=require(_0x7379('0x7'));var fs=require('fs');var fs_extra=require(_0x7379('0x8'));var _=require(_0x7379('0x9'));var squel=require('squel');var crypto=require(_0x7379('0xa'));var jsforce=require(_0x7379('0xb'));var deskjs=require(_0x7379('0xc'));var toCsv=require(_0x7379('0x6'));var querystring=require('querystring');var Papa=require(_0x7379('0xd'));var Redis=require(_0x7379('0xe'));var authService=require(_0x7379('0xf'));var qs=require(_0x7379('0x10'));var as=require(_0x7379('0x11'));var hardwareService=require(_0x7379('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7379('0x13'));var config=require(_0x7379('0x14'));var licenseUtil=require(_0x7379('0x15'));var db=require(_0x7379('0x16'))['db'];function respondWithStatusCode(_0x41d76d,_0x3de4b5){_0x3de4b5=_0x3de4b5||0xcc;return function(_0x24921f){if(_0x24921f){return _0x41d76d[_0x7379('0x17')](_0x3de4b5);}return _0x41d76d[_0x7379('0x18')](_0x3de4b5)[_0x7379('0x19')]();};}function respondWithResult(_0xe41026,_0x4cdf15){_0x4cdf15=_0x4cdf15||0xc8;return function(_0xd73e9b){if(_0xd73e9b){return _0xe41026[_0x7379('0x18')](_0x4cdf15)['json'](_0xd73e9b);}};}function respondWithFilteredResult(_0x14eec7,_0x53902d){return function(_0x151f1b){if(_0x151f1b){var _0x1e0418=typeof _0x53902d[_0x7379('0x1a')]===_0x7379('0x1b')&&typeof _0x53902d[_0x7379('0x1c')]===_0x7379('0x1b');var _0x44e06e=_0x151f1b['count'];var _0x427342=_0x1e0418?0x0:_0x53902d[_0x7379('0x1a')];var _0x47da55=_0x1e0418?_0x151f1b['count']:_0x53902d['offset']+_0x53902d[_0x7379('0x1c')];var _0x39e756;if(_0x47da55>=_0x44e06e){_0x47da55=_0x44e06e;_0x39e756=0xc8;}else{_0x39e756=0xce;}_0x14eec7[_0x7379('0x18')](_0x39e756);return _0x14eec7[_0x7379('0x1d')](_0x7379('0x1e'),_0x427342+'-'+_0x47da55+'/'+_0x44e06e)[_0x7379('0x1f')](_0x151f1b);}return null;};}function patchUpdates(_0xb1adef){return function(_0x2d171a){try{jsonpatch['apply'](_0x2d171a,_0xb1adef,!![]);}catch(_0x5ad534){return BPromise[_0x7379('0x20')](_0x5ad534);}return _0x2d171a['save']();};}function saveUpdates(_0x2082eb,_0x541a9c){return function(_0xd643d6){if(_0xd643d6){return _0xd643d6[_0x7379('0x21')](_0x2082eb)[_0x7379('0x22')](function(_0x581d4b){return _0x581d4b;});}return null;};}function removeEntity(_0x55002b,_0x536642){return function(_0x2e8b23){if(_0x2e8b23){return _0x2e8b23['destroy']()[_0x7379('0x22')](function(){_0x55002b[_0x7379('0x18')](0xcc)[_0x7379('0x19')]();});}};}function handleEntityNotFound(_0x32cd58,_0x226e17){return function(_0x20a78e){if(!_0x20a78e){_0x32cd58[_0x7379('0x17')](0x194);}return _0x20a78e;};}function handleError(_0x2f9b7c,_0xe637d0){_0xe637d0=_0xe637d0||0x1f4;return function(_0x514580){logger[_0x7379('0x23')](_0x514580[_0x7379('0x24')]);if(_0x514580[_0x7379('0x25')]){delete _0x514580[_0x7379('0x25')];}_0x2f9b7c['status'](_0xe637d0)[_0x7379('0x26')](_0x514580);};}exports['index']=function(_0x39e1cb,_0x336cd8){var _0x35bbfe={},_0x435baa={},_0x4985a8={'count':0x0,'rows':[]};var _0x233b8c=_['map'](db[_0x7379('0x27')]['rawAttributes'],function(_0x2b1043){return{'name':_0x2b1043[_0x7379('0x28')],'type':_0x2b1043['type'][_0x7379('0x29')]};});_0x435baa[_0x7379('0x2a')]=_[_0x7379('0x2b')](_[_0x7379('0x2c')](_0x233b8c,'name'),[_0x7379('0x25')]);_0x435baa[_0x7379('0x2d')]=_[_0x7379('0x2e')](_0x39e1cb[_0x7379('0x2d')]);_0x435baa['filters']=_[_0x7379('0x2f')](_0x435baa[_0x7379('0x2a')],_0x435baa[_0x7379('0x2d')]);_0x35bbfe['attributes']=_[_0x7379('0x2f')](_0x435baa[_0x7379('0x2a')],qs['fields'](_0x39e1cb[_0x7379('0x2d')]['fields']));_0x35bbfe[_0x7379('0x30')]=_0x35bbfe[_0x7379('0x30')][_0x7379('0x31')]?_0x35bbfe['attributes']:_0x435baa[_0x7379('0x2a')];if(!_0x39e1cb['query'][_0x7379('0x32')](_0x7379('0x33'))){_0x35bbfe[_0x7379('0x1c')]=qs[_0x7379('0x1c')](_0x39e1cb[_0x7379('0x2d')][_0x7379('0x1c')]);_0x35bbfe[_0x7379('0x1a')]=qs[_0x7379('0x1a')](_0x39e1cb[_0x7379('0x2d')][_0x7379('0x1a')]);}_0x35bbfe[_0x7379('0x34')]=qs[_0x7379('0x35')](_0x39e1cb[_0x7379('0x2d')][_0x7379('0x35')]);_0x35bbfe['where']=qs[_0x7379('0x36')](_[_0x7379('0x37')](_0x39e1cb[_0x7379('0x2d')],_0x435baa[_0x7379('0x36')]),_0x233b8c);if(_0x39e1cb['query'][_0x7379('0x38')]){_0x35bbfe[_0x7379('0x39')]=_[_0x7379('0x3a')](_0x35bbfe[_0x7379('0x39')],{'$or':_['map'](_0x233b8c,function(_0xfac48e){if(_0xfac48e['type']!==_0x7379('0x3b')){var _0x3f7875={};_0x3f7875[_0xfac48e[_0x7379('0x25')]]={'$like':'%'+_0x39e1cb['query']['filter']+'%'};return _0x3f7875;}})});}_0x35bbfe=_[_0x7379('0x3a')]({},_0x35bbfe,_0x39e1cb[_0x7379('0x3c')]);var _0x7a9bb1={'where':_0x35bbfe[_0x7379('0x39')]};return db[_0x7379('0x27')][_0x7379('0x3d')](_0x7a9bb1)['then'](function(_0x3661e9){_0x4985a8[_0x7379('0x3d')]=_0x3661e9;if(_0x39e1cb[_0x7379('0x2d')][_0x7379('0x3e')]){_0x35bbfe['include']=[{'all':!![]}];}return db[_0x7379('0x27')]['findAll'](_0x35bbfe);})[_0x7379('0x22')](function(_0xc5f6be){_0x4985a8[_0x7379('0x3f')]=_0xc5f6be;return _0x4985a8;})[_0x7379('0x22')](respondWithFilteredResult(_0x336cd8,_0x35bbfe))['catch'](handleError(_0x336cd8,null));};exports[_0x7379('0x40')]=function(_0x903428,_0x320b38){var _0x5622dc={'raw':!![],'where':{'id':_0x903428[_0x7379('0x41')]['id']}},_0x5dd981={};_0x5dd981[_0x7379('0x2a')]=_['keys'](db[_0x7379('0x27')][_0x7379('0x42')]);_0x5dd981['query']=_['keys'](_0x903428[_0x7379('0x2d')]);_0x5dd981[_0x7379('0x36')]=_[_0x7379('0x2f')](_0x5dd981[_0x7379('0x2a')],_0x5dd981[_0x7379('0x2d')]);_0x5622dc[_0x7379('0x30')]=_[_0x7379('0x2f')](_0x5dd981[_0x7379('0x2a')],qs['fields'](_0x903428[_0x7379('0x2d')][_0x7379('0x43')]));_0x5622dc['attributes']=_0x5622dc[_0x7379('0x30')][_0x7379('0x31')]?_0x5622dc[_0x7379('0x30')]:_0x5dd981[_0x7379('0x2a')];if(_0x903428['query'][_0x7379('0x3e')]){_0x5622dc[_0x7379('0x44')]=[{'all':!![]}];}_0x5622dc=_[_0x7379('0x3a')]({},_0x5622dc,_0x903428[_0x7379('0x3c')]);return db[_0x7379('0x27')][_0x7379('0x45')](_0x5622dc)['then'](handleEntityNotFound(_0x320b38,null))[_0x7379('0x22')](respondWithResult(_0x320b38,null))['catch'](handleError(_0x320b38,null));};exports[_0x7379('0x46')]=function(_0x352a49,_0x186c74){return db[_0x7379('0x27')]['create'](_0x352a49['body'],{})[_0x7379('0x22')](respondWithResult(_0x186c74,0xc9))['catch'](handleError(_0x186c74,null));};exports[_0x7379('0x21')]=function(_0x5831df,_0x5cf83a){if(_0x5831df['body']['id']){delete _0x5831df[_0x7379('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x5831df[_0x7379('0x41')]['id']}})[_0x7379('0x22')](handleEntityNotFound(_0x5cf83a,null))['then'](saveUpdates(_0x5831df[_0x7379('0x47')],null))[_0x7379('0x22')](respondWithResult(_0x5cf83a,null))[_0x7379('0x48')](handleError(_0x5cf83a,null));};exports[_0x7379('0x49')]=function(_0x40cc11,_0x1a0d3f){return db[_0x7379('0x27')]['find']({'where':{'id':_0x40cc11[_0x7379('0x41')]['id']}})[_0x7379('0x22')](handleEntityNotFound(_0x1a0d3f,null))[_0x7379('0x22')](removeEntity(_0x1a0d3f,null))[_0x7379('0x48')](handleError(_0x1a0d3f,null));};exports[_0x7379('0x4a')]=function(_0x3d7b1c,_0x5cfeaf,_0x4c3257){return db[_0x7379('0x27')][_0x7379('0x45')]({'where':{'id':_0x3d7b1c[_0x7379('0x41')]['id']},'attributes':['id','recording',_0x7379('0x4b')]})[_0x7379('0x22')](handleEntityNotFound(_0x5cfeaf,null))[_0x7379('0x22')](function(_0x14e918){if(_0x14e918){if(!_0x14e918[_0x7379('0x4c')]){throw new db['Sequelize'][(_0x7379('0x4d'))](_0x7379('0x4e'));}var _0x2ad59c={'Content-Type':_0x7379('0x4f'),'Content-Disposition':_0x7379('0x50')};if(_0x14e918['msg_id']){_0x2ad59c[_0x7379('0x51')]=_0x7379('0x52')+_0x14e918[_0x7379('0x4b')]+'.wav\x22';}_0x5cfeaf['set'](_0x2ad59c);return _0x5cfeaf[_0x7379('0x26')](new Buffer(_0x14e918[_0x7379('0x4c')]));}})['catch'](handleError(_0x5cfeaf,null));}; \ No newline at end of file +var _0xc8c9=['rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','VoiceMailMessage','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','save','destroy','then','stack','name','index','map'];(function(_0x36d79c,_0x51c39a){var _0x505741=function(_0x3e7ddb){while(--_0x3e7ddb){_0x36d79c['push'](_0x36d79c['shift']());}};_0x505741(++_0x51c39a);}(_0xc8c9,0x17c));var _0x9c8c=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0xc8c9[_0x218994];return _0x3f350b;};'use strict';var emlformat=require(_0x9c8c('0x0'));var rimraf=require(_0x9c8c('0x1'));var zipdir=require(_0x9c8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c8c('0x3'));var moment=require(_0x9c8c('0x4'));var BPromise=require(_0x9c8c('0x5'));var Mustache=require('mustache');var util=require(_0x9c8c('0x6'));var path=require(_0x9c8c('0x7'));var sox=require('sox');var csv=require(_0x9c8c('0x8'));var ejs=require(_0x9c8c('0x9'));var fs=require('fs');var fs_extra=require(_0x9c8c('0xa'));var _=require(_0x9c8c('0xb'));var squel=require(_0x9c8c('0xc'));var crypto=require(_0x9c8c('0xd'));var jsforce=require(_0x9c8c('0xe'));var deskjs=require(_0x9c8c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9c8c('0x10'));var Papa=require(_0x9c8c('0x11'));var Redis=require(_0x9c8c('0x12'));var authService=require(_0x9c8c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9c8c('0x14'));var hardwareService=require(_0x9c8c('0x15'));var logger=require(_0x9c8c('0x16'))(_0x9c8c('0x17'));var utils=require(_0x9c8c('0x18'));var config=require(_0x9c8c('0x19'));var licenseUtil=require(_0x9c8c('0x1a'));var db=require(_0x9c8c('0x1b'))['db'];function respondWithStatusCode(_0x5963d5,_0x5854a5){_0x5854a5=_0x5854a5||0xcc;return function(_0x5ac3e5){if(_0x5ac3e5){return _0x5963d5[_0x9c8c('0x1c')](_0x5854a5);}return _0x5963d5['status'](_0x5854a5)[_0x9c8c('0x1d')]();};}function respondWithResult(_0x94062b,_0x4de2c5){_0x4de2c5=_0x4de2c5||0xc8;return function(_0x3d2d2d){if(_0x3d2d2d){return _0x94062b[_0x9c8c('0x1e')](_0x4de2c5)[_0x9c8c('0x1f')](_0x3d2d2d);}};}function respondWithFilteredResult(_0x426321,_0x829691){return function(_0x421d4e){if(_0x421d4e){var _0x57f354=typeof _0x829691[_0x9c8c('0x20')]===_0x9c8c('0x21')&&typeof _0x829691['limit']===_0x9c8c('0x21');var _0xba5c8f=_0x421d4e[_0x9c8c('0x22')];var _0x20bd7a=_0x57f354?0x0:_0x829691[_0x9c8c('0x20')];var _0x281a78=_0x57f354?_0x421d4e['count']:_0x829691[_0x9c8c('0x20')]+_0x829691[_0x9c8c('0x23')];var _0x1d13d7;if(_0x281a78>=_0xba5c8f){_0x281a78=_0xba5c8f;_0x1d13d7=0xc8;}else{_0x1d13d7=0xce;}_0x426321[_0x9c8c('0x1e')](_0x1d13d7);return _0x426321[_0x9c8c('0x24')]('Content-Range',_0x20bd7a+'-'+_0x281a78+'/'+_0xba5c8f)[_0x9c8c('0x1f')](_0x421d4e);}return null;};}function patchUpdates(_0x1c9fd8){return function(_0x807b33){try{jsonpatch[_0x9c8c('0x25')](_0x807b33,_0x1c9fd8,!![]);}catch(_0x500583){return BPromise['reject'](_0x500583);}return _0x807b33[_0x9c8c('0x26')]();};}function saveUpdates(_0x118881,_0x290cf2){return function(_0x45976f){if(_0x45976f){return _0x45976f['update'](_0x118881)['then'](function(_0x1f7b7f){return _0x1f7b7f;});}return null;};}function removeEntity(_0xfed167,_0x2a6f27){return function(_0x1053df){if(_0x1053df){return _0x1053df[_0x9c8c('0x27')]()[_0x9c8c('0x28')](function(){_0xfed167[_0x9c8c('0x1e')](0xcc)[_0x9c8c('0x1d')]();});}};}function handleEntityNotFound(_0x119087,_0xeb73b2){return function(_0x5c93de){if(!_0x5c93de){_0x119087[_0x9c8c('0x1c')](0x194);}return _0x5c93de;};}function handleError(_0x2ff1ac,_0x47dc46){_0x47dc46=_0x47dc46||0x1f4;return function(_0x161dc3){logger['error'](_0x161dc3[_0x9c8c('0x29')]);if(_0x161dc3[_0x9c8c('0x2a')]){delete _0x161dc3[_0x9c8c('0x2a')];}_0x2ff1ac[_0x9c8c('0x1e')](_0x47dc46)['send'](_0x161dc3);};}exports[_0x9c8c('0x2b')]=function(_0x1f62de,_0x150353){var _0x26ec53={},_0x4e42de={},_0x41175b={'count':0x0,'rows':[]};var _0x14233a=_[_0x9c8c('0x2c')](db['VoiceMailMessage'][_0x9c8c('0x2d')],function(_0x54e5ca){return{'name':_0x54e5ca['fieldName'],'type':_0x54e5ca[_0x9c8c('0x2e')][_0x9c8c('0x2f')]};});_0x4e42de[_0x9c8c('0x30')]=_[_0x9c8c('0x31')](_['map'](_0x14233a,_0x9c8c('0x2a')),['name']);_0x4e42de[_0x9c8c('0x32')]=_[_0x9c8c('0x33')](_0x1f62de[_0x9c8c('0x32')]);_0x4e42de[_0x9c8c('0x34')]=_[_0x9c8c('0x35')](_0x4e42de['model'],_0x4e42de[_0x9c8c('0x32')]);_0x26ec53[_0x9c8c('0x36')]=_[_0x9c8c('0x35')](_0x4e42de['model'],qs[_0x9c8c('0x37')](_0x1f62de[_0x9c8c('0x32')][_0x9c8c('0x37')]));_0x26ec53[_0x9c8c('0x36')]=_0x26ec53[_0x9c8c('0x36')][_0x9c8c('0x38')]?_0x26ec53['attributes']:_0x4e42de[_0x9c8c('0x30')];if(!_0x1f62de['query'][_0x9c8c('0x39')](_0x9c8c('0x3a'))){_0x26ec53[_0x9c8c('0x23')]=qs[_0x9c8c('0x23')](_0x1f62de['query'][_0x9c8c('0x23')]);_0x26ec53[_0x9c8c('0x20')]=qs['offset'](_0x1f62de[_0x9c8c('0x32')][_0x9c8c('0x20')]);}_0x26ec53[_0x9c8c('0x3b')]=qs[_0x9c8c('0x3c')](_0x1f62de[_0x9c8c('0x32')][_0x9c8c('0x3c')]);_0x26ec53['where']=qs[_0x9c8c('0x34')](_[_0x9c8c('0x3d')](_0x1f62de[_0x9c8c('0x32')],_0x4e42de[_0x9c8c('0x34')]),_0x14233a);if(_0x1f62de[_0x9c8c('0x32')]['filter']){_0x26ec53[_0x9c8c('0x3e')]=_[_0x9c8c('0x3f')](_0x26ec53['where'],{'$or':_[_0x9c8c('0x2c')](_0x14233a,function(_0x596d1e){if(_0x596d1e['type']!==_0x9c8c('0x40')){var _0x5341a8={};_0x5341a8[_0x596d1e[_0x9c8c('0x2a')]]={'$like':'%'+_0x1f62de[_0x9c8c('0x32')]['filter']+'%'};return _0x5341a8;}})});}_0x26ec53=_[_0x9c8c('0x3f')]({},_0x26ec53,_0x1f62de[_0x9c8c('0x41')]);var _0x3007a5={'where':_0x26ec53['where']};return db[_0x9c8c('0x42')][_0x9c8c('0x22')](_0x3007a5)[_0x9c8c('0x28')](function(_0x34bb86){_0x41175b[_0x9c8c('0x22')]=_0x34bb86;if(_0x1f62de[_0x9c8c('0x32')]['includeAll']){_0x26ec53[_0x9c8c('0x43')]=[{'all':!![]}];}return db[_0x9c8c('0x42')][_0x9c8c('0x44')](_0x26ec53);})[_0x9c8c('0x28')](function(_0x579018){_0x41175b[_0x9c8c('0x45')]=_0x579018;return _0x41175b;})[_0x9c8c('0x28')](respondWithFilteredResult(_0x150353,_0x26ec53))[_0x9c8c('0x46')](handleError(_0x150353,null));};exports[_0x9c8c('0x47')]=function(_0x2541bf,_0x63d420){var _0x5bc476={'raw':!![],'where':{'id':_0x2541bf[_0x9c8c('0x48')]['id']}},_0x2c504c={};_0x2c504c[_0x9c8c('0x30')]=_[_0x9c8c('0x33')](db[_0x9c8c('0x42')][_0x9c8c('0x2d')]);_0x2c504c[_0x9c8c('0x32')]=_[_0x9c8c('0x33')](_0x2541bf[_0x9c8c('0x32')]);_0x2c504c['filters']=_[_0x9c8c('0x35')](_0x2c504c[_0x9c8c('0x30')],_0x2c504c['query']);_0x5bc476[_0x9c8c('0x36')]=_[_0x9c8c('0x35')](_0x2c504c[_0x9c8c('0x30')],qs[_0x9c8c('0x37')](_0x2541bf[_0x9c8c('0x32')][_0x9c8c('0x37')]));_0x5bc476[_0x9c8c('0x36')]=_0x5bc476['attributes'][_0x9c8c('0x38')]?_0x5bc476[_0x9c8c('0x36')]:_0x2c504c[_0x9c8c('0x30')];if(_0x2541bf[_0x9c8c('0x32')][_0x9c8c('0x49')]){_0x5bc476[_0x9c8c('0x43')]=[{'all':!![]}];}_0x5bc476=_[_0x9c8c('0x3f')]({},_0x5bc476,_0x2541bf[_0x9c8c('0x41')]);return db['VoiceMailMessage'][_0x9c8c('0x4a')](_0x5bc476)[_0x9c8c('0x28')](handleEntityNotFound(_0x63d420,null))[_0x9c8c('0x28')](respondWithResult(_0x63d420,null))[_0x9c8c('0x46')](handleError(_0x63d420,null));};exports[_0x9c8c('0x4b')]=function(_0x2f21c5,_0x16c8d9){return db[_0x9c8c('0x42')][_0x9c8c('0x4b')](_0x2f21c5[_0x9c8c('0x4c')],{})['then'](respondWithResult(_0x16c8d9,0xc9))[_0x9c8c('0x46')](handleError(_0x16c8d9,null));};exports[_0x9c8c('0x4d')]=function(_0x36a1f5,_0x44c3ae){if(_0x36a1f5['body']['id']){delete _0x36a1f5[_0x9c8c('0x4c')]['id'];}return db[_0x9c8c('0x42')][_0x9c8c('0x4a')]({'where':{'id':_0x36a1f5['params']['id']}})[_0x9c8c('0x28')](handleEntityNotFound(_0x44c3ae,null))[_0x9c8c('0x28')](saveUpdates(_0x36a1f5['body'],null))[_0x9c8c('0x28')](respondWithResult(_0x44c3ae,null))[_0x9c8c('0x46')](handleError(_0x44c3ae,null));};exports[_0x9c8c('0x27')]=function(_0x4ce1e7,_0x3ab88d){return db[_0x9c8c('0x42')][_0x9c8c('0x4a')]({'where':{'id':_0x4ce1e7[_0x9c8c('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ab88d,null))[_0x9c8c('0x28')](removeEntity(_0x3ab88d,null))[_0x9c8c('0x46')](handleError(_0x3ab88d,null));};exports['download']=function(_0x14b394,_0x35488d,_0x4f1f4f){return db['VoiceMailMessage'][_0x9c8c('0x4a')]({'where':{'id':_0x14b394['params']['id']},'attributes':['id',_0x9c8c('0x4e'),'msg_id']})[_0x9c8c('0x28')](handleEntityNotFound(_0x35488d,null))[_0x9c8c('0x28')](function(_0x1ec7de){if(_0x1ec7de){if(!_0x1ec7de[_0x9c8c('0x4e')]){throw new db['Sequelize'][(_0x9c8c('0x4f'))](_0x9c8c('0x50'));}var _0x486153={'Content-Type':_0x9c8c('0x51'),'Content-Disposition':'attachment'};if(_0x1ec7de[_0x9c8c('0x52')]){_0x486153[_0x9c8c('0x53')]='attachment;\x20filename=\x22'+_0x1ec7de[_0x9c8c('0x52')]+_0x9c8c('0x54');}_0x35488d['set'](_0x486153);return _0x35488d['send'](new Buffer(_0x1ec7de['recording']));}})[_0x9c8c('0x46')](handleError(_0x35488d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f0aec2d..0db0830 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 _0x1c67=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1c67,0x193));var _0x71c6=function(_0xb8aa04,_0x18410d){_0xb8aa04=_0xb8aa04-0x0;var _0x1a2bcc=_0x1c67[_0xb8aa04];return _0x1a2bcc;};'use strict';var _=require(_0x71c6('0x0'));var util=require(_0x71c6('0x1'));var logger=require(_0x71c6('0x2'))('api');var moment=require(_0x71c6('0x3'));var BPromise=require(_0x71c6('0x4'));var rp=require(_0x71c6('0x5'));var fs=require('fs');var path=require(_0x71c6('0x6'));var rimraf=require(_0x71c6('0x7'));var config=require(_0x71c6('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x71c6('0x9')]=function(_0x46b8a1,_0x5e7606){return _0x46b8a1[_0x71c6('0xa')](_0x71c6('0xb'),attributes,{'tableName':_0x71c6('0xc'),'paranoid':![],'indexes':[{'name':_0x71c6('0xd'),'fields':[_0x71c6('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7c8f=['moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','dir','util','../../config/logger','api'];(function(_0xfb045,_0x552166){var _0x4009d5=function(_0xf4509c){while(--_0xf4509c){_0xfb045['push'](_0xfb045['shift']());}};_0x4009d5(++_0x552166);}(_0x7c8f,0x195));var _0xf7c8=function(_0x4692be,_0x34393a){_0x4692be=_0x4692be-0x0;var _0x50ed29=_0x7c8f[_0x4692be];return _0x50ed29;};'use strict';var _=require('lodash');var util=require(_0xf7c8('0x0'));var logger=require(_0xf7c8('0x1'))(_0xf7c8('0x2'));var moment=require(_0xf7c8('0x3'));var BPromise=require(_0xf7c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7c8('0x5'));var rimraf=require(_0xf7c8('0x6'));var config=require(_0xf7c8('0x7'));var attributes=require(_0xf7c8('0x8'));module[_0xf7c8('0x9')]=function(_0x29ad9a,_0x468d9d){return _0x29ad9a[_0xf7c8('0xa')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xf7c8('0xb'),'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 28b7fa3..5f0839c 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 _0x0739=['rpc','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x5a9655,_0x2b4bc2){var _0x1543c7=function(_0x357d71){while(--_0x357d71){_0x5a9655['push'](_0x5a9655['shift']());}};_0x1543c7(++_0x2b4bc2);}(_0x0739,0x176));var _0x9073=function(_0x353edc,_0x2a0e87){_0x353edc=_0x353edc-0x0;var _0x4effca=_0x0739[_0x353edc];return _0x4effca;};'use strict';var _=require(_0x9073('0x0'));var util=require(_0x9073('0x1'));var moment=require(_0x9073('0x2'));var BPromise=require(_0x9073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9073('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9073('0x5'))(_0x9073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9073('0x7')][_0x9073('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30f4e7,_0x23c736,_0x482183){return new BPromise(function(_0x125237,_0x4552c9){return client[_0x9073('0x9')](_0x30f4e7,_0x482183)['then'](function(_0x1748de){logger['info'](_0x9073('0xa'),_0x23c736,_0x9073('0xb'));logger[_0x9073('0xc')](_0x9073('0xd'),_0x23c736,'request\x20sent',JSON[_0x9073('0xe')](_0x1748de));if(_0x1748de['error']){if(_0x1748de[_0x9073('0xf')]['code']===0x1f4){logger[_0x9073('0xf')](_0x9073('0xa'),_0x23c736,_0x1748de['error']['message']);return _0x4552c9(_0x1748de['error'][_0x9073('0x10')]);}logger[_0x9073('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x23c736,_0x1748de[_0x9073('0xf')][_0x9073('0x10')]);return _0x125237(_0x1748de[_0x9073('0xf')][_0x9073('0x10')]);}else{logger['info'](_0x9073('0xa'),_0x23c736,_0x9073('0xb'));_0x125237(_0x1748de[_0x9073('0x11')][_0x9073('0x10')]);}})[_0x9073('0x12')](function(_0x28cd5b){logger[_0x9073('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x23c736,_0x28cd5b);_0x4552c9(_0x28cd5b);});});} \ No newline at end of file +var _0xd51d=['info','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','client','request'];(function(_0x33faca,_0x5379ff){var _0x27e2b9=function(_0x1502f9){while(--_0x1502f9){_0x33faca['push'](_0x33faca['shift']());}};_0x27e2b9(++_0x5379ff);}(_0xd51d,0xf4));var _0xdd51=function(_0x9a5148,_0x3ca408){_0x9a5148=_0x9a5148-0x0;var _0x6ec3fa=_0xd51d[_0x9a5148];return _0x6ec3fa;};'use strict';var _=require(_0xdd51('0x0'));var util=require('util');var moment=require(_0xdd51('0x1'));var BPromise=require(_0xdd51('0x2'));var rs=require(_0xdd51('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd51('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd51('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd51('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x411d11,_0x23013a,_0x1d9e1c){return new BPromise(function(_0x477432,_0x2b6782){return client[_0xdd51('0x7')](_0x411d11,_0x1d9e1c)['then'](function(_0x1413b9){logger[_0xdd51('0x8')]('VoiceMailMessage,\x20%s,\x20%s',_0x23013a,'request\x20sent');logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x23013a,'request\x20sent',JSON[_0xdd51('0x9')](_0x1413b9));if(_0x1413b9['error']){if(_0x1413b9[_0xdd51('0xa')][_0xdd51('0xb')]===0x1f4){logger[_0xdd51('0xa')](_0xdd51('0xc'),_0x23013a,_0x1413b9[_0xdd51('0xa')][_0xdd51('0xd')]);return _0x2b6782(_0x1413b9['error'][_0xdd51('0xd')]);}logger[_0xdd51('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x23013a,_0x1413b9[_0xdd51('0xa')][_0xdd51('0xd')]);return _0x477432(_0x1413b9[_0xdd51('0xa')][_0xdd51('0xd')]);}else{logger['info'](_0xdd51('0xc'),_0x23013a,'request\x20sent');_0x477432(_0x1413b9['result'][_0xdd51('0xd')]);}})['catch'](function(_0x5f5c7a){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x23013a,_0x5f5c7a);_0x2b6782(_0x5f5c7a);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 529aebb..7d2957b 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 _0xf36b=['getSounds','post','create','/:id/sounds','put','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf36b,0xd1));var _0xbf36=function(_0x3ef7ef,_0x59e75b){_0x3ef7ef=_0x3ef7ef-0x0;var _0x446038=_0xf36b[_0x3ef7ef];return _0x446038;};'use strict';var multer=require(_0xbf36('0x0'));var util=require(_0xbf36('0x1'));var path=require(_0xbf36('0x2'));var timeout=require(_0xbf36('0x3'));var express=require('express');var router=express[_0xbf36('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf36('0x5'));var controller=require(_0xbf36('0x6'));router[_0xbf36('0x7')]('/',auth[_0xbf36('0x8')](),controller[_0xbf36('0x9')]);router[_0xbf36('0x7')](_0xbf36('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xbf36('0x7')]('/:id/sounds',auth[_0xbf36('0x8')](),controller[_0xbf36('0xb')]);router[_0xbf36('0xc')]('/',auth[_0xbf36('0x8')](),controller[_0xbf36('0xd')]);router[_0xbf36('0xc')](_0xbf36('0xe'),auth['isAuthenticated'](),controller['addSound']);router[_0xbf36('0xf')](_0xbf36('0xa'),auth[_0xbf36('0x8')](),controller['update']);router[_0xbf36('0x10')](_0xbf36('0xa'),auth[_0xbf36('0x8')](),controller['destroy']);router[_0xbf36('0x10')](_0xbf36('0x11'),auth[_0xbf36('0x8')](),controller[_0xbf36('0x12')]);module[_0xbf36('0x13')]=router; \ No newline at end of file +var _0x6e8f=['getSounds','post','create','addSound','/:id','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id/sounds'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x6e8f,0x106));var _0xf6e8=function(_0x990fbe,_0x329918){_0x990fbe=_0x990fbe-0x0;var _0x554042=_0x6e8f[_0x990fbe];return _0x554042;};'use strict';var multer=require(_0xf6e8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf6e8('0x1'));var express=require('express');var router=express[_0xf6e8('0x2')]();var fs_extra=require(_0xf6e8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf6e8('0x4'));var config=require(_0xf6e8('0x5'));var controller=require(_0xf6e8('0x6'));router['get']('/',auth[_0xf6e8('0x7')](),controller[_0xf6e8('0x8')]);router[_0xf6e8('0x9')]('/:id',auth[_0xf6e8('0x7')](),controller['show']);router[_0xf6e8('0x9')](_0xf6e8('0xa'),auth[_0xf6e8('0x7')](),controller[_0xf6e8('0xb')]);router[_0xf6e8('0xc')]('/',auth[_0xf6e8('0x7')](),controller[_0xf6e8('0xd')]);router[_0xf6e8('0xc')](_0xf6e8('0xa'),auth['isAuthenticated'](),controller[_0xf6e8('0xe')]);router['put'](_0xf6e8('0xf'),auth[_0xf6e8('0x7')](),controller['update']);router[_0xf6e8('0x10')](_0xf6e8('0xf'),auth[_0xf6e8('0x7')](),controller[_0xf6e8('0x11')]);router[_0xf6e8('0x10')](_0xf6e8('0x12'),auth[_0xf6e8('0x7')](),controller[_0xf6e8('0x13')]);module[_0xf6e8('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f413390..ce280e8 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 _0x44c7=['files','mp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x259e62,_0x184e80){var _0x64caea=function(_0x223d36){while(--_0x223d36){_0x259e62['push'](_0x259e62['shift']());}};_0x64caea(++_0x184e80);}(_0x44c7,0xab));var _0x744c=function(_0x1a2243,_0x593600){_0x1a2243=_0x1a2243-0x0;var _0x52a83e=_0x44c7[_0x1a2243];return _0x52a83e;};'use strict';var Sequelize=require(_0x744c('0x0'));module[_0x744c('0x1')]={'name':{'type':Sequelize[_0x744c('0x2')],'allowNull':![],'unique':_0x744c('0x3')},'mode':{'type':Sequelize[_0x744c('0x4')]('custom',_0x744c('0x5'),_0x744c('0x6'),'quietmp3nb',_0x744c('0x7'),_0x744c('0x8')),'allowNull':!![],'defaultValue':_0x744c('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x744c('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x744c('0x2')],'allowNull':!![]},'stamp':{'type':_0x744c('0x9')},'defaultEntry':{'type':Sequelize[_0x744c('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9d88=['files','mp3nb','mp3','TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM','custom'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d88,0x1ac));var _0x89d8=function(_0x2b8a55,_0x178e9e){_0x2b8a55=_0x2b8a55-0x0;var _0x403803=_0x9d88[_0x2b8a55];return _0x403803;};'use strict';var Sequelize=require(_0x89d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x89d8('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x89d8('0x2')](_0x89d8('0x3'),_0x89d8('0x4'),_0x89d8('0x5'),'quietmp3nb','quietmp3',_0x89d8('0x6')),'allowNull':!![],'defaultValue':_0x89d8('0x4')},'directory':{'type':Sequelize[_0x89d8('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x89d8('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x89d8('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x89d8('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x89d8('0x1')],'allowNull':!![]},'stamp':{'type':_0x89d8('0x7')},'defaultEntry':{'type':Sequelize[_0x89d8('0x8')],'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 6c4ac34..9008480 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 _0x0ccc=['map','VoiceMusicOnHold','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','length','includeAll','options','body','create','sequelize','mode','join','root','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','MusicOnHolds','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','rmdirSync','ValidationError','addSound','transaction','Sound','findOne','save_name','createdAt','%s.%s','extname','converted_format','server/files/moh','format','symlinkSync','Sequelize','message','removeSound','id2','getSounds','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','get','destroy','error','stack','name','send','index'];(function(_0x1fb57a,_0x148782){var _0x1716f4=function(_0x1f5072){while(--_0x1f5072){_0x1fb57a['push'](_0x1fb57a['shift']());}};_0x1716f4(++_0x148782);}(_0x0ccc,0xb5));var _0xc0cc=function(_0x20ddee,_0x504d08){_0x20ddee=_0x20ddee-0x0;var _0x55a343=_0x0ccc[_0x20ddee];return _0x55a343;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0cc('0x0'));var zipdir=require(_0xc0cc('0x1'));var jsonpatch=require(_0xc0cc('0x2'));var rp=require(_0xc0cc('0x3'));var moment=require(_0xc0cc('0x4'));var BPromise=require(_0xc0cc('0x5'));var Mustache=require(_0xc0cc('0x6'));var util=require(_0xc0cc('0x7'));var path=require('path');var sox=require(_0xc0cc('0x8'));var csv=require(_0xc0cc('0x9'));var ejs=require(_0xc0cc('0xa'));var fs=require('fs');var fs_extra=require(_0xc0cc('0xb'));var _=require(_0xc0cc('0xc'));var squel=require(_0xc0cc('0xd'));var crypto=require(_0xc0cc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc0cc('0xf'));var toCsv=require(_0xc0cc('0x9'));var querystring=require(_0xc0cc('0x10'));var Papa=require(_0xc0cc('0x11'));var Redis=require(_0xc0cc('0x12'));var authService=require(_0xc0cc('0x13'));var qs=require(_0xc0cc('0x14'));var as=require(_0xc0cc('0x15'));var hardwareService=require(_0xc0cc('0x16'));var logger=require('../../config/logger')(_0xc0cc('0x17'));var utils=require(_0xc0cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc0cc('0x19'));var db=require(_0xc0cc('0x1a'))['db'];function respondWithStatusCode(_0x52f8bb,_0x7b073d){_0x7b073d=_0x7b073d||0xcc;return function(_0x5da0b6){if(_0x5da0b6){return _0x52f8bb[_0xc0cc('0x1b')](_0x7b073d);}return _0x52f8bb[_0xc0cc('0x1c')](_0x7b073d)[_0xc0cc('0x1d')]();};}function respondWithResult(_0x45850d,_0x22339c){_0x22339c=_0x22339c||0xc8;return function(_0x28b63a){if(_0x28b63a){return _0x45850d[_0xc0cc('0x1c')](_0x22339c)[_0xc0cc('0x1e')](_0x28b63a);}};}function respondWithFilteredResult(_0x1a3443,_0x30ede){return function(_0x48e735){if(_0x48e735){var _0x583f27=typeof _0x30ede['offset']===_0xc0cc('0x1f')&&typeof _0x30ede[_0xc0cc('0x20')]===_0xc0cc('0x1f');var _0x32283e=_0x48e735[_0xc0cc('0x21')];var _0x2fdf36=_0x583f27?0x0:_0x30ede[_0xc0cc('0x22')];var _0x11f66a=_0x583f27?_0x48e735[_0xc0cc('0x21')]:_0x30ede[_0xc0cc('0x22')]+_0x30ede[_0xc0cc('0x20')];var _0x2f8d13;if(_0x11f66a>=_0x32283e){_0x11f66a=_0x32283e;_0x2f8d13=0xc8;}else{_0x2f8d13=0xce;}_0x1a3443['status'](_0x2f8d13);return _0x1a3443[_0xc0cc('0x23')](_0xc0cc('0x24'),_0x2fdf36+'-'+_0x11f66a+'/'+_0x32283e)['json'](_0x48e735);}return null;};}function patchUpdates(_0xfad3dd){return function(_0x3504c8){try{jsonpatch['apply'](_0x3504c8,_0xfad3dd,!![]);}catch(_0x210f4e){return BPromise['reject'](_0x210f4e);}return _0x3504c8[_0xc0cc('0x25')]();};}function saveUpdates(_0xb346f8,_0x2e1040){return function(_0xcb9de){if(_0xcb9de){return _0xcb9de[_0xc0cc('0x26')](_0xb346f8)[_0xc0cc('0x27')](function(_0x3d7697){return _0x3d7697;});}return null;};}function removeEntity(_0x337434,_0x4dfac7){return function(_0x24f8e5){if(_0x24f8e5){return _0x24f8e5['destroy']()[_0xc0cc('0x27')](function(){var _0x548972=_0x24f8e5[_0xc0cc('0x28')]({'plain':!![]});var _0x2fe1b9='MusicOnHolds';return db['UserProfileResource'][_0xc0cc('0x29')]({'where':{'type':_0x2fe1b9,'resourceId':_0x548972['id']}})[_0xc0cc('0x27')](function(){return _0x24f8e5;});})[_0xc0cc('0x27')](function(){_0x337434[_0xc0cc('0x1c')](0xcc)[_0xc0cc('0x1d')]();});}};}function handleEntityNotFound(_0xbeb27f,_0x4e3867){return function(_0x5e9f10){if(!_0x5e9f10){_0xbeb27f[_0xc0cc('0x1b')](0x194);}return _0x5e9f10;};}function handleError(_0x44f7aa,_0x245f78){_0x245f78=_0x245f78||0x1f4;return function(_0xe6231c){logger[_0xc0cc('0x2a')](_0xe6231c[_0xc0cc('0x2b')]);if(_0xe6231c['name']){delete _0xe6231c[_0xc0cc('0x2c')];}_0x44f7aa[_0xc0cc('0x1c')](_0x245f78)[_0xc0cc('0x2d')](_0xe6231c);};}exports[_0xc0cc('0x2e')]=function(_0x3c47a2,_0x1ab305){var _0x41b30a={},_0x31bd79={},_0x2e1471={'count':0x0,'rows':[]};var _0x5672d8=_[_0xc0cc('0x2f')](db[_0xc0cc('0x30')][_0xc0cc('0x31')],function(_0x5281dc){return{'name':_0x5281dc['fieldName'],'type':_0x5281dc['type'][_0xc0cc('0x32')]};});_0x31bd79[_0xc0cc('0x33')]=_[_0xc0cc('0x2f')](_0x5672d8,_0xc0cc('0x2c'));_0x31bd79['query']=_[_0xc0cc('0x34')](_0x3c47a2[_0xc0cc('0x35')]);_0x31bd79[_0xc0cc('0x36')]=_[_0xc0cc('0x37')](_0x31bd79[_0xc0cc('0x33')],_0x31bd79[_0xc0cc('0x35')]);_0x41b30a['attributes']=_[_0xc0cc('0x37')](_0x31bd79['model'],qs[_0xc0cc('0x38')](_0x3c47a2[_0xc0cc('0x35')]['fields']));_0x41b30a[_0xc0cc('0x39')]=_0x41b30a[_0xc0cc('0x39')]['length']?_0x41b30a['attributes']:_0x31bd79[_0xc0cc('0x33')];if(!_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3a')]('nolimit')){_0x41b30a[_0xc0cc('0x20')]=qs[_0xc0cc('0x20')](_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x20')]);_0x41b30a[_0xc0cc('0x22')]=qs['offset'](_0x3c47a2['query'][_0xc0cc('0x22')]);}_0x41b30a[_0xc0cc('0x3b')]=qs[_0xc0cc('0x3c')](_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3c')]);delete _0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3c')];_0x41b30a['where']=qs[_0xc0cc('0x36')](_[_0xc0cc('0x3d')](_0x3c47a2[_0xc0cc('0x35')],_0x31bd79['filters']),_0x5672d8);if(_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3e')]){_0x41b30a[_0xc0cc('0x3f')]=_['merge'](_0x41b30a[_0xc0cc('0x3f')],{'$or':_['map'](_0x5672d8,function(_0x2a97a1){if(_0x2a97a1[_0xc0cc('0x40')]!==_0xc0cc('0x41')){var _0x3a7d5f={};_0x3a7d5f[_0x2a97a1[_0xc0cc('0x2c')]]={'$like':'%'+_0x3c47a2[_0xc0cc('0x35')][_0xc0cc('0x3e')]+'%'};return _0x3a7d5f;}})});}_0x41b30a=_[_0xc0cc('0x42')]({},_0x41b30a,_0x3c47a2['options']);var _0x52b6fc={'where':_0x41b30a[_0xc0cc('0x3f')]};return db[_0xc0cc('0x30')][_0xc0cc('0x21')](_0x52b6fc)[_0xc0cc('0x27')](function(_0x2cff85){_0x2e1471['count']=_0x2cff85;if(_0x3c47a2[_0xc0cc('0x35')]['includeAll']){_0x41b30a[_0xc0cc('0x43')]=[{'all':!![]}];}return db[_0xc0cc('0x30')][_0xc0cc('0x44')](_0x41b30a);})['then'](function(_0x20f75c){_0x2e1471[_0xc0cc('0x45')]=_0x20f75c;return _0x2e1471;})[_0xc0cc('0x27')](respondWithFilteredResult(_0x1ab305,_0x41b30a))[_0xc0cc('0x46')](handleError(_0x1ab305,null));};exports[_0xc0cc('0x47')]=function(_0x108a24,_0x4c4fb1){var _0x16f5ca={'raw':![],'where':{'id':_0x108a24[_0xc0cc('0x48')]['id']}},_0x5603aa={};_0x5603aa[_0xc0cc('0x33')]=_[_0xc0cc('0x34')](db[_0xc0cc('0x30')][_0xc0cc('0x31')]);_0x5603aa['query']=_['keys'](_0x108a24['query']);_0x5603aa['filters']=_['intersection'](_0x5603aa[_0xc0cc('0x33')],_0x5603aa[_0xc0cc('0x35')]);_0x16f5ca[_0xc0cc('0x39')]=_['intersection'](_0x5603aa[_0xc0cc('0x33')],qs[_0xc0cc('0x38')](_0x108a24[_0xc0cc('0x35')][_0xc0cc('0x38')]));_0x16f5ca[_0xc0cc('0x39')]=_0x16f5ca[_0xc0cc('0x39')][_0xc0cc('0x49')]?_0x16f5ca[_0xc0cc('0x39')]:_0x5603aa[_0xc0cc('0x33')];if(_0x108a24[_0xc0cc('0x35')][_0xc0cc('0x4a')]){_0x16f5ca[_0xc0cc('0x43')]=[{'all':!![]}];}_0x16f5ca=_[_0xc0cc('0x42')]({},_0x16f5ca,_0x108a24[_0xc0cc('0x4b')]);return db['VoiceMusicOnHold']['find'](_0x16f5ca)[_0xc0cc('0x27')](handleEntityNotFound(_0x4c4fb1,null))[_0xc0cc('0x27')](respondWithResult(_0x4c4fb1,null))[_0xc0cc('0x46')](handleError(_0x4c4fb1,null));};exports[_0xc0cc('0x26')]=function(_0x23ea8d,_0x54877e){if(_0x23ea8d['body']['id']){delete _0x23ea8d[_0xc0cc('0x4c')]['id'];}return db[_0xc0cc('0x30')]['find']({'where':{'id':_0x23ea8d[_0xc0cc('0x48')]['id']}})[_0xc0cc('0x27')](handleEntityNotFound(_0x54877e,null))[_0xc0cc('0x27')](saveUpdates(_0x23ea8d[_0xc0cc('0x4c')],null))[_0xc0cc('0x27')](respondWithResult(_0x54877e,null))[_0xc0cc('0x46')](handleError(_0x54877e,null));};exports[_0xc0cc('0x4d')]=function(_0x58aee5,_0x300dad,_0x23b376){return db[_0xc0cc('0x4e')]['transaction'](function(_0x194828){if(_0x58aee5['body'][_0xc0cc('0x4f')]==='files'){_0x58aee5['body']['directory']=path[_0xc0cc('0x50')](config[_0xc0cc('0x51')],'server/files/moh',_0x58aee5['body'][_0xc0cc('0x2c')]);}return db[_0xc0cc('0x30')][_0xc0cc('0x4d')](_0x58aee5[_0xc0cc('0x4c')],{'transaction':_0x194828})['then'](function(_0x3bce43){if(_0x58aee5[_0xc0cc('0x4c')][_0xc0cc('0x4f')]==='files'){fs[_0xc0cc('0x52')](_0x3bce43[_0xc0cc('0x53')],parseInt(_0xc0cc('0x54'),0x8));}var _0x52a501=_0x58aee5[_0xc0cc('0x55')]['get']({'plain':!![]});if(!_0x52a501)throw new Error(_0xc0cc('0x56'));if(_0x52a501[_0xc0cc('0x57')]===_0xc0cc('0x55')){var _0x2f2a3d=_0x3bce43[_0xc0cc('0x28')]({'plain':!![]});return db[_0xc0cc('0x58')][_0xc0cc('0x59')]({'where':{'name':_0xc0cc('0x5a'),'userProfileId':_0x52a501['userProfileId']},'raw':!![]})[_0xc0cc('0x27')](function(_0x1fad5d){if(_0x1fad5d&&_0x1fad5d['autoAssociation']===0x0){return db[_0xc0cc('0x5b')][_0xc0cc('0x4d')]({'name':_0x2f2a3d[_0xc0cc('0x2c')],'resourceId':_0x2f2a3d['id'],'type':_0x1fad5d[_0xc0cc('0x2c')],'sectionId':_0x1fad5d['id']},{})[_0xc0cc('0x27')](function(){return _0x3bce43;});}else{return _0x3bce43;}})[_0xc0cc('0x46')](function(_0x34642a){logger[_0xc0cc('0x2a')](_0xc0cc('0x5c'),_0x34642a);});}return _0x3bce43;});})[_0xc0cc('0x27')](respondWithResult(_0x300dad,0xc9))[_0xc0cc('0x46')](handleError(_0x300dad,null));};exports[_0xc0cc('0x29')]=function(_0x1a098a,_0x2ef855,_0x46a0a4){var _0x582ce1;return db[_0xc0cc('0x30')][_0xc0cc('0x59')]({'where':{'id':_0x1a098a['params']['id']}})[_0xc0cc('0x27')](function(_0x5e5184){if(_0x5e5184){return db[_0xc0cc('0x4e')]['transaction'](function(_0x495eb1){return _0x5e5184[_0xc0cc('0x29')]({'transaction':_0x495eb1,'raw':!![]})['then'](function(_0x4cb886){if(_0x4cb886[_0xc0cc('0x53')]){fs['readdirSync'](_0x4cb886['directory'])['forEach'](function(_0x65aa06){fs[_0xc0cc('0x5d')](path[_0xc0cc('0x50')](_0x4cb886[_0xc0cc('0x53')],_0x65aa06));});fs[_0xc0cc('0x5e')](_0x4cb886['directory']);}return _0x4cb886;});})[_0xc0cc('0x46')](function(_0x556fd1){throw new db['Sequelize'][(_0xc0cc('0x5f'))](_0x556fd1['message']);});}})['then'](handleEntityNotFound(_0x2ef855,null))[_0xc0cc('0x27')](removeEntity(_0x2ef855,null))['catch'](handleError(_0x2ef855,null));};exports[_0xc0cc('0x60')]=function(_0x37d341,_0x7d32cd,_0x3b5f70){return db[_0xc0cc('0x4e')][_0xc0cc('0x61')](function(_0x360125){var _0x2fb3ff;return db[_0xc0cc('0x30')]['find']({'where':{'id':_0x37d341[_0xc0cc('0x48')]['id']}})[_0xc0cc('0x27')](function(_0xd81a43){if(_0xd81a43){_0x2fb3ff=_0xd81a43;return _0xd81a43[_0xc0cc('0x60')](_0x37d341['body']['id'],{'transaction':_0x360125});}})['then'](function(_0x49eef6){if(_0x49eef6){return db[_0xc0cc('0x62')][_0xc0cc('0x63')]({'where':{'id':_0x37d341[_0xc0cc('0x4c')]['id']},'attributes':['id',_0xc0cc('0x2c'),_0xc0cc('0x64'),'converted_format',_0xc0cc('0x65')],'raw':!![]});}})[_0xc0cc('0x27')](function(_0x16ee7f){if(_0x16ee7f){var _0x3eb36f=path[_0xc0cc('0x50')](config[_0xc0cc('0x51')],'server/files/sounds/converted',util['format'](_0xc0cc('0x66'),path['basename'](_0x16ee7f[_0xc0cc('0x64')],path[_0xc0cc('0x67')](_0x16ee7f[_0xc0cc('0x64')])),_0x16ee7f[_0xc0cc('0x68')]));var _0x3efc06=path[_0xc0cc('0x50')](config[_0xc0cc('0x51')],_0xc0cc('0x69'),_0x2fb3ff[_0xc0cc('0x2c')],util[_0xc0cc('0x6a')](_0xc0cc('0x66'),_0x16ee7f[_0xc0cc('0x2c')],_0x16ee7f[_0xc0cc('0x68')]));fs[_0xc0cc('0x6b')](_0x3eb36f,_0x3efc06);return _0x16ee7f;}})[_0xc0cc('0x46')](function(_0x307eda){throw new db[(_0xc0cc('0x6c'))][(_0xc0cc('0x5f'))](_0x307eda[_0xc0cc('0x6d')]);});})[_0xc0cc('0x27')](handleEntityNotFound(_0x7d32cd,null))['then'](respondWithResult(_0x7d32cd,0xc9))[_0xc0cc('0x46')](handleError(_0x7d32cd,null));};exports[_0xc0cc('0x6e')]=function(_0x4ceb67,_0x307a5a,_0x7cfde6){return db[_0xc0cc('0x4e')]['transaction'](function(_0x505173){var _0x29be0f;return db[_0xc0cc('0x30')][_0xc0cc('0x63')]({'where':{'id':_0x4ceb67[_0xc0cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x307a5a,null))[_0xc0cc('0x27')](function(_0x41d1db){if(_0x41d1db){_0x29be0f=_0x41d1db;return _0x41d1db[_0xc0cc('0x6e')](_0x4ceb67['params']['id2']);}})['then'](function(_0x39cd71){if(_0x39cd71){return db['Sound'][_0xc0cc('0x63')]({'where':{'id':_0x4ceb67[_0xc0cc('0x48')][_0xc0cc('0x6f')]},'attributes':['id','name',_0xc0cc('0x64'),_0xc0cc('0x68'),_0xc0cc('0x65')],'raw':!![]});}})[_0xc0cc('0x27')](function(_0xcee41d){if(_0xcee41d){fs['unlinkSync'](path[_0xc0cc('0x50')](_0x29be0f[_0xc0cc('0x53')],util[_0xc0cc('0x6a')]('%s.%s',_0xcee41d[_0xc0cc('0x2c')],_0xcee41d['converted_format'])));return _0xcee41d;}})[_0xc0cc('0x46')](function(_0x127707){throw new db[(_0xc0cc('0x6c'))][(_0xc0cc('0x5f'))](_0x127707['message']);});})[_0xc0cc('0x27')](handleEntityNotFound(_0x307a5a,null))[_0xc0cc('0x27')](respondWithStatusCode(_0x307a5a,0xcc))[_0xc0cc('0x46')](handleError(_0x307a5a,null));};exports[_0xc0cc('0x70')]=function(_0x4c297c,_0x4a526b,_0x579ee2){var _0x2ca98a={};var _0x5d59d6={};var _0x5f0b97;var _0x151607;return db[_0xc0cc('0x30')][_0xc0cc('0x63')]({'where':{'id':_0x4c297c[_0xc0cc('0x48')]['id']}})[_0xc0cc('0x27')](handleEntityNotFound(_0x4a526b,null))[_0xc0cc('0x27')](function(_0x4d9d7d){if(_0x4d9d7d){_0x5f0b97=_0x4d9d7d;_0x5d59d6[_0xc0cc('0x33')]=_[_0xc0cc('0x34')](db['Sound'][_0xc0cc('0x31')]);_0x5d59d6[_0xc0cc('0x35')]=_[_0xc0cc('0x34')](_0x4c297c['query']);_0x5d59d6[_0xc0cc('0x36')]=_[_0xc0cc('0x37')](_0x5d59d6[_0xc0cc('0x33')],_0x5d59d6[_0xc0cc('0x35')]);_0x2ca98a[_0xc0cc('0x39')]=_[_0xc0cc('0x37')](_0x5d59d6['model'],qs[_0xc0cc('0x38')](_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x38')]));_0x2ca98a['attributes']=_0x2ca98a[_0xc0cc('0x39')][_0xc0cc('0x49')]?_0x2ca98a[_0xc0cc('0x39')]:_0x5d59d6[_0xc0cc('0x33')];_0x2ca98a[_0xc0cc('0x3b')]=qs['sort'](_0x4c297c[_0xc0cc('0x35')]['sort']);_0x2ca98a['where']=qs[_0xc0cc('0x36')](_[_0xc0cc('0x3d')](_0x4c297c['query'],_0x5d59d6[_0xc0cc('0x36')]));if(_0x4c297c['query']['filter']){_0x2ca98a[_0xc0cc('0x3f')]=_[_0xc0cc('0x42')](_0x2ca98a[_0xc0cc('0x3f')],{'$or':_[_0xc0cc('0x2f')](_0x2ca98a[_0xc0cc('0x39')],function(_0x1ae552){var _0x4adf41={};_0x4adf41[_0x1ae552]={'$like':'%'+_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x3e')]+'%'};return _0x4adf41;})});}_0x2ca98a=_[_0xc0cc('0x42')]({},_0x2ca98a,_0x4c297c[_0xc0cc('0x4b')]);return _0x5f0b97[_0xc0cc('0x70')](_0x2ca98a);}})['then'](function(_0x1440e3){if(_0x1440e3){_0x151607=_0x1440e3[_0xc0cc('0x49')];if(!_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x3a')](_0xc0cc('0x71'))){_0x2ca98a['limit']=qs[_0xc0cc('0x20')](_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x20')]);_0x2ca98a[_0xc0cc('0x22')]=qs[_0xc0cc('0x22')](_0x4c297c[_0xc0cc('0x35')][_0xc0cc('0x22')]);}return _0x5f0b97[_0xc0cc('0x70')](_0x2ca98a);}})[_0xc0cc('0x27')](function(_0x11e38d){if(_0x11e38d){return _0x11e38d?{'count':_0x151607,'rows':_0x11e38d}:null;}})[_0xc0cc('0x27')](respondWithResult(_0x4a526b,null))[_0xc0cc('0x46')](handleError(_0x4a526b,null));}; \ No newline at end of file +var _0xda63=['key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','params','keys','find','body','catch','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','basename','extname','symlinkSync','removeSound','findOne','id2','%s.%s','Sequelize','getSounds','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName'];(function(_0x389e88,_0x1665bf){var _0x563812=function(_0x1eca88){while(--_0x1eca88){_0x389e88['push'](_0x389e88['shift']());}};_0x563812(++_0x1665bf);}(_0xda63,0xb2));var _0x3da6=function(_0x485c12,_0x63ee16){_0x485c12=_0x485c12-0x0;var _0x5c87ad=_0xda63[_0x485c12];return _0x5c87ad;};'use strict';var emlformat=require(_0x3da6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3da6('0x1'));var rp=require(_0x3da6('0x2'));var moment=require(_0x3da6('0x3'));var BPromise=require(_0x3da6('0x4'));var Mustache=require(_0x3da6('0x5'));var util=require(_0x3da6('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3da6('0x7'));var fs=require('fs');var fs_extra=require(_0x3da6('0x8'));var _=require(_0x3da6('0x9'));var squel=require(_0x3da6('0xa'));var crypto=require(_0x3da6('0xb'));var jsforce=require(_0x3da6('0xc'));var deskjs=require(_0x3da6('0xd'));var toCsv=require(_0x3da6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3da6('0xf'));var authService=require(_0x3da6('0x10'));var qs=require(_0x3da6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3da6('0x12'));var logger=require(_0x3da6('0x13'))(_0x3da6('0x14'));var utils=require(_0x3da6('0x15'));var config=require(_0x3da6('0x16'));var licenseUtil=require(_0x3da6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5de390,_0x48c365){_0x48c365=_0x48c365||0xcc;return function(_0x188d00){if(_0x188d00){return _0x5de390[_0x3da6('0x18')](_0x48c365);}return _0x5de390['status'](_0x48c365)[_0x3da6('0x19')]();};}function respondWithResult(_0x4699a1,_0x1d5039){_0x1d5039=_0x1d5039||0xc8;return function(_0x4e19f4){if(_0x4e19f4){return _0x4699a1['status'](_0x1d5039)[_0x3da6('0x1a')](_0x4e19f4);}};}function respondWithFilteredResult(_0x514ce6,_0x294c73){return function(_0x15729d){if(_0x15729d){var _0x2fb02e=typeof _0x294c73[_0x3da6('0x1b')]===_0x3da6('0x1c')&&typeof _0x294c73[_0x3da6('0x1d')]===_0x3da6('0x1c');var _0x66c41a=_0x15729d[_0x3da6('0x1e')];var _0x4be5e0=_0x2fb02e?0x0:_0x294c73['offset'];var _0x492346=_0x2fb02e?_0x15729d[_0x3da6('0x1e')]:_0x294c73[_0x3da6('0x1b')]+_0x294c73['limit'];var _0x281874;if(_0x492346>=_0x66c41a){_0x492346=_0x66c41a;_0x281874=0xc8;}else{_0x281874=0xce;}_0x514ce6[_0x3da6('0x1f')](_0x281874);return _0x514ce6['set'](_0x3da6('0x20'),_0x4be5e0+'-'+_0x492346+'/'+_0x66c41a)[_0x3da6('0x1a')](_0x15729d);}return null;};}function patchUpdates(_0x438123){return function(_0x441d37){try{jsonpatch[_0x3da6('0x21')](_0x441d37,_0x438123,!![]);}catch(_0x19ee61){return BPromise['reject'](_0x19ee61);}return _0x441d37[_0x3da6('0x22')]();};}function saveUpdates(_0x125525,_0x568ba0){return function(_0x434bd1){if(_0x434bd1){return _0x434bd1[_0x3da6('0x23')](_0x125525)[_0x3da6('0x24')](function(_0x4b9443){return _0x4b9443;});}return null;};}function removeEntity(_0x5ef836,_0x4bfa97){return function(_0x5ed11c){if(_0x5ed11c){return _0x5ed11c[_0x3da6('0x25')]()[_0x3da6('0x24')](function(){var _0x4bfbfb=_0x5ed11c[_0x3da6('0x26')]({'plain':!![]});var _0x26eccf=_0x3da6('0x27');return db[_0x3da6('0x28')][_0x3da6('0x25')]({'where':{'type':_0x26eccf,'resourceId':_0x4bfbfb['id']}})['then'](function(){return _0x5ed11c;});})[_0x3da6('0x24')](function(){_0x5ef836['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4f80,_0x5b924e){return function(_0x2edcef){if(!_0x2edcef){_0x3c4f80[_0x3da6('0x18')](0x194);}return _0x2edcef;};}function handleError(_0x361434,_0x4e066f){_0x4e066f=_0x4e066f||0x1f4;return function(_0x5e209b){logger[_0x3da6('0x29')](_0x5e209b[_0x3da6('0x2a')]);if(_0x5e209b['name']){delete _0x5e209b[_0x3da6('0x2b')];}_0x361434[_0x3da6('0x1f')](_0x4e066f)[_0x3da6('0x2c')](_0x5e209b);};}exports[_0x3da6('0x2d')]=function(_0x33212b,_0x32ce67){var _0x2eaa45={},_0x2831c2={},_0x364984={'count':0x0,'rows':[]};var _0x3e6cd9=_[_0x3da6('0x2e')](db[_0x3da6('0x2f')][_0x3da6('0x30')],function(_0x22fd93){return{'name':_0x22fd93[_0x3da6('0x31')],'type':_0x22fd93['type'][_0x3da6('0x32')]};});_0x2831c2['model']=_['map'](_0x3e6cd9,_0x3da6('0x2b'));_0x2831c2[_0x3da6('0x33')]=_['keys'](_0x33212b['query']);_0x2831c2[_0x3da6('0x34')]=_[_0x3da6('0x35')](_0x2831c2[_0x3da6('0x36')],_0x2831c2[_0x3da6('0x33')]);_0x2eaa45['attributes']=_[_0x3da6('0x35')](_0x2831c2[_0x3da6('0x36')],qs[_0x3da6('0x37')](_0x33212b[_0x3da6('0x33')][_0x3da6('0x37')]));_0x2eaa45[_0x3da6('0x38')]=_0x2eaa45[_0x3da6('0x38')][_0x3da6('0x39')]?_0x2eaa45[_0x3da6('0x38')]:_0x2831c2['model'];if(!_0x33212b[_0x3da6('0x33')][_0x3da6('0x3a')](_0x3da6('0x3b'))){_0x2eaa45[_0x3da6('0x1d')]=qs[_0x3da6('0x1d')](_0x33212b[_0x3da6('0x33')]['limit']);_0x2eaa45[_0x3da6('0x1b')]=qs[_0x3da6('0x1b')](_0x33212b['query'][_0x3da6('0x1b')]);}_0x2eaa45[_0x3da6('0x3c')]=qs[_0x3da6('0x3d')](_0x33212b[_0x3da6('0x33')]['sort']);delete _0x33212b['query'][_0x3da6('0x3d')];_0x2eaa45[_0x3da6('0x3e')]=qs[_0x3da6('0x34')](_[_0x3da6('0x3f')](_0x33212b[_0x3da6('0x33')],_0x2831c2[_0x3da6('0x34')]),_0x3e6cd9);if(_0x33212b[_0x3da6('0x33')]['filter']){_0x2eaa45[_0x3da6('0x3e')]=_[_0x3da6('0x40')](_0x2eaa45[_0x3da6('0x3e')],{'$or':_[_0x3da6('0x2e')](_0x3e6cd9,function(_0x4a124e){if(_0x4a124e['type']!==_0x3da6('0x41')){var _0x5c3720={};_0x5c3720[_0x4a124e[_0x3da6('0x2b')]]={'$like':'%'+_0x33212b[_0x3da6('0x33')][_0x3da6('0x42')]+'%'};return _0x5c3720;}})});}_0x2eaa45=_[_0x3da6('0x40')]({},_0x2eaa45,_0x33212b[_0x3da6('0x43')]);var _0x146024={'where':_0x2eaa45[_0x3da6('0x3e')]};return db[_0x3da6('0x2f')][_0x3da6('0x1e')](_0x146024)[_0x3da6('0x24')](function(_0x3339ed){_0x364984['count']=_0x3339ed;if(_0x33212b[_0x3da6('0x33')][_0x3da6('0x44')]){_0x2eaa45['include']=[{'all':!![]}];}return db[_0x3da6('0x2f')]['findAll'](_0x2eaa45);})[_0x3da6('0x24')](function(_0x1e0841){_0x364984['rows']=_0x1e0841;return _0x364984;})[_0x3da6('0x24')](respondWithFilteredResult(_0x32ce67,_0x2eaa45))['catch'](handleError(_0x32ce67,null));};exports[_0x3da6('0x45')]=function(_0x37bffe,_0x2c855b){var _0x1b78de={'raw':![],'where':{'id':_0x37bffe[_0x3da6('0x46')]['id']}},_0x3da9ac={};_0x3da9ac[_0x3da6('0x36')]=_['keys'](db[_0x3da6('0x2f')][_0x3da6('0x30')]);_0x3da9ac['query']=_[_0x3da6('0x47')](_0x37bffe[_0x3da6('0x33')]);_0x3da9ac[_0x3da6('0x34')]=_[_0x3da6('0x35')](_0x3da9ac[_0x3da6('0x36')],_0x3da9ac[_0x3da6('0x33')]);_0x1b78de[_0x3da6('0x38')]=_['intersection'](_0x3da9ac['model'],qs[_0x3da6('0x37')](_0x37bffe[_0x3da6('0x33')][_0x3da6('0x37')]));_0x1b78de[_0x3da6('0x38')]=_0x1b78de[_0x3da6('0x38')]['length']?_0x1b78de[_0x3da6('0x38')]:_0x3da9ac[_0x3da6('0x36')];if(_0x37bffe[_0x3da6('0x33')][_0x3da6('0x44')]){_0x1b78de['include']=[{'all':!![]}];}_0x1b78de=_[_0x3da6('0x40')]({},_0x1b78de,_0x37bffe[_0x3da6('0x43')]);return db[_0x3da6('0x2f')][_0x3da6('0x48')](_0x1b78de)[_0x3da6('0x24')](handleEntityNotFound(_0x2c855b,null))[_0x3da6('0x24')](respondWithResult(_0x2c855b,null))['catch'](handleError(_0x2c855b,null));};exports[_0x3da6('0x23')]=function(_0x146966,_0xa8e699){if(_0x146966[_0x3da6('0x49')]['id']){delete _0x146966['body']['id'];}return db[_0x3da6('0x2f')]['find']({'where':{'id':_0x146966[_0x3da6('0x46')]['id']}})[_0x3da6('0x24')](handleEntityNotFound(_0xa8e699,null))[_0x3da6('0x24')](saveUpdates(_0x146966['body'],null))[_0x3da6('0x24')](respondWithResult(_0xa8e699,null))[_0x3da6('0x4a')](handleError(_0xa8e699,null));};exports[_0x3da6('0x4b')]=function(_0xe1b561,_0x4fe98e,_0x578292){return db[_0x3da6('0x4c')][_0x3da6('0x4d')](function(_0x2f66a4){if(_0xe1b561[_0x3da6('0x49')][_0x3da6('0x4e')]===_0x3da6('0x4f')){_0xe1b561[_0x3da6('0x49')][_0x3da6('0x50')]=path[_0x3da6('0x51')](config['root'],_0x3da6('0x52'),_0xe1b561[_0x3da6('0x49')][_0x3da6('0x2b')]);}return db[_0x3da6('0x2f')][_0x3da6('0x4b')](_0xe1b561[_0x3da6('0x49')],{'transaction':_0x2f66a4})['then'](function(_0x386a74){if(_0xe1b561['body']['mode']===_0x3da6('0x4f')){fs[_0x3da6('0x53')](_0x386a74[_0x3da6('0x50')],parseInt(_0x3da6('0x54'),0x8));}var _0x570dae=_0xe1b561[_0x3da6('0x55')][_0x3da6('0x26')]({'plain':!![]});if(!_0x570dae)throw new Error(_0x3da6('0x56'));if(_0x570dae[_0x3da6('0x57')]==='user'){var _0x1704b1=_0x386a74[_0x3da6('0x26')]({'plain':!![]});return db[_0x3da6('0x58')][_0x3da6('0x48')]({'where':{'name':_0x3da6('0x27'),'userProfileId':_0x570dae[_0x3da6('0x59')]},'raw':!![]})[_0x3da6('0x24')](function(_0x4ea259){if(_0x4ea259&&_0x4ea259[_0x3da6('0x5a')]===0x0){return db['UserProfileResource'][_0x3da6('0x4b')]({'name':_0x1704b1[_0x3da6('0x2b')],'resourceId':_0x1704b1['id'],'type':_0x4ea259[_0x3da6('0x2b')],'sectionId':_0x4ea259['id']},{})['then'](function(){return _0x386a74;});}else{return _0x386a74;}})[_0x3da6('0x4a')](function(_0x2fe0ea){logger[_0x3da6('0x29')](_0x3da6('0x5b'),_0x2fe0ea);});}return _0x386a74;});})[_0x3da6('0x24')](respondWithResult(_0x4fe98e,0xc9))['catch'](handleError(_0x4fe98e,null));};exports[_0x3da6('0x25')]=function(_0x36b3ef,_0x1af26c,_0xca2e31){var _0x194f29;return db['VoiceMusicOnHold'][_0x3da6('0x48')]({'where':{'id':_0x36b3ef[_0x3da6('0x46')]['id']}})[_0x3da6('0x24')](function(_0x270c74){if(_0x270c74){return db[_0x3da6('0x4c')][_0x3da6('0x4d')](function(_0x10985f){return _0x270c74['destroy']({'transaction':_0x10985f,'raw':!![]})[_0x3da6('0x24')](function(_0x36aa40){if(_0x36aa40['directory']){fs[_0x3da6('0x5c')](_0x36aa40[_0x3da6('0x50')])[_0x3da6('0x5d')](function(_0x58e292){fs[_0x3da6('0x5e')](path[_0x3da6('0x51')](_0x36aa40[_0x3da6('0x50')],_0x58e292));});fs['rmdirSync'](_0x36aa40[_0x3da6('0x50')]);}return _0x36aa40;});})[_0x3da6('0x4a')](function(_0x3eaeba){throw new db['Sequelize'][(_0x3da6('0x5f'))](_0x3eaeba[_0x3da6('0x60')]);});}})[_0x3da6('0x24')](handleEntityNotFound(_0x1af26c,null))['then'](removeEntity(_0x1af26c,null))[_0x3da6('0x4a')](handleError(_0x1af26c,null));};exports[_0x3da6('0x61')]=function(_0x13df01,_0x415d86,_0x46c4d6){return db[_0x3da6('0x4c')][_0x3da6('0x4d')](function(_0x552ca1){var _0x548a38;return db[_0x3da6('0x2f')][_0x3da6('0x48')]({'where':{'id':_0x13df01[_0x3da6('0x46')]['id']}})[_0x3da6('0x24')](function(_0x1da95b){if(_0x1da95b){_0x548a38=_0x1da95b;return _0x1da95b[_0x3da6('0x61')](_0x13df01['body']['id'],{'transaction':_0x552ca1});}})[_0x3da6('0x24')](function(_0x167c3a){if(_0x167c3a){return db[_0x3da6('0x62')]['findOne']({'where':{'id':_0x13df01[_0x3da6('0x49')]['id']},'attributes':['id',_0x3da6('0x2b'),_0x3da6('0x63'),_0x3da6('0x64'),_0x3da6('0x65')],'raw':!![]});}})[_0x3da6('0x24')](function(_0x5cd568){if(_0x5cd568){var _0x3ab048=path['join'](config[_0x3da6('0x66')],_0x3da6('0x67'),util[_0x3da6('0x68')]('%s.%s',path[_0x3da6('0x69')](_0x5cd568[_0x3da6('0x63')],path[_0x3da6('0x6a')](_0x5cd568[_0x3da6('0x63')])),_0x5cd568[_0x3da6('0x64')]));var _0x2fd0ed=path['join'](config[_0x3da6('0x66')],'server/files/moh',_0x548a38['name'],util['format']('%s.%s',_0x5cd568[_0x3da6('0x2b')],_0x5cd568['converted_format']));fs[_0x3da6('0x6b')](_0x3ab048,_0x2fd0ed);return _0x5cd568;}})[_0x3da6('0x4a')](function(_0x3da12e){throw new db['Sequelize'][(_0x3da6('0x5f'))](_0x3da12e[_0x3da6('0x60')]);});})[_0x3da6('0x24')](handleEntityNotFound(_0x415d86,null))[_0x3da6('0x24')](respondWithResult(_0x415d86,0xc9))[_0x3da6('0x4a')](handleError(_0x415d86,null));};exports[_0x3da6('0x6c')]=function(_0x59ff10,_0xb21fa9,_0x94d6ce){return db[_0x3da6('0x4c')]['transaction'](function(_0x37ecd5){var _0x51460a;return db[_0x3da6('0x2f')][_0x3da6('0x6d')]({'where':{'id':_0x59ff10[_0x3da6('0x46')]['id']}})[_0x3da6('0x24')](handleEntityNotFound(_0xb21fa9,null))['then'](function(_0x26d19d){if(_0x26d19d){_0x51460a=_0x26d19d;return _0x26d19d['removeSound'](_0x59ff10[_0x3da6('0x46')][_0x3da6('0x6e')]);}})[_0x3da6('0x24')](function(_0x4507f3){if(_0x4507f3){return db[_0x3da6('0x62')][_0x3da6('0x6d')]({'where':{'id':_0x59ff10[_0x3da6('0x46')][_0x3da6('0x6e')]},'attributes':['id',_0x3da6('0x2b'),_0x3da6('0x63'),'converted_format',_0x3da6('0x65')],'raw':!![]});}})['then'](function(_0x4072d5){if(_0x4072d5){fs[_0x3da6('0x5e')](path[_0x3da6('0x51')](_0x51460a['directory'],util['format'](_0x3da6('0x6f'),_0x4072d5[_0x3da6('0x2b')],_0x4072d5['converted_format'])));return _0x4072d5;}})[_0x3da6('0x4a')](function(_0x2fd6d5){throw new db[(_0x3da6('0x70'))]['ValidationError'](_0x2fd6d5['message']);});})[_0x3da6('0x24')](handleEntityNotFound(_0xb21fa9,null))[_0x3da6('0x24')](respondWithStatusCode(_0xb21fa9,0xcc))[_0x3da6('0x4a')](handleError(_0xb21fa9,null));};exports[_0x3da6('0x71')]=function(_0x15d1bd,_0x447634,_0x561028){var _0x19bc46={};var _0x12868e={};var _0x1a7f95;var _0x5582d7;return db[_0x3da6('0x2f')]['findOne']({'where':{'id':_0x15d1bd['params']['id']}})['then'](handleEntityNotFound(_0x447634,null))[_0x3da6('0x24')](function(_0x4a1cbc){if(_0x4a1cbc){_0x1a7f95=_0x4a1cbc;_0x12868e['model']=_['keys'](db['Sound']['rawAttributes']);_0x12868e[_0x3da6('0x33')]=_[_0x3da6('0x47')](_0x15d1bd[_0x3da6('0x33')]);_0x12868e[_0x3da6('0x34')]=_[_0x3da6('0x35')](_0x12868e[_0x3da6('0x36')],_0x12868e[_0x3da6('0x33')]);_0x19bc46[_0x3da6('0x38')]=_['intersection'](_0x12868e[_0x3da6('0x36')],qs['fields'](_0x15d1bd[_0x3da6('0x33')][_0x3da6('0x37')]));_0x19bc46[_0x3da6('0x38')]=_0x19bc46['attributes']['length']?_0x19bc46[_0x3da6('0x38')]:_0x12868e[_0x3da6('0x36')];_0x19bc46[_0x3da6('0x3c')]=qs[_0x3da6('0x3d')](_0x15d1bd['query'][_0x3da6('0x3d')]);_0x19bc46[_0x3da6('0x3e')]=qs[_0x3da6('0x34')](_[_0x3da6('0x3f')](_0x15d1bd[_0x3da6('0x33')],_0x12868e[_0x3da6('0x34')]));if(_0x15d1bd['query'][_0x3da6('0x42')]){_0x19bc46['where']=_[_0x3da6('0x40')](_0x19bc46[_0x3da6('0x3e')],{'$or':_[_0x3da6('0x2e')](_0x19bc46[_0x3da6('0x38')],function(_0x14c37b){var _0x337af7={};_0x337af7[_0x14c37b]={'$like':'%'+_0x15d1bd[_0x3da6('0x33')][_0x3da6('0x42')]+'%'};return _0x337af7;})});}_0x19bc46=_[_0x3da6('0x40')]({},_0x19bc46,_0x15d1bd[_0x3da6('0x43')]);return _0x1a7f95[_0x3da6('0x71')](_0x19bc46);}})[_0x3da6('0x24')](function(_0x356c04){if(_0x356c04){_0x5582d7=_0x356c04[_0x3da6('0x39')];if(!_0x15d1bd[_0x3da6('0x33')][_0x3da6('0x3a')](_0x3da6('0x3b'))){_0x19bc46['limit']=qs['limit'](_0x15d1bd[_0x3da6('0x33')][_0x3da6('0x1d')]);_0x19bc46[_0x3da6('0x1b')]=qs[_0x3da6('0x1b')](_0x15d1bd[_0x3da6('0x33')][_0x3da6('0x1b')]);}return _0x1a7f95[_0x3da6('0x71')](_0x19bc46);}})[_0x3da6('0x24')](function(_0x48b28c){if(_0x48b28c){return _0x48b28c?{'count':_0x5582d7,'rows':_0x48b28c}:null;}})['then'](respondWithResult(_0x447634,null))['catch'](handleError(_0x447634,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8f1af00..e95bf62 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 _0x47ce=['lodash','util','../../config/logger','api','moment','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x6f645f,_0x41abbd){var _0x11affa=function(_0x4c75a8){while(--_0x4c75a8){_0x6f645f['push'](_0x6f645f['shift']());}};_0x11affa(++_0x41abbd);}(_0x47ce,0x13f));var _0xe47c=function(_0x3413bd,_0x244c45){_0x3413bd=_0x3413bd-0x0;var _0x145e8e=_0x47ce[_0x3413bd];return _0x145e8e;};'use strict';var _=require(_0xe47c('0x0'));var util=require(_0xe47c('0x1'));var logger=require(_0xe47c('0x2'))(_0xe47c('0x3'));var moment=require(_0xe47c('0x4'));var BPromise=require('bluebird');var rp=require(_0xe47c('0x5'));var fs=require('fs');var path=require(_0xe47c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe47c('0x7'));module[_0xe47c('0x8')]=function(_0x1501ae,_0x44538e){return _0x1501ae[_0xe47c('0x9')](_0xe47c('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dd2=['api','moment','bluebird','path','rimraf','../../config/environment','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x8dd2,0x8d));var _0x28dd=function(_0x44e535,_0x2e4be6){_0x44e535=_0x44e535-0x0;var _0x3b46eb=_0x8dd2[_0x44e535];return _0x3b46eb;};'use strict';var _=require(_0x28dd('0x0'));var util=require(_0x28dd('0x1'));var logger=require(_0x28dd('0x2'))(_0x28dd('0x3'));var moment=require(_0x28dd('0x4'));var BPromise=require(_0x28dd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28dd('0x6'));var rimraf=require(_0x28dd('0x7'));var config=require(_0x28dd('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x59051d,_0xd357cd){return _0x59051d[_0x28dd('0x9')](_0x28dd('0xa'),attributes,{'tableName':_0x28dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d570d63..1b063b2 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd84e21,_0x1365e6){var _0xa52c5f=function(_0x3c8a90){while(--_0x3c8a90){_0xd84e21['push'](_0xd84e21['shift']());}};_0xa52c5f(++_0x1365e6);}(_0x70e0,0x17b));var _0x070e=function(_0x376e45,_0x292900){_0x376e45=_0x376e45-0x0;var _0x5008ab=_0x70e0[_0x376e45];return _0x5008ab;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0xb2f21,_0x46b3f1){var _0x105c71=function(_0x3bdec4){while(--_0x3bdec4){_0xb2f21['push'](_0xb2f21['shift']());}};_0x105c71(++_0x46b3f1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0xcb91[_0x22ffbf];return _0x360c17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index b3774fc..28a2589 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 _0xc992=['delete','destroy','removeAgents','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/users','/:id/teams','post','create','addAgents','addTeams','put','update'];(function(_0x5e3a59,_0x5e5af8){var _0x4c8605=function(_0x346521){while(--_0x346521){_0x5e3a59['push'](_0x5e3a59['shift']());}};_0x4c8605(++_0x5e5af8);}(_0xc992,0xbb));var _0x2c99=function(_0x5bea0d,_0x32f9db){_0x5bea0d=_0x5bea0d-0x0;var _0x2542c5=_0xc992[_0x5bea0d];return _0x2542c5;};'use strict';var multer=require(_0x2c99('0x0'));var util=require('util');var path=require(_0x2c99('0x1'));var timeout=require(_0x2c99('0x2'));var express=require('express');var router=express[_0x2c99('0x3')]();var fs_extra=require(_0x2c99('0x4'));var auth=require(_0x2c99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c99('0x6'));var controller=require('./voicePrefix.controller');router[_0x2c99('0x7')]('/',auth[_0x2c99('0x8')](),controller[_0x2c99('0x9')]);router[_0x2c99('0x7')](_0x2c99('0xa'),auth[_0x2c99('0x8')](),controller['describe']);router[_0x2c99('0x7')](_0x2c99('0xb'),auth[_0x2c99('0x8')](),controller[_0x2c99('0xc')]);router['get'](_0x2c99('0xd'),auth[_0x2c99('0x8')](),controller['getAgents']);router[_0x2c99('0x7')](_0x2c99('0xe'),auth[_0x2c99('0x8')](),controller['getTeams']);router[_0x2c99('0xf')]('/',auth[_0x2c99('0x8')](),controller[_0x2c99('0x10')]);router[_0x2c99('0xf')](_0x2c99('0xd'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x11')]);router[_0x2c99('0xf')](_0x2c99('0xe'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x12')]);router[_0x2c99('0x13')]('/:id',auth[_0x2c99('0x8')](),controller[_0x2c99('0x14')]);router[_0x2c99('0x15')](_0x2c99('0xb'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x16')]);router[_0x2c99('0x15')]('/:id/users',auth[_0x2c99('0x8')](),controller[_0x2c99('0x17')]);router[_0x2c99('0x15')](_0x2c99('0xe'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x18')]);module[_0x2c99('0x19')]=router; \ No newline at end of file +var _0x956a=['index','/describe','describe','/:id','show','/:id/users','/:id/teams','post','create','addAgents','update','destroy','removeAgents','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x3e948a,_0x2fa6b4){var _0x224741=function(_0x377cca){while(--_0x377cca){_0x3e948a['push'](_0x3e948a['shift']());}};_0x224741(++_0x2fa6b4);}(_0x956a,0xb6));var _0xa956=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x956a[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xa956('0x0'));var path=require(_0xa956('0x1'));var timeout=require(_0xa956('0x2'));var express=require(_0xa956('0x3'));var router=express[_0xa956('0x4')]();var fs_extra=require(_0xa956('0x5'));var auth=require(_0xa956('0x6'));var interaction=require(_0xa956('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xa956('0x8')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0xa')]);router['get'](_0xa956('0xb'),auth[_0xa956('0x9')](),controller[_0xa956('0xc')]);router[_0xa956('0x8')](_0xa956('0xd'),auth[_0xa956('0x9')](),controller[_0xa956('0xe')]);router['get'](_0xa956('0xf'),auth[_0xa956('0x9')](),controller['getAgents']);router[_0xa956('0x8')](_0xa956('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa956('0x11')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0x12')]);router['post'](_0xa956('0xf'),auth[_0xa956('0x9')](),controller[_0xa956('0x13')]);router['post']('/:id/teams',auth[_0xa956('0x9')](),controller['addTeams']);router['put'](_0xa956('0xd'),auth[_0xa956('0x9')](),controller[_0xa956('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa956('0x15')]);router['delete'](_0xa956('0xf'),auth[_0xa956('0x9')](),controller[_0xa956('0x16')]);router[_0xa956('0x17')](_0xa956('0x10'),auth[_0xa956('0x9')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index bd805ac..2317eb5 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 _0xb606=['name','INTEGER','sequelize','STRING','VIRTUAL','getDataValue'];(function(_0x4752ff,_0x52acb2){var _0x2246de=function(_0x54a8de){while(--_0x54a8de){_0x4752ff['push'](_0x4752ff['shift']());}};_0x2246de(++_0x52acb2);}(_0xb606,0x16a));var _0x6b60=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0xb606[_0x17b0d4];return _0x2d02c7;};'use strict';var Sequelize=require(_0x6b60('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b60('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x6b60('0x2')],'get':function(_0x2815dc){return'system-'+this[_0x6b60('0x3')](_0x6b60('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x6b60('0x5')]}}; \ No newline at end of file +var _0x0575=['INTEGER','exports','name','VIRTUAL','system-','getDataValue','STRING'];(function(_0x32f30a,_0x171ecc){var _0x50f777=function(_0x13ca82){while(--_0x13ca82){_0x32f30a['push'](_0x32f30a['shift']());}};_0x50f777(++_0x171ecc);}(_0x0575,0xcc));var _0x5057=function(_0x3f1a6c,_0x41b99a){_0x3f1a6c=_0x3f1a6c-0x0;var _0x1fd2f2=_0x0575[_0x3f1a6c];return _0x1fd2f2;};'use strict';var Sequelize=require('sequelize');module[_0x5057('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5057('0x1')},'prefix':{'type':Sequelize[_0x5057('0x2')],'get':function(_0x3c4a6e){return _0x5057('0x3')+this[_0x5057('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x5057('0x5')]},'callerIdAll':{'type':Sequelize[_0x5057('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x5057('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index db5af9d..ba42774 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 _0x5c3c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','sequelize','transaction','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','pick','getTeams','addTeams','Team','findAll','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','union','compact','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1c0028,_0x1ffe06){var _0x4c3b77=function(_0x389b78){while(--_0x389b78){_0x1c0028['push'](_0x1c0028['shift']());}};_0x4c3b77(++_0x1ffe06);}(_0x5c3c,0x132));var _0xc5c3=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x5c3c[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5c3('0x18')]=_[_0xc5c3('0x19')](config[_0xc5c3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x1a'))(new Redis(config[_0xc5c3('0x18')]));require(_0xc5c3('0x1b'))[_0xc5c3('0x1c')](socket);function respondWithStatusCode(_0xc8a636,_0x5f34bb){_0x5f34bb=_0x5f34bb||0xcc;return function(_0x5c0341){if(_0x5c0341){return _0xc8a636[_0xc5c3('0x1d')](_0x5f34bb);}return _0xc8a636[_0xc5c3('0x1e')](_0x5f34bb)[_0xc5c3('0x1f')]();};}function respondWithResult(_0xef8b21,_0x5ecd4b){_0x5ecd4b=_0x5ecd4b||0xc8;return function(_0x4ff2de){if(_0x4ff2de){return _0xef8b21[_0xc5c3('0x1e')](_0x5ecd4b)['json'](_0x4ff2de);}};}function respondWithFilteredResult(_0xa9bc84,_0x17ec62){return function(_0x2ff158){if(_0x2ff158){var _0x13c867=typeof _0x17ec62[_0xc5c3('0x20')]==='undefined'&&typeof _0x17ec62[_0xc5c3('0x21')]===_0xc5c3('0x22');var _0x123dba=_0x2ff158[_0xc5c3('0x23')];var _0x4e570f=_0x13c867?0x0:_0x17ec62[_0xc5c3('0x20')];var _0x41578a=_0x13c867?_0x2ff158[_0xc5c3('0x23')]:_0x17ec62[_0xc5c3('0x20')]+_0x17ec62[_0xc5c3('0x21')];var _0x564815;if(_0x41578a>=_0x123dba){_0x41578a=_0x123dba;_0x564815=0xc8;}else{_0x564815=0xce;}_0xa9bc84[_0xc5c3('0x1e')](_0x564815);return _0xa9bc84[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e570f+'-'+_0x41578a+'/'+_0x123dba)[_0xc5c3('0x26')](_0x2ff158);}return null;};}function patchUpdates(_0x1c5793){return function(_0x67445){try{jsonpatch[_0xc5c3('0x27')](_0x67445,_0x1c5793,!![]);}catch(_0x5996a0){return BPromise['reject'](_0x5996a0);}return _0x67445[_0xc5c3('0x28')]();};}function saveUpdates(_0x38dd9e,_0x53ab72){return function(_0x5c7329){if(_0x5c7329){return _0x5c7329[_0xc5c3('0x29')](_0x38dd9e)[_0xc5c3('0x2a')](function(_0x38a3df){return _0x38a3df;});}return null;};}function removeEntity(_0x52e54a,_0x4af067){return function(_0x2df06b){if(_0x2df06b){return _0x2df06b[_0xc5c3('0x2b')]()[_0xc5c3('0x2a')](function(){var _0x29791c=_0x2df06b['get']({'plain':!![]});var _0x21efd6='VoicePrefixes';return db[_0xc5c3('0x2c')]['destroy']({'where':{'type':_0x21efd6,'resourceId':_0x29791c['id']}})[_0xc5c3('0x2a')](function(){return _0x2df06b;});})[_0xc5c3('0x2a')](function(){_0x52e54a[_0xc5c3('0x1e')](0xcc)[_0xc5c3('0x1f')]();});}};}function handleEntityNotFound(_0x15361c,_0x2d07e1){return function(_0x35a397){if(!_0x35a397){_0x15361c['sendStatus'](0x194);}return _0x35a397;};}function handleError(_0xbcafd6,_0x4a3300){_0x4a3300=_0x4a3300||0x1f4;return function(_0xc4b134){logger[_0xc5c3('0x2d')](_0xc4b134['stack']);if(_0xc4b134['name']){delete _0xc4b134[_0xc5c3('0x2e')];}_0xbcafd6[_0xc5c3('0x1e')](_0x4a3300)[_0xc5c3('0x2f')](_0xc4b134);};}exports[_0xc5c3('0x30')]=function(_0x52adcf,_0x3f9591){var _0x24aa70={},_0x3ebcbc={},_0x303eab={'count':0x0,'rows':[]};var _0x1b4538=_[_0xc5c3('0x31')](db[_0xc5c3('0x32')][_0xc5c3('0x33')],function(_0x1d1e6d){return{'name':_0x1d1e6d['fieldName'],'type':_0x1d1e6d[_0xc5c3('0x34')][_0xc5c3('0x35')]};});_0x3ebcbc[_0xc5c3('0x36')]=_[_0xc5c3('0x31')](_0x1b4538,_0xc5c3('0x2e'));_0x3ebcbc[_0xc5c3('0x37')]=_[_0xc5c3('0x38')](_0x52adcf['query']);_0x3ebcbc['filters']=_[_0xc5c3('0x39')](_0x3ebcbc['model'],_0x3ebcbc[_0xc5c3('0x37')]);_0x24aa70[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x3ebcbc[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x52adcf['query'][_0xc5c3('0x3b')]));_0x24aa70[_0xc5c3('0x3a')]=_0x24aa70['attributes'][_0xc5c3('0x3c')]?_0x24aa70[_0xc5c3('0x3a')]:_0x3ebcbc[_0xc5c3('0x36')];if(!_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x24aa70[_0xc5c3('0x21')]=qs[_0xc5c3('0x21')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x21')]);_0x24aa70['offset']=qs[_0xc5c3('0x20')](_0x52adcf['query']['offset']);}_0x24aa70[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x24aa70[_0xc5c3('0x41')]=qs['filters'](_['pick'](_0x52adcf[_0xc5c3('0x37')],_0x3ebcbc[_0xc5c3('0x42')]),_0x1b4538);if(_0x52adcf['query'][_0xc5c3('0x43')]){_0x24aa70['where']=_[_0xc5c3('0x44')](_0x24aa70[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x1b4538,function(_0x59c9cb){if(_0x59c9cb[_0xc5c3('0x34')]!==_0xc5c3('0x45')){var _0x525ef8={};_0x525ef8[_0x59c9cb[_0xc5c3('0x2e')]]={'$like':'%'+_0x52adcf['query'][_0xc5c3('0x43')]+'%'};return _0x525ef8;}})});}_0x24aa70=_[_0xc5c3('0x44')]({},_0x24aa70,_0x52adcf['options']);var _0x4d2056={'where':_0x24aa70['where']};return db[_0xc5c3('0x32')][_0xc5c3('0x23')](_0x4d2056)['then'](function(_0x1a8490){_0x303eab[_0xc5c3('0x23')]=_0x1a8490;if(_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x46')]){_0x24aa70['include']=[{'all':!![]}];}return db[_0xc5c3('0x32')]['findAll'](_0x24aa70);})['then'](function(_0x1363fa){_0x303eab[_0xc5c3('0x47')]=_0x1363fa;return _0x303eab;})['then'](respondWithFilteredResult(_0x3f9591,_0x24aa70))[_0xc5c3('0x48')](handleError(_0x3f9591,null));};exports[_0xc5c3('0x49')]=function(_0x590e65,_0x333c38){var _0x4ffc5a={'raw':![],'where':{'id':_0x590e65[_0xc5c3('0x4a')]['id']}},_0x122a6d={};_0x122a6d['model']=_[_0xc5c3('0x38')](db['VoicePrefix'][_0xc5c3('0x33')]);_0x122a6d[_0xc5c3('0x37')]=_['keys'](_0x590e65[_0xc5c3('0x37')]);_0x122a6d[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x122a6d[_0xc5c3('0x36')],_0x122a6d[_0xc5c3('0x37')]);_0x4ffc5a[_0xc5c3('0x3a')]=_['intersection'](_0x122a6d[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x590e65[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x4ffc5a[_0xc5c3('0x3a')]=_0x4ffc5a['attributes']['length']?_0x4ffc5a[_0xc5c3('0x3a')]:_0x122a6d[_0xc5c3('0x36')];if(_0x590e65[_0xc5c3('0x37')]['includeAll']){_0x4ffc5a[_0xc5c3('0x4b')]=[{'all':!![]}];}_0x4ffc5a=_[_0xc5c3('0x44')]({},_0x4ffc5a,_0x590e65[_0xc5c3('0x4c')]);return db[_0xc5c3('0x32')][_0xc5c3('0x4d')](_0x4ffc5a)[_0xc5c3('0x2a')](handleEntityNotFound(_0x333c38,null))[_0xc5c3('0x2a')](respondWithResult(_0x333c38,null))['catch'](handleError(_0x333c38,null));};exports[_0xc5c3('0x2b')]=function(_0x3ff21e,_0x4538ab){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x3ff21e[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x4538ab,null))[_0xc5c3('0x2a')](removeEntity(_0x4538ab,null))[_0xc5c3('0x48')](handleError(_0x4538ab,null));};exports['describe']=function(_0xd716e6,_0x58204c){return db[_0xc5c3('0x32')]['describe']()[_0xc5c3('0x2a')](respondWithResult(_0x58204c,null))[_0xc5c3('0x48')](handleError(_0x58204c,null));};exports[_0xc5c3('0x4e')]=function(_0x325643,_0x1311de){var _0x4be969;return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x348960){return db[_0xc5c3('0x32')][_0xc5c3('0x4e')](_0x325643['body'],{'transaction':_0x348960})[_0xc5c3('0x2a')](function(_0x34bf9c){_0x4be969=_0x34bf9c[_0xc5c3('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xc5c3('0x4d')]({'where':{'id':_0x4be969['VoiceExtensionId']},'raw':!![]})['then'](function(_0x39f83a){return createVoicePrefixExtensions(_0x4be969,_0x39f83a,_0x348960);});});})[_0xc5c3('0x2a')](function(){var _0x110105=_0x325643[_0xc5c3('0x52')][_0xc5c3('0x51')]({'plain':!![]});if(!_0x110105)throw new Error(_0xc5c3('0x53'));if(_0x110105['role']===_0xc5c3('0x52')){var _0x1ad3aa=_0x4be969;return db[_0xc5c3('0x54')][_0xc5c3('0x4d')]({'where':{'name':_0xc5c3('0x55'),'userProfileId':_0x110105[_0xc5c3('0x56')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x524aff){if(_0x524aff&&_0x524aff['autoAssociation']===0x0){return db[_0xc5c3('0x2c')][_0xc5c3('0x4e')]({'name':_0x1ad3aa['name'],'resourceId':_0x1ad3aa['id'],'type':_0x524aff[_0xc5c3('0x2e')],'sectionId':_0x524aff['id']},{})[_0xc5c3('0x2a')](function(){return _0x4be969;});}else{return _0x4be969;}})[_0xc5c3('0x48')](function(_0x41bcf7){logger['error'](_0xc5c3('0x57'),_0x41bcf7);throw _0x41bcf7;});}return _0x4be969;})[_0xc5c3('0x2a')](respondWithResult(_0x1311de,null))[_0xc5c3('0x48')](handleError(_0x1311de,null));};function Extension(_0x314392,_0x1b66bf,_0x36420a,_0x90e30b){this[_0xc5c3('0x58')]=_0xc5c3('0x59');this['exten']=_0x314392;this[_0xc5c3('0x5a')]=_0x36420a;this[_0xc5c3('0x34')]=_0xc5c3('0x5b');this['description']=_0xc5c3('0x5c');this[_0xc5c3('0x5d')]=_0x1b66bf;this[_0xc5c3('0x5e')]=_0x90e30b;}function createVoicePrefixExtensions(_0x30226f,_0x32d5e2,_0x5067ed){return new BPromise(function(_0xf54924,_0xea569b){var _0xf40f27=new Extension(formatPrefixName(_0x30226f[_0xc5c3('0x5f')]),0x1,_0xc5c3('0x60'),_0xc5c3('0x61'));_0xf40f27[_0xc5c3('0x62')]=_0x30226f['id'];return db['VoiceExtension'][_0xc5c3('0x4e')](_0xf40f27,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x397fc8){var _0x13f6a1=_0x397fc8[_0xc5c3('0x51')]({'plain':!![]});var _0x3cd213=_[_0xc5c3('0x31')](addVoicePrefixExtensions(_0x30226f,_0x32d5e2),function(_0x5b9013){_0x5b9013['VoiceExtensionId']=_0x13f6a1['id'];_0x5b9013[_0xc5c3('0x62')]=_0x30226f['id'];return _0x5b9013;});return db[_0xc5c3('0x63')][_0xc5c3('0x64')](_0x3cd213,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x1ed757){if(!_0x1ed757){return _0xea569b(_0xc5c3('0x65'));}else{return _0xf54924(_0x1ed757);}})[_0xc5c3('0x48')](function(_0x2cdd7a){return _0xea569b(_0x2cdd7a);});});;});};function addVoicePrefixExtensions(_0x385b39,_0x4d3e6f){var _0x92c6cf=[];var _0x358b83=formatPrefixName(_0x385b39['prefix']);_0x92c6cf['push'](new Extension(_0x358b83,0x2,_0xc5c3('0x66'),_0xc5c3('0x67')+_0x385b39[_0xc5c3('0x2e')]));if(_0x385b39[_0xc5c3('0x68')]){_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,_0xc5c3('0x66'),_0xc5c3('0x6a')+_0x385b39[_0xc5c3('0x68')]));}else{_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,'NoOp',_0xc5c3('0x6b')));}_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x4,_0xc5c3('0x6c'),_0x4d3e6f[_0xc5c3('0x58')]+','+_0xc5c3('0x6d')+(0x8+_0x385b39[_0xc5c3('0x2e')][_0xc5c3('0x3c')])+'}'+','+0x1));return _0x92c6cf;}function formatPrefixName(_0x114c90){var _0x22606a='_';for(var _0x31e280=0x0;_0x31e280<_0x114c90[_0xc5c3('0x3c')];_0x31e280++){if(_0x114c90['charAt'](_0x31e280)=='-'){_0x22606a+=_0x114c90['charAt'](_0x31e280);}else{_0x22606a+='['+_0x114c90[_0xc5c3('0x6e')](_0x31e280)+']';}}_0x22606a+='.';return _0x22606a;}exports[_0xc5c3('0x29')]=function(_0x6281e5,_0x1951a5,_0x5540c0){var _0x2da018=_0x6281e5[_0xc5c3('0x6f')];_0x2da018[_0xc5c3('0x5f')]=_0xc5c3('0x70')+_0x2da018[_0xc5c3('0x2e')]+'-';return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x4a3f71){return db[_0xc5c3('0x32')]['update'](_0x2da018,{'where':{'id':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x2b')]({'where':{'VoicePrefixId':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x4d')]({'where':{'id':_0x2da018[_0xc5c3('0x71')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x4813a0){return createVoicePrefixExtensions(_0x2da018,_0x4813a0,_0x4a3f71);});});});})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x32')][_0xc5c3('0x72')](_0x2da018['id']);})['then'](respondWithResult(_0x1951a5,null))['catch'](handleError(_0x1951a5,null));};exports[_0xc5c3('0x73')]=function(_0x5d6b6b,_0x5bcbd3,_0x1f222f){return db[_0xc5c3('0x32')]['find']({'where':{'id':_0x5d6b6b[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bcbd3,null))['then'](function(_0x2dbe80){if(_0x2dbe80){return _0x2dbe80[_0xc5c3('0x73')](_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')],_[_0xc5c3('0x75')](_0x5d6b6b['body'],[_0xc5c3('0x74'),'id'])||{})['spread'](function(_0x110167){for(var _0x109cfa=0x0;_0x109cfa<_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')][_0xc5c3('0x3c')];_0x109cfa+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5d6b6b['body'][_0xc5c3('0x74')][_0x109cfa]),'VoicePrefixId':Number(_0x5d6b6b[_0xc5c3('0x4a')]['id'])});}return _0x110167;});}})[_0xc5c3('0x2a')](respondWithResult(_0x5bcbd3,null))['catch'](handleError(_0x5bcbd3,null));};exports[_0xc5c3('0x76')]=function(_0x41222d,_0x5dcd4d,_0x3afa94){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x41222d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x5dcd4d,null))[_0xc5c3('0x2a')](function(_0x4b0d02){if(_0x4b0d02){return _0x4b0d02[_0xc5c3('0x76')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])[_0xc5c3('0x2a')](function(){if(_[_0xc5c3('0x77')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])){for(var _0x1f36f8=0x0;_0x1f36f8<_0x41222d['query']['ids']['length'];_0x1f36f8+=0x1){socket['emit'](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')][_0x1f36f8]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}}else{socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5dcd4d,null))[_0xc5c3('0x48')](handleError(_0x5dcd4d,null));};exports[_0xc5c3('0x7a')]=function(_0x3aa5e2,_0x1efa1d,_0x2fae6d){var _0x258e36={};var _0x2f1be8={};var _0x550966;var _0x5733a2;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x3aa5e2[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x1efa1d,null))[_0xc5c3('0x2a')](function(_0x306d22){if(_0x306d22){_0x550966=_0x306d22;_0x2f1be8[_0xc5c3('0x36')]=_[_0xc5c3('0x38')](db[_0xc5c3('0x7c')][_0xc5c3('0x33')]);_0x2f1be8[_0xc5c3('0x37')]=_['keys'](_0x3aa5e2[_0xc5c3('0x37')]);_0x2f1be8[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],_0x2f1be8[_0xc5c3('0x37')]);_0x258e36['attributes']=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x3aa5e2[_0xc5c3('0x37')]['fields']));_0x258e36[_0xc5c3('0x3a')]=_0x258e36[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x258e36['attributes']:_0x2f1be8[_0xc5c3('0x36')];_0x258e36[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x258e36[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_[_0xc5c3('0x7d')](_0x3aa5e2[_0xc5c3('0x37')],_0x2f1be8[_0xc5c3('0x42')]));if(_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x43')]){_0x258e36[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x258e36[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x258e36['attributes'],function(_0x2bf9d2){var _0x8aaa64={};_0x8aaa64[_0x2bf9d2]={'$like':'%'+_0x3aa5e2['query'][_0xc5c3('0x43')]+'%'};return _0x8aaa64;})});}_0x258e36=_['merge']({},_0x258e36,_0x3aa5e2[_0xc5c3('0x4c')]);return _0x550966[_0xc5c3('0x7a')](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x1800a0){if(_0x1800a0){_0x5733a2=_0x1800a0[_0xc5c3('0x3c')];if(!_0x3aa5e2['query'][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x258e36[_0xc5c3('0x21')]=qs['limit'](_0x3aa5e2['query'][_0xc5c3('0x21')]);_0x258e36['offset']=qs[_0xc5c3('0x20')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x20')]);}return _0x550966['getAgents'](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x3325b6){if(_0x3325b6){return _0x3325b6?{'count':_0x5733a2,'rows':_0x3325b6}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x1efa1d,null))[_0xc5c3('0x48')](handleError(_0x1efa1d,null));};exports[_0xc5c3('0x7e')]=function(_0x57070d,_0x2f5315,_0x37ef35){var _0x2dcae5={};var _0x5d5248={};var _0xd3091c;var _0x26292e;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x57070d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x2f5315,null))[_0xc5c3('0x2a')](function(_0x12d800){if(_0x12d800){_0xd3091c=_0x12d800;_0x5d5248['model']=_[_0xc5c3('0x38')](db['Team'][_0xc5c3('0x33')]);_0x5d5248[_0xc5c3('0x37')]=_['keys'](_0x57070d[_0xc5c3('0x37')]);_0x5d5248[_0xc5c3('0x42')]=_['intersection'](_0x5d5248[_0xc5c3('0x36')],_0x5d5248[_0xc5c3('0x37')]);_0x2dcae5[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x5d5248[_0xc5c3('0x36')],qs['fields'](_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x2dcae5[_0xc5c3('0x3a')]=_0x2dcae5[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x2dcae5[_0xc5c3('0x3a')]:_0x5d5248['model'];_0x2dcae5[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x57070d['query']['sort']);_0x2dcae5[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_['pick'](_0x57070d[_0xc5c3('0x37')],_0x5d5248[_0xc5c3('0x42')]));if(_0x57070d[_0xc5c3('0x37')]['filter']){_0x2dcae5[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x2dcae5[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x2dcae5[_0xc5c3('0x3a')],function(_0x86d21a){var _0x53f1d={};_0x53f1d[_0x86d21a]={'$like':'%'+_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x43')]+'%'};return _0x53f1d;})});}_0x2dcae5=_[_0xc5c3('0x44')]({},_0x2dcae5,_0x57070d[_0xc5c3('0x4c')]);return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})['then'](function(_0x48e3a2){if(_0x48e3a2){_0x26292e=_0x48e3a2[_0xc5c3('0x3c')];if(!_0x57070d['query']['hasOwnProperty'](_0xc5c3('0x3e'))){_0x2dcae5['limit']=qs[_0xc5c3('0x21')](_0x57070d[_0xc5c3('0x37')]['limit']);_0x2dcae5['offset']=qs[_0xc5c3('0x20')](_0x57070d['query']['offset']);}return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})[_0xc5c3('0x2a')](function(_0x3ce0e9){if(_0x3ce0e9){return _0x3ce0e9?{'count':_0x26292e,'rows':_0x3ce0e9}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x2f5315,null))[_0xc5c3('0x48')](handleError(_0x2f5315,null));};exports[_0xc5c3('0x7f')]=function(_0x116965,_0xa4672a,_0x1aba09){var _0x557b8f=_0x116965['body'][_0xc5c3('0x74')];var _0x389c96;return db[_0xc5c3('0x80')][_0xc5c3('0x81')]({'where':{'id':_0x557b8f},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id',_0xc5c3('0x2e'),'online',_0xc5c3('0x82'),_0xc5c3('0x83')],'raw':!![]}]})[_0xc5c3('0x2a')](function(_0x2c8937){if(_0x2c8937){_0x389c96=_0x2c8937;var _0x9e9372=_[_0xc5c3('0x84')](_0x2c8937,function(_0x1dcde5){var _0x2c8fdb=_0x1dcde5['get']({'plain':!![]});return _0x2c8fdb['Agents'];});return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x116965[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](function(_0x3cc60b){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x2c5fd2){return _0x3cc60b[_0xc5c3('0x7f')](_0x557b8f,{'transaction':_0x2c5fd2})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x389c96,function(_0x554787){return db[_0xc5c3('0x86')][_0xc5c3('0x87')]({'TeamId':_0x554787['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},{'transaction':_0x2c5fd2});});})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x9e9372,function(_0x589e28){return db[_0xc5c3('0x88')][_0xc5c3('0x89')]({'where':{'UserId':_0x589e28['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},'transaction':_0x2c5fd2});});})['then'](function(){_0x9e9372[_0xc5c3('0x8a')](function(_0x2dd850){socket[_0xc5c3('0x79')](_0xc5c3('0x8b'),{'UserId':_0x2dd850['id'],'VoicePrefixId':_0x3cc60b['id']});});});});});}})[_0xc5c3('0x2a')](respondWithStatusCode(_0xa4672a,null))[_0xc5c3('0x48')](handleError(_0xa4672a,null));};exports[_0xc5c3('0x8c')]=function(_0x53a502,_0x762654,_0x37459f){return db['Team'][_0xc5c3('0x81')]({'where':{'id':_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5c3('0x2a')](handleEntityNotFound(_0x762654,null))[_0xc5c3('0x2a')](function(_0x3aafa0){var _0xe80b2b=_[_0xc5c3('0x31')](_0x3aafa0,'id');var _0x2b49da=[];var _0x47bd08=[];var _0x314072=squel[_0xc5c3('0x8d')]();_0x314072['field'](_0xc5c3('0x8e'))['from'](_0xc5c3('0x8f'),'tq')[_0xc5c3('0x90')](_0xc5c3('0x91'),'ut',_0xc5c3('0x92'))['where']('VoicePrefixId\x20=\x20?',_0x53a502['params']['id']);for(var _0x3b5ca9=0x0;_0x3b5ca9<_0x3aafa0[_0xc5c3('0x3c')];_0x3b5ca9+=0x1){let _0x283935=_0x3aafa0[_0x3b5ca9];for(var _0x5cebbc=0x0;_0x5cebbc<_0x283935[_0xc5c3('0x93')]['length'];_0x5cebbc+=0x1){let _0x423b48=_0x283935[_0xc5c3('0x93')][_0x5cebbc];var _0x2a8dfc=_0x314072[_0xc5c3('0x94')]();_0x2a8dfc[_0xc5c3('0x41')](_0xc5c3('0x95'),_0x423b48['id']);_0x47bd08[_0xc5c3('0x69')](db[_0xc5c3('0x4f')][_0xc5c3('0x37')](_0x2a8dfc[_0xc5c3('0x96')](),{'type':db['sequelize'][_0xc5c3('0x97')]['SELECT']})[_0xc5c3('0x2a')](function(_0x397543){if(_0x397543[_0xc5c3('0x3c')]===0x1){return _0x423b48['id'];}else{var _0x21941a=_['every'](_[_0xc5c3('0x31')](_0x397543,_0xc5c3('0x98')),function(_0x1b7fc8){return _['includes'](_0xe80b2b,_0x1b7fc8);});if(_0x21941a){return _0x423b48['id'];}}}));}}return BPromise['all'](_0x47bd08)[_0xc5c3('0x2a')](function(_0x5731da){_0x2b49da=_(_0x2b49da)[_0xc5c3('0x99')](_0x5731da)[_0xc5c3('0x9a')]()['value']();return db[_0xc5c3('0x32')][_0xc5c3('0x4d')]({'where':{'id':_0x53a502['params']['id']}})['then'](function(_0x288b93){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x187a7a){return _0x288b93['removeTeams'](_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')],{'transaction':_0x187a7a})[_0xc5c3('0x2a')](function(){if(!_['isEmpty'](_0x2b49da)){return _0x288b93[_0xc5c3('0x76')](_0x2b49da,{'transaction':_0x187a7a});}})[_0xc5c3('0x2a')](function(){_0x2b49da['forEach'](function(_0x8ec6b6){socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':_0x8ec6b6,'VoicePrefixId':_0x288b93['id']});});});});});});})[_0xc5c3('0x2a')](respondWithStatusCode(_0x762654,null))[_0xc5c3('0x48')](handleError(_0x762654,null));}; \ No newline at end of file +var _0xab40=['PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','omit','body','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','findAll','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','userVoicePrefix:save','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','error','stack','name','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','catch','params','length','find','describe','create','sequelize','transaction','get','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll'];(function(_0x2f3a46,_0x25335f){var _0x98fa2f=function(_0x377b08){while(--_0x377b08){_0x2f3a46['push'](_0x2f3a46['shift']());}};_0x98fa2f(++_0x25335f);}(_0xab40,0xcd));var _0x0ab4=function(_0x5785da,_0x43a3e6){_0x5785da=_0x5785da-0x0;var _0x506edf=_0xab40[_0x5785da];return _0x506edf;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];config[_0x0ab4('0x15')]=_[_0x0ab4('0x16')](config[_0x0ab4('0x15')],{'host':_0x0ab4('0x17'),'port':0x18eb});var socket=require(_0x0ab4('0x18'))(new Redis(config[_0x0ab4('0x15')]));require(_0x0ab4('0x19'))[_0x0ab4('0x1a')](socket);function respondWithStatusCode(_0x3cb1df,_0x2033c8){_0x2033c8=_0x2033c8||0xcc;return function(_0x216a17){if(_0x216a17){return _0x3cb1df[_0x0ab4('0x1b')](_0x2033c8);}return _0x3cb1df[_0x0ab4('0x1c')](_0x2033c8)[_0x0ab4('0x1d')]();};}function respondWithResult(_0x2a83a8,_0x2403db){_0x2403db=_0x2403db||0xc8;return function(_0x283b15){if(_0x283b15){return _0x2a83a8[_0x0ab4('0x1c')](_0x2403db)['json'](_0x283b15);}};}function respondWithFilteredResult(_0x5000d4,_0x49634f){return function(_0x17422f){if(_0x17422f){var _0x30d5df=typeof _0x49634f[_0x0ab4('0x1e')]==='undefined'&&typeof _0x49634f[_0x0ab4('0x1f')]===_0x0ab4('0x20');var _0x212ebd=_0x17422f[_0x0ab4('0x21')];var _0x4e7852=_0x30d5df?0x0:_0x49634f['offset'];var _0xdb0797=_0x30d5df?_0x17422f['count']:_0x49634f[_0x0ab4('0x1e')]+_0x49634f[_0x0ab4('0x1f')];var _0x5bb1d0;if(_0xdb0797>=_0x212ebd){_0xdb0797=_0x212ebd;_0x5bb1d0=0xc8;}else{_0x5bb1d0=0xce;}_0x5000d4[_0x0ab4('0x1c')](_0x5bb1d0);return _0x5000d4[_0x0ab4('0x22')](_0x0ab4('0x23'),_0x4e7852+'-'+_0xdb0797+'/'+_0x212ebd)[_0x0ab4('0x24')](_0x17422f);}return null;};}function patchUpdates(_0x12d06d){return function(_0x52d7d3){try{jsonpatch['apply'](_0x52d7d3,_0x12d06d,!![]);}catch(_0x24b929){return BPromise[_0x0ab4('0x25')](_0x24b929);}return _0x52d7d3[_0x0ab4('0x26')]();};}function saveUpdates(_0x13c882,_0x4e4b80){return function(_0x42d2dd){if(_0x42d2dd){return _0x42d2dd[_0x0ab4('0x27')](_0x13c882)[_0x0ab4('0x28')](function(_0x4ea9aa){return _0x4ea9aa;});}return null;};}function removeEntity(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(_0x1c132c){return _0x1c132c[_0x0ab4('0x29')]()['then'](function(){var _0x519b23=_0x1c132c['get']({'plain':!![]});var _0x19ecc6='VoicePrefixes';return db[_0x0ab4('0x2a')][_0x0ab4('0x29')]({'where':{'type':_0x19ecc6,'resourceId':_0x519b23['id']}})['then'](function(){return _0x1c132c;});})['then'](function(){_0x4c5caf['status'](0xcc)[_0x0ab4('0x1d')]();});}};}function handleEntityNotFound(_0x183bac,_0x1cfdad){return function(_0x3f61cb){if(!_0x3f61cb){_0x183bac[_0x0ab4('0x1b')](0x194);}return _0x3f61cb;};}function handleError(_0x588e0d,_0x5b55c1){_0x5b55c1=_0x5b55c1||0x1f4;return function(_0x580d56){logger[_0x0ab4('0x2b')](_0x580d56[_0x0ab4('0x2c')]);if(_0x580d56[_0x0ab4('0x2d')]){delete _0x580d56[_0x0ab4('0x2d')];}_0x588e0d[_0x0ab4('0x1c')](_0x5b55c1)['send'](_0x580d56);};}exports['index']=function(_0x285a29,_0xe6682){var _0x361f7c={},_0x4819be={},_0x48e430={'count':0x0,'rows':[]};var _0x1b19db=_['map'](db[_0x0ab4('0x2e')][_0x0ab4('0x2f')],function(_0x263e5a){return{'name':_0x263e5a[_0x0ab4('0x30')],'type':_0x263e5a[_0x0ab4('0x31')][_0x0ab4('0x32')]};});_0x4819be['model']=_[_0x0ab4('0x33')](_0x1b19db,_0x0ab4('0x2d'));_0x4819be[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x285a29['query']);_0x4819be['filters']=_[_0x0ab4('0x36')](_0x4819be[_0x0ab4('0x37')],_0x4819be[_0x0ab4('0x34')]);_0x361f7c['attributes']=_['intersection'](_0x4819be['model'],qs[_0x0ab4('0x38')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x361f7c['attributes']=_0x361f7c['attributes']['length']?_0x361f7c[_0x0ab4('0x39')]:_0x4819be[_0x0ab4('0x37')];if(!_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x361f7c[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x361f7c[_0x0ab4('0x1e')]=qs['offset'](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}_0x361f7c[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x361f7c[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x285a29[_0x0ab4('0x34')],_0x4819be[_0x0ab4('0x3f')]),_0x1b19db);if(_0x285a29[_0x0ab4('0x34')]['filter']){_0x361f7c[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x361f7c[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x1b19db,function(_0x589b46){if(_0x589b46[_0x0ab4('0x31')]!=='VIRTUAL'){var _0x43e5ba={};_0x43e5ba[_0x589b46[_0x0ab4('0x2d')]]={'$like':'%'+_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x42')]+'%'};return _0x43e5ba;}})});}_0x361f7c=_[_0x0ab4('0x41')]({},_0x361f7c,_0x285a29[_0x0ab4('0x43')]);var _0x5815d1={'where':_0x361f7c[_0x0ab4('0x3e')]};return db[_0x0ab4('0x2e')][_0x0ab4('0x21')](_0x5815d1)['then'](function(_0x395e0b){_0x48e430[_0x0ab4('0x21')]=_0x395e0b;if(_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x44')]){_0x361f7c[_0x0ab4('0x45')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x361f7c);})['then'](function(_0x2f54dd){_0x48e430[_0x0ab4('0x46')]=_0x2f54dd;return _0x48e430;})['then'](respondWithFilteredResult(_0xe6682,_0x361f7c))[_0x0ab4('0x47')](handleError(_0xe6682,null));};exports['show']=function(_0x2d1d87,_0x562262){var _0x365be1={'raw':![],'where':{'id':_0x2d1d87[_0x0ab4('0x48')]['id']}},_0x300fd8={};_0x300fd8[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x2e')]['rawAttributes']);_0x300fd8[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x2d1d87[_0x0ab4('0x34')]);_0x300fd8[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x300fd8[_0x0ab4('0x37')],_0x300fd8['query']);_0x365be1[_0x0ab4('0x39')]=_['intersection'](_0x300fd8[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x2d1d87[_0x0ab4('0x34')]['fields']));_0x365be1[_0x0ab4('0x39')]=_0x365be1[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x365be1[_0x0ab4('0x39')]:_0x300fd8[_0x0ab4('0x37')];if(_0x2d1d87[_0x0ab4('0x34')]['includeAll']){_0x365be1[_0x0ab4('0x45')]=[{'all':!![]}];}_0x365be1=_[_0x0ab4('0x41')]({},_0x365be1,_0x2d1d87[_0x0ab4('0x43')]);return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')](_0x365be1)[_0x0ab4('0x28')](handleEntityNotFound(_0x562262,null))[_0x0ab4('0x28')](respondWithResult(_0x562262,null))[_0x0ab4('0x47')](handleError(_0x562262,null));};exports[_0x0ab4('0x29')]=function(_0x24bb13,_0x1a9675){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x24bb13['params']['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0x1a9675,null))[_0x0ab4('0x28')](removeEntity(_0x1a9675,null))['catch'](handleError(_0x1a9675,null));};exports[_0x0ab4('0x4b')]=function(_0x48efa4,_0x53d66f){return db[_0x0ab4('0x2e')][_0x0ab4('0x4b')]()[_0x0ab4('0x28')](respondWithResult(_0x53d66f,null))['catch'](handleError(_0x53d66f,null));};exports[_0x0ab4('0x4c')]=function(_0xb3bd1e,_0xeddaa1){var _0xaed2d;return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1eea3b){return db['VoicePrefix'][_0x0ab4('0x4c')](_0xb3bd1e['body'],{'transaction':_0x1eea3b})[_0x0ab4('0x28')](function(_0x55c073){_0xaed2d=_0x55c073[_0x0ab4('0x4f')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xaed2d[_0x0ab4('0x50')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x433346){return createVoicePrefixExtensions(_0xaed2d,_0x433346,_0x1eea3b);});});})[_0x0ab4('0x28')](function(){var _0x4e2db5=_0xb3bd1e[_0x0ab4('0x51')][_0x0ab4('0x4f')]({'plain':!![]});if(!_0x4e2db5)throw new Error(_0x0ab4('0x52'));if(_0x4e2db5[_0x0ab4('0x53')]===_0x0ab4('0x51')){var _0x2354fa=_0xaed2d;return db[_0x0ab4('0x54')][_0x0ab4('0x4a')]({'where':{'name':_0x0ab4('0x55'),'userProfileId':_0x4e2db5[_0x0ab4('0x56')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x355ba8){if(_0x355ba8&&_0x355ba8[_0x0ab4('0x57')]===0x0){return db[_0x0ab4('0x2a')][_0x0ab4('0x4c')]({'name':_0x2354fa[_0x0ab4('0x2d')],'resourceId':_0x2354fa['id'],'type':_0x355ba8[_0x0ab4('0x2d')],'sectionId':_0x355ba8['id']},{})[_0x0ab4('0x28')](function(){return _0xaed2d;});}else{return _0xaed2d;}})[_0x0ab4('0x47')](function(_0x59705f){logger[_0x0ab4('0x2b')](_0x0ab4('0x58'),_0x59705f);throw _0x59705f;});}return _0xaed2d;})[_0x0ab4('0x28')](respondWithResult(_0xeddaa1,null))[_0x0ab4('0x47')](handleError(_0xeddaa1,null));};function Extension(_0x32e38c,_0x3bcb90,_0x387619,_0x251e4d){this['context']=_0x0ab4('0x59');this[_0x0ab4('0x5a')]=_0x32e38c;this['app']=_0x387619;this['type']=_0x0ab4('0x5b');this[_0x0ab4('0x5c')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3bcb90;this[_0x0ab4('0x5d')]=_0x251e4d;}function createVoicePrefixExtensions(_0x5b4bbe,_0x597d26,_0x427b51){return new BPromise(function(_0x3cdedf,_0x12dccd){var _0x42cbcb=new Extension(formatPrefixName(_0x5b4bbe[_0x0ab4('0x5e')]),0x1,_0x0ab4('0x5f'),_0x0ab4('0x60'));_0x42cbcb['VoicePrefixId']=_0x5b4bbe['id'];return db[_0x0ab4('0x61')][_0x0ab4('0x4c')](_0x42cbcb,{'transaction':_0x427b51})[_0x0ab4('0x28')](function(_0x406df2){var _0x194733=_0x406df2[_0x0ab4('0x4f')]({'plain':!![]});var _0x4f1847=_[_0x0ab4('0x33')](addVoicePrefixExtensions(_0x5b4bbe,_0x597d26),function(_0x1b7925){_0x1b7925['VoiceExtensionId']=_0x194733['id'];_0x1b7925[_0x0ab4('0x62')]=_0x5b4bbe['id'];return _0x1b7925;});return db['VoiceExtension'][_0x0ab4('0x63')](_0x4f1847,{'transaction':_0x427b51})['then'](function(_0x268b23){if(!_0x268b23){return _0x12dccd(_0x0ab4('0x64'));}else{return _0x3cdedf(_0x268b23);}})[_0x0ab4('0x47')](function(_0x2e728f){return _0x12dccd(_0x2e728f);});});;});};function addVoicePrefixExtensions(_0x509611,_0x581547){var _0x10dd5b=[];var _0x4477ba=formatPrefixName(_0x509611['prefix']);_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x2,_0x0ab4('0x66'),_0x0ab4('0x67')+_0x509611['name']));if(_0x509611[_0x0ab4('0x68')]){_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x66'),_0x0ab4('0x69')+_0x509611[_0x0ab4('0x68')]));}else{_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x5f'),_0x0ab4('0x6a')));}_0x10dd5b['push'](new Extension(_0x4477ba,0x4,'goto',_0x581547[_0x0ab4('0x6b')]+','+_0x0ab4('0x6c')+(0x8+_0x509611[_0x0ab4('0x2d')][_0x0ab4('0x49')])+'}'+','+0x1));return _0x10dd5b;}function formatPrefixName(_0x58c611){var _0x417926='_';for(var _0x5256d4=0x0;_0x5256d4<_0x58c611[_0x0ab4('0x49')];_0x5256d4++){if(_0x58c611[_0x0ab4('0x6d')](_0x5256d4)=='-'){_0x417926+=_0x58c611[_0x0ab4('0x6d')](_0x5256d4);}else{_0x417926+='['+_0x58c611[_0x0ab4('0x6d')](_0x5256d4)+']';}}_0x417926+='.';return _0x417926;}exports[_0x0ab4('0x27')]=function(_0x41b65f,_0x46a008,_0xf42b98){var _0x29cf79=_0x41b65f['body'];_0x29cf79[_0x0ab4('0x5e')]='system-'+_0x29cf79[_0x0ab4('0x2d')]+'-';return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1481b2){return db[_0x0ab4('0x2e')][_0x0ab4('0x27')](_0x29cf79,{'where':{'id':_0x29cf79['id']},'transaction':_0x1481b2})[_0x0ab4('0x28')](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x29')]({'where':{'VoicePrefixId':_0x29cf79['id']},'transaction':_0x1481b2})['then'](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x4a')]({'where':{'id':_0x29cf79['VoiceExtensionId']},'raw':!![]})[_0x0ab4('0x28')](function(_0x2d4921){return createVoicePrefixExtensions(_0x29cf79,_0x2d4921,_0x1481b2);});});});})[_0x0ab4('0x28')](function(){return db['VoicePrefix'][_0x0ab4('0x6e')](_0x29cf79['id']);})[_0x0ab4('0x28')](respondWithResult(_0x46a008,null))[_0x0ab4('0x47')](handleError(_0x46a008,null));};exports[_0x0ab4('0x6f')]=function(_0x531a07,_0x5bf57e,_0x398b3e){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x531a07[_0x0ab4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bf57e,null))[_0x0ab4('0x28')](function(_0xa0f095){if(_0xa0f095){return _0xa0f095[_0x0ab4('0x6f')](_0x531a07['body']['ids'],_[_0x0ab4('0x70')](_0x531a07[_0x0ab4('0x71')],[_0x0ab4('0x72'),'id'])||{})[_0x0ab4('0x73')](function(_0x46f69a){for(var _0x1c8965=0x0;_0x1c8965<_0x531a07[_0x0ab4('0x71')]['ids'][_0x0ab4('0x49')];_0x1c8965+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x531a07[_0x0ab4('0x71')]['ids'][_0x1c8965]),'VoicePrefixId':Number(_0x531a07[_0x0ab4('0x48')]['id'])});}return _0x46f69a;});}})[_0x0ab4('0x28')](respondWithResult(_0x5bf57e,null))[_0x0ab4('0x47')](handleError(_0x5bf57e,null));};exports[_0x0ab4('0x74')]=function(_0x1eec8e,_0x4bffd4,_0x586bd6){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x1eec8e['params']['id']}})['then'](handleEntityNotFound(_0x4bffd4,null))[_0x0ab4('0x28')](function(_0x3e3ded){if(_0x3e3ded){return _0x3e3ded['removeAgents'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])[_0x0ab4('0x28')](function(){if(_['isArray'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])){for(var _0x2033fc=0x0;_0x2033fc<_0x1eec8e[_0x0ab4('0x34')]['ids'][_0x0ab4('0x49')];_0x2033fc+=0x1){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')][_0x2033fc]),'VoicePrefixId':Number(_0x1eec8e[_0x0ab4('0x48')]['id'])});}}else{socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')]),'VoicePrefixId':Number(_0x1eec8e['params']['id'])});}});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x4bffd4,null))[_0x0ab4('0x47')](handleError(_0x4bffd4,null));};exports[_0x0ab4('0x77')]=function(_0x78c98e,_0xb803f2,_0x5adfaa){var _0x448fcb={};var _0x88676f={};var _0xd916e0;var _0x28a722;return db[_0x0ab4('0x2e')][_0x0ab4('0x78')]({'where':{'id':_0x78c98e[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0xb803f2,null))[_0x0ab4('0x28')](function(_0x23968d){if(_0x23968d){_0xd916e0=_0x23968d;_0x88676f[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x79')][_0x0ab4('0x2f')]);_0x88676f['query']=_[_0x0ab4('0x35')](_0x78c98e[_0x0ab4('0x34')]);_0x88676f[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x88676f['model'],_0x88676f['query']);_0x448fcb[_0x0ab4('0x39')]=_[_0x0ab4('0x36')](_0x88676f['model'],qs[_0x0ab4('0x38')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x448fcb[_0x0ab4('0x39')]=_0x448fcb[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x448fcb[_0x0ab4('0x39')]:_0x88676f['model'];_0x448fcb[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x448fcb[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x78c98e[_0x0ab4('0x34')],_0x88676f[_0x0ab4('0x3f')]));if(_0x78c98e['query'][_0x0ab4('0x42')]){_0x448fcb['where']=_[_0x0ab4('0x41')](_0x448fcb[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x448fcb[_0x0ab4('0x39')],function(_0x12ee59){var _0x76fa2={};_0x76fa2[_0x12ee59]={'$like':'%'+_0x78c98e['query']['filter']+'%'};return _0x76fa2;})});}_0x448fcb=_[_0x0ab4('0x41')]({},_0x448fcb,_0x78c98e[_0x0ab4('0x43')]);return _0xd916e0['getAgents'](_0x448fcb);}})['then'](function(_0x21f0a2){if(_0x21f0a2){_0x28a722=_0x21f0a2[_0x0ab4('0x49')];if(!_0x78c98e['query'][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x448fcb[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x78c98e['query'][_0x0ab4('0x1f')]);_0x448fcb['offset']=qs['offset'](_0x78c98e[_0x0ab4('0x34')]['offset']);}return _0xd916e0[_0x0ab4('0x77')](_0x448fcb);}})[_0x0ab4('0x28')](function(_0xb1cac2){if(_0xb1cac2){return _0xb1cac2?{'count':_0x28a722,'rows':_0xb1cac2}:null;}})['then'](respondWithResult(_0xb803f2,null))[_0x0ab4('0x47')](handleError(_0xb803f2,null));};exports[_0x0ab4('0x7a')]=function(_0x840fc2,_0x2282d7,_0x2bf00c){var _0x37a592={};var _0x171969={};var _0x51f02a;var _0x2a25d5;return db['VoicePrefix'][_0x0ab4('0x78')]({'where':{'id':_0x840fc2['params']['id']}})['then'](handleEntityNotFound(_0x2282d7,null))[_0x0ab4('0x28')](function(_0x7ae8b2){if(_0x7ae8b2){_0x51f02a=_0x7ae8b2;_0x171969[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x7b')]['rawAttributes']);_0x171969['query']=_[_0x0ab4('0x35')](_0x840fc2[_0x0ab4('0x34')]);_0x171969['filters']=_[_0x0ab4('0x36')](_0x171969['model'],_0x171969[_0x0ab4('0x34')]);_0x37a592[_0x0ab4('0x39')]=_['intersection'](_0x171969[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x37a592['attributes']=_0x37a592['attributes'][_0x0ab4('0x49')]?_0x37a592[_0x0ab4('0x39')]:_0x171969[_0x0ab4('0x37')];_0x37a592['order']=qs[_0x0ab4('0x3d')](_0x840fc2['query'][_0x0ab4('0x3d')]);_0x37a592[_0x0ab4('0x3e')]=qs['filters'](_['pick'](_0x840fc2['query'],_0x171969[_0x0ab4('0x3f')]));if(_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x42')]){_0x37a592[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x37a592['where'],{'$or':_[_0x0ab4('0x33')](_0x37a592[_0x0ab4('0x39')],function(_0x5e43fe){var _0xde4e2c={};_0xde4e2c[_0x5e43fe]={'$like':'%'+_0x840fc2[_0x0ab4('0x34')]['filter']+'%'};return _0xde4e2c;})});}_0x37a592=_[_0x0ab4('0x41')]({},_0x37a592,_0x840fc2[_0x0ab4('0x43')]);return _0x51f02a['getTeams'](_0x37a592);}})[_0x0ab4('0x28')](function(_0x213828){if(_0x213828){_0x2a25d5=_0x213828[_0x0ab4('0x49')];if(!_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x37a592[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x37a592['offset']=qs[_0x0ab4('0x1e')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}return _0x51f02a[_0x0ab4('0x7a')](_0x37a592);}})[_0x0ab4('0x28')](function(_0x4a9e47){if(_0x4a9e47){return _0x4a9e47?{'count':_0x2a25d5,'rows':_0x4a9e47}:null;}})['then'](respondWithResult(_0x2282d7,null))[_0x0ab4('0x47')](handleError(_0x2282d7,null));};exports['addTeams']=function(_0x15e2f6,_0x3da0c1,_0x415e42){var _0x1effa7=_0x15e2f6['body'][_0x0ab4('0x72')];var _0x33c31a;return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x1effa7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ab4('0x7d'),'attributes':['id',_0x0ab4('0x2d'),_0x0ab4('0x7e'),_0x0ab4('0x7f'),'interface'],'raw':!![]}]})['then'](function(_0x2c6284){if(_0x2c6284){_0x33c31a=_0x2c6284;var _0x272680=_[_0x0ab4('0x80')](_0x2c6284,function(_0x4e064a){var _0x29f715=_0x4e064a['get']({'plain':!![]});return _0x29f715[_0x0ab4('0x7d')];});return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x15e2f6['params']['id']}})['then'](function(_0x1d9644){return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0xa094f5){return _0x1d9644['addTeams'](_0x1effa7,{'transaction':_0xa094f5})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x33c31a,function(_0x45d3fa){return db[_0x0ab4('0x82')][_0x0ab4('0x83')]({'TeamId':_0x45d3fa['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},{'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x272680,function(_0x1d74f9){return db[_0x0ab4('0x84')][_0x0ab4('0x85')]({'where':{'UserId':_0x1d74f9['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){_0x272680['forEach'](function(_0x3984a2){socket[_0x0ab4('0x75')](_0x0ab4('0x86'),{'UserId':_0x3984a2['id'],'VoicePrefixId':_0x1d9644['id']});});});});});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x3da0c1,null))[_0x0ab4('0x47')](handleError(_0x3da0c1,null));};exports[_0x0ab4('0x87')]=function(_0x2ad3a9,_0x29f866,_0x182dfa){return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x2ad3a9['query'][_0x0ab4('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0ab4('0x79')],'as':_0x0ab4('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x0ab4('0x28')](handleEntityNotFound(_0x29f866,null))[_0x0ab4('0x28')](function(_0x50b719){var _0x2fbbec=_['map'](_0x50b719,'id');var _0x4379f1=[];var _0x175a2a=[];var _0x332b1c=squel[_0x0ab4('0x88')]();_0x332b1c[_0x0ab4('0x89')]('tq.TeamId')[_0x0ab4('0x8a')](_0x0ab4('0x8b'),'tq')[_0x0ab4('0x8c')](_0x0ab4('0x8d'),'ut',_0x0ab4('0x8e'))['where'](_0x0ab4('0x8f'),_0x2ad3a9[_0x0ab4('0x48')]['id']);for(var _0x3acf39=0x0;_0x3acf39<_0x50b719[_0x0ab4('0x49')];_0x3acf39+=0x1){let _0x28bc17=_0x50b719[_0x3acf39];for(var _0x927d5=0x0;_0x927d5<_0x28bc17[_0x0ab4('0x7d')][_0x0ab4('0x49')];_0x927d5+=0x1){let _0x43fde8=_0x28bc17[_0x0ab4('0x7d')][_0x927d5];var _0x3791e6=_0x332b1c[_0x0ab4('0x90')]();_0x3791e6[_0x0ab4('0x3e')](_0x0ab4('0x91'),_0x43fde8['id']);_0x175a2a['push'](db['sequelize']['query'](_0x3791e6['toString'](),{'type':db[_0x0ab4('0x4d')][_0x0ab4('0x92')]['SELECT']})[_0x0ab4('0x28')](function(_0x19e3f9){if(_0x19e3f9['length']===0x1){return _0x43fde8['id'];}else{var _0x58e215=_[_0x0ab4('0x93')](_['map'](_0x19e3f9,_0x0ab4('0x94')),function(_0x22fb42){return _['includes'](_0x2fbbec,_0x22fb42);});if(_0x58e215){return _0x43fde8['id'];}}}));}}return BPromise[_0x0ab4('0x95')](_0x175a2a)[_0x0ab4('0x28')](function(_0x17fed9){_0x4379f1=_(_0x4379f1)[_0x0ab4('0x96')](_0x17fed9)[_0x0ab4('0x97')]()[_0x0ab4('0x98')]();return db['VoicePrefix'][_0x0ab4('0x4a')]({'where':{'id':_0x2ad3a9[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](function(_0x4148dd){return db[_0x0ab4('0x4d')]['transaction'](function(_0x1a8f36){return _0x4148dd[_0x0ab4('0x87')](_0x2ad3a9['query'][_0x0ab4('0x72')],{'transaction':_0x1a8f36})[_0x0ab4('0x28')](function(){if(!_[_0x0ab4('0x99')](_0x4379f1)){return _0x4148dd[_0x0ab4('0x74')](_0x4379f1,{'transaction':_0x1a8f36});}})[_0x0ab4('0x28')](function(){_0x4379f1[_0x0ab4('0x9a')](function(_0x4bc8ff){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':_0x4bc8ff,'VoicePrefixId':_0x4148dd['id']});});});});});});})[_0x0ab4('0x28')](respondWithStatusCode(_0x29f866,null))[_0x0ab4('0x47')](handleError(_0x29f866,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8141b6d..84c340a 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 _0x1caa=['save','update','remove','hasOwnProperty','hook','exports','events','VoicePrefix','setMaxListeners'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x1caa,0xba));var _0xa1ca=function(_0x52aad1,_0x2282bb){_0x52aad1=_0x52aad1-0x0;var _0x131f02=_0x1caa[_0x52aad1];return _0x131f02;};'use strict';var EventEmitter=require(_0xa1ca('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xa1ca('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa1ca('0x2')](0x0);var events={'afterCreate':_0xa1ca('0x3'),'afterUpdate':_0xa1ca('0x4'),'afterDestroy':_0xa1ca('0x5')};function emitEvent(_0x51e623){return function(_0x5437af,_0x526502,_0x78bfb0){VoicePrefixEvents['emit'](_0x51e623+':'+_0x5437af['id'],_0x5437af);VoicePrefixEvents['emit'](_0x51e623,_0x5437af);_0x78bfb0(null);};}for(var e in events){if(events[_0xa1ca('0x6')](e)){var event=events[e];VoicePrefix[_0xa1ca('0x7')](e,emitEvent(event));}}module[_0xa1ca('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x3f2e=['exports','events','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x3f2e,0xf1));var _0xe3f2=function(_0x56aa6c,_0x360d1c){_0x56aa6c=_0x56aa6c-0x0;var _0x580b72=_0x3f2e[_0x56aa6c];return _0x580b72;};'use strict';var EventEmitter=require(_0xe3f2('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xe3f2('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe3f2('0x2')](0x0);var events={'afterCreate':_0xe3f2('0x3'),'afterUpdate':_0xe3f2('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe76f2b){return function(_0x24bcfd,_0x152fc0,_0x135f3c){VoicePrefixEvents[_0xe3f2('0x5')](_0xe76f2b+':'+_0x24bcfd['id'],_0x24bcfd);VoicePrefixEvents[_0xe3f2('0x5')](_0xe76f2b,_0x24bcfd);_0x135f3c(null);};}for(var e in events){if(events[_0xe3f2('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xe3f2('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 3e0cc16..c39b71b 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 _0xcdad=['api','moment','request-promise','path','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','util'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xcdad,0x1a6));var _0xdcda=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xcdad[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0xdcda('0x0'));var logger=require('../../config/logger')(_0xdcda('0x1'));var moment=require(_0xdcda('0x2'));var BPromise=require('bluebird');var rp=require(_0xdcda('0x3'));var fs=require('fs');var path=require(_0xdcda('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdcda('0x5'));module[_0xdcda('0x6')]=function(_0x3cf540,_0x23a6ab){return _0x3cf540['define'](_0xdcda('0x7'),attributes,{'tableName':_0xdcda('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec9=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x2b3816,_0x2979e2){var _0x108998=function(_0x6cfb29){while(--_0x6cfb29){_0x2b3816['push'](_0x2b3816['shift']());}};_0x108998(++_0x2979e2);}(_0x0ec9,0x1a7));var _0x90ec=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0ec9[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x90ec('0x0'));var util=require(_0x90ec('0x1'));var logger=require(_0x90ec('0x2'))('api');var moment=require(_0x90ec('0x3'));var BPromise=require(_0x90ec('0x4'));var rp=require(_0x90ec('0x5'));var fs=require('fs');var path=require(_0x90ec('0x6'));var rimraf=require(_0x90ec('0x7'));var config=require(_0x90ec('0x8'));var attributes=require(_0x90ec('0x9'));module[_0x90ec('0xa')]=function(_0x364e8b,_0x4cfa27){return _0x364e8b[_0x90ec('0xb')](_0x90ec('0xc'),attributes,{'tableName':_0x90ec('0xd'),'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 fa3d7e5..ed72c1b 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 _0xb145=['http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x143b98,_0x33e420){var _0x5a07be=function(_0x2eff14){while(--_0x2eff14){_0x143b98['push'](_0x143b98['shift']());}};_0x5a07be(++_0x33e420);}(_0xb145,0xa3));var _0x5b14=function(_0x10daf7,_0x2c2820){_0x10daf7=_0x10daf7-0x0;var _0xc0018b=_0xb145[_0x10daf7];return _0xc0018b;};'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});config['redis']=_[_0x5b14('0xc')](config[_0x5b14('0xd')],{'host':_0x5b14('0xe'),'port':0x18eb});var socket=require(_0x5b14('0xf'))(new Redis(config[_0x5b14('0xd')]));require('./voicePrefix.socket')[_0x5b14('0x10')](socket);function respondWithRpcPromise(_0x3bdb54,_0x4a4557,_0x1d8b5f){return new BPromise(function(_0x17047f,_0x1ecffb){return client[_0x5b14('0x11')](_0x3bdb54,_0x1d8b5f)[_0x5b14('0x12')](function(_0x4fb6da){logger[_0x5b14('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x4a4557,_0x5b14('0x14'));logger[_0x5b14('0x15')](_0x5b14('0x16'),_0x4a4557,_0x5b14('0x14'),JSON[_0x5b14('0x17')](_0x4fb6da));if(_0x4fb6da[_0x5b14('0x18')]){if(_0x4fb6da['error'][_0x5b14('0x19')]===0x1f4){logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);return _0x1ecffb(_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);}logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);return _0x17047f(_0x4fb6da[_0x5b14('0x18')]['message']);}else{logger[_0x5b14('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x4a4557,'request\x20sent');_0x17047f(_0x4fb6da['result'][_0x5b14('0x1b')]);}})[_0x5b14('0x1c')](function(_0x3662a7){logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x3662a7);_0x1ecffb(_0x3662a7);});});} \ No newline at end of file +var _0xb7f0=['then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x38230,_0x148d0c){var _0x522ec9=function(_0x21fefc){while(--_0x21fefc){_0x38230['push'](_0x38230['shift']());}};_0x522ec9(++_0x148d0c);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x3791a5,_0x3e9d44){_0x3791a5=_0x3791a5-0x0;var _0x495f05=_0xb7f0[_0x3791a5];return _0x495f05;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var moment=require(_0x0b7f('0x2'));var BPromise=require(_0x0b7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7f('0x4'))['db'];var utils=require(_0x0b7f('0x5'));var logger=require(_0x0b7f('0x6'))(_0x0b7f('0x7'));var config=require(_0x0b7f('0x8'));var jayson=require(_0x0b7f('0x9'));var client=jayson[_0x0b7f('0xa')][_0x0b7f('0xb')]({'port':0x232a});config[_0x0b7f('0xc')]=_[_0x0b7f('0xd')](config['redis'],{'host':_0x0b7f('0xe'),'port':0x18eb});var socket=require(_0x0b7f('0xf'))(new Redis(config['redis']));require(_0x0b7f('0x10'))[_0x0b7f('0x11')](socket);function respondWithRpcPromise(_0x5047cf,_0x5400ea,_0x596c5a){return new BPromise(function(_0x255197,_0x1e8f0a){return client[_0x0b7f('0x12')](_0x5047cf,_0x596c5a)[_0x0b7f('0x13')](function(_0x43114c){logger[_0x0b7f('0x14')](_0x0b7f('0x15'),_0x5400ea,_0x0b7f('0x16'));logger[_0x0b7f('0x17')](_0x0b7f('0x18'),_0x5400ea,_0x0b7f('0x16'),JSON['stringify'](_0x43114c));if(_0x43114c[_0x0b7f('0x19')]){if(_0x43114c[_0x0b7f('0x19')][_0x0b7f('0x1a')]===0x1f4){logger[_0x0b7f('0x19')](_0x0b7f('0x15'),_0x5400ea,_0x43114c[_0x0b7f('0x19')][_0x0b7f('0x1b')]);return _0x1e8f0a(_0x43114c[_0x0b7f('0x19')]['message']);}logger[_0x0b7f('0x19')](_0x0b7f('0x15'),_0x5400ea,_0x43114c[_0x0b7f('0x19')][_0x0b7f('0x1b')]);return _0x255197(_0x43114c['error'][_0x0b7f('0x1b')]);}else{logger[_0x0b7f('0x14')](_0x0b7f('0x15'),_0x5400ea,_0x0b7f('0x16'));_0x255197(_0x43114c[_0x0b7f('0x1c')]['message']);}})[_0x0b7f('0x1d')](function(_0x5112be){logger['error'](_0x0b7f('0x15'),_0x5400ea,_0x5112be);_0x1e8f0a(_0x5112be);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e36a1bb..8e75e77 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4584=['remove','update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x4584,0x1cf));var _0x4458=function(_0x17790d,_0x2532a6){_0x17790d=_0x17790d-0x0;var _0x59c20c=_0x4584[_0x17790d];return _0x59c20c;};'use strict';var VoicePrefixEvents=require(_0x4458('0x0'));var events=['save',_0x4458('0x1'),_0x4458('0x2')];function createListener(_0x23b438,_0x5340f5){return function(_0x570b9c){_0x5340f5[_0x4458('0x3')](_0x23b438,_0x570b9c);};}function removeListener(_0xde5996,_0x37118c){return function(){VoicePrefixEvents[_0x4458('0x4')](_0xde5996,_0x37118c);};}exports[_0x4458('0x5')]=function(_0xbf85ca){for(var _0x175c2d=0x0,_0x215b2d=events[_0x4458('0x6')];_0x175c2d<_0x215b2d;_0x175c2d++){var _0x51da14=events[_0x175c2d];var _0x14bb0f=createListener(_0x4458('0x7')+_0x51da14,_0xbf85ca);VoicePrefixEvents['on'](_0x51da14,_0x14bb0f);}}; \ No newline at end of file +var _0xf257=['removeListener','register','length','voicePrefix:','remove','update','emit'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0xf257,0x82));var _0x7f25=function(_0x5a05b8,_0x290752){_0x5a05b8=_0x5a05b8-0x0;var _0x2a0914=_0xf257[_0x5a05b8];return _0x2a0914;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x7f25('0x0'),_0x7f25('0x1')];function createListener(_0x3f7a94,_0x22d4a9){return function(_0x5c712c){_0x22d4a9[_0x7f25('0x2')](_0x3f7a94,_0x5c712c);};}function removeListener(_0x2aca61,_0xd94d7a){return function(){VoicePrefixEvents[_0x7f25('0x3')](_0x2aca61,_0xd94d7a);};}exports[_0x7f25('0x4')]=function(_0x36b013){for(var _0x1998d7=0x0,_0x242a3e=events[_0x7f25('0x5')];_0x1998d7<_0x242a3e;_0x1998d7++){var _0x16e278=events[_0x1998d7];var _0x31a5d8=createListener(_0x7f25('0x6')+_0x16e278,_0x36b013);VoicePrefixEvents['on'](_0x16e278,_0x31a5d8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f8aac79..c953c98 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x45ab7c,_0x2e0b88){var _0x1390db=function(_0xac69f1){while(--_0xac69f1){_0x45ab7c['push'](_0x45ab7c['shift']());}};_0x1390db(++_0x2e0b88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0xb10b,0x12a));var _0xbb10=function(_0x47b281,_0x25034f){_0x47b281=_0x47b281-0x0;var _0x49abfa=_0xb10b[_0x47b281];return _0x49abfa;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 417acb9..38af370 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 _0x3bba=['tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','name','ENUM','inbound','ringall','fewestcalls','random','rrmemory','rrordered','setDataValue','dialMethod','getDataValue','preview','booked','roundrobin','includes','strategy','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x56bf20,_0x282628){var _0x3bcf57=function(_0x12a6c5){while(--_0x12a6c5){_0x56bf20['push'](_0x56bf20['shift']());}};_0x3bcf57(++_0x282628);}(_0x3bba,0x186));var _0xa3bb=function(_0x23a145,_0x3ba4f8){_0x23a145=_0x23a145-0x0;var _0x17070e=_0x3bba[_0x23a145];return _0x17070e;};'use strict';var Sequelize=require('sequelize');module[_0xa3bb('0x0')]={'name':{'type':Sequelize[_0xa3bb('0x1')],'allowNull':![],'unique':_0xa3bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xa3bb('0x5'),'leastrecent',_0xa3bb('0x6'),_0xa3bb('0x7'),_0xa3bb('0x8'),'linear','wrandom',_0xa3bb('0x9')),'allowNull':![],'defaultValue':_0xa3bb('0x5'),'set':function(_0x48c53b){this[_0xa3bb('0xa')]('strategy',_0x48c53b?_0x48c53b:_0xa3bb('0x8'));},'get':function(){var _0x2b84e2=this['getDataValue']('type');var _0x331a98=this['getDataValue'](_0xa3bb('0xb'));var _0x303fcc=this[_0xa3bb('0xc')]('strategy');if(_0x2b84e2==='outbound'){if(_0x331a98===_0xa3bb('0xd')){return null;}if(_0x331a98===_0xa3bb('0xe')&&![_0xa3bb('0x8'),_0xa3bb('0xf')][_0xa3bb('0x10')](_0x303fcc)){this['setDataValue'](_0xa3bb('0x11'),_0xa3bb('0x8'));}}return _0x303fcc;}},'servicelevel':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa3bb('0x12')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa3bb('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa3bb('0x12')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa3bb('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa3bb('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa3bb('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':_0xa3bb('0x13')},'announce_holdtime':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no',_0xa3bb('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0xa3bb('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa3bb('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa3bb('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xa3bb('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xa3bb('0x1')]},'queue_less_than':{'type':Sequelize[_0xa3bb('0x1')]},'periodic_announce':{'type':Sequelize[_0xa3bb('0x15')],'set':function(_0xee954b){this['setDataValue'](_0xa3bb('0x16'),_0xee954b?_0xee954b[_0xa3bb('0x17')](','):[]);},'get':function(){return this[_0xa3bb('0xc')](_0xa3bb('0x16'))?this['getDataValue'](_0xa3bb('0x16'))[_0xa3bb('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':_0xa3bb('0x13'),'set':function(_0x22fc4b){this['setDataValue'](_0xa3bb('0x19'),_0x22fc4b?_0x22fc4b[_0xa3bb('0x17')](','):undefined);},'get':function(){return this['getDataValue'](_0xa3bb('0x19'))?this[_0xa3bb('0xc')]('joinempty')[_0xa3bb('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':'no','set':function(_0x4abe89){this[_0xa3bb('0xa')]('leavewhenempty',_0x4abe89?_0x4abe89[_0xa3bb('0x17')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0xa3bb('0xc')]('leavewhenempty')[_0xa3bb('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa3bb('0x1')]},'description':{'type':Sequelize[_0xa3bb('0x1')]},'acw':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':0x0,'set':function(_0x1475b5){this['setDataValue'](_0xa3bb('0x1b'),_0x1475b5);if(_0x1475b5){if(this[_0xa3bb('0xc')](_0xa3bb('0x1c'))<0x2){this['setDataValue'](_0xa3bb('0x1c'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa3bb('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xa3bb('0x3')](_0xa3bb('0xd'),_0xa3bb('0x1d'),_0xa3bb('0x1e'),_0xa3bb('0x1f'),_0xa3bb('0xe')),'defaultValue':_0xa3bb('0x1d'),'comment':_0xa3bb('0x20')},'dialLimitChannel':{'type':Sequelize[_0xa3bb('0x12')](0x4)[_0xa3bb('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa3bb('0x22')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xa3bb('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa3bb('0x23')},'dialPowerLevel':{'type':Sequelize[_0xa3bb('0x24')](0x2)[_0xa3bb('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa3bb('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xa3bb('0x26'),'dropRate'),'defaultValue':_0xa3bb('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa3bb('0x24')](0x2)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa3bb('0x28')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xa3bb('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa3bb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa3bb('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x29')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xa3bb('0x2a'),'comment':_0xa3bb('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x2c')},'dialQueueProject':{'type':Sequelize[_0xa3bb('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa3bb('0x2e')},'dialTimezone':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa3bb('0x1')],'defaultValue':_0xa3bb('0x2f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa3bb('0x30'),_0xa3bb('0x31'),'onlyIfOpen'),'defaultValue':_0xa3bb('0x30')},'dialAMDActive':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':0x0,'comment':_0xa3bb('0x32')},'dialAMDInitialSilence':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa3bb('0x33')},'dialAMDGreeting':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa3bb('0x34')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa3bb('0x35')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa3bb('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa3bb('0x36')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa3bb('0x37')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa3bb('0x12')](0x9)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa3bb('0x38')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa3bb('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa3bb('0x39')},'dialRecallMeTimeout':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa3bb('0x3a')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa3bb('0x3')]('DESC',_0xa3bb('0x3b')),'defaultValue':_0xa3bb('0x3c')},'dialQueueProject2':{'type':Sequelize[_0xa3bb('0x1')],'comment':_0xa3bb('0x3d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa3bb('0x3e')},'dialCutDigit':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa3bb('0x40')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x41')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa3bb('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa3bb('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa3bb('0x44')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa3bb('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa3bb('0x12')](0x5)[_0xa3bb('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa3bb('0x12')],'allowNull':!![],'comment':_0xa3bb('0x45')},'mandatoryDisposition':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':![],'comment':_0xa3bb('0x46'),'set':function(_0x1b29a0){if(!_0x1b29a0)this[_0xa3bb('0xa')](_0xa3bb('0x47'),null);this[_0xa3bb('0xa')]('mandatoryDisposition',_0x1b29a0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xa3bb('0x12')](0x3)[_0xa3bb('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xa3bb('0x12')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa3bb('0x1a')],'defaultValue':![]}}; \ No newline at end of file +var _0x8db1=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','leavewhenempty','split','BOOLEAN','wrapuptime','progressive','power','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2f167e,_0x38473d){var _0x30ba5f=function(_0x348744){while(--_0x348744){_0x2f167e['push'](_0x2f167e['shift']());}};_0x30ba5f(++_0x38473d);}(_0x8db1,0x162));var _0x18db=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0x8db1[_0x12c280];return _0x3638d3;};'use strict';var Sequelize=require(_0x18db('0x0'));module[_0x18db('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x18db('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x4'),_0x18db('0x5')),'allowNull':![],'defaultValue':_0x18db('0x4')},'musiconhold':{'type':Sequelize[_0x18db('0x6')],'defaultValue':_0x18db('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x18db('0x3')]('rr',_0x18db('0x8'),_0x18db('0x9'),_0x18db('0xa'),_0x18db('0xb'),'rrmemory',_0x18db('0xc'),'wrandom',_0x18db('0xd')),'allowNull':![],'defaultValue':_0x18db('0x8'),'set':function(_0x520883){this[_0x18db('0xe')](_0x18db('0xf'),_0x520883?_0x520883:_0x18db('0x10'));},'get':function(){var _0x4f7619=this[_0x18db('0x11')](_0x18db('0x12'));var _0xcb6515=this['getDataValue'](_0x18db('0x13'));var _0x3d74e7=this[_0x18db('0x11')](_0x18db('0xf'));if(_0x4f7619===_0x18db('0x5')){if(_0xcb6515===_0x18db('0x14')){return null;}if(_0xcb6515===_0x18db('0x15')&&!['rrmemory',_0x18db('0x16')][_0x18db('0x17')](_0x3d74e7)){this['setDataValue'](_0x18db('0xf'),_0x18db('0x10'));}}return _0x3d74e7;}},'servicelevel':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x18db('0x18')](0xb)},'timeout':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x18db('0x6')]},'weight':{'type':Sequelize[_0x18db('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x18db('0x3')]('yes','no'),'defaultValue':_0x18db('0x19')},'autopause':{'type':Sequelize['ENUM'](_0x18db('0x19'),'no',_0x18db('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x18db('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x18db('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x18db('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x18db('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x18db('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defaultValue':_0x18db('0x19')},'announce_holdtime':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no',_0x18db('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x18db('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x18db('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x18db('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x18db('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x18db('0x6')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x18db('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x18db('0x6')]},'queue_quantity1':{'type':Sequelize[_0x18db('0x6')]},'queue_quantity2':{'type':Sequelize[_0x18db('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x18db('0x6')]},'queue_less_than':{'type':Sequelize[_0x18db('0x6')]},'periodic_announce':{'type':Sequelize[_0x18db('0x1c')],'set':function(_0x5f1de5){this[_0x18db('0xe')]('periodic_announce',_0x5f1de5?_0x5f1de5[_0x18db('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x18db('0x1e'))?this[_0x18db('0x11')](_0x18db('0x1e'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x18db('0x6')],'defaultValue':_0x18db('0x19'),'set':function(_0xf80bf6){this[_0x18db('0xe')]('joinempty',_0xf80bf6?_0xf80bf6[_0x18db('0x1d')](','):undefined);},'get':function(){return this[_0x18db('0x11')]('joinempty')?this[_0x18db('0x11')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x18db('0x6')],'defaultValue':'no','set':function(_0x368565){this[_0x18db('0xe')](_0x18db('0x1f'),_0x368565?_0x368565[_0x18db('0x1d')](','):undefined);},'get':function(){return this[_0x18db('0x11')](_0x18db('0x1f'))?this['getDataValue'](_0x18db('0x1f'))[_0x18db('0x20')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x18db('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x18db('0x6')]},'description':{'type':Sequelize[_0x18db('0x6')]},'acw':{'type':Sequelize[_0x18db('0x21')],'defaultValue':0x0,'set':function(_0x52bd5d){this[_0x18db('0xe')]('acw',_0x52bd5d);if(_0x52bd5d){if(this['getDataValue'](_0x18db('0x22'))<0x2){this[_0x18db('0xe')](_0x18db('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x18db('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x18db('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x14'),_0x18db('0x23'),_0x18db('0x24'),'predictive',_0x18db('0x15')),'defaultValue':_0x18db('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x18db('0x18')](0x4)[_0x18db('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x18db('0x26')},'dialLimitQueue':{'type':Sequelize[_0x18db('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x18db('0x27')},'dialPowerLevel':{'type':Sequelize[_0x18db('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x29'),_0x18db('0x2a')),'defaultValue':_0x18db('0x2a'),'comment':_0x18db('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x18db('0x28')](0x2)[_0x18db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x18db('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x18db('0x18')](0x3)[_0x18db('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x18db('0x18')](0x3)[_0x18db('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18db('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x18db('0x6')],'defaultValue':_0x18db('0x2e'),'comment':_0x18db('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x18db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x18db('0x6')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)[_0x18db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18db('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18db('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x18db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18db('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18db('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)[_0x18db('0x25')],'defaultValue':0x3,'comment':_0x18db('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18db('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x18db('0x36')},'dialTimezone':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x18db('0x6')],'defaultValue':_0x18db('0x37')},'dialPrefix':{'type':Sequelize[_0x18db('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x18db('0x3')](_0x18db('0x38'),_0x18db('0x39'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x18db('0x21')],'defaultValue':0x0,'comment':_0x18db('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x18db('0x18')](0x9)[_0x18db('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x18db('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x18db('0x18')](0x9)[_0x18db('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x18db('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x18db('0x18')](0x9)[_0x18db('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x18db('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x18db('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18db('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x18db('0x18')](0x9)[_0x18db('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x18db('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x18db('0x18')](0x9)[_0x18db('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x18db('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x18db('0x18')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x18db('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x18db('0x18')](0x9)[_0x18db('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18db('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x18db('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x18db('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x18db('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x18db('0x44'),_0x18db('0x45')),'defaultValue':_0x18db('0x44')},'dialQueueProject2':{'type':Sequelize[_0x18db('0x6')],'comment':_0x18db('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18db('0x47')},'dialCutDigit':{'type':Sequelize[_0x18db('0x18')](0x3)[_0x18db('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18db('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18db('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18db('0x4a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x18db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18db('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18db('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18db('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x18db('0x18')](0x5)[_0x18db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18db('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x18db('0x18')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5f2819){if(!_0x5f2819)this[_0x18db('0xe')](_0x18db('0x4f'),null);this[_0x18db('0xe')](_0x18db('0x50'),_0x5f2819);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x18db('0x18')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x18db('0x18')](0x3)[_0x18db('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x18db('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x18db('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x18db('0x21')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 113fd3a..ffd874a 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 _0xfd20=['autoAssociation','clone','merge','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','CmHopperHistory','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','User','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','transaction','removeAgents','userVoiceQueue:remove','addAgents','omit','ids','spread','online','isEmpty','isNil','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ListId','scheduledAt','ContactId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','error','stack','send','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','options','VoiceQueue','includeAll','include','rows','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd20,0x66));var _0x0fd2=function(_0x35fcb7,_0x3734c0){_0x35fcb7=_0x35fcb7-0x0;var _0x30f28a=_0xfd20[_0x35fcb7];return _0x30f28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];config[_0x0fd2('0x16')]=_[_0x0fd2('0x17')](config[_0x0fd2('0x16')],{'host':_0x0fd2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0fd2('0x19'))[_0x0fd2('0x1a')](socket);function respondWithStatusCode(_0x21dcc5,_0x28dd2b){_0x28dd2b=_0x28dd2b||0xcc;return function(_0x52ab36){if(_0x52ab36){return _0x21dcc5[_0x0fd2('0x1b')](_0x28dd2b);}return _0x21dcc5['status'](_0x28dd2b)['end']();};}function respondWithResult(_0x2b6254,_0x50eedc){_0x50eedc=_0x50eedc||0xc8;return function(_0x42f44c){if(_0x42f44c){return _0x2b6254['status'](_0x50eedc)[_0x0fd2('0x1c')](_0x42f44c);}};}function respondWithFilteredResult(_0x4cd2bf,_0x267dfb){return function(_0x15c9de){if(_0x15c9de){var _0x53787a=typeof _0x267dfb[_0x0fd2('0x1d')]==='undefined'&&typeof _0x267dfb[_0x0fd2('0x1e')]===_0x0fd2('0x1f');var _0x3fb07e=_0x15c9de[_0x0fd2('0x20')];var _0x2977ef=_0x53787a?0x0:_0x267dfb[_0x0fd2('0x1d')];var _0x3ea260=_0x53787a?_0x15c9de[_0x0fd2('0x20')]:_0x267dfb[_0x0fd2('0x1d')]+_0x267dfb[_0x0fd2('0x1e')];var _0x5c50ad;if(_0x3ea260>=_0x3fb07e){_0x3ea260=_0x3fb07e;_0x5c50ad=0xc8;}else{_0x5c50ad=0xce;}_0x4cd2bf['status'](_0x5c50ad);return _0x4cd2bf['set'](_0x0fd2('0x21'),_0x2977ef+'-'+_0x3ea260+'/'+_0x3fb07e)[_0x0fd2('0x1c')](_0x15c9de);}return null;};}function patchUpdates(_0x53ab17){return function(_0x48586c){try{jsonpatch[_0x0fd2('0x22')](_0x48586c,_0x53ab17,!![]);}catch(_0x25563c){return BPromise[_0x0fd2('0x23')](_0x25563c);}return _0x48586c[_0x0fd2('0x24')]();};}function saveUpdates(_0x25cdd2,_0x5d15ed){return function(_0x233b01){if(_0x233b01){return _0x233b01[_0x0fd2('0x25')](_0x25cdd2)[_0x0fd2('0x26')](function(_0x54cce1){return _0x54cce1;});}return null;};}function removeEntity(_0x4c77a8,_0x11bb10){return function(_0x2a45e1){if(_0x2a45e1){return _0x2a45e1['destroy']()[_0x0fd2('0x26')](function(){var _0x429fef=_0x2a45e1[_0x0fd2('0x27')]({'plain':!![]});var _0x1defb4=[{'name':_0x0fd2('0x28'),'value':_0x0fd2('0x29'),'ignore':![]},{'name':_0x0fd2('0x2a'),'value':_0x0fd2('0x2b'),'ignore':![]}];var _0x5b32df=_(_0x1defb4)[_0x0fd2('0x2c')](_0x0fd2('0x2d'))[_0x0fd2('0x2e')](_0x0fd2('0x2f'))[_0x0fd2('0x2f')]();if(_['includes'](_0x5b32df,_0x429fef[_0x0fd2('0x30')])){return;}var _0x33335b=_[_0x0fd2('0x31')](_0x1defb4,[_0x0fd2('0x2f'),_0x429fef[_0x0fd2('0x30')]])[_0x0fd2('0x32')];return db[_0x0fd2('0x33')][_0x0fd2('0x34')]({'where':{'type':_0x33335b,'resourceId':_0x429fef['id']}})['then'](function(){return _0x2a45e1;});})[_0x0fd2('0x26')](function(){_0x4c77a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1828cc,_0x553715){return function(_0x2faac3){if(!_0x2faac3){_0x1828cc['sendStatus'](0x194);}return _0x2faac3;};}function handleError(_0x244095,_0x53f585){_0x53f585=_0x53f585||0x1f4;return function(_0x5caeff){logger[_0x0fd2('0x35')](_0x5caeff[_0x0fd2('0x36')]);if(_0x5caeff[_0x0fd2('0x32')]){delete _0x5caeff['name'];}_0x244095['status'](_0x53f585)[_0x0fd2('0x37')](_0x5caeff);};}exports['index']=function(_0x11917f,_0x6b6cb4){var _0x803113={},_0x44167a={},_0x12f9ad={'count':0x0,'rows':[]};var _0x2975fb=_[_0x0fd2('0x2e')](db['VoiceQueue'][_0x0fd2('0x38')],function(_0x2ccfbe){return{'name':_0x2ccfbe['fieldName'],'type':_0x2ccfbe['type'][_0x0fd2('0x39')]};});_0x44167a['model']=_['map'](_0x2975fb,_0x0fd2('0x32'));_0x44167a[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x11917f[_0x0fd2('0x3a')]);_0x44167a[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x44167a[_0x0fd2('0x3e')],_0x44167a[_0x0fd2('0x3a')]);_0x803113[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x44167a[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x803113[_0x0fd2('0x3f')]=_0x803113[_0x0fd2('0x3f')]['length']?_0x803113[_0x0fd2('0x3f')]:_0x44167a[_0x0fd2('0x3e')];if(!_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x41')]('nolimit')){_0x803113[_0x0fd2('0x1e')]=qs['limit'](_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x803113['offset']=qs[_0x0fd2('0x1d')](_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x803113[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x11917f[_0x0fd2('0x3a')]['sort']);_0x803113[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x11917f[_0x0fd2('0x3a')],_0x44167a[_0x0fd2('0x3c')]),_0x2975fb);if(_0x11917f['query'][_0x0fd2('0x2c')]){_0x803113[_0x0fd2('0x44')]=_['merge'](_0x803113[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x2975fb,function(_0x400b49){if(_0x400b49[_0x0fd2('0x30')]!==_0x0fd2('0x46')){var _0x22c89d={};_0x22c89d[_0x400b49[_0x0fd2('0x32')]]={'$like':'%'+_0x11917f[_0x0fd2('0x3a')]['filter']+'%'};return _0x22c89d;}})});}_0x803113=_['merge']({},_0x803113,_0x11917f[_0x0fd2('0x47')]);var _0x19d9e2={'where':_0x803113['where']};return db[_0x0fd2('0x48')]['count'](_0x19d9e2)[_0x0fd2('0x26')](function(_0x241570){_0x12f9ad[_0x0fd2('0x20')]=_0x241570;if(_0x11917f[_0x0fd2('0x3a')][_0x0fd2('0x49')]){_0x803113[_0x0fd2('0x4a')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x803113);})[_0x0fd2('0x26')](function(_0x5065dc){_0x12f9ad[_0x0fd2('0x4b')]=_0x5065dc;return _0x12f9ad;})[_0x0fd2('0x26')](respondWithFilteredResult(_0x6b6cb4,_0x803113))[_0x0fd2('0x4c')](handleError(_0x6b6cb4,null));};exports[_0x0fd2('0x4d')]=function(_0x2f47f9,_0x500d1a){var _0x1bbe6a={'raw':![],'where':{'id':_0x2f47f9[_0x0fd2('0x4e')]['id']}},_0x49f5c2={};_0x49f5c2[_0x0fd2('0x3e')]=_['keys'](db[_0x0fd2('0x48')]['rawAttributes']);_0x49f5c2['query']=_[_0x0fd2('0x3b')](_0x2f47f9[_0x0fd2('0x3a')]);_0x49f5c2[_0x0fd2('0x3c')]=_['intersection'](_0x49f5c2[_0x0fd2('0x3e')],_0x49f5c2[_0x0fd2('0x3a')]);_0x1bbe6a[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x49f5c2['model'],qs[_0x0fd2('0x40')](_0x2f47f9[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x1bbe6a[_0x0fd2('0x3f')]=_0x1bbe6a[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x1bbe6a[_0x0fd2('0x3f')]:_0x49f5c2[_0x0fd2('0x3e')];if(_0x2f47f9[_0x0fd2('0x3a')][_0x0fd2('0x49')]){_0x1bbe6a[_0x0fd2('0x4a')]=[{'all':!![]}];}_0x1bbe6a=_['merge']({},_0x1bbe6a,_0x2f47f9[_0x0fd2('0x47')]);return db[_0x0fd2('0x48')]['find'](_0x1bbe6a)[_0x0fd2('0x26')](handleEntityNotFound(_0x500d1a,null))['then'](respondWithResult(_0x500d1a,null))[_0x0fd2('0x4c')](handleError(_0x500d1a,null));};exports[_0x0fd2('0x50')]=function(_0xe2cd72,_0xed36b3){return db[_0x0fd2('0x48')]['create'](_0xe2cd72[_0x0fd2('0x51')],{})[_0x0fd2('0x26')](function(_0x101509){var _0x4c1020=_0xe2cd72['user'][_0x0fd2('0x27')]({'plain':!![]});if(!_0x4c1020)throw new Error(_0x0fd2('0x52'));if(_0x4c1020[_0x0fd2('0x53')]===_0x0fd2('0x54')){var _0xec149c=_0x101509[_0x0fd2('0x27')]({'plain':!![]});var _0x4a9fe1=[{'name':_0x0fd2('0x28'),'value':_0x0fd2('0x29')},{'name':_0x0fd2('0x2a'),'value':_0x0fd2('0x2b')}];var _0x379524=_[_0x0fd2('0x31')](_0x4a9fe1,[_0x0fd2('0x2f'),_0xec149c[_0x0fd2('0x30')]])[_0x0fd2('0x32')];return db[_0x0fd2('0x55')][_0x0fd2('0x31')]({'where':{'name':_0x379524,'userProfileId':_0x4c1020[_0x0fd2('0x56')]},'raw':!![]})[_0x0fd2('0x26')](function(_0x50929f){if(_0x50929f&&_0x50929f[_0x0fd2('0x57')]===0x0){return db[_0x0fd2('0x33')]['create']({'name':_0xec149c[_0x0fd2('0x32')],'resourceId':_0xec149c['id'],'type':_0x50929f[_0x0fd2('0x32')],'sectionId':_0x50929f['id']},{})[_0x0fd2('0x26')](function(){return _0x101509;});}else{return _0x101509;}})[_0x0fd2('0x4c')](function(_0x5674b3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5674b3);throw _0x5674b3;});}return _0x101509;})[_0x0fd2('0x26')](respondWithResult(_0xed36b3,0xc9))[_0x0fd2('0x4c')](handleError(_0xed36b3,null));};exports[_0x0fd2('0x58')]=function(_0x27754d,_0x41dd02){var _0x1ba67f={'where':{'id':_0x27754d[_0x0fd2('0x4e')]['id']}},_0x47343a={};_0x47343a[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db['VoiceQueue']['rawAttributes']);_0x1ba67f['attributes']=_['intersection'](_0x47343a['model'],qs[_0x0fd2('0x40')](_0x27754d['query'][_0x0fd2('0x40')]));_0x1ba67f['attributes']=_0x1ba67f[_0x0fd2('0x3f')]['length']?_0x1ba67f[_0x0fd2('0x3f')]:_0x47343a[_0x0fd2('0x3e')];if(_0x27754d[_0x0fd2('0x3a')]['includeAll']){_0x1ba67f['include']=[{'all':!![]}];}_0x1ba67f=_[_0x0fd2('0x59')]({},_0x1ba67f,_0x27754d[_0x0fd2('0x47')]);return db[_0x0fd2('0x48')][_0x0fd2('0x31')](_0x1ba67f)[_0x0fd2('0x26')](handleEntityNotFound(_0x41dd02,null))[_0x0fd2('0x26')](function(_0x359ee2){if(_0x359ee2){var _0x44fd9d=_0x359ee2[_0x0fd2('0x27')]({'plain':!![]});_0x44fd9d=qs['omit'](_0x44fd9d,['id',_0x0fd2('0x5a'),_0x0fd2('0x5b')]);_0x27754d[_0x0fd2('0x51')]=_['omit'](_0x27754d[_0x0fd2('0x51')],['id','createdAt',_0x0fd2('0x5b')]);return db[_0x0fd2('0x48')][_0x0fd2('0x50')](_[_0x0fd2('0x59')](_0x44fd9d,_0x27754d[_0x0fd2('0x51')]),{'include':_0x27754d[_0x0fd2('0x3a')][_0x0fd2('0x49')]?[{'all':!![]}]:undefined})[_0x0fd2('0x26')](function(_0x53bb88){var _0x33530b=_0x27754d[_0x0fd2('0x54')]['get']({'plain':!![]});if(!_0x33530b)throw new Error(_0x0fd2('0x52'));if(_0x33530b[_0x0fd2('0x53')]===_0x0fd2('0x54')){var _0x58d2f1=_0x53bb88[_0x0fd2('0x27')]({'plain':!![]});var _0x43f751=[{'name':_0x0fd2('0x28'),'value':_0x0fd2('0x29')},{'name':_0x0fd2('0x2a'),'value':_0x0fd2('0x2b')}];var _0x1ed5db=_[_0x0fd2('0x31')](_0x43f751,[_0x0fd2('0x2f'),_0x58d2f1['type']])[_0x0fd2('0x32')];return db[_0x0fd2('0x55')][_0x0fd2('0x31')]({'where':{'name':_0x1ed5db,'userProfileId':_0x33530b['userProfileId']},'raw':!![]})[_0x0fd2('0x26')](function(_0x288212){if(_0x288212&&_0x288212[_0x0fd2('0x57')]===0x0){return db[_0x0fd2('0x33')][_0x0fd2('0x50')]({'name':_0x58d2f1['name'],'resourceId':_0x58d2f1['id'],'type':_0x288212['name'],'sectionId':_0x288212['id']},{})[_0x0fd2('0x26')](function(){return _0x53bb88;});}else{return _0x53bb88;}})[_0x0fd2('0x4c')](function(_0x39bd89){logger[_0x0fd2('0x35')](_0x0fd2('0x5c'),_0x39bd89);throw _0x39bd89;});}return _0x53bb88;});}})[_0x0fd2('0x26')](respondWithResult(_0x41dd02,0xc9))[_0x0fd2('0x4c')](handleError(_0x41dd02,null));};exports[_0x0fd2('0x25')]=function(_0x54aadc,_0x14f6fb){if(_0x54aadc[_0x0fd2('0x51')]['id']){delete _0x54aadc[_0x0fd2('0x51')]['id'];}return db[_0x0fd2('0x48')]['find']({'where':{'id':_0x54aadc[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x14f6fb,null))[_0x0fd2('0x26')](saveUpdates(_0x54aadc[_0x0fd2('0x51')],null))[_0x0fd2('0x26')](respondWithResult(_0x14f6fb,null))[_0x0fd2('0x4c')](handleError(_0x14f6fb,null));};exports[_0x0fd2('0x34')]=function(_0x16d33b,_0x404af9){return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x16d33b[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x404af9,null))[_0x0fd2('0x26')](removeEntity(_0x404af9,null))[_0x0fd2('0x4c')](handleError(_0x404af9,null));};exports[_0x0fd2('0x5d')]=function(_0x294e12,_0x3fb02f,_0x5e91c0){var _0x6660e4={'raw':![],'where':{}};var _0x3b4bfc={};var _0x32ee12={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x294e12['params']['id']}})['then'](handleEntityNotFound(_0x3fb02f,null))[_0x0fd2('0x26')](function(_0x158899){if(_0x158899){_0x3b4bfc[_0x0fd2('0x3e')]=_['keys'](db[_0x0fd2('0x5f')][_0x0fd2('0x38')]);_0x3b4bfc[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x294e12[_0x0fd2('0x3a')]);_0x3b4bfc[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x3b4bfc[_0x0fd2('0x3e')],_0x3b4bfc[_0x0fd2('0x3a')]);_0x6660e4[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x3b4bfc[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x294e12[_0x0fd2('0x3a')]['fields']));_0x6660e4[_0x0fd2('0x3f')]=_0x6660e4[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x6660e4['attributes']:_0x3b4bfc[_0x0fd2('0x3e')];if(!_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x6660e4[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x6660e4[_0x0fd2('0x1d')]=qs['offset'](_0x294e12['query']['offset']);}_0x6660e4[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x6660e4[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_['pick'](_0x294e12[_0x0fd2('0x3a')],_0x3b4bfc['filters']));_0x6660e4[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x158899['id'];if(_0x294e12['query'][_0x0fd2('0x2c')]){_0x6660e4[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x6660e4['where'],{'$or':_[_0x0fd2('0x2e')](_0x6660e4[_0x0fd2('0x3f')],function(_0x5ee8bc){var _0x5659f6={};_0x5659f6[_0x5ee8bc]={'$like':'%'+_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x5659f6;})});}_0x6660e4=_[_0x0fd2('0x59')]({},_0x6660e4,_0x294e12[_0x0fd2('0x47')]);return db[_0x0fd2('0x5f')]['count']({'where':_0x6660e4[_0x0fd2('0x44')]})[_0x0fd2('0x26')](function(_0x53a49c){_0x32ee12[_0x0fd2('0x20')]=_0x53a49c;if(_0x294e12[_0x0fd2('0x3a')][_0x0fd2('0x49')]){_0x6660e4[_0x0fd2('0x4a')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x6660e4);})[_0x0fd2('0x26')](function(_0x524528){_0x32ee12[_0x0fd2('0x4b')]=_0x524528;return _0x32ee12;});}})[_0x0fd2('0x26')](respondWithFilteredResult(_0x3fb02f,_0x6660e4))['catch'](handleError(_0x3fb02f,null));};exports['getHopperHistories']=function(_0x405814,_0x21d371,_0x2043f5){var _0x552dcd={'raw':!![],'where':{}};var _0x22c88a={};var _0x3883de={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')]['findOne']({'where':{'id':_0x405814[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x21d371,null))['then'](function(_0x5cc6fe){if(_0x5cc6fe){_0x22c88a[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db[_0x0fd2('0x62')][_0x0fd2('0x38')]);_0x22c88a[_0x0fd2('0x3a')]=_['keys'](_0x405814[_0x0fd2('0x3a')]);_0x22c88a[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x22c88a[_0x0fd2('0x3e')],_0x22c88a[_0x0fd2('0x3a')]);_0x552dcd[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x22c88a[_0x0fd2('0x3e')],qs['fields'](_0x405814['query'][_0x0fd2('0x40')]));_0x552dcd[_0x0fd2('0x3f')]=_0x552dcd[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x552dcd['attributes']:_0x22c88a[_0x0fd2('0x3e')];if(!_0x405814[_0x0fd2('0x3a')]['hasOwnProperty']('nolimit')){_0x552dcd['limit']=qs[_0x0fd2('0x1e')](_0x405814[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x552dcd[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x405814[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x552dcd[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x405814[_0x0fd2('0x3a')]['sort']);_0x552dcd[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x405814[_0x0fd2('0x3a')],_0x22c88a[_0x0fd2('0x3c')]));_0x552dcd[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x5cc6fe['id'];if(_0x405814['query'][_0x0fd2('0x2c')]){_0x552dcd[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x552dcd[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x552dcd[_0x0fd2('0x3f')],function(_0x203979){var _0x4141de={};_0x4141de[_0x203979]={'$like':'%'+_0x405814['query'][_0x0fd2('0x2c')]+'%'};return _0x4141de;})});}_0x552dcd=_[_0x0fd2('0x59')]({},_0x552dcd,_0x405814[_0x0fd2('0x47')]);return db[_0x0fd2('0x62')][_0x0fd2('0x20')]({'where':_0x552dcd[_0x0fd2('0x44')]})['then'](function(_0x146f01){_0x3883de[_0x0fd2('0x20')]=_0x146f01;if(_0x405814['query'][_0x0fd2('0x49')]){_0x552dcd[_0x0fd2('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x552dcd);})[_0x0fd2('0x26')](function(_0x27e6ac){_0x3883de[_0x0fd2('0x4b')]=_0x27e6ac;return _0x3883de;});}})[_0x0fd2('0x26')](respondWithFilteredResult(_0x21d371,_0x552dcd))['catch'](handleError(_0x21d371,null));};exports['getHopperFinals']=function(_0x12e136,_0x46d4f2,_0x35ec32){var _0x5b88fc={'raw':!![],'where':{}};var _0x2fa756={};var _0x2acc75={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x12e136[_0x0fd2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x46d4f2,null))[_0x0fd2('0x26')](function(_0x2f5c3b){if(_0x2f5c3b){_0x2fa756['model']=_[_0x0fd2('0x3b')](db[_0x0fd2('0x63')]['rawAttributes']);_0x2fa756[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x12e136[_0x0fd2('0x3a')]);_0x2fa756[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x2fa756[_0x0fd2('0x3e')],_0x2fa756[_0x0fd2('0x3a')]);_0x5b88fc[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x2fa756[_0x0fd2('0x3e')],qs['fields'](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x5b88fc[_0x0fd2('0x3f')]=_0x5b88fc[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x5b88fc[_0x0fd2('0x3f')]:_0x2fa756[_0x0fd2('0x3e')];if(!_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x41')]('nolimit')){_0x5b88fc[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x5b88fc['offset']=qs[_0x0fd2('0x1d')](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x5b88fc['order']=qs['sort'](_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x5b88fc[_0x0fd2('0x44')]=qs['filters'](_[_0x0fd2('0x45')](_0x12e136[_0x0fd2('0x3a')],_0x2fa756['filters']));_0x5b88fc[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x2f5c3b['id'];if(_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x5b88fc[_0x0fd2('0x44')]=_['merge'](_0x5b88fc[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x5b88fc[_0x0fd2('0x3f')],function(_0x1260db){var _0x3dfe33={};_0x3dfe33[_0x1260db]={'$like':'%'+_0x12e136[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x3dfe33;})});}_0x5b88fc=_['merge']({},_0x5b88fc,_0x12e136[_0x0fd2('0x47')]);return db[_0x0fd2('0x63')]['count']({'where':_0x5b88fc['where']})['then'](function(_0x3ab8c6){_0x2acc75['count']=_0x3ab8c6;if(_0x12e136['query'][_0x0fd2('0x49')]){_0x5b88fc['include']=[{'all':!![]}];}return db[_0x0fd2('0x63')][_0x0fd2('0x64')](_0x5b88fc);})['then'](function(_0x5d0ca9){_0x2acc75['rows']=_0x5d0ca9;return _0x2acc75;});}})['then'](respondWithFilteredResult(_0x46d4f2,_0x5b88fc))['catch'](handleError(_0x46d4f2,null));};exports[_0x0fd2('0x65')]=function(_0x244fd2,_0x50502e,_0x528fa4){var _0x453b8d={'raw':!![],'where':{}};var _0x1771ce={};var _0xf445a8={'count':0x0,'rows':[]};return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x244fd2[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x50502e,null))[_0x0fd2('0x26')](function(_0x2f56dd){if(_0x2f56dd){_0x1771ce[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db['CmHopperBlack'][_0x0fd2('0x38')]);_0x1771ce['query']=_[_0x0fd2('0x3b')](_0x244fd2[_0x0fd2('0x3a')]);_0x1771ce[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x1771ce['model'],_0x1771ce[_0x0fd2('0x3a')]);_0x453b8d[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x1771ce['model'],qs[_0x0fd2('0x40')](_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x453b8d[_0x0fd2('0x3f')]=_0x453b8d[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x453b8d[_0x0fd2('0x3f')]:_0x1771ce[_0x0fd2('0x3e')];if(!_0x244fd2['query'][_0x0fd2('0x41')]('nolimit')){_0x453b8d[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x244fd2['query']['limit']);_0x453b8d[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}_0x453b8d[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x244fd2['query'][_0x0fd2('0x43')]);_0x453b8d[_0x0fd2('0x44')]=qs['filters'](_['pick'](_0x244fd2[_0x0fd2('0x3a')],_0x1771ce['filters']));_0x453b8d[_0x0fd2('0x44')][_0x0fd2('0x61')]=_0x2f56dd['id'];if(_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x453b8d['where']=_[_0x0fd2('0x59')](_0x453b8d['where'],{'$or':_['map'](_0x453b8d[_0x0fd2('0x3f')],function(_0x1b7818){var _0x41e57e={};_0x41e57e[_0x1b7818]={'$like':'%'+_0x244fd2[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x41e57e;})});}_0x453b8d=_['merge']({},_0x453b8d,_0x244fd2['options']);return db['CmHopperBlack']['count']({'where':_0x453b8d[_0x0fd2('0x44')]})['then'](function(_0x36b164){_0xf445a8[_0x0fd2('0x20')]=_0x36b164;if(_0x244fd2[_0x0fd2('0x3a')]['includeAll']){_0x453b8d[_0x0fd2('0x4a')]=[{'all':!![]}];}return db[_0x0fd2('0x66')][_0x0fd2('0x64')](_0x453b8d);})['then'](function(_0x1c0392){_0xf445a8[_0x0fd2('0x4b')]=_0x1c0392;return _0xf445a8;});}})[_0x0fd2('0x26')](respondWithFilteredResult(_0x50502e,_0x453b8d))[_0x0fd2('0x4c')](handleError(_0x50502e,null));};exports[_0x0fd2('0x67')]=function(_0x2dd7bd,_0x2fb19f,_0x1361ff){var _0x2311d8={};var _0x2fd8f8={};var _0xcc05d5;var _0x19f8c0;return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x2dd7bd[_0x0fd2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fb19f,null))[_0x0fd2('0x26')](function(_0x4463eb){if(_0x4463eb){_0xcc05d5=_0x4463eb;_0x2fd8f8[_0x0fd2('0x3e')]=_['keys'](db[_0x0fd2('0x68')][_0x0fd2('0x38')]);_0x2fd8f8[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x2dd7bd[_0x0fd2('0x3a')]);_0x2fd8f8[_0x0fd2('0x3c')]=_['intersection'](_0x2fd8f8[_0x0fd2('0x3e')],_0x2fd8f8[_0x0fd2('0x3a')]);_0x2311d8[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x2fd8f8[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x2311d8[_0x0fd2('0x3f')]=_0x2311d8[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x2311d8[_0x0fd2('0x3f')]:_0x2fd8f8[_0x0fd2('0x3e')];_0x2311d8[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x2dd7bd[_0x0fd2('0x3a')]['sort']);_0x2311d8[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x2dd7bd[_0x0fd2('0x3a')],_0x2fd8f8[_0x0fd2('0x3c')]));if(_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x2311d8['where']=_[_0x0fd2('0x59')](_0x2311d8[_0x0fd2('0x44')],{'$or':_['map'](_0x2311d8[_0x0fd2('0x3f')],function(_0x425333){var _0x7e2917={};_0x7e2917[_0x425333]={'$like':'%'+_0x2dd7bd[_0x0fd2('0x3a')]['filter']+'%'};return _0x7e2917;})});}_0x2311d8=_['merge']({},_0x2311d8,_0x2dd7bd[_0x0fd2('0x47')]);return _0xcc05d5['getTeams'](_0x2311d8);}})['then'](function(_0x11db90){if(_0x11db90){_0x19f8c0=_0x11db90['length'];if(!_0x2dd7bd[_0x0fd2('0x3a')]['hasOwnProperty'](_0x0fd2('0x60'))){_0x2311d8[_0x0fd2('0x1e')]=qs['limit'](_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x2311d8[_0x0fd2('0x1d')]=qs['offset'](_0x2dd7bd[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0xcc05d5['getTeams'](_0x2311d8);}})[_0x0fd2('0x26')](function(_0x293098){if(_0x293098){return _0x293098?{'count':_0x19f8c0,'rows':_0x293098}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x2fb19f,null))[_0x0fd2('0x4c')](handleError(_0x2fb19f,null));};exports[_0x0fd2('0x69')]=function(_0x23db78,_0x2d97de,_0x5cb489){var _0x5a3809=_0x23db78[_0x0fd2('0x51')]['teams'];var _0x549306=_[_0x0fd2('0x2e')](_0x5a3809,'id');return db[_0x0fd2('0x68')][_0x0fd2('0x64')]({'where':{'id':_0x549306},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fd2('0x6a'),'attributes':['id',_0x0fd2('0x32'),'online',_0x0fd2('0x6b'),_0x0fd2('0x6c')],'raw':!![]}]})[_0x0fd2('0x26')](function(_0x45eb44){if(_0x45eb44){var _0x254999=_[_0x0fd2('0x6d')](_0x45eb44,function(_0x3cc23a){var _0x17b6ee=_0x3cc23a[_0x0fd2('0x27')]({'plain':!![]});_0x17b6ee[_0x0fd2('0x6a')]['forEach'](function(_0x5d1bd1){_0x5d1bd1['penalty']=_[_0x0fd2('0x31')](_0x5a3809,{'id':_0x17b6ee['id']})[_0x0fd2('0x6e')];});return _0x17b6ee[_0x0fd2('0x6a')];});return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x23db78[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(_0x30c8aa){return db[_0x0fd2('0x6f')]['transaction'](function(_0x8aa97d){return _0x30c8aa[_0x0fd2('0x69')](_0x549306,{'transaction':_0x8aa97d})[_0x0fd2('0x26')](function(){return BPromise[_0x0fd2('0x70')](_0x5a3809,function(_0x3ac89f){return db[_0x0fd2('0x71')][_0x0fd2('0x72')]({'TeamId':_0x3ac89f['id'],'VoiceQueueId':_0x23db78['params']['id'],'penalty':_0x3ac89f[_0x0fd2('0x6e')]},{'transaction':_0x8aa97d});});})[_0x0fd2('0x26')](function(){return BPromise['each'](_0x254999,function(_0x26b5b0){return db[_0x0fd2('0x73')]['findOrCreate']({'where':{'UserId':_0x26b5b0['id'],'VoiceQueueId':_0x23db78['params']['id']},'defaults':{'penalty':_0x26b5b0['penalty']},'transaction':_0x8aa97d});});})['then'](function(){return BPromise[_0x0fd2('0x70')](_[_0x0fd2('0x2c')](_0x254999,{'online':!![]}),function(_0x45f4be){return db[_0x0fd2('0x74')][_0x0fd2('0x72')]({'membername':_0x45f4be['name'],'UserId':_0x45f4be['id'],'queue_name':_0x30c8aa[_0x0fd2('0x32')],'VoiceQueueId':_0x30c8aa['id'],'interface':_['isNil'](_0x45f4be[_0x0fd2('0x6c')])?util[_0x0fd2('0x75')](_0x0fd2('0x76'),_0x45f4be[_0x0fd2('0x32')]):_0x45f4be['interface'],'paused':_0x45f4be['voicePause']||![],'penalty':_0x45f4be[_0x0fd2('0x6e')]},{'transaction':_0x8aa97d});});})[_0x0fd2('0x26')](function(){_0x254999[_0x0fd2('0x77')](function(_0x5592a5){socket[_0x0fd2('0x78')](_0x0fd2('0x79'),{'UserId':_0x5592a5['id'],'VoiceQueueId':_0x30c8aa['id']});});});});});}})[_0x0fd2('0x26')](respondWithStatusCode(_0x2d97de,null))[_0x0fd2('0x4c')](handleError(_0x2d97de,null));};exports[_0x0fd2('0x7a')]=function(_0x204295,_0x3acba7,_0x502625){return db[_0x0fd2('0x68')][_0x0fd2('0x64')]({'where':{'id':_0x204295[_0x0fd2('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0fd2('0x7b')],'as':_0x0fd2('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x0fd2('0x26')](handleEntityNotFound(_0x3acba7,null))[_0x0fd2('0x26')](function(_0x2eee6e){var _0x2f46f0=_[_0x0fd2('0x2e')](_0x2eee6e,'id');var _0x930fd8=[];var _0x42359e=[];var _0x4055f4=squel['select']();_0x4055f4[_0x0fd2('0x7c')]('tq.TeamId')[_0x0fd2('0x7d')]('team_has_voice_queues','tq')[_0x0fd2('0x7e')](_0x0fd2('0x7f'),'ut',_0x0fd2('0x80'))[_0x0fd2('0x44')](_0x0fd2('0x81'),_0x204295[_0x0fd2('0x4e')]['id']);for(var _0x24676f=0x0;_0x24676f<_0x2eee6e['length'];_0x24676f+=0x1){let _0x4102c4=_0x2eee6e[_0x24676f];for(var _0x3cab70=0x0;_0x3cab70<_0x4102c4[_0x0fd2('0x6a')][_0x0fd2('0x4f')];_0x3cab70+=0x1){let _0x4af57f=_0x4102c4[_0x0fd2('0x6a')][_0x3cab70];var _0x5f54bb=_0x4055f4['clone']();_0x5f54bb[_0x0fd2('0x44')](_0x0fd2('0x82'),_0x4af57f['id']);_0x42359e[_0x0fd2('0x83')](db[_0x0fd2('0x6f')][_0x0fd2('0x3a')](_0x5f54bb[_0x0fd2('0x84')](),{'type':db[_0x0fd2('0x6f')][_0x0fd2('0x85')]['SELECT']})[_0x0fd2('0x26')](function(_0x1b8a6b){if(_0x1b8a6b[_0x0fd2('0x4f')]===0x1){return _0x4af57f['id'];}else{var _0x55bf30=_[_0x0fd2('0x86')](_['map'](_0x1b8a6b,_0x0fd2('0x87')),function(_0x329f21){return _[_0x0fd2('0x88')](_0x2f46f0,_0x329f21);});if(_0x55bf30){return _0x4af57f['id'];}}}));}}return BPromise['all'](_0x42359e)[_0x0fd2('0x26')](function(_0xfbbf6a){_0x930fd8=_(_0x930fd8)[_0x0fd2('0x89')](_0xfbbf6a)[_0x0fd2('0x8a')]()['value']();return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x204295[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(_0x1ea889){return db[_0x0fd2('0x6f')][_0x0fd2('0x8b')](function(_0x4ef946){return _0x1ea889[_0x0fd2('0x7a')](_0x204295[_0x0fd2('0x3a')]['ids'],{'transaction':_0x4ef946})[_0x0fd2('0x26')](function(){if(!_['isEmpty'](_0x930fd8)){return _0x1ea889[_0x0fd2('0x8c')](_0x930fd8,{'transaction':_0x4ef946})[_0x0fd2('0x26')](function(){return db[_0x0fd2('0x74')][_0x0fd2('0x34')]({'where':{'VoiceQueueId':_0x204295[_0x0fd2('0x4e')]['id'],'UserId':_0x930fd8},'transaction':_0x4ef946});});}})['then'](function(){_0x930fd8['forEach'](function(_0x337a61){socket['emit'](_0x0fd2('0x8d'),{'UserId':_0x337a61,'VoiceQueueId':_0x1ea889['id']});});});});});});})[_0x0fd2('0x26')](respondWithStatusCode(_0x3acba7,null))[_0x0fd2('0x4c')](handleError(_0x3acba7,null));};exports[_0x0fd2('0x8e')]=function(_0x2b36ba,_0x8ec643,_0xd0380a){var _0x5e7a1e,_0x33fb11;return db[_0x0fd2('0x48')][_0x0fd2('0x31')]({'where':{'id':_0x2b36ba[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x8ec643,null))[_0x0fd2('0x26')](function(_0x45a93b){if(_0x45a93b){_0x33fb11=_0x45a93b;return _0x45a93b[_0x0fd2('0x8e')](_0x2b36ba[_0x0fd2('0x51')]['ids'],_[_0x0fd2('0x8f')](_0x2b36ba[_0x0fd2('0x51')],[_0x0fd2('0x90'),'id'])||{})[_0x0fd2('0x91')](function(_0x489a04){for(var _0x56fa58=0x0;_0x56fa58<_0x2b36ba[_0x0fd2('0x51')]['ids'][_0x0fd2('0x4f')];_0x56fa58+=0x1){socket[_0x0fd2('0x78')](_0x0fd2('0x79'),{'UserId':Number(_0x2b36ba[_0x0fd2('0x51')]['ids'][_0x56fa58]),'VoiceQueueId':Number(_0x2b36ba[_0x0fd2('0x4e')]['id'])});}return _0x489a04;});}})[_0x0fd2('0x26')](function(_0x278640){_0x5e7a1e=_0x278640||[];if(_0x33fb11){return db[_0x0fd2('0x7b')]['findAll']({'where':{'id':_0x2b36ba[_0x0fd2('0x51')]['ids']},'attributes':['id',_0x0fd2('0x32'),_0x0fd2('0x92'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x2e2316){if(!_[_0x0fd2('0x93')](_0x2e2316)){var _0x44c4f6=[];for(var _0x5dce22=0x0;_0x5dce22<_0x2e2316[_0x0fd2('0x4f')];_0x5dce22++){if(_0x2e2316[_0x5dce22][_0x0fd2('0x92')]){_0x44c4f6[_0x0fd2('0x83')](db['UserVoiceQueueRt'][_0x0fd2('0x72')]({'membername':_0x2e2316[_0x5dce22][_0x0fd2('0x32')],'UserId':_0x2e2316[_0x5dce22]['id'],'queue_name':_0x33fb11[_0x0fd2('0x32')],'VoiceQueueId':_0x33fb11['id'],'interface':_[_0x0fd2('0x94')](_0x2e2316[_0x5dce22][_0x0fd2('0x6c')])?util['format'](_0x0fd2('0x76'),_0x2e2316[_0x5dce22][_0x0fd2('0x32')]):_0x2e2316[_0x5dce22]['interface'],'paused':_0x2e2316[_0x5dce22][_0x0fd2('0x6b')]||![],'penalty':_0x2b36ba['body'][_0x0fd2('0x6e')]||0x0}));}}return BPromise['all'](_0x44c4f6);}})['then'](function(){return _0x5e7a1e;})['then'](respondWithResult(_0x8ec643,null))[_0x0fd2('0x4c')](handleError(_0x8ec643,null));};exports[_0x0fd2('0x8c')]=function(_0x171fcd,_0x39d82a,_0x352e30){return db[_0x0fd2('0x48')][_0x0fd2('0x31')]({'where':{'id':_0x171fcd[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x39d82a,null))[_0x0fd2('0x26')](function(_0x25ec73){if(_0x25ec73){return _0x25ec73[_0x0fd2('0x8c')](_0x171fcd[_0x0fd2('0x3a')][_0x0fd2('0x90')])[_0x0fd2('0x26')](function(){if(_['isArray'](_0x171fcd[_0x0fd2('0x3a')][_0x0fd2('0x90')])){for(var _0xc64ae7=0x0;_0xc64ae7<_0x171fcd['query'][_0x0fd2('0x90')][_0x0fd2('0x4f')];_0xc64ae7+=0x1){socket['emit'](_0x0fd2('0x8d'),{'UserId':Number(_0x171fcd['query'][_0x0fd2('0x90')][_0xc64ae7]),'VoiceQueueId':Number(_0x171fcd[_0x0fd2('0x4e')]['id'])});}}else{socket[_0x0fd2('0x78')]('userVoiceQueue:remove',{'UserId':Number(_0x171fcd[_0x0fd2('0x3a')][_0x0fd2('0x90')]),'VoiceQueueId':Number(_0x171fcd[_0x0fd2('0x4e')]['id'])});}});}})[_0x0fd2('0x26')](function(_0x386e89){return db[_0x0fd2('0x74')][_0x0fd2('0x34')]({'where':{'VoiceQueueId':_0x171fcd['params']['id'],'UserId':_0x171fcd['query'][_0x0fd2('0x90')]}})[_0x0fd2('0x26')](function(){return _0x386e89;});})[_0x0fd2('0x26')](respondWithStatusCode(_0x39d82a,null))[_0x0fd2('0x4c')](handleError(_0x39d82a,null));};exports[_0x0fd2('0x95')]=function(_0x5288b4,_0x52581b,_0x36f6ad){var _0x38c3dc={};var _0x40d38a={};var _0xcb396d;var _0x3da13b;return db['VoiceQueue'][_0x0fd2('0x5e')]({'where':{'id':_0x5288b4[_0x0fd2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52581b,null))[_0x0fd2('0x26')](function(_0x12c6fd){if(_0x12c6fd){_0xcb396d=_0x12c6fd;_0x40d38a[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db[_0x0fd2('0x7b')]['rawAttributes']);_0x40d38a[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x5288b4[_0x0fd2('0x3a')]);_0x40d38a['filters']=_[_0x0fd2('0x3d')](_0x40d38a[_0x0fd2('0x3e')],_0x40d38a[_0x0fd2('0x3a')]);_0x38c3dc[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x40d38a[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x38c3dc[_0x0fd2('0x3f')]=_0x38c3dc[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x38c3dc['attributes']:_0x40d38a[_0x0fd2('0x3e')];_0x38c3dc[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x38c3dc['where']=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x5288b4[_0x0fd2('0x3a')],_0x40d38a[_0x0fd2('0x3c')]));if(_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x38c3dc[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x38c3dc['where'],{'$or':_[_0x0fd2('0x2e')](_0x38c3dc['attributes'],function(_0x838146){var _0x46c7de={};_0x46c7de[_0x838146]={'$like':'%'+_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0x46c7de;})});}_0x38c3dc=_[_0x0fd2('0x59')]({},_0x38c3dc,_0x5288b4[_0x0fd2('0x47')]);return _0xcb396d[_0x0fd2('0x95')](_0x38c3dc);}})[_0x0fd2('0x26')](function(_0x9e4ce8){if(_0x9e4ce8){_0x3da13b=_0x9e4ce8[_0x0fd2('0x4f')];if(!_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x38c3dc[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x5288b4['query'][_0x0fd2('0x1e')]);_0x38c3dc['offset']=qs['offset'](_0x5288b4[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0xcb396d[_0x0fd2('0x95')](_0x38c3dc);}})['then'](function(_0x389a13){if(_0x389a13){return _0x389a13?{'count':_0x3da13b,'rows':_0x389a13}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x52581b,null))[_0x0fd2('0x4c')](handleError(_0x52581b,null));};exports['getMembers']=function(_0x2d72d3,_0x13d21f,_0x839fa2){var _0x2c937e={};var _0x2182ff={};var _0x57a3b7;var _0x4a560f;return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x2d72d3['params']['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x13d21f,null))[_0x0fd2('0x26')](function(_0xfb23b5){if(_0xfb23b5){_0x57a3b7=_0xfb23b5;_0x2182ff[_0x0fd2('0x3e')]=_[_0x0fd2('0x3b')](db[_0x0fd2('0x74')]['rawAttributes']);_0x2182ff[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x2d72d3[_0x0fd2('0x3a')]);_0x2182ff['filters']=_[_0x0fd2('0x3d')](_0x2182ff['model'],_0x2182ff['query']);_0x2c937e[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0x2182ff[_0x0fd2('0x3e')],qs['fields'](_0x2d72d3[_0x0fd2('0x3a')]['fields']));_0x2c937e[_0x0fd2('0x3f')]=_0x2c937e[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x2c937e['attributes']:_0x2182ff[_0x0fd2('0x3e')];_0x2c937e[_0x0fd2('0x42')]=qs[_0x0fd2('0x43')](_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x2c937e[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_[_0x0fd2('0x45')](_0x2d72d3['query'],_0x2182ff['filters']));if(_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x2c937e[_0x0fd2('0x44')]=_['merge'](_0x2c937e[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x2c937e['attributes'],function(_0x4cbf0b){var _0xbbdba={};_0xbbdba[_0x4cbf0b]={'$like':'%'+_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x2c')]+'%'};return _0xbbdba;})});}_0x2c937e=_[_0x0fd2('0x59')]({},_0x2c937e,_0x2d72d3[_0x0fd2('0x47')]);return _0x57a3b7[_0x0fd2('0x96')](_0x2c937e);}})['then'](function(_0xbc48){if(_0xbc48){_0x4a560f=_0xbc48['length'];if(!_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x2c937e[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x2c937e[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x2d72d3[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0x57a3b7[_0x0fd2('0x96')](_0x2c937e);}})[_0x0fd2('0x26')](function(_0x46d429){return _0x46d429?{'count':_0x4a560f,'rows':_0x46d429}:null;})[_0x0fd2('0x26')](respondWithResult(_0x13d21f,null))[_0x0fd2('0x4c')](handleError(_0x13d21f,null));};exports[_0x0fd2('0x97')]=function(_0x591dab,_0x187f92,_0x26d3d5){var _0x522123={};var _0xe0bf92={};var _0x15c72e;var _0x59eca9;return db[_0x0fd2('0x48')][_0x0fd2('0x5e')]({'where':{'id':_0x591dab['params']['id']}})['then'](handleEntityNotFound(_0x187f92,null))[_0x0fd2('0x26')](function(_0x5d3ae7){if(_0x5d3ae7){_0x15c72e=_0x5d3ae7;_0xe0bf92['model']=_[_0x0fd2('0x3b')](db['CmList'][_0x0fd2('0x38')]);_0xe0bf92[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x591dab[_0x0fd2('0x3a')]);_0xe0bf92[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0xe0bf92[_0x0fd2('0x3e')],_0xe0bf92[_0x0fd2('0x3a')]);_0x522123[_0x0fd2('0x3f')]=_[_0x0fd2('0x3d')](_0xe0bf92[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x40')]));_0x522123['attributes']=_0x522123[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x522123['attributes']:_0xe0bf92[_0x0fd2('0x3e')];_0x522123['order']=qs[_0x0fd2('0x43')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x522123['where']=qs['filters'](_[_0x0fd2('0x45')](_0x591dab[_0x0fd2('0x3a')],_0xe0bf92[_0x0fd2('0x3c')]));if(_0x591dab['query'][_0x0fd2('0x2c')]){_0x522123[_0x0fd2('0x44')]=_[_0x0fd2('0x59')](_0x522123[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x522123[_0x0fd2('0x3f')],function(_0x3ce674){var _0x43f2c6={};_0x43f2c6[_0x3ce674]={'$like':'%'+_0x591dab['query']['filter']+'%'};return _0x43f2c6;})});}_0x522123=_[_0x0fd2('0x59')]({},_0x522123,_0x591dab[_0x0fd2('0x47')]);return _0x15c72e[_0x0fd2('0x97')](_0x522123);}})[_0x0fd2('0x26')](function(_0xaace5f){if(_0xaace5f){_0x59eca9=_0xaace5f[_0x0fd2('0x4f')];if(!_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x41')](_0x0fd2('0x60'))){_0x522123[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x522123[_0x0fd2('0x1d')]=qs[_0x0fd2('0x1d')](_0x591dab[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0x15c72e['getLists'](_0x522123);}})[_0x0fd2('0x26')](function(_0x451f31){if(_0x451f31){return _0x451f31?{'count':_0x59eca9,'rows':_0x451f31}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x187f92,null))[_0x0fd2('0x4c')](handleError(_0x187f92,null));};exports[_0x0fd2('0x98')]=function(_0x468f7a,_0x4b0e7d,_0x4e1cef){var _0x2dc84d=moment()['format'](_0x0fd2('0x99'));var _0x1b61b2,_0x4f4b3b;return db[_0x0fd2('0x48')][_0x0fd2('0x31')]({'where':{'id':_0x468f7a[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x4b0e7d,null))['then'](function(_0x203fbe){if(_0x203fbe){_0x4f4b3b=_0x203fbe;return _0x203fbe[_0x0fd2('0x98')](_0x468f7a[_0x0fd2('0x51')][_0x0fd2('0x90')],_[_0x0fd2('0x8f')](_0x468f7a[_0x0fd2('0x51')],[_0x0fd2('0x90'),'id'])||{});}return null;})['spread'](function(_0x23a184){var _0x544885;_0x1b61b2=_0x23a184||[];var _0x6d0e63=[];if(_0x23a184){for(var _0x2379c0=0x0;_0x2379c0<_0x23a184[_0x0fd2('0x4f')];_0x2379c0+=0x1){var _0x285bd7=_0x23a184[_0x2379c0][_0x0fd2('0x27')]({'plain':!![]});_0x4f4b3b[_0x0fd2('0x9a')]=_0x468f7a['body'][_0x0fd2('0x9a')]?_0x468f7a[_0x0fd2('0x51')][_0x0fd2('0x9a')]:_0x4f4b3b[_0x0fd2('0x9a')];switch(_0x4f4b3b['dialCheckDuplicateType']){case _0x0fd2('0x9b'):_0x544885=squel[_0x0fd2('0x9c')]()['into'](_0x0fd2('0x9d'))[_0x0fd2('0x9e')]([_0x0fd2('0x9f'),'scheduledAt','ContactId',_0x0fd2('0xa0'),_0x0fd2('0x61'),_0x0fd2('0x5a'),'updatedAt'],squel['select']()[_0x0fd2('0x7c')](_0x0fd2('0x9f'),_0x0fd2('0x9f'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0xa1'))[_0x0fd2('0x7c')]('id',_0x0fd2('0xa2'))[_0x0fd2('0x7c')](_0x285bd7['CmListId'][_0x0fd2('0x84')](),_0x0fd2('0xa0'))[_0x0fd2('0x7c')](_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')](),'VoiceQueueId')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5a'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5b'))[_0x0fd2('0x7d')](_0x0fd2('0xa3'))[_0x0fd2('0x44')](_0x0fd2('0xa4'))[_0x0fd2('0x44')](_0x0fd2('0xa5'),_0x285bd7[_0x0fd2('0xa6')][_0x0fd2('0x84')]())[_0x0fd2('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x0fd2('0x44')](_0x0fd2('0xa7'),squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')]('COALESCE(calleridnum,\x27\x27)')[_0x0fd2('0x7d')]('cm_hopper_final')[_0x0fd2('0x44')]('VoiceQueueId\x20=\x20?',_0x468f7a[_0x0fd2('0x4e')]['id']['toString']()))[_0x0fd2('0x44')](_0x0fd2('0xa7'),squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')](_0x0fd2('0xa9'))[_0x0fd2('0x7d')](_0x0fd2('0x9d'))[_0x0fd2('0x44')](_0x0fd2('0x81'),_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')]())))[_0x0fd2('0x84')]();break;case _0x0fd2('0xaa'):_0x544885=squel['insert']()[_0x0fd2('0xab')]('cm_hopper')['fromQuery']([_0x0fd2('0x9f'),_0x0fd2('0xa1'),_0x0fd2('0xa2'),_0x0fd2('0xa0'),_0x0fd2('0x61'),_0x0fd2('0x5a'),'updatedAt'],squel[_0x0fd2('0xa8')]()['field'](_0x0fd2('0x9f'),_0x0fd2('0x9f'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','scheduledAt')[_0x0fd2('0x7c')]('id',_0x0fd2('0xa2'))[_0x0fd2('0x7c')](_0x285bd7[_0x0fd2('0xa6')]['toString'](),_0x0fd2('0xa0'))[_0x0fd2('0x7c')](_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')](),_0x0fd2('0x61'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','createdAt')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','updatedAt')[_0x0fd2('0x7d')]('cm_contacts')[_0x0fd2('0x44')]('deletedAt\x20IS\x20NULL')[_0x0fd2('0x44')]('ListId\x20=\x20?',_0x285bd7['CmListId'][_0x0fd2('0x84')]())[_0x0fd2('0x44')](_0x0fd2('0xac'))[_0x0fd2('0x44')](_0x0fd2('0xa7'),squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')](_0x0fd2('0xa9'))[_0x0fd2('0x7d')]('cm_hopper')[_0x0fd2('0x44')]('VoiceQueueId\x20=\x20?',_0x468f7a[_0x0fd2('0x4e')]['id']['toString']())))[_0x0fd2('0x84')]();break;default:_0x544885=squel[_0x0fd2('0x9c')]()['into'](_0x0fd2('0x9d'))['fromQuery']([_0x0fd2('0x9f'),_0x0fd2('0xa1'),_0x0fd2('0xa2'),_0x0fd2('0xa0'),'VoiceQueueId',_0x0fd2('0x5a'),_0x0fd2('0x5b')],squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')](_0x0fd2('0x9f'),'phone')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','scheduledAt')['field']('id','ContactId')[_0x0fd2('0x7c')](_0x285bd7[_0x0fd2('0xa6')]['toString'](),_0x0fd2('0xa0'))['field'](_0x468f7a[_0x0fd2('0x4e')]['id'][_0x0fd2('0x84')](),_0x0fd2('0x61'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','createdAt')[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5b'))[_0x0fd2('0x7d')](_0x0fd2('0xa3'))[_0x0fd2('0x44')]('deletedAt\x20IS\x20NULL')[_0x0fd2('0x44')]('ListId\x20=\x20?',_0x285bd7[_0x0fd2('0xa6')]['toString']())[_0x0fd2('0x44')](_0x0fd2('0xac')))[_0x0fd2('0x84')]();}_0x6d0e63[_0x0fd2('0x83')](db[_0x0fd2('0x6f')][_0x0fd2('0x3a')](_0x544885));}return BPromise['all'](_0x6d0e63);}})[_0x0fd2('0x26')](function(){var _0x4b2a0e=[];var _0x1ad987=squel[_0x0fd2('0x9c')]()[_0x0fd2('0xab')]('cm_hopper_additional_phones')[_0x0fd2('0x9e')]([_0x0fd2('0xad'),'phone',_0x0fd2('0xae'),_0x0fd2('0x5a'),'updatedAt'],squel[_0x0fd2('0xa8')]()[_0x0fd2('0x7c')]('h.id')[_0x0fd2('0x7c')](_0x0fd2('0xaf'))[_0x0fd2('0x7c')](_0x0fd2('0xb0'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27',_0x0fd2('0x5a'))[_0x0fd2('0x7c')]('\x27'+_0x2dc84d+'\x27','updatedAt')[_0x0fd2('0x7d')](_0x0fd2('0xb1'),'ci')[_0x0fd2('0x7e')](_0x0fd2('0x9d'),'h','h.ContactId=ci.CmContactId')[_0x0fd2('0x44')](_0x0fd2('0xb2'),_0x2dc84d)[_0x0fd2('0x44')](_0x0fd2('0xb3'),_0x0fd2('0xb4')))[_0x0fd2('0x84')]();_0x4b2a0e['push'](db[_0x0fd2('0x6f')]['query'](_0x1ad987));return BPromise[_0x0fd2('0xb5')](_0x4b2a0e);})[_0x0fd2('0x26')](function(){return _0x1b61b2;})['then'](respondWithResult(_0x4b0e7d,null))['catch'](handleError(_0x4b0e7d,null));};exports[_0x0fd2('0xb6')]=function(_0x3878eb,_0x5383ea,_0x260a1d){return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x3878eb['params']['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x5383ea,null))[_0x0fd2('0x26')](function(_0x4fd20b){if(_0x4fd20b){return _0x4fd20b[_0x0fd2('0xb6')](_0x3878eb[_0x0fd2('0x3a')][_0x0fd2('0x90')]);}})[_0x0fd2('0x26')](function(_0x318144){if(_0x318144){return db[_0x0fd2('0x5f')][_0x0fd2('0x34')]({'where':{'ListId':_0x3878eb[_0x0fd2('0x3a')][_0x0fd2('0x90')],'VoiceQueueId':_0x3878eb[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(){return _0x318144;});}})[_0x0fd2('0x26')](respondWithStatusCode(_0x5383ea,null))[_0x0fd2('0x4c')](handleError(_0x5383ea,null));};exports['getBlackLists']=function(_0x51b80a,_0x54585d,_0x407be5){var _0x241914={};var _0x64e087={};var _0x35479a;var _0x81b4bb;return db[_0x0fd2('0x48')]['findOne']({'where':{'id':_0x51b80a[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x54585d,null))['then'](function(_0x2ec276){if(_0x2ec276){_0x35479a=_0x2ec276;_0x64e087['model']=_[_0x0fd2('0x3b')](db[_0x0fd2('0xb7')][_0x0fd2('0x38')]);_0x64e087[_0x0fd2('0x3a')]=_[_0x0fd2('0x3b')](_0x51b80a[_0x0fd2('0x3a')]);_0x64e087[_0x0fd2('0x3c')]=_[_0x0fd2('0x3d')](_0x64e087[_0x0fd2('0x3e')],_0x64e087[_0x0fd2('0x3a')]);_0x241914[_0x0fd2('0x3f')]=_['intersection'](_0x64e087[_0x0fd2('0x3e')],qs[_0x0fd2('0x40')](_0x51b80a[_0x0fd2('0x3a')]['fields']));_0x241914['attributes']=_0x241914[_0x0fd2('0x3f')][_0x0fd2('0x4f')]?_0x241914[_0x0fd2('0x3f')]:_0x64e087[_0x0fd2('0x3e')];_0x241914['order']=qs[_0x0fd2('0x43')](_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x43')]);_0x241914[_0x0fd2('0x44')]=qs[_0x0fd2('0x3c')](_['pick'](_0x51b80a['query'],_0x64e087[_0x0fd2('0x3c')]));if(_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x2c')]){_0x241914[_0x0fd2('0x44')]=_['merge'](_0x241914[_0x0fd2('0x44')],{'$or':_[_0x0fd2('0x2e')](_0x241914[_0x0fd2('0x3f')],function(_0x2c7824){var _0x1ec0da={};_0x1ec0da[_0x2c7824]={'$like':'%'+_0x51b80a['query']['filter']+'%'};return _0x1ec0da;})});}_0x241914=_[_0x0fd2('0x59')]({},_0x241914,_0x51b80a[_0x0fd2('0x47')]);return _0x35479a[_0x0fd2('0xb8')](_0x241914);}})[_0x0fd2('0x26')](function(_0x5a3e6d){if(_0x5a3e6d){_0x81b4bb=_0x5a3e6d[_0x0fd2('0x4f')];if(!_0x51b80a['query']['hasOwnProperty'](_0x0fd2('0x60'))){_0x241914[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x1e')]);_0x241914['offset']=qs[_0x0fd2('0x1d')](_0x51b80a[_0x0fd2('0x3a')][_0x0fd2('0x1d')]);}return _0x35479a[_0x0fd2('0xb8')](_0x241914);}})['then'](function(_0x4567ad){if(_0x4567ad){return _0x4567ad?{'count':_0x81b4bb,'rows':_0x4567ad}:null;}})[_0x0fd2('0x26')](respondWithResult(_0x54585d,null))[_0x0fd2('0x4c')](handleError(_0x54585d,null));};exports[_0x0fd2('0xb9')]=function(_0x30ef90,_0x6ea2c8,_0x17a770){var _0x34b662,_0x14df62;return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x30ef90[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x6ea2c8,null))[_0x0fd2('0x26')](function(_0x3c0c6c){if(_0x3c0c6c){_0x14df62=_0x3c0c6c;return _0x3c0c6c[_0x0fd2('0xb9')](_0x30ef90[_0x0fd2('0x51')]['ids'],_[_0x0fd2('0x8f')](_0x30ef90[_0x0fd2('0x51')],[_0x0fd2('0x90'),'id'])||{});}return null;})[_0x0fd2('0x91')](function(_0x1da9f3){var _0x50e7ba;_0x34b662=_0x1da9f3||[];var _0x1739c7=[];if(_0x1da9f3){for(var _0x59618c=0x0;_0x59618c<_0x1da9f3[_0x0fd2('0x4f')];_0x59618c+=0x1){var _0x18ec77=_0x1da9f3[_0x59618c][_0x0fd2('0x27')]({'plain':!![]});_0x50e7ba=squel[_0x0fd2('0x9c')]()[_0x0fd2('0xab')](_0x0fd2('0xba'))[_0x0fd2('0x9e')]([_0x0fd2('0x9f'),_0x0fd2('0xa2'),_0x0fd2('0xa0'),'VoiceQueueId',_0x0fd2('0x5a'),_0x0fd2('0x5b')],squel['select']()[_0x0fd2('0x7c')](_0x0fd2('0x9f'),_0x0fd2('0x9f'))[_0x0fd2('0x7c')]('id',_0x0fd2('0xa2'))[_0x0fd2('0x7c')](_0x18ec77[_0x0fd2('0xa6')][_0x0fd2('0x84')](),'ListId')[_0x0fd2('0x7c')](_0x30ef90['params']['id'][_0x0fd2('0x84')](),_0x0fd2('0x61'))[_0x0fd2('0x7c')](_0x0fd2('0xbb'),_0x0fd2('0x5a'))[_0x0fd2('0x7c')](_0x0fd2('0xbb'),_0x0fd2('0x5b'))[_0x0fd2('0x7d')](_0x0fd2('0xa3'))[_0x0fd2('0x44')](_0x0fd2('0xa4'))[_0x0fd2('0x44')](_0x0fd2('0xa5'),_0x18ec77[_0x0fd2('0xa6')][_0x0fd2('0x84')]())[_0x0fd2('0x44')](_0x0fd2('0xac')))['toString']();_0x1739c7['push'](db[_0x0fd2('0x6f')][_0x0fd2('0x3a')](_0x50e7ba));}return BPromise[_0x0fd2('0xb5')](_0x1739c7);}})[_0x0fd2('0x26')](function(){return _0x34b662;})[_0x0fd2('0x26')](respondWithResult(_0x6ea2c8,null))[_0x0fd2('0x4c')](handleError(_0x6ea2c8,null));};exports[_0x0fd2('0xbc')]=function(_0x2085ad,_0x44db9a,_0x5134d9){return db['VoiceQueue'][_0x0fd2('0x31')]({'where':{'id':_0x2085ad[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](handleEntityNotFound(_0x44db9a,null))[_0x0fd2('0x26')](function(_0x5af168){if(_0x5af168){return _0x5af168[_0x0fd2('0xbc')](_0x2085ad['query'][_0x0fd2('0x90')]);}})[_0x0fd2('0x26')](function(_0x30e702){if(_0x30e702){return db[_0x0fd2('0x66')][_0x0fd2('0x34')]({'where':{'ListId':_0x2085ad['query'][_0x0fd2('0x90')],'VoiceQueueId':_0x2085ad[_0x0fd2('0x4e')]['id']}})[_0x0fd2('0x26')](function(){return _0x30e702;});}})[_0x0fd2('0x26')](respondWithStatusCode(_0x44db9a,null))['catch'](handleError(_0x44db9a,null));}; \ No newline at end of file +var _0x1561=['voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueueRt','userVoiceQueue:save','removeTeams','ids','User','field','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','omit','spread','isNil','isArray','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','find','type','name','sendStatus','error','stack','send','index','VoiceQueue','fieldName','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','fields','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','createdAt','updatedAt','UserProfileResource','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','Team','getTeams','Agents','online'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1561,0x1bd));var _0x1156=function(_0x4285c6,_0x24b981){_0x4285c6=_0x4285c6-0x0;var _0x1b485e=_0x1561[_0x4285c6];return _0x1b485e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1156('0x0'));var jsonpatch=require(_0x1156('0x1'));var rp=require(_0x1156('0x2'));var moment=require(_0x1156('0x3'));var BPromise=require(_0x1156('0x4'));var Mustache=require('mustache');var util=require(_0x1156('0x5'));var path=require(_0x1156('0x6'));var sox=require(_0x1156('0x7'));var csv=require(_0x1156('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1156('0x9'));var _=require('lodash');var squel=require(_0x1156('0xa'));var crypto=require(_0x1156('0xb'));var jsforce=require(_0x1156('0xc'));var deskjs=require(_0x1156('0xd'));var toCsv=require(_0x1156('0x8'));var querystring=require('querystring');var Papa=require(_0x1156('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1156('0xf'));var as=require(_0x1156('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1156('0x11'))('api');var utils=require(_0x1156('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1156('0x13'));var db=require(_0x1156('0x14'))['db'];config['redis']=_['defaults'](config[_0x1156('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x1156('0x16'))(new Redis(config[_0x1156('0x15')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x3a7c28,_0xf521c2){_0xf521c2=_0xf521c2||0xcc;return function(_0x9673ef){if(_0x9673ef){return _0x3a7c28['sendStatus'](_0xf521c2);}return _0x3a7c28['status'](_0xf521c2)[_0x1156('0x17')]();};}function respondWithResult(_0x236d32,_0x3c244d){_0x3c244d=_0x3c244d||0xc8;return function(_0x399417){if(_0x399417){return _0x236d32[_0x1156('0x18')](_0x3c244d)[_0x1156('0x19')](_0x399417);}};}function respondWithFilteredResult(_0x2c1ff5,_0x6dd20){return function(_0x2d820d){if(_0x2d820d){var _0x211e6b=typeof _0x6dd20[_0x1156('0x1a')]==='undefined'&&typeof _0x6dd20[_0x1156('0x1b')]===_0x1156('0x1c');var _0x40eab4=_0x2d820d['count'];var _0x30353b=_0x211e6b?0x0:_0x6dd20[_0x1156('0x1a')];var _0x33f611=_0x211e6b?_0x2d820d[_0x1156('0x1d')]:_0x6dd20[_0x1156('0x1a')]+_0x6dd20[_0x1156('0x1b')];var _0x3633ef;if(_0x33f611>=_0x40eab4){_0x33f611=_0x40eab4;_0x3633ef=0xc8;}else{_0x3633ef=0xce;}_0x2c1ff5[_0x1156('0x18')](_0x3633ef);return _0x2c1ff5['set'](_0x1156('0x1e'),_0x30353b+'-'+_0x33f611+'/'+_0x40eab4)['json'](_0x2d820d);}return null;};}function patchUpdates(_0x40f190){return function(_0x271515){try{jsonpatch[_0x1156('0x1f')](_0x271515,_0x40f190,!![]);}catch(_0x4a1abe){return BPromise[_0x1156('0x20')](_0x4a1abe);}return _0x271515[_0x1156('0x21')]();};}function saveUpdates(_0x28caf5,_0x2946b5){return function(_0xdcc9dd){if(_0xdcc9dd){return _0xdcc9dd[_0x1156('0x22')](_0x28caf5)['then'](function(_0xa5ffd7){return _0xa5ffd7;});}return null;};}function removeEntity(_0x4599c8,_0x204acc){return function(_0x178383){if(_0x178383){return _0x178383[_0x1156('0x23')]()[_0x1156('0x24')](function(){var _0x1b66f9=_0x178383[_0x1156('0x25')]({'plain':!![]});var _0x195aef=[{'name':_0x1156('0x26'),'value':_0x1156('0x27'),'ignore':![]},{'name':_0x1156('0x28'),'value':_0x1156('0x29'),'ignore':![]}];var _0x17bf39=_(_0x195aef)['filter'](_0x1156('0x2a'))[_0x1156('0x2b')]('value')[_0x1156('0x2c')]();if(_[_0x1156('0x2d')](_0x17bf39,_0x1b66f9['type'])){return;}var _0x18f912=_[_0x1156('0x2e')](_0x195aef,['value',_0x1b66f9[_0x1156('0x2f')]])[_0x1156('0x30')];return db['UserProfileResource'][_0x1156('0x23')]({'where':{'type':_0x18f912,'resourceId':_0x1b66f9['id']}})[_0x1156('0x24')](function(){return _0x178383;});})['then'](function(){_0x4599c8[_0x1156('0x18')](0xcc)[_0x1156('0x17')]();});}};}function handleEntityNotFound(_0x521ff7,_0x321179){return function(_0x275eb6){if(!_0x275eb6){_0x521ff7[_0x1156('0x31')](0x194);}return _0x275eb6;};}function handleError(_0x1d964d,_0x56269e){_0x56269e=_0x56269e||0x1f4;return function(_0x54b89e){logger[_0x1156('0x32')](_0x54b89e[_0x1156('0x33')]);if(_0x54b89e[_0x1156('0x30')]){delete _0x54b89e[_0x1156('0x30')];}_0x1d964d[_0x1156('0x18')](_0x56269e)[_0x1156('0x34')](_0x54b89e);};}exports[_0x1156('0x35')]=function(_0x8a5098,_0x38ab3d){var _0x48d52d={},_0x592ae3={},_0x1d1c44={'count':0x0,'rows':[]};var _0x48a527=_[_0x1156('0x2b')](db[_0x1156('0x36')]['rawAttributes'],function(_0x3a70bb){return{'name':_0x3a70bb[_0x1156('0x37')],'type':_0x3a70bb[_0x1156('0x2f')][_0x1156('0x38')]};});_0x592ae3['model']=_[_0x1156('0x2b')](_0x48a527,_0x1156('0x30'));_0x592ae3['query']=_[_0x1156('0x39')](_0x8a5098[_0x1156('0x3a')]);_0x592ae3[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x592ae3['model'],_0x592ae3[_0x1156('0x3a')]);_0x48d52d['attributes']=_['intersection'](_0x592ae3[_0x1156('0x3d')],qs['fields'](_0x8a5098[_0x1156('0x3a')]['fields']));_0x48d52d['attributes']=_0x48d52d[_0x1156('0x3e')][_0x1156('0x3f')]?_0x48d52d[_0x1156('0x3e')]:_0x592ae3[_0x1156('0x3d')];if(!_0x8a5098[_0x1156('0x3a')][_0x1156('0x40')](_0x1156('0x41'))){_0x48d52d['limit']=qs[_0x1156('0x1b')](_0x8a5098['query'][_0x1156('0x1b')]);_0x48d52d['offset']=qs['offset'](_0x8a5098[_0x1156('0x3a')][_0x1156('0x1a')]);}_0x48d52d[_0x1156('0x42')]=qs[_0x1156('0x43')](_0x8a5098[_0x1156('0x3a')][_0x1156('0x43')]);_0x48d52d['where']=qs[_0x1156('0x3b')](_[_0x1156('0x44')](_0x8a5098[_0x1156('0x3a')],_0x592ae3[_0x1156('0x3b')]),_0x48a527);if(_0x8a5098[_0x1156('0x3a')][_0x1156('0x45')]){_0x48d52d[_0x1156('0x46')]=_['merge'](_0x48d52d['where'],{'$or':_['map'](_0x48a527,function(_0x4e1d11){if(_0x4e1d11[_0x1156('0x2f')]!==_0x1156('0x47')){var _0x4c26d1={};_0x4c26d1[_0x4e1d11['name']]={'$like':'%'+_0x8a5098['query']['filter']+'%'};return _0x4c26d1;}})});}_0x48d52d=_['merge']({},_0x48d52d,_0x8a5098[_0x1156('0x48')]);var _0x3cbeb5={'where':_0x48d52d[_0x1156('0x46')]};return db['VoiceQueue'][_0x1156('0x1d')](_0x3cbeb5)['then'](function(_0x4ed9eb){_0x1d1c44[_0x1156('0x1d')]=_0x4ed9eb;if(_0x8a5098[_0x1156('0x3a')][_0x1156('0x49')]){_0x48d52d[_0x1156('0x4a')]=[{'all':!![]}];}return db[_0x1156('0x36')][_0x1156('0x4b')](_0x48d52d);})[_0x1156('0x24')](function(_0x433616){_0x1d1c44['rows']=_0x433616;return _0x1d1c44;})[_0x1156('0x24')](respondWithFilteredResult(_0x38ab3d,_0x48d52d))[_0x1156('0x4c')](handleError(_0x38ab3d,null));};exports['show']=function(_0x230b29,_0x682e7b){var _0x58092e={'raw':![],'where':{'id':_0x230b29['params']['id']}},_0x3a65a6={};_0x3a65a6[_0x1156('0x3d')]=_['keys'](db['VoiceQueue'][_0x1156('0x4d')]);_0x3a65a6[_0x1156('0x3a')]=_[_0x1156('0x39')](_0x230b29[_0x1156('0x3a')]);_0x3a65a6[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x3a65a6['model'],_0x3a65a6[_0x1156('0x3a')]);_0x58092e['attributes']=_[_0x1156('0x3c')](_0x3a65a6[_0x1156('0x3d')],qs[_0x1156('0x4e')](_0x230b29[_0x1156('0x3a')][_0x1156('0x4e')]));_0x58092e[_0x1156('0x3e')]=_0x58092e[_0x1156('0x3e')][_0x1156('0x3f')]?_0x58092e[_0x1156('0x3e')]:_0x3a65a6['model'];if(_0x230b29[_0x1156('0x3a')][_0x1156('0x49')]){_0x58092e[_0x1156('0x4a')]=[{'all':!![]}];}_0x58092e=_[_0x1156('0x4f')]({},_0x58092e,_0x230b29['options']);return db[_0x1156('0x36')][_0x1156('0x2e')](_0x58092e)[_0x1156('0x24')](handleEntityNotFound(_0x682e7b,null))['then'](respondWithResult(_0x682e7b,null))[_0x1156('0x4c')](handleError(_0x682e7b,null));};exports[_0x1156('0x50')]=function(_0x2f2ec0,_0x27a486){return db[_0x1156('0x36')][_0x1156('0x50')](_0x2f2ec0['body'],{})[_0x1156('0x24')](function(_0x53e27b){var _0x524a23=_0x2f2ec0[_0x1156('0x51')][_0x1156('0x25')]({'plain':!![]});if(!_0x524a23)throw new Error(_0x1156('0x52'));if(_0x524a23[_0x1156('0x53')]===_0x1156('0x51')){var _0x5c13af=_0x53e27b['get']({'plain':!![]});var _0x3aa601=[{'name':_0x1156('0x26'),'value':'inbound'},{'name':_0x1156('0x28'),'value':_0x1156('0x29')}];var _0x1762fb=_[_0x1156('0x2e')](_0x3aa601,[_0x1156('0x2c'),_0x5c13af[_0x1156('0x2f')]])['name'];return db[_0x1156('0x54')][_0x1156('0x2e')]({'where':{'name':_0x1762fb,'userProfileId':_0x524a23[_0x1156('0x55')]},'raw':!![]})[_0x1156('0x24')](function(_0x59de0d){if(_0x59de0d&&_0x59de0d[_0x1156('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c13af['name'],'resourceId':_0x5c13af['id'],'type':_0x59de0d[_0x1156('0x30')],'sectionId':_0x59de0d['id']},{})[_0x1156('0x24')](function(){return _0x53e27b;});}else{return _0x53e27b;}})[_0x1156('0x4c')](function(_0x142b9d){logger[_0x1156('0x32')](_0x1156('0x57'),_0x142b9d);throw _0x142b9d;});}return _0x53e27b;})[_0x1156('0x24')](respondWithResult(_0x27a486,0xc9))['catch'](handleError(_0x27a486,null));};exports['clone']=function(_0x5a9905,_0x2b25a2){var _0x221104={'where':{'id':_0x5a9905[_0x1156('0x58')]['id']}},_0x2b27da={};_0x2b27da[_0x1156('0x3d')]=_[_0x1156('0x39')](db[_0x1156('0x36')]['rawAttributes']);_0x221104[_0x1156('0x3e')]=_[_0x1156('0x3c')](_0x2b27da['model'],qs[_0x1156('0x4e')](_0x5a9905['query'][_0x1156('0x4e')]));_0x221104[_0x1156('0x3e')]=_0x221104[_0x1156('0x3e')][_0x1156('0x3f')]?_0x221104['attributes']:_0x2b27da[_0x1156('0x3d')];if(_0x5a9905['query']['includeAll']){_0x221104['include']=[{'all':!![]}];}_0x221104=_['merge']({},_0x221104,_0x5a9905[_0x1156('0x48')]);return db['VoiceQueue'][_0x1156('0x2e')](_0x221104)[_0x1156('0x24')](handleEntityNotFound(_0x2b25a2,null))[_0x1156('0x24')](function(_0x406ba1){if(_0x406ba1){var _0x13f401=_0x406ba1['get']({'plain':!![]});_0x13f401=qs['omit'](_0x13f401,['id','createdAt','updatedAt']);_0x5a9905[_0x1156('0x59')]=_['omit'](_0x5a9905[_0x1156('0x59')],['id',_0x1156('0x5a'),_0x1156('0x5b')]);return db[_0x1156('0x36')][_0x1156('0x50')](_[_0x1156('0x4f')](_0x13f401,_0x5a9905[_0x1156('0x59')]),{'include':_0x5a9905[_0x1156('0x3a')][_0x1156('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x99c5c5){var _0x179e95=_0x5a9905[_0x1156('0x51')][_0x1156('0x25')]({'plain':!![]});if(!_0x179e95)throw new Error(_0x1156('0x52'));if(_0x179e95[_0x1156('0x53')]===_0x1156('0x51')){var _0x369ce8=_0x99c5c5['get']({'plain':!![]});var _0x5f0709=[{'name':_0x1156('0x26'),'value':_0x1156('0x27')},{'name':_0x1156('0x28'),'value':_0x1156('0x29')}];var _0x32c7fd=_[_0x1156('0x2e')](_0x5f0709,[_0x1156('0x2c'),_0x369ce8[_0x1156('0x2f')]])[_0x1156('0x30')];return db['UserProfileSection'][_0x1156('0x2e')]({'where':{'name':_0x32c7fd,'userProfileId':_0x179e95[_0x1156('0x55')]},'raw':!![]})[_0x1156('0x24')](function(_0x4a5773){if(_0x4a5773&&_0x4a5773[_0x1156('0x56')]===0x0){return db[_0x1156('0x5c')][_0x1156('0x50')]({'name':_0x369ce8[_0x1156('0x30')],'resourceId':_0x369ce8['id'],'type':_0x4a5773[_0x1156('0x30')],'sectionId':_0x4a5773['id']},{})[_0x1156('0x24')](function(){return _0x99c5c5;});}else{return _0x99c5c5;}})[_0x1156('0x4c')](function(_0x286c94){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286c94);throw _0x286c94;});}return _0x99c5c5;});}})['then'](respondWithResult(_0x2b25a2,0xc9))[_0x1156('0x4c')](handleError(_0x2b25a2,null));};exports[_0x1156('0x22')]=function(_0x19439e,_0x564924){if(_0x19439e['body']['id']){delete _0x19439e[_0x1156('0x59')]['id'];}return db[_0x1156('0x36')]['find']({'where':{'id':_0x19439e[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x564924,null))[_0x1156('0x24')](saveUpdates(_0x19439e['body'],null))[_0x1156('0x24')](respondWithResult(_0x564924,null))['catch'](handleError(_0x564924,null));};exports[_0x1156('0x23')]=function(_0x2783b6,_0x3ea68b){return db[_0x1156('0x36')][_0x1156('0x2e')]({'where':{'id':_0x2783b6[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x3ea68b,null))[_0x1156('0x24')](removeEntity(_0x3ea68b,null))[_0x1156('0x4c')](handleError(_0x3ea68b,null));};exports[_0x1156('0x5d')]=function(_0x3aa8c7,_0x4dfc51,_0x21dc9e){var _0x4d75f5={'raw':![],'where':{}};var _0x124121={};var _0x6bb664={'count':0x0,'rows':[]};return db[_0x1156('0x36')][_0x1156('0x5e')]({'where':{'id':_0x3aa8c7[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x4dfc51,null))[_0x1156('0x24')](function(_0x2aec95){if(_0x2aec95){_0x124121[_0x1156('0x3d')]=_[_0x1156('0x39')](db[_0x1156('0x5f')][_0x1156('0x4d')]);_0x124121[_0x1156('0x3a')]=_['keys'](_0x3aa8c7[_0x1156('0x3a')]);_0x124121['filters']=_[_0x1156('0x3c')](_0x124121['model'],_0x124121[_0x1156('0x3a')]);_0x4d75f5[_0x1156('0x3e')]=_['intersection'](_0x124121['model'],qs[_0x1156('0x4e')](_0x3aa8c7[_0x1156('0x3a')][_0x1156('0x4e')]));_0x4d75f5[_0x1156('0x3e')]=_0x4d75f5[_0x1156('0x3e')][_0x1156('0x3f')]?_0x4d75f5[_0x1156('0x3e')]:_0x124121['model'];if(!_0x3aa8c7[_0x1156('0x3a')][_0x1156('0x40')](_0x1156('0x41'))){_0x4d75f5['limit']=qs[_0x1156('0x1b')](_0x3aa8c7[_0x1156('0x3a')][_0x1156('0x1b')]);_0x4d75f5[_0x1156('0x1a')]=qs[_0x1156('0x1a')](_0x3aa8c7[_0x1156('0x3a')]['offset']);}_0x4d75f5['order']=qs['sort'](_0x3aa8c7['query'][_0x1156('0x43')]);_0x4d75f5[_0x1156('0x46')]=qs[_0x1156('0x3b')](_[_0x1156('0x44')](_0x3aa8c7[_0x1156('0x3a')],_0x124121[_0x1156('0x3b')]));_0x4d75f5['where'][_0x1156('0x60')]=_0x2aec95['id'];if(_0x3aa8c7['query'][_0x1156('0x45')]){_0x4d75f5[_0x1156('0x46')]=_[_0x1156('0x4f')](_0x4d75f5[_0x1156('0x46')],{'$or':_[_0x1156('0x2b')](_0x4d75f5[_0x1156('0x3e')],function(_0x54d624){var _0x51391c={};_0x51391c[_0x54d624]={'$like':'%'+_0x3aa8c7[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x51391c;})});}_0x4d75f5=_[_0x1156('0x4f')]({},_0x4d75f5,_0x3aa8c7[_0x1156('0x48')]);return db[_0x1156('0x5f')][_0x1156('0x1d')]({'where':_0x4d75f5[_0x1156('0x46')]})['then'](function(_0x3b63b5){_0x6bb664['count']=_0x3b63b5;if(_0x3aa8c7['query'][_0x1156('0x49')]){_0x4d75f5[_0x1156('0x4a')]=[{'all':!![]}];}return db[_0x1156('0x5f')]['findAll'](_0x4d75f5);})[_0x1156('0x24')](function(_0x4a75bd){_0x6bb664[_0x1156('0x61')]=_0x4a75bd;return _0x6bb664;});}})[_0x1156('0x24')](respondWithFilteredResult(_0x4dfc51,_0x4d75f5))[_0x1156('0x4c')](handleError(_0x4dfc51,null));};exports[_0x1156('0x62')]=function(_0x3a13af,_0x5cbabb,_0x372408){var _0x873718={'raw':!![],'where':{}};var _0x11fada={};var _0x4c7818={'count':0x0,'rows':[]};return db[_0x1156('0x36')][_0x1156('0x5e')]({'where':{'id':_0x3a13af[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x5cbabb,null))[_0x1156('0x24')](function(_0x3f57da){if(_0x3f57da){_0x11fada[_0x1156('0x3d')]=_[_0x1156('0x39')](db[_0x1156('0x63')][_0x1156('0x4d')]);_0x11fada[_0x1156('0x3a')]=_[_0x1156('0x39')](_0x3a13af[_0x1156('0x3a')]);_0x11fada[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x11fada[_0x1156('0x3d')],_0x11fada['query']);_0x873718['attributes']=_[_0x1156('0x3c')](_0x11fada[_0x1156('0x3d')],qs[_0x1156('0x4e')](_0x3a13af[_0x1156('0x3a')]['fields']));_0x873718['attributes']=_0x873718[_0x1156('0x3e')][_0x1156('0x3f')]?_0x873718[_0x1156('0x3e')]:_0x11fada['model'];if(!_0x3a13af[_0x1156('0x3a')][_0x1156('0x40')]('nolimit')){_0x873718[_0x1156('0x1b')]=qs[_0x1156('0x1b')](_0x3a13af['query']['limit']);_0x873718[_0x1156('0x1a')]=qs['offset'](_0x3a13af[_0x1156('0x3a')][_0x1156('0x1a')]);}_0x873718[_0x1156('0x42')]=qs['sort'](_0x3a13af[_0x1156('0x3a')][_0x1156('0x43')]);_0x873718['where']=qs[_0x1156('0x3b')](_['pick'](_0x3a13af[_0x1156('0x3a')],_0x11fada['filters']));_0x873718['where'][_0x1156('0x60')]=_0x3f57da['id'];if(_0x3a13af['query'][_0x1156('0x45')]){_0x873718[_0x1156('0x46')]=_[_0x1156('0x4f')](_0x873718['where'],{'$or':_['map'](_0x873718[_0x1156('0x3e')],function(_0x1b69f8){var _0x47a51d={};_0x47a51d[_0x1b69f8]={'$like':'%'+_0x3a13af[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x47a51d;})});}_0x873718=_[_0x1156('0x4f')]({},_0x873718,_0x3a13af['options']);return db[_0x1156('0x63')][_0x1156('0x1d')]({'where':_0x873718['where']})[_0x1156('0x24')](function(_0x2f1b2b){_0x4c7818[_0x1156('0x1d')]=_0x2f1b2b;if(_0x3a13af['query']['includeAll']){_0x873718['include']=[{'all':!![]}];}return db[_0x1156('0x63')][_0x1156('0x4b')](_0x873718);})[_0x1156('0x24')](function(_0x183e80){_0x4c7818[_0x1156('0x61')]=_0x183e80;return _0x4c7818;});}})[_0x1156('0x24')](respondWithFilteredResult(_0x5cbabb,_0x873718))['catch'](handleError(_0x5cbabb,null));};exports[_0x1156('0x64')]=function(_0x233c36,_0x101eea,_0x44f47c){var _0x12a39c={'raw':!![],'where':{}};var _0x41ec41={};var _0x205d10={'count':0x0,'rows':[]};return db[_0x1156('0x36')]['findOne']({'where':{'id':_0x233c36[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x101eea,null))[_0x1156('0x24')](function(_0x157fb4){if(_0x157fb4){_0x41ec41[_0x1156('0x3d')]=_[_0x1156('0x39')](db[_0x1156('0x65')][_0x1156('0x4d')]);_0x41ec41['query']=_['keys'](_0x233c36['query']);_0x41ec41[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x41ec41[_0x1156('0x3d')],_0x41ec41[_0x1156('0x3a')]);_0x12a39c['attributes']=_[_0x1156('0x3c')](_0x41ec41['model'],qs[_0x1156('0x4e')](_0x233c36['query'][_0x1156('0x4e')]));_0x12a39c[_0x1156('0x3e')]=_0x12a39c[_0x1156('0x3e')]['length']?_0x12a39c[_0x1156('0x3e')]:_0x41ec41[_0x1156('0x3d')];if(!_0x233c36['query'][_0x1156('0x40')](_0x1156('0x41'))){_0x12a39c['limit']=qs[_0x1156('0x1b')](_0x233c36['query']['limit']);_0x12a39c[_0x1156('0x1a')]=qs[_0x1156('0x1a')](_0x233c36[_0x1156('0x3a')][_0x1156('0x1a')]);}_0x12a39c[_0x1156('0x42')]=qs[_0x1156('0x43')](_0x233c36[_0x1156('0x3a')][_0x1156('0x43')]);_0x12a39c[_0x1156('0x46')]=qs[_0x1156('0x3b')](_['pick'](_0x233c36[_0x1156('0x3a')],_0x41ec41['filters']));_0x12a39c[_0x1156('0x46')][_0x1156('0x60')]=_0x157fb4['id'];if(_0x233c36[_0x1156('0x3a')][_0x1156('0x45')]){_0x12a39c[_0x1156('0x46')]=_[_0x1156('0x4f')](_0x12a39c['where'],{'$or':_[_0x1156('0x2b')](_0x12a39c[_0x1156('0x3e')],function(_0x48b1d0){var _0x4ca339={};_0x4ca339[_0x48b1d0]={'$like':'%'+_0x233c36[_0x1156('0x3a')]['filter']+'%'};return _0x4ca339;})});}_0x12a39c=_['merge']({},_0x12a39c,_0x233c36['options']);return db[_0x1156('0x65')][_0x1156('0x1d')]({'where':_0x12a39c[_0x1156('0x46')]})['then'](function(_0x3384eb){_0x205d10['count']=_0x3384eb;if(_0x233c36[_0x1156('0x3a')][_0x1156('0x49')]){_0x12a39c[_0x1156('0x4a')]=[{'all':!![]}];}return db[_0x1156('0x65')][_0x1156('0x4b')](_0x12a39c);})['then'](function(_0x7d904d){_0x205d10['rows']=_0x7d904d;return _0x205d10;});}})[_0x1156('0x24')](respondWithFilteredResult(_0x101eea,_0x12a39c))[_0x1156('0x4c')](handleError(_0x101eea,null));};exports['getHopperBlacks']=function(_0x5321ed,_0x390f4e,_0x5d6452){var _0x31402b={'raw':!![],'where':{}};var _0x58bb03={};var _0x220044={'count':0x0,'rows':[]};return db[_0x1156('0x36')][_0x1156('0x5e')]({'where':{'id':_0x5321ed[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x390f4e,null))[_0x1156('0x24')](function(_0x2dd6ab){if(_0x2dd6ab){_0x58bb03['model']=_[_0x1156('0x39')](db[_0x1156('0x66')]['rawAttributes']);_0x58bb03[_0x1156('0x3a')]=_[_0x1156('0x39')](_0x5321ed[_0x1156('0x3a')]);_0x58bb03[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x58bb03[_0x1156('0x3d')],_0x58bb03[_0x1156('0x3a')]);_0x31402b['attributes']=_[_0x1156('0x3c')](_0x58bb03[_0x1156('0x3d')],qs[_0x1156('0x4e')](_0x5321ed[_0x1156('0x3a')][_0x1156('0x4e')]));_0x31402b[_0x1156('0x3e')]=_0x31402b[_0x1156('0x3e')][_0x1156('0x3f')]?_0x31402b['attributes']:_0x58bb03[_0x1156('0x3d')];if(!_0x5321ed[_0x1156('0x3a')][_0x1156('0x40')](_0x1156('0x41'))){_0x31402b['limit']=qs[_0x1156('0x1b')](_0x5321ed[_0x1156('0x3a')][_0x1156('0x1b')]);_0x31402b[_0x1156('0x1a')]=qs[_0x1156('0x1a')](_0x5321ed[_0x1156('0x3a')][_0x1156('0x1a')]);}_0x31402b[_0x1156('0x42')]=qs['sort'](_0x5321ed[_0x1156('0x3a')][_0x1156('0x43')]);_0x31402b[_0x1156('0x46')]=qs[_0x1156('0x3b')](_[_0x1156('0x44')](_0x5321ed['query'],_0x58bb03[_0x1156('0x3b')]));_0x31402b[_0x1156('0x46')][_0x1156('0x60')]=_0x2dd6ab['id'];if(_0x5321ed[_0x1156('0x3a')]['filter']){_0x31402b[_0x1156('0x46')]=_['merge'](_0x31402b[_0x1156('0x46')],{'$or':_[_0x1156('0x2b')](_0x31402b['attributes'],function(_0x391469){var _0x32a860={};_0x32a860[_0x391469]={'$like':'%'+_0x5321ed[_0x1156('0x3a')]['filter']+'%'};return _0x32a860;})});}_0x31402b=_['merge']({},_0x31402b,_0x5321ed[_0x1156('0x48')]);return db[_0x1156('0x66')][_0x1156('0x1d')]({'where':_0x31402b['where']})[_0x1156('0x24')](function(_0x30f34d){_0x220044[_0x1156('0x1d')]=_0x30f34d;if(_0x5321ed[_0x1156('0x3a')][_0x1156('0x49')]){_0x31402b[_0x1156('0x4a')]=[{'all':!![]}];}return db[_0x1156('0x66')][_0x1156('0x4b')](_0x31402b);})[_0x1156('0x24')](function(_0x535191){_0x220044[_0x1156('0x61')]=_0x535191;return _0x220044;});}})[_0x1156('0x24')](respondWithFilteredResult(_0x390f4e,_0x31402b))[_0x1156('0x4c')](handleError(_0x390f4e,null));};exports['getTeams']=function(_0x475da9,_0x412edf,_0x5f295a){var _0x11f3f2={};var _0x528877={};var _0x2f73a9;var _0x437fcf;return db[_0x1156('0x36')][_0x1156('0x5e')]({'where':{'id':_0x475da9[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x412edf,null))['then'](function(_0x246a9e){if(_0x246a9e){_0x2f73a9=_0x246a9e;_0x528877[_0x1156('0x3d')]=_['keys'](db[_0x1156('0x67')][_0x1156('0x4d')]);_0x528877['query']=_[_0x1156('0x39')](_0x475da9[_0x1156('0x3a')]);_0x528877[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x528877[_0x1156('0x3d')],_0x528877['query']);_0x11f3f2[_0x1156('0x3e')]=_[_0x1156('0x3c')](_0x528877[_0x1156('0x3d')],qs['fields'](_0x475da9['query'][_0x1156('0x4e')]));_0x11f3f2[_0x1156('0x3e')]=_0x11f3f2[_0x1156('0x3e')][_0x1156('0x3f')]?_0x11f3f2[_0x1156('0x3e')]:_0x528877[_0x1156('0x3d')];_0x11f3f2[_0x1156('0x42')]=qs['sort'](_0x475da9['query'][_0x1156('0x43')]);_0x11f3f2[_0x1156('0x46')]=qs['filters'](_[_0x1156('0x44')](_0x475da9[_0x1156('0x3a')],_0x528877['filters']));if(_0x475da9[_0x1156('0x3a')]['filter']){_0x11f3f2[_0x1156('0x46')]=_[_0x1156('0x4f')](_0x11f3f2[_0x1156('0x46')],{'$or':_['map'](_0x11f3f2['attributes'],function(_0x563704){var _0x2d48fb={};_0x2d48fb[_0x563704]={'$like':'%'+_0x475da9[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x2d48fb;})});}_0x11f3f2=_[_0x1156('0x4f')]({},_0x11f3f2,_0x475da9[_0x1156('0x48')]);return _0x2f73a9[_0x1156('0x68')](_0x11f3f2);}})[_0x1156('0x24')](function(_0xf7ccd5){if(_0xf7ccd5){_0x437fcf=_0xf7ccd5['length'];if(!_0x475da9[_0x1156('0x3a')][_0x1156('0x40')]('nolimit')){_0x11f3f2[_0x1156('0x1b')]=qs[_0x1156('0x1b')](_0x475da9[_0x1156('0x3a')][_0x1156('0x1b')]);_0x11f3f2['offset']=qs[_0x1156('0x1a')](_0x475da9['query'][_0x1156('0x1a')]);}return _0x2f73a9[_0x1156('0x68')](_0x11f3f2);}})[_0x1156('0x24')](function(_0x1d91c1){if(_0x1d91c1){return _0x1d91c1?{'count':_0x437fcf,'rows':_0x1d91c1}:null;}})[_0x1156('0x24')](respondWithResult(_0x412edf,null))['catch'](handleError(_0x412edf,null));};exports['addTeams']=function(_0xdbab78,_0x1afae8,_0x365aaa){var _0x4856b8=_0xdbab78['body']['teams'];var _0x2bdead=_[_0x1156('0x2b')](_0x4856b8,'id');return db[_0x1156('0x67')][_0x1156('0x4b')]({'where':{'id':_0x2bdead},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1156('0x69'),'attributes':['id',_0x1156('0x30'),_0x1156('0x6a'),_0x1156('0x6b'),_0x1156('0x6c')],'raw':!![]}]})['then'](function(_0x519a3e){if(_0x519a3e){var _0x38b93a=_[_0x1156('0x6d')](_0x519a3e,function(_0x31617a){var _0x10a3a2=_0x31617a[_0x1156('0x25')]({'plain':!![]});_0x10a3a2[_0x1156('0x69')][_0x1156('0x6e')](function(_0x29b67e){_0x29b67e[_0x1156('0x6f')]=_[_0x1156('0x2e')](_0x4856b8,{'id':_0x10a3a2['id']})[_0x1156('0x6f')];});return _0x10a3a2[_0x1156('0x69')];});return db[_0x1156('0x36')][_0x1156('0x2e')]({'where':{'id':_0xdbab78[_0x1156('0x58')]['id']}})[_0x1156('0x24')](function(_0x28cf4b){return db[_0x1156('0x70')][_0x1156('0x71')](function(_0x22c365){return _0x28cf4b['addTeams'](_0x2bdead,{'transaction':_0x22c365})[_0x1156('0x24')](function(){return BPromise[_0x1156('0x72')](_0x4856b8,function(_0x3c8fb2){return db['TeamVoiceQueue'][_0x1156('0x73')]({'TeamId':_0x3c8fb2['id'],'VoiceQueueId':_0xdbab78[_0x1156('0x58')]['id'],'penalty':_0x3c8fb2[_0x1156('0x6f')]},{'transaction':_0x22c365});});})[_0x1156('0x24')](function(){return BPromise[_0x1156('0x72')](_0x38b93a,function(_0x258aeb){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x258aeb['id'],'VoiceQueueId':_0xdbab78[_0x1156('0x58')]['id']},'defaults':{'penalty':_0x258aeb['penalty']},'transaction':_0x22c365});});})['then'](function(){return BPromise[_0x1156('0x72')](_[_0x1156('0x45')](_0x38b93a,{'online':!![]}),function(_0x433d14){return db[_0x1156('0x74')][_0x1156('0x73')]({'membername':_0x433d14[_0x1156('0x30')],'UserId':_0x433d14['id'],'queue_name':_0x28cf4b[_0x1156('0x30')],'VoiceQueueId':_0x28cf4b['id'],'interface':_['isNil'](_0x433d14['interface'])?util['format']('SIP/%s',_0x433d14[_0x1156('0x30')]):_0x433d14[_0x1156('0x6c')],'paused':_0x433d14[_0x1156('0x6b')]||![],'penalty':_0x433d14[_0x1156('0x6f')]},{'transaction':_0x22c365});});})['then'](function(){_0x38b93a['forEach'](function(_0x42a415){socket['emit'](_0x1156('0x75'),{'UserId':_0x42a415['id'],'VoiceQueueId':_0x28cf4b['id']});});});});});}})[_0x1156('0x24')](respondWithStatusCode(_0x1afae8,null))[_0x1156('0x4c')](handleError(_0x1afae8,null));};exports[_0x1156('0x76')]=function(_0x2247eb,_0x142631,_0x140cd2){return db[_0x1156('0x67')]['findAll']({'where':{'id':_0x2247eb['query'][_0x1156('0x77')]},'attributes':['id'],'include':[{'model':db[_0x1156('0x78')],'as':_0x1156('0x69'),'attributes':['id'],'raw':!![]}]})[_0x1156('0x24')](handleEntityNotFound(_0x142631,null))['then'](function(_0x2b788b){var _0xb70b22=_[_0x1156('0x2b')](_0x2b788b,'id');var _0x5d0fe4=[];var _0x1b794e=[];var _0xf622c9=squel['select']();_0xf622c9[_0x1156('0x79')]('tq.TeamId')['from'](_0x1156('0x7a'),'tq')['join'](_0x1156('0x7b'),'ut',_0x1156('0x7c'))[_0x1156('0x46')](_0x1156('0x7d'),_0x2247eb[_0x1156('0x58')]['id']);for(var _0x1c410d=0x0;_0x1c410d<_0x2b788b[_0x1156('0x3f')];_0x1c410d+=0x1){let _0x308136=_0x2b788b[_0x1c410d];for(var _0x13f7b2=0x0;_0x13f7b2<_0x308136[_0x1156('0x69')]['length'];_0x13f7b2+=0x1){let _0x82c881=_0x308136[_0x1156('0x69')][_0x13f7b2];var _0x18ba61=_0xf622c9[_0x1156('0x7e')]();_0x18ba61[_0x1156('0x46')](_0x1156('0x7f'),_0x82c881['id']);_0x1b794e[_0x1156('0x80')](db[_0x1156('0x70')]['query'](_0x18ba61[_0x1156('0x81')](),{'type':db[_0x1156('0x70')]['QueryTypes']['SELECT']})['then'](function(_0x189ca9){if(_0x189ca9[_0x1156('0x3f')]===0x1){return _0x82c881['id'];}else{var _0x31019d=_[_0x1156('0x82')](_['map'](_0x189ca9,_0x1156('0x83')),function(_0x175791){return _[_0x1156('0x2d')](_0xb70b22,_0x175791);});if(_0x31019d){return _0x82c881['id'];}}}));}}return BPromise[_0x1156('0x84')](_0x1b794e)[_0x1156('0x24')](function(_0x4756c1){_0x5d0fe4=_(_0x5d0fe4)['union'](_0x4756c1)['compact']()[_0x1156('0x2c')]();return db['VoiceQueue'][_0x1156('0x2e')]({'where':{'id':_0x2247eb[_0x1156('0x58')]['id']}})['then'](function(_0x2a678f){return db['sequelize'][_0x1156('0x71')](function(_0x4f9e6e){return _0x2a678f[_0x1156('0x76')](_0x2247eb[_0x1156('0x3a')][_0x1156('0x77')],{'transaction':_0x4f9e6e})['then'](function(){if(!_[_0x1156('0x85')](_0x5d0fe4)){return _0x2a678f[_0x1156('0x86')](_0x5d0fe4,{'transaction':_0x4f9e6e})[_0x1156('0x24')](function(){return db[_0x1156('0x74')]['destroy']({'where':{'VoiceQueueId':_0x2247eb[_0x1156('0x58')]['id'],'UserId':_0x5d0fe4},'transaction':_0x4f9e6e});});}})['then'](function(){_0x5d0fe4[_0x1156('0x6e')](function(_0x4fc54f){socket[_0x1156('0x87')](_0x1156('0x88'),{'UserId':_0x4fc54f,'VoiceQueueId':_0x2a678f['id']});});});});});});})[_0x1156('0x24')](respondWithStatusCode(_0x142631,null))[_0x1156('0x4c')](handleError(_0x142631,null));};exports[_0x1156('0x89')]=function(_0x52be93,_0x19dd25,_0x1f1545){var _0x4bee4e,_0x1c6ec2;return db[_0x1156('0x36')][_0x1156('0x2e')]({'where':{'id':_0x52be93['params']['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x19dd25,null))[_0x1156('0x24')](function(_0x38e4d5){if(_0x38e4d5){_0x1c6ec2=_0x38e4d5;return _0x38e4d5['addAgents'](_0x52be93['body'][_0x1156('0x77')],_[_0x1156('0x8a')](_0x52be93[_0x1156('0x59')],[_0x1156('0x77'),'id'])||{})[_0x1156('0x8b')](function(_0x447143){for(var _0x5bb70a=0x0;_0x5bb70a<_0x52be93['body'][_0x1156('0x77')][_0x1156('0x3f')];_0x5bb70a+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x52be93[_0x1156('0x59')]['ids'][_0x5bb70a]),'VoiceQueueId':Number(_0x52be93['params']['id'])});}return _0x447143;});}})[_0x1156('0x24')](function(_0x659d13){_0x4bee4e=_0x659d13||[];if(_0x1c6ec2){return db[_0x1156('0x78')][_0x1156('0x4b')]({'where':{'id':_0x52be93[_0x1156('0x59')][_0x1156('0x77')]},'attributes':['id',_0x1156('0x30'),_0x1156('0x6a'),_0x1156('0x6b'),_0x1156('0x6c')],'raw':!![]});}})['then'](function(_0x310d92){if(!_[_0x1156('0x85')](_0x310d92)){var _0x531e58=[];for(var _0x3cc5c6=0x0;_0x3cc5c6<_0x310d92[_0x1156('0x3f')];_0x3cc5c6++){if(_0x310d92[_0x3cc5c6]['online']){_0x531e58[_0x1156('0x80')](db[_0x1156('0x74')][_0x1156('0x73')]({'membername':_0x310d92[_0x3cc5c6][_0x1156('0x30')],'UserId':_0x310d92[_0x3cc5c6]['id'],'queue_name':_0x1c6ec2[_0x1156('0x30')],'VoiceQueueId':_0x1c6ec2['id'],'interface':_[_0x1156('0x8c')](_0x310d92[_0x3cc5c6][_0x1156('0x6c')])?util['format']('SIP/%s',_0x310d92[_0x3cc5c6][_0x1156('0x30')]):_0x310d92[_0x3cc5c6][_0x1156('0x6c')],'paused':_0x310d92[_0x3cc5c6][_0x1156('0x6b')]||![],'penalty':_0x52be93[_0x1156('0x59')][_0x1156('0x6f')]||0x0}));}}return BPromise[_0x1156('0x84')](_0x531e58);}})['then'](function(){return _0x4bee4e;})[_0x1156('0x24')](respondWithResult(_0x19dd25,null))[_0x1156('0x4c')](handleError(_0x19dd25,null));};exports[_0x1156('0x86')]=function(_0x365fa8,_0x273dc6,_0x1648be){return db[_0x1156('0x36')][_0x1156('0x2e')]({'where':{'id':_0x365fa8[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x273dc6,null))[_0x1156('0x24')](function(_0x39ed53){if(_0x39ed53){return _0x39ed53['removeAgents'](_0x365fa8[_0x1156('0x3a')][_0x1156('0x77')])[_0x1156('0x24')](function(){if(_[_0x1156('0x8d')](_0x365fa8[_0x1156('0x3a')]['ids'])){for(var _0x3b75b4=0x0;_0x3b75b4<_0x365fa8[_0x1156('0x3a')][_0x1156('0x77')][_0x1156('0x3f')];_0x3b75b4+=0x1){socket[_0x1156('0x87')](_0x1156('0x88'),{'UserId':Number(_0x365fa8[_0x1156('0x3a')][_0x1156('0x77')][_0x3b75b4]),'VoiceQueueId':Number(_0x365fa8[_0x1156('0x58')]['id'])});}}else{socket[_0x1156('0x87')](_0x1156('0x88'),{'UserId':Number(_0x365fa8[_0x1156('0x3a')][_0x1156('0x77')]),'VoiceQueueId':Number(_0x365fa8[_0x1156('0x58')]['id'])});}});}})['then'](function(_0x3f94b0){return db['UserVoiceQueueRt'][_0x1156('0x23')]({'where':{'VoiceQueueId':_0x365fa8[_0x1156('0x58')]['id'],'UserId':_0x365fa8[_0x1156('0x3a')][_0x1156('0x77')]}})[_0x1156('0x24')](function(){return _0x3f94b0;});})[_0x1156('0x24')](respondWithStatusCode(_0x273dc6,null))[_0x1156('0x4c')](handleError(_0x273dc6,null));};exports['getAgents']=function(_0x20cc75,_0x153b8f,_0x42b759){var _0x14ae47={};var _0x278862={};var _0x1140af;var _0x429684;return db['VoiceQueue'][_0x1156('0x5e')]({'where':{'id':_0x20cc75['params']['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x153b8f,null))[_0x1156('0x24')](function(_0x3ccf4b){if(_0x3ccf4b){_0x1140af=_0x3ccf4b;_0x278862[_0x1156('0x3d')]=_[_0x1156('0x39')](db[_0x1156('0x78')][_0x1156('0x4d')]);_0x278862[_0x1156('0x3a')]=_['keys'](_0x20cc75['query']);_0x278862[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x278862[_0x1156('0x3d')],_0x278862[_0x1156('0x3a')]);_0x14ae47['attributes']=_[_0x1156('0x3c')](_0x278862[_0x1156('0x3d')],qs[_0x1156('0x4e')](_0x20cc75[_0x1156('0x3a')][_0x1156('0x4e')]));_0x14ae47['attributes']=_0x14ae47['attributes'][_0x1156('0x3f')]?_0x14ae47[_0x1156('0x3e')]:_0x278862[_0x1156('0x3d')];_0x14ae47[_0x1156('0x42')]=qs[_0x1156('0x43')](_0x20cc75['query'][_0x1156('0x43')]);_0x14ae47['where']=qs['filters'](_['pick'](_0x20cc75['query'],_0x278862[_0x1156('0x3b')]));if(_0x20cc75[_0x1156('0x3a')][_0x1156('0x45')]){_0x14ae47[_0x1156('0x46')]=_['merge'](_0x14ae47[_0x1156('0x46')],{'$or':_['map'](_0x14ae47[_0x1156('0x3e')],function(_0x585189){var _0x436b81={};_0x436b81[_0x585189]={'$like':'%'+_0x20cc75[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x436b81;})});}_0x14ae47=_[_0x1156('0x4f')]({},_0x14ae47,_0x20cc75['options']);return _0x1140af['getAgents'](_0x14ae47);}})[_0x1156('0x24')](function(_0x4afc70){if(_0x4afc70){_0x429684=_0x4afc70[_0x1156('0x3f')];if(!_0x20cc75['query'][_0x1156('0x40')](_0x1156('0x41'))){_0x14ae47[_0x1156('0x1b')]=qs[_0x1156('0x1b')](_0x20cc75[_0x1156('0x3a')][_0x1156('0x1b')]);_0x14ae47[_0x1156('0x1a')]=qs[_0x1156('0x1a')](_0x20cc75['query']['offset']);}return _0x1140af['getAgents'](_0x14ae47);}})[_0x1156('0x24')](function(_0x233ef8){if(_0x233ef8){return _0x233ef8?{'count':_0x429684,'rows':_0x233ef8}:null;}})[_0x1156('0x24')](respondWithResult(_0x153b8f,null))[_0x1156('0x4c')](handleError(_0x153b8f,null));};exports[_0x1156('0x8e')]=function(_0xb9c7b4,_0x529c1c,_0x41fd06){var _0x2a897a={};var _0x3fddbd={};var _0x4fcb24;var _0x4e40c8;return db[_0x1156('0x36')][_0x1156('0x5e')]({'where':{'id':_0xb9c7b4[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x529c1c,null))[_0x1156('0x24')](function(_0xa9c76d){if(_0xa9c76d){_0x4fcb24=_0xa9c76d;_0x3fddbd['model']=_[_0x1156('0x39')](db[_0x1156('0x74')][_0x1156('0x4d')]);_0x3fddbd[_0x1156('0x3a')]=_[_0x1156('0x39')](_0xb9c7b4[_0x1156('0x3a')]);_0x3fddbd[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x3fddbd[_0x1156('0x3d')],_0x3fddbd[_0x1156('0x3a')]);_0x2a897a[_0x1156('0x3e')]=_[_0x1156('0x3c')](_0x3fddbd[_0x1156('0x3d')],qs[_0x1156('0x4e')](_0xb9c7b4[_0x1156('0x3a')][_0x1156('0x4e')]));_0x2a897a[_0x1156('0x3e')]=_0x2a897a[_0x1156('0x3e')][_0x1156('0x3f')]?_0x2a897a['attributes']:_0x3fddbd['model'];_0x2a897a[_0x1156('0x42')]=qs[_0x1156('0x43')](_0xb9c7b4[_0x1156('0x3a')][_0x1156('0x43')]);_0x2a897a['where']=qs[_0x1156('0x3b')](_['pick'](_0xb9c7b4[_0x1156('0x3a')],_0x3fddbd[_0x1156('0x3b')]));if(_0xb9c7b4[_0x1156('0x3a')][_0x1156('0x45')]){_0x2a897a[_0x1156('0x46')]=_[_0x1156('0x4f')](_0x2a897a['where'],{'$or':_['map'](_0x2a897a[_0x1156('0x3e')],function(_0x23bc6a){var _0x191295={};_0x191295[_0x23bc6a]={'$like':'%'+_0xb9c7b4[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x191295;})});}_0x2a897a=_['merge']({},_0x2a897a,_0xb9c7b4[_0x1156('0x48')]);return _0x4fcb24[_0x1156('0x8e')](_0x2a897a);}})['then'](function(_0x53b6c3){if(_0x53b6c3){_0x4e40c8=_0x53b6c3[_0x1156('0x3f')];if(!_0xb9c7b4[_0x1156('0x3a')][_0x1156('0x40')]('nolimit')){_0x2a897a[_0x1156('0x1b')]=qs[_0x1156('0x1b')](_0xb9c7b4['query'][_0x1156('0x1b')]);_0x2a897a[_0x1156('0x1a')]=qs['offset'](_0xb9c7b4[_0x1156('0x3a')][_0x1156('0x1a')]);}return _0x4fcb24[_0x1156('0x8e')](_0x2a897a);}})['then'](function(_0x5afc37){return _0x5afc37?{'count':_0x4e40c8,'rows':_0x5afc37}:null;})[_0x1156('0x24')](respondWithResult(_0x529c1c,null))['catch'](handleError(_0x529c1c,null));};exports[_0x1156('0x8f')]=function(_0x42e20e,_0x5cbeb4,_0x471e2e){var _0xaf5202={};var _0x295acb={};var _0x41e24d;var _0x5e8592;return db['VoiceQueue'][_0x1156('0x5e')]({'where':{'id':_0x42e20e[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x5cbeb4,null))[_0x1156('0x24')](function(_0x4c92d7){if(_0x4c92d7){_0x41e24d=_0x4c92d7;_0x295acb[_0x1156('0x3d')]=_['keys'](db[_0x1156('0x90')][_0x1156('0x4d')]);_0x295acb['query']=_[_0x1156('0x39')](_0x42e20e['query']);_0x295acb[_0x1156('0x3b')]=_['intersection'](_0x295acb[_0x1156('0x3d')],_0x295acb['query']);_0xaf5202[_0x1156('0x3e')]=_[_0x1156('0x3c')](_0x295acb['model'],qs[_0x1156('0x4e')](_0x42e20e[_0x1156('0x3a')][_0x1156('0x4e')]));_0xaf5202[_0x1156('0x3e')]=_0xaf5202[_0x1156('0x3e')][_0x1156('0x3f')]?_0xaf5202['attributes']:_0x295acb['model'];_0xaf5202[_0x1156('0x42')]=qs['sort'](_0x42e20e[_0x1156('0x3a')][_0x1156('0x43')]);_0xaf5202[_0x1156('0x46')]=qs['filters'](_[_0x1156('0x44')](_0x42e20e[_0x1156('0x3a')],_0x295acb[_0x1156('0x3b')]));if(_0x42e20e[_0x1156('0x3a')][_0x1156('0x45')]){_0xaf5202['where']=_['merge'](_0xaf5202[_0x1156('0x46')],{'$or':_[_0x1156('0x2b')](_0xaf5202['attributes'],function(_0x326324){var _0x29505a={};_0x29505a[_0x326324]={'$like':'%'+_0x42e20e[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x29505a;})});}_0xaf5202=_[_0x1156('0x4f')]({},_0xaf5202,_0x42e20e[_0x1156('0x48')]);return _0x41e24d['getLists'](_0xaf5202);}})[_0x1156('0x24')](function(_0x51fe27){if(_0x51fe27){_0x5e8592=_0x51fe27['length'];if(!_0x42e20e['query']['hasOwnProperty']('nolimit')){_0xaf5202[_0x1156('0x1b')]=qs['limit'](_0x42e20e[_0x1156('0x3a')]['limit']);_0xaf5202[_0x1156('0x1a')]=qs[_0x1156('0x1a')](_0x42e20e[_0x1156('0x3a')][_0x1156('0x1a')]);}return _0x41e24d['getLists'](_0xaf5202);}})[_0x1156('0x24')](function(_0x20987e){if(_0x20987e){return _0x20987e?{'count':_0x5e8592,'rows':_0x20987e}:null;}})[_0x1156('0x24')](respondWithResult(_0x5cbeb4,null))[_0x1156('0x4c')](handleError(_0x5cbeb4,null));};exports['addLists']=function(_0x28fbe7,_0x632f2f,_0x47fb4e){var _0x507a48=moment()['format'](_0x1156('0x91'));var _0x272302,_0x4f170b;return db[_0x1156('0x36')]['find']({'where':{'id':_0x28fbe7[_0x1156('0x58')]['id']}})['then'](handleEntityNotFound(_0x632f2f,null))[_0x1156('0x24')](function(_0x509c15){if(_0x509c15){_0x4f170b=_0x509c15;return _0x509c15[_0x1156('0x92')](_0x28fbe7['body'][_0x1156('0x77')],_[_0x1156('0x8a')](_0x28fbe7[_0x1156('0x59')],['ids','id'])||{});}return null;})[_0x1156('0x8b')](function(_0x24c2ed){var _0x50a280;_0x272302=_0x24c2ed||[];var _0xaba0cb=[];if(_0x24c2ed){for(var _0x88ddc9=0x0;_0x88ddc9<_0x24c2ed['length'];_0x88ddc9+=0x1){var _0x3acc96=_0x24c2ed[_0x88ddc9][_0x1156('0x25')]({'plain':!![]});_0x4f170b['dialCheckDuplicateType']=_0x28fbe7[_0x1156('0x59')][_0x1156('0x93')]?_0x28fbe7[_0x1156('0x59')][_0x1156('0x93')]:_0x4f170b['dialCheckDuplicateType'];switch(_0x4f170b[_0x1156('0x93')]){case _0x1156('0x94'):_0x50a280=squel[_0x1156('0x95')]()[_0x1156('0x96')](_0x1156('0x97'))[_0x1156('0x98')]([_0x1156('0x99'),_0x1156('0x9a'),_0x1156('0x9b'),_0x1156('0x9c'),_0x1156('0x60'),_0x1156('0x5a'),'updatedAt'],squel[_0x1156('0x9d')]()['field'](_0x1156('0x99'),_0x1156('0x99'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27',_0x1156('0x9a'))[_0x1156('0x79')]('id',_0x1156('0x9b'))[_0x1156('0x79')](_0x3acc96[_0x1156('0x9e')][_0x1156('0x81')](),'ListId')[_0x1156('0x79')](_0x28fbe7[_0x1156('0x58')]['id'][_0x1156('0x81')](),_0x1156('0x60'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27','createdAt')['field']('\x27'+_0x507a48+'\x27','updatedAt')[_0x1156('0x9f')](_0x1156('0xa0'))[_0x1156('0x46')](_0x1156('0xa1'))['where'](_0x1156('0xa2'),_0x3acc96[_0x1156('0x9e')]['toString']())[_0x1156('0x46')](_0x1156('0xa3'))[_0x1156('0x46')](_0x1156('0xa4'),squel[_0x1156('0x9d')]()[_0x1156('0x79')](_0x1156('0xa5'))['from'](_0x1156('0xa6'))[_0x1156('0x46')](_0x1156('0x7d'),_0x28fbe7['params']['id']['toString']()))['where'](_0x1156('0xa4'),squel[_0x1156('0x9d')]()[_0x1156('0x79')](_0x1156('0xa7'))[_0x1156('0x9f')]('cm_hopper')[_0x1156('0x46')](_0x1156('0x7d'),_0x28fbe7[_0x1156('0x58')]['id'][_0x1156('0x81')]())))['toString']();break;case _0x1156('0xa8'):_0x50a280=squel[_0x1156('0x95')]()[_0x1156('0x96')](_0x1156('0x97'))['fromQuery']([_0x1156('0x99'),_0x1156('0x9a'),_0x1156('0x9b'),_0x1156('0x9c'),_0x1156('0x60'),_0x1156('0x5a'),_0x1156('0x5b')],squel[_0x1156('0x9d')]()['field'](_0x1156('0x99'),_0x1156('0x99'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27',_0x1156('0x9a'))[_0x1156('0x79')]('id',_0x1156('0x9b'))[_0x1156('0x79')](_0x3acc96[_0x1156('0x9e')][_0x1156('0x81')](),'ListId')[_0x1156('0x79')](_0x28fbe7[_0x1156('0x58')]['id'][_0x1156('0x81')](),_0x1156('0x60'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27',_0x1156('0x5a'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27',_0x1156('0x5b'))[_0x1156('0x9f')](_0x1156('0xa0'))[_0x1156('0x46')](_0x1156('0xa1'))['where'](_0x1156('0xa2'),_0x3acc96[_0x1156('0x9e')][_0x1156('0x81')]())[_0x1156('0x46')](_0x1156('0xa3'))[_0x1156('0x46')](_0x1156('0xa4'),squel['select']()[_0x1156('0x79')](_0x1156('0xa7'))[_0x1156('0x9f')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x28fbe7[_0x1156('0x58')]['id'][_0x1156('0x81')]())))[_0x1156('0x81')]();break;default:_0x50a280=squel[_0x1156('0x95')]()[_0x1156('0x96')](_0x1156('0x97'))[_0x1156('0x98')]([_0x1156('0x99'),_0x1156('0x9a'),_0x1156('0x9b'),_0x1156('0x9c'),'VoiceQueueId','createdAt','updatedAt'],squel[_0x1156('0x9d')]()['field'](_0x1156('0x99'),_0x1156('0x99'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27','scheduledAt')[_0x1156('0x79')]('id',_0x1156('0x9b'))[_0x1156('0x79')](_0x3acc96[_0x1156('0x9e')][_0x1156('0x81')](),'ListId')[_0x1156('0x79')](_0x28fbe7['params']['id'][_0x1156('0x81')](),_0x1156('0x60'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27','createdAt')[_0x1156('0x79')]('\x27'+_0x507a48+'\x27','updatedAt')[_0x1156('0x9f')]('cm_contacts')[_0x1156('0x46')](_0x1156('0xa1'))[_0x1156('0x46')](_0x1156('0xa2'),_0x3acc96[_0x1156('0x9e')][_0x1156('0x81')]())['where'](_0x1156('0xa3')))[_0x1156('0x81')]();}_0xaba0cb[_0x1156('0x80')](db[_0x1156('0x70')][_0x1156('0x3a')](_0x50a280));}return BPromise[_0x1156('0x84')](_0xaba0cb);}})[_0x1156('0x24')](function(){var _0x4e7ea3=[];var _0x1ee750=squel['insert']()['into']('cm_hopper_additional_phones')[_0x1156('0x98')]([_0x1156('0xa9'),_0x1156('0x99'),_0x1156('0xaa'),_0x1156('0x5a'),_0x1156('0x5b')],squel['select']()[_0x1156('0x79')]('h.id')[_0x1156('0x79')](_0x1156('0xab'))[_0x1156('0x79')](_0x1156('0xac'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27',_0x1156('0x5a'))[_0x1156('0x79')]('\x27'+_0x507a48+'\x27',_0x1156('0x5b'))['from'](_0x1156('0xad'),'ci')[_0x1156('0xae')](_0x1156('0x97'),'h',_0x1156('0xaf'))[_0x1156('0x46')](_0x1156('0xb0'),_0x507a48)[_0x1156('0x46')]('ci.ItemClass=?',_0x1156('0xb1')))[_0x1156('0x81')]();_0x4e7ea3[_0x1156('0x80')](db[_0x1156('0x70')][_0x1156('0x3a')](_0x1ee750));return BPromise[_0x1156('0x84')](_0x4e7ea3);})[_0x1156('0x24')](function(){return _0x272302;})['then'](respondWithResult(_0x632f2f,null))[_0x1156('0x4c')](handleError(_0x632f2f,null));};exports[_0x1156('0xb2')]=function(_0x12a796,_0x5a366f,_0x58a0d1){return db[_0x1156('0x36')]['find']({'where':{'id':_0x12a796['params']['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x5a366f,null))[_0x1156('0x24')](function(_0x5dc079){if(_0x5dc079){return _0x5dc079[_0x1156('0xb2')](_0x12a796[_0x1156('0x3a')]['ids']);}})['then'](function(_0x19329f){if(_0x19329f){return db['CmHopper'][_0x1156('0x23')]({'where':{'ListId':_0x12a796[_0x1156('0x3a')]['ids'],'VoiceQueueId':_0x12a796[_0x1156('0x58')]['id']}})[_0x1156('0x24')](function(){return _0x19329f;});}})[_0x1156('0x24')](respondWithStatusCode(_0x5a366f,null))[_0x1156('0x4c')](handleError(_0x5a366f,null));};exports[_0x1156('0xb3')]=function(_0x297e6b,_0x3c75c1,_0x2554a0){var _0x55f529={};var _0x7143a={};var _0x2767dd;var _0x133111;return db['VoiceQueue'][_0x1156('0x5e')]({'where':{'id':_0x297e6b[_0x1156('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c75c1,null))[_0x1156('0x24')](function(_0x14d39c){if(_0x14d39c){_0x2767dd=_0x14d39c;_0x7143a[_0x1156('0x3d')]=_[_0x1156('0x39')](db[_0x1156('0x90')][_0x1156('0x4d')]);_0x7143a[_0x1156('0x3a')]=_['keys'](_0x297e6b[_0x1156('0x3a')]);_0x7143a[_0x1156('0x3b')]=_[_0x1156('0x3c')](_0x7143a[_0x1156('0x3d')],_0x7143a[_0x1156('0x3a')]);_0x55f529[_0x1156('0x3e')]=_[_0x1156('0x3c')](_0x7143a[_0x1156('0x3d')],qs[_0x1156('0x4e')](_0x297e6b['query'][_0x1156('0x4e')]));_0x55f529[_0x1156('0x3e')]=_0x55f529[_0x1156('0x3e')][_0x1156('0x3f')]?_0x55f529['attributes']:_0x7143a['model'];_0x55f529[_0x1156('0x42')]=qs[_0x1156('0x43')](_0x297e6b['query'][_0x1156('0x43')]);_0x55f529[_0x1156('0x46')]=qs[_0x1156('0x3b')](_[_0x1156('0x44')](_0x297e6b[_0x1156('0x3a')],_0x7143a[_0x1156('0x3b')]));if(_0x297e6b[_0x1156('0x3a')][_0x1156('0x45')]){_0x55f529[_0x1156('0x46')]=_[_0x1156('0x4f')](_0x55f529[_0x1156('0x46')],{'$or':_[_0x1156('0x2b')](_0x55f529[_0x1156('0x3e')],function(_0x5295fd){var _0x2f2de3={};_0x2f2de3[_0x5295fd]={'$like':'%'+_0x297e6b[_0x1156('0x3a')]['filter']+'%'};return _0x2f2de3;})});}_0x55f529=_[_0x1156('0x4f')]({},_0x55f529,_0x297e6b[_0x1156('0x48')]);return _0x2767dd[_0x1156('0xb3')](_0x55f529);}})[_0x1156('0x24')](function(_0x252829){if(_0x252829){_0x133111=_0x252829[_0x1156('0x3f')];if(!_0x297e6b[_0x1156('0x3a')][_0x1156('0x40')](_0x1156('0x41'))){_0x55f529['limit']=qs[_0x1156('0x1b')](_0x297e6b[_0x1156('0x3a')]['limit']);_0x55f529[_0x1156('0x1a')]=qs[_0x1156('0x1a')](_0x297e6b[_0x1156('0x3a')][_0x1156('0x1a')]);}return _0x2767dd[_0x1156('0xb3')](_0x55f529);}})[_0x1156('0x24')](function(_0x4223ff){if(_0x4223ff){return _0x4223ff?{'count':_0x133111,'rows':_0x4223ff}:null;}})['then'](respondWithResult(_0x3c75c1,null))[_0x1156('0x4c')](handleError(_0x3c75c1,null));};exports[_0x1156('0xb4')]=function(_0x555748,_0x408947,_0x49dc14){var _0x4a35cf,_0x4ba936;return db[_0x1156('0x36')][_0x1156('0x2e')]({'where':{'id':_0x555748['params']['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x408947,null))['then'](function(_0x5d66fd){if(_0x5d66fd){_0x4ba936=_0x5d66fd;return _0x5d66fd['addBlackLists'](_0x555748['body']['ids'],_['omit'](_0x555748['body'],['ids','id'])||{});}return null;})[_0x1156('0x8b')](function(_0x1a7014){var _0x5b43fb;_0x4a35cf=_0x1a7014||[];var _0x32ca68=[];if(_0x1a7014){for(var _0x1e8e12=0x0;_0x1e8e12<_0x1a7014[_0x1156('0x3f')];_0x1e8e12+=0x1){var _0x2fa105=_0x1a7014[_0x1e8e12][_0x1156('0x25')]({'plain':!![]});_0x5b43fb=squel['insert']()[_0x1156('0x96')](_0x1156('0xb5'))['fromQuery']([_0x1156('0x99'),'ContactId',_0x1156('0x9c'),'VoiceQueueId','createdAt',_0x1156('0x5b')],squel['select']()[_0x1156('0x79')](_0x1156('0x99'),_0x1156('0x99'))[_0x1156('0x79')]('id',_0x1156('0x9b'))[_0x1156('0x79')](_0x2fa105[_0x1156('0x9e')][_0x1156('0x81')](),_0x1156('0x9c'))['field'](_0x555748['params']['id'][_0x1156('0x81')](),_0x1156('0x60'))[_0x1156('0x79')](_0x1156('0xb6'),_0x1156('0x5a'))['field']('NOW()',_0x1156('0x5b'))[_0x1156('0x9f')](_0x1156('0xa0'))[_0x1156('0x46')]('deletedAt\x20IS\x20NULL')[_0x1156('0x46')](_0x1156('0xa2'),_0x2fa105['CmListId'][_0x1156('0x81')]())['where'](_0x1156('0xa3')))['toString']();_0x32ca68[_0x1156('0x80')](db[_0x1156('0x70')]['query'](_0x5b43fb));}return BPromise['all'](_0x32ca68);}})[_0x1156('0x24')](function(){return _0x4a35cf;})['then'](respondWithResult(_0x408947,null))['catch'](handleError(_0x408947,null));};exports[_0x1156('0xb7')]=function(_0x42d33c,_0x33e224,_0x1651e5){return db[_0x1156('0x36')]['find']({'where':{'id':_0x42d33c[_0x1156('0x58')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0x33e224,null))[_0x1156('0x24')](function(_0x17a76c){if(_0x17a76c){return _0x17a76c[_0x1156('0xb7')](_0x42d33c[_0x1156('0x3a')][_0x1156('0x77')]);}})['then'](function(_0xd02d98){if(_0xd02d98){return db['CmHopperBlack'][_0x1156('0x23')]({'where':{'ListId':_0x42d33c['query'][_0x1156('0x77')],'VoiceQueueId':_0x42d33c[_0x1156('0x58')]['id']}})[_0x1156('0x24')](function(){return _0xd02d98;});}})[_0x1156('0x24')](respondWithStatusCode(_0x33e224,null))[_0x1156('0x4c')](handleError(_0x33e224,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3a278f7..09e0808 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 _0xbe72=['update','remove','hook','events','VoiceQueue','setMaxListeners'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0xbe72,0x1e3));var _0x2be7=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xbe72[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0x2be7('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x2be7('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2be7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2be7('0x3'),'afterDestroy':_0x2be7('0x4')};function emitEvent(_0x16fb49){return function(_0x484dd0,_0x252f6d,_0x4cd726){VoiceQueueEvents['emit'](_0x16fb49+':'+_0x484dd0['id'],_0x484dd0);VoiceQueueEvents['emit'](_0x16fb49,_0x484dd0);_0x4cd726(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x2be7('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xed90=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x7b102d,_0x414b58){var _0x235e07=function(_0x69d3c4){while(--_0x69d3c4){_0x7b102d['push'](_0x7b102d['shift']());}};_0x235e07(++_0x414b58);}(_0xed90,0x17f));var _0x0ed9=function(_0x38320d,_0x57b660){_0x38320d=_0x38320d-0x0;var _0x5c8407=_0xed90[_0x38320d];return _0x5c8407;};'use strict';var EventEmitter=require(_0x0ed9('0x0'));var VoiceQueue=require(_0x0ed9('0x1'))['db'][_0x0ed9('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0ed9('0x3')](0x0);var events={'afterCreate':_0x0ed9('0x4'),'afterUpdate':_0x0ed9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3f4ebe){return function(_0x4beb45,_0x44f5cc,_0x184713){VoiceQueueEvents[_0x0ed9('0x6')](_0x3f4ebe+':'+_0x4beb45['id'],_0x4beb45);VoiceQueueEvents[_0x0ed9('0x6')](_0x3f4ebe,_0x4beb45);_0x184713(null);};}for(var e in events){if(events[_0x0ed9('0x7')](e)){var event=events[e];VoiceQueue[_0x0ed9('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 8261ce0..7fdfda1 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3ed95e,_0x2d2d13){var _0x4ab531=function(_0x4823b4){while(--_0x4823b4){_0x3ed95e['push'](_0x3ed95e['shift']());}};_0x4ab531(++_0x2d2d13);}(_0x008c,0x188));var _0xc008=function(_0x53b22e,_0x5e248f){_0x53b22e=_0x53b22e-0x0;var _0x14a0a4=_0x008c[_0x53b22e];return _0x14a0a4;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x4e0157,_0x147213){var _0x13a010=function(_0x3d39ea){while(--_0x3d39ea){_0x4e0157['push'](_0x4e0157['shift']());}};_0x13a010(++_0x147213);}(_0x70e0,0x17b));var _0x070e=function(_0x5e3047,_0x3a033a){_0x5e3047=_0x5e3047-0x0;var _0x5194b7=_0x70e0[_0x5e3047];return _0x5194b7;};'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']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'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 4a16f5a..48a874c 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 _0x88bf=['message','VoiceQueue,\x20%s,\x20%s','request\x20sent','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','then','ShowVoiceQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','debug','stringify','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x88bf,0x153));var _0xf88b=function(_0x5eb442,_0xe2ae2e){_0x5eb442=_0x5eb442-0x0;var _0x53aad0=_0x88bf[_0x5eb442];return _0x53aad0;};'use strict';var _=require('lodash');var util=require(_0xf88b('0x0'));var moment=require(_0xf88b('0x1'));var BPromise=require(_0xf88b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf88b('0x3'));var db=require(_0xf88b('0x4'))['db'];var utils=require(_0xf88b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf88b('0x6'));var jayson=require(_0xf88b('0x7'));var client=jayson[_0xf88b('0x8')][_0xf88b('0x9')]({'port':0x232a});config['redis']=_[_0xf88b('0xa')](config[_0xf88b('0xb')],{'host':_0xf88b('0xc'),'port':0x18eb});var socket=require(_0xf88b('0xd'))(new Redis(config[_0xf88b('0xb')]));require(_0xf88b('0xe'))[_0xf88b('0xf')](socket);function respondWithRpcPromise(_0x3d60c2,_0x58bbe4,_0x39f756){return new BPromise(function(_0x4fe4b6,_0x26a08c){return client[_0xf88b('0x10')](_0x3d60c2,_0x39f756)['then'](function(_0x17a4ef){logger[_0xf88b('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x58bbe4,'request\x20sent');logger[_0xf88b('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x58bbe4,'request\x20sent',JSON[_0xf88b('0x13')](_0x17a4ef));if(_0x17a4ef['error']){if(_0x17a4ef[_0xf88b('0x14')]['code']===0x1f4){logger[_0xf88b('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x58bbe4,_0x17a4ef[_0xf88b('0x14')][_0xf88b('0x15')]);return _0x26a08c(_0x17a4ef[_0xf88b('0x14')]['message']);}logger[_0xf88b('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x58bbe4,_0x17a4ef[_0xf88b('0x14')][_0xf88b('0x15')]);return _0x4fe4b6(_0x17a4ef[_0xf88b('0x14')][_0xf88b('0x15')]);}else{logger['info'](_0xf88b('0x16'),_0x58bbe4,_0xf88b('0x17'));_0x4fe4b6(_0x17a4ef[_0xf88b('0x18')]['message']);}})['catch'](function(_0x12d693){logger[_0xf88b('0x14')](_0xf88b('0x16'),_0x58bbe4,_0x12d693);_0x26a08c(_0x12d693);});});}exports[_0xf88b('0x19')]=function(_0x1c1afb){var _0x5c936d=this;return new Promise(function(_0x1485f0,_0x45ce89){return db[_0xf88b('0x1a')][_0xf88b('0x1b')]({'raw':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x1e')]||null:null,'attributes':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x1f')]||null:null,'limit':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x20')]||null:null,'include':_0x1c1afb[_0xf88b('0x1c')]?_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x21')]?_[_0xf88b('0x22')](_0x1c1afb[_0xf88b('0x1c')][_0xf88b('0x21')],function(_0x4ee253){return{'model':db[_0x4ee253[_0xf88b('0x23')]],'as':_0x4ee253['as'],'attributes':_0x4ee253[_0xf88b('0x1f')],'include':_0x4ee253['include']?_['map'](_0x4ee253[_0xf88b('0x21')],function(_0x1f0164){return{'model':db[_0x1f0164[_0xf88b('0x23')]],'as':_0x1f0164['as'],'attributes':_0x1f0164['attributes'],'include':_0x1f0164[_0xf88b('0x21')]?_[_0xf88b('0x22')](_0x1f0164['include'],function(_0x163187){return{'model':db[_0x163187[_0xf88b('0x23')]],'as':_0x163187['as'],'attributes':_0x163187[_0xf88b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46946d){logger[_0xf88b('0x11')](_0xf88b('0x19'),_0x1c1afb);logger[_0xf88b('0x12')](_0xf88b('0x19'),_0x1c1afb,JSON[_0xf88b('0x13')](_0x46946d));_0x1485f0(_0x46946d);})[_0xf88b('0x24')](function(_0x5078d8){logger['error'](_0xf88b('0x19'),_0x5078d8[_0xf88b('0x15')],_0x1c1afb);_0x45ce89(_0x5c936d[_0xf88b('0x14')](0x1f4,_0x5078d8[_0xf88b('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x9aa656){var _0x1e7c65=this;return new Promise(function(_0x3f4682,_0x3910ef){return db['VoiceQueue'][_0xf88b('0x25')]({'raw':_0x9aa656[_0xf88b('0x1c')]?_0x9aa656[_0xf88b('0x1c')][_0xf88b('0x1d')]===undefined?!![]:![]:!![],'where':_0x9aa656[_0xf88b('0x1c')]?_0x9aa656['options']['where']||null:null,'attributes':_0x9aa656['options']?_0x9aa656['options'][_0xf88b('0x1f')]||null:null,'include':_0x9aa656[_0xf88b('0x1c')]?_0x9aa656[_0xf88b('0x1c')][_0xf88b('0x21')]?_['map'](_0x9aa656[_0xf88b('0x1c')]['include'],function(_0x4a1fc3){return{'model':db[_0x4a1fc3[_0xf88b('0x23')]],'as':_0x4a1fc3['as'],'attributes':_0x4a1fc3['attributes'],'include':_0x4a1fc3['include']?_[_0xf88b('0x22')](_0x4a1fc3[_0xf88b('0x21')],function(_0x8158ed){return{'model':db[_0x8158ed[_0xf88b('0x23')]],'as':_0x8158ed['as'],'attributes':_0x8158ed['attributes'],'include':_0x8158ed[_0xf88b('0x21')]?_[_0xf88b('0x22')](_0x8158ed[_0xf88b('0x21')],function(_0x4c134d){return{'model':db[_0x4c134d[_0xf88b('0x23')]],'as':_0x4c134d['as'],'attributes':_0x4c134d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf88b('0x26')](function(_0x42b938){logger[_0xf88b('0x11')](_0xf88b('0x27'),_0x9aa656);logger[_0xf88b('0x12')]('ShowVoiceQueue',_0x9aa656,JSON[_0xf88b('0x13')](_0x42b938));_0x3f4682(_0x42b938);})[_0xf88b('0x24')](function(_0x398fa7){logger[_0xf88b('0x14')]('ShowVoiceQueue',_0x398fa7[_0xf88b('0x15')],_0x9aa656);_0x3910ef(_0x1e7c65[_0xf88b('0x14')](0x1f4,_0x398fa7[_0xf88b('0x15')]));});});}; \ No newline at end of file +var _0x8174=['request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowVoiceQueue','VoiceQueue','find','then','lodash','util','moment','randomstring','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x55fc71,_0xb97ced){var _0x9c5599=function(_0x46ce53){while(--_0x46ce53){_0x55fc71['push'](_0x55fc71['shift']());}};_0x9c5599(++_0xb97ced);}(_0x8174,0x1ea));var _0x4817=function(_0x5a125c,_0x155fa2){_0x5a125c=_0x5a125c-0x0;var _0x4c70af=_0x8174[_0x5a125c];return _0x4c70af;};'use strict';var _=require(_0x4817('0x0'));var util=require(_0x4817('0x1'));var moment=require(_0x4817('0x2'));var BPromise=require('bluebird');var rs=require(_0x4817('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(_0x4817('0x4'));var jayson=require(_0x4817('0x5'));var client=jayson[_0x4817('0x6')][_0x4817('0x7')]({'port':0x232a});config[_0x4817('0x8')]=_[_0x4817('0x9')](config['redis'],{'host':_0x4817('0xa'),'port':0x18eb});var socket=require(_0x4817('0xb'))(new Redis(config['redis']));require(_0x4817('0xc'))[_0x4817('0xd')](socket);function respondWithRpcPromise(_0x35ab92,_0x8825b7,_0x40bea1){return new BPromise(function(_0x4c6059,_0x3879d8){return client[_0x4817('0xe')](_0x35ab92,_0x40bea1)['then'](function(_0x22f20e){logger[_0x4817('0xf')](_0x4817('0x10'),_0x8825b7,_0x4817('0x11'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x8825b7,'request\x20sent',JSON[_0x4817('0x12')](_0x22f20e));if(_0x22f20e['error']){if(_0x22f20e[_0x4817('0x13')][_0x4817('0x14')]===0x1f4){logger[_0x4817('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x8825b7,_0x22f20e[_0x4817('0x13')][_0x4817('0x15')]);return _0x3879d8(_0x22f20e[_0x4817('0x13')]['message']);}logger[_0x4817('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x8825b7,_0x22f20e[_0x4817('0x13')][_0x4817('0x15')]);return _0x4c6059(_0x22f20e['error'][_0x4817('0x15')]);}else{logger['info'](_0x4817('0x10'),_0x8825b7,_0x4817('0x11'));_0x4c6059(_0x22f20e[_0x4817('0x16')]['message']);}})[_0x4817('0x17')](function(_0x431972){logger[_0x4817('0x13')](_0x4817('0x10'),_0x8825b7,_0x431972);_0x3879d8(_0x431972);});});}exports[_0x4817('0x18')]=function(_0x40c78e){var _0x5af552=this;return new Promise(function(_0x5bca2f,_0x115d90){return db['VoiceQueue'][_0x4817('0x19')]({'raw':_0x40c78e[_0x4817('0x1a')]?_0x40c78e[_0x4817('0x1a')][_0x4817('0x1b')]===undefined?!![]:![]:!![],'where':_0x40c78e[_0x4817('0x1a')]?_0x40c78e[_0x4817('0x1a')][_0x4817('0x1c')]||null:null,'attributes':_0x40c78e[_0x4817('0x1a')]?_0x40c78e[_0x4817('0x1a')][_0x4817('0x1d')]||null:null,'limit':_0x40c78e[_0x4817('0x1a')]?_0x40c78e['options'][_0x4817('0x1e')]||null:null,'include':_0x40c78e['options']?_0x40c78e[_0x4817('0x1a')][_0x4817('0x1f')]?_[_0x4817('0x20')](_0x40c78e[_0x4817('0x1a')][_0x4817('0x1f')],function(_0x3e18e3){return{'model':db[_0x3e18e3[_0x4817('0x21')]],'as':_0x3e18e3['as'],'attributes':_0x3e18e3[_0x4817('0x1d')],'include':_0x3e18e3['include']?_[_0x4817('0x20')](_0x3e18e3[_0x4817('0x1f')],function(_0xcb02ff){return{'model':db[_0xcb02ff[_0x4817('0x21')]],'as':_0xcb02ff['as'],'attributes':_0xcb02ff[_0x4817('0x1d')],'include':_0xcb02ff['include']?_[_0x4817('0x20')](_0xcb02ff[_0x4817('0x1f')],function(_0x422cd4){return{'model':db[_0x422cd4['model']],'as':_0x422cd4['as'],'attributes':_0x422cd4[_0x4817('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4be7c5){logger[_0x4817('0xf')]('GetVoiceQueue',_0x40c78e);logger[_0x4817('0x22')]('GetVoiceQueue',_0x40c78e,JSON['stringify'](_0x4be7c5));_0x5bca2f(_0x4be7c5);})['catch'](function(_0x142056){logger['error']('GetVoiceQueue',_0x142056['message'],_0x40c78e);_0x115d90(_0x5af552[_0x4817('0x13')](0x1f4,_0x142056[_0x4817('0x15')]));});});};exports[_0x4817('0x23')]=function(_0xfa9031){var _0x4a8dce=this;return new Promise(function(_0x1dc87e,_0x3e5f56){return db[_0x4817('0x24')][_0x4817('0x25')]({'raw':_0xfa9031['options']?_0xfa9031[_0x4817('0x1a')][_0x4817('0x1b')]===undefined?!![]:![]:!![],'where':_0xfa9031[_0x4817('0x1a')]?_0xfa9031[_0x4817('0x1a')][_0x4817('0x1c')]||null:null,'attributes':_0xfa9031[_0x4817('0x1a')]?_0xfa9031['options'][_0x4817('0x1d')]||null:null,'include':_0xfa9031[_0x4817('0x1a')]?_0xfa9031['options'][_0x4817('0x1f')]?_['map'](_0xfa9031[_0x4817('0x1a')][_0x4817('0x1f')],function(_0x2cbc4a){return{'model':db[_0x2cbc4a['model']],'as':_0x2cbc4a['as'],'attributes':_0x2cbc4a[_0x4817('0x1d')],'include':_0x2cbc4a[_0x4817('0x1f')]?_[_0x4817('0x20')](_0x2cbc4a['include'],function(_0x6128fb){return{'model':db[_0x6128fb[_0x4817('0x21')]],'as':_0x6128fb['as'],'attributes':_0x6128fb[_0x4817('0x1d')],'include':_0x6128fb[_0x4817('0x1f')]?_['map'](_0x6128fb['include'],function(_0x354999){return{'model':db[_0x354999[_0x4817('0x21')]],'as':_0x354999['as'],'attributes':_0x354999[_0x4817('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4817('0x26')](function(_0x3a6d32){logger[_0x4817('0xf')](_0x4817('0x23'),_0xfa9031);logger[_0x4817('0x22')]('ShowVoiceQueue',_0xfa9031,JSON[_0x4817('0x12')](_0x3a6d32));_0x1dc87e(_0x3a6d32);})['catch'](function(_0x5ba513){logger[_0x4817('0x13')](_0x4817('0x23'),_0x5ba513[_0x4817('0x15')],_0xfa9031);_0x3e5f56(_0x4a8dce[_0x4817('0x13')](0x1f4,_0x5ba513[_0x4817('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e61ac25..963e650 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 _0x32ab=['register','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x3149b9,_0x4a7937){var _0xc1c89=function(_0x458baa){while(--_0x458baa){_0x3149b9['push'](_0x3149b9['shift']());}};_0xc1c89(++_0x4a7937);}(_0x32ab,0xba));var _0xb32a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x32ab[_0x46698a];return _0x356db0;};'use strict';var VoiceQueueEvents=require(_0xb32a('0x0'));var events=[_0xb32a('0x1'),_0xb32a('0x2'),_0xb32a('0x3')];function createListener(_0x8a2c1,_0x492ff3){return function(_0xfdfa51){_0x492ff3[_0xb32a('0x4')](_0x8a2c1,_0xfdfa51);};}function removeListener(_0x1e58b9,_0xc7c8f7){return function(){VoiceQueueEvents[_0xb32a('0x5')](_0x1e58b9,_0xc7c8f7);};}exports[_0xb32a('0x6')]=function(_0x3e0bee){for(var _0x49099a=0x0,_0x8ef115=events['length'];_0x49099a<_0x8ef115;_0x49099a++){var _0x44194f=events[_0x49099a];var _0x451b62=createListener(_0xb32a('0x7')+_0x44194f,_0x3e0bee);VoiceQueueEvents['on'](_0x44194f,_0x451b62);}}; \ No newline at end of file +var _0xce7e=['./voiceQueue.events','remove','update'];(function(_0x9a9ded,_0x2bfc4b){var _0x2fbdb0=function(_0xa1a673){while(--_0xa1a673){_0x9a9ded['push'](_0x9a9ded['shift']());}};_0x2fbdb0(++_0x2bfc4b);}(_0xce7e,0xde));var _0xece7=function(_0x38265c,_0x125cee){_0x38265c=_0x38265c-0x0;var _0x4035b0=_0xce7e[_0x38265c];return _0x4035b0;};'use strict';var VoiceQueueEvents=require(_0xece7('0x0'));var events=['save',_0xece7('0x1'),_0xece7('0x2')];function createListener(_0x369587,_0x96ea1d){return function(_0x60a64c){_0x96ea1d['emit'](_0x369587,_0x60a64c);};}function removeListener(_0x19a314,_0xb46d0c){return function(){VoiceQueueEvents['removeListener'](_0x19a314,_0xb46d0c);};}exports['register']=function(_0x2d3be1){for(var _0x1d071d=0x0,_0x20549d=events['length'];_0x1d071d<_0x20549d;_0x1d071d++){var _0x511486=events[_0x1d071d];var _0x1ea245=createListener('voiceQueue:'+_0x511486,_0x2d3be1);VoiceQueueEvents['on'](_0x511486,_0x1ea245);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8d3d6d0..7554086 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 _0x69e6=['delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','/index','getVoiceQueuesReport','/:id','update'];(function(_0x474838,_0x303114){var _0x7e2f05=function(_0x27a114){while(--_0x27a114){_0x474838['push'](_0x474838['shift']());}};_0x7e2f05(++_0x303114);}(_0x69e6,0x145));var _0x669e=function(_0x1d33d9,_0x3a1352){_0x1d33d9=_0x1d33d9-0x0;var _0x407663=_0x69e6[_0x1d33d9];return _0x407663;};'use strict';var multer=require(_0x669e('0x0'));var util=require('util');var path=require(_0x669e('0x1'));var timeout=require(_0x669e('0x2'));var express=require('express');var router=express[_0x669e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x669e('0x4'));var interaction=require(_0x669e('0x5'));var config=require(_0x669e('0x6'));var controller=require(_0x669e('0x7'));router[_0x669e('0x8')]('/',auth['isAuthenticated'](),controller[_0x669e('0x9')]);router[_0x669e('0x8')]('/describe',auth[_0x669e('0xa')](),controller['describe']);router['get'](_0x669e('0xb'),auth[_0x669e('0xa')](),controller[_0x669e('0xc')]);router[_0x669e('0x8')](_0x669e('0xd'),auth[_0x669e('0xa')](),controller['show']);router['post']('/',auth[_0x669e('0xa')](),controller['create']);router['put'](_0x669e('0xd'),auth['isAuthenticated'](),controller[_0x669e('0xe')]);router[_0x669e('0xf')](_0x669e('0xd'),auth[_0x669e('0xa')](),controller[_0x669e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x50bd=['/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x50bd,0x1ed));var _0xd50b=function(_0x4a1153,_0x2c3293){_0x4a1153=_0x4a1153-0x0;var _0x4b26d8=_0x50bd[_0x4a1153];return _0x4b26d8;};'use strict';var multer=require(_0xd50b('0x0'));var util=require(_0xd50b('0x1'));var path=require(_0xd50b('0x2'));var timeout=require(_0xd50b('0x3'));var express=require(_0xd50b('0x4'));var router=express[_0xd50b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd50b('0x6'));var interaction=require(_0xd50b('0x7'));var config=require('../../config/environment');var controller=require(_0xd50b('0x8'));router[_0xd50b('0x9')]('/',auth[_0xd50b('0xa')](),controller[_0xd50b('0xb')]);router[_0xd50b('0x9')](_0xd50b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd50b('0x9')](_0xd50b('0xd'),auth[_0xd50b('0xa')](),controller[_0xd50b('0xe')]);router[_0xd50b('0x9')](_0xd50b('0xf'),auth[_0xd50b('0xa')](),controller[_0xd50b('0x10')]);router[_0xd50b('0x11')]('/',auth['isAuthenticated'](),controller[_0xd50b('0x12')]);router[_0xd50b('0x13')](_0xd50b('0xf'),auth[_0xd50b('0xa')](),controller['update']);router[_0xd50b('0x14')](_0xd50b('0xf'),auth[_0xd50b('0xa')](),controller[_0xd50b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index a4a9ad2..aa6db5d 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 _0xde99=['seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x56a3a7,_0x369bf1){var _0x25021d=function(_0x15e6db){while(--_0x15e6db){_0x56a3a7['push'](_0x56a3a7['shift']());}};_0x25021d(++_0x369bf1);}(_0xde99,0x147));var _0x9de9=function(_0x566dd5,_0x491250){_0x566dd5=_0x566dd5-0x0;var _0x184612=_0xde99[_0x566dd5];return _0x184612;};'use strict';var Sequelize=require(_0x9de9('0x0'));var moment=require(_0x9de9('0x1'));module[_0x9de9('0x2')]={'type':{'type':Sequelize[_0x9de9('0x3')]},'uniqueid':{'type':Sequelize[_0x9de9('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9de9('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9de9('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9de9('0x4')],'set':function(_0x724b01){var _0xf4e037=moment(_0x724b01);var _0xdf6564=moment(this['getDataValue'](_0x9de9('0x5')))[_0x9de9('0x6')](_0x9de9('0x7'));var _0xb03a62=_0xf4e037[_0x9de9('0x8')](_0xdf6564,_0x9de9('0x9'));this[_0x9de9('0xa')](_0x9de9('0xb'),_0x724b01);this[_0x9de9('0xa')](_0x9de9('0xc'),_0xb03a62||null);}},'position':{'type':Sequelize[_0x9de9('0xd')]},'count':{'type':Sequelize[_0x9de9('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9de9('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9de9('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9de9('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x9de9('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9de9('0x3')]},'accountcode':{'type':Sequelize[_0x9de9('0x3')]},'context':{'type':Sequelize[_0x9de9('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x9de9('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9de9('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9de9('0x3')],'comment':_0x9de9('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9de9('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9de9('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x9de9('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x9de9('0x3')]}}; \ No newline at end of file +var _0xdcf4=['queuecallerjoinAt','format','diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','getDataValue'];(function(_0x48bce2,_0x982c2a){var _0x20e39d=function(_0x35163b){while(--_0x35163b){_0x48bce2['push'](_0x48bce2['shift']());}};_0x20e39d(++_0x982c2a);}(_0xdcf4,0x18f));var _0x4dcf=function(_0x1ae1b8,_0xf05d56){_0x1ae1b8=_0x1ae1b8-0x0;var _0x3f55de=_0xdcf4[_0x1ae1b8];return _0x3f55de;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4dcf('0x0'));module['exports']={'type':{'type':Sequelize[_0x4dcf('0x1')]},'uniqueid':{'type':Sequelize[_0x4dcf('0x1')]},'calleridnum':{'type':Sequelize[_0x4dcf('0x1')]},'calleridname':{'type':Sequelize[_0x4dcf('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x4dcf('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5a29c5){var _0x5eae0=moment(_0x5a29c5);var _0x2ef9c9=moment(this[_0x4dcf('0x3')](_0x4dcf('0x4')))[_0x4dcf('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x30ecff=_0x5eae0[_0x4dcf('0x6')](_0x2ef9c9,'seconds');this['setDataValue'](_0x4dcf('0x7'),_0x5a29c5);this[_0x4dcf('0x8')](_0x4dcf('0x9'),_0x30ecff||null);}},'position':{'type':Sequelize[_0x4dcf('0xa')]},'count':{'type':Sequelize[_0x4dcf('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x4dcf('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x4dcf('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4dcf('0x2')]},'queuecallerexit':{'type':Sequelize[_0x4dcf('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4dcf('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x4dcf('0xa')]},'channel':{'type':Sequelize[_0x4dcf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4dcf('0x1')]},'connectedlinename':{'type':Sequelize[_0x4dcf('0x1')]},'accountcode':{'type':Sequelize[_0x4dcf('0x1')]},'context':{'type':Sequelize[_0x4dcf('0x1')]},'exten':{'type':Sequelize[_0x4dcf('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4dcf('0xa')]},'mohtime':{'type':Sequelize[_0x4dcf('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4dcf('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4dcf('0x1')]},'transfer':{'type':Sequelize[_0x4dcf('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4dcf('0x1')],'comment':_0x4dcf('0xc')},'transferexten':{'type':Sequelize[_0x4dcf('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4dcf('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4dcf('0x1')]},'thirdDisposition':{'type':Sequelize[_0x4dcf('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x4dcf('0xa')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 995898d..9882b35 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 _0x0fe5=['destroy','end','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0fe5,0x16c));var _0x50fe=function(_0x312bb4,_0x221c0f){_0x312bb4=_0x312bb4-0x0;var _0x158b85=_0x0fe5[_0x312bb4];return _0x158b85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50fe('0x0'));var zipdir=require(_0x50fe('0x1'));var jsonpatch=require(_0x50fe('0x2'));var rp=require(_0x50fe('0x3'));var moment=require(_0x50fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50fe('0x5'));var util=require(_0x50fe('0x6'));var path=require(_0x50fe('0x7'));var sox=require(_0x50fe('0x8'));var csv=require(_0x50fe('0x9'));var ejs=require(_0x50fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50fe('0xb'));var squel=require(_0x50fe('0xc'));var crypto=require('crypto');var jsforce=require(_0x50fe('0xd'));var deskjs=require(_0x50fe('0xe'));var toCsv=require('to-csv');var querystring=require(_0x50fe('0xf'));var Papa=require(_0x50fe('0x10'));var Redis=require(_0x50fe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x50fe('0x12'));var as=require(_0x50fe('0x13'));var hardwareService=require(_0x50fe('0x14'));var logger=require(_0x50fe('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50fe('0x16'))['db'];config[_0x50fe('0x17')]=_[_0x50fe('0x18')](config[_0x50fe('0x17')],{'host':_0x50fe('0x19'),'port':0x18eb});var socket=require(_0x50fe('0x1a'))(new Redis(config['redis']));require(_0x50fe('0x1b'))[_0x50fe('0x1c')](socket);function respondWithStatusCode(_0x491f67,_0x2520bf){_0x2520bf=_0x2520bf||0xcc;return function(_0x455137){if(_0x455137){return _0x491f67[_0x50fe('0x1d')](_0x2520bf);}return _0x491f67[_0x50fe('0x1e')](_0x2520bf)['end']();};}function respondWithResult(_0x2d4d42,_0x2570d7){_0x2570d7=_0x2570d7||0xc8;return function(_0x564230){if(_0x564230){return _0x2d4d42[_0x50fe('0x1e')](_0x2570d7)[_0x50fe('0x1f')](_0x564230);}};}function respondWithFilteredResult(_0x343b74,_0x5718d7){return function(_0x5f4d87){if(_0x5f4d87){var _0x51dcd0=typeof _0x5718d7[_0x50fe('0x20')]===_0x50fe('0x21')&&typeof _0x5718d7[_0x50fe('0x22')]==='undefined';var _0x726fd0=_0x5f4d87[_0x50fe('0x23')];var _0xe27997=_0x51dcd0?0x0:_0x5718d7['offset'];var _0x217045=_0x51dcd0?_0x5f4d87['count']:_0x5718d7['offset']+_0x5718d7[_0x50fe('0x22')];var _0x1e8605;if(_0x217045>=_0x726fd0){_0x217045=_0x726fd0;_0x1e8605=0xc8;}else{_0x1e8605=0xce;}_0x343b74[_0x50fe('0x1e')](_0x1e8605);return _0x343b74[_0x50fe('0x24')](_0x50fe('0x25'),_0xe27997+'-'+_0x217045+'/'+_0x726fd0)[_0x50fe('0x1f')](_0x5f4d87);}return null;};}function patchUpdates(_0x2b4933){return function(_0x403f01){try{jsonpatch[_0x50fe('0x26')](_0x403f01,_0x2b4933,!![]);}catch(_0x555e33){return BPromise['reject'](_0x555e33);}return _0x403f01[_0x50fe('0x27')]();};}function saveUpdates(_0x6d5824,_0x33ace4){return function(_0x2c21a1){if(_0x2c21a1){return _0x2c21a1['update'](_0x6d5824)[_0x50fe('0x28')](function(_0x4a1752){return _0x4a1752;});}return null;};}function removeEntity(_0x5bc249,_0x5ebc87){return function(_0x32e50c){if(_0x32e50c){return _0x32e50c[_0x50fe('0x29')]()[_0x50fe('0x28')](function(){_0x5bc249[_0x50fe('0x1e')](0xcc)[_0x50fe('0x2a')]();});}};}function handleEntityNotFound(_0x1a30e8,_0x38e935){return function(_0x2c8add){if(!_0x2c8add){_0x1a30e8[_0x50fe('0x1d')](0x194);}return _0x2c8add;};}function handleError(_0x27f4cb,_0x49f709){_0x49f709=_0x49f709||0x1f4;return function(_0x11bff5){logger[_0x50fe('0x2b')](_0x11bff5['stack']);if(_0x11bff5[_0x50fe('0x2c')]){delete _0x11bff5[_0x50fe('0x2c')];}_0x27f4cb['status'](_0x49f709)[_0x50fe('0x2d')](_0x11bff5);};}exports[_0x50fe('0x2e')]=function(_0x2e350c,_0x22cd6e){var _0x2b42f8={},_0x3e0534={},_0x23f858={'count':0x0,'rows':[]};var _0x14d9d4=_[_0x50fe('0x2f')](db[_0x50fe('0x30')][_0x50fe('0x31')],function(_0x5d3aca){return{'name':_0x5d3aca['fieldName'],'type':_0x5d3aca[_0x50fe('0x32')][_0x50fe('0x33')]};});_0x3e0534[_0x50fe('0x34')]=_['map'](_0x14d9d4,_0x50fe('0x2c'));_0x3e0534['query']=_[_0x50fe('0x35')](_0x2e350c['query']);_0x3e0534[_0x50fe('0x36')]=_['intersection'](_0x3e0534['model'],_0x3e0534[_0x50fe('0x37')]);_0x2b42f8[_0x50fe('0x38')]=_[_0x50fe('0x39')](_0x3e0534[_0x50fe('0x34')],qs[_0x50fe('0x3a')](_0x2e350c[_0x50fe('0x37')]['fields']));_0x2b42f8[_0x50fe('0x38')]=_0x2b42f8[_0x50fe('0x38')][_0x50fe('0x3b')]?_0x2b42f8[_0x50fe('0x38')]:_0x3e0534[_0x50fe('0x34')];if(!_0x2e350c['query'][_0x50fe('0x3c')]('nolimit')){_0x2b42f8[_0x50fe('0x22')]=qs[_0x50fe('0x22')](_0x2e350c['query'][_0x50fe('0x22')]);_0x2b42f8[_0x50fe('0x20')]=qs[_0x50fe('0x20')](_0x2e350c[_0x50fe('0x37')][_0x50fe('0x20')]);}_0x2b42f8[_0x50fe('0x3d')]=qs[_0x50fe('0x3e')](_0x2e350c[_0x50fe('0x37')][_0x50fe('0x3e')]);_0x2b42f8[_0x50fe('0x3f')]=qs[_0x50fe('0x36')](_[_0x50fe('0x40')](_0x2e350c[_0x50fe('0x37')],_0x3e0534[_0x50fe('0x36')]),_0x14d9d4);if(_0x2e350c[_0x50fe('0x37')][_0x50fe('0x41')]){_0x2b42f8[_0x50fe('0x3f')]=_['merge'](_0x2b42f8[_0x50fe('0x3f')],{'$or':_['map'](_0x14d9d4,function(_0x5cd6c5){if(_0x5cd6c5['type']!==_0x50fe('0x42')){var _0x3aa6d8={};_0x3aa6d8[_0x5cd6c5[_0x50fe('0x2c')]]={'$like':'%'+_0x2e350c[_0x50fe('0x37')][_0x50fe('0x41')]+'%'};return _0x3aa6d8;}})});}_0x2b42f8=_[_0x50fe('0x43')]({},_0x2b42f8,_0x2e350c['options']);var _0x53c102={'where':_0x2b42f8[_0x50fe('0x3f')]};return db['VoiceQueueReport'][_0x50fe('0x23')](_0x53c102)[_0x50fe('0x28')](function(_0x7c9e72){_0x23f858[_0x50fe('0x23')]=_0x7c9e72;if(_0x2e350c[_0x50fe('0x37')][_0x50fe('0x44')]){_0x2b42f8[_0x50fe('0x45')]=[{'all':!![]}];}return db[_0x50fe('0x30')][_0x50fe('0x46')](_0x2b42f8);})[_0x50fe('0x28')](function(_0xc0a7c0){_0x23f858[_0x50fe('0x47')]=_0xc0a7c0;return _0x23f858;})['then'](respondWithFilteredResult(_0x22cd6e,_0x2b42f8))[_0x50fe('0x48')](handleError(_0x22cd6e,null));};exports[_0x50fe('0x49')]=function(_0x131d7f,_0x553a75){var _0x1424cf={'raw':![],'where':{'id':_0x131d7f['params']['id']}},_0x227571={};_0x227571[_0x50fe('0x34')]=_[_0x50fe('0x35')](db['VoiceQueueReport'][_0x50fe('0x31')]);_0x227571[_0x50fe('0x37')]=_[_0x50fe('0x35')](_0x131d7f[_0x50fe('0x37')]);_0x227571['filters']=_[_0x50fe('0x39')](_0x227571['model'],_0x227571[_0x50fe('0x37')]);_0x1424cf[_0x50fe('0x38')]=_[_0x50fe('0x39')](_0x227571['model'],qs['fields'](_0x131d7f[_0x50fe('0x37')][_0x50fe('0x3a')]));_0x1424cf[_0x50fe('0x38')]=_0x1424cf[_0x50fe('0x38')][_0x50fe('0x3b')]?_0x1424cf['attributes']:_0x227571[_0x50fe('0x34')];if(_0x131d7f['query']['includeAll']){_0x1424cf[_0x50fe('0x45')]=[{'all':!![]}];}_0x1424cf=_['merge']({},_0x1424cf,_0x131d7f['options']);return db[_0x50fe('0x30')][_0x50fe('0x4a')](_0x1424cf)[_0x50fe('0x28')](handleEntityNotFound(_0x553a75,null))[_0x50fe('0x28')](respondWithResult(_0x553a75,null))[_0x50fe('0x48')](handleError(_0x553a75,null));};exports[_0x50fe('0x4b')]=function(_0x33fefc,_0x4021ac){return db[_0x50fe('0x30')][_0x50fe('0x4b')](_0x33fefc['body'],{})['then'](respondWithResult(_0x4021ac,0xc9))[_0x50fe('0x48')](handleError(_0x4021ac,null));};exports[_0x50fe('0x4c')]=function(_0x41aba6,_0x2cbaa8){if(_0x41aba6[_0x50fe('0x4d')]['id']){delete _0x41aba6[_0x50fe('0x4d')]['id'];}return db[_0x50fe('0x30')]['find']({'where':{'id':_0x41aba6[_0x50fe('0x4e')]['id']}})[_0x50fe('0x28')](handleEntityNotFound(_0x2cbaa8,null))[_0x50fe('0x28')](saveUpdates(_0x41aba6['body'],null))['then'](respondWithResult(_0x2cbaa8,null))[_0x50fe('0x48')](handleError(_0x2cbaa8,null));};exports[_0x50fe('0x29')]=function(_0x58727d,_0x28a230){return db['VoiceQueueReport']['find']({'where':{'id':_0x58727d[_0x50fe('0x4e')]['id']}})['then'](handleEntityNotFound(_0x28a230,null))[_0x50fe('0x28')](removeEntity(_0x28a230,null))[_0x50fe('0x48')](handleError(_0x28a230,null));};exports[_0x50fe('0x4f')]=function(_0x37427d,_0x405e60){return db[_0x50fe('0x30')]['describe']()[_0x50fe('0x28')](respondWithResult(_0x405e60,null))[_0x50fe('0x48')](handleError(_0x405e60,null));};exports[_0x50fe('0x50')]=function(_0x4d3b0b,_0x5bf7ac){var _0x426835={},_0x1a18bd={},_0x2f5abe={'count':0x0,'rows':[]};_0x1a18bd[_0x50fe('0x34')]=_[_0x50fe('0x35')](db[_0x50fe('0x30')][_0x50fe('0x31')]);_0x1a18bd[_0x50fe('0x37')]=_[_0x50fe('0x35')](_0x4d3b0b['query']);_0x1a18bd[_0x50fe('0x36')]=_[_0x50fe('0x39')](_0x1a18bd[_0x50fe('0x34')],_0x1a18bd['query']);_0x426835[_0x50fe('0x38')]=_['intersection'](_0x1a18bd[_0x50fe('0x34')],qs[_0x50fe('0x3a')](_0x4d3b0b['query'][_0x50fe('0x3a')]));_0x426835['attributes']=_0x426835[_0x50fe('0x38')]['length']?_0x426835[_0x50fe('0x38')]:_0x1a18bd[_0x50fe('0x34')];if(!_0x4d3b0b['query'][_0x50fe('0x3c')]('nolimit')){_0x426835[_0x50fe('0x22')]=qs[_0x50fe('0x22')](_0x4d3b0b[_0x50fe('0x37')][_0x50fe('0x22')]);_0x426835[_0x50fe('0x20')]=qs[_0x50fe('0x20')](_0x4d3b0b[_0x50fe('0x37')]['offset']);}_0x426835[_0x50fe('0x3d')]=qs['sort'](_0x4d3b0b[_0x50fe('0x37')]['sort']);_0x426835[_0x50fe('0x3f')]=qs[_0x50fe('0x36')](_[_0x50fe('0x40')](_0x4d3b0b['query'],_0x1a18bd['filters']));if(_0x4d3b0b['query'][_0x50fe('0x41')]){_0x426835[_0x50fe('0x3f')]=_['merge'](_0x426835[_0x50fe('0x3f')],{'$or':_[_0x50fe('0x2f')](_0x426835[_0x50fe('0x38')],function(_0x48e5ee){var _0x34c7e2={};_0x34c7e2[_0x48e5ee]={'$like':'%'+_0x4d3b0b[_0x50fe('0x37')][_0x50fe('0x41')]+'%'};return _0x34c7e2;})});}_0x426835=_['merge']({},_0x426835,_0x4d3b0b['options']);var _0x332762={'where':_0x426835['where']};return db['VoiceQueueReport'][_0x50fe('0x23')](_0x332762)[_0x50fe('0x28')](function(_0x267252){_0x2f5abe[_0x50fe('0x23')]=_0x267252;if(_0x4d3b0b[_0x50fe('0x37')]['includeAll']){_0x426835[_0x50fe('0x45')]=[{'all':!![]}];}return db[_0x50fe('0x30')][_0x50fe('0x46')](_0x426835);})[_0x50fe('0x28')](function(_0x59ebf9){_0x2f5abe[_0x50fe('0x47')]=_0x59ebf9;return _0x2f5abe;})[_0x50fe('0x28')](respondWithFilteredResult(_0x5bf7ac,_0x426835,_0x50fe('0x50')))['catch'](handleError(_0x5bf7ac,null,_0x50fe('0x50')));}; \ No newline at end of file +var _0x904b=['fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueueReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x904b,0xf1));var _0xb904=function(_0x1be21c,_0x31cd4c){_0x1be21c=_0x1be21c-0x0;var _0x45a0f2=_0x904b[_0x1be21c];return _0x45a0f2;};'use strict';var emlformat=require(_0xb904('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb904('0x1'));var jsonpatch=require(_0xb904('0x2'));var rp=require('request-promise');var moment=require(_0xb904('0x3'));var BPromise=require(_0xb904('0x4'));var Mustache=require(_0xb904('0x5'));var util=require('util');var path=require(_0xb904('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb904('0x7'));var fs=require('fs');var fs_extra=require(_0xb904('0x8'));var _=require(_0xb904('0x9'));var squel=require('squel');var crypto=require(_0xb904('0xa'));var jsforce=require(_0xb904('0xb'));var deskjs=require(_0xb904('0xc'));var toCsv=require(_0xb904('0xd'));var querystring=require(_0xb904('0xe'));var Papa=require('papaparse');var Redis=require(_0xb904('0xf'));var authService=require(_0xb904('0x10'));var qs=require(_0xb904('0x11'));var as=require(_0xb904('0x12'));var hardwareService=require(_0xb904('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb904('0x14'));var db=require(_0xb904('0x15'))['db'];config[_0xb904('0x16')]=_[_0xb904('0x17')](config[_0xb904('0x16')],{'host':_0xb904('0x18'),'port':0x18eb});var socket=require(_0xb904('0x19'))(new Redis(config[_0xb904('0x16')]));require(_0xb904('0x1a'))[_0xb904('0x1b')](socket);function respondWithStatusCode(_0x4f8ccf,_0x1c1cac){_0x1c1cac=_0x1c1cac||0xcc;return function(_0x5bf13a){if(_0x5bf13a){return _0x4f8ccf[_0xb904('0x1c')](_0x1c1cac);}return _0x4f8ccf[_0xb904('0x1d')](_0x1c1cac)[_0xb904('0x1e')]();};}function respondWithResult(_0x1d5a56,_0x4bf7bc){_0x4bf7bc=_0x4bf7bc||0xc8;return function(_0x1585f8){if(_0x1585f8){return _0x1d5a56[_0xb904('0x1d')](_0x4bf7bc)[_0xb904('0x1f')](_0x1585f8);}};}function respondWithFilteredResult(_0x375f87,_0x4b59bd){return function(_0x2b4edb){if(_0x2b4edb){var _0x394f80=typeof _0x4b59bd[_0xb904('0x20')]===_0xb904('0x21')&&typeof _0x4b59bd[_0xb904('0x22')]===_0xb904('0x21');var _0x295f52=_0x2b4edb[_0xb904('0x23')];var _0x321888=_0x394f80?0x0:_0x4b59bd['offset'];var _0x296303=_0x394f80?_0x2b4edb[_0xb904('0x23')]:_0x4b59bd[_0xb904('0x20')]+_0x4b59bd['limit'];var _0x2fff13;if(_0x296303>=_0x295f52){_0x296303=_0x295f52;_0x2fff13=0xc8;}else{_0x2fff13=0xce;}_0x375f87[_0xb904('0x1d')](_0x2fff13);return _0x375f87[_0xb904('0x24')](_0xb904('0x25'),_0x321888+'-'+_0x296303+'/'+_0x295f52)[_0xb904('0x1f')](_0x2b4edb);}return null;};}function patchUpdates(_0xa2c3b){return function(_0xb050db){try{jsonpatch[_0xb904('0x26')](_0xb050db,_0xa2c3b,!![]);}catch(_0x409bfa){return BPromise[_0xb904('0x27')](_0x409bfa);}return _0xb050db[_0xb904('0x28')]();};}function saveUpdates(_0x3f78be,_0x2f1e3a){return function(_0x27069a){if(_0x27069a){return _0x27069a[_0xb904('0x29')](_0x3f78be)[_0xb904('0x2a')](function(_0x172c52){return _0x172c52;});}return null;};}function removeEntity(_0x25aa32,_0x5a2dc0){return function(_0x5c3bbc){if(_0x5c3bbc){return _0x5c3bbc[_0xb904('0x2b')]()[_0xb904('0x2a')](function(){_0x25aa32[_0xb904('0x1d')](0xcc)[_0xb904('0x1e')]();});}};}function handleEntityNotFound(_0x43c42e,_0x216a22){return function(_0xd9c1cf){if(!_0xd9c1cf){_0x43c42e[_0xb904('0x1c')](0x194);}return _0xd9c1cf;};}function handleError(_0x27bba5,_0x43dc16){_0x43dc16=_0x43dc16||0x1f4;return function(_0x2f78bf){logger[_0xb904('0x2c')](_0x2f78bf[_0xb904('0x2d')]);if(_0x2f78bf[_0xb904('0x2e')]){delete _0x2f78bf[_0xb904('0x2e')];}_0x27bba5['status'](_0x43dc16)[_0xb904('0x2f')](_0x2f78bf);};}exports['index']=function(_0x26d1b1,_0x1767fa){var _0x5e99ef={},_0x14dd44={},_0xb301cb={'count':0x0,'rows':[]};var _0x12baa5=_[_0xb904('0x30')](db[_0xb904('0x31')]['rawAttributes'],function(_0x30d518){return{'name':_0x30d518[_0xb904('0x32')],'type':_0x30d518[_0xb904('0x33')][_0xb904('0x34')]};});_0x14dd44['model']=_[_0xb904('0x30')](_0x12baa5,_0xb904('0x2e'));_0x14dd44['query']=_[_0xb904('0x35')](_0x26d1b1[_0xb904('0x36')]);_0x14dd44[_0xb904('0x37')]=_[_0xb904('0x38')](_0x14dd44[_0xb904('0x39')],_0x14dd44[_0xb904('0x36')]);_0x5e99ef[_0xb904('0x3a')]=_[_0xb904('0x38')](_0x14dd44[_0xb904('0x39')],qs['fields'](_0x26d1b1['query'][_0xb904('0x3b')]));_0x5e99ef[_0xb904('0x3a')]=_0x5e99ef['attributes'][_0xb904('0x3c')]?_0x5e99ef['attributes']:_0x14dd44[_0xb904('0x39')];if(!_0x26d1b1[_0xb904('0x36')]['hasOwnProperty'](_0xb904('0x3d'))){_0x5e99ef[_0xb904('0x22')]=qs[_0xb904('0x22')](_0x26d1b1[_0xb904('0x36')][_0xb904('0x22')]);_0x5e99ef[_0xb904('0x20')]=qs[_0xb904('0x20')](_0x26d1b1['query'][_0xb904('0x20')]);}_0x5e99ef[_0xb904('0x3e')]=qs[_0xb904('0x3f')](_0x26d1b1[_0xb904('0x36')][_0xb904('0x3f')]);_0x5e99ef['where']=qs['filters'](_[_0xb904('0x40')](_0x26d1b1[_0xb904('0x36')],_0x14dd44[_0xb904('0x37')]),_0x12baa5);if(_0x26d1b1['query'][_0xb904('0x41')]){_0x5e99ef[_0xb904('0x42')]=_['merge'](_0x5e99ef[_0xb904('0x42')],{'$or':_['map'](_0x12baa5,function(_0x51b8f4){if(_0x51b8f4['type']!=='VIRTUAL'){var _0x1d52a4={};_0x1d52a4[_0x51b8f4[_0xb904('0x2e')]]={'$like':'%'+_0x26d1b1[_0xb904('0x36')][_0xb904('0x41')]+'%'};return _0x1d52a4;}})});}_0x5e99ef=_[_0xb904('0x43')]({},_0x5e99ef,_0x26d1b1[_0xb904('0x44')]);var _0x4bc0dd={'where':_0x5e99ef[_0xb904('0x42')]};return db[_0xb904('0x31')][_0xb904('0x23')](_0x4bc0dd)[_0xb904('0x2a')](function(_0x467f91){_0xb301cb[_0xb904('0x23')]=_0x467f91;if(_0x26d1b1[_0xb904('0x36')][_0xb904('0x45')]){_0x5e99ef['include']=[{'all':!![]}];}return db[_0xb904('0x31')][_0xb904('0x46')](_0x5e99ef);})[_0xb904('0x2a')](function(_0x224a50){_0xb301cb[_0xb904('0x47')]=_0x224a50;return _0xb301cb;})[_0xb904('0x2a')](respondWithFilteredResult(_0x1767fa,_0x5e99ef))[_0xb904('0x48')](handleError(_0x1767fa,null));};exports[_0xb904('0x49')]=function(_0x33bf85,_0x5f3137){var _0x5d1395={'raw':![],'where':{'id':_0x33bf85[_0xb904('0x4a')]['id']}},_0x308bb3={};_0x308bb3[_0xb904('0x39')]=_[_0xb904('0x35')](db[_0xb904('0x31')][_0xb904('0x4b')]);_0x308bb3['query']=_[_0xb904('0x35')](_0x33bf85[_0xb904('0x36')]);_0x308bb3[_0xb904('0x37')]=_[_0xb904('0x38')](_0x308bb3['model'],_0x308bb3[_0xb904('0x36')]);_0x5d1395[_0xb904('0x3a')]=_[_0xb904('0x38')](_0x308bb3[_0xb904('0x39')],qs[_0xb904('0x3b')](_0x33bf85['query'][_0xb904('0x3b')]));_0x5d1395['attributes']=_0x5d1395['attributes']['length']?_0x5d1395[_0xb904('0x3a')]:_0x308bb3[_0xb904('0x39')];if(_0x33bf85[_0xb904('0x36')][_0xb904('0x45')]){_0x5d1395[_0xb904('0x4c')]=[{'all':!![]}];}_0x5d1395=_[_0xb904('0x43')]({},_0x5d1395,_0x33bf85['options']);return db['VoiceQueueReport'][_0xb904('0x4d')](_0x5d1395)[_0xb904('0x2a')](handleEntityNotFound(_0x5f3137,null))[_0xb904('0x2a')](respondWithResult(_0x5f3137,null))['catch'](handleError(_0x5f3137,null));};exports[_0xb904('0x4e')]=function(_0x236c3a,_0x14910d){return db[_0xb904('0x31')][_0xb904('0x4e')](_0x236c3a[_0xb904('0x4f')],{})[_0xb904('0x2a')](respondWithResult(_0x14910d,0xc9))[_0xb904('0x48')](handleError(_0x14910d,null));};exports['update']=function(_0x6ad10f,_0x350e8e){if(_0x6ad10f[_0xb904('0x4f')]['id']){delete _0x6ad10f[_0xb904('0x4f')]['id'];}return db['VoiceQueueReport'][_0xb904('0x4d')]({'where':{'id':_0x6ad10f[_0xb904('0x4a')]['id']}})[_0xb904('0x2a')](handleEntityNotFound(_0x350e8e,null))[_0xb904('0x2a')](saveUpdates(_0x6ad10f[_0xb904('0x4f')],null))['then'](respondWithResult(_0x350e8e,null))['catch'](handleError(_0x350e8e,null));};exports[_0xb904('0x2b')]=function(_0x110767,_0x2fc4b9){return db[_0xb904('0x31')]['find']({'where':{'id':_0x110767[_0xb904('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fc4b9,null))[_0xb904('0x2a')](removeEntity(_0x2fc4b9,null))[_0xb904('0x48')](handleError(_0x2fc4b9,null));};exports[_0xb904('0x50')]=function(_0x3b32cd,_0x388109){return db[_0xb904('0x31')][_0xb904('0x50')]()[_0xb904('0x2a')](respondWithResult(_0x388109,null))[_0xb904('0x48')](handleError(_0x388109,null));};exports[_0xb904('0x51')]=function(_0x2a3f12,_0x59985f){var _0xc4651c={},_0xa00e4={},_0x34095c={'count':0x0,'rows':[]};_0xa00e4['model']=_[_0xb904('0x35')](db['VoiceQueueReport'][_0xb904('0x4b')]);_0xa00e4[_0xb904('0x36')]=_['keys'](_0x2a3f12[_0xb904('0x36')]);_0xa00e4[_0xb904('0x37')]=_['intersection'](_0xa00e4[_0xb904('0x39')],_0xa00e4[_0xb904('0x36')]);_0xc4651c[_0xb904('0x3a')]=_[_0xb904('0x38')](_0xa00e4[_0xb904('0x39')],qs[_0xb904('0x3b')](_0x2a3f12[_0xb904('0x36')][_0xb904('0x3b')]));_0xc4651c[_0xb904('0x3a')]=_0xc4651c[_0xb904('0x3a')][_0xb904('0x3c')]?_0xc4651c[_0xb904('0x3a')]:_0xa00e4['model'];if(!_0x2a3f12['query'][_0xb904('0x52')](_0xb904('0x3d'))){_0xc4651c[_0xb904('0x22')]=qs[_0xb904('0x22')](_0x2a3f12[_0xb904('0x36')][_0xb904('0x22')]);_0xc4651c[_0xb904('0x20')]=qs['offset'](_0x2a3f12[_0xb904('0x36')][_0xb904('0x20')]);}_0xc4651c['order']=qs[_0xb904('0x3f')](_0x2a3f12[_0xb904('0x36')]['sort']);_0xc4651c[_0xb904('0x42')]=qs['filters'](_['pick'](_0x2a3f12[_0xb904('0x36')],_0xa00e4['filters']));if(_0x2a3f12[_0xb904('0x36')]['filter']){_0xc4651c['where']=_[_0xb904('0x43')](_0xc4651c[_0xb904('0x42')],{'$or':_['map'](_0xc4651c['attributes'],function(_0x2fa0b7){var _0x482cc9={};_0x482cc9[_0x2fa0b7]={'$like':'%'+_0x2a3f12['query'][_0xb904('0x41')]+'%'};return _0x482cc9;})});}_0xc4651c=_[_0xb904('0x43')]({},_0xc4651c,_0x2a3f12['options']);var _0x842a7b={'where':_0xc4651c[_0xb904('0x42')]};return db[_0xb904('0x31')]['count'](_0x842a7b)[_0xb904('0x2a')](function(_0x2e6abb){_0x34095c['count']=_0x2e6abb;if(_0x2a3f12[_0xb904('0x36')][_0xb904('0x45')]){_0xc4651c[_0xb904('0x4c')]=[{'all':!![]}];}return db[_0xb904('0x31')][_0xb904('0x46')](_0xc4651c);})[_0xb904('0x2a')](function(_0x5d6ce2){_0x34095c[_0xb904('0x47')]=_0x5d6ce2;return _0x34095c;})[_0xb904('0x2a')](respondWithFilteredResult(_0x59985f,_0xc4651c,_0xb904('0x51')))['catch'](handleError(_0x59985f,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 6c0b7c4..922b99a 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 _0xd7a3=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd7a3,0x1b4));var _0x3d7a=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xd7a3[_0x543084];return _0x306a57;};'use strict';var EventEmitter=require(_0x3d7a('0x0'));var VoiceQueueReport=require(_0x3d7a('0x1'))['db'][_0x3d7a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3d7a('0x3')](0x0);var events={'afterCreate':_0x3d7a('0x4'),'afterUpdate':_0x3d7a('0x5'),'afterDestroy':_0x3d7a('0x6')};function emitEvent(_0x2b61a0){return function(_0xe147ae,_0x5d3826,_0x5b214a){VoiceQueueReportEvents[_0x3d7a('0x7')](_0x2b61a0+':'+_0xe147ae['id'],_0xe147ae);VoiceQueueReportEvents[_0x3d7a('0x7')](_0x2b61a0,_0xe147ae);_0x5b214a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x3d7a('0x8')](e,emitEvent(event));}}module[_0x3d7a('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x529e=['VoiceQueueReport','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x53465b,_0x5d00a3){var _0x4592ed=function(_0x23c0b6){while(--_0x23c0b6){_0x53465b['push'](_0x53465b['shift']());}};_0x4592ed(++_0x5d00a3);}(_0x529e,0x1b7));var _0xe529=function(_0x5a0816,_0x1def19){_0x5a0816=_0x5a0816-0x0;var _0xd6f370=_0x529e[_0x5a0816];return _0xd6f370;};'use strict';var EventEmitter=require(_0xe529('0x0'));var VoiceQueueReport=require(_0xe529('0x1'))['db'][_0xe529('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe529('0x3'),'afterUpdate':_0xe529('0x4'),'afterDestroy':_0xe529('0x5')};function emitEvent(_0x243611){return function(_0x17b748,_0x11f44c,_0x114c83){VoiceQueueReportEvents[_0xe529('0x6')](_0x243611+':'+_0x17b748['id'],_0x17b748);VoiceQueueReportEvents[_0xe529('0x6')](_0x243611,_0x17b748);_0x114c83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe529('0x7')](e,emitEvent(event));}}module[_0xe529('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 1b0b24b..3d58bd6 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 _0xcc4e=['path','../../config/environment','exports','define','VoiceQueueReport','report_queue','lodash','util','api','moment','request-promise'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xcc4e,0x19d));var _0xecc4=function(_0x507d23,_0x558746){_0x507d23=_0x507d23-0x0;var _0x378187=_0xcc4e[_0x507d23];return _0x378187;};'use strict';var _=require(_0xecc4('0x0'));var util=require(_0xecc4('0x1'));var logger=require('../../config/logger')(_0xecc4('0x2'));var moment=require(_0xecc4('0x3'));var BPromise=require('bluebird');var rp=require(_0xecc4('0x4'));var fs=require('fs');var path=require(_0xecc4('0x5'));var rimraf=require('rimraf');var config=require(_0xecc4('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xecc4('0x7')]=function(_0x34e82c,_0x4a28b7){return _0x34e82c[_0xecc4('0x8')](_0xecc4('0x9'),attributes,{'tableName':_0xecc4('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9584=['define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports'];(function(_0x24e746,_0x5180c2){var _0x1acdfa=function(_0x2407cb){while(--_0x2407cb){_0x24e746['push'](_0x24e746['shift']());}};_0x1acdfa(++_0x5180c2);}(_0x9584,0x1cb));var _0x4958=function(_0x44ba3b,_0x5b4f4d){_0x44ba3b=_0x44ba3b-0x0;var _0x5e4502=_0x9584[_0x44ba3b];return _0x5e4502;};'use strict';var _=require(_0x4958('0x0'));var util=require(_0x4958('0x1'));var logger=require(_0x4958('0x2'))('api');var moment=require(_0x4958('0x3'));var BPromise=require(_0x4958('0x4'));var rp=require(_0x4958('0x5'));var fs=require('fs');var path=require(_0x4958('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4958('0x7'));module[_0x4958('0x8')]=function(_0x4c28ea,_0x3749a0){return _0x4c28ea[_0x4958('0x9')](_0x4958('0xa'),attributes,{'tableName':_0x4958('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x4958('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 737dfea..5bf7e64 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 _0x98dd=['body','update','limit','UpdateVoiceQueueReport','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','include','map','model','attributes','info','CreateVoiceQueueReport'];(function(_0x105a4b,_0x293d3e){var _0x2c8659=function(_0x3c8f17){while(--_0x3c8f17){_0x105a4b['push'](_0x105a4b['shift']());}};_0x2c8659(++_0x293d3e);}(_0x98dd,0x11c));var _0xd98d=function(_0x52d17b,_0x56218d){_0x52d17b=_0x52d17b-0x0;var _0x3d0ddd=_0x98dd[_0x52d17b];return _0x3d0ddd;};'use strict';var _=require(_0xd98d('0x0'));var util=require(_0xd98d('0x1'));var moment=require(_0xd98d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd98d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd98d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd98d('0x5'));var jayson=require(_0xd98d('0x6'));var client=jayson[_0xd98d('0x7')][_0xd98d('0x8')]({'port':0x232a});config['redis']=_[_0xd98d('0x9')](config[_0xd98d('0xa')],{'host':_0xd98d('0xb'),'port':0x18eb});var socket=require(_0xd98d('0xc'))(new Redis(config[_0xd98d('0xa')]));require(_0xd98d('0xd'))[_0xd98d('0xe')](socket);function respondWithRpcPromise(_0x10f026,_0x25c1ce,_0x4b5414){return new BPromise(function(_0x4e7374,_0x215131){return client[_0xd98d('0xf')](_0x10f026,_0x4b5414)[_0xd98d('0x10')](function(_0x1ad662){logger['info'](_0xd98d('0x11'),_0x25c1ce,_0xd98d('0x12'));logger[_0xd98d('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x25c1ce,_0xd98d('0x12'),JSON[_0xd98d('0x14')](_0x1ad662));if(_0x1ad662[_0xd98d('0x15')]){if(_0x1ad662['error'][_0xd98d('0x16')]===0x1f4){logger[_0xd98d('0x15')](_0xd98d('0x11'),_0x25c1ce,_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);return _0x215131(_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);}logger[_0xd98d('0x15')](_0xd98d('0x11'),_0x25c1ce,_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);return _0x4e7374(_0x1ad662[_0xd98d('0x15')][_0xd98d('0x17')]);}else{logger['info'](_0xd98d('0x11'),_0x25c1ce,_0xd98d('0x12'));_0x4e7374(_0x1ad662[_0xd98d('0x18')][_0xd98d('0x17')]);}})['catch'](function(_0xf6fedd){logger[_0xd98d('0x15')](_0xd98d('0x11'),_0x25c1ce,_0xf6fedd);_0x215131(_0xf6fedd);});});}exports[_0xd98d('0x19')]=function(_0x1dee1c){var _0x15e515=this;return new Promise(function(_0x528e26,_0x10ac83){return db[_0xd98d('0x1a')]['findAll']({'raw':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c[_0xd98d('0x1b')][_0xd98d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c['options'][_0xd98d('0x1d')]||null:null,'attributes':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c[_0xd98d('0x1b')]['attributes']||null:null,'limit':_0x1dee1c[_0xd98d('0x1b')]?_0x1dee1c[_0xd98d('0x1b')]['limit']||null:null,'include':_0x1dee1c['options']?_0x1dee1c[_0xd98d('0x1b')][_0xd98d('0x1e')]?_[_0xd98d('0x1f')](_0x1dee1c['options'][_0xd98d('0x1e')],function(_0x491821){return{'model':db[_0x491821[_0xd98d('0x20')]],'as':_0x491821['as'],'attributes':_0x491821[_0xd98d('0x21')],'include':_0x491821[_0xd98d('0x1e')]?_[_0xd98d('0x1f')](_0x491821['include'],function(_0x3f4ff6){return{'model':db[_0x3f4ff6['model']],'as':_0x3f4ff6['as'],'attributes':_0x3f4ff6[_0xd98d('0x21')],'include':_0x3f4ff6[_0xd98d('0x1e')]?_[_0xd98d('0x1f')](_0x3f4ff6[_0xd98d('0x1e')],function(_0x392d87){return{'model':db[_0x392d87[_0xd98d('0x20')]],'as':_0x392d87['as'],'attributes':_0x392d87[_0xd98d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd98d('0x10')](function(_0x45110c){logger[_0xd98d('0x22')](_0xd98d('0x19'),_0x1dee1c);logger[_0xd98d('0x13')](_0xd98d('0x19'),_0x1dee1c,JSON[_0xd98d('0x14')](_0x45110c));_0x528e26(_0x45110c);})['catch'](function(_0x7cbead){logger[_0xd98d('0x15')](_0xd98d('0x19'),_0x7cbead[_0xd98d('0x17')],_0x1dee1c);_0x10ac83(_0x15e515['error'](0x1f4,_0x7cbead[_0xd98d('0x17')]));});});};exports[_0xd98d('0x23')]=function(_0x44da2d){var _0x1f8fa4=this;return new Promise(function(_0xd37b7d,_0x1d2fad){return db[_0xd98d('0x1a')]['create'](_0x44da2d[_0xd98d('0x24')],{'raw':_0x44da2d['options']?_0x44da2d[_0xd98d('0x1b')][_0xd98d('0x1c')]===undefined?!![]:![]:!![]})[_0xd98d('0x10')](function(_0x474296){logger['info']('CreateVoiceQueueReport',_0x44da2d);logger[_0xd98d('0x13')](_0xd98d('0x23'),_0x44da2d,JSON[_0xd98d('0x14')](_0x474296));_0xd37b7d(_0x474296);})['catch'](function(_0x16b5f4){logger[_0xd98d('0x15')](_0xd98d('0x23'),_0x16b5f4[_0xd98d('0x17')],_0x44da2d);_0x1d2fad(_0x1f8fa4[_0xd98d('0x15')](0x1f4,_0x16b5f4[_0xd98d('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4a81f2){var _0x2d15d3=this;return new Promise(function(_0x50965c,_0x48d3f9){return db[_0xd98d('0x1a')][_0xd98d('0x25')](_0x4a81f2['body'],{'raw':_0x4a81f2[_0xd98d('0x1b')]?_0x4a81f2[_0xd98d('0x1b')][_0xd98d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a81f2['options']?_0x4a81f2[_0xd98d('0x1b')]['where']||null:null,'attributes':_0x4a81f2[_0xd98d('0x1b')]?_0x4a81f2[_0xd98d('0x1b')][_0xd98d('0x21')]||null:null,'limit':_0x4a81f2[_0xd98d('0x1b')]?_0x4a81f2[_0xd98d('0x1b')][_0xd98d('0x26')]||null:null})[_0xd98d('0x10')](function(_0x44ccd6){logger[_0xd98d('0x22')](_0xd98d('0x27'),_0x4a81f2);logger['debug']('UpdateVoiceQueueReport',_0x4a81f2,JSON['stringify'](_0x44ccd6));_0x50965c(_0x44ccd6);})['catch'](function(_0x5dd5aa){logger[_0xd98d('0x15')](_0xd98d('0x27'),_0x5dd5aa['message'],_0x4a81f2);_0x48d3f9(_0x2d15d3[_0xd98d('0x15')](0x1f4,_0x5dd5aa[_0xd98d('0x17')]));});});}; \ No newline at end of file +var _0x1cbd=['GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0x1cbd,0x1a5));var _0xd1cb=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x1cbd[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0xd1cb('0x0'));var util=require(_0xd1cb('0x1'));var moment=require('moment');var BPromise=require(_0xd1cb('0x2'));var rs=require(_0xd1cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1cb('0x4'))['db'];var utils=require(_0xd1cb('0x5'));var logger=require(_0xd1cb('0x6'))('rpc');var config=require(_0xd1cb('0x7'));var jayson=require(_0xd1cb('0x8'));var client=jayson[_0xd1cb('0x9')][_0xd1cb('0xa')]({'port':0x232a});config[_0xd1cb('0xb')]=_[_0xd1cb('0xc')](config[_0xd1cb('0xb')],{'host':_0xd1cb('0xd'),'port':0x18eb});var socket=require(_0xd1cb('0xe'))(new Redis(config[_0xd1cb('0xb')]));require(_0xd1cb('0xf'))[_0xd1cb('0x10')](socket);function respondWithRpcPromise(_0x38403b,_0x393c15,_0x1282f6){return new BPromise(function(_0x2f6723,_0x5a79f9){return client[_0xd1cb('0x11')](_0x38403b,_0x1282f6)[_0xd1cb('0x12')](function(_0x5c4ba9){logger[_0xd1cb('0x13')](_0xd1cb('0x14'),_0x393c15,_0xd1cb('0x15'));logger[_0xd1cb('0x16')](_0xd1cb('0x17'),_0x393c15,'request\x20sent',JSON[_0xd1cb('0x18')](_0x5c4ba9));if(_0x5c4ba9[_0xd1cb('0x19')]){if(_0x5c4ba9['error'][_0xd1cb('0x1a')]===0x1f4){logger[_0xd1cb('0x19')](_0xd1cb('0x14'),_0x393c15,_0x5c4ba9[_0xd1cb('0x19')][_0xd1cb('0x1b')]);return _0x5a79f9(_0x5c4ba9['error'][_0xd1cb('0x1b')]);}logger[_0xd1cb('0x19')](_0xd1cb('0x14'),_0x393c15,_0x5c4ba9[_0xd1cb('0x19')][_0xd1cb('0x1b')]);return _0x2f6723(_0x5c4ba9['error'][_0xd1cb('0x1b')]);}else{logger[_0xd1cb('0x13')](_0xd1cb('0x14'),_0x393c15,_0xd1cb('0x15'));_0x2f6723(_0x5c4ba9[_0xd1cb('0x1c')]['message']);}})['catch'](function(_0x5226c6){logger[_0xd1cb('0x19')](_0xd1cb('0x14'),_0x393c15,_0x5226c6);_0x5a79f9(_0x5226c6);});});}exports['GetVoiceQueueReport']=function(_0x5bf19e){var _0x1f5fdc=this;return new Promise(function(_0x2db118,_0x3b64bd){return db[_0xd1cb('0x1d')][_0xd1cb('0x1e')]({'raw':_0x5bf19e[_0xd1cb('0x1f')]?_0x5bf19e[_0xd1cb('0x1f')][_0xd1cb('0x20')]===undefined?!![]:![]:!![],'where':_0x5bf19e[_0xd1cb('0x1f')]?_0x5bf19e[_0xd1cb('0x1f')][_0xd1cb('0x21')]||null:null,'attributes':_0x5bf19e[_0xd1cb('0x1f')]?_0x5bf19e[_0xd1cb('0x1f')][_0xd1cb('0x22')]||null:null,'limit':_0x5bf19e[_0xd1cb('0x1f')]?_0x5bf19e[_0xd1cb('0x1f')][_0xd1cb('0x23')]||null:null,'include':_0x5bf19e[_0xd1cb('0x1f')]?_0x5bf19e[_0xd1cb('0x1f')][_0xd1cb('0x24')]?_['map'](_0x5bf19e[_0xd1cb('0x1f')][_0xd1cb('0x24')],function(_0x426a5a){return{'model':db[_0x426a5a[_0xd1cb('0x25')]],'as':_0x426a5a['as'],'attributes':_0x426a5a[_0xd1cb('0x22')],'include':_0x426a5a['include']?_[_0xd1cb('0x26')](_0x426a5a[_0xd1cb('0x24')],function(_0x397895){return{'model':db[_0x397895[_0xd1cb('0x25')]],'as':_0x397895['as'],'attributes':_0x397895[_0xd1cb('0x22')],'include':_0x397895[_0xd1cb('0x24')]?_[_0xd1cb('0x26')](_0x397895[_0xd1cb('0x24')],function(_0x2b8fe9){return{'model':db[_0x2b8fe9[_0xd1cb('0x25')]],'as':_0x2b8fe9['as'],'attributes':_0x2b8fe9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1cb('0x12')](function(_0x1771e4){logger['info'](_0xd1cb('0x27'),_0x5bf19e);logger[_0xd1cb('0x16')](_0xd1cb('0x27'),_0x5bf19e,JSON[_0xd1cb('0x18')](_0x1771e4));_0x2db118(_0x1771e4);})[_0xd1cb('0x28')](function(_0x566ea9){logger[_0xd1cb('0x19')](_0xd1cb('0x27'),_0x566ea9['message'],_0x5bf19e);_0x3b64bd(_0x1f5fdc['error'](0x1f4,_0x566ea9[_0xd1cb('0x1b')]));});});};exports[_0xd1cb('0x29')]=function(_0x303e5b){var _0x55b02a=this;return new Promise(function(_0x3e579a,_0x29a329){return db[_0xd1cb('0x1d')][_0xd1cb('0x2a')](_0x303e5b[_0xd1cb('0x2b')],{'raw':_0x303e5b[_0xd1cb('0x1f')]?_0x303e5b[_0xd1cb('0x1f')][_0xd1cb('0x20')]===undefined?!![]:![]:!![]})[_0xd1cb('0x12')](function(_0x3c5de1){logger[_0xd1cb('0x13')](_0xd1cb('0x29'),_0x303e5b);logger[_0xd1cb('0x16')](_0xd1cb('0x29'),_0x303e5b,JSON[_0xd1cb('0x18')](_0x3c5de1));_0x3e579a(_0x3c5de1);})[_0xd1cb('0x28')](function(_0x1f6e66){logger[_0xd1cb('0x19')]('CreateVoiceQueueReport',_0x1f6e66['message'],_0x303e5b);_0x29a329(_0x55b02a[_0xd1cb('0x19')](0x1f4,_0x1f6e66['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x7dfbe2){var _0x961099=this;return new Promise(function(_0x2d7137,_0x3695ca){return db[_0xd1cb('0x1d')][_0xd1cb('0x2c')](_0x7dfbe2['body'],{'raw':_0x7dfbe2[_0xd1cb('0x1f')]?_0x7dfbe2[_0xd1cb('0x1f')][_0xd1cb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7dfbe2['options']?_0x7dfbe2[_0xd1cb('0x1f')][_0xd1cb('0x21')]||null:null,'attributes':_0x7dfbe2[_0xd1cb('0x1f')]?_0x7dfbe2[_0xd1cb('0x1f')][_0xd1cb('0x22')]||null:null,'limit':_0x7dfbe2['options']?_0x7dfbe2[_0xd1cb('0x1f')][_0xd1cb('0x23')]||null:null})['then'](function(_0x193e22){logger['info'](_0xd1cb('0x2d'),_0x7dfbe2);logger[_0xd1cb('0x16')](_0xd1cb('0x2d'),_0x7dfbe2,JSON[_0xd1cb('0x18')](_0x193e22));_0x2d7137(_0x193e22);})['catch'](function(_0x27ee6c){logger[_0xd1cb('0x19')](_0xd1cb('0x2d'),_0x27ee6c[_0xd1cb('0x1b')],_0x7dfbe2);_0x3695ca(_0x961099[_0xd1cb('0x19')](0x1f4,_0x27ee6c[_0xd1cb('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e2defbd..f94cacd 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 _0xece0=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','update'];(function(_0x28ea3b,_0x13d7a1){var _0x5ac766=function(_0x1ea77b){while(--_0x1ea77b){_0x28ea3b['push'](_0x28ea3b['shift']());}};_0x5ac766(++_0x13d7a1);}(_0xece0,0xa5));var _0x0ece=function(_0x16d138,_0x3f1d49){_0x16d138=_0x16d138-0x0;var _0x30a98d=_0xece0[_0x16d138];return _0x30a98d;};'use strict';var VoiceQueueReportEvents=require(_0x0ece('0x0'));var events=[_0x0ece('0x1'),'remove',_0x0ece('0x2')];function createListener(_0x42a41c,_0x5304fa){return function(_0x116fb3){_0x5304fa[_0x0ece('0x3')](_0x42a41c,_0x116fb3);};}function removeListener(_0xc9c26b,_0x5f1c86){return function(){VoiceQueueReportEvents['removeListener'](_0xc9c26b,_0x5f1c86);};}exports[_0x0ece('0x4')]=function(_0x3a107d){for(var _0xb736f9=0x0,_0x22ffca=events[_0x0ece('0x5')];_0xb736f9<_0x22ffca;_0xb736f9++){var _0x1de5cd=events[_0xb736f9];var _0x41dae7=createListener(_0x0ece('0x6')+_0x1de5cd,_0x3a107d);VoiceQueueReportEvents['on'](_0x1de5cd,_0x41dae7);}}; \ No newline at end of file +var _0x8ccc=['voiceQueueReport:','./voiceQueueReport.events','update','removeListener','register','length'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x8ccc,0x16f));var _0xc8cc=function(_0xb573fa,_0x3b97b0){_0xb573fa=_0xb573fa-0x0;var _0x35467a=_0x8ccc[_0xb573fa];return _0x35467a;};'use strict';var VoiceQueueReportEvents=require(_0xc8cc('0x0'));var events=['save','remove',_0xc8cc('0x1')];function createListener(_0x547a31,_0x4e17c1){return function(_0x33bb3e){_0x4e17c1['emit'](_0x547a31,_0x33bb3e);};}function removeListener(_0x65c502,_0x2847b0){return function(){VoiceQueueReportEvents[_0xc8cc('0x2')](_0x65c502,_0x2847b0);};}exports[_0xc8cc('0x3')]=function(_0x21488f){for(var _0x5764cc=0x0,_0x51ca6c=events[_0xc8cc('0x4')];_0x5764cc<_0x51ca6c;_0x5764cc++){var _0x3e26d4=events[_0x5764cc];var _0x46a646=createListener(_0xc8cc('0x5')+_0x3e26d4,_0x21488f);VoiceQueueReportEvents['on'](_0x3e26d4,_0x46a646);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c175880..771e206 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 _0xb2e6=['../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1b453b,_0x29fc28){var _0x5ee47a=function(_0x107cd1){while(--_0x107cd1){_0x1b453b['push'](_0x1b453b['shift']());}};_0x5ee47a(++_0x29fc28);}(_0xb2e6,0x1c6));var _0x6b2e=function(_0x4dff32,_0x2d45fc){_0x4dff32=_0x4dff32-0x0;var _0x337d8d=_0xb2e6[_0x4dff32];return _0x337d8d;};'use strict';var multer=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var path=require(_0x6b2e('0x2'));var timeout=require(_0x6b2e('0x3'));var express=require('express');var router=express[_0x6b2e('0x4')]();var fs_extra=require(_0x6b2e('0x5'));var auth=require(_0x6b2e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b2e('0x7'));var controller=require(_0x6b2e('0x8'));router[_0x6b2e('0x9')]('/',auth[_0x6b2e('0xa')](),controller[_0x6b2e('0xb')]);router[_0x6b2e('0x9')](_0x6b2e('0xc'),auth['isAuthenticated'](),controller[_0x6b2e('0xd')]);router[_0x6b2e('0xe')]('/',auth[_0x6b2e('0xa')](),controller[_0x6b2e('0xf')]);router[_0x6b2e('0x10')](_0x6b2e('0xc'),auth[_0x6b2e('0xa')](),controller[_0x6b2e('0x11')]);router[_0x6b2e('0x12')](_0x6b2e('0xc'),auth['isAuthenticated'](),controller[_0x6b2e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x572b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0x572b,0x1b2));var _0xb572=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0x572b[_0x4d8a8f];return _0xfc4adc;};'use strict';var multer=require(_0xb572('0x0'));var util=require(_0xb572('0x1'));var path=require(_0xb572('0x2'));var timeout=require(_0xb572('0x3'));var express=require(_0xb572('0x4'));var router=express['Router']();var fs_extra=require(_0xb572('0x5'));var auth=require(_0xb572('0x6'));var interaction=require(_0xb572('0x7'));var config=require('../../config/environment');var controller=require(_0xb572('0x8'));router[_0xb572('0x9')]('/',auth[_0xb572('0xa')](),controller[_0xb572('0xb')]);router[_0xb572('0x9')](_0xb572('0xc'),auth[_0xb572('0xa')](),controller[_0xb572('0xd')]);router[_0xb572('0xe')]('/',auth[_0xb572('0xa')](),controller['create']);router[_0xb572('0xf')]('/:id',auth[_0xb572('0xa')](),controller[_0xb572('0x10')]);router['delete']('/:id',auth[_0xb572('0xa')](),controller[_0xb572('0x11')]);module[_0xb572('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 55be61c..d53fdaf 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 _0xb3c6=['moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x25752d,_0x2587e5){var _0x4eccbb=function(_0x4b7eac){while(--_0x4b7eac){_0x25752d['push'](_0x25752d['shift']());}};_0x4eccbb(++_0x2587e5);}(_0xb3c6,0x10e));var _0x6b3c=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0xb3c6[_0x575057];return _0x49dbc8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6b3c('0x0'));module[_0x6b3c('0x1')]={'time':{'type':Sequelize[_0x6b3c('0x2')]},'callid':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6b3c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6b3c('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x6b3c('0x4')](_0x6b3c('0x5'))}}; \ No newline at end of file +var _0xd8b9=['STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x14b181,_0x215428){var _0x395be2=function(_0x47d301){while(--_0x47d301){_0x14b181['push'](_0x14b181['shift']());}};_0x395be2(++_0x215428);}(_0xd8b9,0xdf));var _0x9d8b=function(_0x3ffc49,_0x8b7ab2){_0x3ffc49=_0x3ffc49-0x0;var _0x9ce54c=_0xd8b9[_0x3ffc49];return _0x9ce54c;};'use strict';var Sequelize=require(_0x9d8b('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x9d8b('0x1')]},'callid':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9d8b('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9d8b('0x2')](_0x9d8b('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 42427e1..d05b349 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 _0x8726=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','rows','params','include','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','stack','name','send','VoiceQueuesLog','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length'];(function(_0x508a80,_0x2dfd88){var _0x287832=function(_0x370e14){while(--_0x370e14){_0x508a80['push'](_0x508a80['shift']());}};_0x287832(++_0x2dfd88);}(_0x8726,0x16f));var _0x6872=function(_0x14a1ab,_0x2b09f3){_0x14a1ab=_0x14a1ab-0x0;var _0x508777=_0x8726[_0x14a1ab];return _0x508777;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6872('0x0'));var zipdir=require(_0x6872('0x1'));var jsonpatch=require(_0x6872('0x2'));var rp=require(_0x6872('0x3'));var moment=require(_0x6872('0x4'));var BPromise=require(_0x6872('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6872('0x6'));var sox=require(_0x6872('0x7'));var csv=require(_0x6872('0x8'));var ejs=require(_0x6872('0x9'));var fs=require('fs');var fs_extra=require(_0x6872('0xa'));var _=require('lodash');var squel=require(_0x6872('0xb'));var crypto=require(_0x6872('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6872('0xd'));var toCsv=require(_0x6872('0x8'));var querystring=require(_0x6872('0xe'));var Papa=require(_0x6872('0xf'));var Redis=require(_0x6872('0x10'));var authService=require(_0x6872('0x11'));var qs=require(_0x6872('0x12'));var as=require(_0x6872('0x13'));var hardwareService=require(_0x6872('0x14'));var logger=require('../../config/logger')(_0x6872('0x15'));var utils=require(_0x6872('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6872('0x17'))['db'];function respondWithStatusCode(_0x272bc6,_0x25cd81){_0x25cd81=_0x25cd81||0xcc;return function(_0x3dc80b){if(_0x3dc80b){return _0x272bc6[_0x6872('0x18')](_0x25cd81);}return _0x272bc6[_0x6872('0x19')](_0x25cd81)[_0x6872('0x1a')]();};}function respondWithResult(_0x4fdd1,_0x49565a){_0x49565a=_0x49565a||0xc8;return function(_0x7571cf){if(_0x7571cf){return _0x4fdd1[_0x6872('0x19')](_0x49565a)[_0x6872('0x1b')](_0x7571cf);}};}function respondWithFilteredResult(_0x4f92ff,_0x3cf492){return function(_0x548c59){if(_0x548c59){var _0x121843=typeof _0x3cf492[_0x6872('0x1c')]===_0x6872('0x1d')&&typeof _0x3cf492['limit']===_0x6872('0x1d');var _0x170ab8=_0x548c59[_0x6872('0x1e')];var _0x21265a=_0x121843?0x0:_0x3cf492[_0x6872('0x1c')];var _0x1e934b=_0x121843?_0x548c59['count']:_0x3cf492[_0x6872('0x1c')]+_0x3cf492[_0x6872('0x1f')];var _0x2402c9;if(_0x1e934b>=_0x170ab8){_0x1e934b=_0x170ab8;_0x2402c9=0xc8;}else{_0x2402c9=0xce;}_0x4f92ff[_0x6872('0x19')](_0x2402c9);return _0x4f92ff[_0x6872('0x20')]('Content-Range',_0x21265a+'-'+_0x1e934b+'/'+_0x170ab8)[_0x6872('0x1b')](_0x548c59);}return null;};}function patchUpdates(_0x216c4f){return function(_0x17f0bf){try{jsonpatch[_0x6872('0x21')](_0x17f0bf,_0x216c4f,!![]);}catch(_0x57d4e8){return BPromise[_0x6872('0x22')](_0x57d4e8);}return _0x17f0bf['save']();};}function saveUpdates(_0x336007,_0x406723){return function(_0x599b98){if(_0x599b98){return _0x599b98[_0x6872('0x23')](_0x336007)[_0x6872('0x24')](function(_0x2abb5a){return _0x2abb5a;});}return null;};}function removeEntity(_0x3c803e,_0x203e66){return function(_0x276912){if(_0x276912){return _0x276912['destroy']()[_0x6872('0x24')](function(){_0x3c803e[_0x6872('0x19')](0xcc)[_0x6872('0x1a')]();});}};}function handleEntityNotFound(_0x2359a9,_0x56c27b){return function(_0x269724){if(!_0x269724){_0x2359a9[_0x6872('0x18')](0x194);}return _0x269724;};}function handleError(_0x4a9217,_0x50374c){_0x50374c=_0x50374c||0x1f4;return function(_0x2b8ec1){logger['error'](_0x2b8ec1[_0x6872('0x25')]);if(_0x2b8ec1[_0x6872('0x26')]){delete _0x2b8ec1[_0x6872('0x26')];}_0x4a9217[_0x6872('0x19')](_0x50374c)[_0x6872('0x27')](_0x2b8ec1);};}exports['index']=function(_0x22f3d2,_0x29b8fc){var _0x2807ec={},_0x14efb7={},_0x3804ff={'count':0x0,'rows':[]};var _0x20aea8=_['map'](db[_0x6872('0x28')][_0x6872('0x29')],function(_0x19cb3d){return{'name':_0x19cb3d['fieldName'],'type':_0x19cb3d[_0x6872('0x2a')][_0x6872('0x2b')]};});_0x14efb7[_0x6872('0x2c')]=_[_0x6872('0x2d')](_0x20aea8,_0x6872('0x26'));_0x14efb7[_0x6872('0x2e')]=_[_0x6872('0x2f')](_0x22f3d2['query']);_0x14efb7[_0x6872('0x30')]=_['intersection'](_0x14efb7[_0x6872('0x2c')],_0x14efb7['query']);_0x2807ec[_0x6872('0x31')]=_[_0x6872('0x32')](_0x14efb7[_0x6872('0x2c')],qs[_0x6872('0x33')](_0x22f3d2[_0x6872('0x2e')][_0x6872('0x33')]));_0x2807ec[_0x6872('0x31')]=_0x2807ec[_0x6872('0x31')][_0x6872('0x34')]?_0x2807ec['attributes']:_0x14efb7[_0x6872('0x2c')];if(!_0x22f3d2[_0x6872('0x2e')][_0x6872('0x35')](_0x6872('0x36'))){_0x2807ec[_0x6872('0x1f')]=qs[_0x6872('0x1f')](_0x22f3d2[_0x6872('0x2e')][_0x6872('0x1f')]);_0x2807ec[_0x6872('0x1c')]=qs[_0x6872('0x1c')](_0x22f3d2[_0x6872('0x2e')]['offset']);}_0x2807ec['order']=qs[_0x6872('0x37')](_0x22f3d2['query'][_0x6872('0x37')]);_0x2807ec[_0x6872('0x38')]=qs[_0x6872('0x30')](_[_0x6872('0x39')](_0x22f3d2[_0x6872('0x2e')],_0x14efb7[_0x6872('0x30')]),_0x20aea8);if(_0x22f3d2['query'][_0x6872('0x3a')]){_0x2807ec[_0x6872('0x38')]=_[_0x6872('0x3b')](_0x2807ec[_0x6872('0x38')],{'$or':_[_0x6872('0x2d')](_0x20aea8,function(_0x2bede4){if(_0x2bede4[_0x6872('0x2a')]!=='VIRTUAL'){var _0x5c4901={};_0x5c4901[_0x2bede4[_0x6872('0x26')]]={'$like':'%'+_0x22f3d2[_0x6872('0x2e')][_0x6872('0x3a')]+'%'};return _0x5c4901;}})});}_0x2807ec=_[_0x6872('0x3b')]({},_0x2807ec,_0x22f3d2[_0x6872('0x3c')]);var _0x44adf5={'where':_0x2807ec[_0x6872('0x38')]};return db[_0x6872('0x28')][_0x6872('0x1e')](_0x44adf5)['then'](function(_0x49eeb5){_0x3804ff['count']=_0x49eeb5;if(_0x22f3d2['query'][_0x6872('0x3d')]){_0x2807ec['include']=[{'all':!![]}];}return db[_0x6872('0x28')]['findAll'](_0x2807ec);})[_0x6872('0x24')](function(_0x5e153b){_0x3804ff[_0x6872('0x3e')]=_0x5e153b;return _0x3804ff;})[_0x6872('0x24')](respondWithFilteredResult(_0x29b8fc,_0x2807ec))['catch'](handleError(_0x29b8fc,null));};exports['show']=function(_0x4985ca,_0x5acbd3){var _0x429c30={'raw':!![],'where':{'id':_0x4985ca[_0x6872('0x3f')]['id']}},_0x191f62={};_0x191f62[_0x6872('0x2c')]=_[_0x6872('0x2f')](db[_0x6872('0x28')][_0x6872('0x29')]);_0x191f62[_0x6872('0x2e')]=_[_0x6872('0x2f')](_0x4985ca[_0x6872('0x2e')]);_0x191f62[_0x6872('0x30')]=_[_0x6872('0x32')](_0x191f62[_0x6872('0x2c')],_0x191f62[_0x6872('0x2e')]);_0x429c30[_0x6872('0x31')]=_['intersection'](_0x191f62[_0x6872('0x2c')],qs[_0x6872('0x33')](_0x4985ca['query'][_0x6872('0x33')]));_0x429c30[_0x6872('0x31')]=_0x429c30[_0x6872('0x31')][_0x6872('0x34')]?_0x429c30[_0x6872('0x31')]:_0x191f62['model'];if(_0x4985ca[_0x6872('0x2e')][_0x6872('0x3d')]){_0x429c30[_0x6872('0x40')]=[{'all':!![]}];}_0x429c30=_[_0x6872('0x3b')]({},_0x429c30,_0x4985ca[_0x6872('0x3c')]);return db['VoiceQueuesLog'][_0x6872('0x41')](_0x429c30)[_0x6872('0x24')](handleEntityNotFound(_0x5acbd3,null))['then'](respondWithResult(_0x5acbd3,null))[_0x6872('0x42')](handleError(_0x5acbd3,null));};exports[_0x6872('0x43')]=function(_0xcd635f,_0x314ed4){return db[_0x6872('0x28')][_0x6872('0x43')](_0xcd635f['body'],{})['then'](respondWithResult(_0x314ed4,0xc9))[_0x6872('0x42')](handleError(_0x314ed4,null));};exports[_0x6872('0x23')]=function(_0x212db5,_0x2168f4){if(_0x212db5[_0x6872('0x44')]['id']){delete _0x212db5[_0x6872('0x44')]['id'];}return db[_0x6872('0x28')][_0x6872('0x41')]({'where':{'id':_0x212db5[_0x6872('0x3f')]['id']}})[_0x6872('0x24')](handleEntityNotFound(_0x2168f4,null))[_0x6872('0x24')](saveUpdates(_0x212db5['body'],null))[_0x6872('0x24')](respondWithResult(_0x2168f4,null))[_0x6872('0x42')](handleError(_0x2168f4,null));};exports[_0x6872('0x45')]=function(_0xd52018,_0x1d20c7){return db['VoiceQueuesLog'][_0x6872('0x41')]({'where':{'id':_0xd52018['params']['id']}})[_0x6872('0x24')](handleEntityNotFound(_0x1d20c7,null))['then'](removeEntity(_0x1d20c7,null))['catch'](handleError(_0x1d20c7,null));}; \ No newline at end of file +var _0x85c3=['offset','set','apply','reject','save','update','then','destroy','stack','name','index','map','VoiceQueuesLog','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x85c3,0x72));var _0x385c=function(_0x260b51,_0x5e1946){_0x260b51=_0x260b51-0x0;var _0xe368e9=_0x85c3[_0x260b51];return _0xe368e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x385c('0x0'));var zipdir=require(_0x385c('0x1'));var jsonpatch=require(_0x385c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x385c('0x3'));var Mustache=require(_0x385c('0x4'));var util=require('util');var path=require(_0x385c('0x5'));var sox=require(_0x385c('0x6'));var csv=require(_0x385c('0x7'));var ejs=require(_0x385c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x385c('0x9'));var squel=require(_0x385c('0xa'));var crypto=require('crypto');var jsforce=require(_0x385c('0xb'));var deskjs=require(_0x385c('0xc'));var toCsv=require(_0x385c('0x7'));var querystring=require(_0x385c('0xd'));var Papa=require(_0x385c('0xe'));var Redis=require(_0x385c('0xf'));var authService=require(_0x385c('0x10'));var qs=require(_0x385c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x385c('0x12'));var logger=require(_0x385c('0x13'))(_0x385c('0x14'));var utils=require(_0x385c('0x15'));var config=require(_0x385c('0x16'));var licenseUtil=require(_0x385c('0x17'));var db=require(_0x385c('0x18'))['db'];function respondWithStatusCode(_0x3ef4ac,_0x5dde6e){_0x5dde6e=_0x5dde6e||0xcc;return function(_0x2957b6){if(_0x2957b6){return _0x3ef4ac[_0x385c('0x19')](_0x5dde6e);}return _0x3ef4ac['status'](_0x5dde6e)[_0x385c('0x1a')]();};}function respondWithResult(_0x4b05df,_0xedaf09){_0xedaf09=_0xedaf09||0xc8;return function(_0x8e6e66){if(_0x8e6e66){return _0x4b05df[_0x385c('0x1b')](_0xedaf09)[_0x385c('0x1c')](_0x8e6e66);}};}function respondWithFilteredResult(_0x12dafa,_0x594aa5){return function(_0x277fdf){if(_0x277fdf){var _0x1ce7c1=typeof _0x594aa5['offset']===_0x385c('0x1d')&&typeof _0x594aa5[_0x385c('0x1e')]===_0x385c('0x1d');var _0x2c5ba5=_0x277fdf[_0x385c('0x1f')];var _0x3064d4=_0x1ce7c1?0x0:_0x594aa5['offset'];var _0x1cf3dd=_0x1ce7c1?_0x277fdf[_0x385c('0x1f')]:_0x594aa5[_0x385c('0x20')]+_0x594aa5[_0x385c('0x1e')];var _0x355c5d;if(_0x1cf3dd>=_0x2c5ba5){_0x1cf3dd=_0x2c5ba5;_0x355c5d=0xc8;}else{_0x355c5d=0xce;}_0x12dafa[_0x385c('0x1b')](_0x355c5d);return _0x12dafa[_0x385c('0x21')]('Content-Range',_0x3064d4+'-'+_0x1cf3dd+'/'+_0x2c5ba5)[_0x385c('0x1c')](_0x277fdf);}return null;};}function patchUpdates(_0x4d463e){return function(_0x4c9b1a){try{jsonpatch[_0x385c('0x22')](_0x4c9b1a,_0x4d463e,!![]);}catch(_0x185813){return BPromise[_0x385c('0x23')](_0x185813);}return _0x4c9b1a[_0x385c('0x24')]();};}function saveUpdates(_0x248747,_0x50f5b){return function(_0xc68c3f){if(_0xc68c3f){return _0xc68c3f[_0x385c('0x25')](_0x248747)[_0x385c('0x26')](function(_0x93e948){return _0x93e948;});}return null;};}function removeEntity(_0x422c2a,_0x23186a){return function(_0x54eaba){if(_0x54eaba){return _0x54eaba[_0x385c('0x27')]()[_0x385c('0x26')](function(){_0x422c2a[_0x385c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9c52,_0x5e1806){return function(_0x5f6e30){if(!_0x5f6e30){_0x1b9c52[_0x385c('0x19')](0x194);}return _0x5f6e30;};}function handleError(_0x322339,_0x4e86bf){_0x4e86bf=_0x4e86bf||0x1f4;return function(_0x26620a){logger['error'](_0x26620a[_0x385c('0x28')]);if(_0x26620a['name']){delete _0x26620a[_0x385c('0x29')];}_0x322339['status'](_0x4e86bf)['send'](_0x26620a);};}exports[_0x385c('0x2a')]=function(_0x4da6f9,_0x4c5b01){var _0x184caa={},_0x3160fa={},_0x2904bd={'count':0x0,'rows':[]};var _0x533015=_[_0x385c('0x2b')](db[_0x385c('0x2c')][_0x385c('0x2d')],function(_0x129a39){return{'name':_0x129a39['fieldName'],'type':_0x129a39['type']['key']};});_0x3160fa[_0x385c('0x2e')]=_[_0x385c('0x2b')](_0x533015,_0x385c('0x29'));_0x3160fa[_0x385c('0x2f')]=_[_0x385c('0x30')](_0x4da6f9[_0x385c('0x2f')]);_0x3160fa[_0x385c('0x31')]=_[_0x385c('0x32')](_0x3160fa['model'],_0x3160fa[_0x385c('0x2f')]);_0x184caa[_0x385c('0x33')]=_[_0x385c('0x32')](_0x3160fa[_0x385c('0x2e')],qs[_0x385c('0x34')](_0x4da6f9[_0x385c('0x2f')][_0x385c('0x34')]));_0x184caa[_0x385c('0x33')]=_0x184caa['attributes'][_0x385c('0x35')]?_0x184caa[_0x385c('0x33')]:_0x3160fa[_0x385c('0x2e')];if(!_0x4da6f9[_0x385c('0x2f')][_0x385c('0x36')](_0x385c('0x37'))){_0x184caa[_0x385c('0x1e')]=qs[_0x385c('0x1e')](_0x4da6f9[_0x385c('0x2f')][_0x385c('0x1e')]);_0x184caa[_0x385c('0x20')]=qs[_0x385c('0x20')](_0x4da6f9[_0x385c('0x2f')][_0x385c('0x20')]);}_0x184caa[_0x385c('0x38')]=qs[_0x385c('0x39')](_0x4da6f9[_0x385c('0x2f')]['sort']);_0x184caa[_0x385c('0x3a')]=qs['filters'](_['pick'](_0x4da6f9[_0x385c('0x2f')],_0x3160fa['filters']),_0x533015);if(_0x4da6f9[_0x385c('0x2f')]['filter']){_0x184caa[_0x385c('0x3a')]=_[_0x385c('0x3b')](_0x184caa[_0x385c('0x3a')],{'$or':_['map'](_0x533015,function(_0x5da705){if(_0x5da705[_0x385c('0x3c')]!==_0x385c('0x3d')){var _0x5401b6={};_0x5401b6[_0x5da705[_0x385c('0x29')]]={'$like':'%'+_0x4da6f9[_0x385c('0x2f')]['filter']+'%'};return _0x5401b6;}})});}_0x184caa=_[_0x385c('0x3b')]({},_0x184caa,_0x4da6f9[_0x385c('0x3e')]);var _0x4d056e={'where':_0x184caa[_0x385c('0x3a')]};return db['VoiceQueuesLog'][_0x385c('0x1f')](_0x4d056e)['then'](function(_0x184b36){_0x2904bd[_0x385c('0x1f')]=_0x184b36;if(_0x4da6f9[_0x385c('0x2f')][_0x385c('0x3f')]){_0x184caa[_0x385c('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x385c('0x41')](_0x184caa);})[_0x385c('0x26')](function(_0x5b992f){_0x2904bd[_0x385c('0x42')]=_0x5b992f;return _0x2904bd;})[_0x385c('0x26')](respondWithFilteredResult(_0x4c5b01,_0x184caa))[_0x385c('0x43')](handleError(_0x4c5b01,null));};exports[_0x385c('0x44')]=function(_0x21f917,_0x564a83){var _0x52daa2={'raw':!![],'where':{'id':_0x21f917[_0x385c('0x45')]['id']}},_0x19108e={};_0x19108e['model']=_[_0x385c('0x30')](db['VoiceQueuesLog'][_0x385c('0x2d')]);_0x19108e[_0x385c('0x2f')]=_[_0x385c('0x30')](_0x21f917[_0x385c('0x2f')]);_0x19108e[_0x385c('0x31')]=_[_0x385c('0x32')](_0x19108e['model'],_0x19108e[_0x385c('0x2f')]);_0x52daa2['attributes']=_[_0x385c('0x32')](_0x19108e[_0x385c('0x2e')],qs[_0x385c('0x34')](_0x21f917['query']['fields']));_0x52daa2[_0x385c('0x33')]=_0x52daa2[_0x385c('0x33')][_0x385c('0x35')]?_0x52daa2['attributes']:_0x19108e[_0x385c('0x2e')];if(_0x21f917['query']['includeAll']){_0x52daa2[_0x385c('0x40')]=[{'all':!![]}];}_0x52daa2=_[_0x385c('0x3b')]({},_0x52daa2,_0x21f917[_0x385c('0x3e')]);return db['VoiceQueuesLog']['find'](_0x52daa2)['then'](handleEntityNotFound(_0x564a83,null))[_0x385c('0x26')](respondWithResult(_0x564a83,null))[_0x385c('0x43')](handleError(_0x564a83,null));};exports[_0x385c('0x46')]=function(_0x3b60b4,_0x5c6d4a){return db['VoiceQueuesLog'][_0x385c('0x46')](_0x3b60b4[_0x385c('0x47')],{})[_0x385c('0x26')](respondWithResult(_0x5c6d4a,0xc9))[_0x385c('0x43')](handleError(_0x5c6d4a,null));};exports[_0x385c('0x25')]=function(_0x192920,_0x12ccae){if(_0x192920[_0x385c('0x47')]['id']){delete _0x192920['body']['id'];}return db[_0x385c('0x2c')][_0x385c('0x48')]({'where':{'id':_0x192920['params']['id']}})['then'](handleEntityNotFound(_0x12ccae,null))['then'](saveUpdates(_0x192920[_0x385c('0x47')],null))[_0x385c('0x26')](respondWithResult(_0x12ccae,null))[_0x385c('0x43')](handleError(_0x12ccae,null));};exports[_0x385c('0x27')]=function(_0x905a74,_0x151515){return db[_0x385c('0x2c')]['find']({'where':{'id':_0x905a74[_0x385c('0x45')]['id']}})[_0x385c('0x26')](handleEntityNotFound(_0x151515,null))['then'](removeEntity(_0x151515,null))['catch'](handleError(_0x151515,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 250a517..4f49284 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 _0xbe02=['define','VoiceQueuesLog','event_dtm','event','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x4afdbe,_0x478132){var _0x434c4a=function(_0x436e9d){while(--_0x436e9d){_0x4afdbe['push'](_0x4afdbe['shift']());}};_0x434c4a(++_0x478132);}(_0xbe02,0x124));var _0x2be0=function(_0xeccb31,_0x111a5a){_0xeccb31=_0xeccb31-0x0;var _0x30a040=_0xbe02[_0xeccb31];return _0x30a040;};'use strict';var _=require('lodash');var util=require(_0x2be0('0x0'));var logger=require(_0x2be0('0x1'))(_0x2be0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2be0('0x3'));var fs=require('fs');var path=require(_0x2be0('0x4'));var rimraf=require('rimraf');var config=require(_0x2be0('0x5'));var attributes=require(_0x2be0('0x6'));module[_0x2be0('0x7')]=function(_0xa6a72f,_0x35e7d8){return _0xa6a72f[_0x2be0('0x8')](_0x2be0('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x2be0('0xa'),'fields':[_0x2be0('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x2c92=['./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x30faa4,_0x1fd56b){var _0x5a4c80=function(_0x359a67){while(--_0x359a67){_0x30faa4['push'](_0x30faa4['shift']());}};_0x5a4c80(++_0x1fd56b);}(_0x2c92,0x16e));var _0x22c9=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x2c92[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x22c9('0x0'));var util=require(_0x22c9('0x1'));var logger=require(_0x22c9('0x2'))(_0x22c9('0x3'));var moment=require(_0x22c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x22c9('0x5'));var fs=require('fs');var path=require(_0x22c9('0x6'));var rimraf=require(_0x22c9('0x7'));var config=require(_0x22c9('0x8'));var attributes=require(_0x22c9('0x9'));module[_0x22c9('0xa')]=function(_0x447b85,_0x431473){return _0x447b85['define'](_0x22c9('0xb'),attributes,{'tableName':_0x22c9('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x22c9('0xd'),_0x22c9('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c75db52..58126da 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 _0x55e4=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x359d82,_0x3a14e6){var _0x4afe06=function(_0x2928c4){while(--_0x2928c4){_0x359d82['push'](_0x359d82['shift']());}};_0x4afe06(++_0x3a14e6);}(_0x55e4,0x142));var _0x455e=function(_0x5e1c92,_0x38c523){_0x5e1c92=_0x5e1c92-0x0;var _0x3ab170=_0x55e4[_0x5e1c92];return _0x3ab170;};'use strict';var _=require(_0x455e('0x0'));var util=require(_0x455e('0x1'));var moment=require(_0x455e('0x2'));var BPromise=require(_0x455e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x455e('0x4'))['db'];var utils=require(_0x455e('0x5'));var logger=require('../../config/logger')(_0x455e('0x6'));var config=require(_0x455e('0x7'));var jayson=require(_0x455e('0x8'));var client=jayson[_0x455e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d214,_0x4d028f,_0xcd44b0){return new BPromise(function(_0x1fc462,_0x2301b6){return client[_0x455e('0xa')](_0x53d214,_0xcd44b0)[_0x455e('0xb')](function(_0x1d7d1f){logger[_0x455e('0xc')](_0x455e('0xd'),_0x4d028f,_0x455e('0xe'));logger[_0x455e('0xf')](_0x455e('0x10'),_0x4d028f,'request\x20sent',JSON[_0x455e('0x11')](_0x1d7d1f));if(_0x1d7d1f[_0x455e('0x12')]){if(_0x1d7d1f[_0x455e('0x12')][_0x455e('0x13')]===0x1f4){logger[_0x455e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d028f,_0x1d7d1f['error'][_0x455e('0x14')]);return _0x2301b6(_0x1d7d1f[_0x455e('0x12')][_0x455e('0x14')]);}logger[_0x455e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d028f,_0x1d7d1f[_0x455e('0x12')][_0x455e('0x14')]);return _0x1fc462(_0x1d7d1f['error'][_0x455e('0x14')]);}else{logger[_0x455e('0xc')](_0x455e('0xd'),_0x4d028f,'request\x20sent');_0x1fc462(_0x1d7d1f[_0x455e('0x15')][_0x455e('0x14')]);}})[_0x455e('0x16')](function(_0x454d1f){logger['error'](_0x455e('0xd'),_0x4d028f,_0x454d1f);_0x2301b6(_0x454d1f);});});} \ No newline at end of file +var _0x58e5=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch'];(function(_0x15c161,_0x42e4fc){var _0x57bad9=function(_0x423cc2){while(--_0x423cc2){_0x15c161['push'](_0x15c161['shift']());}};_0x57bad9(++_0x42e4fc);}(_0x58e5,0xd1));var _0x558e=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x58e5[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x558e('0x0'));var util=require(_0x558e('0x1'));var moment=require(_0x558e('0x2'));var BPromise=require(_0x558e('0x3'));var rs=require(_0x558e('0x4'));var fs=require('fs');var Redis=require(_0x558e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x558e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x558e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x558e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2887fe,_0xdf6e1e,_0x533a69){return new BPromise(function(_0x58c368,_0x5a26b8){return client['request'](_0x2887fe,_0x533a69)['then'](function(_0x29c7ac){logger[_0x558e('0x9')]('VoiceQueuesLog,\x20%s,\x20%s',_0xdf6e1e,_0x558e('0xa'));logger[_0x558e('0xb')](_0x558e('0xc'),_0xdf6e1e,_0x558e('0xa'),JSON['stringify'](_0x29c7ac));if(_0x29c7ac[_0x558e('0xd')]){if(_0x29c7ac['error'][_0x558e('0xe')]===0x1f4){logger[_0x558e('0xd')](_0x558e('0xf'),_0xdf6e1e,_0x29c7ac[_0x558e('0xd')]['message']);return _0x5a26b8(_0x29c7ac[_0x558e('0xd')][_0x558e('0x10')]);}logger['error'](_0x558e('0xf'),_0xdf6e1e,_0x29c7ac[_0x558e('0xd')]['message']);return _0x58c368(_0x29c7ac[_0x558e('0xd')]['message']);}else{logger[_0x558e('0x9')](_0x558e('0xf'),_0xdf6e1e,'request\x20sent');_0x58c368(_0x29c7ac[_0x558e('0x11')][_0x558e('0x10')]);}})[_0x558e('0x12')](function(_0x15040f){logger['error'](_0x558e('0xf'),_0xdf6e1e,_0x15040f);_0x5a26b8(_0x15040f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 0529af5..e4b51a4 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 _0x2902=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','delete','exports'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x2902,0x11e));var _0x2290=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2902[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x2290('0x0'));var util=require('util');var path=require(_0x2290('0x1'));var timeout=require(_0x2290('0x2'));var express=require(_0x2290('0x3'));var router=express[_0x2290('0x4')]();var fs_extra=require(_0x2290('0x5'));var auth=require(_0x2290('0x6'));var interaction=require(_0x2290('0x7'));var config=require('../../config/environment');var controller=require(_0x2290('0x8'));router[_0x2290('0x9')]('/',auth[_0x2290('0xa')](),controller['index']);router[_0x2290('0x9')](_0x2290('0xb'),auth[_0x2290('0xa')](),controller[_0x2290('0xc')]);router[_0x2290('0x9')](_0x2290('0xd'),auth[_0x2290('0xa')](),controller[_0x2290('0xe')]);router['get'](_0x2290('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x2290('0x9')](_0x2290('0x10'),controller[_0x2290('0x11')]);router['get']('/:id/transcribe',auth[_0x2290('0xa')](),controller[_0x2290('0x12')]);router[_0x2290('0x13')]('/',auth['isAuthenticated'](),controller[_0x2290('0x14')]);router[_0x2290('0x13')](_0x2290('0x15'),auth[_0x2290('0xa')](),controller[_0x2290('0x16')]);router[_0x2290('0x17')](_0x2290('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2290('0x18')](_0x2290('0xd'),auth[_0x2290('0xa')](),controller['destroy']);module[_0x2290('0x19')]=router; \ No newline at end of file +var _0x24a1=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','delete','exports','path'];(function(_0x2afbb0,_0x3c6fa8){var _0x355501=function(_0x53d0f6){while(--_0x53d0f6){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x355501(++_0x3c6fa8);}(_0x24a1,0x1cb));var _0x124a=function(_0x299dc2,_0x20012f){_0x299dc2=_0x299dc2-0x0;var _0x139096=_0x24a1[_0x299dc2];return _0x139096;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x124a('0x0'));var timeout=require(_0x124a('0x1'));var express=require(_0x124a('0x2'));var router=express['Router']();var fs_extra=require(_0x124a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x124a('0x4'));var config=require(_0x124a('0x5'));var controller=require(_0x124a('0x6'));router[_0x124a('0x7')]('/',auth[_0x124a('0x8')](),controller[_0x124a('0x9')]);router[_0x124a('0x7')](_0x124a('0xa'),auth[_0x124a('0x8')](),controller[_0x124a('0xb')]);router[_0x124a('0x7')](_0x124a('0xc'),auth['isAuthenticated'](),controller[_0x124a('0xd')]);router[_0x124a('0x7')]('/:id/download',auth[_0x124a('0x8')](),controller[_0x124a('0xe')]);router[_0x124a('0x7')](_0x124a('0xf'),controller['downloads']);router[_0x124a('0x7')](_0x124a('0x10'),auth['isAuthenticated'](),controller[_0x124a('0x11')]);router[_0x124a('0x12')]('/',auth[_0x124a('0x8')](),controller[_0x124a('0x13')]);router[_0x124a('0x12')](_0x124a('0x10'),auth[_0x124a('0x8')](),controller[_0x124a('0x14')]);router['put'](_0x124a('0xc'),auth[_0x124a('0x8')](),controller['update']);router[_0x124a('0x15')]('/:id',auth[_0x124a('0x8')](),controller['destroy']);module[_0x124a('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 02f4158..9abc76b 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 5a9385b..0dfa677 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 _0xe81c=['transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','VoiceRecording','includeAll','include','findAll','rows','catch','params','length','find','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','format','secrets','Sequelize','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe'];(function(_0x5ce1b5,_0x1db168){var _0xfe0245=function(_0x26f66c){while(--_0x26f66c){_0x5ce1b5['push'](_0x5ce1b5['shift']());}};_0xfe0245(++_0x1db168);}(_0xe81c,0x1de));var _0xce81=function(_0x2a75cd,_0x247962){_0x2a75cd=_0x2a75cd-0x0;var _0x2319bc=_0xe81c[_0x2a75cd];return _0x2319bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce81('0x0'));var zipdir=require(_0xce81('0x1'));var jsonpatch=require(_0xce81('0x2'));var rp=require(_0xce81('0x3'));var moment=require(_0xce81('0x4'));var BPromise=require(_0xce81('0x5'));var Mustache=require('mustache');var util=require(_0xce81('0x6'));var path=require(_0xce81('0x7'));var sox=require(_0xce81('0x8'));var csv=require(_0xce81('0x9'));var ejs=require(_0xce81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce81('0xb'));var squel=require('squel');var crypto=require(_0xce81('0xc'));var jsforce=require(_0xce81('0xd'));var deskjs=require(_0xce81('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce81('0xf'));var Papa=require('papaparse');var AWS=require(_0xce81('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xce81('0x11'));var authService=require(_0xce81('0x12'));var qs=require(_0xce81('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce81('0x14'));var logger=require(_0xce81('0x15'))(_0xce81('0x16'));var utils=require(_0xce81('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xce81('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a3079,_0x3f82e0){_0x3f82e0=_0x3f82e0||0xcc;return function(_0x351e46){if(_0x351e46){return _0x4a3079[_0xce81('0x19')](_0x3f82e0);}return _0x4a3079[_0xce81('0x1a')](_0x3f82e0)[_0xce81('0x1b')]();};}function respondWithResult(_0x1846f7,_0x54d27c){_0x54d27c=_0x54d27c||0xc8;return function(_0x38a7a1){if(_0x38a7a1){return _0x1846f7[_0xce81('0x1a')](_0x54d27c)['json'](_0x38a7a1);}};}function respondWithFilteredResult(_0x494d11,_0x1185d3){return function(_0x41f79c){if(_0x41f79c){var _0x9814e2=typeof _0x1185d3['offset']===_0xce81('0x1c')&&typeof _0x1185d3[_0xce81('0x1d')]===_0xce81('0x1c');var _0x47f2cb=_0x41f79c['count'];var _0x57cd3f=_0x9814e2?0x0:_0x1185d3[_0xce81('0x1e')];var _0x3171d6=_0x9814e2?_0x41f79c[_0xce81('0x1f')]:_0x1185d3[_0xce81('0x1e')]+_0x1185d3[_0xce81('0x1d')];var _0x4e6696;if(_0x3171d6>=_0x47f2cb){_0x3171d6=_0x47f2cb;_0x4e6696=0xc8;}else{_0x4e6696=0xce;}_0x494d11[_0xce81('0x1a')](_0x4e6696);return _0x494d11[_0xce81('0x20')](_0xce81('0x21'),_0x57cd3f+'-'+_0x3171d6+'/'+_0x47f2cb)[_0xce81('0x22')](_0x41f79c);}return null;};}function patchUpdates(_0x39f497){return function(_0x3351fa){try{jsonpatch[_0xce81('0x23')](_0x3351fa,_0x39f497,!![]);}catch(_0xa5a1f5){return BPromise[_0xce81('0x24')](_0xa5a1f5);}return _0x3351fa[_0xce81('0x25')]();};}function saveUpdates(_0x520252,_0x531cd9){return function(_0x4c5156){if(_0x4c5156){return _0x4c5156[_0xce81('0x26')](_0x520252)[_0xce81('0x27')](function(_0x375c0d){return _0x375c0d;});}return null;};}function removeEntity(_0x3032ff,_0x4afbd7){return function(_0x4a0dcd){if(_0x4a0dcd){return _0x4a0dcd[_0xce81('0x28')]()[_0xce81('0x27')](function(){_0x3032ff['status'](0xcc)[_0xce81('0x1b')]();});}};}function handleEntityNotFound(_0x273326,_0x4847b8){return function(_0x21747a){if(!_0x21747a){_0x273326[_0xce81('0x19')](0x194);}return _0x21747a;};}function handleError(_0x11f9db,_0x5e4200){_0x5e4200=_0x5e4200||0x1f4;return function(_0x551960){logger[_0xce81('0x29')](_0x551960['stack']);if(_0x551960[_0xce81('0x2a')]){delete _0x551960[_0xce81('0x2a')];}_0x11f9db[_0xce81('0x1a')](_0x5e4200)[_0xce81('0x2b')](_0x551960);};}exports['index']=function(_0x2f7519,_0x4d78a4){var _0x10ccff={},_0x466b71={},_0x1fe6e1={'count':0x0,'rows':[]};var _0x581128=_[_0xce81('0x2c')](db['VoiceRecording'][_0xce81('0x2d')],function(_0x493b6e){return{'name':_0x493b6e[_0xce81('0x2e')],'type':_0x493b6e[_0xce81('0x2f')][_0xce81('0x30')]};});_0x466b71['model']=_[_0xce81('0x31')](_[_0xce81('0x2c')](_0x581128,_0xce81('0x2a')),['format']);_0x466b71[_0xce81('0x32')]=_[_0xce81('0x33')](_0x2f7519[_0xce81('0x32')]);_0x466b71[_0xce81('0x34')]=_[_0xce81('0x35')](_0x466b71[_0xce81('0x36')],_0x466b71['query']);_0x10ccff[_0xce81('0x37')]=_['intersection'](_0x466b71[_0xce81('0x36')],qs[_0xce81('0x38')](_0x2f7519['query'][_0xce81('0x38')]));_0x10ccff[_0xce81('0x37')]=_0x10ccff[_0xce81('0x37')]['length']?_0x10ccff[_0xce81('0x37')]:_0x466b71[_0xce81('0x36')];if(!_0x2f7519[_0xce81('0x32')]['hasOwnProperty'](_0xce81('0x39'))){_0x10ccff[_0xce81('0x1d')]=qs[_0xce81('0x1d')](_0x2f7519['query']['limit']);_0x10ccff[_0xce81('0x1e')]=qs[_0xce81('0x1e')](_0x2f7519[_0xce81('0x32')][_0xce81('0x1e')]);}_0x10ccff[_0xce81('0x3a')]=qs[_0xce81('0x3b')](_0x2f7519[_0xce81('0x32')]['sort']);_0x10ccff[_0xce81('0x3c')]=qs[_0xce81('0x34')](_[_0xce81('0x3d')](_0x2f7519[_0xce81('0x32')],_0x466b71[_0xce81('0x34')]),_0x581128);if(_0x2f7519[_0xce81('0x32')][_0xce81('0x3e')]){_0x10ccff[_0xce81('0x3c')]=_[_0xce81('0x3f')](_0x10ccff['where'],{'$or':_['map'](_0x581128,function(_0xe40d7){if(_0xe40d7[_0xce81('0x2f')]!=='VIRTUAL'){var _0x4f3030={};_0x4f3030[_0xe40d7[_0xce81('0x2a')]]={'$like':'%'+_0x2f7519[_0xce81('0x32')][_0xce81('0x3e')]+'%'};return _0x4f3030;}})});}_0x10ccff=_[_0xce81('0x3f')]({},_0x10ccff,_0x2f7519[_0xce81('0x40')]);var _0x19bdb0={'where':_0x10ccff[_0xce81('0x3c')]};return db[_0xce81('0x41')][_0xce81('0x1f')](_0x19bdb0)[_0xce81('0x27')](function(_0x4cbc24){_0x1fe6e1['count']=_0x4cbc24;if(_0x2f7519['query'][_0xce81('0x42')]){_0x10ccff[_0xce81('0x43')]=[{'all':!![]}];}return db['VoiceRecording'][_0xce81('0x44')](_0x10ccff);})['then'](function(_0x265d7c){_0x1fe6e1[_0xce81('0x45')]=_0x265d7c;return _0x1fe6e1;})['then'](respondWithFilteredResult(_0x4d78a4,_0x10ccff))[_0xce81('0x46')](handleError(_0x4d78a4,null));};exports['show']=function(_0x439806,_0x5423c2){var _0x131149={'raw':![],'where':{'id':_0x439806[_0xce81('0x47')]['id']}},_0x436e2e={};_0x436e2e['model']=_[_0xce81('0x33')](db[_0xce81('0x41')][_0xce81('0x2d')]);_0x436e2e['query']=_[_0xce81('0x33')](_0x439806[_0xce81('0x32')]);_0x436e2e[_0xce81('0x34')]=_['intersection'](_0x436e2e[_0xce81('0x36')],_0x436e2e[_0xce81('0x32')]);_0x131149[_0xce81('0x37')]=_[_0xce81('0x35')](_0x436e2e[_0xce81('0x36')],qs['fields'](_0x439806[_0xce81('0x32')][_0xce81('0x38')]));_0x131149[_0xce81('0x37')]=_0x131149[_0xce81('0x37')][_0xce81('0x48')]?_0x131149[_0xce81('0x37')]:_0x436e2e[_0xce81('0x36')];if(_0x439806[_0xce81('0x32')][_0xce81('0x42')]){_0x131149[_0xce81('0x43')]=[{'all':!![]}];}_0x131149=_[_0xce81('0x3f')]({},_0x131149,_0x439806[_0xce81('0x40')]);return db[_0xce81('0x41')][_0xce81('0x49')](_0x131149)[_0xce81('0x27')](handleEntityNotFound(_0x5423c2,null))['then'](respondWithResult(_0x5423c2,null))[_0xce81('0x46')](handleError(_0x5423c2,null));};exports['create']=function(_0x369acf,_0x31a5bf){return db[_0xce81('0x41')]['create'](_0x369acf['body'],{})[_0xce81('0x27')](respondWithResult(_0x31a5bf,0xc9))['catch'](handleError(_0x31a5bf,null));};exports[_0xce81('0x26')]=function(_0x58bae7,_0x822b71){if(_0x58bae7[_0xce81('0x4a')]['id']){delete _0x58bae7[_0xce81('0x4a')]['id'];}return db[_0xce81('0x41')]['find']({'where':{'id':_0x58bae7['params']['id']}})[_0xce81('0x27')](handleEntityNotFound(_0x822b71,null))[_0xce81('0x27')](saveUpdates(_0x58bae7[_0xce81('0x4a')],null))[_0xce81('0x27')](respondWithResult(_0x822b71,null))[_0xce81('0x46')](handleError(_0x822b71,null));};exports['describe']=function(_0x4a0dcc,_0x1de1ee){return db[_0xce81('0x41')][_0xce81('0x4b')]()['then'](respondWithResult(_0x1de1ee,null))['catch'](handleError(_0x1de1ee,null));};exports[_0xce81('0x4c')]=function(_0x474256,_0x39f51f,_0x16f238){var _0x4512d7=require(_0xce81('0x4d'));var _0x175215=![];var _0x5b5230={};if(_0x474256[_0xce81('0x32')][_0xce81('0x2f')]&&_0x474256[_0xce81('0x32')]['type']===_0xce81('0x4e')){_0x5b5230[_0xce81('0x4e')]=_0x474256[_0xce81('0x47')]['id'];}else{_0x5b5230['id']=_0x474256[_0xce81('0x47')]['id'];}return db[_0xce81('0x41')][_0xce81('0x49')]({'where':_0x5b5230,'attributes':['id',_0xce81('0x4f')],'raw':!![]})[_0xce81('0x27')](handleEntityNotFound(_0x39f51f,null))[_0xce81('0x27')](function(_0x5f30c4){if(_0x5f30c4){var _0x39105f=_0x5f30c4['value'];var _0x20682f=util['format'](_0xce81('0x50'),_0x39105f);if(fs[_0xce81('0x51')](_0x20682f)){_0x175215=!![];return _0x4512d7[_0xce81('0x52')](_0x20682f,_0x39105f,config['secrets'][_0xce81('0x53')])[_0xce81('0x27')](function(){return _0x5f30c4;});}return _0x5f30c4;}})['then'](function(_0x127853){if(_0x127853){var _0x25ac35=_0x127853[_0xce81('0x4f')];if(!fs[_0xce81('0x51')](_0x25ac35)){throw new db['Sequelize'][(_0xce81('0x54'))](_0xce81('0x55'));}if(_0x127853[_0xce81('0x56')]){return _0x39f51f[_0xce81('0x4c')](_0x25ac35,_0x127853[_0xce81('0x56')]+path['extname'](_0x25ac35),function(){if(_0x175215){fs['unlink'](_0x25ac35);}});}else{return _0x39f51f[_0xce81('0x4c')](_0x25ac35,function(_0x2ef519){if(_0x175215){fs[_0xce81('0x57')](_0x25ac35);}});}}})[_0xce81('0x46')](function(_0x2e7569){if(_0x2e7569[_0xce81('0x58')]==='VoiceRecording\x20not\x20found'){_0x39f51f[_0xce81('0x1a')](0x194)['send'](_0xce81('0x59'));}else{return handleError(_0x39f51f,null);}});};exports[_0xce81('0x5a')]=function(_0x319f19,_0x1b1a43,_0x11ecef){var _0xa9e6c3=require(_0xce81('0x4d'));var _0x2dd35a=![];var _0x3e4a2d={'$and':[db[_0xce81('0x5b')][_0xce81('0x3c')](db[_0xce81('0x5b')]['fn'](_0xce81('0x5c'),db['sequelize'][_0xce81('0x5d')](_0xce81('0x4e'))),_0x319f19[_0xce81('0x32')][_0xce81('0x5e')])]};if(_0x319f19[_0xce81('0x32')][_0xce81('0x2f')]&&_0x319f19['query'][_0xce81('0x2f')]===_0xce81('0x4e')){_0x3e4a2d[_0xce81('0x5f')][_0xce81('0x60')]({'uniqueid':_0x319f19['params']['id']});}else{_0x3e4a2d[_0xce81('0x5f')]['push']({'id':_0x319f19[_0xce81('0x47')]['id']});}return db[_0xce81('0x41')][_0xce81('0x49')]({'where':_0x3e4a2d,'attributes':['id','value'],'raw':!![]})[_0xce81('0x27')](handleEntityNotFound(_0x1b1a43,null))['then'](function(_0x9e052a){if(_0x9e052a){var _0x1b2253=util[_0xce81('0x61')](_0xce81('0x50'),_0x9e052a[_0xce81('0x4f')]);if(fs[_0xce81('0x51')](_0x1b2253)){_0x2dd35a=!![];return _0xa9e6c3['decryptFile'](_0x1b2253,_0x9e052a[_0xce81('0x4f')],config[_0xce81('0x62')][_0xce81('0x53')])[_0xce81('0x27')](function(){return _0x9e052a;});}return _0x9e052a;}})[_0xce81('0x27')](function(_0x845e17){if(_0x845e17){if(!fs['existsSync'](_0x845e17[_0xce81('0x4f')])){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))](_0xce81('0x55'));}if(_0x845e17[_0xce81('0x56')]){return _0x1b1a43[_0xce81('0x4c')](_0x845e17[_0xce81('0x4f')],_0x845e17[_0xce81('0x56')]+path[_0xce81('0x64')](_0x845e17['value']),function(){if(_0x2dd35a){fs[_0xce81('0x57')](_0x845e17[_0xce81('0x4f')]);}});}else{return _0x1b1a43[_0xce81('0x4c')](_0x845e17[_0xce81('0x4f')],function(_0x4f0666){if(_0x2dd35a){fs[_0xce81('0x57')](_0x845e17['value']);}});}}})[_0xce81('0x46')](handleError(_0x1b1a43,null));};exports[_0xce81('0x28')]=function(_0x12c26c,_0x2916d9){return db[_0xce81('0x41')][_0xce81('0x49')]({'where':{'id':_0x12c26c['params']['id']}})[_0xce81('0x27')](function(_0x3dff1f){if(_['isNil'](_0x3dff1f)){throw new ReferenceError(_0xce81('0x65'));}return _0x3dff1f;})['then'](function(_0x2dee25){var _0x1cb72f=_0x2dee25[_0xce81('0x4f')];logger[_0xce81('0x66')](_0xce81('0x67'),_0x1cb72f);if(!_[_0xce81('0x68')](_0x2dee25[_0xce81('0x4f')])&&fs[_0xce81('0x51')](_0x1cb72f)){logger[_0xce81('0x66')](_0xce81('0x69')+_0x1cb72f+_0xce81('0x6a'));fs[_0xce81('0x6b')](_0x1cb72f);}_0x1cb72f=_0x1cb72f+'.cypher';if(!_[_0xce81('0x68')](_0x2dee25[_0xce81('0x4f')])&&fs[_0xce81('0x51')](_0x1cb72f)){logger[_0xce81('0x66')]('File:\x20\x22'+_0x1cb72f+_0xce81('0x6a'));fs[_0xce81('0x6b')](_0x1cb72f);}return _0x2dee25;})['then'](function(_0xe9f9a2){if(!_0xe9f9a2)throw new InternalError();return _0xe9f9a2['destroy']();})[_0xce81('0x27')](function(){_0x2916d9['status'](0xcc)['end']();})[_0xce81('0x46')](handleError(_0x2916d9,null));};function getBucketslist(_0x11573e,_0x52141b,_0x4ebb3a){return new Promise(function(_0x4a9c7d,_0x20437d){var _0x2753c4=new AWS['S3']({'accessKeyId':_0x52141b,'secretAccessKey':_0x11573e,'region':_0x4ebb3a});_0x2753c4[_0xce81('0x6c')]({},function(_0x256a73,_0x49c0e8){if(_0x256a73){return _0x20437d(_0x256a73);}else{return _0x4a9c7d(_0x49c0e8);}});});}function createBucket(_0x335de2,_0x4518ea,_0x5aac92,_0x40f5f6){return new Promise(function(_0x5007ca,_0x292e03){var _0x1d5779=new AWS['S3']({'accessKeyId':_0x4518ea,'secretAccessKey':_0x335de2,'region':_0x5aac92});_0x1d5779[_0xce81('0x6d')]({'Bucket':_0x40f5f6},function(_0x49641e,_0x4bee37){if(_0x49641e){return _0x292e03(_0x49641e);}else{return _0x5007ca(_0x4bee37);}});});}function uploadFile(_0xe8d6c4,_0x819bd7,_0x1129c0,_0x2c7294,_0x390079,_0x1cdb49){return new Promise(function(_0xc30729,_0x367f88){var _0x56c3ad=new AWS['S3']({'accessKeyId':_0x819bd7,'secretAccessKey':_0xe8d6c4,'region':_0x1129c0});_0x56c3ad[_0xce81('0x6e')]({'Bucket':_0x2c7294,'Key':_0x390079,'Body':_0x1cdb49},function(_0x3932e0,_0x306cc0){if(_0x3932e0){return _0x367f88(_0x3932e0);}else{return _0xc30729(_0x306cc0);}});});}function startTranscribe(_0x5a6bb0,_0x4db8d5,_0x48ff38,_0x1ca56f,_0x3a244d,_0x1717de){return new Promise(function(_0x3716b3,_0x553693){var _0x3ad0f3=new AWS['TranscribeService']({'accessKeyId':_0x4db8d5,'secretAccessKey':_0x5a6bb0,'region':_0x48ff38});_0x3ad0f3[_0xce81('0x6f')]({'TranscriptionJobName':_0x1ca56f,'LanguageCode':_0x3a244d,'Media':{'MediaFileUri':_0x1717de}},function(_0x33fb85,_0x1faa79){if(_0x33fb85){return _0x553693(_0x33fb85);}else{return _0x3716b3(_0x1faa79);}});});}function transcribe(_0x3bb61b,_0x163a58,_0x1373e1,_0x370b57,_0x1af1fe,_0x424e01,_0x3bf779){return new Promise(function(_0x2a622c,_0xf56dd){var _0x4eee6e={};logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x70'),_0x3bb61b,_0x1af1fe));return uploadFile(_0x163a58,_0x1373e1,_0x370b57,_0x1af1fe,path['basename'](_0x424e01),fs['readFileSync'](_0x424e01))[_0xce81('0x27')](function(_0x1f7786){logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x71'),_0x3bb61b,_0x1af1fe,_0x1f7786[_0xce81('0x72')]));_0x4eee6e['bucket']=_0x1f7786[_0xce81('0x73')];_0x4eee6e[_0xce81('0x74')]=_0x1f7786[_0xce81('0x72')];logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x75'),_0x3bb61b));return startTranscribe(_0x163a58,_0x1373e1,_0x370b57,uuidv4(),_0x3bf779,_0x1f7786[_0xce81('0x72')]);})['then'](function(_0x5b050c){logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x76'),_0x3bb61b,_0x5b050c[_0xce81('0x77')]['TranscriptionJobName']));_0x4eee6e[_0xce81('0x78')]=_0x5b050c[_0xce81('0x77')][_0xce81('0x79')];_0x4eee6e['transcribeStatus']=_0x5b050c[_0xce81('0x77')]['TranscriptionJobStatus'];return _0x2a622c(_0x4eee6e);})[_0xce81('0x46')](function(_0x49216b){return _0xf56dd(_0x49216b);});});}exports['runTranscribe']=function(_0x2893f6,_0x3a5255,_0x5d4fac){var _0x422d0d;var _0xaad4df;var _0x16c115;var _0xc5780c=require(_0xce81('0x4d'));return db[_0xce81('0x41')][_0xce81('0x7a')]({'where':{'id':_0x2893f6[_0xce81('0x47')]['id']}})[_0xce81('0x27')](function(_0x2e920f){if(_0x2e920f){var _0x1bb60d=util[_0xce81('0x61')](_0xce81('0x50'),_0x2e920f[_0xce81('0x4f')]);if(fs[_0xce81('0x51')](_0x1bb60d)){cypher=!![];return _0xc5780c[_0xce81('0x52')](_0x1bb60d,_0x2e920f[_0xce81('0x4f')],config['secrets'][_0xce81('0x53')])['then'](function(){return _0x2e920f;});}return _0x2e920f;}})['then'](function(_0x4ad082){if(!_0x4ad082){throw new db['Sequelize'][(_0xce81('0x54'))](_0xce81('0x7b'));}_0xaad4df=_0x4ad082;return db[_0xce81('0x7c')][_0xce81('0x7a')]({'where':{'id':0x1}});})[_0xce81('0x27')](handleEntityNotFound(_0x3a5255,null))['then'](function(_0x35d375){if(_0x35d375){_0x422d0d=_0x35d375;if(!_0x422d0d[_0xce81('0x7d')]||!_0x422d0d[_0xce81('0x7e')]||!_0x422d0d[_0xce81('0x7f')]||!_0x422d0d[_0xce81('0x80')]||!_0x422d0d[_0xce81('0x81')]){throw new db['Sequelize'][(_0xce81('0x54'))]('Transcribe\x20not\x20configured');}if(_0x2893f6[_0xce81('0x4a')][_0xce81('0x82')]&&(!_0x422d0d[_0xce81('0x83')]||!_0x422d0d['sentimentAccountId']||!_0x422d0d[_0xce81('0x84')]||!_0x422d0d[_0xce81('0x80')]||!_0x422d0d[_0xce81('0x81')])){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xce81('0x85')][_0xce81('0x7a')]({'where':{'id':_0x422d0d[_0xce81('0x7e')]}});}})[_0xce81('0x27')](function(_0x3bbada){if(!_0x3bbada){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3bbada['data1']||!_0x3bbada['data2']){throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))](_0xce81('0x86'));}_0x16c115=_0x3bbada;return getBucketslist(_0x16c115['data1'],_0x16c115['data2'],_0x422d0d[_0xce81('0x7f')]);})[_0xce81('0x27')](function(_0x22e7d7){if(_0x22e7d7&&_0x22e7d7[_0xce81('0x87')]){var _0x36c64b=_[_0xce81('0x49')](_0x22e7d7[_0xce81('0x87')],function(_0x4e175e){return _0x4e175e['Name']===_0x422d0d['bucket'];});if(!_0x36c64b){logger[_0xce81('0x66')](util['format'](_0xce81('0x88'),_0x2893f6[_0xce81('0x47')]['id'],_0x422d0d[_0xce81('0x81')]));return createBucket(_0x16c115[_0xce81('0x89')],_0x16c115[_0xce81('0x8a')],_0x422d0d[_0xce81('0x7f')],_0x422d0d[_0xce81('0x81')]);}logger[_0xce81('0x66')](util[_0xce81('0x61')](_0xce81('0x8b'),_0x2893f6[_0xce81('0x47')]['id'],_0x422d0d[_0xce81('0x81')]));return;}})[_0xce81('0x27')](function(_0x2be794){if(_0xaad4df[_0xce81('0x8c')]===_0xce81('0x8d')){return transcribe(_0x2893f6['params']['id'],_0x16c115[_0xce81('0x89')],_0x16c115['data2'],_0x422d0d[_0xce81('0x7f')],_0x422d0d['bucket'],_0xaad4df[_0xce81('0x4f')],_0x422d0d[_0xce81('0x80')]);}else{logger[_0xce81('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2893f6[_0xce81('0x47')]['id']));return{'transcribeStatus':_0xce81('0x8e')};}})['then'](function(_0x5473fd){if(_0x5473fd){_0x5473fd[_0xce81('0x8f')]=_0x2893f6[_0xce81('0x4a')][_0xce81('0x82')];return _0xaad4df[_0xce81('0x90')](_0x5473fd);}})[_0xce81('0x27')](respondWithResult(_0x3a5255,null))['catch'](handleError(_0x3a5255,null));};function writeFile(_0xc78001,_0x12b014){return new Promise(function(_0xfe353d,_0x58cad8){fs[_0xce81('0x91')](_0x12b014,_0xc78001,function(_0x5d4b77,_0x198830){if(_0x5d4b77){return _0x58cad8(_0x5d4b77);}else{return _0xfe353d(_0x198830);}});});}exports[_0xce81('0x92')]=function(_0x898f71,_0xd16324,_0x252023){return db[_0xce81('0x41')][_0xce81('0x7a')]({'where':{'id':_0x898f71[_0xce81('0x47')]['id']}})[_0xce81('0x27')](handleEntityNotFound(_0xd16324))[_0xce81('0x27')](function(_0x4c2cd7){if(_0x4c2cd7&&_0x4c2cd7['fileText']){var _0x1f58d6=_0x4c2cd7[_0xce81('0x93')];var _0x491ccd=config['root']+_0xce81('0x94')+_0x4c2cd7['id']+_0xce81('0x95');if(fs[_0xce81('0x51')](_0x491ccd)){return _0x491ccd;}return writeFile(_0x1f58d6,_0x491ccd)[_0xce81('0x27')](function(){return _0x491ccd;});}else{throw new db[(_0xce81('0x63'))][(_0xce81('0x54'))](_0xce81('0x96'));}})[_0xce81('0x27')](function(_0x3d3356){return _0xd16324[_0xce81('0x4c')](_0x3d3356);})['catch'](handleError(_0xd16324));}; \ No newline at end of file +var _0x3607=['%s.cypher','secrets','ValidationError','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','save','then','end','stack','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','name','format','query','filters','intersection','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','keys','attributes','fields','find','body','update','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','push','$and'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x3607,0x166));var _0x7360=function(_0x4680c2,_0xcb197e){_0x4680c2=_0x4680c2-0x0;var _0x3ba546=_0x3607[_0x4680c2];return _0x3ba546;};'use strict';var emlformat=require(_0x7360('0x0'));var rimraf=require(_0x7360('0x1'));var zipdir=require(_0x7360('0x2'));var jsonpatch=require(_0x7360('0x3'));var rp=require(_0x7360('0x4'));var moment=require(_0x7360('0x5'));var BPromise=require(_0x7360('0x6'));var Mustache=require(_0x7360('0x7'));var util=require(_0x7360('0x8'));var path=require(_0x7360('0x9'));var sox=require(_0x7360('0xa'));var csv=require(_0x7360('0xb'));var ejs=require(_0x7360('0xc'));var fs=require('fs');var fs_extra=require(_0x7360('0xd'));var _=require(_0x7360('0xe'));var squel=require('squel');var crypto=require(_0x7360('0xf'));var jsforce=require(_0x7360('0x10'));var deskjs=require(_0x7360('0x11'));var toCsv=require(_0x7360('0xb'));var querystring=require('querystring');var Papa=require(_0x7360('0x12'));var AWS=require(_0x7360('0x13'));var uuidv4=require(_0x7360('0x14'));var Redis=require(_0x7360('0x15'));var authService=require(_0x7360('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x7360('0x17'));var hardwareService=require(_0x7360('0x18'));var logger=require('../../config/logger')(_0x7360('0x19'));var utils=require(_0x7360('0x1a'));var config=require(_0x7360('0x1b'));var licenseUtil=require(_0x7360('0x1c'));var db=require(_0x7360('0x1d'))['db'];function respondWithStatusCode(_0x5118b9,_0x24cc49){_0x24cc49=_0x24cc49||0xcc;return function(_0x162c77){if(_0x162c77){return _0x5118b9[_0x7360('0x1e')](_0x24cc49);}return _0x5118b9[_0x7360('0x1f')](_0x24cc49)['end']();};}function respondWithResult(_0x391b2b,_0xb64afb){_0xb64afb=_0xb64afb||0xc8;return function(_0x37becf){if(_0x37becf){return _0x391b2b[_0x7360('0x1f')](_0xb64afb)['json'](_0x37becf);}};}function respondWithFilteredResult(_0x5ebf2b,_0x2abb60){return function(_0x30bca1){if(_0x30bca1){var _0x2257a8=typeof _0x2abb60[_0x7360('0x20')]===_0x7360('0x21')&&typeof _0x2abb60[_0x7360('0x22')]==='undefined';var _0x25b3b9=_0x30bca1[_0x7360('0x23')];var _0x6fa65c=_0x2257a8?0x0:_0x2abb60[_0x7360('0x20')];var _0x7d2434=_0x2257a8?_0x30bca1[_0x7360('0x23')]:_0x2abb60[_0x7360('0x20')]+_0x2abb60[_0x7360('0x22')];var _0x34da26;if(_0x7d2434>=_0x25b3b9){_0x7d2434=_0x25b3b9;_0x34da26=0xc8;}else{_0x34da26=0xce;}_0x5ebf2b[_0x7360('0x1f')](_0x34da26);return _0x5ebf2b[_0x7360('0x24')]('Content-Range',_0x6fa65c+'-'+_0x7d2434+'/'+_0x25b3b9)['json'](_0x30bca1);}return null;};}function patchUpdates(_0x156811){return function(_0x45d203){try{jsonpatch['apply'](_0x45d203,_0x156811,!![]);}catch(_0x44c24c){return BPromise['reject'](_0x44c24c);}return _0x45d203[_0x7360('0x25')]();};}function saveUpdates(_0x6d514a,_0x8141ac){return function(_0x40532d){if(_0x40532d){return _0x40532d['update'](_0x6d514a)[_0x7360('0x26')](function(_0x45de1a){return _0x45de1a;});}return null;};}function removeEntity(_0x2dc36b,_0x3ba64a){return function(_0x140274){if(_0x140274){return _0x140274['destroy']()[_0x7360('0x26')](function(){_0x2dc36b[_0x7360('0x1f')](0xcc)[_0x7360('0x27')]();});}};}function handleEntityNotFound(_0x2999dc,_0x38b8e2){return function(_0x3c5eb2){if(!_0x3c5eb2){_0x2999dc[_0x7360('0x1e')](0x194);}return _0x3c5eb2;};}function handleError(_0x4544b5,_0x15bcf8){_0x15bcf8=_0x15bcf8||0x1f4;return function(_0x4dc93c){logger['error'](_0x4dc93c[_0x7360('0x28')]);if(_0x4dc93c['name']){delete _0x4dc93c['name'];}_0x4544b5[_0x7360('0x1f')](_0x15bcf8)[_0x7360('0x29')](_0x4dc93c);};}exports['index']=function(_0x15bcdb,_0x2e932e){var _0x37c1f8={},_0x2b1682={},_0x186085={'count':0x0,'rows':[]};var _0x4bd3e3=_[_0x7360('0x2a')](db[_0x7360('0x2b')][_0x7360('0x2c')],function(_0x4f13ae){return{'name':_0x4f13ae[_0x7360('0x2d')],'type':_0x4f13ae[_0x7360('0x2e')][_0x7360('0x2f')]};});_0x2b1682[_0x7360('0x30')]=_[_0x7360('0x31')](_[_0x7360('0x2a')](_0x4bd3e3,_0x7360('0x32')),[_0x7360('0x33')]);_0x2b1682[_0x7360('0x34')]=_['keys'](_0x15bcdb['query']);_0x2b1682[_0x7360('0x35')]=_[_0x7360('0x36')](_0x2b1682[_0x7360('0x30')],_0x2b1682[_0x7360('0x34')]);_0x37c1f8['attributes']=_[_0x7360('0x36')](_0x2b1682['model'],qs['fields'](_0x15bcdb['query']['fields']));_0x37c1f8['attributes']=_0x37c1f8['attributes'][_0x7360('0x37')]?_0x37c1f8['attributes']:_0x2b1682[_0x7360('0x30')];if(!_0x15bcdb[_0x7360('0x34')]['hasOwnProperty'](_0x7360('0x38'))){_0x37c1f8[_0x7360('0x22')]=qs[_0x7360('0x22')](_0x15bcdb[_0x7360('0x34')][_0x7360('0x22')]);_0x37c1f8[_0x7360('0x20')]=qs[_0x7360('0x20')](_0x15bcdb[_0x7360('0x34')]['offset']);}_0x37c1f8['order']=qs[_0x7360('0x39')](_0x15bcdb[_0x7360('0x34')][_0x7360('0x39')]);_0x37c1f8[_0x7360('0x3a')]=qs['filters'](_['pick'](_0x15bcdb['query'],_0x2b1682[_0x7360('0x35')]),_0x4bd3e3);if(_0x15bcdb[_0x7360('0x34')]['filter']){_0x37c1f8[_0x7360('0x3a')]=_[_0x7360('0x3b')](_0x37c1f8['where'],{'$or':_['map'](_0x4bd3e3,function(_0x6f1163){if(_0x6f1163[_0x7360('0x2e')]!==_0x7360('0x3c')){var _0x3e90c9={};_0x3e90c9[_0x6f1163[_0x7360('0x32')]]={'$like':'%'+_0x15bcdb['query'][_0x7360('0x3d')]+'%'};return _0x3e90c9;}})});}_0x37c1f8=_['merge']({},_0x37c1f8,_0x15bcdb[_0x7360('0x3e')]);var _0x4327a6={'where':_0x37c1f8[_0x7360('0x3a')]};return db['VoiceRecording'][_0x7360('0x23')](_0x4327a6)[_0x7360('0x26')](function(_0x3171be){_0x186085[_0x7360('0x23')]=_0x3171be;if(_0x15bcdb[_0x7360('0x34')][_0x7360('0x3f')]){_0x37c1f8[_0x7360('0x40')]=[{'all':!![]}];}return db[_0x7360('0x2b')][_0x7360('0x41')](_0x37c1f8);})[_0x7360('0x26')](function(_0x383c44){_0x186085['rows']=_0x383c44;return _0x186085;})['then'](respondWithFilteredResult(_0x2e932e,_0x37c1f8))[_0x7360('0x42')](handleError(_0x2e932e,null));};exports[_0x7360('0x43')]=function(_0x3f679a,_0x34e1cc){var _0x5813e8={'raw':![],'where':{'id':_0x3f679a['params']['id']}},_0x3dafbd={};_0x3dafbd[_0x7360('0x30')]=_[_0x7360('0x44')](db[_0x7360('0x2b')][_0x7360('0x2c')]);_0x3dafbd[_0x7360('0x34')]=_[_0x7360('0x44')](_0x3f679a['query']);_0x3dafbd[_0x7360('0x35')]=_[_0x7360('0x36')](_0x3dafbd['model'],_0x3dafbd[_0x7360('0x34')]);_0x5813e8[_0x7360('0x45')]=_[_0x7360('0x36')](_0x3dafbd[_0x7360('0x30')],qs['fields'](_0x3f679a['query'][_0x7360('0x46')]));_0x5813e8[_0x7360('0x45')]=_0x5813e8[_0x7360('0x45')]['length']?_0x5813e8['attributes']:_0x3dafbd[_0x7360('0x30')];if(_0x3f679a['query'][_0x7360('0x3f')]){_0x5813e8['include']=[{'all':!![]}];}_0x5813e8=_[_0x7360('0x3b')]({},_0x5813e8,_0x3f679a[_0x7360('0x3e')]);return db[_0x7360('0x2b')][_0x7360('0x47')](_0x5813e8)['then'](handleEntityNotFound(_0x34e1cc,null))[_0x7360('0x26')](respondWithResult(_0x34e1cc,null))['catch'](handleError(_0x34e1cc,null));};exports['create']=function(_0xb8295b,_0x477867){return db['VoiceRecording']['create'](_0xb8295b[_0x7360('0x48')],{})[_0x7360('0x26')](respondWithResult(_0x477867,0xc9))[_0x7360('0x42')](handleError(_0x477867,null));};exports[_0x7360('0x49')]=function(_0x4e4f5b,_0x304dbe){if(_0x4e4f5b[_0x7360('0x48')]['id']){delete _0x4e4f5b['body']['id'];}return db[_0x7360('0x2b')]['find']({'where':{'id':_0x4e4f5b[_0x7360('0x4a')]['id']}})[_0x7360('0x26')](handleEntityNotFound(_0x304dbe,null))[_0x7360('0x26')](saveUpdates(_0x4e4f5b[_0x7360('0x48')],null))[_0x7360('0x26')](respondWithResult(_0x304dbe,null))[_0x7360('0x42')](handleError(_0x304dbe,null));};exports[_0x7360('0x4b')]=function(_0x1bc211,_0x3d25bf){return db[_0x7360('0x2b')][_0x7360('0x4b')]()[_0x7360('0x26')](respondWithResult(_0x3d25bf,null))[_0x7360('0x42')](handleError(_0x3d25bf,null));};exports[_0x7360('0x4c')]=function(_0x4a99bc,_0x1fb15,_0x16b2d3){var _0x40b1a9=require(_0x7360('0x4d'));var _0x100101=![];var _0x1678a7={};if(_0x4a99bc[_0x7360('0x34')][_0x7360('0x2e')]&&_0x4a99bc[_0x7360('0x34')]['type']===_0x7360('0x4e')){_0x1678a7[_0x7360('0x4e')]=_0x4a99bc[_0x7360('0x4a')]['id'];}else{_0x1678a7['id']=_0x4a99bc[_0x7360('0x4a')]['id'];}return db[_0x7360('0x2b')][_0x7360('0x47')]({'where':_0x1678a7,'attributes':['id',_0x7360('0x4f')],'raw':!![]})[_0x7360('0x26')](handleEntityNotFound(_0x1fb15,null))[_0x7360('0x26')](function(_0x8c9bfc){if(_0x8c9bfc){var _0x4e909c=_0x8c9bfc[_0x7360('0x4f')];var _0x5b9ecb=util['format']('%s.cypher',_0x4e909c);if(fs[_0x7360('0x50')](_0x5b9ecb)){_0x100101=!![];return _0x40b1a9[_0x7360('0x51')](_0x5b9ecb,_0x4e909c,config['secrets'][_0x7360('0x52')])[_0x7360('0x26')](function(){return _0x8c9bfc;});}return _0x8c9bfc;}})[_0x7360('0x26')](function(_0x26bbba){if(_0x26bbba){var _0x154c94=_0x26bbba[_0x7360('0x4f')];if(!fs[_0x7360('0x50')](_0x154c94)){throw new db[(_0x7360('0x53'))]['ValidationError'](_0x7360('0x54'));}if(_0x26bbba['filename']){return _0x1fb15[_0x7360('0x4c')](_0x154c94,_0x26bbba[_0x7360('0x55')]+path[_0x7360('0x56')](_0x154c94),function(){if(_0x100101){fs[_0x7360('0x57')](_0x154c94);}});}else{return _0x1fb15[_0x7360('0x4c')](_0x154c94,function(_0x3cf933){if(_0x100101){fs[_0x7360('0x57')](_0x154c94);}});}}})[_0x7360('0x42')](function(_0xdb2cf8){if(_0xdb2cf8[_0x7360('0x58')]==='VoiceRecording\x20not\x20found'){_0x1fb15[_0x7360('0x1f')](0x194)['send']('Not\x20found');}else{return handleError(_0x1fb15,null);}});};exports[_0x7360('0x59')]=function(_0x26578d,_0x1c62dd,_0x41d047){var _0x9215c1=require(_0x7360('0x4d'));var _0x5ca25f=![];var _0x3c97ce={'$and':[db[_0x7360('0x5a')][_0x7360('0x3a')](db[_0x7360('0x5a')]['fn'](_0x7360('0x5b'),db['sequelize'][_0x7360('0x5c')]('uniqueid')),_0x26578d['query']['token'])]};if(_0x26578d[_0x7360('0x34')][_0x7360('0x2e')]&&_0x26578d[_0x7360('0x34')][_0x7360('0x2e')]==='uniqueid'){_0x3c97ce['$and'][_0x7360('0x5d')]({'uniqueid':_0x26578d[_0x7360('0x4a')]['id']});}else{_0x3c97ce[_0x7360('0x5e')]['push']({'id':_0x26578d[_0x7360('0x4a')]['id']});}return db[_0x7360('0x2b')]['find']({'where':_0x3c97ce,'attributes':['id',_0x7360('0x4f')],'raw':!![]})[_0x7360('0x26')](handleEntityNotFound(_0x1c62dd,null))['then'](function(_0xd96af1){if(_0xd96af1){var _0x447b66=util['format'](_0x7360('0x5f'),_0xd96af1[_0x7360('0x4f')]);if(fs[_0x7360('0x50')](_0x447b66)){_0x5ca25f=!![];return _0x9215c1['decryptFile'](_0x447b66,_0xd96af1['value'],config[_0x7360('0x60')][_0x7360('0x52')])['then'](function(){return _0xd96af1;});}return _0xd96af1;}})['then'](function(_0x1a885a){if(_0x1a885a){if(!fs[_0x7360('0x50')](_0x1a885a[_0x7360('0x4f')])){throw new db[(_0x7360('0x53'))][(_0x7360('0x61'))](_0x7360('0x54'));}if(_0x1a885a[_0x7360('0x55')]){return _0x1c62dd['download'](_0x1a885a[_0x7360('0x4f')],_0x1a885a['filename']+path[_0x7360('0x56')](_0x1a885a[_0x7360('0x4f')]),function(){if(_0x5ca25f){fs['unlink'](_0x1a885a[_0x7360('0x4f')]);}});}else{return _0x1c62dd[_0x7360('0x4c')](_0x1a885a[_0x7360('0x4f')],function(_0x400e8d){if(_0x5ca25f){fs[_0x7360('0x57')](_0x1a885a['value']);}});}}})[_0x7360('0x42')](handleError(_0x1c62dd,null));};exports['destroy']=function(_0x494bac,_0x17e1e7){return db[_0x7360('0x2b')]['find']({'where':{'id':_0x494bac[_0x7360('0x4a')]['id']}})[_0x7360('0x26')](function(_0x1af583){if(_['isNil'](_0x1af583)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1af583;})[_0x7360('0x26')](function(_0x52f48b){var _0x831cc4=_0x52f48b['value'];logger[_0x7360('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x831cc4);if(!_[_0x7360('0x63')](_0x52f48b[_0x7360('0x4f')])&&fs[_0x7360('0x50')](_0x831cc4)){logger['info']('File:\x20\x22'+_0x831cc4+_0x7360('0x64'));fs[_0x7360('0x65')](_0x831cc4);}_0x831cc4=_0x831cc4+_0x7360('0x66');if(!_['isNil'](_0x52f48b[_0x7360('0x4f')])&&fs['existsSync'](_0x831cc4)){logger[_0x7360('0x62')](_0x7360('0x67')+_0x831cc4+_0x7360('0x64'));fs[_0x7360('0x65')](_0x831cc4);}return _0x52f48b;})[_0x7360('0x26')](function(_0x119f02){if(!_0x119f02)throw new InternalError();return _0x119f02['destroy']();})[_0x7360('0x26')](function(){_0x17e1e7[_0x7360('0x1f')](0xcc)[_0x7360('0x27')]();})['catch'](handleError(_0x17e1e7,null));};function getBucketslist(_0x1950fa,_0x53a538,_0x2beb07){return new Promise(function(_0xd4488f,_0x2441ff){var _0x4f7c3e=new AWS['S3']({'accessKeyId':_0x53a538,'secretAccessKey':_0x1950fa,'region':_0x2beb07});_0x4f7c3e[_0x7360('0x68')]({},function(_0x15e1db,_0x4be7a5){if(_0x15e1db){return _0x2441ff(_0x15e1db);}else{return _0xd4488f(_0x4be7a5);}});});}function createBucket(_0x1cc9a6,_0x27b91d,_0x392375,_0x357ab3){return new Promise(function(_0x1e18a0,_0x46c614){var _0x4ba984=new AWS['S3']({'accessKeyId':_0x27b91d,'secretAccessKey':_0x1cc9a6,'region':_0x392375});_0x4ba984[_0x7360('0x69')]({'Bucket':_0x357ab3},function(_0x394177,_0x2866c8){if(_0x394177){return _0x46c614(_0x394177);}else{return _0x1e18a0(_0x2866c8);}});});}function uploadFile(_0x521bf0,_0x2af152,_0x5c3e86,_0xfff90e,_0xe70d78,_0x36171c){return new Promise(function(_0x345bec,_0x56638f){var _0x28ac1f=new AWS['S3']({'accessKeyId':_0x2af152,'secretAccessKey':_0x521bf0,'region':_0x5c3e86});_0x28ac1f[_0x7360('0x6a')]({'Bucket':_0xfff90e,'Key':_0xe70d78,'Body':_0x36171c},function(_0x9d3e93,_0x272e35){if(_0x9d3e93){return _0x56638f(_0x9d3e93);}else{return _0x345bec(_0x272e35);}});});}function startTranscribe(_0x1ca20c,_0xc9a26,_0x50cd13,_0x515092,_0x3050ac,_0x53d20a){return new Promise(function(_0x1f4260,_0x2e7b35){var _0x4734a6=new AWS[(_0x7360('0x6b'))]({'accessKeyId':_0xc9a26,'secretAccessKey':_0x1ca20c,'region':_0x50cd13});_0x4734a6['startTranscriptionJob']({'TranscriptionJobName':_0x515092,'LanguageCode':_0x3050ac,'Media':{'MediaFileUri':_0x53d20a}},function(_0x3f1163,_0x520d11){if(_0x3f1163){return _0x2e7b35(_0x3f1163);}else{return _0x1f4260(_0x520d11);}});});}function transcribe(_0x1483a6,_0x8d1e86,_0x26701,_0x2940a5,_0x50a7de,_0x12d3aa,_0x52638a){return new Promise(function(_0x560221,_0x166d75){var _0x2bdaf6={};logger[_0x7360('0x62')](util['format'](_0x7360('0x6c'),_0x1483a6,_0x50a7de));return uploadFile(_0x8d1e86,_0x26701,_0x2940a5,_0x50a7de,path[_0x7360('0x6d')](_0x12d3aa),fs['readFileSync'](_0x12d3aa))[_0x7360('0x26')](function(_0x5c192f){logger[_0x7360('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x1483a6,_0x50a7de,_0x5c192f[_0x7360('0x6e')]));_0x2bdaf6[_0x7360('0x6f')]=_0x5c192f['Bucket'];_0x2bdaf6[_0x7360('0x70')]=_0x5c192f['Location'];logger[_0x7360('0x62')](util[_0x7360('0x33')](_0x7360('0x71'),_0x1483a6));return startTranscribe(_0x8d1e86,_0x26701,_0x2940a5,uuidv4(),_0x52638a,_0x5c192f[_0x7360('0x6e')]);})[_0x7360('0x26')](function(_0x144aa3){logger[_0x7360('0x62')](util['format'](_0x7360('0x72'),_0x1483a6,_0x144aa3[_0x7360('0x73')][_0x7360('0x74')]));_0x2bdaf6[_0x7360('0x75')]=_0x144aa3['TranscriptionJob'][_0x7360('0x74')];_0x2bdaf6[_0x7360('0x76')]=_0x144aa3[_0x7360('0x73')][_0x7360('0x77')];return _0x560221(_0x2bdaf6);})[_0x7360('0x42')](function(_0x4ebabc){return _0x166d75(_0x4ebabc);});});}exports['runTranscribe']=function(_0x3ade86,_0x3503d1,_0x5637da){var _0x2c66f4;var _0x5f488c;var _0x48e1b7;var _0x220545=require('../../components/encryptor');return db[_0x7360('0x2b')][_0x7360('0x78')]({'where':{'id':_0x3ade86['params']['id']}})['then'](function(_0x2953d1){if(_0x2953d1){var _0x1e1030=util[_0x7360('0x33')](_0x7360('0x5f'),_0x2953d1[_0x7360('0x4f')]);if(fs[_0x7360('0x50')](_0x1e1030)){cypher=!![];return _0x220545['decryptFile'](_0x1e1030,_0x2953d1['value'],config[_0x7360('0x60')][_0x7360('0x52')])[_0x7360('0x26')](function(){return _0x2953d1;});}return _0x2953d1;}})['then'](function(_0x26e7a6){if(!_0x26e7a6){throw new db['Sequelize'][(_0x7360('0x61'))](_0x7360('0x79'));}_0x5f488c=_0x26e7a6;return db[_0x7360('0x7a')][_0x7360('0x78')]({'where':{'id':0x1}});})[_0x7360('0x26')](handleEntityNotFound(_0x3503d1,null))['then'](function(_0x22e84e){if(_0x22e84e){_0x2c66f4=_0x22e84e;if(!_0x2c66f4[_0x7360('0x7b')]||!_0x2c66f4[_0x7360('0x7c')]||!_0x2c66f4[_0x7360('0x7d')]||!_0x2c66f4[_0x7360('0x7e')]||!_0x2c66f4['bucket']){throw new db[(_0x7360('0x53'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x3ade86[_0x7360('0x48')][_0x7360('0x7f')]&&(!_0x2c66f4[_0x7360('0x80')]||!_0x2c66f4['sentimentAccountId']||!_0x2c66f4[_0x7360('0x81')]||!_0x2c66f4[_0x7360('0x7e')]||!_0x2c66f4[_0x7360('0x6f')])){throw new db[(_0x7360('0x53'))]['ValidationError'](_0x7360('0x82'));}return db[_0x7360('0x83')][_0x7360('0x78')]({'where':{'id':_0x2c66f4['transcribeAccountId']}});}})['then'](function(_0x3fff79){if(!_0x3fff79){throw new db[(_0x7360('0x53'))][(_0x7360('0x61'))](_0x7360('0x84'));}if(!_0x3fff79[_0x7360('0x85')]||!_0x3fff79[_0x7360('0x86')]){throw new db[(_0x7360('0x53'))]['ValidationError'](_0x7360('0x87'));}_0x48e1b7=_0x3fff79;return getBucketslist(_0x48e1b7[_0x7360('0x85')],_0x48e1b7['data2'],_0x2c66f4['transcribeRegion']);})[_0x7360('0x26')](function(_0x525691){if(_0x525691&&_0x525691['Buckets']){var _0x36bca6=_[_0x7360('0x47')](_0x525691[_0x7360('0x88')],function(_0x1cb42a){return _0x1cb42a[_0x7360('0x89')]===_0x2c66f4[_0x7360('0x6f')];});if(!_0x36bca6){logger['info'](util['format'](_0x7360('0x8a'),_0x3ade86[_0x7360('0x4a')]['id'],_0x2c66f4[_0x7360('0x6f')]));return createBucket(_0x48e1b7[_0x7360('0x85')],_0x48e1b7[_0x7360('0x86')],_0x2c66f4[_0x7360('0x7d')],_0x2c66f4[_0x7360('0x6f')]);}logger['info'](util[_0x7360('0x33')](_0x7360('0x8b'),_0x3ade86[_0x7360('0x4a')]['id'],_0x2c66f4[_0x7360('0x6f')]));return;}})[_0x7360('0x26')](function(_0x5894eb){if(_0x5f488c[_0x7360('0x76')]===_0x7360('0x8c')){return transcribe(_0x3ade86[_0x7360('0x4a')]['id'],_0x48e1b7['data1'],_0x48e1b7[_0x7360('0x86')],_0x2c66f4[_0x7360('0x7d')],_0x2c66f4['bucket'],_0x5f488c[_0x7360('0x4f')],_0x2c66f4[_0x7360('0x7e')]);}else{logger[_0x7360('0x62')](util[_0x7360('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x3ade86[_0x7360('0x4a')]['id']));return{'transcribeStatus':_0x7360('0x8d')};}})[_0x7360('0x26')](function(_0x2ee84f){if(_0x2ee84f){_0x2ee84f[_0x7360('0x8e')]=_0x3ade86[_0x7360('0x48')][_0x7360('0x7f')];return _0x5f488c[_0x7360('0x8f')](_0x2ee84f);}})[_0x7360('0x26')](respondWithResult(_0x3503d1,null))['catch'](handleError(_0x3503d1,null));};function writeFile(_0x255dfb,_0x3f48c7){return new Promise(function(_0x3bc4c9,_0x1beb84){fs[_0x7360('0x90')](_0x3f48c7,_0x255dfb,function(_0x20cfa1,_0x3a746a){if(_0x20cfa1){return _0x1beb84(_0x20cfa1);}else{return _0x3bc4c9(_0x3a746a);}});});}exports[_0x7360('0x91')]=function(_0x16c18e,_0x4cc26e,_0x14ace1){return db[_0x7360('0x2b')][_0x7360('0x78')]({'where':{'id':_0x16c18e[_0x7360('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4cc26e))[_0x7360('0x26')](function(_0xe16fa2){if(_0xe16fa2&&_0xe16fa2['fileText']){var _0xc313b5=_0xe16fa2[_0x7360('0x92')];var _0x303015=config[_0x7360('0x93')]+_0x7360('0x94')+_0xe16fa2['id']+_0x7360('0x95');if(fs['existsSync'](_0x303015)){return _0x303015;}return writeFile(_0xc313b5,_0x303015)[_0x7360('0x26')](function(){return _0x303015;});}else{throw new db[(_0x7360('0x53'))][(_0x7360('0x61'))](_0x7360('0x96'));}})[_0x7360('0x26')](function(_0x21b457){return _0x4cc26e[_0x7360('0x4c')](_0x21b457);})['catch'](handleError(_0x4cc26e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 94b398e..f4e7261 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 _0x03ce=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x03ce,0x1a1));var _0xe03c=function(_0x1f0448,_0xa2865f){_0x1f0448=_0x1f0448-0x0;var _0x16fe78=_0x03ce[_0x1f0448];return _0x16fe78;};'use strict';var attributes=require(_0xe03c('0x0'));module[_0xe03c('0x1')]=function(_0x237c84,_0x4ca1c8){return _0x237c84['define'](_0xe03c('0x2'),attributes,{'tableName':_0xe03c('0x3'),'paranoid':![],'indexes':[{'name':_0xe03c('0x4'),'fields':['uniqueid']},{'name':_0xe03c('0x5'),'fields':[_0xe03c('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa1db=['transcribeStatus','./voiceRecording.attributes','exports','voice_recordings','uniqueid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa1db,0xb0));var _0xba1d=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0xa1db[_0x1ae78f];return _0x5baf80;};'use strict';var attributes=require(_0xba1d('0x0'));module[_0xba1d('0x1')]=function(_0x23b5fa,_0x4670e7){return _0x23b5fa['define']('VoiceRecording',attributes,{'tableName':_0xba1d('0x2'),'paranoid':![],'indexes':[{'name':_0xba1d('0x3'),'fields':['uniqueid']},{'name':_0xba1d('0x4'),'fields':[_0xba1d('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 91e2b55..da6dc45 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 _0x2da6=['stringify','error','code','message','result','catch','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58bed5,_0x14f5d4){var _0x59a047=function(_0x470fe6){while(--_0x470fe6){_0x58bed5['push'](_0x58bed5['shift']());}};_0x59a047(++_0x14f5d4);}(_0x2da6,0x1dd));var _0x62da=function(_0x943e7,_0x200b5e){_0x943e7=_0x943e7-0x0;var _0x2c7431=_0x2da6[_0x943e7];return _0x2c7431;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['UpdateVoiceRecording']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['update'](_0xa7050b[_0x62da('0x19')],{'raw':_0xa7050b['options']?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1c')]||null:null,'attributes':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1d')]||null:null,'limit':_0xa7050b[_0x62da('0x1a')]?_0xa7050b['options'][_0x62da('0x1e')]||null:null})[_0x62da('0xc')](function(_0x2fd925){logger[_0x62da('0xd')](_0x62da('0x1f'),_0xa7050b);logger[_0x62da('0xf')](_0x62da('0x1f'),_0xa7050b,JSON['stringify'](_0x2fd925));_0x4d6482(_0x2fd925);})['catch'](function(_0x509fd9){logger[_0x62da('0x13')](_0x62da('0x1f'),_0x509fd9[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x509fd9['message']));});});};exports[_0x62da('0x20')]=function(_0x3b9c06){var _0x5f0a9c=this;return new Promise(function(_0x3ccf96,_0x195dc4){var _0x1775ea=require('../../components/encryptor');var _0x41de3a;return db[_0x62da('0x21')][_0x62da('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3c6274){_0x41de3a=_0x3c6274;return db[_0x62da('0x18')][_0x62da('0x23')](_0x3b9c06['body']);})[_0x62da('0xc')](function(_0x2a4681){if(_0x41de3a[_0x62da('0x24')]&&fs[_0x62da('0x25')](_0x2a4681[_0x62da('0x26')])){var _0x1cf765=util['format'](_0x62da('0x27'),_0x2a4681['value']);return _0x1775ea[_0x62da('0x28')](_0x2a4681[_0x62da('0x26')],_0x1cf765,config[_0x62da('0x29')][_0x62da('0x2a')])[_0x62da('0xc')](function(){fs[_0x62da('0x2b')](_0x2a4681['value']);logger[_0x62da('0xd')](_0x62da('0x2c'));return _0x2a4681;});}return _0x2a4681;})[_0x62da('0xc')](function(_0x5107b1){logger[_0x62da('0xd')](_0x62da('0x20'),_0x3b9c06);logger[_0x62da('0xf')]('CreateVoiceRecording',_0x3b9c06,JSON[_0x62da('0x12')](_0x5107b1));_0x3ccf96(_0x5107b1);})[_0x62da('0x17')](function(_0x55eda7){logger[_0x62da('0x13')](_0x62da('0x20'),_0x55eda7['message'],_0x3b9c06);_0x195dc4(_0x5f0a9c[_0x62da('0x13')](0x1f4,_0x55eda7[_0x62da('0x15')]));});});}; \ No newline at end of file +var _0x4bd3=['stringify','../../components/encryptor','findOne','callRecordingEncryption','create','format','%s.cypher','value','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit'];(function(_0x27c2f9,_0x1a8d8d){var _0x5d173f=function(_0x20e6dc){while(--_0x20e6dc){_0x27c2f9['push'](_0x27c2f9['shift']());}};_0x5d173f(++_0x1a8d8d);}(_0x4bd3,0x174));var _0x34bd=function(_0xfad9be,_0x8b1101){_0xfad9be=_0xfad9be-0x0;var _0x5242a3=_0x4bd3[_0xfad9be];return _0x5242a3;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});}exports[_0x34bd('0x13')]=function(_0x3b4bf8){var _0x72b197=this;return new Promise(function(_0x4b5ebb,_0x48d2ba){return db[_0x34bd('0x14')][_0x34bd('0x15')](_0x3b4bf8[_0x34bd('0x16')],{'raw':_0x3b4bf8[_0x34bd('0x17')]?_0x3b4bf8[_0x34bd('0x17')][_0x34bd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b4bf8[_0x34bd('0x17')]?_0x3b4bf8[_0x34bd('0x17')][_0x34bd('0x19')]||null:null,'attributes':_0x3b4bf8['options']?_0x3b4bf8[_0x34bd('0x17')][_0x34bd('0x1a')]||null:null,'limit':_0x3b4bf8[_0x34bd('0x17')]?_0x3b4bf8[_0x34bd('0x17')][_0x34bd('0x1b')]||null:null})['then'](function(_0x582772){logger['info']('UpdateVoiceRecording',_0x3b4bf8);logger[_0x34bd('0xc')]('UpdateVoiceRecording',_0x3b4bf8,JSON[_0x34bd('0x1c')](_0x582772));_0x4b5ebb(_0x582772);})[_0x34bd('0x12')](function(_0x428140){logger['error'](_0x34bd('0x13'),_0x428140[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x428140[_0x34bd('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x29bda8){var _0xb256e8=this;return new Promise(function(_0x264c94,_0x3e4dc3){var _0x56baf7=require(_0x34bd('0x1d'));var _0x3fe8b0;return db['Setting'][_0x34bd('0x1e')]({'attributes':['id',_0x34bd('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x34bd('0x9')](function(_0x3f675c){_0x3fe8b0=_0x3f675c;return db[_0x34bd('0x14')][_0x34bd('0x20')](_0x29bda8[_0x34bd('0x16')]);})['then'](function(_0x43b92d){if(_0x3fe8b0[_0x34bd('0x1f')]&&fs['existsSync'](_0x43b92d['value'])){var _0x38bdba=util[_0x34bd('0x21')](_0x34bd('0x22'),_0x43b92d['value']);return _0x56baf7['encryptFile'](_0x43b92d[_0x34bd('0x23')],_0x38bdba,config[_0x34bd('0x24')][_0x34bd('0x25')])[_0x34bd('0x9')](function(){fs['unlink'](_0x43b92d[_0x34bd('0x23')]);logger[_0x34bd('0xa')](_0x34bd('0x26'));return _0x43b92d;});}return _0x43b92d;})[_0x34bd('0x9')](function(_0x2ef58f){logger[_0x34bd('0xa')]('CreateVoiceRecording',_0x29bda8);logger[_0x34bd('0xc')]('CreateVoiceRecording',_0x29bda8,JSON[_0x34bd('0x1c')](_0x2ef58f));_0x264c94(_0x2ef58f);})[_0x34bd('0x12')](function(_0xf12ee6){logger['error'](_0x34bd('0x27'),_0xf12ee6[_0x34bd('0x10')],_0x29bda8);_0x3e4dc3(_0xb256e8['error'](0x1f4,_0xf12ee6[_0x34bd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index fb8abfa..efb79bc 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 _0xc8c0=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x85b692,_0x2d28b1){var _0x236680=function(_0x57a1e){while(--_0x57a1e){_0x85b692['push'](_0x85b692['shift']());}};_0x236680(++_0x2d28b1);}(_0xc8c0,0xc3));var _0x0c8c=function(_0x46ab63,_0xb3113d){_0x46ab63=_0x46ab63-0x0;var _0xb4ec46=_0xc8c0[_0x46ab63];return _0xb4ec46;};'use strict';var multer=require(_0x0c8c('0x0'));var util=require(_0x0c8c('0x1'));var path=require('path');var timeout=require(_0x0c8c('0x2'));var express=require(_0x0c8c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0c8c('0x4'));var interaction=require(_0x0c8c('0x5'));var config=require(_0x0c8c('0x6'));var controller=require(_0x0c8c('0x7'));router[_0x0c8c('0x8')]('/',auth[_0x0c8c('0x9')](),controller[_0x0c8c('0xa')]);router['get'](_0x0c8c('0xb'),auth['isAuthenticated'](),controller[_0x0c8c('0xc')]);router[_0x0c8c('0x8')](_0x0c8c('0xd'),auth[_0x0c8c('0x9')](),controller[_0x0c8c('0xe')]);router[_0x0c8c('0xf')]('/',auth[_0x0c8c('0x9')](),controller[_0x0c8c('0x10')]);router[_0x0c8c('0x11')](_0x0c8c('0xd'),auth['isAuthenticated'](),controller[_0x0c8c('0x12')]);router[_0x0c8c('0x13')](_0x0c8c('0xd'),auth[_0x0c8c('0x9')](),controller[_0x0c8c('0x14')]);module[_0x0c8c('0x15')]=router; \ No newline at end of file +var _0xa29c=['update','destroy','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','create','put'];(function(_0x565208,_0x426dea){var _0x396f3a=function(_0x221e57){while(--_0x221e57){_0x565208['push'](_0x565208['shift']());}};_0x396f3a(++_0x426dea);}(_0xa29c,0x1a7));var _0xca29=function(_0x1f5912,_0x18013e){_0x1f5912=_0x1f5912-0x0;var _0x992c91=_0xa29c[_0x1f5912];return _0x992c91;};'use strict';var multer=require('multer');var util=require(_0xca29('0x0'));var path=require('path');var timeout=require(_0xca29('0x1'));var express=require(_0xca29('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xca29('0x3'));var config=require(_0xca29('0x4'));var controller=require('./voiceTransferReport.controller');router[_0xca29('0x5')]('/',auth['isAuthenticated'](),controller[_0xca29('0x6')]);router[_0xca29('0x5')]('/describe',auth[_0xca29('0x7')](),controller['describe']);router[_0xca29('0x5')](_0xca29('0x8'),auth[_0xca29('0x7')](),controller['show']);router['post']('/',auth[_0xca29('0x7')](),controller[_0xca29('0x9')]);router[_0xca29('0xa')]('/:id',auth[_0xca29('0x7')](),controller[_0xca29('0xb')]);router['delete'](_0xca29('0x8'),auth[_0xca29('0x7')](),controller[_0xca29('0xc')]);module[_0xca29('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 77151f6..163a543 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 _0x8d73=['ENUM','blind','STRING','Yes','exports'];(function(_0x37d239,_0x9890dc){var _0x219891=function(_0xff7ebb){while(--_0xff7ebb){_0x37d239['push'](_0x37d239['shift']());}};_0x219891(++_0x9890dc);}(_0x8d73,0x1e4));var _0x38d7=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0x8d73[_0xf7c208];return _0x16992d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x38d7('0x0')]={'type':{'type':Sequelize[_0x38d7('0x1')](_0x38d7('0x2'),'attended')},'result':{'type':Sequelize[_0x38d7('0x3')]},'transfererchannel':{'type':Sequelize[_0x38d7('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x38d7('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x38d7('0x3')]},'transferercontext':{'type':Sequelize[_0x38d7('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x38d7('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x38d7('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x38d7('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x38d7('0x3')]},'transfereeexten':{'type':Sequelize[_0x38d7('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x38d7('0x3')]},'isexternal':{'type':Sequelize[_0x38d7('0x1')](_0x38d7('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x38d7('0x3')]}}; \ No newline at end of file +var _0x184b=['STRING','ENUM','Yes','sequelize','moment','exports','blind','attended'];(function(_0x5e896b,_0x54eb1e){var _0x3798bd=function(_0x82680c){while(--_0x82680c){_0x5e896b['push'](_0x5e896b['shift']());}};_0x3798bd(++_0x54eb1e);}(_0x184b,0x15b));var _0xb184=function(_0x4b25ea,_0x52a3b6){_0x4b25ea=_0x4b25ea-0x0;var _0x41e3d4=_0x184b[_0x4b25ea];return _0x41e3d4;};'use strict';var Sequelize=require(_0xb184('0x0'));var moment=require(_0xb184('0x1'));module[_0xb184('0x2')]={'type':{'type':Sequelize['ENUM'](_0xb184('0x3'),_0xb184('0x4'))},'result':{'type':Sequelize[_0xb184('0x5')]},'transfererchannel':{'type':Sequelize[_0xb184('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xb184('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xb184('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xb184('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xb184('0x5')]},'transfererexten':{'type':Sequelize[_0xb184('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xb184('0x5')]},'transfereechannel':{'type':Sequelize[_0xb184('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xb184('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xb184('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb184('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb184('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xb184('0x5')]},'transfereecontext':{'type':Sequelize[_0xb184('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xb184('0x6')](_0xb184('0x7'),'No')},'context':{'type':Sequelize[_0xb184('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 4b52531..383d24d 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 _0x08b8=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceTransferReport','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','index','map','type','key','model','query'];(function(_0x25f0cd,_0x4cde3e){var _0x1f442d=function(_0x4fffd1){while(--_0x4fffd1){_0x25f0cd['push'](_0x25f0cd['shift']());}};_0x1f442d(++_0x4cde3e);}(_0x08b8,0x139));var _0x808b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x808b('0x0'));var rimraf=require(_0x808b('0x1'));var zipdir=require(_0x808b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x808b('0x3'));var moment=require(_0x808b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x808b('0x5'));var util=require(_0x808b('0x6'));var path=require(_0x808b('0x7'));var sox=require(_0x808b('0x8'));var csv=require(_0x808b('0x9'));var ejs=require(_0x808b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x808b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x808b('0xc'));var toCsv=require(_0x808b('0x9'));var querystring=require('querystring');var Papa=require(_0x808b('0xd'));var Redis=require(_0x808b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x808b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x808b('0x10'));var logger=require(_0x808b('0x11'))('api');var utils=require(_0x808b('0x12'));var config=require(_0x808b('0x13'));var licenseUtil=require(_0x808b('0x14'));var db=require(_0x808b('0x15'))['db'];function respondWithStatusCode(_0x343175,_0x16a81a){_0x16a81a=_0x16a81a||0xcc;return function(_0x3c23b6){if(_0x3c23b6){return _0x343175[_0x808b('0x16')](_0x16a81a);}return _0x343175[_0x808b('0x17')](_0x16a81a)['end']();};}function respondWithResult(_0x4e27c8,_0x1d86ae){_0x1d86ae=_0x1d86ae||0xc8;return function(_0x21d846){if(_0x21d846){return _0x4e27c8[_0x808b('0x17')](_0x1d86ae)[_0x808b('0x18')](_0x21d846);}};}function respondWithFilteredResult(_0xffb16c,_0x544ee2){return function(_0x5bedd7){if(_0x5bedd7){var _0x34e653=typeof _0x544ee2[_0x808b('0x19')]===_0x808b('0x1a')&&typeof _0x544ee2[_0x808b('0x1b')]===_0x808b('0x1a');var _0x3a9a9b=_0x5bedd7[_0x808b('0x1c')];var _0x3917c1=_0x34e653?0x0:_0x544ee2['offset'];var _0x3ba575=_0x34e653?_0x5bedd7[_0x808b('0x1c')]:_0x544ee2['offset']+_0x544ee2[_0x808b('0x1b')];var _0x51fb4f;if(_0x3ba575>=_0x3a9a9b){_0x3ba575=_0x3a9a9b;_0x51fb4f=0xc8;}else{_0x51fb4f=0xce;}_0xffb16c[_0x808b('0x17')](_0x51fb4f);return _0xffb16c['set']('Content-Range',_0x3917c1+'-'+_0x3ba575+'/'+_0x3a9a9b)[_0x808b('0x18')](_0x5bedd7);}return null;};}function patchUpdates(_0x188c32){return function(_0x29ab83){try{jsonpatch[_0x808b('0x1d')](_0x29ab83,_0x188c32,!![]);}catch(_0x52a8a0){return BPromise[_0x808b('0x1e')](_0x52a8a0);}return _0x29ab83[_0x808b('0x1f')]();};}function saveUpdates(_0x2c55a9,_0x4f80e0){return function(_0x15e4bd){if(_0x15e4bd){return _0x15e4bd[_0x808b('0x20')](_0x2c55a9)[_0x808b('0x21')](function(_0x4373dc){return _0x4373dc;});}return null;};}function removeEntity(_0x206e58,_0xea9ae1){return function(_0x127543){if(_0x127543){return _0x127543['destroy']()[_0x808b('0x21')](function(){_0x206e58[_0x808b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41c46e,_0x5d687a){return function(_0x572330){if(!_0x572330){_0x41c46e[_0x808b('0x16')](0x194);}return _0x572330;};}function handleError(_0x2e573c,_0x54a2bb){_0x54a2bb=_0x54a2bb||0x1f4;return function(_0x1786d7){logger['error'](_0x1786d7[_0x808b('0x22')]);if(_0x1786d7[_0x808b('0x23')]){delete _0x1786d7[_0x808b('0x23')];}_0x2e573c[_0x808b('0x17')](_0x54a2bb)['send'](_0x1786d7);};}exports[_0x808b('0x24')]=function(_0x543054,_0x44136e){var _0x3f69e5={},_0x1667e3={},_0x106909={'count':0x0,'rows':[]};var _0x3ae02c=_[_0x808b('0x25')](db['VoiceTransferReport']['rawAttributes'],function(_0x3d4e1a){return{'name':_0x3d4e1a['fieldName'],'type':_0x3d4e1a[_0x808b('0x26')][_0x808b('0x27')]};});_0x1667e3[_0x808b('0x28')]=_[_0x808b('0x25')](_0x3ae02c,_0x808b('0x23'));_0x1667e3[_0x808b('0x29')]=_['keys'](_0x543054[_0x808b('0x29')]);_0x1667e3[_0x808b('0x2a')]=_[_0x808b('0x2b')](_0x1667e3[_0x808b('0x28')],_0x1667e3['query']);_0x3f69e5[_0x808b('0x2c')]=_[_0x808b('0x2b')](_0x1667e3[_0x808b('0x28')],qs[_0x808b('0x2d')](_0x543054[_0x808b('0x29')][_0x808b('0x2d')]));_0x3f69e5[_0x808b('0x2c')]=_0x3f69e5[_0x808b('0x2c')]['length']?_0x3f69e5[_0x808b('0x2c')]:_0x1667e3[_0x808b('0x28')];if(!_0x543054[_0x808b('0x29')][_0x808b('0x2e')](_0x808b('0x2f'))){_0x3f69e5['limit']=qs[_0x808b('0x1b')](_0x543054['query'][_0x808b('0x1b')]);_0x3f69e5[_0x808b('0x19')]=qs['offset'](_0x543054['query'][_0x808b('0x19')]);}_0x3f69e5[_0x808b('0x30')]=qs[_0x808b('0x31')](_0x543054[_0x808b('0x29')][_0x808b('0x31')]);_0x3f69e5[_0x808b('0x32')]=qs['filters'](_[_0x808b('0x33')](_0x543054['query'],_0x1667e3['filters']),_0x3ae02c);if(_0x543054[_0x808b('0x29')]['filter']){_0x3f69e5['where']=_[_0x808b('0x34')](_0x3f69e5[_0x808b('0x32')],{'$or':_[_0x808b('0x25')](_0x3ae02c,function(_0x9c2a91){if(_0x9c2a91[_0x808b('0x26')]!==_0x808b('0x35')){var _0x30c5df={};_0x30c5df[_0x9c2a91[_0x808b('0x23')]]={'$like':'%'+_0x543054['query'][_0x808b('0x36')]+'%'};return _0x30c5df;}})});}_0x3f69e5=_[_0x808b('0x34')]({},_0x3f69e5,_0x543054[_0x808b('0x37')]);var _0x44d7f5={'where':_0x3f69e5[_0x808b('0x32')]};return db[_0x808b('0x38')][_0x808b('0x1c')](_0x44d7f5)[_0x808b('0x21')](function(_0x1f5c7c){_0x106909[_0x808b('0x1c')]=_0x1f5c7c;if(_0x543054['query'][_0x808b('0x39')]){_0x3f69e5['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0x808b('0x3a')](_0x3f69e5);})[_0x808b('0x21')](function(_0x202e79){_0x106909[_0x808b('0x3b')]=_0x202e79;return _0x106909;})[_0x808b('0x21')](respondWithFilteredResult(_0x44136e,_0x3f69e5))[_0x808b('0x3c')](handleError(_0x44136e,null));};exports[_0x808b('0x3d')]=function(_0x24dc5c,_0x578a10){var _0xd64920={'raw':!![],'where':{'id':_0x24dc5c[_0x808b('0x3e')]['id']}},_0x160ea={};_0x160ea[_0x808b('0x28')]=_[_0x808b('0x3f')](db[_0x808b('0x38')][_0x808b('0x40')]);_0x160ea[_0x808b('0x29')]=_['keys'](_0x24dc5c[_0x808b('0x29')]);_0x160ea[_0x808b('0x2a')]=_[_0x808b('0x2b')](_0x160ea[_0x808b('0x28')],_0x160ea[_0x808b('0x29')]);_0xd64920[_0x808b('0x2c')]=_[_0x808b('0x2b')](_0x160ea['model'],qs[_0x808b('0x2d')](_0x24dc5c[_0x808b('0x29')][_0x808b('0x2d')]));_0xd64920[_0x808b('0x2c')]=_0xd64920[_0x808b('0x2c')][_0x808b('0x41')]?_0xd64920[_0x808b('0x2c')]:_0x160ea[_0x808b('0x28')];if(_0x24dc5c[_0x808b('0x29')][_0x808b('0x39')]){_0xd64920[_0x808b('0x42')]=[{'all':!![]}];}_0xd64920=_[_0x808b('0x34')]({},_0xd64920,_0x24dc5c['options']);return db[_0x808b('0x38')][_0x808b('0x43')](_0xd64920)['then'](handleEntityNotFound(_0x578a10,null))[_0x808b('0x21')](respondWithResult(_0x578a10,null))[_0x808b('0x3c')](handleError(_0x578a10,null));};exports['create']=function(_0x1aa41,_0x2f94bd){return db['VoiceTransferReport'][_0x808b('0x44')](_0x1aa41['body'],{})[_0x808b('0x21')](respondWithResult(_0x2f94bd,0xc9))['catch'](handleError(_0x2f94bd,null));};exports[_0x808b('0x20')]=function(_0x48743c,_0x295625){if(_0x48743c[_0x808b('0x45')]['id']){delete _0x48743c[_0x808b('0x45')]['id'];}return db[_0x808b('0x38')][_0x808b('0x43')]({'where':{'id':_0x48743c[_0x808b('0x3e')]['id']}})[_0x808b('0x21')](handleEntityNotFound(_0x295625,null))[_0x808b('0x21')](saveUpdates(_0x48743c[_0x808b('0x45')],null))['then'](respondWithResult(_0x295625,null))[_0x808b('0x3c')](handleError(_0x295625,null));};exports['destroy']=function(_0x5b30c7,_0x103c4d){return db[_0x808b('0x38')][_0x808b('0x43')]({'where':{'id':_0x5b30c7[_0x808b('0x3e')]['id']}})[_0x808b('0x21')](handleEntityNotFound(_0x103c4d,null))[_0x808b('0x21')](removeEntity(_0x103c4d,null))[_0x808b('0x3c')](handleError(_0x103c4d,null));};exports[_0x808b('0x46')]=function(_0x52fe25,_0x4410b1){return db[_0x808b('0x38')][_0x808b('0x46')]()['then'](respondWithResult(_0x4410b1,null))[_0x808b('0x3c')](handleError(_0x4410b1,null));}; \ No newline at end of file +var _0xa133=['hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','name','send','index','VoiceTransferReport','fieldName','type','key','model','map','query','attributes','intersection','length'];(function(_0x56bf30,_0x284c8b){var _0xaea08b=function(_0xf9d135){while(--_0xf9d135){_0x56bf30['push'](_0x56bf30['shift']());}};_0xaea08b(++_0x284c8b);}(_0xa133,0x69));var _0x3a13=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xa133[_0x26b8b5];return _0x2150a9;};'use strict';var emlformat=require(_0x3a13('0x0'));var rimraf=require(_0x3a13('0x1'));var zipdir=require(_0x3a13('0x2'));var jsonpatch=require(_0x3a13('0x3'));var rp=require(_0x3a13('0x4'));var moment=require(_0x3a13('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3a13('0x6'));var util=require(_0x3a13('0x7'));var path=require(_0x3a13('0x8'));var sox=require(_0x3a13('0x9'));var csv=require(_0x3a13('0xa'));var ejs=require(_0x3a13('0xb'));var fs=require('fs');var fs_extra=require(_0x3a13('0xc'));var _=require(_0x3a13('0xd'));var squel=require(_0x3a13('0xe'));var crypto=require(_0x3a13('0xf'));var jsforce=require(_0x3a13('0x10'));var deskjs=require(_0x3a13('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3a13('0x12'));var Papa=require(_0x3a13('0x13'));var Redis=require(_0x3a13('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a13('0x15'));var hardwareService=require(_0x3a13('0x16'));var logger=require(_0x3a13('0x17'))(_0x3a13('0x18'));var utils=require(_0x3a13('0x19'));var config=require(_0x3a13('0x1a'));var licenseUtil=require(_0x3a13('0x1b'));var db=require(_0x3a13('0x1c'))['db'];function respondWithStatusCode(_0x48b92a,_0x7378ed){_0x7378ed=_0x7378ed||0xcc;return function(_0x479e49){if(_0x479e49){return _0x48b92a['sendStatus'](_0x7378ed);}return _0x48b92a[_0x3a13('0x1d')](_0x7378ed)['end']();};}function respondWithResult(_0x3caf96,_0x4671a3){_0x4671a3=_0x4671a3||0xc8;return function(_0x38dbf7){if(_0x38dbf7){return _0x3caf96[_0x3a13('0x1d')](_0x4671a3)['json'](_0x38dbf7);}};}function respondWithFilteredResult(_0x4efbcf,_0x28197b){return function(_0x20346d){if(_0x20346d){var _0x5b4f97=typeof _0x28197b['offset']===_0x3a13('0x1e')&&typeof _0x28197b['limit']===_0x3a13('0x1e');var _0x420e91=_0x20346d[_0x3a13('0x1f')];var _0x1e8385=_0x5b4f97?0x0:_0x28197b['offset'];var _0x18b877=_0x5b4f97?_0x20346d[_0x3a13('0x1f')]:_0x28197b[_0x3a13('0x20')]+_0x28197b['limit'];var _0x2213b1;if(_0x18b877>=_0x420e91){_0x18b877=_0x420e91;_0x2213b1=0xc8;}else{_0x2213b1=0xce;}_0x4efbcf[_0x3a13('0x1d')](_0x2213b1);return _0x4efbcf[_0x3a13('0x21')](_0x3a13('0x22'),_0x1e8385+'-'+_0x18b877+'/'+_0x420e91)[_0x3a13('0x23')](_0x20346d);}return null;};}function patchUpdates(_0x486956){return function(_0x3bf38b){try{jsonpatch[_0x3a13('0x24')](_0x3bf38b,_0x486956,!![]);}catch(_0x42b116){return BPromise['reject'](_0x42b116);}return _0x3bf38b[_0x3a13('0x25')]();};}function saveUpdates(_0xf88aa2,_0x222d9d){return function(_0x5e0d51){if(_0x5e0d51){return _0x5e0d51[_0x3a13('0x26')](_0xf88aa2)[_0x3a13('0x27')](function(_0x1666b2){return _0x1666b2;});}return null;};}function removeEntity(_0x1ac773,_0x22da78){return function(_0x11f6e4){if(_0x11f6e4){return _0x11f6e4[_0x3a13('0x28')]()[_0x3a13('0x27')](function(){_0x1ac773['status'](0xcc)[_0x3a13('0x29')]();});}};}function handleEntityNotFound(_0x3c9593,_0x19c6b8){return function(_0x2a9a34){if(!_0x2a9a34){_0x3c9593[_0x3a13('0x2a')](0x194);}return _0x2a9a34;};}function handleError(_0x1408cf,_0x334b7d){_0x334b7d=_0x334b7d||0x1f4;return function(_0x5e644b){logger[_0x3a13('0x2b')](_0x5e644b['stack']);if(_0x5e644b[_0x3a13('0x2c')]){delete _0x5e644b[_0x3a13('0x2c')];}_0x1408cf['status'](_0x334b7d)[_0x3a13('0x2d')](_0x5e644b);};}exports[_0x3a13('0x2e')]=function(_0x1c874a,_0x256f03){var _0x235ea={},_0x5c080d={},_0x152e84={'count':0x0,'rows':[]};var _0x3cf20a=_['map'](db[_0x3a13('0x2f')]['rawAttributes'],function(_0x4486a8){return{'name':_0x4486a8[_0x3a13('0x30')],'type':_0x4486a8[_0x3a13('0x31')][_0x3a13('0x32')]};});_0x5c080d[_0x3a13('0x33')]=_[_0x3a13('0x34')](_0x3cf20a,_0x3a13('0x2c'));_0x5c080d['query']=_['keys'](_0x1c874a[_0x3a13('0x35')]);_0x5c080d['filters']=_['intersection'](_0x5c080d[_0x3a13('0x33')],_0x5c080d[_0x3a13('0x35')]);_0x235ea[_0x3a13('0x36')]=_[_0x3a13('0x37')](_0x5c080d[_0x3a13('0x33')],qs['fields'](_0x1c874a[_0x3a13('0x35')]['fields']));_0x235ea[_0x3a13('0x36')]=_0x235ea['attributes'][_0x3a13('0x38')]?_0x235ea['attributes']:_0x5c080d[_0x3a13('0x33')];if(!_0x1c874a[_0x3a13('0x35')][_0x3a13('0x39')]('nolimit')){_0x235ea[_0x3a13('0x3a')]=qs[_0x3a13('0x3a')](_0x1c874a[_0x3a13('0x35')][_0x3a13('0x3a')]);_0x235ea[_0x3a13('0x20')]=qs[_0x3a13('0x20')](_0x1c874a[_0x3a13('0x35')][_0x3a13('0x20')]);}_0x235ea[_0x3a13('0x3b')]=qs[_0x3a13('0x3c')](_0x1c874a[_0x3a13('0x35')]['sort']);_0x235ea[_0x3a13('0x3d')]=qs[_0x3a13('0x3e')](_[_0x3a13('0x3f')](_0x1c874a[_0x3a13('0x35')],_0x5c080d['filters']),_0x3cf20a);if(_0x1c874a['query'][_0x3a13('0x40')]){_0x235ea[_0x3a13('0x3d')]=_[_0x3a13('0x41')](_0x235ea[_0x3a13('0x3d')],{'$or':_[_0x3a13('0x34')](_0x3cf20a,function(_0x3859c7){if(_0x3859c7[_0x3a13('0x31')]!==_0x3a13('0x42')){var _0x1dba62={};_0x1dba62[_0x3859c7[_0x3a13('0x2c')]]={'$like':'%'+_0x1c874a['query'][_0x3a13('0x40')]+'%'};return _0x1dba62;}})});}_0x235ea=_['merge']({},_0x235ea,_0x1c874a['options']);var _0x2efbe6={'where':_0x235ea[_0x3a13('0x3d')]};return db['VoiceTransferReport']['count'](_0x2efbe6)['then'](function(_0x44b03d){_0x152e84[_0x3a13('0x1f')]=_0x44b03d;if(_0x1c874a['query'][_0x3a13('0x43')]){_0x235ea[_0x3a13('0x44')]=[{'all':!![]}];}return db[_0x3a13('0x2f')][_0x3a13('0x45')](_0x235ea);})[_0x3a13('0x27')](function(_0x1a5edf){_0x152e84['rows']=_0x1a5edf;return _0x152e84;})[_0x3a13('0x27')](respondWithFilteredResult(_0x256f03,_0x235ea))[_0x3a13('0x46')](handleError(_0x256f03,null));};exports[_0x3a13('0x47')]=function(_0x2fa60e,_0x1c10ec){var _0xe9243d={'raw':!![],'where':{'id':_0x2fa60e[_0x3a13('0x48')]['id']}},_0x2427ee={};_0x2427ee[_0x3a13('0x33')]=_[_0x3a13('0x49')](db[_0x3a13('0x2f')][_0x3a13('0x4a')]);_0x2427ee[_0x3a13('0x35')]=_['keys'](_0x2fa60e['query']);_0x2427ee[_0x3a13('0x3e')]=_['intersection'](_0x2427ee['model'],_0x2427ee[_0x3a13('0x35')]);_0xe9243d[_0x3a13('0x36')]=_[_0x3a13('0x37')](_0x2427ee[_0x3a13('0x33')],qs[_0x3a13('0x4b')](_0x2fa60e[_0x3a13('0x35')]['fields']));_0xe9243d[_0x3a13('0x36')]=_0xe9243d[_0x3a13('0x36')][_0x3a13('0x38')]?_0xe9243d[_0x3a13('0x36')]:_0x2427ee[_0x3a13('0x33')];if(_0x2fa60e['query'][_0x3a13('0x43')]){_0xe9243d[_0x3a13('0x44')]=[{'all':!![]}];}_0xe9243d=_[_0x3a13('0x41')]({},_0xe9243d,_0x2fa60e[_0x3a13('0x4c')]);return db['VoiceTransferReport'][_0x3a13('0x4d')](_0xe9243d)[_0x3a13('0x27')](handleEntityNotFound(_0x1c10ec,null))[_0x3a13('0x27')](respondWithResult(_0x1c10ec,null))[_0x3a13('0x46')](handleError(_0x1c10ec,null));};exports[_0x3a13('0x4e')]=function(_0x51ec9a,_0x46c628){return db[_0x3a13('0x2f')][_0x3a13('0x4e')](_0x51ec9a[_0x3a13('0x4f')],{})['then'](respondWithResult(_0x46c628,0xc9))[_0x3a13('0x46')](handleError(_0x46c628,null));};exports['update']=function(_0x564173,_0x3ebbbb){if(_0x564173[_0x3a13('0x4f')]['id']){delete _0x564173[_0x3a13('0x4f')]['id'];}return db['VoiceTransferReport'][_0x3a13('0x4d')]({'where':{'id':_0x564173[_0x3a13('0x48')]['id']}})[_0x3a13('0x27')](handleEntityNotFound(_0x3ebbbb,null))[_0x3a13('0x27')](saveUpdates(_0x564173[_0x3a13('0x4f')],null))[_0x3a13('0x27')](respondWithResult(_0x3ebbbb,null))[_0x3a13('0x46')](handleError(_0x3ebbbb,null));};exports[_0x3a13('0x28')]=function(_0x430eed,_0x75a39a){return db['VoiceTransferReport'][_0x3a13('0x4d')]({'where':{'id':_0x430eed[_0x3a13('0x48')]['id']}})['then'](handleEntityNotFound(_0x75a39a,null))['then'](removeEntity(_0x75a39a,null))[_0x3a13('0x46')](handleError(_0x75a39a,null));};exports[_0x3a13('0x50')]=function(_0x281cd8,_0x5c3814){return db[_0x3a13('0x2f')][_0x3a13('0x50')]()[_0x3a13('0x27')](respondWithResult(_0x5c3814,null))['catch'](handleError(_0x5c3814,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 72807f6..a07057a 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 _0x8384=['request-promise','path','exports','define','VoiceTransferReport','report_call_transfer','moment','bluebird'];(function(_0x281be2,_0x37e568){var _0x12599a=function(_0x354db3){while(--_0x354db3){_0x281be2['push'](_0x281be2['shift']());}};_0x12599a(++_0x37e568);}(_0x8384,0x6e));var _0x4838=function(_0x1ca761,_0x341ed6){_0x1ca761=_0x1ca761-0x0;var _0x25104e=_0x8384[_0x1ca761];return _0x25104e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4838('0x0'));var BPromise=require(_0x4838('0x1'));var rp=require(_0x4838('0x2'));var fs=require('fs');var path=require(_0x4838('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x4838('0x4')]=function(_0x327c63,_0x317c8b){return _0x327c63[_0x4838('0x5')](_0x4838('0x6'),attributes,{'tableName':_0x4838('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4152=['rimraf','./voiceTransferReport.attributes','exports','VoiceTransferReport','lodash','../../config/logger','api','moment','request-promise'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x4152,0xca));var _0x2415=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0x4152[_0x361d3f];return _0x320229;};'use strict';var _=require(_0x2415('0x0'));var util=require('util');var logger=require(_0x2415('0x1'))(_0x2415('0x2'));var moment=require(_0x2415('0x3'));var BPromise=require('bluebird');var rp=require(_0x2415('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2415('0x5'));var config=require('../../config/environment');var attributes=require(_0x2415('0x6'));module[_0x2415('0x7')]=function(_0x2fbf99,_0x204618){return _0x2fbf99['define'](_0x2415('0x8'),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 3149e57..958bf3b 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 _0x3d5c=['code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d5c,0xa2));var _0xc3d5=function(_0x584a03,_0x59e0c8){_0x584a03=_0x584a03-0x0;var _0x29d9c9=_0x3d5c[_0x584a03];return _0x29d9c9;};'use strict';var _=require(_0xc3d5('0x0'));var util=require(_0xc3d5('0x1'));var moment=require('moment');var BPromise=require(_0xc3d5('0x2'));var rs=require(_0xc3d5('0x3'));var fs=require('fs');var Redis=require(_0xc3d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3d5('0x5'))(_0xc3d5('0x6'));var config=require(_0xc3d5('0x7'));var jayson=require(_0xc3d5('0x8'));var client=jayson[_0xc3d5('0x9')][_0xc3d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3046cf,_0x508eff,_0x260622){return new BPromise(function(_0x5d9b99,_0x7ec13a){return client[_0xc3d5('0xb')](_0x3046cf,_0x260622)[_0xc3d5('0xc')](function(_0x33df54){logger['info'](_0xc3d5('0xd'),_0x508eff,_0xc3d5('0xe'));logger['debug'](_0xc3d5('0xf'),_0x508eff,'request\x20sent',JSON[_0xc3d5('0x10')](_0x33df54));if(_0x33df54[_0xc3d5('0x11')]){if(_0x33df54[_0xc3d5('0x11')][_0xc3d5('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x508eff,_0x33df54[_0xc3d5('0x11')][_0xc3d5('0x13')]);return _0x7ec13a(_0x33df54['error'][_0xc3d5('0x13')]);}logger[_0xc3d5('0x11')](_0xc3d5('0xd'),_0x508eff,_0x33df54[_0xc3d5('0x11')]['message']);return _0x5d9b99(_0x33df54[_0xc3d5('0x11')][_0xc3d5('0x13')]);}else{logger[_0xc3d5('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x508eff,'request\x20sent');_0x5d9b99(_0x33df54[_0xc3d5('0x15')][_0xc3d5('0x13')]);}})[_0xc3d5('0x16')](function(_0x1b425e){logger[_0xc3d5('0x11')](_0xc3d5('0xd'),_0x508eff,_0x1b425e);_0x7ec13a(_0x1b425e);});});}exports[_0xc3d5('0x17')]=function(_0x19696f){var _0x41c202=this;return new Promise(function(_0x582366,_0x1de63a){return db[_0xc3d5('0x18')][_0xc3d5('0x19')](_0x19696f[_0xc3d5('0x1a')],{'raw':_0x19696f[_0xc3d5('0x1b')]?_0x19696f[_0xc3d5('0x1b')][_0xc3d5('0x1c')]===undefined?!![]:![]:!![]})[_0xc3d5('0xc')](function(_0x2e10af){logger[_0xc3d5('0x14')]('CreateVoiceTransferReport',_0x19696f);logger[_0xc3d5('0x1d')](_0xc3d5('0x17'),_0x19696f,JSON[_0xc3d5('0x10')](_0x2e10af));_0x582366(_0x2e10af);})[_0xc3d5('0x16')](function(_0x53ac72){logger[_0xc3d5('0x11')](_0xc3d5('0x17'),_0x53ac72[_0xc3d5('0x13')],_0x19696f);_0x1de63a(_0x41c202[_0xc3d5('0x11')](0x1f4,_0x53ac72['message']));});});}; \ No newline at end of file +var _0x2b6b=['request','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateVoiceTransferReport','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x288515,_0x1dbb35){var _0x34e27e=function(_0x559fe6){while(--_0x559fe6){_0x288515['push'](_0x288515['shift']());}};_0x34e27e(++_0x1dbb35);}(_0x2b6b,0xf0));var _0xb2b6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2b6b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xb2b6('0x0'));var util=require(_0xb2b6('0x1'));var moment=require(_0xb2b6('0x2'));var BPromise=require(_0xb2b6('0x3'));var rs=require(_0xb2b6('0x4'));var fs=require('fs');var Redis=require(_0xb2b6('0x5'));var db=require(_0xb2b6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2b6('0x7'))(_0xb2b6('0x8'));var config=require(_0xb2b6('0x9'));var jayson=require(_0xb2b6('0xa'));var client=jayson['client'][_0xb2b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x116063,_0x26efff,_0x1ecdd2){return new BPromise(function(_0x21686d,_0x509b1e){return client[_0xb2b6('0xc')](_0x116063,_0x1ecdd2)[_0xb2b6('0xd')](function(_0x15a690){logger[_0xb2b6('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x26efff,'request\x20sent');logger[_0xb2b6('0xf')](_0xb2b6('0x10'),_0x26efff,'request\x20sent',JSON[_0xb2b6('0x11')](_0x15a690));if(_0x15a690[_0xb2b6('0x12')]){if(_0x15a690[_0xb2b6('0x12')][_0xb2b6('0x13')]===0x1f4){logger[_0xb2b6('0x12')](_0xb2b6('0x14'),_0x26efff,_0x15a690['error'][_0xb2b6('0x15')]);return _0x509b1e(_0x15a690[_0xb2b6('0x12')][_0xb2b6('0x15')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x26efff,_0x15a690[_0xb2b6('0x12')]['message']);return _0x21686d(_0x15a690[_0xb2b6('0x12')][_0xb2b6('0x15')]);}else{logger[_0xb2b6('0xe')](_0xb2b6('0x14'),_0x26efff,_0xb2b6('0x16'));_0x21686d(_0x15a690[_0xb2b6('0x17')][_0xb2b6('0x15')]);}})[_0xb2b6('0x18')](function(_0x1a3388){logger[_0xb2b6('0x12')](_0xb2b6('0x14'),_0x26efff,_0x1a3388);_0x509b1e(_0x1a3388);});});}exports[_0xb2b6('0x19')]=function(_0x215584){var _0x42eeca=this;return new Promise(function(_0x3593f2,_0x44bc00){return db['VoiceTransferReport'][_0xb2b6('0x1a')](_0x215584['body'],{'raw':_0x215584[_0xb2b6('0x1b')]?_0x215584[_0xb2b6('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x199f4e){logger['info'](_0xb2b6('0x19'),_0x215584);logger[_0xb2b6('0xf')](_0xb2b6('0x19'),_0x215584,JSON[_0xb2b6('0x11')](_0x199f4e));_0x3593f2(_0x199f4e);})[_0xb2b6('0x18')](function(_0x4f5e33){logger['error'](_0xb2b6('0x19'),_0x4f5e33['message'],_0x215584);_0x44bc00(_0x42eeca[_0xb2b6('0x12')](0x1f4,_0x4f5e33[_0xb2b6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index e298fc4..1686b91 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/calls','calls'];(function(_0x5a2ca9,_0x48ef85){var _0x27b9ef=function(_0x2483c0){while(--_0x2483c0){_0x5a2ca9['push'](_0x5a2ca9['shift']());}};_0x27b9ef(++_0x48ef85);}(_0xe706,0xa3));var _0x6e70=function(_0x4f485f,_0x1db0f7){_0x4f485f=_0x4f485f-0x0;var _0x1e998e=_0xe706[_0x4f485f];return _0x1e998e;};'use strict';var express=require(_0x6e70('0x0'));var router=express[_0x6e70('0x1')]();var auth=require(_0x6e70('0x2'));var controller=require('./webbar.controller');router[_0x6e70('0x3')](_0x6e70('0x4'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x7')]);router[_0x6e70('0x3')](_0x6e70('0x8'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x9')]);router[_0x6e70('0x3')](_0x6e70('0xa'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x3')](_0x6e70('0xc'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x3')](_0x6e70('0xe'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['unhold']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x3')](_0x6e70('0x11'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['transfer']);module['exports']=router; \ No newline at end of file +var _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0x13e89c,_0x6ac156){var _0x14192b=function(_0x4bb49b){while(--_0x4bb49b){_0x13e89c['push'](_0x13e89c['shift']());}};_0x14192b(++_0x6ac156);}(_0x0bb5,0x148));var _0x50bb=function(_0x4249e9,_0x2e9bb4){_0x4249e9=_0x4249e9-0x0;var _0x41fac6=_0x0bb5[_0x4249e9];return _0x41fac6;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 65335ec..b4270b7 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca66=['sessionId\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','code','message','result','catch','User','findOne','agent','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','hangup','hangup\x20fired:','validate','then','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','sessionId','answer\x20executed!','hold','webbar:hold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transferNumber','transfer\x20executed!','path','../../config/environment','util','bluebird','client','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x47c5bd,_0x7605da){var _0x2447dc=function(_0x1d4bff){while(--_0x1d4bff){_0x47c5bd['push'](_0x47c5bd['shift']());}};_0x2447dc(++_0x7605da);}(_0xca66,0x8b));var _0x6ca6=function(_0x49c82e,_0x5457d0){_0x49c82e=_0x49c82e-0x0;var _0x59934a=_0xca66[_0x49c82e];return _0x59934a;};'use strict';var path=require(_0x6ca6('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x6ca6('0x1'));var util=require(_0x6ca6('0x2'));var BPromise=require(_0x6ca6('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x6ca6('0x4')]['http']({'port':0x232a});var logger=require(_0x6ca6('0x5'))('webbarapi');var Redis=require(_0x6ca6('0x6'));config[_0x6ca6('0x7')]=_[_0x6ca6('0x8')](config[_0x6ca6('0x7')],{'host':_0x6ca6('0x9'),'port':0x18eb});var io=require(_0x6ca6('0xa'))(new Redis(config[_0x6ca6('0x7')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'callNumber':{'type':_0x6ca6('0xd'),'required':[!![],_0x6ca6('0xe')]},'callerId':{'type':_0x6ca6('0xd')},'callbackUrl':{'type':_0x6ca6('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':'string','required':[!![],_0x6ca6('0xf')]},'transferNumber':{'type':_0x6ca6('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6ca6('0xb'),'required':[!![],_0x6ca6('0xc')]},'sessionId':{'type':_0x6ca6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6ca6('0xc')]}});function emit(_0x19e94f,_0x260b56,_0x3f03e6){logger[_0x6ca6('0x10')](_0x19e94f,_0x260b56,JSON[_0x6ca6('0x11')](_0x3f03e6));io['to'](_0x19e94f)[_0x6ca6('0x12')](_0x260b56,_0x3f03e6);}function handleError(_0x4f056d){return function(_0x2391ce){console[_0x6ca6('0x13')](_0x6ca6('0x14'),_0x2391ce,_0x2391ce instanceof RangeError);logger[_0x6ca6('0x15')](_0x2391ce[_0x6ca6('0x16')]);if(_0x2391ce instanceof RangeError){if(_0x2391ce[_0x6ca6('0x17')]){delete _0x2391ce[_0x6ca6('0x17')];}_0x4f056d[_0x6ca6('0x18')](0x194)[_0x6ca6('0x19')](_0x2391ce);}else{if(_0x2391ce[_0x6ca6('0x17')]){delete _0x2391ce[_0x6ca6('0x17')];}_0x4f056d['status'](0x1f4)[_0x6ca6('0x19')](_0x2391ce);}};}function checkError(){return function(_0x254afe){if(!_0x254afe){throw new RangeError(_0x6ca6('0x1a'));}return _0x254afe;};}function respondWithRpcPromise(_0x195c92,_0x3a24aa){return new BPromise(function(_0x438694,_0x593f15){var _0xfb962d=amiClient;return _0xfb962d[_0x6ca6('0x1b')](_0x195c92,_0x3a24aa)['then'](function(_0x4927c1){if(_0x4927c1[_0x6ca6('0x15')]){if(_0x4927c1[_0x6ca6('0x15')][_0x6ca6('0x1c')]===0x1f4){return _0x593f15(_0x4927c1[_0x6ca6('0x15')][_0x6ca6('0x1d')]);}return _0x438694(_0x4927c1['error'][_0x6ca6('0x1d')]);}else{_0x438694(_0x4927c1[_0x6ca6('0x1e')]);}})[_0x6ca6('0x1f')](function(_0x2d8c64){_0x593f15(_0x2d8c64);});});}function getAgent(_0x3971a2){return db[_0x6ca6('0x20')][_0x6ca6('0x21')]({'where':{'id':_0x3971a2,'role':_0x6ca6('0x22')}})['then'](checkError());}function getAgentCheckSession(_0x55b07f,_0x144ec5){return new BPromise(function(_0x9467bd,_0xf1d821){var _0x141c0f=respondWithRpcPromise('VoiceChannels');var _0x5ea6f7=getAgent(_0x55b07f);Promise[_0x6ca6('0x23')]([_0x141c0f,_0x5ea6f7])['then'](function(_0x4ab84c){var _0x141e78=_0x4ab84c[0x0];var _0xefd407=_0x4ab84c[0x1];var _0x4a15cb=_[_0x6ca6('0x24')](_0x141e78[_0x6ca6('0x25')],function(_0xac50e8){return _0xac50e8[_0x6ca6('0x26')]==_0xefd407['id']&&_0xac50e8['sessionId']==_0x144ec5;});if(_0x4a15cb[_0x6ca6('0x27')]==0x1){_0x9467bd(_0xefd407);}else{_0xf1d821(new RangeError(_0x6ca6('0x28')+_0x144ec5+_0x6ca6('0x29')));}});});}exports[_0x6ca6('0x2a')]=function(_0x480264,_0x467a89){logger[_0x6ca6('0x10')](_0x6ca6('0x2b'),_0x480264[_0x6ca6('0x2c')]);var _0x5788a2=originateValidation['validate'](_0x480264['body']);if(_0x5788a2['length']>0x0){return _0x467a89['status'](0x190)[_0x6ca6('0x2d')](_0x5788a2);}var _0x3389c2=_0x480264[_0x6ca6('0x2c')]['userId'];var _0x206ecd=_0x480264[_0x6ca6('0x2c')][_0x6ca6('0x2e')];var _0x388e32=_0x480264['body'][_0x6ca6('0x2f')];var _0x40de00=_0x480264[_0x6ca6('0x2c')][_0x6ca6('0x30')];return getAgent(_0x3389c2)['then'](function(_0x1e28b4){logger['info'](_0x6ca6('0x31'),_0x1e28b4['name']);emit(util['format'](_0x6ca6('0x32'),_0x1e28b4[_0x6ca6('0x17')]),_0x6ca6('0x33'),{'callNumber':_0x206ecd,'callerId':_0x388e32,'callbackUrl':_0x40de00});return _0x467a89[_0x6ca6('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x6ca6('0x1f')](handleError(_0x467a89));};exports[_0x6ca6('0x34')]=function(_0x49c8a4,_0x43c2cb){logger['info'](_0x6ca6('0x35'),_0x49c8a4['body']);var _0x1ada8b=hangupValidation[_0x6ca6('0x36')](_0x49c8a4[_0x6ca6('0x2c')]);if(_0x1ada8b[_0x6ca6('0x27')]>0x0){return _0x43c2cb[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x1ada8b);}var _0x45e77b=_0x49c8a4[_0x6ca6('0x2c')]['userId'];var _0x2f6daf=_0x49c8a4['body']['sessionId'];return getAgent(_0x45e77b)[_0x6ca6('0x37')](function(_0x306eda){logger['info'](_0x6ca6('0x31'),_0x306eda['name']);emit(util[_0x6ca6('0x38')](_0x6ca6('0x32'),_0x306eda[_0x6ca6('0x17')]),_0x6ca6('0x39'),{'sessionId':_0x2f6daf});return _0x43c2cb['status'](0xc8)['json']({'error':![],'message':_0x6ca6('0x3a')});})[_0x6ca6('0x1f')](handleError(_0x43c2cb));};exports[_0x6ca6('0x3b')]=function(_0x3423e2,_0x4e6d4){logger['info'](_0x6ca6('0x3c'),_0x3423e2[_0x6ca6('0x2c')]);var _0x5bed6e=answerValidation[_0x6ca6('0x36')](_0x3423e2[_0x6ca6('0x2c')]);if(_0x5bed6e[_0x6ca6('0x27')]>0x0){return _0x4e6d4[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x5bed6e);}var _0x3e658e=_0x3423e2[_0x6ca6('0x2c')][_0x6ca6('0x3d')];var _0x1a8b7e=_0x3423e2['body'][_0x6ca6('0x3e')];return getAgent(_0x3e658e)[_0x6ca6('0x37')](function(_0x243661){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x243661[_0x6ca6('0x17')]);emit(util[_0x6ca6('0x38')](_0x6ca6('0x32'),_0x243661['name']),'webbar:answer',{'sessionId':_0x1a8b7e});return _0x4e6d4[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':_0x6ca6('0x3f')});})[_0x6ca6('0x1f')](handleError(_0x4e6d4));};exports[_0x6ca6('0x40')]=function(_0x33f5d5,_0x1f51f4){logger['info']('hold\x20fired:',_0x33f5d5[_0x6ca6('0x2c')]);var _0x42b263=holdValidation['validate'](_0x33f5d5[_0x6ca6('0x2c')]);if(_0x42b263[_0x6ca6('0x27')]>0x0){return _0x1f51f4[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x42b263);}var _0xc1928f=_0x33f5d5[_0x6ca6('0x2c')][_0x6ca6('0x3d')];var _0x5f27f5=_0x33f5d5[_0x6ca6('0x2c')][_0x6ca6('0x3e')];return getAgent(_0xc1928f)[_0x6ca6('0x37')](function(_0x4fde51){logger[_0x6ca6('0x10')]('entityFound:',_0x4fde51[_0x6ca6('0x17')]);emit(util['format']('user:%s',_0x4fde51['name']),_0x6ca6('0x41'),{'sessionId':_0x5f27f5});return _0x1f51f4[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0x6ca6('0x1f')](handleError(_0x1f51f4));};exports['unhold']=function(_0x1f552d,_0x1010a6){logger[_0x6ca6('0x10')](_0x6ca6('0x42'),_0x1f552d[_0x6ca6('0x2c')]);var _0x2e6364=unholdValidation[_0x6ca6('0x36')](_0x1f552d[_0x6ca6('0x2c')]);if(_0x2e6364[_0x6ca6('0x27')]>0x0){return _0x1010a6[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x2e6364);}var _0x5578fb=_0x1f552d[_0x6ca6('0x2c')][_0x6ca6('0x3d')];var _0x1de2ca=_0x1f552d[_0x6ca6('0x2c')][_0x6ca6('0x3e')];return getAgent(_0x5578fb)['then'](function(_0x14d87a){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x14d87a['name']);emit(util['format']('user:%s',_0x14d87a['name']),_0x6ca6('0x43'),{'sessionId':_0x1de2ca});return _0x1010a6[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x1010a6));};exports[_0x6ca6('0x44')]=function(_0x2cbf30,_0x2591de){logger['info'](_0x6ca6('0x45'),_0x2591de['body']);var _0x281759=callsValidation[_0x6ca6('0x36')](_0x2cbf30[_0x6ca6('0x2c')]);if(_0x281759[_0x6ca6('0x27')]>0x0){return _0x2591de['status'](0x190)[_0x6ca6('0x2d')](_0x281759);}var _0x4874d8=_0x2cbf30['body'][_0x6ca6('0x3d')];var _0x11538e=respondWithRpcPromise(_0x6ca6('0x46'));var _0x35854a=getAgent(_0x4874d8);return Promise['all']([_0x11538e,_0x35854a])[_0x6ca6('0x37')](function(_0x1c12ae){var _0x2c4053=_0x1c12ae[0x0];var _0x13d3ea=_0x1c12ae[0x1];var _0x43881a=_[_0x6ca6('0x24')](_0x2c4053[_0x6ca6('0x25')],function(_0x405609){return _0x405609[_0x6ca6('0x26')]==_0x13d3ea['id'];});return _0x2591de[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'count':_0x43881a[_0x6ca6('0x27')],'rows':_0x43881a});})[_0x6ca6('0x1f')](handleError(_0x2591de));};exports[_0x6ca6('0x47')]=function(_0x2eeed6,_0x290c04){logger['info'](_0x6ca6('0x48'),_0x2eeed6[_0x6ca6('0x2c')]);var _0x2f4886=conferenceValidation[_0x6ca6('0x36')](_0x2eeed6[_0x6ca6('0x2c')]);if(_0x2f4886[_0x6ca6('0x27')]>0x0){return _0x290c04[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0x2f4886);}var _0x3328ea=_0x2eeed6[_0x6ca6('0x2c')][_0x6ca6('0x3d')];return getAgent(_0x3328ea)[_0x6ca6('0x37')](function(_0x9834d6){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x9834d6[_0x6ca6('0x17')]);emit(util['format'](_0x6ca6('0x32'),_0x9834d6[_0x6ca6('0x17')]),_0x6ca6('0x49'));return _0x290c04[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':_0x6ca6('0x4a')});})['catch'](handleError(_0x290c04));};exports['transfer']=function(_0x509fe3,_0x21f786){logger[_0x6ca6('0x10')]('transfer\x20fired:',_0x509fe3[_0x6ca6('0x2c')]);var _0xc6021a=transferValidation[_0x6ca6('0x36')](_0x509fe3['body']);if(_0xc6021a[_0x6ca6('0x27')]>0x0){return _0x21f786[_0x6ca6('0x18')](0x190)[_0x6ca6('0x2d')](_0xc6021a);}var _0x1c3064=_0x509fe3[_0x6ca6('0x2c')]['userId'];var _0x514684=_0x509fe3[_0x6ca6('0x2c')][_0x6ca6('0x3e')];var _0x47d420=_0x509fe3[_0x6ca6('0x2c')][_0x6ca6('0x4b')];return getAgent(_0x1c3064)[_0x6ca6('0x37')](function(_0x19e7ac){logger[_0x6ca6('0x10')](_0x6ca6('0x31'),_0x19e7ac[_0x6ca6('0x17')]);emit(util[_0x6ca6('0x38')](_0x6ca6('0x32'),_0x19e7ac['name']),'webbar:transfer',{'sessionId':_0x514684,'transferNumber':_0x47d420});return _0x21f786[_0x6ca6('0x18')](0xc8)[_0x6ca6('0x2d')]({'error':![],'message':_0x6ca6('0x4c')});})[_0x6ca6('0x1f')](handleError(_0x21f786));}; \ No newline at end of file +var _0xee5b=['answer\x20executed!','hold','hold\x20fired:','sessionId','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','ioredis','redis','defaults','userId\x20is\x20required','string','callNumber\x20is\x20required','number','info','stringify','log','handleError:','error','stack','name','status','send','request','then','code','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','\x20not\x20found!','body','validate','json','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','originate\x20executed!','catch','hangup','userId','format','user:%s','webbar:hangup','hangup\x20executed!','answer\x20fired:'];(function(_0x4a73dc,_0x39669c){var _0x109f74=function(_0x33707c){while(--_0x33707c){_0x4a73dc['push'](_0x4a73dc['shift']());}};_0x109f74(++_0x39669c);}(_0xee5b,0x1f4));var _0xbee5=function(_0x576313,_0x20fd32){_0x576313=_0x576313-0x0;var _0x4627bf=_0xee5b[_0x576313];return _0x4627bf;};'use strict';var path=require(_0xbee5('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xbee5('0x1'))['db'];var config=require(_0xbee5('0x2'));var util=require('util');var BPromise=require(_0xbee5('0x3'));var jayson=require(_0xbee5('0x4'));var amiClient=jayson[_0xbee5('0x5')][_0xbee5('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xbee5('0x7'));config[_0xbee5('0x8')]=_[_0xbee5('0x9')](config[_0xbee5('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbee5('0xa')]},'callNumber':{'type':_0xbee5('0xb'),'required':[!![],_0xbee5('0xc')]},'callerId':{'type':_0xbee5('0xb')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xbee5('0xb'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbee5('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbee5('0xa')]}});function emit(_0x141878,_0xf676b1,_0x53b269){logger[_0xbee5('0xe')](_0x141878,_0xf676b1,JSON[_0xbee5('0xf')](_0x53b269));io['to'](_0x141878)['emit'](_0xf676b1,_0x53b269);}function handleError(_0x254dd3){return function(_0x538460){console[_0xbee5('0x10')](_0xbee5('0x11'),_0x538460,_0x538460 instanceof RangeError);logger[_0xbee5('0x12')](_0x538460[_0xbee5('0x13')]);if(_0x538460 instanceof RangeError){if(_0x538460[_0xbee5('0x14')]){delete _0x538460[_0xbee5('0x14')];}_0x254dd3[_0xbee5('0x15')](0x194)[_0xbee5('0x16')](_0x538460);}else{if(_0x538460[_0xbee5('0x14')]){delete _0x538460[_0xbee5('0x14')];}_0x254dd3[_0xbee5('0x15')](0x1f4)[_0xbee5('0x16')](_0x538460);}};}function checkError(){return function(_0x450824){if(!_0x450824){throw new RangeError('NotFound');}return _0x450824;};}function respondWithRpcPromise(_0x550325,_0x469a7a){return new BPromise(function(_0x48bfb5,_0x205491){var _0x117cb3=amiClient;return _0x117cb3[_0xbee5('0x17')](_0x550325,_0x469a7a)[_0xbee5('0x18')](function(_0x3f23c5){if(_0x3f23c5[_0xbee5('0x12')]){if(_0x3f23c5[_0xbee5('0x12')][_0xbee5('0x19')]===0x1f4){return _0x205491(_0x3f23c5[_0xbee5('0x12')]['message']);}return _0x48bfb5(_0x3f23c5['error']['message']);}else{_0x48bfb5(_0x3f23c5['result']);}})['catch'](function(_0x1af3de){_0x205491(_0x1af3de);});});}function getAgent(_0x18d7f4){return db[_0xbee5('0x1a')][_0xbee5('0x1b')]({'where':{'id':_0x18d7f4,'role':_0xbee5('0x1c')}})[_0xbee5('0x18')](checkError());}function getAgentCheckSession(_0x3c8643,_0x4e9a79){return new BPromise(function(_0x36b50f,_0x402bc4){var _0x179d14=respondWithRpcPromise(_0xbee5('0x1d'));var _0x1a8bcc=getAgent(_0x3c8643);Promise['all']([_0x179d14,_0x1a8bcc])[_0xbee5('0x18')](function(_0x15ffb1){var _0xb7a077=_0x15ffb1[0x0];var _0x136a00=_0x15ffb1[0x1];var _0xa57f85=_[_0xbee5('0x1e')](_0xb7a077[_0xbee5('0x1f')],function(_0x36e8bb){return _0x36e8bb[_0xbee5('0x20')]==_0x136a00['id']&&_0x36e8bb['sessionId']==_0x4e9a79;});if(_0xa57f85[_0xbee5('0x21')]==0x1){_0x36b50f(_0x136a00);}else{_0x402bc4(new RangeError('sessionId\x20'+_0x4e9a79+_0xbee5('0x22')));}});});}exports['originate']=function(_0x2d20cd,_0x52dad9){logger[_0xbee5('0xe')]('originate\x20fired:',_0x2d20cd[_0xbee5('0x23')]);var _0x135587=originateValidation[_0xbee5('0x24')](_0x2d20cd[_0xbee5('0x23')]);if(_0x135587['length']>0x0){return _0x52dad9[_0xbee5('0x15')](0x190)[_0xbee5('0x25')](_0x135587);}var _0x477a03=_0x2d20cd[_0xbee5('0x23')]['userId'];var _0x24aed0=_0x2d20cd[_0xbee5('0x23')][_0xbee5('0x26')];var _0x30a2fc=_0x2d20cd['body'][_0xbee5('0x27')];var _0xe61341=_0x2d20cd[_0xbee5('0x23')][_0xbee5('0x28')];return getAgent(_0x477a03)['then'](function(_0x3c8a87){logger['info'](_0xbee5('0x29'),_0x3c8a87['name']);emit(util['format']('user:%s',_0x3c8a87[_0xbee5('0x14')]),_0xbee5('0x2a'),{'callNumber':_0x24aed0,'callerId':_0x30a2fc,'callbackUrl':_0xe61341});return _0x52dad9[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':_0xbee5('0x2b')});})[_0xbee5('0x2c')](handleError(_0x52dad9));};exports[_0xbee5('0x2d')]=function(_0x4040b3,_0x58452a){logger[_0xbee5('0xe')]('hangup\x20fired:',_0x4040b3[_0xbee5('0x23')]);var _0x16ea3e=hangupValidation[_0xbee5('0x24')](_0x4040b3[_0xbee5('0x23')]);if(_0x16ea3e['length']>0x0){return _0x58452a[_0xbee5('0x15')](0x190)['json'](_0x16ea3e);}var _0x565e9f=_0x4040b3[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x2e2827=_0x4040b3[_0xbee5('0x23')]['sessionId'];return getAgent(_0x565e9f)[_0xbee5('0x18')](function(_0x2819e2){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x2819e2[_0xbee5('0x14')]);emit(util[_0xbee5('0x2f')](_0xbee5('0x30'),_0x2819e2[_0xbee5('0x14')]),_0xbee5('0x31'),{'sessionId':_0x2e2827});return _0x58452a[_0xbee5('0x15')](0xc8)['json']({'error':![],'message':_0xbee5('0x32')});})[_0xbee5('0x2c')](handleError(_0x58452a));};exports['answer']=function(_0x1e872d,_0xebbcc5){logger[_0xbee5('0xe')](_0xbee5('0x33'),_0x1e872d['body']);var _0x4cfe54=answerValidation['validate'](_0x1e872d[_0xbee5('0x23')]);if(_0x4cfe54[_0xbee5('0x21')]>0x0){return _0xebbcc5[_0xbee5('0x15')](0x190)[_0xbee5('0x25')](_0x4cfe54);}var _0x4012fd=_0x1e872d[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x2c4464=_0x1e872d[_0xbee5('0x23')]['sessionId'];return getAgent(_0x4012fd)['then'](function(_0x38e9f5){logger['info'](_0xbee5('0x29'),_0x38e9f5[_0xbee5('0x14')]);emit(util['format'](_0xbee5('0x30'),_0x38e9f5[_0xbee5('0x14')]),'webbar:answer',{'sessionId':_0x2c4464});return _0xebbcc5['status'](0xc8)[_0xbee5('0x25')]({'error':![],'message':_0xbee5('0x34')});})['catch'](handleError(_0xebbcc5));};exports[_0xbee5('0x35')]=function(_0x2974f6,_0x4c88ee){logger[_0xbee5('0xe')](_0xbee5('0x36'),_0x2974f6[_0xbee5('0x23')]);var _0x2978db=holdValidation[_0xbee5('0x24')](_0x2974f6[_0xbee5('0x23')]);if(_0x2978db[_0xbee5('0x21')]>0x0){return _0x4c88ee['status'](0x190)[_0xbee5('0x25')](_0x2978db);}var _0x34f01d=_0x2974f6[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x5ba5f1=_0x2974f6[_0xbee5('0x23')][_0xbee5('0x37')];return getAgent(_0x34f01d)[_0xbee5('0x18')](function(_0x4aa21a){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x4aa21a['name']);emit(util['format']('user:%s',_0x4aa21a[_0xbee5('0x14')]),'webbar:hold',{'sessionId':_0x5ba5f1});return _0x4c88ee[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':_0xbee5('0x38')});})[_0xbee5('0x2c')](handleError(_0x4c88ee));};exports[_0xbee5('0x39')]=function(_0x296fc8,_0x55e654){logger[_0xbee5('0xe')](_0xbee5('0x3a'),_0x296fc8[_0xbee5('0x23')]);var _0x2479f6=unholdValidation['validate'](_0x296fc8[_0xbee5('0x23')]);if(_0x2479f6['length']>0x0){return _0x55e654[_0xbee5('0x15')](0x190)[_0xbee5('0x25')](_0x2479f6);}var _0xf48059=_0x296fc8[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x1b02eb=_0x296fc8[_0xbee5('0x23')][_0xbee5('0x37')];return getAgent(_0xf48059)[_0xbee5('0x18')](function(_0x31abcd){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x31abcd[_0xbee5('0x14')]);emit(util[_0xbee5('0x2f')](_0xbee5('0x30'),_0x31abcd['name']),_0xbee5('0x3b'),{'sessionId':_0x1b02eb});return _0x55e654[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':'unhold\x20executed!'});})[_0xbee5('0x2c')](handleError(_0x55e654));};exports[_0xbee5('0x3c')]=function(_0x21d9c6,_0x4e8864){logger[_0xbee5('0xe')]('calls\x20fired:',_0x4e8864[_0xbee5('0x23')]);var _0x4ee645=callsValidation[_0xbee5('0x24')](_0x21d9c6[_0xbee5('0x23')]);if(_0x4ee645[_0xbee5('0x21')]>0x0){return _0x4e8864['status'](0x190)['json'](_0x4ee645);}var _0x5528e8=_0x21d9c6[_0xbee5('0x23')][_0xbee5('0x2e')];var _0xbc3da7=respondWithRpcPromise('VoiceChannels');var _0x4d8c34=getAgent(_0x5528e8);return Promise['all']([_0xbc3da7,_0x4d8c34])[_0xbee5('0x18')](function(_0x33fbb8){var _0x32ec82=_0x33fbb8[0x0];var _0x5cc68d=_0x33fbb8[0x1];var _0x154d44=_[_0xbee5('0x1e')](_0x32ec82[_0xbee5('0x1f')],function(_0x3fa83b){return _0x3fa83b[_0xbee5('0x20')]==_0x5cc68d['id'];});return _0x4e8864[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'count':_0x154d44[_0xbee5('0x21')],'rows':_0x154d44});})[_0xbee5('0x2c')](handleError(_0x4e8864));};exports[_0xbee5('0x3d')]=function(_0x38100e,_0x245521){logger[_0xbee5('0xe')](_0xbee5('0x3e'),_0x38100e[_0xbee5('0x23')]);var _0x143fd9=conferenceValidation[_0xbee5('0x24')](_0x38100e['body']);if(_0x143fd9[_0xbee5('0x21')]>0x0){return _0x245521['status'](0x190)['json'](_0x143fd9);}var _0x43941c=_0x38100e[_0xbee5('0x23')]['userId'];return getAgent(_0x43941c)['then'](function(_0x9c0fbb){logger['info'](_0xbee5('0x29'),_0x9c0fbb[_0xbee5('0x14')]);emit(util['format'](_0xbee5('0x30'),_0x9c0fbb[_0xbee5('0x14')]),_0xbee5('0x3f'));return _0x245521[_0xbee5('0x15')](0xc8)['json']({'error':![],'message':_0xbee5('0x40')});})['catch'](handleError(_0x245521));};exports[_0xbee5('0x41')]=function(_0x465ec8,_0x5c4c2c){logger[_0xbee5('0xe')](_0xbee5('0x42'),_0x465ec8['body']);var _0xf006d4=transferValidation[_0xbee5('0x24')](_0x465ec8['body']);if(_0xf006d4[_0xbee5('0x21')]>0x0){return _0x5c4c2c['status'](0x190)[_0xbee5('0x25')](_0xf006d4);}var _0x4b5789=_0x465ec8[_0xbee5('0x23')]['userId'];var _0x541414=_0x465ec8[_0xbee5('0x23')][_0xbee5('0x37')];var _0x3b5eda=_0x465ec8[_0xbee5('0x23')][_0xbee5('0x43')];return getAgent(_0x4b5789)[_0xbee5('0x18')](function(_0x4c6a0b){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x4c6a0b[_0xbee5('0x14')]);emit(util[_0xbee5('0x2f')](_0xbee5('0x30'),_0x4c6a0b[_0xbee5('0x14')]),_0xbee5('0x44'),{'sessionId':_0x541414,'transferNumber':_0x3b5eda});return _0x5c4c2c[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':'transfer\x20executed!'});})[_0xbee5('0x2c')](handleError(_0x5c4c2c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 04bd6ad..9204b53 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file +var _0x8e3f=['addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x2372f6,_0x6d9037){var _0x330529=function(_0xf2e72f){while(--_0xf2e72f){_0x2372f6['push'](_0x2372f6['shift']());}};_0x330529(++_0x6d9037);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var fs_extra=require(_0xf8e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var controller=require('./whatsappAccount.controller');router[_0xf8e3('0x8')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xa')]);router[_0xf8e3('0x8')]('/describe',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xb')]);router[_0xf8e3('0x8')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xd')]);router[_0xf8e3('0x8')](_0xf8e3('0xe'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xf')]);router[_0xf8e3('0x8')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller[_0xf8e3('0x11')]);router[_0xf8e3('0x8')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x13')]);router[_0xf8e3('0x8')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller['getApplications']);router[_0xf8e3('0x15')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x16')]);router['post'](_0xf8e3('0xe'),auth['isAuthenticated'](),controller[_0xf8e3('0x17')]);router[_0xf8e3('0x15')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xf8e3('0x15')](_0xf8e3('0x12'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x18')]);router[_0xf8e3('0x15')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x19')]);router[_0xf8e3('0x15')](_0xf8e3('0x1a'),controller['notify']);router[_0xf8e3('0x15')](_0xf8e3('0x1b'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1c')]);router[_0xf8e3('0x1d')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1e')]);router['delete'](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1f')]);router[_0xf8e3('0x20')]('/:id/dispositions',auth[_0xf8e3('0x9')](),controller['removeDispositions']);router[_0xf8e3('0x20')](_0xf8e3('0x10'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x21')]);router[_0xf8e3('0x20')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x22')]);module[_0xf8e3('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f4e0cff..f7569be 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x077e=['exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0xfb889f,_0x12597f){var _0x1a1cb1=function(_0x363c97){while(--_0x363c97){_0xfb889f['push'](_0xfb889f['shift']());}};_0x1a1cb1(++_0x12597f);}(_0x077e,0x1c0));var _0xe077=function(_0x352e4a,_0x18b9df){_0x352e4a=_0x352e4a-0x0;var _0x4d64e8=_0x077e[_0x352e4a];return _0x4d64e8;};'use strict';var Sequelize=require(_0xe077('0x0'));var rs=require(_0xe077('0x1'));module[_0xe077('0x2')]={'name':{'type':Sequelize[_0xe077('0x3')],'unique':_0xe077('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe077('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe077('0x5')]();}},'phone':{'type':Sequelize[_0xe077('0x3')]},'type':{'type':Sequelize[_0xe077('0x6')](_0xe077('0x7'),_0xe077('0x8'))},'accountSid':{'type':Sequelize[_0xe077('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe077('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe077('0x9')],'defaultValue':function(){return _0xe077('0xa');}},'notificationSound':{'type':Sequelize[_0xe077('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe077('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe077('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe077('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe077('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xe077('0xb')],'defaultValue':![],'comment':_0xe077('0xe'),'set':function(_0x4be00d){if(!_0x4be00d){this[_0xe077('0xf')](_0xe077('0x10'),null);}this['setDataValue'](_0xe077('0x11'),_0x4be00d);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c65=['ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x1af469,_0x584d95){var _0x336171=function(_0x574e25){while(--_0x574e25){_0x1af469['push'](_0x1af469['shift']());}};_0x336171(++_0x584d95);}(_0x5c65,0xbe));var _0x55c6=function(_0x3c03b1,_0x2d9e4a){_0x3c03b1=_0x3c03b1-0x0;var _0x21606c=_0x5c65[_0x3c03b1];return _0x21606c;};'use strict';var Sequelize=require(_0x55c6('0x0'));var rs=require(_0x55c6('0x1'));module[_0x55c6('0x2')]={'name':{'type':Sequelize[_0x55c6('0x3')],'unique':_0x55c6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x55c6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x55c6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x55c6('0x3')],'defaultValue':function(){return rs[_0x55c6('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x55c6('0x6')](_0x55c6('0x7'),_0x55c6('0x8'))},'accountSid':{'type':Sequelize[_0x55c6('0x3')]},'baseUrl':{'type':Sequelize[_0x55c6('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x55c6('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x55c6('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x55c6('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x55c6('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x55c6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x55c6('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x55c6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x55c6('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x55c6('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x34582e){if(!_0x34582e){this[_0x55c6('0xc')]('mandatoryDispositionPauseId',null);}this[_0x55c6('0xc')](_0x55c6('0xd'),_0x34582e);}},'description':{'type':Sequelize[_0x55c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 490ec74..5b7e415 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81d3=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','WhatsappAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','sort','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','message_id','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','defaults','contact','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','info','entity\x20found','Content-Type','text/xml','\x0a','List','out','Messages','dataValues','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','Pause','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81d3,0x12a));var _0x381d=function(_0x3319bc,_0xbaba1b){_0x3319bc=_0x3319bc-0x0;var _0x419db9=_0x81d3[_0x3319bc];return _0x419db9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x381d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x381d('0x1'));var moment=require('moment');var BPromise=require(_0x381d('0x2'));var Mustache=require(_0x381d('0x3'));var util=require(_0x381d('0x4'));var path=require(_0x381d('0x5'));var sox=require(_0x381d('0x6'));var csv=require(_0x381d('0x7'));var ejs=require(_0x381d('0x8'));var fs=require('fs');var fs_extra=require(_0x381d('0x9'));var _=require(_0x381d('0xa'));var squel=require(_0x381d('0xb'));var crypto=require(_0x381d('0xc'));var jsforce=require(_0x381d('0xd'));var deskjs=require(_0x381d('0xe'));var toCsv=require(_0x381d('0x7'));var querystring=require(_0x381d('0xf'));var Papa=require(_0x381d('0x10'));var Redis=require(_0x381d('0x11'));var authService=require(_0x381d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x381d('0x13'));var hardwareService=require(_0x381d('0x14'));var logger=require(_0x381d('0x15'))(_0x381d('0x16'));var utils=require(_0x381d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x381d('0x18'));var db=require(_0x381d('0x19'))['db'];config[_0x381d('0x1a')]=_['defaults'](config[_0x381d('0x1a')],{'host':_0x381d('0x1b'),'port':0x18eb});var socket=require(_0x381d('0x1c'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x381d('0x1d')](socket);var jayson=require(_0x381d('0x1e'));var client=jayson[_0x381d('0x1f')][_0x381d('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x16ae10,_0x34df03,_0x4b49c1,_0x23dac4){return new BPromise(function(_0x3c77be,_0x12c2cf){var _0x4c1ccc=_0x23dac4||client;return _0x4c1ccc[_0x381d('0x21')](_0x16ae10,_0x4b49c1)[_0x381d('0x22')](function(_0x41a65c){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x34df03,_0x381d('0x23'));logger[_0x381d('0x24')](_0x381d('0x25'),_0x34df03,_0x381d('0x23'),JSON[_0x381d('0x26')](_0x41a65c));if(_0x41a65c['error']){if(_0x41a65c[_0x381d('0x27')][_0x381d('0x28')]===0x1f4){logger[_0x381d('0x27')](_0x381d('0x29'),_0x34df03,_0x41a65c['error'][_0x381d('0x2a')]);return _0x12c2cf(_0x41a65c[_0x381d('0x27')]['message']);}logger[_0x381d('0x27')](_0x381d('0x29'),_0x34df03,_0x41a65c[_0x381d('0x27')][_0x381d('0x2a')]);return _0x3c77be(_0x41a65c[_0x381d('0x27')][_0x381d('0x2a')]);}else{logger['info'](_0x381d('0x29'),_0x34df03,_0x381d('0x23'));_0x3c77be(_0x41a65c['result']['message']);}})[_0x381d('0x2b')](function(_0x1c33cf){logger[_0x381d('0x27')](_0x381d('0x29'),_0x34df03,_0x1c33cf);_0x12c2cf(_0x1c33cf);});});}function respondWithStatusCode(_0x3e92d5,_0x20ab8c){_0x20ab8c=_0x20ab8c||0xcc;return function(_0xcc4ed3){if(_0xcc4ed3){return _0x3e92d5[_0x381d('0x2c')](_0x20ab8c);}return _0x3e92d5[_0x381d('0x2d')](_0x20ab8c)[_0x381d('0x2e')]();};}function respondWithResult(_0x26ffbe,_0x841f9){_0x841f9=_0x841f9||0xc8;return function(_0x337cb1){if(_0x337cb1){return _0x26ffbe[_0x381d('0x2d')](_0x841f9)[_0x381d('0x2f')](_0x337cb1);}};}function respondWithFilteredResult(_0x1bc28c,_0x1578b3){return function(_0x48d722){if(_0x48d722){var _0x264678=typeof _0x1578b3[_0x381d('0x30')]===_0x381d('0x31')&&typeof _0x1578b3[_0x381d('0x32')]===_0x381d('0x31');var _0x3abcbd=_0x48d722[_0x381d('0x33')];var _0x144041=_0x264678?0x0:_0x1578b3[_0x381d('0x30')];var _0x7741ca=_0x264678?_0x48d722['count']:_0x1578b3[_0x381d('0x30')]+_0x1578b3[_0x381d('0x32')];var _0x497146;if(_0x7741ca>=_0x3abcbd){_0x7741ca=_0x3abcbd;_0x497146=0xc8;}else{_0x497146=0xce;}_0x1bc28c[_0x381d('0x2d')](_0x497146);return _0x1bc28c[_0x381d('0x34')](_0x381d('0x35'),_0x144041+'-'+_0x7741ca+'/'+_0x3abcbd)[_0x381d('0x2f')](_0x48d722);}return null;};}function patchUpdates(_0x29ffae){return function(_0x5e1a6c){try{jsonpatch['apply'](_0x5e1a6c,_0x29ffae,!![]);}catch(_0x10e54d){return BPromise[_0x381d('0x36')](_0x10e54d);}return _0x5e1a6c[_0x381d('0x37')]();};}function saveUpdates(_0x234c91,_0x2284c6){return function(_0x5c0f88){if(_0x5c0f88){return _0x5c0f88[_0x381d('0x38')](_0x234c91)['then'](function(_0x4a7c54){return _0x4a7c54;});}return null;};}function removeEntity(_0x2c6308,_0x39c4cc){return function(_0x516dff){if(_0x516dff){return _0x516dff[_0x381d('0x39')]()[_0x381d('0x22')](function(){var _0x5b07b9=_0x516dff[_0x381d('0x3a')]({'plain':!![]});var _0x3c14b2=_0x381d('0x3b');return db['UserProfileResource'][_0x381d('0x39')]({'where':{'type':_0x3c14b2,'resourceId':_0x5b07b9['id']}})['then'](function(){return _0x516dff;});})[_0x381d('0x22')](function(){_0x2c6308['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x70b4f8,_0x3a4493){return function(_0x554110){if(!_0x554110){_0x70b4f8[_0x381d('0x2c')](0x194);}return _0x554110;};}function handleError(_0x3c1369,_0x32296a){_0x32296a=_0x32296a||0x1f4;return function(_0x2db531){logger[_0x381d('0x27')](_0x2db531[_0x381d('0x3c')]);if(_0x2db531[_0x381d('0x3d')]){delete _0x2db531[_0x381d('0x3d')];}_0x3c1369[_0x381d('0x2d')](_0x32296a)[_0x381d('0x3e')](_0x2db531);};}exports[_0x381d('0x3f')]=function(_0x8ead5f,_0x4446e0){var _0x5face3={'include':[{'model':db['Pause'],'as':_0x381d('0x40')}]},_0x1d4688={},_0x128904={'count':0x0,'rows':[]};var _0xf25438=_[_0x381d('0x41')](db[_0x381d('0x42')][_0x381d('0x43')],function(_0x4bc3f4){return{'name':_0x4bc3f4[_0x381d('0x44')],'type':_0x4bc3f4['type'][_0x381d('0x45')]};});_0x1d4688[_0x381d('0x46')]=_[_0x381d('0x41')](_0xf25438,_0x381d('0x3d'));_0x1d4688[_0x381d('0x47')]=_[_0x381d('0x48')](_0x8ead5f[_0x381d('0x47')]);_0x1d4688[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x1d4688['model'],_0x1d4688[_0x381d('0x47')]);_0x5face3['attributes']=_[_0x381d('0x4a')](_0x1d4688['model'],qs['fields'](_0x8ead5f[_0x381d('0x47')][_0x381d('0x4b')]));_0x5face3['attributes']=_0x5face3['attributes'][_0x381d('0x4c')]?_0x5face3[_0x381d('0x4d')]:_0x1d4688[_0x381d('0x46')];if(!_0x8ead5f[_0x381d('0x47')][_0x381d('0x4e')](_0x381d('0x4f'))){_0x5face3[_0x381d('0x32')]=qs[_0x381d('0x32')](_0x8ead5f[_0x381d('0x47')]['limit']);_0x5face3[_0x381d('0x30')]=qs[_0x381d('0x30')](_0x8ead5f['query']['offset']);}_0x5face3['order']=qs['sort'](_0x8ead5f['query']['sort']);_0x5face3[_0x381d('0x50')]=qs[_0x381d('0x49')](_[_0x381d('0x51')](_0x8ead5f[_0x381d('0x47')],_0x1d4688[_0x381d('0x49')]),_0xf25438);if(_0x8ead5f[_0x381d('0x47')][_0x381d('0x52')]){_0x5face3[_0x381d('0x50')]=_[_0x381d('0x53')](_0x5face3['where'],{'$or':_['map'](_0xf25438,function(_0x55ae55){if(_0x55ae55[_0x381d('0x54')]!==_0x381d('0x55')){var _0x5e40bb={};_0x5e40bb[_0x55ae55['name']]={'$like':'%'+_0x8ead5f['query'][_0x381d('0x52')]+'%'};return _0x5e40bb;}})});}_0x5face3=_[_0x381d('0x53')]({},_0x5face3,_0x8ead5f[_0x381d('0x56')]);var _0x21157f={'where':_0x5face3[_0x381d('0x50')]};return db['WhatsappAccount']['count'](_0x21157f)[_0x381d('0x22')](function(_0x30eb76){_0x128904['count']=_0x30eb76;if(_0x8ead5f[_0x381d('0x47')][_0x381d('0x57')]){_0x5face3['include']=[{'all':!![]}];}return db[_0x381d('0x42')][_0x381d('0x58')](_0x5face3);})[_0x381d('0x22')](function(_0x3bda4e){_0x128904[_0x381d('0x59')]=_0x3bda4e;return _0x128904;})[_0x381d('0x22')](respondWithFilteredResult(_0x4446e0,_0x5face3))[_0x381d('0x2b')](handleError(_0x4446e0,null));};exports[_0x381d('0x5a')]=function(_0x40e9d5,_0x2ef9a1){var _0x4c8651={'raw':![],'where':{'id':_0x40e9d5[_0x381d('0x5b')]['id']},'include':[{'model':db[_0x381d('0x5c')],'as':_0x381d('0x40')}]},_0x354429={};_0x354429['model']=_[_0x381d('0x48')](db['WhatsappAccount'][_0x381d('0x43')]);_0x354429[_0x381d('0x47')]=_[_0x381d('0x48')](_0x40e9d5[_0x381d('0x47')]);_0x354429['filters']=_[_0x381d('0x4a')](_0x354429['model'],_0x354429['query']);_0x4c8651[_0x381d('0x4d')]=_[_0x381d('0x4a')](_0x354429[_0x381d('0x46')],qs[_0x381d('0x4b')](_0x40e9d5[_0x381d('0x47')][_0x381d('0x4b')]));_0x4c8651['attributes']=_0x4c8651[_0x381d('0x4d')][_0x381d('0x4c')]?_0x4c8651[_0x381d('0x4d')]:_0x354429[_0x381d('0x46')];if(_0x40e9d5['query']['includeAll']){_0x4c8651[_0x381d('0x5d')]=[{'all':!![]}];}_0x4c8651=_[_0x381d('0x53')]({},_0x4c8651,_0x40e9d5['options']);return db['WhatsappAccount']['find'](_0x4c8651)['then'](handleEntityNotFound(_0x2ef9a1,null))[_0x381d('0x22')](respondWithResult(_0x2ef9a1,null))[_0x381d('0x2b')](handleError(_0x2ef9a1,null));};exports['create']=function(_0x45e7db,_0x3dd543){return db[_0x381d('0x42')][_0x381d('0x5e')](_0x45e7db[_0x381d('0x5f')],{})[_0x381d('0x22')](function(_0x5414d0){var _0x1ad310=_0x45e7db[_0x381d('0x60')][_0x381d('0x3a')]({'plain':!![]});if(!_0x1ad310)throw new Error(_0x381d('0x61'));if(_0x1ad310['role']===_0x381d('0x60')){var _0x34ffbe=_0x5414d0[_0x381d('0x3a')]({'plain':!![]});var _0x139244='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x139244,'userProfileId':_0x1ad310[_0x381d('0x62')]},'raw':!![]})['then'](function(_0x324c1d){if(_0x324c1d&&_0x324c1d[_0x381d('0x63')]===0x0){return db[_0x381d('0x64')][_0x381d('0x5e')]({'name':_0x34ffbe[_0x381d('0x3d')],'resourceId':_0x34ffbe['id'],'type':_0x324c1d[_0x381d('0x3d')],'sectionId':_0x324c1d['id']},{})[_0x381d('0x22')](function(){return _0x5414d0;});}else{return _0x5414d0;}})[_0x381d('0x2b')](function(_0x3f9422){logger[_0x381d('0x27')](_0x381d('0x65'),_0x3f9422);throw _0x3f9422;});}return _0x5414d0;})[_0x381d('0x22')](respondWithResult(_0x3dd543,0xc9))['catch'](handleError(_0x3dd543,null));};exports[_0x381d('0x38')]=function(_0x2f7e40,_0x1802bb){if(_0x2f7e40[_0x381d('0x5f')]['id']){delete _0x2f7e40[_0x381d('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2f7e40[_0x381d('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x381d('0x40')}]})[_0x381d('0x22')](handleEntityNotFound(_0x1802bb,null))['then'](saveUpdates(_0x2f7e40[_0x381d('0x5f')],null))[_0x381d('0x22')](respondWithResult(_0x1802bb,null))['catch'](handleError(_0x1802bb,null));};exports[_0x381d('0x39')]=function(_0x5cf92a,_0x1d648b){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x5cf92a[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x1d648b,null))[_0x381d('0x22')](removeEntity(_0x1d648b,null))[_0x381d('0x2b')](handleError(_0x1d648b,null));};exports['describe']=function(_0x55bca4,_0x161535){return db['WhatsappAccount'][_0x381d('0x67')]()[_0x381d('0x22')](respondWithResult(_0x161535,null))[_0x381d('0x2b')](handleError(_0x161535,null));};exports[_0x381d('0x68')]=function(_0x4da919,_0x48e4dc,_0x2df078){if(_0x4da919[_0x381d('0x5f')]['id']){delete _0x4da919['body']['id'];}return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x4da919[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x48e4dc,null))[_0x381d('0x22')](function(_0x5cb8c3){if(_0x5cb8c3){_0x4da919[_0x381d('0x5f')][_0x381d('0x69')]=_0x5cb8c3['id'];return db['Disposition']['create'](_0x4da919['body']);}})[_0x381d('0x22')](respondWithResult(_0x48e4dc,null))[_0x381d('0x2b')](handleError(_0x48e4dc,null));};exports['getDispositions']=function(_0x54b4b7,_0x125bd7,_0x46fa23){var _0x2ddc64={'raw':![],'where':{}};var _0x4e9834={};var _0xe6b4fb={'count':0x0,'rows':[]};return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x54b4b7[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x125bd7,null))[_0x381d('0x22')](function(_0x1681fe){if(_0x1681fe){_0x4e9834[_0x381d('0x46')]=_[_0x381d('0x48')](db[_0x381d('0x6b')][_0x381d('0x43')]);_0x4e9834[_0x381d('0x47')]=_[_0x381d('0x48')](_0x54b4b7[_0x381d('0x47')]);_0x4e9834[_0x381d('0x49')]=_['intersection'](_0x4e9834['model'],_0x4e9834[_0x381d('0x47')]);_0x2ddc64[_0x381d('0x4d')]=_[_0x381d('0x4a')](_0x4e9834['model'],qs['fields'](_0x54b4b7[_0x381d('0x47')][_0x381d('0x4b')]));_0x2ddc64[_0x381d('0x4d')]=_0x2ddc64[_0x381d('0x4d')][_0x381d('0x4c')]?_0x2ddc64[_0x381d('0x4d')]:_0x4e9834[_0x381d('0x46')];if(!_0x54b4b7['query'][_0x381d('0x4e')](_0x381d('0x4f'))){_0x2ddc64[_0x381d('0x32')]=qs['limit'](_0x54b4b7[_0x381d('0x47')][_0x381d('0x32')]);_0x2ddc64['offset']=qs['offset'](_0x54b4b7['query']['offset']);}_0x2ddc64['order']=qs['sort'](_0x54b4b7[_0x381d('0x47')]['sort']);_0x2ddc64[_0x381d('0x50')]=qs['filters'](_['pick'](_0x54b4b7[_0x381d('0x47')],_0x4e9834[_0x381d('0x49')]));_0x2ddc64['where'][_0x381d('0x69')]=_0x1681fe['id'];if(_0x54b4b7[_0x381d('0x47')]['filter']){_0x2ddc64[_0x381d('0x50')]=_[_0x381d('0x53')](_0x2ddc64[_0x381d('0x50')],{'$or':_[_0x381d('0x41')](_0x2ddc64['attributes'],function(_0x791ae0){var _0x3ce073={};_0x3ce073[_0x791ae0]={'$like':'%'+_0x54b4b7[_0x381d('0x47')]['filter']+'%'};return _0x3ce073;})});}_0x2ddc64=_[_0x381d('0x53')]({},_0x2ddc64,_0x54b4b7[_0x381d('0x56')]);return db[_0x381d('0x6b')][_0x381d('0x33')]({'where':_0x2ddc64[_0x381d('0x50')]})[_0x381d('0x22')](function(_0x477c66){_0xe6b4fb['count']=_0x477c66;if(_0x54b4b7[_0x381d('0x47')][_0x381d('0x57')]){_0x2ddc64[_0x381d('0x5d')]=[{'all':!![]}];}return db[_0x381d('0x6b')]['findAll'](_0x2ddc64);})[_0x381d('0x22')](function(_0x288dfb){_0xe6b4fb[_0x381d('0x59')]=_0x288dfb;return _0xe6b4fb;});}})[_0x381d('0x22')](respondWithFilteredResult(_0x125bd7,_0x2ddc64))[_0x381d('0x2b')](handleError(_0x125bd7,null));};exports[_0x381d('0x6c')]=function(_0x2433d3,_0x37bbdd,_0x56ee7f){return db[_0x381d('0x42')]['find']({'where':{'id':_0x2433d3[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x37bbdd,null))[_0x381d('0x22')](function(_0x556ccf){if(_0x556ccf){return _0x556ccf[_0x381d('0x6c')](_0x2433d3[_0x381d('0x47')][_0x381d('0x6d')]);}})['then'](respondWithStatusCode(_0x37bbdd,null))['catch'](handleError(_0x37bbdd,null));};exports[_0x381d('0x6e')]=function(_0x10836c,_0x2012c8,_0x1a3002){if(_0x10836c['body']['id']){delete _0x10836c[_0x381d('0x5f')]['id'];}return db['WhatsappAccount'][_0x381d('0x66')]({'where':{'id':_0x10836c[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x2012c8,null))[_0x381d('0x22')](function(_0x1e10ac){if(_0x1e10ac){_0x10836c[_0x381d('0x5f')][_0x381d('0x69')]=_0x1e10ac['id'];return db[_0x381d('0x6f')][_0x381d('0x5e')](_0x10836c['body']);}})[_0x381d('0x22')](respondWithResult(_0x2012c8,null))[_0x381d('0x2b')](handleError(_0x2012c8,null));};exports[_0x381d('0x70')]=function(_0x46bd21,_0x38e3d3,_0x5069f7){var _0x563661={'raw':![],'where':{}};var _0x37b8dc={};var _0x1da5f4={'count':0x0,'rows':[]};return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x46bd21[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x38e3d3,null))[_0x381d('0x22')](function(_0x2870d6){if(_0x2870d6){_0x37b8dc['model']=_[_0x381d('0x48')](db[_0x381d('0x6f')]['rawAttributes']);_0x37b8dc[_0x381d('0x47')]=_['keys'](_0x46bd21[_0x381d('0x47')]);_0x37b8dc[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x37b8dc['model'],_0x37b8dc[_0x381d('0x47')]);_0x563661['attributes']=_[_0x381d('0x4a')](_0x37b8dc[_0x381d('0x46')],qs[_0x381d('0x4b')](_0x46bd21['query']['fields']));_0x563661[_0x381d('0x4d')]=_0x563661[_0x381d('0x4d')][_0x381d('0x4c')]?_0x563661[_0x381d('0x4d')]:_0x37b8dc[_0x381d('0x46')];if(!_0x46bd21[_0x381d('0x47')][_0x381d('0x4e')](_0x381d('0x4f'))){_0x563661['limit']=qs[_0x381d('0x32')](_0x46bd21[_0x381d('0x47')][_0x381d('0x32')]);_0x563661[_0x381d('0x30')]=qs[_0x381d('0x30')](_0x46bd21[_0x381d('0x47')][_0x381d('0x30')]);}_0x563661[_0x381d('0x71')]=qs[_0x381d('0x72')](_0x46bd21[_0x381d('0x47')][_0x381d('0x72')]);_0x563661[_0x381d('0x50')]=qs[_0x381d('0x49')](_[_0x381d('0x51')](_0x46bd21[_0x381d('0x47')],_0x37b8dc[_0x381d('0x49')]));_0x563661[_0x381d('0x50')][_0x381d('0x69')]=_0x2870d6['id'];if(_0x46bd21[_0x381d('0x47')][_0x381d('0x52')]){_0x563661[_0x381d('0x50')]=_['merge'](_0x563661['where'],{'$or':_[_0x381d('0x41')](_0x563661[_0x381d('0x4d')],function(_0x5252c1){var _0x15bc40={};_0x15bc40[_0x5252c1]={'$like':'%'+_0x46bd21[_0x381d('0x47')][_0x381d('0x52')]+'%'};return _0x15bc40;})});}_0x563661=_['merge']({},_0x563661,_0x46bd21[_0x381d('0x56')]);return db[_0x381d('0x6f')][_0x381d('0x33')]({'where':_0x563661[_0x381d('0x50')]})['then'](function(_0x4dc763){_0x1da5f4[_0x381d('0x33')]=_0x4dc763;if(_0x46bd21['query']['includeAll']){_0x563661[_0x381d('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x381d('0x58')](_0x563661);})[_0x381d('0x22')](function(_0xf985ba){_0x1da5f4[_0x381d('0x59')]=_0xf985ba;return _0x1da5f4;});}})[_0x381d('0x22')](respondWithFilteredResult(_0x38e3d3,_0x563661))[_0x381d('0x2b')](handleError(_0x38e3d3,null));};exports[_0x381d('0x73')]=function(_0x3f3c0b,_0x578dda,_0x583d6f){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x3f3c0b[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x578dda,null))['then'](function(_0x3516eb){if(_0x3516eb){return _0x3516eb[_0x381d('0x73')](_0x3f3c0b[_0x381d('0x47')][_0x381d('0x6d')]);}})['then'](respondWithStatusCode(_0x578dda,null))[_0x381d('0x2b')](handleError(_0x578dda,null));};exports[_0x381d('0x74')]=function(_0x5b5f56,_0x1421ce,_0x220b9c){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x5b5f56[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1421ce,null))[_0x381d('0x22')](function(_0x2af7bc){if(_0x2af7bc){return _0x2af7bc[_0x381d('0x74')](_0x5b5f56[_0x381d('0x5f')][_0x381d('0x6d')],_[_0x381d('0x75')](_0x5b5f56[_0x381d('0x5f')],[_0x381d('0x6d'),'id'])||{})[_0x381d('0x76')](function(_0x4dab50){for(var _0x537ada=0x0;_0x537ada<_0x5b5f56[_0x381d('0x5f')][_0x381d('0x6d')][_0x381d('0x4c')];_0x537ada+=0x1){socket['emit'](_0x381d('0x77'),{'UserId':Number(_0x5b5f56[_0x381d('0x5f')][_0x381d('0x6d')][_0x537ada]),'WhatsappAccountId':Number(_0x5b5f56[_0x381d('0x5b')]['id'])});}return _0x4dab50;});}})[_0x381d('0x22')](respondWithResult(_0x1421ce,null))[_0x381d('0x2b')](handleError(_0x1421ce,null));};exports[_0x381d('0x78')]=function(_0x5a5db2,_0x5d8ab0,_0xd463e1){return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x5a5db2[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x5d8ab0,null))[_0x381d('0x22')](function(_0x2df1b1){if(_0x2df1b1){return _0x2df1b1[_0x381d('0x78')](_0x5a5db2['query'][_0x381d('0x6d')])[_0x381d('0x22')](function(){if(_[_0x381d('0x79')](_0x5a5db2[_0x381d('0x47')]['ids'])){for(var _0x458b94=0x0;_0x458b94<_0x5a5db2[_0x381d('0x47')][_0x381d('0x6d')][_0x381d('0x4c')];_0x458b94+=0x1){socket[_0x381d('0x7a')]('userWhatsappAccount:remove',{'UserId':Number(_0x5a5db2['query'][_0x381d('0x6d')][_0x458b94]),'WhatsappAccountId':Number(_0x5a5db2[_0x381d('0x5b')]['id'])});}}else{socket[_0x381d('0x7a')](_0x381d('0x7b'),{'UserId':Number(_0x5a5db2[_0x381d('0x47')]['ids']),'WhatsappAccountId':Number(_0x5a5db2[_0x381d('0x5b')]['id'])});}});}})[_0x381d('0x22')](respondWithStatusCode(_0x5d8ab0,null))['catch'](handleError(_0x5d8ab0,null));};exports[_0x381d('0x7c')]=function(_0x191f1c,_0xcb2802,_0x3c1f6c){var _0x432d1a={};var _0x11809a={};var _0x29b64b;var _0x490a32;return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x191f1c[_0x381d('0x5b')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0xcb2802,null))['then'](function(_0x5aaaa3){if(_0x5aaaa3){_0x29b64b=_0x5aaaa3;_0x11809a['model']=_[_0x381d('0x48')](db[_0x381d('0x7d')]['rawAttributes']);_0x11809a['query']=_[_0x381d('0x48')](_0x191f1c[_0x381d('0x47')]);_0x11809a[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x11809a[_0x381d('0x46')],_0x11809a['query']);_0x432d1a[_0x381d('0x4d')]=_['intersection'](_0x11809a[_0x381d('0x46')],qs[_0x381d('0x4b')](_0x191f1c[_0x381d('0x47')][_0x381d('0x4b')]));_0x432d1a[_0x381d('0x4d')]=_0x432d1a[_0x381d('0x4d')][_0x381d('0x4c')]?_0x432d1a[_0x381d('0x4d')]:_0x11809a[_0x381d('0x46')];_0x432d1a[_0x381d('0x71')]=qs[_0x381d('0x72')](_0x191f1c[_0x381d('0x47')][_0x381d('0x72')]);_0x432d1a[_0x381d('0x50')]=qs['filters'](_[_0x381d('0x51')](_0x191f1c[_0x381d('0x47')],_0x11809a[_0x381d('0x49')]));if(_0x191f1c[_0x381d('0x47')][_0x381d('0x52')]){_0x432d1a[_0x381d('0x50')]=_['merge'](_0x432d1a[_0x381d('0x50')],{'$or':_[_0x381d('0x41')](_0x432d1a['attributes'],function(_0x2137de){var _0x4e920d={};_0x4e920d[_0x2137de]={'$like':'%'+_0x191f1c[_0x381d('0x47')][_0x381d('0x52')]+'%'};return _0x4e920d;})});}_0x432d1a=_[_0x381d('0x53')]({},_0x432d1a,_0x191f1c[_0x381d('0x56')]);return _0x29b64b['getAgents'](_0x432d1a);}})[_0x381d('0x22')](function(_0x4193fd){if(_0x4193fd){_0x490a32=_0x4193fd[_0x381d('0x4c')];if(!_0x191f1c['query'][_0x381d('0x4e')](_0x381d('0x4f'))){_0x432d1a[_0x381d('0x32')]=qs['limit'](_0x191f1c['query'][_0x381d('0x32')]);_0x432d1a[_0x381d('0x30')]=qs[_0x381d('0x30')](_0x191f1c[_0x381d('0x47')][_0x381d('0x30')]);}return _0x29b64b[_0x381d('0x7c')](_0x432d1a);}})[_0x381d('0x22')](function(_0x5e80e8){if(_0x5e80e8){return _0x5e80e8?{'count':_0x490a32,'rows':_0x5e80e8}:null;}})[_0x381d('0x22')](respondWithResult(_0xcb2802,null))[_0x381d('0x2b')](handleError(_0xcb2802,null));};exports[_0x381d('0x7e')]=function(_0x4bebc8,_0x4e1881){var _0x2baa4e=_0x4bebc8[_0x381d('0x5b')]['id'];var _0x12defa=_0x4bebc8[_0x381d('0x5f')];var _0x305187=0xc8;var _0x995fa8=null;return db['sequelize'][_0x381d('0x7f')]({'isolationLevel':db[_0x381d('0x80')]['Transaction'][_0x381d('0x81')][_0x381d('0x82')]},function(_0x499cae){return db['WhatsappAccount'][_0x381d('0x6a')]({'where':{'id':_0x2baa4e},'transaction':_0x499cae})[_0x381d('0x22')](function(_0x239393){if(_0x239393){return db[_0x381d('0x83')]['destroy']({'where':{'WhatsappAccountId':_0x2baa4e},'transaction':_0x499cae})['then'](function(){var _0x8e820d=_[_0x381d('0x41')](_0x12defa,function(_0x5b38a3){_0x5b38a3[_0x381d('0x69')]=_0x2baa4e;return _0x5b38a3;});return db[_0x381d('0x83')][_0x381d('0x84')](_0x8e820d,{'transaction':_0x499cae});});}else{_0x305187=0x194;_0x995fa8=[];}});})['then'](function(){if(_0x305187!==0x194){return db[_0x381d('0x83')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2baa4e},'order':_0x381d('0x85')})[_0x381d('0x22')](function(_0x55c372){_0x995fa8=_0x55c372;});}})[_0x381d('0x2b')](function(_0x10edc8){_0x305187=0x1f4;logger[_0x381d('0x27')](_0x10edc8[_0x381d('0x3c')]);if(_0x10edc8[_0x381d('0x3d')]){delete _0x10edc8[_0x381d('0x3d')];}_0x995fa8=_0x10edc8;})[_0x381d('0x86')](function(){if(_0x995fa8===null){_0x4e1881[_0x381d('0x2c')](_0x305187);}else{if(_0x305187===0x1f4){_0x4e1881['status'](_0x305187)[_0x381d('0x3e')](_0x995fa8);}else{_0x4e1881[_0x381d('0x2d')](_0x305187)[_0x381d('0x2f')](_0x995fa8);}}});};exports['getApplications']=function(_0x3cedaa,_0x403fd3,_0x3f3c5d){var _0x411914={};var _0x21baec={};var _0x4b41b7;var _0x762881;return db[_0x381d('0x42')][_0x381d('0x6a')]({'where':{'id':_0x3cedaa[_0x381d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x403fd3,null))[_0x381d('0x22')](function(_0x4f8679){if(_0x4f8679){_0x4b41b7=_0x4f8679;_0x21baec[_0x381d('0x46')]=_['keys'](db['WhatsappApplication'][_0x381d('0x43')]);_0x21baec[_0x381d('0x47')]=_[_0x381d('0x48')](_0x3cedaa['query']);_0x21baec[_0x381d('0x49')]=_[_0x381d('0x4a')](_0x21baec[_0x381d('0x46')],_0x21baec[_0x381d('0x47')]);_0x411914[_0x381d('0x4d')]=_[_0x381d('0x4a')](_0x21baec['model'],qs['fields'](_0x3cedaa[_0x381d('0x47')]['fields']));_0x411914['attributes']=_0x411914[_0x381d('0x4d')][_0x381d('0x4c')]?_0x411914[_0x381d('0x4d')]:_0x21baec[_0x381d('0x46')];_0x411914[_0x381d('0x71')]=qs[_0x381d('0x72')](_0x3cedaa[_0x381d('0x47')][_0x381d('0x72')]);_0x411914[_0x381d('0x50')]=qs[_0x381d('0x49')](_[_0x381d('0x51')](_0x3cedaa[_0x381d('0x47')],_0x21baec[_0x381d('0x49')]));if(_0x3cedaa[_0x381d('0x47')][_0x381d('0x52')]){_0x411914[_0x381d('0x50')]=_[_0x381d('0x53')](_0x411914[_0x381d('0x50')],{'$or':_[_0x381d('0x41')](_0x411914[_0x381d('0x4d')],function(_0x3a59fb){var _0x1032a1={};_0x1032a1[_0x3a59fb]={'$like':'%'+_0x3cedaa[_0x381d('0x47')][_0x381d('0x52')]+'%'};return _0x1032a1;})});}_0x411914=_[_0x381d('0x53')]({},_0x411914,_0x3cedaa[_0x381d('0x56')]);return _0x4b41b7[_0x381d('0x87')](_0x411914);}})[_0x381d('0x22')](function(_0x33d307){if(_0x33d307){_0x762881=_0x33d307['length'];if(!_0x3cedaa[_0x381d('0x47')]['hasOwnProperty'](_0x381d('0x4f'))){_0x411914[_0x381d('0x32')]=qs[_0x381d('0x32')](_0x3cedaa[_0x381d('0x47')][_0x381d('0x32')]);_0x411914['offset']=qs['offset'](_0x3cedaa['query'][_0x381d('0x30')]);}return _0x4b41b7[_0x381d('0x87')](_0x411914);}})['then'](function(_0x28b716){if(_0x28b716){return _0x28b716?{'count':_0x762881,'rows':_0x28b716}:null;}})[_0x381d('0x22')](respondWithResult(_0x403fd3,null))[_0x381d('0x2b')](handleError(_0x403fd3,null));};exports[_0x381d('0x88')]=function(_0x88aaef,_0x434454,_0x493edb){var _0x59c8f2={'channel':_0x381d('0x89')};var _0x23e687=[];var _0x4e7f72=[];var _0x27d724={};return db[_0x381d('0x42')][_0x381d('0x66')]({'where':{'id':_0x88aaef['params']['id']},'include':[{'model':db[_0x381d('0x83')],'as':_0x381d('0x8a')}]})['then'](handleEntityNotFound(_0x434454,null))[_0x381d('0x22')](function(_0x22326d){_0x59c8f2[_0x381d('0x8b')]=_0x22326d;if(_0x59c8f2[_0x381d('0x8b')]&&_0x59c8f2['account']['type']===_0x381d('0x8c')&&_0x88aaef['body'][_0x381d('0x8d')]){if(_0x88aaef['body'][_0x381d('0x8d')][_0x381d('0x4c')]===0x0)return;if(_0x88aaef[_0x381d('0x5f')][_0x381d('0x8d')][0x0][_0x381d('0x8e')]!=='read')return;return db[_0x381d('0x8f')][_0x381d('0x38')]({'read':!![],'readAt':_0x88aaef[_0x381d('0x5f')][_0x381d('0x8d')][0x0]['timestamp']},{'where':{'messageId':_0x88aaef[_0x381d('0x5f')][_0x381d('0x8d')][0x0][_0x381d('0x90')]},'individualHooks':!![]})[_0x381d('0x22')](function(_0x278412){return _0x434454[_0x381d('0x2d')](0xc8)[_0x381d('0x2f')](_0x278412);});}_0x59c8f2[_0x381d('0x91')]=_['orderBy'](_0x22326d['Applications'],[_0x381d('0x85')],[_0x381d('0x92')]);if(_0x59c8f2[_0x381d('0x8b')][_0x381d('0x8a')]){delete _0x59c8f2['account'][_0x381d('0x8a')];}return db[_0x381d('0x93')]['describe']()[_0x381d('0x22')](function(_0x789f74){if(!_0x789f74){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))](_0x381d('0x96'));}_0x23e687=_[_0x381d('0x97')](_[_0x381d('0x48')](_0x789f74),[_0x381d('0x98'),'updatedAt']);_0x4e7f72=_[_0x381d('0x97')](_[_0x381d('0x48')](_0x789f74),[_0x381d('0x98'),_0x381d('0x99'),'CompanyId',_0x381d('0x9a')]);_0x59c8f2['body']={'mapKey':_0x381d('0x9b')};if(_0x59c8f2['account']&&_0x59c8f2['account'][_0x381d('0x54')]===_0x381d('0x9c')){_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0x9e')]['replace'](_0x381d('0x9f'),'');_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa0')];_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa1')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa2')];}if(_0x59c8f2[_0x381d('0x8b')]&&_0x59c8f2[_0x381d('0x8b')]['type']==='sinch'){_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')]=_0x88aaef[_0x381d('0x5f')]['notifications'][0x0]['from'];_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa3')][0x0][_0x381d('0x2a')]['body'];_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa1')]=_0x88aaef[_0x381d('0x5f')][_0x381d('0xa3')][0x0][_0x381d('0x90')];}if(_0x59c8f2[_0x381d('0x5f')]['id']){delete _0x59c8f2[_0x381d('0x5f')]['id'];}if(_[_0x381d('0xa4')](_0x59c8f2['body']['from'])){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))]('from\x20is\x20mandatory');}if(_[_0x381d('0xa4')](_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')])||_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')]===''){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))](_0x381d('0xa5'));}if(_['isNil'](_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa6')])){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))](_0x381d('0xa7')+_0x4e7f72);}if(!_[_0x381d('0xa8')](_0x4e7f72,_0x59c8f2[_0x381d('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x381d('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e7f72);}_0x27d724[_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa6')]]=_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')];return db[_0x381d('0xa9')][_0x381d('0x66')]({'where':{'id':_0x59c8f2[_0x381d('0x8b')]['ListId']},'include':[{'model':db[_0x381d('0x93')],'as':'Contacts','where':_0x27d724,'limit':0x1,'order':[[_0x381d('0x99'),_0x381d('0xaa')]]}]});})[_0x381d('0x22')](handleEntityNotFound(_0x434454,null))['then'](function(_0x47f2d6){if(_0x47f2d6){_0x59c8f2[_0x381d('0xab')]=_[_0x381d('0x75')](_0x47f2d6,['Contacts']);if(_0x47f2d6[_0x381d('0xac')][_0x381d('0x4c')]){return _0x47f2d6['Contacts'][0x0];}var _0x37e2cf=_[_0x381d('0xad')](_0x59c8f2[_0x381d('0x5f')],{'firstName':_0x59c8f2['body']['from'],'ListId':_0x47f2d6['id']});_0x37e2cf[_0x59c8f2[_0x381d('0x5f')][_0x381d('0xa6')]]=_0x59c8f2[_0x381d('0x5f')][_0x381d('0x9d')];return db['CmContact'][_0x381d('0x5e')](_0x37e2cf,{'fields':_0x23e687,'raw':!![]});}})[_0x381d('0x22')](handleEntityNotFound(_0x434454,null))['then'](function(_0xd73695){if(_0xd73695){_0x59c8f2[_0x381d('0xae')]=_0xd73695;var _0x1f911c={'ContactId':_0xd73695['id'],'phone':_0x59c8f2[_0x381d('0x5f')]['from'],'WhatsappAccountId':_0x88aaef['params']['id']};var _0x7fe700={'ContactId':_0xd73695['id'],'WhatsappAccountId':_0x88aaef[_0x381d('0x5b')]['id'],'closed':![]};return db[_0x381d('0xaf')][_0x381d('0x66')]({'where':_0x7fe700})[_0x381d('0x22')](function(_0x206a8b){if(_0x206a8b){return[_0x206a8b,![]];}return db[_0x381d('0xaf')][_0x381d('0x5e')](_0x1f911c)[_0x381d('0x22')](function(_0x4d5f91){return[_0x4d5f91,!![]];});});}})[_0x381d('0x76')](function(_0x31c5a2,_0xaa15cb){_0x59c8f2['interaction']=_0x31c5a2['get']({'plain':!![]});_0x59c8f2[_0x381d('0xb0')]['created']=![];if(_0xaa15cb){if(_0x59c8f2[_0x381d('0x8b')][_0x381d('0xb1')]){_0x59c8f2['applications'][_0x381d('0xb2')]({'id':0x0,'priority':_0x59c8f2['applications'][_0x381d('0x4c')]+0x1,'app':'close','appdata':_0x381d('0xb3'),'interval':_0x381d('0xb4')});}_0x59c8f2[_0x381d('0xb0')]['created']=!![];}return db[_0x381d('0x8f')][_0x381d('0x5e')]({'phone':_0x59c8f2[_0x381d('0x5f')]['from'],'messageId':_0x59c8f2['body'][_0x381d('0xa1')],'body':_0x59c8f2[_0x381d('0x5f')][_0x381d('0x5f')],'WhatsappAccountId':_0x88aaef[_0x381d('0x5b')]['id'],'WhatsappInteractionId':_0x31c5a2['id'],'direction':'in','ContactId':_0x31c5a2['ContactId'],'AttachmentId':_0x59c8f2[_0x381d('0x5f')][_0x381d('0xb5')]});})[_0x381d('0x22')](function(_0x26b556){_0x59c8f2[_0x381d('0x2a')]=_0x26b556;if(_0x59c8f2[_0x381d('0xb0')][_0x381d('0xb6')]){return db[_0x381d('0x7d')][_0x381d('0x66')]({'attributes':['id',_0x381d('0x3d')],'where':{'id':_0x59c8f2[_0x381d('0xb0')][_0x381d('0xb6')]}})[_0x381d('0x22')](function(_0x3e9b93){if(_0x3e9b93){_0x59c8f2[_0x381d('0x91')][_0x381d('0xb7')]({'id':0x0,'priority':0x0,'app':_0x381d('0xb8'),'appdata':_0x3e9b93[_0x381d('0x3d')]+','+(_0x59c8f2[_0x381d('0x8b')][_0x381d('0xb9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x381d('0xba'),_0x59c8f2);});}return respondWithRpcPromise(_0x381d('0xbb'),_0x381d('0xba'),_0x59c8f2);})['then'](function(_0x8cd171){if(_0x8cd171){var _0x4f7a15=0xc8;var _0x391ec1=_0x381d('0xbc');logger[_0x381d('0xbd')](_0x381d('0x25'),_0x391ec1,_0x4f7a15,_0x381d('0xbe'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x391ec1,_0x4f7a15,_0x381d('0xbe'),JSON[_0x381d('0x26')](_0x8cd171));if(_0x59c8f2[_0x381d('0x8b')][_0x381d('0x54')]===_0x381d('0x9c')){return _0x434454[_0x381d('0x2d')](_0x4f7a15)[_0x381d('0x34')](_0x381d('0xbf'),_0x381d('0xc0'))[_0x381d('0x3e')](_0x381d('0xc1'));}else{return _0x434454[_0x381d('0x2d')](_0x4f7a15)['json'](_0x8cd171);}}});})[_0x381d('0x2b')](handleError(_0x434454,null));};exports[_0x381d('0x3e')]=function(_0x3c4e68,_0x5ed60e,_0x135f69){var _0xd357e8,_0x4784cf,_0x4a186d;if(_[_0x381d('0xa4')](_0x3c4e68[_0x381d('0x5f')]['body'])||_0x3c4e68['body'][_0x381d('0x5f')]===''){throw new db[(_0x381d('0x94'))][(_0x381d('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x381d('0xa4')](_0x3c4e68['body']['to'])){throw new db[(_0x381d('0x94'))]['ValidationError']('to\x20is\x20mandatory');}_0xd357e8=_0x3c4e68['body']['to'];return db['WhatsappAccount'][_0x381d('0x66')]({'where':{'id':_0x3c4e68[_0x381d('0x5b')]['id']},'include':[{'model':db[_0x381d('0xa9')],'as':'List','include':[{'model':db[_0x381d('0x93')],'as':_0x381d('0xac'),'where':{'mobile':_0xd357e8},'limit':0x1,'order':[[_0x381d('0x99'),'DESC']]}]}]})[_0x381d('0x22')](handleEntityNotFound(_0x5ed60e,null))[_0x381d('0x22')](function(_0x4ff1c0){if(_0x4ff1c0&&_0x4ff1c0[_0x381d('0xc2')]){_0x4784cf=_0x4ff1c0[_0x381d('0x3a')]({'plain':!![]});if(_0x4784cf[_0x381d('0xc2')]&&_0x4784cf[_0x381d('0xc2')][_0x381d('0xac')][_0x381d('0x4c')]){return _0x4784cf[_0x381d('0xc2')][_0x381d('0xac')][0x0];}return db[_0x381d('0x93')]['create'](_[_0x381d('0xad')](_0x3c4e68[_0x381d('0x5f')],{'firstName':_0xd357e8,'mobile':_0xd357e8,'phone':_0xd357e8,'ListId':_0x4784cf[_0x381d('0x9a')]}));}})[_0x381d('0x22')](handleEntityNotFound(_0x5ed60e,null))[_0x381d('0x22')](function(_0x350073){if(_0x350073){_0x4a186d=_0x350073;return db[_0x381d('0xaf')][_0x381d('0x66')]({'where':{'ContactId':_0x4a186d['id'],'closed':![],'WhatsappAccountId':_0x4784cf['id']}})[_0x381d('0x22')](function(_0x3afca9){if(_0x3afca9){return[_0x3afca9,![]];}return db['WhatsappInteraction'][_0x381d('0x5e')]({'UserId':_0x3c4e68['user']['id'],'ContactId':_0x4a186d['id'],'WhatsappAccountId':_0x4784cf['id'],'phone':_0xd357e8,'firstMsgDirection':_0x381d('0xc3'),'Messages':[_[_0x381d('0x53')](_0x3c4e68[_0x381d('0x5f')],{'read':![],'body':_0x3c4e68[_0x381d('0x5f')][_0x381d('0x5f')],'phone':_0xd357e8,'WhatsappAccountId':_0x4784cf['id'],'UserId':_0x3c4e68[_0x381d('0x60')]['id'],'ContactId':_0x4a186d['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x381d('0xc4')}]})[_0x381d('0x22')](function(_0x14682b){return[_0x14682b,!![]];});});}})[_0x381d('0x76')](function(_0x233cf4,_0x252f1f){if(_0x252f1f){return _0x233cf4;}return db[_0x381d('0x8f')]['create'](_[_0x381d('0x53')](_0x3c4e68[_0x381d('0x5f')],{'read':![],'body':_0x3c4e68[_0x381d('0x5f')]['body'],'phone':_0xd357e8,'WhatsappAccountId':_0x4784cf['id'],'WhatsappInteractionId':_0x233cf4['id'],'UserId':_0x3c4e68[_0x381d('0x60')]['id'],'ContactId':_0x4a186d['id']}))[_0x381d('0x22')](function(_0x302109){_0x233cf4[_0x381d('0xc5')][_0x381d('0xc4')]=[];_0x233cf4[_0x381d('0xc5')][_0x381d('0xc4')][_0x381d('0xb2')](_0x302109['dataValues']);return _0x233cf4;});})['then'](respondWithResult(_0x5ed60e,null))[_0x381d('0x2b')](handleError(_0x5ed60e,null));}; \ No newline at end of file +var _0x1913=['localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','show','params','keys','includeAll','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','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rawAttributes','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','notify','whatsapp','Applications','account','type','statuses','state','read','WhatsappMessage','update','message_id','applications','orderBy','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from','replace','whatsapp:','messageId','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults'];(function(_0x1bc42d,_0x1b8a92){var _0x2a4351=function(_0x247ad2){while(--_0x247ad2){_0x1bc42d['push'](_0x1bc42d['shift']());}};_0x2a4351(++_0x1b8a92);}(_0x1913,0x16b));var _0x3191=function(_0x375e95,_0x456390){_0x375e95=_0x375e95-0x0;var _0x1af223=_0x1913[_0x375e95];return _0x1af223;};'use strict';var emlformat=require(_0x3191('0x0'));var rimraf=require(_0x3191('0x1'));var zipdir=require(_0x3191('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3191('0x3'));var BPromise=require(_0x3191('0x4'));var Mustache=require(_0x3191('0x5'));var util=require('util');var path=require(_0x3191('0x6'));var sox=require(_0x3191('0x7'));var csv=require('to-csv');var ejs=require(_0x3191('0x8'));var fs=require('fs');var fs_extra=require(_0x3191('0x9'));var _=require(_0x3191('0xa'));var squel=require(_0x3191('0xb'));var crypto=require(_0x3191('0xc'));var jsforce=require(_0x3191('0xd'));var deskjs=require(_0x3191('0xe'));var toCsv=require(_0x3191('0xf'));var querystring=require(_0x3191('0x10'));var Papa=require(_0x3191('0x11'));var Redis=require(_0x3191('0x12'));var authService=require(_0x3191('0x13'));var qs=require(_0x3191('0x14'));var as=require(_0x3191('0x15'));var hardwareService=require(_0x3191('0x16'));var logger=require(_0x3191('0x17'))(_0x3191('0x18'));var utils=require(_0x3191('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3191('0x1a'))['db'];config[_0x3191('0x1b')]=_[_0x3191('0x1c')](config[_0x3191('0x1b')],{'host':_0x3191('0x1d'),'port':0x18eb});var socket=require(_0x3191('0x1e'))(new Redis(config[_0x3191('0x1b')]));require(_0x3191('0x1f'))[_0x3191('0x20')](socket);var jayson=require(_0x3191('0x21'));var client=jayson[_0x3191('0x22')][_0x3191('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x3269f3,_0x162fcd,_0x215d82,_0x18bdee){return new BPromise(function(_0x1dc9b7,_0x128214){var _0x4cb7d0=_0x18bdee||client;return _0x4cb7d0[_0x3191('0x24')](_0x3269f3,_0x215d82)[_0x3191('0x25')](function(_0x19434d){logger[_0x3191('0x26')](_0x3191('0x27'),_0x162fcd,_0x3191('0x28'));logger['debug'](_0x3191('0x29'),_0x162fcd,_0x3191('0x28'),JSON[_0x3191('0x2a')](_0x19434d));if(_0x19434d['error']){if(_0x19434d[_0x3191('0x2b')][_0x3191('0x2c')]===0x1f4){logger[_0x3191('0x2b')](_0x3191('0x27'),_0x162fcd,_0x19434d[_0x3191('0x2b')][_0x3191('0x2d')]);return _0x128214(_0x19434d[_0x3191('0x2b')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x162fcd,_0x19434d[_0x3191('0x2b')][_0x3191('0x2d')]);return _0x1dc9b7(_0x19434d[_0x3191('0x2b')][_0x3191('0x2d')]);}else{logger[_0x3191('0x26')](_0x3191('0x27'),_0x162fcd,_0x3191('0x28'));_0x1dc9b7(_0x19434d[_0x3191('0x2e')][_0x3191('0x2d')]);}})[_0x3191('0x2f')](function(_0x787f71){logger[_0x3191('0x2b')](_0x3191('0x27'),_0x162fcd,_0x787f71);_0x128214(_0x787f71);});});}function respondWithStatusCode(_0x54276d,_0x4087f0){_0x4087f0=_0x4087f0||0xcc;return function(_0x4e778b){if(_0x4e778b){return _0x54276d[_0x3191('0x30')](_0x4087f0);}return _0x54276d[_0x3191('0x31')](_0x4087f0)[_0x3191('0x32')]();};}function respondWithResult(_0x4b9ca0,_0x37c167){_0x37c167=_0x37c167||0xc8;return function(_0x2f48b4){if(_0x2f48b4){return _0x4b9ca0['status'](_0x37c167)[_0x3191('0x33')](_0x2f48b4);}};}function respondWithFilteredResult(_0x5da639,_0x364786){return function(_0xdb3795){if(_0xdb3795){var _0x2481f6=typeof _0x364786[_0x3191('0x34')]===_0x3191('0x35')&&typeof _0x364786[_0x3191('0x36')]==='undefined';var _0x3e6400=_0xdb3795[_0x3191('0x37')];var _0x2a6c2f=_0x2481f6?0x0:_0x364786[_0x3191('0x34')];var _0xf72dd3=_0x2481f6?_0xdb3795[_0x3191('0x37')]:_0x364786[_0x3191('0x34')]+_0x364786[_0x3191('0x36')];var _0x4960ee;if(_0xf72dd3>=_0x3e6400){_0xf72dd3=_0x3e6400;_0x4960ee=0xc8;}else{_0x4960ee=0xce;}_0x5da639[_0x3191('0x31')](_0x4960ee);return _0x5da639[_0x3191('0x38')]('Content-Range',_0x2a6c2f+'-'+_0xf72dd3+'/'+_0x3e6400)['json'](_0xdb3795);}return null;};}function patchUpdates(_0x439e3e){return function(_0x5b2b31){try{jsonpatch[_0x3191('0x39')](_0x5b2b31,_0x439e3e,!![]);}catch(_0x33689a){return BPromise[_0x3191('0x3a')](_0x33689a);}return _0x5b2b31[_0x3191('0x3b')]();};}function saveUpdates(_0x19dbd0,_0x57084f){return function(_0x54ba0d){if(_0x54ba0d){return _0x54ba0d['update'](_0x19dbd0)[_0x3191('0x25')](function(_0x489f1c){return _0x489f1c;});}return null;};}function removeEntity(_0x187866,_0xe13498){return function(_0x21ddd3){if(_0x21ddd3){return _0x21ddd3[_0x3191('0x3c')]()[_0x3191('0x25')](function(){var _0x23375c=_0x21ddd3[_0x3191('0x3d')]({'plain':!![]});var _0x2373a3=_0x3191('0x3e');return db[_0x3191('0x3f')][_0x3191('0x3c')]({'where':{'type':_0x2373a3,'resourceId':_0x23375c['id']}})[_0x3191('0x25')](function(){return _0x21ddd3;});})[_0x3191('0x25')](function(){_0x187866[_0x3191('0x31')](0xcc)[_0x3191('0x32')]();});}};}function handleEntityNotFound(_0x2e6dff,_0x4660dc){return function(_0x51d6d1){if(!_0x51d6d1){_0x2e6dff[_0x3191('0x30')](0x194);}return _0x51d6d1;};}function handleError(_0x33d87c,_0x44dce1){_0x44dce1=_0x44dce1||0x1f4;return function(_0xb0a5aa){logger[_0x3191('0x2b')](_0xb0a5aa[_0x3191('0x40')]);if(_0xb0a5aa['name']){delete _0xb0a5aa[_0x3191('0x41')];}_0x33d87c[_0x3191('0x31')](_0x44dce1)[_0x3191('0x42')](_0xb0a5aa);};}exports[_0x3191('0x43')]=function(_0x54fcd8,_0x2139e1){var _0x48d15c={'include':[{'model':db[_0x3191('0x44')],'as':_0x3191('0x45')}]},_0x17c29a={},_0x10ff4d={'count':0x0,'rows':[]};var _0x49d9f3=_['map'](db[_0x3191('0x46')]['rawAttributes'],function(_0x2a4e99){return{'name':_0x2a4e99[_0x3191('0x47')],'type':_0x2a4e99['type']['key']};});_0x17c29a[_0x3191('0x48')]=_[_0x3191('0x49')](_0x49d9f3,_0x3191('0x41'));_0x17c29a[_0x3191('0x4a')]=_['keys'](_0x54fcd8[_0x3191('0x4a')]);_0x17c29a['filters']=_[_0x3191('0x4b')](_0x17c29a[_0x3191('0x48')],_0x17c29a[_0x3191('0x4a')]);_0x48d15c[_0x3191('0x4c')]=_[_0x3191('0x4b')](_0x17c29a['model'],qs[_0x3191('0x4d')](_0x54fcd8[_0x3191('0x4a')][_0x3191('0x4d')]));_0x48d15c[_0x3191('0x4c')]=_0x48d15c[_0x3191('0x4c')][_0x3191('0x4e')]?_0x48d15c[_0x3191('0x4c')]:_0x17c29a['model'];if(!_0x54fcd8[_0x3191('0x4a')][_0x3191('0x4f')](_0x3191('0x50'))){_0x48d15c[_0x3191('0x36')]=qs['limit'](_0x54fcd8[_0x3191('0x4a')][_0x3191('0x36')]);_0x48d15c[_0x3191('0x34')]=qs[_0x3191('0x34')](_0x54fcd8[_0x3191('0x4a')][_0x3191('0x34')]);}_0x48d15c[_0x3191('0x51')]=qs[_0x3191('0x52')](_0x54fcd8[_0x3191('0x4a')][_0x3191('0x52')]);_0x48d15c[_0x3191('0x53')]=qs[_0x3191('0x54')](_[_0x3191('0x55')](_0x54fcd8[_0x3191('0x4a')],_0x17c29a[_0x3191('0x54')]),_0x49d9f3);if(_0x54fcd8['query'][_0x3191('0x56')]){_0x48d15c[_0x3191('0x53')]=_[_0x3191('0x57')](_0x48d15c[_0x3191('0x53')],{'$or':_[_0x3191('0x49')](_0x49d9f3,function(_0x47690b){if(_0x47690b['type']!=='VIRTUAL'){var _0x3f227a={};_0x3f227a[_0x47690b[_0x3191('0x41')]]={'$like':'%'+_0x54fcd8['query'][_0x3191('0x56')]+'%'};return _0x3f227a;}})});}_0x48d15c=_[_0x3191('0x57')]({},_0x48d15c,_0x54fcd8[_0x3191('0x58')]);var _0x3c274b={'where':_0x48d15c[_0x3191('0x53')]};return db[_0x3191('0x46')][_0x3191('0x37')](_0x3c274b)[_0x3191('0x25')](function(_0x2c5be6){_0x10ff4d[_0x3191('0x37')]=_0x2c5be6;if(_0x54fcd8[_0x3191('0x4a')]['includeAll']){_0x48d15c[_0x3191('0x59')]=[{'all':!![]}];}return db[_0x3191('0x46')][_0x3191('0x5a')](_0x48d15c);})[_0x3191('0x25')](function(_0x5c45db){_0x10ff4d['rows']=_0x5c45db;return _0x10ff4d;})[_0x3191('0x25')](respondWithFilteredResult(_0x2139e1,_0x48d15c))[_0x3191('0x2f')](handleError(_0x2139e1,null));};exports[_0x3191('0x5b')]=function(_0x2ce27a,_0x39e2e1){var _0x3800c1={'raw':![],'where':{'id':_0x2ce27a[_0x3191('0x5c')]['id']},'include':[{'model':db[_0x3191('0x44')],'as':'mandatoryDispositionPause'}]},_0x46f078={};_0x46f078[_0x3191('0x48')]=_['keys'](db[_0x3191('0x46')]['rawAttributes']);_0x46f078['query']=_[_0x3191('0x5d')](_0x2ce27a[_0x3191('0x4a')]);_0x46f078['filters']=_[_0x3191('0x4b')](_0x46f078['model'],_0x46f078[_0x3191('0x4a')]);_0x3800c1[_0x3191('0x4c')]=_[_0x3191('0x4b')](_0x46f078[_0x3191('0x48')],qs[_0x3191('0x4d')](_0x2ce27a[_0x3191('0x4a')][_0x3191('0x4d')]));_0x3800c1['attributes']=_0x3800c1['attributes'][_0x3191('0x4e')]?_0x3800c1[_0x3191('0x4c')]:_0x46f078[_0x3191('0x48')];if(_0x2ce27a['query'][_0x3191('0x5e')]){_0x3800c1[_0x3191('0x59')]=[{'all':!![]}];}_0x3800c1=_[_0x3191('0x57')]({},_0x3800c1,_0x2ce27a['options']);return db['WhatsappAccount'][_0x3191('0x5f')](_0x3800c1)[_0x3191('0x25')](handleEntityNotFound(_0x39e2e1,null))[_0x3191('0x25')](respondWithResult(_0x39e2e1,null))[_0x3191('0x2f')](handleError(_0x39e2e1,null));};exports[_0x3191('0x60')]=function(_0xba9256,_0x5c2360){return db[_0x3191('0x46')]['create'](_0xba9256['body'],{})['then'](function(_0x8fc153){var _0x2d8965=_0xba9256[_0x3191('0x61')][_0x3191('0x3d')]({'plain':!![]});if(!_0x2d8965)throw new Error(_0x3191('0x62'));if(_0x2d8965[_0x3191('0x63')]===_0x3191('0x61')){var _0x2ffd7e=_0x8fc153['get']({'plain':!![]});var _0x4f2ee1=_0x3191('0x3e');return db[_0x3191('0x64')][_0x3191('0x5f')]({'where':{'name':_0x4f2ee1,'userProfileId':_0x2d8965[_0x3191('0x65')]},'raw':!![]})[_0x3191('0x25')](function(_0x24a18b){if(_0x24a18b&&_0x24a18b[_0x3191('0x66')]===0x0){return db[_0x3191('0x3f')][_0x3191('0x60')]({'name':_0x2ffd7e[_0x3191('0x41')],'resourceId':_0x2ffd7e['id'],'type':_0x24a18b[_0x3191('0x41')],'sectionId':_0x24a18b['id']},{})[_0x3191('0x25')](function(){return _0x8fc153;});}else{return _0x8fc153;}})['catch'](function(_0x393d8b){logger['error'](_0x3191('0x67'),_0x393d8b);throw _0x393d8b;});}return _0x8fc153;})[_0x3191('0x25')](respondWithResult(_0x5c2360,0xc9))['catch'](handleError(_0x5c2360,null));};exports['update']=function(_0x2afa3c,_0x3f3163){if(_0x2afa3c[_0x3191('0x68')]['id']){delete _0x2afa3c[_0x3191('0x68')]['id'];}return db['WhatsappAccount'][_0x3191('0x5f')]({'where':{'id':_0x2afa3c['params']['id']},'include':[{'model':db[_0x3191('0x44')],'as':'mandatoryDispositionPause'}]})[_0x3191('0x25')](handleEntityNotFound(_0x3f3163,null))[_0x3191('0x25')](saveUpdates(_0x2afa3c[_0x3191('0x68')],null))[_0x3191('0x25')](respondWithResult(_0x3f3163,null))[_0x3191('0x2f')](handleError(_0x3f3163,null));};exports[_0x3191('0x3c')]=function(_0x127a77,_0x180480){return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x127a77[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x180480,null))[_0x3191('0x25')](removeEntity(_0x180480,null))[_0x3191('0x2f')](handleError(_0x180480,null));};exports[_0x3191('0x69')]=function(_0x28fd04,_0x27660e){return db[_0x3191('0x46')]['describe']()[_0x3191('0x25')](respondWithResult(_0x27660e,null))[_0x3191('0x2f')](handleError(_0x27660e,null));};exports[_0x3191('0x6a')]=function(_0x27a0c5,_0x66ebf8,_0x46b740){if(_0x27a0c5['body']['id']){delete _0x27a0c5[_0x3191('0x68')]['id'];}return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x27a0c5[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x66ebf8,null))['then'](function(_0x302def){if(_0x302def){_0x27a0c5[_0x3191('0x68')][_0x3191('0x6b')]=_0x302def['id'];return db[_0x3191('0x6c')][_0x3191('0x60')](_0x27a0c5['body']);}})[_0x3191('0x25')](respondWithResult(_0x66ebf8,null))[_0x3191('0x2f')](handleError(_0x66ebf8,null));};exports[_0x3191('0x6d')]=function(_0x23603d,_0x3d87f2,_0x47d1bc){var _0x1cab8d={'raw':![],'where':{}};var _0x2b3819={};var _0x1bf99a={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x3191('0x6e')]({'where':{'id':_0x23603d[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x3d87f2,null))['then'](function(_0x3e3010){if(_0x3e3010){_0x2b3819['model']=_[_0x3191('0x5d')](db['Disposition'][_0x3191('0x6f')]);_0x2b3819[_0x3191('0x4a')]=_['keys'](_0x23603d[_0x3191('0x4a')]);_0x2b3819[_0x3191('0x54')]=_[_0x3191('0x4b')](_0x2b3819[_0x3191('0x48')],_0x2b3819['query']);_0x1cab8d[_0x3191('0x4c')]=_['intersection'](_0x2b3819[_0x3191('0x48')],qs[_0x3191('0x4d')](_0x23603d['query'][_0x3191('0x4d')]));_0x1cab8d[_0x3191('0x4c')]=_0x1cab8d[_0x3191('0x4c')][_0x3191('0x4e')]?_0x1cab8d[_0x3191('0x4c')]:_0x2b3819[_0x3191('0x48')];if(!_0x23603d[_0x3191('0x4a')][_0x3191('0x4f')](_0x3191('0x50'))){_0x1cab8d[_0x3191('0x36')]=qs[_0x3191('0x36')](_0x23603d[_0x3191('0x4a')][_0x3191('0x36')]);_0x1cab8d[_0x3191('0x34')]=qs[_0x3191('0x34')](_0x23603d[_0x3191('0x4a')][_0x3191('0x34')]);}_0x1cab8d['order']=qs[_0x3191('0x52')](_0x23603d['query'][_0x3191('0x52')]);_0x1cab8d['where']=qs['filters'](_[_0x3191('0x55')](_0x23603d['query'],_0x2b3819[_0x3191('0x54')]));_0x1cab8d[_0x3191('0x53')]['WhatsappAccountId']=_0x3e3010['id'];if(_0x23603d[_0x3191('0x4a')][_0x3191('0x56')]){_0x1cab8d[_0x3191('0x53')]=_[_0x3191('0x57')](_0x1cab8d['where'],{'$or':_[_0x3191('0x49')](_0x1cab8d[_0x3191('0x4c')],function(_0x512f13){var _0x2e560f={};_0x2e560f[_0x512f13]={'$like':'%'+_0x23603d[_0x3191('0x4a')][_0x3191('0x56')]+'%'};return _0x2e560f;})});}_0x1cab8d=_[_0x3191('0x57')]({},_0x1cab8d,_0x23603d['options']);return db['Disposition'][_0x3191('0x37')]({'where':_0x1cab8d[_0x3191('0x53')]})[_0x3191('0x25')](function(_0x46b7bc){_0x1bf99a[_0x3191('0x37')]=_0x46b7bc;if(_0x23603d[_0x3191('0x4a')][_0x3191('0x5e')]){_0x1cab8d[_0x3191('0x59')]=[{'all':!![]}];}return db[_0x3191('0x6c')]['findAll'](_0x1cab8d);})[_0x3191('0x25')](function(_0x38830c){_0x1bf99a[_0x3191('0x70')]=_0x38830c;return _0x1bf99a;});}})[_0x3191('0x25')](respondWithFilteredResult(_0x3d87f2,_0x1cab8d))['catch'](handleError(_0x3d87f2,null));};exports['removeDispositions']=function(_0x15deb5,_0x3eab18,_0x366bf7){return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x15deb5[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x3eab18,null))[_0x3191('0x25')](function(_0x40535c){if(_0x40535c){return _0x40535c[_0x3191('0x71')](_0x15deb5[_0x3191('0x4a')]['ids']);}})[_0x3191('0x25')](respondWithStatusCode(_0x3eab18,null))[_0x3191('0x2f')](handleError(_0x3eab18,null));};exports[_0x3191('0x72')]=function(_0x27de11,_0x500ac1,_0x197494){if(_0x27de11[_0x3191('0x68')]['id']){delete _0x27de11['body']['id'];}return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x27de11[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x500ac1,null))[_0x3191('0x25')](function(_0x114c7f){if(_0x114c7f){_0x27de11[_0x3191('0x68')]['WhatsappAccountId']=_0x114c7f['id'];return db[_0x3191('0x73')][_0x3191('0x60')](_0x27de11[_0x3191('0x68')]);}})[_0x3191('0x25')](respondWithResult(_0x500ac1,null))['catch'](handleError(_0x500ac1,null));};exports['getAnswers']=function(_0x2d4319,_0x1a53bf,_0x478ec9){var _0x2e92f3={'raw':![],'where':{}};var _0x127fd5={};var _0x1a5a1e={'count':0x0,'rows':[]};return db[_0x3191('0x46')]['findOne']({'where':{'id':_0x2d4319[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x1a53bf,null))[_0x3191('0x25')](function(_0x347af6){if(_0x347af6){_0x127fd5[_0x3191('0x48')]=_[_0x3191('0x5d')](db[_0x3191('0x73')][_0x3191('0x6f')]);_0x127fd5[_0x3191('0x4a')]=_[_0x3191('0x5d')](_0x2d4319[_0x3191('0x4a')]);_0x127fd5[_0x3191('0x54')]=_[_0x3191('0x4b')](_0x127fd5['model'],_0x127fd5['query']);_0x2e92f3[_0x3191('0x4c')]=_[_0x3191('0x4b')](_0x127fd5['model'],qs[_0x3191('0x4d')](_0x2d4319['query'][_0x3191('0x4d')]));_0x2e92f3['attributes']=_0x2e92f3[_0x3191('0x4c')][_0x3191('0x4e')]?_0x2e92f3['attributes']:_0x127fd5[_0x3191('0x48')];if(!_0x2d4319['query'][_0x3191('0x4f')](_0x3191('0x50'))){_0x2e92f3[_0x3191('0x36')]=qs['limit'](_0x2d4319[_0x3191('0x4a')][_0x3191('0x36')]);_0x2e92f3[_0x3191('0x34')]=qs[_0x3191('0x34')](_0x2d4319[_0x3191('0x4a')][_0x3191('0x34')]);}_0x2e92f3[_0x3191('0x51')]=qs[_0x3191('0x52')](_0x2d4319['query'][_0x3191('0x52')]);_0x2e92f3[_0x3191('0x53')]=qs[_0x3191('0x54')](_[_0x3191('0x55')](_0x2d4319[_0x3191('0x4a')],_0x127fd5[_0x3191('0x54')]));_0x2e92f3[_0x3191('0x53')]['WhatsappAccountId']=_0x347af6['id'];if(_0x2d4319['query'][_0x3191('0x56')]){_0x2e92f3[_0x3191('0x53')]=_[_0x3191('0x57')](_0x2e92f3[_0x3191('0x53')],{'$or':_['map'](_0x2e92f3['attributes'],function(_0x20f72c){var _0x5b0ed4={};_0x5b0ed4[_0x20f72c]={'$like':'%'+_0x2d4319[_0x3191('0x4a')][_0x3191('0x56')]+'%'};return _0x5b0ed4;})});}_0x2e92f3=_['merge']({},_0x2e92f3,_0x2d4319['options']);return db[_0x3191('0x73')][_0x3191('0x37')]({'where':_0x2e92f3[_0x3191('0x53')]})[_0x3191('0x25')](function(_0x3ba80f){_0x1a5a1e[_0x3191('0x37')]=_0x3ba80f;if(_0x2d4319[_0x3191('0x4a')]['includeAll']){_0x2e92f3['include']=[{'all':!![]}];}return db[_0x3191('0x73')][_0x3191('0x5a')](_0x2e92f3);})[_0x3191('0x25')](function(_0x5c343b){_0x1a5a1e[_0x3191('0x70')]=_0x5c343b;return _0x1a5a1e;});}})[_0x3191('0x25')](respondWithFilteredResult(_0x1a53bf,_0x2e92f3))['catch'](handleError(_0x1a53bf,null));};exports[_0x3191('0x74')]=function(_0x2cb6f6,_0x377764,_0x350425){return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x2cb6f6[_0x3191('0x5c')]['id']}})['then'](handleEntityNotFound(_0x377764,null))[_0x3191('0x25')](function(_0x577627){if(_0x577627){return _0x577627['removeAnswers'](_0x2cb6f6['query'][_0x3191('0x75')]);}})[_0x3191('0x25')](respondWithStatusCode(_0x377764,null))[_0x3191('0x2f')](handleError(_0x377764,null));};exports['addAgents']=function(_0x58b2d2,_0x265b9b,_0x3afec5){return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x58b2d2['params']['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x265b9b,null))['then'](function(_0x40bde2){if(_0x40bde2){return _0x40bde2[_0x3191('0x76')](_0x58b2d2[_0x3191('0x68')][_0x3191('0x75')],_[_0x3191('0x77')](_0x58b2d2[_0x3191('0x68')],['ids','id'])||{})[_0x3191('0x78')](function(_0xd41aba){for(var _0x31a8ed=0x0;_0x31a8ed<_0x58b2d2[_0x3191('0x68')][_0x3191('0x75')][_0x3191('0x4e')];_0x31a8ed+=0x1){socket[_0x3191('0x79')](_0x3191('0x7a'),{'UserId':Number(_0x58b2d2['body'][_0x3191('0x75')][_0x31a8ed]),'WhatsappAccountId':Number(_0x58b2d2[_0x3191('0x5c')]['id'])});}return _0xd41aba;});}})[_0x3191('0x25')](respondWithResult(_0x265b9b,null))['catch'](handleError(_0x265b9b,null));};exports[_0x3191('0x7b')]=function(_0x35df36,_0x265acf,_0x41f5c6){return db['WhatsappAccount'][_0x3191('0x5f')]({'where':{'id':_0x35df36[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x265acf,null))[_0x3191('0x25')](function(_0xa4cc5a){if(_0xa4cc5a){return _0xa4cc5a[_0x3191('0x7b')](_0x35df36[_0x3191('0x4a')][_0x3191('0x75')])[_0x3191('0x25')](function(){if(_['isArray'](_0x35df36[_0x3191('0x4a')][_0x3191('0x75')])){for(var _0x20595b=0x0;_0x20595b<_0x35df36['query'][_0x3191('0x75')]['length'];_0x20595b+=0x1){socket['emit'](_0x3191('0x7c'),{'UserId':Number(_0x35df36[_0x3191('0x4a')][_0x3191('0x75')][_0x20595b]),'WhatsappAccountId':Number(_0x35df36[_0x3191('0x5c')]['id'])});}}else{socket[_0x3191('0x79')](_0x3191('0x7c'),{'UserId':Number(_0x35df36[_0x3191('0x4a')][_0x3191('0x75')]),'WhatsappAccountId':Number(_0x35df36['params']['id'])});}});}})[_0x3191('0x25')](respondWithStatusCode(_0x265acf,null))['catch'](handleError(_0x265acf,null));};exports[_0x3191('0x7d')]=function(_0x472a50,_0x5a75f6,_0x9b49bc){var _0x4b86d6={};var _0x3604db={};var _0x42190c;var _0xf056d8;return db[_0x3191('0x46')][_0x3191('0x6e')]({'where':{'id':_0x472a50[_0x3191('0x5c')]['id']}})[_0x3191('0x25')](handleEntityNotFound(_0x5a75f6,null))[_0x3191('0x25')](function(_0x122e74){if(_0x122e74){_0x42190c=_0x122e74;_0x3604db['model']=_['keys'](db[_0x3191('0x7e')]['rawAttributes']);_0x3604db['query']=_[_0x3191('0x5d')](_0x472a50[_0x3191('0x4a')]);_0x3604db['filters']=_[_0x3191('0x4b')](_0x3604db[_0x3191('0x48')],_0x3604db[_0x3191('0x4a')]);_0x4b86d6['attributes']=_['intersection'](_0x3604db['model'],qs[_0x3191('0x4d')](_0x472a50[_0x3191('0x4a')][_0x3191('0x4d')]));_0x4b86d6[_0x3191('0x4c')]=_0x4b86d6[_0x3191('0x4c')][_0x3191('0x4e')]?_0x4b86d6[_0x3191('0x4c')]:_0x3604db[_0x3191('0x48')];_0x4b86d6[_0x3191('0x51')]=qs[_0x3191('0x52')](_0x472a50[_0x3191('0x4a')][_0x3191('0x52')]);_0x4b86d6[_0x3191('0x53')]=qs[_0x3191('0x54')](_[_0x3191('0x55')](_0x472a50['query'],_0x3604db[_0x3191('0x54')]));if(_0x472a50['query'][_0x3191('0x56')]){_0x4b86d6[_0x3191('0x53')]=_[_0x3191('0x57')](_0x4b86d6[_0x3191('0x53')],{'$or':_['map'](_0x4b86d6[_0x3191('0x4c')],function(_0x300cb8){var _0x2359b5={};_0x2359b5[_0x300cb8]={'$like':'%'+_0x472a50['query']['filter']+'%'};return _0x2359b5;})});}_0x4b86d6=_['merge']({},_0x4b86d6,_0x472a50[_0x3191('0x58')]);return _0x42190c[_0x3191('0x7d')](_0x4b86d6);}})[_0x3191('0x25')](function(_0x5d3a98){if(_0x5d3a98){_0xf056d8=_0x5d3a98[_0x3191('0x4e')];if(!_0x472a50[_0x3191('0x4a')][_0x3191('0x4f')](_0x3191('0x50'))){_0x4b86d6[_0x3191('0x36')]=qs[_0x3191('0x36')](_0x472a50['query'][_0x3191('0x36')]);_0x4b86d6[_0x3191('0x34')]=qs['offset'](_0x472a50['query'][_0x3191('0x34')]);}return _0x42190c[_0x3191('0x7d')](_0x4b86d6);}})[_0x3191('0x25')](function(_0x27ed46){if(_0x27ed46){return _0x27ed46?{'count':_0xf056d8,'rows':_0x27ed46}:null;}})['then'](respondWithResult(_0x5a75f6,null))[_0x3191('0x2f')](handleError(_0x5a75f6,null));};exports[_0x3191('0x7f')]=function(_0x19d936,_0x2f58e5){var _0x429685=_0x19d936['params']['id'];var _0x3da85d=_0x19d936[_0x3191('0x68')];var _0x51e433=0xc8;var _0x2826c9=null;return db[_0x3191('0x80')][_0x3191('0x81')]({'isolationLevel':db[_0x3191('0x80')][_0x3191('0x82')]['ISOLATION_LEVELS'][_0x3191('0x83')]},function(_0xed9b2e){return db[_0x3191('0x46')][_0x3191('0x6e')]({'where':{'id':_0x429685},'transaction':_0xed9b2e})[_0x3191('0x25')](function(_0x1da1a4){if(_0x1da1a4){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x429685},'transaction':_0xed9b2e})[_0x3191('0x25')](function(){var _0x49f032=_[_0x3191('0x49')](_0x3da85d,function(_0x3447ee){_0x3447ee[_0x3191('0x6b')]=_0x429685;return _0x3447ee;});return db[_0x3191('0x84')][_0x3191('0x85')](_0x49f032,{'transaction':_0xed9b2e});});}else{_0x51e433=0x194;_0x2826c9=[];}});})[_0x3191('0x25')](function(){if(_0x51e433!==0x194){return db['WhatsappApplication'][_0x3191('0x86')]({'where':{'WhatsappAccountId':_0x429685},'order':_0x3191('0x87')})[_0x3191('0x25')](function(_0x5c6f79){_0x2826c9=_0x5c6f79;});}})[_0x3191('0x2f')](function(_0x12a2de){_0x51e433=0x1f4;logger[_0x3191('0x2b')](_0x12a2de['stack']);if(_0x12a2de[_0x3191('0x41')]){delete _0x12a2de[_0x3191('0x41')];}_0x2826c9=_0x12a2de;})[_0x3191('0x88')](function(){if(_0x2826c9===null){_0x2f58e5['sendStatus'](_0x51e433);}else{if(_0x51e433===0x1f4){_0x2f58e5['status'](_0x51e433)[_0x3191('0x42')](_0x2826c9);}else{_0x2f58e5['status'](_0x51e433)[_0x3191('0x33')](_0x2826c9);}}});};exports['getApplications']=function(_0x57763f,_0x2b52b0,_0x5b3287){var _0x23d1a0={};var _0x428bab={};var _0x599b95;var _0x422404;return db[_0x3191('0x46')][_0x3191('0x6e')]({'where':{'id':_0x57763f['params']['id']}})['then'](handleEntityNotFound(_0x2b52b0,null))['then'](function(_0x16f129){if(_0x16f129){_0x599b95=_0x16f129;_0x428bab[_0x3191('0x48')]=_[_0x3191('0x5d')](db['WhatsappApplication'][_0x3191('0x6f')]);_0x428bab[_0x3191('0x4a')]=_['keys'](_0x57763f['query']);_0x428bab[_0x3191('0x54')]=_[_0x3191('0x4b')](_0x428bab['model'],_0x428bab[_0x3191('0x4a')]);_0x23d1a0[_0x3191('0x4c')]=_[_0x3191('0x4b')](_0x428bab['model'],qs[_0x3191('0x4d')](_0x57763f[_0x3191('0x4a')]['fields']));_0x23d1a0[_0x3191('0x4c')]=_0x23d1a0[_0x3191('0x4c')][_0x3191('0x4e')]?_0x23d1a0[_0x3191('0x4c')]:_0x428bab['model'];_0x23d1a0[_0x3191('0x51')]=qs['sort'](_0x57763f[_0x3191('0x4a')][_0x3191('0x52')]);_0x23d1a0[_0x3191('0x53')]=qs['filters'](_[_0x3191('0x55')](_0x57763f['query'],_0x428bab[_0x3191('0x54')]));if(_0x57763f[_0x3191('0x4a')][_0x3191('0x56')]){_0x23d1a0[_0x3191('0x53')]=_[_0x3191('0x57')](_0x23d1a0['where'],{'$or':_['map'](_0x23d1a0['attributes'],function(_0x192685){var _0x3e671f={};_0x3e671f[_0x192685]={'$like':'%'+_0x57763f[_0x3191('0x4a')][_0x3191('0x56')]+'%'};return _0x3e671f;})});}_0x23d1a0=_[_0x3191('0x57')]({},_0x23d1a0,_0x57763f[_0x3191('0x58')]);return _0x599b95['getApplications'](_0x23d1a0);}})[_0x3191('0x25')](function(_0x372dee){if(_0x372dee){_0x422404=_0x372dee[_0x3191('0x4e')];if(!_0x57763f[_0x3191('0x4a')][_0x3191('0x4f')](_0x3191('0x50'))){_0x23d1a0[_0x3191('0x36')]=qs['limit'](_0x57763f[_0x3191('0x4a')][_0x3191('0x36')]);_0x23d1a0[_0x3191('0x34')]=qs[_0x3191('0x34')](_0x57763f[_0x3191('0x4a')][_0x3191('0x34')]);}return _0x599b95['getApplications'](_0x23d1a0);}})[_0x3191('0x25')](function(_0x45d9d0){if(_0x45d9d0){return _0x45d9d0?{'count':_0x422404,'rows':_0x45d9d0}:null;}})[_0x3191('0x25')](respondWithResult(_0x2b52b0,null))[_0x3191('0x2f')](handleError(_0x2b52b0,null));};exports[_0x3191('0x89')]=function(_0x30502,_0x951a40,_0x161461){var _0x12ab1f={'channel':_0x3191('0x8a')};var _0x4f201d=[];var _0x35dcf5=[];var _0x55cb40={};return db[_0x3191('0x46')][_0x3191('0x5f')]({'where':{'id':_0x30502['params']['id']},'include':[{'model':db[_0x3191('0x84')],'as':_0x3191('0x8b')}]})[_0x3191('0x25')](handleEntityNotFound(_0x951a40,null))['then'](function(_0xe42553){_0x12ab1f[_0x3191('0x8c')]=_0xe42553;if(_0x12ab1f['account']&&_0x12ab1f[_0x3191('0x8c')][_0x3191('0x8d')]==='sinch'&&_0x30502[_0x3191('0x68')][_0x3191('0x8e')]){if(_0x30502[_0x3191('0x68')][_0x3191('0x8e')]['length']===0x0)return;if(_0x30502[_0x3191('0x68')][_0x3191('0x8e')][0x0][_0x3191('0x8f')]!==_0x3191('0x90'))return;return db[_0x3191('0x91')][_0x3191('0x92')]({'read':!![],'readAt':_0x30502['body'][_0x3191('0x8e')][0x0]['timestamp']},{'where':{'messageId':_0x30502[_0x3191('0x68')][_0x3191('0x8e')][0x0][_0x3191('0x93')]},'individualHooks':!![]})[_0x3191('0x25')](function(_0x144301){return _0x951a40['status'](0xc8)[_0x3191('0x33')](_0x144301);});}_0x12ab1f[_0x3191('0x94')]=_[_0x3191('0x95')](_0xe42553[_0x3191('0x8b')],[_0x3191('0x87')],['asc']);if(_0x12ab1f['account'][_0x3191('0x8b')]){delete _0x12ab1f['account'][_0x3191('0x8b')];}return db[_0x3191('0x96')]['describe']()[_0x3191('0x25')](function(_0x468dbd){if(!_0x468dbd){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))]('no\x20available\x20attributes');}_0x4f201d=_[_0x3191('0x99')](_['keys'](_0x468dbd),[_0x3191('0x9a'),_0x3191('0x9b')]);_0x35dcf5=_['difference'](_[_0x3191('0x5d')](_0x468dbd),['createdAt','updatedAt',_0x3191('0x9c'),'ListId']);_0x12ab1f[_0x3191('0x68')]={'mapKey':'mobile'};if(_0x12ab1f['account']&&_0x12ab1f['account'][_0x3191('0x8d')]==='twilio'){_0x12ab1f[_0x3191('0x68')][_0x3191('0x9d')]=_0x30502[_0x3191('0x68')]['From'][_0x3191('0x9e')](_0x3191('0x9f'),'');_0x12ab1f['body'][_0x3191('0x68')]=_0x30502[_0x3191('0x68')]['Body'];_0x12ab1f[_0x3191('0x68')][_0x3191('0xa0')]=_0x30502['body']['MessageSid'];}if(_0x12ab1f[_0x3191('0x8c')]&&_0x12ab1f[_0x3191('0x8c')][_0x3191('0x8d')]==='sinch'){_0x12ab1f['body']['from']=_0x30502[_0x3191('0x68')]['notifications'][0x0][_0x3191('0x9d')];_0x12ab1f['body'][_0x3191('0x68')]=_0x30502['body'][_0x3191('0xa1')][0x0][_0x3191('0x2d')][_0x3191('0x68')];_0x12ab1f[_0x3191('0x68')][_0x3191('0xa0')]=_0x30502[_0x3191('0x68')][_0x3191('0xa1')][0x0]['message_id'];}if(_0x12ab1f['body']['id']){delete _0x12ab1f[_0x3191('0x68')]['id'];}if(_[_0x3191('0xa2')](_0x12ab1f[_0x3191('0x68')][_0x3191('0x9d')])){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))]('from\x20is\x20mandatory');}if(_[_0x3191('0xa2')](_0x12ab1f[_0x3191('0x68')][_0x3191('0x68')])||_0x12ab1f[_0x3191('0x68')][_0x3191('0x68')]===''){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))](_0x3191('0xa3'));}if(_[_0x3191('0xa2')](_0x12ab1f['body'][_0x3191('0xa4')])){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35dcf5);}if(!_[_0x3191('0xa5')](_0x35dcf5,_0x12ab1f['body'][_0x3191('0xa4')])){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))](_0x3191('0xa6')+_0x35dcf5);}_0x55cb40[_0x12ab1f[_0x3191('0x68')][_0x3191('0xa4')]]=_0x12ab1f[_0x3191('0x68')][_0x3191('0x9d')];return db[_0x3191('0xa7')][_0x3191('0x5f')]({'where':{'id':_0x12ab1f[_0x3191('0x8c')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x3191('0xa8'),'where':_0x55cb40,'limit':0x1,'order':[[_0x3191('0x9b'),_0x3191('0xa9')]]}]});})[_0x3191('0x25')](handleEntityNotFound(_0x951a40,null))['then'](function(_0x1a7ec8){if(_0x1a7ec8){_0x12ab1f[_0x3191('0xaa')]=_['omit'](_0x1a7ec8,[_0x3191('0xa8')]);if(_0x1a7ec8[_0x3191('0xa8')][_0x3191('0x4e')]){return _0x1a7ec8[_0x3191('0xa8')][0x0];}var _0x943b6f=_[_0x3191('0x1c')](_0x12ab1f[_0x3191('0x68')],{'firstName':_0x12ab1f[_0x3191('0x68')][_0x3191('0x9d')],'ListId':_0x1a7ec8['id']});_0x943b6f[_0x12ab1f[_0x3191('0x68')][_0x3191('0xa4')]]=_0x12ab1f['body'][_0x3191('0x9d')];return db[_0x3191('0x96')][_0x3191('0x60')](_0x943b6f,{'fields':_0x4f201d,'raw':!![]});}})['then'](handleEntityNotFound(_0x951a40,null))[_0x3191('0x25')](function(_0xb9efc6){if(_0xb9efc6){_0x12ab1f[_0x3191('0xab')]=_0xb9efc6;var _0x459379={'ContactId':_0xb9efc6['id'],'phone':_0x12ab1f['body'][_0x3191('0x9d')],'WhatsappAccountId':_0x30502['params']['id']};var _0x8a9d1={'ContactId':_0xb9efc6['id'],'WhatsappAccountId':_0x30502[_0x3191('0x5c')]['id'],'closed':![]};return db[_0x3191('0xac')]['find']({'where':_0x8a9d1})[_0x3191('0x25')](function(_0x46f723){if(_0x46f723){return[_0x46f723,![]];}return db[_0x3191('0xac')][_0x3191('0x60')](_0x459379)[_0x3191('0x25')](function(_0xfa1619){return[_0xfa1619,!![]];});});}})[_0x3191('0x78')](function(_0x7a538d,_0x205b84){_0x12ab1f[_0x3191('0xad')]=_0x7a538d[_0x3191('0x3d')]({'plain':!![]});_0x12ab1f[_0x3191('0xad')][_0x3191('0xae')]=![];if(_0x205b84){if(_0x12ab1f[_0x3191('0x8c')]['autoclose']){_0x12ab1f[_0x3191('0x94')][_0x3191('0xaf')]({'id':0x0,'priority':_0x12ab1f[_0x3191('0x94')][_0x3191('0x4e')]+0x1,'app':'close','appdata':_0x3191('0xb0'),'interval':_0x3191('0xb1')});}_0x12ab1f[_0x3191('0xad')][_0x3191('0xae')]=!![];}return db['WhatsappMessage'][_0x3191('0x60')]({'phone':_0x12ab1f[_0x3191('0x68')][_0x3191('0x9d')],'messageId':_0x12ab1f[_0x3191('0x68')][_0x3191('0xa0')],'body':_0x12ab1f[_0x3191('0x68')][_0x3191('0x68')],'WhatsappAccountId':_0x30502[_0x3191('0x5c')]['id'],'WhatsappInteractionId':_0x7a538d['id'],'direction':'in','ContactId':_0x7a538d['ContactId'],'AttachmentId':_0x12ab1f[_0x3191('0x68')][_0x3191('0xb2')]});})[_0x3191('0x25')](function(_0x2d97b9){_0x12ab1f[_0x3191('0x2d')]=_0x2d97b9;if(_0x12ab1f[_0x3191('0xad')][_0x3191('0xb3')]){return db[_0x3191('0x7e')][_0x3191('0x5f')]({'attributes':['id',_0x3191('0x41')],'where':{'id':_0x12ab1f[_0x3191('0xad')][_0x3191('0xb3')]}})[_0x3191('0x25')](function(_0x122ab2){if(_0x122ab2){_0x12ab1f[_0x3191('0x94')][_0x3191('0xb4')]({'id':0x0,'priority':0x0,'app':_0x3191('0xb5'),'appdata':_0x122ab2[_0x3191('0x41')]+','+(_0x12ab1f[_0x3191('0x8c')][_0x3191('0xb6')]||0xa),'interval':_0x3191('0xb1')});}return respondWithRpcPromise('Start',_0x3191('0xb7'),_0x12ab1f);});}return respondWithRpcPromise('Start','startRouting',_0x12ab1f);})['then'](function(_0x3b9100){if(_0x3b9100){var _0x220dfd=0xc8;var _0x4a5722='receiveMessage';logger[_0x3191('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4a5722,_0x220dfd,_0x3191('0xb8'));logger[_0x3191('0xb9')](_0x3191('0xba'),_0x4a5722,_0x220dfd,_0x3191('0xb8'),JSON[_0x3191('0x2a')](_0x3b9100));if(_0x12ab1f['account'][_0x3191('0x8d')]===_0x3191('0xbb')){return _0x951a40[_0x3191('0x31')](_0x220dfd)['set'](_0x3191('0xbc'),_0x3191('0xbd'))[_0x3191('0x42')]('\x0a');}else{return _0x951a40[_0x3191('0x31')](_0x220dfd)[_0x3191('0x33')](_0x3b9100);}}});})['catch'](handleError(_0x951a40,null));};exports[_0x3191('0x42')]=function(_0x3332c8,_0x1ea089,_0x1cee03){var _0x18c11d,_0x30321d,_0x58943e;if(_[_0x3191('0xa2')](_0x3332c8[_0x3191('0x68')][_0x3191('0x68')])||_0x3332c8['body'][_0x3191('0x68')]===''){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))](_0x3191('0xa3'));}if(_[_0x3191('0xa2')](_0x3332c8[_0x3191('0x68')]['to'])){throw new db[(_0x3191('0x97'))][(_0x3191('0x98'))](_0x3191('0xbe'));}_0x18c11d=_0x3332c8[_0x3191('0x68')]['to'];return db[_0x3191('0x46')]['find']({'where':{'id':_0x3332c8[_0x3191('0x5c')]['id']},'include':[{'model':db[_0x3191('0xa7')],'as':'List','include':[{'model':db[_0x3191('0x96')],'as':'Contacts','where':{'mobile':_0x18c11d},'limit':0x1,'order':[[_0x3191('0x9b'),'DESC']]}]}]})[_0x3191('0x25')](handleEntityNotFound(_0x1ea089,null))[_0x3191('0x25')](function(_0x2bcc8b){if(_0x2bcc8b&&_0x2bcc8b['List']){_0x30321d=_0x2bcc8b[_0x3191('0x3d')]({'plain':!![]});if(_0x30321d[_0x3191('0xbf')]&&_0x30321d['List'][_0x3191('0xa8')][_0x3191('0x4e')]){return _0x30321d[_0x3191('0xbf')]['Contacts'][0x0];}return db[_0x3191('0x96')][_0x3191('0x60')](_['defaults'](_0x3332c8['body'],{'firstName':_0x18c11d,'mobile':_0x18c11d,'phone':_0x18c11d,'ListId':_0x30321d[_0x3191('0xc0')]}));}})['then'](handleEntityNotFound(_0x1ea089,null))[_0x3191('0x25')](function(_0x212b98){if(_0x212b98){_0x58943e=_0x212b98;return db['WhatsappInteraction'][_0x3191('0x5f')]({'where':{'ContactId':_0x58943e['id'],'closed':![],'WhatsappAccountId':_0x30321d['id']}})[_0x3191('0x25')](function(_0x9b101d){if(_0x9b101d){return[_0x9b101d,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x3332c8[_0x3191('0x61')]['id'],'ContactId':_0x58943e['id'],'WhatsappAccountId':_0x30321d['id'],'phone':_0x18c11d,'firstMsgDirection':_0x3191('0xc1'),'Messages':[_[_0x3191('0x57')](_0x3332c8['body'],{'read':![],'body':_0x3332c8[_0x3191('0x68')]['body'],'phone':_0x18c11d,'WhatsappAccountId':_0x30321d['id'],'UserId':_0x3332c8[_0x3191('0x61')]['id'],'ContactId':_0x58943e['id']})]},{'include':[{'model':db[_0x3191('0x91')],'as':_0x3191('0xc2')}]})[_0x3191('0x25')](function(_0x17fca7){return[_0x17fca7,!![]];});});}})[_0x3191('0x78')](function(_0x23eabf,_0x13d6f2){if(_0x13d6f2){return _0x23eabf;}return db[_0x3191('0x91')]['create'](_['merge'](_0x3332c8['body'],{'read':![],'body':_0x3332c8[_0x3191('0x68')]['body'],'phone':_0x18c11d,'WhatsappAccountId':_0x30321d['id'],'WhatsappInteractionId':_0x23eabf['id'],'UserId':_0x3332c8[_0x3191('0x61')]['id'],'ContactId':_0x58943e['id']}))[_0x3191('0x25')](function(_0x364989){_0x23eabf[_0x3191('0xc3')]['Messages']=[];_0x23eabf['dataValues']['Messages'][_0x3191('0xaf')](_0x364989['dataValues']);return _0x23eabf;});})[_0x3191('0x25')](respondWithResult(_0x1ea089,null))[_0x3191('0x2f')](handleError(_0x1ea089,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 98f0768..56b7515 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4e7=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x447ad8,_0x410b9d){var _0x545ef2=function(_0x2cbca6){while(--_0x2cbca6){_0x447ad8['push'](_0x447ad8['shift']());}};_0x545ef2(++_0x410b9d);}(_0xd4e7,0xce));var _0x7d4e=function(_0x46e1f5,_0x4b326e){_0x46e1f5=_0x46e1f5-0x0;var _0x22bc91=_0xd4e7[_0x46e1f5];return _0x22bc91;};'use strict';var EventEmitter=require(_0x7d4e('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7d4e('0x1')](0x0);var events={'afterCreate':_0x7d4e('0x2'),'afterUpdate':'update','afterDestroy':_0x7d4e('0x3')};function emitEvent(_0xd66743){return function(_0x5e783c,_0x55521a,_0x5af63e){WhatsappAccountEvents['emit'](_0xd66743+':'+_0x5e783c['id'],_0x5e783c);WhatsappAccountEvents['emit'](_0xd66743,_0x5e783c);_0x5af63e(null);};}for(var e in events){if(events[_0x7d4e('0x4')](e)){var event=events[e];WhatsappAccount[_0x7d4e('0x5')](e,emitEvent(event));}}module[_0x7d4e('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0xe19e=['emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe19e,0x126));var _0xee19=function(_0x988b66,_0x70f052){_0x988b66=_0x988b66-0x0;var _0x57201b=_0xe19e[_0x988b66];return _0x57201b;};'use strict';var EventEmitter=require(_0xee19('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xee19('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xee19('0x2')](0x0);var events={'afterCreate':_0xee19('0x3'),'afterUpdate':_0xee19('0x4'),'afterDestroy':_0xee19('0x5')};function emitEvent(_0x35b61d){return function(_0x41ab16,_0x54fed1,_0x247785){WhatsappAccountEvents[_0xee19('0x6')](_0x35b61d+':'+_0x41ab16['id'],_0x41ab16);WhatsappAccountEvents[_0xee19('0x6')](_0x35b61d,_0x41ab16);_0x247785(null);};}for(var e in events){if(events[_0xee19('0x7')](e)){var event=events[e];WhatsappAccount[_0xee19('0x8')](e,emitEvent(event));}}module[_0xee19('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 02a0277..0c15289 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76ba=['path','rimraf','../../config/environment','./whatsappAccount.attributes','define','whatsapp_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x37af5a,_0x5e3f15){var _0x2cc353=function(_0x5c51e6){while(--_0x5c51e6){_0x37af5a['push'](_0x37af5a['shift']());}};_0x2cc353(++_0x5e3f15);}(_0x76ba,0x171));var _0xa76b=function(_0x29e5c0,_0x514882){_0x29e5c0=_0x29e5c0-0x0;var _0x3231b8=_0x76ba[_0x29e5c0];return _0x3231b8;};'use strict';var _=require('lodash');var util=require(_0xa76b('0x0'));var logger=require(_0xa76b('0x1'))(_0xa76b('0x2'));var moment=require(_0xa76b('0x3'));var BPromise=require(_0xa76b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa76b('0x5'));var rimraf=require(_0xa76b('0x6'));var config=require(_0xa76b('0x7'));var attributes=require(_0xa76b('0x8'));module['exports']=function(_0x474414,_0xbb1317){return _0x474414[_0xa76b('0x9')]('WhatsappAccount',attributes,{'tableName':_0xa76b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10cd=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash'];(function(_0x56297,_0x224411){var _0x4b7cb6=function(_0x18f9b1){while(--_0x18f9b1){_0x56297['push'](_0x56297['shift']());}};_0x4b7cb6(++_0x224411);}(_0x10cd,0x11f));var _0xd10c=function(_0x47d310,_0x1b57dc){_0x47d310=_0x47d310-0x0;var _0x216c96=_0x10cd[_0x47d310];return _0x216c96;};'use strict';var _=require(_0xd10c('0x0'));var util=require(_0xd10c('0x1'));var logger=require(_0xd10c('0x2'))(_0xd10c('0x3'));var moment=require('moment');var BPromise=require(_0xd10c('0x4'));var rp=require(_0xd10c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd10c('0x6'));var config=require(_0xd10c('0x7'));var attributes=require(_0xd10c('0x8'));module[_0xd10c('0x9')]=function(_0x1dcdeb,_0x37e992){return _0x1dcdeb[_0xd10c('0xa')]('WhatsappAccount',attributes,{'tableName':_0xd10c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index dc379a3..2c86f6d 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4b2=['randomstring','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird'];(function(_0x141cbe,_0x24b13a){var _0x395766=function(_0x1d7749){while(--_0x1d7749){_0x141cbe['push'](_0x141cbe['shift']());}};_0x395766(++_0x24b13a);}(_0xc4b2,0x113));var _0x2c4b=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xc4b2[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0x2c4b('0x0'));var util=require(_0x2c4b('0x1'));var moment=require(_0x2c4b('0x2'));var BPromise=require(_0x2c4b('0x3'));var rs=require(_0x2c4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c4b('0x5'));var config=require(_0x2c4b('0x6'));var jayson=require(_0x2c4b('0x7'));var client=jayson['client'][_0x2c4b('0x8')]({'port':0x232a});config[_0x2c4b('0x9')]=_[_0x2c4b('0xa')](config[_0x2c4b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c4b('0xb'))(new Redis(config[_0x2c4b('0x9')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x345f7c,_0x3b7b98,_0x10aa39){return new BPromise(function(_0x2cb115,_0xe42357){return client['request'](_0x345f7c,_0x10aa39)['then'](function(_0x485579){logger[_0x2c4b('0xc')](_0x2c4b('0xd'),_0x3b7b98,'request\x20sent');logger[_0x2c4b('0xe')](_0x2c4b('0xf'),_0x3b7b98,'request\x20sent',JSON[_0x2c4b('0x10')](_0x485579));if(_0x485579['error']){if(_0x485579[_0x2c4b('0x11')]['code']===0x1f4){logger[_0x2c4b('0x11')](_0x2c4b('0xd'),_0x3b7b98,_0x485579[_0x2c4b('0x11')]['message']);return _0xe42357(_0x485579[_0x2c4b('0x11')][_0x2c4b('0x12')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3b7b98,_0x485579[_0x2c4b('0x11')][_0x2c4b('0x12')]);return _0x2cb115(_0x485579[_0x2c4b('0x11')]['message']);}else{logger[_0x2c4b('0xc')](_0x2c4b('0xd'),_0x3b7b98,'request\x20sent');_0x2cb115(_0x485579[_0x2c4b('0x13')]['message']);}})[_0x2c4b('0x14')](function(_0x123762){logger[_0x2c4b('0x11')](_0x2c4b('0xd'),_0x3b7b98,_0x123762);_0xe42357(_0x123762);});});}exports[_0x2c4b('0x15')]=function(_0x53ba70){var _0x164087=this;return new Promise(function(_0x2b1ef2,_0x175a17){return db[_0x2c4b('0x16')]['find']({'raw':_0x53ba70['options']?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x18')]===undefined?!![]:![]:!![],'where':_0x53ba70[_0x2c4b('0x17')]?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x19')]||null:null,'attributes':_0x53ba70[_0x2c4b('0x17')]?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x1a')]||null:null,'include':_0x53ba70[_0x2c4b('0x17')]?_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x1b')]?_[_0x2c4b('0x1c')](_0x53ba70[_0x2c4b('0x17')][_0x2c4b('0x1b')],function(_0x2d4ee2){return{'model':db[_0x2d4ee2['model']],'as':_0x2d4ee2['as'],'attributes':_0x2d4ee2['attributes'],'include':_0x2d4ee2[_0x2c4b('0x1b')]?_[_0x2c4b('0x1c')](_0x2d4ee2[_0x2c4b('0x1b')],function(_0x300bd0){return{'model':db[_0x300bd0[_0x2c4b('0x1d')]],'as':_0x300bd0['as'],'attributes':_0x300bd0['attributes'],'include':_0x300bd0[_0x2c4b('0x1b')]?_['map'](_0x300bd0[_0x2c4b('0x1b')],function(_0x3646f5){return{'model':db[_0x3646f5[_0x2c4b('0x1d')]],'as':_0x3646f5['as'],'attributes':_0x3646f5['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c4b('0x1e')](function(_0x5ce143){logger[_0x2c4b('0xc')](_0x2c4b('0x15'),_0x53ba70);logger[_0x2c4b('0xe')](_0x2c4b('0x15'),_0x53ba70,JSON[_0x2c4b('0x10')](_0x5ce143));_0x2b1ef2(_0x5ce143);})[_0x2c4b('0x14')](function(_0x58d9d1){logger[_0x2c4b('0x11')](_0x2c4b('0x15'),_0x58d9d1[_0x2c4b('0x12')],_0x53ba70);_0x175a17(_0x164087[_0x2c4b('0x11')](0x1f4,_0x58d9d1[_0x2c4b('0x12')]));});});}; \ No newline at end of file +var _0xd01d=['attributes','map','include','model','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','ShowWhatsappAccount','find','options','raw','where'];(function(_0x14bfd1,_0x255345){var _0x59ee8a=function(_0x310fcf){while(--_0x310fcf){_0x14bfd1['push'](_0x14bfd1['shift']());}};_0x59ee8a(++_0x255345);}(_0xd01d,0xbe));var _0xdd01=function(_0x3b22b9,_0x381357){_0x3b22b9=_0x3b22b9-0x0;var _0x397143=_0xd01d[_0x3b22b9];return _0x397143;};'use strict';var _=require('lodash');var util=require(_0xdd01('0x0'));var moment=require('moment');var BPromise=require(_0xdd01('0x1'));var rs=require(_0xdd01('0x2'));var fs=require('fs');var Redis=require(_0xdd01('0x3'));var db=require(_0xdd01('0x4'))['db'];var utils=require(_0xdd01('0x5'));var logger=require(_0xdd01('0x6'))(_0xdd01('0x7'));var config=require(_0xdd01('0x8'));var jayson=require(_0xdd01('0x9'));var client=jayson[_0xdd01('0xa')]['http']({'port':0x232a});config['redis']=_[_0xdd01('0xb')](config[_0xdd01('0xc')],{'host':_0xdd01('0xd'),'port':0x18eb});var socket=require(_0xdd01('0xe'))(new Redis(config[_0xdd01('0xc')]));require('./whatsappAccount.socket')[_0xdd01('0xf')](socket);function respondWithRpcPromise(_0x17b14a,_0x51b31d,_0x5c256f){return new BPromise(function(_0x1fc7e8,_0x35c9c2){return client[_0xdd01('0x10')](_0x17b14a,_0x5c256f)[_0xdd01('0x11')](function(_0x1fca3c){logger['info'](_0xdd01('0x12'),_0x51b31d,'request\x20sent');logger['debug'](_0xdd01('0x13'),_0x51b31d,_0xdd01('0x14'),JSON[_0xdd01('0x15')](_0x1fca3c));if(_0x1fca3c[_0xdd01('0x16')]){if(_0x1fca3c[_0xdd01('0x16')]['code']===0x1f4){logger[_0xdd01('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x51b31d,_0x1fca3c[_0xdd01('0x16')][_0xdd01('0x17')]);return _0x35c9c2(_0x1fca3c['error'][_0xdd01('0x17')]);}logger['error'](_0xdd01('0x12'),_0x51b31d,_0x1fca3c[_0xdd01('0x16')][_0xdd01('0x17')]);return _0x1fc7e8(_0x1fca3c['error'][_0xdd01('0x17')]);}else{logger[_0xdd01('0x18')](_0xdd01('0x12'),_0x51b31d,'request\x20sent');_0x1fc7e8(_0x1fca3c[_0xdd01('0x19')][_0xdd01('0x17')]);}})[_0xdd01('0x1a')](function(_0x23375a){logger[_0xdd01('0x16')](_0xdd01('0x12'),_0x51b31d,_0x23375a);_0x35c9c2(_0x23375a);});});}exports[_0xdd01('0x1b')]=function(_0x351331){var _0x90d731=this;return new Promise(function(_0x4bf924,_0x297198){return db['WhatsappAccount'][_0xdd01('0x1c')]({'raw':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')][_0xdd01('0x1e')]===undefined?!![]:![]:!![],'where':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')][_0xdd01('0x1f')]||null:null,'attributes':_0x351331[_0xdd01('0x1d')]?_0x351331['options'][_0xdd01('0x20')]||null:null,'include':_0x351331[_0xdd01('0x1d')]?_0x351331[_0xdd01('0x1d')]['include']?_[_0xdd01('0x21')](_0x351331[_0xdd01('0x1d')][_0xdd01('0x22')],function(_0x53152b){return{'model':db[_0x53152b[_0xdd01('0x23')]],'as':_0x53152b['as'],'attributes':_0x53152b[_0xdd01('0x20')],'include':_0x53152b[_0xdd01('0x22')]?_['map'](_0x53152b[_0xdd01('0x22')],function(_0x5890c0){return{'model':db[_0x5890c0[_0xdd01('0x23')]],'as':_0x5890c0['as'],'attributes':_0x5890c0[_0xdd01('0x20')],'include':_0x5890c0[_0xdd01('0x22')]?_[_0xdd01('0x21')](_0x5890c0[_0xdd01('0x22')],function(_0x4e43a2){return{'model':db[_0x4e43a2[_0xdd01('0x23')]],'as':_0x4e43a2['as'],'attributes':_0x4e43a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd01('0x11')](function(_0x346c88){logger[_0xdd01('0x18')](_0xdd01('0x1b'),_0x351331);logger[_0xdd01('0x24')](_0xdd01('0x1b'),_0x351331,JSON[_0xdd01('0x15')](_0x346c88));_0x4bf924(_0x346c88);})[_0xdd01('0x1a')](function(_0x340aea){logger[_0xdd01('0x16')](_0xdd01('0x1b'),_0x340aea[_0xdd01('0x17')],_0x351331);_0x297198(_0x90d731[_0xdd01('0x16')](0x1f4,_0x340aea['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 3032830..af4cf34 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbc4=['whatsappAccount:','./whatsappAccount.events','save','remove','update','removeListener','register','length'];(function(_0x1ab8d7,_0xb19e9e){var _0x3c9e66=function(_0x4f67c9){while(--_0x4f67c9){_0x1ab8d7['push'](_0x1ab8d7['shift']());}};_0x3c9e66(++_0xb19e9e);}(_0xdbc4,0xd1));var _0x4dbc=function(_0x83db46,_0xfe0f30){_0x83db46=_0x83db46-0x0;var _0x102fa7=_0xdbc4[_0x83db46];return _0x102fa7;};'use strict';var WhatsappAccountEvents=require(_0x4dbc('0x0'));var events=[_0x4dbc('0x1'),_0x4dbc('0x2'),_0x4dbc('0x3')];function createListener(_0x4f3774,_0x132673){return function(_0x35f1ec){_0x132673['emit'](_0x4f3774,_0x35f1ec);};}function removeListener(_0x7d2d0c,_0xee7342){return function(){WhatsappAccountEvents[_0x4dbc('0x4')](_0x7d2d0c,_0xee7342);};}exports[_0x4dbc('0x5')]=function(_0x53e2bd){for(var _0x447849=0x0,_0x44971a=events[_0x4dbc('0x6')];_0x447849<_0x44971a;_0x447849++){var _0x2993e3=events[_0x447849];var _0xdfe391=createListener(_0x4dbc('0x7')+_0x2993e3,_0x53e2bd);WhatsappAccountEvents['on'](_0x2993e3,_0xdfe391);}}; \ No newline at end of file +var _0x7e1e=['length','./whatsappAccount.events','save','update','emit','removeListener','register'];(function(_0xcc721e,_0x21ebb5){var _0x5c42df=function(_0x1b7926){while(--_0x1b7926){_0xcc721e['push'](_0xcc721e['shift']());}};_0x5c42df(++_0x21ebb5);}(_0x7e1e,0x127));var _0xe7e1=function(_0x101942,_0x121ea6){_0x101942=_0x101942-0x0;var _0x5d4359=_0x7e1e[_0x101942];return _0x5d4359;};'use strict';var WhatsappAccountEvents=require(_0xe7e1('0x0'));var events=[_0xe7e1('0x1'),'remove',_0xe7e1('0x2')];function createListener(_0x1b2ab6,_0x5435f1){return function(_0x557cb2){_0x5435f1[_0xe7e1('0x3')](_0x1b2ab6,_0x557cb2);};}function removeListener(_0x5f3e78,_0x3b3596){return function(){WhatsappAccountEvents[_0xe7e1('0x4')](_0x5f3e78,_0x3b3596);};}exports[_0xe7e1('0x5')]=function(_0x4ac99f){for(var _0x25a6f2=0x0,_0x200673=events[_0xe7e1('0x6')];_0x25a6f2<_0x200673;_0x25a6f2++){var _0x1ad0c2=events[_0x25a6f2];var _0x2dd508=createListener('whatsappAccount:'+_0x1ad0c2,_0x4ac99f);WhatsappAccountEvents['on'](_0x1ad0c2,_0x2dd508);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f9f3f2f..b79f4e4 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4b8=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','/:id','put','isAuthenticated','update','delete','exports','multer','path','fs-extra'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4b8,0x19d));var _0x8c4b=function(_0x20ac45,_0x593ef2){_0x20ac45=_0x20ac45-0x0;var _0x3d01f8=_0xc4b8[_0x20ac45];return _0x3d01f8;};'use strict';var multer=require(_0x8c4b('0x0'));var util=require('util');var path=require(_0x8c4b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c4b('0x2'));var auth=require(_0x8c4b('0x3'));var interaction=require(_0x8c4b('0x4'));var config=require('../../config/environment');var controller=require(_0x8c4b('0x5'));router[_0x8c4b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8c4b('0x7'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8c4b('0x8')](_0x8c4b('0x7'),auth[_0x8c4b('0x9')](),controller[_0x8c4b('0xa')]);router[_0x8c4b('0xb')]('/:id',auth[_0x8c4b('0x9')](),controller['destroy']);module[_0x8c4b('0xc')]=router; \ No newline at end of file +var _0xa2f2=['index','/:id','show','post','create','put','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa2f2,0x1b1));var _0x2a2f=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xa2f2[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require('multer');var util=require(_0x2a2f('0x0'));var path=require(_0x2a2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a2f('0x2'));var router=express[_0x2a2f('0x3')]();var fs_extra=require(_0x2a2f('0x4'));var auth=require(_0x2a2f('0x5'));var interaction=require(_0x2a2f('0x6'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router[_0x2a2f('0x7')]('/',auth[_0x2a2f('0x8')](),controller[_0x2a2f('0x9')]);router[_0x2a2f('0x7')](_0x2a2f('0xa'),auth[_0x2a2f('0x8')](),controller[_0x2a2f('0xb')]);router[_0x2a2f('0xc')]('/',auth[_0x2a2f('0x8')](),controller[_0x2a2f('0xd')]);router[_0x2a2f('0xe')](_0x2a2f('0xa'),auth[_0x2a2f('0x8')](),controller['update']);router['delete'](_0x2a2f('0xa'),auth[_0x2a2f('0x8')](),controller[_0x2a2f('0xf')]);module[_0x2a2f('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 8561a99..0e5d381 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6465=['STRING','noop','sequelize','INTEGER'];(function(_0x5ee752,_0x35d3df){var _0x121f91=function(_0x1c1654){while(--_0x1c1654){_0x5ee752['push'](_0x5ee752['shift']());}};_0x121f91(++_0x35d3df);}(_0x6465,0x14a));var _0x5646=function(_0x4c973a,_0x1e68e7){_0x4c973a=_0x4c973a-0x0;var _0x1cb814=_0x6465[_0x4c973a];return _0x1cb814;};'use strict';var Sequelize=require(_0x5646('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5646('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5646('0x2')],'allowNull':![],'defaultValue':_0x5646('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5646('0x2')]},'interval':{'type':Sequelize[_0x5646('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd88c=['exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x194b89,_0x29050c){var _0x17b0a8=function(_0x1f3294){while(--_0x1f3294){_0x194b89['push'](_0x194b89['shift']());}};_0x17b0a8(++_0x29050c);}(_0xd88c,0x104));var _0xcd88=function(_0x356ed3,_0x4edc4a){_0x356ed3=_0x356ed3-0x0;var _0xcfbee=_0xd88c[_0x356ed3];return _0xcfbee;};'use strict';var Sequelize=require('sequelize');module[_0xcd88('0x0')]={'priority':{'type':Sequelize[_0xcd88('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcd88('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcd88('0x3')]()},'description':{'type':Sequelize[_0xcd88('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcd88('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index cdbcfad..886af81 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd509=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','find','create','body','params','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x39b7f3,_0x50c53e){var _0xb34cbd=function(_0x638922){while(--_0x638922){_0x39b7f3['push'](_0x39b7f3['shift']());}};_0xb34cbd(++_0x50c53e);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d50('0x0'));var jsonpatch=require(_0x9d50('0x1'));var rp=require(_0x9d50('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d50('0x3'));var util=require(_0x9d50('0x4'));var path=require('path');var sox=require(_0x9d50('0x5'));var csv=require(_0x9d50('0x6'));var ejs=require(_0x9d50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d50('0x8'));var squel=require('squel');var crypto=require(_0x9d50('0x9'));var jsforce=require(_0x9d50('0xa'));var deskjs=require(_0x9d50('0xb'));var toCsv=require(_0x9d50('0x6'));var querystring=require(_0x9d50('0xc'));var Papa=require('papaparse');var Redis=require(_0x9d50('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d50('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d50('0xf'))(_0x9d50('0x10'));var utils=require(_0x9d50('0x11'));var config=require(_0x9d50('0x12'));var licenseUtil=require(_0x9d50('0x13'));var db=require(_0x9d50('0x14'))['db'];function respondWithStatusCode(_0x3bc884,_0x5c1d1b){_0x5c1d1b=_0x5c1d1b||0xcc;return function(_0x1eb11e){if(_0x1eb11e){return _0x3bc884['sendStatus'](_0x5c1d1b);}return _0x3bc884[_0x9d50('0x15')](_0x5c1d1b)[_0x9d50('0x16')]();};}function respondWithResult(_0x1fcdd7,_0x2fd96b){_0x2fd96b=_0x2fd96b||0xc8;return function(_0x36a82d){if(_0x36a82d){return _0x1fcdd7[_0x9d50('0x15')](_0x2fd96b)[_0x9d50('0x17')](_0x36a82d);}};}function respondWithFilteredResult(_0x3c115b,_0x25f253){return function(_0x304b42){if(_0x304b42){var _0x38d651=typeof _0x25f253[_0x9d50('0x18')]==='undefined'&&typeof _0x25f253[_0x9d50('0x19')]===_0x9d50('0x1a');var _0xa326fa=_0x304b42[_0x9d50('0x1b')];var _0x9c4cbd=_0x38d651?0x0:_0x25f253[_0x9d50('0x18')];var _0x437462=_0x38d651?_0x304b42[_0x9d50('0x1b')]:_0x25f253[_0x9d50('0x18')]+_0x25f253[_0x9d50('0x19')];var _0x2965a3;if(_0x437462>=_0xa326fa){_0x437462=_0xa326fa;_0x2965a3=0xc8;}else{_0x2965a3=0xce;}_0x3c115b[_0x9d50('0x15')](_0x2965a3);return _0x3c115b[_0x9d50('0x1c')](_0x9d50('0x1d'),_0x9c4cbd+'-'+_0x437462+'/'+_0xa326fa)[_0x9d50('0x17')](_0x304b42);}return null;};}function patchUpdates(_0x8905d3){return function(_0xdedc47){try{jsonpatch[_0x9d50('0x1e')](_0xdedc47,_0x8905d3,!![]);}catch(_0x40026b){return BPromise[_0x9d50('0x1f')](_0x40026b);}return _0xdedc47[_0x9d50('0x20')]();};}function saveUpdates(_0xfcb55e,_0x3febd6){return function(_0x4a2080){if(_0x4a2080){return _0x4a2080[_0x9d50('0x21')](_0xfcb55e)[_0x9d50('0x22')](function(_0x2a50f7){return _0x2a50f7;});}return null;};}function removeEntity(_0x1adf7d,_0x12ae02){return function(_0x257738){if(_0x257738){return _0x257738[_0x9d50('0x23')]()[_0x9d50('0x22')](function(){_0x1adf7d[_0x9d50('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cf61b,_0x4e0517){return function(_0x5c58e0){if(!_0x5c58e0){_0x2cf61b[_0x9d50('0x24')](0x194);}return _0x5c58e0;};}function handleError(_0xe121d2,_0x31420b){_0x31420b=_0x31420b||0x1f4;return function(_0x210a1b){logger['error'](_0x210a1b[_0x9d50('0x25')]);if(_0x210a1b[_0x9d50('0x26')]){delete _0x210a1b['name'];}_0xe121d2[_0x9d50('0x15')](_0x31420b)['send'](_0x210a1b);};}exports[_0x9d50('0x27')]=function(_0x460420,_0x40f8bd){var _0x5b3642={},_0x3bd762={},_0x515252={'count':0x0,'rows':[]};var _0x1d5a64=_[_0x9d50('0x28')](db[_0x9d50('0x29')][_0x9d50('0x2a')],function(_0x282493){return{'name':_0x282493[_0x9d50('0x2b')],'type':_0x282493[_0x9d50('0x2c')][_0x9d50('0x2d')]};});_0x3bd762[_0x9d50('0x2e')]=_['map'](_0x1d5a64,_0x9d50('0x26'));_0x3bd762['query']=_['keys'](_0x460420[_0x9d50('0x2f')]);_0x3bd762[_0x9d50('0x30')]=_[_0x9d50('0x31')](_0x3bd762['model'],_0x3bd762[_0x9d50('0x2f')]);_0x5b3642[_0x9d50('0x32')]=_[_0x9d50('0x31')](_0x3bd762[_0x9d50('0x2e')],qs[_0x9d50('0x33')](_0x460420[_0x9d50('0x2f')][_0x9d50('0x33')]));_0x5b3642[_0x9d50('0x32')]=_0x5b3642[_0x9d50('0x32')][_0x9d50('0x34')]?_0x5b3642[_0x9d50('0x32')]:_0x3bd762[_0x9d50('0x2e')];if(!_0x460420[_0x9d50('0x2f')][_0x9d50('0x35')](_0x9d50('0x36'))){_0x5b3642['limit']=qs[_0x9d50('0x19')](_0x460420['query'][_0x9d50('0x19')]);_0x5b3642['offset']=qs[_0x9d50('0x18')](_0x460420[_0x9d50('0x2f')][_0x9d50('0x18')]);}_0x5b3642[_0x9d50('0x37')]=qs[_0x9d50('0x38')](_0x460420['query'][_0x9d50('0x38')]);_0x5b3642[_0x9d50('0x39')]=qs[_0x9d50('0x30')](_[_0x9d50('0x3a')](_0x460420[_0x9d50('0x2f')],_0x3bd762[_0x9d50('0x30')]),_0x1d5a64);if(_0x460420[_0x9d50('0x2f')][_0x9d50('0x3b')]){_0x5b3642['where']=_[_0x9d50('0x3c')](_0x5b3642['where'],{'$or':_[_0x9d50('0x28')](_0x1d5a64,function(_0x5c32fb){if(_0x5c32fb[_0x9d50('0x2c')]!==_0x9d50('0x3d')){var _0x2d1b20={};_0x2d1b20[_0x5c32fb[_0x9d50('0x26')]]={'$like':'%'+_0x460420['query']['filter']+'%'};return _0x2d1b20;}})});}_0x5b3642=_[_0x9d50('0x3c')]({},_0x5b3642,_0x460420[_0x9d50('0x3e')]);var _0x365700={'where':_0x5b3642[_0x9d50('0x39')]};return db[_0x9d50('0x29')][_0x9d50('0x1b')](_0x365700)[_0x9d50('0x22')](function(_0x2a7aa6){_0x515252[_0x9d50('0x1b')]=_0x2a7aa6;if(_0x460420[_0x9d50('0x2f')][_0x9d50('0x3f')]){_0x5b3642['include']=[{'all':!![]}];}return db[_0x9d50('0x29')][_0x9d50('0x40')](_0x5b3642);})['then'](function(_0x14e4a7){_0x515252[_0x9d50('0x41')]=_0x14e4a7;return _0x515252;})[_0x9d50('0x22')](respondWithFilteredResult(_0x40f8bd,_0x5b3642))[_0x9d50('0x42')](handleError(_0x40f8bd,null));};exports[_0x9d50('0x43')]=function(_0x1bfaeb,_0x3bea37){var _0x5340b2={'raw':!![],'where':{'id':_0x1bfaeb['params']['id']}},_0x47d09f={};_0x47d09f[_0x9d50('0x2e')]=_[_0x9d50('0x44')](db[_0x9d50('0x29')][_0x9d50('0x2a')]);_0x47d09f[_0x9d50('0x2f')]=_['keys'](_0x1bfaeb['query']);_0x47d09f[_0x9d50('0x30')]=_[_0x9d50('0x31')](_0x47d09f[_0x9d50('0x2e')],_0x47d09f[_0x9d50('0x2f')]);_0x5340b2[_0x9d50('0x32')]=_[_0x9d50('0x31')](_0x47d09f[_0x9d50('0x2e')],qs[_0x9d50('0x33')](_0x1bfaeb[_0x9d50('0x2f')][_0x9d50('0x33')]));_0x5340b2['attributes']=_0x5340b2[_0x9d50('0x32')][_0x9d50('0x34')]?_0x5340b2[_0x9d50('0x32')]:_0x47d09f[_0x9d50('0x2e')];if(_0x1bfaeb[_0x9d50('0x2f')]['includeAll']){_0x5340b2['include']=[{'all':!![]}];}_0x5340b2=_[_0x9d50('0x3c')]({},_0x5340b2,_0x1bfaeb[_0x9d50('0x3e')]);return db[_0x9d50('0x29')][_0x9d50('0x45')](_0x5340b2)[_0x9d50('0x22')](handleEntityNotFound(_0x3bea37,null))['then'](respondWithResult(_0x3bea37,null))[_0x9d50('0x42')](handleError(_0x3bea37,null));};exports[_0x9d50('0x46')]=function(_0x4ed8dd,_0xe98a58){return db[_0x9d50('0x29')]['create'](_0x4ed8dd['body'],{})[_0x9d50('0x22')](respondWithResult(_0xe98a58,0xc9))[_0x9d50('0x42')](handleError(_0xe98a58,null));};exports[_0x9d50('0x21')]=function(_0x441fd5,_0x491876){if(_0x441fd5['body']['id']){delete _0x441fd5[_0x9d50('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x441fd5[_0x9d50('0x48')]['id']}})[_0x9d50('0x22')](handleEntityNotFound(_0x491876,null))['then'](saveUpdates(_0x441fd5['body'],null))[_0x9d50('0x22')](respondWithResult(_0x491876,null))[_0x9d50('0x42')](handleError(_0x491876,null));};exports[_0x9d50('0x23')]=function(_0x4fd62d,_0x15131a){return db[_0x9d50('0x29')]['find']({'where':{'id':_0x4fd62d[_0x9d50('0x48')]['id']}})['then'](handleEntityNotFound(_0x15131a,null))[_0x9d50('0x22')](removeEntity(_0x15131a,null))['catch'](handleError(_0x15131a,null));}; \ No newline at end of file +var _0xb44a=['sort','where','pick','filter','map','type','VIRTUAL','options','rows','catch','show','params','includeAll','merge','create','body','find','destroy','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','WhatsappApplication','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x306e8e,_0xd4eab9){var _0x6c3ca7=function(_0x83850b){while(--_0x83850b){_0x306e8e['push'](_0x306e8e['shift']());}};_0x6c3ca7(++_0xd4eab9);}(_0xb44a,0x1c2));var _0xab44=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0xb44a[_0xd02bb];return _0x1cdf23;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){_0x11f0b[_0xab44('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2439f3,_0x5a7269){return function(_0x2a1bbc){if(!_0x2a1bbc){_0x2439f3['sendStatus'](0x194);}return _0x2a1bbc;};}function handleError(_0x531583,_0x8e60fa){_0x8e60fa=_0x8e60fa||0x1f4;return function(_0x25287b){logger[_0xab44('0x24')](_0x25287b[_0xab44('0x25')]);if(_0x25287b[_0xab44('0x26')]){delete _0x25287b['name'];}_0x531583[_0xab44('0x18')](_0x8e60fa)[_0xab44('0x27')](_0x25287b);};}exports['index']=function(_0x887b0d,_0xebb7d1){var _0x21131e={},_0x1cd486={},_0x4550c8={'count':0x0,'rows':[]};var _0xdc50a1=_['map'](db[_0xab44('0x28')][_0xab44('0x29')],function(_0x36f9b6){return{'name':_0x36f9b6['fieldName'],'type':_0x36f9b6['type'][_0xab44('0x2a')]};});_0x1cd486['model']=_['map'](_0xdc50a1,_0xab44('0x26'));_0x1cd486[_0xab44('0x2b')]=_[_0xab44('0x2c')](_0x887b0d[_0xab44('0x2b')]);_0x1cd486[_0xab44('0x2d')]=_[_0xab44('0x2e')](_0x1cd486[_0xab44('0x2f')],_0x1cd486[_0xab44('0x2b')]);_0x21131e[_0xab44('0x30')]=_[_0xab44('0x2e')](_0x1cd486[_0xab44('0x2f')],qs[_0xab44('0x31')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x31')]));_0x21131e['attributes']=_0x21131e['attributes'][_0xab44('0x32')]?_0x21131e[_0xab44('0x30')]:_0x1cd486['model'];if(!_0x887b0d[_0xab44('0x2b')][_0xab44('0x33')](_0xab44('0x34'))){_0x21131e[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x1c')]);_0x21131e[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x1a')]);}_0x21131e[_0xab44('0x35')]=qs[_0xab44('0x36')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x36')]);_0x21131e[_0xab44('0x37')]=qs[_0xab44('0x2d')](_[_0xab44('0x38')](_0x887b0d['query'],_0x1cd486[_0xab44('0x2d')]),_0xdc50a1);if(_0x887b0d[_0xab44('0x2b')][_0xab44('0x39')]){_0x21131e[_0xab44('0x37')]=_['merge'](_0x21131e[_0xab44('0x37')],{'$or':_[_0xab44('0x3a')](_0xdc50a1,function(_0xcd077a){if(_0xcd077a[_0xab44('0x3b')]!==_0xab44('0x3c')){var _0x4f5cf3={};_0x4f5cf3[_0xcd077a[_0xab44('0x26')]]={'$like':'%'+_0x887b0d[_0xab44('0x2b')][_0xab44('0x39')]+'%'};return _0x4f5cf3;}})});}_0x21131e=_['merge']({},_0x21131e,_0x887b0d[_0xab44('0x3d')]);var _0x1e26de={'where':_0x21131e[_0xab44('0x37')]};return db[_0xab44('0x28')][_0xab44('0x1d')](_0x1e26de)['then'](function(_0x1de52d){_0x4550c8['count']=_0x1de52d;if(_0x887b0d[_0xab44('0x2b')]['includeAll']){_0x21131e['include']=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x21131e);})['then'](function(_0x120585){_0x4550c8[_0xab44('0x3e')]=_0x120585;return _0x4550c8;})[_0xab44('0x23')](respondWithFilteredResult(_0xebb7d1,_0x21131e))[_0xab44('0x3f')](handleError(_0xebb7d1,null));};exports[_0xab44('0x40')]=function(_0xf3f37a,_0x19d20d){var _0x33641e={'raw':!![],'where':{'id':_0xf3f37a[_0xab44('0x41')]['id']}},_0x4429e6={};_0x4429e6['model']=_[_0xab44('0x2c')](db[_0xab44('0x28')][_0xab44('0x29')]);_0x4429e6[_0xab44('0x2b')]=_['keys'](_0xf3f37a[_0xab44('0x2b')]);_0x4429e6[_0xab44('0x2d')]=_[_0xab44('0x2e')](_0x4429e6[_0xab44('0x2f')],_0x4429e6[_0xab44('0x2b')]);_0x33641e[_0xab44('0x30')]=_['intersection'](_0x4429e6['model'],qs[_0xab44('0x31')](_0xf3f37a[_0xab44('0x2b')][_0xab44('0x31')]));_0x33641e[_0xab44('0x30')]=_0x33641e[_0xab44('0x30')]['length']?_0x33641e[_0xab44('0x30')]:_0x4429e6[_0xab44('0x2f')];if(_0xf3f37a[_0xab44('0x2b')][_0xab44('0x42')]){_0x33641e['include']=[{'all':!![]}];}_0x33641e=_[_0xab44('0x43')]({},_0x33641e,_0xf3f37a[_0xab44('0x3d')]);return db[_0xab44('0x28')]['find'](_0x33641e)[_0xab44('0x23')](handleEntityNotFound(_0x19d20d,null))[_0xab44('0x23')](respondWithResult(_0x19d20d,null))[_0xab44('0x3f')](handleError(_0x19d20d,null));};exports[_0xab44('0x44')]=function(_0x4eeb65,_0x13892d){return db['WhatsappApplication'][_0xab44('0x44')](_0x4eeb65[_0xab44('0x45')],{})[_0xab44('0x23')](respondWithResult(_0x13892d,0xc9))[_0xab44('0x3f')](handleError(_0x13892d,null));};exports['update']=function(_0x328891,_0x5497a3){if(_0x328891[_0xab44('0x45')]['id']){delete _0x328891[_0xab44('0x45')]['id'];}return db[_0xab44('0x28')][_0xab44('0x46')]({'where':{'id':_0x328891[_0xab44('0x41')]['id']}})['then'](handleEntityNotFound(_0x5497a3,null))[_0xab44('0x23')](saveUpdates(_0x328891['body'],null))[_0xab44('0x23')](respondWithResult(_0x5497a3,null))[_0xab44('0x3f')](handleError(_0x5497a3,null));};exports[_0xab44('0x47')]=function(_0x50b705,_0x4463f1){return db[_0xab44('0x28')][_0xab44('0x46')]({'where':{'id':_0x50b705[_0xab44('0x41')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x4463f1,null))['then'](removeEntity(_0x4463f1,null))['catch'](handleError(_0x4463f1,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 28bd9f0..de3d913 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x495e=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','api'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x495e,0xfb));var _0xe495=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0x495e[_0x291aaf];return _0x5571e6;};'use strict';var _=require(_0xe495('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe495('0x1'));var moment=require(_0xe495('0x2'));var BPromise=require(_0xe495('0x3'));var rp=require(_0xe495('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe495('0x5'));var config=require(_0xe495('0x6'));var attributes=require(_0xe495('0x7'));module[_0xe495('0x8')]=function(_0x130db3,_0x467a69){return _0x130db3[_0xe495('0x9')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe495('0xa')});}; \ No newline at end of file +var _0xe009=['bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xe009,0x122));var _0x9e00=function(_0xd6ff1e,_0x36aa99){_0xd6ff1e=_0xd6ff1e-0x0;var _0x56c5c7=_0xe009[_0xd6ff1e];return _0x56c5c7;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var logger=require(_0x9e00('0x2'))(_0x9e00('0x3'));var moment=require('moment');var BPromise=require(_0x9e00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e00('0x5'));var rimraf=require(_0x9e00('0x6'));var config=require(_0x9e00('0x7'));var attributes=require(_0x9e00('0x8'));module[_0x9e00('0x9')]=function(_0x467e35,_0x32b4ee){return _0x467e35[_0x9e00('0xa')](_0x9e00('0xb'),attributes,{'tableName':_0x9e00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9e00('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 583293f..70a9b18 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x5c12,0x188));var _0x25c1=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x5c12[_0x216799];return _0x3661c3;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0xdc09bf,_0x420749){var _0x4cfaa3=function(_0x1ce7e8){while(--_0x1ce7e8){_0xdc09bf['push'](_0xdc09bf['shift']());}};_0x4cfaa3(++_0x420749);}(_0xedd9,0xfc));var _0x9edd=function(_0x4893ec,_0x51a6c8){_0x4893ec=_0x4893ec-0x0;var _0x3c0b1a=_0xedd9[_0x4893ec];return _0x3c0b1a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 1704230..bfa2ada 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c5a=['isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe'];(function(_0x57042f,_0x1fdfd4){var _0x40a5ff=function(_0x149545){while(--_0x149545){_0x57042f['push'](_0x57042f['shift']());}};_0x40a5ff(++_0x1fdfd4);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x317307,_0x25c124){_0x317307=_0x317307-0x0;var _0x23b29a=_0x9c5a[_0x317307];return _0x23b29a;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['get'](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller['getMessages']);router['get'](_0xa9c5('0xe'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xf')]);router[_0xa9c5('0x10')]('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);router[_0xa9c5('0x10')](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x12')]);router['post'](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x16')),controller[_0xa9c5('0x17')]);router[_0xa9c5('0x18')](_0xa9c5('0x19'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')]('whatsapp',_0xa9c5('0x1a')),controller[_0xa9c5('0x1b')]);router[_0xa9c5('0x1c')]('/:id',auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x1d')),controller[_0xa9c5('0x1e')]);router[_0xa9c5('0x1c')](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x1f')]);module[_0xa9c5('0x20')]=router; \ No newline at end of file +var _0x1dcc=['tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x28f18d,_0x389006){_0x28f18d=_0x28f18d-0x0;var _0xea200a=_0x1dcc[_0x28f18d];return _0xea200a;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1dc('0x5'));var interaction=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x9')]);router[_0xc1dc('0xa')]('/describe',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xb')]);router['get'](_0xc1dc('0xc'),auth['isAuthenticated'](),controller[_0xc1dc('0xd')]);router['get'](_0xc1dc('0xe'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xf')]);router[_0xc1dc('0xa')](_0xc1dc('0x10'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x11')]);router[_0xc1dc('0x12')]('/',auth[_0xc1dc('0x8')](),controller['create']);router[_0xc1dc('0x12')](_0xc1dc('0xe'),auth[_0xc1dc('0x8')](),controller['addMessage']);router[_0xc1dc('0x12')](_0xc1dc('0x13'),auth[_0xc1dc('0x8')](),interaction[_0xc1dc('0x14')](_0xc1dc('0x15'),_0xc1dc('0x16')),controller[_0xc1dc('0x17')]);router[_0xc1dc('0x18')](_0xc1dc('0xc'),auth[_0xc1dc('0x8')](),interaction[_0xc1dc('0x14')]('whatsapp',_0xc1dc('0x19')),controller[_0xc1dc('0x1a')]);router[_0xc1dc('0x1b')](_0xc1dc('0xc'),auth['isAuthenticated'](),interaction[_0xc1dc('0x14')](_0xc1dc('0x15'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xc1dc('0x1b')](_0xc1dc('0x13'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x1c')]);module[_0xc1dc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 30fe0d8..deae7a1 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9ef=['ENUM','out','sequelize','moment','BOOLEAN','STRING','DATE'];(function(_0x43df9b,_0x36ccd2){var _0xdc5a1=function(_0x575453){while(--_0x575453){_0x43df9b['push'](_0x43df9b['shift']());}};_0xdc5a1(++_0x36ccd2);}(_0xd9ef,0x95));var _0xfd9e=function(_0x40bb34,_0x1fdb03){_0x40bb34=_0x40bb34-0x0;var _0x5d50b5=_0xd9ef[_0x40bb34];return _0x5d50b5;};'use strict';var Sequelize=require(_0xfd9e('0x0'));var moment=require(_0xfd9e('0x1'));module['exports']={'closed':{'type':Sequelize[_0xfd9e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfd9e('0x3')]},'note':{'type':Sequelize[_0xfd9e('0x3')]},'phone':{'type':Sequelize[_0xfd9e('0x3')]},'read1stAt':{'type':Sequelize[_0xfd9e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xfd9e('0x5')]('in',_0xfd9e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfd9e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xfd9e('0x5')]('in',_0xfd9e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfd9e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc949=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x5d849c,_0x567e8a){var _0x14869b=function(_0x2c78cf){while(--_0x2c78cf){_0x5d849c['push'](_0x5d849c['shift']());}};_0x14869b(++_0x567e8a);}(_0xc949,0x181));var _0x9c94=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc949[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x9c94('0x0'));var moment=require('moment');module[_0x9c94('0x1')]={'closed':{'type':Sequelize[_0x9c94('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9c94('0x3')]},'disposition':{'type':Sequelize[_0x9c94('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9c94('0x4')]},'note':{'type':Sequelize[_0x9c94('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9c94('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9c94('0x5')]('in',_0x9c94('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9c94('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9c94('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9c94('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 07ca162..68c43df 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb07=['WhatsappAccount','Account','Owner','fullname','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','read','value','views','transcript-','.pdf','err','unlinkSync','rimraf','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','json','update','then','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','user','catch','params','model','keys','query','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','destroy','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','where','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','User','push','CmContact','Contact','firstName','Attachment','direction','secret'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0xfb07,0x94));var _0x7fb0=function(_0x4ce0f,_0x2926e1){_0x4ce0f=_0x4ce0f-0x0;var _0x522b82=_0xfb07[_0x4ce0f];return _0x522b82;};'use strict';var rimraf=require(_0x7fb0('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7fb0('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fb0('0x2'));var Redis=require(_0x7fb0('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0x7fb0('0x4'));var pdf=require('../../components/export/pdf');var logger=require(_0x7fb0('0x5'))(_0x7fb0('0x6'));var config=require('../../config/environment');var db=require(_0x7fb0('0x7'))['db'];config[_0x7fb0('0x8')]=_[_0x7fb0('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7fb0('0xa'))(new Redis(config[_0x7fb0('0x8')]));require('./whatsappInteraction.socket')[_0x7fb0('0xb')](socket);function respondWithStatusCode(_0x2e2b71,_0x5aa9d0){_0x5aa9d0=_0x5aa9d0||0xcc;return function(_0x5a0fbb){if(_0x5a0fbb){return _0x2e2b71[_0x7fb0('0xc')](_0x5aa9d0);}return _0x2e2b71['status'](_0x5aa9d0)[_0x7fb0('0xd')]();};}function respondWithResult(_0x4850da,_0x4ead2f){_0x4ead2f=_0x4ead2f||0xc8;return function(_0x5e5776){if(_0x5e5776){return _0x4850da[_0x7fb0('0xe')](_0x4ead2f)['json'](_0x5e5776);}};}function respondWithFilteredResult(_0x116628,_0x1cc287){return function(_0x2080e4){if(_0x2080e4){var _0x418c0c=typeof _0x1cc287[_0x7fb0('0xf')]===_0x7fb0('0x10')&&typeof _0x1cc287[_0x7fb0('0x11')]===_0x7fb0('0x10');var _0x12d3ef=_0x2080e4[_0x7fb0('0x12')];var _0x5f414d=_0x418c0c?0x0:_0x1cc287[_0x7fb0('0xf')];var _0x3a8715=_0x418c0c?_0x2080e4['count']:_0x1cc287[_0x7fb0('0xf')]+_0x1cc287['limit'];var _0x107e41;if(_0x3a8715>=_0x12d3ef){_0x3a8715=_0x12d3ef;_0x107e41=0xc8;}else{_0x107e41=0xce;}_0x116628[_0x7fb0('0xe')](_0x107e41);return _0x116628[_0x7fb0('0x13')]('Content-Range',_0x5f414d+'-'+_0x3a8715+'/'+_0x12d3ef)[_0x7fb0('0x14')](_0x2080e4);}return null;};}function saveUpdates(_0x46de43){return function(_0x57635e){if(_0x57635e){return _0x57635e[_0x7fb0('0x15')](_0x46de43)[_0x7fb0('0x16')](function(_0x4cc2e){return _0x4cc2e;});}return null;};}function removeEntity(_0x3203e0){return function(_0x35106c){if(_0x35106c){return _0x35106c['destroy']()[_0x7fb0('0x16')](function(){_0x3203e0[_0x7fb0('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4944f9){return function(_0x54b68e){if(!_0x54b68e){_0x4944f9[_0x7fb0('0xc')](0x194);}return _0x54b68e;};}function handleError(_0x11df9b,_0x5b8feb){_0x5b8feb=_0x5b8feb||0x1f4;return function(_0x3213b7){logger[_0x7fb0('0x17')](_0x3213b7[_0x7fb0('0x18')]);if(_0x3213b7[_0x7fb0('0x19')]){delete _0x3213b7[_0x7fb0('0x19')];}_0x11df9b[_0x7fb0('0xe')](_0x5b8feb)[_0x7fb0('0x1a')](_0x3213b7);};}exports['index']=function(_0x274cb4,_0x51b474){var _0x500cfa={};var _0x15f582=_[_0x7fb0('0x1b')](db[_0x7fb0('0x1c')][_0x7fb0('0x1d')],function(_0x4f4a24){return{'name':_0x4f4a24[_0x7fb0('0x1e')],'type':_0x4f4a24[_0x7fb0('0x1f')]['key']};});_0x500cfa=qs[_0x7fb0('0x20')](_0x15f582,_0x274cb4);return interaction[_0x7fb0('0x21')](_0x7fb0('0x22'),_0x274cb4['query'],_0x274cb4[_0x7fb0('0x23')],_0x500cfa,_0x15f582)[_0x7fb0('0x16')](respondWithFilteredResult(_0x51b474,_0x500cfa))[_0x7fb0('0x24')](handleError(_0x51b474,null));};exports['show']=function(_0x4f1b6,_0xd2e1e9){var _0x5cb5c4={'raw':![],'where':{'id':_0x4f1b6[_0x7fb0('0x25')]['id']}},_0x4a4d86={};_0x4a4d86[_0x7fb0('0x26')]=_[_0x7fb0('0x27')](db['WhatsappInteraction'][_0x7fb0('0x1d')]);_0x4a4d86[_0x7fb0('0x28')]=_[_0x7fb0('0x27')](_0x4f1b6[_0x7fb0('0x28')]);_0x4a4d86[_0x7fb0('0x29')]=_[_0x7fb0('0x2a')](_0x4a4d86[_0x7fb0('0x26')],_0x4a4d86[_0x7fb0('0x28')]);_0x5cb5c4[_0x7fb0('0x2b')]=_['intersection'](_0x4a4d86['model'],qs[_0x7fb0('0x2c')](_0x4f1b6[_0x7fb0('0x28')][_0x7fb0('0x2c')]));_0x5cb5c4[_0x7fb0('0x2b')]=_0x5cb5c4[_0x7fb0('0x2b')]['length']?_0x5cb5c4[_0x7fb0('0x2b')]:_0x4a4d86[_0x7fb0('0x26')];if(_0x4f1b6[_0x7fb0('0x28')][_0x7fb0('0x2d')]){_0x5cb5c4['include']=[{'all':!![]}];}_0x5cb5c4=_[_0x7fb0('0x2e')]({},_0x5cb5c4,_0x4f1b6[_0x7fb0('0x2f')]);return db[_0x7fb0('0x1c')][_0x7fb0('0x30')](_0x5cb5c4)[_0x7fb0('0x16')](handleEntityNotFound(_0xd2e1e9,null))[_0x7fb0('0x16')](respondWithResult(_0xd2e1e9,null))[_0x7fb0('0x24')](handleError(_0xd2e1e9,null));};exports[_0x7fb0('0x31')]=function(_0x5924d1,_0x153bc0){return db['WhatsappInteraction']['create'](_0x5924d1[_0x7fb0('0x32')],{})[_0x7fb0('0x16')](respondWithResult(_0x153bc0,0xc9))[_0x7fb0('0x24')](handleError(_0x153bc0,null));};exports['update']=function(_0x34a12a,_0x46da6f){if(_0x34a12a[_0x7fb0('0x32')]['id']){delete _0x34a12a['body']['id'];}return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x34a12a[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x46da6f,null))['then'](saveUpdates(_0x34a12a[_0x7fb0('0x32')],null))[_0x7fb0('0x16')](respondWithResult(_0x46da6f,null))[_0x7fb0('0x24')](handleError(_0x46da6f,null));};exports[_0x7fb0('0x33')]=function(_0x5ae25c,_0x3d93cd){return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x5ae25c[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x3d93cd,null))[_0x7fb0('0x16')](removeEntity(_0x3d93cd,null))[_0x7fb0('0x24')](handleError(_0x3d93cd,null));};exports['describe']=function(_0x167fb3,_0x410817){return db['WhatsappInteraction']['describe']()[_0x7fb0('0x16')](respondWithResult(_0x410817,null))['catch'](handleError(_0x410817,null));};exports[_0x7fb0('0x34')]=function(_0x33836d,_0x5c0e96){return db[_0x7fb0('0x35')][_0x7fb0('0x30')]({'where':{'id':_0x33836d['params']['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x5c0e96,null))[_0x7fb0('0x16')](function(_0x1aef66){if(_0x1aef66){return _0x1aef66[_0x7fb0('0x34')](_0x33836d[_0x7fb0('0x32')][_0x7fb0('0x36')],_[_0x7fb0('0x37')](_0x33836d[_0x7fb0('0x32')],['ids','id'])||{});}})[_0x7fb0('0x16')](respondWithResult(_0x5c0e96,null))[_0x7fb0('0x24')](handleError(_0x5c0e96,null));};exports[_0x7fb0('0x38')]=function(_0x1e4507,_0x1d6068){var _0x3bcadf={'raw':![],'where':{}};var _0x575d48={};var _0x4c2653={'count':0x0,'rows':[]};return db[_0x7fb0('0x1c')][_0x7fb0('0x39')]({'where':{'id':_0x1e4507[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x1d6068,null))['then'](function(_0x504614){if(_0x504614){_0x575d48[_0x7fb0('0x26')]=_['keys'](db[_0x7fb0('0x35')]['rawAttributes']);_0x575d48['query']=_[_0x7fb0('0x27')](_0x1e4507[_0x7fb0('0x28')]);_0x575d48['filters']=_[_0x7fb0('0x2a')](_0x575d48[_0x7fb0('0x26')],_0x575d48['query']);_0x3bcadf[_0x7fb0('0x2b')]=_[_0x7fb0('0x2a')](_0x575d48['model'],qs[_0x7fb0('0x2c')](_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x2c')]));_0x3bcadf[_0x7fb0('0x2b')]=_0x3bcadf[_0x7fb0('0x2b')]['length']?_0x3bcadf['attributes']:_0x575d48[_0x7fb0('0x26')];if(!_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x3a')](_0x7fb0('0x3b'))){_0x3bcadf[_0x7fb0('0x11')]=qs[_0x7fb0('0x11')](_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x11')]);_0x3bcadf[_0x7fb0('0xf')]=qs['offset'](_0x1e4507['query'][_0x7fb0('0xf')]);}_0x3bcadf[_0x7fb0('0x3c')]=qs['sort'](_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x3d')]);_0x3bcadf['where']=qs['filters'](_[_0x7fb0('0x3e')](_0x1e4507[_0x7fb0('0x28')],_0x575d48['filters']));_0x3bcadf['where'][_0x7fb0('0x3f')]=_0x504614['id'];if(_0x1e4507['query']['filter']){_0x3bcadf['where']=_['merge'](_0x3bcadf['where'],{'$or':_[_0x7fb0('0x1b')](_0x3bcadf[_0x7fb0('0x2b')],function(_0x5ef552){var _0x2afc81={};_0x2afc81[_0x5ef552]={'$like':'%'+_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x40')]+'%'};return _0x2afc81;})});}if(_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x41')]){var _0x8db6b=_0x1e4507['query']['$gte']['split'](',');var _0x7c8aa6={};_0x7c8aa6[_0x8db6b[0x0]]={'$gte':moment(_0x8db6b[0x1])[_0x7fb0('0x42')](_0x7fb0('0x43'))};_0x3bcadf[_0x7fb0('0x44')]=_['merge'](_0x3bcadf['where'],_0x7c8aa6);}_0x3bcadf=_[_0x7fb0('0x2e')]({},_0x3bcadf,_0x1e4507['options']);return db[_0x7fb0('0x35')]['count']({'where':_0x3bcadf['where']})[_0x7fb0('0x16')](function(_0x224e6c){_0x4c2653[_0x7fb0('0x12')]=_0x224e6c;if(_0x1e4507[_0x7fb0('0x28')][_0x7fb0('0x2d')]){_0x3bcadf['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x7fb0('0x21')](_0x3bcadf);})['then'](function(_0x1a8d37){_0x4c2653[_0x7fb0('0x45')]=_0x1a8d37;return _0x4c2653;});}})[_0x7fb0('0x16')](respondWithFilteredResult(_0x1d6068,_0x3bcadf))[_0x7fb0('0x24')](handleError(_0x1d6068,null));};exports[_0x7fb0('0x46')]=function(_0x45d425,_0x4d5d27){return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x45d425[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x4d5d27,null))['then'](function(_0x548fae){if(_0x548fae){return _0x548fae[_0x7fb0('0x47')](_0x45d425[_0x7fb0('0x32')][_0x7fb0('0x36')],_[_0x7fb0('0x37')](_0x45d425[_0x7fb0('0x32')],[_0x7fb0('0x36'),'id'])||{})[_0x7fb0('0x48')](function(){return db[_0x7fb0('0x49')][_0x7fb0('0x21')]({'attributes':['id',_0x7fb0('0x19'),_0x7fb0('0x4a')],'where':{'id':_0x45d425[_0x7fb0('0x32')]['ids']}});})[_0x7fb0('0x16')](function(_0x2e3902){socket[_0x7fb0('0x4b')]('whatsappInteractionTags:save',{'id':Number(_0x45d425['params']['id']),'tags':_0x2e3902||[]});return{'id':Number(_0x45d425[_0x7fb0('0x25')]['id']),'tags':_0x2e3902||[]};});}})[_0x7fb0('0x16')](respondWithResult(_0x4d5d27,null))[_0x7fb0('0x24')](handleError(_0x4d5d27,null));};exports['removeTags']=function(_0x40bc97,_0x2ab34b){return db[_0x7fb0('0x1c')][_0x7fb0('0x30')]({'where':{'id':_0x40bc97[_0x7fb0('0x25')]['id']}})[_0x7fb0('0x16')](handleEntityNotFound(_0x2ab34b,null))[_0x7fb0('0x16')](function(_0x57ccf1){if(_0x57ccf1){return _0x57ccf1[_0x7fb0('0x4c')](_0x40bc97[_0x7fb0('0x28')][_0x7fb0('0x36')]);}})[_0x7fb0('0x16')](respondWithStatusCode(_0x2ab34b,null))['catch'](handleError(_0x2ab34b,null));};exports[_0x7fb0('0x4d')]=function(_0x530270,_0x635c41){var _0x164aad=moment()[_0x7fb0('0x4e')]()[_0x7fb0('0x4f')]();var _0xf6cee7=path[_0x7fb0('0x50')](config[_0x7fb0('0x51')],_0x7fb0('0x52'),_0x7fb0('0x53'),_0x7fb0('0x54'));var _0x38ab34=path['join'](config[_0x7fb0('0x51')],'server',_0x7fb0('0x53'),_0x7fb0('0x55'));var _0x597a48=path[_0x7fb0('0x50')](_0xf6cee7,_0x164aad);var _0x5bc104=util['format']('transcript-%d-%s.zip',_0x530270[_0x7fb0('0x25')]['id'],_0x164aad);var _0x1fc96c=path['join'](_0xf6cee7,_0x5bc104);var _0x1503f7=[];_0x1503f7['push']({'model':db['User'],'as':_0x7fb0('0x56'),'attributes':['id','fullname'],'raw':!![]});_0x1503f7[_0x7fb0('0x57')]({'model':db[_0x7fb0('0x58')],'as':_0x7fb0('0x59'),'attributes':['id',_0x7fb0('0x5a'),'lastName'],'raw':!![]});if(_0x530270[_0x7fb0('0x28')]['attachments']){_0x1503f7['push']({'model':db['Attachment'],'as':_0x7fb0('0x5b'),'raw':!![]});}var _0x244a84=[{'model':db[_0x7fb0('0x35')],'as':'Messages','attributes':['id',_0x7fb0('0x32'),'createdAt',_0x7fb0('0x5c'),_0x7fb0('0x5d'),'read'],'include':_0x1503f7}];_0x244a84[_0x7fb0('0x57')]({'model':db[_0x7fb0('0x5e')],'as':_0x7fb0('0x5f'),'attributes':['id','name']});_0x244a84[_0x7fb0('0x57')]({'model':db['User'],'as':_0x7fb0('0x60'),'attributes':['id',_0x7fb0('0x61')]});return db['WhatsappInteraction'][_0x7fb0('0x30')]({'where':{'id':_0x530270['params']['id']},'include':_0x244a84})[_0x7fb0('0x16')](handleEntityNotFound(_0x635c41,null))[_0x7fb0('0x16')](function(_0x2d29a9){if(_0x2d29a9){var _0x2b0049=_0x2d29a9[_0x7fb0('0x62')]({'plain':!![]});fs[_0x7fb0('0x63')](_0x597a48);var _0x1aebf4={'channel':_0x7fb0('0x64'),'account':_0x2b0049[_0x7fb0('0x5f')][_0x7fb0('0x19')],'agent':_0x2b0049[_0x7fb0('0x60')]?_0x2b0049[_0x7fb0('0x60')][_0x7fb0('0x61')]:_0x7fb0('0x65'),'createdAt':moment(_0x2b0049[_0x7fb0('0x66')])['format'](_0x7fb0('0x43'))[_0x7fb0('0x4f')](),'closedAt':_0x2b0049[_0x7fb0('0x67')]?moment(_0x2b0049[_0x7fb0('0x68')])[_0x7fb0('0x42')](_0x7fb0('0x43'))[_0x7fb0('0x4f')]():'','disposition':_0x2b0049['disposition'],'messages':_(_0x2b0049[_0x7fb0('0x69')])[_0x7fb0('0x40')]({'secret':![]})[_0x7fb0('0x1b')](function(_0x296d01){if(_0x296d01[_0x7fb0('0x5b')]){var _0x357651=path[_0x7fb0('0x50')](_0x38ab34,_0x296d01[_0x7fb0('0x5b')][_0x7fb0('0x6a')]);if(fs[_0x7fb0('0x6b')](_0x357651)){fs[_0x7fb0('0x6c')](_0x357651)[_0x7fb0('0x6d')](fs[_0x7fb0('0x6e')](path[_0x7fb0('0x50')](_0x597a48,_0x296d01[_0x7fb0('0x5b')][_0x7fb0('0x6a')])));}}return{'date':moment(_0x296d01[_0x7fb0('0x66')])['format'](_0x7fb0('0x43'))[_0x7fb0('0x4f')](),'sender':_0x296d01[_0x7fb0('0x5c')]===_0x7fb0('0x6f')?_0x296d01[_0x7fb0('0x56')]?_0x296d01[_0x7fb0('0x56')]['fullname']:_0x7fb0('0x70'):_0x296d01[_0x7fb0('0x59')]['firstName']+(_0x296d01[_0x7fb0('0x59')][_0x7fb0('0x71')]?'\x20'+_0x296d01[_0x7fb0('0x59')][_0x7fb0('0x71')]:''),'body':_0x296d01[_0x7fb0('0x5b')]?_0x296d01[_0x7fb0('0x5b')][_0x7fb0('0x6a')]:_0x296d01[_0x7fb0('0x32')],'direction':_0x296d01[_0x7fb0('0x5c')]===_0x7fb0('0x6f')?'A':'C','secret':_0x296d01['secret'],'read':_0x296d01[_0x7fb0('0x72')],'attachment':_0x296d01['Attachment']};})[_0x7fb0('0x73')]()};return ejs['renderFile'](path[_0x7fb0('0x50')](config[_0x7fb0('0x51')],_0x7fb0('0x52'),_0x7fb0('0x74'),'downloadInteraction.ejs'),{'interaction':_0x1aebf4})[_0x7fb0('0x16')](function(_0x4d7020){var _0x1bd3ff=path[_0x7fb0('0x50')](_0x597a48,_0x7fb0('0x75')+_0x2b0049['id']+'-'+_0x164aad+_0x7fb0('0x76'));var _0x34e474={'path':_0x1bd3ff,'channel':_0x7fb0('0x64'),'interactionId':_0x2b0049['id']};return pdf['createPdfFromHTML'](_0x4d7020,_0x34e474);})['then'](function(){return new BPromise(function(_0x3178f7,_0x4865cc){zipdir(_0x597a48,{'saveTo':_0x1fc96c},function(_0x400146,_0x12c86e){if(_0x400146)return _0x4865cc(_0x400146);return _0x3178f7(_0x12c86e);});})[_0x7fb0('0x16')](function(){return new BPromise(function(_0x35cfea,_0x439686){rimraf(_0x597a48,function(_0x67ed61){if(_0x67ed61)_0x439686(_0x67ed61);return _0x35cfea();});});})[_0x7fb0('0x16')](function(){return _0x635c41[_0x7fb0('0x4d')](_0x1fc96c,_0x5bc104,function(_0x192d8f){if(_0x192d8f){console['log'](_0x7fb0('0x77'),_0x192d8f);}else{fs[_0x7fb0('0x78')](_0x1fc96c);}});});});}else{return _0x635c41[_0x7fb0('0xc')](0xc8);}})[_0x7fb0('0x24')](handleError(_0x635c41,null));}; \ No newline at end of file +var _0xc022=['error','send','map','rawAttributes','type','key','getOptions','findAll','whatsapp','query','user','catch','params','model','WhatsappInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','destroy','describe','WhatsappMessage','addMessage','ids','getMessages','limit','order','sort','where','pick','filter','merge','$gte','split','rows','addTags','Tag','name','color','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','push','User','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','pipe','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','register','status','end','offset','undefined','count','Content-Range','json','update','then','sendStatus'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xc022,0xd1));var _0x2c02=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xc022[_0x541ea6];return _0x3c3e84;};'use strict';var rimraf=require(_0x2c02('0x0'));var zipdir=require(_0x2c02('0x1'));var moment=require('moment');var BPromise=require(_0x2c02('0x2'));var util=require(_0x2c02('0x3'));var path=require(_0x2c02('0x4'));var ejs=require(_0x2c02('0x5'));var fs=require('fs');var _=require(_0x2c02('0x6'));var Redis=require(_0x2c02('0x7'));var interaction=require(_0x2c02('0x8'));var qs=require(_0x2c02('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x2c02('0xa'))(_0x2c02('0xb'));var config=require(_0x2c02('0xc'));var db=require('../../mysqldb')['db'];config[_0x2c02('0xd')]=_['defaults'](config[_0x2c02('0xd')],{'host':_0x2c02('0xe'),'port':0x18eb});var socket=require(_0x2c02('0xf'))(new Redis(config[_0x2c02('0xd')]));require('./whatsappInteraction.socket')[_0x2c02('0x10')](socket);function respondWithStatusCode(_0x4aa48c,_0x1028eb){_0x1028eb=_0x1028eb||0xcc;return function(_0x1e8be0){if(_0x1e8be0){return _0x4aa48c['sendStatus'](_0x1028eb);}return _0x4aa48c[_0x2c02('0x11')](_0x1028eb)[_0x2c02('0x12')]();};}function respondWithResult(_0x4728c8,_0x1eeb8a){_0x1eeb8a=_0x1eeb8a||0xc8;return function(_0x29686a){if(_0x29686a){return _0x4728c8[_0x2c02('0x11')](_0x1eeb8a)['json'](_0x29686a);}};}function respondWithFilteredResult(_0x3f88d5,_0x4674d7){return function(_0x4fbe4a){if(_0x4fbe4a){var _0x163498=typeof _0x4674d7[_0x2c02('0x13')]===_0x2c02('0x14')&&typeof _0x4674d7['limit']==='undefined';var _0xfdcf4=_0x4fbe4a[_0x2c02('0x15')];var _0x8d5eb2=_0x163498?0x0:_0x4674d7[_0x2c02('0x13')];var _0x163979=_0x163498?_0x4fbe4a[_0x2c02('0x15')]:_0x4674d7[_0x2c02('0x13')]+_0x4674d7['limit'];var _0x3b228f;if(_0x163979>=_0xfdcf4){_0x163979=_0xfdcf4;_0x3b228f=0xc8;}else{_0x3b228f=0xce;}_0x3f88d5['status'](_0x3b228f);return _0x3f88d5['set'](_0x2c02('0x16'),_0x8d5eb2+'-'+_0x163979+'/'+_0xfdcf4)[_0x2c02('0x17')](_0x4fbe4a);}return null;};}function saveUpdates(_0x64e4ae){return function(_0x5cd5f5){if(_0x5cd5f5){return _0x5cd5f5[_0x2c02('0x18')](_0x64e4ae)[_0x2c02('0x19')](function(_0x3bd59e){return _0x3bd59e;});}return null;};}function removeEntity(_0x5a8763){return function(_0x156135){if(_0x156135){return _0x156135['destroy']()['then'](function(){_0x5a8763['status'](0xcc)[_0x2c02('0x12')]();});}};}function handleEntityNotFound(_0x5efcbf){return function(_0x5d77dd){if(!_0x5d77dd){_0x5efcbf[_0x2c02('0x1a')](0x194);}return _0x5d77dd;};}function handleError(_0x418eba,_0x125f0d){_0x125f0d=_0x125f0d||0x1f4;return function(_0x25264e){logger[_0x2c02('0x1b')](_0x25264e['stack']);if(_0x25264e['name']){delete _0x25264e['name'];}_0x418eba['status'](_0x125f0d)[_0x2c02('0x1c')](_0x25264e);};}exports['index']=function(_0x1fb602,_0x1fe3d9){var _0x494860={};var _0x962857=_[_0x2c02('0x1d')](db['WhatsappInteraction'][_0x2c02('0x1e')],function(_0xe8d99e){return{'name':_0xe8d99e['fieldName'],'type':_0xe8d99e[_0x2c02('0x1f')][_0x2c02('0x20')]};});_0x494860=qs[_0x2c02('0x21')](_0x962857,_0x1fb602);return interaction[_0x2c02('0x22')](_0x2c02('0x23'),_0x1fb602[_0x2c02('0x24')],_0x1fb602[_0x2c02('0x25')],_0x494860,_0x962857)[_0x2c02('0x19')](respondWithFilteredResult(_0x1fe3d9,_0x494860))[_0x2c02('0x26')](handleError(_0x1fe3d9,null));};exports['show']=function(_0x4b9d9e,_0x2f0026){var _0x5e3c24={'raw':![],'where':{'id':_0x4b9d9e[_0x2c02('0x27')]['id']}},_0xd3771d={};_0xd3771d[_0x2c02('0x28')]=_['keys'](db[_0x2c02('0x29')][_0x2c02('0x1e')]);_0xd3771d[_0x2c02('0x24')]=_[_0x2c02('0x2a')](_0x4b9d9e[_0x2c02('0x24')]);_0xd3771d[_0x2c02('0x2b')]=_[_0x2c02('0x2c')](_0xd3771d[_0x2c02('0x28')],_0xd3771d[_0x2c02('0x24')]);_0x5e3c24[_0x2c02('0x2d')]=_[_0x2c02('0x2c')](_0xd3771d[_0x2c02('0x28')],qs[_0x2c02('0x2e')](_0x4b9d9e[_0x2c02('0x24')]['fields']));_0x5e3c24[_0x2c02('0x2d')]=_0x5e3c24[_0x2c02('0x2d')][_0x2c02('0x2f')]?_0x5e3c24[_0x2c02('0x2d')]:_0xd3771d['model'];if(_0x4b9d9e['query'][_0x2c02('0x30')]){_0x5e3c24[_0x2c02('0x31')]=[{'all':!![]}];}_0x5e3c24=_['merge']({},_0x5e3c24,_0x4b9d9e[_0x2c02('0x32')]);return db[_0x2c02('0x29')][_0x2c02('0x33')](_0x5e3c24)[_0x2c02('0x19')](handleEntityNotFound(_0x2f0026,null))[_0x2c02('0x19')](respondWithResult(_0x2f0026,null))[_0x2c02('0x26')](handleError(_0x2f0026,null));};exports[_0x2c02('0x34')]=function(_0x4cdd16,_0x3dca72){return db['WhatsappInteraction']['create'](_0x4cdd16[_0x2c02('0x35')],{})[_0x2c02('0x19')](respondWithResult(_0x3dca72,0xc9))[_0x2c02('0x26')](handleError(_0x3dca72,null));};exports[_0x2c02('0x18')]=function(_0x10f6be,_0x49ff87){if(_0x10f6be['body']['id']){delete _0x10f6be[_0x2c02('0x35')]['id'];}return db[_0x2c02('0x29')][_0x2c02('0x33')]({'where':{'id':_0x10f6be[_0x2c02('0x27')]['id']}})[_0x2c02('0x19')](handleEntityNotFound(_0x49ff87,null))['then'](saveUpdates(_0x10f6be[_0x2c02('0x35')],null))[_0x2c02('0x19')](respondWithResult(_0x49ff87,null))['catch'](handleError(_0x49ff87,null));};exports[_0x2c02('0x36')]=function(_0x144213,_0x149748){return db['WhatsappInteraction'][_0x2c02('0x33')]({'where':{'id':_0x144213[_0x2c02('0x27')]['id']}})[_0x2c02('0x19')](handleEntityNotFound(_0x149748,null))['then'](removeEntity(_0x149748,null))['catch'](handleError(_0x149748,null));};exports['describe']=function(_0x76c606,_0x27629e){return db[_0x2c02('0x29')][_0x2c02('0x37')]()[_0x2c02('0x19')](respondWithResult(_0x27629e,null))[_0x2c02('0x26')](handleError(_0x27629e,null));};exports['addMessage']=function(_0x3373b8,_0x9d2af6){return db[_0x2c02('0x38')][_0x2c02('0x33')]({'where':{'id':_0x3373b8[_0x2c02('0x27')]['id']}})[_0x2c02('0x19')](handleEntityNotFound(_0x9d2af6,null))['then'](function(_0x37f96f){if(_0x37f96f){return _0x37f96f[_0x2c02('0x39')](_0x3373b8['body'][_0x2c02('0x3a')],_['omit'](_0x3373b8[_0x2c02('0x35')],[_0x2c02('0x3a'),'id'])||{});}})[_0x2c02('0x19')](respondWithResult(_0x9d2af6,null))[_0x2c02('0x26')](handleError(_0x9d2af6,null));};exports[_0x2c02('0x3b')]=function(_0x4330fc,_0x5ba157){var _0x25c4b0={'raw':![],'where':{}};var _0x35b1f3={};var _0x1e0102={'count':0x0,'rows':[]};return db[_0x2c02('0x29')]['findOne']({'where':{'id':_0x4330fc[_0x2c02('0x27')]['id']}})[_0x2c02('0x19')](handleEntityNotFound(_0x5ba157,null))[_0x2c02('0x19')](function(_0x5608b4){if(_0x5608b4){_0x35b1f3[_0x2c02('0x28')]=_[_0x2c02('0x2a')](db[_0x2c02('0x38')][_0x2c02('0x1e')]);_0x35b1f3[_0x2c02('0x24')]=_[_0x2c02('0x2a')](_0x4330fc[_0x2c02('0x24')]);_0x35b1f3[_0x2c02('0x2b')]=_[_0x2c02('0x2c')](_0x35b1f3[_0x2c02('0x28')],_0x35b1f3[_0x2c02('0x24')]);_0x25c4b0[_0x2c02('0x2d')]=_[_0x2c02('0x2c')](_0x35b1f3[_0x2c02('0x28')],qs['fields'](_0x4330fc[_0x2c02('0x24')][_0x2c02('0x2e')]));_0x25c4b0[_0x2c02('0x2d')]=_0x25c4b0['attributes'][_0x2c02('0x2f')]?_0x25c4b0[_0x2c02('0x2d')]:_0x35b1f3[_0x2c02('0x28')];if(!_0x4330fc['query']['hasOwnProperty']('nolimit')){_0x25c4b0[_0x2c02('0x3c')]=qs[_0x2c02('0x3c')](_0x4330fc['query'][_0x2c02('0x3c')]);_0x25c4b0[_0x2c02('0x13')]=qs[_0x2c02('0x13')](_0x4330fc[_0x2c02('0x24')][_0x2c02('0x13')]);}_0x25c4b0[_0x2c02('0x3d')]=qs[_0x2c02('0x3e')](_0x4330fc[_0x2c02('0x24')]['sort']);_0x25c4b0[_0x2c02('0x3f')]=qs[_0x2c02('0x2b')](_[_0x2c02('0x40')](_0x4330fc[_0x2c02('0x24')],_0x35b1f3[_0x2c02('0x2b')]));_0x25c4b0[_0x2c02('0x3f')]['WhatsappInteractionId']=_0x5608b4['id'];if(_0x4330fc[_0x2c02('0x24')][_0x2c02('0x41')]){_0x25c4b0[_0x2c02('0x3f')]=_[_0x2c02('0x42')](_0x25c4b0[_0x2c02('0x3f')],{'$or':_[_0x2c02('0x1d')](_0x25c4b0[_0x2c02('0x2d')],function(_0x4a4a02){var _0xf0cfe={};_0xf0cfe[_0x4a4a02]={'$like':'%'+_0x4330fc['query'][_0x2c02('0x41')]+'%'};return _0xf0cfe;})});}if(_0x4330fc[_0x2c02('0x24')]['$gte']){var _0x5b953e=_0x4330fc['query'][_0x2c02('0x43')][_0x2c02('0x44')](',');var _0x46678d={};_0x46678d[_0x5b953e[0x0]]={'$gte':moment(_0x5b953e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x25c4b0[_0x2c02('0x3f')]=_['merge'](_0x25c4b0[_0x2c02('0x3f')],_0x46678d);}_0x25c4b0=_[_0x2c02('0x42')]({},_0x25c4b0,_0x4330fc[_0x2c02('0x32')]);return db[_0x2c02('0x38')][_0x2c02('0x15')]({'where':_0x25c4b0[_0x2c02('0x3f')]})[_0x2c02('0x19')](function(_0x2f9b70){_0x1e0102[_0x2c02('0x15')]=_0x2f9b70;if(_0x4330fc['query']['includeAll']){_0x25c4b0[_0x2c02('0x31')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x25c4b0);})[_0x2c02('0x19')](function(_0x524ece){_0x1e0102[_0x2c02('0x45')]=_0x524ece;return _0x1e0102;});}})[_0x2c02('0x19')](respondWithFilteredResult(_0x5ba157,_0x25c4b0))['catch'](handleError(_0x5ba157,null));};exports[_0x2c02('0x46')]=function(_0x46ff1a,_0x42dc6d){return db[_0x2c02('0x29')][_0x2c02('0x33')]({'where':{'id':_0x46ff1a[_0x2c02('0x27')]['id']}})['then'](handleEntityNotFound(_0x42dc6d,null))['then'](function(_0x5b911e){if(_0x5b911e){return _0x5b911e['setTags'](_0x46ff1a[_0x2c02('0x35')]['ids'],_['omit'](_0x46ff1a[_0x2c02('0x35')],[_0x2c02('0x3a'),'id'])||{})['spread'](function(){return db[_0x2c02('0x47')][_0x2c02('0x22')]({'attributes':['id',_0x2c02('0x48'),_0x2c02('0x49')],'where':{'id':_0x46ff1a[_0x2c02('0x35')][_0x2c02('0x3a')]}});})[_0x2c02('0x19')](function(_0x2e357a){socket['emit'](_0x2c02('0x4a'),{'id':Number(_0x46ff1a[_0x2c02('0x27')]['id']),'tags':_0x2e357a||[]});return{'id':Number(_0x46ff1a[_0x2c02('0x27')]['id']),'tags':_0x2e357a||[]};});}})['then'](respondWithResult(_0x42dc6d,null))[_0x2c02('0x26')](handleError(_0x42dc6d,null));};exports[_0x2c02('0x4b')]=function(_0x5b409b,_0x2fe4ed){return db['WhatsappInteraction'][_0x2c02('0x33')]({'where':{'id':_0x5b409b['params']['id']}})[_0x2c02('0x19')](handleEntityNotFound(_0x2fe4ed,null))[_0x2c02('0x19')](function(_0x5629e5){if(_0x5629e5){return _0x5629e5[_0x2c02('0x4b')](_0x5b409b['query']['ids']);}})[_0x2c02('0x19')](respondWithStatusCode(_0x2fe4ed,null))[_0x2c02('0x26')](handleError(_0x2fe4ed,null));};exports[_0x2c02('0x4c')]=function(_0x5a1019,_0x2f8889){var _0x49db80=moment()[_0x2c02('0x4d')]()[_0x2c02('0x4e')]();var _0x47d94a=path[_0x2c02('0x4f')](config[_0x2c02('0x50')],'server','files',_0x2c02('0x51'));var _0x21cf80=path[_0x2c02('0x4f')](config['root'],'server','files','attachments');var _0x5a4c9a=path[_0x2c02('0x4f')](_0x47d94a,_0x49db80);var _0x33365b=util['format']('transcript-%d-%s.zip',_0x5a1019['params']['id'],_0x49db80);var _0x2ea77a=path[_0x2c02('0x4f')](_0x47d94a,_0x33365b);var _0x1b037d=[];_0x1b037d[_0x2c02('0x52')]({'model':db['User'],'as':_0x2c02('0x53'),'attributes':['id',_0x2c02('0x54')],'raw':!![]});_0x1b037d[_0x2c02('0x52')]({'model':db[_0x2c02('0x55')],'as':_0x2c02('0x56'),'attributes':['id',_0x2c02('0x57'),_0x2c02('0x58')],'raw':!![]});if(_0x5a1019[_0x2c02('0x24')][_0x2c02('0x59')]){_0x1b037d[_0x2c02('0x52')]({'model':db[_0x2c02('0x5a')],'as':_0x2c02('0x5a'),'raw':!![]});}var _0x5b3850=[{'model':db[_0x2c02('0x38')],'as':_0x2c02('0x5b'),'attributes':['id',_0x2c02('0x35'),_0x2c02('0x5c'),_0x2c02('0x5d'),'secret',_0x2c02('0x5e')],'include':_0x1b037d}];_0x5b3850[_0x2c02('0x52')]({'model':db[_0x2c02('0x5f')],'as':_0x2c02('0x60'),'attributes':['id',_0x2c02('0x48')]});_0x5b3850[_0x2c02('0x52')]({'model':db[_0x2c02('0x53')],'as':_0x2c02('0x61'),'attributes':['id',_0x2c02('0x54')]});return db['WhatsappInteraction'][_0x2c02('0x33')]({'where':{'id':_0x5a1019[_0x2c02('0x27')]['id']},'include':_0x5b3850})['then'](handleEntityNotFound(_0x2f8889,null))[_0x2c02('0x19')](function(_0xfe0c6f){if(_0xfe0c6f){var _0x3acf3e=_0xfe0c6f[_0x2c02('0x62')]({'plain':!![]});fs['mkdirSync'](_0x5a4c9a);var _0x383ded={'channel':_0x2c02('0x63'),'account':_0x3acf3e[_0x2c02('0x60')][_0x2c02('0x48')],'agent':_0x3acf3e[_0x2c02('0x61')]?_0x3acf3e[_0x2c02('0x61')][_0x2c02('0x54')]:_0x2c02('0x64'),'createdAt':moment(_0x3acf3e[_0x2c02('0x5c')])[_0x2c02('0x65')](_0x2c02('0x66'))['toString'](),'closedAt':_0x3acf3e[_0x2c02('0x67')]?moment(_0x3acf3e[_0x2c02('0x68')])[_0x2c02('0x65')](_0x2c02('0x66'))[_0x2c02('0x4e')]():'','disposition':_0x3acf3e[_0x2c02('0x69')],'messages':_(_0x3acf3e['Messages'])[_0x2c02('0x41')]({'secret':![]})[_0x2c02('0x1d')](function(_0x535320){if(_0x535320['Attachment']){var _0x34b383=path['join'](_0x21cf80,_0x535320['Attachment'][_0x2c02('0x6a')]);if(fs[_0x2c02('0x6b')](_0x34b383)){fs['createReadStream'](_0x34b383)[_0x2c02('0x6c')](fs['createWriteStream'](path['join'](_0x5a4c9a,_0x535320['Attachment']['basename'])));}}return{'date':moment(_0x535320[_0x2c02('0x5c')])[_0x2c02('0x65')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2c02('0x4e')](),'sender':_0x535320[_0x2c02('0x5d')]===_0x2c02('0x6d')?_0x535320[_0x2c02('0x53')]?_0x535320['User'][_0x2c02('0x54')]:_0x2c02('0x6e'):_0x535320[_0x2c02('0x56')][_0x2c02('0x57')]+(_0x535320[_0x2c02('0x56')][_0x2c02('0x58')]?'\x20'+_0x535320[_0x2c02('0x56')]['lastName']:''),'body':_0x535320['Attachment']?_0x535320[_0x2c02('0x5a')]['basename']:_0x535320[_0x2c02('0x35')],'direction':_0x535320['direction']===_0x2c02('0x6d')?'A':'C','secret':_0x535320['secret'],'read':_0x535320[_0x2c02('0x5e')],'attachment':_0x535320[_0x2c02('0x5a')]};})['value']()};return ejs[_0x2c02('0x6f')](path['join'](config[_0x2c02('0x50')],'server','views',_0x2c02('0x70')),{'interaction':_0x383ded})[_0x2c02('0x19')](function(_0x150655){var _0x18a685=path['join'](_0x5a4c9a,_0x2c02('0x71')+_0x3acf3e['id']+'-'+_0x49db80+_0x2c02('0x72'));var _0x5ebaf8={'path':_0x18a685,'channel':_0x2c02('0x63'),'interactionId':_0x3acf3e['id']};return pdf[_0x2c02('0x73')](_0x150655,_0x5ebaf8);})[_0x2c02('0x19')](function(){return new BPromise(function(_0x5da53d,_0x2dda17){zipdir(_0x5a4c9a,{'saveTo':_0x2ea77a},function(_0x36a97b,_0x50a1cc){if(_0x36a97b)return _0x2dda17(_0x36a97b);return _0x5da53d(_0x50a1cc);});})[_0x2c02('0x19')](function(){return new BPromise(function(_0x59f5db,_0x200711){rimraf(_0x5a4c9a,function(_0x5c68ac){if(_0x5c68ac)_0x200711(_0x5c68ac);return _0x59f5db();});});})[_0x2c02('0x19')](function(){return _0x2f8889[_0x2c02('0x4c')](_0x2ea77a,_0x33365b,function(_0x15ff76){if(_0x15ff76){console[_0x2c02('0x74')](_0x2c02('0x75'),_0x15ff76);}else{fs['unlinkSync'](_0x2ea77a);}});});});}else{return _0x2f8889['sendStatus'](0xc8);}})[_0x2c02('0x26')](handleError(_0x2f8889,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index df7de54..128f6b5 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9c3=['../../mysqldb','WhatsappInteraction','save','update','getUsers','then','map','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x2f1292,_0x222741){var _0x3e65fc=function(_0x46b2dd){while(--_0x46b2dd){_0x2f1292['push'](_0x2f1292['shift']());}};_0x3e65fc(++_0x222741);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x4036be,_0x18edc0){_0x4036be=_0x4036be-0x0;var _0xe98986=_0xc9c3[_0x4036be];return _0xe98986;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x3c9c('0x0'))['db'][_0x3c9c('0x1')];var WhatsappMessage=require(_0x3c9c('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c9c('0x2'),'afterUpdate':_0x3c9c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x161be6){return function(_0x40e81a,_0x321f55,_0xfb5046){_0x40e81a[_0x3c9c('0x4')]({'attributes':['id'],'raw':!![]})[_0x3c9c('0x5')](function(_0x353324){_0x40e81a['setDataValue']('Users',_0x353324[_0x3c9c('0x6')](function(_0x3d10bc){return{'id':_0x3d10bc['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x40e81a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c9c('0x5')](function(_0x417fdc){_0x40e81a[_0x3c9c('0x7')](_0x3c9c('0x8'),_0x417fdc['length']);WhatsappInteractionEvents['emit'](_0x161be6+':'+_0x40e81a['id'],_0x40e81a);WhatsappInteractionEvents[_0x3c9c('0x9')](_0x161be6,_0x40e81a);_0xfb5046(null);})[_0x3c9c('0xa')](_0xfb5046(null));};}for(var e in events){if(events[_0x3c9c('0xb')](e)){var event=events[e];WhatsappInteraction[_0x3c9c('0xc')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xf2fa=['emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xaf2f('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xaf2f('0x1'))['db'][_0xaf2f('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaf2f('0x3')](0x0);var events={'afterCreate':_0xaf2f('0x4'),'afterUpdate':_0xaf2f('0x5'),'afterDestroy':_0xaf2f('0x6')};function emitEvent(_0x96c9f7){return function(_0x4e2440,_0x48b333,_0x3709f9){_0x4e2440['getUsers']({'attributes':['id'],'raw':!![]})[_0xaf2f('0x7')](function(_0x2dfba7){_0x4e2440[_0xaf2f('0x8')](_0xaf2f('0x9'),_0x2dfba7[_0xaf2f('0xa')](function(_0x5e8ad0){return{'id':_0x5e8ad0['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4e2440['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xfd9db5){_0x4e2440[_0xaf2f('0x8')](_0xaf2f('0xb'),_0xfd9db5[_0xaf2f('0xc')]);WhatsappInteractionEvents[_0xaf2f('0xd')](_0x96c9f7+':'+_0x4e2440['id'],_0x4e2440);WhatsappInteractionEvents[_0xaf2f('0xd')](_0x96c9f7,_0x4e2440);_0x3709f9(null);})[_0xaf2f('0xe')](_0x3709f9(null));};}for(var e in events){if(events[_0xaf2f('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xaf2f('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7fa2926..378b2e7 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb8=['whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction'];(function(_0x4a7b06,_0x3a24c5){var _0x5cdc8d=function(_0x29d8a5){while(--_0x29d8a5){_0x4a7b06['push'](_0x4a7b06['shift']());}};_0x5cdc8d(++_0x3a24c5);}(_0xbdb8,0xf0));var _0x8bdb=function(_0x5124d2,_0x3400cb){_0x5124d2=_0x5124d2-0x0;var _0x361478=_0xbdb8[_0x5124d2];return _0x361478;};'use strict';var _=require('lodash');var util=require(_0x8bdb('0x0'));var logger=require(_0x8bdb('0x1'))('api');var moment=require(_0x8bdb('0x2'));var BPromise=require(_0x8bdb('0x3'));var rp=require(_0x8bdb('0x4'));var fs=require('fs');var path=require(_0x8bdb('0x5'));var rimraf=require(_0x8bdb('0x6'));var config=require(_0x8bdb('0x7'));var attributes=require(_0x8bdb('0x8'));module[_0x8bdb('0x9')]=function(_0x465ec3,_0x63895e){return _0x465ec3[_0x8bdb('0xa')](_0x8bdb('0xb'),attributes,{'tableName':_0x8bdb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e8906,_0x3bf5ea,_0x2426a3){if(_0x2e8906[_0x8bdb('0xd')](_0x8bdb('0xe'))){_0x2e8906[_0x8bdb('0xf')]=moment()[_0x8bdb('0x10')](_0x8bdb('0x11'));}_0x2426a3(null,_0x2e8906);}}});}; \ No newline at end of file +var _0x5f1f=['./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x52ba3d,_0x3ce09c){var _0x968ee9=function(_0x40f53b){while(--_0x40f53b){_0x52ba3d['push'](_0x52ba3d['shift']());}};_0x968ee9(++_0x3ce09c);}(_0x5f1f,0x129));var _0xf5f1=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x5f1f[_0x1a0600];return _0x734670;};'use strict';var _=require(_0xf5f1('0x0'));var util=require(_0xf5f1('0x1'));var logger=require(_0xf5f1('0x2'))(_0xf5f1('0x3'));var moment=require(_0xf5f1('0x4'));var BPromise=require('bluebird');var rp=require(_0xf5f1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf5f1('0x6'));var attributes=require(_0xf5f1('0x7'));module[_0xf5f1('0x8')]=function(_0xa0bca4,_0x358d7f){return _0xa0bca4['define'](_0xf5f1('0x9'),attributes,{'tableName':_0xf5f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc5b7,_0x1df8e9,_0x5c4845){if(_0xc5b7[_0xf5f1('0xb')](_0xf5f1('0xc'))){_0xc5b7[_0xf5f1('0xd')]=moment()[_0xf5f1('0xe')](_0xf5f1('0xf'));}_0x5c4845(null,_0xc5b7);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index f705430..d640c28 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ad0=['request\x20sent','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','attributes','limit','debug','AddTagsToWhatsappInteraction','where','addTags','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','redis','defaults','localhost','socket.io-emitter','then','info','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4b3b40,_0x25836e){var _0x230259=function(_0x1ec204){while(--_0x1ec204){_0x4b3b40['push'](_0x4b3b40['shift']());}};_0x230259(++_0x25836e);}(_0x3ad0,0x103));var _0x03ad=function(_0x370dd8,_0x4ae757){_0x370dd8=_0x370dd8-0x0;var _0xd8de6=_0x3ad0[_0x370dd8];return _0xd8de6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x03ad('0x0'));var rs=require(_0x03ad('0x1'));var fs=require('fs');var Redis=require(_0x03ad('0x2'));var db=require(_0x03ad('0x3'))['db'];var utils=require(_0x03ad('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x03ad('0x5')]({'port':0x232a});config[_0x03ad('0x6')]=_[_0x03ad('0x7')](config[_0x03ad('0x6')],{'host':_0x03ad('0x8'),'port':0x18eb});var socket=require(_0x03ad('0x9'))(new Redis(config[_0x03ad('0x6')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x66ffe9,_0x189c14,_0x3cfbb2){return new BPromise(function(_0x5dd864,_0x2a7f32){return client['request'](_0x66ffe9,_0x3cfbb2)[_0x03ad('0xa')](function(_0x18f506){logger[_0x03ad('0xb')]('WhatsappInteraction,\x20%s,\x20%s',_0x189c14,'request\x20sent');logger['debug'](_0x03ad('0xc'),_0x189c14,_0x03ad('0xd'),JSON[_0x03ad('0xe')](_0x18f506));if(_0x18f506[_0x03ad('0xf')]){if(_0x18f506[_0x03ad('0xf')]['code']===0x1f4){logger[_0x03ad('0xf')](_0x03ad('0x10'),_0x189c14,_0x18f506['error'][_0x03ad('0x11')]);return _0x2a7f32(_0x18f506['error'][_0x03ad('0x11')]);}logger[_0x03ad('0xf')](_0x03ad('0x10'),_0x189c14,_0x18f506[_0x03ad('0xf')][_0x03ad('0x11')]);return _0x5dd864(_0x18f506[_0x03ad('0xf')]['message']);}else{logger[_0x03ad('0xb')]('WhatsappInteraction,\x20%s,\x20%s',_0x189c14,'request\x20sent');_0x5dd864(_0x18f506[_0x03ad('0x12')]['message']);}})[_0x03ad('0x13')](function(_0x478a7e){logger[_0x03ad('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x189c14,_0x478a7e);_0x2a7f32(_0x478a7e);});});}exports[_0x03ad('0x14')]=function(_0x3ea197){var _0x4ad5e5=this;return new Promise(function(_0xaaf441,_0xc2f185){return db[_0x03ad('0x15')]['update'](_0x3ea197[_0x03ad('0x16')],{'raw':_0x3ea197[_0x03ad('0x17')]?_0x3ea197['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ea197[_0x03ad('0x17')]?_0x3ea197['options']['where']||null:null,'attributes':_0x3ea197[_0x03ad('0x17')]?_0x3ea197[_0x03ad('0x17')][_0x03ad('0x18')]||null:null,'limit':_0x3ea197[_0x03ad('0x17')]?_0x3ea197['options'][_0x03ad('0x19')]||null:null})[_0x03ad('0xa')](function(_0x1842db){logger[_0x03ad('0xb')](_0x03ad('0x14'),_0x3ea197);logger[_0x03ad('0x1a')](_0x03ad('0x14'),_0x3ea197,JSON[_0x03ad('0xe')](_0x1842db));_0xaaf441(_0x1842db);})['catch'](function(_0x282082){logger[_0x03ad('0xf')](_0x03ad('0x14'),_0x282082[_0x03ad('0x11')],_0x3ea197);_0xc2f185(_0x4ad5e5[_0x03ad('0xf')](0x1f4,_0x282082[_0x03ad('0x11')]));});});};exports[_0x03ad('0x1b')]=function(_0x59e1b9){return new Promise(function(_0x371488,_0x2f419f){return db['WhatsappInteraction']['find']({'where':_0x59e1b9['options']?_0x59e1b9[_0x03ad('0x17')][_0x03ad('0x1c')]||null:null})[_0x03ad('0xa')](function(_0x2d4cff){if(_0x2d4cff){return _0x2d4cff[_0x03ad('0x1d')](_0x59e1b9['body'][_0x03ad('0x1e')],_[_0x03ad('0x1f')](_0x59e1b9['body'],['ids','id'])||{});}})[_0x03ad('0x20')](function(_0x49ac51){logger[_0x03ad('0xb')]('AddTags',_0x59e1b9);logger[_0x03ad('0x1a')](_0x03ad('0x21'),_0x59e1b9,JSON[_0x03ad('0xe')](_0x49ac51));_0x371488(_0x49ac51);})['catch'](function(_0x2d73e4){logger[_0x03ad('0xf')](_0x03ad('0x21'),_0x2d73e4[_0x03ad('0x11')],_0x59e1b9);_0x2f419f(_this[_0x03ad('0xf')](0x1f4,_0x2d73e4[_0x03ad('0x11')]));});});}; \ No newline at end of file +var _0xef2c=['WhatsappInteraction','update','body','options','where','attributes','limit','debug','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','request','then','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xef2c,0x1e7));var _0xcef2=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0xef2c[_0xc0638b];return _0xd57dfa;};'use strict';var _=require(_0xcef2('0x0'));var util=require(_0xcef2('0x1'));var moment=require(_0xcef2('0x2'));var BPromise=require(_0xcef2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcef2('0x4'))['db'];var utils=require(_0xcef2('0x5'));var logger=require(_0xcef2('0x6'))(_0xcef2('0x7'));var config=require(_0xcef2('0x8'));var jayson=require(_0xcef2('0x9'));var client=jayson['client'][_0xcef2('0xa')]({'port':0x232a});config['redis']=_[_0xcef2('0xb')](config['redis'],{'host':_0xcef2('0xc'),'port':0x18eb});var socket=require(_0xcef2('0xd'))(new Redis(config[_0xcef2('0xe')]));require(_0xcef2('0xf'))[_0xcef2('0x10')](socket);function respondWithRpcPromise(_0x59c3a7,_0x38b30d,_0xa6b04c){return new BPromise(function(_0xf24f0c,_0x171dea){return client[_0xcef2('0x11')](_0x59c3a7,_0xa6b04c)[_0xcef2('0x12')](function(_0x5de320){logger[_0xcef2('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x38b30d,_0xcef2('0x14'));logger['debug'](_0xcef2('0x15'),_0x38b30d,'request\x20sent',JSON[_0xcef2('0x16')](_0x5de320));if(_0x5de320['error']){if(_0x5de320[_0xcef2('0x17')][_0xcef2('0x18')]===0x1f4){logger[_0xcef2('0x17')](_0xcef2('0x19'),_0x38b30d,_0x5de320[_0xcef2('0x17')][_0xcef2('0x1a')]);return _0x171dea(_0x5de320[_0xcef2('0x17')][_0xcef2('0x1a')]);}logger[_0xcef2('0x17')](_0xcef2('0x19'),_0x38b30d,_0x5de320[_0xcef2('0x17')]['message']);return _0xf24f0c(_0x5de320[_0xcef2('0x17')][_0xcef2('0x1a')]);}else{logger[_0xcef2('0x13')](_0xcef2('0x19'),_0x38b30d,_0xcef2('0x14'));_0xf24f0c(_0x5de320['result'][_0xcef2('0x1a')]);}})[_0xcef2('0x1b')](function(_0x5147c8){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x38b30d,_0x5147c8);_0x171dea(_0x5147c8);});});}exports[_0xcef2('0x1c')]=function(_0x5344a6){var _0x3b7c29=this;return new Promise(function(_0x26223d,_0x34a69e){return db[_0xcef2('0x1d')][_0xcef2('0x1e')](_0x5344a6[_0xcef2('0x1f')],{'raw':_0x5344a6[_0xcef2('0x20')]?_0x5344a6[_0xcef2('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5344a6[_0xcef2('0x20')]?_0x5344a6['options'][_0xcef2('0x21')]||null:null,'attributes':_0x5344a6[_0xcef2('0x20')]?_0x5344a6[_0xcef2('0x20')][_0xcef2('0x22')]||null:null,'limit':_0x5344a6['options']?_0x5344a6[_0xcef2('0x20')][_0xcef2('0x23')]||null:null})[_0xcef2('0x12')](function(_0x53795b){logger[_0xcef2('0x13')](_0xcef2('0x1c'),_0x5344a6);logger[_0xcef2('0x24')](_0xcef2('0x1c'),_0x5344a6,JSON[_0xcef2('0x16')](_0x53795b));_0x26223d(_0x53795b);})['catch'](function(_0x347461){logger[_0xcef2('0x17')](_0xcef2('0x1c'),_0x347461['message'],_0x5344a6);_0x34a69e(_0x3b7c29[_0xcef2('0x17')](0x1f4,_0x347461[_0xcef2('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x11d744){return new Promise(function(_0x5117fd,_0x1a8161){return db[_0xcef2('0x1d')][_0xcef2('0x25')]({'where':_0x11d744[_0xcef2('0x20')]?_0x11d744['options'][_0xcef2('0x21')]||null:null})['then'](function(_0x52a29b){if(_0x52a29b){return _0x52a29b[_0xcef2('0x26')](_0x11d744[_0xcef2('0x1f')]['ids'],_[_0xcef2('0x27')](_0x11d744['body'],[_0xcef2('0x28'),'id'])||{});}})[_0xcef2('0x29')](function(_0x49c41d){logger[_0xcef2('0x13')](_0xcef2('0x2a'),_0x11d744);logger[_0xcef2('0x24')](_0xcef2('0x2a'),_0x11d744,JSON['stringify'](_0x49c41d));_0x5117fd(_0x49c41d);})[_0xcef2('0x1b')](function(_0x1e2469){logger[_0xcef2('0x17')](_0xcef2('0x2a'),_0x1e2469[_0xcef2('0x1a')],_0x11d744);_0x1a8161(_this[_0xcef2('0x17')](0x1f4,_0x1e2469[_0xcef2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 80143a2..8326c5c 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42ea=['whatsappInteraction:','save','remove','update','removeListener','register','length'];(function(_0x4e4fd2,_0x92933){var _0x4d34cc=function(_0x3dd7ac){while(--_0x3dd7ac){_0x4e4fd2['push'](_0x4e4fd2['shift']());}};_0x4d34cc(++_0x92933);}(_0x42ea,0x12e));var _0xa42e=function(_0x13dcdd,_0x1f6330){_0x13dcdd=_0x13dcdd-0x0;var _0x4e39d6=_0x42ea[_0x13dcdd];return _0x4e39d6;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xa42e('0x0'),_0xa42e('0x1'),_0xa42e('0x2')];function createListener(_0x106541,_0x72b5fd){return function(_0x275307){_0x72b5fd['emit'](_0x106541,_0x275307);};}function removeListener(_0x4339eb,_0x304804){return function(){WhatsappInteractionEvents[_0xa42e('0x3')](_0x4339eb,_0x304804);};}exports[_0xa42e('0x4')]=function(_0x439ed3){for(var _0x2b4b8d=0x0,_0x1ec5e3=events[_0xa42e('0x5')];_0x2b4b8d<_0x1ec5e3;_0x2b4b8d++){var _0x289557=events[_0x2b4b8d];var _0x4f4d72=createListener(_0xa42e('0x6')+_0x289557,_0x439ed3);WhatsappInteractionEvents['on'](_0x289557,_0x4f4d72);}}; \ No newline at end of file +var _0x2857=['./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x3c7f6c,_0x1ce944){var _0xb79dcf=function(_0x1a7597){while(--_0x1a7597){_0x3c7f6c['push'](_0x3c7f6c['shift']());}};_0xb79dcf(++_0x1ce944);}(_0x2857,0x1a4));var _0x7285=function(_0x84b7f2,_0x3bbc1d){_0x84b7f2=_0x84b7f2-0x0;var _0x52f617=_0x2857[_0x84b7f2];return _0x52f617;};'use strict';var WhatsappInteractionEvents=require(_0x7285('0x0'));var events=[_0x7285('0x1'),_0x7285('0x2'),_0x7285('0x3')];function createListener(_0xfc6513,_0x1cf4a0){return function(_0x498c2f){_0x1cf4a0['emit'](_0xfc6513,_0x498c2f);};}function removeListener(_0x581323,_0xf67cf2){return function(){WhatsappInteractionEvents[_0x7285('0x4')](_0x581323,_0xf67cf2);};}exports['register']=function(_0x3c4c61){for(var _0x2f616c=0x0,_0x20b67b=events['length'];_0x2f616c<_0x20b67b;_0x2f616c++){var _0x8dae8=events[_0x2f616c];var _0x46f109=createListener('whatsappInteraction:'+_0x8dae8,_0x3c4c61);WhatsappInteractionEvents['on'](_0x8dae8,_0x46f109);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 8dcf1c9..4f40930 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28c4=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','whatsappmessage:create','create','post','status','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x291e3e,_0x5728cf){var _0xf4b415=function(_0x44eca6){while(--_0x44eca6){_0x291e3e['push'](_0x291e3e['shift']());}};_0xf4b415(++_0x5728cf);}(_0x28c4,0xd3));var _0x428c=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x28c4[_0x55ff79];return _0x579067;};'use strict';var multer=require('multer');var util=require(_0x428c('0x0'));var path=require(_0x428c('0x1'));var timeout=require(_0x428c('0x2'));var express=require(_0x428c('0x3'));var router=express[_0x428c('0x4')]();var fs_extra=require(_0x428c('0x5'));var auth=require(_0x428c('0x6'));var interaction=require(_0x428c('0x7'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x428c('0x8')]('/',auth[_0x428c('0x9')](),controller[_0x428c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x428c('0xb')]);router['get'](_0x428c('0xc'),auth[_0x428c('0x9')](),controller[_0x428c('0xd')]);router['post']('/',auth[_0x428c('0x9')](),interaction['tracked']('whatsapp',_0x428c('0xe')),controller[_0x428c('0xf')]);router[_0x428c('0x10')]('/:id/status',controller[_0x428c('0x11')]);router[_0x428c('0x12')](_0x428c('0xc'),auth[_0x428c('0x9')](),controller['update']);router['put'](_0x428c('0x13'),auth[_0x428c('0x9')](),controller[_0x428c('0x14')]);router[_0x428c('0x12')](_0x428c('0x15'),auth['isAuthenticated'](),controller[_0x428c('0x16')]);router[_0x428c('0x17')](_0x428c('0xc'),auth[_0x428c('0x9')](),controller[_0x428c('0x18')]);module[_0x428c('0x19')]=router; \ No newline at end of file +var _0xfb84=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','status','put','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb84,0x188));var _0x4fb8=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0xfb84[_0x4d67b8];return _0x55af3b;};'use strict';var multer=require(_0x4fb8('0x0'));var util=require('util');var path=require(_0x4fb8('0x1'));var timeout=require(_0x4fb8('0x2'));var express=require(_0x4fb8('0x3'));var router=express[_0x4fb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4fb8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4fb8('0x6'));var controller=require(_0x4fb8('0x7'));router[_0x4fb8('0x8')]('/',auth[_0x4fb8('0x9')](),controller[_0x4fb8('0xa')]);router[_0x4fb8('0x8')](_0x4fb8('0xb'),auth[_0x4fb8('0x9')](),controller[_0x4fb8('0xc')]);router[_0x4fb8('0x8')](_0x4fb8('0xd'),auth[_0x4fb8('0x9')](),controller[_0x4fb8('0xe')]);router[_0x4fb8('0xf')]('/',auth['isAuthenticated'](),interaction[_0x4fb8('0x10')](_0x4fb8('0x11'),'whatsappmessage:create'),controller[_0x4fb8('0x12')]);router[_0x4fb8('0xf')](_0x4fb8('0x13'),controller[_0x4fb8('0x14')]);router[_0x4fb8('0x15')](_0x4fb8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x4fb8('0x15')]('/:id/accept',auth[_0x4fb8('0x9')](),controller[_0x4fb8('0x16')]);router[_0x4fb8('0x15')](_0x4fb8('0x17'),auth['isAuthenticated'](),controller[_0x4fb8('0x18')]);router[_0x4fb8('0x19')](_0x4fb8('0xd'),auth[_0x4fb8('0x9')](),controller[_0x4fb8('0x1a')]);module[_0x4fb8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 634cab0..a2e1909 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65bb=['exports','TEXT','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x2bfad3,_0x10ab16){var _0xa480f7=function(_0x577993){while(--_0x577993){_0x2bfad3['push'](_0x2bfad3['shift']());}};_0xa480f7(++_0x10ab16);}(_0x65bb,0x1b7));var _0xb65b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x65bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb65b('0x0'));module[_0xb65b('0x1')]={'body':{'type':Sequelize[_0xb65b('0x2')](_0xb65b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb65b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb65b('0x5')),'defaultValue':_0xb65b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xb65b('0x6')]},'secret':{'type':Sequelize[_0xb65b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb65b('0x7')]},'providerResponse':{'type':Sequelize[_0xb65b('0x2')]}}; \ No newline at end of file +var _0x4db5=['STRING','DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x4db5,0x192));var _0x54db=function(_0x25c5b4,_0x11db95){_0x25c5b4=_0x25c5b4-0x0;var _0x1bc6d7=_0x4db5[_0x25c5b4];return _0x1bc6d7;};'use strict';var Sequelize=require('sequelize');module[_0x54db('0x0')]={'body':{'type':Sequelize[_0x54db('0x1')](_0x54db('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x54db('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x54db('0x4')]('in',_0x54db('0x5')),'defaultValue':_0x54db('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x54db('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x54db('0x7')]},'secret':{'type':Sequelize[_0x54db('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x54db('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index c043523..87811a2 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8ad=['where','filters','filter','merge','VIRTUAL','includeAll','include','rows','show','params','intersection','options','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','contact','fullname','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x24e10e,_0x510e5c){var _0x3a9528=function(_0x55aabf){while(--_0x55aabf){_0x24e10e['push'](_0x24e10e['shift']());}};_0x3a9528(++_0x510e5c);}(_0xb8ad,0xd9));var _0xdb8a=function(_0x5b582b,_0x231536){_0x5b582b=_0x5b582b-0x0;var _0x3e9554=_0xb8ad[_0x5b582b];return _0x3e9554;};'use strict';var emlformat=require(_0xdb8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb8a('0x2'));var Mustache=require(_0xdb8a('0x3'));var util=require(_0xdb8a('0x4'));var path=require(_0xdb8a('0x5'));var sox=require(_0xdb8a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb8a('0x7'));var _=require(_0xdb8a('0x8'));var squel=require(_0xdb8a('0x9'));var crypto=require(_0xdb8a('0xa'));var jsforce=require(_0xdb8a('0xb'));var deskjs=require(_0xdb8a('0xc'));var toCsv=require(_0xdb8a('0xd'));var querystring=require('querystring');var Papa=require(_0xdb8a('0xe'));var Redis=require(_0xdb8a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb8a('0x10'));var as=require(_0xdb8a('0x11'));var hardwareService=require(_0xdb8a('0x12'));var logger=require(_0xdb8a('0x13'))(_0xdb8a('0x14'));var utils=require(_0xdb8a('0x15'));var config=require(_0xdb8a('0x16'));var licenseUtil=require(_0xdb8a('0x17'));var db=require(_0xdb8a('0x18'))['db'];config[_0xdb8a('0x19')]=_[_0xdb8a('0x1a')](config['redis'],{'host':_0xdb8a('0x1b'),'port':0x18eb});var socket=require(_0xdb8a('0x1c'))(new Redis(config['redis']));require(_0xdb8a('0x1d'))['register'](socket);var jayson=require(_0xdb8a('0x1e'));var client=jayson[_0xdb8a('0x1f')][_0xdb8a('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xdb8a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4cc453,_0x59e156,_0x4629d2,_0x419296){return new BPromise(function(_0x44ba5f,_0x247e5f){var _0xf074a=_0x419296||client;return _0xf074a[_0xdb8a('0x21')](_0x4cc453,_0x4629d2)['then'](function(_0x29c7b0){logger[_0xdb8a('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x59e156,_0xdb8a('0x23'));logger['debug'](_0xdb8a('0x24'),_0x59e156,_0xdb8a('0x23'),JSON[_0xdb8a('0x25')](_0x29c7b0));if(_0x29c7b0[_0xdb8a('0x26')]){if(_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x27')]===0x1f4){logger[_0xdb8a('0x26')](_0xdb8a('0x28'),_0x59e156,_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);return _0x247e5f(_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);}logger[_0xdb8a('0x26')](_0xdb8a('0x28'),_0x59e156,_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);return _0x44ba5f(_0x29c7b0[_0xdb8a('0x26')][_0xdb8a('0x29')]);}else{logger['info'](_0xdb8a('0x28'),_0x59e156,_0xdb8a('0x23'));_0x44ba5f(_0x29c7b0['result'][_0xdb8a('0x29')]);}})[_0xdb8a('0x2a')](function(_0x4631d2){logger[_0xdb8a('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x59e156,_0x4631d2);_0x247e5f(_0x4631d2);});});}function respondWithStatusCode(_0x3b98e3,_0x24ffb3){_0x24ffb3=_0x24ffb3||0xcc;return function(_0x49afa3){if(_0x49afa3){return _0x3b98e3[_0xdb8a('0x2b')](_0x24ffb3);}return _0x3b98e3['status'](_0x24ffb3)['end']();};}function respondWithResult(_0x3f260d,_0x1292e7){_0x1292e7=_0x1292e7||0xc8;return function(_0x16f8eb){if(_0x16f8eb){return _0x3f260d[_0xdb8a('0x2c')](_0x1292e7)['json'](_0x16f8eb);}};}function respondWithFilteredResult(_0x493e2a,_0x4578b3){return function(_0x138bd0){if(_0x138bd0){var _0x40ffa6=typeof _0x4578b3['offset']==='undefined'&&typeof _0x4578b3['limit']===_0xdb8a('0x2d');var _0x5b5420=_0x138bd0[_0xdb8a('0x2e')];var _0x458e8c=_0x40ffa6?0x0:_0x4578b3['offset'];var _0x3c189a=_0x40ffa6?_0x138bd0[_0xdb8a('0x2e')]:_0x4578b3[_0xdb8a('0x2f')]+_0x4578b3[_0xdb8a('0x30')];var _0x1e40b8;if(_0x3c189a>=_0x5b5420){_0x3c189a=_0x5b5420;_0x1e40b8=0xc8;}else{_0x1e40b8=0xce;}_0x493e2a[_0xdb8a('0x2c')](_0x1e40b8);return _0x493e2a[_0xdb8a('0x31')](_0xdb8a('0x32'),_0x458e8c+'-'+_0x3c189a+'/'+_0x5b5420)[_0xdb8a('0x33')](_0x138bd0);}return null;};}function patchUpdates(_0x44681f){return function(_0x2d72aa){try{jsonpatch[_0xdb8a('0x34')](_0x2d72aa,_0x44681f,!![]);}catch(_0x4d9ff5){return BPromise[_0xdb8a('0x35')](_0x4d9ff5);}return _0x2d72aa[_0xdb8a('0x36')]();};}function saveUpdates(_0x502e5b,_0x413cf7){return function(_0x2472f1){if(_0x2472f1){return _0x2472f1['update'](_0x502e5b)['then'](function(_0x260ec1){return _0x260ec1;});}return null;};}function removeEntity(_0x501b3b,_0x18a499){return function(_0x7ee931){if(_0x7ee931){return _0x7ee931[_0xdb8a('0x37')]()[_0xdb8a('0x38')](function(){_0x501b3b[_0xdb8a('0x2c')](0xcc)[_0xdb8a('0x39')]();});}};}function handleEntityNotFound(_0x376572,_0x5a6f6a){return function(_0x766f12){if(!_0x766f12){_0x376572['sendStatus'](0x194);}return _0x766f12;};}function handleError(_0x3d6afb,_0x2b2a5e){_0x2b2a5e=_0x2b2a5e||0x1f4;return function(_0x504ab2){logger[_0xdb8a('0x26')](_0x504ab2[_0xdb8a('0x3a')]);if(_0x504ab2[_0xdb8a('0x3b')]){delete _0x504ab2[_0xdb8a('0x3b')];}_0x3d6afb[_0xdb8a('0x2c')](_0x2b2a5e)[_0xdb8a('0x3c')](_0x504ab2);};}exports[_0xdb8a('0x3d')]=function(_0x487d0d,_0x5cf027){var _0x4593b6={},_0x39bb71={},_0x43e3ba={'count':0x0,'rows':[]};var _0x40c630=_[_0xdb8a('0x3e')](db[_0xdb8a('0x3f')][_0xdb8a('0x40')],function(_0x1a8731){return{'name':_0x1a8731[_0xdb8a('0x41')],'type':_0x1a8731[_0xdb8a('0x42')][_0xdb8a('0x43')]};});_0x39bb71['model']=_[_0xdb8a('0x3e')](_0x40c630,_0xdb8a('0x3b'));_0x39bb71[_0xdb8a('0x44')]=_[_0xdb8a('0x45')](_0x487d0d[_0xdb8a('0x44')]);_0x39bb71['filters']=_['intersection'](_0x39bb71[_0xdb8a('0x46')],_0x39bb71[_0xdb8a('0x44')]);_0x4593b6[_0xdb8a('0x47')]=_['intersection'](_0x39bb71[_0xdb8a('0x46')],qs[_0xdb8a('0x48')](_0x487d0d['query'][_0xdb8a('0x48')]));_0x4593b6[_0xdb8a('0x47')]=_0x4593b6[_0xdb8a('0x47')][_0xdb8a('0x49')]?_0x4593b6[_0xdb8a('0x47')]:_0x39bb71[_0xdb8a('0x46')];if(!_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x4a')](_0xdb8a('0x4b'))){_0x4593b6[_0xdb8a('0x30')]=qs[_0xdb8a('0x30')](_0x487d0d[_0xdb8a('0x44')]['limit']);_0x4593b6['offset']=qs[_0xdb8a('0x2f')](_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x2f')]);}_0x4593b6['order']=qs[_0xdb8a('0x4c')](_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x4c')]);_0x4593b6[_0xdb8a('0x4d')]=qs['filters'](_['pick'](_0x487d0d[_0xdb8a('0x44')],_0x39bb71[_0xdb8a('0x4e')]),_0x40c630);if(_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x4f')]){_0x4593b6['where']=_[_0xdb8a('0x50')](_0x4593b6[_0xdb8a('0x4d')],{'$or':_[_0xdb8a('0x3e')](_0x40c630,function(_0x529803){if(_0x529803[_0xdb8a('0x42')]!==_0xdb8a('0x51')){var _0x50aaa0={};_0x50aaa0[_0x529803[_0xdb8a('0x3b')]]={'$like':'%'+_0x487d0d['query'][_0xdb8a('0x4f')]+'%'};return _0x50aaa0;}})});}_0x4593b6=_['merge']({},_0x4593b6,_0x487d0d['options']);var _0x2953c7={'where':_0x4593b6[_0xdb8a('0x4d')]};return db['WhatsappMessage'][_0xdb8a('0x2e')](_0x2953c7)[_0xdb8a('0x38')](function(_0x28bed6){_0x43e3ba[_0xdb8a('0x2e')]=_0x28bed6;if(_0x487d0d[_0xdb8a('0x44')][_0xdb8a('0x52')]){_0x4593b6[_0xdb8a('0x53')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4593b6);})['then'](function(_0xe9a877){_0x43e3ba[_0xdb8a('0x54')]=_0xe9a877;return _0x43e3ba;})[_0xdb8a('0x38')](respondWithFilteredResult(_0x5cf027,_0x4593b6))[_0xdb8a('0x2a')](handleError(_0x5cf027,null));};exports[_0xdb8a('0x55')]=function(_0x32c4d2,_0x35166c){var _0x3d689d={'raw':!![],'where':{'id':_0x32c4d2[_0xdb8a('0x56')]['id']}},_0x355430={};_0x355430['model']=_[_0xdb8a('0x45')](db['WhatsappMessage'][_0xdb8a('0x40')]);_0x355430['query']=_[_0xdb8a('0x45')](_0x32c4d2[_0xdb8a('0x44')]);_0x355430[_0xdb8a('0x4e')]=_[_0xdb8a('0x57')](_0x355430['model'],_0x355430[_0xdb8a('0x44')]);_0x3d689d[_0xdb8a('0x47')]=_[_0xdb8a('0x57')](_0x355430[_0xdb8a('0x46')],qs[_0xdb8a('0x48')](_0x32c4d2[_0xdb8a('0x44')][_0xdb8a('0x48')]));_0x3d689d['attributes']=_0x3d689d[_0xdb8a('0x47')]['length']?_0x3d689d[_0xdb8a('0x47')]:_0x355430[_0xdb8a('0x46')];if(_0x32c4d2[_0xdb8a('0x44')][_0xdb8a('0x52')]){_0x3d689d[_0xdb8a('0x53')]=[{'all':!![]}];}_0x3d689d=_[_0xdb8a('0x50')]({},_0x3d689d,_0x32c4d2[_0xdb8a('0x58')]);return db[_0xdb8a('0x3f')][_0xdb8a('0x59')](_0x3d689d)[_0xdb8a('0x38')](handleEntityNotFound(_0x35166c,null))[_0xdb8a('0x38')](respondWithResult(_0x35166c,null))[_0xdb8a('0x2a')](handleError(_0x35166c,null));};exports[_0xdb8a('0x5a')]=function(_0x94192a,_0x10cd5a){return db[_0xdb8a('0x3f')][_0xdb8a('0x5a')](_0x94192a[_0xdb8a('0x5b')],{})[_0xdb8a('0x38')](respondWithResult(_0x10cd5a,0xc9))[_0xdb8a('0x2a')](handleError(_0x10cd5a,null));};exports[_0xdb8a('0x5c')]=function(_0x2f92dd,_0x29bb2c){if(_0x2f92dd[_0xdb8a('0x5b')]['id']){delete _0x2f92dd['body']['id'];}return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x2f92dd[_0xdb8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x29bb2c,null))[_0xdb8a('0x38')](saveUpdates(_0x2f92dd['body'],null))['then'](respondWithResult(_0x29bb2c,null))[_0xdb8a('0x2a')](handleError(_0x29bb2c,null));};exports['destroy']=function(_0x2e6ae0,_0x45edbc){return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x2e6ae0[_0xdb8a('0x56')]['id']}})[_0xdb8a('0x38')](handleEntityNotFound(_0x45edbc,null))[_0xdb8a('0x38')](removeEntity(_0x45edbc,null))[_0xdb8a('0x2a')](handleError(_0x45edbc,null));};exports[_0xdb8a('0x5d')]=function(_0x120405,_0x139234){return db['WhatsappMessage'][_0xdb8a('0x5d')]()[_0xdb8a('0x38')](respondWithResult(_0x139234,null))[_0xdb8a('0x2a')](handleError(_0x139234,null));};var interaction_log=require(_0xdb8a('0x13'))(_0xdb8a('0x5e'));exports[_0xdb8a('0x5f')]=function(_0x49bab2,_0x483dfe,_0x56bc24){var _0x253edb={'agent':{},'channel':_0xdb8a('0x60')};if(_0x49bab2[_0xdb8a('0x5b')]['id']){delete _0x49bab2[_0xdb8a('0x5b')]['id'];}_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x61')]=!![];_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x62')]=moment()[_0xdb8a('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x49bab2[_0xdb8a('0x5b')]['UserId']=_0x49bab2['body'][_0xdb8a('0x64')]||_0x49bab2[_0xdb8a('0x65')]['id'];_0x253edb[_0xdb8a('0x66')]['id']=_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x64')];return db[_0xdb8a('0x3f')]['find']({'where':{'id':_0x49bab2['params']['id'],'UserId':null}})[_0xdb8a('0x38')](handleEntityNotFound(_0x483dfe,null))[_0xdb8a('0x38')](saveUpdates(_0x49bab2['body'],null))[_0xdb8a('0x38')](function(_0x45fcff){if(_0x45fcff){_0x253edb[_0xdb8a('0x29')]=_0x45fcff[_0xdb8a('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0xdb8a('0x59')]({'where':{'id':_0x45fcff[_0xdb8a('0x68')]}});}return null;})[_0xdb8a('0x38')](handleEntityNotFound(_0x483dfe,null))[_0xdb8a('0x38')](function(_0x3bd3ea){if(_0x3bd3ea){return _0x3bd3ea[_0xdb8a('0x5c')]({'UserId':_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x64')],'read1stAt':_['isNil'](_0x3bd3ea[_0xdb8a('0x69')])?moment()[_0xdb8a('0x63')](_0xdb8a('0x6a')):undefined});}return null;})[_0xdb8a('0x38')](function(_0x2134e7){if(_0x2134e7){_0x253edb['interaction']=_0x2134e7[_0xdb8a('0x67')]({'plain':!![]});interaction_log[_0xdb8a('0x22')](_0xdb8a('0x6b'),_0x49bab2[_0xdb8a('0x65')]['id'],_0x49bab2[_0xdb8a('0x65')][_0xdb8a('0x3b')],_0x49bab2[_0xdb8a('0x65')][_0xdb8a('0x6c')],_0x253edb['interaction']['id'],_0x49bab2[_0xdb8a('0x5b')]?JSON[_0xdb8a('0x25')](_0x49bab2[_0xdb8a('0x5b')]):_0xdb8a('0x6d'));return respondWithRpcPromise(_0xdb8a('0x6e'),_0xdb8a('0x6f'),_0x253edb);}return null;})[_0xdb8a('0x38')](function(_0x9ca8da){var _0x1759e5=_0xdb8a('0x70')+_0x9ca8da[_0xdb8a('0x29')]['ContactId'];return db[_0xdb8a('0x71')][_0xdb8a('0x44')](_0x1759e5,{'type':db[_0xdb8a('0x72')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1c9125){return _0x1c9125;});})[_0xdb8a('0x38')](function(_0x4fa1df){if(_0x4fa1df){_0x253edb[_0xdb8a('0x29')]['contact']=_0x4fa1df[0x0];if(!_0x49bab2[_0xdb8a('0x5b')][_0xdb8a('0x64')])return;return db[_0xdb8a('0x73')][_0xdb8a('0x59')]({'where':{'id':_0x49bab2['body'][_0xdb8a('0x64')],'role':'agent'},'attributes':['id','name','fullname',_0xdb8a('0x74'),_0xdb8a('0x75')],'raw':!![]});}return null;})[_0xdb8a('0x38')](function(_0x55659f){if(!_0x55659f)return null;_0x253edb[_0xdb8a('0x29')]['agent']=_0x55659f;return _0x253edb;})[_0xdb8a('0x38')](function(_0x567048){if(_0x567048){if(_0x49bab2['body']['manual']){_0x253edb[_0xdb8a('0x29')]['interface']=util[_0xdb8a('0x63')](_0xdb8a('0x76'),_0x49bab2[_0xdb8a('0x65')][_0xdb8a('0x3b')]);_0x253edb[_0xdb8a('0x29')]['channel']=_0x253edb[_0xdb8a('0x77')];_0x253edb[_0xdb8a('0x29')][_0xdb8a('0x78')]=_0x253edb[_0xdb8a('0x77')];_0x253edb['message'][_0xdb8a('0x79')]=_0xdb8a('0x5f');return respondWithRpcPromise(_0xdb8a('0x7a'),_0xdb8a('0x7a'),{'event':_0xdb8a('0x7b'),'message':_0x253edb[_0xdb8a('0x29')]},client9002)['then'](function(){return _0x253edb;});}return _0x253edb;}return null;})[_0xdb8a('0x38')](respondWithResult(_0x483dfe,null))['catch'](handleError(_0x483dfe,null));};var interaction_log=require(_0xdb8a('0x13'))(_0xdb8a('0x5e'));exports[_0xdb8a('0x35')]=function(_0x3f5145,_0x206418,_0x3e8e42){var _0x18be19={'agent':{},'channel':_0xdb8a('0x60')};if(_0x3f5145[_0xdb8a('0x5b')]['id']){delete _0x3f5145[_0xdb8a('0x5b')]['id'];}_0x3f5145[_0xdb8a('0x5b')]['UserId']=_0x3f5145[_0xdb8a('0x5b')][_0xdb8a('0x64')]||_0x3f5145['user']['id'];_0x18be19[_0xdb8a('0x66')]['id']=_0x3f5145[_0xdb8a('0x5b')]['UserId'];return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x3f5145[_0xdb8a('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x206418,null))[_0xdb8a('0x38')](function(_0x451bcc){if(_0x451bcc){_0x18be19[_0xdb8a('0x29')]=_0x451bcc[_0xdb8a('0x67')]({'plain':!![]});return db[_0xdb8a('0x7c')]['find']({'where':{'id':_0x451bcc[_0xdb8a('0x68')]}});}return null;})[_0xdb8a('0x38')](handleEntityNotFound(_0x206418,null))[_0xdb8a('0x38')](function(_0x479980){if(_0x479980){_0x18be19[_0xdb8a('0x7d')]=_0x479980[_0xdb8a('0x67')]({'plain':!![]});interaction_log[_0xdb8a('0x22')](_0xdb8a('0x7e'),_0x3f5145['user']['id'],_0x3f5145['user'][_0xdb8a('0x3b')],_0x3f5145['user'][_0xdb8a('0x6c')],_0x18be19['interaction']['id'],_0x3f5145[_0xdb8a('0x5b')]?JSON['stringify'](_0x3f5145[_0xdb8a('0x5b')]):'null');return respondWithRpcPromise(_0xdb8a('0x7f'),_0xdb8a('0x80'),_0x18be19);}return null;})[_0xdb8a('0x38')](function(_0x3bef3b){var _0xc306ae=_0xdb8a('0x70')+_0x3bef3b[_0xdb8a('0x29')][_0xdb8a('0x81')];return db[_0xdb8a('0x71')]['query'](_0xc306ae,{'type':db['Sequelize'][_0xdb8a('0x82')][_0xdb8a('0x83')],'raw':!![]})[_0xdb8a('0x38')](function(_0x560c64){return _0x560c64;});})[_0xdb8a('0x38')](function(_0x56e3b3){if(_0x56e3b3){_0x18be19[_0xdb8a('0x29')][_0xdb8a('0x84')]=_0x56e3b3[0x0];if(!_0x3f5145[_0xdb8a('0x5b')]['UserId'])return;return db[_0xdb8a('0x73')][_0xdb8a('0x59')]({'where':{'id':_0x3f5145[_0xdb8a('0x5b')][_0xdb8a('0x64')],'role':_0xdb8a('0x66')},'attributes':['id',_0xdb8a('0x3b'),_0xdb8a('0x85'),_0xdb8a('0x74'),_0xdb8a('0x75')],'raw':!![]});}return null;})[_0xdb8a('0x38')](function(_0x459ef0){if(!_0x459ef0)return null;_0x18be19['message'][_0xdb8a('0x66')]=_0x459ef0;return _0x18be19;})[_0xdb8a('0x38')](function(_0x2bce13){if(_0x2bce13){_0x2bce13[_0xdb8a('0x29')][_0xdb8a('0x86')]=util[_0xdb8a('0x63')]('SIP/%s',_0x3f5145[_0xdb8a('0x65')][_0xdb8a('0x3b')]);_0x2bce13[_0xdb8a('0x29')]['channel']=_0x18be19[_0xdb8a('0x77')];_0x2bce13['message'][_0xdb8a('0x78')]=_0x18be19[_0xdb8a('0x77')];_0x2bce13[_0xdb8a('0x29')][_0xdb8a('0x79')]=_0xdb8a('0x35');respondWithRpcPromise('EventManager',_0xdb8a('0x7a'),{'event':_0xdb8a('0x87'),'message':_0x2bce13['message']},client9002);return _0x18be19;}return null;})[_0xdb8a('0x38')](respondWithResult(_0x206418,null))[_0xdb8a('0x2a')](handleError(_0x206418,null));};exports['status']=function(_0x455130,_0x38e3c4,_0x362b2f){if(_0x455130[_0xdb8a('0x5b')]['id']){delete _0x455130[_0xdb8a('0x5b')]['id'];}var _0x5df166;return db[_0xdb8a('0x3f')][_0xdb8a('0x59')]({'where':{'id':_0x455130[_0xdb8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x38e3c4,null))[_0xdb8a('0x38')](function(_0x42f894){if(_0x42f894){_0x5df166=_0x42f894;return db[_0xdb8a('0x88')][_0xdb8a('0x59')]({'where':{'id':_0x42f894[_0xdb8a('0x89')]}});}})['then'](handleEntityNotFound(_0x38e3c4,null))[_0xdb8a('0x38')](function(_0x4e2e0d){if(_0x4e2e0d){logger[_0xdb8a('0x8a')](_0xdb8a('0x8b'),_0xdb8a('0x2c'),_0xdb8a('0x8c'),_0x4e2e0d['type'],util[_0xdb8a('0x8d')](_0x455130[_0xdb8a('0x5b')],{'showHidden':![],'depth':null}));switch(_0x4e2e0d[_0xdb8a('0x42')]){case _0xdb8a('0x8e'):if(_0x455130['body'][_0xdb8a('0x8f')]&&_0x455130[_0xdb8a('0x5b')][_0xdb8a('0x8f')]===_0x5df166[_0xdb8a('0x90')]&&_0x455130[_0xdb8a('0x5b')][_0xdb8a('0x91')]&&_0x455130['body'][_0xdb8a('0x91')]==='read'){return _0x5df166[_0xdb8a('0x5c')]({'read':!![]});}else{logger['error'](_0xdb8a('0x92'),_0xdb8a('0x2c'),_0xdb8a('0x8e'),util[_0xdb8a('0x8d')](_0x455130[_0xdb8a('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5df166;}})[_0xdb8a('0x38')](respondWithResult(_0x38e3c4,null))[_0xdb8a('0x2a')](handleError(_0x38e3c4,null));}; \ No newline at end of file +var _0x2935=['whatsapp','agent','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','reject','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','info','WhatsappMessage,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','whatsapp-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteractionId','read1stAt','interaction','get','user','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage'];(function(_0x5cca9f,_0x154684){var _0x55edda=function(_0x115aa2){while(--_0x115aa2){_0x5cca9f['push'](_0x5cca9f['shift']());}};_0x55edda(++_0x154684);}(_0x2935,0xa0));var _0x5293=function(_0x769d22,_0x5323c8){_0x769d22=_0x769d22-0x0;var _0x477ae1=_0x2935[_0x769d22];return _0x477ae1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5293('0x0'));var zipdir=require(_0x5293('0x1'));var jsonpatch=require(_0x5293('0x2'));var rp=require(_0x5293('0x3'));var moment=require(_0x5293('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5293('0x5'));var path=require('path');var sox=require(_0x5293('0x6'));var csv=require(_0x5293('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5293('0x8'));var _=require('lodash');var squel=require(_0x5293('0x9'));var crypto=require(_0x5293('0xa'));var jsforce=require(_0x5293('0xb'));var deskjs=require(_0x5293('0xc'));var toCsv=require(_0x5293('0x7'));var querystring=require('querystring');var Papa=require(_0x5293('0xd'));var Redis=require(_0x5293('0xe'));var authService=require(_0x5293('0xf'));var qs=require(_0x5293('0x10'));var as=require(_0x5293('0x11'));var hardwareService=require(_0x5293('0x12'));var logger=require(_0x5293('0x13'))(_0x5293('0x14'));var utils=require(_0x5293('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5293('0x16'));var db=require(_0x5293('0x17'))['db'];config[_0x5293('0x18')]=_[_0x5293('0x19')](config[_0x5293('0x18')],{'host':_0x5293('0x1a'),'port':0x18eb});var socket=require(_0x5293('0x1b'))(new Redis(config[_0x5293('0x18')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5293('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x5293('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x169274,_0x2ce214,_0x2457a4,_0x35f24f){return new BPromise(function(_0x232955,_0x26d484){var _0x20a9f5=_0x35f24f||client;return _0x20a9f5['request'](_0x169274,_0x2457a4)['then'](function(_0x2ccd0b){logger[_0x5293('0x1d')](_0x5293('0x1e'),_0x2ce214,'request\x20sent');logger[_0x5293('0x1f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2ce214,'request\x20sent',JSON['stringify'](_0x2ccd0b));if(_0x2ccd0b['error']){if(_0x2ccd0b[_0x5293('0x20')][_0x5293('0x21')]===0x1f4){logger['error'](_0x5293('0x1e'),_0x2ce214,_0x2ccd0b[_0x5293('0x20')][_0x5293('0x22')]);return _0x26d484(_0x2ccd0b[_0x5293('0x20')][_0x5293('0x22')]);}logger[_0x5293('0x20')](_0x5293('0x1e'),_0x2ce214,_0x2ccd0b[_0x5293('0x20')]['message']);return _0x232955(_0x2ccd0b[_0x5293('0x20')][_0x5293('0x22')]);}else{logger[_0x5293('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0x2ce214,_0x5293('0x23'));_0x232955(_0x2ccd0b['result'][_0x5293('0x22')]);}})[_0x5293('0x24')](function(_0x2c518b){logger[_0x5293('0x20')](_0x5293('0x1e'),_0x2ce214,_0x2c518b);_0x26d484(_0x2c518b);});});}function respondWithStatusCode(_0x4e5205,_0x5e25ff){_0x5e25ff=_0x5e25ff||0xcc;return function(_0x4fcb4c){if(_0x4fcb4c){return _0x4e5205[_0x5293('0x25')](_0x5e25ff);}return _0x4e5205[_0x5293('0x26')](_0x5e25ff)[_0x5293('0x27')]();};}function respondWithResult(_0x24e439,_0x13c84e){_0x13c84e=_0x13c84e||0xc8;return function(_0x3187ba){if(_0x3187ba){return _0x24e439[_0x5293('0x26')](_0x13c84e)[_0x5293('0x28')](_0x3187ba);}};}function respondWithFilteredResult(_0x5c83ee,_0x9b399e){return function(_0x1d54f6){if(_0x1d54f6){var _0x256bae=typeof _0x9b399e[_0x5293('0x29')]==='undefined'&&typeof _0x9b399e[_0x5293('0x2a')]===_0x5293('0x2b');var _0x34b518=_0x1d54f6[_0x5293('0x2c')];var _0x2454ff=_0x256bae?0x0:_0x9b399e[_0x5293('0x29')];var _0x4143d8=_0x256bae?_0x1d54f6[_0x5293('0x2c')]:_0x9b399e['offset']+_0x9b399e[_0x5293('0x2a')];var _0x2ed753;if(_0x4143d8>=_0x34b518){_0x4143d8=_0x34b518;_0x2ed753=0xc8;}else{_0x2ed753=0xce;}_0x5c83ee[_0x5293('0x26')](_0x2ed753);return _0x5c83ee[_0x5293('0x2d')](_0x5293('0x2e'),_0x2454ff+'-'+_0x4143d8+'/'+_0x34b518)[_0x5293('0x28')](_0x1d54f6);}return null;};}function patchUpdates(_0x263dbc){return function(_0x1025b5){try{jsonpatch[_0x5293('0x2f')](_0x1025b5,_0x263dbc,!![]);}catch(_0xdd5577){return BPromise['reject'](_0xdd5577);}return _0x1025b5['save']();};}function saveUpdates(_0x4c7add,_0xd0da){return function(_0x92e066){if(_0x92e066){return _0x92e066[_0x5293('0x30')](_0x4c7add)[_0x5293('0x31')](function(_0x1dea08){return _0x1dea08;});}return null;};}function removeEntity(_0x56ec98,_0x12ea76){return function(_0x1f0bda){if(_0x1f0bda){return _0x1f0bda[_0x5293('0x32')]()[_0x5293('0x31')](function(){_0x56ec98[_0x5293('0x26')](0xcc)[_0x5293('0x27')]();});}};}function handleEntityNotFound(_0x54c524,_0x557e9f){return function(_0x5aa4ae){if(!_0x5aa4ae){_0x54c524['sendStatus'](0x194);}return _0x5aa4ae;};}function handleError(_0x99c95c,_0x5b9614){_0x5b9614=_0x5b9614||0x1f4;return function(_0x7c1eed){logger[_0x5293('0x20')](_0x7c1eed[_0x5293('0x33')]);if(_0x7c1eed['name']){delete _0x7c1eed[_0x5293('0x34')];}_0x99c95c[_0x5293('0x26')](_0x5b9614)[_0x5293('0x35')](_0x7c1eed);};}exports[_0x5293('0x36')]=function(_0x29764b,_0x5a09e6){var _0x15518d={},_0x381156={},_0x2d7045={'count':0x0,'rows':[]};var _0x40b69e=_[_0x5293('0x37')](db[_0x5293('0x38')][_0x5293('0x39')],function(_0x44e6e5){return{'name':_0x44e6e5['fieldName'],'type':_0x44e6e5[_0x5293('0x3a')]['key']};});_0x381156['model']=_['map'](_0x40b69e,_0x5293('0x34'));_0x381156[_0x5293('0x3b')]=_[_0x5293('0x3c')](_0x29764b[_0x5293('0x3b')]);_0x381156[_0x5293('0x3d')]=_[_0x5293('0x3e')](_0x381156[_0x5293('0x3f')],_0x381156['query']);_0x15518d[_0x5293('0x40')]=_[_0x5293('0x3e')](_0x381156[_0x5293('0x3f')],qs[_0x5293('0x41')](_0x29764b[_0x5293('0x3b')][_0x5293('0x41')]));_0x15518d['attributes']=_0x15518d[_0x5293('0x40')][_0x5293('0x42')]?_0x15518d[_0x5293('0x40')]:_0x381156[_0x5293('0x3f')];if(!_0x29764b[_0x5293('0x3b')]['hasOwnProperty'](_0x5293('0x43'))){_0x15518d['limit']=qs[_0x5293('0x2a')](_0x29764b[_0x5293('0x3b')][_0x5293('0x2a')]);_0x15518d[_0x5293('0x29')]=qs['offset'](_0x29764b[_0x5293('0x3b')][_0x5293('0x29')]);}_0x15518d[_0x5293('0x44')]=qs['sort'](_0x29764b[_0x5293('0x3b')][_0x5293('0x45')]);_0x15518d['where']=qs[_0x5293('0x3d')](_[_0x5293('0x46')](_0x29764b[_0x5293('0x3b')],_0x381156[_0x5293('0x3d')]),_0x40b69e);if(_0x29764b['query'][_0x5293('0x47')]){_0x15518d[_0x5293('0x48')]=_['merge'](_0x15518d[_0x5293('0x48')],{'$or':_[_0x5293('0x37')](_0x40b69e,function(_0x3bb3ee){if(_0x3bb3ee['type']!==_0x5293('0x49')){var _0x2bf98c={};_0x2bf98c[_0x3bb3ee[_0x5293('0x34')]]={'$like':'%'+_0x29764b[_0x5293('0x3b')]['filter']+'%'};return _0x2bf98c;}})});}_0x15518d=_[_0x5293('0x4a')]({},_0x15518d,_0x29764b[_0x5293('0x4b')]);var _0x3daa8f={'where':_0x15518d[_0x5293('0x48')]};return db[_0x5293('0x38')][_0x5293('0x2c')](_0x3daa8f)['then'](function(_0xa4208b){_0x2d7045['count']=_0xa4208b;if(_0x29764b[_0x5293('0x3b')][_0x5293('0x4c')]){_0x15518d[_0x5293('0x4d')]=[{'all':!![]}];}return db[_0x5293('0x38')][_0x5293('0x4e')](_0x15518d);})[_0x5293('0x31')](function(_0x4cf312){_0x2d7045[_0x5293('0x4f')]=_0x4cf312;return _0x2d7045;})[_0x5293('0x31')](respondWithFilteredResult(_0x5a09e6,_0x15518d))[_0x5293('0x24')](handleError(_0x5a09e6,null));};exports[_0x5293('0x50')]=function(_0x540dbf,_0x327a10){var _0x5b8223={'raw':!![],'where':{'id':_0x540dbf[_0x5293('0x51')]['id']}},_0x1a05ab={};_0x1a05ab[_0x5293('0x3f')]=_[_0x5293('0x3c')](db[_0x5293('0x38')][_0x5293('0x39')]);_0x1a05ab[_0x5293('0x3b')]=_[_0x5293('0x3c')](_0x540dbf[_0x5293('0x3b')]);_0x1a05ab[_0x5293('0x3d')]=_['intersection'](_0x1a05ab[_0x5293('0x3f')],_0x1a05ab[_0x5293('0x3b')]);_0x5b8223[_0x5293('0x40')]=_[_0x5293('0x3e')](_0x1a05ab['model'],qs[_0x5293('0x41')](_0x540dbf[_0x5293('0x3b')][_0x5293('0x41')]));_0x5b8223['attributes']=_0x5b8223[_0x5293('0x40')][_0x5293('0x42')]?_0x5b8223[_0x5293('0x40')]:_0x1a05ab[_0x5293('0x3f')];if(_0x540dbf[_0x5293('0x3b')]['includeAll']){_0x5b8223['include']=[{'all':!![]}];}_0x5b8223=_[_0x5293('0x4a')]({},_0x5b8223,_0x540dbf[_0x5293('0x4b')]);return db[_0x5293('0x38')][_0x5293('0x52')](_0x5b8223)[_0x5293('0x31')](handleEntityNotFound(_0x327a10,null))[_0x5293('0x31')](respondWithResult(_0x327a10,null))[_0x5293('0x24')](handleError(_0x327a10,null));};exports[_0x5293('0x53')]=function(_0x401f3b,_0x186eff){return db[_0x5293('0x38')][_0x5293('0x53')](_0x401f3b[_0x5293('0x54')],{})['then'](respondWithResult(_0x186eff,0xc9))[_0x5293('0x24')](handleError(_0x186eff,null));};exports[_0x5293('0x30')]=function(_0x122d35,_0x30fd96){if(_0x122d35[_0x5293('0x54')]['id']){delete _0x122d35['body']['id'];}return db[_0x5293('0x38')]['find']({'where':{'id':_0x122d35[_0x5293('0x51')]['id']}})['then'](handleEntityNotFound(_0x30fd96,null))[_0x5293('0x31')](saveUpdates(_0x122d35[_0x5293('0x54')],null))[_0x5293('0x31')](respondWithResult(_0x30fd96,null))['catch'](handleError(_0x30fd96,null));};exports[_0x5293('0x32')]=function(_0x2c982e,_0x2272a8){return db[_0x5293('0x38')][_0x5293('0x52')]({'where':{'id':_0x2c982e[_0x5293('0x51')]['id']}})['then'](handleEntityNotFound(_0x2272a8,null))[_0x5293('0x31')](removeEntity(_0x2272a8,null))[_0x5293('0x24')](handleError(_0x2272a8,null));};exports[_0x5293('0x55')]=function(_0x42e94b,_0xbc2e83){return db[_0x5293('0x38')][_0x5293('0x55')]()['then'](respondWithResult(_0xbc2e83,null))[_0x5293('0x24')](handleError(_0xbc2e83,null));};var interaction_log=require('../../config/logger')(_0x5293('0x56'));exports['accept']=function(_0x5e0cbf,_0x16f07b,_0x59c7ff){var _0x356d2e={'agent':{},'channel':'whatsapp'};if(_0x5e0cbf[_0x5293('0x54')]['id']){delete _0x5e0cbf[_0x5293('0x54')]['id'];}_0x5e0cbf[_0x5293('0x54')]['read']=!![];_0x5e0cbf[_0x5293('0x54')][_0x5293('0x57')]=moment()[_0x5293('0x58')](_0x5293('0x59'));_0x5e0cbf['body'][_0x5293('0x5a')]=_0x5e0cbf[_0x5293('0x54')][_0x5293('0x5a')]||_0x5e0cbf['user']['id'];_0x356d2e['agent']['id']=_0x5e0cbf[_0x5293('0x54')][_0x5293('0x5a')];return db[_0x5293('0x38')][_0x5293('0x52')]({'where':{'id':_0x5e0cbf[_0x5293('0x51')]['id'],'UserId':null}})[_0x5293('0x31')](handleEntityNotFound(_0x16f07b,null))[_0x5293('0x31')](saveUpdates(_0x5e0cbf[_0x5293('0x54')],null))[_0x5293('0x31')](function(_0x551944){if(_0x551944){_0x356d2e[_0x5293('0x22')]=_0x551944['get']({'plain':!![]});return db['WhatsappInteraction'][_0x5293('0x52')]({'where':{'id':_0x551944[_0x5293('0x5b')]}});}return null;})[_0x5293('0x31')](handleEntityNotFound(_0x16f07b,null))[_0x5293('0x31')](function(_0x124dce){if(_0x124dce){return _0x124dce[_0x5293('0x30')]({'UserId':_0x5e0cbf['body'][_0x5293('0x5a')],'read1stAt':_['isNil'](_0x124dce[_0x5293('0x5c')])?moment()[_0x5293('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5293('0x31')](function(_0x4a9f31){if(_0x4a9f31){_0x356d2e[_0x5293('0x5d')]=_0x4a9f31[_0x5293('0x5e')]({'plain':!![]});interaction_log[_0x5293('0x1d')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e0cbf[_0x5293('0x5f')]['id'],_0x5e0cbf[_0x5293('0x5f')][_0x5293('0x34')],_0x5e0cbf[_0x5293('0x5f')]['role'],_0x356d2e[_0x5293('0x5d')]['id'],_0x5e0cbf[_0x5293('0x54')]?JSON[_0x5293('0x60')](_0x5e0cbf[_0x5293('0x54')]):_0x5293('0x61'));return respondWithRpcPromise(_0x5293('0x62'),_0x5293('0x63'),_0x356d2e);}return null;})['then'](function(_0x143ee5){var _0x168d05='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x143ee5[_0x5293('0x22')][_0x5293('0x64')];return db[_0x5293('0x65')]['query'](_0x168d05,{'type':db[_0x5293('0x66')][_0x5293('0x67')][_0x5293('0x68')],'raw':!![]})['then'](function(_0x2a2c8a){return _0x2a2c8a;});})[_0x5293('0x31')](function(_0x5497ed){if(_0x5497ed){_0x356d2e[_0x5293('0x22')][_0x5293('0x69')]=_0x5497ed[0x0];if(!_0x5e0cbf[_0x5293('0x54')]['UserId'])return;return db['User'][_0x5293('0x52')]({'where':{'id':_0x5e0cbf[_0x5293('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0x5293('0x34'),_0x5293('0x6a'),_0x5293('0x6b'),_0x5293('0x6c')],'raw':!![]});}return null;})[_0x5293('0x31')](function(_0x2cc1fd){if(!_0x2cc1fd)return null;_0x356d2e[_0x5293('0x22')]['agent']=_0x2cc1fd;return _0x356d2e;})[_0x5293('0x31')](function(_0x3c8c29){if(_0x3c8c29){if(_0x5e0cbf[_0x5293('0x54')][_0x5293('0x6d')]){_0x356d2e[_0x5293('0x22')][_0x5293('0x6e')]=util[_0x5293('0x58')](_0x5293('0x6f'),_0x5e0cbf[_0x5293('0x5f')][_0x5293('0x34')]);_0x356d2e['message'][_0x5293('0x70')]=_0x356d2e[_0x5293('0x70')];_0x356d2e['message'][_0x5293('0x71')]=_0x356d2e[_0x5293('0x70')];_0x356d2e[_0x5293('0x22')][_0x5293('0x72')]=_0x5293('0x73');return respondWithRpcPromise(_0x5293('0x74'),_0x5293('0x74'),{'event':_0x5293('0x75'),'message':_0x356d2e[_0x5293('0x22')]},client9002)[_0x5293('0x31')](function(){return _0x356d2e;});}return _0x356d2e;}return null;})[_0x5293('0x31')](respondWithResult(_0x16f07b,null))[_0x5293('0x24')](handleError(_0x16f07b,null));};var interaction_log=require(_0x5293('0x13'))(_0x5293('0x56'));exports['reject']=function(_0x30024a,_0x1ff409,_0x426842){var _0x376f18={'agent':{},'channel':_0x5293('0x76')};if(_0x30024a[_0x5293('0x54')]['id']){delete _0x30024a[_0x5293('0x54')]['id'];}_0x30024a[_0x5293('0x54')]['UserId']=_0x30024a['body']['UserId']||_0x30024a[_0x5293('0x5f')]['id'];_0x376f18[_0x5293('0x77')]['id']=_0x30024a[_0x5293('0x54')][_0x5293('0x5a')];return db[_0x5293('0x38')][_0x5293('0x52')]({'where':{'id':_0x30024a[_0x5293('0x51')]['id'],'UserId':null}})[_0x5293('0x31')](handleEntityNotFound(_0x1ff409,null))[_0x5293('0x31')](function(_0xcb667){if(_0xcb667){_0x376f18[_0x5293('0x22')]=_0xcb667[_0x5293('0x5e')]({'plain':!![]});return db[_0x5293('0x78')][_0x5293('0x52')]({'where':{'id':_0xcb667[_0x5293('0x5b')]}});}return null;})[_0x5293('0x31')](handleEntityNotFound(_0x1ff409,null))['then'](function(_0x425709){if(_0x425709){_0x376f18[_0x5293('0x5d')]=_0x425709[_0x5293('0x5e')]({'plain':!![]});interaction_log[_0x5293('0x1d')](_0x5293('0x79'),_0x30024a[_0x5293('0x5f')]['id'],_0x30024a[_0x5293('0x5f')]['name'],_0x30024a[_0x5293('0x5f')][_0x5293('0x7a')],_0x376f18[_0x5293('0x5d')]['id'],_0x30024a[_0x5293('0x54')]?JSON['stringify'](_0x30024a['body']):_0x5293('0x61'));return respondWithRpcPromise(_0x5293('0x7b'),_0x5293('0x7c'),_0x376f18);}return null;})[_0x5293('0x31')](function(_0x2f381e){var _0x553e24=_0x5293('0x7d')+_0x2f381e[_0x5293('0x22')][_0x5293('0x64')];return db[_0x5293('0x65')]['query'](_0x553e24,{'type':db[_0x5293('0x66')][_0x5293('0x67')][_0x5293('0x68')],'raw':!![]})[_0x5293('0x31')](function(_0x248c62){return _0x248c62;});})['then'](function(_0x560aeb){if(_0x560aeb){_0x376f18[_0x5293('0x22')][_0x5293('0x69')]=_0x560aeb[0x0];if(!_0x30024a[_0x5293('0x54')][_0x5293('0x5a')])return;return db[_0x5293('0x7e')]['find']({'where':{'id':_0x30024a[_0x5293('0x54')][_0x5293('0x5a')],'role':_0x5293('0x77')},'attributes':['id',_0x5293('0x34'),_0x5293('0x6a'),_0x5293('0x6b'),_0x5293('0x6c')],'raw':!![]});}return null;})[_0x5293('0x31')](function(_0x2e49d2){if(!_0x2e49d2)return null;_0x376f18[_0x5293('0x22')][_0x5293('0x77')]=_0x2e49d2;return _0x376f18;})[_0x5293('0x31')](function(_0x36c3d2){if(_0x36c3d2){_0x36c3d2[_0x5293('0x22')][_0x5293('0x6e')]=util[_0x5293('0x58')]('SIP/%s',_0x30024a[_0x5293('0x5f')][_0x5293('0x34')]);_0x36c3d2[_0x5293('0x22')][_0x5293('0x70')]=_0x376f18[_0x5293('0x70')];_0x36c3d2['message'][_0x5293('0x71')]=_0x376f18[_0x5293('0x70')];_0x36c3d2[_0x5293('0x22')]['event']=_0x5293('0x7f');respondWithRpcPromise(_0x5293('0x74'),_0x5293('0x74'),{'event':_0x5293('0x80'),'message':_0x36c3d2[_0x5293('0x22')]},client9002);return _0x376f18;}return null;})['then'](respondWithResult(_0x1ff409,null))[_0x5293('0x24')](handleError(_0x1ff409,null));};exports[_0x5293('0x26')]=function(_0x5d3845,_0x100755,_0xf69a47){if(_0x5d3845['body']['id']){delete _0x5d3845[_0x5293('0x54')]['id'];}var _0x3d9843;return db[_0x5293('0x38')][_0x5293('0x52')]({'where':{'id':_0x5d3845[_0x5293('0x51')]['id']}})[_0x5293('0x31')](handleEntityNotFound(_0x100755,null))[_0x5293('0x31')](function(_0x3e2349){if(_0x3e2349){_0x3d9843=_0x3e2349;return db[_0x5293('0x81')][_0x5293('0x52')]({'where':{'id':_0x3e2349[_0x5293('0x82')]}});}})[_0x5293('0x31')](handleEntityNotFound(_0x100755,null))[_0x5293('0x31')](function(_0x1ca176){if(_0x1ca176){logger['debug'](_0x5293('0x83'),_0x5293('0x26'),_0x5293('0x84'),_0x1ca176[_0x5293('0x3a')],util[_0x5293('0x85')](_0x5d3845[_0x5293('0x54')],{'showHidden':![],'depth':null}));switch(_0x1ca176[_0x5293('0x3a')]){case _0x5293('0x86'):if(_0x5d3845[_0x5293('0x54')][_0x5293('0x87')]&&_0x5d3845[_0x5293('0x54')][_0x5293('0x87')]===_0x3d9843['messageId']&&_0x5d3845[_0x5293('0x54')][_0x5293('0x88')]&&_0x5d3845[_0x5293('0x54')][_0x5293('0x88')]===_0x5293('0x89')){return _0x3d9843[_0x5293('0x30')]({'read':!![]});}else{logger['error'](_0x5293('0x8a'),_0x5293('0x26'),'twilio',util[_0x5293('0x85')](_0x5d3845[_0x5293('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x3d9843;}})[_0x5293('0x31')](respondWithResult(_0x100755,null))[_0x5293('0x24')](handleError(_0x100755,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index cafa29b..03a5af6 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e6b=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x39d473,_0x473ba4){var _0x3b016e=function(_0x422a17){while(--_0x422a17){_0x39d473['push'](_0x39d473['shift']());}};_0x3b016e(++_0x473ba4);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9e6b[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xb9e6('0x0'));var WhatsappMessage=require(_0xb9e6('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb9e6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb9e6('0x3')};function emitEvent(_0x6fcb00){return function(_0xb74c07,_0x214661,_0x47fc84){WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00+':'+_0xb74c07['id'],_0xb74c07);WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00,_0xb74c07);_0x47fc84(null);};}for(var e in events){if(events[_0xb9e6('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb9e6('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7af2=['hook','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x11f7a0,_0x38103b){var _0x839f2=function(_0x335cb5){while(--_0x335cb5){_0x11f7a0['push'](_0x11f7a0['shift']());}};_0x839f2(++_0x38103b);}(_0x7af2,0x119));var _0x27af=function(_0x566216,_0x3c6aed){_0x566216=_0x566216-0x0;var _0x1bcf97=_0x7af2[_0x566216];return _0x1bcf97;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x27af('0x0'))['db'][_0x27af('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x27af('0x2')](0x0);var events={'afterCreate':_0x27af('0x3'),'afterUpdate':'update','afterDestroy':_0x27af('0x4')};function emitEvent(_0x1067e7){return function(_0x709cb6,_0x2a542f,_0x22ae46){WhatsappMessageEvents[_0x27af('0x5')](_0x1067e7+':'+_0x709cb6['id'],_0x709cb6);WhatsappMessageEvents[_0x27af('0x5')](_0x1067e7,_0x709cb6);_0x22ae46(null);};}for(var e in events){if(events[_0x27af('0x6')](e)){var event=events[e];WhatsappMessage[_0x27af('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index d384194..c5d2c86 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf278=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid'];(function(_0x27773e,_0x1fb5bd){var _0x24895c=function(_0x2c240d){while(--_0x2c240d){_0x27773e['push'](_0x27773e['shift']());}};_0x24895c(++_0x1fb5bd);}(_0xf278,0xc8));var _0x8f27=function(_0xb89931,_0x461b9e){_0xb89931=_0xb89931-0x0;var _0x324b86=_0xf278[_0xb89931];return _0x324b86;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var logger=require(_0x8f27('0x2'))(_0x8f27('0x3'));var moment=require('moment');var BPromise=require(_0x8f27('0x4'));var rp=require('request-promise');var fetch=require(_0x8f27('0x5'));var fs=require('fs');var path=require(_0x8f27('0x6'));var rimraf=require(_0x8f27('0x7'));var config=require(_0x8f27('0x8'));var attributes=require(_0x8f27('0x9'));module['exports']=function(_0x22fd26,_0x4bc2f0){return _0x22fd26[_0x8f27('0xa')]('WhatsappMessage',attributes,{'tableName':_0x8f27('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x8f27('0xc'),'fields':[_0x8f27('0xd')],'type':_0x8f27('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b5862,_0x14d0f7,_0x43a06f){var _0x1a7f9e=_0x22fd26['models'];var _0x48a8a8=_0x1b5862[_0x8f27('0xf')]({'plain':!![]});if(_0x48a8a8[_0x8f27('0x10')][_0x8f27('0x11')]()==='in'||_0x48a8a8[_0x8f27('0x10')]['toLowerCase']()===_0x8f27('0x12')&&!_0x48a8a8[_0x8f27('0x13')]&&!_[_0x8f27('0x14')](_0x48a8a8[_0x8f27('0x15')])){_0x1a7f9e[_0x8f27('0x16')][_0x8f27('0x17')]({'where':{'id':_0x48a8a8[_0x8f27('0x18')]}})[_0x8f27('0x19')](function(_0x1802ee){if(_0x1802ee){_0x1802ee[_0x8f27('0x1a')]({'lastMsgAt':_0x48a8a8['createdAt'],'lastMsgDirection':_0x48a8a8[_0x8f27('0x10')]['toLowerCase']()});}})[_0x8f27('0x1b')](function(_0x59c3ca){console[_0x8f27('0x1c')](_0x59c3ca);});}if(_0x48a8a8[_0x8f27('0x10')]==='out'&&!_0x48a8a8['secret']){var _0x264ad9;_0x1a7f9e[_0x8f27('0x1d')][_0x8f27('0x1e')]({'where':{'id':_0x48a8a8[_0x8f27('0x1f')]},'raw':!![]})[_0x8f27('0x19')](function(_0x1cc3ef){_0x264ad9=_0x1cc3ef;if(_0x264ad9&&_0x264ad9[_0x8f27('0x20')]){switch(_0x264ad9[_0x8f27('0x20')]){case'twilio':var _0x58d025=require(_0x8f27('0x21'));if(_0x264ad9[_0x8f27('0x22')]&&_0x264ad9[_0x8f27('0x23')]&&_0x264ad9[_0x8f27('0x24')]){var _0x20ab89=new _0x58d025(_0x264ad9[_0x8f27('0x22')],_0x264ad9[_0x8f27('0x23')]);_0x20ab89[_0x8f27('0x25')][_0x8f27('0x26')]({'body':_0x48a8a8[_0x8f27('0xd')],'to':_0x8f27('0x27')+_0x48a8a8[_0x8f27('0x24')],'from':_0x8f27('0x27')+_0x264ad9[_0x8f27('0x24')],'statusCallback':_0x264ad9[_0x8f27('0x28')]+_0x8f27('0x29')+_0x48a8a8['id']+'/status?token='+_0x264ad9[_0x8f27('0x2a')]})[_0x8f27('0x19')](function(_0x5b6114){if(_0x5b6114[_0x8f27('0x2b')]){return _0x1b5862[_0x8f27('0x1a')]({'messageId':_0x5b6114[_0x8f27('0x2b')]});}})['catch'](function(_0x364167){logger['error'](_0x8f27('0x2c'),_0x8f27('0x2d'),_0x8f27('0x21'),util[_0x8f27('0x2e')](_0x364167,{'showHidden':![],'depth':null}));});}else{logger[_0x8f27('0x1c')](_0x8f27('0x2c'),_0x8f27('0x2d'),'twilio',_0x8f27('0x2f'));}break;case _0x8f27('0x30'):var _0x37ed8a=_0x264ad9['accountSid'];var _0x9773e2=_0x264ad9[_0x8f27('0x23')];var _0x54936a=_0x264ad9[_0x8f27('0x31')]+_0x8f27('0x32')+_0x37ed8a+_0x8f27('0x33');var _0x2dca43={'to':[_0x48a8a8[_0x8f27('0x24')]],'message':{'type':'text','text':_0x48a8a8[_0x8f27('0xd')]}};var _0x113711={'method':_0x8f27('0x34'),'uri':_0x54936a,'headers':{'Authorization':_0x8f27('0x35')+_0x9773e2,'Content-Type':_0x8f27('0x36')},'body':_0x2dca43,'json':!![]};rp(_0x113711)[_0x8f27('0x19')](function(_0x2081d5){if(_0x2081d5[_0x8f27('0x37')][0x0][_0x8f27('0x38')]){return _0x1b5862[_0x8f27('0x1a')]({'messageId':_0x2081d5[_0x8f27('0x37')][0x0]['message_id']});}})[_0x8f27('0x1b')](function(_0x28bb19){logger[_0x8f27('0x39')](_0x8f27('0x3a'),_0x28bb19);});break;}}})[_0x8f27('0x3b')](function(){_0x43a06f();});}else{_0x43a06f();}}},'charset':_0x8f27('0x3c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd725=['/whatsapp/v1/','/messages/','text','POST','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','update','createdAt','catch','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','body','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl'];(function(_0x33926a,_0x416fde){var _0x4fdc33=function(_0x132971){while(--_0x132971){_0x33926a['push'](_0x33926a['shift']());}};_0x4fdc33(++_0x416fde);}(_0xd725,0x1d3));var _0x5d72=function(_0x19ce28,_0x4b61f2){_0x19ce28=_0x19ce28-0x0;var _0x1a606e=_0xd725[_0x19ce28];return _0x1a606e;};'use strict';var _=require(_0x5d72('0x0'));var util=require(_0x5d72('0x1'));var logger=require('../../config/logger')(_0x5d72('0x2'));var moment=require(_0x5d72('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d72('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x5d72('0x5'));var rimraf=require('rimraf');var config=require(_0x5d72('0x6'));var attributes=require(_0x5d72('0x7'));module[_0x5d72('0x8')]=function(_0x506f31,_0x2ee728){return _0x506f31[_0x5d72('0x9')]('WhatsappMessage',attributes,{'tableName':_0x5d72('0xa'),'paranoid':![],'indexes':[{'name':_0x5d72('0xb'),'fields':[_0x5d72('0xb')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x5d72('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x354fbf,_0x23aad3,_0x1cd19c){var _0x2bcd66=_0x506f31[_0x5d72('0xd')];var _0x38e6b2=_0x354fbf[_0x5d72('0xe')]({'plain':!![]});if(_0x38e6b2[_0x5d72('0xf')][_0x5d72('0x10')]()==='in'||_0x38e6b2[_0x5d72('0xf')][_0x5d72('0x10')]()==='out'&&!_0x38e6b2[_0x5d72('0x11')]&&!_[_0x5d72('0x12')](_0x38e6b2[_0x5d72('0x13')])){_0x2bcd66[_0x5d72('0x14')]['findOne']({'where':{'id':_0x38e6b2['WhatsappInteractionId']}})['then'](function(_0x10cddd){if(_0x10cddd){_0x10cddd[_0x5d72('0x15')]({'lastMsgAt':_0x38e6b2[_0x5d72('0x16')],'lastMsgDirection':_0x38e6b2[_0x5d72('0xf')]['toLowerCase']()});}})[_0x5d72('0x17')](function(_0x25e14c){console[_0x5d72('0x18')](_0x25e14c);});}if(_0x38e6b2[_0x5d72('0xf')]==='out'&&!_0x38e6b2[_0x5d72('0x11')]){var _0x2c1ab3;_0x2bcd66['WhatsappAccount'][_0x5d72('0x19')]({'where':{'id':_0x38e6b2[_0x5d72('0x1a')]},'raw':!![]})[_0x5d72('0x1b')](function(_0x1cba8d){_0x2c1ab3=_0x1cba8d;if(_0x2c1ab3&&_0x2c1ab3[_0x5d72('0x1c')]){switch(_0x2c1ab3[_0x5d72('0x1c')]){case _0x5d72('0x1d'):var _0x19e107=require(_0x5d72('0x1d'));if(_0x2c1ab3['accountSid']&&_0x2c1ab3['authToken']&&_0x2c1ab3['phone']){var _0x3b9fde=new _0x19e107(_0x2c1ab3[_0x5d72('0x1e')],_0x2c1ab3[_0x5d72('0x1f')]);_0x3b9fde[_0x5d72('0x20')][_0x5d72('0x21')]({'body':_0x38e6b2[_0x5d72('0x22')],'to':'whatsapp:'+_0x38e6b2[_0x5d72('0x23')],'from':_0x5d72('0x24')+_0x2c1ab3[_0x5d72('0x23')],'statusCallback':_0x2c1ab3[_0x5d72('0x25')]+_0x5d72('0x26')+_0x38e6b2['id']+_0x5d72('0x27')+_0x2c1ab3[_0x5d72('0x28')]})[_0x5d72('0x1b')](function(_0x1b2c3d){if(_0x1b2c3d['sid']){return _0x354fbf['update']({'messageId':_0x1b2c3d['sid']});}})[_0x5d72('0x17')](function(_0xdb4429){logger['error'](_0x5d72('0x29'),_0x5d72('0x2a'),_0x5d72('0x1d'),util[_0x5d72('0x2b')](_0xdb4429,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5d72('0x29'),_0x5d72('0x2a'),_0x5d72('0x1d'),_0x5d72('0x2c'));}break;case'sinch':var _0x2f4776=_0x2c1ab3['accountSid'];var _0x82d9d2=_0x2c1ab3[_0x5d72('0x1f')];var _0x2c583d=_0x2c1ab3[_0x5d72('0x2d')]+_0x5d72('0x2e')+_0x2f4776+_0x5d72('0x2f');var _0x43a1a6={'to':[_0x38e6b2['phone']],'message':{'type':_0x5d72('0x30'),'text':_0x38e6b2['body']}};var _0x3dfb7d={'method':_0x5d72('0x31'),'uri':_0x2c583d,'headers':{'Authorization':'Bearer\x20'+_0x82d9d2,'Content-Type':'application/json'},'body':_0x43a1a6,'json':!![]};rp(_0x3dfb7d)[_0x5d72('0x1b')](function(_0x10ee8e){if(_0x10ee8e[_0x5d72('0x32')][0x0][_0x5d72('0x33')]){return _0x354fbf[_0x5d72('0x15')]({'messageId':_0x10ee8e[_0x5d72('0x32')][0x0][_0x5d72('0x33')]});}})[_0x5d72('0x17')](function(_0x4f4c54){logger[_0x5d72('0x34')](_0x5d72('0x35'),_0x4f4c54);});break;}}})[_0x5d72('0x36')](function(){_0x1cd19c();});}else{_0x1cd19c();}}},'charset':_0x5d72('0x37'),'collate':_0x5d72('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 620cc31..f2d42a5 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b6e=['CreateWhatsappMessage','WhatsappMessage','body','options','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2cb5ca,_0x653e5b){var _0x179732=function(_0x17af40){while(--_0x17af40){_0x2cb5ca['push'](_0x2cb5ca['shift']());}};_0x179732(++_0x653e5b);}(_0x0b6e,0xa6));var _0xe0b6=function(_0x1269a0,_0x4c3241){_0x1269a0=_0x1269a0-0x0;var _0x41d41f=_0x0b6e[_0x1269a0];return _0x41d41f;};'use strict';var _=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var moment=require('moment');var BPromise=require(_0xe0b6('0x2'));var rs=require(_0xe0b6('0x3'));var fs=require('fs');var Redis=require(_0xe0b6('0x4'));var db=require(_0xe0b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0b6('0x6'))(_0xe0b6('0x7'));var config=require(_0xe0b6('0x8'));var jayson=require(_0xe0b6('0x9'));var client=jayson[_0xe0b6('0xa')][_0xe0b6('0xb')]({'port':0x232a});config[_0xe0b6('0xc')]=_['defaults'](config[_0xe0b6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b6('0xd'))(new Redis(config[_0xe0b6('0xc')]));require('./whatsappMessage.socket')[_0xe0b6('0xe')](socket);function respondWithRpcPromise(_0x1eeeb9,_0x813ff8,_0x296275){return new BPromise(function(_0x41a303,_0x3d964e){return client[_0xe0b6('0xf')](_0x1eeeb9,_0x296275)['then'](function(_0x5837d4){logger[_0xe0b6('0x10')](_0xe0b6('0x11'),_0x813ff8,_0xe0b6('0x12'));logger[_0xe0b6('0x13')](_0xe0b6('0x14'),_0x813ff8,'request\x20sent',JSON[_0xe0b6('0x15')](_0x5837d4));if(_0x5837d4[_0xe0b6('0x16')]){if(_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x17')]===0x1f4){logger[_0xe0b6('0x16')](_0xe0b6('0x11'),_0x813ff8,_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);return _0x3d964e(_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);}logger['error'](_0xe0b6('0x11'),_0x813ff8,_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);return _0x41a303(_0x5837d4[_0xe0b6('0x16')][_0xe0b6('0x18')]);}else{logger[_0xe0b6('0x10')](_0xe0b6('0x11'),_0x813ff8,_0xe0b6('0x12'));_0x41a303(_0x5837d4['result']['message']);}})[_0xe0b6('0x19')](function(_0x423b98){logger[_0xe0b6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x813ff8,_0x423b98);_0x3d964e(_0x423b98);});});}exports[_0xe0b6('0x1a')]=function(_0x2a6ed3){var _0x5ef0e2=this;return new Promise(function(_0x32267a,_0x430267){return db[_0xe0b6('0x1b')]['create'](_0x2a6ed3[_0xe0b6('0x1c')],{'raw':_0x2a6ed3[_0xe0b6('0x1d')]?_0x2a6ed3['options'][_0xe0b6('0x1e')]===undefined?!![]:![]:!![]})[_0xe0b6('0x1f')](function(_0x3683b4){logger[_0xe0b6('0x10')](_0xe0b6('0x1a'),_0x2a6ed3);logger[_0xe0b6('0x13')](_0xe0b6('0x1a'),_0x2a6ed3,JSON[_0xe0b6('0x15')](_0x3683b4));_0x32267a(_0x3683b4);})[_0xe0b6('0x19')](function(_0x34cc59){logger[_0xe0b6('0x16')](_0xe0b6('0x1a'),_0x34cc59[_0xe0b6('0x18')],_0x2a6ed3);_0x430267(_0x5ef0e2[_0xe0b6('0x16')](0x1f4,_0x34cc59[_0xe0b6('0x18')]));});});}; \ No newline at end of file +var _0x69b5=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','WhatsappMessage','create','options','raw','CreateWhatsappMessage','lodash','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','defaults','localhost','./whatsappMessage.socket','register','request','then'];(function(_0x2f7bd6,_0x3269ed){var _0x2af7d0=function(_0x1ed1b2){while(--_0x1ed1b2){_0x2f7bd6['push'](_0x2f7bd6['shift']());}};_0x2af7d0(++_0x3269ed);}(_0x69b5,0x14e));var _0x569b=function(_0x56f972,_0x49b459){_0x56f972=_0x56f972-0x0;var _0xf415ef=_0x69b5[_0x56f972];return _0xf415ef;};'use strict';var _=require(_0x569b('0x0'));var util=require('util');var moment=require(_0x569b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x569b('0x2'));var db=require(_0x569b('0x3'))['db'];var utils=require(_0x569b('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x569b('0x5'));var client=jayson[_0x569b('0x6')]['http']({'port':0x232a});config[_0x569b('0x7')]=_[_0x569b('0x8')](config[_0x569b('0x7')],{'host':_0x569b('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x569b('0x7')]));require(_0x569b('0xa'))[_0x569b('0xb')](socket);function respondWithRpcPromise(_0x413dc0,_0x48c567,_0x2b88be){return new BPromise(function(_0x103ea0,_0x4069cc){return client[_0x569b('0xc')](_0x413dc0,_0x2b88be)[_0x569b('0xd')](function(_0x419c46){logger['info'](_0x569b('0xe'),_0x48c567,_0x569b('0xf'));logger[_0x569b('0x10')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x48c567,'request\x20sent',JSON[_0x569b('0x11')](_0x419c46));if(_0x419c46[_0x569b('0x12')]){if(_0x419c46[_0x569b('0x12')][_0x569b('0x13')]===0x1f4){logger[_0x569b('0x12')](_0x569b('0xe'),_0x48c567,_0x419c46[_0x569b('0x12')][_0x569b('0x14')]);return _0x4069cc(_0x419c46[_0x569b('0x12')][_0x569b('0x14')]);}logger[_0x569b('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x48c567,_0x419c46[_0x569b('0x12')][_0x569b('0x14')]);return _0x103ea0(_0x419c46[_0x569b('0x12')][_0x569b('0x14')]);}else{logger[_0x569b('0x15')](_0x569b('0xe'),_0x48c567,'request\x20sent');_0x103ea0(_0x419c46[_0x569b('0x16')][_0x569b('0x14')]);}})[_0x569b('0x17')](function(_0x55a9be){logger[_0x569b('0x12')](_0x569b('0xe'),_0x48c567,_0x55a9be);_0x4069cc(_0x55a9be);});});}exports['CreateWhatsappMessage']=function(_0x598362){var _0x54fd34=this;return new Promise(function(_0x4033cd,_0x17b030){return db[_0x569b('0x18')][_0x569b('0x19')](_0x598362['body'],{'raw':_0x598362['options']?_0x598362[_0x569b('0x1a')][_0x569b('0x1b')]===undefined?!![]:![]:!![]})[_0x569b('0xd')](function(_0x41993){logger['info'](_0x569b('0x1c'),_0x598362);logger[_0x569b('0x10')](_0x569b('0x1c'),_0x598362,JSON['stringify'](_0x41993));_0x4033cd(_0x41993);})['catch'](function(_0x56c3c1){logger[_0x569b('0x12')]('CreateWhatsappMessage',_0x56c3c1['message'],_0x598362);_0x17b030(_0x54fd34[_0x569b('0x12')](0x1f4,_0x56c3c1[_0x569b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 4da1ee4..ba54b17 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ad8=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x7ad8,0x94));var _0x87ad=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x7ad8[_0x112fe3];return _0x1ec903;};'use strict';var WhatsappMessageEvents=require(_0x87ad('0x0'));var events=[_0x87ad('0x1'),_0x87ad('0x2'),_0x87ad('0x3')];function createListener(_0x599ee0,_0x16ffc0){return function(_0x291cfd){_0x16ffc0[_0x87ad('0x4')](_0x599ee0,_0x291cfd);};}function removeListener(_0xba779f,_0x1489b0){return function(){WhatsappMessageEvents[_0x87ad('0x5')](_0xba779f,_0x1489b0);};}exports[_0x87ad('0x6')]=function(_0x34bece){for(var _0x1cac5c=0x0,_0x1a1c61=events[_0x87ad('0x7')];_0x1cac5c<_0x1a1c61;_0x1cac5c++){var _0x2bde0c=events[_0x1cac5c];var _0x562e4f=createListener(_0x87ad('0x8')+_0x2bde0c,_0x34bece);WhatsappMessageEvents['on'](_0x2bde0c,_0x562e4f);}}; \ No newline at end of file +var _0x534c=['removeListener','whatsappMessage:','save','update','emit'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0x534c,0x8e));var _0xc534=function(_0x4f1e87,_0x63ed22){_0x4f1e87=_0x4f1e87-0x0;var _0x14a8f7=_0x534c[_0x4f1e87];return _0x14a8f7;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xc534('0x0'),'remove',_0xc534('0x1')];function createListener(_0x277ec4,_0x4b0a81){return function(_0x4f6e0f){_0x4b0a81[_0xc534('0x2')](_0x277ec4,_0x4f6e0f);};}function removeListener(_0x105dc9,_0x3936b6){return function(){WhatsappMessageEvents[_0xc534('0x3')](_0x105dc9,_0x3936b6);};}exports['register']=function(_0x26cbdf){for(var _0x269042=0x0,_0x4676ab=events['length'];_0x269042<_0x4676ab;_0x269042++){var _0x44e412=events[_0x269042];var _0x28b681=createListener(_0xc534('0x4')+_0x44e412,_0x26cbdf);WhatsappMessageEvents['on'](_0x44e412,_0x28b681);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3cd1a48..19de897 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab40=['/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0xb5e13a,_0x48d409){var _0x6756ad=function(_0x30ef30){while(--_0x30ef30){_0xb5e13a['push'](_0xb5e13a['shift']());}};_0x6756ad(++_0x48d409);}(_0xab40,0x193));var _0x0ab4=function(_0x5bac95,_0x13063f){_0x5bac95=_0x5bac95-0x0;var _0x11a942=_0xab40[_0x5bac95];return _0x11a942;};'use strict';var multer=require('multer');var util=require(_0x0ab4('0x0'));var path=require(_0x0ab4('0x1'));var timeout=require(_0x0ab4('0x2'));var express=require(_0x0ab4('0x3'));var router=express[_0x0ab4('0x4')]();var fs_extra=require(_0x0ab4('0x5'));var auth=require(_0x0ab4('0x6'));var interaction=require(_0x0ab4('0x7'));var config=require('../../config/environment');var controller=require(_0x0ab4('0x8'));router[_0x0ab4('0x9')]('/',auth['isAuthenticated'](),controller[_0x0ab4('0xa')]);router[_0x0ab4('0x9')]('/describe',auth[_0x0ab4('0xb')](),controller[_0x0ab4('0xc')]);router[_0x0ab4('0x9')](_0x0ab4('0xd'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0xe')]);router[_0x0ab4('0x9')](_0x0ab4('0xf'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x10')]);router[_0x0ab4('0x9')](_0x0ab4('0x11'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x12')]);router['get'](_0x0ab4('0x13'),auth[_0x0ab4('0xb')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0ab4('0x14')]);router[_0x0ab4('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0ab4('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x0ab4('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0ab4('0x18')](_0x0ab4('0xd'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x19')]);router[_0x0ab4('0x18')](_0x0ab4('0x11'),auth[_0x0ab4('0xb')](),controller['removeTeams']);router[_0x0ab4('0x18')](_0x0ab4('0x13'),auth[_0x0ab4('0xb')](),controller[_0x0ab4('0x1a')]);module[_0x0ab4('0x1b')]=router; \ No newline at end of file +var _0x88f2=['/:id','isAuthenticated','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','describe'];(function(_0x5288e9,_0xc1ed3c){var _0x2d8f10=function(_0x53010e){while(--_0x53010e){_0x5288e9['push'](_0x5288e9['shift']());}};_0x2d8f10(++_0xc1ed3c);}(_0x88f2,0xbf));var _0x288f=function(_0x4c5bb8,_0x51434f){_0x4c5bb8=_0x4c5bb8-0x0;var _0x50d863=_0x88f2[_0x4c5bb8];return _0x50d863;};'use strict';var multer=require('multer');var util=require(_0x288f('0x0'));var path=require(_0x288f('0x1'));var timeout=require(_0x288f('0x2'));var express=require(_0x288f('0x3'));var router=express[_0x288f('0x4')]();var fs_extra=require(_0x288f('0x5'));var auth=require(_0x288f('0x6'));var interaction=require(_0x288f('0x7'));var config=require(_0x288f('0x8'));var controller=require(_0x288f('0x9'));router[_0x288f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x288f('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x288f('0xb')]);router[_0x288f('0xa')](_0x288f('0xc'),auth[_0x288f('0xd')](),controller[_0x288f('0xe')]);router[_0x288f('0xa')](_0x288f('0xf'),auth['isAuthenticated'](),controller[_0x288f('0x10')]);router[_0x288f('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0x288f('0x11')]);router['get'](_0x288f('0x12'),auth[_0x288f('0xd')](),controller['getAgents']);router[_0x288f('0x13')]('/',auth['isAuthenticated'](),controller[_0x288f('0x14')]);router[_0x288f('0x13')](_0x288f('0x15'),auth[_0x288f('0xd')](),controller[_0x288f('0x16')]);router[_0x288f('0x13')](_0x288f('0x12'),auth[_0x288f('0xd')](),controller[_0x288f('0x17')]);router[_0x288f('0x18')]('/:id',auth[_0x288f('0xd')](),controller[_0x288f('0x19')]);router[_0x288f('0x1a')](_0x288f('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth[_0x288f('0xd')](),controller[_0x288f('0x1b')]);router[_0x288f('0x1a')](_0x288f('0x12'),auth[_0x288f('0xd')](),controller['removeAgents']);module[_0x288f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 653891b..3aa61ae 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcffe=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x303f58,_0x5ad7a3){var _0x21d600=function(_0x87d964){while(--_0x87d964){_0x303f58['push'](_0x303f58['shift']());}};_0x21d600(++_0x5ad7a3);}(_0xcffe,0x1a1));var _0xecff=function(_0x480cca,_0x33709f){_0x480cca=_0x480cca-0x0;var _0x22bcdb=_0xcffe[_0x480cca];return _0x22bcdb;};'use strict';var Sequelize=require(_0xecff('0x0'));module[_0xecff('0x1')]={'name':{'type':Sequelize[_0xecff('0x2')],'unique':_0xecff('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xecff('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xecff('0x5')](_0xecff('0x6'),_0xecff('0x7'),_0xecff('0x8'))},'description':{'type':Sequelize[_0xecff('0x2')]}}; \ No newline at end of file +var _0x878f=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x4cd685,_0x472697){var _0x37743e=function(_0x238ec8){while(--_0x238ec8){_0x4cd685['push'](_0x4cd685['shift']());}};_0x37743e(++_0x472697);}(_0x878f,0x173));var _0xf878=function(_0x22444e,_0x29ed9e){_0x22444e=_0x22444e-0x0;var _0x1cf13e=_0x878f[_0x22444e];return _0x1cf13e;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'name':{'type':Sequelize[_0xf878('0x1')],'unique':_0xf878('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf878('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf878('0x4')](_0xf878('0x5'),_0xf878('0x6'),_0xf878('0x7'))},'description':{'type':Sequelize[_0xf878('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 5e7aaa0..8aa48b5 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a83=['createdAt','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','WhatsappQueues','end','stack','name','send','index','map','rawAttributes','type','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','WhatsappQueue','include','findAll','catch','show','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','getMembers','findOne','params','WhatsappQueueId','options','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','SIP'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3a83,0x151));var _0x33a8=function(_0x12fef0,_0x2970df){_0x12fef0=_0x12fef0-0x0;var _0x33b4ea=_0x3a83[_0x12fef0];return _0x33b4ea;};'use strict';var emlformat=require(_0x33a8('0x0'));var rimraf=require(_0x33a8('0x1'));var zipdir=require(_0x33a8('0x2'));var jsonpatch=require(_0x33a8('0x3'));var rp=require(_0x33a8('0x4'));var moment=require(_0x33a8('0x5'));var BPromise=require(_0x33a8('0x6'));var Mustache=require('mustache');var util=require(_0x33a8('0x7'));var path=require(_0x33a8('0x8'));var sox=require(_0x33a8('0x9'));var csv=require('to-csv');var ejs=require(_0x33a8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33a8('0xb'));var squel=require(_0x33a8('0xc'));var crypto=require('crypto');var jsforce=require(_0x33a8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x33a8('0xe'));var querystring=require(_0x33a8('0xf'));var Papa=require('papaparse');var Redis=require(_0x33a8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33a8('0x11'));var as=require(_0x33a8('0x12'));var hardwareService=require(_0x33a8('0x13'));var logger=require(_0x33a8('0x14'))(_0x33a8('0x15'));var utils=require(_0x33a8('0x16'));var config=require(_0x33a8('0x17'));var licenseUtil=require(_0x33a8('0x18'));var db=require(_0x33a8('0x19'))['db'];config[_0x33a8('0x1a')]=_[_0x33a8('0x1b')](config[_0x33a8('0x1a')],{'host':_0x33a8('0x1c'),'port':0x18eb});var socket=require(_0x33a8('0x1d'))(new Redis(config['redis']));require(_0x33a8('0x1e'))[_0x33a8('0x1f')](socket);function respondWithStatusCode(_0x103369,_0x50139a){_0x50139a=_0x50139a||0xcc;return function(_0x11e616){if(_0x11e616){return _0x103369[_0x33a8('0x20')](_0x50139a);}return _0x103369[_0x33a8('0x21')](_0x50139a)['end']();};}function respondWithResult(_0x215ca0,_0x20054e){_0x20054e=_0x20054e||0xc8;return function(_0x11bc74){if(_0x11bc74){return _0x215ca0['status'](_0x20054e)['json'](_0x11bc74);}};}function respondWithFilteredResult(_0x4fd435,_0x1e3803){return function(_0xd6901){if(_0xd6901){var _0x192a89=typeof _0x1e3803[_0x33a8('0x22')]===_0x33a8('0x23')&&typeof _0x1e3803['limit']==='undefined';var _0x189bd2=_0xd6901[_0x33a8('0x24')];var _0x1202aa=_0x192a89?0x0:_0x1e3803[_0x33a8('0x22')];var _0x47fea4=_0x192a89?_0xd6901[_0x33a8('0x24')]:_0x1e3803['offset']+_0x1e3803[_0x33a8('0x25')];var _0x39b6eb;if(_0x47fea4>=_0x189bd2){_0x47fea4=_0x189bd2;_0x39b6eb=0xc8;}else{_0x39b6eb=0xce;}_0x4fd435[_0x33a8('0x21')](_0x39b6eb);return _0x4fd435[_0x33a8('0x26')](_0x33a8('0x27'),_0x1202aa+'-'+_0x47fea4+'/'+_0x189bd2)[_0x33a8('0x28')](_0xd6901);}return null;};}function patchUpdates(_0x49fb64){return function(_0x13ddff){try{jsonpatch['apply'](_0x13ddff,_0x49fb64,!![]);}catch(_0x5927fb){return BPromise[_0x33a8('0x29')](_0x5927fb);}return _0x13ddff[_0x33a8('0x2a')]();};}function saveUpdates(_0x156342,_0x109974){return function(_0x4f1428){if(_0x4f1428){return _0x4f1428[_0x33a8('0x2b')](_0x156342)[_0x33a8('0x2c')](function(_0x1abcdb){return _0x1abcdb;});}return null;};}function removeEntity(_0x117d3e,_0x170102){return function(_0x1a90be){if(_0x1a90be){return _0x1a90be[_0x33a8('0x2d')]()[_0x33a8('0x2c')](function(){var _0x2ce8e3=_0x1a90be['get']({'plain':!![]});var _0x16b9d9=_0x33a8('0x2e');return db['UserProfileResource'][_0x33a8('0x2d')]({'where':{'type':_0x16b9d9,'resourceId':_0x2ce8e3['id']}})['then'](function(){return _0x1a90be;});})[_0x33a8('0x2c')](function(){_0x117d3e[_0x33a8('0x21')](0xcc)[_0x33a8('0x2f')]();});}};}function handleEntityNotFound(_0x549d78,_0x4c1b21){return function(_0x4b16c8){if(!_0x4b16c8){_0x549d78['sendStatus'](0x194);}return _0x4b16c8;};}function handleError(_0x2aeb4c,_0x51caf8){_0x51caf8=_0x51caf8||0x1f4;return function(_0x466fb7){logger['error'](_0x466fb7[_0x33a8('0x30')]);if(_0x466fb7['name']){delete _0x466fb7[_0x33a8('0x31')];}_0x2aeb4c[_0x33a8('0x21')](_0x51caf8)[_0x33a8('0x32')](_0x466fb7);};}exports[_0x33a8('0x33')]=function(_0x3e9ec9,_0x65e4fd){var _0x479706={},_0x737dc6={},_0x5629b6={'count':0x0,'rows':[]};var _0x443793=_[_0x33a8('0x34')](db['WhatsappQueue'][_0x33a8('0x35')],function(_0x4066a9){return{'name':_0x4066a9['fieldName'],'type':_0x4066a9[_0x33a8('0x36')]['key']};});_0x737dc6['model']=_[_0x33a8('0x34')](_0x443793,_0x33a8('0x31'));_0x737dc6['query']=_[_0x33a8('0x37')](_0x3e9ec9['query']);_0x737dc6['filters']=_[_0x33a8('0x38')](_0x737dc6[_0x33a8('0x39')],_0x737dc6[_0x33a8('0x3a')]);_0x479706[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x737dc6[_0x33a8('0x39')],qs[_0x33a8('0x3c')](_0x3e9ec9['query'][_0x33a8('0x3c')]));_0x479706[_0x33a8('0x3b')]=_0x479706['attributes'][_0x33a8('0x3d')]?_0x479706['attributes']:_0x737dc6[_0x33a8('0x39')];if(!_0x3e9ec9['query'][_0x33a8('0x3e')](_0x33a8('0x3f'))){_0x479706[_0x33a8('0x25')]=qs['limit'](_0x3e9ec9[_0x33a8('0x3a')]['limit']);_0x479706['offset']=qs['offset'](_0x3e9ec9[_0x33a8('0x3a')][_0x33a8('0x22')]);}_0x479706[_0x33a8('0x40')]=qs[_0x33a8('0x41')](_0x3e9ec9[_0x33a8('0x3a')][_0x33a8('0x41')]);_0x479706['where']=qs[_0x33a8('0x42')](_[_0x33a8('0x43')](_0x3e9ec9['query'],_0x737dc6[_0x33a8('0x42')]),_0x443793);if(_0x3e9ec9['query'][_0x33a8('0x44')]){_0x479706[_0x33a8('0x45')]=_[_0x33a8('0x46')](_0x479706[_0x33a8('0x45')],{'$or':_['map'](_0x443793,function(_0x25f5be){if(_0x25f5be[_0x33a8('0x36')]!==_0x33a8('0x47')){var _0x4860f7={};_0x4860f7[_0x25f5be[_0x33a8('0x31')]]={'$like':'%'+_0x3e9ec9[_0x33a8('0x3a')][_0x33a8('0x44')]+'%'};return _0x4860f7;}})});}_0x479706=_['merge']({},_0x479706,_0x3e9ec9['options']);var _0x3e0aee={'where':_0x479706[_0x33a8('0x45')]};return db[_0x33a8('0x48')][_0x33a8('0x24')](_0x3e0aee)[_0x33a8('0x2c')](function(_0x3aa8fb){_0x5629b6['count']=_0x3aa8fb;if(_0x3e9ec9[_0x33a8('0x3a')]['includeAll']){_0x479706[_0x33a8('0x49')]=[{'all':!![]}];}return db[_0x33a8('0x48')][_0x33a8('0x4a')](_0x479706);})['then'](function(_0x5f2865){_0x5629b6['rows']=_0x5f2865;return _0x5629b6;})[_0x33a8('0x2c')](respondWithFilteredResult(_0x65e4fd,_0x479706))[_0x33a8('0x4b')](handleError(_0x65e4fd,null));};exports[_0x33a8('0x4c')]=function(_0x1deaca,_0x27c2f3){var _0x51210c={'raw':!![],'where':{'id':_0x1deaca['params']['id']}},_0x5c8140={};_0x5c8140['model']=_[_0x33a8('0x37')](db['WhatsappQueue'][_0x33a8('0x35')]);_0x5c8140['query']=_[_0x33a8('0x37')](_0x1deaca[_0x33a8('0x3a')]);_0x5c8140[_0x33a8('0x42')]=_['intersection'](_0x5c8140[_0x33a8('0x39')],_0x5c8140[_0x33a8('0x3a')]);_0x51210c[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x5c8140[_0x33a8('0x39')],qs[_0x33a8('0x3c')](_0x1deaca[_0x33a8('0x3a')][_0x33a8('0x3c')]));_0x51210c[_0x33a8('0x3b')]=_0x51210c[_0x33a8('0x3b')][_0x33a8('0x3d')]?_0x51210c[_0x33a8('0x3b')]:_0x5c8140[_0x33a8('0x39')];if(_0x1deaca[_0x33a8('0x3a')][_0x33a8('0x4d')]){_0x51210c['include']=[{'all':!![]}];}_0x51210c=_[_0x33a8('0x46')]({},_0x51210c,_0x1deaca['options']);return db['WhatsappQueue'][_0x33a8('0x4e')](_0x51210c)[_0x33a8('0x2c')](handleEntityNotFound(_0x27c2f3,null))[_0x33a8('0x2c')](respondWithResult(_0x27c2f3,null))['catch'](handleError(_0x27c2f3,null));};exports[_0x33a8('0x4f')]=function(_0x3b1a00,_0x501622){return db[_0x33a8('0x48')][_0x33a8('0x4f')](_0x3b1a00[_0x33a8('0x50')],{})[_0x33a8('0x2c')](function(_0x255dd1){var _0x119ea2=_0x3b1a00[_0x33a8('0x51')][_0x33a8('0x52')]({'plain':!![]});if(!_0x119ea2)throw new Error(_0x33a8('0x53'));if(_0x119ea2[_0x33a8('0x54')]===_0x33a8('0x51')){var _0x23fa3c=_0x255dd1['get']({'plain':!![]});var _0x2092cf=_0x33a8('0x2e');return db['UserProfileSection'][_0x33a8('0x4e')]({'where':{'name':_0x2092cf,'userProfileId':_0x119ea2[_0x33a8('0x55')]},'raw':!![]})[_0x33a8('0x2c')](function(_0x3c2d40){if(_0x3c2d40&&_0x3c2d40[_0x33a8('0x56')]===0x0){return db[_0x33a8('0x57')][_0x33a8('0x4f')]({'name':_0x23fa3c['name'],'resourceId':_0x23fa3c['id'],'type':_0x3c2d40['name'],'sectionId':_0x3c2d40['id']},{})[_0x33a8('0x2c')](function(){return _0x255dd1;});}else{return _0x255dd1;}})[_0x33a8('0x4b')](function(_0x5f04bb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f04bb);throw _0x5f04bb;});}return _0x255dd1;})['then'](respondWithResult(_0x501622,0xc9))[_0x33a8('0x4b')](handleError(_0x501622,null));};exports[_0x33a8('0x2b')]=function(_0x5dcd9e,_0x4862d2){if(_0x5dcd9e[_0x33a8('0x50')]['id']){delete _0x5dcd9e[_0x33a8('0x50')]['id'];}return db[_0x33a8('0x48')][_0x33a8('0x4e')]({'where':{'id':_0x5dcd9e['params']['id']}})['then'](handleEntityNotFound(_0x4862d2,null))['then'](saveUpdates(_0x5dcd9e[_0x33a8('0x50')],null))['then'](respondWithResult(_0x4862d2,null))[_0x33a8('0x4b')](handleError(_0x4862d2,null));};exports['destroy']=function(_0x3ac159,_0x5349cf){return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x3ac159['params']['id']}})['then'](handleEntityNotFound(_0x5349cf,null))[_0x33a8('0x2c')](removeEntity(_0x5349cf,null))[_0x33a8('0x4b')](handleError(_0x5349cf,null));};exports['describe']=function(_0x96522c,_0x1adf0f){return db[_0x33a8('0x48')]['describe']()[_0x33a8('0x2c')](respondWithResult(_0x1adf0f,null))[_0x33a8('0x4b')](handleError(_0x1adf0f,null));};exports[_0x33a8('0x58')]=function(_0x52e454,_0x5e1c9b,_0x12bdf1){var _0x1a6886={'raw':!![],'where':{}},_0x2ab208={},_0x1141ee;return db[_0x33a8('0x48')][_0x33a8('0x59')]({'where':{'id':_0x52e454[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x5e1c9b,null))[_0x33a8('0x2c')](function(_0x161414){if(_0x161414){_0x1141ee=_0x161414['get']({'plain':!![]});_0x2ab208['model']=_[_0x33a8('0x37')](db['UserWhatsappQueue'][_0x33a8('0x35')]);_0x2ab208['query']=_[_0x33a8('0x37')](_0x52e454[_0x33a8('0x3a')]);_0x2ab208[_0x33a8('0x42')]=_[_0x33a8('0x38')](_0x2ab208[_0x33a8('0x39')],_0x2ab208['query']);_0x1a6886[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x2ab208[_0x33a8('0x39')],qs[_0x33a8('0x3c')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x3c')]));_0x1a6886[_0x33a8('0x3b')]=_0x1a6886[_0x33a8('0x3b')][_0x33a8('0x3d')]?_0x1a6886[_0x33a8('0x3b')]:_0x2ab208['model'];if(!_0x52e454[_0x33a8('0x3a')][_0x33a8('0x3e')](_0x33a8('0x3f'))){_0x1a6886[_0x33a8('0x25')]=qs[_0x33a8('0x25')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x25')]);_0x1a6886[_0x33a8('0x22')]=qs[_0x33a8('0x22')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x22')]);}_0x1a6886[_0x33a8('0x40')]=qs[_0x33a8('0x41')](_0x52e454[_0x33a8('0x3a')][_0x33a8('0x41')]);_0x1a6886[_0x33a8('0x45')]=qs[_0x33a8('0x42')](_[_0x33a8('0x43')](_0x52e454[_0x33a8('0x3a')],_0x2ab208[_0x33a8('0x42')]));_0x1a6886[_0x33a8('0x45')][_0x33a8('0x5b')]=_0x161414['id'];if(_0x52e454[_0x33a8('0x3a')]['filter']){_0x1a6886[_0x33a8('0x45')]=_[_0x33a8('0x46')](_0x1a6886[_0x33a8('0x45')],{'$or':_[_0x33a8('0x34')](_0x1a6886['attributes'],function(_0x1adac8){var _0x44b77d={};_0x44b77d[_0x1adac8]={'$like':'%'+_0x52e454[_0x33a8('0x3a')][_0x33a8('0x44')]+'%'};return _0x44b77d;})});}_0x1a6886=_[_0x33a8('0x46')]({},_0x1a6886,_0x52e454[_0x33a8('0x5c')]);return db[_0x33a8('0x5d')][_0x33a8('0x4a')](_0x1a6886);}})[_0x33a8('0x2c')](function(_0x1c7368){if(_0x1c7368){return db[_0x33a8('0x5e')][_0x33a8('0x5f')]({'where':{'id':_[_0x33a8('0x34')](_0x1c7368,_0x33a8('0x60')),'role':_0x33a8('0x61')},'attributes':['id','name',_0x33a8('0x62'),_0x33a8('0x63'),'createdAt']});}})['then'](function(_0x5cefe3){if(_0x5cefe3){return{'count':_0x5cefe3[_0x33a8('0x24')],'rows':_[_0x33a8('0x34')](_0x5cefe3[_0x33a8('0x64')],function(_0x43e8c8){return{'membername':_0x43e8c8['name'],'UserId':_0x43e8c8['id'],'queue_name':_0x1141ee[_0x33a8('0x31')],'WhatsappQueueId':_0x1141ee['id'],'interface':util[_0x33a8('0x65')](_0x33a8('0x66'),_0x33a8('0x67'),_0x43e8c8[_0x33a8('0x31')]),'penalty':0x0,'paused':_0x43e8c8['whatsappPause'],'createdAt':_0x43e8c8[_0x33a8('0x68')],'updatedAt':_0x43e8c8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x33a8('0x2c')](respondWithFilteredResult(_0x5e1c9b,_0x1a6886))[_0x33a8('0x4b')](handleError(_0x5e1c9b,null));};exports[_0x33a8('0x69')]=function(_0x52dd15,_0x437ac2,_0x209892){var _0x20f157={};var _0x189f17={};var _0x8ecd4e;var _0x54c06b;return db[_0x33a8('0x48')][_0x33a8('0x59')]({'where':{'id':_0x52dd15[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x437ac2,null))['then'](function(_0x543f2a){if(_0x543f2a){_0x8ecd4e=_0x543f2a;_0x189f17[_0x33a8('0x39')]=_['keys'](db[_0x33a8('0x6a')][_0x33a8('0x35')]);_0x189f17[_0x33a8('0x3a')]=_['keys'](_0x52dd15[_0x33a8('0x3a')]);_0x189f17['filters']=_[_0x33a8('0x38')](_0x189f17[_0x33a8('0x39')],_0x189f17['query']);_0x20f157['attributes']=_[_0x33a8('0x38')](_0x189f17['model'],qs[_0x33a8('0x3c')](_0x52dd15[_0x33a8('0x3a')]['fields']));_0x20f157[_0x33a8('0x3b')]=_0x20f157['attributes'][_0x33a8('0x3d')]?_0x20f157[_0x33a8('0x3b')]:_0x189f17[_0x33a8('0x39')];_0x20f157[_0x33a8('0x40')]=qs['sort'](_0x52dd15[_0x33a8('0x3a')]['sort']);_0x20f157[_0x33a8('0x45')]=qs['filters'](_[_0x33a8('0x43')](_0x52dd15['query'],_0x189f17[_0x33a8('0x42')]));if(_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x44')]){_0x20f157[_0x33a8('0x45')]=_['merge'](_0x20f157[_0x33a8('0x45')],{'$or':_[_0x33a8('0x34')](_0x20f157[_0x33a8('0x3b')],function(_0xfe1002){var _0x59ddff={};_0x59ddff[_0xfe1002]={'$like':'%'+_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x44')]+'%'};return _0x59ddff;})});}_0x20f157=_[_0x33a8('0x46')]({},_0x20f157,_0x52dd15[_0x33a8('0x5c')]);return _0x8ecd4e[_0x33a8('0x69')](_0x20f157);}})['then'](function(_0x514df2){if(_0x514df2){_0x54c06b=_0x514df2[_0x33a8('0x3d')];if(!_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x3e')]('nolimit')){_0x20f157[_0x33a8('0x25')]=qs[_0x33a8('0x25')](_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x25')]);_0x20f157[_0x33a8('0x22')]=qs['offset'](_0x52dd15[_0x33a8('0x3a')][_0x33a8('0x22')]);}return _0x8ecd4e[_0x33a8('0x69')](_0x20f157);}})['then'](function(_0x3c1173){if(_0x3c1173){return _0x3c1173?{'count':_0x54c06b,'rows':_0x3c1173}:null;}})[_0x33a8('0x2c')](respondWithResult(_0x437ac2,null))[_0x33a8('0x4b')](handleError(_0x437ac2,null));};exports[_0x33a8('0x6b')]=function(_0x276a51,_0x26748a,_0x8b98d9){var _0x3b9deb=_0x276a51[_0x33a8('0x50')][_0x33a8('0x6c')];return db[_0x33a8('0x6a')]['findAll']({'where':{'id':_0x3b9deb},'attributes':['id'],'include':[{'model':db[_0x33a8('0x5e')],'as':'Agents','attributes':['id',_0x33a8('0x31'),'online',_0x33a8('0x6d'),_0x33a8('0x6e')],'raw':!![]}]})[_0x33a8('0x2c')](function(_0x17d1d9){if(_0x17d1d9){var _0x2bc265=_[_0x33a8('0x6f')](_0x17d1d9,function(_0x49bf0e){var _0x1d8c1f=_0x49bf0e[_0x33a8('0x52')]({'plain':!![]});return _0x1d8c1f[_0x33a8('0x70')];});return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x276a51['params']['id']}})['then'](function(_0x5af238){return db[_0x33a8('0x71')]['transaction'](function(_0x8f4a86){return _0x5af238[_0x33a8('0x6b')](_0x3b9deb,{'transaction':_0x8f4a86})[_0x33a8('0x2c')](function(){return BPromise['each'](_0x2bc265,function(_0x40609d){return db[_0x33a8('0x5d')][_0x33a8('0x72')]({'where':{'UserId':_0x40609d['id'],'WhatsappQueueId':_0x276a51[_0x33a8('0x5a')]['id']},'transaction':_0x8f4a86});});})[_0x33a8('0x2c')](function(){_0x2bc265['forEach'](function(_0x19168f){socket[_0x33a8('0x73')](_0x33a8('0x74'),{'UserId':_0x19168f['id'],'WhatsappQueueId':_0x5af238['id']});});});});});}})['then'](respondWithStatusCode(_0x26748a,null))[_0x33a8('0x4b')](handleError(_0x26748a,null));};exports[_0x33a8('0x75')]=function(_0x405ec4,_0x2b7842,_0xa897ec){return db[_0x33a8('0x6a')][_0x33a8('0x4a')]({'where':{'id':_0x405ec4[_0x33a8('0x3a')][_0x33a8('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x33a8('0x5e')],'as':_0x33a8('0x70'),'attributes':['id'],'raw':!![]}]})[_0x33a8('0x2c')](handleEntityNotFound(_0x2b7842,null))[_0x33a8('0x2c')](function(_0x4be4b1){var _0x2126a1=_[_0x33a8('0x34')](_0x4be4b1,'id');var _0x127e40=[];var _0x216010=[];var _0x35ca0e=squel[_0x33a8('0x76')]();_0x35ca0e[_0x33a8('0x77')]('tq.TeamId')[_0x33a8('0x78')](_0x33a8('0x79'),'tq')[_0x33a8('0x7a')](_0x33a8('0x7b'),'ut',_0x33a8('0x7c'))['where'](_0x33a8('0x7d'),_0x405ec4['params']['id']);for(var _0x619dbc=0x0;_0x619dbc<_0x4be4b1['length'];_0x619dbc+=0x1){let _0x1ab3a8=_0x4be4b1[_0x619dbc];for(var _0x1a3f94=0x0;_0x1a3f94<_0x1ab3a8['Agents'][_0x33a8('0x3d')];_0x1a3f94+=0x1){let _0x3325f8=_0x1ab3a8['Agents'][_0x1a3f94];var _0x5097f7=_0x35ca0e[_0x33a8('0x7e')]();_0x5097f7[_0x33a8('0x45')](_0x33a8('0x7f'),_0x3325f8['id']);_0x216010[_0x33a8('0x80')](db[_0x33a8('0x71')][_0x33a8('0x3a')](_0x5097f7['toString'](),{'type':db[_0x33a8('0x71')][_0x33a8('0x81')][_0x33a8('0x82')]})[_0x33a8('0x2c')](function(_0x29509f){if(_0x29509f[_0x33a8('0x3d')]===0x1){return _0x3325f8['id'];}else{var _0x42a85=_[_0x33a8('0x83')](_[_0x33a8('0x34')](_0x29509f,_0x33a8('0x84')),function(_0x114a31){return _[_0x33a8('0x85')](_0x2126a1,_0x114a31);});if(_0x42a85){return _0x3325f8['id'];}}}));}}return BPromise[_0x33a8('0x86')](_0x216010)[_0x33a8('0x2c')](function(_0x4f1aaa){_0x127e40=_(_0x127e40)[_0x33a8('0x87')](_0x4f1aaa)[_0x33a8('0x88')]()[_0x33a8('0x89')]();return db[_0x33a8('0x48')][_0x33a8('0x4e')]({'where':{'id':_0x405ec4['params']['id']}})[_0x33a8('0x2c')](function(_0x47c50b){return db[_0x33a8('0x71')]['transaction'](function(_0x44d48f){return _0x47c50b['removeTeams'](_0x405ec4[_0x33a8('0x3a')]['ids'],{'transaction':_0x44d48f})[_0x33a8('0x2c')](function(){if(!_[_0x33a8('0x8a')](_0x127e40)){return _0x47c50b[_0x33a8('0x8b')](_0x127e40,{'transaction':_0x44d48f});}})[_0x33a8('0x2c')](function(){_0x127e40[_0x33a8('0x8c')](function(_0x205d1c){socket[_0x33a8('0x73')](_0x33a8('0x8d'),{'UserId':_0x205d1c,'WhatsappQueueId':_0x47c50b['id']});});});});});});})[_0x33a8('0x2c')](respondWithStatusCode(_0x2b7842,null))['catch'](handleError(_0x2b7842,null));};exports[_0x33a8('0x8e')]=function(_0x4e4cca,_0x44c7df,_0x2f6352){return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x4e4cca['params']['id']}})['then'](handleEntityNotFound(_0x44c7df,null))[_0x33a8('0x2c')](function(_0x23ae00){if(_0x23ae00){return _0x23ae00[_0x33a8('0x8e')](_0x4e4cca[_0x33a8('0x50')][_0x33a8('0x6c')],_[_0x33a8('0x8f')](_0x4e4cca[_0x33a8('0x50')],[_0x33a8('0x6c'),'id'])||{})[_0x33a8('0x90')](function(_0x1c3a5f){for(var _0x525c83=0x0;_0x525c83<_0x4e4cca[_0x33a8('0x50')][_0x33a8('0x6c')][_0x33a8('0x3d')];_0x525c83+=0x1){socket[_0x33a8('0x73')](_0x33a8('0x74'),{'UserId':Number(_0x4e4cca[_0x33a8('0x50')][_0x33a8('0x6c')][_0x525c83]),'WhatsappQueueId':Number(_0x4e4cca['params']['id'])});}return _0x1c3a5f;});}})[_0x33a8('0x2c')](respondWithResult(_0x44c7df,null))[_0x33a8('0x4b')](handleError(_0x44c7df,null));};exports[_0x33a8('0x8b')]=function(_0x9b1fb1,_0x35789d,_0x2a012e){return db['WhatsappQueue'][_0x33a8('0x4e')]({'where':{'id':_0x9b1fb1[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x35789d,null))[_0x33a8('0x2c')](function(_0x4e2bee){if(_0x4e2bee){return _0x4e2bee[_0x33a8('0x8b')](_0x9b1fb1[_0x33a8('0x3a')]['ids'])[_0x33a8('0x2c')](function(){if(_[_0x33a8('0x91')](_0x9b1fb1[_0x33a8('0x3a')][_0x33a8('0x6c')])){for(var _0x4926fc=0x0;_0x4926fc<_0x9b1fb1[_0x33a8('0x3a')][_0x33a8('0x6c')][_0x33a8('0x3d')];_0x4926fc+=0x1){socket[_0x33a8('0x73')](_0x33a8('0x8d'),{'UserId':Number(_0x9b1fb1[_0x33a8('0x3a')]['ids'][_0x4926fc]),'WhatsappQueueId':Number(_0x9b1fb1['params']['id'])});}}else{socket[_0x33a8('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x9b1fb1['query']['ids']),'WhatsappQueueId':Number(_0x9b1fb1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x35789d,null))[_0x33a8('0x4b')](handleError(_0x35789d,null));};exports[_0x33a8('0x92')]=function(_0x4cc449,_0x524e17,_0x112009){var _0x1f2cde={};var _0x395ff9={};var _0x1aa488;var _0x24b4e4;return db[_0x33a8('0x48')][_0x33a8('0x59')]({'where':{'id':_0x4cc449[_0x33a8('0x5a')]['id']}})[_0x33a8('0x2c')](handleEntityNotFound(_0x524e17,null))['then'](function(_0x16790a){if(_0x16790a){_0x1aa488=_0x16790a;_0x395ff9[_0x33a8('0x39')]=_[_0x33a8('0x37')](db[_0x33a8('0x5e')][_0x33a8('0x35')]);_0x395ff9[_0x33a8('0x3a')]=_[_0x33a8('0x37')](_0x4cc449[_0x33a8('0x3a')]);_0x395ff9[_0x33a8('0x42')]=_['intersection'](_0x395ff9['model'],_0x395ff9[_0x33a8('0x3a')]);_0x1f2cde[_0x33a8('0x3b')]=_[_0x33a8('0x38')](_0x395ff9['model'],qs['fields'](_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x3c')]));_0x1f2cde['attributes']=_0x1f2cde[_0x33a8('0x3b')][_0x33a8('0x3d')]?_0x1f2cde[_0x33a8('0x3b')]:_0x395ff9['model'];_0x1f2cde[_0x33a8('0x40')]=qs['sort'](_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x41')]);_0x1f2cde[_0x33a8('0x45')]=qs['filters'](_[_0x33a8('0x43')](_0x4cc449[_0x33a8('0x3a')],_0x395ff9['filters']));if(_0x4cc449['query']['filter']){_0x1f2cde[_0x33a8('0x45')]=_[_0x33a8('0x46')](_0x1f2cde[_0x33a8('0x45')],{'$or':_['map'](_0x1f2cde['attributes'],function(_0xe04203){var _0xcc3e1e={};_0xcc3e1e[_0xe04203]={'$like':'%'+_0x4cc449['query']['filter']+'%'};return _0xcc3e1e;})});}_0x1f2cde=_[_0x33a8('0x46')]({},_0x1f2cde,_0x4cc449[_0x33a8('0x5c')]);return _0x1aa488[_0x33a8('0x92')](_0x1f2cde);}})[_0x33a8('0x2c')](function(_0x15d8f2){if(_0x15d8f2){_0x24b4e4=_0x15d8f2['length'];if(!_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x3e')]('nolimit')){_0x1f2cde['limit']=qs[_0x33a8('0x25')](_0x4cc449[_0x33a8('0x3a')]['limit']);_0x1f2cde[_0x33a8('0x22')]=qs[_0x33a8('0x22')](_0x4cc449[_0x33a8('0x3a')][_0x33a8('0x22')]);}return _0x1aa488[_0x33a8('0x92')](_0x1f2cde);}})[_0x33a8('0x2c')](function(_0x445435){if(_0x445435){return _0x445435?{'count':_0x24b4e4,'rows':_0x445435}:null;}})[_0x33a8('0x2c')](respondWithResult(_0x524e17,null))[_0x33a8('0x4b')](handleError(_0x524e17,null));}; \ No newline at end of file +var _0x6d0d=['redis','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','update','then','WhatsappQueues','UserProfileResource','error','stack','name','index','map','WhatsappQueue','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','UserWhatsappQueue','rawAttributes','pick','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','updatedAt','findOne','Team','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x400da3,_0x55d4fa){var _0x1c7073=function(_0x3d2d90){while(--_0x3d2d90){_0x400da3['push'](_0x400da3['shift']());}};_0x1c7073(++_0x55d4fa);}(_0x6d0d,0x101));var _0xd6d0=function(_0x2ac6dc,_0x3a86da){_0x2ac6dc=_0x2ac6dc-0x0;var _0x564d25=_0x6d0d[_0x2ac6dc];return _0x564d25;};'use strict';var emlformat=require(_0xd6d0('0x0'));var rimraf=require(_0xd6d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6d0('0x2'));var rp=require(_0xd6d0('0x3'));var moment=require(_0xd6d0('0x4'));var BPromise=require(_0xd6d0('0x5'));var Mustache=require(_0xd6d0('0x6'));var util=require('util');var path=require(_0xd6d0('0x7'));var sox=require(_0xd6d0('0x8'));var csv=require(_0xd6d0('0x9'));var ejs=require(_0xd6d0('0xa'));var fs=require('fs');var fs_extra=require(_0xd6d0('0xb'));var _=require(_0xd6d0('0xc'));var squel=require(_0xd6d0('0xd'));var crypto=require(_0xd6d0('0xe'));var jsforce=require(_0xd6d0('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6d0('0x10'));var Papa=require(_0xd6d0('0x11'));var Redis=require(_0xd6d0('0x12'));var authService=require(_0xd6d0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd6d0('0x14'));var hardwareService=require(_0xd6d0('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd6d0('0x16'));var licenseUtil=require(_0xd6d0('0x17'));var db=require(_0xd6d0('0x18'))['db'];config['redis']=_['defaults'](config[_0xd6d0('0x19')],{'host':_0xd6d0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6d0('0x1b'))[_0xd6d0('0x1c')](socket);function respondWithStatusCode(_0xb460f,_0x5cc1e2){_0x5cc1e2=_0x5cc1e2||0xcc;return function(_0x3ba3be){if(_0x3ba3be){return _0xb460f[_0xd6d0('0x1d')](_0x5cc1e2);}return _0xb460f[_0xd6d0('0x1e')](_0x5cc1e2)[_0xd6d0('0x1f')]();};}function respondWithResult(_0x3d26c9,_0x324f88){_0x324f88=_0x324f88||0xc8;return function(_0x5ef92d){if(_0x5ef92d){return _0x3d26c9[_0xd6d0('0x1e')](_0x324f88)[_0xd6d0('0x20')](_0x5ef92d);}};}function respondWithFilteredResult(_0x1b74f3,_0x4fffaa){return function(_0x31f97d){if(_0x31f97d){var _0x3a3830=typeof _0x4fffaa[_0xd6d0('0x21')]==='undefined'&&typeof _0x4fffaa[_0xd6d0('0x22')]===_0xd6d0('0x23');var _0x454977=_0x31f97d['count'];var _0x112877=_0x3a3830?0x0:_0x4fffaa[_0xd6d0('0x21')];var _0x2e9019=_0x3a3830?_0x31f97d[_0xd6d0('0x24')]:_0x4fffaa[_0xd6d0('0x21')]+_0x4fffaa[_0xd6d0('0x22')];var _0x5a4437;if(_0x2e9019>=_0x454977){_0x2e9019=_0x454977;_0x5a4437=0xc8;}else{_0x5a4437=0xce;}_0x1b74f3[_0xd6d0('0x1e')](_0x5a4437);return _0x1b74f3['set']('Content-Range',_0x112877+'-'+_0x2e9019+'/'+_0x454977)[_0xd6d0('0x20')](_0x31f97d);}return null;};}function patchUpdates(_0x3f5652){return function(_0x5bae35){try{jsonpatch[_0xd6d0('0x25')](_0x5bae35,_0x3f5652,!![]);}catch(_0x16ca4b){return BPromise['reject'](_0x16ca4b);}return _0x5bae35[_0xd6d0('0x26')]();};}function saveUpdates(_0x78769b,_0x27c7d2){return function(_0x1410bf){if(_0x1410bf){return _0x1410bf[_0xd6d0('0x27')](_0x78769b)[_0xd6d0('0x28')](function(_0x206e74){return _0x206e74;});}return null;};}function removeEntity(_0x490159,_0x5c0d86){return function(_0x5bcabc){if(_0x5bcabc){return _0x5bcabc['destroy']()[_0xd6d0('0x28')](function(){var _0x5a285a=_0x5bcabc['get']({'plain':!![]});var _0x16cfbc=_0xd6d0('0x29');return db[_0xd6d0('0x2a')]['destroy']({'where':{'type':_0x16cfbc,'resourceId':_0x5a285a['id']}})[_0xd6d0('0x28')](function(){return _0x5bcabc;});})['then'](function(){_0x490159[_0xd6d0('0x1e')](0xcc)[_0xd6d0('0x1f')]();});}};}function handleEntityNotFound(_0x259997,_0x53a253){return function(_0x1d8305){if(!_0x1d8305){_0x259997['sendStatus'](0x194);}return _0x1d8305;};}function handleError(_0x4db20a,_0x5162a5){_0x5162a5=_0x5162a5||0x1f4;return function(_0x374229){logger[_0xd6d0('0x2b')](_0x374229[_0xd6d0('0x2c')]);if(_0x374229[_0xd6d0('0x2d')]){delete _0x374229[_0xd6d0('0x2d')];}_0x4db20a[_0xd6d0('0x1e')](_0x5162a5)['send'](_0x374229);};}exports[_0xd6d0('0x2e')]=function(_0x4d79e6,_0x921f45){var _0x9adf9c={},_0x35381f={},_0x25df94={'count':0x0,'rows':[]};var _0x3af1d3=_[_0xd6d0('0x2f')](db[_0xd6d0('0x30')]['rawAttributes'],function(_0x5de49e){return{'name':_0x5de49e[_0xd6d0('0x31')],'type':_0x5de49e[_0xd6d0('0x32')]['key']};});_0x35381f['model']=_[_0xd6d0('0x2f')](_0x3af1d3,_0xd6d0('0x2d'));_0x35381f['query']=_[_0xd6d0('0x33')](_0x4d79e6[_0xd6d0('0x34')]);_0x35381f['filters']=_[_0xd6d0('0x35')](_0x35381f[_0xd6d0('0x36')],_0x35381f[_0xd6d0('0x34')]);_0x9adf9c[_0xd6d0('0x37')]=_[_0xd6d0('0x35')](_0x35381f[_0xd6d0('0x36')],qs[_0xd6d0('0x38')](_0x4d79e6[_0xd6d0('0x34')]['fields']));_0x9adf9c[_0xd6d0('0x37')]=_0x9adf9c[_0xd6d0('0x37')][_0xd6d0('0x39')]?_0x9adf9c[_0xd6d0('0x37')]:_0x35381f[_0xd6d0('0x36')];if(!_0x4d79e6[_0xd6d0('0x34')][_0xd6d0('0x3a')](_0xd6d0('0x3b'))){_0x9adf9c[_0xd6d0('0x22')]=qs[_0xd6d0('0x22')](_0x4d79e6[_0xd6d0('0x34')]['limit']);_0x9adf9c[_0xd6d0('0x21')]=qs['offset'](_0x4d79e6[_0xd6d0('0x34')]['offset']);}_0x9adf9c[_0xd6d0('0x3c')]=qs[_0xd6d0('0x3d')](_0x4d79e6['query'][_0xd6d0('0x3d')]);_0x9adf9c[_0xd6d0('0x3e')]=qs[_0xd6d0('0x3f')](_['pick'](_0x4d79e6['query'],_0x35381f[_0xd6d0('0x3f')]),_0x3af1d3);if(_0x4d79e6[_0xd6d0('0x34')][_0xd6d0('0x40')]){_0x9adf9c[_0xd6d0('0x3e')]=_['merge'](_0x9adf9c['where'],{'$or':_[_0xd6d0('0x2f')](_0x3af1d3,function(_0x3cea34){if(_0x3cea34[_0xd6d0('0x32')]!==_0xd6d0('0x41')){var _0x27d7ea={};_0x27d7ea[_0x3cea34['name']]={'$like':'%'+_0x4d79e6[_0xd6d0('0x34')][_0xd6d0('0x40')]+'%'};return _0x27d7ea;}})});}_0x9adf9c=_[_0xd6d0('0x42')]({},_0x9adf9c,_0x4d79e6[_0xd6d0('0x43')]);var _0x37b3af={'where':_0x9adf9c[_0xd6d0('0x3e')]};return db['WhatsappQueue'][_0xd6d0('0x24')](_0x37b3af)['then'](function(_0x1a986b){_0x25df94['count']=_0x1a986b;if(_0x4d79e6[_0xd6d0('0x34')]['includeAll']){_0x9adf9c[_0xd6d0('0x44')]=[{'all':!![]}];}return db[_0xd6d0('0x30')][_0xd6d0('0x45')](_0x9adf9c);})['then'](function(_0x22f497){_0x25df94[_0xd6d0('0x46')]=_0x22f497;return _0x25df94;})[_0xd6d0('0x28')](respondWithFilteredResult(_0x921f45,_0x9adf9c))[_0xd6d0('0x47')](handleError(_0x921f45,null));};exports['show']=function(_0x244cab,_0xaf9da0){var _0x9d96ae={'raw':!![],'where':{'id':_0x244cab['params']['id']}},_0x5e89cf={};_0x5e89cf[_0xd6d0('0x36')]=_['keys'](db[_0xd6d0('0x30')]['rawAttributes']);_0x5e89cf[_0xd6d0('0x34')]=_['keys'](_0x244cab[_0xd6d0('0x34')]);_0x5e89cf[_0xd6d0('0x3f')]=_[_0xd6d0('0x35')](_0x5e89cf[_0xd6d0('0x36')],_0x5e89cf['query']);_0x9d96ae['attributes']=_['intersection'](_0x5e89cf['model'],qs[_0xd6d0('0x38')](_0x244cab[_0xd6d0('0x34')]['fields']));_0x9d96ae[_0xd6d0('0x37')]=_0x9d96ae[_0xd6d0('0x37')][_0xd6d0('0x39')]?_0x9d96ae[_0xd6d0('0x37')]:_0x5e89cf[_0xd6d0('0x36')];if(_0x244cab[_0xd6d0('0x34')][_0xd6d0('0x48')]){_0x9d96ae[_0xd6d0('0x44')]=[{'all':!![]}];}_0x9d96ae=_['merge']({},_0x9d96ae,_0x244cab[_0xd6d0('0x43')]);return db[_0xd6d0('0x30')][_0xd6d0('0x49')](_0x9d96ae)[_0xd6d0('0x28')](handleEntityNotFound(_0xaf9da0,null))[_0xd6d0('0x28')](respondWithResult(_0xaf9da0,null))[_0xd6d0('0x47')](handleError(_0xaf9da0,null));};exports['create']=function(_0x450a0b,_0x6128e9){return db[_0xd6d0('0x30')][_0xd6d0('0x4a')](_0x450a0b['body'],{})[_0xd6d0('0x28')](function(_0x1a5b87){var _0x4bf50e=_0x450a0b[_0xd6d0('0x4b')][_0xd6d0('0x4c')]({'plain':!![]});if(!_0x4bf50e)throw new Error(_0xd6d0('0x4d'));if(_0x4bf50e[_0xd6d0('0x4e')]===_0xd6d0('0x4b')){var _0x4cee7e=_0x1a5b87[_0xd6d0('0x4c')]({'plain':!![]});var _0x2b9e90=_0xd6d0('0x29');return db[_0xd6d0('0x4f')]['find']({'where':{'name':_0x2b9e90,'userProfileId':_0x4bf50e['userProfileId']},'raw':!![]})[_0xd6d0('0x28')](function(_0x2a8457){if(_0x2a8457&&_0x2a8457[_0xd6d0('0x50')]===0x0){return db['UserProfileResource'][_0xd6d0('0x4a')]({'name':_0x4cee7e[_0xd6d0('0x2d')],'resourceId':_0x4cee7e['id'],'type':_0x2a8457['name'],'sectionId':_0x2a8457['id']},{})[_0xd6d0('0x28')](function(){return _0x1a5b87;});}else{return _0x1a5b87;}})[_0xd6d0('0x47')](function(_0x12dc93){logger[_0xd6d0('0x2b')](_0xd6d0('0x51'),_0x12dc93);throw _0x12dc93;});}return _0x1a5b87;})[_0xd6d0('0x28')](respondWithResult(_0x6128e9,0xc9))[_0xd6d0('0x47')](handleError(_0x6128e9,null));};exports[_0xd6d0('0x27')]=function(_0xd0e644,_0x5e96ac){if(_0xd0e644[_0xd6d0('0x52')]['id']){delete _0xd0e644['body']['id'];}return db[_0xd6d0('0x30')][_0xd6d0('0x49')]({'where':{'id':_0xd0e644[_0xd6d0('0x53')]['id']}})['then'](handleEntityNotFound(_0x5e96ac,null))[_0xd6d0('0x28')](saveUpdates(_0xd0e644[_0xd6d0('0x52')],null))[_0xd6d0('0x28')](respondWithResult(_0x5e96ac,null))[_0xd6d0('0x47')](handleError(_0x5e96ac,null));};exports[_0xd6d0('0x54')]=function(_0x1274a6,_0x3dc66e){return db['WhatsappQueue'][_0xd6d0('0x49')]({'where':{'id':_0x1274a6[_0xd6d0('0x53')]['id']}})['then'](handleEntityNotFound(_0x3dc66e,null))[_0xd6d0('0x28')](removeEntity(_0x3dc66e,null))['catch'](handleError(_0x3dc66e,null));};exports['describe']=function(_0x3a38dd,_0x1d44a0){return db[_0xd6d0('0x30')][_0xd6d0('0x55')]()['then'](respondWithResult(_0x1d44a0,null))[_0xd6d0('0x47')](handleError(_0x1d44a0,null));};exports['getMembers']=function(_0x7873b3,_0x5187a6,_0xa1329e){var _0x2cc035={'raw':!![],'where':{}},_0x5598ae={},_0x1fb3e4;return db[_0xd6d0('0x30')]['findOne']({'where':{'id':_0x7873b3[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x5187a6,null))[_0xd6d0('0x28')](function(_0x3861d4){if(_0x3861d4){_0x1fb3e4=_0x3861d4[_0xd6d0('0x4c')]({'plain':!![]});_0x5598ae['model']=_[_0xd6d0('0x33')](db[_0xd6d0('0x56')][_0xd6d0('0x57')]);_0x5598ae[_0xd6d0('0x34')]=_[_0xd6d0('0x33')](_0x7873b3[_0xd6d0('0x34')]);_0x5598ae[_0xd6d0('0x3f')]=_[_0xd6d0('0x35')](_0x5598ae[_0xd6d0('0x36')],_0x5598ae[_0xd6d0('0x34')]);_0x2cc035[_0xd6d0('0x37')]=_['intersection'](_0x5598ae['model'],qs[_0xd6d0('0x38')](_0x7873b3[_0xd6d0('0x34')][_0xd6d0('0x38')]));_0x2cc035[_0xd6d0('0x37')]=_0x2cc035['attributes'][_0xd6d0('0x39')]?_0x2cc035[_0xd6d0('0x37')]:_0x5598ae[_0xd6d0('0x36')];if(!_0x7873b3[_0xd6d0('0x34')][_0xd6d0('0x3a')]('nolimit')){_0x2cc035['limit']=qs[_0xd6d0('0x22')](_0x7873b3['query'][_0xd6d0('0x22')]);_0x2cc035[_0xd6d0('0x21')]=qs['offset'](_0x7873b3[_0xd6d0('0x34')][_0xd6d0('0x21')]);}_0x2cc035[_0xd6d0('0x3c')]=qs[_0xd6d0('0x3d')](_0x7873b3['query'][_0xd6d0('0x3d')]);_0x2cc035[_0xd6d0('0x3e')]=qs[_0xd6d0('0x3f')](_[_0xd6d0('0x58')](_0x7873b3[_0xd6d0('0x34')],_0x5598ae[_0xd6d0('0x3f')]));_0x2cc035[_0xd6d0('0x3e')]['WhatsappQueueId']=_0x3861d4['id'];if(_0x7873b3['query']['filter']){_0x2cc035[_0xd6d0('0x3e')]=_[_0xd6d0('0x42')](_0x2cc035['where'],{'$or':_['map'](_0x2cc035[_0xd6d0('0x37')],function(_0x508825){var _0x45d12a={};_0x45d12a[_0x508825]={'$like':'%'+_0x7873b3[_0xd6d0('0x34')][_0xd6d0('0x40')]+'%'};return _0x45d12a;})});}_0x2cc035=_[_0xd6d0('0x42')]({},_0x2cc035,_0x7873b3['options']);return db[_0xd6d0('0x56')]['findAll'](_0x2cc035);}})[_0xd6d0('0x28')](function(_0x5d1597){if(_0x5d1597){return db['User'][_0xd6d0('0x59')]({'where':{'id':_[_0xd6d0('0x2f')](_0x5d1597,'UserId'),'role':_0xd6d0('0x5a')},'attributes':['id',_0xd6d0('0x2d'),_0xd6d0('0x5b'),'updatedAt',_0xd6d0('0x5c')]});}})[_0xd6d0('0x28')](function(_0x24703f){if(_0x24703f){return{'count':_0x24703f[_0xd6d0('0x24')],'rows':_[_0xd6d0('0x2f')](_0x24703f['rows'],function(_0x2c51b8){return{'membername':_0x2c51b8[_0xd6d0('0x2d')],'UserId':_0x2c51b8['id'],'queue_name':_0x1fb3e4[_0xd6d0('0x2d')],'WhatsappQueueId':_0x1fb3e4['id'],'interface':util[_0xd6d0('0x5d')](_0xd6d0('0x5e'),'SIP',_0x2c51b8['name']),'penalty':0x0,'paused':_0x2c51b8[_0xd6d0('0x5b')],'createdAt':_0x2c51b8[_0xd6d0('0x5c')],'updatedAt':_0x2c51b8[_0xd6d0('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd6d0('0x28')](respondWithFilteredResult(_0x5187a6,_0x2cc035))[_0xd6d0('0x47')](handleError(_0x5187a6,null));};exports['getTeams']=function(_0x57ef7a,_0x5f4bd8,_0x44b808){var _0x2f10be={};var _0x267da2={};var _0x5c622f;var _0x45961f;return db[_0xd6d0('0x30')][_0xd6d0('0x60')]({'where':{'id':_0x57ef7a[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x5f4bd8,null))[_0xd6d0('0x28')](function(_0x2b60e0){if(_0x2b60e0){_0x5c622f=_0x2b60e0;_0x267da2['model']=_[_0xd6d0('0x33')](db[_0xd6d0('0x61')][_0xd6d0('0x57')]);_0x267da2[_0xd6d0('0x34')]=_[_0xd6d0('0x33')](_0x57ef7a[_0xd6d0('0x34')]);_0x267da2[_0xd6d0('0x3f')]=_[_0xd6d0('0x35')](_0x267da2['model'],_0x267da2[_0xd6d0('0x34')]);_0x2f10be[_0xd6d0('0x37')]=_[_0xd6d0('0x35')](_0x267da2['model'],qs['fields'](_0x57ef7a[_0xd6d0('0x34')][_0xd6d0('0x38')]));_0x2f10be['attributes']=_0x2f10be[_0xd6d0('0x37')][_0xd6d0('0x39')]?_0x2f10be[_0xd6d0('0x37')]:_0x267da2[_0xd6d0('0x36')];_0x2f10be[_0xd6d0('0x3c')]=qs['sort'](_0x57ef7a['query'][_0xd6d0('0x3d')]);_0x2f10be['where']=qs['filters'](_[_0xd6d0('0x58')](_0x57ef7a['query'],_0x267da2[_0xd6d0('0x3f')]));if(_0x57ef7a[_0xd6d0('0x34')][_0xd6d0('0x40')]){_0x2f10be[_0xd6d0('0x3e')]=_[_0xd6d0('0x42')](_0x2f10be[_0xd6d0('0x3e')],{'$or':_[_0xd6d0('0x2f')](_0x2f10be[_0xd6d0('0x37')],function(_0x71380f){var _0x357776={};_0x357776[_0x71380f]={'$like':'%'+_0x57ef7a[_0xd6d0('0x34')][_0xd6d0('0x40')]+'%'};return _0x357776;})});}_0x2f10be=_[_0xd6d0('0x42')]({},_0x2f10be,_0x57ef7a[_0xd6d0('0x43')]);return _0x5c622f[_0xd6d0('0x62')](_0x2f10be);}})['then'](function(_0x3d1936){if(_0x3d1936){_0x45961f=_0x3d1936[_0xd6d0('0x39')];if(!_0x57ef7a[_0xd6d0('0x34')][_0xd6d0('0x3a')](_0xd6d0('0x3b'))){_0x2f10be['limit']=qs[_0xd6d0('0x22')](_0x57ef7a[_0xd6d0('0x34')][_0xd6d0('0x22')]);_0x2f10be[_0xd6d0('0x21')]=qs[_0xd6d0('0x21')](_0x57ef7a[_0xd6d0('0x34')][_0xd6d0('0x21')]);}return _0x5c622f[_0xd6d0('0x62')](_0x2f10be);}})['then'](function(_0x1056d8){if(_0x1056d8){return _0x1056d8?{'count':_0x45961f,'rows':_0x1056d8}:null;}})[_0xd6d0('0x28')](respondWithResult(_0x5f4bd8,null))[_0xd6d0('0x47')](handleError(_0x5f4bd8,null));};exports[_0xd6d0('0x63')]=function(_0x353439,_0x3e3328,_0x223016){var _0x5ca5fa=_0x353439[_0xd6d0('0x52')][_0xd6d0('0x64')];return db[_0xd6d0('0x61')][_0xd6d0('0x45')]({'where':{'id':_0x5ca5fa},'attributes':['id'],'include':[{'model':db[_0xd6d0('0x65')],'as':'Agents','attributes':['id',_0xd6d0('0x2d'),_0xd6d0('0x66'),_0xd6d0('0x67'),_0xd6d0('0x68')],'raw':!![]}]})['then'](function(_0x2bb848){if(_0x2bb848){var _0x321794=_[_0xd6d0('0x69')](_0x2bb848,function(_0x44b63c){var _0x236afe=_0x44b63c[_0xd6d0('0x4c')]({'plain':!![]});return _0x236afe['Agents'];});return db[_0xd6d0('0x30')]['find']({'where':{'id':_0x353439['params']['id']}})[_0xd6d0('0x28')](function(_0x13c641){return db[_0xd6d0('0x6a')][_0xd6d0('0x6b')](function(_0x52acae){return _0x13c641[_0xd6d0('0x63')](_0x5ca5fa,{'transaction':_0x52acae})[_0xd6d0('0x28')](function(){return BPromise[_0xd6d0('0x6c')](_0x321794,function(_0x24df5a){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x24df5a['id'],'WhatsappQueueId':_0x353439[_0xd6d0('0x53')]['id']},'transaction':_0x52acae});});})[_0xd6d0('0x28')](function(){_0x321794[_0xd6d0('0x6d')](function(_0x2552f0){socket[_0xd6d0('0x6e')](_0xd6d0('0x6f'),{'UserId':_0x2552f0['id'],'WhatsappQueueId':_0x13c641['id']});});});});});}})[_0xd6d0('0x28')](respondWithStatusCode(_0x3e3328,null))[_0xd6d0('0x47')](handleError(_0x3e3328,null));};exports[_0xd6d0('0x70')]=function(_0x1cbe37,_0x2fb13c,_0x304add){return db[_0xd6d0('0x61')]['findAll']({'where':{'id':_0x1cbe37[_0xd6d0('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd6d0('0x65')],'as':_0xd6d0('0x71'),'attributes':['id'],'raw':!![]}]})[_0xd6d0('0x28')](handleEntityNotFound(_0x2fb13c,null))[_0xd6d0('0x28')](function(_0x1f0bd3){var _0x41e4d9=_[_0xd6d0('0x2f')](_0x1f0bd3,'id');var _0x224587=[];var _0x1acbd1=[];var _0xd7b2d=squel[_0xd6d0('0x72')]();_0xd7b2d[_0xd6d0('0x73')](_0xd6d0('0x74'))[_0xd6d0('0x75')](_0xd6d0('0x76'),'tq')[_0xd6d0('0x77')](_0xd6d0('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd6d0('0x3e')](_0xd6d0('0x79'),_0x1cbe37[_0xd6d0('0x53')]['id']);for(var _0x456017=0x0;_0x456017<_0x1f0bd3[_0xd6d0('0x39')];_0x456017+=0x1){let _0xca8aae=_0x1f0bd3[_0x456017];for(var _0x93fe3c=0x0;_0x93fe3c<_0xca8aae[_0xd6d0('0x71')][_0xd6d0('0x39')];_0x93fe3c+=0x1){let _0x4f8f0d=_0xca8aae[_0xd6d0('0x71')][_0x93fe3c];var _0x2734a9=_0xd7b2d[_0xd6d0('0x7a')]();_0x2734a9['where'](_0xd6d0('0x7b'),_0x4f8f0d['id']);_0x1acbd1[_0xd6d0('0x7c')](db[_0xd6d0('0x6a')][_0xd6d0('0x34')](_0x2734a9[_0xd6d0('0x7d')](),{'type':db['sequelize']['QueryTypes'][_0xd6d0('0x7e')]})[_0xd6d0('0x28')](function(_0x5aefed){if(_0x5aefed['length']===0x1){return _0x4f8f0d['id'];}else{var _0x3b850f=_[_0xd6d0('0x7f')](_[_0xd6d0('0x2f')](_0x5aefed,_0xd6d0('0x80')),function(_0x138e8f){return _[_0xd6d0('0x81')](_0x41e4d9,_0x138e8f);});if(_0x3b850f){return _0x4f8f0d['id'];}}}));}}return BPromise[_0xd6d0('0x82')](_0x1acbd1)[_0xd6d0('0x28')](function(_0x382d88){_0x224587=_(_0x224587)['union'](_0x382d88)[_0xd6d0('0x83')]()[_0xd6d0('0x84')]();return db[_0xd6d0('0x30')][_0xd6d0('0x49')]({'where':{'id':_0x1cbe37[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](function(_0xf8a059){return db[_0xd6d0('0x6a')][_0xd6d0('0x6b')](function(_0xe234f0){return _0xf8a059[_0xd6d0('0x70')](_0x1cbe37[_0xd6d0('0x34')][_0xd6d0('0x64')],{'transaction':_0xe234f0})[_0xd6d0('0x28')](function(){if(!_[_0xd6d0('0x85')](_0x224587)){return _0xf8a059['removeAgents'](_0x224587,{'transaction':_0xe234f0});}})['then'](function(){_0x224587['forEach'](function(_0xe9725e){socket[_0xd6d0('0x6e')](_0xd6d0('0x86'),{'UserId':_0xe9725e,'WhatsappQueueId':_0xf8a059['id']});});});});});});})['then'](respondWithStatusCode(_0x2fb13c,null))[_0xd6d0('0x47')](handleError(_0x2fb13c,null));};exports[_0xd6d0('0x87')]=function(_0x8df6a1,_0x15caa9,_0x5d9f3a){return db[_0xd6d0('0x30')][_0xd6d0('0x49')]({'where':{'id':_0x8df6a1[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x15caa9,null))[_0xd6d0('0x28')](function(_0x263b46){if(_0x263b46){return _0x263b46[_0xd6d0('0x87')](_0x8df6a1[_0xd6d0('0x52')][_0xd6d0('0x64')],_[_0xd6d0('0x88')](_0x8df6a1['body'],['ids','id'])||{})[_0xd6d0('0x89')](function(_0x28d649){for(var _0x4ab37c=0x0;_0x4ab37c<_0x8df6a1[_0xd6d0('0x52')][_0xd6d0('0x64')][_0xd6d0('0x39')];_0x4ab37c+=0x1){socket[_0xd6d0('0x6e')](_0xd6d0('0x6f'),{'UserId':Number(_0x8df6a1[_0xd6d0('0x52')][_0xd6d0('0x64')][_0x4ab37c]),'WhatsappQueueId':Number(_0x8df6a1[_0xd6d0('0x53')]['id'])});}return _0x28d649;});}})[_0xd6d0('0x28')](respondWithResult(_0x15caa9,null))[_0xd6d0('0x47')](handleError(_0x15caa9,null));};exports['removeAgents']=function(_0xa57ecd,_0x40c30a,_0x7469a9){return db[_0xd6d0('0x30')][_0xd6d0('0x49')]({'where':{'id':_0xa57ecd[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x40c30a,null))[_0xd6d0('0x28')](function(_0x186eb5){if(_0x186eb5){return _0x186eb5[_0xd6d0('0x8a')](_0xa57ecd[_0xd6d0('0x34')]['ids'])[_0xd6d0('0x28')](function(){if(_[_0xd6d0('0x8b')](_0xa57ecd['query'][_0xd6d0('0x64')])){for(var _0x2f1a28=0x0;_0x2f1a28<_0xa57ecd[_0xd6d0('0x34')][_0xd6d0('0x64')][_0xd6d0('0x39')];_0x2f1a28+=0x1){socket[_0xd6d0('0x6e')](_0xd6d0('0x86'),{'UserId':Number(_0xa57ecd[_0xd6d0('0x34')][_0xd6d0('0x64')][_0x2f1a28]),'WhatsappQueueId':Number(_0xa57ecd[_0xd6d0('0x53')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0xa57ecd[_0xd6d0('0x34')][_0xd6d0('0x64')]),'WhatsappQueueId':Number(_0xa57ecd[_0xd6d0('0x53')]['id'])});}});}})[_0xd6d0('0x28')](respondWithStatusCode(_0x40c30a,null))['catch'](handleError(_0x40c30a,null));};exports[_0xd6d0('0x8c')]=function(_0x4a030f,_0x2607e4,_0x40ad68){var _0x5cb7c0={};var _0x5f2d30={};var _0x38f85a;var _0x25ba0a;return db[_0xd6d0('0x30')][_0xd6d0('0x60')]({'where':{'id':_0x4a030f['params']['id']}})['then'](handleEntityNotFound(_0x2607e4,null))[_0xd6d0('0x28')](function(_0x3fc2db){if(_0x3fc2db){_0x38f85a=_0x3fc2db;_0x5f2d30['model']=_[_0xd6d0('0x33')](db['User'][_0xd6d0('0x57')]);_0x5f2d30[_0xd6d0('0x34')]=_[_0xd6d0('0x33')](_0x4a030f[_0xd6d0('0x34')]);_0x5f2d30['filters']=_[_0xd6d0('0x35')](_0x5f2d30[_0xd6d0('0x36')],_0x5f2d30[_0xd6d0('0x34')]);_0x5cb7c0[_0xd6d0('0x37')]=_['intersection'](_0x5f2d30['model'],qs[_0xd6d0('0x38')](_0x4a030f[_0xd6d0('0x34')]['fields']));_0x5cb7c0[_0xd6d0('0x37')]=_0x5cb7c0[_0xd6d0('0x37')][_0xd6d0('0x39')]?_0x5cb7c0[_0xd6d0('0x37')]:_0x5f2d30['model'];_0x5cb7c0[_0xd6d0('0x3c')]=qs[_0xd6d0('0x3d')](_0x4a030f[_0xd6d0('0x34')][_0xd6d0('0x3d')]);_0x5cb7c0[_0xd6d0('0x3e')]=qs['filters'](_[_0xd6d0('0x58')](_0x4a030f[_0xd6d0('0x34')],_0x5f2d30[_0xd6d0('0x3f')]));if(_0x4a030f[_0xd6d0('0x34')][_0xd6d0('0x40')]){_0x5cb7c0[_0xd6d0('0x3e')]=_[_0xd6d0('0x42')](_0x5cb7c0[_0xd6d0('0x3e')],{'$or':_[_0xd6d0('0x2f')](_0x5cb7c0[_0xd6d0('0x37')],function(_0x164c6b){var _0x994a3c={};_0x994a3c[_0x164c6b]={'$like':'%'+_0x4a030f[_0xd6d0('0x34')][_0xd6d0('0x40')]+'%'};return _0x994a3c;})});}_0x5cb7c0=_[_0xd6d0('0x42')]({},_0x5cb7c0,_0x4a030f[_0xd6d0('0x43')]);return _0x38f85a[_0xd6d0('0x8c')](_0x5cb7c0);}})['then'](function(_0x5ad744){if(_0x5ad744){_0x25ba0a=_0x5ad744['length'];if(!_0x4a030f[_0xd6d0('0x34')]['hasOwnProperty'](_0xd6d0('0x3b'))){_0x5cb7c0[_0xd6d0('0x22')]=qs[_0xd6d0('0x22')](_0x4a030f['query'][_0xd6d0('0x22')]);_0x5cb7c0[_0xd6d0('0x21')]=qs[_0xd6d0('0x21')](_0x4a030f[_0xd6d0('0x34')]['offset']);}return _0x38f85a[_0xd6d0('0x8c')](_0x5cb7c0);}})['then'](function(_0x2b38e8){if(_0x2b38e8){return _0x2b38e8?{'count':_0x25ba0a,'rows':_0x2b38e8}:null;}})[_0xd6d0('0x28')](respondWithResult(_0x2607e4,null))[_0xd6d0('0x47')](handleError(_0x2607e4,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6b83c90..b53108d 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6c1=['remove','emit','hook','events','WhatsappQueue','setMaxListeners','update'];(function(_0x278f83,_0x288600){var _0x4a2fad=function(_0x29f20e){while(--_0x29f20e){_0x278f83['push'](_0x278f83['shift']());}};_0x4a2fad(++_0x288600);}(_0xc6c1,0x1ae));var _0x1c6c=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0xc6c1[_0x436849];return _0x5c5f73;};'use strict';var EventEmitter=require(_0x1c6c('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x1c6c('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1c6c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c6c('0x3'),'afterDestroy':_0x1c6c('0x4')};function emitEvent(_0x137671){return function(_0x28a2af,_0xb8e9b,_0x4a9d87){WhatsappQueueEvents[_0x1c6c('0x5')](_0x137671+':'+_0x28a2af['id'],_0x28a2af);WhatsappQueueEvents[_0x1c6c('0x5')](_0x137671,_0x28a2af);_0x4a9d87(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x1c6c('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xc136=['setMaxListeners','save','update','remove','hook','events','../../mysqldb','WhatsappQueue'];(function(_0x2abc8a,_0x1c4e00){var _0x4ed8d6=function(_0x597bde){while(--_0x597bde){_0x2abc8a['push'](_0x2abc8a['shift']());}};_0x4ed8d6(++_0x1c4e00);}(_0xc136,0x1cd));var _0x6c13=function(_0x19eb60,_0x462649){_0x19eb60=_0x19eb60-0x0;var _0x339f6b=_0xc136[_0x19eb60];return _0x339f6b;};'use strict';var EventEmitter=require(_0x6c13('0x0'));var WhatsappQueue=require(_0x6c13('0x1'))['db'][_0x6c13('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6c13('0x3')](0x0);var events={'afterCreate':_0x6c13('0x4'),'afterUpdate':_0x6c13('0x5'),'afterDestroy':_0x6c13('0x6')};function emitEvent(_0x36f659){return function(_0x358f28,_0x5cb2a8,_0x5127a3){WhatsappQueueEvents['emit'](_0x36f659+':'+_0x358f28['id'],_0x358f28);WhatsappQueueEvents['emit'](_0x36f659,_0x358f28);_0x5127a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6c13('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 1fe8a7e..1899d96 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5f0=['whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue'];(function(_0x4bd69e,_0x33d62e){var _0xd28574=function(_0x2228c1){while(--_0x2228c1){_0x4bd69e['push'](_0x4bd69e['shift']());}};_0xd28574(++_0x33d62e);}(_0xa5f0,0x15f));var _0x0a5f=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xa5f0[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x0a5f('0x0'));var util=require(_0x0a5f('0x1'));var logger=require(_0x0a5f('0x2'))(_0x0a5f('0x3'));var moment=require(_0x0a5f('0x4'));var BPromise=require(_0x0a5f('0x5'));var rp=require(_0x0a5f('0x6'));var fs=require('fs');var path=require(_0x0a5f('0x7'));var rimraf=require(_0x0a5f('0x8'));var config=require(_0x0a5f('0x9'));var attributes=require(_0x0a5f('0xa'));module['exports']=function(_0x42b1b6,_0x298d15){return _0x42b1b6[_0x0a5f('0xb')](_0x0a5f('0xc'),attributes,{'tableName':_0x0a5f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72f8=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x72f8,0xd2));var _0x872f=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x72f8[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x872f('0x0'));var util=require(_0x872f('0x1'));var logger=require(_0x872f('0x2'))(_0x872f('0x3'));var moment=require(_0x872f('0x4'));var BPromise=require(_0x872f('0x5'));var rp=require(_0x872f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x872f('0x7'));var config=require(_0x872f('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0x872f('0x9')]=function(_0x4f0423,_0x150c46){return _0x4f0423[_0x872f('0xa')](_0x872f('0xb'),attributes,{'tableName':_0x872f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index e1fee4d..521dfa8 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2501=['include','map','model','debug','ShowWhatsappQueue','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2501,0x12e));var _0x1250=function(_0x45c074,_0x5498d5){_0x45c074=_0x45c074-0x0;var _0x2572d1=_0x2501[_0x45c074];return _0x2572d1;};'use strict';var _=require(_0x1250('0x0'));var util=require(_0x1250('0x1'));var moment=require('moment');var BPromise=require(_0x1250('0x2'));var rs=require(_0x1250('0x3'));var fs=require('fs');var Redis=require(_0x1250('0x4'));var db=require(_0x1250('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1250('0x6'));var jayson=require(_0x1250('0x7'));var client=jayson[_0x1250('0x8')]['http']({'port':0x232a});config[_0x1250('0x9')]=_[_0x1250('0xa')](config['redis'],{'host':_0x1250('0xb'),'port':0x18eb});var socket=require(_0x1250('0xc'))(new Redis(config[_0x1250('0x9')]));require(_0x1250('0xd'))['register'](socket);function respondWithRpcPromise(_0x545bf3,_0x4c656d,_0x475b45){return new BPromise(function(_0x2d73a2,_0x310340){return client[_0x1250('0xe')](_0x545bf3,_0x475b45)['then'](function(_0x1b09ca){logger[_0x1250('0xf')](_0x1250('0x10'),_0x4c656d,_0x1250('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4c656d,'request\x20sent',JSON[_0x1250('0x12')](_0x1b09ca));if(_0x1b09ca[_0x1250('0x13')]){if(_0x1b09ca[_0x1250('0x13')][_0x1250('0x14')]===0x1f4){logger['error'](_0x1250('0x10'),_0x4c656d,_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);return _0x310340(_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);}logger[_0x1250('0x13')](_0x1250('0x10'),_0x4c656d,_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);return _0x2d73a2(_0x1b09ca[_0x1250('0x13')][_0x1250('0x15')]);}else{logger[_0x1250('0xf')](_0x1250('0x10'),_0x4c656d,'request\x20sent');_0x2d73a2(_0x1b09ca[_0x1250('0x16')][_0x1250('0x15')]);}})[_0x1250('0x17')](function(_0x3bd83e){logger[_0x1250('0x13')](_0x1250('0x10'),_0x4c656d,_0x3bd83e);_0x310340(_0x3bd83e);});});}exports[_0x1250('0x18')]=function(_0x1a3d0b){var _0x4df6c1=this;return new Promise(function(_0x103a39,_0x443224){return db[_0x1250('0x19')][_0x1250('0x1a')]({'raw':_0x1a3d0b['options']?_0x1a3d0b[_0x1250('0x1b')][_0x1250('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a3d0b[_0x1250('0x1b')]?_0x1a3d0b[_0x1250('0x1b')]['where']||null:null,'attributes':_0x1a3d0b[_0x1250('0x1b')]?_0x1a3d0b[_0x1250('0x1b')][_0x1250('0x1d')]||null:null,'limit':_0x1a3d0b['options']?_0x1a3d0b['options'][_0x1250('0x1e')]||null:null,'include':_0x1a3d0b[_0x1250('0x1b')]?_0x1a3d0b[_0x1250('0x1b')][_0x1250('0x1f')]?_[_0x1250('0x20')](_0x1a3d0b['options'][_0x1250('0x1f')],function(_0xb406ab){return{'model':db[_0xb406ab['model']],'as':_0xb406ab['as'],'attributes':_0xb406ab[_0x1250('0x1d')],'include':_0xb406ab[_0x1250('0x1f')]?_['map'](_0xb406ab['include'],function(_0x28c0d4){return{'model':db[_0x28c0d4[_0x1250('0x21')]],'as':_0x28c0d4['as'],'attributes':_0x28c0d4[_0x1250('0x1d')],'include':_0x28c0d4['include']?_[_0x1250('0x20')](_0x28c0d4[_0x1250('0x1f')],function(_0x4248e1){return{'model':db[_0x4248e1[_0x1250('0x21')]],'as':_0x4248e1['as'],'attributes':_0x4248e1[_0x1250('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8020f9){logger[_0x1250('0xf')](_0x1250('0x18'),_0x1a3d0b);logger[_0x1250('0x22')]('GetWhatsappQueue',_0x1a3d0b,JSON['stringify'](_0x8020f9));_0x103a39(_0x8020f9);})[_0x1250('0x17')](function(_0x1ed59f){logger[_0x1250('0x13')](_0x1250('0x18'),_0x1ed59f[_0x1250('0x15')],_0x1a3d0b);_0x443224(_0x4df6c1[_0x1250('0x13')](0x1f4,_0x1ed59f['message']));});});};exports[_0x1250('0x23')]=function(_0x195da0){var _0x287716=this;return new Promise(function(_0xed58c6,_0x363dad){return db[_0x1250('0x19')]['find']({'raw':_0x195da0['options']?_0x195da0[_0x1250('0x1b')][_0x1250('0x1c')]===undefined?!![]:![]:!![],'where':_0x195da0[_0x1250('0x1b')]?_0x195da0['options']['where']||null:null,'attributes':_0x195da0[_0x1250('0x1b')]?_0x195da0['options']['attributes']||null:null,'include':_0x195da0[_0x1250('0x1b')]?_0x195da0['options'][_0x1250('0x1f')]?_[_0x1250('0x20')](_0x195da0[_0x1250('0x1b')][_0x1250('0x1f')],function(_0x570eea){return{'model':db[_0x570eea[_0x1250('0x21')]],'as':_0x570eea['as'],'attributes':_0x570eea[_0x1250('0x1d')],'include':_0x570eea['include']?_['map'](_0x570eea[_0x1250('0x1f')],function(_0x29d971){return{'model':db[_0x29d971[_0x1250('0x21')]],'as':_0x29d971['as'],'attributes':_0x29d971[_0x1250('0x1d')],'include':_0x29d971['include']?_[_0x1250('0x20')](_0x29d971[_0x1250('0x1f')],function(_0x5d01c5){return{'model':db[_0x5d01c5[_0x1250('0x21')]],'as':_0x5d01c5['as'],'attributes':_0x5d01c5[_0x1250('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1250('0x24')](function(_0x3b064e){logger['info'](_0x1250('0x23'),_0x195da0);logger[_0x1250('0x22')](_0x1250('0x23'),_0x195da0,JSON[_0x1250('0x12')](_0x3b064e));_0xed58c6(_0x3b064e);})['catch'](function(_0x9bc73d){logger['error'](_0x1250('0x23'),_0x9bc73d[_0x1250('0x15')],_0x195da0);_0x363dad(_0x287716[_0x1250('0x13')](0x1f4,_0x9bc73d['message']));});});}; \ No newline at end of file +var _0xa57f=['http','redis','localhost','socket.io-emitter','request','info','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','attributes','limit','include','map','model','ShowWhatsappQueue','where','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0xa57f,0x1cb));var _0xfa57=function(_0x100456,_0x48112b){_0x100456=_0x100456-0x0;var _0x571df7=_0xa57f[_0x100456];return _0x571df7;};'use strict';var _=require(_0xfa57('0x0'));var util=require(_0xfa57('0x1'));var moment=require('moment');var BPromise=require(_0xfa57('0x2'));var rs=require(_0xfa57('0x3'));var fs=require('fs');var Redis=require(_0xfa57('0x4'));var db=require(_0xfa57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfa57('0x6'));var jayson=require(_0xfa57('0x7'));var client=jayson[_0xfa57('0x8')][_0xfa57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfa57('0xa')],{'host':_0xfa57('0xb'),'port':0x18eb});var socket=require(_0xfa57('0xc'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5d3c13,_0x1ffb04,_0x1ad6f9){return new BPromise(function(_0x195f94,_0x4d1b6e){return client[_0xfa57('0xd')](_0x5d3c13,_0x1ad6f9)['then'](function(_0x425c6f){logger[_0xfa57('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x1ffb04,'request\x20sent');logger[_0xfa57('0xf')](_0xfa57('0x10'),_0x1ffb04,_0xfa57('0x11'),JSON[_0xfa57('0x12')](_0x425c6f));if(_0x425c6f[_0xfa57('0x13')]){if(_0x425c6f[_0xfa57('0x13')]['code']===0x1f4){logger[_0xfa57('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x1ffb04,_0x425c6f[_0xfa57('0x13')][_0xfa57('0x14')]);return _0x4d1b6e(_0x425c6f['error'][_0xfa57('0x14')]);}logger['error'](_0xfa57('0x15'),_0x1ffb04,_0x425c6f['error']['message']);return _0x195f94(_0x425c6f['error']['message']);}else{logger[_0xfa57('0xe')](_0xfa57('0x15'),_0x1ffb04,_0xfa57('0x11'));_0x195f94(_0x425c6f[_0xfa57('0x16')][_0xfa57('0x14')]);}})[_0xfa57('0x17')](function(_0xe4420b){logger[_0xfa57('0x13')](_0xfa57('0x15'),_0x1ffb04,_0xe4420b);_0x4d1b6e(_0xe4420b);});});}exports[_0xfa57('0x18')]=function(_0x4e24ad){var _0x33e4a7=this;return new Promise(function(_0x52f9ac,_0x52d24e){return db[_0xfa57('0x19')]['findAll']({'raw':_0x4e24ad['options']?_0x4e24ad[_0xfa57('0x1a')][_0xfa57('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e24ad[_0xfa57('0x1a')]?_0x4e24ad['options']['where']||null:null,'attributes':_0x4e24ad[_0xfa57('0x1a')]?_0x4e24ad[_0xfa57('0x1a')][_0xfa57('0x1c')]||null:null,'limit':_0x4e24ad[_0xfa57('0x1a')]?_0x4e24ad[_0xfa57('0x1a')][_0xfa57('0x1d')]||null:null,'include':_0x4e24ad[_0xfa57('0x1a')]?_0x4e24ad[_0xfa57('0x1a')][_0xfa57('0x1e')]?_[_0xfa57('0x1f')](_0x4e24ad[_0xfa57('0x1a')][_0xfa57('0x1e')],function(_0xdf1ca0){return{'model':db[_0xdf1ca0[_0xfa57('0x20')]],'as':_0xdf1ca0['as'],'attributes':_0xdf1ca0[_0xfa57('0x1c')],'include':_0xdf1ca0[_0xfa57('0x1e')]?_[_0xfa57('0x1f')](_0xdf1ca0[_0xfa57('0x1e')],function(_0x532d1d){return{'model':db[_0x532d1d[_0xfa57('0x20')]],'as':_0x532d1d['as'],'attributes':_0x532d1d['attributes'],'include':_0x532d1d[_0xfa57('0x1e')]?_['map'](_0x532d1d['include'],function(_0x3cd8d1){return{'model':db[_0x3cd8d1[_0xfa57('0x20')]],'as':_0x3cd8d1['as'],'attributes':_0x3cd8d1[_0xfa57('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47b693){logger[_0xfa57('0xe')](_0xfa57('0x18'),_0x4e24ad);logger['debug']('GetWhatsappQueue',_0x4e24ad,JSON[_0xfa57('0x12')](_0x47b693));_0x52f9ac(_0x47b693);})[_0xfa57('0x17')](function(_0x184bc3){logger['error'](_0xfa57('0x18'),_0x184bc3[_0xfa57('0x14')],_0x4e24ad);_0x52d24e(_0x33e4a7['error'](0x1f4,_0x184bc3[_0xfa57('0x14')]));});});};exports[_0xfa57('0x21')]=function(_0x559e46){var _0x4a8ad6=this;return new Promise(function(_0x1eb4fa,_0x17f847){return db[_0xfa57('0x19')]['find']({'raw':_0x559e46[_0xfa57('0x1a')]?_0x559e46[_0xfa57('0x1a')][_0xfa57('0x1b')]===undefined?!![]:![]:!![],'where':_0x559e46[_0xfa57('0x1a')]?_0x559e46[_0xfa57('0x1a')][_0xfa57('0x22')]||null:null,'attributes':_0x559e46[_0xfa57('0x1a')]?_0x559e46[_0xfa57('0x1a')][_0xfa57('0x1c')]||null:null,'include':_0x559e46[_0xfa57('0x1a')]?_0x559e46['options']['include']?_['map'](_0x559e46[_0xfa57('0x1a')]['include'],function(_0x73d1aa){return{'model':db[_0x73d1aa[_0xfa57('0x20')]],'as':_0x73d1aa['as'],'attributes':_0x73d1aa['attributes'],'include':_0x73d1aa[_0xfa57('0x1e')]?_[_0xfa57('0x1f')](_0x73d1aa[_0xfa57('0x1e')],function(_0x476cf8){return{'model':db[_0x476cf8[_0xfa57('0x20')]],'as':_0x476cf8['as'],'attributes':_0x476cf8[_0xfa57('0x1c')],'include':_0x476cf8[_0xfa57('0x1e')]?_[_0xfa57('0x1f')](_0x476cf8[_0xfa57('0x1e')],function(_0x428729){return{'model':db[_0x428729[_0xfa57('0x20')]],'as':_0x428729['as'],'attributes':_0x428729[_0xfa57('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfa57('0x23')](function(_0x3d7c6c){logger[_0xfa57('0xe')](_0xfa57('0x21'),_0x559e46);logger[_0xfa57('0xf')](_0xfa57('0x21'),_0x559e46,JSON[_0xfa57('0x12')](_0x3d7c6c));_0x1eb4fa(_0x3d7c6c);})[_0xfa57('0x17')](function(_0xf36f0b){logger['error']('ShowWhatsappQueue',_0xf36f0b['message'],_0x559e46);_0x17f847(_0x4a8ad6[_0xfa57('0x13')](0x1f4,_0xf36f0b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index affd631..02d90bf 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1ae=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x502968,_0x215c0d){var _0x2c71f0=function(_0xdae7e8){while(--_0xdae7e8){_0x502968['push'](_0x502968['shift']());}};_0x2c71f0(++_0x215c0d);}(_0xa1ae,0x174));var _0xea1a=function(_0x5635ec,_0x1c2c17){_0x5635ec=_0x5635ec-0x0;var _0x124309=_0xa1ae[_0x5635ec];return _0x124309;};'use strict';var WhatsappQueueEvents=require(_0xea1a('0x0'));var events=[_0xea1a('0x1'),_0xea1a('0x2'),_0xea1a('0x3')];function createListener(_0x553b9d,_0x21dbab){return function(_0x30e5a1){_0x21dbab[_0xea1a('0x4')](_0x553b9d,_0x30e5a1);};}function removeListener(_0x467582,_0x10a18f){return function(){WhatsappQueueEvents[_0xea1a('0x5')](_0x467582,_0x10a18f);};}exports[_0xea1a('0x6')]=function(_0x348ca2){for(var _0x273ef4=0x0,_0x1d1bed=events[_0xea1a('0x7')];_0x273ef4<_0x1d1bed;_0x273ef4++){var _0x246169=events[_0x273ef4];var _0x268099=createListener(_0xea1a('0x8')+_0x246169,_0x348ca2);WhatsappQueueEvents['on'](_0x246169,_0x268099);}}; \ No newline at end of file +var _0x36bf=['emit','removeListener','length','./whatsappQueue.events','remove','update'];(function(_0x2fa144,_0x207d68){var _0x25ac63=function(_0x3ef8ae){while(--_0x3ef8ae){_0x2fa144['push'](_0x2fa144['shift']());}};_0x25ac63(++_0x207d68);}(_0x36bf,0x141));var _0xf36b=function(_0x3fdd72,_0x5cf8a0){_0x3fdd72=_0x3fdd72-0x0;var _0x127284=_0x36bf[_0x3fdd72];return _0x127284;};'use strict';var WhatsappQueueEvents=require(_0xf36b('0x0'));var events=['save',_0xf36b('0x1'),_0xf36b('0x2')];function createListener(_0xd4768a,_0x51c8d5){return function(_0x14a10f){_0x51c8d5[_0xf36b('0x3')](_0xd4768a,_0x14a10f);};}function removeListener(_0x1369bb,_0x54b1b2){return function(){WhatsappQueueEvents[_0xf36b('0x4')](_0x1369bb,_0x54b1b2);};}exports['register']=function(_0x1e6932){for(var _0x2250f2=0x0,_0x2c3de9=events[_0xf36b('0x5')];_0x2250f2<_0x2c3de9;_0x2250f2++){var _0x52e9c4=events[_0x2250f2];var _0x59f4a1=createListener('whatsappQueue:'+_0x52e9c4,_0x1e6932);WhatsappQueueEvents['on'](_0x52e9c4,_0x59f4a1);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 026c443..0008be9 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x756b=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','multer','util'];(function(_0x24270a,_0x58a926){var _0x53fa12=function(_0x23cd8c){while(--_0x23cd8c){_0x24270a['push'](_0x24270a['shift']());}};_0x53fa12(++_0x58a926);}(_0x756b,0xa0));var _0xb756=function(_0x38c01b,_0x399d76){_0x38c01b=_0x38c01b-0x0;var _0x40b880=_0x756b[_0x38c01b];return _0x40b880;};'use strict';var multer=require(_0xb756('0x0'));var util=require(_0xb756('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb756('0x2'));var router=express[_0xb756('0x3')]();var fs_extra=require(_0xb756('0x4'));var auth=require(_0xb756('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb756('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xb756('0x7')]('/',auth[_0xb756('0x8')](),controller[_0xb756('0x9')]);router[_0xb756('0x7')](_0xb756('0xa'),auth[_0xb756('0x8')](),controller[_0xb756('0xb')]);router[_0xb756('0x7')](_0xb756('0xc'),auth[_0xb756('0x8')](),controller[_0xb756('0xd')]);router[_0xb756('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb756('0xf')]('/:id',auth[_0xb756('0x8')](),controller['update']);router[_0xb756('0x10')](_0xb756('0xc'),auth[_0xb756('0x8')](),controller[_0xb756('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0846=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0xaea115,_0x5be14f){var _0x1500b3=function(_0x53b31c){while(--_0x53b31c){_0xaea115['push'](_0xaea115['shift']());}};_0x1500b3(++_0x5be14f);}(_0x0846,0xe3));var _0x6084=function(_0x24826c,_0x5d4ad3){_0x24826c=_0x24826c-0x0;var _0x5ca07b=_0x0846[_0x24826c];return _0x5ca07b;};'use strict';var multer=require(_0x6084('0x0'));var util=require(_0x6084('0x1'));var path=require('path');var timeout=require(_0x6084('0x2'));var express=require('express');var router=express[_0x6084('0x3')]();var fs_extra=require(_0x6084('0x4'));var auth=require(_0x6084('0x5'));var interaction=require(_0x6084('0x6'));var config=require(_0x6084('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x6084('0x8')]('/',auth[_0x6084('0x9')](),controller['index']);router[_0x6084('0x8')](_0x6084('0xa'),auth[_0x6084('0x9')](),controller[_0x6084('0xb')]);router[_0x6084('0x8')](_0x6084('0xc'),auth[_0x6084('0x9')](),controller[_0x6084('0xd')]);router[_0x6084('0xe')]('/',auth[_0x6084('0x9')](),controller[_0x6084('0xf')]);router[_0x6084('0x10')](_0x6084('0xc'),auth[_0x6084('0x9')](),controller[_0x6084('0x11')]);router[_0x6084('0x12')](_0x6084('0xc'),auth[_0x6084('0x9')](),controller[_0x6084('0x13')]);module[_0x6084('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index fea2a55..d17b8a4 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x11ae3d,_0x40fae0){var _0x5a00fb=function(_0x5197aa){while(--_0x5197aa){_0x11ae3d['push'](_0x11ae3d['shift']());}};_0x5a00fb(++_0x40fae0);}(_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')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2df3a2,_0x2d52dc){var _0xee707c=function(_0x44b249){while(--_0x44b249){_0x2df3a2['push'](_0x2df3a2['shift']());}};_0xee707c(++_0x2d52dc);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 8b16147..bb98e93 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cb4=['apply','reject','save','update','then','stack','name','send','index','map','WhatsappQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range'];(function(_0x2ad6b2,_0x5b7de){var _0x5a318f=function(_0x325a64){while(--_0x325a64){_0x2ad6b2['push'](_0x2ad6b2['shift']());}};_0x5a318f(++_0x5b7de);}(_0x6cb4,0xff));var _0x46cb=function(_0xa42ce7,_0x165b03){_0xa42ce7=_0xa42ce7-0x0;var _0x1dab48=_0x6cb4[_0xa42ce7];return _0x1dab48;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];function respondWithStatusCode(_0x323ac2,_0x1058a8){_0x1058a8=_0x1058a8||0xcc;return function(_0xf22158){if(_0xf22158){return _0x323ac2['sendStatus'](_0x1058a8);}return _0x323ac2[_0x46cb('0x18')](_0x1058a8)[_0x46cb('0x19')]();};}function respondWithResult(_0x2a1f9d,_0x3c0071){_0x3c0071=_0x3c0071||0xc8;return function(_0x1f7150){if(_0x1f7150){return _0x2a1f9d[_0x46cb('0x18')](_0x3c0071)[_0x46cb('0x1a')](_0x1f7150);}};}function respondWithFilteredResult(_0x3c396b,_0x37d368){return function(_0x41e398){if(_0x41e398){var _0x136215=typeof _0x37d368['offset']===_0x46cb('0x1b')&&typeof _0x37d368['limit']===_0x46cb('0x1b');var _0x4ab22b=_0x41e398['count'];var _0x4e3454=_0x136215?0x0:_0x37d368[_0x46cb('0x1c')];var _0x1f2891=_0x136215?_0x41e398[_0x46cb('0x1d')]:_0x37d368[_0x46cb('0x1c')]+_0x37d368[_0x46cb('0x1e')];var _0x26e38d;if(_0x1f2891>=_0x4ab22b){_0x1f2891=_0x4ab22b;_0x26e38d=0xc8;}else{_0x26e38d=0xce;}_0x3c396b[_0x46cb('0x18')](_0x26e38d);return _0x3c396b[_0x46cb('0x1f')](_0x46cb('0x20'),_0x4e3454+'-'+_0x1f2891+'/'+_0x4ab22b)[_0x46cb('0x1a')](_0x41e398);}return null;};}function patchUpdates(_0x149483){return function(_0x46e541){try{jsonpatch[_0x46cb('0x21')](_0x46e541,_0x149483,!![]);}catch(_0x2f438b){return BPromise[_0x46cb('0x22')](_0x2f438b);}return _0x46e541[_0x46cb('0x23')]();};}function saveUpdates(_0x7084b2,_0x1fb467){return function(_0x41ecd2){if(_0x41ecd2){return _0x41ecd2[_0x46cb('0x24')](_0x7084b2)[_0x46cb('0x25')](function(_0x1e9e38){return _0x1e9e38;});}return null;};}function removeEntity(_0x309e4b,_0xadcad6){return function(_0x40e0e5){if(_0x40e0e5){return _0x40e0e5['destroy']()['then'](function(){_0x309e4b[_0x46cb('0x18')](0xcc)[_0x46cb('0x19')]();});}};}function handleEntityNotFound(_0x2711ac,_0xe078a8){return function(_0x6e6d9){if(!_0x6e6d9){_0x2711ac['sendStatus'](0x194);}return _0x6e6d9;};}function handleError(_0xc5a9a4,_0x578ffd){_0x578ffd=_0x578ffd||0x1f4;return function(_0x495886){logger['error'](_0x495886[_0x46cb('0x26')]);if(_0x495886[_0x46cb('0x27')]){delete _0x495886[_0x46cb('0x27')];}_0xc5a9a4[_0x46cb('0x18')](_0x578ffd)[_0x46cb('0x28')](_0x495886);};}exports[_0x46cb('0x29')]=function(_0x378dc7,_0x8c65b2){var _0x2b846a={},_0x12e01e={},_0x4620ef={'count':0x0,'rows':[]};var _0x4a1517=_[_0x46cb('0x2a')](db[_0x46cb('0x2b')]['rawAttributes'],function(_0x49e0bc){return{'name':_0x49e0bc[_0x46cb('0x2c')],'type':_0x49e0bc['type'][_0x46cb('0x2d')]};});_0x12e01e[_0x46cb('0x2e')]=_[_0x46cb('0x2a')](_0x4a1517,_0x46cb('0x27'));_0x12e01e[_0x46cb('0x2f')]=_[_0x46cb('0x30')](_0x378dc7['query']);_0x12e01e[_0x46cb('0x31')]=_['intersection'](_0x12e01e[_0x46cb('0x2e')],_0x12e01e[_0x46cb('0x2f')]);_0x2b846a['attributes']=_[_0x46cb('0x32')](_0x12e01e[_0x46cb('0x2e')],qs[_0x46cb('0x33')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x33')]));_0x2b846a['attributes']=_0x2b846a[_0x46cb('0x34')]['length']?_0x2b846a[_0x46cb('0x34')]:_0x12e01e[_0x46cb('0x2e')];if(!_0x378dc7[_0x46cb('0x2f')]['hasOwnProperty'](_0x46cb('0x35'))){_0x2b846a[_0x46cb('0x1e')]=qs['limit'](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x1e')]);_0x2b846a[_0x46cb('0x1c')]=qs[_0x46cb('0x1c')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x1c')]);}_0x2b846a[_0x46cb('0x36')]=qs[_0x46cb('0x37')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x37')]);_0x2b846a[_0x46cb('0x38')]=qs['filters'](_['pick'](_0x378dc7['query'],_0x12e01e[_0x46cb('0x31')]),_0x4a1517);if(_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x39')]){_0x2b846a[_0x46cb('0x38')]=_[_0x46cb('0x3a')](_0x2b846a[_0x46cb('0x38')],{'$or':_['map'](_0x4a1517,function(_0x1f2e11){if(_0x1f2e11['type']!=='VIRTUAL'){var _0x173fac={};_0x173fac[_0x1f2e11['name']]={'$like':'%'+_0x378dc7['query'][_0x46cb('0x39')]+'%'};return _0x173fac;}})});}_0x2b846a=_['merge']({},_0x2b846a,_0x378dc7['options']);var _0x67bd14={'where':_0x2b846a[_0x46cb('0x38')]};return db[_0x46cb('0x2b')][_0x46cb('0x1d')](_0x67bd14)[_0x46cb('0x25')](function(_0x4075b4){_0x4620ef[_0x46cb('0x1d')]=_0x4075b4;if(_0x378dc7['query'][_0x46cb('0x3b')]){_0x2b846a['include']=[{'all':!![]}];}return db[_0x46cb('0x2b')]['findAll'](_0x2b846a);})[_0x46cb('0x25')](function(_0x2fbad9){_0x4620ef[_0x46cb('0x3c')]=_0x2fbad9;return _0x4620ef;})['then'](respondWithFilteredResult(_0x8c65b2,_0x2b846a))[_0x46cb('0x3d')](handleError(_0x8c65b2,null));};exports[_0x46cb('0x3e')]=function(_0x4d24b6,_0x18be96){var _0x3d0b83={'raw':!![],'where':{'id':_0x4d24b6[_0x46cb('0x3f')]['id']}},_0x1f67af={};_0x1f67af[_0x46cb('0x2e')]=_['keys'](db['WhatsappQueueReport'][_0x46cb('0x40')]);_0x1f67af['query']=_[_0x46cb('0x30')](_0x4d24b6[_0x46cb('0x2f')]);_0x1f67af['filters']=_[_0x46cb('0x32')](_0x1f67af[_0x46cb('0x2e')],_0x1f67af[_0x46cb('0x2f')]);_0x3d0b83['attributes']=_['intersection'](_0x1f67af['model'],qs['fields'](_0x4d24b6[_0x46cb('0x2f')][_0x46cb('0x33')]));_0x3d0b83[_0x46cb('0x34')]=_0x3d0b83[_0x46cb('0x34')][_0x46cb('0x41')]?_0x3d0b83['attributes']:_0x1f67af['model'];if(_0x4d24b6[_0x46cb('0x2f')][_0x46cb('0x3b')]){_0x3d0b83['include']=[{'all':!![]}];}_0x3d0b83=_[_0x46cb('0x3a')]({},_0x3d0b83,_0x4d24b6[_0x46cb('0x42')]);return db[_0x46cb('0x2b')][_0x46cb('0x43')](_0x3d0b83)[_0x46cb('0x25')](handleEntityNotFound(_0x18be96,null))[_0x46cb('0x25')](respondWithResult(_0x18be96,null))[_0x46cb('0x3d')](handleError(_0x18be96,null));};exports['create']=function(_0x58c69f,_0x449593){return db['WhatsappQueueReport'][_0x46cb('0x44')](_0x58c69f[_0x46cb('0x45')],{})[_0x46cb('0x25')](respondWithResult(_0x449593,0xc9))['catch'](handleError(_0x449593,null));};exports[_0x46cb('0x24')]=function(_0x5c1665,_0x5c02c9){if(_0x5c1665[_0x46cb('0x45')]['id']){delete _0x5c1665[_0x46cb('0x45')]['id'];}return db[_0x46cb('0x2b')][_0x46cb('0x43')]({'where':{'id':_0x5c1665[_0x46cb('0x3f')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x5c02c9,null))[_0x46cb('0x25')](saveUpdates(_0x5c1665['body'],null))['then'](respondWithResult(_0x5c02c9,null))[_0x46cb('0x3d')](handleError(_0x5c02c9,null));};exports[_0x46cb('0x46')]=function(_0x52e479,_0x34399d){return db[_0x46cb('0x2b')][_0x46cb('0x43')]({'where':{'id':_0x52e479[_0x46cb('0x3f')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x34399d,null))['then'](removeEntity(_0x34399d,null))[_0x46cb('0x3d')](handleError(_0x34399d,null));};exports[_0x46cb('0x47')]=function(_0x20cf6d,_0x52d1a7){return db[_0x46cb('0x2b')]['describe']()['then'](respondWithResult(_0x52d1a7,null))[_0x46cb('0x3d')](handleError(_0x52d1a7,null));}; \ No newline at end of file +var _0x34b7=['WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','show','params','includeAll','include','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x34b7,0x196));var _0x734b=function(_0x58d092,_0x36a559){_0x58d092=_0x58d092-0x0;var _0xe2d411=_0x34b7[_0x58d092];return _0xe2d411;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x26')]();});}};}function handleEntityNotFound(_0x3abbe6,_0x44ffa9){return function(_0x148abe){if(!_0x148abe){_0x3abbe6[_0x734b('0x18')](0x194);}return _0x148abe;};}function handleError(_0x566d55,_0x49732b){_0x49732b=_0x49732b||0x1f4;return function(_0x13cc5a){logger[_0x734b('0x27')](_0x13cc5a['stack']);if(_0x13cc5a[_0x734b('0x28')]){delete _0x13cc5a[_0x734b('0x28')];}_0x566d55[_0x734b('0x19')](_0x49732b)[_0x734b('0x29')](_0x13cc5a);};}exports[_0x734b('0x2a')]=function(_0x1b8295,_0x3ba39c){var _0x5c6c5d={},_0x1f3652={},_0x436efe={'count':0x0,'rows':[]};var _0x42e9ae=_[_0x734b('0x2b')](db[_0x734b('0x2c')][_0x734b('0x2d')],function(_0x1fed72){return{'name':_0x1fed72[_0x734b('0x2e')],'type':_0x1fed72[_0x734b('0x2f')][_0x734b('0x30')]};});_0x1f3652['model']=_[_0x734b('0x2b')](_0x42e9ae,_0x734b('0x28'));_0x1f3652['query']=_[_0x734b('0x31')](_0x1b8295[_0x734b('0x32')]);_0x1f3652[_0x734b('0x33')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],_0x1f3652[_0x734b('0x32')]);_0x5c6c5d[_0x734b('0x36')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],qs[_0x734b('0x37')](_0x1b8295[_0x734b('0x32')][_0x734b('0x37')]));_0x5c6c5d[_0x734b('0x36')]=_0x5c6c5d[_0x734b('0x36')][_0x734b('0x38')]?_0x5c6c5d['attributes']:_0x1f3652[_0x734b('0x35')];if(!_0x1b8295['query'][_0x734b('0x39')](_0x734b('0x3a'))){_0x5c6c5d[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x1b8295[_0x734b('0x32')][_0x734b('0x1e')]);_0x5c6c5d['offset']=qs['offset'](_0x1b8295[_0x734b('0x32')]['offset']);}_0x5c6c5d[_0x734b('0x3b')]=qs['sort'](_0x1b8295[_0x734b('0x32')]['sort']);_0x5c6c5d[_0x734b('0x3c')]=qs['filters'](_[_0x734b('0x3d')](_0x1b8295[_0x734b('0x32')],_0x1f3652[_0x734b('0x33')]),_0x42e9ae);if(_0x1b8295[_0x734b('0x32')][_0x734b('0x3e')]){_0x5c6c5d[_0x734b('0x3c')]=_[_0x734b('0x3f')](_0x5c6c5d['where'],{'$or':_[_0x734b('0x2b')](_0x42e9ae,function(_0x317d32){if(_0x317d32['type']!==_0x734b('0x40')){var _0x309b31={};_0x309b31[_0x317d32[_0x734b('0x28')]]={'$like':'%'+_0x1b8295[_0x734b('0x32')]['filter']+'%'};return _0x309b31;}})});}_0x5c6c5d=_[_0x734b('0x3f')]({},_0x5c6c5d,_0x1b8295[_0x734b('0x41')]);var _0x4efb1f={'where':_0x5c6c5d[_0x734b('0x3c')]};return db[_0x734b('0x2c')]['count'](_0x4efb1f)[_0x734b('0x24')](function(_0x2d8f31){_0x436efe[_0x734b('0x1d')]=_0x2d8f31;if(_0x1b8295[_0x734b('0x32')]['includeAll']){_0x5c6c5d['include']=[{'all':!![]}];}return db[_0x734b('0x2c')]['findAll'](_0x5c6c5d);})['then'](function(_0x121a00){_0x436efe['rows']=_0x121a00;return _0x436efe;})[_0x734b('0x24')](respondWithFilteredResult(_0x3ba39c,_0x5c6c5d))['catch'](handleError(_0x3ba39c,null));};exports[_0x734b('0x42')]=function(_0x337106,_0xe4fe38){var _0x4c3fdc={'raw':!![],'where':{'id':_0x337106[_0x734b('0x43')]['id']}},_0x5cf3a0={};_0x5cf3a0['model']=_['keys'](db[_0x734b('0x2c')][_0x734b('0x2d')]);_0x5cf3a0['query']=_[_0x734b('0x31')](_0x337106['query']);_0x5cf3a0[_0x734b('0x33')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],_0x5cf3a0['query']);_0x4c3fdc[_0x734b('0x36')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],qs[_0x734b('0x37')](_0x337106['query']['fields']));_0x4c3fdc['attributes']=_0x4c3fdc[_0x734b('0x36')]['length']?_0x4c3fdc['attributes']:_0x5cf3a0[_0x734b('0x35')];if(_0x337106['query'][_0x734b('0x44')]){_0x4c3fdc[_0x734b('0x45')]=[{'all':!![]}];}_0x4c3fdc=_[_0x734b('0x3f')]({},_0x4c3fdc,_0x337106[_0x734b('0x41')]);return db['WhatsappQueueReport'][_0x734b('0x46')](_0x4c3fdc)['then'](handleEntityNotFound(_0xe4fe38,null))[_0x734b('0x24')](respondWithResult(_0xe4fe38,null))[_0x734b('0x47')](handleError(_0xe4fe38,null));};exports[_0x734b('0x48')]=function(_0x5cdacb,_0x370326){return db['WhatsappQueueReport'][_0x734b('0x48')](_0x5cdacb[_0x734b('0x49')],{})['then'](respondWithResult(_0x370326,0xc9))[_0x734b('0x47')](handleError(_0x370326,null));};exports[_0x734b('0x4a')]=function(_0x145ced,_0x38125a){if(_0x145ced[_0x734b('0x49')]['id']){delete _0x145ced['body']['id'];}return db[_0x734b('0x2c')]['find']({'where':{'id':_0x145ced[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x38125a,null))[_0x734b('0x24')](saveUpdates(_0x145ced[_0x734b('0x49')],null))[_0x734b('0x24')](respondWithResult(_0x38125a,null))[_0x734b('0x47')](handleError(_0x38125a,null));};exports[_0x734b('0x25')]=function(_0x4b70f2,_0x4c0378){return db['WhatsappQueueReport'][_0x734b('0x46')]({'where':{'id':_0x4b70f2[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c0378,null))[_0x734b('0x24')](removeEntity(_0x4c0378,null))[_0x734b('0x47')](handleError(_0x4c0378,null));};exports['describe']=function(_0x167173,_0x3a9749){return db[_0x734b('0x2c')]['describe']()[_0x734b('0x24')](respondWithResult(_0x3a9749,null))[_0x734b('0x47')](handleError(_0x3a9749,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c4c9fac..38ae970 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc277=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','uniqueid'];(function(_0x1680ea,_0x3c6c58){var _0x25c2a8=function(_0x1571c8){while(--_0x1571c8){_0x1680ea['push'](_0x1680ea['shift']());}};_0x25c2a8(++_0x3c6c58);}(_0xc277,0x104));var _0x7c27=function(_0x4e33b2,_0x320b65){_0x4e33b2=_0x4e33b2-0x0;var _0x2564c8=_0xc277[_0x4e33b2];return _0x2564c8;};'use strict';var _=require(_0x7c27('0x0'));var util=require(_0x7c27('0x1'));var logger=require(_0x7c27('0x2'))(_0x7c27('0x3'));var moment=require('moment');var BPromise=require(_0x7c27('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c27('0x5'));var rimraf=require(_0x7c27('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x7c27('0x7')]=function(_0x105a33,_0x44c5d5){return _0x105a33[_0x7c27('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x7c27('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9976=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2f2e3f,_0x902203){var _0x2bb971=function(_0x584cb9){while(--_0x584cb9){_0x2f2e3f['push'](_0x2f2e3f['shift']());}};_0x2bb971(++_0x902203);}(_0x9976,0x88));var _0x6997=function(_0x99e31c,_0x501de3){_0x99e31c=_0x99e31c-0x0;var _0x4a125c=_0x9976[_0x99e31c];return _0x4a125c;};'use strict';var _=require(_0x6997('0x0'));var util=require(_0x6997('0x1'));var logger=require(_0x6997('0x2'))(_0x6997('0x3'));var moment=require('moment');var BPromise=require(_0x6997('0x4'));var rp=require(_0x6997('0x5'));var fs=require('fs');var path=require(_0x6997('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6997('0x7'));module[_0x6997('0x8')]=function(_0x55d659,_0x244e6a){return _0x55d659[_0x6997('0x9')](_0x6997('0xa'),attributes,{'tableName':_0x6997('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6997('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 920e1f5..1f91326 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dd5=['UpdateWhatsappQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','debug','body','where','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3dd5,0x1e2));var _0x53dd=function(_0x243b53,_0x5b8264){_0x243b53=_0x243b53-0x0;var _0x4cc63b=_0x3dd5[_0x243b53];return _0x4cc63b;};'use strict';var _=require(_0x53dd('0x0'));var util=require(_0x53dd('0x1'));var moment=require(_0x53dd('0x2'));var BPromise=require(_0x53dd('0x3'));var rs=require(_0x53dd('0x4'));var fs=require('fs');var Redis=require(_0x53dd('0x5'));var db=require(_0x53dd('0x6'))['db'];var utils=require(_0x53dd('0x7'));var logger=require(_0x53dd('0x8'))('rpc');var config=require(_0x53dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x53dd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30e750,_0x57018b,_0x5ce527){return new BPromise(function(_0x2050ab,_0x34a3ec){return client[_0x53dd('0xb')](_0x30e750,_0x5ce527)[_0x53dd('0xc')](function(_0x4a3369){logger['info'](_0x53dd('0xd'),_0x57018b,_0x53dd('0xe'));logger['debug'](_0x53dd('0xf'),_0x57018b,_0x53dd('0xe'),JSON['stringify'](_0x4a3369));if(_0x4a3369[_0x53dd('0x10')]){if(_0x4a3369['error']['code']===0x1f4){logger[_0x53dd('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x57018b,_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);return _0x34a3ec(_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);}logger[_0x53dd('0x10')](_0x53dd('0xd'),_0x57018b,_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);return _0x2050ab(_0x4a3369[_0x53dd('0x10')][_0x53dd('0x11')]);}else{logger[_0x53dd('0x12')](_0x53dd('0xd'),_0x57018b,_0x53dd('0xe'));_0x2050ab(_0x4a3369['result']['message']);}})[_0x53dd('0x13')](function(_0x24d726){logger[_0x53dd('0x10')](_0x53dd('0xd'),_0x57018b,_0x24d726);_0x34a3ec(_0x24d726);});});}exports[_0x53dd('0x14')]=function(_0xb3e07c){var _0x9ca6a0=this;return new Promise(function(_0x5a70dc,_0x5eb40d){return db[_0x53dd('0x15')][_0x53dd('0x16')](_0xb3e07c['body'],{'raw':_0xb3e07c[_0x53dd('0x17')]?_0xb3e07c[_0x53dd('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x53dd('0xc')](function(_0x19d7ed){logger[_0x53dd('0x12')](_0x53dd('0x14'),_0xb3e07c);logger[_0x53dd('0x18')](_0x53dd('0x14'),_0xb3e07c,JSON['stringify'](_0x19d7ed));_0x5a70dc(_0x19d7ed);})[_0x53dd('0x13')](function(_0x3b3778){logger[_0x53dd('0x10')]('CreateWhatsappQueueReport',_0x3b3778[_0x53dd('0x11')],_0xb3e07c);_0x5eb40d(_0x9ca6a0[_0x53dd('0x10')](0x1f4,_0x3b3778['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xf2221a){var _0x4b20aa=this;return new Promise(function(_0x35f041,_0x547f2b){return db[_0x53dd('0x15')]['update'](_0xf2221a[_0x53dd('0x19')],{'raw':_0xf2221a[_0x53dd('0x17')]?_0xf2221a[_0x53dd('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf2221a[_0x53dd('0x17')]?_0xf2221a[_0x53dd('0x17')][_0x53dd('0x1a')]||null:null,'attributes':_0xf2221a[_0x53dd('0x17')]?_0xf2221a['options'][_0x53dd('0x1b')]||null:null,'limit':_0xf2221a[_0x53dd('0x17')]?_0xf2221a[_0x53dd('0x17')]['limit']||null:null})['then'](function(_0x5e47a6){logger[_0x53dd('0x12')](_0x53dd('0x1c'),_0xf2221a);logger['debug'](_0x53dd('0x1c'),_0xf2221a,JSON[_0x53dd('0x1d')](_0x5e47a6));_0x35f041(_0x5e47a6);})[_0x53dd('0x13')](function(_0x474d99){logger[_0x53dd('0x10')](_0x53dd('0x1c'),_0x474d99[_0x53dd('0x11')],_0xf2221a);_0x547f2b(_0x4b20aa['error'](0x1f4,_0x474d99[_0x53dd('0x11')]));});});}; \ No newline at end of file +var _0x8886=['rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','debug','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0x8886,0x14d));var _0x6888=function(_0x96c417,_0x2120be){_0x96c417=_0x96c417-0x0;var _0x4fb703=_0x8886[_0x96c417];return _0x4fb703;};'use strict';var _=require(_0x6888('0x0'));var util=require(_0x6888('0x1'));var moment=require(_0x6888('0x2'));var BPromise=require('bluebird');var rs=require(_0x6888('0x3'));var fs=require('fs');var Redis=require(_0x6888('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6888('0x5'));var logger=require(_0x6888('0x6'))(_0x6888('0x7'));var config=require(_0x6888('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6888('0x9')][_0x6888('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d402a,_0x3f91a5,_0x38adac){return new BPromise(function(_0x2a0d8f,_0x56d65e){return client[_0x6888('0xb')](_0x1d402a,_0x38adac)[_0x6888('0xc')](function(_0x42a0a9){logger[_0x6888('0xd')](_0x6888('0xe'),_0x3f91a5,_0x6888('0xf'));logger['debug'](_0x6888('0x10'),_0x3f91a5,_0x6888('0xf'),JSON[_0x6888('0x11')](_0x42a0a9));if(_0x42a0a9[_0x6888('0x12')]){if(_0x42a0a9[_0x6888('0x12')][_0x6888('0x13')]===0x1f4){logger['error'](_0x6888('0xe'),_0x3f91a5,_0x42a0a9[_0x6888('0x12')]['message']);return _0x56d65e(_0x42a0a9[_0x6888('0x12')][_0x6888('0x14')]);}logger[_0x6888('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3f91a5,_0x42a0a9[_0x6888('0x12')][_0x6888('0x14')]);return _0x2a0d8f(_0x42a0a9[_0x6888('0x12')][_0x6888('0x14')]);}else{logger[_0x6888('0xd')](_0x6888('0xe'),_0x3f91a5,_0x6888('0xf'));_0x2a0d8f(_0x42a0a9[_0x6888('0x15')]['message']);}})[_0x6888('0x16')](function(_0x464653){logger[_0x6888('0x12')](_0x6888('0xe'),_0x3f91a5,_0x464653);_0x56d65e(_0x464653);});});}exports['CreateWhatsappQueueReport']=function(_0x1ed21a){var _0x3bfcf2=this;return new Promise(function(_0x42c576,_0x133685){return db['WhatsappQueueReport'][_0x6888('0x17')](_0x1ed21a[_0x6888('0x18')],{'raw':_0x1ed21a['options']?_0x1ed21a[_0x6888('0x19')][_0x6888('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x43ac02){logger[_0x6888('0xd')]('CreateWhatsappQueueReport',_0x1ed21a);logger[_0x6888('0x1b')](_0x6888('0x1c'),_0x1ed21a,JSON[_0x6888('0x11')](_0x43ac02));_0x42c576(_0x43ac02);})['catch'](function(_0x552940){logger[_0x6888('0x12')]('CreateWhatsappQueueReport',_0x552940[_0x6888('0x14')],_0x1ed21a);_0x133685(_0x3bfcf2[_0x6888('0x12')](0x1f4,_0x552940[_0x6888('0x14')]));});});};exports[_0x6888('0x1d')]=function(_0x1e4b29){var _0x497bf4=this;return new Promise(function(_0x2230cd,_0x398878){return db[_0x6888('0x1e')]['update'](_0x1e4b29['body'],{'raw':_0x1e4b29[_0x6888('0x19')]?_0x1e4b29['options'][_0x6888('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4b29[_0x6888('0x19')]?_0x1e4b29['options'][_0x6888('0x1f')]||null:null,'attributes':_0x1e4b29['options']?_0x1e4b29[_0x6888('0x19')][_0x6888('0x20')]||null:null,'limit':_0x1e4b29[_0x6888('0x19')]?_0x1e4b29['options'][_0x6888('0x21')]||null:null})['then'](function(_0x3dbfcc){logger[_0x6888('0xd')](_0x6888('0x1d'),_0x1e4b29);logger[_0x6888('0x1b')](_0x6888('0x1d'),_0x1e4b29,JSON[_0x6888('0x11')](_0x3dbfcc));_0x2230cd(_0x3dbfcc);})[_0x6888('0x16')](function(_0x4a1682){logger[_0x6888('0x12')](_0x6888('0x1d'),_0x4a1682['message'],_0x1e4b29);_0x398878(_0x497bf4[_0x6888('0x12')](0x1f4,_0x4a1682[_0x6888('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index ccf5a0d..5d78023 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81fa=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','update'];(function(_0x3ffba0,_0x1e16ff){var _0x276413=function(_0x22f9fd){while(--_0x22f9fd){_0x3ffba0['push'](_0x3ffba0['shift']());}};_0x276413(++_0x1e16ff);}(_0x81fa,0xdf));var _0xa81f=function(_0x2baa5d,_0x42a1cb){_0x2baa5d=_0x2baa5d-0x0;var _0x88bf18=_0x81fa[_0x2baa5d];return _0x88bf18;};'use strict';var multer=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var path=require(_0xa81f('0x2'));var timeout=require(_0xa81f('0x3'));var express=require(_0xa81f('0x4'));var router=express[_0xa81f('0x5')]();var fs_extra=require(_0xa81f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa81f('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xa81f('0x8')]('/',auth[_0xa81f('0x9')](),controller[_0xa81f('0xa')]);router[_0xa81f('0x8')](_0xa81f('0xb'),auth[_0xa81f('0x9')](),controller['describe']);router[_0xa81f('0x8')](_0xa81f('0xc'),auth['isAuthenticated'](),controller[_0xa81f('0xd')]);router['post']('/',auth[_0xa81f('0x9')](),controller['create']);router['put'](_0xa81f('0xc'),auth[_0xa81f('0x9')](),controller[_0xa81f('0xe')]);router[_0xa81f('0xf')](_0xa81f('0xc'),auth[_0xa81f('0x9')](),controller[_0xa81f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6e24=['/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','show','post','create','update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6e24,0x1cb));var _0x46e2=function(_0xe20e66,_0xe29944){_0xe20e66=_0xe20e66-0x0;var _0x5d0095=_0x6e24[_0xe20e66];return _0x5d0095;};'use strict';var multer=require(_0x46e2('0x0'));var util=require('util');var path=require(_0x46e2('0x1'));var timeout=require(_0x46e2('0x2'));var express=require(_0x46e2('0x3'));var router=express[_0x46e2('0x4')]();var fs_extra=require(_0x46e2('0x5'));var auth=require(_0x46e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x46e2('0x7'));var controller=require(_0x46e2('0x8'));router[_0x46e2('0x9')]('/',auth[_0x46e2('0xa')](),controller['index']);router[_0x46e2('0x9')](_0x46e2('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x46e2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x46e2('0xc')]);router[_0x46e2('0xd')]('/',auth['isAuthenticated'](),controller[_0x46e2('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x46e2('0xf')]);router['delete'](_0x46e2('0x10'),auth[_0x46e2('0xa')](),controller[_0x46e2('0x11')]);module[_0x46e2('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a743a72..159ce45 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75dc=['DATE','sequelize','exports','agent','queue'];(function(_0xf11d52,_0x54d5bf){var _0x256cba=function(_0x38ad63){while(--_0x38ad63){_0xf11d52['push'](_0xf11d52['shift']());}};_0x256cba(++_0x54d5bf);}(_0x75dc,0x1d7));var _0xc75d=function(_0x5c3891,_0x284f4c){_0x5c3891=_0x5c3891-0x0;var _0x34ecda=_0x75dc[_0x5c3891];return _0x34ecda;};'use strict';var Sequelize=require(_0xc75d('0x0'));module[_0xc75d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xc75d('0x2'),_0xc75d('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc75d('0x4')]}}; \ No newline at end of file +var _0xa887=['STRING','ENUM','agent','queue','DATE','sequelize'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0xa887,0x89));var _0x7a88=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa887[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0x7a88('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7a88('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7a88('0x2')]('account',_0x7a88('0x3'),_0x7a88('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7a88('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2221937..44758f9 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x956c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','offset','count','set','Content-Range','apply','update','then','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','WhatsappTransferReport','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs'];(function(_0x3241f3,_0x537340){var _0x29ac16=function(_0x1847a3){while(--_0x1847a3){_0x3241f3['push'](_0x3241f3['shift']());}};_0x29ac16(++_0x537340);}(_0x956c,0x1d5));var _0xc956=function(_0x5cdd2f,_0x77b5b4){_0x5cdd2f=_0x5cdd2f-0x0;var _0x611149=_0x956c[_0x5cdd2f];return _0x611149;};'use strict';var emlformat=require(_0xc956('0x0'));var rimraf=require(_0xc956('0x1'));var zipdir=require(_0xc956('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc956('0x3'));var moment=require(_0xc956('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc956('0x5'));var util=require('util');var path=require(_0xc956('0x6'));var sox=require('sox');var csv=require(_0xc956('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc956('0x8'));var squel=require(_0xc956('0x9'));var crypto=require(_0xc956('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc956('0xb'));var toCsv=require(_0xc956('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc956('0xc'));var qs=require(_0xc956('0xd'));var as=require(_0xc956('0xe'));var hardwareService=require(_0xc956('0xf'));var logger=require(_0xc956('0x10'))(_0xc956('0x11'));var utils=require(_0xc956('0x12'));var config=require(_0xc956('0x13'));var licenseUtil=require(_0xc956('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a2b77,_0xde625d){_0xde625d=_0xde625d||0xcc;return function(_0x125e51){if(_0x125e51){return _0x2a2b77[_0xc956('0x15')](_0xde625d);}return _0x2a2b77[_0xc956('0x16')](_0xde625d)[_0xc956('0x17')]();};}function respondWithResult(_0x5e03f3,_0xe6c45a){_0xe6c45a=_0xe6c45a||0xc8;return function(_0x35431f){if(_0x35431f){return _0x5e03f3[_0xc956('0x16')](_0xe6c45a)[_0xc956('0x18')](_0x35431f);}};}function respondWithFilteredResult(_0x502494,_0x25d1ca){return function(_0x15b41f){if(_0x15b41f){var _0x52dd38=typeof _0x25d1ca['offset']==='undefined'&&typeof _0x25d1ca[_0xc956('0x19')]==='undefined';var _0x16472d=_0x15b41f['count'];var _0x154ec6=_0x52dd38?0x0:_0x25d1ca[_0xc956('0x1a')];var _0x51a8c2=_0x52dd38?_0x15b41f[_0xc956('0x1b')]:_0x25d1ca[_0xc956('0x1a')]+_0x25d1ca[_0xc956('0x19')];var _0x52f7b7;if(_0x51a8c2>=_0x16472d){_0x51a8c2=_0x16472d;_0x52f7b7=0xc8;}else{_0x52f7b7=0xce;}_0x502494[_0xc956('0x16')](_0x52f7b7);return _0x502494[_0xc956('0x1c')](_0xc956('0x1d'),_0x154ec6+'-'+_0x51a8c2+'/'+_0x16472d)[_0xc956('0x18')](_0x15b41f);}return null;};}function patchUpdates(_0x338f88){return function(_0x2cb86b){try{jsonpatch[_0xc956('0x1e')](_0x2cb86b,_0x338f88,!![]);}catch(_0x52bfdf){return BPromise['reject'](_0x52bfdf);}return _0x2cb86b['save']();};}function saveUpdates(_0x3b5518,_0x167974){return function(_0x4e9a1a){if(_0x4e9a1a){return _0x4e9a1a[_0xc956('0x1f')](_0x3b5518)[_0xc956('0x20')](function(_0x98465e){return _0x98465e;});}return null;};}function removeEntity(_0x66f07f,_0x709100){return function(_0x4c6068){if(_0x4c6068){return _0x4c6068['destroy']()[_0xc956('0x20')](function(){_0x66f07f['status'](0xcc)[_0xc956('0x17')]();});}};}function handleEntityNotFound(_0x11bb49,_0x2305ef){return function(_0x27548e){if(!_0x27548e){_0x11bb49['sendStatus'](0x194);}return _0x27548e;};}function handleError(_0x30eb54,_0x273ee2){_0x273ee2=_0x273ee2||0x1f4;return function(_0x47815e){logger['error'](_0x47815e['stack']);if(_0x47815e[_0xc956('0x21')]){delete _0x47815e[_0xc956('0x21')];}_0x30eb54[_0xc956('0x16')](_0x273ee2)[_0xc956('0x22')](_0x47815e);};}exports[_0xc956('0x23')]=function(_0x5246c8,_0xbb5dcf){var _0x1b6685={},_0x35cdaa={},_0x5e1cb6={'count':0x0,'rows':[]};var _0x21c3da=_[_0xc956('0x24')](db['WhatsappTransferReport'][_0xc956('0x25')],function(_0x33eecc){return{'name':_0x33eecc[_0xc956('0x26')],'type':_0x33eecc[_0xc956('0x27')][_0xc956('0x28')]};});_0x35cdaa['model']=_[_0xc956('0x24')](_0x21c3da,_0xc956('0x21'));_0x35cdaa[_0xc956('0x29')]=_[_0xc956('0x2a')](_0x5246c8[_0xc956('0x29')]);_0x35cdaa['filters']=_['intersection'](_0x35cdaa[_0xc956('0x2b')],_0x35cdaa[_0xc956('0x29')]);_0x1b6685[_0xc956('0x2c')]=_[_0xc956('0x2d')](_0x35cdaa[_0xc956('0x2b')],qs[_0xc956('0x2e')](_0x5246c8[_0xc956('0x29')][_0xc956('0x2e')]));_0x1b6685[_0xc956('0x2c')]=_0x1b6685[_0xc956('0x2c')][_0xc956('0x2f')]?_0x1b6685['attributes']:_0x35cdaa[_0xc956('0x2b')];if(!_0x5246c8[_0xc956('0x29')][_0xc956('0x30')](_0xc956('0x31'))){_0x1b6685['limit']=qs[_0xc956('0x19')](_0x5246c8[_0xc956('0x29')][_0xc956('0x19')]);_0x1b6685['offset']=qs[_0xc956('0x1a')](_0x5246c8['query'][_0xc956('0x1a')]);}_0x1b6685[_0xc956('0x32')]=qs[_0xc956('0x33')](_0x5246c8[_0xc956('0x29')][_0xc956('0x33')]);_0x1b6685[_0xc956('0x34')]=qs[_0xc956('0x35')](_[_0xc956('0x36')](_0x5246c8['query'],_0x35cdaa[_0xc956('0x35')]),_0x21c3da);if(_0x5246c8[_0xc956('0x29')]['filter']){_0x1b6685[_0xc956('0x34')]=_[_0xc956('0x37')](_0x1b6685[_0xc956('0x34')],{'$or':_[_0xc956('0x24')](_0x21c3da,function(_0x34920d){if(_0x34920d[_0xc956('0x27')]!==_0xc956('0x38')){var _0x137519={};_0x137519[_0x34920d[_0xc956('0x21')]]={'$like':'%'+_0x5246c8[_0xc956('0x29')]['filter']+'%'};return _0x137519;}})});}_0x1b6685=_['merge']({},_0x1b6685,_0x5246c8[_0xc956('0x39')]);var _0x593b38={'where':_0x1b6685['where']};return db['WhatsappTransferReport'][_0xc956('0x1b')](_0x593b38)[_0xc956('0x20')](function(_0xc1c6c){_0x5e1cb6[_0xc956('0x1b')]=_0xc1c6c;if(_0x5246c8[_0xc956('0x29')][_0xc956('0x3a')]){_0x1b6685[_0xc956('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x1b6685);})[_0xc956('0x20')](function(_0x4315f7){_0x5e1cb6[_0xc956('0x3c')]=_0x4315f7;return _0x5e1cb6;})[_0xc956('0x20')](respondWithFilteredResult(_0xbb5dcf,_0x1b6685))[_0xc956('0x3d')](handleError(_0xbb5dcf,null));};exports[_0xc956('0x3e')]=function(_0x2c25bd,_0xf5703c){var _0x1cc734={'raw':!![],'where':{'id':_0x2c25bd[_0xc956('0x3f')]['id']}},_0xa5edea={};_0xa5edea[_0xc956('0x2b')]=_[_0xc956('0x2a')](db['WhatsappTransferReport'][_0xc956('0x25')]);_0xa5edea[_0xc956('0x29')]=_[_0xc956('0x2a')](_0x2c25bd[_0xc956('0x29')]);_0xa5edea[_0xc956('0x35')]=_[_0xc956('0x2d')](_0xa5edea[_0xc956('0x2b')],_0xa5edea['query']);_0x1cc734[_0xc956('0x2c')]=_['intersection'](_0xa5edea[_0xc956('0x2b')],qs[_0xc956('0x2e')](_0x2c25bd[_0xc956('0x29')][_0xc956('0x2e')]));_0x1cc734[_0xc956('0x2c')]=_0x1cc734[_0xc956('0x2c')][_0xc956('0x2f')]?_0x1cc734[_0xc956('0x2c')]:_0xa5edea[_0xc956('0x2b')];if(_0x2c25bd[_0xc956('0x29')]['includeAll']){_0x1cc734['include']=[{'all':!![]}];}_0x1cc734=_[_0xc956('0x37')]({},_0x1cc734,_0x2c25bd[_0xc956('0x39')]);return db[_0xc956('0x40')]['find'](_0x1cc734)[_0xc956('0x20')](handleEntityNotFound(_0xf5703c,null))[_0xc956('0x20')](respondWithResult(_0xf5703c,null))[_0xc956('0x3d')](handleError(_0xf5703c,null));};exports['create']=function(_0x467573,_0x5a1101){return db[_0xc956('0x40')]['create'](_0x467573[_0xc956('0x41')],{})['then'](respondWithResult(_0x5a1101,0xc9))[_0xc956('0x3d')](handleError(_0x5a1101,null));};exports[_0xc956('0x1f')]=function(_0x1fbd45,_0x52230a){if(_0x1fbd45[_0xc956('0x41')]['id']){delete _0x1fbd45[_0xc956('0x41')]['id'];}return db['WhatsappTransferReport'][_0xc956('0x42')]({'where':{'id':_0x1fbd45[_0xc956('0x3f')]['id']}})[_0xc956('0x20')](handleEntityNotFound(_0x52230a,null))['then'](saveUpdates(_0x1fbd45[_0xc956('0x41')],null))['then'](respondWithResult(_0x52230a,null))[_0xc956('0x3d')](handleError(_0x52230a,null));};exports[_0xc956('0x43')]=function(_0x2cac49,_0x80f665){return db[_0xc956('0x40')]['find']({'where':{'id':_0x2cac49[_0xc956('0x3f')]['id']}})[_0xc956('0x20')](handleEntityNotFound(_0x80f665,null))['then'](removeEntity(_0x80f665,null))[_0xc956('0x3d')](handleError(_0x80f665,null));};exports['describe']=function(_0xe9ab9e,_0x56efd0){return db[_0xc956('0x40')][_0xc956('0x44')]()['then'](respondWithResult(_0x56efd0,null))[_0xc956('0x3d')](handleError(_0x56efd0,null));}; \ No newline at end of file +var _0x8f9d=['nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3b2d00,_0x2748ed){var _0x3e333a=function(_0x1411eb){while(--_0x1411eb){_0x3b2d00['push'](_0x3b2d00['shift']());}};_0x3e333a(++_0x2748ed);}(_0x8f9d,0x1d6));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xd8f9('0x0'));var rimraf=require(_0xd8f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f9('0x2'));var rp=require(_0xd8f9('0x3'));var moment=require('moment');var BPromise=require(_0xd8f9('0x4'));var Mustache=require(_0xd8f9('0x5'));var util=require(_0xd8f9('0x6'));var path=require(_0xd8f9('0x7'));var sox=require('sox');var csv=require(_0xd8f9('0x8'));var ejs=require(_0xd8f9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd8f9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd8f9('0xb'));var toCsv=require(_0xd8f9('0x8'));var querystring=require(_0xd8f9('0xc'));var Papa=require(_0xd8f9('0xd'));var Redis=require(_0xd8f9('0xe'));var authService=require(_0xd8f9('0xf'));var qs=require(_0xd8f9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8f9('0x11'));var logger=require(_0xd8f9('0x12'))(_0xd8f9('0x13'));var utils=require(_0xd8f9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd8f9('0x15'));var db=require(_0xd8f9('0x16'))['db'];function respondWithStatusCode(_0x4f63f8,_0xbcf776){_0xbcf776=_0xbcf776||0xcc;return function(_0x18b8c2){if(_0x18b8c2){return _0x4f63f8[_0xd8f9('0x17')](_0xbcf776);}return _0x4f63f8[_0xd8f9('0x18')](_0xbcf776)[_0xd8f9('0x19')]();};}function respondWithResult(_0x38e61a,_0x406998){_0x406998=_0x406998||0xc8;return function(_0xbe5830){if(_0xbe5830){return _0x38e61a[_0xd8f9('0x18')](_0x406998)[_0xd8f9('0x1a')](_0xbe5830);}};}function respondWithFilteredResult(_0x4e8d03,_0x3c7776){return function(_0x1ce516){if(_0x1ce516){var _0x460940=typeof _0x3c7776[_0xd8f9('0x1b')]===_0xd8f9('0x1c')&&typeof _0x3c7776[_0xd8f9('0x1d')]===_0xd8f9('0x1c');var _0x2e0d41=_0x1ce516[_0xd8f9('0x1e')];var _0x480567=_0x460940?0x0:_0x3c7776[_0xd8f9('0x1b')];var _0x5a80b3=_0x460940?_0x1ce516['count']:_0x3c7776['offset']+_0x3c7776['limit'];var _0x543bc9;if(_0x5a80b3>=_0x2e0d41){_0x5a80b3=_0x2e0d41;_0x543bc9=0xc8;}else{_0x543bc9=0xce;}_0x4e8d03[_0xd8f9('0x18')](_0x543bc9);return _0x4e8d03[_0xd8f9('0x1f')](_0xd8f9('0x20'),_0x480567+'-'+_0x5a80b3+'/'+_0x2e0d41)[_0xd8f9('0x1a')](_0x1ce516);}return null;};}function patchUpdates(_0x2cdd67){return function(_0x2a4966){try{jsonpatch[_0xd8f9('0x21')](_0x2a4966,_0x2cdd67,!![]);}catch(_0x2d190c){return BPromise['reject'](_0x2d190c);}return _0x2a4966[_0xd8f9('0x22')]();};}function saveUpdates(_0xc4dcf9,_0x33b41f){return function(_0x19d623){if(_0x19d623){return _0x19d623[_0xd8f9('0x23')](_0xc4dcf9)['then'](function(_0x6892fc){return _0x6892fc;});}return null;};}function removeEntity(_0x4a6263,_0x28c46a){return function(_0x53b3b6){if(_0x53b3b6){return _0x53b3b6['destroy']()[_0xd8f9('0x24')](function(){_0x4a6263[_0xd8f9('0x18')](0xcc)[_0xd8f9('0x19')]();});}};}function handleEntityNotFound(_0x3515ce,_0x4f6b53){return function(_0x1b8d98){if(!_0x1b8d98){_0x3515ce[_0xd8f9('0x17')](0x194);}return _0x1b8d98;};}function handleError(_0x20f0ad,_0x2d7c1f){_0x2d7c1f=_0x2d7c1f||0x1f4;return function(_0x34b16d){logger[_0xd8f9('0x25')](_0x34b16d['stack']);if(_0x34b16d[_0xd8f9('0x26')]){delete _0x34b16d[_0xd8f9('0x26')];}_0x20f0ad[_0xd8f9('0x18')](_0x2d7c1f)[_0xd8f9('0x27')](_0x34b16d);};}exports[_0xd8f9('0x28')]=function(_0x46c556,_0x32b57a){var _0x49cdc2={},_0x3e89a7={},_0x334347={'count':0x0,'rows':[]};var _0x338f8b=_[_0xd8f9('0x29')](db[_0xd8f9('0x2a')][_0xd8f9('0x2b')],function(_0x3cf7b5){return{'name':_0x3cf7b5['fieldName'],'type':_0x3cf7b5[_0xd8f9('0x2c')][_0xd8f9('0x2d')]};});_0x3e89a7[_0xd8f9('0x2e')]=_[_0xd8f9('0x29')](_0x338f8b,_0xd8f9('0x26'));_0x3e89a7[_0xd8f9('0x2f')]=_[_0xd8f9('0x30')](_0x46c556[_0xd8f9('0x2f')]);_0x3e89a7[_0xd8f9('0x31')]=_[_0xd8f9('0x32')](_0x3e89a7[_0xd8f9('0x2e')],_0x3e89a7[_0xd8f9('0x2f')]);_0x49cdc2[_0xd8f9('0x33')]=_[_0xd8f9('0x32')](_0x3e89a7[_0xd8f9('0x2e')],qs['fields'](_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x34')]));_0x49cdc2['attributes']=_0x49cdc2[_0xd8f9('0x33')][_0xd8f9('0x35')]?_0x49cdc2[_0xd8f9('0x33')]:_0x3e89a7[_0xd8f9('0x2e')];if(!_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x36')](_0xd8f9('0x37'))){_0x49cdc2['limit']=qs[_0xd8f9('0x1d')](_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x1d')]);_0x49cdc2[_0xd8f9('0x1b')]=qs[_0xd8f9('0x1b')](_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x1b')]);}_0x49cdc2['order']=qs['sort'](_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x38')]);_0x49cdc2[_0xd8f9('0x39')]=qs[_0xd8f9('0x31')](_[_0xd8f9('0x3a')](_0x46c556[_0xd8f9('0x2f')],_0x3e89a7[_0xd8f9('0x31')]),_0x338f8b);if(_0x46c556['query'][_0xd8f9('0x3b')]){_0x49cdc2[_0xd8f9('0x39')]=_[_0xd8f9('0x3c')](_0x49cdc2['where'],{'$or':_[_0xd8f9('0x29')](_0x338f8b,function(_0x2db92e){if(_0x2db92e['type']!==_0xd8f9('0x3d')){var _0x3ce36f={};_0x3ce36f[_0x2db92e['name']]={'$like':'%'+_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x3b')]+'%'};return _0x3ce36f;}})});}_0x49cdc2=_[_0xd8f9('0x3c')]({},_0x49cdc2,_0x46c556[_0xd8f9('0x3e')]);var _0x4f1a11={'where':_0x49cdc2[_0xd8f9('0x39')]};return db[_0xd8f9('0x2a')][_0xd8f9('0x1e')](_0x4f1a11)[_0xd8f9('0x24')](function(_0x1db79b){_0x334347[_0xd8f9('0x1e')]=_0x1db79b;if(_0x46c556[_0xd8f9('0x2f')][_0xd8f9('0x3f')]){_0x49cdc2[_0xd8f9('0x40')]=[{'all':!![]}];}return db[_0xd8f9('0x2a')][_0xd8f9('0x41')](_0x49cdc2);})['then'](function(_0x5b224b){_0x334347[_0xd8f9('0x42')]=_0x5b224b;return _0x334347;})[_0xd8f9('0x24')](respondWithFilteredResult(_0x32b57a,_0x49cdc2))[_0xd8f9('0x43')](handleError(_0x32b57a,null));};exports[_0xd8f9('0x44')]=function(_0x2f4760,_0x53fd99){var _0x2674a9={'raw':!![],'where':{'id':_0x2f4760[_0xd8f9('0x45')]['id']}},_0x5951d2={};_0x5951d2[_0xd8f9('0x2e')]=_[_0xd8f9('0x30')](db[_0xd8f9('0x2a')][_0xd8f9('0x2b')]);_0x5951d2[_0xd8f9('0x2f')]=_[_0xd8f9('0x30')](_0x2f4760[_0xd8f9('0x2f')]);_0x5951d2['filters']=_[_0xd8f9('0x32')](_0x5951d2['model'],_0x5951d2[_0xd8f9('0x2f')]);_0x2674a9[_0xd8f9('0x33')]=_[_0xd8f9('0x32')](_0x5951d2[_0xd8f9('0x2e')],qs[_0xd8f9('0x34')](_0x2f4760[_0xd8f9('0x2f')][_0xd8f9('0x34')]));_0x2674a9[_0xd8f9('0x33')]=_0x2674a9[_0xd8f9('0x33')][_0xd8f9('0x35')]?_0x2674a9[_0xd8f9('0x33')]:_0x5951d2[_0xd8f9('0x2e')];if(_0x2f4760[_0xd8f9('0x2f')][_0xd8f9('0x3f')]){_0x2674a9[_0xd8f9('0x40')]=[{'all':!![]}];}_0x2674a9=_['merge']({},_0x2674a9,_0x2f4760[_0xd8f9('0x3e')]);return db[_0xd8f9('0x2a')][_0xd8f9('0x46')](_0x2674a9)[_0xd8f9('0x24')](handleEntityNotFound(_0x53fd99,null))[_0xd8f9('0x24')](respondWithResult(_0x53fd99,null))[_0xd8f9('0x43')](handleError(_0x53fd99,null));};exports[_0xd8f9('0x47')]=function(_0x3ab5ca,_0x445453){return db[_0xd8f9('0x2a')]['create'](_0x3ab5ca[_0xd8f9('0x48')],{})['then'](respondWithResult(_0x445453,0xc9))[_0xd8f9('0x43')](handleError(_0x445453,null));};exports[_0xd8f9('0x23')]=function(_0x44bd16,_0x2cad1a){if(_0x44bd16[_0xd8f9('0x48')]['id']){delete _0x44bd16[_0xd8f9('0x48')]['id'];}return db['WhatsappTransferReport'][_0xd8f9('0x46')]({'where':{'id':_0x44bd16[_0xd8f9('0x45')]['id']}})[_0xd8f9('0x24')](handleEntityNotFound(_0x2cad1a,null))[_0xd8f9('0x24')](saveUpdates(_0x44bd16['body'],null))[_0xd8f9('0x24')](respondWithResult(_0x2cad1a,null))[_0xd8f9('0x43')](handleError(_0x2cad1a,null));};exports[_0xd8f9('0x49')]=function(_0x1f3ee2,_0x16a3c6){return db[_0xd8f9('0x2a')][_0xd8f9('0x46')]({'where':{'id':_0x1f3ee2[_0xd8f9('0x45')]['id']}})[_0xd8f9('0x24')](handleEntityNotFound(_0x16a3c6,null))[_0xd8f9('0x24')](removeEntity(_0x16a3c6,null))[_0xd8f9('0x43')](handleError(_0x16a3c6,null));};exports[_0xd8f9('0x4a')]=function(_0x1a1596,_0x36c2a1){return db[_0xd8f9('0x2a')][_0xd8f9('0x4a')]()['then'](respondWithResult(_0x36c2a1,null))[_0xd8f9('0x43')](handleError(_0x36c2a1,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 75641fa..811a971 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe69=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','WhatsappTransferReport'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xbe69,0x16a));var _0x9be6=function(_0x1abc4f,_0x4c1bc2){_0x1abc4f=_0x1abc4f-0x0;var _0x38f9df=_0xbe69[_0x1abc4f];return _0x38f9df;};'use strict';var _=require(_0x9be6('0x0'));var util=require(_0x9be6('0x1'));var logger=require(_0x9be6('0x2'))(_0x9be6('0x3'));var moment=require('moment');var BPromise=require(_0x9be6('0x4'));var rp=require(_0x9be6('0x5'));var fs=require('fs');var path=require(_0x9be6('0x6'));var rimraf=require('rimraf');var config=require(_0x9be6('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x9be6('0x8')]=function(_0x79b94f,_0x35b7c2){return _0x79b94f['define'](_0x9be6('0x9'),attributes,{'tableName':_0x9be6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9be6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbce9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0xcf3081,_0x686a8d){var _0x5c10f7=function(_0x51c474){while(--_0x51c474){_0xcf3081['push'](_0xcf3081['shift']());}};_0x5c10f7(++_0x686a8d);}(_0xbce9,0x13e));var _0x9bce=function(_0x327e17,_0x8e788e){_0x327e17=_0x327e17-0x0;var _0x143c10=_0xbce9[_0x327e17];return _0x143c10;};'use strict';var _=require(_0x9bce('0x0'));var util=require(_0x9bce('0x1'));var logger=require(_0x9bce('0x2'))(_0x9bce('0x3'));var moment=require(_0x9bce('0x4'));var BPromise=require(_0x9bce('0x5'));var rp=require(_0x9bce('0x6'));var fs=require('fs');var path=require(_0x9bce('0x7'));var rimraf=require(_0x9bce('0x8'));var config=require(_0x9bce('0x9'));var attributes=require(_0x9bce('0xa'));module[_0x9bce('0xb')]=function(_0x26e644,_0x279919){return _0x26e644[_0x9bce('0xc')](_0x9bce('0xd'),attributes,{'tableName':_0x9bce('0xe'),'paranoid':![],'indexes':[{'name':_0x9bce('0xf'),'fields':[_0x9bce('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 46033b5..b388ad7 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8085=['jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1bbf61,_0x4b2648){var _0x215b3b=function(_0x210704){while(--_0x210704){_0x1bbf61['push'](_0x1bbf61['shift']());}};_0x215b3b(++_0x4b2648);}(_0x8085,0x174));var _0x5808=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x8085[_0x22e47a];return _0x15a12a;};'use strict';var _=require(_0x5808('0x0'));var util=require(_0x5808('0x1'));var moment=require(_0x5808('0x2'));var BPromise=require('bluebird');var rs=require(_0x5808('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5808('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5808('0x5'))(_0x5808('0x6'));var config=require(_0x5808('0x7'));var jayson=require(_0x5808('0x8'));var client=jayson[_0x5808('0x9')][_0x5808('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x330357,_0x50bb71,_0x57504b){return new BPromise(function(_0x406ca5,_0x32e69f){return client[_0x5808('0xb')](_0x330357,_0x57504b)[_0x5808('0xc')](function(_0x2589de){logger[_0x5808('0xd')](_0x5808('0xe'),_0x50bb71,'request\x20sent');logger['debug'](_0x5808('0xf'),_0x50bb71,_0x5808('0x10'),JSON['stringify'](_0x2589de));if(_0x2589de[_0x5808('0x11')]){if(_0x2589de['error']['code']===0x1f4){logger['error'](_0x5808('0xe'),_0x50bb71,_0x2589de['error'][_0x5808('0x12')]);return _0x32e69f(_0x2589de[_0x5808('0x11')][_0x5808('0x12')]);}logger[_0x5808('0x11')](_0x5808('0xe'),_0x50bb71,_0x2589de[_0x5808('0x11')][_0x5808('0x12')]);return _0x406ca5(_0x2589de[_0x5808('0x11')][_0x5808('0x12')]);}else{logger[_0x5808('0xd')](_0x5808('0xe'),_0x50bb71,_0x5808('0x10'));_0x406ca5(_0x2589de[_0x5808('0x13')][_0x5808('0x12')]);}})['catch'](function(_0x303cc4){logger['error'](_0x5808('0xe'),_0x50bb71,_0x303cc4);_0x32e69f(_0x303cc4);});});} \ No newline at end of file +var _0xc672=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x26dc96,_0x10c6f5){var _0x30b7be=function(_0x47de22){while(--_0x47de22){_0x26dc96['push'](_0x26dc96['shift']());}};_0x30b7be(++_0x10c6f5);}(_0xc672,0x1d7));var _0x2c67=function(_0x39b764,_0x3bfa8b){_0x39b764=_0x39b764-0x0;var _0x185644=_0xc672[_0x39b764];return _0x185644;};'use strict';var _=require(_0x2c67('0x0'));var util=require(_0x2c67('0x1'));var moment=require(_0x2c67('0x2'));var BPromise=require(_0x2c67('0x3'));var rs=require(_0x2c67('0x4'));var fs=require('fs');var Redis=require(_0x2c67('0x5'));var db=require(_0x2c67('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c67('0x7'))(_0x2c67('0x8'));var config=require(_0x2c67('0x9'));var jayson=require(_0x2c67('0xa'));var client=jayson[_0x2c67('0xb')][_0x2c67('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51f7e2,_0x1e25d0,_0x49857c){return new BPromise(function(_0x54539e,_0x34bcf2){return client[_0x2c67('0xd')](_0x51f7e2,_0x49857c)[_0x2c67('0xe')](function(_0x34abf3){logger[_0x2c67('0xf')](_0x2c67('0x10'),_0x1e25d0,'request\x20sent');logger[_0x2c67('0x11')](_0x2c67('0x12'),_0x1e25d0,_0x2c67('0x13'),JSON[_0x2c67('0x14')](_0x34abf3));if(_0x34abf3[_0x2c67('0x15')]){if(_0x34abf3[_0x2c67('0x15')][_0x2c67('0x16')]===0x1f4){logger[_0x2c67('0x15')](_0x2c67('0x10'),_0x1e25d0,_0x34abf3['error'][_0x2c67('0x17')]);return _0x34bcf2(_0x34abf3[_0x2c67('0x15')]['message']);}logger['error'](_0x2c67('0x10'),_0x1e25d0,_0x34abf3['error'][_0x2c67('0x17')]);return _0x54539e(_0x34abf3[_0x2c67('0x15')][_0x2c67('0x17')]);}else{logger[_0x2c67('0xf')](_0x2c67('0x10'),_0x1e25d0,_0x2c67('0x13'));_0x54539e(_0x34abf3[_0x2c67('0x18')][_0x2c67('0x17')]);}})[_0x2c67('0x19')](function(_0x1d0d64){logger[_0x2c67('0x15')](_0x2c67('0x10'),_0x1e25d0,_0x1d0d64);_0x34bcf2(_0x1d0d64);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 9d4fd96..ea3dbec 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf50b=['join','Offline\x20apps:','status','name','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','listen','start','info','filter','exitCode','number','length','map','pm2_env','Online\x20apps:','online'];(function(_0xe20d48,_0x11f1d0){var _0x1580e6=function(_0x43b82f){while(--_0x43b82f){_0xe20d48['push'](_0xe20d48['shift']());}};_0x1580e6(++_0x11f1d0);}(_0xf50b,0xc8));var _0xbf50=function(_0x204eb8,_0x40cd16){_0x204eb8=_0x204eb8-0x0;var _0x36293d=_0xf50b[_0x204eb8];return _0x36293d;};'use strict';var _=require(_0xbf50('0x0'));var db=require(_0xbf50('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xbf50('0x2'));var rpc=require(_0xbf50('0x3'));var config=require(_0xbf50('0x4'));var logger=require(_0xbf50('0x5'))('app');var pm2=require(_0xbf50('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xbf50('0x7'));var chat=require(_0xbf50('0x8'));var whatsapp=require(_0xbf50('0x9'));var transcribe=require(_0xbf50('0xa'));var provider=require(_0xbf50('0xb'));function main(){return db[_0xbf50('0xc')][_0xbf50('0xd')]()['then'](function(){if(config[_0xbf50('0xe')]){return seedDb[_0xbf50('0xf')]();}})[_0xbf50('0x10')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xbf50('0x11')]();})[_0xbf50('0x10')](function(_0x31c66f){logger['info'](_0x31c66f);return chat[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(){return whatsapp[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(){return schedule[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(){return transcribe[_0xbf50('0x12')]();})['then'](function(){return provider[_0xbf50('0x12')]();})[_0xbf50('0x10')](function(_0x38ae23){logger[_0xbf50('0x13')](_0x38ae23);return pm2[_0xbf50('0x12')](pm2Config);})['then'](function(_0x554d70){var _0x4b05bb=_0x554d70[_0xbf50('0x14')](function(_0x5df099){return typeof _0x5df099[_0xbf50('0x15')]===_0xbf50('0x16')&&_0x5df099[_0xbf50('0x15')]>=0x0;});if(_0x4b05bb['length']>0x0){throw new Error(_0x4b05bb[_0xbf50('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xbf50('0x18')](_0x4b05bb,function(_0x2264a0){return'\x22'+_0x2264a0[_0xbf50('0x19')]['name']+'\x22';}));}logger[_0xbf50('0x13')](_0xbf50('0x1a'),_[_0xbf50('0x18')](_[_0xbf50('0x14')](_0x554d70,{'status':_0xbf50('0x1b')}),'name')[_0xbf50('0x1c')]());logger[_0xbf50('0x13')](_0xbf50('0x1d'),_[_0xbf50('0x18')](_[_0xbf50('0x14')](_0x554d70,function(_0x5a30db){return _0x5a30db[_0xbf50('0x1e')]!==_0xbf50('0x1b');}),_0xbf50('0x1f'))[_0xbf50('0x1c')]()||_0xbf50('0x20'));console[_0xbf50('0x21')](_0xbf50('0x22'));})['catch'](function(_0x304bd5){console[_0xbf50('0x21')](_0xbf50('0x23'),_0x304bd5);logger[_0xbf50('0x24')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x304bd5);process[_0xbf50('0x25')](0x1);});}main(); \ No newline at end of file +var _0x9f7a=['./config/seedDB','./config/license','./config/environment','./config/pm2/config','./config/schedule','./config/schedule/transcribe','then','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','filter','online','Offline\x20apps:','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','lodash','./mysqldb'];(function(_0x18ca89,_0x39fb6b){var _0x295eab=function(_0x50e04b){while(--_0x50e04b){_0x18ca89['push'](_0x18ca89['shift']());}};_0x295eab(++_0x39fb6b);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x9f7a[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xa9f7('0x0'));var db=require(_0xa9f7('0x1'))['db'];var seedDb=require(_0xa9f7('0x2'));var checkLicense=require(_0xa9f7('0x3'));var rpc=require('./rpc');var config=require(_0xa9f7('0x4'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0xa9f7('0x5'));var schedule=require(_0xa9f7('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xa9f7('0x7'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize']['sync']()[_0xa9f7('0x8')](function(){if(config['seedDB']){return seedDb[_0xa9f7('0x9')]();}})[_0xa9f7('0x8')](function(){return checkLicense[_0xa9f7('0x9')]();})['then'](function(){return rpc[_0xa9f7('0xa')]();})[_0xa9f7('0x8')](function(_0x4d9b2a){logger[_0xa9f7('0xb')](_0x4d9b2a);return chat[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return whatsapp[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return schedule[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return transcribe['start']();})[_0xa9f7('0x8')](function(){return provider['start']();})[_0xa9f7('0x8')](function(_0x437a83){logger[_0xa9f7('0xb')](_0x437a83);return pm2['start'](pm2Config);})['then'](function(_0xe56a20){var _0x4855d0=_0xe56a20['filter'](function(_0x188f8a){return typeof _0x188f8a[_0xa9f7('0xd')]===_0xa9f7('0xe')&&_0x188f8a['exitCode']>=0x0;});if(_0x4855d0[_0xa9f7('0xf')]>0x0){throw new Error(_0x4855d0[_0xa9f7('0xf')]+_0xa9f7('0x10')+_['map'](_0x4855d0,function(_0x310009){return'\x22'+_0x310009[_0xa9f7('0x11')][_0xa9f7('0x12')]+'\x22';}));}logger[_0xa9f7('0xb')](_0xa9f7('0x13'),_[_0xa9f7('0x14')](_[_0xa9f7('0x15')](_0xe56a20,{'status':_0xa9f7('0x16')}),_0xa9f7('0x12'))['join']());logger[_0xa9f7('0xb')](_0xa9f7('0x17'),_[_0xa9f7('0x14')](_[_0xa9f7('0x15')](_0xe56a20,function(_0x402c6d){return _0x402c6d['status']!=='online';}),'name')['join']()||'None');console[_0xa9f7('0x18')]('App\x20Ready!');})[_0xa9f7('0x19')](function(_0x504304){console['log'](_0xa9f7('0x1a'),_0x504304);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x504304);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 f83f207..b59b187 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 _0x3e74=['util','moment','session','role','fullname','name','internal','userpic','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','then','disposition','unmanaged','json','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','join','promisify','secret','secrets','payload','options','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','basic-auth','crypto','bluebird'];(function(_0xad8344,_0x23dbe6){var _0x48c4c5=function(_0x2079f8){while(--_0x2079f8){_0xad8344['push'](_0xad8344['shift']());}};_0x48c4c5(++_0x23dbe6);}(_0x3e74,0x175));var _0x43e7=function(_0x23d9ed,_0x45cc36){_0x23d9ed=_0x23d9ed-0x0;var _0x3e5478=_0x3e74[_0x23d9ed];return _0x3e5478;};'use strict';var db=require(_0x43e7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x43e7('0x1'));var licenseUtil=require(_0x43e7('0x2'));var encryptor=require(_0x43e7('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x43e7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x43e7('0x5'));var crypto=require(_0x43e7('0x6'));var BPromise=require(_0x43e7('0x7'));var util=require(_0x43e7('0x8'));var moment=require(_0x43e7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x43e7('0xa')]});var userAttributes=['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xe'),'email',_0x43e7('0xf'),'permissions','md5secret',_0x43e7('0x10'),_0x43e7('0x11'),'mailPause',_0x43e7('0x12'),'smsPause',_0x43e7('0x13'),_0x43e7('0x14'),'showWebBar',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),'passwordResetAt','alias',_0x43e7('0x19'),_0x43e7('0x1a'),_0x43e7('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x43e7('0x1c'),_0x43e7('0x1d'),_0x43e7('0x1e'),_0x43e7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x43e7('0x20'),_0x43e7('0x21'),_0x43e7('0x22'),'settingsEnabled','wssPort',_0x43e7('0x23'),_0x43e7('0x24'),_0x43e7('0x25'),_0x43e7('0x26'),_0x43e7('0x27'),_0x43e7('0x28'),_0x43e7('0x29'),_0x43e7('0x2a'),_0x43e7('0x2b'),_0x43e7('0x2c'),_0x43e7('0x2d'),_0x43e7('0x2e'),'openchannelAutoanswerDelay',_0x43e7('0x2f'),_0x43e7('0x30'),'whatsappAutoanswer',_0x43e7('0x31')];exports[_0x43e7('0x32')]=function(){return this[_0x43e7('0x33')](!![])[_0x43e7('0x34')](function(_0x4077fb,_0x2f4cb4,_0x54a9e7){if(_0x4077fb[_0x43e7('0x35')]){_0x54a9e7();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4077fb[_0x43e7('0x36')]['id']},'attributes':['id',_0x43e7('0x37'),'disposition'],'raw':!![]})[_0x43e7('0x38')](function(_0x4ca5cf){if(_0x4ca5cf&&_0x4ca5cf[_0x43e7('0x37')]){return _0x2f4cb4['status'](_0x4ca5cf[_0x43e7('0x39')]===_0x43e7('0x3a')?0x195:0x193)[_0x43e7('0x3b')]({'message':_0x4ca5cf[_0x43e7('0x39')]==='unmanaged'?'Unmanaged.':_0x43e7('0x3c')});}else{_0x54a9e7();}})['catch'](function(_0x2dd5f){_0x54a9e7(_0x2dd5f);});}});};exports[_0x43e7('0x33')]=function isAuthenticated(_0x3565cf){return compose()[_0x43e7('0x34')](function(_0x5087d7,_0x33a1a5,_0x4690a6){var _0x45b675;if(_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')]){if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')],_0x43e7('0x40'))){var _0x35dbcd=basicAuth(_0x5087d7);db[_0x43e7('0x41')][_0x43e7('0x42')]({'where':{'name':_0x35dbcd[_0x43e7('0xd')]}})[_0x43e7('0x38')](function(_0x4bdb17){if(!_0x4bdb17||!_0x4bdb17[_0x43e7('0x43')](_0x35dbcd[_0x43e7('0x44')])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x46')});}_0x5087d7['user']={'id':_0x4bdb17['id']};_0x4690a6();})[_0x43e7('0x47')](function(_0x49b83d){_0x4690a6(_0x49b83d);});}else if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')]['authorization'],'Bearer')){validateJwt(_0x5087d7,_0x33a1a5,_0x4690a6);}else{if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5['status'](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x48')});}}}else if(_0x5087d7[_0x43e7('0x49')][_0x43e7('0x4a')]){try{var _0x108313={'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5087d7['query']['apikey'],_0x108313)['then'](function(_0x4e8e86){return db['User']['find']({'where':{'id':_0x4e8e86[_0x43e7('0x4c')]}})['then'](function(_0x2b4bfd){_0x45b675=_0x2b4bfd;return db[_0x43e7('0x4d')][_0x43e7('0x4e')]({'where':{'id':0x1},'attributes':[_0x43e7('0x4f'),_0x43e7('0x50')],'raw':!![]});})[_0x43e7('0x38')](function(_0x101d45){if(!_0x45b675||!_['isEqual'](_0x45b675['apiKeyNonce'],_0x4e8e86['nonce'])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x51')});}if(_0x45b675[_0x43e7('0x52')]){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}if(_0x45b675[_0x43e7('0x54')]){if(_0x101d45['blockDuration']>0x0){if(moment(_0x45b675[_0x43e7('0x55')])[_0x43e7('0x56')](_0x101d45['blockDuration'],_0x43e7('0x57'))>moment()){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}else{return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}_0x5087d7[_0x43e7('0x35')]={'id':_0x45b675['id']};_0x4690a6();});})['catch'](function(){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});});}catch(_0x44b6ae){_0x4690a6(_0x44b6ae);}}else if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':'Unknown\x20authorization\x20format'});}})[_0x43e7('0x34')](function(_0x4227c4,_0x575439,_0x3628e0){if(_0x4227c4['user']){db[_0x43e7('0x41')]['find']({'where':{'id':_0x4227c4[_0x43e7('0x35')]['id']},'attributes':userAttributes})[_0x43e7('0x38')](function(_0x3a5807){if(!_0x3a5807){return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x4227c4[_0x43e7('0x35')]=_0x3a5807;_0x3628e0();})[_0x43e7('0x47')](function(_0xe979b5){_0x3628e0(_0xe979b5);});}else if(_0x3565cf){_0x3628e0();}else{return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x43e7('0x34')](function(_0x57f5d0,_0x2ab022,_0x4b3a59){return licenseUtil['getLicense']()[_0x43e7('0x38')](function(_0x5ee1c5){if(_0x5ee1c5[_0x43e7('0x58')]){_0x4b3a59();}else{return _0x2ab022[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x59')});}})['catch'](function(_0x91f1e4){_0x4b3a59(_0x91f1e4);});});};exports[_0x43e7('0x5a')]=function isWebrtcLicence(){return compose()[_0x43e7('0x34')](function(_0x1fd277,_0x296dc8,_0x1efe59){return licenseUtil['getLicense']()['then'](function(_0x3bc9de){if(_0x3bc9de[_0x43e7('0x5b')]){_0x1efe59();}else{return _0x296dc8[_0x43e7('0x45')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x292ded){_0x1efe59(_0x292ded);});});};exports[_0x43e7('0x5c')]=function(_0x52b098,_0x351ca2,_0x47686e){_0x52b098[_0x43e7('0x5c')]=!![];return _0x47686e();};exports['signToken']=function signToken(_0x593155){return signJwt(_0x593155);};exports['setTokenCookie']=function(_0x4de644,_0x214e7e){if(!_0x4de644[_0x43e7('0x35')]){return _0x214e7e['status'](0x194)[_0x43e7('0x3b')]({'message':_0x43e7('0x5d')});}var _0x426bcb={'payload':{'id':_0x4de644[_0x43e7('0x35')]['id'],'role':_0x4de644['user'][_0x43e7('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x426bcb)['then'](function(_0x4bebd4){_0x214e7e[_0x43e7('0x5e')](_0x43e7('0x5f'),_0x4bebd4);_0x214e7e[_0x43e7('0x60')](_0x43e7('0x61'));})[_0x43e7('0x47')](function(_0x2351cf){return _0x214e7e[_0x43e7('0x45')](0x1f4)[_0x43e7('0x62')](_0x2351cf);});};exports[_0x43e7('0x63')]=function(_0x2b5515){if(_['isNil'](_0x2b5515[_0x43e7('0x64')])||_[_0x43e7('0x65')](_0x2b5515['apiKeyIat'])){return null;}else{return createJwt(_0x2b5515);}};exports[_0x43e7('0x66')]=function(_0x4e6f6d){_0x4e6f6d[_0x43e7('0x64')]=generateNonce();_0x4e6f6d[_0x43e7('0x67')]=generateIssuedAt();return createJwt(_0x4e6f6d);};exports[_0x43e7('0x68')]=function(_0x1f561f,_0xfe13fa){var _0x5e5556=_0x1f561f['query'][_0x43e7('0x4a')];if(_0x5e5556){var _0x2ab7ee={'nonce':_0xfe13fa[_0x43e7('0x64')],'iat':_0xfe13fa[_0x43e7('0x67')],'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf[_0x43e7('0x4b')]()};return verifyJwt(_0x5e5556,_0x2ab7ee)[_0x43e7('0x38')](function(){return generateApiKey(_0xfe13fa);});}else{throw{'message':_0x43e7('0x69')};}};exports[_0x43e7('0x6a')]=function(_0x24e758){var _0x312306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x312306['test'](_0x24e758))throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x43e7('0x6d')]=function(_0x220bf2,_0x2d0052,_0x558d54){var _0x5d63c6=encryptor[_0x43e7('0x6e')](_0x2d0052)[_0x43e7('0x6f')](',');for(var _0x4ebdde=0x0;_0x4ebdde<_0x558d54;_0x4ebdde++){if(!_0x5d63c6[_0x4ebdde])break;if(_0x220bf2[_0x43e7('0x70')]()===_0x5d63c6[_0x4ebdde]['toLowerCase']()){var _0x49a6ce=util[_0x43e7('0x71')](_0x43e7('0x72'),_0x558d54);if(_0x558d54===0x1){_0x49a6ce=_0x43e7('0x73');}throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))](_0x49a6ce);}}return;};exports['updatePasswordsHistory']=function(_0xc3976,_0xdb9fbe){var _0x4d89bd=_0xdb9fbe?encryptor[_0x43e7('0x6e')](_0xdb9fbe)[_0x43e7('0x6f')](','):[];if(_0x4d89bd[_0x43e7('0x74')]===0x5){_0x4d89bd['splice'](-0x1,0x1);}_0x4d89bd['unshift'](_0xc3976);return encryptor['encryptString'](_0x4d89bd[_0x43e7('0x75')](','));};function signJwt(_0x4058ce){var _0x323cf7=BPromise[_0x43e7('0x76')](jwt['sign'],{'context':jwt});var _0x5a50fc=_0x4058ce[_0x43e7('0x77')]||config[_0x43e7('0x78')][_0x43e7('0xa')];return new BPromise(function(_0x5dd349,_0x5ea0db){_0x323cf7(_0x4058ce[_0x43e7('0x79')],_0x5a50fc,_0x4058ce[_0x43e7('0x7a')])[_0x43e7('0x38')](function(_0x2a194d){_0x5dd349(_0x2a194d);})[_0x43e7('0x47')](function(_0xd41e79){_0x5ea0db(_0xd41e79);});});}function verifyJwt(_0x4665db,_0x46748f,_0x406155){var _0x381208=BPromise[_0x43e7('0x76')](jwt['verify'],{'context':jwt});var _0x5f3824=_0x406155||config[_0x43e7('0x78')]['session'];return new BPromise(function(_0x501616,_0x50edb2){_0x381208(_0x4665db,_0x5f3824,_0x46748f)[_0x43e7('0x38')](function(_0xe666b0){_0x501616(_0xe666b0);})['catch'](function(_0xfe5a8d){_0x50edb2(_0xfe5a8d);});});}function generateNonce(){return crypto[_0x43e7('0x7b')](0x10)[_0x43e7('0x7c')]('hex');}function generateIssuedAt(){return Math[_0x43e7('0x7d')](Date[_0x43e7('0x7e')]()/0x3e8)[_0x43e7('0x7c')]();}function createJwt(_0xc9723){var _0x2f43d7={'payload':{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723[_0x43e7('0x64')]},'options':{'algorithm':'HS512','subject':_0xc9723['id'][_0x43e7('0x7c')](),'issuer':hardwareConf[_0x43e7('0x4b')](),'audience':hardwareConf[_0x43e7('0x4b')]()}};return signJwt(_0x2f43d7)['then'](function(_0x56b06d){return{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723['apiKeyNonce'],'token':_0x56b06d};});} \ No newline at end of file +var _0xb43b=['headers','then','authenticate','pass','status','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','find','sub','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','moment','session','role','fullname','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarPrefixRequired','phoneBarRemoteControl','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Forbidden.','catch','isAuthenticated','authorization','startsWith'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1bf3f1,_0xb2a63b){_0x1bf3f1=_0x1bf3f1-0x0;var _0x1f1dbe=_0xb43b[_0x1bf3f1];return _0x1f1dbe;};'use strict';var db=require(_0xbb43('0x0'))['db'];var config=require(_0xbb43('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xbb43('0x2'));var encryptor=require(_0xbb43('0x3'));var _=require(_0xbb43('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xbb43('0x5'));var compose=require(_0xbb43('0x6'));var basicAuth=require(_0xbb43('0x7'));var crypto=require(_0xbb43('0x8'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xbb43('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xbb43('0xa')]});var userAttributes=['id',_0xbb43('0xb'),_0xbb43('0xc'),_0xbb43('0xd'),_0xbb43('0xe'),'email',_0xbb43('0xf'),_0xbb43('0x10'),'md5secret',_0xbb43('0x11'),_0xbb43('0x12'),_0xbb43('0x13'),_0xbb43('0x14'),_0xbb43('0x15'),_0xbb43('0x16'),'pauseType',_0xbb43('0x17'),_0xbb43('0x18'),'lastPauseAt','crudPermissions',_0xbb43('0x19'),'passwordResetAt','alias',_0xbb43('0x1a'),'phoneBarAutoAnswerDelay',_0xbb43('0x1b'),_0xbb43('0x1c'),'phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires',_0xbb43('0x1d'),_0xbb43('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xbb43('0x1f'),'userProfileId','privacyEnabled',_0xbb43('0x20'),_0xbb43('0x21'),_0xbb43('0x22'),'downloadOmnichannelInteractions',_0xbb43('0x23'),'ignorePauseForPreviewCalls',_0xbb43('0x24'),_0xbb43('0x25'),'chatAutoanswerDelay','emailAutoanswer',_0xbb43('0x26'),_0xbb43('0x27'),_0xbb43('0x28'),_0xbb43('0x29'),'openchannelAutoanswerDelay',_0xbb43('0x2a'),'faxAutoanswerDelay',_0xbb43('0x2b'),'whatsappAutoanswerDelay'];exports[_0xbb43('0x2c')]=function(){return this['isAuthenticated'](!![])[_0xbb43('0x2d')](function(_0x451cbd,_0x577ddd,_0x1d0768){if(_0x451cbd['user']){_0x1d0768();}else{return db[_0xbb43('0x2e')][_0xbb43('0x2f')]({'where':{'id':_0x451cbd[_0xbb43('0x30')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})['then'](function(_0x269ca5){if(_0x269ca5&&_0x269ca5[_0xbb43('0x31')]){return _0x577ddd['status'](_0x269ca5[_0xbb43('0x32')]===_0xbb43('0x33')?0x195:0x193)[_0xbb43('0x34')]({'message':_0x269ca5[_0xbb43('0x32')]==='unmanaged'?'Unmanaged.':_0xbb43('0x35')});}else{_0x1d0768();}})[_0xbb43('0x36')](function(_0xa88db0){_0x1d0768(_0xa88db0);});}});};exports[_0xbb43('0x37')]=function isAuthenticated(_0x510b05){return compose()[_0xbb43('0x2d')](function(_0x21d386,_0x473828,_0x539730){var _0x2ad6da;if(_0x21d386['headers'][_0xbb43('0x38')]){if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],'Basic')){var _0x157d62=basicAuth(_0x21d386);db['User']['find']({'where':{'name':_0x157d62['name']}})[_0xbb43('0x3b')](function(_0x573a05){if(!_0x573a05||!_0x573a05[_0xbb43('0x3c')](_0x157d62[_0xbb43('0x3d')])){return _0x473828[_0xbb43('0x3e')](0x191)['json']({'message':_0xbb43('0x3f')});}_0x21d386[_0xbb43('0x40')]={'id':_0x573a05['id']};_0x539730();})[_0xbb43('0x36')](function(_0xd987fa){_0x539730(_0xd987fa);});}else if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],_0xbb43('0x41'))){validateJwt(_0x21d386,_0x473828,_0x539730);}else{if(_0x510b05){_0x539730();}else{return _0x473828['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}}}else if(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')]){try{var _0x4015ec={'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf[_0xbb43('0x45')]()};verifyJwt(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')],_0x4015ec)[_0xbb43('0x3b')](function(_0x21346a){return db[_0xbb43('0x46')][_0xbb43('0x47')]({'where':{'id':_0x21346a[_0xbb43('0x48')]}})[_0xbb43('0x3b')](function(_0x405f36){_0x2ad6da=_0x405f36;return db['Setting'][_0xbb43('0x2f')]({'where':{'id':0x1},'attributes':[_0xbb43('0x49'),'blockDuration'],'raw':!![]});})[_0xbb43('0x3b')](function(_0x2c9a7c){if(!_0x2ad6da||!_[_0xbb43('0x4a')](_0x2ad6da['apiKeyNonce'],_0x21346a['nonce'])){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4b')});}if(_0x2ad6da['disabled']){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}if(_0x2ad6da[_0xbb43('0x4d')]){if(_0x2c9a7c[_0xbb43('0x4e')]>0x0){if(moment(_0x2ad6da[_0xbb43('0x4f')])['add'](_0x2c9a7c[_0xbb43('0x4e')],_0xbb43('0x50'))>moment()){return _0x473828[_0xbb43('0x3e')](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}}else{return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x21d386[_0xbb43('0x40')]={'id':_0x2ad6da['id']};_0x539730();});})[_0xbb43('0x36')](function(){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1fcf64){_0x539730(_0x1fcf64);}}else if(_0x510b05){_0x539730();}else{return _0x473828[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}})['use'](function(_0x3e0871,_0x136bd4,_0x59750b){if(_0x3e0871[_0xbb43('0x40')]){db['User'][_0xbb43('0x47')]({'where':{'id':_0x3e0871[_0xbb43('0x40')]['id']},'attributes':userAttributes})[_0xbb43('0x3b')](function(_0x14e57e){if(!_0x14e57e){return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':'User\x20not\x20found.'});}_0x3e0871[_0xbb43('0x40')]=_0x14e57e;_0x59750b();})['catch'](function(_0x307f1e){_0x59750b(_0x307f1e);});}else if(_0x510b05){_0x59750b();}else{return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':_0xbb43('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xbb43('0x2d')](function(_0x39f75f,_0x4bc351,_0x24ba15){return licenseUtil[_0xbb43('0x52')]()[_0xbb43('0x3b')](function(_0x40f519){if(_0x40f519[_0xbb43('0x53')]){_0x24ba15();}else{return _0x4bc351['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x54')});}})['catch'](function(_0x1a66f0){_0x24ba15(_0x1a66f0);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x4d7034,_0x5e2e6d,_0x1c3482){return licenseUtil['getLicense']()[_0xbb43('0x3b')](function(_0x5e5c86){if(_0x5e5c86[_0xbb43('0x55')]){_0x1c3482();}else{return _0x5e2e6d[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':'Forbidden'});}})[_0xbb43('0x36')](function(_0x4d9f18){_0x1c3482(_0x4d9f18);});});};exports[_0xbb43('0x56')]=function(_0x2518bf,_0xd43d24,_0x29840e){_0x2518bf[_0xbb43('0x56')]=!![];return _0x29840e();};exports[_0xbb43('0x57')]=function signToken(_0x37d8d3){return signJwt(_0x37d8d3);};exports['setTokenCookie']=function(_0x93f6e7,_0x26ea59){if(!_0x93f6e7[_0xbb43('0x40')]){return _0x26ea59[_0xbb43('0x3e')](0x194)['json']({'message':_0xbb43('0x58')});}var _0x3233b7={'payload':{'id':_0x93f6e7[_0xbb43('0x40')]['id'],'role':_0x93f6e7[_0xbb43('0x40')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3233b7)[_0xbb43('0x3b')](function(_0x3fdb10){_0x26ea59[_0xbb43('0x59')]('motion.token',_0x3fdb10);_0x26ea59[_0xbb43('0x5a')](_0xbb43('0x5b'));})[_0xbb43('0x36')](function(_0x1dc40a){return _0x26ea59[_0xbb43('0x3e')](0x1f4)['send'](_0x1dc40a);});};exports['retrieveApiKey']=function(_0xb44557){if(_['isNil'](_0xb44557[_0xbb43('0x5c')])||_[_0xbb43('0x5d')](_0xb44557['apiKeyIat'])){return null;}else{return createJwt(_0xb44557);}};exports[_0xbb43('0x5e')]=function(_0x3719dc){_0x3719dc[_0xbb43('0x5c')]=generateNonce();_0x3719dc[_0xbb43('0x5f')]=generateIssuedAt();return createJwt(_0x3719dc);};exports[_0xbb43('0x60')]=function(_0x5cb3c6,_0x124f88){var _0x539ffc=_0x5cb3c6['query'][_0xbb43('0x44')];if(_0x539ffc){var _0x1b9307={'nonce':_0x124f88[_0xbb43('0x5c')],'iat':_0x124f88[_0xbb43('0x5f')],'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x539ffc,_0x1b9307)['then'](function(){return generateApiKey(_0x124f88);});}else{throw{'message':_0xbb43('0x61')};}};exports[_0xbb43('0x62')]=function(_0x3a84ad){var _0x308646=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x308646[_0xbb43('0x63')](_0x3a84ad))throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0xbb43('0x66'));return;};exports[_0xbb43('0x67')]=function(_0x578b85,_0x1b6f96,_0xb996d7){var _0x432bd8=encryptor[_0xbb43('0x68')](_0x1b6f96)[_0xbb43('0x69')](',');for(var _0x1fae27=0x0;_0x1fae27<_0xb996d7;_0x1fae27++){if(!_0x432bd8[_0x1fae27])break;if(_0x578b85[_0xbb43('0x6a')]()===_0x432bd8[_0x1fae27][_0xbb43('0x6a')]()){var _0x3e01e4=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xb996d7);if(_0xb996d7===0x1){_0x3e01e4=_0xbb43('0x6b');}throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0x3e01e4);}}return;};exports[_0xbb43('0x6c')]=function(_0x38814a,_0x19e27e){var _0x2e01fb=_0x19e27e?encryptor['decryptString'](_0x19e27e)[_0xbb43('0x69')](','):[];if(_0x2e01fb['length']===0x5){_0x2e01fb['splice'](-0x1,0x1);}_0x2e01fb[_0xbb43('0x6d')](_0x38814a);return encryptor[_0xbb43('0x6e')](_0x2e01fb[_0xbb43('0x6f')](','));};function signJwt(_0x22ce17){var _0x24393a=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x71')],{'context':jwt});var _0x341481=_0x22ce17['secret']||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0x2b96b8,_0x137e75){_0x24393a(_0x22ce17[_0xbb43('0x72')],_0x341481,_0x22ce17[_0xbb43('0x73')])[_0xbb43('0x3b')](function(_0x12717e){_0x2b96b8(_0x12717e);})[_0xbb43('0x36')](function(_0x3ca6ad){_0x137e75(_0x3ca6ad);});});}function verifyJwt(_0x555426,_0x165936,_0x392d1a){var _0x234bc7=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x74')],{'context':jwt});var _0x33a4db=_0x392d1a||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0xb48be2,_0x42e437){_0x234bc7(_0x555426,_0x33a4db,_0x165936)[_0xbb43('0x3b')](function(_0xc34a02){_0xb48be2(_0xc34a02);})['catch'](function(_0x3c260f){_0x42e437(_0x3c260f);});});}function generateNonce(){return crypto[_0xbb43('0x75')](0x10)[_0xbb43('0x76')](_0xbb43('0x77'));}function generateIssuedAt(){return Math[_0xbb43('0x78')](Date[_0xbb43('0x79')]()/0x3e8)[_0xbb43('0x76')]();}function createJwt(_0x2992ea){var _0x10fd8b={'payload':{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce']},'options':{'algorithm':_0xbb43('0x7a'),'subject':_0x2992ea['id']['toString'](),'issuer':hardwareConf[_0xbb43('0x45')](),'audience':hardwareConf[_0xbb43('0x45')]()}};return signJwt(_0x10fd8b)[_0xbb43('0x3b')](function(_0x3dbcd9){return{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce'],'token':_0x3dbcd9};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index c3000fc..ce8e509 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb7e7[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});}; \ No newline at end of file +var _0xd55f=['startsWith','map','CmCustomField','findOne','cf_','fieldType','type','lodash','./sql-utils','findAll','skipContactsQuery','resolve','getContactsSubquery','search','parseAdvancedSearchFilter','parseQueryParameters','then','where','default','fields','filter','user','skip','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','catch','describe','keys'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd55f,0x130));var _0xfd55=function(_0x4e3032,_0x3d1eee){_0x4e3032=_0x4e3032-0x0;var _0x144c11=_0xd55f[_0x4e3032];return _0x144c11;};'use strict';var _=require(_0xfd55('0x0'));var sqlUtils=require(_0xfd55('0x1'));var db=require('../../mysqldb')['db'];exports[_0xfd55('0x2')]=function(_0xc3c887,_0x5ef7ac,_0x37a684,_0x34ebd0){var _0x35ffdc={'count':0x0,'rows':[]};var _0x457678=sqlUtils[_0xfd55('0x3')](_0x5ef7ac,_0xc3c887);if(_0x457678){return Promise[_0xfd55('0x4')](_0x35ffdc);}var _0x6da0b8=sqlUtils[_0xfd55('0x5')]();var _0x36813e={};var _0x49d2cc=![];var _0x1bc3fb=![];return Promise[_0xfd55('0x4')]()['then'](function(){if(_0xc3c887[_0xfd55('0x6')]){return sqlUtils[_0xfd55('0x7')](_0xc3c887[_0xfd55('0x6')],_0x34ebd0);}else{return sqlUtils[_0xfd55('0x8')](_0xc3c887,_0x34ebd0);}})[_0xfd55('0x9')](function(_0x29d4b6){_0x6da0b8[_0xfd55('0xa')](_0x29d4b6[_0xfd55('0xb')]);_0x6da0b8[_0xfd55('0xa')](_0x29d4b6[_0xfd55('0xc')]);_0x6da0b8[_0xfd55('0xa')](_0x29d4b6[_0xfd55('0xd')]);_0x6da0b8['where'](_0x29d4b6[_0xfd55('0xe')]['clause']);_0x36813e=_0x29d4b6['tags'];_0x1bc3fb=_0x29d4b6[_0xfd55('0xe')][_0xfd55('0xf')];return sqlUtils['checkListsRestrictions'](_0x5ef7ac,_0xc3c887,_0x1bc3fb);})[_0xfd55('0x9')](function(_0x3659db){_0x6da0b8[_0xfd55('0xa')](_0x3659db);var _0x5bb545=_0xc3c887[_0xfd55('0x6')]?_0x36813e['ids']:_0xc3c887[_0xfd55('0x10')];_0x49d2cc=_0x5bb545?!![]:![];return sqlUtils[_0xfd55('0x11')](_0x6da0b8,_0x5bb545);})[_0xfd55('0x9')](function(_0x5c9007){_0x35ffdc['count']=_0x5c9007;if(_0x35ffdc[_0xfd55('0x12')]===0x0){return;}if(_0xc3c887['User']){_0x1bc3fb=!![];}return sqlUtils[_0xfd55('0x13')](_0x6da0b8,_0xc3c887[_0xfd55('0xc')],_0x37a684,_0x49d2cc,_0x36813e[_0xfd55('0x14')],_0x1bc3fb);})['then'](function(_0x593aca){if(!_0x593aca){return[];}return sqlUtils[_0xfd55('0x15')](_0x593aca,_0xc3c887,_0x37a684);})[_0xfd55('0x9')](function(_0x86ae67){_0x35ffdc[_0xfd55('0x16')]=_0x86ae67;return _0x35ffdc;})[_0xfd55('0x17')](function(_0x501f06){throw _0x501f06;});};exports[_0xfd55('0x18')]=function(){var _0x22cb99={};var _0x24e528=[];return db['CmContact'][_0xfd55('0x18')]()['then'](function(_0x14d2f3){_0x22cb99=_0x14d2f3;var _0x129bbd=Object[_0xfd55('0x19')](_0x22cb99)['filter'](function(_0x15f9aa){return _[_0xfd55('0x1a')](_0x15f9aa,'cf_')?_0x15f9aa:undefined;});var _0x587c12=_0x129bbd[_0xfd55('0x1b')](function(_0x468b20){return db[_0xfd55('0x1c')][_0xfd55('0x1d')]({'where':{'id':_0x468b20['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x587c12);})['then'](function(_0x41f151){for(var _0x6d51d7=0x0;_0x6d51d7<_0x41f151['length'];_0x6d51d7++){if(_0x41f151[_0x6d51d7]){var _0x27f0a7=_0xfd55('0x1e')+_0x41f151[_0x6d51d7]['id'];_0x22cb99[_0x27f0a7][_0xfd55('0x1f')]=_0x41f151[_0x6d51d7][_0xfd55('0x20')];}}_0x24e528=_[_0xfd55('0x1b')](Object[_0xfd55('0x19')](_0x22cb99),function(_0x169680){return{'name':_0x169680,'type':_0x22cb99[_0x169680][_0xfd55('0x20')]};});return _0x24e528;})[_0xfd55('0x17')](function(_0x290166){throw _0x290166;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 19ea090..c5396d2 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74b8=['CmContact','sequelize','query','toString','Tags','clone','c.id','t.id\x20IN\x20?','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','subqry','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','push','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','start','value','Tag','map','tags','and','ids','user','clause','uc.UserId\x20=\x20?','keys','compact','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','SELECT'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0x74b8,0x79));var _0x874b=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x74b8[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x874b('0x0'));var squel=require(_0x874b('0x1'));var as=require(_0x874b('0x2'));var qs=require(_0x874b('0x3'));var utils=require(_0x874b('0x4'));var db=require(_0x874b('0x5'))['db'];function skipContactsQuery(_0x400d74,_0x49eefc){var _0x3eb843=![];if(_0x400d74[_0x874b('0x6')]==='agent'&&!_0x49eefc[_0x874b('0x7')]&&!_0x49eefc[_0x874b('0x8')]&&_0x49eefc['autocomplete']!==_0x874b('0x9')){_0x3eb843=!![];}return _0x3eb843;}function getContactsSubquery(){return squel[_0x874b('0xa')]()[_0x874b('0xb')](_0x874b('0xc'),'c')[_0x874b('0xd')](_0x874b('0xe'));}function applyJoinClauses(_0x3defbc,_0x5a0dbf){var _0x234f09=_0x5a0dbf?'c':'subqry';_0x3defbc[_0x874b('0xf')]('cm_user_has_contacts','uc',_0x874b('0x10')+_0x234f09+_0x874b('0x11'))[_0x874b('0xf')]('cm_contact_has_tags','ct',_0x874b('0x12')+_0x234f09+_0x874b('0x11'))[_0x874b('0xf')](_0x874b('0x13'),'t','t.id\x20=\x20ct.TagId');return _0x3defbc;}function addFieldsToQuery(_0x3adf8f,_0x231043,_0x461386,_0x2f425b,_0x3b0e75){var _0x4560b6=_0x3b0e75?'c':_0x874b('0x14');if(!_0x231043){_0x231043=['id',_0x874b('0x15'),_0x874b('0x16'),_0x874b('0x17'),_0x874b('0x18'),_0x874b('0x19'),_0x874b('0x1a'),'ListId','CompanyId',_0x874b('0x1b'),_0x874b('0x1c'),_0x874b('0x1d'),_0x874b('0x1e')];}else if(!_0x231043[_0x874b('0x1f')]('id')){_0x231043[_0x874b('0x20')]('id');}var _0x2dbb4c=_0x461386&&_0x3b0e75||!_0x461386&&!_0x3b0e75;if(_0x2f425b){_0x2dbb4c=_0x2f425b&&_0x3b0e75||!_0x2f425b&&!_0x3b0e75;}_0x231043['forEach'](function(_0x3d9afa){if(_0x3d9afa==='TagIds'){if(_0x2dbb4c){_0x3adf8f[_0x874b('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3d9afa);}else if(_0x461386||_0x2f425b){_0x3adf8f[_0x874b('0x21')](_0x4560b6+'.'+_0x3d9afa);}}else{_0x3adf8f[_0x874b('0x21')](_0x4560b6+'.'+_0x3d9afa);}});return _0x3adf8f;}function getSqlClauses(){var _0x2113c4={'default':squel[_0x874b('0x22')](),'fields':squel[_0x874b('0x22')](),'filter':squel[_0x874b('0x22')](),'tags':{'clause':squel[_0x874b('0x22')](),'ids':null},'user':{'clause':squel[_0x874b('0x22')](),'skip':![]}};return _0x2113c4;}function parseTagParameter(_0x2bfb18){var _0x509c38=squel[_0x874b('0x22')]();if(_0x2bfb18){var _0x1cadbb=utils[_0x874b('0x23')](_0x2bfb18);_0x1cadbb[_0x874b('0x24')](function(_0xe1a9f0){_0x509c38['or'](_0x874b('0x25'),'%,'+_0xe1a9f0+',%');});}return _0x509c38;}function parseSearchFilter(_0x17d0af){var _0x1086eb=squel[_0x874b('0x22')]();if(_0x17d0af){var _0x16d917=_0x17d0af[_0x874b('0x26')]('\x5c','\x5c\x5c')[_0x874b('0x26')](/'/g,'\x27\x27');if(_0x16d917[_0x874b('0x27')]('\x20')[_0x874b('0x28')]>0x1){_0x1086eb['or'](_0x874b('0x29'),qs[_0x874b('0x2a')](_0x16d917),null);}else{if(qs[_0x874b('0x2b')](_0x16d917)){_0x1086eb['or'](_0x874b('0x2c'),_0x16d917+'%');_0x1086eb['or'](_0x874b('0x2d'),_0x16d917+'%');_0x1086eb['or'](_0x874b('0x2e'),_0x16d917+'%');_0x1086eb['or'](_0x874b('0x2f'),_0x16d917+'%');}else if(qs[_0x874b('0x30')](_0x16d917)){_0x1086eb['or'](_0x874b('0x31'),_0x16d917+'%');}else{_0x1086eb['or']('c.firstName\x20LIKE\x20?','%'+_0x16d917+'%');_0x1086eb['or']('c.lastName\x20LIKE\x20?','%'+_0x16d917+'%');_0x1086eb['or'](_0x874b('0x31'),'%'+_0x16d917+'%');}}}return _0x1086eb;}function parseAdvancedSearchFilter(_0x2d1b11,_0x41278){var _0x649497=getSqlClauses();var _0x52d95b=as[_0x874b('0x32')](_0x2d1b11);var _0x3e1dea=_0x52d95b['sqlOperator'];for(var _0x5688e0=0x0;_0x5688e0<_0x52d95b[_0x874b('0x33')]['length'];_0x5688e0++){var _0x4584a8=_0x52d95b['conditions'][_0x5688e0];var _0x567470='c';var _0x4936ef=_['find'](_0x41278,[_0x874b('0x34'),_0x4584a8[_0x874b('0x21')]]);if(_0x4936ef){if(_0x4584a8['field']===_0x874b('0x35')||_0x4936ef[_0x874b('0x36')]===_0x874b('0x37')){_0x4584a8[_0x874b('0x38')]=_0x874b('0x39');}var _0x34f1c2=as[_0x874b('0x3a')](_0x567470,_0x4936ef[_0x874b('0x3b')],_0x4584a8);_0x649497[_0x874b('0x3c')][_0x3e1dea](_0x34f1c2[_0x874b('0x3d')],_0x34f1c2['value'][_0x874b('0x3e')],_0x34f1c2[_0x874b('0x3f')]['end']);}else{if(_0x4584a8['field']===_0x874b('0x40')){var _0x5f409f=_0x4584a8[_0x874b('0x3f')]['split'](',')[_0x874b('0x41')](function(_0x4d04ca){return Number(_0x4d04ca);});var _0x5d2e79=parseTagParameter(_0x5f409f);_0x649497[_0x874b('0x42')]['clause'][_0x874b('0x43')](_0x5d2e79);_0x649497[_0x874b('0x42')][_0x874b('0x44')]=_0x5f409f;}else if(_0x4584a8[_0x874b('0x21')]==='User'){_0x649497[_0x874b('0x45')][_0x874b('0x46')][_0x874b('0x43')](_0x874b('0x47'),_0x4584a8[_0x874b('0x3f')]);_0x649497[_0x874b('0x45')]['skip']=!![];}}}return _0x649497;}function parseModelFields(_0x23ed60,_0x3e6733){var _0x21abab=squel[_0x874b('0x22')]();var _0x2631f8=_(_0x23ed60)[_0x874b('0x48')]()[_0x874b('0x41')](function(_0x3891e8){return _['some'](_0x3e6733,['name',_0x3891e8])?_0x3891e8:undefined;})[_0x874b('0x49')]()[_0x874b('0x3f')]();if(_0x23ed60['Contact']){_0x2631f8[_0x874b('0x20')]('Contact');}if(_0x2631f8[_0x874b('0x28')]>0x0){_0x2631f8[_0x874b('0x24')](function(_0x4af449){if(_0x4af449===_0x874b('0x8')){_0x21abab[_0x874b('0x43')](_0x874b('0x4a'),[][_0x874b('0x4b')](_0x23ed60[_0x4af449]));}else if(_0x4af449===_0x874b('0x4c')){var _0x37ac20='%'+_0x23ed60[_0x4af449]+'%';_0x21abab[_0x874b('0x43')](_0x874b('0x4d'),_0x37ac20);}else{_0x21abab['and']('c.'+_0x4af449+_0x874b('0x4e'),_0x23ed60[_0x4af449]);}});}return _0x21abab;}function parseQueryParameters(_0x327006,_0x25e5aa){var _0x246750=getSqlClauses();return Promise[_0x874b('0x4f')]()[_0x874b('0x50')](function(){return parseModelFields(_0x327006,_0x25e5aa);})['then'](function(_0x43c365){_0x246750[_0x874b('0x51')][_0x874b('0x43')](_0x43c365);return parseTagParameter(_0x327006[_0x874b('0x52')]);})[_0x874b('0x50')](function(_0x470dca){_0x246750[_0x874b('0x42')]['clause']['and'](_0x470dca);return parseSearchFilter(_0x327006[_0x874b('0x53')]);})[_0x874b('0x50')](function(_0x46bf12){_0x246750[_0x874b('0x53')]=_0x46bf12;return _0x246750;});}function checkListsRestrictions(_0x38bf94,_0xd15797,_0x45fc9d){var _0x1344a5=squel[_0x874b('0x22')]();return Promise[_0x874b('0x4f')]()[_0x874b('0x50')](function(){if(_0xd15797['search']&&_0x38bf94[_0x874b('0x6')]===_0x874b('0x54')&&!_0x45fc9d){return _0x38bf94[_0x874b('0x55')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x58138b){if(_0x58138b){if(_0x58138b[_0x874b('0x28')]===0x0){_0x1344a5[_0x874b('0x43')](_0x874b('0x56'));}else{_0x1344a5[_0x874b('0x43')]('c.ListId\x20IN\x20?',_[_0x874b('0x41')](_0x58138b,'id'));}}})['then'](function(){return _0x1344a5;});}function buildContactsQuery(_0x3bbc0d,_0xd251b9,_0x5f4a0b,_0x45cafa,_0x409789,_0x89783){if(_0xd251b9){_0xd251b9=_0x5f4a0b[_0x874b('0x57')];}_0x3bbc0d=addFieldsToQuery(_0x3bbc0d,_0xd251b9,_0x45cafa,_0x89783,!![]);var _0x3eda8b=squel[_0x874b('0xa')]();_0x3eda8b=addFieldsToQuery(_0x3eda8b,_0xd251b9,_0x45cafa,_0x89783,![]);if(_0x45cafa||_0x89783){_0x3bbc0d=applyJoinClauses(_0x3bbc0d,!![]);_0x3bbc0d[_0x874b('0x58')]('c.id');if(_0x5f4a0b['limit']){_0x3eda8b[_0x874b('0x59')](_0x5f4a0b[_0x874b('0x59')]);}if(_0x5f4a0b['offset']){_0x3eda8b['offset'](_0x5f4a0b[_0x874b('0x5a')]);}}else{_0x3eda8b=applyJoinClauses(_0x3eda8b,![]);_0x3eda8b[_0x874b('0x58')](_0x874b('0x5b'));if(_0x5f4a0b[_0x874b('0x59')]){_0x3bbc0d['limit'](_0x5f4a0b['limit']);}if(_0x5f4a0b[_0x874b('0x5a')]){_0x3bbc0d['offset'](_0x5f4a0b[_0x874b('0x5a')]);}}_0x3eda8b[_0x874b('0x5c')](_0x409789);if(_0x5f4a0b['order']){_0x5f4a0b[_0x874b('0x5d')][_0x874b('0x24')](function(_0x42538a){_0x3bbc0d['order']('c.'+_0x42538a[0x0],_0x42538a[0x1]==='DESC'?![]:!![]);_0x3eda8b['order']('subqry.'+_0x42538a[0x0],_0x42538a[0x1]===_0x874b('0x5e')?![]:!![]);});}_0x3eda8b[_0x874b('0xb')](_0x3bbc0d,_0x874b('0x14'));return _0x3eda8b;}function getFilteredContacts(_0x2c7693){var _0xd2b7aa=[];return db['Tag'][_0x874b('0x5f')]({'attributes':['id',_0x874b('0x34'),_0x874b('0x60')],'raw':!![]})[_0x874b('0x50')](function(_0x45f4c7){_0xd2b7aa=_[_0x874b('0x61')](_0x45f4c7,'id');var _0x59953e={'type':db[_0x874b('0x62')][_0x874b('0x63')][_0x874b('0x64')],'model':db[_0x874b('0x65')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x874b('0x66')][_0x874b('0x67')](_0x2c7693[_0x874b('0x68')](),_0x59953e);})[_0x874b('0x50')](function(_0x5b163c){_0x5b163c[_0x874b('0x24')](function(_0x5575b2){if(_0x5575b2[_0x874b('0x1e')]){_0x5575b2[_0x874b('0x69')]=[];_0x5575b2['TagIds']['split'](',')[_0x874b('0x24')](function(_0x56da2c){_0x5575b2[_0x874b('0x69')][_0x874b('0x20')](_0xd2b7aa[_0x56da2c]);});}delete _0x5575b2[_0x874b('0x1e')];});return _0x5b163c;});}function countFilteredContacts(_0x491b02,_0x161bc0){var _0x34e87f=_0x491b02[_0x874b('0x6a')]();_0x34e87f[_0x874b('0x21')]('COUNT(*)');_0x34e87f=applyJoinClauses(_0x34e87f,!![]);_0x491b02['group'](_0x874b('0x6b'));var _0x1cb232=utils[_0x874b('0x23')](_0x161bc0);if(!_['isEmpty'](_0x1cb232)){_0x34e87f[_0x874b('0xd')](_0x874b('0x6c'),_0x1cb232);}var _0x5522ff={'type':db[_0x874b('0x62')][_0x874b('0x63')][_0x874b('0x64')],'raw':!![]};return db['sequelize']['query'](_0x34e87f['toString'](),_0x5522ff)['then'](function(_0x43a7ce){return _0x43a7ce[0x0][_0x874b('0x6d')];});}module[_0x874b('0x6e')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x3a7e=['skip','keys','some','Contact','push','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','tag','clause','filter','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','subqry.id','having','order','subqry.','DESC','Tag','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','where','t.id\x20IN\x20?','sequelize','exports','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','true','select','from','c.deletedAt\x20IS\x20NULL','subqry','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','includes','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','parseSearch','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','type','default','value','start','map','tags','and','ids','user'];(function(_0xfb3b3,_0x10db7a){var _0x36cae7=function(_0x183814){while(--_0x183814){_0xfb3b3['push'](_0xfb3b3['shift']());}};_0x36cae7(++_0x10db7a);}(_0x3a7e,0x106));var _0xe3a7=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x3a7e[_0x4a5494];return _0x57cbb5;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0xe3a7('0x0'));var qs=require(_0xe3a7('0x1'));var utils=require(_0xe3a7('0x2'));var db=require(_0xe3a7('0x3'))['db'];function skipContactsQuery(_0x2bc5fc,_0x1ab9bf){var _0x1ab0cc=![];if(_0x2bc5fc['role']===_0xe3a7('0x4')&&!_0x1ab9bf[_0xe3a7('0x5')]&&!_0x1ab9bf[_0xe3a7('0x6')]&&_0x1ab9bf['autocomplete']!==_0xe3a7('0x7')){_0x1ab0cc=!![];}return _0x1ab0cc;}function getContactsSubquery(){return squel[_0xe3a7('0x8')]()[_0xe3a7('0x9')]('cm_contacts','c')['where'](_0xe3a7('0xa'));}function applyJoinClauses(_0x23589d,_0xf2c6a8){var _0xa963d0=_0xf2c6a8?'c':_0xe3a7('0xb');_0x23589d['left_join']('cm_user_has_contacts','uc',_0xe3a7('0xc')+_0xa963d0+_0xe3a7('0xd'))[_0xe3a7('0xe')](_0xe3a7('0xf'),'ct',_0xe3a7('0x10')+_0xa963d0+'.id')[_0xe3a7('0xe')]('tools_tags','t',_0xe3a7('0x11'));return _0x23589d;}function addFieldsToQuery(_0x37825e,_0x3b08b1,_0x4e2390,_0x5da7a7,_0x21806e){var _0x5dd38e=_0x21806e?'c':_0xe3a7('0xb');if(!_0x3b08b1){_0x3b08b1=['id',_0xe3a7('0x12'),_0xe3a7('0x13'),_0xe3a7('0x14'),_0xe3a7('0x15'),_0xe3a7('0x16'),_0xe3a7('0x17'),'ListId',_0xe3a7('0x18'),_0xe3a7('0x19'),'updatedAt',_0xe3a7('0x1a'),_0xe3a7('0x1b')];}else if(!_0x3b08b1[_0xe3a7('0x1c')]('id')){_0x3b08b1['push']('id');}var _0x305df6=_0x4e2390&&_0x21806e||!_0x4e2390&&!_0x21806e;if(_0x5da7a7){_0x305df6=_0x5da7a7&&_0x21806e||!_0x5da7a7&&!_0x21806e;}_0x3b08b1[_0xe3a7('0x1d')](function(_0x109247){if(_0x109247==='TagIds'){if(_0x305df6){_0x37825e['field'](_0xe3a7('0x1e'),_0x109247);}else if(_0x4e2390||_0x5da7a7){_0x37825e[_0xe3a7('0x1f')](_0x5dd38e+'.'+_0x109247);}}else{_0x37825e['field'](_0x5dd38e+'.'+_0x109247);}});return _0x37825e;}function getSqlClauses(){var _0x4f4bf3={'default':squel[_0xe3a7('0x20')](),'fields':squel[_0xe3a7('0x20')](),'filter':squel[_0xe3a7('0x20')](),'tags':{'clause':squel[_0xe3a7('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x4f4bf3;}function parseTagParameter(_0xc9d9f){var _0x25782f=squel[_0xe3a7('0x20')]();if(_0xc9d9f){var _0x19605d=utils[_0xe3a7('0x21')](_0xc9d9f);_0x19605d[_0xe3a7('0x1d')](function(_0x2d41f1){_0x25782f['or'](_0xe3a7('0x22'),'%,'+_0x2d41f1+',%');});}return _0x25782f;}function parseSearchFilter(_0x2a5d9d){var _0x2db731=squel['expr']();if(_0x2a5d9d){var _0x367246=_0x2a5d9d[_0xe3a7('0x23')]('\x5c','\x5c\x5c')[_0xe3a7('0x23')](/'/g,'\x27\x27');if(_0x367246[_0xe3a7('0x24')]('\x20')[_0xe3a7('0x25')]>0x1){_0x2db731['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe3a7('0x26')](_0x367246,!![]),null);}else{if(qs['isNumeric'](_0x367246)){_0x2db731['or'](_0xe3a7('0x27'),_0x367246+'%');_0x2db731['or'](_0xe3a7('0x28'),_0x367246+'%');_0x2db731['or']('c.mobile\x20LIKE\x20?',_0x367246+'%');_0x2db731['or'](_0xe3a7('0x29'),_0x367246+'%');}else if(qs[_0xe3a7('0x2a')](_0x367246)){_0x2db731['or']('c.email\x20LIKE\x20?',_0x367246+'%');}else{_0x2db731['or'](_0xe3a7('0x2b'),'%'+_0x367246+'%');_0x2db731['or']('c.lastName\x20LIKE\x20?','%'+_0x367246+'%');_0x2db731['or']('c.email\x20LIKE\x20?','%'+_0x367246+'%');}}}return _0x2db731;}function parseAdvancedSearchFilter(_0x325f3a,_0x48daf9){var _0x1ebc71=getSqlClauses();var _0x268f48=as[_0xe3a7('0x2c')](_0x325f3a);var _0x479050=_0x268f48['sqlOperator'];for(var _0x1220c4=0x0;_0x1220c4<_0x268f48[_0xe3a7('0x2d')][_0xe3a7('0x25')];_0x1220c4++){var _0x4e4698=_0x268f48['conditions'][_0x1220c4];var _0x45747d='c';var _0x74a459=_[_0xe3a7('0x2e')](_0x48daf9,[_0xe3a7('0x2f'),_0x4e4698[_0xe3a7('0x1f')]]);if(_0x74a459){if(_0x4e4698[_0xe3a7('0x1f')]===_0xe3a7('0x30')||_0x74a459[_0xe3a7('0x31')]===_0xe3a7('0x32')){_0x4e4698[_0xe3a7('0x33')]=_0xe3a7('0x34');}var _0x315566=as['buildExpression'](_0x45747d,_0x74a459[_0xe3a7('0x35')],_0x4e4698);_0x1ebc71[_0xe3a7('0x36')][_0x479050](_0x315566['text'],_0x315566[_0xe3a7('0x37')][_0xe3a7('0x38')],_0x315566[_0xe3a7('0x37')]['end']);}else{if(_0x4e4698[_0xe3a7('0x1f')]==='Tag'){var _0x5d4e6a=_0x4e4698[_0xe3a7('0x37')][_0xe3a7('0x24')](',')[_0xe3a7('0x39')](function(_0x16d801){return Number(_0x16d801);});var _0x35c750=parseTagParameter(_0x5d4e6a);_0x1ebc71[_0xe3a7('0x3a')]['clause'][_0xe3a7('0x3b')](_0x35c750);_0x1ebc71[_0xe3a7('0x3a')][_0xe3a7('0x3c')]=_0x5d4e6a;}else if(_0x4e4698[_0xe3a7('0x1f')]==='User'){_0x1ebc71['user']['clause'][_0xe3a7('0x3b')]('uc.UserId\x20=\x20?',_0x4e4698['value']);_0x1ebc71[_0xe3a7('0x3d')][_0xe3a7('0x3e')]=!![];}}}return _0x1ebc71;}function parseModelFields(_0x4b2279,_0x40b66c){var _0x2a3586=squel[_0xe3a7('0x20')]();var _0x2d79f0=_(_0x4b2279)[_0xe3a7('0x3f')]()['map'](function(_0x503bd6){return _[_0xe3a7('0x40')](_0x40b66c,[_0xe3a7('0x2f'),_0x503bd6])?_0x503bd6:undefined;})['compact']()[_0xe3a7('0x37')]();if(_0x4b2279[_0xe3a7('0x41')]){_0x2d79f0['push']('Contact');}if(_0x4b2279['User']){_0x2d79f0[_0xe3a7('0x42')](_0xe3a7('0x43'));}if(_0x2d79f0[_0xe3a7('0x25')]>0x0){_0x2d79f0[_0xe3a7('0x1d')](function(_0x389179){if(_0x389179==='ListId'){_0x2a3586[_0xe3a7('0x3b')](_0xe3a7('0x44'),[][_0xe3a7('0x45')](_0x4b2279[_0x389179]));}else if(_0x389179===_0xe3a7('0x41')){var _0x1bc3d6='%'+_0x4b2279[_0x389179]+'%';_0x2a3586[_0xe3a7('0x3b')](_0xe3a7('0x46'),_0x1bc3d6);}else if(_0x389179===_0xe3a7('0x43')){_0x2a3586[_0xe3a7('0x3b')](_0xe3a7('0x47'),_0x4b2279[_0x389179]);}else{_0x2a3586[_0xe3a7('0x3b')]('c.'+_0x389179+_0xe3a7('0x48'),_0x4b2279[_0x389179]);}});}return _0x2a3586;}function parseQueryParameters(_0x210a26,_0x1c3b26){var _0x1b7dd6=getSqlClauses();return Promise[_0xe3a7('0x49')]()[_0xe3a7('0x4a')](function(){return parseModelFields(_0x210a26,_0x1c3b26);})[_0xe3a7('0x4a')](function(_0x29d65a){_0x1b7dd6[_0xe3a7('0x4b')][_0xe3a7('0x3b')](_0x29d65a);return parseTagParameter(_0x210a26[_0xe3a7('0x4c')]);})[_0xe3a7('0x4a')](function(_0x1bbef7){_0x1b7dd6[_0xe3a7('0x3a')][_0xe3a7('0x4d')][_0xe3a7('0x3b')](_0x1bbef7);return parseSearchFilter(_0x210a26[_0xe3a7('0x4e')]);})[_0xe3a7('0x4a')](function(_0x45e0a8){_0x1b7dd6[_0xe3a7('0x4e')]=_0x45e0a8;return _0x1b7dd6;});}function checkListsRestrictions(_0x18e2aa,_0x4e6580,_0x532600){var _0x453c30=squel[_0xe3a7('0x20')]();return Promise[_0xe3a7('0x49')]()['then'](function(){if(_0x4e6580[_0xe3a7('0x5')]&&_0x18e2aa['role']===_0xe3a7('0x4')&&!_0x532600){return _0x18e2aa[_0xe3a7('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0xe3a7('0x4a')](function(_0x31495c){if(_0x31495c){if(_0x31495c[_0xe3a7('0x25')]===0x0){_0x453c30[_0xe3a7('0x3b')](_0xe3a7('0x50'));}else{_0x453c30[_0xe3a7('0x3b')]('c.ListId\x20IN\x20?',_['map'](_0x31495c,'id'));}}})['then'](function(){return _0x453c30;});}function buildContactsQuery(_0xbc01fc,_0x3aa287,_0xc95117,_0x1ed490,_0x443586,_0x3296eb){if(_0x3aa287){_0x3aa287=_0xc95117[_0xe3a7('0x51')];}_0xbc01fc=addFieldsToQuery(_0xbc01fc,_0x3aa287,_0x1ed490,_0x3296eb,!![]);var _0x3563df=squel['select']();_0x3563df=addFieldsToQuery(_0x3563df,_0x3aa287,_0x1ed490,_0x3296eb,![]);if(_0x1ed490||_0x3296eb){_0xbc01fc=applyJoinClauses(_0xbc01fc,!![]);_0xbc01fc['group'](_0xe3a7('0x52'));if(_0xc95117[_0xe3a7('0x53')]){_0x3563df[_0xe3a7('0x53')](_0xc95117[_0xe3a7('0x53')]);}if(_0xc95117[_0xe3a7('0x54')]){_0x3563df[_0xe3a7('0x54')](_0xc95117['offset']);}}else{_0x3563df=applyJoinClauses(_0x3563df,![]);_0x3563df[_0xe3a7('0x55')](_0xe3a7('0x56'));if(_0xc95117[_0xe3a7('0x53')]){_0xbc01fc[_0xe3a7('0x53')](_0xc95117[_0xe3a7('0x53')]);}if(_0xc95117[_0xe3a7('0x54')]){_0xbc01fc[_0xe3a7('0x54')](_0xc95117[_0xe3a7('0x54')]);}}_0x3563df[_0xe3a7('0x57')](_0x443586);if(_0xc95117[_0xe3a7('0x58')]){_0xc95117['order'][_0xe3a7('0x1d')](function(_0x4f3fe3){_0xbc01fc[_0xe3a7('0x58')]('c.'+_0x4f3fe3[0x0],_0x4f3fe3[0x1]==='DESC'?![]:!![]);_0x3563df[_0xe3a7('0x58')](_0xe3a7('0x59')+_0x4f3fe3[0x0],_0x4f3fe3[0x1]===_0xe3a7('0x5a')?![]:!![]);});}_0x3563df[_0xe3a7('0x9')](_0xbc01fc,_0xe3a7('0xb'));return _0x3563df;}function getFilteredContacts(_0x1adb74){var _0x189013=[];return db[_0xe3a7('0x5b')][_0xe3a7('0x5c')]({'attributes':['id',_0xe3a7('0x2f'),_0xe3a7('0x5d')],'raw':!![]})[_0xe3a7('0x4a')](function(_0x3446df){_0x189013=_[_0xe3a7('0x5e')](_0x3446df,'id');var _0x168439={'type':db[_0xe3a7('0x5f')][_0xe3a7('0x60')][_0xe3a7('0x61')],'model':db[_0xe3a7('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xe3a7('0x63')](_0x1adb74[_0xe3a7('0x64')](),_0x168439);})[_0xe3a7('0x4a')](function(_0x191f14){_0x191f14[_0xe3a7('0x1d')](function(_0x2deb2d){if(_0x2deb2d[_0xe3a7('0x1b')]){_0x2deb2d[_0xe3a7('0x65')]=[];_0x2deb2d[_0xe3a7('0x1b')][_0xe3a7('0x24')](',')['forEach'](function(_0x2ab040){_0x2deb2d['Tags'][_0xe3a7('0x42')](_0x189013[_0x2ab040]);});}delete _0x2deb2d[_0xe3a7('0x1b')];});return _0x191f14;});}function countFilteredContacts(_0x4b01d5,_0x18303b){var _0x2064fd=_0x4b01d5[_0xe3a7('0x66')]();_0x2064fd[_0xe3a7('0x1f')](_0xe3a7('0x67'));_0x2064fd=applyJoinClauses(_0x2064fd,!![]);_0x4b01d5[_0xe3a7('0x55')]('c.id');var _0xedb630=utils[_0xe3a7('0x21')](_0x18303b);if(!_['isEmpty'](_0xedb630)){_0x2064fd[_0xe3a7('0x68')](_0xe3a7('0x69'),_0xedb630);}var _0x3d596={'type':db[_0xe3a7('0x5f')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0xe3a7('0x6a')][_0xe3a7('0x63')](_0x2064fd[_0xe3a7('0x64')](),_0x3d596)['then'](function(_0x184e3a){return _0x184e3a[0x0]['COUNT(*)'];});}module[_0xe3a7('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 87bc5ef..9d676e1 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 _0xbbfa=['encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','final','createDecipher','close','createCipher','base64','decryptString','secret','utf8','bluebird','lodash','../../config/environment','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','hasOwnProperty'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xbbfa,0x6a));var _0xabbf=function(_0x13a68a,_0x2daaaa){_0x13a68a=_0x13a68a-0x0;var _0x27f857=_0xbbfa[_0x13a68a];return _0x27f857;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xabbf('0x0'));var _=require(_0xabbf('0x1'));var config=require(_0xabbf('0x2'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xabbf('0x3')][_0xabbf('0x4')],'algorithm':_0xabbf('0x5')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xabbf('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xabbf('0x7')]=config[_0xabbf('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xabbf('0x8')](',\x20');logger[_0xabbf('0x9')](config['encrypt']['algorithm'],_0xabbf('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x157a10){return AES_SUPPORTED_RX['test'](_0x157a10);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xabbf('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x23bddb){return getSupportedCiphers()[_0xabbf('0xc')](_0x23bddb)>-0x1;}function combineOptions(_0x4d17cd){var _0x2df118={};for(var _0x2e2c21 in fileOptions){if(fileOptions[_0xabbf('0xd')](_0x2e2c21)){_0x2df118[_0x2e2c21]=fileOptions[_0x2e2c21];}}if(_0x4d17cd){for(var _0x4d4a9a in _0x4d17cd){if(_0x4d17cd[_0xabbf('0xd')](_0x4d4a9a)){_0x2df118[_0x4d4a9a]=_0x4d17cd[_0x4d4a9a];}}}return _0x2df118;}exports[_0xabbf('0xe')]=function(_0x4e4743,_0xc7ad70,_0x4bd9dc,_0x30e15c){return new BPromise(function(_0x35b5b2,_0x97c02b){_0x30e15c=combineOptions(_0x30e15c);var _0x216918=new Buffer(_0x4bd9dc);var _0x220a65=fs[_0xabbf('0xf')](_0x4e4743);var _0x329087=fs[_0xabbf('0x10')](_0xc7ad70);var _0x3f8906=crypto['createCipher'](_0x30e15c[_0xabbf('0x7')],_0x216918);_0x220a65['on'](_0xabbf('0x11'),function(_0x3e2921){var _0x10dd1b=new Buffer(_0x3f8906[_0xabbf('0x12')](_0x3e2921),_0xabbf('0x13'));_0x329087[_0xabbf('0x14')](_0x10dd1b);});_0x220a65['on'](_0xabbf('0x15'),function(){try{var _0x227703=new Buffer(_0x3f8906[_0xabbf('0x16')](_0xabbf('0x13')),_0xabbf('0x13'));_0x329087[_0xabbf('0x14')](_0x227703);_0x329087[_0xabbf('0x15')]();_0x329087['on']('close',function(){return _0x35b5b2(_0xc7ad70);});}catch(_0x508063){fs['unlink'](_0xc7ad70);return _0x97c02b(_0x508063);}});});};exports['decryptFile']=function(_0x24936c,_0x52ac9b,_0x89f4dd,_0x246f4f){return new BPromise(function(_0x3b0e51,_0x419bcb){_0x246f4f=combineOptions(_0x246f4f);var _0x745f6a=new Buffer(_0x89f4dd);var _0x23268f=fs[_0xabbf('0xf')](_0x24936c);var _0x569cf4=fs[_0xabbf('0x10')](_0x52ac9b);var _0x5111f4=crypto[_0xabbf('0x17')](_0x246f4f[_0xabbf('0x7')],_0x745f6a);_0x23268f['on'](_0xabbf('0x11'),function(_0x4eb506){var _0x4446ae=new Buffer(_0x5111f4[_0xabbf('0x12')](_0x4eb506),'binary');_0x569cf4[_0xabbf('0x14')](_0x4446ae);});_0x23268f['on'](_0xabbf('0x15'),function(){try{var _0x9a1ac6=new Buffer(_0x5111f4[_0xabbf('0x16')](_0xabbf('0x13')),_0xabbf('0x13'));_0x569cf4[_0xabbf('0x14')](_0x9a1ac6);_0x569cf4['end']();_0x569cf4['on'](_0xabbf('0x18'),function(){return _0x3b0e51(_0x52ac9b);});}catch(_0x2bb603){fs['unlink'](_0x52ac9b);return _0x419bcb(_0x2bb603);}});});};exports['encryptString']=function(_0x297548,_0x5a3770,_0x4dca34){var _0x5d2bb8=_0x4dca34||stringOptions[_0xabbf('0x7')];var _0x1c5739=_0x5a3770||stringOptions['secret'];var _0x52964b=crypto[_0xabbf('0x19')](_0x5d2bb8,_0x1c5739);var _0x4b4b21=_0x52964b[_0xabbf('0x12')](_0x297548,'utf8',_0xabbf('0x1a'));_0x4b4b21+=_0x52964b[_0xabbf('0x16')]('base64');return _0x4b4b21;};exports[_0xabbf('0x1b')]=function(_0x1a2580,_0xf44182,_0x163fb1){var _0x229f7c=_0x163fb1||stringOptions[_0xabbf('0x7')];var _0x354f1e=_0xf44182||stringOptions[_0xabbf('0x1c')];var _0x7f0e87=crypto['createDecipher'](_0x229f7c,_0x354f1e);var _0xd013a4=_0x7f0e87[_0xabbf('0x12')](_0x1a2580,'base64',_0xabbf('0x1d'));_0xd013a4+=_0x7f0e87[_0xabbf('0x16')]('utf8');return _0xd013a4;}; \ No newline at end of file +var _0x6fd5=['encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','end','final','binary','write','close','unlink','decryptFile','createDecipher','update','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','session','aes192'];(function(_0x1da667,_0x5f0f7c){var _0x4bd44e=function(_0x56b7cd){while(--_0x56b7cd){_0x1da667['push'](_0x1da667['shift']());}};_0x4bd44e(++_0x5f0f7c);}(_0x6fd5,0x1e9));var _0x56fd=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6fd5[_0x580576];return _0x3f55a0;};'use strict';var crypto=require(_0x56fd('0x0'));var fs=require('fs');var BPromise=require(_0x56fd('0x1'));var _=require('lodash');var config=require(_0x56fd('0x2'));var logger=require(_0x56fd('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x56fd('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x56fd('0x5')};if(config['encrypt']&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x56fd('0x6')][_0x56fd('0x7')]);if(isSupported){fileOptions[_0x56fd('0x7')]=config[_0x56fd('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x56fd('0x8')](',\x20');logger[_0x56fd('0x9')](config[_0x56fd('0x6')]['algorithm'],_0x56fd('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x56150b){return AES_SUPPORTED_RX[_0x56fd('0xb')](_0x56150b);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x56fd('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x47d831){return getSupportedCiphers()['indexOf'](_0x47d831)>-0x1;}function combineOptions(_0x52fbcf){var _0x3d5731={};for(var _0x4b3e4c in fileOptions){if(fileOptions['hasOwnProperty'](_0x4b3e4c)){_0x3d5731[_0x4b3e4c]=fileOptions[_0x4b3e4c];}}if(_0x52fbcf){for(var _0x1c06fb in _0x52fbcf){if(_0x52fbcf[_0x56fd('0xd')](_0x1c06fb)){_0x3d5731[_0x1c06fb]=_0x52fbcf[_0x1c06fb];}}}return _0x3d5731;}exports[_0x56fd('0xe')]=function(_0x265412,_0x594647,_0xf9c722,_0x4392d8){return new BPromise(function(_0x5c0edd,_0x54362c){_0x4392d8=combineOptions(_0x4392d8);var _0x1d1c87=new Buffer(_0xf9c722);var _0x448472=fs[_0x56fd('0xf')](_0x265412);var _0x31cb11=fs[_0x56fd('0x10')](_0x594647);var _0x346fd0=crypto['createCipher'](_0x4392d8[_0x56fd('0x7')],_0x1d1c87);_0x448472['on'](_0x56fd('0x11'),function(_0x4a93c3){var _0x5f1c4d=new Buffer(_0x346fd0['update'](_0x4a93c3),'binary');_0x31cb11['write'](_0x5f1c4d);});_0x448472['on'](_0x56fd('0x12'),function(){try{var _0x200b32=new Buffer(_0x346fd0[_0x56fd('0x13')](_0x56fd('0x14')),_0x56fd('0x14'));_0x31cb11[_0x56fd('0x15')](_0x200b32);_0x31cb11[_0x56fd('0x12')]();_0x31cb11['on'](_0x56fd('0x16'),function(){return _0x5c0edd(_0x594647);});}catch(_0xb0e96b){fs[_0x56fd('0x17')](_0x594647);return _0x54362c(_0xb0e96b);}});});};exports[_0x56fd('0x18')]=function(_0x286b61,_0x34befd,_0x353edb,_0x403b90){return new BPromise(function(_0x265723,_0xc93f3c){_0x403b90=combineOptions(_0x403b90);var _0x5cdab7=new Buffer(_0x353edb);var _0x220500=fs[_0x56fd('0xf')](_0x286b61);var _0xc43891=fs['createWriteStream'](_0x34befd);var _0x5830f1=crypto[_0x56fd('0x19')](_0x403b90[_0x56fd('0x7')],_0x5cdab7);_0x220500['on'](_0x56fd('0x11'),function(_0x4d7d1c){var _0x3133b2=new Buffer(_0x5830f1[_0x56fd('0x1a')](_0x4d7d1c),_0x56fd('0x14'));_0xc43891['write'](_0x3133b2);});_0x220500['on'](_0x56fd('0x12'),function(){try{var _0x3f08f3=new Buffer(_0x5830f1['final']('binary'),_0x56fd('0x14'));_0xc43891[_0x56fd('0x15')](_0x3f08f3);_0xc43891['end']();_0xc43891['on'](_0x56fd('0x16'),function(){return _0x265723(_0x34befd);});}catch(_0x3cd4d9){fs[_0x56fd('0x17')](_0x34befd);return _0xc93f3c(_0x3cd4d9);}});});};exports[_0x56fd('0x1b')]=function(_0x481b4e,_0x820418,_0x737fda){var _0x170608=_0x737fda||stringOptions['algorithm'];var _0x4c526a=_0x820418||stringOptions[_0x56fd('0x1c')];var _0x54d5f1=crypto[_0x56fd('0x1d')](_0x170608,_0x4c526a);var _0x133916=_0x54d5f1['update'](_0x481b4e,_0x56fd('0x1e'),_0x56fd('0x1f'));_0x133916+=_0x54d5f1['final']('base64');return _0x133916;};exports[_0x56fd('0x20')]=function(_0x1df99a,_0x26017a,_0x1f3fb2){var _0x1720c2=_0x1f3fb2||stringOptions[_0x56fd('0x7')];var _0x281c03=_0x26017a||stringOptions[_0x56fd('0x1c')];var _0x55a3a7=crypto['createDecipher'](_0x1720c2,_0x281c03);var _0x2f6017=_0x55a3a7[_0x56fd('0x1a')](_0x1df99a,_0x56fd('0x1f'),_0x56fd('0x1e'));_0x2f6017+=_0x55a3a7[_0x56fd('0x13')](_0x56fd('0x1e'));return _0x2f6017;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 40134eb..b41447d 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 _0xa6b2=['split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','isInteger','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','zip','zip\x20finished','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find'];(function(_0x446bc2,_0x3e65be){var _0x52b940=function(_0x1ee216){while(--_0x1ee216){_0x446bc2['push'](_0x446bc2['shift']());}};_0x52b940(++_0x3e65be);}(_0xa6b2,0x1eb));var _0x2a6b=function(_0x24f5ec,_0x34c588){_0x24f5ec=_0x24f5ec-0x0;var _0x366b7c=_0xa6b2[_0x24f5ec];return _0x366b7c;};'use strict';var util=require(_0x2a6b('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x2a6b('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2a6b('0x2'));var db=require(_0x2a6b('0x3'))['db'];var dbH=require(_0x2a6b('0x3'))[_0x2a6b('0x4')];var logger=require(_0x2a6b('0x5'))(_0x2a6b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x2a6b('0x7')][0x2]);var QUERY=process[_0x2a6b('0x7')][0x3];var PATH=process[_0x2a6b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xde9f7b,_0x17c967){var _0x1285cb={'status':_0xde9f7b};var _0x256a8a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17c967){_0x1285cb['savename']=_0x17c967;}return db[_0x2a6b('0x8')][_0x2a6b('0x9')](_0x1285cb,_0x256a8a);}function main(){var _0x2dcc0a=0x1388;var _0x21edc6;logger[_0x2a6b('0xa')](util[_0x2a6b('0xb')](_0x2a6b('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x2a6b('0xd')][_0x2a6b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2a6b('0xf'),'splitSizeCsv']})['then'](function(_0x4780de){if(_0x4780de){_0x21edc6=_0x4780de;_0x2dcc0a=_0x21edc6[_0x2a6b('0x10')]||0x1388;}})[_0x2a6b('0x11')](function(){return dbH['sequelize'][_0x2a6b('0x12')](util[_0x2a6b('0xb')](_0x2a6b('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x2a6b('0x14')]});})[_0x2a6b('0x11')](function(_0x12ed7d){if(!_0x12ed7d[0x0][_0x2a6b('0x15')]){return analyticExtractedReport(_0x2a6b('0x16'));}var _0x52aff7=[];var _0x442548=0x0;if(_0x21edc6['split']){if(_0x12ed7d&&_0x12ed7d[_0x2a6b('0x17')]){var _0x530f87=_['range'](_0x12ed7d[0x0]['num']/_0x2dcc0a);var _0x1bff81=Number[_0x2a6b('0x18')](_0x12ed7d[0x0]['num']/_0x2dcc0a)?_0x12ed7d[0x0][_0x2a6b('0x15')]%_0x2dcc0a:0x0;_0x530f87['forEach'](function(_0x13ab57){if(_0x13ab57>0x0){_0x442548+=_0x2dcc0a;}_0x52aff7[_0x2a6b('0x19')](dbH[_0x2a6b('0x1a')]['query'](util[_0x2a6b('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2dcc0a,_0x442548),{'type':dbH['sequelize']['QueryTypes'][_0x2a6b('0x14')]}));});if(_0x1bff81>0x0){_0x442548+=_0x2dcc0a;_0x52aff7[_0x2a6b('0x19')](dbH[_0x2a6b('0x1a')][_0x2a6b('0x12')](util['format'](_0x2a6b('0x1b'),QUERY,_0x1bff81,_0x442548),{'type':dbH[_0x2a6b('0x1a')][_0x2a6b('0x1c')][_0x2a6b('0x14')]}));}}}else{_0x52aff7[_0x2a6b('0x19')](dbH[_0x2a6b('0x1a')][_0x2a6b('0x12')](QUERY,{'type':dbH['sequelize'][_0x2a6b('0x1c')]['SELECT']}));}var _0x20fbaa=path[_0x2a6b('0x1d')](PATH);var _0x4e5683=path[_0x2a6b('0x1e')](PATH,_0x2a6b('0x1f'));var _0x3a8efa=_0x21edc6[_0x2a6b('0xf')]&&_0x52aff7['length']>0x1;var _0x1b6ecd=[];if(!fs[_0x2a6b('0x20')](path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683))&&_0x3a8efa){fs[_0x2a6b('0x22')](path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683));}return BPromise[_0x2a6b('0x23')](_0x52aff7,function(_0x55c02f){_0x1b6ecd['push'](_0x55c02f);})['then'](function(){for(var _0x4f32e0=0x0;_0x4f32e0<_0x1b6ecd[_0x2a6b('0x17')];_0x4f32e0+=0x1){var _0x35c7af;var _0x3f655c=_0x1b6ecd[_0x4f32e0];if(_0x3a8efa){_0x35c7af=path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683,util[_0x2a6b('0xb')](_0x2a6b('0x24'),_0x4e5683,_0x4f32e0,_0x2a6b('0x25')));}else{_0x35c7af=path['join'](_0x20fbaa,util[_0x2a6b('0xb')]('%s.%s',_0x4e5683,_0x2a6b('0x25')));}fs['writeFileSync'](_0x35c7af,csv(_0x3f655c));}})[_0x2a6b('0x11')](function(){if(_0x3a8efa){return new Promise(function(_0xfb0eb8){zipdir(path['join'](_0x20fbaa,_0x4e5683),{'saveTo':path['join'](_0x20fbaa,util[_0x2a6b('0xb')]('%s.%s',_0x4e5683,_0x2a6b('0x26')))},function(_0x597d67,_0x5ff74d){rimraf(path[_0x2a6b('0x21')](_0x20fbaa,_0x4e5683),function(){});_0xfb0eb8(_0x2a6b('0x27'));});});}})[_0x2a6b('0x11')](function(){logger[_0x2a6b('0xa')](util[_0x2a6b('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2a6b('0x28')));return analyticExtractedReport(_0x2a6b('0x29'),_0x3a8efa?util['format']('%s.%s',_0x4e5683,_0x3a8efa?_0x2a6b('0x26'):_0x2a6b('0x25')):null);});})[_0x2a6b('0x2a')](function(_0x4280f3){logger[_0x2a6b('0xa')](util[_0x2a6b('0xb')](_0x2a6b('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x4280f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2a6b('0x2c'));})['finally'](function(){process[_0x2a6b('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbb76=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','format','CSV','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','forEach'];(function(_0x576f97,_0x42fbbb){var _0x250e02=function(_0x3a4b01){while(--_0x3a4b01){_0x576f97['push'](_0x576f97['shift']());}};_0x250e02(++_0x42fbbb);}(_0xbb76,0x128));var _0x6bb7=function(_0x2ade6f,_0x18d576){_0x2ade6f=_0x2ade6f-0x0;var _0x28fa0f=_0xbb76[_0x2ade6f];return _0x28fa0f;};'use strict';var util=require(_0x6bb7('0x0'));var path=require('path');var _=require(_0x6bb7('0x1'));var csv=require(_0x6bb7('0x2'));var fs=require('fs');var BPromise=require(_0x6bb7('0x3'));var zipdir=require(_0x6bb7('0x4'));var rimraf=require('rimraf');var db=require(_0x6bb7('0x5'))['db'];var dbH=require('../../mysqldb')[_0x6bb7('0x6')];var logger=require(_0x6bb7('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6bb7('0x8')][0x2]);var QUERY=process[_0x6bb7('0x8')][0x3];var PATH=process[_0x6bb7('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c56ef,_0x4f7f98){var _0x15d6cb={'status':_0x4c56ef};var _0x458cde={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f7f98){_0x15d6cb['savename']=_0x4f7f98;}return db[_0x6bb7('0x9')]['update'](_0x15d6cb,_0x458cde);}function main(){var _0x39862a=0x1388;var _0x23f0bf;logger['info'](util[_0x6bb7('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6bb7('0xb')));return db[_0x6bb7('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6bb7('0xd'),_0x6bb7('0xe')]})[_0x6bb7('0xf')](function(_0x395f41){if(_0x395f41){_0x23f0bf=_0x395f41;_0x39862a=_0x23f0bf[_0x6bb7('0xe')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x6bb7('0x10')](util[_0x6bb7('0xa')](_0x6bb7('0x11'),QUERY),{'type':dbH[_0x6bb7('0x12')][_0x6bb7('0x13')][_0x6bb7('0x14')]});})['then'](function(_0x5b09e3){if(!_0x5b09e3[0x0][_0x6bb7('0x15')]){return analyticExtractedReport(_0x6bb7('0x16'));}var _0x3f217f=[];var _0x2f6a6b=0x0;if(_0x23f0bf[_0x6bb7('0xd')]){if(_0x5b09e3&&_0x5b09e3[_0x6bb7('0x17')]){var _0x2d6e1c=_[_0x6bb7('0x18')](_0x5b09e3[0x0][_0x6bb7('0x15')]/_0x39862a);var _0x50f458=Number['isInteger'](_0x5b09e3[0x0][_0x6bb7('0x15')]/_0x39862a)?_0x5b09e3[0x0][_0x6bb7('0x15')]%_0x39862a:0x0;_0x2d6e1c[_0x6bb7('0x19')](function(_0x16cdaf){if(_0x16cdaf>0x0){_0x2f6a6b+=_0x39862a;}_0x3f217f[_0x6bb7('0x1a')](dbH[_0x6bb7('0x12')]['query'](util[_0x6bb7('0xa')](_0x6bb7('0x1b'),QUERY,_0x39862a,_0x2f6a6b),{'type':dbH['sequelize'][_0x6bb7('0x13')][_0x6bb7('0x14')]}));});if(_0x50f458>0x0){_0x2f6a6b+=_0x39862a;_0x3f217f[_0x6bb7('0x1a')](dbH[_0x6bb7('0x12')][_0x6bb7('0x10')](util[_0x6bb7('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x50f458,_0x2f6a6b),{'type':dbH[_0x6bb7('0x12')]['QueryTypes'][_0x6bb7('0x14')]}));}}}else{_0x3f217f[_0x6bb7('0x1a')](dbH[_0x6bb7('0x12')][_0x6bb7('0x10')](QUERY,{'type':dbH[_0x6bb7('0x12')]['QueryTypes'][_0x6bb7('0x14')]}));}var _0x1e055f=path['dirname'](PATH);var _0x26d0bb=path[_0x6bb7('0x1c')](PATH,'.csv');var _0x89f80c=_0x23f0bf[_0x6bb7('0xd')]&&_0x3f217f[_0x6bb7('0x17')]>0x1;var _0x18175d=[];if(!fs[_0x6bb7('0x1d')](path[_0x6bb7('0x1e')](_0x1e055f,_0x26d0bb))&&_0x89f80c){fs[_0x6bb7('0x1f')](path[_0x6bb7('0x1e')](_0x1e055f,_0x26d0bb));}return BPromise[_0x6bb7('0x20')](_0x3f217f,function(_0x357cc7){_0x18175d[_0x6bb7('0x1a')](_0x357cc7);})[_0x6bb7('0xf')](function(){for(var _0x5bd0e7=0x0;_0x5bd0e7<_0x18175d['length'];_0x5bd0e7+=0x1){var _0x252495;var _0xcc35d4=_0x18175d[_0x5bd0e7];if(_0x89f80c){_0x252495=path['join'](_0x1e055f,_0x26d0bb,util['format'](_0x6bb7('0x21'),_0x26d0bb,_0x5bd0e7,_0x6bb7('0x22')));}else{_0x252495=path[_0x6bb7('0x1e')](_0x1e055f,util['format'](_0x6bb7('0x23'),_0x26d0bb,_0x6bb7('0x22')));}fs[_0x6bb7('0x24')](_0x252495,csv(_0xcc35d4));}})[_0x6bb7('0xf')](function(){if(_0x89f80c){return new Promise(function(_0x5b9451){zipdir(path[_0x6bb7('0x1e')](_0x1e055f,_0x26d0bb),{'saveTo':path[_0x6bb7('0x1e')](_0x1e055f,util['format'](_0x6bb7('0x23'),_0x26d0bb,_0x6bb7('0x25')))},function(_0x58b94b,_0x148f82){rimraf(path[_0x6bb7('0x1e')](_0x1e055f,_0x26d0bb),function(){});_0x5b9451(_0x6bb7('0x26'));});});}})[_0x6bb7('0xf')](function(){logger[_0x6bb7('0x27')](util[_0x6bb7('0xa')](_0x6bb7('0x28'),EXTRACTED_REPORT_ID,_0x6bb7('0xb')));return analyticExtractedReport(_0x6bb7('0x29'),_0x89f80c?util[_0x6bb7('0xa')](_0x6bb7('0x23'),_0x26d0bb,_0x89f80c?'zip':_0x6bb7('0x22')):null);});})['catch'](function(_0x4ccd7b){logger['info'](util['format'](_0x6bb7('0x2a'),EXTRACTED_REPORT_ID,_0x6bb7('0xb')),util[_0x6bb7('0x2b')](_0x4ccd7b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6bb7('0x2c'));})[_0x6bb7('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 1a8f39b..fea28a1 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 _0xf063=['inspect','finally','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','lodash','path','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','fill','length','auto','push','body','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','landscape','toString','\x20/\x20','Arial','black','right','Setting','find','split','splitSizePdf','then','range','num','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','each','pdf','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0xf063,0xc0));var _0x3f06=function(_0x40c9a5,_0x254d8d){_0x40c9a5=_0x40c9a5-0x0;var _0x48413e=_0xf063[_0x40c9a5];return _0x48413e;};'use strict';var _=require(_0x3f06('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x3f06('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x3f06('0x2'));var PdfPrinter=require(_0x3f06('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x3f06('0x4'));var JSDOM=require(_0x3f06('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x3f06('0x6'));var db=require(_0x3f06('0x7'))['db'];var dbH=require(_0x3f06('0x7'))[_0x3f06('0x8')];var logger=require(_0x3f06('0x9'))(_0x3f06('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x3f06('0xb')][0x2]);var QUERY=process[_0x3f06('0xb')][0x3];var PATH=process[_0x3f06('0xb')][0x4];var NAME=process[_0x3f06('0xb')][0x5];var FORMAT=_0x3f06('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xac12bc,_0x3a69d1){var _0x5d7643={'status':_0xac12bc};var _0x4aec21={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a69d1){_0x5d7643[_0x3f06('0xd')]=_0x3a69d1;}return db[_0x3f06('0xe')][_0x3f06('0xf')](_0x5d7643,_0x4aec21);}function getHeaders(_0x351cd6){return _['map'](_0x351cd6,function(_0x1f040d){return{'text':_0x1f040d,'style':'tableHeader'};});}function getRows(_0x416f96,_0x3618f4){return _[_0x3f06('0x10')](_0x3618f4,function(_0x22d603){return _(_0x22d603)[_0x3f06('0x11')](_0x416f96)[_0x3f06('0x10')](function(_0x4d1bec){return _0x4d1bec?_['toString'](_0x4d1bec):'';})['value']();});}function createTable(_0x3da4b5,_0x5b4c7b){var _0x5a9e7c={'widths':_[_0x3f06('0x12')](Array(_0x3da4b5[_0x3f06('0x13')]),0x91),'heights':function(_0x5a8b55){return _0x5a8b55===0x0?_0x3f06('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x300091=getHeaders(_0x3da4b5);_0x5a9e7c['body'][_0x3f06('0x15')](_0x300091);var _0x4e0941=getRows(_0x3da4b5,_0x5b4c7b);_0x5a9e7c['body']=_0x5a9e7c[_0x3f06('0x16')]['concat'](_0x4e0941);return _0x5a9e7c;}function createTables(_0x16edef){var _0x160b21=[];var _0x56de0b=_[_0x3f06('0x17')](Object[_0x3f06('0x18')](_0x16edef[0x0]),0x5);_0x56de0b[_0x3f06('0x19')](function(_0x1d9c11){_0x160b21[_0x3f06('0x15')](createTable(_0x1d9c11,_0x16edef));});return _0x160b21;}function getPDFDocDefinition(_0x11bf79){var _0x3d65af=util[_0x3f06('0x1a')](_0x3f06('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x3f06('0x1c')])[_0x3f06('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x3f06('0x1d')])[_0x3f06('0x1a')](FORMAT));var _0x3dcffb=[];for(var _0x1c03eb=0x0;_0x1c03eb<_0x11bf79[_0x3f06('0x13')];_0x1c03eb++){var _0x3fdba3=[];if(_0x1c03eb===0x0){_0x3fdba3[_0x3f06('0x15')]({'text':_0x3d65af,'style':_0x3f06('0x1e')});}var _0x55f3af={'table':_0x11bf79[_0x1c03eb]};if(_0x1c03eb>0x0){_0x55f3af[_0x3f06('0x1f')]=_0x3f06('0x20');_0x55f3af['margin']=[0x0,0x46,0x0,0x0];}_0x3fdba3['push'](_0x55f3af);_0x3dcffb[_0x3f06('0x15')](_0x3fdba3);}return{'pageSize':'A4','pageOrientation':_0x3f06('0x21'),'content':_0x3dcffb,'footer':function(_0xae6b01,_0x6a32ff){return{'text':_0xae6b01[_0x3f06('0x22')]()+_0x3f06('0x23')+_0x6a32ff,'style':'footer'};},'defaultStyle':{'font':_0x3f06('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3f06('0x25')},'footer':{'alignment':_0x3f06('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x464638){var _0x342905=0x1388;var _0xef1181;if(!_0x464638[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x3f06('0x27')][_0x3f06('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3f06('0x29'),_0x3f06('0x2a')]})[_0x3f06('0x2b')](function(_0x246d91){if(_0x246d91){_0xef1181=_0x246d91;_0x342905=_0xef1181[_0x3f06('0x2a')]||0x3e8;}})[_0x3f06('0x2b')](function(){var _0x587a60=[];var _0x5e68ca=0x0;if(_0xef1181[_0x3f06('0x29')]){if(_0x464638&&_0x464638[_0x3f06('0x13')]){var _0x19dcfd=_[_0x3f06('0x2c')](_0x464638[0x0][_0x3f06('0x2d')]/_0x342905);var _0x1f86b1=Number[_0x3f06('0x2e')](_0x464638[0x0][_0x3f06('0x2d')]/_0x342905)?_0x464638[0x0][_0x3f06('0x2d')]%_0x342905:0x0;_0x19dcfd[_0x3f06('0x19')](function(_0x31cdba){if(_0x31cdba>0x0){_0x5e68ca+=_0x342905;}_0x587a60['push'](dbH[_0x3f06('0x2f')]['query'](util[_0x3f06('0x1a')](_0x3f06('0x30'),QUERY,_0x342905,_0x5e68ca),{'type':dbH[_0x3f06('0x2f')]['QueryTypes'][_0x3f06('0x31')]}));});if(_0x1f86b1>0x0){_0x5e68ca+=_0x342905;_0x587a60[_0x3f06('0x15')](dbH['sequelize'][_0x3f06('0x32')](util['format'](_0x3f06('0x30'),QUERY,_0x1f86b1,_0x5e68ca),{'type':dbH[_0x3f06('0x2f')][_0x3f06('0x33')][_0x3f06('0x31')]}));}}}else{_0x587a60['push'](dbH['sequelize'][_0x3f06('0x32')](QUERY,{'type':dbH[_0x3f06('0x2f')]['QueryTypes'][_0x3f06('0x31')]}));}var _0x8b2a5=path[_0x3f06('0x34')](PATH);var _0x4f2f09=path[_0x3f06('0x35')](PATH,_0x3f06('0x36'));var _0x30accc=_0xef1181[_0x3f06('0x29')]&&_0x587a60[_0x3f06('0x13')]>0x1;var _0x418b03=[];if(!fs[_0x3f06('0x37')](path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09))&&_0x30accc){fs[_0x3f06('0x39')](path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09));}return BPromise[_0x3f06('0x3a')](_0x587a60,function(_0xad929d){_0x418b03['push'](_0xad929d);})[_0x3f06('0x2b')](function(){var _0x55bbff=[];for(var _0x45b4e4=0x0;_0x45b4e4<_0x418b03[_0x3f06('0x13')];_0x45b4e4+=0x1){var _0x3057fd=_0x418b03[_0x45b4e4];var _0x1f5917=createTables(_['flatten'](_0x3057fd));var _0xf6bbaf;var _0x31af3e=getPDFDocDefinition(_0x1f5917);var _0x3e78c3=getPDFPrinter();var _0x3ee48f=_0x3e78c3['createPdfKitDocument'](_0x31af3e);if(_0x30accc){_0xf6bbaf=path['join'](_0x8b2a5,_0x4f2f09,util[_0x3f06('0x1a')]('%s%d.%s',_0x4f2f09,_0x45b4e4,_0x3f06('0x3b')));}else{_0xf6bbaf=path[_0x3f06('0x38')](_0x8b2a5,util[_0x3f06('0x1a')](_0x3f06('0x3c'),_0x4f2f09,_0x3f06('0x3b')));}_0x55bbff['push'](writePDFDocument(_0x3ee48f,_0xf6bbaf));}return Promise['all'](_0x55bbff);})['then'](function(){if(_0x30accc){return new Promise(function(_0x2fab3b){zipdir(path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09),{'saveTo':path[_0x3f06('0x38')](_0x8b2a5,util[_0x3f06('0x1a')](_0x3f06('0x3c'),_0x4f2f09,'zip'))},function(){rimraf(path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09),function(){});_0x2fab3b('zip\x20finished');});});}})['then'](function(){if(!_0x30accc)return;rimraf(path[_0x3f06('0x38')](_0x8b2a5,_0x4f2f09),function(){});})[_0x3f06('0x2b')](function(){logger[_0x3f06('0x3d')](util[_0x3f06('0x1a')](_0x3f06('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x3f06('0x3f'),_0x30accc?util[_0x3f06('0x1a')](_0x3f06('0x3c'),_0x4f2f09,_0x30accc?_0x3f06('0x40'):_0x3f06('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3f06('0x3d')](util[_0x3f06('0x1a')](_0x3f06('0x41'),EXTRACTED_REPORT_ID,_0x3f06('0x42')));return db[_0x3f06('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3f06('0x2b')](function(_0x3e40d8){EXTRACTED_REPORT=_0x3e40d8;return dbH[_0x3f06('0x2f')]['query'](util[_0x3f06('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3f06('0x2f')][_0x3f06('0x33')][_0x3f06('0x31')]});})['then'](extractReport)[_0x3f06('0x43')](function(_0x4b0dc2){logger[_0x3f06('0x3d')](util['format'](_0x3f06('0x44'),EXTRACTED_REPORT_ID,_0x3f06('0x42')),util[_0x3f06('0x45')](_0x4b0dc2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x3f06('0x46')](function(){process[_0x3f06('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x760376=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x3f06('0x48'),'bolditalics':__dirname+_0x3f06('0x49')}});return _0x760376;}function getPDFDocDefinitionFromHTML(_0x1a228b,_0x519a48){var _0x5c1400=util['format'](_0x3f06('0x4a'),_0x519a48[_0x3f06('0x4b')],_0x519a48[_0x3f06('0x4c')]);var _0x410379=moment()[_0x3f06('0x1a')](_0x3f06('0x4d'))[_0x3f06('0x22')]();var _0x5d45fb=htmlToPdfmake(_0x1a228b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5d45fb],'defaultStyle':{'font':_0x3f06('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3f06('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x3f06('0x1e')}];},'footer':function(_0x85d95d,_0x53b668){return[{'text':util['format'](_0x3f06('0x4f'),_0x5c1400,_0x85d95d,_0x53b668,_0x410379),'style':_0x3f06('0x50')}];}};}function writePDFDocument(_0x548c38,_0x245eb4){return new Promise(function(_0x538001,_0x2a8b2d){var _0x3eedc8=_0x548c38[_0x3f06('0x51')](fs[_0x3f06('0x52')](_0x245eb4));_0x3eedc8['on'](_0x3f06('0x53'),function(){_0x538001('finish');});_0x3eedc8['on'](_0x3f06('0x54'),function(_0x1a1a05){_0x2a8b2d(_0x1a1a05);});_0x548c38['end']();});}exports[_0x3f06('0x55')]=function(_0x10481e,_0x282723){var _0x10dd27=getPDFPrinter();var _0x28e13b=getPDFDocDefinitionFromHTML(_0x10481e,_0x282723);var _0x184754=_0x10dd27[_0x3f06('0x56')](_0x28e13b);return writePDFDocument(_0x184754,_0x282723[_0x3f06('0x1')])[_0x3f06('0x43')](function(_0x327755){throw _0x327755;});}; \ No newline at end of file +var _0x0a3d=['finish','error','end','createPdfFromHTML','util','path','moment','pdfmake/src/printer','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','value','fill','length','body','push','concat','chunk','keys','forEach','format','startDate','endDate','pageBreak','before','toString','\x20/\x20','Arial','black','num','Setting','find','split','splitSizePdf','then','range','isInteger','query','sequelize','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x0a3d,0x109));var _0xd0a3=function(_0x2a38a6,_0x2f2da3){_0x2a38a6=_0x2a38a6-0x0;var _0x403457=_0x0a3d[_0x2a38a6];return _0x403457;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xd0a3('0x0'));var path=require(_0xd0a3('0x1'));var moment=require(_0xd0a3('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xd0a3('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xd0a3('0x4'));var JSDOM=require(_0xd0a3('0x5'))['JSDOM'];var window=new JSDOM('')[_0xd0a3('0x6')];var BPromise=require('bluebird');var db=require(_0xd0a3('0x7'))['db'];var dbH=require(_0xd0a3('0x7'))[_0xd0a3('0x8')];var logger=require(_0xd0a3('0x9'))(_0xd0a3('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xd0a3('0xb')][0x2]);var QUERY=process[_0xd0a3('0xb')][0x3];var PATH=process[_0xd0a3('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xd0a3('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4549df,_0x4c28f7){var _0x27b6db={'status':_0x4549df};var _0x4c575f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4c28f7){_0x27b6db[_0xd0a3('0xd')]=_0x4c28f7;}return db[_0xd0a3('0xe')]['update'](_0x27b6db,_0x4c575f);}function getHeaders(_0x5964d8){return _[_0xd0a3('0xf')](_0x5964d8,function(_0x167b16){return{'text':_0x167b16,'style':_0xd0a3('0x10')};});}function getRows(_0x21e961,_0x146d5d){return _['map'](_0x146d5d,function(_0x28afdc){return _(_0x28afdc)['pick'](_0x21e961)[_0xd0a3('0xf')](function(_0x749495){return _0x749495?_['toString'](_0x749495):'';})[_0xd0a3('0x11')]();});}function createTable(_0x5a185f,_0x2780d5){var _0x4024b8={'widths':_[_0xd0a3('0x12')](Array(_0x5a185f[_0xd0a3('0x13')]),0x91),'heights':function(_0x133b27){return _0x133b27===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4353f8=getHeaders(_0x5a185f);_0x4024b8[_0xd0a3('0x14')][_0xd0a3('0x15')](_0x4353f8);var _0x269d7d=getRows(_0x5a185f,_0x2780d5);_0x4024b8[_0xd0a3('0x14')]=_0x4024b8[_0xd0a3('0x14')][_0xd0a3('0x16')](_0x269d7d);return _0x4024b8;}function createTables(_0x1e19ff){var _0x2675d6=[];var _0x1d6925=_[_0xd0a3('0x17')](Object[_0xd0a3('0x18')](_0x1e19ff[0x0]),0x5);_0x1d6925[_0xd0a3('0x19')](function(_0x314409){_0x2675d6['push'](createTable(_0x314409,_0x1e19ff));});return _0x2675d6;}function getPDFDocDefinition(_0x745868){var _0x4fad9b=util[_0xd0a3('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xd0a3('0x1b')])[_0xd0a3('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xd0a3('0x1c')])['format'](FORMAT));var _0x30e408=[];for(var _0x506f36=0x0;_0x506f36<_0x745868['length'];_0x506f36++){var _0x4d8330=[];if(_0x506f36===0x0){_0x4d8330['push']({'text':_0x4fad9b,'style':'header'});}var _0x24a553={'table':_0x745868[_0x506f36]};if(_0x506f36>0x0){_0x24a553[_0xd0a3('0x1d')]=_0xd0a3('0x1e');_0x24a553['margin']=[0x0,0x46,0x0,0x0];}_0x4d8330['push'](_0x24a553);_0x30e408[_0xd0a3('0x15')](_0x4d8330);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x30e408,'footer':function(_0x10e013,_0x54765e){return{'text':_0x10e013[_0xd0a3('0x1f')]()+_0xd0a3('0x20')+_0x54765e,'style':'footer'};},'defaultStyle':{'font':_0xd0a3('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd0a3('0x22')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x429505){var _0x2ee699=0x1388;var _0x868da0;if(!_0x429505[0x0][_0xd0a3('0x23')]){return analyticExtractedReport('Empty');}return db[_0xd0a3('0x24')][_0xd0a3('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd0a3('0x26'),_0xd0a3('0x27')]})[_0xd0a3('0x28')](function(_0x1a5579){if(_0x1a5579){_0x868da0=_0x1a5579;_0x2ee699=_0x868da0[_0xd0a3('0x27')]||0x3e8;}})[_0xd0a3('0x28')](function(){var _0x2c2ab5=[];var _0x239b03=0x0;if(_0x868da0[_0xd0a3('0x26')]){if(_0x429505&&_0x429505[_0xd0a3('0x13')]){var _0x2592e1=_[_0xd0a3('0x29')](_0x429505[0x0][_0xd0a3('0x23')]/_0x2ee699);var _0x235139=Number[_0xd0a3('0x2a')](_0x429505[0x0][_0xd0a3('0x23')]/_0x2ee699)?_0x429505[0x0]['num']%_0x2ee699:0x0;_0x2592e1[_0xd0a3('0x19')](function(_0x124351){if(_0x124351>0x0){_0x239b03+=_0x2ee699;}_0x2c2ab5['push'](dbH['sequelize'][_0xd0a3('0x2b')](util[_0xd0a3('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2ee699,_0x239b03),{'type':dbH[_0xd0a3('0x2c')]['QueryTypes'][_0xd0a3('0x2d')]}));});if(_0x235139>0x0){_0x239b03+=_0x2ee699;_0x2c2ab5[_0xd0a3('0x15')](dbH['sequelize'][_0xd0a3('0x2b')](util[_0xd0a3('0x1a')](_0xd0a3('0x2e'),QUERY,_0x235139,_0x239b03),{'type':dbH[_0xd0a3('0x2c')][_0xd0a3('0x2f')]['SELECT']}));}}}else{_0x2c2ab5[_0xd0a3('0x15')](dbH[_0xd0a3('0x2c')]['query'](QUERY,{'type':dbH[_0xd0a3('0x2c')][_0xd0a3('0x2f')][_0xd0a3('0x2d')]}));}var _0x2f04ff=path['dirname'](PATH);var _0xa97491=path[_0xd0a3('0x30')](PATH,_0xd0a3('0x31'));var _0x383e73=_0x868da0[_0xd0a3('0x26')]&&_0x2c2ab5['length']>0x1;var _0x1ddfef=[];if(!fs[_0xd0a3('0x32')](path[_0xd0a3('0x33')](_0x2f04ff,_0xa97491))&&_0x383e73){fs[_0xd0a3('0x34')](path['join'](_0x2f04ff,_0xa97491));}return BPromise[_0xd0a3('0x35')](_0x2c2ab5,function(_0x2a2dda){_0x1ddfef[_0xd0a3('0x15')](_0x2a2dda);})[_0xd0a3('0x28')](function(){var _0x371ea2=[];for(var _0x53aaa1=0x0;_0x53aaa1<_0x1ddfef[_0xd0a3('0x13')];_0x53aaa1+=0x1){var _0x3e2da8=_0x1ddfef[_0x53aaa1];var _0x1dc220=createTables(_['flatten'](_0x3e2da8));var _0x37f2c4;var _0x5f49dc=getPDFDocDefinition(_0x1dc220);var _0x5797e6=getPDFPrinter();var _0x5015dd=_0x5797e6[_0xd0a3('0x36')](_0x5f49dc);if(_0x383e73){_0x37f2c4=path['join'](_0x2f04ff,_0xa97491,util[_0xd0a3('0x1a')](_0xd0a3('0x37'),_0xa97491,_0x53aaa1,_0xd0a3('0x38')));}else{_0x37f2c4=path['join'](_0x2f04ff,util[_0xd0a3('0x1a')](_0xd0a3('0x39'),_0xa97491,_0xd0a3('0x38')));}_0x371ea2[_0xd0a3('0x15')](writePDFDocument(_0x5015dd,_0x37f2c4));}return Promise[_0xd0a3('0x3a')](_0x371ea2);})[_0xd0a3('0x28')](function(){if(_0x383e73){return new Promise(function(_0x1d729a){zipdir(path[_0xd0a3('0x33')](_0x2f04ff,_0xa97491),{'saveTo':path[_0xd0a3('0x33')](_0x2f04ff,util[_0xd0a3('0x1a')](_0xd0a3('0x39'),_0xa97491,_0xd0a3('0x3b')))},function(){rimraf(path['join'](_0x2f04ff,_0xa97491),function(){});_0x1d729a(_0xd0a3('0x3c'));});});}})['then'](function(){if(!_0x383e73)return;rimraf(path[_0xd0a3('0x33')](_0x2f04ff,_0xa97491),function(){});})['then'](function(){logger[_0xd0a3('0x3d')](util[_0xd0a3('0x1a')](_0xd0a3('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xd0a3('0x3f'),_0x383e73?util[_0xd0a3('0x1a')](_0xd0a3('0x39'),_0xa97491,_0x383e73?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xd0a3('0x1a')](_0xd0a3('0x40'),EXTRACTED_REPORT_ID,_0xd0a3('0x41')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd0a3('0x28')](function(_0x89acb1){EXTRACTED_REPORT=_0x89acb1;return dbH[_0xd0a3('0x2c')]['query'](util[_0xd0a3('0x1a')](_0xd0a3('0x42'),QUERY),{'type':dbH[_0xd0a3('0x2c')][_0xd0a3('0x2f')][_0xd0a3('0x2d')]});})[_0xd0a3('0x28')](extractReport)[_0xd0a3('0x43')](function(_0x5f8592){logger[_0xd0a3('0x3d')](util[_0xd0a3('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd0a3('0x41')),util[_0xd0a3('0x44')](_0x5f8592,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd0a3('0x45'));})[_0xd0a3('0x46')](function(){process[_0xd0a3('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x354e96=new PdfPrinter({'Arial':{'normal':__dirname+_0xd0a3('0x48'),'bold':__dirname+_0xd0a3('0x49'),'italics':__dirname+_0xd0a3('0x4a'),'bolditalics':__dirname+_0xd0a3('0x4b')}});return _0x354e96;}function getPDFDocDefinitionFromHTML(_0x1881db,_0x21f5d4){var _0x297ce3=util['format']('%s\x20#%d',_0x21f5d4[_0xd0a3('0x4c')],_0x21f5d4[_0xd0a3('0x4d')]);var _0x1fd603=moment()['format'](_0xd0a3('0x4e'))['toString']();var _0x25735c=htmlToPdfmake(_0x1881db,{'window':window,'tableAutoSize':!![]});return{'content':[_0x25735c],'defaultStyle':{'font':_0xd0a3('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd0a3('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd0a3('0x4f')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x2541cc,_0x47ce00){return[{'text':util[_0xd0a3('0x1a')](_0xd0a3('0x50'),_0x297ce3,_0x2541cc,_0x47ce00,_0x1fd603),'style':'footer'}];}};}function writePDFDocument(_0x1cabd0,_0x4a6bdc){return new Promise(function(_0x403a7c,_0xf47985){var _0x513e96=_0x1cabd0[_0xd0a3('0x51')](fs[_0xd0a3('0x52')](_0x4a6bdc));_0x513e96['on'](_0xd0a3('0x53'),function(){_0x403a7c(_0xd0a3('0x53'));});_0x513e96['on'](_0xd0a3('0x54'),function(_0x541815){_0xf47985(_0x541815);});_0x1cabd0[_0xd0a3('0x55')]();});}exports[_0xd0a3('0x56')]=function(_0x105e74,_0x29d8dc){var _0x4572ee=getPDFPrinter();var _0xdf5d82=getPDFDocDefinitionFromHTML(_0x105e74,_0x29d8dc);var _0x4cf440=_0x4572ee[_0xd0a3('0x36')](_0xdf5d82);return writePDFDocument(_0x4cf440,_0x29d8dc['path'])['catch'](function(_0x2bce0d){throw _0x2bce0d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index bf7db81..2fcd372 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 _0x4809=['xlsx','%s.%s','binary','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','json2xls','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s'];(function(_0x5d439b,_0x20a697){var _0x3699d6=function(_0x1d683f){while(--_0x1d683f){_0x5d439b['push'](_0x5d439b['shift']());}};_0x3699d6(++_0x20a697);}(_0x4809,0x1e0));var _0x9480=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x4809[_0x57d13b];return _0x467696;};'use strict';var util=require(_0x9480('0x0'));var path=require(_0x9480('0x1'));var _=require(_0x9480('0x2'));var fs=require('fs');var json2xls=require(_0x9480('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x9480('0x4'));var db=require(_0x9480('0x5'))['db'];var dbH=require('../../mysqldb')[_0x9480('0x6')];var logger=require('../../config/logger')(_0x9480('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9480('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x184f72,_0x3820ef){var _0x208960={'status':_0x184f72};var _0x1db5d7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3820ef){_0x208960[_0x9480('0x9')]=_0x3820ef;}return db[_0x9480('0xa')][_0x9480('0xb')](_0x208960,_0x1db5d7);}function main(){var _0x5e7541=0x1388;var _0x37345b;logger['info'](util['format'](_0x9480('0xc'),EXTRACTED_REPORT_ID,_0x9480('0xd')));return db[_0x9480('0xe')][_0x9480('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9480('0x10'),'splitSizeXlsx']})[_0x9480('0x11')](function(_0x5717da){if(_0x5717da){_0x37345b=_0x5717da;_0x5e7541=_0x37345b[_0x9480('0x12')]||0x1388;}})[_0x9480('0x11')](function(){return dbH[_0x9480('0x13')]['query'](util[_0x9480('0x14')](_0x9480('0x15'),QUERY),{'type':dbH[_0x9480('0x13')][_0x9480('0x16')][_0x9480('0x17')]});})[_0x9480('0x11')](function(_0x45598a){if(!_0x45598a[0x0][_0x9480('0x18')]){return analyticExtractedReport(_0x9480('0x19'));}var _0xfbd0c4=[];var _0x28c6a2=0x0;if(_0x37345b[_0x9480('0x10')]){if(_0x45598a&&_0x45598a[_0x9480('0x1a')]){var _0x59fc88=_['range'](_0x45598a[0x0][_0x9480('0x18')]/_0x5e7541);var _0x40a6a9=Number[_0x9480('0x1b')](_0x45598a[0x0][_0x9480('0x18')]/_0x5e7541)?_0x45598a[0x0][_0x9480('0x18')]%_0x5e7541:0x0;_0x59fc88[_0x9480('0x1c')](function(_0x5026b9){if(_0x5026b9>0x0){_0x28c6a2+=_0x5e7541;}_0xfbd0c4[_0x9480('0x1d')](dbH[_0x9480('0x13')][_0x9480('0x1e')](util['format'](_0x9480('0x1f'),QUERY,_0x5e7541,_0x28c6a2),{'type':dbH[_0x9480('0x13')]['QueryTypes'][_0x9480('0x17')]}));});if(_0x40a6a9>0x0){_0x28c6a2+=_0x5e7541;_0xfbd0c4[_0x9480('0x1d')](dbH[_0x9480('0x13')][_0x9480('0x1e')](util[_0x9480('0x14')](_0x9480('0x1f'),QUERY,_0x40a6a9,_0x28c6a2),{'type':dbH['sequelize'][_0x9480('0x16')][_0x9480('0x17')]}));}}}else{_0xfbd0c4['push'](dbH[_0x9480('0x13')][_0x9480('0x1e')](QUERY,{'type':dbH[_0x9480('0x13')][_0x9480('0x16')][_0x9480('0x17')]}));}var _0xc5bc4=path[_0x9480('0x20')](PATH);var _0x4cd421=path[_0x9480('0x21')](PATH,_0x9480('0x22'));var _0x148321=_0x37345b[_0x9480('0x10')]&&_0xfbd0c4['length']>0x1;var _0x554f19=[];if(!fs[_0x9480('0x23')](path[_0x9480('0x24')](_0xc5bc4,_0x4cd421))&&_0x148321){fs[_0x9480('0x25')](path[_0x9480('0x24')](_0xc5bc4,_0x4cd421));}return BPromise[_0x9480('0x26')](_0xfbd0c4,function(_0x491b67){_0x554f19[_0x9480('0x1d')](_0x491b67);})[_0x9480('0x11')](function(){for(var _0x2d2ff8=0x0;_0x2d2ff8<_0x554f19[_0x9480('0x1a')];_0x2d2ff8+=0x1){var _0x5bf7f0;var _0x2bb43a=_0x554f19[_0x2d2ff8];if(_0x148321){_0x5bf7f0=path[_0x9480('0x24')](_0xc5bc4,_0x4cd421,util[_0x9480('0x14')](_0x9480('0x27'),_0x4cd421,_0x2d2ff8,_0x9480('0x28')));}else{_0x5bf7f0=path[_0x9480('0x24')](_0xc5bc4,util[_0x9480('0x14')](_0x9480('0x29'),_0x4cd421,_0x9480('0x28')));}fs['writeFileSync'](_0x5bf7f0,json2xls(_0x2bb43a),_0x9480('0x2a'));}})[_0x9480('0x11')](function(){if(_0x148321){return new Promise(function(_0x347935){zipdir(path[_0x9480('0x24')](_0xc5bc4,_0x4cd421),{'saveTo':path[_0x9480('0x24')](_0xc5bc4,util[_0x9480('0x14')](_0x9480('0x29'),_0x4cd421,'zip'))},function(_0x4314c6,_0x15bd5e){rimraf(path['join'](_0xc5bc4,_0x4cd421),function(){});_0x347935(_0x9480('0x2b'));});});}})['then'](function(){logger[_0x9480('0x2c')](util[_0x9480('0x14')](_0x9480('0x2d'),EXTRACTED_REPORT_ID,_0x9480('0xd')));return analyticExtractedReport(_0x9480('0x2e'),_0x148321?util[_0x9480('0x14')](_0x9480('0x29'),_0x4cd421,_0x148321?'zip':'xlsx'):null);});})[_0x9480('0x2f')](function(_0x3ae040){logger[_0x9480('0x2c')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9480('0xd')),util[_0x9480('0x30')](_0x3ae040,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9480('0x31'));})[_0x9480('0x32')](function(){process[_0x9480('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x991a=['XLSX','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','mkdirSync','each','join','%s%d.%s','xlsx','%s.%s','zip','zip\x20finished','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','Failed','exit','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x2d3d18,_0x475f4c){var _0x202f49=function(_0x41abb5){while(--_0x41abb5){_0x2d3d18['push'](_0x2d3d18['shift']());}};_0x202f49(++_0x475f4c);}(_0x991a,0x1ec));var _0xa991=function(_0x31d4dd,_0x4e605d){_0x31d4dd=_0x31d4dd-0x0;var _0x47b0d0=_0x991a[_0x31d4dd];return _0x47b0d0;};'use strict';var util=require(_0xa991('0x0'));var path=require(_0xa991('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xa991('0x2'));var BPromise=require(_0xa991('0x3'));var zipdir=require(_0xa991('0x4'));var rimraf=require(_0xa991('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa991('0x6'))['dbH'];var logger=require(_0xa991('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa991('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e17bc,_0x3e1972){var _0x13bd2a={'status':_0x2e17bc};var _0x23f20d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e1972){_0x13bd2a[_0xa991('0x9')]=_0x3e1972;}return db['AnalyticExtractedReport'][_0xa991('0xa')](_0x13bd2a,_0x23f20d);}function main(){var _0x4ba439=0x1388;var _0x5bc5a2;logger[_0xa991('0xb')](util[_0xa991('0xc')](_0xa991('0xd'),EXTRACTED_REPORT_ID,_0xa991('0xe')));return db['Setting'][_0xa991('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa991('0x10'),_0xa991('0x11')]})[_0xa991('0x12')](function(_0x42b503){if(_0x42b503){_0x5bc5a2=_0x42b503;_0x4ba439=_0x5bc5a2['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xa991('0x13')][_0xa991('0x14')](util[_0xa991('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa991('0x13')][_0xa991('0x15')]['SELECT']});})[_0xa991('0x12')](function(_0x1cd0c0){if(!_0x1cd0c0[0x0][_0xa991('0x16')]){return analyticExtractedReport(_0xa991('0x17'));}var _0x4335a7=[];var _0x387654=0x0;if(_0x5bc5a2['split']){if(_0x1cd0c0&&_0x1cd0c0[_0xa991('0x18')]){var _0xb78d61=_[_0xa991('0x19')](_0x1cd0c0[0x0][_0xa991('0x16')]/_0x4ba439);var _0x11c7a8=Number[_0xa991('0x1a')](_0x1cd0c0[0x0][_0xa991('0x16')]/_0x4ba439)?_0x1cd0c0[0x0][_0xa991('0x16')]%_0x4ba439:0x0;_0xb78d61[_0xa991('0x1b')](function(_0x4f9ec4){if(_0x4f9ec4>0x0){_0x387654+=_0x4ba439;}_0x4335a7[_0xa991('0x1c')](dbH[_0xa991('0x13')]['query'](util[_0xa991('0xc')](_0xa991('0x1d'),QUERY,_0x4ba439,_0x387654),{'type':dbH[_0xa991('0x13')]['QueryTypes'][_0xa991('0x1e')]}));});if(_0x11c7a8>0x0){_0x387654+=_0x4ba439;_0x4335a7[_0xa991('0x1c')](dbH['sequelize']['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x11c7a8,_0x387654),{'type':dbH['sequelize'][_0xa991('0x15')][_0xa991('0x1e')]}));}}}else{_0x4335a7['push'](dbH[_0xa991('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0xa991('0x15')]['SELECT']}));}var _0x5eec35=path['dirname'](PATH);var _0x2c75a2=path[_0xa991('0x1f')](PATH,'.xlsx');var _0x1e4acd=_0x5bc5a2[_0xa991('0x10')]&&_0x4335a7[_0xa991('0x18')]>0x1;var _0x452a91=[];if(!fs['existsSync'](path['join'](_0x5eec35,_0x2c75a2))&&_0x1e4acd){fs[_0xa991('0x20')](path['join'](_0x5eec35,_0x2c75a2));}return BPromise[_0xa991('0x21')](_0x4335a7,function(_0x25cf2e){_0x452a91[_0xa991('0x1c')](_0x25cf2e);})[_0xa991('0x12')](function(){for(var _0x7b445d=0x0;_0x7b445d<_0x452a91[_0xa991('0x18')];_0x7b445d+=0x1){var _0x35e52d;var _0x192bb7=_0x452a91[_0x7b445d];if(_0x1e4acd){_0x35e52d=path[_0xa991('0x22')](_0x5eec35,_0x2c75a2,util[_0xa991('0xc')](_0xa991('0x23'),_0x2c75a2,_0x7b445d,_0xa991('0x24')));}else{_0x35e52d=path[_0xa991('0x22')](_0x5eec35,util[_0xa991('0xc')]('%s.%s',_0x2c75a2,_0xa991('0x24')));}fs['writeFileSync'](_0x35e52d,json2xls(_0x192bb7),'binary');}})[_0xa991('0x12')](function(){if(_0x1e4acd){return new Promise(function(_0x54c6ef){zipdir(path[_0xa991('0x22')](_0x5eec35,_0x2c75a2),{'saveTo':path[_0xa991('0x22')](_0x5eec35,util[_0xa991('0xc')](_0xa991('0x25'),_0x2c75a2,_0xa991('0x26')))},function(_0x20da71,_0x4f56b6){rimraf(path[_0xa991('0x22')](_0x5eec35,_0x2c75a2),function(){});_0x54c6ef(_0xa991('0x27'));});});}})['then'](function(){logger['info'](util[_0xa991('0xc')](_0xa991('0x28'),EXTRACTED_REPORT_ID,_0xa991('0xe')));return analyticExtractedReport(_0xa991('0x29'),_0x1e4acd?util[_0xa991('0xc')](_0xa991('0x25'),_0x2c75a2,_0x1e4acd?_0xa991('0x26'):_0xa991('0x24')):null);});})[_0xa991('0x2a')](function(_0x1ad7d2){logger[_0xa991('0xb')](util['format'](_0xa991('0x2b'),EXTRACTED_REPORT_ID,_0xa991('0xe')),util['inspect'](_0x1ad7d2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa991('0x2c'));})['finally'](function(){process[_0xa991('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 340a540..a8c1bbe 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 _0x3471=['map','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','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','util','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','extensions','extension','find','Set','type','context','priority','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3471,0x135));var _0x1347=function(_0x5bd1dd,_0x3c4e21){_0x5bd1dd=_0x5bd1dd-0x0;var _0x5387cd=_0x3471[_0x5bd1dd];return _0x5387cd;};'use strict';var _=require('lodash');var util=require(_0x1347('0x0'));function rewrite(_0x1a28c6,_0x19119c){var _0x7400f1=this;return _0x1a28c6[_0x1347('0x1')][_0x1347('0x2')]['findAll']({'raw':!![]})[_0x1347('0x3')](function(_0x5ef6a3){_0x7400f1[_0x1347('0x4')]=_0x5ef6a3;return _0x1a28c6[_0x1347('0x1')][_0x1347('0x5')][_0x1347('0x6')]({'where':{'IntervalId':_0x19119c[_0x1347('0x7')]},'raw':!![]});})[_0x1347('0x3')](function(_0x1aabb1){return _0x1a28c6['models']['VoiceExtension'][_0x1347('0x6')]({'where':{'exten':{'$in':_[_0x1347('0x8')](_['map'](_0x1aabb1,_0x1347('0x9')))}},'order':[{'raw':_0x1347('0xa')}],'raw':!![]});})['then'](function(_0x38cc58){var _0x2b1457=_['filter'](_0x38cc58,{'priority':'1'});var _0x21c74f=_[_0x1347('0xb')](_0x38cc58,{'isApp':0x1});var _0x130369=_[_0x1347('0xc')](_0x21c74f,_0x1347('0x9'));var _0x5c2bfb=[_0x1347('0xd'),'playback'];var _0x19b8d1=[];var _0x3905d0=[];for(var _0x55af3f in _0x130369){if(_0x130369[_0x1347('0xe')](_0x55af3f)){_0x7400f1['priority']=0x2;_0x7400f1[_0x1347('0xf')]=[];_0x7400f1[_0x1347('0x10')]=_[_0x1347('0x11')](_0x2b1457,{'exten':_0x130369[_0x55af3f][0x0]['exten']});_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0]['type'],'app':_0x1347('0x12'),'appdata':util['format']('CDR(type)=%s',_0x130369[_0x55af3f][0x0][_0x1347('0x13')]),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0]['exten'],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});if(_0x130369[_0x55af3f][0x0][_0x1347('0x13')]===_0x1347('0x17')){_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'Set','appdata':_0x1347('0x19')+_0x130369[_0x55af3f][0x0][_0x1347('0x16')],'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});}else if(_0x130369[_0x55af3f][0x0][_0x1347('0x13')]===_0x1347('0x1a')){if(_0x7400f1['extension']){_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0]['type'],'app':_0x1347('0x12'),'appdata':_0x1347('0x1b')+(_0x7400f1[_0x1347('0x10')][_0x1347('0x1c')]?'${EXTEN:'+_0x7400f1[_0x1347('0x10')]['cutdigits']+'}':_0x1347('0x1d')),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});}_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'Set','appdata':_0x1347('0x19')+_0x130369[_0x55af3f][0x0][_0x1347('0x16')],'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});var _0x5eacd0=_0x7400f1[_0x1347('0x15')]++;_0x7400f1['extensions']['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'ExecIf','appdata':_0x1347('0x1e')+(_0x5eacd0+0x2)+_0x1347('0x1f')+(_0x5eacd0+0x1)+')','context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x5eacd0,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});if(_0x7400f1['extension']){_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x7400f1[_0x1347('0x10')][_0x1347('0x1c')]?_0x1347('0x20')+_0x7400f1[_0x1347('0x10')][_0x1347('0x1c')]+'}':_0x1347('0x21'),'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});}_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'outboundrouteid='+_0x130369[_0x55af3f][0x0][_0x1347('0x16')],'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});if(_0x7400f1[_0x1347('0x10')]&&_0x7400f1[_0x1347('0x10')][_0x1347('0xe')](_0x1347('0x22'))&&_0x7400f1[_0x1347('0x10')][_0x1347('0x22')]!==_0x1347('0x23')){_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x24'),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x7400f1[_0x1347('0x10')][_0x1347('0x22')]||_0x1347('0x25'),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});}}_0x7400f1['extensions']['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x26'),'context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0]['exten'],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0]['VoiceExtensionId']});_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0]['type'],'app':_0x1347('0x12'),'appdata':_0x1347('0x27'),'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'exten':_0x130369[_0x55af3f][0x0]['exten'],'priority':_0x7400f1[_0x1347('0x15')]++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});_0x7400f1[_0x1347('0xf')][_0x1347('0x18')]({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x130369[_0x55af3f][0x0]['context'],'exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'priority':_0x7400f1['priority']++,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});for(var _0x21a9da=0x0,_0x8d4b2d=0x0;_0x21a9da<_0x130369[_0x55af3f][_0x1347('0x28')];_0x21a9da+=0x1,_0x8d4b2d=0x0){var _0x5c2862=_0x130369[_0x55af3f][_0x21a9da];if(_0x5c2862[_0x1347('0x13')]){_0x5c2862[_0x1347('0x13')]=_0x5c2862[_0x1347('0x13')][_0x1347('0x29')]();}var _0x25ad33=[];var _0x972936=[];delete _0x5c2862['id'];delete _0x5c2862[_0x1347('0x2a')];delete _0x5c2862[_0x1347('0x2b')];var _0x2a3c4c=_0x5c2862[_0x1347('0x2c')]!==_0x1347('0x2d')?[_0x5c2862[_0x1347('0x2c')]]:_0x5c2862[_0x1347('0x7')]?_[_0x1347('0x2e')](_[_0x1347('0xb')](_0x7400f1['intervals'],{'IntervalId':_0x5c2862[_0x1347('0x7')]}),_0x1347('0x2c')):[];if(_0x5c2862[_0x1347('0xe')]('tag')){if(_0x5c2862[_0x1347('0x2f')]&&_0x5c2862[_0x1347('0x2f')]!=='--'){_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x30')+_0x5c2862['tag'],'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862['exten'],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1['priority']+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}}if(_0x5c2862['type']==='outbound'&&_0x5c2862[_0x1347('0xe')](_0x1347('0x31'))){if(_0x5c2862[_0x1347('0x31')]){_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x32'),'appdata':_0x1347('0x33')+_0x5c2862[_0x1347('0x31')]+')','context':_0x5c2862['context'],'exten':_0x5c2862['exten'],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1['priority']+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}else{_0x25ad33['push']({'type':_0x5c2862['type'],'app':_0x1347('0x32'),'appdata':_0x1347('0x34'),'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862['VoiceExtensionId']});}}if(_0x5c2862['hasOwnProperty'](_0x1347('0x35'))){if(_0x5c2bfb[_0x1347('0x36')](_0x5c2862[_0x1347('0x37')][_0x1347('0x29')]())>=0x0&&_0x5c2862[_0x1347('0x38')]!=='custom'){if(_0x5c2862[_0x1347('0x35')]){_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x32'),'appdata':_0x1347('0x39'),'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1['priority']+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}else{_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862['type'],'app':'ExecIf','appdata':_0x1347('0x3a'),'context':_0x5c2862[_0x1347('0x14')],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});_0x25ad33[_0x1347('0x18')]({'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x12'),'appdata':_0x1347('0x3b'),'context':_0x5c2862['context'],'exten':_0x5c2862[_0x1347('0x9')],'priority':_0x2a3c4c[_0x1347('0x28')]+_0x7400f1[_0x1347('0x15')]+_0x8d4b2d++,'VoiceExtensionId':_0x5c2862[_0x1347('0x16')]});}}}for(var _0x4daa77=0x0;_0x4daa77<_0x2a3c4c[_0x1347('0x28')];_0x4daa77+=0x1){var _0x462e79=_0x7400f1['priority']+_0x2a3c4c[_0x1347('0x28')];var _0x138d05=_0x4daa77===_0x2a3c4c['length']-0x1?_0x7400f1[_0x1347('0x15')]+_0x25ad33['length']+_0x972936[_0x1347('0x28')]+0x2:_0x7400f1[_0x1347('0x15')]+_0x4daa77+0x1;_0x25ad33[_0x1347('0x3c')](_0x4daa77,0x0,{'type':_0x5c2862[_0x1347('0x13')],'app':_0x1347('0x3d'),'appdata':_0x2a3c4c[_0x4daa77]+'?'+_0x5c2862[_0x1347('0x14')]+_0x1347('0x3e')+_0x462e79+':'+_0x5c2862[_0x1347('0x14')]+',${EXTEN},'+_0x138d05,'exten':_0x5c2862['exten'],'context':_0x5c2862['context'],'priority':_0x7400f1[_0x1347('0x15')]+_0x4daa77,'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});}_0x5c2862[_0x1347('0x15')]=_0x25ad33[_0x1347('0x28')]?_[_0x1347('0x3f')](_0x25ad33)[_0x1347('0x15')]+0x1:_0x7400f1[_0x1347('0x15')];_0x7400f1['priority']=(_0x972936[_0x1347('0x28')]?_['last'](_0x972936)[_0x1347('0x15')]:_0x5c2862[_0x1347('0x15')])+0x1;_0x7400f1[_0x1347('0xf')]=_[_0x1347('0x40')](_0x7400f1['extensions'],_0x25ad33,[_0x5c2862],_0x972936);}_0x7400f1[_0x1347('0xf')]['push']({'type':_0x130369[_0x55af3f][0x0][_0x1347('0x13')],'app':'Hangup','exten':_0x130369[_0x55af3f][0x0][_0x1347('0x9')],'context':_0x130369[_0x55af3f][0x0][_0x1347('0x14')],'priority':_0x7400f1['priority'],'VoiceExtensionId':_0x130369[_0x55af3f][0x0][_0x1347('0x16')]});_0x19b8d1[_0x1347('0x18')](_0x130369[_0x55af3f][0x0][_0x1347('0x16')]);_0x3905d0=_['concat'](_0x3905d0,_0x7400f1['extensions']);}}return _0x1a28c6[_0x1347('0x41')](function(_0x80d198){return _0x1a28c6[_0x1347('0x1')][_0x1347('0x5')][_0x1347('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x19b8d1}},'transaction':_0x80d198})[_0x1347('0x3')](function(_0x33cb64){return _0x1a28c6[_0x1347('0x1')][_0x1347('0x5')][_0x1347('0x43')](_[_0x1347('0x44')](_0x3905d0,_0x1347('0x15')),{'transaction':_0x80d198});});});})[_0x1347('0x45')](function(_0x862666){console[_0x1347('0x46')](_0x862666);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xaa68=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','updatedAt','*,*,*,*','interval','IntervalId','tag','CDR(tag)=','length','callerID'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xaa68,0x9f));var _0x8aa6=function(_0x340b09,_0x28b657){_0x340b09=_0x340b09-0x0;var _0x1f1b97=_0xaa68[_0x340b09];return _0x1f1b97;};'use strict';var _=require(_0x8aa6('0x0'));var util=require(_0x8aa6('0x1'));function rewrite(_0x4296d4,_0x5a8cc5){var _0x2083c6=this;return _0x4296d4[_0x8aa6('0x2')][_0x8aa6('0x3')][_0x8aa6('0x4')]({'raw':!![]})[_0x8aa6('0x5')](function(_0x493428){_0x2083c6['intervals']=_0x493428;return _0x4296d4[_0x8aa6('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x5a8cc5['IntervalId']},'raw':!![]});})[_0x8aa6('0x5')](function(_0x33f044){return _0x4296d4[_0x8aa6('0x2')][_0x8aa6('0x6')][_0x8aa6('0x4')]({'where':{'exten':{'$in':_[_0x8aa6('0x7')](_[_0x8aa6('0x8')](_0x33f044,_0x8aa6('0x9')))}},'order':[{'raw':_0x8aa6('0xa')}],'raw':!![]});})['then'](function(_0xab17ab){var _0x2b9479=_['filter'](_0xab17ab,{'priority':'1'});var _0x53f2ef=_[_0x8aa6('0xb')](_0xab17ab,{'isApp':0x1});var _0x22a87d=_[_0x8aa6('0xc')](_0x53f2ef,_0x8aa6('0x9'));var _0x4e10b3=['queue',_0x8aa6('0xd')];var _0x28e48f=[];var _0x334e0f=[];for(var _0x5696fa in _0x22a87d){if(_0x22a87d[_0x8aa6('0xe')](_0x5696fa)){_0x2083c6[_0x8aa6('0xf')]=0x2;_0x2083c6[_0x8aa6('0x10')]=[];_0x2083c6[_0x8aa6('0x11')]=_[_0x8aa6('0x12')](_0x2b9479,{'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')]});_0x2083c6[_0x8aa6('0x10')][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0]['type'],'app':_0x8aa6('0x14'),'appdata':util[_0x8aa6('0x15')](_0x8aa6('0x16'),_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')]),'context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});if(_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')]==='inbound'){_0x2083c6[_0x8aa6('0x10')][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x1a')+_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')],'context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});}else if(_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')]===_0x8aa6('0x1b')){if(_0x2083c6[_0x8aa6('0x11')]){_0x2083c6[_0x8aa6('0x10')][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':'CDR(destination)='+(_0x2083c6[_0x8aa6('0x11')][_0x8aa6('0x1c')]?_0x8aa6('0x1d')+_0x2083c6[_0x8aa6('0x11')][_0x8aa6('0x1c')]+'}':_0x8aa6('0x1e')),'context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});}_0x2083c6[_0x8aa6('0x10')]['push']({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x1a')+_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')],'context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6['priority']++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});var _0x5856ae=_0x2083c6['priority']++;_0x2083c6[_0x8aa6('0x10')][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x1f'),'appdata':_0x8aa6('0x20')+(_0x5856ae+0x2)+_0x8aa6('0x21')+(_0x5856ae+0x1)+')','context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x5856ae,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0]['VoiceExtensionId']});if(_0x2083c6[_0x8aa6('0x11')]){_0x2083c6[_0x8aa6('0x10')][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':'Set','appdata':_0x2083c6['extension'][_0x8aa6('0x1c')]?_0x8aa6('0x22')+_0x2083c6['extension']['cutdigits']+'}':_0x8aa6('0x23'),'context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0]['exten'],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});}_0x2083c6[_0x8aa6('0x10')]['push']({'type':_0x22a87d[_0x5696fa][0x0]['type'],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x24')+_0x22a87d[_0x5696fa][0x0]['VoiceExtensionId'],'context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0]['exten'],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});if(_0x2083c6[_0x8aa6('0x11')]&&_0x2083c6[_0x8aa6('0x11')][_0x8aa6('0xe')](_0x8aa6('0x25'))&&_0x2083c6[_0x8aa6('0x11')][_0x8aa6('0x25')]!==_0x8aa6('0x26')){_0x2083c6[_0x8aa6('0x10')]['push']({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x27'),'context':_0x22a87d[_0x5696fa][0x0]['context'],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});_0x2083c6['extensions']['push']({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x28')+_0x2083c6[_0x8aa6('0x11')][_0x8aa6('0x25')]||'wav','context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});}}_0x2083c6['extensions'][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x29'),'context':_0x22a87d[_0x5696fa][0x0]['context'],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});_0x2083c6['extensions'][_0x8aa6('0x13')]({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x2a'),'context':_0x22a87d[_0x5696fa][0x0]['context'],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});_0x2083c6[_0x8aa6('0x10')]['push']({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x18')],'exten':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x9')],'priority':_0x2083c6[_0x8aa6('0xf')]++,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});for(var _0x32f0dd=0x0,_0x2a51fe=0x0;_0x32f0dd<_0x22a87d[_0x5696fa]['length'];_0x32f0dd+=0x1,_0x2a51fe=0x0){var _0x567275=_0x22a87d[_0x5696fa][_0x32f0dd];if(_0x567275[_0x8aa6('0x17')]){_0x567275['type']=_0x567275[_0x8aa6('0x17')]['toLowerCase']();}var _0x38becc=[];var _0x477057=[];delete _0x567275['id'];delete _0x567275['createdAt'];delete _0x567275[_0x8aa6('0x2b')];var _0x43de24=_0x567275['interval']!==_0x8aa6('0x2c')?[_0x567275[_0x8aa6('0x2d')]]:_0x567275[_0x8aa6('0x2e')]?_[_0x8aa6('0x8')](_['filter'](_0x2083c6['intervals'],{'IntervalId':_0x567275['IntervalId']}),_0x8aa6('0x2d')):[];if(_0x567275[_0x8aa6('0xe')](_0x8aa6('0x2f'))){if(_0x567275[_0x8aa6('0x2f')]&&_0x567275[_0x8aa6('0x2f')]!=='--'){_0x38becc[_0x8aa6('0x13')]({'type':_0x567275['type'],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x30')+_0x567275[_0x8aa6('0x2f')],'context':_0x567275[_0x8aa6('0x18')],'exten':_0x567275['exten'],'priority':_0x43de24[_0x8aa6('0x31')]+_0x2083c6[_0x8aa6('0xf')]+_0x2a51fe++,'VoiceExtensionId':_0x567275['VoiceExtensionId']});}}if(_0x567275[_0x8aa6('0x17')]==='outbound'&&_0x567275['hasOwnProperty'](_0x8aa6('0x32'))){if(_0x567275[_0x8aa6('0x32')]){_0x38becc[_0x8aa6('0x13')]({'type':_0x567275[_0x8aa6('0x17')],'app':_0x8aa6('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x567275['callerID']+')','context':_0x567275[_0x8aa6('0x18')],'exten':_0x567275['exten'],'priority':_0x43de24['length']+_0x2083c6[_0x8aa6('0xf')]+_0x2a51fe++,'VoiceExtensionId':_0x567275['VoiceExtensionId']});}else{_0x38becc[_0x8aa6('0x13')]({'type':_0x567275['type'],'app':_0x8aa6('0x1f'),'appdata':_0x8aa6('0x33'),'context':_0x567275[_0x8aa6('0x18')],'exten':_0x567275[_0x8aa6('0x9')],'priority':_0x43de24[_0x8aa6('0x31')]+_0x2083c6[_0x8aa6('0xf')]+_0x2a51fe++,'VoiceExtensionId':_0x567275[_0x8aa6('0x19')]});}}if(_0x567275[_0x8aa6('0xe')](_0x8aa6('0x34'))){if(_0x4e10b3[_0x8aa6('0x35')](_0x567275[_0x8aa6('0x36')][_0x8aa6('0x37')]())>=0x0&&_0x567275['appType']!==_0x8aa6('0x38')){if(_0x567275['answer']){_0x38becc[_0x8aa6('0x13')]({'type':_0x567275[_0x8aa6('0x17')],'app':_0x8aa6('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x567275[_0x8aa6('0x18')],'exten':_0x567275[_0x8aa6('0x9')],'priority':_0x43de24[_0x8aa6('0x31')]+_0x2083c6[_0x8aa6('0xf')]+_0x2a51fe++,'VoiceExtensionId':_0x567275[_0x8aa6('0x19')]});_0x38becc['push']({'type':_0x567275['type'],'app':_0x8aa6('0x14'),'appdata':_0x8aa6('0x39'),'context':_0x567275[_0x8aa6('0x18')],'exten':_0x567275['exten'],'priority':_0x43de24[_0x8aa6('0x31')]+_0x2083c6['priority']+_0x2a51fe++,'VoiceExtensionId':_0x567275[_0x8aa6('0x19')]});}else{_0x38becc[_0x8aa6('0x13')]({'type':_0x567275[_0x8aa6('0x17')],'app':_0x8aa6('0x1f'),'appdata':_0x8aa6('0x3a'),'context':_0x567275[_0x8aa6('0x18')],'exten':_0x567275[_0x8aa6('0x9')],'priority':_0x43de24[_0x8aa6('0x31')]+_0x2083c6['priority']+_0x2a51fe++,'VoiceExtensionId':_0x567275['VoiceExtensionId']});_0x38becc[_0x8aa6('0x13')]({'type':_0x567275[_0x8aa6('0x17')],'app':'Set','appdata':_0x8aa6('0x3b'),'context':_0x567275['context'],'exten':_0x567275[_0x8aa6('0x9')],'priority':_0x43de24['length']+_0x2083c6[_0x8aa6('0xf')]+_0x2a51fe++,'VoiceExtensionId':_0x567275[_0x8aa6('0x19')]});}}}for(var _0x2bb208=0x0;_0x2bb208<_0x43de24[_0x8aa6('0x31')];_0x2bb208+=0x1){var _0x57fd6d=_0x2083c6[_0x8aa6('0xf')]+_0x43de24['length'];var _0xa9c243=_0x2bb208===_0x43de24[_0x8aa6('0x31')]-0x1?_0x2083c6['priority']+_0x38becc[_0x8aa6('0x31')]+_0x477057[_0x8aa6('0x31')]+0x2:_0x2083c6[_0x8aa6('0xf')]+_0x2bb208+0x1;_0x38becc[_0x8aa6('0x3c')](_0x2bb208,0x0,{'type':_0x567275[_0x8aa6('0x17')],'app':_0x8aa6('0x3d'),'appdata':_0x43de24[_0x2bb208]+'?'+_0x567275[_0x8aa6('0x18')]+_0x8aa6('0x3e')+_0x57fd6d+':'+_0x567275[_0x8aa6('0x18')]+_0x8aa6('0x3e')+_0xa9c243,'exten':_0x567275[_0x8aa6('0x9')],'context':_0x567275['context'],'priority':_0x2083c6[_0x8aa6('0xf')]+_0x2bb208,'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});}_0x567275['priority']=_0x38becc[_0x8aa6('0x31')]?_['last'](_0x38becc)[_0x8aa6('0xf')]+0x1:_0x2083c6['priority'];_0x2083c6[_0x8aa6('0xf')]=(_0x477057[_0x8aa6('0x31')]?_[_0x8aa6('0x3f')](_0x477057)[_0x8aa6('0xf')]:_0x567275[_0x8aa6('0xf')])+0x1;_0x2083c6['extensions']=_[_0x8aa6('0x40')](_0x2083c6['extensions'],_0x38becc,[_0x567275],_0x477057);}_0x2083c6['extensions']['push']({'type':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x17')],'app':_0x8aa6('0x41'),'exten':_0x22a87d[_0x5696fa][0x0]['exten'],'context':_0x22a87d[_0x5696fa][0x0]['context'],'priority':_0x2083c6[_0x8aa6('0xf')],'VoiceExtensionId':_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]});_0x28e48f[_0x8aa6('0x13')](_0x22a87d[_0x5696fa][0x0][_0x8aa6('0x19')]);_0x334e0f=_[_0x8aa6('0x40')](_0x334e0f,_0x2083c6[_0x8aa6('0x10')]);}}return _0x4296d4[_0x8aa6('0x42')](function(_0x12ba93){return _0x4296d4[_0x8aa6('0x2')][_0x8aa6('0x6')][_0x8aa6('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x28e48f}},'transaction':_0x12ba93})[_0x8aa6('0x5')](function(_0x2f596e){return _0x4296d4[_0x8aa6('0x2')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x334e0f,_0x8aa6('0xf')),{'transaction':_0x12ba93});});});})[_0x8aa6('0x44')](function(_0x49bb62){console['error'](_0x49bb62);});}exports[_0x8aa6('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index b546c68..7fc229b 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 _0xe1d5=['cm_hopper_black','VoiceQueue','CmList','Lists','then','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','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','join','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','into','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str'];(function(_0x16f474,_0x412a0c){var _0x2fb547=function(_0x231dd3){while(--_0x231dd3){_0x16f474['push'](_0x16f474['shift']());}};_0x2fb547(++_0x412a0c);}(_0xe1d5,0x91));var _0x5e1d=function(_0x40083e,_0x5c30d3){_0x40083e=_0x40083e-0x0;var _0x620390=_0xe1d5[_0x40083e];return _0x620390;};'use strict';var BPromise=require('bluebird');var util=require(_0x5e1d('0x0'));var _=require(_0x5e1d('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x5e1d('0x2'));var Redis=require(_0x5e1d('0x3'));var db=require(_0x5e1d('0x4'))['db'];var config=require(_0x5e1d('0x5'));var logger=require(_0x5e1d('0x6'))(_0x5e1d('0x7'));config[_0x5e1d('0x8')]=_[_0x5e1d('0x9')](config[_0x5e1d('0x8')],{'host':_0x5e1d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e1d('0x8')]));require(_0x5e1d('0xb'))[_0x5e1d('0xc')](socket);try{if(!process[_0x5e1d('0xd')][0x2]||process[_0x5e1d('0xd')][0x2]===_0x5e1d('0xe')||process[_0x5e1d('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x5e1d('0xd')][0x2];if(!process[_0x5e1d('0xd')][0x3]||process[_0x5e1d('0xd')][0x3]===_0x5e1d('0xe')||process[_0x5e1d('0xd')][0x3]===_0x5e1d('0xf')||!process[_0x5e1d('0xd')][0x4]||process[_0x5e1d('0xd')][0x4]==='undefined'||process[_0x5e1d('0xd')][0x4]===_0x5e1d('0xf')){throw new Error(_0x5e1d('0x10'));}var FIELDS=_[_0x5e1d('0x11')](process[_0x5e1d('0xd')][0x3]['split'](','),process[_0x5e1d('0xd')][0x4][_0x5e1d('0x12')](','));if(!process[_0x5e1d('0xd')][0x5]||process['argv'][0x5]==='undefined'||process[_0x5e1d('0xd')][0x5]===_0x5e1d('0xf')){throw new Error(_0x5e1d('0x13'));}var LISTID=process[_0x5e1d('0xd')][0x5];var COMPANYID=process[_0x5e1d('0xd')][0x6]&&process[_0x5e1d('0xd')][0x6]!==_0x5e1d('0xe')&&process[_0x5e1d('0xd')][0x6]!==_0x5e1d('0xf')?process[_0x5e1d('0xd')][0x6]:null;var DUPLICATES=process[_0x5e1d('0xd')][0x7]&&process[_0x5e1d('0xd')][0x7]!==_0x5e1d('0xe')&&process[_0x5e1d('0xd')][0x7]!==_0x5e1d('0xf')?process[_0x5e1d('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x5e1d('0xd')][0x8]===_0x5e1d('0xe')||process[_0x5e1d('0xd')][0x8]===_0x5e1d('0xf')){throw new Error(_0x5e1d('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xd8011f){logger[_0x5e1d('0x15')](_0xd8011f);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(_0x472922,_0x1f161d,_0x6d7cef,_0x13d151){var _0x162780={'message':_0x1f161d};_0x162780[_0x472922]=!![];if(_0x6d7cef){_0x162780[_0x5e1d('0x16')]=_0x6d7cef;}if(_0x13d151){_0x162780[_0x5e1d('0x17')]=_0x13d151;}return _0x162780;}function isEmail(_0x5d2456){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'](_0x5d2456);}function checkRow(_0xd70130,_0x2223d9,_0x51bbc9){return new BPromise(function(_0x1a3960,_0x3ce867){if(_[_0x5e1d('0x18')](_0xd70130)){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x19'),null,_0x51bbc9));}if(_0xd70130[_0x5e1d('0x1a')]&&_0xd70130[_0x5e1d('0x1a')][_0x5e1d('0x1b')]){var _0x4c448f=_[_0x5e1d('0x1c')](_0xd70130[_0x5e1d('0x1a')],_0x5e1d('0x1d'))[_0x5e1d('0x1e')](';');return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x4c448f,null,_0x51bbc9));}var _0x49922c={};for(var _0x443a7c in FIELDS){if(FIELDS['hasOwnProperty'](_0x443a7c)&&FIELDS[_0x443a7c]){_0x49922c[_0x443a7c]=_0xd70130[_0x5e1d('0x1f')][0x0][FIELDS[_0x443a7c]]||_0xd70130[_0x5e1d('0x1f')][0x0]['\ufeff'+FIELDS[_0x443a7c]];}}if(!_0x49922c['firstName']){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x20'),null,_0x51bbc9));}if(!_0x49922c[_0x5e1d('0x21')]){return _0x3ce867(handleCheckRowError('error',_0x5e1d('0x22'),null,_0x51bbc9));}if(_0x49922c[_0x5e1d('0x23')]){var _0x2eddc4=moment(_0x49922c[_0x5e1d('0x23')],'YYYY-MM-DD');if(!_0x2eddc4['isValid']()){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x51bbc9));}}if(_0x49922c[_0x5e1d('0x24')]){if(!isEmail(_0x49922c['email'])){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x25'),null,_0x51bbc9));}}_0x49922c[_0x5e1d('0x26')]=LISTID;_0x49922c['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5e1d('0x1b')]&&_0x2223d9){var _0x213415={};for(var _0x2d70c8=0x0,_0x196ea2=DUPLICATES[_0x5e1d('0x1b')];_0x2d70c8<_0x196ea2;_0x2d70c8+=0x1){_0x213415[DUPLICATES[_0x2d70c8]]=_0x49922c[DUPLICATES[_0x2d70c8]];}var _0x218d37=_[_0x5e1d('0x27')](_0x2223d9,_0x213415);if(_0x218d37){return _0x3ce867(handleCheckRowError(_0x5e1d('0x28'),_0x5e1d('0x29'),_0x218d37,_0x51bbc9));}}return db[_0x5e1d('0x2a')][_0x5e1d('0x2b')](_0x49922c,{'raw':!![],'hooks':![],'fields':_['keys'](_0x49922c)})['then'](function(_0x836e1e){if(DUPLICATES&&DUPLICATES[_0x5e1d('0x1b')]&&_0x2223d9){_0x2223d9[_0x5e1d('0x2c')](_[_0x5e1d('0x2d')](_0x49922c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x836e1e['id'];return _0x1a3960();})[_0x5e1d('0x2e')](function(_0x48e5bb){return _0x3ce867(handleCheckRowError(_0x5e1d('0x15'),_0x5e1d('0x2f')+(_0x48e5bb[_0x5e1d('0x1d')]||JSON[_0x5e1d('0x30')](_0x48e5bb)),null,_0x51bbc9));});});}function checkHopper(){function _0x4b05ae(){return function(_0x28da07){logger[_0x5e1d('0x15')]('cmContact',_0x5e1d('0x31'),util[_0x5e1d('0x32')](_0x28da07,{'showHidden':![],'depth':null}));};}var _0x4f8701=function(_0x5e4b2c,_0x3740d8){var _0x2fb47a=squel[_0x5e1d('0x33')]()['into'](_0x5e1d('0x34'))[_0x5e1d('0x35')](['phone',_0x5e1d('0x36'),_0x5e1d('0x37'),'ListId',_0x3740d8,_0x5e1d('0x38'),_0x5e1d('0x39')],squel['select']()[_0x5e1d('0x3a')](_0x5e1d('0x21'),_0x5e1d('0x21'))['field'](_0x5e1d('0x3b'),_0x5e1d('0x36'))['field']('id',_0x5e1d('0x37'))[_0x5e1d('0x3a')](LISTID[_0x5e1d('0x3c')](),'ListId')['field'](_0x5e4b2c['id'][_0x5e1d('0x3c')](),_0x3740d8)[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x38'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x39'))['from']('cm_contacts')[_0x5e1d('0x3d')]('deletedAt\x20IS\x20NULL')[_0x5e1d('0x3d')](_0x5e1d('0x3e'),LISTID[_0x5e1d('0x3c')]())[_0x5e1d('0x3d')](_0x5e1d('0x3f'))[_0x5e1d('0x3d')](_0x5e1d('0x40'),squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')](_0x5e1d('0x21'))[_0x5e1d('0x42')](_0x5e1d('0x34'))[_0x5e1d('0x3d')](_0x3740d8+_0x5e1d('0x43'),_0x5e4b2c['id'][_0x5e1d('0x3c')]())))[_0x5e1d('0x3c')]();return _0x2fb47a;};var _0x3eaad1=function(_0x298f7d,_0x279fe9){var _0x3ea588=squel[_0x5e1d('0x33')]()[_0x5e1d('0x44')](_0x5e1d('0x34'))[_0x5e1d('0x35')]([_0x5e1d('0x21'),_0x5e1d('0x36'),_0x5e1d('0x37'),_0x5e1d('0x26'),_0x279fe9,_0x5e1d('0x38'),_0x5e1d('0x39')],squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')](_0x5e1d('0x21'),_0x5e1d('0x21'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x36'))[_0x5e1d('0x3a')]('id',_0x5e1d('0x37'))[_0x5e1d('0x3a')](LISTID[_0x5e1d('0x3c')](),'ListId')[_0x5e1d('0x3a')](_0x298f7d['id'][_0x5e1d('0x3c')](),_0x279fe9)[_0x5e1d('0x3a')]('NOW()',_0x5e1d('0x38'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),'updatedAt')['from'](_0x5e1d('0x45'))[_0x5e1d('0x3d')](_0x5e1d('0x46'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x5e1d('0x3d')](_0x5e1d('0x47'),squel[_0x5e1d('0x48')](hopperContacts))[_0x5e1d('0x3d')](_0x5e1d('0x3f'))[_0x5e1d('0x3d')](_0x5e1d('0x40'),squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')]('calleridnum')[_0x5e1d('0x42')]('cm_hopper_final')[_0x5e1d('0x3d')](_0x279fe9+_0x5e1d('0x43'),_0x298f7d['id']['toString']()))[_0x5e1d('0x3d')](_0x5e1d('0x40'),squel[_0x5e1d('0x41')]()['field'](_0x5e1d('0x21'))[_0x5e1d('0x42')](_0x5e1d('0x34'))[_0x5e1d('0x3d')](_0x279fe9+_0x5e1d('0x43'),_0x298f7d['id'][_0x5e1d('0x3c')]())))[_0x5e1d('0x3c')]();return _0x3ea588;};function _0xaee81b(_0x190679,_0x493bbc){var _0x2f40de=squel[_0x5e1d('0x33')]()['into'](_0x5e1d('0x34'))[_0x5e1d('0x35')]([_0x5e1d('0x21'),_0x5e1d('0x36'),_0x5e1d('0x37'),_0x5e1d('0x26'),_0x493bbc,_0x5e1d('0x38'),_0x5e1d('0x39')],squel[_0x5e1d('0x41')]()[_0x5e1d('0x3a')](_0x5e1d('0x21'),_0x5e1d('0x21'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x36'))['field']('id',_0x5e1d('0x37'))[_0x5e1d('0x3a')](LISTID[_0x5e1d('0x3c')](),_0x5e1d('0x26'))['field'](_0x190679['id']['toString'](),_0x493bbc)[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x38'))[_0x5e1d('0x3a')](_0x5e1d('0x3b'),_0x5e1d('0x39'))[_0x5e1d('0x42')]('cm_contacts')[_0x5e1d('0x3d')](_0x5e1d('0x46'))[_0x5e1d('0x3d')](_0x5e1d('0x3e'),LISTID['toString']())[_0x5e1d('0x3d')]('id\x20IN\x20?',squel[_0x5e1d('0x48')](hopperContacts))['where'](_0x5e1d('0x3f')))[_0x5e1d('0x3c')]();return _0x2f40de;}function _0x568caf(_0x2dd781,_0x314e51){var _0x2c038e=squel['insert']()[_0x5e1d('0x44')](_0x5e1d('0x49'))['fromQuery']([_0x5e1d('0x21'),_0x5e1d('0x37'),_0x5e1d('0x26'),_0x314e51,_0x5e1d('0x38'),_0x5e1d('0x39')],squel[_0x5e1d('0x41')]()['field'](_0x5e1d('0x21'),_0x5e1d('0x21'))[_0x5e1d('0x3a')]('id','ContactId')['field'](LISTID[_0x5e1d('0x3c')](),'ListId')[_0x5e1d('0x3a')](_0x2dd781['id'][_0x5e1d('0x3c')](),_0x314e51)[_0x5e1d('0x3a')]('NOW()',_0x5e1d('0x38'))['field'](_0x5e1d('0x3b'),'updatedAt')[_0x5e1d('0x42')](_0x5e1d('0x45'))[_0x5e1d('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x5e1d('0x3e'),LISTID['toString']())[_0x5e1d('0x3d')](_0x5e1d('0x47'),squel[_0x5e1d('0x48')](hopperContacts))[_0x5e1d('0x3d')](_0x5e1d('0x3f')))[_0x5e1d('0x3c')]();return _0x2c038e;}return db[_0x5e1d('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5e1d('0x4b')],'as':_0x5e1d('0x4c'),'where':{'id':LISTID}}]})[_0x5e1d('0x4d')](function(_0x2d41db){var _0x56e3e7=[];if(_0x2d41db){var _0x558af2;for(var _0x1a02be=0x0,_0x14b6ea;_0x1a02be<_0x2d41db[_0x5e1d('0x1b')];_0x1a02be+=0x1){_0x14b6ea=_0x2d41db[_0x1a02be][_0x5e1d('0x4e')]({'plain':!![]});switch(_0x14b6ea[_0x5e1d('0x4f')]){case _0x5e1d('0x50'):_0x56e3e7[_0x5e1d('0x2c')](db[_0x5e1d('0x51')][_0x5e1d('0x52')](_0x3eaad1(_0x14b6ea,_0x5e1d('0x53')))[_0x5e1d('0x4d')](function(){})['catch'](_0x4b05ae()));break;case _0x5e1d('0x54'):_0x56e3e7['push'](db[_0x5e1d('0x51')]['query'](_0x4f8701(_0x14b6ea,'VoiceQueueId'))['then'](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));break;default:_0x56e3e7['push'](db['sequelize']['query'](_0xaee81b(_0x14b6ea,_0x5e1d('0x53')))['then'](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}}return _0x56e3e7;})[_0x5e1d('0x55')]()[_0x5e1d('0x4d')](function(){return db[_0x5e1d('0x4a')][_0x5e1d('0x56')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x5e1d('0x4b')],'as':_0x5e1d('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x1f96f2){var _0x36ce17=[];if(_0x1f96f2){var _0x57e907;for(var _0x7c843f=0x0,_0x8d72ce;_0x7c843f<_0x1f96f2[_0x5e1d('0x1b')];_0x7c843f+=0x1){_0x8d72ce=_0x1f96f2[_0x7c843f][_0x5e1d('0x4e')]({'plain':!![]});_0x36ce17[_0x5e1d('0x2c')](db['sequelize'][_0x5e1d('0x52')](_0x568caf(_0x8d72ce,'VoiceQueueId'))['then'](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}return _0x36ce17;})[_0x5e1d('0x55')]();})[_0x5e1d('0x4d')](function(){return db[_0x5e1d('0x58')][_0x5e1d('0x56')]({'attributes':['id',_0x5e1d('0x4f')],'include':[{'model':db['CmList'],'as':_0x5e1d('0x4c'),'where':{'id':LISTID}}]})[_0x5e1d('0x4d')](function(_0x5d233d){var _0x29020f=[];if(_0x5d233d){for(var _0x353fe1=0x0,_0x1f2152;_0x353fe1<_0x5d233d[_0x5e1d('0x1b')];_0x353fe1+=0x1){_0x1f2152=_0x5d233d[_0x353fe1]['get']({'plain':!![]});switch(_0x1f2152[_0x5e1d('0x4f')]){case _0x5e1d('0x50'):_0x29020f[_0x5e1d('0x2c')](db['sequelize'][_0x5e1d('0x52')](_0x3eaad1(_0x1f2152,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));break;case _0x5e1d('0x54'):_0x29020f[_0x5e1d('0x2c')](db[_0x5e1d('0x51')][_0x5e1d('0x52')](_0x4f8701(_0x1f2152,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));break;default:_0x29020f['push'](db['sequelize'][_0x5e1d('0x52')](_0xaee81b(_0x1f2152,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}}return _0x29020f;})[_0x5e1d('0x55')]();})[_0x5e1d('0x4d')](function(){return db[_0x5e1d('0x58')][_0x5e1d('0x56')]({'attributes':['id'],'include':[{'model':db[_0x5e1d('0x4b')],'as':_0x5e1d('0x57'),'where':{'id':LISTID}}]})[_0x5e1d('0x4d')](function(_0x52729a){var _0x12e6f6=[];if(_0x52729a){for(var _0x1c5165=0x0,_0x4dfaf5;_0x1c5165<_0x52729a[_0x5e1d('0x1b')];_0x1c5165+=0x1){_0x4dfaf5=_0x52729a[_0x1c5165][_0x5e1d('0x4e')]({'plain':!![]});_0x12e6f6[_0x5e1d('0x2c')](db['sequelize']['query'](_0x568caf(_0x4dfaf5,_0x5e1d('0x59')))[_0x5e1d('0x4d')](function(){})[_0x5e1d('0x2e')](_0x4b05ae()));}}return _0x12e6f6;})[_0x5e1d('0x55')]();})['catch'](function(_0x6ff36e){logger[_0x5e1d('0x15')](_0x5e1d('0x5a'),_0x5e1d('0x5b'),_0x6ff36e['message']);});}var processPromises=function(_0x45e5ff){return BPromise[_0x5e1d('0x55')](promises)['then'](function(_0x538118){})[_0x5e1d('0x2e')](function(_0x277da){logger[_0x5e1d('0x15')](_0x5e1d('0x5c'),JSON[_0x5e1d('0x30')](_0x277da));})['finally'](function(){socket[_0x5e1d('0x5d')](_0x5e1d('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x45e5ff){return _0x45e5ff[_0x5e1d('0x5f')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x5e1d('0x4d')](function(){if(hopperContacts){return checkHopper();}})[_0x5e1d('0x4d')](function(){socket[_0x5e1d('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5e1d('0x60')](FILEPATH);}catch(_0x112a6b){logger[_0x5e1d('0x15')](_0x5e1d('0x61'),JSON[_0x5e1d('0x30')](_0x112a6b));}finally{process[_0x5e1d('0x62')](0x0);}});};process['on'](_0x5e1d('0x63'),function(){logger['info'](_0x5e1d('0x64'));endCsv();});function main(){return BPromise[_0x5e1d('0x65')]()[_0x5e1d('0x4d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5e1d('0x12')](',');return db['CmContact'][_0x5e1d('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5e1d('0x4d')](function(_0x39f672){var _0x503b41=fs[_0x5e1d('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5e1d('0x67')](_0x503b41,{'header':!![],'skipEmptyLines':!![],'step':function(_0x57db16,_0x477d16){total+=0x1;var _0x491120=total;promises['push'](checkRow(_0x57db16,_0x39f672,_0x491120)['then'](function(){success+=0x1;})['catch'](function(_0x37acd3){if(_0x37acd3['error']){errors+=0x1;delete _0x37acd3[_0x5e1d('0x15')];}else if(_0x37acd3[_0x5e1d('0x28')]){duplicates+=0x1;delete _0x37acd3[_0x5e1d('0x28')];}rows['push'](_0x37acd3);}));if(total%0xc8===0x0){_0x477d16[_0x5e1d('0x68')]();return processPromises(_0x477d16);}},'complete':function(){return processPromises()[_0x5e1d('0x4d')](function(){logger[_0x5e1d('0x69')](_0x5e1d('0x6a'));endCsv();});},'error':function(_0x3761db,_0x33fb99){logger['info'](_0x5e1d('0x6b'),JSON['stringify'](_0x3761db));endCsv();}});})[_0x5e1d('0x2e')](function(_0x320a03){logger['error'](_0x5e1d('0x6c'),JSON[_0x5e1d('0x30')](_0x320a03));});}main(); \ No newline at end of file +var _0xd982=['phone','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','select','\x20=\x20?','insert','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','ListId\x20=\x20?','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','Lists','get','always','VoiceQueueId','catch','onlyIfOpen','sequelize','query','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery'];(function(_0x44da47,_0x48551a){var _0x53354a=function(_0x1d0987){while(--_0x1d0987){_0x44da47['push'](_0x44da47['shift']());}};_0x53354a(++_0x48551a);}(_0xd982,0x18c));var _0x2d98=function(_0xa14764,_0x2f963a){_0xa14764=_0xa14764-0x0;var _0x46961e=_0xd982[_0xa14764];return _0x46961e;};'use strict';var BPromise=require(_0x2d98('0x0'));var util=require(_0x2d98('0x1'));var _=require(_0x2d98('0x2'));var fs=require('fs');var squel=require(_0x2d98('0x3'));var Papa=require('papaparse');var Redis=require(_0x2d98('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x2d98('0x5'));var logger=require(_0x2d98('0x6'))('api');config[_0x2d98('0x7')]=_[_0x2d98('0x8')](config[_0x2d98('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d98('0x9'))(new Redis(config[_0x2d98('0x7')]));require(_0x2d98('0xa'))[_0x2d98('0xb')](socket);try{if(!process[_0x2d98('0xc')][0x2]||process[_0x2d98('0xc')][0x2]===_0x2d98('0xd')||process[_0x2d98('0xc')][0x2]===_0x2d98('0xe')){throw new Error(_0x2d98('0xf'));}var FILEPATH=process[_0x2d98('0xc')][0x2];if(!process[_0x2d98('0xc')][0x3]||process[_0x2d98('0xc')][0x3]===_0x2d98('0xd')||process[_0x2d98('0xc')][0x3]===_0x2d98('0xe')||!process['argv'][0x4]||process['argv'][0x4]===_0x2d98('0xd')||process[_0x2d98('0xc')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x2d98('0x10')](process['argv'][0x3][_0x2d98('0x11')](','),process[_0x2d98('0xc')][0x4][_0x2d98('0x11')](','));if(!process[_0x2d98('0xc')][0x5]||process[_0x2d98('0xc')][0x5]===_0x2d98('0xd')||process['argv'][0x5]===_0x2d98('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x2d98('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x2d98('0xc')][0x6]!==_0x2d98('0xd')&&process[_0x2d98('0xc')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x2d98('0xc')][0x7]!=='null'?process[_0x2d98('0xc')][0x7]:null;if(!process[_0x2d98('0xc')][0x8]||process['argv'][0x8]===_0x2d98('0xd')||process[_0x2d98('0xc')][0x8]===_0x2d98('0xe')){throw new Error(_0x2d98('0x12'));}var SOCKET_TIMESTAMP=process[_0x2d98('0xc')][0x8];}catch(_0x141c59){logger[_0x2d98('0x13')](_0x141c59);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(_0x5f5468,_0xb37fe4,_0x4ec14e,_0xdc7d90){var _0x161c29={'message':_0xb37fe4};_0x161c29[_0x5f5468]=!![];if(_0x4ec14e){_0x161c29[_0x2d98('0x14')]=_0x4ec14e;}if(_0xdc7d90){_0x161c29[_0x2d98('0x15')]=_0xdc7d90;}return _0x161c29;}function isEmail(_0x407c0f){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'](_0x407c0f);}function checkRow(_0x3b7097,_0x302494,_0x2950eb){return new BPromise(function(_0x3f2a98,_0x73486b){if(_[_0x2d98('0x16')](_0x3b7097)){return _0x73486b(handleCheckRowError('error',_0x2d98('0x17'),null,_0x2950eb));}if(_0x3b7097[_0x2d98('0x18')]&&_0x3b7097[_0x2d98('0x18')][_0x2d98('0x19')]){var _0x29fafd=_[_0x2d98('0x1a')](_0x3b7097['errors'],_0x2d98('0x1b'))[_0x2d98('0x1c')](';');return _0x73486b(handleCheckRowError(_0x2d98('0x13'),_0x29fafd,null,_0x2950eb));}var _0x3feedf={};for(var _0x54a191 in FIELDS){if(FIELDS[_0x2d98('0x1d')](_0x54a191)&&FIELDS[_0x54a191]){_0x3feedf[_0x54a191]=_0x3b7097[_0x2d98('0x1e')][0x0][FIELDS[_0x54a191]]||_0x3b7097[_0x2d98('0x1e')][0x0]['\ufeff'+FIELDS[_0x54a191]];}}if(!_0x3feedf[_0x2d98('0x1f')]){return _0x73486b(handleCheckRowError(_0x2d98('0x13'),_0x2d98('0x20'),null,_0x2950eb));}if(!_0x3feedf['phone']){return _0x73486b(handleCheckRowError(_0x2d98('0x13'),_0x2d98('0x21'),null,_0x2950eb));}if(_0x3feedf[_0x2d98('0x22')]){var _0x9dcfe7=moment(_0x3feedf[_0x2d98('0x22')],_0x2d98('0x23'));if(!_0x9dcfe7['isValid']()){return _0x73486b(handleCheckRowError('error',_0x2d98('0x24'),null,_0x2950eb));}}if(_0x3feedf[_0x2d98('0x25')]){if(!isEmail(_0x3feedf[_0x2d98('0x25')])){return _0x73486b(handleCheckRowError(_0x2d98('0x13'),_0x2d98('0x26'),null,_0x2950eb));}}_0x3feedf[_0x2d98('0x27')]=LISTID;_0x3feedf['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2d98('0x19')]&&_0x302494){var _0x576fc2={};for(var _0x144c9e=0x0,_0x57227c=DUPLICATES[_0x2d98('0x19')];_0x144c9e<_0x57227c;_0x144c9e+=0x1){_0x576fc2[DUPLICATES[_0x144c9e]]=_0x3feedf[DUPLICATES[_0x144c9e]];}var _0xed5e00=_[_0x2d98('0x28')](_0x302494,_0x576fc2);if(_0xed5e00){return _0x73486b(handleCheckRowError(_0x2d98('0x29'),_0x2d98('0x2a'),_0xed5e00,_0x2950eb));}}return db[_0x2d98('0x2b')][_0x2d98('0x2c')](_0x3feedf,{'raw':!![],'hooks':![],'fields':_[_0x2d98('0x2d')](_0x3feedf)})[_0x2d98('0x2e')](function(_0x38661e){if(DUPLICATES&&DUPLICATES['length']&&_0x302494){_0x302494[_0x2d98('0x2f')](_[_0x2d98('0x30')](_0x3feedf,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x38661e['id'];return _0x3f2a98();})['catch'](function(_0x1a0c15){return _0x73486b(handleCheckRowError(_0x2d98('0x13'),_0x2d98('0x31')+(_0x1a0c15['message']||JSON['stringify'](_0x1a0c15)),null,_0x2950eb));});});}function checkHopper(){function _0x1a0234(){return function(_0x13439f){logger[_0x2d98('0x13')](_0x2d98('0x32'),_0x2d98('0x33'),util[_0x2d98('0x34')](_0x13439f,{'showHidden':![],'depth':null}));};}var _0x22337b=function(_0x48c3d0,_0x446b59){var _0x23d307=squel['insert']()[_0x2d98('0x35')](_0x2d98('0x36'))[_0x2d98('0x37')]([_0x2d98('0x38'),_0x2d98('0x39'),_0x2d98('0x3a'),_0x2d98('0x27'),_0x446b59,_0x2d98('0x3b'),_0x2d98('0x3c')],squel['select']()['field'](_0x2d98('0x38'),_0x2d98('0x38'))[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x39'))[_0x2d98('0x3d')]('id',_0x2d98('0x3a'))[_0x2d98('0x3d')](LISTID[_0x2d98('0x3f')](),_0x2d98('0x27'))[_0x2d98('0x3d')](_0x48c3d0['id'][_0x2d98('0x3f')](),_0x446b59)[_0x2d98('0x3d')]('NOW()',_0x2d98('0x3b'))[_0x2d98('0x3d')]('NOW()','updatedAt')[_0x2d98('0x40')](_0x2d98('0x41'))[_0x2d98('0x42')](_0x2d98('0x43'))[_0x2d98('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0x2d98('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x2d98('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2d98('0x44')]()[_0x2d98('0x3d')](_0x2d98('0x38'))[_0x2d98('0x40')](_0x2d98('0x36'))[_0x2d98('0x42')](_0x446b59+_0x2d98('0x45'),_0x48c3d0['id'][_0x2d98('0x3f')]())))[_0x2d98('0x3f')]();return _0x23d307;};var _0x459b66=function(_0x55f3d0,_0x5db7ed){var _0x5bc3f3=squel[_0x2d98('0x46')]()['into']('cm_hopper')[_0x2d98('0x37')]([_0x2d98('0x38'),'scheduledAt',_0x2d98('0x3a'),'ListId',_0x5db7ed,_0x2d98('0x3b'),_0x2d98('0x3c')],squel['select']()[_0x2d98('0x3d')](_0x2d98('0x38'),_0x2d98('0x38'))[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x39'))[_0x2d98('0x3d')]('id','ContactId')['field'](LISTID[_0x2d98('0x3f')](),_0x2d98('0x27'))[_0x2d98('0x3d')](_0x55f3d0['id'][_0x2d98('0x3f')](),_0x5db7ed)[_0x2d98('0x3d')]('NOW()',_0x2d98('0x3b'))[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x3c'))[_0x2d98('0x40')]('cm_contacts')[_0x2d98('0x42')](_0x2d98('0x43'))['where']('ListId\x20=\x20?',LISTID[_0x2d98('0x3f')]())[_0x2d98('0x42')]('id\x20IN\x20?',squel[_0x2d98('0x47')](hopperContacts))[_0x2d98('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x2d98('0x42')](_0x2d98('0x48'),squel[_0x2d98('0x44')]()[_0x2d98('0x3d')](_0x2d98('0x49'))[_0x2d98('0x40')](_0x2d98('0x4a'))[_0x2d98('0x42')](_0x5db7ed+_0x2d98('0x45'),_0x55f3d0['id'][_0x2d98('0x3f')]()))[_0x2d98('0x42')](_0x2d98('0x48'),squel['select']()[_0x2d98('0x3d')](_0x2d98('0x38'))[_0x2d98('0x40')](_0x2d98('0x36'))['where'](_0x5db7ed+_0x2d98('0x45'),_0x55f3d0['id'][_0x2d98('0x3f')]())))[_0x2d98('0x3f')]();return _0x5bc3f3;};function _0x55c60b(_0x19b856,_0x3a28a6){var _0x31a986=squel[_0x2d98('0x46')]()[_0x2d98('0x35')](_0x2d98('0x36'))[_0x2d98('0x37')]([_0x2d98('0x38'),_0x2d98('0x39'),'ContactId',_0x2d98('0x27'),_0x3a28a6,_0x2d98('0x3b'),_0x2d98('0x3c')],squel[_0x2d98('0x44')]()['field']('phone',_0x2d98('0x38'))[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x39'))[_0x2d98('0x3d')]('id',_0x2d98('0x3a'))[_0x2d98('0x3d')](LISTID[_0x2d98('0x3f')](),_0x2d98('0x27'))[_0x2d98('0x3d')](_0x19b856['id'][_0x2d98('0x3f')](),_0x3a28a6)[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x3b'))[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x3c'))[_0x2d98('0x40')](_0x2d98('0x41'))['where'](_0x2d98('0x43'))[_0x2d98('0x42')](_0x2d98('0x4b'),LISTID['toString']())[_0x2d98('0x42')](_0x2d98('0x4c'),squel[_0x2d98('0x47')](hopperContacts))['where'](_0x2d98('0x4d')))[_0x2d98('0x3f')]();return _0x31a986;}function _0x5a6558(_0x2bb7b2,_0x5ac2d9){var _0x31d84e=squel[_0x2d98('0x46')]()['into'](_0x2d98('0x4e'))[_0x2d98('0x37')]([_0x2d98('0x38'),_0x2d98('0x3a'),'ListId',_0x5ac2d9,'createdAt',_0x2d98('0x3c')],squel[_0x2d98('0x44')]()[_0x2d98('0x3d')](_0x2d98('0x38'),'phone')[_0x2d98('0x3d')]('id',_0x2d98('0x3a'))['field'](LISTID[_0x2d98('0x3f')](),'ListId')[_0x2d98('0x3d')](_0x2bb7b2['id'][_0x2d98('0x3f')](),_0x5ac2d9)[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x3b'))[_0x2d98('0x3d')](_0x2d98('0x3e'),_0x2d98('0x3c'))['from'](_0x2d98('0x41'))['where'](_0x2d98('0x43'))[_0x2d98('0x42')](_0x2d98('0x4b'),LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x2d98('0x42')](_0x2d98('0x4d')))[_0x2d98('0x3f')]();return _0x31d84e;}return db['VoiceQueue'][_0x2d98('0x4f')]({'where':{'type':_0x2d98('0x50')},'attributes':['id',_0x2d98('0x51')],'include':[{'model':db['CmList'],'as':_0x2d98('0x52'),'where':{'id':LISTID}}]})[_0x2d98('0x2e')](function(_0x22a5d8){var _0x187935=[];if(_0x22a5d8){var _0x1e9ba8;for(var _0x4c791f=0x0,_0x520651;_0x4c791f<_0x22a5d8[_0x2d98('0x19')];_0x4c791f+=0x1){_0x520651=_0x22a5d8[_0x4c791f][_0x2d98('0x53')]({'plain':!![]});switch(_0x520651[_0x2d98('0x51')]){case _0x2d98('0x54'):_0x187935[_0x2d98('0x2f')](db['sequelize']['query'](_0x459b66(_0x520651,_0x2d98('0x55')))['then'](function(){})[_0x2d98('0x56')](_0x1a0234()));break;case _0x2d98('0x57'):_0x187935[_0x2d98('0x2f')](db[_0x2d98('0x58')][_0x2d98('0x59')](_0x22337b(_0x520651,'VoiceQueueId'))[_0x2d98('0x2e')](function(){})['catch'](_0x1a0234()));break;default:_0x187935['push'](db[_0x2d98('0x58')]['query'](_0x55c60b(_0x520651,_0x2d98('0x55')))[_0x2d98('0x2e')](function(){})[_0x2d98('0x56')](_0x1a0234()));}}}return _0x187935;})[_0x2d98('0x5a')]()[_0x2d98('0x2e')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x2d98('0x50')},'attributes':['id'],'include':[{'model':db[_0x2d98('0x5b')],'as':_0x2d98('0x5c'),'where':{'id':LISTID}}]})[_0x2d98('0x2e')](function(_0x37a723){var _0x4e0dc7=[];if(_0x37a723){var _0x45fc71;for(var _0x453c1d=0x0,_0x5145cf;_0x453c1d<_0x37a723[_0x2d98('0x19')];_0x453c1d+=0x1){_0x5145cf=_0x37a723[_0x453c1d]['get']({'plain':!![]});_0x4e0dc7[_0x2d98('0x2f')](db[_0x2d98('0x58')]['query'](_0x5a6558(_0x5145cf,'VoiceQueueId'))[_0x2d98('0x2e')](function(){})['catch'](_0x1a0234()));}}return _0x4e0dc7;})[_0x2d98('0x5a')]();})['then'](function(){return db[_0x2d98('0x5d')][_0x2d98('0x4f')]({'attributes':['id',_0x2d98('0x51')],'include':[{'model':db[_0x2d98('0x5b')],'as':'Lists','where':{'id':LISTID}}]})[_0x2d98('0x2e')](function(_0x2d11f8){var _0x12534e=[];if(_0x2d11f8){for(var _0x5ece85=0x0,_0x1c42e3;_0x5ece85<_0x2d11f8['length'];_0x5ece85+=0x1){_0x1c42e3=_0x2d11f8[_0x5ece85][_0x2d98('0x53')]({'plain':!![]});switch(_0x1c42e3['dialCheckDuplicateType']){case _0x2d98('0x54'):_0x12534e['push'](db[_0x2d98('0x58')]['query'](_0x459b66(_0x1c42e3,_0x2d98('0x5e')))[_0x2d98('0x2e')](function(){})[_0x2d98('0x56')](_0x1a0234()));break;case'onlyIfOpen':_0x12534e[_0x2d98('0x2f')](db[_0x2d98('0x58')][_0x2d98('0x59')](_0x22337b(_0x1c42e3,_0x2d98('0x5e')))[_0x2d98('0x2e')](function(){})[_0x2d98('0x56')](_0x1a0234()));break;default:_0x12534e[_0x2d98('0x2f')](db['sequelize'][_0x2d98('0x59')](_0x55c60b(_0x1c42e3,'CampaignId'))['then'](function(){})[_0x2d98('0x56')](_0x1a0234()));}}}return _0x12534e;})['all']();})[_0x2d98('0x2e')](function(){return db[_0x2d98('0x5d')][_0x2d98('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x2d98('0x5b')],'as':_0x2d98('0x5c'),'where':{'id':LISTID}}]})[_0x2d98('0x2e')](function(_0x1907a9){var _0x26938a=[];if(_0x1907a9){for(var _0x3eba41=0x0,_0x33c662;_0x3eba41<_0x1907a9[_0x2d98('0x19')];_0x3eba41+=0x1){_0x33c662=_0x1907a9[_0x3eba41]['get']({'plain':!![]});_0x26938a[_0x2d98('0x2f')](db['sequelize'][_0x2d98('0x59')](_0x5a6558(_0x33c662,_0x2d98('0x5e')))[_0x2d98('0x2e')](function(){})['catch'](_0x1a0234()));}}return _0x26938a;})['all']();})[_0x2d98('0x56')](function(_0x28dcf2){logger['error'](_0x2d98('0x5f'),'generalCheckHopper',_0x28dcf2[_0x2d98('0x1b')]);});}var processPromises=function(_0x3570cc){return BPromise['all'](promises)['then'](function(_0x4c1b82){})[_0x2d98('0x56')](function(_0x5bf4de){logger['error'](_0x2d98('0x60'),JSON[_0x2d98('0x61')](_0x5bf4de));})['finally'](function(){socket[_0x2d98('0x62')](_0x2d98('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3570cc){return _0x3570cc[_0x2d98('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x2d98('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x2d98('0x2e')](function(){socket[_0x2d98('0x62')](_0x2d98('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2d98('0x65')](FILEPATH);}catch(_0x2001a2){logger[_0x2d98('0x13')](_0x2d98('0x66'),JSON[_0x2d98('0x61')](_0x2001a2));}finally{process[_0x2d98('0x67')](0x0);}});};process['on'](_0x2d98('0x68'),function(){logger[_0x2d98('0x69')](_0x2d98('0x6a'));endCsv();});function main(){return BPromise['resolve']()[_0x2d98('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2d98('0x11')](',');return db[_0x2d98('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x2d98('0x2e')](function(_0x49ec78){var _0x35f84f=fs[_0x2d98('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2d98('0x6c')](_0x35f84f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x173637,_0x2e0415){total+=0x1;var _0x4e6b43=total;promises[_0x2d98('0x2f')](checkRow(_0x173637,_0x49ec78,_0x4e6b43)['then'](function(){success+=0x1;})[_0x2d98('0x56')](function(_0x5d31db){if(_0x5d31db[_0x2d98('0x13')]){errors+=0x1;delete _0x5d31db[_0x2d98('0x13')];}else if(_0x5d31db['duplicate']){duplicates+=0x1;delete _0x5d31db[_0x2d98('0x29')];}rows[_0x2d98('0x2f')](_0x5d31db);}));if(total%0xc8===0x0){_0x2e0415[_0x2d98('0x6d')]();return processPromises(_0x2e0415);}},'complete':function(){return processPromises()['then'](function(){logger[_0x2d98('0x69')](_0x2d98('0x6e'));endCsv();});},'error':function(_0x4a0a88,_0x4ee545){logger[_0x2d98('0x69')](_0x2d98('0x6f'),JSON[_0x2d98('0x61')](_0x4a0a88));endCsv();}});})[_0x2d98('0x56')](function(_0x40df8a){logger[_0x2d98('0x13')](_0x2d98('0x70'),JSON[_0x2d98('0x61')](_0x40df8a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0ccf5b0..c21f744 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 _0xcd15=['header','writeFileSync','parse','data','rows','find','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','hasOwnProperty','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','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',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','length','push','then','split','all','filter','CmContactHasItem','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','fields','cm_contacts','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','into','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','exit','errors','info','sequelize','query','spread','catch','message','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','binding','socket_timestamp','server/files/tmp','.csv','keys','includes','ContactItemType','name','_description'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0xcd15,0xf6));var _0x5cd1=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0xcd15[_0x4fda88];return _0xe37511;};'use strict';var fs=require('fs');var path=require(_0x5cd1('0x0'));var _=require(_0x5cd1('0x1'));var Papa=require(_0x5cd1('0x2'));var util=require(_0x5cd1('0x3'));var BPromise=require(_0x5cd1('0x4'));var moment=require(_0x5cd1('0x5'));var squel=require(_0x5cd1('0x6'));var Redis=require(_0x5cd1('0x7'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0x5cd1('0x8'));var logger=require(_0x5cd1('0x9'))(_0x5cd1('0xa'));config[_0x5cd1('0xb')]=_[_0x5cd1('0xc')](config[_0x5cd1('0xb')],{'host':_0x5cd1('0xd'),'port':0x18eb});var socket=require(_0x5cd1('0xe'))(new Redis(config[_0x5cd1('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5cd1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5cd1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1c14f5){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'](_0x1c14f5);}function selectNotIn(_0x8bd6c0,_0x125539,_0x4df576,_0x39c357,_0xe66e24){return squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')](_0x5cd1('0x12'))[_0x5cd1('0x13')](_0x39c357)[_0x5cd1('0x14')](_0x125539,null,_0x125539+_0x5cd1('0x15')+_0x39c357+'.'+_0x4df576)[_0x5cd1('0x16')](_0x39c357+'.'+_0x4df576+_0x5cd1('0x17')+_0x8bd6c0+'.'+_0x4df576)[_0x5cd1('0x16')](_0x125539+'.dialCheckDuplicateType\x20IN\x20('+_0xe66e24[_0x5cd1('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3d3ef9,_0x2687d1){promisesAdditionalPhones=[];return db[_0x5cd1('0x18')][_0x5cd1('0x19')]({'raw':!![],'attributes':['id',_0x5cd1('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x44b418){if(_0x44b418!==null){var _0x373543=[];for(var _0x5fbd8f=0x0;_0x5fbd8f<_0x44b418[_0x5cd1('0x1b')];_0x5fbd8f++){var _0x1201c6=_0x44b418[_0x5fbd8f];_0x373543[_0x5cd1('0x1c')](insertAdditionalPhones(_0x1201c6));}}Promise['all'](_0x373543)[_0x5cd1('0x1d')](function(){_0x3d3ef9({'val':0x1});});});});}function insertAdditionalPhones(_0x3bdf3b){return new Promise(function(_0x52abba,_0x483ec6){var _0x4de2fc=_0x3bdf3b['AdditionalPhones'];var _0x47dee2=_0x4de2fc[_0x5cd1('0x1e')](';');var _0x2a2fef=[];orderBy=0x0;for(var _0x23aea4=0x0;_0x23aea4<_0x47dee2[_0x5cd1('0x1b')];_0x23aea4++){_0x2a2fef[_0x5cd1('0x1c')](splitAdditionalPhone(_0x3bdf3b['id'],_0x47dee2[_0x23aea4]));}Promise[_0x5cd1('0x1f')](_0x2a2fef)[_0x5cd1('0x1d')](function(){_0x52abba({'val':_0x47dee2['length']});});});}function splitAdditionalPhone(_0x106ad1,_0x5ada3f){return new Promise(function(_0x22f34d,_0x4b3729){var _0x109a0c=_0x5ada3f[_0x5cd1('0x1e')](':');var _0x551537=_0x109a0c[0x0];var _0x22216d=_0x109a0c[0x1];if(!_['isNil'](_0x22216d)){var _0x2d2c00=_0x22216d[_0x5cd1('0x1e')]('|');var _0x212991=[];for(var _0x431001=0x0;_0x431001<_0x2d2c00[_0x5cd1('0x1b')];_0x431001++){if(_0x2d2c00[_0x431001]!==''){var _0x2da530=_[_0x5cd1('0x20')](promisesAdditionalPhones,{'contactId':_0x106ad1,'phone':_0x2d2c00[_0x431001]});if(_0x2da530[_0x5cd1('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x5cd1('0x1c')]({'contactId':_0x106ad1,'contactTypeId':_0x551537,'phone':_0x2d2c00[_0x431001],'orderBy':orderBy});}}}_0x22f34d({'ok':0x1});}else _0x22f34d({'res':0x0});});}function createAdditionalPhone(_0x704733,_0x28d96a,_0x2ae1a4,_0x41e1db){var _0xb9a8f0='';var _0x239cb5='';var _0x20b958=_0x2ae1a4[_0x5cd1('0x1e')]('§');_0xb9a8f0=_0x20b958[0x0];if(_0x20b958[_0x5cd1('0x1b')]==0x2)_0x239cb5=_0x20b958[0x1];return new Promise(function(_0x163085,_0x5743bb){return db[_0x5cd1('0x21')]['findOne']({'where':{'CmContactId':_0x704733,'item':_0xb9a8f0}})[_0x5cd1('0x1d')](function(_0x46f1fd){if(_0x46f1fd){return db[_0x5cd1('0x21')]['update']({'ItemTypeId':_0x28d96a,'description':_0x239cb5,'OrderBy':_0x41e1db},{'where':{'CmContactId':_0x704733,'item':_0xb9a8f0}})['then'](function(_0x5924f2){_0x163085({'res':_0x5cd1('0x22')});});}else{return db[_0x5cd1('0x21')][_0x5cd1('0x23')]({'CmContactId':_0x704733,'item':_0xb9a8f0,'description':_0x239cb5,'ItemTypeId':_0x28d96a,'OrderBy':_0x41e1db,'ItemClass':'PHONE'})['then'](function(_0x23a5f3){_0x163085({'res':_0x5cd1('0x24')});});}});});}function insertCmHopper(_0x39a5e5,_0x2b4675,_0x233822,_0x531a91,_0x186fe5){var _0x5b145a=[_0x5cd1('0x25'),_0x5cd1('0x26'),_0x5cd1('0x27'),'cm_contacts.ListId',_0x2b4675+'.'+_0x531a91,_0x5cd1('0x28'),_0x5cd1('0x29'),_0x5cd1('0x2a'),_0x5cd1('0x2b'),'\x22'+_0x186fe5+'\x22'];return squel[_0x5cd1('0x2c')]()['into']('cm_hopper')[_0x5cd1('0x2d')](['phone',_0x5cd1('0x2e'),_0x5cd1('0x2f'),_0x5cd1('0x30'),_0x531a91,_0x5cd1('0x31'),_0x5cd1('0x32'),_0x5cd1('0x33'),_0x5cd1('0x34'),_0x5cd1('0x35')],squel[_0x5cd1('0x10')]()['fields'](_0x5b145a)['from'](_0x2b4675)[_0x5cd1('0x14')]('cm_contacts',null,_0x5cd1('0x36')+_0x2b4675+_0x5cd1('0x37'))[_0x5cd1('0x14')](_0x233822,null,_0x233822+_0x5cd1('0x15')+_0x2b4675+'.'+_0x531a91)[_0x5cd1('0x16')](_0x2b4675+_0x5cd1('0x38'),_0x39a5e5)[_0x5cd1('0x16')](_0x5cd1('0x39'),NOW)[_0x5cd1('0x16')](_0x5cd1('0x3a'),selectNotIn(_0x2b4675,_0x233822,_0x531a91,_0x5cd1('0x3b'),[_0x5cd1('0x3c'),_0x5cd1('0x3d')]))[_0x5cd1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2b4675,_0x233822,_0x531a91,_0x5cd1('0x3b'),[_0x5cd1('0x3c')])))[_0x5cd1('0x3e')]();}function insertCmHopperBlack(_0x1afd4d,_0x485e30,_0x5787fe,_0x198786){var _0x5839bf=[_0x5cd1('0x25'),_0x5cd1('0x27'),_0x5cd1('0x3f'),_0x485e30+'.'+_0x198786,_0x5cd1('0x28'),'cm_contacts.updatedAt'];return squel[_0x5cd1('0x2c')]()['into'](_0x5cd1('0x40'))[_0x5cd1('0x2d')](['phone','ContactId',_0x5cd1('0x30'),_0x198786,'createdAt',_0x5cd1('0x32')],squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0x5839bf)['from'](_0x485e30)[_0x5cd1('0x14')](_0x5cd1('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x485e30+_0x5cd1('0x37'))[_0x5cd1('0x14')](_0x5787fe,null,_0x5787fe+_0x5cd1('0x15')+_0x485e30+'.'+_0x198786)[_0x5cd1('0x16')](_0x485e30+_0x5cd1('0x38'),_0x1afd4d)[_0x5cd1('0x16')](_0x5cd1('0x39'),NOW)[_0x5cd1('0x16')](_0x5cd1('0x3a'),squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')]('phone')[_0x5cd1('0x13')](_0x5cd1('0x40'))[_0x5cd1('0x16')](_0x5cd1('0x43'),_0x1afd4d)[_0x5cd1('0x16')](_0x198786+_0x5cd1('0x17')+_0x485e30+'.'+_0x198786)))[_0x5cd1('0x3e')]();}function insertTzCmHopper(_0xa3a123,_0x5854ef,_0x268eaf,_0x55c5cc,_0xf040ca,_0x2d884b){var _0x3753f6=[_0x5cd1('0x25'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x2d884b+_0x5cd1('0x44'),_0x5cd1('0x27'),'cm_contacts.ListId',_0x5854ef+'.'+_0x55c5cc,'cm_contacts.createdAt',_0x5cd1('0x29'),_0x5cd1('0x2a'),_0x5cd1('0x2b'),'\x22'+_0xf040ca+'\x22'];var _0x688faf=squel[_0x5cd1('0x2c')]()[_0x5cd1('0x45')](_0x5cd1('0x3b'))[_0x5cd1('0x2d')](['phone','scheduledat',_0x5cd1('0x2f'),_0x5cd1('0x30'),_0x55c5cc,'createdAt',_0x5cd1('0x32'),_0x5cd1('0x33'),_0x5cd1('0x34'),_0x5cd1('0x35')],squel['select']()[_0x5cd1('0x41')](_0x3753f6)['from'](_0x5854ef)[_0x5cd1('0x14')](_0x5cd1('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x5854ef+_0x5cd1('0x37'))[_0x5cd1('0x14')](_0x268eaf,null,_0x268eaf+'.id\x20=\x20'+_0x5854ef+'.'+_0x55c5cc)[_0x5cd1('0x14')](_0x2d884b,null,_0x2d884b+_0x5cd1('0x15')+_0x5854ef+'.'+_0x55c5cc)[_0x5cd1('0x16')](_0x5854ef+_0x5cd1('0x38'),_0xa3a123)[_0x5cd1('0x16')](_0x5cd1('0x39'),NOW)[_0x5cd1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5854ef,_0x268eaf,_0x55c5cc,_0x5cd1('0x3b'),[_0x5cd1('0x3c'),_0x5cd1('0x3d')]))[_0x5cd1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5854ef,_0x268eaf,_0x55c5cc,_0x5cd1('0x3b'),[_0x5cd1('0x3c')])))[_0x5cd1('0x3e')]();return _0x688faf;}function insertTzCmHopperBlack(_0x487014,_0x2f2a46,_0x451d72,_0x413917){var _0x47d466=[_0x5cd1('0x25'),_0x5cd1('0x27'),_0x5cd1('0x3f'),_0x2f2a46+'.'+_0x413917,_0x5cd1('0x28'),_0x5cd1('0x29')];return squel[_0x5cd1('0x2c')]()[_0x5cd1('0x45')]('cm_hopper_black')['fromQuery']([_0x5cd1('0x12'),_0x5cd1('0x2f'),_0x5cd1('0x30'),_0x413917,_0x5cd1('0x31'),_0x5cd1('0x32')],squel['select']()[_0x5cd1('0x41')](_0x47d466)[_0x5cd1('0x13')](_0x2f2a46)[_0x5cd1('0x14')](_0x5cd1('0x42'),null,_0x5cd1('0x36')+_0x2f2a46+_0x5cd1('0x37'))['join'](_0x451d72,null,_0x451d72+_0x5cd1('0x15')+_0x2f2a46+'.'+_0x413917)[_0x5cd1('0x16')](_0x2f2a46+_0x5cd1('0x38'),_0x487014)[_0x5cd1('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5cd1('0x16')](_0x5cd1('0x3a'),squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')](_0x5cd1('0x12'))['from'](_0x5cd1('0x40'))[_0x5cd1('0x16')]('ListId\x20=\x20?',_0x487014)['where'](_0x413917+_0x5cd1('0x17')+_0x2f2a46+'.'+_0x413917)))['toString']();}function insertCmHopperAdditionalPhones(_0xfbef0f){var _0x2e5fb0=[_0x5cd1('0x46'),_0x5cd1('0x47'),_0x5cd1('0x48'),_0x5cd1('0x49'),_0x5cd1('0x4a')];return squel['insert']()[_0x5cd1('0x45')]('cm_hopper_additional_phones')[_0x5cd1('0x2d')](['CmHopperId','phone',_0x5cd1('0x4b'),_0x5cd1('0x31'),_0x5cd1('0x32')],squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0x2e5fb0)['from']('cm_hopper')[_0x5cd1('0x14')](_0x5cd1('0x42'),null,_0x5cd1('0x4c'))[_0x5cd1('0x14')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x5cd1('0x16')](_0x5cd1('0x4d'),_0xfbef0f)['where'](_0x5cd1('0x39'),NOW))[_0x5cd1('0x3e')]();}function insertCmContact(_0x17e210,_0xac1001,_0xd923dd,_0x300946){var _0x30393d=_[_0x5cd1('0x4e')](_['keys'](_0x300946),[_0x5cd1('0x30'),_0x5cd1('0x4f'),_0x5cd1('0x31'),'updatedAt']);return squel[_0x5cd1('0x2c')]()['into'](_0x5cd1('0x42'))[_0x5cd1('0x2d')](_0x30393d,squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0x30393d)[_0x5cd1('0x13')](_0xac1001)[_0x5cd1('0x16')]('('+_0xd923dd[_0x5cd1('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](_0xd923dd)[_0x5cd1('0x13')](_0x5cd1('0x42'))[_0x5cd1('0x16')](_0x5cd1('0x43'),_0x17e210)[_0x5cd1('0x16')](_0x5cd1('0x50')))[_0x5cd1('0x16')](_0x5cd1('0x51'),squel[_0x5cd1('0x10')]()[_0x5cd1('0x11')](_0x5cd1('0x52'),'min_id')['from'](_0xac1001)[_0x5cd1('0x53')](_0xd923dd[_0x5cd1('0x14')](','))))[_0x5cd1('0x3e')]();}function handleStop(){logger['info'](_0x5cd1('0x54'));stopped=!![];}function handleUncaughtException(_0x34bd5c){logger[_0x5cd1('0x55')](_0x34bd5c['message']);process[_0x5cd1('0x56')](0x1);}function handleError(_0x496461,_0x360592){stats[_0x5cd1('0x57')][_0x5cd1('0x1c')]({'name':_0x360592['code'],'message':_0x360592['message'],'row':_0x496461});}function handleQuery(_0x45ec69){logger[_0x5cd1('0x58')](_0x45ec69);return db[_0x5cd1('0x59')][_0x5cd1('0x5a')](_0x45ec69)[_0x5cd1('0x5b')](function(_0x1ae296){results['push'](_0x1ae296);})[_0x5cd1('0x5c')](function(_0x52d3a8){logger[_0x5cd1('0x55')](_0x52d3a8[_0x5cd1('0x5d')]);});}function updateTzCampaigns(_0x1a6870){return new Promise(function(_0x8b76b8,_0x15b7e9){var _0x54d7fe=squel[_0x5cd1('0x10')]()[_0x5cd1('0x41')](['campaigns.id',_0x5cd1('0x5e')])[_0x5cd1('0x13')](_0x5cd1('0x5f'))[_0x5cd1('0x14')](_0x5cd1('0x60'),null,_0x5cd1('0x61'))[_0x5cd1('0x16')](_0x5cd1('0x62')+_0x1a6870);db[_0x5cd1('0x59')][_0x5cd1('0x5a')](_0x54d7fe['toString']())[_0x5cd1('0x5b')](function(_0x57a63e){var _0x3adb02=[];for(var _0x759a5d=0x0;_0x759a5d<_0x57a63e[_0x5cd1('0x1b')];_0x759a5d++){_0x3adb02['push'](getTimezoneData(_0x57a63e[_0x759a5d],tmp_campaigns));}BPromise['all'](_0x3adb02)['then'](function(){_0x8b76b8({'val':0x1});});})[_0x5cd1('0x5c')](function(_0x379253){logger['error'](_0x379253[_0x5cd1('0x5d')]);_0x8b76b8({'val':0x0});});});}function updateTzVoiceQueues(_0x2dd6c8){return new Promise(function(_0x307f87,_0x2fb848){var _0x35fbb8=squel[_0x5cd1('0x10')]()['fields']([_0x5cd1('0x63'),_0x5cd1('0x64')])[_0x5cd1('0x13')](_0x5cd1('0x65'))['join'](_0x5cd1('0x66'),null,_0x5cd1('0x67'))[_0x5cd1('0x16')](_0x5cd1('0x68')+_0x2dd6c8);db['sequelize']['query'](_0x35fbb8[_0x5cd1('0x3e')]())[_0x5cd1('0x5b')](function(_0x3d1c5d){var _0x40dce3=[];for(var _0x252b7d=0x0;_0x252b7d<_0x3d1c5d[_0x5cd1('0x1b')];_0x252b7d++){_0x40dce3[_0x5cd1('0x1c')](getTimezoneData(_0x3d1c5d[_0x252b7d],tmp_voice_queues));}BPromise[_0x5cd1('0x1f')](_0x40dce3)['then'](function(){_0x307f87({'val':0x1});});})[_0x5cd1('0x5c')](function(_0x13a84b){logger['error'](_0x13a84b[_0x5cd1('0x5d')]);_0x307f87({'val':0x0});});});}function getTimezoneData(_0x53ea91,_0x575d60){return new Promise(function(_0x24a800,_0x5d5e35){var _0xfc7bd5=shared['timezones'];var _0x2a6ef8=_0xfc7bd5[_0x53ea91[_0x5cd1('0x69')]];if(_[_0x5cd1('0x6a')](_0x2a6ef8)){_0x24a800({'ret':0x1});}else{var _0x55c328=_0x2a6ef8[_0x5cd1('0x6b')];var _0x20695f=squel[_0x5cd1('0x2c')]()['into'](_0x575d60)[_0x5cd1('0x6c')]('id',_0x53ea91['id'])[_0x5cd1('0x6c')](_0x5cd1('0x6d'),_0x55c328)[_0x5cd1('0x6c')](_0x5cd1('0x69'),_0x53ea91[_0x5cd1('0x69')])[_0x5cd1('0x3e')]();return db[_0x5cd1('0x59')]['query'](_0x20695f)[_0x5cd1('0x5b')](function(_0x24489f){_0x24a800({'ret':0x1});})[_0x5cd1('0x5c')](function(_0x2f7bbf){logger[_0x5cd1('0x55')](_0x2f7bbf['message']);_0x5d5e35({'ret':0x1});});}});}function handleTZQuery(_0x32976b){logger['info'](_0x32976b);return db[_0x5cd1('0x59')][_0x5cd1('0x5a')](_0x32976b)[_0x5cd1('0x5b')](function(_0x293254){})['catch'](function(_0xaa7adf){logger['error'](_0xaa7adf[_0x5cd1('0x5d')]);});}function main(_0x18788f,_0x589bba,_0x20c203,_0x1c8c12){logger[_0x5cd1('0x58')](_0x5cd1('0x6e'),_0x18788f,JSON[_0x5cd1('0x6f')](_0x589bba));process[_0x5cd1('0x70')]('start');var _0x5e30f5=_0x589bba[_0x5cd1('0x71')];var _0xab41e4=_['clone'](_0x5e30f5);var _0x897eef=_0x589bba[_0x5cd1('0x72')];var _0x2bfb2f=path[_0x5cd1('0x14')](config['root'],_0x5cd1('0x73'),_0x897eef+_0x5cd1('0x74'));hasTZ=_[_0x5cd1('0x75')](_0x5e30f5)[_0x5cd1('0x76')](_0x5cd1('0x69'));var _0x82c77d=_[_0x5cd1('0x75')](_0x5e30f5)[_0x5cd1('0x14')]();logger[_0x5cd1('0x58')]('header',_0x82c77d);db[_0x5cd1('0x77')][_0x5cd1('0x19')]({'raw':!![],'attributes':['id',_0x5cd1('0x78')]})[_0x5cd1('0x1d')](function(_0x356d3c){for(var _0x35ad69=0x0;_0x35ad69<_0x356d3c['length'];_0x35ad69++){if(_0x356d3c[_0x35ad69][_0x5cd1('0x78')]in _0x5e30f5){contactItemTypes[_0x5cd1('0x1c')](_0x356d3c[_0x35ad69]);delete _0xab41e4[_0x356d3c[_0x35ad69]['name']];hasAdditionalPhones=!![];}for(var _0x476d35 in _0x5e30f5){if(_0x356d3c[_0x35ad69][_0x5cd1('0x78')]+_0x5cd1('0x79')===_0x476d35){phoneDescriptions[_0x5cd1('0x1c')]({'itemTypeId':_0x356d3c[_0x35ad69]['id'],'description':_0x476d35});delete _0xab41e4[_0x476d35];}}}if(hasAdditionalPhones)_0xab41e4[_0x5cd1('0x1a')]='';var _0xafb128=_[_0x5cd1('0x75')](_0xab41e4)[_0x5cd1('0x14')]();logger[_0x5cd1('0x58')](_0x5cd1('0x7a'),_0xafb128);fs[_0x5cd1('0x7b')](_0x2bfb2f,_0xafb128+'\x0a');Papa[_0x5cd1('0x7c')](fs['createReadStream'](_0x18788f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x30f3c4,_0x92a77d){try{for(var _0x3ebbcf=0x0,_0x23bf60=[];_0x3ebbcf<_0x30f3c4[_0x5cd1('0x7d')][_0x5cd1('0x1b')];_0x3ebbcf++){stats[_0x5cd1('0x7e')]+=0x1;if(_0x30f3c4[_0x5cd1('0x57')][_0x3ebbcf]){handleError(_0x30f3c4['data'][_0x3ebbcf],_0x30f3c4['errors'][_0x3ebbcf]);}else{var _0x565ad6=[];var _0x1e7369=[];var _0x25a661={};for(var _0x5d6b93 in _0x5e30f5){let _0x316677=contactItemTypes[_0x5cd1('0x7f')](_0x3b1b44=>_0x3b1b44['name']===_0x5d6b93);let _0x527474=contactItemTypes[_0x5cd1('0x7f')](_0x5c983f=>_0x5c983f[_0x5cd1('0x78')]+_0x5cd1('0x79')===_0x5d6b93);if(_[_0x5cd1('0x6a')](_0x316677)&&_[_0x5cd1('0x6a')](_0x527474)){if(_0x5e30f5['hasOwnProperty'](_0x5d6b93)){if(_0x30f3c4['data'][_0x3ebbcf][_0x5e30f5[_0x5d6b93]]){var _0x4f6b03=_[_0x5cd1('0x80')](_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf][_0x5e30f5[_0x5d6b93]][_0x5cd1('0x81')](/"/g,'\x27'));switch(_0x5d6b93){case _0x5cd1('0x2e'):var _0x566534=moment(_0x4f6b03,_0x5cd1('0x82'),!![]);if(_0x566534[_0x5cd1('0x83')]()){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');}else{_0x565ad6[_0x5cd1('0x1c')](_0x5cd1('0x84'));}break;case _0x5cd1('0x33'):var _0x54a5a5=parseInt(_0x4f6b03);_0x4f6b03=_['isNaN'](_0x54a5a5)||_0x54a5a5<0x0||_0x54a5a5>0x4?_0x1c8c12?0x3:0x2:_0x54a5a5;_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');break;case _0x5cd1('0x34'):var _0x7b7bc9=parseInt(_0x4f6b03);if(_['isNumber'](_0x7b7bc9)&&_[_0x5cd1('0x76')](_0x20c203,_0x7b7bc9)){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x7b7bc9+'\x22');}else{_0x565ad6['push'](_0x5cd1('0x85'));}break;case _0x5cd1('0x86'):if(isEmail(_0x4f6b03)){_0x23bf60['push']('\x22'+_0x4f6b03+'\x22');}else{_0x565ad6['push'](_0x5cd1('0x87'));}break;case'dateOfBirth':var _0x180b79=moment(_0x4f6b03,'YYYY-MM-DD',!![]);if(_0x180b79[_0x5cd1('0x83')]()){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');}else{_0x565ad6[_0x5cd1('0x1c')](_0x5cd1('0x88'));}break;case _0x5cd1('0x69'):var _0x23d0cd=shared[_0x5cd1('0x89')];var _0x39bbea=_0x23d0cd[_0x4f6b03];if(!_[_0x5cd1('0x6a')](_0x39bbea)){var _0x9a97ce=_0x39bbea['utcOffset'];_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x9a97ce+'\x22');}break;default:_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x4f6b03+'\x22');}}else{switch(_0x5d6b93){case _0x5cd1('0x8a'):case _0x5cd1('0x12'):_0x565ad6['push'](_0x5d6b93+_0x5cd1('0x8b'));break;default:_0x23bf60[_0x5cd1('0x1c')]('\x22\x22');}}}}else{var _0x141a47='';if(!_[_0x5cd1('0x6a')](_0x316677)){if(!_0x25a661[_0x5cd1('0x8c')](_0x316677['id'])){if(!_[_0x5cd1('0x6a')](_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf][_0x5e30f5[_0x5d6b93]])){var _0x4f6b03=_['trim'](_0x30f3c4['data'][_0x3ebbcf][_0x5e30f5[_0x5d6b93]][_0x5cd1('0x81')](/"/g,'\x27'));var _0x3b734f=phoneDescriptions['find'](_0x484bfa=>_0x484bfa['itemTypeId']===_0x316677['id']);if(!_['isNil'](_0x3b734f)){var _0x50d75f=_[_0x5cd1('0x80')](_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf][_0x5e30f5[_0x3b734f[_0x5cd1('0x8d')]]]['replace'](/"/g,'\x27'));if(!_[_0x5cd1('0x6a')](_0x50d75f))_0x4f6b03=_0x4f6b03+'§'+_0x50d75f;}if(_0x141a47=='')_0x141a47=_0x4f6b03;else _0x141a47+='|'+_0x4f6b03;}_0x1e7369[_0x5cd1('0x1c')](_0x316677['id']+':'+_0x141a47);_0x25a661[_0x316677['id']]=0x1;}}}}if(hasAdditionalPhones){_0x23bf60[_0x5cd1('0x1c')]('\x22'+_0x1e7369[_0x5cd1('0x14')](';')+'\x22');}if(_0x565ad6[_0x5cd1('0x1b')]){handleError(_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf],{'code':_0x5cd1('0x8e'),'message':_0x565ad6['join']()});}else{fs[_0x5cd1('0x8f')](_0x2bfb2f,_0x23bf60[_0x5cd1('0x14')]()+'\x0a');}_0x23bf60=[];}if(!(stats['rows']%0xc8)){socket[_0x5cd1('0x90')](_0x5cd1('0x91')+_0x897eef,stats);stats[_0x5cd1('0x57')]=[];}}if(stopped){logger[_0x5cd1('0x58')](_0x5cd1('0x92'));_0x92a77d[_0x5cd1('0x93')]();}}catch(_0x71c599){handleError(_0x30f3c4[_0x5cd1('0x7d')][_0x3ebbcf],{'code':_0x5cd1('0x94'),'message':_0x71c599[_0x5cd1('0x5d')]});logger[_0x5cd1('0x55')](_0x5cd1('0x95'),_0x71c599['message']);}},'complete':function(){try{var _0x25c2fc=[];var _0x2b82e8=[];var _0x3e58b1='cm_contacts';if(_0x589bba[_0x5cd1('0x96')]&&_0x589bba['duplicates']['length']){_0x3e58b1=_0x5cd1('0x97')+_0x897eef;_0x25c2fc[_0x5cd1('0x1c')](_0x5cd1('0x98')+_0x3e58b1+_0x5cd1('0x99'));}tmp_campaigns=_0x5cd1('0x9a')+_0x897eef;tmp_voice_queues=_0x5cd1('0x9b')+_0x897eef;_0x2b82e8[_0x5cd1('0x1c')](_0x5cd1('0x98')+tmp_campaigns+_0x5cd1('0x9c'));_0x2b82e8['push'](_0x5cd1('0x98')+tmp_voice_queues+_0x5cd1('0x9c'));BPromise[_0x5cd1('0x9d')](_0x2b82e8,handleTZQuery)['then'](function(_0x1b0a8e){updateTzCampaigns(_0x589bba[_0x5cd1('0x30')])['then'](function(_0x4bb74e){updateTzVoiceQueues(_0x589bba[_0x5cd1('0x30')])['then'](function(_0x29752d){if(hasTZ)_0xafb128=_0xafb128[_0x5cd1('0x81')](_0x5cd1('0x69'),_0x5cd1('0x9e'));var _0x1d92ad=util[_0x5cd1('0xf')](_0x5cd1('0x9f'),_0x2bfb2f,_0x3e58b1,_0xafb128,_0x589bba[_0x5cd1('0x30')],_0x589bba[_0x5cd1('0x4f')]||null,NOW,NOW);if(_[_0x5cd1('0x6a')](_0x5e30f5['scheduledat'])){_0x1d92ad+=_0x5cd1('0xa0');}_0x25c2fc[_0x5cd1('0x1c')](_0x1d92ad);if(_0x589bba[_0x5cd1('0x96')]&&_0x589bba['duplicates'][_0x5cd1('0x1b')]){_0x25c2fc[_0x5cd1('0x1c')](insertCmContact(_0x589bba[_0x5cd1('0x30')],_0x3e58b1,_0x589bba[_0x5cd1('0x96')],_0x5e30f5));_0x25c2fc[_0x5cd1('0x1c')](_0x5cd1('0xa1')+_0x3e58b1+';');}BPromise[_0x5cd1('0x9d')](_0x25c2fc,handleQuery)[_0x5cd1('0x1d')](function(_0x200e12){BPromise[_0x5cd1('0x1f')]([handleAdditionalPhones()])[_0x5cd1('0x1d')](function(){_0x25c2fc=[];for(var _0x5e60a0=0x0;_0x5e60a0_0x1f377[_0xacec('0x71')]===_0x7bf7f9);let _0x3a6633=contactItemTypes[_0xacec('0x78')](_0x3808ac=>_0x3808ac[_0xacec('0x71')]+_0xacec('0x72')===_0x7bf7f9);if(_['isNil'](_0x11447b)&&_[_0xacec('0x66')](_0x3a6633)){if(_0x28657a[_0xacec('0x79')](_0x7bf7f9)){if(_0x1102b5['data'][_0x323c34][_0x28657a[_0x7bf7f9]]){var _0x400817=_[_0xacec('0x7a')](_0x1102b5[_0xacec('0x76')][_0x323c34][_0x28657a[_0x7bf7f9]][_0xacec('0x7b')](/"/g,'\x27'));switch(_0x7bf7f9){case'scheduledat':var _0x2ce8f0=moment(_0x400817,_0xacec('0xe'),!![]);if(_0x2ce8f0[_0xacec('0x7c')]()){_0x153634[_0xacec('0x1b')]('\x22'+_0x400817+'\x22');}else{_0x2800ee['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x202ee1=parseInt(_0x400817);_0x400817=_['isNaN'](_0x202ee1)||_0x202ee1<0x0||_0x202ee1>0x4?_0x57cf93?0x3:0x2:_0x202ee1;_0x153634[_0xacec('0x1b')]('\x22'+_0x400817+'\x22');break;case'UserId':var _0x114515=parseInt(_0x400817);if(_[_0xacec('0x7d')](_0x114515)&&_[_0xacec('0x7e')](_0x5f1c5e,_0x114515)){_0x153634['push']('\x22'+_0x114515+'\x22');}else{_0x2800ee[_0xacec('0x1b')](_0xacec('0x7f'));}break;case _0xacec('0x80'):if(isEmail(_0x400817)){_0x153634[_0xacec('0x1b')]('\x22'+_0x400817+'\x22');}else{_0x2800ee[_0xacec('0x1b')](_0xacec('0x81'));}break;case _0xacec('0x82'):var _0x39cb98=moment(_0x400817,_0xacec('0x83'),!![]);if(_0x39cb98[_0xacec('0x7c')]()){_0x153634[_0xacec('0x1b')]('\x22'+_0x400817+'\x22');}else{_0x2800ee[_0xacec('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x22b32a=shared[_0xacec('0x64')];var _0x51d96d=_0x22b32a[_0x400817];if(!_[_0xacec('0x66')](_0x51d96d)){var _0x4d9089=_0x51d96d[_0xacec('0x67')];_0x153634[_0xacec('0x1b')]('\x22'+_0x400817+'\x22');_0x153634[_0xacec('0x1b')]('\x22'+_0x4d9089+'\x22');}break;default:_0x153634[_0xacec('0x1b')]('\x22'+_0x400817+'\x22');}}else{switch(_0x7bf7f9){case _0xacec('0x84'):case _0xacec('0x11'):_0x2800ee[_0xacec('0x1b')](_0x7bf7f9+_0xacec('0x85'));break;default:_0x153634['push']('\x22\x22');}}}}else{var _0x457b39='';if(!_[_0xacec('0x66')](_0x11447b)){if(!_0x4a020c[_0xacec('0x79')](_0x11447b['id'])){if(!_['isNil'](_0x1102b5[_0xacec('0x76')][_0x323c34][_0x28657a[_0x7bf7f9]])){var _0x400817=_[_0xacec('0x7a')](_0x1102b5[_0xacec('0x76')][_0x323c34][_0x28657a[_0x7bf7f9]][_0xacec('0x7b')](/"/g,'\x27'));var _0x5d02bf=phoneDescriptions[_0xacec('0x78')](_0x8adb20=>_0x8adb20[_0xacec('0x86')]===_0x11447b['id']);if(!_[_0xacec('0x66')](_0x5d02bf)){var _0x39ed2a=_['trim'](_0x1102b5[_0xacec('0x76')][_0x323c34][_0x28657a[_0x5d02bf[_0xacec('0x87')]]][_0xacec('0x7b')](/"/g,'\x27'));if(!_['isNil'](_0x39ed2a))_0x400817=_0x400817+'§'+_0x39ed2a;}if(_0x457b39=='')_0x457b39=_0x400817;else _0x457b39+='|'+_0x400817;}_0x456cbd[_0xacec('0x1b')](_0x11447b['id']+':'+_0x457b39);_0x4a020c[_0x11447b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x153634['push']('\x22'+_0x456cbd[_0xacec('0x13')](';')+'\x22');}if(_0x2800ee['length']){handleError(_0x1102b5[_0xacec('0x76')][_0x323c34],{'code':_0xacec('0x88'),'message':_0x2800ee[_0xacec('0x13')]()});}else{fs[_0xacec('0x89')](_0x5e0baa,_0x153634[_0xacec('0x13')]()+'\x0a');}_0x153634=[];}if(!(stats[_0xacec('0x77')]%0xc8)){socket[_0xacec('0x8a')]('contact:import:'+_0x4d792a,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xacec('0x8b'));_0x287529['abort']();}}catch(_0x45c231){handleError(_0x1102b5[_0xacec('0x76')][_0x323c34],{'code':_0xacec('0x8c'),'message':_0x45c231[_0xacec('0x59')]});logger[_0xacec('0x58')](_0xacec('0x8d'),_0x45c231[_0xacec('0x59')]);}},'complete':function(){try{var _0x13b2c6=[];var _0x3a398e=[];var _0x6b8314='cm_contacts';if(_0x4f2926[_0xacec('0x8e')]&&_0x4f2926[_0xacec('0x8e')]['length']){_0x6b8314=_0xacec('0x8f')+_0x4d792a;_0x13b2c6['push']('CREATE\x20TABLE\x20'+_0x6b8314+_0xacec('0x90'));}tmp_campaigns=_0xacec('0x91')+_0x4d792a;tmp_voice_queues=_0xacec('0x92')+_0x4d792a;_0x3a398e[_0xacec('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xacec('0x93'));_0x3a398e[_0xacec('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xacec('0x93'));BPromise[_0xacec('0x94')](_0x3a398e,handleTZQuery)[_0xacec('0x19')](function(_0x127ed7){updateTzCampaigns(_0x4f2926['ListId'])['then'](function(_0x3e8498){updateTzVoiceQueues(_0x4f2926[_0xacec('0x3f')])[_0xacec('0x19')](function(_0x1d818c){if(hasTZ)_0x57fb94=_0x57fb94['replace']('dialTimezone','dialTimezone,utcOffset');var _0x59ac42=util['format'](_0xacec('0x95'),_0x5e0baa,_0x6b8314,_0x57fb94,_0x4f2926[_0xacec('0x3f')],_0x4f2926[_0xacec('0x4c')]||null,NOW,NOW);if(_[_0xacec('0x66')](_0x28657a[_0xacec('0x96')])){_0x59ac42+=',\x20scheduledAt\x20=\x20NOW()';}_0x13b2c6['push'](_0x59ac42);if(_0x4f2926[_0xacec('0x8e')]&&_0x4f2926[_0xacec('0x8e')][_0xacec('0x1a')]){_0x13b2c6[_0xacec('0x1b')](insertCmContact(_0x4f2926[_0xacec('0x3f')],_0x6b8314,_0x4f2926[_0xacec('0x8e')],_0x28657a));_0x13b2c6[_0xacec('0x1b')](_0xacec('0x97')+_0x6b8314+';');}BPromise[_0xacec('0x94')](_0x13b2c6,handleQuery)[_0xacec('0x19')](function(_0x2d3cf1){BPromise[_0xacec('0x1c')]([handleAdditionalPhones()])[_0xacec('0x19')](function(){_0x13b2c6=[];for(var _0x268741=0x0;_0x268741\x20\x20');}var _0x100c9c=path[_0xacec('0x13')](config[_0xacec('0xa4')],_0xacec('0xa5'),process[_0xacec('0xa3')][0x2]);if(!fs[_0xacec('0xa6')](_0x100c9c)){throw new Error(_0xacec('0xa7'));}var _0xb75511={};try{_0xb75511=JSON[_0xacec('0x75')](process[_0xacec('0xa3')][0x3]);if(!_0xb75511['binding']){throw new Error(_0xacec('0xa8'));}if(!_0xb75511['binding'][_0xacec('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0xb75511[_0xacec('0x6c')]['firstName']){throw new Error(_0xacec('0xa9'));}var _0x4fb5d9=0x0;if(_0xb75511[_0xacec('0x6c')][_0xacec('0x2e')]){_0x4fb5d9=0x1;}if(!_0xb75511[_0xacec('0x3f')]){throw new Error(_0xacec('0xaa'));}}catch(_0x164d7c){throw new Error(_0xacec('0xab'));}var _0x1dd873=[];try{_0x1dd873=_[_0xacec('0xac')](JSON[_0xacec('0x75')](process[_0xacec('0xa3')][0x4]),'id');}catch(_0xbff49a){logger[_0xacec('0x55')](_0xacec('0xad'));}main(_0x100c9c,_0xb75511,_0x1dd873,_0x4fb5d9);}validate();process['on'](_0xacec('0xae'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index c3e2a95..d5d9897 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c50=['errors','data','find','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','description','replace','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','defaults','redis','socket.io-emitter','format','cm_contacts_temp_','test','select','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','phone','AdditionalPhones','push','all','then','catch','error','message','isNil','split','CmContactHasItem','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','insert','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','code','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','findAll','name','_description','header','parse','createReadStream','rows'];(function(_0x48ca1b,_0x107936){var _0x2258c2=function(_0x164b55){while(--_0x164b55){_0x48ca1b['push'](_0x48ca1b['shift']());}};_0x2258c2(++_0x107936);}(_0x8c50,0xcd));var _0x08c5=function(_0x268c91,_0x3b3f17){_0x268c91=_0x268c91-0x0;var _0x546b80=_0x8c50[_0x268c91];return _0x546b80;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x08c5('0x0'));var Papa=require(_0x08c5('0x1'));var util=require('util');var BPromise=require(_0x08c5('0x2'));var moment=require(_0x08c5('0x3'));var squel=require(_0x08c5('0x4'));var Redis=require(_0x08c5('0x5'));var db=require(_0x08c5('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x08c5('0x7'))('import');config['redis']=_[_0x08c5('0x8')](config[_0x08c5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x08c5('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x08c5('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x08c5('0xc')+moment()[_0x08c5('0xb')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x200935){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))*$/[_0x08c5('0xd')](_0x200935);}function selectNotIn(_0x472dba,_0x20d6b8,_0x11ef4b,_0x18c9a1,_0x41a1aa){return squel[_0x08c5('0xe')]()['field']('phone')[_0x08c5('0xf')](_0x18c9a1)[_0x08c5('0x10')](_0x20d6b8,null,_0x20d6b8+_0x08c5('0x11')+_0x18c9a1+'.'+_0x11ef4b)[_0x08c5('0x12')](_0x18c9a1+'.'+_0x11ef4b+'\x20=\x20'+_0x472dba+'.'+_0x11ef4b)[_0x08c5('0x12')](_0x20d6b8+_0x08c5('0x13')+_0x41a1aa[_0x08c5('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3e6a76,_0x431628){promisesAdditionalPhones=[];promisesContact=[];return db[_0x08c5('0x14')][_0x08c5('0x15')]('select\x20*\x20from\x20'+tempTableName)[_0x08c5('0x16')](function(_0x5c5db0){if(_0x5c5db0!==null){var _0xa589ce=[];for(var _0xc08175=0x0;_0xc08175<_0x5c5db0[_0x08c5('0x17')];_0xc08175++){var _0x30f727=_0x5c5db0[_0xc08175];if(!_['isNil'](_0x30f727[_0x08c5('0x18')])){if(!_['isNil'](_0x30f727[_0x08c5('0x19')]))_0xa589ce[_0x08c5('0x1a')](insertAdditionalPhones(_0x30f727));promisesContact[_0x08c5('0x1a')]({'contact':_0x30f727});}}}Promise[_0x08c5('0x1b')](_0xa589ce)[_0x08c5('0x1c')](function(){_0x3e6a76({'val':0x1});});})[_0x08c5('0x1d')](function(_0xb6b966){logger[_0x08c5('0x1e')](_0xb6b966[_0x08c5('0x1f')]);});});}function insertAdditionalPhones(_0x2e155c){return new Promise(function(_0x65bf0a,_0x273e7e){var _0xa0fe5e=_0x2e155c['AdditionalPhones'];if(_[_0x08c5('0x20')](_0xa0fe5e))_0x273e7e({'val':0x0});else{var _0x183842=_0xa0fe5e[_0x08c5('0x21')](';');var _0x490a9c=[];orderBy=0x0;for(var _0x187734=0x0;_0x187734<_0x183842[_0x08c5('0x17')];_0x187734++){_0x490a9c['push'](splitAdditionalPhone(_0x2e155c['id'],_0x183842[_0x187734]));}Promise[_0x08c5('0x1b')](_0x490a9c)[_0x08c5('0x1c')](function(){_0x65bf0a({'val':_0x183842[_0x08c5('0x17')]});});}});}function splitAdditionalPhone(_0x53ff91,_0x24f1e6){return new Promise(function(_0x1b1bfb,_0x36c109){var _0x51b761=_0x24f1e6[_0x08c5('0x21')](':');var _0x4bbf24=_0x51b761[0x0];var _0xdd372e=_0x51b761[0x1];if(_0xdd372e!==''){var _0x388db4=_0xdd372e[_0x08c5('0x21')]('|');var _0x5490e7=[];for(var _0x43d950=0x0;_0x43d950<_0x388db4[_0x08c5('0x17')];_0x43d950++){if(_0x388db4[_0x43d950]!==''){var _0x1b65e4=_['filter'](promisesAdditionalPhones,{'contactId':_0x53ff91,'phone':_0x388db4[_0x43d950]});if(_0x1b65e4['length']==0x0){orderBy++;promisesAdditionalPhones[_0x08c5('0x1a')]({'contactId':_0x53ff91,'contactTypeId':_0x4bbf24,'phone':_0x388db4[_0x43d950],'orderBy':orderBy});}}}_0x1b1bfb({'ok':0x1});}else _0x1b1bfb({'res':0x0});});}function createAdditionalPhone(_0x22c96,_0x4a1e1c,_0x4b78b3,_0x17b115){var _0x54a559='';var _0x3b3aff='';var _0x3b84c3=_0x4b78b3[_0x08c5('0x21')]('§');_0x54a559=_0x3b84c3[0x0];if(_0x3b84c3[_0x08c5('0x17')]==0x2)_0x3b3aff=_0x3b84c3[0x1];return new Promise(function(_0x4d0193,_0x277897){return db[_0x08c5('0x22')]['findOne']({'where':{'CmContactId':_0x22c96,'item':_0x54a559}})[_0x08c5('0x1c')](function(_0x10f054){if(_0x10f054){return db[_0x08c5('0x22')][_0x08c5('0x23')]({'ItemTypeId':_0x4a1e1c,'description':_0x3b3aff,'OrderBy':_0x17b115},{'where':{'CmContactId':_0x22c96,'item':_0x54a559}})[_0x08c5('0x1c')](function(_0x1d6f34){_0x4d0193({'res':'updated'});});}else{return db[_0x08c5('0x22')][_0x08c5('0x24')]({'CmContactId':_0x22c96,'item':_0x54a559,'ItemTypeId':_0x4a1e1c,'description':_0x3b3aff,'OrderBy':_0x17b115,'ItemClass':_0x08c5('0x25')})[_0x08c5('0x1c')](function(_0x145add){_0x4d0193({'res':_0x08c5('0x26')});});}});});}function updateContact(_0x1434b0){return new Promise(function(_0x3b0c80,_0x5bfcc6){var _0x5dfb26=_0x1434b0['id'];delete _0x1434b0['id'];return db[_0x08c5('0x27')][_0x08c5('0x23')](_0x1434b0,{'where':{'id':_0x5dfb26}})[_0x08c5('0x1c')](function(_0xa91fb0){updatedRows+=0x1;return db[_0x08c5('0x28')][_0x08c5('0x23')]({'phone':_0x1434b0[_0x08c5('0x18')]},{'where':{'ContactId':_0x5dfb26}})[_0x08c5('0x1c')](function(_0x5c5e67){_0x3b0c80({'ret':'OK'});});});});}function insertCmHopper(_0x34a048,_0x254bc6,_0x4a7b36,_0x4f29f6,_0x48b587){var _0x1dc264=[_0x08c5('0x29'),_0x08c5('0x2a'),_0x08c5('0x2b'),_0x08c5('0x2c'),_0x254bc6+'.'+_0x4f29f6,_0x08c5('0x2d'),_0x08c5('0x2e'),_0x08c5('0x2f'),_0x08c5('0x30'),'\x22'+_0x48b587+'\x22'];return squel['insert']()[_0x08c5('0x31')](_0x08c5('0x32'))[_0x08c5('0x33')](['phone',_0x08c5('0x34'),_0x08c5('0x35'),_0x08c5('0x36'),_0x4f29f6,_0x08c5('0x37'),_0x08c5('0x38'),'priority',_0x08c5('0x39'),_0x08c5('0x3a')],squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x1dc264)[_0x08c5('0xf')](_0x254bc6)[_0x08c5('0x10')](_0x08c5('0x3c'),null,_0x08c5('0x3d')+_0x254bc6+_0x08c5('0x3e'))['join'](_0x4a7b36,null,_0x4a7b36+'.id\x20=\x20'+_0x254bc6+'.'+_0x4f29f6)[_0x08c5('0x12')](_0x254bc6+_0x08c5('0x3f'),_0x34a048)[_0x08c5('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x08c5('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x254bc6,_0x4a7b36,_0x4f29f6,_0x08c5('0x32'),['\x22always\x22',_0x08c5('0x40')]))[_0x08c5('0x12')](_0x08c5('0x41'),selectNotIn(_0x254bc6,_0x4a7b36,_0x4f29f6,_0x08c5('0x32'),[_0x08c5('0x42')])))[_0x08c5('0x43')]();}function insertCmHopperBlack(_0xf0f65f,_0x29cbf6,_0x3bcfaa,_0x29b2b5){var _0x33f407=[_0x08c5('0x29'),_0x08c5('0x2b'),'cm_contacts.ListId',_0x29cbf6+'.'+_0x29b2b5,_0x08c5('0x2d'),_0x08c5('0x2e')];return squel[_0x08c5('0x44')]()[_0x08c5('0x31')](_0x08c5('0x45'))['fromQuery']([_0x08c5('0x18'),_0x08c5('0x35'),'ListId',_0x29b2b5,_0x08c5('0x37'),_0x08c5('0x38')],squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x33f407)[_0x08c5('0xf')](_0x29cbf6)[_0x08c5('0x10')](_0x08c5('0x3c'),null,_0x08c5('0x3d')+_0x29cbf6+_0x08c5('0x3e'))[_0x08c5('0x10')](_0x3bcfaa,null,_0x3bcfaa+_0x08c5('0x11')+_0x29cbf6+'.'+_0x29b2b5)['where'](_0x29cbf6+_0x08c5('0x3f'),_0xf0f65f)[_0x08c5('0x12')](_0x08c5('0x46'),NOW)['where'](_0x08c5('0x41'),squel[_0x08c5('0xe')]()[_0x08c5('0x47')](_0x08c5('0x18'))[_0x08c5('0xf')](_0x08c5('0x45'))['where'](_0x08c5('0x48'),_0xf0f65f)['where'](_0x29b2b5+'\x20=\x20?',_0x29cbf6+'.'+_0x29b2b5)))[_0x08c5('0x43')]();}function insertCmHopperAdditionalPhones(_0x354306){var _0x4ca47a=[_0x08c5('0x49'),'cm_contact_has_items.item',_0x08c5('0x4a'),'cm_contact_has_items.createdAt',_0x08c5('0x4b')];return squel[_0x08c5('0x44')]()[_0x08c5('0x31')](_0x08c5('0x4c'))[_0x08c5('0x33')]([_0x08c5('0x4d'),_0x08c5('0x18'),_0x08c5('0x4e'),_0x08c5('0x37'),_0x08c5('0x38')],squel['select']()[_0x08c5('0x3b')](_0x4ca47a)[_0x08c5('0xf')](_0x08c5('0x32'))[_0x08c5('0x10')](_0x08c5('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x08c5('0x10')](_0x08c5('0x4f'),null,_0x08c5('0x50'))[_0x08c5('0x12')](_0x08c5('0x51'),_0x354306)['where'](_0x08c5('0x46'),NOW))[_0x08c5('0x43')]();}function insertCmContact(_0x36ea43,_0x111c77,_0x201dac,_0x255e2e){var _0x5c04ba=_['concat'](_[_0x08c5('0x52')](_0x255e2e),[_0x08c5('0x36'),'CompanyId','createdAt',_0x08c5('0x38')]);return squel[_0x08c5('0x44')]()[_0x08c5('0x31')](_0x08c5('0x3c'))[_0x08c5('0x33')](_0x5c04ba,squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x5c04ba)[_0x08c5('0xf')](_0x111c77)[_0x08c5('0x12')]('('+_0x201dac[_0x08c5('0x10')](',')+_0x08c5('0x53'),squel[_0x08c5('0xe')]()[_0x08c5('0x3b')](_0x201dac)[_0x08c5('0xf')]('cm_contacts')[_0x08c5('0x12')](_0x08c5('0x48'),_0x36ea43))[_0x08c5('0x12')](_0x08c5('0x54'),squel[_0x08c5('0xe')]()[_0x08c5('0x47')](_0x08c5('0x55'),_0x08c5('0x56'))[_0x08c5('0xf')](_0x111c77)[_0x08c5('0x57')](_0x201dac[_0x08c5('0x10')](','))))[_0x08c5('0x43')]();}function handleStop(){logger[_0x08c5('0x58')](_0x08c5('0x59'));stopped=!![];}function handleUncaughtException(_0x1b04b6){logger['error'](_0x1b04b6[_0x08c5('0x1f')]);process[_0x08c5('0x5a')](0x1);}function handleError(_0x3a36f3,_0x1dc369){stats['errors'][_0x08c5('0x1a')]({'name':_0x1dc369[_0x08c5('0x5b')],'message':_0x1dc369['message'],'row':_0x3a36f3});}function handleQuery(_0x23f0e4){logger['info'](_0x23f0e4);return db['sequelize'][_0x08c5('0x15')](_0x23f0e4)[_0x08c5('0x16')](function(_0x7e9c82){results['push'](_0x7e9c82);})[_0x08c5('0x1d')](function(_0x2ad27e){logger[_0x08c5('0x1e')](_0x2ad27e[_0x08c5('0x1f')]);});}function main(_0x371759,_0xd28366,_0x2fd8d6,_0x21e3b5){logger[_0x08c5('0x58')](_0x08c5('0x5c'),_0x371759,JSON['stringify'](_0xd28366));process[_0x08c5('0x5d')](_0x08c5('0x5e'));var _0x18357c=_0xd28366[_0x08c5('0x5f')];var _0x8f6923=_[_0x08c5('0x60')](_0x18357c);var _0x36d94e=_0xd28366[_0x08c5('0x61')];var _0x150acb=path['join'](config[_0x08c5('0x62')],_0x08c5('0x63'),_0x36d94e+_0x08c5('0x64'));logger['info']('body',_0xd28366);db[_0x08c5('0x65')][_0x08c5('0x66')]({'raw':!![],'attributes':['id',_0x08c5('0x67')]})['then'](function(_0x1dc988){for(var _0xd1f943=0x0;_0xd1f943<_0x1dc988[_0x08c5('0x17')];_0xd1f943++){if(_0x1dc988[_0xd1f943]['name']in _0x18357c){contactItemTypes[_0x08c5('0x1a')](_0x1dc988[_0xd1f943]);delete _0x8f6923[_0x1dc988[_0xd1f943][_0x08c5('0x67')]];hasAdditionalPhones=!![];}for(var _0x42c593 in _0x18357c){if(_0x1dc988[_0xd1f943][_0x08c5('0x67')]+_0x08c5('0x68')===_0x42c593){phoneDescriptions['push']({'itemTypeId':_0x1dc988[_0xd1f943]['id'],'description':_0x42c593});delete _0x8f6923[_0x42c593];}}}if(hasAdditionalPhones)_0x8f6923[_0x08c5('0x19')]='';var _0x187b69=_['keys'](_0x8f6923)[_0x08c5('0x10')]();logger[_0x08c5('0x58')](_0x08c5('0x69'),_0x187b69);fs['writeFileSync'](_0x150acb,_0x187b69+'\x0a');Papa[_0x08c5('0x6a')](fs[_0x08c5('0x6b')](_0x371759),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a62ab,_0x3dd0fe){try{for(var _0x29580b=0x0,_0x384c90=[];_0x29580b<_0x2a62ab['data'][_0x08c5('0x17')];_0x29580b++){stats[_0x08c5('0x6c')]+=0x1;if(_0x2a62ab[_0x08c5('0x6d')][_0x29580b]){handleError(_0x2a62ab[_0x08c5('0x6e')][_0x29580b],_0x2a62ab[_0x08c5('0x6d')][_0x29580b]);}else{var _0x33460f=[];var _0x273c93=[];var _0x2e2ef0={};for(var _0x26eb31 in _0x18357c){let _0x3e8396=contactItemTypes[_0x08c5('0x6f')](_0x2bc01e=>_0x2bc01e[_0x08c5('0x67')]===_0x26eb31);let _0x59c90d=contactItemTypes[_0x08c5('0x6f')](_0x4880ba=>_0x4880ba[_0x08c5('0x67')]+_0x08c5('0x68')===_0x26eb31);if(_['isNil'](_0x3e8396)&&_[_0x08c5('0x20')](_0x59c90d)){if(_0x18357c[_0x08c5('0x70')](_0x26eb31)){if(_0x2a62ab[_0x08c5('0x6e')][_0x29580b][_0x18357c[_0x26eb31]]){var _0x5c21d7=_[_0x08c5('0x71')](_0x2a62ab['data'][_0x29580b][_0x18357c[_0x26eb31]]['replace'](/"/g,'\x27'));switch(_0x26eb31){case _0x08c5('0x34'):var _0x5160f1=moment(_0x5c21d7,_0x08c5('0x72'),!![]);if(_0x5160f1[_0x08c5('0x73')]()){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');}else{_0x33460f[_0x08c5('0x1a')](_0x08c5('0x74'));}break;case _0x08c5('0x75'):var _0x313806=parseInt(_0x5c21d7);_0x5c21d7=_[_0x08c5('0x76')](_0x313806)||_0x313806<0x0||_0x313806>0x4?_0x21e3b5?0x3:0x2:_0x313806;_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');break;case _0x08c5('0x39'):var _0x3071e5=parseInt(_0x5c21d7);if(_[_0x08c5('0x77')](_0x3071e5)&&_[_0x08c5('0x78')](_0x2fd8d6,_0x3071e5)){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x3071e5+'\x22');}else{_0x33460f['push'](_0x08c5('0x79'));}break;case'email':if(isEmail(_0x5c21d7)){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');}else{_0x33460f['push'](_0x08c5('0x7a'));}break;case _0x08c5('0x7b'):var _0x253bd5=moment(_0x5c21d7,_0x08c5('0x7c'),!![]);if(_0x253bd5[_0x08c5('0x73')]()){_0x384c90[_0x08c5('0x1a')]('\x22'+_0x5c21d7+'\x22');}else{_0x33460f[_0x08c5('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x384c90['push']('\x22'+_0x5c21d7+'\x22');}}else{switch(_0x26eb31){case _0x08c5('0x7d'):case _0x08c5('0x18'):_0x33460f[_0x08c5('0x1a')](_0x26eb31+'\x20not\x20specified');break;default:_0x384c90[_0x08c5('0x1a')]('\x22\x22');}}}}else{var _0x2701a8='';if(!_['isNil'](_0x3e8396)){if(!_0x2e2ef0[_0x08c5('0x70')](_0x3e8396['id'])){for(var _0x693d3f=0x0;_0x693d3f<_0x18357c[_0x26eb31]['length'];_0x693d3f++){var _0x5c21d7=_[_0x08c5('0x71')](_0x2a62ab['data'][_0x29580b][_0x18357c[_0x26eb31][_0x693d3f]]['replace'](/"/g,'\x27'));var _0x2c3492=phoneDescriptions[_0x08c5('0x6f')](_0x58af85=>_0x58af85['itemTypeId']===_0x3e8396['id']);if(!_[_0x08c5('0x20')](_0x2c3492)){var _0x112a70=_[_0x08c5('0x71')](_0x2a62ab[_0x08c5('0x6e')][_0x29580b][_0x18357c[_0x2c3492[_0x08c5('0x7e')]][0x0]][_0x08c5('0x7f')](/"/g,'\x27'));if(!_[_0x08c5('0x20')](_0x112a70))_0x5c21d7=_0x5c21d7+'§'+_0x112a70;}if(_0x2701a8=='')_0x2701a8=_0x5c21d7;else _0x2701a8+='|'+_0x5c21d7;}_0x273c93[_0x08c5('0x1a')](_0x3e8396['id']+':'+_0x2701a8);_0x2e2ef0[_0x3e8396['id']]=0x1;}}}}if(hasAdditionalPhones){_0x384c90['push']('\x22'+_0x273c93[_0x08c5('0x10')](';')+'\x22');}if(_0x33460f[_0x08c5('0x17')]){handleError(_0x2a62ab[_0x08c5('0x6e')][_0x29580b],{'code':'SystemRow','message':_0x33460f['join']()});}else{fs['appendFileSync'](_0x150acb,_0x384c90[_0x08c5('0x10')]()+'\x0a');}_0x384c90=[];}if(!(stats[_0x08c5('0x6c')]%0xc8)){socket['emit'](_0x08c5('0x80')+_0x36d94e,stats);stats[_0x08c5('0x6d')]=[];}}if(stopped){logger[_0x08c5('0x58')](_0x08c5('0x81'));_0x3dd0fe['abort']();}}catch(_0x2c969e){handleError(_0x2a62ab[_0x08c5('0x6e')][_0x29580b],{'code':_0x08c5('0x82'),'message':_0x2c969e[_0x08c5('0x1f')]});logger[_0x08c5('0x1e')](_0x08c5('0x83'),_0x2c969e[_0x08c5('0x1f')]);}},'complete':function(){try{var _0x575651=[];var _0x32529a=tempTableName;_0x575651[_0x08c5('0x1a')](_0x08c5('0x84')+_0x32529a+_0x08c5('0x85'));logger['info'](_0x08c5('0x86'),contactItemTypes[_0x08c5('0x17')]);var _0x5b4de9=util[_0x08c5('0xb')](_0x08c5('0x87'),_0x150acb,_0x32529a,_0x187b69,_0xd28366[_0x08c5('0x36')],_0xd28366[_0x08c5('0x88')]||null,NOW,NOW);if(_[_0x08c5('0x20')](_0x18357c[_0x08c5('0x34')])){_0x5b4de9+=_0x08c5('0x89');}_0x575651[_0x08c5('0x1a')](_0x5b4de9);BPromise['each'](_0x575651,handleQuery)[_0x08c5('0x1c')](function(_0x46d55c){BPromise[_0x08c5('0x1b')]([handleAdditionalPhones()])[_0x08c5('0x1c')](function(){_0x575651=[];for(var _0x2c74b6=0x0;_0x2c74b6\x20\x20','existsSync','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','moment','../../../mysqldb','../../../config/environment','../../../config/logger','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','updated','PHONE','inserted','CmContact','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId'];(function(_0x214a7b,_0x5d9608){var _0x157eb1=function(_0x3b9e5a){while(--_0x3b9e5a){_0x214a7b['push'](_0x214a7b['shift']());}};_0x157eb1(++_0x5d9608);}(_0x2ca5,0x108));var _0x52ca=function(_0x3d773f,_0x3462b3){_0x3d773f=_0x3d773f-0x0;var _0x22bf3a=_0x2ca5[_0x3d773f];return _0x22bf3a;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x52ca('0x0'));var Papa=require(_0x52ca('0x1'));var util=require(_0x52ca('0x2'));var BPromise=require('bluebird');var moment=require(_0x52ca('0x3'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x52ca('0x4'))['db'];var config=require(_0x52ca('0x5'));var logger=require(_0x52ca('0x6'))('import');config['redis']=_['defaults'](config[_0x52ca('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52ca('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x52ca('0x8')](_0x52ca('0x9'));var tempTableName=_0x52ca('0xa')+moment()[_0x52ca('0x8')](_0x52ca('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x20a129){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'](_0x20a129);}function selectNotIn(_0x431308,_0x11fedc,_0x278f12,_0x492021,_0x2d0e25){return squel[_0x52ca('0xc')]()[_0x52ca('0xd')](_0x52ca('0xe'))['from'](_0x492021)[_0x52ca('0xf')](_0x11fedc,null,_0x11fedc+_0x52ca('0x10')+_0x492021+'.'+_0x278f12)[_0x52ca('0x11')](_0x492021+'.'+_0x278f12+_0x52ca('0x12')+_0x431308+'.'+_0x278f12)[_0x52ca('0x11')](_0x11fedc+_0x52ca('0x13')+_0x2d0e25[_0x52ca('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x42ec50,_0x36d0e8){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0x52ca('0x14')+tempTableName)[_0x52ca('0x15')](function(_0x10f302){if(_0x10f302!==null){var _0x8d230=[];for(var _0xe88ca7=0x0;_0xe88ca7<_0x10f302[_0x52ca('0x16')];_0xe88ca7++){var _0x31cc2b=_0x10f302[_0xe88ca7];if(!_[_0x52ca('0x17')](_0x31cc2b[_0x52ca('0xe')])){if(!_[_0x52ca('0x17')](_0x31cc2b[_0x52ca('0x18')]))_0x8d230['push'](insertAdditionalPhones(_0x31cc2b));promisesContact[_0x52ca('0x19')]({'contact':_0x31cc2b});}}}Promise[_0x52ca('0x1a')](_0x8d230)[_0x52ca('0x1b')](function(){_0x42ec50({'val':0x1});});})[_0x52ca('0x1c')](function(_0x3fc685){logger[_0x52ca('0x1d')](_0x3fc685[_0x52ca('0x1e')]);});});}function insertAdditionalPhones(_0x3a19a9){return new Promise(function(_0x41f4f3,_0x9b383a){var _0x4492ca=_0x3a19a9['AdditionalPhones'];if(_[_0x52ca('0x17')](_0x4492ca))_0x9b383a({'val':0x0});else{var _0x140020=_0x4492ca[_0x52ca('0x1f')](';');var _0x1e5d58=[];orderBy=0x0;for(var _0x42bf69=0x0;_0x42bf69<_0x140020[_0x52ca('0x16')];_0x42bf69++){_0x1e5d58[_0x52ca('0x19')](splitAdditionalPhone(_0x3a19a9['id'],_0x140020[_0x42bf69]));}Promise['all'](_0x1e5d58)[_0x52ca('0x1b')](function(){_0x41f4f3({'val':_0x140020[_0x52ca('0x16')]});});}});}function splitAdditionalPhone(_0x3719ad,_0x18f919){return new Promise(function(_0x4e6e3d,_0x26daa1){var _0x350316=_0x18f919[_0x52ca('0x1f')](':');var _0x54b05e=_0x350316[0x0];var _0x4f9ed4=_0x350316[0x1];if(_0x4f9ed4!==''){var _0x303464=_0x4f9ed4['split']('|');var _0x27cc1f=[];for(var _0x1b67d8=0x0;_0x1b67d8<_0x303464['length'];_0x1b67d8++){if(_0x303464[_0x1b67d8]!==''){var _0x15649c=_[_0x52ca('0x20')](promisesAdditionalPhones,{'contactId':_0x3719ad,'phone':_0x303464[_0x1b67d8]});if(_0x15649c[_0x52ca('0x16')]==0x0){orderBy++;promisesAdditionalPhones[_0x52ca('0x19')]({'contactId':_0x3719ad,'contactTypeId':_0x54b05e,'phone':_0x303464[_0x1b67d8],'orderBy':orderBy});}}}_0x4e6e3d({'ok':0x1});}else _0x4e6e3d({'res':0x0});});}function createAdditionalPhone(_0x52016d,_0x37b938,_0x3133c3,_0x551dea){var _0x4e9a2a='';var _0x25ea10='';var _0x55f177=_0x3133c3[_0x52ca('0x1f')]('§');_0x4e9a2a=_0x55f177[0x0];if(_0x55f177[_0x52ca('0x16')]==0x2)_0x25ea10=_0x55f177[0x1];return new Promise(function(_0x44a266,_0x38c00d){return db[_0x52ca('0x21')][_0x52ca('0x22')]({'where':{'CmContactId':_0x52016d,'item':_0x4e9a2a}})[_0x52ca('0x1b')](function(_0x2be835){if(_0x2be835){return db[_0x52ca('0x21')]['update']({'ItemTypeId':_0x37b938,'description':_0x25ea10,'OrderBy':_0x551dea},{'where':{'CmContactId':_0x52016d,'item':_0x4e9a2a}})[_0x52ca('0x1b')](function(_0x1fd8d0){_0x44a266({'res':_0x52ca('0x23')});});}else{return db[_0x52ca('0x21')]['create']({'CmContactId':_0x52016d,'item':_0x4e9a2a,'ItemTypeId':_0x37b938,'description':_0x25ea10,'OrderBy':_0x551dea,'ItemClass':_0x52ca('0x24')})[_0x52ca('0x1b')](function(_0x1292fc){_0x44a266({'res':_0x52ca('0x25')});});}});});}function updateContact(_0x32dad3){return new Promise(function(_0x54cb4b,_0x2e8b81){var _0x272587=_0x32dad3['id'];delete _0x32dad3['id'];return db[_0x52ca('0x26')][_0x52ca('0x27')](_0x32dad3,{'where':{'id':_0x272587}})[_0x52ca('0x1b')](function(_0x5ed313){updatedRows+=0x1;return db[_0x52ca('0x28')][_0x52ca('0x27')]({'phone':_0x32dad3[_0x52ca('0xe')]},{'where':{'ContactId':_0x272587}})[_0x52ca('0x1b')](function(_0x29e2c2){_0x54cb4b({'ret':'OK'});});});});}function insertCmHopper(_0x22a3a9,_0xd64c1f,_0x5b0a12,_0x3d1148,_0x5e5153){var _0x32e64c=[_0x52ca('0x29'),_0x52ca('0x2a'),_0x52ca('0x2b'),_0x52ca('0x2c'),_0xd64c1f+'.'+_0x3d1148,'cm_contacts.createdAt',_0x52ca('0x2d'),_0x52ca('0x2e'),_0x52ca('0x2f'),'\x22'+_0x5e5153+'\x22'];return squel['insert']()[_0x52ca('0x30')](_0x52ca('0x31'))[_0x52ca('0x32')]([_0x52ca('0xe'),_0x52ca('0x33'),_0x52ca('0x34'),'ListId',_0x3d1148,_0x52ca('0x35'),_0x52ca('0x36'),'priority',_0x52ca('0x37'),_0x52ca('0x38')],squel[_0x52ca('0xc')]()[_0x52ca('0x39')](_0x32e64c)[_0x52ca('0x3a')](_0xd64c1f)[_0x52ca('0xf')](_0x52ca('0x3b'),null,_0x52ca('0x3c')+_0xd64c1f+_0x52ca('0x3d'))['join'](_0x5b0a12,null,_0x5b0a12+_0x52ca('0x10')+_0xd64c1f+'.'+_0x3d1148)['where'](_0xd64c1f+_0x52ca('0x3e'),_0x22a3a9)[_0x52ca('0x11')](_0x52ca('0x3f'),NOW)[_0x52ca('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xd64c1f,_0x5b0a12,_0x3d1148,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x52ca('0x11')](_0x52ca('0x40'),selectNotIn(_0xd64c1f,_0x5b0a12,_0x3d1148,_0x52ca('0x31'),[_0x52ca('0x41')])))['toString']();}function insertCmHopperBlack(_0x5b4139,_0x1e8d16,_0x2c5787,_0xd756d9){var _0x2afa53=[_0x52ca('0x29'),_0x52ca('0x2b'),_0x52ca('0x2c'),_0x1e8d16+'.'+_0xd756d9,_0x52ca('0x42'),_0x52ca('0x2d')];return squel[_0x52ca('0x43')]()[_0x52ca('0x30')]('cm_hopper_black')[_0x52ca('0x32')](['phone','ContactId',_0x52ca('0x44'),_0xd756d9,_0x52ca('0x35'),_0x52ca('0x36')],squel['select']()[_0x52ca('0x39')](_0x2afa53)[_0x52ca('0x3a')](_0x1e8d16)[_0x52ca('0xf')](_0x52ca('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x1e8d16+_0x52ca('0x3d'))[_0x52ca('0xf')](_0x2c5787,null,_0x2c5787+'.id\x20=\x20'+_0x1e8d16+'.'+_0xd756d9)[_0x52ca('0x11')](_0x1e8d16+'.CmListId\x20=\x20?',_0x5b4139)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x52ca('0x40'),squel[_0x52ca('0xc')]()[_0x52ca('0xd')]('phone')[_0x52ca('0x3a')](_0x52ca('0x45'))[_0x52ca('0x11')](_0x52ca('0x46'),_0x5b4139)[_0x52ca('0x11')](_0xd756d9+_0x52ca('0x47'),_0x1e8d16+'.'+_0xd756d9)))[_0x52ca('0x48')]();}function insertCmHopperAdditionalPhones(_0x354b1f){var _0x31b3bd=[_0x52ca('0x49'),_0x52ca('0x4a'),'cm_contact_has_items.OrderBy',_0x52ca('0x4b'),_0x52ca('0x4c')];return squel[_0x52ca('0x43')]()[_0x52ca('0x30')](_0x52ca('0x4d'))[_0x52ca('0x32')]([_0x52ca('0x4e'),_0x52ca('0xe'),'OrderBy','createdAt','updatedAt'],squel['select']()['fields'](_0x31b3bd)[_0x52ca('0x3a')](_0x52ca('0x31'))[_0x52ca('0xf')](_0x52ca('0x3b'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x52ca('0xf')](_0x52ca('0x4f'),null,_0x52ca('0x50'))['where'](_0x52ca('0x51'),_0x354b1f)['where'](_0x52ca('0x3f'),NOW))[_0x52ca('0x48')]();}function insertCmContact(_0x43d750,_0x3281e5,_0x491481,_0x5407ee){var _0x2a0476=_[_0x52ca('0x52')](_[_0x52ca('0x53')](_0x5407ee),[_0x52ca('0x44'),_0x52ca('0x54'),'createdAt',_0x52ca('0x36')]);return squel[_0x52ca('0x43')]()[_0x52ca('0x30')](_0x52ca('0x3b'))[_0x52ca('0x32')](_0x2a0476,squel['select']()['fields'](_0x2a0476)[_0x52ca('0x3a')](_0x3281e5)['where']('('+_0x491481['join'](',')+_0x52ca('0x55'),squel[_0x52ca('0xc')]()[_0x52ca('0x39')](_0x491481)[_0x52ca('0x3a')](_0x52ca('0x3b'))[_0x52ca('0x11')](_0x52ca('0x46'),_0x43d750))[_0x52ca('0x11')](_0x52ca('0x56'),squel[_0x52ca('0xc')]()['field'](_0x52ca('0x57'),_0x52ca('0x58'))[_0x52ca('0x3a')](_0x3281e5)[_0x52ca('0x59')](_0x491481[_0x52ca('0xf')](','))))[_0x52ca('0x48')]();}function handleStop(){logger[_0x52ca('0x5a')](_0x52ca('0x5b'));stopped=!![];}function handleUncaughtException(_0x407df5){logger[_0x52ca('0x1d')](_0x407df5['message']);process['exit'](0x1);}function handleError(_0x3a88fb,_0x280d77){stats[_0x52ca('0x5c')][_0x52ca('0x19')]({'name':_0x280d77[_0x52ca('0x5d')],'message':_0x280d77['message'],'row':_0x3a88fb});}function handleQuery(_0x3b2b9c){logger[_0x52ca('0x5a')](_0x3b2b9c);return db['sequelize']['query'](_0x3b2b9c)['spread'](function(_0x5aa81f){results[_0x52ca('0x19')](_0x5aa81f);})[_0x52ca('0x1c')](function(_0x2e355a){logger[_0x52ca('0x1d')](_0x2e355a[_0x52ca('0x1e')]);});}function main(_0x3d65ab,_0x4dd261,_0xb41dc9,_0xe95e3f){logger[_0x52ca('0x5a')](_0x52ca('0x5e'),_0x3d65ab,JSON[_0x52ca('0x5f')](_0x4dd261));process[_0x52ca('0x60')](_0x52ca('0x61'));var _0x534fe4=_0x4dd261[_0x52ca('0x62')];var _0x3db43f=_[_0x52ca('0x63')](_0x534fe4);var _0x172dd3=_0x4dd261[_0x52ca('0x64')];var _0xefe6c9=path[_0x52ca('0xf')](config[_0x52ca('0x65')],_0x52ca('0x66'),_0x172dd3+'.csv');logger[_0x52ca('0x5a')]('body',_0x4dd261);db[_0x52ca('0x67')][_0x52ca('0x68')]({'raw':!![],'attributes':['id',_0x52ca('0x69')]})[_0x52ca('0x1b')](function(_0x179cc2){for(var _0x8df664=0x0;_0x8df664<_0x179cc2[_0x52ca('0x16')];_0x8df664++){if(_0x179cc2[_0x8df664][_0x52ca('0x69')]in _0x534fe4){contactItemTypes[_0x52ca('0x19')](_0x179cc2[_0x8df664]);delete _0x3db43f[_0x179cc2[_0x8df664][_0x52ca('0x69')]];hasAdditionalPhones=!![];}for(var _0x487522 in _0x534fe4){if(_0x179cc2[_0x8df664][_0x52ca('0x69')]+'_description'===_0x487522){phoneDescriptions[_0x52ca('0x19')]({'itemTypeId':_0x179cc2[_0x8df664]['id'],'description':_0x487522});delete _0x3db43f[_0x487522];}}}if(hasAdditionalPhones)_0x3db43f[_0x52ca('0x18')]='';var _0x237f74=_[_0x52ca('0x53')](_0x3db43f)['join']();logger['info'](_0x52ca('0x6a'),_0x237f74);fs['writeFileSync'](_0xefe6c9,_0x237f74+'\x0a');Papa[_0x52ca('0x6b')](fs[_0x52ca('0x6c')](_0x3d65ab),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3033e7,_0x3fd8f9){try{for(var _0x242d18=0x0,_0x42b25f=[];_0x242d18<_0x3033e7['data']['length'];_0x242d18++){stats[_0x52ca('0x6d')]+=0x1;if(_0x3033e7[_0x52ca('0x5c')][_0x242d18]){handleError(_0x3033e7[_0x52ca('0x6e')][_0x242d18],_0x3033e7[_0x52ca('0x5c')][_0x242d18]);}else{var _0x13ac6a=[];var _0x9b0080=[];var _0x37a903={};for(var _0x15e939 in _0x534fe4){let _0x301cc4=contactItemTypes[_0x52ca('0x6f')](_0x571b1c=>_0x571b1c[_0x52ca('0x69')]===_0x15e939);let _0x69e18c=contactItemTypes['find'](_0x44d08f=>_0x44d08f['name']+_0x52ca('0x70')===_0x15e939);if(_['isNil'](_0x301cc4)&&_[_0x52ca('0x17')](_0x69e18c)){if(_0x534fe4[_0x52ca('0x71')](_0x15e939)){if(_0x3033e7[_0x52ca('0x6e')][_0x242d18][_0x534fe4[_0x15e939]]){var _0x5b6f8e=_[_0x52ca('0x72')](_0x3033e7[_0x52ca('0x6e')][_0x242d18][_0x534fe4[_0x15e939]][_0x52ca('0x73')](/"/g,'\x27'));switch(_0x15e939){case _0x52ca('0x33'):var _0x52d130=moment(_0x5b6f8e,_0x52ca('0x9'),!![]);if(_0x52d130[_0x52ca('0x74')]()){_0x42b25f['push']('\x22'+_0x5b6f8e+'\x22');}else{_0x13ac6a['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x27dc11=parseInt(_0x5b6f8e);_0x5b6f8e=_['isNaN'](_0x27dc11)||_0x27dc11<0x0||_0x27dc11>0x4?_0xe95e3f?0x3:0x2:_0x27dc11;_0x42b25f[_0x52ca('0x19')]('\x22'+_0x5b6f8e+'\x22');break;case _0x52ca('0x37'):var _0x5387df=parseInt(_0x5b6f8e);if(_[_0x52ca('0x75')](_0x5387df)&&_['includes'](_0xb41dc9,_0x5387df)){_0x42b25f[_0x52ca('0x19')]('\x22'+_0x5387df+'\x22');}else{_0x13ac6a[_0x52ca('0x19')](_0x52ca('0x76'));}break;case _0x52ca('0x77'):if(isEmail(_0x5b6f8e)){_0x42b25f[_0x52ca('0x19')]('\x22'+_0x5b6f8e+'\x22');}else{_0x13ac6a[_0x52ca('0x19')]('email\x20wrong\x20format');}break;case _0x52ca('0x78'):var _0x305014=moment(_0x5b6f8e,_0x52ca('0x79'),!![]);if(_0x305014[_0x52ca('0x74')]()){_0x42b25f[_0x52ca('0x19')]('\x22'+_0x5b6f8e+'\x22');}else{_0x13ac6a[_0x52ca('0x19')](_0x52ca('0x7a'));}break;default:_0x42b25f['push']('\x22'+_0x5b6f8e+'\x22');}}else{switch(_0x15e939){case _0x52ca('0x7b'):case _0x52ca('0xe'):_0x13ac6a[_0x52ca('0x19')](_0x15e939+_0x52ca('0x7c'));break;default:_0x42b25f[_0x52ca('0x19')]('\x22\x22');}}}}else{var _0x1d3ed2='';if(!_['isNil'](_0x301cc4)){if(!_0x37a903[_0x52ca('0x71')](_0x301cc4['id'])){for(var _0x5ba5e1=0x0;_0x5ba5e1<_0x534fe4[_0x15e939]['length'];_0x5ba5e1++){var _0x5b6f8e=_['trim'](_0x3033e7[_0x52ca('0x6e')][_0x242d18][_0x534fe4[_0x15e939][_0x5ba5e1]][_0x52ca('0x73')](/"/g,'\x27'));var _0x13ef52=phoneDescriptions['find'](_0x5acc65=>_0x5acc65[_0x52ca('0x7d')]===_0x301cc4['id']);if(!_[_0x52ca('0x17')](_0x13ef52)){var _0x1b87e9=_[_0x52ca('0x72')](_0x3033e7[_0x52ca('0x6e')][_0x242d18][_0x534fe4[_0x13ef52[_0x52ca('0x7e')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x52ca('0x17')](_0x1b87e9))_0x5b6f8e=_0x5b6f8e+'§'+_0x1b87e9;}if(_0x1d3ed2=='')_0x1d3ed2=_0x5b6f8e;else _0x1d3ed2+='|'+_0x5b6f8e;}_0x9b0080['push'](_0x301cc4['id']+':'+_0x1d3ed2);_0x37a903[_0x301cc4['id']]=0x1;}}}}if(hasAdditionalPhones){_0x42b25f[_0x52ca('0x19')]('\x22'+_0x9b0080[_0x52ca('0xf')](';')+'\x22');}if(_0x13ac6a[_0x52ca('0x16')]){handleError(_0x3033e7[_0x52ca('0x6e')][_0x242d18],{'code':_0x52ca('0x7f'),'message':_0x13ac6a['join']()});}else{fs[_0x52ca('0x80')](_0xefe6c9,_0x42b25f[_0x52ca('0xf')]()+'\x0a');}_0x42b25f=[];}if(!(stats['rows']%0xc8)){socket[_0x52ca('0x81')](_0x52ca('0x82')+_0x172dd3,stats);stats[_0x52ca('0x5c')]=[];}}if(stopped){logger[_0x52ca('0x5a')](_0x52ca('0x83'));_0x3fd8f9[_0x52ca('0x84')]();}}catch(_0x3738c1){handleError(_0x3033e7[_0x52ca('0x6e')][_0x242d18],{'code':'SystemError','message':_0x3738c1[_0x52ca('0x1e')]});logger[_0x52ca('0x1d')]('step',_0x3738c1['message']);}},'complete':function(){try{var _0x5b69c2=[];var _0x56d9e1=tempTableName;_0x5b69c2[_0x52ca('0x19')]('CREATE\x20TABLE\x20'+_0x56d9e1+_0x52ca('0x85'));logger[_0x52ca('0x5a')](_0x52ca('0x86'),contactItemTypes[_0x52ca('0x16')]);var _0x3844c2=util['format'](_0x52ca('0x87'),_0xefe6c9,_0x56d9e1,_0x237f74,_0x4dd261[_0x52ca('0x44')],_0x4dd261[_0x52ca('0x54')]||null,NOW,NOW);if(_[_0x52ca('0x17')](_0x534fe4[_0x52ca('0x33')])){_0x3844c2+=_0x52ca('0x88');}_0x5b69c2[_0x52ca('0x19')](_0x3844c2);BPromise[_0x52ca('0x89')](_0x5b69c2,handleQuery)[_0x52ca('0x1b')](function(_0x5350f5){BPromise['all']([handleAdditionalPhones()])[_0x52ca('0x1b')](function(){_0x5b69c2=[];for(var _0x4d99fa=0x0;_0x4d99fa\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.substatus','i.to','i.ContactId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','toString','groupBy','Setting','findOne','enableEmailPreview','clone','isEmpty','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','getInteractionFK','u.id','u.fullname','left_join','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','tools_tags'];(function(_0x4491e5,_0x3aead){var _0x4cf0e3=function(_0x51484c){while(--_0x51484c){_0x4491e5['push'](_0x4491e5['shift']());}};_0x4cf0e3(++_0x3aead);}(_0x8664,0x11a));var _0x4866=function(_0x4684e6,_0x353bfd){_0x4684e6=_0x4684e6-0x0;var _0x4a5336=_0x8664[_0x4684e6];return _0x4a5336;};'use strict';var _=require(_0x4866('0x0'));var squel=require(_0x4866('0x1'));var as=require(_0x4866('0x2'));var qs=require(_0x4866('0x3'));var updateInteraction=require(_0x4866('0x4'))[_0x4866('0x5')];var utils=require(_0x4866('0x6'));var db=require(_0x4866('0x7'))['db'];function skipInteractionsQuery(_0x16a88f,_0x4a2986,_0x1d8d7a){var _0x595c9d=![];var _0x66b444=utils[_0x4866('0x8')](_0x16a88f);if(_0x4a2986[_0x4866('0x9')]===_0x4866('0xa')&&!_0x1d8d7a[_0x4866('0xb')]&&!_0x1d8d7a[_0x66b444]){_0x595c9d=!![];}return _0x595c9d;}function getTagsQuery(){return squel[_0x4866('0xc')]()['field']('id')[_0x4866('0xd')](_0x4866('0xe'))[_0x4866('0xd')](_0x4866('0xf'))[_0x4866('0x10')]('tools_tags');}function getUsersQuery(_0x35dab1,_0x61028f){var _0x5f21ba=utils[_0x4866('0x11')](_0x35dab1);var _0x3d80c7='user_has_'+_0x35dab1+'_interactions';var _0x47a50e=squel[_0x4866('0xc')]()[_0x4866('0xd')](_0x4866('0x12'))[_0x4866('0xd')](_0x4866('0x13'))[_0x4866('0xd')]('ui.'+_0x5f21ba)[_0x4866('0x10')](_0x3d80c7,'ui')[_0x4866('0x14')]('users','u',_0x4866('0x15'));if(_0x61028f[_0x4866('0x16')]>0x0){_0x47a50e[_0x4866('0x17')](_0x4866('0x18')+_0x5f21ba+_0x4866('0x19'),_[_0x4866('0x1a')](_0x61028f,'id'));}return _0x47a50e;}function getInteractionsQuery(_0x373888){var _0x653916=utils[_0x4866('0x1b')](_0x373888);var _0x56ba1f=utils['getAccountFK'](_0x373888);var _0x423490=utils[_0x4866('0x11')](_0x373888);return squel[_0x4866('0xc')]()['from'](_0x653916['interactions'],'i')[_0x4866('0x14')](_0x4866('0x1c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4866('0x14')]('users','o',_0x4866('0x1d'))['left_join'](_0x653916[_0x4866('0x1e')],'a',_0x4866('0x1f')+_0x56ba1f)[_0x4866('0x14')](_0x653916[_0x4866('0x20')],'me',_0x4866('0x21')+_0x423490+'\x20=\x20i.id')['left_join'](_0x653916[_0x4866('0x22')],'it',_0x4866('0x23')+_0x423490+_0x4866('0x24'))['left_join'](_0x4866('0x25'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x4a16d1={'body':squel[_0x4866('0x26')](),'contact':squel[_0x4866('0x26')](),'default':squel['expr'](),'fields':squel[_0x4866('0x26')](),'filter':squel[_0x4866('0x26')](),'read':squel[_0x4866('0x26')](),'tags':{'clause':squel[_0x4866('0x26')](),'ids':null},'user':squel[_0x4866('0x26')]()};return _0x4a16d1;}function parseTagParameter(_0x2b5557){var _0x1a1813=squel[_0x4866('0x26')]();if(_0x2b5557){var _0x43c4e2=utils[_0x4866('0x27')](_0x2b5557);_0x43c4e2[_0x4866('0x28')](function(_0x58f5f4){_0x1a1813['or'](_0x4866('0x29'),'%,'+_0x58f5f4+',%');});}return _0x1a1813;}function parseReadParameter(_0x3f8632){var _0xa371d1='';if(_0x3f8632){_0xa371d1=_0x4866('0x2a');if(_0x3f8632==='1'){_0xa371d1=_0xa371d1[_0x4866('0x2b')](_0x4866('0x2c'),'=');}else{_0xa371d1=_0xa371d1[_0x4866('0x2b')](_0x4866('0x2c'),'>');}}return _0xa371d1;}function parseSearchFilter(_0x21a7f9,_0x194b87){var _0x18dedf=squel[_0x4866('0x26')]();if(_0x194b87){var _0x2dc47f=_0x194b87[_0x4866('0x2b')]('\x5c','\x5c\x5c')[_0x4866('0x2b')](/'/g,'\x27\x27');if(qs[_0x4866('0x2d')](_0x2dc47f)){_0x18dedf['or'](_0x4866('0x2e'),_0x2dc47f+'%');if([_0x4866('0x2f'),_0x4866('0x30')][_0x4866('0x31')](_0x21a7f9)){_0x18dedf['or'](_0x4866('0x32'),_0x2dc47f+'%');}else if(_0x21a7f9===_0x4866('0x33')){_0x18dedf['or']('i.fax\x20LIKE\x20?',_0x2dc47f+'%');}else if(_0x21a7f9==='openchannel'){_0x18dedf['or'](_0x4866('0x34'),_0x2dc47f+'%');}}else if(_0x21a7f9===_0x4866('0x35')&&qs[_0x4866('0x36')](_0x2dc47f)){_0x18dedf['or'](_0x4866('0x37'),_0x2dc47f+'%');}else{if(_0x21a7f9===_0x4866('0x35')){_0x18dedf['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4866('0x38')](_0x2dc47f))['or'](_0x4866('0x39'),qs[_0x4866('0x38')](_0x2dc47f));}else{if(_0x21a7f9!==_0x4866('0x33')){_0x18dedf['or'](_0x4866('0x3a'),qs['getFullTextValue'](_0x2dc47f));}_0x18dedf['or'](_0x4866('0x3b'),_0x2dc47f+'%');}}}return _0x18dedf;}function parseAdvancedSearchFilter(_0x4055f0,_0x398201){var _0x42d92d=getSqlClauses();var _0x2858fb=as[_0x4866('0x3c')](_0x4055f0);var _0x3b5505=_0x2858fb[_0x4866('0x3d')];for(var _0x34f7ae=0x0;_0x34f7ae<_0x2858fb['conditions'][_0x4866('0x16')];_0x34f7ae++){var _0x381bbc=_0x2858fb['conditions'][_0x34f7ae];var _0x176c43='i';var _0xab047f=_['find'](_0x398201,['name',_0x381bbc['field']]);if(_0xab047f){var _0x59c857=as[_0x4866('0x3e')](_0x176c43,_0xab047f[_0x4866('0x3f')],_0x381bbc);_0x42d92d['default'][_0x3b5505](_0x59c857['text'],_0x59c857['value'][_0x4866('0x40')],_0x59c857['value'][_0x4866('0x41')]);}else{switch(_0x381bbc['field']){case _0x4866('0x42'):var _0x5e3de6=parseReadParameter(_0x381bbc[_0x4866('0x43')]);_0x42d92d[_0x4866('0x44')][_0x4866('0x45')](_0x5e3de6);break;case _0x4866('0x46'):if(_0x381bbc[_0x4866('0x47')]===_0x4866('0x48')){if(_0x381bbc[_0x4866('0x43')]['split']('\x20')['length']>0x1){_0x42d92d[_0x4866('0x49')][_0x3b5505](_0x4866('0x4a'),qs[_0x4866('0x38')](_0x381bbc[_0x4866('0x43')]),null);}else{var _0x322422='%'+_0x381bbc[_0x4866('0x43')]+'%';_0x42d92d['contact'][_0x3b5505](_0x4866('0x4b'),_0x322422,_0x322422,_0x322422);}}else{_0xab047f=_[_0x4866('0x4c')](_0x398201,['name','ContactId']);_0x381bbc['field']='ContactId';_0x59c857=as[_0x4866('0x3e')](_0x176c43,_0xab047f[_0x4866('0x3f')],_0x381bbc);_0x42d92d[_0x4866('0x49')][_0x3b5505](_0x59c857[_0x4866('0x4d')],_0x59c857['value'][_0x4866('0x40')],_0x59c857[_0x4866('0x43')][_0x4866('0x41')]);}break;case _0x4866('0x4e'):var _0x13a28a=_0x381bbc[_0x4866('0x43')]['split'](',')[_0x4866('0x1a')](function(_0x44295e){return Number(_0x44295e);});var _0x3a7c13=parseTagParameter(_0x13a28a);_0x42d92d[_0x4866('0x4f')][_0x4866('0x50')][_0x4866('0x45')](_0x3a7c13);_0x42d92d[_0x4866('0x4f')]['ids']=_0x13a28a;break;case _0x4866('0x51'):if(_0x381bbc['operator']===_0x4866('0x48')){_0x42d92d['user'][_0x3b5505](_0x4866('0x52'),'%'+_0x381bbc[_0x4866('0x43')]+'%',null);}else{_0xab047f=_[_0x4866('0x4c')](_0x398201,[_0x4866('0xe'),'UserId']);_0x381bbc[_0x4866('0xd')]=_0x4866('0x53');_0x59c857=as[_0x4866('0x3e')](_0x176c43,_0xab047f['type'],_0x381bbc);_0x42d92d[_0x4866('0x54')][_0x3b5505](_0x59c857[_0x4866('0x4d')],_0x59c857[_0x4866('0x43')]['start'],_0x59c857[_0x4866('0x43')][_0x4866('0x41')]);}break;case _0x4866('0x55'):case'plainBody':_0x59c857=as[_0x4866('0x3e')]('me',null,_0x381bbc);_0x42d92d[_0x4866('0x55')][_0x3b5505](_0x59c857[_0x4866('0x4d')],_0x59c857[_0x4866('0x43')][_0x4866('0x40')],_0x59c857[_0x4866('0x43')][_0x4866('0x41')]);break;}}}return _0x42d92d;}function parseModelFields(_0x2f0e86,_0x59906e,_0x1feb85){var _0x4ed185=utils['getAccountFK'](_0x2f0e86);var _0x255fcc=squel[_0x4866('0x26')]();var _0x4608d8=_(_0x59906e)['keys']()[_0x4866('0x1a')](function(_0x39f0de){return _[_0x4866('0x56')](_0x1feb85,['name',_0x39f0de])?_0x39f0de:undefined;})[_0x4866('0x57')]()['value']();if(_0x4608d8[_0x4866('0x16')]>0x0){_0x4608d8[_0x4866('0x28')](function(_0x2e0e8c){if(_0x2e0e8c===_0x4ed185){_0x255fcc['and']('i.'+_0x4ed185+_0x4866('0x19'),[][_0x4866('0x58')](_0x59906e[_0x2e0e8c]));}else if(_0x2e0e8c===_0x4866('0x59')){var _0x21cd32=JSON[_0x4866('0x5a')](_0x59906e[_0x2e0e8c])['$gte'];var _0x6b6eeb=JSON[_0x4866('0x5a')](_0x59906e[_0x2e0e8c])[_0x4866('0x5b')];_0x255fcc[_0x4866('0x45')](_0x4866('0x5c'),_0x21cd32,_0x6b6eeb);}else{if(_0x59906e[_0x2e0e8c]===_0x4866('0x5d')){_0x255fcc['and']('i.'+_0x2e0e8c+_0x4866('0x5e'));}else{_0x255fcc[_0x4866('0x45')]('i.'+_0x2e0e8c+'\x20=\x20?',_0x59906e[_0x2e0e8c]);}}});}return _0x255fcc;}function parseQueryParameters(_0x50e171,_0x16af75,_0xbfe515){var _0x578687=getSqlClauses();return Promise[_0x4866('0x5f')]()['then'](function(){return parseModelFields(_0x50e171,_0x16af75,_0xbfe515);})['then'](function(_0x4413e9){_0x578687[_0x4866('0x60')][_0x4866('0x45')](_0x4413e9);return parseReadParameter(_0x16af75[_0x4866('0x44')]);})['then'](function(_0x4ab731){_0x578687[_0x4866('0x44')][_0x4866('0x45')](_0x4ab731);return parseTagParameter(_0x16af75[_0x4866('0x61')]);})[_0x4866('0x62')](function(_0x17e904){_0x578687[_0x4866('0x4f')][_0x4866('0x50')][_0x4866('0x45')](_0x17e904);return parseSearchFilter(_0x50e171,_0x16af75['filter']);})[_0x4866('0x62')](function(_0x1dc9a1){_0x578687[_0x4866('0x63')]=_0x1dc9a1;return _0x578687;});}function checkAccountsRestrictions(_0x5e5a55,_0x4bb889,_0x4b5bef){var _0x39a6e2=utils[_0x4866('0x8')](_0x5e5a55);var _0xd19e56=_0x4866('0x64')+_['capitalize'](_0x5e5a55)+(_0x5e5a55===_0x4866('0x65')?'Websites':'Accounts');var _0x19e7df=squel[_0x4866('0x26')]();return Promise[_0x4866('0x5f')]()['then'](function(){if(_0x4b5bef['search']&&_0x4bb889[_0x4866('0x9')]===_0x4866('0xa')){return _0x4bb889[_0xd19e56]({'attributes':['id'],'raw':!![]});}})[_0x4866('0x62')](function(_0x8ca5b5){if(_0x8ca5b5){if(_0x8ca5b5[_0x4866('0x16')]===0x0){_0x19e7df['and']('i.'+_0x39a6e2+_0x4866('0x5e'));}else{_0x19e7df['and']('i.'+_0x39a6e2+_0x4866('0x19'),_[_0x4866('0x1a')](_0x8ca5b5,'id'));}}else if(!_0x4b5bef[_0x39a6e2]){_0x19e7df[_0x4866('0x45')]('i.'+_0x39a6e2+_0x4866('0x66'));}})[_0x4866('0x62')](function(){return _0x19e7df;});}function getClosedOrderClause(_0x403cd8,_0x142050){var _0x5f3454='';var _0x8e465d=[_0x4866('0x67'),_0x4866('0x68'),_0x4866('0x69')];if(_0x403cd8===_0x4866('0x35')){_0x8e465d[_0x4866('0x6a')]('i.substatus');}if(_0x142050[_0x4866('0x6b')]==='0'&&_0x403cd8===_0x4866('0x35')){_0x5f3454='i.substatus';}else{if(_0x142050[_0x4866('0x6b')]==='1'){_0x8e465d[_0x4866('0x6c')]();}_0x5f3454=_0x4866('0x6d')+_0x8e465d[_0x4866('0x6e')](',\x20')+')';}return _0x5f3454;}function getFilteredInteractions(_0x7524cc,_0x390795,_0x52916f,_0x15afb5){var _0x29c4ca=utils['getInteractionFK'](_0x7524cc);var _0x17aea5=_[_0x4866('0x6f')](_0x7524cc)+_0x4866('0x70');var _0x2d9e5f=[];var _0x19622e=getTagsQuery();var _0x2daf0a={'type':db[_0x4866('0x71')]['QueryTypes'][_0x4866('0x72')],'raw':!![]};var _0x8d4e2a=[];var _0x4b5ba6=[];return db[_0x4866('0x73')]['query'](_0x19622e['toString'](),_0x2daf0a)[_0x4866('0x62')](function(_0x344fc2){_0x2d9e5f=_['keyBy'](_0x344fc2,'id');_0x2daf0a=_['merge'](_0x2daf0a,{'model':db[_0x17aea5],'mapToModel':!![],'nest':!![]});if(_0x52916f[_0x4866('0x60')]){_0x15afb5['attributes'][_0x4866('0x28')](function(_0x10e459){_0x390795['field']('i.'+_0x10e459);});}else{_0x390795[_0x4866('0xd')](_0x4866('0x74'),_0x4866('0x42'));_0x390795['field']('a.key',_0x4866('0x75'));_0x390795[_0x4866('0xd')](_0x4866('0x76'),_0x4866('0x77'));if(_0x7524cc===_0x4866('0x35')){_0x390795[_0x4866('0xd')](_0x4866('0x78'),_0x4866('0x79'));_0x390795[_0x4866('0xd')](_0x4866('0x7a'),_0x4866('0x7b'));_0x390795['field']('i.id');_0x390795[_0x4866('0xd')]('i.createdAt');_0x390795['field']('i.updatedAt');_0x390795[_0x4866('0xd')](_0x4866('0x7c'));_0x390795[_0x4866('0xd')](_0x4866('0x7d'));_0x390795[_0x4866('0xd')](_0x4866('0x7e'));_0x390795[_0x4866('0xd')](_0x4866('0x7f'));_0x390795[_0x4866('0xd')](_0x4866('0x80'));_0x390795[_0x4866('0xd')](_0x4866('0x81'));_0x390795['field'](_0x4866('0x69'));_0x390795[_0x4866('0xd')]('i.secondDisposition');_0x390795['field']('i.thirdDisposition');_0x390795[_0x4866('0xd')](_0x4866('0x82'));_0x390795[_0x4866('0xd')](_0x4866('0x83'));_0x390795[_0x4866('0xd')](_0x4866('0x84'));_0x390795[_0x4866('0xd')]('i.MailAccountId');_0x390795['field']('i.UserId');}else if(_0x7524cc==='openchannel'){_0x390795[_0x4866('0xd')](_0x4866('0x85'),'contactName');}else{_0x390795['field'](_0x4866('0x86'),_0x4866('0x7b'));}if(_0x7524cc!==_0x4866('0x35')){_0x390795[_0x4866('0xd')]('i.*');}_0x390795['field']('c.firstName',_0x4866('0x87'));_0x390795['field'](_0x4866('0x88'),'Contact.lastName');_0x390795['field'](_0x4866('0x89'),_0x4866('0x8a'));_0x390795[_0x4866('0xd')](_0x4866('0x8b'),_0x4866('0x8c'));_0x390795[_0x4866('0xd')]('c.mobile',_0x4866('0x8d'));_0x390795[_0x4866('0xd')](_0x4866('0x8e'),_0x4866('0x8f'));_0x390795['field'](_0x4866('0x90'),_0x4866('0x91'));_0x390795['field'](_0x4866('0x92'),_0x4866('0x93'));_0x390795['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4866('0x94'));}if(_0x15afb5[_0x4866('0x95')]){_0x390795[_0x4866('0x95')](_0x15afb5[_0x4866('0x95')]);}if(_0x15afb5[_0x4866('0x96')]){_0x390795[_0x4866('0x96')](_0x15afb5[_0x4866('0x96')]);}return db[_0x4866('0x73')]['query'](_0x390795['toString'](),_0x2daf0a);})['then'](function(_0x53b3f2){_0x8d4e2a=_0x53b3f2;var _0x18da02=getUsersQuery(_0x7524cc,_0x8d4e2a);return db[_0x4866('0x73')][_0x4866('0x97')](_0x18da02[_0x4866('0x98')](),_0x2daf0a);})['then'](function(_0x5df8a1){_0x4b5ba6=_[_0x4866('0x99')](_0x5df8a1,_0x29c4ca);if(_0x7524cc==='mail'){return db[_0x4866('0x9a')][_0x4866('0x9b')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x4866('0x62')](function(_0x2a04f6){var _0x507ccf=_0x2a04f6?_0x2a04f6[_0x4866('0x9c')]:undefined;var _0x20d55f=_0x8d4e2a['map'](function(_0x4b0e1c){return updateInteraction(_0x4b0e1c,_0x2d9e5f,_0x4b5ba6,_0x507ccf);});return Promise['all'](_0x20d55f);});}function countFilteredInteractions(_0x3800bb,_0x305bc9){var _0x2c6d5b=_0x3800bb[_0x4866('0x9d')]();_0x2c6d5b['field']('COUNT(*)');_0x2c6d5b[_0x4866('0xd')](_0x4866('0x74'),_0x4866('0x42'));var _0x24f7ef=utils['getSelectedTags'](_0x305bc9);if(!_[_0x4866('0x9e')](_0x24f7ef)){_0x2c6d5b[_0x4866('0x17')]('t.id\x20IN\x20?',_0x24f7ef);}var _0x54f9f9={'type':db[_0x4866('0x71')][_0x4866('0x9f')][_0x4866('0x72')],'raw':!![]};return db[_0x4866('0x73')][_0x4866('0x97')](_0x2c6d5b[_0x4866('0x98')](),_0x54f9f9);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x24cf=['type','default','value','start','end','read','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','map','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','plainBody','keys','some','compact','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','filter','get','capitalize','Websites','Accounts','role','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','QueryTypes','sequelize','toString','keyBy','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','Owner.internal','limit','offset','query','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','Sequelize','SELECT','exports','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','agent','select','field','name','color','from','tools_tags','user_has_','_interactions','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','length','where','getAccountFK','getInteractionFK','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','messages','me.','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression'];(function(_0x5e48c2,_0x191dee){var _0x524b9a=function(_0x18061b){while(--_0x18061b){_0x5e48c2['push'](_0x5e48c2['shift']());}};_0x524b9a(++_0x191dee);}(_0x24cf,0x1d5));var _0xf24c=function(_0x46ff19,_0x51402e){_0x46ff19=_0x46ff19-0x0;var _0x569915=_0x24cf[_0x46ff19];return _0x569915;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0xf24c('0x0'));var qs=require(_0xf24c('0x1'));var updateInteraction=require(_0xf24c('0x2'))[_0xf24c('0x3')];var utils=require(_0xf24c('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x3cfc01,_0x417bb2,_0x1eafb4){var _0x10c351=![];var _0x5c4ebc=utils['getAccountFK'](_0x3cfc01);if(_0x417bb2['role']===_0xf24c('0x5')&&!_0x1eafb4['search']&&!_0x1eafb4[_0x5c4ebc]){_0x10c351=!![];}return _0x10c351;}function getTagsQuery(){return squel[_0xf24c('0x6')]()[_0xf24c('0x7')]('id')[_0xf24c('0x7')](_0xf24c('0x8'))['field'](_0xf24c('0x9'))[_0xf24c('0xa')](_0xf24c('0xb'));}function getUsersQuery(_0x21a4cc,_0x3bfc0f){var _0x1fd435=utils['getInteractionFK'](_0x21a4cc);var _0x13a62e=_0xf24c('0xc')+_0x21a4cc+_0xf24c('0xd');var _0x4ab39d=squel[_0xf24c('0x6')]()[_0xf24c('0x7')]('u.id')['field'](_0xf24c('0xe'))['field'](_0xf24c('0xf')+_0x1fd435)[_0xf24c('0xa')](_0x13a62e,'ui')['left_join'](_0xf24c('0x10'),'u',_0xf24c('0x11'));if(_0x3bfc0f[_0xf24c('0x12')]>0x0){_0x4ab39d[_0xf24c('0x13')](_0xf24c('0xf')+_0x1fd435+'\x20IN\x20?',_['map'](_0x3bfc0f,'id'));}return _0x4ab39d;}function getInteractionsQuery(_0x32787d){var _0x462801=utils['getInteractionsTables'](_0x32787d);var _0x2640cd=utils[_0xf24c('0x14')](_0x32787d);var _0x2d9015=utils[_0xf24c('0x15')](_0x32787d);return squel[_0xf24c('0x6')]()[_0xf24c('0xa')](_0x462801[_0xf24c('0x16')],'i')[_0xf24c('0x17')](_0xf24c('0x18'),'c',_0xf24c('0x19'))[_0xf24c('0x17')](_0xf24c('0x10'),'o','o.id\x20=\x20i.UserId')[_0xf24c('0x17')](_0x462801[_0xf24c('0x1a')],'a','a.id\x20=\x20i.'+_0x2640cd)[_0xf24c('0x17')](_0x462801[_0xf24c('0x1b')],'me',_0xf24c('0x1c')+_0x2d9015+'\x20=\x20i.id')[_0xf24c('0x17')](_0x462801['interactionsTags'],'it',_0xf24c('0x1d')+_0x2d9015+_0xf24c('0x1e'))['left_join'](_0xf24c('0xb'),'t',_0xf24c('0x1f'));}function getSqlClauses(){var _0x106771={'body':squel[_0xf24c('0x20')](),'contact':squel[_0xf24c('0x20')](),'default':squel[_0xf24c('0x20')](),'fields':squel[_0xf24c('0x20')](),'filter':squel[_0xf24c('0x20')](),'read':squel[_0xf24c('0x20')](),'tags':{'clause':squel[_0xf24c('0x20')](),'ids':null},'user':squel[_0xf24c('0x20')]()};return _0x106771;}function parseTagParameter(_0x4a9a9b){var _0x4b21f5=squel[_0xf24c('0x20')]();if(_0x4a9a9b){var _0x4940e0=utils['getSelectedTags'](_0x4a9a9b);_0x4940e0[_0xf24c('0x21')](function(_0x5eb931){_0x4b21f5['or'](_0xf24c('0x22'),'%,'+_0x5eb931+',%');});}return _0x4b21f5;}function parseReadParameter(_0x379f9a){var _0x4ba389='';if(_0x379f9a){_0x4ba389='unreadMessages\x20{OPERATOR}\x200';if(_0x379f9a==='1'){_0x4ba389=_0x4ba389['replace'](_0xf24c('0x23'),'=');}else{_0x4ba389=_0x4ba389['replace'](_0xf24c('0x23'),'>');}}return _0x4ba389;}function parseSearchFilter(_0x266cfe,_0x2ee712){var _0x5c8588=squel[_0xf24c('0x20')]();if(_0x2ee712){var _0x4f0777=_0x2ee712['replace']('\x5c','\x5c\x5c')[_0xf24c('0x24')](/'/g,'\x27\x27');if(qs[_0xf24c('0x25')](_0x4f0777)){_0x5c8588['or'](_0xf24c('0x26'),_0x4f0777+'%');if([_0xf24c('0x27'),'whatsapp'][_0xf24c('0x28')](_0x266cfe)){_0x5c8588['or'](_0xf24c('0x29'),_0x4f0777+'%');}else if(_0x266cfe===_0xf24c('0x2a')){_0x5c8588['or'](_0xf24c('0x2b'),_0x4f0777+'%');}else if(_0x266cfe===_0xf24c('0x2c')){_0x5c8588['or'](_0xf24c('0x2d'),_0x4f0777+'%');}}else if(_0x266cfe==='mail'&&qs[_0xf24c('0x2e')](_0x4f0777)){_0x5c8588['or'](_0xf24c('0x2f'),_0x4f0777+'%');}else{if(_0x266cfe===_0xf24c('0x30')){_0x5c8588['or'](_0xf24c('0x31'),qs[_0xf24c('0x32')](_0x4f0777))['or'](_0xf24c('0x33'),qs[_0xf24c('0x32')](_0x4f0777));}else{if(_0x266cfe!=='fax'){_0x5c8588['or'](_0xf24c('0x34'),qs['getFullTextValue'](_0x4f0777));}_0x5c8588['or'](_0xf24c('0x35'),_0x4f0777+'%');}}}return _0x5c8588;}function parseAdvancedSearchFilter(_0x2fa14b,_0x59d010){var _0x30c240=getSqlClauses();var _0x4fe3e1=as[_0xf24c('0x36')](_0x2fa14b);var _0x269d1b=_0x4fe3e1[_0xf24c('0x37')];for(var _0x47f733=0x0;_0x47f733<_0x4fe3e1[_0xf24c('0x38')]['length'];_0x47f733++){var _0x24d8f1=_0x4fe3e1['conditions'][_0x47f733];var _0x5648e8='i';var _0x53dfd6=_[_0xf24c('0x39')](_0x59d010,[_0xf24c('0x8'),_0x24d8f1[_0xf24c('0x7')]]);if(_0x53dfd6){var _0x3334b3=as[_0xf24c('0x3a')](_0x5648e8,_0x53dfd6[_0xf24c('0x3b')],_0x24d8f1);_0x30c240[_0xf24c('0x3c')][_0x269d1b](_0x3334b3['text'],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3e')],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3f')]);}else{switch(_0x24d8f1[_0xf24c('0x7')]){case'unreadMessages':var _0x177c02=parseReadParameter(_0x24d8f1['value']);_0x30c240[_0xf24c('0x40')][_0xf24c('0x41')](_0x177c02);break;case _0xf24c('0x42'):if(_0x24d8f1[_0xf24c('0x43')]===_0xf24c('0x44')){if(_0x24d8f1[_0xf24c('0x3d')][_0xf24c('0x45')]('\x20')[_0xf24c('0x12')]>0x1){_0x30c240[_0xf24c('0x46')][_0x269d1b](_0xf24c('0x47'),qs[_0xf24c('0x32')](_0x24d8f1['value']),null);}else{var _0x5d55f0='%'+_0x24d8f1[_0xf24c('0x3d')]+'%';_0x30c240[_0xf24c('0x46')][_0x269d1b](_0xf24c('0x48'),_0x5d55f0,_0x5d55f0,_0x5d55f0);}}else{_0x53dfd6=_[_0xf24c('0x39')](_0x59d010,[_0xf24c('0x8'),_0xf24c('0x49')]);_0x24d8f1[_0xf24c('0x7')]=_0xf24c('0x49');_0x3334b3=as[_0xf24c('0x3a')](_0x5648e8,_0x53dfd6[_0xf24c('0x3b')],_0x24d8f1);_0x30c240[_0xf24c('0x46')][_0x269d1b](_0x3334b3['text'],_0x3334b3[_0xf24c('0x3d')]['start'],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3f')]);}break;case _0xf24c('0x4a'):var _0x2bd052=_0x24d8f1[_0xf24c('0x3d')][_0xf24c('0x45')](',')[_0xf24c('0x4b')](function(_0x462354){return Number(_0x462354);});var _0x1b69dc=parseTagParameter(_0x2bd052);_0x30c240[_0xf24c('0x4c')][_0xf24c('0x4d')][_0xf24c('0x41')](_0x1b69dc);_0x30c240[_0xf24c('0x4c')][_0xf24c('0x4e')]=_0x2bd052;break;case _0xf24c('0x4f'):if(_0x24d8f1['operator']==='$substring'){_0x30c240[_0xf24c('0x50')][_0x269d1b](_0xf24c('0x51'),'%'+_0x24d8f1[_0xf24c('0x3d')]+'%',null);}else{_0x53dfd6=_[_0xf24c('0x39')](_0x59d010,[_0xf24c('0x8'),'UserId']);_0x24d8f1[_0xf24c('0x7')]=_0xf24c('0x52');_0x3334b3=as[_0xf24c('0x3a')](_0x5648e8,_0x53dfd6[_0xf24c('0x3b')],_0x24d8f1);_0x30c240['user'][_0x269d1b](_0x3334b3[_0xf24c('0x53')],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3e')],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3f')]);}break;case _0xf24c('0x54'):case _0xf24c('0x55'):_0x3334b3=as[_0xf24c('0x3a')]('me',null,_0x24d8f1);_0x30c240[_0xf24c('0x54')][_0x269d1b](_0x3334b3[_0xf24c('0x53')],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3e')],_0x3334b3[_0xf24c('0x3d')][_0xf24c('0x3f')]);break;}}}return _0x30c240;}function parseModelFields(_0x343099,_0x340552,_0x296252){var _0x4ab953=utils[_0xf24c('0x14')](_0x343099);var _0x324122=squel[_0xf24c('0x20')]();var _0xff2783=_(_0x340552)[_0xf24c('0x56')]()[_0xf24c('0x4b')](function(_0x86dc69){return _[_0xf24c('0x57')](_0x296252,[_0xf24c('0x8'),_0x86dc69])?_0x86dc69:undefined;})[_0xf24c('0x58')]()['value']();if(_0xff2783[_0xf24c('0x12')]>0x0){_0xff2783[_0xf24c('0x21')](function(_0x4f0e16){if(_0x4f0e16===_0x4ab953){_0x324122['and']('i.'+_0x4ab953+_0xf24c('0x59'),[][_0xf24c('0x5a')](_0x340552[_0x4f0e16]));}else if(_0x4f0e16===_0xf24c('0x5b')){var _0x3642c7=JSON[_0xf24c('0x5c')](_0x340552[_0x4f0e16])[_0xf24c('0x5d')];var _0x317071=JSON[_0xf24c('0x5c')](_0x340552[_0x4f0e16])[_0xf24c('0x5e')];_0x324122['and'](_0xf24c('0x5f'),_0x3642c7,_0x317071);}else{if(_0x340552[_0x4f0e16]==='null'){_0x324122['and']('i.'+_0x4f0e16+_0xf24c('0x60'));}else{_0x324122[_0xf24c('0x41')]('i.'+_0x4f0e16+_0xf24c('0x61'),_0x340552[_0x4f0e16]);}}});}return _0x324122;}function parseQueryParameters(_0x288a1e,_0x168df5,_0x3721ab){var _0x412d5f=getSqlClauses();return Promise[_0xf24c('0x62')]()[_0xf24c('0x63')](function(){return parseModelFields(_0x288a1e,_0x168df5,_0x3721ab);})[_0xf24c('0x63')](function(_0x5793f2){_0x412d5f['fields'][_0xf24c('0x41')](_0x5793f2);return parseReadParameter(_0x168df5['read']);})[_0xf24c('0x63')](function(_0x35a63a){_0x412d5f[_0xf24c('0x40')][_0xf24c('0x41')](_0x35a63a);return parseTagParameter(_0x168df5[_0xf24c('0x64')]);})[_0xf24c('0x63')](function(_0x3afe4e){_0x412d5f[_0xf24c('0x4c')][_0xf24c('0x4d')][_0xf24c('0x41')](_0x3afe4e);return parseSearchFilter(_0x288a1e,_0x168df5[_0xf24c('0x65')]);})[_0xf24c('0x63')](function(_0x4b669e){_0x412d5f['filter']=_0x4b669e;return _0x412d5f;});}function checkAccountsRestrictions(_0x35d85b,_0x1c75d4,_0x5ae31a){var _0x296ea4=utils[_0xf24c('0x14')](_0x35d85b);var _0x257006=_0xf24c('0x66')+_[_0xf24c('0x67')](_0x35d85b)+(_0x35d85b==='chat'?_0xf24c('0x68'):_0xf24c('0x69'));var _0x52081e=squel['expr']();return Promise['resolve']()[_0xf24c('0x63')](function(){if(_0x5ae31a['search']&&_0x1c75d4[_0xf24c('0x6a')]===_0xf24c('0x5')){return _0x1c75d4[_0x257006]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4a83bd){if(_0x4a83bd){if(_0x4a83bd['length']===0x0){_0x52081e[_0xf24c('0x41')]('i.'+_0x296ea4+_0xf24c('0x60'));}else{_0x52081e['and']('i.'+_0x296ea4+_0xf24c('0x59'),_[_0xf24c('0x4b')](_0x4a83bd,'id'));}}else if(!_0x5ae31a[_0x296ea4]){_0x52081e['and']('i.'+_0x296ea4+_0xf24c('0x6b'));}})[_0xf24c('0x63')](function(){return _0x52081e;});}function getClosedOrderClause(_0x198df0,_0x291bc2){var _0x403c01='';var _0x59ecb4=['i.thirdDisposition',_0xf24c('0x6c'),_0xf24c('0x6d')];if(_0x198df0==='mail'){_0x59ecb4[_0xf24c('0x6e')](_0xf24c('0x6f'));}if(_0x291bc2[_0xf24c('0x70')]==='0'&&_0x198df0===_0xf24c('0x30')){_0x403c01=_0xf24c('0x6f');}else{if(_0x291bc2[_0xf24c('0x70')]==='1'){_0x59ecb4[_0xf24c('0x71')]();}_0x403c01=_0xf24c('0x72')+_0x59ecb4[_0xf24c('0x73')](',\x20')+')';}return _0x403c01;}function getFilteredInteractions(_0x10a35f,_0x25704c,_0x42d91e,_0x1bd68c){var _0x4faac7=utils[_0xf24c('0x15')](_0x10a35f);var _0x46bdcf=_[_0xf24c('0x67')](_0x10a35f)+'Interaction';var _0x2bb95d=[];var _0x237449=getTagsQuery();var _0x161d39={'type':db['Sequelize'][_0xf24c('0x74')]['SELECT'],'raw':!![]};var _0x153639=[];var _0x1e60b5=[];return db[_0xf24c('0x75')]['query'](_0x237449[_0xf24c('0x76')](),_0x161d39)[_0xf24c('0x63')](function(_0x157e9d){_0x2bb95d=_[_0xf24c('0x77')](_0x157e9d,'id');_0x161d39=_[_0xf24c('0x78')](_0x161d39,{'model':db[_0x46bdcf],'mapToModel':!![],'nest':!![]});if(_0x42d91e[_0xf24c('0x79')]){_0x1bd68c[_0xf24c('0x7a')]['forEach'](function(_0x4f20df){_0x25704c[_0xf24c('0x7')]('i.'+_0x4f20df);});}else{_0x25704c[_0xf24c('0x7')](_0xf24c('0x7b'),_0xf24c('0x7c'));_0x25704c['field'](_0xf24c('0x7d'),_0xf24c('0x7e'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x7f'),_0xf24c('0x80'));if(_0x10a35f===_0xf24c('0x30')){_0x25704c[_0xf24c('0x7')](_0xf24c('0x81'),_0xf24c('0x82'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x83'),'contactName');_0x25704c[_0xf24c('0x7')](_0xf24c('0x84'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x85'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x86'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x87'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x88'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x89'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x8a'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x8b'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x8c'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x6d'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x6c'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x8d'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x6f'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x8e'));_0x25704c['field']('i.ContactId');_0x25704c[_0xf24c('0x7')](_0xf24c('0x8f'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x90'));}else if(_0x10a35f===_0xf24c('0x2c')){_0x25704c['field'](_0xf24c('0x91'),_0xf24c('0x92'));}else{_0x25704c['field'](_0xf24c('0x93'),_0xf24c('0x92'));}if(_0x10a35f!==_0xf24c('0x30')){_0x25704c['field']('i.*');}_0x25704c[_0xf24c('0x7')](_0xf24c('0x94'),'Contact.firstName');_0x25704c['field'](_0xf24c('0x95'),_0xf24c('0x96'));_0x25704c['field'](_0xf24c('0x97'),_0xf24c('0x98'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x99'),_0xf24c('0x9a'));_0x25704c[_0xf24c('0x7')](_0xf24c('0x9b'),_0xf24c('0x9c'));_0x25704c['field'](_0xf24c('0x9d'),'Contact.fax');_0x25704c[_0xf24c('0x7')]('o.fullname',_0xf24c('0x9e'));_0x25704c['field']('o.internal',_0xf24c('0x9f'));_0x25704c['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1bd68c['limit']){_0x25704c[_0xf24c('0xa0')](_0x1bd68c[_0xf24c('0xa0')]);}if(_0x1bd68c[_0xf24c('0xa1')]){_0x25704c[_0xf24c('0xa1')](_0x1bd68c[_0xf24c('0xa1')]);}return db[_0xf24c('0x75')][_0xf24c('0xa2')](_0x25704c[_0xf24c('0x76')](),_0x161d39);})[_0xf24c('0x63')](function(_0x90c843){_0x153639=_0x90c843;var _0x30d3ff=getUsersQuery(_0x10a35f,_0x153639);return db[_0xf24c('0x75')]['query'](_0x30d3ff[_0xf24c('0x76')](),_0x161d39);})['then'](function(_0xd59e72){_0x1e60b5=_[_0xf24c('0xa3')](_0xd59e72,_0x4faac7);if(_0x10a35f==='mail'){return db[_0xf24c('0xa4')][_0xf24c('0xa5')]({'attributes':[_0xf24c('0xa6')],'raw':!![]});}})[_0xf24c('0x63')](function(_0x36c2d6){var _0xecee3a=_0x36c2d6?_0x36c2d6[_0xf24c('0xa6')]:undefined;var _0x320c75=_0x153639[_0xf24c('0x4b')](function(_0x214ba2){return updateInteraction(_0x214ba2,_0x2bb95d,_0x1e60b5,_0xecee3a);});return Promise[_0xf24c('0xa7')](_0x320c75);});}function countFilteredInteractions(_0x47b1ad,_0x309f00){var _0x337df9=_0x47b1ad[_0xf24c('0xa8')]();_0x337df9[_0xf24c('0x7')](_0xf24c('0xa9'));_0x337df9[_0xf24c('0x7')](_0xf24c('0x7b'),_0xf24c('0x7c'));var _0x549a2d=utils[_0xf24c('0xaa')](_0x309f00);if(!_[_0xf24c('0xab')](_0x549a2d)){_0x337df9['where'](_0xf24c('0xac'),_0x549a2d);}var _0x5e45f3={'type':db[_0xf24c('0xad')]['QueryTypes'][_0xf24c('0xae')],'raw':!![]};return db[_0xf24c('0x75')]['query'](_0x337df9['toString'](),_0x5e45f3);}module[_0xf24c('0xaf')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 8bafe64..90b3010 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe12b=['lodash','../../mysqldb','map','fullname','split','forEach','waiting','abandoned','UserId','answered','talking','disposition','unmanaged','MailMessage','out','plainBody','-id','then','lastMsgText','trimStart','catch','Users','TagIds','Tags'];(function(_0x5058b6,_0x2cd40c){var _0x3cb924=function(_0x35165e){while(--_0x35165e){_0x5058b6['push'](_0x5058b6['shift']());}};_0x3cb924(++_0x2cd40c);}(_0xe12b,0xd8));var _0xbe12=function(_0x44c7c5,_0x7e632f){_0x44c7c5=_0x44c7c5-0x0;var _0x580c3b=_0xe12b[_0x44c7c5];return _0x580c3b;};'use strict';var _=require(_0xbe12('0x0'));var db=require(_0xbe12('0x1'))['db'];function getInteractionUsers(_0x202131,_0x28ee58){return new Promise(function(_0x53157a,_0x4f0a5d){try{var _0x39e746=[];if(_0x28ee58[_0x202131]){_0x39e746=_0x28ee58[_0x202131][_0xbe12('0x2')](function(_0x24660f){return{'id':_0x24660f['id'],'fullname':_0x24660f[_0xbe12('0x3')]};});}return _0x53157a(_0x39e746);}catch(_0x4bfba9){_0x4f0a5d(_0x4bfba9);}});}function getInteractionTags(_0x1eafc6,_0x595589){var _0xa2daa8=[];if(_0x1eafc6){_0x1eafc6[_0xbe12('0x4')](',')[_0xbe12('0x5')](function(_0x447aeb){_0xa2daa8['push'](_0x595589[_0x447aeb]);});}return _0xa2daa8;}function updateWaitingCounter(_0x292995){if(_0x292995['waiting']){_0x292995['waiting']-=0x1;}}function updateInteractionCounters(_0x5be830){_0x5be830[_0xbe12('0x6')]=0x0;_0x5be830['talking']=0x0;_0x5be830['answered']=0x0;_0x5be830['unmanaged']=0x0;_0x5be830['abandoned']=0x0;_0x5be830['total']=0x0;if(_0x5be830['closed']){if(_0x5be830['disposition']===_0xbe12('0x7')){_0x5be830['abandoned']+=0x1;updateWaitingCounter(_0x5be830);}if(_0x5be830[_0xbe12('0x8')]){_0x5be830[_0xbe12('0x9')]+=0x1;if(_0x5be830[_0xbe12('0xa')]){_0x5be830[_0xbe12('0xa')]-=0x1;}}else{if(_0x5be830[_0xbe12('0xb')]){_0x5be830[_0xbe12('0xc')]+=0x1;updateWaitingCounter(_0x5be830);}}}else{if(!_0x5be830[_0xbe12('0x8')]){_0x5be830[_0xbe12('0x6')]+=0x1;}if(_0x5be830['UserId']){_0x5be830[_0xbe12('0xa')]+=0x1;updateWaitingCounter(_0x5be830);}}_0x5be830['total']+=0x1;return _0x5be830;}function getLastMessageText(_0x287787){return db[_0xbe12('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x287787['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbe12('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbe12('0xf')],'order':_0xbe12('0x10'),'raw':!![]})[_0xbe12('0x11')](function(_0x4f231d){if(_0x4f231d&&_0x4f231d[_0xbe12('0xf')]){_0x287787[_0xbe12('0x12')]=_[_0xbe12('0x13')](_0x4f231d[_0xbe12('0xf')]);}return _0x287787;})[_0xbe12('0x14')](function(_0x485f30){throw _0x485f30;});}exports['updateInteraction']=function(_0x33958f,_0x242f69,_0x38e7b1,_0x268cdb){return new Promise(function(_0x1d1a64,_0x23e653){return getInteractionUsers(_0x33958f['id'],_0x38e7b1)[_0xbe12('0x11')](function(_0x56c4ee){_0x33958f[_0xbe12('0x15')]=_0x56c4ee;return getInteractionTags(_0x33958f[_0xbe12('0x16')],_0x242f69);})['then'](function(_0x10b05b){_0x33958f[_0xbe12('0x17')]=_0x10b05b;delete _0x33958f['TagIds'];return updateInteractionCounters(_0x33958f);})[_0xbe12('0x11')](function(_0x15bbb9){if(_0x268cdb){return getLastMessageText(_0x15bbb9);}else{return _0x15bbb9;}})[_0xbe12('0x11')](function(_0x1316df){_0x1d1a64(_0x1316df);})[_0xbe12('0x14')](function(_0x1fbaf0){_0x23e653(_0x1fbaf0);});});}; \ No newline at end of file +var _0x5434=['push','waiting','answered','closed','disposition','abandoned','UserId','talking','unmanaged','findOne','out','plainBody','-id','lastMsgText','catch','updateInteraction','then','Tags','TagIds','lodash','../../mysqldb','map','fullname','split','forEach'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x5434,0xc2));var _0x4543=function(_0x19968c,_0x309645){_0x19968c=_0x19968c-0x0;var _0x2fcd5c=_0x5434[_0x19968c];return _0x2fcd5c;};'use strict';var _=require(_0x4543('0x0'));var db=require(_0x4543('0x1'))['db'];function getInteractionUsers(_0x9202b1,_0x181518){return new Promise(function(_0x48e8fa,_0x295300){try{var _0x417969=[];if(_0x181518[_0x9202b1]){_0x417969=_0x181518[_0x9202b1][_0x4543('0x2')](function(_0x4aae4f){return{'id':_0x4aae4f['id'],'fullname':_0x4aae4f[_0x4543('0x3')]};});}return _0x48e8fa(_0x417969);}catch(_0x403115){_0x295300(_0x403115);}});}function getInteractionTags(_0x3dc2cf,_0x2747b8){var _0x3bdd30=[];if(_0x3dc2cf){_0x3dc2cf[_0x4543('0x4')](',')[_0x4543('0x5')](function(_0xb4b706){_0x3bdd30[_0x4543('0x6')](_0x2747b8[_0xb4b706]);});}return _0x3bdd30;}function updateWaitingCounter(_0x5335f5){if(_0x5335f5[_0x4543('0x7')]){_0x5335f5['waiting']-=0x1;}}function updateInteractionCounters(_0x5d8bd4){_0x5d8bd4['waiting']=0x0;_0x5d8bd4['talking']=0x0;_0x5d8bd4[_0x4543('0x8')]=0x0;_0x5d8bd4['unmanaged']=0x0;_0x5d8bd4['abandoned']=0x0;_0x5d8bd4['total']=0x0;if(_0x5d8bd4[_0x4543('0x9')]){if(_0x5d8bd4[_0x4543('0xa')]===_0x4543('0xb')){_0x5d8bd4[_0x4543('0xb')]+=0x1;updateWaitingCounter(_0x5d8bd4);}if(_0x5d8bd4[_0x4543('0xc')]){_0x5d8bd4[_0x4543('0x8')]+=0x1;if(_0x5d8bd4[_0x4543('0xd')]){_0x5d8bd4[_0x4543('0xd')]-=0x1;}}else{if(_0x5d8bd4[_0x4543('0xa')]){_0x5d8bd4[_0x4543('0xe')]+=0x1;updateWaitingCounter(_0x5d8bd4);}}}else{if(!_0x5d8bd4[_0x4543('0xc')]){_0x5d8bd4['waiting']+=0x1;}if(_0x5d8bd4['UserId']){_0x5d8bd4['talking']+=0x1;updateWaitingCounter(_0x5d8bd4);}}_0x5d8bd4['total']+=0x1;return _0x5d8bd4;}function getLastMessageText(_0x598556){return db['MailMessage'][_0x4543('0xf')]({'where':{'$and':[{'MailInteractionId':_0x598556['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4543('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x4543('0x11')],'order':_0x4543('0x12'),'raw':!![]})['then'](function(_0x204eb8){if(_0x204eb8&&_0x204eb8[_0x4543('0x11')]){_0x598556[_0x4543('0x13')]=_['trimStart'](_0x204eb8[_0x4543('0x11')]);}return _0x598556;})[_0x4543('0x14')](function(_0x6c0b75){throw _0x6c0b75;});}exports[_0x4543('0x15')]=function(_0x39414d,_0x49fc0d,_0x58d6a0,_0x6762be){return new Promise(function(_0x3090d2,_0x4416b4){return getInteractionUsers(_0x39414d['id'],_0x58d6a0)[_0x4543('0x16')](function(_0x4915d4){_0x39414d['Users']=_0x4915d4;return getInteractionTags(_0x39414d['TagIds'],_0x49fc0d);})['then'](function(_0xf04571){_0x39414d[_0x4543('0x17')]=_0xf04571;delete _0x39414d[_0x4543('0x18')];return updateInteractionCounters(_0x39414d);})[_0x4543('0x16')](function(_0x31e88f){if(_0x6762be){return getLastMessageText(_0x31e88f);}else{return _0x31e88f;}})[_0x4543('0x16')](function(_0x14d77a){_0x3090d2(_0x14d77a);})[_0x4543('0x14')](function(_0x437272){_0x4416b4(_0x437272);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index a688dfa..b0b29d1 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5df=['toUpperCase','name','role','null','Interaction','then','update','info','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x55e3de,_0x20ae6a){var _0x5d6764=function(_0x3e8f8f){while(--_0x3e8f8f){_0x55e3de['push'](_0x55e3de['shift']());}};_0x5d6764(++_0x20ae6a);}(_0xe5df,0x1b7));var _0xfe5d=function(_0x24d6dc,_0x1f79d8){_0x24d6dc=_0x24d6dc-0x0;var _0x4cca03=_0xe5df[_0x24d6dc];return _0x4cca03;};'use strict';var _=require(_0xfe5d('0x0'));var db=require(_0xfe5d('0x1'))['db'];var loggers={'openchannel':require(_0xfe5d('0x2'))(_0xfe5d('0x3')),'mail':require(_0xfe5d('0x2'))(_0xfe5d('0x4')),'fax':require(_0xfe5d('0x2'))('fax-interactions'),'sms':require(_0xfe5d('0x2'))(_0xfe5d('0x5')),'chat':require(_0xfe5d('0x2'))(_0xfe5d('0x6')),'whatsapp':require(_0xfe5d('0x2'))(_0xfe5d('0x7'))};function getAccountFK(_0x57879e){return _[_0xfe5d('0x8')](_0x57879e)+(_0x57879e===_0xfe5d('0x9')?_0xfe5d('0xa'):_0xfe5d('0xb'))+'Id';}function getInteractionFK(_0x2ff010){return _[_0xfe5d('0x8')](_0x2ff010)+_0xfe5d('0xc');}function getInteractionId(_0xb770e5,_0x4a1cbc,_0x35f52a){if(_0xb770e5&&_0xb770e5[_[_0xfe5d('0xd')](_0x35f52a)+_0xfe5d('0xc')]){return _0xb770e5[_['upperFirst'](_0x35f52a)+_0xfe5d('0xc')];}else if(_0xb770e5&&_0xb770e5['id']){return _0xb770e5['id'];}else if(_0x4a1cbc&&_0x4a1cbc['id']){return _0x4a1cbc['id'];}else{return _0xfe5d('0xe');}}function getInteractionsTables(_0x29514c){return{'accounts':_0x29514c+'_'+(_0x29514c==='chat'?_0xfe5d('0xf'):_0xfe5d('0x10')),'interactions':_0x29514c+_0xfe5d('0x11'),'interactionsTags':_0x29514c+'_interaction_has_tags','messages':_0x29514c+_0xfe5d('0x12'),'userInteractions':_0xfe5d('0x13')+_0x29514c+_0xfe5d('0x11')};}function getSelectedTags(_0x3df38c){var _0xc7a75e=[];if(_0x3df38c){_0xc7a75e=Array[_0xfe5d('0x14')](_0x3df38c)?_0x3df38c:[_0x3df38c];}return _0xc7a75e;}function log(_0x13a890,_0x5cccde,_0x48018d,_0x475c33,_0x1e0bef,_0x5b3e7d){loggers[_0x1e0bef[_0xfe5d('0x15')]()][_0x13a890](_0xfe5d('0x16'),_0x5b3e7d[_0xfe5d('0x17')](),_0x5cccde?_0x5cccde['id']:null,_0x5cccde?_0x5cccde[_0xfe5d('0x18')]:null,_0x5cccde?_0x5cccde[_0xfe5d('0x19')]:null,getInteractionId(_0x48018d,_0x475c33,_0x1e0bef),_0x48018d?JSON['stringify'](_0x48018d):_0xfe5d('0x1a'));}function updateUser(_0x30a6e5,_0x22de17,_0xd6b155,_0x18c9b1,_0x251858){db[_[_0xfe5d('0xd')](_0x18c9b1)+_0xfe5d('0x1b')]['findOne']({'where':{'id':getInteractionId(_0x22de17,_0xd6b155,_0x18c9b1)}})[_0xfe5d('0x1c')](function(_0x15906a){if(_0x15906a){return _0x15906a[_0xfe5d('0x1d')]({'UserId':_0x30a6e5?_0x30a6e5['id']:null});}})[_0xfe5d('0x1c')](function(_0x217ad9){if(_0x217ad9){log(_0xfe5d('0x1e'),_0x30a6e5,_0x22de17,_0xd6b155,_0x18c9b1,_0x251858);}})[_0xfe5d('0x1f')](function(){log(_0xfe5d('0x20'),_0x30a6e5,_0x22de17,_0xd6b155,_0x18c9b1,_0x251858);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x072c=['then','update','catch','error','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne'];(function(_0xffe22c,_0x358abf){var _0x514106=function(_0x5e19a8){while(--_0x5e19a8){_0xffe22c['push'](_0xffe22c['shift']());}};_0x514106(++_0x358abf);}(_0x072c,0x1e4));var _0xc072=function(_0x3da964,_0x1f2f8e){_0x3da964=_0x3da964-0x0;var _0x36830a=_0x072c[_0x3da964];return _0x36830a;};'use strict';var _=require('lodash');var db=require(_0xc072('0x0'))['db'];var loggers={'openchannel':require(_0xc072('0x1'))(_0xc072('0x2')),'mail':require('../../config/logger')(_0xc072('0x3')),'fax':require(_0xc072('0x1'))('fax-interactions'),'sms':require(_0xc072('0x1'))(_0xc072('0x4')),'chat':require(_0xc072('0x1'))(_0xc072('0x5')),'whatsapp':require(_0xc072('0x1'))(_0xc072('0x6'))};function getAccountFK(_0x3328f2){return _[_0xc072('0x7')](_0x3328f2)+(_0x3328f2===_0xc072('0x8')?_0xc072('0x9'):_0xc072('0xa'))+'Id';}function getInteractionFK(_0x1b4fa7){return _[_0xc072('0x7')](_0x1b4fa7)+_0xc072('0xb');}function getInteractionId(_0x92312e,_0x252523,_0x48fdb6){if(_0x92312e&&_0x92312e[_[_0xc072('0xc')](_0x48fdb6)+'InteractionId']){return _0x92312e[_[_0xc072('0xc')](_0x48fdb6)+_0xc072('0xb')];}else if(_0x92312e&&_0x92312e['id']){return _0x92312e['id'];}else if(_0x252523&&_0x252523['id']){return _0x252523['id'];}else{return _0xc072('0xd');}}function getInteractionsTables(_0x129d99){return{'accounts':_0x129d99+'_'+(_0x129d99===_0xc072('0x8')?_0xc072('0xe'):_0xc072('0xf')),'interactions':_0x129d99+_0xc072('0x10'),'interactionsTags':_0x129d99+_0xc072('0x11'),'messages':_0x129d99+'_messages','userInteractions':_0xc072('0x12')+_0x129d99+'_interactions'};}function getSelectedTags(_0x478a6f){var _0x2e8195=[];if(_0x478a6f){_0x2e8195=Array['isArray'](_0x478a6f)?_0x478a6f:[_0x478a6f];}return _0x2e8195;}function log(_0x3bf9cd,_0x492ea2,_0x237102,_0x57daa6,_0x4764db,_0xc5ea65){loggers[_0x4764db['toLowerCase']()][_0x3bf9cd](_0xc072('0x13'),_0xc5ea65[_0xc072('0x14')](),_0x492ea2?_0x492ea2['id']:null,_0x492ea2?_0x492ea2[_0xc072('0x15')]:null,_0x492ea2?_0x492ea2[_0xc072('0x16')]:null,getInteractionId(_0x237102,_0x57daa6,_0x4764db),_0x237102?JSON['stringify'](_0x237102):_0xc072('0x17'));}function updateUser(_0x379e9f,_0x590076,_0x3bb2eb,_0x29c94f,_0x572878){db[_[_0xc072('0xc')](_0x29c94f)+_0xc072('0x18')][_0xc072('0x19')]({'where':{'id':getInteractionId(_0x590076,_0x3bb2eb,_0x29c94f)}})[_0xc072('0x1a')](function(_0x5d313a){if(_0x5d313a){return _0x5d313a[_0xc072('0x1b')]({'UserId':_0x379e9f?_0x379e9f['id']:null});}})[_0xc072('0x1a')](function(_0x38a572){if(_0x38a572){log('info',_0x379e9f,_0x590076,_0x3bb2eb,_0x29c94f,_0x572878);}})[_0xc072('0x1c')](function(){log(_0xc072('0x1d'),_0x379e9f,_0x590076,_0x3bb2eb,_0x29c94f,_0x572878);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 1cac27d..13c8e8b 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 _0x3db0=['composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','format','utf8','final','parse','hasOwnProperty','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util'];(function(_0x572f1b,_0x9b4d72){var _0x1a9c6f=function(_0x400941){while(--_0x400941){_0x572f1b['push'](_0x572f1b['shift']());}};_0x1a9c6f(++_0x9b4d72);}(_0x3db0,0x7b));var _0x03db=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0x3db0[_0x5da54c];return _0x1246b0;};'use strict';var crypto=require(_0x03db('0x0'));var util=require(_0x03db('0x1'));var compose=require(_0x03db('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x03db('0x3'));function getValueFromLicense(_0x29109d,_0x56c314){if(_0x29109d&&_0x56c314){if(_0x56c314['data1']&&_0x56c314[_0x03db('0x4')]){var _0x504b52=_0x56c314[_0x03db('0x5')];var _0x11a5d2=_0x56c314[_0x03db('0x4')];var _0x24561e=_0x504b52[_0x03db('0x6')]('-')[0x4];var _0x42977c=_0x504b52[_0x03db('0x6')]('-')[0x0];var _0x445069=crypto['createDecipher'](_0x03db('0x7'),util[_0x03db('0x8')]('%s:%s:%s',_0x24561e,_0x504b52,_0x42977c));var _0x27e976=_0x445069['update'](_0x11a5d2,'base64',_0x03db('0x9'));_0x27e976+=_0x445069[_0x03db('0xa')]('utf8');var _0x46f4ea=JSON[_0x03db('0xb')](_0x27e976);return _0x46f4ea[_0x03db('0xc')](_0x29109d)?_0x46f4ea[_0x29109d]:null;}}return null;}function isLimit(_0x17016b,_0x23efa0,_0x23aeac,_0x3b0884){var _0x4c56db=_0x23efa0;return compose()['use'](function(_0x74efd,_0x55a6d9,_0x42d1e2){return db[_0x03db('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x03db('0xe')](function(_0x2408ee){var _0x370958=getValueFromLicense(_0x17016b,_0x2408ee);return _0x370958?_0x370958:_0x4c56db;})['then'](function(_0x52d22c){_0x4c56db=_0x52d22c;return _0x23aeac[_0x03db('0xf')](_0x3b0884);})[_0x03db('0xe')](function(_0x20da47){if(_0x20da47>=_0x4c56db){return _0x55a6d9[_0x03db('0x10')](0x193)[_0x03db('0x11')]({'message':util[_0x03db('0x8')](_0x03db('0x12'),_0x17016b)});}_0x42d1e2();})[_0x03db('0x13')](function(_0x1361ef){_0x42d1e2(_0x1361ef);});});}function isUserLimit(){return isLimit(_0x03db('0x14'),0x1,db[_0x03db('0x15')],{'where':{'$or':[{'role':_0x03db('0x16')},{'role':_0x03db('0x17')}]}});}exports[_0x03db('0x18')]=isUserLimit; \ No newline at end of file +var _0xcf34=['composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf34,0x15d));var _0x4cf3=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0xcf34[_0x5de1bc];return _0x19f4b8;};'use strict';var crypto=require(_0x4cf3('0x0'));var util=require(_0x4cf3('0x1'));var compose=require(_0x4cf3('0x2'));var db=require(_0x4cf3('0x3'))['db'];var config=require(_0x4cf3('0x4'));function getValueFromLicense(_0x28598c,_0x28ed25){if(_0x28598c&&_0x28ed25){if(_0x28ed25[_0x4cf3('0x5')]&&_0x28ed25[_0x4cf3('0x6')]){var _0x25aa96=_0x28ed25['data1'];var _0x1726f2=_0x28ed25['license'];var _0x4679b2=_0x25aa96[_0x4cf3('0x7')]('-')[0x4];var _0x57c026=_0x25aa96[_0x4cf3('0x7')]('-')[0x0];var _0x20a300=crypto['createDecipher'](_0x4cf3('0x8'),util[_0x4cf3('0x9')](_0x4cf3('0xa'),_0x4679b2,_0x25aa96,_0x57c026));var _0x5b7a0d=_0x20a300[_0x4cf3('0xb')](_0x1726f2,_0x4cf3('0xc'),_0x4cf3('0xd'));_0x5b7a0d+=_0x20a300[_0x4cf3('0xe')](_0x4cf3('0xd'));var _0x31f817=JSON[_0x4cf3('0xf')](_0x5b7a0d);return _0x31f817[_0x4cf3('0x10')](_0x28598c)?_0x31f817[_0x28598c]:null;}}return null;}function isLimit(_0x462644,_0x1c7d2f,_0x3951e2,_0x45a17b){var _0x3dbb06=_0x1c7d2f;return compose()[_0x4cf3('0x11')](function(_0x21be99,_0x177aa3,_0x56b660){return db[_0x4cf3('0x12')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x4cf3('0x13')](function(_0x32b138){var _0x2b67ca=getValueFromLicense(_0x462644,_0x32b138);return _0x2b67ca?_0x2b67ca:_0x3dbb06;})[_0x4cf3('0x13')](function(_0x563a6b){_0x3dbb06=_0x563a6b;return _0x3951e2['count'](_0x45a17b);})['then'](function(_0x1a2616){if(_0x1a2616>=_0x3dbb06){return _0x177aa3[_0x4cf3('0x14')](0x193)[_0x4cf3('0x15')]({'message':util[_0x4cf3('0x9')](_0x4cf3('0x16'),_0x462644)});}_0x56b660();})[_0x4cf3('0x17')](function(_0xa842fa){_0x56b660(_0xa842fa);});});}function isUserLimit(){return isLimit(_0x4cf3('0x18'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x4cf3('0x19')}]}});}exports[_0x4cf3('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 99f5414..5ef44cb 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2edb=['replace','split','slice','forEach','shift','filter','indexOf','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2edb,0x179));var _0xb2ed=function(_0x358bf3,_0x40ec1f){_0x358bf3=_0x358bf3-0x0;var _0x248106=_0x2edb[_0x358bf3];return _0x248106;};'use strict';var _=require(_0xb2ed('0x0'));var moment=require(_0xb2ed('0x1'));exports[_0xb2ed('0x2')]=function(_0x16c030){var _0x372327={'conditions':[]};_0x372327[_0xb2ed('0x3')]=_[_0xb2ed('0x4')](_0x16c030,_0xb2ed('0x5'))?'or':_0xb2ed('0x6');var _0x465148=_0x16c030['replace'](_0xb2ed('0x7'),'')[_0xb2ed('0x8')](_0xb2ed('0x5'),'')[_0xb2ed('0x9')]('||');for(var _0x374377=0x0;_0x374377<_0x465148['length'];_0x374377++){var _0x5c139a=_0x465148[_0x374377][_0xb2ed('0x9')](':=');var _0x271ec9=_0x5c139a[0x0];var _0x3c191e=_0x5c139a[_0xb2ed('0xa')](0x1);_0x3c191e[_0xb2ed('0xb')](function(_0x1cdc31){var _0x395a7d=_0x1cdc31[_0xb2ed('0x9')]('[')[_0xb2ed('0xc')]();var _0x5a8fbd=_0x1cdc31['match'](/\[(.*?)\]/g);_0x5a8fbd[_0xb2ed('0xb')](function(_0x861f7e){var _0x4cfdf4=_0x861f7e[_0xb2ed('0x9')]('[')[_0xb2ed('0xd')](function(_0x308478){return _0x308478[_0xb2ed('0xe')](']')>-0x1;})['map'](function(_0x49da90){return _0x49da90[_0xb2ed('0x9')](']')[0x0];})[0x0];_0x372327['conditions'][_0xb2ed('0xf')]({'field':_0x271ec9,'operator':_0x395a7d,'value':_0x4cfdf4});});});}return _0x372327;};exports[_0xb2ed('0x10')]=function(_0x4a2c4c,_0x11c5cc,_0x233d29){var _0x492d1e={};if(_0x11c5cc===_0xb2ed('0x11')){if(_0x233d29[_0xb2ed('0x12')]===_0xb2ed('0x13')){_0x233d29['operator']=_0xb2ed('0x14');_0x233d29[_0xb2ed('0x15')]+=','+_0x233d29['value'];}else if(_['includes']([_0xb2ed('0x16'),_0xb2ed('0x17')],_0x233d29['operator'])){_0x233d29['value']=moment(_0x233d29[_0xb2ed('0x15')])[_0xb2ed('0x18')](0x1,_0xb2ed('0x19'))[_0xb2ed('0x1a')](_0xb2ed('0x1b'));}}if(_0x233d29[_0xb2ed('0x1c')]){_0x11c5cc=_0x233d29['castTo'];_0x492d1e[_0xb2ed('0x1d')]=_0xb2ed('0x1e')+_0x4a2c4c+'.'+_0x233d29[_0xb2ed('0x1f')]+'\x20AS\x20'+_0x233d29['castTo']+')\x20'+parseOperator(_0x233d29[_0xb2ed('0x12')]);}else{_0x492d1e[_0xb2ed('0x1d')]=_0x4a2c4c+'.'+_0x233d29[_0xb2ed('0x1f')]+'\x20'+parseOperator(_0x233d29[_0xb2ed('0x12')]);}if(_['includes']([_0xb2ed('0x20'),'$notIn'],_0x233d29[_0xb2ed('0x12')]))_0x492d1e[_0xb2ed('0x1d')]='('+_0x492d1e[_0xb2ed('0x1d')]+_0xb2ed('0x21')+_0x4a2c4c+'.'+_0x233d29[_0xb2ed('0x1f')]+_0xb2ed('0x22');_0x492d1e[_0xb2ed('0x15')]=parseValue(_0x11c5cc,_0x233d29[_0xb2ed('0x12')],_0x233d29[_0xb2ed('0x15')]);return _0x492d1e;};function parseOperator(_0x1176f8){var _0x2f7ac3;switch(_0x1176f8){case'$in':_0x2f7ac3='IN\x20?';break;case _0xb2ed('0x23'):_0x2f7ac3=_0xb2ed('0x24');break;case _0xb2ed('0x13'):_0x2f7ac3=_0xb2ed('0x25');break;case _0xb2ed('0x20'):_0x2f7ac3=_0xb2ed('0x26');break;case _0xb2ed('0x27'):case _0xb2ed('0x28'):case _0xb2ed('0x29'):_0x2f7ac3=_0xb2ed('0x2a');break;case _0xb2ed('0x2b'):_0x2f7ac3=_0xb2ed('0x2c');break;case'$gt':_0x2f7ac3=_0xb2ed('0x2d');break;case _0xb2ed('0x17'):_0x2f7ac3=_0xb2ed('0x2e');break;case _0xb2ed('0x2f'):_0x2f7ac3='>=\x20?';break;case _0xb2ed('0x14'):_0x2f7ac3=_0xb2ed('0x30');break;}return _0x2f7ac3;}function parseValue(_0x275242,_0x5842b8,_0x51c1f9){var _0x388574={'start':undefined,'end':undefined};switch(_0x5842b8){case _0xb2ed('0x31'):case _0xb2ed('0x23'):_0x388574[_0xb2ed('0x32')]=_0x51c1f9[_0xb2ed('0x9')](',');break;case _0xb2ed('0x27'):_0x388574[_0xb2ed('0x32')]='%'+_0x51c1f9+'%';break;case _0xb2ed('0x28'):_0x388574[_0xb2ed('0x32')]=_0x51c1f9+'%';break;case'$endsWith':_0x388574['start']='%'+_0x51c1f9;break;case _0xb2ed('0x14'):var _0x251249=_0x51c1f9[_0xb2ed('0x9')](',');var _0x51c1f9=_0x251249[_0xb2ed('0xc')]();var _0x831f5=_0x251249[_0xb2ed('0x33')]();if(_0x275242===_0xb2ed('0x11')){_0x51c1f9=moment(_0x51c1f9)[_0xb2ed('0x34')](0x0,!![])['format']();_0x831f5=moment(_0x831f5)[_0xb2ed('0x34')](0x0,!![])[_0xb2ed('0x18')](0x17,_0xb2ed('0x35'))[_0xb2ed('0x18')](0x3b,'minutes')[_0xb2ed('0x18')](0x3b,_0xb2ed('0x36'))[_0xb2ed('0x1a')]();}_0x388574={'start':_0x51c1f9,'end':_0x831f5};break;default:_0x388574[_0xb2ed('0x32')]=_0x51c1f9;break;}return _0x388574;} \ No newline at end of file +var _0x7b57=['add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x7b57,0xb4));var _0x77b5=function(_0xc0b974,_0xcc89c2){_0xc0b974=_0xc0b974-0x0;var _0xccdf7b=_0x7b57[_0xc0b974];return _0xccdf7b;};'use strict';var _=require(_0x77b5('0x0'));var moment=require(_0x77b5('0x1'));exports[_0x77b5('0x2')]=function(_0x507ae6){var _0x3d6ef3={'conditions':[]};_0x3d6ef3[_0x77b5('0x3')]=_[_0x77b5('0x4')](_0x507ae6,_0x77b5('0x5'))?'or':_0x77b5('0x6');var _0x111f24=_0x507ae6[_0x77b5('0x7')](_0x77b5('0x8'),'')[_0x77b5('0x7')](_0x77b5('0x5'),'')['split']('||');for(var _0x6a65b8=0x0;_0x6a65b8<_0x111f24['length'];_0x6a65b8++){var _0x5256cf=_0x111f24[_0x6a65b8][_0x77b5('0x9')](':=');var _0x3b2bab=_0x5256cf[0x0];var _0xae956a=_0x5256cf[_0x77b5('0xa')](0x1);_0xae956a[_0x77b5('0xb')](function(_0x36055c){var _0x3b5b10=_0x36055c[_0x77b5('0x9')]('[')['shift']();var _0x1046cc=_0x36055c[_0x77b5('0xc')](/\[(.*?)\]/g);_0x1046cc[_0x77b5('0xb')](function(_0x379222){var _0x38b33c=_0x379222[_0x77b5('0x9')]('[')[_0x77b5('0xd')](function(_0x2854a7){return _0x2854a7[_0x77b5('0xe')](']')>-0x1;})[_0x77b5('0xf')](function(_0x3b60df){return _0x3b60df[_0x77b5('0x9')](']')[0x0];})[0x0];_0x3d6ef3[_0x77b5('0x10')][_0x77b5('0x11')]({'field':_0x3b2bab,'operator':_0x3b5b10,'value':_0x38b33c});});});}return _0x3d6ef3;};exports['buildExpression']=function(_0xa6f44,_0x75a631,_0x43291d){var _0x312569={};if(_0x75a631===_0x77b5('0x12')){if(_0x43291d[_0x77b5('0x13')]===_0x77b5('0x14')){_0x43291d[_0x77b5('0x13')]=_0x77b5('0x15');_0x43291d[_0x77b5('0x16')]+=','+_0x43291d[_0x77b5('0x16')];}else if(_[_0x77b5('0x17')](['$gt',_0x77b5('0x18')],_0x43291d['operator'])){_0x43291d['value']=moment(_0x43291d['value'])['add'](0x1,_0x77b5('0x19'))[_0x77b5('0x1a')](_0x77b5('0x1b'));}}if(_0x43291d[_0x77b5('0x1c')]){_0x75a631=_0x43291d[_0x77b5('0x1c')];_0x312569[_0x77b5('0x1d')]=_0x77b5('0x1e')+_0xa6f44+'.'+_0x43291d[_0x77b5('0x1f')]+_0x77b5('0x20')+_0x43291d[_0x77b5('0x1c')]+')\x20'+parseOperator(_0x43291d[_0x77b5('0x13')]);}else{_0x312569[_0x77b5('0x1d')]=_0xa6f44+'.'+_0x43291d[_0x77b5('0x1f')]+'\x20'+parseOperator(_0x43291d[_0x77b5('0x13')]);}if(_[_0x77b5('0x17')](['$ne',_0x77b5('0x21')],_0x43291d[_0x77b5('0x13')]))_0x312569[_0x77b5('0x1d')]='('+_0x312569[_0x77b5('0x1d')]+_0x77b5('0x22')+_0xa6f44+'.'+_0x43291d[_0x77b5('0x1f')]+_0x77b5('0x23');_0x312569['value']=parseValue(_0x75a631,_0x43291d[_0x77b5('0x13')],_0x43291d['value']);return _0x312569;};function parseOperator(_0x3842cf){var _0x440258;switch(_0x3842cf){case _0x77b5('0x24'):_0x440258=_0x77b5('0x25');break;case _0x77b5('0x21'):_0x440258=_0x77b5('0x26');break;case _0x77b5('0x14'):_0x440258='=\x20?';break;case _0x77b5('0x27'):_0x440258=_0x77b5('0x28');break;case _0x77b5('0x29'):case _0x77b5('0x2a'):case _0x77b5('0x2b'):_0x440258=_0x77b5('0x2c');break;case _0x77b5('0x2d'):_0x440258='<\x20?';break;case _0x77b5('0x2e'):_0x440258=_0x77b5('0x2f');break;case _0x77b5('0x18'):_0x440258=_0x77b5('0x30');break;case _0x77b5('0x31'):_0x440258=_0x77b5('0x32');break;case'$between':_0x440258=_0x77b5('0x33');break;}return _0x440258;}function parseValue(_0x48177b,_0x278f22,_0x44ad21){var _0x5eadf5={'start':undefined,'end':undefined};switch(_0x278f22){case _0x77b5('0x24'):case _0x77b5('0x21'):_0x5eadf5[_0x77b5('0x34')]=_0x44ad21[_0x77b5('0x9')](',');break;case _0x77b5('0x29'):_0x5eadf5[_0x77b5('0x34')]='%'+_0x44ad21+'%';break;case'$startsWith':_0x5eadf5[_0x77b5('0x34')]=_0x44ad21+'%';break;case _0x77b5('0x2b'):_0x5eadf5[_0x77b5('0x34')]='%'+_0x44ad21;break;case _0x77b5('0x15'):var _0x21bdfa=_0x44ad21['split'](',');var _0x44ad21=_0x21bdfa[_0x77b5('0x35')]();var _0x366bb9=_0x21bdfa[_0x77b5('0x36')]();if(_0x48177b==='DATE'){_0x44ad21=moment(_0x44ad21)[_0x77b5('0x37')](0x0,!![])[_0x77b5('0x1a')]();_0x366bb9=moment(_0x366bb9)[_0x77b5('0x37')](0x0,!![])[_0x77b5('0x38')](0x17,'hours')[_0x77b5('0x38')](0x3b,_0x77b5('0x39'))['add'](0x3b,_0x77b5('0x3a'))[_0x77b5('0x1a')]();}_0x5eadf5={'start':_0x44ad21,'end':_0x366bb9};break;default:_0x5eadf5[_0x77b5('0x34')]=_0x44ad21;break;}return _0x5eadf5;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 64c7340..b66baa9 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 _0x5162=['attributes','limit','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','lodash','parse','keys','includes','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','col','substr','DESC','unsigned','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','intersection'];(function(_0x2013c7,_0x59f933){var _0x146363=function(_0x2960f6){while(--_0x2960f6){_0x2013c7['push'](_0x2013c7['shift']());}};_0x146363(++_0x59f933);}(_0x5162,0x103));var _0x2516=function(_0x32c9b9,_0x21a0cf){_0x32c9b9=_0x32c9b9-0x0;var _0x239eab=_0x5162[_0x32c9b9];return _0x239eab;};'use strict';var _=require(_0x2516('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5194e6){var _0x4db25c=['ne'];try{var _0x41fd28=JSON[_0x2516('0x1')](_0x5194e6);var _0x3ce7de=Object[_0x2516('0x2')](_0x41fd28)[0x0];return _0x4db25c[_0x2516('0x3')](_0x3ce7de);}catch(_0x25dce6){return![];}}function getOperatorValue(_0x3a7984){var _0x5b71b5=JSON['parse'](_0x3a7984);var _0x5beeb3=Object[_0x2516('0x2')](_0x5b71b5)[0x0];var _0xba4b36=_0x5b71b5[_0x5beeb3];return{['$'+_0x5beeb3]:_0xba4b36};}exports[_0x2516('0x4')]=function(_0x3a8834){var _0x3abc5d=null;if(_0x3a8834){_0x3abc5d=_0x3a8834[_0x2516('0x5')](',');}return _0x3abc5d;};exports[_0x2516('0x6')]=function(_0x590875,_0x409550){var _0x3f7e71={};if(!_[_0x2516('0x7')](_0x590875)){_['forOwn'](_0x590875,function(_0x530b1b,_0x4ba807){try{if(_0x409550){var _0x4ceaa1=_[_0x2516('0x8')](_0x409550,{'name':_0x4ba807})||{};if(hasSequelizeOperator(_0x530b1b)){_0x3f7e71[_0x4ba807]=getOperatorValue(_0x530b1b);}else if(_0x4ceaa1[_0x2516('0x9')]===_0x2516('0xa')&&_[_0x2516('0xb')](_0x530b1b)){var _0x56c69c=JSON[_0x2516('0x1')](_0x530b1b);var _0x458aca={'$gte':moment(moment(_0x56c69c[_0x2516('0xc')])[_0x2516('0xd')](_0x2516('0xe')))[_0x2516('0xf')]()[_0x2516('0xd')](),'$lte':moment(moment(_0x56c69c[_0x2516('0x10')])[_0x2516('0xd')](_0x2516('0xe')))[_0x2516('0xf')]()[_0x2516('0x11')](0x1,'s')[_0x2516('0xd')]()};_0x3f7e71[_0x4ba807]=_0x458aca;}else if(_0x4ceaa1[_0x2516('0x12')]===_0x2516('0x13')){_0x3f7e71[_0x4ba807]=_0x530b1b;}else{_0x3f7e71[_0x4ba807]=_['isArray'](_0x530b1b)?_0x530b1b:JSON[_0x2516('0x1')](_0x530b1b);}}else{_0x3f7e71[_0x4ba807]=_[_0x2516('0x14')](_0x530b1b)?_0x530b1b:JSON[_0x2516('0x1')](_0x530b1b);}}catch(_0x564d05){_0x3f7e71[_0x4ba807]=_0x530b1b[_0x2516('0x5')](',');}});}return _0x3f7e71;};exports['limit']=function(_0x532d46){_0x532d46=parseInt(_0x532d46,0xa);if(!_0x532d46||_0x532d46<0x0){_0x532d46=LIMIT_VALUE;}return _0x532d46;};exports[_0x2516('0x15')]=function(_0x3583cf){_0x3583cf=parseInt(_0x3583cf,0xa);if(!_0x3583cf||_0x3583cf<0x0){_0x3583cf=0x0;}return _0x3583cf;};exports[_0x2516('0x16')]=function(_0x618aed){var _0x198b93,_0x42ba50=null;if(_0x618aed){_0x198b93=_0x618aed[_0x2516('0x5')](',');_0x42ba50=_[_0x2516('0x17')](_0x198b93,function(_0x248c5a){if(_0x248c5a[_0x2516('0x18')]('-')===0x0){return[_0x248c5a===_0x2516('0x19')?sequelize[_0x2516('0x1a')](sequelize[_0x2516('0x1b')]('priority'),'unsigned'):_0x248c5a[_0x2516('0x1c')](0x1),_0x2516('0x1d')];}else{return[_0x248c5a===_0x2516('0x19')?sequelize[_0x2516('0x1a')](sequelize[_0x2516('0x1b')](_0x2516('0x19')),_0x2516('0x1e')):_0x248c5a,_0x2516('0x1f')];}});}return _0x42ba50;};exports['omit']=function(_0xa4538d,_0x39c63f){if(_[_0x2516('0x7')](_0xa4538d)){return _0xa4538d;}if(_[_0x2516('0x14')](_0xa4538d)){for(var _0x47f4fb=0x0;_0x47f4fb<_0xa4538d[_0x2516('0x20')];_0x47f4fb+=0x1){_0xa4538d[_0x47f4fb]=this[_0x2516('0x21')](_0xa4538d[_0x47f4fb],_0x39c63f);}return _0xa4538d;}if(!_[_0x2516('0x22')](_0xa4538d)){return _0xa4538d;}if(_[_0x2516('0x23')](_0x39c63f)){_0x39c63f=[_0x39c63f];}if(!_[_0x2516('0x14')](_0x39c63f)){return _0xa4538d;}for(var _0x4a3dc8=0x0;_0x4a3dc8<_0x39c63f[_0x2516('0x20')];_0x4a3dc8+=0x1){_[_0x2516('0x24')](_0xa4538d,_0x39c63f[_0x4a3dc8]);}for(var _0x935035 in _0xa4538d){if(_0xa4538d[_0x2516('0x25')](_0x935035)){_0xa4538d[_0x935035]=this[_0x2516('0x21')](_0xa4538d[_0x935035],_0x39c63f);}}return _0xa4538d;};exports[_0x2516('0x26')]=function(_0x556f01){return _0x556f01[_0x2516('0x27')](RegExp(_0x2516('0x28')))?!![]:![];};exports['isEmail']=function(_0x19d90d){return _0x19d90d[_0x2516('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x2516('0x29')]=function(_0x3b1aa6){var _0x539704=[];_0x3b1aa6[_0x2516('0x5')](/[ ,]+/)[_0x2516('0x2a')](function(_0x3c1daf){_0x3c1daf=_0x3c1daf[_0x2516('0x2b')](/([^:]")"+/g,'$1');_0x3c1daf='+'+_0x3c1daf+'*';var _0x12d790=/[ `!@#$%^&*()_\-?~]/;if(_0x3c1daf[_0x2516('0x27')](_0x12d790))_0x3c1daf='\x22'+_0x3c1daf+'\x22';_0x539704[_0x2516('0x2c')](_0x3c1daf);});return _0x539704[_0x2516('0x2d')]('\x20');};exports[_0x2516('0x2e')]=function(_0xe29221,_0x56fda8,_0x3e7a55){var _0x54147b={},_0x35fdf8={};if(_0x56fda8['query'][_0x2516('0x2f')]){_0x56fda8['query']['id']=_0x56fda8[_0x2516('0x30')][_0x2516('0x2f')];delete _0x56fda8[_0x2516('0x30')][_0x2516('0x2f')];}_0x54147b[_0x2516('0x31')]=_[_0x2516('0x17')](_0xe29221,_0x2516('0x12'));_0x54147b[_0x2516('0x30')]=_[_0x2516('0x2')](_0x56fda8['query']);_0x54147b[_0x2516('0x6')]=_[_0x2516('0x32')](_0x54147b[_0x2516('0x31')],_0x54147b[_0x2516('0x30')]);_0x35fdf8['attributes']=_['intersection'](_0x54147b[_0x2516('0x31')],this[_0x2516('0x4')](_0x56fda8[_0x2516('0x30')][_0x2516('0x4')]));_0x35fdf8[_0x2516('0x33')]=_0x35fdf8[_0x2516('0x33')][_0x2516('0x20')]?_0x35fdf8[_0x2516('0x33')]:_0x54147b[_0x2516('0x31')];if(!_0x56fda8[_0x2516('0x30')]['hasOwnProperty']('nolimit')){_0x35fdf8[_0x2516('0x34')]=this[_0x2516('0x34')](_0x56fda8['query']['limit']);_0x35fdf8[_0x2516('0x15')]=this[_0x2516('0x15')](_0x56fda8['query'][_0x2516('0x15')]);}_0x35fdf8['order']=this[_0x2516('0x16')](_0x56fda8[_0x2516('0x30')]['sort']);_0x35fdf8[_0x2516('0x35')]=this[_0x2516('0x6')](_[_0x2516('0x36')](_0x56fda8[_0x2516('0x30')],_0x54147b[_0x2516('0x6')]),_0xe29221);if(_0x56fda8[_0x2516('0x30')][_0x2516('0x37')]){var _0x2371a8=_0xe29221;var _0x346e31=_0x56fda8[_0x2516('0x30')][_0x2516('0x37')];if(typeof _0x346e31===_0x2516('0x38')){_0x2371a8=_[_0x2516('0x37')](_0xe29221,function(_0x4c832b){return _[_0x2516('0x3')](_0x346e31[_0x2516('0x39')],_0x4c832b['name']);});_0x346e31=_0x346e31[_0x2516('0x3a')];}_0x35fdf8[_0x2516('0x35')]=_[_0x2516('0x3b')](_0x35fdf8[_0x2516('0x35')],{'$or':_[_0x2516('0x17')](_0x2371a8,function(_0x582cb6){if(_0x582cb6[_0x2516('0x9')]!==_0x2516('0x3c')){if(_0x3e7a55){return sequelize[_0x2516('0x35')](sequelize['fn'](_0x2516('0x3d'),sequelize[_0x2516('0x1b')](_0x582cb6[_0x2516('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x56fda8[_0x2516('0x30')][_0x2516('0x37')]+'%')});}else{var _0xe64acc={};_0xe64acc[_0x582cb6[_0x2516('0x12')]]={'$like':'%'+_0x56fda8[_0x2516('0x30')][_0x2516('0x37')]+'%'};return _0xe64acc;}}})});}_0x35fdf8=_[_0x2516('0x3b')]({},_0x35fdf8,_0x56fda8['options']);return _0x35fdf8;}; \ No newline at end of file +var _0xa5ed=['isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join','getOptions','$id','query','name','intersection','model','attributes','hasOwnProperty','sort','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','map','indexOf','priority','cast','col','unsigned','ASC','omit','length','isObject','isString','unset'];(function(_0x30da45,_0x2741bc){var _0x1e3973=function(_0x268122){while(--_0x268122){_0x30da45['push'](_0x30da45['shift']());}};_0x1e3973(++_0x2741bc);}(_0xa5ed,0x9e));var _0xda5e=function(_0x6abcdf,_0xb0efa1){_0x6abcdf=_0x6abcdf-0x0;var _0x173b63=_0xa5ed[_0x6abcdf];return _0x173b63;};'use strict';var _=require(_0xda5e('0x0'));var sequelize=require(_0xda5e('0x1'));var moment=require(_0xda5e('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2733fd){var _0x43476a=['ne'];try{var _0x405c2f=JSON['parse'](_0x2733fd);var _0x5e61d7=Object[_0xda5e('0x3')](_0x405c2f)[0x0];return _0x43476a[_0xda5e('0x4')](_0x5e61d7);}catch(_0x4b92bb){return![];}}function getOperatorValue(_0x4e0fef){var _0x2a8cc6=JSON[_0xda5e('0x5')](_0x4e0fef);var _0x11dfc9=Object[_0xda5e('0x3')](_0x2a8cc6)[0x0];var _0x2a0c42=_0x2a8cc6[_0x11dfc9];return{['$'+_0x11dfc9]:_0x2a0c42};}exports[_0xda5e('0x6')]=function(_0x5254dd){var _0x24942d=null;if(_0x5254dd){_0x24942d=_0x5254dd[_0xda5e('0x7')](',');}return _0x24942d;};exports[_0xda5e('0x8')]=function(_0x1af8b5,_0x502aee){var _0x4b264d={};if(!_[_0xda5e('0x9')](_0x1af8b5)){_[_0xda5e('0xa')](_0x1af8b5,function(_0x595c4f,_0xc72947){try{if(_0x502aee){var _0x290daa=_[_0xda5e('0xb')](_0x502aee,{'name':_0xc72947})||{};if(hasSequelizeOperator(_0x595c4f)){_0x4b264d[_0xc72947]=getOperatorValue(_0x595c4f);}else if(_0x290daa[_0xda5e('0xc')]===_0xda5e('0xd')&&_[_0xda5e('0xe')](_0x595c4f)){var _0x11132c=JSON[_0xda5e('0x5')](_0x595c4f);var _0x4afa33={'$gte':moment(moment(_0x11132c[_0xda5e('0xf')])[_0xda5e('0x10')](_0xda5e('0x11')))[_0xda5e('0x12')]()[_0xda5e('0x10')](),'$lte':moment(moment(_0x11132c[_0xda5e('0x13')])[_0xda5e('0x10')](_0xda5e('0x11')))[_0xda5e('0x12')]()[_0xda5e('0x14')](0x1,'s')['format']()};_0x4b264d[_0xc72947]=_0x4afa33;}else if(_0x290daa['name']===_0xda5e('0x15')){_0x4b264d[_0xc72947]=_0x595c4f;}else{_0x4b264d[_0xc72947]=_[_0xda5e('0x16')](_0x595c4f)?_0x595c4f:JSON[_0xda5e('0x5')](_0x595c4f);}}else{_0x4b264d[_0xc72947]=_['isArray'](_0x595c4f)?_0x595c4f:JSON[_0xda5e('0x5')](_0x595c4f);}}catch(_0x3b5ef0){_0x4b264d[_0xc72947]=_0x595c4f[_0xda5e('0x7')](',');}});}return _0x4b264d;};exports[_0xda5e('0x17')]=function(_0x126bd0){_0x126bd0=parseInt(_0x126bd0,0xa);if(!_0x126bd0||_0x126bd0<0x0){_0x126bd0=LIMIT_VALUE;}return _0x126bd0;};exports[_0xda5e('0x18')]=function(_0x31847e){_0x31847e=parseInt(_0x31847e,0xa);if(!_0x31847e||_0x31847e<0x0){_0x31847e=0x0;}return _0x31847e;};exports['sort']=function(_0x46f325){var _0x2875d2,_0xcb9c93=null;if(_0x46f325){_0x2875d2=_0x46f325[_0xda5e('0x7')](',');_0xcb9c93=_[_0xda5e('0x19')](_0x2875d2,function(_0x37ea33){if(_0x37ea33[_0xda5e('0x1a')]('-')===0x0){return[_0x37ea33===_0xda5e('0x1b')?sequelize[_0xda5e('0x1c')](sequelize[_0xda5e('0x1d')](_0xda5e('0x1b')),'unsigned'):_0x37ea33['substr'](0x1),'DESC'];}else{return[_0x37ea33===_0xda5e('0x1b')?sequelize['cast'](sequelize[_0xda5e('0x1d')](_0xda5e('0x1b')),_0xda5e('0x1e')):_0x37ea33,_0xda5e('0x1f')];}});}return _0xcb9c93;};exports[_0xda5e('0x20')]=function(_0x5ea6ba,_0x5e2143){if(_[_0xda5e('0x9')](_0x5ea6ba)){return _0x5ea6ba;}if(_[_0xda5e('0x16')](_0x5ea6ba)){for(var _0x3bff24=0x0;_0x3bff24<_0x5ea6ba[_0xda5e('0x21')];_0x3bff24+=0x1){_0x5ea6ba[_0x3bff24]=this[_0xda5e('0x20')](_0x5ea6ba[_0x3bff24],_0x5e2143);}return _0x5ea6ba;}if(!_[_0xda5e('0x22')](_0x5ea6ba)){return _0x5ea6ba;}if(_[_0xda5e('0x23')](_0x5e2143)){_0x5e2143=[_0x5e2143];}if(!_[_0xda5e('0x16')](_0x5e2143)){return _0x5ea6ba;}for(var _0x47c6b9=0x0;_0x47c6b9<_0x5e2143[_0xda5e('0x21')];_0x47c6b9+=0x1){_[_0xda5e('0x24')](_0x5ea6ba,_0x5e2143[_0x47c6b9]);}for(var _0x14c3fd in _0x5ea6ba){if(_0x5ea6ba['hasOwnProperty'](_0x14c3fd)){_0x5ea6ba[_0x14c3fd]=this[_0xda5e('0x20')](_0x5ea6ba[_0x14c3fd],_0x5e2143);}}return _0x5ea6ba;};exports[_0xda5e('0x25')]=function(_0x4ca42b){return _0x4ca42b[_0xda5e('0x26')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xda5e('0x27')]=function(_0x5dd272){return _0x5dd272[_0xda5e('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xda5e('0x28')]=function(_0x2a54b8,_0x269f8e){var _0x2c7fe3=[];var _0x16a076=/[ `!@#$%^&*()_\-?~]/;var _0x3febba=_0x269f8e?_0xda5e('0x29'):_0xda5e('0x2a');_0x2a54b8[_0xda5e('0x7')](/[ ,]+/)['forEach'](function(_0x11cc3a){_0x11cc3a=_0x11cc3a[_0xda5e('0x2b')](/([^:]")"+/g,'$1');_0x11cc3a='+'+_0x11cc3a+'*';var _0x272522=_0x11cc3a[_0xda5e('0x26')](_0x16a076);if(_0x272522){_0x11cc3a='\x22'+_0x11cc3a+'\x22';}_0x2c7fe3[_0xda5e('0x2c')](_0x11cc3a);});_0x3febba=_0x3febba[_0xda5e('0x2b')](_0xda5e('0x2a'),_0x2c7fe3[_0xda5e('0x2d')]('\x20'));return _0x3febba;};exports[_0xda5e('0x2e')]=function(_0xd572e9,_0x548ee1,_0x5bab9d){var _0x451014={},_0x1d1ba2={};if(_0x548ee1['query'][_0xda5e('0x2f')]){_0x548ee1[_0xda5e('0x30')]['id']=_0x548ee1['query']['$id'];delete _0x548ee1[_0xda5e('0x30')][_0xda5e('0x2f')];}_0x451014['model']=_[_0xda5e('0x19')](_0xd572e9,_0xda5e('0x31'));_0x451014[_0xda5e('0x30')]=_[_0xda5e('0x3')](_0x548ee1[_0xda5e('0x30')]);_0x451014[_0xda5e('0x8')]=_[_0xda5e('0x32')](_0x451014[_0xda5e('0x33')],_0x451014[_0xda5e('0x30')]);_0x1d1ba2['attributes']=_[_0xda5e('0x32')](_0x451014[_0xda5e('0x33')],this[_0xda5e('0x6')](_0x548ee1['query'][_0xda5e('0x6')]));_0x1d1ba2['attributes']=_0x1d1ba2[_0xda5e('0x34')][_0xda5e('0x21')]?_0x1d1ba2[_0xda5e('0x34')]:_0x451014['model'];if(!_0x548ee1['query'][_0xda5e('0x35')]('nolimit')){_0x1d1ba2['limit']=this[_0xda5e('0x17')](_0x548ee1[_0xda5e('0x30')][_0xda5e('0x17')]);_0x1d1ba2[_0xda5e('0x18')]=this[_0xda5e('0x18')](_0x548ee1[_0xda5e('0x30')][_0xda5e('0x18')]);}_0x1d1ba2['order']=this[_0xda5e('0x36')](_0x548ee1['query'][_0xda5e('0x36')]);_0x1d1ba2[_0xda5e('0x37')]=this[_0xda5e('0x8')](_[_0xda5e('0x38')](_0x548ee1[_0xda5e('0x30')],_0x451014[_0xda5e('0x8')]),_0xd572e9);if(_0x548ee1[_0xda5e('0x30')][_0xda5e('0x39')]){var _0x2a986b=_0xd572e9;var _0x1aa7ab=_0x548ee1['query']['filter'];if(typeof _0x1aa7ab===_0xda5e('0x3a')){_0x2a986b=_[_0xda5e('0x39')](_0xd572e9,function(_0x371f40){return _['includes'](_0x1aa7ab[_0xda5e('0x3b')],_0x371f40[_0xda5e('0x31')]);});_0x1aa7ab=_0x1aa7ab[_0xda5e('0x3c')];}_0x1d1ba2[_0xda5e('0x37')]=_[_0xda5e('0x3d')](_0x1d1ba2['where'],{'$or':_['map'](_0x2a986b,function(_0x35f34f){if(_0x35f34f[_0xda5e('0xc')]!==_0xda5e('0x3e')){if(_0x5bab9d){return sequelize[_0xda5e('0x37')](sequelize['fn'](_0xda5e('0x3f'),sequelize[_0xda5e('0x1d')](_0x35f34f['name'])),{'$like':sequelize['fn']('lower','%'+_0x548ee1[_0xda5e('0x30')][_0xda5e('0x39')]+'%')});}else{var _0x5cf737={};_0x5cf737[_0x35f34f['name']]={'$like':'%'+_0x548ee1[_0xda5e('0x30')][_0xda5e('0x39')]+'%'};return _0x5cf737;}}})});}_0x1d1ba2=_[_0xda5e('0x3d')]({},_0x1d1ba2,_0x548ee1[_0xda5e('0x40')]);return _0x1d1ba2;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 9a79f92..f9fe051 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x707a=['ringing','isNil','voiceStatus','voicePause','pause','chatStatus','openchannelStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','getAgentIdsByStatus','includes','User','name','fullname','chatPause','whatsappPause','pauseType','merge','split','fields','globalStatus','startsWith','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','DESC','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','lodash','jayson/promise','client','faxPause','mailPause','openchannelPause','smsPause','every','filter','length','idle','unavailable'];(function(_0x4dc1d8,_0x56976e){var _0x3f56cd=function(_0x378313){while(--_0x378313){_0x4dc1d8['push'](_0x4dc1d8['shift']());}};_0x3f56cd(++_0x56976e);}(_0x707a,0x102));var _0xa707=function(_0x3cf64b,_0x5d2fee){_0x3cf64b=_0x3cf64b-0x0;var _0x183727=_0x707a[_0x3cf64b];return _0x183727;};'use strict';var _=require(_0xa707('0x0'));var jayson=require(_0xa707('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xa707('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xa707('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x38bc3a,_0x29e12d){var _0x43e81f=[_0x38bc3a['chatPause'],_0x38bc3a[_0xa707('0x3')],_0x38bc3a[_0xa707('0x4')],_0x38bc3a[_0xa707('0x5')],_0x38bc3a[_0xa707('0x6')],_0x38bc3a['voicePause'],_0x38bc3a['whatsappPause']];if(!_0x29e12d)return _[_0xa707('0x7')](_0x43e81f);var _0x597e92=_[_0xa707('0x8')](_0x43e81f);return _0x597e92[_0xa707('0x9')]>0x0&&_0x597e92[_0xa707('0x9')]<_0x43e81f[_0xa707('0x9')]?!![]:![];}function isIdle(_0x4292fa){return _0x4292fa===_0xa707('0xa')||_0x4292fa==='unknown'||_0x4292fa===_0xa707('0xb')||_0x4292fa===_0xa707('0xc')||_[_0xa707('0xd')](_0x4292fa);}function isAgentIdle(_0x1e71f9){if(_0x1e71f9[_0xa707('0xe')]!==_0xa707('0xa')&&_0x1e71f9[_0xa707('0xf')]){_0x1e71f9[_0xa707('0xe')]=_0xa707('0x10');return![];}return _[_0xa707('0x7')]([_0x1e71f9[_0xa707('0x11')],_0x1e71f9['faxStatus'],_0x1e71f9['mailStatus'],_0x1e71f9[_0xa707('0x12')],_0x1e71f9['smsStatus'],_0x1e71f9['voiceStatus'],_0x1e71f9[_0xa707('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0xa707('0x14')](function(_0x470094){if(_0x470094[_0xa707('0x15')]){throw new Error(_0xa707('0x16'));}var _0x1ea568=_0x470094[_0xa707('0x17')];return routingClient['request']('Agents',{})[_0xa707('0x14')](function(_0x5c913d){if(_0x5c913d['error']){throw new Error(_0xa707('0x18'));}var _0x42ec8f=_0x5c913d[_0xa707('0x17')];return _['merge']({},_0x1ea568,_0x42ec8f);});})[_0xa707('0x19')](function(_0x329df2){throw _0x329df2;});}exports[_0xa707('0x1a')]=getRealtimeAgents;function getAgentStatus(_0x5eaf0c){var _0x10c41c='unknown';if(isAgentPaused(_0x5eaf0c))_0x10c41c=_0xa707('0x10');else if(isAgentPaused(_0x5eaf0c,!![]))_0x10c41c=_0xa707('0x1b');else if(isAgentIdle(_0x5eaf0c))_0x10c41c='idle';else _0x10c41c=_0xa707('0x1c');return _0x10c41c;}exports[_0xa707('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x13d97b,_0x130131){var _0x25c023=_[_0xa707('0x1e')](_0x13d97b)?_0x13d97b:[_0x13d97b];var _0x31b558=_['startCase'](_0x130131)+_0xa707('0x1f');var _0x57763e=_[_0xa707('0x20')](_0x25c023,function(_0x197a38){return db[_0x31b558][_0xa707('0x21')]({'where':{'id':_0x197a38}})[_0xa707('0x14')](function(_0x238a07){if(!_0x238a07)return[];return _0x238a07[_0xa707('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa707('0x23')](_0x57763e)[_0xa707('0x14')](function(_0xc836b){var _0x1178a5=_(_0xc836b)[_0xa707('0x24')]()[_0xa707('0x20')]('id')[_0xa707('0x25')]()['value']();return _0x1178a5;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x281f02,_0x3c4c97,_0x55593e){try{if(_0x3c4c97[_0xa707('0x9')]>0x0){_0x281f02=_0x281f02[_0xa707('0x8')](function(_0x5c12b9){return _0x3c4c97['includes'](_0x5c12b9['id']);});}var _0x934d3b=_0x281f02[_0xa707('0x8')](function(_0x509740){var _0x59f796=_0xa707('0x1c');if(isAgentIdle(_0x509740)){_0x59f796='idle';}return _0x59f796===_0x55593e;});return _[_0xa707('0x20')](_0x934d3b,'id');}catch(_0x2417ba){throw _0x2417ba;}}exports[_0xa707('0x26')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5b6314,_0x1c2fe8,_0x3c278d){return Promise['resolve']()['then'](function(){if(_0x1c2fe8[_0xa707('0x9')]>0x0){_0x5b6314=_0x5b6314['filter'](function(_0x3ab8d4){return _0x1c2fe8[_0xa707('0x27')](_0x3ab8d4['id']);});}return _0x5b6314;})[_0xa707('0x14')](function(){return db[_0xa707('0x28')]['findAll']({'attributes':['id',_0xa707('0x29'),_0xa707('0x2a'),_0xa707('0x2b'),'faxPause',_0xa707('0x4'),_0xa707('0x5'),_0xa707('0x6'),_0xa707('0xf'),_0xa707('0x2c'),_0xa707('0x2d')],'where':{'id':{'$in':_[_0xa707('0x20')](_0x5b6314,'id')}},'raw':!![]});})['then'](function(_0x6a6943){return _0x6a6943[_0xa707('0x20')](function(_0x5d0aaf){var _0x3df697=_['find'](_0x5b6314,['id',_0x5d0aaf['id']]);var _0x2a84b1=filterAgentAttributes(_0x3df697);_[_0xa707('0x2e')](_0x5d0aaf,_0x2a84b1);_0x5d0aaf['globalStatus']=getAgentStatus(_0x5d0aaf);return _0x5d0aaf;});})[_0xa707('0x14')](function(_0x4e51ec){var _0x47d3ac=sortAgentsByStatus(_0x4e51ec,_0x3c278d);return _[_0xa707('0x20')](_0x47d3ac,'id');})['catch'](function(_0x2798fb){throw _0x2798fb;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x37fd0c){var _0xf7a130={'fields':[],'order':null};var _0xdf6a77=_0x37fd0c[_0xa707('0x2f')](',');_0xf7a130[_0xa707('0x30')]=_[_0xa707('0x8')](_0xdf6a77,function(_0x5baee9){if(!_0x5baee9[_0xa707('0x27')](_0xa707('0x31'))){return!![];}_0xf7a130['order']=_[_0xa707('0x32')](_0x5baee9,'-')?'DESC':_0xa707('0x33');return![];});return _0xf7a130;}exports[_0xa707('0x34')]=getUpdatedSortOptions;function validateSortParameter(_0x41b314){if(_0x41b314[_0xa707('0x27')]('fullname')&&!_0x41b314[_0xa707('0x27')](_0xa707('0x35'))){var _0x35bb09=_0x41b314[_0xa707('0x36')](0x0,_0x41b314[_0xa707('0x37')](_0xa707('0x2a')));_0x41b314+=','+_0x35bb09+_0xa707('0x35');}return _0x41b314;}exports[_0xa707('0x38')]=validateSortParameter;function sortAgentsByStatus(_0x3a365e,_0x78e441){var _0x1b334a=_0x3a365e[_0xa707('0x39')](function(_0x2b4e6f,_0x499421){if(_0x2b4e6f[_0xa707('0x31')]===_0x499421[_0xa707('0x31')]){if(_0x2b4e6f[_0xa707('0x31')]==='pause'){if(_0x78e441===_0xa707('0x3a')){return(_0x2b4e6f['pauseType']||'')<(_0x499421[_0xa707('0x2d')]||'')||_0x2b4e6f[_0xa707('0x2a')][_0xa707('0x3b')]()>_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?0x1:-0x1;}else{return(_0x2b4e6f[_0xa707('0x2d')]||'')<(_0x499421[_0xa707('0x2d')]||'')||_0x2b4e6f[_0xa707('0x2a')]['toLowerCase']()>_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?-0x1:0x1;}}else{if(_0x78e441===_0xa707('0x3a')){return _0x2b4e6f['fullname'][_0xa707('0x3b')]()<_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?0x1:-0x1;}else{return _0x2b4e6f[_0xa707('0x2a')][_0xa707('0x3b')]()<_0x499421[_0xa707('0x2a')][_0xa707('0x3b')]()?-0x1:0x1;}}}else{if(_0x78e441===_0xa707('0x3a')){return _0x2b4e6f[_0xa707('0x31')]<_0x499421[_0xa707('0x31')]?0x1:-0x1;}else{return _0x2b4e6f[_0xa707('0x31')]<_0x499421[_0xa707('0x31')]?-0x1:0x1;}}});return _0x1b334a;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x2698eb){var _0x4c7390=[_0xa707('0x3c'),_0xa707('0x3d'),_0xa707('0x3e'),'lastPauseAt',_0xa707('0x2d'),_0xa707('0x3f'),_0xa707('0x35'),'address',_0xa707('0x2b'),'openchannelPause',_0xa707('0x4'),_0xa707('0x6'),'whatsappPause',_0xa707('0x3'),_0xa707('0xf'),_0xa707('0x40'),_0xa707('0x41'),_0xa707('0x42'),_0xa707('0x43'),_0xa707('0x44'),_0xa707('0x45'),_0xa707('0x46'),'openchannelCurrentCapacity',_0xa707('0x47'),_0xa707('0x48'),_0xa707('0x49'),'faxCurrentCapacity',_0xa707('0x11'),_0xa707('0x12'),_0xa707('0x4a'),'smsStatus',_0xa707('0x13'),'faxStatus',_0xa707('0xe'),_0xa707('0x4b'),_0xa707('0x4c'),_0xa707('0x4d'),_0xa707('0x4e'),_0xa707('0x4f'),_0xa707('0x50'),_0xa707('0x51'),_0xa707('0x52'),_0xa707('0x53'),'screenrecording',_0xa707('0x54'),_0xa707('0x55'),_0xa707('0x56')];var _0x1ada18=[_0xa707('0x2b'),_0xa707('0x5'),_0xa707('0x4'),_0xa707('0x6'),'whatsappPause',_0xa707('0x3'),'voicePause',_0xa707('0x3d')];var _0x5d71af=_(_0x2698eb)[_0xa707('0x57')](_0x1ada18)[_0xa707('0x58')](_0x4c7390)[_0xa707('0x59')]();return _0x5d71af;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x8f46=['getAgentStatus','startCase','Queue','map','getAgents','all','flatten','value','includes','resolve','User','findAll','name','fullname','chatPause','faxPause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','ASC','internal','substring','indexOf','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','lastPauseAt','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','mailPause','openchannelPause','smsPause','voicePause','every','filter','length','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','faxStatus','openchannelStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','unknown','*pause','busy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8f46,0xf8));var _0x68f4=function(_0x5d24df,_0x44b3db){_0x5d24df=_0x5d24df-0x0;var _0x386f69=_0x8f46[_0x5d24df];return _0x386f69;};'use strict';var _=require('lodash');var jayson=require(_0x68f4('0x0'));var db=require(_0x68f4('0x1'))['db'];var amiClient=jayson[_0x68f4('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x68f4('0x2')][_0x68f4('0x3')]({'port':0x232c});function isAgentPaused(_0x4ae168,_0x1536b2){var _0x5b77fb=[_0x4ae168['chatPause'],_0x4ae168['faxPause'],_0x4ae168[_0x68f4('0x4')],_0x4ae168[_0x68f4('0x5')],_0x4ae168[_0x68f4('0x6')],_0x4ae168[_0x68f4('0x7')],_0x4ae168['whatsappPause']];if(!_0x1536b2)return _[_0x68f4('0x8')](_0x5b77fb);var _0x1876a4=_[_0x68f4('0x9')](_0x5b77fb);return _0x1876a4[_0x68f4('0xa')]>0x0&&_0x1876a4['length']<_0x5b77fb[_0x68f4('0xa')]?!![]:![];}function isIdle(_0x6a5f8d){return _0x6a5f8d==='idle'||_0x6a5f8d==='unknown'||_0x6a5f8d===_0x68f4('0xb')||_0x6a5f8d===_0x68f4('0xc')||_[_0x68f4('0xd')](_0x6a5f8d);}function isAgentIdle(_0x4de851){if(_0x4de851[_0x68f4('0xe')]!==_0x68f4('0xf')&&_0x4de851['voicePause']){_0x4de851['voiceStatus']=_0x68f4('0x10');return![];}return _[_0x68f4('0x8')]([_0x4de851[_0x68f4('0x11')],_0x4de851[_0x68f4('0x12')],_0x4de851['mailStatus'],_0x4de851[_0x68f4('0x13')],_0x4de851['smsStatus'],_0x4de851[_0x68f4('0xe')],_0x4de851[_0x68f4('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x68f4('0x15')]('Agents',{})[_0x68f4('0x16')](function(_0x5db91c){if(_0x5db91c[_0x68f4('0x17')]){throw new Error(_0x68f4('0x18'));}var _0x138630=_0x5db91c[_0x68f4('0x19')];return routingClient[_0x68f4('0x15')](_0x68f4('0x1a'),{})[_0x68f4('0x16')](function(_0x2c6bc6){if(_0x2c6bc6[_0x68f4('0x17')]){throw new Error(_0x68f4('0x1b'));}var _0x136af4=_0x2c6bc6['result'];return _[_0x68f4('0x1c')]({},_0x138630,_0x136af4);});})[_0x68f4('0x1d')](function(_0x3e4895){throw _0x3e4895;});}exports[_0x68f4('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x58eb6f){var _0x13df1a=_0x68f4('0x1f');if(isAgentPaused(_0x58eb6f))_0x13df1a='pause';else if(isAgentPaused(_0x58eb6f,!![]))_0x13df1a=_0x68f4('0x20');else if(isAgentIdle(_0x58eb6f))_0x13df1a=_0x68f4('0xf');else _0x13df1a=_0x68f4('0x21');return _0x13df1a;}exports[_0x68f4('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x5f0466,_0x2761f7){var _0x3ae2a4=_['isArray'](_0x5f0466)?_0x5f0466:[_0x5f0466];var _0x589965=_[_0x68f4('0x23')](_0x2761f7)+_0x68f4('0x24');var _0x21a47f=_[_0x68f4('0x25')](_0x3ae2a4,function(_0x31a4a8){return db[_0x589965]['findOne']({'where':{'id':_0x31a4a8}})[_0x68f4('0x16')](function(_0x386c45){if(!_0x386c45)return[];return _0x386c45[_0x68f4('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x68f4('0x27')](_0x21a47f)[_0x68f4('0x16')](function(_0x375da3){var _0x48c8d9=_(_0x375da3)[_0x68f4('0x28')]()[_0x68f4('0x25')]('id')['uniq']()[_0x68f4('0x29')]();return _0x48c8d9;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5a72ef,_0x274faf,_0x12a1d9){try{if(_0x274faf['length']>0x0){_0x5a72ef=_0x5a72ef[_0x68f4('0x9')](function(_0x20a116){return _0x274faf[_0x68f4('0x2a')](_0x20a116['id']);});}var _0x4a5021=_0x5a72ef[_0x68f4('0x9')](function(_0x3c4cbc){var _0x138d19=_0x68f4('0x21');if(isAgentIdle(_0x3c4cbc)){_0x138d19=_0x68f4('0xf');}return _0x138d19===_0x12a1d9;});return _[_0x68f4('0x25')](_0x4a5021,'id');}catch(_0x59627c){throw _0x59627c;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x50b609,_0x1362d0,_0x2f7d81){return Promise[_0x68f4('0x2b')]()[_0x68f4('0x16')](function(){if(_0x1362d0[_0x68f4('0xa')]>0x0){_0x50b609=_0x50b609[_0x68f4('0x9')](function(_0xbf46a8){return _0x1362d0[_0x68f4('0x2a')](_0xbf46a8['id']);});}return _0x50b609;})[_0x68f4('0x16')](function(){return db[_0x68f4('0x2c')][_0x68f4('0x2d')]({'attributes':['id',_0x68f4('0x2e'),_0x68f4('0x2f'),_0x68f4('0x30'),_0x68f4('0x31'),_0x68f4('0x4'),_0x68f4('0x5'),_0x68f4('0x6'),'voicePause',_0x68f4('0x32'),_0x68f4('0x33')],'where':{'id':{'$in':_[_0x68f4('0x25')](_0x50b609,'id')}},'raw':!![]});})['then'](function(_0x7191f8){return _0x7191f8[_0x68f4('0x25')](function(_0x1ddbc1){var _0x3a3a21=_[_0x68f4('0x34')](_0x50b609,['id',_0x1ddbc1['id']]);var _0x404277=filterAgentAttributes(_0x3a3a21);_[_0x68f4('0x1c')](_0x1ddbc1,_0x404277);_0x1ddbc1['globalStatus']=getAgentStatus(_0x1ddbc1);return _0x1ddbc1;});})[_0x68f4('0x16')](function(_0x114fb6){var _0x2d5681=sortAgentsByStatus(_0x114fb6,_0x2f7d81);return _[_0x68f4('0x25')](_0x2d5681,'id');})[_0x68f4('0x1d')](function(_0x14fd4c){throw _0x14fd4c;});}exports[_0x68f4('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x26e5a8){var _0x1dbfcf={'fields':[],'order':null};var _0x107b34=_0x26e5a8['split'](',');_0x1dbfcf[_0x68f4('0x36')]=_[_0x68f4('0x9')](_0x107b34,function(_0x233037){if(!_0x233037[_0x68f4('0x2a')]('globalStatus')){return!![];}_0x1dbfcf[_0x68f4('0x37')]=_[_0x68f4('0x38')](_0x233037,'-')?_0x68f4('0x39'):_0x68f4('0x3a');return![];});return _0x1dbfcf;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x5f352d){if(_0x5f352d[_0x68f4('0x2a')]('fullname')&&!_0x5f352d[_0x68f4('0x2a')](_0x68f4('0x3b'))){var _0x5d8fda=_0x5f352d[_0x68f4('0x3c')](0x0,_0x5f352d[_0x68f4('0x3d')](_0x68f4('0x2f')));_0x5f352d+=','+_0x5d8fda+'internal';}return _0x5f352d;}exports[_0x68f4('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x3dafd2,_0x194495){var _0x10d4b3=_0x3dafd2[_0x68f4('0x3f')](function(_0x2361b5,_0x3a433c){if(_0x2361b5[_0x68f4('0x40')]===_0x3a433c['globalStatus']){if(_0x2361b5[_0x68f4('0x40')]===_0x68f4('0x10')){if(_0x194495===_0x68f4('0x39')){return(_0x2361b5[_0x68f4('0x33')]||'')<(_0x3a433c[_0x68f4('0x33')]||'')||_0x2361b5[_0x68f4('0x2f')]['toLowerCase']()>_0x3a433c[_0x68f4('0x2f')][_0x68f4('0x41')]()?0x1:-0x1;}else{return(_0x2361b5[_0x68f4('0x33')]||'')<(_0x3a433c[_0x68f4('0x33')]||'')||_0x2361b5[_0x68f4('0x2f')][_0x68f4('0x41')]()>_0x3a433c['fullname'][_0x68f4('0x41')]()?-0x1:0x1;}}else{if(_0x194495===_0x68f4('0x39')){return _0x2361b5[_0x68f4('0x2f')][_0x68f4('0x41')]()<_0x3a433c[_0x68f4('0x2f')][_0x68f4('0x41')]()?0x1:-0x1;}else{return _0x2361b5[_0x68f4('0x2f')][_0x68f4('0x41')]()<_0x3a433c[_0x68f4('0x2f')][_0x68f4('0x41')]()?-0x1:0x1;}}}else{if(_0x194495===_0x68f4('0x39')){return _0x2361b5[_0x68f4('0x40')]<_0x3a433c[_0x68f4('0x40')]?0x1:-0x1;}else{return _0x2361b5[_0x68f4('0x40')]<_0x3a433c['globalStatus']?-0x1:0x1;}}});return _0x10d4b3;}exports[_0x68f4('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x2a4d80){var _0x20e418=[_0x68f4('0x43'),'online','lastLoginAt','lastPauseAt',_0x68f4('0x33'),_0x68f4('0x44'),'internal','address','chatPause',_0x68f4('0x5'),_0x68f4('0x4'),_0x68f4('0x6'),_0x68f4('0x32'),_0x68f4('0x31'),'voicePause','chatCapacity',_0x68f4('0x45'),_0x68f4('0x46'),_0x68f4('0x47'),_0x68f4('0x48'),_0x68f4('0x49'),_0x68f4('0x4a'),'openchannelCurrentCapacity',_0x68f4('0x4b'),_0x68f4('0x4c'),_0x68f4('0x4d'),_0x68f4('0x4e'),'chatStatus','openchannelStatus','mailStatus','smsStatus',_0x68f4('0x14'),_0x68f4('0x12'),_0x68f4('0xe'),'chatStatusTime',_0x68f4('0x4f'),'mailStatusTime',_0x68f4('0x50'),_0x68f4('0x51'),_0x68f4('0x52'),_0x68f4('0x53'),_0x68f4('0x54'),_0x68f4('0x55'),_0x68f4('0x56'),_0x68f4('0x57'),_0x68f4('0x58'),_0x68f4('0x59')];var _0x5f309=[_0x68f4('0x30'),_0x68f4('0x5'),_0x68f4('0x4'),_0x68f4('0x6'),_0x68f4('0x32'),_0x68f4('0x31'),_0x68f4('0x7'),_0x68f4('0x5a')];var _0x598ca8=_(_0x2a4d80)[_0x68f4('0x5b')](_0x5f309)[_0x68f4('0x5c')](_0x20e418)[_0x68f4('0x29')]();return _0x598ca8;}exports[_0x68f4('0x5d')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 816163a..548732a 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c3e=['talking','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','inbound','concat','outbound','map','get','loggedIn','busy','find','merge','pick','initializeQueues','lodash','util','client','http','available','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold'];(function(_0x17a472,_0x54811b){var _0x36a618=function(_0x17317){while(--_0x17317){_0x17a472['push'](_0x17a472['shift']());}};_0x36a618(++_0x54811b);}(_0x1c3e,0x194));var _0xe1c3=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x1c3e[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0xe1c3('0x0'));var jayson=require('jayson/promise');var util=require(_0xe1c3('0x1'));var amiClient=jayson[_0xe1c3('0x2')][_0xe1c3('0x3')]({'port':0x232a});var routingClient=jayson[_0xe1c3('0x2')][_0xe1c3('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xe1c3('0x4'),'loggedIn',_0xe1c3('0x5'),_0xe1c3('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xe1c3('0x7'),_0xe1c3('0x8'),_0xe1c3('0x9'),_0xe1c3('0xa'),_0xe1c3('0xb'),'ringing','ringInUse',_0xe1c3('0xc'),_0xe1c3('0xd'),_0xe1c3('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xe1c3('0xf'),_0xe1c3('0x10'),_0xe1c3('0x11'),'statusMessage',_0xe1c3('0x12'),_0xe1c3('0x13'),_0xe1c3('0x14'),_0xe1c3('0x15'),_0xe1c3('0x16'),_0xe1c3('0x17'),'erlangCallToSecond',_0xe1c3('0x18'),'erlangBusyFactor',_0xe1c3('0x19'),_0xe1c3('0x1a'),_0xe1c3('0x1b'),_0xe1c3('0x1c'),'predictiveIntervalTotalCalls',_0xe1c3('0x1d'),_0xe1c3('0x1e'),_0xe1c3('0x1f'),_0xe1c3('0x20'),_0xe1c3('0x21')];function getRealtimeQueues(_0x5020a4,_0x4be8bd){var _0x2a81ff=_0x4be8bd===_0xe1c3('0x22')?amiClient:routingClient;return _0x2a81ff[_0xe1c3('0x23')](_[_0xe1c3('0x24')](_0x4be8bd)+'Queues',_0x5020a4)[_0xe1c3('0x25')](function(_0x4be13f){if(_0x4be13f[_0xe1c3('0x26')])throw new Error(util[_0xe1c3('0x27')](_0xe1c3('0x28'),_0x4be8bd));return _0x4be13f['result'];})['catch'](function(_0x79f740){throw _0x79f740;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x482e61,_0x428e59,_0x35bf6b,_0x29d7cd){var _0x70b2c6=DEFAULT_QUEUE_ATTRIBUTES;if(_0x35bf6b==='voice'){if(_0x29d7cd===_0xe1c3('0x29')){_0x70b2c6=_0x70b2c6[_0xe1c3('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x29d7cd===_0xe1c3('0x2b')){_0x70b2c6=_0x70b2c6[_0xe1c3('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x482e61[_0xe1c3('0x2c')](function(_0x45498f){var _0x4bb244=_0x45498f[_0xe1c3('0x2d')]({'plain':!![]});_0x4bb244['paused']=0x0;_0x4bb244[_0xe1c3('0x9')]=0x0;_0x4bb244[_0xe1c3('0x2e')]=0x0;_0x4bb244['available']=0x0;_0x4bb244['waiting']=0x0;if(_0x35bf6b==='voice'){_0x4bb244[_0xe1c3('0xc')]=0x0;_0x4bb244[_0xe1c3('0x2f')]=0x0;if(_0x29d7cd===_0xe1c3('0x2b')){_0x4bb244['pTalking']=0x0;_0x4bb244[_0xe1c3('0x10')]=0x0;}}var _0x52acdb=_[_0xe1c3('0x30')](_0x428e59,['id',_0x4bb244['id']]);if(_0x52acdb){_[_0xe1c3('0x31')](_0x4bb244,_[_0xe1c3('0x32')](_0x52acdb,_0x70b2c6));}return _0x4bb244;});}exports[_0xe1c3('0x33')]=initializeQueues; \ No newline at end of file +var _0xc3bb=['getRealtimeQueues','inbound','outbound','concat','get','loggedInDb','busy','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','loggedIn','paused','waiting','invalid','notInUse','onHold','ringing','ringInUse','talking','unknown','pTalking','originated','statusMessage','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc3bb,0x70));var _0xbc3b=function(_0x22057c,_0x1068a0){_0x22057c=_0x22057c-0x0;var _0xd34c2b=_0xc3bb[_0x22057c];return _0xd34c2b;};'use strict';var _=require(_0xbc3b('0x0'));var jayson=require(_0xbc3b('0x1'));var util=require(_0xbc3b('0x2'));var amiClient=jayson[_0xbc3b('0x3')][_0xbc3b('0x4')]({'port':0x232a});var routingClient=jayson[_0xbc3b('0x3')][_0xbc3b('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xbc3b('0x5'),_0xbc3b('0x6'),_0xbc3b('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0xbc3b('0x8'),'loggedInDb',_0xbc3b('0x9'),_0xbc3b('0xa'),_0xbc3b('0xb'),_0xbc3b('0xc'),_0xbc3b('0xd'),'unavailable',_0xbc3b('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xbc3b('0xf'),_0xbc3b('0x10'),'message',_0xbc3b('0x11'),'dialActive',_0xbc3b('0x12'),_0xbc3b('0x13'),'startPredictive',_0xbc3b('0x14'),_0xbc3b('0x15'),_0xbc3b('0x16'),_0xbc3b('0x17'),'erlangBusyFactor',_0xbc3b('0x18'),'dialPredictiveIntervalMaxThreshold',_0xbc3b('0x19'),_0xbc3b('0x1a'),_0xbc3b('0x1b'),_0xbc3b('0x1c'),_0xbc3b('0x1d'),_0xbc3b('0x1e'),_0xbc3b('0x1f'),_0xbc3b('0x20')];function getRealtimeQueues(_0x96d6,_0x457a08){var _0x24ef9b=_0x457a08===_0xbc3b('0x21')?amiClient:routingClient;return _0x24ef9b[_0xbc3b('0x22')](_[_0xbc3b('0x23')](_0x457a08)+'Queues',_0x96d6)[_0xbc3b('0x24')](function(_0x3ed7d7){if(_0x3ed7d7[_0xbc3b('0x25')])throw new Error(util[_0xbc3b('0x26')](_0xbc3b('0x27'),_0x457a08));return _0x3ed7d7[_0xbc3b('0x28')];})['catch'](function(_0x138105){throw _0x138105;});}exports[_0xbc3b('0x29')]=getRealtimeQueues;function initializeQueues(_0x7009e0,_0x33e8ad,_0x435879,_0x359d63){var _0x4d562d=DEFAULT_QUEUE_ATTRIBUTES;if(_0x435879===_0xbc3b('0x21')){if(_0x359d63===_0xbc3b('0x2a')){_0x4d562d=_0x4d562d['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x359d63===_0xbc3b('0x2b')){_0x4d562d=_0x4d562d[_0xbc3b('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x7009e0['map'](function(_0x3eca36){var _0x3ada77=_0x3eca36[_0xbc3b('0x2d')]({'plain':!![]});_0x3ada77[_0xbc3b('0x6')]=0x0;_0x3ada77[_0xbc3b('0x2e')]=0x0;_0x3ada77[_0xbc3b('0x5')]=0x0;_0x3ada77['available']=0x0;_0x3ada77['waiting']=0x0;if(_0x435879===_0xbc3b('0x21')){_0x3ada77[_0xbc3b('0xd')]=0x0;_0x3ada77[_0xbc3b('0x2f')]=0x0;if(_0x359d63===_0xbc3b('0x2b')){_0x3ada77[_0xbc3b('0xf')]=0x0;_0x3ada77[_0xbc3b('0x10')]=0x0;}}var _0x40449e=_[_0xbc3b('0x30')](_0x33e8ad,['id',_0x3ada77['id']]);if(_0x40449e){_[_0xbc3b('0x31')](_0x3ada77,_['pick'](_0x40449e,_0x4d562d));}return _0x3ada77;});}exports[_0xbc3b('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index ca46778..3d2522a 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5997f4,_0x482272){var _0xa47e6a=function(_0x451754){while(--_0x451754){_0x5997f4['push'](_0x5997f4['shift']());}};_0xa47e6a(++_0x482272);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x403454,_0x4688ad){var _0x535214=function(_0x11b380){while(--_0x11b380){_0x403454['push'](_0x403454['shift']());}};_0x535214(++_0x4688ad);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 7d482a0..2aaacaf 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 _0x1fe5=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','IPv4'];(function(_0x11adbd,_0x5055f5){var _0x270029=function(_0x25feb6){while(--_0x25feb6){_0x11adbd['push'](_0x11adbd['shift']());}};_0x270029(++_0x5055f5);}(_0x1fe5,0x116));var _0x51fe=function(_0xf52322,_0x4e2427){_0xf52322=_0xf52322-0x0;var _0x528e53=_0x1fe5[_0xf52322];return _0x528e53;};'use strict';var _=require(_0x51fe('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x51fe('0x1'));var exec=require(_0x51fe('0x2'))[_0x51fe('0x3')];var config=require(_0x51fe('0x4'));function getInterfaces(){var _0x531b81=[];var _0x4b28b0=os[_0x51fe('0x5')]();var _0xb0a9d7=_[_0x51fe('0x6')](_[_0x51fe('0x7')](_0x4b28b0));for(var _0x49cad2=0x0;_0x49cad2<_0xb0a9d7['length'];_0x49cad2++){var _0x18333a=_0x4b28b0[_0xb0a9d7[_0x49cad2]][_0x51fe('0x8')](function(_0x2eb3e2){return _0x2eb3e2['family']===_0x51fe('0x9')&&_0x2eb3e2['internal']===![];});_0x531b81=_0x531b81[_0x51fe('0xa')](_0x18333a);}return _0x531b81;}function getFirstInterface(){var _0x320c4e=_[_0x51fe('0xb')](getInterfaces());return{'macAddress':_0x320c4e&&_0x320c4e[_0x51fe('0xc')]?_0x320c4e[_0x51fe('0xc')]:_0x51fe('0xd'),'ipAddress':_0x320c4e&&_0x320c4e['address']?_0x320c4e[_0x51fe('0xe')]:_0x51fe('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x226282=_['orderBy'](os[_0x51fe('0x10')]()[_0x51fe('0x11')](function(_0x540246){return _0x540246[_0x51fe('0x12')];}))[_0x51fe('0x13')](':');return crypto[_0x51fe('0x14')](_0x51fe('0x15'))[_0x51fe('0x16')](_0x226282)[_0x51fe('0x17')](_0x51fe('0x18'));}exports[_0x51fe('0x19')]=function(){var _0x559366=os[_0x51fe('0x1a')]();var _0x503178=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x503178[_0x51fe('0x1b')](config[_0x51fe('0x1c')])){return config[_0x51fe('0x1c')];}else if(_0x559366===_0x51fe('0x1d')){return exec(_0x51fe('0x1e'),{'encoding':_0x51fe('0x1f')})['replace']('\x0d\x0a','');}else{var _0x4d4c1e=getFirstInterface();var _0x59b8a4=getCPUhash();var _0xb2a306=_0x59b8a4+'|'+os[_0x51fe('0x20')]()+'|'+_0x4d4c1e[_0x51fe('0x21')]+'|'+_0x4d4c1e[_0x51fe('0x22')];var _0x36686d=crypto[_0x51fe('0x14')](_0x51fe('0x15'))[_0x51fe('0x16')](_0xb2a306)[_0x51fe('0x17')](_0x51fe('0x18'));return _0x36686d[_0x51fe('0x23')](0x0,0x8)+'-'+_0x36686d[_0x51fe('0x23')](0x8,0xc)+'-'+_0x36686d[_0x51fe('0x23')](0xc,0x10)+'-'+_0x36686d[_0x51fe('0x23')](0x10,0x14)+'-'+_0x36686d[_0x51fe('0x23')](0x14);}}; \ No newline at end of file +var _0xc5c9=['../environment','networkInterfaces','orderBy','length','filter','IPv4','internal','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','cpus','model','md5','update','digest','hex','getUuid','platform','licenseToken','win32','utf8','hostname','macAddress','ipAddress','substring','crypto'];(function(_0x5cbf2d,_0x3cc4f8){var _0x4d0945=function(_0x37939c){while(--_0x37939c){_0x5cbf2d['push'](_0x5cbf2d['shift']());}};_0x4d0945(++_0x3cc4f8);}(_0xc5c9,0x8b));var _0x9c5c=function(_0x255f57,_0x23d604){_0x255f57=_0x255f57-0x0;var _0x46c81c=_0xc5c9[_0x255f57];return _0x46c81c;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x9c5c('0x0'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')['execSync'];var config=require(_0x9c5c('0x1'));function getInterfaces(){var _0xe6ef1d=[];var _0x5c3700=os[_0x9c5c('0x2')]();var _0x5b0c27=_[_0x9c5c('0x3')](_['keys'](_0x5c3700));for(var _0x4ca8fe=0x0;_0x4ca8fe<_0x5b0c27[_0x9c5c('0x4')];_0x4ca8fe++){var _0x1007e6=_0x5c3700[_0x5b0c27[_0x4ca8fe]][_0x9c5c('0x5')](function(_0x55dbb9){return _0x55dbb9['family']===_0x9c5c('0x6')&&_0x55dbb9[_0x9c5c('0x7')]===![];});_0xe6ef1d=_0xe6ef1d['concat'](_0x1007e6);}return _0xe6ef1d;}function getFirstInterface(){var _0x3b6695=_[_0x9c5c('0x8')](getInterfaces());return{'macAddress':_0x3b6695&&_0x3b6695[_0x9c5c('0x9')]?_0x3b6695[_0x9c5c('0x9')]:_0x9c5c('0xa'),'ipAddress':_0x3b6695&&_0x3b6695['address']?_0x3b6695['address']:_0x9c5c('0xb')};}exports[_0x9c5c('0xc')]=getFirstInterface;function getCPUhash(){var _0x393c88=_['orderBy'](os[_0x9c5c('0xd')]()['map'](function(_0x3dc482){return _0x3dc482[_0x9c5c('0xe')];}))['join'](':');return crypto['createHash'](_0x9c5c('0xf'))[_0x9c5c('0x10')](_0x393c88)[_0x9c5c('0x11')](_0x9c5c('0x12'));}exports[_0x9c5c('0x13')]=function(){var _0x57c2dd=os[_0x9c5c('0x14')]();var _0x3931cc=/[0-9a-f-]{36}/;if(config[_0x9c5c('0x15')]&&_0x3931cc['test'](config[_0x9c5c('0x15')])){return config[_0x9c5c('0x15')];}else if(_0x57c2dd===_0x9c5c('0x16')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x9c5c('0x17')})['replace']('\x0d\x0a','');}else{var _0x4d7b7f=getFirstInterface();var _0x315d93=getCPUhash();var _0x5ad343=_0x315d93+'|'+os[_0x9c5c('0x18')]()+'|'+_0x4d7b7f[_0x9c5c('0x19')]+'|'+_0x4d7b7f[_0x9c5c('0x1a')];var _0x25bb90=crypto['createHash']('md5')[_0x9c5c('0x10')](_0x5ad343)[_0x9c5c('0x11')](_0x9c5c('0x12'));return _0x25bb90[_0x9c5c('0x1b')](0x0,0x8)+'-'+_0x25bb90[_0x9c5c('0x1b')](0x8,0xc)+'-'+_0x25bb90[_0x9c5c('0x1b')](0xc,0x10)+'-'+_0x25bb90[_0x9c5c('0x1b')](0x10,0x14)+'-'+_0x25bb90[_0x9c5c('0x1b')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index cb8139a..e0c03b1 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 _0x6732=['active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','catch','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2'];(function(_0x212ef0,_0x424557){var _0x562d42=function(_0x4a91a){while(--_0x4a91a){_0x212ef0['push'](_0x212ef0['shift']());}};_0x562d42(++_0x424557);}(_0x6732,0xc9));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x2673('0x0'));var moment=require(_0x2673('0x1'));var rp=require(_0x2673('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x2673('0x3'))(module,_0x2673('0x4'));var db=require(_0x2673('0x5'))['db'];var encryptor=require(_0x2673('0x6'));var hardware=require('./hardware');var logger=require(_0x2673('0x7'))(_0x2673('0x8'));var HOST=_0x2673('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2ad73f){return new BPromise(function(_0x14b217,_0x272c9c){var _0x2a6fd4=util[_0x2673('0xa')](_0x2673('0xb'),HOST,_0x2ad73f,module[_0x2673('0xc')][_0x2673('0x4')]);if(oldToken){_0x2a6fd4=util[_0x2673('0xa')](_0x2673('0xd'),HOST,_0x2ad73f,module['exports']['version'],oldToken);}var _0x28ce8b={'uri':_0x2a6fd4,'method':_0x2673('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x28ce8b)[_0x2673('0xf')](function(_0x5b2afb){_0x14b217(_0x5b2afb);})['catch'](function(_0x11a421){_0x272c9c(_0x11a421);});});}function manageLicense(_0x5688c6,_0x378ba5){var _0x4a816b=_0x378ba5[_0x2673('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4a816b[_0x2673('0x11')]!==_0x5688c6&&!_0x4a816b[_0x2673('0x12')]){oldToken=_0x4a816b[_0x2673('0x11')];}httpRequest(_0x5688c6)[_0x2673('0xf')](function(_0x25b693){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25b693[_0x2673('0x13')]){isOldTokenSent=![];if(!_0x4a816b[_0x2673('0x8')]&&_0x4a816b[_0x2673('0x8')]!=_0x25b693[_0x2673('0x8')]||_0x4a816b['license']&&_0x4a816b[_0x2673('0x12')]){logger[_0x2673('0x14')](_0x2673('0x15'));}if(_0x4a816b[_0x2673('0x8')]&&!_0x4a816b['data2']&&_0x4a816b[_0x2673('0x8')]!=_0x25b693[_0x2673('0x8')]){logger[_0x2673('0x14')](_0x2673('0x16'));}if(_0x4a816b[_0x2673('0x8')]&&!_0x4a816b['data2']&&_0x4a816b[_0x2673('0x8')]==_0x25b693[_0x2673('0x8')]){return _0x378ba5;}return _0x378ba5[_0x2673('0x17')]({'data1':_0x5688c6,'data2':null,'license':_0x25b693['license']});}else{if(_0x25b693[_0x2673('0x8')]||_0x4a816b['license']){if(!_0x4a816b['data2']){if(_0x4a816b[_0x2673('0x11')]==_0x5688c6){GRAY_PERIOD_REASON=_0x2673('0x18');logger[_0x2673('0x14')](_0x2673('0x19'));}else{GRAY_PERIOD_REASON=_0x2673('0x1a');logger[_0x2673('0x14')](_0x2673('0x1b'),_0x4a816b[_0x2673('0x11')],_0x5688c6);}logger['info'](_0x2673('0x1c'),GRAY_PERIOD_REASON[_0x2673('0x1d')](),moment()['format'](_0x2673('0x1e')));return _0x378ba5['update']({'data2':encryptor[_0x2673('0x1f')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2673('0x20')](encryptor[_0x2673('0x21')](_0x4a816b[_0x2673('0x12')]),_0x2673('0x22'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x2673('0xa')](_0x2673('0x1e')));isOldTokenSent=![];return _0x378ba5['update']({'data1':_0x5688c6,'data2':null,'license':null});}}}else{if(_0x4a816b['data1']!=_0x5688c6){logger[_0x2673('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4a816b['data1'],_0x5688c6);return _0x378ba5[_0x2673('0x17')]({'data1':_0x5688c6,'data2':null,'license':null});}}}return _0x378ba5;})[_0x2673('0xf')](function(_0x1e0470){_0x378ba5=_0x1e0470;})[_0x2673('0x23')](function(_0x3c9123){logger[_0x2673('0x24')](_0x3c9123[_0x2673('0x25')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2673('0x26')](),_0x378ba5);},TIME);});}function defaultLicense(){var _0x248dd0=hardware[_0x2673('0x26')]();if(_0x248dd0){return db[_0x2673('0x27')][_0x2673('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x248dd0}})[_0x2673('0x29')](function(_0xec5fcf,_0x3ecc0b){logger['info'](_0x2673('0x2a'),_0x248dd0);manageLicense(_0x248dd0,_0xec5fcf);})['catch'](function(_0x223a3e){logger[_0x2673('0x24')](_0x223a3e[_0x2673('0x25')]);});}}exports[_0x2673('0x2b')]=defaultLicense; \ No newline at end of file +var _0x29a7=['../logger','license','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','update','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','then','error','message','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x29a7,0x157));var _0x729a=function(_0x3171f1,_0x28c520){_0x3171f1=_0x3171f1-0x0;var _0x244bc2=_0x29a7[_0x3171f1];return _0x244bc2;};'use strict';var util=require(_0x729a('0x0'));var moment=require(_0x729a('0x1'));var rp=require(_0x729a('0x2'));var BPromise=require(_0x729a('0x3'));var pkginfo=require(_0x729a('0x4'))(module,_0x729a('0x5'));var db=require(_0x729a('0x6'))['db'];var encryptor=require(_0x729a('0x7'));var hardware=require(_0x729a('0x8'));var logger=require(_0x729a('0x9'))(_0x729a('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x17c884){return new BPromise(function(_0x29b2dd,_0x8ad1a4){var _0x4c2103=util['format'](_0x729a('0xb'),HOST,_0x17c884,module['exports'][_0x729a('0x5')]);if(oldToken){_0x4c2103=util[_0x729a('0xc')](_0x729a('0xd'),HOST,_0x17c884,module[_0x729a('0xe')][_0x729a('0x5')],oldToken);}var _0x395871={'uri':_0x4c2103,'method':_0x729a('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x395871)['then'](function(_0x24ff3c){_0x29b2dd(_0x24ff3c);})[_0x729a('0x10')](function(_0x1bdc6f){_0x8ad1a4(_0x1bdc6f);});});}function manageLicense(_0x37a51f,_0x2f268f){var _0x29a9ea=_0x2f268f[_0x729a('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x29a9ea[_0x729a('0x12')]!==_0x37a51f&&!_0x29a9ea[_0x729a('0x13')]){oldToken=_0x29a9ea[_0x729a('0x12')];}httpRequest(_0x37a51f)['then'](function(_0xd727f6){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xd727f6[_0x729a('0x14')]){isOldTokenSent=![];if(!_0x29a9ea[_0x729a('0xa')]&&_0x29a9ea[_0x729a('0xa')]!=_0xd727f6[_0x729a('0xa')]||_0x29a9ea[_0x729a('0xa')]&&_0x29a9ea[_0x729a('0x13')]){logger[_0x729a('0x15')](_0x729a('0x16'));}if(_0x29a9ea[_0x729a('0xa')]&&!_0x29a9ea[_0x729a('0x13')]&&_0x29a9ea[_0x729a('0xa')]!=_0xd727f6['license']){logger['info'](_0x729a('0x17'));}if(_0x29a9ea[_0x729a('0xa')]&&!_0x29a9ea[_0x729a('0x13')]&&_0x29a9ea[_0x729a('0xa')]==_0xd727f6['license']){return _0x2f268f;}return _0x2f268f['update']({'data1':_0x37a51f,'data2':null,'license':_0xd727f6[_0x729a('0xa')]});}else{if(_0xd727f6['license']||_0x29a9ea[_0x729a('0xa')]){if(!_0x29a9ea[_0x729a('0x13')]){if(_0x29a9ea[_0x729a('0x12')]==_0x37a51f){GRAY_PERIOD_REASON=_0x729a('0x18');logger[_0x729a('0x15')](_0x729a('0x19'));}else{GRAY_PERIOD_REASON=_0x729a('0x1a');logger[_0x729a('0x15')](_0x729a('0x1b'),_0x29a9ea[_0x729a('0x12')],_0x37a51f);}logger[_0x729a('0x15')](_0x729a('0x1c'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x2f268f[_0x729a('0x1d')]({'data2':encryptor[_0x729a('0x1e')](moment()['format'](_0x729a('0x1f')))});}else{if(moment()[_0x729a('0x20')](encryptor[_0x729a('0x21')](_0x29a9ea[_0x729a('0x13')]),_0x729a('0x22'))>DAYS){logger['info'](_0x729a('0x23'),moment()[_0x729a('0xc')](_0x729a('0x1f')));isOldTokenSent=![];return _0x2f268f[_0x729a('0x1d')]({'data1':_0x37a51f,'data2':null,'license':null});}}}else{if(_0x29a9ea[_0x729a('0x12')]!=_0x37a51f){logger['info'](_0x729a('0x1b'),_0x29a9ea['data1'],_0x37a51f);return _0x2f268f[_0x729a('0x1d')]({'data1':_0x37a51f,'data2':null,'license':null});}}}return _0x2f268f;})[_0x729a('0x24')](function(_0x2afebc){_0x2f268f=_0x2afebc;})[_0x729a('0x10')](function(_0x4c3978){logger[_0x729a('0x25')](_0x4c3978[_0x729a('0x26')]);})[_0x729a('0x27')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x2f268f);},TIME);});}function defaultLicense(){var _0x26245a=hardware[_0x729a('0x28')]();if(_0x26245a){return db['License'][_0x729a('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x26245a}})['spread'](function(_0x29237a,_0x22c08a){logger[_0x729a('0x15')](_0x729a('0x2a'),_0x26245a);manageLicense(_0x26245a,_0x29237a);})['catch'](function(_0x4395ac){logger[_0x729a('0x25')](_0x4395ac['message']);});}}exports[_0x729a('0x2b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 62438fa..77952df 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 _0x4f2e=['role','sequelize','col','admin','telephone','users','telephones','forEach','user','count','catch','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','getUuid','defaults','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','deadline','add','days','grayReason','machineUuid','changed','then','User','findAll'];(function(_0x4a6699,_0x115a0a){var _0x436bfc=function(_0xa3b96e){while(--_0xa3b96e){_0x4a6699['push'](_0x4a6699['shift']());}};_0x436bfc(++_0x115a0a);}(_0x4f2e,0xb5));var _0xe4f2=function(_0x701c5d,_0x47a566){_0x701c5d=_0x701c5d-0x0;var _0x617b08=_0x4f2e[_0x701c5d];return _0x617b08;};'use strict';var util=require(_0xe4f2('0x0'));var _=require('lodash');var moment=require(_0xe4f2('0x1'));var BPromise=require(_0xe4f2('0x2'));var hardware=require(_0xe4f2('0x3'));var encryptor=require(_0xe4f2('0x4'));var db=require(_0xe4f2('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xe4f2('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xe4f2('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x44991f){return new BPromise(function(_0x1e8c7b,_0x239b23){return db['License']['find'](_[_0xe4f2('0x7')](_0x44991f,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x551d52){return checkLicense(_0x551d52,null);})['then'](function(_0x5d507a){_0x1e8c7b(_0x5d507a);return;})['catch'](function(_0x1a813b){_0x239b23(_0x1a813b);});});}function checkLicense(_0x4db8c1,_0x36973c){if(!_0x4db8c1){demoLicense[_0xe4f2('0x8')]=_0x4db8c1[_0xe4f2('0x9')];return demoLicense;}try{var _0x568a3b=_0x36973c||_0x4db8c1[_0xe4f2('0xa')];if(_[_0xe4f2('0xb')](_0x568a3b)){throw new Error(_0xe4f2('0xc'));}var _0xc27d27=_0x4db8c1[_0xe4f2('0x9')];var _0x21552f=_0x4db8c1[_0xe4f2('0xd')];var _0x306fca=_0xc27d27['split']('-')[0x4];var _0x21204d=_0xc27d27[_0xe4f2('0xe')]('-')[0x0];var _0x474bdc=encryptor[_0xe4f2('0xf')](_0x568a3b,util[_0xe4f2('0x10')](_0xe4f2('0x11'),_0x306fca,_0xc27d27,_0x21204d));var _0x4ac5a6=JSON[_0xe4f2('0x12')](_0x474bdc);_0x4ac5a6[_0xe4f2('0x13')]=![];_0x4ac5a6['uuid']=_0xc27d27;_0x4ac5a6['machineUuid']=hardware['getUuid']();if(_0x21552f){var _0x2dc9b6=encryptor[_0xe4f2('0xf')](_0x21552f);_0x4ac5a6['gray']=_0x2dc9b6;_0x4ac5a6[_0xe4f2('0x14')]=moment(_0x2dc9b6)[_0xe4f2('0x15')](0x7,_0xe4f2('0x16'))[_0xe4f2('0x10')]();_0x4ac5a6[_0xe4f2('0x17')]=_0x4ac5a6[_0xe4f2('0x8')]!=_0x4ac5a6[_0xe4f2('0x18')]?_0xe4f2('0x19'):'disabled';}return _0x4ac5a6;}catch(_0x544bbd){breakingLicense[_0xe4f2('0x8')]=_0x4db8c1['data1'];breakingLicense['message']=_0x544bbd['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5bb945,_0x17196c){getLicense()[_0xe4f2('0x1a')](function(_0x13b9d5){return db[_0xe4f2('0x1b')][_0xe4f2('0x1c')]({'attributes':[_0xe4f2('0x1d'),[db[_0xe4f2('0x1e')]['fn']('COUNT',db[_0xe4f2('0x1e')][_0xe4f2('0x1f')](_0xe4f2('0x1d'))),'count']],'group':'role','where':{'role':{'$or':[_0xe4f2('0x20'),'user',_0xe4f2('0x21')]}},'raw':!![]})[_0xe4f2('0x1a')](function(_0x480250){var _0x1c6616={'user':_0x13b9d5[_0xe4f2('0x22')]||0x0,'telephone':_0x13b9d5[_0xe4f2('0x23')]||0x0};_0x480250[_0xe4f2('0x24')](function(_0x2fd74d){var _0x196a70=_0x2fd74d[_0xe4f2('0x1d')]===_0xe4f2('0x20')?_0xe4f2('0x25'):_0x2fd74d[_0xe4f2('0x1d')];_0x1c6616[_0x196a70]-=_0x2fd74d[_0xe4f2('0x26')];if(_0x1c6616[_0x196a70]<0x0)_0x1c6616[_0x196a70]=0x0;});_0x5bb945(_0x1c6616);return;});})[_0xe4f2('0x27')](function(_0x2dd14c){_0x17196c(_0x2dd14c);});});}function checkUserLimits(_0x5956dc){return new BPromise(function(_0x43c4ab,_0x3d3c08){getLimits()['then'](function(_0x15268e){var _0x5b4753=_['pick'](_['countBy'](_0x5956dc,_0xe4f2('0x1d')),[_0xe4f2('0x20'),_0xe4f2('0x25'),'telephone']);var _0x2468ae=(_0x5b4753[_0xe4f2('0x20')]||0x0)+(_0x5b4753['user']||0x0);var _0x2465c4=_0x5b4753[_0xe4f2('0x21')]||0x0;if(_0x2468ae>_0x15268e['user'])return _0x3d3c08('License\x20limit\x20reached\x20for\x20users');if(_0x2465c4>_0x15268e[_0xe4f2('0x21')])return _0x3d3c08(_0xe4f2('0x28'));return _0x43c4ab();})['catch'](function(_0x220e83){_0x3d3c08(_0x220e83);});});}module[_0xe4f2('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x8b33=['catch','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','parse','demo','uuid','grayReason','changed','disabled','data1','message','User','role','sequelize','COUNT','col','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','moment','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','find','then'];(function(_0x44a76a,_0x58ae6e){var _0x317181=function(_0x52c78c){while(--_0x52c78c){_0x44a76a['push'](_0x44a76a['shift']());}};_0x317181(++_0x58ae6e);}(_0x8b33,0x90));var _0x38b3=function(_0x280049,_0x169fb9){_0x280049=_0x280049-0x0;var _0x1c4cb5=_0x8b33[_0x280049];return _0x1c4cb5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x38b3('0x0'));var BPromise=require('bluebird');var hardware=require(_0x38b3('0x1'));var encryptor=require(_0x38b3('0x2'));var db=require(_0x38b3('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x38b3('0x4'),'machineUuid':hardware[_0x38b3('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x38b3('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x435450){return new BPromise(function(_0x7abbdc,_0x33d35c){return db['License'][_0x38b3('0x6')](_['defaults'](_0x435450,{'raw':!![],'where':{'id':0x1}}))[_0x38b3('0x7')](function(_0x4192e1){return checkLicense(_0x4192e1,null);})['then'](function(_0x306ba4){_0x7abbdc(_0x306ba4);return;})[_0x38b3('0x8')](function(_0x4cb986){_0x33d35c(_0x4cb986);});});}function checkLicense(_0x6147cc,_0xd21561){if(!_0x6147cc){demoLicense['uuid']=_0x6147cc['data1'];return demoLicense;}try{var _0x52f623=_0xd21561||_0x6147cc[_0x38b3('0x9')];if(_[_0x38b3('0xa')](_0x52f623)){throw new Error(_0x38b3('0xb'));}var _0x48bdff=_0x6147cc['data1'];var _0x4dbc84=_0x6147cc['data2'];var _0x51e621=_0x48bdff[_0x38b3('0xc')]('-')[0x4];var _0x229f80=_0x48bdff[_0x38b3('0xc')]('-')[0x0];var _0x1d5c73=encryptor[_0x38b3('0xd')](_0x52f623,util[_0x38b3('0xe')]('%s:%s:%s',_0x51e621,_0x48bdff,_0x229f80));var _0x53e44d=JSON[_0x38b3('0xf')](_0x1d5c73);_0x53e44d[_0x38b3('0x10')]=![];_0x53e44d[_0x38b3('0x11')]=_0x48bdff;_0x53e44d['machineUuid']=hardware['getUuid']();if(_0x4dbc84){var _0x2a5397=encryptor['decryptString'](_0x4dbc84);_0x53e44d['gray']=_0x2a5397;_0x53e44d['deadline']=moment(_0x2a5397)['add'](0x7,'days')[_0x38b3('0xe')]();_0x53e44d[_0x38b3('0x12')]=_0x53e44d[_0x38b3('0x11')]!=_0x53e44d['machineUuid']?_0x38b3('0x13'):_0x38b3('0x14');}return _0x53e44d;}catch(_0x487d09){breakingLicense[_0x38b3('0x11')]=_0x6147cc[_0x38b3('0x15')];breakingLicense[_0x38b3('0x16')]=_0x487d09[_0x38b3('0x16')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5ed0f7,_0x721278){getLicense()[_0x38b3('0x7')](function(_0x1f21b0){return db[_0x38b3('0x17')]['findAll']({'attributes':[_0x38b3('0x18'),[db[_0x38b3('0x19')]['fn'](_0x38b3('0x1a'),db['sequelize'][_0x38b3('0x1b')](_0x38b3('0x18'))),'count']],'group':_0x38b3('0x18'),'where':{'role':{'$or':[_0x38b3('0x1c'),_0x38b3('0x1d'),_0x38b3('0x1e')]}},'raw':!![]})[_0x38b3('0x7')](function(_0x41c38c){var _0x2f703e={'user':_0x1f21b0[_0x38b3('0x1f')]||0x0,'telephone':_0x1f21b0['telephones']||0x0};_0x41c38c[_0x38b3('0x20')](function(_0x481149){var _0x104a38=_0x481149[_0x38b3('0x18')]===_0x38b3('0x1c')?'user':_0x481149[_0x38b3('0x18')];_0x2f703e[_0x104a38]-=_0x481149[_0x38b3('0x21')];if(_0x2f703e[_0x104a38]<0x0)_0x2f703e[_0x104a38]=0x0;});_0x5ed0f7(_0x2f703e);return;});})['catch'](function(_0x378642){_0x721278(_0x378642);});});}function checkUserLimits(_0x2b1e79){return new BPromise(function(_0xd3611c,_0x5955c1){getLimits()[_0x38b3('0x7')](function(_0x5e0bbc){var _0x48850f=_[_0x38b3('0x22')](_[_0x38b3('0x23')](_0x2b1e79,'role'),[_0x38b3('0x1c'),'user',_0x38b3('0x1e')]);var _0x6f3780=(_0x48850f['admin']||0x0)+(_0x48850f[_0x38b3('0x1d')]||0x0);var _0x2a80f8=_0x48850f[_0x38b3('0x1e')]||0x0;if(_0x6f3780>_0x5e0bbc[_0x38b3('0x1d')])return _0x5955c1('License\x20limit\x20reached\x20for\x20users');if(_0x2a80f8>_0x5e0bbc['telephone'])return _0x5955c1(_0x38b3('0x24'));return _0xd3611c();})[_0x38b3('0x8')](function(_0x2081a2){_0x5955c1(_0x2081a2);});});}module[_0x38b3('0x25')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 0cc480e..fe02a55 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 _0xa30a=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x52b844,_0x434e67){var _0x14432f=function(_0x6b692a){while(--_0x6b692a){_0x52b844['push'](_0x52b844['shift']());}};_0x14432f(++_0x434e67);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';module[_0xaa30('0x0')]={'DOMAIN':_0xaa30('0x1'),'SESSION_SECRET':_0xaa30('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xaa30('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x0abf=['app-id','exports','myappanuglar-secret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0abf[_0x432682];return _0x463d05;};'use strict';module[_0xf0ab('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xf0ab('0x1'),'GOOGLE_ID':_0xf0ab('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b114edc..00d7c9f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0ed=['exports','../utils/loggers'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xb0ed,0x91));var _0xdb0e=function(_0x44b5ef,_0x4ef55c){_0x44b5ef=_0x44b5ef-0x0;var _0x104927=_0xb0ed[_0x44b5ef];return _0x104927;};'use strict';var fileLogger=require(_0xdb0e('0x0'))['fileLogger'];module[_0xdb0e('0x1')]=fileLogger; \ No newline at end of file +var _0xa894=['exports','fileLogger'];(function(_0x56418c,_0xd90668){var _0x1c838d=function(_0x222bb8){while(--_0x222bb8){_0x56418c['push'](_0x56418c['shift']());}};_0x1c838d(++_0xd90668);}(_0xa894,0xb9));var _0x4a89=function(_0x326407,_0x2c9181){_0x326407=_0x326407-0x0;var _0x1b69f1=_0xa894[_0x326407];return _0x1b69f1;};'use strict';var fileLogger=require('../utils/loggers')[_0x4a89('0x0')];module[_0x4a89('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9f5fa35..d1dab97 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 _0x8123=['email','../../services/email/index.js','routing','xdr','exports','path','express','ami','join','../../services/ami/index.js','agi'];(function(_0x29f268,_0x2ba80d){var _0x153844=function(_0x276367){while(--_0x276367){_0x29f268['push'](_0x29f268['shift']());}};_0x153844(++_0x2ba80d);}(_0x8123,0x73));var _0x3812=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x8123[_0x270adf];return _0x29eda9;};'use strict';var path=require(_0x3812('0x0'));var os=require('os');var config={'apps':[{'name':_0x3812('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x3812('0x2'),'script':path[_0x3812('0x3')](__dirname,_0x3812('0x4'))},{'name':_0x3812('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x3812('0x6'),'script':path[_0x3812('0x3')](__dirname,_0x3812('0x7'))},{'name':_0x3812('0x8'),'script':path[_0x3812('0x3')](__dirname,'../../services/routing/index.js')},{'name':_0x3812('0x9'),'script':path[_0x3812('0x3')](__dirname,'../../services/xdr/index.js')}]};module[_0x3812('0xa')]=config; \ No newline at end of file +var _0x4295=['agi','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x19f23f,_0x3c7e87){var _0x2f5efb=function(_0x29fcd8){while(--_0x29fcd8){_0x19f23f['push'](_0x19f23f['shift']());}};_0x2f5efb(++_0x3c7e87);}(_0x4295,0x171));var _0x5429=function(_0x4d1cc6,_0x26bebe){_0x4d1cc6=_0x4d1cc6-0x0;var _0x1a6fee=_0x4295[_0x4d1cc6];return _0x1a6fee;};'use strict';var path=require(_0x5429('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x5429('0x1')](__dirname,_0x5429('0x2'))},{'name':_0x5429('0x3'),'script':path[_0x5429('0x1')](__dirname,_0x5429('0x4'))},{'name':_0x5429('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x5429('0x6'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x5429('0x7'),'script':path[_0x5429('0x1')](__dirname,_0x5429('0x8'))},{'name':_0x5429('0x9'),'script':path[_0x5429('0x1')](__dirname,_0x5429('0xa'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 90a092c..0405808 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 _0x34fd=['describe','delete','dump','saved','pm2','bluebird','connect','connected','start','then','stop','restart','disconnect','list'];(function(_0xb277dc,_0x13ab7c){var _0x3903bf=function(_0x3e2d3c){while(--_0x3e2d3c){_0xb277dc['push'](_0xb277dc['shift']());}};_0x3903bf(++_0x13ab7c);}(_0x34fd,0x1d2));var _0xd34f=function(_0x43fc9c,_0xbb4ea1){_0x43fc9c=_0x43fc9c-0x0;var _0x58efbd=_0x34fd[_0x43fc9c];return _0x58efbd;};'use strict';var pm2=require(_0xd34f('0x0'));var BPromise=require(_0xd34f('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x52bfce,_0x10bd32){return pm2[_0xd34f('0x2')](function(_0x4bc776){if(_0x4bc776){return _0x10bd32(_0x4bc776);}return _0x52bfce(_0xd34f('0x3'));});});};exports[_0xd34f('0x4')]=function(_0x28c4e4){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x4180b8,_0xdbdf45){return pm2[_0xd34f('0x4')](_0x28c4e4,function(_0x264320,_0x5ed29d){if(_0x264320){return _0xdbdf45(_0x264320);}pm2['disconnect']();return _0x4180b8(_0x5ed29d);});});});};exports[_0xd34f('0x6')]=function(_0x5643de){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x18f79c,_0x2d9a78){return pm2[_0xd34f('0x6')](_0x5643de,function(_0x362eb7,_0x15c683){if(_0x362eb7){return _0x2d9a78(_0x362eb7);}pm2['disconnect']();return _0x18f79c(_0x15c683);});});});};exports[_0xd34f('0x7')]=function(_0xfd599e){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x46092d,_0x512495){return pm2[_0xd34f('0x7')](_0xfd599e,function(_0x21b092,_0x43c934){if(_0x21b092){return _0x512495(_0x21b092);}pm2[_0xd34f('0x8')]();return _0x46092d(_0x43c934);});});});};exports[_0xd34f('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x16a86a,_0x55e3e8){return pm2[_0xd34f('0x9')](function(_0x773907,_0x1dcdbd){if(_0x773907){return _0x55e3e8(_0x773907);}pm2['disconnect']();return _0x16a86a(_0x1dcdbd);});});});};exports[_0xd34f('0xa')]=function(_0x23dcaa){return connect()['then'](function(){return new BPromise(function(_0x6b3be2,_0x44802d){return pm2['describe'](_0x23dcaa,function(_0x3cf2b3,_0x36b00a){if(_0x3cf2b3){return _0x44802d(_0x3cf2b3);}pm2[_0xd34f('0x8')]();return _0x6b3be2(_0x36b00a);});});});};exports[_0xd34f('0xb')]=function(_0x408449){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x2218ad,_0x27068e){return pm2['delete'](_0x408449,function(_0x2b4f0b,_0xe2b7d8){if(_0x2b4f0b){return _0x27068e(_0x2b4f0b);}pm2[_0xd34f('0x8')]();return _0x2218ad(_0xe2b7d8);});});});};exports[_0xd34f('0xc')]=function(){return connect()[_0xd34f('0x5')](function(){return new BPromise(function(_0x4aaf53,_0x16ecf7){return pm2['dump'](function(_0x51a383){if(_0x51a383){return _0x16ecf7(_0x51a383);}return _0x4aaf53(_0xd34f('0xd'));});});});}; \ No newline at end of file +var _0xef88=['describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','stop','restart','list','disconnect'];(function(_0x5ee98a,_0x5a0da5){var _0x4c5050=function(_0x2b0e81){while(--_0x2b0e81){_0x5ee98a['push'](_0x5ee98a['shift']());}};_0x4c5050(++_0x5a0da5);}(_0xef88,0x1a8));var _0x8ef8=function(_0x3ae750,_0x2c37a9){_0x3ae750=_0x3ae750-0x0;var _0x484a18=_0xef88[_0x3ae750];return _0x484a18;};'use strict';var pm2=require(_0x8ef8('0x0'));var BPromise=require(_0x8ef8('0x1'));var config=require(_0x8ef8('0x2'));function connect(){return new BPromise(function(_0x3e0695,_0x230a4e){return pm2[_0x8ef8('0x3')](function(_0xd4f00b){if(_0xd4f00b){return _0x230a4e(_0xd4f00b);}return _0x3e0695(_0x8ef8('0x4'));});});};exports[_0x8ef8('0x5')]=function(_0x25f5bb){return connect()[_0x8ef8('0x6')](function(){return new BPromise(function(_0x402066,_0x9089e6){return pm2[_0x8ef8('0x5')](_0x25f5bb,function(_0x1ae3ba,_0x336af4){if(_0x1ae3ba){return _0x9089e6(_0x1ae3ba);}pm2['disconnect']();return _0x402066(_0x336af4);});});});};exports[_0x8ef8('0x7')]=function(_0x2e1b4b){return connect()[_0x8ef8('0x6')](function(){return new BPromise(function(_0x1f4a01,_0x88028a){return pm2['stop'](_0x2e1b4b,function(_0x478175,_0x135642){if(_0x478175){return _0x88028a(_0x478175);}pm2['disconnect']();return _0x1f4a01(_0x135642);});});});};exports[_0x8ef8('0x8')]=function(_0x16e85b){return connect()['then'](function(){return new BPromise(function(_0x2e6ceb,_0x5f0747){return pm2[_0x8ef8('0x8')](_0x16e85b,function(_0x7ef816,_0x182a98){if(_0x7ef816){return _0x5f0747(_0x7ef816);}pm2['disconnect']();return _0x2e6ceb(_0x182a98);});});});};exports[_0x8ef8('0x9')]=function(){return connect()[_0x8ef8('0x6')](function(){return new BPromise(function(_0x381f4c,_0x1f621f){return pm2['list'](function(_0x27e7b4,_0x594b2d){if(_0x27e7b4){return _0x1f621f(_0x27e7b4);}pm2[_0x8ef8('0xa')]();return _0x381f4c(_0x594b2d);});});});};exports[_0x8ef8('0xb')]=function(_0x4c7a8d){return connect()[_0x8ef8('0x6')](function(){return new BPromise(function(_0x19f15e,_0x15bca8){return pm2['describe'](_0x4c7a8d,function(_0x38e13e,_0x1ccb26){if(_0x38e13e){return _0x15bca8(_0x38e13e);}pm2[_0x8ef8('0xa')]();return _0x19f15e(_0x1ccb26);});});});};exports[_0x8ef8('0xc')]=function(_0x552c1b){return connect()['then'](function(){return new BPromise(function(_0x28a2e2,_0x22a58e){return pm2['delete'](_0x552c1b,function(_0x5c57e3,_0x110bf5){if(_0x5c57e3){return _0x22a58e(_0x5c57e3);}pm2[_0x8ef8('0xa')]();return _0x28a2e2(_0x110bf5);});});});};exports['dump']=function(){return connect()[_0x8ef8('0x6')](function(){return new BPromise(function(_0x23d227,_0x1c900d){return pm2[_0x8ef8('0xd')](function(_0x2da941){if(_0x2da941){return _0x1c900d(_0x2da941);}return _0x23d227(_0x8ef8('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 87eb494..a378877 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 _0x717e=['catch','error','[CHAT]\x20Error\x20closing\x20interactions','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','then','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit'];(function(_0x54d1c4,_0x3adff8){var _0x4cb00a=function(_0x2a7db2){while(--_0x2a7db2){_0x54d1c4['push'](_0x54d1c4['shift']());}};_0x4cb00a(++_0x3adff8);}(_0x717e,0x1f3));var _0xe717=function(_0xde9959,_0x415b88){_0xde9959=_0xde9959-0x0;var _0x24d9d5=_0x717e[_0xde9959];return _0x24d9d5;};'use strict';var _=require('lodash');var moment=require(_0xe717('0x0'));var Redis=require(_0xe717('0x1'));var util=require(_0xe717('0x2'));var config=require(_0xe717('0x3'));var db=require(_0xe717('0x4'))['db'];var logger=require(_0xe717('0x5'))(_0xe717('0x6'));config[_0xe717('0x7')]=_[_0xe717('0x8')](config[_0xe717('0x7')],{'host':_0xe717('0x9'),'port':0x18eb});var io=require(_0xe717('0xa'))(new Redis(config[_0xe717('0x7')]));function closeInteractions(){var _0x151f35=0x0;var _0x14211c=[];return db['Setting'][_0xe717('0xb')]({'raw':!![],'attributes':['id',_0xe717('0xc')],'where':{'id':0x1}})['then'](function(_0x503bed){_0x151f35=_0x503bed[_0xe717('0xc')];if(_0x151f35){return db[_0xe717('0xd')]['findAll']({'raw':!![],'attributes':['id',_0xe717('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe717('0xf')](_0x503bed[_0xe717('0xc')],'minutes')}}});}else{return[];}})[_0xe717('0x10')](function(_0x1aca34){if(_0x1aca34&&_0x1aca34['length']){_0x14211c=_[_0xe717('0x11')](_0x1aca34||[],'id');logger['info'](_0xe717('0x12'),_0x14211c[_0xe717('0x13')]());return db['ChatInteraction']['update']({'closeReason':_0xe717('0x14'),'disposition':_0xe717('0x15'),'closed':!![],'closedAt':moment()[_0xe717('0x16')](_0xe717('0x17'))},{'where':{'id':_0x14211c}});}})[_0xe717('0x10')](function(){if(_0x14211c&&_0x14211c['length']){logger[_0xe717('0x18')](_0xe717('0x19'),_0x14211c[_0xe717('0x13')]());for(var _0x38ac04=0x0;_0x38ac04<_0x14211c[_0xe717('0x1a')];_0x38ac04++){io[_0xe717('0x1b')]('chatInteraction:update',{'id':_0x14211c[_0x38ac04],'closed':!![]});}}})[_0xe717('0x1c')](function(_0x4f7018){logger[_0xe717('0x1d')](_0xe717('0x1e'),_0x4f7018?util['inspect'](_0x4f7018,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3959=['chatTimeout','minutes','length','map','info','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','Setting','find','then','ChatInteraction','lastMsgAt','subtract'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3959,0x127));var _0x9395=function(_0x6844f1,_0x2385e4){_0x6844f1=_0x6844f1-0x0;var _0x2daa4c=_0x3959[_0x6844f1];return _0x2daa4c;};'use strict';var _=require(_0x9395('0x0'));var moment=require(_0x9395('0x1'));var Redis=require('ioredis');var util=require(_0x9395('0x2'));var config=require(_0x9395('0x3'));var db=require(_0x9395('0x4'))['db'];var logger=require('../logger')(_0x9395('0x5'));config[_0x9395('0x6')]=_['defaults'](config[_0x9395('0x6')],{'host':_0x9395('0x7'),'port':0x18eb});var io=require(_0x9395('0x8'))(new Redis(config[_0x9395('0x6')]));function closeInteractions(){var _0x12a22f=0x0;var _0x280fad=[];return db[_0x9395('0x9')][_0x9395('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x9395('0xb')](function(_0x4d3e1c){_0x12a22f=_0x4d3e1c['chatTimeout'];if(_0x12a22f){return db[_0x9395('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x9395('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9395('0xe')](_0x4d3e1c[_0x9395('0xf')],_0x9395('0x10'))}}});}else{return[];}})[_0x9395('0xb')](function(_0x3f9b15){if(_0x3f9b15&&_0x3f9b15[_0x9395('0x11')]){_0x280fad=_[_0x9395('0x12')](_0x3f9b15||[],'id');logger[_0x9395('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x280fad[_0x9395('0x14')]());return db[_0x9395('0xc')][_0x9395('0x15')]({'closeReason':'system','disposition':_0x9395('0x16'),'closed':!![],'closedAt':moment()[_0x9395('0x17')](_0x9395('0x18'))},{'where':{'id':_0x280fad}});}})['then'](function(){if(_0x280fad&&_0x280fad['length']){logger[_0x9395('0x13')](_0x9395('0x19'),_0x280fad['join']());for(var _0x300fd5=0x0;_0x300fd5<_0x280fad[_0x9395('0x11')];_0x300fd5++){io[_0x9395('0x1a')](_0x9395('0x1b'),{'id':_0x280fad[_0x300fd5],'closed':!![]});}}})['catch'](function(_0x2a430a){logger[_0x9395('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x2a430a?util[_0x9395('0x1d')](_0x2a430a,{'showHidden':![],'depth':null}):'');});}exports[_0x9395('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 423a7e1..8975981 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe90f=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x5ef631,_0x947435){var _0x1ad9d7=function(_0x13f01d){while(--_0x13f01d){_0x5ef631['push'](_0x5ef631['shift']());}};_0x1ad9d7(++_0x947435);}(_0xe90f,0x7f));var _0xfe90=function(_0x55e631,_0x4e9bdb){_0x55e631=_0x55e631-0x0;var _0x1a0670=_0xe90f[_0x55e631];return _0x1a0670;};'use strict';function start(){var _0x5d4a27=require(_0xfe90('0x0'));return _0x5d4a27[_0xfe90('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xc47c=['startAllRefreshIntervals','exports'];(function(_0x3e61d4,_0x224d2d){var _0x40bd4e=function(_0x21432f){while(--_0x21432f){_0x3e61d4['push'](_0x3e61d4['shift']());}};_0x40bd4e(++_0x224d2d);}(_0xc47c,0xc0));var _0xcc47=function(_0x47db2e,_0x41b2e3){_0x47db2e=_0x47db2e-0x0;var _0x467df3=_0xc47c[_0x47db2e];return _0x467df3;};'use strict';function start(){var _0x1549b2=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1549b2[_0xcc47('0x0')]();}module[_0xcc47('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index efaf21d..ac67932 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 _0x7acd=['then','findAll','CloudProvider','jobs','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','length','active','update','update\x20cron','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','%s.%s','savename','extname','existsSync','status','Sent','message','attachments','stringify','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId'];(function(_0x4f3baa,_0x9d31ac){var _0x307f57=function(_0x5dee19){while(--_0x5dee19){_0x4f3baa['push'](_0x4f3baa['shift']());}};_0x307f57(++_0x9d31ac);}(_0x7acd,0x107));var _0xd7ac=function(_0x52aac3,_0x495cb2){_0x52aac3=_0x52aac3-0x0;var _0x4f213e=_0x7acd[_0x52aac3];return _0x4f213e;};'use strict';var fs=require('fs');var util=require(_0xd7ac('0x0'));var path=require('path');var _=require(_0xd7ac('0x1'));var moment=require(_0xd7ac('0x2'));var CronJobManager=require(_0xd7ac('0x3'));var jayson=require(_0xd7ac('0x4'));var BPromise=require(_0xd7ac('0x5'));var logger=require(_0xd7ac('0x6'))(_0xd7ac('0x7'));var db=require(_0xd7ac('0x8'))['db'];var analyticCustomReportController=require(_0xd7ac('0x9'));var analyticDefaultReportController=require(_0xd7ac('0xa'));var client=jayson[_0xd7ac('0xb')][_0xd7ac('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x48475c,_0xba4a67){return function(){logger[_0xd7ac('0xd')](_0xd7ac('0xe'),_0x48475c[_0xd7ac('0xf')]);var _0x4f2ccb=!![];var _0x2f099c=_0x48475c['MailAccount'][_0xd7ac('0x10')]();var _0x458657={'account':_0x2f099c,'message':{'from':util[_0xd7ac('0x11')](_0xd7ac('0x12'),_0x48475c[_0xd7ac('0x13')][_0xd7ac('0x14')],_0x48475c['MailAccount'][_0xd7ac('0xf')]||_0x48475c[_0xd7ac('0x13')][_0xd7ac('0x15')]['user']),'to':_0x48475c[_0xd7ac('0xf')],'cc':_0x48475c['cc'],'bcc':_0x48475c[_0xd7ac('0x16')],'subject':util[_0xd7ac('0x11')](_0xd7ac('0x17'),_0xba4a67[_0xd7ac('0x14')],_0x48475c[_0xd7ac('0x18')],_0x48475c[_0xd7ac('0x19')])}};var _0x39c246=path[_0xd7ac('0x1a')](__dirname,'../../files/reports');var _0x24ec98=_0xba4a67['savename'];var _0x3eb33f=util[_0xd7ac('0x11')](_0xd7ac('0x1b'),path['basename'](_0xba4a67[_0xd7ac('0x1c')],path[_0xd7ac('0x1d')](_0xba4a67[_0xd7ac('0x1c')])),'zip');var _0x1d0f21=path['join'](_0x39c246,_0x24ec98);var _0x55a4eb=path[_0xd7ac('0x1a')](_0x39c246,_0x3eb33f);if(fs[_0xd7ac('0x1e')](_0x1d0f21)){_0xba4a67[_0xd7ac('0x1f')]=_0xd7ac('0x20');_0x458657[_0xd7ac('0x21')][_0xd7ac('0x22')]=[{'filename':_0x24ec98,'path':_0x1d0f21}];_0x458657['message']['text']=util[_0xd7ac('0x11')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd7ac('0x23')](_0xba4a67,null,0x2));}else if(fs[_0xd7ac('0x1e')](_0x55a4eb)){_0xba4a67[_0xd7ac('0x1f')]=_0xd7ac('0x20');_0x458657['message'][_0xd7ac('0x22')]=[{'filename':_0x3eb33f,'path':_0x55a4eb}];}else{_0x458657['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x48475c['sendIfEmpty']){_0x4f2ccb=![];logger['info'](_0xd7ac('0x24'));}}if(_0x4f2ccb){return client[_0xd7ac('0x25')](_0xd7ac('0x26'),_0x458657)['then'](function(_0x28f206){if(_0x28f206[_0xd7ac('0x27')]){return logger['error'](_0xd7ac('0x28'),JSON[_0xd7ac('0x23')](_0x28f206));}return logger['info'](_0xd7ac('0x29'));})[_0xd7ac('0x2a')](function(_0x21567b){return logger[_0xd7ac('0x27')](_0xd7ac('0x28'),JSON[_0xd7ac('0x23')](_0x21567b));});}};}function handleError(){return function(_0x497f26){return logger[_0xd7ac('0x27')](JSON[_0xd7ac('0x23')](_0x497f26));};}function handleResult(_0xc2e59f){return function(_0x56e09e){logger[_0xd7ac('0xd')](_0xd7ac('0x2b'),JSON[_0xd7ac('0x23')](_0x56e09e));if(_0xc2e59f[_0xd7ac('0x13')]&&_0xc2e59f[_0xd7ac('0x13')][_0xd7ac('0x15')]&&!_[_0xd7ac('0x2c')](_0xc2e59f[_0xd7ac('0xf')])){setTimeout(handleSendEmail(_0xc2e59f,_0x56e09e),0x3c*0x3e8);}};}function handleJob(_0x234e93){return function(){try{if(_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x18')])){return logger[_0xd7ac('0xd')](_0xd7ac('0x2d'));}if(_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x19')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5663b7={'startDate':moment()[_0xd7ac('0x2e')](_0x234e93[_0xd7ac('0x18')],_0x234e93[_0xd7ac('0x19')])[_0xd7ac('0x11')](_0xd7ac('0x2f')),'endDate':moment()[_0xd7ac('0x11')](_0xd7ac('0x2f')),'type':_0xd7ac('0x30'),'output':_0x234e93['output'],'name':_0x234e93[_0xd7ac('0x14')]};if(!_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x31')])){logger[_0xd7ac('0xd')](_0xd7ac('0x32'),_0x234e93[_0xd7ac('0x31')]);return analyticDefaultReportController[_0xd7ac('0x33')]({'id':_0x234e93[_0xd7ac('0x31')]},_0x5663b7)['then'](handleResult(_0x234e93))['catch'](handleError());}if(!_[_0xd7ac('0x2c')](_0x234e93[_0xd7ac('0x34')])){logger[_0xd7ac('0xd')]('exec\x20custom\x20report\x20id:%s',_0x234e93['CustomReportId']);return analyticCustomReportController[_0xd7ac('0x33')]({'id':_0x234e93['CustomReportId']},_0x5663b7)[_0xd7ac('0x35')](handleResult(_0x234e93))[_0xd7ac('0x2a')](handleError());}}catch(_0x26f52e){logger[_0xd7ac('0x27')](JSON[_0xd7ac('0x23')](_0x26f52e));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x39d880){var _0x21694a={};if(_0x39d880){_0x21694a['id']=_0x39d880;}return db['Schedule'][_0xd7ac('0x36')]({'where':_0x21694a,'include':[{'model':db['MailAccount'],'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xd7ac('0x15'),'include':[{'model':db['CloudProvider'],'as':_0xd7ac('0x37')}]}]}]})[_0xd7ac('0x35')](function(_0x5ccf73){var _0x3e5af8=_['keys'](manager[_0xd7ac('0x38')]);var _0x4eb904=_[_0xd7ac('0x39')](_0x5ccf73,function(_0x3f71f2){return _0x3f71f2['id'][_0xd7ac('0x3a')]();});var _0x931772=_['keyBy'](_0x5ccf73,function(_0x36b777){return _0x36b777['id'][_0xd7ac('0x3a')]();});var _0xc39aea=_0x39d880?_0x4eb904:_[_0xd7ac('0x3b')](_0x4eb904,_0x3e5af8);var _0x59572f=_[_0xd7ac('0x3c')](_0x4eb904,_0x3e5af8);var _0x516956=_[_0xd7ac('0x3b')](_0x3e5af8,_0x4eb904);var _0x5aa476;var _0x415923;for(_0x5aa476=0x0;_0x5aa476<_0x516956['length']&&!_0x39d880;_0x5aa476+=0x1){_0x415923=_0x516956[_0x5aa476]['toString']();if(manager[_0xd7ac('0x3d')](_0x415923)){manager[_0xd7ac('0x3e')](_0x415923);manager[_0xd7ac('0x3f')](_0x415923);logger[_0xd7ac('0xd')](_0xd7ac('0x40'),_0x415923);}}logger[_0xd7ac('0xd')](_0xd7ac('0x41'),JSON['stringify'](_0xc39aea));for(_0x5aa476=0x0;_0x5aa476<_0xc39aea['length'];_0x5aa476+=0x1){_0x415923=_0xc39aea[_0x5aa476][_0xd7ac('0x3a')]();logger[_0xd7ac('0xd')]('index',_0x415923);if(_0x39d880){logger[_0xd7ac('0xd')](_0xd7ac('0x42'),_0x39d880);logger[_0xd7ac('0xd')](JSON[_0xd7ac('0x23')](_0x931772[_0x415923]));BPromise['resolve']()['then'](handleJob(_0x931772[_0x415923]));logger['info'](_0xd7ac('0x43'),_0x931772[_0x415923]['name'],_0x931772[_0x415923][_0xd7ac('0x44')]);}else if(_0x931772[_0x415923]['cron']&&_0x931772[_0x415923]['active']&&moment()[_0xd7ac('0x45')](_0x931772[_0x415923][_0xd7ac('0x46')],_0x931772[_0x415923][_0xd7ac('0x47')])){manager['add'](_0x415923,_0x931772[_0x415923][_0xd7ac('0x44')],handleJob(_0x931772[_0x415923]));manager[_0xd7ac('0x48')](_0x415923);logger[_0xd7ac('0xd')](_0xd7ac('0x49'),_0x931772[_0x415923]['name'],_0x931772[_0x415923][_0xd7ac('0x44')]);}else if(manager[_0xd7ac('0x3d')](_0x415923)){manager[_0xd7ac('0x3e')](_0x415923);manager['deleteJob'](_0x415923);logger['info'](_0xd7ac('0x4a'),_0x931772[_0x415923][_0xd7ac('0x14')],_0x931772[_0x415923][_0xd7ac('0x44')]);}}for(_0x5aa476=0x0,_0x415923;_0x5aa476<_0x59572f[_0xd7ac('0x4b')]&&!_0x39d880;_0x5aa476+=0x1){_0x415923=_0x59572f[_0x5aa476]['toString']();if(manager['exists'](_0x415923)){if(_0x931772[_0x415923]['cron']&&_0x931772[_0x415923][_0xd7ac('0x4c')]&&moment()[_0xd7ac('0x45')](_0x931772[_0x415923][_0xd7ac('0x46')],_0x931772[_0x415923]['endAt'])){manager[_0xd7ac('0x4d')](_0x415923,_0x931772[_0x415923][_0xd7ac('0x44')],handleJob(_0x931772[_0x415923]));logger['info'](_0xd7ac('0x4e'),_0x931772[_0x415923][_0xd7ac('0x14')],_0x931772[_0x415923][_0xd7ac('0x44')]);}else{manager[_0xd7ac('0x3e')](_0x415923);manager['deleteJob'](_0x415923);logger[_0xd7ac('0xd')](_0xd7ac('0x4a'),_0x931772[_0x415923]['name'],_0x931772[_0x415923][_0xd7ac('0x44')]);}}}})['catch'](function(_0x3d9386){logger[_0xd7ac('0x27')](JSON[_0xd7ac('0x23')](_0x3d9386));});}exports['run']=function(_0xb0149e){return getJobs(_0xb0149e);};exports[_0xd7ac('0x48')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0f61=['exec\x20defaul\x20report\x20id:%s','DefaultReportId','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','intersection','difference','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','startAt','endAt','add','add\x20cron','stop\x20cron','isBetween','update','update\x20cron','stop','start','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','data','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output'];(function(_0x12a020,_0x85b476){var _0x63cddd=function(_0x13bff5){while(--_0x13bff5){_0x12a020['push'](_0x12a020['shift']());}};_0x63cddd(++_0x85b476);}(_0x0f61,0x17f));var _0x10f6=function(_0x5ebf10,_0x2f1aaa){_0x5ebf10=_0x5ebf10-0x0;var _0x3ecc0a=_0x0f61[_0x5ebf10];return _0x3ecc0a;};'use strict';var fs=require('fs');var util=require(_0x10f6('0x0'));var path=require('path');var _=require(_0x10f6('0x1'));var moment=require(_0x10f6('0x2'));var CronJobManager=require(_0x10f6('0x3'));var jayson=require(_0x10f6('0x4'));var BPromise=require(_0x10f6('0x5'));var logger=require(_0x10f6('0x6'))(_0x10f6('0x7'));var db=require(_0x10f6('0x8'))['db'];var analyticCustomReportController=require(_0x10f6('0x9'));var analyticDefaultReportController=require(_0x10f6('0xa'));var client=jayson[_0x10f6('0xb')][_0x10f6('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x13ce98,_0x1357f1){return function(){logger['info'](_0x10f6('0xd'),_0x13ce98[_0x10f6('0xe')]);var _0x50276b=!![];var _0x193b88=_0x13ce98[_0x10f6('0xf')][_0x10f6('0x10')]();var _0x30f6d1={'account':_0x193b88,'message':{'from':util[_0x10f6('0x11')](_0x10f6('0x12'),_0x13ce98[_0x10f6('0xf')][_0x10f6('0x13')],_0x13ce98[_0x10f6('0xf')][_0x10f6('0xe')]||_0x13ce98[_0x10f6('0xf')][_0x10f6('0x14')][_0x10f6('0x15')]),'to':_0x13ce98['email'],'cc':_0x13ce98['cc'],'bcc':_0x13ce98['bcc'],'subject':util[_0x10f6('0x11')](_0x10f6('0x16'),_0x1357f1[_0x10f6('0x13')],_0x13ce98[_0x10f6('0x17')],_0x13ce98[_0x10f6('0x18')])}};var _0x595543=path[_0x10f6('0x19')](__dirname,_0x10f6('0x1a'));var _0x4f69b3=_0x1357f1['savename'];var _0x2d8a31=util['format']('%s.%s',path[_0x10f6('0x1b')](_0x1357f1[_0x10f6('0x1c')],path[_0x10f6('0x1d')](_0x1357f1['savename'])),_0x10f6('0x1e'));var _0x52ef75=path['join'](_0x595543,_0x4f69b3);var _0x5dae6a=path[_0x10f6('0x19')](_0x595543,_0x2d8a31);if(fs[_0x10f6('0x1f')](_0x52ef75)){_0x1357f1[_0x10f6('0x20')]=_0x10f6('0x21');_0x30f6d1['message']['attachments']=[{'filename':_0x4f69b3,'path':_0x52ef75}];_0x30f6d1[_0x10f6('0x22')][_0x10f6('0x23')]=util[_0x10f6('0x11')](_0x10f6('0x24'),JSON[_0x10f6('0x25')](_0x1357f1,null,0x2));}else if(fs['existsSync'](_0x5dae6a)){_0x1357f1['status']='Sent';_0x30f6d1[_0x10f6('0x22')][_0x10f6('0x26')]=[{'filename':_0x2d8a31,'path':_0x5dae6a}];}else{_0x30f6d1[_0x10f6('0x22')][_0x10f6('0x23')]=_0x10f6('0x27');if(!_0x13ce98['sendIfEmpty']){_0x50276b=![];logger[_0x10f6('0x28')](_0x10f6('0x29'));}}if(_0x50276b){return client['request'](_0x10f6('0x2a'),_0x30f6d1)[_0x10f6('0x2b')](function(_0x530cf4){if(_0x530cf4['error']){return logger[_0x10f6('0x2c')]('error\x20mail',JSON[_0x10f6('0x25')](_0x530cf4));}return logger[_0x10f6('0x28')]('email\x20sent');})['catch'](function(_0xcc0efe){return logger[_0x10f6('0x2c')]('error\x20mail',JSON[_0x10f6('0x25')](_0xcc0efe));});}};}function handleError(){return function(_0x4929c7){return logger[_0x10f6('0x2c')](JSON[_0x10f6('0x25')](_0x4929c7));};}function handleResult(_0x4ea327){return function(_0x1a148a){logger[_0x10f6('0x28')](_0x10f6('0x2d'),JSON[_0x10f6('0x25')](_0x1a148a));if(_0x4ea327[_0x10f6('0xf')]&&_0x4ea327[_0x10f6('0xf')]['Smtp']&&!_['isNil'](_0x4ea327[_0x10f6('0xe')])){setTimeout(handleSendEmail(_0x4ea327,_0x1a148a),0x3c*0x3e8);}};}function handleJob(_0x28a038){return function(){try{if(_['isNil'](_0x28a038['subtractNumber'])){return logger['info'](_0x10f6('0x2e'));}if(_[_0x10f6('0x2f')](_0x28a038[_0x10f6('0x18')])){return logger[_0x10f6('0x28')](_0x10f6('0x30'));}var _0x3786dc={'startDate':moment()['subtract'](_0x28a038['subtractNumber'],_0x28a038['subtractUnit'])[_0x10f6('0x11')](_0x10f6('0x31')),'endDate':moment()[_0x10f6('0x11')](_0x10f6('0x31')),'type':_0x10f6('0x32'),'output':_0x28a038[_0x10f6('0x33')],'name':_0x28a038[_0x10f6('0x13')]};if(!_['isNil'](_0x28a038['DefaultReportId'])){logger['info'](_0x10f6('0x34'),_0x28a038['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x28a038[_0x10f6('0x35')]},_0x3786dc)['then'](handleResult(_0x28a038))[_0x10f6('0x36')](handleError());}if(!_['isNil'](_0x28a038[_0x10f6('0x37')])){logger[_0x10f6('0x28')](_0x10f6('0x38'),_0x28a038[_0x10f6('0x37')]);return analyticCustomReportController['runReport']({'id':_0x28a038['CustomReportId']},_0x3786dc)[_0x10f6('0x2b')](handleResult(_0x28a038))[_0x10f6('0x36')](handleError());}}catch(_0x2a0374){logger[_0x10f6('0x2c')](JSON[_0x10f6('0x25')](_0x2a0374));}return logger[_0x10f6('0x28')](_0x10f6('0x39'));};}function getJobs(_0x57aed2){var _0x5a2393={};if(_0x57aed2){_0x5a2393['id']=_0x57aed2;}return db[_0x10f6('0x3a')][_0x10f6('0x3b')]({'where':_0x5a2393,'include':[{'model':db[_0x10f6('0xf')],'attributes':['id',_0x10f6('0x13'),_0x10f6('0xe')],'include':[{'model':db[_0x10f6('0x3c')],'as':_0x10f6('0x14'),'include':[{'model':db[_0x10f6('0x3d')],'as':_0x10f6('0x3d')}]}]}]})[_0x10f6('0x2b')](function(_0x2ccbfe){var _0x86abd5=_[_0x10f6('0x3e')](manager[_0x10f6('0x3f')]);var _0xcb56bb=_[_0x10f6('0x40')](_0x2ccbfe,function(_0x2e849c){return _0x2e849c['id'][_0x10f6('0x41')]();});var _0x311b01=_['keyBy'](_0x2ccbfe,function(_0xd66732){return _0xd66732['id'][_0x10f6('0x41')]();});var _0x34f2f7=_0x57aed2?_0xcb56bb:_['difference'](_0xcb56bb,_0x86abd5);var _0x4341bd=_[_0x10f6('0x42')](_0xcb56bb,_0x86abd5);var _0x4f2170=_[_0x10f6('0x43')](_0x86abd5,_0xcb56bb);var _0xcc0eb5;var _0xeecb1d;for(_0xcc0eb5=0x0;_0xcc0eb5<_0x4f2170[_0x10f6('0x44')]&&!_0x57aed2;_0xcc0eb5+=0x1){_0xeecb1d=_0x4f2170[_0xcc0eb5][_0x10f6('0x41')]();if(manager[_0x10f6('0x45')](_0xeecb1d)){manager['stop'](_0xeecb1d);manager[_0x10f6('0x46')](_0xeecb1d);logger[_0x10f6('0x28')](_0x10f6('0x47'),_0xeecb1d);}}logger['info'](_0x10f6('0x48'),JSON[_0x10f6('0x25')](_0x34f2f7));for(_0xcc0eb5=0x0;_0xcc0eb5<_0x34f2f7['length'];_0xcc0eb5+=0x1){_0xeecb1d=_0x34f2f7[_0xcc0eb5][_0x10f6('0x41')]();logger['info'](_0x10f6('0x49'),_0xeecb1d);if(_0x57aed2){logger[_0x10f6('0x28')](_0x10f6('0x4a'),_0x57aed2);logger[_0x10f6('0x28')](JSON[_0x10f6('0x25')](_0x311b01[_0xeecb1d]));BPromise['resolve']()['then'](handleJob(_0x311b01[_0xeecb1d]));logger[_0x10f6('0x28')](_0x10f6('0x4b'),_0x311b01[_0xeecb1d][_0x10f6('0x13')],_0x311b01[_0xeecb1d][_0x10f6('0x4c')]);}else if(_0x311b01[_0xeecb1d][_0x10f6('0x4c')]&&_0x311b01[_0xeecb1d]['active']&&moment()['isBetween'](_0x311b01[_0xeecb1d][_0x10f6('0x4d')],_0x311b01[_0xeecb1d][_0x10f6('0x4e')])){manager[_0x10f6('0x4f')](_0xeecb1d,_0x311b01[_0xeecb1d][_0x10f6('0x4c')],handleJob(_0x311b01[_0xeecb1d]));manager['start'](_0xeecb1d);logger[_0x10f6('0x28')](_0x10f6('0x50'),_0x311b01[_0xeecb1d][_0x10f6('0x13')],_0x311b01[_0xeecb1d][_0x10f6('0x4c')]);}else if(manager['exists'](_0xeecb1d)){manager['stop'](_0xeecb1d);manager['deleteJob'](_0xeecb1d);logger[_0x10f6('0x28')](_0x10f6('0x51'),_0x311b01[_0xeecb1d][_0x10f6('0x13')],_0x311b01[_0xeecb1d]['cron']);}}for(_0xcc0eb5=0x0,_0xeecb1d;_0xcc0eb5<_0x4341bd['length']&&!_0x57aed2;_0xcc0eb5+=0x1){_0xeecb1d=_0x4341bd[_0xcc0eb5][_0x10f6('0x41')]();if(manager['exists'](_0xeecb1d)){if(_0x311b01[_0xeecb1d][_0x10f6('0x4c')]&&_0x311b01[_0xeecb1d]['active']&&moment()[_0x10f6('0x52')](_0x311b01[_0xeecb1d][_0x10f6('0x4d')],_0x311b01[_0xeecb1d][_0x10f6('0x4e')])){manager[_0x10f6('0x53')](_0xeecb1d,_0x311b01[_0xeecb1d]['cron'],handleJob(_0x311b01[_0xeecb1d]));logger[_0x10f6('0x28')](_0x10f6('0x54'),_0x311b01[_0xeecb1d][_0x10f6('0x13')],_0x311b01[_0xeecb1d][_0x10f6('0x4c')]);}else{manager[_0x10f6('0x55')](_0xeecb1d);manager[_0x10f6('0x46')](_0xeecb1d);logger['info'](_0x10f6('0x51'),_0x311b01[_0xeecb1d][_0x10f6('0x13')],_0x311b01[_0xeecb1d][_0x10f6('0x4c')]);}}}})[_0x10f6('0x36')](function(_0x539d07){logger[_0x10f6('0x2c')](JSON[_0x10f6('0x25')](_0x539d07));});}exports['run']=function(_0x37f6d0){return getJobs(_0x37f6d0);};exports[_0x10f6('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index ae8f55b..d42798f 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbb4=['[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeName','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Sequelize','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason'];(function(_0x56a90e,_0x139138){var _0x4d44ea=function(_0x1c4db2){while(--_0x1c4db2){_0x56a90e['push'](_0x56a90e['shift']());}};_0x4d44ea(++_0x139138);}(_0xfbb4,0x186));var _0x4fbb=function(_0x4c77a2,_0x451b31){_0x4c77a2=_0x4c77a2-0x0;var _0x1f41dd=_0xfbb4[_0x4c77a2];return _0x1f41dd;};var _=require(_0x4fbb('0x0'));var AWS=require(_0x4fbb('0x1'));var rp=require(_0x4fbb('0x2'));var util=require(_0x4fbb('0x3'));var BPromise=require(_0x4fbb('0x4'));var db=require(_0x4fbb('0x5'))['db'];var logger=require(_0x4fbb('0x6'))(_0x4fbb('0x7'));function getTranscriptionJob(_0x5c67e4,_0x514d23,_0x16c6f2,_0xba265e){return new Promise(function(_0x2b5756,_0x306f07){var _0x5f0b6b=new AWS['TranscribeService']({'accessKeyId':_0x514d23,'secretAccessKey':_0x5c67e4,'region':_0x16c6f2});_0x5f0b6b['getTranscriptionJob']({'TranscriptionJobName':_0xba265e},function(_0x4e57d7,_0xa17d45){if(_0x4e57d7){return _0x306f07(_0x4e57d7);}else{return _0x2b5756(_0xa17d45);}});});}function sentiment(_0x45ac3e,_0x5574b4,_0xc9ddea,_0xc3ed78,_0x4cac34){return new Promise(function(_0x360c27,_0x208526){var _0x1ecd42=new AWS[(_0x4fbb('0x8'))]({'accessKeyId':_0x5574b4,'secretAccessKey':_0x45ac3e,'region':_0xc9ddea});_0x1ecd42[_0x4fbb('0x9')]({'Text':_0xc3ed78,'LanguageCode':_0x4cac34['substring'](0x0,0x2)},function(_0xa148,_0x3e349){if(_0xa148){return _0x208526(_0xa148);}else{return _0x360c27(_0x3e349);}});});}function checkTranscribeJob(_0x3b94dc,_0x2aec34,_0x340523){var _0x486020;return new BPromise(function(_0x5f2a54,_0x19dd5e){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0xc'),_0x3b94dc['id'],_0x3b94dc['transcribeName']));return getTranscriptionJob(_0x340523[_0x4fbb('0xd')],_0x340523['data2'],_0x2aec34['transcribeRegion'],_0x3b94dc[_0x4fbb('0xe')])[_0x4fbb('0xf')](function(_0x4c47ff){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3b94dc['id'],_0x3b94dc['transcribeName'],_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x11')]));if(!_0x3b94dc[_0x4fbb('0x12')]){switch(_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x11')]){case _0x4fbb('0x13'):var _0x91e29f={'transcribeStatus':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x11')],'fileUri':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x14')][_0x4fbb('0x15')]};logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x16'),_0x3b94dc['id']));return rp({'uri':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x14')][_0x4fbb('0x15')],'json':!![]})[_0x4fbb('0xf')](function(_0x2db786){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x17'),_0x3b94dc['id']));if(_0x2db786&&_0x2db786[_0x4fbb('0x18')]&&_0x2db786['results']['transcripts']&&_0x2db786[_0x4fbb('0x18')][_0x4fbb('0x19')][_0x4fbb('0x1a')]){_0x91e29f[_0x4fbb('0x12')]='';for(var _0x505c9d=0x0;_0x505c9d<_0x2db786[_0x4fbb('0x18')][_0x4fbb('0x19')]['length'];_0x505c9d++){_0x91e29f['fileText']+=_0x2db786['results'][_0x4fbb('0x19')][_0x505c9d][_0x4fbb('0x1b')]+'';}}return _0x3b94dc[_0x4fbb('0x1c')](_0x91e29f);})[_0x4fbb('0xf')](function(){logger['info'](util[_0x4fbb('0xb')](_0x4fbb('0x1d'),_0x3b94dc['id']));if(!_0x3b94dc[_0x4fbb('0x1e')]){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x20'));}if(!_0x2aec34[_0x4fbb('0x21')]||!_0x2aec34[_0x4fbb('0x22')]||!_0x2aec34[_0x4fbb('0x23')]||!_0x2aec34[_0x4fbb('0x24')]||!_0x2aec34[_0x4fbb('0x25')]){throw new db['Sequelize'][(_0x4fbb('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x91e29f[_0x4fbb('0x12')]){throw new Error(_0x4fbb('0x26'));}if(_0x2aec34[_0x4fbb('0x22')]===_0x340523['id']){return _0x340523;}else{return db[_0x4fbb('0x27')]['findOne']({'where':{'id':_settings[_0x4fbb('0x22')]}});}})[_0x4fbb('0xf')](function(_0x4f112c){if(!_0x4f112c){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x28'));}if(!_0x4f112c[_0x4fbb('0xd')]||!_0x4f112c['data2']){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x2a'));}_0x486020=_0x4f112c;logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x2b'),_0x3b94dc['id']));return sentiment(_0x486020['data1'],_0x486020[_0x4fbb('0x2c')],_0x2aec34['sentimentRegion'],_0x91e29f['fileText'],_0x2aec34[_0x4fbb('0x24')]);})['then'](function(_0x3c2be1){logger[_0x4fbb('0xa')](util['format'](_0x4fbb('0x2d'),_0x3b94dc['id']));return _0x3b94dc[_0x4fbb('0x1c')]({'sentiment':_0x3c2be1[_0x4fbb('0x2e')],'sPositive':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x30')],'sNegative':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x31')],'sMixed':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x32')],'sNeutral':_0x3c2be1[_0x4fbb('0x2f')][_0x4fbb('0x33')]});})[_0x4fbb('0xf')](function(){logger['info'](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3b94dc['id']));_0x5f2a54();});case _0x4fbb('0x34'):return _0x3b94dc[_0x4fbb('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x4c47ff[_0x4fbb('0x10')][_0x4fbb('0x35')]})[_0x4fbb('0xf')](function(){logger['info'](util['format'](_0x4fbb('0x1d'),_0x3b94dc['id']));_0x5f2a54();});default:logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')](_0x4fbb('0x36'),_0x3b94dc['id']));break;}}else{return BPromise[_0x4fbb('0x37')]()[_0x4fbb('0xf')](function(){if(!_0x3b94dc['tempSentiment']){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x20'));}if(!_0x2aec34['sentiment']||!_0x2aec34[_0x4fbb('0x22')]||!_0x2aec34[_0x4fbb('0x23')]||!_0x2aec34['language']||!_0x2aec34['bucket']){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x38'));}if(!_0x3b94dc[_0x4fbb('0x12')]){throw new Error(_0x4fbb('0x26'));}if(_0x2aec34[_0x4fbb('0x22')]===_0x340523['id']){return _0x340523;}else{return db[_0x4fbb('0x27')]['findOne']({'where':{'id':_settings[_0x4fbb('0x22')]}});}})[_0x4fbb('0xf')](function(_0x19ea9d){if(!_0x19ea9d){throw new db[(_0x4fbb('0x29'))][(_0x4fbb('0x1f'))](_0x4fbb('0x28'));}if(!_0x19ea9d[_0x4fbb('0xd')]||!_0x19ea9d[_0x4fbb('0x2c')]){throw new db[(_0x4fbb('0x29'))][(_0x4fbb('0x1f'))](_0x4fbb('0x2a'));}_0x486020=_0x19ea9d;logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3b94dc['id']));return sentiment(_0x486020[_0x4fbb('0xd')],_0x486020[_0x4fbb('0x2c')],_0x2aec34[_0x4fbb('0x23')],_0x3b94dc[_0x4fbb('0x12')],_0x2aec34[_0x4fbb('0x24')]);})[_0x4fbb('0xf')](function(_0x5bbd77){logger[_0x4fbb('0xa')](util[_0x4fbb('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3b94dc['id']));return _0x3b94dc[_0x4fbb('0x1c')]({'sentiment':_0x5bbd77[_0x4fbb('0x2e')],'sPositive':_0x5bbd77['SentimentScore'][_0x4fbb('0x30')],'sNegative':_0x5bbd77[_0x4fbb('0x2f')]['Negative'],'sMixed':_0x5bbd77[_0x4fbb('0x2f')][_0x4fbb('0x32')],'sNeutral':_0x5bbd77[_0x4fbb('0x2f')][_0x4fbb('0x33')],'transcribeStatus':_0x4fbb('0x13')});})[_0x4fbb('0xf')](function(){logger['info'](util['format'](_0x4fbb('0x1d'),_0x3b94dc['id']));_0x5f2a54();});}})['catch'](function(_0x574d10){if(_0x574d10){if(!_0x574d10[_0x4fbb('0x39')]||_0x574d10[_0x4fbb('0x39')]!=='SequelizeValidationError'){logger[_0x4fbb('0x3a')](util[_0x4fbb('0xb')](_0x4fbb('0x3b'),_0x3b94dc['id']),util[_0x4fbb('0x3c')](_0x574d10,{'showHidden':![],'depth':null}));}}_0x5f2a54();});});}function checkTranscribe(){var _0x38c149;var _0x143883;var _0x1b736d;return db[_0x4fbb('0x3d')]['findAll']({'where':{'transcribeStatus':_0x4fbb('0x3e')}})[_0x4fbb('0xf')](function(_0x12d624){if(!_0x12d624||!_0x12d624[_0x4fbb('0x1a')]){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x3f'));}_0x38c149=_0x12d624;return db[_0x4fbb('0x40')]['findOne']({'where':{'id':0x1}});})[_0x4fbb('0xf')](function(_0x236bea){if(!_0x236bea){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x41'));}_0x143883=_0x236bea;if(!_0x143883[_0x4fbb('0x7')]||!_0x143883[_0x4fbb('0x42')]||!_0x143883[_0x4fbb('0x43')]||!_0x143883[_0x4fbb('0x24')]||!_0x143883['bucket']){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x44'));}return db[_0x4fbb('0x27')]['findOne']({'where':{'id':_0x143883[_0x4fbb('0x42')]}});})[_0x4fbb('0xf')](function(_0x2030b5){if(!_0x2030b5){throw new db['Sequelize'][(_0x4fbb('0x1f'))](_0x4fbb('0x28'));}if(!_0x2030b5['data1']||!_0x2030b5[_0x4fbb('0x2c')]){throw new db[(_0x4fbb('0x29'))]['ValidationError'](_0x4fbb('0x2a'));}_0x1b736d=_0x2030b5;var _0x588f86=[];_0x38c149[_0x4fbb('0x45')](function(_0x12e00f){_0x588f86[_0x4fbb('0x46')](checkTranscribeJob(_0x12e00f,_0x143883,_0x1b736d));});return BPromise[_0x4fbb('0x47')](_0x588f86);})['catch'](function(_0x5a655c){if(_0x5a655c){if(!_0x5a655c['name']||_0x5a655c['name']!==_0x4fbb('0x48')){logger['error'](util['inspect'](_0x5a655c,{'showHidden':![],'depth':null}));}}});}exports[_0x4fbb('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x8b1a=['TranscriptFileUri','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','data2','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','language','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript'];(function(_0x557778,_0x3adbc5){var _0x4edd95=function(_0x1da77d){while(--_0x1da77d){_0x557778['push'](_0x557778['shift']());}};_0x4edd95(++_0x3adbc5);}(_0x8b1a,0x152));var _0xa8b1=function(_0x374d2d,_0x5df5dd){_0x374d2d=_0x374d2d-0x0;var _0x563d1f=_0x8b1a[_0x374d2d];return _0x563d1f;};var _=require(_0xa8b1('0x0'));var AWS=require(_0xa8b1('0x1'));var rp=require(_0xa8b1('0x2'));var util=require('util');var BPromise=require(_0xa8b1('0x3'));var db=require(_0xa8b1('0x4'))['db'];var logger=require(_0xa8b1('0x5'))('transcribe');function getTranscriptionJob(_0x353bea,_0x2427cc,_0x1981aa,_0xf65f47){return new Promise(function(_0x493b8e,_0x90c588){var _0x5db169=new AWS[(_0xa8b1('0x6'))]({'accessKeyId':_0x2427cc,'secretAccessKey':_0x353bea,'region':_0x1981aa});_0x5db169[_0xa8b1('0x7')]({'TranscriptionJobName':_0xf65f47},function(_0x5d958d,_0xabb2b9){if(_0x5d958d){return _0x90c588(_0x5d958d);}else{return _0x493b8e(_0xabb2b9);}});});}function sentiment(_0x27f578,_0x54e418,_0x112113,_0x2f0be9,_0x1c9b89){return new Promise(function(_0x5f19d4,_0x5da796){var _0x30f1d9=new AWS['Comprehend']({'accessKeyId':_0x54e418,'secretAccessKey':_0x27f578,'region':_0x112113});_0x30f1d9[_0xa8b1('0x8')]({'Text':_0x2f0be9,'LanguageCode':_0x1c9b89[_0xa8b1('0x9')](0x0,0x2)},function(_0xf4c687,_0x24c629){if(_0xf4c687){return _0x5da796(_0xf4c687);}else{return _0x5f19d4(_0x24c629);}});});}function checkTranscribeJob(_0x1e26c8,_0x371ffc,_0x186fd3){var _0x26bed2;return new BPromise(function(_0x487b0a,_0x3bf562){logger[_0xa8b1('0xa')](util['format'](_0xa8b1('0xb'),_0x1e26c8['id'],_0x1e26c8['transcribeName']));return getTranscriptionJob(_0x186fd3[_0xa8b1('0xc')],_0x186fd3['data2'],_0x371ffc[_0xa8b1('0xd')],_0x1e26c8[_0xa8b1('0xe')])[_0xa8b1('0xf')](function(_0x1fbc70){logger[_0xa8b1('0xa')](util[_0xa8b1('0x10')](_0xa8b1('0x11'),_0x1e26c8['id'],_0x1e26c8[_0xa8b1('0xe')],_0x1fbc70['TranscriptionJob'][_0xa8b1('0x12')]));if(!_0x1e26c8[_0xa8b1('0x13')]){switch(_0x1fbc70[_0xa8b1('0x14')]['TranscriptionJobStatus']){case'COMPLETED':var _0x4e8ff4={'transcribeStatus':_0x1fbc70['TranscriptionJob'][_0xa8b1('0x12')],'fileUri':_0x1fbc70[_0xa8b1('0x14')][_0xa8b1('0x15')]['TranscriptFileUri']};logger['info'](util[_0xa8b1('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0x1e26c8['id']));return rp({'uri':_0x1fbc70[_0xa8b1('0x14')][_0xa8b1('0x15')][_0xa8b1('0x16')],'json':!![]})[_0xa8b1('0xf')](function(_0x240dc9){logger['info'](util[_0xa8b1('0x10')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1e26c8['id']));if(_0x240dc9&&_0x240dc9['results']&&_0x240dc9[_0xa8b1('0x17')][_0xa8b1('0x18')]&&_0x240dc9[_0xa8b1('0x17')][_0xa8b1('0x18')][_0xa8b1('0x19')]){_0x4e8ff4[_0xa8b1('0x13')]='';for(var _0x137572=0x0;_0x137572<_0x240dc9[_0xa8b1('0x17')]['transcripts'][_0xa8b1('0x19')];_0x137572++){_0x4e8ff4['fileText']+=_0x240dc9[_0xa8b1('0x17')]['transcripts'][_0x137572]['transcript']+'';}}return _0x1e26c8[_0xa8b1('0x1a')](_0x4e8ff4);})[_0xa8b1('0xf')](function(){logger[_0xa8b1('0xa')](util[_0xa8b1('0x10')](_0xa8b1('0x1b'),_0x1e26c8['id']));if(!_0x1e26c8[_0xa8b1('0x1c')]){throw new db[(_0xa8b1('0x1d'))][(_0xa8b1('0x1e'))](_0xa8b1('0x1f'));}if(!_0x371ffc[_0xa8b1('0x20')]||!_0x371ffc[_0xa8b1('0x21')]||!_0x371ffc[_0xa8b1('0x22')]||!_0x371ffc['language']||!_0x371ffc[_0xa8b1('0x23')]){throw new db[(_0xa8b1('0x1d'))][(_0xa8b1('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4e8ff4[_0xa8b1('0x13')]){throw new Error(_0xa8b1('0x24'));}if(_0x371ffc[_0xa8b1('0x21')]===_0x186fd3['id']){return _0x186fd3;}else{return db[_0xa8b1('0x25')][_0xa8b1('0x26')]({'where':{'id':_settings[_0xa8b1('0x21')]}});}})['then'](function(_0x4c4c46){if(!_0x4c4c46){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x4c4c46['data1']||!_0x4c4c46['data2']){throw new db[(_0xa8b1('0x1d'))][(_0xa8b1('0x1e'))](_0xa8b1('0x27'));}_0x26bed2=_0x4c4c46;logger[_0xa8b1('0xa')](util['format'](_0xa8b1('0x28'),_0x1e26c8['id']));return sentiment(_0x26bed2[_0xa8b1('0xc')],_0x26bed2['data2'],_0x371ffc[_0xa8b1('0x22')],_0x4e8ff4[_0xa8b1('0x13')],_0x371ffc['language']);})[_0xa8b1('0xf')](function(_0x22c521){logger['info'](util[_0xa8b1('0x10')](_0xa8b1('0x29'),_0x1e26c8['id']));return _0x1e26c8[_0xa8b1('0x1a')]({'sentiment':_0x22c521[_0xa8b1('0x2a')],'sPositive':_0x22c521['SentimentScore'][_0xa8b1('0x2b')],'sNegative':_0x22c521[_0xa8b1('0x2c')][_0xa8b1('0x2d')],'sMixed':_0x22c521[_0xa8b1('0x2c')][_0xa8b1('0x2e')],'sNeutral':_0x22c521[_0xa8b1('0x2c')][_0xa8b1('0x2f')]});})['then'](function(){logger['info'](util[_0xa8b1('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e26c8['id']));_0x487b0a();});case'FAILED':return _0x1e26c8[_0xa8b1('0x1a')]({'transcribeStatus':'FAILED','failureReason':_0x1fbc70[_0xa8b1('0x14')][_0xa8b1('0x30')]})['then'](function(){logger[_0xa8b1('0xa')](util[_0xa8b1('0x10')](_0xa8b1('0x1b'),_0x1e26c8['id']));_0x487b0a();});default:logger['info'](util[_0xa8b1('0x10')](_0xa8b1('0x31'),_0x1e26c8['id']));break;}}else{return BPromise[_0xa8b1('0x32')]()[_0xa8b1('0xf')](function(){if(!_0x1e26c8[_0xa8b1('0x1c')]){throw new db['Sequelize']['ValidationError'](_0xa8b1('0x1f'));}if(!_0x371ffc['sentiment']||!_0x371ffc['sentimentAccountId']||!_0x371ffc[_0xa8b1('0x22')]||!_0x371ffc['language']||!_0x371ffc[_0xa8b1('0x23')]){throw new db[(_0xa8b1('0x1d'))][(_0xa8b1('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1e26c8[_0xa8b1('0x13')]){throw new Error(_0xa8b1('0x24'));}if(_0x371ffc['sentimentAccountId']===_0x186fd3['id']){return _0x186fd3;}else{return db['CloudProvider'][_0xa8b1('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa8b1('0xf')](function(_0x13d0c3){if(!_0x13d0c3){throw new db['Sequelize']['ValidationError'](_0xa8b1('0x33'));}if(!_0x13d0c3['data1']||!_0x13d0c3[_0xa8b1('0x34')]){throw new db[(_0xa8b1('0x1d'))][(_0xa8b1('0x1e'))](_0xa8b1('0x27'));}_0x26bed2=_0x13d0c3;logger['info'](util[_0xa8b1('0x10')](_0xa8b1('0x28'),_0x1e26c8['id']));return sentiment(_0x26bed2[_0xa8b1('0xc')],_0x26bed2['data2'],_0x371ffc['sentimentRegion'],_0x1e26c8[_0xa8b1('0x13')],_0x371ffc['language']);})[_0xa8b1('0xf')](function(_0x7f3b7b){logger[_0xa8b1('0xa')](util[_0xa8b1('0x10')](_0xa8b1('0x29'),_0x1e26c8['id']));return _0x1e26c8['update']({'sentiment':_0x7f3b7b[_0xa8b1('0x2a')],'sPositive':_0x7f3b7b[_0xa8b1('0x2c')][_0xa8b1('0x2b')],'sNegative':_0x7f3b7b[_0xa8b1('0x2c')][_0xa8b1('0x2d')],'sMixed':_0x7f3b7b[_0xa8b1('0x2c')][_0xa8b1('0x2e')],'sNeutral':_0x7f3b7b[_0xa8b1('0x2c')][_0xa8b1('0x2f')],'transcribeStatus':_0xa8b1('0x35')});})['then'](function(){logger[_0xa8b1('0xa')](util[_0xa8b1('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e26c8['id']));_0x487b0a();});}})[_0xa8b1('0x36')](function(_0x2d665d){if(_0x2d665d){if(!_0x2d665d[_0xa8b1('0x37')]||_0x2d665d[_0xa8b1('0x37')]!==_0xa8b1('0x38')){logger[_0xa8b1('0x39')](util['format'](_0xa8b1('0x3a'),_0x1e26c8['id']),util[_0xa8b1('0x3b')](_0x2d665d,{'showHidden':![],'depth':null}));}}_0x487b0a();});});}function checkTranscribe(){var _0xb5b069;var _0x3c0465;var _0xd895a2;return db[_0xa8b1('0x3c')][_0xa8b1('0x3d')]({'where':{'transcribeStatus':_0xa8b1('0x3e')}})[_0xa8b1('0xf')](function(_0x2e0f19){if(!_0x2e0f19||!_0x2e0f19['length']){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0xb5b069=_0x2e0f19;return db[_0xa8b1('0x3f')][_0xa8b1('0x26')]({'where':{'id':0x1}});})[_0xa8b1('0xf')](function(_0x2bbdbe){if(!_0x2bbdbe){throw new db[(_0xa8b1('0x1d'))]['ValidationError'](_0xa8b1('0x40'));}_0x3c0465=_0x2bbdbe;if(!_0x3c0465['transcribe']||!_0x3c0465[_0xa8b1('0x41')]||!_0x3c0465['transcribeRegion']||!_0x3c0465[_0xa8b1('0x42')]||!_0x3c0465['bucket']){throw new db['Sequelize']['ValidationError'](_0xa8b1('0x43'));}return db['CloudProvider'][_0xa8b1('0x26')]({'where':{'id':_0x3c0465['transcribeAccountId']}});})[_0xa8b1('0xf')](function(_0x2e4d06){if(!_0x2e4d06){throw new db[(_0xa8b1('0x1d'))][(_0xa8b1('0x1e'))](_0xa8b1('0x33'));}if(!_0x2e4d06['data1']||!_0x2e4d06[_0xa8b1('0x34')]){throw new db[(_0xa8b1('0x1d'))]['ValidationError'](_0xa8b1('0x27'));}_0xd895a2=_0x2e4d06;var _0x28e74a=[];_0xb5b069[_0xa8b1('0x44')](function(_0x3af322){_0x28e74a[_0xa8b1('0x45')](checkTranscribeJob(_0x3af322,_0x3c0465,_0xd895a2));});return BPromise[_0xa8b1('0x46')](_0x28e74a);})[_0xa8b1('0x36')](function(_0x2129cf){if(_0x2129cf){if(!_0x2129cf[_0xa8b1('0x37')]||_0x2129cf[_0xa8b1('0x37')]!==_0xa8b1('0x38')){logger[_0xa8b1('0x39')](util['inspect'](_0x2129cf,{'showHidden':![],'depth':null}));}}});}exports[_0xa8b1('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 77b2d8b..3261376 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32f3=['[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error'];(function(_0x3f0685,_0x4edd55){var _0x3fdfdd=function(_0x7b9bd9){while(--_0x7b9bd9){_0x3f0685['push'](_0x3f0685['shift']());}};_0x3fdfdd(++_0x4edd55);}(_0x32f3,0xd4));var _0x332f=function(_0x461bbb,_0x45dd5b){_0x461bbb=_0x461bbb-0x0;var _0x3d97b2=_0x32f3[_0x461bbb];return _0x3d97b2;};'use strict';var _=require('lodash');var moment=require(_0x332f('0x0'));var Redis=require(_0x332f('0x1'));var util=require(_0x332f('0x2'));var config=require('../../config/environment');var db=require(_0x332f('0x3'))['db'];var logger=require(_0x332f('0x4'))(_0x332f('0x5'));config['redis']=_[_0x332f('0x6')](config[_0x332f('0x7')],{'host':_0x332f('0x8'),'port':0x18eb});var io=require(_0x332f('0x9'))(new Redis(config[_0x332f('0x7')]));function closeInteractions(){var _0x2f3c2c=[];return db[_0x332f('0xa')][_0x332f('0xb')]({'raw':!![],'attributes':['id',_0x332f('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x332f('0xd')](0x18,_0x332f('0xe'))}}})['then'](function(_0x38dd4e){if(_0x38dd4e&&_0x38dd4e[_0x332f('0xf')]){_0x2f3c2c=_['map'](_0x38dd4e||[],'id');logger[_0x332f('0x10')](_0x332f('0x11'),_0x2f3c2c['join']());return db[_0x332f('0xa')][_0x332f('0x12')]({'closeReason':_0x332f('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x332f('0x14')](_0x332f('0x15'))},{'where':{'id':_0x2f3c2c}});}})[_0x332f('0x16')](function(){if(_0x2f3c2c&&_0x2f3c2c[_0x332f('0xf')]){logger[_0x332f('0x10')](_0x332f('0x17'),_0x2f3c2c['join']());for(var _0x1fd935=0x0;_0x1fd935<_0x2f3c2c[_0x332f('0xf')];_0x1fd935++){io[_0x332f('0x18')](_0x332f('0x19'),{'id':_0x2f3c2c[_0x1fd935],'closed':!![]});}}})[_0x332f('0x1a')](function(_0x4953e8){logger[_0x332f('0x1b')](_0x332f('0x1c'),_0x4953e8?util['inspect'](_0x4953e8,{'showHidden':![],'depth':null}):'');});}exports[_0x332f('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5797=['redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule'];(function(_0x53084c,_0x4a10a7){var _0x3725c5=function(_0x2d650c){while(--_0x2d650c){_0x53084c['push'](_0x53084c['shift']());}};_0x3725c5(++_0x4a10a7);}(_0x5797,0x89));var _0x7579=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x5797[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x7579('0x0'));var moment=require(_0x7579('0x1'));var Redis=require(_0x7579('0x2'));var util=require(_0x7579('0x3'));var config=require(_0x7579('0x4'));var db=require(_0x7579('0x5'))['db'];var logger=require(_0x7579('0x6'))(_0x7579('0x7'));config[_0x7579('0x8')]=_['defaults'](config[_0x7579('0x8')],{'host':_0x7579('0x9'),'port':0x18eb});var io=require(_0x7579('0xa'))(new Redis(config[_0x7579('0x8')]));function closeInteractions(){var _0x4e9093=[];return db[_0x7579('0xb')][_0x7579('0xc')]({'raw':!![],'attributes':['id',_0x7579('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7579('0xe')](0x18,_0x7579('0xf'))}}})['then'](function(_0x5673b5){if(_0x5673b5&&_0x5673b5[_0x7579('0x10')]){_0x4e9093=_[_0x7579('0x11')](_0x5673b5||[],'id');logger[_0x7579('0x12')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4e9093[_0x7579('0x13')]());return db[_0x7579('0xb')]['update']({'closeReason':'system','disposition':_0x7579('0x14'),'closed':!![],'closedAt':moment()[_0x7579('0x15')](_0x7579('0x16'))},{'where':{'id':_0x4e9093}});}})[_0x7579('0x17')](function(){if(_0x4e9093&&_0x4e9093[_0x7579('0x10')]){logger[_0x7579('0x12')](_0x7579('0x18'),_0x4e9093[_0x7579('0x13')]());for(var _0x1ec46b=0x0;_0x1ec46b<_0x4e9093[_0x7579('0x10')];_0x1ec46b++){io[_0x7579('0x19')]('whatsappInteraction:update',{'id':_0x4e9093[_0x1ec46b],'closed':!![]});}}})['catch'](function(_0x13c8de){logger[_0x7579('0x1a')](_0x7579('0x1b'),_0x13c8de?util[_0x7579('0x1c')](_0x13c8de,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index f8c6603..608591c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21d6=['innocenzo.biondo','CmContact','destroy','then','finished\x20populating','contacts1','bulkCreate','log','hopper1','contacts2','CmHopper','catch','util','push','Innocenzo','Biondo','@xcally.com','now'];(function(_0x433d9d,_0xb36042){var _0xa3ecc7=function(_0x429740){while(--_0x429740){_0x433d9d['push'](_0x433d9d['shift']());}};_0xa3ecc7(++_0xb36042);}(_0x21d6,0x8a));var _0x621d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x21d6[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x621d('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x621d('0x1')]({'id':i,'firstName':_0x621d('0x2')+i,'lastName':_0x621d('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x621d('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x621d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x621d('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x621d('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x621d('0x3')+i,'phone':0xf879fb460+i,'email':_0x621d('0x6')+i+_0x621d('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x621d('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x621d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x621d('0x5')](),'updatedAt':Date[_0x621d('0x5')]()});}db[_0x621d('0x7')][_0x621d('0x8')]({'where':{}})[_0x621d('0x9')](function(){return db[_0x621d('0x7')]['bulkCreate'](contacts);})[_0x621d('0x9')](function(){console['log'](_0x621d('0xa'),_0x621d('0xb'));return db['CmHopper']['destroy']({'where':{}});})[_0x621d('0x9')](function(){return db['CmHopper'][_0x621d('0xc')](hopper);})['then'](function(){console[_0x621d('0xd')](_0x621d('0xa'),_0x621d('0xe'));return db[_0x621d('0x7')][_0x621d('0xc')](contacts2);})[_0x621d('0x9')](function(){console[_0x621d('0xd')]('finished\x20populating',_0x621d('0xf'));return db[_0x621d('0x10')][_0x621d('0xc')](hopper2);})[_0x621d('0x9')](function(){console[_0x621d('0xd')](_0x621d('0xa'),'hopper2');})[_0x621d('0x11')](function(_0x505100){console[_0x621d('0xd')](_0x505100);}); \ No newline at end of file +var _0xe7b6=['CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','catch','util','../mysqldb','push','Biondo','@xcally.com','now'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe7b6,0x1c5));var _0x6e7b=function(_0x3d235f,_0x1e3499){_0x3d235f=_0x3d235f-0x0;var _0x2f1c41=_0xe7b6[_0x3d235f];return _0x2f1c41;};'use strict';var util=require(_0x6e7b('0x0'));var db=require(_0x6e7b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6e7b('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6e7b('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6e7b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6e7b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6e7b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6e7b('0x5')](),'updatedAt':Date[_0x6e7b('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6e7b('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6e7b('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6e7b('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6e7b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6e7b('0x5')](),'updatedAt':Date[_0x6e7b('0x5')]()});}db[_0x6e7b('0x6')][_0x6e7b('0x7')]({'where':{}})[_0x6e7b('0x8')](function(){return db[_0x6e7b('0x6')][_0x6e7b('0x9')](contacts);})[_0x6e7b('0x8')](function(){console[_0x6e7b('0xa')]('finished\x20populating',_0x6e7b('0xb'));return db[_0x6e7b('0xc')]['destroy']({'where':{}});})[_0x6e7b('0x8')](function(){return db['CmHopper'][_0x6e7b('0x9')](hopper);})[_0x6e7b('0x8')](function(){console['log'](_0x6e7b('0xd'),_0x6e7b('0xe'));return db['CmContact']['bulkCreate'](contacts2);})[_0x6e7b('0x8')](function(){console[_0x6e7b('0xa')](_0x6e7b('0xd'),_0x6e7b('0xf'));return db[_0x6e7b('0xc')][_0x6e7b('0x9')](hopper2);})[_0x6e7b('0x8')](function(){console[_0x6e7b('0xa')]('finished\x20populating','hopper2');})[_0x6e7b('0x10')](function(_0x4751ee){console[_0x6e7b('0xa')](_0x4751ee);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index ffdeffb..c64f33a 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f41=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','ulaw','yes'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7f41,0x94));var _0x17f4=function(_0x1bb306,_0x306b38){_0x1bb306=_0x1bb306-0x0;var _0x498eca=_0x7f41[_0x1bb306];return _0x498eca;};'use strict';var util=require(_0x17f4('0x0'));var db=require(_0x17f4('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x17f4('0x2')]({'name':util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),'fullname':util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),'email':util[_0x17f4('0x3')](_0x17f4('0x6'),_0x17f4('0x5'),i),'role':_0x17f4('0x5'),'password':_0x17f4('0x7'),'internal':0xfa0+i,'type':_0x17f4('0x8'),'transport':[_0x17f4('0x9'),'ws','wss'],'disallow':['all'],'allow':[_0x17f4('0xa')],'defaultuser':util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),'encryption':_0x17f4('0xb'),'avpf':'yes','force_avp':_0x17f4('0xb'),'icesupport':_0x17f4('0xb'),'dtlsenable':_0x17f4('0xb'),'dtlsverify':'no','dtlscertfile':_0x17f4('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x17f4('0xd'),'callerid':util[_0x17f4('0x3')](_0x17f4('0xe'),util[_0x17f4('0x3')](_0x17f4('0x4'),_0x17f4('0x5'),i),0xfa0+i)});}db[_0x17f4('0xf')][_0x17f4('0x10')](users)['then'](function(){console['log'](_0x17f4('0x11'));})[_0x17f4('0x12')](function(_0x58e6da){console[_0x17f4('0x13')](_0x58e6da);}); \ No newline at end of file +var _0x2aea=['util','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','bulkCreate','then','log','add\x20user'];(function(_0x36028c,_0xa84497){var _0x32766c=function(_0x2acd64){while(--_0x2acd64){_0x36028c['push'](_0x36028c['shift']());}};_0x32766c(++_0xa84497);}(_0x2aea,0x13b));var _0xa2ae=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x2aea[_0xc8a931];return _0x28bd27;};'use strict';var util=require(_0xa2ae('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xa2ae('0x1')](_0xa2ae('0x2'),_0xa2ae('0x3'),i),'fullname':util['format'](_0xa2ae('0x2'),'agent',i),'email':util['format'](_0xa2ae('0x4'),_0xa2ae('0x3'),i),'role':_0xa2ae('0x3'),'password':'password','internal':0xfa0+i,'type':_0xa2ae('0x5'),'transport':[_0xa2ae('0x6'),'ws','wss'],'disallow':[_0xa2ae('0x7')],'allow':[_0xa2ae('0x8')],'defaultuser':util[_0xa2ae('0x1')](_0xa2ae('0x2'),_0xa2ae('0x3'),i),'encryption':'yes','avpf':'yes','force_avp':_0xa2ae('0x9'),'icesupport':_0xa2ae('0x9'),'dtlsenable':_0xa2ae('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xa2ae('0xa'),'dtlssetup':'actpass','callerid':util[_0xa2ae('0x1')]('\x22%s\x22\x20<%s>',util['format'](_0xa2ae('0x2'),_0xa2ae('0x3'),i),0xfa0+i)});}db['User'][_0xa2ae('0xb')](users)[_0xa2ae('0xc')](function(){console[_0xa2ae('0xd')](_0xa2ae('0xe'));})['catch'](function(_0x565767){console['log'](_0x565767);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2254d94..c191517 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50e5=['telephone','type','findOne','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','IvrCampaigns','UserProfileResource','then','where','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','ChatQueues','ChatQueue','MailQueue','WhatsappQueues','Telephones','Trunks','getFaxQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','map','user_has_mail_interactions:remove','FaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','request','remoteAddress','remotePort','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x50e5,0xb7));var _0x550e=function(_0x330816,_0x41cff3){_0x330816=_0x330816-0x0;var _0x2068b8=_0x50e5[_0x330816];return _0x2068b8;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var BPromise=require('bluebird');var db=require(_0x550e('0x2'))['db'];var config=require(_0x550e('0x3'));var queryQueues={'attributes':['id',_0x550e('0x4')],'include':[{'as':_0x550e('0x5'),'model':db[_0x550e('0x6')],'attributes':['id',_0x550e('0x4'),_0x550e('0x7')],'raw':!![],'where':{'role':_0x550e('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x550e('0x4')],'where':{'role':_0x550e('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x550e('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x550e('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x550e('0x4'),_0x550e('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0xebedae,_0x3b7f0b,_0x1390a4){return db['UserProfileSection'][_0x550e('0xb')]({'where':{'name':_0xebedae,'userProfileId':_0x3b7f0b},'raw':!![]})['then'](function(_0x59c6c9){if(_0x59c6c9){if(_0x59c6c9[_0x550e('0xc')]){switch(_0xebedae){case _0x550e('0xd'):case'ChatQueues':case _0x550e('0xe'):case _0x550e('0xf'):case _0x550e('0x10'):case _0x550e('0x11'):case'WhatsappQueues':return db[_0x1390a4][_0x550e('0x12')](queryQueues);case'Telephones':return db[_0x1390a4][_0x550e('0x12')](queryTelephones);case'Trunks':return db[_0x1390a4][_0x550e('0x12')](queryTrunks);case _0x550e('0x13'):return db[_0x1390a4][_0x550e('0x12')](queryCampaigns);}}else{return db[_0x550e('0x14')][_0x550e('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x59c6c9['id']},'raw':!![]})[_0x550e('0x15')](function(_0x49787c){if(_0x49787c){var _0xf28ba7={'where':{'id':_['map'](_0x49787c,'resourceId')},'raw':!![]};switch(_0x1390a4){case _0x550e('0x6'):_0xf28ba7[_0x550e('0x16')]['role']='telephone';break;case'Campaign':_0xf28ba7[_0x550e('0x16')]['type']='ivr';break;}return db[_0x1390a4][_0x550e('0x12')](_0xf28ba7);}else{return[];}});}}else{return[];}})[_0x550e('0x15')](function(_0x6c7178){return _0x6c7178;});}function joinOrLeaveQueues(_0x846ad,_0x1ff0e9,_0x29f2db,_0x3b4dca){_0x846ad[_0x1ff0e9](util[_0x550e('0x17')](_0x550e('0x18'),_0x29f2db,_0x3b4dca['name']));if(_0x3b4dca[_0x550e('0x5')]){for(var _0x106c68=0x0;_0x106c68<_0x3b4dca['Agents']['length'];_0x106c68+=0x1){_0x846ad[_0x1ff0e9](util[_0x550e('0x17')](_0x550e('0x19'),_0x3b4dca['Agents'][_0x106c68][_0x550e('0x4')]));}}}function joinOrLeave(_0xcf3981,_0x1762c3,_0x317249){var _0x3aa1b8;if(_0xcf3981[_0x550e('0x1a')]['query']['id']){db[_0x550e('0x6')][_0x550e('0x1b')]({'attributes':['id',_0x550e('0x4'),_0x550e('0x7'),_0x550e('0x1c')],'where':{'id':_0xcf3981[_0x550e('0x1a')][_0x550e('0x1d')]['id']},'include':[{'model':db[_0x550e('0x1e')],'as':_0x550e('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x20')],'as':_0x550e('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x22')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x23')],'as':_0x550e('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x550e('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x550e('0x26')],'as':_0x550e('0x27'),'attributes':['id'],'raw':!![]}]})[_0x550e('0x15')](function(_0x1a4caa){if(_0x1a4caa){_0x3aa1b8=_0x1a4caa;_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x19'),_0x1a4caa[_0x550e('0x4')]));var _0x209f30=[];switch(_0x1a4caa[_0x550e('0x7')]){case _0x550e('0x28'):_0xcf3981[_0x1762c3](_0x550e('0x29'));_0xcf3981[_0x1762c3](_0x550e('0x2a'));if(queryQueues[_0x550e('0x2b')]('include')){delete queryQueues[_0x550e('0x2c')];}_0x209f30[_0x550e('0x2d')](db['VoiceQueue'][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db['ChatQueue'][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db[_0x550e('0x2e')][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db[_0x550e('0x2f')][_0x550e('0x12')](queryQueues));_0x209f30[_0x550e('0x2d')](db['MailQueue'][_0x550e('0x12')](queryQueues));_0x209f30['push'](db[_0x550e('0x30')][_0x550e('0x12')](queryQueues));_0x209f30['push'](db[_0x550e('0x31')][_0x550e('0x12')](queryQueues));_0x209f30['push'](db['User']['findAll'](queryTelephones));_0x209f30['push'](db[_0x550e('0x32')][_0x550e('0x12')](queryTrunks));_0x209f30[_0x550e('0x2d')](db['Campaign']['findAll'](queryCampaigns));_0x209f30['push'](db[_0x550e('0x6')][_0x550e('0x12')](queryAgents));break;case'user':_0xcf3981[_0x1762c3]('voice:inbound');_0xcf3981[_0x1762c3]('voice:outbound');_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0xd'),_0x1a4caa[_0x550e('0x1c')],'VoiceQueue'));_0x209f30['push'](getAssociatedResources(_0x550e('0x33'),_0x1a4caa[_0x550e('0x1c')],_0x550e('0x34')));_0x209f30[_0x550e('0x2d')](getAssociatedResources('FaxQueues',_0x1a4caa[_0x550e('0x1c')],_0x550e('0x2e')));_0x209f30['push'](getAssociatedResources('SmsQueues',_0x1a4caa[_0x550e('0x1c')],_0x550e('0x2f')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x10'),_0x1a4caa['userProfileId'],_0x550e('0x35')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x11'),_0x1a4caa[_0x550e('0x1c')],'OpenchannelQueue'));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x36'),_0x1a4caa[_0x550e('0x1c')],_0x550e('0x31')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x37'),_0x1a4caa['userProfileId'],_0x550e('0x6')));_0x209f30[_0x550e('0x2d')](getAssociatedResources(_0x550e('0x38'),_0x1a4caa[_0x550e('0x1c')],_0x550e('0x32')));_0x209f30['push'](getAssociatedResources(_0x550e('0x13'),_0x1a4caa[_0x550e('0x1c')],'Campaign'));_0x209f30[_0x550e('0x2d')](db[_0x550e('0x6')][_0x550e('0x12')](queryAgents));break;case'agent':_0xcf3981[_0x1762c3]('voice:inbound');_0xcf3981[_0x1762c3](_0x550e('0x2a'));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getVoiceQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getChatQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa[_0x550e('0x39')]({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa[_0x550e('0x3a')]({'attributes':['id','name']}));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getMailQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa['getOpenchannelQueues']({'attributes':['id',_0x550e('0x4')]}));_0x209f30[_0x550e('0x2d')](_0x1a4caa[_0x550e('0x3b')]({'attributes':['id',_0x550e('0x4')]}));break;}return BPromise[_0x550e('0x3c')](_0x209f30);}})[_0x550e('0x15')](function(_0x5e4596){if(_0x5e4596&&_0x5e4596[_0x550e('0x3d')]){for(var _0x30f708=0x0;_0x30f708<_0x5e4596[_0x550e('0x3d')];_0x30f708+=0x1){for(var _0x444c23=0x0;_0x444c23<_0x5e4596[_0x30f708][_0x550e('0x3d')];_0x444c23+=0x1){switch(_0x30f708){case 0x0:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x3e'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x1:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x3f'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x2:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x40'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x3:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x41'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x4:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x42'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x5:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x43'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x6:joinOrLeaveQueues(_0xcf3981,_0x1762c3,_0x550e('0x44'),_0x5e4596[_0x30f708][_0x444c23]);break;case 0x7:if(_0x3aa1b8[_0x550e('0x7')]!==_0x550e('0x8'))_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x45'),_0x5e4596[_0x30f708][_0x444c23][_0x550e('0x4')]));break;case 0x8:if(_0x3aa1b8[_0x550e('0x7')]!==_0x550e('0x8'))_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x46'),_0x5e4596[_0x30f708][_0x444c23][_0x550e('0x4')]));break;case 0x9:if(_0x3aa1b8['role']!==_0x550e('0x8'))_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x47'),_0x5e4596[_0x30f708][_0x444c23][_0x550e('0xa')],_0x5e4596[_0x30f708][_0x444c23][_0x550e('0x4')]));break;case 0xa:_0xcf3981[_0x1762c3](util[_0x550e('0x17')](_0x550e('0x19'),_0x5e4596[_0x30f708][_0x444c23]['name']));break;}}}}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x23486f=_['map'](_0x3aa1b8['ChatInteractions'],'id');return _0x3aa1b8['removeChatInteractions'](_0x23486f)[_0x550e('0x15')](function(){for(var _0xed33ee=0x0;_0xed33ee<_0x23486f[_0x550e('0x3d')];_0xed33ee+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x4a'),{'ChatInteractionId':Number(_0x23486f[_0xed33ee]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3==='leave'){var _0x7203cb=_[_0x550e('0x4b')](_0x3aa1b8[_0x550e('0x21')],'id');return _0x3aa1b8['removeMailInteractions'](_0x7203cb)[_0x550e('0x15')](function(){for(var _0x4ba38b=0x0;_0x4ba38b<_0x7203cb[_0x550e('0x3d')];_0x4ba38b+=0x1){_0x317249['emit'](_0x550e('0x4c'),{'MailInteractionId':Number(_0x7203cb[_0x4ba38b]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3==='leave'){var _0x3740dd=_['map'](_0x3aa1b8[_0x550e('0x4d')],'id');return _0x3aa1b8['removeFaxInteractions'](_0x3740dd)[_0x550e('0x15')](function(){for(var _0x45b188=0x0;_0x45b188<_0x3740dd['length'];_0x45b188+=0x1){_0x317249[_0x550e('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3740dd[_0x45b188]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x2c8734=_[_0x550e('0x4b')](_0x3aa1b8['SmsInteractions'],'id');return _0x3aa1b8['removeSmsInteractions'](_0x2c8734)[_0x550e('0x15')](function(){for(var _0x564b7d=0x0;_0x564b7d<_0x2c8734['length'];_0x564b7d+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x4e'),{'SmsInteractionId':Number(_0x2c8734[_0x564b7d]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x46b54e=_[_0x550e('0x4b')](_0x3aa1b8['OpenchannelInteractions'],'id');return _0x3aa1b8[_0x550e('0x4f')](_0x46b54e)[_0x550e('0x15')](function(){for(var _0x17e969=0x0;_0x17e969<_0x46b54e[_0x550e('0x3d')];_0x17e969+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x50'),{'OpenchannelInteractionId':Number(_0x46b54e[_0x17e969]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x15')](function(){if(_0x1762c3===_0x550e('0x48')){var _0x27ddf5=_['map'](_0x3aa1b8[_0x550e('0x27')],'id');return _0x3aa1b8[_0x550e('0x51')](_0x27ddf5)[_0x550e('0x15')](function(){for(var _0x1ece5e=0x0;_0x1ece5e<_0x27ddf5[_0x550e('0x3d')];_0x1ece5e+=0x1){_0x317249[_0x550e('0x49')](_0x550e('0x52'),{'WhatsappInteractionId':Number(_0x27ddf5[_0x1ece5e]),'UserId':Number(_0x3aa1b8['id'])});}});}})[_0x550e('0x53')](function(_0x14b2c0){_0xcf3981[_0x550e('0x54')](_0x14b2c0);});}}function onDisconnect(_0x5094bb,_0x3b53b2){joinOrLeave(_0x5094bb,_0x550e('0x48'),_0x3b53b2);}function onConnect(_0x189904){joinOrLeave(_0x189904,_0x550e('0x55'));}exports[_0x550e('0x56')]=function(_0x2d5de5){_0x2d5de5['on'](_0x550e('0x57'),function(_0x4b710e){_0x4b710e['setMaxListeners'](0x0);_0x4b710e['address']=_0x4b710e[_0x550e('0x58')][_0x550e('0x57')][_0x550e('0x59')]+':'+_0x4b710e[_0x550e('0x58')][_0x550e('0x57')][_0x550e('0x5a')];_0x4b710e['connectedAt']=new Date();_0x4b710e[_0x550e('0x54')]=function(_0x3a0051){console['log']('SocketIO\x20'+_0x4b710e[_0x550e('0x5b')][_0x550e('0x4')]+'['+_0x4b710e[_0x550e('0x5c')]+']',_0x3a0051);};_0x4b710e['on'](_0x550e('0x5d'),function(){onDisconnect(_0x4b710e,_0x2d5de5);_0x4b710e[_0x550e('0x54')](_0x550e('0x5e'));});onConnect(_0x4b710e);_0x4b710e[_0x550e('0x54')](_0x550e('0x5f'));});}; \ No newline at end of file +var _0x27de=['ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','ChatQueue','FaxQueues','FaxQueue','WhatsappQueue','voice:inbound','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','map','removeChatInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','UserProfileSection','findOne','then','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','role','Campaign','format','%s:queue:%s','length','handshake','query','find','userProfileId','ChatInteraction'];(function(_0x1307f9,_0x43802d){var _0x115fa1=function(_0x6c0ef3){while(--_0x6c0ef3){_0x1307f9['push'](_0x1307f9['shift']());}};_0x115fa1(++_0x43802d);}(_0x27de,0x111));var _0xe27d=function(_0x19df30,_0x59a15e){_0x19df30=_0x19df30-0x0;var _0x5ae3ca=_0x27de[_0x19df30];return _0x5ae3ca;};'use strict';var _=require(_0xe27d('0x0'));var util=require(_0xe27d('0x1'));var BPromise=require(_0xe27d('0x2'));var db=require(_0xe27d('0x3'))['db'];var config=require(_0xe27d('0x4'));var queryQueues={'attributes':['id',_0xe27d('0x5')],'include':[{'as':_0xe27d('0x6'),'model':db[_0xe27d('0x7')],'attributes':['id',_0xe27d('0x5'),'role'],'raw':!![],'where':{'role':_0xe27d('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xe27d('0x5')],'where':{'role':_0xe27d('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xe27d('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xe27d('0x5')],'where':{'role':_0xe27d('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe27d('0x5'),_0xe27d('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x24c74f,_0x222d36,_0x3b6591){return db[_0xe27d('0xb')][_0xe27d('0xc')]({'where':{'name':_0x24c74f,'userProfileId':_0x222d36},'raw':!![]})[_0xe27d('0xd')](function(_0x3f4ca9){if(_0x3f4ca9){if(_0x3f4ca9['autoAssociation']){switch(_0x24c74f){case _0xe27d('0xe'):case'ChatQueues':case'FaxQueues':case _0xe27d('0xf'):case _0xe27d('0x10'):case _0xe27d('0x11'):case _0xe27d('0x12'):return db[_0x3b6591][_0xe27d('0x13')](queryQueues);case _0xe27d('0x14'):return db[_0x3b6591][_0xe27d('0x13')](queryTelephones);case _0xe27d('0x15'):return db[_0x3b6591][_0xe27d('0x13')](queryTrunks);case _0xe27d('0x16'):return db[_0x3b6591][_0xe27d('0x13')](queryCampaigns);}}else{return db[_0xe27d('0x17')][_0xe27d('0x13')]({'attributes':[_0xe27d('0x18')],'where':{'sectionId':_0x3f4ca9['id']},'raw':!![]})[_0xe27d('0xd')](function(_0x2fa917){if(_0x2fa917){var _0x4e6b34={'where':{'id':_['map'](_0x2fa917,_0xe27d('0x18'))},'raw':!![]};switch(_0x3b6591){case _0xe27d('0x7'):_0x4e6b34[_0xe27d('0x19')][_0xe27d('0x1a')]=_0xe27d('0x9');break;case _0xe27d('0x1b'):_0x4e6b34['where'][_0xe27d('0xa')]='ivr';break;}return db[_0x3b6591][_0xe27d('0x13')](_0x4e6b34);}else{return[];}});}}else{return[];}})['then'](function(_0x3bb252){return _0x3bb252;});}function joinOrLeaveQueues(_0x52a372,_0x1806ce,_0x4b97c2,_0xa97dbd){_0x52a372[_0x1806ce](util[_0xe27d('0x1c')](_0xe27d('0x1d'),_0x4b97c2,_0xa97dbd[_0xe27d('0x5')]));if(_0xa97dbd['Agents']){for(var _0x3ac758=0x0;_0x3ac758<_0xa97dbd[_0xe27d('0x6')][_0xe27d('0x1e')];_0x3ac758+=0x1){_0x52a372[_0x1806ce](util[_0xe27d('0x1c')]('user:%s',_0xa97dbd[_0xe27d('0x6')][_0x3ac758]['name']));}}}function joinOrLeave(_0x560582,_0x2cc0d3,_0x5cd059){var _0x1a10cc;if(_0x560582[_0xe27d('0x1f')][_0xe27d('0x20')]['id']){db[_0xe27d('0x7')][_0xe27d('0x21')]({'attributes':['id',_0xe27d('0x5'),_0xe27d('0x1a'),_0xe27d('0x22')],'where':{'id':_0x560582[_0xe27d('0x1f')][_0xe27d('0x20')]['id']},'include':[{'model':db[_0xe27d('0x23')],'as':_0xe27d('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xe27d('0x25')],'as':_0xe27d('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xe27d('0x27')],'as':_0xe27d('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xe27d('0x29')],'as':_0xe27d('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xe27d('0x2b')],'as':_0xe27d('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xe27d('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xe27d('0xd')](function(_0x1b36ba){if(_0x1b36ba){_0x1a10cc=_0x1b36ba;_0x560582[_0x2cc0d3](util[_0xe27d('0x1c')](_0xe27d('0x2e'),_0x1b36ba['name']));var _0x3986a7=[];switch(_0x1b36ba[_0xe27d('0x1a')]){case _0xe27d('0x2f'):_0x560582[_0x2cc0d3]('voice:inbound');_0x560582[_0x2cc0d3](_0xe27d('0x30'));if(queryQueues[_0xe27d('0x31')](_0xe27d('0x32'))){delete queryQueues[_0xe27d('0x32')];}_0x3986a7[_0xe27d('0x33')](db[_0xe27d('0x34')][_0xe27d('0x13')](queryQueues));_0x3986a7['push'](db['ChatQueue']['findAll'](queryQueues));_0x3986a7[_0xe27d('0x33')](db['FaxQueue'][_0xe27d('0x13')](queryQueues));_0x3986a7[_0xe27d('0x33')](db[_0xe27d('0x35')][_0xe27d('0x13')](queryQueues));_0x3986a7['push'](db[_0xe27d('0x36')][_0xe27d('0x13')](queryQueues));_0x3986a7[_0xe27d('0x33')](db[_0xe27d('0x37')][_0xe27d('0x13')](queryQueues));_0x3986a7[_0xe27d('0x33')](db['WhatsappQueue'][_0xe27d('0x13')](queryQueues));_0x3986a7[_0xe27d('0x33')](db['User'][_0xe27d('0x13')](queryTelephones));_0x3986a7[_0xe27d('0x33')](db[_0xe27d('0x38')][_0xe27d('0x13')](queryTrunks));_0x3986a7['push'](db[_0xe27d('0x1b')][_0xe27d('0x13')](queryCampaigns));_0x3986a7[_0xe27d('0x33')](db[_0xe27d('0x7')][_0xe27d('0x13')](queryAgents));break;case _0xe27d('0x39'):_0x560582[_0x2cc0d3]('voice:inbound');_0x560582[_0x2cc0d3](_0xe27d('0x30'));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0xe'),_0x1b36ba[_0xe27d('0x22')],_0xe27d('0x34')));_0x3986a7[_0xe27d('0x33')](getAssociatedResources('ChatQueues',_0x1b36ba['userProfileId'],_0xe27d('0x3a')));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0x3b'),_0x1b36ba[_0xe27d('0x22')],_0xe27d('0x3c')));_0x3986a7['push'](getAssociatedResources(_0xe27d('0xf'),_0x1b36ba[_0xe27d('0x22')],'SmsQueue'));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0x10'),_0x1b36ba[_0xe27d('0x22')],_0xe27d('0x36')));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0x11'),_0x1b36ba[_0xe27d('0x22')],_0xe27d('0x37')));_0x3986a7[_0xe27d('0x33')](getAssociatedResources('WhatsappQueues',_0x1b36ba[_0xe27d('0x22')],_0xe27d('0x3d')));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0x14'),_0x1b36ba['userProfileId'],_0xe27d('0x7')));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0x15'),_0x1b36ba[_0xe27d('0x22')],'Trunk'));_0x3986a7[_0xe27d('0x33')](getAssociatedResources(_0xe27d('0x16'),_0x1b36ba[_0xe27d('0x22')],_0xe27d('0x1b')));_0x3986a7[_0xe27d('0x33')](db[_0xe27d('0x7')][_0xe27d('0x13')](queryAgents));break;case'agent':_0x560582[_0x2cc0d3](_0xe27d('0x3e'));_0x560582[_0x2cc0d3](_0xe27d('0x30'));_0x3986a7[_0xe27d('0x33')](_0x1b36ba[_0xe27d('0x3f')]({'attributes':['id',_0xe27d('0x5')]}));_0x3986a7[_0xe27d('0x33')](_0x1b36ba[_0xe27d('0x40')]({'attributes':['id',_0xe27d('0x5')]}));_0x3986a7['push'](_0x1b36ba['getFaxQueues']({'attributes':['id',_0xe27d('0x5')]}));_0x3986a7[_0xe27d('0x33')](_0x1b36ba[_0xe27d('0x41')]({'attributes':['id',_0xe27d('0x5')]}));_0x3986a7['push'](_0x1b36ba[_0xe27d('0x42')]({'attributes':['id',_0xe27d('0x5')]}));_0x3986a7[_0xe27d('0x33')](_0x1b36ba['getOpenchannelQueues']({'attributes':['id',_0xe27d('0x5')]}));_0x3986a7[_0xe27d('0x33')](_0x1b36ba[_0xe27d('0x43')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x3986a7);}})[_0xe27d('0xd')](function(_0x450250){if(_0x450250&&_0x450250[_0xe27d('0x1e')]){for(var _0xd89dd9=0x0;_0xd89dd9<_0x450250[_0xe27d('0x1e')];_0xd89dd9+=0x1){for(var _0x289cf9=0x0;_0x289cf9<_0x450250[_0xd89dd9][_0xe27d('0x1e')];_0x289cf9+=0x1){switch(_0xd89dd9){case 0x0:joinOrLeaveQueues(_0x560582,_0x2cc0d3,'voice',_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x1:joinOrLeaveQueues(_0x560582,_0x2cc0d3,_0xe27d('0x44'),_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x2:joinOrLeaveQueues(_0x560582,_0x2cc0d3,_0xe27d('0x45'),_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x3:joinOrLeaveQueues(_0x560582,_0x2cc0d3,_0xe27d('0x46'),_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x4:joinOrLeaveQueues(_0x560582,_0x2cc0d3,_0xe27d('0x47'),_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x5:joinOrLeaveQueues(_0x560582,_0x2cc0d3,_0xe27d('0x48'),_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x6:joinOrLeaveQueues(_0x560582,_0x2cc0d3,_0xe27d('0x49'),_0x450250[_0xd89dd9][_0x289cf9]);break;case 0x7:if(_0x1a10cc['role']!==_0xe27d('0x8'))_0x560582[_0x2cc0d3](util[_0xe27d('0x1c')](_0xe27d('0x4a'),_0x450250[_0xd89dd9][_0x289cf9][_0xe27d('0x5')]));break;case 0x8:if(_0x1a10cc['role']!==_0xe27d('0x8'))_0x560582[_0x2cc0d3](util[_0xe27d('0x1c')](_0xe27d('0x4b'),_0x450250[_0xd89dd9][_0x289cf9]['name']));break;case 0x9:if(_0x1a10cc[_0xe27d('0x1a')]!==_0xe27d('0x8'))_0x560582[_0x2cc0d3](util['format']('campaign:%s:%s',_0x450250[_0xd89dd9][_0x289cf9][_0xe27d('0xa')],_0x450250[_0xd89dd9][_0x289cf9][_0xe27d('0x5')]));break;case 0xa:_0x560582[_0x2cc0d3](util[_0xe27d('0x1c')](_0xe27d('0x2e'),_0x450250[_0xd89dd9][_0x289cf9][_0xe27d('0x5')]));break;}}}}})[_0xe27d('0xd')](function(){if(_0x2cc0d3===_0xe27d('0x4c')){var _0x233912=_[_0xe27d('0x4d')](_0x1a10cc['ChatInteractions'],'id');return _0x1a10cc[_0xe27d('0x4e')](_0x233912)[_0xe27d('0xd')](function(){for(var _0x3f536b=0x0;_0x3f536b<_0x233912[_0xe27d('0x1e')];_0x3f536b+=0x1){_0x5cd059[_0xe27d('0x4f')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x233912[_0x3f536b]),'UserId':Number(_0x1a10cc['id'])});}});}})[_0xe27d('0xd')](function(){if(_0x2cc0d3===_0xe27d('0x4c')){var _0x1797ae=_[_0xe27d('0x4d')](_0x1a10cc[_0xe27d('0x26')],'id');return _0x1a10cc['removeMailInteractions'](_0x1797ae)[_0xe27d('0xd')](function(){for(var _0x5edbac=0x0;_0x5edbac<_0x1797ae[_0xe27d('0x1e')];_0x5edbac+=0x1){_0x5cd059[_0xe27d('0x4f')](_0xe27d('0x50'),{'MailInteractionId':Number(_0x1797ae[_0x5edbac]),'UserId':Number(_0x1a10cc['id'])});}});}})['then'](function(){if(_0x2cc0d3==='leave'){var _0x4df7c5=_['map'](_0x1a10cc[_0xe27d('0x28')],'id');return _0x1a10cc[_0xe27d('0x51')](_0x4df7c5)['then'](function(){for(var _0xaefb16=0x0;_0xaefb16<_0x4df7c5[_0xe27d('0x1e')];_0xaefb16+=0x1){_0x5cd059[_0xe27d('0x4f')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4df7c5[_0xaefb16]),'UserId':Number(_0x1a10cc['id'])});}});}})[_0xe27d('0xd')](function(){if(_0x2cc0d3===_0xe27d('0x4c')){var _0xf1bfed=_[_0xe27d('0x4d')](_0x1a10cc[_0xe27d('0x2a')],'id');return _0x1a10cc[_0xe27d('0x52')](_0xf1bfed)[_0xe27d('0xd')](function(){for(var _0x2f7dfa=0x0;_0x2f7dfa<_0xf1bfed['length'];_0x2f7dfa+=0x1){_0x5cd059[_0xe27d('0x4f')](_0xe27d('0x53'),{'SmsInteractionId':Number(_0xf1bfed[_0x2f7dfa]),'UserId':Number(_0x1a10cc['id'])});}});}})[_0xe27d('0xd')](function(){if(_0x2cc0d3===_0xe27d('0x4c')){var _0x40ab8a=_['map'](_0x1a10cc['OpenchannelInteractions'],'id');return _0x1a10cc[_0xe27d('0x54')](_0x40ab8a)[_0xe27d('0xd')](function(){for(var _0x14aea4=0x0;_0x14aea4<_0x40ab8a[_0xe27d('0x1e')];_0x14aea4+=0x1){_0x5cd059[_0xe27d('0x4f')](_0xe27d('0x55'),{'OpenchannelInteractionId':Number(_0x40ab8a[_0x14aea4]),'UserId':Number(_0x1a10cc['id'])});}});}})['then'](function(){if(_0x2cc0d3===_0xe27d('0x4c')){var _0x581f9b=_[_0xe27d('0x4d')](_0x1a10cc[_0xe27d('0x2d')],'id');return _0x1a10cc[_0xe27d('0x56')](_0x581f9b)[_0xe27d('0xd')](function(){for(var _0x1cacf7=0x0;_0x1cacf7<_0x581f9b[_0xe27d('0x1e')];_0x1cacf7+=0x1){_0x5cd059[_0xe27d('0x4f')](_0xe27d('0x57'),{'WhatsappInteractionId':Number(_0x581f9b[_0x1cacf7]),'UserId':Number(_0x1a10cc['id'])});}});}})[_0xe27d('0x58')](function(_0x11858b){_0x560582['log'](_0x11858b);});}}function onDisconnect(_0x31a75b,_0x427c5c){joinOrLeave(_0x31a75b,_0xe27d('0x4c'),_0x427c5c);}function onConnect(_0x5f54be){joinOrLeave(_0x5f54be,_0xe27d('0x59'));}exports[_0xe27d('0x5a')]=function(_0x4ec94d){_0x4ec94d['on'](_0xe27d('0x5b'),function(_0x15d600){_0x15d600[_0xe27d('0x5c')](0x0);_0x15d600[_0xe27d('0x5d')]=_0x15d600[_0xe27d('0x5e')][_0xe27d('0x5b')][_0xe27d('0x5f')]+':'+_0x15d600[_0xe27d('0x5e')][_0xe27d('0x5b')]['remotePort'];_0x15d600[_0xe27d('0x60')]=new Date();_0x15d600[_0xe27d('0x61')]=function(_0xfa7f96){console[_0xe27d('0x61')](_0xe27d('0x62')+_0x15d600[_0xe27d('0x63')][_0xe27d('0x5')]+'['+_0x15d600[_0xe27d('0x5d')]+']',_0xfa7f96);};_0x15d600['on'](_0xe27d('0x64'),function(){onDisconnect(_0x15d600,_0x4ec94d);_0x15d600['log'](_0xe27d('0x65'));});onConnect(_0x15d600);_0x15d600[_0xe27d('0x61')](_0xe27d('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index aa2f697..b0657d6 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 _0x0bcd=['Trigger,\x20%s','code','error','catch','channel','motionChannel','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','incomingmessage','outgoingmessage','AfterCreateMessage','event','offlineMessage','get','opened','sequelize','AfterCreate','changed','closed','substatus','agent','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','ChatInteraction','afterCreate','Chat','afterUpdate','closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then'];(function(_0x466258,_0x79be17){var _0x2d5007=function(_0x5894b9){while(--_0x5894b9){_0x466258['push'](_0x466258['shift']());}};_0x2d5007(++_0x79be17);}(_0x0bcd,0x159));var _0xd0bc=function(_0x521010,_0x2b9c5a){_0x521010=_0x521010-0x0;var _0x2f5e4f=_0x0bcd[_0x521010];return _0x2f5e4f;};'use strict';var util=require(_0xd0bc('0x0'));var db=require(_0xd0bc('0x1'))['db'];var jayson=require(_0xd0bc('0x2'));var logger=require(_0xd0bc('0x3'))(_0xd0bc('0x4'));var client=jayson[_0xd0bc('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd0bc('0x6'),'event':_0xd0bc('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd0bc('0x8'),'model':_0xd0bc('0x6'),'event':_0xd0bc('0x9'),'condition':_0xd0bc('0xa'),'callback':afterUpdate},{'channel':_0xd0bc('0x8'),'model':'ChatMessage','event':_0xd0bc('0x7'),'condition':_0xd0bc('0xb'),'callback':afterCreateMessage},{'channel':_0xd0bc('0x8'),'model':_0xd0bc('0xc'),'event':_0xd0bc('0x7'),'condition':_0xd0bc('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xd0bc('0xd'),'model':_0xd0bc('0xe'),'event':'afterCreate','condition':_0xd0bc('0xf'),'callback':afterCreate},{'channel':_0xd0bc('0xd'),'model':_0xd0bc('0xe'),'event':_0xd0bc('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd0bc('0xd'),'model':_0xd0bc('0x10'),'event':_0xd0bc('0x7'),'condition':_0xd0bc('0xb'),'callback':afterCreateMessage},{'channel':_0xd0bc('0x11'),'model':_0xd0bc('0x12'),'event':_0xd0bc('0x7'),'condition':_0xd0bc('0xf'),'callback':afterCreate},{'channel':_0xd0bc('0x11'),'model':_0xd0bc('0x12'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0xd0bc('0x13'),'event':'afterCreate','condition':_0xd0bc('0xb'),'callback':afterCreateMessage},{'channel':_0xd0bc('0x14'),'model':_0xd0bc('0x15'),'event':'afterCreate','condition':_0xd0bc('0xf'),'callback':afterCreate},{'channel':_0xd0bc('0x14'),'model':_0xd0bc('0x15'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd0bc('0x14'),'model':'FaxMessage','event':_0xd0bc('0x7'),'condition':_0xd0bc('0xb'),'callback':afterCreateMessage},{'channel':_0xd0bc('0x16'),'model':_0xd0bc('0x17'),'event':'afterCreate','condition':_0xd0bc('0xf'),'callback':afterCreate},{'channel':_0xd0bc('0x16'),'model':'MailInteraction','event':_0xd0bc('0x9'),'condition':_0xd0bc('0xa'),'callback':afterUpdate},{'channel':_0xd0bc('0x16'),'model':'MailMessage','event':_0xd0bc('0x7'),'condition':_0xd0bc('0xb'),'callback':afterCreateMessage},{'channel':_0xd0bc('0x18'),'model':_0xd0bc('0x19'),'event':_0xd0bc('0x7'),'condition':_0xd0bc('0xf'),'callback':afterCreate},{'channel':_0xd0bc('0x18'),'model':_0xd0bc('0x19'),'event':_0xd0bc('0x9'),'condition':_0xd0bc('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xd0bc('0x1a'),'event':_0xd0bc('0x7'),'condition':_0xd0bc('0xb'),'callback':afterCreateMessage}];function request(_0x20b762){return client[_0xd0bc('0x1b')](_0xd0bc('0x1c'),_0x20b762)[_0xd0bc('0x1d')](function(_0x55c01c){logger['info'](_0xd0bc('0x1e'),_0xd0bc('0x1c'),_0x55c01c);if(_0x55c01c['error']){if(_0x55c01c['error'][_0xd0bc('0x1f')]===0x1f4){logger[_0xd0bc('0x20')]('Trigger,\x20%s','EventManager',_0x55c01c['error']);}}})[_0xd0bc('0x21')](function(_0x29c84c){logger[_0xd0bc('0x20')](_0xd0bc('0x1e'),_0xd0bc('0x1c'),_0x29c84c);});}function afterCreateMessage(_0x31ec97){return function(_0x30ab0e){_0x30ab0e=_0x30ab0e['get']({'plain':!![]});_0x30ab0e[_0xd0bc('0x22')]=_0x31ec97;_0x30ab0e[_0xd0bc('0x23')]=_0x31ec97;_0x30ab0e['event']=_0x30ab0e[_0xd0bc('0x24')];Promise[_0xd0bc('0x25')]()[_0xd0bc('0x1d')](function(){if(typeof _0x30ab0e[_0xd0bc('0x26')]===_0xd0bc('0x27'))return null;var _0x6c7cbc=_0xd0bc('0x28')+_0x30ab0e[_0xd0bc('0x26')];return db['sequelize'][_0xd0bc('0x29')](_0x6c7cbc,{'type':db[_0xd0bc('0x2a')][_0xd0bc('0x2b')][_0xd0bc('0x2c')],'raw':!![]});})[_0xd0bc('0x1d')](function(_0x435593){if(_0x435593){_0x30ab0e[_0xd0bc('0x2d')]=_0x435593[0x0];}if(typeof _0x30ab0e[_0xd0bc('0x2e')]===_0xd0bc('0x27'))return;return getAgent(_0x30ab0e[_0xd0bc('0x2e')]);})[_0xd0bc('0x1d')](function(_0xcb8734){if(_0xcb8734){_0x30ab0e[_0xd0bc('0x2f')]=util[_0xd0bc('0x30')](_0xd0bc('0x31'),_0xcb8734[_0xd0bc('0x32')]);_0x30ab0e['agent']=_0xcb8734;_0x30ab0e[_0xd0bc('0x22')]=_0x31ec97;return request({'event':_0xd0bc('0x33'),'message':_0x30ab0e});}else{return request({'event':_0xd0bc('0x34'),'message':_0x30ab0e});}})['catch'](function(_0x30ef0b){logger[_0xd0bc('0x20')](_0xd0bc('0x1e'),_0xd0bc('0x35'),_0x30ef0b);});};}function afterCreateOfflineMessage(_0x1ccc99){return function(_0x42d86c){_0x42d86c=_0x42d86c['get']({'plain':!![]});_0x42d86c[_0xd0bc('0x22')]=_0x1ccc99;_0x42d86c['motionChannel']=_0x1ccc99;_0x42d86c[_0xd0bc('0x36')]=_0xd0bc('0x37');return request({'event':_0x42d86c[_0xd0bc('0x36')],'message':_0x42d86c});};}function afterCreate(_0x3ffb93,_0x568307){return function(_0x5744a5){_0x5744a5=_0x5744a5[_0xd0bc('0x38')]({'plain':!![]});_0x5744a5[_0xd0bc('0x22')]=_0x3ffb93;_0x5744a5[_0xd0bc('0x23')]=_0x3ffb93;_0x5744a5[_0xd0bc('0x36')]=_0xd0bc('0x39');Promise['resolve']()['then'](function(){var _0x5cdd9b=_0xd0bc('0x28')+_0x5744a5['ContactId'];return db[_0xd0bc('0x3a')][_0xd0bc('0x29')](_0x5cdd9b,{'type':db[_0xd0bc('0x2a')][_0xd0bc('0x2b')]['SELECT'],'raw':!![]});})[_0xd0bc('0x1d')](function(_0x35b66e){if(_0x35b66e){_0x5744a5['contact']=_0x35b66e[0x0];}if(typeof _0x5744a5[_0xd0bc('0x2e')]===_0xd0bc('0x27'))return;return getAgent(_0x5744a5[_0xd0bc('0x2e')]);})[_0xd0bc('0x1d')](function(_0x5487b4){if(_0x5487b4){_0x5744a5[_0xd0bc('0x2f')]=util[_0xd0bc('0x30')](_0xd0bc('0x31'),_0x5487b4[_0xd0bc('0x32')]);_0x5744a5['agent']=_0x5487b4;}return request({'event':_0x568307,'message':_0x5744a5});})['catch'](function(_0x8c9391){logger['error'](_0xd0bc('0x1e'),_0xd0bc('0x3b'),_0x8c9391);});};}function afterUpdate(_0x3830fe){return function(_0x1adf0f){var _0x3a025d=_0x1adf0f[_0xd0bc('0x3c')]('closed')&&_0x1adf0f[_0xd0bc('0x3d')];var _0x2cd37a=_0x1adf0f['changed'](_0xd0bc('0x3e'));if(_0x3a025d||_0x2cd37a){var _0x481447=_0x3a025d?_0xd0bc('0xa'):_0xd0bc('0x3e');var _0x502a4c=_0x1adf0f['get']({'plain':!![]});_0x502a4c[_0xd0bc('0x22')]=_0x3830fe;_0x502a4c[_0xd0bc('0x23')]=_0x3830fe;_0x502a4c[_0xd0bc('0x36')]=_0x3a025d?'closed':_0xd0bc('0x3e');var _0x2b0fe5=_0xd0bc('0x28')+_0x502a4c[_0xd0bc('0x26')];return db['sequelize']['query'](_0x2b0fe5,{'type':db[_0xd0bc('0x2a')][_0xd0bc('0x2b')][_0xd0bc('0x2c')],'raw':!![]})[_0xd0bc('0x1d')](function(_0x3f77b9){if(_0x3f77b9){_0x502a4c[_0xd0bc('0x2d')]=_0x3f77b9[0x0];}if(typeof _0x502a4c['UserId']===_0xd0bc('0x27'))return;return getAgent(_0x502a4c[_0xd0bc('0x2e')]);})[_0xd0bc('0x1d')](function(_0x1c08bf){if(_0x1c08bf){_0x502a4c[_0xd0bc('0x2f')]=util['format'](_0xd0bc('0x31'),_0x1c08bf[_0xd0bc('0x32')]);_0x502a4c[_0xd0bc('0x3f')]=_0x1c08bf;}return request({'event':_0x481447,'message':_0x502a4c});})[_0xd0bc('0x21')](function(_0xe106d8){logger[_0xd0bc('0x20')](_0xd0bc('0x1e'),'AfterUpdate',_0xe106d8);});}};}function getAgent(_0x599199){return db['User'][_0xd0bc('0x40')]({'where':{'id':_0x599199},'attributes':['id',_0xd0bc('0x32'),_0xd0bc('0x41'),_0xd0bc('0x42'),_0xd0bc('0x43')],'raw':!![]})[_0xd0bc('0x1d')](function(_0x49efd4){return _0x49efd4;});}exports[_0xd0bc('0x44')]=function(){for(var _0x523ffb=0x0;_0x523ffb=_0x3c9e8e['agents']){throw Error(_0x5b1f('0x10'));}_0x4a624e(_0x576da8);})[_0x5b1f('0x11')](function(_0x55487b){_0x20bcad(_0x55487b);});});}; \ No newline at end of file +var _0x4503=['catch','bluebird','./license/util','voice','mail','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','updateAttributes','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x51b1de,_0x29b6e5){var _0x3c2c9e=function(_0x222e6c){while(--_0x222e6c){_0x51b1de['push'](_0x51b1de['shift']());}};_0x3c2c9e(++_0x29b6e5);}(_0x4503,0x6f));var _0x3450=function(_0x561596,_0x3905a5){_0x561596=_0x561596-0x0;var _0x1e8590=_0x4503[_0x561596];return _0x1e8590;};'use strict';var _=require('lodash');var BPromise=require(_0x3450('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x3450('0x1'));var channels=[_0x3450('0x2'),_0x3450('0x3'),'chat',_0x3450('0x4'),_0x3450('0x5'),_0x3450('0x6'),_0x3450('0x7')];exports['getChannels']=function(){return channels;};exports[_0x3450('0x8')]=function(_0x42c262){_0x42c262=_0x42c262[_0x3450('0x9')]();return _[_0x3450('0xa')](channels,_0x42c262);};exports[_0x3450('0xb')]=function(_0x144adf,_0xcb170,_0x1ff272,_0x1a9724){var _0x4e0a54={'loginAttempts':_0xcb170,'blocked':_0x1ff272};if(!_['isUndefined'](_0x1a9724)){_0x4e0a54['blockedAt']=_0x1a9724;}return _0x144adf[_0x3450('0xc')](_0x4e0a54);};exports['getLicense']=function(_0x43120e){return new BPromise(function(_0x16bda0,_0x3ed011){var _0x488ece=0x0;if(_0x43120e[_0x3450('0xd')]!==_0x3450('0xe')){_0x16bda0(_0x43120e);}db[_0x3450('0xf')][_0x3450('0x10')]({'where':{'role':_0x3450('0xe'),'online':!![],'id':{'$ne':_0x43120e['id']}}})[_0x3450('0x11')](function(_0x1aba70){_0x488ece=_0x1aba70;return util[_0x3450('0x12')]();})[_0x3450('0x11')](function(_0x5a719a){if(_0x5a719a&&_0x5a719a[_0x3450('0x13')]&&_0x488ece>=_0x5a719a[_0x3450('0x13')]){throw Error(_0x3450('0x14'));}_0x16bda0(_0x43120e);})[_0x3450('0x15')](function(_0x3c3eb2){_0x3ed011(_0x3c3eb2);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 68812f8..8a6f3aa 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['name','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','inherits','Bad\x20Request'];(function(_0x485d2a,_0x1fd61e){var _0x59ff37=function(_0x56ba99){while(--_0x56ba99){_0x485d2a['push'](_0x485d2a['shift']());}};_0x59ff37(++_0x1fd61e);}(_0xa571,0x107));var _0x1a57=function(_0x57b2b2,_0x31bf5f){_0x57b2b2=_0x57b2b2-0x0;var _0x88ccc7=_0xa571[_0x57b2b2];return _0x88ccc7;};'use strict';var util=require(_0x1a57('0x0'));var logger=require(_0x1a57('0x1'))(_0x1a57('0x2'));var APIError=function(_0x1067d9,_0x48485e){this[_0x1a57('0x3')]=_0x1067d9||_0x1a57('0x4');this['name']=_0x48485e||'Error';util[_0x1a57('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5067fa){this[_0x1a57('0x3')]=_0x5067fa||_0x1a57('0x6');this[_0x1a57('0x7')]=_0x1a57('0x6');util[_0x1a57('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x924873){this['message']=_0x924873||_0x1a57('0x8');this[_0x1a57('0x7')]=_0x1a57('0x9');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x3c8182){switch(_0x3c8182){case _0x1a57('0x6'):return 0x190;case _0x1a57('0xa'),_0x1a57('0xb'):return 0x193;case _0x1a57('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x2980b2){return function(_0x62cc63){logger[_0x1a57('0xc')](_0x62cc63['stack']);var _0x562fa4=getStatusCode(_0x62cc63[_0x1a57('0x7')]);if(_0x62cc63[_0x1a57('0x7')])delete _0x62cc63[_0x1a57('0x7')];return _0x2980b2['status'](_0x562fa4)[_0x1a57('0xd')](_0x62cc63);};}module[_0x1a57('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xaa88=['Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits','Entity\x20not\x20found'];(function(_0x13dd65,_0x1117a5){var _0x365058=function(_0x2c62f8){while(--_0x2c62f8){_0x13dd65['push'](_0x13dd65['shift']());}};_0x365058(++_0x1117a5);}(_0xaa88,0x137));var _0x8aa8=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0xaa88[_0x53afe9];return _0x396396;};'use strict';var util=require(_0x8aa8('0x0'));var logger=require(_0x8aa8('0x1'))(_0x8aa8('0x2'));var APIError=function(_0x51c79b,_0x4aee38){this[_0x8aa8('0x3')]=_0x51c79b||_0x8aa8('0x4');this[_0x8aa8('0x5')]=_0x4aee38||_0x8aa8('0x6');util[_0x8aa8('0x7')](APIError,Error);};var APIBadRequestError=function(_0x350e8b){this['message']=_0x350e8b||'Bad\x20Request';this[_0x8aa8('0x5')]='Bad\x20Request';util[_0x8aa8('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1ed84d){this[_0x8aa8('0x3')]=_0x1ed84d||_0x8aa8('0x8');this['name']=_0x8aa8('0x9');util[_0x8aa8('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x224f25){switch(_0x224f25){case'Bad\x20Request':return 0x190;case _0x8aa8('0xa'),_0x8aa8('0xb'):return 0x193;case _0x8aa8('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x33cc5c){return function(_0x583688){logger[_0x8aa8('0xc')](_0x583688[_0x8aa8('0xd')]);var _0x50787d=getStatusCode(_0x583688[_0x8aa8('0x5')]);if(_0x583688[_0x8aa8('0x5')])delete _0x583688[_0x8aa8('0x5')];return _0x33cc5c['status'](_0x50787d)[_0x8aa8('0xe')](_0x583688);};}module[_0x8aa8('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 0698e06..f495fdd 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x586b=['render','json','send','404','status'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x586b,0x1bb));var _0xb586=function(_0xd81e6c,_0x48d93d){_0xd81e6c=_0xd81e6c-0x0;var _0x41f111=_0x586b[_0xd81e6c];return _0x41f111;};'use strict';module['exports'][0x194]=function pageNotFound(_0x523790,_0x18427d){var _0x3e1832=_0xb586('0x0');var _0x2a15df=0x194;var _0x23f7c8={'status':_0x2a15df};_0x18427d[_0xb586('0x1')](_0x23f7c8[_0xb586('0x1')]);_0x18427d[_0xb586('0x2')](_0x3e1832,{},function(_0x5cfaf4,_0x51b75e){if(_0x5cfaf4){return _0x18427d[_0xb586('0x1')](_0x23f7c8[_0xb586('0x1')])[_0xb586('0x3')](_0x23f7c8);}_0x18427d[_0xb586('0x4')](_0x51b75e);});}; \ No newline at end of file +var _0x51cf=['json','send','exports','404','status','render'];(function(_0x16f3b7,_0x3c649c){var _0x42d669=function(_0x18b3b6){while(--_0x18b3b6){_0x16f3b7['push'](_0x16f3b7['shift']());}};_0x42d669(++_0x3c649c);}(_0x51cf,0x16a));var _0xf51c=function(_0x5af6b9,_0x2356a5){_0x5af6b9=_0x5af6b9-0x0;var _0x31a966=_0x51cf[_0x5af6b9];return _0x31a966;};'use strict';module[_0xf51c('0x0')][0x194]=function pageNotFound(_0x596022,_0x168999){var _0x9514f5=_0xf51c('0x1');var _0x52b23a=0x194;var _0x1e365c={'status':_0x52b23a};_0x168999[_0xf51c('0x2')](_0x1e365c['status']);_0x168999[_0xf51c('0x3')](_0x9514f5,{},function(_0x1ae7df,_0x1d1391){if(_0x1ae7df){return _0x168999[_0xf51c('0x2')](_0x1e365c[_0xf51c('0x2')])[_0xf51c('0x4')](_0x1e365c);}_0x168999[_0xf51c('0x5')](_0x1d1391);});}; \ No newline at end of file diff --git a/server/files/chat/iframe.ejs b/server/files/chat/iframe.ejs index 220645c..d0a4155 100644 --- a/server/files/chat/iframe.ejs +++ b/server/files/chat/iframe.ejs @@ -1,390 +1,296 @@ (function() { 'use strict'; - const chatWebsiteAddressOrigin = '{{{chatWebsiteAddressOrigin}}}' - if(chatWebsiteAddressOrigin !== window.location.origin){ - alert(`The current location does not match ${chatWebsiteAddressOrigin}. Please check your website domain in the current XCALLY Chat Website settings.`) - } - else - { - // Init all URLs - const remoteURL = new URL('{{{remote}}}') - const chatOrigin = remoteURL.origin - const chatPath = '/snippet/' - const chatStylesPath = chatPath + 'styles/' - const chatVersion = '{{{chatVersion}}}' - - // Style setttings - const divColor = '<%=div_color%>' - const textColor = '<%=text_color%>' - const buttonColor = '<%=button_color%>' - const backgroungColor = '<%=background_color%>' - let alignment = "<%=alignment%>"; - let verticalAlignment = "<%=verticalAlignment%>"; - - // iframe URL settings - const iframeId = 'motion-chat-iframe' - const iframeSrcURL = new URL(chatPath, chatOrigin) - const iframeSearchParams = new URLSearchParams('{{{query}}}') - iframeSearchParams.append('version', chatVersion) - iframeSearchParams.append('location', btoa(window.location.host)) - iframeSrcURL.search = iframeSearchParams - - // Style URL settings - const linkURL = new URL(chatStylesPath + 'mobile.css', chatOrigin) - linkURL.search = new URLSearchParams({ version: chatVersion }) - const linkMobile = document.createElement('link'); - linkMobile.type = "text/css"; - linkMobile.rel='stylesheet'; - linkMobile.href = linkURL.toString() - - // Iframe localstorage whitelisting - const allowedOrigins = [chatOrigin] - - function remoteLocalStorageEventHandler(event){ - if (allowedOrigins.includes(event.origin)) { - const { action, key, value } = event.data - const localStorage = window.localStorage - switch(action){ - case 'setItem': - { - localStorage.setItem(key, JSON.stringify(value)) - event.source.postMessage( - { - action: 'setItemResult', - key - }, event.origin) - } - break - case 'getItem': - { - let item = localStorage.getItem(key) - if(item){ - try { - item = JSON.parse(item) - } catch (error) { - console.error('Cannot read data from localstorage', error) - } - } - event.source.postMessage( - { - action: 'getItemResult', - key, - item - }, event.origin) - } - break - case 'removeItem': - { - localStorage.removeItem(key) - event.source.postMessage( - { - action: 'removeItemResult', - key - }, event.origin) - } - break - default: - typeof action === 'string' && console.debug('Unsupported action', action) - break; - } - } - } - - // DOM Manipulation - let iframe = document.createElement('iframe'); - // Attributes - iframe['id'] = iframeId; - iframe['src'] = iframeSrcURL.toString() - - let iframe_status = false; - - document.documentElement.style.setProperty('--xc-ws-div-color', divColor); - document.documentElement.style.setProperty('--xc-ws-text-color', textColor); - document.documentElement.style.setProperty('--xc-ws-button-color', buttonColor); - document.documentElement.style.setProperty('--xc-ws-background-color', backgroungColor); + var iframe = document.createElement('iframe'); + // Attributes + iframe['id'] = 'motion-chat-iframe'; + iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=3.0.0&{{{query}}}'; + + var alignment="<%=alignment%>"; + var verticalAlignment="<%=verticalAlignment%>"; + var iframe_status = false; + + document.documentElement.style.setProperty('--xc-ws-div-color', '<%=div_color%>'); + document.documentElement.style.setProperty('--xc-ws-text-color', '<%=text_color%>'); + document.documentElement.style.setProperty('--xc-ws-button_color', '<%=button_color%>'); + document.documentElement.style.setProperty('--xc-ws-background-color', '<%=background_color%>'); - document.head.appendChild(linkMobile); - - <% if (alignment == 'bottom_right') { -%> // Bottom, right - iframe.className = 'motion-chat-iframe-bottom_right'; - verticalAlignment = 0; - document.body.appendChild(iframe); - - <% } else if (alignment == 'right') { -%> // Right - iframe.className = 'motion-chat-iframe-right'; - iframe.style['top'] = verticalAlignment+'%'; - let iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - let div_tab = document.createElement('div'); - div_tab['id'] = 'motion-chat-iframe-tab'; - div_tab.className = 'motion-chat-div-right'; - let tab_status=0; - - <% } else if (alignment == 'left') { -%> // Left - iframe.className = 'motion-chat-iframe-left'; - iframe.style['top'] = verticalAlignment+'%'; - let iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - let div_tab = document.createElement('div'); - div_tab.className = 'motion-chat-div-left'; - div_tab['id'] ='motion-chat-iframe-tab'; - let tab_status=0; - - <% } -%> - - <% if (alignment == 'right') { -%> // Right - topChat_set(iframe_h, verticalAlignment); - document.body.appendChild(div_tab); - let html = '
<
<%=labelText%>'; - div_tab.innerHTML = html; - - div_tab.style.backgroundColor = divColor; - document.getElementById("chat_tab_text").style.color = textColor; - document.getElementById("chat_tab_arrow").style.color = divColor - document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; - document.getElementById("motion-chat-iframe-tab").style.display = "flex"; - - function appendLink(){ - if(iframe_status == false){ - document.body.appendChild(iframe); - iframe_status=true; - } - } - - function expandChatRight(){ - appendLink() - div_tab.style.right = '295px'; - iframe.style.right = '0px'; - document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); - } - - function collapseChatRight(){ - appendLink() - div_tab.style.right = '0px'; - iframe.style.right = '-312px'; - document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - } - - function toggleChatExpandedRight(){ - if(tab_status % 2 === 0) { - expandChatRight() - } - else { - collapseChatRight() - } - tab_status++; - } - - document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedRight); - <% } else if (alignment == 'left') { -%> - topChat_set(iframe_h, verticalAlignment); - document.body.appendChild(div_tab); - let html='
>
<%=labelText%>'; - div_tab.innerHTML=html; - - div_tab.style.backgroundColor = divColor; - document.getElementById("chat_tab_text").style.color = textColor; - document.getElementById("chat_tab_arrow").style.color = divColor; - document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; - document.getElementById("motion-chat-iframe-tab").style.display="flex"; - - function appendLink(){ - if(iframe_status == false){ - document.body.appendChild(iframe); - iframe_status=true; - } - } + var link_mobile = document.createElement('link'); + link_mobile.href = '{{{remote}}}/snippet/styles/mobile.css?version=3.0.0'; + link_mobile.rel='stylesheet'; + link_mobile.type = "text/css"; + document.head.appendChild(link_mobile); + <% if (alignment == 'bottom_right') { -%> // Bottom, right + iframe.className = 'motion-chat-iframe-bottom_right'; + verticalAlignment = 0; + document.body.appendChild(iframe); + + <% } else if (alignment == 'right') { -%> // Right + iframe.className = 'motion-chat-iframe-right'; + iframe.style['top'] = verticalAlignment+'%'; + var iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + var div_tab = document.createElement('div'); + div_tab['id'] = 'motion-chat-iframe-tab'; + div_tab.className = 'motion-chat-div-right'; + var tab_status=0; + + <% } else if (alignment == 'left') { -%> // Left + iframe.className = 'motion-chat-iframe-left'; + iframe.style['top'] = verticalAlignment+'%'; + var iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + var div_tab = document.createElement('div'); + div_tab.className = 'motion-chat-div-left'; + div_tab['id'] ='motion-chat-iframe-tab'; + var tab_status=0; + + <% } -%> + + <% if (alignment == 'right') { -%> // Right + topChat_set(iframe_h, verticalAlignment); + document.body.appendChild(div_tab); + var html = '
<
<%=labelText%>'; + div_tab.innerHTML = html; + + div_tab.style.backgroundColor="<%=div_color%>"; + document.getElementById("chat_tab_text").style.color= "<%=text_color%>"; + document.getElementById("chat_tab_arrow").style.color="<%=div_color%>"; + document.getElementById("chat_tab_arrow").style.backgroundColor="<%=text_color%>"; + document.getElementById("motion-chat-iframe-tab").style.display="flex"; + + function appendLink(){ + if(iframe_status == false){ + document.body.appendChild(iframe); + iframe_status=true; + } + } - function expandChatLeft(){ - appendLink() - div_tab.style.left = '295px'; - iframe.style.left = '0px'; - document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); - } + function expandChatRight(){ + appendLink() + div_tab.style.right = '295px'; + iframe.style.right = '0px'; + document.getElementById("chat_tab_arrow").innerHTML = " > "; + var iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); + } - function collapseChatLeft(){ - appendLink() - div_tab.style.left = '0px'; - iframe.style.left = '-312px'; - document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - } + function collapseChatRight(){ + appendLink() + div_tab.style.right = '0px'; + iframe.style.right = '-312px'; + document.getElementById("chat_tab_arrow").innerHTML = " < "; + var iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + } - function toggleChatExpandedLeft(){ - if(tab_status % 2 === 0) { - expandChatLeft() - } - else { - collapseChatLeft() - } - tab_status++; + function toggleChatExpandedRight(){ + if(tab_status % 2 === 0) { + expandChatRight() } - - document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedLeft); - - <% } -%> - - // START Events management - window.addEventListener('message', function(evt) { - remoteLocalStorageEventHandler(evt) - switch (evt.data.cmd) { - case 'show': - <% if (alignment == 'bottom_right') { -%> // Bottom, right - iframe.style.top = 'auto'; - iframe.style.bottom = '0px'; - <% } else if (alignment == 'right') { -%> // Right - iframe.style.right = '0px'; - div_tab.style.right = '295px'; - <% } else if (alignment == 'left') { -%> // Left - iframe.style.left = '0px'; - div_tab.style.left = '295px'; - // Left - <% } -%> break; - case 'hide': - <% if (alignment == 'bottom_right') { -%> // Bottom, right - iframe.style.top = 'calc(100% - 50px)'; - <% } else if (alignment == 'right') { -%> // Right - iframe.style.right = '-312px'; - div_tab.style['right'] = '0px'; - <% } else if (alignment == 'left') { -%> // Left - iframe.style.left = '-312px'; - div_tab.style.left = '0px'; - <% } -%> break; - case "init": - <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right - div_tab.style.backgroundColor = textColor; - document.getElementById("chat_tab_text").style.color = textColor; - document.getElementById("chat_tab_arrow").style.color = textColor; - document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; - document.getElementById("motion-chat-iframe-tab").style.display = "flex"; - <% } -%> break; - case "offline": - <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right - document.getElementById("motion-chat-iframe-tab").style.display = "none"; - <% } -%> break; - default: + else { + collapseChatRight() } + tab_status++; + } - }, false); - // END Events management + document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedRight); + <% } else if (alignment == 'left') { -%> + topChat_set(iframe_h, verticalAlignment); + document.body.appendChild(div_tab); + var html='
>
<%=labelText%>'; + div_tab.innerHTML=html; + + div_tab.style.backgroundColor="<%=div_color%>"; + document.getElementById("chat_tab_text").style.color= "<%=text_color%>"; + document.getElementById("chat_tab_arrow").style.color="<%=div_color%>"; + document.getElementById("chat_tab_arrow").style.backgroundColor="<%=text_color%>"; + document.getElementById("motion-chat-iframe-tab").style.display="flex"; + + function appendLink(){ + if(iframe_status == false){ + document.body.appendChild(iframe); + iframe_status=true; + } + } - // START Proactive action management - <% proactiveActions.forEach(function(action, index) { -%> - <% if (action.type == 'timeout') { -%> - setTimeout(function() { - <% if (alignment == 'right') { -%> - expandChatRight(); - tab_status++; - <% } else if (alignment == 'left') { -%> - expandChatLeft(); - tab_status++; - <% } else { -%> - iframe.style.bottom = '0px'; - iframe.contentWindow?.postMessage({ - evt: 'show' - }, '*'); - <% } -%> - }, <%- action.timeout %> * 1000); - <% } -%> - <% if (action.type == 'mouseOver') { -%> - let elements<%- index %> = document.querySelectorAll("<%- action.selector %>"); - for (let i = 0; i < elements<%- index %>.length; i++) { - elements<%- index %>[i].onmouseover = function() { - <% if (alignment == 'right') { -%> - expandChatRight(); - tab_status++; - <% } else if (alignment == 'left') { -%> - expandChatLeft(); - tab_status++; - <% } else { -%> - iframe.style.bottom = '0px'; - iframe.contentWindow?.postMessage({ - evt: 'show' - }, '*'); - <% } -%> - } + function expandChatLeft(){ + appendLink() + div_tab.style.left = '295px'; + iframe.style.left = '0px'; + document.getElementById("chat_tab_arrow").innerHTML = " < "; + var iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); } - <% } -%> <% }); -%> - // END Proactive action management - - if (window.DeviceOrientationEvent) { - window.addEventListener('orientationchange', function() { - if (alignment == 'right'){ - document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - tab_status = 0; - iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); - } - else if (alignment == 'left'){ - document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - tab_status = 0; - iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); - } }, false); + function collapseChatLeft(){ + appendLink() + div_tab.style.left = '0px'; + iframe.style.left = '-312px'; + document.getElementById("chat_tab_arrow").innerHTML = " > "; + var iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); } - window.addEventListener("resize", function(event) { - let iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); - }); + function toggleChatExpandedLeft(){ + if(tab_status % 2 === 0) { + expandChatLeft() + } + else { + collapseChatLeft() + } + tab_status++; + } - function topIframe_calc(){ - let height_iframe - let heightD = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); - let iframeT = ((heightD/100)*verticalAlignment) + 450; - if (heightD < iframeT) { - height_iframe = 450 - (iframeT - heightD); + document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedLeft); + + <% } -%> + + // START Events management + window.addEventListener('message', function(evt) { + switch (evt.data.cmd) { + case 'show': + <% if (alignment == 'bottom_right') { -%> // Bottom, right + iframe.style.top = 'auto'; + iframe.style.bottom = '0px'; + <% } else if (alignment == 'right') { -%> // Right + iframe.style.right = '0px'; + div_tab.style.right = '295px'; + <% } else if (alignment == 'left') { -%> // Left + iframe.style.left = '0px'; + div_tab.style.left = '295px'; + // Left + <% } -%> break; + case 'hide': + <% if (alignment == 'bottom_right') { -%> // Bottom, right + iframe.style.top = 'calc(100% - 50px)'; + <% } else if (alignment == 'right') { -%> // Right + iframe.style.right = '-312px'; + div_tab.style['right'] = '0px'; + <% } else if (alignment == 'left') { -%> // Left + iframe.style.left = '-312px'; + div_tab.style.left = '0px'; + <% } -%> break; + case "init": + <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right + div_tab.style.backgroundColor="<%=div_color%>"; + document.getElementById("chat_tab_text").style.color= "<%=text_color%>"; + document.getElementById("chat_tab_arrow").style.color="<%=div_color%>"; + document.getElementById("chat_tab_arrow").style.backgroundColor="<%=text_color%>"; + document.getElementById("motion-chat-iframe-tab").style.display="flex"; + <% } -%> break; + case "offline": + <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right + document.getElementById("motion-chat-iframe-tab").style.display="none"; + <% } -%> break; + default: } - else { height_iframe = 450; } - return height_iframe; + + }, false); + // END Events management + + // START Proactive action management + <% proactiveActions.forEach(function(action, index) { -%> <% if (action.type == 'timeout') { -%> + setTimeout(function() { + <% if (alignment == 'right') { -%> expandChatRight(); + tab_status++; + <% } else if (alignment == 'left') { -%> + expandChatLeft(); + tab_status++; + <% } else { -%> + iframe.style.bottom = '0px'; + iframe.contentWindow?.postMessage({ + evt: 'show' + }, '*'); + <% } -%> + }, <%- action.timeout %> * 1000); + <% } -%> <% if (action.type == 'mouseOver') { -%> var elements<%- index %> = document.querySelectorAll("<%- action.selector %>"); + for (var i = 0; i < elements<%- index %>.length; i++) { + elements<%- index %>[i].onmouseover = function() { + <% if (alignment == 'right') { -%> expandChatRight(); + tab_status++; + <% } else if (alignment == 'left') { -%> + expandChatLeft(); + tab_status++; + <% } else { -%> + iframe.style.bottom = '0px'; + iframe.contentWindow?.postMessage({ + evt: 'show' + }, '*'); + <% } -%> } + } + <% } -%> <% }); -%> // END Proactive action management + - function topIframe_set(height_iframe){ - if( height_iframe > 340){ - iframe.style['height'] = height_iframe +'px'; - if (alignment == "right" || alignment == "left" ) - { iframe.style['top'] = verticalAlignment + "%"; } - else{ iframe.style['bottom'] = "0%"; } + if (window.DeviceOrientationEvent) { + window.addEventListener('orientationchange', function() { + if (alignment == 'right'){ + document.getElementById("chat_tab_arrow").innerHTML = " < "; + var iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + tab_status = 0; + iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); + } + else if (alignment == 'left'){ + document.getElementById("chat_tab_arrow").innerHTML = " > "; + var iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + tab_status = 0; + iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); + } }, false); + } - } - else { - iframe.style['height'] = '340px'; - if (alignment == "right" || alignment == "left" ) - { iframe.style['top'] = "calc(100% - 340px)"; } - else{ iframe.style['bottom'] = "0%"; } + window.addEventListener("resize", function(event) { + var iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); + }); + + function topIframe_calc(){ + var height_iframe + var heightD = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + var iframeT = ((heightD/100)*verticalAlignment) + 450; + if (heightD < iframeT) { + height_iframe = 450 - (iframeT - heightD); + } + else { height_iframe = 450; } + return height_iframe; + } - } - } - - function topChat_set(height_iframe, verticalAlignment){ - + function topIframe_set(height_iframe){ if( height_iframe > 340){ - div_tab.style['top'] = "calc("+ verticalAlignment +"% + " + (height_iframe - 100) + "px)"; + iframe.style['height'] = height_iframe +'px'; + if (alignment == "right" || alignment == "left" ) + { iframe.style['top'] = verticalAlignment + "%"; } + else{ iframe.style['bottom'] = "0%"; } + } else { - div_tab.style['top'] = "auto"; - div_tab.style['bottom'] = "0px"; - } - } + iframe.style['height'] = '340px'; + if (alignment == "right" || alignment == "left" ) + { iframe.style['top'] = "calc(100% - 340px)"; } + else{ iframe.style['bottom'] = "0%"; } - // hide chat - <% if (hideWhenOffline && intervalId != null) { -%> // hide template - document.getElementById("motion-chat-iframe-tab").style.display = "none"; - <% } -%> + } + } + + function topChat_set(height_iframe, verticalAlignment){ + + if( height_iframe > 340){ + div_tab.style['top'] = "calc("+ verticalAlignment +"% + " + (height_iframe - 100) + "px)"; + } + else { + div_tab.style['top'] = "auto"; + div_tab.style['bottom'] = "0px"; + } } + + <% if (hideWhenOffline && interval != null) { -%> // hide template + document.getElementById("motion-chat-iframe-tab").style.display="none"; + <% } -%> + }()); \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index ebd9d72..99d72cd 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb507=['../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','userSetting','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','UserNotification','UserNotifications','SenderId','belongsTo','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','FaxInteraction','user_has_openchannel_interactions','WhatsappInteraction','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','TrunkBackup','TrunkBackupId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','restrict','CloudProviderId','Imap','Smtp','Dispositions','CannedAnswer','Answers','List','ListId','Template','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessage','IntervalId','TagId','Items','FaxAccount','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','ChatGroupId','CompanyId','Phones','CmContactId','cm_contact_has_tags','AdditionalPhones','Queue','CampaignId','OwnerId','Automation','All','OneAll','Any','OneAny','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmHopperId','AllCondition','AnyConditions','AnyCondition','Fields','AnalyticDefaultReport','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','SugarcrmConfiguration','VariableId','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowField','Dynamics365Configuration','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToQueue','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Contacts','userProfileId','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','sequelize','jstz','defaultsDeep','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','mysql','utf8','database','username','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport'];(function(_0x197b35,_0xf6507c){var _0x442dc2=function(_0x333504){while(--_0x333504){_0x197b35['push'](_0x197b35['shift']());}};_0x442dc2(++_0xf6507c);}(_0xb507,0x12e));var _0x7b50=function(_0x529a0f,_0x328763){_0x529a0f=_0x529a0f-0x0;var _0x187a88=_0xb507[_0x529a0f];return _0x187a88;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x7b50('0x0'));var _=require('lodash');var jstz=require(_0x7b50('0x1'));var timezone=jstz['determine']();config[_0x7b50('0x0')]=_[_0x7b50('0x2')](config[_0x7b50('0x0')],{'database':'motion2','username':_0x7b50('0x3'),'password':_0x7b50('0x4'),'options':{'host':_0x7b50('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x7b50('0x6')},'logging':![],'timezone':timezone[_0x7b50('0x7')](),'define':{'charset':'utf8','collate':_0x7b50('0x8')}}});config[_0x7b50('0x9')]=_[_0x7b50('0x2')](config['sequelizeHistory'],{'database':'motion2','username':_0x7b50('0x3'),'password':'xC@LL1234','options':{'host':_0x7b50('0x5'),'port':0xcea,'dialect':_0x7b50('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x7b50('0x7')](),'define':{'charset':_0x7b50('0xb'),'collate':_0x7b50('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7b50('0x0')][_0x7b50('0xc')],config[_0x7b50('0x0')][_0x7b50('0xd')],config[_0x7b50('0x0')]['password'],config[_0x7b50('0x0')][_0x7b50('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x7b50('0xc')],config[_0x7b50('0x9')][_0x7b50('0xd')],config[_0x7b50('0x9')]['password'],config[_0x7b50('0x9')][_0x7b50('0xe')])};db[_0x7b50('0xf')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x11'));db[_0x7b50('0x12')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x13'));db[_0x7b50('0x14')]=db[_0x7b50('0x0')]['import']('../api/voiceContext/voiceContext.model');db[_0x7b50('0x15')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x16'));db['VoiceMusicOnHold']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x7b50('0x0')]['import'](_0x7b50('0x17'));db[_0x7b50('0x18')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x19'));db['ScreenRecording']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x1a'));db[_0x7b50('0x1b')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x1c'));db['VoiceMailMessage']=db[_0x7b50('0x0')]['import'](_0x7b50('0x1d'));db[_0x7b50('0x1e')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x7b50('0x0')]['import'](_0x7b50('0x1f'));db[_0x7b50('0x20')]=db['sequelize'][_0x7b50('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x7b50('0x21')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x22'));db[_0x7b50('0x23')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x24'));db[_0x7b50('0x25')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x26'));db[_0x7b50('0x27')]=db['sequelize']['import'](_0x7b50('0x28'));db['UserVoiceQueueRt']=db[_0x7b50('0x0')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7b50('0x29')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x2a'));db['UserChatQueue']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x2b'));db[_0x7b50('0x2c')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x2d'));db[_0x7b50('0x2e')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x2f'));db['UserSmsQueue']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x30'));db[_0x7b50('0x31')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x32'));db[_0x7b50('0x33')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x34'));db[_0x7b50('0x35')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x36'));db[_0x7b50('0x37')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x38'));db[_0x7b50('0x39')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x3a'));db[_0x7b50('0x3b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x3c'));db['MailInteraction']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x3d'));db[_0x7b50('0x3e')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/mailMessage/mailMessage.model');db[_0x7b50('0x3f')]=db[_0x7b50('0x0')]['import']('../api/mailApplication/mailApplication.model');db[_0x7b50('0x40')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0x7b50('0x41')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x42'));db[_0x7b50('0x43')]=db['sequelize']['import'](_0x7b50('0x44'));db['FaxAccount']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x45'));db[_0x7b50('0x46')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x47'));db['FaxInteraction']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x48'));db[_0x7b50('0x49')]=db['sequelize'][_0x7b50('0x10')]('../api/faxMessage/faxMessage.model');db[_0x7b50('0x4a')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x4b'));db[_0x7b50('0x4c')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x4d'));db[_0x7b50('0x4e')]=db[_0x7b50('0x0')]['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x4f'));db[_0x7b50('0x50')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x51'));db['SmsMessage']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/smsMessage/smsMessage.model');db[_0x7b50('0x52')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x53'));db['OpenchannelAccount']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x54'));db[_0x7b50('0x55')]=db['sequelize']['import'](_0x7b50('0x56'));db[_0x7b50('0x57')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x58'));db['OpenchannelMessage']=db[_0x7b50('0x0')]['import'](_0x7b50('0x59'));db[_0x7b50('0x5a')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x5b'));db['ChatWebsite']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x5c'));db[_0x7b50('0x5d')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x5e'));db[_0x7b50('0x5f')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x60'));db['ChatInteraction']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x61'));db[_0x7b50('0x62')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x63'));db['ChatOfflineMessage']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x64'));db[_0x7b50('0x65')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x66'));db[_0x7b50('0x67')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x68'));db[_0x7b50('0x69')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x6a'));db[_0x7b50('0x6b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x6c'));db[_0x7b50('0x6d')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x6e'));db[_0x7b50('0x6f')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmHopper/cmHopper.model');db[_0x7b50('0x70')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x71'));db[_0x7b50('0x72')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x73'));db[_0x7b50('0x74')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x7b50('0x75')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmCustomField/cmCustomField.model');db[_0x7b50('0x76')]=db['sequelize']['import']('../api/action/action.model');db['Automation']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x77'));db['CannedAnswer']=db['sequelize'][_0x7b50('0x10')]('../api/cannedAnswer/cannedAnswer.model');db[_0x7b50('0x78')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x79'));db[_0x7b50('0x7a')]=db['sequelize'][_0x7b50('0x10')]('../api/condition/condition.model');db[_0x7b50('0x7b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x7c'));db[_0x7b50('0x7d')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/pause/pause.model');db[_0x7b50('0x7e')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x7f'));db['VoiceQueuesLog']=db[_0x7b50('0x0')]['import'](_0x7b50('0x80'));db[_0x7b50('0x81')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x82'));db[_0x7b50('0x83')]=db['sequelize'][_0x7b50('0x10')]('../api/sound/sound.model');db['Tag']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x84'));db[_0x7b50('0x85')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x86'));db[_0x7b50('0x87')]=db[_0x7b50('0x0')]['import'](_0x7b50('0x88'));db[_0x7b50('0x89')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db['Template']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x8a'));db[_0x7b50('0x8b')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x8c'));db[_0x7b50('0x8d')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x8e'));db[_0x7b50('0x8f')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x90'));db[_0x7b50('0x91')]=db['sequelize']['import'](_0x7b50('0x92'));db[_0x7b50('0x93')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x94'));db['AnalyticDefaultReport']=db['sequelize']['import'](_0x7b50('0x95'));db['AnalyticExtractedReport']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x96'));db[_0x7b50('0x97')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x98'));db[_0x7b50('0x99')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x9a'));db['AnalyticTreeReport']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x7b50('0x9b')]=db[_0x7b50('0x0')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x7b50('0x9c')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x9d'));db[_0x7b50('0x9e')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x9f'));db[_0x7b50('0xa0')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xa1'));db[_0x7b50('0xa2')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xa3'));db[_0x7b50('0xa4')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xa5'));db['DeskConfiguration']=db[_0x7b50('0x0')]['import'](_0x7b50('0xa6'));db['DeskField']=db[_0x7b50('0x0')]['import'](_0x7b50('0xa7'));db[_0x7b50('0xa8')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xa9'));db[_0x7b50('0xaa')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xab'));db[_0x7b50('0xac')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xad'));db[_0x7b50('0xae')]=db[_0x7b50('0x0')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x7b50('0xaf')]=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xb0'));db[_0x7b50('0xb1')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xb2'));db[_0x7b50('0xb3')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xb4'));db[_0x7b50('0xb5')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xb6'));db['VtigerConfiguration']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xb7'));db[_0x7b50('0xb8')]=db['sequelize']['import'](_0x7b50('0xb9'));db[_0x7b50('0xba')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xbb'));db[_0x7b50('0xbc')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xbd'));db[_0x7b50('0xbe')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xbf'));db['Dynamics365Configuration']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x7b50('0xc0')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xc1'));db[_0x7b50('0xc2')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xc3'));db[_0x7b50('0xc4')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xc5'));db[_0x7b50('0xc6')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xc7'));db[_0x7b50('0x8f')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x90'));db[_0x7b50('0xc8')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xc9'));db[_0x7b50('0xca')]=db['sequelize']['import'](_0x7b50('0xcb'));db[_0x7b50('0xcc')]=db['sequelize']['import'](_0x7b50('0xcd'));db['JscriptyAnswerReport']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xce'));db[_0x7b50('0xcf')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x7b50('0xd0')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xd1'));db[_0x7b50('0xd2')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x7b50('0x0')]['import'](_0x7b50('0xd3'));db[_0x7b50('0xd4')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xd5'));db[_0x7b50('0xd6')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xd7'));db[_0x7b50('0xd8')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xd9'));db['SquareOdbc']=db[_0x7b50('0x0')]['import'](_0x7b50('0xda'));db['SquareProject']=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xdb'));db[_0x7b50('0xdc')]=db['sequelize'][_0x7b50('0x10')]('../api/squareRecording/squareRecording.model');db[_0x7b50('0xdd')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xde'));db[_0x7b50('0xdf')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xe0'));db[_0x7b50('0xe1')]=db['sequelize'][_0x7b50('0x10')]('../api/license/license.model');db[_0x7b50('0xe2')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xe3'));db['Migration']=db[_0x7b50('0x0')]['import'](_0x7b50('0xe4'));db[_0x7b50('0xe5')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xe6'));db[_0x7b50('0xe7')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xe8'));db[_0x7b50('0xe9')]=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/mailTransferReport/mailTransferReport.model');db[_0x7b50('0xea')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xeb'));db[_0x7b50('0xec')]=db['sequelize']['import'](_0x7b50('0xed'));db[_0x7b50('0xee')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xef'));db[_0x7b50('0xf0')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf1'));db[_0x7b50('0xf2')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xf3'));db[_0x7b50('0xf4')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf5'));db[_0x7b50('0xf6')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf7'));db[_0x7b50('0xf8')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xf9'));db['UserProfileResource']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xfa'));db['UserNotification']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/userNotification/userNotification.model');db[_0x7b50('0xfb')]=db[_0x7b50('0x0')]['import'](_0x7b50('0xfc'));db[_0x7b50('0xfd')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0xfe'));db['WhatsappInteraction']=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0xff'));db[_0x7b50('0x100')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x101'));db[_0x7b50('0x102')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x103'));db[_0x7b50('0x104')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x105'));db[_0x7b50('0x106')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x107'));db[_0x7b50('0x108')]=db['sequelize']['import'](_0x7b50('0x109'));db[_0x7b50('0x10a')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x10b'));db['TeamVoicePrefix']=db[_0x7b50('0x0')][_0x7b50('0x10')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x7b50('0x10c')]=db['sequelize'][_0x7b50('0x10')](_0x7b50('0x10d'));db[_0x7b50('0x10e')]=db[_0x7b50('0x0')][_0x7b50('0x10')](_0x7b50('0x10f'));db[_0x7b50('0xf')][_0x7b50('0x110')](db[_0x7b50('0x1b')],{'as':_0x7b50('0x1b'),'onDelete':'cascade','foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x110')](db['UserSetting'],{'as':_0x7b50('0x112'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x18')],{'as':'Recordings','foreignKey':_0x7b50('0x111')});db['User'][_0x7b50('0x113')](db[_0x7b50('0x114')],{'as':_0x7b50('0x115'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')]['hasMany'](db['VoiceExtension'],{'as':_0x7b50('0x116'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x72')],{'as':_0x7b50('0x118'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x119')],{'as':_0x7b50('0x11a'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':'UserId'});db['User'][_0x7b50('0x113')](db['OpenchannelInteraction'],{'as':_0x7b50('0x11b'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['ChatInteraction'],{'as':_0x7b50('0x11c'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['SmsInteraction'],{'as':_0x7b50('0x11d'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['FaxInteraction'],{'as':_0x7b50('0x11e'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x11f')],{'as':'MailInteractions','foreignKey':_0x7b50('0x111')});db[_0x7b50('0xf')][_0x7b50('0x113')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0x7b50('0xf')][_0x7b50('0x113')](db[_0x7b50('0x120')],{'as':_0x7b50('0x121'),'foreignKey':_0x7b50('0x122')});db[_0x7b50('0xf')][_0x7b50('0x123')](db['UserProfile'],{'as':_0x7b50('0xf6'),'foreignKey':'userProfileId'});db[_0x7b50('0xf')]['belongsToMany'](db[_0x7b50('0x67')],{'as':_0x7b50('0x124'),'through':_0x7b50('0x125')});db[_0x7b50('0xf')][_0x7b50('0x126')](db['CmContact'],{'as':'Contacts','through':_0x7b50('0x127')});db['User'][_0x7b50('0x126')](db['CmList'],{'as':'Lists','through':_0x7b50('0x128')});db['User']['belongsToMany'](db['Team'],{'through':_0x7b50('0x129')});db[_0x7b50('0xf')]['belongsToMany'](db[_0x7b50('0x11f')],{'as':_0x7b50('0x12a'),'through':_0x7b50('0x12b')});db['User'][_0x7b50('0x126')](db[_0x7b50('0x12c')],{'as':'ChatInteractions','through':_0x7b50('0x12d')});db['User'][_0x7b50('0x126')](db[_0x7b50('0x12e')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x7b50('0xf')][_0x7b50('0x126')](db['SmsInteraction'],{'as':_0x7b50('0x11d'),'through':'user_has_sms_interactions'});db['User'][_0x7b50('0x126')](db['OpenchannelInteraction'],{'as':_0x7b50('0x11b'),'through':_0x7b50('0x12f')});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x130')],{'as':_0x7b50('0x131'),'through':_0x7b50('0x132')});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x133')],{'as':_0x7b50('0x134'),'through':_0x7b50('0x29'),'required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db['VoicePrefix'],{'as':_0x7b50('0x135'),'through':_0x7b50('0x10c'),'required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db['MailQueue'],{'as':_0x7b50('0x136'),'through':'UserMailQueue','required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x65')],{'as':_0x7b50('0x137'),'through':_0x7b50('0x138'),'required':![],'hooks':!![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x4a')],{'as':_0x7b50('0x139'),'through':_0x7b50('0x2e'),'required':![]});db['User'][_0x7b50('0x126')](db[_0x7b50('0x52')],{'as':_0x7b50('0x13a'),'through':_0x7b50('0x13b'),'required':![]});db[_0x7b50('0xf')][_0x7b50('0x126')](db['OpenchannelQueue'],{'as':_0x7b50('0x13c'),'through':_0x7b50('0x31'),'required':![]});db[_0x7b50('0xf')]['belongsToMany'](db['WhatsappQueue'],{'as':_0x7b50('0x13d'),'through':_0x7b50('0x13e'),'required':![]});db[_0x7b50('0xf')]['belongsToMany'](db['CmList'],{'through':_0x7b50('0x128')});db[_0x7b50('0xf')]['belongsToMany'](db[_0x7b50('0x13f')],{'as':_0x7b50('0x140'),'through':_0x7b50('0x141')});db[_0x7b50('0xf')][_0x7b50('0x126')](db['FaxAccount'],{'as':_0x7b50('0x142'),'through':_0x7b50('0x143')});db['User']['belongsToMany'](db[_0x7b50('0x37')],{'as':_0x7b50('0x144'),'through':'user_has_mail_accounts'});db[_0x7b50('0xf')][_0x7b50('0x126')](db['OpenchannelAccount'],{'as':_0x7b50('0x145'),'through':_0x7b50('0x146')});db[_0x7b50('0xf')][_0x7b50('0x126')](db[_0x7b50('0x4e')],{'as':_0x7b50('0x147'),'through':_0x7b50('0x148')});db[_0x7b50('0xf')][_0x7b50('0x126')](db['WhatsappAccount'],{'as':_0x7b50('0x149'),'through':_0x7b50('0x14a')});db[_0x7b50('0x12')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x7b50('0x14b')});db[_0x7b50('0x14')][_0x7b50('0x113')](db['VoiceExtension'],{'onDelete':_0x7b50('0x117')});db['VoiceExtension'][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':_0x7b50('0x14c'),'onDelete':'cascade'});db[_0x7b50('0x14d')][_0x7b50('0x126')](db[_0x7b50('0x83')],{'as':_0x7b50('0x14e'),'through':_0x7b50('0x14f')});db['VoiceQueue'][_0x7b50('0x113')](db[_0x7b50('0x114')],{'as':_0x7b50('0x150'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')]['hasMany'](db[_0x7b50('0x6f')],{'as':_0x7b50('0x152'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')][_0x7b50('0x113')](db[_0x7b50('0x72')],{'as':_0x7b50('0x118'),'foreignKey':'VoiceQueueId'});db[_0x7b50('0x133')][_0x7b50('0x113')](db['CmHopperHistory'],{'as':_0x7b50('0x153'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':_0x7b50('0x151')});db[_0x7b50('0x133')][_0x7b50('0x113')](db[_0x7b50('0x70')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x7b50('0x133')]['hasMany'](db[_0x7b50('0xd0')],{'as':_0x7b50('0x154'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['belongsTo'](db[_0x7b50('0x25')],{'as':_0x7b50('0x25'),'foreignKey':'TrunkId'});db[_0x7b50('0x133')][_0x7b50('0x123')](db[_0x7b50('0x25')],{'as':_0x7b50('0x155'),'foreignKey':_0x7b50('0x156')});db['VoiceQueue'][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'as':_0x7b50('0x7b'),'foreignKey':'IntervalId'});db[_0x7b50('0x133')]['belongsTo'](db[_0x7b50('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x7b50('0x157')});db[_0x7b50('0x133')][_0x7b50('0x126')](db[_0x7b50('0xf2')],{'as':'Lists','through':_0x7b50('0x158')});db[_0x7b50('0x133')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':'UserVoiceQueue'});db[_0x7b50('0x133')]['belongsToMany'](db[_0x7b50('0xdf')],{'as':_0x7b50('0x15a'),'through':_0x7b50('0x10a')});db[_0x7b50('0x133')][_0x7b50('0x126')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x15b'),'through':'voice_queues_has_cm_blacklists'});db[_0x7b50('0x18')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0xf'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x15c')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0xf'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x1b')][_0x7b50('0x113')](db[_0x7b50('0x15d')],{'as':_0x7b50('0x15e'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x7b50('0x15f')});db['VoiceMailMessage']['belongsTo'](db[_0x7b50('0x1b')],{'foreignKey':_0x7b50('0x160'),'targetKey':_0x7b50('0x15f')});db[_0x7b50('0x1e')][_0x7b50('0x113')](db[_0x7b50('0x21')],{'as':_0x7b50('0x161'),'foreignKey':_0x7b50('0x162'),'constraints':![]});db['VoiceCallReport'][_0x7b50('0x113')](db[_0x7b50('0x20')],{'as':_0x7b50('0x163'),'foreignKey':_0x7b50('0x162'),'constraints':![]});db['VoiceCallReport'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0xf'),'foreignKey':'UserId'});db[_0x7b50('0x1e')]['belongsTo'](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['MailServerIn'][_0x7b50('0x123')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x7b50('0x166')});db[_0x7b50('0x33')][_0x7b50('0x123')](db[_0x7b50('0x108')],{'as':_0x7b50('0x108'),'foreignKey':'CloudProviderId','onDelete':_0x7b50('0x167')});db[_0x7b50('0x35')]['belongsTo'](db['MailAccount'],{'as':_0x7b50('0x37'),'foreignKey':_0x7b50('0x166')});db[_0x7b50('0x35')][_0x7b50('0x123')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x7b50('0x168'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x37')][_0x7b50('0x110')](db[_0x7b50('0x33')],{'as':_0x7b50('0x169'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x37')][_0x7b50('0x110')](db['MailServerOut'],{'as':_0x7b50('0x16a'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x37')][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x166'),'onDelete':_0x7b50('0x117')});db['MailAccount'][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x166')});db[_0x7b50('0x37')]['hasMany'](db['MailMessage'],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x166')});db[_0x7b50('0x37')][_0x7b50('0x113')](db[_0x7b50('0x11f')],{'as':'Interactions'});db[_0x7b50('0x37')]['hasMany'](db['MailApplication'],{'as':_0x7b50('0x14c')});db[_0x7b50('0x37')][_0x7b50('0x123')](db['CmList'],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x37')][_0x7b50('0x123')](db['Template'],{'as':_0x7b50('0x170'),'foreignKey':_0x7b50('0x171')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0x7b50('0x172'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x173')});db[_0x7b50('0x39')]['belongsToMany'](db[_0x7b50('0xf')],{'as':'Agents','through':_0x7b50('0x2c')});db['MailQueue'][_0x7b50('0x126')](db[_0x7b50('0xdf')],{'through':_0x7b50('0x174'),'as':_0x7b50('0x15a')});db[_0x7b50('0x11f')][_0x7b50('0x113')](db['MailMessage'],{'as':_0x7b50('0x15e'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x175')});db[_0x7b50('0x11f')][_0x7b50('0x123')](db[_0x7b50('0x37')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x7b50('0x11f')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':'ContactId'});db[_0x7b50('0x11f')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x11f')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x178'),'as':_0x7b50('0x179')});db[_0x7b50('0x11f')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x178'),'as':_0x7b50('0x17a')});db[_0x7b50('0x11f')]['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x12b'),'foreignKey':_0x7b50('0x175')});db[_0x7b50('0x3e')][_0x7b50('0x113')](db[_0x7b50('0xe5')],{'as':_0x7b50('0x17c'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x3e')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0xf')});db[_0x7b50('0x3e')]['belongsTo'](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164')});db[_0x7b50('0x3e')]['belongsTo'](db['MailInteraction'],{'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x175')});db['MailMessage']['belongsTo'](db['MailAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x166')});db['MailMessage'][_0x7b50('0x123')](db[_0x7b50('0x13f')],{'as':'ChatWebsite','foreignKey':_0x7b50('0x17f')});db['MailMessage'][_0x7b50('0x123')](db[_0x7b50('0x180')],{'as':_0x7b50('0x180'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x3f')][_0x7b50('0x123')](db['MailQueue'],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x3f')][_0x7b50('0x123')](db[_0x7b50('0x37')],{'onDelete':_0x7b50('0x167')});db['MailApplication']['belongsTo'](db[_0x7b50('0x7b')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x181')});db[_0x7b50('0x3f')][_0x7b50('0x123')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7b50('0x182')});db[_0x7b50('0x40')][_0x7b50('0x123')](db[_0x7b50('0x37')],{});db[_0x7b50('0x40')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f')});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x11f')],{});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x3e')],{});db[_0x7b50('0x40')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db['MailQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x39')],{});db[_0x7b50('0x41')][_0x7b50('0x113')](db[_0x7b50('0x43')],{'as':_0x7b50('0x183'),'onDelete':'cascade'});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x185'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x184')][_0x7b50('0x113')](db['CannedAnswer'],{'as':_0x7b50('0x16d'),'foreignKey':'FaxAccountId'});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x12e')],{'as':_0x7b50('0x186')});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x46')],{'as':_0x7b50('0x14c')});db[_0x7b50('0x184')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':_0x7b50('0x187'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x184')]['hasMany'](db[_0x7b50('0x49')],{'as':_0x7b50('0x15e')});db[_0x7b50('0x184')][_0x7b50('0x123')](db['Trunk'],{'as':_0x7b50('0x25')});db[_0x7b50('0x184')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':'ListId'});db[_0x7b50('0x184')]['belongsTo'](db[_0x7b50('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x7b50('0x157')});db['FaxAccount'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x143')});db[_0x7b50('0x46')]['belongsTo'](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x46')][_0x7b50('0x123')](db[_0x7b50('0x4a')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x46')]['belongsTo'](db[_0x7b50('0x184')],{'onDelete':'restrict'});db[_0x7b50('0x46')]['belongsTo'](db['Tag'],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x182')});db[_0x7b50('0x12e')]['hasMany'](db['FaxMessage'],{'as':_0x7b50('0x15e'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x188')});db[_0x7b50('0x12e')]['belongsTo'](db['FaxAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x185')});db[_0x7b50('0x12e')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['FaxInteraction'][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0x176'),'foreignKey':'UserId'});db['FaxInteraction'][_0x7b50('0x126')](db['Tag'],{'through':_0x7b50('0x189'),'as':_0x7b50('0x179')});db[_0x7b50('0x12e')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction']['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x18a'),'foreignKey':_0x7b50('0x188')});db[_0x7b50('0x49')]['belongsTo'](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0xf')});db['FaxMessage'][_0x7b50('0x123')](db['FaxInteraction'],{'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x188')});db[_0x7b50('0x49')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':'Contact'});db[_0x7b50('0x49')][_0x7b50('0x123')](db[_0x7b50('0xe5')],{'as':'Attachment','foreignKey':_0x7b50('0x18b')});db[_0x7b50('0x49')][_0x7b50('0x123')](db['FaxAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x185')});db[_0x7b50('0x4a')]['belongsToMany'](db[_0x7b50('0xf')],{'as':'Agents','through':_0x7b50('0x2e')});db[_0x7b50('0x4a')][_0x7b50('0x126')](db['Team'],{'through':_0x7b50('0x18c'),'as':_0x7b50('0x15a')});db[_0x7b50('0x4c')]['belongsTo'](db[_0x7b50('0x184')],{});db[_0x7b50('0x4c')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db['FaxQueueReport'][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x4c')]['belongsTo'](db[_0x7b50('0x12e')],{});db['FaxQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x49')],{});db['FaxQueueReport']['belongsTo'](db[_0x7b50('0xf')],{});db['FaxQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x4a')],{});db[_0x7b50('0x4e')][_0x7b50('0x113')](db['Disposition'],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x18d'),'onDelete':'cascade'});db[_0x7b50('0x4e')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x18d')});db[_0x7b50('0x4e')][_0x7b50('0x113')](db[_0x7b50('0x18e')],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x18d')});db['SmsAccount'][_0x7b50('0x113')](db[_0x7b50('0x50')],{'as':_0x7b50('0x186')});db[_0x7b50('0x4e')][_0x7b50('0x113')](db['SmsApplication'],{'as':_0x7b50('0x14c')});db[_0x7b50('0x4e')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x4e')][_0x7b50('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7b50('0x157')});db[_0x7b50('0x4e')]['belongsToMany'](db['User'],{'as':_0x7b50('0x159'),'through':_0x7b50('0x148')});db[_0x7b50('0x18f')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':'restrict'});db[_0x7b50('0x18f')][_0x7b50('0x123')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x7b50('0x18f')][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0x18f')][_0x7b50('0x123')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x7b50('0x181')});db[_0x7b50('0x18f')][_0x7b50('0x123')](db[_0x7b50('0x177')],{'onDelete':'restrict','foreignKey':_0x7b50('0x182')});db[_0x7b50('0x50')][_0x7b50('0x113')](db[_0x7b50('0x18e')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7b50('0x190')});db['SmsInteraction'][_0x7b50('0x123')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x7b50('0x50')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x50')][_0x7b50('0x123')](db['User'],{'as':'Owner','foreignKey':_0x7b50('0x111')});db[_0x7b50('0x50')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x191'),'as':'Tags'});db[_0x7b50('0x50')]['belongsToMany'](db[_0x7b50('0x177')],{'through':'sms_interaction_has_tags','as':_0x7b50('0x17a')});db['SmsInteraction'][_0x7b50('0x126')](db['User'],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x192'),'foreignKey':'SmsInteractionId'});db[_0x7b50('0x18e')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0xf')});db[_0x7b50('0x18e')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164')});db['SmsMessage'][_0x7b50('0x123')](db[_0x7b50('0x50')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x190')});db[_0x7b50('0x18e')][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x18d')});db[_0x7b50('0x52')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x13b'),'foreignKey':_0x7b50('0x193')});db[_0x7b50('0x52')][_0x7b50('0x126')](db[_0x7b50('0xdf')],{'through':_0x7b50('0x194'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x7b50('0x195')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x196')});db['OpenchannelAccount'][_0x7b50('0x113')](db[_0x7b50('0x57')],{'as':_0x7b50('0x186'),'foreignKey':_0x7b50('0x196')});db[_0x7b50('0x195')][_0x7b50('0x113')](db['OpenchannelMessage'],{'as':_0x7b50('0x15e'),'foreignKey':'OpenchannelAccountId'});db[_0x7b50('0x195')]['hasMany'](db['OpenchannelApplication'],{'as':_0x7b50('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x7b50('0x195')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x195')]['belongsTo'](db[_0x7b50('0x7d')],{'as':_0x7b50('0x172'),'foreignKey':_0x7b50('0x157')});db[_0x7b50('0x195')][_0x7b50('0x126')](db['User'],{'as':_0x7b50('0x159'),'through':_0x7b50('0x146')});db[_0x7b50('0x55')][_0x7b50('0x123')](db['User'],{'onDelete':_0x7b50('0x167')});db['OpenchannelApplication'][_0x7b50('0x123')](db[_0x7b50('0x5a')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x197')});db[_0x7b50('0x55')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x196')});db[_0x7b50('0x55')][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'onDelete':_0x7b50('0x167'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x7b50('0x123')](db[_0x7b50('0x177')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x182')});db[_0x7b50('0x57')][_0x7b50('0x113')](db[_0x7b50('0x198')],{'as':'Messages','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x199')});db['OpenchannelInteraction'][_0x7b50('0x123')](db[_0x7b50('0x195')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x7b50('0x57')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x57')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x57')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x19a'),'as':_0x7b50('0x179')});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x7b50('0x17a')});db[_0x7b50('0x57')]['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':_0x7b50('0x12f'),'foreignKey':_0x7b50('0x199')});db[_0x7b50('0x198')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0xf')});db[_0x7b50('0x198')][_0x7b50('0x123')](db['CmContact'],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164')});db[_0x7b50('0x198')]['belongsTo'](db[_0x7b50('0x57')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x7b50('0x123')](db['Attachment'],{'as':_0x7b50('0xe5'),'foreignKey':_0x7b50('0x18b')});db[_0x7b50('0x198')][_0x7b50('0x123')](db[_0x7b50('0x195')],{'as':'Account','foreignKey':_0x7b50('0x196')});db[_0x7b50('0x5a')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':'UserOpenchannelQueue','foreignKey':_0x7b50('0x197')});db[_0x7b50('0x5a')]['belongsToMany'](db['Team'],{'through':_0x7b50('0x19b'),'as':_0x7b50('0x15a')});db[_0x7b50('0x13f')]['hasMany'](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x7b50('0x13f')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':'Answers','foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x13f')][_0x7b50('0x113')](db['ChatProactiveAction'],{'as':_0x7b50('0x19c')});db[_0x7b50('0x13f')]['hasMany'](db[_0x7b50('0x12c')],{'as':'Interactions'});db[_0x7b50('0x13f')]['hasMany'](db['ChatApplication'],{'as':_0x7b50('0x14c')});db[_0x7b50('0x13f')][_0x7b50('0x113')](db[_0x7b50('0x62')],{'as':_0x7b50('0x15e')});db[_0x7b50('0x13f')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x13f')]['belongsTo'](db[_0x7b50('0x7b')],{'as':_0x7b50('0x7b'),'foreignKey':'IntervalId'});db[_0x7b50('0x13f')][_0x7b50('0x123')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x7b50('0x166')});db['ChatWebsite'][_0x7b50('0x123')](db[_0x7b50('0x7d')],{'as':_0x7b50('0x172'),'foreignKey':_0x7b50('0x157')});db[_0x7b50('0x13f')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x141')});db[_0x7b50('0x5d')]['belongsTo'](db[_0x7b50('0x195')],{});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db['OpenchannelQueueReport'][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0x57')],{});db[_0x7b50('0x5d')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db[_0x7b50('0x5d')][_0x7b50('0x123')](db[_0x7b50('0x5a')],{});db['ChatApplication'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0x19d'),'foreignKey':_0x7b50('0x111'),'onDelete':'restrict'});db[_0x7b50('0x5f')][_0x7b50('0x123')](db[_0x7b50('0x65')],{'as':'Queue','foreignKey':_0x7b50('0x19e'),'onDelete':_0x7b50('0x167')});db['ChatApplication'][_0x7b50('0x123')](db['ChatWebsite'],{'as':_0x7b50('0x19f'),'foreignKey':'ChatWebsiteId','onDelete':_0x7b50('0x167')});db[_0x7b50('0x5f')]['belongsTo'](db['Tag'],{'onDelete':_0x7b50('0x167'),'foreignKey':'TagId'});db['ChatInteraction'][_0x7b50('0x113')](db[_0x7b50('0x62')],{'as':_0x7b50('0x15e'),'onDelete':_0x7b50('0x117'),'foreignKey':'ChatInteractionId'});db[_0x7b50('0x12c')][_0x7b50('0x123')](db['ChatWebsite'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x12c')][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x12c')][_0x7b50('0x123')](db['User'],{'as':'Owner','foreignKey':_0x7b50('0x111')});db[_0x7b50('0x12c')][_0x7b50('0x126')](db['Tag'],{'through':_0x7b50('0x1a0'),'as':_0x7b50('0x179')});db[_0x7b50('0x12c')][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x1a0'),'as':_0x7b50('0x17a')});db[_0x7b50('0x12c')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':'Users','through':_0x7b50('0x12d'),'foreignKey':_0x7b50('0x1a1')});db[_0x7b50('0x62')][_0x7b50('0x123')](db['User'],{'onDelete':'cascade','as':_0x7b50('0xf')});db[_0x7b50('0x62')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['ChatMessage'][_0x7b50('0x123')](db[_0x7b50('0x12c')],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':_0x7b50('0x1a1')});db[_0x7b50('0x62')][_0x7b50('0x123')](db[_0x7b50('0xe5')],{'as':'Attachment','foreignKey':_0x7b50('0x18b')});db[_0x7b50('0x62')]['belongsTo'](db[_0x7b50('0x13f')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x180')][_0x7b50('0x113')](db[_0x7b50('0xe5')],{'as':_0x7b50('0x17c'),'foreignKey':_0x7b50('0x1a2'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x180')]['belongsTo'](db[_0x7b50('0x6d')],{'onDelete':'cascade','as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['ChatOfflineMessage'][_0x7b50('0x123')](db['ChatWebsite'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x17f')});db[_0x7b50('0x65')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x138'),'hooks':!![]});db[_0x7b50('0x65')][_0x7b50('0x126')](db['Team'],{'through':'team_has_chat_queues','as':_0x7b50('0x15a')});db[_0x7b50('0x67')][_0x7b50('0x113')](db[_0x7b50('0xcc')],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x1a3'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x67')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x150'),'through':_0x7b50('0x125')});db['ChatProactiveAction'][_0x7b50('0x123')](db[_0x7b50('0x13f')],{'as':_0x7b50('0x19f'),'foreignKey':_0x7b50('0x17f')});db['CmCompany'][_0x7b50('0x113')](db[_0x7b50('0x6d')],{'as':'Contacts','foreignKey':_0x7b50('0x1a4')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x87')],{'as':_0x7b50('0x1a5'),'foreignKey':_0x7b50('0x1a6')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x6f')],{'as':'Hoppers','foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')]['hasMany'](db['CmHopperFinal'],{'as':_0x7b50('0x118'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')]['hasMany'](db[_0x7b50('0x119')],{'as':_0x7b50('0x153'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0xd0')],{'as':_0x7b50('0x154'),'foreignKey':'ContactId'});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x57')],{'as':_0x7b50('0x11b'),'foreignKey':_0x7b50('0x165'),'onDelete':'restrict'});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x12c')],{'as':'ChatInteractions','foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')]['hasMany'](db[_0x7b50('0x50')],{'as':_0x7b50('0x11d'),'foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db['FaxInteraction'],{'as':_0x7b50('0x11e'),'foreignKey':'ContactId','onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')][_0x7b50('0x113')](db[_0x7b50('0x11f')],{'as':_0x7b50('0x12a'),'foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x6d')][_0x7b50('0x123')](db[_0x7b50('0x6b')],{'as':'Company','foreignKey':_0x7b50('0x1a4')});db[_0x7b50('0x6d')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':'ListId','onDelete':_0x7b50('0x117')});db[_0x7b50('0x6d')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':'Users','through':_0x7b50('0x127')});db[_0x7b50('0x6d')]['belongsToMany'](db[_0x7b50('0x177')],{'as':_0x7b50('0x179'),'through':_0x7b50('0x1a7')});db[_0x7b50('0x6d')]['belongsToMany'](db[_0x7b50('0x177')],{'through':'cm_contact_has_tags','as':_0x7b50('0x17a')});db[_0x7b50('0x6f')][_0x7b50('0x113')](db['CmHopperAdditionalPhone'],{'as':_0x7b50('0x1a8'),'foreignKey':'CmHopperId'});db[_0x7b50('0x6f')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':'Contact','foreignKey':_0x7b50('0x165'),'onDelete':'cascade'});db[_0x7b50('0x6f')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':'ListId','onDelete':_0x7b50('0x117')});db[_0x7b50('0x6f')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0x19d'),'foreignKey':_0x7b50('0x111')});db[_0x7b50('0x6f')]['belongsTo'](db[_0x7b50('0x133')],{'as':_0x7b50('0x1a9'),'foreignKey':_0x7b50('0x151'),'onDelete':_0x7b50('0x117')});db['CmHopper'][_0x7b50('0x123')](db[_0x7b50('0xe2')],{'as':'Campaign','foreignKey':_0x7b50('0x1aa'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x6f')]['belongsTo'](db[_0x7b50('0xf')],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x1ab')});db['CmHopperBlack'][_0x7b50('0x123')](db['CmContact'],{'as':'Contact','foreignKey':_0x7b50('0x165'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x70')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x70')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x7b50('0x70')][_0x7b50('0x123')](db['Campaign'],{'as':_0x7b50('0xe2'),'foreignKey':_0x7b50('0x1aa'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0x1ac')]['hasMany'](db[_0x7b50('0x7a')],{'as':{'plural':_0x7b50('0x1ad'),'singular':_0x7b50('0x1ae')},'foreignKey':'AutomationAllId','onDelete':_0x7b50('0x117'),'hooks':!![]});db['Automation']['hasMany'](db[_0x7b50('0x7a')],{'as':{'plural':_0x7b50('0x1af'),'singular':_0x7b50('0x1b0')},'foreignKey':'AutomationAnyId','onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x1ac')][_0x7b50('0x113')](db[_0x7b50('0x76')],{'as':_0x7b50('0x1b1'),'foreignKey':_0x7b50('0x1b2'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db['Disposition'][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0x7b50('0x117')});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x7b')],{'as':_0x7b50('0x1b3'),'foreignKey':'IntervalId','onDelete':_0x7b50('0x117'),'hooks':!![],'required':![]});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':_0x7b50('0x116'),'foreignKey':_0x7b50('0x181'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x3f')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0x7b50('0x7b')][_0x7b50('0x113')](db[_0x7b50('0x5f')],{'as':_0x7b50('0x1b4'),'foreignKey':_0x7b50('0x181')});db['Interval'][_0x7b50('0x113')](db[_0x7b50('0x46')],{'as':_0x7b50('0x1b5'),'foreignKey':_0x7b50('0x181')});db['Interval'][_0x7b50('0x113')](db[_0x7b50('0x18f')],{'as':_0x7b50('0x1b6'),'foreignKey':_0x7b50('0x181')});db[_0x7b50('0x81')][_0x7b50('0x123')](db[_0x7b50('0x37')],{});db[_0x7b50('0x81')][_0x7b50('0x123')](db['AnalyticDefaultReport'],{'foreignKey':_0x7b50('0x1b7')});db[_0x7b50('0x81')][_0x7b50('0x123')](db[_0x7b50('0x93')],{'foreignKey':'CustomReportId'});db[_0x7b50('0x83')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x7b50('0x1b8'),'through':_0x7b50('0x14f'),'onDelete':'restrict'});db[_0x7b50('0x177')]['belongsToMany'](db[_0x7b50('0x6d')],{'through':_0x7b50('0x1a7')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x12c')],{'through':_0x7b50('0x1a0')});db[_0x7b50('0x177')][_0x7b50('0x126')](db['MailInteraction'],{'through':_0x7b50('0x178')});db[_0x7b50('0x177')]['belongsToMany'](db[_0x7b50('0x50')],{'through':_0x7b50('0x191')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x12e')],{'through':_0x7b50('0x189')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x57')],{'through':_0x7b50('0x19a')});db[_0x7b50('0x177')][_0x7b50('0x126')](db[_0x7b50('0x130')],{'through':_0x7b50('0x1b9')});db[_0x7b50('0x87')][_0x7b50('0x123')](db[_0x7b50('0x85')],{'as':'ItemType','foreignKey':_0x7b50('0x1ba')});db[_0x7b50('0x89')][_0x7b50('0x123')](db[_0x7b50('0x6f')],{'as':_0x7b50('0x1bb'),'foreignKey':_0x7b50('0x1bc')});db[_0x7b50('0x87')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':'Contact','foreignKey':_0x7b50('0x1a6')});db[_0x7b50('0x8b')][_0x7b50('0x113')](db[_0x7b50('0x7a')],{'as':{'plural':'AllConditions','singular':_0x7b50('0x1bd')},'foreignKey':'TriggerAllId','onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x8b')][_0x7b50('0x113')](db[_0x7b50('0x7a')],{'as':{'plural':_0x7b50('0x1be'),'singular':_0x7b50('0x1bf')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x7b50('0x8b')][_0x7b50('0x113')](db['Action'],{'as':_0x7b50('0x1b1'),'foreignKey':'TriggerId','onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x93')][_0x7b50('0x113')](db[_0x7b50('0x99')],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x7b50('0x1c1')][_0x7b50('0x113')](db[_0x7b50('0x99')],{'as':'Fields','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1b7')});db[_0x7b50('0x97')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x7b50('0x1c0'),'onDelete':'cascade','foreignKey':_0x7b50('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x7b50('0x97')],{'foreignKey':_0x7b50('0x1c2')});db[_0x7b50('0x9b')]['hasMany'](db[_0x7b50('0x9c')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db['SalesforceConfiguration'][_0x7b50('0x113')](db[_0x7b50('0x9e')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x7b50('0x113')](db[_0x7b50('0x9e')],{'as':_0x7b50('0x1c6'),'onDelete':'cascade','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x9c')]['hasMany'](db[_0x7b50('0x9e')],{'as':'Fields','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x9c')]['belongsTo'](db[_0x7b50('0x9b')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0x9e')]['hasMany'](db['SalesforceField'],{'as':_0x7b50('0x1c9'),'foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x9e')][_0x7b50('0x113')](db[_0x7b50('0x9e')],{'as':_0x7b50('0x1cb'),'foreignKey':'DescriptionId'});db[_0x7b50('0x9e')][_0x7b50('0x113')](db['SalesforceField'],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x9e')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7b50('0xa0')]['hasMany'](db[_0x7b50('0x1cd')],{'as':'Configurations','onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0x1cd')][_0x7b50('0x113')](db['SugarcrmField'],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':'SubjectId'});db[_0x7b50('0x1cd')][_0x7b50('0x113')](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c7')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':'Fields','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db['SugarcrmConfiguration'][_0x7b50('0x123')](db[_0x7b50('0xa0')],{'as':_0x7b50('0x17e'),'foreignKey':'AccountId'});db[_0x7b50('0xa2')]['hasMany'](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xa2')]['hasMany'](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db['SugarcrmField']['hasMany'](db[_0x7b50('0xa2')],{'as':_0x7b50('0x1cc'),'foreignKey':'FieldId'});db[_0x7b50('0xa2')]['belongsTo'](db[_0x7b50('0x8d')],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xa4')]['hasMany'](db[_0x7b50('0x1cf')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0x1cf')][_0x7b50('0x113')](db[_0x7b50('0x1d0')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1ca')});db['DeskConfiguration'][_0x7b50('0x113')](db['DeskField'],{'as':'Descriptions','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1cf')][_0x7b50('0x113')](db['DeskField'],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1cf')][_0x7b50('0x123')](db['DeskAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db['DeskConfiguration'][_0x7b50('0x126')](db['Tag'],{'through':_0x7b50('0x1d1')});db[_0x7b50('0x1d0')][_0x7b50('0x113')](db['DeskField'],{'as':_0x7b50('0x1c9'),'foreignKey':_0x7b50('0x1ca')});db['DeskField'][_0x7b50('0x113')](db[_0x7b50('0x1d0')],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d0')][_0x7b50('0x113')](db[_0x7b50('0x1d0')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d0')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xa8')][_0x7b50('0x113')](db[_0x7b50('0xaa')],{'as':_0x7b50('0x1c3'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0x7b50('0x113')](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xaa')]['hasMany'](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':'DescriptionId'});db[_0x7b50('0xaa')][_0x7b50('0x113')](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':'FieldId'});db[_0x7b50('0xaa')][_0x7b50('0x123')](db[_0x7b50('0xa8')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xac')]['hasMany'](db[_0x7b50('0xac')],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xac')][_0x7b50('0x113')](db['ZohoField'],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db['ZohoField']['hasMany'](db[_0x7b50('0xac')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0xac')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xae')][_0x7b50('0x113')](db[_0x7b50('0xaf')],{'as':'Configurations','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xaf')]['hasMany'](db[_0x7b50('0x1d2')],{'as':_0x7b50('0x1c5'),'foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xaf')]['hasMany'](db[_0x7b50('0x1d2')],{'as':'Descriptions','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xaf')][_0x7b50('0x113')](db[_0x7b50('0x1d2')],{'as':_0x7b50('0x1c0'),'foreignKey':'FieldId'});db[_0x7b50('0xaf')][_0x7b50('0x123')](db[_0x7b50('0xae')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xaf')]['belongsToMany'](db['Tag'],{'through':_0x7b50('0x1d3')});db[_0x7b50('0x1d2')][_0x7b50('0x113')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x1d2')][_0x7b50('0x113')](db['ZendeskField'],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d2')]['hasMany'](db['ZendeskField'],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d2')][_0x7b50('0x123')](db['Variable'],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0x1d4')][_0x7b50('0x113')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xb1')][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':_0x7b50('0x1c5'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1ca')});db['FreshdeskConfiguration'][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':'DescriptionId'});db[_0x7b50('0xb1')][_0x7b50('0x113')](db['FreshdeskField'],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0xb1')]['belongsTo'](db[_0x7b50('0x1d4')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db['FreshdeskConfiguration'][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':_0x7b50('0x1d5')});db['FreshdeskField'][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db['FreshdeskField'][_0x7b50('0x113')](db['FreshdeskField'],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xb3')][_0x7b50('0x113')](db[_0x7b50('0xb3')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0xb3')][_0x7b50('0x123')](db['Variable'],{'as':_0x7b50('0x8d'),'foreignKey':'VariableId'});db[_0x7b50('0xb5')][_0x7b50('0x113')](db['VtigerConfiguration'],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0x1d6')][_0x7b50('0x113')](db[_0x7b50('0xb8')],{'as':'Subjects','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x1d6')][_0x7b50('0x113')](db[_0x7b50('0xb8')],{'as':_0x7b50('0x1c6'),'foreignKey':'DescriptionId'});db[_0x7b50('0x1d6')][_0x7b50('0x113')](db['VtigerField'],{'as':_0x7b50('0x1c0'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d6')]['belongsTo'](db[_0x7b50('0xb5')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xb8')][_0x7b50('0x113')](db[_0x7b50('0xb8')],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xb8')][_0x7b50('0x113')](db['VtigerField'],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xb8')][_0x7b50('0x113')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x7b50('0xb8')][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7b50('0xba')][_0x7b50('0x113')](db[_0x7b50('0xbc')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c4')});db['ServicenowConfiguration'][_0x7b50('0x113')](db[_0x7b50('0x1d7')],{'as':'Subjects','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x7b50('0x1c6'),'foreignKey':_0x7b50('0x1c7')});db['ServicenowConfiguration'][_0x7b50('0x113')](db['ServicenowField'],{'as':_0x7b50('0x1c0'),'foreignKey':'FieldId'});db[_0x7b50('0xbc')][_0x7b50('0x123')](db[_0x7b50('0xba')],{'as':'Account','foreignKey':_0x7b50('0x1c4')});db['ServicenowField'][_0x7b50('0x113')](db[_0x7b50('0x1d7')],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db['ServicenowField'][_0x7b50('0x113')](db[_0x7b50('0x1d7')],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d7')]['hasMany'](db[_0x7b50('0x1d7')],{'as':_0x7b50('0x1cc'),'foreignKey':_0x7b50('0x1c8')});db[_0x7b50('0x1d7')][_0x7b50('0x123')](db['Variable'],{'as':_0x7b50('0x8d'),'foreignKey':'VariableId'});db[_0x7b50('0xbe')][_0x7b50('0x113')](db[_0x7b50('0x1d8')],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0xbe')][_0x7b50('0x123')](db[_0x7b50('0x108')],{'as':_0x7b50('0x108'),'foreignKey':_0x7b50('0x168')});db[_0x7b50('0x1d8')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':_0x7b50('0x1c5'),'onDelete':'cascade','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0x1d8')]['hasMany'](db[_0x7b50('0xc0')],{'as':_0x7b50('0x1c6'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0x1d8')][_0x7b50('0x113')](db['Dynamics365Field'],{'as':_0x7b50('0x1c0'),'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1c8')});db['Dynamics365Configuration'][_0x7b50('0x123')](db[_0x7b50('0xbe')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1c4')});db[_0x7b50('0xc0')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':'Subject','foreignKey':_0x7b50('0x1ca')});db[_0x7b50('0xc0')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':_0x7b50('0x1cb'),'foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xc0')][_0x7b50('0x113')](db[_0x7b50('0xc0')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field'][_0x7b50('0x123')](db[_0x7b50('0x8d')],{'as':_0x7b50('0x8d'),'foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xc2')][_0x7b50('0x113')](db['FreshsalesConfiguration'],{'as':_0x7b50('0x1c3'),'onDelete':_0x7b50('0x117'),'foreignKey':'AccountId'});db[_0x7b50('0xc4')][_0x7b50('0x113')](db[_0x7b50('0xc6')],{'as':_0x7b50('0x1c5'),'foreignKey':_0x7b50('0x1ca')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xc4')][_0x7b50('0x113')](db[_0x7b50('0xc6')],{'as':_0x7b50('0x1c0'),'foreignKey':_0x7b50('0x1c8')});db['FreshsalesConfiguration'][_0x7b50('0x123')](db[_0x7b50('0xc2')],{'as':_0x7b50('0x17e'),'foreignKey':'AccountId'});db[_0x7b50('0xc6')]['hasMany'](db['FreshsalesField'],{'as':_0x7b50('0x1c9'),'foreignKey':'SubjectId'});db[_0x7b50('0xc6')][_0x7b50('0x113')](db[_0x7b50('0xc6')],{'as':'Description','foreignKey':_0x7b50('0x1c7')});db[_0x7b50('0xc6')][_0x7b50('0x113')](db['FreshsalesField'],{'as':_0x7b50('0x1cc'),'foreignKey':'FieldId'});db[_0x7b50('0xc6')]['belongsTo'](db[_0x7b50('0x8d')],{'as':'Variable','foreignKey':_0x7b50('0x1ce')});db[_0x7b50('0xca')]['belongsTo'](db[_0x7b50('0x13f')],{});db['ChatQueueReport'][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xca')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db[_0x7b50('0xca')][_0x7b50('0x123')](db['ChatInteraction'],{});db[_0x7b50('0xca')][_0x7b50('0x123')](db['ChatMessage'],{});db[_0x7b50('0xca')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db[_0x7b50('0xca')]['belongsTo'](db[_0x7b50('0x65')],{});db[_0x7b50('0xcc')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1d9')});db[_0x7b50('0xcc')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x117'),'foreignKey':_0x7b50('0x1da')});db['JscriptySessionReport'][_0x7b50('0x113')](db[_0x7b50('0xcf')],{'foreignKey':_0x7b50('0x1db'),'onDelete':_0x7b50('0x117')});db['JscriptySessionReport'][_0x7b50('0x113')](db[_0x7b50('0x1dc')],{'foreignKey':_0x7b50('0x1db'),'onDelete':_0x7b50('0x117')});db['SmsQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x4e')],{});db['SmsQueueReport'][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xd2')][_0x7b50('0x123')](db['CmContact'],{'as':_0x7b50('0x164'),'foreignKey':'ContactId'});db[_0x7b50('0xd2')][_0x7b50('0x123')](db['SmsInteraction'],{});db[_0x7b50('0xd2')][_0x7b50('0x123')](db['SmsMessage'],{});db[_0x7b50('0xd2')]['belongsTo'](db['User'],{});db[_0x7b50('0xd2')][_0x7b50('0x123')](db[_0x7b50('0x52')],{});db[_0x7b50('0xd6')][_0x7b50('0x113')](db[_0x7b50('0xd0')],{'foreignKey':_0x7b50('0x1dd')});db[_0x7b50('0xd6')][_0x7b50('0x113')](db[_0x7b50('0xcf')],{'foreignKey':_0x7b50('0x1dd')});db[_0x7b50('0xd6')][_0x7b50('0x113')](db[_0x7b50('0x1dc')],{'foreignKey':_0x7b50('0x1dd')});db['Team'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x129')});db[_0x7b50('0xdf')][_0x7b50('0x126')](db[_0x7b50('0x133')],{'through':_0x7b50('0x10a'),'as':_0x7b50('0x134')});db[_0x7b50('0xdf')]['belongsToMany'](db[_0x7b50('0x39')],{'through':_0x7b50('0x174'),'as':_0x7b50('0x136')});db[_0x7b50('0xdf')]['belongsToMany'](db[_0x7b50('0x65')],{'through':'team_has_chat_queues','as':_0x7b50('0x137')});db[_0x7b50('0xdf')][_0x7b50('0x126')](db['FaxQueue'],{'through':_0x7b50('0x18c'),'as':_0x7b50('0x139')});db[_0x7b50('0xdf')][_0x7b50('0x126')](db[_0x7b50('0x52')],{'through':_0x7b50('0x194'),'as':'SmsQueues'});db['Team'][_0x7b50('0x126')](db['OpenchannelQueue'],{'through':_0x7b50('0x19b'),'as':_0x7b50('0x13c')});db['Team'][_0x7b50('0x126')](db[_0x7b50('0x106')],{'through':_0x7b50('0x1de'),'as':'WhatsappQueues'});db[_0x7b50('0xdf')][_0x7b50('0x126')](db[_0x7b50('0xf4')],{'through':_0x7b50('0x1df'),'as':_0x7b50('0x135')});db[_0x7b50('0xe2')]['hasMany'](db[_0x7b50('0x6f')],{'as':_0x7b50('0x152'),'foreignKey':'CampaignId'});db[_0x7b50('0xe2')][_0x7b50('0x113')](db[_0x7b50('0x72')],{'as':'HopperFinals','foreignKey':_0x7b50('0x1aa')});db[_0x7b50('0xe2')]['hasMany'](db['CmHopperHistory'],{'as':_0x7b50('0x153'),'foreignKey':_0x7b50('0x1aa')});db[_0x7b50('0xe2')][_0x7b50('0x113')](db[_0x7b50('0x70')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign'][_0x7b50('0x123')](db[_0x7b50('0x25')],{'as':_0x7b50('0x25'),'foreignKey':_0x7b50('0x1e0')});db['Campaign'][_0x7b50('0x123')](db[_0x7b50('0x25')],{'as':_0x7b50('0x155'),'foreignKey':_0x7b50('0x156')});db[_0x7b50('0xe2')][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'as':_0x7b50('0x7b'),'foreignKey':'IntervalId'});db[_0x7b50('0xe2')][_0x7b50('0x123')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x7b50('0xe2')]['belongsToMany'](db[_0x7b50('0xf2')],{'as':_0x7b50('0x1e1'),'through':_0x7b50('0x1e2')});db[_0x7b50('0xe2')]['belongsToMany'](db[_0x7b50('0xf2')],{'as':_0x7b50('0x15b'),'through':_0x7b50('0x1e3')});db[_0x7b50('0xe5')][_0x7b50('0x123')](db['ChatOfflineMessage'],{'as':_0x7b50('0x180'),'foreignKey':_0x7b50('0x1a2')});db['MailTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x3e')],{});db[_0x7b50('0xe9')]['belongsTo'](db['MailInteraction'],{});db[_0x7b50('0xe9')][_0x7b50('0x123')](db[_0x7b50('0x37')],{'foreignKey':_0x7b50('0x1e4'),'as':_0x7b50('0x1e5')});db[_0x7b50('0xe9')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0xe9')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':'ToAgent'});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x7b50('0x1e8')});db[_0x7b50('0xe9')]['belongsTo'](db[_0x7b50('0x37')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0x62')],{});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0x12c')],{});db[_0x7b50('0xea')][_0x7b50('0x123')](db['ChatWebsite'],{'foreignKey':_0x7b50('0x1e9'),'as':'FromAccount'});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db['ChatTransferReport'][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':'ToAgent'});db[_0x7b50('0xea')]['belongsTo'](db[_0x7b50('0x65')],{'foreignKey':_0x7b50('0x1ea'),'as':'ToQueue'});db[_0x7b50('0xea')][_0x7b50('0x123')](db[_0x7b50('0x13f')],{'foreignKey':_0x7b50('0x1eb'),'as':_0x7b50('0x1ec')});db[_0x7b50('0xec')][_0x7b50('0x123')](db['FaxMessage'],{});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0x12e')],{});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0x184')],{'foreignKey':_0x7b50('0x1ed'),'as':_0x7b50('0x1e5')});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0xec')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':_0x7b50('0x1ee')});db['FaxTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x4a')],{'foreignKey':_0x7b50('0x1ef'),'as':'ToQueue'});db[_0x7b50('0xec')][_0x7b50('0x123')](db['FaxAccount'],{'foreignKey':_0x7b50('0x1f0'),'as':_0x7b50('0x1ec')});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0x198')],{});db['OpenchannelTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x57')],{});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0x195')],{'foreignKey':_0x7b50('0x1f1'),'as':'FromAccount'});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':_0x7b50('0x1f2')});db[_0x7b50('0xee')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e7'),'as':'ToAgent'});db[_0x7b50('0xee')][_0x7b50('0x123')](db['OpenchannelQueue'],{'foreignKey':_0x7b50('0x1f3'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x7b50('0x123')](db['OpenchannelAccount'],{'foreignKey':_0x7b50('0x1f4'),'as':_0x7b50('0x1ec')});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0x18e')],{});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0x50')],{});db[_0x7b50('0xf0')][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'foreignKey':_0x7b50('0x1f5'),'as':_0x7b50('0x1e5')});db[_0x7b50('0xf0')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x7b50('0xf0')]['belongsTo'](db[_0x7b50('0x52')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x4e')],{'foreignKey':_0x7b50('0x1f6'),'as':_0x7b50('0x1ec')});db['CmList']['hasMany'](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x16f'),'onDelete':_0x7b50('0x117')});db[_0x7b50('0xf2')][_0x7b50('0x113')](db['CmCustomField'],{'as':_0x7b50('0x1f7'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xf2')][_0x7b50('0x113')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x1f8'),'onDelete':_0x7b50('0x117'),'foreignKey':'ListId'});db['CmList'][_0x7b50('0x113')](db['CmHopperFinal'],{'as':_0x7b50('0x118'),'foreignKey':'ListId'});db[_0x7b50('0xf2')]['hasMany'](db[_0x7b50('0x119')],{'as':_0x7b50('0x11a'),'foreignKey':'ListId'});db[_0x7b50('0xf2')][_0x7b50('0x113')](db[_0x7b50('0x74')],{'as':_0x7b50('0x74'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xf2')][_0x7b50('0x126')](db[_0x7b50('0x133')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x7b50('0xf2')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x128')});db[_0x7b50('0xf4')][_0x7b50('0x113')](db[_0x7b50('0x15')],{'as':'Extensions','onDelete':_0x7b50('0x117')});db[_0x7b50('0xf4')]['belongsToMany'](db['User'],{'as':_0x7b50('0x159'),'through':_0x7b50('0x10c')});db[_0x7b50('0xf4')]['belongsToMany'](db['Team'],{'through':_0x7b50('0x1df'),'as':_0x7b50('0x15a')});db[_0x7b50('0xf6')][_0x7b50('0x113')](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'foreignKey':_0x7b50('0x1f9')});db[_0x7b50('0xf6')][_0x7b50('0x113')](db[_0x7b50('0xf8')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x7b50('0x117')});db[_0x7b50('0xf8')][_0x7b50('0x113')](db[_0x7b50('0x1fa')],{'as':'Resources','foreignKey':_0x7b50('0x1fb'),'onDelete':'cascade'});db[_0x7b50('0xfb')][_0x7b50('0x113')](db[_0x7b50('0x78')],{'as':_0x7b50('0x16b'),'foreignKey':_0x7b50('0x1fc'),'onDelete':'cascade'});db[_0x7b50('0xfb')][_0x7b50('0x113')](db[_0x7b50('0x16c')],{'as':_0x7b50('0x16d'),'foreignKey':_0x7b50('0x1fc')});db['WhatsappAccount'][_0x7b50('0x113')](db[_0x7b50('0x100')],{'as':_0x7b50('0x15e'),'foreignKey':_0x7b50('0x1fc')});db[_0x7b50('0xfb')][_0x7b50('0x113')](db[_0x7b50('0x130')],{'as':'Interactions'});db[_0x7b50('0xfb')]['hasMany'](db[_0x7b50('0xfd')],{'as':_0x7b50('0x14c')});db[_0x7b50('0xfb')][_0x7b50('0x123')](db[_0x7b50('0xf2')],{'as':'List','foreignKey':_0x7b50('0x16f')});db[_0x7b50('0xfb')][_0x7b50('0x123')](db['Pause'],{'as':_0x7b50('0x172'),'foreignKey':_0x7b50('0x157')});db[_0x7b50('0xfb')]['belongsToMany'](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x14a')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db['WhatsappQueue'],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db['WhatsappAccount'],{'onDelete':_0x7b50('0x167')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db[_0x7b50('0x7b')],{'onDelete':_0x7b50('0x167'),'foreignKey':_0x7b50('0x181')});db[_0x7b50('0xfd')][_0x7b50('0x123')](db[_0x7b50('0x177')],{'onDelete':'restrict','foreignKey':_0x7b50('0x182')});db[_0x7b50('0x130')][_0x7b50('0x113')](db[_0x7b50('0x100')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7b50('0x1fd')});db[_0x7b50('0x130')][_0x7b50('0x123')](db['WhatsappAccount'],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1fc')});db['WhatsappInteraction'][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':'Contact','foreignKey':_0x7b50('0x165')});db[_0x7b50('0x130')][_0x7b50('0x123')](db['User'],{'as':_0x7b50('0x176'),'foreignKey':_0x7b50('0x111')});db['WhatsappInteraction'][_0x7b50('0x126')](db[_0x7b50('0x177')],{'through':'whatsapp_interaction_has_tags','as':_0x7b50('0x179')});db[_0x7b50('0x130')][_0x7b50('0x126')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x17b'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x7b50('0x100')][_0x7b50('0x123')](db['User'],{'as':'User'});db['WhatsappMessage'][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0x7b50('0x123')](db['WhatsappInteraction'],{'onDelete':_0x7b50('0x117'),'as':_0x7b50('0x17d'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x7b50('0x123')](db[_0x7b50('0xfb')],{'as':_0x7b50('0x17e'),'foreignKey':_0x7b50('0x1fc')});db['WhatsappQueueReport']['belongsTo'](db[_0x7b50('0xfb')],{});db[_0x7b50('0x102')]['belongsTo'](db['CmList'],{'as':_0x7b50('0x16e'),'foreignKey':_0x7b50('0x16f')});db[_0x7b50('0x102')][_0x7b50('0x123')](db[_0x7b50('0x6d')],{'as':_0x7b50('0x164'),'foreignKey':_0x7b50('0x165')});db['WhatsappQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x130')],{});db['WhatsappQueueReport'][_0x7b50('0x123')](db[_0x7b50('0x106')],{});db[_0x7b50('0x102')][_0x7b50('0x123')](db[_0x7b50('0x100')],{});db[_0x7b50('0x102')][_0x7b50('0x123')](db[_0x7b50('0xf')],{});db[_0x7b50('0x104')][_0x7b50('0x123')](db[_0x7b50('0x100')],{});db[_0x7b50('0x104')][_0x7b50('0x123')](db[_0x7b50('0x130')],{});db[_0x7b50('0x104')][_0x7b50('0x123')](db[_0x7b50('0xfb')],{'foreignKey':_0x7b50('0x1fe'),'as':_0x7b50('0x1e5')});db[_0x7b50('0x104')][_0x7b50('0x123')](db['WhatsappAccount'],{'foreignKey':_0x7b50('0x1ff'),'as':_0x7b50('0x1ec')});db['WhatsappTransferReport'][_0x7b50('0x123')](db[_0x7b50('0x106')],{'foreignKey':_0x7b50('0x200'),'as':_0x7b50('0x1e8')});db[_0x7b50('0x104')]['belongsTo'](db[_0x7b50('0xf')],{'foreignKey':_0x7b50('0x1e6'),'as':'FromAgent'});db[_0x7b50('0x104')]['belongsTo'](db[_0x7b50('0xf')],{'foreignKey':'ToUserId','as':_0x7b50('0x1ee')});db[_0x7b50('0x106')][_0x7b50('0x126')](db[_0x7b50('0xf')],{'as':_0x7b50('0x159'),'through':_0x7b50('0x13e'),'foreignKey':_0x7b50('0x201')});db[_0x7b50('0x106')]['belongsToMany'](db[_0x7b50('0xdf')],{'through':_0x7b50('0x1de'),'as':_0x7b50('0x15a')});db[_0x7b50('0x10e')][_0x7b50('0x123')](db[_0x7b50('0xf')],{'as':_0x7b50('0x202'),'foreignKey':_0x7b50('0x111'),'onDelete':_0x7b50('0x117'),'hooks':!![]});db[_0x7b50('0x108')][_0x7b50('0x110')](db[_0x7b50('0xbe')],{'as':_0x7b50('0xbe'),'onDelete':_0x7b50('0x167')});db[_0x7b50('0x108')][_0x7b50('0x110')](db[_0x7b50('0x33')],{'as':_0x7b50('0x169'),'onDelete':'restrict'});db[_0x7b50('0x108')]['hasOne'](db['MailServerOut'],{'as':_0x7b50('0x16a'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x1e64=['../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','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','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','DeskAccount','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/migration/migration.model','Attachment','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappQueue/whatsappQueue.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','cascade','userSetting','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','Groups','chat_group_has_users','belongsToMany','CmContact','Contacts','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','Sounds','VoiceQueueId','CmHopper','Hoppers','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','Imap','CannedAnswer','Answers','Messages','TemplateId','mandatoryDispositionPause','team_has_mail_queues','Teams','MailInteractionId','Owner','mail_interaction_has_tags','Tags','Users','user_has_mail_interactions','Interaction','Account','ChatWebsiteId','restrict','IntervalId','ListId','Items','Dispositions','FaxAccountId','Interactions','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','List','SmsAccountId','TagId','sms_interaction_has_tags','ThroughTags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteraction','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Agent','Queue','Website','chat_interaction_has_tags','ChatInteractionId','Attachments','UserChatQueue','team_has_chat_queues','ChatGroupId','Members','Phones','CmContactId','CmCompany','Company','cm_contact_has_tags','CmHopperId','CampaignId','OwnerId','Automation','All','OneAll','Any','OneAny','Action','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Sound','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemTypeId','Hopper','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmConfiguration','Subjects','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZendeskConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ToId','ProjectId','ChatQueues','VoicePrefixes','SquareProject','SquareProjectId','Lists','BlackLists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','FromChatWebsiteId','FromUserId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','user_has_whatsapp_interactions','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','user','exports','../config/environment','lodash','jstz','determine','sequelize','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','xcall','utf8mb4','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model'];(function(_0x193abd,_0x277730){var _0x51a59e=function(_0x14654b){while(--_0x14654b){_0x193abd['push'](_0x193abd['shift']());}};_0x51a59e(++_0x277730);}(_0x1e64,0x1bd));var _0x41e6=function(_0x10288b,_0x4e92e0){_0x10288b=_0x10288b-0x0;var _0x34a09b=_0x1e64[_0x10288b];return _0x34a09b;};'use strict';var config=require(_0x41e6('0x0'));var Sequelize=require('sequelize');var _=require(_0x41e6('0x1'));var jstz=require(_0x41e6('0x2'));var timezone=jstz[_0x41e6('0x3')]();config['sequelize']=_['defaultsDeep'](config[_0x41e6('0x4')],{'database':_0x41e6('0x5'),'username':'xcall','password':_0x41e6('0x6'),'options':{'host':_0x41e6('0x7'),'port':0xcea,'dialect':_0x41e6('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x41e6('0x9')](),'define':{'charset':_0x41e6('0xa'),'collate':_0x41e6('0xb')}}});config[_0x41e6('0xc')]=_[_0x41e6('0xd')](config[_0x41e6('0xc')],{'database':_0x41e6('0x5'),'username':_0x41e6('0xe'),'password':'xC@LL1234','options':{'host':_0x41e6('0x7'),'port':0xcea,'dialect':_0x41e6('0x8'),'dialectOptions':{'charset':_0x41e6('0xf')},'logging':![],'timezone':timezone[_0x41e6('0x9')](),'define':{'charset':_0x41e6('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x41e6('0x10')],config['sequelize']['username'],config[_0x41e6('0x4')][_0x41e6('0x11')],config[_0x41e6('0x4')][_0x41e6('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x41e6('0xc')][_0x41e6('0x10')],config[_0x41e6('0xc')][_0x41e6('0x13')],config[_0x41e6('0xc')][_0x41e6('0x11')],config['sequelizeHistory'][_0x41e6('0x12')])};db[_0x41e6('0x14')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x16'));db[_0x41e6('0x17')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x18'));db['VoiceContext']=db[_0x41e6('0x4')]['import']('../api/voiceContext/voiceContext.model');db[_0x41e6('0x19')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x41e6('0x4')]['import'](_0x41e6('0x1a'));db[_0x41e6('0x1b')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x1c'));db[_0x41e6('0x1d')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x1e'));db[_0x41e6('0x1f')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x20'));db['VoiceMail']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x21'));db['VoiceMailMessage']=db[_0x41e6('0x4')]['import'](_0x41e6('0x22'));db[_0x41e6('0x23')]=db['sequelize'][_0x41e6('0x15')]('../api/voiceCallReport/voiceCallReport.model');db[_0x41e6('0x24')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x25'));db[_0x41e6('0x26')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x27'));db['VoiceQueueReport']=db[_0x41e6('0x4')]['import'](_0x41e6('0x28'));db[_0x41e6('0x29')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x2a'));db[_0x41e6('0x2b')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x2c'));db[_0x41e6('0x2d')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x2e'));db['UserVoiceQueueRt']=db[_0x41e6('0x4')]['import'](_0x41e6('0x2f'));db[_0x41e6('0x30')]=db['sequelize'][_0x41e6('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x31'));db[_0x41e6('0x32')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x33'));db[_0x41e6('0x34')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0x41e6('0x35')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x36'));db[_0x41e6('0x37')]=db[_0x41e6('0x4')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize'][_0x41e6('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x41e6('0x38')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x39'));db[_0x41e6('0x3a')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x3b'));db[_0x41e6('0x3c')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/mailAccount/mailAccount.model');db[_0x41e6('0x3d')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x3e'));db['MailSubstatus']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x3f'));db[_0x41e6('0x40')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x41'));db[_0x41e6('0x42')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x43'));db[_0x41e6('0x44')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x45'));db[_0x41e6('0x46')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x47'));db[_0x41e6('0x48')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x49'));db[_0x41e6('0x4a')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x4b'));db['FaxAccount']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x4c'));db[_0x41e6('0x4d')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x4e'));db[_0x41e6('0x4f')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x50'));db[_0x41e6('0x51')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x52'));db['FaxQueue']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/faxQueue/faxQueue.model');db[_0x41e6('0x53')]=db['sequelize'][_0x41e6('0x15')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/smsAccount/smsAccount.model');db[_0x41e6('0x54')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x55'));db[_0x41e6('0x56')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0x41e6('0x57')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x58'));db[_0x41e6('0x59')]=db['sequelize']['import']('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0x41e6('0x5a')]=db[_0x41e6('0x4')]['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x5b'));db[_0x41e6('0x5c')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x5d'));db['OpenchannelQueue']=db['sequelize']['import'](_0x41e6('0x5e'));db[_0x41e6('0x5f')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x60'));db['OpenchannelQueueReport']=db[_0x41e6('0x4')]['import'](_0x41e6('0x61'));db[_0x41e6('0x62')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x63'));db[_0x41e6('0x64')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x65'));db[_0x41e6('0x66')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x67'));db[_0x41e6('0x68')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x69'));db[_0x41e6('0x6a')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x6b'));db[_0x41e6('0x6c')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x6d'));db[_0x41e6('0x6e')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x6f'));db['CmCompany']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x70'));db['CmContact']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x71'));db['CmHopper']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x72'));db['CmHopperBlack']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x41e6('0x73')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x74'));db[_0x41e6('0x75')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x76'));db[_0x41e6('0x77')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x41e6('0x78')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/cmCustomField/cmCustomField.model');db['Action']=db['sequelize'][_0x41e6('0x15')]('../api/action/action.model');db['Automation']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x79'));db['CannedAnswer']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x7a'));db[_0x41e6('0x7b')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x7c'));db[_0x41e6('0x7d')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x7e'));db['Interval']=db['sequelize']['import'](_0x41e6('0x7f'));db[_0x41e6('0x80')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x81'));db['Cdr']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x82'));db[_0x41e6('0x83')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x41e6('0x84')]=db['sequelize'][_0x41e6('0x15')]('../api/schedule/schedule.model');db['Sound']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/sound/sound.model');db[_0x41e6('0x85')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x86'));db[_0x41e6('0x87')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x88'));db[_0x41e6('0x89')]=db['sequelize']['import'](_0x41e6('0x8a'));db[_0x41e6('0x8b')]=db['sequelize']['import'](_0x41e6('0x8c'));db[_0x41e6('0x8d')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x8e'));db[_0x41e6('0x8f')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/trigger/trigger.model');db[_0x41e6('0x90')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x91'));db[_0x41e6('0x92')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x93'));db[_0x41e6('0x94')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/integrationReport/integrationReport.model');db[_0x41e6('0x95')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x96'));db[_0x41e6('0x97')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x98'));db['AnalyticExtractedReport']=db[_0x41e6('0x4')]['import'](_0x41e6('0x99'));db[_0x41e6('0x9a')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x9b'));db[_0x41e6('0x9c')]=db['sequelize']['import'](_0x41e6('0x9d'));db[_0x41e6('0x9e')]=db[_0x41e6('0x4')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x41e6('0x9f')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x41e6('0xa0')]=db[_0x41e6('0x4')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x41e6('0xa1')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xa2'));db[_0x41e6('0xa3')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xa4'));db['SugarcrmConfiguration']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x41e6('0xa5')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x41e6('0xa6')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x41e6('0x4')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xa7'));db[_0x41e6('0xa8')]=db['sequelize'][_0x41e6('0x15')]('../api/intZohoAccount/intZohoAccount.model');db[_0x41e6('0xa9')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xaa'));db[_0x41e6('0xab')]=db[_0x41e6('0x4')]['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xac'));db['ZendeskConfiguration']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xad'));db[_0x41e6('0xae')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xaf'));db[_0x41e6('0xb0')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xb1'));db[_0x41e6('0xb2')]=db['sequelize'][_0x41e6('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x41e6('0xb3')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xb4'));db[_0x41e6('0xb5')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xb6'));db['VtigerConfiguration']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xb7'));db[_0x41e6('0xb8')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xb9'));db[_0x41e6('0xba')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xbb'));db[_0x41e6('0xbc')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xbd'));db[_0x41e6('0xbe')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xbf'));db[_0x41e6('0xc0')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x41e6('0xc1')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xc2'));db[_0x41e6('0xc3')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xc4'));db[_0x41e6('0xc5')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xc6'));db[_0x41e6('0xc7')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xc8'));db[_0x41e6('0xc9')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xca'));db[_0x41e6('0x92')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x93'));db['Network']=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xcb'));db[_0x41e6('0xcc')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xcd'));db[_0x41e6('0xce')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xcf'));db[_0x41e6('0xd0')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xd1'));db[_0x41e6('0xd2')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xd3'));db[_0x41e6('0xd4')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xd5'));db[_0x41e6('0xd6')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xd7'));db[_0x41e6('0xd8')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xd9'));db[_0x41e6('0xda')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xdb'));db[_0x41e6('0xdc')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xdd'));db[_0x41e6('0xde')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xdf'));db['SquareOdbc']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xe0'));db['SquareProject']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xe1'));db[_0x41e6('0xe2')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xe3'));db[_0x41e6('0xe4')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xe5'));db[_0x41e6('0xe6')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xe7'));db[_0x41e6('0xe8')]=db[_0x41e6('0x4')]['import']('../api/license/license.model');db[_0x41e6('0xe9')]=db['sequelize'][_0x41e6('0x15')]('../api/campaign/campaign.model');db['Migration']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xea'));db[_0x41e6('0xeb')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/attachment/attachment.model');db['Plugin']=db['sequelize'][_0x41e6('0x15')]('../api/plugin/plugin.model');db[_0x41e6('0xec')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xed'));db[_0x41e6('0xee')]=db[_0x41e6('0x4')]['import'](_0x41e6('0xef'));db[_0x41e6('0xf0')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x41e6('0xf1')]=db['sequelize']['import'](_0x41e6('0xf2'));db[_0x41e6('0xf3')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xf4'));db[_0x41e6('0xf5')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xf6'));db[_0x41e6('0xf7')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xf8'));db[_0x41e6('0xf9')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0xfa'));db[_0x41e6('0xfb')]=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db['sequelize']['import']('../api/userProfileResource/userProfileResource.model');db[_0x41e6('0xfc')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0xfd'));db[_0x41e6('0xfe')]=db[_0x41e6('0x4')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x41e6('0xff')]=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x100'));db['WhatsappInteraction']=db[_0x41e6('0x4')]['import'](_0x41e6('0x101'));db[_0x41e6('0x102')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x103'));db['WhatsappQueueReport']=db[_0x41e6('0x4')][_0x41e6('0x15')](_0x41e6('0x104'));db[_0x41e6('0x105')]=db[_0x41e6('0x4')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0x41e6('0x4')]['import'](_0x41e6('0x106'));db['CloudProvider']=db[_0x41e6('0x4')][_0x41e6('0x15')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x41e6('0x4')]['import'](_0x41e6('0x107'));db[_0x41e6('0x108')]=db[_0x41e6('0x4')]['import'](_0x41e6('0x109'));db[_0x41e6('0x10a')]=db['sequelize'][_0x41e6('0x15')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x41e6('0x10b')]=db['sequelize'][_0x41e6('0x15')](_0x41e6('0x10c'));db['User'][_0x41e6('0x10d')](db[_0x41e6('0x10e')],{'as':_0x41e6('0x10e'),'onDelete':_0x41e6('0x10f'),'foreignKey':'UserId'});db['User']['hasOne'](db[_0x41e6('0x10b')],{'as':_0x41e6('0x110'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x1d')],{'as':_0x41e6('0x113'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x114')],{'as':_0x41e6('0x115'),'foreignKey':_0x41e6('0x111')});db['User']['hasMany'](db[_0x41e6('0x19')],{'as':_0x41e6('0x116'),'onDelete':'cascade','hooks':!![]});db[_0x41e6('0x14')][_0x41e6('0x112')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x75')],{'as':_0x41e6('0x117'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x77')],{'as':'ReportAgentPreview','foreignKey':_0x41e6('0x111')});db['User'][_0x41e6('0x112')](db['OpenchannelInteraction'],{'as':_0x41e6('0x118'),'foreignKey':'UserId'});db[_0x41e6('0x14')][_0x41e6('0x112')](db['ChatInteraction'],{'as':_0x41e6('0x119'),'foreignKey':'UserId'});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x56')],{'as':_0x41e6('0x11a'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x4f')],{'as':_0x41e6('0x11b'),'foreignKey':_0x41e6('0x111')});db['User']['hasMany'](db[_0x41e6('0x40')],{'as':_0x41e6('0x11c'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0x11d')],{'as':_0x41e6('0x11e'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x14')][_0x41e6('0x112')](db[_0x41e6('0xfc')],{'as':'UserNotifications','foreignKey':_0x41e6('0x11f')});db[_0x41e6('0x14')]['belongsTo'](db[_0x41e6('0xf9')],{'as':_0x41e6('0xf9'),'foreignKey':'userProfileId'});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x6c')],{'as':_0x41e6('0x120'),'through':_0x41e6('0x121')});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x123')],{'as':_0x41e6('0x124'),'through':'cm_user_has_contacts'});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0xf5')],{'as':'Lists','through':'cm_user_has_lists'});db['User'][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x125')});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x40')],{'as':_0x41e6('0x11c'),'through':'user_has_mail_interactions'});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x64')],{'as':_0x41e6('0x119'),'through':_0x41e6('0x126')});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x4f')],{'as':_0x41e6('0x11b'),'through':_0x41e6('0x127')});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x56')],{'as':_0x41e6('0x11a'),'through':_0x41e6('0x128')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':_0x41e6('0x118'),'through':_0x41e6('0x129')});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x11d')],{'as':_0x41e6('0x11e'),'through':'user_has_whatsapp_interactions'});db[_0x41e6('0x14')][_0x41e6('0x122')](db['VoiceQueue'],{'as':_0x41e6('0x12a'),'through':_0x41e6('0x30'),'required':![]});db['User'][_0x41e6('0x122')](db[_0x41e6('0xf7')],{'as':'VoicePrefixes','through':_0x41e6('0x10a'),'required':![]});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x3d')],{'as':_0x41e6('0x12b'),'through':_0x41e6('0x32'),'required':![]});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x6a')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x12c')],{'as':_0x41e6('0x12d'),'through':_0x41e6('0x34'),'required':![]});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x59')],{'as':_0x41e6('0x12e'),'through':'UserSmsQueue','required':![]});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x12f')],{'as':_0x41e6('0x130'),'through':_0x41e6('0x37'),'required':![]});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x131')],{'as':_0x41e6('0x132'),'through':_0x41e6('0x133'),'required':![]});db[_0x41e6('0x14')][_0x41e6('0x122')](db['CmList'],{'through':_0x41e6('0x134')});db[_0x41e6('0x14')][_0x41e6('0x122')](db[_0x41e6('0x5f')],{'as':'ChatWebsites','through':_0x41e6('0x135')});db['User'][_0x41e6('0x122')](db[_0x41e6('0x136')],{'as':_0x41e6('0x137'),'through':'user_has_fax_accounts'});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0x3c')],{'as':_0x41e6('0x138'),'through':_0x41e6('0x139')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0x41e6('0x13a'),'through':_0x41e6('0x13b')});db['User'][_0x41e6('0x122')](db[_0x41e6('0x13c')],{'as':'SmsAccounts','through':_0x41e6('0x13d')});db[_0x41e6('0x14')]['belongsToMany'](db[_0x41e6('0xfe')],{'as':_0x41e6('0x13e'),'through':'user_has_whatsapp_accounts'});db[_0x41e6('0x17')][_0x41e6('0x112')](db[_0x41e6('0x19')],{'as':_0x41e6('0x13f'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x140')});db[_0x41e6('0x141')][_0x41e6('0x112')](db[_0x41e6('0x19')],{'onDelete':'cascade'});db[_0x41e6('0x19')][_0x41e6('0x112')](db[_0x41e6('0x19')],{'as':_0x41e6('0x142'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x143')][_0x41e6('0x122')](db['Sound'],{'as':_0x41e6('0x144'),'through':'moh_has_sounds'});db[_0x41e6('0x1b')][_0x41e6('0x112')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x41e6('0x145')});db['VoiceQueue'][_0x41e6('0x112')](db[_0x41e6('0x146')],{'as':_0x41e6('0x147'),'foreignKey':_0x41e6('0x145')});db[_0x41e6('0x1b')]['hasMany'](db[_0x41e6('0x73')],{'as':_0x41e6('0x148'),'foreignKey':_0x41e6('0x145')});db[_0x41e6('0x1b')][_0x41e6('0x112')](db['CmHopperHistory'],{'as':_0x41e6('0x149'),'foreignKey':_0x41e6('0x145')});db[_0x41e6('0x1b')]['hasMany'](db['ReportAgentPreview'],{'as':_0x41e6('0x77'),'foreignKey':'VoiceQueueId'});db[_0x41e6('0x1b')][_0x41e6('0x112')](db[_0x41e6('0x14a')],{'as':_0x41e6('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x41e6('0x1b')][_0x41e6('0x112')](db[_0x41e6('0xd4')],{'as':_0x41e6('0x14c'),'foreignKey':'VoiceQueueId'});db[_0x41e6('0x1b')][_0x41e6('0x14d')](db[_0x41e6('0x2b')],{'as':'Trunk','foreignKey':_0x41e6('0x14e')});db['VoiceQueue'][_0x41e6('0x14d')](db[_0x41e6('0x2b')],{'as':_0x41e6('0x14f'),'foreignKey':_0x41e6('0x150')});db[_0x41e6('0x1b')][_0x41e6('0x14d')](db[_0x41e6('0x151')],{'as':_0x41e6('0x151'),'foreignKey':'IntervalId'});db[_0x41e6('0x1b')][_0x41e6('0x14d')](db[_0x41e6('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x41e6('0x152')});db['VoiceQueue'][_0x41e6('0x122')](db['CmList'],{'as':'Lists','through':_0x41e6('0x153')});db[_0x41e6('0x1b')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':_0x41e6('0x30')});db[_0x41e6('0x1b')][_0x41e6('0x122')](db['Team'],{'as':'Teams','through':_0x41e6('0x155')});db['VoiceQueue']['belongsToMany'](db[_0x41e6('0xf5')],{'as':'BlackLists','through':_0x41e6('0x156')});db[_0x41e6('0x1d')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x14'),'foreignKey':_0x41e6('0x111')});db['ScreenRecording'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x14'),'foreignKey':'UserId'});db[_0x41e6('0x10e')][_0x41e6('0x112')](db[_0x41e6('0x157')],{'as':'Messages','onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x158'),'sourceKey':_0x41e6('0x159')});db[_0x41e6('0x157')][_0x41e6('0x14d')](db[_0x41e6('0x10e')],{'foreignKey':'mailboxuser','targetKey':_0x41e6('0x159')});db[_0x41e6('0x23')]['hasMany'](db[_0x41e6('0x15a')],{'as':_0x41e6('0x15b'),'foreignKey':'uniqueid','constraints':![]});db[_0x41e6('0x23')][_0x41e6('0x112')](db[_0x41e6('0x26')],{'as':'AgentReports','foreignKey':_0x41e6('0x15c'),'constraints':![]});db[_0x41e6('0x23')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x14'),'foreignKey':_0x41e6('0x111')});db['VoiceCallReport']['belongsTo'](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x38')]['belongsTo'](db[_0x41e6('0x3c')],{'as':_0x41e6('0x3c'),'foreignKey':_0x41e6('0x15f')});db[_0x41e6('0x38')]['belongsTo'](db[_0x41e6('0x160')],{'as':_0x41e6('0x160'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x41e6('0x3a')][_0x41e6('0x14d')](db[_0x41e6('0x3c')],{'as':_0x41e6('0x3c'),'foreignKey':_0x41e6('0x15f')});db[_0x41e6('0x3a')][_0x41e6('0x14d')](db[_0x41e6('0x160')],{'as':'CloudProvider','foreignKey':_0x41e6('0x161'),'onDelete':'restrict'});db[_0x41e6('0x3c')][_0x41e6('0x10d')](db[_0x41e6('0x38')],{'as':_0x41e6('0x162'),'onDelete':_0x41e6('0x10f')});db['MailAccount'][_0x41e6('0x10d')](db[_0x41e6('0x3a')],{'as':'Smtp','onDelete':_0x41e6('0x10f')});db[_0x41e6('0x3c')][_0x41e6('0x112')](db[_0x41e6('0x7b')],{'as':'Dispositions','foreignKey':_0x41e6('0x15f'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x3c')][_0x41e6('0x112')](db[_0x41e6('0x163')],{'as':_0x41e6('0x164'),'foreignKey':_0x41e6('0x15f')});db[_0x41e6('0x3c')]['hasMany'](db[_0x41e6('0x42')],{'as':_0x41e6('0x165'),'foreignKey':_0x41e6('0x15f')});db[_0x41e6('0x3c')]['hasMany'](db[_0x41e6('0x40')],{'as':'Interactions'});db[_0x41e6('0x3c')][_0x41e6('0x112')](db['MailApplication'],{'as':_0x41e6('0x142')});db['MailAccount'][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':'List','foreignKey':'ListId'});db['MailAccount'][_0x41e6('0x14d')](db[_0x41e6('0x8d')],{'as':_0x41e6('0x8d'),'foreignKey':_0x41e6('0x166')});db[_0x41e6('0x3c')]['belongsTo'](db[_0x41e6('0x80')],{'as':_0x41e6('0x167'),'foreignKey':_0x41e6('0x152')});db['MailAccount']['belongsToMany'](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0x41e6('0x32')});db[_0x41e6('0x3d')][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x168'),'as':_0x41e6('0x169')});db[_0x41e6('0x40')][_0x41e6('0x112')](db[_0x41e6('0x42')],{'as':_0x41e6('0x165'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x16a')});db[_0x41e6('0x40')][_0x41e6('0x14d')](db[_0x41e6('0x3c')],{'as':'Account','foreignKey':_0x41e6('0x15f')});db[_0x41e6('0x40')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x40')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16b'),'foreignKey':_0x41e6('0x111')});db['MailInteraction'][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':_0x41e6('0x16c'),'as':_0x41e6('0x16d')});db['MailInteraction'][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':_0x41e6('0x16c'),'as':'ThroughTags'});db[_0x41e6('0x40')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16e'),'through':_0x41e6('0x16f'),'foreignKey':_0x41e6('0x16a')});db[_0x41e6('0x42')][_0x41e6('0x112')](db[_0x41e6('0xeb')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0x41e6('0x14d')](db['User'],{'as':_0x41e6('0x14')});db[_0x41e6('0x42')][_0x41e6('0x14d')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['MailMessage']['belongsTo'](db[_0x41e6('0x40')],{'as':_0x41e6('0x170'),'foreignKey':_0x41e6('0x16a')});db[_0x41e6('0x42')][_0x41e6('0x14d')](db[_0x41e6('0x3c')],{'as':_0x41e6('0x171'),'foreignKey':'MailAccountId'});db[_0x41e6('0x42')][_0x41e6('0x14d')](db['ChatWebsite'],{'as':_0x41e6('0x5f'),'foreignKey':_0x41e6('0x172')});db['MailMessage'][_0x41e6('0x14d')](db[_0x41e6('0x68')],{'as':_0x41e6('0x68'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x41e6('0x14d')](db['User'],{'onDelete':_0x41e6('0x173')});db[_0x41e6('0x44')]['belongsTo'](db[_0x41e6('0x3d')],{'onDelete':'restrict'});db[_0x41e6('0x44')][_0x41e6('0x14d')](db[_0x41e6('0x3c')],{'onDelete':_0x41e6('0x173')});db['MailApplication'][_0x41e6('0x14d')](db[_0x41e6('0x151')],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x174')});db['MailApplication'][_0x41e6('0x14d')](db[_0x41e6('0x85')],{'onDelete':_0x41e6('0x173'),'foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db[_0x41e6('0x3c')],{});db[_0x41e6('0x46')][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':'List','foreignKey':_0x41e6('0x175')});db[_0x41e6('0x46')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x46')][_0x41e6('0x14d')](db[_0x41e6('0x40')],{});db[_0x41e6('0x46')][_0x41e6('0x14d')](db['MailMessage'],{});db['MailQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{});db[_0x41e6('0x46')][_0x41e6('0x14d')](db['MailQueue'],{});db[_0x41e6('0x48')][_0x41e6('0x112')](db[_0x41e6('0x4a')],{'as':_0x41e6('0x176'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x136')][_0x41e6('0x112')](db['Disposition'],{'as':_0x41e6('0x177'),'foreignKey':_0x41e6('0x178'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x136')][_0x41e6('0x112')](db[_0x41e6('0x163')],{'as':_0x41e6('0x164'),'foreignKey':_0x41e6('0x178')});db[_0x41e6('0x136')][_0x41e6('0x112')](db['FaxInteraction'],{'as':_0x41e6('0x179')});db[_0x41e6('0x136')][_0x41e6('0x112')](db['FaxApplication'],{'as':_0x41e6('0x142')});db[_0x41e6('0x136')]['hasMany'](db['VoiceExtension'],{'as':_0x41e6('0x17a'),'onDelete':'cascade'});db[_0x41e6('0x136')][_0x41e6('0x112')](db[_0x41e6('0x51')],{'as':_0x41e6('0x165')});db[_0x41e6('0x136')]['belongsTo'](db[_0x41e6('0x2b')],{'as':'Trunk'});db[_0x41e6('0x136')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x41e6('0x175')});db[_0x41e6('0x136')][_0x41e6('0x14d')](db[_0x41e6('0x80')],{'as':_0x41e6('0x167'),'foreignKey':_0x41e6('0x152')});db[_0x41e6('0x136')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':_0x41e6('0x17b')});db[_0x41e6('0x4d')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':'restrict'});db[_0x41e6('0x4d')][_0x41e6('0x14d')](db[_0x41e6('0x12c')],{'onDelete':_0x41e6('0x173')});db['FaxApplication'][_0x41e6('0x14d')](db[_0x41e6('0x136')],{'onDelete':_0x41e6('0x173')});db['FaxApplication'][_0x41e6('0x14d')](db[_0x41e6('0x85')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x41e6('0x4f')][_0x41e6('0x112')](db[_0x41e6('0x51')],{'as':_0x41e6('0x165'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x17c')});db[_0x41e6('0x4f')][_0x41e6('0x14d')](db['FaxAccount'],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x178')});db[_0x41e6('0x4f')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x4f')]['belongsTo'](db['User'],{'as':_0x41e6('0x16b'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x4f')][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':_0x41e6('0x17d'),'as':_0x41e6('0x16d')});db['FaxInteraction'][_0x41e6('0x122')](db['Tag'],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x41e6('0x4f')]['belongsToMany'](db[_0x41e6('0x14')],{'as':'Users','through':_0x41e6('0x127'),'foreignKey':'FaxInteractionId'});db[_0x41e6('0x51')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':'cascade','as':_0x41e6('0x14')});db[_0x41e6('0x51')][_0x41e6('0x14d')](db[_0x41e6('0x4f')],{'as':_0x41e6('0x170'),'foreignKey':_0x41e6('0x17c')});db[_0x41e6('0x51')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x15d')});db[_0x41e6('0x51')][_0x41e6('0x14d')](db[_0x41e6('0xeb')],{'as':_0x41e6('0xeb'),'foreignKey':'AttachmentId'});db[_0x41e6('0x51')][_0x41e6('0x14d')](db[_0x41e6('0x136')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x178')});db['FaxQueue']['belongsToMany'](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':_0x41e6('0x34')});db[_0x41e6('0x12c')][_0x41e6('0x122')](db['Team'],{'through':_0x41e6('0x17e'),'as':_0x41e6('0x169')});db['FaxQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x136')],{});db[_0x41e6('0x53')][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':_0x41e6('0x17f'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x41e6('0x14d')](db['CmContact'],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x53')][_0x41e6('0x14d')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x51')],{});db[_0x41e6('0x53')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{});db[_0x41e6('0x53')][_0x41e6('0x14d')](db[_0x41e6('0x12c')],{});db['SmsAccount'][_0x41e6('0x112')](db[_0x41e6('0x7b')],{'as':'Dispositions','foreignKey':_0x41e6('0x180'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x13c')][_0x41e6('0x112')](db[_0x41e6('0x163')],{'as':_0x41e6('0x164'),'foreignKey':'SmsAccountId'});db[_0x41e6('0x13c')][_0x41e6('0x112')](db[_0x41e6('0x57')],{'as':_0x41e6('0x165'),'foreignKey':_0x41e6('0x180')});db['SmsAccount']['hasMany'](db[_0x41e6('0x56')],{'as':_0x41e6('0x179')});db['SmsAccount'][_0x41e6('0x112')](db[_0x41e6('0x54')],{'as':_0x41e6('0x142')});db[_0x41e6('0x13c')][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':'List','foreignKey':'ListId'});db['SmsAccount'][_0x41e6('0x14d')](db[_0x41e6('0x80')],{'as':_0x41e6('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x41e6('0x13c')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':_0x41e6('0x13d')});db['SmsApplication'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':'restrict'});db[_0x41e6('0x54')][_0x41e6('0x14d')](db[_0x41e6('0x59')],{'onDelete':'restrict'});db[_0x41e6('0x54')]['belongsTo'](db[_0x41e6('0x13c')],{'onDelete':_0x41e6('0x173')});db[_0x41e6('0x54')][_0x41e6('0x14d')](db[_0x41e6('0x151')],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x174')});db[_0x41e6('0x54')][_0x41e6('0x14d')](db[_0x41e6('0x85')],{'onDelete':'restrict','foreignKey':_0x41e6('0x181')});db[_0x41e6('0x56')][_0x41e6('0x112')](db[_0x41e6('0x57')],{'as':_0x41e6('0x165'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x41e6('0x56')]['belongsTo'](db[_0x41e6('0x13c')],{'as':_0x41e6('0x171'),'foreignKey':'SmsAccountId'});db[_0x41e6('0x56')]['belongsTo'](db[_0x41e6('0x123')],{'as':'Contact','foreignKey':'ContactId'});db[_0x41e6('0x56')]['belongsTo'](db[_0x41e6('0x14')],{'as':_0x41e6('0x16b'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x56')][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':'sms_interaction_has_tags','as':_0x41e6('0x16d')});db[_0x41e6('0x56')][_0x41e6('0x122')](db['Tag'],{'through':_0x41e6('0x182'),'as':_0x41e6('0x183')});db[_0x41e6('0x56')][_0x41e6('0x122')](db['User'],{'as':_0x41e6('0x16e'),'through':_0x41e6('0x128'),'foreignKey':_0x41e6('0x184')});db[_0x41e6('0x57')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':'User'});db[_0x41e6('0x57')][_0x41e6('0x14d')](db['CmContact'],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x15d')});db[_0x41e6('0x57')][_0x41e6('0x14d')](db['SmsInteraction'],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x170'),'foreignKey':_0x41e6('0x184')});db[_0x41e6('0x57')]['belongsTo'](db[_0x41e6('0x13c')],{'as':'Account','foreignKey':_0x41e6('0x180')});db['SmsQueue'][_0x41e6('0x122')](db['User'],{'as':_0x41e6('0x154'),'through':_0x41e6('0x35'),'foreignKey':_0x41e6('0x185')});db[_0x41e6('0x59')][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x186'),'as':_0x41e6('0x169')});db[_0x41e6('0x187')][_0x41e6('0x112')](db[_0x41e6('0x7b')],{'as':_0x41e6('0x177'),'foreignKey':_0x41e6('0x188'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x187')]['hasMany'](db[_0x41e6('0x163')],{'as':_0x41e6('0x164'),'foreignKey':_0x41e6('0x188')});db[_0x41e6('0x187')][_0x41e6('0x112')](db['OpenchannelInteraction'],{'as':_0x41e6('0x179'),'foreignKey':_0x41e6('0x188')});db[_0x41e6('0x187')]['hasMany'](db[_0x41e6('0x5c')],{'as':_0x41e6('0x165'),'foreignKey':_0x41e6('0x188')});db[_0x41e6('0x187')][_0x41e6('0x112')](db[_0x41e6('0x5a')],{'as':'Applications','foreignKey':_0x41e6('0x188')});db[_0x41e6('0x187')]['belongsTo'](db['CmList'],{'as':_0x41e6('0x17f'),'foreignKey':_0x41e6('0x175')});db[_0x41e6('0x187')][_0x41e6('0x14d')](db[_0x41e6('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x41e6('0x152')});db[_0x41e6('0x187')][_0x41e6('0x122')](db['User'],{'as':'Agents','through':_0x41e6('0x13b')});db[_0x41e6('0x5a')][_0x41e6('0x14d')](db['User'],{'onDelete':_0x41e6('0x173')});db[_0x41e6('0x5a')][_0x41e6('0x14d')](db['OpenchannelQueue'],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x189')});db['OpenchannelApplication'][_0x41e6('0x14d')](db[_0x41e6('0x187')],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x188')});db[_0x41e6('0x5a')][_0x41e6('0x14d')](db[_0x41e6('0x151')],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x174')});db[_0x41e6('0x5a')][_0x41e6('0x14d')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x41e6('0x181')});db[_0x41e6('0x18a')][_0x41e6('0x112')](db[_0x41e6('0x5c')],{'as':_0x41e6('0x165'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x18b')});db[_0x41e6('0x18a')][_0x41e6('0x14d')](db[_0x41e6('0x187')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x188')});db[_0x41e6('0x18a')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db['OpenchannelInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x41e6('0x111')});db[_0x41e6('0x18a')][_0x41e6('0x122')](db['Tag'],{'through':_0x41e6('0x18c'),'as':_0x41e6('0x16d')});db[_0x41e6('0x18a')][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':'openchannel_interaction_has_tags','as':_0x41e6('0x183')});db[_0x41e6('0x18a')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16e'),'through':_0x41e6('0x129'),'foreignKey':_0x41e6('0x18b')});db[_0x41e6('0x5c')][_0x41e6('0x14d')](db['User'],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x14')});db[_0x41e6('0x5c')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'onDelete':'cascade','as':_0x41e6('0x15d')});db['OpenchannelMessage'][_0x41e6('0x14d')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x41e6('0x170'),'foreignKey':_0x41e6('0x18b')});db['OpenchannelMessage']['belongsTo'](db[_0x41e6('0xeb')],{'as':_0x41e6('0xeb'),'foreignKey':_0x41e6('0x18d')});db[_0x41e6('0x5c')]['belongsTo'](db[_0x41e6('0x187')],{'as':_0x41e6('0x171'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0x41e6('0x12f')][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x18e'),'as':'Teams'});db[_0x41e6('0x5f')][_0x41e6('0x112')](db['Disposition'],{'as':_0x41e6('0x177'),'foreignKey':_0x41e6('0x172'),'onDelete':_0x41e6('0x10f')});db['ChatWebsite'][_0x41e6('0x112')](db[_0x41e6('0x163')],{'as':_0x41e6('0x164'),'foreignKey':_0x41e6('0x172')});db[_0x41e6('0x5f')][_0x41e6('0x112')](db[_0x41e6('0x6e')],{'as':_0x41e6('0x18f')});db['ChatWebsite'][_0x41e6('0x112')](db[_0x41e6('0x64')],{'as':_0x41e6('0x179')});db[_0x41e6('0x5f')][_0x41e6('0x112')](db['ChatApplication'],{'as':_0x41e6('0x142')});db[_0x41e6('0x5f')][_0x41e6('0x112')](db[_0x41e6('0x66')],{'as':'Messages'});db[_0x41e6('0x5f')][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':_0x41e6('0x17f'),'foreignKey':_0x41e6('0x175')});db[_0x41e6('0x5f')][_0x41e6('0x14d')](db[_0x41e6('0x151')],{'as':_0x41e6('0x151'),'foreignKey':'IntervalId'});db[_0x41e6('0x5f')][_0x41e6('0x14d')](db[_0x41e6('0x3c')],{'as':_0x41e6('0x3c'),'foreignKey':_0x41e6('0x15f')});db[_0x41e6('0x5f')][_0x41e6('0x14d')](db[_0x41e6('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x41e6('0x152')});db[_0x41e6('0x5f')][_0x41e6('0x122')](db['User'],{'as':_0x41e6('0x154'),'through':_0x41e6('0x135')});db['OpenchannelQueueReport']['belongsTo'](db[_0x41e6('0x187')],{});db[_0x41e6('0x190')][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':'List','foreignKey':_0x41e6('0x175')});db[_0x41e6('0x190')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':'ContactId'});db[_0x41e6('0x190')]['belongsTo'](db[_0x41e6('0x18a')],{});db[_0x41e6('0x190')][_0x41e6('0x14d')](db[_0x41e6('0x5c')],{});db['OpenchannelQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{});db['OpenchannelQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x12f')],{});db['ChatApplication'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x191'),'foreignKey':_0x41e6('0x111'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x62')][_0x41e6('0x14d')](db['ChatQueue'],{'as':_0x41e6('0x192'),'foreignKey':'ChatQueueId','onDelete':_0x41e6('0x173')});db[_0x41e6('0x62')][_0x41e6('0x14d')](db[_0x41e6('0x5f')],{'as':_0x41e6('0x193'),'foreignKey':'ChatWebsiteId','onDelete':_0x41e6('0x173')});db[_0x41e6('0x62')][_0x41e6('0x14d')](db['Tag'],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x181')});db[_0x41e6('0x64')][_0x41e6('0x112')](db[_0x41e6('0x66')],{'as':'Messages','onDelete':_0x41e6('0x10f'),'foreignKey':'ChatInteractionId'});db[_0x41e6('0x64')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x41e6('0x172')});db[_0x41e6('0x64')][_0x41e6('0x14d')](db['CmContact'],{'as':'Contact','foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x64')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16b'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x64')][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':_0x41e6('0x194'),'as':_0x41e6('0x16d')});db[_0x41e6('0x64')][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':_0x41e6('0x194'),'as':_0x41e6('0x183')});db[_0x41e6('0x64')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':'Users','through':_0x41e6('0x126'),'foreignKey':_0x41e6('0x195')});db[_0x41e6('0x66')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x14')});db[_0x41e6('0x66')][_0x41e6('0x14d')](db['CmContact'],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x66')][_0x41e6('0x14d')](db[_0x41e6('0x64')],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x170'),'foreignKey':_0x41e6('0x195')});db[_0x41e6('0x66')][_0x41e6('0x14d')](db[_0x41e6('0xeb')],{'as':_0x41e6('0xeb'),'foreignKey':_0x41e6('0x18d')});db[_0x41e6('0x66')][_0x41e6('0x14d')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x41e6('0x172')});db['ChatOfflineMessage'][_0x41e6('0x112')](db[_0x41e6('0xeb')],{'as':_0x41e6('0x196'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db['ChatOfflineMessage'][_0x41e6('0x14d')](db[_0x41e6('0x5f')],{'as':'Account','foreignKey':_0x41e6('0x172')});db[_0x41e6('0x6a')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':'Agents','through':_0x41e6('0x197'),'hooks':!![]});db[_0x41e6('0x6a')][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x198'),'as':_0x41e6('0x169')});db[_0x41e6('0x6c')][_0x41e6('0x112')](db[_0x41e6('0xce')],{'as':_0x41e6('0x165'),'foreignKey':_0x41e6('0x199'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x6c')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x19a'),'through':_0x41e6('0x121')});db[_0x41e6('0x6e')][_0x41e6('0x14d')](db[_0x41e6('0x5f')],{'as':'Website','foreignKey':_0x41e6('0x172')});db['CmCompany'][_0x41e6('0x112')](db[_0x41e6('0x123')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0x41e6('0x112')](db['CmContactHasItem'],{'as':_0x41e6('0x19b'),'foreignKey':_0x41e6('0x19c')});db['CmContact']['hasMany'](db[_0x41e6('0x146')],{'as':_0x41e6('0x147'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x123')][_0x41e6('0x112')](db['CmHopperFinal'],{'as':_0x41e6('0x148'),'foreignKey':_0x41e6('0x15e')});db['CmContact']['hasMany'](db[_0x41e6('0x75')],{'as':'HopperHistories','foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x123')][_0x41e6('0x112')](db['ReportAgentPreview'],{'as':_0x41e6('0x77'),'foreignKey':_0x41e6('0x15e')});db['CmContact'][_0x41e6('0x112')](db[_0x41e6('0xd4')],{'as':_0x41e6('0x14c'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x123')][_0x41e6('0x112')](db[_0x41e6('0x18a')],{'as':_0x41e6('0x118'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x41e6('0x64')],{'as':_0x41e6('0x119'),'foreignKey':_0x41e6('0x15e'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x123')]['hasMany'](db[_0x41e6('0x56')],{'as':_0x41e6('0x11a'),'foreignKey':_0x41e6('0x15e'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x123')][_0x41e6('0x112')](db[_0x41e6('0x4f')],{'as':_0x41e6('0x11b'),'foreignKey':_0x41e6('0x15e'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x123')][_0x41e6('0x112')](db[_0x41e6('0x40')],{'as':_0x41e6('0x11c'),'foreignKey':_0x41e6('0x15e'),'onDelete':_0x41e6('0x173')});db['CmContact']['belongsTo'](db[_0x41e6('0x19d')],{'as':_0x41e6('0x19e'),'foreignKey':'CompanyId'});db[_0x41e6('0x123')]['belongsTo'](db[_0x41e6('0xf5')],{'as':'List','foreignKey':'ListId','onDelete':_0x41e6('0x10f')});db['CmContact'][_0x41e6('0x122')](db['User'],{'as':_0x41e6('0x16e'),'through':'cm_user_has_contacts'});db[_0x41e6('0x123')]['belongsToMany'](db[_0x41e6('0x85')],{'as':_0x41e6('0x16d'),'through':_0x41e6('0x19f')});db[_0x41e6('0x123')][_0x41e6('0x122')](db['Tag'],{'through':_0x41e6('0x19f'),'as':_0x41e6('0x183')});db[_0x41e6('0x146')][_0x41e6('0x112')](db[_0x41e6('0x8b')],{'as':'AdditionalPhones','foreignKey':_0x41e6('0x1a0')});db[_0x41e6('0x146')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':'Contact','foreignKey':_0x41e6('0x15e'),'onDelete':'cascade'});db[_0x41e6('0x146')][_0x41e6('0x14d')](db['CmList'],{'as':_0x41e6('0x17f'),'foreignKey':'ListId','onDelete':_0x41e6('0x10f')});db[_0x41e6('0x146')][_0x41e6('0x14d')](db['User'],{'as':'Agent','foreignKey':'UserId'});db['CmHopper'][_0x41e6('0x14d')](db[_0x41e6('0x1b')],{'as':_0x41e6('0x192'),'foreignKey':_0x41e6('0x145'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x146')][_0x41e6('0x14d')](db['Campaign'],{'as':_0x41e6('0xe9'),'foreignKey':_0x41e6('0x1a1'),'onDelete':_0x41e6('0x10f')});db['CmHopper'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16b'),'foreignKey':_0x41e6('0x1a2')});db['CmHopperBlack'][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':'ContactId','onDelete':_0x41e6('0x10f')});db['CmHopperBlack'][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':_0x41e6('0x17f'),'foreignKey':_0x41e6('0x175'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0x14a')]['belongsTo'](db[_0x41e6('0x1b')],{'as':_0x41e6('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x41e6('0x10f')});db['CmHopperBlack'][_0x41e6('0x14d')](db[_0x41e6('0xe9')],{'as':_0x41e6('0xe9'),'foreignKey':'CampaignId','onDelete':_0x41e6('0x10f')});db[_0x41e6('0x1a3')][_0x41e6('0x112')](db[_0x41e6('0x7d')],{'as':{'plural':_0x41e6('0x1a4'),'singular':_0x41e6('0x1a5')},'foreignKey':'AutomationAllId','onDelete':_0x41e6('0x10f'),'hooks':!![]});db[_0x41e6('0x1a3')][_0x41e6('0x112')](db[_0x41e6('0x7d')],{'as':{'plural':_0x41e6('0x1a6'),'singular':_0x41e6('0x1a7')},'foreignKey':'AutomationAnyId','onDelete':_0x41e6('0x10f'),'hooks':!![]});db[_0x41e6('0x1a3')][_0x41e6('0x112')](db[_0x41e6('0x1a8')],{'as':'Actions','foreignKey':_0x41e6('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0x41e6('0x7b')][_0x41e6('0x112')](db[_0x41e6('0x7b')],{'as':_0x41e6('0x177'),'foreignKey':_0x41e6('0x1aa'),'onDelete':'cascade'});db[_0x41e6('0x151')][_0x41e6('0x112')](db[_0x41e6('0x151')],{'as':_0x41e6('0x1ab'),'foreignKey':_0x41e6('0x174'),'onDelete':_0x41e6('0x10f'),'hooks':!![],'required':![]});db[_0x41e6('0x151')][_0x41e6('0x112')](db[_0x41e6('0x19')],{'as':'Extensions','foreignKey':_0x41e6('0x174'),'onDelete':'restrict'});db['Interval'][_0x41e6('0x112')](db[_0x41e6('0x44')],{'as':_0x41e6('0x1ac'),'foreignKey':_0x41e6('0x174')});db[_0x41e6('0x151')]['hasMany'](db[_0x41e6('0x62')],{'as':_0x41e6('0x1ad'),'foreignKey':_0x41e6('0x174')});db['Interval'][_0x41e6('0x112')](db[_0x41e6('0x4d')],{'as':'FaxApplications','foreignKey':_0x41e6('0x174')});db[_0x41e6('0x151')][_0x41e6('0x112')](db['SmsApplication'],{'as':_0x41e6('0x1ae'),'foreignKey':'IntervalId'});db[_0x41e6('0x84')][_0x41e6('0x14d')](db['MailAccount'],{});db[_0x41e6('0x84')][_0x41e6('0x14d')](db['AnalyticDefaultReport'],{'foreignKey':_0x41e6('0x1af')});db[_0x41e6('0x84')][_0x41e6('0x14d')](db[_0x41e6('0x95')],{'foreignKey':_0x41e6('0x1b0')});db[_0x41e6('0x1b1')][_0x41e6('0x122')](db[_0x41e6('0x143')],{'as':_0x41e6('0x1b2'),'through':_0x41e6('0x1b3'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x85')][_0x41e6('0x122')](db['CmContact'],{'through':_0x41e6('0x19f')});db[_0x41e6('0x85')][_0x41e6('0x122')](db[_0x41e6('0x64')],{'through':_0x41e6('0x194')});db[_0x41e6('0x85')][_0x41e6('0x122')](db[_0x41e6('0x40')],{'through':_0x41e6('0x16c')});db['Tag'][_0x41e6('0x122')](db[_0x41e6('0x56')],{'through':_0x41e6('0x182')});db[_0x41e6('0x85')]['belongsToMany'](db[_0x41e6('0x4f')],{'through':'fax_interaction_has_tags'});db[_0x41e6('0x85')][_0x41e6('0x122')](db[_0x41e6('0x18a')],{'through':_0x41e6('0x18c')});db[_0x41e6('0x85')][_0x41e6('0x122')](db['WhatsappInteraction'],{'through':_0x41e6('0x1b4')});db['CmContactHasItem'][_0x41e6('0x14d')](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x41e6('0x1b5')});db[_0x41e6('0x8b')][_0x41e6('0x14d')](db[_0x41e6('0x146')],{'as':_0x41e6('0x1b6'),'foreignKey':'CmHopperId'});db['CmContactHasItem']['belongsTo'](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x19c')});db[_0x41e6('0x8f')][_0x41e6('0x112')](db[_0x41e6('0x7d')],{'as':{'plural':'AllConditions','singular':_0x41e6('0x1b7')},'foreignKey':_0x41e6('0x1b8'),'onDelete':_0x41e6('0x10f'),'hooks':!![]});db[_0x41e6('0x8f')][_0x41e6('0x112')](db[_0x41e6('0x7d')],{'as':{'plural':'AnyConditions','singular':_0x41e6('0x1b9')},'foreignKey':_0x41e6('0x1ba'),'onDelete':_0x41e6('0x10f'),'hooks':!![]});db['Trigger'][_0x41e6('0x112')](db[_0x41e6('0x1a8')],{'as':_0x41e6('0x1bb'),'foreignKey':_0x41e6('0x1bc'),'onDelete':_0x41e6('0x10f'),'hooks':!![]});db[_0x41e6('0x95')][_0x41e6('0x112')](db[_0x41e6('0x9c')],{'as':_0x41e6('0x1bd'),'onDelete':_0x41e6('0x10f'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x41e6('0x112')](db[_0x41e6('0x9c')],{'as':_0x41e6('0x1bd'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1af')});db['AnalyticMetric'][_0x41e6('0x112')](db[_0x41e6('0x9c')],{'as':_0x41e6('0x1bd'),'onDelete':'cascade','foreignKey':_0x41e6('0x1be')});db[_0x41e6('0x9c')][_0x41e6('0x14d')](db[_0x41e6('0x9a')],{'foreignKey':_0x41e6('0x1be')});db[_0x41e6('0x9f')][_0x41e6('0x112')](db['SalesforceConfiguration'],{'as':_0x41e6('0x1bf'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xa0')][_0x41e6('0x112')](db[_0x41e6('0xa1')],{'as':'Subjects','onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xa0')][_0x41e6('0x112')](db[_0x41e6('0xa1')],{'as':_0x41e6('0x1c2'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xa0')][_0x41e6('0x112')](db[_0x41e6('0xa1')],{'as':_0x41e6('0x1bd'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xa0')][_0x41e6('0x14d')](db[_0x41e6('0x9f')],{'as':'Account','foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xa1')][_0x41e6('0x112')](db['SalesforceField'],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xa1')][_0x41e6('0x112')](db[_0x41e6('0xa1')],{'as':_0x41e6('0x1c6'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xa1')][_0x41e6('0x112')](db['SalesforceField'],{'as':_0x41e6('0x1c7'),'foreignKey':'FieldId'});db[_0x41e6('0xa1')][_0x41e6('0x14d')](db['Variable'],{'as':_0x41e6('0x90'),'foreignKey':_0x41e6('0x1c8')});db[_0x41e6('0xa3')][_0x41e6('0x112')](db['SugarcrmConfiguration'],{'as':_0x41e6('0x1bf'),'onDelete':_0x41e6('0x10f'),'foreignKey':'AccountId'});db[_0x41e6('0x1c9')][_0x41e6('0x112')](db['SugarcrmField'],{'as':_0x41e6('0x1ca'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0x1c9')]['hasMany'](db[_0x41e6('0xa5')],{'as':_0x41e6('0x1c2'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0x1c9')][_0x41e6('0x112')](db[_0x41e6('0xa5')],{'as':_0x41e6('0x1bd'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0x1c9')][_0x41e6('0x14d')](db[_0x41e6('0xa3')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xa5')][_0x41e6('0x112')](db[_0x41e6('0xa5')],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xa5')][_0x41e6('0x112')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xa5')][_0x41e6('0x112')](db[_0x41e6('0xa5')],{'as':_0x41e6('0x1c7'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xa5')][_0x41e6('0x14d')](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':'VariableId'});db[_0x41e6('0xa6')][_0x41e6('0x112')](db[_0x41e6('0x1cb')],{'as':_0x41e6('0x1bf'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x41e6('0x1cb')][_0x41e6('0x112')](db[_0x41e6('0x1cc')],{'as':_0x41e6('0x1ca'),'onDelete':'cascade','foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0x1cb')]['hasMany'](db[_0x41e6('0x1cc')],{'as':_0x41e6('0x1c2'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0x1cb')][_0x41e6('0x112')](db[_0x41e6('0x1cc')],{'as':'Fields','onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c4')});db['DeskConfiguration'][_0x41e6('0x14d')](db[_0x41e6('0xa6')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0x41e6('0x122')](db[_0x41e6('0x85')],{'through':_0x41e6('0x1cd')});db['DeskField'][_0x41e6('0x112')](db[_0x41e6('0x1cc')],{'as':'Subject','foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0x1cc')]['hasMany'](db[_0x41e6('0x1cc')],{'as':_0x41e6('0x1c6'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0x1cc')][_0x41e6('0x112')](db[_0x41e6('0x1cc')],{'as':_0x41e6('0x1c7'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0x1cc')][_0x41e6('0x14d')](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':_0x41e6('0x1c8')});db[_0x41e6('0xa8')]['hasMany'](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xa9')][_0x41e6('0x112')](db['ZohoField'],{'as':_0x41e6('0x1ca'),'onDelete':_0x41e6('0x10f'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x41e6('0x112')](db[_0x41e6('0xab')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xa9')][_0x41e6('0x112')](db[_0x41e6('0xab')],{'as':_0x41e6('0x1bd'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c4')});db['ZohoConfiguration'][_0x41e6('0x14d')](db[_0x41e6('0xa8')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x1c0')});db['ZohoField'][_0x41e6('0x112')](db['ZohoField'],{'as':_0x41e6('0x1c5'),'foreignKey':'SubjectId'});db[_0x41e6('0xab')]['hasMany'](db[_0x41e6('0xab')],{'as':_0x41e6('0x1c6'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xab')]['hasMany'](db[_0x41e6('0xab')],{'as':'Field','foreignKey':_0x41e6('0x1c4')});db['ZohoField']['belongsTo'](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':_0x41e6('0x1c8')});db['ZendeskAccount']['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x41e6('0x10f'),'foreignKey':'AccountId'});db[_0x41e6('0x1ce')]['hasMany'](db['ZendeskField'],{'as':_0x41e6('0x1ca'),'foreignKey':'SubjectId'});db[_0x41e6('0x1ce')][_0x41e6('0x112')](db[_0x41e6('0xae')],{'as':_0x41e6('0x1c2'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0x1ce')][_0x41e6('0x112')](db[_0x41e6('0xae')],{'as':'Fields','foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0x1ce')][_0x41e6('0x14d')](db[_0x41e6('0x1cf')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x1c0')});db['ZendeskConfiguration'][_0x41e6('0x122')](db['Tag'],{'through':_0x41e6('0x1d0')});db[_0x41e6('0xae')]['hasMany'](db[_0x41e6('0xae')],{'as':'Subject','foreignKey':_0x41e6('0x1c1')});db['ZendeskField']['hasMany'](db[_0x41e6('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x41e6('0xae')]['hasMany'](db[_0x41e6('0xae')],{'as':_0x41e6('0x1c7'),'foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':'VariableId'});db[_0x41e6('0xb0')][_0x41e6('0x112')](db[_0x41e6('0xb2')],{'as':'Configurations','onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xb2')][_0x41e6('0x112')](db[_0x41e6('0xb3')],{'as':_0x41e6('0x1ca'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c1')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0x41e6('0x1c2'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xb2')][_0x41e6('0x112')](db[_0x41e6('0xb3')],{'as':_0x41e6('0x1bd'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xb2')][_0x41e6('0x14d')](db[_0x41e6('0xb0')],{'as':'Account','foreignKey':_0x41e6('0x1c0')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x41e6('0x85')],{'through':_0x41e6('0x1d1')});db['FreshdeskField'][_0x41e6('0x112')](db[_0x41e6('0xb3')],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xb3')][_0x41e6('0x112')](db[_0x41e6('0xb3')],{'as':_0x41e6('0x1c6'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xb3')][_0x41e6('0x112')](db[_0x41e6('0xb3')],{'as':_0x41e6('0x1c7'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xb3')]['belongsTo'](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':_0x41e6('0x1c8')});db[_0x41e6('0xb5')][_0x41e6('0x112')](db[_0x41e6('0x1d2')],{'as':'Configurations','onDelete':_0x41e6('0x10f'),'foreignKey':'AccountId'});db[_0x41e6('0x1d2')][_0x41e6('0x112')](db[_0x41e6('0xb8')],{'as':_0x41e6('0x1ca'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0x1d2')][_0x41e6('0x112')](db[_0x41e6('0xb8')],{'as':_0x41e6('0x1c2'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0x1d2')][_0x41e6('0x112')](db['VtigerField'],{'as':_0x41e6('0x1bd'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0x1d2')][_0x41e6('0x14d')](db[_0x41e6('0xb5')],{'as':'Account','foreignKey':_0x41e6('0x1c0')});db['VtigerField'][_0x41e6('0x112')](db[_0x41e6('0xb8')],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xb8')][_0x41e6('0x112')](db['VtigerField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x41e6('0xb8')][_0x41e6('0x112')](db[_0x41e6('0xb8')],{'as':_0x41e6('0x1c7'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xb8')][_0x41e6('0x14d')](db['Variable'],{'as':_0x41e6('0x90'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0x41e6('0x112')](db[_0x41e6('0xbc')],{'as':_0x41e6('0x1bf'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xbc')][_0x41e6('0x112')](db[_0x41e6('0xbe')],{'as':_0x41e6('0x1ca'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xbc')]['hasMany'](db[_0x41e6('0xbe')],{'as':_0x41e6('0x1c2'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xbc')]['hasMany'](db[_0x41e6('0xbe')],{'as':_0x41e6('0x1bd'),'foreignKey':_0x41e6('0x1c4')});db['ServicenowConfiguration']['belongsTo'](db[_0x41e6('0xba')],{'as':_0x41e6('0x171'),'foreignKey':'AccountId'});db[_0x41e6('0xbe')][_0x41e6('0x112')](db[_0x41e6('0xbe')],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xbe')]['hasMany'](db[_0x41e6('0xbe')],{'as':_0x41e6('0x1c6'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xbe')][_0x41e6('0x112')](db[_0x41e6('0xbe')],{'as':_0x41e6('0x1c7'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xbe')][_0x41e6('0x14d')](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':'VariableId'});db[_0x41e6('0xc0')][_0x41e6('0x112')](db[_0x41e6('0xc1')],{'as':_0x41e6('0x1bf'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c0')});db['Dynamics365Account']['belongsTo'](db[_0x41e6('0x160')],{'as':_0x41e6('0x160'),'foreignKey':_0x41e6('0x161')});db[_0x41e6('0xc1')][_0x41e6('0x112')](db[_0x41e6('0xc3')],{'as':_0x41e6('0x1ca'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xc1')][_0x41e6('0x112')](db[_0x41e6('0xc3')],{'as':'Descriptions','onDelete':_0x41e6('0x10f'),'foreignKey':'DescriptionId'});db[_0x41e6('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0x41e6('0x1bd'),'onDelete':'cascade','foreignKey':_0x41e6('0x1c4')});db['Dynamics365Configuration'][_0x41e6('0x14d')](db[_0x41e6('0xc0')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xc3')][_0x41e6('0x112')](db[_0x41e6('0xc3')],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xc3')][_0x41e6('0x112')](db[_0x41e6('0xc3')],{'as':_0x41e6('0x1c6'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xc3')]['hasMany'](db[_0x41e6('0xc3')],{'as':_0x41e6('0x1c7'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xc3')][_0x41e6('0x14d')](db['Variable'],{'as':'Variable','foreignKey':_0x41e6('0x1c8')});db[_0x41e6('0xc5')][_0x41e6('0x112')](db[_0x41e6('0xc7')],{'as':_0x41e6('0x1bf'),'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1c0')});db[_0x41e6('0xc7')][_0x41e6('0x112')](db[_0x41e6('0xc9')],{'as':'Subjects','foreignKey':_0x41e6('0x1c1')});db[_0x41e6('0xc7')][_0x41e6('0x112')](db[_0x41e6('0xc9')],{'as':_0x41e6('0x1c2'),'foreignKey':_0x41e6('0x1c3')});db[_0x41e6('0xc7')]['hasMany'](db[_0x41e6('0xc9')],{'as':_0x41e6('0x1bd'),'foreignKey':_0x41e6('0x1c4')});db[_0x41e6('0xc7')][_0x41e6('0x14d')](db[_0x41e6('0xc5')],{'as':_0x41e6('0x171'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x41e6('0x112')](db[_0x41e6('0xc9')],{'as':_0x41e6('0x1c5'),'foreignKey':_0x41e6('0x1c1')});db['FreshsalesField'][_0x41e6('0x112')](db[_0x41e6('0xc9')],{'as':'Description','foreignKey':_0x41e6('0x1c3')});db['FreshsalesField'][_0x41e6('0x112')](db[_0x41e6('0xc9')],{'as':_0x41e6('0x1c7'),'foreignKey':'FieldId'});db[_0x41e6('0xc9')][_0x41e6('0x14d')](db[_0x41e6('0x90')],{'as':_0x41e6('0x90'),'foreignKey':_0x41e6('0x1c8')});db[_0x41e6('0xcc')][_0x41e6('0x14d')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':_0x41e6('0x17f'),'foreignKey':'ListId'});db[_0x41e6('0xcc')]['belongsTo'](db[_0x41e6('0x123')],{'as':'Contact','foreignKey':_0x41e6('0x15e')});db[_0x41e6('0xcc')][_0x41e6('0x14d')](db['ChatInteraction'],{});db[_0x41e6('0xcc')]['belongsTo'](db['ChatMessage'],{});db[_0x41e6('0xcc')]['belongsTo'](db[_0x41e6('0x14')],{});db[_0x41e6('0xcc')][_0x41e6('0x14d')](db['ChatQueue'],{});db[_0x41e6('0xce')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':_0x41e6('0x10f'),'foreignKey':'FromId'});db[_0x41e6('0xce')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':_0x41e6('0x10f'),'foreignKey':_0x41e6('0x1d3')});db[_0x41e6('0xd4')]['hasMany'](db[_0x41e6('0xd2')],{'foreignKey':'SessionId','onDelete':_0x41e6('0x10f')});db[_0x41e6('0xd4')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x41e6('0x10f')});db[_0x41e6('0xd6')][_0x41e6('0x14d')](db[_0x41e6('0x13c')],{});db['SmsQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':'List','foreignKey':_0x41e6('0x175')});db[_0x41e6('0xd6')]['belongsTo'](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db['SmsQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x56')],{});db['SmsQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0x57')],{});db[_0x41e6('0xd6')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{});db[_0x41e6('0xd6')][_0x41e6('0x14d')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0x41e6('0xd4')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x41e6('0xd2')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x41e6('0x112')](db[_0x41e6('0xd0')],{'foreignKey':_0x41e6('0x1d4')});db['Team']['belongsToMany'](db[_0x41e6('0x14')],{'as':'Agents','through':'user_has_teams'});db['Team'][_0x41e6('0x122')](db[_0x41e6('0x1b')],{'through':_0x41e6('0x155'),'as':'VoiceQueues'});db[_0x41e6('0xe6')][_0x41e6('0x122')](db['MailQueue'],{'through':_0x41e6('0x168'),'as':_0x41e6('0x12b')});db[_0x41e6('0xe6')][_0x41e6('0x122')](db['ChatQueue'],{'through':_0x41e6('0x198'),'as':_0x41e6('0x1d5')});db[_0x41e6('0xe6')][_0x41e6('0x122')](db[_0x41e6('0x12c')],{'through':_0x41e6('0x17e'),'as':'FaxQueues'});db['Team'][_0x41e6('0x122')](db[_0x41e6('0x59')],{'through':_0x41e6('0x186'),'as':_0x41e6('0x12e')});db['Team'][_0x41e6('0x122')](db[_0x41e6('0x12f')],{'through':_0x41e6('0x18e'),'as':'OpenchannelQueues'});db[_0x41e6('0xe6')]['belongsToMany'](db[_0x41e6('0x131')],{'through':'team_has_whatsapp_queues','as':_0x41e6('0x132')});db[_0x41e6('0xe6')][_0x41e6('0x122')](db[_0x41e6('0xf7')],{'through':_0x41e6('0x108'),'as':_0x41e6('0x1d6')});db[_0x41e6('0xe9')]['hasMany'](db[_0x41e6('0x146')],{'as':_0x41e6('0x147'),'foreignKey':_0x41e6('0x1a1')});db['Campaign'][_0x41e6('0x112')](db['CmHopperFinal'],{'as':_0x41e6('0x148'),'foreignKey':'CampaignId'});db[_0x41e6('0xe9')][_0x41e6('0x112')](db[_0x41e6('0x75')],{'as':_0x41e6('0x149'),'foreignKey':_0x41e6('0x1a1')});db[_0x41e6('0xe9')][_0x41e6('0x112')](db['CmHopperBlack'],{'as':_0x41e6('0x14b'),'foreignKey':_0x41e6('0x1a1')});db[_0x41e6('0xe9')][_0x41e6('0x14d')](db['Trunk'],{'as':_0x41e6('0x2b'),'foreignKey':_0x41e6('0x14e')});db['Campaign']['belongsTo'](db[_0x41e6('0x2b')],{'as':_0x41e6('0x14f'),'foreignKey':'TrunkBackupId'});db[_0x41e6('0xe9')][_0x41e6('0x14d')](db[_0x41e6('0x151')],{'as':_0x41e6('0x151'),'foreignKey':_0x41e6('0x174')});db[_0x41e6('0xe9')][_0x41e6('0x14d')](db[_0x41e6('0x1d7')],{'as':_0x41e6('0x1d7'),'foreignKey':_0x41e6('0x1d8')});db[_0x41e6('0xe9')]['belongsToMany'](db[_0x41e6('0xf5')],{'as':_0x41e6('0x1d9'),'through':'campaigns_has_cm_lists'});db[_0x41e6('0xe9')][_0x41e6('0x122')](db['CmList'],{'as':_0x41e6('0x1da'),'through':'campaigns_has_cm_blacklists'});db[_0x41e6('0xeb')][_0x41e6('0x14d')](db['ChatOfflineMessage'],{'as':_0x41e6('0x68'),'foreignKey':_0x41e6('0x1db')});db['MailTransferReport'][_0x41e6('0x14d')](db[_0x41e6('0x42')],{});db[_0x41e6('0xec')][_0x41e6('0x14d')](db[_0x41e6('0x40')],{});db[_0x41e6('0xec')]['belongsTo'](db[_0x41e6('0x3c')],{'foreignKey':_0x41e6('0x1dc'),'as':_0x41e6('0x1dd')});db[_0x41e6('0xec')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':'FromUserId','as':_0x41e6('0x1de')});db[_0x41e6('0xec')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':_0x41e6('0x1df'),'as':_0x41e6('0x1e0')});db[_0x41e6('0xec')]['belongsTo'](db[_0x41e6('0x3d')],{'foreignKey':'ToMailQueueId','as':_0x41e6('0x1e1')});db['MailTransferReport'][_0x41e6('0x14d')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x41e6('0xee')]['belongsTo'](db[_0x41e6('0x66')],{});db[_0x41e6('0xee')][_0x41e6('0x14d')](db['ChatInteraction'],{});db[_0x41e6('0xee')][_0x41e6('0x14d')](db['ChatWebsite'],{'foreignKey':_0x41e6('0x1e2'),'as':_0x41e6('0x1dd')});db[_0x41e6('0xee')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':_0x41e6('0x1e3'),'as':'FromAgent'});db[_0x41e6('0xee')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':'ToUserId','as':_0x41e6('0x1e0')});db['ChatTransferReport'][_0x41e6('0x14d')](db[_0x41e6('0x6a')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db[_0x41e6('0x5f')],{'foreignKey':_0x41e6('0x1e4'),'as':_0x41e6('0x1e5')});db[_0x41e6('0xf0')][_0x41e6('0x14d')](db[_0x41e6('0x51')],{});db[_0x41e6('0xf0')][_0x41e6('0x14d')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x41e6('0x14d')](db[_0x41e6('0x136')],{'foreignKey':_0x41e6('0x1e6'),'as':'FromAccount'});db['FaxTransferReport'][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':'FromUserId','as':_0x41e6('0x1de')});db[_0x41e6('0xf0')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':_0x41e6('0x1df'),'as':_0x41e6('0x1e0')});db[_0x41e6('0xf0')][_0x41e6('0x14d')](db[_0x41e6('0x12c')],{'foreignKey':'ToFaxQueueId','as':_0x41e6('0x1e1')});db['FaxTransferReport'][_0x41e6('0x14d')](db[_0x41e6('0x136')],{'foreignKey':_0x41e6('0x1e7'),'as':_0x41e6('0x1e5')});db[_0x41e6('0xf1')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x41e6('0xf1')][_0x41e6('0x14d')](db[_0x41e6('0x18a')],{});db[_0x41e6('0xf1')][_0x41e6('0x14d')](db[_0x41e6('0x187')],{'foreignKey':_0x41e6('0x1e8'),'as':_0x41e6('0x1dd')});db[_0x41e6('0xf1')][_0x41e6('0x14d')](db['User'],{'foreignKey':_0x41e6('0x1e3'),'as':_0x41e6('0x1de')});db[_0x41e6('0xf1')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':_0x41e6('0x1df'),'as':_0x41e6('0x1e0')});db['OpenchannelTransferReport'][_0x41e6('0x14d')](db[_0x41e6('0x12f')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x41e6('0xf3')][_0x41e6('0x14d')](db[_0x41e6('0x57')],{});db[_0x41e6('0xf3')]['belongsTo'](db[_0x41e6('0x56')],{});db[_0x41e6('0xf3')][_0x41e6('0x14d')](db[_0x41e6('0x13c')],{'foreignKey':_0x41e6('0x1e9'),'as':'FromAccount'});db[_0x41e6('0xf3')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':_0x41e6('0x1e3'),'as':'FromAgent'});db[_0x41e6('0xf3')][_0x41e6('0x14d')](db['User'],{'foreignKey':'ToUserId','as':_0x41e6('0x1e0')});db[_0x41e6('0xf3')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x41e6('0xf3')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x41e6('0x1ea'),'as':_0x41e6('0x1e5')});db[_0x41e6('0xf5')][_0x41e6('0x112')](db[_0x41e6('0x7b')],{'as':_0x41e6('0x177'),'foreignKey':_0x41e6('0x175'),'onDelete':'cascade'});db['CmList']['hasMany'](db[_0x41e6('0x78')],{'as':_0x41e6('0x1eb'),'foreignKey':'ListId'});db[_0x41e6('0xf5')][_0x41e6('0x112')](db[_0x41e6('0x123')],{'as':_0x41e6('0x124'),'onDelete':_0x41e6('0x10f'),'foreignKey':'ListId'});db[_0x41e6('0xf5')][_0x41e6('0x112')](db[_0x41e6('0x73')],{'as':_0x41e6('0x148'),'foreignKey':'ListId'});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':_0x41e6('0x117'),'foreignKey':'ListId'});db[_0x41e6('0xf5')][_0x41e6('0x112')](db[_0x41e6('0x77')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0x41e6('0x1ec'),'through':'voice_queues_has_cm_lists'});db[_0x41e6('0xf5')]['belongsToMany'](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':'cm_user_has_lists'});db[_0x41e6('0xf7')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade'});db['VoicePrefix'][_0x41e6('0x122')](db['User'],{'as':_0x41e6('0x154'),'through':_0x41e6('0x10a')});db[_0x41e6('0xf7')][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x108'),'as':'Teams'});db[_0x41e6('0xf9')][_0x41e6('0x112')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16e'),'foreignKey':_0x41e6('0x1ed')});db[_0x41e6('0xf9')][_0x41e6('0x112')](db[_0x41e6('0xfb')],{'as':_0x41e6('0x1ee'),'foreignKey':_0x41e6('0x1ed'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0xfb')][_0x41e6('0x112')](db['UserProfileResource'],{'as':_0x41e6('0x1ef'),'foreignKey':_0x41e6('0x1f0'),'onDelete':_0x41e6('0x10f')});db[_0x41e6('0xfe')][_0x41e6('0x112')](db[_0x41e6('0x7b')],{'as':_0x41e6('0x177'),'foreignKey':_0x41e6('0x1f1'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0x41e6('0x163')],{'as':_0x41e6('0x164'),'foreignKey':_0x41e6('0x1f1')});db['WhatsappAccount'][_0x41e6('0x112')](db[_0x41e6('0x102')],{'as':_0x41e6('0x165'),'foreignKey':'WhatsappAccountId'});db[_0x41e6('0xfe')]['hasMany'](db[_0x41e6('0x11d')],{'as':_0x41e6('0x179')});db[_0x41e6('0xfe')][_0x41e6('0x112')](db[_0x41e6('0xff')],{'as':'Applications'});db['WhatsappAccount'][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':_0x41e6('0x17f'),'foreignKey':_0x41e6('0x175')});db[_0x41e6('0xfe')][_0x41e6('0x14d')](db[_0x41e6('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x41e6('0x152')});db['WhatsappAccount'][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':_0x41e6('0x1f2')});db[_0x41e6('0xff')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'onDelete':_0x41e6('0x173')});db[_0x41e6('0xff')][_0x41e6('0x14d')](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0x41e6('0xff')][_0x41e6('0x14d')](db[_0x41e6('0xfe')],{'onDelete':_0x41e6('0x173')});db[_0x41e6('0xff')]['belongsTo'](db['Interval'],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x174')});db[_0x41e6('0xff')]['belongsTo'](db[_0x41e6('0x85')],{'onDelete':_0x41e6('0x173'),'foreignKey':_0x41e6('0x181')});db[_0x41e6('0x11d')]['hasMany'](db['WhatsappMessage'],{'as':_0x41e6('0x165'),'onDelete':_0x41e6('0x10f'),'foreignKey':'WhatsappInteractionId'});db[_0x41e6('0x11d')][_0x41e6('0x14d')](db[_0x41e6('0xfe')],{'as':_0x41e6('0x171'),'foreignKey':_0x41e6('0x1f1')});db['WhatsappInteraction'][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':_0x41e6('0x15d'),'foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x11d')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16b'),'foreignKey':_0x41e6('0x111')});db[_0x41e6('0x11d')][_0x41e6('0x122')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x41e6('0x16d')});db[_0x41e6('0x11d')][_0x41e6('0x122')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x41e6('0x183')});db[_0x41e6('0x11d')][_0x41e6('0x122')](db[_0x41e6('0x14')],{'as':_0x41e6('0x16e'),'through':_0x41e6('0x1f3'),'foreignKey':_0x41e6('0x1f4')});db[_0x41e6('0x102')][_0x41e6('0x14d')](db['User'],{'as':'User'});db['WhatsappMessage'][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x15d')});db['WhatsappMessage'][_0x41e6('0x14d')](db[_0x41e6('0x11d')],{'onDelete':_0x41e6('0x10f'),'as':_0x41e6('0x170'),'foreignKey':_0x41e6('0x1f4')});db['WhatsappMessage'][_0x41e6('0x14d')](db[_0x41e6('0xfe')],{'as':'Account','foreignKey':_0x41e6('0x1f1')});db[_0x41e6('0x1f5')]['belongsTo'](db[_0x41e6('0xfe')],{});db['WhatsappQueueReport'][_0x41e6('0x14d')](db[_0x41e6('0xf5')],{'as':_0x41e6('0x17f'),'foreignKey':_0x41e6('0x175')});db[_0x41e6('0x1f5')][_0x41e6('0x14d')](db[_0x41e6('0x123')],{'as':'Contact','foreignKey':_0x41e6('0x15e')});db[_0x41e6('0x1f5')][_0x41e6('0x14d')](db['WhatsappInteraction'],{});db[_0x41e6('0x1f5')][_0x41e6('0x14d')](db[_0x41e6('0x131')],{});db[_0x41e6('0x1f5')][_0x41e6('0x14d')](db[_0x41e6('0x102')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x41e6('0x14')],{});db[_0x41e6('0x105')][_0x41e6('0x14d')](db[_0x41e6('0x102')],{});db[_0x41e6('0x105')][_0x41e6('0x14d')](db[_0x41e6('0x11d')],{});db[_0x41e6('0x105')][_0x41e6('0x14d')](db[_0x41e6('0xfe')],{'foreignKey':_0x41e6('0x1f6'),'as':'FromAccount'});db[_0x41e6('0x105')]['belongsTo'](db[_0x41e6('0xfe')],{'foreignKey':_0x41e6('0x1f7'),'as':_0x41e6('0x1e5')});db[_0x41e6('0x105')][_0x41e6('0x14d')](db[_0x41e6('0x131')],{'foreignKey':'ToQueueId','as':_0x41e6('0x1e1')});db[_0x41e6('0x105')][_0x41e6('0x14d')](db[_0x41e6('0x14')],{'foreignKey':_0x41e6('0x1e3'),'as':_0x41e6('0x1de')});db[_0x41e6('0x105')][_0x41e6('0x14d')](db['User'],{'foreignKey':_0x41e6('0x1df'),'as':_0x41e6('0x1e0')});db[_0x41e6('0x131')]['belongsToMany'](db[_0x41e6('0x14')],{'as':_0x41e6('0x154'),'through':_0x41e6('0x133'),'foreignKey':_0x41e6('0x1f8')});db[_0x41e6('0x131')][_0x41e6('0x122')](db[_0x41e6('0xe6')],{'through':_0x41e6('0x1f9'),'as':_0x41e6('0x169')});db[_0x41e6('0x10b')][_0x41e6('0x14d')](db['User'],{'as':_0x41e6('0x1fa'),'foreignKey':'UserId','onDelete':_0x41e6('0x10f'),'hooks':!![]});db[_0x41e6('0x160')]['hasOne'](db[_0x41e6('0xc0')],{'as':_0x41e6('0xc0'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x160')][_0x41e6('0x10d')](db[_0x41e6('0x38')],{'as':_0x41e6('0x162'),'onDelete':_0x41e6('0x173')});db[_0x41e6('0x160')]['hasOne'](db[_0x41e6('0x3a')],{'as':'Smtp','onDelete':'restrict'});module[_0x41e6('0x1fb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3987717..4a7432d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2305=['/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','join','root','/www','static','/demo','snippet','3.1.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','./api/user','/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/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount'];(function(_0x5a2291,_0x3ddda7){var _0x10e3f5=function(_0xc510cc){while(--_0xc510cc){_0x5a2291['push'](_0x5a2291['shift']());}};_0x10e3f5(++_0x3ddda7);}(_0x2305,0x7b));var _0x5230=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x2305[_0x3d13bb];return _0x4b5a1b;};'use strict';var path=require(_0x5230('0x0'));var express=require(_0x5230('0x1'));var errors=require(_0x5230('0x2'));var config=require(_0x5230('0x3'));var setupLoggers=require(_0x5230('0x4'))[_0x5230('0x5')];var clientSideLogs=require(_0x5230('0x6'));exports[_0x5230('0x7')]=function(_0x223ba6){return setupLoggers(_0x223ba6)['then'](function(){_0x223ba6[_0x5230('0x8')]('/api/users',require(_0x5230('0x9')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa'),require(_0x5230('0xb')));_0x223ba6[_0x5230('0x8')](_0x5230('0xc'),require(_0x5230('0xd')));_0x223ba6['use']('/api/voice/extensions',require(_0x5230('0xe')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf'),require(_0x5230('0x10')));_0x223ba6[_0x5230('0x8')](_0x5230('0x11'),require(_0x5230('0x12')));_0x223ba6[_0x5230('0x8')](_0x5230('0x13'),require('./api/voiceRecording'));_0x223ba6['use'](_0x5230('0x14'),require(_0x5230('0x15')));_0x223ba6['use'](_0x5230('0x16'),require('./api/voiceMail'));_0x223ba6[_0x5230('0x8')](_0x5230('0x17'),require('./api/voiceMailMessage'));_0x223ba6[_0x5230('0x8')](_0x5230('0x18'),require(_0x5230('0x19')));_0x223ba6[_0x5230('0x8')](_0x5230('0x1a'),require(_0x5230('0x1b')));_0x223ba6[_0x5230('0x8')](_0x5230('0x1c'),require(_0x5230('0x1d')));_0x223ba6['use']('/api/voice/queues/reports',require(_0x5230('0x1e')));_0x223ba6[_0x5230('0x8')](_0x5230('0x1f'),require('./api/memberReport'));_0x223ba6['use'](_0x5230('0x20'),require(_0x5230('0x21')));_0x223ba6[_0x5230('0x8')](_0x5230('0x22'),require(_0x5230('0x23')));_0x223ba6[_0x5230('0x8')](_0x5230('0x24'),require(_0x5230('0x25')));_0x223ba6[_0x5230('0x8')]('/api/mail/accounts',require(_0x5230('0x26')));_0x223ba6['use'](_0x5230('0x27'),require('./api/mailQueue'));_0x223ba6['use'](_0x5230('0x28'),require(_0x5230('0x29')));_0x223ba6['use'](_0x5230('0x2a'),require(_0x5230('0x2b')));_0x223ba6[_0x5230('0x8')]('/api/mail/messages',require('./api/mailMessage'));_0x223ba6[_0x5230('0x8')](_0x5230('0x2c'),require('./api/mailApplication'));_0x223ba6[_0x5230('0x8')](_0x5230('0x2d'),require(_0x5230('0x2e')));_0x223ba6[_0x5230('0x8')](_0x5230('0x2f'),require('./api/dashboard'));_0x223ba6[_0x5230('0x8')](_0x5230('0x30'),require(_0x5230('0x31')));_0x223ba6['use'](_0x5230('0x32'),require(_0x5230('0x33')));_0x223ba6[_0x5230('0x8')](_0x5230('0x34'),require('./api/faxApplication'));_0x223ba6[_0x5230('0x8')](_0x5230('0x35'),require(_0x5230('0x36')));_0x223ba6['use'](_0x5230('0x37'),require(_0x5230('0x38')));_0x223ba6[_0x5230('0x8')](_0x5230('0x39'),require(_0x5230('0x3a')));_0x223ba6[_0x5230('0x8')](_0x5230('0x3b'),require(_0x5230('0x3c')));_0x223ba6[_0x5230('0x8')](_0x5230('0x3d'),require('./api/smsAccount'));_0x223ba6[_0x5230('0x8')](_0x5230('0x3e'),require(_0x5230('0x3f')));_0x223ba6['use']('/api/sms/interactions',require(_0x5230('0x40')));_0x223ba6[_0x5230('0x8')](_0x5230('0x41'),require(_0x5230('0x42')));_0x223ba6[_0x5230('0x8')](_0x5230('0x43'),require('./api/smsQueue'));_0x223ba6[_0x5230('0x8')](_0x5230('0x44'),require('./api/openchannelAccount'));_0x223ba6[_0x5230('0x8')]('/api/openchannel/applications',require(_0x5230('0x45')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/interactions',require(_0x5230('0x46')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/messages',require(_0x5230('0x47')));_0x223ba6[_0x5230('0x8')](_0x5230('0x48'),require(_0x5230('0x49')));_0x223ba6[_0x5230('0x8')](_0x5230('0x4a'),require(_0x5230('0x4b')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0x4c'),require(_0x5230('0x4d')));_0x223ba6[_0x5230('0x8')]('/api/chat/interactions',require(_0x5230('0x4e')));_0x223ba6[_0x5230('0x8')](_0x5230('0x4f'),require('./api/chatMessage'));_0x223ba6[_0x5230('0x8')]('/api/chat/offline_messages',require(_0x5230('0x50')));_0x223ba6['use'](_0x5230('0x51'),require(_0x5230('0x52')));_0x223ba6[_0x5230('0x8')](_0x5230('0x53'),require('./api/chatGroup'));_0x223ba6[_0x5230('0x8')](_0x5230('0x54'),require(_0x5230('0x55')));_0x223ba6[_0x5230('0x8')](_0x5230('0x56'),require(_0x5230('0x57')));_0x223ba6['use']('/api/cm/contacts',require(_0x5230('0x58')));_0x223ba6['use']('/api/cm/hopper',require(_0x5230('0x59')));_0x223ba6[_0x5230('0x8')]('/api/cm/hopper_black',require(_0x5230('0x5a')));_0x223ba6['use'](_0x5230('0x5b'),require(_0x5230('0x5c')));_0x223ba6['use']('/api/cm/hopper_history',require(_0x5230('0x5d')));_0x223ba6[_0x5230('0x8')]('/api/cm/custom_fields',require(_0x5230('0x5e')));_0x223ba6[_0x5230('0x8')]('/api/actions',require(_0x5230('0x5f')));_0x223ba6[_0x5230('0x8')](_0x5230('0x60'),require(_0x5230('0x61')));_0x223ba6[_0x5230('0x8')](_0x5230('0x62'),require('./api/cannedAnswer'));_0x223ba6['use']('/api/dispositions',require(_0x5230('0x63')));_0x223ba6['use'](_0x5230('0x64'),require(_0x5230('0x65')));_0x223ba6[_0x5230('0x8')](_0x5230('0x66'),require(_0x5230('0x67')));_0x223ba6['use'](_0x5230('0x68'),require(_0x5230('0x69')));_0x223ba6[_0x5230('0x8')](_0x5230('0x6a'),require('./api/cdr'));_0x223ba6[_0x5230('0x8')]('/api/voiceQueuesLog',require(_0x5230('0x6b')));_0x223ba6[_0x5230('0x8')]('/api/schedules',require('./api/schedule'));_0x223ba6[_0x5230('0x8')](_0x5230('0x6c'),require(_0x5230('0x6d')));_0x223ba6[_0x5230('0x8')](_0x5230('0x6e'),require('./api/tag'));_0x223ba6['use'](_0x5230('0x6f'),require(_0x5230('0x70')));_0x223ba6[_0x5230('0x8')](_0x5230('0x71'),require(_0x5230('0x72')));_0x223ba6[_0x5230('0x8')](_0x5230('0x73'),require(_0x5230('0x74')));_0x223ba6[_0x5230('0x8')](_0x5230('0x75'),require(_0x5230('0x76')));_0x223ba6['use'](_0x5230('0x77'),require(_0x5230('0x78')));_0x223ba6[_0x5230('0x8')](_0x5230('0x79'),require(_0x5230('0x7a')));_0x223ba6['use'](_0x5230('0x7b'),require(_0x5230('0x7c')));_0x223ba6[_0x5230('0x8')](_0x5230('0x7d'),require('./api/integrationReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0x7e'),require(_0x5230('0x7f')));_0x223ba6[_0x5230('0x8')](_0x5230('0x80'),require(_0x5230('0x81')));_0x223ba6[_0x5230('0x8')](_0x5230('0x82'),require(_0x5230('0x83')));_0x223ba6['use'](_0x5230('0x84'),require('./api/analyticMetric'));_0x223ba6[_0x5230('0x8')](_0x5230('0x85'),require(_0x5230('0x86')));_0x223ba6[_0x5230('0x8')](_0x5230('0x87'),require('./api/analyticTreeReport'));_0x223ba6[_0x5230('0x8')]('/api/integrations/salesforce/accounts',require(_0x5230('0x88')));_0x223ba6[_0x5230('0x8')](_0x5230('0x89'),require(_0x5230('0x8a')));_0x223ba6[_0x5230('0x8')](_0x5230('0x8b'),require(_0x5230('0x8c')));_0x223ba6[_0x5230('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x5230('0x8d')));_0x223ba6[_0x5230('0x8')](_0x5230('0x8e'),require(_0x5230('0x8f')));_0x223ba6[_0x5230('0x8')](_0x5230('0x90'),require('./api/intSugarcrmField'));_0x223ba6[_0x5230('0x8')](_0x5230('0x91'),require(_0x5230('0x92')));_0x223ba6[_0x5230('0x8')](_0x5230('0x93'),require(_0x5230('0x94')));_0x223ba6[_0x5230('0x8')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x223ba6['use']('/api/integrations/zoho/accounts',require(_0x5230('0x95')));_0x223ba6[_0x5230('0x8')](_0x5230('0x96'),require(_0x5230('0x97')));_0x223ba6[_0x5230('0x8')]('/api/integrations/zoho/fields',require(_0x5230('0x98')));_0x223ba6[_0x5230('0x8')](_0x5230('0x99'),require('./api/intZendeskAccount'));_0x223ba6[_0x5230('0x8')]('/api/integrations/zendesk/configurations',require(_0x5230('0x9a')));_0x223ba6['use'](_0x5230('0x9b'),require(_0x5230('0x9c')));_0x223ba6[_0x5230('0x8')](_0x5230('0x9d'),require(_0x5230('0x9e')));_0x223ba6['use'](_0x5230('0x9f'),require(_0x5230('0xa0')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa1'),require('./api/intFreshdeskField'));_0x223ba6[_0x5230('0x8')](_0x5230('0xa2'),require(_0x5230('0xa3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa4'),require('./api/intVtigerConfiguration'));_0x223ba6[_0x5230('0x8')]('/api/integrations/vtiger/fields',require(_0x5230('0xa5')));_0x223ba6['use'](_0x5230('0xa6'),require(_0x5230('0xa7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xa8'),require('./api/intServicenowConfiguration'));_0x223ba6[_0x5230('0x8')]('/api/integrations/servicenow/fields',require(_0x5230('0xa9')));_0x223ba6[_0x5230('0x8')](_0x5230('0xaa'),require(_0x5230('0xab')));_0x223ba6[_0x5230('0x8')]('/api/integrations/dynamics365/configurations',require(_0x5230('0xac')));_0x223ba6['use'](_0x5230('0xad'),require(_0x5230('0xae')));_0x223ba6[_0x5230('0x8')](_0x5230('0xaf'),require('./api/intFreshsalesAccount'));_0x223ba6['use'](_0x5230('0xb0'),require('./api/intFreshsalesConfiguration'));_0x223ba6[_0x5230('0x8')](_0x5230('0xb1'),require('./api/intFreshsalesField'));_0x223ba6[_0x5230('0x8')](_0x5230('0xb2'),require(_0x5230('0xb3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xb4'),require(_0x5230('0xb5')));_0x223ba6['use'](_0x5230('0xb6'),require(_0x5230('0xb7')));_0x223ba6['use'](_0x5230('0xb8'),require('./api/jscriptyAnswerReport'));_0x223ba6['use'](_0x5230('0xb9'),require('./api/jscriptyQuestionReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0xba'),require(_0x5230('0xbb')));_0x223ba6['use'](_0x5230('0xbc'),require('./api/smsQueueReport'));_0x223ba6['use']('/api/square/reports',require(_0x5230('0xbd')));_0x223ba6[_0x5230('0x8')](_0x5230('0xbe'),require(_0x5230('0xbf')));_0x223ba6[_0x5230('0x8')]('/api/jscripty/projects',require(_0x5230('0xc0')));_0x223ba6[_0x5230('0x8')]('/api/settings',require(_0x5230('0xc1')));_0x223ba6[_0x5230('0x8')]('/api/square/odbc',require(_0x5230('0xc2')));_0x223ba6['use'](_0x5230('0xc3'),require('./api/squareProject'));_0x223ba6[_0x5230('0x8')](_0x5230('0xc4'),require('./api/squareRecording'));_0x223ba6['use'](_0x5230('0xc5'),require(_0x5230('0xc6')));_0x223ba6[_0x5230('0x8')]('/api/teams',require(_0x5230('0xc7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xc8'),require(_0x5230('0xc9')));_0x223ba6['use'](_0x5230('0xca'),require(_0x5230('0xcb')));_0x223ba6['use'](_0x5230('0xcc'),require('./api/migration'));_0x223ba6[_0x5230('0x8')](_0x5230('0xcd'),require('./api/attachment'));_0x223ba6[_0x5230('0x8')](_0x5230('0xce'),require(_0x5230('0xcf')));_0x223ba6[_0x5230('0x8')](_0x5230('0xd0'),require(_0x5230('0xd1')));_0x223ba6['use'](_0x5230('0xd2'),require(_0x5230('0xd3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xd4'),require(_0x5230('0xd5')));_0x223ba6[_0x5230('0x8')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x223ba6[_0x5230('0x8')](_0x5230('0xd6'),require(_0x5230('0xd7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xd8'),require(_0x5230('0xd9')));_0x223ba6[_0x5230('0x8')](_0x5230('0xda'),require(_0x5230('0xdb')));_0x223ba6[_0x5230('0x8')]('/api/userProfiles',require('./api/userProfile'));_0x223ba6[_0x5230('0x8')](_0x5230('0xdc'),require('./api/userProfileSection'));_0x223ba6['use']('/api/userProfile/resources',require(_0x5230('0xdd')));_0x223ba6[_0x5230('0x8')](_0x5230('0xde'),require(_0x5230('0xdf')));_0x223ba6['use'](_0x5230('0xe0'),require(_0x5230('0xe1')));_0x223ba6[_0x5230('0x8')]('/api/whatsapp/applications',require(_0x5230('0xe2')));_0x223ba6[_0x5230('0x8')](_0x5230('0xe3'),require(_0x5230('0xe4')));_0x223ba6['use'](_0x5230('0xe5'),require('./api/whatsappMessage'));_0x223ba6['use']('/api/whatsapp/reports/queue',require(_0x5230('0xe6')));_0x223ba6[_0x5230('0x8')](_0x5230('0xe7'),require(_0x5230('0xe8')));_0x223ba6[_0x5230('0x8')](_0x5230('0xe9'),require(_0x5230('0xea')));_0x223ba6[_0x5230('0x8')]('/api/cloudProviders',require(_0x5230('0xeb')));_0x223ba6[_0x5230('0x8')](_0x5230('0xec'),require('./api/realtime'));_0x223ba6['use'](_0x5230('0xed'),require(_0x5230('0xee')));_0x223ba6[_0x5230('0x8')](_0x5230('0xef'),require(_0x5230('0xf0')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf1'),require(_0x5230('0xf2')));_0x223ba6['use']('/api/auth/activedirectory',require(_0x5230('0xf3')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf4'),require(_0x5230('0xf5')));_0x223ba6['use'](_0x5230('0xf6'),require(_0x5230('0xf7')));_0x223ba6[_0x5230('0x8')](_0x5230('0xf8'),require(_0x5230('0xf9')));_0x223ba6['use'](_0x5230('0xfa'),require(_0x5230('0xfb')));_0x223ba6['use'](_0x5230('0xfc'),require(_0x5230('0xfd')));_0x223ba6['use']('/api/webbar',require(_0x5230('0xfe')));_0x223ba6[_0x5230('0x8')]('/api/logs',clientSideLogs);_0x223ba6[_0x5230('0x8')](_0x5230('0xff'),express['static'](path[_0x5230('0x100')](config[_0x5230('0x101')],_0x5230('0xff'))));_0x223ba6[_0x5230('0x8')](_0x5230('0x102'),express[_0x5230('0x103')](path['join'](config[_0x5230('0x101')],_0x5230('0x102'))));_0x223ba6['use'](_0x5230('0x104'),express[_0x5230('0x103')](path[_0x5230('0x100')](config[_0x5230('0x101')],'/demo')));_0x223ba6[_0x5230('0x8')]('/snippet',express[_0x5230('0x103')](path[_0x5230('0x100')](config['root'],_0x5230('0x105'),_0x5230('0x106'))));_0x223ba6[_0x5230('0x8')]('/plugins',express[_0x5230('0x103')](path[_0x5230('0x100')](config[_0x5230('0x101')],_0x5230('0x107'))));_0x223ba6[_0x5230('0x108')](_0x5230('0x109'))[_0x5230('0x10a')](errors[0x194]);_0x223ba6[_0x5230('0x108')]('/*')[_0x5230('0x10a')](function(_0x1eca9d,_0x377257){_0x377257['sendFile'](path[_0x5230('0x10b')](_0x223ba6[_0x5230('0x10a')](_0x5230('0x10c'))+_0x5230('0x10d')));});return _0x223ba6;});}; \ No newline at end of file +var _0xa174=['./api/chatOfflineMessage','./api/chatQueue','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/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/teams','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./api/client-side-logs','default','/api/users','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages'];(function(_0x416872,_0x14abbc){var _0x8beb6=function(_0x218663){while(--_0x218663){_0x416872['push'](_0x416872['shift']());}};_0x8beb6(++_0x14abbc);}(_0xa174,0xc4));var _0x4a17=function(_0x2dd1b6,_0xfc1dbe){_0x2dd1b6=_0x2dd1b6-0x0;var _0x1f7bb8=_0xa174[_0x2dd1b6];return _0x1f7bb8;};'use strict';var path=require(_0x4a17('0x0'));var express=require(_0x4a17('0x1'));var errors=require(_0x4a17('0x2'));var config=require(_0x4a17('0x3'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0x4a17('0x4'));exports[_0x4a17('0x5')]=function(_0x46ce23){return setupLoggers(_0x46ce23)['then'](function(){_0x46ce23['use'](_0x4a17('0x6'),require('./api/user'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x8'),require('./api/voiceChanSpy'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x9'),require(_0x4a17('0xa')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xb'),require('./api/voiceExtension'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xc'),require(_0x4a17('0xd')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xe'),require(_0x4a17('0xf')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x10'),require(_0x4a17('0x11')));_0x46ce23[_0x4a17('0x7')]('/api/screen/recordings',require(_0x4a17('0x12')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x13'),require('./api/voiceMail'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x14'),require(_0x4a17('0x15')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x16'),require(_0x4a17('0x17')));_0x46ce23[_0x4a17('0x7')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x18'),require(_0x4a17('0x19')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x1a'),require('./api/voiceQueueReport'));_0x46ce23['use'](_0x4a17('0x1b'),require(_0x4a17('0x1c')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x1d'),require(_0x4a17('0x1e')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x1f'),require('./api/voiceTransferReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x20'),require(_0x4a17('0x21')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x22'),require(_0x4a17('0x23')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x24'),require(_0x4a17('0x25')));_0x46ce23[_0x4a17('0x7')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x46ce23[_0x4a17('0x7')]('/api/mail/interactions',require(_0x4a17('0x26')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x27'),require(_0x4a17('0x28')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x29'),require('./api/mailApplication'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x2a'),require('./api/mailQueueReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x2b'),require('./api/dashboard'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x2c'),require(_0x4a17('0x2d')));_0x46ce23['use'](_0x4a17('0x2e'),require(_0x4a17('0x2f')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x30'),require('./api/faxApplication'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x31'),require(_0x4a17('0x32')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x33'),require(_0x4a17('0x34')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x35'),require('./api/faxQueue'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x36'),require('./api/faxQueueReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x37'),require(_0x4a17('0x38')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x39'),require(_0x4a17('0x3a')));_0x46ce23[_0x4a17('0x7')]('/api/sms/interactions',require(_0x4a17('0x3b')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x3c'),require(_0x4a17('0x3d')));_0x46ce23['use']('/api/sms/queues',require(_0x4a17('0x3e')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x3f'),require('./api/openchannelAccount'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x40'),require('./api/openchannelApplication'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x41'),require('./api/openchannelInteraction'));_0x46ce23['use'](_0x4a17('0x42'),require(_0x4a17('0x43')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x44'),require(_0x4a17('0x45')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x46'),require('./api/chatWebsite'));_0x46ce23['use'](_0x4a17('0x47'),require(_0x4a17('0x48')));_0x46ce23['use'](_0x4a17('0x49'),require(_0x4a17('0x4a')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x4b'),require(_0x4a17('0x4c')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x4d'),require(_0x4a17('0x4e')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x4f'),require(_0x4a17('0x50')));_0x46ce23[_0x4a17('0x7')]('/api/chat/queues',require(_0x4a17('0x51')));_0x46ce23[_0x4a17('0x7')]('/api/chat/groups',require('./api/chatGroup'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x52'),require('./api/chatProactiveAction'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x53'),require(_0x4a17('0x54')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x55'),require(_0x4a17('0x56')));_0x46ce23[_0x4a17('0x7')]('/api/cm/hopper',require(_0x4a17('0x57')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x58'),require(_0x4a17('0x59')));_0x46ce23['use'](_0x4a17('0x5a'),require(_0x4a17('0x5b')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x5c'),require('./api/cmHopperHistory'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x5d'),require(_0x4a17('0x5e')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x5f'),require('./api/action'));_0x46ce23[_0x4a17('0x7')]('/api/automations',require(_0x4a17('0x60')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x61'),require(_0x4a17('0x62')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x63'),require('./api/disposition'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x64'),require(_0x4a17('0x65')));_0x46ce23['use'](_0x4a17('0x66'),require(_0x4a17('0x67')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x68'),require('./api/pause'));_0x46ce23[_0x4a17('0x7')]('/api/cdr',require(_0x4a17('0x69')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x6a'),require('./api/voiceQueuesLog'));_0x46ce23['use'](_0x4a17('0x6b'),require(_0x4a17('0x6c')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x6d'),require(_0x4a17('0x6e')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x6f'),require('./api/tag'));_0x46ce23[_0x4a17('0x7')]('/api/contact_item_types',require(_0x4a17('0x70')));_0x46ce23[_0x4a17('0x7')]('/api/cm_contact_has_items',require(_0x4a17('0x71')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x72'),require(_0x4a17('0x73')));_0x46ce23[_0x4a17('0x7')]('/api/templates',require(_0x4a17('0x74')));_0x46ce23[_0x4a17('0x7')]('/api/triggers',require(_0x4a17('0x75')));_0x46ce23['use']('/api/variables',require(_0x4a17('0x76')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x77'),require(_0x4a17('0x78')));_0x46ce23['use'](_0x4a17('0x79'),require(_0x4a17('0x7a')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x7b'),require(_0x4a17('0x7c')));_0x46ce23['use'](_0x4a17('0x7d'),require('./api/analyticDefaultReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x7e'),require(_0x4a17('0x7f')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x80'),require(_0x4a17('0x81')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x82'),require(_0x4a17('0x83')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x84'),require(_0x4a17('0x85')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x86'),require(_0x4a17('0x87')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x88'),require(_0x4a17('0x89')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x8a'),require(_0x4a17('0x8b')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x4a17('0x8c')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x8d'),require(_0x4a17('0x8e')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/sugarcrm/fields',require(_0x4a17('0x8f')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x90'),require(_0x4a17('0x91')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/desk/configurations',require(_0x4a17('0x92')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x93'),require(_0x4a17('0x94')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x95'),require(_0x4a17('0x96')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/zoho/configurations',require(_0x4a17('0x97')));_0x46ce23['use']('/api/integrations/zoho/fields',require(_0x4a17('0x98')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x99'),require(_0x4a17('0x9a')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x9b'),require(_0x4a17('0x9c')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x9d'),require(_0x4a17('0x9e')));_0x46ce23['use'](_0x4a17('0x9f'),require('./api/intFreshdeskConfiguration'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xa0'),require(_0x4a17('0xa1')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xa2'),require(_0x4a17('0xa3')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xa4'),require(_0x4a17('0xa5')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/vtiger/fields',require(_0x4a17('0xa6')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xa7'),require(_0x4a17('0xa8')));_0x46ce23['use'](_0x4a17('0xa9'),require(_0x4a17('0xaa')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/servicenow/fields',require(_0x4a17('0xab')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xac'),require('./api/intDynamics365Account'));_0x46ce23['use']('/api/integrations/dynamics365/configurations',require(_0x4a17('0xad')));_0x46ce23[_0x4a17('0x7')]('/api/integrations/dynamics365/fields',require(_0x4a17('0xae')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xaf'),require('./api/intFreshsalesAccount'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xb0'),require(_0x4a17('0xb1')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xb2'),require(_0x4a17('0xb3')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xb4'),require(_0x4a17('0xb5')));_0x46ce23[_0x4a17('0x7')]('/api/chat/reports/queue',require(_0x4a17('0xb6')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xb7'),require('./api/chatInternalMessage'));_0x46ce23[_0x4a17('0x7')]('/api/jscripty/answers/reports',require(_0x4a17('0xb8')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xb9'),require(_0x4a17('0xba')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xbb'),require(_0x4a17('0xbc')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xbd'),require(_0x4a17('0xbe')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xbf'),require(_0x4a17('0xc0')));_0x46ce23[_0x4a17('0x7')]('/api/square/details/reports',require(_0x4a17('0xc1')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xc2'),require(_0x4a17('0xc3')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xc4'),require(_0x4a17('0xc5')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xc6'),require('./api/squareOdbc'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xc7'),require(_0x4a17('0xc8')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xc9'),require(_0x4a17('0xca')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xcb'),require(_0x4a17('0xcc')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xcd'),require(_0x4a17('0xce')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xcf'),require(_0x4a17('0xd0')));_0x46ce23[_0x4a17('0x7')]('/api/campaigns',require(_0x4a17('0xd1')));_0x46ce23[_0x4a17('0x7')]('/api/migrations',require(_0x4a17('0xd2')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xd3'),require(_0x4a17('0xd4')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xd5'),require('./api/plugin'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xd6'),require(_0x4a17('0xd7')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xd8'),require(_0x4a17('0xd9')));_0x46ce23['use']('/api/fax/reports/transfer',require(_0x4a17('0xda')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xdb'),require(_0x4a17('0xdc')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xdd'),require('./api/smsTransferReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xde'),require('./api/cmList'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xdf'),require(_0x4a17('0xe0')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xe1'),require('./api/userProfile'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xe2'),require(_0x4a17('0xe3')));_0x46ce23['use'](_0x4a17('0xe4'),require(_0x4a17('0xe5')));_0x46ce23['use'](_0x4a17('0xe6'),require(_0x4a17('0xe7')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xe8'),require(_0x4a17('0xe9')));_0x46ce23[_0x4a17('0x7')]('/api/whatsapp/applications',require(_0x4a17('0xea')));_0x46ce23['use']('/api/whatsapp/interactions',require(_0x4a17('0xeb')));_0x46ce23[_0x4a17('0x7')]('/api/whatsapp/messages',require(_0x4a17('0xec')));_0x46ce23['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xed'),require(_0x4a17('0xee')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xef'),require(_0x4a17('0xf0')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xf1'),require('./api/cloudProvider'));_0x46ce23[_0x4a17('0x7')]('/api/realtime',require(_0x4a17('0xf2')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xf3'),require('./api/user-setting'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xf4'),require(_0x4a17('0xf5')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xf6'),require(_0x4a17('0xf7')));_0x46ce23[_0x4a17('0x7')]('/api/auth/activedirectory',require(_0x4a17('0xf8')));_0x46ce23['use'](_0x4a17('0xf9'),require(_0x4a17('0xfa')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xfb'),require(_0x4a17('0xfc')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xfd'),require('./api/version'));_0x46ce23[_0x4a17('0x7')]('/api/system',require(_0x4a17('0xfe')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0xff'),require(_0x4a17('0x100')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x101'),require('./api/webbar'));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x102'),clientSideLogs);_0x46ce23[_0x4a17('0x7')](_0x4a17('0x103'),express[_0x4a17('0x104')](path['join'](config['root'],_0x4a17('0x103'))));_0x46ce23[_0x4a17('0x7')]('/www',express[_0x4a17('0x104')](path[_0x4a17('0x105')](config[_0x4a17('0x106')],'/www')));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x107'),express[_0x4a17('0x104')](path[_0x4a17('0x105')](config[_0x4a17('0x106')],_0x4a17('0x107'))));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x108'),express[_0x4a17('0x104')](path['join'](config[_0x4a17('0x106')],_0x4a17('0x109'),_0x4a17('0x10a'))));_0x46ce23[_0x4a17('0x7')](_0x4a17('0x10b'),express['static'](path[_0x4a17('0x105')](config[_0x4a17('0x106')],_0x4a17('0x10c'))));_0x46ce23[_0x4a17('0x10d')](_0x4a17('0x10e'))['get'](errors[0x194]);_0x46ce23[_0x4a17('0x10d')]('/*')[_0x4a17('0x10f')](function(_0x41c4c6,_0x3b5304){_0x3b5304[_0x4a17('0x110')](path[_0x4a17('0x111')](_0x46ce23[_0x4a17('0x10f')](_0x4a17('0x112'))+_0x4a17('0x113')));});return _0x46ce23;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 903e5be..be6e2f5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8e9=['../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/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/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../api/user/user.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc'];(function(_0xa2c378,_0xf2bde1){var _0x40eebc=function(_0x2101cc){while(--_0x2101cc){_0xa2c378['push'](_0xa2c378['shift']());}};_0x40eebc(++_0xf2bde1);}(_0xc8e9,0x18c));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var _=require(_0x9c8e('0x0'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x243a0d,_0xe09bc4){var _0x730907={};_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x1')));_0x730907=_['merge'](_0x730907,require('../api/voiceExtension/voiceExtension.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/voiceQueue/voiceQueue.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x3')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x4')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x5')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x6')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x7')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x8')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x9')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xa')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xb')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xc')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/mailQueue/mailQueue.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xd')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xe')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/mailApplication/mailApplication.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0xf')));_0x730907=_['merge'](_0x730907,require('../api/faxAccount/faxAccount.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x10')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x11')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x12')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x13')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x14')));_0x730907=_['merge'](_0x730907,require('../api/smsAccount/smsAccount.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x15')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x16')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x17')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x18')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x19')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1a')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1b')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1c')));_0x730907=_['merge'](_0x730907,require('../api/chatMessage/chatMessage.rpc'));_0x730907=_['merge'](_0x730907,require('../api/chatQueue/chatQueue.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/cmContact/cmContact.rpc'));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x1d')));_0x730907=_['merge'](_0x730907,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1e')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x1f')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x20')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/pause/pause.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x21')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x22')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x23')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/trigger/trigger.rpc'));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x24')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x25')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x26')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x27')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x28')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x29')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x2a')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2b')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2c')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x2d')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2e')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x2f')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x30')));_0x730907=_['merge'](_0x730907,require('../api/setting/setting.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x31')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x32')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/squareRecording/squareRecording.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x33')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x34')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x35')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x36')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x37')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x38')));_0x730907=_['merge'](_0x730907,require(_0x9c8e('0x39')));_0x730907=_[_0x9c8e('0x2')](_0x730907,require(_0x9c8e('0x3a')));var _0x1b91c5=jayson['server'](_0x730907)[_0x9c8e('0x3b')]();var _0x587811=config[_0x9c8e('0x3c')]['port']||config[_0x9c8e('0x3d')]+0x1;var _0x551358=config[_0x9c8e('0x3c')]['ip']||'localhost';_0x1b91c5['on'](_0x9c8e('0x3e'),function(_0x33ce50){return _0xe09bc4(_0x33ce50);});_0x1b91c5[_0x9c8e('0x3f')](_0x587811,_0x551358,function(){console[_0x9c8e('0x40')](_0x9c8e('0x41'),_0x551358,_0x587811);require(_0x9c8e('0x42'))[_0x9c8e('0x43')]();return _0x243a0d(_0x9c8e('0x44')+_0x551358+':'+_0x587811);});});}; \ No newline at end of file +var _0x1e4e=['../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc'];(function(_0x3c49ce,_0x56f9c9){var _0x3b6e99=function(_0x2c6145){while(--_0x2c6145){_0x3c49ce['push'](_0x3c49ce['shift']());}};_0x3b6e99(++_0x56f9c9);}(_0x1e4e,0x18c));var _0xe1e4=function(_0x5b29f9,_0x11e1ab){_0x5b29f9=_0x5b29f9-0x0;var _0x54a64b=_0x1e4e[_0x5b29f9];return _0x54a64b;};'use strict';var jayson=require(_0xe1e4('0x0'));var _=require(_0xe1e4('0x1'));var config=require(_0xe1e4('0x2'));exports[_0xe1e4('0x3')]=function(){return new Promise(function(_0xe5b9f5,_0x559ebe){var _0x35c222={};_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x5')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x6')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x7')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x8')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x9')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0xa')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0xb')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0xc')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0xd')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0xe')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0xf')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x10')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/mailAccount/mailAccount.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x11')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/mailInteraction/mailInteraction.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x12')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x13')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x14')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x15')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x16')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x17')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x18')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x19')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x1a')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x1b')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x1c')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x1d')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x1e')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x1f')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x20')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x21')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x22')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x23')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x24')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x25')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x26')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x27')));_0x35c222=_['merge'](_0x35c222,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x28')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x29')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x2a')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/interval/interval.rpc'));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x2b')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/sound/sound.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x2c')));_0x35c222=_['merge'](_0x35c222,require('../api/template/template.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x2d')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x2e')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x2f')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x30')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x31')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x32')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x33')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x34')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x35')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x36')));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x37')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x38')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x39')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/squareOdbc/squareOdbc.rpc'));_0x35c222=_['merge'](_0x35c222,require(_0xe1e4('0x3a')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x3b')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x3c')));_0x35c222=_['merge'](_0x35c222,require('../api/campaign/campaign.rpc'));_0x35c222=_['merge'](_0x35c222,require('../api/attachment/attachment.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x3d')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x3e')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x3f')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x40')));_0x35c222=_[_0xe1e4('0x4')](_0x35c222,require(_0xe1e4('0x41')));var _0x5e9eea=jayson[_0xe1e4('0x42')](_0x35c222)[_0xe1e4('0x43')]();var _0x56feb4=config[_0xe1e4('0x44')][_0xe1e4('0x45')]||config[_0xe1e4('0x45')]+0x1;var _0x18dbe6=config[_0xe1e4('0x44')]['ip']||'localhost';_0x5e9eea['on'](_0xe1e4('0x46'),function(_0x15c73d){return _0x559ebe(_0x15c73d);});_0x5e9eea[_0xe1e4('0x3')](_0x56feb4,_0x18dbe6,function(){console[_0xe1e4('0x47')](_0xe1e4('0x48'),_0x18dbe6,_0x56feb4);require(_0xe1e4('0x49'))[_0xe1e4('0x4a')]();return _0xe5b9f5(_0xe1e4('0x4b')+_0x18dbe6+':'+_0x56feb4);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 22b0a66..872fa23 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 _0x0b62=['prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./error','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','function','write','inherits'];(function(_0x1ed4ae,_0x3d6af9){var _0x37debd=function(_0x158679){while(--_0x158679){_0x1ed4ae['push'](_0x1ed4ae['shift']());}};_0x37debd(++_0x3d6af9);}(_0x0b62,0x177));var _0x20b6=function(_0xce7869,_0x360876){_0xce7869=_0xce7869-0x0;var _0x9062a=_0x0b62[_0xce7869];return _0x9062a;};'use strict';var util=require(_0x20b6('0x0'));var _=require(_0x20b6('0x1'));var EventEmitter=require('events')[_0x20b6('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x20b6('0x3'));function AGIChannel(_0x1c823a){var _0x3c062c=this,_0x714b86=new AGIReply(),_0x44154f=![],_0x195273={};EventEmitter['call'](_0x3c062c);_0x1c823a[_0x20b6('0x4')](_0x20b6('0x5'));_0x1c823a[_0x20b6('0x6')](0x8*0x3c*0x3c*0x3e8);_0x714b86[_0x20b6('0x4')](_0x20b6('0x5'));_0x714b86['on'](_0x20b6('0x7'),function(_0x1e07d5){for(var _0x106144 in _0x1e07d5){_0x3c062c[_0x106144]=_0x1e07d5[_0x106144];}_0x3c062c[_0x20b6('0x8')]('ready');});_0x714b86['on'](_0x20b6('0x9'),function(_0x4e85c6){if(_0x4e85c6[_0x20b6('0xa')]()==_0x20b6('0xb')){_0x3c062c[_0x20b6('0x8')](_0x20b6('0xb'));return;}if(_0x4e85c6[_0x20b6('0xc')](0x0,0xb)==_0x20b6('0xd')){_0x44154f=!![];}if(_0x44154f){_0x195273['rx']+=_0x4e85c6+'\x0a';if(_0x4e85c6[_0x20b6('0xe')](_0x20b6('0xf'))!=-0x1){_0x44154f=![];}}else{_0x195273['rx']=_0x4e85c6;}if(_0x44154f){return;}if(typeof _0x195273['cb']=='function'){var _0x238291=_0x195273['rx'][_0x20b6('0xc')](0x0,0x3),_0x5e83b0=null,_0x3918a6=null;_0x238291=parseInt(_0x238291);if(isNaN(_0x238291)){_0x195273['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x20b6('0x10')});return;}if(_0x238291!=0xc8){_0x195273['cb'](null,{'code':_0x238291,'result':-0x1,'extra':'KO'});return;}_0x5e83b0=_0x195273['rx'][_0x20b6('0xc')](0x4)[_0x20b6('0x11')]('result=','');if(_0x5e83b0[_0x20b6('0x12')]('\x20')!=-0x1){_0x5e83b0=_0x5e83b0[_0x20b6('0x13')](0x0,_0x5e83b0[_0x20b6('0x12')]('\x20'));}if(_[_0x20b6('0x14')](_0x5e83b0,'-1')){_0x5e83b0=parseInt(_0x5e83b0);}_0x3918a6=_0x195273['rx'][_0x20b6('0x15')]('\x20');if(_0x3918a6[_0x20b6('0x16')]==0x3){_0x3918a6=_0x3918a6[0x2]['substring'](0x1,_0x3918a6[0x2][_0x20b6('0x16')]-0x1);}else if(_0x3918a6[_0x20b6('0x16')]>0x3){var _0x23e254=/\((.+)\)/;var _0x5192ba=_0x195273['rx'][_0x20b6('0x17')](_0x23e254);if(_0x5192ba){_0x3918a6=_0x5192ba[0x1];}else{_0x3918a6=null;}}else{_0x3918a6=null;}_0x195273['cb'](null,{'code':_0x238291,'result':_0x5e83b0,'extra':_0x3918a6});}});_0x1c823a['on'](_0x20b6('0x18'),function(_0x354930){_0x3c062c['emit'](_0x20b6('0x18'),new AGIError(_0x20b6('0x19'),_0x354930[_0x20b6('0x1a')]));});_0x1c823a['on'](_0x20b6('0x1b'),function(){_0x3c062c[_0x20b6('0x8')](_0x20b6('0x1b'),new AGIError(_0x20b6('0x1c')));});_0x1c823a['on'](_0x20b6('0x1d'),function(){_0x3c062c[_0x20b6('0x8')](_0x20b6('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1c823a[_0x20b6('0x1e')]();});_0x1c823a['pipe'](_0x714b86);this[_0x20b6('0x1f')]=function(_0x2f6b9a,_0x3878b5){var _0x2f6b9a=_0x2f6b9a||'',_0x3878b5=typeof _0x3878b5==_0x20b6('0x20')?_0x3878b5:new Function();_0x195273={'tx':_0x2f6b9a,'rx':'','cb':_0x3878b5};_0x1c823a[_0x20b6('0x21')](_0x2f6b9a+'\x0a');},this['close']=function(){_0x1c823a['destroy']();};}util[_0x20b6('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x20b6('0x23')][_0x20b6('0x24')]=function(_0x501453){return this['command'][_0x20b6('0x25')](this,_0x501453);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x26')]=function(){return this['sendRequest'](_0x20b6('0x27'));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x28')]=function(_0x9ce6fc,_0x3861f2,_0x448146){_0x9ce6fc=_0x9ce6fc===undefined?_0x20b6('0x29'):_0x9ce6fc;_0x3861f2=_0x3861f2===undefined?'5':_0x3861f2;_0x448146=_0x448146===undefined?'1':_0x448146;return this[_0x20b6('0x24')](util[_0x20b6('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x9ce6fc,_0x3861f2*0x3e8,_0x448146));};AGIChannel[_0x20b6('0x23')]['noop']=function(_0x410377){_0x410377=_0x410377||_0x20b6('0x2b');return this[_0x20b6('0x24')](util['format'](_0x20b6('0x2c'),_0x410377));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x2d')]=function(_0xb21276,_0x38b9ff){if(_[_0x20b6('0x2e')](_0x38b9ff)){return this[_0x20b6('0x24')](util['format'](_0x20b6('0x2f'),_0xb21276,_0x38b9ff[_0x20b6('0x30')](',')));}return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x2f'),_0xb21276,_0x38b9ff));};AGIChannel['prototype']['setContext']=function(_0xdec1d2){return this[_0x20b6('0x24')](util['format'](_0x20b6('0x31'),_0xdec1d2));};AGIChannel['prototype']['setExtension']=function(_0x4d1e09){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x32'),_0x4d1e09));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x33')]=function(_0x57f30b){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')]('SET\x20PRIORITY\x20%s',_0x57f30b));};AGIChannel[_0x20b6('0x23')][_0x20b6('0xb')]=function(){return this[_0x20b6('0x24')]('HANGUP');};AGIChannel[_0x20b6('0x23')][_0x20b6('0x34')]=function(_0x1893f1,_0x59dad0){var _0x3219d5=_[_0x20b6('0x35')](_0x59dad0)||_[_0x20b6('0x36')](_0x59dad0)?_0x59dad0[_0x20b6('0x37')]():_0x59dad0;return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x38'),_0x1893f1,_0x3219d5?_0x3219d5[_0x20b6('0x37')]()[_0x20b6('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x39')]=function(_0x5e499e,_0x39b7be){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x3a'),_0x5e499e,_0x39b7be));};AGIChannel['prototype'][_0x20b6('0x3b')]=function(_0x269049,_0x4263f7){return this['sendRequest'](util[_0x20b6('0x2a')](_0x20b6('0x3c'),_0x269049,_0x4263f7));};AGIChannel['prototype'][_0x20b6('0x3d')]=function(_0x49eae0,_0x53ae09){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x3e'),_0x49eae0,_0x53ae09));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x3f')]=function(_0x1782dd,_0x3cd581,_0x5f479e){_0x3cd581=_0x3cd581||this[_0x20b6('0x40')];_0x5f479e=_0x5f479e||0x1;this[_0x20b6('0x41')](_0x1782dd);this[_0x20b6('0x42')](_0x3cd581);this['setPriority'](_0x5f479e);return this[_0x20b6('0x43')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x1782dd,_0x3cd581,_0x5f479e));};AGIChannel['prototype'][_0x20b6('0x44')]=function(_0x16fa7d){return this['sendRequest'](util[_0x20b6('0x2a')](_0x20b6('0x45'),_0x16fa7d));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x46')]=function(_0x3eb27f,_0x11edc3,_0x9d7ae3,_0x186190,_0x167eab,_0x5aab15){_0x11edc3=_0x11edc3||_0x20b6('0x47');_0x9d7ae3=_0x9d7ae3||'';_0x186190=_0x186190===undefined?-0x1:_0x186190==='-1'?-0x1:_0x186190*0x3e8;_0x167eab=_0x167eab===undefined?'':'s='+_0x167eab;_0x5aab15=_0x5aab15?_0x20b6('0x48'):'';return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x49'),_0x3eb27f,_0x11edc3,_0x9d7ae3,_0x186190,_0x5aab15,_0x167eab));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4a')]=function(_0x3e7df0,_0x192f71){_0x192f71=_0x192f71||'';return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x4b'),_0x3e7df0,_0x192f71));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4c')]=function(_0x549056){return this[_0x20b6('0x2d')]('AGI',_0x549056);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4d')]=function(_0x414629){return this['exec'](_0x20b6('0x4e'),_0x414629);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x18')]=function(_0x351d3e,_0x2112ce){this['noop'](util[_0x20b6('0x2a')](_0x20b6('0x4f'),_0x351d3e['id'],_0x351d3e[_0x20b6('0x50')],_0x2112ce));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x20b6('0x51')]=AGIChannel; \ No newline at end of file +var _0xe6e4=['search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe6e4,0x139));var _0x4e6e=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0xe6e4[_0x2f48cd];return _0x193ae2;};'use strict';var util=require(_0x4e6e('0x0'));var _=require(_0x4e6e('0x1'));var EventEmitter=require('events')[_0x4e6e('0x2')];var AGIReply=require(_0x4e6e('0x3'));var AGIError=require(_0x4e6e('0x4'));function AGIChannel(_0x57de71){var _0x4346cc=this,_0x280be0=new AGIReply(),_0x44cd95=![],_0x28220a={};EventEmitter['call'](_0x4346cc);_0x57de71[_0x4e6e('0x5')](_0x4e6e('0x6'));_0x57de71[_0x4e6e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x280be0[_0x4e6e('0x5')](_0x4e6e('0x6'));_0x280be0['on'](_0x4e6e('0x8'),function(_0xb81bc2){for(var _0x5debaf in _0xb81bc2){_0x4346cc[_0x5debaf]=_0xb81bc2[_0x5debaf];}_0x4346cc[_0x4e6e('0x9')](_0x4e6e('0xa'));});_0x280be0['on'](_0x4e6e('0xb'),function(_0x5e36ce){if(_0x5e36ce[_0x4e6e('0xc')]()=='hangup'){_0x4346cc[_0x4e6e('0x9')](_0x4e6e('0xd'));return;}if(_0x5e36ce[_0x4e6e('0xe')](0x0,0xb)=='520-Invalid'){_0x44cd95=!![];}if(_0x44cd95){_0x28220a['rx']+=_0x5e36ce+'\x0a';if(_0x5e36ce[_0x4e6e('0xf')](_0x4e6e('0x10'))!=-0x1){_0x44cd95=![];}}else{_0x28220a['rx']=_0x5e36ce;}if(_0x44cd95){return;}if(typeof _0x28220a['cb']==_0x4e6e('0x11')){var _0x2163e8=_0x28220a['rx'][_0x4e6e('0xe')](0x0,0x3),_0x2b1ef8=null,_0xef9381=null;_0x2163e8=parseInt(_0x2163e8);if(isNaN(_0x2163e8)){_0x28220a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2163e8!=0xc8){_0x28220a['cb'](null,{'code':_0x2163e8,'result':-0x1,'extra':'KO'});return;}_0x2b1ef8=_0x28220a['rx']['substring'](0x4)[_0x4e6e('0x12')](_0x4e6e('0x13'),'');if(_0x2b1ef8[_0x4e6e('0x14')]('\x20')!=-0x1){_0x2b1ef8=_0x2b1ef8[_0x4e6e('0x15')](0x0,_0x2b1ef8[_0x4e6e('0x14')]('\x20'));}if(_[_0x4e6e('0x16')](_0x2b1ef8,'-1')){_0x2b1ef8=parseInt(_0x2b1ef8);}_0xef9381=_0x28220a['rx'][_0x4e6e('0x17')]('\x20');if(_0xef9381[_0x4e6e('0x18')]==0x3){_0xef9381=_0xef9381[0x2][_0x4e6e('0xe')](0x1,_0xef9381[0x2][_0x4e6e('0x18')]-0x1);}else if(_0xef9381[_0x4e6e('0x18')]>0x3){var _0x1c6550=/\((.+)\)/;var _0x1c2eba=_0x28220a['rx'][_0x4e6e('0x19')](_0x1c6550);if(_0x1c2eba){_0xef9381=_0x1c2eba[0x1];}else{_0xef9381=null;}}else{_0xef9381=null;}_0x28220a['cb'](null,{'code':_0x2163e8,'result':_0x2b1ef8,'extra':_0xef9381});}});_0x57de71['on'](_0x4e6e('0x1a'),function(_0x4924e9){_0x4346cc['emit'](_0x4e6e('0x1a'),new AGIError(_0x4e6e('0x1b'),_0x4924e9['code']));});_0x57de71['on'](_0x4e6e('0x1c'),function(){_0x4346cc['emit'](_0x4e6e('0x1c'),new AGIError(_0x4e6e('0x1d')));});_0x57de71['on'](_0x4e6e('0x1e'),function(){_0x4346cc['emit']('timeout',new AGIError(_0x4e6e('0x1f')));_0x57de71[_0x4e6e('0x20')]();});_0x57de71[_0x4e6e('0x21')](_0x280be0);this[_0x4e6e('0x22')]=function(_0x8d3c32,_0x5860a2){var _0x8d3c32=_0x8d3c32||'',_0x5860a2=typeof _0x5860a2==_0x4e6e('0x11')?_0x5860a2:new Function();_0x28220a={'tx':_0x8d3c32,'rx':'','cb':_0x5860a2};_0x57de71[_0x4e6e('0x23')](_0x8d3c32+'\x0a');},this[_0x4e6e('0x1c')]=function(){_0x57de71[_0x4e6e('0x20')]();};}util[_0x4e6e('0x24')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x4e6e('0x25')]=function(_0x1ad7ca){return this[_0x4e6e('0x22')][_0x4e6e('0x26')](this,_0x1ad7ca);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x28')]=function(){return this[_0x4e6e('0x25')](_0x4e6e('0x29'));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x2a')]=function(_0x334bac,_0x1eab17,_0x949807){_0x334bac=_0x334bac===undefined?_0x4e6e('0x2b'):_0x334bac;_0x1eab17=_0x1eab17===undefined?'5':_0x1eab17;_0x949807=_0x949807===undefined?'1':_0x949807;return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x2d'),_0x334bac,_0x1eab17*0x3e8,_0x949807));};AGIChannel[_0x4e6e('0x27')]['noop']=function(_0x598bb6){_0x598bb6=_0x598bb6||_0x4e6e('0x2e');return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')]('VERBOSE\x20\x22%s\x22',_0x598bb6));};AGIChannel['prototype']['exec']=function(_0x2c2472,_0x25da20){if(_[_0x4e6e('0x2f')](_0x25da20)){return this['sendRequest'](util[_0x4e6e('0x2c')]('EXEC\x20%s\x20%s',_0x2c2472,_0x25da20[_0x4e6e('0x30')](',')));}return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x31'),_0x2c2472,_0x25da20));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x32')]=function(_0x4c4d91){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x33'),_0x4c4d91));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x34')]=function(_0x1ddf55){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x35'),_0x1ddf55));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x36')]=function(_0x233327){return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x37'),_0x233327));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0xd')]=function(){return this[_0x4e6e('0x25')](_0x4e6e('0x38'));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x39')]=function(_0x27b4a9,_0x1418a3){var _0x5c51f4=_[_0x4e6e('0x3a')](_0x1418a3)||_[_0x4e6e('0x3b')](_0x1418a3)?_0x1418a3['toString']():_0x1418a3;return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x3c'),_0x27b4a9,_0x5c51f4?_0x5c51f4[_0x4e6e('0x3d')]()[_0x4e6e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x3e')]=function(_0x128668,_0x4a9409){return this[_0x4e6e('0x25')](util['format'](_0x4e6e('0x3f'),_0x128668,_0x4a9409));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x40')]=function(_0x46ce64,_0x2ba26c){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x46ce64,_0x2ba26c));};AGIChannel[_0x4e6e('0x27')]['sayPhonetic']=function(_0x19281a,_0x176480){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x41'),_0x19281a,_0x176480));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x42')]=function(_0x365c15,_0x13742a,_0x3b94dc){_0x13742a=_0x13742a||this['extension'];_0x3b94dc=_0x3b94dc||0x1;this[_0x4e6e('0x32')](_0x365c15);this[_0x4e6e('0x34')](_0x13742a);this[_0x4e6e('0x36')](_0x3b94dc);return this[_0x4e6e('0x43')](util['format'](_0x4e6e('0x44'),_0x365c15,_0x13742a,_0x3b94dc));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x45')]=function(_0x37b306){return this[_0x4e6e('0x25')](util['format'](_0x4e6e('0x46'),_0x37b306));};AGIChannel[_0x4e6e('0x27')]['recordFile']=function(_0x34aa39,_0x2c44dd,_0x577e5c,_0x1132be,_0x37f045,_0x13f453){_0x2c44dd=_0x2c44dd||_0x4e6e('0x47');_0x577e5c=_0x577e5c||'';_0x1132be=_0x1132be===undefined?-0x1:_0x1132be==='-1'?-0x1:_0x1132be*0x3e8;_0x37f045=_0x37f045===undefined?'':'s='+_0x37f045;_0x13f453=_0x13f453?'BEEP':'';return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x48'),_0x34aa39,_0x2c44dd,_0x577e5c,_0x1132be,_0x13f453,_0x37f045));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x49')]=function(_0x5d1582,_0x1ddd6e){_0x1ddd6e=_0x1ddd6e||'';return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x4a'),_0x5d1582,_0x1ddd6e));};AGIChannel['prototype'][_0x4e6e('0x4b')]=function(_0x4f1442){return this['exec'](_0x4e6e('0x4c'),_0x4f1442);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x4d')]=function(_0x12c1b3){return this[_0x4e6e('0x4e')]('WAIT',_0x12c1b3);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x1a')]=function(_0x43973b,_0x4379b7){this[_0x4e6e('0x43')](util['format'](_0x4e6e('0x4f'),_0x43973b['id'],_0x43973b[_0x4e6e('0x50')],_0x4379b7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4e6e('0x51')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index cc2ef9d..9a87ca7 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 _0x6f37=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','util'];(function(_0x5d04c0,_0x312567){var _0xee356e=function(_0x19b13f){while(--_0x19b13f){_0x5d04c0['push'](_0x5d04c0['shift']());}};_0xee356e(++_0x312567);}(_0x6f37,0x1d0));var _0x76f3=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x6f37[_0x7ad123];return _0x37d073;};'use strict';var util=require(_0x76f3('0x0'));var error={'E_AGI_UNDEFINED':_0x76f3('0x1'),'E_AGI_ARGUMENT_PORT':_0x76f3('0x2'),'E_AGI_SERVER_ERROR':_0x76f3('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x76f3('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x76f3('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x76f3('0x6'),'E_AGI_COMMAND_EMPTY':_0x76f3('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x76f3('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x329679){var _0x329679=_0x329679||null,_0x54b080=_0x54b080||[],_0x3a9076=0x1,_0x16e204='';if(!error[_0x329679]){_0x329679=_0x76f3('0x9');}_0x54b080[_0x76f3('0xa')](error[_0x329679]);while(arguments[_0x3a9076]){_0x54b080['push'](arguments[_0x3a9076]);_0x3a9076++;}_0x16e204=util[_0x76f3('0xb')][_0x76f3('0xc')](util,_0x54b080);this[_0x76f3('0xd')]=_0x16e204;this[_0x76f3('0xe')]=_0x329679;}module['exports']=AGIError; \ No newline at end of file +var _0x93c9=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x3ef606,_0x2f3682){var _0x3d61bb=function(_0x1d23db){while(--_0x1d23db){_0x3ef606['push'](_0x3ef606['shift']());}};_0x3d61bb(++_0x2f3682);}(_0x93c9,0x14e));var _0x993c=function(_0x4c16dd,_0x128b30){_0x4c16dd=_0x4c16dd-0x0;var _0x118701=_0x93c9[_0x4c16dd];return _0x118701;};'use strict';var util=require(_0x993c('0x0'));var error={'E_AGI_UNDEFINED':_0x993c('0x1'),'E_AGI_ARGUMENT_PORT':_0x993c('0x2'),'E_AGI_SERVER_ERROR':_0x993c('0x3'),'E_AGI_SERVER_CLOSE':_0x993c('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x993c('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x993c('0x6'),'E_AGI_SOCKET_ERROR':_0x993c('0x7'),'E_AGI_SOCKET_CLOSE':_0x993c('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x993c('0x9'),'E_AGI_COMMAND_EMPTY':_0x993c('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x993c('0xb'),'E_AGI_IVR_ENTRY':_0x993c('0xc')};function AGIError(_0x57b493){var _0x57b493=_0x57b493||null,_0x3f2b69=_0x3f2b69||[],_0x4a6d9a=0x1,_0x4229c5='';if(!error[_0x57b493]){_0x57b493=_0x993c('0xd');}_0x3f2b69[_0x993c('0xe')](error[_0x57b493]);while(arguments[_0x4a6d9a]){_0x3f2b69[_0x993c('0xe')](arguments[_0x4a6d9a]);_0x4a6d9a++;}_0x4229c5=util[_0x993c('0xf')][_0x993c('0x10')](util,_0x3f2b69);this['message']=_0x4229c5;this[_0x993c('0x11')]=_0x57b493;}module[_0x993c('0x12')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 2dd9cd4..8a20390 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1935=['defaults','redis','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1935,0x71));var _0x5193=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x1935[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x5193('0x0'));var EventEmitter=require(_0x5193('0x1'))[_0x5193('0x2')];var Redis=require(_0x5193('0x3'));var AGIError=require(_0x5193('0x4'));var config=require(_0x5193('0x5'));config['redis']=_[_0x5193('0x6')](config[_0x5193('0x7')],{'host':_0x5193('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5193('0x7')]);sub[_0x5193('0x9')](_0x5193('0xa'),function(_0x5a9aab){if(_0x5a9aab)return eventEmitter[_0x5193('0xb')]('error',new AGIError(_0x5193('0xc'),_0x5a9aab));});sub['on'](_0x5193('0xd'),function(_0xcfe9ec,_0x3adcf6){if(_0xcfe9ec!==_0x5193('0xa'))return;try{var _0x3754a8=JSON['parse'](_0x3adcf6);eventEmitter['emit'](_0x5193('0xe'),_0x3754a8);}catch(_0x3a37f4){eventEmitter[_0x5193('0xb')](_0x5193('0xf'),new AGIError(_0x5193('0xc'),_0x3a37f4));}});module[_0x5193('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xc00a=['agi','error','message','parse','emit','E_AGI_SERVER_ERROR','exports','lodash','events','EventEmitter','./error','redis','defaults','localhost','subscribe'];(function(_0x471ec4,_0x42c871){var _0x43ab60=function(_0x178e9f){while(--_0x178e9f){_0x471ec4['push'](_0x471ec4['shift']());}};_0x43ab60(++_0x42c871);}(_0xc00a,0xac));var _0xac00=function(_0x51eb91,_0x4799d5){_0x51eb91=_0x51eb91-0x0;var _0x1c4fc4=_0xc00a[_0x51eb91];return _0x1c4fc4;};'use strict';var _=require(_0xac00('0x0'));var EventEmitter=require(_0xac00('0x1'))[_0xac00('0x2')];var Redis=require('ioredis');var AGIError=require(_0xac00('0x3'));var config=require('../../config/environment');config[_0xac00('0x4')]=_[_0xac00('0x5')](config[_0xac00('0x4')],{'host':_0xac00('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xac00('0x4')]);sub[_0xac00('0x7')](_0xac00('0x8'),function(_0x4b04c3){if(_0x4b04c3)return eventEmitter['emit'](_0xac00('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x4b04c3));});sub['on'](_0xac00('0xa'),function(_0x17523f,_0x553dcf){if(_0x17523f!==_0xac00('0x8'))return;try{var _0x30a07a=JSON[_0xac00('0xb')](_0x553dcf);eventEmitter[_0xac00('0xc')]('projectUpdate',_0x30a07a);}catch(_0x5eff2d){eventEmitter[_0xac00('0xc')](_0xac00('0x9'),new AGIError(_0xac00('0xd'),_0x5eff2d));}});module[_0xac00('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index ef9ddb4..b0608c5 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 _0xd8af=['relations','getVertex','traverseBFS','info','no\x20edge/s\x20available','length','condition','split','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','vertices','numberOfEdges','addVertex','edges','prototype','addEdge','size'];(function(_0x7c3553,_0x58020e){var _0x3d2fc5=function(_0x1197d1){while(--_0x1197d1){_0x7c3553['push'](_0x7c3553['shift']());}};_0x3d2fc5(++_0x58020e);}(_0xd8af,0x145));var _0xfd8a=function(_0xd96994,_0x235693){_0xd96994=_0xd96994-0x0;var _0x253aee=_0xd8af[_0xd96994];return _0x253aee;};'use strict';var _=require('lodash');var logger=require(_0xfd8a('0x0'))(_0xfd8a('0x1'));var verticesWithRetry=[_0xfd8a('0x2'),_0xfd8a('0x3'),'getsecretdigits'];var Graph=function(){this[_0xfd8a('0x4')]={};this['edges']={};this[_0xfd8a('0x5')]=0x0;};Graph['prototype'][_0xfd8a('0x6')]=function(_0x391475){this['vertices'][_0x391475['id']]=_0x391475;this[_0xfd8a('0x7')][_0x391475['id']]=[];};Graph[_0xfd8a('0x8')][_0xfd8a('0x9')]=function(_0x388001,_0x1583a7,_0x21e181){this[_0xfd8a('0x7')][_0x388001]['push']({'target':_0x1583a7,'condition':_0x21e181});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0xfd8a('0xa')](this[_0xfd8a('0x4')]);};Graph[_0xfd8a('0x8')][_0xfd8a('0xb')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0xfd8a('0xc')]=function(_0xbc43e5){return this[_0xfd8a('0x4')][_0xbc43e5];};Graph['prototype'][_0xfd8a('0xd')]=function(_0x1598e2,_0x271f9a){if(!this[_0xfd8a('0x4')][_0x1598e2]){return logger[_0xfd8a('0xe')]('no\x20vertex\x20found');}var _0x31fa78=_0x271f9a(this['vertices'][_0x1598e2]);if(!_0x31fa78){return logger[_0xfd8a('0xe')]('stop\x20traverse');}if(this['edges'][_0x1598e2]['length']===0x0){return logger['info'](_0xfd8a('0xf'));}for(var _0x61a213=0x0,_0x4eaf46=[],_0x16b5a6=![];_0x61a213\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally'];(function(_0xc75ef6,_0x288e5a){var _0x1f3214=function(_0x565083){while(--_0x565083){_0xc75ef6['push'](_0xc75ef6['shift']());}};_0x1f3214(++_0x288e5a);}(_0xb233,0x11e));var _0x3b23=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xb233[_0x5f49c0];return _0x5ab653;};'use strict';var _=require(_0x3b23('0x0'));var syncho=require(_0x3b23('0x1'));var util=require(_0x3b23('0x2'));var config=require(_0x3b23('0x3'));var logger=require(_0x3b23('0x4'))(_0x3b23('0x5'));var utilLicense=require(_0x3b23('0x6'));var rpc=require('./rpc');var Project=require(_0x3b23('0x7'));var AGIEmitter=require(_0x3b23('0x8'))[_0x3b23('0x9')];var projects=[];config[_0x3b23('0x5')]=_[_0x3b23('0xa')](config[_0x3b23('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x3b23('0xb'),projectUpdateHandler);function connectionHandler(_0x357aa8){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x357aa8);agiHandler(_0x357aa8);}catch(_0x3dc935){logger['error'](_0x3dc935[_0x3b23('0xc')]);}});});}function projectUpdateHandler(_0x5985c9){try{var _0x63949e=_[_0x3b23('0xd')](projects,['id',_0x5985c9['id']]);if(_0x63949e>-0x1){if(_0x5985c9['deleted']===!![]){projects[_0x3b23('0xe')](_0x63949e,0x1);}else{projects[_0x63949e]=_0x5985c9;}}else{projects[_0x3b23('0xf')](_0x5985c9);}}catch(_0x3d3bb6){logger[_0x3b23('0x10')](_0x3d3bb6[_0x3b23('0xc')]);}}function listeningHandler(){console[_0x3b23('0x11')](_0x3b23('0x12'),config[_0x3b23('0x5')][_0x3b23('0x13')]);logger[_0x3b23('0x14')](util[_0x3b23('0x15')](_0x3b23('0x16'),config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x32d10d){if(_0x32d10d&&_0x32d10d[_0x3b23('0x17')]&&_0x32d10d[_0x3b23('0x18')]){logger['error'](util[_0x3b23('0x15')]('[%s]\x20%s',_0x32d10d['name'],_0x32d10d[_0x3b23('0x18')]));}else{logger[_0x3b23('0x10')](util[_0x3b23('0x15')](_0x3b23('0x19'),_0x32d10d['stack']));}}function closeHandler(){logger[_0x3b23('0x14')](util[_0x3b23('0x15')](_0x3b23('0x1a'),this['arg_1'],this['calleridname'],this['callerid'],this[_0x3b23('0x1b')],this[_0x3b23('0x1c')]));try{createSquareReport(this);}catch(_0x34c2fa){logger[_0x3b23('0x10')](_0x34c2fa[_0x3b23('0xc')]);}}function timeoutHandler(){logger[_0x3b23('0x14')](util['format'](_0x3b23('0x1d'),this[_0x3b23('0x1e')],this[_0x3b23('0x1f')],this[_0x3b23('0x20')],this[_0x3b23('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x3b23('0x14')](util[_0x3b23('0x15')](_0x3b23('0x21'),this['arg_1'],this[_0x3b23('0x1f')],this['callerid'],this['dnid'],this[_0x3b23('0x1c')]));this[_0x3b23('0x22')]=!![];}function createSquareReport(_0x375e62,_0x224bcc){rpc[_0x3b23('0x23')](_0x375e62)[_0x3b23('0x24')](function(_0x297a15){if(_0x224bcc){_0x224bcc(null,_0x297a15);}})[_0x3b23('0x25')](function(_0x767b25){if(_0x224bcc){_0x224bcc(null,_0x767b25);}});}function setChannelVariables(_0x382fca){for(var _0x406168 in _0x382fca){if(_0x382fca[_0x3b23('0x26')](_0x406168)){if(_0x406168[_0x3b23('0x27')](_0x3b23('0x28'))===0x0){_0x382fca[_0x406168['substring'](0x4)]=_0x382fca[_0x406168];delete _0x382fca[_0x406168];}}}}function agiHandler(_0x5af762){logger[_0x3b23('0x29')](_0x3b23('0x2a'),JSON['stringify'](_0x5af762,null,0x2));logger[_0x3b23('0x14')](util[_0x3b23('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5af762[_0x3b23('0x1e')],_0x5af762[_0x3b23('0x1f')],_0x5af762[_0x3b23('0x20')],_0x5af762[_0x3b23('0x1b')],_0x5af762['uniqueid']));_0x5af762['on'](_0x3b23('0x10'),errorHandler);_0x5af762['on'](_0x3b23('0x2b'),closeHandler);_0x5af762['on'](_0x3b23('0x2c'),timeoutHandler);_0x5af762['evtHangup']=![];_0x5af762['on']('hangup',hangupHandler);var _0x3edce5=_[_0x3b23('0x2d')](projects,[_0x3b23('0x17'),_0x5af762[_0x3b23('0x1e')]]);if(!_0x3edce5)return Project[_0x3b23('0x2e')](_0x5af762);if(!_0x3edce5[_0x3b23('0x2f')])return Project[_0x3b23('0x30')](_0x5af762);return Project[_0x3b23('0x31')](_0x3edce5,_0x5af762);}function main(){var _0x9c7b02;return utilLicense['getLicense']()['then'](function(_0x23e06f){if(!_0x23e06f)return;if(_0x23e06f[_0x3b23('0x32')]){if(_0x23e06f[_0x3b23('0x33')]&&_0x23e06f[_0x3b23('0x33')]>0x0){logger[_0x3b23('0x14')](util['format'](_0x3b23('0x34'),_0x23e06f[_0x3b23('0x33')]));_0x9c7b02=_0x23e06f[_0x3b23('0x33')];}else{logger[_0x3b23('0x14')](_0x3b23('0x35'));}}else{logger[_0x3b23('0x14')](_0x3b23('0x36'));_0x9c7b02=-0x1;}})[_0x3b23('0x24')](function(){return Project['getAll']();})[_0x3b23('0x24')](function(_0x1ce96f){projects=_0x1ce96f;return;})[_0x3b23('0x25')](function(_0x28ad9f){logger['error']('[LICENSE]',_0x28ad9f[_0x3b23('0xc')]);})[_0x3b23('0x37')](function(){var _0x1f3b11=require('./server')(config[_0x3b23('0x5')]['port'],config[_0x3b23('0x5')]['ip'],_0x9c7b02);_0x1f3b11['on'](_0x3b23('0x10'),errorHandler);_0x1f3b11['on']('listening',listeningHandler);_0x1f3b11['on'](_0x3b23('0x38'),connectionHandler);_0x1f3b11['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xc60c=['debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','EventEmitter','agi','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring'];(function(_0x3bfc7a,_0x5bcc67){var _0x35dd5a=function(_0x713734){while(--_0x713734){_0x3bfc7a['push'](_0x3bfc7a['shift']());}};_0x35dd5a(++_0x5bcc67);}(_0xc60c,0x116));var _0xcc60=function(_0x4b1473,_0x570c61){_0x4b1473=_0x4b1473-0x0;var _0x4eb602=_0xc60c[_0x4b1473];return _0x4eb602;};'use strict';var _=require(_0xcc60('0x0'));var syncho=require(_0xcc60('0x1'));var util=require(_0xcc60('0x2'));var config=require(_0xcc60('0x3'));var logger=require(_0xcc60('0x4'))('agi');var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require('./events')[_0xcc60('0x5')];var projects=[];config[_0xcc60('0x6')]=_[_0xcc60('0x7')](config[_0xcc60('0x6')],{'ip':_0xcc60('0x8'),'port':0x11dd});AGIEmitter['on'](_0xcc60('0x9'),projectUpdateHandler);function connectionHandler(_0x5752bf){process[_0xcc60('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5752bf);agiHandler(_0x5752bf);}catch(_0x5997f4){logger[_0xcc60('0xb')](_0x5997f4[_0xcc60('0xc')]);}});});}function projectUpdateHandler(_0x23150b){try{var _0x5ef9f1=_[_0xcc60('0xd')](projects,['id',_0x23150b['id']]);if(_0x5ef9f1>-0x1){if(_0x23150b[_0xcc60('0xe')]===!![]){projects[_0xcc60('0xf')](_0x5ef9f1,0x1);}else{projects[_0x5ef9f1]=_0x23150b;}}else{projects[_0xcc60('0x10')](_0x23150b);}}catch(_0x19ecaa){logger[_0xcc60('0xb')](_0x19ecaa[_0xcc60('0xc')]);}}function listeningHandler(){console[_0xcc60('0x11')](_0xcc60('0x12'),config[_0xcc60('0x6')][_0xcc60('0x13')]);logger[_0xcc60('0x14')](util['format'](_0xcc60('0x15'),config[_0xcc60('0x6')]['ip'],config[_0xcc60('0x6')]['port']));}function errorHandler(_0x3aa306){if(_0x3aa306&&_0x3aa306[_0xcc60('0x16')]&&_0x3aa306['message']){logger[_0xcc60('0xb')](util[_0xcc60('0x17')](_0xcc60('0x18'),_0x3aa306[_0xcc60('0x16')],_0x3aa306[_0xcc60('0x19')]));}else{logger[_0xcc60('0xb')](util[_0xcc60('0x17')](_0xcc60('0x1a'),_0x3aa306[_0xcc60('0xc')]));}}function closeHandler(){logger['info'](util[_0xcc60('0x17')](_0xcc60('0x1b'),this[_0xcc60('0x1c')],this['calleridname'],this['callerid'],this['dnid'],this[_0xcc60('0x1d')]));try{createSquareReport(this);}catch(_0x34b85c){logger['error'](_0x34b85c[_0xcc60('0xc')]);}}function timeoutHandler(){logger['info'](util[_0xcc60('0x17')](_0xcc60('0x1e'),this[_0xcc60('0x1c')],this[_0xcc60('0x1f')],this[_0xcc60('0x20')],this[_0xcc60('0x21')],this[_0xcc60('0x1d')]));}function hangupHandler(){logger[_0xcc60('0x14')](util[_0xcc60('0x17')](_0xcc60('0x22'),this[_0xcc60('0x1c')],this[_0xcc60('0x1f')],this['callerid'],this[_0xcc60('0x21')],this['uniqueid']));this[_0xcc60('0x23')]=!![];}function createSquareReport(_0xdd7f20,_0x1477ed){rpc[_0xcc60('0x24')](_0xdd7f20)[_0xcc60('0x25')](function(_0x375a4c){if(_0x1477ed){_0x1477ed(null,_0x375a4c);}})['catch'](function(_0x5df29e){if(_0x1477ed){_0x1477ed(null,_0x5df29e);}});}function setChannelVariables(_0x1b5aec){for(var _0x1209d3 in _0x1b5aec){if(_0x1b5aec[_0xcc60('0x26')](_0x1209d3)){if(_0x1209d3[_0xcc60('0x27')](_0xcc60('0x28'))===0x0){_0x1b5aec[_0x1209d3[_0xcc60('0x29')](0x4)]=_0x1b5aec[_0x1209d3];delete _0x1b5aec[_0x1209d3];}}}}function agiHandler(_0xbcb3cb){logger[_0xcc60('0x2a')](_0xcc60('0x2b'),JSON[_0xcc60('0x2c')](_0xbcb3cb,null,0x2));logger[_0xcc60('0x14')](util[_0xcc60('0x17')](_0xcc60('0x2d'),_0xbcb3cb[_0xcc60('0x1c')],_0xbcb3cb['calleridname'],_0xbcb3cb[_0xcc60('0x20')],_0xbcb3cb[_0xcc60('0x21')],_0xbcb3cb[_0xcc60('0x1d')]));_0xbcb3cb['on'](_0xcc60('0xb'),errorHandler);_0xbcb3cb['on'](_0xcc60('0x2e'),closeHandler);_0xbcb3cb['on']('timeout',timeoutHandler);_0xbcb3cb['evtHangup']=![];_0xbcb3cb['on'](_0xcc60('0x2f'),hangupHandler);var _0x5cf7c9=_[_0xcc60('0x30')](projects,[_0xcc60('0x16'),_0xbcb3cb[_0xcc60('0x1c')]]);if(!_0x5cf7c9)return Project[_0xcc60('0x31')](_0xbcb3cb);if(!_0x5cf7c9['production'])return Project[_0xcc60('0x32')](_0xbcb3cb);return Project[_0xcc60('0x33')](_0x5cf7c9,_0xbcb3cb);}function main(){var _0x3e067b;return utilLicense[_0xcc60('0x34')]()[_0xcc60('0x25')](function(_0x4bae28){if(!_0x4bae28)return;if(_0x4bae28[_0xcc60('0x35')]){if(_0x4bae28[_0xcc60('0x36')]&&_0x4bae28[_0xcc60('0x36')]>0x0){logger[_0xcc60('0x14')](util[_0xcc60('0x17')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4bae28['callysquare']));_0x3e067b=_0x4bae28['callysquare'];}else{logger[_0xcc60('0x14')](_0xcc60('0x37'));}}else{logger[_0xcc60('0x14')](_0xcc60('0x38'));_0x3e067b=-0x1;}})[_0xcc60('0x25')](function(){return Project[_0xcc60('0x39')]();})[_0xcc60('0x25')](function(_0x46af75){projects=_0x46af75;return;})[_0xcc60('0x3a')](function(_0x247f70){logger[_0xcc60('0xb')](_0xcc60('0x3b'),_0x247f70[_0xcc60('0xc')]);})[_0xcc60('0x3c')](function(){var _0x2c9af3=require(_0xcc60('0x3d'))(config[_0xcc60('0x6')][_0xcc60('0x13')],config[_0xcc60('0x6')]['ip'],_0x3e067b);_0x2c9af3['on']('error',errorHandler);_0x2c9af3['on'](_0xcc60('0x3e'),listeningHandler);_0x2c9af3['on'](_0xcc60('0x3f'),connectionHandler);_0x2c9af3['on'](_0xcc60('0x2e'),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 ca4ea84..b30efa0 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 _0x8f92=['http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x8f92,0x1aa));var _0x28f9=function(_0x569187,_0x214d62){_0x569187=_0x569187-0x0;var _0x1a254f=_0x8f92[_0x569187];return _0x1a254f;};'use strict';var BPromise=require(_0x28f9('0x0'));var jayson=require(_0x28f9('0x1'));var client=jayson[_0x28f9('0x2')][_0x28f9('0x3')]({'port':0x232b});function request(_0x483d36,_0x3de36d){return new BPromise(function(_0x5f2cea,_0x43d925){return client[_0x28f9('0x4')](_0x483d36,_0x3de36d)[_0x28f9('0x5')](function(_0x506a90){if(_0x506a90[_0x28f9('0x6')]){return _0x43d925(_0x506a90[_0x28f9('0x6')]['message']);}else{return _0x5f2cea(_0x506a90[_0x28f9('0x7')]);}})[_0x28f9('0x8')](function(_0xeb449d){return _0x43d925(_0xeb449d);});});}exports[_0x28f9('0x9')]=function(_0x1a948c,_0x2c344d){return request(_0x28f9('0xa'),{'account':_0x1a948c,'message':_0x2c344d});}; \ No newline at end of file +var _0x7615=['result','catch','SendMail','client','http','request','then','error'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x7615,0xc3));var _0x5761=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x7615[_0x3fb9dd];return _0x20136a;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x5761('0x0')][_0x5761('0x1')]({'port':0x232b});function request(_0x1df54c,_0x414b39){return new BPromise(function(_0x508e86,_0x593323){return client[_0x5761('0x2')](_0x1df54c,_0x414b39)[_0x5761('0x3')](function(_0x2073a4){if(_0x2073a4[_0x5761('0x4')]){return _0x593323(_0x2073a4[_0x5761('0x4')]['message']);}else{return _0x508e86(_0x2073a4[_0x5761('0x5')]);}})[_0x5761('0x6')](function(_0x4b2daf){return _0x593323(_0x4b2daf);});});}exports['sendMailMessage']=function(_0x45376b,_0x47acc8){return request(_0x5761('0x7'),{'account':_0x45376b,'message':_0x47acc8});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 4a95324..8acb360 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bd2=['extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','arg_1','callerid','uniqueid','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','agi','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','length','source','target','value','toJson','mxGraphModel','root','production','debug','stringify','format','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0xd38de,_0xecd845){var _0x2c394c=function(_0x2ce989){while(--_0x2ce989){_0xd38de['push'](_0xd38de['shift']());}};_0x2c394c(++_0xecd845);}(_0x1bd2,0x174));var _0x21bd=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1bd2[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x21bd('0x0'));var moment=require('moment');var parser=require(_0x21bd('0x1'));var util=require(_0x21bd('0x2'));var logger=require(_0x21bd('0x3'))(_0x21bd('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x21bd('0x5'));var Graph=require(_0x21bd('0x6'));var Vertices=require(_0x21bd('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x21bd('0x8')](function(_0x1cbadc){logger[_0x21bd('0x9')](_0x21bd('0xa'),_0x1cbadc[_0x21bd('0xb')]);return[];});}function addVertex(_0x426550,_0x583821,_0xe12a59){_0x583821['agicommand']=_0xe12a59;if(_0x583821['hasOwnProperty'](_0x21bd('0xc'))){_0x583821[_0x21bd('0xd')]=parseInt(_0x583821[_0x21bd('0xc')],0xa);}_0x426550[_0x21bd('0xe')](_[_0x21bd('0xf')](_0x583821,'mxCell'));}function initGraph(_0x428cd4,_0x5007a7){var _0x521cae=new Graph();for(var _0x24e20e in _0x428cd4){if(_0x428cd4[_0x21bd('0x10')](_0x24e20e)){if(_[_0x21bd('0x11')](_0x428cd4[_0x24e20e])){for(var _0x1ed59a=0x0;_0x1ed59a<_0x428cd4[_0x24e20e][_0x21bd('0x12')];_0x1ed59a+=0x1){addVertex(_0x521cae,_0x428cd4[_0x24e20e][_0x1ed59a],_0x24e20e);}}else{addVertex(_0x521cae,_0x428cd4[_0x24e20e],_0x24e20e);}}}for(var _0x2a2bb4=0x0;_0x2a2bb4<_0x5007a7[_0x21bd('0x12')];_0x2a2bb4+=0x1){if(_0x5007a7[_0x2a2bb4][_0x21bd('0x13')]&&_0x5007a7[_0x2a2bb4][_0x21bd('0x14')]){_0x521cae['addEdge'](_0x5007a7[_0x2a2bb4][_0x21bd('0x13')],_0x5007a7[_0x2a2bb4][_0x21bd('0x14')],_0x5007a7[_0x2a2bb4][_0x21bd('0x15')]);}}return _0x521cae;}function getRoot(_0x2b6707){return parser[_0x21bd('0x16')](_0x2b6707,{'object':!![]})[_0x21bd('0x17')][_0x21bd('0x18')];}function inspect(_0x491569){return util['inspect'](_0x491569,{'showHidden':![],'depth':null});}function initialize(_0x4c78f3,_0x3cb75d){var _0x5b5dfd=getRoot(_0x4c78f3[_0x21bd('0x19')]);if(!_0x5b5dfd||!_0x5b5dfd['start'])return;var _0x29d8a2,_0x599e5c,_0x644bcb;logger[_0x21bd('0x1a')](_0x21bd('0x18'),JSON[_0x21bd('0x1b')](_0x5b5dfd,null,0x2));_0x3cb75d['joinAt']=moment()[_0x21bd('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x29d8a2=initGraph(_[_0x21bd('0xf')](_0x5b5dfd,_0x21bd('0x1d')),_0x5b5dfd[_0x21bd('0x1d')]);_0x599e5c=new Vertices(_0x3cb75d,rpc,mailRpc);logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')](_0x21bd('0x1f'),_0x3cb75d['arg_1'],_0x3cb75d[_0x21bd('0x20')],_0x3cb75d['callerid'],_0x3cb75d[_0x21bd('0x21')],_0x3cb75d['uniqueid']));_0x29d8a2[_0x21bd('0x22')](_0x5b5dfd[_0x21bd('0x23')]['id'],function(_0x1b3c5e){try{_0x1b3c5e=_0x599e5c[_0x21bd('0x24')](_0x1b3c5e);logger[_0x21bd('0x1a')](_0x21bd('0x25'),JSON['stringify'](_0x1b3c5e,null,0x2));if(_0x1b3c5e['agicommand']===_0x21bd('0x26')){logger[_0x21bd('0x1e')](_0x21bd('0x27'));_0x3cb75d[_0x21bd('0x28')]=_0x1b3c5e[_0x21bd('0x28')]||_0x3cb75d[_0x21bd('0x28')];_0x3cb75d[_0x21bd('0x29')]=_0x1b3c5e[_0x21bd('0x29')];_0x3cb75d[_0x21bd('0x2a')]=_0x1b3c5e[_0x21bd('0x2a')]?_0x1b3c5e['priority']-0x1:0x1;return null;}else if(_0x1b3c5e&&_0x599e5c[_0x1b3c5e['agicommand']]){_0x644bcb=_0x599e5c[_0x1b3c5e['agicommand']](_0x1b3c5e);logger['info'](_0x21bd('0x2b'),JSON[_0x21bd('0x1b')](_0x644bcb,null,0x2));if(_0x644bcb&&_0x644bcb[_0x21bd('0x2c')]===AGI_CODE_SUCCESS&&_0x644bcb[_0x21bd('0x2d')]!==AGI_RESULT_ERROR&&!_0x3cb75d['evtHangup']){logger[_0x21bd('0x1a')]('response',inspect(_0x644bcb));return _['isUndefined'](_0x644bcb[_0x21bd('0x2d')])?null:_0x644bcb['result'][_0x21bd('0x2e')]();}else{logger[_0x21bd('0x9')](_0x21bd('0x2b'),inspect(_0x644bcb));return null;}}else{logger[_0x21bd('0x9')](_0x21bd('0x2f'));return null;}}catch(_0xa55117){logger[_0x21bd('0x9')](_0xa55117[_0x21bd('0xb')]);return null;}});if(_0x5b5dfd[_0x21bd('0x30')]){logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3cb75d[_0x21bd('0x31')],_0x3cb75d[_0x21bd('0x20')],_0x3cb75d[_0x21bd('0x32')],_0x3cb75d[_0x21bd('0x21')],_0x3cb75d[_0x21bd('0x33')]));_0x29d8a2[_0x21bd('0x22')](_0x5b5dfd[_0x21bd('0x30')]['id'],function(_0x5714f0){try{_0x5714f0=_0x599e5c[_0x21bd('0x24')](_0x5714f0);logger[_0x21bd('0x1a')]('vertex',JSON['stringify'](_0x5714f0,null,0x2));if(_0x5714f0&&_0x599e5c[_0x5714f0['agicommand']]){_0x644bcb=_0x599e5c[_0x5714f0['agicommand']](_0x5714f0);if(_0x644bcb){logger[_0x21bd('0x1a')](_0x21bd('0x2b'),inspect(_0x644bcb));return _[_0x21bd('0x34')](_0x644bcb[_0x21bd('0x2d')])?null:_0x644bcb[_0x21bd('0x2d')][_0x21bd('0x2e')]();}else{logger[_0x21bd('0x9')](_0x21bd('0x2b'),inspect(_0x644bcb));return null;}}else{logger['error'](_0x21bd('0x2f'));return null;}}catch(_0x32fe6c){logger[_0x21bd('0x9')](_0x32fe6c[_0x21bd('0xb')]);return null;}});}logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')](_0x21bd('0x35'),_0x3cb75d[_0x21bd('0x31')],_0x3cb75d[_0x21bd('0x20')],_0x3cb75d[_0x21bd('0x32')],_0x3cb75d['dnid'],_0x3cb75d[_0x21bd('0x33')]));logger[_0x21bd('0x1e')](util[_0x21bd('0x1c')](_0x21bd('0x36'),_0x3cb75d[_0x21bd('0x28')],_0x3cb75d['extension'],parseInt(_0x3cb75d['priority'],0xa)+0x1));_0x3cb75d[_0x21bd('0x37')](_0x3cb75d['context'],_0x3cb75d[_0x21bd('0x29')],parseInt(_0x3cb75d[_0x21bd('0x2a')],0xa)+0x1);_0x3cb75d[_0x21bd('0x38')]();}function handleNotFound(_0x2b7dc3){logger[_0x21bd('0x9')](util[_0x21bd('0x1c')]('Project\x20%s\x20not\x20found',_0x2b7dc3[_0x21bd('0x31')]));_0x2b7dc3[_0x21bd('0x37')](_0x2b7dc3[_0x21bd('0x28')],_0x2b7dc3[_0x21bd('0x29')],parseInt(_0x2b7dc3['priority'],0xa)+0x1);_0x2b7dc3[_0x21bd('0x38')]();}function handleUnpublished(_0x3cc0c0){logger[_0x21bd('0x9')](util[_0x21bd('0x1c')](_0x21bd('0x39'),_0x3cc0c0[_0x21bd('0x31')]));_0x3cc0c0[_0x21bd('0x37')](_0x3cc0c0[_0x21bd('0x28')],_0x3cc0c0['extension'],parseInt(_0x3cc0c0[_0x21bd('0x2a')],0xa)+0x1);_0x3cc0c0[_0x21bd('0x38')]();}module[_0x21bd('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xeab8=['context','extension','priority','response','code','result','isUndefined','toString','arg_1','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./mailRpc','./graph','./vertices','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS'];(function(_0x2fc531,_0x2f67e0){var _0x77ff6f=function(_0x6fe393){while(--_0x6fe393){_0x2fc531['push'](_0x2fc531['shift']());}};_0x77ff6f(++_0x2f67e0);}(_0xeab8,0xb2));var _0x8eab=function(_0x1711df,_0x31c315){_0x1711df=_0x1711df-0x0;var _0x3876de=_0xeab8[_0x1711df];return _0x3876de;};'use strict';var _=require(_0x8eab('0x0'));var moment=require(_0x8eab('0x1'));var parser=require(_0x8eab('0x2'));var util=require(_0x8eab('0x3'));var logger=require(_0x8eab('0x4'))(_0x8eab('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x8eab('0x6'));var Graph=require(_0x8eab('0x7'));var Vertices=require(_0x8eab('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x3fd170){logger[_0x8eab('0x9')](_0x8eab('0xa'),_0x3fd170[_0x8eab('0xb')]);return[];});}function addVertex(_0x1aae81,_0x5b34af,_0x50eccb){_0x5b34af['agicommand']=_0x50eccb;if(_0x5b34af[_0x8eab('0xc')](_0x8eab('0xd'))){_0x5b34af['maxRetry']=parseInt(_0x5b34af[_0x8eab('0xd')],0xa);}_0x1aae81[_0x8eab('0xe')](_[_0x8eab('0xf')](_0x5b34af,_0x8eab('0x10')));}function initGraph(_0x4443db,_0x21661d){var _0x2528f2=new Graph();for(var _0x1f140e in _0x4443db){if(_0x4443db[_0x8eab('0xc')](_0x1f140e)){if(_[_0x8eab('0x11')](_0x4443db[_0x1f140e])){for(var _0x2ba686=0x0;_0x2ba686<_0x4443db[_0x1f140e][_0x8eab('0x12')];_0x2ba686+=0x1){addVertex(_0x2528f2,_0x4443db[_0x1f140e][_0x2ba686],_0x1f140e);}}else{addVertex(_0x2528f2,_0x4443db[_0x1f140e],_0x1f140e);}}}for(var _0x27af1e=0x0;_0x27af1e<_0x21661d[_0x8eab('0x12')];_0x27af1e+=0x1){if(_0x21661d[_0x27af1e][_0x8eab('0x13')]&&_0x21661d[_0x27af1e][_0x8eab('0x14')]){_0x2528f2[_0x8eab('0x15')](_0x21661d[_0x27af1e][_0x8eab('0x13')],_0x21661d[_0x27af1e][_0x8eab('0x14')],_0x21661d[_0x27af1e][_0x8eab('0x16')]);}}return _0x2528f2;}function getRoot(_0x4454ca){return parser['toJson'](_0x4454ca,{'object':!![]})['mxGraphModel'][_0x8eab('0x17')];}function inspect(_0x163983){return util[_0x8eab('0x18')](_0x163983,{'showHidden':![],'depth':null});}function initialize(_0x1f48c7,_0x421934){var _0xf01b18=getRoot(_0x1f48c7[_0x8eab('0x19')]);if(!_0xf01b18||!_0xf01b18[_0x8eab('0x1a')])return;var _0x45135c,_0x31dca5,_0x5e9122;logger[_0x8eab('0x1b')](_0x8eab('0x17'),JSON[_0x8eab('0x1c')](_0xf01b18,null,0x2));_0x421934[_0x8eab('0x1d')]=moment()[_0x8eab('0x1e')](_0x8eab('0x1f'));_0x45135c=initGraph(_['omit'](_0xf01b18,_0x8eab('0x10')),_0xf01b18[_0x8eab('0x10')]);_0x31dca5=new Vertices(_0x421934,rpc,mailRpc);logger[_0x8eab('0x20')](util[_0x8eab('0x1e')](_0x8eab('0x21'),_0x421934['arg_1'],_0x421934[_0x8eab('0x22')],_0x421934[_0x8eab('0x23')],_0x421934[_0x8eab('0x24')],_0x421934[_0x8eab('0x25')]));_0x45135c['traverseBFS'](_0xf01b18[_0x8eab('0x1a')]['id'],function(_0x45a1b4){try{_0x45a1b4=_0x31dca5[_0x8eab('0x26')](_0x45a1b4);logger[_0x8eab('0x1b')](_0x8eab('0x27'),JSON[_0x8eab('0x1c')](_0x45a1b4,null,0x2));if(_0x45a1b4[_0x8eab('0x28')]==='gotoc'){logger['info'](_0x8eab('0x29'));_0x421934['context']=_0x45a1b4[_0x8eab('0x2a')]||_0x421934['context'];_0x421934[_0x8eab('0x2b')]=_0x45a1b4[_0x8eab('0x2b')];_0x421934[_0x8eab('0x2c')]=_0x45a1b4[_0x8eab('0x2c')]?_0x45a1b4['priority']-0x1:0x1;return null;}else if(_0x45a1b4&&_0x31dca5[_0x45a1b4[_0x8eab('0x28')]]){_0x5e9122=_0x31dca5[_0x45a1b4[_0x8eab('0x28')]](_0x45a1b4);logger[_0x8eab('0x20')](_0x8eab('0x2d'),JSON[_0x8eab('0x1c')](_0x5e9122,null,0x2));if(_0x5e9122&&_0x5e9122[_0x8eab('0x2e')]===AGI_CODE_SUCCESS&&_0x5e9122[_0x8eab('0x2f')]!==AGI_RESULT_ERROR&&!_0x421934['evtHangup']){logger['debug'](_0x8eab('0x2d'),inspect(_0x5e9122));return _[_0x8eab('0x30')](_0x5e9122[_0x8eab('0x2f')])?null:_0x5e9122[_0x8eab('0x2f')][_0x8eab('0x31')]();}else{logger[_0x8eab('0x9')]('response',inspect(_0x5e9122));return null;}}else{logger[_0x8eab('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x55d2ad){logger[_0x8eab('0x9')](_0x55d2ad[_0x8eab('0xb')]);return null;}});if(_0xf01b18['finally']){logger[_0x8eab('0x20')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x421934[_0x8eab('0x32')],_0x421934[_0x8eab('0x22')],_0x421934['callerid'],_0x421934[_0x8eab('0x24')],_0x421934[_0x8eab('0x25')]));_0x45135c['traverseBFS'](_0xf01b18['finally']['id'],function(_0x26f995){try{_0x26f995=_0x31dca5[_0x8eab('0x26')](_0x26f995);logger[_0x8eab('0x1b')](_0x8eab('0x27'),JSON[_0x8eab('0x1c')](_0x26f995,null,0x2));if(_0x26f995&&_0x31dca5[_0x26f995[_0x8eab('0x28')]]){_0x5e9122=_0x31dca5[_0x26f995[_0x8eab('0x28')]](_0x26f995);if(_0x5e9122){logger[_0x8eab('0x1b')](_0x8eab('0x2d'),inspect(_0x5e9122));return _[_0x8eab('0x30')](_0x5e9122[_0x8eab('0x2f')])?null:_0x5e9122['result'][_0x8eab('0x31')]();}else{logger[_0x8eab('0x9')](_0x8eab('0x2d'),inspect(_0x5e9122));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x469b16){logger[_0x8eab('0x9')](_0x469b16[_0x8eab('0xb')]);return null;}});}logger[_0x8eab('0x20')](util['format'](_0x8eab('0x33'),_0x421934[_0x8eab('0x32')],_0x421934['calleridname'],_0x421934['callerid'],_0x421934['dnid'],_0x421934['uniqueid']));logger['info'](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x421934[_0x8eab('0x2a')],_0x421934[_0x8eab('0x2b')],parseInt(_0x421934[_0x8eab('0x2c')],0xa)+0x1));_0x421934['continueAt'](_0x421934[_0x8eab('0x2a')],_0x421934['extension'],parseInt(_0x421934[_0x8eab('0x2c')],0xa)+0x1);_0x421934[_0x8eab('0x34')]();}function handleNotFound(_0x5a0eb0){logger[_0x8eab('0x9')](util[_0x8eab('0x1e')]('Project\x20%s\x20not\x20found',_0x5a0eb0[_0x8eab('0x32')]));_0x5a0eb0['continueAt'](_0x5a0eb0[_0x8eab('0x2a')],_0x5a0eb0[_0x8eab('0x2b')],parseInt(_0x5a0eb0['priority'],0xa)+0x1);_0x5a0eb0[_0x8eab('0x34')]();}function handleUnpublished(_0x50e2b7){logger['error'](util[_0x8eab('0x1e')](_0x8eab('0x35'),_0x50e2b7[_0x8eab('0x32')]));_0x50e2b7['continueAt'](_0x50e2b7[_0x8eab('0x2a')],_0x50e2b7['extension'],parseInt(_0x50e2b7[_0x8eab('0x2c')],0xa)+0x1);_0x50e2b7[_0x8eab('0x34')]();}module[_0x8eab('0x36')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index f556429..3368d35 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 _0xfc33=['Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','_localBuffer','substring','length','slice','trim','emit','exports','util','stream'];(function(_0x14e8b9,_0x78433f){var _0x49279e=function(_0x202eb1){while(--_0x202eb1){_0x14e8b9['push'](_0x14e8b9['shift']());}};_0x49279e(++_0x78433f);}(_0xfc33,0x16e));var _0x3fc3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xfc33[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x3fc3('0x0'));var Transform=require(_0x3fc3('0x1'))[_0x3fc3('0x2')];function AGIReply(_0x2a952d){Transform[_0x3fc3('0x3')](this,_0x2a952d);this['_localBuffer']='';this[_0x3fc3('0x4')]=![];}util[_0x3fc3('0x5')](AGIReply,Transform);AGIReply[_0x3fc3('0x6')]['_transform']=function(_0x2b73a2,_0x110161,_0x1e7af4){var _0x1dfb48='\x0a',_0x5bdc39=['\x0a\x0a',_0x3fc3('0x7')],_0x504a95=-0x1,_0x21788c=-0x1,_0xc54c24='',_0x127b7e=0x0,_0x4a1a1a='',_0x2852d5='';this['_localBuffer']+=_0x2b73a2[_0x3fc3('0x8')]();_0x4a1a1a=this[_0x3fc3('0x9')];if(!this['_inBody']){_0x127b7e=0x0;while(_0x5bdc39[_0x127b7e]){while((_0x21788c=_0x4a1a1a['indexOf'](_0x5bdc39[_0x127b7e]))!=-0x1){_0xc54c24=_0x5bdc39[_0x127b7e];_0x2852d5=_0x4a1a1a[_0x3fc3('0xa')](0x0,_0x21788c);_0x4a1a1a=_0x4a1a1a['substring'](_0x21788c+_0xc54c24[_0x3fc3('0xb')]);var _0x27d18a=_0x2852d5['split'](_0x1dfb48),_0x2ff025=0x0,_0x3946d4={},_0x11c228='',_0x496b4f='',_0x3df05f=-0x1;while(_0x27d18a[_0x2ff025]){_0x3df05f=_0x27d18a[_0x2ff025]['indexOf'](':');if(_0x3df05f!=-0x1){_0x11c228=_0x27d18a[_0x2ff025][_0x3fc3('0xc')](0x0,_0x3df05f)[_0x3fc3('0xd')]();_0x496b4f=_0x27d18a[_0x2ff025]['slice'](_0x3df05f+0x1)[_0x3fc3('0xd')]();if(_0x11c228['length']>0x0){_0x3946d4[_0x11c228]=_0x496b4f;}}else{}_0x2ff025++;}this['emit']('headers',_0x3946d4);this[_0x3fc3('0x4')]=!![];}_0x127b7e++;}this['_localBuffer']=_0x4a1a1a;}else{while((_0x504a95=_0x4a1a1a['indexOf'](_0x1dfb48))!=-0x1){_0x2852d5=_0x4a1a1a[_0x3fc3('0xa')](0x0,_0x504a95);this[_0x3fc3('0xe')]('line',_0x2852d5);_0x4a1a1a=_0x4a1a1a[_0x3fc3('0xa')](_0x504a95+_0x1dfb48[_0x3fc3('0xb')]);}this[_0x3fc3('0x9')]=_0x4a1a1a;}_0x1e7af4();};module[_0x3fc3('0xf')]=AGIReply; \ No newline at end of file +var _0x124c=['Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream'];(function(_0x4026ba,_0x280e04){var _0x172754=function(_0x2a902c){while(--_0x2a902c){_0x4026ba['push'](_0x4026ba['shift']());}};_0x172754(++_0x280e04);}(_0x124c,0x18d));var _0xc124=function(_0xe20a5d,_0x4f58b0){_0xe20a5d=_0xe20a5d-0x0;var _0x7c0234=_0x124c[_0xe20a5d];return _0x7c0234;};'use strict';var util=require(_0xc124('0x0'));var Transform=require(_0xc124('0x1'))[_0xc124('0x2')];function AGIReply(_0x1e9acf){Transform['call'](this,_0x1e9acf);this[_0xc124('0x3')]='';this[_0xc124('0x4')]=![];}util[_0xc124('0x5')](AGIReply,Transform);AGIReply[_0xc124('0x6')][_0xc124('0x7')]=function(_0x3b2d37,_0x11ff62,_0x2833b6){var _0x4e9c62='\x0a',_0x1e8297=['\x0a\x0a',_0xc124('0x8')],_0x3678ed=-0x1,_0x753264=-0x1,_0x3465b2='',_0x5d5b9b=0x0,_0x3f1edd='',_0x2e57ce='';this[_0xc124('0x3')]+=_0x3b2d37['toString']();_0x3f1edd=this[_0xc124('0x3')];if(!this['_inBody']){_0x5d5b9b=0x0;while(_0x1e8297[_0x5d5b9b]){while((_0x753264=_0x3f1edd[_0xc124('0x9')](_0x1e8297[_0x5d5b9b]))!=-0x1){_0x3465b2=_0x1e8297[_0x5d5b9b];_0x2e57ce=_0x3f1edd[_0xc124('0xa')](0x0,_0x753264);_0x3f1edd=_0x3f1edd['substring'](_0x753264+_0x3465b2[_0xc124('0xb')]);var _0x1168b0=_0x2e57ce[_0xc124('0xc')](_0x4e9c62),_0x415359=0x0,_0x535e11={},_0x59bbf9='',_0x1b8bff='',_0x3e005f=-0x1;while(_0x1168b0[_0x415359]){_0x3e005f=_0x1168b0[_0x415359]['indexOf'](':');if(_0x3e005f!=-0x1){_0x59bbf9=_0x1168b0[_0x415359][_0xc124('0xd')](0x0,_0x3e005f)[_0xc124('0xe')]();_0x1b8bff=_0x1168b0[_0x415359][_0xc124('0xd')](_0x3e005f+0x1)[_0xc124('0xe')]();if(_0x59bbf9[_0xc124('0xb')]>0x0){_0x535e11[_0x59bbf9]=_0x1b8bff;}}else{}_0x415359++;}this[_0xc124('0xf')](_0xc124('0x10'),_0x535e11);this[_0xc124('0x4')]=!![];}_0x5d5b9b++;}this['_localBuffer']=_0x3f1edd;}else{while((_0x3678ed=_0x3f1edd[_0xc124('0x9')](_0x4e9c62))!=-0x1){_0x2e57ce=_0x3f1edd[_0xc124('0xa')](0x0,_0x3678ed);this[_0xc124('0xf')](_0xc124('0x11'),_0x2e57ce);_0x3f1edd=_0x3f1edd['substring'](_0x3678ed+_0x4e9c62[_0xc124('0xb')]);}this[_0xc124('0x3')]=_0x3f1edd;}_0x2833b6();};module[_0xc124('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 f7b9cbf..175ba34 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 _0x8135=['ShowSound','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById'];(function(_0x276574,_0x14aba5){var _0x25faa5=function(_0x3811c1){while(--_0x3811c1){_0x276574['push'](_0x276574['shift']());}};_0x25faa5(++_0x14aba5);}(_0x8135,0x99));var _0x5813=function(_0x52c40b,_0x336f94){_0x52c40b=_0x52c40b-0x0;var _0x179429=_0x8135[_0x52c40b];return _0x179429;};'use strict';var _=require('lodash');var moment=require(_0x5813('0x0'));var jayson=require(_0x5813('0x1'));var client=jayson[_0x5813('0x2')][_0x5813('0x3')]({'port':0x2329});function request(_0x4b43a8,_0x1fced6){return new Promise(function(_0x196ea8,_0xf23c29){return client[_0x5813('0x4')](_0x4b43a8,_0x1fced6)[_0x5813('0x5')](function(_0x5c8ff5){if(_0x5c8ff5['error']){return _0xf23c29(_0x5c8ff5[_0x5813('0x6')][_0x5813('0x7')]);}else{return _0x196ea8(_0x5c8ff5[_0x5813('0x8')]);}})[_0x5813('0x9')](function(_0x3101ea){return _0xf23c29(_0x3101ea);});});}exports[_0x5813('0xa')]=function(){return request(_0x5813('0xb'),{'options':{'raw':![],'attributes':['id',_0x5813('0xc'),_0x5813('0xd')]}});};exports[_0x5813('0xe')]=function(_0x3adb65){return request(_0x5813('0xf'),{'options':{'raw':![],'where':{'name':_0x3adb65},'attributes':[_0x5813('0xd')]}});};exports[_0x5813('0x10')]=function(_0x3012b5){return request(_0x5813('0x11'),{'options':{'raw':![],'where':{'id':_0x3012b5},'include':[{'model':_0x5813('0x12'),'as':'Smtp','include':[{'model':_0x5813('0x13'),'as':_0x5813('0x13')}]}],'attributes':['id',_0x5813('0xc'),'email'],'smtp':!![]}});};exports[_0x5813('0x14')]=function(_0x5076d){return request('ShowSquareProject',{'options':{'where':{'id':_0x5076d},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x15')]=function(_0x57df76){return request(_0x5813('0x16'),{'options':{'where':{'id':_0x57df76},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x17')]=function(_0x5044e9){return request(_0x5813('0x18'),{'options':{'where':{'id':_0x5044e9},'attributes':[_0x5813('0xc')]}});};exports['getSquareOdbcById']=function(_0x2834e6){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2834e6},'attributes':['dsn']}});};exports['getUserById']=function(_0x5705c9){return request('ShowUser',{'options':{'where':{'id':_0x5705c9},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x19')]=function(_0x1e43df){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1e43df[_0x5813('0x1a')]},'attributes':['id']}});};exports[_0x5813('0x1b')]=function(_0x7b7ee8){return request(_0x5813('0x1c'),{'options':{'where':{'id':_0x7b7ee8},'attributes':['name']}});};exports[_0x5813('0x1d')]=function(_0x383196){return request(_0x5813('0x1e'),{'options':{'where':{'id':_0x383196},'attributes':[_0x5813('0x1f')]}});};exports['getIntervalById']=function(_0x1f2506){return request(_0x5813('0x20'),{'options':{'raw':![],'where':{'id':_0x1f2506},'include':[{'model':_0x5813('0x21'),'as':'Intervals'}]}});};exports[_0x5813('0x22')]=function(_0xd116c0){return request(_0x5813('0x23'),{'options':{'where':{'id':_0xd116c0},'attributes':['id',_0x5813('0xc')]}});};exports[_0x5813('0x24')]=function(_0x183f7d){return request(_0x5813('0x25'),{'body':_0x183f7d});};exports[_0x5813('0x26')]=function(_0x5b4189){return request(_0x5813('0x27'),{'body':_0x5b4189});};exports[_0x5813('0x28')]=function(_0x23c6c7){return request(_0x5813('0x29'),{'body':_[_0x5813('0x2a')](_0x23c6c7,{'project_name':_0x23c6c7[_0x5813('0x2b')],'prev_project_name':_0x23c6c7[_0x5813('0x2c')]||'','is_subproject':_0x23c6c7['arg_2']?!![]:![],'leaveAt':moment()[_0x5813('0x2d')](_0x5813('0x2e'))})});};exports[_0x5813('0x2f')]=function(_0x4c9385){return request(_0x5813('0x30'),{'body':_0x4c9385});};exports[_0x5813('0x31')]=function(_0x56d18c){return request('CreateSquareMessage',{'body':_0x56d18c});};exports[_0x5813('0x32')]=function(_0x17acb5){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x17acb5['phone'],'ListId':_0x17acb5[_0x5813('0x33')]}}})[_0x5813('0x5')](function(_0x3a9bed){if(_0x3a9bed){return _0x3a9bed;}return request(_0x5813('0x34'),{'body':_0x17acb5});});};exports['getPauseById']=function(_0x520db4){return request(_0x5813('0x35'),{'options':{'where':{'id':_0x520db4},'attributes':[_0x5813('0xc')]}});};exports[_0x5813('0x36')]=function(_0x534b5c,_0x2e6665){return request(_0x5813('0x37'),{'body':{'interface':_0x2e6665},'options':{'where':_0x534b5c}});};exports[_0x5813('0x38')]=function(_0x5981da,_0x363275,_0x41b7a7){return request(_0x5813('0x39'),{'body':{'type':_0x363275,'uniqueid':_0x41b7a7},'options':{'where':_0x5981da}});};exports['agentUnpause']=function(_0x247ba1){return request(_0x5813('0x3a'),{'body':{},'options':{'where':_0x247ba1}});};exports[_0x5813('0x3b')]=function(_0x424430){return request(_0x5813('0x3c'),{'body':{},'options':{'where':_0x424430}});}; \ No newline at end of file +var _0x3e5c=['getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ListId','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','ShowTrunk'];(function(_0x2bf7c6,_0x349ac4){var _0x26c4ff=function(_0x569b1b){while(--_0x569b1b){_0x2bf7c6['push'](_0x2bf7c6['shift']());}};_0x26c4ff(++_0x349ac4);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x304bf5,_0x5472ef){_0x304bf5=_0x304bf5-0x0;var _0x4b43a1=_0x3e5c[_0x304bf5];return _0x4b43a1;};'use strict';var _=require(_0xc3e5('0x0'));var moment=require(_0xc3e5('0x1'));var jayson=require(_0xc3e5('0x2'));var client=jayson[_0xc3e5('0x3')]['http']({'port':0x2329});function request(_0x266cb5,_0x185c21){return new Promise(function(_0x3785eb,_0x336716){return client[_0xc3e5('0x4')](_0x266cb5,_0x185c21)[_0xc3e5('0x5')](function(_0x4cb0db){if(_0x4cb0db[_0xc3e5('0x6')]){return _0x336716(_0x4cb0db[_0xc3e5('0x6')][_0xc3e5('0x7')]);}else{return _0x3785eb(_0x4cb0db[_0xc3e5('0x8')]);}})[_0xc3e5('0x9')](function(_0x4864a2){return _0x336716(_0x4864a2);});});}exports[_0xc3e5('0xa')]=function(){return request(_0xc3e5('0xb'),{'options':{'raw':![],'attributes':['id',_0xc3e5('0xc'),_0xc3e5('0xd')]}});};exports[_0xc3e5('0xe')]=function(_0x644286){return request(_0xc3e5('0xf'),{'options':{'raw':![],'where':{'name':_0x644286},'attributes':['production']}});};exports[_0xc3e5('0x10')]=function(_0x2768d5){return request(_0xc3e5('0x11'),{'options':{'raw':![],'where':{'id':_0x2768d5},'include':[{'model':_0xc3e5('0x12'),'as':'Smtp','include':[{'model':_0xc3e5('0x13'),'as':_0xc3e5('0x13')}]}],'attributes':['id',_0xc3e5('0xc'),_0xc3e5('0x14')],'smtp':!![]}});};exports[_0xc3e5('0x15')]=function(_0x1dbba8){return request('ShowSquareProject',{'options':{'where':{'id':_0x1dbba8},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x27c226){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x27c226},'attributes':[_0xc3e5('0xc')]}});};exports[_0xc3e5('0x16')]=function(_0x4d1ad9){return request(_0xc3e5('0x17'),{'options':{'where':{'id':_0x4d1ad9},'attributes':[_0xc3e5('0xc')]}});};exports[_0xc3e5('0x18')]=function(_0x1829f9){return request(_0xc3e5('0x19'),{'options':{'where':{'id':_0x1829f9},'attributes':['dsn']}});};exports[_0xc3e5('0x1a')]=function(_0x277063){return request(_0xc3e5('0x1b'),{'options':{'where':{'id':_0x277063},'attributes':[_0xc3e5('0xc')]}});};exports[_0xc3e5('0x1c')]=function(_0x1e1eea){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1e1eea[_0xc3e5('0x1d')]},'attributes':['id']}});};exports[_0xc3e5('0x1e')]=function(_0x4a1d86){return request(_0xc3e5('0x1f'),{'options':{'where':{'id':_0x4a1d86},'attributes':['name']}});};exports[_0xc3e5('0x20')]=function(_0x128e00){return request(_0xc3e5('0x21'),{'options':{'where':{'id':_0x128e00},'attributes':[_0xc3e5('0x22')]}});};exports[_0xc3e5('0x23')]=function(_0x4a7806){return request(_0xc3e5('0x24'),{'options':{'raw':![],'where':{'id':_0x4a7806},'include':[{'model':_0xc3e5('0x25'),'as':_0xc3e5('0x26')}]}});};exports[_0xc3e5('0x27')]=function(_0x414ba9){return request(_0xc3e5('0x28'),{'options':{'where':{'id':_0x414ba9},'attributes':['id',_0xc3e5('0xc')]}});};exports['createSmsMessage']=function(_0x3a2800){return request(_0xc3e5('0x29'),{'body':_0x3a2800});};exports[_0xc3e5('0x2a')]=function(_0x30224b){return request(_0xc3e5('0x2b'),{'body':_0x30224b});};exports[_0xc3e5('0x2c')]=function(_0x2777c4){return request(_0xc3e5('0x2d'),{'body':_['merge'](_0x2777c4,{'project_name':_0x2777c4[_0xc3e5('0x2e')],'prev_project_name':_0x2777c4['arg_2']||'','is_subproject':_0x2777c4['arg_2']?!![]:![],'leaveAt':moment()[_0xc3e5('0x2f')](_0xc3e5('0x30'))})});};exports[_0xc3e5('0x31')]=function(_0x59dcff){return request(_0xc3e5('0x32'),{'body':_0x59dcff});};exports[_0xc3e5('0x33')]=function(_0x2d3702){return request(_0xc3e5('0x34'),{'body':_0x2d3702});};exports['createCmContact']=function(_0xa6766d){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xa6766d[_0xc3e5('0x1d')],'ListId':_0xa6766d[_0xc3e5('0x35')]}}})[_0xc3e5('0x5')](function(_0x5a2d41){if(_0x5a2d41){return _0x5a2d41;}return request('CreateCmContact',{'body':_0xa6766d});});};exports['getPauseById']=function(_0x1dcc51){return request(_0xc3e5('0x36'),{'options':{'where':{'id':_0x1dcc51},'attributes':[_0xc3e5('0xc')]}});};exports[_0xc3e5('0x37')]=function(_0xeea535,_0x65bb96){return request('LoginUser',{'body':{'interface':_0x65bb96},'options':{'where':_0xeea535}});};exports[_0xc3e5('0x38')]=function(_0x2ecda2,_0x440617,_0x9e1a69){return request(_0xc3e5('0x39'),{'body':{'type':_0x440617,'uniqueid':_0x9e1a69},'options':{'where':_0x2ecda2}});};exports[_0xc3e5('0x3a')]=function(_0x471317){return request(_0xc3e5('0x3b'),{'body':{},'options':{'where':_0x471317}});};exports[_0xc3e5('0x3c')]=function(_0x8a084f){return request(_0xc3e5('0x3d'),{'body':{},'options':{'where':_0x8a084f}});}; \ 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 3484cbf..28cfe96 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe225=['exports','./lex'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xe225,0x1bd));var _0x5e22=function(_0x15a2cb,_0x571a10){_0x15a2cb=_0x15a2cb-0x0;var _0x26d3f6=_0xe225[_0x15a2cb];return _0x26d3f6;};var polly=require('./polly');var lex=require(_0x5e22('0x0'));module[_0x5e22('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 80be1a0..605975f 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['exports','./lib/api'];(function(_0x4d715d,_0x550e17){var _0x30df86=function(_0x21c558){while(--_0x21c558){_0x4d715d['push'](_0x4d715d['shift']());}};_0x30df86(++_0x550e17);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xe5b5[_0x1b3a5c];return _0x2ae8cb;};'use strict';var lex=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]=function(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763){return lex(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763);}; \ No newline at end of file +var _0x668b=['./lib/api','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x668b,0x140));var _0xb668=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x668b[_0x2a6d45];return _0x295253;};'use strict';var lex=require(_0xb668('0x0'));module[_0xb668('0x1')]=function(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83){return lex(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83);}; \ 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 42c306a..76d8a12 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x262f45,_0x4a12e3){var _0x25bf5d=function(_0x226c52){while(--_0x226c52){_0x262f45['push'](_0x262f45['shift']());}};_0x25bf5d(++_0x4a12e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x4fe746,_0x268964){var _0x588cb1=function(_0x16ead3){while(--_0x16ead3){_0x4fe746['push'](_0x4fe746['shift']());}};_0x588cb1(++_0x268964);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 6542892..54de38d 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x5e048b,_0x594df4,_0x2eb825,_0x2c5175,_0x3613bc,_0x4fe964,_0x35a1f5){return polly(_0x5e048b,_0x594df4,_0x2eb825,_0x2c5175,_0x3613bc,_0x4fe964,_0x35a1f5);}; \ No newline at end of file +var _0x86b2=['./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x86b2,0xc7));var _0x286b=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x86b2[_0x47a349];return _0x18ab75;};'use strict';var polly=require(_0x286b('0x0'));module['exports']=function(_0x2144ba,_0x2e471b,_0x41465d,_0x474a2e,_0x116afc,_0x2b6d45,_0xe1b9ab){return polly(_0x2144ba,_0x2e471b,_0x41465d,_0x474a2e,_0x116afc,_0x2b6d45,_0xe1b9ab);}; \ 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 d362d25..a4299c3 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 _0xd6f4=['Polly','text','mp3','synthesizeSpeech','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x583c44,_0x10db41){var _0x22b717=function(_0xd1bf91){while(--_0xd1bf91){_0x583c44['push'](_0x583c44['shift']());}};_0x22b717(++_0x10db41);}(_0xd6f4,0x176));var _0x4d6f=function(_0x513480,_0x15c4d3){_0x513480=_0x513480-0x0;var _0x3b0136=_0xd6f4[_0x513480];return _0x3b0136;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x135f91,_0x2e69c3,_0x2fb902){return new BPromise(function(_0x56a643,_0x203fe6){_0x135f91[_0x4d6f('0x0')](_0x2e69c3,function(_0x3e7c0f,_0x30c380){if(_0x3e7c0f){_0x203fe6(_0x3e7c0f);}else if(_0x30c380){if(_0x30c380['AudioStream']instanceof Buffer){fs['writeFile'](_0x2fb902,_0x30c380['AudioStream'],function(_0x41a3b3){if(_0x41a3b3){_0x203fe6(_0x41a3b3);}else{_0x56a643();}});}else{_0x203fe6(new Error(_0x4d6f('0x1')));}}else{_0x203fe6(new Error(_0x4d6f('0x2')));}});});}module[_0x4d6f('0x3')]=function(_0x31e794,_0x3b95ec,_0xf4f743,_0x5ab854,_0xf047a9,_0xa771da,_0x33ec18){var _0x130b9e=new AWS[(_0x4d6f('0x4'))]({'accessKeyId':_0x31e794,'secretAccessKey':_0x3b95ec,'region':_0xf4f743});var _0x43842c={'Text':_0xf047a9,'TextType':_0xa771da||_0x4d6f('0x5'),'OutputFormat':_0x4d6f('0x6'),'VoiceId':_0x5ab854};return pollyResult(_0x130b9e,_0x43842c,_0x33ec18);}; \ No newline at end of file +var _0x9b4e=['aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','bluebird'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x9b4e,0x116));var _0xe9b4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9b4e[_0x397e5f];return _0x5302b8;};'use strict';var fs=require('fs');var path=require(_0xe9b4('0x0'));var BPromise=require(_0xe9b4('0x1'));var rs=require('randomstring');var AWS=require(_0xe9b4('0x2'));function pollyResult(_0x303823,_0x450cb2,_0x318f3d){return new BPromise(function(_0x165e07,_0x5a1316){_0x303823['synthesizeSpeech'](_0x450cb2,function(_0x5af428,_0x5ab425){if(_0x5af428){_0x5a1316(_0x5af428);}else if(_0x5ab425){if(_0x5ab425['AudioStream']instanceof Buffer){fs['writeFile'](_0x318f3d,_0x5ab425[_0xe9b4('0x3')],function(_0x4bb73a){if(_0x4bb73a){_0x5a1316(_0x4bb73a);}else{_0x165e07();}});}else{_0x5a1316(new Error(_0xe9b4('0x4')));}}else{_0x5a1316(new Error(_0xe9b4('0x5')));}});});}module['exports']=function(_0x464284,_0x28cbbc,_0x14597e,_0x1de610,_0x167d96,_0x38a903,_0x24ef03){var _0x34d06f=new AWS[(_0xe9b4('0x6'))]({'accessKeyId':_0x464284,'secretAccessKey':_0x28cbbc,'region':_0x14597e});var _0x5d0f95={'Text':_0x167d96,'TextType':_0x38a903||_0xe9b4('0x7'),'OutputFormat':'mp3','VoiceId':_0x1de610};return pollyResult(_0x34d06f,_0x5d0f95,_0x24ef03);}; \ 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 8ec7d8b..f95a9b1 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x4df8e7,_0x272223,_0x2b238a,_0x4768ef){return asr(_0x4df8e7,_0x272223,_0x2b238a);}; \ No newline at end of file +var _0x4646=['./lib/api','exports'];(function(_0xc52898,_0x165722){var _0x1941d7=function(_0x3de672){while(--_0x3de672){_0xc52898['push'](_0xc52898['shift']());}};_0x1941d7(++_0x165722);}(_0x4646,0x1a4));var _0x6464=function(_0x263c14,_0x54a892){_0x263c14=_0x263c14-0x0;var _0x126c05=_0x4646[_0x263c14];return _0x126c05;};'use strict';var asr=require(_0x6464('0x0'));module[_0x6464('0x1')]=function(_0x45baa3,_0x544a53,_0x228462,_0x996ad1){return asr(_0x45baa3,_0x544a53,_0x228462);}; \ 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 ecc2b51..11388a5 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 _0xee24=['LINEAR16','8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee24,0x1a6));var _0x4ee2=function(_0x476e4c,_0x166c72){_0x476e4c=_0x476e4c-0x0;var _0x5ea720=_0xee24[_0x476e4c];return _0x5ea720;};'use strict';var url=require('url');var BPromise=require(_0x4ee2('0x0'));var fs=require('fs');var host=_0x4ee2('0x1');module['exports']=function(_0x234b61,_0x4e09d3,_0x3ff71c){return new BPromise(function(_0x34b373,_0x5546e1){var _0x1aee89;if(typeof _0x234b61!==_0x4ee2('0x2')||_0x234b61[_0x4ee2('0x3')]===0x0){return _0x5546e1(_0x4ee2('0x4'));}if(typeof _0x4e09d3!=='string'||_0x4e09d3[_0x4ee2('0x3')]===0x0){return _0x5546e1(_0x4ee2('0x5'));}if(typeof _0x3ff71c!==_0x4ee2('0x6')&&(typeof _0x3ff71c!==_0x4ee2('0x2')||_0x3ff71c[_0x4ee2('0x3')]===0x0)){return _0x5546e1(_0x4ee2('0x7'));}try{_0x1aee89=fs[_0x4ee2('0x8')](_0x234b61)[_0x4ee2('0x9')]('base64');}catch(_0x519e87){return _0x5546e1(_0x519e87);}return _0x34b373({'method':_0x4ee2('0xa'),'uri':host+_0x4ee2('0xb')+_0x4e09d3,'body':{'config':{'encoding':_0x4ee2('0xc'),'sampleRateHertz':_0x4ee2('0xd'),'languageCode':_0x3ff71c},'audio':{'content':_0x1aee89}},'json':!![]});});}; \ No newline at end of file +var _0x063c=['undefined','length','readFileSync','toString','POST','LINEAR16','bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string'];(function(_0x12b537,_0x462637){var _0xa9bf8e=function(_0x56db9b){while(--_0x56db9b){_0x12b537['push'](_0x12b537['shift']());}};_0xa9bf8e(++_0x462637);}(_0x063c,0xba));var _0xc063=function(_0x2c4652,_0x442364){_0x2c4652=_0x2c4652-0x0;var _0xd57664=_0x063c[_0x2c4652];return _0xd57664;};'use strict';var url=require('url');var BPromise=require(_0xc063('0x0'));var fs=require('fs');var host=_0xc063('0x1');module[_0xc063('0x2')]=function(_0x25e61c,_0x314f1b,_0x33d075){return new BPromise(function(_0x5aa766,_0x3803ac){var _0x5ec48e;if(typeof _0x25e61c!=='string'||_0x25e61c['length']===0x0){return _0x3803ac(_0xc063('0x3'));}if(typeof _0x314f1b!==_0xc063('0x4')||_0x314f1b['length']===0x0){return _0x3803ac(_0xc063('0x5'));}if(typeof _0x33d075!==_0xc063('0x6')&&(typeof _0x33d075!==_0xc063('0x4')||_0x33d075[_0xc063('0x7')]===0x0)){return _0x3803ac('lang\x20should\x20be\x20a\x20string');}try{_0x5ec48e=fs[_0xc063('0x8')](_0x25e61c)[_0xc063('0x9')]('base64');}catch(_0x34d40a){return _0x3803ac(_0x34d40a);}return _0x5aa766({'method':_0xc063('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x314f1b,'body':{'config':{'encoding':_0xc063('0xb'),'sampleRateHertz':'8000','languageCode':_0x33d075},'audio':{'content':_0x5ec48e}},'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 bcba3aa..3bbacbb 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 _0x2b69=['./asr','exports'];(function(_0xbb13e8,_0x4a60d0){var _0xaf4923=function(_0x35443c){while(--_0x35443c){_0xbb13e8['push'](_0xbb13e8['shift']());}};_0xaf4923(++_0x4a60d0);}(_0x2b69,0x84));var _0x92b6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x2b69[_0x16b9ed];return _0x66b1f8;};var asr=require(_0x92b6('0x0'));module[_0x92b6('0x1')]={'asr':asr}; \ No newline at end of file +var _0x796d=['exports'];(function(_0x3de43f,_0x4f4c39){var _0x1879aa=function(_0x3337b){while(--_0x3337b){_0x3de43f['push'](_0x3de43f['shift']());}};_0x1879aa(++_0x4f4c39);}(_0x796d,0xa4));var _0xd796=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x796d[_0x291f8b];return _0x275171;};var asr=require('./asr');module[_0xd796('0x0')]={'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 18246d5..049dfcc 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 _0xa1e5=['googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','length','lang\x20\x22','.mp3','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','actionIncomplete','fulfillment','speech','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','.wav','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./sestek','./tilde','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','audioConfig','text:synthesize','POST','resolve','from','audioContent','writeFile'];(function(_0x4f96ec,_0x203eec){var _0x52f867=function(_0x504b5b){while(--_0x504b5b){_0x4f96ec['push'](_0x4f96ec['shift']());}};_0x52f867(++_0x203eec);}(_0xa1e5,0xd0));var _0x5a1e=function(_0x52da40,_0x40b3c9){_0x52da40=_0x52da40-0x0;var _0x5b0ef5=_0xa1e5[_0x52da40];return _0x5b0ef5;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x5a1e('0x0'));var fs=require('fs');var http=require(_0x5a1e('0x1'));var https=require(_0x5a1e('0x2'));var md5=require(_0x5a1e('0x3'));var path=require(_0x5a1e('0x4'));var querystring=require(_0x5a1e('0x5'));var rp=require(_0x5a1e('0x6'));var rs=require(_0x5a1e('0x7'));var sox=require(_0x5a1e('0x8'));var tts=require(_0x5a1e('0x9'));var urlParse=require(_0x5a1e('0xa'))[_0x5a1e('0xb')];var util=require(_0x5a1e('0xc'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x5a1e('0xd'));var tilde=require(_0x5a1e('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x5a1e('0xf');function downloadFile(_0x1fa298,_0x38fbdd){return new BPromise(function(_0xada3fc,_0xb23280){var _0x579f5a=urlParse(_0x1fa298);var _0x4b029b=_0x579f5a['protocol']===_0x5a1e('0x10')?https:http;var _0x1fbd14={'host':_0x579f5a[_0x5a1e('0x11')],'path':_0x579f5a[_0x5a1e('0x4')],'headers':{'user-agent':_0x5a1e('0x12')}};_0x4b029b[_0x5a1e('0x13')](_0x1fbd14,function(_0x57de66){if(_0x57de66[_0x5a1e('0x14')]!==0xc8){logger[_0x5a1e('0x15')](_0x5a1e('0x16')+_0x1fa298+_0x5a1e('0x17')+_0x57de66[_0x5a1e('0x14')]+'\x20('+_0x57de66['statusMessage']+')');_0xb23280(new Error(_0x5a1e('0x16')+_0x1fa298+_0x5a1e('0x17')+_0x57de66[_0x5a1e('0x14')]+'\x20('+_0x57de66[_0x5a1e('0x18')]+')'));return;}var _0xd7aee1=fs[_0x5a1e('0x19')](_0x38fbdd);_0xd7aee1['on']('finish',function(){logger[_0x5a1e('0x1a')](_0x5a1e('0x1b'));_0xd7aee1[_0x5a1e('0x1c')](_0xada3fc);});_0xd7aee1['on'](_0x5a1e('0x15'),function(_0x3f4efa){fs[_0x5a1e('0x1d')](_0x38fbdd);logger[_0x5a1e('0x15')](_0x5a1e('0x1e'),_0x3f4efa);_0xb23280(_0x3f4efa);});_0x57de66[_0x5a1e('0x1f')](_0xd7aee1);})['on'](_0x5a1e('0x15'),function(_0x536b47){logger[_0x5a1e('0x15')](_0x536b47);_0xb23280(_0x536b47);})['end']();});}function uploadFile(_0x7794ca){return new BPromise(function(_0x426861,_0x4d0921){var _0x1aad1f=urlParse(_0x7794ca);var _0x4e7271=_0x1aad1f['protocol']===_0x5a1e('0x10')?https:http;var _0x37116b={'host':_0x1aad1f[_0x5a1e('0x11')],'path':_0x1aad1f['path'],'headers':{'user-agent':_0x5a1e('0x12')}};_0x4e7271['get'](_0x37116b,function(_0x35a97b){if(_0x35a97b[_0x5a1e('0x14')]!==0xc8){_0x4d0921(new Error(_0x5a1e('0x16')+_0x7794ca+_0x5a1e('0x17')+_0x35a97b['statusCode']+'\x20('+_0x35a97b[_0x5a1e('0x18')]+')'));return;}var _0x159c7a='';_0x35a97b['on']('data',function(_0x3ee627){_0x159c7a+=_0x3ee627;});_0x35a97b['on'](_0x5a1e('0x20'),function(){_0x426861(_0x159c7a);});})['on'](_0x5a1e('0x15'),function(_0x2024d8){_0x4d0921(_0x2024d8);})[_0x5a1e('0x20')]();});}function convertFile(_0x310eb4,_0x1ca2de){return new BPromise(function(_0x14014d,_0x14bf37){var _0x111c04=sox['transcode'](_0x310eb4,_0x1ca2de,{'sampleRate':0x1f40,'format':_0x5a1e('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x111c04['on'](_0x5a1e('0x15'),function(_0x5a7191){logger[_0x5a1e('0x15')](_0x5a1e('0x22'),_0x5a7191);_0x14bf37(_0x5a7191);});_0x111c04['on']('end',function(){logger['info'](_0x5a1e('0x23'));_0x14014d();});_0x111c04[_0x5a1e('0x24')]();});}function base64Decode(_0x13b742,_0x5a59fc){var _0x42fb39=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.wav');fs[_0x5a1e('0x27')](_0x42fb39,_0x13b742,_0x5a1e('0x28'));return convertFile(_0x42fb39,_0x5a59fc)[_0x5a1e('0x29')](function(){try{fs['unlink'](_0x42fb39);fs[_0x5a1e('0x2a')](_0x5a59fc,_0x5a1e('0x2b'));}catch(_0x191f89){logger['error'](_0x191f89);}return _0x5a59fc[_0x5a1e('0x2c')]('.')[0x0];});}function base64Encode(_0x95b897){var _0x395a65=fs[_0x5a1e('0x2d')](_0x95b897);return new Buffer(_0x395a65)[_0x5a1e('0x2e')](_0x5a1e('0x28'));}exports[_0x5a1e('0x2f')]=function(_0x3b82f3,_0x39a326,_0x5d0d0c,_0x2151a3,_0x5dbdb7,_0x4caeac){var _0xc349ee,_0x23031b;var _0x17d497='https://texttospeech.googleapis.com/v1/';var _0x34079f=_0x5a1e('0x30')+_0x3b82f3;var _0x2c16fb={};if(_0x39a326===_0x5a1e('0x31')){_0x2c16fb[_0x5a1e('0x32')]={'ssml':_0x5d0d0c};}else{_0x2c16fb[_0x5a1e('0x32')]={'text':_0x5d0d0c};};_0x2c16fb['voice']={'languageCode':_0x2151a3,'ssmlGender':_0x5dbdb7};_0x2c16fb[_0x5a1e('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x30fa0c={'url':_0x17d497+_0x5a1e('0x34')+_0x34079f,'method':_0x5a1e('0x35'),'json':!![],'body':_0x2c16fb};return rp(_0x30fa0c)[_0x5a1e('0x29')](function(_0x5f5194){return new BPromise(function(_0x3e5ce8,_0x103636){_0xc349ee=path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.mp3');var _0x2bd2f0=Buffer[_0x5a1e('0x37')](_0x5f5194[_0x5a1e('0x38')],'base64');return fs[_0x5a1e('0x39')](_0xc349ee,_0x2bd2f0,function(_0x2a3572){_0x103636(_0x2a3572);},function(_0x1da53e){fs[_0x5a1e('0x2a')](_0xc349ee,_0x5a1e('0x2b'));_0x3e5ce8(_0x1da53e);});});})[_0x5a1e('0x29')](function(_0x78319b){_0x23031b=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.wav');return convertFile(_0xc349ee,_0x23031b);})[_0x5a1e('0x29')](function(){try{fs['unlink'](_0xc349ee);fs[_0x5a1e('0x2a')](_0x23031b,_0x5a1e('0x2b'));}catch(_0x52fb51){logger[_0x5a1e('0x15')](_0x52fb51);}logger['info'](_0x5a1e('0x3a'),_0x23031b[_0x5a1e('0x2c')]('.')[0x0]);return _0x23031b['split']('.')[0x0];});};exports[_0x5a1e('0x3b')]=function(_0xd012d9,_0x47dac0){var _0x4ca0a2=_0x5a1e('0x3c');var _0x399ddd,_0x9643ad;var _0x353bec;var _0x58c8bc={'encoding':_0x5a1e('0x3d'),'method':_0x5a1e('0x35'),'timeout':0x2710,'url':_0x4ca0a2,'headers':{'Content-Type':_0x5a1e('0x3e')},'body':_0x5a1e('0x3f')+encodeURIComponent(JSON[_0x5a1e('0x40')]([[['jQ1olc',JSON[_0x5a1e('0x40')]([_0xd012d9,_0x47dac0||'en',![],_0x5a1e('0x41')]),null,_0x5a1e('0x42')]]]))};return rp(_0x58c8bc)[_0x5a1e('0x29')](function(_0x431f19){try{_0x353bec=eval(_0x431f19[_0x5a1e('0x43')](0x5))[0x0][0x2];}catch(_0x5cea6c){throw new Error('parse\x20response\x20failed:\x0a'+_0x431f19['data']);}if(!_0x353bec){if(_0xd012d9[_0x5a1e('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x5a1e('0x45')+_0x47dac0+'\x22\x20might\x20not\x20exist');}}try{_0x353bec=eval(_0x353bec)[0x0];}catch(_0x363c2a){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x41c7e3=_0x353bec;_0x399ddd=path[_0x5a1e('0x36')](__dirname,'tmp',rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x46'));fs[_0x5a1e('0x27')](_0x399ddd,_0x353bec,{'encoding':_0x5a1e('0x28')});_0x9643ad=path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x399ddd,_0x9643ad);})[_0x5a1e('0x29')](function(){try{fs[_0x5a1e('0x1d')](_0x399ddd);fs['chmodSync'](_0x9643ad,'777');}catch(_0x5c6768){logger[_0x5a1e('0x15')](_0x5c6768);}logger[_0x5a1e('0x1a')]('goggleTTS\x20path',_0x9643ad[_0x5a1e('0x2c')]('.')[0x0]);return _0x9643ad[_0x5a1e('0x2c')]('.')[0x0];});};exports[_0x5a1e('0x47')]=function(_0x5c8eda,_0x90ac5f,_0x2d4a82){return google[_0x5a1e('0x48')](_0x5c8eda,_0x90ac5f,_0x2d4a82)[_0x5a1e('0x29')](function(_0x34b95b){logger['info'](_0x34b95b[_0x5a1e('0x49')]);return rp(_0x34b95b);})[_0x5a1e('0x29')](function(_0xecb07f){var _0x1caf3a='';var _0x2e2120=0x0;try{fs['unlink'](_0x5c8eda);}catch(_0x411562){logger[_0x5a1e('0x15')](_0x411562);}if(_0xecb07f&&_0xecb07f[_0x5a1e('0x4a')]){_0x1caf3a=_0xecb07f['results'][_0x5a1e('0x4b')](function(_0x293810){return _0x293810&&_0x293810[_0x5a1e('0x4c')][0x0]&&_0x293810[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4d')]?_0x293810[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4d')]:'';})[_0x5a1e('0x4e')]('\x0a');_0x2e2120=_0xecb07f[_0x5a1e('0x4a')][_0x5a1e('0x4b')](function(_0x3936a1){return _0x3936a1&&_0x3936a1[_0x5a1e('0x4c')][0x0]&&_0x3936a1[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4f')]?_0x3936a1[_0x5a1e('0x4c')][0x0][_0x5a1e('0x4f')]:0x0;})[_0x5a1e('0x4e')]('\x0a');}logger[_0x5a1e('0x1a')](_0x5a1e('0x50'),_0x1caf3a);logger[_0x5a1e('0x1a')]('googleASR\x20confidence',_0x2e2120);return{'transcript':_0x1caf3a,'confidence':_0x2e2120};})[_0x5a1e('0x51')](function(_0x82a23e){logger[_0x5a1e('0x15')](_0x5a1e('0x52'),_0x82a23e['statusCode'],_0x82a23e[_0x5a1e('0x53')],_0x82a23e[_0x5a1e('0x54')]);});};exports[_0x5a1e('0x55')]=function(_0x2a0f7a,_0x58987a,_0x281e3a,_0x10ceb2){var _0x43bdc8=apiai(_0x58987a,{'language':_0x10ceb2||'en'});return _0x43bdc8[_0x5a1e('0x56')](_0x281e3a,{'sessionId':md5(_0x2a0f7a)})[_0x5a1e('0x29')](function(_0x1d792e){logger[_0x5a1e('0x1a')](JSON[_0x5a1e('0x40')](_0x1d792e));return{'source':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x58')],'resolvedQuery':_0x1d792e[_0x5a1e('0x57')]['resolvedQuery'],'action':_0x1d792e[_0x5a1e('0x57')]['action'],'actionIncomplete':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x59')],'speech':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x5a')][_0x5a1e('0x5b')],'score':_0x1d792e['result']['score'],'statusCode':_0x1d792e[_0x5a1e('0x5c')]['code'],'endConversation':_0x1d792e[_0x5a1e('0x57')][_0x5a1e('0x5d')][_0x5a1e('0x5e')]||![],'isFallbackIntent':_0x1d792e['result'][_0x5a1e('0x5d')][_0x5a1e('0x5f')]};});};exports[_0x5a1e('0x60')]=function(_0x1db0b3,_0x178b7d,_0x28aa74,_0x68d179,_0x57d3ad,_0xc358f1){var _0x4f5e8e=_0x68d179[_0x5a1e('0x61')](/\\n/g,'\x0a');var _0x1a15ca={'credentials':{'private_key':_0x4f5e8e,'client_email':_0x28aa74}};var _0x46d166=new dialogflow[(_0x5a1e('0x62'))](_0x1a15ca);var _0xaedc02=_0x46d166[_0x5a1e('0x63')](_0x178b7d,md5(_0x1db0b3));var _0x3d51bb={'session':_0xaedc02,'queryInput':{'text':{'text':_0x57d3ad,'languageCode':_0xc358f1}}};return _0x46d166[_0x5a1e('0x64')](_0x3d51bb)['then'](function(_0x565210){if(_0x565210&&_0x565210[_0x5a1e('0x44')]){logger[_0x5a1e('0x1a')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x565210));var _0xa8f403=_0x565210[0x0];if(_0xa8f403){var _0x5cad2d={'action':_0xa8f403[_0x5a1e('0x65')]['action'],'allRequiredParamsPresent':_0xa8f403['queryResult']['allRequiredParamsPresent'],'endConversation':_0xa8f403[_0x5a1e('0x65')]['diagnosticInfo']&&_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x66')][_0x5a1e('0x67')]?_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x66')][_0x5a1e('0x67')][_0x5a1e('0x68')]['boolValue']:![],'fulfillmentText':_0xa8f403['queryResult'][_0x5a1e('0x69')],'intentName':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x6a')]['name'],'intentDisplayName':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x6a')][_0x5a1e('0x6b')],'isFallbackIntent':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x6a')]['isFallback'],'languageCode':_0xa8f403['queryResult'][_0x5a1e('0x6c')],'queryText':_0xa8f403[_0x5a1e('0x65')]['queryText'],'responseId':_0xa8f403[_0x5a1e('0x6d')],'score':_0xa8f403['queryResult'][_0x5a1e('0x6e')],'speech':_0xa8f403[_0x5a1e('0x65')][_0x5a1e('0x69')],'providerResponse':JSON[_0x5a1e('0x40')](_0x565210)};return _0x5cad2d;}}});};exports[_0x5a1e('0x6f')]=function(_0x523ba1,_0x84fd46,_0x2945ef,_0xb4f1af){return tilde['asr'](_0x523ba1,_0x84fd46,_0x2945ef,_0xb4f1af)['then'](function(_0x56695c){try{fs['unlink'](_0x523ba1);}catch(_0x50f6cc){logger['error'](_0x50f6cc);}logger['info'](_0x5a1e('0x70'),_0x56695c[_0x5a1e('0x4d')]);logger['info'](_0x5a1e('0x71'),_0x56695c[_0x5a1e('0x4f')]);return _0x56695c;});};exports[_0x5a1e('0x72')]=function(_0xf9cfea,_0xe8bec4,_0x2fd38e,_0x15aac4,_0x520d0b,_0x2e7636){var _0x364a36=path[_0x5a1e('0x36')](__dirname,'tmp',rs[_0x5a1e('0x26')](0x4)+'.mp3');var _0x574c01;return aws[_0x5a1e('0x73')](_0xf9cfea,_0xe8bec4,_0x2fd38e,_0x15aac4,_0x520d0b,_0x2e7636,_0x364a36)[_0x5a1e('0x29')](function(){_0x574c01=path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x74'));return convertFile(_0x364a36,_0x574c01);})[_0x5a1e('0x29')](function(){try{fs['unlink'](_0x364a36);fs[_0x5a1e('0x2a')](_0x574c01,_0x5a1e('0x2b'));}catch(_0x5453c0){logger[_0x5a1e('0x15')](_0x5453c0);}return _0x574c01[_0x5a1e('0x2c')]('.')[0x0];});};exports[_0x5a1e('0x75')]=function(_0x34738c,_0x77f1ea,_0x1c6864,_0x108d34,_0x4cf0d8,_0xb9d0e5){return aws[_0x5a1e('0x76')](_0x34738c,_0x77f1ea,_0x1c6864,_0x108d34,_0x4cf0d8,_0xb9d0e5)['then'](function(_0x2faa11){logger[_0x5a1e('0x1a')](JSON[_0x5a1e('0x40')](_0x2faa11));return _0x2faa11;});};exports[_0x5a1e('0x77')]=function(_0x5f42d2,_0x25ccab,_0x5dcc09,_0x315d35){var _0x271c47=util[_0x5a1e('0x78')](_0x5a1e('0x79'),ISPEECH_API,_0x5f42d2,encodeURIComponent(_0x25ccab),_0x5dcc09,_0x315d35);var _0x4ae517=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x46'));var _0x3671ed;return downloadFile(_0x271c47,_0x4ae517)['then'](function(){_0x3671ed=path['resolve'](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+_0x5a1e('0x74'));return convertFile(_0x4ae517,_0x3671ed);})[_0x5a1e('0x29')](function(){try{fs[_0x5a1e('0x1d')](_0x4ae517);fs[_0x5a1e('0x2a')](_0x3671ed,_0x5a1e('0x2b'));}catch(_0x273764){logger[_0x5a1e('0x15')](_0x273764);}return _0x3671ed['split']('.')[0x0];});};exports[_0x5a1e('0x7a')]=function(_0x242ba9,_0xd7de96,_0x2a8357,_0x4ca62d){var _0x2ccf6d=util[_0x5a1e('0x78')](_0x5a1e('0x7b'),ISPEECH_API,_0xd7de96,_0x2a8357,base64Encode(_0x242ba9),_0x4ca62d?util['format'](_0x5a1e('0x7c'),encodeURIComponent(_0x4ca62d)):_0x5a1e('0x7d'));return uploadFile(_0x2ccf6d)[_0x5a1e('0x29')](function(_0x341eaf){return querystring[_0x5a1e('0xb')](_0x341eaf);});};exports['sestekNDA']=function(_0x5a918d,_0x15c677){return sestek['nda'](_0x5a918d,_0x15c677)['then'](function(_0x7b46bd){logger[_0x5a1e('0x1a')](JSON[_0x5a1e('0x40')](_0x7b46bd));var _0x3c04ca={'speech':_0x7b46bd[_0x5a1e('0x7e')],'action':_0x7b46bd[_0x5a1e('0x7f')]?_0x7b46bd[_0x5a1e('0x7f')][_0x5a1e('0x80')]:undefined,'actiondata':_0x7b46bd[_0x5a1e('0x7f')]?_0x7b46bd['channelData'][_0x5a1e('0x81')]:undefined};if(_0x7b46bd['channelData']&&_0x7b46bd[_0x5a1e('0x7f')][_0x5a1e('0x82')]){return base64Decode(_0x7b46bd[_0x5a1e('0x7f')][_0x5a1e('0x82')][_0x5a1e('0x83')],path[_0x5a1e('0x36')](__dirname,_0x5a1e('0x25'),rs[_0x5a1e('0x26')](0x4)+'.wav'))[_0x5a1e('0x29')](function(_0x54861e){_0x3c04ca[_0x5a1e('0x84')]=_0x54861e;return _0x3c04ca;});}return _0x3c04ca;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xdb95=['finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','chmodSync','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','data','length','lang\x20\x22','parse\x20response\x20failed:\x0a','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','name','message','textRequest','source','resolvedQuery','result','actionIncomplete','speech','score','status','code','isFallbackIntent','googleDialogflowV2','sessionPath','detectIntent','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','error','request\x20to\x20','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','end','transcode'];(function(_0x18b25f,_0x5ee84d){var _0x412d58=function(_0x5d198d){while(--_0x5d198d){_0x18b25f['push'](_0x18b25f['shift']());}};_0x412d58(++_0x5ee84d);}(_0xdb95,0xe3));var _0x5db9=function(_0x4429ef,_0x499b48){_0x4429ef=_0x4429ef-0x0;var _0x455088=_0xdb95[_0x4429ef];return _0x455088;};'use strict';var apiai=require(_0x5db9('0x0'));var BPromise=require(_0x5db9('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require('md5');var path=require(_0x5db9('0x2'));var querystring=require('querystring');var rp=require(_0x5db9('0x3'));var rs=require(_0x5db9('0x4'));var sox=require(_0x5db9('0x5'));var tts=require(_0x5db9('0x6'));var urlParse=require(_0x5db9('0x7'))[_0x5db9('0x8')];var util=require(_0x5db9('0x9'));var aws=require(_0x5db9('0xa'));var google=require(_0x5db9('0xb'));var sestek=require(_0x5db9('0xc'));var tilde=require(_0x5db9('0xd'));var logger=require(_0x5db9('0xe'))(_0x5db9('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x21721d,_0x28d0af){return new BPromise(function(_0xe5274,_0x3c77d3){var _0x3c1885=urlParse(_0x21721d);var _0x31b02f=_0x3c1885[_0x5db9('0x10')]===_0x5db9('0x11')?https:http;var _0x4433b6={'host':_0x3c1885[_0x5db9('0x12')],'path':_0x3c1885[_0x5db9('0x2')],'headers':{'user-agent':_0x5db9('0x13')}};_0x31b02f[_0x5db9('0x14')](_0x4433b6,function(_0x362879){if(_0x362879['statusCode']!==0xc8){logger[_0x5db9('0x15')](_0x5db9('0x16')+_0x21721d+'\x20failed,\x20status\x20code\x20=\x20'+_0x362879[_0x5db9('0x17')]+'\x20('+_0x362879['statusMessage']+')');_0x3c77d3(new Error(_0x5db9('0x16')+_0x21721d+_0x5db9('0x18')+_0x362879['statusCode']+'\x20('+_0x362879[_0x5db9('0x19')]+')'));return;}var _0x40fe50=fs[_0x5db9('0x1a')](_0x28d0af);_0x40fe50['on']('finish',function(){logger[_0x5db9('0x1b')](_0x5db9('0x1c'));_0x40fe50[_0x5db9('0x1d')](_0xe5274);});_0x40fe50['on'](_0x5db9('0x15'),function(_0xa78eda){fs[_0x5db9('0x1e')](_0x28d0af);logger['error']('download\x20error',_0xa78eda);_0x3c77d3(_0xa78eda);});_0x362879['pipe'](_0x40fe50);})['on'](_0x5db9('0x15'),function(_0x2adf17){logger[_0x5db9('0x15')](_0x2adf17);_0x3c77d3(_0x2adf17);})[_0x5db9('0x1f')]();});}function uploadFile(_0x1e1e1b){return new BPromise(function(_0x5c2fb7,_0x13be99){var _0x35d1d1=urlParse(_0x1e1e1b);var _0x420ecb=_0x35d1d1['protocol']===_0x5db9('0x11')?https:http;var _0x18ef64={'host':_0x35d1d1[_0x5db9('0x12')],'path':_0x35d1d1[_0x5db9('0x2')],'headers':{'user-agent':'WHAT_EVER'}};_0x420ecb[_0x5db9('0x14')](_0x18ef64,function(_0x526d46){if(_0x526d46[_0x5db9('0x17')]!==0xc8){_0x13be99(new Error(_0x5db9('0x16')+_0x1e1e1b+_0x5db9('0x18')+_0x526d46[_0x5db9('0x17')]+'\x20('+_0x526d46['statusMessage']+')'));return;}var _0x510aa3='';_0x526d46['on']('data',function(_0x5510e9){_0x510aa3+=_0x5510e9;});_0x526d46['on']('end',function(){_0x5c2fb7(_0x510aa3);});})['on'](_0x5db9('0x15'),function(_0x4c0015){_0x13be99(_0x4c0015);})['end']();});}function convertFile(_0x440861,_0x32b88e){return new BPromise(function(_0x168fa6,_0x201a62){var _0x46ad13=sox[_0x5db9('0x20')](_0x440861,_0x32b88e,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x46ad13['on'](_0x5db9('0x15'),function(_0x2ed88f){logger[_0x5db9('0x15')]('error\x20convert',_0x2ed88f);_0x201a62(_0x2ed88f);});_0x46ad13['on'](_0x5db9('0x1f'),function(){logger[_0x5db9('0x1b')](_0x5db9('0x21'));_0x168fa6();});_0x46ad13[_0x5db9('0x22')]();});}function base64Decode(_0x4c129d,_0x11d7ff){var _0x4d929d=path[_0x5db9('0x23')](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+_0x5db9('0x26'));fs[_0x5db9('0x27')](_0x4d929d,_0x4c129d,_0x5db9('0x28'));return convertFile(_0x4d929d,_0x11d7ff)[_0x5db9('0x29')](function(){try{fs[_0x5db9('0x1e')](_0x4d929d);fs['chmodSync'](_0x11d7ff,_0x5db9('0x2a'));}catch(_0x3a95a8){logger[_0x5db9('0x15')](_0x3a95a8);}return _0x11d7ff[_0x5db9('0x2b')]('.')[0x0];});}function base64Encode(_0x2f5128){var _0x29f324=fs['readFileSync'](_0x2f5128);return new Buffer(_0x29f324)[_0x5db9('0x2c')]('base64');}exports[_0x5db9('0x2d')]=function(_0x466ffd,_0x10dce9,_0x5368f4,_0x4ec5a5,_0x557477,_0x468ec7){var _0x27f40e,_0x901b52;var _0x4d1a32=_0x5db9('0x2e');var _0x12c0d3=_0x5db9('0x2f')+_0x466ffd;var _0x58ba0b={};if(_0x10dce9==='ssml'){_0x58ba0b[_0x5db9('0x30')]={'ssml':_0x5368f4};}else{_0x58ba0b['input']={'text':_0x5368f4};};_0x58ba0b[_0x5db9('0x31')]={'languageCode':_0x4ec5a5,'ssmlGender':_0x557477};_0x58ba0b[_0x5db9('0x32')]={'audioEncoding':_0x5db9('0x33'),'sampleRateHertz':0x1f40};var _0xf33fdb={'url':_0x4d1a32+'text:synthesize'+_0x12c0d3,'method':_0x5db9('0x34'),'json':!![],'body':_0x58ba0b};return rp(_0xf33fdb)[_0x5db9('0x29')](function(_0x458d42){return new BPromise(function(_0x3958f0,_0xcdbbcc){_0x27f40e=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x5db9('0x35'));var _0x81c101=Buffer[_0x5db9('0x36')](_0x458d42[_0x5db9('0x37')],'base64');return fs['writeFile'](_0x27f40e,_0x81c101,function(_0x3afb92){_0xcdbbcc(_0x3afb92);},function(_0x2d348a){fs[_0x5db9('0x38')](_0x27f40e,_0x5db9('0x2a'));_0x3958f0(_0x2d348a);});});})[_0x5db9('0x29')](function(_0x35b7d0){_0x901b52=path['resolve'](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+_0x5db9('0x26'));return convertFile(_0x27f40e,_0x901b52);})[_0x5db9('0x29')](function(){try{fs[_0x5db9('0x1e')](_0x27f40e);fs[_0x5db9('0x38')](_0x901b52,_0x5db9('0x2a'));}catch(_0x4ef1da){logger[_0x5db9('0x15')](_0x4ef1da);}logger['info']('googleCloudTTS\x20path',_0x901b52['split']('.')[0x0]);return _0x901b52['split']('.')[0x0];});};exports[_0x5db9('0x39')]=function(_0x14c19b,_0x5c0840){var _0x4dfc7a=_0x5db9('0x3a');var _0x4a024c,_0x4d75b8;var _0x4b6dd3;var _0x404452={'encoding':_0x5db9('0x3b'),'method':_0x5db9('0x34'),'timeout':0x2710,'url':_0x4dfc7a,'headers':{'Content-Type':_0x5db9('0x3c')},'body':'f.req='+encodeURIComponent(JSON[_0x5db9('0x3d')]([[[_0x5db9('0x3e'),JSON[_0x5db9('0x3d')]([_0x14c19b,_0x5c0840||'en',![],'null']),null,_0x5db9('0x3f')]]]))};return rp(_0x404452)[_0x5db9('0x29')](function(_0x1739cc){try{_0x4b6dd3=eval(_0x1739cc[_0x5db9('0x40')](0x5))[0x0][0x2];}catch(_0x34d232){throw new Error('parse\x20response\x20failed:\x0a'+_0x1739cc[_0x5db9('0x41')]);}if(!_0x4b6dd3){if(_0x14c19b[_0x5db9('0x42')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x5db9('0x43')+_0x5c0840+'\x22\x20might\x20not\x20exist');}}try{_0x4b6dd3=eval(_0x4b6dd3)[0x0];}catch(_0x32f420){throw new Error(_0x5db9('0x44')+res[_0x5db9('0x41')]);}const _0x2633f9=_0x4b6dd3;_0x4a024c=path[_0x5db9('0x23')](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+'.mp3');fs[_0x5db9('0x27')](_0x4a024c,_0x4b6dd3,{'encoding':_0x5db9('0x28')});_0x4d75b8=path[_0x5db9('0x23')](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+_0x5db9('0x26'));return convertFile(_0x4a024c,_0x4d75b8);})[_0x5db9('0x29')](function(){try{fs['unlink'](_0x4a024c);fs[_0x5db9('0x38')](_0x4d75b8,_0x5db9('0x2a'));}catch(_0x1f7cdc){logger[_0x5db9('0x15')](_0x1f7cdc);}logger[_0x5db9('0x1b')]('goggleTTS\x20path',_0x4d75b8[_0x5db9('0x2b')]('.')[0x0]);return _0x4d75b8[_0x5db9('0x2b')]('.')[0x0];});};exports[_0x5db9('0x45')]=function(_0x5426d7,_0x1955b0,_0x769708){return google[_0x5db9('0x46')](_0x5426d7,_0x1955b0,_0x769708)['then'](function(_0x2cff52){logger['info'](_0x2cff52[_0x5db9('0x47')]);return rp(_0x2cff52);})[_0x5db9('0x29')](function(_0x5286bd){var _0x12cf1d='';var _0x4e92b2=0x0;try{fs[_0x5db9('0x1e')](_0x5426d7);}catch(_0x1efb0d){logger[_0x5db9('0x15')](_0x1efb0d);}if(_0x5286bd&&_0x5286bd[_0x5db9('0x48')]){_0x12cf1d=_0x5286bd[_0x5db9('0x48')][_0x5db9('0x49')](function(_0x4577cd){return _0x4577cd&&_0x4577cd['alternatives'][0x0]&&_0x4577cd[_0x5db9('0x4a')][0x0][_0x5db9('0x4b')]?_0x4577cd[_0x5db9('0x4a')][0x0][_0x5db9('0x4b')]:'';})[_0x5db9('0x4c')]('\x0a');_0x4e92b2=_0x5286bd[_0x5db9('0x48')][_0x5db9('0x49')](function(_0x1699aa){return _0x1699aa&&_0x1699aa[_0x5db9('0x4a')][0x0]&&_0x1699aa[_0x5db9('0x4a')][0x0][_0x5db9('0x4d')]?_0x1699aa[_0x5db9('0x4a')][0x0]['confidence']:0x0;})[_0x5db9('0x4c')]('\x0a');}logger[_0x5db9('0x1b')]('googleASR\x20transcription',_0x12cf1d);logger[_0x5db9('0x1b')](_0x5db9('0x4e'),_0x4e92b2);return{'transcript':_0x12cf1d,'confidence':_0x4e92b2};})[_0x5db9('0x4f')](function(_0x38c308){logger[_0x5db9('0x15')]('[%s]\x20%s:%s',_0x38c308[_0x5db9('0x17')],_0x38c308[_0x5db9('0x50')],_0x38c308[_0x5db9('0x51')]);});};exports['googleDialogflow']=function(_0x444c48,_0x3ffa82,_0x405db3,_0x199bc8){var _0x567c73=apiai(_0x3ffa82,{'language':_0x199bc8||'en'});return _0x567c73[_0x5db9('0x52')](_0x405db3,{'sessionId':md5(_0x444c48)})[_0x5db9('0x29')](function(_0x38ab8a){logger[_0x5db9('0x1b')](JSON[_0x5db9('0x3d')](_0x38ab8a));return{'source':_0x38ab8a['result'][_0x5db9('0x53')],'resolvedQuery':_0x38ab8a['result'][_0x5db9('0x54')],'action':_0x38ab8a[_0x5db9('0x55')]['action'],'actionIncomplete':_0x38ab8a[_0x5db9('0x55')][_0x5db9('0x56')],'speech':_0x38ab8a[_0x5db9('0x55')]['fulfillment'][_0x5db9('0x57')],'score':_0x38ab8a['result'][_0x5db9('0x58')],'statusCode':_0x38ab8a[_0x5db9('0x59')][_0x5db9('0x5a')],'endConversation':_0x38ab8a[_0x5db9('0x55')]['metadata']['endConversation']||![],'isFallbackIntent':_0x38ab8a['result']['metadata'][_0x5db9('0x5b')]};});};exports[_0x5db9('0x5c')]=function(_0x34b5d5,_0x1a06fb,_0x1ee702,_0x4cf51b,_0x2995f1,_0x273696){var _0x3624af=_0x4cf51b['replace'](/\\n/g,'\x0a');var _0x30ba6a={'credentials':{'private_key':_0x3624af,'client_email':_0x1ee702}};var _0x3ad53d=new dialogflow['SessionsClient'](_0x30ba6a);var _0x58e17a=_0x3ad53d[_0x5db9('0x5d')](_0x1a06fb,md5(_0x34b5d5));var _0x56939b={'session':_0x58e17a,'queryInput':{'text':{'text':_0x2995f1,'languageCode':_0x273696}}};return _0x3ad53d[_0x5db9('0x5e')](_0x56939b)[_0x5db9('0x29')](function(_0x32e324){if(_0x32e324&&_0x32e324[_0x5db9('0x42')]){logger[_0x5db9('0x1b')]('Dialogflow\x20V2\x20response:',JSON[_0x5db9('0x3d')](_0x32e324));var _0x5ef06f=_0x32e324[0x0];if(_0x5ef06f){var _0x1398c7={'action':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x60')],'allRequiredParamsPresent':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x61')],'endConversation':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x62')]&&_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x62')][_0x5db9('0x63')]?_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x62')][_0x5db9('0x63')][_0x5db9('0x64')][_0x5db9('0x65')]:![],'fulfillmentText':_0x5ef06f['queryResult']['fulfillmentText'],'intentName':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x66')]['name'],'intentDisplayName':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x66')]['displayName'],'isFallbackIntent':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x66')][_0x5db9('0x67')],'languageCode':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x68')],'queryText':_0x5ef06f['queryResult'][_0x5db9('0x69')],'responseId':_0x5ef06f[_0x5db9('0x6a')],'score':_0x5ef06f[_0x5db9('0x5f')][_0x5db9('0x6b')],'speech':_0x5ef06f['queryResult'][_0x5db9('0x6c')],'providerResponse':JSON['stringify'](_0x32e324)};return _0x1398c7;}}});};exports['tildeASR']=function(_0x7e3045,_0x1a5284,_0x51628c,_0x4b480d){return tilde['asr'](_0x7e3045,_0x1a5284,_0x51628c,_0x4b480d)[_0x5db9('0x29')](function(_0x3d3288){try{fs['unlink'](_0x7e3045);}catch(_0x32cd4d){logger[_0x5db9('0x15')](_0x32cd4d);}logger[_0x5db9('0x1b')]('Tilde\x20ASR\x20transcription',_0x3d3288[_0x5db9('0x4b')]);logger[_0x5db9('0x1b')](_0x5db9('0x6d'),_0x3d3288[_0x5db9('0x4d')]);return _0x3d3288;});};exports[_0x5db9('0x6e')]=function(_0x493ea5,_0x408b55,_0x5c9f53,_0x265261,_0x39d5b1,_0x227d93){var _0x2721c5=path[_0x5db9('0x23')](__dirname,'tmp',rs[_0x5db9('0x25')](0x4)+_0x5db9('0x35'));var _0x49be11;return aws[_0x5db9('0x6f')](_0x493ea5,_0x408b55,_0x5c9f53,_0x265261,_0x39d5b1,_0x227d93,_0x2721c5)[_0x5db9('0x29')](function(){_0x49be11=path['resolve'](__dirname,_0x5db9('0x24'),rs['generate'](0x4)+_0x5db9('0x26'));return convertFile(_0x2721c5,_0x49be11);})['then'](function(){try{fs['unlink'](_0x2721c5);fs[_0x5db9('0x38')](_0x49be11,_0x5db9('0x2a'));}catch(_0x381461){logger[_0x5db9('0x15')](_0x381461);}return _0x49be11[_0x5db9('0x2b')]('.')[0x0];});};exports[_0x5db9('0x70')]=function(_0x29ae96,_0x596b58,_0x3e9dd1,_0x4d5d33,_0x2815ff,_0x2baf04){return aws[_0x5db9('0x71')](_0x29ae96,_0x596b58,_0x3e9dd1,_0x4d5d33,_0x2815ff,_0x2baf04)['then'](function(_0x53d8fe){logger[_0x5db9('0x1b')](JSON[_0x5db9('0x3d')](_0x53d8fe));return _0x53d8fe;});};exports['ispeechTTS']=function(_0x3f5884,_0x44469a,_0x25962a,_0x555594){var _0x3e046e=util[_0x5db9('0x72')](_0x5db9('0x73'),ISPEECH_API,_0x3f5884,encodeURIComponent(_0x44469a),_0x25962a,_0x555594);var _0x462c17=path[_0x5db9('0x23')](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+'.mp3');var _0x525ad4;return downloadFile(_0x3e046e,_0x462c17)['then'](function(){_0x525ad4=path['resolve'](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+'.wav');return convertFile(_0x462c17,_0x525ad4);})[_0x5db9('0x29')](function(){try{fs[_0x5db9('0x1e')](_0x462c17);fs[_0x5db9('0x38')](_0x525ad4,_0x5db9('0x2a'));}catch(_0x1c9aa7){logger[_0x5db9('0x15')](_0x1c9aa7);}return _0x525ad4[_0x5db9('0x2b')]('.')[0x0];});};exports[_0x5db9('0x74')]=function(_0x344eb2,_0x14b6c6,_0x43ed50,_0x23fa40){var _0x374002=util[_0x5db9('0x72')](_0x5db9('0x75'),ISPEECH_API,_0x14b6c6,_0x43ed50,base64Encode(_0x344eb2),_0x23fa40?util['format'](_0x5db9('0x76'),encodeURIComponent(_0x23fa40)):_0x5db9('0x77'));return uploadFile(_0x374002)[_0x5db9('0x29')](function(_0x26e787){return querystring[_0x5db9('0x8')](_0x26e787);});};exports[_0x5db9('0x78')]=function(_0x5ea249,_0x206d27){return sestek[_0x5db9('0x79')](_0x5ea249,_0x206d27)['then'](function(_0x8e19a6){logger[_0x5db9('0x1b')](JSON['stringify'](_0x8e19a6));var _0x1a1877={'speech':_0x8e19a6[_0x5db9('0x7a')],'action':_0x8e19a6[_0x5db9('0x7b')]?_0x8e19a6['channelData'][_0x5db9('0x7c')]:undefined,'actiondata':_0x8e19a6[_0x5db9('0x7b')]?_0x8e19a6[_0x5db9('0x7b')][_0x5db9('0x7d')]:undefined};if(_0x8e19a6[_0x5db9('0x7b')]&&_0x8e19a6[_0x5db9('0x7b')][_0x5db9('0x7e')]){return base64Decode(_0x8e19a6[_0x5db9('0x7b')][_0x5db9('0x7e')][_0x5db9('0x7f')],path[_0x5db9('0x23')](__dirname,_0x5db9('0x24'),rs[_0x5db9('0x25')](0x4)+_0x5db9('0x26')))[_0x5db9('0x29')](function(_0x30c0b7){_0x1a1877[_0x5db9('0x80')]=_0x30c0b7;return _0x1a1877;});}return _0x1a1877;});};exports[_0x5db9('0x81')]=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 a3ffcb7..e049603 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 _0xcbdb=['exports','./nda'];(function(_0x3e8ed9,_0x4f505a){var _0x29eecc=function(_0x5ea983){while(--_0x5ea983){_0x3e8ed9['push'](_0x3e8ed9['shift']());}};_0x29eecc(++_0x4f505a);}(_0xcbdb,0x111));var _0xbcbd=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xcbdb[_0x125ff8];return _0x2d9ef;};var nda=require(_0xbcbd('0x0'));module[_0xbcbd('0x1')]={'nda':nda}; \ No newline at end of file +var _0x26d7=['exports'];(function(_0x4e5976,_0x307099){var _0x1a1fa2=function(_0x655618){while(--_0x655618){_0x4e5976['push'](_0x4e5976['shift']());}};_0x1a1fa2(++_0x307099);}(_0x26d7,0x1d2));var _0x726d=function(_0x4ee79a,_0x191a6e){_0x4ee79a=_0x4ee79a-0x0;var _0x400ae7=_0x26d7[_0x4ee79a];return _0x400ae7;};var nda=require('./nda');module[_0x726d('0x0')]={'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 9c72ebb..be3dccb 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 _0x2bdb=['CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action'];(function(_0x31d53a,_0x3c21e5){var _0x3ce703=function(_0x33f317){while(--_0x33f317){_0x31d53a['push'](_0x31d53a['shift']());}};_0x3ce703(++_0x3c21e5);}(_0x2bdb,0x105));var _0xb2bd=function(_0x4259a3,_0x2f9e82){_0x4259a3=_0x4259a3-0x0;var _0x5dfed4=_0x2bdb[_0x4259a3];return _0x5dfed4;};'use strict';var rp=require(_0xb2bd('0x0'));var url=require('url');var logger=require(_0xb2bd('0x1'))('agi');module[_0xb2bd('0x2')]=function(_0x1d3ddb,_0xab9a35){var _0x552d38={'method':_0xb2bd('0x3'),'uri':url[_0xb2bd('0x4')](_0xab9a35[_0xb2bd('0x5')],_0xb2bd('0x6')),'form':{'grant_type':_0xb2bd('0x7'),'username':_0xab9a35[_0xb2bd('0x8')],'password':_0xab9a35[_0xb2bd('0x7')]},'json':!![]};return rp(_0x552d38)['then'](function(_0x21462b){var _0x4d9d3f={'method':_0xb2bd('0x3'),'uri':url[_0xb2bd('0x4')](_0xab9a35[_0xb2bd('0x9')],_0xb2bd('0xa')),'body':{'type':_0xab9a35[_0xb2bd('0xb')]||_0xb2bd('0xc'),'channelId':_0xb2bd('0xd'),'conversation':{'id':_0x1d3ddb[_0xb2bd('0xe')]},'from':{'id':_0x1d3ddb[_0xb2bd('0xf')],'name':_0x1d3ddb['calleridname']},'recipient':{'id':_0x1d3ddb[_0xb2bd('0x10')],'name':_0x1d3ddb[_0xb2bd('0x11')]},'text':_0xab9a35[_0xb2bd('0x12')],'channelData':{}},'headers':{'Authorization':_0xb2bd('0x13')+_0x21462b[_0xb2bd('0x14')]},'json':!![]};if(_0xab9a35[_0xb2bd('0x15')]){_0x4d9d3f[_0xb2bd('0x16')][_0xb2bd('0x17')]['ProjectName']=_0xab9a35[_0xb2bd('0x15')];}if(_0xab9a35['ndagenerate_audio']=='1'){_0x4d9d3f[_0xb2bd('0x16')][_0xb2bd('0x17')][_0xb2bd('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb2bd('0x19')};}if(_0xab9a35[_0xb2bd('0x1a')]){_0x4d9d3f['body'][_0xb2bd('0x17')][_0xb2bd('0x1b')]=_0xab9a35[_0xb2bd('0x1a')];if(_0xab9a35[_0xb2bd('0x1c')]){_0x4d9d3f['body'][_0xb2bd('0x17')][_0xb2bd('0x1d')]=_0xab9a35['custom_action_data'];}}logger[_0xb2bd('0x1e')](JSON[_0xb2bd('0x1f')](_0x4d9d3f));return rp(_0x4d9d3f);});}; \ No newline at end of file +var _0x54f3=['agi','exports','POST','resolve','ndauth_url','username','then','ndassistant_url','ndaactivity_type','message','callerid','calleridname','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','CustomActionData','custom_action_data','info','stringify','url','../../../../../config/logger'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x54f3,0x120));var _0x354f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x54f3[_0x178e48];return _0x440d7e;};'use strict';var rp=require('request-promise');var url=require(_0x354f('0x0'));var logger=require(_0x354f('0x1'))(_0x354f('0x2'));module[_0x354f('0x3')]=function(_0x2cd824,_0x517a53){var _0x48d7aa={'method':_0x354f('0x4'),'uri':url[_0x354f('0x5')](_0x517a53[_0x354f('0x6')],'/token'),'form':{'grant_type':'password','username':_0x517a53[_0x354f('0x7')],'password':_0x517a53['password']},'json':!![]};return rp(_0x48d7aa)[_0x354f('0x8')](function(_0x4311ad){var _0x2f111a={'method':_0x354f('0x4'),'uri':url['resolve'](_0x517a53[_0x354f('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x517a53[_0x354f('0xa')]||_0x354f('0xb'),'channelId':'Nda','conversation':{'id':_0x2cd824['uniqueid']},'from':{'id':_0x2cd824[_0x354f('0xc')],'name':_0x2cd824[_0x354f('0xd')]},'recipient':{'id':_0x2cd824['dnid'],'name':_0x2cd824[_0x354f('0xe')]},'text':_0x517a53[_0x354f('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4311ad[_0x354f('0x10')]},'json':!![]};if(_0x517a53[_0x354f('0x11')]){_0x2f111a[_0x354f('0x12')][_0x354f('0x13')][_0x354f('0x14')]=_0x517a53[_0x354f('0x11')];}if(_0x517a53[_0x354f('0x15')]=='1'){_0x2f111a['body'][_0x354f('0x13')][_0x354f('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x354f('0x17')};}if(_0x517a53['custom_action']){_0x2f111a[_0x354f('0x12')][_0x354f('0x13')][_0x354f('0x18')]=_0x517a53['custom_action'];if(_0x517a53['custom_action_data']){_0x2f111a[_0x354f('0x12')][_0x354f('0x13')][_0x354f('0x19')]=_0x517a53[_0x354f('0x1a')];}}logger[_0x354f('0x1b')](JSON[_0x354f('0x1c')](_0x2f111a));return rp(_0x2f111a);});}; \ 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 b57bdd8..c81c675 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 _0xc98d=['exports','./lib/api'];(function(_0x302997,_0x192c04){var _0x24e5d3=function(_0x27ceb8){while(--_0x27ceb8){_0x302997['push'](_0x302997['shift']());}};_0x24e5d3(++_0x192c04);}(_0xc98d,0x91));var _0xdc98=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xc98d[_0x35d3a8];return _0x182378;};'use strict';var asr=require(_0xdc98('0x0'));module[_0xdc98('0x1')]=function(_0x34373c,_0x298bd4,_0x291f38,_0x522d79){return asr(_0x34373c,_0x298bd4,_0x291f38,_0x522d79);}; \ No newline at end of file +var _0x030a=['./lib/api'];(function(_0x36fe2a,_0x40f21a){var _0x54566f=function(_0x29bda7){while(--_0x29bda7){_0x36fe2a['push'](_0x36fe2a['shift']());}};_0x54566f(++_0x40f21a);}(_0x030a,0xa8));var _0xa030=function(_0x6090f2,_0x90b872){_0x6090f2=_0x6090f2-0x0;var _0x2618d2=_0x030a[_0x6090f2];return _0x2618d2;};'use strict';var asr=require(_0xa030('0x0'));module['exports']=function(_0x1b4304,_0x57ba22,_0x3b37fb,_0x2f36d7){return asr(_0x1b4304,_0x57ba22,_0x3b37fb,_0x2f36d7);}; \ 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 758655e..dce3a7f 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 _0xddad=['exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','stringify','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xddad,0xd3));var _0xddda=function(_0x192add,_0x4490e4){_0x192add=_0x192add-0x0;var _0x1b9d9d=_0xddad[_0x192add];return _0x1b9d9d;};'use strict';var BPromise=require(_0xddda('0x0'));var _=require(_0xddda('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xddda('0x2'));var crypto=require('crypto');var logger=require(_0xddda('0x3'))(_0xddda('0x4'));module[_0xddda('0x5')]=function(_0x18a684,_0x3bf7be,_0x539f8f,_0x82b192){return new BPromise(function(_0x5f3cd4,_0x3417ba){logger[_0xddda('0x6')](_0xddda('0x7'),_0x82b192||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xd0d6e1=new WebSocket(_0x82b192||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x211bc7='';var _0x8efda3='0';var _0x58609f='1';var _0x753e6b=_0xddda('0x8');function _0x15195e(_0x102e2f){var _0x53fc02=crypto[_0xddda('0x9')](_0xddda('0xa'));_0x53fc02[_0xddda('0xb')](_0x102e2f);return _0x53fc02[_0xddda('0xc')]('hex');}function _0x133da0(){try{logger[_0xddda('0x6')](_0xddda('0xd'));var _0x3b8d21=moment()['unix']();var _0x3df7e1=_0x15195e(_0x3b8d21+_0x3bf7be+_0x539f8f);_0xd0d6e1['send'](JSON[_0xddda('0xe')]({'appID':_0x3bf7be,'timestamp':_0x3b8d21,'appKey':_0x3df7e1}));var _0x36f1bb=fs['createReadStream'](_0x18a684);_0x36f1bb['on'](_0xddda('0xf'),function(_0x5853f6){_0xd0d6e1[_0xddda('0x10')](_0x5853f6);});_0x36f1bb['on'](_0xddda('0x11'),function(){_0xd0d6e1[_0xddda('0x10')](_0xddda('0x12'));});}catch(_0x520f7a){logger[_0xddda('0x13')](_0xddda('0x14'),JSON[_0xddda('0xe')](_0x520f7a));_0xd0d6e1[_0xddda('0x15')]();}}function _0x46b1a4(_0x402e95){try{if(_0x402e95){var _0x88cc4d=JSON[_0xddda('0x16')](_0x402e95);switch(_0x88cc4d['status']){case 0x0:if(_0x88cc4d['result']){if(_0x88cc4d[_0xddda('0x17')]['final']){logger[_0xddda('0x6')](_0xddda('0x18'),JSON['stringify'](_0x88cc4d[_0xddda('0x17')]['hypotheses']));_0x211bc7=_0x88cc4d[_0xddda('0x17')][_0xddda('0x19')][0x0]['transcript'];_0x8efda3=_0x88cc4d['result'][_0xddda('0x19')][0x0]['likelihood'];_0x58609f='0';_0x753e6b=_0xddda('0x1a');_0xd0d6e1['terminate']();}}break;case 0x1:logger[_0xddda('0x6')](_0xddda('0x8'));_0x58609f='1';_0x753e6b=_0xddda('0x8');break;case 0x2:logger[_0xddda('0x6')](_0xddda('0x1b'));_0x58609f='2';_0x753e6b=_0xddda('0x1b');break;case 0x9:logger['info'](_0xddda('0x1c'));_0x58609f='9';_0x753e6b=_0xddda('0x1c');break;case 0xa:logger[_0xddda('0x6')]('Authentication\x20failed.');_0x58609f='10';_0x753e6b=_0xddda('0x1d');break;case 0xb:logger[_0xddda('0x6')](_0xddda('0x1e'));_0x58609f='11';_0x753e6b=_0xddda('0x1e');}}}catch(_0x56b78b){logger['error'](_0xddda('0x1f'),JSON[_0xddda('0xe')](_0x56b78b));_0xd0d6e1[_0xddda('0x15')]();}}function _0x1348f9(){logger[_0xddda('0x6')](_0xddda('0x20'));_0x5f3cd4({'transcript':_0x211bc7,'confidence':_0x8efda3,'status':_0x58609f,'status_message':_0x753e6b});}function _0x3580f4(_0x130fb3){logger[_0xddda('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xddda('0x21')](_0x130fb3)){logger[_0xddda('0x13')](_['isObject'](_0x130fb3)?JSON['stringify'](_0x130fb3):_0x130fb3);}}_0xd0d6e1['on'](_0xddda('0x22'),_0x133da0);_0xd0d6e1['on'](_0xddda('0x23'),_0x46b1a4);_0xd0d6e1['on']('close',_0x1348f9);_0xd0d6e1['on']('error',_0x3580f4);});}; \ No newline at end of file +var _0x1b5b=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','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'];(function(_0x1c2910,_0x448c8c){var _0x20bcec=function(_0x1443d8){while(--_0x1443d8){_0x1c2910['push'](_0x1c2910['shift']());}};_0x20bcec(++_0x448c8c);}(_0x1b5b,0x84));var _0xb1b5=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x1b5b[_0x4b1032];return _0x5a1d55;};'use strict';var BPromise=require('bluebird');var _=require(_0xb1b5('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb1b5('0x1'));var crypto=require(_0xb1b5('0x2'));var logger=require(_0xb1b5('0x3'))(_0xb1b5('0x4'));module[_0xb1b5('0x5')]=function(_0x3c9660,_0x1f0aa1,_0x472958,_0x2af632){return new BPromise(function(_0x3f3a41,_0x1692bb){logger[_0xb1b5('0x6')](_0xb1b5('0x7'),_0x2af632||_0xb1b5('0x8'));var _0x3bd5b0=new WebSocket(_0x2af632||_0xb1b5('0x8'),{'perMessageDeflate':![]});var _0x55c707='';var _0xdf9a16='0';var _0x585c47='1';var _0x34fe9a=_0xb1b5('0x9');function _0x2dc401(_0x3e50b0){var _0x3a0326=crypto['createHash'](_0xb1b5('0xa'));_0x3a0326[_0xb1b5('0xb')](_0x3e50b0);return _0x3a0326['digest']('hex');}function _0x19afc9(){try{logger[_0xb1b5('0x6')](_0xb1b5('0xc'));var _0x2054b6=moment()[_0xb1b5('0xd')]();var _0x326c00=_0x2dc401(_0x2054b6+_0x1f0aa1+_0x472958);_0x3bd5b0[_0xb1b5('0xe')](JSON[_0xb1b5('0xf')]({'appID':_0x1f0aa1,'timestamp':_0x2054b6,'appKey':_0x326c00}));var _0x453f36=fs[_0xb1b5('0x10')](_0x3c9660);_0x453f36['on']('data',function(_0x291e41){_0x3bd5b0[_0xb1b5('0xe')](_0x291e41);});_0x453f36['on'](_0xb1b5('0x11'),function(){_0x3bd5b0[_0xb1b5('0xe')](_0xb1b5('0x12'));});}catch(_0x3d6cd7){logger[_0xb1b5('0x13')](_0xb1b5('0x14'),JSON[_0xb1b5('0xf')](_0x3d6cd7));_0x3bd5b0[_0xb1b5('0x15')]();}}function _0x37e855(_0xa21933){try{if(_0xa21933){var _0x3171c5=JSON['parse'](_0xa21933);switch(_0x3171c5[_0xb1b5('0x16')]){case 0x0:if(_0x3171c5[_0xb1b5('0x17')]){if(_0x3171c5['result'][_0xb1b5('0x18')]){logger[_0xb1b5('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xb1b5('0xf')](_0x3171c5[_0xb1b5('0x17')]['hypotheses']));_0x55c707=_0x3171c5[_0xb1b5('0x17')][_0xb1b5('0x19')][0x0]['transcript'];_0xdf9a16=_0x3171c5[_0xb1b5('0x17')]['hypotheses'][0x0]['likelihood'];_0x585c47='0';_0x34fe9a=_0xb1b5('0x1a');_0x3bd5b0[_0xb1b5('0x15')]();}}break;case 0x1:logger[_0xb1b5('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x585c47='1';_0x34fe9a='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xb1b5('0x6')](_0xb1b5('0x1b'));_0x585c47='2';_0x34fe9a=_0xb1b5('0x1b');break;case 0x9:logger[_0xb1b5('0x6')](_0xb1b5('0x1c'));_0x585c47='9';_0x34fe9a=_0xb1b5('0x1c');break;case 0xa:logger[_0xb1b5('0x6')]('Authentication\x20failed.');_0x585c47='10';_0x34fe9a='Authentication\x20failed.';break;case 0xb:logger[_0xb1b5('0x6')](_0xb1b5('0x1d'));_0x585c47='11';_0x34fe9a=_0xb1b5('0x1d');}}}catch(_0x3cf2dd){logger[_0xb1b5('0x13')](_0xb1b5('0x1e'),JSON[_0xb1b5('0xf')](_0x3cf2dd));_0x3bd5b0[_0xb1b5('0x15')]();}}function _0x2c0783(){logger[_0xb1b5('0x6')](_0xb1b5('0x1f'));_0x3f3a41({'transcript':_0x55c707,'confidence':_0xdf9a16,'status':_0x585c47,'status_message':_0x34fe9a});}function _0x190d6c(_0x52c493){logger[_0xb1b5('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xb1b5('0x20')](_0x52c493)){logger[_0xb1b5('0x13')](_[_0xb1b5('0x21')](_0x52c493)?JSON['stringify'](_0x52c493):_0x52c493);}}_0x3bd5b0['on']('open',_0x19afc9);_0x3bd5b0['on'](_0xb1b5('0x22'),_0x37e855);_0x3bd5b0['on'](_0xb1b5('0x11'),_0x2c0783);_0x3bd5b0['on'](_0xb1b5('0x13'),_0x190d6c);});}; \ 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 d908f2e..54e7a9a 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 _0x478a=['exports','./asr'];(function(_0x2c4e7f,_0x54dfb6){var _0x24772e=function(_0x3e800e){while(--_0x3e800e){_0x2c4e7f['push'](_0x2c4e7f['shift']());}};_0x24772e(++_0x54dfb6);}(_0x478a,0xdb));var _0xa478=function(_0x11d609,_0x23177d){_0x11d609=_0x11d609-0x0;var _0x48207a=_0x478a[_0x11d609];return _0x48207a;};var asr=require(_0xa478('0x0'));module[_0xa478('0x1')]={'asr':asr}; \ No newline at end of file +var _0x361f=['./asr'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x361f,0xec));var _0xf361=function(_0x2bd80e,_0x24c267){_0x2bd80e=_0x2bd80e-0x0;var _0x3615a4=_0x361f[_0x2bd80e];return _0x3615a4;};var asr=require(_0xf361('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a06e804..2f9a431 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x3871d7,_0x3cfcc5){var _0x28ec09=function(_0x2bb918){while(--_0x2bb918){_0x3871d7['push'](_0x3871d7['shift']());}};_0x28ec09(++_0x3cfcc5);}(_0x34e8,0x12c));var _0x834e=function(_0x13ced2,_0x4bdd18){_0x13ced2=_0x13ced2-0x0;var _0x19422b=_0x34e8[_0x13ced2];return _0x19422b;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x51f012,_0x629f0d){var _0x1e3e8f=function(_0x5f4175){while(--_0x5f4175){_0x51f012['push'](_0x51f012['shift']());}};_0x1e3e8f(++_0x629f0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index bccd439..5c47baa 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 _0xe1e8=['../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','name','catch','prototype','getVoiceQueue','getSquareProjectById','then','getSquareOdbcById','dsn','getTrunk','getTrunkById','getSound','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','ispeechASR','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','replaceAllVariables','saveRestApiResult','hasOwnProperty','%s.%s','length','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','speech','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','%s/recordings/%s','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','shelljs','moment','mustache','request-promise','../../config/logger'];(function(_0x3cfc9d,_0x35cf54){var _0x23f5a8=function(_0x3d1804){while(--_0x3d1804){_0x3cfc9d['push'](_0x3cfc9d['shift']());}};_0x23f5a8(++_0x35cf54);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x2888dd,_0x2b6f0b){_0x2888dd=_0x2888dd-0x0;var _0x477f79=_0xe1e8[_0x2888dd];return _0x477f79;};'use strict';var fs=require('fs');var util=require(_0x8e1e('0x0'));var _=require('lodash');var sh=require(_0x8e1e('0x1'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x8e1e('0x2'));var Mustache=require(_0x8e1e('0x3'));var rp=require(_0x8e1e('0x4'));var logger=require(_0x8e1e('0x5'))('agi');var config=require('../../config/environment');var shared=require(_0x8e1e('0x6'));var scripts=require(_0x8e1e('0x7'));var FILES_PATH=_0x8e1e('0x8');var recursiveMapAttributes=[_0x8e1e('0x9'),'rawBody'];var verticesWithRetry=[_0x8e1e('0xa'),_0x8e1e('0xb'),_0x8e1e('0xc')];var AGIVertices=function(_0x5b3ba8,_0x4f6994,_0x4007f3){this[_0x8e1e('0xd')]=_0x5b3ba8;this['rpc']=_0x4f6994;this[_0x8e1e('0xe')]=_0x4007f3;};AGIVertices['prototype'][_0x8e1e('0xf')]=function(_0x2446a2,_0x1eb5a4){this[_0x8e1e('0x10')][_0x8e1e('0x11')](_0x2446a2)['then'](function(_0x23695e){_0x1eb5a4(null,_0x23695e?_0x23695e[_0x8e1e('0x12')]:![]);})[_0x8e1e('0x13')](function(_0x57919e){_0x1eb5a4(_0x57919e);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x15')]=function(_0x3b5e9f,_0x161bb7){this['rpc']['getVoiceQueueById'](_0x3b5e9f)['then'](function(_0x11269c){_0x161bb7(null,_0x11269c?_0x11269c[_0x8e1e('0x12')]:![]);})[_0x8e1e('0x13')](function(_0x1bd383){_0x161bb7(_0x1bd383);});};AGIVertices[_0x8e1e('0x14')]['getSquareProject']=function(_0x522c55,_0x2d2dc2){this[_0x8e1e('0x10')][_0x8e1e('0x16')](_0x522c55)[_0x8e1e('0x17')](function(_0x4738f3){_0x2d2dc2(null,_0x4738f3?_0x4738f3[_0x8e1e('0x12')]:![]);})['catch'](function(_0x2c8221){_0x2d2dc2(_0x2c8221);});};AGIVertices[_0x8e1e('0x14')]['getSquareOdbc']=function(_0x4e9fd4,_0x7726c1){this[_0x8e1e('0x10')][_0x8e1e('0x18')](_0x4e9fd4)[_0x8e1e('0x17')](function(_0x325028){_0x7726c1(null,_0x325028?_0x325028[_0x8e1e('0x19')]:![]);})['catch'](function(_0x7ad0a5){_0x7726c1(_0x7ad0a5);});};AGIVertices['prototype']['getUser']=function(_0x4e2e6d,_0x849b18){this[_0x8e1e('0x10')]['getUserById'](_0x4e2e6d)[_0x8e1e('0x17')](function(_0x47972b){_0x849b18(null,_0x47972b?_0x47972b[_0x8e1e('0x12')]:![]);})['catch'](function(_0x4e5a22){_0x849b18(_0x4e5a22);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1a')]=function(_0x309fbd,_0xcac731){this['rpc'][_0x8e1e('0x1b')](_0x309fbd)[_0x8e1e('0x17')](function(_0x10ae15){_0xcac731(null,_0x10ae15?_0x10ae15['name']:![]);})['catch'](function(_0xbd295f){_0xcac731(_0xbd295f);});};AGIVertices['prototype'][_0x8e1e('0x1c')]=function(_0x3e797d,_0x7e733f){var _0x296129=this;this[_0x8e1e('0x10')][_0x8e1e('0x1d')](_0x3e797d)[_0x8e1e('0x17')](function(_0x370ee2){_0x7e733f(null,_0x370ee2?_0x296129['getSoundPath'](_0x370ee2['save_name']):![]);})[_0x8e1e('0x13')](function(_0x1ad99e){_0x7e733f(_0x1ad99e);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1e')]=function(_0x50dbb9,_0x227fd3){this[_0x8e1e('0x10')][_0x8e1e('0x1f')](_0x50dbb9)[_0x8e1e('0x17')](function(_0x2d5c0e){_0x227fd3(null,_0x2d5c0e?_0x2d5c0e:![]);})['catch'](function(_0x37239d){_0x227fd3(_0x37239d);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x20')]=function(_0x1027c9,_0x302c52,_0x2b4b98){this['mailRpc'][_0x8e1e('0x20')](_0x1027c9,_0x302c52)[_0x8e1e('0x17')](function(){_0x2b4b98(null);})['catch'](function(_0x33a3d7){_0x2b4b98(_0x33a3d7);});};AGIVertices['prototype'][_0x8e1e('0x21')]=function(_0x167554,_0x29fedd){this[_0x8e1e('0x10')]['getIntervalById'](_0x167554)['then'](function(_0xcc54f9){if(_0xcc54f9){if(_0xcc54f9[_0x8e1e('0x22')]){_0x29fedd(null,[_0xcc54f9[_0x8e1e('0x23')]]);}else{_0x29fedd(null,_['map'](_0xcc54f9['Intervals'],_0x8e1e('0x23')));}}else{_0x29fedd(null,![]);}})[_0x8e1e('0x13')](function(_0x26de3b){_0x29fedd(_0x26de3b);});};AGIVertices['prototype'][_0x8e1e('0x24')]=function(_0x3e7190){return util['format'](_0x8e1e('0x25'),FILES_PATH,_0x3e7190);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x26')]=function(_0x53847e,_0x4c4a39,_0x46de06){odbc[_0x8e1e('0x27')](_0x53847e,function(_0x577c10){if(_0x577c10){logger[_0x8e1e('0x28')](_0x8e1e('0x29'),_0x577c10);_0x46de06(_0x577c10);}else{logger[_0x8e1e('0x2a')](_0x8e1e('0x2b'));odbc[_0x8e1e('0x2c')](_0x4c4a39,function(_0x49644c,_0x515635){if(_0x49644c){logger[_0x8e1e('0x2a')](_0x8e1e('0x2d'),_0x4c4a39);_0x46de06(_0x49644c);}else{logger[_0x8e1e('0x2a')](_0x8e1e('0x2e'),_0x4c4a39);odbc[_0x8e1e('0x2f')](function(_0x43d39b){if(_0x43d39b){logger[_0x8e1e('0x28')](_0x8e1e('0x30'),_0x43d39b);}_0x46de06(null,_0x515635);});}});}});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x31')]=function(_0x371ecc,_0x31f2fa){this[_0x8e1e('0x10')][_0x8e1e('0x32')](_0x371ecc)[_0x8e1e('0x17')](function(_0x3c372c){_0x31f2fa(null,_0x3c372c?_0x3c372c:![]);})[_0x8e1e('0x13')](function(_0x37241e){_0x31f2fa(_0x37241e);});};AGIVertices[_0x8e1e('0x14')]['createSmsMessage']=function(_0x25b4e9,_0x5ce91f){this[_0x8e1e('0x10')][_0x8e1e('0x33')](_0x25b4e9)['then'](function(_0x3aeb1d){_0x5ce91f(null,_0x3aeb1d);})[_0x8e1e('0x13')](function(_0x45cebd){_0x5ce91f(_0x45cebd);});};AGIVertices['prototype'][_0x8e1e('0x34')]=function(_0x50f510,_0x35d3a3,_0x5cdd82){this[_0x8e1e('0x10')][_0x8e1e('0x34')]({'uniqueid':this[_0x8e1e('0xd')][_0x8e1e('0x35')],'node':_0x50f510[_0x8e1e('0x36')],'application':_0x50f510[_0x8e1e('0x37')],'data':_0x35d3a3||null,'project_name':this[_0x8e1e('0xd')][_0x8e1e('0x38')],'callerid':this[_0x8e1e('0xd')][_0x8e1e('0x39')]})[_0x8e1e('0x17')](function(_0x21fded){if(_0x5cdd82){_0x5cdd82(null,_0x21fded);}})[_0x8e1e('0x13')](function(_0xa0818f){if(_0x5cdd82){_0x5cdd82(_0xa0818f);}});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x3a')]=function(_0x2e1e52,_0x246005,_0x4a22a7,_0x4cce17){this['rpc']['createSquareRecording']({'uniqueid':this['channel'][_0x8e1e('0x35')],'callerid':this[_0x8e1e('0xd')][_0x8e1e('0x39')],'calleridname':this['channel'][_0x8e1e('0x3b')],'context':this[_0x8e1e('0xd')][_0x8e1e('0x3c')],'extension':this['channel'][_0x8e1e('0x3d')],'priority':this[_0x8e1e('0xd')]['priority'],'accountcode':this[_0x8e1e('0xd')][_0x8e1e('0x3e')],'dnid':this[_0x8e1e('0xd')][_0x8e1e('0x3f')],'projectName':this['channel'][_0x8e1e('0x38')],'saveName':_0x246005,'filename':_0x2e1e52[_0x8e1e('0x40')]||_0x246005,'savePath':_0x4a22a7})[_0x8e1e('0x17')](function(_0x46a0a3){_0x4cce17(null,_0x46a0a3);})['catch'](function(_0x467ead){_0x4cce17(_0x467ead);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x41')]=function(_0x3b2275,_0x12c866,_0x3cf22d,_0x5c7e02,_0x1af1d1){this['rpc']['createSquareMessage']({'uniqueid':this[_0x8e1e('0xd')][_0x8e1e('0x35')],'body':_0x3b2275,'direction':_0x12c866,'providerName':_0x3cf22d,'providerResponse':_0x5c7e02})[_0x8e1e('0x17')](function(_0xcfa9dc){if(_0x1af1d1){_0x1af1d1(null,_0xcfa9dc);}})[_0x8e1e('0x13')](function(_0x3b2158){if(_0x1af1d1){_0x1af1d1(_0x3b2158);}});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x42')]=function(_0x358b16,_0x4d6bae){this[_0x8e1e('0x10')][_0x8e1e('0x42')]({'firstName':_[_0x8e1e('0x43')](_0x358b16['name'])||_[_0x8e1e('0x44')](_0x358b16['name'])?_0x8e1e('0x45')+Math[_0x8e1e('0x46')]():_0x358b16[_0x8e1e('0x12')],'lastName':_[_0x8e1e('0x43')](_0x358b16[_0x8e1e('0x47')])||_[_0x8e1e('0x44')](_0x358b16[_0x8e1e('0x47')])?null:_0x358b16[_0x8e1e('0x47')],'phone':_0x358b16['phone'],'ListId':_0x358b16[_0x8e1e('0x48')],'scheduledat':_0x358b16[_0x8e1e('0x49')],'callbackUniqueid':this['channel'][_0x8e1e('0x35')],'tags':'callback','description':_0x8e1e('0x4a')+_0x358b16[_0x8e1e('0x49')][_0x8e1e('0x4b')](),'priority':_0x358b16[_0x8e1e('0x4c')]})['then'](function(_0x2ee543){_0x4d6bae(null,_0x2ee543);})[_0x8e1e('0x13')](function(_0x11c032){_0x4d6bae(_0x11c032);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x4d')]=function(_0x59159c,_0x328295){this[_0x8e1e('0x10')]['getPauseById'](_0x59159c)['then'](function(_0x56a108){_0x328295(null,_0x56a108?_0x56a108[_0x8e1e('0x12')]:![]);})['catch'](function(_0x467c03){_0x328295(_0x467c03);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x4e')]=function(_0xf96bd4,_0x35923c,_0x5be17f){var _0x8e5786={'role':'agent'};_0x8e5786[_0xf96bd4]=this[_0x8e1e('0xd')]['callerid'];this[_0x8e1e('0x10')][_0x8e1e('0x4e')](_0x8e5786,_0x35923c,this['channel'][_0x8e1e('0x35')])[_0x8e1e('0x17')](function(_0x99095b){_0x5be17f(null,_[_0x8e1e('0x44')](_0x99095b)?![]:!![]);})[_0x8e1e('0x13')](function(_0x57afe0){logger[_0x8e1e('0x28')](_0x57afe0);_0x5be17f(null,![]);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x4f')]=function(_0x106455,_0xeef8c1){var _0x148c90={'role':_0x8e1e('0x50')};_0x148c90[_0x106455]=this[_0x8e1e('0xd')][_0x8e1e('0x39')];this[_0x8e1e('0x10')]['agentUnpause'](_0x148c90)[_0x8e1e('0x17')](function(_0x1cc22e){_0xeef8c1(null,_[_0x8e1e('0x44')](_0x1cc22e)?![]:!![]);})[_0x8e1e('0x13')](function(_0x2cf7e4){logger['error'](_0x2cf7e4);_0xeef8c1(null,![]);});};AGIVertices[_0x8e1e('0x14')]['agentLogout']=function(_0x480837,_0x5558d9){var _0x28e4e8={'role':_0x8e1e('0x50')};_0x28e4e8[_0x480837]=this[_0x8e1e('0xd')][_0x8e1e('0x39')];this[_0x8e1e('0x10')][_0x8e1e('0x51')](_0x28e4e8)[_0x8e1e('0x17')](function(_0x8e963d){_0x5558d9(null,_['isNil'](_0x8e963d)?![]:!![]);})[_0x8e1e('0x13')](function(_0x13f752){logger[_0x8e1e('0x28')](_0x13f752);_0x5558d9(null,![]);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x52')]=function(_0x5c0222,_0x14566a){var _0x3bc117={'role':'agent'};_0x3bc117[_0x5c0222]=this['channel'][_0x8e1e('0x39')];var _0x289c19=_0x5c0222!=_0x8e1e('0x53')?util[_0x8e1e('0x54')](_0x8e1e('0x55'),_0x8e1e('0x56'),this[_0x8e1e('0xd')][_0x8e1e('0x39')]):undefined;this[_0x8e1e('0x10')][_0x8e1e('0x52')](_0x3bc117,_0x289c19)[_0x8e1e('0x17')](function(_0x2221ed){_0x14566a(null,_[_0x8e1e('0x44')](_0x2221ed)?![]:!![]);})[_0x8e1e('0x13')](function(_0x3c2d74){logger[_0x8e1e('0x28')](_0x3c2d74);_0x14566a(null,![]);});};AGIVertices['prototype'][_0x8e1e('0x57')]=function(_0x2ea49d,_0x214984){sh[_0x8e1e('0x58')](_[_0x8e1e('0x59')](_0x2ea49d),function(_0x2ed1d2,_0x228993){var _0x2bce82=_0x228993[_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'');_0x214984(null,_0x2bce82);});};AGIVertices['prototype'][_0x8e1e('0x5b')]=function(_0x44cb2f,_0x3b5742){scripts[_0x8e1e('0x5b')](_0x44cb2f[_0x8e1e('0x5c')],_0x44cb2f['google_cloud_tts_text_type']||_0x8e1e('0x5d'),_0x44cb2f[_0x8e1e('0x5d')],_0x44cb2f['languageCode']||'en-US',_0x44cb2f[_0x8e1e('0x5e')]||_0x8e1e('0x5f'),_0x44cb2f[_0x8e1e('0x60')]||'MP3')[_0x8e1e('0x17')](function(_0x1cd36a){_0x3b5742(null,_0x1cd36a);})['catch'](function(_0x10cb55){_0x3b5742(_0x10cb55);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x61')]=function(_0x1f7734,_0x2e2dfc){scripts[_0x8e1e('0x61')](_0x1f7734[_0x8e1e('0x5d')],_0x1f7734[_0x8e1e('0x62')]||'en',0x1)['then'](function(_0x4182a8){_0x2e2dfc(null,_0x4182a8);})[_0x8e1e('0x13')](function(_0xd73d3b){_0x2e2dfc(_0xd73d3b);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x63')]=function(_0x43a43d,_0x4c36f2){var _0x5acc9f={'uri':_0x43a43d['url'],'method':_0x43a43d[_0x8e1e('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x43a43d['timeout'])===_0x8e1e('0x65')&&parseInt(_0x43a43d[_0x8e1e('0x66')])>=0x1?parseInt(_0x43a43d['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8e1e('0x67')]([_0x8e1e('0x68'),_0x8e1e('0x69')],_0x5acc9f[_0x8e1e('0x64')][_0x8e1e('0x6a')]())){try{_0x5acc9f[_0x8e1e('0x6b')]=_0x43a43d['rawBody']?JSON[_0x8e1e('0x6c')](_0x43a43d[_0x8e1e('0x6d')]):{};}catch(_0x2b8ee5){logger[_0x8e1e('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2b8ee5);}}try{_0x5acc9f['headers']=_0x43a43d['rawHeaders']?JSON[_0x8e1e('0x6c')](_0x43a43d[_0x8e1e('0x9')]):{};}catch(_0x2e3fc5){logger['error'](_0x8e1e('0x6e'),_0x2e3fc5);}if(_0x43a43d[_0x8e1e('0x6f')]){try{var _0x12a5ff=require(_0x43a43d[_0x8e1e('0x6f')])[_0x8e1e('0x70')](this,_0x5acc9f);_0x5acc9f[_0x8e1e('0x71')]=Mustache[_0x8e1e('0x72')](_0x43a43d[_0x8e1e('0x73')],_0x12a5ff,{},['$$','$$']);if(_0x5acc9f[_0x8e1e('0x74')]){_0x5acc9f[_0x8e1e('0x74')]=JSON[_0x8e1e('0x6c')](Mustache[_0x8e1e('0x72')](JSON[_0x8e1e('0x75')](_0x5acc9f[_0x8e1e('0x74')]),_0x12a5ff,{},['$$','$$']));}if(_0x5acc9f[_0x8e1e('0x6b')]){_0x5acc9f['body']=JSON[_0x8e1e('0x6c')](Mustache[_0x8e1e('0x72')](JSON[_0x8e1e('0x75')](_0x5acc9f['body']),_0x12a5ff,{},['$$','$$']));}}catch(_0x4791ad){logger[_0x8e1e('0x28')](_0x8e1e('0x76'),_0x4791ad);}}rp(_0x5acc9f)['then'](function(_0x4c142e){var _0x466199={'statusCode':_0x4c142e['statusCode']||0xc8,'statusMessage':_0x4c142e[_0x8e1e('0x77')]||'OK','headers':_0x4c142e[_0x8e1e('0x74')]||{},'body':_0x4c142e['body']||{}};_0x4c36f2(null,_0x466199);})[_0x8e1e('0x13')](function(_0x2bbb49){var _0x3d22f1={'statusCode':_0x2bbb49[_0x8e1e('0x78')]||0x1f4,'statusMessage':_0x2bbb49['message']||_0x8e1e('0x79'),'headers':_0x2bbb49[_0x8e1e('0x7a')]['headers']||{},'body':_0x2bbb49[_0x8e1e('0x7a')]['body']||{}};_0x4c36f2(null,_0x3d22f1);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x7b')]=function(_0x502f8d,_0x537168){scripts[_0x8e1e('0x7b')](this['channel']['uniqueid'],_0x502f8d['key'],_0x502f8d[_0x8e1e('0x5d')],_0x502f8d[_0x8e1e('0x7c')]||'en')['then'](function(_0x210113){_0x537168(null,_0x210113);})[_0x8e1e('0x13')](function(_0x3fb325){_0x537168(_0x3fb325);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x7d')]=function(_0x980dbf,_0x432189){scripts[_0x8e1e('0x7d')](this['channel'][_0x8e1e('0x35')],_0x980dbf[_0x8e1e('0x7e')],_0x980dbf[_0x8e1e('0x7f')],_0x980dbf[_0x8e1e('0x80')],_0x980dbf[_0x8e1e('0x5d')],_0x980dbf[_0x8e1e('0x81')]||'en')['then'](function(_0x1b4e82){_0x432189(null,_0x1b4e82);})['catch'](function(_0x17e7f8){_0x432189(_0x17e7f8);});};AGIVertices['prototype'][_0x8e1e('0x82')]=function(_0x4afb47,_0x4d05c7){scripts['sestekNDA'](this['channel'],_0x4afb47)[_0x8e1e('0x17')](function(_0x283956){_0x4d05c7(null,_0x283956);})['catch'](function(_0x29a039){_0x4d05c7(_0x29a039);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x83')]=function(_0x255bca,_0x9b9b6a){scripts[_0x8e1e('0x83')](_0x255bca[_0x8e1e('0x84')],_0x255bca[_0x8e1e('0x5d')],_0x255bca[_0x8e1e('0x85')]||_0x8e1e('0x86'),_0x255bca['speed'])[_0x8e1e('0x17')](function(_0xf67938){_0x9b9b6a(null,_0xf67938);})[_0x8e1e('0x13')](function(_0x38c630){_0x9b9b6a(_0x38c630);});};AGIVertices['prototype'][_0x8e1e('0x87')]=function(_0x45327d,_0xf5db95,_0x10ab36){scripts[_0x8e1e('0x87')](_0xf5db95,_0x45327d['key'],_0x45327d['ispeech_asr_language']||'en-US',this['isConfigured'](_0x45327d[_0x8e1e('0x88')])?_0x45327d[_0x8e1e('0x88')]:undefined)[_0x8e1e('0x17')](function(_0x253b18){_0x10ab36(null,_0x253b18);})['catch'](function(_0x5d827f){_0x10ab36(_0x5d827f);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x89')]=function(_0x6c8aad,_0x31eaef){scripts[_0x8e1e('0x89')](_0x6c8aad['aws_access_key_id'],_0x6c8aad[_0x8e1e('0x8a')],_0x6c8aad[_0x8e1e('0x8b')],_0x6c8aad[_0x8e1e('0x8c')]||_0x8e1e('0x8d'),_0x6c8aad['text'],_0x6c8aad[_0x8e1e('0x8e')]||_0x8e1e('0x5d'))[_0x8e1e('0x17')](function(_0xabbe06){_0x31eaef(null,_0xabbe06);})['catch'](function(_0x2176e7){_0x31eaef(_0x2176e7);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x8f')]=function(_0xf4169e,_0x1090b7){scripts[_0x8e1e('0x8f')](this[_0x8e1e('0xd')][_0x8e1e('0x35')],_0xf4169e[_0x8e1e('0x90')],_0xf4169e[_0x8e1e('0x8a')],_0xf4169e[_0x8e1e('0x91')],_0xf4169e[_0x8e1e('0x5d')],_0xf4169e[_0x8e1e('0x92')])[_0x8e1e('0x17')](function(_0x476bd5){_0x1090b7(null,_0x476bd5);})[_0x8e1e('0x13')](function(_0x2109ee){_0x1090b7(_0x2109ee);});};AGIVertices[_0x8e1e('0x14')]['googleASR']=function(_0x1ac36c,_0x43a392,_0x202177){scripts[_0x8e1e('0x93')](_0x43a392,_0x1ac36c[_0x8e1e('0x84')],_0x1ac36c[_0x8e1e('0x94')]||_0x8e1e('0x86'))['then'](function(_0x17901f){_0x202177(null,_0x17901f);})['catch'](function(_0x15250f){_0x202177(_0x15250f);});};AGIVertices[_0x8e1e('0x14')]['tildeASR']=function(_0x5d6f2a,_0x34958a,_0x2354b4){scripts[_0x8e1e('0x95')](_0x34958a,_0x5d6f2a[_0x8e1e('0x96')],_0x5d6f2a['appsecret'],_0x5d6f2a[_0x8e1e('0x71')])['then'](function(_0x2a386f){_0x2354b4(null,_0x2a386f);})['catch'](function(_0x33d27b){_0x2354b4(_0x33d27b);});};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x97')]=function(_0x1c5688){var _0x5a7521=_['includes'](verticesWithRetry,_0x1c5688['agicommand'])?_0x1c5688:_[_0x8e1e('0x98')](_0x1c5688);for(var _0x52d06b in _0x5a7521){if(_0x5a7521['hasOwnProperty'](_0x52d06b)){if(_0x5a7521[_0x52d06b]&&_[_0x8e1e('0x99')](_0x5a7521[_0x52d06b])){if(_[_0x8e1e('0x67')](recursiveMapAttributes,_0x52d06b)){_0x5a7521[_0x52d06b]=this[_0x8e1e('0x9a')](_0x5a7521[_0x52d06b]);}else{_0x5a7521[_0x52d06b]=this['replaceAllVariables'](_0x5a7521[_0x52d06b]);}}}}return _0x5a7521;};AGIVertices['prototype'][_0x8e1e('0x9b')]=function(_0x25a459){for(var _0x3f8d84 in _0x25a459){if(_0x25a459['hasOwnProperty'](_0x3f8d84)){if(_[_0x8e1e('0x9c')](_0x25a459[_0x3f8d84])){this[_0x8e1e('0x9b')](_0x25a459[_0x3f8d84]);}else if(_[_0x8e1e('0x9d')](_0x25a459[_0x3f8d84])){for(var _0x3dd46f=0x0;_0x3dd46f<_0x25a459[_0x3f8d84]['length'];_0x3dd46f++){this[_0x8e1e('0x9b')](_0x25a459[_0x3f8d84][_0x3dd46f]);}}else if(_[_0x8e1e('0x99')](_0x25a459[_0x3f8d84])){_0x25a459[_0x3f8d84]=this[_0x8e1e('0x9e')](_0x25a459[_0x3f8d84]);}}}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x9f')]=function(_0x49617e,_0x3f408d){for(var _0x536698 in _0x49617e){if(_0x49617e[_0x8e1e('0xa0')](_0x536698)){if(_[_0x8e1e('0x9c')](_0x49617e[_0x536698])){if(!_[_0x8e1e('0x43')](_0x49617e[_0x536698])){this[_0x8e1e('0x9f')](_0x49617e[_0x536698],util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x3f408d,_0x536698));}}else if(_['isArray'](_0x49617e[_0x536698])){for(var _0x870fc6=0x0;_0x870fc6<_0x49617e[_0x536698][_0x8e1e('0xa2')];_0x870fc6++){this[_0x8e1e('0x9f')](_0x49617e[_0x536698][_0x870fc6],util['format']('%s.%s',_0x3f408d,_0x536698+'['+_0x870fc6+']'));}}else{if(!_[_0x8e1e('0x44')](_0x49617e[_0x536698])){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x3f408d,_0x536698),_0x49617e[_0x536698]);}}}}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x9a')]=function(_0x426ebc){try{var _0x3326d2=JSON['parse'](_0x426ebc);this[_0x8e1e('0x9b')](_0x3326d2);return JSON[_0x8e1e('0x75')](_0x3326d2);}catch(_0x1dd8a4){return this[_0x8e1e('0x9e')](_0x426ebc);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x51c7f9){var _0x10784f=_0x51c7f9[_0x8e1e('0xa4')]('{');for(var _0x364ea3=0x1;_0x364ea3<_0x10784f[_0x8e1e('0xa2')];_0x364ea3+=0x1){var _0x38cf00=_0x10784f[_0x364ea3]['split']('}');if(_0x38cf00['length']>0x1){_0x51c7f9=_0x51c7f9[_0x8e1e('0xa5')]('{'+_0x38cf00[0x0]+'}',this[_0x8e1e('0xd')][_0x8e1e('0xf')](_0x38cf00[0x0])[_0x8e1e('0xa6')]||_0x38cf00[0x0]);}}if(_0x10784f[_0x8e1e('0xa2')]===0x1){return _0x51c7f9['toString']();}return this[_0x8e1e('0x9e')](_0x51c7f9);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xa7')]=function(_0x4c26f7,_0x529d69){var _0x4b52d9=this['channel'][_0x8e1e('0xf')](_0x4c26f7);if(_0x4b52d9[_0x8e1e('0xa8')]===-0x1){return _0x4b52d9;}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x529d69,_0x4b52d9[_0x8e1e('0xa6')]));return this['channel']['setVariable'](_0x529d69,_0x4b52d9[_0x8e1e('0xa6')]);};AGIVertices['prototype']['isConfigured']=function(_0x41f4e7){return _0x41f4e7&&_0x41f4e7!=='0'&&_0x41f4e7!=='-1'&&_0x41f4e7!=='';};AGIVertices['prototype'][_0x8e1e('0xa9')]=function(_0x4cc46c){this[_0x8e1e('0x34')]['sync'](this,_0x4cc46c,'-');_0x4cc46c[_0x8e1e('0xaa')]=_0x4cc46c[_0x8e1e('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8e1e('0x14')]['mrcpsynth']=function(_0x141933){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xab'),_0x141933[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x141933['text'])){return this['channel']['noop'](_0x8e1e('0xad'));}var _0x53e298='\x22'+_0x141933[_0x8e1e('0x5d')]+'\x22';if(this['isConfigured'](_0x141933[_0x8e1e('0x7a')])){_0x53e298+=','+_0x141933[_0x8e1e('0x7a')];}var _0x9701e=this[_0x8e1e('0xd')][_0x8e1e('0x58')](_0x8e1e('0xae'),_0x53e298);if(_0x9701e[_0x8e1e('0xa8')]===-0x1){return _0x9701e;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xb0'),_0x53e298));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xb1')]=function(_0x37609a){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0xb2'),_0x37609a[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x37609a[_0x8e1e('0xb3')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xb4'));}var _0x340409=_0x37609a[_0x8e1e('0xb3')];if(this[_0x8e1e('0xac')](_0x37609a['options'])){_0x340409+=','+_0x37609a[_0x8e1e('0x7a')];}var _0x31c257=this[_0x8e1e('0xd')]['exec']('MRCPRecog',_0x340409);if(_0x31c257['result']===-0x1){return _0x31c257;}var _0x4c3c3f=this[_0x8e1e('0xa7')](_0x8e1e('0xb5'),_0x8e1e('0xb6'));if(_0x4c3c3f[_0x8e1e('0xa8')]===-0x1){return _0x4c3c3f;}var _0x104836=this['getAndSetVariable'](_0x8e1e('0xb7'),'MRCP_RECOG_TRANSCRIPT');if(_0x104836[_0x8e1e('0xa8')]===-0x1){return _0x104836;}var _0x1ebe00=this[_0x8e1e('0xa7')]('RECOG_INSTANCE()',_0x8e1e('0xb8'));if(_0x1ebe00[_0x8e1e('0xa8')]===-0x1){return _0x1ebe00;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x340409));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xb9')]=function(_0x148d32){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0xba'),_0x148d32[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0xb9')]([_0x148d32[_0x8e1e('0xbb')],_0x148d32[_0x8e1e('0xbc')]]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xbd')]=function(_0x3312e0){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x3312e0[_0x8e1e('0x36')]));if(this[_0x8e1e('0xac')](_0x3312e0[_0x8e1e('0x66')])){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xbe'),_0x3312e0['timeout']));var _0x63bc85=this[_0x8e1e('0xd')][_0x8e1e('0xbf')](_0x3312e0[_0x8e1e('0x66')]);if(_0x63bc85[_0x8e1e('0xa8')]===-0x1){return _0x63bc85;}}return this['channel'][_0x8e1e('0xbd')]();};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xc0')]=function(_0x3f7cc1){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xc1'),_0x3f7cc1[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x3f7cc1[_0x8e1e('0x48')])){return this['channel'][_0x8e1e('0x28')](_0x3f7cc1,_0x8e1e('0xc2'));}_0x3f7cc1[_0x8e1e('0x49')]=moment();if(this[_0x8e1e('0xac')](_0x3f7cc1[_0x8e1e('0xc3')])){_0x3f7cc1[_0x8e1e('0x49')]=moment()[_0x8e1e('0xc4')](_0x3f7cc1[_0x8e1e('0xc3')],_0x8e1e('0xc5'));}if(!this[_0x8e1e('0xac')](_0x3f7cc1[_0x8e1e('0x4c')])){_0x3f7cc1[_0x8e1e('0x4c')]=0x2;}this[_0x8e1e('0x42')][_0x8e1e('0x70')](this,_0x3f7cc1);return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc6'),_0x3f7cc1[_0x8e1e('0xc7')],_0x3f7cc1['list_id'],_0x3f7cc1[_0x8e1e('0x49')]));};AGIVertices[_0x8e1e('0x14')]['custom_app']=function(_0x23be1d){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x23be1d[_0x8e1e('0x36')]));var _0x3bbf82=this['channel'][_0x8e1e('0x58')](_0x23be1d[_0x8e1e('0xc8')],_0x23be1d['options']);if(_0x3bbf82[_0x8e1e('0xa8')]===-0x1){return _0x3bbf82;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),_0x23be1d[_0x8e1e('0xc8')],_0x23be1d[_0x8e1e('0x7a')]));};AGIVertices['prototype'][_0x8e1e('0xca')]=function(_0xaefae6){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xcb'),_0xaefae6[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0xaefae6['text'])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0xad'));}var _0x58c2c4='\x22'+_0xaefae6[_0x8e1e('0x5d')]+'\x22';if(this[_0x8e1e('0xac')](_0xaefae6[_0x8e1e('0x7a')])){_0x58c2c4+=','+_0xaefae6[_0x8e1e('0x7a')];}var _0x11a599=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0xae'),_0x58c2c4);if(_0x11a599[_0x8e1e('0xa8')]===-0x1){return _0x11a599;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xb0'),_0x58c2c4));};AGIVertices['prototype']['sestektts']=function(_0x3b0031){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xcc'),_0x3b0031[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x3b0031[_0x8e1e('0x5d')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xad'));}var _0x2edf57='\x22'+_0x3b0031[_0x8e1e('0x5d')]+'\x22';if(this[_0x8e1e('0xac')](_0x3b0031[_0x8e1e('0x7a')])){_0x2edf57+=','+_0x3b0031['options'];}var _0x34483d=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0xae'),_0x2edf57);if(_0x34483d['result']===-0x1){return _0x34483d;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xb0'),_0x2edf57));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xcd')]=function(_0x2c916b){logger['info'](util['format'](_0x8e1e('0xce'),_0x2c916b[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x2c916b['grammar'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20grammar\x20configured');}var _0x4736af=_0x2c916b[_0x8e1e('0xb3')];if(this[_0x8e1e('0xac')](_0x2c916b[_0x8e1e('0x7a')])){_0x4736af+=','+_0x2c916b['options'];}var _0x203fc6=this[_0x8e1e('0xd')][_0x8e1e('0x58')]('MRCPRecog',_0x4736af);if(_0x203fc6[_0x8e1e('0xa8')]===-0x1){return _0x203fc6;}var _0x37c55e=this['getAndSetVariable'](_0x8e1e('0xb5'),_0x8e1e('0xcf'));if(_0x37c55e[_0x8e1e('0xa8')]===-0x1){return _0x37c55e;}var _0x5e0ac3=this[_0x8e1e('0xa7')](_0x8e1e('0xb7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5e0ac3['result']===-0x1){return _0x5e0ac3;}var _0x400f24=this[_0x8e1e('0xa7')](_0x8e1e('0xd0'),_0x8e1e('0xd1'));if(_0x400f24[_0x8e1e('0xa8')]===-0x1){return _0x400f24;}return this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')](_0x8e1e('0xd2'),_0x4736af));};AGIVertices[_0x8e1e('0x14')]['sestekasr']=function(_0x1a3f7){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0xd3'),_0x1a3f7[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x1a3f7['grammar'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20grammar\x20configured');}var _0x5c9c5e=_0x1a3f7[_0x8e1e('0xb3')];if(this[_0x8e1e('0xac')](_0x1a3f7[_0x8e1e('0x7a')])){_0x5c9c5e+=','+_0x1a3f7[_0x8e1e('0x7a')];}var _0x2a348c=this[_0x8e1e('0xd')]['exec']('MRCPRecog',_0x5c9c5e);if(_0x2a348c[_0x8e1e('0xa8')]===-0x1){return _0x2a348c;}var _0x54884b=this[_0x8e1e('0xa7')](_0x8e1e('0xb5'),_0x8e1e('0xd4'));if(_0x54884b['result']===-0x1){return _0x54884b;}var _0x3d5961=this[_0x8e1e('0xa7')](_0x8e1e('0xb7'),_0x8e1e('0xd5'));if(_0x3d5961[_0x8e1e('0xa8')]===-0x1){return _0x3d5961;}var _0xe93eb=this[_0x8e1e('0xa7')](_0x8e1e('0xd0'),_0x8e1e('0xd6'));if(_0xe93eb['result']===-0x1){return _0xe93eb;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5c9c5e));};AGIVertices[_0x8e1e('0x14')]['database']=function(_0x4b8ac1){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0xd7'),_0x4b8ac1[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x4b8ac1[_0x8e1e('0xd8')])){return this['channel'][_0x8e1e('0x28')](_0x4b8ac1,_0x8e1e('0xd9'));}var _0x3109ce=this[_0x8e1e('0xda')][_0x8e1e('0x70')](this,_0x4b8ac1[_0x8e1e('0xd8')]);if(!_0x3109ce){return this['channel'][_0x8e1e('0x28')](_0x4b8ac1,_0x8e1e('0xdb'));}if(!this[_0x8e1e('0xac')](_0x4b8ac1[_0x8e1e('0x2c')])){return this[_0x8e1e('0xd')]['error'](_0x4b8ac1,_0x8e1e('0xdc'));}var _0x20f95=_0x4b8ac1[_0x8e1e('0x2c')][_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x8e1e('0x54')]('query:\x20%s',_0x20f95));var _0x56770b=this['getQueryOdbc'][_0x8e1e('0x70')](this,_0x3109ce,_0x20f95);this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x4b8ac1,_0x20f95);if(!this[_0x8e1e('0xac')](_0x4b8ac1[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xde'));}var _0x4a2962=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x4b8ac1[_0x8e1e('0xdd')]);if(!_0x4a2962){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x4b8ac1,_0x8e1e('0xdf'));}var _0x231496=this;_0x56770b['forEach'](function(_0x191b88,_0x83fc1d){Object[_0x8e1e('0xe0')](_0x191b88)['forEach'](function(_0x4ad69d){_0x231496['channel']['setVariable'](util['format'](_0x8e1e('0xe1'),_0x4a2962,_0x83fc1d,_0x4ad69d),_0x191b88[_0x4ad69d]);});});this['channel'][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0xe2'),_0x4a2962),_0x56770b[_0x8e1e('0xa2')]);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format']('variable\x20%s\x20set',_0x4a2962));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xe3')]=function(_0x17e2ad){logger[_0x8e1e('0xe4')](util['format'](_0x8e1e('0xe5'),_0x17e2ad[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x17e2ad[_0x8e1e('0xe6')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x17e2ad,_0x8e1e('0xe7'));}var _0xa119ca=this[_0x8e1e('0xe8')][_0x8e1e('0x70')](this,_0x17e2ad[_0x8e1e('0xe6')]);if(!_0xa119ca){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x17e2ad,'no\x20user\x20found');}var _0x2ed616=this[_0x8e1e('0xd')][_0x8e1e('0x58')](_0x8e1e('0xe9'),[util['format'](_0x8e1e('0xea'),_0xa119ca),_0x17e2ad['timeout'],_0x17e2ad[_0x8e1e('0xeb')],_0x17e2ad['url']]);if(_0x2ed616[_0x8e1e('0xa8')]===-0x1){return _0x2ed616;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0xec'),_0x8e1e('0xe9')));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xed')]=function(_0x3c1903){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0xee'),_0x3c1903[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x3c1903[_0x8e1e('0x84')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20key\x20configured');}if(!this[_0x8e1e('0xac')](_0x3c1903['text'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x8e1e('0x34')](_0x3c1903);this[_0x8e1e('0x41')](_0x3c1903['text'],'in','','');this['channel'][_0x8e1e('0xaf')](util['format'](_0x8e1e('0xef'),_0x3c1903[_0x8e1e('0x5d')]));var _0x21178f=this[_0x8e1e('0x7b')]['sync'](this,_0x3c1903);if(_0x21178f){for(var _0x386ce2 in _0x21178f){if(_0x21178f[_0x8e1e('0xa0')](_0x386ce2)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util['format'](_0x8e1e('0xf0'),_0x386ce2[_0x8e1e('0x6a')]()),_0x21178f[_0x386ce2]);}}this[_0x8e1e('0x41')](_0x21178f['speech'],_0x8e1e('0xf1'),_0x8e1e('0xed'),'');return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xf2'),_0x21178f['speech']));}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x3c1903,_0x8e1e('0xf3'));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xf4')]=function(_0x15af23){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x15af23[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x15af23['dialogflowV2_project_id'])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xf5'));}if(!this[_0x8e1e('0xac')](_0x15af23[_0x8e1e('0x7f')])){return this['channel']['noop'](_0x8e1e('0xf6'));}if(!this['isConfigured'](_0x15af23[_0x8e1e('0x80')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xf7'));}if(!this[_0x8e1e('0xac')](_0x15af23['dialogflowV2_language'])){return this['channel']['noop'](_0x8e1e('0xf8'));}if(!this[_0x8e1e('0xac')](_0x15af23['text'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this['channel'][_0x8e1e('0xf9')]=!![];this[_0x8e1e('0x34')](_0x15af23);this[_0x8e1e('0x41')](_0x15af23[_0x8e1e('0x5d')],'in','','');this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0xfa'),_0x15af23[_0x8e1e('0x5d')]));var _0x508d67=this[_0x8e1e('0x7d')]['sync'](this,_0x15af23);if(_0x508d67){for(var _0x4fcf81 in _0x508d67){if(_0x508d67['hasOwnProperty'](_0x4fcf81)){if(_0x4fcf81!=='providerResponse'){this[_0x8e1e('0xd')]['setVariable'](util[_0x8e1e('0x54')]('DIALOGFLOW_%s',_0x4fcf81[_0x8e1e('0x6a')]()),_0x508d67[_0x4fcf81]);}}}this[_0x8e1e('0x41')](_0x508d67[_0x8e1e('0xfb')],_0x8e1e('0xf1'),_0x8e1e('0xf4'),_0x508d67['providerResponse']);return this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')](_0x8e1e('0xfc'),_0x508d67[_0x8e1e('0xfb')]));}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x15af23,_0x8e1e('0xfd'));};AGIVertices['prototype'][_0x8e1e('0xfe')]=function(_0x43d19c){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0xff'),_0x43d19c[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x43d19c['ndauth_url'])){return this['channel']['noop'](_0x8e1e('0x100'));}if(!this[_0x8e1e('0xac')](_0x43d19c[_0x8e1e('0x101')])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0x102'));}if(!this[_0x8e1e('0xac')](_0x43d19c['password'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x103'));}if(!this['isConfigured'](_0x43d19c[_0x8e1e('0x104')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this[_0x8e1e('0xd')][_0x8e1e('0xf9')]=!![];this[_0x8e1e('0x34')](_0x43d19c);this[_0x8e1e('0x41')](_0x43d19c['text'],'in','','');this[_0x8e1e('0xd')]['noop'](util['format'](_0x8e1e('0x105'),_0x43d19c[_0x8e1e('0x5d')]));var _0x50b587=this[_0x8e1e('0x82')][_0x8e1e('0x70')](this,_0x43d19c);if(_0x50b587){for(var _0x337174 in _0x50b587){if(_0x50b587[_0x8e1e('0xa0')](_0x337174)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x106'),_0x337174[_0x8e1e('0x6a')]()),_0x50b587[_0x337174]);}}this[_0x8e1e('0x41')](_0x50b587[_0x8e1e('0xfb')],'out',_0x8e1e('0xfe'),'');if(_0x50b587[_0x8e1e('0x107')]){this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x50b587[_0x8e1e('0x107')]));var _0x356f5d=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x50b587[_0x8e1e('0x107')]);try{fs[_0x8e1e('0x109')](_0x50b587[_0x8e1e('0x107')]+_0x8e1e('0x10a'));}catch(_0x2762e0){logger['error'](_0x2762e0);}return _0x356f5d;}else{return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format']('SestekNDA\x20Result\x20%s',_0x50b587[_0x8e1e('0xfb')]));}}return this['channel'][_0x8e1e('0x28')](_0x43d19c,_0x8e1e('0x10b'));};AGIVertices['prototype'][_0x8e1e('0x10c')]=function(_0x11dc32){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x10d'),_0x11dc32[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x10c'));};AGIVertices['prototype'][_0x8e1e('0x10e')]=function(_0x355ab9){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x10f'),_0x355ab9[_0x8e1e('0x36')]));var _0x148b82='';if(_0x355ab9[_0x8e1e('0x110')]){if(!this[_0x8e1e('0xac')](_0x355ab9['trunk_id'])){return this[_0x8e1e('0xd')]['error'](_0x355ab9,_0x8e1e('0x111'));}else{var _0xf93da0=parseInt(_0x355ab9['trunk_id'],0xa);if(isNaN(_0xf93da0)){_0x148b82=_0x355ab9[_0x8e1e('0x110')];}else{_0x148b82=this['getTrunk'][_0x8e1e('0x70')](this,_0x355ab9['trunk_id']);if(!_0x148b82){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x355ab9,_0x8e1e('0x112'));}}}}else if(_0x355ab9[_0x8e1e('0x113')]){_0x148b82=_0x355ab9[_0x8e1e('0x113')];}else{return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x355ab9,_0x8e1e('0x111'));}var _0x596334=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0xe9'),[util[_0x8e1e('0x54')](_0x8e1e('0x114'),_0x148b82,_0x355ab9['phone']),_0x355ab9[_0x8e1e('0x66')],_0x355ab9[_0x8e1e('0xeb')],_0x355ab9[_0x8e1e('0x73')]]);if(_0x596334[_0x8e1e('0xa8')]===-0x1){return _0x596334;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xec'),_0x8e1e('0xe9')));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x115')]=function(_0x3c5c75){logger['info'](util['format'](_0x8e1e('0x116'),_0x3c5c75[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0x115'));};AGIVertices['prototype'][_0x8e1e('0xb')]=function(_0x7409fe){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x117'),_0x7409fe['label']));if(_0x7409fe[_0x8e1e('0xaa')]===0x0){return this[_0x8e1e('0xa9')](_0x7409fe);}_0x7409fe[_0x8e1e('0xaa')]-=0x1;if(!this['isConfigured'](_0x7409fe[_0x8e1e('0x118')])){return this['channel'][_0x8e1e('0x28')](_0x7409fe,_0x8e1e('0x119'));}var _0x40bdde=this[_0x8e1e('0x1c')][_0x8e1e('0x70')](this,_0x7409fe['file_id']);if(!_0x40bdde){return this['channel'][_0x8e1e('0x28')](_0x7409fe,'no\x20file\x20audio\x20found');}if(!this[_0x8e1e('0xac')](_0x7409fe[_0x8e1e('0xdd')])){return this['channel'][_0x8e1e('0x28')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1b9172=this[_0x8e1e('0xd')][_0x8e1e('0x11a')](_0x40bdde,_0x7409fe[_0x8e1e('0x11b')],_0x7409fe['maxdigit']);var _0x35e28f=_0x1b9172[_0x8e1e('0xa8')]?_0x1b9172[_0x8e1e('0xa8')][_0x8e1e('0x4b')]():'';logger[_0x8e1e('0x2a')](_0x8e1e('0x11c'),JSON[_0x8e1e('0x75')](_0x1b9172));if(_0x1b9172[_0x8e1e('0xa8')]===-0x1){this[_0x8e1e('0x34')]['sync'](this,_0x7409fe,_0x35e28f);return _0x1b9172;}else if(_0x1b9172[_0x8e1e('0xa6')]===_0x8e1e('0x66')){_0x1b9172[_0x8e1e('0xa8')]=_0x35e28f[_0x8e1e('0xa2')]>=parseInt(_0x7409fe[_0x8e1e('0x11d')])?'x':'i';}else{_0x1b9172[_0x8e1e('0xa8')]=_0x35e28f[_0x8e1e('0xa2')]>=parseInt(_0x7409fe[_0x8e1e('0x11d')])&&_0x35e28f[_0x8e1e('0xa2')]<=parseInt(_0x7409fe['maxdigit'])?'x':'i';}var _0x588a6e=this[_0x8e1e('0xf')]['sync'](this,_0x7409fe['variable_id']);if(!_0x588a6e){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x7409fe,'no\x20variable\x20found');}this[_0x8e1e('0xd')]['setVariable'](_0x588a6e,_0x35e28f);if(this[_0x8e1e('0xac')](_0x7409fe[_0x8e1e('0x11e')])){var _0x41a1e1=parseInt(_0x7409fe[_0x8e1e('0x11e')],0xa);var _0x3fb234=rs[_0x8e1e('0x11f')]({'charset':'*','length':_0x41a1e1});var _0x1b3faa=_0x35e28f[_0x8e1e('0xa2')];if(_0x1b3faa>0x0){if(_0x1b3faa>_0x41a1e1){this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x7409fe,_0x7409fe[_0x8e1e('0x120')]===_0x8e1e('0x121')?_0x3fb234+_0x35e28f['substr'](_0x41a1e1):_0x35e28f[_0x8e1e('0x122')](0x0,_0x1b3faa-_0x41a1e1)+_0x3fb234);}else{this['createSquareDetailsReport'][_0x8e1e('0x70')](this,_0x7409fe,rs[_0x8e1e('0x11f')]({'charset':'*','length':_0x1b3faa}));}}else{this['createSquareDetailsReport']['sync'](this,_0x7409fe,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x7409fe,_0x35e28f);}return _0x1b9172;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0xc')]=function(_0x1394cc){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x123'),_0x1394cc['label']));return this[_0x8e1e('0xb')](_0x1394cc);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x124')]=function(_0x41f6df){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x125'),_0x41f6df['label']));this['createSquareDetailsReport']['sync'](this,_0x41f6df,_0x41f6df[_0x8e1e('0x126')]);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x127'),_0x41f6df['goalname']));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x128')]=function(_0x144267){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x129'),_0x144267[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x144267['aws_access_key_id'])||!this[_0x8e1e('0xac')](_0x144267[_0x8e1e('0x8a')])){return this[_0x8e1e('0xd')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x8e1e('0xac')](_0x144267[_0x8e1e('0x5d')])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0xad'));}this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x12a'),_0x144267[_0x8e1e('0x5d')]));var _0x36001b=this['awsPolly'][_0x8e1e('0x70')](this,_0x144267);if(_0x36001b){this['channel'][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x12b'),_0x36001b));var _0x40dbca=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x36001b);try{fs[_0x8e1e('0x109')](_0x36001b+_0x8e1e('0x10a'));}catch(_0x4ddce6){logger[_0x8e1e('0x28')](_0x4ddce6);}return _0x40dbca;}return this['channel'][_0x8e1e('0x28')](_0x144267,_0x8e1e('0x12c'));};AGIVertices[_0x8e1e('0x14')]['awslex']=function(_0x15434a){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x12d'),_0x15434a[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x15434a[_0x8e1e('0x90')])||!this['isConfigured'](_0x15434a[_0x8e1e('0x8a')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x12e'));}if(!this[_0x8e1e('0xac')](_0x15434a['aws_bot_name'])){return this[_0x8e1e('0xd')]['noop'](_0x8e1e('0x12f'));}if(!this['isConfigured'](_0x15434a[_0x8e1e('0x5d')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this[_0x8e1e('0xd')]['bot']=!![];this[_0x8e1e('0x34')](_0x15434a);this['createSquareMessage'](_0x15434a['text'],'in','','');this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x130'),_0x15434a[_0x8e1e('0x5d')]));var _0x383d23=this[_0x8e1e('0x8f')]['sync'](this,_0x15434a);if(_0x383d23){for(var _0xabf58c in _0x383d23){if(_0x383d23[_0x8e1e('0xa0')](_0xabf58c)&&_['isString'](_0x383d23[_0xabf58c])){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util['format'](_0x8e1e('0x131'),_0xabf58c[_0x8e1e('0x6a')]()),_0x383d23[_0xabf58c]);}}if(_['isNil'](_0x383d23[_0x8e1e('0x132')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x133'));}else{this[_0x8e1e('0x41')](_0x383d23['message'],_0x8e1e('0xf1'),_0x8e1e('0x134'),'');return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Amazon\x20Lex\x20Result\x20%s',_0x383d23['message']));}}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x15434a,_0x8e1e('0x135'));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x136')]=function(_0x4a0c97){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x137'),_0x4a0c97[_0x8e1e('0x36')],_0x4a0c97['timeout']));if(!this['isConfigured'](_0x4a0c97['key'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20key\x20configured');}var _0x4efda5='wav';var _0x4421ee=util[_0x8e1e('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x8e1e('0x11f')](0x4));var _0x3f72a5=util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x4421ee,_0x4efda5);var _0x5a5f66=!![];if(_0x4a0c97[_0x8e1e('0x138')]==='NOBEEP'){_0x5a5f66=![];}var _0x43a570=this[_0x8e1e('0xd')][_0x8e1e('0x139')](_0x4421ee,_0x4efda5,_0x4a0c97[_0x8e1e('0x13a')],_0x4a0c97[_0x8e1e('0x66')],undefined,_0x5a5f66);if(_0x43a570['result']!==-0x1){this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x13b'),_0x3f72a5));var _0xaacb5c=this['googleASR'][_0x8e1e('0x70')](this,_0x4a0c97,_0x3f72a5);if(_0xaacb5c){for(var _0x193d97 in _0xaacb5c){if(_0xaacb5c[_0x8e1e('0xa0')](_0x193d97)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x13c'),_0x193d97['toUpperCase']()),_0xaacb5c[_0x193d97]);}}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x13d'),JSON['stringify'](_0xaacb5c)));}}return _0x43a570;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x13e')]=function(_0x216ff7){logger['info'](util['format'](_0x8e1e('0x13f'),_0x216ff7[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x216ff7[_0x8e1e('0x96')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x140'));}if(!this[_0x8e1e('0xac')](_0x216ff7[_0x8e1e('0x141')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x142'));}var _0x25f8f5=_0x8e1e('0x143');var _0xf857ff=util[_0x8e1e('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x8e1e('0x11f')](0x4));var _0x121022=util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0xf857ff,_0x25f8f5);var _0x2d9e26=!![];if(_0x216ff7[_0x8e1e('0x138')]===_0x8e1e('0x144')){_0x2d9e26=![];}var _0x1581b5=this[_0x8e1e('0xd')][_0x8e1e('0x139')](_0xf857ff,_0x25f8f5,_0x216ff7[_0x8e1e('0x13a')],_0x216ff7[_0x8e1e('0x66')],undefined,_0x2d9e26);if(_0x1581b5[_0x8e1e('0xa8')]!==-0x1){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x145'),_0x121022));var _0x2e83e2=this[_0x8e1e('0x95')]['sync'](this,_0x216ff7,_0x121022);if(_0x2e83e2){for(var _0x30e1ef in _0x2e83e2){if(_0x2e83e2[_0x8e1e('0xa0')](_0x30e1ef)){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x146'),_0x30e1ef[_0x8e1e('0x6a')]()),_0x2e83e2[_0x30e1ef]);}}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('TildeASR\x20Result\x20%s',JSON[_0x8e1e('0x75')](_0x2e83e2)));}}return _0x1581b5;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x147')]=function(_0x27946c){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x148'),_0x27946c[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0x149')](_0x27946c[_0x8e1e('0x3c')],_0x27946c['extension'],_0x27946c[_0x8e1e('0x14a')]);};AGIVertices['prototype'][_0x8e1e('0x14b')]=function(_0x20ad4b){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x20ad4b['label']));if(!this[_0x8e1e('0xac')](_0x20ad4b[_0x8e1e('0x14c')])){return this['channel']['error'](_0x20ad4b,'no\x20condition\x20configured');}try{var _0x361b64=eval(_0x20ad4b[_0x8e1e('0x14c')])?_0x8e1e('0x14d'):'false';this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x14e'),_0x20ad4b[_0x8e1e('0x14c')],_0x361b64));return{'code':0xc8,'result':_0x361b64};}catch(_0x267938){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x14f')]=function(_0x2c0cfb){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2c0cfb['label']));if(!this[_0x8e1e('0xac')](_0x2c0cfb[_0x8e1e('0x150')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x2c0cfb,_0x8e1e('0x151'));}var _0x3b6ecf=this['getIntervals'][_0x8e1e('0x70')](this,_0x2c0cfb[_0x8e1e('0x150')]);if(!_0x3b6ecf){return this[_0x8e1e('0xd')]['error'](_0x2c0cfb,_0x8e1e('0x152'));}for(var _0x1f544d=0x0;_0x1f544d<_0x3b6ecf[_0x8e1e('0xa2')];_0x1f544d+=0x1){var _0x385258=this['channel'][_0x8e1e('0xf')](util[_0x8e1e('0x54')](_0x8e1e('0x153'),_0x3b6ecf[_0x1f544d]));if(_0x385258[_0x8e1e('0xa8')]===-0x1){return _0x385258;}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('IFTIME\x20%s\x20%s',_0x3b6ecf[_0x1f544d],_0x385258[_0x8e1e('0xa6')]));if(_0x385258[_0x8e1e('0xa6')]===_0x8e1e('0x14d')){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('IFTIME\x20%s\x20%s',_0x3b6ecf[_0x1f544d],'true'));this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x154'),_0x3b6ecf[_0x1f544d],_0x8e1e('0x14d')));return{'code':0xc8,'result':_0x8e1e('0x14d')};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x154'),_0x3b6ecf[_0x1f544d],_0x8e1e('0x155')));this['channel']['noop'](util['format'](_0x8e1e('0x154'),_0x3b6ecf[_0x1f544d],_0x8e1e('0x155')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x156')]=function(_0x3e6fb9){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x157'),_0x3e6fb9[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0x156')]();};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x158')]=function(_0x4a862a){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x159'),_0x4a862a[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x4a862a['key'])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x15a'));}var _0x51eb82='wav';var _0x387344=util[_0x8e1e('0x54')](_0x8e1e('0x15b'),FILES_PATH,rs[_0x8e1e('0x11f')](0x4));var _0x51c22f=util[_0x8e1e('0x54')](_0x8e1e('0xa1'),_0x387344,_0x51eb82);var _0x3610ac=!![];if(_0x4a862a[_0x8e1e('0x138')]==='NOBEEP'){_0x3610ac=![];}var _0x531df3=this['channel'][_0x8e1e('0x139')](_0x387344,_0x51eb82,_0x4a862a[_0x8e1e('0x13a')],_0x4a862a[_0x8e1e('0x66')],undefined,_0x3610ac);if(_0x531df3['result']!==-0x1){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x15c'),_0x51c22f));var _0x586926=this[_0x8e1e('0x87')][_0x8e1e('0x70')](this,_0x4a862a,_0x51c22f);if(_0x586926){for(var _0x34e847 in _0x586926){if(_0x586926[_0x8e1e('0xa0')](_0x34e847)){this['channel'][_0x8e1e('0xa3')](util[_0x8e1e('0x54')]('ISPEECH_ASR_%s',_0x34e847[_0x8e1e('0x6a')]()),_0x586926[_0x34e847]);}}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x15d'),JSON['stringify'](_0x586926)));}}return _0x531df3;};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x15e')]=function(_0x58452c){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x15f'),_0x58452c['label']));if(!this['isConfigured'](_0x58452c[_0x8e1e('0x84')])){return this['channel'][_0x8e1e('0xaf')]('no\x20key\x20configured');}if(!this[_0x8e1e('0xac')](_0x58452c[_0x8e1e('0x5d')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20text\x20configured');}this[_0x8e1e('0xd')]['noop'](util['format'](_0x8e1e('0x160'),_0x58452c[_0x8e1e('0x5d')]));var _0x57f964=this[_0x8e1e('0x83')][_0x8e1e('0x70')](this,_0x58452c);if(_0x57f964){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x15c'),_0x57f964));var _0x20a5c3=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x57f964,_0x58452c[_0x8e1e('0x13a')]);try{fs[_0x8e1e('0x109')](_0x57f964+_0x8e1e('0x10a'));}catch(_0x4fd2d5){logger[_0x8e1e('0x28')](_0x4fd2d5);}return _0x20a5c3;}return this[_0x8e1e('0xd')]['error'](_0x58452c,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8e1e('0x14')]['login']=function(_0x342fc2){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x161'),_0x342fc2[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x342fc2[_0x8e1e('0x162')])){return this['channel'][_0x8e1e('0x28')](_0x342fc2,_0x8e1e('0x163'));}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x164'),this[_0x8e1e('0xd')]['callerid'],_0x342fc2[_0x8e1e('0x162')]));var _0x4ef528=this['agentLogin']['sync'](this,_0x342fc2['findBy']);if(_0x4ef528){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x165'),this[_0x8e1e('0xd')]['callerid'],_0x342fc2[_0x8e1e('0x162')]));this[_0x8e1e('0xd')]['noop'](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x342fc2[_0x8e1e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8e1e('0x39')],_0x342fc2[_0x8e1e('0x162')]));this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x166'),this['channel'][_0x8e1e('0x39')],_0x342fc2[_0x8e1e('0x162')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8e1e('0x14')]['logout']=function(_0x253699){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x167'),_0x253699[_0x8e1e('0x36')]));if(!this['isConfigured'](_0x253699['findBy'])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x253699,'no\x20find\x20by\x20configured');}logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x164'),this[_0x8e1e('0xd')]['callerid'],_0x253699[_0x8e1e('0x162')]));var _0x5bbf48=this[_0x8e1e('0x51')]['sync'](this,_0x253699[_0x8e1e('0x162')]);if(_0x5bbf48){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x253699[_0x8e1e('0x162')]));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x165'),this['channel'][_0x8e1e('0x39')],_0x253699[_0x8e1e('0x162')]));return{'code':0xc8,'result':_0x8e1e('0x168')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8e1e('0x39')],_0x253699[_0x8e1e('0x162')]));this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x166'),this['channel'][_0x8e1e('0x39')],_0x253699['findBy']));return{'code':0xc8,'result':_0x8e1e('0x169')};}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x16a')]=function(_0x4e10ed){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x16b'),_0x4e10ed['label']));if(!this['isConfigured'](_0x4e10ed[_0x8e1e('0x16c')])){return this[_0x8e1e('0xd')]['error'](_0x4e10ed,_0x8e1e('0x16d'));}this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('math\x20%s',_0x4e10ed[_0x8e1e('0x16c')]));var _0x18a0ad=eval(_0x4e10ed[_0x8e1e('0x16c')]);if(!this[_0x8e1e('0xac')](_0x4e10ed[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xde'));}var _0xcc6d9c=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x4e10ed[_0x8e1e('0xdd')]);if(!_0xcc6d9c){return this['channel'][_0x8e1e('0x28')](_0x4e10ed,_0x8e1e('0xdf'));}if(_[_0x8e1e('0x9d')](_0x18a0ad)){var _0x1d332e=this;_0x18a0ad['forEach'](function(_0xdf163f,_0x48337d){_0x1d332e['channel'][_0x8e1e('0xa3')](util['format'](_0x8e1e('0x16e'),_0xcc6d9c,_0x48337d),_0xdf163f);});return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x16f'),_0xcc6d9c));}else{return this[_0x8e1e('0xd')][_0x8e1e('0xa3')](_0xcc6d9c,_0x18a0ad);}};AGIVertices['prototype'][_0x8e1e('0xa')]=function(_0x230a87){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x170'),_0x230a87[_0x8e1e('0x36')]));if(_0x230a87['retry']===0x0){return this[_0x8e1e('0xa9')](_0x230a87);}_0x230a87[_0x8e1e('0xaa')]-=0x1;if(!this['isConfigured'](_0x230a87[_0x8e1e('0x118')])){return this[_0x8e1e('0xd')]['error'](_0x230a87,_0x8e1e('0x119'));}var _0x1dcaa5=this[_0x8e1e('0x1c')][_0x8e1e('0x70')](this,_0x230a87[_0x8e1e('0x118')]);if(!_0x1dcaa5){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x230a87,'no\x20file\x20audio\x20found');}var _0x466520=this[_0x8e1e('0xd')][_0x8e1e('0x11a')](_0x1dcaa5,_0x230a87[_0x8e1e('0x11b')],_0x230a87[_0x8e1e('0x171')]);var _0x485396=_0x466520[_0x8e1e('0xa8')];if(_0x466520['result']===-0x1){this['createSquareDetailsReport'][_0x8e1e('0x70')](this,_0x230a87,'-1');return _0x466520;}else if(_0x466520[_0x8e1e('0xa6')]===_0x8e1e('0x66')){_0x466520[_0x8e1e('0xa8')]=_0x466520[_0x8e1e('0xa8')][_0x8e1e('0xa2')]>0x0?_0x466520['result']:'t';}else if(_[_0x8e1e('0x43')](_0x466520[_0x8e1e('0xa8')])){_0x466520['result']='#';_0x485396='#';}if(!this['isConfigured'](_0x230a87[_0x8e1e('0xdd')])){this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x19d97c=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x230a87[_0x8e1e('0xdd')]);if(!_0x19d97c){return this['channel'][_0x8e1e('0x28')](_0x230a87,_0x8e1e('0xdf'));}this['channel']['setVariable'](_0x19d97c,_0x485396);}this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x230a87,_0x485396);return _0x466520;};AGIVertices['prototype'][_0x8e1e('0xaf')]=function(_0x5b5d7f){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x172'),_0x5b5d7f[_0x8e1e('0x36')]));return this['channel'][_0x8e1e('0xaf')](_0x5b5d7f[_0x8e1e('0x173')]||_0x5b5d7f[_0x8e1e('0x36')]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x174')]=function(_0x497c17){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x175'),_0x497c17[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x497c17[_0x8e1e('0x162')])){return this[_0x8e1e('0xd')]['error'](_0x497c17,'no\x20find\x20by\x20configured');}logger['info'](util[_0x8e1e('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x497c17[_0x8e1e('0x162')]));var _0xf79115=this[_0x8e1e('0x4d')][_0x8e1e('0x70')](this,_0x497c17[_0x8e1e('0x176')]);var _0x4bfa04=this[_0x8e1e('0x4e')][_0x8e1e('0x70')](this,_0x497c17['findBy'],_0xf79115);if(_0x4bfa04){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x497c17['findBy']));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x165'),this['channel']['callerid'],_0x497c17[_0x8e1e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8e1e('0x39')],_0x497c17['findBy']));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x165'),this[_0x8e1e('0xd')]['callerid'],_0x497c17['findBy']));return{'code':0xc8,'result':_0x8e1e('0x169')};}};AGIVertices[_0x8e1e('0x14')]['playback']=function(_0xdbbacf){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x177'),_0xdbbacf['label']));if(!this[_0x8e1e('0xac')](_0xdbbacf[_0x8e1e('0x118')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0xdbbacf,_0x8e1e('0x119'));}var _0x476d74=this['getSound'][_0x8e1e('0x70')](this,_0xdbbacf[_0x8e1e('0x118')]);if(!_0x476d74){return this['channel'][_0x8e1e('0x28')](_0xdbbacf,_0x8e1e('0x178'));}var _0x3023aa=this[_0x8e1e('0xd')][_0x8e1e('0x58')](_0x8e1e('0x179'),[_0x476d74,_0xdbbacf[_0x8e1e('0xeb')]]);if(_0x3023aa[_0x8e1e('0xa8')]===-0x1){return _0x3023aa;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),_0x8e1e('0x179'),_0x476d74));};AGIVertices['prototype']['queue']=function(_0x3b4b68){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x17a'),_0x3b4b68['label']));if(!this[_0x8e1e('0xac')](_0x3b4b68[_0x8e1e('0x17b')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x3b4b68,_0x8e1e('0x17c'));}var _0x12876b='';var _0x3199b6=parseInt(_0x3b4b68[_0x8e1e('0x17b')],0xa);if(isNaN(_0x3199b6)){_0x12876b=_0x3b4b68[_0x8e1e('0x17b')];}else{_0x12876b=this[_0x8e1e('0x15')][_0x8e1e('0x70')](this,_0x3b4b68[_0x8e1e('0x17b')]);if(!_0x12876b){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x3b4b68,'no\x20queue\x20found');}}var _0x313549='';if(this[_0x8e1e('0xac')](_0x3b4b68[_0x8e1e('0x118')])){var _0x1636d7=this[_0x8e1e('0x1c')][_0x8e1e('0x70')](this,_0x3b4b68[_0x8e1e('0x118')]);if(_0x1636d7){_0x313549=_0x1636d7;}}this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x3b4b68,_0x12876b);if(_0x3b4b68['opts'][_0x8e1e('0x17d')]('x')<0x0){_0x3b4b68[_0x8e1e('0xeb')]+='x';}if(_0x3b4b68[_0x8e1e('0xeb')][_0x8e1e('0x17d')]('X')<0x0){_0x3b4b68[_0x8e1e('0xeb')]+='X';}this['channel'][_0x8e1e('0xa3')]('XMCS-QUEUE',_0x12876b?_0x12876b['toLowerCase']():'');var _0x39fab6=this[_0x8e1e('0xd')]['exec'](_0x8e1e('0x17e'),[_0x12876b,_0x3b4b68['opts'],_0x3b4b68[_0x8e1e('0x73')],_0x313549,_0x3b4b68[_0x8e1e('0x66')],_0x3b4b68[_0x8e1e('0xb9')],_0x3b4b68[_0x8e1e('0x17f')],_0x3b4b68[_0x8e1e('0x180')],'',_0x3b4b68[_0x8e1e('0x181')]]);if(_0x39fab6['result']===-0x1){return _0x39fab6;}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')]('Executed\x20command\x20%s\x20%s',_0x8e1e('0x17e'),_0x12876b));};AGIVertices['prototype']['record']=function(_0x2d084d){logger['info'](util['format'](_0x8e1e('0x182'),_0x2d084d[_0x8e1e('0x36')]));var _0x1d7e97=_0x2d084d[_0x8e1e('0x183')]||_0x8e1e('0x143');var _0x426da2=util[_0x8e1e('0x54')](_0x8e1e('0x184'),this[_0x8e1e('0xd')]['uniqueid'],rs[_0x8e1e('0x11f')](0x5));var _0x497ed0=util[_0x8e1e('0x54')](_0x8e1e('0x185'),FILES_PATH,_0x426da2,_0x1d7e97);var _0x3104e3=util[_0x8e1e('0x54')](_0x8e1e('0x15b'),FILES_PATH,_0x426da2);this[_0x8e1e('0x3a')][_0x8e1e('0x70')](this,_0x2d084d,_0x426da2,_0x497ed0);this[_0x8e1e('0xd')][_0x8e1e('0xa3')]('RECORDING_SAVENAME',_0x426da2);logger[_0x8e1e('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3104e3,_0x1d7e97,_0x2d084d[_0x8e1e('0x186')],_0x2d084d[_0x8e1e('0x66')]);return this[_0x8e1e('0xd')][_0x8e1e('0x139')](_0x3104e3,_0x1d7e97,_0x2d084d[_0x8e1e('0x186')],_0x2d084d['timeout'],undefined,!![]);};AGIVertices['prototype'][_0x8e1e('0x187')]=function(_0x1f0a86){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x188'),_0x1f0a86[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x1f0a86[_0x8e1e('0x73')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x189'));}var _0x5328aa=this[_0x8e1e('0x63')][_0x8e1e('0x70')](this,_0x1f0a86);logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x18a'),util[_0x8e1e('0x18b')](_0x5328aa,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1f0a86[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x18c'));}var _0x13869b=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x1f0a86['variable_id']);if(!_0x13869b){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x1f0a86,_0x8e1e('0xdf'));}this['channel'][_0x8e1e('0xa3')](util[_0x8e1e('0x54')](_0x8e1e('0x18d'),_0x13869b),_0x5328aa['statusCode']?_0x5328aa[_0x8e1e('0x78')]:_0x8e1e('0x18e'));this[_0x8e1e('0xd')][_0x8e1e('0xa3')](util['format']('%s_STATUS_MESSAGE',_0x13869b),_0x5328aa[_0x8e1e('0x77')]?_0x5328aa[_0x8e1e('0x77')]:'OK');if(_0x5328aa[_0x8e1e('0x6b')]){try{this[_0x8e1e('0x9f')](_0x5328aa[_0x8e1e('0x6b')],_0x13869b);}catch(_0x4f208a){logger[_0x8e1e('0x28')](util[_0x8e1e('0x54')](_0x8e1e('0x18f'),_0x13869b));}}return this['channel']['noop'](util['format'](_0x8e1e('0x190'),_0x13869b));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x191')]=function(_0x1f13b5){logger['info'](util['format'](_0x8e1e('0x192'),_0x1f13b5[_0x8e1e('0x36')]));return this[_0x8e1e('0xd')][_0x8e1e('0x193')](_0x1f13b5[_0x8e1e('0x194')][_0x8e1e('0x5a')](/\s+/g,''),_0x1f13b5[_0x8e1e('0x186')]);};AGIVertices['prototype'][_0x8e1e('0x195')]=function(_0x2d7784){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x196'),_0x2d7784['label']));return this[_0x8e1e('0xd')][_0x8e1e('0x197')](_0x2d7784[_0x8e1e('0x65')][_0x8e1e('0x5a')](/\s+/g,''),_0x2d7784[_0x8e1e('0x186')]);};AGIVertices['prototype']['sayphonetic']=function(_0x4fc6e1){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x198'),_0x4fc6e1['label']));return this[_0x8e1e('0xd')][_0x8e1e('0x199')](_0x4fc6e1[_0x8e1e('0x5d')],_0x4fc6e1[_0x8e1e('0x186')]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x19a')]=function(_0x113b07){logger['info'](util[_0x8e1e('0x54')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x113b07['label']));if(!this['isConfigured'](_0x113b07[_0x8e1e('0x19b')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x19c'));}var _0x55ed99=this['getMailAccount']['sync'](this,_0x113b07['account_id']);if(!_0x55ed99||!_0x55ed99[_0x8e1e('0x19d')]){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x113b07,'no\x20mail\x20account\x20found');}var _0x225cec={'from':util['format'](_0x8e1e('0x19e'),_0x55ed99['name'],_0x55ed99[_0x8e1e('0x19f')]||_0x55ed99[_0x8e1e('0x19d')][_0x8e1e('0x1a0')]),'to':_0x113b07['to']||'','cc':_0x113b07['cc']||'','bcc':_0x113b07[_0x8e1e('0x1a1')]||'','subject':_0x113b07[_0x8e1e('0x1a2')],'html':_0x113b07[_0x8e1e('0x5d')],'text':_0x113b07[_0x8e1e('0x5d')]};if(this[_0x8e1e('0xac')](_0x113b07[_0x8e1e('0x1a3')])){}logger[_0x8e1e('0xe4')]('sendMail\x20message',JSON[_0x8e1e('0x75')](_0x225cec));this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x113b07,_0x113b07[_0x8e1e('0x19b')]);this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1a4'),_0x55ed99[_0x8e1e('0x12')]));this[_0x8e1e('0x20')]['sync'](this,_0x55ed99[_0x8e1e('0x1a5')],_0x225cec);return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1a6'));};AGIVertices['prototype'][_0x8e1e('0x1a7')]=function(_0x3e3309){logger['info'](util['format'](_0x8e1e('0x1a8'),_0x3e3309[_0x8e1e('0x36')]));return this['channel'][_0x8e1e('0xaf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1a9')]=function(_0x40e20e){logger[_0x8e1e('0x2a')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x40e20e[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x40e20e[_0x8e1e('0x1aa')])){return this[_0x8e1e('0xd')]['noop']('no\x20sms\x20account\x20configured');}var _0x156aaa=this[_0x8e1e('0x31')][_0x8e1e('0x70')](this,_0x40e20e['sms_account_id']);if(!_0x156aaa){return this['channel']['error'](_0x40e20e,_0x8e1e('0x1ab'));}var _0x2c097e={'body':_0x40e20e['sms_text'],'phone':_0x40e20e['to']||'','SmsAccountId':_0x156aaa['id']};logger[_0x8e1e('0xe4')]('sendSMS\x20message',JSON[_0x8e1e('0x75')](_0x2c097e));this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x40e20e,_0x40e20e[_0x8e1e('0x1aa')]);this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1ac'),_0x156aaa[_0x8e1e('0x12')]));this[_0x8e1e('0x33')][_0x8e1e('0x70')](this,_0x2c097e);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0x1ad'));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1ae')]=function(_0x4f7d11){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x1af'),_0x4f7d11['label']));if(!this[_0x8e1e('0xac')](_0x4f7d11[_0x8e1e('0xdd')])){return this['channel'][_0x8e1e('0x28')](_0x4f7d11,'no\x20variable\x20selected');}var _0x4e5a02=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x4f7d11[_0x8e1e('0xdd')]);if(!_0x4e5a02){return this['channel']['error'](_0x4f7d11,_0x8e1e('0xdf'));}return this[_0x8e1e('0xd')][_0x8e1e('0xa3')](_0x4e5a02,_0x4f7d11[_0x8e1e('0x1b0')]);};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1b1')]=function(_0x548c2f){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x1b2'),_0x548c2f[_0x8e1e('0x36')]));this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1b3'));if(_0x548c2f[_0x8e1e('0xbd')]==='yes'){this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1b4'));return this[_0x8e1e('0xd')][_0x8e1e('0xbd')]();}return this[_0x8e1e('0xd')][_0x8e1e('0xaf')]('Skipped\x20Answer');};AGIVertices[_0x8e1e('0x14')]['subproject']=function(_0x18f6db){logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x1b5'),_0x18f6db[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x18f6db['project_id'])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x18f6db,'no\x20subproject\x20selected');}var _0x4e56d7=this[_0x8e1e('0x1b6')]['sync'](this,_0x18f6db['project_id']);if(!this['isConfigured'](_0x4e56d7)){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x18f6db,util[_0x8e1e('0x54')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x18f6db['project_id']));}if(_0x4e56d7===this[_0x8e1e('0xd')][_0x8e1e('0x38')]){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x18f6db,_0x8e1e('0x1b7'));}this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x18f6db,_0x4e56d7);var _0x59dc27=this['channel'][_0x8e1e('0x58')](_0x8e1e('0x1b8'),util['format'](_0x8e1e('0x1b9'),config[_0x8e1e('0xb9')][_0x8e1e('0x1ba')]||_0x8e1e('0x1bb'),_0x4e56d7,this[_0x8e1e('0xd')][_0x8e1e('0x38')]));if(_0x59dc27[_0x8e1e('0xa8')]===-0x1){return _0x59dc27;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),_0x8e1e('0x1b8'),_0x4e56d7));};AGIVertices['prototype'][_0x8e1e('0x1bc')]=function(_0x550c90){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')](_0x8e1e('0x1bd'),_0x550c90[_0x8e1e('0x36')]));var _0x1f83f0=this[_0x8e1e('0x57')]['sync'](this,_0x550c90[_0x8e1e('0xbb')]);this[_0x8e1e('0x34')][_0x8e1e('0x70')](this,_0x550c90,_0x550c90[_0x8e1e('0xbb')]);if(this[_0x8e1e('0xac')](_0x550c90[_0x8e1e('0xdd')])){var _0x256d0b=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x550c90['variable_id']);if(_0x256d0b){this[_0x8e1e('0xd')][_0x8e1e('0xa3')](_0x256d0b,_0x1f83f0);return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1be'),_0x550c90[_0x8e1e('0xbb')],_0x256d0b));}}return this['channel']['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x1bf'),_0x550c90[_0x8e1e('0xbb')]));};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1c0')]=function(_0x1477de){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x1c1'),_0x1477de[_0x8e1e('0x36')]));_0x1477de[_0x8e1e('0x5d')]=_0x1477de['text'][_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8e1e('0xac')](_0x1477de[_0x8e1e('0x5c')])){return this['channel'][_0x8e1e('0xaf')](_0x8e1e('0x1c2'));}if(!this[_0x8e1e('0xac')](_0x1477de[_0x8e1e('0x5d')])){return this[_0x8e1e('0xd')][_0x8e1e('0xaf')](_0x8e1e('0xad'));}this[_0x8e1e('0xd')]['noop'](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x1477de[_0x8e1e('0x5d')]));var _0x587067=this['googleCloudTTS'][_0x8e1e('0x70')](this,_0x1477de);if(_0x587067){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1c3'),_0x587067));var _0x195e13=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x587067);try{fs['unlink'](_0x587067+'.wav');}catch(_0x219566){logger[_0x8e1e('0x28')](_0x219566);}return _0x195e13;}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x1477de,_0x8e1e('0x1c4'));};AGIVertices[_0x8e1e('0x14')]['tts']=function(_0x1d96fc){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1d96fc[_0x8e1e('0x36')]));_0x1d96fc[_0x8e1e('0x5d')]=_0x1d96fc[_0x8e1e('0x5d')][_0x8e1e('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8e1e('0xac')](_0x1d96fc[_0x8e1e('0x5d')])){return this['channel'][_0x8e1e('0xaf')]('no\x20text\x20configured');}this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util['format'](_0x8e1e('0x1c5'),_0x1d96fc['text']));var _0x2f4dcf=this[_0x8e1e('0x61')][_0x8e1e('0x70')](this,_0x1d96fc);if(_0x2f4dcf){this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x1c6'),_0x2f4dcf));var _0x35fae0=this[_0x8e1e('0xd')][_0x8e1e('0x108')](_0x2f4dcf);try{fs[_0x8e1e('0x109')](_0x2f4dcf+'.wav');}catch(_0x324b85){logger[_0x8e1e('0x28')](_0x324b85);}return _0x35fae0;}return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x1d96fc,_0x8e1e('0x1c7'));};AGIVertices['prototype'][_0x8e1e('0x1c8')]=function(_0x50e0c1){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x1c9'),_0x50e0c1[_0x8e1e('0x36')]));if(!this[_0x8e1e('0xac')](_0x50e0c1[_0x8e1e('0x162')])){return this['channel'][_0x8e1e('0x28')](_0x50e0c1,_0x8e1e('0x163'));}logger[_0x8e1e('0x2a')](util['format'](_0x8e1e('0x164'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));var _0x33f43f=this['agentUnpause']['sync'](this,_0x50e0c1['findBy']);if(_0x33f43f){logger[_0x8e1e('0x2a')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));this[_0x8e1e('0xd')]['noop'](util[_0x8e1e('0x54')](_0x8e1e('0x165'),this['channel'][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1[_0x8e1e('0x162')]));this[_0x8e1e('0xd')][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0x166'),this[_0x8e1e('0xd')][_0x8e1e('0x39')],_0x50e0c1['findBy']));return{'code':0xc8,'result':_0x8e1e('0x169')};}};AGIVertices[_0x8e1e('0x14')][_0x8e1e('0x1ca')]=function(_0x32cc08){logger[_0x8e1e('0x2a')](util[_0x8e1e('0x54')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x32cc08[_0x8e1e('0x36')]));var _0x293134=this['channel'][_0x8e1e('0x58')](_0x8e1e('0x1cb'),[_0x32cc08[_0x8e1e('0x1cc')],_0x32cc08[_0x8e1e('0x7a')]]);if(_0x293134[_0x8e1e('0xa8')]===-0x1){return _0x293134;}return this['channel'][_0x8e1e('0xaf')](util[_0x8e1e('0x54')](_0x8e1e('0xc9'),'VOICEMAIL',_0x32cc08[_0x8e1e('0x1cc')]));};AGIVertices[_0x8e1e('0x14')]['vswitch']=function(_0x5adff8){logger['info'](util[_0x8e1e('0x54')](_0x8e1e('0x1cd'),_0x5adff8['label']));if(!this[_0x8e1e('0xac')](_0x5adff8[_0x8e1e('0xdd')])){return this[_0x8e1e('0xd')][_0x8e1e('0x28')](_0x5adff8,_0x8e1e('0x1ce'));}var _0x3ca2e7=this[_0x8e1e('0xf')][_0x8e1e('0x70')](this,_0x5adff8[_0x8e1e('0xdd')]);if(!_0x3ca2e7){return this[_0x8e1e('0xd')]['error'](_0x5adff8,_0x8e1e('0xdf'));}var _0x327e64=this[_0x8e1e('0xd')][_0x8e1e('0xf')](_0x3ca2e7);return{'code':0xc8,'result':_0x327e64['extra']?_0x327e64[_0x8e1e('0xa6')]:'-'};};String[_0x8e1e('0x14')]['replaceAll']=function(_0x21f308,_0x547476){return this[_0x8e1e('0xa4')](_0x21f308)[_0x8e1e('0x1cf')](_0x547476);};module[_0x8e1e('0x1d0')]=AGIVertices; \ No newline at end of file +var _0x0f73=['ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','clear','clone','hasOwnProperty','isString','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','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','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','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','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','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','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','util','lodash','shelljs','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','channel','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','rpc','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f73,0x146));var _0x30f7=function(_0xacf184,_0x2765db){_0xacf184=_0xacf184-0x0;var _0x588924=_0x0f73[_0xacf184];return _0x588924;};'use strict';var fs=require('fs');var util=require(_0x30f7('0x0'));var _=require(_0x30f7('0x1'));var sh=require(_0x30f7('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x30f7('0x3'));var Mustache=require(_0x30f7('0x4'));var rp=require(_0x30f7('0x5'));var logger=require(_0x30f7('0x6'))(_0x30f7('0x7'));var config=require('../../config/environment');var shared=require(_0x30f7('0x8'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x30f7('0x9'),_0x30f7('0xa')];var verticesWithRetry=[_0x30f7('0xb'),_0x30f7('0xc'),'getsecretdigits'];var AGIVertices=function(_0x38858f,_0x131cce,_0x5eedb2){this[_0x30f7('0xd')]=_0x38858f;this['rpc']=_0x131cce;this['mailRpc']=_0x5eedb2;};AGIVertices[_0x30f7('0xe')][_0x30f7('0xf')]=function(_0x37edb7,_0x393031){this['rpc'][_0x30f7('0x10')](_0x37edb7)[_0x30f7('0x11')](function(_0x481160){_0x393031(null,_0x481160?_0x481160[_0x30f7('0x12')]:![]);})[_0x30f7('0x13')](function(_0xb9752c){_0x393031(_0xb9752c);});};AGIVertices['prototype'][_0x30f7('0x14')]=function(_0x8c0a76,_0x5155bd){this[_0x30f7('0x15')][_0x30f7('0x16')](_0x8c0a76)[_0x30f7('0x11')](function(_0x3e3c86){_0x5155bd(null,_0x3e3c86?_0x3e3c86[_0x30f7('0x12')]:![]);})['catch'](function(_0x49fccb){_0x5155bd(_0x49fccb);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x17')]=function(_0x1dfa9d,_0x1a5565){this['rpc'][_0x30f7('0x18')](_0x1dfa9d)[_0x30f7('0x11')](function(_0x1efb71){_0x1a5565(null,_0x1efb71?_0x1efb71[_0x30f7('0x12')]:![]);})[_0x30f7('0x13')](function(_0x21f3d1){_0x1a5565(_0x21f3d1);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x19')]=function(_0x1d6f46,_0x4d2d8d){this[_0x30f7('0x15')][_0x30f7('0x1a')](_0x1d6f46)[_0x30f7('0x11')](function(_0x12cdf1){_0x4d2d8d(null,_0x12cdf1?_0x12cdf1[_0x30f7('0x1b')]:![]);})[_0x30f7('0x13')](function(_0x5745d7){_0x4d2d8d(_0x5745d7);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x1c')]=function(_0x571f7e,_0x570d52){this[_0x30f7('0x15')]['getUserById'](_0x571f7e)['then'](function(_0x4c6009){_0x570d52(null,_0x4c6009?_0x4c6009[_0x30f7('0x12')]:![]);})[_0x30f7('0x13')](function(_0x4c686d){_0x570d52(_0x4c686d);});};AGIVertices['prototype'][_0x30f7('0x1d')]=function(_0x86b4f8,_0x5acb01){this[_0x30f7('0x15')][_0x30f7('0x1e')](_0x86b4f8)[_0x30f7('0x11')](function(_0x583496){_0x5acb01(null,_0x583496?_0x583496[_0x30f7('0x12')]:![]);})[_0x30f7('0x13')](function(_0x540caf){_0x5acb01(_0x540caf);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x1f')]=function(_0x5de116,_0x23d3ae){var _0x2ee090=this;this['rpc'][_0x30f7('0x20')](_0x5de116)['then'](function(_0x2ec3b9){_0x23d3ae(null,_0x2ec3b9?_0x2ee090[_0x30f7('0x21')](_0x2ec3b9[_0x30f7('0x22')]):![]);})[_0x30f7('0x13')](function(_0xbd53d){_0x23d3ae(_0xbd53d);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x23')]=function(_0x29bec2,_0x28daf5){this[_0x30f7('0x15')]['getMailAccountById'](_0x29bec2)[_0x30f7('0x11')](function(_0x4fb3bb){_0x28daf5(null,_0x4fb3bb?_0x4fb3bb:![]);})[_0x30f7('0x13')](function(_0x5eab7b){_0x28daf5(_0x5eab7b);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x24')]=function(_0xb59eb2,_0x318413,_0x53b448){this['mailRpc'][_0x30f7('0x24')](_0xb59eb2,_0x318413)[_0x30f7('0x11')](function(){_0x53b448(null);})[_0x30f7('0x13')](function(_0x2bede0){_0x53b448(_0x2bede0);});};AGIVertices['prototype'][_0x30f7('0x25')]=function(_0x3090dd,_0x86134c){this[_0x30f7('0x15')][_0x30f7('0x26')](_0x3090dd)[_0x30f7('0x11')](function(_0x1e8e63){if(_0x1e8e63){if(_0x1e8e63[_0x30f7('0x27')]){_0x86134c(null,[_0x1e8e63[_0x30f7('0x28')]]);}else{_0x86134c(null,_['map'](_0x1e8e63[_0x30f7('0x29')],_0x30f7('0x28')));}}else{_0x86134c(null,![]);}})[_0x30f7('0x13')](function(_0x3ced66){_0x86134c(_0x3ced66);});};AGIVertices['prototype'][_0x30f7('0x21')]=function(_0x27a5b2){return util[_0x30f7('0x2a')]('%s/sounds/converted/%s',FILES_PATH,_0x27a5b2);};AGIVertices[_0x30f7('0xe')][_0x30f7('0x2b')]=function(_0x32214e,_0x1e46ba,_0x1f4d3f){odbc[_0x30f7('0x2c')](_0x32214e,function(_0x343011){if(_0x343011){logger[_0x30f7('0x2d')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x343011);_0x1f4d3f(_0x343011);}else{logger[_0x30f7('0x2e')](_0x30f7('0x2f'));odbc['query'](_0x1e46ba,function(_0x410aa3,_0x2accfd){if(_0x410aa3){logger[_0x30f7('0x2e')](_0x30f7('0x30'),_0x1e46ba);_0x1f4d3f(_0x410aa3);}else{logger[_0x30f7('0x2e')](_0x30f7('0x31'),_0x1e46ba);odbc[_0x30f7('0x32')](function(_0x21b7d1){if(_0x21b7d1){logger[_0x30f7('0x2d')](_0x30f7('0x33'),_0x21b7d1);}_0x1f4d3f(null,_0x2accfd);});}});}});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x34')]=function(_0x440103,_0xb025bc){this[_0x30f7('0x15')]['getSmsAccountById'](_0x440103)[_0x30f7('0x11')](function(_0x4ac209){_0xb025bc(null,_0x4ac209?_0x4ac209:![]);})['catch'](function(_0x57795c){_0xb025bc(_0x57795c);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x35')]=function(_0x12d8b1,_0x3cac5e){this[_0x30f7('0x15')][_0x30f7('0x35')](_0x12d8b1)['then'](function(_0x167c81){_0x3cac5e(null,_0x167c81);})[_0x30f7('0x13')](function(_0x5b6e70){_0x3cac5e(_0x5b6e70);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x5194c7,_0x43f19a,_0x59513b){this[_0x30f7('0x15')][_0x30f7('0x36')]({'uniqueid':this[_0x30f7('0xd')]['uniqueid'],'node':_0x5194c7[_0x30f7('0x37')],'application':_0x5194c7[_0x30f7('0x38')],'data':_0x43f19a||null,'project_name':this[_0x30f7('0xd')][_0x30f7('0x39')],'callerid':this[_0x30f7('0xd')][_0x30f7('0x3a')]})['then'](function(_0x4a5349){if(_0x59513b){_0x59513b(null,_0x4a5349);}})[_0x30f7('0x13')](function(_0x2e485d){if(_0x59513b){_0x59513b(_0x2e485d);}});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x3b')]=function(_0x5b8c1a,_0x2a2a58,_0x329a2a,_0x16b1e2){this['rpc']['createSquareRecording']({'uniqueid':this[_0x30f7('0xd')][_0x30f7('0x3c')],'callerid':this['channel'][_0x30f7('0x3a')],'calleridname':this['channel'][_0x30f7('0x3d')],'context':this[_0x30f7('0xd')][_0x30f7('0x3e')],'extension':this[_0x30f7('0xd')][_0x30f7('0x3f')],'priority':this[_0x30f7('0xd')][_0x30f7('0x40')],'accountcode':this[_0x30f7('0xd')][_0x30f7('0x41')],'dnid':this[_0x30f7('0xd')][_0x30f7('0x42')],'projectName':this[_0x30f7('0xd')][_0x30f7('0x39')],'saveName':_0x2a2a58,'filename':_0x5b8c1a[_0x30f7('0x43')]||_0x2a2a58,'savePath':_0x329a2a})[_0x30f7('0x11')](function(_0x44b0d2){_0x16b1e2(null,_0x44b0d2);})[_0x30f7('0x13')](function(_0x1343a7){_0x16b1e2(_0x1343a7);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x44')]=function(_0x1b99df,_0x480fcf,_0x1a7e00,_0x140938,_0x64528a){this[_0x30f7('0x15')][_0x30f7('0x44')]({'uniqueid':this[_0x30f7('0xd')][_0x30f7('0x3c')],'body':_0x1b99df,'direction':_0x480fcf,'providerName':_0x1a7e00,'providerResponse':_0x140938})[_0x30f7('0x11')](function(_0x2866ce){if(_0x64528a){_0x64528a(null,_0x2866ce);}})[_0x30f7('0x13')](function(_0x2f06e5){if(_0x64528a){_0x64528a(_0x2f06e5);}});};AGIVertices[_0x30f7('0xe')]['createCmContact']=function(_0xac41ea,_0x4bd1d1){this[_0x30f7('0x15')][_0x30f7('0x45')]({'firstName':_[_0x30f7('0x46')](_0xac41ea['name'])||_[_0x30f7('0x47')](_0xac41ea[_0x30f7('0x12')])?_0x30f7('0x48')+Math['random']():_0xac41ea['name'],'lastName':_[_0x30f7('0x46')](_0xac41ea[_0x30f7('0x49')])||_['isNil'](_0xac41ea['lastName'])?null:_0xac41ea[_0x30f7('0x49')],'phone':_0xac41ea[_0x30f7('0x4a')],'ListId':_0xac41ea['list_id'],'scheduledat':_0xac41ea[_0x30f7('0x4b')],'callbackUniqueid':this[_0x30f7('0xd')][_0x30f7('0x3c')],'tags':_0x30f7('0x4c'),'description':_0x30f7('0x4d')+_0xac41ea[_0x30f7('0x4b')][_0x30f7('0x4e')](),'priority':_0xac41ea[_0x30f7('0x4f')]})[_0x30f7('0x11')](function(_0x14ac1c){_0x4bd1d1(null,_0x14ac1c);})['catch'](function(_0x16f264){_0x4bd1d1(_0x16f264);});};AGIVertices['prototype'][_0x30f7('0x50')]=function(_0x34281c,_0x12e3b8){this[_0x30f7('0x15')][_0x30f7('0x51')](_0x34281c)[_0x30f7('0x11')](function(_0x57b240){_0x12e3b8(null,_0x57b240?_0x57b240[_0x30f7('0x12')]:![]);})[_0x30f7('0x13')](function(_0x5d61ff){_0x12e3b8(_0x5d61ff);});};AGIVertices['prototype'][_0x30f7('0x52')]=function(_0x38c670,_0x22a87f,_0x20763d){var _0xd670d2={'role':_0x30f7('0x53')};_0xd670d2[_0x38c670]=this[_0x30f7('0xd')][_0x30f7('0x3a')];this[_0x30f7('0x15')][_0x30f7('0x52')](_0xd670d2,_0x22a87f,this[_0x30f7('0xd')][_0x30f7('0x3c')])[_0x30f7('0x11')](function(_0x385ff9){_0x20763d(null,_[_0x30f7('0x47')](_0x385ff9)?![]:!![]);})[_0x30f7('0x13')](function(_0x231a95){logger[_0x30f7('0x2d')](_0x231a95);_0x20763d(null,![]);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x54')]=function(_0x547da3,_0x3f0924){var _0x12e640={'role':_0x30f7('0x53')};_0x12e640[_0x547da3]=this[_0x30f7('0xd')]['callerid'];this['rpc'][_0x30f7('0x54')](_0x12e640)['then'](function(_0x18c5b4){_0x3f0924(null,_[_0x30f7('0x47')](_0x18c5b4)?![]:!![]);})[_0x30f7('0x13')](function(_0x50ca72){logger[_0x30f7('0x2d')](_0x50ca72);_0x3f0924(null,![]);});};AGIVertices['prototype'][_0x30f7('0x55')]=function(_0x8e0140,_0x25f7cb){var _0x58e161={'role':_0x30f7('0x53')};_0x58e161[_0x8e0140]=this[_0x30f7('0xd')][_0x30f7('0x3a')];this[_0x30f7('0x15')][_0x30f7('0x55')](_0x58e161)[_0x30f7('0x11')](function(_0x59175c){_0x25f7cb(null,_[_0x30f7('0x47')](_0x59175c)?![]:!![]);})[_0x30f7('0x13')](function(_0x4e32f4){logger[_0x30f7('0x2d')](_0x4e32f4);_0x25f7cb(null,![]);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x56')]=function(_0x42c272,_0x30ee9d){var _0x5230ff={'role':_0x30f7('0x53')};_0x5230ff[_0x42c272]=this[_0x30f7('0xd')]['callerid'];var _0x457936=_0x42c272!=_0x30f7('0x57')?util[_0x30f7('0x2a')]('%s/%s@from-sip/n',_0x30f7('0x58'),this[_0x30f7('0xd')][_0x30f7('0x3a')]):undefined;this['rpc'][_0x30f7('0x56')](_0x5230ff,_0x457936)[_0x30f7('0x11')](function(_0x1365c4){_0x30ee9d(null,_['isNil'](_0x1365c4)?![]:!![]);})[_0x30f7('0x13')](function(_0xd9dadd){logger[_0x30f7('0x2d')](_0xd9dadd);_0x30ee9d(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x1bd8dd,_0x38eb7d){sh[_0x30f7('0x59')](_[_0x30f7('0x5a')](_0x1bd8dd),function(_0x2f2526,_0xa8f9f4){var _0x2d3d90=_0xa8f9f4[_0x30f7('0x5b')](/(\r\n|\n|\r)/gm,'');_0x38eb7d(null,_0x2d3d90);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x5c')]=function(_0x4933d6,_0x587843){scripts[_0x30f7('0x5c')](_0x4933d6[_0x30f7('0x5d')],_0x4933d6[_0x30f7('0x5e')]||'text',_0x4933d6[_0x30f7('0x5f')],_0x4933d6[_0x30f7('0x60')]||_0x30f7('0x61'),_0x4933d6['ssmlGender']||_0x30f7('0x62'),_0x4933d6[_0x30f7('0x63')]||'MP3')['then'](function(_0x27043b){_0x587843(null,_0x27043b);})[_0x30f7('0x13')](function(_0x180d72){_0x587843(_0x180d72);});};AGIVertices[_0x30f7('0xe')]['googleTTS']=function(_0x3a52d5,_0x57a4c6){scripts[_0x30f7('0x64')](_0x3a52d5[_0x30f7('0x5f')],_0x3a52d5[_0x30f7('0x65')]||'en',0x1)['then'](function(_0x40f7f6){_0x57a4c6(null,_0x40f7f6);})[_0x30f7('0x13')](function(_0x54ebf7){_0x57a4c6(_0x54ebf7);});};AGIVertices[_0x30f7('0xe')]['restAPI']=function(_0x590f49,_0x3d40b6){var _0x65c52e={'uri':_0x590f49[_0x30f7('0x66')],'method':_0x590f49[_0x30f7('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x590f49['timeout'])==='number'&&parseInt(_0x590f49['timeout'])>=0x1?parseInt(_0x590f49[_0x30f7('0x68')])*0x3e8:0x5*0x3e8};if(_[_0x30f7('0x69')]([_0x30f7('0x6a'),_0x30f7('0x6b')],_0x65c52e['method'][_0x30f7('0x6c')]())){try{_0x65c52e[_0x30f7('0x6d')]=_0x590f49['rawBody']?JSON[_0x30f7('0x6e')](_0x590f49['rawBody']):{};}catch(_0x4fc748){logger[_0x30f7('0x2d')](_0x30f7('0x6f'),_0x4fc748);}}try{_0x65c52e[_0x30f7('0x70')]=_0x590f49[_0x30f7('0x9')]?JSON[_0x30f7('0x6e')](_0x590f49['rawHeaders']):{};}catch(_0x566b37){logger[_0x30f7('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x566b37);}if(_0x590f49[_0x30f7('0x71')]){try{var _0x2a2a36=require(_0x590f49['computedVariables'])[_0x30f7('0x72')](this,_0x65c52e);_0x65c52e['uri']=Mustache[_0x30f7('0x73')](_0x590f49[_0x30f7('0x66')],_0x2a2a36,{},['$$','$$']);if(_0x65c52e[_0x30f7('0x70')]){_0x65c52e[_0x30f7('0x70')]=JSON['parse'](Mustache[_0x30f7('0x73')](JSON[_0x30f7('0x74')](_0x65c52e[_0x30f7('0x70')]),_0x2a2a36,{},['$$','$$']));}if(_0x65c52e[_0x30f7('0x6d')]){_0x65c52e[_0x30f7('0x6d')]=JSON['parse'](Mustache[_0x30f7('0x73')](JSON['stringify'](_0x65c52e[_0x30f7('0x6d')]),_0x2a2a36,{},['$$','$$']));}}catch(_0x1bc6cc){logger[_0x30f7('0x2d')](_0x30f7('0x75'),_0x1bc6cc);}}rp(_0x65c52e)[_0x30f7('0x11')](function(_0x5bcc8b){var _0x43700a={'statusCode':_0x5bcc8b['statusCode']||0xc8,'statusMessage':_0x5bcc8b['statusMessage']||'OK','headers':_0x5bcc8b[_0x30f7('0x70')]||{},'body':_0x5bcc8b['body']||{}};_0x3d40b6(null,_0x43700a);})[_0x30f7('0x13')](function(_0x2119c2){var _0x9c14a1={'statusCode':_0x2119c2[_0x30f7('0x76')]||0x1f4,'statusMessage':_0x2119c2[_0x30f7('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2119c2['options'][_0x30f7('0x70')]||{},'body':_0x2119c2[_0x30f7('0x78')][_0x30f7('0x6d')]||{}};_0x3d40b6(null,_0x9c14a1);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x79')]=function(_0x267118,_0x2fdbda){scripts['googleDialogflow'](this[_0x30f7('0xd')][_0x30f7('0x3c')],_0x267118[_0x30f7('0x7a')],_0x267118[_0x30f7('0x5f')],_0x267118['dialogflow_language']||'en')[_0x30f7('0x11')](function(_0x2925fd){_0x2fdbda(null,_0x2925fd);})[_0x30f7('0x13')](function(_0x58b8dd){_0x2fdbda(_0x58b8dd);});};AGIVertices['prototype'][_0x30f7('0x7b')]=function(_0x209758,_0x5e96f0){scripts[_0x30f7('0x7b')](this['channel'][_0x30f7('0x3c')],_0x209758[_0x30f7('0x7c')],_0x209758[_0x30f7('0x7d')],_0x209758[_0x30f7('0x7e')],_0x209758['text'],_0x209758[_0x30f7('0x7f')]||'en')['then'](function(_0x4b1ce3){_0x5e96f0(null,_0x4b1ce3);})['catch'](function(_0x4395a1){_0x5e96f0(_0x4395a1);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x80')]=function(_0xa01983,_0x1e7d40){scripts[_0x30f7('0x80')](this[_0x30f7('0xd')],_0xa01983)[_0x30f7('0x11')](function(_0xf9ea30){_0x1e7d40(null,_0xf9ea30);})[_0x30f7('0x13')](function(_0x4fda68){_0x1e7d40(_0x4fda68);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x81')]=function(_0x1fe9e6,_0x561098){scripts['ispeechTTS'](_0x1fe9e6['key'],_0x1fe9e6[_0x30f7('0x5f')],_0x1fe9e6[_0x30f7('0x82')]||'en-US',_0x1fe9e6[_0x30f7('0x83')])['then'](function(_0x567d4f){_0x561098(null,_0x567d4f);})[_0x30f7('0x13')](function(_0x5887ea){_0x561098(_0x5887ea);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x84')]=function(_0x328190,_0x412fb3,_0x189386){scripts[_0x30f7('0x84')](_0x412fb3,_0x328190[_0x30f7('0x7a')],_0x328190[_0x30f7('0x85')]||_0x30f7('0x61'),this[_0x30f7('0x86')](_0x328190['model'])?_0x328190[_0x30f7('0x87')]:undefined)[_0x30f7('0x11')](function(_0x39554b){_0x189386(null,_0x39554b);})['catch'](function(_0xe3cc07){_0x189386(_0xe3cc07);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x88')]=function(_0x52d4b4,_0x4a68f5){scripts['awsPolly'](_0x52d4b4[_0x30f7('0x89')],_0x52d4b4[_0x30f7('0x8a')],_0x52d4b4[_0x30f7('0x8b')],_0x52d4b4['aws_polly_voice']||_0x30f7('0x8c'),_0x52d4b4[_0x30f7('0x5f')],_0x52d4b4[_0x30f7('0x8d')]||'text')['then'](function(_0x1c0fd1){_0x4a68f5(null,_0x1c0fd1);})[_0x30f7('0x13')](function(_0x38e410){_0x4a68f5(_0x38e410);});};AGIVertices['prototype'][_0x30f7('0x8e')]=function(_0x3db74b,_0x4a654f){scripts[_0x30f7('0x8e')](this['channel'][_0x30f7('0x3c')],_0x3db74b[_0x30f7('0x89')],_0x3db74b[_0x30f7('0x8a')],_0x3db74b[_0x30f7('0x8f')],_0x3db74b[_0x30f7('0x5f')],_0x3db74b[_0x30f7('0x90')])[_0x30f7('0x11')](function(_0x29c36e){_0x4a654f(null,_0x29c36e);})[_0x30f7('0x13')](function(_0x179293){_0x4a654f(_0x179293);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x91')]=function(_0x3f561a,_0x5a7395,_0x2e5997){scripts[_0x30f7('0x91')](_0x5a7395,_0x3f561a[_0x30f7('0x7a')],_0x3f561a[_0x30f7('0x92')]||_0x30f7('0x61'))[_0x30f7('0x11')](function(_0x12c3f8){_0x2e5997(null,_0x12c3f8);})[_0x30f7('0x13')](function(_0x4f22d5){_0x2e5997(_0x4f22d5);});};AGIVertices[_0x30f7('0xe')][_0x30f7('0x93')]=function(_0x3acd6d,_0x348ecc,_0x3f030d){scripts['tildeASR'](_0x348ecc,_0x3acd6d[_0x30f7('0x94')],_0x3acd6d['appsecret'],_0x3acd6d[_0x30f7('0x95')])['then'](function(_0x23c575){_0x3f030d(null,_0x23c575);})[_0x30f7('0x13')](function(_0x2016cc){_0x3f030d(_0x2016cc);});};AGIVertices['prototype'][_0x30f7('0x96')]=function(_0x117c0a){var _0x298ee6=_[_0x30f7('0x69')](verticesWithRetry,_0x117c0a['agicommand'])?_0x117c0a:_[_0x30f7('0x97')](_0x117c0a);for(var _0x2126ba in _0x298ee6){if(_0x298ee6[_0x30f7('0x98')](_0x2126ba)){if(_0x298ee6[_0x2126ba]&&_[_0x30f7('0x99')](_0x298ee6[_0x2126ba])){if(_[_0x30f7('0x69')](recursiveMapAttributes,_0x2126ba)){_0x298ee6[_0x2126ba]=this['replaceObjectAllVariables'](_0x298ee6[_0x2126ba]);}else{_0x298ee6[_0x2126ba]=this[_0x30f7('0x9a')](_0x298ee6[_0x2126ba]);}}}}return _0x298ee6;};AGIVertices[_0x30f7('0xe')]['recursiveNodeIndex']=function(_0x50ed13){for(var _0x549d0d in _0x50ed13){if(_0x50ed13[_0x30f7('0x98')](_0x549d0d)){if(_[_0x30f7('0x9b')](_0x50ed13[_0x549d0d])){this[_0x30f7('0x9c')](_0x50ed13[_0x549d0d]);}else if(_[_0x30f7('0x9d')](_0x50ed13[_0x549d0d])){for(var _0x1c326c=0x0;_0x1c326c<_0x50ed13[_0x549d0d][_0x30f7('0x9e')];_0x1c326c++){this[_0x30f7('0x9c')](_0x50ed13[_0x549d0d][_0x1c326c]);}}else if(_[_0x30f7('0x99')](_0x50ed13[_0x549d0d])){_0x50ed13[_0x549d0d]=this[_0x30f7('0x9a')](_0x50ed13[_0x549d0d]);}}}};AGIVertices[_0x30f7('0xe')][_0x30f7('0x9f')]=function(_0x46be77,_0x520990){for(var _0x53298f in _0x46be77){if(_0x46be77[_0x30f7('0x98')](_0x53298f)){if(_[_0x30f7('0x9b')](_0x46be77[_0x53298f])){if(!_[_0x30f7('0x46')](_0x46be77[_0x53298f])){this['saveRestApiResult'](_0x46be77[_0x53298f],util['format']('%s.%s',_0x520990,_0x53298f));}}else if(_['isArray'](_0x46be77[_0x53298f])){for(var _0x546c83=0x0;_0x546c83<_0x46be77[_0x53298f][_0x30f7('0x9e')];_0x546c83++){this[_0x30f7('0x9f')](_0x46be77[_0x53298f][_0x546c83],util[_0x30f7('0x2a')](_0x30f7('0xa0'),_0x520990,_0x53298f+'['+_0x546c83+']'));}}else{if(!_[_0x30f7('0x47')](_0x46be77[_0x53298f])){this[_0x30f7('0xd')][_0x30f7('0xa1')](util[_0x30f7('0x2a')](_0x30f7('0xa0'),_0x520990,_0x53298f),_0x46be77[_0x53298f]);}}}}};AGIVertices[_0x30f7('0xe')]['replaceObjectAllVariables']=function(_0x5c617a){try{var _0x4b2d66=JSON[_0x30f7('0x6e')](_0x5c617a);this[_0x30f7('0x9c')](_0x4b2d66);return JSON[_0x30f7('0x74')](_0x4b2d66);}catch(_0x34354b){return this[_0x30f7('0x9a')](_0x5c617a);}};AGIVertices[_0x30f7('0xe')]['replaceAllVariables']=function(_0x2a7252){var _0xdaa6da=_0x2a7252[_0x30f7('0xa2')]('{');for(var _0x324894=0x1;_0x324894<_0xdaa6da[_0x30f7('0x9e')];_0x324894+=0x1){var _0x5de5b1=_0xdaa6da[_0x324894][_0x30f7('0xa2')]('}');if(_0x5de5b1[_0x30f7('0x9e')]>0x1){_0x2a7252=_0x2a7252['replaceAll']('{'+_0x5de5b1[0x0]+'}',this[_0x30f7('0xd')][_0x30f7('0xf')](_0x5de5b1[0x0])['extra']||_0x5de5b1[0x0]);}}if(_0xdaa6da[_0x30f7('0x9e')]===0x1){return _0x2a7252['toString']();}return this[_0x30f7('0x9a')](_0x2a7252);};AGIVertices[_0x30f7('0xe')][_0x30f7('0xa3')]=function(_0xdd13fe,_0x20b546){var _0x3dc888=this[_0x30f7('0xd')]['getVariable'](_0xdd13fe);if(_0x3dc888[_0x30f7('0xa4')]===-0x1){return _0x3dc888;}logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0xa5'),_0x20b546,_0x3dc888['extra']));return this['channel']['setVariable'](_0x20b546,_0x3dc888[_0x30f7('0xa6')]);};AGIVertices[_0x30f7('0xe')]['isConfigured']=function(_0x55e3f9){return _0x55e3f9&&_0x55e3f9!=='0'&&_0x55e3f9!=='-1'&&_0x55e3f9!=='';};AGIVertices[_0x30f7('0xe')][_0x30f7('0xa7')]=function(_0x1c048c){this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x1c048c,'-');_0x1c048c[_0x30f7('0xa8')]=_0x1c048c[_0x30f7('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x30f7('0xa9')]=function(_0x1f9c01){logger['info'](util[_0x30f7('0x2a')](_0x30f7('0xaa'),_0x1f9c01[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x1f9c01['text'])){return this[_0x30f7('0xd')][_0x30f7('0xab')]('no\x20text\x20configured');}var _0x3a3d6b='\x22'+_0x1f9c01[_0x30f7('0x5f')]+'\x22';if(this['isConfigured'](_0x1f9c01[_0x30f7('0x78')])){_0x3a3d6b+=','+_0x1f9c01['options'];}var _0x1c1edb=this[_0x30f7('0xd')]['exec'](_0x30f7('0xac'),_0x3a3d6b);if(_0x1c1edb['result']===-0x1){return _0x1c1edb;}return this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3a3d6b));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xad')]=function(_0x486d8b){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0xae'),_0x486d8b[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x486d8b[_0x30f7('0xaf')])){return this['channel']['noop'](_0x30f7('0xb0'));}var _0x58b326=_0x486d8b[_0x30f7('0xaf')];if(this[_0x30f7('0x86')](_0x486d8b[_0x30f7('0x78')])){_0x58b326+=','+_0x486d8b[_0x30f7('0x78')];}var _0x47472e=this['channel']['exec'](_0x30f7('0xb1'),_0x58b326);if(_0x47472e['result']===-0x1){return _0x47472e;}var _0x101325=this[_0x30f7('0xa3')](_0x30f7('0xb2'),_0x30f7('0xb3'));if(_0x101325[_0x30f7('0xa4')]===-0x1){return _0x101325;}var _0x2eb666=this[_0x30f7('0xa3')](_0x30f7('0xb4'),'MRCP_RECOG_TRANSCRIPT');if(_0x2eb666['result']===-0x1){return _0x2eb666;}var _0x39bb45=this[_0x30f7('0xa3')](_0x30f7('0xb5'),'MRCP_RECOG_INSTANCE');if(_0x39bb45['result']===-0x1){return _0x39bb45;}return this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x58b326));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x7')]=function(_0x4cdb62){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4cdb62[_0x30f7('0x37')]));return this[_0x30f7('0xd')]['agi']([_0x4cdb62['command'],_0x4cdb62['args']]);};AGIVertices['prototype'][_0x30f7('0xb6')]=function(_0x4e101a){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4e101a[_0x30f7('0x37')]));if(this[_0x30f7('0x86')](_0x4e101a[_0x30f7('0x68')])){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0xb7'),_0x4e101a[_0x30f7('0x68')]));var _0x3dd266=this[_0x30f7('0xd')][_0x30f7('0xb8')](_0x4e101a[_0x30f7('0x68')]);if(_0x3dd266[_0x30f7('0xa4')]===-0x1){return _0x3dd266;}}return this[_0x30f7('0xd')][_0x30f7('0xb6')]();};AGIVertices[_0x30f7('0xe')][_0x30f7('0x4c')]=function(_0x4ee620){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0xb9'),_0x4ee620[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x4ee620[_0x30f7('0xba')])){return this['channel'][_0x30f7('0x2d')](_0x4ee620,_0x30f7('0xbb'));}_0x4ee620[_0x30f7('0x4b')]=moment();if(this[_0x30f7('0x86')](_0x4ee620['delay'])){_0x4ee620[_0x30f7('0x4b')]=moment()[_0x30f7('0xbc')](_0x4ee620[_0x30f7('0xbd')],'minutes');}if(!this[_0x30f7('0x86')](_0x4ee620[_0x30f7('0x4f')])){_0x4ee620['callback_priority']=0x2;}this[_0x30f7('0x45')][_0x30f7('0x72')](this,_0x4ee620);return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xbe'),_0x4ee620[_0x30f7('0x4a')],_0x4ee620[_0x30f7('0xba')],_0x4ee620[_0x30f7('0x4b')]));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xbf')]=function(_0xbd36b9){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0xc0'),_0xbd36b9[_0x30f7('0x37')]));var _0x22b96e=this[_0x30f7('0xd')][_0x30f7('0x59')](_0xbd36b9[_0x30f7('0xc1')],_0xbd36b9[_0x30f7('0x78')]);if(_0x22b96e[_0x30f7('0xa4')]===-0x1){return _0x22b96e;}return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xc2'),_0xbd36b9['application'],_0xbd36b9[_0x30f7('0x78')]));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xc3')]=function(_0x239459){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x239459['label']));if(!this[_0x30f7('0x86')](_0x239459['text'])){return this[_0x30f7('0xd')]['noop'](_0x30f7('0xc4'));}var _0x8843a3='\x22'+_0x239459[_0x30f7('0x5f')]+'\x22';if(this['isConfigured'](_0x239459[_0x30f7('0x78')])){_0x8843a3+=','+_0x239459[_0x30f7('0x78')];}var _0x517ac3=this['channel']['exec'](_0x30f7('0xac'),_0x8843a3);if(_0x517ac3[_0x30f7('0xa4')]===-0x1){return _0x517ac3;}return this['channel']['noop'](util[_0x30f7('0x2a')](_0x30f7('0xc5'),_0x8843a3));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xc6')]=function(_0x3857d6){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0xc7'),_0x3857d6[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x3857d6[_0x30f7('0x5f')])){return this['channel'][_0x30f7('0xab')](_0x30f7('0xc4'));}var _0x44af45='\x22'+_0x3857d6['text']+'\x22';if(this[_0x30f7('0x86')](_0x3857d6[_0x30f7('0x78')])){_0x44af45+=','+_0x3857d6[_0x30f7('0x78')];}var _0x36679c=this[_0x30f7('0xd')][_0x30f7('0x59')](_0x30f7('0xac'),_0x44af45);if(_0x36679c[_0x30f7('0xa4')]===-0x1){return _0x36679c;}return this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xc5'),_0x44af45));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xc8')]=function(_0x1d3d70){logger['info'](util[_0x30f7('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1d3d70['label']));if(!this[_0x30f7('0x86')](_0x1d3d70[_0x30f7('0xaf')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xb0'));}var _0x412832=_0x1d3d70[_0x30f7('0xaf')];if(this[_0x30f7('0x86')](_0x1d3d70[_0x30f7('0x78')])){_0x412832+=','+_0x1d3d70[_0x30f7('0x78')];}var _0x1929b1=this[_0x30f7('0xd')][_0x30f7('0x59')](_0x30f7('0xb1'),_0x412832);if(_0x1929b1[_0x30f7('0xa4')]===-0x1){return _0x1929b1;}var _0x3a0a54=this[_0x30f7('0xa3')](_0x30f7('0xb2'),_0x30f7('0xc9'));if(_0x3a0a54[_0x30f7('0xa4')]===-0x1){return _0x3a0a54;}var _0x445a62=this[_0x30f7('0xa3')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x445a62[_0x30f7('0xa4')]===-0x1){return _0x445a62;}var _0x18ee64=this[_0x30f7('0xa3')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x18ee64[_0x30f7('0xa4')]===-0x1){return _0x18ee64;}return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xca'),_0x412832));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xcb')]=function(_0x304933){logger['info'](util['format'](_0x30f7('0xcc'),_0x304933[_0x30f7('0x37')]));if(!this['isConfigured'](_0x304933[_0x30f7('0xaf')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xb0'));}var _0x151bcc=_0x304933['grammar'];if(this['isConfigured'](_0x304933[_0x30f7('0x78')])){_0x151bcc+=','+_0x304933['options'];}var _0xc2a4f9=this['channel']['exec'](_0x30f7('0xb1'),_0x151bcc);if(_0xc2a4f9['result']===-0x1){return _0xc2a4f9;}var _0x3b9bb6=this[_0x30f7('0xa3')](_0x30f7('0xb2'),_0x30f7('0xcd'));if(_0x3b9bb6[_0x30f7('0xa4')]===-0x1){return _0x3b9bb6;}var _0x2a5ef7=this['getAndSetVariable'](_0x30f7('0xb4'),_0x30f7('0xce'));if(_0x2a5ef7[_0x30f7('0xa4')]===-0x1){return _0x2a5ef7;}var _0x4a81df=this['getAndSetVariable'](_0x30f7('0xb5'),_0x30f7('0xcf'));if(_0x4a81df['result']===-0x1){return _0x4a81df;}return this['channel'][_0x30f7('0xab')](util['format'](_0x30f7('0xca'),_0x151bcc));};AGIVertices[_0x30f7('0xe')]['database']=function(_0x26fb45){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0xd0'),_0x26fb45[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x26fb45[_0x30f7('0xd1')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x26fb45,_0x30f7('0xd2'));}var _0x52bd2a=this['getSquareOdbc']['sync'](this,_0x26fb45[_0x30f7('0xd1')]);if(!_0x52bd2a){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x26fb45,_0x30f7('0xd3'));}if(!this['isConfigured'](_0x26fb45['query'])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x26fb45,_0x30f7('0xd4'));}var _0x426060=_0x26fb45[_0x30f7('0xd5')][_0x30f7('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x30f7('0x2a')](_0x30f7('0xd6'),_0x426060));var _0x7d7a84=this[_0x30f7('0x2b')][_0x30f7('0x72')](this,_0x52bd2a,_0x426060);this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x26fb45,_0x426060);if(!this[_0x30f7('0x86')](_0x26fb45['variable_id'])){return this['channel'][_0x30f7('0xab')](_0x30f7('0xd7'));}var _0x80307b=this[_0x30f7('0xf')]['sync'](this,_0x26fb45[_0x30f7('0xd8')]);if(!_0x80307b){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x26fb45,'no\x20variable\x20found');}var _0x49abb2=this;_0x7d7a84[_0x30f7('0xd9')](function(_0x4b46db,_0x5c38ce){Object[_0x30f7('0xda')](_0x4b46db)[_0x30f7('0xd9')](function(_0x8fa65f){_0x49abb2[_0x30f7('0xd')]['setVariable'](util[_0x30f7('0x2a')](_0x30f7('0xdb'),_0x80307b,_0x5c38ce,_0x8fa65f),_0x4b46db[_0x8fa65f]);});});this[_0x30f7('0xd')]['setVariable'](util[_0x30f7('0x2a')]('%s_ROWS_COUNT',_0x80307b),_0x7d7a84[_0x30f7('0x9e')]);return this['channel'][_0x30f7('0xab')](util['format'](_0x30f7('0xdc'),_0x80307b));};AGIVertices['prototype'][_0x30f7('0xdd')]=function(_0x45e70c){logger[_0x30f7('0xde')](util[_0x30f7('0x2a')](_0x30f7('0xdf'),_0x45e70c['label']));if(!this['isConfigured'](_0x45e70c[_0x30f7('0xe0')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x45e70c,'no\x20user\x20selected');}var _0xb540f3=this['getUser'][_0x30f7('0x72')](this,_0x45e70c[_0x30f7('0xe0')]);if(!_0xb540f3){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x45e70c,'no\x20user\x20found');}var _0xc4772d=this[_0x30f7('0xd')][_0x30f7('0x59')](_0x30f7('0xe1'),[util[_0x30f7('0x2a')]('SIP/%s',_0xb540f3),_0x45e70c[_0x30f7('0x68')],_0x45e70c[_0x30f7('0xe2')],_0x45e70c[_0x30f7('0x66')]]);if(_0xc4772d[_0x30f7('0xa4')]===-0x1){return _0xc4772d;}return this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xe3'),_0x30f7('0xe1')));};AGIVertices['prototype'][_0x30f7('0xe4')]=function(_0x4511f7){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0xe5'),_0x4511f7[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x4511f7[_0x30f7('0x7a')])){return this['channel'][_0x30f7('0xab')](_0x30f7('0xe6'));}if(!this[_0x30f7('0x86')](_0x4511f7[_0x30f7('0x5f')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xc4'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x4511f7);this[_0x30f7('0x44')](_0x4511f7[_0x30f7('0x5f')],'in','','');this[_0x30f7('0xd')][_0x30f7('0xab')](util['format']('Trying\x20Dialogflow:\x20%s',_0x4511f7[_0x30f7('0x5f')]));var _0x1173e1=this[_0x30f7('0x79')]['sync'](this,_0x4511f7);if(_0x1173e1){for(var _0x2b3c53 in _0x1173e1){if(_0x1173e1[_0x30f7('0x98')](_0x2b3c53)){this[_0x30f7('0xd')][_0x30f7('0xa1')](util[_0x30f7('0x2a')](_0x30f7('0xe7'),_0x2b3c53[_0x30f7('0x6c')]()),_0x1173e1[_0x2b3c53]);}}this[_0x30f7('0x44')](_0x1173e1[_0x30f7('0xe8')],_0x30f7('0xe9'),_0x30f7('0xe4'),'');return this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')]('Dialogflow\x20Result\x20%s',_0x1173e1['speech']));}return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x4511f7,_0x30f7('0xea'));};AGIVertices['prototype'][_0x30f7('0xeb')]=function(_0x32bb26){logger[_0x30f7('0x2e')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x32bb26[_0x30f7('0x37')]));if(!this['isConfigured'](_0x32bb26[_0x30f7('0x7c')])){return this['channel'][_0x30f7('0xab')]('no\x20project_id\x20configured');}if(!this[_0x30f7('0x86')](_0x32bb26[_0x30f7('0x7d')])){return this[_0x30f7('0xd')][_0x30f7('0xab')]('no\x20client_email\x20configured');}if(!this[_0x30f7('0x86')](_0x32bb26['private_key'])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xec'));}if(!this[_0x30f7('0x86')](_0x32bb26[_0x30f7('0x7f')])){return this[_0x30f7('0xd')]['noop'](_0x30f7('0xed'));}if(!this[_0x30f7('0x86')](_0x32bb26[_0x30f7('0x5f')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xc4'));}this[_0x30f7('0xd')][_0x30f7('0xee')]=!![];this[_0x30f7('0x36')](_0x32bb26);this[_0x30f7('0x44')](_0x32bb26[_0x30f7('0x5f')],'in','','');this['channel']['noop'](util[_0x30f7('0x2a')]('Trying\x20DialogflowV2:\x20%s',_0x32bb26['text']));var _0x529802=this[_0x30f7('0x7b')]['sync'](this,_0x32bb26);if(_0x529802){for(var _0x424061 in _0x529802){if(_0x529802[_0x30f7('0x98')](_0x424061)){if(_0x424061!==_0x30f7('0xef')){this['channel']['setVariable'](util[_0x30f7('0x2a')](_0x30f7('0xe7'),_0x424061['toUpperCase']()),_0x529802[_0x424061]);}}}this[_0x30f7('0x44')](_0x529802[_0x30f7('0xe8')],'out',_0x30f7('0xeb'),_0x529802[_0x30f7('0xef')]);return this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xf0'),_0x529802[_0x30f7('0xe8')]));}return this[_0x30f7('0xd')]['error'](_0x32bb26,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x30f7('0xf1')]=function(_0x13eec9){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0xf2'),_0x13eec9['label']));if(!this[_0x30f7('0x86')](_0x13eec9[_0x30f7('0xf3')])){return this[_0x30f7('0xd')]['noop'](_0x30f7('0xf4'));}if(!this['isConfigured'](_0x13eec9[_0x30f7('0xf5')])){return this['channel'][_0x30f7('0xab')](_0x30f7('0xf6'));}if(!this[_0x30f7('0x86')](_0x13eec9['password'])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xf7'));}if(!this[_0x30f7('0x86')](_0x13eec9[_0x30f7('0xf8')])){return this[_0x30f7('0xd')]['noop'](_0x30f7('0xc4'));}this[_0x30f7('0xd')][_0x30f7('0xee')]=!![];this['createSquareDetailsReport'](_0x13eec9);this[_0x30f7('0x44')](_0x13eec9[_0x30f7('0x5f')],'in','','');this['channel'][_0x30f7('0xab')](util['format'](_0x30f7('0xf9'),_0x13eec9['text']));var _0x1c8906=this[_0x30f7('0x80')][_0x30f7('0x72')](this,_0x13eec9);if(_0x1c8906){for(var _0x17638b in _0x1c8906){if(_0x1c8906[_0x30f7('0x98')](_0x17638b)){this[_0x30f7('0xd')]['setVariable'](util[_0x30f7('0x2a')]('SESTEK_NDA_%s',_0x17638b[_0x30f7('0x6c')]()),_0x1c8906[_0x17638b]);}}this[_0x30f7('0x44')](_0x1c8906[_0x30f7('0xe8')],_0x30f7('0xe9'),_0x30f7('0xf1'),'');if(_0x1c8906[_0x30f7('0xfa')]){this[_0x30f7('0xd')][_0x30f7('0xab')](util['format'](_0x30f7('0xfb'),_0x1c8906['audiofile']));var _0x231d63=this[_0x30f7('0xd')][_0x30f7('0xfc')](_0x1c8906[_0x30f7('0xfa')]);try{fs[_0x30f7('0xfd')](_0x1c8906[_0x30f7('0xfa')]+_0x30f7('0xfe'));}catch(_0x3769f0){logger['error'](_0x3769f0);}return _0x231d63;}else{return this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')](_0x30f7('0xff'),_0x1c8906[_0x30f7('0xe8')]));}}return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x13eec9,_0x30f7('0x100'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x101')]=function(_0x2a5274){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2a5274[_0x30f7('0x37')]));return this['channel'][_0x30f7('0xab')](_0x30f7('0x101'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x102')]=function(_0x5a0988){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x103'),_0x5a0988[_0x30f7('0x37')]));var _0x271cec='';if(_0x5a0988[_0x30f7('0x104')]){if(!this[_0x30f7('0x86')](_0x5a0988['trunk_id'])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x5a0988,'no\x20trunk\x20selected');}else{var _0x3b1329=parseInt(_0x5a0988['trunk_id'],0xa);if(isNaN(_0x3b1329)){_0x271cec=_0x5a0988[_0x30f7('0x104')];}else{_0x271cec=this['getTrunk'][_0x30f7('0x72')](this,_0x5a0988[_0x30f7('0x104')]);if(!_0x271cec){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x5a0988,_0x30f7('0x105'));}}}}else if(_0x5a0988[_0x30f7('0x106')]){_0x271cec=_0x5a0988[_0x30f7('0x106')];}else{return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x5a0988,_0x30f7('0x107'));}var _0x2d9d2=this[_0x30f7('0xd')]['exec'](_0x30f7('0xe1'),[util[_0x30f7('0x2a')](_0x30f7('0x108'),_0x271cec,_0x5a0988[_0x30f7('0x4a')]),_0x5a0988[_0x30f7('0x68')],_0x5a0988[_0x30f7('0xe2')],_0x5a0988[_0x30f7('0x66')]]);if(_0x2d9d2[_0x30f7('0xa4')]===-0x1){return _0x2d9d2;}return this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')](_0x30f7('0xe3'),_0x30f7('0xe1')));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x109')]=function(_0x95745a){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x95745a[_0x30f7('0x37')]));return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x109'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0xc')]=function(_0x10b512){logger['info'](util[_0x30f7('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x10b512[_0x30f7('0x37')]));if(_0x10b512['retry']===0x0){return this[_0x30f7('0xa7')](_0x10b512);}_0x10b512['retry']-=0x1;if(!this[_0x30f7('0x86')](_0x10b512['file_id'])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x10b512,'no\x20file\x20audio\x20selected');}var _0x222b4b=this[_0x30f7('0x1f')][_0x30f7('0x72')](this,_0x10b512[_0x30f7('0x10a')]);if(!_0x222b4b){return this[_0x30f7('0xd')]['error'](_0x10b512,_0x30f7('0x10b'));}if(!this[_0x30f7('0x86')](_0x10b512['variable_id'])){return this[_0x30f7('0xd')][_0x30f7('0x2d')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x10f29f=this[_0x30f7('0xd')][_0x30f7('0x10c')](_0x222b4b,_0x10b512['response'],_0x10b512[_0x30f7('0x10d')]);var _0x2d9c07=_0x10f29f[_0x30f7('0xa4')]?_0x10f29f[_0x30f7('0xa4')][_0x30f7('0x4e')]():'';logger[_0x30f7('0x2e')](_0x30f7('0x10e'),JSON[_0x30f7('0x74')](_0x10f29f));if(_0x10f29f['result']===-0x1){this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x10b512,_0x2d9c07);return _0x10f29f;}else if(_0x10f29f[_0x30f7('0xa6')]==='timeout'){_0x10f29f[_0x30f7('0xa4')]=_0x2d9c07[_0x30f7('0x9e')]>=parseInt(_0x10b512[_0x30f7('0x10f')])?'x':'i';}else{_0x10f29f[_0x30f7('0xa4')]=_0x2d9c07[_0x30f7('0x9e')]>=parseInt(_0x10b512['mindigit'])&&_0x2d9c07[_0x30f7('0x9e')]<=parseInt(_0x10b512['maxdigit'])?'x':'i';}var _0x1371ee=this[_0x30f7('0xf')][_0x30f7('0x72')](this,_0x10b512[_0x30f7('0xd8')]);if(!_0x1371ee){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x10b512,_0x30f7('0x110'));}this[_0x30f7('0xd')][_0x30f7('0xa1')](_0x1371ee,_0x2d9c07);if(this[_0x30f7('0x86')](_0x10b512[_0x30f7('0x111')])){var _0x4031cd=parseInt(_0x10b512[_0x30f7('0x111')],0xa);var _0x76d822=rs[_0x30f7('0x112')]({'charset':'*','length':_0x4031cd});var _0x29350f=_0x2d9c07['length'];if(_0x29350f>0x0){if(_0x29350f>_0x4031cd){this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x10b512,_0x10b512['hiddendigitspos']==='first'?_0x76d822+_0x2d9c07[_0x30f7('0x113')](_0x4031cd):_0x2d9c07[_0x30f7('0x113')](0x0,_0x29350f-_0x4031cd)+_0x76d822);}else{this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x10b512,rs['generate']({'charset':'*','length':_0x29350f}));}}else{this['createSquareDetailsReport']['sync'](this,_0x10b512,'');}}else{this[_0x30f7('0x36')]['sync'](this,_0x10b512,_0x2d9c07);}return _0x10f29f;};AGIVertices['prototype'][_0x30f7('0x114')]=function(_0x5e43b1){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x115'),_0x5e43b1[_0x30f7('0x37')]));return this[_0x30f7('0xc')](_0x5e43b1);};AGIVertices[_0x30f7('0xe')][_0x30f7('0x116')]=function(_0x325097){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x325097[_0x30f7('0x37')]));this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x325097,_0x325097[_0x30f7('0x117')]);return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x118'),_0x325097[_0x30f7('0x117')]));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x119')]=function(_0x476f08){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x11a'),_0x476f08[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x476f08[_0x30f7('0x89')])||!this['isConfigured'](_0x476f08[_0x30f7('0x8a')])){return this[_0x30f7('0xd')][_0x30f7('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x476f08['text'])){return this[_0x30f7('0xd')][_0x30f7('0xab')]('no\x20text\x20configured');}this[_0x30f7('0xd')]['noop'](util['format'](_0x30f7('0x11b'),_0x476f08[_0x30f7('0x5f')]));var _0xc7504b=this['awsPolly'][_0x30f7('0x72')](this,_0x476f08);if(_0xc7504b){this[_0x30f7('0xd')][_0x30f7('0xab')](util['format'](_0x30f7('0x11c'),_0xc7504b));var _0x583ed7=this[_0x30f7('0xd')][_0x30f7('0xfc')](_0xc7504b);try{fs[_0x30f7('0xfd')](_0xc7504b+'.wav');}catch(_0x5db9e1){logger['error'](_0x5db9e1);}return _0x583ed7;}return this['channel'][_0x30f7('0x2d')](_0x476f08,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x30f7('0xe')][_0x30f7('0x11d')]=function(_0x5cc4c6){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5cc4c6[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x5cc4c6[_0x30f7('0x89')])||!this[_0x30f7('0x86')](_0x5cc4c6[_0x30f7('0x8a')])){return this['channel']['noop'](_0x30f7('0x11e'));}if(!this[_0x30f7('0x86')](_0x5cc4c6[_0x30f7('0x90')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x11f'));}if(!this[_0x30f7('0x86')](_0x5cc4c6[_0x30f7('0x5f')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xc4'));}this[_0x30f7('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x5cc4c6);this[_0x30f7('0x44')](_0x5cc4c6[_0x30f7('0x5f')],'in','','');this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5cc4c6['text']));var _0x520f98=this[_0x30f7('0x8e')][_0x30f7('0x72')](this,_0x5cc4c6);if(_0x520f98){for(var _0x4e9094 in _0x520f98){if(_0x520f98[_0x30f7('0x98')](_0x4e9094)&&_[_0x30f7('0x99')](_0x520f98[_0x4e9094])){this[_0x30f7('0xd')][_0x30f7('0xa1')](util[_0x30f7('0x2a')](_0x30f7('0x120'),_0x4e9094[_0x30f7('0x6c')]()),_0x520f98[_0x4e9094]);}}if(_[_0x30f7('0x47')](_0x520f98['message'])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x121'));}else{this[_0x30f7('0x44')](_0x520f98['message'],_0x30f7('0xe9'),_0x30f7('0x122'),'');return this['channel'][_0x30f7('0xab')](util['format'](_0x30f7('0x123'),_0x520f98['message']));}}return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x5cc4c6,_0x30f7('0x124'));};AGIVertices['prototype'][_0x30f7('0x125')]=function(_0x4676f3){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x126'),_0x4676f3[_0x30f7('0x37')],_0x4676f3[_0x30f7('0x68')]));if(!this[_0x30f7('0x86')](_0x4676f3[_0x30f7('0x7a')])){return this[_0x30f7('0xd')][_0x30f7('0xab')]('no\x20key\x20configured');}var _0x2801e5=_0x30f7('0x127');var _0x3804d6=util[_0x30f7('0x2a')](_0x30f7('0x128'),FILES_PATH,rs[_0x30f7('0x112')](0x4));var _0x5a2382=util[_0x30f7('0x2a')](_0x30f7('0xa0'),_0x3804d6,_0x2801e5);var _0x593a6b=!![];if(_0x4676f3[_0x30f7('0x129')]===_0x30f7('0x12a')){_0x593a6b=![];}var _0x4a0739=this[_0x30f7('0xd')]['recordFile'](_0x3804d6,_0x2801e5,_0x4676f3[_0x30f7('0x12b')],_0x4676f3[_0x30f7('0x68')],undefined,_0x593a6b);if(_0x4a0739['result']!==-0x1){this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')]('google\x20%s\x20file\x20created',_0x5a2382));var _0x376523=this[_0x30f7('0x91')][_0x30f7('0x72')](this,_0x4676f3,_0x5a2382);if(_0x376523){for(var _0xd94b14 in _0x376523){if(_0x376523[_0x30f7('0x98')](_0xd94b14)){this[_0x30f7('0xd')][_0x30f7('0xa1')](util[_0x30f7('0x2a')]('GOOGLE_ASR_%s',_0xd94b14[_0x30f7('0x6c')]()),_0x376523[_0xd94b14]);}}return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x12c'),JSON[_0x30f7('0x74')](_0x376523)));}}return _0x4a0739;};AGIVertices[_0x30f7('0xe')][_0x30f7('0x12d')]=function(_0x338fa6){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x12e'),_0x338fa6[_0x30f7('0x37')]));if(!this['isConfigured'](_0x338fa6['appid'])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x12f'));}if(!this[_0x30f7('0x86')](_0x338fa6[_0x30f7('0x130')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x131'));}var _0x2faefe=_0x30f7('0x127');var _0x14c9e5=util[_0x30f7('0x2a')](_0x30f7('0x128'),FILES_PATH,rs[_0x30f7('0x112')](0x4));var _0x756995=util['format'](_0x30f7('0xa0'),_0x14c9e5,_0x2faefe);var _0x875513=!![];if(_0x338fa6['beep']===_0x30f7('0x12a')){_0x875513=![];}var _0x1acb80=this[_0x30f7('0xd')][_0x30f7('0x132')](_0x14c9e5,_0x2faefe,_0x338fa6['intKey'],_0x338fa6[_0x30f7('0x68')],undefined,_0x875513);if(_0x1acb80[_0x30f7('0xa4')]!==-0x1){this[_0x30f7('0xd')][_0x30f7('0xab')](util['format'](_0x30f7('0x133'),_0x756995));var _0x3d27fa=this[_0x30f7('0x93')][_0x30f7('0x72')](this,_0x338fa6,_0x756995);if(_0x3d27fa){for(var _0x49202e in _0x3d27fa){if(_0x3d27fa[_0x30f7('0x98')](_0x49202e)){this['channel'][_0x30f7('0xa1')](util['format']('TILDE_ASR_%s',_0x49202e[_0x30f7('0x6c')]()),_0x3d27fa[_0x49202e]);}}return this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')](_0x30f7('0x134'),JSON[_0x30f7('0x74')](_0x3d27fa)));}}return _0x1acb80;};AGIVertices['prototype'][_0x30f7('0x135')]=function(_0x4f22cc){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x136'),_0x4f22cc['label']));return this['channel'][_0x30f7('0x137')](_0x4f22cc[_0x30f7('0x3e')],_0x4f22cc[_0x30f7('0x3f')],_0x4f22cc[_0x30f7('0x40')]);};AGIVertices[_0x30f7('0xe')]['gotoif']=function(_0x37c3df){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x138'),_0x37c3df[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x37c3df[_0x30f7('0x139')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x37c3df,_0x30f7('0x13a'));}try{var _0x17382d=eval(_0x37c3df[_0x30f7('0x139')])?_0x30f7('0x13b'):_0x30f7('0x13c');this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x13d'),_0x37c3df[_0x30f7('0x139')],_0x17382d));return{'code':0xc8,'result':_0x17382d};}catch(_0x5e2193){return{'code':0xc8,'result':_0x30f7('0x13c')};}};AGIVertices[_0x30f7('0xe')]['gotoiftime']=function(_0x1b4d16){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x13e'),_0x1b4d16[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x1b4d16[_0x30f7('0x13f')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x1b4d16,_0x30f7('0x140'));}var _0x186fa3=this[_0x30f7('0x25')]['sync'](this,_0x1b4d16[_0x30f7('0x13f')]);if(!_0x186fa3){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x1b4d16,_0x30f7('0x141'));}for(var _0x3a3c00=0x0;_0x3a3c00<_0x186fa3[_0x30f7('0x9e')];_0x3a3c00+=0x1){var _0x1db24a=this['channel'][_0x30f7('0xf')](util[_0x30f7('0x2a')](_0x30f7('0x142'),_0x186fa3[_0x3a3c00]));if(_0x1db24a['result']===-0x1){return _0x1db24a;}logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x143'),_0x186fa3[_0x3a3c00],_0x1db24a[_0x30f7('0xa6')]));if(_0x1db24a[_0x30f7('0xa6')]==='true'){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x143'),_0x186fa3[_0x3a3c00],_0x30f7('0x13b')));this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x143'),_0x186fa3[_0x3a3c00],_0x30f7('0x13b')));return{'code':0xc8,'result':_0x30f7('0x13b')};}else{logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x143'),_0x186fa3[_0x3a3c00],_0x30f7('0x13c')));this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x143'),_0x186fa3[_0x3a3c00],_0x30f7('0x13c')));}}return{'code':0xc8,'result':_0x30f7('0x13c')};};AGIVertices[_0x30f7('0xe')][_0x30f7('0x144')]=function(_0x154475){logger[_0x30f7('0x2e')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x154475['label']));return this[_0x30f7('0xd')]['hangup']();};AGIVertices[_0x30f7('0xe')]['ispeechasr']=function(_0x11ee34){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x145'),_0x11ee34[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x11ee34[_0x30f7('0x7a')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xe6'));}var _0x2e9a77=_0x30f7('0x127');var _0xa4bcb=util['format'](_0x30f7('0x128'),FILES_PATH,rs['generate'](0x4));var _0x3cfa24=util[_0x30f7('0x2a')](_0x30f7('0xa0'),_0xa4bcb,_0x2e9a77);var _0x32b0a1=!![];if(_0x11ee34[_0x30f7('0x129')]===_0x30f7('0x12a')){_0x32b0a1=![];}var _0x44f430=this['channel'][_0x30f7('0x132')](_0xa4bcb,_0x2e9a77,_0x11ee34[_0x30f7('0x12b')],_0x11ee34[_0x30f7('0x68')],undefined,_0x32b0a1);if(_0x44f430[_0x30f7('0xa4')]!==-0x1){this[_0x30f7('0xd')]['noop'](util['format'](_0x30f7('0x146'),_0x3cfa24));var _0x1460f8=this['ispeechASR'][_0x30f7('0x72')](this,_0x11ee34,_0x3cfa24);if(_0x1460f8){for(var _0x48d1c3 in _0x1460f8){if(_0x1460f8['hasOwnProperty'](_0x48d1c3)){this[_0x30f7('0xd')][_0x30f7('0xa1')](util['format'](_0x30f7('0x147'),_0x48d1c3[_0x30f7('0x6c')]()),_0x1460f8[_0x48d1c3]);}}return this[_0x30f7('0xd')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x30f7('0x74')](_0x1460f8)));}}return _0x44f430;};AGIVertices[_0x30f7('0xe')][_0x30f7('0x148')]=function(_0xd5234a){logger['info'](util[_0x30f7('0x2a')](_0x30f7('0x149'),_0xd5234a[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0xd5234a[_0x30f7('0x7a')])){return this[_0x30f7('0xd')][_0x30f7('0xab')]('no\x20key\x20configured');}if(!this[_0x30f7('0x86')](_0xd5234a[_0x30f7('0x5f')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xc4'));}this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x14a'),_0xd5234a[_0x30f7('0x5f')]));var _0x1c368a=this[_0x30f7('0x81')][_0x30f7('0x72')](this,_0xd5234a);if(_0x1c368a){this[_0x30f7('0xd')]['noop'](util['format'](_0x30f7('0x146'),_0x1c368a));var _0x13eb41=this[_0x30f7('0xd')]['streamFile'](_0x1c368a,_0xd5234a[_0x30f7('0x12b')]);try{fs['unlink'](_0x1c368a+_0x30f7('0xfe'));}catch(_0x40453f){logger[_0x30f7('0x2d')](_0x40453f);}return _0x13eb41;}return this[_0x30f7('0xd')]['error'](_0xd5234a,_0x30f7('0x14b'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x14c')]=function(_0x417ea6){logger['info'](util[_0x30f7('0x2a')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x417ea6[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x417ea6[_0x30f7('0x14d')])){return this['channel'][_0x30f7('0x2d')](_0x417ea6,_0x30f7('0x14e'));}logger[_0x30f7('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x417ea6[_0x30f7('0x14d')]));var _0x475a7f=this[_0x30f7('0x56')][_0x30f7('0x72')](this,_0x417ea6['findBy']);if(_0x475a7f){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x14f'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x417ea6[_0x30f7('0x14d')]));this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x14f'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x417ea6[_0x30f7('0x14d')]));return{'code':0xc8,'result':_0x30f7('0x150')};}else{logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x151'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x417ea6['findBy']));this[_0x30f7('0xd')][_0x30f7('0xab')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x30f7('0x3a')],_0x417ea6['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x30f7('0xe')][_0x30f7('0x152')]=function(_0x489b97){logger['info'](util[_0x30f7('0x2a')](_0x30f7('0x153'),_0x489b97[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x489b97[_0x30f7('0x14d')])){return this['channel'][_0x30f7('0x2d')](_0x489b97,_0x30f7('0x14e'));}logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x489b97[_0x30f7('0x14d')]));var _0x22dbb6=this['agentLogout'][_0x30f7('0x72')](this,_0x489b97[_0x30f7('0x14d')]);if(_0x22dbb6){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x14f'),this[_0x30f7('0xd')]['callerid'],_0x489b97[_0x30f7('0x14d')]));this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')](_0x30f7('0x14f'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x489b97[_0x30f7('0x14d')]));return{'code':0xc8,'result':_0x30f7('0x150')};}else{logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x151'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x489b97[_0x30f7('0x14d')]));this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x151'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x489b97[_0x30f7('0x14d')]));return{'code':0xc8,'result':_0x30f7('0x154')};}};AGIVertices[_0x30f7('0xe')][_0x30f7('0x155')]=function(_0x30dbe1){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x156'),_0x30dbe1['label']));if(!this[_0x30f7('0x86')](_0x30dbe1[_0x30f7('0x157')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x30dbe1,_0x30f7('0x158'));}this['channel']['noop'](util[_0x30f7('0x2a')](_0x30f7('0x159'),_0x30dbe1['operation']));var _0x5379f2=eval(_0x30dbe1[_0x30f7('0x157')]);if(!this['isConfigured'](_0x30dbe1['variable_id'])){return this['channel'][_0x30f7('0xab')](_0x30f7('0xd7'));}var _0xdb4adf=this[_0x30f7('0xf')][_0x30f7('0x72')](this,_0x30dbe1[_0x30f7('0xd8')]);if(!_0xdb4adf){return this['channel'][_0x30f7('0x2d')](_0x30dbe1,'no\x20variable\x20found');}if(_[_0x30f7('0x9d')](_0x5379f2)){var _0x4b26ea=this;_0x5379f2[_0x30f7('0xd9')](function(_0x5f5cce,_0x4397cf){_0x4b26ea['channel'][_0x30f7('0xa1')](util['format'](_0x30f7('0x15a'),_0xdb4adf,_0x4397cf),_0x5f5cce);});return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x15b'),_0xdb4adf));}else{return this[_0x30f7('0xd')]['setVariable'](_0xdb4adf,_0x5379f2);}};AGIVertices[_0x30f7('0xe')][_0x30f7('0xb')]=function(_0x58fcd8){logger[_0x30f7('0x2e')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x58fcd8['label']));if(_0x58fcd8['retry']===0x0){return this[_0x30f7('0xa7')](_0x58fcd8);}_0x58fcd8[_0x30f7('0xa8')]-=0x1;if(!this[_0x30f7('0x86')](_0x58fcd8[_0x30f7('0x10a')])){return this['channel']['error'](_0x58fcd8,_0x30f7('0x15c'));}var _0x4d2174=this[_0x30f7('0x1f')]['sync'](this,_0x58fcd8['file_id']);if(!_0x4d2174){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x58fcd8,'no\x20file\x20audio\x20found');}var _0x5e4a55=this[_0x30f7('0xd')][_0x30f7('0x10c')](_0x4d2174,_0x58fcd8[_0x30f7('0x15d')],_0x58fcd8['digit']);var _0x58617e=_0x5e4a55['result'];if(_0x5e4a55[_0x30f7('0xa4')]===-0x1){this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x58fcd8,'-1');return _0x5e4a55;}else if(_0x5e4a55[_0x30f7('0xa6')]===_0x30f7('0x68')){_0x5e4a55[_0x30f7('0xa4')]=_0x5e4a55['result'][_0x30f7('0x9e')]>0x0?_0x5e4a55[_0x30f7('0xa4')]:'t';}else if(_[_0x30f7('0x46')](_0x5e4a55[_0x30f7('0xa4')])){_0x5e4a55[_0x30f7('0xa4')]='#';_0x58617e='#';}if(!this[_0x30f7('0x86')](_0x58fcd8['variable_id'])){this[_0x30f7('0xd')]['noop'](_0x30f7('0xd7'));}else{var _0x324f05=this[_0x30f7('0xf')][_0x30f7('0x72')](this,_0x58fcd8[_0x30f7('0xd8')]);if(!_0x324f05){return this[_0x30f7('0xd')]['error'](_0x58fcd8,'no\x20variable\x20found');}this[_0x30f7('0xd')]['setVariable'](_0x324f05,_0x58617e);}this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x58fcd8,_0x58617e);return _0x5e4a55;};AGIVertices[_0x30f7('0xe')][_0x30f7('0xab')]=function(_0x4efc12){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x15e'),_0x4efc12[_0x30f7('0x37')]));return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x4efc12[_0x30f7('0x15f')]||_0x4efc12['label']);};AGIVertices[_0x30f7('0xe')][_0x30f7('0x160')]=function(_0x579d73){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x161'),_0x579d73[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x579d73[_0x30f7('0x14d')])){return this[_0x30f7('0xd')]['error'](_0x579d73,_0x30f7('0x14e'));}logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x162'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x579d73[_0x30f7('0x14d')]));var _0x41fef1=this['getPause']['sync'](this,_0x579d73[_0x30f7('0x163')]);var _0xf56e15=this['agentPause'][_0x30f7('0x72')](this,_0x579d73[_0x30f7('0x14d')],_0x41fef1);if(_0xf56e15){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x14f'),this[_0x30f7('0xd')]['callerid'],_0x579d73[_0x30f7('0x14d')]));this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x14f'),this[_0x30f7('0xd')]['callerid'],_0x579d73[_0x30f7('0x14d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x151'),this[_0x30f7('0xd')]['callerid'],_0x579d73[_0x30f7('0x14d')]));this[_0x30f7('0xd')][_0x30f7('0xab')](util['format'](_0x30f7('0x14f'),this['channel']['callerid'],_0x579d73[_0x30f7('0x14d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x30f7('0xe')][_0x30f7('0x164')]=function(_0x19263f){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x165'),_0x19263f[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x19263f[_0x30f7('0x10a')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x19263f,_0x30f7('0x15c'));}var _0x45f07a=this[_0x30f7('0x1f')]['sync'](this,_0x19263f[_0x30f7('0x10a')]);if(!_0x45f07a){return this['channel'][_0x30f7('0x2d')](_0x19263f,_0x30f7('0x10b'));}var _0x2faf78=this[_0x30f7('0xd')][_0x30f7('0x59')](_0x30f7('0x166'),[_0x45f07a,_0x19263f[_0x30f7('0xe2')]]);if(_0x2faf78['result']===-0x1){return _0x2faf78;}return this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')](_0x30f7('0xc2'),_0x30f7('0x166'),_0x45f07a));};AGIVertices[_0x30f7('0xe')]['queue']=function(_0x53e055){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x167'),_0x53e055[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x53e055[_0x30f7('0x168')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x53e055,_0x30f7('0x169'));}var _0x439a76='';var _0x3ff2de=parseInt(_0x53e055[_0x30f7('0x168')],0xa);if(isNaN(_0x3ff2de)){_0x439a76=_0x53e055[_0x30f7('0x168')];}else{_0x439a76=this[_0x30f7('0x14')][_0x30f7('0x72')](this,_0x53e055[_0x30f7('0x168')]);if(!_0x439a76){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x53e055,'no\x20queue\x20found');}}var _0x1e9d12='';if(this[_0x30f7('0x86')](_0x53e055[_0x30f7('0x10a')])){var _0x1826e7=this[_0x30f7('0x1f')][_0x30f7('0x72')](this,_0x53e055[_0x30f7('0x10a')]);if(_0x1826e7){_0x1e9d12=_0x1826e7;}}this['createSquareDetailsReport'][_0x30f7('0x72')](this,_0x53e055,_0x439a76);if(_0x53e055[_0x30f7('0xe2')][_0x30f7('0x16a')]('x')<0x0){_0x53e055['opts']+='x';}if(_0x53e055['opts'][_0x30f7('0x16a')]('X')<0x0){_0x53e055['opts']+='X';}this[_0x30f7('0xd')]['setVariable'](_0x30f7('0x16b'),_0x439a76?_0x439a76[_0x30f7('0x16c')]():'');var _0x5aa5eb=this['channel'][_0x30f7('0x59')]('QUEUE',[_0x439a76,_0x53e055[_0x30f7('0xe2')],_0x53e055[_0x30f7('0x66')],_0x1e9d12,_0x53e055[_0x30f7('0x68')],_0x53e055[_0x30f7('0x7')],_0x53e055[_0x30f7('0x16d')],_0x53e055[_0x30f7('0x16e')],'',_0x53e055[_0x30f7('0x16f')]]);if(_0x5aa5eb[_0x30f7('0xa4')]===-0x1){return _0x5aa5eb;}return this['channel']['noop'](util['format'](_0x30f7('0xc2'),_0x30f7('0x170'),_0x439a76));};AGIVertices['prototype']['record']=function(_0x111981){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x171'),_0x111981['label']));var _0x1a4073=_0x111981[_0x30f7('0x172')]||_0x30f7('0x127');var _0xf131d1=util[_0x30f7('0x2a')](_0x30f7('0x173'),this[_0x30f7('0xd')][_0x30f7('0x3c')],rs[_0x30f7('0x112')](0x5));var _0x450ee5=util[_0x30f7('0x2a')]('%s/recordings/%s.%s',FILES_PATH,_0xf131d1,_0x1a4073);var _0x314de8=util[_0x30f7('0x2a')](_0x30f7('0x128'),FILES_PATH,_0xf131d1);this['createSquareRecording'][_0x30f7('0x72')](this,_0x111981,_0xf131d1,_0x450ee5);this[_0x30f7('0xd')][_0x30f7('0xa1')](_0x30f7('0x174'),_0xf131d1);logger[_0x30f7('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x314de8,_0x1a4073,_0x111981[_0x30f7('0x175')],_0x111981[_0x30f7('0x68')]);return this[_0x30f7('0xd')][_0x30f7('0x132')](_0x314de8,_0x1a4073,_0x111981['escape_digits'],_0x111981[_0x30f7('0x68')],undefined,!![]);};AGIVertices[_0x30f7('0xe')]['restapi']=function(_0x4b9694){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x176'),_0x4b9694[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x4b9694['url'])){return this['channel'][_0x30f7('0xab')](_0x30f7('0x177'));}var _0x1cdf72=this['restAPI'][_0x30f7('0x72')](this,_0x4b9694);logger['info'](util[_0x30f7('0x2a')](_0x30f7('0x178'),util[_0x30f7('0x179')](_0x1cdf72,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x4b9694[_0x30f7('0xd8')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x17a'));}var _0x34add4=this[_0x30f7('0xf')][_0x30f7('0x72')](this,_0x4b9694[_0x30f7('0xd8')]);if(!_0x34add4){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x4b9694,_0x30f7('0x110'));}this['channel']['setVariable'](util[_0x30f7('0x2a')](_0x30f7('0x17b'),_0x34add4),_0x1cdf72[_0x30f7('0x76')]?_0x1cdf72['statusCode']:_0x30f7('0x17c'));this[_0x30f7('0xd')][_0x30f7('0xa1')](util[_0x30f7('0x2a')](_0x30f7('0x17d'),_0x34add4),_0x1cdf72['statusMessage']?_0x1cdf72[_0x30f7('0x17e')]:'OK');if(_0x1cdf72[_0x30f7('0x6d')]){try{this[_0x30f7('0x9f')](_0x1cdf72[_0x30f7('0x6d')],_0x34add4);}catch(_0x99a964){logger[_0x30f7('0x2d')](util['format'](_0x30f7('0x17f'),_0x34add4));}}return this['channel']['noop'](util[_0x30f7('0x2a')]('variable\x20%s\x20set',_0x34add4));};AGIVertices['prototype'][_0x30f7('0x180')]=function(_0x3df09b){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x181'),_0x3df09b[_0x30f7('0x37')]));return this[_0x30f7('0xd')][_0x30f7('0x182')](_0x3df09b[_0x30f7('0x183')][_0x30f7('0x5b')](/\s+/g,''),_0x3df09b[_0x30f7('0x175')]);};AGIVertices[_0x30f7('0xe')][_0x30f7('0x184')]=function(_0x2aaaad){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x185'),_0x2aaaad[_0x30f7('0x37')]));return this[_0x30f7('0xd')][_0x30f7('0x186')](_0x2aaaad[_0x30f7('0x187')]['replace'](/\s+/g,''),_0x2aaaad['escape_digits']);};AGIVertices[_0x30f7('0xe')][_0x30f7('0x188')]=function(_0x42ca57){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x42ca57[_0x30f7('0x37')]));return this[_0x30f7('0xd')][_0x30f7('0x189')](_0x42ca57[_0x30f7('0x5f')],_0x42ca57['escape_digits']);};AGIVertices[_0x30f7('0xe')][_0x30f7('0x18a')]=function(_0x3ba6df){logger['info'](util[_0x30f7('0x2a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3ba6df[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x3ba6df[_0x30f7('0x18b')])){return this['channel']['noop'](_0x30f7('0x18c'));}var _0x6c2c9a=this[_0x30f7('0x23')]['sync'](this,_0x3ba6df[_0x30f7('0x18b')]);if(!_0x6c2c9a||!_0x6c2c9a['Smtp']){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x3ba6df,_0x30f7('0x18d'));}var _0x4486fa={'from':util[_0x30f7('0x2a')](_0x30f7('0x18e'),_0x6c2c9a[_0x30f7('0x12')],_0x6c2c9a[_0x30f7('0x18f')]||_0x6c2c9a[_0x30f7('0x190')][_0x30f7('0x191')]),'to':_0x3ba6df['to']||'','cc':_0x3ba6df['cc']||'','bcc':_0x3ba6df[_0x30f7('0x192')]||'','subject':_0x3ba6df[_0x30f7('0x193')],'html':_0x3ba6df['text'],'text':_0x3ba6df[_0x30f7('0x5f')]};if(this['isConfigured'](_0x3ba6df[_0x30f7('0x194')])){}logger[_0x30f7('0xde')](_0x30f7('0x195'),JSON[_0x30f7('0x74')](_0x4486fa));this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x3ba6df,_0x3ba6df[_0x30f7('0x18b')]);this['channel'][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x196'),_0x6c2c9a[_0x30f7('0x12')]));this['sendMailMessage'][_0x30f7('0x72')](this,_0x6c2c9a[_0x30f7('0x197')],_0x4486fa);return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x198'));};AGIVertices['prototype'][_0x30f7('0x199')]=function(_0x1b54f4){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1b54f4['label']));return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x19a'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x19b')]=function(_0x593195){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x19c'),_0x593195[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x593195[_0x30f7('0x19d')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x19e'));}var _0x3fca5c=this[_0x30f7('0x34')][_0x30f7('0x72')](this,_0x593195['sms_account_id']);if(!_0x3fca5c){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x593195,_0x30f7('0x19f'));}var _0x4d08e8={'body':_0x593195[_0x30f7('0x1a0')],'phone':_0x593195['to']||'','SmsAccountId':_0x3fca5c['id']};logger[_0x30f7('0xde')](_0x30f7('0x1a1'),JSON[_0x30f7('0x74')](_0x4d08e8));this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0x593195,_0x593195['sms_account_id']);this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x1a2'),_0x3fca5c['name']));this[_0x30f7('0x35')]['sync'](this,_0x4d08e8);return this[_0x30f7('0xd')]['noop'](_0x30f7('0x1a3'));};AGIVertices[_0x30f7('0xe')]['set']=function(_0x12028f){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x1a4'),_0x12028f['label']));if(!this[_0x30f7('0x86')](_0x12028f[_0x30f7('0xd8')])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x12028f,_0x30f7('0x1a5'));}var _0x3091ba=this['getVariable'][_0x30f7('0x72')](this,_0x12028f[_0x30f7('0xd8')]);if(!_0x3091ba){return this['channel'][_0x30f7('0x2d')](_0x12028f,_0x30f7('0x110'));}return this[_0x30f7('0xd')]['setVariable'](_0x3091ba,_0x12028f[_0x30f7('0x1a6')]);};AGIVertices['prototype'][_0x30f7('0x1a7')]=function(_0x3c0dbe){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x1a8'),_0x3c0dbe[_0x30f7('0x37')]));this['channel'][_0x30f7('0xab')](_0x30f7('0x1a9'));if(_0x3c0dbe['answer']===_0x30f7('0x1aa')){this['channel'][_0x30f7('0xab')]('Answer');return this[_0x30f7('0xd')][_0x30f7('0xb6')]();}return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0x1ab'));};AGIVertices[_0x30f7('0xe')]['subproject']=function(_0x45da6d){logger['info'](util[_0x30f7('0x2a')](_0x30f7('0x1ac'),_0x45da6d[_0x30f7('0x37')]));if(!this[_0x30f7('0x86')](_0x45da6d['project_id'])){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x45da6d,_0x30f7('0x1ad'));}var _0x46d3a1=this[_0x30f7('0x17')][_0x30f7('0x72')](this,_0x45da6d[_0x30f7('0x1ae')]);if(!this[_0x30f7('0x86')](_0x46d3a1)){return this[_0x30f7('0xd')]['error'](_0x45da6d,util[_0x30f7('0x2a')](_0x30f7('0x1af'),_0x45da6d[_0x30f7('0x1ae')]));}if(_0x46d3a1===this[_0x30f7('0xd')][_0x30f7('0x39')]){return this[_0x30f7('0xd')]['error'](_0x45da6d,_0x30f7('0x1b0'));}this['createSquareDetailsReport'][_0x30f7('0x72')](this,_0x45da6d,_0x46d3a1);var _0x4cd614=this[_0x30f7('0xd')][_0x30f7('0x59')](_0x30f7('0x1b1'),util[_0x30f7('0x2a')](_0x30f7('0x1b2'),config[_0x30f7('0x7')][_0x30f7('0x1b3')]||_0x30f7('0x1b4'),_0x46d3a1,this['channel'][_0x30f7('0x39')]));if(_0x4cd614[_0x30f7('0xa4')]===-0x1){return _0x4cd614;}return this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0xc2'),'AGI',_0x46d3a1));};AGIVertices['prototype']['system']=function(_0xf388a2){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x1b5'),_0xf388a2[_0x30f7('0x37')]));var _0x25b467=this[_0x30f7('0x1b6')][_0x30f7('0x72')](this,_0xf388a2[_0x30f7('0x1b7')]);this[_0x30f7('0x36')][_0x30f7('0x72')](this,_0xf388a2,_0xf388a2[_0x30f7('0x1b7')]);if(this['isConfigured'](_0xf388a2[_0x30f7('0xd8')])){var _0x23c31d=this[_0x30f7('0xf')][_0x30f7('0x72')](this,_0xf388a2['variable_id']);if(_0x23c31d){this[_0x30f7('0xd')]['setVariable'](_0x23c31d,_0x25b467);return this['channel']['noop'](util[_0x30f7('0x2a')](_0x30f7('0x1b8'),_0xf388a2[_0x30f7('0x1b7')],_0x23c31d));}}return this[_0x30f7('0xd')]['noop'](util[_0x30f7('0x2a')](_0x30f7('0x1b9'),_0xf388a2[_0x30f7('0x1b7')]));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x1ba')]=function(_0x3ce876){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x1bb'),_0x3ce876[_0x30f7('0x37')]));_0x3ce876[_0x30f7('0x5f')]=_0x3ce876[_0x30f7('0x5f')][_0x30f7('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3ce876[_0x30f7('0x5d')])){return this[_0x30f7('0xd')]['noop'](_0x30f7('0x1bc'));}if(!this['isConfigured'](_0x3ce876[_0x30f7('0x5f')])){return this[_0x30f7('0xd')][_0x30f7('0xab')](_0x30f7('0xc4'));}this['channel']['noop'](util[_0x30f7('0x2a')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x3ce876[_0x30f7('0x5f')]));var _0x163d48=this[_0x30f7('0x5c')]['sync'](this,_0x3ce876);if(_0x163d48){this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x1bd'),_0x163d48));var _0x5cd7d9=this[_0x30f7('0xd')][_0x30f7('0xfc')](_0x163d48);try{fs['unlink'](_0x163d48+_0x30f7('0xfe'));}catch(_0x565b5e){logger[_0x30f7('0x2d')](_0x565b5e);}return _0x5cd7d9;}return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x3ce876,_0x30f7('0x1be'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x1bf')]=function(_0x1381e3){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x1c0'),_0x1381e3['label']));_0x1381e3['text']=_0x1381e3[_0x30f7('0x5f')][_0x30f7('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x30f7('0x86')](_0x1381e3['text'])){return this['channel'][_0x30f7('0xab')](_0x30f7('0xc4'));}this[_0x30f7('0xd')][_0x30f7('0xab')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x1381e3[_0x30f7('0x5f')]));var _0x48fac0=this[_0x30f7('0x64')][_0x30f7('0x72')](this,_0x1381e3);if(_0x48fac0){this['channel'][_0x30f7('0xab')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x48fac0));var _0x4358a1=this[_0x30f7('0xd')]['streamFile'](_0x48fac0);try{fs[_0x30f7('0xfd')](_0x48fac0+_0x30f7('0xfe'));}catch(_0x1b03f5){logger['error'](_0x1b03f5);}return _0x4358a1;}return this['channel'][_0x30f7('0x2d')](_0x1381e3,_0x30f7('0x1c1'));};AGIVertices[_0x30f7('0xe')][_0x30f7('0x1c2')]=function(_0x415170){logger['info'](util[_0x30f7('0x2a')](_0x30f7('0x1c3'),_0x415170['label']));if(!this[_0x30f7('0x86')](_0x415170[_0x30f7('0x14d')])){return this[_0x30f7('0xd')]['error'](_0x415170,'no\x20find\x20by\x20configured');}logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x162'),this[_0x30f7('0xd')]['callerid'],_0x415170[_0x30f7('0x14d')]));var _0x20f93=this[_0x30f7('0x54')][_0x30f7('0x72')](this,_0x415170[_0x30f7('0x14d')]);if(_0x20f93){logger[_0x30f7('0x2e')](util['format'](_0x30f7('0x14f'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x415170['findBy']));this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x14f'),this[_0x30f7('0xd')]['callerid'],_0x415170['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x415170[_0x30f7('0x14d')]));this[_0x30f7('0xd')][_0x30f7('0xab')](util[_0x30f7('0x2a')](_0x30f7('0x151'),this[_0x30f7('0xd')][_0x30f7('0x3a')],_0x415170[_0x30f7('0x14d')]));return{'code':0xc8,'result':_0x30f7('0x154')};}};AGIVertices['prototype'][_0x30f7('0x1c4')]=function(_0x2d866b){logger[_0x30f7('0x2e')](util[_0x30f7('0x2a')](_0x30f7('0x1c5'),_0x2d866b[_0x30f7('0x37')]));var _0x41a977=this[_0x30f7('0xd')]['exec'](_0x30f7('0x1c6'),[_0x2d866b[_0x30f7('0x1c7')],_0x2d866b[_0x30f7('0x78')]]);if(_0x41a977[_0x30f7('0xa4')]===-0x1){return _0x41a977;}return this[_0x30f7('0xd')][_0x30f7('0xab')](util['format'](_0x30f7('0xc2'),'VOICEMAIL',_0x2d866b[_0x30f7('0x1c7')]));};AGIVertices[_0x30f7('0xe')]['vswitch']=function(_0x3cbdd4){logger['info'](util[_0x30f7('0x2a')](_0x30f7('0x1c8'),_0x3cbdd4['label']));if(!this['isConfigured'](_0x3cbdd4[_0x30f7('0xd8')])){return this['channel'][_0x30f7('0x2d')](_0x3cbdd4,'no\x20variable\x20selected');}var _0x18ae3e=this['getVariable'][_0x30f7('0x72')](this,_0x3cbdd4['variable_id']);if(!_0x18ae3e){return this[_0x30f7('0xd')][_0x30f7('0x2d')](_0x3cbdd4,_0x30f7('0x110'));}var _0x2a1805=this[_0x30f7('0xd')][_0x30f7('0xf')](_0x18ae3e);return{'code':0xc8,'result':_0x2a1805['extra']?_0x2a1805[_0x30f7('0xa6')]:'-'};};String[_0x30f7('0xe')][_0x30f7('0x1c9')]=function(_0x5b9af6,_0x5eb6ea){return this[_0x30f7('0xa2')](_0x5b9af6)[_0x30f7('0x1ca')](_0x5eb6ea);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 11a17a5..8fd130e 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 _0x2852=['[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','bind','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','info','attended','destlinkedid','savePause','acwTimeout','timer','lastPauseAt','format','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','prototype','queue','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause'];(function(_0x3a57b0,_0x23145a){var _0x2b8f3e=function(_0x1c721a){while(--_0x1c721a){_0x3a57b0['push'](_0x3a57b0['shift']());}};_0x2b8f3e(++_0x23145a);}(_0x2852,0x1d5));var _0x2285=function(_0x2d7e67,_0x44850d){_0x2d7e67=_0x2d7e67-0x0;var _0x5c41e1=_0x2852[_0x2d7e67];return _0x5c41e1;};'use strict';var _=require('lodash');var moment=require(_0x2285('0x0'));var ami=require(_0x2285('0x1'));var logger=require(_0x2285('0x2'))(_0x2285('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x128de7){this[_0x2285('0x4')]=_0x128de7[_0x2285('0x4')];this[_0x2285('0x5')]=_0x128de7[_0x2285('0x5')];this[_0x2285('0x6')]=_0x128de7[_0x2285('0x6')];this[_0x2285('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x2285('0x8'),this[_0x2285('0x9')]['bind'](this));ami['on'](_0x2285('0xa'),this[_0x2285('0xb')]['bind'](this));ami['on'](_0x2285('0xc'),this[_0x2285('0xd')][_0x2285('0xe')](this));ami['on']('attendedtransfer',this[_0x2285('0xf')][_0x2285('0xe')](this));ami['on']('blindtransfer',this[_0x2285('0x10')][_0x2285('0xe')](this));ami['on'](_0x2285('0x11'),this[_0x2285('0x12')][_0x2285('0xe')](this));}function getDiff(_0x15079a){var _0x139851=moment()[_0x2285('0x13')](0x0);var _0x57cc0b=moment(_0x15079a)[_0x2285('0x13')](0x0);return _0x139851[_0x2285('0x14')](_0x57cc0b,_0x2285('0x15'));}Acw['prototype'][_0x2285('0x16')]=function(_0x25cdb6){try{var _0x416871=this;var _0x2d15dc=this['channels'][_0x25cdb6][_0x2285('0x17')];var _0x107350=this[_0x2285('0x7')][_0x25cdb6]['queue'];var _0x54e808=this[_0x2285('0x4')][_0x107350];var _0x2ae2f8=![];var _0x245d33=_0x2285('0x18');if(_0x54e808[_0x2285('0x19')]){if(_0x54e808[_0x2285('0x1a')][_0x2285('0x1b')]){_0x2ae2f8=!![];_0x245d33=_0x54e808[_0x2285('0x1a')][_0x2285('0x1b')];}}return ami[_0x2285('0x1c')]({'action':_0x2285('0x1d'),'interface':_0x2d15dc,'paused':!![],'reason':_0x245d33})['then'](function(){if(_0x416871[_0x2285('0x5')][_0x2d15dc]){return RpcUser['getAgent'](_0x416871[_0x2285('0x5')][_0x2d15dc]['id'])[_0x2285('0x1e')](function(_0x583ecc){if(_0x583ecc&&!_0x583ecc['voicePause']){logger[_0x2285('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x25cdb6,_0x2d15dc,_0x107350);var _0x2360bc=_0x416871[_0x2285('0x7')][_0x25cdb6][_0x2285('0x20')]&&_0x416871[_0x2285('0x7')][_0x25cdb6][_0x2285('0x21')]?_0x416871[_0x2285('0x7')][_0x25cdb6][_0x2285('0x21')]:_0x25cdb6;return RpcUser[_0x2285('0x22')](_0x416871[_0x2285('0x5')][_0x2d15dc],_0x245d33,_0x2360bc)['then'](function(){if(!_0x2ae2f8){_0x416871['timers'][_0x2d15dc]={};logger[_0x2285('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x25cdb6,_0x416871[_0x2285('0x4')][_0x107350][_0x2285('0x23')],_0x2d15dc,_0x107350);_0x416871[_0x2285('0x6')][_0x2d15dc][_0x2285('0x24')]=setTimeout(_0x416871['stopAcw'][_0x2285('0xe')](_0x416871,_0x2d15dc),_0x416871[_0x2285('0x4')][_0x107350][_0x2285('0x23')]*0x3e8);_0x416871['timers'][_0x2d15dc][_0x2285('0x25')]=moment()[_0x2285('0x26')]('YYYY-MM-DD\x20HH:mm:ss');_0x416871['timers'][_0x2d15dc]['uniqueid']=_0x25cdb6;_0x416871[_0x2285('0x6')][_0x2d15dc]['queue']=_0x107350;_0x416871['timers'][_0x2d15dc][_0x2285('0x27')]=function(){var _0x351336=getDiff(_0x416871['timers'][_0x2d15dc][_0x2285('0x25')]);clearTimeout(_0x416871[_0x2285('0x6')][_0x2d15dc][_0x2285('0x24')]);_0x416871['timers'][_0x2d15dc]['timer']=![];RpcVoiceAgentReport[_0x2285('0x28')]({'acwtime':_0x351336},_0x416871[_0x2285('0x6')][_0x2d15dc][_0x2285('0x29')],_0x2d15dc)[_0x2285('0x1e')](function(_0xf36941){logger['info'](_0x2285('0x2a'),_0x25cdb6,_0x351336,_0xf36941);})[_0x2285('0x2b')](function(_0x53c8a1){logger[_0x2285('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x25cdb6,_0x53c8a1);});delete _0x416871[_0x2285('0x6')][_0x2d15dc];};}});}else{logger[_0x2285('0x1f')](_0x2285('0x2d'),_0x25cdb6,_0x2d15dc,_0x107350);}});}})[_0x2285('0x2b')](function(){logger[_0x2285('0x2c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x25cdb6,_0x416871[_0x2285('0x4')][_0x107350]['acwTimeout'],_0x2d15dc,_0x107350);})[_0x2285('0x2e')](function(){delete _0x416871[_0x2285('0x7')][_0x25cdb6];});}catch(_0x558808){logger[_0x2285('0x2c')]('[ACW][START]\x20%s',_0x558808[_0x2285('0x2f')]);}};Acw[_0x2285('0x30')]['stopAcw']=function(_0x2a1793){try{var _0x35e63a=this;if(_0x35e63a[_0x2285('0x6')][_0x2a1793]){_0x35e63a[_0x2285('0x6')][_0x2a1793][_0x2285('0x24')]=![];var _0x1e6ff8=_0x35e63a[_0x2285('0x6')][_0x2a1793][_0x2285('0x29')];var _0x2eec78=_0x35e63a[_0x2285('0x6')][_0x2a1793][_0x2285('0x31')];var _0x3e10b3=_0x35e63a[_0x2285('0x4')][_0x2eec78][_0x2285('0x23')];logger['info'](_0x2285('0x32'),_0x1e6ff8,_0x2a1793);RpcUser['saveUnpause'](this[_0x2285('0x5')][_0x2a1793]);RpcVoiceAgentReport[_0x2285('0x28')]({'acwtime':_0x3e10b3,'agentacw':!![]},_0x1e6ff8,_0x2a1793)[_0x2285('0x1e')](function(_0x9b276c){logger[_0x2285('0x1f')](_0x2285('0x2a'),_0x1e6ff8,_0x3e10b3,_0x9b276c);})[_0x2285('0x2b')](function(_0x113e3a){logger[_0x2285('0x2c')](_0x2285('0x33'),_0x1e6ff8,_0x113e3a);});}else{logger[_0x2285('0x2c')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x2a1793);if(_0x35e63a[_0x2285('0x6')]){logger[_0x2285('0x1f')](_0x2285('0x34'),JSON[_0x2285('0x35')](_0x35e63a[_0x2285('0x6')]));}}}catch(_0x2709c0){logger[_0x2285('0x2c')]('[ACW][STOP]\x20%s',_0x2709c0['message']);}};Acw['prototype'][_0x2285('0x36')]=function(_0x3fee1f){try{if(this[_0x2285('0x4')][_0x3fee1f[_0x2285('0x31')]]&&(this['voiceQueues'][_0x3fee1f['queue']][_0x2285('0x3')]||this['voiceQueues'][_0x3fee1f[_0x2285('0x31')]]['mandatoryDisposition'])){if(this[_0x2285('0x5')][_0x3fee1f[_0x2285('0x17')]]){this[_0x2285('0x7')][_0x3fee1f[_0x2285('0x29')]]={'queue':_0x3fee1f[_0x2285('0x31')],'interface':_0x3fee1f[_0x2285('0x17')],'destlinkedid':_0x3fee1f[_0x2285('0x21')]};}}}catch(_0x25c8ac){logger[_0x2285('0x2c')](_0x2285('0x37'),_0x25c8ac[_0x2285('0x2f')]);}};Acw['prototype'][_0x2285('0x12')]=function(_0x222507){try{if(this[_0x2285('0x4')][_0x222507['queue']]&&(this[_0x2285('0x4')][_0x222507[_0x2285('0x31')]][_0x2285('0x3')]||this[_0x2285('0x4')][_0x222507['queue']]['mandatoryDisposition'])){if(this[_0x2285('0x5')][_0x222507['interface']]){this[_0x2285('0x7')][_0x222507[_0x2285('0x29')]]={'queue':_0x222507['queue'],'interface':_0x222507[_0x2285('0x17')]};}}}catch(_0x12a8e9){logger[_0x2285('0x2c')](_0x2285('0x38'),_0x12a8e9['message']);}};Acw[_0x2285('0x30')][_0x2285('0x9')]=function(_0x2d9b59){try{if(this[_0x2285('0x7')][_0x2d9b59[_0x2285('0x29')]]&&_[_0x2285('0x39')](this['channels'][_0x2d9b59[_0x2285('0x29')]][_0x2285('0x20')])){logger[_0x2285('0x1f')](_0x2285('0x3a'),_0x2d9b59[_0x2285('0x29')]);this['startAcw'](_0x2d9b59[_0x2285('0x29')]);}else if(this[_0x2285('0x7')][_0x2d9b59[_0x2285('0x3b')]]&&_[_0x2285('0x39')](this['channels'][_0x2d9b59[_0x2285('0x3b')]]['attended'])){logger[_0x2285('0x1f')](_0x2285('0x3c'),_0x2d9b59[_0x2285('0x3b')]);this[_0x2285('0x16')](_0x2d9b59[_0x2285('0x3b')]);}}catch(_0x2740a0){logger[_0x2285('0x2c')](_0x2285('0x3d'),_0x2740a0['message']);}};Acw[_0x2285('0x30')][_0x2285('0xb')]=function(_0x31a897){try{if(this[_0x2285('0x7')][_0x31a897[_0x2285('0x29')]]&&this[_0x2285('0x7')][_0x31a897['uniqueid']][_0x2285('0x20')]){logger[_0x2285('0x1f')](_0x2285('0x3e'),_0x31a897[_0x2285('0x29')]);this['startAcw'](_0x31a897[_0x2285('0x29')]);}else if(this[_0x2285('0x7')][_0x31a897[_0x2285('0x3b')]]&&this[_0x2285('0x7')][_0x31a897[_0x2285('0x3b')]][_0x2285('0x20')]){logger[_0x2285('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x31a897[_0x2285('0x3b')]);this[_0x2285('0x16')](_0x31a897[_0x2285('0x3b')]);}}catch(_0x1a4614){logger[_0x2285('0x2c')](_0x2285('0x3f'),_0x1a4614[_0x2285('0x2f')]);}};Acw[_0x2285('0x30')][_0x2285('0xf')]=function(_0x2e4bfd){try{if(!_[_0x2285('0x40')](this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x41')]])){this[_0x2285('0x16')](_0x2e4bfd['transfereeuniqueid']);if(this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]]){this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]][_0x2285('0x20')]=!![];this[_0x2285('0x7')][_0x2e4bfd['transfertargetuniqueid']]=this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]];delete this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x42')]];}}else if(!_['isNil'](this[_0x2285('0x7')][_0x2e4bfd[_0x2285('0x43')]])){this[_0x2285('0x16')](_0x2e4bfd[_0x2285('0x43')]);if(this[_0x2285('0x7')][_0x2e4bfd['origtransfereruniqueid']]){this[_0x2285('0x7')][_0x2e4bfd['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x2e4bfd[_0x2285('0x41')]]=this['channels'][_0x2e4bfd['origtransfereruniqueid']];delete this[_0x2285('0x7')][_0x2e4bfd['origtransfereruniqueid']];}}}catch(_0x313a1a){logger[_0x2285('0x2c')](_0x2285('0x44'),_0x313a1a[_0x2285('0x2f')]);}};Acw['prototype'][_0x2285('0x10')]=function(_0x531b46){try{if(this[_0x2285('0x7')][_0x531b46[_0x2285('0x45')]]){logger['info'](_0x2285('0x46'),JSON[_0x2285('0x35')](_0x531b46[_0x2285('0x45')]));this[_0x2285('0x16')](_0x531b46[_0x2285('0x45')]);}else if(this[_0x2285('0x7')][_0x531b46['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x2285('0x35')](_0x531b46['transfererlinkedid']));this['startAcw'](_0x531b46[_0x2285('0x47')]);}}catch(_0x2de104){logger[_0x2285('0x2c')](_0x2285('0x48'),_0x2de104[_0x2285('0x2f')]);}};Acw[_0x2285('0x30')]['syncAgentRingNoAnswer']=function(_0x194490){try{if(this[_0x2285('0x4')][_0x194490['queue']]&&this[_0x2285('0x4')][_0x194490[_0x2285('0x31')]][_0x2285('0x49')]===_0x2285('0x4a')){if(this[_0x2285('0x5')][_0x194490['interface']]){logger['info'](_0x2285('0x4b'),_0x194490[_0x2285('0x29')],_0x194490[_0x2285('0x17')],_0x194490[_0x2285('0x31')]);return RpcUser[_0x2285('0x22')](this['agents'][_0x194490[_0x2285('0x17')]],_0x2285('0x4c'),_0x194490[_0x2285('0x29')]);}}}catch(_0x1891be){logger['error'](_0x2285('0x4d'),_0x1891be[_0x2285('0x2f')]);}};module['exports']=Acw; \ No newline at end of file +var _0xc041=['linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','queue','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined'];(function(_0x1f5873,_0x1497be){var _0x2a75d9=function(_0x16c497){while(--_0x16c497){_0x1f5873['push'](_0x1f5873['shift']());}};_0x2a75d9(++_0x1497be);}(_0xc041,0x67));var _0x1c04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc041[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1c04('0x0'));var moment=require(_0x1c04('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x1c04('0x2'));var RpcUser=require(_0x1c04('0x3'));var RpcVoiceAgentReport=require(_0x1c04('0x4'));function Acw(_0x21c3f2){this['voiceQueues']=_0x21c3f2[_0x1c04('0x5')];this[_0x1c04('0x6')]=_0x21c3f2[_0x1c04('0x6')];this[_0x1c04('0x7')]=_0x21c3f2[_0x1c04('0x7')];this[_0x1c04('0x8')]={};ami['on']('agentconnect',this[_0x1c04('0x9')][_0x1c04('0xa')](this));ami['on']('hanguprequest',this[_0x1c04('0xb')]['bind'](this));ami['on']('hangup',this[_0x1c04('0xc')][_0x1c04('0xa')](this));ami['on'](_0x1c04('0xd'),this['syncAgentRingNoAnswer'][_0x1c04('0xa')](this));ami['on'](_0x1c04('0xe'),this[_0x1c04('0xf')][_0x1c04('0xa')](this));ami['on']('blindtransfer',this[_0x1c04('0x10')][_0x1c04('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x1c04('0x11')]['bind'](this));}function getDiff(_0x1e6b05){var _0x2128fb=moment()[_0x1c04('0x12')](0x0);var _0xe8cdf=moment(_0x1e6b05)[_0x1c04('0x12')](0x0);return _0x2128fb[_0x1c04('0x13')](_0xe8cdf,_0x1c04('0x14'));}Acw[_0x1c04('0x15')][_0x1c04('0x16')]=function(_0x2f071f){try{var _0x27c5c1=this;var _0x340767=this[_0x1c04('0x8')][_0x2f071f][_0x1c04('0x17')];var _0x19c3be=this[_0x1c04('0x8')][_0x2f071f]['queue'];var _0x486e13=this['voiceQueues'][_0x19c3be];var _0x6e0a55=![];var _0x28f885='ACW';if(_0x486e13['mandatoryDisposition']){if(_0x486e13[_0x1c04('0x18')][_0x1c04('0x19')]){_0x6e0a55=!![];_0x28f885=_0x486e13[_0x1c04('0x18')][_0x1c04('0x19')];}}return ami[_0x1c04('0x1a')]({'action':_0x1c04('0x1b'),'interface':_0x340767,'paused':!![],'reason':_0x28f885})[_0x1c04('0x1c')](function(){if(_0x27c5c1[_0x1c04('0x6')][_0x340767]){return RpcUser[_0x1c04('0x1d')](_0x27c5c1['agents'][_0x340767]['id'])[_0x1c04('0x1c')](function(_0x4900c3){if(_0x4900c3&&!_0x4900c3[_0x1c04('0x1e')]){logger[_0x1c04('0x1f')](_0x1c04('0x20'),_0x2f071f,_0x340767,_0x19c3be);var _0x2fad56=_0x27c5c1['channels'][_0x2f071f][_0x1c04('0x21')]&&_0x27c5c1[_0x1c04('0x8')][_0x2f071f]['destlinkedid']?_0x27c5c1[_0x1c04('0x8')][_0x2f071f][_0x1c04('0x22')]:_0x2f071f;return RpcUser[_0x1c04('0x23')](_0x27c5c1[_0x1c04('0x6')][_0x340767],_0x28f885,_0x2fad56)['then'](function(){if(!_0x6e0a55){_0x27c5c1['timers'][_0x340767]={};logger[_0x1c04('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2f071f,_0x27c5c1[_0x1c04('0x5')][_0x19c3be][_0x1c04('0x24')],_0x340767,_0x19c3be);_0x27c5c1[_0x1c04('0x7')][_0x340767][_0x1c04('0x25')]=setTimeout(_0x27c5c1[_0x1c04('0x26')][_0x1c04('0xa')](_0x27c5c1,_0x340767),_0x27c5c1[_0x1c04('0x5')][_0x19c3be]['acwTimeout']*0x3e8);_0x27c5c1[_0x1c04('0x7')][_0x340767][_0x1c04('0x27')]=moment()[_0x1c04('0x28')](_0x1c04('0x29'));_0x27c5c1[_0x1c04('0x7')][_0x340767]['uniqueid']=_0x2f071f;_0x27c5c1[_0x1c04('0x7')][_0x340767]['queue']=_0x19c3be;_0x27c5c1[_0x1c04('0x7')][_0x340767][_0x1c04('0x2a')]=function(){var _0x561d99=getDiff(_0x27c5c1[_0x1c04('0x7')][_0x340767][_0x1c04('0x27')]);clearTimeout(_0x27c5c1['timers'][_0x340767][_0x1c04('0x25')]);_0x27c5c1[_0x1c04('0x7')][_0x340767][_0x1c04('0x25')]=![];RpcVoiceAgentReport[_0x1c04('0x2b')]({'acwtime':_0x561d99},_0x27c5c1['timers'][_0x340767][_0x1c04('0x2c')],_0x340767)[_0x1c04('0x1c')](function(_0x3101ff){logger[_0x1c04('0x1f')](_0x1c04('0x2d'),_0x2f071f,_0x561d99,_0x3101ff);})['catch'](function(_0x17123e){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x2f071f,_0x17123e);});delete _0x27c5c1['timers'][_0x340767];};}});}else{logger[_0x1c04('0x1f')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2f071f,_0x340767,_0x19c3be);}});}})[_0x1c04('0x2e')](function(){logger[_0x1c04('0x2f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2f071f,_0x27c5c1[_0x1c04('0x5')][_0x19c3be]['acwTimeout'],_0x340767,_0x19c3be);})[_0x1c04('0x30')](function(){delete _0x27c5c1[_0x1c04('0x8')][_0x2f071f];});}catch(_0x44f1b6){logger[_0x1c04('0x2f')](_0x1c04('0x31'),_0x44f1b6[_0x1c04('0x32')]);}};Acw[_0x1c04('0x15')][_0x1c04('0x26')]=function(_0x31d023){try{var _0x537b04=this;if(_0x537b04[_0x1c04('0x7')][_0x31d023]){_0x537b04[_0x1c04('0x7')][_0x31d023][_0x1c04('0x25')]=![];var _0x43cb11=_0x537b04[_0x1c04('0x7')][_0x31d023][_0x1c04('0x2c')];var _0x10d9f5=_0x537b04['timers'][_0x31d023]['queue'];var _0x5b3f18=_0x537b04[_0x1c04('0x5')][_0x10d9f5][_0x1c04('0x24')];logger['info'](_0x1c04('0x33'),_0x43cb11,_0x31d023);RpcUser[_0x1c04('0x34')](this[_0x1c04('0x6')][_0x31d023]);RpcVoiceAgentReport[_0x1c04('0x2b')]({'acwtime':_0x5b3f18,'agentacw':!![]},_0x43cb11,_0x31d023)['then'](function(_0x51c8f3){logger[_0x1c04('0x1f')](_0x1c04('0x2d'),_0x43cb11,_0x5b3f18,_0x51c8f3);})[_0x1c04('0x2e')](function(_0x54477f){logger[_0x1c04('0x2f')](_0x1c04('0x35'),_0x43cb11,_0x54477f);});}else{logger[_0x1c04('0x2f')](_0x1c04('0x36'),_0x31d023);if(_0x537b04[_0x1c04('0x7')]){logger['info'](_0x1c04('0x37'),JSON['stringify'](_0x537b04[_0x1c04('0x7')]));}}}catch(_0x11420b){logger[_0x1c04('0x2f')](_0x1c04('0x38'),_0x11420b[_0x1c04('0x32')]);}};Acw[_0x1c04('0x15')][_0x1c04('0x9')]=function(_0x52b65c){try{if(this[_0x1c04('0x5')][_0x52b65c[_0x1c04('0x39')]]&&(this[_0x1c04('0x5')][_0x52b65c[_0x1c04('0x39')]][_0x1c04('0x2')]||this[_0x1c04('0x5')][_0x52b65c[_0x1c04('0x39')]]['mandatoryDisposition'])){if(this[_0x1c04('0x6')][_0x52b65c[_0x1c04('0x17')]]){this[_0x1c04('0x8')][_0x52b65c[_0x1c04('0x2c')]]={'queue':_0x52b65c[_0x1c04('0x39')],'interface':_0x52b65c['interface'],'destlinkedid':_0x52b65c[_0x1c04('0x22')]};}}}catch(_0x1db504){logger[_0x1c04('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0x1db504[_0x1c04('0x32')]);}};Acw[_0x1c04('0x15')]['syncAgentConnectPreview']=function(_0x406d05){try{if(this[_0x1c04('0x5')][_0x406d05[_0x1c04('0x39')]]&&(this[_0x1c04('0x5')][_0x406d05[_0x1c04('0x39')]][_0x1c04('0x2')]||this[_0x1c04('0x5')][_0x406d05[_0x1c04('0x39')]][_0x1c04('0x3a')])){if(this[_0x1c04('0x6')][_0x406d05[_0x1c04('0x17')]]){this['channels'][_0x406d05['uniqueid']]={'queue':_0x406d05['queue'],'interface':_0x406d05[_0x1c04('0x17')]};}}}catch(_0x50163f){logger['error'](_0x1c04('0x3b'),_0x50163f['message']);}};Acw[_0x1c04('0x15')][_0x1c04('0xb')]=function(_0x47ea3b){try{if(this[_0x1c04('0x8')][_0x47ea3b[_0x1c04('0x2c')]]&&_[_0x1c04('0x3c')](this[_0x1c04('0x8')][_0x47ea3b[_0x1c04('0x2c')]]['attended'])){logger[_0x1c04('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x47ea3b[_0x1c04('0x2c')]);this[_0x1c04('0x16')](_0x47ea3b['uniqueid']);}else if(this[_0x1c04('0x8')][_0x47ea3b[_0x1c04('0x3d')]]&&_['isUndefined'](this['channels'][_0x47ea3b[_0x1c04('0x3d')]][_0x1c04('0x21')])){logger[_0x1c04('0x1f')](_0x1c04('0x3e'),_0x47ea3b[_0x1c04('0x3d')]);this[_0x1c04('0x16')](_0x47ea3b[_0x1c04('0x3d')]);}}catch(_0xc5de42){logger[_0x1c04('0x2f')](_0x1c04('0x3f'),_0xc5de42[_0x1c04('0x32')]);}};Acw[_0x1c04('0x15')]['syncHangup']=function(_0x5db546){try{if(this['channels'][_0x5db546[_0x1c04('0x2c')]]&&this[_0x1c04('0x8')][_0x5db546['uniqueid']][_0x1c04('0x21')]){logger['info'](_0x1c04('0x40'),_0x5db546[_0x1c04('0x2c')]);this[_0x1c04('0x16')](_0x5db546[_0x1c04('0x2c')]);}else if(this[_0x1c04('0x8')][_0x5db546[_0x1c04('0x3d')]]&&this[_0x1c04('0x8')][_0x5db546[_0x1c04('0x3d')]][_0x1c04('0x21')]){logger[_0x1c04('0x1f')](_0x1c04('0x41'),_0x5db546[_0x1c04('0x3d')]);this[_0x1c04('0x16')](_0x5db546['linkedid']);}}catch(_0x244159){logger[_0x1c04('0x2f')](_0x1c04('0x42'),_0x244159[_0x1c04('0x32')]);}};Acw[_0x1c04('0x15')][_0x1c04('0xf')]=function(_0x3c97b9){try{if(!_['isNil'](this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x43')]])){this[_0x1c04('0x16')](_0x3c97b9[_0x1c04('0x43')]);if(this['channels'][_0x3c97b9[_0x1c04('0x44')]]){this['channels'][_0x3c97b9[_0x1c04('0x44')]]['attended']=!![];this['channels'][_0x3c97b9[_0x1c04('0x45')]]=this['channels'][_0x3c97b9[_0x1c04('0x44')]];delete this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x44')]];}}else if(!_['isNil'](this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x45')]])){this['startAcw'](_0x3c97b9[_0x1c04('0x45')]);if(this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x46')]]){this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x46')]]['attended']=!![];this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x43')]]=this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x46')]];delete this[_0x1c04('0x8')][_0x3c97b9[_0x1c04('0x46')]];}}}catch(_0x1f81d0){logger[_0x1c04('0x2f')]('[ACW][syncAttendedTransfer]\x20%s',_0x1f81d0['message']);}};Acw[_0x1c04('0x15')]['syncBlindTransfer']=function(_0x241f08){try{if(this[_0x1c04('0x8')][_0x241f08['transfereruniqueid']]){logger[_0x1c04('0x1f')](_0x1c04('0x47'),JSON['stringify'](_0x241f08[_0x1c04('0x48')]));this[_0x1c04('0x16')](_0x241f08[_0x1c04('0x48')]);}else if(this[_0x1c04('0x8')][_0x241f08['transfererlinkedid']]){logger[_0x1c04('0x1f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x1c04('0x49')](_0x241f08['transfererlinkedid']));this[_0x1c04('0x16')](_0x241f08[_0x1c04('0x4a')]);}}catch(_0x1f0861){logger[_0x1c04('0x2f')](_0x1c04('0x4b'),_0x1f0861[_0x1c04('0x32')]);}};Acw[_0x1c04('0x15')][_0x1c04('0x4c')]=function(_0x13bd8d){try{if(this[_0x1c04('0x5')][_0x13bd8d['queue']]&&this[_0x1c04('0x5')][_0x13bd8d[_0x1c04('0x39')]]['autopause']===_0x1c04('0x4d')){if(this[_0x1c04('0x6')][_0x13bd8d['interface']]){logger[_0x1c04('0x1f')](_0x1c04('0x4e'),_0x13bd8d[_0x1c04('0x2c')],_0x13bd8d['interface'],_0x13bd8d[_0x1c04('0x39')]);return RpcUser[_0x1c04('0x23')](this['agents'][_0x13bd8d['interface']],_0x1c04('0x4f'),_0x13bd8d[_0x1c04('0x2c')]);}}}catch(_0x534db3){logger[_0x1c04('0x2f')](_0x1c04('0x50'),_0x534db3['message']);}};module[_0x1c04('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 384235e..34430de 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 _0x198b=['once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','asterisk','port','password','Action','promisify','action','error','username','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x198b,0x18d));var _0xb198=function(_0x432601,_0x3852b0){_0x432601=_0x432601-0x0;var _0x41b0d1=_0x198b[_0x432601];return _0x41b0d1;};'use strict';var Manager=require(_0xb198('0x0'));var BPromise=require(_0xb198('0x1'));var util=require(_0xb198('0x2'));var logger=require(_0xb198('0x3'))(_0xb198('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0xb198('0x5')][_0xb198('0x6')],config['asterisk']['ip'],config[_0xb198('0x5')]['username'],config[_0xb198('0x5')][_0xb198('0x7')],!![]);ami['keepConnected']();ami[_0xb198('0x8')]=BPromise[_0xb198('0x9')](ami[_0xb198('0xa')]);function error(_0x254f41){logger[_0xb198('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')],util['inspect'](_0x254f41,![],null)));}function close(){logger['error'](util[_0xb198('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config['asterisk'][_0xb198('0x6')]));}ami[_0xb198('0xe')]=function(){return function(){return ami['Action']({'action':_0xb198('0xf')});};};ami[_0xb198('0x10')]=function(){return function(){return ami['Action']({'action':_0xb198('0x11')});};};ami[_0xb198('0x12')]=function(){return function(){return ami[_0xb198('0x8')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xb198('0x8')]({'action':_0xb198('0x13')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xb198('0x8')]({'action':_0xb198('0x14')});};};function connect(){logger[_0xb198('0x15')](util[_0xb198('0xd')](_0xb198('0x16'),config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')]));ami[_0xb198('0x17')](_0xb198('0xb'),error);ami['once']('close',close);}ami['on']('connect',connect);ami['on'](_0xb198('0x18'),function(_0x46351a){logger[_0xb198('0x15')](util['format'](_0xb198('0x19'),config[_0xb198('0x5')][_0xb198('0xc')],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')],util[_0xb198('0x1a')](_0x46351a,![],null)));});ami['on']('fullybooted',function(){logger[_0xb198('0x15')](util[_0xb198('0xd')](_0xb198('0x1b'),config[_0xb198('0x5')]['username'],config[_0xb198('0x5')]['ip'],config[_0xb198('0x5')][_0xb198('0x6')]));return Promise[_0xb198('0x1c')]()[_0xb198('0x1d')](ami[_0xb198('0xe')]())[_0xb198('0x1d')](ami['actionDeviceStateList']())[_0xb198('0x1d')](ami[_0xb198('0x12')]())[_0xb198('0x1d')](ami[_0xb198('0x1e')]())[_0xb198('0x1d')](ami[_0xb198('0x1f')]())[_0xb198('0x20')](function(_0x1dbdb5){logger[_0xb198('0xb')](_0xb198('0x21'),util[_0xb198('0x1a')](_0x1dbdb5,{'showHidden':![],'depth':null}));});});ami[_0xb198('0x17')](_0xb198('0xb'),error);ami[_0xb198('0x17')]('close',close);module[_0xb198('0x22')]=ami; \ No newline at end of file +var _0x9097=['connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','once','close','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x875ad5,_0x3b0b6a){var _0x4df35e=function(_0x2ff061){while(--_0x2ff061){_0x875ad5['push'](_0x875ad5['shift']());}};_0x4df35e(++_0x3b0b6a);}(_0x9097,0x1da));var _0x7909=function(_0x3192bb,_0x1e070d){_0x3192bb=_0x3192bb-0x0;var _0x307d4c=_0x9097[_0x3192bb];return _0x307d4c;};'use strict';var Manager=require(_0x7909('0x0'));var BPromise=require(_0x7909('0x1'));var util=require(_0x7909('0x2'));var logger=require(_0x7909('0x3'))(_0x7909('0x4'));var config=require(_0x7909('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0x7909('0x6')]['ip'],config[_0x7909('0x6')]['username'],config['asterisk'][_0x7909('0x7')],!![]);ami[_0x7909('0x8')]();ami[_0x7909('0x9')]=BPromise[_0x7909('0xa')](ami[_0x7909('0xb')]);function error(_0x2a2d27){logger[_0x7909('0xc')](util['format'](_0x7909('0xd'),config[_0x7909('0x6')]['username'],config['asterisk']['ip'],config[_0x7909('0x6')][_0x7909('0xe')],util['inspect'](_0x2a2d27,![],null)));}function close(){logger[_0x7909('0xc')](util[_0x7909('0xf')](_0x7909('0x10'),config[_0x7909('0x6')][_0x7909('0x11')],config[_0x7909('0x6')]['ip'],config[_0x7909('0x6')][_0x7909('0xe')]));}ami[_0x7909('0x12')]=function(){return function(){return ami[_0x7909('0x9')]({'action':_0x7909('0x13')});};};ami[_0x7909('0x14')]=function(){return function(){return ami[_0x7909('0x9')]({'action':_0x7909('0x15')});};};ami[_0x7909('0x16')]=function(){return function(){return ami[_0x7909('0x9')]({'action':_0x7909('0x17')});};};ami[_0x7909('0x18')]=function(){return function(){return ami[_0x7909('0x9')]({'action':_0x7909('0x19')});};};ami[_0x7909('0x1a')]=function(){return function(){return ami[_0x7909('0x9')]({'action':_0x7909('0x1b')});};};function connect(){logger[_0x7909('0x1c')](util[_0x7909('0xf')](_0x7909('0x1d'),config[_0x7909('0x6')][_0x7909('0x11')],config[_0x7909('0x6')]['ip'],config['asterisk'][_0x7909('0xe')]));ami['once'](_0x7909('0xc'),error);ami['once']('close',close);}ami['on'](_0x7909('0x1e'),connect);ami['on'](_0x7909('0x1f'),function(_0x14b0a7){logger[_0x7909('0x1c')](util[_0x7909('0xf')](_0x7909('0x20'),config[_0x7909('0x6')][_0x7909('0x11')],config[_0x7909('0x6')]['ip'],config[_0x7909('0x6')][_0x7909('0xe')],util[_0x7909('0x21')](_0x14b0a7,![],null)));});ami['on'](_0x7909('0x22'),function(){logger[_0x7909('0x1c')](util[_0x7909('0xf')](_0x7909('0x23'),config['asterisk'][_0x7909('0x11')],config[_0x7909('0x6')]['ip'],config['asterisk']['port']));return Promise[_0x7909('0x24')]()[_0x7909('0x25')](ami['actionSipShowRegistry']())[_0x7909('0x25')](ami['actionDeviceStateList']())['then'](ami['actionSipPeerStatus']())['then'](ami[_0x7909('0x18')]())[_0x7909('0x25')](ami['actionCoreShowChannels']())['catch'](function(_0x59117c){logger[_0x7909('0xc')](_0x7909('0x26'),util[_0x7909('0x21')](_0x59117c,{'showHidden':![],'depth':null}));});});ami[_0x7909('0x27')](_0x7909('0xc'),error);ami[_0x7909('0x27')](_0x7909('0x28'),close);module[_0x7909('0x29')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7178814..7784e9a 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 _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x49003c,_0x9b09ab){var _0x342c42=function(_0x64c0be){while(--_0x64c0be){_0x49003c['push'](_0x49003c['shift']());}};_0x342c42(++_0x9b09ab);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file +var _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x3282e7,_0x3b8a9b){var _0x104d39=function(_0x55d126){while(--_0x55d126){_0x3282e7['push'](_0x3282e7['shift']());}};_0x104d39(++_0x3b8a9b);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9427d4b..459ef0d 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 _0x0a57=['AGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','queuesSummary','running','isPreviewCampaign','statusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','syncQueueSummaryComplete','filter','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','object','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','originate','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','loggedIn','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','checkIsBlackList','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','lodash','uuid','moment','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummarycomplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','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','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','contacts','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','Error','isTrunkReachable','active','trunks','SIP/%s','status','reachable','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','command','then','indexOf','true','Action','iftime\x20%s,%s','content','catch','all','some','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','[ifTime][Action]','queue','uniqueId','uniqueid','ivr','updateOriginated','answertime','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','moveContactManagedDialer','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','state','statedesc','Drop','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','dialDropRetryFrequency','minutes','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','add','ContactId','ListId','[rescheduleContact][Abandoned]','syncNewExten','actions','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','stateinterface','idHopper','paused','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','callProgressDetecting','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','MACHINE','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countagentrejectretry','createStateFinal','ivrAnswerCallsDay','dialQueueProject','AnswerAGI'];(function(_0x4da78e,_0x13cb84){var _0x4463b1=function(_0x41aaf1){while(--_0x41aaf1){_0x4da78e['push'](_0x4da78e['shift']());}};_0x4463b1(++_0x13cb84);}(_0x0a57,0xe0));var _0x70a5=function(_0xadf7fc,_0x2afcc9){_0xadf7fc=_0xadf7fc-0x0;var _0x256935=_0x0a57[_0xadf7fc];return _0x256935;};'use strict';var util=require('util');var _=require(_0x70a5('0x0'));var uuid=require(_0x70a5('0x1'));var moment=require(_0x70a5('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x70a5('0x3'));var hopperUtils=require(_0x70a5('0x4'));var ut=require('../preview/util/util');var config=require(_0x70a5('0x5'));var logger=require(_0x70a5('0x6'))('dialer');var loggerBooked=require(_0x70a5('0x6'))('booked');var loggerPredictive=require(_0x70a5('0x6'))(_0x70a5('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0x70a5('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x70a5('0x9'));var ami=require(_0x70a5('0xa'));config['redis']=_['defaults'](config[_0x70a5('0xb')],{'host':_0x70a5('0xc'),'port':0x18eb});var io=require(_0x70a5('0xd'))(new Redis(config[_0x70a5('0xb')]));var cmHopper=require(_0x70a5('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x70a5('0xf'));var Interval=require(_0x70a5('0x10'));var Action=require(_0x70a5('0x11'));var History=require(_0x70a5('0x12'));var Final=require(_0x70a5('0x13'));var AgentComplete=require(_0x70a5('0x14'));var QueueCallerAbandon=require(_0x70a5('0x15'));var Hangup=require(_0x70a5('0x16'));var ipAgi=process[_0x70a5('0x17')][_0x70a5('0x18')]||_0x70a5('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x70a5('0x1a')][_0x70a5('0x1b')]=function(_0x222de9){this[_0x70a5('0x1c')]=this[_0x70a5('0x1c')]?this[_0x70a5('0x1c')]['finally'](_0x222de9):_0x222de9();};function Dialer(_0xb9791e,_0x1a022e){this[_0x70a5('0x1d')]=new Sequence();this[_0x70a5('0x1e')]=_0x1a022e;this[_0x70a5('0x1f')]=_0xb9791e[_0x70a5('0x1f')];this[_0x70a5('0x20')]=_0xb9791e['campaigns'];this[_0x70a5('0x21')]=_0xb9791e['agents'];this['trunks']=_0xb9791e['trunks'];this[_0x70a5('0x22')]=config['maxNumberOriginate']||0x2;this[_0x70a5('0x23')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0x70a5('0x24')]={};this[_0x70a5('0x25')]={};this[_0x70a5('0x26')]={};this[_0x70a5('0x27')]={};this['queueBookedRR']={};this['queuesSummary']={};ami['on'](_0x70a5('0x28'),this[_0x70a5('0x29')][_0x70a5('0x2a')](this));ami['on']('queuecallerabandon',this[_0x70a5('0x2b')][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x2c'),this[_0x70a5('0x2d')]['bind'](this));ami['on']('agentcomplete',this[_0x70a5('0x2e')]['bind'](this));ami['on']('custom:queuesummary',this[_0x70a5('0x9')]['bind'](this));ami['on'](_0x70a5('0x2f'),this['syncQueueSummaryComplete'][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x30'),this[_0x70a5('0x31')][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x32'),this['syncNewExten'][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x33'),this[_0x70a5('0x34')][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x35'),this['syncQueueMember'][_0x70a5('0x2a')](this));ami['on'](_0x70a5('0x36'),this[_0x70a5('0x37')][_0x70a5('0x2a')](this));this[_0x70a5('0x38')]();this[_0x70a5('0x39')]();RpcSetting['getSettings']()['then'](function(_0x3107e3){previewRecallmeReminderInterval=_0x3107e3[_0x70a5('0x3a')];});}function isNotNull(_0x34f419){return _0x34f419!==null&&!_[_0x70a5('0x3b')](_0x34f419);}function msgResponse(_0x1d5d96,_0x370ce2,_0x1ad2e4){return{'action':_0x1d5d96,'response':_0x370ce2,'message':_0x1ad2e4,'stack':_0x1ad2e4};}function emit(_0x4c272c,_0x4b1e8f,_0x412b2c){io['to'](_0x4c272c)[_0x70a5('0x3c')](_0x4b1e8f,_0x412b2c);}function emitOutboundVoiceQueueSummary(_0x26d51a){if(_0x26d51a[_0x70a5('0x3d')]===_0x70a5('0x3e')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x70a5('0x3f')](_0x26d51a,{'showHidden':![],'depth':null}));emit(util[_0x70a5('0x40')](_0x70a5('0x41'),_0x26d51a[_0x70a5('0x42')]),_0x70a5('0x43'),_0x26d51a);}}function checkGetDataPredictive(_0x4e733e){if(isNotNull(_0x4e733e)&&!_[_0x70a5('0x44')](_0x4e733e)){loggerPredictive[_0x70a5('0x45')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x70a5('0x45')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e733e[_0x70a5('0x46')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x47'),_0x4e733e[_0x70a5('0x48')]);loggerPredictive[_0x70a5('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e733e[_0x70a5('0x49')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4a'),_0x4e733e[_0x70a5('0x4b')]);loggerPredictive[_0x70a5('0x45')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e733e['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x70a5('0x4c'),_0x4e733e[_0x70a5('0x4d')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));if(_0x4e733e['predictiveIntervalTotalCalls']>0x0){if(!_[_0x70a5('0x3b')](_0x4e733e[_0x70a5('0x4d')])&&_0x4e733e[_0x70a5('0x4d')]>0x0){return!![];}loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4f'));if(!_[_0x70a5('0x3b')](_0x4e733e[_0x70a5('0x50')])&&_0x4e733e[_0x70a5('0x50')]>0x0){return!![];}loggerPredictive['info'](_0x70a5('0x51'));}else{loggerPredictive[_0x70a5('0x45')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x70a5('0x45')](_0x70a5('0x52'));}return![];}function mergeDataErlangB(_0x156341){return function(_0x56b970){loggerPredictive[_0x70a5('0x45')](_0x70a5('0x53'));loggerPredictive[_0x70a5('0x45')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x56b970[_0x70a5('0x54')]);loggerPredictive['info'](_0x70a5('0x55'),_0x56b970[_0x70a5('0x56')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x57'),_0x56b970[_0x70a5('0x58')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x59'),_0x56b970[_0x70a5('0x5a')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x57'),_0x56b970[_0x70a5('0x58')]);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));_[_0x70a5('0x5b')](_0x156341,_0x56b970);};}function ifInterval(_0x53e943,_0x415393){if(_['isUndefined'](_0x415393)){return![];}return utils[_0x70a5('0x5c')](undefined,_0x415393)<_0x53e943*0x3c;}function clearPredictiveAttributes(_0x1c307e){if(_0x1c307e[_0x70a5('0x25')]){_0x1c307e['startProgressive']=undefined;loggerPredictive[_0x70a5('0x5d')](_0x1c307e[_0x70a5('0x42')],_0x70a5('0x5e'));}if(_0x1c307e['startPredictive']){_0x1c307e['startPredictive']=undefined;loggerPredictive[_0x70a5('0x5d')](_0x1c307e[_0x70a5('0x42')],_0x70a5('0x5f'));}if(_0x1c307e[_0x70a5('0x60')]){clearInterval(_0x1c307e[_0x70a5('0x60')]);_0x1c307e[_0x70a5('0x60')]=undefined;loggerPredictive[_0x70a5('0x5d')](_0x1c307e[_0x70a5('0x42')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x389066,_0x46778f){return function(_0x3d5291){loggerPredictive['error'](_0x46778f[_0x70a5('0x42')],_0x389066);loggerPredictive[_0x70a5('0x61')](_0x3d5291[_0x70a5('0x62')]);clearPredictiveAttributes(_0x46778f);};}function loggerCatch(_0x36dd8e){return function(_0x4cf494){logger[_0x70a5('0x61')](_0x36dd8e,util[_0x70a5('0x3f')](_0x4cf494,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x19d605,_0x21ee38,_0x5c72b7){return function(_0x49902b){utils[_0x70a5('0x63')](_0x21ee38,_0x5c72b7,0x0);logger[_0x70a5('0x61')](_0x19d605,util[_0x70a5('0x3f')](_0x49902b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x395796){return function(_0x554ae2){if(isNotNull(_0x554ae2)&&isNotNull(_0x554ae2[0x0])){if(_0x554ae2[0x0][_0x70a5('0x64')]>0x0){_0x395796[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x70a5('0x45')]('[getContactDialer2][ReScheduled]'+_0x395796[_0x70a5('0x42')],_0x554ae2[0x0][_0x70a5('0x64')],_0x70a5('0x66'));}else{_0x395796['message']=utils[_0x70a5('0x67')][_0x70a5('0x68')];logger['info'](_0x70a5('0x69')+_0x395796[_0x70a5('0x42')]);}}};}function createObjHistory(_0x1d9b64,_0x165792,_0x398a0b,_0x3dff13,_0x5a5a0f){_0x1d9b64[_0x70a5('0x65')]=_0x398a0b;var _0x21b0de=new Action(_0x1d9b64,_0x165792);var _0x2609af=new History(_0x21b0de);_0x2609af['state']=_0x3dff13;_0x2609af['statedesc']=_0x5a5a0f;_0x2609af['endtime']=_0x21b0de[_0x70a5('0x6a')];return _0x2609af;}function unlockQueueStatus(_0x47264a,_0x3f4a47){setTimeout(function(){if(_[_0x70a5('0x3b')](_0x47264a[_0x70a5('0x6b')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x3f4a47);}_0x47264a['queueStatusComplete']=!![];loggerBooked[_0x70a5('0x45')](_0x70a5('0x6c'),_0x3f4a47,JSON[_0x70a5('0x6d')](_[_0x70a5('0x6e')](_0x47264a,[_0x70a5('0x42'),_0x70a5('0x6b')])));},0x1f3);}function checkInterval(_0x5790d6){return function(){if(!isNotNull(_0x5790d6[_0x70a5('0x6f')])){_0x5790d6[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x70')];throw _0x5790d6['name']+_0x70a5('0x71');}if(!isNotNull(_0x5790d6[_0x70a5('0x6f')]['Intervals'])){_0x5790d6[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x70')];throw _0x5790d6[_0x70a5('0x42')]+_0x70a5('0x71');}if(!isNotNull(_['isEmpty'](_0x5790d6[_0x70a5('0x6f')]['Intervals']))){_0x5790d6['message']=utils[_0x70a5('0x67')][_0x70a5('0x70')];throw _0x5790d6[_0x70a5('0x42')]+_0x70a5('0x71');}};}function checkIsIVRCampaignActive(_0x4a7050){return function(){if(!utils[_0x70a5('0x72')](_0x4a7050)){_0x4a7050[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x73')];throw _0x4a7050[_0x70a5('0x42')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x2d4711){if(utils[_0x70a5('0x74')](_0x2d4711)){emit(util[_0x70a5('0x40')](_0x70a5('0x75'),_0x2d4711['name']),_0x70a5('0x76'),_0x2d4711);}}function loggerCatchQueueSummary(_0x30c364,_0x495170){return function(_0x1ee127){clearPredictiveAttributes(_0x495170);emitCampaignSummary(_0x495170);loggerSyncQueueSummary[_0x70a5('0x5d')](_0x30c364,util[_0x70a5('0x3f')](_0x1ee127,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x24d511){if(_0x24d511['sendMessageOneNotActive']){if(_0x24d511[_0x70a5('0x77')]===0x0){_0x24d511[_0x70a5('0x78')]=![];_0x24d511[_0x70a5('0x65')]=utils[_0x70a5('0x67')]['INACTIVE'];loggerSyncQueueSummary[_0x70a5('0x5d')](_0x70a5('0x79'),_0x24d511[_0x70a5('0x42')],'is\x20not\x20active');}else{_0x24d511[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x7a')];loggerSyncQueueSummary[_0x70a5('0x5d')](_0x70a5('0x79'),_0x24d511['name'],_0x70a5('0x7b'));}emitCampaignSummary(_0x24d511);}}function myreject(_0x50654e){return function(_0x1b9ccd){return _0x50654e(msgResponse('[ifTime][Action]',_0x70a5('0x7c'),JSON['stringify'](_0x1b9ccd)));};}Dialer[_0x70a5('0x1a')][_0x70a5('0x7d')]=function(_0x260ea0){return!_['isUndefined'](_0x260ea0)&&_0x260ea0&&!_[_0x70a5('0x3b')](_0x260ea0[_0x70a5('0x42')])&&!_[_0x70a5('0x3b')](_0x260ea0[_0x70a5('0x7e')])&&_0x260ea0['active']&&(this[_0x70a5('0x7f')][util['format'](_0x70a5('0x80'),_0x260ea0[_0x70a5('0x42')])][_0x70a5('0x81')]===_0x70a5('0x82')||this[_0x70a5('0x7f')][util['format'](_0x70a5('0x80'),_0x260ea0[_0x70a5('0x42')])][_0x70a5('0x81')]==='unmonitored');};Dialer[_0x70a5('0x1a')][_0x70a5('0x83')]=function(_0xf97e17){var _0x1c2a9d=this;return function(){if(!_0x1c2a9d[_0x70a5('0x7d')](_0xf97e17[_0x70a5('0x84')])){if(!_0x1c2a9d['isTrunkReachable'](_0xf97e17[_0x70a5('0x85')])){_0xf97e17[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x86')];throw _0xf97e17[_0x70a5('0x42')]+_0x70a5('0x87');}}};};Dialer['prototype'][_0x70a5('0x88')]=function(_0x2fac37,_0x595300,_0x1130bf,_0x4007c2){var _0x212b60=this;return function(){var _0x8eccc3=!![];return _0x212b60[_0x70a5('0x89')](_0x2fac37,_0x595300,_0x1130bf,_0x4007c2,_0x8eccc3);};};Dialer['prototype'][_0x70a5('0x8a')]=function(_0x44d74d,_0x67619a,_0x53fcd1,_0x3a0b93){var _0x5a950d=this;return function(){var _0x22649a=![];return _0x5a950d[_0x70a5('0x89')](_0x44d74d['Intervals'],_0x67619a,_0x53fcd1,_0x3a0b93,_0x22649a);};};Dialer['prototype'][_0x70a5('0x89')]=function(_0x383609,_0x2c5afc,_0x6832a8,_0x21b99e,_0x29a8de){var _0x55c37a=[];return new Promise(function(_0x1fa33b,_0x54994d){if(!isNotNull(_0x383609)){_0x21b99e[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x70')];return _0x54994d(msgResponse(_0x70a5('0x8b'),_0x70a5('0x8c'),_0x6832a8+_0x70a5('0x8d')));}if(_['isEmpty'](_0x383609)){_0x21b99e[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x8e')];return _0x54994d(msgResponse('ifTime','Failure',_0x6832a8+_0x70a5('0x8f')));}if(_0x2c5afc&&_[_0x70a5('0x3b')](config[_0x70a5('0x90')][_0x2c5afc])){_0x21b99e[_0x70a5('0x65')]=utils['CAMPAIGN_STATUS'][_0x70a5('0x91')];return _0x54994d(msgResponse(_0x70a5('0x8b'),_0x70a5('0x8c'),_0x6832a8+_0x70a5('0x92')+_0x2c5afc));}if(_['isArray'](_0x383609)){for(var _0xd508fd=0x0;_0xd508fd<_0x383609['length'];_0xd508fd+=0x1){_0x55c37a[_0x70a5('0x93')](ami['Action']({'action':_0x70a5('0x94'),'command':util[_0x70a5('0x40')]('iftime\x20%s,%s',_0x383609[_0xd508fd]['interval'],!_['isUndefined'](config['timezones'][_0x2c5afc])?_0x2c5afc:'')})[_0x70a5('0x95')](function(_0x44f4eb){return _0x44f4eb['content'][_0x70a5('0x96')](_0x70a5('0x97'))>=0x0;})['catch'](myreject(_0x54994d)));}}else{_0x55c37a[_0x70a5('0x93')](ami[_0x70a5('0x98')]({'action':_0x70a5('0x94'),'command':util[_0x70a5('0x40')](_0x70a5('0x99'),_0x383609,!_[_0x70a5('0x3b')](config[_0x70a5('0x90')][_0x2c5afc])?_0x2c5afc:'')})['then'](function(_0x3b0096){return _0x3b0096[_0x70a5('0x9a')]['indexOf'](_0x70a5('0x97'))>=0x0;})[_0x70a5('0x9b')](myreject(_0x54994d)));}Promise[_0x70a5('0x9c')](_0x55c37a)[_0x70a5('0x95')](function(_0x351c3d){var _0x4c8d20=_[_0x70a5('0x9d')](_0x351c3d);if(_0x4c8d20){return _0x1fa33b(_0x4c8d20);}else{_0x21b99e[_0x70a5('0x65')]=_0x29a8de?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x70a5('0x9e')];return _0x54994d(msgResponse('[ifTime][promiseAll]',_0x70a5('0x8c'),_0x70a5('0x9f')+_0x29a8de+'\x20'+_0x6832a8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x383609,{'showHidden':![],'depth':null})+_0x70a5('0xa0')+_0x2c5afc));}})[_0x70a5('0x9b')](function(_0x30fe12){return _0x54994d(msgResponse(_0x70a5('0x8b'),_0x70a5('0x8c'),JSON['stringify'](_0x30fe12)));});});};Dialer[_0x70a5('0x1a')][_0x70a5('0x38')]=function(){var _0xd4a2dc=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0xd4a2dc[_0x70a5('0xa1')]();},0x3e8);});};Dialer[_0x70a5('0x1a')][_0x70a5('0xa1')]=function(){var _0x2e30b7=this;var _0x56875d;for(var _0x2dbe6a in this[_0x70a5('0x20')]){if(typeof this[_0x70a5('0x20')][_0x2dbe6a]!==_0x70a5('0xa2')){_0x56875d=this[_0x70a5('0x20')][_0x2dbe6a];if(utils[_0x70a5('0x74')](_0x56875d)&&utils[_0x70a5('0x72')](_0x56875d)){_0x56875d[_0x70a5('0x78')]=!![];Promise[_0x70a5('0xa3')]()[_0x70a5('0x95')](checkIsIVRCampaignActive(_0x56875d))[_0x70a5('0x95')](checkInterval(_0x56875d))['then'](_0x2e30b7[_0x70a5('0x83')](_0x56875d))[_0x70a5('0x95')](_0x2e30b7[_0x70a5('0x88')](_0x56875d[_0x70a5('0xa4')],_0x56875d[_0x70a5('0xa5')],_0x56875d[_0x70a5('0x42')],_0x56875d))[_0x70a5('0x95')](_0x2e30b7[_0x70a5('0x8a')](_0x56875d['Interval'],_0x56875d['dialTimezone'],_0x56875d[_0x70a5('0x42')],_0x56875d))['then'](_0x2e30b7['launchHandleIvr'](_0x56875d))[_0x70a5('0x9b')](loggerCatchQueueSummary('[syncCampaigns]',_0x56875d));}else{notSendMessagesCampaign(_0x56875d);}}}};Dialer['prototype'][_0x70a5('0xa6')]=function(_0x13d7a9){if(_0x13d7a9[_0x70a5('0xa7')]!==_0x70a5('0x7')){clearPredictiveAttributes(_0x13d7a9);}switch(_0x13d7a9[_0x70a5('0xa7')]){case _0x70a5('0xa8'):this[_0x70a5('0xa9')](_0x13d7a9,0x1);break;case _0x70a5('0xaa'):this[_0x70a5('0xa9')](_0x13d7a9,_0x13d7a9[_0x70a5('0xab')]);break;case'predictive':this[_0x70a5('0x7')](_0x13d7a9);break;case _0x70a5('0xac'):this[_0x70a5('0xa9')](_0x13d7a9,0x1);break;default:logger[_0x70a5('0x61')](_0x70a5('0xad'),_0x13d7a9[_0x70a5('0x42')],'method\x20not\x20recognized');}};Dialer['prototype']['ifTime']=function(_0x56762c,_0x123560){var _0x21ed98=_0x56762c[_0x70a5('0xa5')];var _0x54d331=_0x123560?_0x56762c[_0x70a5('0xa4')]:_0x56762c['Interval']['Intervals'];logger[_0x70a5('0xae')](_0x70a5('0xaf'),_0x54d331,_0x21ed98,_0x56762c['name'],util['format'](_0x70a5('0xb0'),_0x56762c['name'],_0x56762c['id']));var _0x44fb2c=null;return Interval[_0x70a5('0xb1')](_0x54d331,_0x21ed98)['then'](function(_0x26a4c7){if(_0x26a4c7===!![]){return _0x26a4c7;}else{_0x56762c[_0x70a5('0x65')]=_0x123560?utils[_0x70a5('0x67')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x70a5('0x9e')];_0x44fb2c=msgResponse('[ifTime][promiseAll]',_0x70a5('0x8c'),_0x70a5('0x9f')+_0x123560+'\x20'+_0x56762c[_0x70a5('0x42')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x54d331,{'showHidden':![],'depth':null})+_0x70a5('0xa0')+_0x21ed98);}if(_0x44fb2c!==null){logger[_0x70a5('0xae')](_0x70a5('0xb2'),_0x44fb2c);_0x44fb2c[_0x70a5('0xb3')]=_0x123560;throw _0x44fb2c;}})[_0x70a5('0x9b')](function(_0x539a9e){logger[_0x70a5('0x61')]('AMI\x20IfTime',_0x539a9e);throw msgResponse(_0x70a5('0xb4'),_0x70a5('0x7c'),util[_0x70a5('0x3f')](_0x539a9e,{'showHidden':![],'depth':null}));});};Dialer[_0x70a5('0x1a')][_0x70a5('0x29')]=function(_0x3f0bfb){if(this[_0x70a5('0x1f')][_0x3f0bfb[_0x70a5('0xb5')]]){if(this[_0x70a5('0xb6')][_0x3f0bfb[_0x70a5('0xb7')]]&&this[_0x70a5('0xb6')][_0x3f0bfb[_0x70a5('0xb7')]][_0x70a5('0x3d')]!==_0x70a5('0xb8')){this[_0x70a5('0xb9')](this['voiceQueues'][_0x3f0bfb[_0x70a5('0xb5')]]);this['uniqueId'][_0x3f0bfb[_0x70a5('0xb7')]][_0x70a5('0xba')]=moment()[_0x70a5('0x40')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x70a5('0x1a')][_0x70a5('0x2e')]=function(_0xafcbb6){var _0xae3f9=this[_0x70a5('0xb6')][_0xafcbb6['uniqueid']];if(this['voiceQueues'][_0xafcbb6[_0x70a5('0xb5')]]){if(_0xae3f9&&_0xae3f9[_0x70a5('0x3d')]!=='ivr'){delete this[_0x70a5('0xb6')][_0xafcbb6[_0x70a5('0xb7')]];this[_0x70a5('0x1f')][_0xafcbb6['queue']][_0x70a5('0xbb')]+=0x1;var _0x6acc38=new AgentComplete(_0xae3f9,_0xafcbb6);if(_0xafcbb6[_0x70a5('0xbc')]===_0x70a5('0xbd')){_0x6acc38[_0x70a5('0xbe')]=this[_0x70a5('0x1f')][_0xafcbb6[_0x70a5('0xb5')]][_0x70a5('0xbf')]&&this[_0x70a5('0x1f')][_0xafcbb6[_0x70a5('0xb5')]][_0x70a5('0xc0')]?moment()[_0x70a5('0x40')](_0x70a5('0xc1')):undefined;}hopperUtils['createHistory'](_0x6acc38)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x70a5('0xc2')](_0x6acc38)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x70a5('0x2b')]=function(_0x4e6149){var _0x3c79f8=this[_0x70a5('0xb6')][_0x4e6149[_0x70a5('0xb7')]];var _0x4f56b5=this;var _0x302fd7=![];var _0x1e47ef;var _0x2aeaa4;if(this['voiceQueues'][_0x4e6149['queue']]){if(_0x3c79f8&&_0x3c79f8['type']!==_0x70a5('0xb8')){delete this[_0x70a5('0xb6')][_0x4e6149[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this['voiceQueues'][_0x4e6149['queue']]);_0x3c79f8['droptime']=moment()['format'](_0x70a5('0xc1'));var _0x118055=new QueueCallerAbandon(_0x3c79f8,_0x4e6149);if(utils[_0x70a5('0x5c')](_0x3c79f8[_0x70a5('0xc3')],_0x3c79f8[_0x70a5('0xc4')])>=_0x3c79f8['dialQueueTimeout']){this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0x49')]+=0x1;this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xc5')]+=0x1;_0x118055[_0x70a5('0xc6')]=0xa;_0x118055[_0x70a5('0xc7')]=_0x70a5('0xc8');_0x118055['dropreason']=_0x70a5('0xc9');_0x118055[_0x70a5('0xbe')]=this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]]['dialQueueProject2']?moment()['format'](_0x70a5('0xc1')):undefined;_0x118055[_0x70a5('0xca')]+=0x1;_0x118055[_0x70a5('0xcb')]+=0x1;_0x1e47ef=this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]]['dialDropRetryFrequency'];_0x2aeaa4=this['voiceQueues'][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xcc')];hopperUtils['verifyAdditionalPhones'](_0x118055,_0x118055[_0x70a5('0xc6')],_0x3c79f8[_0x70a5('0xcd')])[_0x70a5('0x95')](function(_0x2b1bf3){_0x302fd7=_0x2b1bf3[_0x70a5('0xce')]==0x1;if(_0x118055[_0x70a5('0xca')]>=_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xcf')]){_0x4f56b5[_0x70a5('0xd0')](_0x118055,_0x2b1bf3['additional']);}else{hopperUtils[_0x70a5('0xd1')]({'active':![],'countdropretry':_0x118055[_0x70a5('0xca')],'scheduledat':moment()['add'](_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xd2')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x3c79f8['ContactId'],'ListId':_0x3c79f8['ListId'],'VoiceQueueId':_0x3c79f8[_0x70a5('0xd4')]||undefined,'CampaignId':_0x3c79f8[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xd6')));var _0x244c48=new History(_0x118055);_0x244c48[_0x70a5('0xc6')]=0xa;_0x244c48['statedesc']=_0x70a5('0xc8');_0x244c48['starttime']=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));_0x244c48[_0x70a5('0xd7')]=_0x244c48['starttime'];_0x244c48[_0x70a5('0xd8')]=_0x118055[_0x70a5('0xd8')];_0x244c48[_0x70a5('0xd9')]=_0x118055[_0x70a5('0xd9')];hopperUtils[_0x70a5('0xda')](_0x244c48)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xdb')));}})[_0x70a5('0x95')](function(){if(_0x302fd7)hopperUtils[_0x70a5('0xdc')](_0x118055,_0x1e47ef,_0x2aeaa4)[_0x70a5('0x95')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0x4b')]+=0x1;this[_0x70a5('0x1f')][_0x4e6149['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x118055[_0x70a5('0xc6')]=0xb;_0x118055[_0x70a5('0xc7')]=_0x70a5('0xdd');_0x118055[_0x70a5('0xde')]=_0x70a5('0xdf');_0x118055[_0x70a5('0xe0')]+=0x1;_0x118055[_0x70a5('0xcb')]+=0x1;_0x1e47ef=this[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xe1')];_0x2aeaa4=this['voiceQueues'][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xcc')];hopperUtils[_0x70a5('0xe2')](_0x118055,_0x118055[_0x70a5('0xc6')],_0x3c79f8['voiceQueue'])[_0x70a5('0x95')](function(_0x4382b9){if(_0x118055[_0x70a5('0xe0')]>=_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xe3')]){_0x4f56b5[_0x70a5('0xd0')](_0x118055,_0x4382b9[_0x70a5('0xce')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x118055[_0x70a5('0xe0')],'scheduledat':moment()[_0x70a5('0xe4')](_0x4f56b5[_0x70a5('0x1f')][_0x4e6149[_0x70a5('0xb5')]][_0x70a5('0xe1')],'minutes')[_0x70a5('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c79f8[_0x70a5('0xe5')],'ListId':_0x3c79f8[_0x70a5('0xe6')],'VoiceQueueId':_0x3c79f8[_0x70a5('0xd4')]||undefined,'CampaignId':_0x3c79f8[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xe7')));var _0x4b5556=new History(_0x118055);_0x4b5556[_0x70a5('0xc6')]=0xb;_0x4b5556[_0x70a5('0xc7')]='Abandoned';_0x4b5556[_0x70a5('0x6a')]=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));_0x4b5556[_0x70a5('0xd7')]=_0x4b5556[_0x70a5('0x6a')];_0x4b5556[_0x70a5('0xd8')]=_0x118055['calleridname'];_0x4b5556[_0x70a5('0xd9')]=_0x118055[_0x70a5('0xd9')];hopperUtils[_0x70a5('0xda')](_0x4b5556)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x302fd7)hopperUtils[_0x70a5('0xdc')](_0x118055,_0x1e47ef,_0x2aeaa4)['then'](function(){return 0x1;});});}}}};Dialer[_0x70a5('0x1a')][_0x70a5('0xe8')]=function(_0x3cca78){if(this['actions'][_0x3cca78[_0x70a5('0xb7')]]){this[_0x70a5('0xe9')][_0x3cca78[_0x70a5('0xb7')]]['channel']=_0x3cca78[_0x70a5('0xea')];}if(this[_0x70a5('0xb6')][_0x3cca78['uniqueid']]){this['uniqueId'][_0x3cca78[_0x70a5('0xb7')]][_0x70a5('0xea')]=_0x3cca78[_0x70a5('0xea')];}};Dialer[_0x70a5('0x1a')][_0x70a5('0xeb')]=function(_0x1ad46e){if(!this['actions'][_0x1ad46e[_0x70a5('0xec')]]){return;}var _0x25578c=this[_0x70a5('0x1f')][this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xb5')]][_0x70a5('0xed')]||_0x70a5('0xee');if(_0x25578c===_0x70a5('0xef')){if(this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]]&&_[_0x70a5('0xf0')](this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xf1')])&&_0x1ad46e[_0x70a5('0x81')]==='1'&&_0x1ad46e['paused']==='0'){if(this[_0x70a5('0x21')][_0x1ad46e['stateinterface']]){if(!this[_0x70a5('0x21')][_0x1ad46e[_0x70a5('0xf2')]][_0x70a5('0xf1')]){this[_0x70a5('0x21')][_0x1ad46e[_0x70a5('0xf2')]][_0x70a5('0xf1')]=!![];this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xf1')]=!![];this['actions'][_0x1ad46e[_0x70a5('0xec')]]['stateinterface']=_0x1ad46e[_0x70a5('0xf2')];}}}}else if(_0x25578c==='rrmemory'){if(this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]]){if(this[_0x70a5('0x21')][_0x1ad46e['stateinterface']]){this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]][_0x70a5('0xf2')]=_0x1ad46e[_0x70a5('0xf2')];if(_[_0x70a5('0xf0')](this[_0x70a5('0x27')][this[_0x70a5('0xe9')][_0x1ad46e[_0x70a5('0xec')]]['queue']])){this['queueBooked'][this[_0x70a5('0xe9')][_0x1ad46e['actionid']][_0x70a5('0xb5')]]=[];}this['queueBooked'][this[_0x70a5('0xe9')][_0x1ad46e['actionid']][_0x70a5('0xb5')]]['push'](_[_0x70a5('0x5b')](_['pick'](this[_0x70a5('0xe9')][_0x1ad46e['actionid']],[_0x70a5('0xf3'),'stateinterface']),{'status':_0x1ad46e[_0x70a5('0x81')],'paused':_0x1ad46e[_0x70a5('0xf4')]}));}}}};Dialer[_0x70a5('0x1a')][_0x70a5('0x37')]=function(_0x537fe1){if(!this['actions'][_0x537fe1[_0x70a5('0xec')]]){return;}var _0xb02792=this;var _0x118cb2=this[_0x70a5('0x1f')][this['actions'][_0x537fe1[_0x70a5('0xec')]]['queue']];var _0x5baa5c=_0x118cb2[_0x70a5('0xed')]||'rrmemory';if(_0x5baa5c==='roundrobin'){if(this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]&&this[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xf2')]){this[_0x70a5('0x1e')][_0x70a5('0xf5')](this['actions'][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xf3')],this['actions'][_0x537fe1['actionid']][_0x70a5('0xf2')])[_0x70a5('0x9b')](function(_0x48acaf){logger[_0x70a5('0x61')](_0x70a5('0xf6'),util[_0x70a5('0x3f')](_0x48acaf,{'showHidden':![],'depth':null}));})[_0x70a5('0xf7')](function(){_0xb02792[_0x70a5('0xb9')](_0xb02792[_0x70a5('0x1f')][_0xb02792[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xb5')]]);_0xb02792[_0x70a5('0x21')][_0xb02792[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xf2')]][_0x70a5('0xf1')]=![];delete _0xb02792[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]];unlockQueueStatus(_0x118cb2);});}else{this[_0x70a5('0xb9')](this[_0x70a5('0x1f')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xb5')]]);hopperUtils[_0x70a5('0xd1')]({'active':![],'ContactId':this['actions'][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xe5')],'ListId':this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xe6')],'VoiceQueueId':this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xd4')]||undefined,'CampaignId':this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xf8')));delete this['actions'][_0x537fe1[_0x70a5('0xec')]];unlockQueueStatus(_0x118cb2);}}else if(_0x5baa5c===_0x70a5('0xee')){var _0x36d082;if(this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]&&!_[_0x70a5('0x44')](this['queueBooked'][this[_0x70a5('0xe9')][_0x537fe1['actionid']]['queue']])){if(this[_0x70a5('0xf9')][_0xb02792['actions'][_0x537fe1['actionid']][_0x70a5('0xb5')]]){this['queueBookedRR'][_0xb02792[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']]=this[_0x70a5('0xf9')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']]?this[_0x70a5('0xf9')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']]:this[_0x70a5('0x27')][this[_0x70a5('0xe9')][_0x537fe1['actionid']][_0x70a5('0xb5')]]?this['queueBooked'][this['actions'][_0x537fe1[_0x70a5('0xec')]][_0x70a5('0xb5')]][_0x70a5('0xfa')]||0x0:0x0;}this[_0x70a5('0x27')][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']][_0x70a5('0xfa')]=this['queueBookedRR'][this[_0x70a5('0xe9')][_0x537fe1[_0x70a5('0xec')]]['queue']];for(var _0x2dbeed=0x0;_0x2dbeed=_0x2f7e0d[_0x70a5('0x11b')]){_0x247a35[_0x70a5('0x11c')](_0x15bdeb,_0x286e6e,_0x50208f,_0x70a5('0x11d'));}else{if(_0x15bdeb[_0x70a5('0x114')]>=_0x2f7e0d[_0x70a5('0x11e')]){_0x247a35['createStateFinal'](_0x15bdeb,_0x286e6e,_0x50208f,_0x70a5('0x11f'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x15bdeb[_0x70a5('0x114')],'scheduledat':moment()['add'](_0x2f7e0d[_0x70a5('0x120')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x15bdeb['ContactId'],'ListId':_0x15bdeb[_0x70a5('0xe6')],'VoiceQueueId':_0x15bdeb[_0x70a5('0xd4')]||undefined,'CampaignId':_0x15bdeb[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x121')));_0x286e6e({'reschedule':0x1});}}});}if(_0x2a3a45[_0x70a5('0x3d')]==='ivr'&&this[_0x70a5('0x20')][_0x2a3a45['queue']]['dialAMDActive']&&_0x588c94['value']==='HANGUP'){delete this[_0x70a5('0xb6')][_0x588c94[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]]);_0x3ec748=new Hangup(_0x2a3a45,_0x588c94);_0x3ec748[_0x70a5('0xc6')]=0x12;_0x3ec748['statedesc']='HangupInAMD';_0x3ec748[_0x70a5('0x10d')]='AMD';ami['emit'](_0x70a5('0x115'),ut[_0x70a5('0x10f')](_0x3ec748,_0x70a5('0x110')));this[_0x70a5('0x111')](_0x3ec748,_0x70a5('0x122'),'[syncHangupInAMDIvr]');}if(_0x2a3a45[_0x70a5('0x3d')]==='ivr'&&this[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]][_0x70a5('0x108')]&&_0x588c94[_0x70a5('0x109')]==='MACHINE'){return new Promise(function(_0x265f2a,_0x46097f){delete _0x247a35['uniqueId'][_0x588c94[_0x70a5('0xb7')]];_0x247a35[_0x70a5('0xb9')](_0x247a35[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]]);_0x247a35[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]][_0x70a5('0xbb')]+=0x1;_0x247a35[_0x70a5('0x20')][_0x2a3a45[_0x70a5('0xb5')]][_0x70a5('0x10b')]+=0x1;var _0x261802=_0x247a35['campaigns'][_0x2a3a45[_0x70a5('0xb5')]];var _0x5d2cb4=new Hangup(_0x2a3a45,_0x588c94);_0x5d2cb4[_0x70a5('0xc6')]=0x13;_0x5d2cb4[_0x70a5('0xc7')]=_0x70a5('0x113');_0x5d2cb4['membername']=_0x70a5('0x10e');_0x5d2cb4[_0x70a5('0x114')]+=0x1;_0x5d2cb4[_0x70a5('0xcb')]+=0x1;_0x5d2cb4[_0x70a5('0x110')]=!![];ami[_0x70a5('0x3c')](_0x70a5('0x115'),ut[_0x70a5('0x10f')](_0x5d2cb4,_0x70a5('0x110')));hopperUtils[_0x70a5('0xda')](_0x5d2cb4)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5d2cb4['countbusyretry']+_0x5d2cb4['countcongestionretry']+_0x5d2cb4[_0x70a5('0x119')]+_0x5d2cb4[_0x70a5('0x11a')]+_0x5d2cb4[_0x70a5('0xca')]+_0x5d2cb4[_0x70a5('0xe0')]+_0x5d2cb4[_0x70a5('0x114')]+_0x5d2cb4[_0x70a5('0x123')]>=_0x261802[_0x70a5('0x11b')]){_0x247a35[_0x70a5('0x11c')](_0x5d2cb4,_0x265f2a,_0x46097f,_0x70a5('0x11d'));}else{if(_0x5d2cb4[_0x70a5('0x114')]>=_0x261802['dialMachineMaxRetry']){_0x247a35[_0x70a5('0x124')](_0x5d2cb4,_0x265f2a,_0x46097f,_0x70a5('0x11f'));}else{hopperUtils[_0x70a5('0xd1')]({'active':![],'countmachineretry':_0x5d2cb4[_0x70a5('0x114')],'scheduledat':moment()[_0x70a5('0xe4')](_0x261802[_0x70a5('0x120')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x5d2cb4[_0x70a5('0xe5')],'ListId':_0x5d2cb4['ListId'],'VoiceQueueId':_0x5d2cb4[_0x70a5('0xd4')]||undefined,'CampaignId':_0x5d2cb4[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x265f2a({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x70a5('0x31')]=function(_0x2911b9){var _0x4ca141=this[_0x70a5('0xb6')][_0x2911b9['uniqueid']];var _0x3073d6;if(_0x4ca141&&_0x4ca141[_0x70a5('0x3d')]==='ivr'){delete this[_0x70a5('0xb6')][_0x2911b9[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this['campaigns'][_0x4ca141[_0x70a5('0xb5')]]);this[_0x70a5('0x20')][_0x4ca141['queue']][_0x70a5('0x125')]+=0x1;_0x3073d6=new Hangup(_0x4ca141,_0x2911b9);hopperUtils[_0x70a5('0xda')](_0x3073d6)[_0x70a5('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x70a5('0xc2')](_0x3073d6)[_0x70a5('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x4ca141&&_0x4ca141[_0x70a5('0x3d')]!==_0x70a5('0xb8')&&isNotNull(this['voiceQueues'][_0x4ca141[_0x70a5('0xb5')]][_0x70a5('0x126')])){delete this[_0x70a5('0xb6')][_0x2911b9[_0x70a5('0xb7')]];this['updateOriginated'](this[_0x70a5('0x1f')][_0x4ca141[_0x70a5('0xb5')]]);this['voiceQueues'][_0x4ca141['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4ca141['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3073d6=new Hangup(_0x4ca141,_0x2911b9);_0x3073d6[_0x70a5('0xc6')]=0x10;_0x3073d6[_0x70a5('0xc7')]=_0x70a5('0x127');_0x3073d6[_0x70a5('0x10d')]=_0x70a5('0x128');hopperUtils[_0x70a5('0xda')](_0x3073d6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x70a5('0xc2')](_0x3073d6)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x129')));}if(_0x4ca141&&_0x4ca141[_0x70a5('0x3d')]!==_0x70a5('0xb8')&&!isNotNull(this[_0x70a5('0x1f')][_0x4ca141[_0x70a5('0xb5')]][_0x70a5('0x126')])){delete this[_0x70a5('0xb6')][_0x2911b9[_0x70a5('0xb7')]];this[_0x70a5('0xb9')](this[_0x70a5('0x1f')][_0x4ca141[_0x70a5('0xb5')]]);this['voiceQueues'][_0x4ca141['queue']][_0x70a5('0x12a')]+=0x1;_0x3073d6=new Hangup(_0x4ca141,_0x2911b9);_0x3073d6['state']=0xc;_0x3073d6[_0x70a5('0xc7')]=_0x2911b9[_0x70a5('0x12b')];_0x3073d6['membername']='Unknow';hopperUtils[_0x70a5('0xda')](_0x3073d6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x3073d6)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x129')));}};Dialer[_0x70a5('0x1a')]['syncQueueSummary']=function(_0x3fcc65){var _0x49d4dc=this;if(!_0x49d4dc[_0x70a5('0x12c')][_0x3fcc65[_0x70a5('0x42')]]){_0x49d4dc[_0x70a5('0x12c')][_0x3fcc65['name']]={'running':![]};}else if(_0x49d4dc['queuesSummary'][_0x3fcc65[_0x70a5('0x42')]][_0x70a5('0x12d')]===!![]){return;}else if(_0x49d4dc['queuesSummary'][_0x3fcc65[_0x70a5('0x42')]][_0x70a5('0x12d')]===![]){_0x49d4dc[_0x70a5('0x12c')][_0x3fcc65[_0x70a5('0x42')]][_0x70a5('0x12d')]=!![];}var _0x5df0b3=_0x49d4dc['voiceQueues'][_0x3fcc65['name']];var _0x1140b5=_0x5df0b3[_0x70a5('0x65')]!==utils[_0x70a5('0x67')]['INACTIVE'];var _0x6ca961=utils[_0x70a5('0x12e')](_0x5df0b3);_0x5df0b3[_0x70a5('0x12f')]=utils['getQueueCampaignStatusMessage'](_0x5df0b3,_0x49d4dc[_0x70a5('0x7f')]);Promise[_0x70a5('0xa3')]()[_0x70a5('0x95')](function(){if(_0x5df0b3['statusMessage']===utils[_0x70a5('0x67')][_0x70a5('0x73')]){if(_0x1140b5){clearPredictiveAttributes(_0x5df0b3);_0x3fcc65[_0x70a5('0x24')]=undefined;_0x3fcc65[_0x70a5('0x25')]=undefined;}if(_0x5df0b3[_0x70a5('0x12f')]===utils['CAMPAIGN_STATUS'][_0x70a5('0x73')]){_0x3fcc65[_0x70a5('0x130')]=0x0;_0x3fcc65[_0x70a5('0xf4')]=0x0;_0x3fcc65[_0x70a5('0x131')]=0x0;_0x3fcc65['talking']=0x0;_0x3fcc65[_0x70a5('0x132')]=0x0;}}else if(_0x5df0b3['statusMessage']===utils[_0x70a5('0x67')][_0x70a5('0x133')]&&!_0x6ca961){return _0x49d4dc[_0x70a5('0x8b')](_0x5df0b3,!![])['then'](function(){return _0x49d4dc[_0x70a5('0x8b')](_0x5df0b3,![]);})[_0x70a5('0x95')](function(){return _0x49d4dc[_0x70a5('0xa6')](_0x5df0b3);})[_0x70a5('0x9b')](function(_0x4e6c96){loggerSyncQueueSummary['debug'](_0x70a5('0x134'),util[_0x70a5('0x3f')](_0x4e6c96,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5df0b3);});}else{clearPredictiveAttributes(_0x5df0b3);}})[_0x70a5('0x95')](function(){var _0x493345=_0x3fcc65[_0x70a5('0x135')](_0x5df0b3);if(_0x493345||_0x5df0b3[_0x70a5('0x136')]){_0x5df0b3[_0x70a5('0x136')]=![];_0x3fcc65['updateReportFromOutboundQueue'](_0x5df0b3);Object[_0x70a5('0x137')](_0x5df0b3,_0x3fcc65);emitOutboundVoiceQueueSummary(_0x3fcc65);}_0x49d4dc[_0x70a5('0x12c')][_0x5df0b3['name']]['running']=![];})[_0x70a5('0x9b')](function(_0x5a2c88){logger[_0x70a5('0x61')](_0x70a5('0x134'),util['inspect'](_0x5a2c88,{'showHidden':![],'depth':null}));_0x49d4dc[_0x70a5('0x12c')][_0x5df0b3[_0x70a5('0x42')]]['running']=![];});};Dialer['prototype'][_0x70a5('0x138')]=_['throttle'](function(){var _0x5ee674=_['filter'](this[_0x70a5('0x1f')],function(_0x4f208b){return _0x4f208b['dialPreviewRecallmeReminder'];});var _0x3e5227=_[_0x70a5('0x139')](this[_0x70a5('0x21')],function(_0x47d19e){return _0x47d19e['online']&&_0x47d19e[_0x70a5('0x81')]===_0x70a5('0x82');});if(_0x5ee674['length']>0x0&&_0x3e5227[_0x70a5('0x13a')]>0x0){return Promise['resolve']()[_0x70a5('0x95')](cmHopper[_0x70a5('0x13b')](_[_0x70a5('0x13c')](_0x5ee674,'id'),previewRecallmeReminderInterval,_['map'](_0x3e5227,'id')))['then'](function(_0x3bbde7){for(var _0x40c7ea=0x0;_0x40c7ea<_0x3bbde7[_0x70a5('0x13a')];_0x40c7ea++){var _0x42c5b0=_0x3bbde7[_0x40c7ea][_0x70a5('0x13d')][_0x70a5('0x42')];if(_0x42c5b0)io['to'](util[_0x70a5('0x40')](_0x70a5('0x13e'),_0x42c5b0))[_0x70a5('0x3c')](_0x70a5('0x13f'),{'hopper':_0x3bbde7[_0x40c7ea]});}})[_0x70a5('0x9b')](function(_0x40d714){logger[_0x70a5('0x61')](_0x70a5('0x140'),_0x40d714);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x70a5('0x1a')][_0x70a5('0x39')]=function(){var _0x4c3a8a=this;setInterval(function(){_0x4c3a8a['clearZombieChannels'](_0x4c3a8a[_0x70a5('0xb6')],_0x70a5('0x141'));_0x4c3a8a[_0x70a5('0x142')](_0x4c3a8a[_0x70a5('0xe9')],_0x70a5('0x143'));},0x32c8);};Dialer[_0x70a5('0x1a')][_0x70a5('0x142')]=function(_0x20e739,_0x4e1e06){var _0x16e013=this;for(var _0x1b8f87 in _0x20e739){if(typeof _0x20e739[_0x1b8f87]!==_0x70a5('0xa2')){this[_0x70a5('0x1d')][_0x70a5('0x1b')](function(){if(!_[_0x70a5('0xf0')](_0x20e739[_0x1b8f87])){return ami[_0x70a5('0x98')]({'action':_0x70a5('0x81'),'channel':_0x20e739[_0x1b8f87]['channel']})[_0x70a5('0x9b')](function(_0x2e31c9){if(_0x2e31c9[_0x70a5('0x65')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x20e739[_0x1b8f87]&&_0x20e739[_0x1b8f87][_0x70a5('0x3d')]!=='ivr'){_0x16e013[_0x70a5('0xb9')](_0x16e013[_0x70a5('0x1f')][_0x20e739[_0x1b8f87]['queue']]);logger[_0x70a5('0x61')]('[Dialer][checkChannel]',_0x4e1e06,_0x1b8f87,_0x20e739[_0x1b8f87]['queue']);delete _0x20e739[_0x1b8f87];}if(_0x20e739[_0x1b8f87]&&_0x20e739[_0x1b8f87][_0x70a5('0x3d')]===_0x70a5('0xb8')){_0x16e013['updateOriginated'](_0x16e013[_0x70a5('0x20')][_0x20e739[_0x1b8f87][_0x70a5('0xb5')]]);logger[_0x70a5('0x61')](_0x70a5('0x144'),_0x4e1e06,_0x1b8f87,_0x20e739[_0x1b8f87][_0x70a5('0xb5')]);delete _0x20e739[_0x1b8f87];}},0x2328);}});}});}}};Dialer['prototype'][_0x70a5('0x145')]=function(_0x5ec25a){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x5ec25a))[_0x70a5('0x9b')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x70a5('0x1a')][_0x70a5('0xb9')]=function(_0xab8b06){if(!_['isUndefined'](_0xab8b06)&&_0xab8b06!==null){if(typeof _0xab8b06[_0x70a5('0x77')]!==_0x70a5('0xa2')){if(_0xab8b06[_0x70a5('0x77')]>0x0){_0xab8b06[_0x70a5('0x77')]-=0x1;}else{logger[_0x70a5('0x61')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x70a5('0x61')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x70a5('0x1a')]['loggerHandler']=function(_0x3ea446,_0xdf1f42){var _0x1c869f=this;return function(_0x145d24){_0x1c869f[_0x70a5('0xb9')](_0xdf1f42);logger[_0x70a5('0x61')](_0x3ea446,util[_0x70a5('0x3f')](_0x145d24,{'showHidden':![],'depth':null}));};};Dialer[_0x70a5('0x1a')][_0x70a5('0x146')]=function(_0xd3a41d,_0x3732b4,_0x580c76){var _0x23f13a={'state':0x19,'statedesc':_0x70a5('0x147')};this[_0x70a5('0xb9')](_0x3732b4);this[_0x70a5('0x111')](_[_0x70a5('0x5b')](_0x23f13a,_[_0x70a5('0x6e')](_0x580c76,[_0x70a5('0xe5'),'ListId',_0x70a5('0x148'),_0x70a5('0xd4'),'CampaignId'])),_0x70a5('0x149'),'[emptyContact]');logger[_0x70a5('0x61')](_0xd3a41d);};Dialer[_0x70a5('0x1a')][_0x70a5('0x111')]=function(_0x36fc9b,_0x484158,_0x3681e7){hopperUtils['createHistory'](_0x36fc9b)[_0x70a5('0x9b')](loggerCatch(_0x484158));hopperUtils['moveContactManagedDialer'](_0x36fc9b)[_0x70a5('0x9b')](loggerCatch(_0x3681e7));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4b5fbc,_0x11e9d1){hopperUtils[_0x70a5('0xda')](_0x4b5fbc)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x11e9d1==0x0){hopperUtils[_0x70a5('0xc2')](_0x4b5fbc)['catch'](loggerCatch(_0x70a5('0x14a')));}};Dialer[_0x70a5('0x1a')][_0x70a5('0x140')]=function(_0x1c3953){return Promise[_0x70a5('0xa3')]()[_0x70a5('0x95')](cmHopper['handlePreviewRecallNotifications'](_0x1c3953['id'],previewRecallmeReminderInterval))[_0x70a5('0x95')](function(_0x18373b){for(var _0x22fc04=0x0;_0x22fc04<_0x18373b[_0x70a5('0x13a')];_0x22fc04++){var _0x4a8867=_0x18373b[_0x22fc04][_0x70a5('0x13d')]['name'];if(_0x4a8867)io['to'](util[_0x70a5('0x40')](_0x70a5('0x13e'),_0x4a8867))[_0x70a5('0x3c')]('user:dialPreviewRecallReminder',{'hopper':_0x18373b[_0x22fc04]});}})[_0x70a5('0x9b')](function(){});};Dialer[_0x70a5('0x1a')]['launchHandleIvr']=function(_0x3440e2){var _0x803509=this;return function(){_0x803509[_0x70a5('0x14b')](_0x3440e2);};};Dialer[_0x70a5('0x1a')]['actionOriginate']=function(_0x93bb94,_0x26592c){var _0x5d2f4e=this;var _0x2af464=uuid['v4']();this[_0x70a5('0xe9')][_0x2af464]=new Action(_0x93bb94,_0x26592c,_0x2af464);return new Promise(function(_0x204b50,_0x15b9bb){if(_[_0x70a5('0x3b')](_0x93bb94)&&typeof _0x93bb94!==_0x70a5('0x14c')){return _0x15b9bb(msgResponse('originate',_0x70a5('0x8c'),'voiceQueue\x20is\x20undefine'));}if(_[_0x70a5('0x3b')](_0x26592c[_0x70a5('0x14d')])||_0x26592c[_0x70a5('0x14d')]===null){return _0x15b9bb(msgResponse('originate',_0x70a5('0x8c'),_0x70a5('0x14e')));}var _0x406e5e={'XMD-CALLERID':_0x5d2f4e['actions'][_0x2af464][_0x70a5('0x14f')](),'XMD-AGI':_0x93bb94[_0x70a5('0x126')]?util[_0x70a5('0x40')]('\x22agi://%s/square,%s\x22',ipAgi,_0x93bb94[_0x70a5('0x126')]):'NONE','XMD-AGIAFTER':_0x93bb94[_0x70a5('0xbf')]?util['format'](_0x70a5('0x150'),ipAgi,_0x93bb94[_0x70a5('0xbf')]):'NONE','XMD-QUEUE':utils[_0x70a5('0x151')](_0x93bb94)?util['format'](_0x70a5('0x152'),_0x93bb94[_0x70a5('0x42')],_0x93bb94[_0x70a5('0x153')]||'',_0x93bb94[_0x70a5('0xc0')]?'c':'',_0x93bb94['dialQueueTimeout']||0x3):_0x70a5('0x154'),'XMD-CONTACTID':_0x26592c[_0x70a5('0xe5')],'XMD-CDRTYPE':_0x70a5('0x155'),'CALLERID(all)':_0x5d2f4e[_0x70a5('0xe9')][_0x2af464][_0x70a5('0x14f')](),'XMD-AMD':_0x93bb94[_0x70a5('0x108')]?_0x70a5('0x133'):_0x70a5('0x154'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x93bb94['dialAMDActive']){_0x406e5e[_0x70a5('0x156')]=_0x93bb94['dialAMDInitialSilence']||0x9c4;_0x406e5e[_0x70a5('0x157')]=_0x93bb94[_0x70a5('0x158')]||0x5dc;_0x406e5e[_0x70a5('0x159')]=_0x93bb94[_0x70a5('0x15a')]||0x320;_0x406e5e[_0x70a5('0x15b')]=_0x93bb94['dialAMDTotalAnalysisTime']||0x1388;_0x406e5e[_0x70a5('0x15c')]=_0x93bb94[_0x70a5('0x15d')]||0x64;_0x406e5e[_0x70a5('0x15e')]=_0x93bb94['dialAMDBetweenWordsSilence']||0x32;_0x406e5e[_0x70a5('0x15f')]=_0x93bb94[_0x70a5('0x160')]||0x3;_0x406e5e['XMD-AMDSILENCETHRESHOLD']=_0x93bb94['dialAMDSilenceThreshold']||0x100;_0x406e5e[_0x70a5('0x161')]=_0x93bb94[_0x70a5('0x162')]||0x1388;}if(utils['isOutboundQueue'](_0x93bb94)){_0x406e5e['XMD-VOICEQUEUEID']=_0x26592c[_0x70a5('0xd4')];}else{_0x406e5e[_0x70a5('0x163')]=_0x26592c[_0x70a5('0xd5')];}for(var _0x4225f8 in _0x26592c[_0x70a5('0x164')]){if(typeof _0x26592c['Contact'][_0x4225f8]!==_0x70a5('0xa2')){if(isNotNull(_0x26592c['Contact'][_0x4225f8])&&_0x4225f8!=='id'&&_0x4225f8!==_0x70a5('0x165')&&_0x4225f8!=='createdAt'&&_0x4225f8!=='updatedAt'){_0x406e5e[util[_0x70a5('0x40')]('%s%s',_0x70a5('0x166'),_[_0x70a5('0x167')](_0x4225f8))]=_0x26592c[_0x70a5('0x164')][_0x4225f8];}}}var _0x573b11=_0x5d2f4e[_0x70a5('0x7d')](_0x93bb94[_0x70a5('0x84')])?utils['getCallerId'](_0x93bb94[_0x70a5('0x84')][_0x70a5('0x168')],_0x93bb94[_0x70a5('0x169')],_0x93bb94[_0x70a5('0x16a')]>0x0?utils['getCallerIdRandom'](_0x93bb94[_0x70a5('0x16b')],_0x93bb94[_0x70a5('0x16a')]):_0x93bb94[_0x70a5('0x16b')]):utils['getCallerId'](_[_0x70a5('0xf0')](_0x93bb94[_0x70a5('0x85')])?_0x93bb94[_0x70a5('0x84')][_0x70a5('0x168')]:_0x93bb94['TrunkBackup'][_0x70a5('0x168')],_0x93bb94[_0x70a5('0x169')],_0x93bb94[_0x70a5('0x16a')]>0x0?utils[_0x70a5('0x16c')](_0x93bb94[_0x70a5('0x16b')],_0x93bb94[_0x70a5('0x16a')]):_0x93bb94[_0x70a5('0x16b')]);if(_0x573b11){_0x406e5e[_0x70a5('0x16d')]=_0x5d2f4e[_0x70a5('0xe9')][_0x2af464][_0x70a5('0x16e')]=utils['extractCalleridName'](_0x573b11);_0x406e5e[_0x70a5('0x16f')]=_0x26592c[_0x70a5('0x14d')];}_0x93bb94[_0x70a5('0x170')]=_0x406e5e;return ami['Action']({'actionid':_0x2af464,'action':_0x70a5('0x171'),'channel':_0x5d2f4e[_0x70a5('0x7d')](_0x93bb94[_0x70a5('0x84')])?util[_0x70a5('0x40')](_0x70a5('0x172'),_0x93bb94[_0x70a5('0x84')][_0x70a5('0x42')],isNotNull(_0x93bb94[_0x70a5('0x173')])?_0x93bb94[_0x70a5('0x173')][_0x70a5('0x174')]()||'':'',_0x93bb94[_0x70a5('0x175')]>0x0?_0x26592c[_0x70a5('0x14d')][_0x70a5('0x176')](_0x93bb94[_0x70a5('0x175')]):_0x26592c['phone']):util[_0x70a5('0x40')](_0x70a5('0x172'),_[_0x70a5('0xf0')](_0x93bb94[_0x70a5('0x85')])?_0x93bb94['Trunk'][_0x70a5('0x42')]:_0x93bb94['TrunkBackup'][_0x70a5('0x42')],isNotNull(_0x93bb94['dialPrefix'])?_0x93bb94[_0x70a5('0x173')][_0x70a5('0x174')]()||'':'',_0x93bb94['dialCutDigit']>0x0?_0x26592c[_0x70a5('0x14d')][_0x70a5('0x176')](_0x93bb94[_0x70a5('0x175')]):_0x26592c['phone']),'callerid':_0x573b11,'Exten':_0x70a5('0x107'),'Context':'from-sip','Priority':'1','variable':_0x406e5e,'timeout':(_0x93bb94[_0x70a5('0x177')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2af464})[_0x70a5('0x95')](function(_0x1ab3f2){return _0x204b50(_0x1ab3f2);})[_0x70a5('0x9b')](function(_0x41f4f2){_0x93bb94[_0x70a5('0x178')]+=0x1;var _0x3466bc=new History(_0x5d2f4e[_0x70a5('0xe9')][_0x2af464]);logger[_0x70a5('0x61')](util[_0x70a5('0x40')](_0x70a5('0x179'),JSON[_0x70a5('0x6d')](_0x41f4f2)));_0x3466bc['state']=0xe;_0x3466bc[_0x70a5('0xc7')]=_0x70a5('0x17a');_0x3466bc['starttime']=moment()['format'](_0x70a5('0xc1'));_0x3466bc[_0x70a5('0xd7')]=_0x3466bc[_0x70a5('0x6a')];hopperUtils['createHistory'](_0x3466bc)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x17b')));_0x5d2f4e[_0x70a5('0xc2')](_0x3466bc)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x17b')))[_0x70a5('0xf7')](function(){delete _0x5d2f4e[_0x70a5('0xe9')][_0x2af464];return _0x15b9bb(msgResponse('originate',_0x70a5('0x7c'),_0x70a5('0x17c')));});});});};Dialer[_0x70a5('0x1a')][_0x70a5('0x17d')]=function(_0x240d65,_0x405eb2,_0x54215a){var _0x4c4ef2=new History(_0x405eb2);if(_0x4c4ef2[_0x70a5('0x117')]+_0x4c4ef2[_0x70a5('0x118')]+_0x4c4ef2[_0x70a5('0x119')]+_0x4c4ef2[_0x70a5('0x11a')]+_0x4c4ef2[_0x70a5('0xca')]+_0x4c4ef2[_0x70a5('0xe0')]+_0x4c4ef2[_0x70a5('0x114')]+_0x4c4ef2[_0x70a5('0x123')]>=_0x54215a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x240d65){case 0x3:if(_0x4c4ef2[_0x70a5('0x119')]>=_0x54215a[_0x70a5('0x17e')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countnoanswerretry':_0x4c4ef2[_0x70a5('0x119')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialNoAnswerRetryFrequency'],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x17f')));break;case 0x5:if(_0x4c4ef2[_0x70a5('0x117')]>=_0x54215a[_0x70a5('0x180')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countbusyretry':_0x4c4ef2[_0x70a5('0x117')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialBusyRetryFrequency'],'minutes')['format'](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x181')));break;case 0x8:if(_0x4c4ef2[_0x70a5('0x118')]>=_0x54215a['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countcongestionretry':_0x4c4ef2[_0x70a5('0x118')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x182')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})['catch'](loggerCatch(_0x70a5('0x183')));break;case 0x0:if(_0x4c4ef2[_0x70a5('0x11a')]>=_0x54215a[_0x70a5('0x184')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4c4ef2[_0x70a5('0x11a')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x185')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2['ListId'],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4c4ef2[_0x70a5('0xca')]>=_0x54215a[_0x70a5('0xcf')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4c4ef2['countdropretry']+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialDropRetryFrequency'],'minutes')[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2['ContactId'],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2['VoiceQueueId']||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0xd6')));break;case 0xb:if(_0x4c4ef2[_0x70a5('0xe0')]>=_0x54215a[_0x70a5('0xe3')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4c4ef2[_0x70a5('0xe0')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a['dialAbandonedRetryFrequency'],_0x70a5('0xd3'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2[_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4c4ef2[_0x70a5('0x114')]>=_0x54215a[_0x70a5('0x11e')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countmachineretry':_0x4c4ef2[_0x70a5('0x114')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x120')],_0x70a5('0xd3'))['format'](_0x70a5('0xc1')),'ContactId':_0x4c4ef2['ContactId'],'ListId':_0x4c4ef2[_0x70a5('0xe6')],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x121')));break;case 0x14:if(_0x4c4ef2['countagentrejectretry']>=_0x54215a[_0x70a5('0x186')]-0x1){return!![];}hopperUtils[_0x70a5('0xd1')]({'active':![],'countagentrejectretry':_0x4c4ef2[_0x70a5('0x123')]+=0x1,'scheduledat':moment()[_0x70a5('0xe4')](_0x54215a[_0x70a5('0x187')],_0x70a5('0xd3'))[_0x70a5('0x40')](_0x70a5('0xc1')),'ContactId':_0x4c4ef2[_0x70a5('0xe5')],'ListId':_0x4c4ef2['ListId'],'VoiceQueueId':_0x4c4ef2[_0x70a5('0xd4')]||undefined,'CampaignId':_0x4c4ef2['CampaignId']||undefined})[_0x70a5('0x9b')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x70a5('0x1a')]['callProgressDetecting']=function(_0x387f79,_0x58f9ab,_0xcf7d48){var _0x54ef2b=this;var _0x263a00=new History(_0x387f79);var _0x31e810=![];var _0x140f23;var _0x10827c;return new Promise(function(_0x38db5d,_0xa26883){if(_[_0x70a5('0x3b')](_0x58f9ab)&&typeof _0x58f9ab!==_0x70a5('0x14c')){return _0xa26883(msgResponse(_0x70a5('0x188'),_0x70a5('0x8c'),_0x70a5('0x189')));}if(_[_0x70a5('0x3b')](_0xcf7d48)&&typeof _0xcf7d48!==_0x70a5('0x14c')){return _0xa26883(msgResponse('[callProgressDetecting]',_0x70a5('0x8c'),_0x70a5('0x18a')));}hopperUtils[_0x70a5('0xe2')](_0x263a00,_0xcf7d48['reason'],_0x58f9ab)[_0x70a5('0x95')](function(_0x2bd9ba){if(_0x2bd9ba['additional']==0x1)_0x31e810=!![];switch(_0xcf7d48[_0x70a5('0xbc')]){case'0':_0x58f9ab['outboundNoSuchCallsDay']+=0x1;_0x263a00[_0x70a5('0xc6')]=0x0;_0x263a00[_0x70a5('0xc7')]='NoSuchNumber';_0x263a00[_0x70a5('0x11a')]+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;ami['emit'](_0x70a5('0x18b'),ut[_0x70a5('0x10f')](_0x387f79,_0x70a5('0x18c')));_0x140f23=_0x58f9ab[_0x70a5('0x185')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];hopperUtils[_0x70a5('0xda')](_0x263a00)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x54ef2b[_0x70a5('0x17d')](0x0,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x11a')]>=_0x58f9ab[_0x70a5('0x184')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,'reason\x200\x20no\x20such\x20number....');}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x58f9ab['outboundNoAnswerCallsDay']+=0x1;_0x263a00[_0x70a5('0xc6')]=0x3;_0x263a00[_0x70a5('0xc7')]='NoAnswer';_0x263a00[_0x70a5('0x119')]+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;var _0x20388a=ut['buildNoAnswerEventPayload'](_0x387f79,_0x58f9ab);ami[_0x70a5('0x3c')](_0x70a5('0x18d'),_0x20388a);_0x140f23=_0x58f9ab[_0x70a5('0x18e')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x18f')));if(_0x54ef2b['checkRetriveMax'](0x3,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x119')]>=_0x58f9ab[_0x70a5('0x17e')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,'reason\x203\x20ringing\x20no\x20answer');}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x58f9ab[_0x70a5('0x190')]+=0x1;_0x263a00[_0x70a5('0xc6')]=0x5;_0x263a00[_0x70a5('0xc7')]=_0x70a5('0x191');_0x263a00['countbusyretry']+=0x1;_0x263a00['countglobal']+=0x1;ami[_0x70a5('0x3c')](_0x70a5('0x192'),ut[_0x70a5('0x10f')](_0x387f79,_0x70a5('0x193')));_0x140f23=_0x58f9ab[_0x70a5('0x194')];_0x10827c=_0x58f9ab[_0x70a5('0xcc')];hopperUtils[_0x70a5('0xda')](_0x263a00)[_0x70a5('0x9b')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x54ef2b['checkRetriveMax'](0x5,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00['countbusyretry']>=_0x58f9ab[_0x70a5('0x180')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x195'));}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,'reason\x205\x20busy');}}break;case'8':_0x58f9ab[_0x70a5('0x196')]+=0x1;_0x263a00[_0x70a5('0xc6')]=0x8;_0x263a00[_0x70a5('0xc7')]='Congestion';_0x263a00[_0x70a5('0x118')]+=0x1;_0x263a00['countglobal']+=0x1;_0x140f23=_0x58f9ab[_0x70a5('0x182')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];ami['emit'](_0x70a5('0x197'),ut['buildObj'](_0x387f79,_0x70a5('0x198')));hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x199')));if(_0x54ef2b['checkRetriveMax'](0x8,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x118')]>=_0x58f9ab['dialCongestionMaxRetry']){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19a'));}else{_0x54ef2b['stateGlobal'](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19a'));}}break;case'11':_0x58f9ab[_0x70a5('0x19b')]+=0x1;_0x263a00['state']=0xb;_0x263a00[_0x70a5('0xc7')]='Abandoned';_0x263a00[_0x70a5('0xe0')]+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;_0x140f23=_0x58f9ab[_0x70a5('0xe1')];_0x10827c=_0x58f9ab[_0x70a5('0xcc')];hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x19c')));if(_0x54ef2b['checkRetriveMax'](0xb,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0xe0')]>=_0x58f9ab[_0x70a5('0xe3')]){_0x54ef2b['createStateFinal'](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19d'));}else{_0x54ef2b['stateGlobal'](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x19d'));}}break;case'20':_0x58f9ab['outboundRejectCallsDay']+=0x1;_0x263a00[_0x70a5('0xc6')]=0x14;_0x263a00['statedesc']=_0x70a5('0x19e');_0x263a00['countagentrejectretry']+=0x1;_0x263a00[_0x70a5('0xcb')]+=0x1;_0x140f23=_0x58f9ab[_0x70a5('0x187')];_0x10827c=_0x58f9ab['callAdditionalPhoneAfterMin'];ami[_0x70a5('0x3c')](_0x70a5('0x19f'),ut[_0x70a5('0x10f')](_0x387f79,'agentreject'));hopperUtils[_0x70a5('0xda')](_0x263a00)['catch'](loggerCatch(_0x70a5('0x1a0')));if(_0x54ef2b['checkRetriveMax'](0x14,_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00[_0x70a5('0x123')]>=_0x58f9ab[_0x70a5('0x186')]){_0x54ef2b[_0x70a5('0x124')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x1a1'));}else{_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,_0x70a5('0x1a1'));}}break;default:_0x58f9ab[_0x70a5('0x12a')]+=0x1;_0x263a00[_0x70a5('0xc6')]=0xc;_0x263a00[_0x70a5('0xc7')]=_0xcf7d48[_0x70a5('0xbc')];_0x140f23=_0x58f9ab['dialAgentRejectRetryFrequency'];_0x10827c=_0x58f9ab[_0x70a5('0xcc')];hopperUtils['createHistory'](_0x263a00)[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1a2')));if(_0x54ef2b[_0x70a5('0x17d')](_0xcf7d48['reason'],_0x387f79,_0x58f9ab)&&!_0x31e810){if(_0x263a00['countbusyretry']+_0x263a00[_0x70a5('0x118')]+_0x263a00[_0x70a5('0x119')]+_0x263a00[_0x70a5('0x11a')]+_0x263a00['countdropretry']+_0x263a00['countabandonedretry']+_0x263a00[_0x70a5('0x114')]+_0x263a00[_0x70a5('0x123')]>=_0x58f9ab[_0x70a5('0x11b')]){_0x54ef2b[_0x70a5('0x11c')](_0x263a00,_0x38db5d,_0xa26883,_0xcf7d48[_0x70a5('0xbc')]);}else{_0x54ef2b['createStateFinal'](_0x263a00,_0x38db5d,_0xa26883,_0xcf7d48['reason']);}}}})[_0x70a5('0x95')](function(){if(_0x31e810){hopperUtils['swapAdditionalPhones'](_0x263a00,_0x140f23,_0x10827c)[_0x70a5('0x95')](function(){return _0x38db5d(0x1);});}});});};Dialer[_0x70a5('0x1a')][_0x70a5('0x11c')]=function(_0x507980,_0x8c44b5,_0x209e6f,_0x2620fc){var _0x448ffd=new Final(_0x507980);_0x448ffd['state']=0xf;_0x448ffd[_0x70a5('0xc7')]='Global';this['createStateFinal'](_0x448ffd,_0x8c44b5,_0x209e6f,_0x2620fc);};Dialer[_0x70a5('0x1a')][_0x70a5('0x124')]=function(_0x23e969,_0xd46d74,_0xca206d,_0x46fd34){hopperUtils[_0x70a5('0xc2')](_0x23e969)['then'](function(){return _0xd46d74(msgResponse('[callProgressDetecting]',_0x70a5('0x1a3'),_0x46fd34));})[_0x70a5('0x9b')](function(){return _0xca206d(msgResponse('[moveContactManagedDialer][0]',_0x70a5('0x8c'),'contact\x20not\x20moved'));});};Dialer[_0x70a5('0x1a')][_0x70a5('0x7')]=function(_0x124743){var _0x24a089=_0x124743[_0x70a5('0x1a4')]/0x64;var _0x5251e1=_0x124743[_0x70a5('0x1a5')]/(_0x124743['outboundDropCallsDayTimeout']+_0x124743[_0x70a5('0xbb')]);var _0x1aecd7=Math['round'](_0x124743[_0x70a5('0x1a6')]*(_0x124743[_0x70a5('0x1a7')]/0x64));var _0xca0b8=Math['round'](_0x124743[_0x70a5('0x1a6')]*(_0x124743[_0x70a5('0x1a8')]/0x64));var _0x5d0799=_0x124743[_0x70a5('0x130')]+_0x124743[_0x70a5('0x1a9')];var _0x1c2143=Math[_0x70a5('0x1aa')](_0x124743[_0x70a5('0x54')]*_0x124743[_0x70a5('0x58')]*_0x124743[_0x70a5('0x1ab')]*_0x124743[_0x70a5('0x1ac')]);if(_[_0x70a5('0x3b')](_0x124743['startProgressive'])){if(!_['isUndefined'](_0x124743[_0x70a5('0x24')])){_0x124743[_0x70a5('0x24')]=undefined;loggerPredictive[_0x70a5('0x61')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x124743[_0x70a5('0x60')])){loggerPredictive[_0x70a5('0x61')](_0x70a5('0x1ad'),_0x70a5('0x1ae'));clearInterval(_0x124743[_0x70a5('0x60')]);_0x124743[_0x70a5('0x60')]=undefined;}_0x124743[_0x70a5('0x25')]=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));loggerPredictive[_0x70a5('0x45')](_0x124743[_0x70a5('0x42')],_0x70a5('0x1af'),_0x124743[_0x70a5('0x25')]);this[_0x70a5('0xa9')](_0x124743,0x1);}else if(ifInterval(_0x124743[_0x70a5('0x1b0')],_0x124743[_0x70a5('0x25')])){this[_0x70a5('0xa9')](_0x124743,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x124743[_0x70a5('0x25')],_0x124743[_0x70a5('0x42')]);_0x124743[_0x70a5('0x54')]=0x0;_0x124743[_0x70a5('0xc5')]=0x0;}else if(_0x24a089<_0x5251e1&&_0x124743[_0x70a5('0x1b1')]===_0x70a5('0x1b2')){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1b3'),_0x70a5('0x1b4'),_0x5251e1,_0x70a5('0x25'),_0x124743[_0x70a5('0x42')]);}else if(_0x1c2143<_0x124743['predictiveIntervalErlangCallsDroppedCalls']&&_0x124743[_0x70a5('0x1b1')]===_0x70a5('0x1b2')){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1b5'),_0x70a5('0x1b6'),_0x1c2143,_0x70a5('0x1b7'),_0x124743[_0x70a5('0xc5')],_0x70a5('0x25'),_0x124743['name']);}else if(!ifInterval(_0x124743[_0x70a5('0x1b0')],_0x124743[_0x70a5('0x25')])&&_[_0x70a5('0x3b')](_0x124743['startPredictive'])&&!_[_0x70a5('0x3b')](_0x124743['startProgressive'])){_0x124743[_0x70a5('0x24')]=moment()['format'](_0x70a5('0xc1'));loggerPredictive[_0x70a5('0x45')](_0x124743[_0x70a5('0x42')],'started\x20in\x20predictive\x20at',_0x124743[_0x70a5('0x24')]);hopperUtils[_0x70a5('0x1b8')](_0x124743[_0x70a5('0x1b0')])['then'](this[_0x70a5('0x1b9')](_0x124743))[_0x70a5('0x95')](mergeDataErlangB(_0x124743))[_0x70a5('0x95')](this[_0x70a5('0x1ba')](_0x124743))['catch'](loggerCatchPredictive(_0x70a5('0x1bb'),_0x124743));}else if(!ifInterval(_0x124743[_0x70a5('0x1b0')],_0x124743[_0x70a5('0x24')])){_0x124743[_0x70a5('0xc5')]=0x0;_0x124743['startPredictive']=moment()[_0x70a5('0x40')](_0x70a5('0xc1'));loggerPredictive['info'](_0x124743[_0x70a5('0x42')],_0x70a5('0x1bc'),_0x124743[_0x70a5('0x24')]);clearInterval(_0x124743['handlePredictive']);_0x124743['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x124743[_0x70a5('0x1b0')])[_0x70a5('0x95')](this[_0x70a5('0x1b9')](_0x124743))[_0x70a5('0x95')](mergeDataErlangB(_0x124743))[_0x70a5('0x95')](this[_0x70a5('0x1ba')](_0x124743))[_0x70a5('0x9b')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x124743));}else if(_0x124743[_0x70a5('0x1a6')]&&_0x5d0799<_0x124743['predictiveIntervalAvailable']-_0xca0b8){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x124743[_0x70a5('0x42')],_0x70a5('0x1bd'),_0x5d0799,')\x20are\x20less\x20than\x20threshold\x20(',_0x124743['predictiveIntervalAvailable'],'-',_0xca0b8,'=',_0x124743[_0x70a5('0x1a6')]-_0xca0b8,')');}else if(_0x124743[_0x70a5('0x1a6')]&&_0x5d0799>_0x124743[_0x70a5('0x1a6')]+_0x1aecd7){clearPredictiveAttributes(_0x124743);loggerPredictive[_0x70a5('0x45')](_0x124743['name'],_0x70a5('0x1bd'),_0x5d0799,_0x70a5('0x1be'),_0x124743[_0x70a5('0x1a6')],'+',_0x1aecd7,'=',_0x124743[_0x70a5('0x1a6')]+_0x1aecd7,')');}};Dialer[_0x70a5('0x1a')][_0x70a5('0x1b9')]=function(_0x59c8d7){var _0xd4bcc4=this;return function(_0x172915){return new Promise(function(_0x26e118,_0x3f5a81){_['merge'](_0x59c8d7,_0x172915[0x0]);if(checkGetDataPredictive(_0x172915[0x0])){var _0x35b911=_0x59c8d7['predictiveIntervalAvailable']=_0x59c8d7[_0x70a5('0x1a9')]+_0x59c8d7[_0x70a5('0x130')];var _0x6f416c=_0x59c8d7[_0x70a5('0x1b0')]*0x3c;var _0x356a30=_0x172915[0x0][_0x70a5('0x4d')]+_0x172915[0x0][_0x70a5('0x50')];var _0x4debcc=(_0x172915[0x0][_0x70a5('0x48')]+_0x172915[0x0][_0x70a5('0x49')]+_0x172915[0x0][_0x70a5('0x4b')])/_0x172915[0x0][_0x70a5('0x46')];_0x59c8d7[_0x70a5('0x1ab')]=_0x4debcc>0x0?_0x4debcc:0x1;switch(_0x59c8d7['dialPredictiveOptimization']){case _0x70a5('0x1b2'):var _0x3a8aa1=_0x59c8d7[_0x70a5('0x1a4')]/0x64;return _0xd4bcc4[_0x70a5('0x1bf')](_0x35b911,_0x6f416c,_0x356a30,_0x4debcc,_0x3a8aa1)[_0x70a5('0x95')](function(_0x23b800){return _0x26e118(_0x23b800);});case _0x70a5('0x1c0'):var _0xd9446e=_0x59c8d7[_0x70a5('0x1a4')]/0x64;return _0xd4bcc4[_0x70a5('0x1c1')](_0x35b911,_0x6f416c,_0x356a30,_0x4debcc,_0xd9446e)[_0x70a5('0x95')](function(_0x5eecb1){return _0x26e118(_0x5eecb1);});default:return _0x3f5a81(msgResponse(_0x70a5('0x1c2'),'Failure','Unknown\x20Predictive'));}}else{return _0x3f5a81(msgResponse(_0x70a5('0x1c2'),_0x70a5('0x8c'),'check\x20failure'));}});};};Dialer[_0x70a5('0x1a')]['getDataPredictiveOld']=function(_0x395edc){var _0x6810dc=this;return function(_0xeaa9f5){return new Promise(function(_0x1b30da,_0xc4a30){_[_0x70a5('0x5b')](_0x395edc,_0xeaa9f5[0x0]);if(checkGetDataPredictive(_0xeaa9f5[0x0])){loggerPredictive[_0x70a5('0x45')](JSON[_0x70a5('0x6d')](_0xeaa9f5[0x0]));if(_0x395edc[_0x70a5('0x1b1')]===_0x70a5('0x1b2')){return _0x6810dc[_0x70a5('0x145')](_0x395edc['id'])[_0x70a5('0x95')](function(_0x2ab187){var _0x16289b=_0x395edc['loggedIn']-_0x2ab187[0x0]['outboundQueuePauses'];var _0x20a00d=_0x395edc[_0x70a5('0x1b0')]*0x3c;var _0x4fdb8c=_0xeaa9f5[0x0][_0x70a5('0x4d')]+_0xeaa9f5[0x0][_0x70a5('0x50')];var _0x1af25a=(_0xeaa9f5[0x0]['predictiveIntervalAnsweredCalls']+_0xeaa9f5[0x0][_0x70a5('0x49')]+_0xeaa9f5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xeaa9f5[0x0]['predictiveIntervalTotalCalls'];var _0x1bfeb4=_0x395edc[_0x70a5('0x1a4')]/0x64;_0x395edc[_0x70a5('0x1c3')]=_0x2ab187[0x0][_0x70a5('0x1c4')]||0x0;_0x395edc[_0x70a5('0x1ab')]=_0x1af25a>0x0?_0x1af25a:0x1;return _0x6810dc['abandonmentRate'](_0x16289b,_0x20a00d,_0x4fdb8c,_0x1af25a,_0x1bfeb4);})[_0x70a5('0x95')](function(_0x46e80c){return _0x1b30da(_0x46e80c);})[_0x70a5('0x9b')](function(_0xe8dbdc){return _0xc4a30(msgResponse(_0x70a5('0x1c5'),'Failure',JSON[_0x70a5('0x6d')](_0xe8dbdc)));});}if(_0x395edc[_0x70a5('0x1b1')]==='agentBusyFactor'){return _0x6810dc[_0x70a5('0x145')](_0x395edc['id'])[_0x70a5('0x95')](function(_0x357266){var _0x5dd77c=_0x395edc[_0x70a5('0x1c6')]-_0x357266[0x0][_0x70a5('0x1c4')];var _0x4b3274=_0x395edc[_0x70a5('0x1b0')]*0x3c;var _0x1f13c8=_0xeaa9f5[0x0]['predictiveIntervalAvgTalktime']+_0xeaa9f5[0x0][_0x70a5('0x50')];var _0x13ea15=(_0xeaa9f5[0x0][_0x70a5('0x48')]+_0xeaa9f5[0x0][_0x70a5('0x49')]+_0xeaa9f5[0x0][_0x70a5('0x4b')])/_0xeaa9f5[0x0][_0x70a5('0x46')];var _0x137a69=_0x395edc[_0x70a5('0x1a4')]/0x64;_0x395edc[_0x70a5('0x1c3')]=_0x357266[0x0]['outboundQueuePauses']||0x0;_0x395edc['predictiveIntervalHitRate']=_0x13ea15>0x0?_0x13ea15:0x1;return _0x6810dc[_0x70a5('0x1c1')](_0x5dd77c,_0x4b3274,_0x1f13c8,_0x13ea15,_0x137a69);})[_0x70a5('0x95')](function(_0x2cd9ce){return _0x1b30da(_0x2cd9ce);})[_0x70a5('0x9b')](function(_0x23b47e){return _0xc4a30(msgResponse('[CatchErlangB]',_0x70a5('0x8c'),JSON[_0x70a5('0x6d')](_0x23b47e)));});}}else{return _0xc4a30(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x70a5('0x1a')][_0x70a5('0x1ba')]=function(_0x21fb1e){var _0xe1f711=this;return function(){var _0x969ba6=0x0;var _0x49805e=Math[_0x70a5('0x1aa')](_0x21fb1e['erlangCallToSecond']*0x3e8);if(_0x49805e>0x0){_0x49805e=_0x49805e<0x64?0x64:_0x49805e;loggerPredictive[_0x70a5('0x45')](_0x21fb1e[_0x70a5('0x42')],'one\x20call\x20every:',_0x49805e,_0x70a5('0x1c7'));_0x21fb1e['handlePredictive']=setInterval(function(){_0xe1f711[_0x70a5('0x60')](_0x21fb1e);loggerPredictiveCalls[_0x70a5('0x45')](_0x70a5('0x1c8'),_0x969ba6+=0x1);},_0x49805e);}else{loggerPredictive['info'](_0x21fb1e[_0x70a5('0x42')],_0x70a5('0x1c9'));}};};Dialer[_0x70a5('0x1a')][_0x70a5('0x1ca')]=function(_0x54115e,_0x439eb6){var _0x40961f=this;return function(_0x50c50d){if(_['isEmpty'](_0x50c50d)){if(_[_0x70a5('0xf0')](_0x439eb6[_0x70a5('0x148')])||!_0x439eb6[_0x70a5('0x1cb')]){if(_0x54115e['dialMethod']===_0x70a5('0xac')){_0x54115e[_0x70a5('0x6b')]=_['isUndefined'](_0x54115e[_0x70a5('0x6b')])?!![]:_0x54115e[_0x70a5('0x6b')];var _0x5427ea=uuid['v4']();_0x40961f[_0x70a5('0xe9')][_0x5427ea]=new Action(_0x54115e,_0x439eb6,_0x5427ea);loggerBooked['info']('[booked][checkContactBlack]',_0x5427ea,_0x70a5('0x1cc'),JSON['stringify'](_0x54115e[_0x70a5('0x6b')]),_0x70a5('0x1cd'),_0x54115e[_0x70a5('0x42')]);if(_0x54115e[_0x70a5('0x6b')]){_0x54115e[_0x70a5('0x6b')]=![];_0x40961f['queueBooked'][_0x40961f[_0x70a5('0xe9')][_0x5427ea]['queue']]=[];ami[_0x70a5('0x98')]({'actionid':_0x5427ea,'action':_0x70a5('0x1ce'),'queue':_0x54115e[_0x70a5('0x42')]})['catch'](function(){_0x40961f[_0x70a5('0xb9')](_0x54115e);hopperUtils[_0x70a5('0xd1')]({'active':![],'ContactId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xe5')],'ListId':_0x40961f['actions'][_0x5427ea]['ListId'],'VoiceQueueId':_0x40961f[_0x70a5('0xe9')][_0x5427ea]['VoiceQueueId']||undefined,'CampaignId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1cf')));delete _0x40961f[_0x70a5('0xe9')][_0x5427ea];});}else{loggerBooked['info'](_0x70a5('0x1d0'),JSON['stringify'](_0x54115e[_0x70a5('0x6b')]),_0x70a5('0x1cd'),_0x54115e[_0x70a5('0x42')]);_0x40961f[_0x70a5('0xb9')](_0x54115e);hopperUtils[_0x70a5('0xd1')]({'active':![],'ContactId':_0x40961f['actions'][_0x5427ea][_0x70a5('0xe5')],'ListId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xe6')],'VoiceQueueId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xd4')]||undefined,'CampaignId':_0x40961f[_0x70a5('0xe9')][_0x5427ea][_0x70a5('0xd5')]||undefined})[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1cf')));delete _0x40961f[_0x70a5('0xe9')][_0x5427ea];}}else{return _0x40961f[_0x70a5('0x1d1')](_0x54115e,_0x439eb6);}}else{if(utils[_0x70a5('0x5c')](undefined,_0x439eb6[_0x70a5('0x1d2')])<_0x54115e[_0x70a5('0x1d3')]*0x3c){if(_0x439eb6[_0x70a5('0x13d')]&&!_0x439eb6[_0x70a5('0x13d')][_0x70a5('0x1d4')]){_0x40961f[_0x70a5('0x1e')][_0x70a5('0xf5')](_0x439eb6['id'])[_0x70a5('0xf7')](function(){_0x40961f[_0x70a5('0xb9')](_0x54115e);});}else{hopperUtils[_0x70a5('0x1d5')]({'active':![]},_0x439eb6['id'],0x1)[_0x70a5('0xf7')](function(){_0x40961f['updateOriginated'](_0x54115e);});}}else{_0x54115e[_0x70a5('0x1d6')]+=0x1;_0x40961f[_0x70a5('0xb9')](_0x54115e);if(_0x54115e[_0x70a5('0x1d7')]){hopperUtils[_0x70a5('0xd1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x439eb6['ContactId'],'ListId':_0x439eb6['ListId'],'VoiceQueueId':_0x439eb6[_0x70a5('0xd4')]||undefined,'CampaignId':_0x439eb6[_0x70a5('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x70a5('0xda')](createObjHistory(_0x54115e,_0x439eb6,utils['CAMPAIGN_STATUS'][_0x70a5('0x1d8')],0x17,_0x70a5('0x1d9')))[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1da')));}else{_0x40961f[_0x70a5('0x111')](createObjHistory(_0x54115e,_0x439eb6,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x70a5('0x1db'),_0x70a5('0x1dc'));}}}}else{_0x54115e[_0x70a5('0x1dd')]+=0x1;_0x40961f[_0x70a5('0x111')](createObjHistory(_0x54115e,_0x439eb6,utils[_0x70a5('0x67')][_0x70a5('0x1de')],0xd,_0x70a5('0x1df')),_0x70a5('0x1e0'),'[Originate][MoveBlacklist]');throw _0x70a5('0x1e1');}};};Dialer[_0x70a5('0x1a')]['handleIvr']=function(_0x3f8c24){var _0x40e3c0=this;var _0x3f0d7c=_0x3f8c24[_0x70a5('0x1e2')]-_0x3f8c24[_0x70a5('0x77')]-_0x3f8c24[_0x70a5('0x1e3')];emitCampaignSummary(_0x3f8c24);if(_0x3f0d7c>0x0){if(_0x3f0d7c>this[_0x70a5('0x22')]){_0x3f0d7c=this[_0x70a5('0x22')];}_0x3f8c24[_0x70a5('0x1e3')]+=_0x3f0d7c;hopperUtils[_0x70a5('0x1e4')](_0x3f8c24['id'],_0x3f0d7c,_0x3f8c24[_0x70a5('0x1e5')],_0x3f8c24)['then'](function(_0x5226f5){_0x3f8c24['temp']-=_0x3f0d7c;_0x3f8c24[_0x70a5('0x1e3')]=_0x3f8c24[_0x70a5('0x1e3')]>0x0?_0x3f8c24[_0x70a5('0x1e3')]:0x0;if(!utils[_0x70a5('0x1e6')](_0x5226f5)){_0x3f8c24[_0x70a5('0x65')]=utils[_0x70a5('0x67')]['NO_AVAILABLE_CONTACTS'];logger[_0x70a5('0x45')]('[getContactCampaign2][Empty]'+_0x3f8c24[_0x70a5('0x42')]);}else{_0x3f8c24['originated']+=_0x5226f5[_0x70a5('0x13a')];_0x3f8c24[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x1e7')];for(var _0x5738a6=0x0;_0x5738a6<_0x5226f5['length'];_0x5738a6+=0x1){_0x3f8c24[_0x70a5('0x1e8')]+=0x1;if(_[_0x70a5('0xf0')](_0x5226f5[_0x5738a6])||_['isNil'](_0x5226f5[_0x5738a6][_0x70a5('0x164')])||_[_0x70a5('0xf0')](_0x5226f5[_0x5738a6][_0x70a5('0x14d')])){_0x40e3c0[_0x70a5('0x146')]('[actionOriginate]\x20',_0x3f8c24,_0x5226f5[_0x5738a6]);}else{hopperUtils[_0x70a5('0x1e9')](_[_0x70a5('0x6e')](_0x5226f5[_0x5738a6],['CampaignId',_0x70a5('0x14d')]))[_0x70a5('0x95')](_0x40e3c0['checkContactBlack'](_0x3f8c24,_0x5226f5[_0x5738a6]))[_0x70a5('0x9b')](_0x40e3c0['loggerHandler'](_0x70a5('0x1ea'),_0x3f8c24));}}}})['catch'](loggerGetContactDialer(_0x70a5('0x1eb'),_0x3f8c24,_0x3f0d7c));}};Dialer[_0x70a5('0x1a')][_0x70a5('0xa9')]=function(_0x4b4c1f,_0x5f30a5){var _0x18f6d2=this;var _0x4ea08a=[];if(_0x5f30a5<0x1||_0x4b4c1f[_0x70a5('0xa7')]===_0x70a5('0xac')){_0x5f30a5=0x1;}var _0x5d772b=Math[_0x70a5('0x1aa')](_0x4b4c1f['available']*_0x5f30a5)-_0x4b4c1f['originated']-_0x4b4c1f['temp'];if(_0x4b4c1f['dialLimitQueue']>0x0){var _0x5b1ca0=_0x4b4c1f[_0x70a5('0x1ec')]-_0x4b4c1f['originated']-_0x4b4c1f[_0x70a5('0x1a9')]-_0x4b4c1f['temp']-_0x4b4c1f[_0x70a5('0x132')];if(_0x5d772b>_0x5b1ca0){_0x5d772b=_0x5b1ca0;}}if(_0x5d772b>0x0){if(_0x4b4c1f[_0x70a5('0xa7')]==='booked'){_0x5d772b=0x1;}if(_0x5d772b>this[_0x70a5('0x22')]){_0x5d772b=this[_0x70a5('0x22')];}_0x4b4c1f[_0x70a5('0x1e3')]+=_0x5d772b;for(var _0xfc721d in this[_0x70a5('0x21')]){if(typeof this[_0x70a5('0x21')][_0xfc721d]!==_0x70a5('0xa2')){if(this[_0x70a5('0x21')][_0xfc721d][_0x70a5('0xc6')]===_0x70a5('0x1ed')&&this[_0x70a5('0x21')][_0xfc721d][_0x70a5('0x81')]===_0x70a5('0x82')){_0x4ea08a['push'](this[_0x70a5('0x21')][_0xfc721d]['id']);}}}hopperUtils[_0x70a5('0x1ee')](_0x4b4c1f,_0x4ea08a,_0x5d772b)[_0x70a5('0x95')](function(_0x5dfa79){_0x4b4c1f[_0x70a5('0x1e3')]-=_0x5d772b;_0x4b4c1f[_0x70a5('0x1e3')]=_0x4b4c1f[_0x70a5('0x1e3')]>0x0?_0x4b4c1f[_0x70a5('0x1e3')]:0x0;if(!utils[_0x70a5('0x1e6')](_0x5dfa79)){hopperUtils[_0x70a5('0x1ef')](_0x4b4c1f)[_0x70a5('0x95')](sendMessageReschedule(_0x4b4c1f))[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1f0')));}else{_0x4b4c1f['originated']+=_0x5dfa79[_0x70a5('0x13a')];_0x4b4c1f[_0x70a5('0x65')]=_0x4b4c1f['dialMethod']===_0x70a5('0xac')?utils[_0x70a5('0x67')][_0x70a5('0x133')]:utils[_0x70a5('0x67')][_0x70a5('0x1e7')];for(var _0x413798=0x0;_0x413798<_0x5dfa79[_0x70a5('0x13a')];_0x413798+=0x1){if(_[_0x70a5('0xf0')](_0x5dfa79[_0x413798])||_['isNil'](_0x5dfa79[_0x413798][_0x70a5('0x164')])||_[_0x70a5('0xf0')](_0x5dfa79[_0x413798][_0x70a5('0x14d')])){_0x18f6d2[_0x70a5('0x146')](_0x70a5('0x1f1'),_0x4b4c1f,_0x5dfa79[_0x413798]);}else{hopperUtils[_0x70a5('0x1f2')](_[_0x70a5('0x6e')](_0x5dfa79[_0x413798],[_0x70a5('0xd4'),_0x70a5('0x14d')]))[_0x70a5('0x95')](_0x18f6d2[_0x70a5('0x1ca')](_0x4b4c1f,_0x5dfa79[_0x413798]))[_0x70a5('0x9b')](_0x18f6d2[_0x70a5('0x1f3')](_0x70a5('0x1f1'),_0x4b4c1f));}}}})['catch'](loggerGetContactDialer(_0x70a5('0x1f4'),_0x4b4c1f,_0x5d772b));}};Dialer[_0x70a5('0x1a')][_0x70a5('0x60')]=function(_0x2092fc){if(_0x2092fc[_0x70a5('0x1ec')]>0x0){var _0x52b39d=_0x2092fc[_0x70a5('0x1ec')]-_0x2092fc[_0x70a5('0x77')]-_0x2092fc[_0x70a5('0x1a9')];if(_0x52b39d>0x0){this[_0x70a5('0x1f5')](_0x2092fc);}else{loggerPredictiveCalls[_0x70a5('0x45')](_0x70a5('0x1f6'));}}else{this[_0x70a5('0x1f5')](_0x2092fc);}};Dialer['prototype'][_0x70a5('0x1f5')]=function(_0x5de46a){var _0x4e7bfe=this;var _0x374ebf=[];_0x5de46a[_0x70a5('0x77')]+=0x1;for(var _0x6cd3ad in this[_0x70a5('0x21')]){if(typeof this['agents'][_0x6cd3ad]!==_0x70a5('0xa2')){if(this['agents'][_0x6cd3ad][_0x70a5('0xc6')]===_0x70a5('0x1ed')&&this[_0x70a5('0x21')][_0x6cd3ad][_0x70a5('0x81')]===_0x70a5('0x82')){_0x374ebf[_0x70a5('0x93')](this['agents'][_0x6cd3ad]['id']);}}}return this[_0x70a5('0x1ee')](_0x5de46a['id'],_0x374ebf,0x1,_0x5de46a[_0x70a5('0x1e5')],_0x5de46a)[_0x70a5('0x95')](function(_0x18687f){if(!utils[_0x70a5('0x1e6')](_0x18687f)){utils[_0x70a5('0x63')](_0x5de46a,0x1,0x0);return hopperUtils[_0x70a5('0x1ef')](_0x5de46a)['then'](sendMessageReschedule(_0x5de46a))[_0x70a5('0x9b')](loggerCatch(_0x70a5('0x1f0')));}else{_0x5de46a[_0x70a5('0x65')]=utils[_0x70a5('0x67')][_0x70a5('0x1e7')];if(_[_0x70a5('0xf0')](_0x18687f[0x0])||_['isNil'](_0x18687f[0x0][_0x70a5('0x164')])||_['isNil'](_0x18687f[0x0][_0x70a5('0x14d')])){_0x4e7bfe[_0x70a5('0x146')]('[actionOriginate]\x20',_0x5de46a,_0x18687f[0x0]);}else{return hopperUtils[_0x70a5('0x1f2')](_[_0x70a5('0x6e')](_0x18687f[0x0],[_0x70a5('0xd4'),'phone']))[_0x70a5('0x95')](_0x4e7bfe['checkContactBlack'](_0x5de46a,_0x18687f[0x0]))[_0x70a5('0x9b')](_0x4e7bfe[_0x70a5('0x1f3')](_0x70a5('0x1f7'),_0x5de46a));}}})[_0x70a5('0x9b')](loggerGetContactDialer(_0x70a5('0x1f8'),_0x5de46a,0x1));};Dialer['prototype'][_0x70a5('0x1bf')]=function(_0x211a18,_0x3e80a1,_0x5bac1a,_0x3aab59,_0x5a8572,_0x10a6b1){loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1f9'));loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fa'),_0x211a18);loggerPredictive['info'](_0x70a5('0x1fb'),_0x3e80a1);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fc'),_0x5bac1a);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fd'),_0x3aab59);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fe'),_0x5a8572);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));return new Promise(function(_0x16926f,_0x41114e){if(_0x211a18<=0x0||isNaN(_0x211a18)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),_0x70a5('0x7c'),_0x70a5('0x200')+_0x211a18));}if(_0x5bac1a<=0x0||isNaN(_0x5bac1a)){return _0x41114e(msgResponse('[abandonmentRate]','Error',_0x70a5('0x201')+_0x5bac1a));}if(_0x3aab59<=0x0||isNaN(_0x3aab59)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),'Error',_0x70a5('0x202')+_0x3aab59));}if(_0x3e80a1<=0x0||isNaN(_0x3e80a1)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),_0x70a5('0x7c'),_0x70a5('0x203')+_0x3e80a1));}if(_0x5a8572<=0x0||isNaN(_0x5a8572)){return _0x41114e(msgResponse(_0x70a5('0x1ff'),_0x70a5('0x7c'),'Amax\x20=\x20'+_0x5a8572));}_0x10a6b1=_0x10a6b1||0x0;var _0x1ac017=0x1/_0x5bac1a;var _0x4c7e5d=0x0;var _0x2b0685=0x0;var _0x4aa6b5=0x0;var _0x1bade2=0x0;for(var _0x2323ef=0x0;_0x4aa6b5<_0x5a8572;_0x2323ef+=0x1){_0x2b0685=_0x2323ef/_0x3e80a1;_0x4c7e5d=(_0x3aab59*_0x2b0685+_0x10a6b1)/_0x1ac017;_0x4aa6b5=utils['erlangb'](_0x4c7e5d,_0x211a18);_0x1bade2=_0x4c7e5d/_0x211a18*(0x1-utils[_0x70a5('0x204')](_0x4c7e5d,_0x211a18));}return _0x16926f({'erlangCalls':_0x2323ef,'erlangCallToSecond':_0x3e80a1/_0x2323ef,'erlangAbandonmentRate':_0x4aa6b5,'erlangBusyFactor':_0x1bade2});});};Dialer['prototype'][_0x70a5('0x1c1')]=function(_0x58c0bf,_0xb0dcd1,_0x49d676,_0x3cc5eb,_0x42b400,_0x37ed03){loggerPredictive[_0x70a5('0x45')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fa'),_0x58c0bf);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fb'),_0xb0dcd1);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fc'),_0x49d676);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x1fd'),_0x3cc5eb);loggerPredictive['info'](_0x70a5('0x205'),_0x42b400);loggerPredictive[_0x70a5('0x45')](_0x70a5('0x4e'));return new Promise(function(_0x32a659,_0x394093){if(_0x58c0bf<=0x0||isNaN(_0x58c0bf)){return _0x394093(msgResponse(_0x70a5('0x206'),'Error',_0x70a5('0x200')+_0x58c0bf));}if(_0x49d676<=0x0||isNaN(_0x49d676)){return _0x394093(msgResponse(_0x70a5('0x206'),_0x70a5('0x7c'),_0x70a5('0x201')+_0x49d676));}if(_0x3cc5eb<=0x0||isNaN(_0x3cc5eb)){return _0x394093(msgResponse(_0x70a5('0x206'),_0x70a5('0x7c'),_0x70a5('0x202')+_0x3cc5eb));}if(_0xb0dcd1<=0x0||isNaN(_0xb0dcd1)){return _0x394093(msgResponse(_0x70a5('0x206'),'Error','interval\x20=\x20'+_0xb0dcd1));}if(_0x42b400<=0x0||isNaN(_0x42b400)){return _0x394093(msgResponse('[busyFactor]',_0x70a5('0x7c'),_0x70a5('0x207')+_0x42b400));}_0x37ed03=_0x37ed03||0x0;var _0x37cd59=0x1/_0x49d676;var _0x538de3=0x0;var _0x44ded7=0x0;var _0x5e245e=0x0;var _0x490443=0x0;for(var _0x4c9fa2=0x0;_0x490443<_0x42b400;_0x4c9fa2+=0x1){_0x44ded7=_0x4c9fa2/_0xb0dcd1;_0x538de3=(_0x3cc5eb*_0x44ded7+_0x37ed03)/_0x37cd59;_0x5e245e=utils[_0x70a5('0x204')](_0x538de3,_0x58c0bf);_0x490443=_0x538de3/_0x58c0bf*(0x1-utils[_0x70a5('0x204')](_0x538de3,_0x58c0bf));}return _0x32a659({'erlangCalls':_0x4c9fa2,'erlangCallToSecond':_0xb0dcd1/_0x4c9fa2,'erlangAbandonmentRate':_0x5e245e,'erlangBusyFactor':_0x490443});});};module['exports']=Dialer; \ No newline at end of file +var _0x8243=['ifTimeIvr','checkIfTimeIntervals','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','length','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','ifTime','resetActiveCalls','syncCampaigns','undefined','resolve','checkIfTime','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','handlePower','power','Queue','method\x20not\x20recognized','dialGlobalInterval','Dialer::ifTime()','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','type','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','syncQueueCallerAbandon','droptime','responsetime','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','additional','rescheduleContact','countdropretry','add','minutes','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedMaxRetry','queueCallerAbandonCreateState','dialAbandonedRetryFrequency','ContactId','ListId','[rescheduleContact][Abandoned]','actions','channel','actionid','strategy','rrmemory','isNil','paused','stateinterface','locked','queueBooked','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','finally','VoiceQueueId','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','dialGlobalMaxRetry','stateGlobal','reason\x2019\x20machine....','dialMachineRetryFrequency','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundAnswerAgiCallsDay','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','inUse','talking','pTalking','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[actions]','enqueue','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','actionOriginate','object','phone','originate','getCaller','\x22agi://%s/square,%s\x22','isOutboundQueue','dialQueueOptions','dialQueueTimeout','NONE','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','updatedAt','%s%s','XMD-','toUpper','Trunk','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAvgTalktime','dropRate','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','push','getContactDialer','[actionOriginate]\x20','checkIsBlackList','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','countReScheduled','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','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]','m\x20=\x20','Umin\x20=\x20','uuid','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','then','previewRecallmeReminderInterval','isUndefined','emit','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','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','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','Error','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x8243,0x198));var _0x3824=function(_0x530bb9,_0x2f3978){_0x530bb9=_0x530bb9-0x0;var _0x75e0e6=_0x8243[_0x530bb9];return _0x75e0e6;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0x3824('0x0'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3824('0x1'));var hopperUtils=require(_0x3824('0x2'));var ut=require('../preview/util/util');var config=require(_0x3824('0x3'));var logger=require(_0x3824('0x4'))(_0x3824('0x5'));var loggerBooked=require(_0x3824('0x4'))(_0x3824('0x6'));var loggerPredictive=require('../../../config/logger')(_0x3824('0x7'));var loggerPredictiveCalls=require(_0x3824('0x4'))(_0x3824('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x3824('0x9'));var ami=require('../ami');config[_0x3824('0xa')]=_[_0x3824('0xb')](config[_0x3824('0xa')],{'host':_0x3824('0xc'),'port':0x18eb});var io=require(_0x3824('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x3824('0xe'));var voiceQueueRt=require(_0x3824('0xf'));var RpcSetting=require(_0x3824('0x10'));var Interval=require(_0x3824('0x11'));var Action=require(_0x3824('0x12'));var History=require('./models/history');var Final=require(_0x3824('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x3824('0x14'));var Hangup=require('./models/hangup');var ipAgi=process[_0x3824('0x15')][_0x3824('0x16')]||_0x3824('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x7647ab){this[_0x3824('0x18')]=this[_0x3824('0x18')]?this[_0x3824('0x18')]['finally'](_0x7647ab):_0x7647ab();};function Dialer(_0x5906c0,_0x436d67){this[_0x3824('0x19')]=new Sequence();this['preview']=_0x436d67;this['voiceQueues']=_0x5906c0[_0x3824('0x1a')];this[_0x3824('0x1b')]=_0x5906c0[_0x3824('0x1b')];this[_0x3824('0x1c')]=_0x5906c0[_0x3824('0x1c')];this[_0x3824('0x1d')]=_0x5906c0[_0x3824('0x1d')];this['maxNumberOriginate']=config[_0x3824('0x1e')]||0x2;this['channels']={};this['actions']={};this['contactsId']={};this[_0x3824('0x1f')]={};this['optionPredictive']={};this[_0x3824('0x20')]={};this[_0x3824('0x21')]={};this[_0x3824('0x22')]={};this['queueBooked']={};this[_0x3824('0x23')]={};this[_0x3824('0x24')]={};ami['on'](_0x3824('0x25'),this[_0x3824('0x26')]['bind'](this));ami['on'](_0x3824('0x27'),this['syncQueueCallerAbandon'][_0x3824('0x28')](this));ami['on'](_0x3824('0x29'),this['syncOriginateResponse'][_0x3824('0x28')](this));ami['on'](_0x3824('0x2a'),this[_0x3824('0x2b')][_0x3824('0x28')](this));ami['on'](_0x3824('0x2c'),this[_0x3824('0x9')][_0x3824('0x28')](this));ami['on'](_0x3824('0x2d'),this['syncQueueSummaryComplete'][_0x3824('0x28')](this));ami['on'](_0x3824('0x2e'),this['syncHangup'][_0x3824('0x28')](this));ami['on'](_0x3824('0x2f'),this[_0x3824('0x30')][_0x3824('0x28')](this));ami['on'](_0x3824('0x31'),this[_0x3824('0x32')][_0x3824('0x28')](this));ami['on'](_0x3824('0x33'),this[_0x3824('0x34')][_0x3824('0x28')](this));ami['on'](_0x3824('0x35'),this[_0x3824('0x36')][_0x3824('0x28')](this));this[_0x3824('0x37')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x3824('0x38')](function(_0x43f362){previewRecallmeReminderInterval=_0x43f362[_0x3824('0x39')];});}function isNotNull(_0x112f54){return _0x112f54!==null&&!_[_0x3824('0x3a')](_0x112f54);}function msgResponse(_0x48e8a9,_0x25f779,_0x27b7ab){return{'action':_0x48e8a9,'response':_0x25f779,'message':_0x27b7ab,'stack':_0x27b7ab};}function emit(_0x5b65e0,_0x4a3386,_0x2f8b9f){io['to'](_0x5b65e0)[_0x3824('0x3b')](_0x4a3386,_0x2f8b9f);}function emitOutboundVoiceQueueSummary(_0x284c7f){if(_0x284c7f['type']==='outbound'){logger[_0x3824('0x3c')](_0x3824('0x3d'),util[_0x3824('0x3e')](_0x284c7f,{'showHidden':![],'depth':null}));emit(util[_0x3824('0x3f')]('voice:queue:%s',_0x284c7f['name']),_0x3824('0x40'),_0x284c7f);}}function checkGetDataPredictive(_0x10c6a4){if(isNotNull(_0x10c6a4)&&!_[_0x3824('0x41')](_0x10c6a4)){loggerPredictive[_0x3824('0x42')](_0x3824('0x43'));loggerPredictive[_0x3824('0x42')](_0x3824('0x44'),_0x10c6a4[_0x3824('0x45')]);loggerPredictive[_0x3824('0x42')](_0x3824('0x46'),_0x10c6a4[_0x3824('0x47')]);loggerPredictive[_0x3824('0x42')](_0x3824('0x48'),_0x10c6a4[_0x3824('0x49')]);loggerPredictive[_0x3824('0x42')](_0x3824('0x4a'),_0x10c6a4['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10c6a4['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x3824('0x42')](_0x3824('0x4b'),_0x10c6a4['predictiveIntervalAvgTalktime']);loggerPredictive[_0x3824('0x42')](_0x3824('0x4c'));if(_0x10c6a4['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x10c6a4['predictiveIntervalAvgTalktime'])&&_0x10c6a4['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x3824('0x42')](_0x3824('0x4d'));if(!_['isUndefined'](_0x10c6a4[_0x3824('0x4e')])&&_0x10c6a4[_0x3824('0x4e')]>0x0){return!![];}loggerPredictive[_0x3824('0x42')](_0x3824('0x4f'));}else{loggerPredictive[_0x3824('0x42')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x3824('0x42')](_0x3824('0x50'));}return![];}function mergeDataErlangB(_0x514a2a){return function(_0x269ab6){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x3824('0x51'),_0x269ab6[_0x3824('0x52')]);loggerPredictive['info'](_0x3824('0x53'),_0x269ab6[_0x3824('0x54')]);loggerPredictive[_0x3824('0x42')](_0x3824('0x55'),_0x269ab6[_0x3824('0x56')]);loggerPredictive[_0x3824('0x42')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x269ab6[_0x3824('0x57')]);loggerPredictive[_0x3824('0x42')](_0x3824('0x55'),_0x269ab6[_0x3824('0x56')]);loggerPredictive['info']('---------------------------');_[_0x3824('0x58')](_0x514a2a,_0x269ab6);};}function ifInterval(_0x357121,_0x5f1c0d){if(_[_0x3824('0x3a')](_0x5f1c0d)){return![];}return utils[_0x3824('0x59')](undefined,_0x5f1c0d)<_0x357121*0x3c;}function clearPredictiveAttributes(_0x49da1b){if(_0x49da1b['startProgressive']){_0x49da1b[_0x3824('0x21')]=undefined;loggerPredictive['debug'](_0x49da1b[_0x3824('0x5a')],_0x3824('0x5b'));}if(_0x49da1b[_0x3824('0x20')]){_0x49da1b[_0x3824('0x20')]=undefined;loggerPredictive[_0x3824('0x3c')](_0x49da1b['name'],'startPredictive\x20value\x20cleared');}if(_0x49da1b[_0x3824('0x5c')]){clearInterval(_0x49da1b['handlePredictive']);_0x49da1b[_0x3824('0x5c')]=undefined;loggerPredictive[_0x3824('0x3c')](_0x49da1b[_0x3824('0x5a')],_0x3824('0x5d'));}}function loggerCatchPredictive(_0x5090a7,_0xe036ef){return function(_0x3be7b9){loggerPredictive[_0x3824('0x5e')](_0xe036ef[_0x3824('0x5a')],_0x5090a7);loggerPredictive[_0x3824('0x5e')](_0x3be7b9[_0x3824('0x5f')]);clearPredictiveAttributes(_0xe036ef);};}function loggerCatch(_0x4ac78f){return function(_0x3fc31f){logger['error'](_0x4ac78f,util[_0x3824('0x3e')](_0x3fc31f,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x5a9f87,_0x2660ca,_0x392d59){return function(_0x4b2f13){utils[_0x3824('0x60')](_0x2660ca,_0x392d59,0x0);logger['error'](_0x5a9f87,util[_0x3824('0x3e')](_0x4b2f13,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x6c9705){return function(_0x18e4fa){if(isNotNull(_0x18e4fa)&&isNotNull(_0x18e4fa[0x0])){if(_0x18e4fa[0x0][_0x3824('0x61')]>0x0){_0x6c9705[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x64')];logger[_0x3824('0x42')](_0x3824('0x65')+_0x6c9705[_0x3824('0x5a')],_0x18e4fa[0x0][_0x3824('0x61')],_0x3824('0x66'));}else{_0x6c9705[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x67')];logger['info'](_0x3824('0x68')+_0x6c9705[_0x3824('0x5a')]);}}};}function createObjHistory(_0xdf41a,_0x2021e7,_0x8da2a7,_0x2e1401,_0x2a502c){_0xdf41a['message']=_0x8da2a7;var _0x3495c8=new Action(_0xdf41a,_0x2021e7);var _0x3c6b7c=new History(_0x3495c8);_0x3c6b7c[_0x3824('0x69')]=_0x2e1401;_0x3c6b7c[_0x3824('0x6a')]=_0x2a502c;_0x3c6b7c[_0x3824('0x6b')]=_0x3495c8[_0x3824('0x6c')];return _0x3c6b7c;}function unlockQueueStatus(_0x12cdd1,_0x2d6f8d){setTimeout(function(){if(_['isUndefined'](_0x12cdd1[_0x3824('0x6d')])){loggerBooked[_0x3824('0x5e')]('[unlockQueueStatus][undefined]',_0x2d6f8d);}_0x12cdd1['queueStatusComplete']=!![];loggerBooked[_0x3824('0x42')](_0x3824('0x6e'),_0x2d6f8d,JSON[_0x3824('0x6f')](_[_0x3824('0x70')](_0x12cdd1,[_0x3824('0x5a'),_0x3824('0x6d')])));},0x1f3);}function checkInterval(_0x3638c5){return function(){if(!isNotNull(_0x3638c5[_0x3824('0x71')])){_0x3638c5[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x72')];throw _0x3638c5[_0x3824('0x5a')]+_0x3824('0x73');}if(!isNotNull(_0x3638c5[_0x3824('0x71')][_0x3824('0x74')])){_0x3638c5['message']=utils['CAMPAIGN_STATUS'][_0x3824('0x72')];throw _0x3638c5[_0x3824('0x5a')]+_0x3824('0x73');}if(!isNotNull(_[_0x3824('0x41')](_0x3638c5[_0x3824('0x71')][_0x3824('0x74')]))){_0x3638c5[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x72')];throw _0x3638c5[_0x3824('0x5a')]+_0x3824('0x73');}};}function checkIsIVRCampaignActive(_0x1ae3b6){return function(){if(!utils[_0x3824('0x75')](_0x1ae3b6)){_0x1ae3b6[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x76')];throw _0x1ae3b6[_0x3824('0x5a')]+_0x3824('0x77');}};}function emitCampaignSummary(_0x31e589){if(utils[_0x3824('0x78')](_0x31e589)){emit(util[_0x3824('0x3f')](_0x3824('0x79'),_0x31e589[_0x3824('0x5a')]),'campaign:save',_0x31e589);}}function loggerCatchQueueSummary(_0x1af9bf,_0x57facc){return function(_0x235813){clearPredictiveAttributes(_0x57facc);emitCampaignSummary(_0x57facc);loggerSyncQueueSummary[_0x3824('0x3c')](_0x1af9bf,util[_0x3824('0x3e')](_0x235813,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xa29646){if(_0xa29646[_0x3824('0x7a')]){if(_0xa29646['originated']===0x0){_0xa29646[_0x3824('0x7a')]=![];_0xa29646[_0x3824('0x62')]=utils['CAMPAIGN_STATUS'][_0x3824('0x76')];loggerSyncQueueSummary[_0x3824('0x3c')](_0x3824('0x7b'),_0xa29646[_0x3824('0x5a')],_0x3824('0x7c'));}else{_0xa29646[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x7d')];loggerSyncQueueSummary[_0x3824('0x3c')](_0x3824('0x7b'),_0xa29646[_0x3824('0x5a')],'is\x20disactive');}emitCampaignSummary(_0xa29646);}}function myreject(_0x88fedb){return function(_0x324105){return _0x88fedb(msgResponse('[ifTime][Action]',_0x3824('0x7e'),JSON[_0x3824('0x6f')](_0x324105)));};}Dialer[_0x3824('0x7f')][_0x3824('0x80')]=function(_0xb3f4ff){return!_[_0x3824('0x3a')](_0xb3f4ff)&&_0xb3f4ff&&!_[_0x3824('0x3a')](_0xb3f4ff[_0x3824('0x5a')])&&!_['isUndefined'](_0xb3f4ff[_0x3824('0x81')])&&_0xb3f4ff['active']&&(this['trunks'][util[_0x3824('0x3f')](_0x3824('0x82'),_0xb3f4ff[_0x3824('0x5a')])][_0x3824('0x83')]===_0x3824('0x84')||this[_0x3824('0x1d')][util[_0x3824('0x3f')](_0x3824('0x82'),_0xb3f4ff['name'])][_0x3824('0x83')]===_0x3824('0x85'));};Dialer['prototype'][_0x3824('0x86')]=function(_0xc8e9){var _0x5eb341=this;return function(){if(!_0x5eb341[_0x3824('0x80')](_0xc8e9['Trunk'])){if(!_0x5eb341[_0x3824('0x80')](_0xc8e9[_0x3824('0x87')])){_0xc8e9[_0x3824('0x62')]=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0xc8e9[_0x3824('0x5a')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x3824('0x7f')]['checkIfTime']=function(_0x4b34a4,_0x58e82e,_0x14b5a4,_0x29f169){var _0x2fa050=this;return function(){var _0x74d842=!![];return _0x2fa050[_0x3824('0x88')](_0x4b34a4,_0x58e82e,_0x14b5a4,_0x29f169,_0x74d842);};};Dialer[_0x3824('0x7f')][_0x3824('0x89')]=function(_0x2a995d,_0x22bc48,_0x486409,_0x325b9a){var _0x42119c=this;return function(){var _0x443011=![];return _0x42119c[_0x3824('0x88')](_0x2a995d[_0x3824('0x74')],_0x22bc48,_0x486409,_0x325b9a,_0x443011);};};Dialer[_0x3824('0x7f')]['ifTimeIvr']=function(_0x11cdc6,_0xf54fa1,_0x1feb9d,_0x39c6d4,_0x36515a){var _0x22a554=[];return new Promise(function(_0x1a436,_0x1eacad){if(!isNotNull(_0x11cdc6)){_0x39c6d4[_0x3824('0x62')]=utils[_0x3824('0x63')]['NULL_INTERVAL'];return _0x1eacad(msgResponse('ifTime',_0x3824('0x8a'),_0x1feb9d+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x3824('0x41')](_0x11cdc6)){_0x39c6d4['message']=utils[_0x3824('0x63')][_0x3824('0x8b')];return _0x1eacad(msgResponse('ifTime',_0x3824('0x8a'),_0x1feb9d+_0x3824('0x8c')));}if(_0xf54fa1&&_['isUndefined'](config[_0x3824('0x8d')][_0xf54fa1])){_0x39c6d4['message']=utils[_0x3824('0x63')][_0x3824('0x8e')];return _0x1eacad(msgResponse('ifTime',_0x3824('0x8a'),_0x1feb9d+'\x20Timezone\x20unknow\x20'+_0xf54fa1));}if(_['isArray'](_0x11cdc6)){for(var _0x4b8e14=0x0;_0x4b8e14<_0x11cdc6[_0x3824('0x8f')];_0x4b8e14+=0x1){_0x22a554['push'](ami[_0x3824('0x90')]({'action':_0x3824('0x91'),'command':util[_0x3824('0x3f')](_0x3824('0x92'),_0x11cdc6[_0x4b8e14][_0x3824('0x93')],!_[_0x3824('0x3a')](config[_0x3824('0x8d')][_0xf54fa1])?_0xf54fa1:'')})[_0x3824('0x38')](function(_0x13025e){return _0x13025e[_0x3824('0x94')][_0x3824('0x95')](_0x3824('0x96'))>=0x0;})[_0x3824('0x97')](myreject(_0x1eacad)));}}else{_0x22a554['push'](ami['Action']({'action':'command','command':util['format'](_0x3824('0x92'),_0x11cdc6,!_[_0x3824('0x3a')](config[_0x3824('0x8d')][_0xf54fa1])?_0xf54fa1:'')})['then'](function(_0x320671){return _0x320671[_0x3824('0x94')][_0x3824('0x95')](_0x3824('0x96'))>=0x0;})[_0x3824('0x97')](myreject(_0x1eacad)));}Promise['all'](_0x22a554)[_0x3824('0x38')](function(_0x25b01d){var _0x4a3cc7=_[_0x3824('0x98')](_0x25b01d);if(_0x4a3cc7){return _0x1a436(_0x4a3cc7);}else{_0x39c6d4[_0x3824('0x62')]=_0x36515a?utils[_0x3824('0x63')][_0x3824('0x99')]:utils[_0x3824('0x63')][_0x3824('0x9a')];return _0x1eacad(msgResponse(_0x3824('0x9b'),_0x3824('0x8a'),_0x3824('0x9c')+_0x36515a+'\x20'+_0x1feb9d+_0x3824('0x9d')+util['inspect'](_0x11cdc6,{'showHidden':![],'depth':null})+_0x3824('0x9e')+_0xf54fa1));}})['catch'](function(_0x3fdeff){return _0x1eacad(msgResponse(_0x3824('0x9f'),'Failure',JSON[_0x3824('0x6f')](_0x3fdeff)));});});};Dialer[_0x3824('0x7f')][_0x3824('0x37')]=function(){var _0x59aea6=this;return cmHopper[_0x3824('0xa0')]({'active':![]},{'where':{'active':!![]}})[_0x3824('0x38')](function(){setInterval(function(){_0x59aea6[_0x3824('0xa1')]();},0x3e8);});};Dialer['prototype'][_0x3824('0xa1')]=function(){var _0x5efd83=this;var _0x1780e1;for(var _0x4844c9 in this[_0x3824('0x1b')]){if(typeof this[_0x3824('0x1b')][_0x4844c9]!==_0x3824('0xa2')){_0x1780e1=this['campaigns'][_0x4844c9];if(utils[_0x3824('0x78')](_0x1780e1)&&utils[_0x3824('0x75')](_0x1780e1)){_0x1780e1[_0x3824('0x7a')]=!![];Promise[_0x3824('0xa3')]()[_0x3824('0x38')](checkIsIVRCampaignActive(_0x1780e1))[_0x3824('0x38')](checkInterval(_0x1780e1))['then'](_0x5efd83[_0x3824('0x86')](_0x1780e1))['then'](_0x5efd83[_0x3824('0xa4')](_0x1780e1['dialGlobalInterval'],_0x1780e1[_0x3824('0xa5')],_0x1780e1[_0x3824('0x5a')],_0x1780e1))[_0x3824('0x38')](_0x5efd83[_0x3824('0x89')](_0x1780e1['Interval'],_0x1780e1[_0x3824('0xa5')],_0x1780e1[_0x3824('0x5a')],_0x1780e1))['then'](_0x5efd83[_0x3824('0xa6')](_0x1780e1))[_0x3824('0x97')](loggerCatchQueueSummary(_0x3824('0xa7'),_0x1780e1));}else{notSendMessagesCampaign(_0x1780e1);}}}};Dialer[_0x3824('0x7f')]['checkDialMethod']=function(_0x3f15f7){if(_0x3f15f7[_0x3824('0xa8')]!==_0x3824('0x7')){clearPredictiveAttributes(_0x3f15f7);}switch(_0x3f15f7[_0x3824('0xa8')]){case'progressive':this[_0x3824('0xa9')](_0x3f15f7,0x1);break;case _0x3824('0xaa'):this['handlePower'](_0x3f15f7,_0x3f15f7['dialPowerLevel']);break;case'predictive':this[_0x3824('0x7')](_0x3f15f7);break;case _0x3824('0x6'):this[_0x3824('0xa9')](_0x3f15f7,0x1);break;default:logger['error'](_0x3824('0xab'),_0x3f15f7[_0x3824('0x5a')],_0x3824('0xac'));}};Dialer[_0x3824('0x7f')][_0x3824('0x9f')]=function(_0x49be10,_0x45c4a9){var _0x535e62=_0x49be10['dialTimezone'];var _0x372cdc=_0x45c4a9?_0x49be10[_0x3824('0xad')]:_0x49be10[_0x3824('0x71')][_0x3824('0x74')];logger['silly'](_0x3824('0xae'),_0x372cdc,_0x535e62,_0x49be10[_0x3824('0x5a')],util[_0x3824('0x3f')]('Voice\x20Queue\x20%s\x20$s',_0x49be10[_0x3824('0x5a')],_0x49be10['id']));var _0x283737=null;return Interval[_0x3824('0xaf')](_0x372cdc,_0x535e62)[_0x3824('0x38')](function(_0x5f4aae){if(_0x5f4aae===!![]){return _0x5f4aae;}else{_0x49be10[_0x3824('0x62')]=_0x45c4a9?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0x3824('0x63')][_0x3824('0x9a')];_0x283737=msgResponse(_0x3824('0x9b'),'Failure',_0x3824('0x9c')+_0x45c4a9+'\x20'+_0x49be10[_0x3824('0x5a')]+_0x3824('0x9d')+util[_0x3824('0x3e')](_0x372cdc,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x535e62);}if(_0x283737!==null){logger['silly'](_0x3824('0xb0'),_0x283737);_0x283737[_0x3824('0xb1')]=_0x45c4a9;throw _0x283737;}})[_0x3824('0x97')](function(_0x2ccb2c){logger['error'](_0x3824('0xb2'),_0x2ccb2c);throw msgResponse(_0x3824('0xb3'),_0x3824('0x7e'),util[_0x3824('0x3e')](_0x2ccb2c,{'showHidden':![],'depth':null}));});};Dialer[_0x3824('0x7f')][_0x3824('0x26')]=function(_0x4c9339){if(this[_0x3824('0x1a')][_0x4c9339[_0x3824('0xb4')]]){if(this[_0x3824('0x1f')][_0x4c9339['uniqueid']]&&this[_0x3824('0x1f')][_0x4c9339[_0x3824('0xb5')]][_0x3824('0xb6')]!==_0x3824('0xb7')){this[_0x3824('0xb8')](this['voiceQueues'][_0x4c9339[_0x3824('0xb4')]]);this['uniqueId'][_0x4c9339[_0x3824('0xb5')]]['answertime']=moment()[_0x3824('0x3f')](_0x3824('0xb9'));}}};Dialer[_0x3824('0x7f')]['syncAgentComplete']=function(_0x3c46b9){var _0x48c562=this[_0x3824('0x1f')][_0x3c46b9['uniqueid']];if(this[_0x3824('0x1a')][_0x3c46b9[_0x3824('0xb4')]]){if(_0x48c562&&_0x48c562['type']!=='ivr'){delete this['uniqueId'][_0x3c46b9['uniqueid']];this['voiceQueues'][_0x3c46b9[_0x3824('0xb4')]]['outboundAnswerCallsDay']+=0x1;var _0x108d7c=new AgentComplete(_0x48c562,_0x3c46b9);if(_0x3c46b9[_0x3824('0xba')]===_0x3824('0xbb')){_0x108d7c[_0x3824('0xbc')]=this[_0x3824('0x1a')][_0x3c46b9['queue']][_0x3824('0xbd')]&&this[_0x3824('0x1a')][_0x3c46b9[_0x3824('0xb4')]][_0x3824('0xbe')]?moment()[_0x3824('0x3f')](_0x3824('0xb9')):undefined;}hopperUtils[_0x3824('0xbf')](_0x108d7c)[_0x3824('0x97')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x3824('0xc0')](_0x108d7c)[_0x3824('0x97')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x3824('0x7f')][_0x3824('0xc1')]=function(_0x237d86){var _0x59c38e=this['uniqueId'][_0x237d86[_0x3824('0xb5')]];var _0x124aa4=this;var _0x181658=![];var _0x222e19;var _0x2a70b2;if(this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]]){if(_0x59c38e&&_0x59c38e[_0x3824('0xb6')]!=='ivr'){delete this[_0x3824('0x1f')][_0x237d86[_0x3824('0xb5')]];this[_0x3824('0xb8')](this['voiceQueues'][_0x237d86[_0x3824('0xb4')]]);_0x59c38e[_0x3824('0xc2')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1ffd73=new QueueCallerAbandon(_0x59c38e,_0x237d86);if(utils[_0x3824('0x59')](_0x59c38e[_0x3824('0xc2')],_0x59c38e[_0x3824('0xc3')])>=_0x59c38e['dialQueueTimeout']){this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0x49')]+=0x1;this['voiceQueues'][_0x237d86[_0x3824('0xb4')]][_0x3824('0xc4')]+=0x1;this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1ffd73['state']=0xa;_0x1ffd73[_0x3824('0x6a')]=_0x3824('0xc5');_0x1ffd73[_0x3824('0xc6')]=_0x3824('0xc7');_0x1ffd73[_0x3824('0xbc')]=this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]]['dialQueueProject2']?moment()[_0x3824('0x3f')](_0x3824('0xb9')):undefined;_0x1ffd73['countdropretry']+=0x1;_0x1ffd73['countglobal']+=0x1;_0x222e19=this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xc8')];_0x2a70b2=this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xc9')];hopperUtils[_0x3824('0xca')](_0x1ffd73,_0x1ffd73['state'],_0x59c38e[_0x3824('0xcb')])[_0x3824('0x38')](function(_0x51d539){_0x181658=_0x51d539['additional']==0x1;if(_0x1ffd73['countdropretry']>=_0x124aa4['voiceQueues'][_0x237d86['queue']][_0x3824('0xcc')]){_0x124aa4['queueCallerAbandonCreateState'](_0x1ffd73,_0x51d539[_0x3824('0xcd')]);}else{hopperUtils[_0x3824('0xce')]({'active':![],'countdropretry':_0x1ffd73[_0x3824('0xcf')],'scheduledat':moment()[_0x3824('0xd0')](_0x124aa4[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xc8')],_0x3824('0xd1'))[_0x3824('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59c38e['ContactId'],'ListId':_0x59c38e['ListId'],'VoiceQueueId':_0x59c38e['VoiceQueueId']||undefined,'CampaignId':_0x59c38e[_0x3824('0xd2')]||undefined})['catch'](loggerCatch(_0x3824('0xd3')));var _0x308eff=new History(_0x1ffd73);_0x308eff['state']=0xa;_0x308eff['statedesc']=_0x3824('0xc5');_0x308eff[_0x3824('0x6c')]=moment()[_0x3824('0x3f')](_0x3824('0xb9'));_0x308eff['endtime']=_0x308eff[_0x3824('0x6c')];_0x308eff[_0x3824('0xd4')]=_0x1ffd73['calleridname'];_0x308eff['calleridnum']=_0x1ffd73[_0x3824('0xd5')];hopperUtils[_0x3824('0xbf')](_0x308eff)['catch'](loggerCatch(_0x3824('0xd6')));}})[_0x3824('0x38')](function(){if(_0x181658)hopperUtils[_0x3824('0xd7')](_0x1ffd73,_0x222e19,_0x2a70b2)['then'](function(){return 0x1;});});}else{this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xd8')]+=0x1;this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xd9')]+=0x1;_0x1ffd73[_0x3824('0x69')]=0xb;_0x1ffd73[_0x3824('0x6a')]=_0x3824('0xda');_0x1ffd73[_0x3824('0xc6')]=_0x3824('0xdb');_0x1ffd73[_0x3824('0xdc')]+=0x1;_0x1ffd73[_0x3824('0xdd')]+=0x1;_0x222e19=this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]]['dialAbandonedRetryFrequency'];_0x2a70b2=this[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xc9')];hopperUtils['verifyAdditionalPhones'](_0x1ffd73,_0x1ffd73[_0x3824('0x69')],_0x59c38e[_0x3824('0xcb')])[_0x3824('0x38')](function(_0x1e5762){if(_0x1ffd73[_0x3824('0xdc')]>=_0x124aa4[_0x3824('0x1a')][_0x237d86[_0x3824('0xb4')]][_0x3824('0xde')]){_0x124aa4[_0x3824('0xdf')](_0x1ffd73,_0x1e5762[_0x3824('0xcd')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1ffd73[_0x3824('0xdc')],'scheduledat':moment()['add'](_0x124aa4['voiceQueues'][_0x237d86[_0x3824('0xb4')]][_0x3824('0xe0')],'minutes')[_0x3824('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59c38e[_0x3824('0xe1')],'ListId':_0x59c38e[_0x3824('0xe2')],'VoiceQueueId':_0x59c38e['VoiceQueueId']||undefined,'CampaignId':_0x59c38e[_0x3824('0xd2')]||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0xe3')));var _0x2ea2bb=new History(_0x1ffd73);_0x2ea2bb[_0x3824('0x69')]=0xb;_0x2ea2bb[_0x3824('0x6a')]=_0x3824('0xda');_0x2ea2bb[_0x3824('0x6c')]=moment()['format'](_0x3824('0xb9'));_0x2ea2bb[_0x3824('0x6b')]=_0x2ea2bb[_0x3824('0x6c')];_0x2ea2bb[_0x3824('0xd4')]=_0x1ffd73[_0x3824('0xd4')];_0x2ea2bb[_0x3824('0xd5')]=_0x1ffd73['calleridnum'];hopperUtils[_0x3824('0xbf')](_0x2ea2bb)[_0x3824('0x97')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x3824('0x38')](function(){if(_0x181658)hopperUtils[_0x3824('0xd7')](_0x1ffd73,_0x222e19,_0x2a70b2)[_0x3824('0x38')](function(){return 0x1;});});}}}};Dialer[_0x3824('0x7f')]['syncNewExten']=function(_0x20d29a){if(this['actions'][_0x20d29a[_0x3824('0xb5')]]){this[_0x3824('0xe4')][_0x20d29a[_0x3824('0xb5')]]['channel']=_0x20d29a[_0x3824('0xe5')];}if(this['uniqueId'][_0x20d29a[_0x3824('0xb5')]]){this[_0x3824('0x1f')][_0x20d29a[_0x3824('0xb5')]][_0x3824('0xe5')]=_0x20d29a[_0x3824('0xe5')];}};Dialer[_0x3824('0x7f')][_0x3824('0x34')]=function(_0x37cf58){if(!this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]]){return;}var _0x50cc0f=this[_0x3824('0x1a')][this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]][_0x3824('0xb4')]][_0x3824('0xe7')]||_0x3824('0xe8');if(_0x50cc0f==='roundrobin'){if(this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]]&&_[_0x3824('0xe9')](this['actions'][_0x37cf58[_0x3824('0xe6')]]['locked'])&&_0x37cf58[_0x3824('0x83')]==='1'&&_0x37cf58[_0x3824('0xea')]==='0'){if(this[_0x3824('0x1c')][_0x37cf58[_0x3824('0xeb')]]){if(!this[_0x3824('0x1c')][_0x37cf58[_0x3824('0xeb')]][_0x3824('0xec')]){this['agents'][_0x37cf58[_0x3824('0xeb')]][_0x3824('0xec')]=!![];this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]][_0x3824('0xec')]=!![];this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]][_0x3824('0xeb')]=_0x37cf58[_0x3824('0xeb')];}}}}else if(_0x50cc0f==='rrmemory'){if(this[_0x3824('0xe4')][_0x37cf58['actionid']]){if(this[_0x3824('0x1c')][_0x37cf58[_0x3824('0xeb')]]){this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]][_0x3824('0xeb')]=_0x37cf58[_0x3824('0xeb')];if(_[_0x3824('0xe9')](this[_0x3824('0xed')][this[_0x3824('0xe4')][_0x37cf58['actionid']][_0x3824('0xb4')]])){this[_0x3824('0xed')][this[_0x3824('0xe4')][_0x37cf58['actionid']][_0x3824('0xb4')]]=[];}this['queueBooked'][this[_0x3824('0xe4')][_0x37cf58['actionid']]['queue']]['push'](_[_0x3824('0x58')](_['pick'](this[_0x3824('0xe4')][_0x37cf58[_0x3824('0xe6')]],[_0x3824('0xee'),_0x3824('0xeb')]),{'status':_0x37cf58[_0x3824('0x83')],'paused':_0x37cf58[_0x3824('0xea')]}));}}}};Dialer[_0x3824('0x7f')][_0x3824('0x36')]=function(_0x3b834c){if(!this['actions'][_0x3b834c[_0x3824('0xe6')]]){return;}var _0x2da711=this;var _0x1daf50=this[_0x3824('0x1a')][this[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xb4')]];var _0x530d3c=_0x1daf50['strategy']||_0x3824('0xe8');if(_0x530d3c==='roundrobin'){if(this[_0x3824('0xe4')][_0x3b834c['actionid']]&&this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xeb')]){this['preview'][_0x3824('0xef')](this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xee')],this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xeb')])['catch'](function(_0x20f9b9){logger[_0x3824('0x5e')](_0x3824('0xf0'),util['inspect'](_0x20f9b9,{'showHidden':![],'depth':null}));})[_0x3824('0xf1')](function(){_0x2da711[_0x3824('0xb8')](_0x2da711[_0x3824('0x1a')][_0x2da711['actions'][_0x3b834c['actionid']][_0x3824('0xb4')]]);_0x2da711[_0x3824('0x1c')][_0x2da711[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xeb')]][_0x3824('0xec')]=![];delete _0x2da711[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]];unlockQueueStatus(_0x1daf50);});}else{this[_0x3824('0xb8')](this['voiceQueues'][this['actions'][_0x3b834c['actionid']]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]]['ContactId'],'ListId':this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xe2')],'VoiceQueueId':this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xf2')]||undefined,'CampaignId':this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xd2')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x3b834c[_0x3824('0xe6')]];unlockQueueStatus(_0x1daf50);}}else if(_0x530d3c===_0x3824('0xe8')){var _0x3c3243;if(this['actions'][_0x3b834c[_0x3824('0xe6')]]&&!_[_0x3824('0x41')](this[_0x3824('0xed')][this[_0x3824('0xe4')][_0x3b834c['actionid']][_0x3824('0xb4')]])){if(this[_0x3824('0x23')][_0x2da711['actions'][_0x3b834c['actionid']][_0x3824('0xb4')]]){this[_0x3824('0x23')][_0x2da711[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xb4')]]=this[_0x3824('0x23')][this[_0x3824('0xe4')][_0x3b834c['actionid']]['queue']]?this[_0x3824('0x23')][this[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xb4')]]:this[_0x3824('0xed')][this[_0x3824('0xe4')][_0x3b834c[_0x3824('0xe6')]]['queue']]?this[_0x3824('0xed')][this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xb4')]]['_rr']||0x0:0x0;}this[_0x3824('0xed')][this['actions'][_0x3b834c[_0x3824('0xe6')]][_0x3824('0xb4')]]['_rr']=this[_0x3824('0x23')][this[_0x3824('0xe4')][_0x3b834c['actionid']][_0x3824('0xb4')]];for(var _0x2d8dbf=0x0;_0x2d8dbf=_0x2fbca6['dialGlobalMaxRetry']){_0x538ca8['stateGlobal'](_0x2e50b9,_0x5c81e4,_0x217844,_0x3824('0x11b'));}else{if(_0x2e50b9[_0x3824('0x119')]>=_0x2fbca6[_0x3824('0x11c')]){_0x538ca8[_0x3824('0x11d')](_0x2e50b9,_0x5c81e4,_0x217844,'reason\x2019\x20machine....');}else{hopperUtils[_0x3824('0xce')]({'active':![],'countmachineretry':_0x2e50b9['countmachineretry'],'scheduledat':moment()[_0x3824('0xd0')](_0x2fbca6['dialMachineRetryFrequency'],'minutes')[_0x3824('0x3f')](_0x3824('0xb9')),'ContactId':_0x2e50b9[_0x3824('0xe1')],'ListId':_0x2e50b9['ListId'],'VoiceQueueId':_0x2e50b9[_0x3824('0xf2')]||undefined,'CampaignId':_0x2e50b9[_0x3824('0xd2')]||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x11e')));_0x5c81e4({'reschedule':0x1});}}});}if(_0x1b44b9['type']===_0x3824('0xb7')&&this[_0x3824('0x1b')][_0x1b44b9['queue']][_0x3824('0x107')]&&_0xc96cd9[_0x3824('0x108')]==='HANGUP'){delete this['uniqueId'][_0xc96cd9[_0x3824('0xb5')]];this[_0x3824('0xb8')](this[_0x3824('0x1b')][_0x1b44b9['queue']]);_0x7e7400=new Hangup(_0x1b44b9,_0xc96cd9);_0x7e7400['state']=0x12;_0x7e7400[_0x3824('0x6a')]=_0x3824('0x11f');_0x7e7400[_0x3824('0x10b')]=_0x3824('0x10c');ami['emit'](_0x3824('0x10d'),ut[_0x3824('0x114')](_0x7e7400,'amd'));this[_0x3824('0x10f')](_0x7e7400,_0x3824('0x120'),_0x3824('0x121'));}if(_0x1b44b9[_0x3824('0xb6')]==='ivr'&&this[_0x3824('0x1b')][_0x1b44b9['queue']]['dialAMDActive']&&_0xc96cd9[_0x3824('0x108')]===_0x3824('0x112')){return new Promise(function(_0xc9f43b,_0x2e17c4){delete _0x538ca8[_0x3824('0x1f')][_0xc96cd9[_0x3824('0xb5')]];_0x538ca8['updateOriginated'](_0x538ca8[_0x3824('0x1b')][_0x1b44b9[_0x3824('0xb4')]]);_0x538ca8[_0x3824('0x1b')][_0x1b44b9['queue']][_0x3824('0x10a')]+=0x1;_0x538ca8[_0x3824('0x1b')][_0x1b44b9[_0x3824('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x190aa4=_0x538ca8[_0x3824('0x1b')][_0x1b44b9[_0x3824('0xb4')]];var _0x362acd=new Hangup(_0x1b44b9,_0xc96cd9);_0x362acd[_0x3824('0x69')]=0x13;_0x362acd[_0x3824('0x6a')]=_0x3824('0x113');_0x362acd['membername']=_0x3824('0x10c');_0x362acd['countmachineretry']+=0x1;_0x362acd['countglobal']+=0x1;_0x362acd[_0x3824('0x10e')]=!![];ami[_0x3824('0x3b')]('custom:amd',ut[_0x3824('0x114')](_0x362acd,'amd'));hopperUtils[_0x3824('0xbf')](_0x362acd)[_0x3824('0x97')](loggerCatch(_0x3824('0x115')));if(_0x362acd[_0x3824('0x122')]+_0x362acd[_0x3824('0x116')]+_0x362acd[_0x3824('0x117')]+_0x362acd[_0x3824('0x118')]+_0x362acd[_0x3824('0xcf')]+_0x362acd[_0x3824('0xdc')]+_0x362acd['countmachineretry']+_0x362acd['countagentrejectretry']>=_0x190aa4[_0x3824('0x123')]){_0x538ca8[_0x3824('0x124')](_0x362acd,_0xc9f43b,_0x2e17c4,_0x3824('0x11b'));}else{if(_0x362acd[_0x3824('0x119')]>=_0x190aa4[_0x3824('0x11c')]){_0x538ca8[_0x3824('0x11d')](_0x362acd,_0xc9f43b,_0x2e17c4,_0x3824('0x125'));}else{hopperUtils[_0x3824('0xce')]({'active':![],'countmachineretry':_0x362acd[_0x3824('0x119')],'scheduledat':moment()[_0x3824('0xd0')](_0x190aa4[_0x3824('0x126')],_0x3824('0xd1'))['format'](_0x3824('0xb9')),'ContactId':_0x362acd[_0x3824('0xe1')],'ListId':_0x362acd[_0x3824('0xe2')],'VoiceQueueId':_0x362acd[_0x3824('0xf2')]||undefined,'CampaignId':_0x362acd[_0x3824('0xd2')]||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x11e')));_0xc9f43b({'reschedule':0x1});}}});}}};Dialer[_0x3824('0x7f')][_0x3824('0x127')]=function(_0x46ab47){var _0x431d0a=this[_0x3824('0x1f')][_0x46ab47[_0x3824('0xb5')]];var _0x33f60b;if(_0x431d0a&&_0x431d0a['type']===_0x3824('0xb7')){delete this['uniqueId'][_0x46ab47[_0x3824('0xb5')]];this[_0x3824('0xb8')](this[_0x3824('0x1b')][_0x431d0a[_0x3824('0xb4')]]);this[_0x3824('0x1b')][_0x431d0a[_0x3824('0xb4')]][_0x3824('0x128')]+=0x1;_0x33f60b=new Hangup(_0x431d0a,_0x46ab47);hopperUtils['createHistory'](_0x33f60b)[_0x3824('0x97')](loggerCatch(_0x3824('0x129')));hopperUtils[_0x3824('0xc0')](_0x33f60b)[_0x3824('0x97')](loggerCatch(_0x3824('0x12a')));}if(_0x431d0a&&_0x431d0a['type']!=='ivr'&&isNotNull(this[_0x3824('0x1a')][_0x431d0a['queue']][_0x3824('0x12b')])){delete this[_0x3824('0x1f')][_0x46ab47[_0x3824('0xb5')]];this['updateOriginated'](this[_0x3824('0x1a')][_0x431d0a[_0x3824('0xb4')]]);this[_0x3824('0x1a')][_0x431d0a['queue']][_0x3824('0x10a')]+=0x1;this['voiceQueues'][_0x431d0a['queue']][_0x3824('0x12c')]+=0x1;_0x33f60b=new Hangup(_0x431d0a,_0x46ab47);_0x33f60b[_0x3824('0x69')]=0x10;_0x33f60b['statedesc']='AnswerAGI';_0x33f60b[_0x3824('0x10b')]=_0x3824('0x12d');hopperUtils[_0x3824('0xbf')](_0x33f60b)[_0x3824('0x97')](loggerCatch(_0x3824('0x129')));hopperUtils[_0x3824('0xc0')](_0x33f60b)[_0x3824('0x97')](loggerCatch(_0x3824('0x12a')));}if(_0x431d0a&&_0x431d0a['type']!==_0x3824('0xb7')&&!isNotNull(this[_0x3824('0x1a')][_0x431d0a[_0x3824('0xb4')]][_0x3824('0x12b')])){delete this[_0x3824('0x1f')][_0x46ab47[_0x3824('0xb5')]];this['updateOriginated'](this['voiceQueues'][_0x431d0a[_0x3824('0xb4')]]);this['voiceQueues'][_0x431d0a[_0x3824('0xb4')]][_0x3824('0x12e')]+=0x1;_0x33f60b=new Hangup(_0x431d0a,_0x46ab47);_0x33f60b[_0x3824('0x69')]=0xc;_0x33f60b['statedesc']=_0x46ab47[_0x3824('0x12f')];_0x33f60b[_0x3824('0x10b')]=_0x3824('0x130');hopperUtils[_0x3824('0xbf')](_0x33f60b)[_0x3824('0x97')](loggerCatch(_0x3824('0x129')));hopperUtils[_0x3824('0xc0')](_0x33f60b)[_0x3824('0x97')](loggerCatch(_0x3824('0x12a')));}};Dialer[_0x3824('0x7f')]['syncQueueSummary']=function(_0x2fd0db){var _0x1a3646=this;if(!_0x1a3646[_0x3824('0x24')][_0x2fd0db[_0x3824('0x5a')]]){_0x1a3646[_0x3824('0x24')][_0x2fd0db[_0x3824('0x5a')]]={'running':![]};}else if(_0x1a3646[_0x3824('0x24')][_0x2fd0db[_0x3824('0x5a')]]['running']===!![]){return;}else if(_0x1a3646[_0x3824('0x24')][_0x2fd0db['name']][_0x3824('0x131')]===![]){_0x1a3646[_0x3824('0x24')][_0x2fd0db[_0x3824('0x5a')]]['running']=!![];}var _0x35713c=_0x1a3646[_0x3824('0x1a')][_0x2fd0db[_0x3824('0x5a')]];var _0x2bec3d=_0x35713c[_0x3824('0x62')]!==utils[_0x3824('0x63')][_0x3824('0x76')];var _0x2e3e86=utils[_0x3824('0x132')](_0x35713c);_0x35713c['statusMessage']=utils[_0x3824('0x133')](_0x35713c,_0x1a3646['trunks']);Promise[_0x3824('0xa3')]()[_0x3824('0x38')](function(){if(_0x35713c['statusMessage']===utils[_0x3824('0x63')][_0x3824('0x76')]){if(_0x2bec3d){clearPredictiveAttributes(_0x35713c);_0x2fd0db[_0x3824('0x20')]=undefined;_0x2fd0db[_0x3824('0x21')]=undefined;}if(_0x35713c[_0x3824('0x134')]===utils[_0x3824('0x63')][_0x3824('0x76')]){_0x2fd0db['available']=0x0;_0x2fd0db[_0x3824('0xea')]=0x0;_0x2fd0db[_0x3824('0x135')]=0x0;_0x2fd0db[_0x3824('0x136')]=0x0;_0x2fd0db[_0x3824('0x137')]=0x0;}}else if(_0x35713c['statusMessage']===utils[_0x3824('0x63')]['ACTIVE']&&!_0x2e3e86){return _0x1a3646[_0x3824('0x9f')](_0x35713c,!![])[_0x3824('0x38')](function(){return _0x1a3646[_0x3824('0x9f')](_0x35713c,![]);})[_0x3824('0x38')](function(){return _0x1a3646[_0x3824('0x138')](_0x35713c);})[_0x3824('0x97')](function(_0x1127d5){loggerSyncQueueSummary[_0x3824('0x3c')](_0x3824('0x139'),util[_0x3824('0x3e')](_0x1127d5,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x35713c);});}else{clearPredictiveAttributes(_0x35713c);}})['then'](function(){var _0x20625f=_0x2fd0db[_0x3824('0x13a')](_0x35713c);if(_0x20625f||_0x35713c['queueSummaryCountersUpdated']){_0x35713c[_0x3824('0x13b')]=![];_0x2fd0db[_0x3824('0x13c')](_0x35713c);Object[_0x3824('0x13d')](_0x35713c,_0x2fd0db);emitOutboundVoiceQueueSummary(_0x2fd0db);}_0x1a3646[_0x3824('0x24')][_0x35713c['name']][_0x3824('0x131')]=![];})['catch'](function(_0x3101c4){logger[_0x3824('0x5e')](_0x3824('0x139'),util[_0x3824('0x3e')](_0x3101c4,{'showHidden':![],'depth':null}));_0x1a3646[_0x3824('0x24')][_0x35713c['name']][_0x3824('0x131')]=![];});};Dialer['prototype']['syncQueueSummaryComplete']=_[_0x3824('0x13e')](function(){var _0x427f08=_[_0x3824('0x13f')](this[_0x3824('0x1a')],function(_0x2df0e1){return _0x2df0e1['dialPreviewRecallmeReminder'];});var _0x370cc9=_['filter'](this[_0x3824('0x1c')],function(_0x5d3456){return _0x5d3456['online']&&_0x5d3456[_0x3824('0x83')]==='reachable';});if(_0x427f08[_0x3824('0x8f')]>0x0&&_0x370cc9['length']>0x0){return Promise[_0x3824('0xa3')]()[_0x3824('0x38')](cmHopper['handlePreviewRecallNotifications'](_[_0x3824('0x140')](_0x427f08,'id'),previewRecallmeReminderInterval,_['map'](_0x370cc9,'id')))['then'](function(_0x295a94){for(var _0x4f3695=0x0;_0x4f3695<_0x295a94[_0x3824('0x8f')];_0x4f3695++){var _0x482f3a=_0x295a94[_0x4f3695][_0x3824('0x141')]['name'];if(_0x482f3a)io['to'](util[_0x3824('0x3f')](_0x3824('0x142'),_0x482f3a))[_0x3824('0x3b')](_0x3824('0x143'),{'hopper':_0x295a94[_0x4f3695]});}})[_0x3824('0x97')](function(_0x1a4d86){logger['error'](_0x3824('0x144'),_0x1a4d86);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x3824('0x145')]=function(){var _0x5ed0a9=this;setInterval(function(){_0x5ed0a9[_0x3824('0x146')](_0x5ed0a9['uniqueId'],'[uniqueid]');_0x5ed0a9[_0x3824('0x146')](_0x5ed0a9[_0x3824('0xe4')],_0x3824('0x147'));},0x32c8);};Dialer[_0x3824('0x7f')][_0x3824('0x146')]=function(_0x5288ad,_0x27b984){var _0x29e607=this;for(var _0x4fd6b0 in _0x5288ad){if(typeof _0x5288ad[_0x4fd6b0]!==_0x3824('0xa2')){this[_0x3824('0x19')][_0x3824('0x148')](function(){if(!_[_0x3824('0xe9')](_0x5288ad[_0x4fd6b0])){return ami[_0x3824('0x90')]({'action':'status','channel':_0x5288ad[_0x4fd6b0]['channel']})['catch'](function(_0x178977){if(_0x178977[_0x3824('0x62')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5288ad[_0x4fd6b0]&&_0x5288ad[_0x4fd6b0][_0x3824('0xb6')]!==_0x3824('0xb7')){_0x29e607[_0x3824('0xb8')](_0x29e607[_0x3824('0x1a')][_0x5288ad[_0x4fd6b0][_0x3824('0xb4')]]);logger[_0x3824('0x5e')]('[Dialer][checkChannel]',_0x27b984,_0x4fd6b0,_0x5288ad[_0x4fd6b0][_0x3824('0xb4')]);delete _0x5288ad[_0x4fd6b0];}if(_0x5288ad[_0x4fd6b0]&&_0x5288ad[_0x4fd6b0]['type']===_0x3824('0xb7')){_0x29e607[_0x3824('0xb8')](_0x29e607[_0x3824('0x1b')][_0x5288ad[_0x4fd6b0][_0x3824('0xb4')]]);logger[_0x3824('0x5e')]('[Dialer][checkChannel][ivr]',_0x27b984,_0x4fd6b0,_0x5288ad[_0x4fd6b0][_0x3824('0xb4')]);delete _0x5288ad[_0x4fd6b0];}},0x2328);}});}});}}};Dialer[_0x3824('0x7f')][_0x3824('0x149')]=function(_0x75dad){return Promise[_0x3824('0xa3')]()[_0x3824('0x38')](voiceQueueRt[_0x3824('0x149')](_0x75dad))['catch'](loggerCatch(_0x3824('0x14a')));};Dialer[_0x3824('0x7f')][_0x3824('0xb8')]=function(_0x1c2695){if(!_[_0x3824('0x3a')](_0x1c2695)&&_0x1c2695!==null){if(typeof _0x1c2695[_0x3824('0x14b')]!==_0x3824('0xa2')){if(_0x1c2695[_0x3824('0x14b')]>0x0){_0x1c2695['originated']-=0x1;}else{logger[_0x3824('0x5e')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x3824('0x14c'));}};Dialer[_0x3824('0x7f')][_0x3824('0x14d')]=function(_0x216dcc,_0x7770ba){var _0x3e1e05=this;return function(_0x3ba3f9){_0x3e1e05[_0x3824('0xb8')](_0x7770ba);logger['error'](_0x216dcc,util[_0x3824('0x3e')](_0x3ba3f9,{'showHidden':![],'depth':null}));};};Dialer[_0x3824('0x7f')]['emptyContact']=function(_0x547622,_0x47dd63,_0x2f289f){var _0x4060c7={'state':0x19,'statedesc':_0x3824('0x14e')};this[_0x3824('0xb8')](_0x47dd63);this[_0x3824('0x10f')](_['merge'](_0x4060c7,_[_0x3824('0x70')](_0x2f289f,[_0x3824('0xe1'),_0x3824('0xe2'),_0x3824('0x14f'),'VoiceQueueId',_0x3824('0xd2')])),'[emptyContact][createHistory]',_0x3824('0x150'));logger['error'](_0x547622);};Dialer[_0x3824('0x7f')]['saveInDb']=function(_0xa611e5,_0xe0617,_0x39d3f6){hopperUtils['createHistory'](_0xa611e5)[_0x3824('0x97')](loggerCatch(_0xe0617));hopperUtils['moveContactManagedDialer'](_0xa611e5)[_0x3824('0x97')](loggerCatch(_0x39d3f6));};Dialer[_0x3824('0x7f')][_0x3824('0xdf')]=function(_0x59d4df,_0x199682){hopperUtils[_0x3824('0xbf')](_0x59d4df)[_0x3824('0x97')](loggerCatch(_0x3824('0x151')));if(_0x199682==0x0){hopperUtils[_0x3824('0xc0')](_0x59d4df)[_0x3824('0x97')](loggerCatch(_0x3824('0x152')));}};Dialer['prototype'][_0x3824('0x144')]=function(_0x2c5ec6){return Promise['resolve']()['then'](cmHopper[_0x3824('0x153')](_0x2c5ec6['id'],previewRecallmeReminderInterval))[_0x3824('0x38')](function(_0x4a5801){for(var _0x53cd24=0x0;_0x53cd24<_0x4a5801[_0x3824('0x8f')];_0x53cd24++){var _0x4b838e=_0x4a5801[_0x53cd24][_0x3824('0x141')]['name'];if(_0x4b838e)io['to'](util[_0x3824('0x3f')](_0x3824('0x142'),_0x4b838e))[_0x3824('0x3b')](_0x3824('0x143'),{'hopper':_0x4a5801[_0x53cd24]});}})[_0x3824('0x97')](function(){});};Dialer[_0x3824('0x7f')][_0x3824('0xa6')]=function(_0x461214){var _0x417373=this;return function(){_0x417373[_0x3824('0x154')](_0x461214);};};Dialer['prototype'][_0x3824('0x155')]=function(_0x57658e,_0x56251e){var _0x1ff6ca=this;var _0x4839c2=uuid['v4']();this[_0x3824('0xe4')][_0x4839c2]=new Action(_0x57658e,_0x56251e,_0x4839c2);return new Promise(function(_0x147058,_0x606319){if(_[_0x3824('0x3a')](_0x57658e)&&typeof _0x57658e!==_0x3824('0x156')){return _0x606319(msgResponse('originate',_0x3824('0x8a'),'voiceQueue\x20is\x20undefine'));}if(_[_0x3824('0x3a')](_0x56251e[_0x3824('0x157')])||_0x56251e[_0x3824('0x157')]===null){return _0x606319(msgResponse(_0x3824('0x158'),_0x3824('0x8a'),'contact\x20is\x20undefine'));}var _0xad7109={'XMD-CALLERID':_0x1ff6ca[_0x3824('0xe4')][_0x4839c2][_0x3824('0x159')](),'XMD-AGI':_0x57658e['dialQueueProject']?util['format'](_0x3824('0x15a'),ipAgi,_0x57658e[_0x3824('0x12b')]):'NONE','XMD-AGIAFTER':_0x57658e['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x57658e[_0x3824('0xbd')]):'NONE','XMD-QUEUE':utils[_0x3824('0x15b')](_0x57658e)?util['format']('\x22%s,%s%s,,,%s\x22',_0x57658e[_0x3824('0x5a')],_0x57658e[_0x3824('0x15c')]||'',_0x57658e[_0x3824('0xbe')]?'c':'',_0x57658e[_0x3824('0x15d')]||0x3):_0x3824('0x15e'),'XMD-CONTACTID':_0x56251e['ContactId'],'XMD-CDRTYPE':_0x3824('0x5'),'CALLERID(all)':_0x1ff6ca[_0x3824('0xe4')][_0x4839c2][_0x3824('0x159')](),'XMD-AMD':_0x57658e[_0x3824('0x107')]?_0x3824('0x15f'):_0x3824('0x15e'),'XMD-DESTINATION':_0x3824('0x106')};if(_0x57658e[_0x3824('0x107')]){_0xad7109[_0x3824('0x160')]=_0x57658e['dialAMDInitialSilence']||0x9c4;_0xad7109[_0x3824('0x161')]=_0x57658e[_0x3824('0x162')]||0x5dc;_0xad7109[_0x3824('0x163')]=_0x57658e[_0x3824('0x164')]||0x320;_0xad7109[_0x3824('0x165')]=_0x57658e[_0x3824('0x166')]||0x1388;_0xad7109['XMD-AMDMINWORDLENGTH']=_0x57658e[_0x3824('0x167')]||0x64;_0xad7109[_0x3824('0x168')]=_0x57658e['dialAMDBetweenWordsSilence']||0x32;_0xad7109[_0x3824('0x169')]=_0x57658e[_0x3824('0x16a')]||0x3;_0xad7109[_0x3824('0x16b')]=_0x57658e['dialAMDSilenceThreshold']||0x100;_0xad7109['XMD-AMDMAXIMUMWORDLENGTH']=_0x57658e[_0x3824('0x16c')]||0x1388;}if(utils[_0x3824('0x15b')](_0x57658e)){_0xad7109['XMD-VOICEQUEUEID']=_0x56251e[_0x3824('0xf2')];}else{_0xad7109[_0x3824('0x16d')]=_0x56251e[_0x3824('0xd2')];}for(var _0x1f1819 in _0x56251e[_0x3824('0x16e')]){if(typeof _0x56251e['Contact'][_0x1f1819]!==_0x3824('0xa2')){if(isNotNull(_0x56251e[_0x3824('0x16e')][_0x1f1819])&&_0x1f1819!=='id'&&_0x1f1819!=='tags'&&_0x1f1819!=='createdAt'&&_0x1f1819!==_0x3824('0x16f')){_0xad7109[util[_0x3824('0x3f')](_0x3824('0x170'),_0x3824('0x171'),_[_0x3824('0x172')](_0x1f1819))]=_0x56251e[_0x3824('0x16e')][_0x1f1819];}}}var _0x3e081e=_0x1ff6ca[_0x3824('0x80')](_0x57658e[_0x3824('0x173')])?utils[_0x3824('0x174')](_0x57658e['Trunk']['callerid'],_0x57658e[_0x3824('0x175')],_0x57658e[_0x3824('0x176')]>0x0?utils[_0x3824('0x177')](_0x57658e[_0x3824('0x178')],_0x57658e['dialRandomLastDigitCallerIdNumber']):_0x57658e['dialOriginateCallerIdNumber']):utils[_0x3824('0x174')](_[_0x3824('0xe9')](_0x57658e[_0x3824('0x87')])?_0x57658e['Trunk']['callerid']:_0x57658e['TrunkBackup'][_0x3824('0x179')],_0x57658e['dialOriginateCallerIdName'],_0x57658e[_0x3824('0x176')]>0x0?utils['getCallerIdRandom'](_0x57658e[_0x3824('0x178')],_0x57658e[_0x3824('0x176')]):_0x57658e[_0x3824('0x178')]);if(_0x3e081e){_0xad7109[_0x3824('0x17a')]=_0x1ff6ca[_0x3824('0xe4')][_0x4839c2][_0x3824('0x17b')]=utils[_0x3824('0x17c')](_0x3e081e);_0xad7109[_0x3824('0x17d')]=_0x56251e['phone'];}_0x57658e[_0x3824('0x17e')]=_0xad7109;return ami[_0x3824('0x90')]({'actionid':_0x4839c2,'action':_0x3824('0x158'),'channel':_0x1ff6ca[_0x3824('0x80')](_0x57658e[_0x3824('0x173')])?util[_0x3824('0x3f')](_0x3824('0x17f'),_0x57658e['Trunk'][_0x3824('0x5a')],isNotNull(_0x57658e[_0x3824('0x180')])?_0x57658e[_0x3824('0x180')]['trim']()||'':'',_0x57658e[_0x3824('0x181')]>0x0?_0x56251e['phone'][_0x3824('0x182')](_0x57658e[_0x3824('0x181')]):_0x56251e[_0x3824('0x157')]):util[_0x3824('0x3f')](_0x3824('0x17f'),_[_0x3824('0xe9')](_0x57658e['TrunkBackup'])?_0x57658e[_0x3824('0x173')]['name']:_0x57658e[_0x3824('0x87')][_0x3824('0x5a')],isNotNull(_0x57658e[_0x3824('0x180')])?_0x57658e[_0x3824('0x180')][_0x3824('0x183')]()||'':'',_0x57658e[_0x3824('0x181')]>0x0?_0x56251e[_0x3824('0x157')][_0x3824('0x182')](_0x57658e['dialCutDigit']):_0x56251e[_0x3824('0x157')]),'callerid':_0x3e081e,'Exten':_0x3824('0x106'),'Context':_0x3824('0x184'),'Priority':'1','variable':_0xad7109,'timeout':(_0x57658e[_0x3824('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4839c2})[_0x3824('0x38')](function(_0x1a41ca){return _0x147058(_0x1a41ca);})[_0x3824('0x97')](function(_0x25e85c){_0x57658e[_0x3824('0x186')]+=0x1;var _0x451a1a=new History(_0x1ff6ca['actions'][_0x4839c2]);logger[_0x3824('0x5e')](util[_0x3824('0x3f')](_0x3824('0x187'),JSON[_0x3824('0x6f')](_0x25e85c)));_0x451a1a[_0x3824('0x69')]=0xe;_0x451a1a['statedesc']=_0x3824('0x188');_0x451a1a[_0x3824('0x6c')]=moment()[_0x3824('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x451a1a['endtime']=_0x451a1a[_0x3824('0x6c')];hopperUtils['createHistory'](_0x451a1a)['catch'](loggerCatch(_0x3824('0x189')));_0x1ff6ca[_0x3824('0xc0')](_0x451a1a)['catch'](loggerCatch(_0x3824('0x189')))[_0x3824('0xf1')](function(){delete _0x1ff6ca[_0x3824('0xe4')][_0x4839c2];return _0x606319(msgResponse(_0x3824('0x158'),_0x3824('0x7e'),_0x3824('0x18a')));});});});};Dialer[_0x3824('0x7f')][_0x3824('0x18b')]=function(_0x44dae5,_0x4ba330,_0x3755b1){var _0x4bdd8c=new History(_0x4ba330);if(_0x4bdd8c[_0x3824('0x122')]+_0x4bdd8c[_0x3824('0x116')]+_0x4bdd8c[_0x3824('0x117')]+_0x4bdd8c[_0x3824('0x118')]+_0x4bdd8c['countdropretry']+_0x4bdd8c[_0x3824('0xdc')]+_0x4bdd8c[_0x3824('0x119')]+_0x4bdd8c['countagentrejectretry']>=_0x3755b1[_0x3824('0x123')]-0x1){return!![];}switch(_0x44dae5){case 0x3:if(_0x4bdd8c[_0x3824('0x117')]>=_0x3755b1[_0x3824('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x4bdd8c[_0x3824('0x117')]+=0x1,'scheduledat':moment()[_0x3824('0xd0')](_0x3755b1[_0x3824('0x18d')],_0x3824('0xd1'))[_0x3824('0x3f')](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c[_0x3824('0xf2')]||undefined,'CampaignId':_0x4bdd8c[_0x3824('0xd2')]||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x18e')));break;case 0x5:if(_0x4bdd8c[_0x3824('0x122')]>=_0x3755b1[_0x3824('0x18f')]-0x1){return!![];}hopperUtils[_0x3824('0xce')]({'active':![],'countbusyretry':_0x4bdd8c[_0x3824('0x122')]+=0x1,'scheduledat':moment()[_0x3824('0xd0')](_0x3755b1[_0x3824('0x190')],_0x3824('0xd1'))[_0x3824('0x3f')](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c[_0x3824('0xf2')]||undefined,'CampaignId':_0x4bdd8c['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x191')));break;case 0x8:if(_0x4bdd8c[_0x3824('0x116')]>=_0x3755b1[_0x3824('0x192')]-0x1){return!![];}hopperUtils[_0x3824('0xce')]({'active':![],'countcongestionretry':_0x4bdd8c[_0x3824('0x116')]+=0x1,'scheduledat':moment()[_0x3824('0xd0')](_0x3755b1['dialCongestionRetryFrequency'],_0x3824('0xd1'))['format'](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c[_0x3824('0xf2')]||undefined,'CampaignId':_0x4bdd8c[_0x3824('0xd2')]||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x193')));break;case 0x0:if(_0x4bdd8c[_0x3824('0x118')]>=_0x3755b1['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x3824('0xce')]({'active':![],'countnosuchnumberretry':_0x4bdd8c[_0x3824('0x118')]+=0x1,'scheduledat':moment()[_0x3824('0xd0')](_0x3755b1[_0x3824('0x194')],_0x3824('0xd1'))[_0x3824('0x3f')](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c[_0x3824('0xf2')]||undefined,'CampaignId':_0x4bdd8c['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x195')));}break;case 0xa:if(_0x4bdd8c[_0x3824('0xcf')]>=_0x3755b1['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x3824('0xce')]({'active':![],'countdropretry':_0x4bdd8c[_0x3824('0xcf')]+=0x1,'scheduledat':moment()[_0x3824('0xd0')](_0x3755b1['dialDropRetryFrequency'],'minutes')[_0x3824('0x3f')](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c[_0x3824('0xf2')]||undefined,'CampaignId':_0x4bdd8c['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0xd3')));break;case 0xb:if(_0x4bdd8c['countabandonedretry']>=_0x3755b1[_0x3824('0xde')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4bdd8c[_0x3824('0xdc')]+=0x1,'scheduledat':moment()['add'](_0x3755b1[_0x3824('0xe0')],'minutes')['format'](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c['VoiceQueueId']||undefined,'CampaignId':_0x4bdd8c[_0x3824('0xd2')]||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0xe3')));break;case 0x13:if(_0x4bdd8c[_0x3824('0x119')]>=_0x3755b1[_0x3824('0x11c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4bdd8c['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x3755b1[_0x3824('0x126')],'minutes')['format'](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c['VoiceQueueId']||undefined,'CampaignId':_0x4bdd8c['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x11e')));break;case 0x14:if(_0x4bdd8c[_0x3824('0x11a')]>=_0x3755b1[_0x3824('0x196')]-0x1){return!![];}hopperUtils[_0x3824('0xce')]({'active':![],'countagentrejectretry':_0x4bdd8c[_0x3824('0x11a')]+=0x1,'scheduledat':moment()['add'](_0x3755b1[_0x3824('0x197')],_0x3824('0xd1'))['format'](_0x3824('0xb9')),'ContactId':_0x4bdd8c[_0x3824('0xe1')],'ListId':_0x4bdd8c[_0x3824('0xe2')],'VoiceQueueId':_0x4bdd8c['VoiceQueueId']||undefined,'CampaignId':_0x4bdd8c['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x198')));break;default:return!![];}};Dialer['prototype'][_0x3824('0x102')]=function(_0x519165,_0x548599,_0x46cf22){var _0x2584ac=this;var _0x56a0b8=new History(_0x519165);var _0x2e6181=![];var _0x43b9a8;var _0x2b2313;return new Promise(function(_0x221273,_0xabbf4d){if(_['isUndefined'](_0x548599)&&typeof _0x548599!==_0x3824('0x156')){return _0xabbf4d(msgResponse('[callProgressDetecting]',_0x3824('0x8a'),_0x3824('0x199')));}if(_['isUndefined'](_0x46cf22)&&typeof _0x46cf22!==_0x3824('0x156')){return _0xabbf4d(msgResponse('[callProgressDetecting]',_0x3824('0x8a'),_0x3824('0x19a')));}hopperUtils[_0x3824('0xca')](_0x56a0b8,_0x46cf22[_0x3824('0xba')],_0x548599)[_0x3824('0x38')](function(_0x2d0704){if(_0x2d0704[_0x3824('0xcd')]==0x1)_0x2e6181=!![];switch(_0x46cf22[_0x3824('0xba')]){case'0':_0x548599[_0x3824('0x19b')]+=0x1;_0x56a0b8[_0x3824('0x69')]=0x0;_0x56a0b8[_0x3824('0x6a')]='NoSuchNumber';_0x56a0b8[_0x3824('0x118')]+=0x1;_0x56a0b8[_0x3824('0xdd')]+=0x1;ami[_0x3824('0x3b')](_0x3824('0x19c'),ut[_0x3824('0x114')](_0x519165,'nosuchnumber'));_0x43b9a8=_0x548599[_0x3824('0x194')];_0x2b2313=_0x548599['callAdditionalPhoneAfterMin'];hopperUtils[_0x3824('0xbf')](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x115')));if(_0x2584ac[_0x3824('0x18b')](0x0,_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8['countnosuchnumberretry']>=_0x548599[_0x3824('0x19d')]){_0x2584ac[_0x3824('0x11d')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x19e'));}else{_0x2584ac[_0x3824('0x124')](_0x56a0b8,_0x221273,_0xabbf4d,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x548599[_0x3824('0x19f')]+=0x1;_0x56a0b8[_0x3824('0x69')]=0x3;_0x56a0b8[_0x3824('0x6a')]=_0x3824('0x1a0');_0x56a0b8[_0x3824('0x117')]+=0x1;_0x56a0b8['countglobal']+=0x1;var _0x283161=ut[_0x3824('0x1a1')](_0x519165,_0x548599);ami[_0x3824('0x3b')](_0x3824('0x1a2'),_0x283161);_0x43b9a8=_0x548599['dialNoAnswerRetryFrequency'];_0x2b2313=_0x548599[_0x3824('0xc9')];hopperUtils[_0x3824('0xbf')](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x1a3')));if(_0x2584ac[_0x3824('0x18b')](0x3,_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8[_0x3824('0x117')]>=_0x548599[_0x3824('0x18c')]){_0x2584ac[_0x3824('0x11d')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1a4'));}else{_0x2584ac[_0x3824('0x124')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1a4'));}}break;case'5':_0x548599[_0x3824('0x1a5')]+=0x1;_0x56a0b8[_0x3824('0x69')]=0x5;_0x56a0b8['statedesc']='Busy';_0x56a0b8[_0x3824('0x122')]+=0x1;_0x56a0b8[_0x3824('0xdd')]+=0x1;ami[_0x3824('0x3b')](_0x3824('0x1a6'),ut[_0x3824('0x114')](_0x519165,_0x3824('0x1a7')));_0x43b9a8=_0x548599[_0x3824('0x190')];_0x2b2313=_0x548599[_0x3824('0xc9')];hopperUtils[_0x3824('0xbf')](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x1a8')));if(_0x2584ac[_0x3824('0x18b')](0x5,_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8[_0x3824('0x122')]>=_0x548599[_0x3824('0x18f')]){_0x2584ac[_0x3824('0x11d')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1a9'));}else{_0x2584ac[_0x3824('0x124')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1a9'));}}break;case'8':_0x548599[_0x3824('0x1aa')]+=0x1;_0x56a0b8[_0x3824('0x69')]=0x8;_0x56a0b8['statedesc']=_0x3824('0x1ab');_0x56a0b8[_0x3824('0x116')]+=0x1;_0x56a0b8[_0x3824('0xdd')]+=0x1;_0x43b9a8=_0x548599[_0x3824('0x1ac')];_0x2b2313=_0x548599[_0x3824('0xc9')];ami[_0x3824('0x3b')]('custom:agentcongestion',ut[_0x3824('0x114')](_0x519165,_0x3824('0x1ad')));hopperUtils[_0x3824('0xbf')](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x1ae')));if(_0x2584ac[_0x3824('0x18b')](0x8,_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8[_0x3824('0x116')]>=_0x548599[_0x3824('0x192')]){_0x2584ac[_0x3824('0x11d')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1af'));}else{_0x2584ac['stateGlobal'](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1af'));}}break;case'11':_0x548599[_0x3824('0x1b0')]+=0x1;_0x56a0b8[_0x3824('0x69')]=0xb;_0x56a0b8[_0x3824('0x6a')]=_0x3824('0xda');_0x56a0b8[_0x3824('0xdc')]+=0x1;_0x56a0b8[_0x3824('0xdd')]+=0x1;_0x43b9a8=_0x548599[_0x3824('0xe0')];_0x2b2313=_0x548599['callAdditionalPhoneAfterMin'];hopperUtils[_0x3824('0xbf')](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x1b1')));if(_0x2584ac[_0x3824('0x18b')](0xb,_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8[_0x3824('0xdc')]>=_0x548599[_0x3824('0xde')]){_0x2584ac['createStateFinal'](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1b2'));}else{_0x2584ac[_0x3824('0x124')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1b2'));}}break;case'20':_0x548599['outboundRejectCallsDay']+=0x1;_0x56a0b8['state']=0x14;_0x56a0b8[_0x3824('0x6a')]='AgentReject';_0x56a0b8['countagentrejectretry']+=0x1;_0x56a0b8[_0x3824('0xdd')]+=0x1;_0x43b9a8=_0x548599[_0x3824('0x197')];_0x2b2313=_0x548599[_0x3824('0xc9')];ami[_0x3824('0x3b')]('custom:agentreject',ut[_0x3824('0x114')](_0x519165,_0x3824('0x1b3')));hopperUtils[_0x3824('0xbf')](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x1b4')));if(_0x2584ac[_0x3824('0x18b')](0x14,_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8[_0x3824('0x11a')]>=_0x548599[_0x3824('0x196')]){_0x2584ac[_0x3824('0x11d')](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1b5'));}else{_0x2584ac['stateGlobal'](_0x56a0b8,_0x221273,_0xabbf4d,_0x3824('0x1b5'));}}break;default:_0x548599['outboundUnknownCallsDay']+=0x1;_0x56a0b8[_0x3824('0x69')]=0xc;_0x56a0b8['statedesc']=_0x46cf22[_0x3824('0xba')];_0x43b9a8=_0x548599['dialAgentRejectRetryFrequency'];_0x2b2313=_0x548599[_0x3824('0xc9')];hopperUtils['createHistory'](_0x56a0b8)[_0x3824('0x97')](loggerCatch(_0x3824('0x1b6')));if(_0x2584ac['checkRetriveMax'](_0x46cf22['reason'],_0x519165,_0x548599)&&!_0x2e6181){if(_0x56a0b8[_0x3824('0x122')]+_0x56a0b8[_0x3824('0x116')]+_0x56a0b8['countnoanswerretry']+_0x56a0b8[_0x3824('0x118')]+_0x56a0b8[_0x3824('0xcf')]+_0x56a0b8[_0x3824('0xdc')]+_0x56a0b8['countmachineretry']+_0x56a0b8[_0x3824('0x11a')]>=_0x548599[_0x3824('0x123')]){_0x2584ac[_0x3824('0x124')](_0x56a0b8,_0x221273,_0xabbf4d,_0x46cf22[_0x3824('0xba')]);}else{_0x2584ac[_0x3824('0x11d')](_0x56a0b8,_0x221273,_0xabbf4d,_0x46cf22[_0x3824('0xba')]);}}}})['then'](function(){if(_0x2e6181){hopperUtils['swapAdditionalPhones'](_0x56a0b8,_0x43b9a8,_0x2b2313)[_0x3824('0x38')](function(){return _0x221273(0x1);});}});});};Dialer[_0x3824('0x7f')][_0x3824('0x124')]=function(_0x4d8522,_0x1a0c10,_0x2ea837,_0x4147a0){var _0x1327b1=new Final(_0x4d8522);_0x1327b1[_0x3824('0x69')]=0xf;_0x1327b1['statedesc']=_0x3824('0x1b7');this[_0x3824('0x11d')](_0x1327b1,_0x1a0c10,_0x2ea837,_0x4147a0);};Dialer[_0x3824('0x7f')][_0x3824('0x11d')]=function(_0x540328,_0x361e9e,_0xdc34b,_0x7a5b57){hopperUtils['moveContactManagedDialer'](_0x540328)[_0x3824('0x38')](function(){return _0x361e9e(msgResponse(_0x3824('0x1b8'),_0x3824('0x101'),_0x7a5b57));})['catch'](function(){return _0xdc34b(msgResponse(_0x3824('0x1b9'),_0x3824('0x8a'),_0x3824('0x1ba')));});};Dialer[_0x3824('0x7f')][_0x3824('0x7')]=function(_0x1d65e8){var _0x2ac8a1=_0x1d65e8[_0x3824('0x1bb')]/0x64;var _0x714cbf=_0x1d65e8['outboundDropCallsDayTimeout']/(_0x1d65e8[_0x3824('0xc4')]+_0x1d65e8[_0x3824('0x10a')]);var _0x4f358a=Math[_0x3824('0x1bc')](_0x1d65e8[_0x3824('0x1bd')]*(_0x1d65e8[_0x3824('0x1be')]/0x64));var _0x10ecf7=Math['round'](_0x1d65e8['predictiveIntervalAvailable']*(_0x1d65e8[_0x3824('0x1bf')]/0x64));var _0xffed18=_0x1d65e8[_0x3824('0x1c0')]+_0x1d65e8[_0x3824('0x136')];var _0xc36c4f=Math[_0x3824('0x1c1')](_0x1d65e8['erlangCalls']*_0x1d65e8[_0x3824('0x56')]*_0x1d65e8[_0x3824('0x1c2')]*_0x1d65e8[_0x3824('0x1c3')]);if(_[_0x3824('0x3a')](_0x1d65e8[_0x3824('0x21')])){if(!_[_0x3824('0x3a')](_0x1d65e8[_0x3824('0x20')])){_0x1d65e8[_0x3824('0x20')]=undefined;loggerPredictive[_0x3824('0x5e')]('[startMethodPredictive][StartProgressive]',_0x3824('0x1c4'));}if(!_[_0x3824('0x3a')](_0x1d65e8[_0x3824('0x5c')])){loggerPredictive[_0x3824('0x5e')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x1d65e8[_0x3824('0x5c')]);_0x1d65e8[_0x3824('0x5c')]=undefined;}_0x1d65e8['startProgressive']=moment()[_0x3824('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1d65e8['name'],_0x3824('0x1c5'),_0x1d65e8[_0x3824('0x21')]);this['handlePower'](_0x1d65e8,0x1);}else if(ifInterval(_0x1d65e8['dialPredictiveInterval'],_0x1d65e8['startProgressive'])){this['handlePower'](_0x1d65e8,0x1);loggerPredictiveCalls[_0x3824('0x42')]('[startMethodPredictive][StartProgressive][Loop]',_0x1d65e8[_0x3824('0x21')],_0x1d65e8[_0x3824('0x5a')]);_0x1d65e8[_0x3824('0x52')]=0x0;_0x1d65e8['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2ac8a1<_0x714cbf&&_0x1d65e8[_0x3824('0x1c6')]==='dropRate'){clearPredictiveAttributes(_0x1d65e8);loggerPredictive[_0x3824('0x42')](_0x3824('0x1c7'),_0x3824('0x1c8'),_0x714cbf,_0x3824('0x21'),_0x1d65e8['name']);}else if(_0xc36c4f<_0x1d65e8['predictiveIntervalErlangCallsDroppedCalls']&&_0x1d65e8[_0x3824('0x1c6')]==='dropRate'){clearPredictiveAttributes(_0x1d65e8);loggerPredictive[_0x3824('0x42')](_0x3824('0x1c9'),_0x3824('0x1ca'),_0xc36c4f,_0x3824('0x1cb'),_0x1d65e8[_0x3824('0x1cc')],_0x3824('0x21'),_0x1d65e8[_0x3824('0x5a')]);}else if(!ifInterval(_0x1d65e8[_0x3824('0x1cd')],_0x1d65e8['startProgressive'])&&_['isUndefined'](_0x1d65e8[_0x3824('0x20')])&&!_[_0x3824('0x3a')](_0x1d65e8[_0x3824('0x21')])){_0x1d65e8['startPredictive']=moment()['format'](_0x3824('0xb9'));loggerPredictive[_0x3824('0x42')](_0x1d65e8[_0x3824('0x5a')],_0x3824('0x1ce'),_0x1d65e8[_0x3824('0x20')]);hopperUtils[_0x3824('0x1cf')](_0x1d65e8[_0x3824('0x1cd')])[_0x3824('0x38')](this[_0x3824('0x1d0')](_0x1d65e8))['then'](mergeDataErlangB(_0x1d65e8))[_0x3824('0x38')](this[_0x3824('0x1d1')](_0x1d65e8))[_0x3824('0x97')](loggerCatchPredictive(_0x3824('0x1d2'),_0x1d65e8));}else if(!ifInterval(_0x1d65e8[_0x3824('0x1cd')],_0x1d65e8['startPredictive'])){_0x1d65e8['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1d65e8[_0x3824('0x20')]=moment()[_0x3824('0x3f')](_0x3824('0xb9'));loggerPredictive[_0x3824('0x42')](_0x1d65e8[_0x3824('0x5a')],'recalculate\x20predictive\x20at',_0x1d65e8['startPredictive']);clearInterval(_0x1d65e8[_0x3824('0x5c')]);_0x1d65e8[_0x3824('0x5c')]=undefined;hopperUtils[_0x3824('0x1cf')](_0x1d65e8[_0x3824('0x1cd')])[_0x3824('0x38')](this['getDataPredictive'](_0x1d65e8))[_0x3824('0x38')](mergeDataErlangB(_0x1d65e8))[_0x3824('0x38')](this['startMethodPredictive'](_0x1d65e8))[_0x3824('0x97')](loggerCatchPredictive(_0x3824('0x1d3'),_0x1d65e8));}else if(_0x1d65e8[_0x3824('0x1bd')]&&_0xffed18<_0x1d65e8[_0x3824('0x1bd')]-_0x10ecf7){clearPredictiveAttributes(_0x1d65e8);loggerPredictive[_0x3824('0x42')](_0x1d65e8[_0x3824('0x5a')],_0x3824('0x1d4'),_0xffed18,')\x20are\x20less\x20than\x20threshold\x20(',_0x1d65e8[_0x3824('0x1bd')],'-',_0x10ecf7,'=',_0x1d65e8['predictiveIntervalAvailable']-_0x10ecf7,')');}else if(_0x1d65e8[_0x3824('0x1bd')]&&_0xffed18>_0x1d65e8['predictiveIntervalAvailable']+_0x4f358a){clearPredictiveAttributes(_0x1d65e8);loggerPredictive['info'](_0x1d65e8[_0x3824('0x5a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xffed18,_0x3824('0x1d5'),_0x1d65e8[_0x3824('0x1bd')],'+',_0x4f358a,'=',_0x1d65e8[_0x3824('0x1bd')]+_0x4f358a,')');}};Dialer[_0x3824('0x7f')][_0x3824('0x1d0')]=function(_0x120985){var _0x249406=this;return function(_0x4bcde){return new Promise(function(_0x2b6ddd,_0x352105){_[_0x3824('0x58')](_0x120985,_0x4bcde[0x0]);if(checkGetDataPredictive(_0x4bcde[0x0])){var _0x1ae2c8=_0x120985[_0x3824('0x1bd')]=_0x120985[_0x3824('0x136')]+_0x120985[_0x3824('0x1c0')];var _0xca4219=_0x120985['dialPredictiveInterval']*0x3c;var _0x40e4f6=_0x4bcde[0x0][_0x3824('0x1d6')]+_0x4bcde[0x0][_0x3824('0x4e')];var _0x3e7bdc=(_0x4bcde[0x0][_0x3824('0x47')]+_0x4bcde[0x0][_0x3824('0x49')]+_0x4bcde[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4bcde[0x0]['predictiveIntervalTotalCalls'];_0x120985['predictiveIntervalHitRate']=_0x3e7bdc>0x0?_0x3e7bdc:0x1;switch(_0x120985[_0x3824('0x1c6')]){case _0x3824('0x1d7'):var _0x101911=_0x120985['dialPredictiveOptimizationPercentage']/0x64;return _0x249406[_0x3824('0x1d8')](_0x1ae2c8,_0xca4219,_0x40e4f6,_0x3e7bdc,_0x101911)['then'](function(_0x362d56){return _0x2b6ddd(_0x362d56);});case _0x3824('0x1d9'):var _0x1d143e=_0x120985[_0x3824('0x1bb')]/0x64;return _0x249406['busyFactor'](_0x1ae2c8,_0xca4219,_0x40e4f6,_0x3e7bdc,_0x1d143e)[_0x3824('0x38')](function(_0x1a18f0){return _0x2b6ddd(_0x1a18f0);});default:return _0x352105(msgResponse(_0x3824('0x1da'),_0x3824('0x8a'),_0x3824('0x1db')));}}else{return _0x352105(msgResponse('[getDataPredictive]',_0x3824('0x8a'),_0x3824('0x1dc')));}});};};Dialer[_0x3824('0x7f')][_0x3824('0x1dd')]=function(_0xeb5f6a){var _0x49dbc2=this;return function(_0x4c964b){return new Promise(function(_0x15a130,_0x4efdcf){_[_0x3824('0x58')](_0xeb5f6a,_0x4c964b[0x0]);if(checkGetDataPredictive(_0x4c964b[0x0])){loggerPredictive[_0x3824('0x42')](JSON[_0x3824('0x6f')](_0x4c964b[0x0]));if(_0xeb5f6a['dialPredictiveOptimization']===_0x3824('0x1d7')){return _0x49dbc2[_0x3824('0x149')](_0xeb5f6a['id'])[_0x3824('0x38')](function(_0x3e6de3){var _0x3ceaf9=_0xeb5f6a[_0x3824('0x1de')]-_0x3e6de3[0x0][_0x3824('0x1df')];var _0x60f4b1=_0xeb5f6a['dialPredictiveInterval']*0x3c;var _0x50697a=_0x4c964b[0x0]['predictiveIntervalAvgTalktime']+_0x4c964b[0x0][_0x3824('0x4e')];var _0x53c411=(_0x4c964b[0x0][_0x3824('0x47')]+_0x4c964b[0x0][_0x3824('0x49')]+_0x4c964b[0x0][_0x3824('0xd8')])/_0x4c964b[0x0][_0x3824('0x45')];var _0x53aea7=_0xeb5f6a[_0x3824('0x1bb')]/0x64;_0xeb5f6a[_0x3824('0x1e0')]=_0x3e6de3[0x0][_0x3824('0x1df')]||0x0;_0xeb5f6a[_0x3824('0x1c2')]=_0x53c411>0x0?_0x53c411:0x1;return _0x49dbc2[_0x3824('0x1d8')](_0x3ceaf9,_0x60f4b1,_0x50697a,_0x53c411,_0x53aea7);})[_0x3824('0x38')](function(_0x207f6d){return _0x15a130(_0x207f6d);})[_0x3824('0x97')](function(_0x5046fe){return _0x4efdcf(msgResponse(_0x3824('0x1e1'),_0x3824('0x8a'),JSON[_0x3824('0x6f')](_0x5046fe)));});}if(_0xeb5f6a[_0x3824('0x1c6')]===_0x3824('0x1d9')){return _0x49dbc2[_0x3824('0x149')](_0xeb5f6a['id'])[_0x3824('0x38')](function(_0x5a9dbc){var _0x4577f0=_0xeb5f6a[_0x3824('0x1de')]-_0x5a9dbc[0x0][_0x3824('0x1df')];var _0x2aff41=_0xeb5f6a[_0x3824('0x1cd')]*0x3c;var _0x4b6c2a=_0x4c964b[0x0][_0x3824('0x1d6')]+_0x4c964b[0x0][_0x3824('0x4e')];var _0x87b59c=(_0x4c964b[0x0][_0x3824('0x47')]+_0x4c964b[0x0][_0x3824('0x49')]+_0x4c964b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4c964b[0x0][_0x3824('0x45')];var _0x5be38c=_0xeb5f6a[_0x3824('0x1bb')]/0x64;_0xeb5f6a[_0x3824('0x1e0')]=_0x5a9dbc[0x0][_0x3824('0x1df')]||0x0;_0xeb5f6a[_0x3824('0x1c2')]=_0x87b59c>0x0?_0x87b59c:0x1;return _0x49dbc2[_0x3824('0x1e2')](_0x4577f0,_0x2aff41,_0x4b6c2a,_0x87b59c,_0x5be38c);})['then'](function(_0x275308){return _0x15a130(_0x275308);})[_0x3824('0x97')](function(_0x3d892e){return _0x4efdcf(msgResponse('[CatchErlangB]',_0x3824('0x8a'),JSON['stringify'](_0x3d892e)));});}}else{return _0x4efdcf(msgResponse(_0x3824('0x1da'),'Failure',_0x3824('0x1dc')));}});};};Dialer['prototype'][_0x3824('0x1d1')]=function(_0x44fa84){var _0x13ab1f=this;return function(){var _0x256087=0x0;var _0x2e2a93=Math[_0x3824('0x1c1')](_0x44fa84[_0x3824('0x54')]*0x3e8);if(_0x2e2a93>0x0){_0x2e2a93=_0x2e2a93<0x64?0x64:_0x2e2a93;loggerPredictive[_0x3824('0x42')](_0x44fa84[_0x3824('0x5a')],_0x3824('0x1e3'),_0x2e2a93,_0x3824('0x1e4'));_0x44fa84['handlePredictive']=setInterval(function(){_0x13ab1f[_0x3824('0x5c')](_0x44fa84);loggerPredictiveCalls['info'](_0x3824('0x1e5'),_0x256087+=0x1);},_0x2e2a93);}else{loggerPredictive['info'](_0x44fa84['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3824('0x7f')][_0x3824('0x1e6')]=function(_0x4ff30f,_0x5054af){var _0x5f44e0=this;return function(_0x8621e3){if(_['isEmpty'](_0x8621e3)){if(_[_0x3824('0xe9')](_0x5054af[_0x3824('0x14f')])||!_0x5054af[_0x3824('0x1e7')]){if(_0x4ff30f[_0x3824('0xa8')]===_0x3824('0x6')){_0x4ff30f[_0x3824('0x6d')]=_['isUndefined'](_0x4ff30f[_0x3824('0x6d')])?!![]:_0x4ff30f[_0x3824('0x6d')];var _0x46375d=uuid['v4']();_0x5f44e0[_0x3824('0xe4')][_0x46375d]=new Action(_0x4ff30f,_0x5054af,_0x46375d);loggerBooked[_0x3824('0x42')](_0x3824('0x1e8'),_0x46375d,'queueStatusComplete:\x20',JSON[_0x3824('0x6f')](_0x4ff30f[_0x3824('0x6d')]),_0x3824('0x1e9'),_0x4ff30f[_0x3824('0x5a')]);if(_0x4ff30f['queueStatusComplete']){_0x4ff30f[_0x3824('0x6d')]=![];_0x5f44e0[_0x3824('0xed')][_0x5f44e0[_0x3824('0xe4')][_0x46375d][_0x3824('0xb4')]]=[];ami[_0x3824('0x90')]({'actionid':_0x46375d,'action':'queuestatus','queue':_0x4ff30f['name']})[_0x3824('0x97')](function(){_0x5f44e0['updateOriginated'](_0x4ff30f);hopperUtils[_0x3824('0xce')]({'active':![],'ContactId':_0x5f44e0[_0x3824('0xe4')][_0x46375d]['ContactId'],'ListId':_0x5f44e0[_0x3824('0xe4')][_0x46375d]['ListId'],'VoiceQueueId':_0x5f44e0[_0x3824('0xe4')][_0x46375d][_0x3824('0xf2')]||undefined,'CampaignId':_0x5f44e0[_0x3824('0xe4')][_0x46375d]['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x1ea')));delete _0x5f44e0[_0x3824('0xe4')][_0x46375d];});}else{loggerBooked[_0x3824('0x42')](_0x3824('0x1eb'),JSON[_0x3824('0x6f')](_0x4ff30f['queueStatusComplete']),_0x3824('0x1e9'),_0x4ff30f[_0x3824('0x5a')]);_0x5f44e0[_0x3824('0xb8')](_0x4ff30f);hopperUtils[_0x3824('0xce')]({'active':![],'ContactId':_0x5f44e0['actions'][_0x46375d]['ContactId'],'ListId':_0x5f44e0[_0x3824('0xe4')][_0x46375d][_0x3824('0xe2')],'VoiceQueueId':_0x5f44e0['actions'][_0x46375d][_0x3824('0xf2')]||undefined,'CampaignId':_0x5f44e0[_0x3824('0xe4')][_0x46375d]['CampaignId']||undefined})[_0x3824('0x97')](loggerCatch(_0x3824('0x1ea')));delete _0x5f44e0['actions'][_0x46375d];}}else{return _0x5f44e0[_0x3824('0x155')](_0x4ff30f,_0x5054af);}}else{if(utils[_0x3824('0x59')](undefined,_0x5054af['scheduledat'])<_0x4ff30f[_0x3824('0x1ec')]*0x3c){if(_0x5054af[_0x3824('0x141')]&&!_0x5054af['Agent'][_0x3824('0x1ed')]){_0x5f44e0['preview'][_0x3824('0xef')](_0x5054af['id'])['finally'](function(){_0x5f44e0[_0x3824('0xb8')](_0x4ff30f);});}else{hopperUtils[_0x3824('0x1ee')]({'active':![]},_0x5054af['id'],0x1)[_0x3824('0xf1')](function(){_0x5f44e0[_0x3824('0xb8')](_0x4ff30f);});}}else{_0x4ff30f[_0x3824('0x1ef')]+=0x1;_0x5f44e0[_0x3824('0xb8')](_0x4ff30f);if(_0x4ff30f['dialRecallInQueue']){hopperUtils[_0x3824('0xce')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5054af['ContactId'],'ListId':_0x5054af['ListId'],'VoiceQueueId':_0x5054af['VoiceQueueId']||undefined,'CampaignId':_0x5054af['CampaignId']||undefined})['catch'](loggerCatch(_0x3824('0x1f0')));hopperUtils[_0x3824('0xbf')](createObjHistory(_0x4ff30f,_0x5054af,utils[_0x3824('0x63')][_0x3824('0x1f1')],0x17,_0x3824('0x1f2')))[_0x3824('0x97')](loggerCatch(_0x3824('0x1f3')));}else{_0x5f44e0[_0x3824('0x10f')](createObjHistory(_0x4ff30f,_0x5054af,utils['CAMPAIGN_STATUS'][_0x3824('0x1f4')],0x16,'RecallFailedTimeout'),_0x3824('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x4ff30f[_0x3824('0x1f6')]+=0x1;_0x5f44e0[_0x3824('0x10f')](createObjHistory(_0x4ff30f,_0x5054af,utils[_0x3824('0x63')][_0x3824('0x1f7')],0xd,_0x3824('0x1f8')),'[Originate][historyBlacklist]',_0x3824('0x1f9'));throw _0x3824('0x1fa');}};};Dialer[_0x3824('0x7f')][_0x3824('0x154')]=function(_0x5eb63a){var _0x379120=this;var _0x25a5c7=_0x5eb63a[_0x3824('0x1fb')]-_0x5eb63a[_0x3824('0x14b')]-_0x5eb63a[_0x3824('0x1fc')];emitCampaignSummary(_0x5eb63a);if(_0x25a5c7>0x0){if(_0x25a5c7>this[_0x3824('0x1e')]){_0x25a5c7=this[_0x3824('0x1e')];}_0x5eb63a['temp']+=_0x25a5c7;hopperUtils[_0x3824('0x1fd')](_0x5eb63a['id'],_0x25a5c7,_0x5eb63a[_0x3824('0x1fe')],_0x5eb63a)[_0x3824('0x38')](function(_0x9ea8a8){_0x5eb63a['temp']-=_0x25a5c7;_0x5eb63a[_0x3824('0x1fc')]=_0x5eb63a[_0x3824('0x1fc')]>0x0?_0x5eb63a[_0x3824('0x1fc')]:0x0;if(!utils[_0x3824('0x1ff')](_0x9ea8a8)){_0x5eb63a[_0x3824('0x62')]=utils[_0x3824('0x63')][_0x3824('0x67')];logger[_0x3824('0x42')](_0x3824('0x200')+_0x5eb63a[_0x3824('0x5a')]);}else{_0x5eb63a['originated']+=_0x9ea8a8[_0x3824('0x8f')];_0x5eb63a['message']=utils[_0x3824('0x63')]['RUNNING'];for(var _0x3d3996=0x0;_0x3d3996<_0x9ea8a8['length'];_0x3d3996+=0x1){_0x5eb63a[_0x3824('0x201')]+=0x1;if(_[_0x3824('0xe9')](_0x9ea8a8[_0x3d3996])||_[_0x3824('0xe9')](_0x9ea8a8[_0x3d3996][_0x3824('0x16e')])||_[_0x3824('0xe9')](_0x9ea8a8[_0x3d3996][_0x3824('0x157')])){_0x379120[_0x3824('0x202')]('[actionOriginate]\x20',_0x5eb63a,_0x9ea8a8[_0x3d3996]);}else{hopperUtils[_0x3824('0x203')](_[_0x3824('0x70')](_0x9ea8a8[_0x3d3996],['CampaignId',_0x3824('0x157')]))[_0x3824('0x38')](_0x379120[_0x3824('0x1e6')](_0x5eb63a,_0x9ea8a8[_0x3d3996]))[_0x3824('0x97')](_0x379120[_0x3824('0x14d')](_0x3824('0x204'),_0x5eb63a));}}}})[_0x3824('0x97')](loggerGetContactDialer(_0x3824('0x205'),_0x5eb63a,_0x25a5c7));}};Dialer[_0x3824('0x7f')]['handlePower']=function(_0x1c22ed,_0x4e15a5){var _0x262cd0=this;var _0x19ef66=[];if(_0x4e15a5<0x1||_0x1c22ed[_0x3824('0xa8')]===_0x3824('0x6')){_0x4e15a5=0x1;}var _0x52dfa8=Math[_0x3824('0x1c1')](_0x1c22ed['available']*_0x4e15a5)-_0x1c22ed[_0x3824('0x14b')]-_0x1c22ed[_0x3824('0x1fc')];if(_0x1c22ed['dialLimitQueue']>0x0){var _0x549115=_0x1c22ed['dialLimitQueue']-_0x1c22ed[_0x3824('0x14b')]-_0x1c22ed['talking']-_0x1c22ed[_0x3824('0x1fc')]-_0x1c22ed[_0x3824('0x137')];if(_0x52dfa8>_0x549115){_0x52dfa8=_0x549115;}}if(_0x52dfa8>0x0){if(_0x1c22ed[_0x3824('0xa8')]==='booked'){_0x52dfa8=0x1;}if(_0x52dfa8>this[_0x3824('0x1e')]){_0x52dfa8=this[_0x3824('0x1e')];}_0x1c22ed[_0x3824('0x1fc')]+=_0x52dfa8;for(var _0x444ac2 in this[_0x3824('0x1c')]){if(typeof this['agents'][_0x444ac2]!==_0x3824('0xa2')){if(this[_0x3824('0x1c')][_0x444ac2][_0x3824('0x69')]===_0x3824('0x206')&&this[_0x3824('0x1c')][_0x444ac2][_0x3824('0x83')]===_0x3824('0x84')){_0x19ef66[_0x3824('0x207')](this[_0x3824('0x1c')][_0x444ac2]['id']);}}}hopperUtils[_0x3824('0x208')](_0x1c22ed,_0x19ef66,_0x52dfa8)[_0x3824('0x38')](function(_0x6c578e){_0x1c22ed[_0x3824('0x1fc')]-=_0x52dfa8;_0x1c22ed[_0x3824('0x1fc')]=_0x1c22ed[_0x3824('0x1fc')]>0x0?_0x1c22ed['temp']:0x0;if(!utils[_0x3824('0x1ff')](_0x6c578e)){hopperUtils['countReScheduled'](_0x1c22ed)[_0x3824('0x38')](sendMessageReschedule(_0x1c22ed))[_0x3824('0x97')](loggerCatch('[countReScheduled]\x20'));}else{_0x1c22ed[_0x3824('0x14b')]+=_0x6c578e[_0x3824('0x8f')];_0x1c22ed[_0x3824('0x62')]=_0x1c22ed[_0x3824('0xa8')]===_0x3824('0x6')?utils[_0x3824('0x63')][_0x3824('0x15f')]:utils[_0x3824('0x63')]['RUNNING'];for(var _0x20a625=0x0;_0x20a625<_0x6c578e['length'];_0x20a625+=0x1){if(_[_0x3824('0xe9')](_0x6c578e[_0x20a625])||_['isNil'](_0x6c578e[_0x20a625][_0x3824('0x16e')])||_[_0x3824('0xe9')](_0x6c578e[_0x20a625][_0x3824('0x157')])){_0x262cd0['emptyContact'](_0x3824('0x209'),_0x1c22ed,_0x6c578e[_0x20a625]);}else{hopperUtils[_0x3824('0x20a')](_[_0x3824('0x70')](_0x6c578e[_0x20a625],['VoiceQueueId',_0x3824('0x157')]))[_0x3824('0x38')](_0x262cd0[_0x3824('0x1e6')](_0x1c22ed,_0x6c578e[_0x20a625]))[_0x3824('0x97')](_0x262cd0[_0x3824('0x14d')]('[actionOriginate]\x20',_0x1c22ed));}}}})[_0x3824('0x97')](loggerGetContactDialer('[getContactDialer2]',_0x1c22ed,_0x52dfa8));}};Dialer['prototype'][_0x3824('0x5c')]=function(_0x5a785f){if(_0x5a785f[_0x3824('0x20b')]>0x0){var _0x134372=_0x5a785f['dialLimitQueue']-_0x5a785f[_0x3824('0x14b')]-_0x5a785f[_0x3824('0x136')];if(_0x134372>0x0){this[_0x3824('0x20c')](_0x5a785f);}else{loggerPredictiveCalls[_0x3824('0x42')](_0x3824('0x20d'));}}else{this[_0x3824('0x20c')](_0x5a785f);}};Dialer[_0x3824('0x7f')][_0x3824('0x20c')]=function(_0x1b25d2){var _0xa540cc=this;var _0x150033=[];_0x1b25d2[_0x3824('0x14b')]+=0x1;for(var _0x56c902 in this[_0x3824('0x1c')]){if(typeof this[_0x3824('0x1c')][_0x56c902]!==_0x3824('0xa2')){if(this[_0x3824('0x1c')][_0x56c902][_0x3824('0x69')]===_0x3824('0x206')&&this[_0x3824('0x1c')][_0x56c902]['status']===_0x3824('0x84')){_0x150033[_0x3824('0x207')](this[_0x3824('0x1c')][_0x56c902]['id']);}}}return this['getContactDialer'](_0x1b25d2['id'],_0x150033,0x1,_0x1b25d2['dialOrderByScheduledAt'],_0x1b25d2)['then'](function(_0x55975c){if(!utils[_0x3824('0x1ff')](_0x55975c)){utils[_0x3824('0x60')](_0x1b25d2,0x1,0x0);return hopperUtils[_0x3824('0x20e')](_0x1b25d2)[_0x3824('0x38')](sendMessageReschedule(_0x1b25d2))['catch'](loggerCatch(_0x3824('0x20f')));}else{_0x1b25d2[_0x3824('0x62')]=utils[_0x3824('0x63')]['RUNNING'];if(_[_0x3824('0xe9')](_0x55975c[0x0])||_[_0x3824('0xe9')](_0x55975c[0x0]['Contact'])||_[_0x3824('0xe9')](_0x55975c[0x0][_0x3824('0x157')])){_0xa540cc[_0x3824('0x202')](_0x3824('0x209'),_0x1b25d2,_0x55975c[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x3824('0x70')](_0x55975c[0x0],['VoiceQueueId',_0x3824('0x157')]))[_0x3824('0x38')](_0xa540cc[_0x3824('0x1e6')](_0x1b25d2,_0x55975c[0x0]))[_0x3824('0x97')](_0xa540cc[_0x3824('0x14d')](_0x3824('0x210'),_0x1b25d2));}}})[_0x3824('0x97')](loggerGetContactDialer(_0x3824('0x211'),_0x1b25d2,0x1));};Dialer[_0x3824('0x7f')]['abandonmentRate']=function(_0x1d3d8e,_0x4e5821,_0x519def,_0x2a2209,_0x2c7a04,_0x43810e){loggerPredictive[_0x3824('0x42')](_0x3824('0x212'));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',_0x1d3d8e);loggerPredictive[_0x3824('0x42')](_0x3824('0x213'),_0x4e5821);loggerPredictive[_0x3824('0x42')](_0x3824('0x214'),_0x519def);loggerPredictive[_0x3824('0x42')]('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',_0x2a2209);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c7a04);loggerPredictive[_0x3824('0x42')]('---------------------------');return new Promise(function(_0x4b5735,_0x1447c5){if(_0x1d3d8e<=0x0||isNaN(_0x1d3d8e)){return _0x1447c5(msgResponse(_0x3824('0x215'),_0x3824('0x7e'),'m\x20=\x20'+_0x1d3d8e));}if(_0x519def<=0x0||isNaN(_0x519def)){return _0x1447c5(msgResponse('[abandonmentRate]','Error','Ts\x20=\x20'+_0x519def));}if(_0x2a2209<=0x0||isNaN(_0x2a2209)){return _0x1447c5(msgResponse('[abandonmentRate]',_0x3824('0x7e'),_0x3824('0x216')+_0x2a2209));}if(_0x4e5821<=0x0||isNaN(_0x4e5821)){return _0x1447c5(msgResponse(_0x3824('0x215'),_0x3824('0x7e'),_0x3824('0x217')+_0x4e5821));}if(_0x2c7a04<=0x0||isNaN(_0x2c7a04)){return _0x1447c5(msgResponse('[abandonmentRate]','Error',_0x3824('0x218')+_0x2c7a04));}_0x43810e=_0x43810e||0x0;var _0x1a809f=0x1/_0x519def;var _0x5cafa9=0x0;var _0x3a47f5=0x0;var _0x9a42c4=0x0;var _0x473848=0x0;for(var _0x3546a2=0x0;_0x9a42c4<_0x2c7a04;_0x3546a2+=0x1){_0x3a47f5=_0x3546a2/_0x4e5821;_0x5cafa9=(_0x2a2209*_0x3a47f5+_0x43810e)/_0x1a809f;_0x9a42c4=utils[_0x3824('0x219')](_0x5cafa9,_0x1d3d8e);_0x473848=_0x5cafa9/_0x1d3d8e*(0x1-utils[_0x3824('0x219')](_0x5cafa9,_0x1d3d8e));}return _0x4b5735({'erlangCalls':_0x3546a2,'erlangCallToSecond':_0x4e5821/_0x3546a2,'erlangAbandonmentRate':_0x9a42c4,'erlangBusyFactor':_0x473848});});};Dialer[_0x3824('0x7f')][_0x3824('0x1e2')]=function(_0x33420b,_0xf43f6f,_0x1e20ca,_0x2e1d79,_0x53db39,_0x143b39){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x3824('0x42')](_0x3824('0x21a'),_0x33420b);loggerPredictive[_0x3824('0x42')](_0x3824('0x213'),_0xf43f6f);loggerPredictive['info'](_0x3824('0x214'),_0x1e20ca);loggerPredictive[_0x3824('0x42')](_0x3824('0x21b'),_0x2e1d79);loggerPredictive[_0x3824('0x42')](_0x3824('0x21c'),_0x53db39);loggerPredictive[_0x3824('0x42')](_0x3824('0x4c'));return new Promise(function(_0x5ec361,_0x14543c){if(_0x33420b<=0x0||isNaN(_0x33420b)){return _0x14543c(msgResponse(_0x3824('0x21d'),'Error',_0x3824('0x21e')+_0x33420b));}if(_0x1e20ca<=0x0||isNaN(_0x1e20ca)){return _0x14543c(msgResponse(_0x3824('0x21d'),_0x3824('0x7e'),'Ts\x20=\x20'+_0x1e20ca));}if(_0x2e1d79<=0x0||isNaN(_0x2e1d79)){return _0x14543c(msgResponse(_0x3824('0x21d'),_0x3824('0x7e'),_0x3824('0x216')+_0x2e1d79));}if(_0xf43f6f<=0x0||isNaN(_0xf43f6f)){return _0x14543c(msgResponse(_0x3824('0x21d'),_0x3824('0x7e'),_0x3824('0x217')+_0xf43f6f));}if(_0x53db39<=0x0||isNaN(_0x53db39)){return _0x14543c(msgResponse(_0x3824('0x21d'),'Error',_0x3824('0x21f')+_0x53db39));}_0x143b39=_0x143b39||0x0;var _0x259d47=0x1/_0x1e20ca;var _0x42758e=0x0;var _0x5e90c9=0x0;var _0x43e08c=0x0;var _0x346e27=0x0;for(var _0x17bb5f=0x0;_0x346e27<_0x53db39;_0x17bb5f+=0x1){_0x5e90c9=_0x17bb5f/_0xf43f6f;_0x42758e=(_0x2e1d79*_0x5e90c9+_0x143b39)/_0x259d47;_0x43e08c=utils['erlangb'](_0x42758e,_0x33420b);_0x346e27=_0x42758e/_0x33420b*(0x1-utils[_0x3824('0x219')](_0x42758e,_0x33420b));}return _0x5ec361({'erlangCalls':_0x17bb5f,'erlangCallToSecond':_0xf43f6f/_0x17bb5f,'erlangAbandonmentRate':_0x43e08c,'erlangBusyFactor':_0x346e27});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index c113dff..19a5819 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb691=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb691,0x192));var _0x1b69=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0xb691[_0x21233e];return _0x3752c9;};'use strict';var util=require(_0x1b69('0x0'));var _=require(_0x1b69('0x1'));var moment=require('moment');function checkNameSurname(_0x501e9c,_0x301dbf,_0x1acb56){var _0x25943f='';if(!_[_0x1b69('0x2')](_0x301dbf)&&_0x1b69('0x3')===typeof _0x301dbf){_0x25943f+=_0x301dbf;}if(!_[_0x1b69('0x2')](_0x1acb56)&&_0x1b69('0x3')===typeof _0x1acb56){_0x25943f+='\x20'+_0x1acb56;}if(_0x25943f!==''){return _0x25943f;}return _0x501e9c;}function Action(_0xc4ab38,_0x24a3a0,_0x53b120){this[_0x1b69('0x4')]=_0xc4ab38;this[_0x1b69('0x5')]=_0x53b120||undefined;this[_0x1b69('0x6')]=checkNameSurname(_0x24a3a0[_0x1b69('0x7')][_0x1b69('0x8')],_0x24a3a0[_0x1b69('0x7')][_0x1b69('0x9')],_0x24a3a0[_0x1b69('0x7')][_0x1b69('0xa')]);this['number']=_0x24a3a0['phone'];this[_0x1b69('0xb')]=_0xc4ab38[_0x1b69('0x6')];this['active']=_0x24a3a0[_0x1b69('0xc')]||![];this[_0x1b69('0xd')]=_0xc4ab38[_0x1b69('0xd')];this[_0x1b69('0xe')]=_0xc4ab38[_0x1b69('0xe')]||0x3;this[_0x1b69('0xf')]=_0x24a3a0['scheduledat'];this['countbusyretry']=_0x24a3a0[_0x1b69('0x10')];this[_0x1b69('0x11')]=_0x24a3a0[_0x1b69('0x11')];this['countnoanswerretry']=_0x24a3a0[_0x1b69('0x12')];this[_0x1b69('0x13')]=_0x24a3a0[_0x1b69('0x13')];this[_0x1b69('0x14')]=_0x24a3a0[_0x1b69('0x14')];this[_0x1b69('0x15')]=_0x24a3a0[_0x1b69('0x15')];this[_0x1b69('0x16')]=_0x24a3a0[_0x1b69('0x16')];this[_0x1b69('0x17')]=_0x24a3a0[_0x1b69('0x17')];this['ContactId']=_0x24a3a0[_0x1b69('0x18')];this[_0x1b69('0x19')]=_0x24a3a0[_0x1b69('0x19')];this[_0x1b69('0x1a')]=_0x24a3a0['UserId'];this['VoiceQueueId']=_0x24a3a0[_0x1b69('0x1b')];this[_0x1b69('0x1c')]=_0x24a3a0[_0x1b69('0x1c')];this['idHopper']=_0x24a3a0['id'];this[_0x1b69('0x1d')]=_0x24a3a0[_0x1b69('0x7')][_0x1b69('0x9')]||'';this['starttime']=moment()['format'](_0x1b69('0x1e'));this['callback']=_0x24a3a0[_0x1b69('0x1f')];this[_0x1b69('0x20')]=_0x24a3a0[_0x1b69('0x20')];this['callbackat']=_0x24a3a0[_0x1b69('0x21')];this[_0x1b69('0x22')]=_0x24a3a0['recallme'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1b69('0x23')][_0x1b69('0x24')]=function(){return util['format'](_0x1b69('0x25'),this[_0x1b69('0x6')],this[_0x1b69('0x4')][_0x1b69('0x26')]>0x0?this[_0x1b69('0x27')]['substring'](this[_0x1b69('0x4')]['dialCutDigit']):this[_0x1b69('0x27')]);};Action['prototype'][_0x1b69('0x28')]=function(){return this[_0x1b69('0xb')];};module[_0x1b69('0x29')]=Action; \ No newline at end of file +var _0x713e=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','dialCutDigit','number','substring','getQueue','util','moment','isNil','string','voiceQueue','name','Contact','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x1d1eaf,_0x31b7bc){var _0xb0dc37=function(_0x2db2d4){while(--_0x2db2d4){_0x1d1eaf['push'](_0x1d1eaf['shift']());}};_0xb0dc37(++_0x31b7bc);}(_0x713e,0x1dc));var _0xe713=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x713e[_0x49beea];return _0x27693a;};'use strict';var util=require(_0xe713('0x0'));var _=require('lodash');var moment=require(_0xe713('0x1'));function checkNameSurname(_0x2880cf,_0x1882dd,_0x5306f7){var _0x5a1f63='';if(!_[_0xe713('0x2')](_0x1882dd)&&_0xe713('0x3')===typeof _0x1882dd){_0x5a1f63+=_0x1882dd;}if(!_['isNil'](_0x5306f7)&&_0xe713('0x3')===typeof _0x5306f7){_0x5a1f63+='\x20'+_0x5306f7;}if(_0x5a1f63!==''){return _0x5a1f63;}return _0x2880cf;}function Action(_0x22b958,_0x3417c2,_0x51748c){this[_0xe713('0x4')]=_0x22b958;this['uniqueid']=_0x51748c||undefined;this[_0xe713('0x5')]=checkNameSurname(_0x3417c2[_0xe713('0x6')]['phone'],_0x3417c2['Contact'][_0xe713('0x7')],_0x3417c2[_0xe713('0x6')][_0xe713('0x8')]);this['number']=_0x3417c2['phone'];this['queue']=_0x22b958[_0xe713('0x5')];this[_0xe713('0x9')]=_0x3417c2[_0xe713('0x9')]||![];this[_0xe713('0xa')]=_0x22b958['type'];this['dialQueueTimeout']=_0x22b958[_0xe713('0xb')]||0x3;this[_0xe713('0xc')]=_0x3417c2[_0xe713('0xc')];this[_0xe713('0xd')]=_0x3417c2[_0xe713('0xd')];this['countcongestionretry']=_0x3417c2[_0xe713('0xe')];this['countnoanswerretry']=_0x3417c2[_0xe713('0xf')];this['countnosuchnumberretry']=_0x3417c2[_0xe713('0x10')];this['countdropretry']=_0x3417c2[_0xe713('0x11')];this[_0xe713('0x12')]=_0x3417c2[_0xe713('0x12')];this[_0xe713('0x13')]=_0x3417c2[_0xe713('0x13')];this[_0xe713('0x14')]=_0x3417c2[_0xe713('0x14')];this[_0xe713('0x15')]=_0x3417c2[_0xe713('0x15')];this[_0xe713('0x16')]=_0x3417c2[_0xe713('0x16')];this['UserId']=_0x3417c2[_0xe713('0x17')];this[_0xe713('0x18')]=_0x3417c2[_0xe713('0x18')];this[_0xe713('0x19')]=_0x3417c2[_0xe713('0x19')];this['idHopper']=_0x3417c2['id'];this[_0xe713('0x1a')]=_0x3417c2['Contact'][_0xe713('0x7')]||'';this[_0xe713('0x1b')]=moment()['format'](_0xe713('0x1c'));this['callback']=_0x3417c2[_0xe713('0x1d')];this[_0xe713('0x1e')]=_0x3417c2[_0xe713('0x1e')];this['callbackat']=_0x3417c2[_0xe713('0x1f')];this[_0xe713('0x20')]=_0x3417c2[_0xe713('0x20')];this[_0xe713('0x21')]='';this[_0xe713('0x22')]='';}Action[_0xe713('0x23')]['getCaller']=function(){return util[_0xe713('0x24')]('\x22%s\x22\x20<%s>',this[_0xe713('0x5')],this['voiceQueue'][_0xe713('0x25')]>0x0?this[_0xe713('0x26')][_0xe713('0x27')](this[_0xe713('0x4')]['dialCutDigit']):this[_0xe713('0x26')]);};Action[_0xe713('0x23')][_0xe713('0x28')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index d74105d..d80fe35 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1637=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','callback','callbackat'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x1637,0x198));var _0x7163=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x1637[_0x47fd36];return _0x21a0fc;};'use strict';var moment=require(_0x7163('0x0'));var utils=require(_0x7163('0x1'));function AgentComplete(_0x43ea67,_0x46aac3){this[_0x7163('0x2')]=0x4;this[_0x7163('0x3')]=_0x7163('0x4');this[_0x7163('0x5')]=_0x43ea67[_0x7163('0x5')];this[_0x7163('0x6')]=_0x43ea67[_0x7163('0x6')];this['campaigntype']=_0x43ea67[_0x7163('0x6')]===_0x7163('0x7')?_0x7163('0x8'):_0x43ea67['type'];this[_0x7163('0x9')]=_0x43ea67[_0x7163('0x9')];this[_0x7163('0xa')]=_0x43ea67[_0x7163('0xa')];this[_0x7163('0xb')]=_0x43ea67[_0x7163('0xb')];this['countglobal']=_0x43ea67[_0x7163('0x9')]+_0x43ea67[_0x7163('0xa')]+_0x43ea67[_0x7163('0xb')]+_0x43ea67[_0x7163('0xc')]+_0x43ea67[_0x7163('0xd')]+_0x43ea67[_0x7163('0xe')]+_0x43ea67[_0x7163('0xf')]+_0x43ea67[_0x7163('0x10')];this[_0x7163('0xc')]=_0x43ea67[_0x7163('0xc')];this['countdropretry']=_0x43ea67[_0x7163('0xd')];this[_0x7163('0xe')]=_0x43ea67[_0x7163('0xe')];this['countmachineretry']=_0x43ea67[_0x7163('0xf')];this[_0x7163('0x10')]=_0x43ea67[_0x7163('0x10')];this[_0x7163('0x11')]=_0x46aac3['uniqueid'];this['calleridname']=_0x43ea67[_0x7163('0x12')];this[_0x7163('0x13')]=_0x43ea67['number'];this[_0x7163('0x14')]=_0x43ea67[_0x7163('0x14')];this[_0x7163('0x15')]=_0x43ea67[_0x7163('0x15')];this['answertime']=_0x43ea67[_0x7163('0x16')];this[_0x7163('0x17')]=moment()[_0x7163('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7163('0x19')]=utils[_0x7163('0x1a')](_0x43ea67['responsetime'],_0x43ea67[_0x7163('0x14')]);this[_0x7163('0x1b')]=utils[_0x7163('0x1a')](_0x43ea67[_0x7163('0x16')],_0x43ea67[_0x7163('0x15')]);this[_0x7163('0x1c')]=utils[_0x7163('0x1a')](this['endtime'],_0x43ea67[_0x7163('0x16')]);this['queue']=_0x46aac3['queue'];this[_0x7163('0x1d')]=_0x46aac3['membername'];this['reason']=_0x46aac3['reason'];this[_0x7163('0x1e')]=_0x43ea67[_0x7163('0x1e')];this['callbackuniqueid']=_0x43ea67['callbackuniqueid'];this[_0x7163('0x1f')]=_0x43ea67[_0x7163('0x1f')];this['recallme']=_0x43ea67['recallme'];this[_0x7163('0x20')]=_0x43ea67[_0x7163('0x20')];this[_0x7163('0x21')]=_0x43ea67['ListId'];this[_0x7163('0x22')]=_0x43ea67[_0x7163('0x22')];this[_0x7163('0x23')]=_0x43ea67[_0x7163('0x23')];this[_0x7163('0x24')]=_0x43ea67[_0x7163('0x24')];this['originatecalleridnum']=_0x43ea67['originatecalleridnum']||'';this[_0x7163('0x25')]=_0x43ea67[_0x7163('0x25')]||'';this['agiafterat']=_0x43ea67[_0x7163('0x26')];}module[_0x7163('0x27')]=AgentComplete; \ No newline at end of file +var _0x5bad=['answertime','endtime','ringtime','getSeconds','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime'];(function(_0x3d80cd,_0x56c9e0){var _0x533d32=function(_0x41cac9){while(--_0x41cac9){_0x3d80cd['push'](_0x3d80cd['shift']());}};_0x533d32(++_0x56c9e0);}(_0x5bad,0x1e1));var _0xd5ba=function(_0xe7c022,_0x5eefe2){_0xe7c022=_0xe7c022-0x0;var _0x5b6ea5=_0x5bad[_0xe7c022];return _0x5b6ea5;};'use strict';var moment=require(_0xd5ba('0x0'));var utils=require(_0xd5ba('0x1'));function AgentComplete(_0x26aafb,_0xb4c160){this[_0xd5ba('0x2')]=0x4;this[_0xd5ba('0x3')]=_0xd5ba('0x4');this[_0xd5ba('0x5')]=_0x26aafb[_0xd5ba('0x5')];this[_0xd5ba('0x6')]=_0x26aafb[_0xd5ba('0x6')];this[_0xd5ba('0x7')]=_0x26aafb[_0xd5ba('0x6')]==='outbound'?_0xd5ba('0x8'):_0x26aafb[_0xd5ba('0x6')];this['countbusyretry']=_0x26aafb[_0xd5ba('0x9')];this['countcongestionretry']=_0x26aafb[_0xd5ba('0xa')];this[_0xd5ba('0xb')]=_0x26aafb[_0xd5ba('0xb')];this[_0xd5ba('0xc')]=_0x26aafb[_0xd5ba('0x9')]+_0x26aafb[_0xd5ba('0xa')]+_0x26aafb['countnoanswerretry']+_0x26aafb[_0xd5ba('0xd')]+_0x26aafb[_0xd5ba('0xe')]+_0x26aafb[_0xd5ba('0xf')]+_0x26aafb[_0xd5ba('0x10')]+_0x26aafb[_0xd5ba('0x11')];this['countnosuchnumberretry']=_0x26aafb['countnosuchnumberretry'];this['countdropretry']=_0x26aafb[_0xd5ba('0xe')];this[_0xd5ba('0xf')]=_0x26aafb[_0xd5ba('0xf')];this[_0xd5ba('0x10')]=_0x26aafb[_0xd5ba('0x10')];this[_0xd5ba('0x11')]=_0x26aafb[_0xd5ba('0x11')];this['uniqueid']=_0xb4c160[_0xd5ba('0x12')];this[_0xd5ba('0x13')]=_0x26aafb['name'];this['calleridnum']=_0x26aafb[_0xd5ba('0x14')];this['starttime']=_0x26aafb[_0xd5ba('0x15')];this[_0xd5ba('0x16')]=_0x26aafb[_0xd5ba('0x16')];this[_0xd5ba('0x17')]=_0x26aafb[_0xd5ba('0x17')];this[_0xd5ba('0x18')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xd5ba('0x19')]=utils[_0xd5ba('0x1a')](_0x26aafb['responsetime'],_0x26aafb['starttime']);this[_0xd5ba('0x1b')]=utils[_0xd5ba('0x1a')](_0x26aafb[_0xd5ba('0x17')],_0x26aafb['responsetime']);this[_0xd5ba('0x1c')]=utils['getSeconds'](this[_0xd5ba('0x18')],_0x26aafb[_0xd5ba('0x17')]);this[_0xd5ba('0x8')]=_0xb4c160['queue'];this['membername']=_0xb4c160[_0xd5ba('0x1d')];this['reason']=_0xb4c160['reason'];this[_0xd5ba('0x1e')]=_0x26aafb[_0xd5ba('0x1e')];this[_0xd5ba('0x1f')]=_0x26aafb['callbackuniqueid'];this['callbackat']=_0x26aafb[_0xd5ba('0x20')];this[_0xd5ba('0x21')]=_0x26aafb['recallme'];this[_0xd5ba('0x22')]=_0x26aafb[_0xd5ba('0x22')];this[_0xd5ba('0x23')]=_0x26aafb[_0xd5ba('0x23')];this[_0xd5ba('0x24')]=_0x26aafb['UserId'];this[_0xd5ba('0x25')]=_0x26aafb[_0xd5ba('0x25')];this[_0xd5ba('0x26')]=_0x26aafb[_0xd5ba('0x26')];this[_0xd5ba('0x27')]=_0x26aafb[_0xd5ba('0x27')]||'';this['originatecalleridname']=_0x26aafb['originatecalleridname']||'';this[_0xd5ba('0x28')]=_0x26aafb[_0xd5ba('0x28')];}module[_0xd5ba('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index af212c7..2bbd9e3 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0cb=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid'];(function(_0x34b5ca,_0x594010){var _0x2d72c0=function(_0x4ae1d3){while(--_0x4ae1d3){_0x34b5ca['push'](_0x34b5ca['shift']());}};_0x2d72c0(++_0x594010);}(_0xb0cb,0x102));var _0xbb0c=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xb0cb[_0x22b68a];return _0x1ac67a;};'use strict';function Final(_0x4711ce){this[_0xbb0c('0x0')]=_0x4711ce[_0xbb0c('0x0')];this[_0xbb0c('0x1')]=_0x4711ce[_0xbb0c('0x1')];this[_0xbb0c('0x2')]=_0x4711ce[_0xbb0c('0x2')];this[_0xbb0c('0x3')]=_0x4711ce[_0xbb0c('0x2')]===_0xbb0c('0x4')?'queue':_0x4711ce[_0xbb0c('0x2')];this[_0xbb0c('0x5')]=_0x4711ce[_0xbb0c('0x5')];this[_0xbb0c('0x6')]=_0x4711ce[_0xbb0c('0x6')];this[_0xbb0c('0x7')]=_0x4711ce[_0xbb0c('0x7')];this[_0xbb0c('0x8')]=_0x4711ce[_0xbb0c('0x5')]+_0x4711ce[_0xbb0c('0x6')]+_0x4711ce['countnoanswerretry']+_0x4711ce[_0xbb0c('0x9')]+_0x4711ce[_0xbb0c('0xa')]+_0x4711ce['countabandonedretry']+_0x4711ce[_0xbb0c('0xb')]+_0x4711ce[_0xbb0c('0xc')];this[_0xbb0c('0x9')]=_0x4711ce[_0xbb0c('0x9')];this[_0xbb0c('0xa')]=_0x4711ce[_0xbb0c('0xa')];this[_0xbb0c('0xd')]=_0x4711ce[_0xbb0c('0xd')];this[_0xbb0c('0xb')]=_0x4711ce[_0xbb0c('0xb')];this[_0xbb0c('0xc')]=_0x4711ce[_0xbb0c('0xc')];this['queue']=_0x4711ce[_0xbb0c('0xe')];this[_0xbb0c('0xf')]=_0x4711ce[_0xbb0c('0xf')];this[_0xbb0c('0x10')]=_0x4711ce['calleridnum'];this['starttime']=_0x4711ce[_0xbb0c('0x11')];this[_0xbb0c('0x12')]=_0x4711ce[_0xbb0c('0x12')];this[_0xbb0c('0x13')]=_0x4711ce[_0xbb0c('0x12')];this['ringtime']=_0x4711ce[_0xbb0c('0x14')]||0x0;this[_0xbb0c('0x15')]=_0x4711ce[_0xbb0c('0x15')]||0x0;this[_0xbb0c('0x16')]=_0x4711ce[_0xbb0c('0x16')]||0x0;this[_0xbb0c('0x17')]=_0x4711ce[_0xbb0c('0x17')];this[_0xbb0c('0x18')]=_0x4711ce[_0xbb0c('0x18')];this['callbackat']=_0x4711ce[_0xbb0c('0x19')];this[_0xbb0c('0x1a')]=_0x4711ce[_0xbb0c('0x1a')];this[_0xbb0c('0x1b')]=_0x4711ce[_0xbb0c('0x1b')];this[_0xbb0c('0x1c')]=_0x4711ce[_0xbb0c('0x1c')];this[_0xbb0c('0x1d')]=_0x4711ce['UserId'];this[_0xbb0c('0x1e')]=_0x4711ce[_0xbb0c('0x1e')];this[_0xbb0c('0x1f')]=_0x4711ce[_0xbb0c('0x1f')];this[_0xbb0c('0x20')]=_0x4711ce[_0xbb0c('0x20')]||'';this[_0xbb0c('0x21')]=_0x4711ce[_0xbb0c('0x21')]||'';this[_0xbb0c('0x22')]=_0x4711ce[_0xbb0c('0x22')];this[_0xbb0c('0x23')]=_0x4711ce[_0xbb0c('0x23')];}module[_0xbb0c('0x24')]=Final; \ No newline at end of file +var _0xe400=['type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat'];(function(_0x1b8a6c,_0x4c2a5f){var _0x13ec3b=function(_0x53e579){while(--_0x53e579){_0x1b8a6c['push'](_0x1b8a6c['shift']());}};_0x13ec3b(++_0x4c2a5f);}(_0xe400,0x1b8));var _0x0e40=function(_0x435fce,_0x2de044){_0x435fce=_0x435fce-0x0;var _0x35bc10=_0xe400[_0x435fce];return _0x35bc10;};'use strict';function Final(_0x22f103){this[_0x0e40('0x0')]=_0x22f103['uniqueid'];this[_0x0e40('0x1')]=_0x22f103[_0x0e40('0x1')];this[_0x0e40('0x2')]=_0x22f103[_0x0e40('0x2')];this[_0x0e40('0x3')]=_0x22f103[_0x0e40('0x2')]==='outbound'?_0x0e40('0x4'):_0x22f103['type'];this[_0x0e40('0x5')]=_0x22f103[_0x0e40('0x5')];this[_0x0e40('0x6')]=_0x22f103[_0x0e40('0x6')];this[_0x0e40('0x7')]=_0x22f103[_0x0e40('0x7')];this[_0x0e40('0x8')]=_0x22f103[_0x0e40('0x5')]+_0x22f103['countcongestionretry']+_0x22f103[_0x0e40('0x7')]+_0x22f103[_0x0e40('0x9')]+_0x22f103['countdropretry']+_0x22f103[_0x0e40('0xa')]+_0x22f103[_0x0e40('0xb')]+_0x22f103['countagentrejectretry'];this[_0x0e40('0x9')]=_0x22f103[_0x0e40('0x9')];this[_0x0e40('0xc')]=_0x22f103[_0x0e40('0xc')];this[_0x0e40('0xa')]=_0x22f103[_0x0e40('0xa')];this[_0x0e40('0xb')]=_0x22f103[_0x0e40('0xb')];this[_0x0e40('0xd')]=_0x22f103['countagentrejectretry'];this[_0x0e40('0x4')]=_0x22f103[_0x0e40('0x4')];this[_0x0e40('0xe')]=_0x22f103['calleridname'];this[_0x0e40('0xf')]=_0x22f103[_0x0e40('0xf')];this[_0x0e40('0x10')]=_0x22f103[_0x0e40('0x10')];this[_0x0e40('0x11')]=_0x22f103['responsetime'];this[_0x0e40('0x12')]=_0x22f103['responsetime'];this[_0x0e40('0x13')]=_0x22f103[_0x0e40('0x13')]||0x0;this[_0x0e40('0x14')]=_0x22f103['holdtime']||0x0;this[_0x0e40('0x15')]=_0x22f103['talktime']||0x0;this[_0x0e40('0x16')]=_0x22f103['callback'];this[_0x0e40('0x17')]=_0x22f103[_0x0e40('0x17')];this[_0x0e40('0x18')]=_0x22f103['callbackat'];this['recallme']=_0x22f103['recallme'];this[_0x0e40('0x19')]=_0x22f103['ContactId'];this[_0x0e40('0x1a')]=_0x22f103['ListId'];this[_0x0e40('0x1b')]=_0x22f103[_0x0e40('0x1b')];this[_0x0e40('0x1c')]=_0x22f103[_0x0e40('0x1c')];this[_0x0e40('0x1d')]=_0x22f103[_0x0e40('0x1d')];this[_0x0e40('0x1e')]=_0x22f103['originatecalleridnum']||'';this[_0x0e40('0x1f')]=_0x22f103['originatecalleridname']||'';this[_0x0e40('0x20')]=_0x22f103[_0x0e40('0x20')];this['statedesc']=_0x22f103[_0x0e40('0x21')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 70ebb9d..f6fc5fb 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7ba=['Answer','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc'];(function(_0x7340c0,_0x20b8e6){var _0x3ca19c=function(_0x5e4611){while(--_0x5e4611){_0x7340c0['push'](_0x7340c0['shift']());}};_0x3ca19c(++_0x20b8e6);}(_0xe7ba,0x7a));var _0xae7b=function(_0xb09943,_0x4ac90c){_0xb09943=_0xb09943-0x0;var _0x110eb1=_0xe7ba[_0xb09943];return _0x110eb1;};'use strict';var moment=require(_0xae7b('0x0'));var utils=require(_0xae7b('0x1'));function Hangup(_0x46321f,_0x480fab){this[_0xae7b('0x2')]=0x4;this[_0xae7b('0x3')]=_0xae7b('0x4');this['scheduledat']=_0x46321f['scheduledat'];this[_0xae7b('0x5')]=_0x46321f[_0xae7b('0x5')];this[_0xae7b('0x6')]=_0x46321f[_0xae7b('0x5')]===_0xae7b('0x7')?_0xae7b('0x8'):_0x46321f['type'];this[_0xae7b('0x9')]=_0x46321f[_0xae7b('0x9')]||![];this[_0xae7b('0xa')]=_0x46321f[_0xae7b('0xa')];this[_0xae7b('0xb')]=_0x46321f[_0xae7b('0xb')];this[_0xae7b('0xc')]=_0x46321f[_0xae7b('0xc')];this['countglobal']=_0x46321f[_0xae7b('0xa')]+_0x46321f[_0xae7b('0xb')]+_0x46321f[_0xae7b('0xc')]+_0x46321f['countnosuchnumberretry']+_0x46321f[_0xae7b('0xd')]+_0x46321f[_0xae7b('0xe')]+_0x46321f[_0xae7b('0xf')]+_0x46321f[_0xae7b('0x10')];this['countnosuchnumberretry']=_0x46321f[_0xae7b('0x11')];this[_0xae7b('0xd')]=_0x46321f['countdropretry'];this[_0xae7b('0xe')]=_0x46321f[_0xae7b('0xe')];this[_0xae7b('0xf')]=_0x46321f[_0xae7b('0xf')];this['countagentrejectretry']=_0x46321f[_0xae7b('0x10')];this[_0xae7b('0x12')]=_0x480fab[_0xae7b('0x12')];this[_0xae7b('0x13')]=_0x46321f[_0xae7b('0x14')];this[_0xae7b('0x15')]=_0x46321f['number'];this[_0xae7b('0x16')]=_0x46321f[_0xae7b('0x16')];this[_0xae7b('0x17')]=_0x46321f[_0xae7b('0x17')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xae7b('0x18')]=utils[_0xae7b('0x19')](_0x46321f[_0xae7b('0x17')],_0x46321f['starttime']);this[_0xae7b('0x1a')]=0x0;this[_0xae7b('0x1b')]=utils['getSeconds'](this['endtime'],_0x46321f[_0xae7b('0x17')]);this[_0xae7b('0x8')]=_0x46321f[_0xae7b('0x8')];this[_0xae7b('0x1c')]=_0xae7b('0x1d');this[_0xae7b('0x1e')]=_0x480fab[_0xae7b('0x1f')];this[_0xae7b('0x20')]=_0x46321f[_0xae7b('0x20')];this['callbackuniqueid']=_0x46321f[_0xae7b('0x21')];this[_0xae7b('0x22')]=_0x46321f[_0xae7b('0x22')];this['recallme']=_0x46321f[_0xae7b('0x23')];this[_0xae7b('0x24')]=_0x46321f[_0xae7b('0x24')];this['ListId']=_0x46321f[_0xae7b('0x25')];this[_0xae7b('0x26')]=_0x46321f[_0xae7b('0x26')];this[_0xae7b('0x27')]=_0x46321f[_0xae7b('0x27')];this['CampaignId']=_0x46321f[_0xae7b('0x28')];}module[_0xae7b('0x29')]=Hangup; \ No newline at end of file +var _0xde89=['responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','starttime'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xde89,0x13a));var _0x9de8=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xde89[_0x48999d];return _0x1ad0d1;};'use strict';var moment=require('moment');var utils=require('../utils');function Hangup(_0x3e9e17,_0xd9b7bf){this[_0x9de8('0x0')]=0x4;this[_0x9de8('0x1')]=_0x9de8('0x2');this[_0x9de8('0x3')]=_0x3e9e17[_0x9de8('0x3')];this[_0x9de8('0x4')]=_0x3e9e17[_0x9de8('0x4')];this[_0x9de8('0x5')]=_0x3e9e17[_0x9de8('0x4')]===_0x9de8('0x6')?_0x9de8('0x7'):_0x3e9e17[_0x9de8('0x4')];this[_0x9de8('0x8')]=_0x3e9e17[_0x9de8('0x8')]||![];this[_0x9de8('0x9')]=_0x3e9e17[_0x9de8('0x9')];this[_0x9de8('0xa')]=_0x3e9e17[_0x9de8('0xa')];this['countnoanswerretry']=_0x3e9e17[_0x9de8('0xb')];this[_0x9de8('0xc')]=_0x3e9e17[_0x9de8('0x9')]+_0x3e9e17[_0x9de8('0xa')]+_0x3e9e17[_0x9de8('0xb')]+_0x3e9e17[_0x9de8('0xd')]+_0x3e9e17['countdropretry']+_0x3e9e17['countabandonedretry']+_0x3e9e17[_0x9de8('0xe')]+_0x3e9e17[_0x9de8('0xf')];this['countnosuchnumberretry']=_0x3e9e17[_0x9de8('0xd')];this[_0x9de8('0x10')]=_0x3e9e17[_0x9de8('0x10')];this[_0x9de8('0x11')]=_0x3e9e17[_0x9de8('0x11')];this[_0x9de8('0xe')]=_0x3e9e17[_0x9de8('0xe')];this[_0x9de8('0xf')]=_0x3e9e17[_0x9de8('0xf')];this['uniqueid']=_0xd9b7bf[_0x9de8('0x12')];this[_0x9de8('0x13')]=_0x3e9e17[_0x9de8('0x14')];this['calleridnum']=_0x3e9e17['number'];this[_0x9de8('0x15')]=_0x3e9e17[_0x9de8('0x15')];this[_0x9de8('0x16')]=_0x3e9e17[_0x9de8('0x16')];this[_0x9de8('0x17')]=moment()[_0x9de8('0x18')](_0x9de8('0x19'));this[_0x9de8('0x1a')]=utils[_0x9de8('0x1b')](_0x3e9e17['responsetime'],_0x3e9e17[_0x9de8('0x15')]);this[_0x9de8('0x1c')]=0x0;this[_0x9de8('0x1d')]=utils[_0x9de8('0x1b')](this[_0x9de8('0x17')],_0x3e9e17[_0x9de8('0x16')]);this[_0x9de8('0x7')]=_0x3e9e17[_0x9de8('0x7')];this[_0x9de8('0x1e')]=_0x9de8('0x1f');this['reason']=_0xd9b7bf[_0x9de8('0x20')];this[_0x9de8('0x21')]=_0x3e9e17[_0x9de8('0x21')];this[_0x9de8('0x22')]=_0x3e9e17[_0x9de8('0x22')];this[_0x9de8('0x23')]=_0x3e9e17[_0x9de8('0x23')];this['recallme']=_0x3e9e17[_0x9de8('0x24')];this[_0x9de8('0x25')]=_0x3e9e17['ContactId'];this['ListId']=_0x3e9e17[_0x9de8('0x26')];this['UserId']=_0x3e9e17[_0x9de8('0x27')];this[_0x9de8('0x28')]=_0x3e9e17['VoiceQueueId'];this['CampaignId']=_0x3e9e17['CampaignId'];}module[_0x9de8('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index b118019..5c591b8 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa360=['calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x2f09f7,_0x461707){var _0x1b266c=function(_0xbff8dc){while(--_0xbff8dc){_0x2f09f7['push'](_0x2f09f7['shift']());}};_0x1b266c(++_0x461707);}(_0xa360,0x108));var _0x0a36=function(_0xdfc539,_0x351741){_0xdfc539=_0xdfc539-0x0;var _0x4d5a6b=_0xa360[_0xdfc539];return _0x4d5a6b;};'use strict';var utils=require(_0x0a36('0x0'));function History(_0x1cb5c8){this[_0x0a36('0x1')]=_0x1cb5c8['uniqueid'];this['scheduledat']=_0x1cb5c8[_0x0a36('0x2')]||undefined;this[_0x0a36('0x3')]=_0x1cb5c8['type'];this[_0x0a36('0x4')]=_0x1cb5c8[_0x0a36('0x3')]===_0x0a36('0x5')?_0x0a36('0x6'):_0x1cb5c8[_0x0a36('0x3')];this[_0x0a36('0x7')]=_0x1cb5c8['countbusyretry'];this['countcongestionretry']=_0x1cb5c8[_0x0a36('0x8')];this['countnoanswerretry']=_0x1cb5c8['countnoanswerretry'];this[_0x0a36('0x9')]=_0x1cb5c8[_0x0a36('0x7')]+_0x1cb5c8[_0x0a36('0x8')]+_0x1cb5c8[_0x0a36('0xa')]+_0x1cb5c8[_0x0a36('0xb')]+_0x1cb5c8[_0x0a36('0xc')]+_0x1cb5c8[_0x0a36('0xd')]+_0x1cb5c8['countmachineretry']+_0x1cb5c8[_0x0a36('0xe')];this[_0x0a36('0xb')]=_0x1cb5c8[_0x0a36('0xb')];this[_0x0a36('0xc')]=_0x1cb5c8[_0x0a36('0xc')];this[_0x0a36('0xd')]=_0x1cb5c8['countabandonedretry'];this[_0x0a36('0xf')]=_0x1cb5c8['countmachineretry'];this[_0x0a36('0xe')]=_0x1cb5c8[_0x0a36('0xe')];this[_0x0a36('0x6')]=_0x1cb5c8[_0x0a36('0x6')];this[_0x0a36('0x10')]=_0x1cb5c8['name'];this[_0x0a36('0x11')]=_0x1cb5c8[_0x0a36('0x12')];this['starttime']=_0x1cb5c8[_0x0a36('0x13')];this['responsetime']=_0x1cb5c8[_0x0a36('0x14')];this[_0x0a36('0x15')]=_0x1cb5c8[_0x0a36('0x14')];this[_0x0a36('0x16')]=utils[_0x0a36('0x17')](_0x1cb5c8[_0x0a36('0x14')],_0x1cb5c8[_0x0a36('0x13')]);this[_0x0a36('0x18')]=0x0;this[_0x0a36('0x19')]=0x0;this[_0x0a36('0x1a')]=_0x1cb5c8['callback'];this[_0x0a36('0x1b')]=_0x1cb5c8[_0x0a36('0x1b')];this[_0x0a36('0x1c')]=_0x1cb5c8[_0x0a36('0x1c')];this[_0x0a36('0x1d')]=_0x1cb5c8[_0x0a36('0x1d')];this[_0x0a36('0x1e')]=_0x1cb5c8[_0x0a36('0x1e')];this[_0x0a36('0x1f')]=_0x1cb5c8[_0x0a36('0x1f')];this[_0x0a36('0x20')]=_0x1cb5c8[_0x0a36('0x20')];this[_0x0a36('0x21')]=_0x1cb5c8[_0x0a36('0x21')];this[_0x0a36('0x22')]=_0x1cb5c8[_0x0a36('0x22')];this['originatecalleridnum']=_0x1cb5c8[_0x0a36('0x23')]||'';this[_0x0a36('0x24')]=_0x1cb5c8[_0x0a36('0x24')]||'';this[_0x0a36('0x25')]=_0x1cb5c8[_0x0a36('0x25')];this[_0x0a36('0x26')]=_0x1cb5c8['statedesc'];}module[_0x0a36('0x27')]=History; \ No newline at end of file +var _0x2130=['exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc'];(function(_0x6a2228,_0x4a1d8b){var _0x2d7c81=function(_0x53bf1e){while(--_0x53bf1e){_0x6a2228['push'](_0x6a2228['shift']());}};_0x2d7c81(++_0x4a1d8b);}(_0x2130,0xe5));var _0x0213=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x2130[_0x1992f1];return _0x413dfe;};'use strict';var utils=require(_0x0213('0x0'));function History(_0x144536){this['uniqueid']=_0x144536[_0x0213('0x1')];this[_0x0213('0x2')]=_0x144536['scheduledat']||undefined;this[_0x0213('0x3')]=_0x144536[_0x0213('0x3')];this[_0x0213('0x4')]=_0x144536[_0x0213('0x3')]===_0x0213('0x5')?_0x0213('0x6'):_0x144536['type'];this['countbusyretry']=_0x144536[_0x0213('0x7')];this[_0x0213('0x8')]=_0x144536[_0x0213('0x8')];this[_0x0213('0x9')]=_0x144536['countnoanswerretry'];this['countglobal']=_0x144536['countbusyretry']+_0x144536[_0x0213('0x8')]+_0x144536[_0x0213('0x9')]+_0x144536[_0x0213('0xa')]+_0x144536['countdropretry']+_0x144536[_0x0213('0xb')]+_0x144536[_0x0213('0xc')]+_0x144536[_0x0213('0xd')];this['countnosuchnumberretry']=_0x144536[_0x0213('0xa')];this['countdropretry']=_0x144536[_0x0213('0xe')];this[_0x0213('0xb')]=_0x144536[_0x0213('0xb')];this[_0x0213('0xc')]=_0x144536['countmachineretry'];this[_0x0213('0xd')]=_0x144536['countagentrejectretry'];this['queue']=_0x144536['queue'];this[_0x0213('0xf')]=_0x144536['name'];this[_0x0213('0x10')]=_0x144536[_0x0213('0x11')];this[_0x0213('0x12')]=_0x144536[_0x0213('0x12')];this[_0x0213('0x13')]=_0x144536[_0x0213('0x13')];this[_0x0213('0x14')]=_0x144536[_0x0213('0x13')];this[_0x0213('0x15')]=utils[_0x0213('0x16')](_0x144536[_0x0213('0x13')],_0x144536[_0x0213('0x12')]);this[_0x0213('0x17')]=0x0;this[_0x0213('0x18')]=0x0;this['callback']=_0x144536['callback'];this['callbackuniqueid']=_0x144536[_0x0213('0x19')];this[_0x0213('0x1a')]=_0x144536[_0x0213('0x1a')];this[_0x0213('0x1b')]=_0x144536[_0x0213('0x1b')];this['ContactId']=_0x144536[_0x0213('0x1c')];this[_0x0213('0x1d')]=_0x144536[_0x0213('0x1d')];this[_0x0213('0x1e')]=_0x144536[_0x0213('0x1e')];this[_0x0213('0x1f')]=_0x144536[_0x0213('0x1f')];this[_0x0213('0x20')]=_0x144536[_0x0213('0x20')];this[_0x0213('0x21')]=_0x144536['originatecalleridnum']||'';this[_0x0213('0x22')]=_0x144536['originatecalleridname']||'';this['state']=_0x144536[_0x0213('0x23')];this[_0x0213('0x24')]=_0x144536[_0x0213('0x24')];}module[_0x0213('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index b37ba0e..ee425d1 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6149=['countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','dropreason','endtime','droptime','ringtime','holdtime','getSeconds','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','campaigntype','type','outbound','queue'];(function(_0x541ade,_0xd86dfb){var _0x30096e=function(_0x33b81d){while(--_0x33b81d){_0x541ade['push'](_0x541ade['shift']());}};_0x30096e(++_0xd86dfb);}(_0x6149,0x84));var _0x9614=function(_0x50449e,_0x93cbf9){_0x50449e=_0x50449e-0x0;var _0x1cc098=_0x6149[_0x50449e];return _0x1cc098;};'use strict';var utils=require(_0x9614('0x0'));function QueueCallerAbandon(_0x2b07ab,_0x134307){this[_0x9614('0x1')]=_0x2b07ab[_0x9614('0x1')];this['type']=_0x2b07ab['type'];this[_0x9614('0x2')]=_0x2b07ab[_0x9614('0x3')]===_0x9614('0x4')?_0x9614('0x5'):_0x2b07ab[_0x9614('0x3')];this['countbusyretry']=_0x2b07ab[_0x9614('0x6')];this[_0x9614('0x7')]=_0x2b07ab[_0x9614('0x7')];this['countnoanswerretry']=_0x2b07ab['countnoanswerretry'];this[_0x9614('0x8')]=_0x2b07ab[_0x9614('0x6')]+_0x2b07ab[_0x9614('0x7')]+_0x2b07ab[_0x9614('0x9')]+_0x2b07ab[_0x9614('0xa')]+_0x2b07ab[_0x9614('0xb')]+_0x2b07ab['countabandonedretry']+_0x2b07ab['countmachineretry']+_0x2b07ab[_0x9614('0xc')];this[_0x9614('0xa')]=_0x2b07ab[_0x9614('0xa')];this['countdropretry']=_0x2b07ab[_0x9614('0xb')];this['countabandonedretry']=_0x2b07ab[_0x9614('0xd')];this[_0x9614('0xe')]=_0x2b07ab[_0x9614('0xe')];this['countagentrejectretry']=_0x2b07ab[_0x9614('0xc')];this['uniqueid']=_0x134307[_0x9614('0xf')];this[_0x9614('0x10')]=_0x2b07ab[_0x9614('0x11')];this[_0x9614('0x12')]=_0x2b07ab[_0x9614('0x13')];this['starttime']=_0x2b07ab[_0x9614('0x14')];this[_0x9614('0x15')]=_0x2b07ab['responsetime'];this['droptime']=_0x2b07ab['droptime'];this[_0x9614('0x16')]=_0x2b07ab['dropreason'];this[_0x9614('0x17')]=this[_0x9614('0x18')];this[_0x9614('0x19')]=utils['getSeconds'](_0x2b07ab[_0x9614('0x15')],_0x2b07ab[_0x9614('0x14')]);this[_0x9614('0x1a')]=utils[_0x9614('0x1b')](this[_0x9614('0x18')],_0x2b07ab['responsetime']);this[_0x9614('0x1c')]=0x0;this[_0x9614('0x5')]=_0x134307['queue'];this['membername']=_0x134307[_0x9614('0x1d')];this[_0x9614('0x1e')]=_0x134307[_0x9614('0x1e')];this[_0x9614('0x1f')]=_0x2b07ab[_0x9614('0x1f')];this[_0x9614('0x20')]=_0x2b07ab[_0x9614('0x20')];this[_0x9614('0x21')]=_0x2b07ab['callbackat'];this[_0x9614('0x22')]=_0x2b07ab['recallme'];this['ContactId']=_0x2b07ab[_0x9614('0x23')];this[_0x9614('0x24')]=_0x2b07ab[_0x9614('0x24')];this['UserId']=_0x2b07ab[_0x9614('0x25')];this[_0x9614('0x26')]=_0x2b07ab[_0x9614('0x26')];this[_0x9614('0x27')]=_0x2b07ab[_0x9614('0x27')];this[_0x9614('0x28')]=_0x2b07ab['originatecalleridnum']||'';this[_0x9614('0x29')]=_0x2b07ab[_0x9614('0x29')]||'';this[_0x9614('0x2a')]=_0x2b07ab[_0x9614('0x2a')];this['state']=_0x2b07ab[_0x9614('0x2b')];this[_0x9614('0x2c')]=_0x2b07ab[_0x9614('0x2c')];}module[_0x9614('0x2d')]=QueueCallerAbandon; \ No newline at end of file +var _0x3854=['exports','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','starttime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3854,0x184));var _0x4385=function(_0x44164b,_0x2dbe2d){_0x44164b=_0x44164b-0x0;var _0x19afe3=_0x3854[_0x44164b];return _0x19afe3;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x228c1b,_0x4c6b90){this[_0x4385('0x0')]=_0x228c1b[_0x4385('0x0')];this['type']=_0x228c1b[_0x4385('0x1')];this['campaigntype']=_0x228c1b[_0x4385('0x1')]===_0x4385('0x2')?_0x4385('0x3'):_0x228c1b[_0x4385('0x1')];this['countbusyretry']=_0x228c1b[_0x4385('0x4')];this[_0x4385('0x5')]=_0x228c1b['countcongestionretry'];this[_0x4385('0x6')]=_0x228c1b['countnoanswerretry'];this[_0x4385('0x7')]=_0x228c1b['countbusyretry']+_0x228c1b[_0x4385('0x5')]+_0x228c1b[_0x4385('0x6')]+_0x228c1b[_0x4385('0x8')]+_0x228c1b[_0x4385('0x9')]+_0x228c1b['countabandonedretry']+_0x228c1b['countmachineretry']+_0x228c1b[_0x4385('0xa')];this['countnosuchnumberretry']=_0x228c1b[_0x4385('0x8')];this['countdropretry']=_0x228c1b['countdropretry'];this['countabandonedretry']=_0x228c1b[_0x4385('0xb')];this[_0x4385('0xc')]=_0x228c1b[_0x4385('0xc')];this[_0x4385('0xa')]=_0x228c1b['countagentrejectretry'];this[_0x4385('0xd')]=_0x4c6b90[_0x4385('0xd')];this[_0x4385('0xe')]=_0x228c1b[_0x4385('0xf')];this[_0x4385('0x10')]=_0x228c1b['number'];this['starttime']=_0x228c1b['starttime'];this[_0x4385('0x11')]=_0x228c1b[_0x4385('0x11')];this[_0x4385('0x12')]=_0x228c1b['droptime'];this[_0x4385('0x13')]=_0x228c1b[_0x4385('0x13')];this[_0x4385('0x14')]=this[_0x4385('0x12')];this[_0x4385('0x15')]=utils[_0x4385('0x16')](_0x228c1b[_0x4385('0x11')],_0x228c1b[_0x4385('0x17')]);this[_0x4385('0x18')]=utils[_0x4385('0x16')](this[_0x4385('0x12')],_0x228c1b[_0x4385('0x11')]);this['talktime']=0x0;this[_0x4385('0x3')]=_0x4c6b90[_0x4385('0x3')];this[_0x4385('0x19')]=_0x4c6b90[_0x4385('0x1a')];this[_0x4385('0x1b')]=_0x4c6b90['reason'];this['callback']=_0x228c1b[_0x4385('0x1c')];this[_0x4385('0x1d')]=_0x228c1b[_0x4385('0x1d')];this['callbackat']=_0x228c1b[_0x4385('0x1e')];this[_0x4385('0x1f')]=_0x228c1b[_0x4385('0x1f')];this[_0x4385('0x20')]=_0x228c1b['ContactId'];this['ListId']=_0x228c1b[_0x4385('0x21')];this[_0x4385('0x22')]=_0x228c1b[_0x4385('0x22')];this[_0x4385('0x23')]=_0x228c1b[_0x4385('0x23')];this['CampaignId']=_0x228c1b[_0x4385('0x24')];this[_0x4385('0x25')]=_0x228c1b[_0x4385('0x25')]||'';this['originatecalleridname']=_0x228c1b[_0x4385('0x26')]||'';this[_0x4385('0x27')]=_0x228c1b[_0x4385('0x27')];this[_0x4385('0x28')]=_0x228c1b[_0x4385('0x28')];this[_0x4385('0x29')]=_0x228c1b[_0x4385('0x29')];}module[_0x4385('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 8545543..0c4ff0d 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x2054ad,_0x6e57ca){var _0x4d874b=function(_0x50e27e){while(--_0x50e27e){_0x2054ad['push'](_0x2054ad['shift']());}};_0x4d874b(++_0x6e57ca);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x5a94c7,_0x20fd04){var _0x5ae131=function(_0x54cd21){while(--_0x54cd21){_0x5a94c7['push'](_0x5a94c7['shift']());}};_0x5ae131(++_0x20fd04);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 2893a1f..8c9ce2a 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4b5=['diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','string','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds'];(function(_0x3c57a3,_0x2d9495){var _0x234cb3=function(_0x35d394){while(--_0x35d394){_0x3c57a3['push'](_0x3c57a3['shift']());}};_0x234cb3(++_0x2d9495);}(_0xa4b5,0xe2));var _0x5a4b=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa4b5[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x5a4b('0x0'));var moment=require(_0x5a4b('0x1'));var util=require(_0x5a4b('0x2'));var logger=require(_0x5a4b('0x3'))(_0x5a4b('0x4'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x5a4b('0x5'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x5a4b('0x6'),'DISACTIVED':_0x5a4b('0x7'),'EMPTY_INTERVAL':_0x5a4b('0x8'),'INACTIVE':_0x5a4b('0x9'),'NO_AGENTS_LOGGED':_0x5a4b('0xa'),'NO_AVAILABLE_CONTACTS':_0x5a4b('0xb'),'NULL_INTERVAL':_0x5a4b('0xc'),'OVERTIME_INTERVAL':_0x5a4b('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x5a4b('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x5a4b('0xf'),'RUNNING':_0x5a4b('0x10'),'UNKNOWN_TIMEZONE':_0x5a4b('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x42fccb){return _0x42fccb[_0x5a4b('0x12')]===_0x5a4b('0x13');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x46e24e){return _0x46e24e[_0x5a4b('0x14')]===_0x5a4b('0x15');}exports[_0x5a4b('0x16')]=isIVRCampaign;function isOutboundQueue(_0x7ac507){return _0x7ac507[_0x5a4b('0x14')]==='outbound';}exports[_0x5a4b('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x437852){return _0x437852[_0x5a4b('0x18')];}exports[_0x5a4b('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5194f4){return _0x5194f4[_0x5a4b('0x1a')];}exports[_0x5a4b('0x1b')]=isIVRCampaignActive;function getSeconds(_0x3f1605,_0xcfd917){var _0x3bee84=moment(_0x3f1605)['milliseconds'](0x0);var _0x1c38f0=moment(_0xcfd917)[_0x5a4b('0x1c')](0x0);return _0x3bee84[_0x5a4b('0x1d')](_0x1c38f0,_0x5a4b('0x1e'));}exports[_0x5a4b('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x195ecb,_0x13a3e9){var _0x2f84b5=![];var _0x356d49=_0x195ecb['dialMethod']!==_0x13a3e9[_0x5a4b('0x12')]||_0x195ecb[_0x5a4b('0x18')]!==_0x13a3e9[_0x5a4b('0x18')]||_0x195ecb[_0x5a4b('0x20')]!==_0x13a3e9['message'];var _0x4e623f=_0x195ecb[_0x5a4b('0x21')]!==_0x13a3e9['available']||_0x195ecb[_0x5a4b('0x22')]!==_0x13a3e9['loggedIn']||_0x195ecb[_0x5a4b('0x23')]!==_0x13a3e9[_0x5a4b('0x23')]||_0x195ecb[_0x5a4b('0x24')]!==_0x13a3e9[_0x5a4b('0x24')]||_0x195ecb[_0x5a4b('0x25')]!==_0x13a3e9[_0x5a4b('0x25')]||_0x195ecb[_0x5a4b('0x26')]!==_0x13a3e9[_0x5a4b('0x26')]||_0x195ecb[_0x5a4b('0x27')]!==_0x13a3e9[_0x5a4b('0x27')]||_0x195ecb[_0x5a4b('0x28')]!==_0x13a3e9[_0x5a4b('0x28')]||_0x195ecb[_0x5a4b('0x29')]!==_0x13a3e9[_0x5a4b('0x29')];if(_0x195ecb['Trunk']&&_0x13a3e9['Trunk']){_0x2f84b5=_0x195ecb[_0x5a4b('0x2a')][_0x5a4b('0x2b')]!==_0x13a3e9[_0x5a4b('0x2a')][_0x5a4b('0x2b')]||_0x195ecb[_0x5a4b('0x2a')][_0x5a4b('0x1a')]!==_0x13a3e9[_0x5a4b('0x2a')][_0x5a4b('0x1a')];}return _0x356d49||_0x4e623f||_0x2f84b5;}exports[_0x5a4b('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x12ea15){var _0x4fb336=null;var _0x518a81=_0x12ea15[_0x5a4b('0x2d')];if(_[_0x5a4b('0x2e')](_0x12ea15[_0x5a4b('0x2f')])||_['isNil'](_0x12ea15[_0x5a4b('0x30')])||_[_0x5a4b('0x2e')](_0x12ea15[_0x5a4b('0x30')][_0x5a4b('0x31')])){_0x4fb336=CAMPAIGN_STATUS[_0x5a4b('0x32')];}else if(_[_0x5a4b('0x33')](_0x12ea15[_0x5a4b('0x2f')])||_[_0x5a4b('0x33')](_0x12ea15[_0x5a4b('0x30')][_0x5a4b('0x31')])){_0x4fb336=CAMPAIGN_STATUS[_0x5a4b('0x34')];}else if(_0x518a81&&!timezones[_0x518a81]){_0x4fb336=CAMPAIGN_STATUS[_0x5a4b('0x35')];}return _0x4fb336;}function checkAnyValidTrunk(_0x1520fc,_0x5be3fa){var _0x4c4c=null;var _0x11a276=_0x5a4b('0x36');var _0x4a361e=['reachable',_0x5a4b('0x37')];var _0x29511f=!![];if(_0x1520fc[_0x5a4b('0x2a')]&&_0x1520fc[_0x5a4b('0x2a')]['active']){_0x11a276+=_0x1520fc[_0x5a4b('0x2a')][_0x5a4b('0x2b')];_0x4c4c=_0x5be3fa[_0x11a276];_0x29511f=_0x4a361e[_0x5a4b('0x38')](_0x4c4c[_0x5a4b('0x39')]);}else if(_0x1520fc['TrunkBackup']&&_0x1520fc[_0x5a4b('0x3a')][_0x5a4b('0x1a')]){_0x11a276+=_0x1520fc['TrunkBackup'][_0x5a4b('0x2b')];_0x4c4c=_0x5be3fa[_0x11a276];_0x29511f=_0x4a361e[_0x5a4b('0x38')](_0x4c4c['status']);}return _0x29511f;}function getQueueCampaignStatusMessage(_0x108ceb,_0x2e99dd){var _0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3b')];var _0x29796e=isPreviewCampaign(_0x108ceb);if(!isQueueCampaignActive(_0x108ceb)){if(_0x29796e){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3c')];}else{if(_0x108ceb[_0x5a4b('0x29')]===0x0&&_0x108ceb['talking']===0x0&&_0x108ceb[_0x5a4b('0x27')]===0x0&&(_0x108ceb['pTalking']||0x0)===0x0){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3c')];}else{_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3d')];}}}else if(_0x108ceb['loggedIn']===0x0){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3e')];}else if(!checkAnyValidTrunk(_0x108ceb,_0x2e99dd)){_0xe5aa23=CAMPAIGN_STATUS[_0x5a4b('0x3f')];}else if(!isPreviewCampaign(_0x108ceb)){var _0x28cd6f=checkAnyValidQueueCampaignInterval(_0x108ceb);if(_0x28cd6f){_0xe5aa23=_0x28cd6f;}}return _0xe5aa23;}exports[_0x5a4b('0x40')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x193749){var _0x4472b2=CAMPAIGN_STATUS['DISACTIVED'];if(_0x193749[_0x5a4b('0x29')]===0x0&&_0x193749['talking']===0x0&&_0x193749[_0x5a4b('0x27')]===0x0&&(_0x193749[_0x5a4b('0x26')]||0x0)===0x0){_0x4472b2=CAMPAIGN_STATUS[_0x5a4b('0x3c')];}return _0x4472b2;}exports[_0x5a4b('0x41')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x11819e){var _0x4ebf54=_0x11819e['match'](/"(.*?)"/);return _0x4ebf54?_0x4ebf54[0x1]:_0x11819e;}exports[_0x5a4b('0x42')]=extractCalleridName;function getCallerId(_0x26395b,_0x5151a9,_0x1d50df){if(!_['isUndefined'](_0x1d50df)&&typeof _0x1d50df===_0x5a4b('0x43')&&!_['isEmpty'](_0x1d50df)){if(!_['isUndefined'](_0x5151a9)&&typeof _0x5151a9===_0x5a4b('0x43')&&!_[_0x5a4b('0x33')](_0x5151a9)){return util[_0x5a4b('0x44')](_0x5a4b('0x45'),_0x5151a9,_0x1d50df);}return util['format'](_0x5a4b('0x45'),_0x1d50df,_0x1d50df);}if(!_[_0x5a4b('0x46')](_0x26395b)&&typeof _0x26395b===_0x5a4b('0x43')&&!_[_0x5a4b('0x33')](_0x26395b)){return _0x26395b;}return _0x5a4b('0x47');}exports[_0x5a4b('0x48')]=getCallerId;function getCallerIdRandom(_0x3b18a4,_0x30987a){var _0x3e439e;var _0x2d5159;var _0x296900;if(_0x30987a<=0x0){_0x30987a=0x1;}_0x3e439e=new RegExp(_0x5a4b('0x49')+_0x30987a+'}$');_0x2d5159=Math['pow'](0xa,_0x30987a-0x1);_0x296900=Math[_0x5a4b('0x4a')](0xa,_0x30987a)-0x1;return util[_0x5a4b('0x44')]('%s',_[_0x5a4b('0x4b')](_0x3b18a4,_0x3e439e,_[_0x5a4b('0x4c')](_0x2d5159,_0x296900)[_0x5a4b('0x4d')]()));}exports[_0x5a4b('0x4e')]=getCallerIdRandom;function decrementOriginate(_0x47ffa0){if(_0x47ffa0[_0x5a4b('0x29')]&&_0x47ffa0[_0x5a4b('0x29')]>0x0){_0x47ffa0[_0x5a4b('0x29')]-=0x1;}else{logger[_0x5a4b('0x4f')](_0x5a4b('0x50'));}}exports[_0x5a4b('0x51')]=decrementOriginate;function checkContactEmpty(_0x392c53){return _0x392c53&&_0x392c53[_0x5a4b('0x52')]>0x0;}exports[_0x5a4b('0x53')]=checkContactEmpty;function erlangb(_0x46ddca,_0x5da848){if(_0x5da848===0x0){return 0x0;}var _0xf92fde=0x1;for(var _0x5a7135=0x1;_0x5a7135<=_0x5da848;_0x5a7135+=0x1){_0xf92fde=0x1+_0xf92fde*_0x5a7135/_0x46ddca;}return 0x1/_0xf92fde;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x179da0,_0xae7156,_0x214fc0){if(_0xae7156>_0x214fc0){for(var _0x1c3b9=0x0;_0x1c3b9<_0xae7156-_0x214fc0;_0x1c3b9+=0x1){decrementOriginate(_0x179da0);}}}exports[_0x5a4b('0x54')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xf9d0=['replace','random','toString','getCallerIdRandom','error','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','milliseconds','diff','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow'];(function(_0x2683fa,_0x51d8d3){var _0x3be83b=function(_0x43f756){while(--_0x43f756){_0x2683fa['push'](_0x2683fa['shift']());}};_0x3be83b(++_0x51d8d3);}(_0xf9d0,0xad));var _0x0f9d=function(_0x5051cf,_0x4e6d95){_0x5051cf=_0x5051cf-0x0;var _0x36c5f6=_0xf9d0[_0x5051cf];return _0x36c5f6;};'use strict';var _=require(_0x0f9d('0x0'));var moment=require(_0x0f9d('0x1'));var util=require(_0x0f9d('0x2'));var logger=require(_0x0f9d('0x3'))(_0x0f9d('0x4'));var timezones=require(_0x0f9d('0x5'))[_0x0f9d('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x0f9d('0x7'),'BLACKLIST':_0x0f9d('0x8'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x0f9d('0x9'),'DISACTIVED':_0x0f9d('0xa'),'EMPTY_INTERVAL':_0x0f9d('0xb'),'INACTIVE':_0x0f9d('0xc'),'NO_AGENTS_LOGGED':_0x0f9d('0xd'),'NO_AVAILABLE_CONTACTS':_0x0f9d('0xe'),'NULL_INTERVAL':_0x0f9d('0xf'),'OVERTIME_INTERVAL':_0x0f9d('0x10'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x0f9d('0x11'),'RECALL_TIMEOUT':_0x0f9d('0x12'),'RUNNING':_0x0f9d('0x13'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x593db8){return _0x593db8[_0x0f9d('0x14')]===_0x0f9d('0x15');}exports[_0x0f9d('0x16')]=isPreviewCampaign;function isIVRCampaign(_0xceef81){return _0xceef81[_0x0f9d('0x17')]===_0x0f9d('0x18');}exports[_0x0f9d('0x19')]=isIVRCampaign;function isOutboundQueue(_0x390ef8){return _0x390ef8[_0x0f9d('0x17')]===_0x0f9d('0x1a');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x45d8f9){return _0x45d8f9[_0x0f9d('0x1b')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x637477){return _0x637477['active'];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x112754,_0x190244){var _0x4bc2cd=moment(_0x112754)[_0x0f9d('0x1c')](0x0);var _0x3355b1=moment(_0x190244)['milliseconds'](0x0);return _0x4bc2cd[_0x0f9d('0x1d')](_0x3355b1,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x234bd7,_0x24780e){var _0x2e47b2=![];var _0x1ef3e9=_0x234bd7[_0x0f9d('0x14')]!==_0x24780e['dialMethod']||_0x234bd7[_0x0f9d('0x1b')]!==_0x24780e['dialActive']||_0x234bd7[_0x0f9d('0x1e')]!==_0x24780e[_0x0f9d('0x1e')];var _0xf71d3a=_0x234bd7[_0x0f9d('0x1f')]!==_0x24780e[_0x0f9d('0x1f')]||_0x234bd7[_0x0f9d('0x20')]!==_0x24780e[_0x0f9d('0x20')]||_0x234bd7[_0x0f9d('0x21')]!==_0x24780e[_0x0f9d('0x21')]||_0x234bd7[_0x0f9d('0x22')]!==_0x24780e[_0x0f9d('0x22')]||_0x234bd7[_0x0f9d('0x23')]!==_0x24780e[_0x0f9d('0x23')]||_0x234bd7[_0x0f9d('0x24')]!==_0x24780e[_0x0f9d('0x24')]||_0x234bd7[_0x0f9d('0x25')]!==_0x24780e[_0x0f9d('0x25')]||_0x234bd7['inUse']!==_0x24780e[_0x0f9d('0x26')]||_0x234bd7[_0x0f9d('0x27')]!==_0x24780e[_0x0f9d('0x27')];if(_0x234bd7['Trunk']&&_0x24780e[_0x0f9d('0x28')]){_0x2e47b2=_0x234bd7[_0x0f9d('0x28')][_0x0f9d('0x29')]!==_0x24780e['Trunk'][_0x0f9d('0x29')]||_0x234bd7[_0x0f9d('0x28')][_0x0f9d('0x2a')]!==_0x24780e['Trunk'][_0x0f9d('0x2a')];}return _0x1ef3e9||_0xf71d3a||_0x2e47b2;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x56cb91){var _0x4207ac=null;var _0x418005=_0x56cb91[_0x0f9d('0x2b')];if(_['isNil'](_0x56cb91[_0x0f9d('0x2c')])||_[_0x0f9d('0x2d')](_0x56cb91[_0x0f9d('0x2e')])||_[_0x0f9d('0x2d')](_0x56cb91['Interval'][_0x0f9d('0x2f')])){_0x4207ac=CAMPAIGN_STATUS[_0x0f9d('0x30')];}else if(_[_0x0f9d('0x31')](_0x56cb91[_0x0f9d('0x2c')])||_['isEmpty'](_0x56cb91[_0x0f9d('0x2e')][_0x0f9d('0x2f')])){_0x4207ac=CAMPAIGN_STATUS[_0x0f9d('0x32')];}else if(_0x418005&&!timezones[_0x418005]){_0x4207ac=CAMPAIGN_STATUS[_0x0f9d('0x33')];}return _0x4207ac;}function checkAnyValidTrunk(_0x2025e8,_0x2effb1){var _0x3bf96b=null;var _0x2df603='SIP/';var _0x209c9f=[_0x0f9d('0x34'),_0x0f9d('0x35')];var _0xe77ab6=!![];if(_0x2025e8['Trunk']&&_0x2025e8['Trunk'][_0x0f9d('0x2a')]){_0x2df603+=_0x2025e8['Trunk'][_0x0f9d('0x29')];_0x3bf96b=_0x2effb1[_0x2df603];_0xe77ab6=_0x209c9f[_0x0f9d('0x36')](_0x3bf96b[_0x0f9d('0x37')]);}else if(_0x2025e8[_0x0f9d('0x38')]&&_0x2025e8[_0x0f9d('0x38')]['active']){_0x2df603+=_0x2025e8['TrunkBackup'][_0x0f9d('0x29')];_0x3bf96b=_0x2effb1[_0x2df603];_0xe77ab6=_0x209c9f[_0x0f9d('0x36')](_0x3bf96b[_0x0f9d('0x37')]);}return _0xe77ab6;}function getQueueCampaignStatusMessage(_0x3b11b4,_0x1ca3b0){var _0x27b450=CAMPAIGN_STATUS[_0x0f9d('0x7')];var _0x929fad=isPreviewCampaign(_0x3b11b4);if(!isQueueCampaignActive(_0x3b11b4)){if(_0x929fad){_0x27b450=CAMPAIGN_STATUS[_0x0f9d('0x39')];}else{if(_0x3b11b4[_0x0f9d('0x27')]===0x0&&_0x3b11b4['talking']===0x0&&_0x3b11b4[_0x0f9d('0x25')]===0x0&&(_0x3b11b4[_0x0f9d('0x24')]||0x0)===0x0){_0x27b450=CAMPAIGN_STATUS[_0x0f9d('0x39')];}else{_0x27b450=CAMPAIGN_STATUS[_0x0f9d('0x3a')];}}}else if(_0x3b11b4[_0x0f9d('0x20')]===0x0){_0x27b450=CAMPAIGN_STATUS[_0x0f9d('0x3b')];}else if(!checkAnyValidTrunk(_0x3b11b4,_0x1ca3b0)){_0x27b450=CAMPAIGN_STATUS[_0x0f9d('0x3c')];}else if(!isPreviewCampaign(_0x3b11b4)){var _0x23dd30=checkAnyValidQueueCampaignInterval(_0x3b11b4);if(_0x23dd30){_0x27b450=_0x23dd30;}}return _0x27b450;}exports[_0x0f9d('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x10be36){var _0x22f106=CAMPAIGN_STATUS[_0x0f9d('0x3a')];if(_0x10be36[_0x0f9d('0x27')]===0x0&&_0x10be36[_0x0f9d('0x23')]===0x0&&_0x10be36['waiting']===0x0&&(_0x10be36[_0x0f9d('0x24')]||0x0)===0x0){_0x22f106=CAMPAIGN_STATUS[_0x0f9d('0x39')];}return _0x22f106;}exports[_0x0f9d('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5b2265){var _0x3fdaf9=_0x5b2265[_0x0f9d('0x3f')](/"(.*?)"/);return _0x3fdaf9?_0x3fdaf9[0x1]:_0x5b2265;}exports[_0x0f9d('0x40')]=extractCalleridName;function getCallerId(_0x3bdd54,_0x192b8f,_0x5a362a){if(!_[_0x0f9d('0x41')](_0x5a362a)&&typeof _0x5a362a==='string'&&!_[_0x0f9d('0x31')](_0x5a362a)){if(!_['isUndefined'](_0x192b8f)&&typeof _0x192b8f===_0x0f9d('0x42')&&!_[_0x0f9d('0x31')](_0x192b8f)){return util[_0x0f9d('0x43')](_0x0f9d('0x44'),_0x192b8f,_0x5a362a);}return util[_0x0f9d('0x43')](_0x0f9d('0x44'),_0x5a362a,_0x5a362a);}if(!_['isUndefined'](_0x3bdd54)&&typeof _0x3bdd54===_0x0f9d('0x42')&&!_[_0x0f9d('0x31')](_0x3bdd54)){return _0x3bdd54;}return _0x0f9d('0x45');}exports[_0x0f9d('0x46')]=getCallerId;function getCallerIdRandom(_0x496853,_0x121930){var _0x582f07;var _0x5e7375;var _0x31e8c0;if(_0x121930<=0x0){_0x121930=0x1;}_0x582f07=new RegExp(_0x0f9d('0x47')+_0x121930+'}$');_0x5e7375=Math[_0x0f9d('0x48')](0xa,_0x121930-0x1);_0x31e8c0=Math[_0x0f9d('0x48')](0xa,_0x121930)-0x1;return util['format']('%s',_[_0x0f9d('0x49')](_0x496853,_0x582f07,_[_0x0f9d('0x4a')](_0x5e7375,_0x31e8c0)[_0x0f9d('0x4b')]()));}exports[_0x0f9d('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x50eb5f){if(_0x50eb5f[_0x0f9d('0x27')]&&_0x50eb5f[_0x0f9d('0x27')]>0x0){_0x50eb5f[_0x0f9d('0x27')]-=0x1;}else{logger[_0x0f9d('0x4d')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x0f9d('0x4e')]=decrementOriginate;function checkContactEmpty(_0x87932e){return _0x87932e&&_0x87932e[_0x0f9d('0x4f')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x59f309,_0x5f53d9){if(_0x5f53d9===0x0){return 0x0;}var _0xfa9894=0x1;for(var _0x4ba6f4=0x1;_0x4ba6f4<=_0x5f53d9;_0x4ba6f4+=0x1){_0xfa9894=0x1+_0xfa9894*_0x4ba6f4/_0x59f309;}return 0x1/_0xfa9894;}exports[_0x0f9d('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x1b9f33,_0x384a07,_0x41b3a4){if(_0x384a07>_0x41b3a4){for(var _0xeafdb2=0x0;_0xeafdb2<_0x384a07-_0x41b3a4;_0xeafdb2+=0x1){decrementOriginate(_0x1b9f33);}}}exports[_0x0f9d('0x51')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index de31d24..48c21e7 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x5002b5,_0x15dd3e){var _0x35892d=function(_0x5f03ae){while(--_0x5f03ae){_0x5002b5['push'](_0x5002b5['shift']());}};_0x35892d(++_0x15dd3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x4f88eb,_0xcc3455){var _0x39063a=function(_0x5253a4){while(--_0x5253a4){_0x4f88eb['push'](_0x4f88eb['shift']());}};_0x39063a(++_0xcc3455);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index d87eefc..261063e 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 _0xc7ea=['util','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','prototype','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isNil','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports'];(function(_0x7a502,_0x3c3e75){var _0x39bbbc=function(_0x2eb9a7){while(--_0x2eb9a7){_0x7a502['push'](_0x7a502['shift']());}};_0x39bbbc(++_0x3c3e75);}(_0xc7ea,0xe8));var _0xac7e=function(_0x32a370,_0x4dab40){_0x32a370=_0x32a370-0x0;var _0x358b58=_0xc7ea[_0x32a370];return _0x358b58;};'use strict';var util=require(_0xac7e('0x0'));var _=require('lodash');var BPromise=require(_0xac7e('0x1'));var uuid=require(_0xac7e('0x2'));var moment=require(_0xac7e('0x3'));var path=require(_0xac7e('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xac7e('0x5'));var logger=require(_0xac7e('0x6'))(_0xac7e('0x7'));var ami=require(_0xac7e('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xac7e('0x9'));var faxAccount=require(_0xac7e('0xa'));var attachment=require(_0xac7e('0xb'));var faxMessage=require(_0xac7e('0xc'));function Fax(_0x1f8280){this[_0xac7e('0xd')]={};this[_0xac7e('0xe')]=_0x1f8280[_0xac7e('0xe')];this[_0xac7e('0xf')]=_0x1f8280['trunks'];this['actions']={};ami['on'](_0xac7e('0x10'),this[_0xac7e('0x11')][_0xac7e('0x12')](this));ami['on'](_0xac7e('0x13'),this[_0xac7e('0x14')]['bind'](this));ami['on'](_0xac7e('0x15'),this[_0xac7e('0x16')][_0xac7e('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0xac7e('0x12')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0xac7e('0x17'),this[_0xac7e('0x18')][_0xac7e('0x12')](this));ami['on'](_0xac7e('0x19'),this[_0xac7e('0x1a')]['bind'](this));ami['on']('originateresponse',this[_0xac7e('0x1b')][_0xac7e('0x12')](this));}Fax['prototype'][_0xac7e('0x11')]=function(_0x2e31bb){if(_0x2e31bb[_0xac7e('0x1c')]==='from-voip-provider'){for(var _0x3d7ced in this['faxAccounts']){if(this['faxAccounts'][_0xac7e('0x1d')](_0x3d7ced)){if(_0x2e31bb[_0xac7e('0x1e')]===this[_0xac7e('0xe')][_0x3d7ced][_0xac7e('0x1f')]){this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]]={};this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]][_0xac7e('0x21')]=_0x2e31bb[_0xac7e('0x21')];this[_0xac7e('0xd')][_0x2e31bb['uniqueid']]['id']=this['faxAccounts'][_0x3d7ced]['id'];this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]][_0xac7e('0x22')]=this[_0xac7e('0xe')][_0x3d7ced][_0xac7e('0x22')];logger[_0xac7e('0x23')](_0x2e31bb[_0xac7e('0x20')],_0xac7e('0x24'));}}}}if(this[_0xac7e('0x25')][_0x2e31bb[_0xac7e('0x20')]]){this['channels'][_0x2e31bb[_0xac7e('0x20')]]={};this[_0xac7e('0xd')][_0x2e31bb[_0xac7e('0x20')]][_0xac7e('0x21')]=_0x2e31bb['channel'];logger[_0xac7e('0x23')](_0x2e31bb['uniqueid'],_0xac7e('0x24'));}};Fax['prototype'][_0xac7e('0x14')]=function(_0xc55627){if(this[_0xac7e('0xd')][_0xc55627['uniqueid']]){for(var _0x14ea70 in _0xc55627[_0xac7e('0x26')]){if(_0xc55627[_0xac7e('0x26')]['hasOwnProperty'](_0x14ea70)){this[_0xac7e('0xd')][_0xc55627[_0xac7e('0x20')]][_0x14ea70]=_0xc55627[_0xac7e('0x27')];}}}};Fax[_0xac7e('0x28')][_0xac7e('0x16')]=function(_0x2c0414){if(this['channels'][_0x2c0414[_0xac7e('0x20')]]){this[_0xac7e('0xd')][_0x2c0414[_0xac7e('0x20')]][_0xac7e('0x29')]=_0x2c0414['channelstate'];this[_0xac7e('0xd')][_0x2c0414['uniqueid']][_0xac7e('0x2a')]=_0x2c0414[_0xac7e('0x2a')];}};Fax[_0xac7e('0x28')][_0xac7e('0x2b')]=function(_0xaa2ac4){if(this[_0xac7e('0xd')][_0xaa2ac4[_0xac7e('0x20')]]){for(var _0x2c2815 in _0xaa2ac4[_0xac7e('0x26')]){if(_0xaa2ac4['variable'][_0xac7e('0x1d')](_0x2c2815)){this['channels'][_0xaa2ac4[_0xac7e('0x20')]][_0x2c2815]=_0xaa2ac4[_0xac7e('0x27')];}}}};Fax['prototype'][_0xac7e('0x2c')]=function(_0x6911c){if(this[_0xac7e('0xd')][_0x6911c[_0xac7e('0x20')]]){this[_0xac7e('0xd')][_0x6911c['uniqueid']]['operation']=_0x6911c[_0xac7e('0x2d')];this[_0xac7e('0xd')][_0x6911c[_0xac7e('0x20')]]['status']=_0x6911c[_0xac7e('0x2e')];this[_0xac7e('0xd')][_0x6911c[_0xac7e('0x20')]][_0xac7e('0x1f')]=_0x6911c[_0xac7e('0x1f')];this['channels'][_0x6911c[_0xac7e('0x20')]][_0xac7e('0x2f')]=_0x6911c[_0xac7e('0x2f')];logger[_0xac7e('0x23')](_0x6911c['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xac7e('0x28')][_0xac7e('0x18')]=function(_0x4ca995){var _0x1be327=this;if(this['channels'][_0x4ca995[_0xac7e('0x20')]]){var _0x1fdfed=this['channels'][_0x4ca995['uniqueid']]['id'];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x30')]=_0x4ca995['remotestationid'];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x31')]=_0x4ca995['pagestransferred'];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x1f')]=_0x4ca995[_0xac7e('0x1f')];this[_0xac7e('0xd')][_0x4ca995[_0xac7e('0x20')]][_0xac7e('0x32')]=_0x4ca995[_0xac7e('0x32')];this['channels'][_0x4ca995[_0xac7e('0x20')]][_0xac7e('0x33')]=_0x4ca995[_0xac7e('0x33')];this[_0xac7e('0xd')][_0x4ca995[_0xac7e('0x20')]][_0xac7e('0x2f')]=_0x4ca995[_0xac7e('0x2f')];this[_0xac7e('0xd')][_0x4ca995['uniqueid']][_0xac7e('0x34')]=_0x4ca995[_0xac7e('0x34')];if(this[_0xac7e('0xd')][_0x4ca995[_0xac7e('0x20')]]['pagestransferred']>0x0){tiff2pdf(_0x4ca995['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x7685bf){logger[_0xac7e('0x23')](_0x4ca995[_0xac7e('0x20')],_0xac7e('0x35'),_0x7685bf[_0xac7e('0x36')]);attachment[_0xac7e('0x37')]({'name':path['parse'](_0x4ca995[_0xac7e('0x2f')])[_0xac7e('0x22')],'basename':path[_0xac7e('0x38')](_0x4ca995[_0xac7e('0x2f')])[_0xac7e('0x22')]+_0xac7e('0x39'),'type':_0xac7e('0x3a')})[_0xac7e('0x3b')](function(_0x5736b4){faxAccount[_0xac7e('0x3c')](_0x1fdfed,{'from':_0x4ca995['calleridnum'],'mapKey':_0xac7e('0x7'),'body':path[_0xac7e('0x38')](_0x4ca995['filename'])[_0xac7e('0x22')]+_0xac7e('0x39'),'AttachmentId':_0x5736b4['id']})[_0xac7e('0x3d')](function(_0x4574bf){logger['error'](_0x4ca995[_0xac7e('0x20')],_0xac7e('0x3e'),JSON[_0xac7e('0x3f')](_0x4574bf));});})['catch'](function(_0x18094c){logger[_0xac7e('0x40')](_0x4ca995[_0xac7e('0x20')],'\x20receiveFax\x20',JSON[_0xac7e('0x3f')](_0x18094c));});});}logger[_0xac7e('0x23')](_0x4ca995[_0xac7e('0x20')],_0xac7e('0x41'));}};Fax[_0xac7e('0x28')][_0xac7e('0x1b')]=function(_0x52e2fc){if(this[_0xac7e('0x25')][_0x52e2fc[_0xac7e('0x20')]]){_[_0xac7e('0x42')](this['channels'][_0x52e2fc[_0xac7e('0x20')]],_[_0xac7e('0x43')](_0x52e2fc,[_0xac7e('0x44'),_0xac7e('0x45')]));}};function updateStatus(_0x53bea6){if(_0x53bea6[_0xac7e('0x46')]){faxMessage['update'](_0x53bea6[_0xac7e('0x46')],{'failMessage':_0xac7e('0x47')})[_0xac7e('0x3b')](function(_0x18faee){ut[_0xac7e('0x48')]('[Fax][Message][Error][Updated]',_0x18faee);})['catch'](function(_0x28a88f){ut['logger'](_0xac7e('0x49'),_0x28a88f);});}else{ut[_0xac7e('0x48')](_0xac7e('0x4a'));}}Fax['prototype'][_0xac7e('0x4b')]=function(_0x5e9265,_0x50d933,_0x3eac3f){var _0x282008=this;var _0x689779={};if(_0x50d933){_0x689779={'read':_0x50d933};}else{_0x689779={'failMessage':_0x3eac3f};}if(this['actions'][_0x5e9265][_0xac7e('0x46')]){faxMessage['update'](this[_0xac7e('0x25')][_0x5e9265][_0xac7e('0x46')],_0x689779)['then'](function(_0x50983b){ut[_0xac7e('0x48')]('[Fax][Message][Updated]',_0x50983b);})['catch'](function(_0x34ea25){ut[_0xac7e('0x48')](_0xac7e('0x4c'),_0x34ea25);})[_0xac7e('0x4d')](function(){delete _0x282008[_0xac7e('0xd')][_0x5e9265];delete _0x282008[_0xac7e('0x25')][_0x5e9265];});}else{ut['logger'](_0xac7e('0x4e'));delete this[_0xac7e('0xd')][_0x5e9265];delete this[_0xac7e('0x25')][_0x5e9265];}};Fax[_0xac7e('0x28')][_0xac7e('0x1a')]=function(_0x7f079f){var _0x10581d=this;if(this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]]){if(this[_0xac7e('0x25')][_0x7f079f[_0xac7e('0x20')]]){this[_0xac7e('0xd')][_0x7f079f['uniqueid']]['id']=this[_0xac7e('0x25')][_0x7f079f[_0xac7e('0x20')]]['id'];this['channels'][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x22')]=this[_0xac7e('0x25')][_0x7f079f['uniqueid']]['name'];}logger[_0xac7e('0x23')](_0x7f079f['uniqueid'],this[_0xac7e('0x25')][_0x7f079f[_0xac7e('0x20')]]?_0xac7e('0x4f'):_0xac7e('0x50'),JSON[_0xac7e('0x3f')](this['channels'][_0x7f079f['uniqueid']]));if(this['actions'][_0x7f079f[_0xac7e('0x20')]]){if(this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]]['faxpages']>0x0&&this['channels'][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x51')]===_0xac7e('0x52')){this[_0xac7e('0x4b')](_0x7f079f[_0xac7e('0x20')],!![]);}else{this[_0xac7e('0x4b')](_0x7f079f[_0xac7e('0x20')],![],this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x53')]?_0xac7e('0x54')+this[_0xac7e('0xd')][_0x7f079f[_0xac7e('0x20')]][_0xac7e('0x53')]:_0xac7e('0x55'));}}}};Fax[_0xac7e('0x28')][_0xac7e('0x56')]=function(_0x557c8d){var _0xeeb2b7=this;return new BPromise(function(_0xddb5a0,_0x305546){_0xeeb2b7[_0xac7e('0x57')](_0x557c8d,_0xeeb2b7['faxAccounts'][_0x557c8d[_0xac7e('0x58')]])[_0xac7e('0x3b')](function(_0x3e8fd2){ut[_0xac7e('0x48')](_0xac7e('0x59'),_0x3e8fd2);_0xddb5a0(ut[_0xac7e('0x36')]('Fax\x20received'));})[_0xac7e('0x3d')](function(_0x394292){ut[_0xac7e('0x48')](_0xac7e('0x5a'),_0x394292);updateStatus(_0x557c8d);_0x305546(ut['message'](_0xac7e('0x5b')));});});};Fax['prototype'][_0xac7e('0x5c')]=function(_0x415a97){var _0x532109=this;return new BPromise(function(_0x35bad2,_0x3df4d8){var _0x4776e8=_0x532109[_0xac7e('0x5d')](_0x532109[_0xac7e('0xe')][_0x415a97[_0xac7e('0x58')]][_0xac7e('0x5e')],_0x415a97);if(_0x4776e8[_0xac7e('0x5f')]){_0x35bad2(ut['message']('Trunk\x20Reachable'));}else{_0x3df4d8(ut[_0xac7e('0x36')](_0x4776e8[_0xac7e('0x36')]));}});};function originate(_0x55487d,_0x5a8514,_0x3b11a7){return new BPromise(function(_0x180ad1,_0x1c39fb){if(_0x3b11a7){var _0x27f8cc=util['format'](_0xac7e('0x60'),path['parse'](_0x55487d[_0xac7e('0x4')])[_0xac7e('0x22')],_0x55487d[_0xac7e('0x4')]);gs[_0xac7e('0x61')](_0x27f8cc)['then'](function(){_0x55487d[_0xac7e('0x4')]=util[_0xac7e('0x62')]('%s/%s.tif',path[_0xac7e('0x38')](_0x55487d[_0xac7e('0x4')])[_0xac7e('0x63')],path['parse'](_0x55487d[_0xac7e('0x4')])['name']);_0x5a8514[_0xac7e('0x64')]=_0x55487d['path'];ut[_0xac7e('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0xac7e('0x65')](ut[_0xac7e('0x66')](_0x55487d,_0x5a8514))[_0xac7e('0x3b')](function(_0x1c8b1a){_0x180ad1(_0x1c8b1a);})[_0xac7e('0x3d')](function(_0x5a4c9c){_0x1c39fb(_0x5a4c9c);});})[_0xac7e('0x3d')](function(_0x441a1e){_0x1c39fb(_0x441a1e);});}else{ami[_0xac7e('0x65')](ut[_0xac7e('0x66')](_0x55487d,_0x5a8514))[_0xac7e('0x3b')](function(_0x4bd032){_0x180ad1(_0x4bd032);})[_0xac7e('0x3d')](function(_0x3c8ba){_0x1c39fb(_0x3c8ba);});}});}Fax['prototype']['execOriginate']=function(_0x273f39,_0x3eec87){var _0x39c9c4=this;return new BPromise(function(_0x4558da,_0x5a0993){var _0x45ecc3=uuid['v4']();var _0xbf8bc5=ut[_0xac7e('0x67')](_0x273f39,_0x3eec87);_0x39c9c4[_0xac7e('0x25')][_0x45ecc3]=new Action(_0x45ecc3,_0x3eec87,_0x273f39);var _0x3ff8c8=_0x39c9c4['actions'][_0x45ecc3];if(path[_0xac7e('0x38')](_0x273f39[_0xac7e('0x4')])[_0xac7e('0x68')]===_0xac7e('0x39')){originate(_0x3ff8c8,_0xbf8bc5,!![])[_0xac7e('0x3b')](function(_0x5a10cb){_0x4558da(_0x5a10cb);})[_0xac7e('0x3d')](function(_0x593c3f){_0x5a0993(_0x593c3f);});}else{originate(_0x3ff8c8,_0xbf8bc5,![])[_0xac7e('0x3b')](function(_0x1f68c3){_0x4558da(_0x1f68c3);})[_0xac7e('0x3d')](function(_0x499378){_0x5a0993(_0x499378);});}});};Fax[_0xac7e('0x28')]['isTrunkReachable']=function(_0x4aec94){return!_[_0xac7e('0x69')](_0x4aec94)&&!_[_0xac7e('0x69')](_0x4aec94[_0xac7e('0x22')])&&!_['isNil'](_0x4aec94['active'])&&_0x4aec94['active']&&!_[_0xac7e('0x69')](this[_0xac7e('0xf')][util[_0xac7e('0x62')]('SIP/%s',_0x4aec94['name'])])&&!_[_0xac7e('0x69')](this[_0xac7e('0xf')][util[_0xac7e('0x62')](_0xac7e('0x6a'),_0x4aec94[_0xac7e('0x22')])]['status'])&&(this[_0xac7e('0xf')][util[_0xac7e('0x62')](_0xac7e('0x6a'),_0x4aec94[_0xac7e('0x22')])][_0xac7e('0x2e')]===_0xac7e('0x6b')||this[_0xac7e('0xf')][util['format']('SIP/%s',_0x4aec94['name'])][_0xac7e('0x2e')]===_0xac7e('0x6c'));};Fax[_0xac7e('0x28')]['checkTrunk']=function(_0x1d6e76,_0x1fce61){if(!this[_0xac7e('0x6d')](_0x1d6e76)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xac7e('0x69')](_0x1d6e76)?'':_0x1d6e76['name']+_0xac7e('0x6e'));return{'isValid':![],'message':_0xac7e('0x6f')};}if(_['isNil'](_0x1fce61[_0xac7e('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xac7e('0x3f')](_0x1fce61));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x1fce61[_0xac7e('0x4')])){ut['logger'](_0xac7e('0x70'),JSON[_0xac7e('0x3f')](_0x1fce61));return{'isValid':![],'message':_0xac7e('0x71')};}return{'isValid':!![],'message':_0xac7e('0x72')};};module[_0xac7e('0x73')]=Fax; \ No newline at end of file +var _0x73d3=['path','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','.pdf','then','notify','error','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x73d3,0x15d));var _0x373d=function(_0x203da7,_0x9b8e03){_0x203da7=_0x203da7-0x0;var _0x304e25=_0x73d3[_0x203da7];return _0x304e25;};'use strict';var util=require(_0x373d('0x0'));var _=require(_0x373d('0x1'));var BPromise=require(_0x373d('0x2'));var uuid=require(_0x373d('0x3'));var moment=require(_0x373d('0x4'));var path=require(_0x373d('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x373d('0x6'));var logger=require('../../../config/logger')(_0x373d('0x7'));var ami=require(_0x373d('0x8'));var rpcDb=require(_0x373d('0x9'));var Channel=require(_0x373d('0xa'));var ut=require(_0x373d('0xb'));var Action=require(_0x373d('0xc'));var faxAccount=require(_0x373d('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x5ea5d2){this[_0x373d('0xe')]={};this[_0x373d('0xf')]=_0x5ea5d2[_0x373d('0xf')];this[_0x373d('0x10')]=_0x5ea5d2[_0x373d('0x10')];this['actions']={};ami['on'](_0x373d('0x11'),this[_0x373d('0x12')][_0x373d('0x13')](this));ami['on'](_0x373d('0x14'),this[_0x373d('0x15')][_0x373d('0x13')](this));ami['on']('newstate',this['syncNewState'][_0x373d('0x13')](this));ami['on'](_0x373d('0x16'),this[_0x373d('0x17')][_0x373d('0x13')](this));ami['on'](_0x373d('0x18'),this[_0x373d('0x19')][_0x373d('0x13')](this));ami['on'](_0x373d('0x1a'),this[_0x373d('0x1b')]['bind'](this));ami['on'](_0x373d('0x1c'),this['syncHangup'][_0x373d('0x13')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x373d('0x13')](this));}Fax[_0x373d('0x1d')][_0x373d('0x12')]=function(_0x1fa87d){if(_0x1fa87d[_0x373d('0x1e')]===_0x373d('0x1f')){for(var _0x111281 in this['faxAccounts']){if(this[_0x373d('0xf')][_0x373d('0x20')](_0x111281)){if(_0x1fa87d[_0x373d('0x21')]===this[_0x373d('0xf')][_0x111281][_0x373d('0x22')]){this['channels'][_0x1fa87d[_0x373d('0x23')]]={};this['channels'][_0x1fa87d[_0x373d('0x23')]][_0x373d('0x24')]=_0x1fa87d[_0x373d('0x24')];this['channels'][_0x1fa87d[_0x373d('0x23')]]['id']=this[_0x373d('0xf')][_0x111281]['id'];this['channels'][_0x1fa87d['uniqueid']][_0x373d('0x25')]=this[_0x373d('0xf')][_0x111281][_0x373d('0x25')];logger[_0x373d('0x26')](_0x1fa87d['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x373d('0x27')][_0x1fa87d['uniqueid']]){this[_0x373d('0xe')][_0x1fa87d[_0x373d('0x23')]]={};this[_0x373d('0xe')][_0x1fa87d['uniqueid']][_0x373d('0x24')]=_0x1fa87d['channel'];logger[_0x373d('0x26')](_0x1fa87d['uniqueid'],_0x373d('0x28'));}};Fax[_0x373d('0x1d')][_0x373d('0x15')]=function(_0x5d6847){if(this['channels'][_0x5d6847['uniqueid']]){for(var _0x5c3f26 in _0x5d6847[_0x373d('0x29')]){if(_0x5d6847[_0x373d('0x29')]['hasOwnProperty'](_0x5c3f26)){this[_0x373d('0xe')][_0x5d6847[_0x373d('0x23')]][_0x5c3f26]=_0x5d6847[_0x373d('0x2a')];}}}};Fax['prototype'][_0x373d('0x2b')]=function(_0x496e58){if(this['channels'][_0x496e58[_0x373d('0x23')]]){this[_0x373d('0xe')][_0x496e58[_0x373d('0x23')]][_0x373d('0x2c')]=_0x496e58['channelstate'];this[_0x373d('0xe')][_0x496e58[_0x373d('0x23')]][_0x373d('0x2d')]=_0x496e58[_0x373d('0x2d')];}};Fax[_0x373d('0x1d')]['syncNewExten']=function(_0x12d968){if(this[_0x373d('0xe')][_0x12d968[_0x373d('0x23')]]){for(var _0x47e869 in _0x12d968[_0x373d('0x29')]){if(_0x12d968[_0x373d('0x29')][_0x373d('0x20')](_0x47e869)){this[_0x373d('0xe')][_0x12d968[_0x373d('0x23')]][_0x47e869]=_0x12d968[_0x373d('0x2a')];}}}};Fax[_0x373d('0x1d')][_0x373d('0x19')]=function(_0x233dc7){if(this[_0x373d('0xe')][_0x233dc7['uniqueid']]){this[_0x373d('0xe')][_0x233dc7[_0x373d('0x23')]][_0x373d('0x2e')]=_0x233dc7[_0x373d('0x2e')];this[_0x373d('0xe')][_0x233dc7[_0x373d('0x23')]][_0x373d('0x2f')]=_0x233dc7[_0x373d('0x2f')];this[_0x373d('0xe')][_0x233dc7[_0x373d('0x23')]][_0x373d('0x22')]=_0x233dc7[_0x373d('0x22')];this[_0x373d('0xe')][_0x233dc7['uniqueid']][_0x373d('0x30')]=_0x233dc7[_0x373d('0x30')];logger[_0x373d('0x26')](_0x233dc7[_0x373d('0x23')],_0x373d('0x31'));}};Fax[_0x373d('0x1d')][_0x373d('0x1b')]=function(_0x29fe05){var _0x1d31ba=this;if(this[_0x373d('0xe')][_0x29fe05[_0x373d('0x23')]]){var _0x3722e9=this['channels'][_0x29fe05[_0x373d('0x23')]]['id'];this[_0x373d('0xe')][_0x29fe05[_0x373d('0x23')]][_0x373d('0x32')]=_0x29fe05['remotestationid'];this[_0x373d('0xe')][_0x29fe05['uniqueid']][_0x373d('0x33')]=_0x29fe05[_0x373d('0x33')];this[_0x373d('0xe')][_0x29fe05[_0x373d('0x23')]][_0x373d('0x22')]=_0x29fe05[_0x373d('0x22')];this[_0x373d('0xe')][_0x29fe05['uniqueid']][_0x373d('0x34')]=_0x29fe05[_0x373d('0x34')];this[_0x373d('0xe')][_0x29fe05[_0x373d('0x23')]]['transferrate']=_0x29fe05[_0x373d('0x35')];this[_0x373d('0xe')][_0x29fe05[_0x373d('0x23')]][_0x373d('0x30')]=_0x29fe05[_0x373d('0x30')];this[_0x373d('0xe')][_0x29fe05[_0x373d('0x23')]][_0x373d('0x36')]=_0x29fe05[_0x373d('0x36')];if(this['channels'][_0x29fe05[_0x373d('0x23')]][_0x373d('0x33')]>0x0){tiff2pdf(_0x29fe05['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x4fba2c){logger['info'](_0x29fe05['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x4fba2c[_0x373d('0x37')]);attachment[_0x373d('0x38')]({'name':path[_0x373d('0x39')](_0x29fe05[_0x373d('0x30')])['name'],'basename':path[_0x373d('0x39')](_0x29fe05[_0x373d('0x30')])[_0x373d('0x25')]+_0x373d('0x3a'),'type':'application/pdf'})[_0x373d('0x3b')](function(_0x292ee4){faxAccount[_0x373d('0x3c')](_0x3722e9,{'from':_0x29fe05[_0x373d('0x36')],'mapKey':_0x373d('0x7'),'body':path[_0x373d('0x39')](_0x29fe05['filename'])[_0x373d('0x25')]+'.pdf','AttachmentId':_0x292ee4['id']})['catch'](function(_0x53e156){logger[_0x373d('0x3d')](_0x29fe05[_0x373d('0x23')],'\x20notify\x20',JSON[_0x373d('0x3e')](_0x53e156));});})[_0x373d('0x3f')](function(_0x4066f7){logger[_0x373d('0x3d')](_0x29fe05['uniqueid'],'\x20receiveFax\x20',JSON[_0x373d('0x3e')](_0x4066f7));});});}logger[_0x373d('0x26')](_0x29fe05[_0x373d('0x23')],_0x373d('0x40'));}};Fax['prototype']['syncOriginateResponse']=function(_0x2ec1f1){if(this['actions'][_0x2ec1f1['uniqueid']]){_[_0x373d('0x41')](this[_0x373d('0xe')][_0x2ec1f1['uniqueid']],_[_0x373d('0x42')](_0x2ec1f1,[_0x373d('0x43'),_0x373d('0x44')]));}};function updateStatus(_0x48d095){if(_0x48d095[_0x373d('0x45')]){faxMessage['update'](_0x48d095['AttachmentId'],{'failMessage':_0x373d('0x46')})[_0x373d('0x3b')](function(_0x3bb570){ut[_0x373d('0x47')](_0x373d('0x48'),_0x3bb570);})[_0x373d('0x3f')](function(_0x26649e){ut[_0x373d('0x47')](_0x373d('0x49'),_0x26649e);});}else{ut[_0x373d('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x373d('0x1d')][_0x373d('0x4a')]=function(_0x275702,_0x11d462,_0x37fca3){var _0x3c94a4=this;var _0x47a19e={};if(_0x11d462){_0x47a19e={'read':_0x11d462};}else{_0x47a19e={'failMessage':_0x37fca3};}if(this[_0x373d('0x27')][_0x275702][_0x373d('0x45')]){faxMessage[_0x373d('0x4b')](this[_0x373d('0x27')][_0x275702][_0x373d('0x45')],_0x47a19e)[_0x373d('0x3b')](function(_0x3762f7){ut[_0x373d('0x47')](_0x373d('0x4c'),_0x3762f7);})[_0x373d('0x3f')](function(_0x4ba245){ut['logger'](_0x373d('0x4d'),_0x4ba245);})[_0x373d('0x4e')](function(){delete _0x3c94a4[_0x373d('0xe')][_0x275702];delete _0x3c94a4[_0x373d('0x27')][_0x275702];});}else{ut[_0x373d('0x47')](_0x373d('0x4f'));delete this[_0x373d('0xe')][_0x275702];delete this[_0x373d('0x27')][_0x275702];}};Fax['prototype'][_0x373d('0x50')]=function(_0x2ee9fd){var _0x1a1074=this;if(this[_0x373d('0xe')][_0x2ee9fd[_0x373d('0x23')]]){if(this[_0x373d('0x27')][_0x2ee9fd['uniqueid']]){this['channels'][_0x2ee9fd[_0x373d('0x23')]]['id']=this[_0x373d('0x27')][_0x2ee9fd[_0x373d('0x23')]]['id'];this[_0x373d('0xe')][_0x2ee9fd[_0x373d('0x23')]]['name']=this['actions'][_0x2ee9fd[_0x373d('0x23')]][_0x373d('0x25')];}logger[_0x373d('0x26')](_0x2ee9fd[_0x373d('0x23')],this[_0x373d('0x27')][_0x2ee9fd[_0x373d('0x23')]]?_0x373d('0x51'):_0x373d('0x52'),JSON['stringify'](this[_0x373d('0xe')][_0x2ee9fd['uniqueid']]));if(this[_0x373d('0x27')][_0x2ee9fd[_0x373d('0x23')]]){if(this[_0x373d('0xe')][_0x2ee9fd['uniqueid']]['faxpages']>0x0&&this[_0x373d('0xe')][_0x2ee9fd[_0x373d('0x23')]][_0x373d('0x18')]===_0x373d('0x53')){this['updateStatus'](_0x2ee9fd[_0x373d('0x23')],!![]);}else{this[_0x373d('0x4a')](_0x2ee9fd[_0x373d('0x23')],![],this['channels'][_0x2ee9fd[_0x373d('0x23')]][_0x373d('0x54')]?_0x373d('0x55')+this[_0x373d('0xe')][_0x2ee9fd[_0x373d('0x23')]][_0x373d('0x54')]:_0x373d('0x56'));}}}};Fax[_0x373d('0x1d')][_0x373d('0x57')]=function(_0x31ddff){var _0x3600d4=this;return new BPromise(function(_0x2c9697,_0x1bc8fb){_0x3600d4[_0x373d('0x58')](_0x31ddff,_0x3600d4[_0x373d('0xf')][_0x31ddff[_0x373d('0x59')]])['then'](function(_0x34248f){ut[_0x373d('0x47')](_0x373d('0x5a'),_0x34248f);_0x2c9697(ut[_0x373d('0x37')](_0x373d('0x5b')));})[_0x373d('0x3f')](function(_0x1336e8){ut['logger']('[Fax][execOriginate][failure]',_0x1336e8);updateStatus(_0x31ddff);_0x1bc8fb(ut[_0x373d('0x37')]('Fax\x20failed'));});});};Fax[_0x373d('0x1d')]['checkAfterSend']=function(_0x39fb91){var _0x5a5d7b=this;return new BPromise(function(_0x306768,_0x4e8fba){var _0x24e7c8=_0x5a5d7b['checkTrunk'](_0x5a5d7b[_0x373d('0xf')][_0x39fb91['FaxAccountId']][_0x373d('0x5c')],_0x39fb91);if(_0x24e7c8['isValid']){_0x306768(ut[_0x373d('0x37')](_0x373d('0x5d')));}else{_0x4e8fba(ut[_0x373d('0x37')](_0x24e7c8[_0x373d('0x37')]));}});};function originate(_0x280fa8,_0x8cd345,_0x1af2c5){return new BPromise(function(_0x4e8298,_0x516a4d){if(_0x1af2c5){var _0x3590a6=util[_0x373d('0x5e')](_0x373d('0x5f'),path[_0x373d('0x39')](_0x280fa8[_0x373d('0x5')])[_0x373d('0x25')],_0x280fa8['path']);gs['execute'](_0x3590a6)['then'](function(){_0x280fa8[_0x373d('0x5')]=util[_0x373d('0x5e')]('%s/%s.tif',path[_0x373d('0x39')](_0x280fa8[_0x373d('0x5')])[_0x373d('0x60')],path['parse'](_0x280fa8[_0x373d('0x5')])['name']);_0x8cd345[_0x373d('0x61')]=_0x280fa8[_0x373d('0x5')];ut['logger'](_0x373d('0x62'),'');ami[_0x373d('0x63')](ut[_0x373d('0x64')](_0x280fa8,_0x8cd345))['then'](function(_0x5d2181){_0x4e8298(_0x5d2181);})[_0x373d('0x3f')](function(_0x15d2f5){_0x516a4d(_0x15d2f5);});})[_0x373d('0x3f')](function(_0x4ab688){_0x516a4d(_0x4ab688);});}else{ami[_0x373d('0x63')](ut[_0x373d('0x64')](_0x280fa8,_0x8cd345))[_0x373d('0x3b')](function(_0x309dcb){_0x4e8298(_0x309dcb);})[_0x373d('0x3f')](function(_0x14be10){_0x516a4d(_0x14be10);});}});}Fax['prototype'][_0x373d('0x58')]=function(_0x4b1e98,_0x4f7367){var _0xdc5546=this;return new BPromise(function(_0x200694,_0x49646a){var _0x3bde08=uuid['v4']();var _0x3f43c3=ut[_0x373d('0x65')](_0x4b1e98,_0x4f7367);_0xdc5546[_0x373d('0x27')][_0x3bde08]=new Action(_0x3bde08,_0x4f7367,_0x4b1e98);var _0x5ae83b=_0xdc5546[_0x373d('0x27')][_0x3bde08];if(path['parse'](_0x4b1e98[_0x373d('0x5')])[_0x373d('0x66')]==='.pdf'){originate(_0x5ae83b,_0x3f43c3,!![])[_0x373d('0x3b')](function(_0x39d9a6){_0x200694(_0x39d9a6);})['catch'](function(_0x55b58b){_0x49646a(_0x55b58b);});}else{originate(_0x5ae83b,_0x3f43c3,![])[_0x373d('0x3b')](function(_0x40f4a1){_0x200694(_0x40f4a1);})[_0x373d('0x3f')](function(_0x5a80db){_0x49646a(_0x5a80db);});}});};Fax[_0x373d('0x1d')][_0x373d('0x67')]=function(_0x5af467){return!_['isNil'](_0x5af467)&&!_[_0x373d('0x68')](_0x5af467['name'])&&!_[_0x373d('0x68')](_0x5af467['active'])&&_0x5af467[_0x373d('0x69')]&&!_['isNil'](this[_0x373d('0x10')][util[_0x373d('0x5e')](_0x373d('0x6a'),_0x5af467[_0x373d('0x25')])])&&!_['isNil'](this[_0x373d('0x10')][util['format'](_0x373d('0x6a'),_0x5af467[_0x373d('0x25')])][_0x373d('0x2f')])&&(this[_0x373d('0x10')][util[_0x373d('0x5e')](_0x373d('0x6a'),_0x5af467[_0x373d('0x25')])][_0x373d('0x2f')]===_0x373d('0x6b')||this[_0x373d('0x10')][util['format'](_0x373d('0x6a'),_0x5af467[_0x373d('0x25')])]['status']===_0x373d('0x6c'));};Fax[_0x373d('0x1d')][_0x373d('0x6d')]=function(_0x216fd4,_0x4689d5){if(!this[_0x373d('0x67')](_0x216fd4)){ut['logger'](_0x373d('0x6e'),_['isNil'](_0x216fd4)?'':_0x216fd4[_0x373d('0x25')]+_0x373d('0x6f'));return{'isValid':![],'message':_0x373d('0x70')};}if(_[_0x373d('0x68')](_0x4689d5[_0x373d('0x7')])){ut[_0x373d('0x47')](_0x373d('0x71'),JSON[_0x373d('0x3e')](_0x4689d5));return{'isValid':![],'message':_0x373d('0x72')};}if(_[_0x373d('0x68')](_0x4689d5[_0x373d('0x5')])){ut[_0x373d('0x47')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x4689d5));return{'isValid':![],'message':_0x373d('0x73')};}return{'isValid':!![],'message':_0x373d('0x74')};};module[_0x373d('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e8670cd..cfbf242 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 _0x0f90=['../../../config/logger','lodash','inspect','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x198ed8,_0x1c0ba3){var _0x3f031c=function(_0x43dd9a){while(--_0x43dd9a){_0x198ed8['push'](_0x198ed8['shift']());}};_0x3f031c(++_0x1c0ba3);}(_0x0f90,0xb3));var _0x00f9=function(_0x4c1e76,_0x430881){_0x4c1e76=_0x4c1e76-0x0;var _0x59b5a7=_0x0f90[_0x4c1e76];return _0x59b5a7;};'use strict';var util=require(_0x00f9('0x0'));var BPromise=require('bluebird');var logger=require(_0x00f9('0x1'))('preview');var _=require(_0x00f9('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x259b8b){return function(_0x3a261f){logger['error'](_0x259b8b,util[_0x00f9('0x3')](_0x3a261f,{'showHidden':![],'depth':null}));};}exports[_0x00f9('0x4')]=function(_0x1b4799,_0x181076){return BPromise[_0x00f9('0x5')]()[_0x00f9('0x6')](faxAccount[_0x00f9('0x4')](_0x1b4799,_0x181076))[_0x00f9('0x7')](loggerCatch(_0x00f9('0x8')));}; \ No newline at end of file +var _0x5f50=['notify','then','[Notify]\x20','util','../../../config/logger','../rpc/faxAccount','error'];(function(_0x4cf5ea,_0x285f96){var _0x5ee4c9=function(_0x3d3af8){while(--_0x3d3af8){_0x4cf5ea['push'](_0x4cf5ea['shift']());}};_0x5ee4c9(++_0x285f96);}(_0x5f50,0x184));var _0x05f5=function(_0x5e7ab0,_0x222ad2){_0x5e7ab0=_0x5e7ab0-0x0;var _0xefbf78=_0x5f50[_0x5e7ab0];return _0xefbf78;};'use strict';var util=require(_0x05f5('0x0'));var BPromise=require('bluebird');var logger=require(_0x05f5('0x1'))('preview');var _=require('lodash');var faxAccount=require(_0x05f5('0x2'));function loggerCatch(_0x5b4c81){return function(_0x453fcd){logger[_0x05f5('0x3')](_0x5b4c81,util['inspect'](_0x453fcd,{'showHidden':![],'depth':null}));};}exports[_0x05f5('0x4')]=function(_0x44c840,_0x3d6064){return BPromise['resolve']()[_0x05f5('0x5')](faxAccount['notify'](_0x44c840,_0x3d6064))['catch'](loggerCatch(_0x05f5('0x6')));}; \ 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 19b5ef2..4c44648 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 _0x6d63=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird','child_process','exec'];(function(_0x9c31ca,_0x90bff1){var _0x51941c=function(_0x14706a){while(--_0x14706a){_0x9c31ca['push'](_0x9c31ca['shift']());}};_0x51941c(++_0x90bff1);}(_0x6d63,0xef));var _0x36d6=function(_0x1e0209,_0x1088ef){_0x1e0209=_0x1e0209-0x0;var _0x2de180=_0x6d63[_0x1e0209];return _0x2de180;};'use strict';var util=require(_0x36d6('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x36d6('0x1'));var exec=require(_0x36d6('0x2'))[_0x36d6('0x3')];exports[_0x36d6('0x4')]=function(_0x5d0449){return new BPromise(function(_0x5221d6,_0x14fa3b){exec(_0x5d0449,function(_0x366c3d,_0x2c0b8f,_0x6736b1){logger[_0x36d6('0x5')](_0x36d6('0x6'),_0x2c0b8f);if(_0x366c3d){logger['info']('Exec\x20gs',_0x36d6('0x7'),util[_0x36d6('0x8')](_0x366c3d,{'showHidden':![],'depth':null}),_0x2c0b8f,_0x6736b1);_0x14fa3b(_0x366c3d);}_0x5221d6(_0x2c0b8f);});});}; \ No newline at end of file +var _0xa2eb=['info','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','Exec\x20gs'];(function(_0x4e7c2,_0x3b3347){var _0x84bb35=function(_0x217b38){while(--_0x217b38){_0x4e7c2['push'](_0x4e7c2['shift']());}};_0x84bb35(++_0x3b3347);}(_0xa2eb,0x16a));var _0xba2e=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0xa2eb[_0x37e845];return _0x59e55b;};'use strict';var util=require(_0xba2e('0x0'));var logger=require(_0xba2e('0x1'))(_0xba2e('0x2'));var BPromise=require(_0xba2e('0x3'));var exec=require(_0xba2e('0x4'))[_0xba2e('0x5')];exports[_0xba2e('0x6')]=function(_0x7d515a){return new BPromise(function(_0x130f31,_0x3cff8e){exec(_0x7d515a,function(_0x52c6b2,_0x39f539,_0x279641){logger['info'](_0xba2e('0x7'),_0x39f539);if(_0x52c6b2){logger[_0xba2e('0x8')](_0xba2e('0x7'),_0xba2e('0x9'),util['inspect'](_0x52c6b2,{'showHidden':![],'depth':null}),_0x39f539,_0x279641);_0x3cff8e(_0x52c6b2);}_0x130f31(_0x39f539);});});}; \ 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 828465d..a96dd34 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 _0x7fe7=['fax','message','logger','info','inspect','ecm','headerinfo','maxrate','format','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment'];(function(_0x3b10df,_0x46d3ec){var _0x50501e=function(_0x28b8b5){while(--_0x28b8b5){_0x3b10df['push'](_0x3b10df['shift']());}};_0x50501e(++_0x46d3ec);}(_0x7fe7,0x1b7));var _0x77fe=function(_0x30cb96,_0x31b9e1){_0x30cb96=_0x30cb96-0x0;var _0xeff506=_0x7fe7[_0x30cb96];return _0xeff506;};'use strict';var util=require(_0x77fe('0x0'));var _=require('lodash');var moment=require(_0x77fe('0x1'));var logger=require('../../../../config/logger')(_0x77fe('0x2'));exports[_0x77fe('0x3')]=function(_0x5055d3){return{'message':_0x5055d3};};exports[_0x77fe('0x4')]=function(_0x1e70ba,_0xea6ce3){logger[_0x77fe('0x5')](_0x1e70ba,util[_0x77fe('0x6')](_0xea6ce3,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x13c712,_0x5cf1c6){var _0x3e2431={'XMF-ECM':_0x5cf1c6[_0x77fe('0x7')],'XMF-HEADERINFO':_0x5cf1c6[_0x77fe('0x8')],'XMF-MINRATE':_0x5cf1c6['minrate'],'XMF-MAXRATE':_0x5cf1c6[_0x77fe('0x9')],'XMF-MODEM':util[_0x77fe('0xa')]('\x22%s\x22',_0x5cf1c6[_0x77fe('0xb')]),'XMF-GATEWAY':_0x5cf1c6[_0x77fe('0xc')],'XMF-FAXDETECT':_0x5cf1c6['faxdetect'],'XMF-T38TIMEOUT':_0x5cf1c6[_0x77fe('0xd')],'XMF-LOCALSTATIONID':_0x5cf1c6[_0x77fe('0xe')],'XMF-PATH':_0x13c712['path']};return _0x3e2431;};exports[_0x77fe('0xf')]=function(_0x15a9d8,_0xa315c4){return{'actionid':_0x15a9d8[_0x77fe('0x10')],'action':_0x77fe('0x11'),'channel':_0x15a9d8['channel'],'Exten':_0x77fe('0x12'),'Context':_0x77fe('0x13'),'Priority':'1','callerid':util[_0x77fe('0xa')](_0x77fe('0x14'),_0x15a9d8[_0x77fe('0x8')]?_0x15a9d8[_0x77fe('0x8')]:'',_0x15a9d8[_0x77fe('0xe')]),'variable':_0xa315c4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x15a9d8['uniqueid']};}; \ No newline at end of file +var _0x1800=['t38timeout','localstationid','variablesAction','uniqueid','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0xf18977,_0x87ecc4){var _0x360bb8=function(_0x58a178){while(--_0x58a178){_0xf18977['push'](_0xf18977['shift']());}};_0x360bb8(++_0x87ecc4);}(_0x1800,0x9d));var _0x0180=function(_0x48ad92,_0x3881cc){_0x48ad92=_0x48ad92-0x0;var _0x40a008=_0x1800[_0x48ad92];return _0x40a008;};'use strict';var util=require('util');var _=require(_0x0180('0x0'));var moment=require(_0x0180('0x1'));var logger=require(_0x0180('0x2'))(_0x0180('0x3'));exports[_0x0180('0x4')]=function(_0x5afd4d){return{'message':_0x5afd4d};};exports[_0x0180('0x5')]=function(_0x33a705,_0x364e32){logger[_0x0180('0x6')](_0x33a705,util[_0x0180('0x7')](_0x364e32,{'showHidden':![],'depth':null}));};exports[_0x0180('0x8')]=function(_0x6d4648,_0x12553a){var _0x16326f={'XMF-ECM':_0x12553a[_0x0180('0x9')],'XMF-HEADERINFO':_0x12553a[_0x0180('0xa')],'XMF-MINRATE':_0x12553a[_0x0180('0xb')],'XMF-MAXRATE':_0x12553a[_0x0180('0xc')],'XMF-MODEM':util[_0x0180('0xd')](_0x0180('0xe'),_0x12553a[_0x0180('0xf')]),'XMF-GATEWAY':_0x12553a[_0x0180('0x10')],'XMF-FAXDETECT':_0x12553a[_0x0180('0x11')],'XMF-T38TIMEOUT':_0x12553a[_0x0180('0x12')],'XMF-LOCALSTATIONID':_0x12553a[_0x0180('0x13')],'XMF-PATH':_0x6d4648['path']};return _0x16326f;};exports[_0x0180('0x14')]=function(_0x43b2c5,_0x30e0d7){return{'actionid':_0x43b2c5[_0x0180('0x15')],'action':'originate','channel':_0x43b2c5['channel'],'Exten':_0x0180('0x16'),'Context':_0x0180('0x17'),'Priority':'1','callerid':util[_0x0180('0xd')](_0x0180('0x18'),_0x43b2c5[_0x0180('0xa')]?_0x43b2c5[_0x0180('0xa')]:'',_0x43b2c5[_0x0180('0x13')]),'variable':_0x30e0d7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x43b2c5[_0x0180('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index cad2b6d..59c932e 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 _0x73ed=['getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','util','moment','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','then','getAgents'];(function(_0x46e94c,_0x461216){var _0x597221=function(_0x17b6d9){while(--_0x17b6d9){_0x46e94c['push'](_0x46e94c['shift']());}};_0x597221(++_0x461216);}(_0x73ed,0x1a4));var _0xd73e=function(_0x232155,_0x2f87ea){_0x232155=_0x232155-0x0;var _0x19a588=_0x73ed[_0x232155];return _0x19a588;};'use strict';var util=require(_0xd73e('0x0'));var moment=require(_0xd73e('0x1'));var server=require('./server');var Realtime=require(_0xd73e('0x2'));var Report=require(_0xd73e('0x3'));var Acw=require(_0xd73e('0x4'));var Trigger=require(_0xd73e('0x5'));var Dialer=require('./dialer');var Preview=require(_0xd73e('0x6'));var Fax=require('./fax');var user=require(_0xd73e('0x7'));var voiceQueue=require(_0xd73e('0x8'));var voiceQueueReport=require(_0xd73e('0x9'));var voiceCallReport=require(_0xd73e('0xa'));var trunk=require(_0xd73e('0xb'));var trigger=require('./rpc/trigger');var template=require(_0xd73e('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0xd73e('0xd'));var faxAccount=require(_0xd73e('0xe'));var zendesk=require(_0xd73e('0xf'));var salesforce=require(_0xd73e('0x10'));var sugarcrm=require(_0xd73e('0x11'));var freshdesk=require(_0xd73e('0x12'));var desk=require(_0xd73e('0x13'));var zoho=require(_0xd73e('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xd73e('0x15'));var servicenow=require(_0xd73e('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xd73e('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd73e('0x18')](_0xd73e('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xd73e('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xd73e('0x1a')](user[_0xd73e('0x1b')]())['then'](realtime['initAgents']())['then'](user[_0xd73e('0x1c')]())['then'](realtime['initTelephones']())[_0xd73e('0x1a')](trunk[_0xd73e('0x1d')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x1e')]())[_0xd73e('0x1a')](voiceQueue[_0xd73e('0x1f')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x20')]())['then'](trigger[_0xd73e('0x21')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x22')]())[_0xd73e('0x1a')](template['getTemplates']())[_0xd73e('0x1a')](realtime['initTemplates']())[_0xd73e('0x1a')](zendesk[_0xd73e('0x23')]())['then'](realtime[_0xd73e('0x24')]())[_0xd73e('0x1a')](salesforce[_0xd73e('0x25')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x26')]())[_0xd73e('0x1a')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xd73e('0x27')]())[_0xd73e('0x1a')](freshdesk[_0xd73e('0x28')]())[_0xd73e('0x1a')](realtime['initFreshdeskAccounts']())[_0xd73e('0x1a')](desk[_0xd73e('0x29')]())['then'](realtime['initDeskAccounts']())[_0xd73e('0x1a')](zoho['getZohoAccounts']())[_0xd73e('0x1a')](realtime['initZohoAccounts']())[_0xd73e('0x1a')](vtiger[_0xd73e('0x2a')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x2b')]())['then'](freshsales[_0xd73e('0x2c')]())['then'](realtime[_0xd73e('0x2d')]())['then'](servicenow[_0xd73e('0x2e')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xd73e('0x2f')]())[_0xd73e('0x1a')](realtime['initDynamics365Accounts']())[_0xd73e('0x1a')](campaign[_0xd73e('0x30')]())[_0xd73e('0x1a')](realtime['initCampaigns']())[_0xd73e('0x1a')](voiceExtension[_0xd73e('0x31')]())['then'](realtime['initVoiceExtensions']())[_0xd73e('0x1a')](faxAccount[_0xd73e('0x32')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x33')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xd73e('0x34')]()[_0xd73e('0x1a')](voiceQueueReport[_0xd73e('0x35')]())[_0xd73e('0x1a')](realtime[_0xd73e('0x36')]())['then'](cmHopperHistory[_0xd73e('0x37')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xd73e('0x1a')](cmHopperHistory[_0xd73e('0x38')]())['then'](realtime[_0xd73e('0x39')]())[_0xd73e('0x1a')](voiceCallReport[_0xd73e('0x3a')]())['then'](realtime[_0xd73e('0x3b')]())[_0xd73e('0x3c')](function(_0x343bba){logger[_0xd73e('0x3d')](_0xd73e('0x3e'),util['inspect'](_0x343bba,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd73e('0x3f')](realtime,preview,fax)[_0xd73e('0x1a')](function(){return initRealtime();})[_0xd73e('0x1a')](function(){return initParams();})[_0xd73e('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xd73e('0x3c')](function(_0xc119ab){logger[_0xd73e('0x3d')]('[index.js][main]',util['inspect'](_0xc119ab,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xd035=['catch','inspect','listen','error','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xd035,0x1e1));var _0x5d03=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xd035[_0x1694f5];return _0x5b4321;};'use strict';var util=require(_0x5d03('0x0'));var moment=require(_0x5d03('0x1'));var server=require(_0x5d03('0x2'));var Realtime=require('./realtime');var Report=require(_0x5d03('0x3'));var Acw=require(_0x5d03('0x4'));var Trigger=require(_0x5d03('0x5'));var Dialer=require('./dialer');var Preview=require(_0x5d03('0x6'));var Fax=require(_0x5d03('0x7'));var user=require(_0x5d03('0x8'));var voiceQueue=require(_0x5d03('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x5d03('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x5d03('0xb'));var campaign=require(_0x5d03('0xc'));var voiceExtension=require(_0x5d03('0xd'));var faxAccount=require(_0x5d03('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5d03('0xf'));var sugarcrm=require(_0x5d03('0x10'));var freshdesk=require(_0x5d03('0x11'));var desk=require(_0x5d03('0x12'));var zoho=require(_0x5d03('0x13'));var vtiger=require(_0x5d03('0x14'));var freshsales=require(_0x5d03('0x15'));var servicenow=require(_0x5d03('0x16'));var dynamics365=require(_0x5d03('0x17'));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 logger=require(_0x5d03('0x18'))(_0x5d03('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5d03('0x1a')](_0x5d03('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5d03('0x1a')](_0x5d03('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x5d03('0x1c')]()[_0x5d03('0x1d')](user[_0x5d03('0x1e')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x1f')]())[_0x5d03('0x1d')](user[_0x5d03('0x20')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x21')]())['then'](trunk[_0x5d03('0x22')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x23')]())['then'](voiceQueue['getVoiceQueues']())[_0x5d03('0x1d')](realtime[_0x5d03('0x24')]())[_0x5d03('0x1d')](trigger['getTriggers']())[_0x5d03('0x1d')](realtime[_0x5d03('0x25')]())[_0x5d03('0x1d')](template['getTemplates']())['then'](realtime[_0x5d03('0x26')]())['then'](zendesk[_0x5d03('0x27')]())[_0x5d03('0x1d')](realtime['initZendeskAccounts']())[_0x5d03('0x1d')](salesforce[_0x5d03('0x28')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x29')]())[_0x5d03('0x1d')](sugarcrm[_0x5d03('0x2a')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x2b')]())['then'](freshdesk[_0x5d03('0x2c')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x2d')]())[_0x5d03('0x1d')](desk[_0x5d03('0x2e')]())[_0x5d03('0x1d')](realtime['initDeskAccounts']())[_0x5d03('0x1d')](zoho['getZohoAccounts']())[_0x5d03('0x1d')](realtime[_0x5d03('0x2f')]())[_0x5d03('0x1d')](vtiger[_0x5d03('0x30')]())['then'](realtime[_0x5d03('0x31')]())[_0x5d03('0x1d')](freshsales[_0x5d03('0x32')]())[_0x5d03('0x1d')](realtime['initFreshsalesAccounts']())[_0x5d03('0x1d')](servicenow[_0x5d03('0x33')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x34')]())[_0x5d03('0x1d')](dynamics365[_0x5d03('0x35')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x36')]())[_0x5d03('0x1d')](campaign['getCampaigns']())['then'](realtime[_0x5d03('0x37')]())['then'](voiceExtension[_0x5d03('0x38')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x39')]())[_0x5d03('0x1d')](faxAccount['getFaxAccounts']())[_0x5d03('0x1d')](realtime[_0x5d03('0x3a')]())[_0x5d03('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0x5d03('0x1c')]()[_0x5d03('0x1d')](voiceQueueReport[_0x5d03('0x3b')]())[_0x5d03('0x1d')](realtime[_0x5d03('0x3c')]())[_0x5d03('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x5d03('0x3d')]())['then'](realtime[_0x5d03('0x3e')]())[_0x5d03('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x5d03('0x1d')](realtime['initVoiceCallReports']())[_0x5d03('0x3f')](function(_0x3cc38f){logger['error']('[index.js][initParams]',util[_0x5d03('0x40')](_0x3cc38f,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5d03('0x41')](realtime,preview,fax)[_0x5d03('0x1d')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x5d03('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x5d03('0x3f')](function(_0xb65084){logger[_0x5d03('0x42')](_0x5d03('0x43'),util[_0x5d03('0x40')](_0xb65084,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 09b5833..3b4523c 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 _0xc67b=['stateTime','address','mobile','interface','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','name','fullname','status','online','user:%s','emit','user:presence','lodash','util','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','email','accountcode','state','unknown'];(function(_0x8f2dd,_0x4ae215){var _0x3143a3=function(_0xf716e5){while(--_0xf716e5){_0x8f2dd['push'](_0x8f2dd['shift']());}};_0x3143a3(++_0x4ae215);}(_0xc67b,0x104));var _0xbc67=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc67b[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xbc67('0x0'));var util=require(_0xbc67('0x1'));var moment=require(_0xbc67('0x2'));var md5=require(_0xbc67('0x3'));var Redis=require(_0xbc67('0x4'));var config=require(_0xbc67('0x5'));config['redis']=_[_0xbc67('0x6')](config[_0xbc67('0x7')],{'host':_0xbc67('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc67('0x7')]));function Agent(_0x20ad01){this['id']=_0x20ad01['id']||0x0;this['name']=_0x20ad01['name']||'';this['email']=_0x20ad01[_0xbc67('0x9')]||'';this['accountcode']=_0x20ad01[_0xbc67('0xa')]||'';this['fullname']=_0x20ad01['fullname']||'';this[_0xbc67('0xb')]=_0xbc67('0xc');this[_0xbc67('0xd')]=0x0;this['status']=_0xbc67('0xc');this[_0xbc67('0xe')]='';this['phone']='';this[_0xbc67('0xf')]='';this[_0xbc67('0x10')]='';this['online']=_0x20ad01['online']||![];this[_0xbc67('0x11')]=_0xbc67('0xc');this[_0xbc67('0x12')]=0x0;this[_0xbc67('0x13')]='';this[_0xbc67('0x14')]='';this[_0xbc67('0x15')]=![];this[_0xbc67('0x16')]=![];this['md5']='';}Agent[_0xbc67('0x17')][_0xbc67('0x18')]=function(_0x12cfcb){var _0x5ad901;if(_0x12cfcb&&_0x12cfcb['state']){_0x5ad901=_0x12cfcb[_0xbc67('0xb')][_0xbc67('0x19')]();switch(_0x5ad901){case _0xbc67('0x1a'):_0x5ad901=_0xbc67('0x1b');break;case _0xbc67('0x1c'):_0x5ad901=_0xbc67('0x1d');break;}}if(_0x5ad901&&this[_0xbc67('0x11')]!==_0x5ad901||_0x12cfcb[_0xbc67('0x1e')]){this[_0xbc67('0x12')]=_['toNumber'](moment()[_0xbc67('0x1f')]('x'));}if(_0x5ad901){this[_0xbc67('0x11')]=_0x5ad901;}var _0x1d32a3={'id':this['id'],'name':this[_0xbc67('0x20')],'email':this[_0xbc67('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xbc67('0x21')],'state':this[_0xbc67('0xb')],'stateTime':this[_0xbc67('0xd')],'status':this[_0xbc67('0x22')],'address':this[_0xbc67('0xe')],'online':this[_0xbc67('0x23')],'voiceStatus':this[_0xbc67('0x11')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xbc67('0x13')],'voiceStatusQueue':this[_0xbc67('0x14')],'interface':this[_0xbc67('0x10')],'onhold':this['onhold']};var _0xe4c0f8=md5(JSON['stringify'](_0x1d32a3));if(this[_0xbc67('0x3')]!==_0xe4c0f8){this[_0xbc67('0x3')]=_0xe4c0f8;io['to'](util[_0xbc67('0x1f')](_0xbc67('0x24'),_0x1d32a3['name']))[_0xbc67('0x25')]('user:save',_0x1d32a3);io[_0xbc67('0x25')](_0xbc67('0x26'),_0x1d32a3);}};module['exports']=Agent; \ No newline at end of file +var _0x1d82=['ioredis','../../../config/environment','redis','defaults','name','email','accountcode','fullname','state','stateTime','unknown','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','not_inuse','idle','inuse','talking','statePause','toNumber','format','status','onhold','user:%s','emit','user:save','user:presence','exports','util','moment','md5'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x1d82,0xe1));var _0x21d8=function(_0x28b9d0,_0x195c84){_0x28b9d0=_0x28b9d0-0x0;var _0x2ca785=_0x1d82[_0x28b9d0];return _0x2ca785;};'use strict';var _=require('lodash');var util=require(_0x21d8('0x0'));var moment=require(_0x21d8('0x1'));var md5=require(_0x21d8('0x2'));var Redis=require(_0x21d8('0x3'));var config=require(_0x21d8('0x4'));config[_0x21d8('0x5')]=_[_0x21d8('0x6')](config[_0x21d8('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21d8('0x5')]));function Agent(_0x3439ce){this['id']=_0x3439ce['id']||0x0;this[_0x21d8('0x7')]=_0x3439ce[_0x21d8('0x7')]||'';this[_0x21d8('0x8')]=_0x3439ce[_0x21d8('0x8')]||'';this[_0x21d8('0x9')]=_0x3439ce[_0x21d8('0x9')]||'';this[_0x21d8('0xa')]=_0x3439ce[_0x21d8('0xa')]||'';this[_0x21d8('0xb')]='unknown';this[_0x21d8('0xc')]=0x0;this['status']=_0x21d8('0xd');this[_0x21d8('0xe')]='';this[_0x21d8('0xf')]='';this[_0x21d8('0x10')]='';this['interface']='';this[_0x21d8('0x11')]=_0x3439ce[_0x21d8('0x11')]||![];this[_0x21d8('0x12')]=_0x21d8('0xd');this[_0x21d8('0x13')]=0x0;this[_0x21d8('0x14')]='';this[_0x21d8('0x15')]='';this['onhold']=![];this[_0x21d8('0x16')]=![];this[_0x21d8('0x2')]='';}Agent[_0x21d8('0x17')]['updateStatusRealtime']=function(_0x3bffd8){var _0x5cb4d4;if(_0x3bffd8&&_0x3bffd8['state']){_0x5cb4d4=_0x3bffd8[_0x21d8('0xb')]['toLowerCase']();switch(_0x5cb4d4){case _0x21d8('0x18'):_0x5cb4d4=_0x21d8('0x19');break;case _0x21d8('0x1a'):_0x5cb4d4=_0x21d8('0x1b');break;}}if(_0x5cb4d4&&this[_0x21d8('0x12')]!==_0x5cb4d4||_0x3bffd8[_0x21d8('0x1c')]){this[_0x21d8('0x13')]=_[_0x21d8('0x1d')](moment()[_0x21d8('0x1e')]('x'));}if(_0x5cb4d4){this[_0x21d8('0x12')]=_0x5cb4d4;}var _0x510fde={'id':this['id'],'name':this[_0x21d8('0x7')],'email':this[_0x21d8('0x8')],'accountcode':this[_0x21d8('0x9')],'fullname':this[_0x21d8('0xa')],'state':this[_0x21d8('0xb')],'stateTime':this[_0x21d8('0xc')],'status':this[_0x21d8('0x1f')],'address':this[_0x21d8('0xe')],'online':this[_0x21d8('0x11')],'voiceStatus':this[_0x21d8('0x12')],'voiceStatusTime':this[_0x21d8('0x13')],'voiceStatusCallerIdNumber':this[_0x21d8('0x14')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x21d8('0x20')]};var _0x2f8aef=md5(JSON['stringify'](_0x510fde));if(this['md5']!==_0x2f8aef){this[_0x21d8('0x2')]=_0x2f8aef;io['to'](util['format'](_0x21d8('0x21'),_0x510fde[_0x21d8('0x7')]))[_0x21d8('0x22')](_0x21d8('0x23'),_0x510fde);io[_0x21d8('0x22')](_0x21d8('0x24'),_0x510fde);}};module[_0x21d8('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d372988..f14d9ef 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 _0x1208=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x4e324f,_0x4f0cfc){var _0x4e6076=function(_0x4b8227){while(--_0x4b8227){_0x4e324f['push'](_0x4e324f['shift']());}};_0x4e6076(++_0x4f0cfc);}(_0x1208,0x119));var _0x8120=function(_0x3bdbfa,_0x5f0d24){_0x3bdbfa=_0x3bdbfa-0x0;var _0x80bd85=_0x1208[_0x3bdbfa];return _0x80bd85;};'use strict';function Campaign(_0x46fc7c){this['id']=_0x46fc7c['id']||0x0;this[_0x8120('0x0')]=_0x46fc7c[_0x8120('0x0')]||'';this[_0x8120('0x1')]=_0x46fc7c[_0x8120('0x1')]||_0x8120('0x2');this[_0x8120('0x3')]=0x0;this[_0x8120('0x4')]=0x0;this[_0x8120('0x5')]=0x0;this[_0x8120('0x6')]=0x0;this[_0x8120('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0x8120('0x8')]=_0x46fc7c[_0x8120('0x8')];this[_0x8120('0x9')]=_0x46fc7c[_0x8120('0x9')];this[_0x8120('0xa')]=_0x46fc7c[_0x8120('0xa')]||null;this[_0x8120('0xb')]=_0x46fc7c[_0x8120('0xb')]?_0x46fc7c[_0x8120('0xb')]:null;this[_0x8120('0xc')]=_0x46fc7c[_0x8120('0xc')];this[_0x8120('0xd')]=_0x46fc7c[_0x8120('0xd')];this[_0x8120('0xe')]=_0x46fc7c[_0x8120('0xe')]||0x1e;this[_0x8120('0xf')]=_0x46fc7c['dialCongestionMaxRetry'];this[_0x8120('0x10')]=_0x46fc7c[_0x8120('0x10')];this[_0x8120('0x11')]=_0x46fc7c['dialBusyMaxRetry'];this[_0x8120('0x12')]=_0x46fc7c[_0x8120('0x12')];this[_0x8120('0x13')]=_0x46fc7c[_0x8120('0x13')];this['dialNoAnswerRetryFrequency']=_0x46fc7c[_0x8120('0x14')];this[_0x8120('0x15')]=_0x46fc7c['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x46fc7c[_0x8120('0x16')]||0x3;this[_0x8120('0x17')]=_0x46fc7c[_0x8120('0x17')]||0x96;this[_0x8120('0x18')]=_0x46fc7c[_0x8120('0x18')]||0x3;this[_0x8120('0x19')]=_0x46fc7c[_0x8120('0x19')]||0x96;this[_0x8120('0x1a')]=_0x46fc7c[_0x8120('0x1a')]||0x3;this[_0x8120('0x1b')]=_0x46fc7c[_0x8120('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x46fc7c['dialMachineMaxRetry']||0x3;this[_0x8120('0x1c')]=_0x46fc7c[_0x8120('0x1c')]||0x96;this[_0x8120('0x1d')]=_0x46fc7c[_0x8120('0x1d')]||0x3;this[_0x8120('0x1e')]=_0x46fc7c[_0x8120('0x1e')]||0x96;this[_0x8120('0x1f')]=_0x46fc7c[_0x8120('0x1f')]||'DESC';this[_0x8120('0x20')]=_0x46fc7c[_0x8120('0x20')]||undefined;this[_0x8120('0x21')]=_0x46fc7c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8120('0x22')]=_0x46fc7c['dialCutDigit']||undefined;this[_0x8120('0x23')]=_0x46fc7c[_0x8120('0x23')]?_0x46fc7c[_0x8120('0x23')]:undefined;this[_0x8120('0x24')]=_0x46fc7c[_0x8120('0x24')]?_0x46fc7c[_0x8120('0x24')]:undefined;this[_0x8120('0x25')]=_0x46fc7c[_0x8120('0x25')]?_0x46fc7c[_0x8120('0x25')]:undefined;this['SquareProject']=_0x46fc7c[_0x8120('0x26')]?_0x46fc7c[_0x8120('0x26')]:undefined;this[_0x8120('0x27')]=_0x46fc7c[_0x8120('0x26')]?_0x46fc7c[_0x8120('0x26')]['name']:undefined;this[_0x8120('0x28')]=_0x46fc7c[_0x8120('0x28')]||![];this[_0x8120('0x29')]=_0x46fc7c[_0x8120('0x29')];this[_0x8120('0x2a')]=_0x46fc7c[_0x8120('0x2a')];this[_0x8120('0x2b')]=_0x46fc7c['dialAMDAfterGreetingSilence'];this[_0x8120('0x2c')]=_0x46fc7c[_0x8120('0x2c')];this['dialAMDMinWordLength']=_0x46fc7c[_0x8120('0x2d')];this[_0x8120('0x2e')]=_0x46fc7c[_0x8120('0x2e')];this[_0x8120('0x2f')]=_0x46fc7c['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x46fc7c['dialAMDSilenceThreshold'];this[_0x8120('0x30')]=_0x46fc7c[_0x8120('0x30')];}module[_0x8120('0x31')]=Campaign; \ No newline at end of file +var _0xcd31=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0xafb534,_0x315258){var _0x2df1d6=function(_0x4eddc2){while(--_0x4eddc2){_0xafb534['push'](_0xafb534['shift']());}};_0x2df1d6(++_0x315258);}(_0xcd31,0x1bb));var _0x1cd3=function(_0x345ca6,_0x4ca797){_0x345ca6=_0x345ca6-0x0;var _0x3fd9bc=_0xcd31[_0x345ca6];return _0x3fd9bc;};'use strict';function Campaign(_0x3ea089){this['id']=_0x3ea089['id']||0x0;this[_0x1cd3('0x0')]=_0x3ea089[_0x1cd3('0x0')]||'';this['type']=_0x3ea089[_0x1cd3('0x1')]||_0x1cd3('0x2');this[_0x1cd3('0x3')]=0x0;this[_0x1cd3('0x4')]=0x0;this[_0x1cd3('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x1cd3('0x6')]='';this[_0x1cd3('0x7')]=!![];this[_0x1cd3('0x8')]=_0x3ea089[_0x1cd3('0x8')];this[_0x1cd3('0x9')]=_0x3ea089[_0x1cd3('0x9')];this[_0x1cd3('0xa')]=_0x3ea089['dialTimezone']||null;this[_0x1cd3('0xb')]=_0x3ea089['dialGlobalInterval']?_0x3ea089['dialGlobalInterval']:null;this[_0x1cd3('0xc')]=_0x3ea089['dialOriginateCallerIdName'];this[_0x1cd3('0xd')]=_0x3ea089[_0x1cd3('0xd')];this[_0x1cd3('0xe')]=_0x3ea089[_0x1cd3('0xe')]||0x1e;this[_0x1cd3('0xf')]=_0x3ea089[_0x1cd3('0xf')];this[_0x1cd3('0x10')]=_0x3ea089[_0x1cd3('0x10')];this['dialBusyMaxRetry']=_0x3ea089[_0x1cd3('0x11')];this[_0x1cd3('0x12')]=_0x3ea089[_0x1cd3('0x12')];this[_0x1cd3('0x13')]=_0x3ea089[_0x1cd3('0x13')];this[_0x1cd3('0x14')]=_0x3ea089['dialNoAnswerRetryFrequency'];this[_0x1cd3('0x15')]=_0x3ea089[_0x1cd3('0x15')];this[_0x1cd3('0x16')]=_0x3ea089['dialNoSuchNumberMaxRetry']||0x3;this[_0x1cd3('0x17')]=_0x3ea089[_0x1cd3('0x17')]||0x96;this[_0x1cd3('0x18')]=_0x3ea089[_0x1cd3('0x18')]||0x3;this[_0x1cd3('0x19')]=_0x3ea089[_0x1cd3('0x19')]||0x96;this[_0x1cd3('0x1a')]=_0x3ea089['dialAbandonedMaxRetry']||0x3;this[_0x1cd3('0x1b')]=_0x3ea089['dialAbandonedRetryFrequency']||0x96;this[_0x1cd3('0x1c')]=_0x3ea089[_0x1cd3('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0x3ea089[_0x1cd3('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x3ea089[_0x1cd3('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3ea089[_0x1cd3('0x1f')]||0x96;this[_0x1cd3('0x20')]=_0x3ea089[_0x1cd3('0x20')]||_0x1cd3('0x21');this[_0x1cd3('0x22')]=_0x3ea089[_0x1cd3('0x22')]||undefined;this[_0x1cd3('0x23')]=_0x3ea089[_0x1cd3('0x23')]||undefined;this[_0x1cd3('0x24')]=_0x3ea089[_0x1cd3('0x24')]||undefined;this[_0x1cd3('0x25')]=_0x3ea089['TrunkBackup']?_0x3ea089[_0x1cd3('0x25')]:undefined;this[_0x1cd3('0x26')]=_0x3ea089[_0x1cd3('0x26')]?_0x3ea089['Trunk']:undefined;this['Interval']=_0x3ea089[_0x1cd3('0x27')]?_0x3ea089['Interval']:undefined;this[_0x1cd3('0x28')]=_0x3ea089['SquareProject']?_0x3ea089['SquareProject']:undefined;this[_0x1cd3('0x29')]=_0x3ea089['SquareProject']?_0x3ea089[_0x1cd3('0x28')][_0x1cd3('0x0')]:undefined;this[_0x1cd3('0x2a')]=_0x3ea089[_0x1cd3('0x2a')]||![];this['dialAMDInitialSilence']=_0x3ea089[_0x1cd3('0x2b')];this[_0x1cd3('0x2c')]=_0x3ea089[_0x1cd3('0x2c')];this['dialAMDAfterGreetingSilence']=_0x3ea089['dialAMDAfterGreetingSilence'];this[_0x1cd3('0x2d')]=_0x3ea089[_0x1cd3('0x2d')];this['dialAMDMinWordLength']=_0x3ea089[_0x1cd3('0x2e')];this[_0x1cd3('0x2f')]=_0x3ea089['dialAMDBetweenWordsSilence'];this[_0x1cd3('0x30')]=_0x3ea089[_0x1cd3('0x30')];this[_0x1cd3('0x31')]=_0x3ea089[_0x1cd3('0x31')];this[_0x1cd3('0x32')]=_0x3ea089[_0x1cd3('0x32')];}module[_0x1cd3('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index f56bffb..ff20a6b 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 _0x80b2=['type','tag','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80b2,0x141));var _0x280b=function(_0x595b17,_0x2191c2){_0x595b17=_0x595b17-0x0;var _0xd8228e=_0x80b2[_0x595b17];return _0xd8228e;};'use strict';function Channel(){this[_0x280b('0x0')]=null;this[_0x280b('0x1')]='';this['destinationchannel']='';this[_0x280b('0x2')]=0x0;this[_0x280b('0x3')]='';this['connectedlinenum']=undefined;this[_0x280b('0x4')]=undefined;this[_0x280b('0x5')]=0x0;this[_0x280b('0x6')]='';this[_0x280b('0x7')]=0x0;this[_0x280b('0x8')]=0x0;this['exten']=0x0;this[_0x280b('0x9')]=![];this[_0x280b('0xa')]=null;this['endtime']=null;this[_0x280b('0xb')]=![];this[_0x280b('0xc')]=![];this[_0x280b('0xd')]='';this['lastdata']='';this[_0x280b('0xe')]=0x0;this[_0x280b('0xf')]=0x0;this[_0x280b('0x10')]=0x0;this[_0x280b('0x11')]=null;this[_0x280b('0x12')]=null;this[_0x280b('0x13')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x280b('0x14')]=null;this[_0x280b('0x15')]=[];this[_0x280b('0x16')]=undefined;this[_0x280b('0x17')]=undefined;this[_0x280b('0x18')]=undefined;this['mohtime']=0x0;}module[_0x280b('0x19')]=Channel; \ No newline at end of file +var _0x5f7b=['accountcode','context','uniqueid','exten','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','transferconnectedlinenum','transferType','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x2cbf6b,_0x24f557){var _0x51a5f3=function(_0x46166c){while(--_0x46166c){_0x2cbf6b['push'](_0x2cbf6b['shift']());}};_0x51a5f3(++_0x24f557);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5f7b[_0x413feb];return _0x40ee88;};'use strict';function Channel(){this[_0xb5f7('0x0')]=null;this[_0xb5f7('0x1')]='';this['destinationchannel']='';this[_0xb5f7('0x2')]=0x0;this[_0xb5f7('0x3')]='';this[_0xb5f7('0x4')]=undefined;this[_0xb5f7('0x5')]=undefined;this[_0xb5f7('0x6')]=0x0;this[_0xb5f7('0x7')]='';this[_0xb5f7('0x8')]=0x0;this['linkedid']=0x0;this[_0xb5f7('0x9')]=0x0;this['answered']=![];this[_0xb5f7('0xa')]=null;this[_0xb5f7('0xb')]=null;this['unmanaged']=![];this[_0xb5f7('0xc')]=![];this[_0xb5f7('0xd')]='';this['lastdata']='';this[_0xb5f7('0xe')]=0x0;this[_0xb5f7('0xf')]=0x0;this[_0xb5f7('0x10')]=0x0;this[_0xb5f7('0x11')]=null;this[_0xb5f7('0x12')]=null;this[_0xb5f7('0x13')]=null;this[_0xb5f7('0x14')]=![];this['monitorFilename']=null;this[_0xb5f7('0x15')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xb5f7('0x16')]=undefined;this[_0xb5f7('0x17')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index f342eaa..b8c140c 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 _0x4bec=['username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x4bec,0x1ee));var _0xc4be=function(_0x42dfef,_0x2d28ac){_0x42dfef=_0x42dfef-0x0;var _0x4d222e=_0x4bec[_0x42dfef];return _0x4d222e;};'use strict';function DeskAccount(_0x3dca3f){this['id']=_0x3dca3f['id']||0x0;this[_0xc4be('0x0')]=_0x3dca3f[_0xc4be('0x0')]||'';this[_0xc4be('0x1')]=_0x3dca3f['username']||'';this['remoteUri']=_0x3dca3f[_0xc4be('0x2')]||'';this[_0xc4be('0x3')]=_0x3dca3f[_0xc4be('0x3')]||'';this[_0xc4be('0x4')]=_0x3dca3f[_0xc4be('0x4')]||'';this['consumerKey']=_0x3dca3f['consumerKey']||'';this[_0xc4be('0x5')]=_0x3dca3f[_0xc4be('0x5')]||'';this[_0xc4be('0x6')]=_0x3dca3f[_0xc4be('0x6')]||'';this['tokenSecret']=_0x3dca3f[_0xc4be('0x7')]||'';this[_0xc4be('0x8')]=_0x3dca3f[_0xc4be('0x8')]||'';this[_0xc4be('0x9')]=_0x3dca3f[_0xc4be('0x9')]||'';this['Configurations']=_0x3dca3f[_0xc4be('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xe52c=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerSecret'];(function(_0xacf7a7,_0x460ede){var _0x128fd4=function(_0x4209f0){while(--_0x4209f0){_0xacf7a7['push'](_0xacf7a7['shift']());}};_0x128fd4(++_0x460ede);}(_0xe52c,0x192));var _0xce52=function(_0x5f4ee5,_0x5cefad){_0x5f4ee5=_0x5f4ee5-0x0;var _0xa91d00=_0xe52c[_0x5f4ee5];return _0xa91d00;};'use strict';function DeskAccount(_0x1d30e1){this['id']=_0x1d30e1['id']||0x0;this[_0xce52('0x0')]=_0x1d30e1['name']||'';this['username']=_0x1d30e1[_0xce52('0x1')]||'';this[_0xce52('0x2')]=_0x1d30e1[_0xce52('0x2')]||'';this[_0xce52('0x3')]=_0x1d30e1[_0xce52('0x3')]||'';this['password']=_0x1d30e1[_0xce52('0x4')]||'';this['consumerKey']=_0x1d30e1['consumerKey']||'';this[_0xce52('0x5')]=_0x1d30e1[_0xce52('0x5')]||'';this['token']=_0x1d30e1[_0xce52('0x6')]||'';this[_0xce52('0x7')]=_0x1d30e1['tokenSecret']||'';this[_0xce52('0x8')]=_0x1d30e1[_0xce52('0x8')]||'';this[_0xce52('0x9')]=_0x1d30e1[_0xce52('0x9')]||'';this[_0xce52('0xa')]=_0x1d30e1['Configurations']||{};}module[_0xce52('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 8a2bee9..0096af8 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 _0xa36e=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x158b7b,_0x59eaa4){var _0x10e595=function(_0x432640){while(--_0x432640){_0x158b7b['push'](_0x158b7b['shift']());}};_0x10e595(++_0x59eaa4);}(_0xa36e,0xb3));var _0xea36=function(_0x404ed7,_0x2567c5){_0x404ed7=_0x404ed7-0x0;var _0x27a8bc=_0xa36e[_0x404ed7];return _0x27a8bc;};'use strict';function Dynamics365Account(_0x5becd1){this['id']=_0x5becd1['id']||0x0;this[_0xea36('0x0')]=_0x5becd1[_0xea36('0x0')]||'';this[_0xea36('0x1')]=_0x5becd1['username']||'';this[_0xea36('0x2')]=_0x5becd1['password']||'';this[_0xea36('0x3')]=_0x5becd1['remoteUri']||'';this[_0xea36('0x4')]=_0x5becd1[_0xea36('0x4')]||'';this[_0xea36('0x5')]=_0x5becd1[_0xea36('0x5')]||'';this[_0xea36('0x6')]=_0x5becd1[_0xea36('0x6')]||{};this[_0xea36('0x7')]=_0x5becd1[_0xea36('0x7')]||'';this[_0xea36('0x8')]=_0x5becd1[_0xea36('0x8')]||![];this[_0xea36('0x9')]=_0x5becd1[_0xea36('0x9')]||{};this['CloudProvider']=_0x5becd1[_0xea36('0xa')]||{};}module[_0xea36('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xd780=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd780,0x175));var _0x0d78=function(_0x42954e,_0x35ae01){_0x42954e=_0x42954e-0x0;var _0x596bb4=_0xd780[_0x42954e];return _0x596bb4;};'use strict';function Dynamics365Account(_0x1ddbe0){this['id']=_0x1ddbe0['id']||0x0;this[_0x0d78('0x0')]=_0x1ddbe0['name']||'';this[_0x0d78('0x1')]=_0x1ddbe0[_0x0d78('0x1')]||'';this[_0x0d78('0x2')]=_0x1ddbe0[_0x0d78('0x2')]||'';this[_0x0d78('0x3')]=_0x1ddbe0['remoteUri']||'';this[_0x0d78('0x4')]=_0x1ddbe0[_0x0d78('0x4')]||'';this[_0x0d78('0x5')]=_0x1ddbe0['clientId']||'';this[_0x0d78('0x6')]=_0x1ddbe0[_0x0d78('0x6')]||{};this[_0x0d78('0x7')]=_0x1ddbe0[_0x0d78('0x7')]||'';this[_0x0d78('0x8')]=_0x1ddbe0[_0x0d78('0x8')]||![];this[_0x0d78('0x9')]=_0x1ddbe0[_0x0d78('0x9')]||{};this['CloudProvider']=_0x1ddbe0[_0x0d78('0xa')]||{};}module[_0x0d78('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 12729c0..e6f5c12 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 _0xbb69=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x5344f6,_0x34d749){var _0x35ca27=function(_0x360729){while(--_0x360729){_0x5344f6['push'](_0x5344f6['shift']());}};_0x35ca27(++_0x34d749);}(_0xbb69,0x1ca));var _0x9bb6=function(_0x52923d,_0x204ee8){_0x52923d=_0x52923d-0x0;var _0x2a3598=_0xbb69[_0x52923d];return _0x2a3598;};'use strict';function FaxAccount(_0x28e6b4){this['id']=_0x28e6b4['id']||0x0;this[_0x9bb6('0x0')]=_0x28e6b4['name']||'';this['description']=_0x28e6b4['description'];this['ecm']=_0x28e6b4[_0x9bb6('0x1')];this[_0x9bb6('0x2')]=_0x28e6b4[_0x9bb6('0x2')];this[_0x9bb6('0x3')]=_0x28e6b4['localstationid'];this['minrate']=_0x28e6b4[_0x9bb6('0x4')]||0x960;this[_0x9bb6('0x5')]=_0x28e6b4['maxrate']||0x3840;this[_0x9bb6('0x6')]=_0x28e6b4['modem']||_0x9bb6('0x7');this[_0x9bb6('0x8')]=_0x28e6b4[_0x9bb6('0x8')]||'no';this[_0x9bb6('0x9')]=_0x28e6b4[_0x9bb6('0x9')]||'no';this[_0x9bb6('0xa')]=_0x28e6b4[_0x9bb6('0xa')]||0x1388;this[_0x9bb6('0xb')]=_0x28e6b4[_0x9bb6('0xb')]||_0x9bb6('0xc');this[_0x9bb6('0xd')]=_0x28e6b4[_0x9bb6('0xd')]?_0x28e6b4[_0x9bb6('0xd')]:undefined;this[_0x9bb6('0xe')]=_0x28e6b4[_0x9bb6('0xe')];this[_0x9bb6('0xf')]=_0x28e6b4[_0x9bb6('0xf')];}module[_0x9bb6('0x10')]=FaxAccount; \ No newline at end of file +var _0xe09a=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xe09a,0xaa));var _0xae09=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xe09a[_0x12aaee];return _0x37c350;};'use strict';function FaxAccount(_0x5b15e8){this['id']=_0x5b15e8['id']||0x0;this['name']=_0x5b15e8[_0xae09('0x0')]||'';this[_0xae09('0x1')]=_0x5b15e8[_0xae09('0x1')];this[_0xae09('0x2')]=_0x5b15e8[_0xae09('0x2')];this[_0xae09('0x3')]=_0x5b15e8[_0xae09('0x3')];this[_0xae09('0x4')]=_0x5b15e8['localstationid'];this[_0xae09('0x5')]=_0x5b15e8['minrate']||0x960;this['maxrate']=_0x5b15e8[_0xae09('0x6')]||0x3840;this['modem']=_0x5b15e8[_0xae09('0x7')]||_0xae09('0x8');this[_0xae09('0x9')]=_0x5b15e8[_0xae09('0x9')]||'no';this[_0xae09('0xa')]=_0x5b15e8[_0xae09('0xa')]||'no';this[_0xae09('0xb')]=_0x5b15e8['t38timeout']||0x1388;this[_0xae09('0xc')]=_0x5b15e8[_0xae09('0xc')]||_0xae09('0xd');this[_0xae09('0xe')]=_0x5b15e8[_0xae09('0xe')]?_0x5b15e8[_0xae09('0xe')]:undefined;this[_0xae09('0xf')]=_0x5b15e8[_0xae09('0xf')];this[_0xae09('0x10')]=_0x5b15e8['key'];}module[_0xae09('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 41a17d2..c9d0b3a 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 _0xf5c4=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf5c4,0x137));var _0x4f5c=function(_0x9db9e,_0x4a52b0){_0x9db9e=_0x9db9e-0x0;var _0x12af4a=_0xf5c4[_0x9db9e];return _0x12af4a;};'use strict';function FreshdeskAccount(_0x33b180){this['id']=_0x33b180['id']||0x0;this[_0x4f5c('0x0')]=_0x33b180[_0x4f5c('0x0')]||'';this['username']=_0x33b180[_0x4f5c('0x1')]||'';this[_0x4f5c('0x2')]=_0x33b180[_0x4f5c('0x3')]||'';this['remoteUri']=_0x33b180[_0x4f5c('0x4')]||'';this[_0x4f5c('0x5')]=_0x33b180[_0x4f5c('0x5')]||'';this['Configurations']=_0x33b180[_0x4f5c('0x6')]||{};}module[_0x4f5c('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x419a=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x419a,0x1cb));var _0xa419=function(_0x5f5191,_0x24220e){_0x5f5191=_0x5f5191-0x0;var _0x5b25a7=_0x419a[_0x5f5191];return _0x5b25a7;};'use strict';function FreshdeskAccount(_0x2ee98f){this['id']=_0x2ee98f['id']||0x0;this[_0xa419('0x0')]=_0x2ee98f['name']||'';this[_0xa419('0x1')]=_0x2ee98f[_0xa419('0x1')]||'';this['apiKey']=_0x2ee98f['token']||'';this[_0xa419('0x2')]=_0x2ee98f[_0xa419('0x2')]||'';this['serverUrl']=_0x2ee98f[_0xa419('0x3')]||'';this[_0xa419('0x4')]=_0x2ee98f[_0xa419('0x4')]||{};}module[_0xa419('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index aac9821..e459151 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41d9=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x22e4fd){this['id']=_0x22e4fd['id']||0x0;this[_0x941d('0x0')]=_0x22e4fd[_0x941d('0x0')]||'';this[_0x941d('0x1')]=_0x22e4fd[_0x941d('0x1')]||'';this[_0x941d('0x2')]=_0x22e4fd[_0x941d('0x3')]||'';this['remoteUri']=_0x22e4fd[_0x941d('0x4')]||'';this[_0x941d('0x5')]=_0x22e4fd['serverUrl']||'';this[_0x941d('0x6')]=_0x22e4fd[_0x941d('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x3148=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x5542b6,_0x21ad35){var _0x20faf9=function(_0x22e18c){while(--_0x22e18c){_0x5542b6['push'](_0x5542b6['shift']());}};_0x20faf9(++_0x21ad35);}(_0x3148,0x1d3));var _0x8314=function(_0x1e0c8c,_0x320dd3){_0x1e0c8c=_0x1e0c8c-0x0;var _0x30b996=_0x3148[_0x1e0c8c];return _0x30b996;};'use strict';function FreshsalesAccount(_0x414720){this['id']=_0x414720['id']||0x0;this[_0x8314('0x0')]=_0x414720['name']||'';this[_0x8314('0x1')]=_0x414720[_0x8314('0x1')]||'';this[_0x8314('0x2')]=_0x414720[_0x8314('0x3')]||'';this['remoteUri']=_0x414720[_0x8314('0x4')]||'';this[_0x8314('0x5')]=_0x414720[_0x8314('0x5')]||'';this[_0x8314('0x6')]=_0x414720[_0x8314('0x6')]||{};}module[_0x8314('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 0688829..76db013 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 _0x62e5=['count','queuecallerabandon','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','type','inbound','uniqueid','queue','queuecallerleaveAt','position'];(function(_0x4c637c,_0x4e901f){var _0x3eb8d0=function(_0x5ba2f1){while(--_0x5ba2f1){_0x4c637c['push'](_0x4c637c['shift']());}};_0x3eb8d0(++_0x4e901f);}(_0x62e5,0x1aa));var _0x562e=function(_0x4642e4,_0x1177b6){_0x4642e4=_0x4642e4-0x0;var _0x5ccf90=_0x62e5[_0x4642e4];return _0x5ccf90;};'use strict';function QueueReport(){this[_0x562e('0x0')]=_0x562e('0x1');this[_0x562e('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0x562e('0x3')]='';this['queuecallerjoinAt']=null;this[_0x562e('0x4')]=null;this[_0x562e('0x5')]=0x1;this[_0x562e('0x6')]=0x1;this[_0x562e('0x7')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x562e('0x8')]=![];this[_0x562e('0x9')]=null;this[_0x562e('0xa')]=0x1;this[_0x562e('0xb')]='';this[_0x562e('0xc')]='';this['connectedlinename']='';this[_0x562e('0xd')]='';this[_0x562e('0xe')]='';this[_0x562e('0xf')]='';this['priority']='';this[_0x562e('0x10')]=0x0;this[_0x562e('0x11')]=![];this[_0x562e('0x12')]='';this[_0x562e('0x13')]=_0x562e('0x14');this[_0x562e('0x15')]=null;this[_0x562e('0x16')]=0x0;this[_0x562e('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xb420=['originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallerexit'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0xb420,0x1ee));var _0x0b42=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb420[_0x397e5f];return _0x5302b8;};'use strict';function QueueReport(){this[_0x0b42('0x0')]=_0x0b42('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x0b42('0x2')]='';this[_0x0b42('0x3')]='';this[_0x0b42('0x4')]=null;this[_0x0b42('0x5')]=null;this[_0x0b42('0x6')]=0x1;this[_0x0b42('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x0b42('0x8')]=![];this['queuecallercompleteAt']=null;this[_0x0b42('0x9')]=![];this['queuecallerexitAt']=null;this[_0x0b42('0xa')]=0x1;this['channel']='';this[_0x0b42('0xb')]='';this[_0x0b42('0xc')]='';this[_0x0b42('0xd')]='';this[_0x0b42('0xe')]='';this[_0x0b42('0xf')]='';this[_0x0b42('0x10')]='';this[_0x0b42('0x11')]=0x0;this[_0x0b42('0x12')]=![];this[_0x0b42('0x13')]='';this[_0x0b42('0x14')]=_0x0b42('0x15');this['routealias']=null;this[_0x0b42('0x16')]=0x0;this[_0x0b42('0x17')]={};}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 18d4d85..50d985e 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 _0x920c=['clientSecret','securityToken','type','serverUrl','Configurations','name','username','remoteUri','password'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x920c,0x152));var _0xc920=function(_0x21ac3a,_0x2111bb){_0x21ac3a=_0x21ac3a-0x0;var _0x8f97a9=_0x920c[_0x21ac3a];return _0x8f97a9;};'use strict';function SalesforceAccount(_0x5b58ab){this['id']=_0x5b58ab['id']||0x0;this[_0xc920('0x0')]=_0x5b58ab[_0xc920('0x0')]||'';this[_0xc920('0x1')]=_0x5b58ab['username']||'';this['remoteUri']=_0x5b58ab[_0xc920('0x2')]||'';this['password']=_0x5b58ab[_0xc920('0x3')]||'';this['clientId']=_0x5b58ab['clientId']||'';this[_0xc920('0x4')]=_0x5b58ab[_0xc920('0x4')]||'';this[_0xc920('0x5')]=_0x5b58ab[_0xc920('0x5')]||'';this[_0xc920('0x6')]=_0x5b58ab[_0xc920('0x6')]||'integrationTab';this[_0xc920('0x7')]=_0x5b58ab[_0xc920('0x7')]||'';this[_0xc920('0x8')]=_0x5b58ab[_0xc920('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xebfc=['Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x53cc37,_0x30e9c6){var _0x52c0c0=function(_0x37e0b1){while(--_0x37e0b1){_0x53cc37['push'](_0x53cc37['shift']());}};_0x52c0c0(++_0x30e9c6);}(_0xebfc,0xbf));var _0xcebf=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xebfc[_0x16b9ed];return _0x66b1f8;};'use strict';function SalesforceAccount(_0x281fd9){this['id']=_0x281fd9['id']||0x0;this[_0xcebf('0x0')]=_0x281fd9['name']||'';this[_0xcebf('0x1')]=_0x281fd9[_0xcebf('0x1')]||'';this['remoteUri']=_0x281fd9[_0xcebf('0x2')]||'';this[_0xcebf('0x3')]=_0x281fd9[_0xcebf('0x3')]||'';this[_0xcebf('0x4')]=_0x281fd9['clientId']||'';this[_0xcebf('0x5')]=_0x281fd9[_0xcebf('0x5')]||'';this[_0xcebf('0x6')]=_0x281fd9[_0xcebf('0x6')]||'';this[_0xcebf('0x7')]=_0x281fd9[_0xcebf('0x7')]||'integrationTab';this[_0xcebf('0x8')]=_0x281fd9[_0xcebf('0x8')]||'';this['Configurations']=_0x281fd9[_0xcebf('0x9')]||{};}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 fa0476b..8a01037 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 _0xc40d=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1a1e9a,_0x2b3f6d){var _0x5e0f72=function(_0x577845){while(--_0x577845){_0x1a1e9a['push'](_0x1a1e9a['shift']());}};_0x5e0f72(++_0x2b3f6d);}(_0xc40d,0x115));var _0xdc40=function(_0x45dccf,_0x2b4c7a){_0x45dccf=_0x45dccf-0x0;var _0x3546df=_0xc40d[_0x45dccf];return _0x3546df;};'use strict';function ServicenowAccount(_0x3c9cd2){this['id']=_0x3c9cd2['id']||0x0;this[_0xdc40('0x0')]=_0x3c9cd2[_0xdc40('0x0')]||'';this[_0xdc40('0x1')]=_0x3c9cd2[_0xdc40('0x1')]||'';this[_0xdc40('0x2')]=_0x3c9cd2['password']||'';this[_0xdc40('0x3')]=_0x3c9cd2['remoteUri']||'';this[_0xdc40('0x4')]=_0x3c9cd2['serverUrl']||'';this[_0xdc40('0x5')]=_0x3c9cd2[_0xdc40('0x5')]||{};}module[_0xdc40('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xb92c=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xb92c,0x15c));var _0xcb92=function(_0x44c502,_0x47ee08){_0x44c502=_0x44c502-0x0;var _0x168c43=_0xb92c[_0x44c502];return _0x168c43;};'use strict';function ServicenowAccount(_0x3a67b8){this['id']=_0x3a67b8['id']||0x0;this[_0xcb92('0x0')]=_0x3a67b8[_0xcb92('0x0')]||'';this[_0xcb92('0x1')]=_0x3a67b8[_0xcb92('0x1')]||'';this[_0xcb92('0x2')]=_0x3a67b8['password']||'';this[_0xcb92('0x3')]=_0x3a67b8['remoteUri']||'';this[_0xcb92('0x4')]=_0x3a67b8[_0xcb92('0x4')]||'';this[_0xcb92('0x5')]=_0x3a67b8['Configurations']||{};}module[_0xcb92('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 9ffa22c..641143d 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 _0x8ba1=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2aa83a,_0x4b5c0b){var _0x36a653=function(_0x3fdc46){while(--_0x3fdc46){_0x2aa83a['push'](_0x2aa83a['shift']());}};_0x36a653(++_0x4b5c0b);}(_0x8ba1,0x19e));var _0x18ba=function(_0x45922d,_0x505f14){_0x45922d=_0x45922d-0x0;var _0x131aca=_0x8ba1[_0x45922d];return _0x131aca;};'use strict';function SugarcrmAccount(_0x599f46){this['id']=_0x599f46['id']||0x0;this[_0x18ba('0x0')]=_0x599f46[_0x18ba('0x0')]||'';this['username']=_0x599f46[_0x18ba('0x1')]||'';this[_0x18ba('0x2')]=_0x599f46[_0x18ba('0x2')]||'';this['remoteUri']=_0x599f46[_0x18ba('0x3')]||'';this[_0x18ba('0x4')]=_0x599f46['serverUrl']||'';this[_0x18ba('0x5')]=_0x599f46[_0x18ba('0x5')]||{};}module[_0x18ba('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0752=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x26a672,_0x59f5be){var _0x348f43=function(_0x461812){while(--_0x461812){_0x26a672['push'](_0x26a672['shift']());}};_0x348f43(++_0x59f5be);}(_0x0752,0x1b4));var _0x2075=function(_0x15ae9d,_0x4997a8){_0x15ae9d=_0x15ae9d-0x0;var _0x15c819=_0x0752[_0x15ae9d];return _0x15c819;};'use strict';function SugarcrmAccount(_0x5975e9){this['id']=_0x5975e9['id']||0x0;this[_0x2075('0x0')]=_0x5975e9[_0x2075('0x0')]||'';this[_0x2075('0x1')]=_0x5975e9['username']||'';this[_0x2075('0x2')]=_0x5975e9['password']||'';this['remoteUri']=_0x5975e9[_0x2075('0x3')]||'';this[_0x2075('0x4')]=_0x5975e9[_0x2075('0x4')]||'';this[_0x2075('0x5')]=_0x5975e9[_0x2075('0x5')]||{};}module[_0x2075('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index ff75834..ddf0539 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 _0xb7a5=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x163596,_0x3fb94f){var _0x3837b5=function(_0x3efab9){while(--_0x3efab9){_0x163596['push'](_0x163596['shift']());}};_0x3837b5(++_0x3fb94f);}(_0xb7a5,0x67));var _0x5b7a=function(_0x232752,_0xd84381){_0x232752=_0x232752-0x0;var _0x326df8=_0xb7a5[_0x232752];return _0x326df8;};'use strict';function Telephone(_0x292ba6){this['id']=_0x292ba6['id']||0x0;this[_0x5b7a('0x0')]=_0x292ba6[_0x5b7a('0x0')]||'';this['accountcode']=_0x292ba6[_0x5b7a('0x1')]||'';this['state']=_0x5b7a('0x2');this[_0x5b7a('0x3')]=0x0;this[_0x5b7a('0x4')]='unknown';this[_0x5b7a('0x5')]='';}module[_0x5b7a('0x6')]=Telephone; \ No newline at end of file +var _0x5a32=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x370cc1,_0x934cf){var _0xf56ab0=function(_0x52d821){while(--_0x52d821){_0x370cc1['push'](_0x370cc1['shift']());}};_0xf56ab0(++_0x934cf);}(_0x5a32,0x19b));var _0x25a3=function(_0x4a78b6,_0x2855e9){_0x4a78b6=_0x4a78b6-0x0;var _0x128d58=_0x5a32[_0x4a78b6];return _0x128d58;};'use strict';function Telephone(_0x538497){this['id']=_0x538497['id']||0x0;this['name']=_0x538497[_0x25a3('0x0')]||'';this[_0x25a3('0x1')]=_0x538497[_0x25a3('0x1')]||'';this[_0x25a3('0x2')]=_0x25a3('0x3');this[_0x25a3('0x4')]=0x0;this[_0x25a3('0x5')]=_0x25a3('0x3');this[_0x25a3('0x6')]='';}module[_0x25a3('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 0fc5054..a7f3ada 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x21bf65,_0x3025ce){var _0xcc3629=function(_0x196711){while(--_0x196711){_0x21bf65['push'](_0x21bf65['shift']());}};_0xcc3629(++_0x3025ce);}(_0xb10b,0x12a));var _0xbb10=function(_0x18d710,_0x153c7c){_0x18d710=_0x18d710-0x0;var _0x54f4eb=_0xb10b[_0x18d710];return _0x54f4eb;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x180d4c,_0x3ac156){var _0x374e8c=function(_0x44ef62){while(--_0x44ef62){_0x180d4c['push'](_0x180d4c['shift']());}};_0x374e8c(++_0x3ac156);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 283fa53..aff1f92 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1fa274,_0x27a51f){var _0x5601e0=function(_0x146c2c){while(--_0x146c2c){_0x1fa274['push'](_0x1fa274['shift']());}};_0x5601e0(++_0x27a51f);}(_0x4fc2,0x111));var _0x24fc=function(_0x18841e,_0x64e61f){_0x18841e=_0x18841e-0x0;var _0x49db81=_0x4fc2[_0x18841e];return _0x49db81;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x1b012d,_0x219732){var _0x4aa4ff=function(_0x209ac0){while(--_0x209ac0){_0x1b012d['push'](_0x1b012d['shift']());}};_0x4aa4ff(++_0x219732);}(_0x8603,0x190));var _0x3860=function(_0x13db5b,_0x1abac7){_0x13db5b=_0x13db5b-0x0;var _0x159cb9=_0x8603[_0x13db5b];return _0x159cb9;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('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 aa0d02d..7754420 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 _0x7924=['exports','active','name','state','unknown','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7924,0x100));var _0x4792=function(_0x3cd451,_0x26e81a){_0x3cd451=_0x3cd451-0x0;var _0x571ce6=_0x7924[_0x3cd451];return _0x571ce6;};'use strict';function Trunk(_0x92874a){this['id']=_0x92874a['id']||0x0;this[_0x4792('0x0')]=_0x92874a[_0x4792('0x0')]||![];this[_0x4792('0x1')]=_0x92874a[_0x4792('0x1')]||'';this[_0x4792('0x2')]=_0x4792('0x3');this['stateTime']=0x0;this[_0x4792('0x4')]=_0x4792('0x3');this[_0x4792('0x5')]=_0x92874a[_0x4792('0x5')]&&_0x92874a[_0x4792('0x5')][_0x4792('0x6')](':')?_0x92874a[_0x4792('0x5')][_0x4792('0x7')](':')[0x0]:'';this[_0x4792('0x8')]='';this[_0x4792('0x9')]='';this[_0x4792('0xa')]='';this[_0x4792('0xb')]='';this[_0x4792('0xc')]='';this[_0x4792('0xd')]='unknown';this[_0x4792('0xe')]='';this['address']='';this[_0x4792('0xf')]=_0x92874a['defaultuser']||'';}module[_0x4792('0x10')]=Trunk; \ No newline at end of file +var _0x4f11=['port','domain','domainport','refresh','stateRegistry','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host'];(function(_0x3b1bad,_0x333e25){var _0x1dd4db=function(_0x19cf72){while(--_0x19cf72){_0x3b1bad['push'](_0x3b1bad['shift']());}};_0x1dd4db(++_0x333e25);}(_0x4f11,0xf5));var _0x14f1=function(_0x30620f,_0x29d75f){_0x30620f=_0x30620f-0x0;var _0x2397bc=_0x4f11[_0x30620f];return _0x2397bc;};'use strict';function Trunk(_0x31aec4){this['id']=_0x31aec4['id']||0x0;this[_0x14f1('0x0')]=_0x31aec4['active']||![];this[_0x14f1('0x1')]=_0x31aec4['name']||'';this[_0x14f1('0x2')]=_0x14f1('0x3');this[_0x14f1('0x4')]=0x0;this[_0x14f1('0x5')]=_0x14f1('0x3');this[_0x14f1('0x6')]=_0x31aec4[_0x14f1('0x6')]&&_0x31aec4['registry'][_0x14f1('0x7')](':')?_0x31aec4['registry'][_0x14f1('0x8')](':')[0x0]:'';this[_0x14f1('0x9')]='';this[_0x14f1('0xa')]='';this[_0x14f1('0xb')]='';this[_0x14f1('0xc')]='';this[_0x14f1('0xd')]='';this[_0x14f1('0xe')]='unknown';this['registrationtime']='';this['address']='';this[_0x14f1('0xf')]=_0x31aec4[_0x14f1('0xf')]||'';}module[_0x14f1('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 9014c84..e3b0919 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 _0x6e72=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x4df408,_0x46500f){var _0x40308f=function(_0x478229){while(--_0x478229){_0x4df408['push'](_0x4df408['shift']());}};_0x40308f(++_0x46500f);}(_0x6e72,0xa4));var _0x26e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e72[_0x14add3];return _0x4a174f;};'use strict';function voiceExtension(_0x4af276){this['id']=_0x4af276['id']||0x0;this[_0x26e7('0x0')]=_0x4af276[_0x26e7('0x0')]||'';this[_0x26e7('0x1')]=_0x4af276[_0x26e7('0x1')]||_0x26e7('0x2');this['mandatoryDisposition']=_0x4af276[_0x26e7('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x1e35=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x2f5b9d,_0x5a1816){var _0x374f7d=function(_0x26b3ef){while(--_0x26b3ef){_0x2f5b9d['push'](_0x2f5b9d['shift']());}};_0x374f7d(++_0x5a1816);}(_0x1e35,0xf7));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x5de3ae){this['id']=_0x5de3ae['id']||0x0;this[_0x51e3('0x0')]=_0x5de3ae[_0x51e3('0x0')]||'';this['recordingFormat']=_0x5de3ae[_0x51e3('0x1')]||'none';this[_0x51e3('0x2')]=_0x5de3ae[_0x51e3('0x2')]||![];}module[_0x51e3('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 2b2df64..fc5211f 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 _0xb1c0=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','abandoned','busy','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x352992,_0x320de0){var _0x18c4f3=function(_0x579c14){while(--_0x579c14){_0x352992['push'](_0x352992['shift']());}};_0x18c4f3(++_0x320de0);}(_0xb1c0,0xb8));var _0x0b1c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb1c0[_0x4e676e];return _0x336a3c;};'use strict';var monitorFormat={'wav':_0x0b1c('0x0'),'wav49':_0x0b1c('0x1'),'gsm':_0x0b1c('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x0b1c('0x3'),'linear':_0x0b1c('0x4'),'random':_0x0b1c('0x5'),'ringall':_0x0b1c('0x6'),'rr':_0x0b1c('0x7'),'rrmemory':_0x0b1c('0x8'),'rrordered':_0x0b1c('0x9'),'wrandom':'wrandom'};function VoiceQueue(_0x4d3158){this['id']=_0x4d3158['id']||0x0;this[_0x0b1c('0xa')]=_0x4d3158[_0x0b1c('0xa')]||'';this['monitor_format']=_0x4d3158[_0x0b1c('0xb')]||'';this['type']=_0x4d3158[_0x0b1c('0xc')]||_0x0b1c('0xd');this[_0x0b1c('0xe')]=0x0;this[_0x0b1c('0xf')]=0x0;this['answered']=0x0;this[_0x0b1c('0x10')]=0x0;this[_0x0b1c('0x11')]=0x0;this[_0x0b1c('0x12')]=0x0;this['unmanaged']=0x0;this[_0x0b1c('0x13')]=0x0;this['available']=0x0;this[_0x0b1c('0x14')]=0x0;this['inUse']=0x0;this[_0x0b1c('0x15')]=0x0;this[_0x0b1c('0x16')]=0x0;this[_0x0b1c('0x17')]=0x0;this[_0x0b1c('0x18')]=0x0;this[_0x0b1c('0x19')]=0x0;this[_0x0b1c('0x1a')]=0x0;this[_0x0b1c('0x1b')]=0x0;this[_0x0b1c('0x1c')]=0x0;this['unavailable']=0x0;this[_0x0b1c('0x1d')]=0x0;this['acw']=_0x4d3158[_0x0b1c('0x1e')]||![];this[_0x0b1c('0x1f')]=_0x4d3158[_0x0b1c('0x1f')]||0xa;this[_0x0b1c('0x20')]=_0x4d3158[_0x0b1c('0x20')]||'no';this[_0x0b1c('0x21')]=!![];this[_0x0b1c('0x22')]='';this['statusMessage']='';this[_0x0b1c('0x23')]=0x0;this[_0x0b1c('0x24')]=0x0;this[_0x0b1c('0x25')]=_0x4d3158[_0x0b1c('0x25')]||null;this['dialGlobalInterval']=_0x4d3158[_0x0b1c('0x26')]?_0x4d3158[_0x0b1c('0x26')]:null;this[_0x0b1c('0x27')]=_0x4d3158[_0x0b1c('0x27')];this[_0x0b1c('0x28')]=_0x4d3158[_0x0b1c('0x28')]||_0x0b1c('0x29');this[_0x0b1c('0x2a')]=_0x4d3158[_0x0b1c('0x2a')]||0x0;this[_0x0b1c('0x2b')]=_0x4d3158[_0x0b1c('0x2b')]||0x0;this[_0x0b1c('0x2c')]=_0x4d3158[_0x0b1c('0x2c')]||0x1;this[_0x0b1c('0x2d')]=_0x4d3158[_0x0b1c('0x2d')]||_0x0b1c('0x2e');this[_0x0b1c('0x2f')]=_0x4d3158['dialPredictiveOptimizationPercentage']||0.03;this[_0x0b1c('0x30')]=_0x4d3158[_0x0b1c('0x30')]||0x258;this[_0x0b1c('0x31')]=_0x4d3158[_0x0b1c('0x31')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x4d3158[_0x0b1c('0x32')]||'anonymous';this[_0x0b1c('0x33')]=_0x4d3158[_0x0b1c('0x33')]||0x1e;this['dialQueueOptions']=_0x4d3158[_0x0b1c('0x34')]||_0x0b1c('0x35');this[_0x0b1c('0x36')]=_0x4d3158[_0x0b1c('0x36')]||0x3;this[_0x0b1c('0x37')]=_0x4d3158[_0x0b1c('0x37')]||undefined;this[_0x0b1c('0x38')]=_0x4d3158[_0x0b1c('0x38')]||0x3;this[_0x0b1c('0x39')]=_0x4d3158[_0x0b1c('0x39')]||0x96;this['dialBusyMaxRetry']=_0x4d3158[_0x0b1c('0x3a')]||0x3;this['dialBusyRetryFrequency']=_0x4d3158[_0x0b1c('0x3b')]||0x96;this[_0x0b1c('0x3c')]=_0x4d3158[_0x0b1c('0x3c')]||0x3;this[_0x0b1c('0x3d')]=_0x4d3158[_0x0b1c('0x3d')]||0x96;this[_0x0b1c('0x3e')]=_0x4d3158[_0x0b1c('0x3e')]||0x3;this[_0x0b1c('0x3f')]=_0x4d3158[_0x0b1c('0x3f')]||0x96;this[_0x0b1c('0x40')]=_0x4d3158['dialDropMaxRetry']||0x3;this[_0x0b1c('0x41')]=_0x4d3158[_0x0b1c('0x41')]||0x96;this[_0x0b1c('0x42')]=_0x4d3158['dialAbandonedMaxRetry']||0x3;this[_0x0b1c('0x43')]=_0x4d3158[_0x0b1c('0x43')]||0x96;this['dialMachineMaxRetry']=_0x4d3158[_0x0b1c('0x44')]||0x3;this[_0x0b1c('0x45')]=_0x4d3158['dialMachineRetryFrequency']||0x96;this[_0x0b1c('0x46')]=_0x4d3158['dialAgentRejectMaxRetry']||0x3;this[_0x0b1c('0x47')]=_0x4d3158[_0x0b1c('0x47')]||0x96;this['callAdditionalPhoneAfterMin']=_0x4d3158[_0x0b1c('0x48')]||0x3;this[_0x0b1c('0x49')]=_0x4d3158[_0x0b1c('0x49')]||0x4;this[_0x0b1c('0x4a')]=_0x4d3158[_0x0b1c('0x4a')]?_0x4d3158[_0x0b1c('0x4a')]:undefined;this[_0x0b1c('0x4b')]=_0x4d3158[_0x0b1c('0x4b')]?_0x4d3158[_0x0b1c('0x4b')]:undefined;this[_0x0b1c('0x4c')]=_0x4d3158[_0x0b1c('0x4c')]||undefined;this[_0x0b1c('0x4d')]=_0x4d3158[_0x0b1c('0x4d')]?_0x4d3158[_0x0b1c('0x4d')]:undefined;this['dialOrderByScheduledAt']=_0x4d3158[_0x0b1c('0x4e')]||_0x0b1c('0x4f');this[_0x0b1c('0x50')]=_0x4d3158[_0x0b1c('0x50')]||undefined;this[_0x0b1c('0x51')]=_0x4d3158[_0x0b1c('0x51')]||undefined;this[_0x0b1c('0x52')]=strategy[_0x4d3158[_0x0b1c('0x52')]];this[_0x0b1c('0x53')]=!![];this[_0x0b1c('0x54')]=_0x4d3158[_0x0b1c('0x54')]||![];this[_0x0b1c('0x55')]=_0x4d3158[_0x0b1c('0x55')];this[_0x0b1c('0x56')]=_0x4d3158['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4d3158[_0x0b1c('0x57')];this['dialAMDTotalAnalysisTime']=_0x4d3158[_0x0b1c('0x58')];this[_0x0b1c('0x59')]=_0x4d3158['dialAMDMinWordLength'];this[_0x0b1c('0x5a')]=_0x4d3158[_0x0b1c('0x5a')];this[_0x0b1c('0x5b')]=_0x4d3158[_0x0b1c('0x5b')];this[_0x0b1c('0x5c')]=_0x4d3158[_0x0b1c('0x5c')];this[_0x0b1c('0x5d')]=_0x4d3158[_0x0b1c('0x5d')];this[_0x0b1c('0x5e')]=0x0;this[_0x0b1c('0x5f')]=0x0;this[_0x0b1c('0x60')]=_0x4d3158[_0x0b1c('0x60')];this['outboundAnswerCallsDay']=0x0;this[_0x0b1c('0x61')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x0b1c('0x62')]=0x0;this[_0x0b1c('0x63')]=0x0;this[_0x0b1c('0x64')]=0x0;this[_0x0b1c('0x65')]=0x0;this[_0x0b1c('0x66')]=0x0;this[_0x0b1c('0x67')]=0x0;this[_0x0b1c('0x68')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x0b1c('0x69')]=0x0;this[_0x0b1c('0x6a')]=0x0;this[_0x0b1c('0x6b')]=0x0;this[_0x0b1c('0x6c')]=undefined;this[_0x0b1c('0x6d')]=undefined;this['handlePredictive']=undefined;this[_0x0b1c('0x6e')]=1.05;this[_0x0b1c('0x6f')]=0x0;this[_0x0b1c('0x70')]=0x0;this[_0x0b1c('0x71')]=0x0;this[_0x0b1c('0x72')]=0x0;this[_0x0b1c('0x73')]=0x0;this[_0x0b1c('0x74')]=0x0;this[_0x0b1c('0x75')]=0x0;this[_0x0b1c('0x76')]=0x0;this[_0x0b1c('0x77')]=_0x4d3158[_0x0b1c('0x78')]||0x14;this['predictiveIntervalMinThreshold']=_0x4d3158['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x0b1c('0x79')]=0x0;this[_0x0b1c('0x7a')]=0x0;this[_0x0b1c('0x7b')]=0x1;this[_0x0b1c('0x7c')]=0x0;this[_0x0b1c('0x7d')]=0x0;this[_0x0b1c('0x7e')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4d3158['dialRecallMeTimeout']||0x1e;this[_0x0b1c('0x7f')]=_0x4d3158[_0x0b1c('0x7f')]||![];this[_0x0b1c('0x80')]=!!_0x4d3158['dialPreviewAutoRecallMe']||![];this[_0x0b1c('0x81')]=!!_0x4d3158[_0x0b1c('0x81')]||![];this[_0x0b1c('0x82')]=_0x4d3158[_0x0b1c('0x82')]||undefined;this[_0x0b1c('0x83')]=_0x4d3158[_0x0b1c('0x83')]||![];this[_0x0b1c('0x84')]=_0x4d3158['dialAgiAfterHangupAgent']||![];this[_0x0b1c('0xb')]=monitorFormat[_0x4d3158['monitor_format']]?monitorFormat[_0x4d3158['monitor_format']]:undefined;this[_0x0b1c('0x85')]=_0x4d3158[_0x0b1c('0x85')]||![];this[_0x0b1c('0x86')]=_0x4d3158[_0x0b1c('0x86')]?_0x4d3158['mandatoryDispositionPause']:undefined;this[_0x0b1c('0x87')]=![];}module[_0x0b1c('0x88')]=VoiceQueue; \ No newline at end of file +var _0xb567=['dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','onHold','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb567,0x19a));var _0x7b56=function(_0x1ed088,_0x33261e){_0x1ed088=_0x1ed088-0x0;var _0x438933=_0xb567[_0x1ed088];return _0x438933;};'use strict';var monitorFormat={'wav':_0x7b56('0x0'),'wav49':_0x7b56('0x1'),'gsm':_0x7b56('0x2')};var strategy={'fewestcalls':_0x7b56('0x3'),'leastrecent':_0x7b56('0x4'),'linear':_0x7b56('0x5'),'random':_0x7b56('0x6'),'ringall':'ringall','rr':_0x7b56('0x7'),'rrmemory':'rrmemory','rrordered':_0x7b56('0x8'),'wrandom':_0x7b56('0x9')};function VoiceQueue(_0x2d6101){this['id']=_0x2d6101['id']||0x0;this[_0x7b56('0xa')]=_0x2d6101[_0x7b56('0xa')]||'';this[_0x7b56('0xb')]=_0x2d6101['monitor_format']||'';this[_0x7b56('0xc')]=_0x2d6101[_0x7b56('0xc')]||_0x7b56('0xd');this[_0x7b56('0xe')]=0x0;this['total']=0x0;this[_0x7b56('0xf')]=0x0;this[_0x7b56('0x10')]=0x0;this[_0x7b56('0x11')]=0x0;this[_0x7b56('0x12')]=0x0;this[_0x7b56('0x13')]=0x0;this[_0x7b56('0x14')]=0x0;this[_0x7b56('0x15')]=0x0;this[_0x7b56('0x16')]=0x0;this[_0x7b56('0x17')]=0x0;this[_0x7b56('0x18')]=0x0;this[_0x7b56('0x19')]=0x0;this['notInUse']=0x0;this[_0x7b56('0x1a')]=0x0;this[_0x7b56('0x1b')]=0x0;this[_0x7b56('0x1c')]=0x0;this[_0x7b56('0x1d')]=0x0;this[_0x7b56('0x1e')]=0x0;this['unavailable']=0x0;this[_0x7b56('0x1f')]=0x0;this[_0x7b56('0x20')]=_0x2d6101[_0x7b56('0x20')]||![];this[_0x7b56('0x21')]=_0x2d6101[_0x7b56('0x21')]||0xa;this[_0x7b56('0x22')]=_0x2d6101['autopause']||'no';this[_0x7b56('0x23')]=!![];this[_0x7b56('0x24')]='';this[_0x7b56('0x25')]='';this[_0x7b56('0x26')]=0x0;this[_0x7b56('0x27')]=0x0;this['dialTimezone']=_0x2d6101['dialTimezone']||null;this[_0x7b56('0x28')]=_0x2d6101[_0x7b56('0x28')]?_0x2d6101[_0x7b56('0x28')]:null;this[_0x7b56('0x29')]=_0x2d6101[_0x7b56('0x29')];this[_0x7b56('0x2a')]=_0x2d6101['dialMethod']||_0x7b56('0x2b');this[_0x7b56('0x2c')]=_0x2d6101[_0x7b56('0x2c')]||0x0;this[_0x7b56('0x2d')]=_0x2d6101[_0x7b56('0x2d')]||0x0;this[_0x7b56('0x2e')]=_0x2d6101[_0x7b56('0x2e')]||0x1;this[_0x7b56('0x2f')]=_0x2d6101[_0x7b56('0x2f')]||'dropRate';this[_0x7b56('0x30')]=_0x2d6101[_0x7b56('0x30')]||0.03;this[_0x7b56('0x31')]=_0x2d6101['dialPredictiveInterval']||0x258;this[_0x7b56('0x32')]=_0x2d6101['dialOriginateCallerIdName']||_0x7b56('0x33');this['dialOriginateCallerIdNumber']=_0x2d6101[_0x7b56('0x34')]||_0x7b56('0x33');this['dialOriginateTimeout']=_0x2d6101[_0x7b56('0x35')]||0x1e;this[_0x7b56('0x36')]=_0x2d6101[_0x7b56('0x36')]||_0x7b56('0x37');this[_0x7b56('0x38')]=_0x2d6101['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x2d6101[_0x7b56('0x39')]||undefined;this['dialCongestionMaxRetry']=_0x2d6101[_0x7b56('0x3a')]||0x3;this[_0x7b56('0x3b')]=_0x2d6101['dialCongestionRetryFrequency']||0x96;this[_0x7b56('0x3c')]=_0x2d6101[_0x7b56('0x3c')]||0x3;this[_0x7b56('0x3d')]=_0x2d6101['dialBusyRetryFrequency']||0x96;this[_0x7b56('0x3e')]=_0x2d6101[_0x7b56('0x3e')]||0x3;this[_0x7b56('0x3f')]=_0x2d6101[_0x7b56('0x3f')]||0x96;this[_0x7b56('0x40')]=_0x2d6101[_0x7b56('0x40')]||0x3;this[_0x7b56('0x41')]=_0x2d6101[_0x7b56('0x41')]||0x96;this[_0x7b56('0x42')]=_0x2d6101[_0x7b56('0x42')]||0x3;this[_0x7b56('0x43')]=_0x2d6101[_0x7b56('0x43')]||0x96;this['dialAbandonedMaxRetry']=_0x2d6101['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x2d6101['dialAbandonedRetryFrequency']||0x96;this[_0x7b56('0x44')]=_0x2d6101[_0x7b56('0x44')]||0x3;this[_0x7b56('0x45')]=_0x2d6101['dialMachineRetryFrequency']||0x96;this[_0x7b56('0x46')]=_0x2d6101['dialAgentRejectMaxRetry']||0x3;this[_0x7b56('0x47')]=_0x2d6101[_0x7b56('0x47')]||0x96;this[_0x7b56('0x48')]=_0x2d6101[_0x7b56('0x48')]||0x3;this[_0x7b56('0x49')]=_0x2d6101['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x2d6101[_0x7b56('0x4a')]?_0x2d6101[_0x7b56('0x4a')]:undefined;this[_0x7b56('0x4b')]=_0x2d6101[_0x7b56('0x4b')]?_0x2d6101[_0x7b56('0x4b')]:undefined;this[_0x7b56('0x4c')]=_0x2d6101['dialPrefix']||undefined;this['Interval']=_0x2d6101[_0x7b56('0x4d')]?_0x2d6101['Interval']:undefined;this[_0x7b56('0x4e')]=_0x2d6101[_0x7b56('0x4e')]||_0x7b56('0x4f');this[_0x7b56('0x50')]=_0x2d6101[_0x7b56('0x50')]||undefined;this[_0x7b56('0x51')]=_0x2d6101['dialCutDigit']||undefined;this[_0x7b56('0x52')]=strategy[_0x2d6101[_0x7b56('0x52')]];this[_0x7b56('0x53')]=!![];this[_0x7b56('0x54')]=_0x2d6101[_0x7b56('0x54')]||![];this['dialAMDInitialSilence']=_0x2d6101[_0x7b56('0x55')];this['dialAMDGreeting']=_0x2d6101[_0x7b56('0x56')];this[_0x7b56('0x57')]=_0x2d6101[_0x7b56('0x57')];this[_0x7b56('0x58')]=_0x2d6101['dialAMDTotalAnalysisTime'];this[_0x7b56('0x59')]=_0x2d6101[_0x7b56('0x59')];this[_0x7b56('0x5a')]=_0x2d6101[_0x7b56('0x5a')];this['dialAMDMaximumNumberOfWords']=_0x2d6101[_0x7b56('0x5b')];this[_0x7b56('0x5c')]=_0x2d6101[_0x7b56('0x5c')];this['dialAMDMaximumWordLength']=_0x2d6101[_0x7b56('0x5d')];this[_0x7b56('0x5e')]=0x0;this[_0x7b56('0x5f')]=0x0;this[_0x7b56('0x60')]=_0x2d6101[_0x7b56('0x60')];this[_0x7b56('0x61')]=0x0;this[_0x7b56('0x62')]=0x0;this[_0x7b56('0x63')]=0x0;this[_0x7b56('0x64')]=0x0;this[_0x7b56('0x65')]=0x0;this[_0x7b56('0x66')]=0x0;this[_0x7b56('0x67')]=0x0;this[_0x7b56('0x68')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x7b56('0x69')]=0x0;this[_0x7b56('0x6a')]=0x0;this['outboundReCallsDay']=0x0;this[_0x7b56('0x6b')]=0x0;this[_0x7b56('0x6c')]=undefined;this[_0x7b56('0x6d')]=undefined;this[_0x7b56('0x6e')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7b56('0x6f')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x7b56('0x70')]=0x0;this[_0x7b56('0x71')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x7b56('0x72')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x7b56('0x73')]=0x0;this[_0x7b56('0x74')]=_0x2d6101[_0x7b56('0x75')]||0x14;this['predictiveIntervalMinThreshold']=_0x2d6101['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x7b56('0x76')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x7b56('0x77')]=0x1;this[_0x7b56('0x78')]=0x0;this[_0x7b56('0x79')]=0x0;this[_0x7b56('0x7a')]=0x0;this[_0x7b56('0x7b')]=0x0;this[_0x7b56('0x7c')]=_0x2d6101[_0x7b56('0x7c')]||0x1e;this['dialRecallInQueue']=_0x2d6101[_0x7b56('0x7d')]||![];this[_0x7b56('0x7e')]=!!_0x2d6101[_0x7b56('0x7e')]||![];this['dialPreviewRecallmeReminder']=!!_0x2d6101['dialPreviewRecallmeReminder']||![];this[_0x7b56('0x7f')]=_0x2d6101['dialQueueProject2']||undefined;this[_0x7b56('0x80')]=_0x2d6101[_0x7b56('0x80')]||![];this[_0x7b56('0x81')]=_0x2d6101[_0x7b56('0x81')]||![];this[_0x7b56('0xb')]=monitorFormat[_0x2d6101[_0x7b56('0xb')]]?monitorFormat[_0x2d6101[_0x7b56('0xb')]]:undefined;this[_0x7b56('0x82')]=_0x2d6101[_0x7b56('0x82')]||![];this['mandatoryDispositionPause']=_0x2d6101['mandatoryDispositionPause']?_0x2d6101[_0x7b56('0x83')]:undefined;this[_0x7b56('0x84')]=![];}module[_0x7b56('0x85')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index e8139c8..8b340d6 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','callerid','createReport','loggedin','callers','length','SIP/','online','status','keys','queue','dialer','exten','xcally-motion-preview','some','prototype','dialActive','active','updateReportFromOutboundQueue','outboundAbandonedCallsDay','outboundBusyCallsDay','preview','exports','available','loggedIn','loggedInDb','ringing','waiting','inUse','originated','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','talking','sumBillable','sumDuration','total','strategy','abandoned','answered','busy','invalid','onHold'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x466594,_0x58bbfe){_0x466594=_0x466594-0x0;var _0x1e03f4=_0xdc97[_0x466594];return _0x1e03f4;};'use strict';var INBOUND_COUNTERS=[_0x7dc9('0x0'),_0x7dc9('0x1'),_0x7dc9('0x2'),'paused',_0x7dc9('0x3'),'talking',_0x7dc9('0x4')];var OUTBOUND_COUNTERS=[_0x7dc9('0x0'),'answered',_0x7dc9('0x5'),_0x7dc9('0x1'),_0x7dc9('0x2'),_0x7dc9('0x6'),'outboundAbandonedCallsDay',_0x7dc9('0x7'),'outboundBlacklistCallsDay','outboundBusyCallsDay',_0x7dc9('0x8'),_0x7dc9('0x9'),_0x7dc9('0xa'),_0x7dc9('0xb'),_0x7dc9('0xc'),'outboundUnknownCallsDay',_0x7dc9('0xd'),_0x7dc9('0xe'),_0x7dc9('0xf'),_0x7dc9('0x10'),_0x7dc9('0x11'),_0x7dc9('0x12'),_0x7dc9('0x4')];function VoiceQueueSummary(_0x4e8e65){this['id']=_0x4e8e65['id'];this['name']=_0x4e8e65['name'];this['strategy']=_0x4e8e65[_0x7dc9('0x13')];this[_0x7dc9('0x14')]=_0x4e8e65['abandoned']||0x0;this[_0x7dc9('0x15')]=_0x4e8e65[_0x7dc9('0x15')]||0x0;this[_0x7dc9('0x0')]=_0x4e8e65[_0x7dc9('0x0')]||0x0;this[_0x7dc9('0x16')]=_0x4e8e65[_0x7dc9('0x16')]||0x0;this['inUse']=_0x4e8e65[_0x7dc9('0x5')]||0x0;this[_0x7dc9('0x17')]=_0x4e8e65[_0x7dc9('0x17')]||0x0;this[_0x7dc9('0x1')]=_0x4e8e65[_0x7dc9('0x1')]||0x0;this[_0x7dc9('0x2')]=_0x4e8e65[_0x7dc9('0x2')]||0x0;this[_0x7dc9('0x18')]=_0x4e8e65[_0x7dc9('0x18')]||0x0;this['notInUse']=_0x4e8e65[_0x7dc9('0x19')]||0x0;this['paused']=_0x4e8e65[_0x7dc9('0xd')]||0x0;this[_0x7dc9('0x3')]=_0x4e8e65['ringing']||0x0;this[_0x7dc9('0x1a')]=_0x4e8e65[_0x7dc9('0x1a')];this[_0x7dc9('0x10')]=_0x4e8e65[_0x7dc9('0x10')];this[_0x7dc9('0x11')]=_0x4e8e65[_0x7dc9('0x11')];this[_0x7dc9('0x1b')]=_0x4e8e65[_0x7dc9('0x1b')]||0x0;this[_0x7dc9('0xf')]=_0x4e8e65[_0x7dc9('0xf')]||0x0;this['total']=_0x4e8e65['total']||0x0;this[_0x7dc9('0x1c')]=_0x4e8e65[_0x7dc9('0x1c')];this['unavailable']=_0x4e8e65[_0x7dc9('0x1d')]||0x0;this[_0x7dc9('0x1e')]=_0x4e8e65['unknown']||0x0;this[_0x7dc9('0x1f')]=_0x4e8e65[_0x7dc9('0x1f')]||0x0;this[_0x7dc9('0x4')]=_0x4e8e65['waiting']||0x0;if(_0x4e8e65[_0x7dc9('0x1c')]===_0x7dc9('0x20')){this[_0x7dc9('0xe')]=_0x4e8e65['pTalking']||0x0;this['dialActive']=_0x4e8e65['dialActive'];this[_0x7dc9('0x21')]=_0x4e8e65[_0x7dc9('0x21')];this['dialOriginateCallerIdName']=_0x4e8e65['dialOriginateCallerIdName'];this[_0x7dc9('0x22')]=_0x4e8e65['dialOriginateCallerIdNumber'];this[_0x7dc9('0x23')]=_0x4e8e65[_0x7dc9('0x23')];this[_0x7dc9('0x24')]=_0x4e8e65[_0x7dc9('0x24')];this[_0x7dc9('0x25')]=_0x4e8e65[_0x7dc9('0x25')];this[_0x7dc9('0x26')]=_0x4e8e65[_0x7dc9('0x26')];this[_0x7dc9('0x7')]=_0x4e8e65[_0x7dc9('0x7')];this[_0x7dc9('0x27')]=_0x4e8e65[_0x7dc9('0x27')];this['outboundBusyCallsDay']=_0x4e8e65['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x4e8e65['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x4e8e65['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x4e8e65['outboundDropCallsDayCallersExit'];this[_0x7dc9('0x28')]=_0x4e8e65[_0x7dc9('0x28')];this[_0x7dc9('0x9')]=_0x4e8e65[_0x7dc9('0x9')];this[_0x7dc9('0xa')]=_0x4e8e65[_0x7dc9('0xa')];this['outboundOriginateFailureCallsDay']=_0x4e8e65['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x4e8e65[_0x7dc9('0xb')];this['outboundRejectCallsDay']=_0x4e8e65[_0x7dc9('0xc')];this[_0x7dc9('0x29')]=_0x4e8e65[_0x7dc9('0x29')];this[_0x7dc9('0x2a')]=_0x4e8e65[_0x7dc9('0x2a')];this[_0x7dc9('0x2b')]=_0x4e8e65[_0x7dc9('0x2b')];this[_0x7dc9('0x2c')]=_0x4e8e65['predictiveIntervalAvgTalktime'];this[_0x7dc9('0x2d')]=_0x4e8e65['predictiveIntervalDroppedCallsCallersExit'];this[_0x7dc9('0x2e')]=_0x4e8e65[_0x7dc9('0x2e')];this[_0x7dc9('0x2f')]=_0x4e8e65[_0x7dc9('0x2f')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x4e8e65[_0x7dc9('0x30')];this['predictiveIntervalHitRate']=_0x4e8e65[_0x7dc9('0x31')];this['predictiveIntervalMultiplicativeFactor']=_0x4e8e65['predictiveIntervalMultiplicativeFactor'];this[_0x7dc9('0x32')]=_0x4e8e65[_0x7dc9('0x32')];this[_0x7dc9('0x33')]=_0x4e8e65[_0x7dc9('0x33')];this['predictiveIntervalTotalCalls']=_0x4e8e65[_0x7dc9('0x34')];this[_0x7dc9('0x6')]=_0x4e8e65[_0x7dc9('0x6')];this[_0x7dc9('0x35')]=_0x4e8e65[_0x7dc9('0x35')];this[_0x7dc9('0x36')]=_0x4e8e65[_0x7dc9('0x36')];this[_0x7dc9('0x37')]=_0x4e8e65[_0x7dc9('0x37')];this[_0x7dc9('0x38')]=_0x4e8e65[_0x7dc9('0x38')];this[_0x7dc9('0x39')]=_0x4e8e65['startPredictive'];this[_0x7dc9('0x3a')]=_0x4e8e65[_0x7dc9('0x3a')];this[_0x7dc9('0x3b')]=_0x4e8e65[_0x7dc9('0x3b')];this['statusMessage']=_0x4e8e65[_0x7dc9('0x3c')];}if(_0x4e8e65[_0x7dc9('0x3d')]){this[_0x7dc9('0x3d')]={'id':_0x4e8e65[_0x7dc9('0x3d')]['id'],'name':_0x4e8e65[_0x7dc9('0x3d')][_0x7dc9('0x3e')],'active':_0x4e8e65['Trunk']['active'],'callerid':_0x4e8e65[_0x7dc9('0x3d')][_0x7dc9('0x3f')]};}}VoiceQueueSummary['prototype'][_0x7dc9('0x40')]=function(_0x4a37ec,_0x315d65,_0x2a91fe,_0x3bca9c){this['loggedInDb']=0x0;this[_0x7dc9('0xf')]=0x0;this[_0x7dc9('0xd')]=0x0;this[_0x7dc9('0x1e')]=0x0;this[_0x7dc9('0x19')]=0x0;this[_0x7dc9('0x5')]=0x0;this[_0x7dc9('0x16')]=0x0;this[_0x7dc9('0x17')]=0x0;this['unavailable']=0x0;this[_0x7dc9('0x3')]=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x2a91fe){if(_0x2a91fe[_0x7dc9('0x0')]){this[_0x7dc9('0x0')]=Number(_0x2a91fe[_0x7dc9('0x0')]);}if(_0x2a91fe[_0x7dc9('0x41')]){this[_0x7dc9('0x1')]=Number(_0x2a91fe[_0x7dc9('0x41')]);}if(_0x2a91fe[_0x7dc9('0x42')]){this[_0x7dc9('0x4')]=Number(_0x2a91fe[_0x7dc9('0x42')]);}}for(var _0x573b48=0x0;_0x573b48<_0x4a37ec[_0x7dc9('0x43')];_0x573b48++){var _0x1971c7=_0x315d65[_0x7dc9('0x44')+_0x4a37ec[_0x573b48][_0x7dc9('0x3e')]];if(_0x1971c7&&_0x1971c7[_0x7dc9('0x45')]){this[_0x7dc9('0x2')]+=0x1;}if(_0x4a37ec[_0x573b48]['incall']==='1'){this[_0x7dc9('0xf')]+=0x1;}if(_0x4a37ec[_0x573b48][_0x7dc9('0xd')]==='1'&&!['2','7','8']['includes'](_0x4a37ec[_0x573b48][_0x7dc9('0x46')])){this[_0x7dc9('0xd')]+=0x1;}switch(_0x4a37ec[_0x573b48][_0x7dc9('0x46')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x7dc9('0x19')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x7dc9('0x17')]+=0x1;break;case'5':this[_0x7dc9('0x1d')]+=0x1;break;case'6':this[_0x7dc9('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x7dc9('0x21')]==='booked'){var _0xad7278=Object[_0x7dc9('0x47')](_0x3bca9c);for(var _0x5e2d59=0x0;_0x5e2d59<_0xad7278[_0x7dc9('0x43')];_0x5e2d59++){var _0x1d6c0a=_0xad7278[_0x5e2d59];var _0x1f2a6e=_0x3bca9c[_0x1d6c0a];if(_0x1f2a6e[_0x7dc9('0x48')]===this[_0x7dc9('0x3e')]&&_0x1f2a6e[_0x7dc9('0x1c')]===_0x7dc9('0x49')&&_0x1f2a6e[_0x7dc9('0x4a')]===_0x7dc9('0x4b')){this[_0x7dc9('0xf')]+=0x1;}}if(this[_0x7dc9('0xf')]>this[_0x7dc9('0x5')]){this[_0x7dc9('0xf')]=this['inUse'];}this[_0x7dc9('0xe')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x446103){var _0x22423e=![];if(_0x446103){_0x22423e=INBOUND_COUNTERS[_0x7dc9('0x4c')](function(_0x3902aa){return this[_0x3902aa]!==_0x446103[_0x3902aa];},this);}return _0x22423e;};VoiceQueueSummary[_0x7dc9('0x4d')]['compareToOutboundQueue']=function(_0x1ae85b){var _0x2b2142=![];var _0x34f7b1=![];var _0x4a9b75=![];if(_0x1ae85b){_0x2b2142=this[_0x7dc9('0x21')]!==_0x1ae85b[_0x7dc9('0x21')]||this[_0x7dc9('0x4e')]!==_0x1ae85b[_0x7dc9('0x4e')]||this[_0x7dc9('0x3b')]!==_0x1ae85b[_0x7dc9('0x3b')]||this['statusMessage']!==_0x1ae85b[_0x7dc9('0x3c')];_0x34f7b1=OUTBOUND_COUNTERS[_0x7dc9('0x4c')](function(_0x2b0941){return this[_0x2b0941]!==_0x1ae85b[_0x2b0941];},this);if(this[_0x7dc9('0x3d')]&&_0x1ae85b[_0x7dc9('0x3d')]){_0x4a9b75=this[_0x7dc9('0x3d')][_0x7dc9('0x3e')]!==_0x1ae85b[_0x7dc9('0x3d')][_0x7dc9('0x3e')]||this[_0x7dc9('0x3d')][_0x7dc9('0x4f')]!==_0x1ae85b[_0x7dc9('0x3d')]['active'];}}return _0x2b2142||_0x34f7b1||_0x4a9b75;};VoiceQueueSummary[_0x7dc9('0x4d')][_0x7dc9('0x50')]=function(_0x38df9a){this[_0x7dc9('0x15')]=_0x38df9a[_0x7dc9('0x15')];this['message']=_0x38df9a[_0x7dc9('0x3b')];this[_0x7dc9('0x3c')]=_0x38df9a[_0x7dc9('0x3c')];this[_0x7dc9('0x6')]=_0x38df9a[_0x7dc9('0x6')];this[_0x7dc9('0x51')]=_0x38df9a['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x38df9a['outboundAnswerCallsDay'];this[_0x7dc9('0x27')]=_0x38df9a[_0x7dc9('0x27')];this[_0x7dc9('0x52')]=_0x38df9a[_0x7dc9('0x52')];this['outboundCongestionCallsDay']=_0x38df9a['outboundCongestionCallsDay'];this[_0x7dc9('0x9')]=_0x38df9a[_0x7dc9('0x9')];this[_0x7dc9('0xa')]=_0x38df9a[_0x7dc9('0xa')];this[_0x7dc9('0xb')]=_0x38df9a[_0x7dc9('0xb')];this[_0x7dc9('0xc')]=_0x38df9a['outboundRejectCallsDay'];this[_0x7dc9('0x29')]=_0x38df9a[_0x7dc9('0x29')];this[_0x7dc9('0x10')]=_0x38df9a[_0x7dc9('0x10')];this[_0x7dc9('0x11')]=_0x38df9a['sumDuration'];this[_0x7dc9('0x12')]=_0x38df9a[_0x7dc9('0x12')];if(this[_0x7dc9('0x21')]===_0x7dc9('0x53')){this[_0x7dc9('0xe')]=_0x38df9a[_0x7dc9('0xe')];}};module[_0x7dc9('0x54')]=VoiceQueueSummary; \ No newline at end of file +var _0x4cfd=['online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','prototype','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','available','loggedIn','paused','ringing','talking','waiting','answered','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialMethod','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','loggedin','length'];(function(_0x25eb47,_0x1dcf4f){var _0x4ff34e=function(_0x111500){while(--_0x111500){_0x25eb47['push'](_0x25eb47['shift']());}};_0x4ff34e(++_0x1dcf4f);}(_0x4cfd,0x170));var _0xd4cf=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x4cfd[_0x19b3f9];return _0x18c3f6;};'use strict';var INBOUND_COUNTERS=[_0xd4cf('0x0'),_0xd4cf('0x1'),'loggedInDb',_0xd4cf('0x2'),_0xd4cf('0x3'),_0xd4cf('0x4'),_0xd4cf('0x5')];var OUTBOUND_COUNTERS=[_0xd4cf('0x0'),_0xd4cf('0x6'),'inUse',_0xd4cf('0x1'),_0xd4cf('0x7'),_0xd4cf('0x8'),_0xd4cf('0x9'),_0xd4cf('0xa'),_0xd4cf('0xb'),'outboundBusyCallsDay',_0xd4cf('0xc'),_0xd4cf('0xd'),_0xd4cf('0xe'),_0xd4cf('0xf'),_0xd4cf('0x10'),_0xd4cf('0x11'),_0xd4cf('0x2'),'pTalking',_0xd4cf('0x4'),_0xd4cf('0x12'),_0xd4cf('0x13'),_0xd4cf('0x14'),_0xd4cf('0x5')];function VoiceQueueSummary(_0x5104da){this['id']=_0x5104da['id'];this['name']=_0x5104da[_0xd4cf('0x15')];this[_0xd4cf('0x16')]=_0x5104da['strategy'];this[_0xd4cf('0x17')]=_0x5104da['abandoned']||0x0;this[_0xd4cf('0x6')]=_0x5104da['answered']||0x0;this[_0xd4cf('0x0')]=_0x5104da[_0xd4cf('0x0')]||0x0;this['busy']=_0x5104da[_0xd4cf('0x18')]||0x0;this[_0xd4cf('0x19')]=_0x5104da[_0xd4cf('0x19')]||0x0;this[_0xd4cf('0x1a')]=_0x5104da[_0xd4cf('0x1a')]||0x0;this[_0xd4cf('0x1')]=_0x5104da['loggedIn']||0x0;this[_0xd4cf('0x7')]=_0x5104da[_0xd4cf('0x7')]||0x0;this[_0xd4cf('0x1b')]=_0x5104da[_0xd4cf('0x1b')]||0x0;this[_0xd4cf('0x1c')]=_0x5104da[_0xd4cf('0x1c')]||0x0;this[_0xd4cf('0x2')]=_0x5104da[_0xd4cf('0x2')]||0x0;this[_0xd4cf('0x3')]=_0x5104da[_0xd4cf('0x3')]||0x0;this[_0xd4cf('0x1d')]=_0x5104da[_0xd4cf('0x1d')];this[_0xd4cf('0x12')]=_0x5104da[_0xd4cf('0x12')];this[_0xd4cf('0x13')]=_0x5104da[_0xd4cf('0x13')];this[_0xd4cf('0x1e')]=_0x5104da[_0xd4cf('0x1e')]||0x0;this[_0xd4cf('0x4')]=_0x5104da['talking']||0x0;this[_0xd4cf('0x14')]=_0x5104da['total']||0x0;this['type']=_0x5104da[_0xd4cf('0x1f')];this[_0xd4cf('0x20')]=_0x5104da[_0xd4cf('0x20')]||0x0;this[_0xd4cf('0x21')]=_0x5104da[_0xd4cf('0x21')]||0x0;this[_0xd4cf('0x22')]=_0x5104da['unmanaged']||0x0;this[_0xd4cf('0x5')]=_0x5104da['waiting']||0x0;if(_0x5104da[_0xd4cf('0x1f')]===_0xd4cf('0x23')){this[_0xd4cf('0x24')]=_0x5104da['pTalking']||0x0;this['dialActive']=_0x5104da['dialActive'];this[_0xd4cf('0x25')]=_0x5104da[_0xd4cf('0x25')];this['dialOriginateCallerIdName']=_0x5104da['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x5104da[_0xd4cf('0x26')];this['dialOriginateTimeout']=_0x5104da['dialOriginateTimeout'];this['dialPrefix']=_0x5104da[_0xd4cf('0x27')];this['temp']=_0x5104da[_0xd4cf('0x28')];this[_0xd4cf('0x29')]=_0x5104da[_0xd4cf('0x29')];this[_0xd4cf('0xa')]=_0x5104da[_0xd4cf('0xa')];this[_0xd4cf('0xb')]=_0x5104da[_0xd4cf('0xb')];this[_0xd4cf('0x2a')]=_0x5104da['outboundBusyCallsDay'];this[_0xd4cf('0xc')]=_0x5104da[_0xd4cf('0xc')];this[_0xd4cf('0x2b')]=_0x5104da['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x5104da[_0xd4cf('0x2c')];this[_0xd4cf('0x2d')]=_0x5104da[_0xd4cf('0x2d')];this[_0xd4cf('0xd')]=_0x5104da[_0xd4cf('0xd')];this[_0xd4cf('0xe')]=_0x5104da[_0xd4cf('0xe')];this[_0xd4cf('0x2e')]=_0x5104da['outboundOriginateFailureCallsDay'];this[_0xd4cf('0xf')]=_0x5104da[_0xd4cf('0xf')];this[_0xd4cf('0x10')]=_0x5104da[_0xd4cf('0x10')];this[_0xd4cf('0x11')]=_0x5104da[_0xd4cf('0x11')];this[_0xd4cf('0x2f')]=_0x5104da[_0xd4cf('0x2f')];this[_0xd4cf('0x30')]=_0x5104da[_0xd4cf('0x30')];this[_0xd4cf('0x31')]=_0x5104da[_0xd4cf('0x31')];this[_0xd4cf('0x32')]=_0x5104da['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x5104da[_0xd4cf('0x33')];this[_0xd4cf('0x34')]=_0x5104da[_0xd4cf('0x34')];this[_0xd4cf('0x35')]=_0x5104da[_0xd4cf('0x35')];this[_0xd4cf('0x36')]=_0x5104da[_0xd4cf('0x36')];this[_0xd4cf('0x37')]=_0x5104da['predictiveIntervalMultiplicativeFactor'];this[_0xd4cf('0x38')]=_0x5104da[_0xd4cf('0x38')];this[_0xd4cf('0x39')]=_0x5104da['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x5104da[_0xd4cf('0x3a')];this[_0xd4cf('0x8')]=_0x5104da[_0xd4cf('0x8')];this[_0xd4cf('0x3b')]=_0x5104da['erlangCalls'];this[_0xd4cf('0x3c')]=_0x5104da[_0xd4cf('0x3c')];this[_0xd4cf('0x3d')]=_0x5104da[_0xd4cf('0x3d')];this['erlangBusyFactor']=_0x5104da['erlangBusyFactor'];this['startPredictive']=_0x5104da[_0xd4cf('0x3e')];this[_0xd4cf('0x3f')]=_0x5104da[_0xd4cf('0x3f')];this[_0xd4cf('0x40')]=_0x5104da[_0xd4cf('0x40')];this[_0xd4cf('0x41')]=_0x5104da[_0xd4cf('0x41')];}if(_0x5104da[_0xd4cf('0x42')]){this['Trunk']={'id':_0x5104da['Trunk']['id'],'name':_0x5104da['Trunk'][_0xd4cf('0x15')],'active':_0x5104da['Trunk'][_0xd4cf('0x43')],'callerid':_0x5104da[_0xd4cf('0x42')][_0xd4cf('0x44')]};}}VoiceQueueSummary['prototype'][_0xd4cf('0x45')]=function(_0x1ee4e2,_0x5c0a07,_0x44dda0,_0x4b8b75){this[_0xd4cf('0x7')]=0x0;this['talking']=0x0;this[_0xd4cf('0x2')]=0x0;this[_0xd4cf('0x21')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this['busy']=0x0;this[_0xd4cf('0x1a')]=0x0;this[_0xd4cf('0x20')]=0x0;this[_0xd4cf('0x3')]=0x0;this[_0xd4cf('0x1d')]=0x0;this[_0xd4cf('0x1b')]=0x0;if(_0x44dda0){if(_0x44dda0[_0xd4cf('0x0')]){this['available']=Number(_0x44dda0[_0xd4cf('0x0')]);}if(_0x44dda0[_0xd4cf('0x46')]){this[_0xd4cf('0x1')]=Number(_0x44dda0[_0xd4cf('0x46')]);}if(_0x44dda0['callers']){this[_0xd4cf('0x5')]=Number(_0x44dda0['callers']);}}for(var _0x3f63b4=0x0;_0x3f63b4<_0x1ee4e2[_0xd4cf('0x47')];_0x3f63b4++){var _0x5b00e8=_0x5c0a07['SIP/'+_0x1ee4e2[_0x3f63b4][_0xd4cf('0x15')]];if(_0x5b00e8&&_0x5b00e8[_0xd4cf('0x48')]){this['loggedInDb']+=0x1;}if(_0x1ee4e2[_0x3f63b4][_0xd4cf('0x49')]==='1'){this[_0xd4cf('0x4')]+=0x1;}if(_0x1ee4e2[_0x3f63b4][_0xd4cf('0x2')]==='1'&&!['2','7','8'][_0xd4cf('0x4a')](_0x1ee4e2[_0x3f63b4][_0xd4cf('0x4b')])){this['paused']+=0x1;}switch(_0x1ee4e2[_0x3f63b4][_0xd4cf('0x4b')]){case'0':this[_0xd4cf('0x21')]+=0x1;break;case'1':this[_0xd4cf('0x1c')]+=0x1;break;case'2':this[_0xd4cf('0x19')]+=0x1;break;case'3':this[_0xd4cf('0x18')]+=0x1;break;case'4':this[_0xd4cf('0x1a')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xd4cf('0x3')]+=0x1;break;case'7':this[_0xd4cf('0x1d')]+=0x1;break;case'8':this[_0xd4cf('0x1b')]+=0x1;break;}}if(this[_0xd4cf('0x25')]===_0xd4cf('0x4c')){var _0x49d58a=Object[_0xd4cf('0x4d')](_0x4b8b75);for(var _0x532c7b=0x0;_0x532c7b<_0x49d58a[_0xd4cf('0x47')];_0x532c7b++){var _0x28098e=_0x49d58a[_0x532c7b];var _0x22a1eb=_0x4b8b75[_0x28098e];if(_0x22a1eb[_0xd4cf('0x4e')]===this['name']&&_0x22a1eb[_0xd4cf('0x1f')]===_0xd4cf('0x4f')&&_0x22a1eb[_0xd4cf('0x50')]===_0xd4cf('0x51')){this[_0xd4cf('0x4')]+=0x1;}}if(this[_0xd4cf('0x4')]>this[_0xd4cf('0x19')]){this['talking']=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xd4cf('0x52')][_0xd4cf('0x53')]=function(_0x454a2d){var _0xb06837=![];if(_0x454a2d){_0xb06837=INBOUND_COUNTERS[_0xd4cf('0x54')](function(_0x4934a0){return this[_0x4934a0]!==_0x454a2d[_0x4934a0];},this);}return _0xb06837;};VoiceQueueSummary['prototype'][_0xd4cf('0x55')]=function(_0x59b23e){var _0x374406=![];var _0xde3151=![];var _0x525f38=![];if(_0x59b23e){_0x374406=this[_0xd4cf('0x25')]!==_0x59b23e[_0xd4cf('0x25')]||this['dialActive']!==_0x59b23e['dialActive']||this['message']!==_0x59b23e['message']||this[_0xd4cf('0x41')]!==_0x59b23e[_0xd4cf('0x41')];_0xde3151=OUTBOUND_COUNTERS['some'](function(_0xc09094){return this[_0xc09094]!==_0x59b23e[_0xc09094];},this);if(this['Trunk']&&_0x59b23e['Trunk']){_0x525f38=this[_0xd4cf('0x42')][_0xd4cf('0x15')]!==_0x59b23e[_0xd4cf('0x42')][_0xd4cf('0x15')]||this[_0xd4cf('0x42')][_0xd4cf('0x43')]!==_0x59b23e[_0xd4cf('0x42')][_0xd4cf('0x43')];}}return _0x374406||_0xde3151||_0x525f38;};VoiceQueueSummary[_0xd4cf('0x52')][_0xd4cf('0x56')]=function(_0x47605a){this[_0xd4cf('0x6')]=_0x47605a[_0xd4cf('0x6')];this['message']=_0x47605a[_0xd4cf('0x40')];this[_0xd4cf('0x41')]=_0x47605a[_0xd4cf('0x41')];this[_0xd4cf('0x8')]=_0x47605a[_0xd4cf('0x8')];this[_0xd4cf('0x9')]=_0x47605a['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x47605a[_0xd4cf('0xa')];this[_0xd4cf('0xb')]=_0x47605a[_0xd4cf('0xb')];this[_0xd4cf('0x2a')]=_0x47605a[_0xd4cf('0x2a')];this[_0xd4cf('0xc')]=_0x47605a[_0xd4cf('0xc')];this[_0xd4cf('0xd')]=_0x47605a[_0xd4cf('0xd')];this[_0xd4cf('0xe')]=_0x47605a[_0xd4cf('0xe')];this[_0xd4cf('0xf')]=_0x47605a[_0xd4cf('0xf')];this['outboundRejectCallsDay']=_0x47605a[_0xd4cf('0x10')];this[_0xd4cf('0x11')]=_0x47605a[_0xd4cf('0x11')];this[_0xd4cf('0x12')]=_0x47605a[_0xd4cf('0x12')];this[_0xd4cf('0x13')]=_0x47605a[_0xd4cf('0x13')];this[_0xd4cf('0x14')]=_0x47605a[_0xd4cf('0x14')];if(this[_0xd4cf('0x25')]===_0xd4cf('0x57')){this[_0xd4cf('0x24')]=_0x47605a[_0xd4cf('0x24')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 92980d3..a346fb0 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 _0x64da=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1a5687,_0xc2188f){var _0x257d5c=function(_0x4a1783){while(--_0x4a1783){_0x1a5687['push'](_0x1a5687['shift']());}};_0x257d5c(++_0xc2188f);}(_0x64da,0x76));var _0xa64d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x64da[_0xa464c9];return _0x3d73c4;};'use strict';function VtigerAccount(_0x2c95e7){this['id']=_0x2c95e7['id']||0x0;this[_0xa64d('0x0')]=_0x2c95e7['name']||'';this[_0xa64d('0x1')]=_0x2c95e7[_0xa64d('0x1')]||'';this[_0xa64d('0x2')]=_0x2c95e7[_0xa64d('0x2')]||'';this['remoteUri']=_0x2c95e7[_0xa64d('0x3')]||'';this[_0xa64d('0x4')]=_0x2c95e7['serverUrl']||'';this['Configurations']=_0x2c95e7[_0xa64d('0x5')]||{};}module[_0xa64d('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd099=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd099,0x1d7));var _0x9d09=function(_0x49fcfc,_0x104175){_0x49fcfc=_0x49fcfc-0x0;var _0x4ab162=_0xd099[_0x49fcfc];return _0x4ab162;};'use strict';function VtigerAccount(_0x12d3a0){this['id']=_0x12d3a0['id']||0x0;this[_0x9d09('0x0')]=_0x12d3a0[_0x9d09('0x0')]||'';this['username']=_0x12d3a0[_0x9d09('0x1')]||'';this[_0x9d09('0x2')]=_0x12d3a0['accessKey']||'';this[_0x9d09('0x3')]=_0x12d3a0[_0x9d09('0x3')]||'';this[_0x9d09('0x4')]=_0x12d3a0[_0x9d09('0x4')]||'';this['Configurations']=_0x12d3a0[_0x9d09('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index af7c6fd..5828a57 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 _0x053f=['password','token','remoteUri','authType','type','integrationTab','serverUrl','exports','name','username'];(function(_0x21f078,_0x26fbe3){var _0x1f4967=function(_0x362bcc){while(--_0x362bcc){_0x21f078['push'](_0x21f078['shift']());}};_0x1f4967(++_0x26fbe3);}(_0x053f,0xbc));var _0xf053=function(_0x544f53,_0x816985){_0x544f53=_0x544f53-0x0;var _0x3704b7=_0x053f[_0x544f53];return _0x3704b7;};'use strict';function ZendeskAccount(_0x2cc51d){this['id']=_0x2cc51d['id']||0x0;this[_0xf053('0x0')]=_0x2cc51d[_0xf053('0x0')]||'';this[_0xf053('0x1')]=_0x2cc51d[_0xf053('0x1')]||'';this['password']=_0x2cc51d[_0xf053('0x2')]||'';this[_0xf053('0x3')]=_0x2cc51d['token']||'';this[_0xf053('0x4')]=_0x2cc51d[_0xf053('0x4')]||'';this[_0xf053('0x5')]=_0x2cc51d[_0xf053('0x5')]||'';this['type']=_0x2cc51d[_0xf053('0x6')]||_0xf053('0x7');this[_0xf053('0x8')]=_0x2cc51d[_0xf053('0x8')]||'';this['Configurations']=_0x2cc51d['Configurations']||{};}module[_0xf053('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xefcf=['exports','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0xb3078c,_0x1d073d){var _0x43ae91=function(_0x1338d5){while(--_0x1338d5){_0xb3078c['push'](_0xb3078c['shift']());}};_0x43ae91(++_0x1d073d);}(_0xefcf,0x121));var _0xfefc=function(_0x11cf32,_0x560d24){_0x11cf32=_0x11cf32-0x0;var _0x163a94=_0xefcf[_0x11cf32];return _0x163a94;};'use strict';function ZendeskAccount(_0x3602c1){this['id']=_0x3602c1['id']||0x0;this['name']=_0x3602c1['name']||'';this[_0xfefc('0x0')]=_0x3602c1[_0xfefc('0x0')]||'';this[_0xfefc('0x1')]=_0x3602c1[_0xfefc('0x1')]||'';this[_0xfefc('0x2')]=_0x3602c1[_0xfefc('0x2')]||'';this[_0xfefc('0x3')]=_0x3602c1[_0xfefc('0x3')]||'';this[_0xfefc('0x4')]=_0x3602c1['authType']||'';this['type']=_0x3602c1[_0xfefc('0x5')]||'integrationTab';this[_0xfefc('0x6')]=_0x3602c1[_0xfefc('0x6')]||'';this[_0xfefc('0x7')]=_0x3602c1[_0xfefc('0x7')]||{};}module[_0xfefc('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b69cc76..84960ac 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 _0xcc15=['refreshToken','Configurations','name','description','zone','clientId','clientSecret','serverUrl','code'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xcc15,0x65));var _0x5cc1=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcc15[_0x8c43de];return _0xa6591b;};'use strict';function ZohoAccount(_0x556756){this['id']=_0x556756['id']||0x0;this[_0x5cc1('0x0')]=_0x556756[_0x5cc1('0x0')]||'';this[_0x5cc1('0x1')]=_0x556756['description']||'';this['host']=_0x556756['host']||'';this[_0x5cc1('0x2')]=_0x556756[_0x5cc1('0x2')]||'';this[_0x5cc1('0x3')]=_0x556756['clientId']||'';this['clientSecret']=_0x556756[_0x5cc1('0x4')]||'';this[_0x5cc1('0x5')]=_0x556756[_0x5cc1('0x5')]||'';this[_0x5cc1('0x6')]=_0x556756[_0x5cc1('0x6')]||'';this[_0x5cc1('0x7')]=_0x556756[_0x5cc1('0x7')]||'';this[_0x5cc1('0x8')]=_0x556756[_0x5cc1('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x79f4=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x238d2c,_0x1792e4){var _0x3942aa=function(_0x5e3314){while(--_0x5e3314){_0x238d2c['push'](_0x238d2c['shift']());}};_0x3942aa(++_0x1792e4);}(_0x79f4,0x144));var _0x479f=function(_0x178d79,_0x1c5ad3){_0x178d79=_0x178d79-0x0;var _0x1f9a0a=_0x79f4[_0x178d79];return _0x1f9a0a;};'use strict';function ZohoAccount(_0x4b8eb5){this['id']=_0x4b8eb5['id']||0x0;this[_0x479f('0x0')]=_0x4b8eb5[_0x479f('0x0')]||'';this[_0x479f('0x1')]=_0x4b8eb5[_0x479f('0x1')]||'';this[_0x479f('0x2')]=_0x4b8eb5[_0x479f('0x2')]||'';this[_0x479f('0x3')]=_0x4b8eb5[_0x479f('0x3')]||'';this[_0x479f('0x4')]=_0x4b8eb5[_0x479f('0x4')]||'';this[_0x479f('0x5')]=_0x4b8eb5[_0x479f('0x5')]||'';this[_0x479f('0x6')]=_0x4b8eb5[_0x479f('0x6')]||'';this[_0x479f('0x7')]=_0x4b8eb5['code']||'';this[_0x479f('0x8')]=_0x4b8eb5[_0x479f('0x8')]||'';this[_0x479f('0x9')]=_0x4b8eb5[_0x479f('0x9')]||{};}module[_0x479f('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 060f266..1e033d5 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 _0x5430=['ContactId','ListId','UserId','isNil','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','callback','callbackuniqueid','recallme'];(function(_0x289cec,_0x4cbaae){var _0x535158=function(_0x4eda7c){while(--_0x4eda7c){_0x289cec['push'](_0x289cec['shift']());}};_0x535158(++_0x4cbaae);}(_0x5430,0x10c));var _0x0543=function(_0x8ba20,_0x131d07){_0x8ba20=_0x8ba20-0x0;var _0x558111=_0x5430[_0x8ba20];return _0x558111;};'use strict';var util=require(_0x0543('0x0'));var _=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));function checkNameSurname(_0x4078bf,_0x114bf2,_0x3b93d7){var _0x5518f8='';if(!_['isNil'](_0x114bf2)&&_0x0543('0x3')===typeof _0x114bf2){_0x5518f8+=_0x114bf2;}if(!_['isNil'](_0x3b93d7)&&'string'===typeof _0x3b93d7){_0x5518f8+='\x20'+_0x3b93d7;}if(_0x5518f8!==''){return _0x5518f8;}return _0x4078bf;}function Action(_0xce0b65,_0x45b909,_0x9754ba,_0x319568,_0x46bca7){this['uniqueid']=_0x9754ba||undefined;this[_0x0543('0x4')]=_0xce0b65['id'];this[_0x0543('0x5')]=_0x45b909[_0x0543('0x6')];this[_0x0543('0x7')]=_0x45b909[_0x0543('0x7')];this[_0x0543('0x8')]='queue';this[_0x0543('0x9')]=![];this[_0x0543('0xa')]=_['isNil'](_0xce0b65[_0x0543('0xb')])?undefined:_0xce0b65[_0x0543('0xb')][_0x0543('0x6')];this[_0x0543('0xc')]=this[_0x0543('0xa')]?util[_0x0543('0xd')](_0x0543('0xe'),this[_0x0543('0xa')]):_0x319568||undefined;this[_0x0543('0xf')]=checkNameSurname(_0xce0b65[_0x0543('0x10')][_0x0543('0x11')],_0xce0b65[_0x0543('0x10')]['firstName'],_0xce0b65[_0x0543('0x10')][_0x0543('0x12')]);this['active']=_0xce0b65['active']||![];this[_0x0543('0x13')]=_0xce0b65[_0x0543('0x11')];this[_0x0543('0x14')]=_0xce0b65[_0x0543('0x14')];this[_0x0543('0x15')]=_0xce0b65['countbusyretry']||0x0;this[_0x0543('0x16')]=_0xce0b65[_0x0543('0x16')]||0x0;this[_0x0543('0x17')]=_0xce0b65[_0x0543('0x17')]||0x0;this[_0x0543('0x18')]=(_0xce0b65[_0x0543('0x15')]||0x0)+(_0xce0b65[_0x0543('0x16')]||0x0)+(_0xce0b65['countnoanswerretry']||0x0)+(_0xce0b65[_0x0543('0x19')]||0x0)+(_0xce0b65['countdropretry']||0x0)+(_0xce0b65['countabandonedretry']||0x0)+(_0xce0b65[_0x0543('0x1a')]||0x0)+(_0xce0b65[_0x0543('0x1b')]||0x0);this[_0x0543('0x19')]=_0xce0b65['countnosuchnumberretry']||0x0;this[_0x0543('0x1c')]=_0xce0b65['countdropretry']||0x0;this[_0x0543('0x1d')]=_0xce0b65[_0x0543('0x1d')]||0x0;this['countmachineretry']=_0xce0b65[_0x0543('0x1a')]||0x0;this[_0x0543('0x1b')]=_0xce0b65[_0x0543('0x1b')]||0x0;this[_0x0543('0x1e')]=_0xce0b65[_0x0543('0x1e')];this[_0x0543('0x1f')]=_0xce0b65['callbackuniqueid'];this['callbackat']=_0xce0b65['callbackat'];this[_0x0543('0x20')]=_0xce0b65[_0x0543('0x20')];this[_0x0543('0x21')]=_0xce0b65[_0x0543('0x21')];this[_0x0543('0x22')]=_0xce0b65[_0x0543('0x22')];this[_0x0543('0x23')]=_[_0x0543('0x24')](_0xce0b65[_0x0543('0xb')])?_0xce0b65[_0x0543('0x23')]:_0xce0b65[_0x0543('0xb')]['id'];this[_0x0543('0x25')]=_0xce0b65['VoiceQueueId'];this[_0x0543('0x26')]='';this[_0x0543('0x27')]='';}Action[_0x0543('0x28')]['getCaller']=function(){return util[_0x0543('0xd')](_0x0543('0x29'),this[_0x0543('0xf')],this[_0x0543('0x2a')]);};module['exports']=Action; \ No newline at end of file +var _0x7096=['countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','number','lodash','isNil','string','uniqueid','idContact','type','campaigntype','queue','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry'];(function(_0x28fc81,_0x2b1112){var _0x9ae18d=function(_0x42aea0){while(--_0x42aea0){_0x28fc81['push'](_0x28fc81['shift']());}};_0x9ae18d(++_0x2b1112);}(_0x7096,0x10c));var _0x6709=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7096[_0x110c3d];return _0x226d67;};'use strict';var util=require('util');var _=require(_0x6709('0x0'));var moment=require('moment');function checkNameSurname(_0x253760,_0x5c668a,_0x233cbf){var _0x9544e0='';if(!_[_0x6709('0x1')](_0x5c668a)&&_0x6709('0x2')===typeof _0x5c668a){_0x9544e0+=_0x5c668a;}if(!_[_0x6709('0x1')](_0x233cbf)&&_0x6709('0x2')===typeof _0x233cbf){_0x9544e0+='\x20'+_0x233cbf;}if(_0x9544e0!==''){return _0x9544e0;}return _0x253760;}function Action(_0xb8fe6d,_0x9d630f,_0xa35832,_0x3e2223,_0x11ad23){this[_0x6709('0x3')]=_0xa35832||undefined;this[_0x6709('0x4')]=_0xb8fe6d['id'];this['queue']=_0x9d630f['name'];this[_0x6709('0x5')]=_0x9d630f[_0x6709('0x5')];this[_0x6709('0x6')]=_0x6709('0x7');this[_0x6709('0x8')]=![];this[_0x6709('0x9')]=_['isNil'](_0xb8fe6d['Agent'])?undefined:_0xb8fe6d[_0x6709('0xa')][_0x6709('0xb')];this[_0x6709('0xc')]=this[_0x6709('0x9')]?util[_0x6709('0xd')](_0x6709('0xe'),this[_0x6709('0x9')]):_0x3e2223||undefined;this[_0x6709('0xf')]=checkNameSurname(_0xb8fe6d['Contact'][_0x6709('0x10')],_0xb8fe6d[_0x6709('0x11')][_0x6709('0x12')],_0xb8fe6d[_0x6709('0x11')]['lastName']);this[_0x6709('0x13')]=_0xb8fe6d['active']||![];this[_0x6709('0x14')]=_0xb8fe6d['phone'];this[_0x6709('0x15')]=_0xb8fe6d[_0x6709('0x15')];this[_0x6709('0x16')]=_0xb8fe6d[_0x6709('0x16')]||0x0;this['countcongestionretry']=_0xb8fe6d['countcongestionretry']||0x0;this['countnoanswerretry']=_0xb8fe6d[_0x6709('0x17')]||0x0;this[_0x6709('0x18')]=(_0xb8fe6d['countbusyretry']||0x0)+(_0xb8fe6d[_0x6709('0x19')]||0x0)+(_0xb8fe6d[_0x6709('0x17')]||0x0)+(_0xb8fe6d[_0x6709('0x1a')]||0x0)+(_0xb8fe6d['countdropretry']||0x0)+(_0xb8fe6d[_0x6709('0x1b')]||0x0)+(_0xb8fe6d[_0x6709('0x1c')]||0x0)+(_0xb8fe6d[_0x6709('0x1d')]||0x0);this[_0x6709('0x1a')]=_0xb8fe6d['countnosuchnumberretry']||0x0;this[_0x6709('0x1e')]=_0xb8fe6d[_0x6709('0x1e')]||0x0;this[_0x6709('0x1b')]=_0xb8fe6d[_0x6709('0x1b')]||0x0;this[_0x6709('0x1c')]=_0xb8fe6d[_0x6709('0x1c')]||0x0;this[_0x6709('0x1d')]=_0xb8fe6d[_0x6709('0x1d')]||0x0;this[_0x6709('0x1f')]=_0xb8fe6d[_0x6709('0x1f')];this[_0x6709('0x20')]=_0xb8fe6d[_0x6709('0x20')];this['callbackat']=_0xb8fe6d[_0x6709('0x21')];this[_0x6709('0x22')]=_0xb8fe6d[_0x6709('0x22')];this['ContactId']=_0xb8fe6d[_0x6709('0x23')];this[_0x6709('0x24')]=_0xb8fe6d[_0x6709('0x24')];this[_0x6709('0x25')]=_['isNil'](_0xb8fe6d[_0x6709('0xa')])?_0xb8fe6d[_0x6709('0x25')]:_0xb8fe6d['Agent']['id'];this[_0x6709('0x26')]=_0xb8fe6d[_0x6709('0x26')];this['originatecalleridnum']='';this[_0x6709('0x27')]='';}Action[_0x6709('0x28')]['getCaller']=function(){return util[_0x6709('0xd')]('\x22%s\x22\x20<%s>',this[_0x6709('0xf')],this[_0x6709('0x29')]);};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 14eae36..e826760 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 _0xb43b=['custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','called','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','isTrunkReachable','active','trunks','SIP/%s','reachable','execRun','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','phone','substring','TrunkBackup','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','agents','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','../dialer/utils','redis','defaults','localhost','prototype','tail','finally','campaignsPreview','voiceQueues','actions','clockClearZombieChannels','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncAttendedTransfer','loopCampaigns','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','name','\x20is\x20deactivated','syncCampaigns','dialMethod','type','outbound','clearZombieChannels','hasOwnProperty','dialActive','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','countglobal','Busy','dialBusyRetryFrequency','[callProgressDetectingCustomer][logBusy]','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus'];(function(_0x262a69,_0x1f67fe){var _0x43ca44=function(_0x43b543){while(--_0x43b543){_0x262a69['push'](_0x262a69['shift']());}};_0x43ca44(++_0x1f67fe);}(_0xb43b,0x1b2));var _0xbb43=function(_0x181aad,_0x2cea9d){_0x181aad=_0x181aad-0x0;var _0x216edf=_0xb43b[_0x181aad];return _0x216edf;};'use strict';var util=require(_0xbb43('0x0'));var _=require(_0xbb43('0x1'));var uuid=require('uuid');var moment=require(_0xbb43('0x2'));var Redis=require(_0xbb43('0x3'));var config=require(_0xbb43('0x4'));var logger=require('../../../config/logger')(_0xbb43('0x5'));var loggerAction=require(_0xbb43('0x6'))(_0xbb43('0x7'));var ami=require(_0xbb43('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xbb43('0x9'));var ut=require('./util/util');var utils=require(_0xbb43('0xa'));config[_0xbb43('0xb')]=_[_0xbb43('0xc')](config[_0xbb43('0xb')],{'host':_0xbb43('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb43('0xb')]));var Sequence=function(){};Sequence[_0xbb43('0xe')]['enqueue']=function(_0x7e0fc2){this[_0xbb43('0xf')]=this[_0xbb43('0xf')]?this[_0xbb43('0xf')][_0xbb43('0x10')](_0x7e0fc2):_0x7e0fc2();};function Preview(_0x2bef86){this['sequence']=new Sequence();this[_0xbb43('0x11')]=_0x2bef86[_0xbb43('0x12')];this['trunks']=_0x2bef86['trunks'];this[_0xbb43('0x13')]={};this['agents']=_0x2bef86['agents'];this[_0xbb43('0x14')]=0x0;ami['on']('originateresponse',this[_0xbb43('0x15')][_0xbb43('0x16')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xbb43('0x17'),this[_0xbb43('0x18')]['bind'](this));ami['on']('dialend',this[_0xbb43('0x19')]['bind'](this));ami['on']('newexten',this[_0xbb43('0x1a')][_0xbb43('0x16')](this));ami['on'](_0xbb43('0x1b'),this['syncVarSet'][_0xbb43('0x16')](this));ami['on']('attendedtransfer',this[_0xbb43('0x1c')][_0xbb43('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xbb43('0x16')](this));this[_0xbb43('0x1d')](this[_0xbb43('0x11')]);}function emit(_0x2bf2d4,_0x5bcce7,_0x40a650){io['to'](_0x2bf2d4)['emit'](_0x5bcce7,_0x40a650);}function emitVoiceQueueChannelRemove(_0x3a257d){logger['info'](_0xbb43('0x1e'),JSON['stringify'](_0x3a257d));emit(util[_0xbb43('0x1f')](_0xbb43('0x20'),_0x3a257d['name']),_0xbb43('0x21'),_0x3a257d);io['emit'](_0xbb43('0x22'),_0x3a257d);}function notSendMessagesQueue(_0x298ce2){if(_0x298ce2[_0xbb43('0x23')]){if(_0x298ce2['originated']===0x0&&_0x298ce2['pTalking']===0x0){_0x298ce2['sendMessageOneNotActive']=![];_0x298ce2[_0xbb43('0x24')]=0x0;_0x298ce2[_0xbb43('0x25')]=0x0;_0x298ce2['message']=utils[_0xbb43('0x26')][_0xbb43('0x27')];ut[_0xbb43('0x28')](_0xbb43('0x29'),_0x298ce2['name']+'\x20is\x20not\x20active');}else{_0x298ce2[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x2b')];ut[_0xbb43('0x28')](_0xbb43('0x29'),_0x298ce2[_0xbb43('0x2c')]+_0xbb43('0x2d'));}}}Preview[_0xbb43('0xe')]['loopCampaigns']=function(){var _0x2ad6da=this;setInterval(function(){_0x2ad6da['syncCampaigns']();},0x7cf);};Preview[_0xbb43('0xe')][_0xbb43('0x2e')]=function(){var _0x34f5b2=this[_0xbb43('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x157d62 in _0x34f5b2){if(_0x34f5b2['hasOwnProperty'](_0x157d62)&&(_0x34f5b2[_0x157d62]['dialMethod']==='preview'||_0x34f5b2[_0x157d62][_0xbb43('0x2f')]==='booked')&&_0x34f5b2[_0x157d62][_0xbb43('0x30')]===_0xbb43('0x31')){if(this[_0xbb43('0x14')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xbb43('0x32')]();}}if(_0x34f5b2[_0xbb43('0x33')](_0x157d62)&&_0x34f5b2[_0x157d62][_0xbb43('0x2f')]===_0xbb43('0x5')&&_0x34f5b2[_0x157d62][_0xbb43('0x30')]===_0xbb43('0x31')){if(_0x34f5b2[_0x157d62][_0xbb43('0x34')]){this[_0xbb43('0x35')](_0x34f5b2[_0x157d62]);if(_0x34f5b2[_0x157d62]['dialPreviewAutoRecallMe'])this[_0xbb43('0x36')](_0x34f5b2[_0x157d62]);}else{notSendMessagesQueue(_0x34f5b2[_0x157d62]);}}}};Preview[_0xbb43('0xe')][_0xbb43('0x37')]=function(_0x244d66){var _0x4015ec=this;this[_0xbb43('0x38')][_0xbb43('0x39')](function(){if(!_[_0xbb43('0x3a')](_0x4015ec[_0xbb43('0x13')][_0x244d66])){loggerAction[_0xbb43('0x3b')](_0xbb43('0x3c'),_0x244d66,_0xbb43('0x3d'),_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')],_0xbb43('0x3f'),JSON[_0xbb43('0x40')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]]['originated']),_0xbb43('0x41'),JSON[_0xbb43('0x40')](_0x4015ec[_0xbb43('0x11')][_0x4015ec['actions'][_0x244d66]['queue']]['pTalking']),JSON[_0xbb43('0x40')](_0x4015ec[_0xbb43('0x13')][_0x244d66]['dialAnswer']),JSON['stringify'](_[_0xbb43('0x42')](_0x4015ec[_0xbb43('0x13')][_0x244d66],[_0xbb43('0x43'),_0xbb43('0x44'),_0xbb43('0x45'),'ListId'])));return ami[_0xbb43('0x46')]({'action':_0xbb43('0x47'),'channel':_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x48')]})[_0xbb43('0x49')](function(_0x531d96){if(_0x531d96[_0xbb43('0x2a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4015ec[_0xbb43('0x13')][_0x244d66]){ut[_0xbb43('0x4a')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66]['queue']],_0xbb43('0x4b'));if(_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x4c')]===!![]){ut[_0xbb43('0x4d')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]],'[clearZombieChannel]');ut[_0xbb43('0x4e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x244d66,_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]);}ut[_0xbb43('0x4e')](_0xbb43('0x4f')+_0x244d66,_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]);delete _0x4015ec['actions'][_0x244d66];}},0x2328);}});}});};Preview[_0xbb43('0xe')]['clearZombieChannels']=function(){var _0x307f1e=this;loggerAction[_0xbb43('0x3b')](_0xbb43('0x50'),_[_0xbb43('0x51')](this['actions']));for(var _0x4622ea in this[_0xbb43('0x13')]){if(_0x307f1e[_0xbb43('0x13')][_0xbb43('0x33')](_0x4622ea)){_0x307f1e[_0xbb43('0x37')](_0x4622ea);}}};Preview[_0xbb43('0xe')][_0xbb43('0x36')]=function(_0x3592fb){var _0x5a662b=this;rpcDb[_0xbb43('0x52')](_0x3592fb['id'],ut[_0xbb43('0x53')](this['agents']))[_0xbb43('0x54')](function(_0x5d4c19){if(!_['isNil'](_0x5d4c19)){for(var _0x4d7034=0x0;_0x4d7034<_0x5d4c19['length'];_0x4d7034+=0x1){if(ut[_0xbb43('0x55')](_0x5d4c19[_0x4d7034]['scheduledat'])<_0x3592fb[_0xbb43('0x56')]*0x3c){if(_0x5d4c19[_0x4d7034]['Agent']&&!_0x5d4c19[_0x4d7034][_0xbb43('0x57')][_0xbb43('0x58')]){_0x5a662b[_0xbb43('0x59')](_0x5d4c19[_0x4d7034]['id'])['then'](ut[_0xbb43('0x5a')]('[RecallMe]'))[_0xbb43('0x49')](ut[_0xbb43('0x5a')](_0xbb43('0x5b')));}else{rpcDb[_0xbb43('0x5c')](_0x5d4c19[_0x4d7034]['id']);}}else{var _0x417ad9=new Action(_0x5d4c19[_0x4d7034],_0x3592fb);_0x417ad9[_0xbb43('0x5d')]=moment()[_0xbb43('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3592fb[_0xbb43('0x5e')]+=0x1;ut[_0xbb43('0x5f')](_0x417ad9,0x17,_0xbb43('0x60'));if(_0x3592fb[_0xbb43('0x61')]){rpcDb['rescheduleContactInQueue'](ut[_0xbb43('0x62')](_0x5d4c19[_0x4d7034]));rpcDb[_0xbb43('0x63')](_0x417ad9,_0xbb43('0x64'));}else{ut[_0xbb43('0x5f')](_0x417ad9,0x16,'RecallFailedTimeout');rpcDb[_0xbb43('0x63')](_0x417ad9,_0xbb43('0x65'));rpcDb[_0xbb43('0x66')](_0x417ad9,'[HistoryRecallClose]');}}}}})[_0xbb43('0x49')](ut[_0xbb43('0x5a')](_0xbb43('0x67')));};Preview[_0xbb43('0xe')][_0xbb43('0x35')]=function(_0x59c805){_0x59c805['sendMessageOneNotActive']=!![];if(ut[_0xbb43('0x68')](_0x59c805['loggedIn'])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xbb43('0x69')](_0x59c805[_0xbb43('0x34')])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x27')];}else if(!this['isTrunkReachable'](_0x59c805[_0xbb43('0x6a')])){if(!this['isTrunkReachable'](_0x59c805['TrunkBackup'])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x6b')];}else{_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')]['ACTIVE'];}}else{_0x59c805['message']=utils[_0xbb43('0x26')][_0xbb43('0x6c')];}};Preview[_0xbb43('0xe')][_0xbb43('0x6d')]=function(_0x99cb09,_0x38d540,_0x44691b){var _0x14fce0=this;var _0x1a3f98=this['actions'][_0x38d540];var _0x1b6f96=this[_0xbb43('0x11')][_0x1a3f98[_0xbb43('0x3e')]];var _0x3675d9;var _0x22bceb=![];var _0x1fae27=0x2;var _0x3f7262=0x3;if(_0x1b6f96){switch(_0x44691b){case'1':_0x1b6f96[_0xbb43('0x6e')]+=0x1;_0x1a3f98[_0xbb43('0x6f')]+=0x1;_0x1a3f98['countglobal']=ut['totalGlobal'](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x0,_0xbb43('0x70'));ami[_0xbb43('0x71')](_0xbb43('0x72'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x74')));rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][logNoSuch]');_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'0',_0x1b6f96)['then'](function(_0x5a6ff0){_0x22bceb=_0x5a6ff0[_0xbb43('0x76')]==0x1;_0x1fae27=_0x1b6f96[_0xbb43('0x77')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x1a3f98['countnosuchnumberretry']>=_0x1b6f96[_0xbb43('0x7d')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0x7e'));}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0x6f'),_0x1b6f96[_0xbb43('0x77')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}delete this['actions'][_0x99cb09[_0xbb43('0x83')]];}else{_0x1a3f98[_0xbb43('0x6f')]++;logger[_0xbb43('0x3b')](_0xbb43('0x84'),_0x1a3f98[_0xbb43('0x6f')]);logger[_0xbb43('0x3b')]('id',_0x1a3f98['idContact']);_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnosuchnumberretry':_0x1a3f98[_0xbb43('0x6f')]}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case _0xbb43('0x88'):var _0x6f04b3=moment()[_0xbb43('0x1f')](_0xbb43('0x89'));_0x1a3f98[_0xbb43('0x8a')]=_0x6f04b3;_0x1a3f98[_0xbb43('0x8b')]=_0x6f04b3;_0x1a3f98[_0xbb43('0x4c')]=!![];_0x1b6f96[_0xbb43('0x8c')]+=0x1;logger[_0xbb43('0x3b')](_0xbb43('0x8d'),_0x1a3f98['uniqueid'],_0xbb43('0x8e'),_0x1b6f96['name'],_0xbb43('0x41'),_0x1b6f96[_0xbb43('0x8c')]);ami[_0xbb43('0x71')](_0xbb43('0x8f'),ut[_0xbb43('0x73')](_0x1a3f98,'connect',this['campaignsPreview'][_0x1a3f98[_0xbb43('0x3e')]]));if(_0x1b6f96[_0xbb43('0x90')]){ami['emit'](_0xbb43('0x91'),ut[_0xbb43('0x92')](_0x1a3f98));}break;case'16':ami[_0xbb43('0x71')](_0xbb43('0x93'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x94'),this[_0xbb43('0x11')][_0x1a3f98[_0xbb43('0x3e')]]));emitVoiceQueueChannelRemove(ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x94')));_0x1b6f96[_0xbb43('0x95')]+=0x1;_0x1b6f96[_0xbb43('0x96')]+=0x1;_0x1b6f96[_0xbb43('0x97')]+=0x1;ut[_0xbb43('0x4d')](_0x1b6f96,'[16]');_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x4,_0xbb43('0x98'));rpcDb['createCustomerHistory'](_0x1a3f98,_0xbb43('0x99'));rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0x9a'));rpcDb[_0xbb43('0x9b')](_0x1a3f98);_0x1b6f96[_0xbb43('0x9c')]+=_0x1a3f98['talktime'];_0x1b6f96[_0xbb43('0x9d')]+=_0x1a3f98[_0xbb43('0x9e')];logger[_0xbb43('0x3b')]('[syncHangup][talking][decrement]',_0x1a3f98[_0xbb43('0x9f')],_0xbb43('0x8e'),_0x1b6f96[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1b6f96[_0xbb43('0x8c')]);delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];break;case _0xbb43('0xa0'):_0x1b6f96[_0xbb43('0xa1')]+=0x1;_0x1a3f98[_0xbb43('0xa2')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut['totalGlobal'](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x5,_0xbb43('0xa4'));_0x1fae27=_0x1b6f96[_0xbb43('0xa5')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')]('custom:agentbusy',ut['buildObj'](_0x1a3f98,'busy'));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xa6'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'5',_0x1b6f96)[_0xbb43('0x54')](function(_0x8d5a8d){_0x22bceb=_0x8d5a8d[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96['dialGlobalMaxRetry']){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x1a3f98[_0xbb43('0xa2')]>=_0x1b6f96['dialBusyMaxRetry']){rpcDb[_0xbb43('0x66')](_0x1a3f98,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xa2'),_0x1b6f96[_0xbb43('0xa5')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xa2')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98['idContact'],'field':{'countbusyretry':_0x1a3f98[_0xbb43('0xa2')]}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});});}});break;case _0xbb43('0xa7'):_0x1b6f96[_0xbb43('0xa8')]+=0x1;_0x1a3f98['countnoanswerretry']+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x3,_0xbb43('0xa9'));_0x1fae27=_0x1b6f96[_0xbb43('0xaa')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];var _0x4f356d=ut[_0xbb43('0xab')](_0x1a3f98,_0x1b6f96);ami['emit'](_0xbb43('0xac'),_0x4f356d);rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][logNoAnswer]');_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'3',_0x1b6f96)[_0xbb43('0x54')](function(_0x4d9668){_0x22bceb=_0x4d9668['additional']==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xad'));}else{if(_0x1a3f98[_0xbb43('0xae')]>=_0x1b6f96[_0xbb43('0xaf')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xb0'));}else{rpcDb['rescheduleContact'](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xae'),_0x1b6f96[_0xbb43('0xaa')]),_0x1a3f98['unlockAgent'],_0x1a3f98['activeContact']);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})['then'](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case _0xbb43('0xb1'):_0x1b6f96[_0xbb43('0xb2')]+=0x1;_0x1a3f98[_0xbb43('0xb3')]+=0x1;_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x8,'Congestion');_0x1fae27=_0x1b6f96['dialCongestionRetryFrequency'];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')](_0xbb43('0xb4'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xb5')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xb6'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'8',_0x1b6f96)['then'](function(_0xaa42f9){_0x22bceb=_0xaa42f9[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut['cloneAction'](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x1a3f98[_0xbb43('0xb3')]>=_0x1b6f96[_0xbb43('0xb7')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1a3f98,_0xbb43('0xb3'),_0x1b6f96[_0xbb43('0xa5')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xb3')]++;_0x14fce0['incrementPreviewCounters']({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countcongestionretry':_0x1a3f98['countcongestionretry']}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case'CANCEL':_0x1b6f96[_0xbb43('0xb8')]+=0x1;_0x1a3f98[_0xbb43('0xb9')]+=0x1;_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x14,_0xbb43('0xba'));_0x1fae27=_0x1b6f96[_0xbb43('0xbb')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')](_0xbb43('0xbc'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xbd')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xbe'));_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'20',_0x1b6f96)[_0xbb43('0x54')](function(_0x5bbbf4){_0x22bceb=_0x5bbbf4[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0x14,_0xbb43('0xba'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xbf'));}else{if(_0x1a3f98[_0xbb43('0xb9')]>=_0x1b6f96[_0xbb43('0xc0')]){rpcDb['createCustomerFinal'](_0x1a3f98,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,'countagentrejectretry',_0x1b6f96[_0xbb43('0xbb')]),_0x1a3f98['unlockAgent'],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});});}});break;case _0xbb43('0xc1'):_0x1b6f96[_0xbb43('0xc2')]+=0x1;_0x1a3f98[_0xbb43('0xc3')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0xb,_0xbb43('0xc4'));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xc5'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'11',_0x1b6f96)[_0xbb43('0x54')](function(_0x14cd97){_0x22bceb=_0x14cd97[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96['dialGlobalMaxRetry']){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x1a3f98[_0xbb43('0xc6')]>=_0x1b6f96['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x1a3f98,_0xbb43('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xc3'),_0x1b6f96[_0xbb43('0xc7')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98['activeContact']);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98['countnoanswerretry']}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case'18':_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xc9')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x12,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);ami[_0xbb43('0x71')](_0xbb43('0xcc'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xcd')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xce'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'18',_0x1b6f96)['then'](function(_0x1f5a0a){_0x22bceb=_0x1f5a0a[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut['cloneAction'](_0x1a3f98,0x12,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xce'));}else{rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xce'));}}else{_0x1a3f98['countnoanswerretry']++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98['countnoanswerretry']}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];break;case'19':_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut['logCustomer'](_0x1a3f98,0x13,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);ami[_0xbb43('0x71')](_0xbb43('0xcc'),ut[_0xbb43('0x73')](_0x1a3f98,'amd'));rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][machine]');_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'18',_0x1b6f96)[_0xbb43('0x54')](function(_0x54fd3b){_0x22bceb=_0x54fd3b[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,'Global');rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xcf'));}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});delete this[_0xbb43('0x13')][_0x99cb09['linkedid']];break;default:if(_0x1a3f98[_0xbb43('0x4c')]){ut[_0xbb43('0x4d')](_0x1b6f96,_0xbb43('0xd0'));ut[_0xbb43('0x4e')](_0xbb43('0xd1')+_0x1b6f96[_0xbb43('0x2c')],_0x99cb09);}_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut['logCustomer'](_0x1a3f98,0xc,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);_0x1fae27=_0x1b6f96[_0xbb43('0xbb')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xd2'));_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'20',_0x1b6f96)[_0xbb43('0x54')](function(_0x2965ec){_0x22bceb=_0x2965ec[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xd3'));}else{rpcDb['createCustomerFinal'](_0x1a3f98,_0xbb43('0xd3'));}delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];}else{_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});}});}if(!(_0x1a3f98['dialAnswer']&&_0x44691b==='16')){ut['updateOriginated'](_0x1b6f96,_0xbb43('0xd4'));logger[_0xbb43('0x3b')]('[originated][decrement][callProgressDetectingCustomer]',_0x1a3f98[_0xbb43('0x9f')],'\x20Queue',_0x1b6f96[_0xbb43('0x2c')],_0xbb43('0x3f'),_0x1b6f96[_0xbb43('0xd5')]);}if(_0x44691b!=='ANSWER'){delete this['actions'][_0x99cb09['linkedid']];delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0xd6')]];}_0x1b6f96[_0xbb43('0xd7')]=!![];}};Preview[_0xbb43('0xe')][_0xbb43('0xd8')]=function(_0x53b9ee,_0xb54a91,_0x7271d0){if(_[_0xbb43('0xd9')](_0xb54a91)&&_0xbb43('0xda')!==typeof _0xb54a91){return;}if(_[_0xbb43('0xd9')](_0x7271d0)&&_0xbb43('0xda')!==typeof _0x7271d0){return;}switch(_0x7271d0['reason']){case'0':ut['logAgent'](_0x53b9ee,0x0,_0xbb43('0x70'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x53b9ee,0x3,_0xbb43('0xa9'));rpcDb['createAgentHistory'](_0x53b9ee,_0xbb43('0xdc'));break;case'5':ut[_0xbb43('0xdd')](_0x53b9ee,0x5,_0xbb43('0xa4'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xbb43('0xdd')](_0x53b9ee,0x8,_0xbb43('0xde'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,_0xbb43('0xdf'));break;case'22':ut[_0xbb43('0xdd')](_0x53b9ee,0x16,_0xbb43('0xe0'));rpcDb['createAgentHistory'](_0x53b9ee,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbb43('0xdd')](_0x53b9ee,0xc,_0x7271d0[_0xbb43('0xe1')]);rpcDb[_0xbb43('0xdb')](_0x53b9ee,_0xbb43('0xdf'));}ut[_0xbb43('0x4a')](_0xb54a91,'[callProgressDetectingAgent]');logger['info'](_0xbb43('0xe2'),_0x53b9ee[_0xbb43('0x9f')],_0xbb43('0x8e'),_0xb54a91['name'],_0xbb43('0x3f'),_0xb54a91[_0xbb43('0xd5')]);delete this[_0xbb43('0x13')][_0x53b9ee['uniqueid']];};Preview[_0xbb43('0xe')]['verifyAdditionalPhones']=function(_0x2719ce,_0x235409,_0x3386bc){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2719ce,_0x235409,_0x3386bc)[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe3')));};Preview[_0xbb43('0xe')][_0xbb43('0x87')]=function(_0x34e8b8,_0x339b30,_0x4122e7){return cmHopperAdditionalPhone[_0xbb43('0x87')](_0x34e8b8,_0x339b30,_0x4122e7)[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe4')));};Preview[_0xbb43('0xe')][_0xbb43('0x85')]=function(_0x5e2afe){return Promise[_0xbb43('0xe5')]()[_0xbb43('0x54')](cmHopperAdditionalPhone[_0xbb43('0x85')](_0x5e2afe))[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe6')));};Preview[_0xbb43('0xe')][_0xbb43('0xe7')]=function(_0x1f8f78,_0x3a05be,_0x2dd161,_0x2d2127,_0x3c537a){var _0x36af9a=this;return new Promise(function(_0x199b58,_0x357e45){if(_[_0xbb43('0x3a')](_0x3a05be)||_['isNil'](_0x3a05be[_0xbb43('0xe8')])||_['isNil'](_0x3a05be['phone'])||_[_0xbb43('0x3a')](_0x3a05be[_0xbb43('0x45')])){_0x357e45(ut['message']('Contact\x20is\x20undefined',_0x2d2127,_0x3c537a));return;}var _0x3fce74=uuid['v4']();var _0x5911fc=_0x36af9a['campaignsPreview'][_0x3a05be[_0xbb43('0x3d')]['name']];var _0x41f3fe=_0x2dd161?_0x36af9a['agents'][_0x2dd161]['id']:undefined;_0x36af9a[_0xbb43('0x13')][_0x3fce74]=new Action(_0x3a05be,_0x5911fc,_0x3fce74,_0x2dd161,_0x41f3fe);var _0x5fdbcd=_0x36af9a['actions'][_0x3fce74];_0x5fdbcd[_0xbb43('0x81')]=_0x2d2127;_0x5fdbcd[_0xbb43('0x82')]=_0x3c537a;_0x5fdbcd[_0xbb43('0xe9')]=_0x2dd161;if(_[_0xbb43('0xea')](_0x1f8f78)){_0x36af9a[_0xbb43('0xeb')](_0x5fdbcd,_0x5911fc,_0x3a05be,_0x2dd161)['then'](function(_0x6b0dd){logger[_0xbb43('0x3b')](_0xbb43('0xec'),_0xbb43('0xed')+_0x5fdbcd[_0xbb43('0x3e')]+'\x20IdHopper:\x20'+_0x5fdbcd[_0xbb43('0x86')],JSON[_0xbb43('0x40')](_0x6b0dd));ami[_0xbb43('0x71')]('custom:agentcalled',ut['buildObj'](_0x5fdbcd,_0xbb43('0xee'),_0x36af9a[_0xbb43('0x11')][_0x5fdbcd[_0xbb43('0x3e')]]));_0x199b58(ut['message']('Calling'));})[_0xbb43('0x49')](function(_0x1ab4c4){ut[_0xbb43('0x28')](_0xbb43('0xef'),_0x1ab4c4);_0x357e45(ut[_0xbb43('0x2a')]('Call\x20failed',_0x2d2127,_0x3c537a));});}else{_0x5911fc[_0xbb43('0xf0')]+=0x1;ut[_0xbb43('0xf1')](_0x5fdbcd);rpcDb[_0xbb43('0xf2')](_0x5fdbcd,_0xbb43('0xf3'));delete _0x36af9a[_0xbb43('0x13')][_0x3fce74];_0x357e45(ut[_0xbb43('0x2a')]('Contact\x20in\x20black\x20List',_0x2d2127,_0x3c537a));}});};Preview[_0xbb43('0xe')][_0xbb43('0xf4')]=function(_0x12f7a9){return!_['isNil'](_0x12f7a9)&&!_[_0xbb43('0x3a')](_0x12f7a9['name'])&&!_[_0xbb43('0x3a')](_0x12f7a9[_0xbb43('0xf5')])&&_0x12f7a9[_0xbb43('0xf5')]&&!_[_0xbb43('0x3a')](this['trunks'][util[_0xbb43('0x1f')]('SIP/%s',_0x12f7a9[_0xbb43('0x2c')])])&&!_[_0xbb43('0x3a')](this[_0xbb43('0xf6')][util[_0xbb43('0x1f')](_0xbb43('0xf7'),_0x12f7a9['name'])][_0xbb43('0x47')])&&(this[_0xbb43('0xf6')][util[_0xbb43('0x1f')](_0xbb43('0xf7'),_0x12f7a9[_0xbb43('0x2c')])]['status']===_0xbb43('0xf8')||this[_0xbb43('0xf6')][util[_0xbb43('0x1f')]('SIP/%s',_0x12f7a9[_0xbb43('0x2c')])]['status']==='unmonitored');};Preview['prototype']['run']=function(_0x44b3de,_0x5d7629){return this[_0xbb43('0xf9')](_0x44b3de,_0x5d7629)[_0xbb43('0x54')](function(_0x20be22){return _[_0xbb43('0x42')](_0x20be22,['message']);})[_0xbb43('0x49')](function(_0x12c97f){if(_0x12c97f['unlock']){rpcDb[_0xbb43('0xfa')](_0x44b3de);}if(_0x12c97f[_0xbb43('0xf5')]){rpcDb['disableContact'](_0x44b3de);}throw _['pick'](_0x12c97f,[_0xbb43('0x2a')]);});};Preview[_0xbb43('0xe')][_0xbb43('0xf9')]=function(_0x5d6ec2,_0x17065d){var _0x59fc4a=this;var _0x448d75,_0x33edab;return rpcDb[_0xbb43('0xfb')](_0x5d6ec2)[_0xbb43('0x54')](function(_0x55df31){if(!_[_0xbb43('0x3a')](_0x55df31[0x0])){_0x33edab=_0x55df31[0x0][_0xbb43('0xfc')]?![]:!![];_0x448d75=_0x55df31[0x0][_0xbb43('0xfc')]?!![]:![];_0x448d75=_0x17065d?!![]:_0x448d75;}var _0x7c7f55=_0x59fc4a[_0xbb43('0xfd')](_0x55df31);if(_0x7c7f55['isValid']){rpcDb[_0xbb43('0xfe')](_[_0xbb43('0x42')](_0x55df31[0x0],['VoiceQueueId','phone']))[_0xbb43('0x54')](function(_0x4d0023){_0x59fc4a[_0xbb43('0xe7')](_0x4d0023,_0x55df31[0x0],_0x17065d,_0x33edab,_0x448d75)[_0xbb43('0x54')](function(_0x36fddb){return _0x36fddb;})[_0xbb43('0x49')](function(_0x6bbd30){throw _0x6bbd30;});})[_0xbb43('0x49')](function(_0x21a044){ut[_0xbb43('0x28')](_0xbb43('0xff'),_0x21a044);throw ut[_0xbb43('0x2a')]('Call\x20unsuccessful',_0x33edab,_0x448d75);});}else{throw ut[_0xbb43('0x2a')](_0x7c7f55[_0xbb43('0x2a')],_0x33edab,_0x448d75);}})[_0xbb43('0x49')](function(_0x544418){ut[_0xbb43('0x28')](_0xbb43('0x100'),_0x544418);throw ut[_0xbb43('0x2a')](_0xbb43('0x101'),![],!![]);});};Preview[_0xbb43('0xe')]['validateContact']=function(_0x3f4ab7){if(_['isNil'](_0x3f4ab7)||_['isEmpty'](_0x3f4ab7)||!_['isNil'](_0x3f4ab7[0x0]['Agent'])&&_[_0xbb43('0x3a')](_0x3f4ab7[0x0][_0xbb43('0x57')][_0xbb43('0x2c')])){ut[_0xbb43('0x28')](_0xbb43('0x102'),_0x3f4ab7);return{'isValid':![],'message':_0xbb43('0x103')};}var _0x108e6d=this['campaignsPreview'][_0x3f4ab7[0x0][_0xbb43('0x3d')][_0xbb43('0x2c')]];_0x108e6d[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x6c')];if(_[_0xbb43('0x3a')](_0x108e6d)){ut[_0xbb43('0x28')](_0xbb43('0x104'),_0x108e6d);return{'isValid':![],'message':_0xbb43('0x105')};}if(!this[_0xbb43('0xf4')](_0x108e6d[_0xbb43('0x6a')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xbb43('0x106')+_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x107'));if(!this[_0xbb43('0xf4')](_0x108e6d['TrunkBackup'])){ut[_0xbb43('0x28')](_0xbb43('0x108'),_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x108e6d[_0xbb43('0x34')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x10a'));return{'isValid':![],'message':_0xbb43('0x106')+_0x108e6d[_0xbb43('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xbb43('0x10b')};};Preview[_0xbb43('0xe')][_0xbb43('0xeb')]=function(_0x581645,_0x4e7cdb,_0x3eaada,_0x1c9c7f){var _0x1d5376=this;return new Promise(function(_0x2ba34c,_0x30e984){var _0x5d7a43=_0x581645[_0xbb43('0x9f')];var _0x540b8d=_0x1d5376[_0xbb43('0xf4')](_0x4e7cdb[_0xbb43('0x6a')])?util[_0xbb43('0x1f')](_0xbb43('0x10c'),_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x2c')],_['isNil'](_0x4e7cdb[_0xbb43('0x10d')])?'':_0x4e7cdb[_0xbb43('0x10d')]['trim']()||'',_0x4e7cdb[_0xbb43('0x10e')]>0x0?_0x3eaada[_0xbb43('0x10f')][_0xbb43('0x110')](_0x4e7cdb[_0xbb43('0x10e')]):_0x3eaada[_0xbb43('0x10f')]):util[_0xbb43('0x1f')](_0xbb43('0x10c'),_[_0xbb43('0x3a')](_0x4e7cdb['TrunkBackup'])?_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x2c')]:_0x4e7cdb[_0xbb43('0x111')][_0xbb43('0x2c')],_['isNil'](_0x4e7cdb[_0xbb43('0x10d')])?'':_0x4e7cdb[_0xbb43('0x10d')][_0xbb43('0x112')]()||'',_0x4e7cdb[_0xbb43('0x10e')]>0x0?_0x3eaada[_0xbb43('0x10f')][_0xbb43('0x110')](_0x4e7cdb[_0xbb43('0x10e')]):_0x3eaada[_0xbb43('0x10f')]);var _0x1f211d=_0x1d5376[_0xbb43('0xf4')](_0x4e7cdb['Trunk'])?ut[_0xbb43('0x113')](_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x114')],_0x4e7cdb['dialOriginateCallerIdName'],_0x4e7cdb[_0xbb43('0x115')]>0x0?ut[_0xbb43('0x116')](_0x4e7cdb[_0xbb43('0x117')],_0x4e7cdb[_0xbb43('0x115')]):_0x4e7cdb[_0xbb43('0x117')]):ut['getCallerId'](_[_0xbb43('0x3a')](_0x4e7cdb[_0xbb43('0x111')])?_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x114')]:_0x4e7cdb[_0xbb43('0x111')][_0xbb43('0x114')],_0x4e7cdb['dialOriginateCallerIdName'],_0x4e7cdb[_0xbb43('0x115')]>0x0?ut[_0xbb43('0x116')](_0x4e7cdb[_0xbb43('0x117')],_0x4e7cdb[_0xbb43('0x115')]):_0x4e7cdb[_0xbb43('0x117')]);if(_0x1f211d){_0x581645[_0xbb43('0x118')]=ut[_0xbb43('0x119')](_0x1f211d);_0x581645[_0xbb43('0x11a')]=ut[_0xbb43('0x11b')](_0x1f211d);}var _0x19260c=ut[_0xbb43('0x11c')](_0x4e7cdb,_0x3eaada,_0x540b8d,_0x1f211d,_0x5d7a43,_0x581645);_[_0xbb43('0x11d')](_0x581645,ut[_0xbb43('0x11e')](_0x19260c));_0x581645[_0xbb43('0x5d')]=moment()['format'](_0xbb43('0x89'));_0x4e7cdb[_0xbb43('0x11f')]=_0x19260c;var _0x1baf8c=ut[_0xbb43('0x120')](_0x581645,_0x4e7cdb,_0x19260c,_0x581645[_0xbb43('0x82')],_0x1c9c7f);return ami[_0xbb43('0x46')](_0x1baf8c)['then'](function(_0x4345e4){_0x4e7cdb[_0xbb43('0xd5')]+=0x1;logger[_0xbb43('0x3b')](_0xbb43('0x121'),_0x5d7a43,_0xbb43('0x8e'),_0x4e7cdb[_0xbb43('0x2c')],_0xbb43('0x3f'),_0x4e7cdb[_0xbb43('0xd5')]);_0x2ba34c(_0x4345e4);})[_0xbb43('0x49')](function(_0x510584){ut[_0xbb43('0xdd')](_0x581645,0xe,_0xbb43('0x122'));rpcDb[_0xbb43('0xdb')](_0x581645,_0xbb43('0x123'));_0x30e984(_0x510584);});});};Preview[_0xbb43('0xe')]['syncNewExten']=function(_0x26825d){if(this['actions'][_0x26825d['linkedid']]){this['actions'][_0x26825d[_0xbb43('0x83')]][_0xbb43('0x48')]=_0x26825d['channel'];}};Preview['prototype'][_0xbb43('0x15')]=function(_0x59d31f){var _0x400c6e=this;var _0x26c450=this[_0xbb43('0x13')][_0x59d31f[_0xbb43('0x124')]];if(_0x26c450){if(_0x26c450[_0xbb43('0xe9')]&&this['agents'][_0x26c450[_0xbb43('0xe9')]]){ut[_0xbb43('0x125')](_0x26c450,this[_0xbb43('0x126')][_0x26c450[_0xbb43('0xe9')]][_0xbb43('0x2c')],this[_0xbb43('0x126')][_0x26c450['lookAgent']]['id']);}var _0x756278=_[_0xbb43('0x127')](_0x26c450);_0x756278[_0xbb43('0x8a')]=moment()[_0xbb43('0x1f')](_0xbb43('0x89'));var _0x4cd83a=_0x400c6e[_0xbb43('0x11')][_0x26c450[_0xbb43('0x3e')]];if(ut[_0xbb43('0x128')](_0x59d31f[_0xbb43('0x129')])){if(_0x26c450[_0xbb43('0x81')]){rpcDb[_0xbb43('0xfa')](_0x26c450[_0xbb43('0x86')]);}if(_0x26c450[_0xbb43('0x82')]){rpcDb[_0xbb43('0x5c')](_0x26c450['idContact']);}ami[_0xbb43('0x71')](_0xbb43('0x12a'),ut[_0xbb43('0x73')](_0x26c450,_0xbb43('0x12b'),this[_0xbb43('0x11')][_0x26c450[_0xbb43('0x3e')]]));this[_0xbb43('0xd8')](_0x756278,_0x4cd83a,_0x59d31f);}else{_0x26c450['starttime']=moment()[_0xbb43('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xbb43('0xdd')](_0x756278,0x4,'Answer');rpcDb[_0xbb43('0xdb')](_0x756278,_0xbb43('0x12c'));}}};Preview[_0xbb43('0xe')][_0xbb43('0x12d')]=function(_0x31d75c){var _0x570d24=this['actions'][_0x31d75c['linkedid']];var _0x1d4d0b;if(_0x570d24){_0x1d4d0b=this[_0xbb43('0x11')][_0x570d24['queue']];logger['info'](_0xbb43('0x12e'),_0x31d75c[_0xbb43('0x83')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1d4d0b['pTalking']);}if(this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]&&_0x31d75c['linkedid']!==_0x31d75c['uniqueid']){if(_0x31d75c[_0xbb43('0x12f')]==='16'&&this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]['dialAnswer']){this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')]);}else if(this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]][_0xbb43('0x4c')]){logger[_0xbb43('0x3b')]('[syncHangup][talking][cause]',_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1d4d0b['pTalking']);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c[_0xbb43('0x83')],_0x31d75c['cause']);}}else if(_0x570d24&&_['isNil'](_0x570d24[_0xbb43('0x130')])&&_0x1d4d0b[_0xbb43('0x131')]&&_0x31d75c['linkedid']===_0x31d75c['uniqueid']&&_[_0xbb43('0x3a')](_0x31d75c[_0xbb43('0xe1')])&&_0x31d75c[_0xbb43('0x12f')]==='16'&&_0x31d75c[_0xbb43('0x132')]==='6'&&_['isUndefined'](_0x570d24[_0xbb43('0x133')])){if(_0x570d24['unlockAgent']){rpcDb[_0xbb43('0xfa')](_0x570d24[_0xbb43('0x86')]);}if(_0x570d24[_0xbb43('0x82')]){rpcDb['disableContact'](_0x570d24[_0xbb43('0x86')]);}_0x31d75c[_0xbb43('0xe1')]='22';this[_0xbb43('0xd8')](_0x570d24,_0x1d4d0b,_0x31d75c);}else if(_0x570d24&&_0x570d24[_0xbb43('0x133')]){if(_0x31d75c[_0xbb43('0x12f')]==='16'&&this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]['dialAnswer']){logger[_0xbb43('0x3b')]('[syncHangup][talking][transfer]',_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],'pTalking:\x20',_0x1d4d0b[_0xbb43('0x8c')]);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')]);}else if(this['actions'][_0x31d75c[_0xbb43('0x83')]][_0xbb43('0x4c')]){logger[_0xbb43('0x3b')]('[syncHangup][talking][cause]',_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')],'\x20Queue',_0x1d4d0b[_0xbb43('0x2c')],'pTalking:\x20',_0x1d4d0b[_0xbb43('0x8c')]);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')]);}}};Preview[_0xbb43('0xe')][_0xbb43('0x19')]=function(_0xa1e9ba){if(this[_0xbb43('0x13')][_0xa1e9ba['destlinkedid']]&&_0xa1e9ba[_0xbb43('0xd6')]!==_0xa1e9ba[_0xbb43('0x134')]){this[_0xbb43('0x6d')](_0xa1e9ba,_0xa1e9ba[_0xbb43('0xd6')],_0xa1e9ba['dialstatus']);}};Preview[_0xbb43('0xe')][_0xbb43('0x18')]=function(_0x3178f7){if(this[_0xbb43('0x13')][_0x3178f7[_0xbb43('0x83')]]&&_0x3178f7[_0xbb43('0x83')]!==_0x3178f7['uniqueid']&&!this['actions'][_0x3178f7['linkedid']][_0xbb43('0x4c')]){if(_0x3178f7['cause']==='1'){this[_0xbb43('0x6d')](_0x3178f7,_0x3178f7[_0xbb43('0x83')],_0x3178f7['cause']);}}};Preview[_0xbb43('0xe')][_0xbb43('0x135')]=function(_0xea8659,_0x157391,_0x2b60f0){if(this['actions'][_0xea8659]){if(_[_0xbb43('0x3a')](this[_0xbb43('0x13')][_0xea8659]['variables'])){this['actions'][_0xea8659][_0xbb43('0x11f')]={};}this['actions'][_0xea8659][_0xbb43('0x11f')][_0x157391]=_0x2b60f0;}};Preview[_0xbb43('0xe')]['syncVarSet']=function(_0x18a8d3){try{if(!_[_0xbb43('0x3a')](_0x18a8d3)){if(ut['filterKey'](_[_0xbb43('0x136')](_0x18a8d3['variable'])[0x0])){this['addVariable'](_0x18a8d3['uniqueid'],_['keys'](_0x18a8d3[_0xbb43('0x137')])[0x0],_0x18a8d3[_0xbb43('0x138')]);}}}catch(_0x21ba01){logger[_0xbb43('0x139')](_0xbb43('0x13a'),util[_0xbb43('0x13b')](_0x21ba01,{'showHidden':![],'depth':null}));}};Preview[_0xbb43('0xe')][_0xbb43('0x1c')]=function(_0x53b812){if(_0x53b812){if(this[_0xbb43('0x13')][_0x53b812[_0xbb43('0x13c')]]){this[_0xbb43('0x13')][_0x53b812[_0xbb43('0x13c')]][_0xbb43('0x133')]=!![];}}};Preview[_0xbb43('0xe')]['syncBlindTransfer']=function(_0x47c884){if(_0x47c884){if(this[_0xbb43('0x13')][_0x47c884[_0xbb43('0x13d')]]){this[_0xbb43('0x13')][_0x47c884['transfererlinkedid']][_0xbb43('0x133')]=!![];}}};module[_0xbb43('0x13e')]=Preview; \ No newline at end of file +var _0xf3cd=['dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[action]','size','getContactRecallMe','agentReadyId','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','CAMPAIGN_STATUS','NO_AGENTS_LOGGED','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','answered','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','additional','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','countbusyretry','incrementPreviewCounters','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','verifyAdditionalPhones','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','syncNewExten','actionid','clone','response','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','prototype','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','INACTIVE','logger','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','dialActive','setMessage'];(function(_0x4734d8,_0x479950){var _0x3b1120=function(_0x4a5d1c){while(--_0x4a5d1c){_0x4734d8['push'](_0x4734d8['shift']());}};_0x3b1120(++_0x479950);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1416fc,_0x72e155){_0x1416fc=_0x1416fc-0x0;var _0x3a4b34=_0xf3cd[_0x1416fc];return _0x3a4b34;};'use strict';var util=require(_0xdf3c('0x0'));var _=require(_0xdf3c('0x1'));var uuid=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var Redis=require(_0xdf3c('0x4'));var config=require(_0xdf3c('0x5'));var logger=require('../../../config/logger')(_0xdf3c('0x6'));var loggerAction=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var ami=require('../ami');var rpcDb=require(_0xdf3c('0x9'));var cmHopperAdditionalPhone=require(_0xdf3c('0xa'));var Action=require(_0xdf3c('0xb'));var ut=require(_0xdf3c('0xc'));var utils=require(_0xdf3c('0xd'));config[_0xdf3c('0xe')]=_['defaults'](config[_0xdf3c('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdf3c('0xe')]));var Sequence=function(){};Sequence[_0xdf3c('0xf')]['enqueue']=function(_0x1dba4c){this[_0xdf3c('0x10')]=this[_0xdf3c('0x10')]?this[_0xdf3c('0x10')][_0xdf3c('0x11')](_0x1dba4c):_0x1dba4c();};function Preview(_0x1c456b){this[_0xdf3c('0x12')]=new Sequence();this[_0xdf3c('0x13')]=_0x1c456b['voiceQueues'];this[_0xdf3c('0x14')]=_0x1c456b[_0xdf3c('0x14')];this[_0xdf3c('0x15')]={};this[_0xdf3c('0x16')]=_0x1c456b['agents'];this[_0xdf3c('0x17')]=0x0;ami['on'](_0xdf3c('0x18'),this[_0xdf3c('0x19')]['bind'](this));ami['on'](_0xdf3c('0x1a'),this[_0xdf3c('0x1b')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1d'),this[_0xdf3c('0x1e')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1f'),this[_0xdf3c('0x20')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x21'),this['syncNewExten'][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x22'),this[_0xdf3c('0x23')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x24'),this[_0xdf3c('0x25')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x26'),this[_0xdf3c('0x27')][_0xdf3c('0x1c')](this));this[_0xdf3c('0x28')](this[_0xdf3c('0x13')]);}function emit(_0x25487c,_0x5d2390,_0x4d620f){io['to'](_0x25487c)[_0xdf3c('0x29')](_0x5d2390,_0x4d620f);}function emitVoiceQueueChannelRemove(_0x583ce4){logger[_0xdf3c('0x2a')](_0xdf3c('0x2b'),JSON[_0xdf3c('0x2c')](_0x583ce4));emit(util[_0xdf3c('0x2d')](_0xdf3c('0x2e'),_0x583ce4[_0xdf3c('0x2f')]),'voice_queue_channel:remove',_0x583ce4);io[_0xdf3c('0x29')](_0xdf3c('0x30'),_0x583ce4);}function notSendMessagesQueue(_0x13e3ca){if(_0x13e3ca[_0xdf3c('0x31')]){if(_0x13e3ca[_0xdf3c('0x32')]===0x0&&_0x13e3ca[_0xdf3c('0x33')]===0x0){_0x13e3ca[_0xdf3c('0x31')]=![];_0x13e3ca[_0xdf3c('0x34')]=0x0;_0x13e3ca[_0xdf3c('0x35')]=0x0;_0x13e3ca[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x37')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca[_0xdf3c('0x2f')]+'\x20is\x20not\x20active');}else{_0x13e3ca['message']=utils['CAMPAIGN_STATUS'][_0xdf3c('0x39')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca['name']+_0xdf3c('0x3a'));}}}Preview[_0xdf3c('0xf')][_0xdf3c('0x28')]=function(){var _0x1ccdd4=this;setInterval(function(){_0x1ccdd4['syncCampaigns']();},0x7cf);};Preview[_0xdf3c('0xf')][_0xdf3c('0x3b')]=function(){var _0x5386bf=this['campaignsPreview'];this[_0xdf3c('0x17')]+=0x1;for(var _0x46f0e3 in _0x5386bf){if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&(_0x5386bf[_0x46f0e3]['dialMethod']===_0xdf3c('0x6')||_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x3e'))&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(this[_0xdf3c('0x17')]>0x7){this[_0xdf3c('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x6')&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(_0x5386bf[_0x46f0e3][_0xdf3c('0x40')]){this[_0xdf3c('0x41')](_0x5386bf[_0x46f0e3]);if(_0x5386bf[_0x46f0e3][_0xdf3c('0x42')])this[_0xdf3c('0x43')](_0x5386bf[_0x46f0e3]);}else{notSendMessagesQueue(_0x5386bf[_0x46f0e3]);}}}};Preview['prototype'][_0xdf3c('0x44')]=function(_0x3e7a4b){var _0x5ddd21=this;this['sequence'][_0xdf3c('0x45')](function(){if(!_['isNil'](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b])){loggerAction['info']('[clearZombieChannels][talking]',_0x3e7a4b,'Queue',_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')],_0xdf3c('0x47'),JSON[_0xdf3c('0x2c')](_0x5ddd21['campaignsPreview'][_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x46')]]['originated']),_0xdf3c('0x48'),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]][_0xdf3c('0x33')]),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x49')]),JSON['stringify'](_[_0xdf3c('0x4a')](_0x5ddd21['actions'][_0x3e7a4b],['contactId',_0xdf3c('0x4b'),'VoiceQueueId',_0xdf3c('0x4c')])));return ami['Action']({'action':_0xdf3c('0x4d'),'channel':_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x4e')]})[_0xdf3c('0x4f')](function(_0x3098cb){if(_0x3098cb[_0xdf3c('0x36')]===_0xdf3c('0x50')){setTimeout(function(){if(_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b]){ut[_0xdf3c('0x51')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],'[clearZombieChannel]');if(_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x49')]===!![]){ut['decrementTalkink'](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],_0xdf3c('0x52'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);}ut[_0xdf3c('0x53')]('[Dialer][checkChannel][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);delete _0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b];}},0x2328);}});}});};Preview[_0xdf3c('0xf')]['clearZombieChannels']=function(){var _0x127685=this;loggerAction[_0xdf3c('0x2a')](_0xdf3c('0x54'),_[_0xdf3c('0x55')](this[_0xdf3c('0x15')]));for(var _0x55849e in this[_0xdf3c('0x15')]){if(_0x127685[_0xdf3c('0x15')][_0xdf3c('0x3c')](_0x55849e)){_0x127685[_0xdf3c('0x44')](_0x55849e);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x43')]=function(_0x555389){var _0x4d6349=this;rpcDb[_0xdf3c('0x56')](_0x555389['id'],ut[_0xdf3c('0x57')](this['agents']))['then'](function(_0x269723){if(!_[_0xdf3c('0x58')](_0x269723)){for(var _0x46b2bd=0x0;_0x46b2bd<_0x269723[_0xdf3c('0x59')];_0x46b2bd+=0x1){if(ut[_0xdf3c('0x5a')](_0x269723[_0x46b2bd][_0xdf3c('0x5b')])<_0x555389[_0xdf3c('0x5c')]*0x3c){if(_0x269723[_0x46b2bd][_0xdf3c('0x5d')]&&!_0x269723[_0x46b2bd][_0xdf3c('0x5d')]['voicePause']){_0x4d6349[_0xdf3c('0x5e')](_0x269723[_0x46b2bd]['id'])[_0xdf3c('0x5f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')))[_0xdf3c('0x4f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')));}else{rpcDb['disableContact'](_0x269723[_0x46b2bd]['id']);}}else{var _0x1751a8=new Action(_0x269723[_0x46b2bd],_0x555389);_0x1751a8['starttime']=moment()[_0xdf3c('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x555389[_0xdf3c('0x62')]+=0x1;ut[_0xdf3c('0x63')](_0x1751a8,0x17,_0xdf3c('0x64'));if(_0x555389[_0xdf3c('0x65')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x269723[_0x46b2bd]));rpcDb['createCustomerHistory'](_0x1751a8,_0xdf3c('0x66'));}else{ut['logCustomer'](_0x1751a8,0x16,_0xdf3c('0x67'));rpcDb[_0xdf3c('0x68')](_0x1751a8,_0xdf3c('0x69'));rpcDb[_0xdf3c('0x6a')](_0x1751a8,_0xdf3c('0x69'));}}}}})['catch'](ut['logger2'](_0xdf3c('0x6b')));};Preview[_0xdf3c('0xf')]['setMessage']=function(_0x3b215d){_0x3b215d[_0xdf3c('0x31')]=!![];if(ut[_0xdf3c('0x6c')](_0x3b215d[_0xdf3c('0x6d')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x6f')];}else if(!ut['isActive'](_0x3b215d['dialActive'])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x37')];}else if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x71')])){if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x72')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x73')];}else{_0x3b215d[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x74')];}}else{_0x3b215d['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview['prototype']['callProgressDetectingCustomer']=function(_0x1afc6c,_0x1c18a9,_0x5c53cd){var _0x4257c4=this;var _0x32427e=this['actions'][_0x1c18a9];var _0xa8dddb=this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]];var _0x1389e0;var _0x396461=![];var _0x28f387=0x2;var _0xb54629=0x3;if(_0xa8dddb){switch(_0x5c53cd){case'1':_0xa8dddb[_0xdf3c('0x75')]+=0x1;_0x32427e[_0xdf3c('0x76')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x0,_0xdf3c('0x79'));ami[_0xdf3c('0x29')](_0xdf3c('0x7a'),ut['buildObj'](_0x32427e,_0xdf3c('0x7b')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x7c'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'0',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x13bf69){_0x396461=_0x13bf69['additional']==0x1;_0x28f387=_0xa8dddb[_0xdf3c('0x7d')];_0xb54629=_0xa8dddb['callAdditionalPhoneAfterMin'];if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0x81'));}else{if(_0x32427e[_0xdf3c('0x76')]>=_0xa8dddb[_0xdf3c('0x82')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x81'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0x76'),_0xa8dddb[_0xdf3c('0x7d')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}delete this[_0xdf3c('0x15')][_0x1afc6c['linkedid']];}else{_0x32427e['countnosuchnumberretry']++;logger[_0xdf3c('0x2a')](_0xdf3c('0x87'),_0x32427e[_0xdf3c('0x76')]);logger['info']('id',_0x32427e[_0xdf3c('0x88')]);_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countnosuchnumberretry':_0x32427e[_0xdf3c('0x76')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0x8a'):var _0x9b7034=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x32427e[_0xdf3c('0x8c')]=_0x9b7034;_0x32427e[_0xdf3c('0x8d')]=_0x9b7034;_0x32427e[_0xdf3c('0x49')]=!![];_0xa8dddb[_0xdf3c('0x33')]+=0x1;logger[_0xdf3c('0x2a')]('[syncHangup][talking][increment]',_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);ami['emit'](_0xdf3c('0x90'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x92'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));if(_0xa8dddb[_0xdf3c('0x93')]){ami[_0xdf3c('0x29')](_0xdf3c('0x94'),ut[_0xdf3c('0x95')](_0x32427e));}break;case'16':ami[_0xdf3c('0x29')]('custom:agentcomplete',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));emitVoiceQueueChannelRemove(ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96')));_0xa8dddb[_0xdf3c('0x97')]+=0x1;_0xa8dddb['total']+=0x1;_0xa8dddb[_0xdf3c('0x98')]+=0x1;ut[_0xdf3c('0x99')](_0xa8dddb,'[16]');_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x9b'));rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x9c'));rpcDb[_0xdf3c('0x9d')](_0x32427e);_0xa8dddb['sumDuration']+=_0x32427e[_0xdf3c('0x9e')];_0xa8dddb[_0xdf3c('0x9f')]+=_0x32427e[_0xdf3c('0x9e')];logger['info'](_0xdf3c('0xa0'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb['name'],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;case _0xdf3c('0xa2'):_0xa8dddb[_0xdf3c('0xa3')]+=0x1;_0x32427e['countbusyretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x5,'Busy');_0x28f387=_0xa8dddb[_0xdf3c('0xa4')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')]('custom:agentbusy',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xa6')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logBusy]');_0x4257c4['verifyAdditionalPhones'](_0x32427e,'5',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x4e3517){_0x396461=_0x4e3517[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x32427e['countbusyretry']>=_0xa8dddb[_0xdf3c('0xa8')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xa9'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xaa'),_0xa8dddb['dialBusyRetryFrequency']),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xaa')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countbusyretry':_0x32427e[_0xdf3c('0xaa')]}})[_0xdf3c('0x5f')](function(){_0x4257c4['swapAdditionalPhones'](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xac'):_0xa8dddb[_0xdf3c('0xad')]+=0x1;_0x32427e['countnoanswerretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x3,_0xdf3c('0xae'));_0x28f387=_0xa8dddb[_0xdf3c('0xaf')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];var _0x391042=ut[_0xdf3c('0xb0')](_0x32427e,_0xa8dddb);ami[_0xdf3c('0x29')]('custom:agentnoanswer',_0x391042);rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logNoAnswer]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'3',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x2e5f82){_0x396461=_0x2e5f82[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xb2'));}else{if(_0x32427e[_0xdf3c('0xb3')]>=_0xa8dddb[_0xdf3c('0xb4')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xb5'));}else{rpcDb['rescheduleContact'](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xb3'),_0xa8dddb[_0xdf3c('0xaf')]),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e['idContact'],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xb6'):_0xa8dddb[_0xdf3c('0xb7')]+=0x1;_0x32427e['countcongestionretry']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x8,_0xdf3c('0xb8'));_0x28f387=_0xa8dddb[_0xdf3c('0xb9')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami['emit'](_0xdf3c('0xba'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xbb')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xbc'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'8',_0xa8dddb)['then'](function(_0x5c99f2){_0x396461=_0x5c99f2[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xbd'));}else{if(_0x32427e[_0xdf3c('0xbe')]>=_0xa8dddb['dialCongestionMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xbc'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xbe'),_0xa8dddb[_0xdf3c('0xa4')]),_0x32427e['unlockAgent'],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xbe')]++;_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countcongestionretry':_0x32427e[_0xdf3c('0xbe')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'CANCEL':_0xa8dddb[_0xdf3c('0xbf')]+=0x1;_0x32427e[_0xdf3c('0xc0')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x14,_0xdf3c('0xc1'));_0x28f387=_0xa8dddb['dialAgentRejectRetryFrequency'];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')](_0xdf3c('0xc2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xc3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xc4'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x1745fd){_0x396461=_0x1745fd[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb['dialGlobalMaxRetry']){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x1389e0,_0xdf3c('0xc5'));}else{if(_0x32427e[_0xdf3c('0xc0')]>=_0xa8dddb['dialAgentRejectMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xdf3c('0x83')](ut['scheduledAt'](_0x32427e,_0xdf3c('0xc0'),_0xa8dddb[_0xdf3c('0xc6')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xc7'):_0xa8dddb[_0xdf3c('0xc8')]+=0x1;_0x32427e[_0xdf3c('0xc9')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xb,_0xdf3c('0xca'));rpcDb['createCustomerHistory'](_0x32427e,_0xdf3c('0xcb'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'11',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x6e1899){_0x396461=_0x6e1899[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xcb'));}else{if(_0x32427e['countabandonedetry']>=_0xa8dddb[_0xdf3c('0xcc')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xcb'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xc9'),_0xa8dddb[_0xdf3c('0xcd')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'18':_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e[_0xdf3c('0xcf')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x12,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);ami[_0xdf3c('0x29')](_0xdf3c('0xd2'),ut['buildObj'](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)['then'](function(_0x418021){_0x396461=_0x418021[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x12,_0xdf3c('0x80'));rpcDb['createCustomerFinal'](_0x1389e0,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});delete this['actions'][_0x1afc6c[_0xdf3c('0xa1')]];break;case'19':_0xa8dddb['outboundUnknownCallsDay']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x13,_0x1afc6c['cause-txt']||_0x1afc6c[_0xdf3c('0xd1')]);ami['emit'](_0xdf3c('0xd2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd4'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x1d95d9){_0x396461=_0x1d95d9[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xd4'));}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});});}});delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;default:if(_0x32427e[_0xdf3c('0x49')]){ut[_0xdf3c('0x99')](_0xa8dddb,_0xdf3c('0xd5'));ut[_0xdf3c('0x53')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xa8dddb[_0xdf3c('0x2f')],_0x1afc6c);}_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xc,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);_0x28f387=_0xa8dddb[_0xdf3c('0xc6')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd6'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x44dc52){_0x396461=_0x44dc52[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,'Global');rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];}else{_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});}});}if(!(_0x32427e[_0xdf3c('0x49')]&&_0x5c53cd==='16')){ut[_0xdf3c('0x51')](_0xa8dddb,'[callProgressDetectingCustomer]');logger['info'](_0xdf3c('0xd7'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa8dddb[_0xdf3c('0x32')]);}if(_0x5c53cd!==_0xdf3c('0x8a')){delete this['actions'][_0x1afc6c['linkedid']];delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xd8')]];}_0xa8dddb[_0xdf3c('0xd9')]=!![];}};Preview[_0xdf3c('0xf')][_0xdf3c('0xda')]=function(_0x268aa9,_0xa10e73,_0x828c9c){if(_[_0xdf3c('0xdb')](_0xa10e73)&&_0xdf3c('0xdc')!==typeof _0xa10e73){return;}if(_[_0xdf3c('0xdb')](_0x828c9c)&&_0xdf3c('0xdc')!==typeof _0x828c9c){return;}switch(_0x828c9c[_0xdf3c('0xdd')]){case'0':ut[_0xdf3c('0xde')](_0x268aa9,0x0,_0xdf3c('0x79'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe0'));break;case'3':ut[_0xdf3c('0xde')](_0x268aa9,0x3,_0xdf3c('0xae'));rpcDb['createAgentHistory'](_0x268aa9,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xdf3c('0xde')](_0x268aa9,0x5,'Busy');rpcDb['createAgentHistory'](_0x268aa9,_0xdf3c('0xe1'));break;case'8':ut['logAgent'](_0x268aa9,0x8,_0xdf3c('0xb8'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x268aa9,0x16,'AnswerAGI');rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe2'));break;default:ut[_0xdf3c('0xde')](_0x268aa9,0xc,_0x828c9c['reason']);rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdf3c('0x51')](_0xa10e73,'[callProgressDetectingAgent]');logger['info'](_0xdf3c('0xe3'),_0x268aa9[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa10e73[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa10e73[_0xdf3c('0x32')]);delete this['actions'][_0x268aa9['uniqueid']];};Preview[_0xdf3c('0xf')]['verifyAdditionalPhones']=function(_0x1a5e31,_0x14244a,_0x18e639){return cmHopperAdditionalPhone[_0xdf3c('0xb1')](_0x1a5e31,_0x14244a,_0x18e639)[_0xdf3c('0x4f')](logger[_0xdf3c('0x2a')](_0xdf3c('0xe4')));};Preview['prototype']['swapAdditionalPhones']=function(_0x40fdd4,_0x1446af,_0x3fa455){return cmHopperAdditionalPhone[_0xdf3c('0x89')](_0x40fdd4,_0x1446af,_0x3fa455)['catch'](logger[_0xdf3c('0x2a')](_0xdf3c('0xe5')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xab')]=function(_0x33ef58){return Promise[_0xdf3c('0xe6')]()['then'](cmHopperAdditionalPhone[_0xdf3c('0xab')](_0x33ef58))[_0xdf3c('0x4f')](logger['info'](_0xdf3c('0xe7')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xe8')]=function(_0x511a40,_0x87ec92,_0x1ebfff,_0x3487cf,_0xb1c08d){var _0x3100fa=this;return new Promise(function(_0x147769,_0x3c91ba){if(_[_0xdf3c('0x58')](_0x87ec92)||_[_0xdf3c('0x58')](_0x87ec92['Contact'])||_[_0xdf3c('0x58')](_0x87ec92['phone'])||_[_0xdf3c('0x58')](_0x87ec92[_0xdf3c('0xe9')])){_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xea'),_0x3487cf,_0xb1c08d));return;}var _0x90c66=uuid['v4']();var _0x34344b=_0x3100fa[_0xdf3c('0x13')][_0x87ec92[_0xdf3c('0xeb')][_0xdf3c('0x2f')]];var _0x36a8c7=_0x1ebfff?_0x3100fa[_0xdf3c('0x16')][_0x1ebfff]['id']:undefined;_0x3100fa['actions'][_0x90c66]=new Action(_0x87ec92,_0x34344b,_0x90c66,_0x1ebfff,_0x36a8c7);var _0x379996=_0x3100fa[_0xdf3c('0x15')][_0x90c66];_0x379996['unlockAgent']=_0x3487cf;_0x379996[_0xdf3c('0x86')]=_0xb1c08d;_0x379996[_0xdf3c('0xec')]=_0x1ebfff;if(_[_0xdf3c('0xed')](_0x511a40)){_0x3100fa[_0xdf3c('0xee')](_0x379996,_0x34344b,_0x87ec92,_0x1ebfff)['then'](function(_0x2670ef){logger[_0xdf3c('0x2a')](_0xdf3c('0xef'),'Queue:\x20'+_0x379996['queue']+'\x20IdHopper:\x20'+_0x379996[_0xdf3c('0x88')],JSON[_0xdf3c('0x2c')](_0x2670ef));ami[_0xdf3c('0x29')](_0xdf3c('0xf0'),ut[_0xdf3c('0x91')](_0x379996,_0xdf3c('0xf1'),_0x3100fa[_0xdf3c('0x13')][_0x379996[_0xdf3c('0x46')]]));_0x147769(ut['message'](_0xdf3c('0xf2')));})['catch'](function(_0x359366){ut[_0xdf3c('0x38')](_0xdf3c('0xf3'),_0x359366);_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf4'),_0x3487cf,_0xb1c08d));});}else{_0x34344b[_0xdf3c('0xf5')]+=0x1;ut['logBlacklist'](_0x379996);rpcDb[_0xdf3c('0xf6')](_0x379996,_0xdf3c('0xf7'));delete _0x3100fa['actions'][_0x90c66];_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf8'),_0x3487cf,_0xb1c08d));}});};Preview[_0xdf3c('0xf')][_0xdf3c('0x70')]=function(_0x4e66a3){return!_[_0xdf3c('0x58')](_0x4e66a3)&&!_['isNil'](_0x4e66a3[_0xdf3c('0x2f')])&&!_[_0xdf3c('0x58')](_0x4e66a3[_0xdf3c('0xf9')])&&_0x4e66a3[_0xdf3c('0xf9')]&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3['name'])])&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3[_0xdf3c('0x2f')])]['status'])&&(this['trunks'][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]==='reachable'||this[_0xdf3c('0x14')][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]===_0xdf3c('0xfb'));};Preview[_0xdf3c('0xf')][_0xdf3c('0x5e')]=function(_0xd5aa90,_0x2eef6f){return this[_0xdf3c('0xfc')](_0xd5aa90,_0x2eef6f)['then'](function(_0x17add4){return _[_0xdf3c('0x4a')](_0x17add4,['message']);})[_0xdf3c('0x4f')](function(_0x1e8646){if(_0x1e8646['unlock']){rpcDb[_0xdf3c('0xfd')](_0xd5aa90);}if(_0x1e8646['active']){rpcDb[_0xdf3c('0xfe')](_0xd5aa90);}throw _[_0xdf3c('0x4a')](_0x1e8646,[_0xdf3c('0x36')]);});};Preview[_0xdf3c('0xf')][_0xdf3c('0xfc')]=function(_0x1086a3,_0x232b34){var _0x41b5f4=this;var _0x171231,_0x2b27de;return rpcDb[_0xdf3c('0xff')](_0x1086a3)[_0xdf3c('0x5f')](function(_0x2a4dbf){if(!_[_0xdf3c('0x58')](_0x2a4dbf[0x0])){_0x2b27de=_0x2a4dbf[0x0][_0xdf3c('0x100')]?![]:!![];_0x171231=_0x2a4dbf[0x0][_0xdf3c('0x100')]?!![]:![];_0x171231=_0x232b34?!![]:_0x171231;}var _0x542a02=_0x41b5f4[_0xdf3c('0x101')](_0x2a4dbf);if(_0x542a02[_0xdf3c('0x102')]){rpcDb['checkIsBlackList'](_[_0xdf3c('0x4a')](_0x2a4dbf[0x0],[_0xdf3c('0xe9'),_0xdf3c('0x103')]))[_0xdf3c('0x5f')](function(_0x518290){_0x41b5f4[_0xdf3c('0xe8')](_0x518290,_0x2a4dbf[0x0],_0x232b34,_0x2b27de,_0x171231)[_0xdf3c('0x5f')](function(_0x5b25d7){return _0x5b25d7;})[_0xdf3c('0x4f')](function(_0x37b1a6){throw _0x37b1a6;});})['catch'](function(_0x59c8f9){ut[_0xdf3c('0x38')](_0xdf3c('0x104'),_0x59c8f9);throw ut[_0xdf3c('0x36')]('Call\x20unsuccessful',_0x2b27de,_0x171231);});}else{throw ut[_0xdf3c('0x36')](_0x542a02['message'],_0x2b27de,_0x171231);}})[_0xdf3c('0x4f')](function(_0x246958){ut[_0xdf3c('0x38')](_0xdf3c('0x105'),_0x246958);throw ut[_0xdf3c('0x36')](_0xdf3c('0x106'),![],!![]);});};Preview['prototype'][_0xdf3c('0x101')]=function(_0x47f9d1){if(_[_0xdf3c('0x58')](_0x47f9d1)||_[_0xdf3c('0xed')](_0x47f9d1)||!_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'])&&_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'][_0xdf3c('0x2f')])){ut[_0xdf3c('0x38')]('[Preview][validateContact][Empty\x20Contact]',_0x47f9d1);return{'isValid':![],'message':_0xdf3c('0x107')};}var _0x4185f0=this[_0xdf3c('0x13')][_0x47f9d1[0x0][_0xdf3c('0xeb')]['name']];_0x4185f0[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x74')];if(_[_0xdf3c('0x58')](_0x4185f0)){ut[_0xdf3c('0x38')](_0xdf3c('0x108'),_0x4185f0);return{'isValid':![],'message':_0xdf3c('0x109')};}if(!this['isTrunkReachable'](_0x4185f0[_0xdf3c('0x71')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x10c'));if(!this[_0xdf3c('0x70')](_0x4185f0[_0xdf3c('0x72')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0x4185f0[_0xdf3c('0x2f')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdf3c('0x10d')};}}if(!ut[_0xdf3c('0x10e')](_0x4185f0[_0xdf3c('0x40')])){ut['logger'](_0xdf3c('0x10f'),_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x110'));return{'isValid':![],'message':_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xdf3c('0x111')};};Preview[_0xdf3c('0xf')]['execCall']=function(_0x2a0943,_0x3d4dc5,_0x38c6f3,_0xb39cc){var _0xcc2f18=this;return new Promise(function(_0x13ee9b,_0x8d7c0c){var _0x3d9041=_0x2a0943[_0xdf3c('0x8e')];var _0x4f8990=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5[_0xdf3c('0x71')])?util['format'](_0xdf3c('0x112'),_0x3d4dc5[_0xdf3c('0x71')]['name'],_['isNil'](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5[_0xdf3c('0x113')][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')][_0xdf3c('0x116')](_0x3d4dc5[_0xdf3c('0x115')]):_0x38c6f3[_0xdf3c('0x103')]):util['format'](_0xdf3c('0x112'),_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')]['name']:_0x3d4dc5[_0xdf3c('0x72')][_0xdf3c('0x2f')],_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5['dialPrefix'][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')]['substring'](_0x3d4dc5['dialCutDigit']):_0x38c6f3[_0xdf3c('0x103')]);var _0xcaea00=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5['Trunk'])?ut[_0xdf3c('0x117')](_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut['getCallerIdRandom'](_0x3d4dc5['dialOriginateCallerIdNumber'],_0x3d4dc5[_0xdf3c('0x11a')]):_0x3d4dc5['dialOriginateCallerIdNumber']):ut[_0xdf3c('0x117')](_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')]:_0x3d4dc5[_0xdf3c('0x72')]['callerid'],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut[_0xdf3c('0x11b')](_0x3d4dc5[_0xdf3c('0x11c')],_0x3d4dc5['dialRandomLastDigitCallerIdNumber']):_0x3d4dc5[_0xdf3c('0x11c')]);if(_0xcaea00){_0x2a0943[_0xdf3c('0x11d')]=ut[_0xdf3c('0x11e')](_0xcaea00);_0x2a0943['originatecalleridnum']=ut['extractCalleridNumber'](_0xcaea00);}var _0x1617d8=ut[_0xdf3c('0x11f')](_0x3d4dc5,_0x38c6f3,_0x4f8990,_0xcaea00,_0x3d9041,_0x2a0943);_['merge'](_0x2a0943,ut[_0xdf3c('0x120')](_0x1617d8));_0x2a0943['starttime']=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x3d4dc5[_0xdf3c('0x121')]=_0x1617d8;var _0x1961cd=ut[_0xdf3c('0x122')](_0x2a0943,_0x3d4dc5,_0x1617d8,_0x2a0943[_0xdf3c('0x86')],_0xb39cc);return ami['Action'](_0x1961cd)[_0xdf3c('0x5f')](function(_0x2c24b7){_0x3d4dc5[_0xdf3c('0x32')]+=0x1;logger[_0xdf3c('0x2a')](_0xdf3c('0x123'),_0x3d9041,_0xdf3c('0x8f'),_0x3d4dc5[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0x3d4dc5[_0xdf3c('0x32')]);_0x13ee9b(_0x2c24b7);})[_0xdf3c('0x4f')](function(_0x340107){ut['logAgent'](_0x2a0943,0xe,_0xdf3c('0x124'));rpcDb[_0xdf3c('0xdf')](_0x2a0943,'[originateFailure][logOriginateFailure]');_0x8d7c0c(_0x340107);});});};Preview[_0xdf3c('0xf')][_0xdf3c('0x125')]=function(_0x2accb4){if(this[_0xdf3c('0x15')][_0x2accb4[_0xdf3c('0xa1')]]){this['actions'][_0x2accb4[_0xdf3c('0xa1')]][_0xdf3c('0x4e')]=_0x2accb4[_0xdf3c('0x4e')];}};Preview[_0xdf3c('0xf')][_0xdf3c('0x19')]=function(_0x31391d){var _0x158c75=this;var _0x7554e2=this[_0xdf3c('0x15')][_0x31391d[_0xdf3c('0x126')]];if(_0x7554e2){if(_0x7554e2[_0xdf3c('0xec')]&&this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]){ut['logLookAgent'](_0x7554e2,this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['name'],this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['id']);}var _0x44388c=_[_0xdf3c('0x127')](_0x7554e2);_0x44388c[_0xdf3c('0x8c')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));var _0x15322a=_0x158c75[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]];if(ut['isFailure'](_0x31391d[_0xdf3c('0x128')])){if(_0x7554e2[_0xdf3c('0x85')]){rpcDb['unlockContact'](_0x7554e2[_0xdf3c('0x88')]);}if(_0x7554e2['activeContact']){rpcDb[_0xdf3c('0xfe')](_0x7554e2['idContact']);}ami[_0xdf3c('0x29')]('custom:agentringnoanswer',ut[_0xdf3c('0x91')](_0x7554e2,_0xdf3c('0x129'),this[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]]));this[_0xdf3c('0xda')](_0x44388c,_0x15322a,_0x31391d);}else{_0x7554e2[_0xdf3c('0x12a')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));ut['logAgent'](_0x44388c,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0xdf')](_0x44388c,_0xdf3c('0x12b'));}}};Preview['prototype'][_0xdf3c('0x1b')]=function(_0x30b5c8){var _0x30e5ab=this[_0xdf3c('0x15')][_0x30b5c8['linkedid']];var _0x55a4fa;if(_0x30e5ab){_0x55a4fa=this['campaignsPreview'][_0x30e5ab['queue']];logger[_0xdf3c('0x2a')](_0xdf3c('0x12c'),_0x30b5c8[_0xdf3c('0xa1')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);}if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]&&_0x30b5c8['linkedid']!==_0x30b5c8[_0xdf3c('0x8e')]){if(_0x30b5c8[_0xdf3c('0x12d')]==='16'&&this[_0xdf3c('0x15')][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],'\x20Queue',_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}}else if(_0x30e5ab&&_[_0xdf3c('0x58')](_0x30e5ab[_0xdf3c('0x130')])&&_0x55a4fa[_0xdf3c('0x131')]&&_0x30b5c8[_0xdf3c('0xa1')]===_0x30b5c8[_0xdf3c('0x8e')]&&_['isNil'](_0x30b5c8[_0xdf3c('0xdd')])&&_0x30b5c8[_0xdf3c('0x12d')]==='16'&&_0x30b5c8[_0xdf3c('0x132')]==='6'&&_[_0xdf3c('0xdb')](_0x30e5ab[_0xdf3c('0x133')])){if(_0x30e5ab[_0xdf3c('0x85')]){rpcDb[_0xdf3c('0xfd')](_0x30e5ab['idContact']);}if(_0x30e5ab[_0xdf3c('0x86')]){rpcDb['disableContact'](_0x30e5ab[_0xdf3c('0x88')]);}_0x30b5c8['reason']='22';this[_0xdf3c('0xda')](_0x30e5ab,_0x55a4fa,_0x30b5c8);}else if(_0x30e5ab&&_0x30e5ab[_0xdf3c('0x133')]){if(_0x30b5c8['cause']==='16'&&this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x134'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]['dialAnswer']){logger['info'](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],'pTalking:\x20',_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x20')]=function(_0x386a3b){if(this[_0xdf3c('0x15')][_0x386a3b['destlinkedid']]&&_0x386a3b[_0xdf3c('0xd8')]!==_0x386a3b[_0xdf3c('0x135')]){this[_0xdf3c('0x12e')](_0x386a3b,_0x386a3b[_0xdf3c('0xd8')],_0x386a3b[_0xdf3c('0xd1')]);}};Preview['prototype'][_0xdf3c('0x1e')]=function(_0x43fc55){if(this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]]&&_0x43fc55[_0xdf3c('0xa1')]!==_0x43fc55[_0xdf3c('0x8e')]&&!this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){if(_0x43fc55[_0xdf3c('0x12d')]==='1'){this[_0xdf3c('0x12e')](_0x43fc55,_0x43fc55[_0xdf3c('0xa1')],_0x43fc55[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x136')]=function(_0x2be6c7,_0x18bbe0,_0x174e96){if(this['actions'][_0x2be6c7]){if(_[_0xdf3c('0x58')](this[_0xdf3c('0x15')][_0x2be6c7][_0xdf3c('0x121')])){this['actions'][_0x2be6c7][_0xdf3c('0x121')]={};}this['actions'][_0x2be6c7][_0xdf3c('0x121')][_0x18bbe0]=_0x174e96;}};Preview['prototype'][_0xdf3c('0x23')]=function(_0xd721b1){try{if(!_[_0xdf3c('0x58')](_0xd721b1)){if(ut[_0xdf3c('0x137')](_[_0xdf3c('0x138')](_0xd721b1[_0xdf3c('0x139')])[0x0])){this[_0xdf3c('0x136')](_0xd721b1[_0xdf3c('0x8e')],_[_0xdf3c('0x138')](_0xd721b1['variable'])[0x0],_0xd721b1[_0xdf3c('0x13a')]);}}}catch(_0x3e3d63){logger[_0xdf3c('0x13b')](_0xdf3c('0x13c'),util['inspect'](_0x3e3d63,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xdf3c('0x25')]=function(_0x2d412f){if(_0x2d412f){if(this[_0xdf3c('0x15')][_0x2d412f[_0xdf3c('0x13d')]]){this['actions'][_0x2d412f[_0xdf3c('0x13d')]]['transfer']=!![];}}};Preview['prototype'][_0xdf3c('0x27')]=function(_0x4255cd){if(_0x4255cd){if(this['actions'][_0x4255cd[_0xdf3c('0x13e')]]){this[_0xdf3c('0x15')][_0x4255cd['transfererlinkedid']][_0xdf3c('0x133')]=!![];}}};module[_0xdf3c('0x13f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 3112228..8ea1163 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 _0x6f73=['inspect','createHistory','catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error'];(function(_0x9e670b,_0x1ea251){var _0x17188f=function(_0x1e525e){while(--_0x1e525e){_0x9e670b['push'](_0x9e670b['shift']());}};_0x17188f(++_0x1ea251);}(_0x6f73,0x92));var _0x36f7=function(_0x35ba2f,_0x554cb7){_0x35ba2f=_0x35ba2f-0x0;var _0x4b8bc6=_0x6f73[_0x35ba2f];return _0x4b8bc6;};'use strict';var util=require(_0x36f7('0x0'));var BPromise=require(_0x36f7('0x1'));var logger=require(_0x36f7('0x2'))(_0x36f7('0x3'));var cmHopper=require(_0x36f7('0x4'));var cmHopperHistory=require(_0x36f7('0x5'));var cmHopperBlack=require(_0x36f7('0x6'));var agentReportPreview=require(_0x36f7('0x7'));var voiceQueueReport=require(_0x36f7('0x8'));function loggerCatch(_0x2bd7a2){return function(_0x2ab764){logger[_0x36f7('0x9')](_0x2bd7a2,util[_0x36f7('0xa')](_0x2ab764,{'showHidden':![],'depth':null}));};}function create(_0x245e58){return cmHopperHistory[_0x36f7('0xb')](_0x245e58)[_0x36f7('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x99fd86){return BPromise[_0x36f7('0xd')]()[_0x36f7('0xe')](agentReportPreview['createHistory'](_0x99fd86))['catch'](loggerCatch(_0x36f7('0xf')));}function moveContact(_0x23a021){return cmHopper[_0x36f7('0x10')](_0x23a021,!![])[_0x36f7('0xc')](loggerCatch(_0x36f7('0x11')));}exports[_0x36f7('0x12')]=function(_0x59bda1){return cmHopperBlack[_0x36f7('0x12')](_0x59bda1)[_0x36f7('0xc')](loggerCatch(_0x36f7('0x13')));};exports[_0x36f7('0x14')]=function(_0x26dd1a){return BPromise['resolve']()[_0x36f7('0xe')](cmHopper[_0x36f7('0x14')](_0x26dd1a))[_0x36f7('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0x36f7('0xb')]=function(_0x1e97f9,_0x318f21){create(_0x1e97f9)['catch'](loggerCatch(_0x318f21));moveContact(_0x1e97f9)[_0x36f7('0xc')](loggerCatch(_0x318f21));};exports[_0x36f7('0x15')]=function(_0x358331,_0x55774d){createAgent(_0x358331)['catch'](loggerCatch(_0x55774d));};exports[_0x36f7('0x16')]=function(_0x2266c0,_0x36cd50){create(_0x2266c0)['catch'](loggerCatch(_0x36cd50));};exports[_0x36f7('0x17')]=function(_0x43c1e7,_0x3021e2){moveContact(_0x43c1e7)[_0x36f7('0xc')](loggerCatch(_0x3021e2));};exports['rescheduleContact']=function(_0x490598,_0x43c11d,_0x11b3e0){if(_0x43c11d){_0x490598[_0x36f7('0x18')]=null;}if(_0x11b3e0){_0x490598[_0x36f7('0x19')]=![];}return cmHopper[_0x36f7('0x1a')](_0x490598)[_0x36f7('0xc')](loggerCatch(_0x36f7('0x1b')));};exports[_0x36f7('0x1c')]=function(_0x2d48ab){return cmHopper[_0x36f7('0x1c')](_0x2d48ab)['catch'](loggerCatch(_0x36f7('0x1d')));};exports[_0x36f7('0x1e')]=function(_0x2a31ea){return cmHopper[_0x36f7('0x1e')]({'UserId':null},_0x2a31ea,0x1)[_0x36f7('0xc')](loggerCatch(_0x36f7('0x1f')));};exports['disableContact']=function(_0x49806){return cmHopper['unlockContact']({'active':![]},_0x49806,0x1)[_0x36f7('0xc')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x4aa437){var _0x4f7682={};_0x4f7682[_0x36f7('0x20')]=_0x4aa437[_0x36f7('0x20')];_0x4f7682[_0x36f7('0x21')]=_0x4aa437[_0x36f7('0x21')];_0x4f7682['calleridnum']=_0x4aa437['calleridnum'];_0x4f7682[_0x36f7('0x22')]=_0x4aa437[_0x36f7('0x22')];_0x4f7682[_0x36f7('0x23')]=_0x4aa437[_0x36f7('0x23')];_0x4f7682[_0x36f7('0x24')]=_0x4aa437[_0x36f7('0x25')];_0x4f7682['queuecallerleaveAt']=_0x4aa437[_0x36f7('0x25')];_0x4f7682[_0x36f7('0x26')]=0x1;_0x4f7682['queuecallercompleteAt']=_0x4aa437[_0x36f7('0x27')];_0x4f7682[_0x36f7('0x28')]=_0x4aa437[_0x36f7('0x29')];_0x4f7682[_0x36f7('0x2a')]='from-sip';_0x4f7682[_0x36f7('0x2b')]='xcally-motion-preview';_0x4f7682[_0x36f7('0x2c')]=0x0;_0x4f7682[_0x36f7('0x2d')]=0x1;_0x4f7682[_0x36f7('0x2e')]=_0x4aa437[_0x36f7('0x29')];_0x4f7682[_0x36f7('0x2f')]='COMPLETED';return BPromise[_0x36f7('0xd')]()[_0x36f7('0xe')](voiceQueueReport['create'](_0x4f7682))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x36f7('0x30')]=function(_0x26b352,_0x2f3f22){return BPromise['resolve']()[_0x36f7('0xe')](cmHopper[_0x36f7('0x30')](_0x26b352,_0x2f3f22))[_0x36f7('0xc')](loggerCatch(_0x36f7('0x31')));};exports[_0x36f7('0x32')]=function(_0x2e0f07){return cmHopper[_0x36f7('0x1a')](_0x2e0f07,!![],!![])[_0x36f7('0xc')](loggerCatch(_0x36f7('0x33')));}; \ No newline at end of file +var _0xee8d=['preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird'];(function(_0x59405e,_0x427fa3){var _0x4ce754=function(_0x4d1ff6){while(--_0x4d1ff6){_0x59405e['push'](_0x59405e['shift']());}};_0x4ce754(++_0x427fa3);}(_0xee8d,0xa3));var _0xdee8=function(_0x29ad33,_0x3b59e7){_0x29ad33=_0x29ad33-0x0;var _0x76da86=_0xee8d[_0x29ad33];return _0x76da86;};'use strict';var util=require(_0xdee8('0x0'));var BPromise=require(_0xdee8('0x1'));var logger=require('../../../config/logger')(_0xdee8('0x2'));var cmHopper=require(_0xdee8('0x3'));var cmHopperHistory=require(_0xdee8('0x4'));var cmHopperBlack=require(_0xdee8('0x5'));var agentReportPreview=require(_0xdee8('0x6'));var voiceQueueReport=require(_0xdee8('0x7'));function loggerCatch(_0x499fc0){return function(_0x3371ce){logger['error'](_0x499fc0,util[_0xdee8('0x8')](_0x3371ce,{'showHidden':![],'depth':null}));};}function create(_0x3fa29f){return cmHopperHistory[_0xdee8('0x9')](_0x3fa29f)['catch'](loggerCatch(_0xdee8('0xa')));}function createAgent(_0x4908db){return BPromise[_0xdee8('0xb')]()[_0xdee8('0xc')](agentReportPreview[_0xdee8('0x9')](_0x4908db))[_0xdee8('0xd')](loggerCatch(_0xdee8('0xa')));}function moveContact(_0xdad2b1){return cmHopper[_0xdee8('0xe')](_0xdad2b1,!![])[_0xdee8('0xd')](loggerCatch(_0xdee8('0xf')));}exports[_0xdee8('0x10')]=function(_0x1781c4){return cmHopperBlack[_0xdee8('0x10')](_0x1781c4)[_0xdee8('0xd')](loggerCatch(_0xdee8('0x11')));};exports[_0xdee8('0x12')]=function(_0x486262){return BPromise[_0xdee8('0xb')]()[_0xdee8('0xc')](cmHopper[_0xdee8('0x12')](_0x486262))[_0xdee8('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0xdee8('0x9')]=function(_0x28fdb7,_0xf86b3c){create(_0x28fdb7)[_0xdee8('0xd')](loggerCatch(_0xf86b3c));moveContact(_0x28fdb7)['catch'](loggerCatch(_0xf86b3c));};exports[_0xdee8('0x13')]=function(_0x251242,_0x29896a){createAgent(_0x251242)[_0xdee8('0xd')](loggerCatch(_0x29896a));};exports[_0xdee8('0x14')]=function(_0xb09f8b,_0x161bd9){create(_0xb09f8b)[_0xdee8('0xd')](loggerCatch(_0x161bd9));};exports['createCustomerFinal']=function(_0x35dd5f,_0x10c5c4){moveContact(_0x35dd5f)[_0xdee8('0xd')](loggerCatch(_0x10c5c4));};exports[_0xdee8('0x15')]=function(_0x59dc78,_0x2cc75b,_0x5e1905){if(_0x2cc75b){_0x59dc78[_0xdee8('0x16')]=null;}if(_0x5e1905){_0x59dc78[_0xdee8('0x17')]=![];}return cmHopper['rescheduleContact'](_0x59dc78)[_0xdee8('0xd')](loggerCatch(_0xdee8('0x18')));};exports[_0xdee8('0x19')]=function(_0x1e440a){return cmHopper[_0xdee8('0x19')](_0x1e440a)[_0xdee8('0xd')](loggerCatch(_0xdee8('0x1a')));};exports[_0xdee8('0x1b')]=function(_0x42a966){return cmHopper[_0xdee8('0x1b')]({'UserId':null},_0x42a966,0x1)[_0xdee8('0xd')](loggerCatch(_0xdee8('0x1c')));};exports['disableContact']=function(_0x3f2acc){return cmHopper[_0xdee8('0x1b')]({'active':![]},_0x3f2acc,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports[_0xdee8('0x1d')]=function(_0x495926){var _0x4c3633={};_0x4c3633[_0xdee8('0x1e')]=_0x495926[_0xdee8('0x1e')];_0x4c3633[_0xdee8('0x1f')]=_0x495926[_0xdee8('0x1f')];_0x4c3633['calleridnum']=_0x495926[_0xdee8('0x20')];_0x4c3633[_0xdee8('0x21')]=_0x495926[_0xdee8('0x21')];_0x4c3633['queue']=_0x495926[_0xdee8('0x22')];_0x4c3633[_0xdee8('0x23')]=_0x495926[_0xdee8('0x24')];_0x4c3633['queuecallerleaveAt']=_0x495926['answertime'];_0x4c3633[_0xdee8('0x25')]=0x1;_0x4c3633[_0xdee8('0x26')]=_0x495926['endtime'];_0x4c3633[_0xdee8('0x27')]=_0x495926[_0xdee8('0x28')];_0x4c3633['context']=_0xdee8('0x29');_0x4c3633[_0xdee8('0x2a')]=_0xdee8('0x2b');_0x4c3633[_0xdee8('0x2c')]=0x0;_0x4c3633[_0xdee8('0x2d')]=0x1;_0x4c3633[_0xdee8('0x2e')]=_0x495926[_0xdee8('0x28')];_0x4c3633[_0xdee8('0x2f')]=_0xdee8('0x30');return BPromise['resolve']()[_0xdee8('0xc')](voiceQueueReport[_0xdee8('0x31')](_0x4c3633))[_0xdee8('0xd')](loggerCatch(_0xdee8('0x32')));};exports[_0xdee8('0x33')]=function(_0x2a20b2,_0x5a569c){return BPromise[_0xdee8('0xb')]()['then'](cmHopper[_0xdee8('0x33')](_0x2a20b2,_0x5a569c))[_0xdee8('0xd')](loggerCatch(_0xdee8('0x34')));};exports[_0xdee8('0x35')]=function(_0x4923b7){return cmHopper[_0xdee8('0x15')](_0x4923b7,!![],!![])[_0xdee8('0xd')](loggerCatch(_0xdee8('0x36')));}; \ 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 eef79c1..5b5d2d7 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 _0xbff6=['replace','match','extractCalleridNumber','toLowerCase','variables','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','error','inspect','logger','logger2','info','message','getCallerId','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','string','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','channelAgent','calleridnum','from-sip','uniqueid','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','campaigntype','dialAnswer','active','callback','callbackat','sipcallid','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow'];(function(_0x83b514,_0x1a0cbe){var _0x250c0f=function(_0xcd8eb9){while(--_0xcd8eb9){_0x83b514['push'](_0x83b514['shift']());}};_0x250c0f(++_0x1a0cbe);}(_0xbff6,0x8e));var _0x6bff=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbff6[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x6bff('0x0'));var _=require(_0x6bff('0x1'));var moment=require(_0x6bff('0x2'));var logger=require(_0x6bff('0x3'))(_0x6bff('0x4'));var ipAgi=process[_0x6bff('0x5')][_0x6bff('0x6')]||_0x6bff('0x7');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x1c7864){return function(_0x1d814a){logger[_0x6bff('0x8')](_0x1c7864,util[_0x6bff('0x9')](_0x1d814a,{'showHidden':![],'depth':null}));};};exports[_0x6bff('0xa')]=function(_0x2267bb,_0x525250){logger['info'](_0x2267bb,util[_0x6bff('0x9')](_0x525250,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2d6dcb,_0x2826c7){logger[_0x6bff('0x8')](_0x2d6dcb,util[_0x6bff('0x9')](_0x2826c7,{'showHidden':![],'depth':null}));};exports[_0x6bff('0xb')]=function(_0x564abd){return function(_0x14ec84){logger[_0x6bff('0xc')](_0x564abd,util[_0x6bff('0x9')](_0x14ec84,{'showHidden':![],'depth':null}));};};exports[_0x6bff('0xd')]=function(_0x6aa3b9,_0x55550a,_0x10a1fa){return{'message':_0x6aa3b9,'unlock':_0x55550a,'active':_0x10a1fa};};exports[_0x6bff('0xe')]=function(_0x145fa3,_0x25df88,_0x7c0006){if(!_['isUndefined'](_0x7c0006)&&'string'===typeof _0x7c0006&&!_[_0x6bff('0xf')](_0x7c0006)){if(!_[_0x6bff('0x10')](_0x25df88)&&'string'===typeof _0x25df88&&!_[_0x6bff('0xf')](_0x25df88)){return util[_0x6bff('0x11')](_0x6bff('0x12'),_0x25df88,_0x7c0006);}return util[_0x6bff('0x11')]('\x22%s\x22\x20<%s>',_0x7c0006,_0x7c0006);}if(!_[_0x6bff('0x10')](_0x145fa3)&&_0x6bff('0x13')===typeof _0x145fa3&&!_[_0x6bff('0xf')](_0x145fa3)){return _0x145fa3;}return'\x22\x22\x20<>';};exports[_0x6bff('0x14')]=function(_0x3f68ca){if(_[_0x6bff('0x15')](_0x3f68ca)){return![];}return _0x3f68ca;};exports[_0x6bff('0x16')]=function(_0x545057,_0x138544,_0x26d83a,_0x594037,_0x343900,_0x44e08e){var _0x25acbf={'XMD-QUEUE':_0x138544[_0x6bff('0x17')]?_0x138544['Queue']['name']:'','XMD-CALLERID':_0x594037,'XMD-CALLERID-PREVIEW':_0x44e08e?util[_0x6bff('0x11')](_0x6bff('0x12'),_0x44e08e[_0x6bff('0x18')],_0x44e08e['calleridnum']):_0x594037,'XMD-DIALID':_0x343900,'XMD-CONTACTID':_0x138544[_0x6bff('0x19')],'XMD-CDRTYPE':_0x6bff('0x1a'),'CALLERID(all)':_0x594037,'XMD-VOICEQUEUEID':_0x138544['VoiceQueueId'],'XMD-DIALCHANNEL':_0x26d83a,'XMD-DIALTIMEOUT':_0x545057[_0x6bff('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x6bff('0x11')](_0x6bff('0x1c'),_0x545057['dialQueueProject2']?'g':'',_[_0x6bff('0xf')](_0x545057[_0x6bff('0x1d')])?'':_0x6bff('0x1e')),'XMD-DIALURL':_0x545057[_0x6bff('0x1f')]||'','XMD-AGI':_0x545057[_0x6bff('0x20')]?util[_0x6bff('0x11')](_0x6bff('0x21'),ipAgi,_0x545057[_0x6bff('0x20')]):'NONE','XMD-AGIAFTER':_0x545057[_0x6bff('0x22')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x545057[_0x6bff('0x22')]):_0x6bff('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x44e08e?_0x44e08e[_0x6bff('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x44e08e?_0x44e08e[_0x6bff('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x545057[_0x6bff('0x1d')])){_0x25acbf[util['format']('%s',_0x6bff('0x26'))]=_0x545057[_0x6bff('0x1d')];_0x25acbf[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x343900;}if(_0x138544&&_0x138544[_0x6bff('0x27')]){for(var _0x1bc49b in _0x138544[_0x6bff('0x27')]){if(_0x138544[_0x6bff('0x27')][_0x6bff('0x28')](_0x1bc49b)){if(!_[_0x6bff('0x15')](_0x138544[_0x6bff('0x27')][_0x1bc49b])&&_0x1bc49b!=='id'&&_0x1bc49b!==_0x6bff('0x29')&&_0x1bc49b!==_0x6bff('0x2a')&&_0x1bc49b!==_0x6bff('0x2b')){_0x25acbf[util['format']('%s%s',_0x6bff('0x2c'),_[_0x6bff('0x2d')](_0x1bc49b))]=_0x138544['Contact'][_0x1bc49b];}}}}return _0x25acbf;};exports['toLowerVariables']=function(_0x47a215){var _0x48329d={};for(var _0xa6b0e1 in _0x47a215){if(_0x47a215[_0x6bff('0x28')](_0xa6b0e1)){_0x48329d[util[_0x6bff('0x11')]('%s',_[_0x6bff('0x2e')](_0xa6b0e1))]=_0x47a215[_0xa6b0e1];}}return{'variables':_0x48329d};};exports[_0x6bff('0x2f')]=function(_0xe114f4,_0x252d3d){if(!_[_0x6bff('0x15')](_0xe114f4)){if(_0xe114f4[_0x6bff('0x28')](_0x6bff('0x30'))){if(_0xe114f4['originated']>0x0){_0xe114f4['originated']-=0x1;}else{logger[_0x6bff('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x252d3d);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x252d3d);}};exports[_0x6bff('0x31')]=function(_0x34703b){var _0x38b8ec=moment()[_0x6bff('0x11')](_0x6bff('0x32'));_0x34703b[_0x6bff('0x33')]=0xd;_0x34703b[_0x6bff('0x34')]=_0x6bff('0x35');_0x34703b[_0x6bff('0x36')]=_0x38b8ec;_0x34703b[_0x6bff('0x37')]=_0x38b8ec;_0x34703b['endtime']=_0x38b8ec;};exports[_0x6bff('0x38')]=function(_0x2223f7,_0x393098,_0x2aec2b){var _0x334fa5=moment()[_0x6bff('0x11')](_0x6bff('0x32'));_0x2223f7[_0x6bff('0x33')]=_0x393098;_0x2223f7[_0x6bff('0x34')]=_0x2aec2b;_0x2223f7['responsetime']=_0x334fa5;_0x2223f7[_0x6bff('0x39')]=utils[_0x6bff('0x3a')](_0x2223f7[_0x6bff('0x37')],_0x2223f7[_0x6bff('0x36')]);};exports[_0x6bff('0x3b')]=function(_0x3a7cb1,_0x2f293d,_0x542078){_0x3a7cb1[_0x6bff('0x3c')]=_0x2f293d;_0x3a7cb1[_0x6bff('0x3d')]=_0x542078;};exports['logCustomer']=function(_0x5f1fa6,_0x8c5792,_0x196156){var _0x1c7921=moment()['format'](_0x6bff('0x32'));_0x5f1fa6[_0x6bff('0x33')]=_0x8c5792;_0x5f1fa6[_0x6bff('0x34')]=_0x196156;_0x5f1fa6[_0x6bff('0x37')]=_0x5f1fa6[_0x6bff('0x37')]?_0x5f1fa6[_0x6bff('0x37')]:_0x1c7921;_0x5f1fa6[_0x6bff('0x3e')]=_0x5f1fa6[_0x6bff('0x3e')]?_0x5f1fa6[_0x6bff('0x3e')]:_0x1c7921;_0x5f1fa6[_0x6bff('0x39')]=utils['getSeconds'](_0x5f1fa6['responsetime']||0x0,_0x5f1fa6[_0x6bff('0x36')]||0x0);_0x5f1fa6[_0x6bff('0x3f')]=_0x5f1fa6[_0x6bff('0x40')]?utils['getSeconds'](_0x5f1fa6['endtime'],_0x5f1fa6[_0x6bff('0x40')]):0x0;};exports[_0x6bff('0x41')]=function(_0x24692e){return _0x24692e===_0x6bff('0x42');};exports[_0x6bff('0x43')]=function(_0x9aefbe,_0x253f2f,_0x46a37c,_0xca6525,_0x179e09){var _0xa0c472=_0xca6525?_0x6bff('0x44'):_0x9aefbe[_0x6bff('0x18')];_0xa0c472=_0x179e09?'BOOKED':_0xa0c472;return{'actionid':_0x9aefbe['uniqueid'],'action':'originate','channel':_0x9aefbe[_0x6bff('0x45')],'callerid':util[_0x6bff('0x11')](_0x6bff('0x12'),_0xa0c472,_0x9aefbe[_0x6bff('0x46')]),'Exten':'xcally-motion-preview','Context':_0x6bff('0x47'),'Priority':'1','variable':_0x46a37c,'timeout':(_0x253f2f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x9aefbe[_0x6bff('0x48')]};};exports[_0x6bff('0x49')]=function(_0x1e1a80){return _0x1e1a80['countbusyretry']+_0x1e1a80['countcongestionretry']+_0x1e1a80[_0x6bff('0x4a')]+_0x1e1a80[_0x6bff('0x4b')]+_0x1e1a80[_0x6bff('0x4c')];};exports[_0x6bff('0x4d')]=function(_0x59e1f6){var _0x2bb372=_[_0x6bff('0x4e')](_0x59e1f6);_0x2bb372[_0x6bff('0x33')]=0xf;_0x2bb372[_0x6bff('0x34')]=_0x6bff('0x4f');return _0x2bb372;};exports['scheduledAt']=function(_0x5cf8bc,_0x37392a,_0x506213){var _0x2f2cf3={};_0x2f2cf3[_0x37392a]=_0x5cf8bc[_0x37392a];_0x2f2cf3['active']=![];_0x2f2cf3[_0x6bff('0x50')]=moment()[_0x6bff('0x51')](_0x506213,_0x6bff('0x52'))['format'](_0x6bff('0x32'));_0x2f2cf3[_0x6bff('0x19')]=_0x5cf8bc[_0x6bff('0x19')];_0x2f2cf3['ListId']=_0x5cf8bc[_0x6bff('0x53')];_0x2f2cf3[_0x6bff('0x54')]=_0x5cf8bc[_0x6bff('0x54')]||undefined;return _0x2f2cf3;};exports[_0x6bff('0x55')]=function(_0x11c881,_0x598cc8){if(!_[_0x6bff('0x15')](_0x11c881)){if(_0x11c881[_0x6bff('0x56')]>0x0){_0x11c881['pTalking']-=0x1;}else{logger[_0x6bff('0x8')](_0x598cc8,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x6bff('0x8')](_0x598cc8,_0x6bff('0x57'));}};exports[_0x6bff('0x58')]=function(_0x3e50d4){if(_0x3e50d4<=0x0){return!![];}return![];};function buildObj(_0x54b35a,_0x39c793,_0x3694f1){_0x54b35a['lastevent']=_0x39c793;_0x54b35a[_0x6bff('0x59')]=_0x54b35a[_0x6bff('0x5a')];_0x54b35a[_0x6bff('0x5b')]=_0x54b35a[_0x6bff('0x45')];_0x54b35a['motionChannel']=_0x6bff('0x5c');if(_0x3694f1){_0x54b35a[_0x6bff('0x5d')]=_0x3694f1[_0x6bff('0x5d')];}return _0x54b35a;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x24cb94){var _0x9960b={};_0x9960b[_0x6bff('0x5a')]=_0x24cb94[_0x6bff('0x5a')];_0x9960b['interface']=_0x24cb94[_0x6bff('0x45')];_0x9960b[_0x6bff('0x48')]=_0x24cb94[_0x6bff('0x48')];return _0x9960b;};exports[_0x6bff('0x5e')]=function(_0x1149ed){var _0x4f21cf=[];for(var _0x5557be in _0x1149ed){if(_0x1149ed[_0x6bff('0x28')](_0x5557be)){if(!_['isNil'](_0x1149ed[_0x5557be])&&_0x1149ed[_0x5557be][_0x6bff('0x33')]===_0x6bff('0x5f')&&_0x1149ed[_0x5557be][_0x6bff('0x60')]===_0x6bff('0x61')){_0x4f21cf[_0x6bff('0x62')](_0x1149ed[_0x5557be]['id']);}}}return _0x4f21cf;};exports[_0x6bff('0x63')]=function(_0x3397e8){var _0x2d5d2b=moment()[_0x6bff('0x64')](0x0);var _0x5e235c=moment(_0x3397e8)[_0x6bff('0x64')](0x0);return _0x2d5d2b[_0x6bff('0x65')](_0x5e235c,'seconds');};exports[_0x6bff('0x66')]=function(_0x3e4067){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3e4067[_0x6bff('0x19')],'ListId':_0x3e4067['ListId'],'VoiceQueueId':_0x3e4067['VoiceQueueId']||undefined,'CampaignId':_0x3e4067['CampaignId']||undefined};};exports[_0x6bff('0x67')]=function(_0x14d664){if(_0x14d664===_0x6bff('0x48')||_0x14d664===_0x6bff('0x68')||_0x14d664==='queue'||_0x14d664==='type'||_0x14d664===_0x6bff('0x69')||_0x14d664===_0x6bff('0x6a')||_0x14d664===_0x6bff('0x3c')||_0x14d664===_0x6bff('0x45')||_0x14d664===_0x6bff('0x18')||_0x14d664===_0x6bff('0x6b')||_0x14d664===_0x6bff('0x46')||_0x14d664===_0x6bff('0x50')||_0x14d664==='countbusyretry'||_0x14d664==='countcongestionretry'||_0x14d664===_0x6bff('0x4a')||_0x14d664==='countglobal'||_0x14d664===_0x6bff('0x6c')||_0x14d664==='callbackuniqueid'||_0x14d664===_0x6bff('0x6d')||_0x14d664==='recallme'||_0x14d664===_0x6bff('0x19')||_0x14d664===_0x6bff('0x53')||_0x14d664===_0x6bff('0x3d')||_0x14d664==='VoiceQueueId'||_0x14d664===_0x6bff('0x6e')||_0x14d664==='xmd-voicequeueid'||_0x14d664==='xmd-queue'||_0x14d664==='xmd-phone'||_0x14d664===_0x6bff('0x6f')||_0x14d664==='xmd-dialurl'||_0x14d664===_0x6bff('0x70')||_0x14d664===_0x6bff('0x71')||_0x14d664===_0x6bff('0x72')||_0x14d664===_0x6bff('0x73')||_0x14d664===_0x6bff('0x74')||_0x14d664==='xmd-cdrtype'||_0x14d664===_0x6bff('0x75')||_0x14d664===_0x6bff('0x76')||_0x14d664===_0x6bff('0x77')||_0x14d664===_0x6bff('0x78')||_0x14d664==='rtpaudioqosbridged'||_0x14d664===_0x6bff('0x79')||_0x14d664===_0x6bff('0x7a')||_0x14d664===_0x6bff('0x7b')||_0x14d664===_0x6bff('0x7c')||_0x14d664===_0x6bff('0x7d')||_0x14d664===_0x6bff('0x7e')||_0x14d664==='rtpaudioqos'||_0x14d664==='rtpaudioqosbridged'||_0x14d664===_0x6bff('0x79')||_0x14d664===_0x6bff('0x7a')||_0x14d664===_0x6bff('0x7b')||_0x14d664===_0x6bff('0x7c')||_0x14d664==='rtpaudioqosrtt'||_0x14d664===_0x6bff('0x7e')||_0x14d664===_0x6bff('0x7f')||_0x14d664===_0x6bff('0x80')||_0x14d664===_0x6bff('0x33')||_0x14d664===_0x6bff('0x34')){return![];}return!![];};exports[_0x6bff('0x81')]=function(_0x259718,_0x94a91a){var _0xa15147,_0x43cd85,_0x51362b;if(_0x94a91a<=0x0){_0x94a91a=0x1;}_0xa15147=new RegExp(_0x6bff('0x82')+_0x94a91a+'}$');_0x43cd85=Math[_0x6bff('0x83')](0xa,_0x94a91a-0x1);_0x51362b=Math['pow'](0xa,_0x94a91a)-0x1;return util['format']('%s',_[_0x6bff('0x84')](_0x259718,_0xa15147,_['random'](_0x43cd85,_0x51362b)));};exports['extractCalleridName']=function(_0x1e793b){var _0x452fa5=_0x1e793b[_0x6bff('0x85')](/"(.*?)"/);return _0x452fa5?_0x452fa5[0x1]:_0x1e793b;};exports[_0x6bff('0x86')]=function(_0x941178){var _0x5488e5=_0x941178[_0x6bff('0x85')](/<(.*?)>/);return _0x5488e5?_0x5488e5[0x1]:_0x941178;};function buildNoAnswerEventPayload(_0xa6c68b,_0x4240d3){var _0x5d8afd=buildObj(_0xa6c68b,'noanswer');if(!_[_0x6bff('0xf')](_0x4240d3['variables'])){Object['keys'](_0x4240d3['variables'])['forEach'](function(_0x5e069b){_0x5d8afd[_0x5e069b[_0x6bff('0x87')]()]=_0x4240d3[_0x6bff('0x88')][_0x5e069b];});}return _0x5d8afd;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xecb9=['campaigntype','membername','scheduledat','callback','callbackuniqueid','callbackat','recallme','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','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','../../../../config/logger','env','127.0.0.1','../../dialer/utils','loggerCatch','inspect','loggerError','error','logger2','info','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','getSeconds','UserId','ringtime','talktime','answertime','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type'];(function(_0x334a99,_0x5455b4){var _0x95e9df=function(_0x3d8394){while(--_0x3d8394){_0x334a99['push'](_0x334a99['shift']());}};_0x95e9df(++_0x5455b4);}(_0xecb9,0xb4));var _0x9ecb=function(_0x3da241,_0xeba26a){_0x3da241=_0x3da241-0x0;var _0x43e156=_0xecb9[_0x3da241];return _0x43e156;};'use strict';var util=require(_0x9ecb('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x9ecb('0x1'))('preview');var ipAgi=process[_0x9ecb('0x2')]['XCALLY_IP_AGI']||_0x9ecb('0x3');var utils=require(_0x9ecb('0x4'));exports[_0x9ecb('0x5')]=function(_0x138cb5){return function(_0x3cf009){logger['error'](_0x138cb5,util[_0x9ecb('0x6')](_0x3cf009,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x44a31e,_0x201a4c){logger['info'](_0x44a31e,util['inspect'](_0x201a4c,{'showHidden':![],'depth':null}));};exports[_0x9ecb('0x7')]=function(_0x442894,_0x5d863a){logger[_0x9ecb('0x8')](_0x442894,util[_0x9ecb('0x6')](_0x5d863a,{'showHidden':![],'depth':null}));};exports[_0x9ecb('0x9')]=function(_0x584c21){return function(_0x30a240){logger[_0x9ecb('0xa')](_0x584c21,util[_0x9ecb('0x6')](_0x30a240,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3e904e,_0x3ca8a7,_0x252ab9){return{'message':_0x3e904e,'unlock':_0x3ca8a7,'active':_0x252ab9};};exports['getCallerId']=function(_0x3597fa,_0x298dda,_0xf22016){if(!_[_0x9ecb('0xb')](_0xf22016)&&_0x9ecb('0xc')===typeof _0xf22016&&!_[_0x9ecb('0xd')](_0xf22016)){if(!_['isUndefined'](_0x298dda)&&_0x9ecb('0xc')===typeof _0x298dda&&!_[_0x9ecb('0xd')](_0x298dda)){return util[_0x9ecb('0xe')]('\x22%s\x22\x20<%s>',_0x298dda,_0xf22016);}return util[_0x9ecb('0xe')](_0x9ecb('0xf'),_0xf22016,_0xf22016);}if(!_['isUndefined'](_0x3597fa)&&_0x9ecb('0xc')===typeof _0x3597fa&&!_[_0x9ecb('0xd')](_0x3597fa)){return _0x3597fa;}return'\x22\x22\x20<>';};exports[_0x9ecb('0x10')]=function(_0x54f42f){if(_['isNil'](_0x54f42f)){return![];}return _0x54f42f;};exports[_0x9ecb('0x11')]=function(_0x387960,_0xd20f93,_0xcb582f,_0xc9022d,_0x15dbaa,_0x45590f){var _0x2a279a={'XMD-QUEUE':_0xd20f93[_0x9ecb('0x12')]?_0xd20f93[_0x9ecb('0x12')][_0x9ecb('0x13')]:'','XMD-CALLERID':_0xc9022d,'XMD-CALLERID-PREVIEW':_0x45590f?util[_0x9ecb('0xe')]('\x22%s\x22\x20<%s>',_0x45590f['calleridname'],_0x45590f[_0x9ecb('0x14')]):_0xc9022d,'XMD-DIALID':_0x15dbaa,'XMD-CONTACTID':_0xd20f93[_0x9ecb('0x15')],'XMD-CDRTYPE':_0x9ecb('0x16'),'CALLERID(all)':_0xc9022d,'XMD-VOICEQUEUEID':_0xd20f93['VoiceQueueId'],'XMD-DIALCHANNEL':_0xcb582f,'XMD-DIALTIMEOUT':_0x387960[_0x9ecb('0x17')]||0x1e,'XMD-DIALOPTIONS':util[_0x9ecb('0xe')](_0x9ecb('0x18'),_0x387960['dialQueueProject2']?'g':'',_['isEmpty'](_0x387960['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x387960['dialPreviewUrl']||'','XMD-AGI':_0x387960['dialQueueProject']?util[_0x9ecb('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x387960[_0x9ecb('0x19')]):_0x9ecb('0x1a'),'XMD-AGIAFTER':_0x387960[_0x9ecb('0x1b')]?util[_0x9ecb('0xe')](_0x9ecb('0x1c'),ipAgi,_0x387960[_0x9ecb('0x1b')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x45590f?_0x45590f['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x45590f?_0x45590f['originatecalleridname']:'','XMD-DESTINATION':_0x9ecb('0x1d'),'SIPADDHEADER':_0x9ecb('0x1e')};if(!_['isEmpty'](_0x387960[_0x9ecb('0x1f')])){_0x2a279a[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x387960[_0x9ecb('0x1f')];_0x2a279a[util['format']('%s',_0x9ecb('0x20'))]=_0x15dbaa;}if(_0xd20f93&&_0xd20f93[_0x9ecb('0x21')]){for(var _0x29a1f0 in _0xd20f93['Contact']){if(_0xd20f93['Contact'][_0x9ecb('0x22')](_0x29a1f0)){if(!_['isNil'](_0xd20f93[_0x9ecb('0x21')][_0x29a1f0])&&_0x29a1f0!=='id'&&_0x29a1f0!=='tags'&&_0x29a1f0!==_0x9ecb('0x23')&&_0x29a1f0!=='updatedAt'){_0x2a279a[util[_0x9ecb('0xe')](_0x9ecb('0x24'),_0x9ecb('0x25'),_[_0x9ecb('0x26')](_0x29a1f0))]=_0xd20f93['Contact'][_0x29a1f0];}}}}return _0x2a279a;};exports[_0x9ecb('0x27')]=function(_0x45bce3){var _0x4b8eb5={};for(var _0x1357f6 in _0x45bce3){if(_0x45bce3[_0x9ecb('0x22')](_0x1357f6)){_0x4b8eb5[util[_0x9ecb('0xe')]('%s',_[_0x9ecb('0x28')](_0x1357f6))]=_0x45bce3[_0x1357f6];}}return{'variables':_0x4b8eb5};};exports[_0x9ecb('0x29')]=function(_0x2a2305,_0x187128){if(!_[_0x9ecb('0x2a')](_0x2a2305)){if(_0x2a2305[_0x9ecb('0x22')](_0x9ecb('0x2b'))){if(_0x2a2305[_0x9ecb('0x2b')]>0x0){_0x2a2305[_0x9ecb('0x2b')]-=0x1;}else{logger[_0x9ecb('0x8')](_0x9ecb('0x2c'),_0x187128);}}}else{logger[_0x9ecb('0x8')](_0x9ecb('0x2d'),_0x187128);}};exports[_0x9ecb('0x2e')]=function(_0x243e83){var _0x298d38=moment()[_0x9ecb('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x243e83[_0x9ecb('0x2f')]=0xd;_0x243e83[_0x9ecb('0x30')]=_0x9ecb('0x31');_0x243e83[_0x9ecb('0x32')]=_0x298d38;_0x243e83[_0x9ecb('0x33')]=_0x298d38;_0x243e83[_0x9ecb('0x34')]=_0x298d38;};exports[_0x9ecb('0x35')]=function(_0x335306,_0x23163e,_0xd7f79a){var _0x283163=moment()[_0x9ecb('0xe')](_0x9ecb('0x36'));_0x335306[_0x9ecb('0x2f')]=_0x23163e;_0x335306[_0x9ecb('0x30')]=_0xd7f79a;_0x335306[_0x9ecb('0x33')]=_0x283163;_0x335306['ringtime']=utils[_0x9ecb('0x37')](_0x335306[_0x9ecb('0x33')],_0x335306[_0x9ecb('0x32')]);};exports['logLookAgent']=function(_0x2f4a34,_0x5e9468,_0x5368bf){_0x2f4a34['membername']=_0x5e9468;_0x2f4a34[_0x9ecb('0x38')]=_0x5368bf;};exports['logCustomer']=function(_0x52483f,_0x103bd3,_0x42fdf2){var _0x4afcfb=moment()[_0x9ecb('0xe')](_0x9ecb('0x36'));_0x52483f[_0x9ecb('0x2f')]=_0x103bd3;_0x52483f['statedesc']=_0x42fdf2;_0x52483f[_0x9ecb('0x33')]=_0x52483f['responsetime']?_0x52483f['responsetime']:_0x4afcfb;_0x52483f['endtime']=_0x52483f['endtime']?_0x52483f[_0x9ecb('0x34')]:_0x4afcfb;_0x52483f[_0x9ecb('0x39')]=utils[_0x9ecb('0x37')](_0x52483f[_0x9ecb('0x33')]||0x0,_0x52483f['starttime']||0x0);_0x52483f[_0x9ecb('0x3a')]=_0x52483f[_0x9ecb('0x3b')]?utils['getSeconds'](_0x52483f[_0x9ecb('0x34')],_0x52483f[_0x9ecb('0x3b')]):0x0;};exports['isFailure']=function(_0x4b53a5){return _0x4b53a5===_0x9ecb('0x3c');};exports[_0x9ecb('0x3d')]=function(_0x28cc88,_0x263ff4,_0x260dd4,_0x3a5f9,_0x5b7328){var _0x33e949=_0x3a5f9?_0x9ecb('0x3e'):_0x28cc88[_0x9ecb('0x3f')];_0x33e949=_0x5b7328?'BOOKED':_0x33e949;return{'actionid':_0x28cc88[_0x9ecb('0x40')],'action':_0x9ecb('0x41'),'channel':_0x28cc88[_0x9ecb('0x42')],'callerid':util[_0x9ecb('0xe')]('\x22%s\x22\x20<%s>',_0x33e949,_0x28cc88['calleridnum']),'Exten':_0x9ecb('0x1d'),'Context':_0x9ecb('0x43'),'Priority':'1','variable':_0x260dd4,'timeout':(_0x263ff4[_0x9ecb('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x28cc88['uniqueid']};};exports[_0x9ecb('0x45')]=function(_0x55e150){return _0x55e150['countbusyretry']+_0x55e150[_0x9ecb('0x46')]+_0x55e150[_0x9ecb('0x47')]+_0x55e150['countagentrejectretry']+_0x55e150['countnosuchnumberretry'];};exports[_0x9ecb('0x48')]=function(_0x2c0a07){var _0x10bf40=_[_0x9ecb('0x49')](_0x2c0a07);_0x10bf40[_0x9ecb('0x2f')]=0xf;_0x10bf40[_0x9ecb('0x30')]=_0x9ecb('0x4a');return _0x10bf40;};exports[_0x9ecb('0x4b')]=function(_0x27e4cc,_0x394e14,_0x1c50e6){var _0x68501c={};_0x68501c[_0x394e14]=_0x27e4cc[_0x394e14];_0x68501c[_0x9ecb('0x4c')]=![];_0x68501c['scheduledat']=moment()['add'](_0x1c50e6,_0x9ecb('0x4d'))['format'](_0x9ecb('0x36'));_0x68501c[_0x9ecb('0x15')]=_0x27e4cc[_0x9ecb('0x15')];_0x68501c[_0x9ecb('0x4e')]=_0x27e4cc[_0x9ecb('0x4e')];_0x68501c['VoiceQueueId']=_0x27e4cc[_0x9ecb('0x4f')]||undefined;return _0x68501c;};exports['decrementTalkink']=function(_0x1c23e2,_0x316369){if(!_['isNil'](_0x1c23e2)){if(_0x1c23e2['pTalking']>0x0){_0x1c23e2[_0x9ecb('0x50')]-=0x1;}else{logger['error'](_0x316369,_0x9ecb('0x51'));}}else{logger['error'](_0x316369,_0x9ecb('0x52'));}};exports[_0x9ecb('0x53')]=function(_0x54d6af){if(_0x54d6af<=0x0){return!![];}return![];};function buildObj(_0x3ef2d1,_0xe45249,_0x4e53b7){_0x3ef2d1[_0x9ecb('0x54')]=_0xe45249;_0x3ef2d1[_0x9ecb('0x13')]=_0x3ef2d1[_0x9ecb('0x55')];_0x3ef2d1['interface']=_0x3ef2d1[_0x9ecb('0x42')];_0x3ef2d1['motionChannel']=_0x9ecb('0x56');if(_0x4e53b7){_0x3ef2d1[_0x9ecb('0x57')]=_0x4e53b7[_0x9ecb('0x57')];}return _0x3ef2d1;}exports['buildObj']=buildObj;exports[_0x9ecb('0x58')]=function(_0x1cf82a){var _0x25c4d9={};_0x25c4d9[_0x9ecb('0x55')]=_0x1cf82a[_0x9ecb('0x55')];_0x25c4d9[_0x9ecb('0x59')]=_0x1cf82a[_0x9ecb('0x42')];_0x25c4d9[_0x9ecb('0x40')]=_0x1cf82a['uniqueid'];return _0x25c4d9;};exports[_0x9ecb('0x5a')]=function(_0x526d00){var _0x21d313=[];for(var _0x1bb676 in _0x526d00){if(_0x526d00[_0x9ecb('0x22')](_0x1bb676)){if(!_[_0x9ecb('0x2a')](_0x526d00[_0x1bb676])&&_0x526d00[_0x1bb676][_0x9ecb('0x2f')]===_0x9ecb('0x5b')&&_0x526d00[_0x1bb676]['status']==='reachable'){_0x21d313[_0x9ecb('0x5c')](_0x526d00[_0x1bb676]['id']);}}}return _0x21d313;};exports[_0x9ecb('0x5d')]=function(_0x14a14d){var _0x2dbfbf=moment()['milliseconds'](0x0);var _0xa7db7f=moment(_0x14a14d)[_0x9ecb('0x5e')](0x0);return _0x2dbfbf[_0x9ecb('0x5f')](_0xa7db7f,_0x9ecb('0x60'));};exports[_0x9ecb('0x61')]=function(_0x487c00){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x487c00[_0x9ecb('0x15')],'ListId':_0x487c00['ListId'],'VoiceQueueId':_0x487c00['VoiceQueueId']||undefined,'CampaignId':_0x487c00[_0x9ecb('0x62')]||undefined};};exports[_0x9ecb('0x63')]=function(_0x2b3c88){if(_0x2b3c88==='uniqueid'||_0x2b3c88===_0x9ecb('0x64')||_0x2b3c88===_0x9ecb('0x55')||_0x2b3c88===_0x9ecb('0x65')||_0x2b3c88===_0x9ecb('0x66')||_0x2b3c88==='dialAnswer'||_0x2b3c88===_0x9ecb('0x67')||_0x2b3c88===_0x9ecb('0x42')||_0x2b3c88===_0x9ecb('0x3f')||_0x2b3c88===_0x9ecb('0x4c')||_0x2b3c88===_0x9ecb('0x14')||_0x2b3c88===_0x9ecb('0x68')||_0x2b3c88==='countbusyretry'||_0x2b3c88===_0x9ecb('0x46')||_0x2b3c88===_0x9ecb('0x47')||_0x2b3c88==='countglobal'||_0x2b3c88===_0x9ecb('0x69')||_0x2b3c88===_0x9ecb('0x6a')||_0x2b3c88===_0x9ecb('0x6b')||_0x2b3c88===_0x9ecb('0x6c')||_0x2b3c88===_0x9ecb('0x15')||_0x2b3c88==='ListId'||_0x2b3c88===_0x9ecb('0x38')||_0x2b3c88===_0x9ecb('0x4f')||_0x2b3c88===_0x9ecb('0x6d')||_0x2b3c88===_0x9ecb('0x6e')||_0x2b3c88===_0x9ecb('0x6f')||_0x2b3c88===_0x9ecb('0x70')||_0x2b3c88===_0x9ecb('0x71')||_0x2b3c88===_0x9ecb('0x72')||_0x2b3c88===_0x9ecb('0x73')||_0x2b3c88===_0x9ecb('0x74')||_0x2b3c88===_0x9ecb('0x75')||_0x2b3c88===_0x9ecb('0x76')||_0x2b3c88==='xmd-contactid'||_0x2b3c88===_0x9ecb('0x77')||_0x2b3c88===_0x9ecb('0x78')||_0x2b3c88===_0x9ecb('0x79')||_0x2b3c88==='xmd-agi'||_0x2b3c88==='rtpaudioqos'||_0x2b3c88===_0x9ecb('0x7a')||_0x2b3c88===_0x9ecb('0x7b')||_0x2b3c88==='rtpaudioqosjitterbridged'||_0x2b3c88===_0x9ecb('0x7c')||_0x2b3c88==='rtpaudioqoslossbridged'||_0x2b3c88===_0x9ecb('0x7d')||_0x2b3c88===_0x9ecb('0x7e')||_0x2b3c88===_0x9ecb('0x7f')||_0x2b3c88===_0x9ecb('0x7a')||_0x2b3c88===_0x9ecb('0x7b')||_0x2b3c88===_0x9ecb('0x80')||_0x2b3c88===_0x9ecb('0x7c')||_0x2b3c88==='rtpaudioqoslossbridged'||_0x2b3c88===_0x9ecb('0x7d')||_0x2b3c88==='rtpaudioqosrttbridged'||_0x2b3c88===_0x9ecb('0x81')||_0x2b3c88===_0x9ecb('0x82')||_0x2b3c88==='state'||_0x2b3c88==='statedesc'){return![];}return!![];};exports[_0x9ecb('0x83')]=function(_0x5c0d23,_0x535459){var _0x2ec7fd,_0x7c7502,_0xe3f126;if(_0x535459<=0x0){_0x535459=0x1;}_0x2ec7fd=new RegExp(_0x9ecb('0x84')+_0x535459+'}$');_0x7c7502=Math[_0x9ecb('0x85')](0xa,_0x535459-0x1);_0xe3f126=Math[_0x9ecb('0x85')](0xa,_0x535459)-0x1;return util[_0x9ecb('0xe')]('%s',_[_0x9ecb('0x86')](_0x5c0d23,_0x2ec7fd,_[_0x9ecb('0x87')](_0x7c7502,_0xe3f126)));};exports['extractCalleridName']=function(_0x31ff89){var _0x3930b7=_0x31ff89[_0x9ecb('0x88')](/"(.*?)"/);return _0x3930b7?_0x3930b7[0x1]:_0x31ff89;};exports['extractCalleridNumber']=function(_0x35b6a5){var _0x19c488=_0x35b6a5[_0x9ecb('0x88')](/<(.*?)>/);return _0x19c488?_0x19c488[0x1]:_0x35b6a5;};function buildNoAnswerEventPayload(_0xa924c1,_0x1a91c){var _0x35d05f=buildObj(_0xa924c1,'noanswer');if(!_['isEmpty'](_0x1a91c[_0x9ecb('0x89')])){Object['keys'](_0x1a91c['variables'])[_0x9ecb('0x8a')](function(_0x583812){_0x35d05f[_0x583812[_0x9ecb('0x8b')]()]=_0x1a91c[_0x9ecb('0x89')][_0x583812];});}return _0x35d05f;}exports[_0x9ecb('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 889fb53..405900e 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 _0xeab3=['voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','voicequeuechannel','voicechannel'];(function(_0x247402,_0x269fc8){var _0x438ef9=function(_0x4ecd5e){while(--_0x4ecd5e){_0x247402['push'](_0x247402['shift']());}};_0x438ef9(++_0x269fc8);}(_0xeab3,0x121));var _0x3eab=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0xeab3[_0x26299e];return _0x6c4f4a;};'use strict';exports[_0x3eab('0x0')]={'queue':{'type':_0x3eab('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x3eab('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x3eab('0x2'),'required':![]}};exports[_0x3eab('0x3')]={'queue':{'type':_0x3eab('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x3eab('0x4')]={'interface':{'type':_0x3eab('0x1'),'required':!![]},'paused':{'type':_0x3eab('0x2')},'reason':{'type':_0x3eab('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x3eab('0x1'),'required':![]}};exports[_0x3eab('0x5')]={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]}};exports[_0x3eab('0x6')]={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x3eab('0x1')},'mixmonitorid':{'type':_0x3eab('0x1')}};exports[_0x3eab('0x7')]={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x3eab('0x1'),'required':!![]},'exten':{'type':_0x3eab('0x1'),'required':!![]},'context':{'type':_0x3eab('0x1')}}; \ No newline at end of file +var _0x2e55=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','boolean'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x2e55,0xc1));var _0x52e5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2e55[_0x178e48];return _0x440d7e;};'use strict';exports[_0x52e5('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x52e5('0x1'),'required':!![]},'membername':{'type':_0x52e5('0x1'),'required':!![]},'penalty':{'type':_0x52e5('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x52e5('0x3')]={'queue':{'type':_0x52e5('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0x52e5('0x1'),'required':!![]},'paused':{'type':_0x52e5('0x4')},'reason':{'type':_0x52e5('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x52e5('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x52e5('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x52e5('0x1')}};exports[_0x52e5('0x7')]={'uniqueid':{'type':_0x52e5('0x1'),'required':!![]}};exports[_0x52e5('0x8')]={'uniqueid':{'type':_0x52e5('0x1'),'required':!![]},'exten':{'type':_0x52e5('0x1'),'required':!![]},'context':{'type':_0x52e5('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 8cdd144..898f2c9 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 _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0xdc6179,_0x228c8d){var _0x3c24c4=function(_0x586212){while(--_0x586212){_0xdc6179['push'](_0xdc6179['shift']());}};_0x3c24c4(++_0x228c8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ed50b,_0x176349){_0x5ed50b=_0x5ed50b-0x0;var _0x20ea2b=_0x5f2f[_0x5ed50b];return _0x20ea2b;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x16ade0,_0xaa249d){var _0x327ade=function(_0xb0f64a){while(--_0xb0f64a){_0x16ade0['push'](_0x16ade0['shift']());}};_0x327ade(++_0xaa249d);}(_0xadb5,0xad));var _0x5adb=function(_0x5c7209,_0x4304c0){_0x5c7209=_0x5c7209-0x0;var _0xa5f916=_0xadb5[_0x5c7209];return _0xa5f916;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index be9804a..8a66d39 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x543d=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x327429,_0x3d2ccb){var _0x237393=function(_0x47be6b){while(--_0x47be6b){_0x327429['push'](_0x327429['shift']());}};_0x237393(++_0x3d2ccb);}(_0x543d,0x1e1));var _0xd543=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0x543d[_0x50f112];return _0x4ecf28;};'use strict';function mergeDBDataToRealtime(_0x5c9a2a,_0x474766){var _0x3fd9c2=Object[_0xd543('0x0')]({},_0x5c9a2a);for(var _0x37432e in _0x474766){if(_0x3fd9c2[_0xd543('0x1')](_0x37432e)){_0x3fd9c2[_0x37432e]=_0x474766[_0x37432e];}}return _0x3fd9c2;}exports[_0xd543('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xb154=['hasOwnProperty','assign'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xb154,0xb7));var _0x4b15=function(_0x3abcc2,_0x355368){_0x3abcc2=_0x3abcc2-0x0;var _0x2f470e=_0xb154[_0x3abcc2];return _0x2f470e;};'use strict';function mergeDBDataToRealtime(_0x44351c,_0x325a03){var _0x36e32b=Object[_0x4b15('0x0')]({},_0x44351c);for(var _0x2cbad7 in _0x325a03){if(_0x36e32b[_0x4b15('0x1')](_0x2cbad7)){_0x36e32b[_0x2cbad7]=_0x325a03[_0x2cbad7];}}return _0x36e32b;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 43e293e..4bfeff6 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 _0x5833=['context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','UserId','membername','monitor','length','monitorFilename','monitors','filename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','format','SIP/%s','name','connectedlinenum','assigned','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','prototype','getAgentByInternal','keys','getCallType','split','agents','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','lastdata'];(function(_0x452c04,_0x38217a){var _0x40225f=function(_0x1b6532){while(--_0x1b6532){_0x452c04['push'](_0x452c04['shift']());}};_0x40225f(++_0x38217a);}(_0x5833,0x141));var _0x3583=function(_0xab2284,_0x40eb02){_0xab2284=_0xab2284-0x0;var _0xc19888=_0x5833[_0xab2284];return _0xc19888;};'use strict';var _=require(_0x3583('0x0'));var moment=require('moment');var util=require(_0x3583('0x1'));var config=require(_0x3583('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x3583('0x3'));var RpcVoiceCallReport=require(_0x3583('0x4'));var RpcVoiceDialReport=require(_0x3583('0x5'));var RpcMemberReport=require(_0x3583('0x6'));var RpcVoiceQueueReport=require(_0x3583('0x7'));var RpcVoiceRecording=require(_0x3583('0x8'));var RpcVoiceTransferReport=require(_0x3583('0x9'));var VoiceQueueReport=require(_0x3583('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x3583('0xb'));var VoiceDialReport=require(_0x3583('0xc'));var UserReport=require(_0x3583('0xd'));function Report(_0x143b8b){this[_0x3583('0xe')]=_0x143b8b;this['agents']=_0x143b8b['agents'];this['telephones']=_0x143b8b[_0x3583('0xf')];}Report['prototype'][_0x3583('0x10')]=function(_0x1b1f5c){var _0x5e4dc6=new VoiceQueueReport(this[_0x3583('0xe')]);var _0x38c51c=new VoiceAgentReport(this[_0x3583('0xe')]);var _0x4200f4=new VoiceDialReport(this['realtime']);var _0x38b672=new VoiceCallReport(this[_0x3583('0xe')]);var _0x48c052=new UserReport(this['realtime']);if(config[_0x3583('0x11')]&&config['xdr']['disabled']){ami['on'](_0x3583('0x12'),this[_0x3583('0x13')][_0x3583('0x14')](this));ami['on'](_0x3583('0x15'),this[_0x3583('0x16')]['bind'](this));ami['on'](_0x3583('0x17'),this[_0x3583('0x18')][_0x3583('0x14')](this));ami['on'](_0x3583('0x19'),this['voiceDialReport'][_0x3583('0x14')](this));ami['on'](_0x3583('0x1a'),this[_0x3583('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0x3583('0x1c')][_0x3583('0x14')](this));}};Report['prototype'][_0x3583('0x1d')]=function(_0x54b148){var _0xaf9eac;_0xaf9eac=_[_0x3583('0x1e')](this['agents'],function(_0x1a13dd){return _0x1a13dd[_0x3583('0x1f')]==_0x54b148||_0x1a13dd['name']==_0x54b148;});if(_[_0x3583('0x20')](_0xaf9eac)){var _0x51d7a3=_[_0x3583('0x1e')](this['telephones'],function(_0x2b358f){return _0x2b358f[_0x3583('0x1f')]==_0x54b148||_0x2b358f['name']==_0x54b148;});if(_0x51d7a3){_0xaf9eac=_[_0x3583('0x1e')](this['agents'],function(_0x2edb2b){return _0x2edb2b['interface']==util[_0x3583('0x21')](_0x3583('0x22'),_0x51d7a3[_0x3583('0x23')]);});}}return _0xaf9eac;};Report['prototype'][_0x3583('0x13')]=function(_0x4e2bfb){for(var _0x5ccf72=0x0;_0x5ccf72<_0x4e2bfb['length'];_0x5ccf72+=0x1){var _0x3598ba=this[_0x3583('0x1d')](_0x4e2bfb[_0x5ccf72][_0x3583('0x24')]);if(_0x3598ba){_0x4e2bfb[_0x5ccf72][_0x3583('0x1f')]=_0x3598ba[_0x3583('0x1f')];_0x4e2bfb[_0x5ccf72][_0x3583('0x25')]=!![];_0x4e2bfb[_0x5ccf72]['lastAssignedTo']=_0x3598ba[_0x3583('0x23')];_0x4e2bfb[_0x5ccf72][_0x3583('0x26')]=_[_0x3583('0x20')](_0x3598ba['interface'])?util[_0x3583('0x21')](_0x3583('0x22'),_0x3598ba[_0x3583('0x23')]):_0x3598ba[_0x3583('0x26')];if(_0x4e2bfb[_0x5ccf72]['queuecallercomplete']){_0x4e2bfb[_0x5ccf72][_0x3583('0x27')]=moment()[_0x3583('0x21')](_0x3583('0x28'));}if(_0x4e2bfb[_0x5ccf72][_0x3583('0x29')]){_0x4e2bfb[_0x5ccf72]['queuecallerexitAt']=moment()[_0x3583('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x3583('0x13')](_0x4e2bfb[_0x5ccf72]);}RpcVoiceQueueReport[_0x3583('0x2a')](_0x4e2bfb[_0x5ccf72]);}};function extractCalleridNumber(_0x1d861f){var _0x52a9f6=_0x1d861f[_0x3583('0x2b')](/<(.*?)>/);return _0x52a9f6?_0x52a9f6[0x1]:_0x1d861f;}Report[_0x3583('0x2c')][_0x3583('0x2d')]=function(_0x20c5b2){for(var _0x34ba59=0x0;_0x34ba59/);return _0x2057dc?_0x2057dc[0x1]:_0x19dc9b;}Report[_0xd9db('0x1d')][_0xd9db('0x2e')]=function(_0x332184){for(var _0x1891b6=0x0;_0x1891b6',_0x5c46c7[_0xd9db('0x44')],_0x5c46c7[_0xd9db('0x3f')]);}if(RpcVoiceTransferReport['transfers'][_0x5c46c7[_0xd9db('0x45')]]){var _0x707fd3=RpcVoiceTransferReport[_0xd9db('0x46')][_0x5c46c7[_0xd9db('0x45')]];_0x707fd3[_0xd9db('0x47')]=_0x5c46c7[_0xd9db('0x48')];RpcVoiceTransferReport[_0xd9db('0x1b')](_0x707fd3);delete RpcVoiceTransferReport[_0xd9db('0x46')][_0x5c46c7['linkedid']];}if(_[_0xd9db('0x20')](_0x5c46c7[_0xd9db('0x35')])){_0x5c46c7[_0xd9db('0x35')]=this[_0xd9db('0x49')](_0x5c46c7);}if(_[_0xd9db('0x20')](_0x5c46c7[_0xd9db('0x4a')])){var _0x56e94a=_0x5c46c7['channel'][_0xd9db('0x4b')]('-')[0x0];var _0x437994=this['agents'][_0x56e94a];if(!_0x437994)_0x437994=this[_0xd9db('0x2e')](_0x5c46c7[_0xd9db('0x21')]);if(_0x437994){_0x5c46c7[_0xd9db('0x4a')]=_0x437994['id'];_0x5c46c7[_0xd9db('0x4c')]=_0x437994[_0xd9db('0x1f')];}}RpcVoiceCallReport[_0xd9db('0x2d')](_0x5c46c7);if(_0x5c46c7[_0xd9db('0x4d')]){for(var _0x535820=0x0;_0x535820<_0x5c46c7[_0xd9db('0x4e')][_0xd9db('0x4f')];_0x535820+=0x1){_0x5c46c7[_0xd9db('0x50')]=_0x5c46c7[_0xd9db('0x4e')][_0x535820][_0xd9db('0x51')];_0x5c46c7[_0xd9db('0x52')]=_0x5c46c7[_0xd9db('0x4e')][_0x535820]['createdAt'];if(_0x5c46c7[_0xd9db('0x34')]=='xcally-motion-preview'){_0x5c46c7['calleridnum']=_0x5c46c7[_0xd9db('0x25')];_0x5c46c7[_0xd9db('0x44')]=_0x5c46c7[_0xd9db('0x53')];_0x5c46c7[_0xd9db('0x25')]=_0x5c46c7[_0xd9db('0x21')];_0x5c46c7['connectedlinename']=_0x5c46c7['membername'];_0x5c46c7[_0xd9db('0x34')]=_0x5c46c7['originatecalleridnum'];}else if(_0x5c46c7['exten']==_0xd9db('0x54')){_0x5c46c7[_0xd9db('0x3f')]=_0x5c46c7['destination'];_0x5c46c7[_0xd9db('0x34')]=_0x5c46c7[_0xd9db('0x40')];}RpcVoiceRecording[_0xd9db('0x2d')](_0x5c46c7);}}};Report['prototype']['voiceAgentReport']=function(_0x2c1b62){if(_[_0xd9db('0x55')](_0x2c1b62)){_0x2c1b62[_0xd9db('0x56')](function(_0x6efbd4){RpcVoiceAgentReport[_0xd9db('0x2d')](_0x6efbd4);});}else{RpcVoiceAgentReport['create'](_0x2c1b62);}};Report[_0xd9db('0x1d')][_0xd9db('0x19')]=function(_0x2b1a91){RpcVoiceDialReport[_0xd9db('0x2d')](_0x2b1a91);var _0x4634f2;var _0x1c9663;var _0x1c298f=_0x2b1a91[_0xd9db('0x30')];if(_[_0xd9db('0x57')](_0x1c298f,_0xd9db('0x58'))){_0x1c9663=_0x1c298f['substring'](_0x1c298f[_0xd9db('0x59')]('/')+0x1,_0x1c298f[_0xd9db('0x59')]('@'));_0x4634f2=_['find'](this[_0xd9db('0xe')],function(_0x1fa921){return _0x1fa921[_0xd9db('0x5a')]==_0x1c9663||_0x1fa921['phone']==_0x1c9663||_0x1fa921[_0xd9db('0x21')]==_0x1c9663;});}else{_0x1c9663=_0x1c298f[_0xd9db('0x5b')](_0x1c298f['indexOf']('/')+0x1,_0x1c298f[_0xd9db('0x5c')]('-'));_0x4634f2=this[_0xd9db('0x24')](_0x1c9663);}if(_0x4634f2){_0x2b1a91[_0xd9db('0x22')]=_[_0xd9db('0x20')](_0x4634f2[_0xd9db('0x22')])?util[_0xd9db('0x23')]('SIP/%s',_0x4634f2[_0xd9db('0x1f')]):_0x4634f2[_0xd9db('0x22')];_0x2b1a91[_0xd9db('0x4c')]=_0x4634f2[_0xd9db('0x1f')];_0x2b1a91['accountcode']=_0x4634f2[_0xd9db('0x21')];RpcMemberReport[_0xd9db('0x19')](_0x2b1a91);}};Report[_0xd9db('0x1d')][_0xd9db('0x1b')]=function(_0x3c3a2b){RpcVoiceTransferReport[_0xd9db('0x46')][_0x3c3a2b['transfererlinkedid']]=_0x3c3a2b;};Report[_0xd9db('0x1d')]['attendedTransfer']=function(_0x19bae3){RpcVoiceTransferReport[_0xd9db('0x5d')](_0x19bae3);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 28d070c..e6e6417 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 _0x406a=['syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','then','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','stateTime','toNumber','toLowerCase','updateStatusRealtime','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus'];(function(_0x1407b7,_0x1bc31c){var _0x253c4b=function(_0x38819f){while(--_0x38819f){_0x1407b7['push'](_0x1407b7['shift']());}};_0x253c4b(++_0x1bc31c);}(_0x406a,0x115));var _0xa406=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x406a[_0x1d50f2];return _0x3769b8;};'use strict';var _=require('lodash');var moment=require(_0xa406('0x0'));var util=require(_0xa406('0x1'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xa406('0x2'));var logger=require(_0xa406('0x3'))(_0xa406('0x4'));var ami=require(_0xa406('0x5'));config[_0xa406('0x6')]=_[_0xa406('0x7')](config[_0xa406('0x6')],{'host':_0xa406('0x8'),'port':0x18eb});var io=require(_0xa406('0x9'))(new Redis(config[_0xa406('0x6')]));function UserReport(_0x2b1bfb){this['trunks']=_0x2b1bfb[_0xa406('0xa')];this[_0xa406('0xb')]=_0x2b1bfb[_0xa406('0xb')];this['telephones']=_0x2b1bfb[_0xa406('0xc')];ami['on'](_0xa406('0xd'),this[_0xa406('0xe')][_0xa406('0xf')](this));ami['on']('registry',this[_0xa406('0xe')][_0xa406('0xf')](this));ami['on'](_0xa406('0x10'),this[_0xa406('0x11')][_0xa406('0xf')](this));ami['on'](_0xa406('0x12'),this[_0xa406('0x13')]['bind'](this));return this[_0xa406('0x14')]();}function showSipRegistrations(){Promise[_0xa406('0x15')]()['then'](ami[_0xa406('0x16')]())[_0xa406('0x17')](function(_0x261eb4){logger[_0xa406('0x18')](_0xa406('0x19'),util[_0xa406('0x1a')](_0x261eb4,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0xa406('0x1b')]())[_0xa406('0x17')](function(_0x57dbab){logger[_0xa406('0x18')](_0xa406('0x1c'),util[_0xa406('0x1a')](_0x57dbab,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xa406('0x15')]()[_0xa406('0x1d')](ami[_0xa406('0x1e')]())['catch'](function(_0x3a88b1){logger[_0xa406('0x18')](_0xa406('0x1f'),util[_0xa406('0x1a')](_0x3a88b1,{'showHidden':![],'depth':null}));});}UserReport[_0xa406('0x20')][_0xa406('0x14')]=function(){setInterval(function(){BPromise[_0xa406('0x15')]()['then'](showSipRegistrations())[_0xa406('0x1d')](listDeviceStates())[_0xa406('0x1d')](showPeersStatus());},0x32c8);};UserReport[_0xa406('0x20')][_0xa406('0x21')]=function(_0x350ba8){return _0x350ba8!==null&&!_[_0xa406('0x22')](_0x350ba8);};UserReport[_0xa406('0x20')][_0xa406('0x23')]=function(_0x56df41,_0x20f2e5,_0x2dfabc){io['to'](_0x56df41)[_0xa406('0x23')](_0x20f2e5,_0x2dfabc);};UserReport[_0xa406('0x20')][_0xa406('0xe')]=function(_0x2513d6){try{if(this[_0xa406('0x21')](_0x2513d6)){logger[_0xa406('0x24')](_0xa406('0x25'),_0x2513d6[_0xa406('0x26')],_0x2513d6[_0xa406('0x27')]);logger['debug'](_0xa406('0x28'),util[_0xa406('0x1a')](_0x2513d6,{'showHidden':![],'depth':null}));var _0x3ef0c2=_[_0xa406('0x29')](this['trunks'],{'defaultuser':_0x2513d6[_0xa406('0x26')]});if(_0x3ef0c2){_0x2513d6[_0xa406('0x2a')]=_0x2513d6[_0xa406('0x27')];_[_0xa406('0x2b')](_0x3ef0c2,_['omit'](_0x2513d6,[_0xa406('0x2c'),_0xa406('0x2d'),_0xa406('0x26'),_0xa406('0x27')]));logger[_0xa406('0x2e')](_0xa406('0x2f'),util[_0xa406('0x1a')](_0x3ef0c2,{'showHidden':![],'depth':null}));this[_0xa406('0x23')](util[_0xa406('0x30')](_0xa406('0x31'),_0x3ef0c2[_0xa406('0x32')]),_0xa406('0x33'),_0x3ef0c2);}}}catch(_0x2c34b0){logger[_0xa406('0x18')]('[userReport][registry]',util[_0xa406('0x1a')](_0x2c34b0,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa406('0x11')]=function(_0x1c2bca){try{if(this[_0xa406('0x21')](_0x1c2bca)){logger[_0xa406('0x24')](_0xa406('0x34'),_0x1c2bca[_0xa406('0x35')],_0x1c2bca[_0xa406('0x27')]);logger['debug'](_0xa406('0x36'),util[_0xa406('0x1a')](_0x1c2bca,{'showHidden':![],'depth':null}));if(this['agents'][_0x1c2bca['device']]){if(!this[_0xa406('0xb')][_0x1c2bca[_0xa406('0x35')]]['local']||_0x1c2bca[_0xa406('0x27')]['toLowerCase']()=='inuse'){this[_0xa406('0xb')][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x37')]=![];if(this['agents'][_0x1c2bca['device']]['state']!==_0x1c2bca['state']['toLowerCase']()){this[_0xa406('0xb')][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x38')]=_[_0xa406('0x39')](moment()[_0xa406('0x30')]('x'));}this['agents'][_0x1c2bca[_0xa406('0x35')]]['state']=_0x1c2bca[_0xa406('0x27')][_0xa406('0x3a')]();this['agents'][_0x1c2bca['device']][_0xa406('0x3b')](_0x1c2bca);}}else if(this['telephones'][_0x1c2bca[_0xa406('0x35')]]){if(this[_0xa406('0xc')][_0x1c2bca['device']]['state']!==_0x1c2bca[_0xa406('0x27')][_0xa406('0x3a')]()){this['telephones'][_0x1c2bca['device']][_0xa406('0x38')]=_[_0xa406('0x39')](moment()[_0xa406('0x30')]('x'));}this[_0xa406('0xc')][_0x1c2bca[_0xa406('0x35')]]['state']=_0x1c2bca[_0xa406('0x27')]['toLowerCase']();logger[_0xa406('0x2e')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xa406('0x1a')](this[_0xa406('0xc')][_0x1c2bca[_0xa406('0x35')]],{'showHidden':![],'depth':null}));this[_0xa406('0x23')](util[_0xa406('0x30')](_0xa406('0x3c'),this[_0xa406('0xc')][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x32')]),_0xa406('0x3d'),this[_0xa406('0xc')][_0x1c2bca['device']]);}else if(this[_0xa406('0xa')][_0x1c2bca[_0xa406('0x35')]]){if(this[_0xa406('0xa')][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x27')]!==_0x1c2bca['state'][_0xa406('0x3a')]()){this[_0xa406('0xa')][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x38')]=_[_0xa406('0x39')](moment()[_0xa406('0x30')]('x'));}this[_0xa406('0xa')][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x27')]=_0x1c2bca[_0xa406('0x27')]['toLowerCase']();logger[_0xa406('0x2e')](_0xa406('0x3e'),util[_0xa406('0x1a')](this[_0xa406('0xa')][_0x1c2bca[_0xa406('0x35')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xa406('0x30')](_0xa406('0x31'),this['trunks'][_0x1c2bca[_0xa406('0x35')]][_0xa406('0x32')]),_0xa406('0x33'),this['trunks'][_0x1c2bca[_0xa406('0x35')]]);}else if(_[_0xa406('0x3f')](_0x1c2bca['device'],'Local')){var _0x4a3af4=_0x1c2bca[_0xa406('0x35')];var _0x4fb870=_0x4a3af4[_0xa406('0x40')](_0x4a3af4[_0xa406('0x41')]('/')+0x1,_0x4a3af4[_0xa406('0x41')]('@'));var _0x330746=_[_0xa406('0x29')](this[_0xa406('0xb')],function(_0x2e6469){return _0x2e6469['mobile']==_0x4fb870||_0x2e6469['phone']==_0x4fb870||_0x2e6469[_0xa406('0x42')]==_0x4fb870;});if(_0x330746){if(_0x330746[_0xa406('0x27')]!==_0x1c2bca['state'][_0xa406('0x3a')]()){_0x330746[_0xa406('0x38')]=_[_0xa406('0x39')](moment()[_0xa406('0x30')]('x'));}_0x330746[_0xa406('0x27')]=_0x1c2bca[_0xa406('0x27')][_0xa406('0x3a')]();_0x330746[_0xa406('0x37')]=!![];_0x330746['updateStatusRealtime'](_0x1c2bca);}}}}catch(_0x1de7e2){logger[_0xa406('0x18')]('[userReport][devicestatechange]',util[_0xa406('0x1a')](_0x1de7e2,{'showHidden':![],'depth':null}));}};UserReport[_0xa406('0x20')]['syncPeerStatus']=function(_0x142b14){try{if(this[_0xa406('0x21')](_0x142b14)&&this[_0xa406('0x21')](_0x142b14['peerstatus'])){logger[_0xa406('0x24')](_0xa406('0x43'),_0x142b14[_0xa406('0x44')],_0x142b14[_0xa406('0x45')],_0x142b14[_0xa406('0x12')]);logger[_0xa406('0x2e')]('[userReport][peerstatus]',util[_0xa406('0x1a')](_0x142b14,{'showHidden':![],'depth':null}));if(this[_0xa406('0xb')][_0x142b14[_0xa406('0x44')]]){if(!this['agents'][_0x142b14[_0xa406('0x44')]]['local']||_0x142b14['peerstatus']['toLowerCase']()=='registered'){this[_0xa406('0xb')][_0x142b14[_0xa406('0x44')]][_0xa406('0x37')]=![];this[_0xa406('0xb')][_0x142b14[_0xa406('0x44')]]['status']=_0x142b14[_0xa406('0x12')]['toLowerCase']();this[_0xa406('0xb')][_0x142b14[_0xa406('0x44')]]['address']=_0x142b14[_0xa406('0x45')];this[_0xa406('0xb')][_0x142b14[_0xa406('0x44')]][_0xa406('0x3b')](_0x142b14);}}else if(this[_0xa406('0xc')][_0x142b14[_0xa406('0x44')]]){this[_0xa406('0xc')][_0x142b14[_0xa406('0x44')]][_0xa406('0x46')]=_0x142b14[_0xa406('0x12')][_0xa406('0x3a')]();this['telephones'][_0x142b14[_0xa406('0x44')]][_0xa406('0x45')]=_0x142b14[_0xa406('0x45')];logger[_0xa406('0x2e')](_0xa406('0x47'),util['inspect'](this[_0xa406('0xc')][_0x142b14[_0xa406('0x44')]],{'showHidden':![],'depth':null}));this[_0xa406('0x23')](util[_0xa406('0x30')](_0xa406('0x3c'),this[_0xa406('0xc')][_0x142b14[_0xa406('0x44')]][_0xa406('0x32')]),_0xa406('0x3d'),this[_0xa406('0xc')][_0x142b14[_0xa406('0x44')]]);}else if(this[_0xa406('0xa')][_0x142b14[_0xa406('0x44')]]){this[_0xa406('0xa')][_0x142b14[_0xa406('0x44')]][_0xa406('0x46')]=_0x142b14[_0xa406('0x12')][_0xa406('0x3a')]();this[_0xa406('0xa')][_0x142b14['peer']][_0xa406('0x45')]=_0x142b14[_0xa406('0x45')];logger[_0xa406('0x2e')](_0xa406('0x48'),util[_0xa406('0x1a')](this[_0xa406('0xa')][_0x142b14['peer']],{'showHidden':![],'depth':null}));this[_0xa406('0x23')](util[_0xa406('0x30')](_0xa406('0x31'),this[_0xa406('0xa')][_0x142b14[_0xa406('0x44')]]['name']),_0xa406('0x33'),this[_0xa406('0xa')][_0x142b14[_0xa406('0x44')]]);}}}catch(_0xc860ae){logger['error'](_0xa406('0x49'),util[_0xa406('0x1a')](_0xc860ae,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xaf97=['telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','stateRegistry','merge','omit','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','name','startsWith','Local','substring','indexOf','mobile','phone','accountcode','[userReport][devicestatechange]','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','lodash','moment','ioredis','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents'];(function(_0x5f3d29,_0x831a81){var _0x49d39b=function(_0xf0212){while(--_0xf0212){_0x5f3d29['push'](_0x5f3d29['shift']());}};_0x49d39b(++_0x831a81);}(_0xaf97,0x122));var _0x7af9=function(_0x43b2e0,_0xa40a3b){_0x43b2e0=_0x43b2e0-0x0;var _0x38607c=_0xaf97[_0x43b2e0];return _0x38607c;};'use strict';var _=require(_0x7af9('0x0'));var moment=require(_0x7af9('0x1'));var util=require('util');var Redis=require(_0x7af9('0x2'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x7af9('0x3'));var ami=require('../ami');config[_0x7af9('0x4')]=_[_0x7af9('0x5')](config[_0x7af9('0x4')],{'host':_0x7af9('0x6'),'port':0x18eb});var io=require(_0x7af9('0x7'))(new Redis(config[_0x7af9('0x4')]));function UserReport(_0x1ad507){this[_0x7af9('0x8')]=_0x1ad507[_0x7af9('0x8')];this[_0x7af9('0x9')]=_0x1ad507[_0x7af9('0x9')];this[_0x7af9('0xa')]=_0x1ad507[_0x7af9('0xa')];ami['on'](_0x7af9('0xb'),this[_0x7af9('0xc')]['bind'](this));ami['on'](_0x7af9('0xd'),this[_0x7af9('0xc')][_0x7af9('0xe')](this));ami['on'](_0x7af9('0xf'),this[_0x7af9('0x10')][_0x7af9('0xe')](this));ami['on'](_0x7af9('0x11'),this[_0x7af9('0x12')][_0x7af9('0xe')](this));return this[_0x7af9('0x13')]();}function showSipRegistrations(){Promise[_0x7af9('0x14')]()[_0x7af9('0x15')](ami[_0x7af9('0x16')]())[_0x7af9('0x17')](function(_0x756a84){logger[_0x7af9('0x18')](_0x7af9('0x19'),util['inspect'](_0x756a84,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7af9('0x14')]()[_0x7af9('0x15')](ami['actionDeviceStateList']())['catch'](function(_0x4c3130){logger['error'](_0x7af9('0x1a'),util[_0x7af9('0x1b')](_0x4c3130,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x7af9('0x14')]()[_0x7af9('0x15')](ami[_0x7af9('0x1c')]())[_0x7af9('0x17')](function(_0x58fb50){logger[_0x7af9('0x18')](_0x7af9('0x1d'),util[_0x7af9('0x1b')](_0x58fb50,{'showHidden':![],'depth':null}));});}UserReport[_0x7af9('0x1e')][_0x7af9('0x13')]=function(){setInterval(function(){BPromise[_0x7af9('0x14')]()[_0x7af9('0x15')](showSipRegistrations())[_0x7af9('0x15')](listDeviceStates())[_0x7af9('0x15')](showPeersStatus());},0x32c8);};UserReport[_0x7af9('0x1e')]['isNotNull']=function(_0x289570){return _0x289570!==null&&!_[_0x7af9('0x1f')](_0x289570);};UserReport['prototype'][_0x7af9('0x20')]=function(_0x336bc4,_0x1d595d,_0x15254e){io['to'](_0x336bc4)['emit'](_0x1d595d,_0x15254e);};UserReport['prototype'][_0x7af9('0xc')]=function(_0x457075){try{if(this[_0x7af9('0x21')](_0x457075)){logger[_0x7af9('0x22')](_0x7af9('0x23'),_0x457075['username'],_0x457075[_0x7af9('0x24')]);logger['debug']('[userReport][registry]',util[_0x7af9('0x1b')](_0x457075,{'showHidden':![],'depth':null}));var _0x579b34=_[_0x7af9('0x25')](this[_0x7af9('0x8')],{'defaultuser':_0x457075['username']});if(_0x579b34){_0x457075[_0x7af9('0x26')]=_0x457075[_0x7af9('0x24')];_[_0x7af9('0x27')](_0x579b34,_[_0x7af9('0x28')](_0x457075,['event',_0x7af9('0x29'),'username','state']));logger[_0x7af9('0x2a')](_0x7af9('0x2b'),util['inspect'](_0x579b34,{'showHidden':![],'depth':null}));this[_0x7af9('0x20')](util[_0x7af9('0x2c')](_0x7af9('0x2d'),_0x579b34['name']),_0x7af9('0x2e'),_0x579b34);}}}catch(_0x1e6aad){logger[_0x7af9('0x18')](_0x7af9('0x2f'),util['inspect'](_0x1e6aad,{'showHidden':![],'depth':null}));}};UserReport[_0x7af9('0x1e')][_0x7af9('0x10')]=function(_0x3881c0){try{if(this[_0x7af9('0x21')](_0x3881c0)){logger['info'](_0x7af9('0x30'),_0x3881c0[_0x7af9('0x31')],_0x3881c0[_0x7af9('0x24')]);logger[_0x7af9('0x2a')]('[userReport][devicestatechange]',util[_0x7af9('0x1b')](_0x3881c0,{'showHidden':![],'depth':null}));if(this[_0x7af9('0x9')][_0x3881c0['device']]){if(!this[_0x7af9('0x9')][_0x3881c0[_0x7af9('0x31')]]['local']||_0x3881c0['state'][_0x7af9('0x32')]()==_0x7af9('0x33')){this[_0x7af9('0x9')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x34')]=![];if(this[_0x7af9('0x9')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x24')]!==_0x3881c0[_0x7af9('0x24')][_0x7af9('0x32')]()){this[_0x7af9('0x9')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x35')]=_[_0x7af9('0x36')](moment()[_0x7af9('0x2c')]('x'));}this[_0x7af9('0x9')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x24')]=_0x3881c0[_0x7af9('0x24')]['toLowerCase']();this[_0x7af9('0x9')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x37')](_0x3881c0);}}else if(this['telephones'][_0x3881c0[_0x7af9('0x31')]]){if(this[_0x7af9('0xa')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x24')]!==_0x3881c0[_0x7af9('0x24')]['toLowerCase']()){this[_0x7af9('0xa')][_0x3881c0['device']][_0x7af9('0x35')]=_[_0x7af9('0x36')](moment()[_0x7af9('0x2c')]('x'));}this[_0x7af9('0xa')][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x24')]=_0x3881c0['state']['toLowerCase']();logger['debug'](_0x7af9('0x38'),util['inspect'](this['telephones'][_0x3881c0[_0x7af9('0x31')]],{'showHidden':![],'depth':null}));this[_0x7af9('0x20')](util[_0x7af9('0x2c')](_0x7af9('0x39'),this[_0x7af9('0xa')][_0x3881c0['device']]['name']),'telephone:save',this['telephones'][_0x3881c0[_0x7af9('0x31')]]);}else if(this[_0x7af9('0x8')][_0x3881c0[_0x7af9('0x31')]]){if(this['trunks'][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x24')]!==_0x3881c0[_0x7af9('0x24')][_0x7af9('0x32')]()){this[_0x7af9('0x8')][_0x3881c0[_0x7af9('0x31')]]['stateTime']=_[_0x7af9('0x36')](moment()['format']('x'));}this['trunks'][_0x3881c0['device']][_0x7af9('0x24')]=_0x3881c0[_0x7af9('0x24')]['toLowerCase']();logger[_0x7af9('0x2a')](_0x7af9('0x3a'),util[_0x7af9('0x1b')](this[_0x7af9('0x8')][_0x3881c0['device']],{'showHidden':![],'depth':null}));this[_0x7af9('0x20')](util[_0x7af9('0x2c')](_0x7af9('0x2d'),this['trunks'][_0x3881c0[_0x7af9('0x31')]][_0x7af9('0x3b')]),_0x7af9('0x2e'),this['trunks'][_0x3881c0[_0x7af9('0x31')]]);}else if(_[_0x7af9('0x3c')](_0x3881c0[_0x7af9('0x31')],_0x7af9('0x3d'))){var _0x6f1076=_0x3881c0[_0x7af9('0x31')];var _0x2ac40d=_0x6f1076[_0x7af9('0x3e')](_0x6f1076['indexOf']('/')+0x1,_0x6f1076[_0x7af9('0x3f')]('@'));var _0x11b75c=_[_0x7af9('0x25')](this[_0x7af9('0x9')],function(_0x31beb5){return _0x31beb5[_0x7af9('0x40')]==_0x2ac40d||_0x31beb5[_0x7af9('0x41')]==_0x2ac40d||_0x31beb5[_0x7af9('0x42')]==_0x2ac40d;});if(_0x11b75c){if(_0x11b75c[_0x7af9('0x24')]!==_0x3881c0[_0x7af9('0x24')][_0x7af9('0x32')]()){_0x11b75c[_0x7af9('0x35')]=_['toNumber'](moment()[_0x7af9('0x2c')]('x'));}_0x11b75c['state']=_0x3881c0[_0x7af9('0x24')][_0x7af9('0x32')]();_0x11b75c['local']=!![];_0x11b75c[_0x7af9('0x37')](_0x3881c0);}}}}catch(_0x1f1216){logger[_0x7af9('0x18')](_0x7af9('0x43'),util[_0x7af9('0x1b')](_0x1f1216,{'showHidden':![],'depth':null}));}};UserReport[_0x7af9('0x1e')][_0x7af9('0x12')]=function(_0x3baab1){try{if(this[_0x7af9('0x21')](_0x3baab1)&&this[_0x7af9('0x21')](_0x3baab1[_0x7af9('0x11')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x3baab1['peer'],_0x3baab1[_0x7af9('0x44')],_0x3baab1[_0x7af9('0x11')]);logger[_0x7af9('0x2a')](_0x7af9('0x45'),util[_0x7af9('0x1b')](_0x3baab1,{'showHidden':![],'depth':null}));if(this[_0x7af9('0x9')][_0x3baab1[_0x7af9('0x46')]]){if(!this[_0x7af9('0x9')][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x34')]||_0x3baab1[_0x7af9('0x11')][_0x7af9('0x32')]()==_0x7af9('0x47')){this['agents'][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x34')]=![];this['agents'][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x48')]=_0x3baab1[_0x7af9('0x11')][_0x7af9('0x32')]();this[_0x7af9('0x9')][_0x3baab1['peer']][_0x7af9('0x44')]=_0x3baab1[_0x7af9('0x44')];this[_0x7af9('0x9')][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x37')](_0x3baab1);}}else if(this[_0x7af9('0xa')][_0x3baab1[_0x7af9('0x46')]]){this[_0x7af9('0xa')][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x48')]=_0x3baab1['peerstatus'][_0x7af9('0x32')]();this['telephones'][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x44')]=_0x3baab1[_0x7af9('0x44')];logger[_0x7af9('0x2a')](_0x7af9('0x49'),util[_0x7af9('0x1b')](this[_0x7af9('0xa')][_0x3baab1[_0x7af9('0x46')]],{'showHidden':![],'depth':null}));this[_0x7af9('0x20')](util[_0x7af9('0x2c')]('telephone:%s',this[_0x7af9('0xa')][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x3b')]),_0x7af9('0x4a'),this['telephones'][_0x3baab1['peer']]);}else if(this[_0x7af9('0x8')][_0x3baab1[_0x7af9('0x46')]]){this[_0x7af9('0x8')][_0x3baab1[_0x7af9('0x46')]]['status']=_0x3baab1[_0x7af9('0x11')]['toLowerCase']();this[_0x7af9('0x8')][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x44')]=_0x3baab1[_0x7af9('0x44')];logger[_0x7af9('0x2a')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x7af9('0x1b')](this[_0x7af9('0x8')][_0x3baab1[_0x7af9('0x46')]],{'showHidden':![],'depth':null}));this[_0x7af9('0x20')](util['format'](_0x7af9('0x2d'),this[_0x7af9('0x8')][_0x3baab1[_0x7af9('0x46')]][_0x7af9('0x3b')]),_0x7af9('0x2e'),this['trunks'][_0x3baab1[_0x7af9('0x46')]]);}}}catch(_0x5f0f80){logger[_0x7af9('0x18')]('[userReport][peerstatus]',util['inspect'](_0x5f0f80,{'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 62aeb0d..7f08014 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 _0x41de=['queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','merge','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','voiceChannels','routealias','pick','destconnectedlinenum','channel','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','talktime','acw','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','diff','[%s][voiceAgentReport][blindtransfer]','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','ami','../ami','defaults','socket.io-emitter','redis','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer'];(function(_0x39e69d,_0x5b151f){var _0x38114a=function(_0x16686b){while(--_0x16686b){_0x39e69d['push'](_0x39e69d['shift']());}};_0x38114a(++_0x5b151f);}(_0x41de,0x12c));var _0xe41d=function(_0x50d916,_0x204880){_0x50d916=_0x50d916-0x0;var _0x469530=_0x41de[_0x50d916];return _0x469530;};'use strict';var _=require(_0xe41d('0x0'));var moment=require(_0xe41d('0x1'));var util=require('util');var Redis=require(_0xe41d('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xe41d('0x3'));var ami=require(_0xe41d('0x4'));config['redis']=_[_0xe41d('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe41d('0x6'))(new Redis(config[_0xe41d('0x7')]));function VoiceAgentReport(_0x3e3b0b){this[_0xe41d('0x8')]={};this['voiceChannels']=_0x3e3b0b[_0xe41d('0x8')];this[_0xe41d('0x9')]=_0x3e3b0b[_0xe41d('0x9')];this[_0xe41d('0xa')]=_0x3e3b0b[_0xe41d('0xa')];this[_0xe41d('0xb')]={};ami['on'](_0xe41d('0xc'),this['syncAgentCalled'][_0xe41d('0xd')](this));ami['on'](_0xe41d('0xe'),this[_0xe41d('0xf')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x10'),this[_0xe41d('0x11')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x12'),this[_0xe41d('0x13')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x14'),this[_0xe41d('0x15')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x16'),this[_0xe41d('0x17')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x18'),this[_0xe41d('0x19')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x1a'),this[_0xe41d('0x1b')][_0xe41d('0xd')](this));ami['on'](_0xe41d('0x1c'),this[_0xe41d('0x1d')][_0xe41d('0xd')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xe41d('0x1e'),this['syncBlindTransfer'][_0xe41d('0xd')](this));}VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x20')]=function(_0x51192b,_0x1e7640,_0x3a44d5){io['to'](_0x51192b)[_0xe41d('0x20')](_0x1e7640,_0x3a44d5);};VoiceAgentReport['prototype'][_0xe41d('0x21')]=function(_0x3a674b){return _0x3a674b!==null&&!_[_0xe41d('0x22')](_0x3a674b);};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x23')]=function(_0x5581c5){try{if(this[_0xe41d('0x21')](_0x5581c5)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x5581c5[_0xe41d('0x24')],_0x5581c5[_0xe41d('0x25')],_0x5581c5[_0xe41d('0x26')]);logger[_0xe41d('0x27')](_0xe41d('0x28'),_0x5581c5[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x5581c5,{'showHidden':![],'depth':null}));if(_[_0xe41d('0x22')](this[_0xe41d('0x8')][_0x5581c5['uniqueid']])){this[_0xe41d('0x8')][_0x5581c5[_0xe41d('0x24')]]={};}var _0x42939c=this['agents'][_0x5581c5[_0xe41d('0x2a')]];var _0x52ba74=this['channels'][_0x5581c5[_0xe41d('0x24')]][_0x5581c5[_0xe41d('0x26')]];var _0x243197=this[_0xe41d('0x9')][_0x5581c5[_0xe41d('0x2b')]];var _0x570e6f=this['variables'][_0x5581c5['uniqueid']];if(_[_0xe41d('0x22')](_0x52ba74)){_0x52ba74={'agentcalledAt':moment()[_0xe41d('0x2c')](_0xe41d('0x2d')),'lastevent':_0xe41d('0x2e'),'mandatoryDisposition':_0x243197&&_0x243197[_0xe41d('0x2f')]?_0x243197[_0xe41d('0x2f')]:![],'type':_0x243197&&_0x243197[_0xe41d('0x30')]?_0x243197[_0xe41d('0x30')]:_0xe41d('0x31'),'variables':_0x570e6f,'motionChannel':_0xe41d('0x32')};}_[_0xe41d('0x33')](_0x52ba74,_['omit'](_0x5581c5,[_0xe41d('0x34'),_0xe41d('0x35')]));logger[_0xe41d('0x27')](_0xe41d('0x36'),_0x5581c5[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x52ba74,{'showHidden':![],'depth':null}));ami[_0xe41d('0x20')](_0xe41d('0x37'),_0x52ba74);var _0x2a7d8c={'id':_0x42939c['id'],'calleridnum':_0x52ba74[_0xe41d('0x38')],'queue':_0x52ba74[_0xe41d('0x2b')],'variables':_0x52ba74['variables'],'uniqueid':_0x5581c5['uniqueid']};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x5581c5[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x2a7d8c,{'showHidden':![],'depth':null}));this[_0xe41d('0x20')](util['format'](_0xe41d('0x39'),_0x5581c5[_0xe41d('0x25')]),_0xe41d('0x3a'),_0x2a7d8c);}}catch(_0x2da6db){logger[_0xe41d('0x3b')]('[%s][voiceAgentReport][agentcalled]',_0x5581c5[_0xe41d('0x24')],util['inspect'](_0x2da6db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0xf')]=function(_0x1593d5){try{if(this[_0xe41d('0x21')](_0x1593d5)){if(this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]]){logger[_0xe41d('0x27')](_0xe41d('0x3c'),_0x1593d5[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x1593d5,{'showHidden':![],'depth':null}));for(var _0x17e8a0 in this['channels'][_0x1593d5[_0xe41d('0x24')]]){if(this['channels'][_0x1593d5[_0xe41d('0x24')]][_0xe41d('0x3d')](_0x17e8a0)){if(_0x1593d5['destuniqueid']===_0x17e8a0){logger[_0xe41d('0x3e')](_0xe41d('0x3f'),_0x1593d5[_0xe41d('0x24')],_0x1593d5[_0xe41d('0x25')],_0x1593d5[_0xe41d('0x26')]);this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x40')]=moment()[_0xe41d('0x2c')](_0xe41d('0x2d'));this['channels'][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x41')]=_0x1593d5[_0xe41d('0x41')];this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x42')]=_0x1593d5[_0xe41d('0x42')];this[_0xe41d('0x8')][_0x1593d5['uniqueid']][_0x17e8a0]['destchannelstate']=_0x1593d5[_0xe41d('0x43')];this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x44')]=_0x1593d5[_0xe41d('0x44')];this['channels'][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x45')]=_0x1593d5['holdtime'];this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['lastevent']='connect';if(this[_0xe41d('0x46')][this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['uniqueid']]){var _0x391bf7=this['voiceChannels'][this['channels'][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['uniqueid']][_0xe41d('0x47')];this['channels'][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['routealias']=_0x391bf7;_0x1593d5['routealias']=_0x391bf7;}_[_0xe41d('0x33')](this[_0xe41d('0xa')][_0x1593d5['interface']],_[_0xe41d('0x48')](_0x1593d5,[_0xe41d('0x2b'),_0xe41d('0x49'),_0xe41d('0x47')]));var _0x45ce5a=this[_0xe41d('0xa')][_0x1593d5[_0xe41d('0x4a')]['split']('-')[0x0]];var _0x155914={'id':_0x45ce5a['id'],'name':_0x45ce5a['name'],'agentconnected':!![],'destaccountcode':_0x45ce5a['accountcode'],'destconnectedlinenum':this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x1593d5['destuniqueid']][_0xe41d('0x4b')],'queue':this['channels'][_0x1593d5[_0xe41d('0x24')]][_0x1593d5[_0xe41d('0x26')]][_0xe41d('0x2b')],'routealias':this['channels'][_0x1593d5[_0xe41d('0x24')]][_0x1593d5[_0xe41d('0x26')]]['routealias'],'uniqueid':this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x1593d5['destuniqueid']][_0xe41d('0x24')]};logger[_0xe41d('0x27')](_0xe41d('0x4c'),_0x1593d5[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x155914,{'showHidden':![],'depth':null}));ami[_0xe41d('0x20')](_0xe41d('0x4d'),_0x155914);logger[_0xe41d('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x1593d5['uniqueid'],util[_0xe41d('0x29')](_0x155914,{'showHidden':![],'depth':null}));this[_0xe41d('0x20')](util[_0xe41d('0x2c')]('user:%s',_0x1593d5[_0xe41d('0x25')]),_0xe41d('0x4e'),_0x155914);}else if(!this[_0xe41d('0x8')][_0x1593d5['uniqueid']][_0x17e8a0][_0xe41d('0x10')]&&!this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['agentcomplete']){logger[_0xe41d('0x3e')](_0xe41d('0x4f'),_0x1593d5['uniqueid'],this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x25')],_0x17e8a0);this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['agentringnoanswer']=!![];this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x50')]=moment()[_0xe41d('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['answeredelsewheredestinationuniqueid']=_0x1593d5[_0xe41d('0x26')];this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0][_0xe41d('0x51')]=_0x1593d5[_0xe41d('0x25')];this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]['lastevent']=_0xe41d('0x52');this['channels'][_0x1593d5['uniqueid']][_0x17e8a0][_0xe41d('0x53')]='answered_elsewhere';logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x1593d5[_0xe41d('0x24')],util[_0xe41d('0x29')](this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0],{'showHidden':![],'depth':null}));ami[_0xe41d('0x20')]('custom:agentansweredelsewhere',this[_0xe41d('0x8')][_0x1593d5[_0xe41d('0x24')]][_0x17e8a0]);}}}}}}catch(_0x3984da){logger['error'](_0xe41d('0x54'),_0x1593d5[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x3984da,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x11')]=function(_0x770ef0){try{if(this[_0xe41d('0x21')](_0x770ef0)){logger[_0xe41d('0x27')](_0xe41d('0x55'),_0x770ef0[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x770ef0,{'showHidden':![],'depth':null}));if(this[_0xe41d('0x8')][_0x770ef0['uniqueid']]&&this[_0xe41d('0x8')][_0x770ef0[_0xe41d('0x24')]][_0x770ef0['destuniqueid']]){logger['info'](_0xe41d('0x56'),_0x770ef0[_0xe41d('0x24')],_0x770ef0['membername'],_0x770ef0['destuniqueid']);var _0x5112d4=this[_0xe41d('0xa')][_0x770ef0[_0xe41d('0x2a')]];var _0x3d6712=this[_0xe41d('0x8')][_0x770ef0[_0xe41d('0x24')]][_0x770ef0['destuniqueid']];_0x3d6712['agentringnoanswer']=!![];_0x3d6712[_0xe41d('0x50')]=moment()[_0xe41d('0x2c')](_0xe41d('0x2d'));_0x3d6712[_0xe41d('0x57')]='rejected';_0x3d6712[_0xe41d('0x53')]='rejected';var _0x15f5e4={'id':_0x5112d4['id'],'name':_0x5112d4[_0xe41d('0x58')],'queue':_0x3d6712[_0xe41d('0x2b')],'uniqueid':_0x3d6712[_0xe41d('0x24')]};logger[_0xe41d('0x27')](_0xe41d('0x59'),_0x770ef0['uniqueid'],util[_0xe41d('0x29')](_0x15f5e4,{'showHidden':![],'depth':null}));this[_0xe41d('0x20')](util[_0xe41d('0x2c')]('user:%s',_0x5112d4[_0xe41d('0x58')]),_0xe41d('0x5a'),_0x15f5e4);ami[_0xe41d('0x20')](_0xe41d('0x5b'),_0x3d6712);}}}catch(_0x29e80a){logger[_0xe41d('0x3b')](_0xe41d('0x5c'),_0x770ef0[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x29e80a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe41d('0x13')]=function(_0x45c0a4){try{if(this[_0xe41d('0x21')](_0x45c0a4)){logger[_0xe41d('0x27')](_0xe41d('0x5d'),_0x45c0a4[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x45c0a4,{'showHidden':![],'depth':null}));if(this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]]){for(var _0x360f69 in this[_0xe41d('0x8')][_0x45c0a4['uniqueid']]){if(this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]]['hasOwnProperty'](_0x360f69)&&!this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]][_0x360f69]['agentringnoanswer']&&!this['channels'][_0x45c0a4[_0xe41d('0x24')]][_0x360f69][_0xe41d('0x14')]){logger[_0xe41d('0x3e')](_0xe41d('0x5e'),_0x45c0a4['uniqueid'],this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]][_0x360f69][_0xe41d('0x25')],_0x360f69);this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]][_0x360f69][_0xe41d('0x10')]=!![];this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]][_0x360f69][_0xe41d('0x50')]=moment()[_0xe41d('0x2c')](_0xe41d('0x2d'));this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]][_0x360f69][_0xe41d('0x57')]=_0xe41d('0x5f');this[_0xe41d('0x8')][_0x45c0a4[_0xe41d('0x24')]][_0x360f69][_0xe41d('0x53')]=_0xe41d('0x5f');logger[_0xe41d('0x27')](_0xe41d('0x60'),_0x45c0a4[_0xe41d('0x24')],util[_0xe41d('0x29')](this[_0xe41d('0x8')][_0x45c0a4['uniqueid']][_0x360f69],{'showHidden':![],'depth':null}));ami[_0xe41d('0x20')](_0xe41d('0x61'),this[_0xe41d('0x8')][_0x45c0a4['uniqueid']][_0x360f69]);}}}}}catch(_0xac027e){logger[_0xe41d('0x3b')](_0xe41d('0x62'),_0x45c0a4[_0xe41d('0x24')],util[_0xe41d('0x29')](_0xac027e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe41d('0x15')]=function(_0x3e3acd){try{if(this[_0xe41d('0x21')](_0x3e3acd)){logger[_0xe41d('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x3e3acd[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x3e3acd,{'showHidden':![],'depth':null}));if(this['channels'][_0x3e3acd[_0xe41d('0x24')]]){for(var _0x2b73ba in this['channels'][_0x3e3acd[_0xe41d('0x24')]]){if(this['channels'][_0x3e3acd[_0xe41d('0x24')]][_0xe41d('0x3d')](_0x2b73ba)){if(this['channels'][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x40')]&&!this['channels'][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x14')]){logger[_0xe41d('0x3e')](_0xe41d('0x63'),_0x3e3acd[_0xe41d('0x24')],this[_0xe41d('0x8')][_0x3e3acd['uniqueid']][_0x2b73ba][_0xe41d('0x25')],_0x2b73ba);this[_0xe41d('0x8')][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x14')]=!![];this[_0xe41d('0x8')][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x64')]=moment()[_0xe41d('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe41d('0x8')][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x57')]=_0xe41d('0x65');this[_0xe41d('0x8')][_0x3e3acd['uniqueid']][_0x2b73ba][_0xe41d('0x53')]=_0x3e3acd[_0xe41d('0x53')]==_0xe41d('0x66')?'agent':_0x3e3acd[_0xe41d('0x53')];this[_0xe41d('0x8')][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x67')]=_0x3e3acd[_0xe41d('0x67')];if(this[_0xe41d('0x9')][_0x3e3acd['queue']]&&this[_0xe41d('0x9')][_0x3e3acd[_0xe41d('0x2b')]][_0xe41d('0x68')]){this['channels'][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba]['acwtime']=this[_0xe41d('0x9')][_0x3e3acd[_0xe41d('0x2b')]][_0xe41d('0x69')];this[_0xe41d('0x8')][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba][_0xe41d('0x6a')]=!![];}this['agents'][_0x3e3acd[_0xe41d('0x2a')]]=_['omit'](this[_0xe41d('0xa')][_0x3e3acd[_0xe41d('0x2a')]],[_0xe41d('0x2b'),'destconnectedlinenum']);logger['debug'](_0xe41d('0x6b'),_0x3e3acd[_0xe41d('0x24')],util['inspect'](this['channels'][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba],{'showHidden':![],'depth':null}));ami[_0xe41d('0x20')](_0xe41d('0x6c'),this[_0xe41d('0x8')][_0x3e3acd[_0xe41d('0x24')]][_0x2b73ba]);logger[_0xe41d('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3e3acd[_0xe41d('0x24')],util[_0xe41d('0x29')]({'id':this['agents'][_0x3e3acd[_0xe41d('0x2a')]]['id'],'destaccountcode':_0x3e3acd[_0xe41d('0x6d')]},{'showHidden':![],'depth':null}));this[_0xe41d('0x20')](util[_0xe41d('0x2c')](_0xe41d('0x39'),_0x3e3acd[_0xe41d('0x25')]),_0xe41d('0x6e'),{'id':this[_0xe41d('0xa')][_0x3e3acd[_0xe41d('0x2a')]]['id'],'destaccountcode':Number(_0x3e3acd[_0xe41d('0x6d')])});}}}}}}catch(_0x174f0c){logger[_0xe41d('0x3b')](_0xe41d('0x6f'),_0x3e3acd[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x174f0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x17')]=function(_0x18f782){try{if(this[_0xe41d('0x21')](_0x18f782)){logger[_0xe41d('0x27')](_0xe41d('0x70'),_0x18f782[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x18f782,{'showHidden':![],'depth':null}));this[_0xe41d('0x71')](_0x18f782['uniqueid'],_[_0xe41d('0x72')](_0x18f782[_0xe41d('0x73')])[0x0],_0x18f782[_0xe41d('0x74')]);if(this[_0xe41d('0x8')][_0x18f782[_0xe41d('0x24')]]){for(var _0x354604 in this['channels'][_0x18f782['uniqueid']]){if(this['channels'][_0x18f782['uniqueid']][_0xe41d('0x3d')](_0x354604)){logger[_0xe41d('0x3e')](_0xe41d('0x75'),_0x18f782[_0xe41d('0x24')],_0x354604,_[_0xe41d('0x72')](_0x18f782[_0xe41d('0x73')])[0x0],_0x18f782[_0xe41d('0x74')]);if(_['isUndefined'](this[_0xe41d('0x8')][_0x18f782[_0xe41d('0x24')]][_0x354604][_0xe41d('0xb')])){this['channels'][_0x18f782[_0xe41d('0x24')]][_0x354604][_0xe41d('0xb')]={};}this[_0xe41d('0x8')][_0x18f782['uniqueid']][_0x354604]['variables']=this[_0xe41d('0xb')][_0x18f782[_0xe41d('0x24')]];}}}}}catch(_0x4a8179){logger['error'](_0xe41d('0x76'),_0x18f782['uniqueid'],util[_0xe41d('0x29')](_0x4a8179,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x71')]=function(_0x172264,_0x29343a,_0xf05907){var _0x228de2=[_0xe41d('0x77'),'rtpaudioqosbridged',_0xe41d('0x78'),'rtpaudioqosjitterbridged',_0xe41d('0x79'),_0xe41d('0x7a'),_0xe41d('0x7b'),_0xe41d('0x7c'),'sipcallid',_0xe41d('0x7d'),'bridgepeer',_0xe41d('0x7e'),_0xe41d('0x7f'),'memberdynamic',_0xe41d('0x80'),_0xe41d('0x81'),_0xe41d('0x25'),'memberpenalty',_0xe41d('0x82')];if(!_[_0xe41d('0x83')](_0x29343a)&&!_[_0xe41d('0x84')](_0x228de2,_0x29343a)){if(_[_0xe41d('0x22')](this[_0xe41d('0xb')][_0x172264])){this['variables'][_0x172264]={};}this[_0xe41d('0xb')][_0x172264][_0x29343a]=_0xf05907;}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x19')]=function(_0x1f1751){try{if(this[_0xe41d('0x21')](_0x1f1751)){logger[_0xe41d('0x27')](_0xe41d('0x85'),_0x1f1751[_0xe41d('0x24')],util['inspect'](_0x1f1751,{'showHidden':![],'depth':null}));if(this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]]){for(var _0x12df98 in this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]]){if(this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]][_0xe41d('0x3d')](_0x12df98)){if(this[_0xe41d('0x8')][_0x1f1751['uniqueid']][_0x12df98][_0xe41d('0x53')]==_0xe41d('0x66')&&this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]][_0x12df98][_0xe41d('0x14')]){logger['info'](_0xe41d('0x86'),_0x1f1751[_0xe41d('0x24')],_0x12df98);this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]][_0x12df98]['agentcompleteAt']=moment()[_0xe41d('0x2c')](_0xe41d('0x2d'));}}}logger[_0xe41d('0x27')](_0xe41d('0x87'),_0x1f1751[_0xe41d('0x24')],util[_0xe41d('0x29')](_['values'](this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]]),{'showHidden':![],'depth':null}));ami[_0xe41d('0x20')](_0xe41d('0x88'),_['values'](this[_0xe41d('0x8')][_0x1f1751[_0xe41d('0x24')]]));delete this['channels'][_0x1f1751[_0xe41d('0x24')]];}if(this['variables'][_0x1f1751[_0xe41d('0x24')]]){delete this[_0xe41d('0xb')][_0x1f1751[_0xe41d('0x24')]];}}}catch(_0x423b41){logger['error'](_0xe41d('0x89'),_0x1f1751[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x423b41,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe41d('0x8a')]=function(_0x410841){try{if(this[_0xe41d('0x21')](_0x410841)){logger[_0xe41d('0x27')](_0xe41d('0x8b'),_0x410841[_0xe41d('0x24')],util['inspect'](_0x410841,{'showHidden':![],'depth':null}));if(this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]]){for(var _0x591282 in this['channels'][_0x410841['transfereeuniqueid']]){if(this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]][_0xe41d('0x3d')](_0x591282)){if(_0x410841[_0xe41d('0x8d')]===_0x591282){logger['info'](_0xe41d('0x8e'),_0x410841[_0xe41d('0x24')],this[_0xe41d('0x8')][_0x410841['transfereeuniqueid']][_0x591282][_0xe41d('0x25')],_0x591282);var _0xe36c3d=moment();this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]][_0x591282][_0xe41d('0x14')]=!![];this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]][_0x591282][_0xe41d('0x64')]=moment()[_0xe41d('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]][_0x591282][_0xe41d('0x57')]='complete';this[_0xe41d('0x8')][_0x410841['transfereeuniqueid']][_0x591282][_0xe41d('0x53')]=_0xe41d('0x66');this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]][_0x591282][_0xe41d('0x67')]=_0xe36c3d['diff'](this['channels'][_0x410841[_0xe41d('0x8c')]][_0x591282][_0xe41d('0x40')],_0xe41d('0x8f'));}}}}if(this[_0xe41d('0x8')][_0x410841[_0xe41d('0x90')]]){var _0x5c8f79=this[_0xe41d('0x8')][_0x410841[_0xe41d('0x90')]];this['channels'][_0x410841[_0xe41d('0x90')]]=this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]];this[_0xe41d('0x8')][_0x410841[_0xe41d('0x8c')]]=_0x5c8f79;}}}catch(_0x30ccf2){logger[_0xe41d('0x3b')](_0xe41d('0x91'),_0x410841[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x30ccf2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x92')]=function(_0x32da9e){try{if(this['isNotNull'](_0x32da9e)){logger['debug'](_0xe41d('0x93'),_0x32da9e[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x32da9e,{'showHidden':![],'depth':null}));if(this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]]){for(var _0x260bb6 in this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]]){if(this[_0xe41d('0x8')][_0x32da9e['transfereeuniqueid']][_0xe41d('0x3d')](_0x260bb6)){if(_0x32da9e['transfereruniqueid']===_0x260bb6){logger[_0xe41d('0x3e')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x32da9e['uniqueid'],this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]][_0x260bb6][_0xe41d('0x25')],_0x260bb6);var _0x44ed26=moment();this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]][_0x260bb6][_0xe41d('0x14')]=!![];this[_0xe41d('0x8')][_0x32da9e['transfereeuniqueid']][_0x260bb6]['agentcompleteAt']=_0x44ed26;this['channels'][_0x32da9e[_0xe41d('0x8c')]][_0x260bb6][_0xe41d('0x57')]=_0xe41d('0x65');this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]][_0x260bb6][_0xe41d('0x53')]='transfer';this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]][_0x260bb6][_0xe41d('0x67')]=_0x44ed26[_0xe41d('0x94')](this[_0xe41d('0x8')][_0x32da9e[_0xe41d('0x8c')]][_0x260bb6][_0xe41d('0x40')],_0xe41d('0x8f'));}}}}}}catch(_0x453b76){logger[_0xe41d('0x3b')](_0xe41d('0x95'),_0x32da9e[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x453b76,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x1b')]=function(_0x1666a8){var _0xdbfc7e='';try{if(this[_0xe41d('0x21')](_0x1666a8)){logger[_0xe41d('0x27')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1666a8[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x1666a8,{'showHidden':![],'depth':null}));if(_0x1666a8[_0xe41d('0x4a')]){_0xdbfc7e=_0x1666a8[_0xe41d('0x4a')][_0xe41d('0x96')](0x0,_0x1666a8[_0xe41d('0x4a')][_0xe41d('0x97')]('-'));if(this[_0xe41d('0xa')][_0xdbfc7e]){logger[_0xe41d('0x3e')](_0xe41d('0x98'),_0x1666a8[_0xe41d('0x24')],_0xdbfc7e);this[_0xe41d('0xa')][_0xdbfc7e][_0xe41d('0x99')]=!![];}}}}catch(_0x4fb360){logger[_0xe41d('0x3b')](_0xe41d('0x9a'),_0x1666a8['uniqueid'],util[_0xe41d('0x29')](_0x4fb360,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe41d('0x1f')][_0xe41d('0x1d')]=function(_0x5e0495){var _0x3afa5c='';try{if(this['isNotNull'](_0x5e0495)){logger[_0xe41d('0x27')](_0xe41d('0x9b'),_0x5e0495[_0xe41d('0x24')],util['inspect'](_0x5e0495,{'showHidden':![],'depth':null}));if(_0x5e0495['channel']){_0x3afa5c=_0x5e0495[_0xe41d('0x4a')][_0xe41d('0x96')](0x0,_0x5e0495[_0xe41d('0x4a')][_0xe41d('0x97')]('-'));if(this[_0xe41d('0xa')][_0x3afa5c]){logger[_0xe41d('0x3e')](_0xe41d('0x9c'),_0x5e0495[_0xe41d('0x24')],_0x3afa5c);this[_0xe41d('0xa')][_0x3afa5c][_0xe41d('0x99')]=![];}}}}catch(_0x10e35a){logger[_0xe41d('0x3b')](_0xe41d('0x9d'),_0x5e0495[_0xe41d('0x24')],util[_0xe41d('0x29')](_0x10e35a,{'showHidden':![],'depth':null}));}};module[_0xe41d('0x9e')]=VoiceAgentReport; \ No newline at end of file +var _0x728b=['addVariable','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','redis','localhost','voiceChannels','channels','voiceQueues','agents','syncAgentCalled','syncAgentConnect','bind','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','debug','isUndefined','interface','queue','variables','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','merge','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','membername','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','pick','destconnectedlinenum','channel','split','accountcode','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x728b,0x16f));var _0xb728=function(_0x210e48,_0x60e1cd){_0x210e48=_0x210e48-0x0;var _0x572ad9=_0x728b[_0x210e48];return _0x572ad9;};'use strict';var _=require(_0xb728('0x0'));var moment=require(_0xb728('0x1'));var util=require(_0xb728('0x2'));var Redis=require(_0xb728('0x3'));var config=require(_0xb728('0x4'));var logger=require('../../../config/logger')(_0xb728('0x5'));var ami=require(_0xb728('0x6'));config[_0xb728('0x7')]=_['defaults'](config[_0xb728('0x7')],{'host':_0xb728('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb728('0x7')]));function VoiceAgentReport(_0x8cd6e2){this['channels']={};this[_0xb728('0x9')]=_0x8cd6e2[_0xb728('0xa')];this[_0xb728('0xb')]=_0x8cd6e2[_0xb728('0xb')];this[_0xb728('0xc')]=_0x8cd6e2[_0xb728('0xc')];this['variables']={};ami['on']('agentcalled',this[_0xb728('0xd')]['bind'](this));ami['on']('agentconnect',this[_0xb728('0xe')][_0xb728('0xf')](this));ami['on'](_0xb728('0x10'),this['syncAgentRingNoAnswer'][_0xb728('0xf')](this));ami['on'](_0xb728('0x11'),this[_0xb728('0x12')]['bind'](this));ami['on'](_0xb728('0x13'),this[_0xb728('0x14')][_0xb728('0xf')](this));ami['on'](_0xb728('0x15'),this[_0xb728('0x16')][_0xb728('0xf')](this));ami['on'](_0xb728('0x17'),this['syncHangup'][_0xb728('0xf')](this));ami['on'](_0xb728('0x18'),this[_0xb728('0x19')][_0xb728('0xf')](this));ami['on'](_0xb728('0x1a'),this['syncMusicOnHoldStop'][_0xb728('0xf')](this));ami['on']('attendedtransfer',this[_0xb728('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0xb728('0x1c')][_0xb728('0xf')](this));}VoiceAgentReport['prototype'][_0xb728('0x1d')]=function(_0x327b4f,_0x396f15,_0xcea064){io['to'](_0x327b4f)[_0xb728('0x1d')](_0x396f15,_0xcea064);};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0x1f')]=function(_0x45c0f3){return _0x45c0f3!==null&&!_['isUndefined'](_0x45c0f3);};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0xd')]=function(_0x1be6d6){try{if(this[_0xb728('0x1f')](_0x1be6d6)){logger[_0xb728('0x20')](_0xb728('0x21'),_0x1be6d6[_0xb728('0x22')],_0x1be6d6['membername'],_0x1be6d6[_0xb728('0x23')]);logger[_0xb728('0x24')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x1be6d6[_0xb728('0x22')],util['inspect'](_0x1be6d6,{'showHidden':![],'depth':null}));if(_[_0xb728('0x25')](this[_0xb728('0xa')][_0x1be6d6[_0xb728('0x22')]])){this[_0xb728('0xa')][_0x1be6d6[_0xb728('0x22')]]={};}var _0x2d3b3b=this['agents'][_0x1be6d6[_0xb728('0x26')]];var _0xcf7934=this[_0xb728('0xa')][_0x1be6d6[_0xb728('0x22')]][_0x1be6d6['destuniqueid']];var _0x302d26=this[_0xb728('0xb')][_0x1be6d6[_0xb728('0x27')]];var _0x2a9dee=this[_0xb728('0x28')][_0x1be6d6[_0xb728('0x22')]];if(_['isUndefined'](_0xcf7934)){_0xcf7934={'agentcalledAt':moment()[_0xb728('0x29')](_0xb728('0x2a')),'lastevent':_0xb728('0x2b'),'mandatoryDisposition':_0x302d26&&_0x302d26['mandatoryDisposition']?_0x302d26[_0xb728('0x2c')]:![],'type':_0x302d26&&_0x302d26[_0xb728('0x2d')]?_0x302d26[_0xb728('0x2d')]:_0xb728('0x2e'),'variables':_0x2a9dee,'motionChannel':_0xb728('0x2f')};}_[_0xb728('0x30')](_0xcf7934,_['omit'](_0x1be6d6,[_0xb728('0x31'),'privilege']));logger[_0xb728('0x24')](_0xb728('0x32'),_0x1be6d6[_0xb728('0x22')],util[_0xb728('0x33')](_0xcf7934,{'showHidden':![],'depth':null}));ami[_0xb728('0x1d')](_0xb728('0x34'),_0xcf7934);var _0x2d7bbc={'id':_0x2d3b3b['id'],'calleridnum':_0xcf7934[_0xb728('0x35')],'queue':_0xcf7934[_0xb728('0x27')],'variables':_0xcf7934['variables'],'uniqueid':_0x1be6d6[_0xb728('0x22')]};logger[_0xb728('0x24')](_0xb728('0x36'),_0x1be6d6[_0xb728('0x22')],util['inspect'](_0x2d7bbc,{'showHidden':![],'depth':null}));this[_0xb728('0x1d')](util[_0xb728('0x29')](_0xb728('0x37'),_0x1be6d6['membername']),_0xb728('0x38'),_0x2d7bbc);}}catch(_0x2ba0ce){logger[_0xb728('0x39')]('[%s][voiceAgentReport][agentcalled]',_0x1be6d6[_0xb728('0x22')],util[_0xb728('0x33')](_0x2ba0ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb728('0xe')]=function(_0x233b21){try{if(this[_0xb728('0x1f')](_0x233b21)){if(this['channels'][_0x233b21[_0xb728('0x22')]]){logger[_0xb728('0x24')](_0xb728('0x3a'),_0x233b21[_0xb728('0x22')],util[_0xb728('0x33')](_0x233b21,{'showHidden':![],'depth':null}));for(var _0x25a99c in this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]]){if(this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0xb728('0x3b')](_0x25a99c)){if(_0x233b21[_0xb728('0x23')]===_0x25a99c){logger[_0xb728('0x20')](_0xb728('0x3c'),_0x233b21[_0xb728('0x22')],_0x233b21[_0xb728('0x3d')],_0x233b21[_0xb728('0x23')]);this[_0xb728('0xa')][_0x233b21['uniqueid']][_0x25a99c][_0xb728('0x3e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x233b21['uniqueid']][_0x25a99c][_0xb728('0x3f')]=_0x233b21['connectedlinename'];this[_0xb728('0xa')][_0x233b21['uniqueid']][_0x25a99c][_0xb728('0x40')]=_0x233b21[_0xb728('0x40')];this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x41')]=_0x233b21['destchannelstate'];this[_0xb728('0xa')][_0x233b21['uniqueid']][_0x25a99c][_0xb728('0x42')]=_0x233b21[_0xb728('0x42')];this[_0xb728('0xa')][_0x233b21['uniqueid']][_0x25a99c][_0xb728('0x43')]=_0x233b21[_0xb728('0x43')];this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x44')]='connect';if(this[_0xb728('0x9')][this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x22')]]){var _0x1995f3=this[_0xb728('0x9')][this['channels'][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x22')]][_0xb728('0x45')];this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x45')]=_0x1995f3;_0x233b21[_0xb728('0x45')]=_0x1995f3;}_[_0xb728('0x30')](this['agents'][_0x233b21[_0xb728('0x26')]],_[_0xb728('0x46')](_0x233b21,[_0xb728('0x27'),_0xb728('0x47'),_0xb728('0x45')]));var _0x23dd37=this[_0xb728('0xc')][_0x233b21[_0xb728('0x48')][_0xb728('0x49')]('-')[0x0]];var _0x3819c6={'id':_0x23dd37['id'],'name':_0x23dd37['name'],'agentconnected':!![],'destaccountcode':_0x23dd37[_0xb728('0x4a')],'destconnectedlinenum':this['channels'][_0x233b21[_0xb728('0x22')]][_0x233b21[_0xb728('0x23')]][_0xb728('0x4b')],'queue':this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x233b21[_0xb728('0x23')]][_0xb728('0x27')],'routealias':this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x233b21[_0xb728('0x23')]][_0xb728('0x45')],'uniqueid':this['channels'][_0x233b21[_0xb728('0x22')]][_0x233b21[_0xb728('0x23')]][_0xb728('0x22')]};logger[_0xb728('0x24')](_0xb728('0x4c'),_0x233b21[_0xb728('0x22')],util['inspect'](_0x3819c6,{'showHidden':![],'depth':null}));ami[_0xb728('0x1d')](_0xb728('0x4d'),_0x3819c6);logger[_0xb728('0x24')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x233b21[_0xb728('0x22')],util[_0xb728('0x33')](_0x3819c6,{'showHidden':![],'depth':null}));this[_0xb728('0x1d')](util[_0xb728('0x29')](_0xb728('0x37'),_0x233b21[_0xb728('0x3d')]),_0xb728('0x4e'),_0x3819c6);}else if(!this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c]['agentringnoanswer']&&!this['channels'][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x13')]){logger[_0xb728('0x20')](_0xb728('0x4f'),_0x233b21['uniqueid'],this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x3d')],_0x25a99c);this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x10')]=!![];this['channels'][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x50')]=moment()[_0xb728('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c]['answeredelsewheredestinationuniqueid']=_0x233b21['destuniqueid'];this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c][_0xb728('0x51')]=_0x233b21[_0xb728('0x3d')];this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c]['lastevent']=_0xb728('0x52');this['channels'][_0x233b21[_0xb728('0x22')]][_0x25a99c]['reason']=_0xb728('0x52');logger[_0xb728('0x24')](_0xb728('0x53'),_0x233b21[_0xb728('0x22')],util['inspect'](this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this[_0xb728('0xa')][_0x233b21[_0xb728('0x22')]][_0x25a99c]);}}}}}}catch(_0x4b015a){logger[_0xb728('0x39')](_0xb728('0x54'),_0x233b21[_0xb728('0x22')],util[_0xb728('0x33')](_0x4b015a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb728('0x1e')]['syncAgentRingNoAnswer']=function(_0x2f0271){try{if(this['isNotNull'](_0x2f0271)){logger['debug'](_0xb728('0x55'),_0x2f0271[_0xb728('0x22')],util[_0xb728('0x33')](_0x2f0271,{'showHidden':![],'depth':null}));if(this[_0xb728('0xa')][_0x2f0271[_0xb728('0x22')]]&&this[_0xb728('0xa')][_0x2f0271[_0xb728('0x22')]][_0x2f0271['destuniqueid']]){logger[_0xb728('0x20')](_0xb728('0x56'),_0x2f0271['uniqueid'],_0x2f0271['membername'],_0x2f0271['destuniqueid']);var _0x2ad79f=this[_0xb728('0xc')][_0x2f0271[_0xb728('0x26')]];var _0x2fae7d=this['channels'][_0x2f0271[_0xb728('0x22')]][_0x2f0271[_0xb728('0x23')]];_0x2fae7d[_0xb728('0x10')]=!![];_0x2fae7d[_0xb728('0x50')]=moment()[_0xb728('0x29')](_0xb728('0x2a'));_0x2fae7d[_0xb728('0x44')]=_0xb728('0x57');_0x2fae7d[_0xb728('0x58')]=_0xb728('0x57');var _0x379f19={'id':_0x2ad79f['id'],'name':_0x2ad79f['name'],'queue':_0x2fae7d[_0xb728('0x27')],'uniqueid':_0x2fae7d[_0xb728('0x22')]};logger['debug'](_0xb728('0x59'),_0x2f0271['uniqueid'],util['inspect'](_0x379f19,{'showHidden':![],'depth':null}));this[_0xb728('0x1d')](util[_0xb728('0x29')](_0xb728('0x37'),_0x2ad79f['name']),_0xb728('0x5a'),_0x379f19);ami[_0xb728('0x1d')](_0xb728('0x5b'),_0x2fae7d);}}}catch(_0x3d62fd){logger[_0xb728('0x39')]('[%s][voiceAgentReport][agentringnoanswer]',_0x2f0271[_0xb728('0x22')],util[_0xb728('0x33')](_0x3d62fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x476160){try{if(this[_0xb728('0x1f')](_0x476160)){logger[_0xb728('0x24')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x476160[_0xb728('0x22')],util[_0xb728('0x33')](_0x476160,{'showHidden':![],'depth':null}));if(this[_0xb728('0xa')][_0x476160['uniqueid']]){for(var _0x2f78b4 in this[_0xb728('0xa')][_0x476160['uniqueid']]){if(this['channels'][_0x476160['uniqueid']][_0xb728('0x3b')](_0x2f78b4)&&!this[_0xb728('0xa')][_0x476160[_0xb728('0x22')]][_0x2f78b4]['agentringnoanswer']&&!this['channels'][_0x476160['uniqueid']][_0x2f78b4][_0xb728('0x13')]){logger[_0xb728('0x20')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x476160[_0xb728('0x22')],this[_0xb728('0xa')][_0x476160[_0xb728('0x22')]][_0x2f78b4][_0xb728('0x3d')],_0x2f78b4);this[_0xb728('0xa')][_0x476160[_0xb728('0x22')]][_0x2f78b4][_0xb728('0x10')]=!![];this['channels'][_0x476160[_0xb728('0x22')]][_0x2f78b4][_0xb728('0x50')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x476160[_0xb728('0x22')]][_0x2f78b4]['lastevent']=_0xb728('0x5c');this[_0xb728('0xa')][_0x476160[_0xb728('0x22')]][_0x2f78b4][_0xb728('0x58')]=_0xb728('0x5c');logger[_0xb728('0x24')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x476160['uniqueid'],util[_0xb728('0x33')](this['channels'][_0x476160[_0xb728('0x22')]][_0x2f78b4],{'showHidden':![],'depth':null}));ami[_0xb728('0x1d')](_0xb728('0x5d'),this['channels'][_0x476160[_0xb728('0x22')]][_0x2f78b4]);}}}}}catch(_0x4ed187){logger[_0xb728('0x39')](_0xb728('0x5e'),_0x476160['uniqueid'],util['inspect'](_0x4ed187,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb728('0x14')]=function(_0x42a0b4){try{if(this[_0xb728('0x1f')](_0x42a0b4)){logger[_0xb728('0x24')](_0xb728('0x5f'),_0x42a0b4['uniqueid'],util[_0xb728('0x33')](_0x42a0b4,{'showHidden':![],'depth':null}));if(this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]]){for(var _0x3946f8 in this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]]){if(this['channels'][_0x42a0b4['uniqueid']][_0xb728('0x3b')](_0x3946f8)){if(this['channels'][_0x42a0b4[_0xb728('0x22')]][_0x3946f8]['agentconnectAt']&&!this['channels'][_0x42a0b4['uniqueid']][_0x3946f8][_0xb728('0x13')]){logger[_0xb728('0x20')](_0xb728('0x60'),_0x42a0b4[_0xb728('0x22')],this['channels'][_0x42a0b4[_0xb728('0x22')]][_0x3946f8][_0xb728('0x3d')],_0x3946f8);this[_0xb728('0xa')][_0x42a0b4['uniqueid']][_0x3946f8][_0xb728('0x13')]=!![];this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]][_0x3946f8]['agentcompleteAt']=moment()[_0xb728('0x29')](_0xb728('0x2a'));this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]][_0x3946f8][_0xb728('0x44')]=_0xb728('0x61');this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]][_0x3946f8][_0xb728('0x58')]=_0x42a0b4[_0xb728('0x58')]==_0xb728('0x62')?_0xb728('0x63'):_0x42a0b4[_0xb728('0x58')];this[_0xb728('0xa')][_0x42a0b4['uniqueid']][_0x3946f8][_0xb728('0x64')]=_0x42a0b4[_0xb728('0x64')];if(this[_0xb728('0xb')][_0x42a0b4[_0xb728('0x27')]]&&this[_0xb728('0xb')][_0x42a0b4[_0xb728('0x27')]]['acw']){this['channels'][_0x42a0b4[_0xb728('0x22')]][_0x3946f8][_0xb728('0x65')]=this[_0xb728('0xb')][_0x42a0b4[_0xb728('0x27')]][_0xb728('0x66')];this[_0xb728('0xa')][_0x42a0b4['uniqueid']][_0x3946f8][_0xb728('0x67')]=!![];}this['agents'][_0x42a0b4[_0xb728('0x26')]]=_[_0xb728('0x68')](this[_0xb728('0xc')][_0x42a0b4[_0xb728('0x26')]],[_0xb728('0x27'),'destconnectedlinenum']);logger[_0xb728('0x24')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x42a0b4[_0xb728('0x22')],util['inspect'](this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]][_0x3946f8],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0xb728('0xa')][_0x42a0b4[_0xb728('0x22')]][_0x3946f8]);logger['debug'](_0xb728('0x69'),_0x42a0b4[_0xb728('0x22')],util[_0xb728('0x33')]({'id':this[_0xb728('0xc')][_0x42a0b4[_0xb728('0x26')]]['id'],'destaccountcode':_0x42a0b4[_0xb728('0x6a')]},{'showHidden':![],'depth':null}));this[_0xb728('0x1d')](util[_0xb728('0x29')](_0xb728('0x37'),_0x42a0b4['membername']),'user:agentcomplete',{'id':this[_0xb728('0xc')][_0x42a0b4['interface']]['id'],'destaccountcode':Number(_0x42a0b4[_0xb728('0x6a')])});}}}}}}catch(_0xa11006){logger[_0xb728('0x39')](_0xb728('0x6b'),_0x42a0b4[_0xb728('0x22')],util[_0xb728('0x33')](_0xa11006,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb728('0x16')]=function(_0x1e4e57){try{if(this['isNotNull'](_0x1e4e57)){logger[_0xb728('0x24')]('[%s][voiceAgentReport][varset]\x20event:',_0x1e4e57[_0xb728('0x22')],util[_0xb728('0x33')](_0x1e4e57,{'showHidden':![],'depth':null}));this['addVariable'](_0x1e4e57[_0xb728('0x22')],_[_0xb728('0x6c')](_0x1e4e57[_0xb728('0x6d')])[0x0],_0x1e4e57[_0xb728('0x6e')]);if(this[_0xb728('0xa')][_0x1e4e57[_0xb728('0x22')]]){for(var _0x32c255 in this[_0xb728('0xa')][_0x1e4e57['uniqueid']]){if(this[_0xb728('0xa')][_0x1e4e57['uniqueid']][_0xb728('0x3b')](_0x32c255)){logger[_0xb728('0x20')](_0xb728('0x6f'),_0x1e4e57['uniqueid'],_0x32c255,_['keys'](_0x1e4e57[_0xb728('0x6d')])[0x0],_0x1e4e57[_0xb728('0x6e')]);if(_['isUndefined'](this[_0xb728('0xa')][_0x1e4e57['uniqueid']][_0x32c255][_0xb728('0x28')])){this[_0xb728('0xa')][_0x1e4e57['uniqueid']][_0x32c255][_0xb728('0x28')]={};}this[_0xb728('0xa')][_0x1e4e57[_0xb728('0x22')]][_0x32c255][_0xb728('0x28')]=this['variables'][_0x1e4e57[_0xb728('0x22')]];}}}}}catch(_0x507c89){logger[_0xb728('0x39')](_0xb728('0x70'),_0x1e4e57[_0xb728('0x22')],util[_0xb728('0x33')](_0x507c89,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0x71')]=function(_0x8add73,_0x424db8,_0x353dd5){var _0x1e3294=[_0xb728('0x72'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xb728('0x73'),_0xb728('0x74'),_0xb728('0x75'),_0xb728('0x76'),_0xb728('0x77'),_0xb728('0x78'),'sipuri',_0xb728('0x79'),_0xb728('0x7a'),'membercalls',_0xb728('0x7b'),_0xb728('0x7c'),_0xb728('0x7d'),_0xb728('0x3d'),_0xb728('0x7e'),_0xb728('0x7f')];if(!_[_0xb728('0x80')](_0x424db8)&&!_[_0xb728('0x81')](_0x1e3294,_0x424db8)){if(_[_0xb728('0x25')](this[_0xb728('0x28')][_0x8add73])){this[_0xb728('0x28')][_0x8add73]={};}this['variables'][_0x8add73][_0x424db8]=_0x353dd5;}};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0x82')]=function(_0x3efeee){try{if(this[_0xb728('0x1f')](_0x3efeee)){logger[_0xb728('0x24')](_0xb728('0x83'),_0x3efeee[_0xb728('0x22')],util[_0xb728('0x33')](_0x3efeee,{'showHidden':![],'depth':null}));if(this['channels'][_0x3efeee[_0xb728('0x22')]]){for(var _0x465bd2 in this[_0xb728('0xa')][_0x3efeee[_0xb728('0x22')]]){if(this[_0xb728('0xa')][_0x3efeee[_0xb728('0x22')]]['hasOwnProperty'](_0x465bd2)){if(this[_0xb728('0xa')][_0x3efeee[_0xb728('0x22')]][_0x465bd2][_0xb728('0x58')]=='transfer'&&this[_0xb728('0xa')][_0x3efeee[_0xb728('0x22')]][_0x465bd2][_0xb728('0x13')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x3efeee[_0xb728('0x22')],_0x465bd2);this['channels'][_0x3efeee[_0xb728('0x22')]][_0x465bd2]['agentcompleteAt']=moment()['format'](_0xb728('0x2a'));}}}logger[_0xb728('0x24')](_0xb728('0x84'),_0x3efeee[_0xb728('0x22')],util['inspect'](_[_0xb728('0x85')](this[_0xb728('0xa')][_0x3efeee[_0xb728('0x22')]]),{'showHidden':![],'depth':null}));ami[_0xb728('0x1d')](_0xb728('0x86'),_['values'](this[_0xb728('0xa')][_0x3efeee['uniqueid']]));delete this['channels'][_0x3efeee['uniqueid']];}if(this[_0xb728('0x28')][_0x3efeee[_0xb728('0x22')]]){delete this['variables'][_0x3efeee['uniqueid']];}}}catch(_0x46d5d4){logger[_0xb728('0x39')](_0xb728('0x87'),_0x3efeee['uniqueid'],util['inspect'](_0x46d5d4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0x1b')]=function(_0x4a4022){try{if(this[_0xb728('0x1f')](_0x4a4022)){logger[_0xb728('0x24')](_0xb728('0x88'),_0x4a4022['uniqueid'],util[_0xb728('0x33')](_0x4a4022,{'showHidden':![],'depth':null}));if(this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]]){for(var _0x3dfcdc in this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]]){if(this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]]['hasOwnProperty'](_0x3dfcdc)){if(_0x4a4022[_0xb728('0x8a')]===_0x3dfcdc){logger[_0xb728('0x20')](_0xb728('0x8b'),_0x4a4022[_0xb728('0x22')],this[_0xb728('0xa')][_0x4a4022['transfereeuniqueid']][_0x3dfcdc][_0xb728('0x3d')],_0x3dfcdc);var _0x51e4f6=moment();this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]][_0x3dfcdc][_0xb728('0x13')]=!![];this['channels'][_0x4a4022[_0xb728('0x89')]][_0x3dfcdc][_0xb728('0x8c')]=moment()[_0xb728('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]][_0x3dfcdc]['lastevent']='complete';this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]][_0x3dfcdc][_0xb728('0x58')]=_0xb728('0x62');this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]][_0x3dfcdc][_0xb728('0x64')]=_0x51e4f6[_0xb728('0x8d')](this['channels'][_0x4a4022[_0xb728('0x89')]][_0x3dfcdc][_0xb728('0x3e')],_0xb728('0x8e'));}}}}if(this[_0xb728('0xa')][_0x4a4022[_0xb728('0x8f')]]){var _0x221454=this['channels'][_0x4a4022[_0xb728('0x8f')]];this[_0xb728('0xa')][_0x4a4022[_0xb728('0x8f')]]=this['channels'][_0x4a4022[_0xb728('0x89')]];this[_0xb728('0xa')][_0x4a4022[_0xb728('0x89')]]=_0x221454;}}}catch(_0x584b5b){logger[_0xb728('0x39')](_0xb728('0x90'),_0x4a4022['uniqueid'],util['inspect'](_0x584b5b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0x1c')]=function(_0x5f29da){try{if(this[_0xb728('0x1f')](_0x5f29da)){logger[_0xb728('0x24')](_0xb728('0x91'),_0x5f29da[_0xb728('0x22')],util[_0xb728('0x33')](_0x5f29da,{'showHidden':![],'depth':null}));if(this[_0xb728('0xa')][_0x5f29da[_0xb728('0x89')]]){for(var _0xdf8e35 in this[_0xb728('0xa')][_0x5f29da[_0xb728('0x89')]]){if(this[_0xb728('0xa')][_0x5f29da[_0xb728('0x89')]][_0xb728('0x3b')](_0xdf8e35)){if(_0x5f29da[_0xb728('0x92')]===_0xdf8e35){logger[_0xb728('0x20')](_0xb728('0x93'),_0x5f29da['uniqueid'],this[_0xb728('0xa')][_0x5f29da['transfereeuniqueid']][_0xdf8e35]['membername'],_0xdf8e35);var _0x5dda73=moment();this[_0xb728('0xa')][_0x5f29da[_0xb728('0x89')]][_0xdf8e35]['agentcomplete']=!![];this[_0xb728('0xa')][_0x5f29da['transfereeuniqueid']][_0xdf8e35][_0xb728('0x8c')]=_0x5dda73;this['channels'][_0x5f29da[_0xb728('0x89')]][_0xdf8e35][_0xb728('0x44')]=_0xb728('0x61');this[_0xb728('0xa')][_0x5f29da['transfereeuniqueid']][_0xdf8e35][_0xb728('0x58')]=_0xb728('0x62');this[_0xb728('0xa')][_0x5f29da[_0xb728('0x89')]][_0xdf8e35][_0xb728('0x64')]=_0x5dda73[_0xb728('0x8d')](this['channels'][_0x5f29da[_0xb728('0x89')]][_0xdf8e35][_0xb728('0x3e')],_0xb728('0x8e'));}}}}}}catch(_0x173918){logger[_0xb728('0x39')](_0xb728('0x94'),_0x5f29da[_0xb728('0x22')],util['inspect'](_0x173918,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb728('0x1e')]['syncMusicOnHoldStart']=function(_0x4e0f17){var _0x595669='';try{if(this[_0xb728('0x1f')](_0x4e0f17)){logger[_0xb728('0x24')](_0xb728('0x95'),_0x4e0f17[_0xb728('0x22')],util[_0xb728('0x33')](_0x4e0f17,{'showHidden':![],'depth':null}));if(_0x4e0f17[_0xb728('0x48')]){_0x595669=_0x4e0f17['channel']['substring'](0x0,_0x4e0f17[_0xb728('0x48')][_0xb728('0x96')]('-'));if(this[_0xb728('0xc')][_0x595669]){logger['info'](_0xb728('0x97'),_0x4e0f17[_0xb728('0x22')],_0x595669);this[_0xb728('0xc')][_0x595669][_0xb728('0x98')]=!![];}}}}catch(_0x5e3290){logger['error'](_0xb728('0x99'),_0x4e0f17[_0xb728('0x22')],util[_0xb728('0x33')](_0x5e3290,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb728('0x1e')][_0xb728('0x9a')]=function(_0x572d89){var _0x375580='';try{if(this[_0xb728('0x1f')](_0x572d89)){logger[_0xb728('0x24')](_0xb728('0x9b'),_0x572d89[_0xb728('0x22')],util['inspect'](_0x572d89,{'showHidden':![],'depth':null}));if(_0x572d89[_0xb728('0x48')]){_0x375580=_0x572d89[_0xb728('0x48')][_0xb728('0x9c')](0x0,_0x572d89[_0xb728('0x48')][_0xb728('0x96')]('-'));if(this[_0xb728('0xc')][_0x375580]){logger['info'](_0xb728('0x9d'),_0x572d89[_0xb728('0x22')],_0x375580);this['agents'][_0x375580]['onhold']=![];}}}}catch(_0x2995a0){logger[_0xb728('0x39')](_0xb728('0x9e'),_0x572d89[_0xb728('0x22')],util[_0xb728('0x33')](_0x2995a0,{'showHidden':![],'depth':null}));}};module[_0xb728('0x9f')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 37c737f..2073e00 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 _0x19e1=['ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','routeid','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','transfereruniqueid','BLIND','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','moment','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','defaults','localhost','redis','channels','agents','syncNewExten','newexten','bind','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','linkedid','isUndefined','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','blindTransfers','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','applicationdata','startsWith','CDR(routeAlias)','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','lastapplication','lastdata','cdr(','type','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answertime','holdtime','diff','destinationchannel','UserId','answered','connectedlinename','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','monitorFilename','find','isNil','monitors','push','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','length','user:agentcomplete','transferType','then','undefined','isEmpty','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid'];(function(_0xc19fd8,_0x304c9b){var _0x229071=function(_0x35bb4b){while(--_0x35bb4b){_0xc19fd8['push'](_0xc19fd8['shift']());}};_0x229071(++_0x304c9b);}(_0x19e1,0xd1));var _0x119e=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x19e1[_0xfb42e6];return _0x27265b;};'use strict';var _=require('lodash');var moment=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var path=require(_0x119e('0x2'));var Redis=require(_0x119e('0x3'));var config=require(_0x119e('0x4'));var logger=require('../../../config/logger')(_0x119e('0x5'));var ami=require(_0x119e('0x6'));var Channel=require(_0x119e('0x7'));var RpcSetting=require(_0x119e('0x8'));var applications=[_0x119e('0x9'),'queue',_0x119e('0xa'),_0x119e('0xb'),_0x119e('0xc'),_0x119e('0xd')];var dispositions=[_0x119e('0xe'),_0x119e('0xf'),_0x119e('0xf'),_0x119e('0xe'),_0x119e('0xe'),_0x119e('0xe'),'ANSWERED',_0x119e('0x10'),_0x119e('0xf'),_0x119e('0xf'),_0x119e('0xf')];config['redis']=_[_0x119e('0x11')](config['redis'],{'host':_0x119e('0x12'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x119e('0x13')]));function VoiceCallReport(_0xdfef51){this['channels']=_0xdfef51[_0x119e('0x14')];this[_0x119e('0x15')]=_0xdfef51['agents'];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0x119e('0x16')]['bind'](this));ami['on'](_0x119e('0x17'),this[_0x119e('0x16')][_0x119e('0x18')](this));ami['on']('newchannel',this[_0x119e('0x19')][_0x119e('0x18')](this));ami['on'](_0x119e('0x1a'),this[_0x119e('0x1b')][_0x119e('0x18')](this));ami['on'](_0x119e('0x1c'),this[_0x119e('0x1d')][_0x119e('0x18')](this));ami['on'](_0x119e('0x1e'),this[_0x119e('0x1f')][_0x119e('0x18')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x119e('0x18')](this));ami['on'](_0x119e('0x20'),this[_0x119e('0x21')][_0x119e('0x18')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x119e('0x18')](this));ami['on'](_0x119e('0x22'),this[_0x119e('0x23')][_0x119e('0x18')](this));ami['on'](_0x119e('0x24'),this[_0x119e('0x25')]['bind'](this));try{logger[_0x119e('0x26')](_0x119e('0x27'));ami['actionCoreShowChannels']();}catch(_0x1cc490){logger[_0x119e('0x28')](_0x119e('0x29'),util[_0x119e('0x2a')](_0x1cc490,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x119e('0x2b')][_0x119e('0x2c')]=function(_0x563ad0){return _0x563ad0!==null&&!_['isUndefined'](_0x563ad0);};VoiceCallReport[_0x119e('0x2b')][_0x119e('0x2d')]=function(_0x5147e1,_0x4db2c2,_0x1746c2){io['to'](_0x5147e1)[_0x119e('0x2d')](_0x4db2c2,_0x1746c2);};VoiceCallReport[_0x119e('0x2b')]['syncNewCallerId']=function(_0x2b5820){try{if(this[_0x119e('0x2c')](_0x2b5820)){logger[_0x119e('0x26')](_0x119e('0x2e'),_0x2b5820[_0x119e('0x2f')],_0x2b5820[_0x119e('0x30')],_0x2b5820[_0x119e('0x31')]);logger[_0x119e('0x32')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x2b5820[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x2b5820,{'showHidden':![],'depth':null}));if(_0x2b5820[_0x119e('0x2f')]===_0x2b5820[_0x119e('0x33')]){if(!_[_0x119e('0x34')](this['channels'][_0x2b5820[_0x119e('0x2f')]])){_['merge'](this[_0x119e('0x14')][_0x2b5820[_0x119e('0x2f')]],_[_0x119e('0x35')](_0x2b5820,_[_0x119e('0x36')](this[_0x119e('0x14')][_0x2b5820[_0x119e('0x2f')]])));}}if(_0x2b5820[_0x119e('0x37')]===_0x119e('0x38')){if(this['agents'][_0x2b5820[_0x119e('0x39')][_0x119e('0x3a')]('-')[0x0]]){if(_0x2b5820[_0x119e('0x3b')]==_0x119e('0x3c')){this[_0x119e('0x15')][_0x2b5820[_0x119e('0x39')][_0x119e('0x3a')]('-')[0x0]][_0x119e('0x3d')]=_0x2b5820[_0x119e('0x3e')];this[_0x119e('0x2d')](util[_0x119e('0x3f')](_0x119e('0x40'),this[_0x119e('0x15')][_0x2b5820[_0x119e('0x39')]['split']('-')[0x0]][_0x119e('0x41')]),_0x119e('0x42'),{'destaccountcode':this['agents'][_0x2b5820['channel'][_0x119e('0x3a')]('-')[0x0]][_0x119e('0x43')],'destconnectedlinenum':_0x2b5820[_0x119e('0x3e')]});}}}}}catch(_0x34f62b){logger['error'](_0x119e('0x44'),_0x2b5820[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x34f62b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x2ca039){try{if(this[_0x119e('0x2c')](_0x2ca039)){logger[_0x119e('0x32')](_0x119e('0x45'),_0x2ca039[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x2ca039,{'showHidden':![],'depth':null}));if(this[_0x119e('0x14')][_0x2ca039['uniqueid']]){return;}if(_0x2ca039['channel']===_0x119e('0x46')){return;}if(_0x2ca039['uniqueid']!==_0x2ca039[_0x119e('0x33')]&&!this[_0x119e('0x47')][_0x2ca039[_0x119e('0x33')]]){return;}logger[_0x119e('0x26')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x2ca039[_0x119e('0x2f')],_0x2ca039[_0x119e('0x37')],_0x2ca039[_0x119e('0x3b')]);this[_0x119e('0x14')][_0x2ca039['uniqueid']]=new Channel();this[_0x119e('0x14')][_0x2ca039['uniqueid']]['starttime']=moment()[_0x119e('0x3f')](_0x119e('0x48'));this[_0x119e('0x14')][_0x2ca039[_0x119e('0x2f')]][_0x119e('0x49')]=dispositions[_[_0x119e('0x4a')](_0x2ca039[_0x119e('0x4b')])];_['merge'](this[_0x119e('0x14')][_0x2ca039['uniqueid']],_['pick'](_0x2ca039,_['keys'](this[_0x119e('0x14')][_0x2ca039[_0x119e('0x2f')]])));if(_0x2ca039[_0x119e('0x37')]===_0x119e('0x38')){var _0x2efb77=this[_0x119e('0x15')][_0x2ca039[_0x119e('0x39')][_0x119e('0x3a')]('-')[0x0]];if(_0x2efb77&&typeof _0x2efb77['destconnectedlinenum']==='undefined'){_0x2efb77[_0x119e('0x3d')]=_0x2ca039[_0x119e('0x3b')];logger[_0x119e('0x32')](_0x119e('0x4c'),_0x2ca039[_0x119e('0x2f')],util[_0x119e('0x2a')]({'id':_0x2efb77['id'],'destaccountcode':_0x2efb77['accountcode'],'destconnectedlinenum':_0x2ca039[_0x119e('0x3b')]},{'showHidden':![],'depth':null}));this[_0x119e('0x2d')](util[_0x119e('0x3f')](_0x119e('0x40'),_0x2efb77[_0x119e('0x41')]),_0x119e('0x42'),{'id':_0x2efb77['id'],'destaccountcode':_0x2efb77[_0x119e('0x43')],'destconnectedlinenum':_0x2ca039[_0x119e('0x3b')]});}}}}catch(_0x12aa2d){logger[_0x119e('0x28')](_0x119e('0x4d'),_0x2ca039[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x12aa2d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x119e('0x16')]=function(_0x4ff705){try{if(this[_0x119e('0x2c')](_0x4ff705)){logger[_0x119e('0x32')](_0x119e('0x4e'),_0x4ff705[_0x119e('0x2f')],util['inspect'](_0x4ff705,{'showHidden':![],'depth':null}));if(_0x4ff705[_0x119e('0x39')]===_0x119e('0x46')||_0x4ff705[_0x119e('0x3b')]==='h')return;if(_0x4ff705[_0x119e('0x2f')]===_0x4ff705[_0x119e('0x33')]||this[_0x119e('0x47')][_0x4ff705['linkedid']]){_0x4ff705[_0x119e('0x4f')]=_0x4ff705[_0x119e('0x4f')]?_0x4ff705[_0x119e('0x4f')][_0x119e('0x50')]():undefined;_0x4ff705['applicationdata']=_0x4ff705[_0x119e('0x51')]||_0x4ff705[_0x119e('0x52')];if(_0x4ff705[_0x119e('0x51')]&&!_0x4ff705[_0x119e('0x51')][_0x119e('0x53')](_0x119e('0x54'))&&_0x4ff705[_0x119e('0x4f')]!==_0x119e('0x55')){_0x4ff705[_0x119e('0x52')]=_0x4ff705['applicationdata'][_0x119e('0x50')]();}logger[_0x119e('0x26')](_0x119e('0x56'),_0x4ff705[_0x119e('0x2f')],_0x4ff705['application'],_0x4ff705[_0x119e('0x52')]);if(_[_0x119e('0x34')](this['channels'][_0x4ff705[_0x119e('0x2f')]])){this[_0x119e('0x14')][_0x4ff705[_0x119e('0x2f')]]=new Channel();this['channels'][_0x4ff705[_0x119e('0x2f')]][_0x119e('0x57')]=_0x4ff705[_0x119e('0x58')]?moment()[_0x119e('0x59')](moment[_0x119e('0x58')](_0x4ff705['duration'])[_0x119e('0x5a')](),'seconds')[_0x119e('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x119e('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x119e('0x14')][_0x4ff705['uniqueid']][_0x119e('0x49')]=_0x119e('0xe');}_['merge'](this['channels'][_0x4ff705['uniqueid']],_[_0x119e('0x35')](_0x4ff705,_['keys'](this[_0x119e('0x14')][_0x4ff705['uniqueid']])));if(_['includes'](applications,_0x4ff705[_0x119e('0x4f')])){this[_0x119e('0x14')][_0x4ff705['uniqueid']][_0x119e('0x5b')]=_0x4ff705['application'];this[_0x119e('0x14')][_0x4ff705['uniqueid']][_0x119e('0x5c')]=_0x4ff705[_0x119e('0x52')];if(_0x4ff705['application']===_0x119e('0x9')&&_[_0x119e('0x53')](_0x4ff705['applicationdata'][_0x119e('0x50')](),_0x119e('0x5d'))){var _0x1de16e=_0x4ff705['applicationdata'][_0x119e('0x3a')]('=');var _0x1e3302=_0x1de16e[0x0][_0x119e('0x50')]()['match'](/cdr\((.*)\)/);if(_0x1e3302){if(_0x1e3302[0x1]===_0x119e('0x5e')&&!_['isNil'](this[_0x119e('0x14')][_0x4ff705[_0x119e('0x2f')]][_0x1e3302[0x1]]))return;this[_0x119e('0x14')][_0x4ff705[_0x119e('0x2f')]][_0x1e3302[0x1]]=_0x1de16e[0x1];}}else if(_0x4ff705[_0x119e('0x4f')]===_0x119e('0x55')){this['channels'][_0x4ff705[_0x119e('0x2f')]][_0x119e('0x55')]=_0x4ff705[_0x119e('0x52')]['split'](',')[0x0];}}}}}catch(_0x4a28a5){logger['error']('[%s][voiceCallReport][newexten]',_0x4ff705[_0x119e('0x2f')],util['inspect'](_0x4a28a5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x119e('0x2b')]['syncNewState']=function(_0x26d5e7){try{if(this[_0x119e('0x2c')](_0x26d5e7)){logger[_0x119e('0x26')](_0x119e('0x5f'),_0x26d5e7[_0x119e('0x2f')],_0x26d5e7[_0x119e('0x33')],_0x26d5e7['calleridname'],_0x26d5e7['calleridnum']);logger[_0x119e('0x32')](_0x119e('0x60'),_0x26d5e7[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x26d5e7,{'showHidden':![],'depth':null}));if(_0x26d5e7[_0x119e('0x4b')]!=='6')return;var _0xb3b72a=this[_0x119e('0x15')][_0x26d5e7['channel'][_0x119e('0x3a')]('-')[0x0]];if(_0x26d5e7[_0x119e('0x2f')]!==_0x26d5e7[_0x119e('0x33')]){var _0xe309bb=moment();if(this['channels'][_0x26d5e7['linkedid']]){if(!this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]]['answered']){this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]]['answered']=!![];this[_0x119e('0x14')][_0x26d5e7['linkedid']][_0x119e('0x61')]=_0xe309bb[_0x119e('0x3f')](_0x119e('0x48'));if(this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]]['starttime']){this['channels'][_0x26d5e7['linkedid']][_0x119e('0x62')]=_0xe309bb[_0x119e('0x63')](this['channels'][_0x26d5e7[_0x119e('0x33')]][_0x119e('0x57')],_0x119e('0x5a'));}}this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]][_0x119e('0x33')]=_0x26d5e7[_0x119e('0x2f')];if(_0x26d5e7[_0x119e('0x31')]!==_0x119e('0x3c')){this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]][_0x119e('0x3e')]=_0x26d5e7[_0x119e('0x31')];}this[_0x119e('0x14')][_0x26d5e7['linkedid']]['connectedlinename']=_0x26d5e7[_0x119e('0x30')];this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]][_0x119e('0x64')]=_0x26d5e7['channel'];this['channels'][_0x26d5e7[_0x119e('0x33')]]['disposition']=dispositions[_[_0x119e('0x4a')](_0x26d5e7['channelstate'])];if(_0xb3b72a){this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]][_0x119e('0x65')]=_0xb3b72a['id'];this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]]['membername']=_0xb3b72a[_0x119e('0x41')];}}if(this[_0x119e('0x14')][_0x26d5e7['uniqueid']]){if(!this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]][_0x119e('0x66')]){this[_0x119e('0x14')][_0x26d5e7['uniqueid']]['answered']=!![];this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]][_0x119e('0x61')]=_0xe309bb['format'](_0x119e('0x48'));if(this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]]['starttime']){this['channels'][_0x26d5e7[_0x119e('0x2f')]][_0x119e('0x62')]=_0xe309bb['diff'](this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]]['starttime'],_0x119e('0x5a'));}}if(_0x26d5e7['calleridnum']!==_0x119e('0x3c')){this[_0x119e('0x14')][_0x26d5e7['uniqueid']][_0x119e('0x3e')]=_0x26d5e7[_0x119e('0x31')];}this[_0x119e('0x14')][_0x26d5e7['uniqueid']][_0x119e('0x67')]=_0x26d5e7['calleridname'];this['channels'][_0x26d5e7[_0x119e('0x2f')]][_0x119e('0x64')]=_0x26d5e7[_0x119e('0x39')];this[_0x119e('0x14')][_0x26d5e7['uniqueid']][_0x119e('0x49')]=dispositions[_[_0x119e('0x4a')](_0x26d5e7[_0x119e('0x4b')])];}}else{if(this[_0x119e('0x14')][_0x26d5e7['uniqueid']]){if(_0xb3b72a){this['channels'][_0x26d5e7[_0x119e('0x2f')]]['UserId']=_0xb3b72a['id'];this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]][_0x119e('0x68')]=_0xb3b72a[_0x119e('0x41')];}}}if(_0x26d5e7[_0x119e('0x37')]===_0x119e('0x38')){if(_0xb3b72a){_0xb3b72a[_0x119e('0x3d')]=_0x26d5e7['exten'];var _0x2af3e3,_0x347016;if(this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]]){_0x2af3e3=this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x2f')]][_0x119e('0x69')];_0x347016=this[_0x119e('0x14')][_0x26d5e7['uniqueid']]['queue'];}else if(this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]]){_0x2af3e3=this[_0x119e('0x14')][_0x26d5e7[_0x119e('0x33')]][_0x119e('0x69')];_0x347016=this[_0x119e('0x14')][_0x26d5e7['linkedid']]['queue'];}_0xb3b72a['queue']=_0x347016;_0xb3b72a['routealias']=_0x2af3e3;var _0x1598ec={'id':_0xb3b72a['id'],'name':_0xb3b72a[_0x119e('0x41')],'agentconnected':!![],'destaccountcode':_0xb3b72a[_0x119e('0x43')],'destconnectedlinenum':_0x26d5e7['exten'],'queue':_0x347016||undefined,'routealias':_0x2af3e3,'uniqueid':_0x26d5e7[_0x119e('0x33')]};logger['debug'](_0x119e('0x6a'),_0x26d5e7[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x1598ec,{'showHidden':![],'depth':null}));this[_0x119e('0x2d')](util[_0x119e('0x3f')](_0x119e('0x40'),_0xb3b72a['name']),_0x119e('0x42'),_0x1598ec);}}}}catch(_0x1f86c3){logger['error'](_0x119e('0x6b'),_0x26d5e7[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x1f86c3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x3f434c,_0x4921b0){try{if(this[_0x119e('0x14')][_0x3f434c]){logger['info'](_0x119e('0x6c'),_0x3f434c,_0x4921b0);this[_0x119e('0x14')][_0x3f434c][_0x119e('0x6d')]=!![];if(_['endsWith'](_0x4921b0,_0x119e('0x6e'))){_0x4921b0=_0x4921b0[_0x119e('0x6f')](_0x119e('0x6e'),'.WAV');}this[_0x119e('0x14')][_0x3f434c][_0x119e('0x70')]=_0x4921b0;var _0x44d51c=_[_0x119e('0x71')](this['channels'][_0x3f434c]['monitors'],{'filename':_0x4921b0});if(_[_0x119e('0x72')](_0x44d51c)){this[_0x119e('0x14')][_0x3f434c][_0x119e('0x73')][_0x119e('0x74')]({'filename':_0x4921b0,'createdAt':moment()[_0x119e('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}}catch(_0x2ad5d6){logger[_0x119e('0x28')]('[%s][voiceCallReport][mixMonitorFilename]',_0x3f434c,util[_0x119e('0x2a')](_0x2ad5d6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x119e('0x1d')]=function(_0x1ff3b2){try{if(this['isNotNull'](_0x1ff3b2)){logger[_0x119e('0x32')](_0x119e('0x75'),_0x1ff3b2[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x1ff3b2,{'showHidden':![],'depth':null}));if(this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]]&&_0x1ff3b2[_0x119e('0x39')]!=_0x119e('0x46')){if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')])){if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x77')])){logger[_0x119e('0x26')](_0x119e('0x78'),_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2['value']);this['syncMixMonitorFilename'](_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2['value']);}else if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x79')])){logger[_0x119e('0x26')](_0x119e('0x7a'),_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]][_0x119e('0x31')]=_0x1ff3b2['value'];}else if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')]['xmd-callerid'])){logger[_0x119e('0x26')](_0x119e('0x7c'),_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2['value']);this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]][_0x119e('0x7d')]=_0x1ff3b2['value'];}else if(this[_0x119e('0x2c')](_0x1ff3b2['variable'][_0x119e('0x7e')])){logger[_0x119e('0x26')](_0x119e('0x7f'),_0x1ff3b2['uniqueid'],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]][_0x119e('0x5e')]=_0x1ff3b2['value'];}else if(this['isNotNull'](_0x1ff3b2['variable']['xmd-queue'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2['value'][_0x119e('0x3a')](',')[0x0]);this[_0x119e('0x14')][_0x1ff3b2['uniqueid']]['queue']=_0x1ff3b2[_0x119e('0x7b')][_0x119e('0x3a')](',')[0x0];}else if(this[_0x119e('0x2c')](_0x1ff3b2['variable']['xmd-originatecalleridnum'])){logger[_0x119e('0x26')](_0x119e('0x80'),_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]][_0x119e('0x81')]=_0x1ff3b2[_0x119e('0x7b')];}else if(this['isNotNull'](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x82')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]]['destination']=_0x1ff3b2[_0x119e('0x7b')];}else if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')]['xmd-callerid-preview'])){logger['info'](_0x119e('0x83'),_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2['uniqueid']][_0x119e('0x84')]=_0x1ff3b2[_0x119e('0x7b')];}else if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x85')])){logger['info'](_0x119e('0x86'),_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x2f')]][_0x119e('0x55')]=_0x1ff3b2[_0x119e('0x7b')];}else if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1ff3b2[_0x119e('0x2f')],_0x1ff3b2['value']);this['channels'][_0x1ff3b2[_0x119e('0x2f')]][_0x119e('0x88')]=_0x1ff3b2['value'];}}}else if(this[_0x119e('0x2c')](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x77')])){if(_0x1ff3b2[_0x119e('0x7b')]){var _0x113549=path['parse'](_0x1ff3b2[_0x119e('0x7b')])[_0x119e('0x41')];logger['info'](_0x119e('0x78'),_0x113549,_0x1ff3b2['value']);this['syncMixMonitorFilename'](_0x113549,_0x1ff3b2[_0x119e('0x7b')]);}}else if(this[_0x119e('0x14')][_0x1ff3b2[_0x119e('0x33')]]){if(this['isNotNull'](_0x1ff3b2[_0x119e('0x76')])){if(this['isNotNull'](_0x1ff3b2[_0x119e('0x76')][_0x119e('0x87')])){logger[_0x119e('0x26')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1ff3b2[_0x119e('0x33')],_0x1ff3b2[_0x119e('0x7b')]);this[_0x119e('0x14')][_0x1ff3b2['linkedid']]['sipcalllinkedid']=_0x1ff3b2[_0x119e('0x7b')];}}}}}catch(_0xec8967){logger[_0x119e('0x28')](_0x119e('0x89'),_0x1ff3b2['uniqueid'],util[_0x119e('0x2a')](_0xec8967,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x119e('0x2b')][_0x119e('0x1f')]=function(_0x44897a){try{if(this['isNotNull'](_0x44897a)){logger[_0x119e('0x32')](_0x119e('0x8a'),_0x44897a[_0x119e('0x2f')],util[_0x119e('0x2a')](_0x44897a,{'showHidden':![],'depth':null}));if(this[_0x119e('0x47')][_0x44897a['linkedid']]){if(this[_0x119e('0x14')][this['blindTransfers'][_0x44897a[_0x119e('0x33')]]['linkedid']]){this[_0x119e('0x14')][this['blindTransfers'][_0x44897a[_0x119e('0x33')]]['linkedid']][_0x119e('0x2f')]=_0x44897a[_0x119e('0x2f')];this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x33')]][_0x119e('0x66')]=this['channels'][_0x44897a['uniqueid']][_0x119e('0x66')];this[_0x119e('0x14')][this['blindTransfers'][_0x44897a[_0x119e('0x33')]][_0x119e('0x33')]]['answertime']=this['channels'][_0x44897a[_0x119e('0x2f')]][_0x119e('0x61')];this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x33')]]['destinationchannel']=this[_0x119e('0x14')][this['blindTransfers'][_0x44897a[_0x119e('0x33')]][_0x119e('0x33')]][_0x119e('0x39')];this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x33')]][_0x119e('0x49')]=this['channels'][_0x44897a['uniqueid']][_0x119e('0x49')];this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]]=this['channels'][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x33')]];delete this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]]['linkedid']];}else if(this['channels'][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]]){this[_0x119e('0x14')][this['blindTransfers'][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]][_0x119e('0x2f')]=[this['channels'][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]]['linkedid'],this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]]['linkedid']=this['channels'][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]]['uniqueid']][_0x119e('0x2f')]][0x0];this['channels'][this[_0x119e('0x47')][_0x44897a['linkedid']][_0x119e('0x2f')]][_0x119e('0x66')]=this[_0x119e('0x14')][_0x44897a['uniqueid']][_0x119e('0x66')];this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]][_0x119e('0x61')]=this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]][_0x119e('0x61')];this['channels'][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]][_0x119e('0x64')]=this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]][_0x119e('0x39')];this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]][_0x119e('0x49')]=this['channels'][_0x44897a[_0x119e('0x2f')]][_0x119e('0x49')];this[_0x119e('0x14')][_0x44897a['uniqueid']]=this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]]['uniqueid']];delete this[_0x119e('0x14')][this[_0x119e('0x47')][_0x44897a[_0x119e('0x33')]][_0x119e('0x2f')]];}}if(this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x44897a['uniqueid'],_0x44897a[_0x119e('0x8b')]);var _0x1fee5b=moment();this['channels'][_0x44897a[_0x119e('0x2f')]][_0x119e('0x8c')]=_0x1fee5b[_0x119e('0x3f')](_0x119e('0x48'));this[_0x119e('0x14')][_0x44897a['uniqueid']][_0x119e('0x58')]=_0x1fee5b[_0x119e('0x63')](this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]][_0x119e('0x57')],_0x119e('0x5a'));if(this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]][_0x119e('0x66')]){this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]][_0x119e('0x8d')]=_0x1fee5b[_0x119e('0x63')](this[_0x119e('0x14')][_0x44897a['uniqueid']]['answertime'],'seconds');this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]][_0x119e('0x62')]=this[_0x119e('0x14')][_0x44897a[_0x119e('0x2f')]][_0x119e('0x58')]-this['channels'][_0x44897a[_0x119e('0x2f')]]['billableseconds'];}if(_0x44897a[_0x119e('0x37')]===_0x119e('0x38')){if(this[_0x119e('0x15')][_0x44897a['channel'][_0x119e('0x3a')]('-')[0x0]]){this[_0x119e('0x15')][_0x44897a[_0x119e('0x39')]['split']('-')[0x0]]=_[_0x119e('0x8e')](this[_0x119e('0x15')][_0x44897a['channel']['split']('-')[0x0]],[_0x119e('0x3d')]);logger[_0x119e('0x32')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x44897a[_0x119e('0x2f')],util[_0x119e('0x2a')]({'id':this[_0x119e('0x15')][_0x44897a[_0x119e('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x119e('0x15')][_0x44897a[_0x119e('0x39')]['split']('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x119e('0x2d')](util[_0x119e('0x3f')]('user:%s',this[_0x119e('0x15')][_0x44897a[_0x119e('0x39')]['split']('-')[0x0]][_0x119e('0x41')]),'user:agentcomplete',{'id':this['agents'][_0x44897a[_0x119e('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x119e('0x15')][_0x44897a[_0x119e('0x39')][_0x119e('0x3a')]('-')[0x0]]['accountcode']});for(var _0x4dc41d=0x0;_0x4dc41d0x0?!![]:![];if(!_0x53abaf){return this[_0x7a04('0x6b')](this['summary']['completeEvent']);}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x1a')]=function(_0x4b1cf1){var _0x23fc67=this['summary']['id'];if(this[_0x7a04('0x14')][_0x7a04('0x64')][_0x23fc67]&&this[_0x7a04('0x14')][_0x7a04('0x64')][_0x23fc67][_0x4b1cf1['actionid']]){this[_0x7a04('0x14')]['queuestatus'][_0x23fc67][_0x4b1cf1['actionid']]['agents'][_0x7a04('0x6c')](_0x4b1cf1);}};VoiceQueueReport[_0x7a04('0x37')]['syncQueueSummary']=function(_0x1c6798){var _0x214889=this;try{if(this[_0x7a04('0x56')](_0x1c6798)&&this[_0x7a04('0x56')](_0x1c6798[_0x7a04('0x4c')])){logger[_0x7a04('0x48')](_0x7a04('0x6d'),util[_0x7a04('0x40')](_0x1c6798,{'showHidden':![],'depth':null}));var _0x52ccca=this[_0x7a04('0x65')][_0x1c6798[_0x7a04('0x4c')]];if(_0x52ccca){logger[_0x7a04('0x6e')](_0x7a04('0x6f'),_0x52ccca['name']);this[_0x7a04('0x14')][_0x7a04('0x5a')][_0x52ccca['name']]={'summaryEvent':_0x1c6798};this[_0x7a04('0x14')][_0x7a04('0x6a')]+=0x1;return ami[_0x7a04('0x59')]({'action':_0x7a04('0x64'),'queue':_0x52ccca[_0x7a04('0x70')]})[_0x7a04('0x71')](function(_0x180502){if(!_0x214889[_0x7a04('0x14')][_0x7a04('0x64')][_0x1c6798[_0x7a04('0x5d')]]){_0x214889[_0x7a04('0x14')][_0x7a04('0x64')][_0x1c6798[_0x7a04('0x5d')]]={};}_0x214889[_0x7a04('0x14')][_0x7a04('0x64')][_0x1c6798['actionid']][_0x180502[_0x7a04('0x5d')]]={'queue':_0x52ccca[_0x7a04('0x70')],'agents':[]};})[_0x7a04('0x3c')](function(_0x50a3c0){throw _0x50a3c0;});}}}catch(_0x2ec29a){logger[_0x7a04('0x3f')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x2ec29a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x6b')]=function(_0x1b90d9){if(this[_0x7a04('0x14')][_0x7a04('0x6a')]>0x0){this[_0x7a04('0x14')][_0x7a04('0x72')]=_0x1b90d9;return;}logger[_0x7a04('0x48')](_0x7a04('0x73'),util['inspect'](_0x1b90d9,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami['emit'](_0x7a04('0x74'),{});};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x1d')]=function(_0x4166d0){try{if(this[_0x7a04('0x56')](_0x4166d0)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x4166d0[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x4166d0,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x4166d0[_0x7a04('0x75')]])){this['queueReports'][_0x4166d0[_0x7a04('0x75')]]=[];}if(_[_0x7a04('0x57')](this['channels'][_0x4166d0[_0x7a04('0x75')]])){this[_0x7a04('0x11')][_0x4166d0['uniqueid']]={};}var _0x40d731=new QueueReport();_0x40d731[_0x7a04('0x4c')]=_0x4166d0[_0x7a04('0x4c')];_0x40d731[_0x7a04('0x54')]=this[_0x7a04('0x65')][_0x40d731[_0x7a04('0x4c')]]&&this[_0x7a04('0x65')][_0x40d731[_0x7a04('0x4c')]]['type']?this[_0x7a04('0x65')][_0x40d731[_0x7a04('0x4c')]][_0x7a04('0x54')]||_0x7a04('0x66'):_0x7a04('0x66');_0x40d731[_0x7a04('0x76')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x40d731[_0x7a04('0x78')]=_0x4166d0[_0x7a04('0x78')];_0x40d731[_0x7a04('0x79')]=_0x4166d0[_0x7a04('0x79')];_0x40d731['uniqueid']=_0x4166d0['uniqueid'];_0x40d731[_0x7a04('0x7a')]=this[_0x7a04('0x11')][_0x4166d0[_0x7a04('0x75')]]['routealias'];logger[_0x7a04('0x6e')](_0x7a04('0x7b'),_0x40d731[_0x7a04('0x4c')],_0x40d731['type']);_[_0x7a04('0x7c')](_0x40d731,_[_0x7a04('0x7d')](_0x4166d0,_[_0x7a04('0x7e')](_0x40d731)));this[_0x7a04('0xf')][_0x4166d0['uniqueid']]['push'](_0x40d731);this[_0x7a04('0x11')][_0x4166d0['uniqueid']]=_0x40d731;this['emitVoiceQueueChannelSave'](_0x40d731,_0x7a04('0x1c'));}}catch(_0x371c00){logger[_0x7a04('0x3f')](_0x7a04('0x7f'),_0x4166d0[_0x7a04('0x75')],util['inspect'](_0x371c00,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x1f')]=function(_0x31bac4){try{if(this['isNotNull'](_0x31bac4)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x31bac4[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x31bac4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x31bac4[_0x7a04('0x75')]]){var _0x2d8f1a=_['last'](this[_0x7a04('0xf')][_0x31bac4['uniqueid']]);_0x2d8f1a[_0x7a04('0x80')]=![];_0x2d8f1a['queuecallercompleteAt']=null;_0x2d8f1a[_0x7a04('0x81')]=_0x31bac4['holdtime'];_0x2d8f1a[_0x7a04('0x82')]=_0x31bac4[_0x7a04('0x82')];_0x2d8f1a[_0x7a04('0x1e')]=!![];_0x2d8f1a[_0x7a04('0x83')]=moment()[_0x7a04('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d8f1a[_0x7a04('0x84')]='ABANDONED';_0x2d8f1a[_0x7a04('0x85')]=null;logger[_0x7a04('0x6e')](_0x7a04('0x86'),_0x2d8f1a[_0x7a04('0x4c')],_0x2d8f1a[_0x7a04('0x54')]);this[_0x7a04('0x11')][_0x31bac4[_0x7a04('0x75')]]=_0x2d8f1a;this[_0x7a04('0x44')](_0x2d8f1a,_0x7a04('0x1e'));}}}catch(_0x3ecdb7){logger['error'](_0x7a04('0x87'),_0x31bac4[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x3ecdb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0x21')]=function(_0x5b7b91){try{if(this[_0x7a04('0x56')](_0x5b7b91)){logger[_0x7a04('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b7b91[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x5b7b91,{'showHidden':![],'depth':null}));if(this[_0x7a04('0xf')][_0x5b7b91[_0x7a04('0x75')]]){var _0x5d2a68=_['last'](this['queueReports'][_0x5b7b91[_0x7a04('0x75')]]);_0x5d2a68[_0x7a04('0x88')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x5d2a68['connectedlinenum']=_0x5b7b91[_0x7a04('0x89')];_0x5d2a68[_0x7a04('0x8a')]=_0x5b7b91[_0x7a04('0x8a')];logger[_0x7a04('0x6e')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5d2a68[_0x7a04('0x4c')],_0x5d2a68[_0x7a04('0x54')],_0x5b7b91[_0x7a04('0x89')],_0x5b7b91[_0x7a04('0x8a')]);this[_0x7a04('0x11')][_0x5b7b91[_0x7a04('0x75')]]=_0x5d2a68;this[_0x7a04('0x47')](_0x5d2a68,_0x7a04('0x20'));}}}catch(_0x2e6b0d){logger[_0x7a04('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b7b91[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x2e6b0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a04('0x25')]=function(_0x1ee801){try{if(this[_0x7a04('0x56')](_0x1ee801)){logger[_0x7a04('0x48')]('[%s][voiceQueueReport][agentconnect]',_0x1ee801[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x1ee801,{'showHidden':![],'depth':null}));if(this[_0x7a04('0xf')][_0x1ee801[_0x7a04('0x75')]]){var _0x2c5714=_[_0x7a04('0x8b')](this['queueReports'][_0x1ee801[_0x7a04('0x75')]]);_0x2c5714[_0x7a04('0x80')]=!![];_0x2c5714[_0x7a04('0x84')]=_0x7a04('0x8c');logger[_0x7a04('0x6e')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2c5714[_0x7a04('0x4c')],_0x2c5714[_0x7a04('0x54')]);}}}catch(_0x3e6747){logger[_0x7a04('0x3f')](_0x7a04('0x8d'),_0x1ee801[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x3e6747,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a04('0x23')]=function(_0x5dfde8){try{if(this[_0x7a04('0x56')](_0x5dfde8)){logger[_0x7a04('0x48')](_0x7a04('0x8e'),_0x5dfde8[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x5dfde8,{'showHidden':![],'depth':null}));if(this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]]){var _0x37e2bd=_[_0x7a04('0x8b')](this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]]);_0x37e2bd[_0x7a04('0x1e')]=![];_0x37e2bd[_0x7a04('0x83')]=null;_0x37e2bd[_0x7a04('0x8f')]=!![];_0x37e2bd[_0x7a04('0x85')]=_0x5dfde8[_0x7a04('0x90')];_0x37e2bd['holdtime']=_0x5dfde8[_0x7a04('0x81')];_0x37e2bd['queuecallercomplete']=!![];_0x37e2bd[_0x7a04('0x91')]=![];_0x37e2bd[_0x7a04('0x92')]=null;if(!_0x37e2bd[_0x7a04('0x93')]){if(_0x5dfde8[_0x7a04('0x94')]==_0x7a04('0x93')){_0x37e2bd[_0x7a04('0x84')]=_0x7a04('0x95');logger[_0x7a04('0x6e')](_0x7a04('0x96'),_0x37e2bd[_0x7a04('0x4c')],_0x37e2bd[_0x7a04('0x54')]);}else{if(_[_0x7a04('0x97')](_0x5dfde8[_0x7a04('0x3b')][_0x7a04('0x98')](),'local/')){if(this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x99')]]){var _0x5b22b8=_[_0x7a04('0x8b')](this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x99')]]);_0x5b22b8['queuecallercomplete']=![];_0x5b22b8[_0x7a04('0x91')]=!![];_0x5b22b8[_0x7a04('0x92')]=moment(_0x37e2bd[_0x7a04('0x76')])[_0x7a04('0x9a')](_0x5dfde8[_0x7a04('0x81')],_0x7a04('0x9b'))[_0x7a04('0x4b')](_0x7a04('0x77'));_0x5b22b8['queuecallerexitreason']=_0x7a04('0x9c');_0x5b22b8[_0x7a04('0x93')]=!![];_0x5b22b8[_0x7a04('0x9d')]=_0x7a04('0x9e');_0x5b22b8[_0x7a04('0x9f')]=_0x5dfde8[_0x7a04('0xa0')];_0x5b22b8[_0x7a04('0xa1')]=_0x5dfde8[_0x7a04('0x75')];logger[_0x7a04('0x6e')](_0x7a04('0xa2'),_0x5b22b8[_0x7a04('0x4c')],_0x5b22b8[_0x7a04('0x54')]);var _0x2889c1=this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x99')]];this['queueReports'][_0x5dfde8[_0x7a04('0x99')]]=this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]];this[_0x7a04('0xf')][_0x5dfde8[_0x7a04('0x75')]]=_0x2889c1;}}else{_0x37e2bd[_0x7a04('0x84')]=_0x7a04('0xa3')+_0x5dfde8[_0x7a04('0x94')][_0x7a04('0xa4')]();logger[_0x7a04('0x6e')](_0x7a04('0xa5'),_0x37e2bd[_0x7a04('0x4c')],_0x37e2bd[_0x7a04('0x54')],_0x37e2bd[_0x7a04('0x84')]);}}}this[_0x7a04('0x11')][_0x5dfde8[_0x7a04('0x75')]]=_0x37e2bd;this[_0x7a04('0x44')](_0x37e2bd,_0x7a04('0x22'));}}}catch(_0x47829e){logger[_0x7a04('0x3f')](_0x7a04('0x8e'),_0x5dfde8[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x47829e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0xa6')]=function(_0x342c59){try{if(this[_0x7a04('0x56')](_0x342c59)){logger['debug']('[%s][voiceQueueReport][varset]',_0x342c59[_0x7a04('0x75')],util[_0x7a04('0x40')](_0x342c59,{'showHidden':![],'depth':null}));this['addVariable'](_0x342c59[_0x7a04('0x75')],_[_0x7a04('0x7e')](_0x342c59[_0x7a04('0xa7')])[0x0],_0x342c59[_0x7a04('0xa8')]);if(this[_0x7a04('0xf')][_0x342c59[_0x7a04('0x75')]]){var _0x2c6002=_[_0x7a04('0x8b')](this[_0x7a04('0xf')][_0x342c59['uniqueid']]);if(_0x2c6002){if(this[_0x7a04('0x56')](_0x342c59[_0x7a04('0xa7')])&&this[_0x7a04('0x56')](_0x342c59['variable']['queuestatus'])){switch(_0x342c59[_0x7a04('0xa8')]){case _0x7a04('0xa9'):_0x2c6002[_0x7a04('0x91')]=![];_0x2c6002[_0x7a04('0x92')]=null;break;case _0x7a04('0xaa'):_0x2c6002[_0x7a04('0xab')]='timeout';_0x2c6002[_0x7a04('0x91')]=!![];_0x2c6002[_0x7a04('0x92')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c6002['queuecallerleaveAt']=moment()['format'](_0x7a04('0x77'));logger[_0x7a04('0x48')](_0x7a04('0xac'),_0x342c59['uniqueid'],util[_0x7a04('0x40')](_0x2c6002,{'showHidden':![],'depth':null}));ami[_0x7a04('0x46')](_0x7a04('0xad'),_0x2c6002);break;default:_0x2c6002[_0x7a04('0x91')]=!![];_0x2c6002[_0x7a04('0x92')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x2c6002[_0x7a04('0x88')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));}_0x2c6002['queuecallerabandon']=![];_0x2c6002[_0x7a04('0x83')]=null;_0x2c6002[_0x7a04('0x84')]=_0x342c59[_0x7a04('0xa8')];this[_0x7a04('0x11')][_0x342c59[_0x7a04('0x75')]]=_0x2c6002;this['emitVoiceQueueChannelRemove'](_0x2c6002,_0x7a04('0x26'));}else if(this[_0x7a04('0x56')](_0x342c59['variable'])&&this[_0x7a04('0x56')](_0x342c59[_0x7a04('0xa7')]['queueposition'])){if(!_0x2c6002[_0x7a04('0x1e')]){_0x2c6002[_0x7a04('0x91')]=!![];_0x2c6002[_0x7a04('0x92')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));_0x2c6002['queuecallerexitreason']=_0x7a04('0xae');_0x2c6002[_0x7a04('0x88')]=moment()[_0x7a04('0x4b')](_0x7a04('0x77'));this[_0x7a04('0x11')][_0x342c59[_0x7a04('0x75')]]=_0x2c6002;}}logger[_0x7a04('0x6e')](_0x7a04('0xaf'),_0x342c59[_0x7a04('0x75')],_0x2c6002[_0x7a04('0x4c')],_0x2c6002[_0x7a04('0x54')],_[_0x7a04('0x7e')](_0x342c59['variable'])[0x0],_0x342c59[_0x7a04('0xa8')]);_0x2c6002[_0x7a04('0x15')]=this[_0x7a04('0x15')][_0x342c59[_0x7a04('0x75')]];}}}}catch(_0x26614e){logger[_0x7a04('0x3f')](_0x7a04('0xb0'),_0x342c59['uniqueid'],util[_0x7a04('0x40')](_0x26614e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a04('0x37')][_0x7a04('0xb1')]=function(_0x579ec9,_0x310a37,_0x4e0bf1){var _0x554459=[_0x7a04('0xb2'),_0x7a04('0xb3'),_0x7a04('0xb4'),_0x7a04('0xb5'),_0x7a04('0xb6'),_0x7a04('0xb7'),_0x7a04('0xb8'),'rtpaudioqosrttbridged',_0x7a04('0xb9'),_0x7a04('0xba'),_0x7a04('0xbb'),_0x7a04('0xbc'),'membercalls',_0x7a04('0xbd'),_0x7a04('0xbe'),_0x7a04('0xbf'),_0x7a04('0x90'),_0x7a04('0xc0'),_0x7a04('0xc1')];if(!_['isNil'](_0x310a37)&&!_['includes'](_0x554459,_0x310a37)){if(_[_0x7a04('0x57')](this[_0x7a04('0x15')][_0x579ec9])){this[_0x7a04('0x15')][_0x579ec9]={};}this[_0x7a04('0x15')][_0x579ec9][_0x310a37]=_0x4e0bf1;}};VoiceQueueReport['prototype'][_0x7a04('0xc2')]=function(_0x1f56d3,_0x1cb49b,_0x4a4da1){var _0x5c19d5={};for(var _0x1a57e1=0x0;_0x1a57e10x0?!![]:![];if(!_0xc7f6b8){return this[_0xe7cf('0x66')](this[_0xe7cf('0x58')][_0xe7cf('0x67')]);}};VoiceQueueReport[_0xe7cf('0xc')][_0xe7cf('0x68')]=function(_0x476574){var _0x50b95a=this['summary']['id'];if(this['summary'][_0xe7cf('0x62')][_0x50b95a]&&this[_0xe7cf('0x58')]['queuestatus'][_0x50b95a][_0x476574[_0xe7cf('0x5b')]]){this[_0xe7cf('0x58')][_0xe7cf('0x62')][_0x50b95a][_0x476574[_0xe7cf('0x5b')]]['agents'][_0xe7cf('0x69')](_0x476574);}};VoiceQueueReport[_0xe7cf('0xc')]['syncQueueSummary']=function(_0x3eef57){var _0x3b4e66=this;try{if(this[_0xe7cf('0x6a')](_0x3eef57)&&this[_0xe7cf('0x6a')](_0x3eef57['queue'])){logger[_0xe7cf('0x43')](_0xe7cf('0x6b'),util[_0xe7cf('0x3b')](_0x3eef57,{'showHidden':![],'depth':null}));var _0x5eb3a0=this['voiceQueues'][_0x3eef57[_0xe7cf('0x49')]];if(_0x5eb3a0){logger[_0xe7cf('0x6c')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x5eb3a0[_0xe7cf('0x5d')]);this[_0xe7cf('0x58')][_0xe7cf('0x56')][_0x5eb3a0[_0xe7cf('0x5d')]]={'summaryEvent':_0x3eef57};this['summary'][_0xe7cf('0x65')]+=0x1;return ami[_0xe7cf('0x55')]({'action':'queuestatus','queue':_0x5eb3a0[_0xe7cf('0x5d')]})['then'](function(_0x1d1476){if(!_0x3b4e66[_0xe7cf('0x58')]['queuestatus'][_0x3eef57[_0xe7cf('0x5b')]]){_0x3b4e66[_0xe7cf('0x58')]['queuestatus'][_0x3eef57['actionid']]={};}_0x3b4e66['summary'][_0xe7cf('0x62')][_0x3eef57['actionid']][_0x1d1476[_0xe7cf('0x5b')]]={'queue':_0x5eb3a0[_0xe7cf('0x5d')],'agents':[]};})[_0xe7cf('0x38')](function(_0x44ea0f){throw _0x44ea0f;});}}}catch(_0x5cd9c0){logger[_0xe7cf('0x3c')](_0xe7cf('0x6d'),util['inspect'](_0x5cd9c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe7cf('0x66')]=function(_0x567ebc){if(this[_0xe7cf('0x58')][_0xe7cf('0x65')]>0x0){this['summary'][_0xe7cf('0x67')]=_0x567ebc;return;}logger['debug'](_0xe7cf('0x6e'),util[_0xe7cf('0x3b')](_0x567ebc,{'showHidden':![],'depth':null}));this[_0xe7cf('0x58')]=initializeSummary();ami[_0xe7cf('0x46')](_0xe7cf('0x6f'),{});};VoiceQueueReport[_0xe7cf('0xc')][_0xe7cf('0x70')]=function(_0xc41247){try{if(this['isNotNull'](_0xc41247)){logger[_0xe7cf('0x43')](_0xe7cf('0x71'),_0xc41247[_0xe7cf('0x45')],util['inspect'](_0xc41247,{'showHidden':![],'depth':null}));if(_[_0xe7cf('0x54')](this[_0xe7cf('0x11')][_0xc41247[_0xe7cf('0x45')]])){this[_0xe7cf('0x11')][_0xc41247[_0xe7cf('0x45')]]=[];}if(_[_0xe7cf('0x54')](this[_0xe7cf('0x13')][_0xc41247[_0xe7cf('0x45')]])){this[_0xe7cf('0x13')][_0xc41247[_0xe7cf('0x45')]]={};}var _0x2ea3ee=new QueueReport();_0x2ea3ee[_0xe7cf('0x49')]=_0xc41247['queue'];_0x2ea3ee[_0xe7cf('0x51')]=this[_0xe7cf('0x14')][_0x2ea3ee[_0xe7cf('0x49')]]&&this[_0xe7cf('0x14')][_0x2ea3ee[_0xe7cf('0x49')]][_0xe7cf('0x51')]?this['voiceQueues'][_0x2ea3ee[_0xe7cf('0x49')]][_0xe7cf('0x51')]||'inbound':_0xe7cf('0x63');_0x2ea3ee[_0xe7cf('0x72')]=moment()[_0xe7cf('0x47')](_0xe7cf('0x73'));_0x2ea3ee[_0xe7cf('0x74')]=_0xc41247[_0xe7cf('0x74')];_0x2ea3ee[_0xe7cf('0x75')]=_0xc41247['count'];_0x2ea3ee['uniqueid']=_0xc41247[_0xe7cf('0x45')];_0x2ea3ee[_0xe7cf('0x76')]=this[_0xe7cf('0x13')][_0xc41247[_0xe7cf('0x45')]]['routealias'];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2ea3ee[_0xe7cf('0x49')],_0x2ea3ee[_0xe7cf('0x51')]);_[_0xe7cf('0x77')](_0x2ea3ee,_[_0xe7cf('0x78')](_0xc41247,_[_0xe7cf('0x79')](_0x2ea3ee)));this[_0xe7cf('0x11')][_0xc41247[_0xe7cf('0x45')]]['push'](_0x2ea3ee);this[_0xe7cf('0x13')][_0xc41247[_0xe7cf('0x45')]]=_0x2ea3ee;this[_0xe7cf('0x42')](_0x2ea3ee,_0xe7cf('0x1a'));}}catch(_0x2cf507){logger[_0xe7cf('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0xc41247[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x2cf507,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe7cf('0xc')]['syncQueueCallerAbandon']=function(_0x388f37){try{if(this[_0xe7cf('0x6a')](_0x388f37)){logger[_0xe7cf('0x43')](_0xe7cf('0x7a'),_0x388f37['uniqueid'],util['inspect'](_0x388f37,{'showHidden':![],'depth':null}));if(this[_0xe7cf('0x11')][_0x388f37['uniqueid']]){var _0x2dc677=_[_0xe7cf('0x7b')](this[_0xe7cf('0x11')][_0x388f37[_0xe7cf('0x45')]]);_0x2dc677[_0xe7cf('0x7c')]=![];_0x2dc677[_0xe7cf('0x7d')]=null;_0x2dc677[_0xe7cf('0x7e')]=_0x388f37[_0xe7cf('0x7e')];_0x2dc677[_0xe7cf('0x7f')]=_0x388f37[_0xe7cf('0x7f')];_0x2dc677['queuecallerabandon']=!![];_0x2dc677[_0xe7cf('0x80')]=moment()[_0xe7cf('0x47')](_0xe7cf('0x73'));_0x2dc677[_0xe7cf('0x4d')]='ABANDONED';_0x2dc677[_0xe7cf('0x81')]=null;logger[_0xe7cf('0x6c')](_0xe7cf('0x82'),_0x2dc677[_0xe7cf('0x49')],_0x2dc677[_0xe7cf('0x51')]);this[_0xe7cf('0x13')][_0x388f37[_0xe7cf('0x45')]]=_0x2dc677;this['emitVoiceQueueChannelRemove'](_0x2dc677,'queuecallerabandon');}}}catch(_0x37f5a3){logger[_0xe7cf('0x3c')](_0xe7cf('0x7a'),_0x388f37['uniqueid'],util[_0xe7cf('0x3b')](_0x37f5a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe7cf('0x83')]=function(_0x1e1378){try{if(this[_0xe7cf('0x6a')](_0x1e1378)){logger[_0xe7cf('0x43')](_0xe7cf('0x84'),_0x1e1378[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x1e1378,{'showHidden':![],'depth':null}));if(this[_0xe7cf('0x11')][_0x1e1378[_0xe7cf('0x45')]]){var _0x5de73e=_['last'](this[_0xe7cf('0x11')][_0x1e1378['uniqueid']]);_0x5de73e[_0xe7cf('0x85')]=moment()[_0xe7cf('0x47')](_0xe7cf('0x73'));_0x5de73e[_0xe7cf('0x86')]=_0x1e1378[_0xe7cf('0x86')];_0x5de73e[_0xe7cf('0x87')]=_0x1e1378[_0xe7cf('0x87')];logger[_0xe7cf('0x6c')](_0xe7cf('0x88'),_0x5de73e['queue'],_0x5de73e['type'],_0x1e1378[_0xe7cf('0x86')],_0x1e1378['connectedlinename']);this[_0xe7cf('0x13')][_0x1e1378[_0xe7cf('0x45')]]=_0x5de73e;this[_0xe7cf('0x42')](_0x5de73e,'queuecallerleave');}}}catch(_0x28b6ce){logger[_0xe7cf('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x1e1378[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x28b6ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe7cf('0xc')][_0xe7cf('0x89')]=function(_0x43cd35){try{if(this['isNotNull'](_0x43cd35)){logger[_0xe7cf('0x43')](_0xe7cf('0x8a'),_0x43cd35[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x43cd35,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x43cd35[_0xe7cf('0x45')]]){var _0x3d202b=_[_0xe7cf('0x7b')](this['queueReports'][_0x43cd35[_0xe7cf('0x45')]]);_0x3d202b['queuecallercomplete']=!![];_0x3d202b[_0xe7cf('0x4d')]=_0xe7cf('0x8b');logger[_0xe7cf('0x6c')](_0xe7cf('0x8c'),_0x3d202b[_0xe7cf('0x49')],_0x3d202b['type']);}}}catch(_0x1e9c4d){logger[_0xe7cf('0x3c')](_0xe7cf('0x8a'),_0x43cd35['uniqueid'],util['inspect'](_0x1e9c4d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe7cf('0xc')]['syncAgentComplete']=function(_0x199b78){try{if(this[_0xe7cf('0x6a')](_0x199b78)){logger[_0xe7cf('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x199b78['uniqueid'],util['inspect'](_0x199b78,{'showHidden':![],'depth':null}));if(this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x45')]]){var _0x121af9=_[_0xe7cf('0x7b')](this['queueReports'][_0x199b78[_0xe7cf('0x45')]]);_0x121af9[_0xe7cf('0x1b')]=![];_0x121af9[_0xe7cf('0x80')]=null;_0x121af9[_0xe7cf('0x8d')]=!![];_0x121af9['lastAssignedTo']=_0x199b78['membername'];_0x121af9[_0xe7cf('0x7e')]=_0x199b78[_0xe7cf('0x7e')];_0x121af9[_0xe7cf('0x7c')]=!![];_0x121af9[_0xe7cf('0x8e')]=![];_0x121af9[_0xe7cf('0x8f')]=null;if(!_0x121af9[_0xe7cf('0x90')]){if(_0x199b78[_0xe7cf('0x91')]=='transfer'){_0x121af9[_0xe7cf('0x4d')]=_0xe7cf('0x92');logger[_0xe7cf('0x6c')](_0xe7cf('0x93'),_0x121af9[_0xe7cf('0x49')],_0x121af9[_0xe7cf('0x51')]);}else{if(_['startsWith'](_0x199b78['channel'][_0xe7cf('0x94')](),_0xe7cf('0x95'))){if(this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x96')]]){var _0x16ac07=_[_0xe7cf('0x7b')](this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x96')]]);_0x16ac07['queuecallercomplete']=![];_0x16ac07[_0xe7cf('0x8e')]=!![];_0x16ac07['queuecallerexitAt']=moment(_0x121af9[_0xe7cf('0x72')])[_0xe7cf('0x97')](_0x199b78[_0xe7cf('0x7e')],_0xe7cf('0x98'))[_0xe7cf('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x16ac07['queuecallerexitreason']='FORWARDTRANSFER';_0x16ac07['transfer']=!![];_0x16ac07[_0xe7cf('0x99')]=_0xe7cf('0x9a');_0x16ac07[_0xe7cf('0x9b')]=_0x199b78[_0xe7cf('0x9c')];_0x16ac07[_0xe7cf('0x9d')]=_0x199b78[_0xe7cf('0x45')];logger[_0xe7cf('0x6c')](_0xe7cf('0x9e'),_0x16ac07[_0xe7cf('0x49')],_0x16ac07[_0xe7cf('0x51')]);var _0x17e1ca=this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x96')]];this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x96')]]=this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x45')]];this[_0xe7cf('0x11')][_0x199b78[_0xe7cf('0x45')]]=_0x17e1ca;}}else{_0x121af9[_0xe7cf('0x4d')]=_0xe7cf('0x9f')+_0x199b78['reason']['toUpperCase']();logger[_0xe7cf('0x6c')](_0xe7cf('0xa0'),_0x121af9[_0xe7cf('0x49')],_0x121af9[_0xe7cf('0x51')],_0x121af9[_0xe7cf('0x4d')]);}}}this[_0xe7cf('0x13')][_0x199b78[_0xe7cf('0x45')]]=_0x121af9;this[_0xe7cf('0x40')](_0x121af9,_0xe7cf('0x1d'));}}}catch(_0x40756f){logger[_0xe7cf('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x199b78['uniqueid'],util[_0xe7cf('0x3b')](_0x40756f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe7cf('0xc')][_0xe7cf('0x20')]=function(_0x72156c){try{if(this['isNotNull'](_0x72156c)){logger[_0xe7cf('0x43')](_0xe7cf('0xa1'),_0x72156c[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x72156c,{'showHidden':![],'depth':null}));this[_0xe7cf('0xa2')](_0x72156c[_0xe7cf('0x45')],_['keys'](_0x72156c[_0xe7cf('0xa3')])[0x0],_0x72156c[_0xe7cf('0xa4')]);if(this['queueReports'][_0x72156c[_0xe7cf('0x45')]]){var _0x587ff6=_[_0xe7cf('0x7b')](this['queueReports'][_0x72156c['uniqueid']]);if(_0x587ff6){if(this['isNotNull'](_0x72156c[_0xe7cf('0xa3')])&&this[_0xe7cf('0x6a')](_0x72156c[_0xe7cf('0xa3')]['queuestatus'])){switch(_0x72156c[_0xe7cf('0xa4')]){case _0xe7cf('0xa5'):_0x587ff6[_0xe7cf('0x8e')]=![];_0x587ff6[_0xe7cf('0x8f')]=null;break;case _0xe7cf('0xa6'):_0x587ff6[_0xe7cf('0xa7')]='timeout';_0x587ff6[_0xe7cf('0x8e')]=!![];_0x587ff6[_0xe7cf('0x8f')]=moment()[_0xe7cf('0x47')](_0xe7cf('0x73'));_0x587ff6[_0xe7cf('0x85')]=moment()[_0xe7cf('0x47')](_0xe7cf('0x73'));logger[_0xe7cf('0x43')](_0xe7cf('0xa8'),_0x72156c[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x587ff6,{'showHidden':![],'depth':null}));ami[_0xe7cf('0x46')]('custom:timeout',_0x587ff6);break;default:_0x587ff6[_0xe7cf('0x8e')]=!![];_0x587ff6[_0xe7cf('0x8f')]=moment()[_0xe7cf('0x47')](_0xe7cf('0x73'));_0x587ff6['queuecallerleaveAt']=moment()[_0xe7cf('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x587ff6['queuecallerabandon']=![];_0x587ff6['queuecallerabandonAt']=null;_0x587ff6[_0xe7cf('0x4d')]=_0x72156c[_0xe7cf('0xa4')];this['channels'][_0x72156c[_0xe7cf('0x45')]]=_0x587ff6;this[_0xe7cf('0x40')](_0x587ff6,'varset');}else if(this[_0xe7cf('0x6a')](_0x72156c['variable'])&&this['isNotNull'](_0x72156c['variable'][_0xe7cf('0xa9')])){if(!_0x587ff6[_0xe7cf('0x1b')]){_0x587ff6[_0xe7cf('0x8e')]=!![];_0x587ff6[_0xe7cf('0x8f')]=moment()[_0xe7cf('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x587ff6[_0xe7cf('0x4d')]=_0xe7cf('0xaa');_0x587ff6[_0xe7cf('0x85')]=moment()['format'](_0xe7cf('0x73'));this[_0xe7cf('0x13')][_0x72156c[_0xe7cf('0x45')]]=_0x587ff6;}}logger[_0xe7cf('0x6c')](_0xe7cf('0xab'),_0x72156c[_0xe7cf('0x45')],_0x587ff6['queue'],_0x587ff6['type'],_['keys'](_0x72156c[_0xe7cf('0xa3')])[0x0],_0x72156c[_0xe7cf('0xa4')]);_0x587ff6[_0xe7cf('0x15')]=this[_0xe7cf('0x15')][_0x72156c['uniqueid']];}}}}catch(_0x1e837b){logger[_0xe7cf('0x3c')](_0xe7cf('0xa1'),_0x72156c[_0xe7cf('0x45')],util[_0xe7cf('0x3b')](_0x1e837b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe7cf('0xc')][_0xe7cf('0xa2')]=function(_0x306997,_0x2a7297,_0x5102ca){var _0x47b7e5=[_0xe7cf('0xac'),_0xe7cf('0xad'),_0xe7cf('0xae'),'rtpaudioqosjitterbridged',_0xe7cf('0xaf'),'rtpaudioqoslossbridged',_0xe7cf('0xb0'),_0xe7cf('0xb1'),_0xe7cf('0xb2'),_0xe7cf('0xb3'),_0xe7cf('0xb4'),'bridgepvtcallid',_0xe7cf('0xb5'),_0xe7cf('0xb6'),_0xe7cf('0xb7'),_0xe7cf('0xb8'),'membername',_0xe7cf('0xb9'),_0xe7cf('0xba')];if(!_[_0xe7cf('0x36')](_0x2a7297)&&!_['includes'](_0x47b7e5,_0x2a7297)){if(_['isUndefined'](this[_0xe7cf('0x15')][_0x306997])){this[_0xe7cf('0x15')][_0x306997]={};}this[_0xe7cf('0x15')][_0x306997][_0x2a7297]=_0x5102ca;}};VoiceQueueReport['prototype']['handleHangup']=function(_0xe266cb,_0x353dd3,_0x39580f){var _0xa2fa37={};for(var _0x101ced=0x0;_0x101ced=0x0?moment(_0x48ec9a[_0xa7c9('0x18')])[_0xa7c9('0xd')](_0x48ec9a[_0xa7c9('0x17')],_0xa7c9('0xe')):null,'data1':_0xa7c9('0x19'),'data2':_0x48ec9a[_0xa7c9('0x1a')],'data3':_0x48ec9a[_0xa7c9('0x11')],'data4':_0x48ec9a[_0xa7c9('0x1b')]||null,'role':_0xa7c9('0x13'),'internal':_0x48ec9a[_0xa7c9('0x1a')]?_[_0xa7c9('0x1c')](_0x48ec9a[_0xa7c9('0x1a')]):undefined,'uniqueid':_0x48ec9a[_0xa7c9('0x14')]},'log':_0xa7c9('0x6')});}; \ No newline at end of file +var _0x8dc1=['moment','../client','voiceQueueReport','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','exten','queue','agent','toNumber','accountcode','uniqueid','Request','membername','endtime','starttime','outbound','dialstring'];(function(_0x44dda8,_0x3a36cb){var _0x40713f=function(_0x18c77e){while(--_0x18c77e){_0x44dda8['push'](_0x44dda8['shift']());}};_0x40713f(++_0x3a36cb);}(_0x8dc1,0x144));var _0x18dc=function(_0x5eb6ee,_0x206d93){_0x5eb6ee=_0x5eb6ee-0x0;var _0x49c754=_0x8dc1[_0x5eb6ee];return _0x49c754;};'use strict';var moment=require(_0x18dc('0x0'));var _=require('lodash');var util=require('util');var client=require(_0x18dc('0x1'));exports[_0x18dc('0x2')]=function(_0xedb170){var _0x509930=_0xedb170[_0x18dc('0x3')]||_0xedb170['queuecallerexitAt'];return client['Request'](_0x18dc('0x4'),{'body':{'channel':_0x18dc('0x5'),'membername':_0xedb170[_0x18dc('0x6')],'interface':_[_0x18dc('0x7')](_0xedb170[_0x18dc('0x8')])?util[_0x18dc('0x9')](_0x18dc('0xa'),_0xedb170['lastAssignedTo']):_0xedb170[_0x18dc('0x8')],'type':_0x18dc('0xb'),'enterAt':_0xedb170['queuecallerleaveAt'],'exitAt':_0x509930,'duration':moment(_0x509930)[_0x18dc('0xc')](_0xedb170[_0x18dc('0xd')],_0x18dc('0xe')),'data1':'inbound','data2':_0xedb170['calleridnum'],'data3':_0xedb170[_0x18dc('0xf')],'data4':null,'data5':_0xedb170[_0x18dc('0x10')],'role':_0x18dc('0x11'),'internal':_0xedb170['accountcode']?_[_0x18dc('0x12')](_0xedb170[_0x18dc('0x13')]):undefined,'uniqueid':_0xedb170[_0x18dc('0x14')]},'log':_0x18dc('0x4')});};exports['voiceDialReport']=function(_0xf99d8a){return client[_0x18dc('0x15')](_0x18dc('0x4'),{'body':{'channel':_0x18dc('0x5'),'membername':_0xf99d8a[_0x18dc('0x16')],'interface':_0xf99d8a[_0x18dc('0x8')],'type':_0x18dc('0xb'),'enterAt':_0xf99d8a['starttime'],'exitAt':_0xf99d8a[_0x18dc('0x17')],'duration':moment(_0xf99d8a[_0x18dc('0x17')])['diff'](_0xf99d8a[_0x18dc('0x18')],'seconds')>=0x0?moment(_0xf99d8a[_0x18dc('0x17')])[_0x18dc('0xc')](_0xf99d8a[_0x18dc('0x18')],_0x18dc('0xe')):null,'data1':_0x18dc('0x19'),'data2':_0xf99d8a[_0x18dc('0x13')],'data3':_0xf99d8a['exten'],'data4':_0xf99d8a[_0x18dc('0x1a')]||null,'role':_0x18dc('0x11'),'internal':_0xf99d8a[_0x18dc('0x13')]?_['toNumber'](_0xf99d8a[_0x18dc('0x13')]):undefined,'uniqueid':_0xf99d8a[_0x18dc('0x14')]},'log':_0x18dc('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 14c8ae8..19cae0f 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6554=['../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x6554,0x181));var _0x4655=function(_0x3906b4,_0x2d2c76){_0x3906b4=_0x3906b4-0x0;var _0x39892f=_0x6554[_0x3906b4];return _0x39892f;};'use strict';var client=require(_0x4655('0x0'));exports[_0x4655('0x1')]=function(){return client[_0x4655('0x2')](_0x4655('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4655('0x4'),_0x4655('0x5')]},'log':_0x4655('0x6')});}; \ No newline at end of file +var _0x6a95=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x522738,_0x26c67d){var _0x4af3e0=function(_0x244d3a){while(--_0x244d3a){_0x522738['push'](_0x522738['shift']());}};_0x4af3e0(++_0x26c67d);}(_0x6a95,0x1db));var _0x56a9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6a95[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(){return client[_0x56a9('0x2')](_0x56a9('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x56a9('0x4'),_0x56a9('0x5')]},'log':_0x56a9('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 1b0de6e..cb27b10 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bc5=['GetTemplate','name','Request'];(function(_0xb71c35,_0x129343){var _0x39224f=function(_0x26eee8){while(--_0x26eee8){_0xb71c35['push'](_0xb71c35['shift']());}};_0x39224f(++_0x129343);}(_0x2bc5,0x1bb));var _0x52bc=function(_0x5b95af,_0x1b27a5){_0x5b95af=_0x5b95af-0x0;var _0x57da28=_0x2bc5[_0x5b95af];return _0x57da28;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x5b2cbf){return function(_0x39f03e){return client[_0x52bc('0x0')](_0x52bc('0x1'),{'options':{'raw':!![],'attributes':['id',_0x52bc('0x2'),'html']},'log':_0x52bc('0x1')});};}; \ No newline at end of file +var _0x8b5c=['html','getTemplates','Request','name'];(function(_0xce255a,_0x26e6b0){var _0x3400cd=function(_0x1788e5){while(--_0x1788e5){_0xce255a['push'](_0xce255a['shift']());}};_0x3400cd(++_0x26e6b0);}(_0x8b5c,0x10d));var _0xc8b5=function(_0x448c50,_0x491757){_0x448c50=_0x448c50-0x0;var _0x535709=_0x8b5c[_0x448c50];return _0x535709;};'use strict';var client=require('../client');exports[_0xc8b5('0x0')]=function(_0x4ba81a){return function(_0x4b3edc){return client[_0xc8b5('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xc8b5('0x2'),_0xc8b5('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 462bcd8..8b1d192 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 _0xd513=['data7','../client','getTriggers','GetTrigger','name','channel','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions','action','data2','data3','data5'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd513,0x7f));var _0x3d51=function(_0x3c74fc,_0x1f46b3){_0x3c74fc=_0x3c74fc-0x0;var _0x3f44cd=_0xd513[_0x3c74fc];return _0x3f44cd;};'use strict';var client=require(_0x3d51('0x0'));exports[_0x3d51('0x1')]=function(_0x53879e){return function(_0x39bc0c){return client['Request'](_0x3d51('0x2'),{'options':{'raw':![],'attributes':['id',_0x3d51('0x3'),_0x3d51('0x4'),'status'],'include':[{'model':'Condition','as':_0x3d51('0x5'),'attributes':['id',_0x3d51('0x6'),_0x3d51('0x7'),_0x3d51('0x8')]},{'model':_0x3d51('0x9'),'as':_0x3d51('0xa'),'attributes':['id',_0x3d51('0x6'),_0x3d51('0x7'),_0x3d51('0x8')]},{'model':_0x3d51('0xb'),'as':_0x3d51('0xc'),'attributes':['id',_0x3d51('0xd'),'data1',_0x3d51('0xe'),_0x3d51('0xf'),'data4',_0x3d51('0x10'),'data6',_0x3d51('0x11')]}]},'log':_0x3d51('0x2')});};}; \ No newline at end of file +var _0xfc93=['GetTrigger','field','value','Condition','operator','Actions','action','data2','data3','data5','data6','data7','../client','getTriggers','Request'];(function(_0xede794,_0x2ae814){var _0x1ee325=function(_0x378360){while(--_0x378360){_0xede794['push'](_0xede794['shift']());}};_0x1ee325(++_0x2ae814);}(_0xfc93,0x93));var _0x3fc9=function(_0x21b88d,_0xfbff6a){_0x21b88d=_0x21b88d-0x0;var _0xf9851a=_0xfc93[_0x21b88d];return _0xf9851a;};'use strict';var client=require(_0x3fc9('0x0'));exports[_0x3fc9('0x1')]=function(_0x304148){return function(_0x23660c){return client[_0x3fc9('0x2')](_0x3fc9('0x3'),{'options':{'raw':![],'attributes':['id','name','channel','status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x3fc9('0x4'),'operator',_0x3fc9('0x5')]},{'model':_0x3fc9('0x6'),'as':'AnyConditions','attributes':['id','field',_0x3fc9('0x7'),'value']},{'model':'Action','as':_0x3fc9('0x8'),'attributes':['id',_0x3fc9('0x9'),'data1',_0x3fc9('0xa'),_0x3fc9('0xb'),'data4',_0x3fc9('0xc'),_0x3fc9('0xd'),_0x3fc9('0xe')]}]},'log':_0x3fc9('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 737f83d..72f43a9 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 _0xbe7c=['../client','getTrunks','Request','name','registry','GetTrunk'];(function(_0x4f8ccf,_0x8388e4){var _0x379001=function(_0x3e9659){while(--_0x3e9659){_0x4f8ccf['push'](_0x4f8ccf['shift']());}};_0x379001(++_0x8388e4);}(_0xbe7c,0x108));var _0xcbe7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe7c[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xcbe7('0x0'));exports[_0xcbe7('0x1')]=function(_0x2d8733){return function(_0x192c99){return client[_0xcbe7('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xcbe7('0x3'),_0xcbe7('0x4'),'defaultuser']},'log':_0xcbe7('0x5')});};}; \ No newline at end of file +var _0x33c5=['registry','defaultuser','getTrunks','Request','GetTrunk','name'];(function(_0x640207,_0x29fbe1){var _0x14bc51=function(_0x142717){while(--_0x142717){_0x640207['push'](_0x640207['shift']());}};_0x14bc51(++_0x29fbe1);}(_0x33c5,0xe6));var _0x533c=function(_0x4e9f29,_0x1bbcbf){_0x4e9f29=_0x4e9f29-0x0;var _0x8e1ab3=_0x33c5[_0x4e9f29];return _0x8e1ab3;};'use strict';var client=require('../client');exports[_0x533c('0x0')]=function(_0x23d84f){return function(_0x487b15){return client[_0x533c('0x1')](_0x533c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x533c('0x3'),_0x533c('0x4'),_0x533c('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9099296..7f6b60c 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x2ea100,_0x347ad5){var _0x4bdbeb=function(_0x106c7d){while(--_0x106c7d){_0x2ea100['push'](_0x2ea100['shift']());}};_0x4bdbeb(++_0x347ad5);}(_0x70e0,0x17b));var _0x070e=function(_0x4a9446,_0x3d2ade){_0x4a9446=_0x4a9446-0x0;var _0x23c972=_0x70e0[_0x4a9446];return _0x23c972;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x87a083,_0x2a9873){var _0x364e45=function(_0x2db709){while(--_0x2db709){_0x87a083['push'](_0x87a083['shift']());}};_0x364e45(++_0x2a9873);}(_0xedd9,0xfc));var _0x9edd=function(_0x1d6cb8,_0x31a3f3){_0x1d6cb8=_0x1d6cb8-0x0;var _0x38a43f=_0xedd9[_0x1d6cb8];return _0x38a43f;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index a096833..df4b0b7 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 _0x643c=['Request','UpdateVoiceAgentReport','../client','CreateVoiceAgentReport'];(function(_0x143ca5,_0x45019d){var _0x31fb7b=function(_0x4ff1be){while(--_0x4ff1be){_0x143ca5['push'](_0x143ca5['shift']());}};_0x31fb7b(++_0x45019d);}(_0x643c,0xba));var _0xc643=function(_0x31bdee,_0x5d888e){_0x31bdee=_0x31bdee-0x0;var _0x187af1=_0x643c[_0x31bdee];return _0x187af1;};'use strict';var client=require(_0xc643('0x0'));exports['create']=function(_0x472314){return client['Request'](_0xc643('0x1'),{'body':_0x472314,'log':_0xc643('0x1')});};exports['update']=function(_0x4e845f,_0x107471,_0x481146){return client[_0xc643('0x2')](_0xc643('0x3'),{'body':_0x4e845f,'options':{'where':{'uniqueid':_0x107471,'interface':_0x481146,'agentcomplete':!![]}},'log':_0xc643('0x3')});}; \ No newline at end of file +var _0xd154=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xd154,0x1bb));var _0x4d15=function(_0x2eec5d,_0xdc3aea){_0x2eec5d=_0x2eec5d-0x0;var _0x493519=_0xd154[_0x2eec5d];return _0x493519;};'use strict';var client=require('../client');exports[_0x4d15('0x0')]=function(_0x340944){return client[_0x4d15('0x1')](_0x4d15('0x2'),{'body':_0x340944,'log':'CreateVoiceAgentReport'});};exports[_0x4d15('0x3')]=function(_0x54bb09,_0x2777e7,_0x1da832){return client[_0x4d15('0x1')]('UpdateVoiceAgentReport',{'body':_0x54bb09,'options':{'where':{'uniqueid':_0x2777e7,'interface':_0x1da832,'agentcomplete':!![]}},'log':_0x4d15('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6fd011a..fb2df92 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 _0x9851=['billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','merge','calleridnum','callerid','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition'];(function(_0x26de31,_0x1d53f8){var _0x54aa37=function(_0x29c1b5){while(--_0x29c1b5){_0x26de31['push'](_0x26de31['shift']());}};_0x54aa37(++_0x1d53f8);}(_0x9851,0x1a6));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x1985('0x0'));var util=require(_0x1985('0x1'));var _=require('lodash');var client=require(_0x1985('0x2'));exports[_0x1985('0x3')]=function(_0xd89d68){return client[_0x1985('0x4')]('CreateVoiceCallReport',{'body':_[_0x1985('0x5')](_0xd89d68,{'source':_0xd89d68[_0x1985('0x6')],'destinationcontext':_0xd89d68['context'],'callerid':_0xd89d68[_0x1985('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x1985('0x8')});};exports[_0x1985('0x9')]=function(){return function(){return client[_0x1985('0x4')](_0x1985('0xa'),{'options':{'where':{'type':[_0x1985('0xb')],'createdAt':{'$between':[moment()[_0x1985('0xc')]('day')[_0x1985('0xd')](_0x1985('0xe')),moment()[_0x1985('0xf')](_0x1985('0x10'))[_0x1985('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x1985('0x11'),_0x1985('0x12'),'duration',_0x1985('0x13')]},'log':_0x1985('0x14')});};}; \ No newline at end of file +var _0xdc02=['lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','moment','util'];(function(_0x4b4240,_0x16631a){var _0x478c8c=function(_0xcfc58d){while(--_0xcfc58d){_0x4b4240['push'](_0x4b4240['shift']());}};_0x478c8c(++_0x16631a);}(_0xdc02,0x167));var _0x2dc0=function(_0x5854a6,_0x4111dd){_0x5854a6=_0x5854a6-0x0;var _0x32c7ee=_0xdc02[_0x5854a6];return _0x32c7ee;};'use strict';var moment=require(_0x2dc0('0x0'));var util=require(_0x2dc0('0x1'));var _=require(_0x2dc0('0x2'));var client=require(_0x2dc0('0x3'));exports[_0x2dc0('0x4')]=function(_0x5d303e){return client[_0x2dc0('0x5')](_0x2dc0('0x6'),{'body':_[_0x2dc0('0x7')](_0x5d303e,{'source':_0x5d303e[_0x2dc0('0x8')],'destinationcontext':_0x5d303e[_0x2dc0('0x9')],'callerid':_0x5d303e['callerid'],'amaflags':_0x2dc0('0xa')}),'log':_0x2dc0('0x6')});};exports[_0x2dc0('0xb')]=function(){return function(){return client[_0x2dc0('0x5')](_0x2dc0('0xc'),{'options':{'where':{'type':[_0x2dc0('0xd')],'createdAt':{'$between':[moment()['startOf'](_0x2dc0('0xe'))[_0x2dc0('0xf')](_0x2dc0('0x10')),moment()['endOf'](_0x2dc0('0xe'))['format'](_0x2dc0('0x10'))]}},'attributes':['type',_0x2dc0('0x11'),'duration',_0x2dc0('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index a0f9eb5..fcbfb4b 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 _0x5046=['../client','Request','CreateVoiceDialReport'];(function(_0x8dcd93,_0x51b2e7){var _0x2d272e=function(_0x5928e2){while(--_0x5928e2){_0x8dcd93['push'](_0x8dcd93['shift']());}};_0x2d272e(++_0x51b2e7);}(_0x5046,0x183));var _0x6504=function(_0x5c684b,_0x31ecd9){_0x5c684b=_0x5c684b-0x0;var _0x45d114=_0x5046[_0x5c684b];return _0x45d114;};'use strict';var client=require(_0x6504('0x0'));exports['create']=function(_0x2d1f75){return client[_0x6504('0x1')](_0x6504('0x2'),{'body':_0x2d1f75,'log':_0x6504('0x2')});}; \ No newline at end of file +var _0xc4e4=['create','Request','CreateVoiceDialReport','../client'];(function(_0x259a73,_0x50ebcd){var _0x513802=function(_0x3f58e1){while(--_0x3f58e1){_0x259a73['push'](_0x259a73['shift']());}};_0x513802(++_0x50ebcd);}(_0xc4e4,0x1e7));var _0x4c4e=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xc4e4[_0x543084];return _0x306a57;};'use strict';var client=require(_0x4c4e('0x0'));exports[_0x4c4e('0x1')]=function(_0x50d266){return client[_0x4c4e('0x2')](_0x4c4e('0x3'),{'body':_0x50d266,'log':_0x4c4e('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index d35a954..a79e41a 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 _0x4d46=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x28022a,_0x31eb0c){var _0x4b9d20=function(_0x1468bc){while(--_0x1468bc){_0x28022a['push'](_0x28022a['shift']());}};_0x4b9d20(++_0x31eb0c);}(_0x4d46,0x197));var _0x64d4=function(_0x3f8965,_0x3c80b9){_0x3f8965=_0x3f8965-0x0;var _0xcdf5c9=_0x4d46[_0x3f8965];return _0xcdf5c9;};'use strict';var client=require(_0x64d4('0x0'));exports[_0x64d4('0x1')]=function(){return function(){return client[_0x64d4('0x2')](_0x64d4('0x3'),{'options':{'raw':!![],'attributes':['id',_0x64d4('0x4'),_0x64d4('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xb921=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x4461ff,_0x2db42e){var _0x30c025=function(_0x2aef56){while(--_0x2aef56){_0x4461ff['push'](_0x4461ff['shift']());}};_0x30c025(++_0x2db42e);}(_0xb921,0x16a));var _0x1b92=function(_0x2b7cec,_0x948c5d){_0x2b7cec=_0x2b7cec-0x0;var _0x5c7780=_0xb921[_0x2b7cec];return _0x5c7780;};'use strict';var client=require(_0x1b92('0x0'));exports[_0x1b92('0x1')]=function(){return function(){return client[_0x1b92('0x2')](_0x1b92('0x3'),{'options':{'raw':!![],'attributes':['id',_0x1b92('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index f49fd31..a47fad1 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 _0xbdf1=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','getVoiceQueues','Request','GetVoiceQueue','name','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence'];(function(_0x789052,_0x422a0c){var _0x405831=function(_0x451272){while(--_0x451272){_0x789052['push'](_0x789052['shift']());}};_0x405831(++_0x422a0c);}(_0xbdf1,0xdc));var _0x1bdf=function(_0x191567,_0x231109){_0x191567=_0x191567-0x0;var _0x140553=_0xbdf1[_0x191567];return _0x140553;};'use strict';var client=require('../client');exports[_0x1bdf('0x0')]=function(){return function(){return client[_0x1bdf('0x1')](_0x1bdf('0x2'),{'options':{'raw':![],'attributes':['id',_0x1bdf('0x3'),'acw','acwTimeout',_0x1bdf('0x4'),_0x1bdf('0x5'),'type',_0x1bdf('0x6'),_0x1bdf('0x7'),'dialLimitChannel',_0x1bdf('0x8'),_0x1bdf('0x9'),_0x1bdf('0xa'),_0x1bdf('0xb'),_0x1bdf('0xc'),'dialOriginateCallerIdName',_0x1bdf('0xd'),'dialOriginateTimeout',_0x1bdf('0xe'),_0x1bdf('0xf'),_0x1bdf('0x10'),_0x1bdf('0x11'),_0x1bdf('0x12'),_0x1bdf('0x13'),_0x1bdf('0x14'),_0x1bdf('0x15'),_0x1bdf('0x16'),_0x1bdf('0x17'),_0x1bdf('0x18'),'dialGlobalInterval',_0x1bdf('0x19'),_0x1bdf('0x1a'),'dialAMDActive',_0x1bdf('0x1b'),_0x1bdf('0x1c'),_0x1bdf('0x1d'),_0x1bdf('0x1e'),_0x1bdf('0x1f'),_0x1bdf('0x20'),_0x1bdf('0x21'),_0x1bdf('0x22'),_0x1bdf('0x23'),_0x1bdf('0x24'),_0x1bdf('0x25'),'dialRecallInQueue',_0x1bdf('0x26'),_0x1bdf('0x27'),_0x1bdf('0x28'),_0x1bdf('0x29'),'monitor_format','strategy',_0x1bdf('0x2a'),_0x1bdf('0x2b'),'dialNoSuchNumberMaxRetry',_0x1bdf('0x2c'),_0x1bdf('0x2d'),'dialDropRetryFrequency',_0x1bdf('0x2e'),_0x1bdf('0x2f'),_0x1bdf('0x30'),_0x1bdf('0x31'),_0x1bdf('0x32'),_0x1bdf('0x33'),_0x1bdf('0x34'),'dialPredictiveIntervalMaxThreshold',_0x1bdf('0x35'),_0x1bdf('0x36'),_0x1bdf('0x37')],'include':[{'model':_0x1bdf('0x38'),'as':_0x1bdf('0x38'),'attributes':['id',_0x1bdf('0x3'),_0x1bdf('0x39'),_0x1bdf('0x3a')]},{'model':_0x1bdf('0x3b'),'as':_0x1bdf('0x3c'),'attributes':['id',_0x1bdf('0x3')]},{'model':_0x1bdf('0x38'),'as':'TrunkBackup','attributes':['id',_0x1bdf('0x3'),_0x1bdf('0x39'),_0x1bdf('0x3a')]},{'model':'Interval','as':_0x1bdf('0x3d'),'attributes':['id',_0x1bdf('0x3')],'include':[{'model':_0x1bdf('0x3d'),'as':'Intervals','attributes':['id',_0x1bdf('0x3'),'interval']}]}]},'log':_0x1bdf('0x0')});};}; \ No newline at end of file +var _0x18e4=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','TrunkBackup','callerid','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x76087e,_0x9cd048){var _0x373c65=function(_0x1a4aed){while(--_0x1a4aed){_0x76087e['push'](_0x76087e['shift']());}};_0x373c65(++_0x9cd048);}(_0x18e4,0x94));var _0x418e=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0x18e4[_0x3b3f4f];return _0x174dbe;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x418e('0x0')](_0x418e('0x1'),{'options':{'raw':![],'attributes':['id',_0x418e('0x2'),_0x418e('0x3'),_0x418e('0x4'),'autopause',_0x418e('0x5'),'type',_0x418e('0x6'),_0x418e('0x7'),_0x418e('0x8'),'dialLimitQueue',_0x418e('0x9'),_0x418e('0xa'),_0x418e('0xb'),_0x418e('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions',_0x418e('0xd'),_0x418e('0xe'),'dialCongestionMaxRetry',_0x418e('0xf'),_0x418e('0x10'),'dialBusyRetryFrequency',_0x418e('0x11'),_0x418e('0x12'),_0x418e('0x13'),_0x418e('0x14'),'dialGlobalInterval',_0x418e('0x15'),_0x418e('0x16'),'dialAMDActive',_0x418e('0x17'),_0x418e('0x18'),'dialAMDAfterGreetingSilence',_0x418e('0x19'),'dialAMDMinWordLength',_0x418e('0x1a'),'dialAMDMaximumNumberOfWords',_0x418e('0x1b'),_0x418e('0x1c'),_0x418e('0x1d'),'dialRecallMeTimeout',_0x418e('0x1e'),_0x418e('0x1f'),_0x418e('0x20'),_0x418e('0x21'),'dialQueueProject2',_0x418e('0x5'),_0x418e('0x22'),_0x418e('0x23'),'dialCutDigit',_0x418e('0x24'),_0x418e('0x25'),_0x418e('0x26'),'dialDropRetryFrequency',_0x418e('0x27'),_0x418e('0x28'),'dialMachineMaxRetry',_0x418e('0x29'),'dialAgentRejectMaxRetry',_0x418e('0x2a'),'mandatoryDisposition',_0x418e('0x2b'),_0x418e('0x2c'),_0x418e('0x2d'),_0x418e('0x2e')],'include':[{'model':_0x418e('0x2f'),'as':_0x418e('0x2f'),'attributes':['id',_0x418e('0x2'),'callerid',_0x418e('0x30')]},{'model':_0x418e('0x31'),'as':'mandatoryDispositionPause','attributes':['id',_0x418e('0x2')]},{'model':'Trunk','as':_0x418e('0x32'),'attributes':['id',_0x418e('0x2'),_0x418e('0x33'),_0x418e('0x30')]},{'model':_0x418e('0x34'),'as':_0x418e('0x34'),'attributes':['id',_0x418e('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0x418e('0x35')]}]}]},'log':_0x418e('0x36')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 76dea90..6b8c6b8 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0xa84652,_0x2b4f05){var _0xbe6fb1=function(_0x591469){while(--_0x591469){_0xa84652['push'](_0xa84652['shift']());}};_0xbe6fb1(++_0x2b4f05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5d29a7,_0x2523d8){var _0x596c21=function(_0x14d966){while(--_0x14d966){_0x5d29a7['push'](_0x5d29a7['shift']());}};_0x596c21(++_0x2523d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 1faecba..bee152e 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 _0xbf71=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xbf71,0x164));var _0x1bf7=function(_0x394ed2,_0x160fa8){_0x394ed2=_0x394ed2-0x0;var _0x5a9de1=_0xbf71[_0x394ed2];return _0x5a9de1;};'use strict';var client=require('../client');exports[_0x1bf7('0x0')]=function(_0x3bbf36){return function(){return client[_0x1bf7('0x1')](_0x1bf7('0x2'),{'options':{'where':{'VoiceQueueId':_0x3bbf36,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x1b55=['../client','getVoiceQueueRtPauses'];(function(_0x5e944a,_0x2847b4){var _0x38f07b=function(_0x433e88){while(--_0x433e88){_0x5e944a['push'](_0x5e944a['shift']());}};_0x38f07b(++_0x2847b4);}(_0x1b55,0xea));var _0x51b5=function(_0x4956f2,_0xb602ca){_0x4956f2=_0x4956f2-0x0;var _0x1da579=_0x1b55[_0x4956f2];return _0x1da579;};'use strict';var client=require(_0x51b5('0x0'));exports[_0x51b5('0x1')]=function(_0x53cabf){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x53cabf,'paused':!![]},'raw':!![]},'log':_0x51b5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index df6a630..7020488 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5642d7,_0x291444){var _0x3bdbda=function(_0x31f70c){while(--_0x31f70c){_0x5642d7['push'](_0x5642d7['shift']());}};_0x3bdbda(++_0x291444);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x944dcf,_0x3d7b1e){var _0x3da147=function(_0x5afa3c){while(--_0x5afa3c){_0x944dcf['push'](_0x944dcf['shift']());}};_0x3da147(++_0x3d7b1e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 0207ff0..20bee90 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 _0xd2b9=['transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname'];(function(_0x3cb516,_0x4f170d){var _0x43a4a7=function(_0x430a7e){while(--_0x430a7e){_0x3cb516['push'](_0x3cb516['shift']());}};_0x43a4a7(++_0x4f170d);}(_0xd2b9,0x1e9));var _0x9d2b=function(_0x2ec3aa,_0x29bd65){_0x2ec3aa=_0x2ec3aa-0x0;var _0x284ab2=_0xd2b9[_0x2ec3aa];return _0x284ab2;};'use strict';var client=require(_0x9d2b('0x0'));exports[_0x9d2b('0x1')]={};exports[_0x9d2b('0x2')]=function(_0x39e0cc){return client[_0x9d2b('0x3')](_0x9d2b('0x4'),{'body':{'result':_0x39e0cc[_0x9d2b('0x5')],'transfererchannel':_0x39e0cc['transfererchannel'],'transferercalleridnum':_0x39e0cc[_0x9d2b('0x6')],'transferercalleridname':_0x39e0cc[_0x9d2b('0x7')],'transfererconnectedlinenum':_0x39e0cc[_0x9d2b('0x8')],'transfererconnectedlinename':_0x39e0cc[_0x9d2b('0x9')],'transfereraccountcode':_0x39e0cc[_0x9d2b('0xa')],'transferercontext':_0x39e0cc['transferercontext'],'transfererexten':_0x39e0cc[_0x9d2b('0xb')],'transfererlinkedid':_0x39e0cc[_0x9d2b('0xc')],'transfereechannel':_0x39e0cc['transfereechannel'],'transfereecalleridnum':_0x39e0cc[_0x9d2b('0xd')],'transfereecalleridname':_0x39e0cc[_0x9d2b('0xe')],'transfereeconnectedlinenum':_0x39e0cc[_0x9d2b('0xf')],'transfereeconnectedlinename':_0x39e0cc['transfereeconnectedlinename'],'transfereeaccountcode':_0x39e0cc[_0x9d2b('0x10')],'transfereecontext':_0x39e0cc[_0x9d2b('0x11')],'transfereeexten':_0x39e0cc[_0x9d2b('0x12')],'transfereelinkedid':_0x39e0cc[_0x9d2b('0x13')],'isexternal':_0x39e0cc[_0x9d2b('0x14')],'context':_0x39e0cc[_0x9d2b('0x15')],'extension':_0x39e0cc[_0x9d2b('0x16')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x9d2b('0x17')]=function(_0x51e75b){return client['Request'](_0x9d2b('0x4'),{'body':{'result':_0x51e75b[_0x9d2b('0x5')],'transfererchannel':_0x51e75b['origtransfererchannel'],'transferercalleridnum':_0x51e75b[_0x9d2b('0x18')],'transferercalleridname':_0x51e75b[_0x9d2b('0x19')],'transfererconnectedlinenum':_0x51e75b[_0x9d2b('0x1a')],'transfererconnectedlinename':_0x51e75b[_0x9d2b('0x1b')],'transfereraccountcode':_0x51e75b['origtransfereraccountcode'],'transferercontext':_0x51e75b[_0x9d2b('0x1c')],'transfererexten':_0x51e75b[_0x9d2b('0x1d')],'transfererlinkedid':_0x51e75b[_0x9d2b('0x1e')],'transfereechannel':_0x51e75b['transfertargetchannel'],'transfereecalleridnum':_0x51e75b[_0x9d2b('0x1f')],'transfereecalleridname':_0x51e75b[_0x9d2b('0x20')],'transfereeconnectedlinenum':_0x51e75b[_0x9d2b('0x21')],'transfereeconnectedlinename':_0x51e75b[_0x9d2b('0x22')],'transfereeaccountcode':_0x51e75b[_0x9d2b('0x23')],'transfereecontext':_0x51e75b[_0x9d2b('0x24')],'transfereeexten':_0x51e75b[_0x9d2b('0x25')],'transfereelinkedid':_0x51e75b[_0x9d2b('0x26')],'isexternal':_0x51e75b[_0x9d2b('0x14')],'context':_0x51e75b[_0x9d2b('0x27')],'extension':_0x51e75b[_0x9d2b('0x28')],'type':_0x9d2b('0x29')},'log':_0x9d2b('0x4')});}; \ No newline at end of file +var _0x54d9=['transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','blind','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','transfers','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode'];(function(_0x3533a2,_0xd08c0d){var _0x27c550=function(_0x147801){while(--_0x147801){_0x3533a2['push'](_0x3533a2['shift']());}};_0x27c550(++_0xd08c0d);}(_0x54d9,0xfb));var _0x954d=function(_0x48ebdb,_0x5b0054){_0x48ebdb=_0x48ebdb-0x0;var _0x5c1eaf=_0x54d9[_0x48ebdb];return _0x5c1eaf;};'use strict';var client=require('../client');exports[_0x954d('0x0')]={};exports[_0x954d('0x1')]=function(_0xbedc29){return client['Request'](_0x954d('0x2'),{'body':{'result':_0xbedc29['result'],'transfererchannel':_0xbedc29[_0x954d('0x3')],'transferercalleridnum':_0xbedc29[_0x954d('0x4')],'transferercalleridname':_0xbedc29[_0x954d('0x5')],'transfererconnectedlinenum':_0xbedc29[_0x954d('0x6')],'transfererconnectedlinename':_0xbedc29['transfererconnectedlinename'],'transfereraccountcode':_0xbedc29[_0x954d('0x7')],'transferercontext':_0xbedc29[_0x954d('0x8')],'transfererexten':_0xbedc29['transfererexten'],'transfererlinkedid':_0xbedc29[_0x954d('0x9')],'transfereechannel':_0xbedc29[_0x954d('0xa')],'transfereecalleridnum':_0xbedc29[_0x954d('0xb')],'transfereecalleridname':_0xbedc29['transfereecalleridname'],'transfereeconnectedlinenum':_0xbedc29['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0xbedc29[_0x954d('0xc')],'transfereeaccountcode':_0xbedc29[_0x954d('0xd')],'transfereecontext':_0xbedc29[_0x954d('0xe')],'transfereeexten':_0xbedc29[_0x954d('0xf')],'transfereelinkedid':_0xbedc29[_0x954d('0x10')],'isexternal':_0xbedc29['isexternal'],'context':_0xbedc29['context'],'extension':_0xbedc29[_0x954d('0x11')],'type':_0x954d('0x12')},'log':_0x954d('0x2')});};exports['attendedTransfer']=function(_0x16e0e7){return client[_0x954d('0x13')](_0x954d('0x2'),{'body':{'result':_0x16e0e7[_0x954d('0x14')],'transfererchannel':_0x16e0e7[_0x954d('0x15')],'transferercalleridnum':_0x16e0e7[_0x954d('0x16')],'transferercalleridname':_0x16e0e7[_0x954d('0x17')],'transfererconnectedlinenum':_0x16e0e7[_0x954d('0x18')],'transfererconnectedlinename':_0x16e0e7['secondtransfererconnectedlinename'],'transfereraccountcode':_0x16e0e7[_0x954d('0x19')],'transferercontext':_0x16e0e7[_0x954d('0x1a')],'transfererexten':_0x16e0e7['secondtransfererexten'],'transfererlinkedid':_0x16e0e7[_0x954d('0x1b')],'transfereechannel':_0x16e0e7[_0x954d('0x1c')],'transfereecalleridnum':_0x16e0e7['transfertargetcalleridnum'],'transfereecalleridname':_0x16e0e7[_0x954d('0x1d')],'transfereeconnectedlinenum':_0x16e0e7[_0x954d('0x1e')],'transfereeconnectedlinename':_0x16e0e7['transfertargetconnectedlinename'],'transfereeaccountcode':_0x16e0e7['transfertargetaccountcode'],'transfereecontext':_0x16e0e7[_0x954d('0x1f')],'transfereeexten':_0x16e0e7[_0x954d('0x20')],'transfereelinkedid':_0x16e0e7[_0x954d('0x21')],'isexternal':_0x16e0e7[_0x954d('0x22')],'context':_0x16e0e7[_0x954d('0x23')],'extension':_0x16e0e7['origtransfererexten'],'type':_0x954d('0x24')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a65b763..ca5c81d 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 _0x2675=['outbound','includes','filter','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','values','trunks','run','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','moment','../../../config/environment','../ami','../model/voiceQueueSummary','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','pick','keys','reload','module','action','Reload','Action','then','message','catch','join','command','Command','voiceQueues','hasOwnProperty','push','find','omit','undefined','length','ami\x20disconnected','voicechannel','validate','map','channels','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','type','inbound'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0x2675,0x75));var _0x5267=function(_0x369826,_0x110b43){_0x369826=_0x369826-0x0;var _0xcc4c29=_0x2675[_0x369826];return _0xcc4c29;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x5267('0x1'));var config=require(_0x5267('0x2'));var properties=require('../properties');var ami=require(_0x5267('0x3'));var VoiceQueueSummary=require(_0x5267('0x4'));exports['listen']=function(_0x328776,_0xf2b350,_0x4bd042){return new Promise(function(_0x10f92c,_0x20f065){var _0xc56cd5={'QueuePause':function(_0x527c16){return new Promise(function(_0x9e0a27){var _0x46bfdf=util['format'](_0x5267('0x5'),'SIP',_0x527c16[_0x5267('0x6')]);if(_0x328776[_0x5267('0x7')]&&_0x328776[_0x5267('0x7')][_0x46bfdf]&&_0x328776['timers'][_0x46bfdf][_0x5267('0x8')]){_0x328776['timers'][_0x46bfdf][_0x5267('0x9')]();}if(_0x328776['agents'][_0x46bfdf]){_0x328776[_0x5267('0xa')][_0x46bfdf][_0x5267('0xb')]({'statePause':_0x527c16[_0x5267('0xc')]?!![]:![]});}_0x9e0a27({'code':0xc8,'message':_0x5267('0xd')});});},'Reload':function(_0x1d7090){var _0x1171b9=this;return new Promise(function(_0x20785c,_0x36dc17){if(ami[_0x5267('0xe')]()==![]){return _0x36dc17(_0x1171b9[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x1d7090=_[_0x5267('0x12')](_0x1d7090,_[_0x5267('0x13')](properties[_0x5267('0x14')][_0x5267('0x15')]));_0x1d7090[_0x5267('0x16')]=_0x5267('0x17');return ami[_0x5267('0x18')](_0x1d7090)[_0x5267('0x19')](function(_0x15d81e){_0x20785c({'code':0xc8,'message':_0x15d81e[_0x5267('0x1a')]});})[_0x5267('0x1b')](function(_0x1ab03){_0x36dc17(_0x1171b9['error'](0x1f5,_0x1ab03[_0x5267('0x1a')]));});});},'Command':function(_0x2afd38){var _0x5069e8=this;return new Promise(function(_0x20cb50,_0x56733e){if(ami[_0x5267('0xe')]()==![]){return _0x56733e(_0x5069e8[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],'ami\x20disconnected'][_0x5267('0x1c')]('\x20')));}_0x2afd38=_['pick'](_0x2afd38,_0x5267('0x1d'));_0x2afd38[_0x5267('0x16')]=_0x5267('0x1e');return ami['Action'](_0x2afd38)['then'](function(_0x5546e2){_0x20cb50({'code':0xc8,'message':_0x5546e2['content']});})['catch'](function(_0x26c7f8){_0x56733e(_0x5069e8[_0x5267('0xf')](0x1f5,_0x26c7f8[_0x5267('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x279377){var _0x11c8ea=[];for(var _0x40d1be in _0x328776[_0x5267('0x1f')]){if(_0x328776[_0x5267('0x1f')][_0x5267('0x20')](_0x40d1be)){var _0x59f112=_0x328776['voiceQueues'][_0x40d1be];var _0x354111=new VoiceQueueSummary(_0x59f112);_0x11c8ea[_0x5267('0x21')](_0x354111);}}_0x279377({'count':_0x11c8ea['length'],'rows':_0x11c8ea});});},'UpdateVoiceQueue':function(_0x45373e){return new Promise(function(_0x52504e,_0x4d7c2a){var _0x43e7e7=_[_0x5267('0x22')](_0x328776[_0x5267('0x1f')],{'id':parseInt(_0x45373e['id'])});var _0x2d2ace=_[_0x5267('0x23')](_0x45373e,['id']);if(_0x43e7e7){for(var _0x4f3d4d in _0x2d2ace){if(typeof _0x2d2ace[_0x4f3d4d]!=='undefined'&&typeof _0x43e7e7[_0x4f3d4d]!==_0x5267('0x24')){_0x43e7e7[_0x4f3d4d]=_0x2d2ace[_0x4f3d4d];}}_0x52504e(_0x43e7e7);}else{_0x4d7c2a();}});},'VoiceChannels':function(){return new Promise(function(_0x10a68c){var _0x24496d=_['values'](_0x328776['channels']);_0x10a68c({'count':_0x24496d[_0x5267('0x25')],'rows':_0x24496d});});},'VoiceChannelMixMonitor':function(_0x3ef2a8){var _0x1fa725=this;return new Promise(function(_0x5bec7e,_0x59b091){if(ami[_0x5267('0xe')]()==![]){return _0x59b091(_0x1fa725[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')]['username'],_0x5267('0x26')][_0x5267('0x1c')]('\x20')));}var _0x4344c5=schema(properties[_0x5267('0x27')])[_0x5267('0x28')](_0x3ef2a8);if(_0x4344c5[_0x5267('0x25')]>0x0){return _0x59b091(_0x1fa725[_0x5267('0xf')](0x1f4,_[_0x5267('0x29')](_0x4344c5,'message')['join'](',\x20')));}var _0x39e309=_['find'](_0x328776[_0x5267('0x2a')],{'uniqueid':_0x3ef2a8[_0x5267('0x2b')]});if(_0x39e309&&_0x39e309[_0x5267('0x2c')]){var _0x3a729c=util['format'](_0x5267('0x2d'),_0x3ef2a8[_0x5267('0x2e')]||_0x3ef2a8[_0x5267('0x2b')],_0x3ef2a8[_0x5267('0x2f')]||_0x5267('0x30'));return ami[_0x5267('0x18')]({'action':_0x5267('0x31'),'channel':_0x39e309[_0x5267('0x2c')],'file':_0x3a729c,'options':'ai(mixmonitorid)'})[_0x5267('0x19')](function(_0x4fdee0){var _0x391235=_[_0x5267('0x22')](_0x39e309[_0x5267('0x32')],{'filename':_0x5267('0x33')+_0x3a729c[_0x5267('0x34')]()});if(_[_0x5267('0x35')](_0x391235)){_0x39e309[_0x5267('0x32')]['push']({'filename':_0x5267('0x33')+_0x3a729c[_0x5267('0x34')](),'createdAt':moment()[_0x5267('0x2f')](_0x5267('0x36')),'mixmonitorid':_0x4fdee0[_0x5267('0x37')],'status':_0x5267('0x38')});}else{_0x391235[_0x5267('0x37')]=_0x4fdee0['mixmonitorid'];_0x391235[_0x5267('0x39')]='rec';}_0x5bec7e({'code':0xc8,'message':[_0x3ef2a8[_0x5267('0x2b')],'MixMonitor\x20Success',_0x4fdee0['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x4fdee0[_0x5267('0x37')]});})['catch'](function(_0xf33688){_0x59b091(_0x1fa725[_0x5267('0xf')](0x1f5,[_0x3ef2a8[_0x5267('0x2b')],_0xf33688[_0x5267('0x1a')]['toLowerCase']()][_0x5267('0x1c')]('\x20')));});}else{return _0x59b091(_0x1fa725[_0x5267('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x54a5e5){var _0x3e1483=this;return new Promise(function(_0x560cdf,_0x12df83){if(ami[_0x5267('0xe')]()==![]){return _0x12df83(_0x3e1483[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],_0x5267('0x26')]['join']('\x20')));}var _0x50736e=schema(properties[_0x5267('0x27')])['validate'](_0x54a5e5);if(_0x50736e[_0x5267('0x25')]>0x0){return _0x12df83(_0x3e1483[_0x5267('0xf')](0x1f4,_['map'](_0x50736e,_0x5267('0x1a'))[_0x5267('0x1c')](',\x20')));}var _0x299a13=_[_0x5267('0x22')](_0x328776[_0x5267('0x2a')],{'uniqueid':_0x54a5e5[_0x5267('0x2b')]});if(_0x299a13){return Promise[_0x5267('0x3a')]()[_0x5267('0x19')](function(){if(_0x299a13[_0x5267('0x2c')]){return ami['Action']({'action':_0x5267('0x3b'),'channel':_0x299a13[_0x5267('0x2c')],'mixmonitorid':_0x54a5e5[_0x5267('0x37')]})[_0x5267('0x1b')](function(){});}})[_0x5267('0x19')](function(){if(_0x299a13['destinationchannel']){return ami[_0x5267('0x18')]({'action':'StopMixMonitor','channel':_0x299a13[_0x5267('0x3c')],'mixmonitorid':_0x54a5e5['mixmonitorid']})['catch'](function(){});}})[_0x5267('0x19')](function(){var _0x56d33f=_[_0x5267('0x22')](_0x299a13[_0x5267('0x32')],{'mixmonitorid':_0x54a5e5[_0x5267('0x37')]});if(_0x56d33f){_0x56d33f[_0x5267('0x39')]='stop';}})[_0x5267('0x19')](function(){var _0x4ee826=util['format'](_0x5267('0x2d'),_0x54a5e5[_0x5267('0x2e')]||_0x54a5e5['uniqueid'],_0x54a5e5['format']||_0x5267('0x30'));var _0xe0439e=_[_0x5267('0x22')](_0x299a13[_0x5267('0x32')],{'filename':_0x5267('0x33')+_0x4ee826[_0x5267('0x34')]()});if(_0xe0439e){_0xe0439e[_0x5267('0x39')]=_0x5267('0x3d');}})[_0x5267('0x19')](function(){_0x560cdf({'code':0xc8,'message':[_0x54a5e5[_0x5267('0x2b')],_0x5267('0x3e')][_0x5267('0x1c')]('\x20')});})[_0x5267('0x1b')](function(_0x4693d9){_0x12df83(_0x3e1483['error'](0x1f5,[_0x54a5e5[_0x5267('0x2b')],_0x4693d9[_0x5267('0x1a')][_0x5267('0x34')]()]['join']('\x20')));});}else{return _0x12df83(_0x3e1483[_0x5267('0xf')](0x1f5,_0x5267('0x3f')));}});},'VoiceQueuesChannels':function(_0x31b722){var _0x2a97f1=this;return new Promise(function(_0x119546){var _0x1457cf=_['values'](_0x328776[_0x5267('0x40')]);var _0x5318d0={'count':_0x1457cf[_0x5267('0x25')],'rows':_0x1457cf};if(_0x31b722&&_0x31b722[_0x5267('0x41')]){if(![_0x5267('0x42'),_0x5267('0x43')][_0x5267('0x44')](_0x31b722[_0x5267('0x41')])){return _0x20f065(_0x2a97f1[_0x5267('0xf')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x57ca8f=_[_0x5267('0x45')](_0x1457cf,function(_0x15b5c9){return _0x15b5c9['type']===_0x31b722[_0x5267('0x41')];});_0x5318d0['count']=_0x57ca8f['length'];_0x5318d0[_0x5267('0x46')]=_0x57ca8f;}_0x119546(_0x5318d0);});},'VoiceQueuesChannel':function(_0x79cee1){var _0x1b11e4=this;return new Promise(function(_0x194519,_0x2be9da){var _0x3e7e6a=schema(properties[_0x5267('0x47')])[_0x5267('0x28')](_0x79cee1);if(_0x3e7e6a[_0x5267('0x25')]>0x0){return _0x2be9da(_0x1b11e4[_0x5267('0xf')](0x1f4,_['map'](_0x3e7e6a,_0x5267('0x1a'))[_0x5267('0x1c')](',\x20')));}var _0x3c7c37=_[_0x5267('0x22')](_0x328776[_0x5267('0x40')],{'uniqueid':_0x79cee1[_0x5267('0x2b')]});if(_0x3c7c37){_0x194519(_0x3c7c37);}else{return _0x2be9da(_0x1b11e4['error'](0x1f5,_0x5267('0x3f')));}});},'VoiceQueuesChannelHangup':function(_0x5ad1ce){var _0x1522d6=this;return new Promise(function(_0x3b0b6a,_0x19fd1c){if(ami['isConnected']()==![]){return _0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],_0x5267('0x26')][_0x5267('0x1c')]('\x20')));}var _0x4e809c=schema(properties[_0x5267('0x48')])[_0x5267('0x28')](_0x5ad1ce);if(_0x4e809c[_0x5267('0x25')]>0x0){return _0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f4,_['map'](_0x4e809c,'message')[_0x5267('0x1c')](',\x20')));}var _0x5393e9=_[_0x5267('0x22')](_0x328776[_0x5267('0x40')],{'uniqueid':_0x5ad1ce['uniqueid']});if(_0x5393e9&&_0x5393e9['channel']){return ami[_0x5267('0x18')]({'action':_0x5267('0x49'),'channel':_0x5393e9[_0x5267('0x2c')]})['then'](function(_0x457dca){_0x3b0b6a({'code':0xc8,'message':[_0x5ad1ce[_0x5267('0x2b')],_0x457dca[_0x5267('0x1a')][_0x5267('0x34')]()]['join']('\x20')});})['catch'](function(_0x540ab8){_0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f5,[_0x5ad1ce[_0x5267('0x2b')],_0x540ab8[_0x5267('0x1a')][_0x5267('0x34')]()][_0x5267('0x1c')]('\x20')));});}else{return _0x19fd1c(_0x1522d6[_0x5267('0xf')](0x1f5,_0x5267('0x3f')));}});},'VoiceQueuesChannelRedirect':function(_0x7c513c){var _0x486b02=this;return new Promise(function(_0x1ddfad,_0x667b5d){if(ami['isConnected']()==![]){return _0x667b5d(_0x486b02[_0x5267('0xf')](0x1f4,[config[_0x5267('0x10')]['ip'],config[_0x5267('0x10')][_0x5267('0x11')],_0x5267('0x26')][_0x5267('0x1c')]('\x20')));}var _0x4915f4=schema(properties[_0x5267('0x4a')])[_0x5267('0x28')](_0x7c513c);if(_0x4915f4[_0x5267('0x25')]>0x0){return _0x667b5d(_0x486b02[_0x5267('0xf')](0x1f4,_[_0x5267('0x29')](_0x4915f4,_0x5267('0x1a'))['join'](',\x20')));}var _0x4222e8=_[_0x5267('0x22')](_0x328776[_0x5267('0x40')],{'uniqueid':_0x7c513c[_0x5267('0x2b')]});if(_0x4222e8&&_0x4222e8[_0x5267('0x2c')]){return ami[_0x5267('0x18')]({'action':'Redirect','channel':_0x4222e8[_0x5267('0x2c')],'exten':_0x7c513c[_0x5267('0x4b')],'context':_0x7c513c[_0x5267('0x4c')]||_0x4222e8[_0x5267('0x4c')],'priority':0x1})['then'](function(_0x516e6e){_0x1ddfad({'code':0xc8,'message':[_0x7c513c['uniqueid'],_0x516e6e[_0x5267('0x1a')]['toLowerCase']()][_0x5267('0x1c')]('\x20')});})['catch'](function(_0x3992b2){_0x667b5d(_0x486b02[_0x5267('0xf')](0x1f5,[_0x7c513c[_0x5267('0x2b')],_0x3992b2[_0x5267('0x1a')][_0x5267('0x34')]()][_0x5267('0x1c')]('\x20')));});}else{return _0x667b5d(_0x486b02[_0x5267('0xf')](0x1f5,_0x5267('0x3f')));}});},'Agents':function(_0x489b9a){return new Promise(function(_0x489f46){var _0x5853e9=_[_0x5267('0x4d')](_0x328776[_0x5267('0xa')]);if(_0x489b9a&&_0x489b9a['id']){var _0x2ab2be=_[_0x5267('0x22')](_0x5853e9,function(_0x4974d1){return _0x4974d1['id']===_0x489b9a['id'];});_0x489f46(_0x2ab2be);}else{_0x489f46({'count':_0x5853e9[_0x5267('0x25')],'rows':_0x5853e9});}});},'Telephones':function(){return new Promise(function(_0x3c17de){var _0x3c547f=_[_0x5267('0x4d')](_0x328776['telephones']);_0x3c17de({'count':_0x3c547f[_0x5267('0x25')],'rows':_0x3c547f});});},'Trunks':function(){return new Promise(function(_0x2c3904){var _0x50a5e6=_[_0x5267('0x4d')](_0x328776[_0x5267('0x4e')]);_0x2c3904({'count':_0x50a5e6['length'],'rows':_0x50a5e6});});},'OutboundChannels':function(){return new Promise(function(_0x47e235){var _0x1521c4=_[_0x5267('0x4d')](_0x328776['outboundChannels']);_0x47e235({'count':_0x1521c4['length'],'rows':_0x1521c4});});},'Outbound':function(){return new Promise(function(_0xc1fca9){_0xc1fca9(_0x328776[_0x5267('0x43')]);});},'Campaigns':function(){return new Promise(function(_0x35b302){var _0x14bc66=_[_0x5267('0x4d')](_0x328776['campaigns']);_0x35b302({'count':_0x14bc66[_0x5267('0x25')],'rows':_0x14bc66});});},'VoiceQueuesPreview':function(_0x2c5d28){var _0x538786=this;return new Promise(function(_0x26c628,_0x12cdfe){_0xf2b350[_0x5267('0x4f')](_0x2c5d28['id'])[_0x5267('0x19')](function(_0xb8c52c){_0x26c628({'code':0xc8,'message':_0xb8c52c[_0x5267('0x1a')]});})[_0x5267('0x1b')](function(_0x84ff5){_0x12cdfe(_0x538786['error'](0x1f4,_0x84ff5['message']));});});},'EventManager':function(_0x1ac20f){var _0xbf7a4c=this;return new Promise(function(_0x3f729f,_0x3a6ad7){if(!_0x1ac20f['event']){return _0x3a6ad7(_0xbf7a4c[_0x5267('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x5267('0x50')](_0x5267('0x51')+_0x1ac20f[_0x5267('0x52')],_0x1ac20f[_0x5267('0x1a')]);_0x3f729f({'code':0xc8,'message':_0x1ac20f});});},'FaxAccounts':function(){return new Promise(function(_0x579f88){var _0x4fb8f3=_[_0x5267('0x4d')](_0x328776[_0x5267('0x53')]);_0x579f88({'count':_0x4fb8f3[_0x5267('0x25')],'rows':_0x4fb8f3});});},'SendFax':function(_0x360a1b){var _0x162506=this;return new Promise(function(_0x371302,_0x5e1ba4){_0x4bd042[_0x5267('0x54')](_0x360a1b)['then'](function(_0x418a03){_0x371302({'code':0xc8,'message':_0x418a03['message']});})[_0x5267('0x1b')](function(_0x20888d){_0x5e1ba4(_0x162506[_0x5267('0xf')](0x1f4,_0x20888d[_0x5267('0x1a')]));});});},'CheckAfterSend':function(_0x164cc1){var _0x1ccb6c=this;return new Promise(function(_0x449c4d,_0x256228){_0x4bd042[_0x5267('0x55')](_0x164cc1)[_0x5267('0x19')](function(_0x555c8){_0x449c4d({'code':0xc8,'message':_0x555c8['message']});})[_0x5267('0x1b')](function(_0x14baf4){_0x256228(_0x1ccb6c['error'](0x1f4,_0x14baf4[_0x5267('0x1a')]));});});}};var _0x18d985=jayson[_0x5267('0x56')](_0xc56cd5)[_0x5267('0x57')]();_0x18d985['on'](_0x5267('0xf'),function(_0x37b007){return _0x20f065(_0x37b007);});_0x18d985[_0x5267('0x58')](0x232a,'127.0.0.1',function(){console[_0x5267('0x59')](_0x5267('0x5a'),0x232a);return _0x10f92c(_0x5267('0x5b')+0x232a);});});}; \ No newline at end of file +var _0x31f0=['send','checkAfterSend','server','127.0.0.1','log','lodash','jayson/promise','moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','pick','keys','reload','module','Reload','Action','catch','message','ami\x20disconnected','join','action','voiceQueues','hasOwnProperty','length','find','omit','undefined','values','channels','voicechannel','validate','map','channel','%s.%s','filename','uniqueid','MixMonitor','ai(mixmonitorid)','then','monitors','isNil','push','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','wav','queueChannels','type','inbound','outbound','includes','filter','rows','Hangup','Redirect','exten','context','telephones','trunks','campaigns','event','emit','custom:','faxAccounts'];(function(_0x2b41cd,_0x2b4d13){var _0x4d021b=function(_0x3b969e){while(--_0x3b969e){_0x2b41cd['push'](_0x2b41cd['shift']());}};_0x4d021b(++_0x2b4d13);}(_0x31f0,0xb7));var _0x031f=function(_0x2a73d4,_0x420118){_0x2a73d4=_0x2a73d4-0x0;var _0x3014ea=_0x31f0[_0x2a73d4];return _0x3014ea;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var jayson=require(_0x031f('0x1'));var schema=require('validate');var moment=require(_0x031f('0x2'));var config=require(_0x031f('0x3'));var properties=require(_0x031f('0x4'));var ami=require(_0x031f('0x5'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0x031f('0x6')]=function(_0x1a63ba,_0x4f6059,_0x4c0f94){return new Promise(function(_0x56328c,_0x3dc98e){var _0x487e65={'QueuePause':function(_0x365f59){return new Promise(function(_0x4300b4){var _0x2569b6=util[_0x031f('0x7')]('%s/%s',_0x031f('0x8'),_0x365f59[_0x031f('0x9')]);if(_0x1a63ba[_0x031f('0xa')]&&_0x1a63ba[_0x031f('0xa')][_0x2569b6]&&_0x1a63ba[_0x031f('0xa')][_0x2569b6][_0x031f('0xb')]){_0x1a63ba[_0x031f('0xa')][_0x2569b6][_0x031f('0xc')]();}if(_0x1a63ba['agents'][_0x2569b6]){_0x1a63ba[_0x031f('0xd')][_0x2569b6][_0x031f('0xe')]({'statePause':_0x365f59[_0x031f('0xf')]?!![]:![]});}_0x4300b4({'code':0xc8,'message':_0x031f('0x10')});});},'Reload':function(_0x3819bb){var _0x405896=this;return new Promise(function(_0x1c230d,_0x5d0457){if(ami[_0x031f('0x11')]()==![]){return _0x5d0457(_0x405896[_0x031f('0x12')](0x1f4,[config[_0x031f('0x13')]['ip'],config[_0x031f('0x13')][_0x031f('0x14')],'ami\x20disconnected']['join']('\x20')));}_0x3819bb=_[_0x031f('0x15')](_0x3819bb,_[_0x031f('0x16')](properties[_0x031f('0x17')][_0x031f('0x18')]));_0x3819bb['action']=_0x031f('0x19');return ami[_0x031f('0x1a')](_0x3819bb)['then'](function(_0xcdae16){_0x1c230d({'code':0xc8,'message':_0xcdae16['message']});})[_0x031f('0x1b')](function(_0x5f2199){_0x5d0457(_0x405896[_0x031f('0x12')](0x1f5,_0x5f2199[_0x031f('0x1c')]));});});},'Command':function(_0x1ceddc){var _0x26cb5e=this;return new Promise(function(_0x1b76d6,_0x2825ef){if(ami[_0x031f('0x11')]()==![]){return _0x2825ef(_0x26cb5e[_0x031f('0x12')](0x1f4,[config[_0x031f('0x13')]['ip'],config['asterisk'][_0x031f('0x14')],_0x031f('0x1d')][_0x031f('0x1e')]('\x20')));}_0x1ceddc=_['pick'](_0x1ceddc,'command');_0x1ceddc[_0x031f('0x1f')]='Command';return ami[_0x031f('0x1a')](_0x1ceddc)['then'](function(_0x54d054){_0x1b76d6({'code':0xc8,'message':_0x54d054['content']});})[_0x031f('0x1b')](function(_0x12c406){_0x2825ef(_0x26cb5e[_0x031f('0x12')](0x1f5,_0x12c406[_0x031f('0x1c')]));});});},'VoiceQueues':function(){return new Promise(function(_0x494568){var _0x374b65=[];for(var _0x5a64c0 in _0x1a63ba[_0x031f('0x20')]){if(_0x1a63ba[_0x031f('0x20')][_0x031f('0x21')](_0x5a64c0)){var _0x567666=_0x1a63ba[_0x031f('0x20')][_0x5a64c0];var _0x3b2a51=new VoiceQueueSummary(_0x567666);_0x374b65['push'](_0x3b2a51);}}_0x494568({'count':_0x374b65[_0x031f('0x22')],'rows':_0x374b65});});},'UpdateVoiceQueue':function(_0x28a617){return new Promise(function(_0x2403e9,_0x5395ea){var _0xa308b=_[_0x031f('0x23')](_0x1a63ba[_0x031f('0x20')],{'id':parseInt(_0x28a617['id'])});var _0xaf5bea=_[_0x031f('0x24')](_0x28a617,['id']);if(_0xa308b){for(var _0x301bd2 in _0xaf5bea){if(typeof _0xaf5bea[_0x301bd2]!=='undefined'&&typeof _0xa308b[_0x301bd2]!==_0x031f('0x25')){_0xa308b[_0x301bd2]=_0xaf5bea[_0x301bd2];}}_0x2403e9(_0xa308b);}else{_0x5395ea();}});},'VoiceChannels':function(){return new Promise(function(_0xab24ad){var _0x34f249=_[_0x031f('0x26')](_0x1a63ba[_0x031f('0x27')]);_0xab24ad({'count':_0x34f249[_0x031f('0x22')],'rows':_0x34f249});});},'VoiceChannelMixMonitor':function(_0x378692){var _0x87dc07=this;return new Promise(function(_0x2034ac,_0xfc4a89){if(ami[_0x031f('0x11')]()==![]){return _0xfc4a89(_0x87dc07['error'](0x1f4,[config[_0x031f('0x13')]['ip'],config[_0x031f('0x13')][_0x031f('0x14')],_0x031f('0x1d')][_0x031f('0x1e')]('\x20')));}var _0xb774cf=schema(properties[_0x031f('0x28')])[_0x031f('0x29')](_0x378692);if(_0xb774cf[_0x031f('0x22')]>0x0){return _0xfc4a89(_0x87dc07[_0x031f('0x12')](0x1f4,_[_0x031f('0x2a')](_0xb774cf,_0x031f('0x1c'))[_0x031f('0x1e')](',\x20')));}var _0x564f3b=_[_0x031f('0x23')](_0x1a63ba[_0x031f('0x27')],{'uniqueid':_0x378692['uniqueid']});if(_0x564f3b&&_0x564f3b[_0x031f('0x2b')]){var _0x1fde6b=util['format'](_0x031f('0x2c'),_0x378692[_0x031f('0x2d')]||_0x378692[_0x031f('0x2e')],_0x378692[_0x031f('0x7')]||'wav');return ami['Action']({'action':_0x031f('0x2f'),'channel':_0x564f3b['channel'],'file':_0x1fde6b,'options':_0x031f('0x30')})[_0x031f('0x31')](function(_0x43ef89){var _0x56a7f0=_['find'](_0x564f3b[_0x031f('0x32')],{'filename':'/var/spool/asterisk/monitor/'+_0x1fde6b['toLowerCase']()});if(_[_0x031f('0x33')](_0x56a7f0)){_0x564f3b[_0x031f('0x32')][_0x031f('0x34')]({'filename':_0x031f('0x35')+_0x1fde6b[_0x031f('0x36')](),'createdAt':moment()[_0x031f('0x7')](_0x031f('0x37')),'mixmonitorid':_0x43ef89['mixmonitorid'],'status':_0x031f('0x38')});}else{_0x56a7f0[_0x031f('0x39')]=_0x43ef89[_0x031f('0x39')];_0x56a7f0[_0x031f('0x3a')]='rec';}_0x2034ac({'code':0xc8,'message':[_0x378692[_0x031f('0x2e')],_0x031f('0x3b'),_0x43ef89[_0x031f('0x39')]]['join']('\x20'),'mixmonitorid':_0x43ef89[_0x031f('0x39')]});})[_0x031f('0x1b')](function(_0x5d6826){_0xfc4a89(_0x87dc07[_0x031f('0x12')](0x1f5,[_0x378692[_0x031f('0x2e')],_0x5d6826['message']['toLowerCase']()][_0x031f('0x1e')]('\x20')));});}else{return _0xfc4a89(_0x87dc07[_0x031f('0x12')](0x1f5,_0x031f('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x46885f){var _0x2691b7=this;return new Promise(function(_0xf0fb95,_0xe07087){if(ami['isConnected']()==![]){return _0xe07087(_0x2691b7[_0x031f('0x12')](0x1f4,[config[_0x031f('0x13')]['ip'],config['asterisk'][_0x031f('0x14')],'ami\x20disconnected'][_0x031f('0x1e')]('\x20')));}var _0x260a3d=schema(properties['voicechannel'])[_0x031f('0x29')](_0x46885f);if(_0x260a3d[_0x031f('0x22')]>0x0){return _0xe07087(_0x2691b7[_0x031f('0x12')](0x1f4,_['map'](_0x260a3d,_0x031f('0x1c'))[_0x031f('0x1e')](',\x20')));}var _0x1d3324=_[_0x031f('0x23')](_0x1a63ba[_0x031f('0x27')],{'uniqueid':_0x46885f[_0x031f('0x2e')]});if(_0x1d3324){return Promise[_0x031f('0x3d')]()[_0x031f('0x31')](function(){if(_0x1d3324[_0x031f('0x2b')]){return ami['Action']({'action':_0x031f('0x3e'),'channel':_0x1d3324[_0x031f('0x2b')],'mixmonitorid':_0x46885f[_0x031f('0x39')]})[_0x031f('0x1b')](function(){});}})[_0x031f('0x31')](function(){if(_0x1d3324[_0x031f('0x3f')]){return ami[_0x031f('0x1a')]({'action':_0x031f('0x3e'),'channel':_0x1d3324[_0x031f('0x3f')],'mixmonitorid':_0x46885f['mixmonitorid']})[_0x031f('0x1b')](function(){});}})['then'](function(){var _0x512937=_[_0x031f('0x23')](_0x1d3324[_0x031f('0x32')],{'mixmonitorid':_0x46885f[_0x031f('0x39')]});if(_0x512937){_0x512937[_0x031f('0x3a')]=_0x031f('0x40');}})['then'](function(){var _0x309642=util[_0x031f('0x7')](_0x031f('0x2c'),_0x46885f['filename']||_0x46885f[_0x031f('0x2e')],_0x46885f[_0x031f('0x7')]||_0x031f('0x41'));var _0x318829=_[_0x031f('0x23')](_0x1d3324[_0x031f('0x32')],{'filename':'/var/spool/asterisk/monitor/'+_0x309642['toLowerCase']()});if(_0x318829){_0x318829[_0x031f('0x3a')]='stop';}})[_0x031f('0x31')](function(){_0xf0fb95({'code':0xc8,'message':[_0x46885f[_0x031f('0x2e')],'StopMixMonitor\x20Success'][_0x031f('0x1e')]('\x20')});})['catch'](function(_0x5d38ea){_0xe07087(_0x2691b7[_0x031f('0x12')](0x1f5,[_0x46885f['uniqueid'],_0x5d38ea[_0x031f('0x1c')]['toLowerCase']()][_0x031f('0x1e')]('\x20')));});}else{return _0xe07087(_0x2691b7[_0x031f('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3a9fea){var _0x2e7abe=this;return new Promise(function(_0x57e32d){var _0x46471a=_['values'](_0x1a63ba[_0x031f('0x42')]);var _0x5e18f0={'count':_0x46471a[_0x031f('0x22')],'rows':_0x46471a};if(_0x3a9fea&&_0x3a9fea[_0x031f('0x43')]){if(![_0x031f('0x44'),_0x031f('0x45')][_0x031f('0x46')](_0x3a9fea['type'])){return _0x3dc98e(_0x2e7abe[_0x031f('0x12')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x186957=_[_0x031f('0x47')](_0x46471a,function(_0x4d49f8){return _0x4d49f8[_0x031f('0x43')]===_0x3a9fea[_0x031f('0x43')];});_0x5e18f0['count']=_0x186957[_0x031f('0x22')];_0x5e18f0[_0x031f('0x48')]=_0x186957;}_0x57e32d(_0x5e18f0);});},'VoiceQueuesChannel':function(_0x22a547){var _0x55b9cf=this;return new Promise(function(_0x1cf243,_0x597a60){var _0x254604=schema(properties['voicequeuechannel'])[_0x031f('0x29')](_0x22a547);if(_0x254604['length']>0x0){return _0x597a60(_0x55b9cf[_0x031f('0x12')](0x1f4,_[_0x031f('0x2a')](_0x254604,'message')['join'](',\x20')));}var _0x24525b=_[_0x031f('0x23')](_0x1a63ba['queueChannels'],{'uniqueid':_0x22a547[_0x031f('0x2e')]});if(_0x24525b){_0x1cf243(_0x24525b);}else{return _0x597a60(_0x55b9cf[_0x031f('0x12')](0x1f5,_0x031f('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x286d4e){var _0x21a89d=this;return new Promise(function(_0x1a01fa,_0x1f7c79){if(ami[_0x031f('0x11')]()==![]){return _0x1f7c79(_0x21a89d['error'](0x1f4,[config[_0x031f('0x13')]['ip'],config[_0x031f('0x13')][_0x031f('0x14')],'ami\x20disconnected'][_0x031f('0x1e')]('\x20')));}var _0x3e4414=schema(properties['voicequeuechannelhangup'])[_0x031f('0x29')](_0x286d4e);if(_0x3e4414[_0x031f('0x22')]>0x0){return _0x1f7c79(_0x21a89d[_0x031f('0x12')](0x1f4,_[_0x031f('0x2a')](_0x3e4414,'message')['join'](',\x20')));}var _0x4b5db9=_['find'](_0x1a63ba[_0x031f('0x42')],{'uniqueid':_0x286d4e[_0x031f('0x2e')]});if(_0x4b5db9&&_0x4b5db9['channel']){return ami[_0x031f('0x1a')]({'action':_0x031f('0x49'),'channel':_0x4b5db9['channel']})[_0x031f('0x31')](function(_0x26ecb0){_0x1a01fa({'code':0xc8,'message':[_0x286d4e[_0x031f('0x2e')],_0x26ecb0[_0x031f('0x1c')][_0x031f('0x36')]()][_0x031f('0x1e')]('\x20')});})[_0x031f('0x1b')](function(_0x4527e5){_0x1f7c79(_0x21a89d[_0x031f('0x12')](0x1f5,[_0x286d4e['uniqueid'],_0x4527e5[_0x031f('0x1c')]['toLowerCase']()][_0x031f('0x1e')]('\x20')));});}else{return _0x1f7c79(_0x21a89d[_0x031f('0x12')](0x1f5,_0x031f('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x574f26){var _0x4c1b74=this;return new Promise(function(_0xdb3d45,_0x46af33){if(ami[_0x031f('0x11')]()==![]){return _0x46af33(_0x4c1b74[_0x031f('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x031f('0x13')]['username'],'ami\x20disconnected'][_0x031f('0x1e')]('\x20')));}var _0x534bae=schema(properties['voicequeuechannelredirect'])[_0x031f('0x29')](_0x574f26);if(_0x534bae[_0x031f('0x22')]>0x0){return _0x46af33(_0x4c1b74[_0x031f('0x12')](0x1f4,_[_0x031f('0x2a')](_0x534bae,_0x031f('0x1c'))['join'](',\x20')));}var _0x56b573=_[_0x031f('0x23')](_0x1a63ba['queueChannels'],{'uniqueid':_0x574f26[_0x031f('0x2e')]});if(_0x56b573&&_0x56b573[_0x031f('0x2b')]){return ami['Action']({'action':_0x031f('0x4a'),'channel':_0x56b573[_0x031f('0x2b')],'exten':_0x574f26[_0x031f('0x4b')],'context':_0x574f26[_0x031f('0x4c')]||_0x56b573[_0x031f('0x4c')],'priority':0x1})[_0x031f('0x31')](function(_0x5bea08){_0xdb3d45({'code':0xc8,'message':[_0x574f26['uniqueid'],_0x5bea08[_0x031f('0x1c')][_0x031f('0x36')]()][_0x031f('0x1e')]('\x20')});})[_0x031f('0x1b')](function(_0x6d85c8){_0x46af33(_0x4c1b74[_0x031f('0x12')](0x1f5,[_0x574f26[_0x031f('0x2e')],_0x6d85c8['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x46af33(_0x4c1b74['error'](0x1f5,_0x031f('0x3c')));}});},'Agents':function(_0x14b33e){return new Promise(function(_0x45977a){var _0x4fb931=_[_0x031f('0x26')](_0x1a63ba[_0x031f('0xd')]);if(_0x14b33e&&_0x14b33e['id']){var _0x5133a6=_[_0x031f('0x23')](_0x4fb931,function(_0x2c15f4){return _0x2c15f4['id']===_0x14b33e['id'];});_0x45977a(_0x5133a6);}else{_0x45977a({'count':_0x4fb931[_0x031f('0x22')],'rows':_0x4fb931});}});},'Telephones':function(){return new Promise(function(_0x140ccd){var _0xb197ff=_[_0x031f('0x26')](_0x1a63ba[_0x031f('0x4d')]);_0x140ccd({'count':_0xb197ff['length'],'rows':_0xb197ff});});},'Trunks':function(){return new Promise(function(_0x571d15){var _0x8a448f=_['values'](_0x1a63ba[_0x031f('0x4e')]);_0x571d15({'count':_0x8a448f['length'],'rows':_0x8a448f});});},'OutboundChannels':function(){return new Promise(function(_0x13251c){var _0x1cefb8=_[_0x031f('0x26')](_0x1a63ba['outboundChannels']);_0x13251c({'count':_0x1cefb8[_0x031f('0x22')],'rows':_0x1cefb8});});},'Outbound':function(){return new Promise(function(_0x586315){_0x586315(_0x1a63ba[_0x031f('0x45')]);});},'Campaigns':function(){return new Promise(function(_0xffb00){var _0x3efa82=_['values'](_0x1a63ba[_0x031f('0x4f')]);_0xffb00({'count':_0x3efa82[_0x031f('0x22')],'rows':_0x3efa82});});},'VoiceQueuesPreview':function(_0x3c4b09){var _0x3e3ff5=this;return new Promise(function(_0x45330f,_0x5a55e7){_0x4f6059['run'](_0x3c4b09['id'])[_0x031f('0x31')](function(_0x15da9e){_0x45330f({'code':0xc8,'message':_0x15da9e['message']});})[_0x031f('0x1b')](function(_0x542dba){_0x5a55e7(_0x3e3ff5[_0x031f('0x12')](0x1f4,_0x542dba[_0x031f('0x1c')]));});});},'EventManager':function(_0x142310){var _0x448734=this;return new Promise(function(_0x52bb92,_0x284fe5){if(!_0x142310[_0x031f('0x50')]){return _0x284fe5(_0x448734[_0x031f('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x031f('0x51')](_0x031f('0x52')+_0x142310['event'],_0x142310[_0x031f('0x1c')]);_0x52bb92({'code':0xc8,'message':_0x142310});});},'FaxAccounts':function(){return new Promise(function(_0x4842a8){var _0x11d498=_[_0x031f('0x26')](_0x1a63ba[_0x031f('0x53')]);_0x4842a8({'count':_0x11d498[_0x031f('0x22')],'rows':_0x11d498});});},'SendFax':function(_0x3f3582){var _0x596280=this;return new Promise(function(_0x181232,_0x3dc159){_0x4c0f94[_0x031f('0x54')](_0x3f3582)['then'](function(_0x4f4aff){_0x181232({'code':0xc8,'message':_0x4f4aff[_0x031f('0x1c')]});})['catch'](function(_0x54f02d){_0x3dc159(_0x596280[_0x031f('0x12')](0x1f4,_0x54f02d[_0x031f('0x1c')]));});});},'CheckAfterSend':function(_0x1c8055){var _0x1d6aca=this;return new Promise(function(_0x92345b,_0x3b2aec){_0x4c0f94[_0x031f('0x55')](_0x1c8055)[_0x031f('0x31')](function(_0xecbfed){_0x92345b({'code':0xc8,'message':_0xecbfed[_0x031f('0x1c')]});})[_0x031f('0x1b')](function(_0x49505e){_0x3b2aec(_0x1d6aca[_0x031f('0x12')](0x1f4,_0x49505e[_0x031f('0x1c')]));});});}};var _0x1f4ecf=jayson[_0x031f('0x56')](_0x487e65)['http']();_0x1f4ecf['on'](_0x031f('0x12'),function(_0x5329c2){return _0x3dc98e(_0x5329c2);});_0x1f4ecf['listen'](0x232a,_0x031f('0x57'),function(){console[_0x031f('0x58')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x56328c('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index e75a555..c5087a2 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 _0x9825=['[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','','resolve','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','exec','data1','data2','data5','xmd-contactid','ListId','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4'];(function(_0x388da2,_0x571cad){var _0x2b1a45=function(_0x10f0e2){while(--_0x10f0e2){_0x388da2['push'](_0x388da2['shift']());}};_0x2b1a45(++_0x571cad);}(_0x9825,0x19f));var _0x5982=function(_0x5b9cfe,_0x34be08){_0x5b9cfe=_0x5b9cfe-0x0;var _0x38bb6b=_0x9825[_0x5b9cfe];return _0x38bb6b;};'use strict';var _=require('lodash');var BPromise=require(_0x5982('0x0'));var Redis=require(_0x5982('0x1'));var util=require(_0x5982('0x2'));var config=require(_0x5982('0x3'));var logger=require(_0x5982('0x4'))('trigger');var cmContactRpc=require(_0x5982('0x5'));config['redis']=_[_0x5982('0x6')](config[_0x5982('0x7')],{'host':_0x5982('0x8'),'port':0x18eb});var io=require(_0x5982('0x9'))(new Redis(config[_0x5982('0x7')]));function emit(_0x2decc0,_0x1be7d3,_0x40393f,_0x3a9cc6,_0xd6f5ef){logger['info']('[CM][%s][%s]',_0x2decc0,_0x1be7d3['id'],_0x40393f,_0x3a9cc6,JSON['stringify'](_0xd6f5ef));io['to'](_0x40393f)['emit'](_0x3a9cc6,_0xd6f5ef);}exports[_0x5982('0xa')]=function(_0x1d0102,_0x35fb3f,_0x42e38f,_0x144309){var _0x4037b7,_0x2d7130;var _0x53d616={};var _0x403018;var _0x5357eb=Number(_0x42e38f[_0x5982('0xb')]);var _0x5e7a62=_0x42e38f[_0x5982('0xc')]?Boolean(Number(_0x42e38f[_0x5982('0xc')])):![];var _0x351d69;var _0x5a4a6d=![];if(!_['isNil'](_0x42e38f[_0x5982('0xd')])){if(_0x42e38f[_0x5982('0xd')]=='1')_0x5a4a6d=!![];}if(!_0x5a4a6d){if(_0x144309[_0x5982('0xe')]){_0x53d616['id']=_0x144309['xmd-contactid'];}}if(!_0x53d616['id']){_0x53d616[_0x5982('0xf')]=_0x5357eb;_0x351d69=_0x42e38f[_0x5982('0x10')]&&_0x42e38f[_0x5982('0x10')]!=='0'?_0x42e38f[_0x5982('0x10')]['split'](','):['phone'];_0x53d616[_0x5982('0x11')]=_[_0x5982('0x12')](_0x351d69,function(_0x4ff385){var _0x211a5d={};_0x211a5d[_0x4ff385]=_0x144309[_0x5982('0x13')]?_0x144309[_0x5982('0x14')]:_0x144309[_0x5982('0x15')];return _0x211a5d;});_0x403018=_0x144309[_0x5982('0x13')]?_0x144309[_0x5982('0x14')]:_0x144309[_0x5982('0x15')];}var _0xa4a1e9=['id',_0x5982('0x16'),_0x5982('0x17'),_0x5982('0x18'),_0x5982('0x19'),_0x5982('0x1a'),_0x5982('0xf'),_0x5982('0x1b'),_0x5982('0x1c'),_0x5982('0x1d')];var _0x433a8c=_[_0x5982('0x1e')](_0xa4a1e9,_0x351d69);BPromise['resolve']()[_0x5982('0x1f')](cmContactRpc[_0x5982('0x20')]({'attributes':_0x433a8c,'where':_0x53d616,'phone':_0x403018}))[_0x5982('0x1f')](function(_0x1a4a75){_0x2d7130=_0x1a4a75;if(!_[_0x5982('0x21')](_0x2d7130)){if(_0x2d7130[_0x5982('0x22')]===0x1){_0x4037b7=_0x2d7130[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x144309['uniqueid'],_0x35fb3f['id'],_0x4037b7['id']);}else{logger[_0x5982('0x23')](_0x5982('0x24'),_0x144309['uniqueid'],_0x35fb3f['id'],_['map'](_0x2d7130,'id')[_0x5982('0x25')](','));}return;}else{logger[_0x5982('0x23')](_0x5982('0x26'),_0x144309[_0x5982('0x27')],_0x35fb3f['id']);var _0x409496={'ListId':_0x5357eb};var _0x3a2685=_0x42e38f['data4']&&_0x42e38f[_0x5982('0x28')]!=='0'?_0x42e38f[_0x5982('0x28')]:_0x5982('0x18');if(_0x5e7a62){logger[_0x5982('0x23')](_0x5982('0x29'),_0x144309[_0x5982('0x27')],_0x35fb3f['id']);_0x409496[_0x3a2685]=_[_0x5982('0x2a')](_0x144309[_0x5982('0x13')])?_0x144309[_0x5982('0x15')]:_0x144309['destcalleridnum'];if(_[_0x5982('0x2a')](_0x144309[_0x5982('0x13')])){_0x409496[_0x5982('0x16')]=_0x144309[_0x5982('0x2b')]&&_0x144309[_0x5982('0x2b')]!==''?_0x144309['calleridname']:_0x5982('0x2c');}else{_0x409496[_0x5982('0x16')]=_0x144309[_0x5982('0x2d')]&&_0x144309[_0x5982('0x2d')]!==_0x5982('0x2e')?_0x144309[_0x5982('0x2d')]:_0x5982('0x2c');}return BPromise[_0x5982('0x2f')]()[_0x5982('0x1f')](cmContactRpc['createContact'](_0x409496))[_0x5982('0x1f')](function(_0x46a977){_0x4037b7=_0x46a977;_0x2d7130['push'](_0x46a977);if(_0x4037b7){logger[_0x5982('0x23')](_0x5982('0x30'),_0x144309[_0x5982('0x27')],_0x35fb3f['id'],_0x4037b7['id']);}return;});}else{logger[_0x5982('0x23')](_0x5982('0x31'),_0x144309['uniqueid'],_0x35fb3f['id']);_0x409496[_0x3a2685]=_[_0x5982('0x2a')](_0x144309[_0x5982('0x13')])?_0x144309[_0x5982('0x15')]:_0x144309[_0x5982('0x14')];if(_[_0x5982('0x2a')](_0x144309['routeId'])){_0x409496['firstName']=_0x144309[_0x5982('0x2b')]&&_0x144309[_0x5982('0x2b')]!==''?_0x144309['calleridname']:_0x5982('0x2c');}else{_0x409496[_0x5982('0x16')]=_0x144309[_0x5982('0x2d')]&&_0x144309['destcalleridname']!==_0x5982('0x2e')?_0x144309['destcalleridname']:'Unknown';}_0x4037b7=_0x409496;_0x2d7130[_0x5982('0x32')](_0x409496);return;}}})['then'](function(){if(_0x1d0102){emit(_0x144309[_0x5982('0x27')],_0x35fb3f,util[_0x5982('0x33')](_0x5982('0x34'),_0x1d0102[_0x5982('0x35')]),util[_0x5982('0x33')]('trigger:%s',_0x42e38f[_0x5982('0x36')][_0x5982('0x37')]()),{'evt':_[_0x5982('0x38')](_0x144309,{'autoCreate':_0x5e7a62}),'contact':_0x4037b7===undefined?{}:_0x4037b7,'contacts':_0x2d7130['length']===0x0?undefined:_0x2d7130});}});}; \ No newline at end of file +var _0x4cfa=['join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','','format','user:%s','name','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','data5','ListId','data3','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','createdAt','scheduledAt','union','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4cfa,0xb9));var _0xa4cf=function(_0x7b3ebf,_0x58145b){_0x7b3ebf=_0x7b3ebf-0x0;var _0x2a8186=_0x4cfa[_0x7b3ebf];return _0x2a8186;};'use strict';var _=require(_0xa4cf('0x0'));var BPromise=require(_0xa4cf('0x1'));var Redis=require(_0xa4cf('0x2'));var util=require(_0xa4cf('0x3'));var config=require('../../../../config/environment');var logger=require(_0xa4cf('0x4'))(_0xa4cf('0x5'));var cmContactRpc=require(_0xa4cf('0x6'));config[_0xa4cf('0x7')]=_[_0xa4cf('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa4cf('0x9'))(new Redis(config[_0xa4cf('0x7')]));function emit(_0x3e5ad2,_0x2982fb,_0x501ff6,_0xd81ac9,_0x1d48c8){logger[_0xa4cf('0xa')](_0xa4cf('0xb'),_0x3e5ad2,_0x2982fb['id'],_0x501ff6,_0xd81ac9,JSON['stringify'](_0x1d48c8));io['to'](_0x501ff6)[_0xa4cf('0xc')](_0xd81ac9,_0x1d48c8);}exports[_0xa4cf('0xd')]=function(_0x569a72,_0x8118c5,_0x70a3e1,_0x51b460){var _0x3739b2,_0x4fb622;var _0x20c3c2={};var _0x10389e;var _0x2d200c=Number(_0x70a3e1[_0xa4cf('0xe')]);var _0x3736e7=_0x70a3e1[_0xa4cf('0xf')]?Boolean(Number(_0x70a3e1[_0xa4cf('0xf')])):![];var _0x484a5f;var _0x1cae94=![];if(!_['isNil'](_0x70a3e1[_0xa4cf('0x10')])){if(_0x70a3e1[_0xa4cf('0x10')]=='1')_0x1cae94=!![];}if(!_0x1cae94){if(_0x51b460['xmd-contactid']){_0x20c3c2['id']=_0x51b460['xmd-contactid'];}}if(!_0x20c3c2['id']){_0x20c3c2[_0xa4cf('0x11')]=_0x2d200c;_0x484a5f=_0x70a3e1['data3']&&_0x70a3e1['data3']!=='0'?_0x70a3e1[_0xa4cf('0x12')]['split'](','):[_0xa4cf('0x13')];_0x20c3c2[_0xa4cf('0x14')]=_[_0xa4cf('0x15')](_0x484a5f,function(_0x20dbfb){var _0x2ef1e2={};_0x2ef1e2[_0x20dbfb]=_0x51b460[_0xa4cf('0x16')]?_0x51b460['destcalleridnum']:_0x51b460[_0xa4cf('0x17')];return _0x2ef1e2;});_0x10389e=_0x51b460[_0xa4cf('0x16')]?_0x51b460[_0xa4cf('0x18')]:_0x51b460[_0xa4cf('0x17')];}var _0x5777e=['id',_0xa4cf('0x19'),_0xa4cf('0x1a'),_0xa4cf('0x13'),_0xa4cf('0x1b'),'fax',_0xa4cf('0x11'),_0xa4cf('0x1c'),_0xa4cf('0x1d'),'updatedAt'];var _0x22adff=_[_0xa4cf('0x1e')](_0x5777e,_0x484a5f);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x22adff,'where':_0x20c3c2,'phone':_0x10389e}))[_0xa4cf('0x1f')](function(_0x387dca){_0x4fb622=_0x387dca;if(!_[_0xa4cf('0x20')](_0x4fb622)){if(_0x4fb622['length']===0x1){_0x3739b2=_0x4fb622[0x0];logger[_0xa4cf('0xa')](_0xa4cf('0x21'),_0x51b460[_0xa4cf('0x22')],_0x8118c5['id'],_0x3739b2['id']);}else{logger[_0xa4cf('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x51b460['uniqueid'],_0x8118c5['id'],_[_0xa4cf('0x15')](_0x4fb622,'id')[_0xa4cf('0x23')](','));}return;}else{logger['info'](_0xa4cf('0x24'),_0x51b460[_0xa4cf('0x22')],_0x8118c5['id']);var _0x49d611={'ListId':_0x2d200c};var _0xd231f5=_0x70a3e1[_0xa4cf('0x25')]&&_0x70a3e1['data4']!=='0'?_0x70a3e1['data4']:_0xa4cf('0x13');if(_0x3736e7){logger[_0xa4cf('0xa')](_0xa4cf('0x26'),_0x51b460[_0xa4cf('0x22')],_0x8118c5['id']);_0x49d611[_0xd231f5]=_['isNil'](_0x51b460['routeId'])?_0x51b460[_0xa4cf('0x17')]:_0x51b460['destcalleridnum'];if(_[_0xa4cf('0x27')](_0x51b460[_0xa4cf('0x16')])){_0x49d611[_0xa4cf('0x19')]=_0x51b460[_0xa4cf('0x28')]&&_0x51b460[_0xa4cf('0x28')]!==''?_0x51b460[_0xa4cf('0x28')]:_0xa4cf('0x29');}else{_0x49d611[_0xa4cf('0x19')]=_0x51b460[_0xa4cf('0x2a')]&&_0x51b460[_0xa4cf('0x2a')]!==''?_0x51b460[_0xa4cf('0x2a')]:_0xa4cf('0x29');}return BPromise[_0xa4cf('0x2b')]()['then'](cmContactRpc[_0xa4cf('0x2c')](_0x49d611))['then'](function(_0xb5fab5){_0x3739b2=_0xb5fab5;_0x4fb622['push'](_0xb5fab5);if(_0x3739b2){logger[_0xa4cf('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x51b460['uniqueid'],_0x8118c5['id'],_0x3739b2['id']);}return;});}else{logger[_0xa4cf('0xa')](_0xa4cf('0x2d'),_0x51b460[_0xa4cf('0x22')],_0x8118c5['id']);_0x49d611[_0xd231f5]=_['isNil'](_0x51b460[_0xa4cf('0x16')])?_0x51b460['calleridnum']:_0x51b460[_0xa4cf('0x18')];if(_['isNil'](_0x51b460[_0xa4cf('0x16')])){_0x49d611[_0xa4cf('0x19')]=_0x51b460[_0xa4cf('0x28')]&&_0x51b460[_0xa4cf('0x28')]!==_0xa4cf('0x2e')?_0x51b460[_0xa4cf('0x28')]:_0xa4cf('0x29');}else{_0x49d611['firstName']=_0x51b460[_0xa4cf('0x2a')]&&_0x51b460[_0xa4cf('0x2a')]!==_0xa4cf('0x2e')?_0x51b460[_0xa4cf('0x2a')]:_0xa4cf('0x29');}_0x3739b2=_0x49d611;_0x4fb622['push'](_0x49d611);return;}}})[_0xa4cf('0x1f')](function(){if(_0x569a72){emit(_0x51b460[_0xa4cf('0x22')],_0x8118c5,util[_0xa4cf('0x2f')](_0xa4cf('0x30'),_0x569a72[_0xa4cf('0x31')]),util[_0xa4cf('0x2f')](_0xa4cf('0x32'),_0x70a3e1[_0xa4cf('0x33')][_0xa4cf('0x34')]()),{'evt':_[_0xa4cf('0x35')](_0x51b460,{'autoCreate':_0x3736e7}),'contact':_0x3739b2===undefined?{}:_0x3739b2,'contacts':_0x4fb622[_0xa4cf('0x36')]===0x0?undefined:_0x4fb622});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 281bd0a..b44fb09 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 _0xa945=['buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','user:%s','name','format','trigger:%s','exec','integration','queue','routeId','urlforward','parse','query','search','replace','channel','AllConditions','checkConditions','AnyConditions','some','chat','ChatWebsiteId','operator','value','AccountId','message','event','agent','membername','lastevent','null','substatus','undefined','created','equals','util','lodash','url','./urlforward','./cmContact','../../../config/environment','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','clone','motionChannel','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found'];(function(_0x5c72f6,_0x2b1b31){var _0x70daf2=function(_0x468ce6){while(--_0x468ce6){_0x5c72f6['push'](_0x5c72f6['shift']());}};_0x70daf2(++_0x2b1b31);}(_0xa945,0x118));var _0x5a94=function(_0x3c066e,_0x2b83a1){_0x3c066e=_0x3c066e-0x0;var _0x254c12=_0xa945[_0x3c066e];return _0x254c12;};'use strict';var util=require(_0x5a94('0x0'));var _=require(_0x5a94('0x1'));var url=require(_0x5a94('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x5a94('0x3'));var integration=require('./integration');var cmContact=require(_0x5a94('0x4'));var script=require('./script');var config=require(_0x5a94('0x5'));var logger=require('../../../config/logger')(_0x5a94('0x6'));var ami=require(_0x5a94('0x7'));config['redis']=_[_0x5a94('0x8')](config[_0x5a94('0x9')],{'host':_0x5a94('0xa'),'port':0x18eb});var io=require(_0x5a94('0xb'))(new Redis(config[_0x5a94('0x9')]));var operators={'equals':function(_0x2f795f,_0xae329){return _0x2f795f==_0xae329;},'not_equals':function(_0x544257,_0x52c755){return _0x544257!=_0x52c755;}};var barAndWebActions=[_0x5a94('0xc'),_0x5a94('0x2'),_0x5a94('0xd')];function Trigger(_0x2c7782){this['triggers']=_0x2c7782[_0x5a94('0xe')];this[_0x5a94('0xf')]=_0x2c7782['agents'];this[_0x5a94('0x10')]=_0x2c7782[_0x5a94('0x10')];this[_0x5a94('0x11')]=_0x2c7782[_0x5a94('0x11')];this[_0x5a94('0x12')]=_0x2c7782[_0x5a94('0x12')];this[_0x5a94('0x13')]=_0x2c7782['zendeskAccounts'];this['freshdeskAccounts']=_0x2c7782[_0x5a94('0x14')];this['salesforceAccounts']=_0x2c7782[_0x5a94('0x15')];this[_0x5a94('0x16')]=_0x2c7782[_0x5a94('0x16')];this[_0x5a94('0x17')]=_0x2c7782[_0x5a94('0x17')];this[_0x5a94('0x18')]=_0x2c7782[_0x5a94('0x18')];this[_0x5a94('0x19')]=_0x2c7782[_0x5a94('0x19')];this[_0x5a94('0x1a')]=_0x2c7782['servicenowAccounts'];this[_0x5a94('0x1b')]=_0x2c7782[_0x5a94('0x1b')];this[_0x5a94('0x1c')]=_0x2c7782[_0x5a94('0x1c')];this[_0x5a94('0x1d')]={'zendesk':this[_0x5a94('0x13')],'salesforce':this[_0x5a94('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x5a94('0x16')],'zoho':this[_0x5a94('0x17')],'desk':this[_0x5a94('0x18')],'vtiger':this[_0x5a94('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x5a94('0x1a')]};ami['on'](_0x5a94('0x1e'),this[_0x5a94('0x1f')]['bind'](this));ami['on']('custom:agentconnect',this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x21'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:agentcomplete',this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x22'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x23'),this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x24'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x25'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:agentreject',this[_0x5a94('0x1f')]['bind'](this));ami['on'](_0x5a94('0x26'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x27'),this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x28'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:dialbegin',this[_0x5a94('0x29')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x2a'),this['syncAgentDial'][_0x5a94('0x20')](this));ami['on']('custom:dialend',this[_0x5a94('0x29')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x2b'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on']('custom:incomingmessage',this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x2c'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:acceptmessage',this[_0x5a94('0x1f')]['bind'](this));ami['on'](_0x5a94('0x2d'),this[_0x5a94('0x1f')]['bind'](this));ami['on'](_0x5a94('0x2e'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));}Trigger[_0x5a94('0x2f')][_0x5a94('0x30')]=function(_0xf457f0,_0x306464,_0x4b2306){logger[_0x5a94('0x31')](_0xf457f0,_0x306464,JSON['stringify'](_0x4b2306));io['to'](_0xf457f0)['emit'](_0x306464,_0x4b2306);};Trigger[_0x5a94('0x2f')]['syncCustomEvent']=function(_0x118558){var _0x2ca3f2=_[_0x5a94('0x32')](_0x118558);if(typeof _0x2ca3f2[_0x5a94('0x33')]==='undefined'){_0x2ca3f2[_0x5a94('0x33')]='voice';}this[_0x5a94('0x34')](_0x2ca3f2);};Trigger[_0x5a94('0x2f')][_0x5a94('0x29')]=function(_0x351226){if(this[_0x5a94('0xf')][_0x351226[_0x5a94('0x35')]]){this[_0x5a94('0x1f')](_0x351226);}};Trigger['prototype'][_0x5a94('0x34')]=function(_0x13b934){var _0x92bdea;for(var _0x23d4c8 in this[_0x5a94('0xe')]){if(this[_0x5a94('0xe')][_0x5a94('0x36')](_0x23d4c8)){if(this[_0x5a94('0xe')][_0x23d4c8][_0x5a94('0x37')]){_0x92bdea=this[_0x5a94('0x38')](this['triggers'][_0x23d4c8],_0x13b934);if(_0x92bdea){_[_0x5a94('0x39')](_0x13b934,_0x13b934[_0x5a94('0x3a')]);for(var _0x404c8f=0x0,_0x27742b,_0x22c896,_0x3cf28d;_0x404c8f0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x326f,0xd1));var _0xf326=function(_0x5a08c9,_0x2b46c6){_0x5a08c9=_0x5a08c9-0x0;var _0x23f1be=_0x326f[_0x5a08c9];return _0x23f1be;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ 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 75d5d82..df3d73f 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 _0x88a1=['then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','outbound','calleridnum','contacts','Bearer\x20','body','odata-entityid','lastIndexOf','enduserId','toLowerCase','destcalleridnum','&$filter=','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','type','customField','idField','substring','indexOf','content','incidents','assign','getString','Descriptions','Fields','ticketType','/systemusers(','callDirection','/contacts(','queue','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','ioredis','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x88a1,0x198));var _0x188a=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x88a1[_0x5c1345];return _0x1c070d;};'use strict';var _=require('lodash');var rp=require(_0x188a('0x0'));var util=require(_0x188a('0x1'));var intUtil=require(_0x188a('0x2'));var md5=require('md5');var Redis=require(_0x188a('0x3'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x188a('0x4'));config[_0x188a('0x5')]=_['defaults'](config[_0x188a('0x5')],{'host':_0x188a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x2fab85,_0x23d854,_0x41c7cd){if(_0x2fab85[_0x188a('0x7')]){_0x2fab85[_0x188a('0x8')]=_0x2fab85[_0x188a('0x9')][_0x188a('0xa')];_0x2fab85[_0x188a('0xb')]=_0x2fab85[_0x188a('0x9')][_0x188a('0xc')];return Promise[_0x188a('0xd')](_0x2fab85['CloudProvider'][_0x188a('0xe')]);}var _0x2f351c={'method':_0x188a('0xf'),'uri':_0x23d854,'form':{'client_id':_0x2fab85[_0x188a('0x10')],'resource':_0x2fab85[_0x188a('0x8')],'username':_0x2fab85[_0x188a('0x11')],'password':_0x2fab85[_0x188a('0x12')],'grant_type':_0x188a('0x12'),'client_secret':_0x2fab85[_0x188a('0x13')]},'json':!![]};return rp(_0x2f351c)[_0x188a('0x14')](function(_0x144d86){return _0x144d86[_0x188a('0x15')];})[_0x188a('0x16')](function(_0x396ebb){logger[_0x188a('0x17')]('['+[_0x41c7cd['toUpperCase']()]+_0x188a('0x18'));return _0x396ebb[_0x188a('0x19')];});}function getUser(_0xc58444,_0x48fa01,_0x496291,_0x126a9f,_0x1db8e7,_0x403f8b){return new Promise(function(_0x5f2a24,_0x512eb8){return getAuthToken(_0x48fa01,_0x126a9f,_0x403f8b)[_0x188a('0x14')](function(_0x547fca){var _0x23ef8f={'method':_0x188a('0x1a'),'uri':_0x1db8e7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x547fca,'OData-Version':_0x188a('0x1b')},'json':!![]};return rp(_0x23ef8f);})[_0x188a('0x14')](function(_0x21b967){var _0x5168e0=_0x21b967[_0x188a('0x1c')];var _0x38ceaf=![];var _0x169b44=null;if(!_[_0x188a('0x1d')](_0x496291)){if(intUtil[_0x188a('0x1e')](_0x496291[_0x188a('0x1f')])){_0xc58444[_0x188a('0x20')]=_0x496291[_0x188a('0x1f')];for(_0x169b44=0x0;_0x169b44<_0x5168e0['length'];_0x169b44++){if(_0x5168e0[_0x169b44][_0x188a('0x21')]===_0x496291['email']&&!_0x5168e0[_0x169b44][_0x188a('0x22')]){_0x38ceaf=!![];logger[_0x188a('0x23')]('['+[_0x403f8b[_0x188a('0x24')]()]+_0x188a('0x25')+_0x5168e0[_0x169b44][_0x188a('0x26')]+'!');_0xc58444['userId']=_0x5168e0[_0x169b44][_0x188a('0x26')];}}}}if(!_0x38ceaf){logger[_0x188a('0x23')]('['+[_0x403f8b[_0x188a('0x24')]()]+_0x188a('0x27'));_0xc58444[_0x188a('0x20')]=_0x48fa01['username'];for(_0x169b44=0x0;_0x169b44<_0x5168e0[_0x188a('0x28')];_0x169b44++){if(_0x5168e0[_0x169b44][_0x188a('0x21')]===_0x48fa01[_0x188a('0x11')]){_0xc58444[_0x188a('0x29')]=_0x5168e0[_0x169b44][_0x188a('0x26')];}}}_0x5f2a24(_0xc58444);})[_0x188a('0x16')](function(_0x1ed05d){_0x512eb8(_0x1ed05d[_0x188a('0x19')]);});});}function createEndUser(_0x37b581,_0x26d977,_0x4d7d11,_0x551f87,_0x52a9f7,_0xbd215,_0x3b05de){return new Promise(function(_0x20a59a,_0x197b14){return getAuthToken(_0x26d977,_0x4d7d11,_0xbd215)[_0x188a('0x14')](function(_0x5d480f){var _0x5c51d0=_0xbd215['toLowerCase']()===_0x188a('0x2a')?_0x52a9f7['destcalleridnum']:_0x52a9f7[_0x188a('0x2b')];var _0x41ea25={'method':'POST','uri':_0x551f87+_0x188a('0x2c'),'body':{'fullname':_0x5c51d0,'firstname':_0x5c51d0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x37b581['userId']+')'},'headers':{'Authorization':_0x188a('0x2d')+_0x5d480f,'OData-Version':_0x188a('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x41ea25[_0x188a('0x2e')][_0x3b05de]=_0x5c51d0;return rp(_0x41ea25);})[_0x188a('0x14')](function(_0x14aed6){var _0xa80e8c=_0x14aed6['headers'][_0x188a('0x2f')];var _0xce3ce6=_0xa80e8c['substring'](_0xa80e8c[_0x188a('0x30')]('(')+0x1,_0xa80e8c[_0x188a('0x30')](')'));_0x37b581[_0x188a('0x31')]=_0xce3ce6;_0x20a59a(_0x37b581);})['catch'](function(_0x178c75){_0x197b14(_0x178c75[_0x188a('0x19')]);});});}function getEndUser(_0x395e04,_0x3d959c,_0x4d80ec,_0x141b18,_0x1b7e55,_0x1f3c59,_0x1c708e,_0x37211c){var _0x469044=_0x1f3c59[_0x188a('0x32')]()===_0x188a('0x2a')?_0x1b7e55[_0x188a('0x33')]:_0x1b7e55['calleridnum'];return getAuthToken(_0x3d959c,_0x4d80ec,_0x1f3c59)[_0x188a('0x14')](function(_0x3a6cd1){_0x37211c=_0x37211c?_0x37211c:'telephone1';var _0x34bd0f={'method':_0x188a('0x1a'),'uri':_0x141b18+'contacts?$select='+_0x37211c+_0x188a('0x34')+_0x37211c+'\x20eq\x20\x27'+_0x469044[_0x188a('0x35')]('+',_0x188a('0x36'))+'\x27','headers':{'Authorization':_0x188a('0x2d')+_0x3a6cd1,'If-None-Match':null,'OData-Version':_0x188a('0x1b')},'json':!![]};return rp(_0x34bd0f);})['then'](function(_0x530bf0){var _0x2d883a=![];if(!_0x530bf0)return _0x2d883a;var _0xc9cec6=_0x530bf0[_0x188a('0x1c')];for(var _0x386375=0x0;_0x386375<_0xc9cec6['length'];_0x386375++){if(_0xc9cec6[_0x386375][_0x37211c]===_0x469044){_0x2d883a=!![];_0x395e04[_0x188a('0x31')]=_0xc9cec6[_0x386375][_0x188a('0x37')];}}return _0x2d883a;})[_0x188a('0x14')](function(_0xe9b884){if(_0xe9b884)return _0x395e04;if(_0x1c708e===_0x188a('0x38')){logger['info']('['+[_0x1f3c59['toUpperCase']()]+_0x188a('0x39'));return _0x395e04;}return createEndUser(_0x395e04,_0x3d959c,_0x4d80ec,_0x141b18,_0x1b7e55,_0x1f3c59,_0x37211c)[_0x188a('0x14')](function(_0x4125f3){logger[_0x188a('0x23')]('['+[_0x1f3c59[_0x188a('0x24')]()]+']\x20Enduser\x20created!',_0x4125f3[_0x188a('0x31')]);return _0x4125f3;});});}function getCustomFields(_0x1a5d3b,_0x149bd8,_0x9d5a41){var _0x171c5e={};if(_0x1a5d3b[_0x188a('0x28')]>0x0){_[_0x188a('0x3a')](_0x1a5d3b,function(_0x3d7954){if(_['includes']([_0x188a('0x3b'),_0x188a('0x3c')],_0x3d7954[_0x188a('0x3d')])&&_0x3d7954['nameField']&&!_0x3d7954[_0x188a('0x3e')]){var _0x5cfa73=_0x3d7954[_0x188a('0x3f')][_0x188a('0x32')]();var _0x48e5ad=_0x5cfa73[_0x188a('0x40')](0x0,_0x5cfa73['indexOf']('_'));var _0x975944=_0x5cfa73['substring'](_0x5cfa73[_0x188a('0x41')]('_')+0x1);if(_0x48e5ad===_0x9d5a41){_0x171c5e[_0x975944]=_0x3d7954[_0x188a('0x42')];}}});}return _0x171c5e;}function getTicket(_0x50f6ce,_0x242ca5,_0x4b4de6,_0x557577,_0x1cac6c,_0x3f2fbd,_0x5f00b4){return new Promise(function(_0x36f449,_0x520bb2){var _0x5796d6;return getAuthToken(_0x242ca5,_0x4b4de6,_0x5f00b4)[_0x188a('0x14')](function(_0x4b1a97){if(_0x3f2fbd['ticketType']==='incident'){_0x5796d6={'method':_0x188a('0xf'),'uri':_0x557577+_0x188a('0x43'),'body':Object[_0x188a('0x44')]({},{'title':intUtil[_0x188a('0x45')](_0x3f2fbd['Subjects'],_0x1cac6c,'\x20'),'description':intUtil['getString'](_0x3f2fbd[_0x188a('0x46')],_0x1cac6c,'\x0a'),'customerid_contact@odata.bind':_0x50f6ce[_0x188a('0x31')]?'/contacts('+_0x50f6ce[_0x188a('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x50f6ce[_0x188a('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x3f2fbd[_0x188a('0x47')],_0x1cac6c,_0x3f2fbd[_0x188a('0x48')])),'headers':{'Authorization':_0x188a('0x2d')+_0x4b1a97,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3f2fbd[_0x188a('0x48')]==='phonecall'){var _0x5924de=_0x50f6ce['enduserId']?[{'partyid_systemuser@odata.bind':_0x188a('0x49')+_0x50f6ce[_0x188a('0x29')]+')','participationtypemask':_0x50f6ce[_0x188a('0x4a')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x188a('0x4b')+_0x50f6ce['enduserId']+')','participationtypemask':_0x50f6ce[_0x188a('0x4a')]===_0x188a('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x188a('0x49')+_0x50f6ce[_0x188a('0x29')]+')','participationtypemask':_0x50f6ce[_0x188a('0x4a')]===_0x188a('0x4c')?0x2:0x1}];_0x5796d6={'method':'POST','uri':_0x557577+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x188a('0x45')](_0x3f2fbd[_0x188a('0x4d')],_0x1cac6c,'\x20'),'phonenumber':String(_0x1cac6c['calleridnum']),'description':intUtil['getString'](_0x3f2fbd[_0x188a('0x46')],_0x1cac6c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x50f6ce[_0x188a('0x31')]?'/contacts('+_0x50f6ce[_0x188a('0x31')]+')':undefined,'ownerid@odata.bind':_0x188a('0x49')+_0x50f6ce['userId']+')','directioncode':_0x50f6ce[_0x188a('0x4a')]===_0x188a('0x4c')?![]:!![],'phonecall_activity_parties':_0x5924de},getCustomFields(_0x3f2fbd['Fields'],_0x1cac6c,_0x3f2fbd['ticketType'])),'headers':{'Authorization':_0x188a('0x2d')+_0x4b1a97,'OData-Version':_0x188a('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5796d6);})['then'](function(_0x2426ac){var _0x5eab9f=_0x2426ac['headers'][_0x188a('0x2f')];var _0x3c5335=_0x5eab9f[_0x188a('0x40')](_0x5eab9f[_0x188a('0x30')]('(')+0x1,_0x5eab9f['lastIndexOf'](')'));_0x50f6ce[_0x188a('0x4e')]=_0x3c5335;_0x36f449(_0x50f6ce);})[_0x188a('0x16')](function(_0x546cfb){_0x520bb2(_0x546cfb['message']);});});}function emit(_0x38cfb7,_0x2a927d,_0x431a80,_0x5027cc){var _0x1a5d86={'uri':util[_0x188a('0x4f')](_0x188a('0x50'),_0x38cfb7,_0x431a80,_0x5027cc)};io['to'](util[_0x188a('0x4f')](_0x188a('0x51'),_0x2a927d))[_0x188a('0x52')](_0x188a('0x53'),_0x1a5d86);}exports['cs']=function(_0x39dcfc,_0x5d8328,_0x543a1c,_0x10ca1b,_0xf20bac,_0x425927,_0x427e85,_0x3028ec){var _0x5c6fed={};_0x425927[_0x188a('0x8')]=_0x425927[_0x188a('0x7')]?intUtil[_0x188a('0x54')](_0x425927[_0x188a('0x9')][_0x188a('0xa')]):intUtil['stripTrailingSlash'](_0x425927[_0x188a('0x8')]);_0x425927[_0x188a('0x55')]=intUtil[_0x188a('0x54')](_0x425927['serverUrl']);_0x5c6fed[_0x188a('0x4a')]=_0x3028ec===_0x188a('0x4c')||_0x3028ec===_0x188a('0x56')?_0x188a('0x4c'):'outbound';var _0x4baefc=_0x425927[_0x188a('0x7')]?util['format'](_0x188a('0x57'),_0x425927[_0x188a('0x9')][_0x188a('0xa')]):util[_0x188a('0x4f')](_0x188a('0x57'),_0x425927[_0x188a('0x8')]);var _0x84ed73=util['format'](_0x188a('0x58'),_0x425927[_0x188a('0xb')]);var _0x548122=util[_0x188a('0x4f')](_0x188a('0x59'),_0x425927['serverUrl'],_0x5d8328[_0x188a('0x5a')],md5(_0x5d8328[_0x188a('0x5a')]));if(_0xf20bac&&_0xf20bac[_0x188a('0x5b')]){logger['info'](_0x188a('0x5c'),'Recording\x20is\x20enabled!');_0x5d8328[_0x188a('0x5d')]=_0x548122;}else if(_0x427e85&&_0x427e85['recordingFormat']&&_0x427e85[_0x188a('0x5e')]!=='none'){logger[_0x188a('0x23')](_0x188a('0x5f'),_0x188a('0x60'));_0x5d8328[_0x188a('0x5d')]=_0x548122;}else{_0x5d8328[_0x188a('0x5d')]='';}return getUser(_0x5c6fed,_0x425927,_0x10ca1b,_0x84ed73,_0x4baefc,_0x3028ec)[_0x188a('0x14')](function(_0x518da5){logger[_0x188a('0x23')]('['+_0x3028ec[_0x188a('0x24')]()+_0x188a('0x61'),_0x518da5[_0x188a('0x29')]);logger[_0x188a('0x23')]('['+_0x3028ec[_0x188a('0x24')]()+']\x20The\x20User\x20email\x20is:',_0x518da5[_0x188a('0x20')]);return getEndUser(_0x518da5,_0x425927,_0x84ed73,_0x4baefc,_0x5d8328,_0x3028ec,_0x543a1c['moduleCreate'],_0x543a1c[_0x188a('0x62')]);})[_0x188a('0x14')](function(_0x15614f){logger['info']('['+_0x3028ec[_0x188a('0x24')]()+_0x188a('0x63'),_0x15614f[_0x188a('0x31')]);logger['info']('['+_0x3028ec['toUpperCase']()+_0x188a('0x64'),_0x5d8328['calleridnum']);return getTicket(_0x15614f,_0x425927,_0x84ed73,_0x4baefc,_0x5d8328,_0x543a1c,_0x3028ec);})['then'](function(_0x549b31){logger[_0x188a('0x23')](util[_0x188a('0x4f')]('['+_0x3028ec['toUpperCase']()+_0x188a('0x65'),_0x543a1c['ticketType'],_0x549b31[_0x188a('0x4e')]));logger[_0x188a('0x23')](util[_0x188a('0x4f')]('['+_0x3028ec['toUpperCase']()+_0x188a('0x66'),_0x3028ec));if(_0x3028ec!==_0x188a('0x56')&&_0x543a1c[_0x188a('0x67')]){logger[_0x188a('0x23')]('['+_0x3028ec[_0x188a('0x24')]()+']',_0x188a('0x68'));emit(_0x425927[_0x188a('0x8')],_0x10ca1b['name'],_0x543a1c[_0x188a('0x48')],_0x549b31[_0x188a('0x4e')]);}})['catch'](function(_0x4fdeb7){logger[_0x188a('0x17')]('['+_0x3028ec[_0x188a('0x24')]()+_0x188a('0x69'),_0x4fdeb7[_0x188a('0x19')]);console[_0x188a('0x17')](_0x188a('0x6a'),_0x4fdeb7);});}; \ No newline at end of file +var _0x41b0=['toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','4.0','body','headers','substring','lastIndexOf','enduserId','GET','contacts?$select=','\x20eq\x20\x27','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','nameField','customField','indexOf','ticketType','incident','incidents','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','assign','Subjects','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','modernAuthentication','stripTrailingSlash','data7','remoteUri','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\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...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','CloudProvider','tenantId','resolve','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length'];(function(_0x770f7,_0x3af003){var _0xe797c6=function(_0x47d92a){while(--_0x47d92a){_0x770f7['push'](_0x770f7['shift']());}};_0xe797c6(++_0x3af003);}(_0x41b0,0x187));var _0x041b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x41b0[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x041b('0x0'));var rp=require(_0x041b('0x1'));var util=require('util');var intUtil=require(_0x041b('0x2'));var md5=require(_0x041b('0x3'));var Redis=require(_0x041b('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x041b('0x5'));config[_0x041b('0x6')]=_[_0x041b('0x7')](config[_0x041b('0x6')],{'host':_0x041b('0x8'),'port':0x18eb});var io=require(_0x041b('0x9'))(new Redis(config[_0x041b('0x6')]));function getAuthToken(_0x11db61,_0x5a6634,_0x154e58){if(_0x11db61['modernAuthentication']){_0x11db61['remoteUri']=_0x11db61[_0x041b('0xa')]['data7'];_0x11db61[_0x041b('0xb')]=_0x11db61[_0x041b('0xa')]['data2'];return Promise[_0x041b('0xc')](_0x11db61['CloudProvider']['data5']);}var _0x537566={'method':'POST','uri':_0x5a6634,'form':{'client_id':_0x11db61[_0x041b('0xd')],'resource':_0x11db61['remoteUri'],'username':_0x11db61[_0x041b('0xe')],'password':_0x11db61[_0x041b('0xf')],'grant_type':'password','client_secret':_0x11db61['clientSecret']},'json':!![]};return rp(_0x537566)[_0x041b('0x10')](function(_0x1c3364){return _0x1c3364[_0x041b('0x11')];})[_0x041b('0x12')](function(_0x300b7d){logger[_0x041b('0x13')]('['+[_0x154e58[_0x041b('0x14')]()]+_0x041b('0x15'));return _0x300b7d[_0x041b('0x16')];});}function getUser(_0x44b998,_0x594954,_0x34a031,_0x43d17f,_0xe36c96,_0x3b9a55){return new Promise(function(_0x131fe3,_0x19b2ab){return getAuthToken(_0x594954,_0x43d17f,_0x3b9a55)[_0x041b('0x10')](function(_0x105cf6){var _0xc603e9={'method':'GET','uri':_0xe36c96+_0x041b('0x17'),'headers':{'Authorization':_0x041b('0x18')+_0x105cf6,'OData-Version':'4.0'},'json':!![]};return rp(_0xc603e9);})[_0x041b('0x10')](function(_0x47a575){var _0xc83b32=_0x47a575['value'];var _0x2038aa=![];var _0x782747=null;if(!_[_0x041b('0x19')](_0x34a031)){if(intUtil[_0x041b('0x1a')](_0x34a031[_0x041b('0x1b')])){_0x44b998[_0x041b('0x1c')]=_0x34a031[_0x041b('0x1b')];for(_0x782747=0x0;_0x782747<_0xc83b32['length'];_0x782747++){if(_0xc83b32[_0x782747][_0x041b('0x1d')]===_0x34a031['email']&&!_0xc83b32[_0x782747][_0x041b('0x1e')]){_0x2038aa=!![];logger[_0x041b('0x1f')]('['+[_0x3b9a55[_0x041b('0x14')]()]+_0x041b('0x20')+_0xc83b32[_0x782747][_0x041b('0x21')]+'!');_0x44b998[_0x041b('0x22')]=_0xc83b32[_0x782747][_0x041b('0x21')];}}}}if(!_0x2038aa){logger['info']('['+[_0x3b9a55[_0x041b('0x14')]()]+_0x041b('0x23'));_0x44b998[_0x041b('0x1c')]=_0x594954[_0x041b('0xe')];for(_0x782747=0x0;_0x782747<_0xc83b32[_0x041b('0x24')];_0x782747++){if(_0xc83b32[_0x782747][_0x041b('0x1d')]===_0x594954[_0x041b('0xe')]){_0x44b998[_0x041b('0x22')]=_0xc83b32[_0x782747]['systemuserid'];}}}_0x131fe3(_0x44b998);})[_0x041b('0x12')](function(_0x5ba58f){_0x19b2ab(_0x5ba58f['message']);});});}function createEndUser(_0x542952,_0x516496,_0x51e346,_0x49c438,_0x4cf4c7,_0x168d0a,_0x10aebb){return new Promise(function(_0x572275,_0x45414a){return getAuthToken(_0x516496,_0x51e346,_0x168d0a)[_0x041b('0x10')](function(_0xcbcd3e){var _0x473128=_0x168d0a[_0x041b('0x25')]()===_0x041b('0x26')?_0x4cf4c7[_0x041b('0x27')]:_0x4cf4c7[_0x041b('0x28')];var _0x1871ee={'method':_0x041b('0x29'),'uri':_0x49c438+_0x041b('0x2a'),'body':{'fullname':_0x473128,'firstname':_0x473128,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x041b('0x2b')+_0x542952['userId']+')'},'headers':{'Authorization':_0x041b('0x18')+_0xcbcd3e,'OData-Version':_0x041b('0x2c')},'json':!![],'resolveWithFullResponse':!![]};_0x1871ee[_0x041b('0x2d')][_0x10aebb]=_0x473128;return rp(_0x1871ee);})[_0x041b('0x10')](function(_0x1cbe06){var _0x2cb478=_0x1cbe06[_0x041b('0x2e')]['odata-entityid'];var _0x443a15=_0x2cb478[_0x041b('0x2f')](_0x2cb478[_0x041b('0x30')]('(')+0x1,_0x2cb478['lastIndexOf'](')'));_0x542952[_0x041b('0x31')]=_0x443a15;_0x572275(_0x542952);})[_0x041b('0x12')](function(_0x1f68cd){_0x45414a(_0x1f68cd[_0x041b('0x16')]);});});}function getEndUser(_0x1df88d,_0x19e21e,_0x19fdc3,_0x1c8b31,_0x64428b,_0xc16081,_0xb69d43,_0x44a938){var _0x5c23c2=_0xc16081[_0x041b('0x25')]()===_0x041b('0x26')?_0x64428b[_0x041b('0x27')]:_0x64428b[_0x041b('0x28')];return getAuthToken(_0x19e21e,_0x19fdc3,_0xc16081)['then'](function(_0x390e25){_0x44a938=_0x44a938?_0x44a938:'telephone1';var _0x3d6482={'method':_0x041b('0x32'),'uri':_0x1c8b31+_0x041b('0x33')+_0x44a938+'&$filter='+_0x44a938+_0x041b('0x34')+_0x5c23c2['replace']('+',_0x041b('0x35'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x390e25,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3d6482);})[_0x041b('0x10')](function(_0xcf7496){var _0x20e90d=![];if(!_0xcf7496)return _0x20e90d;var _0xec252c=_0xcf7496[_0x041b('0x36')];for(var _0x30ccfd=0x0;_0x30ccfd<_0xec252c[_0x041b('0x24')];_0x30ccfd++){if(_0xec252c[_0x30ccfd][_0x44a938]===_0x5c23c2){_0x20e90d=!![];_0x1df88d[_0x041b('0x31')]=_0xec252c[_0x30ccfd][_0x041b('0x37')];}}return _0x20e90d;})[_0x041b('0x10')](function(_0x300682){if(_0x300682)return _0x1df88d;if(_0xb69d43===_0x041b('0x38')){logger['info']('['+[_0xc16081[_0x041b('0x14')]()]+_0x041b('0x39'));return _0x1df88d;}return createEndUser(_0x1df88d,_0x19e21e,_0x19fdc3,_0x1c8b31,_0x64428b,_0xc16081,_0x44a938)[_0x041b('0x10')](function(_0x236a88){logger[_0x041b('0x1f')]('['+[_0xc16081[_0x041b('0x14')]()]+']\x20Enduser\x20created!',_0x236a88[_0x041b('0x31')]);return _0x236a88;});});}function getCustomFields(_0x4468f5,_0x323c2b,_0x3a90d4){var _0x441ffb={};if(_0x4468f5['length']>0x0){_[_0x041b('0x3a')](_0x4468f5,function(_0x4f6a5e){if(_[_0x041b('0x3b')]([_0x041b('0x3c'),'picklist'],_0x4f6a5e['type'])&&_0x4f6a5e[_0x041b('0x3d')]&&!_0x4f6a5e[_0x041b('0x3e')]){var _0x5d8949=_0x4f6a5e['idField'][_0x041b('0x25')]();var _0xfd0e52=_0x5d8949['substring'](0x0,_0x5d8949[_0x041b('0x3f')]('_'));var _0x526f67=_0x5d8949[_0x041b('0x2f')](_0x5d8949[_0x041b('0x3f')]('_')+0x1);if(_0xfd0e52===_0x3a90d4){_0x441ffb[_0x526f67]=_0x4f6a5e['content'];}}});}return _0x441ffb;}function getTicket(_0x31dbbb,_0x5cde90,_0x8313c7,_0x17d622,_0x1969a0,_0x8fec1a,_0x3a290c){return new Promise(function(_0x541cae,_0x362c10){var _0xad73a3;return getAuthToken(_0x5cde90,_0x8313c7,_0x3a290c)[_0x041b('0x10')](function(_0x36e4a0){if(_0x8fec1a[_0x041b('0x40')]===_0x041b('0x41')){_0xad73a3={'method':_0x041b('0x29'),'uri':_0x17d622+_0x041b('0x42'),'body':Object['assign']({},{'title':intUtil[_0x041b('0x43')](_0x8fec1a['Subjects'],_0x1969a0,'\x20'),'description':intUtil['getString'](_0x8fec1a[_0x041b('0x44')],_0x1969a0,'\x0a'),'customerid_contact@odata.bind':_0x31dbbb[_0x041b('0x31')]?_0x041b('0x45')+_0x31dbbb[_0x041b('0x31')]+')':undefined,'ownerid@odata.bind':_0x041b('0x2b')+_0x31dbbb['userId']+')','caseorigincode':'1'},getCustomFields(_0x8fec1a[_0x041b('0x46')],_0x1969a0,_0x8fec1a[_0x041b('0x40')])),'headers':{'Authorization':_0x041b('0x18')+_0x36e4a0,'OData-Version':_0x041b('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x8fec1a[_0x041b('0x40')]===_0x041b('0x47')){var _0x39de1f=_0x31dbbb[_0x041b('0x31')]?[{'partyid_systemuser@odata.bind':_0x041b('0x2b')+_0x31dbbb['userId']+')','participationtypemask':_0x31dbbb[_0x041b('0x48')]===_0x041b('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x041b('0x45')+_0x31dbbb[_0x041b('0x31')]+')','participationtypemask':_0x31dbbb[_0x041b('0x48')]===_0x041b('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x041b('0x2b')+_0x31dbbb[_0x041b('0x22')]+')','participationtypemask':_0x31dbbb[_0x041b('0x48')]===_0x041b('0x49')?0x2:0x1}];_0xad73a3={'method':'POST','uri':_0x17d622+'phonecalls','body':Object[_0x041b('0x4a')]({},{'subject':intUtil[_0x041b('0x43')](_0x8fec1a[_0x041b('0x4b')],_0x1969a0,'\x20'),'phonenumber':String(_0x1969a0[_0x041b('0x28')]),'description':intUtil['getString'](_0x8fec1a[_0x041b('0x44')],_0x1969a0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x31dbbb[_0x041b('0x31')]?'/contacts('+_0x31dbbb[_0x041b('0x31')]+')':undefined,'ownerid@odata.bind':_0x041b('0x2b')+_0x31dbbb[_0x041b('0x22')]+')','directioncode':_0x31dbbb['callDirection']===_0x041b('0x49')?![]:!![],'phonecall_activity_parties':_0x39de1f},getCustomFields(_0x8fec1a[_0x041b('0x46')],_0x1969a0,_0x8fec1a['ticketType'])),'headers':{'Authorization':_0x041b('0x18')+_0x36e4a0,'OData-Version':_0x041b('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xad73a3);})['then'](function(_0xa5e571){var _0x5cf815=_0xa5e571[_0x041b('0x2e')][_0x041b('0x4c')];var _0x3f485f=_0x5cf815[_0x041b('0x2f')](_0x5cf815[_0x041b('0x30')]('(')+0x1,_0x5cf815[_0x041b('0x30')](')'));_0x31dbbb[_0x041b('0x4d')]=_0x3f485f;_0x541cae(_0x31dbbb);})['catch'](function(_0x541a28){_0x362c10(_0x541a28[_0x041b('0x16')]);});});}function emit(_0x26d55b,_0x2700f3,_0x101b59,_0x16baff){var _0x4bda32={'uri':util['format'](_0x041b('0x4e'),_0x26d55b,_0x101b59,_0x16baff)};io['to'](util[_0x041b('0x4f')](_0x041b('0x50'),_0x2700f3))['emit'](_0x041b('0x51'),_0x4bda32);}exports['cs']=function(_0xe1bb31,_0x454043,_0x23f2a2,_0x488f8d,_0x22401d,_0x37f7cc,_0x3abce5,_0xdb320a){var _0x51810c={};_0x37f7cc['remoteUri']=_0x37f7cc[_0x041b('0x52')]?intUtil[_0x041b('0x53')](_0x37f7cc[_0x041b('0xa')][_0x041b('0x54')]):intUtil[_0x041b('0x53')](_0x37f7cc[_0x041b('0x55')]);_0x37f7cc['serverUrl']=intUtil[_0x041b('0x53')](_0x37f7cc['serverUrl']);_0x51810c[_0x041b('0x48')]=_0xdb320a===_0x041b('0x49')||_0xdb320a==='unmanaged'?'queue':_0x041b('0x26');var _0xc17911=_0x37f7cc[_0x041b('0x52')]?util[_0x041b('0x4f')](_0x041b('0x56'),_0x37f7cc[_0x041b('0xa')][_0x041b('0x54')]):util['format'](_0x041b('0x56'),_0x37f7cc[_0x041b('0x55')]);var _0xc12e36=util[_0x041b('0x4f')](_0x041b('0x57'),_0x37f7cc[_0x041b('0xb')]);var _0x4a5abf=util[_0x041b('0x4f')](_0x041b('0x58'),_0x37f7cc[_0x041b('0x59')],_0x454043['uniqueid'],md5(_0x454043[_0x041b('0x5a')]));if(_0x22401d&&_0x22401d[_0x041b('0x5b')]){logger[_0x041b('0x1f')](_0x041b('0x5c'),_0x041b('0x5d'));_0x454043['recordingURL']=_0x4a5abf;}else if(_0x3abce5&&_0x3abce5[_0x041b('0x5e')]&&_0x3abce5[_0x041b('0x5e')]!==_0x041b('0x5f')){logger['info'](_0x041b('0x60'),_0x041b('0x5d'));_0x454043[_0x041b('0x61')]=_0x4a5abf;}else{_0x454043[_0x041b('0x61')]='';}return getUser(_0x51810c,_0x37f7cc,_0x488f8d,_0xc12e36,_0xc17911,_0xdb320a)[_0x041b('0x10')](function(_0x37b05c){logger[_0x041b('0x1f')]('['+_0xdb320a[_0x041b('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x37b05c[_0x041b('0x22')]);logger['info']('['+_0xdb320a[_0x041b('0x14')]()+_0x041b('0x62'),_0x37b05c[_0x041b('0x1c')]);return getEndUser(_0x37b05c,_0x37f7cc,_0xc12e36,_0xc17911,_0x454043,_0xdb320a,_0x23f2a2['moduleCreate'],_0x23f2a2[_0x041b('0x63')]);})[_0x041b('0x10')](function(_0x3ffee9){logger['info']('['+_0xdb320a[_0x041b('0x14')]()+_0x041b('0x64'),_0x3ffee9[_0x041b('0x31')]);logger[_0x041b('0x1f')]('['+_0xdb320a[_0x041b('0x14')]()+_0x041b('0x65'),_0x454043['calleridnum']);return getTicket(_0x3ffee9,_0x37f7cc,_0xc12e36,_0xc17911,_0x454043,_0x23f2a2,_0xdb320a);})[_0x041b('0x10')](function(_0x12d84d){logger[_0x041b('0x1f')](util[_0x041b('0x4f')]('['+_0xdb320a[_0x041b('0x14')]()+_0x041b('0x66'),_0x23f2a2['ticketType'],_0x12d84d[_0x041b('0x4d')]));logger['info'](util['format']('['+_0xdb320a[_0x041b('0x14')]()+_0x041b('0x67'),_0xdb320a));if(_0xdb320a!=='unmanaged'&&_0x23f2a2['openNewTab']){logger[_0x041b('0x1f')]('['+_0xdb320a[_0x041b('0x14')]()+']',_0x041b('0x68'));emit(_0x37f7cc[_0x041b('0x55')],_0x488f8d[_0x041b('0x69')],_0x23f2a2[_0x041b('0x40')],_0x12d84d[_0x041b('0x4d')]);}})[_0x041b('0x12')](function(_0x483184){logger[_0x041b('0x13')]('['+_0xdb320a[_0x041b('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x483184[_0x041b('0x16')]);console[_0x041b('0x13')](_0x041b('0x6a'),_0x483184);});}; \ 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 97ffe8a..86f7f64 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 _0xab66=['variableName','customVariable','name','Variable','push','queue','stripTrailingSlash','serverUrl','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','stringify','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','user:%s','trigger:browser:url','unmanaged','monitor_format','toUpperCase','lodash','./util','../../../../config/environment','freshdesk','redis','localhost','application/json','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','debug','[HTTP]','defaults','GET','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField'];(function(_0xc60d76,_0x365b64){var _0x2b2732=function(_0x27b864){while(--_0x27b864){_0xc60d76['push'](_0xc60d76['shift']());}};_0x2b2732(++_0x365b64);}(_0xab66,0x1d8));var _0x6ab6=function(_0x579eae,_0x282832){_0x579eae=_0x579eae-0x0;var _0x41b1a0=_0xab66[_0x579eae];return _0x41b1a0;};'use strict';var _=require(_0x6ab6('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6ab6('0x1'));var config=require(_0x6ab6('0x2'));var logger=require('../../../../config/logger')(_0x6ab6('0x3'));config[_0x6ab6('0x4')]=_['defaults'](config['redis'],{'host':_0x6ab6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6ab6('0x4')]));var headers={'Content-Type':_0x6ab6('0x6'),'Accept':'application/json'};function emit(_0x1258b6,_0x3686ae,_0x424715){io['to'](_0x1258b6)['emit'](_0x3686ae,_0x424715);}function getTicket(_0x39bff6,_0x705902,_0x49af56,_0x32837b,_0x168d44){logger['info'](_0x6ab6('0x7'));var _0x86cac8=_[_0x6ab6('0x8')]({'responder_id':_0x705902['id'],'requester_id':_0x49af56['id'],'name':util['format'](_0x6ab6('0x9'),_0x168d44[_0x6ab6('0xa')]),'phone':_0x168d44['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6ab6('0xb')](_0x32837b[_0x6ab6('0xc')],_0x168d44,'\x20'),'description':intUtil[_0x6ab6('0xb')](_0x32837b[_0x6ab6('0xd')],_0x168d44,_0x6ab6('0xe')),'tags':getTags(_0x32837b[_0x6ab6('0xf')],'name')},getCustomFields(_0x32837b[_0x6ab6('0x10')],_0x168d44));_0x86cac8[_0x6ab6('0x11')]=_[_0x6ab6('0x12')](_[_0x6ab6('0x13')](_0x86cac8[_0x6ab6('0x11')],'id'),_0x6ab6('0x14'));return request({'uri':util['format'](_0x6ab6('0x15'),_0x39bff6[_0x6ab6('0x16')]),'method':_0x6ab6('0x17'),'body':_0x86cac8})[_0x6ab6('0x18')](function(_0x1d2fa1){logger[_0x6ab6('0x19')](_0x6ab6('0x1a'));return _0x1d2fa1;});}function getUser(_0x4a4cdd,_0x205dcf){if(intUtil[_0x6ab6('0x1b')](_0x205dcf)){return request({'uri':util['format'](_0x6ab6('0x1c'),_0x4a4cdd['remoteUri']),'qs':{'email':_0x205dcf}})['then'](function(_0x3be1f3){if(_0x3be1f3['length']){logger[_0x6ab6('0x19')]('Agent\x20found!');return _[_0x6ab6('0x1d')](_0x3be1f3,function(_0x90857c){return _0x90857c[_0x6ab6('0x1e')]['email']===_0x205dcf;});}else{logger[_0x6ab6('0x19')](_0x6ab6('0x1f'));return request({'uri':util[_0x6ab6('0x20')]('%s/api/v2/agents/me',_0x4a4cdd['remoteUri'])})[_0x6ab6('0x18')](function(_0x1ed30d){logger[_0x6ab6('0x19')](_0x6ab6('0x21'));return _0x1ed30d;});}});}else{logger[_0x6ab6('0x19')](_0x6ab6('0x22'));return request({'uri':util['format'](_0x6ab6('0x23'),_0x4a4cdd['remoteUri'])})[_0x6ab6('0x18')](function(_0x510ecc){logger[_0x6ab6('0x19')](_0x6ab6('0x21'));return _0x510ecc;});}}function getEndUser(_0x219a33,_0x23814f,_0x96a2b2){logger['info']('Searching\x20enduser\x20with\x20phone',_0x96a2b2);return request({'uri':util[_0x6ab6('0x20')](_0x6ab6('0x24'),_0x219a33[_0x6ab6('0x16')]),'qs':{'phone':_0x96a2b2}})[_0x6ab6('0x18')](function(_0x4cbf6c){if(_0x4cbf6c[_0x6ab6('0x25')]){logger[_0x6ab6('0x19')](_0x6ab6('0x26'));return _[_0x6ab6('0x1d')](_0x4cbf6c,{'phone':_0x96a2b2});}else{logger[_0x6ab6('0x19')](_0x6ab6('0x27'));return request({'uri':util[_0x6ab6('0x20')]('%s/api/v2/contacts',_0x219a33[_0x6ab6('0x16')]),'method':_0x6ab6('0x17'),'body':{'name':_0x23814f,'phone':_0x96a2b2}})['then'](function(_0x2e357f){logger[_0x6ab6('0x19')](_0x6ab6('0x28'));return _0x2e357f;});}});}function getAuth(_0x7435c5){return util[_0x6ab6('0x20')](_0x6ab6('0x29'),new Buffer(_0x7435c5['apiKey']+':X')[_0x6ab6('0x2a')]('base64'));}function request(_0x14f004){logger[_0x6ab6('0x2b')](_0x6ab6('0x2c'),JSON['stringify'](_0x14f004));return rp(_[_0x6ab6('0x2d')](_0x14f004,{'method':_0x6ab6('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x56369a,_0x47cce2){var _0x18ef77=[];if(_0x56369a&&_0x56369a[_0x6ab6('0x25')]>0x0){_0x18ef77=_['map'](_0x56369a,_0x47cce2);}return _0x18ef77;}function getCustomFields(_0x499c16,_0x531b09){var _0x4a9a8a=[];var _0x384671={'custom_fields':[]};if(_0x499c16[_0x6ab6('0x25')]>0x0){_['forEach'](_0x499c16,function(_0x382e0a){if(_[_0x6ab6('0x2f')]([_0x6ab6('0x30'),_0x6ab6('0x31')],_0x382e0a[_0x6ab6('0x32')])&&_0x382e0a['nameField']&&!_0x382e0a['customField']){_0x384671[_0x382e0a[_0x6ab6('0x33')][_0x6ab6('0x34')]()]=_0x382e0a[_0x6ab6('0x35')][_0x6ab6('0x2a')]();}else if(_[_0x6ab6('0x2f')](['string',_0x6ab6('0x31')],_0x382e0a[_0x6ab6('0x32')])&&_0x382e0a[_0x6ab6('0x36')]&&_0x382e0a[_0x6ab6('0x37')]){_0x384671[_0x6ab6('0x11')]['push']({'id':_0x382e0a['idField'],'value':_0x382e0a[_0x6ab6('0x35')][_0x6ab6('0x2a')]()});}else if(_0x382e0a[_0x6ab6('0x32')]==='variable'&&_0x382e0a[_0x6ab6('0x38')]&&_0x382e0a['idField']&&_0x382e0a[_0x6ab6('0x37')]){_0x531b09[_0x382e0a[_0x6ab6('0x38')]]&&_0x384671[_0x6ab6('0x11')]['push']({'id':_0x382e0a['idField'],'value':_0x531b09[_0x382e0a[_0x6ab6('0x38')]][_0x6ab6('0x2a')]()});}else if(_0x382e0a[_0x6ab6('0x32')]===_0x6ab6('0x39')&&_0x382e0a['Variable']&&_0x382e0a['Variable'][_0x6ab6('0x3a')]&&_0x382e0a[_0x6ab6('0x36')]&&_0x382e0a[_0x6ab6('0x37')]){_0x531b09[_0x382e0a[_0x6ab6('0x3b')][_0x6ab6('0x3a')]['toLowerCase']()]&&_0x384671[_0x6ab6('0x11')][_0x6ab6('0x3c')]({'id':_0x382e0a[_0x6ab6('0x36')],'value':_0x531b09[_0x382e0a['Variable'][_0x6ab6('0x3a')]['toLowerCase']()][_0x6ab6('0x2a')]()});}});}return _0x384671;}exports[_0x6ab6('0x3d')]=function(_0x16e32b,_0x42b204,_0x199ce6,_0x2872fa,_0x13a842,_0x5e6755){var _0x370a35,_0x11617b;_0x5e6755[_0x6ab6('0x16')]=intUtil[_0x6ab6('0x3e')](_0x5e6755[_0x6ab6('0x16')]);_0x5e6755[_0x6ab6('0x3f')]=intUtil[_0x6ab6('0x3e')](_0x5e6755['serverUrl']);if(_0x13a842&&_0x13a842['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x42b204[_0x6ab6('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e6755[_0x6ab6('0x3f')],_0x42b204[_0x6ab6('0x41')],md5(_0x42b204[_0x6ab6('0x41')]));}else{_0x42b204[_0x6ab6('0x40')]='';}headers[_0x6ab6('0x42')]=getAuth(_0x5e6755);return getUser(_0x5e6755,_0x2872fa[_0x6ab6('0x43')])[_0x6ab6('0x18')](function(_0x5a1754){_0x370a35=_0x5a1754;logger['info']('The\x20User\x20ID\x20is:',_0x370a35['id']);return getEndUser(_0x5e6755,_0x42b204[_0x6ab6('0xa')],_0x42b204[_0x6ab6('0x44')]);})['then'](function(_0x578d3a){_0x11617b=_0x578d3a;logger['info'](_0x6ab6('0x45'),_0x11617b['id']);return getTicket(_0x5e6755,_0x370a35,_0x11617b,_0x199ce6,_0x42b204);})[_0x6ab6('0x18')](function(_0x34f070){if(_0x34f070&&_0x34f070['id']){logger[_0x6ab6('0x19')](_0x6ab6('0x1a'));logger[_0x6ab6('0x19')](_0x6ab6('0x46'),_0x34f070['id']);logger[_0x6ab6('0x19')](_0x6ab6('0x47'),_0x6ab6('0x48'));emit(util[_0x6ab6('0x20')]('user:%s',_0x2872fa[_0x6ab6('0x3a')]),'trigger:browser:url',{'uri':util[_0x6ab6('0x20')]('%s/helpdesk/tickets/%d',_0x5e6755['remoteUri'],_0x34f070['id'])});}})[_0x6ab6('0x49')](function(_0x41fac1){logger[_0x6ab6('0x4a')]('[QUEUE]',JSON[_0x6ab6('0x4b')](_0x41fac1));});};exports[_0x6ab6('0x4c')]=function(_0x23657d,_0x16a4e9,_0x5b8159,_0x3b2d2f,_0x33e922,_0x1f75c0,_0x29b94f){var _0x26a851,_0x4db968;_0x1f75c0['remoteUri']=intUtil['stripTrailingSlash'](_0x1f75c0[_0x6ab6('0x16')]);_0x1f75c0['serverUrl']=intUtil[_0x6ab6('0x3e')](_0x1f75c0[_0x6ab6('0x3f')]);if(_0x29b94f&&_0x29b94f[_0x6ab6('0x4d')]&&_0x29b94f[_0x6ab6('0x4d')]!=='none'){logger['info'](_0x6ab6('0x4e'),_0x6ab6('0x4f'));_0x16a4e9[_0x6ab6('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f75c0['serverUrl'],_0x16a4e9[_0x6ab6('0x41')],md5(_0x16a4e9[_0x6ab6('0x41')]));}headers['Authorization']=getAuth(_0x1f75c0);return getUser(_0x1f75c0,_0x3b2d2f[_0x6ab6('0x43')])[_0x6ab6('0x18')](function(_0x19ef10){_0x26a851=_0x19ef10;logger['info'](_0x6ab6('0x50'),_0x26a851['id']);return getEndUser(_0x1f75c0,_0x16a4e9[_0x6ab6('0x51')],_0x16a4e9[_0x6ab6('0x52')]);})['then'](function(_0x2e6d62){_0x4db968=_0x2e6d62;logger[_0x6ab6('0x19')](_0x6ab6('0x45'),_0x4db968['id']);return getTicket(_0x1f75c0,_0x26a851,_0x4db968,_0x5b8159,_0x16a4e9);})[_0x6ab6('0x18')](function(_0x5df007){if(_0x5df007&&_0x5df007['id']){logger[_0x6ab6('0x19')](_0x6ab6('0x1a'));logger['info'](_0x6ab6('0x46'),_0x5df007['id']);logger[_0x6ab6('0x19')](_0x6ab6('0x4e'),_0x6ab6('0x48'));emit(util[_0x6ab6('0x20')](_0x6ab6('0x53'),_0x3b2d2f[_0x6ab6('0x3a')]),_0x6ab6('0x54'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x1f75c0['remoteUri'],_0x5df007['id'])});}})[_0x6ab6('0x49')](function(_0x5b06c9){logger[_0x6ab6('0x4a')](_0x6ab6('0x4e'),JSON[_0x6ab6('0x4b')](_0x5b06c9));});};exports[_0x6ab6('0x55')]=function(_0x289068,_0x1536d8,_0x250dac,_0x5dbd19,_0x4181cb,_0x2f6022){var _0x1da245,_0x2e23e4;_0x2f6022[_0x6ab6('0x16')]=intUtil[_0x6ab6('0x3e')](_0x2f6022[_0x6ab6('0x16')]);_0x2f6022['serverUrl']=intUtil['stripTrailingSlash'](_0x2f6022[_0x6ab6('0x3f')]);if(_0x4181cb&&_0x4181cb[_0x6ab6('0x56')]){logger[_0x6ab6('0x19')]('['+_0x1536d8['lastevent'][_0x6ab6('0x57')]()+']',_0x6ab6('0x4f'));_0x1536d8[_0x6ab6('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f6022[_0x6ab6('0x3f')],_0x1536d8[_0x6ab6('0x41')],md5(_0x1536d8[_0x6ab6('0x41')]));}else{_0x1536d8['recordingURL']='';}headers[_0x6ab6('0x42')]=getAuth(_0x2f6022);return getUser(_0x2f6022,'')['then'](function(_0x5924ee){_0x1da245=_0x5924ee;logger[_0x6ab6('0x19')](_0x6ab6('0x50'),_0x1da245['id']);return getEndUser(_0x2f6022,_0x1536d8[_0x6ab6('0xa')],_0x1536d8['calleridnum']);})['then'](function(_0x540ece){_0x2e23e4=_0x540ece;logger['info'](_0x6ab6('0x45'),_0x2e23e4['id']);return getTicket(_0x2f6022,_0x1da245,_0x2e23e4,_0x250dac,_0x1536d8);})[_0x6ab6('0x18')](function(_0x539bb7){if(_0x539bb7){logger['info'](_0x6ab6('0x1a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x539bb7['id']);}})[_0x6ab6('0x49')](function(_0x1d8589){logger[_0x6ab6('0x4a')]('['+_0x1536d8['lastevent'][_0x6ab6('0x57')]()+']',JSON[_0x6ab6('0x4b')](_0x1d8589));});}; \ No newline at end of file +var _0xd689=['../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','custom_fields','mapValues','keyBy','value','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','apiKey','toString','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','ioredis','./util','../../../../config/environment'];(function(_0xea1bf2,_0x2d5096){var _0x21dee6=function(_0x1c4d6a){while(--_0x1c4d6a){_0xea1bf2['push'](_0xea1bf2['shift']());}};_0x21dee6(++_0x2d5096);}(_0xd689,0x114));var _0x9d68=function(_0x1e1058,_0x30a95c){_0x1e1058=_0x1e1058-0x0;var _0x1bd2e5=_0xd689[_0x1e1058];return _0x1bd2e5;};'use strict';var _=require(_0x9d68('0x0'));var rp=require(_0x9d68('0x1'));var md5=require(_0x9d68('0x2'));var util=require('util');var Redis=require(_0x9d68('0x3'));var intUtil=require(_0x9d68('0x4'));var config=require(_0x9d68('0x5'));var logger=require(_0x9d68('0x6'))(_0x9d68('0x7'));config[_0x9d68('0x8')]=_[_0x9d68('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9d68('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x9d68('0xb'),'Accept':_0x9d68('0xb')};function emit(_0x366eeb,_0x44c871,_0x2bfb9d){io['to'](_0x366eeb)[_0x9d68('0xc')](_0x44c871,_0x2bfb9d);}function getTicket(_0x5c9066,_0x2c67a2,_0x539afc,_0x5cd11d,_0x3c0139){logger[_0x9d68('0xd')]('Creating\x20new\x20ticket...');var _0x2d18ea=_[_0x9d68('0xe')]({'responder_id':_0x2c67a2['id'],'requester_id':_0x539afc['id'],'name':util[_0x9d68('0xf')](_0x9d68('0x10'),_0x3c0139[_0x9d68('0x11')]),'phone':_0x3c0139['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9d68('0x12')](_0x5cd11d[_0x9d68('0x13')],_0x3c0139,'\x20'),'description':intUtil['getString'](_0x5cd11d[_0x9d68('0x14')],_0x3c0139,_0x9d68('0x15')),'tags':getTags(_0x5cd11d['Tags'],'name')},getCustomFields(_0x5cd11d['Fields'],_0x3c0139));_0x2d18ea[_0x9d68('0x16')]=_[_0x9d68('0x17')](_[_0x9d68('0x18')](_0x2d18ea[_0x9d68('0x16')],'id'),_0x9d68('0x19'));return request({'uri':util['format']('%s/api/v2/tickets',_0x5c9066[_0x9d68('0x1a')]),'method':'POST','body':_0x2d18ea})[_0x9d68('0x1b')](function(_0x394460){logger[_0x9d68('0xd')](_0x9d68('0x1c'));return _0x394460;});}function getUser(_0x5d3da3,_0x26a028){if(intUtil[_0x9d68('0x1d')](_0x26a028)){return request({'uri':util[_0x9d68('0xf')](_0x9d68('0x1e'),_0x5d3da3[_0x9d68('0x1a')]),'qs':{'email':_0x26a028}})[_0x9d68('0x1b')](function(_0x1f573c){if(_0x1f573c[_0x9d68('0x1f')]){logger[_0x9d68('0xd')](_0x9d68('0x20'));return _[_0x9d68('0x21')](_0x1f573c,function(_0x123fd9){return _0x123fd9[_0x9d68('0x22')]['email']===_0x26a028;});}else{logger[_0x9d68('0xd')](_0x9d68('0x23'));return request({'uri':util[_0x9d68('0xf')]('%s/api/v2/agents/me',_0x5d3da3[_0x9d68('0x1a')])})[_0x9d68('0x1b')](function(_0x1e4a19){logger['info'](_0x9d68('0x24'));return _0x1e4a19;});}});}else{logger[_0x9d68('0xd')](_0x9d68('0x25'));return request({'uri':util[_0x9d68('0xf')]('%s/api/v2/agents/me',_0x5d3da3['remoteUri'])})[_0x9d68('0x1b')](function(_0x108fb4){logger[_0x9d68('0xd')]('Admin\x20account\x20selected.');return _0x108fb4;});}}function getEndUser(_0x280f0e,_0x3ca3d8,_0x47c56c){logger['info'](_0x9d68('0x26'),_0x47c56c);return request({'uri':util[_0x9d68('0xf')]('%s/api/v2/contacts',_0x280f0e[_0x9d68('0x1a')]),'qs':{'phone':_0x47c56c}})['then'](function(_0x20170e){if(_0x20170e[_0x9d68('0x1f')]){logger[_0x9d68('0xd')](_0x9d68('0x27'));return _[_0x9d68('0x21')](_0x20170e,{'phone':_0x47c56c});}else{logger[_0x9d68('0xd')](_0x9d68('0x28'));return request({'uri':util[_0x9d68('0xf')](_0x9d68('0x29'),_0x280f0e[_0x9d68('0x1a')]),'method':_0x9d68('0x2a'),'body':{'name':_0x3ca3d8,'phone':_0x47c56c}})[_0x9d68('0x1b')](function(_0x1d5743){logger[_0x9d68('0xd')](_0x9d68('0x2b'));return _0x1d5743;});}});}function getAuth(_0x315e2e){return util[_0x9d68('0xf')]('Basic\x20%s',new Buffer(_0x315e2e[_0x9d68('0x2c')]+':X')[_0x9d68('0x2d')]('base64'));}function request(_0x55288a){logger['debug']('[HTTP]',JSON['stringify'](_0x55288a));return rp(_[_0x9d68('0x9')](_0x55288a,{'method':_0x9d68('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x2980d2,_0x384b80){var _0x26f6ab=[];if(_0x2980d2&&_0x2980d2[_0x9d68('0x1f')]>0x0){_0x26f6ab=_[_0x9d68('0x2f')](_0x2980d2,_0x384b80);}return _0x26f6ab;}function getCustomFields(_0x1c0d77,_0x55e58c){var _0x9c707a=[];var _0x1d7733={'custom_fields':[]};if(_0x1c0d77['length']>0x0){_[_0x9d68('0x30')](_0x1c0d77,function(_0x544e3b){if(_[_0x9d68('0x31')]([_0x9d68('0x32'),_0x9d68('0x33')],_0x544e3b[_0x9d68('0x34')])&&_0x544e3b['nameField']&&!_0x544e3b[_0x9d68('0x35')]){_0x1d7733[_0x544e3b[_0x9d68('0x36')][_0x9d68('0x37')]()]=_0x544e3b[_0x9d68('0x38')][_0x9d68('0x2d')]();}else if(_[_0x9d68('0x31')]([_0x9d68('0x32'),_0x9d68('0x33')],_0x544e3b[_0x9d68('0x34')])&&_0x544e3b[_0x9d68('0x39')]&&_0x544e3b[_0x9d68('0x35')]){_0x1d7733[_0x9d68('0x16')][_0x9d68('0x3a')]({'id':_0x544e3b['idField'],'value':_0x544e3b[_0x9d68('0x38')][_0x9d68('0x2d')]()});}else if(_0x544e3b[_0x9d68('0x34')]==='variable'&&_0x544e3b[_0x9d68('0x3b')]&&_0x544e3b[_0x9d68('0x39')]&&_0x544e3b[_0x9d68('0x35')]){_0x55e58c[_0x544e3b[_0x9d68('0x3b')]]&&_0x1d7733[_0x9d68('0x16')]['push']({'id':_0x544e3b[_0x9d68('0x39')],'value':_0x55e58c[_0x544e3b[_0x9d68('0x3b')]][_0x9d68('0x2d')]()});}else if(_0x544e3b['type']===_0x9d68('0x3c')&&_0x544e3b[_0x9d68('0x3d')]&&_0x544e3b['Variable'][_0x9d68('0x3e')]&&_0x544e3b[_0x9d68('0x39')]&&_0x544e3b[_0x9d68('0x35')]){_0x55e58c[_0x544e3b[_0x9d68('0x3d')][_0x9d68('0x3e')][_0x9d68('0x37')]()]&&_0x1d7733[_0x9d68('0x16')]['push']({'id':_0x544e3b['idField'],'value':_0x55e58c[_0x544e3b['Variable'][_0x9d68('0x3e')][_0x9d68('0x37')]()][_0x9d68('0x2d')]()});}});}return _0x1d7733;}exports[_0x9d68('0x3f')]=function(_0x4cc9d3,_0x12fd46,_0x3d1cb0,_0x22fe40,_0x3c0f68,_0xc54867){var _0x4f7ba5,_0x6b84e3;_0xc54867['remoteUri']=intUtil[_0x9d68('0x40')](_0xc54867[_0x9d68('0x1a')]);_0xc54867['serverUrl']=intUtil['stripTrailingSlash'](_0xc54867['serverUrl']);if(_0x3c0f68&&_0x3c0f68[_0x9d68('0x41')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x12fd46[_0x9d68('0x42')]=util[_0x9d68('0xf')](_0x9d68('0x43'),_0xc54867[_0x9d68('0x44')],_0x12fd46[_0x9d68('0x45')],md5(_0x12fd46[_0x9d68('0x45')]));}else{_0x12fd46[_0x9d68('0x42')]='';}headers[_0x9d68('0x46')]=getAuth(_0xc54867);return getUser(_0xc54867,_0x22fe40[_0x9d68('0x47')])['then'](function(_0x3cd110){_0x4f7ba5=_0x3cd110;logger[_0x9d68('0xd')](_0x9d68('0x48'),_0x4f7ba5['id']);return getEndUser(_0xc54867,_0x12fd46[_0x9d68('0x11')],_0x12fd46['calleridnum']);})[_0x9d68('0x1b')](function(_0x2e9525){_0x6b84e3=_0x2e9525;logger[_0x9d68('0xd')]('The\x20Enduser\x20ID\x20is:',_0x6b84e3['id']);return getTicket(_0xc54867,_0x4f7ba5,_0x6b84e3,_0x3d1cb0,_0x12fd46);})[_0x9d68('0x1b')](function(_0x1623d7){if(_0x1623d7&&_0x1623d7['id']){logger['info']('Ticket\x20created!');logger[_0x9d68('0xd')](_0x9d68('0x49'),_0x1623d7['id']);logger[_0x9d68('0xd')](_0x9d68('0x4a'),_0x9d68('0x4b'));emit(util[_0x9d68('0xf')](_0x9d68('0x4c'),_0x22fe40[_0x9d68('0x3e')]),_0x9d68('0x4d'),{'uri':util[_0x9d68('0xf')](_0x9d68('0x4e'),_0xc54867[_0x9d68('0x1a')],_0x1623d7['id'])});}})[_0x9d68('0x4f')](function(_0x42c88a){logger[_0x9d68('0x50')](_0x9d68('0x4a'),JSON[_0x9d68('0x51')](_0x42c88a));});};exports[_0x9d68('0x52')]=function(_0x119b38,_0x20b069,_0x89cfa0,_0x5ec7c9,_0x20d0ec,_0x2e5de9,_0x17962b){var _0x317b85,_0x8433ff;_0x2e5de9[_0x9d68('0x1a')]=intUtil[_0x9d68('0x40')](_0x2e5de9['remoteUri']);_0x2e5de9['serverUrl']=intUtil[_0x9d68('0x40')](_0x2e5de9['serverUrl']);if(_0x17962b&&_0x17962b['recordingFormat']&&_0x17962b[_0x9d68('0x53')]!==_0x9d68('0x54')){logger[_0x9d68('0xd')]('[OUTBOUND]',_0x9d68('0x55'));_0x20b069[_0x9d68('0x42')]=util[_0x9d68('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e5de9[_0x9d68('0x44')],_0x20b069[_0x9d68('0x45')],md5(_0x20b069[_0x9d68('0x45')]));}headers[_0x9d68('0x46')]=getAuth(_0x2e5de9);return getUser(_0x2e5de9,_0x5ec7c9[_0x9d68('0x47')])[_0x9d68('0x1b')](function(_0x2fc31d){_0x317b85=_0x2fc31d;logger[_0x9d68('0xd')]('The\x20User\x20ID\x20is:',_0x317b85['id']);return getEndUser(_0x2e5de9,_0x20b069[_0x9d68('0x56')],_0x20b069[_0x9d68('0x57')]);})[_0x9d68('0x1b')](function(_0x50663b){_0x8433ff=_0x50663b;logger[_0x9d68('0xd')](_0x9d68('0x58'),_0x8433ff['id']);return getTicket(_0x2e5de9,_0x317b85,_0x8433ff,_0x89cfa0,_0x20b069);})[_0x9d68('0x1b')](function(_0x2d05f1){if(_0x2d05f1&&_0x2d05f1['id']){logger[_0x9d68('0xd')](_0x9d68('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2d05f1['id']);logger['info'](_0x9d68('0x59'),_0x9d68('0x4b'));emit(util[_0x9d68('0xf')](_0x9d68('0x4c'),_0x5ec7c9[_0x9d68('0x3e')]),_0x9d68('0x4d'),{'uri':util[_0x9d68('0xf')](_0x9d68('0x4e'),_0x2e5de9[_0x9d68('0x1a')],_0x2d05f1['id'])});}})[_0x9d68('0x4f')](function(_0x4c048b){logger['error']('[OUTBOUND]',JSON[_0x9d68('0x51')](_0x4c048b));});};exports[_0x9d68('0x5a')]=function(_0x167adf,_0x4537c0,_0x8fb404,_0x53c145,_0x5b61dc,_0x24320a){var _0x1d499e,_0x431b4d;_0x24320a[_0x9d68('0x1a')]=intUtil[_0x9d68('0x40')](_0x24320a['remoteUri']);_0x24320a[_0x9d68('0x44')]=intUtil[_0x9d68('0x40')](_0x24320a[_0x9d68('0x44')]);if(_0x5b61dc&&_0x5b61dc[_0x9d68('0x41')]){logger[_0x9d68('0xd')]('['+_0x4537c0[_0x9d68('0x5b')][_0x9d68('0x5c')]()+']',_0x9d68('0x55'));_0x4537c0['recordingURL']=util[_0x9d68('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24320a['serverUrl'],_0x4537c0[_0x9d68('0x45')],md5(_0x4537c0[_0x9d68('0x45')]));}else{_0x4537c0[_0x9d68('0x42')]='';}headers['Authorization']=getAuth(_0x24320a);return getUser(_0x24320a,'')[_0x9d68('0x1b')](function(_0x1a7e99){_0x1d499e=_0x1a7e99;logger[_0x9d68('0xd')](_0x9d68('0x48'),_0x1d499e['id']);return getEndUser(_0x24320a,_0x4537c0[_0x9d68('0x11')],_0x4537c0[_0x9d68('0x5d')]);})['then'](function(_0x2aa7f3){_0x431b4d=_0x2aa7f3;logger[_0x9d68('0xd')](_0x9d68('0x58'),_0x431b4d['id']);return getTicket(_0x24320a,_0x1d499e,_0x431b4d,_0x8fb404,_0x4537c0);})[_0x9d68('0x1b')](function(_0x315e90){if(_0x315e90){logger[_0x9d68('0xd')](_0x9d68('0x1c'));logger[_0x9d68('0xd')]('The\x20Ticket\x20ID\x20is:',_0x315e90['id']);}})[_0x9d68('0x4f')](function(_0x91ee08){logger[_0x9d68('0x50')]('['+_0x4537c0[_0x9d68('0x5b')][_0x9d68('0x5c')]()+']',JSON[_0x9d68('0x51')](_0x91ee08));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 2b63331..2ceb985 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d96=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','headers','Getting\x20admin\x20information','users','length','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','userEmail','error','/api/lookup?q=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','then','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','Subjects','getString','Descriptions','Contact','ticketId','task','Task\x20created:','user:%s','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x54bbef,_0x1aab38){var _0x9dc657=function(_0x2a782e){while(--_0x2a782e){_0x54bbef['push'](_0x54bbef['shift']());}};_0x9dc657(++_0x1aab38);}(_0x7d96,0x102));var _0x67d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x67d9('0x0'));var rp=require(_0x67d9('0x1'));var md5=require(_0x67d9('0x2'));var util=require(_0x67d9('0x3'));var moment=require(_0x67d9('0x4'));var Promise=require('bluebird');var Redis=require(_0x67d9('0x5'));var intUtil=require(_0x67d9('0x6'));var config=require('../../../../config/environment');var logger=require(_0x67d9('0x7'))(_0x67d9('0x8'));config[_0x67d9('0x9')]=_[_0x67d9('0xa')](config[_0x67d9('0x9')],{'host':_0x67d9('0xb'),'port':0x18eb});var io=require(_0x67d9('0xc'))(new Redis(config[_0x67d9('0x9')]));function getAdminId(_0x1cfd9a,_0x266d17,_0x2b85ef,_0x59557d){return new Promise(function(_0x572363,_0x193268){var _0x56f916=![];var _0x3433bf={'method':'GET','uri':_0x59557d+'/api/selector/owners','json':!![]};_0x3433bf[_0x67d9('0xd')]=_0x2b85ef;logger['info'](_0x67d9('0xe'));return rp(_0x3433bf)['then'](function(_0x23a245){if(_0x23a245){var _0x11f640=_0x23a245[_0x67d9('0xf')];var _0x3465fb=null;for(_0x3465fb=0x0;_0x3465fb<_0x11f640[_0x67d9('0x10')];_0x3465fb++){if(_0x11f640[_0x3465fb][_0x67d9('0x11')]===_0x1cfd9a['adminEmail']){_0x1cfd9a[_0x67d9('0x12')]=_0x11f640[_0x3465fb]['id'];_0x56f916=!![];}}if(_0x56f916){logger[_0x67d9('0x13')](_0x67d9('0x14'),_0x1cfd9a[_0x67d9('0x12')]);_0x572363(_0x1cfd9a);}else{_0x193268({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x193268({'statusCode':0x194,'message':_0x67d9('0x15')});}})[_0x67d9('0x16')](function(_0x523886){logger['error']('['+[_0x266d17[_0x67d9('0x17')]()]+']',_0x523886[_0x67d9('0x18')]);_0x193268(_0x523886);});});}function getUser(_0x365e8e,_0x3470cf,_0x4706f5){return function(_0x14a126){return new Promise(function(_0x32f747,_0x80435b){var _0x30c2b2={'method':_0x67d9('0x19'),'uri':_0x4706f5+_0x67d9('0x1a'),'json':!![]};_0x30c2b2[_0x67d9('0xd')]=_0x3470cf;logger['info'](_0x67d9('0x1b'));return rp(_0x30c2b2)['then'](function(_0x4b8415){if(_0x4b8415){var _0x356ba9=_0x4b8415['users'];var _0x57e6d4=![];var _0x4d1b32=null;if(_0x14a126['agentEmail']!==null){logger['info'](_0x67d9('0x1c'),_0x14a126[_0x67d9('0x1d')]);_0x14a126['userEmail']=_0x14a126[_0x67d9('0x1d')];for(_0x4d1b32=0x0;_0x4d1b32<_0x356ba9[_0x67d9('0x10')];_0x4d1b32++){if(_0x356ba9[_0x4d1b32][_0x67d9('0x11')]===_0x14a126[_0x67d9('0x1d')]){_0x57e6d4=!![];_0x14a126[_0x67d9('0x1e')]=_0x356ba9[_0x4d1b32]['id'];logger[_0x67d9('0x13')](_0x67d9('0x1f'),_0x14a126['userId']);}}}if(!_0x57e6d4){logger[_0x67d9('0x13')]('Admin\x20selected');_0x14a126[_0x67d9('0x20')]=_0x14a126['adminEmail'];_0x14a126[_0x67d9('0x1e')]=_0x14a126[_0x67d9('0x12')];_0x57e6d4=!![];}if(_0x57e6d4){_0x32f747(_0x14a126);}else{_0x80435b({'statusCode':0x194,'message':_0x67d9('0x15')});}}else{_0x80435b({'statusCode':0x194,'message':_0x67d9('0x15')});}})[_0x67d9('0x16')](function(_0x140314){logger[_0x67d9('0x21')]('['+[_0x365e8e[_0x67d9('0x17')]()]+']',_0x140314['message']);_0x80435b(_0x140314);});});};}function searchContact(_0x20a9d2,_0x2325d0,_0x2cd683,_0x36f739){return new Promise(function(_0x2d7a88,_0x493751){var _0x42815f={'method':_0x67d9('0x19'),'headers':_0x2325d0,'uri':_0x20a9d2+_0x67d9('0x22')+_0x36f739+'&f='+_0x2cd683+_0x67d9('0x23'),'json':!![]};rp(_0x42815f)['then'](function(_0x4e924b){var _0x26cf09=_[_0x67d9('0x24')](_0x4e924b[_0x67d9('0x25')][_0x67d9('0x25')],[_0x2cd683,_0x36f739]);_0x2d7a88(_0x26cf09);})[_0x67d9('0x16')](function(_0x389015){_0x493751(_0x389015);});});}function getEndUser(_0xad7cbb,_0x2d97cf,_0x3941ca){return function(_0x4b64fe){return new Promise(function(_0x577ae1,_0x1dc339){logger['info'](util['format'](_0x67d9('0x26'),_0x4b64fe['contactNumber']));searchContact(_0x3941ca,_0x2d97cf,_0x67d9('0x27'),_0x4b64fe[_0x67d9('0x28')])[_0x67d9('0x29')](function(_0x4b4628){if(_0x4b4628){_0x4b64fe[_0x67d9('0x2a')]=_0x4b4628['id'];logger['info'](_0x67d9('0x2b'),_0x4b64fe[_0x67d9('0x2a')]);return _0x577ae1(_0x4b64fe);}searchContact(_0x3941ca,_0x2d97cf,_0x67d9('0x2c'),_0x4b64fe[_0x67d9('0x28')])['then'](function(_0x5271eb){if(_0x5271eb){_0x4b64fe[_0x67d9('0x2a')]=_0x5271eb['id'];logger[_0x67d9('0x13')](_0x67d9('0x2d'),_0x4b64fe[_0x67d9('0x2a')]);return _0x577ae1(_0x4b64fe);}createEndUser(_0x4b64fe,_0xad7cbb,_0x2d97cf,_0x3941ca)[_0x67d9('0x29')](function(_0x24fa6b){logger['info'](_0x67d9('0x2e'),_0x24fa6b[_0x67d9('0x2a')]);return _0x577ae1(_0x24fa6b);});});})[_0x67d9('0x16')](function(_0x4e1e31){_0x1dc339(_0x4e1e31);});});};}function createEndUser(_0x3acb14,_0x545d32,_0x3bb68a,_0x1e2c96){return new Promise(function(_0x1c241d,_0x273948){var _0x497464=moment();var _0x24d1f2={'method':'POST','uri':_0x1e2c96+_0x67d9('0x2f'),'body':{'contact':{'last_name':_0x3acb14[_0x67d9('0x28')],'work_number':_0x3acb14['contactNumber'],'mobile_number':_0x3acb14[_0x67d9('0x28')],'owner_id':_0x3acb14[_0x67d9('0x1e')],'created_at':_0x497464[_0x67d9('0x30')](_0x67d9('0x31'))}},'json':!![]};_0x24d1f2[_0x67d9('0xd')]=_0x3bb68a;logger[_0x67d9('0x13')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x24d1f2)['then'](function(_0x14386f){_0x3acb14[_0x67d9('0x2a')]=_0x14386f[_0x67d9('0x32')]['id'];_0x1c241d(_0x3acb14);})['catch'](function(_0x5a1ee8){logger[_0x67d9('0x21')]('['+[_0x545d32['toUpperCase']()]+']',_0x5a1ee8[_0x67d9('0x18')]);_0x273948(_0x5a1ee8[_0x67d9('0x18')]);});});}function getTicket(_0x475216,_0x15d834,_0x2fab45,_0x1b8b86,_0x25b753){return function(_0x9cc64e){logger[_0x67d9('0x13')](_0x67d9('0x33'));return new Promise(function(_0x16f9a6,_0xe73ad5){var _0x1b3d0a=moment();var _0x14c77d={'method':_0x67d9('0x34'),'uri':_0x2fab45+_0x67d9('0x35'),'body':{'title':intUtil['getString'](_0x1b8b86[_0x67d9('0x36')],_0x25b753,'\x20'),'description':intUtil[_0x67d9('0x37')](_0x1b8b86[_0x67d9('0x38')],_0x25b753,'\x0a'),'owner_id':_0x9cc64e[_0x67d9('0x1e')],'creater_id':_0x9cc64e['adminId'],'targetable_id':_0x9cc64e['endUserId'],'targetable_type':_0x67d9('0x39'),'created_at':_0x1b3d0a['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1b3d0a['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x14c77d[_0x67d9('0xd')]=_0x15d834;return rp(_0x14c77d)[_0x67d9('0x29')](function(_0x1fd65c){_0x9cc64e[_0x67d9('0x3a')]=_0x1fd65c[_0x67d9('0x3b')]['id'];logger[_0x67d9('0x13')](_0x67d9('0x3c'),_0x9cc64e[_0x67d9('0x3a')]);_0x16f9a6(_0x9cc64e);})['catch'](function(_0x566456){logger[_0x67d9('0x21')]('['+[_0x475216[_0x67d9('0x17')]()]+']',_0x566456[_0x67d9('0x18')]);_0xe73ad5(_0x566456[_0x67d9('0x18')]);});});};}function emit(_0x788530,_0x36ffe7,_0x1ef696){var _0x3c2f64={'uri':_0x788530+'/contacts/'+_0x1ef696};io['to'](util[_0x67d9('0x30')](_0x67d9('0x3d'),_0x36ffe7))['emit']('trigger:browser:url',_0x3c2f64);}exports['cs']=function(_0x236ad4,_0x48b1a8,_0x29e651,_0x24cef1,_0x1bed2f,_0x4be564,_0x3028a5,_0x4e0a9a){var _0x140d6d={};var _0xa85fac={'Authorization':_0x67d9('0x3e')+_0x4be564['apiKey']};_0x4be564[_0x67d9('0x3f')]=intUtil[_0x67d9('0x40')](_0x4be564[_0x67d9('0x3f')]);_0x4be564[_0x67d9('0x41')]=intUtil[_0x67d9('0x40')](_0x4be564['serverUrl']);var _0x28ef28=_0x4be564[_0x67d9('0x3f')];_0x140d6d[_0x67d9('0x42')]=_0x4be564[_0x67d9('0x43')];_0x140d6d['contactNumber']=_0x4e0a9a['toLowerCase']()===_0x67d9('0x44')?_0x48b1a8[_0x67d9('0x45')]:_0x48b1a8[_0x67d9('0x46')];_0x140d6d['callDirection']=_0x4e0a9a===_0x67d9('0x47')||_0x4e0a9a===_0x67d9('0x48')?_0x67d9('0x47'):_0x67d9('0x44');if(_0x24cef1){_0x140d6d[_0x67d9('0x1d')]=_0x24cef1[_0x67d9('0x11')];}var _0x50f6e5=util[_0x67d9('0x30')](_0x67d9('0x49'),_0x4be564[_0x67d9('0x41')],_0x48b1a8[_0x67d9('0x4a')],md5(_0x48b1a8[_0x67d9('0x4a')]));if(_0x1bed2f&&_0x1bed2f[_0x67d9('0x4b')]){logger[_0x67d9('0x13')](_0x67d9('0x4c'),_0x67d9('0x4d'));_0x48b1a8[_0x67d9('0x4e')]=_0x50f6e5;}else if(_0x3028a5&&_0x3028a5['recordingFormat']&&_0x3028a5['recordingFormat']!==_0x67d9('0x4f')){logger[_0x67d9('0x13')]('[OUTBOUND]',_0x67d9('0x4d'));_0x48b1a8[_0x67d9('0x4e')]=_0x50f6e5;}else{_0x48b1a8[_0x67d9('0x4e')]='';}return getAdminId(_0x140d6d,_0x4e0a9a,_0xa85fac,_0x28ef28)[_0x67d9('0x29')](getUser(_0x4e0a9a,_0xa85fac,_0x28ef28))[_0x67d9('0x29')](getEndUser(_0x4e0a9a,_0xa85fac,_0x28ef28))[_0x67d9('0x29')](getTicket(_0x4e0a9a,_0xa85fac,_0x28ef28,_0x29e651,_0x48b1a8))[_0x67d9('0x29')](function(_0x19069b){logger['info'](util[_0x67d9('0x30')]('The\x20ticket\x20ID\x20is:\x20%s',_0x19069b[_0x67d9('0x3a')]));if(_0x4e0a9a!==_0x67d9('0x48')){logger[_0x67d9('0x13')]('['+[_0x4e0a9a['toUpperCase']()]+']',_0x67d9('0x50'));emit(_0x28ef28,_0x24cef1[_0x67d9('0x51')],_0x19069b[_0x67d9('0x2a')]);}})[_0x67d9('0x16')](function(_0x4e9cd4){logger['error']('['+[_0x4e0a9a[_0x67d9('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x67d9('0x52')](_0x4e9cd4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2f30=['error','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','task','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:'];(function(_0x44add5,_0x1467b0){var _0x3410be=function(_0x246b1c){while(--_0x246b1c){_0x44add5['push'](_0x44add5['shift']());}};_0x3410be(++_0x1467b0);}(_0x2f30,0x8b));var _0x02f3=function(_0x326532,_0x4deb01){_0x326532=_0x326532-0x0;var _0x571ead=_0x2f30[_0x326532];return _0x571ead;};'use strict';var _=require(_0x02f3('0x0'));var rp=require(_0x02f3('0x1'));var md5=require('md5');var util=require('util');var moment=require('moment');var Promise=require(_0x02f3('0x2'));var Redis=require(_0x02f3('0x3'));var intUtil=require('./util');var config=require(_0x02f3('0x4'));var logger=require(_0x02f3('0x5'))('freshsales');config[_0x02f3('0x6')]=_['defaults'](config['redis'],{'host':_0x02f3('0x7'),'port':0x18eb});var io=require(_0x02f3('0x8'))(new Redis(config['redis']));function getAdminId(_0x59800d,_0x1e9642,_0x594346,_0x3acf28){return new Promise(function(_0x4159cd,_0xa1e303){var _0x3c92ac=![];var _0x4695b8={'method':_0x02f3('0x9'),'uri':_0x3acf28+'/api/selector/owners','json':!![]};_0x4695b8[_0x02f3('0xa')]=_0x594346;logger[_0x02f3('0xb')](_0x02f3('0xc'));return rp(_0x4695b8)[_0x02f3('0xd')](function(_0x2430ca){if(_0x2430ca){var _0x52ed68=_0x2430ca['users'];var _0x51eba8=null;for(_0x51eba8=0x0;_0x51eba8<_0x52ed68['length'];_0x51eba8++){if(_0x52ed68[_0x51eba8]['email']===_0x59800d[_0x02f3('0xe')]){_0x59800d['adminId']=_0x52ed68[_0x51eba8]['id'];_0x3c92ac=!![];}}if(_0x3c92ac){logger[_0x02f3('0xb')](_0x02f3('0xf'),_0x59800d[_0x02f3('0x10')]);_0x4159cd(_0x59800d);}else{_0xa1e303({'statusCode':0x194,'message':_0x02f3('0x11')});}}else{_0xa1e303({'statusCode':0x194,'message':_0x02f3('0x11')});}})[_0x02f3('0x12')](function(_0x259ab7){logger['error']('['+[_0x1e9642['toUpperCase']()]+']',_0x259ab7[_0x02f3('0x13')]);_0xa1e303(_0x259ab7);});});}function getUser(_0x3661a2,_0x3e7058,_0x2e6aca){return function(_0x503316){return new Promise(function(_0x284ccf,_0x57969f){var _0x502f41={'method':'GET','uri':_0x2e6aca+_0x02f3('0x14'),'json':!![]};_0x502f41[_0x02f3('0xa')]=_0x3e7058;logger[_0x02f3('0xb')](_0x02f3('0x15'));return rp(_0x502f41)[_0x02f3('0xd')](function(_0x11bee4){if(_0x11bee4){var _0x515d36=_0x11bee4[_0x02f3('0x16')];var _0x133c4d=![];var _0x462a08=null;if(_0x503316[_0x02f3('0x17')]!==null){logger[_0x02f3('0xb')](_0x02f3('0x18'),_0x503316[_0x02f3('0x17')]);_0x503316[_0x02f3('0x19')]=_0x503316[_0x02f3('0x17')];for(_0x462a08=0x0;_0x462a08<_0x515d36[_0x02f3('0x1a')];_0x462a08++){if(_0x515d36[_0x462a08]['email']===_0x503316[_0x02f3('0x17')]){_0x133c4d=!![];_0x503316[_0x02f3('0x1b')]=_0x515d36[_0x462a08]['id'];logger['info'](_0x02f3('0x1c'),_0x503316[_0x02f3('0x1b')]);}}}if(!_0x133c4d){logger[_0x02f3('0xb')]('Admin\x20selected');_0x503316[_0x02f3('0x19')]=_0x503316[_0x02f3('0xe')];_0x503316[_0x02f3('0x1b')]=_0x503316[_0x02f3('0x10')];_0x133c4d=!![];}if(_0x133c4d){_0x284ccf(_0x503316);}else{_0x57969f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x57969f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x02f3('0x12')](function(_0x2345f1){logger[_0x02f3('0x1d')]('['+[_0x3661a2[_0x02f3('0x1e')]()]+']',_0x2345f1[_0x02f3('0x13')]);_0x57969f(_0x2345f1);});});};}function searchContact(_0x101e0f,_0x500a6b,_0x18a350,_0x479509){return new Promise(function(_0x52889c,_0x2fc89a){var _0x9c68fe={'method':_0x02f3('0x9'),'headers':_0x500a6b,'uri':_0x101e0f+_0x02f3('0x1f')+_0x479509+_0x02f3('0x20')+_0x18a350+_0x02f3('0x21'),'json':!![]};rp(_0x9c68fe)['then'](function(_0x21ea6e){var _0x5651e0=_[_0x02f3('0x22')](_0x21ea6e[_0x02f3('0x23')][_0x02f3('0x23')],[_0x18a350,_0x479509]);_0x52889c(_0x5651e0);})[_0x02f3('0x12')](function(_0x1f790b){_0x2fc89a(_0x1f790b);});});}function getEndUser(_0x1b9dc4,_0x5f4d67,_0x166698){return function(_0x486743){return new Promise(function(_0x27b006,_0x5be032){logger[_0x02f3('0xb')](util[_0x02f3('0x24')](_0x02f3('0x25'),_0x486743[_0x02f3('0x26')]));searchContact(_0x166698,_0x5f4d67,_0x02f3('0x27'),_0x486743[_0x02f3('0x26')])[_0x02f3('0xd')](function(_0x5b34d5){if(_0x5b34d5){_0x486743[_0x02f3('0x28')]=_0x5b34d5['id'];logger[_0x02f3('0xb')](_0x02f3('0x29'),_0x486743['endUserId']);return _0x27b006(_0x486743);}searchContact(_0x166698,_0x5f4d67,_0x02f3('0x2a'),_0x486743[_0x02f3('0x26')])[_0x02f3('0xd')](function(_0x137b40){if(_0x137b40){_0x486743[_0x02f3('0x28')]=_0x137b40['id'];logger[_0x02f3('0xb')](_0x02f3('0x2b'),_0x486743['endUserId']);return _0x27b006(_0x486743);}createEndUser(_0x486743,_0x1b9dc4,_0x5f4d67,_0x166698)[_0x02f3('0xd')](function(_0x3f1ffa){logger[_0x02f3('0xb')](_0x02f3('0x2c'),_0x3f1ffa[_0x02f3('0x28')]);return _0x27b006(_0x3f1ffa);});});})[_0x02f3('0x12')](function(_0x590c7c){_0x5be032(_0x590c7c);});});};}function createEndUser(_0x457bb3,_0x49279e,_0x4a8ed2,_0x322c6b){return new Promise(function(_0x9ae720,_0x5c658b){var _0x50bbae=moment();var _0x39d6c0={'method':_0x02f3('0x2d'),'uri':_0x322c6b+_0x02f3('0x2e'),'body':{'contact':{'last_name':_0x457bb3[_0x02f3('0x26')],'work_number':_0x457bb3[_0x02f3('0x26')],'mobile_number':_0x457bb3['contactNumber'],'owner_id':_0x457bb3[_0x02f3('0x1b')],'created_at':_0x50bbae['format'](_0x02f3('0x2f'))}},'json':!![]};_0x39d6c0['headers']=_0x4a8ed2;logger[_0x02f3('0xb')](_0x02f3('0x30'));return rp(_0x39d6c0)[_0x02f3('0xd')](function(_0x203cca){_0x457bb3[_0x02f3('0x28')]=_0x203cca[_0x02f3('0x31')]['id'];_0x9ae720(_0x457bb3);})[_0x02f3('0x12')](function(_0x35c8b6){logger[_0x02f3('0x1d')]('['+[_0x49279e['toUpperCase']()]+']',_0x35c8b6[_0x02f3('0x13')]);_0x5c658b(_0x35c8b6[_0x02f3('0x13')]);});});}function getTicket(_0x28d083,_0x55d2ca,_0x47f806,_0x3c6817,_0x1d7f67){return function(_0x4d49ec){logger[_0x02f3('0xb')](_0x02f3('0x32'));return new Promise(function(_0x33a860,_0x2aa480){var _0x2607ef=moment();var _0x173b11={'method':_0x02f3('0x2d'),'uri':_0x47f806+_0x02f3('0x33'),'body':{'title':intUtil[_0x02f3('0x34')](_0x3c6817[_0x02f3('0x35')],_0x1d7f67,'\x20'),'description':intUtil[_0x02f3('0x34')](_0x3c6817[_0x02f3('0x36')],_0x1d7f67,'\x0a'),'owner_id':_0x4d49ec[_0x02f3('0x1b')],'creater_id':_0x4d49ec['adminId'],'targetable_id':_0x4d49ec[_0x02f3('0x28')],'targetable_type':_0x02f3('0x37'),'created_at':_0x2607ef[_0x02f3('0x24')](_0x02f3('0x2f')),'due_date':_0x2607ef['add'](0x1e,'m')[_0x02f3('0x24')](_0x02f3('0x2f'))},'json':!![]};_0x173b11['headers']=_0x55d2ca;return rp(_0x173b11)[_0x02f3('0xd')](function(_0x1efc89){_0x4d49ec[_0x02f3('0x38')]=_0x1efc89[_0x02f3('0x39')]['id'];logger[_0x02f3('0xb')]('Task\x20created:',_0x4d49ec[_0x02f3('0x38')]);_0x33a860(_0x4d49ec);})[_0x02f3('0x12')](function(_0x3d84cb){logger['error']('['+[_0x28d083[_0x02f3('0x1e')]()]+']',_0x3d84cb['message']);_0x2aa480(_0x3d84cb['message']);});});};}function emit(_0x49743a,_0x170a62,_0x15cd10){var _0x464925={'uri':_0x49743a+'/contacts/'+_0x15cd10};io['to'](util[_0x02f3('0x24')]('user:%s',_0x170a62))[_0x02f3('0x3a')](_0x02f3('0x3b'),_0x464925);}exports['cs']=function(_0x1c3e43,_0x459306,_0x47cb44,_0x58dab5,_0x319a2e,_0x2f05b8,_0xa6f085,_0x37065b){var _0x2458b0={};var _0x300c0c={'Authorization':_0x02f3('0x3c')+_0x2f05b8[_0x02f3('0x3d')]};_0x2f05b8['remoteUri']=intUtil[_0x02f3('0x3e')](_0x2f05b8[_0x02f3('0x3f')]);_0x2f05b8[_0x02f3('0x40')]=intUtil['stripTrailingSlash'](_0x2f05b8[_0x02f3('0x40')]);var _0x5db4a6=_0x2f05b8['remoteUri'];_0x2458b0[_0x02f3('0xe')]=_0x2f05b8[_0x02f3('0x41')];_0x2458b0[_0x02f3('0x26')]=_0x37065b[_0x02f3('0x42')]()===_0x02f3('0x43')?_0x459306['destcalleridnum']:_0x459306[_0x02f3('0x44')];_0x2458b0[_0x02f3('0x45')]=_0x37065b===_0x02f3('0x46')||_0x37065b===_0x02f3('0x47')?_0x02f3('0x46'):'outbound';if(_0x58dab5){_0x2458b0['agentEmail']=_0x58dab5['email'];}var _0x5ac54c=util[_0x02f3('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f05b8[_0x02f3('0x40')],_0x459306['uniqueid'],md5(_0x459306['uniqueid']));if(_0x319a2e&&_0x319a2e[_0x02f3('0x48')]){logger['info'](_0x02f3('0x49'),_0x02f3('0x4a'));_0x459306['recordingURL']=_0x5ac54c;}else if(_0xa6f085&&_0xa6f085[_0x02f3('0x4b')]&&_0xa6f085[_0x02f3('0x4b')]!==_0x02f3('0x4c')){logger[_0x02f3('0xb')](_0x02f3('0x4d'),_0x02f3('0x4a'));_0x459306['recordingURL']=_0x5ac54c;}else{_0x459306[_0x02f3('0x4e')]='';}return getAdminId(_0x2458b0,_0x37065b,_0x300c0c,_0x5db4a6)['then'](getUser(_0x37065b,_0x300c0c,_0x5db4a6))['then'](getEndUser(_0x37065b,_0x300c0c,_0x5db4a6))[_0x02f3('0xd')](getTicket(_0x37065b,_0x300c0c,_0x5db4a6,_0x47cb44,_0x459306))['then'](function(_0x4871e9){logger[_0x02f3('0xb')](util[_0x02f3('0x24')](_0x02f3('0x4f'),_0x4871e9[_0x02f3('0x38')]));if(_0x37065b!==_0x02f3('0x47')){logger[_0x02f3('0xb')]('['+[_0x37065b[_0x02f3('0x1e')]()]+']',_0x02f3('0x50'));emit(_0x5db4a6,_0x58dab5[_0x02f3('0x51')],_0x4871e9[_0x02f3('0x28')]);}})[_0x02f3('0x12')](function(_0x4bc3c9){logger[_0x02f3('0x1d')]('['+[_0x37065b[_0x02f3('0x1e')]()]+_0x02f3('0x52'),util[_0x02f3('0x53')](_0x4bc3c9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 747d73a..103460c 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 _0xfb91=['./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./desk','./servicenow'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0xfb91,0x1da));var _0x1fb9=function(_0x30e69f,_0x3010ab){_0x30e69f=_0x30e69f-0x0;var _0x5008e4=_0xfb91[_0x30e69f];return _0x5008e4;};'use strict';var _=require(_0x1fb9('0x0'));var util=require(_0x1fb9('0x1'));var zendesk=require(_0x1fb9('0x2'));var salesforce=require(_0x1fb9('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1fb9('0x4'));var zoho=require('./zoho');var desk=require(_0x1fb9('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x1fb9('0x6'));var dynamics365=require(_0x1fb9('0x7'));var freshsales=require('./freshsales');var integrations=[_0x1fb9('0x8'),'salesforce',_0x1fb9('0x9'),_0x1fb9('0xa'),_0x1fb9('0xb'),_0x1fb9('0xc'),_0x1fb9('0xd'),_0x1fb9('0xe'),_0x1fb9('0xf'),_0x1fb9('0x10')];exports[_0x1fb9('0x11')]=function(_0x597df5,_0x21362b,_0x1128f6,_0x3e367d,_0x102e47,_0x5f5a36){if(_0x1128f6){if(_[_0x1fb9('0x12')](integrations,_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]())){try{var _0x356131=null;var _0x3bcae9='';var _0x4d34d6=_0x1128f6[_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]()];if(_0x4d34d6){var _0x5abd95=_0x4d34d6[_0x597df5[_0x1fb9('0x15')]];if(_0x5abd95){var _0x3e7b5f=_[_0x1fb9('0x16')](_0x5abd95[_0x1fb9('0x17')],{'id':parseInt(_0x597df5['data3'],0xa)});if(_0x3e7b5f){if(_0x3e367d){if(_0x102e47&&_0x21362b[_0x1fb9('0x18')]){_0x3bcae9=_0x1fb9('0x18');}else if(_0x21362b[_0x1fb9('0x19')]){_0x3bcae9=_0x1fb9('0x1a');}else{console[_0x1fb9('0x1b')](_0x1fb9('0x1c'),_0x21362b);}}else{_0x3bcae9='unmanaged';}switch(_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]()){case _0x1fb9('0x8'):zendesk[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0x1d'):salesforce[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0x9'):sugarcrm[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xa'):freshdesk[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xb'):zoho[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xc'):desk[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xd'):vtiger[_0x3bcae9](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36);break;case _0x1fb9('0xf'):freshsales['cs'](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36,_0x3bcae9);break;case _0x1fb9('0x10'):servicenow['cs'](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36,_0x3bcae9);break;case _0x1fb9('0xe'):dynamics365['cs'](_0x597df5,_0x21362b,_0x3e7b5f,_0x3e367d,_0x102e47,_0x5abd95,_0x5f5a36,_0x3bcae9);break;default:console['log'](_0x1fb9('0x1e'));}}else{_0x356131=require(_0x1fb9('0x1f'))(_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]());_0x356131[_0x1fb9('0x20')](_0x1fb9('0x21'),util[_0x1fb9('0x22')](_0x1fb9('0x23'),_0x597df5['data1']['toLowerCase'](),_0x597df5['data3']));}}else{_0x356131=require('../../../../config/logger')(_0x597df5[_0x1fb9('0x13')][_0x1fb9('0x14')]());_0x356131[_0x1fb9('0x20')](_0x1fb9('0x21'),util[_0x1fb9('0x22')](_0x1fb9('0x24'),_0x597df5[_0x1fb9('0x13')]['toLowerCase'](),_0x597df5[_0x1fb9('0x15')]));}}else{}}catch(_0x32fc0d){console['error'](_0x32fc0d);}}}}; \ No newline at end of file +var _0x543d=['salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','log','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./servicenow','./freshsales','zendesk'];(function(_0x4a4378,_0x539894){var _0x2fd1bb=function(_0xadf956){while(--_0xadf956){_0x4a4378['push'](_0x4a4378['shift']());}};_0x2fd1bb(++_0x539894);}(_0x543d,0x173));var _0xd543=function(_0x253d2b,_0x49a0fb){_0x253d2b=_0x253d2b-0x0;var _0x3ce8bd=_0x543d[_0x253d2b];return _0x3ce8bd;};'use strict';var _=require('lodash');var util=require(_0xd543('0x0'));var zendesk=require(_0xd543('0x1'));var salesforce=require(_0xd543('0x2'));var sugarcrm=require(_0xd543('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xd543('0x4'));var desk=require(_0xd543('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xd543('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0xd543('0x7'));var integrations=[_0xd543('0x8'),_0xd543('0x9'),_0xd543('0xa'),_0xd543('0xb'),_0xd543('0xc'),_0xd543('0xd'),_0xd543('0xe'),_0xd543('0xf'),'freshsales',_0xd543('0x10')];exports[_0xd543('0x11')]=function(_0x5f854a,_0x584fb7,_0x528df8,_0x1b8ca4,_0x557a1a,_0x589f48){if(_0x528df8){if(_[_0xd543('0x12')](integrations,_0x5f854a[_0xd543('0x13')][_0xd543('0x14')]())){try{var _0x40c4d6=null;var _0xafe0e0='';var _0x1efa54=_0x528df8[_0x5f854a[_0xd543('0x13')]['toLowerCase']()];if(_0x1efa54){var _0x4b8bb0=_0x1efa54[_0x5f854a[_0xd543('0x15')]];if(_0x4b8bb0){var _0x3eb866=_[_0xd543('0x16')](_0x4b8bb0[_0xd543('0x17')],{'id':parseInt(_0x5f854a[_0xd543('0x18')],0xa)});if(_0x3eb866){if(_0x1b8ca4){if(_0x557a1a&&_0x584fb7['queue']){_0xafe0e0=_0xd543('0x19');}else if(_0x584fb7[_0xd543('0x1a')]){_0xafe0e0=_0xd543('0x1b');}else{console['log'](_0xd543('0x1c'),_0x584fb7);}}else{_0xafe0e0=_0xd543('0x1d');}switch(_0x5f854a[_0xd543('0x13')][_0xd543('0x14')]()){case _0xd543('0x8'):zendesk[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case _0xd543('0x9'):salesforce[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case'sugarcrm':sugarcrm[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case _0xd543('0xb'):freshdesk[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case'zoho':zoho[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case _0xd543('0xd'):desk[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case _0xd543('0xe'):vtiger[_0xafe0e0](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48);break;case'freshsales':freshsales['cs'](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48,_0xafe0e0);break;case _0xd543('0x10'):servicenow['cs'](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48,_0xafe0e0);break;case _0xd543('0xf'):dynamics365['cs'](_0x5f854a,_0x584fb7,_0x3eb866,_0x1b8ca4,_0x557a1a,_0x4b8bb0,_0x589f48,_0xafe0e0);break;default:console[_0xd543('0x1e')](_0xd543('0x1f'));}}else{_0x40c4d6=require('../../../../config/logger')(_0x5f854a[_0xd543('0x13')][_0xd543('0x14')]());_0x40c4d6[_0xd543('0x20')](_0xd543('0x21'),util[_0xd543('0x22')](_0xd543('0x23'),_0x5f854a[_0xd543('0x13')][_0xd543('0x14')](),_0x5f854a[_0xd543('0x18')]));}}else{_0x40c4d6=require(_0xd543('0x24'))(_0x5f854a[_0xd543('0x13')][_0xd543('0x14')]());_0x40c4d6[_0xd543('0x20')](_0xd543('0x21'),util[_0xd543('0x22')](_0xd543('0x25'),_0x5f854a[_0xd543('0x13')][_0xd543('0x14')](),_0x5f854a[_0xd543('0x15')]));}}else{}}catch(_0x33e74e){console['error'](_0x33e74e);}}}}; \ 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 a35b0ba..8933a13 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 _0x93cf=['WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','length','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','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','find','account_contact_lead','additionalSearchAccount','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','Fields','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x93cf,0xe2));var _0xf93c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x93cf[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf93c('0x0'));var rp=require(_0xf93c('0x1'));var moment=require(_0xf93c('0x2'));var BPromise=require(_0xf93c('0x3'));var md5=require('md5');var jsforce=require(_0xf93c('0x4'));var util=require('util');var Redis=require(_0xf93c('0x5'));var intUtil=require(_0xf93c('0x6'));var config=require(_0xf93c('0x7'));var logger=require('../../../../config/logger')(_0xf93c('0x8'));config[_0xf93c('0x9')]=_[_0xf93c('0xa')](config[_0xf93c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf93c('0xb'))(new Redis(config[_0xf93c('0x9')]));function emit(_0x4ec137,_0x51fc42,_0x42975f){io['to'](_0x4ec137)['emit'](_0x51fc42,_0x42975f);}function getTicket(_0x5c3e94,_0xe91a82,_0x307e0e,_0x2751e7,_0x5b9d60,_0x23845c,_0x1417b0,_0xfd43f6){var _0x1c7d83=Object[_0xf93c('0xc')]({},{'OwnerId':_0xe91a82['id'],'Subject':intUtil[_0xf93c('0xd')](_0x2751e7['Subjects'],_0x5b9d60,'\x20'),'Description':intUtil[_0xf93c('0xd')](_0x2751e7[_0xf93c('0xe')],_0x5b9d60,'\x0a')},getCustomFields(_0x23845c,_0x5b9d60));if(_0x307e0e){if(_0x2751e7[_0xf93c('0xf')]===_0xf93c('0x10')){_0x1c7d83[_0xf93c('0x11')]=moment[_0xf93c('0x12')]();_0x1c7d83[_0xf93c('0x13')]=![];_0x1c7d83[_0xf93c('0x14')]=![];if(_0x307e0e[_0xf93c('0x15')]===_0xf93c('0x16')||_0x307e0e[_0xf93c('0x15')]===_0xf93c('0x17')){_0x1c7d83[_0xf93c('0x18')]=_0x307e0e['id'];}else if(_0x307e0e[_0xf93c('0x15')]===_0xf93c('0x19')){_0x1c7d83['WhatId']=_0x307e0e['id'];}}else if(_0x2751e7[_0xf93c('0xf')]===_0xf93c('0x1a')){if(_0x307e0e[_0xf93c('0x15')]==='contact'){_0x1c7d83[_0xf93c('0x1b')]=_0x307e0e['id'];}else if(_0x307e0e[_0xf93c('0x15')]==='account'){_0x1c7d83[_0xf93c('0x1c')]=_0x307e0e['id'];}else if(_0x307e0e['endUserType']==='lead'&&_0x2751e7['leadId']){_0x1c7d83[_0x2751e7[_0xf93c('0x1d')]]=_0x307e0e['id'];}else{logger[_0xf93c('0x1e')](_0xf93c('0x1f'));}}}return _0x1417b0[_0xf93c('0x20')](_0x2751e7['ticketType'])[_0xf93c('0x21')](_0x1c7d83);}function getUser(_0x2b1a64,_0x234174,_0x97625f){if(!_[_0xf93c('0x22')](_0x234174)&&intUtil[_0xf93c('0x23')](_0x234174)){var _0x14587e={'Email':_0x234174};var _0x29faa7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x97625f[_0xf93c('0x20')](_0xf93c('0x24'))['find'](_0x14587e,_0x29faa7)[_0xf93c('0x25')]()[_0xf93c('0x26')](function(_0x334840){if(_0x334840[_0xf93c('0x27')]){var _0x3314df=_['find'](_0x334840,function(_0x5d6268){return _0x5d6268['Email']===_0x234174;});if(_0x3314df){logger[_0xf93c('0x1e')](_0xf93c('0x28'),_0x234174);return BPromise[_0xf93c('0x29')]({'id':_0x3314df['Id'],'name':_0x3314df[_0xf93c('0x2a')]});}}else{logger[_0xf93c('0x1e')](_0xf93c('0x2b'),_0x234174);return _0x97625f[_0xf93c('0x2c')]()[_0xf93c('0x26')](function(_0x9dacaa){return BPromise['resolve']({'id':_0x9dacaa[_0xf93c('0x2d')],'name':_0x9dacaa['display_name']});});}});}else{logger[_0xf93c('0x1e')](_0xf93c('0x2b'),_0x234174);return _0x97625f[_0xf93c('0x2c')]()['then'](function(_0x2802c6){return BPromise['resolve']({'id':_0x2802c6[_0xf93c('0x2d')],'name':_0x2802c6[_0xf93c('0x2e')]});});}}function getEndUser(_0x40c0cf,_0x16773c,_0x4ba091,_0x5398ad,_0x1039a9){var _0x174cd6={'$or':{'Phone':_0x5398ad}};var _0x4b7fc5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf93c('0x29')]()[_0xf93c('0x26')](function(){logger['info'](_0xf93c('0x2f'),_0x5398ad,_0x16773c[_0xf93c('0x30')]);switch(_0x16773c[_0xf93c('0x30')]){case'contact_lead':var _0x17b5e5=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x32')]){var _0x33458b={};_0x33458b[_0x16773c['additionalSearchContact']]=_0x5398ad;_[_0xf93c('0x33')](_0x17b5e5['$or'],_0x33458b);}return _0x1039a9['sobject'](_0xf93c('0x34'))['find'](_0x17b5e5,_0x4b7fc5)[_0xf93c('0x25')]()['then'](function(_0x1e6d64){if(_0x1e6d64&&_0x1e6d64[_0xf93c('0x27')]){return _0x1e6d64;}else{var _0x4e7d00=_['cloneDeep'](_0x174cd6);if(_0x16773c[_0xf93c('0x35')]){var _0x28b669={};_0x28b669[_0x16773c[_0xf93c('0x35')]]=_0x5398ad;_[_0xf93c('0x33')](_0x4e7d00[_0xf93c('0x36')],_0x28b669);}return _0x1039a9[_0xf93c('0x20')]('Lead')[_0xf93c('0x37')](_0x4e7d00,_0x4b7fc5);}});case _0xf93c('0x38'):var _0x411c2b=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x39')]){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x39')]]=_0x5398ad;_[_0xf93c('0x33')](_0x411c2b['$or'],_0x33458b);}return _0x1039a9[_0xf93c('0x20')]('Account')['find'](_0x411c2b,_0x4b7fc5)[_0xf93c('0x25')]()[_0xf93c('0x26')](function(_0x1a4315){if(_0x1a4315&&_0x1a4315[_0xf93c('0x27')]){return _0x1a4315;}else{var _0x46b4ed=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x32')]){var _0x5c81ca={};_0x5c81ca[_0x16773c[_0xf93c('0x32')]]=_0x5398ad;_[_0xf93c('0x33')](_0x46b4ed['$or'],_0x5c81ca);}return _0x1039a9[_0xf93c('0x20')](_0xf93c('0x34'))['find'](_0x46b4ed,_0x4b7fc5)['then'](function(_0x489e92){if(_0x489e92&&_0x489e92['length']){return _0x489e92;}else{var _0x35cdd6=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x35')]){var _0x35714a={};_0x35714a[_0x16773c['additionalSearchLead']]=_0x5398ad;_[_0xf93c('0x33')](_0x35cdd6[_0xf93c('0x36')],_0x35714a);}return _0x1039a9[_0xf93c('0x20')]('Lead')['find'](_0x35cdd6,_0x4b7fc5);}});}});case _0xf93c('0x16'):var _0x17b5e5=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x32')]){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x32')]]=_0x5398ad;_[_0xf93c('0x33')](_0x17b5e5[_0xf93c('0x36')],_0x33458b);}return _0x1039a9['sobject'](_0xf93c('0x34'))['find'](_0x17b5e5,_0x4b7fc5)['execute']();case _0xf93c('0x17'):var _0x19fb69=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c['additionalSearchLead']){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x35')]]=_0x5398ad;_[_0xf93c('0x33')](_0x19fb69['$or'],_0x33458b);}return _0x1039a9[_0xf93c('0x20')]('Lead')[_0xf93c('0x37')](_0x19fb69,_0x4b7fc5);case'account':var _0x411c2b=_[_0xf93c('0x31')](_0x174cd6);if(_0x16773c[_0xf93c('0x39')]){var _0x33458b={};_0x33458b[_0x16773c[_0xf93c('0x39')]]=_0x5398ad;_[_0xf93c('0x33')](_0x411c2b['$or'],_0x33458b);}return _0x1039a9['sobject']('Account')[_0xf93c('0x37')](_0x411c2b,_0x4b7fc5);default:return null;}})['then'](function(_0x4d41ab){if(_0x4d41ab&&_0x4d41ab[_0xf93c('0x27')]){var _0x3cb9d0=_[_0xf93c('0x3a')](_0x4d41ab);if(_0x3cb9d0){return BPromise['resolve']({'id':_0x3cb9d0['Id'],'name':_0x3cb9d0['Name'],'phone':_0x3cb9d0[_0xf93c('0x3b')],'endUserType':_0x3cb9d0[_0xf93c('0x3c')]['type'][_0xf93c('0x3d')]()});}}})['then'](function(_0x2bbd7f){if(_0x2bbd7f){logger[_0xf93c('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2bbd7f[_0xf93c('0x15')],_0x5398ad);return BPromise['resolve'](_0x2bbd7f);}else{logger[_0xf93c('0x1e')](_0xf93c('0x3e'),_0x5398ad);var _0x5eb593={'Phone':_0x5398ad};if(_0x16773c[_0xf93c('0x3f')]){if(_0x16773c[_0xf93c('0x3f')]===_0xf93c('0x16')){logger[_0xf93c('0x1e')](_0xf93c('0x40'),_0x5398ad,_0x16773c[_0xf93c('0x3f')]);_0x5eb593[_0xf93c('0x41')]=_0x4ba091!==_0xf93c('0x42')?_0x4ba091:util[_0xf93c('0x43')](_0xf93c('0x44'),_0x5398ad);}else if(_0x16773c['moduleCreate']===_0xf93c('0x17')){logger[_0xf93c('0x1e')](_0xf93c('0x40'),_0x5398ad,_0x16773c[_0xf93c('0x3f')]);_0x5eb593['LastName']=_0x4ba091!==_0xf93c('0x42')?_0x4ba091:util[_0xf93c('0x43')](_0xf93c('0x44'),_0x5398ad);_0x5eb593[_0xf93c('0x45')]=_0xf93c('0x46');}else if(_0x16773c[_0xf93c('0x3f')]==='account'){logger[_0xf93c('0x1e')](_0xf93c('0x40'),_0x5398ad,_0x16773c[_0xf93c('0x3f')]);_0x5eb593[_0xf93c('0x2a')]=_0x4ba091!==_0xf93c('0x42')?_0x4ba091:util['format'](_0xf93c('0x44'),_0x5398ad);}else{return null;}}return _0x1039a9[_0xf93c('0x20')](_['upperFirst'](_0x16773c['moduleCreate']))['create'](_0x5eb593)[_0xf93c('0x26')](function(_0x416a88){return BPromise[_0xf93c('0x29')]({'id':_0x416a88['id'],'endUserType':_0x16773c['moduleCreate']});});}});}function getCustomFields(_0x19b564,_0x537737){var _0x56e436={};if(_0x19b564[_0xf93c('0x27')]>0x0){_[_0xf93c('0x47')](_0x19b564,function(_0x5ba48a){if(_[_0xf93c('0x48')](['string',_0xf93c('0x49')],_0x5ba48a['type'])&&_0x5ba48a[_0xf93c('0x4a')]){_0x56e436[_0x5ba48a[_0xf93c('0x4a')]]=_0x5ba48a[_0xf93c('0x4b')]['toString']();}else if(_0x5ba48a[_0xf93c('0x4c')]===_0xf93c('0x4d')&&_0x5ba48a[_0xf93c('0x4e')]&&_0x5ba48a[_0xf93c('0x4a')]){_0x537737[_0x5ba48a['variableName']]&&(_0x56e436[_0x5ba48a[_0xf93c('0x4a')]]=_0x537737[_0x5ba48a['variableName']][_0xf93c('0x4f')]());}else if(_0x5ba48a[_0xf93c('0x4c')]===_0xf93c('0x50')&&_0x5ba48a[_0xf93c('0x51')]&&_0x5ba48a[_0xf93c('0x51')][_0xf93c('0x52')]&&_0x5ba48a[_0xf93c('0x4a')]){_0x537737[_0x5ba48a[_0xf93c('0x51')]['name'][_0xf93c('0x3d')]()]&&(_0x56e436[_0x5ba48a[_0xf93c('0x4a')]]=_0x537737[_0x5ba48a['Variable'][_0xf93c('0x52')][_0xf93c('0x3d')]()][_0xf93c('0x4f')]());}});}return _0x56e436;}function getConnection(_0x18e42e){var _0x3050ca=_0x18e42e[_0xf93c('0x53')]['concat'](_0x18e42e[_0xf93c('0x54')]);var _0x53a1c1=new jsforce[(_0xf93c('0x55'))]({'oauth2':{'loginUrl':_0x18e42e[_0xf93c('0x56')]||_0xf93c('0x57'),'clientId':_0x18e42e['clientId'],'clientSecret':_0x18e42e[_0xf93c('0x58')]}});return _0x53a1c1['login'](_0x18e42e[_0xf93c('0x59')],_0x3050ca)[_0xf93c('0x26')](function(){logger[_0xf93c('0x1e')](_0xf93c('0x5a'));return _0x53a1c1;});}exports[_0xf93c('0x5b')]=function(_0x42de91,_0x3303da,_0x31b0f6,_0x313cb8,_0x913ec7,_0xc31f9f){var _0x346236,_0xd0f92e,_0x548814,_0x4ab638;_0xc31f9f['serverUrl']=intUtil[_0xf93c('0x5c')](_0xc31f9f['serverUrl']);_0xc31f9f[_0xf93c('0x56')]=intUtil[_0xf93c('0x5c')](_0xc31f9f[_0xf93c('0x56')]);if(_0x913ec7&&_0x913ec7[_0xf93c('0x5d')]){logger[_0xf93c('0x1e')]('[QUEUE]',_0xf93c('0x5e'));_0x3303da[_0xf93c('0x5f')]=util[_0xf93c('0x43')](_0xf93c('0x60'),_0xc31f9f[_0xf93c('0x61')],_0x3303da[_0xf93c('0x62')],md5(_0x3303da['uniqueid']));}else{_0x3303da[_0xf93c('0x5f')]='';}return getConnection(_0xc31f9f)[_0xf93c('0x26')](function(_0x27a452){_0x4ab638=_0x27a452;return getUser(_0xc31f9f,_0x313cb8[_0xf93c('0x63')],_0x4ab638);})['then'](function(_0x248681){_0x346236=_0x248681;return getEndUser(_0xc31f9f,_0x31b0f6,_0x3303da['calleridname'],_0x3303da[_0xf93c('0x64')],_0x4ab638);})[_0xf93c('0x26')](function(_0xad0ffe){_0xd0f92e=_0xad0ffe;return getTicket(_0xc31f9f,_0x346236,_0xd0f92e,_0x31b0f6,_0x3303da,_0x31b0f6['Fields'],_0x4ab638,_0xf93c('0x5b'));})[_0xf93c('0x26')](function(_0x15a5db){_0x548814=_0x15a5db;logger[_0xf93c('0x1e')](_0xf93c('0x65'),_0x548814['id']);logger[_0xf93c('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x548814['id'],_0x313cb8[_0xf93c('0x52')],_0xc31f9f[_0xf93c('0x4c')]);switch(_0xc31f9f[_0xf93c('0x4c')]){case _0xf93c('0x66'):emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x313cb8[_0xf93c('0x52')]),_0xf93c('0x68'),{'recordId':_0x548814['id']});break;case _0xf93c('0x69'):emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x313cb8[_0xf93c('0x52')]),_0xf93c('0x6a'),{'uri':util[_0xf93c('0x43')](_0xf93c('0x6b'),_0x4ab638[_0xf93c('0x6c')],_0x548814['id'])});break;default:logger[_0xf93c('0x6d')](_0xf93c('0x6e'));}})[_0xf93c('0x6f')](function(_0x59b945){logger[_0xf93c('0x6d')](_0xf93c('0x70'),_0x59b945);});};exports[_0xf93c('0x71')]=function(_0x316608,_0x59b3d3,_0x4d488a,_0x1b5023,_0x3aa766,_0x6e083a,_0x36c10c){var _0xf7ac30,_0x428931,_0x5f698f,_0xa1fc14;_0x6e083a[_0xf93c('0x61')]=intUtil['stripTrailingSlash'](_0x6e083a[_0xf93c('0x61')]);_0x6e083a[_0xf93c('0x56')]=intUtil[_0xf93c('0x5c')](_0x6e083a[_0xf93c('0x56')]);if(_0x36c10c&&_0x36c10c[_0xf93c('0x72')]&&_0x36c10c[_0xf93c('0x72')]!==_0xf93c('0x73')){logger[_0xf93c('0x1e')](_0xf93c('0x74'),_0xf93c('0x5e'));_0x59b3d3[_0xf93c('0x5f')]=util[_0xf93c('0x43')](_0xf93c('0x60'),_0x6e083a['serverUrl'],_0x59b3d3[_0xf93c('0x62')],md5(_0x59b3d3[_0xf93c('0x62')]));}return getConnection(_0x6e083a)[_0xf93c('0x26')](function(_0x5ca51e){_0xa1fc14=_0x5ca51e;return getUser(_0x6e083a,_0x1b5023[_0xf93c('0x63')],_0xa1fc14);})['then'](function(_0x2a1229){_0xf7ac30=_0x2a1229;return getEndUser(_0x6e083a,_0x4d488a,_0x59b3d3[_0xf93c('0x75')],_0x59b3d3[_0xf93c('0x76')],_0xa1fc14);})['then'](function(_0x492cb8){_0x428931=_0x492cb8;return getTicket(_0x6e083a,_0xf7ac30,_0x428931,_0x4d488a,_0x59b3d3,_0x4d488a['Fields'],_0xa1fc14,_0xf93c('0x71'));})[_0xf93c('0x26')](function(_0x3a3fae){_0x5f698f=_0x3a3fae;logger[_0xf93c('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5f698f['id']);logger[_0xf93c('0x1e')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5f698f['id'],_0x1b5023['name'],_0x6e083a['type']);switch(_0x6e083a[_0xf93c('0x4c')]){case'integrationTab':emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x1b5023[_0xf93c('0x52')]),_0xf93c('0x68'),{'recordId':_0x5f698f['id']});break;case _0xf93c('0x69'):emit(util[_0xf93c('0x43')](_0xf93c('0x67'),_0x1b5023[_0xf93c('0x52')]),_0xf93c('0x6a'),{'uri':util[_0xf93c('0x43')]('%s/%s/e',_0xa1fc14[_0xf93c('0x6c')],_0x5f698f['id'])});break;default:logger[_0xf93c('0x6d')](_0xf93c('0x74'),_0xf93c('0x77'));}})[_0xf93c('0x6f')](function(_0x222238){logger['error'](_0xf93c('0x74'),_0x222238);});};exports['unmanaged']=function(_0x4b229b,_0x2538ae,_0x19479c,_0x46ceee,_0x1dc9c1,_0x4fde60){var _0x1048aa,_0x42f260,_0x3004e5,_0x53155a;_0x4fde60[_0xf93c('0x61')]=intUtil['stripTrailingSlash'](_0x4fde60['serverUrl']);_0x4fde60['remoteUri']=intUtil['stripTrailingSlash'](_0x4fde60[_0xf93c('0x56')]);if(_0x1dc9c1&&_0x1dc9c1[_0xf93c('0x5d')]){logger[_0xf93c('0x1e')]('['+_0x2538ae['lastevent'][_0xf93c('0x78')]()+']',_0xf93c('0x5e'));_0x2538ae['recordingURL']=util[_0xf93c('0x43')](_0xf93c('0x60'),_0x4fde60[_0xf93c('0x61')],_0x2538ae[_0xf93c('0x62')],md5(_0x2538ae[_0xf93c('0x62')]));}else{_0x2538ae[_0xf93c('0x5f')]='';}return getConnection(_0x4fde60)[_0xf93c('0x26')](function(_0x4be46a){_0x53155a=_0x4be46a;if(!_['isNil'](_0x46ceee)){return getUser(_0x4fde60,_0x46ceee['name'],_0x53155a);}else{return getUser(_0x4fde60,null,_0x53155a);}})[_0xf93c('0x26')](function(_0x3d8958){_0x1048aa=_0x3d8958;return getEndUser(_0x4fde60,_0x19479c,_0x2538ae['calleridname'],_0x2538ae['calleridnum'],_0x53155a);})[_0xf93c('0x26')](function(_0x57b784){_0x42f260=_0x57b784;return getTicket(_0x4fde60,_0x1048aa,_0x42f260,_0x19479c,_0x2538ae,_0x19479c[_0xf93c('0x79')],_0x53155a);})[_0xf93c('0x26')](function(_0x37443f){_0x3004e5=_0x37443f;logger[_0xf93c('0x1e')]('['+_0x2538ae[_0xf93c('0x7a')][_0xf93c('0x78')]()+_0xf93c('0x7b'),_0x3004e5['id']);logger[_0xf93c('0x1e')]('['+_0x2538ae[_0xf93c('0x7a')][_0xf93c('0x78')]()+_0xf93c('0x7c'),_0x4fde60['type']);})['catch'](function(_0x2379cf){logger['error']('['+_0x2538ae[_0xf93c('0x7a')]['toUpperCase']()+']',_0x2379cf);});}; \ No newline at end of file +var _0x91c8=['leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Email','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','account_contact_lead','additionalSearchAccount','Lead','lead','first','Name','Phone','attributes','type','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','LastName','','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','error','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','getString','Subjects','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','Case','ContactId','account','AccountId'];(function(_0x2f2810,_0x4d1cc9){var _0x251e9e=function(_0x5ba66a){while(--_0x5ba66a){_0x2f2810['push'](_0x2f2810['shift']());}};_0x251e9e(++_0x4d1cc9);}(_0x91c8,0x67));var _0x891c=function(_0x5c295d,_0xfb0257){_0x5c295d=_0x5c295d-0x0;var _0x6bbb98=_0x91c8[_0x5c295d];return _0x6bbb98;};'use strict';var _=require(_0x891c('0x0'));var rp=require(_0x891c('0x1'));var moment=require(_0x891c('0x2'));var BPromise=require(_0x891c('0x3'));var md5=require(_0x891c('0x4'));var jsforce=require('jsforce');var util=require(_0x891c('0x5'));var Redis=require('ioredis');var intUtil=require(_0x891c('0x6'));var config=require(_0x891c('0x7'));var logger=require(_0x891c('0x8'))('salesforce');config[_0x891c('0x9')]=_['defaults'](config['redis'],{'host':_0x891c('0xa'),'port':0x18eb});var io=require(_0x891c('0xb'))(new Redis(config[_0x891c('0x9')]));function emit(_0x3b6227,_0x2e2fdd,_0x32e056){io['to'](_0x3b6227)[_0x891c('0xc')](_0x2e2fdd,_0x32e056);}function getTicket(_0x47e408,_0x3f6487,_0x336269,_0x175ae8,_0x4e23fd,_0x48b5ee,_0x1d3042,_0x5c2413){var _0xd96bb4=Object['assign']({},{'OwnerId':_0x3f6487['id'],'Subject':intUtil[_0x891c('0xd')](_0x175ae8[_0x891c('0xe')],_0x4e23fd,'\x20'),'Description':intUtil[_0x891c('0xd')](_0x175ae8['Descriptions'],_0x4e23fd,'\x0a')},getCustomFields(_0x48b5ee,_0x4e23fd));if(_0x336269){if(_0x175ae8[_0x891c('0xf')]===_0x891c('0x10')){_0xd96bb4['ActivityDate']=moment[_0x891c('0x11')]();_0xd96bb4[_0x891c('0x12')]=![];_0xd96bb4[_0x891c('0x13')]=![];if(_0x336269[_0x891c('0x14')]===_0x891c('0x15')||_0x336269[_0x891c('0x14')]==='lead'){_0xd96bb4[_0x891c('0x16')]=_0x336269['id'];}else if(_0x336269[_0x891c('0x14')]==='account'){_0xd96bb4['WhatId']=_0x336269['id'];}}else if(_0x175ae8[_0x891c('0xf')]===_0x891c('0x17')){if(_0x336269[_0x891c('0x14')]==='contact'){_0xd96bb4[_0x891c('0x18')]=_0x336269['id'];}else if(_0x336269[_0x891c('0x14')]===_0x891c('0x19')){_0xd96bb4[_0x891c('0x1a')]=_0x336269['id'];}else if(_0x336269['endUserType']==='lead'&&_0x175ae8[_0x891c('0x1b')]){_0xd96bb4[_0x175ae8['leadId']]=_0x336269['id'];}else{logger['info'](_0x891c('0x1c'));}}}return _0x1d3042[_0x891c('0x1d')](_0x175ae8[_0x891c('0xf')])[_0x891c('0x1e')](_0xd96bb4);}function getUser(_0x1dc716,_0xa84ec0,_0x974281){if(!_[_0x891c('0x1f')](_0xa84ec0)&&intUtil[_0x891c('0x20')](_0xa84ec0)){var _0x553cbf={'Email':_0xa84ec0};var _0x2fdb39={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x974281[_0x891c('0x1d')](_0x891c('0x21'))[_0x891c('0x22')](_0x553cbf,_0x2fdb39)[_0x891c('0x23')]()['then'](function(_0x533b7f){if(_0x533b7f[_0x891c('0x24')]){var _0x3b197c=_[_0x891c('0x22')](_0x533b7f,function(_0x882319){return _0x882319[_0x891c('0x25')]===_0xa84ec0;});if(_0x3b197c){logger[_0x891c('0x26')]('Agent\x20%s\x20found.',_0xa84ec0);return BPromise['resolve']({'id':_0x3b197c['Id'],'name':_0x3b197c['Name']});}}else{logger['info'](_0x891c('0x27'),_0xa84ec0);return _0x974281[_0x891c('0x28')]()[_0x891c('0x29')](function(_0x2da812){return BPromise['resolve']({'id':_0x2da812[_0x891c('0x2a')],'name':_0x2da812[_0x891c('0x2b')]});});}});}else{logger[_0x891c('0x26')](_0x891c('0x27'),_0xa84ec0);return _0x974281['identity']()['then'](function(_0x4a41cc){return BPromise[_0x891c('0x2c')]({'id':_0x4a41cc[_0x891c('0x2a')],'name':_0x4a41cc['display_name']});});}}function getEndUser(_0x4a2a48,_0x33c8e2,_0x46f2a7,_0x222a86,_0x1d2a28){var _0x2905ed={'$or':{'Phone':_0x222a86}};var _0x3e3e0d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x891c('0x2c')]()['then'](function(){logger[_0x891c('0x26')](_0x891c('0x2d'),_0x222a86,_0x33c8e2[_0x891c('0x2e')]);switch(_0x33c8e2[_0x891c('0x2e')]){case _0x891c('0x2f'):var _0x3394da=_[_0x891c('0x30')](_0x2905ed);if(_0x33c8e2[_0x891c('0x31')]){var _0x12aff9={};_0x12aff9[_0x33c8e2[_0x891c('0x31')]]=_0x222a86;_[_0x891c('0x32')](_0x3394da['$or'],_0x12aff9);}return _0x1d2a28[_0x891c('0x1d')](_0x891c('0x33'))[_0x891c('0x22')](_0x3394da,_0x3e3e0d)['execute']()['then'](function(_0x57bff0){if(_0x57bff0&&_0x57bff0[_0x891c('0x24')]){return _0x57bff0;}else{var _0x872429=_[_0x891c('0x30')](_0x2905ed);if(_0x33c8e2['additionalSearchLead']){var _0xaac347={};_0xaac347[_0x33c8e2[_0x891c('0x34')]]=_0x222a86;_[_0x891c('0x32')](_0x872429[_0x891c('0x35')],_0xaac347);}return _0x1d2a28['sobject']('Lead')[_0x891c('0x22')](_0x872429,_0x3e3e0d);}});case _0x891c('0x36'):var _0x974766=_['cloneDeep'](_0x2905ed);if(_0x33c8e2[_0x891c('0x37')]){var _0x12aff9={};_0x12aff9[_0x33c8e2[_0x891c('0x37')]]=_0x222a86;_[_0x891c('0x32')](_0x974766['$or'],_0x12aff9);}return _0x1d2a28[_0x891c('0x1d')]('Account')[_0x891c('0x22')](_0x974766,_0x3e3e0d)[_0x891c('0x23')]()['then'](function(_0x362d52){if(_0x362d52&&_0x362d52[_0x891c('0x24')]){return _0x362d52;}else{var _0x1d1e09=_[_0x891c('0x30')](_0x2905ed);if(_0x33c8e2['additionalSearchContact']){var _0x518a8f={};_0x518a8f[_0x33c8e2['additionalSearchContact']]=_0x222a86;_[_0x891c('0x32')](_0x1d1e09[_0x891c('0x35')],_0x518a8f);}return _0x1d2a28[_0x891c('0x1d')]('Contact')[_0x891c('0x22')](_0x1d1e09,_0x3e3e0d)[_0x891c('0x29')](function(_0x4538d0){if(_0x4538d0&&_0x4538d0[_0x891c('0x24')]){return _0x4538d0;}else{var _0x109806=_[_0x891c('0x30')](_0x2905ed);if(_0x33c8e2['additionalSearchLead']){var _0x174e59={};_0x174e59[_0x33c8e2[_0x891c('0x34')]]=_0x222a86;_[_0x891c('0x32')](_0x109806[_0x891c('0x35')],_0x174e59);}return _0x1d2a28[_0x891c('0x1d')](_0x891c('0x38'))[_0x891c('0x22')](_0x109806,_0x3e3e0d);}});}});case'contact':var _0x3394da=_['cloneDeep'](_0x2905ed);if(_0x33c8e2[_0x891c('0x31')]){var _0x12aff9={};_0x12aff9[_0x33c8e2[_0x891c('0x31')]]=_0x222a86;_[_0x891c('0x32')](_0x3394da[_0x891c('0x35')],_0x12aff9);}return _0x1d2a28[_0x891c('0x1d')](_0x891c('0x33'))[_0x891c('0x22')](_0x3394da,_0x3e3e0d)[_0x891c('0x23')]();case _0x891c('0x39'):var _0x4f338a=_[_0x891c('0x30')](_0x2905ed);if(_0x33c8e2['additionalSearchLead']){var _0x12aff9={};_0x12aff9[_0x33c8e2['additionalSearchLead']]=_0x222a86;_[_0x891c('0x32')](_0x4f338a[_0x891c('0x35')],_0x12aff9);}return _0x1d2a28[_0x891c('0x1d')](_0x891c('0x38'))[_0x891c('0x22')](_0x4f338a,_0x3e3e0d);case _0x891c('0x19'):var _0x974766=_['cloneDeep'](_0x2905ed);if(_0x33c8e2[_0x891c('0x37')]){var _0x12aff9={};_0x12aff9[_0x33c8e2['additionalSearchAccount']]=_0x222a86;_['merge'](_0x974766['$or'],_0x12aff9);}return _0x1d2a28[_0x891c('0x1d')]('Account')[_0x891c('0x22')](_0x974766,_0x3e3e0d);default:return null;}})[_0x891c('0x29')](function(_0x338fac){if(_0x338fac&&_0x338fac[_0x891c('0x24')]){var _0x528123=_[_0x891c('0x3a')](_0x338fac);if(_0x528123){return BPromise[_0x891c('0x2c')]({'id':_0x528123['Id'],'name':_0x528123[_0x891c('0x3b')],'phone':_0x528123[_0x891c('0x3c')],'endUserType':_0x528123[_0x891c('0x3d')][_0x891c('0x3e')]['toLowerCase']()});}}})['then'](function(_0x13c4f5){if(_0x13c4f5){logger[_0x891c('0x26')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x13c4f5[_0x891c('0x14')],_0x222a86);return BPromise[_0x891c('0x2c')](_0x13c4f5);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x222a86);var _0x515e34={'Phone':_0x222a86};if(_0x33c8e2[_0x891c('0x3f')]){if(_0x33c8e2[_0x891c('0x3f')]===_0x891c('0x15')){logger[_0x891c('0x26')](_0x891c('0x40'),_0x222a86,_0x33c8e2[_0x891c('0x3f')]);_0x515e34['LastName']=_0x46f2a7!==''?_0x46f2a7:util[_0x891c('0x41')](_0x891c('0x42'),_0x222a86);}else if(_0x33c8e2[_0x891c('0x3f')]==='lead'){logger[_0x891c('0x26')](_0x891c('0x40'),_0x222a86,_0x33c8e2[_0x891c('0x3f')]);_0x515e34[_0x891c('0x43')]=_0x46f2a7!==_0x891c('0x44')?_0x46f2a7:util[_0x891c('0x41')]('Caller\x20-\x20%s',_0x222a86);_0x515e34['Company']='No\x20Company';}else if(_0x33c8e2[_0x891c('0x3f')]==='account'){logger[_0x891c('0x26')](_0x891c('0x40'),_0x222a86,_0x33c8e2['moduleCreate']);_0x515e34['Name']=_0x46f2a7!==_0x891c('0x44')?_0x46f2a7:util[_0x891c('0x41')](_0x891c('0x42'),_0x222a86);}else{return null;}}return _0x1d2a28[_0x891c('0x1d')](_[_0x891c('0x45')](_0x33c8e2[_0x891c('0x3f')]))[_0x891c('0x1e')](_0x515e34)['then'](function(_0x163a02){return BPromise[_0x891c('0x2c')]({'id':_0x163a02['id'],'endUserType':_0x33c8e2[_0x891c('0x3f')]});});}});}function getCustomFields(_0x10927e,_0x583083){var _0x288971={};if(_0x10927e[_0x891c('0x24')]>0x0){_[_0x891c('0x46')](_0x10927e,function(_0x4fd686){if(_[_0x891c('0x47')]([_0x891c('0x48'),_0x891c('0x49')],_0x4fd686[_0x891c('0x3e')])&&_0x4fd686[_0x891c('0x4a')]){_0x288971[_0x4fd686[_0x891c('0x4a')]]=_0x4fd686[_0x891c('0x4b')]['toString']();}else if(_0x4fd686[_0x891c('0x3e')]===_0x891c('0x4c')&&_0x4fd686[_0x891c('0x4d')]&&_0x4fd686[_0x891c('0x4a')]){_0x583083[_0x4fd686['variableName']]&&(_0x288971[_0x4fd686[_0x891c('0x4a')]]=_0x583083[_0x4fd686['variableName']][_0x891c('0x4e')]());}else if(_0x4fd686['type']===_0x891c('0x4f')&&_0x4fd686[_0x891c('0x50')]&&_0x4fd686[_0x891c('0x50')][_0x891c('0x51')]&&_0x4fd686['idField']){_0x583083[_0x4fd686[_0x891c('0x50')][_0x891c('0x51')]['toLowerCase']()]&&(_0x288971[_0x4fd686['idField']]=_0x583083[_0x4fd686['Variable']['name'][_0x891c('0x52')]()]['toString']());}});}return _0x288971;}function getConnection(_0xe3fb58){var _0x4d94e4=_0xe3fb58[_0x891c('0x53')][_0x891c('0x54')](_0xe3fb58[_0x891c('0x55')]);var _0x1328a1=new jsforce[(_0x891c('0x56'))]({'oauth2':{'loginUrl':_0xe3fb58[_0x891c('0x57')]||_0x891c('0x58'),'clientId':_0xe3fb58[_0x891c('0x59')],'clientSecret':_0xe3fb58[_0x891c('0x5a')]}});return _0x1328a1[_0x891c('0x5b')](_0xe3fb58[_0x891c('0x5c')],_0x4d94e4)[_0x891c('0x29')](function(){logger['info'](_0x891c('0x5d'));return _0x1328a1;});}exports['queue']=function(_0x3582d2,_0x253d29,_0x4ecd3c,_0x1643da,_0xe05449,_0x236eee){var _0x5c1347,_0xd0fcbd,_0x59b717,_0x16d8b1;_0x236eee[_0x891c('0x5e')]=intUtil[_0x891c('0x5f')](_0x236eee[_0x891c('0x5e')]);_0x236eee['remoteUri']=intUtil['stripTrailingSlash'](_0x236eee[_0x891c('0x57')]);if(_0xe05449&&_0xe05449[_0x891c('0x60')]){logger['info'](_0x891c('0x61'),_0x891c('0x62'));_0x253d29['recordingURL']=util[_0x891c('0x41')](_0x891c('0x63'),_0x236eee[_0x891c('0x5e')],_0x253d29[_0x891c('0x64')],md5(_0x253d29[_0x891c('0x64')]));}else{_0x253d29[_0x891c('0x65')]='';}return getConnection(_0x236eee)['then'](function(_0x477026){_0x16d8b1=_0x477026;return getUser(_0x236eee,_0x1643da[_0x891c('0x66')],_0x16d8b1);})[_0x891c('0x29')](function(_0xdf273d){_0x5c1347=_0xdf273d;return getEndUser(_0x236eee,_0x4ecd3c,_0x253d29[_0x891c('0x67')],_0x253d29[_0x891c('0x68')],_0x16d8b1);})[_0x891c('0x29')](function(_0x8a22a8){_0xd0fcbd=_0x8a22a8;return getTicket(_0x236eee,_0x5c1347,_0xd0fcbd,_0x4ecd3c,_0x253d29,_0x4ecd3c[_0x891c('0x69')],_0x16d8b1,_0x891c('0x6a'));})[_0x891c('0x29')](function(_0x2c22fa){_0x59b717=_0x2c22fa;logger[_0x891c('0x26')](_0x891c('0x6b'),_0x59b717['id']);logger['info'](_0x891c('0x6c'),_0x59b717['id'],_0x1643da[_0x891c('0x51')],_0x236eee[_0x891c('0x3e')]);switch(_0x236eee['type']){case _0x891c('0x6d'):emit(util[_0x891c('0x41')](_0x891c('0x6e'),_0x1643da[_0x891c('0x51')]),_0x891c('0x6f'),{'recordId':_0x59b717['id']});break;case _0x891c('0x70'):emit(util[_0x891c('0x41')](_0x891c('0x6e'),_0x1643da[_0x891c('0x51')]),_0x891c('0x71'),{'uri':util[_0x891c('0x41')]('%s/%s/e',_0x16d8b1['instanceUrl'],_0x59b717['id'])});break;default:logger[_0x891c('0x72')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x891c('0x73')](function(_0xfb5b06){logger['error'](_0x891c('0x61'),_0xfb5b06);});};exports['outbound']=function(_0x50d337,_0x3e513d,_0x11e420,_0x3863f2,_0x5de5ff,_0xeb9d8e,_0x443965){var _0x4df1fd,_0x463881,_0x17c0e4,_0x5db81b;_0xeb9d8e['serverUrl']=intUtil['stripTrailingSlash'](_0xeb9d8e[_0x891c('0x5e')]);_0xeb9d8e[_0x891c('0x57')]=intUtil[_0x891c('0x5f')](_0xeb9d8e['remoteUri']);if(_0x443965&&_0x443965[_0x891c('0x74')]&&_0x443965['recordingFormat']!==_0x891c('0x75')){logger[_0x891c('0x26')](_0x891c('0x76'),_0x891c('0x62'));_0x3e513d[_0x891c('0x65')]=util[_0x891c('0x41')](_0x891c('0x63'),_0xeb9d8e[_0x891c('0x5e')],_0x3e513d[_0x891c('0x64')],md5(_0x3e513d[_0x891c('0x64')]));}return getConnection(_0xeb9d8e)[_0x891c('0x29')](function(_0x29a318){_0x5db81b=_0x29a318;return getUser(_0xeb9d8e,_0x3863f2[_0x891c('0x66')],_0x5db81b);})[_0x891c('0x29')](function(_0x366bc3){_0x4df1fd=_0x366bc3;return getEndUser(_0xeb9d8e,_0x11e420,_0x3e513d[_0x891c('0x77')],_0x3e513d[_0x891c('0x78')],_0x5db81b);})[_0x891c('0x29')](function(_0x248a76){_0x463881=_0x248a76;return getTicket(_0xeb9d8e,_0x4df1fd,_0x463881,_0x11e420,_0x3e513d,_0x11e420['Fields'],_0x5db81b,'outbound');})['then'](function(_0x3ba536){_0x17c0e4=_0x3ba536;logger[_0x891c('0x26')](_0x891c('0x79'),_0x17c0e4['id']);logger[_0x891c('0x26')](_0x891c('0x7a'),_0x17c0e4['id'],_0x3863f2[_0x891c('0x51')],_0xeb9d8e['type']);switch(_0xeb9d8e[_0x891c('0x3e')]){case'integrationTab':emit(util[_0x891c('0x41')](_0x891c('0x6e'),_0x3863f2[_0x891c('0x51')]),_0x891c('0x6f'),{'recordId':_0x17c0e4['id']});break;case _0x891c('0x70'):emit(util[_0x891c('0x41')](_0x891c('0x6e'),_0x3863f2[_0x891c('0x51')]),'trigger:browser:url',{'uri':util[_0x891c('0x41')](_0x891c('0x7b'),_0x5db81b[_0x891c('0x7c')],_0x17c0e4['id'])});break;default:logger[_0x891c('0x72')](_0x891c('0x76'),_0x891c('0x7d'));}})[_0x891c('0x73')](function(_0x2de088){logger[_0x891c('0x72')](_0x891c('0x76'),_0x2de088);});};exports['unmanaged']=function(_0x9f21b2,_0x4395e2,_0x54eede,_0x3b89f6,_0x2b6463,_0x2b372f){var _0x468e5e,_0x3a60ba,_0x493264,_0x511c07;_0x2b372f[_0x891c('0x5e')]=intUtil[_0x891c('0x5f')](_0x2b372f[_0x891c('0x5e')]);_0x2b372f[_0x891c('0x57')]=intUtil['stripTrailingSlash'](_0x2b372f[_0x891c('0x57')]);if(_0x2b6463&&_0x2b6463[_0x891c('0x60')]){logger[_0x891c('0x26')]('['+_0x4395e2[_0x891c('0x7e')][_0x891c('0x7f')]()+']',_0x891c('0x62'));_0x4395e2[_0x891c('0x65')]=util[_0x891c('0x41')](_0x891c('0x63'),_0x2b372f[_0x891c('0x5e')],_0x4395e2[_0x891c('0x64')],md5(_0x4395e2[_0x891c('0x64')]));}else{_0x4395e2[_0x891c('0x65')]='';}return getConnection(_0x2b372f)[_0x891c('0x29')](function(_0x3ba8ce){_0x511c07=_0x3ba8ce;if(!_[_0x891c('0x1f')](_0x3b89f6)){return getUser(_0x2b372f,_0x3b89f6['name'],_0x511c07);}else{return getUser(_0x2b372f,null,_0x511c07);}})[_0x891c('0x29')](function(_0x3dea5d){_0x468e5e=_0x3dea5d;return getEndUser(_0x2b372f,_0x54eede,_0x4395e2['calleridname'],_0x4395e2[_0x891c('0x68')],_0x511c07);})[_0x891c('0x29')](function(_0x2389b0){_0x3a60ba=_0x2389b0;return getTicket(_0x2b372f,_0x468e5e,_0x3a60ba,_0x54eede,_0x4395e2,_0x54eede[_0x891c('0x69')],_0x511c07);})[_0x891c('0x29')](function(_0x342517){_0x493264=_0x342517;logger[_0x891c('0x26')]('['+_0x4395e2['lastevent'][_0x891c('0x7f')]()+_0x891c('0x80'),_0x493264['id']);logger[_0x891c('0x26')]('['+_0x4395e2['lastevent'][_0x891c('0x7f')]()+_0x891c('0x81'),_0x2b372f[_0x891c('0x3e')]);})[_0x891c('0x73')](function(_0x48b8c3){logger[_0x891c('0x72')]('['+_0x4395e2['lastevent'][_0x891c('0x7f')]()+']',_0x48b8c3);});}; \ 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 bf4049e..7684ad8 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 _0xc5a3=['label_entry','Incident','Incident\x20-\x20','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','sys_id','adminEmail','error',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label'];(function(_0xf36a76,_0x3967b3){var _0x414aa5=function(_0x84dc89){while(--_0x84dc89){_0xf36a76['push'](_0xf36a76['shift']());}};_0x414aa5(++_0x3967b3);}(_0xc5a3,0x103));var _0x3c5a=function(_0x45269d,_0x474648){_0x45269d=_0x45269d-0x0;var _0x252895=_0xc5a3[_0x45269d];return _0x252895;};'use strict';var _=require(_0x3c5a('0x0'));var Promise=require(_0x3c5a('0x1'));var rp=require('request-promise');var util=require(_0x3c5a('0x2'));var md5=require(_0x3c5a('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x3c5a('0x4'));var logger=require(_0x3c5a('0x5'))(_0x3c5a('0x6'));config[_0x3c5a('0x7')]=_[_0x3c5a('0x8')](config[_0x3c5a('0x7')],{'host':_0x3c5a('0x9'),'port':0x18eb});var io=require(_0x3c5a('0xa'))(new Redis(config[_0x3c5a('0x7')]));function getAdminUser(_0x2cec66,_0x272b5c,_0x120acb,_0x43ecac,_0x15dbe8,_0x1212a9){return new Promise(function(_0x57d789,_0x2f3b32){var _0x22f7ad={'method':'GET','uri':_0x43ecac+_0x3c5a('0xb')+'&'+_0x15dbe8+'&'+_0x1212a9,'auth':_0x272b5c,'json':!![]};return rp(_0x22f7ad)[_0x3c5a('0xc')](function(_0x31e21a){if(_0x31e21a[_0x3c5a('0xd')]['length']>0x0){_0x120acb[_0x3c5a('0xe')]=_0x31e21a[_0x3c5a('0xd')][0x0]['sys_id'];}logger[_0x3c5a('0xf')]('['+[_0x2cec66['toUpperCase']()]+_0x3c5a('0x10'),_0x120acb);_0x57d789(_0x120acb);})[_0x3c5a('0x11')](function(_0x27158b){logger['error']('['+[_0x2cec66[_0x3c5a('0x12')]()]+']',_0x27158b[_0x3c5a('0x13')]);_0x2f3b32(_0x27158b['message']);});});}function getUser(_0x2288aa,_0x1c4372,_0x455022,_0x3722a8,_0x2e225c){return function(_0x2a0cf8){logger['info']('['+[_0x2288aa[_0x3c5a('0x12')]()]+_0x3c5a('0x14'),_0x2a0cf8);return new Promise(function(_0x44dfb2,_0xef5893){if(intUtil[_0x3c5a('0x15')](_0x2a0cf8[_0x3c5a('0x16')])){var _0x538029={'method':_0x3c5a('0x17'),'uri':_0x455022+'sys_user?sysparm_query=email%3D'+_0x2a0cf8['userEmail']+'&'+_0x3722a8+'&'+_0x2e225c,'auth':_0x1c4372,'json':!![]};logger[_0x3c5a('0xf')]('['+[_0x2288aa['toUpperCase']()]+_0x3c5a('0x18'),_0x538029);return rp(_0x538029)[_0x3c5a('0xc')](function(_0x5f0a00){logger[_0x3c5a('0xf')]('['+[_0x2288aa[_0x3c5a('0x12')]()]+_0x3c5a('0x19'),_0x5f0a00);if(_0x5f0a00[_0x3c5a('0xd')][_0x3c5a('0x1a')]>0x0&&String(_0x5f0a00[_0x3c5a('0xd')][0x0][_0x3c5a('0x1b')])===_0x3c5a('0x1c')){_0x2a0cf8['userId']=_0x5f0a00[_0x3c5a('0xd')][0x0][_0x3c5a('0x1d')];}else{_0x2a0cf8['userId']=_0x2a0cf8['adminId'];_0x2a0cf8[_0x3c5a('0x16')]=_0x2a0cf8[_0x3c5a('0x1e')];}logger[_0x3c5a('0xf')]('['+[_0x2288aa['toUpperCase']()]+'],\x20getUser\x20crm',_0x2a0cf8);_0x44dfb2(_0x2a0cf8);})[_0x3c5a('0x11')](function(_0x49e88c){logger[_0x3c5a('0x1f')]('['+[_0x2288aa[_0x3c5a('0x12')]()]+']',_0x49e88c[_0x3c5a('0x13')]);_0xef5893(_0x49e88c['message']);});}else{logger['info']('['+[_0x2288aa[_0x3c5a('0x12')]()]+_0x3c5a('0x20'));_0x2a0cf8[_0x3c5a('0x21')]=_0x2a0cf8[_0x3c5a('0xe')];_0x2a0cf8[_0x3c5a('0x16')]=_0x2a0cf8['adminEmail'];_0x44dfb2(_0x2a0cf8);}});};}function createEndUser(_0x192197,_0x378662,_0x519d2a,_0x21a86f,_0x376885){logger[_0x3c5a('0xf')]('['+[_0x192197['toUpperCase']()]+_0x3c5a('0x22'),_0x519d2a);return new Promise(function(_0x1ce089,_0x55cf27){var _0x2fe463={'method':_0x3c5a('0x23'),'uri':_0x21a86f+_0x3c5a('0x24')+_0x376885,'body':{'user_name':_0x519d2a[_0x3c5a('0x25')],'roles':_0x3c5a('0x26'),'first_name':_0x519d2a[_0x3c5a('0x25')],'active':_0x3c5a('0x1c'),'date_format':_0x3c5a('0x27'),'phone':_0x519d2a[_0x3c5a('0x25')]},'auth':_0x378662,'json':!![]};return rp(_0x2fe463)[_0x3c5a('0xc')](function(_0x49f8b8){logger['info']('['+[_0x192197['toUpperCase']()]+'],\x20EndUser\x20schema',_0x49f8b8['result']);_0x519d2a['endUserId']=_0x49f8b8[_0x3c5a('0xd')]['sys_id'];_0x1ce089(_0x519d2a);})[_0x3c5a('0x11')](function(_0xcb74fb){logger[_0x3c5a('0x1f')]('['+[_0x192197[_0x3c5a('0x12')]()]+']',_0xcb74fb['message']);_0x55cf27(_0xcb74fb[_0x3c5a('0x13')]);});});}function getEndUser(_0x2443ad,_0x1c90a2,_0x19e27f,_0xba130,_0x40de37){return function(_0x4e0750){logger[_0x3c5a('0xf')]('['+[_0x2443ad['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x4e0750);return new Promise(function(_0x5d11a5,_0x5e7e23){var _0x501bf0={'method':_0x3c5a('0x17'),'uri':_0x19e27f+_0x3c5a('0x28')+_0x4e0750[_0x3c5a('0x25')]+'&'+_0xba130+'&'+_0x40de37,'auth':_0x1c90a2,'json':!![]};return rp(_0x501bf0)['then'](function(_0x29d8ef){if(_0x29d8ef[_0x3c5a('0xd')][_0x3c5a('0x1a')]>0x0){_0x4e0750[_0x3c5a('0x29')]=_0x29d8ef[_0x3c5a('0xd')][0x0]['sys_id'];logger[_0x3c5a('0xf')]('['+[_0x2443ad[_0x3c5a('0x12')]()]+_0x3c5a('0x2a'),_0x4e0750);_0x5d11a5(_0x4e0750);}else{return createEndUser(_0x2443ad,_0x1c90a2,_0x4e0750,_0x19e27f,_0xba130)[_0x3c5a('0xc')](function(_0x4767b8){logger[_0x3c5a('0xf')]('['+[_0x2443ad[_0x3c5a('0x12')]()]+'],\x20createEndUser\x20crm',_0x4767b8);_0x5d11a5(_0x4767b8);});}})[_0x3c5a('0x11')](function(_0x193d77){logger[_0x3c5a('0x1f')]('['+[_0x2443ad[_0x3c5a('0x12')]()]+']',_0x193d77[_0x3c5a('0x13')]);_0x5e7e23(_0x193d77['message']);});});};}function getCustomFields(_0x4d566b,_0x12b792){var _0x36c2f1={};if(_0x4d566b[_0x3c5a('0x1a')]>0x0){_[_0x3c5a('0x2b')](_0x4d566b,function(_0x200fd1){if(_[_0x3c5a('0x2c')]([_0x3c5a('0x2d'),_0x3c5a('0x2e')],_0x200fd1[_0x3c5a('0x2f')])&&_0x200fd1['nameField']&&!_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x31')][_0x3c5a('0x32')]()]=_0x200fd1[_0x3c5a('0x33')][_0x3c5a('0x34')]();}else if(_['includes'](['string',_0x3c5a('0x2e')],_0x200fd1[_0x3c5a('0x2f')])&&_0x200fd1[_0x3c5a('0x35')]&&_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x35')][_0x3c5a('0x32')]()]=_0x200fd1[_0x3c5a('0x33')][_0x3c5a('0x34')]();}else if(_0x200fd1[_0x3c5a('0x2f')]===_0x3c5a('0x36')&&_0x200fd1[_0x3c5a('0x37')]&&_0x200fd1['idField']&&_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x35')]['toLowerCase']()]=_0x12b792[_0x200fd1['variableName']][_0x3c5a('0x34')]();}else if(_0x200fd1[_0x3c5a('0x2f')]==='customVariable'&&_0x200fd1[_0x3c5a('0x38')]&&_0x200fd1[_0x3c5a('0x38')][_0x3c5a('0x39')]&&_0x200fd1[_0x3c5a('0x35')]&&_0x200fd1[_0x3c5a('0x30')]){_0x36c2f1[_0x200fd1[_0x3c5a('0x35')][_0x3c5a('0x32')]()]=_0x12b792[_0x200fd1['Variable'][_0x3c5a('0x39')][_0x3c5a('0x32')]()][_0x3c5a('0x34')]();}});}return _0x36c2f1;}function getTicket(_0x36d694,_0x14dd64,_0x170848,_0x3b9afb,_0x44c646,_0x4822d5){return function(_0x7b86cc){logger[_0x3c5a('0xf')]('['+[_0x36d694[_0x3c5a('0x12')]()]+_0x3c5a('0x3a'),_0x7b86cc);return new Promise(function(_0x3d7416,_0x2ec76d){var _0xf53092=_0x36d694[_0x3c5a('0x32')]()==='outbound'?_0x7b86cc['userId']:_0x7b86cc['endUserId'];var _0x11f8c2={'method':_0x3c5a('0x23'),'uri':_0x170848+'incident'+'?'+_0x4822d5,'body':Object[_0x3c5a('0x3b')]({},{'active':_0x3c5a('0x1c'),'caller_id':_0xf53092,'assigned_to':_0x7b86cc[_0x3c5a('0x21')],'short_description':intUtil[_0x3c5a('0x3c')](_0x3b9afb['Subjects'],_0x44c646,'\x20'),'description':intUtil['getString'](_0x3b9afb[_0x3c5a('0x3d')],_0x44c646,'\x0a')},getCustomFields(_0x3b9afb[_0x3c5a('0x3e')],_0x44c646)),'auth':_0x14dd64,'json':!![]};return rp(_0x11f8c2)['then'](function(_0x1e5b65){logger[_0x3c5a('0xf')]('['+[_0x36d694[_0x3c5a('0x12')]()]+_0x3c5a('0x3f'),_0x1e5b65[_0x3c5a('0xd')]);_0x7b86cc[_0x3c5a('0x40')]=_0x1e5b65['result'][_0x3c5a('0x1d')];_0x7b86cc[_0x3c5a('0x41')]=_0x1e5b65[_0x3c5a('0xd')]['number'];logger[_0x3c5a('0xf')]('['+[_0x36d694[_0x3c5a('0x12')]()]+_0x3c5a('0x42'),_0x7b86cc);_0x3d7416(_0x7b86cc);})[_0x3c5a('0x11')](function(_0x172fc7){logger[_0x3c5a('0x1f')]('['+[_0x36d694[_0x3c5a('0x12')]()]+']',_0x172fc7[_0x3c5a('0x13')]);_0x2ec76d(_0x172fc7[_0x3c5a('0x13')]);});});};}function createRemoteTag(_0x29adee,_0x10669d,_0x1053ad,_0x3199d8){return new Promise(function(_0x380b25,_0x212135){var _0x2b0a61={'method':_0x3c5a('0x23'),'uri':_0x1053ad+_0x3c5a('0x43')+'?'+_0x3199d8,'body':{'short_description':_0x29adee,'global':!![],'active':!![],'name':_0x29adee},'auth':_0x10669d,'json':!![]};return rp(_0x2b0a61)['then'](function(_0x545112){var _0x1f067a=_0x545112[_0x3c5a('0xd')][_0x3c5a('0x1d')];_0x380b25(_0x1f067a);});});}function getRemoteTag(_0x23beed,_0x2e31de,_0x219be5,_0x321925,_0x3b20d4){return new Promise(function(_0x54b9ee,_0x23836b){var _0x2d2078={'method':_0x3c5a('0x17'),'uri':_0x219be5+_0x3c5a('0x43')+'?sysparm_query=name%3D'+_0x23beed+'&'+_0x321925,'auth':_0x2e31de,'json':!![]};return rp(_0x2d2078)['then'](function(_0x13a3fc){if(_0x13a3fc[_0x3c5a('0xd')][_0x3c5a('0x1a')]>0x0){var _0x188f8c=_0x13a3fc['result'][0x0][_0x3c5a('0x1d')];_0x54b9ee(_0x188f8c);}else{return createRemoteTag(_0x23beed,_0x2e31de,_0x219be5,_0x321925)[_0x3c5a('0xc')](function(_0x4dad40){_0x54b9ee(_0x4dad40);});}});});}function assignTagToIncident(_0x30d4eb,_0x25f42c,_0x51ebb9,_0x11966c,_0x589eae){return new Promise(function(_0xee8f15,_0x37d5db){var _0x4d099e={'method':_0x3c5a('0x23'),'uri':_0x51ebb9+_0x3c5a('0x44')+'?'+_0x589eae,'body':{'label':_0x30d4eb,'table':'incident','id_type':_0x3c5a('0x45'),'table_key':_0x11966c[_0x3c5a('0x40')],'title':_0x3c5a('0x46')+_0x11966c[_0x3c5a('0x41')],'id_display':_0x11966c['ticketNumber']},'auth':_0x25f42c,'json':!![]};return rp(_0x4d099e)['then'](function(_0x1bcc94){_0xee8f15();})[_0x3c5a('0x11')](function(){_0xee8f15();});});}function manageTags(_0x4687da,_0x2d6f18,_0x22b7e8,_0x196189,_0x3eaaa2,_0xdd7b1c,_0x28c696){return new Promise(function(_0x40b263,_0x14302a){var _0x319281=[];_0x2d6f18[_0x3c5a('0x2b')](function(_0x7e1d19){_0x319281[_0x3c5a('0x47')](getRemoteTag(_0x7e1d19,_0x22b7e8,_0x196189,_0xdd7b1c,_0x28c696));});return Promise[_0x3c5a('0x48')](_0x319281)[_0x3c5a('0xc')](function(_0x5a071d){if(_0x5a071d['length']){logger[_0x3c5a('0xf')]('['+[_0x4687da[_0x3c5a('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5a071d);var _0x423bf9=[];_0x5a071d[_0x3c5a('0x2b')](function(_0x1483de){_0x423bf9['push'](assignTagToIncident(_0x1483de,_0x22b7e8,_0x196189,_0x3eaaa2,_0xdd7b1c));});return Promise['all'](_0x423bf9)[_0x3c5a('0xc')](function(){_0x40b263();})[_0x3c5a('0x11')](function(){_0x40b263();});}else{_0x40b263();}});});}function getTags(_0x11c4df,_0x169c4a,_0x20dc21,_0x293de1,_0x41ac30,_0x249a21){return function(_0x5cbe9b){return new Promise(function(_0x1bd0c7,_0x141956){var _0x449934=[];var _0x169e67=_0x293de1['Tags'];if(_0x169e67&&_0x169e67[_0x3c5a('0x1a')]>0x0){_0x449934=_[_0x3c5a('0x49')](_0x169e67,_0x3c5a('0x39'));}if(_0x449934[_0x3c5a('0x1a')]>0x0){return manageTags(_0x11c4df,_0x449934,_0x169c4a,_0x20dc21,_0x5cbe9b,_0x41ac30,_0x249a21)['then'](function(){_0x1bd0c7(_0x5cbe9b);});}else{_0x1bd0c7(_0x5cbe9b);}});};}function emit(_0x311c33,_0x1aaf50,_0x4695e8){var _0x2b0456=_0x3c5a('0x4a')+_0x3c5a('0x4b')+_0x3c5a('0x4c')+_0x3c5a('0x4d');var _0x1da373={'uri':_0x311c33+_0x3c5a('0x4e')+_0x4695e8+_0x2b0456};io['to'](util[_0x3c5a('0x4f')](_0x3c5a('0x50'),_0x1aaf50))[_0x3c5a('0x51')](_0x3c5a('0x52'),_0x1da373);}exports['cs']=function(_0x1e75c6,_0x167bf6,_0x337841,_0x1cb35b,_0x3eab7c,_0x211eea,_0x4fa339,_0x293d52){var _0x1000cf={};var _0x25ecc4={'user':_0x211eea[_0x3c5a('0x53')],'pass':_0x211eea[_0x3c5a('0x54')]};var _0x1f0be3=_0x3c5a('0x55');var _0x270bb3=_0x3c5a('0x56');_0x211eea[_0x3c5a('0x57')]=intUtil[_0x3c5a('0x58')](_0x211eea[_0x3c5a('0x57')]);_0x211eea[_0x3c5a('0x59')]=intUtil['stripTrailingSlash'](_0x211eea[_0x3c5a('0x59')]);var _0x522c18=util[_0x3c5a('0x4f')](_0x3c5a('0x5a'),_0x211eea[_0x3c5a('0x57')]);_0x1000cf['userEmail']=!_[_0x3c5a('0x5b')](_0x1cb35b)?_0x1cb35b['email']:null;_0x1000cf[_0x3c5a('0x1e')]=_0x211eea[_0x3c5a('0x5c')];_0x1000cf[_0x3c5a('0x25')]=_0x293d52['toLowerCase']()===_0x3c5a('0x5d')?_0x167bf6[_0x3c5a('0x5e')]:_0x167bf6[_0x3c5a('0x5f')];_0x1000cf[_0x3c5a('0x60')]=_0x293d52===_0x3c5a('0x61')||_0x293d52===_0x3c5a('0x62')?'queue':_0x3c5a('0x5d');var _0x40e363=util[_0x3c5a('0x4f')](_0x3c5a('0x63'),_0x211eea['serverUrl'],_0x167bf6[_0x3c5a('0x64')],md5(_0x167bf6[_0x3c5a('0x64')]));if(_0x3eab7c&&_0x3eab7c['monitor_format']){logger[_0x3c5a('0xf')]('[QUEUE]',_0x3c5a('0x65'));_0x167bf6[_0x3c5a('0x66')]=_0x40e363;}else if(_0x4fa339&&_0x4fa339[_0x3c5a('0x67')]&&_0x4fa339[_0x3c5a('0x67')]!==_0x3c5a('0x68')){logger[_0x3c5a('0xf')]('[OUTBOUND]',_0x3c5a('0x65'));_0x167bf6[_0x3c5a('0x66')]=_0x40e363;}else{_0x167bf6['recordingURL']='';}return getAdminUser(_0x293d52,_0x25ecc4,_0x1000cf,_0x522c18,_0x270bb3,_0x1f0be3)[_0x3c5a('0xc')](getUser(_0x293d52,_0x25ecc4,_0x522c18,_0x270bb3,_0x1f0be3))[_0x3c5a('0xc')](getEndUser(_0x293d52,_0x25ecc4,_0x522c18,_0x270bb3,_0x1f0be3))[_0x3c5a('0xc')](getTicket(_0x293d52,_0x25ecc4,_0x522c18,_0x337841,_0x167bf6,_0x270bb3))[_0x3c5a('0xc')](function(_0xf251ce){logger[_0x3c5a('0xf')](util[_0x3c5a('0x4f')]('The\x20ticket\x20ID\x20is:\x20%s',_0xf251ce[_0x3c5a('0x40')]));logger[_0x3c5a('0xf')](util['format'](_0x3c5a('0x69'),_0x293d52));if(_0x293d52!==_0x3c5a('0x62')){logger[_0x3c5a('0xf')]('['+[_0x293d52[_0x3c5a('0x12')]()]+']',_0x3c5a('0x6a'));emit(_0x211eea[_0x3c5a('0x57')],_0x1cb35b[_0x3c5a('0x39')],_0xf251ce[_0x3c5a('0x40')]);}})['catch'](function(_0x468f81){logger[_0x3c5a('0x1f')]('['+[_0x293d52[_0x3c5a('0x12')]()]+_0x3c5a('0x6b'),util[_0x3c5a('0x6c')](_0x468f81,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3e68=['isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','toUpperCase','catch','error','message','info','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','content','idField','toLowerCase','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','POST','label_entry','incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/'];(function(_0x2e1ef0,_0x15c4fb){var _0x1146b2=function(_0x4e2f97){while(--_0x4e2f97){_0x2e1ef0['push'](_0x2e1ef0['shift']());}};_0x1146b2(++_0x15c4fb);}(_0x3e68,0x1d4));var _0x83e6=function(_0x34c961,_0x18cada){_0x34c961=_0x34c961-0x0;var _0x409adc=_0x3e68[_0x34c961];return _0x409adc;};'use strict';var _=require(_0x83e6('0x0'));var Promise=require('bluebird');var rp=require(_0x83e6('0x1'));var util=require(_0x83e6('0x2'));var md5=require(_0x83e6('0x3'));var Redis=require(_0x83e6('0x4'));var intUtil=require(_0x83e6('0x5'));var config=require(_0x83e6('0x6'));var logger=require(_0x83e6('0x7'))('servicenow');config[_0x83e6('0x8')]=_[_0x83e6('0x9')](config['redis'],{'host':_0x83e6('0xa'),'port':0x18eb});var io=require(_0x83e6('0xb'))(new Redis(config[_0x83e6('0x8')]));function getAdminUser(_0x310ee4,_0xba689a,_0x78327f,_0x558af3,_0x22d080,_0x2c20bf){return new Promise(function(_0x47f9fa,_0x5bdf1f){var _0x2fa04a={'method':_0x83e6('0xc'),'uri':_0x558af3+_0x83e6('0xd')+'&'+_0x22d080+'&'+_0x2c20bf,'auth':_0xba689a,'json':!![]};return rp(_0x2fa04a)[_0x83e6('0xe')](function(_0x20896b){if(_0x20896b[_0x83e6('0xf')][_0x83e6('0x10')]>0x0){_0x78327f[_0x83e6('0x11')]=_0x20896b[_0x83e6('0xf')][0x0]['sys_id'];}logger['info']('['+[_0x310ee4[_0x83e6('0x12')]()]+'],\x20getAdminUser\x20crm',_0x78327f);_0x47f9fa(_0x78327f);})[_0x83e6('0x13')](function(_0x3ecb85){logger[_0x83e6('0x14')]('['+[_0x310ee4[_0x83e6('0x12')]()]+']',_0x3ecb85[_0x83e6('0x15')]);_0x5bdf1f(_0x3ecb85['message']);});});}function getUser(_0x5ce457,_0x21617c,_0x3047a3,_0x7ac2f7,_0x53c19d){return function(_0x5528d2){logger[_0x83e6('0x16')]('['+[_0x5ce457[_0x83e6('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x5528d2);return new Promise(function(_0x21cbe1,_0x825fd0){if(intUtil[_0x83e6('0x17')](_0x5528d2['userEmail'])){var _0x71532d={'method':'GET','uri':_0x3047a3+_0x83e6('0x18')+_0x5528d2[_0x83e6('0x19')]+'&'+_0x7ac2f7+'&'+_0x53c19d,'auth':_0x21617c,'json':!![]};logger['info']('['+[_0x5ce457[_0x83e6('0x12')]()]+_0x83e6('0x1a'),_0x71532d);return rp(_0x71532d)[_0x83e6('0xe')](function(_0x53d3b5){logger[_0x83e6('0x16')]('['+[_0x5ce457['toUpperCase']()]+_0x83e6('0x1b'),_0x53d3b5);if(_0x53d3b5[_0x83e6('0xf')][_0x83e6('0x10')]>0x0&&String(_0x53d3b5[_0x83e6('0xf')][0x0][_0x83e6('0x1c')])===_0x83e6('0x1d')){_0x5528d2[_0x83e6('0x1e')]=_0x53d3b5[_0x83e6('0xf')][0x0][_0x83e6('0x1f')];}else{_0x5528d2[_0x83e6('0x1e')]=_0x5528d2[_0x83e6('0x11')];_0x5528d2[_0x83e6('0x19')]=_0x5528d2[_0x83e6('0x20')];}logger[_0x83e6('0x16')]('['+[_0x5ce457[_0x83e6('0x12')]()]+_0x83e6('0x21'),_0x5528d2);_0x21cbe1(_0x5528d2);})[_0x83e6('0x13')](function(_0x25341){logger[_0x83e6('0x14')]('['+[_0x5ce457['toUpperCase']()]+']',_0x25341['message']);_0x825fd0(_0x25341[_0x83e6('0x15')]);});}else{logger[_0x83e6('0x16')]('['+[_0x5ce457[_0x83e6('0x12')]()]+_0x83e6('0x22'));_0x5528d2['userId']=_0x5528d2['adminId'];_0x5528d2[_0x83e6('0x19')]=_0x5528d2[_0x83e6('0x20')];_0x21cbe1(_0x5528d2);}});};}function createEndUser(_0x259e5a,_0xe7eba0,_0x17ed99,_0x1f82f6,_0x41df55){logger[_0x83e6('0x16')]('['+[_0x259e5a[_0x83e6('0x12')]()]+_0x83e6('0x23'),_0x17ed99);return new Promise(function(_0x3652a6,_0x4c1872){var _0x3cb369={'method':'POST','uri':_0x1f82f6+'sys_user?'+_0x41df55,'body':{'user_name':_0x17ed99[_0x83e6('0x24')],'roles':_0x83e6('0x25'),'first_name':_0x17ed99[_0x83e6('0x24')],'active':'true','date_format':_0x83e6('0x26'),'phone':_0x17ed99[_0x83e6('0x24')]},'auth':_0xe7eba0,'json':!![]};return rp(_0x3cb369)[_0x83e6('0xe')](function(_0x114797){logger[_0x83e6('0x16')]('['+[_0x259e5a[_0x83e6('0x12')]()]+_0x83e6('0x27'),_0x114797[_0x83e6('0xf')]);_0x17ed99[_0x83e6('0x28')]=_0x114797[_0x83e6('0xf')][_0x83e6('0x1f')];_0x3652a6(_0x17ed99);})['catch'](function(_0x10d660){logger['error']('['+[_0x259e5a[_0x83e6('0x12')]()]+']',_0x10d660['message']);_0x4c1872(_0x10d660[_0x83e6('0x15')]);});});}function getEndUser(_0x5f36f3,_0x4f41ac,_0x3aea30,_0x34bcd2,_0xe0775d){return function(_0x153139){logger[_0x83e6('0x16')]('['+[_0x5f36f3['toUpperCase']()]+_0x83e6('0x29'),_0x153139);return new Promise(function(_0x3aa1e0,_0x311867){var _0x2b542e={'method':'GET','uri':_0x3aea30+_0x83e6('0x2a')+_0x153139[_0x83e6('0x24')]+'&'+_0x34bcd2+'&'+_0xe0775d,'auth':_0x4f41ac,'json':!![]};return rp(_0x2b542e)['then'](function(_0x1e3e91){if(_0x1e3e91['result']['length']>0x0){_0x153139[_0x83e6('0x28')]=_0x1e3e91[_0x83e6('0xf')][0x0][_0x83e6('0x1f')];logger[_0x83e6('0x16')]('['+[_0x5f36f3[_0x83e6('0x12')]()]+'],\x20getEndUser\x20crm',_0x153139);_0x3aa1e0(_0x153139);}else{return createEndUser(_0x5f36f3,_0x4f41ac,_0x153139,_0x3aea30,_0x34bcd2)['then'](function(_0x226608){logger[_0x83e6('0x16')]('['+[_0x5f36f3[_0x83e6('0x12')]()]+_0x83e6('0x2b'),_0x226608);_0x3aa1e0(_0x226608);});}})[_0x83e6('0x13')](function(_0x470f3b){logger['error']('['+[_0x5f36f3['toUpperCase']()]+']',_0x470f3b['message']);_0x311867(_0x470f3b['message']);});});};}function getCustomFields(_0x5e3c96,_0x29e240){var _0x5b0bff={};if(_0x5e3c96[_0x83e6('0x10')]>0x0){_[_0x83e6('0x2c')](_0x5e3c96,function(_0x12fba0){if(_[_0x83e6('0x2d')]([_0x83e6('0x2e'),_0x83e6('0x2f')],_0x12fba0[_0x83e6('0x30')])&&_0x12fba0[_0x83e6('0x31')]&&!_0x12fba0[_0x83e6('0x32')]){_0x5b0bff[_0x12fba0[_0x83e6('0x31')]['toLowerCase']()]=_0x12fba0[_0x83e6('0x33')]['toString']();}else if(_[_0x83e6('0x2d')](['string',_0x83e6('0x2f')],_0x12fba0['type'])&&_0x12fba0['idField']&&_0x12fba0[_0x83e6('0x32')]){_0x5b0bff[_0x12fba0[_0x83e6('0x34')][_0x83e6('0x35')]()]=_0x12fba0[_0x83e6('0x33')]['toString']();}else if(_0x12fba0[_0x83e6('0x30')]==='variable'&&_0x12fba0[_0x83e6('0x36')]&&_0x12fba0[_0x83e6('0x34')]&&_0x12fba0[_0x83e6('0x32')]){_0x5b0bff[_0x12fba0[_0x83e6('0x34')][_0x83e6('0x35')]()]=_0x29e240[_0x12fba0[_0x83e6('0x36')]][_0x83e6('0x37')]();}else if(_0x12fba0['type']===_0x83e6('0x38')&&_0x12fba0['Variable']&&_0x12fba0[_0x83e6('0x39')][_0x83e6('0x3a')]&&_0x12fba0[_0x83e6('0x34')]&&_0x12fba0['customField']){_0x5b0bff[_0x12fba0['idField'][_0x83e6('0x35')]()]=_0x29e240[_0x12fba0[_0x83e6('0x39')]['name'][_0x83e6('0x35')]()][_0x83e6('0x37')]();}});}return _0x5b0bff;}function getTicket(_0x28b09f,_0x27112b,_0x2de9b3,_0x526379,_0x24dcb0,_0x3ff3a0){return function(_0x327b9a){logger[_0x83e6('0x16')]('['+[_0x28b09f[_0x83e6('0x12')]()]+_0x83e6('0x3b'),_0x327b9a);return new Promise(function(_0x20ca5a,_0x3b2df8){var _0x23414b=_0x28b09f[_0x83e6('0x35')]()===_0x83e6('0x3c')?_0x327b9a[_0x83e6('0x1e')]:_0x327b9a[_0x83e6('0x28')];var _0x429492={'method':'POST','uri':_0x2de9b3+'incident'+'?'+_0x3ff3a0,'body':Object[_0x83e6('0x3d')]({},{'active':_0x83e6('0x1d'),'caller_id':_0x23414b,'assigned_to':_0x327b9a[_0x83e6('0x1e')],'short_description':intUtil[_0x83e6('0x3e')](_0x526379[_0x83e6('0x3f')],_0x24dcb0,'\x20'),'description':intUtil[_0x83e6('0x3e')](_0x526379[_0x83e6('0x40')],_0x24dcb0,'\x0a')},getCustomFields(_0x526379[_0x83e6('0x41')],_0x24dcb0)),'auth':_0x27112b,'json':!![]};return rp(_0x429492)[_0x83e6('0xe')](function(_0x2176a5){logger[_0x83e6('0x16')]('['+[_0x28b09f['toUpperCase']()]+_0x83e6('0x42'),_0x2176a5[_0x83e6('0xf')]);_0x327b9a['ticketId']=_0x2176a5[_0x83e6('0xf')][_0x83e6('0x1f')];_0x327b9a[_0x83e6('0x43')]=_0x2176a5['result'][_0x83e6('0x44')];logger['info']('['+[_0x28b09f['toUpperCase']()]+']\x20getTicket\x20crm',_0x327b9a);_0x20ca5a(_0x327b9a);})[_0x83e6('0x13')](function(_0x12b561){logger['error']('['+[_0x28b09f['toUpperCase']()]+']',_0x12b561[_0x83e6('0x15')]);_0x3b2df8(_0x12b561[_0x83e6('0x15')]);});});};}function createRemoteTag(_0x55bbfb,_0x3d96a1,_0x5e3d98,_0x523c41){return new Promise(function(_0x2dc1bd,_0x3b9e40){var _0x591ae6={'method':'POST','uri':_0x5e3d98+'label'+'?'+_0x523c41,'body':{'short_description':_0x55bbfb,'global':!![],'active':!![],'name':_0x55bbfb},'auth':_0x3d96a1,'json':!![]};return rp(_0x591ae6)[_0x83e6('0xe')](function(_0x4814e6){var _0x306ab3=_0x4814e6[_0x83e6('0xf')]['sys_id'];_0x2dc1bd(_0x306ab3);});});}function getRemoteTag(_0xd3930b,_0x15ec04,_0xe44238,_0x344397,_0xb1cf81){return new Promise(function(_0x1aff39,_0x1fa261){var _0xaa09d2={'method':_0x83e6('0xc'),'uri':_0xe44238+_0x83e6('0x45')+_0x83e6('0x46')+_0xd3930b+'&'+_0x344397,'auth':_0x15ec04,'json':!![]};return rp(_0xaa09d2)[_0x83e6('0xe')](function(_0xb23c9d){if(_0xb23c9d['result']['length']>0x0){var _0x2a07ee=_0xb23c9d[_0x83e6('0xf')][0x0][_0x83e6('0x1f')];_0x1aff39(_0x2a07ee);}else{return createRemoteTag(_0xd3930b,_0x15ec04,_0xe44238,_0x344397)[_0x83e6('0xe')](function(_0x19cb58){_0x1aff39(_0x19cb58);});}});});}function assignTagToIncident(_0x310d6f,_0x2faa93,_0x524b91,_0x2df592,_0xb860da){return new Promise(function(_0x43acb7,_0x303a94){var _0x158fa5={'method':_0x83e6('0x47'),'uri':_0x524b91+_0x83e6('0x48')+'?'+_0xb860da,'body':{'label':_0x310d6f,'table':_0x83e6('0x49'),'id_type':'Incident','table_key':_0x2df592['ticketId'],'title':_0x83e6('0x4a')+_0x2df592[_0x83e6('0x43')],'id_display':_0x2df592['ticketNumber']},'auth':_0x2faa93,'json':!![]};return rp(_0x158fa5)['then'](function(_0x499998){_0x43acb7();})[_0x83e6('0x13')](function(){_0x43acb7();});});}function manageTags(_0x2f7945,_0x536b25,_0x22cd6d,_0x1ce6d9,_0x2b31b1,_0x20382a,_0x4de40f){return new Promise(function(_0x472460,_0x563b78){var _0x1c7858=[];_0x536b25['forEach'](function(_0xb99094){_0x1c7858[_0x83e6('0x4b')](getRemoteTag(_0xb99094,_0x22cd6d,_0x1ce6d9,_0x20382a,_0x4de40f));});return Promise[_0x83e6('0x4c')](_0x1c7858)[_0x83e6('0xe')](function(_0x23ffac){if(_0x23ffac[_0x83e6('0x10')]){logger[_0x83e6('0x16')]('['+[_0x2f7945[_0x83e6('0x12')]()]+_0x83e6('0x4d'),_0x23ffac);var _0x4b7250=[];_0x23ffac[_0x83e6('0x2c')](function(_0x2fba9f){_0x4b7250[_0x83e6('0x4b')](assignTagToIncident(_0x2fba9f,_0x22cd6d,_0x1ce6d9,_0x2b31b1,_0x20382a));});return Promise[_0x83e6('0x4c')](_0x4b7250)[_0x83e6('0xe')](function(){_0x472460();})[_0x83e6('0x13')](function(){_0x472460();});}else{_0x472460();}});});}function getTags(_0x2a1c16,_0x18bf7e,_0x459b5c,_0x43d598,_0x5bd307,_0x35044a){return function(_0xac5a65){return new Promise(function(_0x34a797,_0xe77cd5){var _0x3269f0=[];var _0x1e658e=_0x43d598[_0x83e6('0x4e')];if(_0x1e658e&&_0x1e658e['length']>0x0){_0x3269f0=_[_0x83e6('0x4f')](_0x1e658e,_0x83e6('0x3a'));}if(_0x3269f0[_0x83e6('0x10')]>0x0){return manageTags(_0x2a1c16,_0x3269f0,_0x18bf7e,_0x459b5c,_0xac5a65,_0x5bd307,_0x35044a)[_0x83e6('0xe')](function(){_0x34a797(_0xac5a65);});}else{_0x34a797(_0xac5a65);}});};}function emit(_0x22c503,_0x3c0a58,_0x1070a6){var _0xb8efac='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x83e6('0x50')+_0x83e6('0x51');var _0x3d19a3={'uri':_0x22c503+_0x83e6('0x52')+_0x1070a6+_0xb8efac};io['to'](util[_0x83e6('0x53')](_0x83e6('0x54'),_0x3c0a58))[_0x83e6('0x55')](_0x83e6('0x56'),_0x3d19a3);}exports['cs']=function(_0x2d49fa,_0x3087c7,_0x467829,_0x5616bd,_0x29ce0d,_0x141610,_0x1a47f8,_0x5623af){var _0x3c7dba={};var _0x162047={'user':_0x141610['username'],'pass':_0x141610[_0x83e6('0x57')]};var _0x536e68='sysparm_limit=1';var _0x3f16f4=_0x83e6('0x58');_0x141610['remoteUri']=intUtil['stripTrailingSlash'](_0x141610[_0x83e6('0x59')]);_0x141610[_0x83e6('0x5a')]=intUtil['stripTrailingSlash'](_0x141610[_0x83e6('0x5a')]);var _0x7c8b95=util['format'](_0x83e6('0x5b'),_0x141610[_0x83e6('0x59')]);_0x3c7dba['userEmail']=!_[_0x83e6('0x5c')](_0x5616bd)?_0x5616bd[_0x83e6('0x5d')]:null;_0x3c7dba[_0x83e6('0x20')]=_0x141610[_0x83e6('0x5d')];_0x3c7dba[_0x83e6('0x24')]=_0x5623af[_0x83e6('0x35')]()===_0x83e6('0x3c')?_0x3087c7[_0x83e6('0x5e')]:_0x3087c7[_0x83e6('0x5f')];_0x3c7dba[_0x83e6('0x60')]=_0x5623af==='queue'||_0x5623af===_0x83e6('0x61')?_0x83e6('0x62'):_0x83e6('0x3c');var _0x58d316=util['format'](_0x83e6('0x63'),_0x141610[_0x83e6('0x5a')],_0x3087c7[_0x83e6('0x64')],md5(_0x3087c7[_0x83e6('0x64')]));if(_0x29ce0d&&_0x29ce0d[_0x83e6('0x65')]){logger[_0x83e6('0x16')]('[QUEUE]',_0x83e6('0x66'));_0x3087c7['recordingURL']=_0x58d316;}else if(_0x1a47f8&&_0x1a47f8['recordingFormat']&&_0x1a47f8[_0x83e6('0x67')]!==_0x83e6('0x68')){logger[_0x83e6('0x16')](_0x83e6('0x69'),'Recording\x20is\x20enabled!');_0x3087c7[_0x83e6('0x6a')]=_0x58d316;}else{_0x3087c7[_0x83e6('0x6a')]='';}return getAdminUser(_0x5623af,_0x162047,_0x3c7dba,_0x7c8b95,_0x3f16f4,_0x536e68)[_0x83e6('0xe')](getUser(_0x5623af,_0x162047,_0x7c8b95,_0x3f16f4,_0x536e68))['then'](getEndUser(_0x5623af,_0x162047,_0x7c8b95,_0x3f16f4,_0x536e68))['then'](getTicket(_0x5623af,_0x162047,_0x7c8b95,_0x467829,_0x3087c7,_0x3f16f4))[_0x83e6('0xe')](function(_0xe98c67){logger[_0x83e6('0x16')](util['format'](_0x83e6('0x6b'),_0xe98c67[_0x83e6('0x6c')]));logger['info'](util[_0x83e6('0x53')]('call\x20direction:\x20%s',_0x5623af));if(_0x5623af!==_0x83e6('0x61')){logger[_0x83e6('0x16')]('['+[_0x5623af['toUpperCase']()]+']',_0x83e6('0x6d'));emit(_0x141610[_0x83e6('0x59')],_0x5616bd[_0x83e6('0x3a')],_0xe98c67[_0x83e6('0x6c')]);}})[_0x83e6('0x13')](function(_0x1a2353){logger[_0x83e6('0x14')]('['+[_0x5623af[_0x83e6('0x12')]()]+_0x83e6('0x6e'),util[_0x83e6('0x6f')](_0x1a2353,{'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 ff68082..6f50c3a 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 _0x63ea=['custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','toUpperCase','calleridname','The\x20Ticket\x20ID\x20is:','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','customField','toLowerCase','content'];(function(_0x2bbd2d,_0x37c3c4){var _0x257dc9=function(_0x1928ff){while(--_0x1928ff){_0x2bbd2d['push'](_0x2bbd2d['shift']());}};_0x257dc9(++_0x37c3c4);}(_0x63ea,0xb4));var _0xa63e=function(_0x32085d,_0x16cf84){_0x32085d=_0x32085d-0x0;var _0x668485=_0x63ea[_0x32085d];return _0x668485;};'use strict';var _=require(_0xa63e('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0xa63e('0x1'));var util=require(_0xa63e('0x2'));var Redis=require(_0xa63e('0x3'));var intUtil=require('./util');var config=require(_0xa63e('0x4'));var logger=require(_0xa63e('0x5'))(_0xa63e('0x6'));config[_0xa63e('0x7')]=_[_0xa63e('0x8')](config[_0xa63e('0x7')],{'host':_0xa63e('0x9'),'port':0x18eb});var io=require(_0xa63e('0xa'))(new Redis(config[_0xa63e('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x1bea8,_0x1f807e,_0x4e2eef){io['to'](_0x1bea8)['emit'](_0x1f807e,_0x4e2eef);}function getTicket(_0xb07835,_0x1895fd,_0x2342ab,_0x19359c,_0x23aaf4,_0x64c709,_0x4ad962,_0x5d21c5){logger[_0xa63e('0xb')](_0xa63e('0xc'));var _0x5eb8bc=new Date();var _0xe54701=[{'name':_0xa63e('0xd'),'value':intUtil[_0xa63e('0xe')](_0x19359c[_0xa63e('0xf')],_0x23aaf4,'\x20')},{'name':_0xa63e('0x10'),'value':_0x1895fd['id']},{'name':'created_by','value':_0x1895fd['id']},{'name':_0xa63e('0x11'),'value':intUtil[_0xa63e('0xe')](_0x19359c[_0xa63e('0x12')],_0x23aaf4,'\x0a')},{'name':_0xa63e('0x13'),'value':_0x5eb8bc[_0xa63e('0x14')]()[_0xa63e('0x15')](0x0,0x13)[_0xa63e('0x16')]('T','\x20')},{'name':_0xa63e('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xa63e('0x18'),'value':_0x2342ab['id']},{'name':_0xa63e('0x19'),'value':_0xa63e('0x1a')},{'name':_0xa63e('0x1b'),'value':_0x2342ab[_0xa63e('0xd')]},{'name':_0xa63e('0x1c'),'value':_0x5d21c5}];if(_0x64c709[_0xa63e('0x1d')]){_[_0xa63e('0x1e')](_0x64c709,function(_0x1b4fd3){if(_0x23aaf4[_0x1b4fd3[_0xa63e('0x1f')]]){_0xe54701[_0xa63e('0x20')]({'name':_0x1b4fd3[_0xa63e('0x21')],'value':_0x23aaf4[_0x1b4fd3[_0xa63e('0x1f')]]});}});}return request({'form':{'method':_0xa63e('0x22'),'input_type':_0xa63e('0x23'),'response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'session':_0x4ad962['id'],'module_name':_0xa63e('0x25'),'name_value_list':_0xe54701})}});}function getAuth(_0x363bf0){return util[_0xa63e('0x26')](_0xa63e('0x27'),new Buffer(_0x363bf0['apiKey']+':X')[_0xa63e('0x28')](_0xa63e('0x29')));}function getServerInfo(_0xc3a876){return request({'form':{'method':_0xa63e('0x2a'),'input_type':_0xa63e('0x23'),'response_type':_0xa63e('0x23'),'rest_data':JSON['stringify']({'session':_0xc3a876['id']})}});}function getUser(_0x2689a2,_0x9a8144,_0xd77739){if(!_[_0xa63e('0x2b')](_0x9a8144)){logger['info'](_0xa63e('0x2c'),_0x9a8144);return request({'form':{'method':_0xa63e('0x2d'),'input_type':_0xa63e('0x23'),'response_type':_0xa63e('0x23'),'rest_data':JSON[_0xa63e('0x24')]({'session':_0xd77739['id'],'module_name':_0xa63e('0x2e'),'query':util[_0xa63e('0x26')](_0xa63e('0x2f'),_0x9a8144),'order_by':'','offset':'0','select_fields':['id',_0xa63e('0xd'),_0xa63e('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa63e('0x31')](function(_0xbed636){if(_0xbed636[_0xa63e('0x32')][_0xa63e('0x1d')]){var _0xac8e1e=_[_0xa63e('0x33')](_0xbed636[_0xa63e('0x32')],function(_0x1dcb6f){return _0x1dcb6f[_0xa63e('0x34')]['user_name'][_0xa63e('0x35')]===_0x9a8144;});if(_0xac8e1e){logger[_0xa63e('0xb')](_0xa63e('0x36'));return BPromise[_0xa63e('0x37')]({'id':_0xac8e1e[_0xa63e('0x34')]['id'][_0xa63e('0x35')],'name':_0xac8e1e[_0xa63e('0x34')][_0xa63e('0xd')]['value']});}}logger[_0xa63e('0xb')](_0xa63e('0x38'));return BPromise[_0xa63e('0x37')]({'id':_0xd77739[_0xa63e('0x34')][_0xa63e('0x39')]['value'],'name':_0xd77739[_0xa63e('0x34')][_0xa63e('0x30')]['value']});});}else{logger[_0xa63e('0xb')](_0xa63e('0x3a'));return BPromise[_0xa63e('0x37')]({'id':_0xd77739[_0xa63e('0x34')][_0xa63e('0x39')][_0xa63e('0x35')],'name':_0xd77739['name_value_list'][_0xa63e('0x30')]['value']});}}function getEndUser(_0x102a7e,_0x2be09b,_0x2548d3,_0x559d5){logger[_0xa63e('0xb')](_0xa63e('0x3b'),_0x2548d3);return request({'form':{'method':_0xa63e('0x2d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'session':_0x559d5['id'],'module_name':_0xa63e('0x1a'),'query':util[_0xa63e('0x26')](_0xa63e('0x3c'),_0x2548d3),'order_by':'','offset':'0','select_fields':['id',_0xa63e('0xd'),_0xa63e('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa63e('0x31')](function(_0x593d86){if(_0x593d86['entry_list'][_0xa63e('0x1d')]){var _0x1721ac=_[_0xa63e('0x33')](_0x593d86[_0xa63e('0x32')],function(_0x3b57ed){return _0x3b57ed[_0xa63e('0x34')][_0xa63e('0x3d')]['value']===_0x2548d3;});if(_0x1721ac){logger[_0xa63e('0xb')](_0xa63e('0x3e'));return BPromise['resolve']({'id':_0x1721ac[_0xa63e('0x34')]['id'][_0xa63e('0x35')],'name':_0x1721ac['name_value_list'][_0xa63e('0xd')][_0xa63e('0x35')],'phone':_0x1721ac[_0xa63e('0x34')][_0xa63e('0x3d')][_0xa63e('0x35')]});}}else{logger[_0xa63e('0xb')](_0xa63e('0x3f'));return request({'form':{'method':'set_entry','input_type':_0xa63e('0x23'),'response_type':_0xa63e('0x23'),'rest_data':JSON['stringify']({'session':_0x559d5['id'],'module_name':_0xa63e('0x1a'),'name_value_list':[{'name':_0xa63e('0x40'),'value':_0x2be09b!==_0xa63e('0x41')?_0x2be09b:util[_0xa63e('0x26')](_0xa63e('0x42'),_0x2548d3)},{'name':_0xa63e('0x3d'),'value':_0x2548d3}]})}})[_0xa63e('0x31')](function(_0x44688){logger[_0xa63e('0xb')](_0xa63e('0x43'));return BPromise['resolve']({'id':_0x44688['id'],'name':_0x44688[_0xa63e('0x32')][_0xa63e('0x40')][_0xa63e('0x35')],'phone':_0x44688[_0xa63e('0x32')]['phone_home'][_0xa63e('0x35')]});});}});}function request(_0xbbaba7){logger[_0xa63e('0x44')](_0xa63e('0x45'),JSON[_0xa63e('0x24')](_0xbbaba7));return rp(_[_0xa63e('0x46')](def,_0xbbaba7));}function getTags(_0x504048,_0x4f8b98){var _0x27d883=[];if(_0x504048&&_0x504048[_0xa63e('0x1d')]>0x0){_0x27d883=_['map'](_0x504048,_0x4f8b98);}return _0x27d883;}function getCustomFields(_0x27f7c7,_0x56dbf4){var _0x50e0d4=[];var _0x19bbe1={'custom_fields':[]};if(_0x27f7c7[_0xa63e('0x1d')]>0x0){_['forEach'](_0x27f7c7,function(_0x25fc92){if(_0x25fc92[_0xa63e('0x47')]===_0xa63e('0x48')&&_0x25fc92['nameField']&&!_0x25fc92[_0xa63e('0x49')]){_0x19bbe1[_0x25fc92['nameField'][_0xa63e('0x4a')]()]=_0x25fc92[_0xa63e('0x4b')][_0xa63e('0x28')]();}else if(_0x25fc92['type']===_0xa63e('0x48')&&_0x25fc92[_0xa63e('0x21')]&&_0x25fc92[_0xa63e('0x49')]){_0x19bbe1[_0xa63e('0x4c')][_0xa63e('0x20')]({'id':_0x25fc92['idField'],'value':_0x25fc92[_0xa63e('0x4b')]['toString']()});}else if(_0x25fc92[_0xa63e('0x47')]===_0xa63e('0x4d')&&_0x25fc92[_0xa63e('0x1f')]&&_0x25fc92[_0xa63e('0x21')]&&_0x25fc92['customField']){_0x56dbf4[_0x25fc92[_0xa63e('0x1f')]]&&_0x19bbe1['custom_fields'][_0xa63e('0x20')]({'id':_0x25fc92[_0xa63e('0x21')],'value':_0x56dbf4[_0x25fc92[_0xa63e('0x1f')]][_0xa63e('0x28')]()});}else if(_0x25fc92[_0xa63e('0x47')]===_0xa63e('0x4e')&&_0x25fc92['Variable']&&_0x25fc92[_0xa63e('0x4f')][_0xa63e('0xd')]&&_0x25fc92[_0xa63e('0x21')]&&_0x25fc92[_0xa63e('0x49')]){_0x56dbf4[_0x25fc92[_0xa63e('0x4f')]['name'][_0xa63e('0x4a')]()]&&_0x19bbe1[_0xa63e('0x4c')][_0xa63e('0x20')]({'id':_0x25fc92[_0xa63e('0x21')],'value':_0x56dbf4[_0x25fc92[_0xa63e('0x4f')][_0xa63e('0xd')][_0xa63e('0x4a')]()][_0xa63e('0x28')]()});}});}return _0x19bbe1;}function getConnection(_0x40c90e){return request({'method':'POST','form':{'method':_0xa63e('0x50'),'input_type':_0xa63e('0x23'),'response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'user_auth':{'user_name':_0x40c90e[_0xa63e('0x51')],'password':_0x40c90e[_0xa63e('0x52')],'encryption':_0xa63e('0x53')},'application':_0xa63e('0x54')})}})[_0xa63e('0x31')](function(_0x41d4a8){var _0x48d1f9=_0x41d4a8;if(_0x48d1f9['id']){def[_0xa63e('0x55')]=_0x48d1f9['id'];return BPromise[_0xa63e('0x37')](_0x48d1f9);}else{throw new Error(util['format'](_0xa63e('0x56'),_0x40c90e['id']));}});}function setRelationship(_0x4cf7d6,_0x41f502,_0x2590ea,_0x5b5650){return request({'form':{'method':_0xa63e('0x57'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa63e('0x24')]({'session':_0x4cf7d6['id'],'module_name':_0xa63e('0x25'),'module_id':_0x2590ea['id'],'link_field_name':_0x5b5650,'related_ids':[_0x41f502['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa63e('0x58')]=function(_0x8e9675,_0x5a10fe,_0x34665e,_0x57dbc0,_0x278dab,_0x1b38bf){var _0x262e36,_0x188c56,_0xa95349,_0x4d25f6;_0x1b38bf[_0xa63e('0x59')]=intUtil[_0xa63e('0x5a')](_0x1b38bf['remoteUri']);_0x1b38bf[_0xa63e('0x5b')]=intUtil['stripTrailingSlash'](_0x1b38bf[_0xa63e('0x5b')]);def['uri']=util['format'](_0xa63e('0x5c'),_0x1b38bf[_0xa63e('0x59')]);if(_0x278dab&&_0x278dab[_0xa63e('0x5d')]){logger[_0xa63e('0xb')](_0xa63e('0x5e'),_0xa63e('0x5f'));_0x5a10fe['recordingURL']=util[_0xa63e('0x26')](_0xa63e('0x60'),_0x1b38bf[_0xa63e('0x5b')],_0x5a10fe[_0xa63e('0x61')],md5(_0x5a10fe[_0xa63e('0x61')]));}else{_0x5a10fe[_0xa63e('0x62')]='';}return getConnection(_0x1b38bf)['then'](function(_0x59127c){_0x4d25f6=_0x59127c;return getUser(_0x1b38bf,_0x57dbc0[_0xa63e('0xd')],_0x4d25f6);})['then'](function(_0x5bf9d9){_0x262e36=_0x5bf9d9;logger[_0xa63e('0xb')](_0xa63e('0x63'),_0x262e36['id']);return getEndUser(_0x1b38bf,_0x5a10fe['calleridname'],_0x5a10fe[_0xa63e('0x64')],_0x4d25f6);})[_0xa63e('0x31')](function(_0x4976cf){_0x188c56=_0x4976cf;logger[_0xa63e('0xb')](_0xa63e('0x65'),_0x188c56['id']);return getTicket(_0x1b38bf,_0x262e36,_0x188c56,_0x34665e,_0x5a10fe,_0x34665e['Fields'],_0x4d25f6,_0xa63e('0x66'));})[_0xa63e('0x31')](function(_0x4c0fa8){_0xa95349=_0x4c0fa8;logger[_0xa63e('0xb')](_0xa63e('0x67'));logger[_0xa63e('0xb')]('The\x20Ticket\x20ID\x20is:',_0xa95349['id']);return setRelationship(_0x4d25f6,_0x262e36,_0xa95349,_0xa63e('0x68'));})['then'](function(){return setRelationship(_0x4d25f6,_0x188c56,_0xa95349,_0xa63e('0x69'));})['then'](function(){return getServerInfo(_0x4d25f6);})[_0xa63e('0x31')](function(_0x82cbd6){var _0x3975a8=parseInt(_0x82cbd6[_0xa63e('0x6a')][_0xa63e('0x6b')](0x0));var _0x3b766d=util[_0xa63e('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1b38bf['remoteUri'],_0xa95349['id']);if(_0x3975a8>0x6){_0x3b766d=util['format'](_0xa63e('0x6c'),_0x1b38bf[_0xa63e('0x59')],_0xa95349['id']);}logger['info'](_0xa63e('0x5e'),_0xa63e('0x6d'));emit(util[_0xa63e('0x26')](_0xa63e('0x6e'),_0x57dbc0[_0xa63e('0xd')]),_0xa63e('0x6f'),{'uri':_0x3b766d});})[_0xa63e('0x70')](function(_0x4a2ad7){logger[_0xa63e('0x71')](_0xa63e('0x5e'),JSON[_0xa63e('0x24')](_0x4a2ad7));});};exports[_0xa63e('0x72')]=function(_0x3d063f,_0x18d31e,_0x585b43,_0x16f476,_0xfeb79c,_0x367127,_0x23e46b){var _0x5b0718,_0x557a19,_0x13919d,_0x5e01c9;_0x367127[_0xa63e('0x59')]=intUtil[_0xa63e('0x5a')](_0x367127[_0xa63e('0x59')]);_0x367127['serverUrl']=intUtil[_0xa63e('0x5a')](_0x367127['serverUrl']);def[_0xa63e('0x73')]=util['format'](_0xa63e('0x5c'),_0x367127[_0xa63e('0x59')]);if(_0x23e46b&&_0x23e46b['recordingFormat']&&_0x23e46b[_0xa63e('0x74')]!==_0xa63e('0x75')){logger[_0xa63e('0xb')](_0xa63e('0x76'),_0xa63e('0x5f'));_0x18d31e[_0xa63e('0x62')]=util[_0xa63e('0x26')](_0xa63e('0x60'),_0x367127[_0xa63e('0x5b')],_0x18d31e[_0xa63e('0x61')],md5(_0x18d31e[_0xa63e('0x61')]));}return getConnection(_0x367127)['then'](function(_0x1b3dd4){_0x5e01c9=_0x1b3dd4;return getUser(_0x367127,_0x16f476[_0xa63e('0xd')],_0x5e01c9);})[_0xa63e('0x31')](function(_0x5ed8c9){_0x5b0718=_0x5ed8c9;logger[_0xa63e('0xb')](_0xa63e('0x63'),_0x5b0718['id']);return getEndUser(_0x367127,_0x18d31e[_0xa63e('0x77')],_0x18d31e['destcalleridnum'],_0x5e01c9);})['then'](function(_0x261bbb){_0x557a19=_0x261bbb;logger[_0xa63e('0xb')](_0xa63e('0x65'),_0x557a19['id']);return getTicket(_0x367127,_0x5b0718,_0x557a19,_0x585b43,_0x18d31e,_0x585b43[_0xa63e('0x78')],_0x5e01c9,_0xa63e('0x79'));})[_0xa63e('0x31')](function(_0xbf1824){_0x13919d=_0xbf1824;logger[_0xa63e('0xb')](_0xa63e('0x67'));logger[_0xa63e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x13919d['id']);return setRelationship(_0x5e01c9,_0x5b0718,_0x13919d,'users');})[_0xa63e('0x31')](function(){return setRelationship(_0x5e01c9,_0x557a19,_0x13919d,'contacts');})[_0xa63e('0x31')](function(){return getServerInfo(_0x5e01c9);})[_0xa63e('0x31')](function(_0x22f060){var _0x117331=parseInt(_0x22f060[_0xa63e('0x6a')]['charAt'](0x0));var _0x15458c=util[_0xa63e('0x26')](_0xa63e('0x7a'),_0x367127['remoteUri'],_0x13919d['id']);if(_0x117331>0x6){_0x15458c=util['format'](_0xa63e('0x6c'),_0x367127[_0xa63e('0x59')],_0x13919d['id']);}logger['info'](_0xa63e('0x76'),_0xa63e('0x6d'));emit(util[_0xa63e('0x26')]('user:%s',_0x16f476['name']),_0xa63e('0x6f'),{'uri':_0x15458c});})[_0xa63e('0x70')](function(_0x4cf4bb){logger[_0xa63e('0x71')](_0xa63e('0x76'),JSON[_0xa63e('0x24')](_0x4cf4bb));});};exports[_0xa63e('0x7b')]=function(_0xb94184,_0xa98dd2,_0x2a9692,_0x2e947f,_0x10a84c,_0x47af17){var _0x46f86e,_0x4e24fe,_0x1e68ae,_0x477e04;_0x47af17[_0xa63e('0x59')]=intUtil['stripTrailingSlash'](_0x47af17[_0xa63e('0x59')]);_0x47af17['serverUrl']=intUtil[_0xa63e('0x5a')](_0x47af17[_0xa63e('0x5b')]);def[_0xa63e('0x73')]=util[_0xa63e('0x26')](_0xa63e('0x5c'),_0x47af17[_0xa63e('0x59')]);if(_0x10a84c&&_0x10a84c[_0xa63e('0x5d')]){logger['info']('['+_0xa98dd2[_0xa63e('0x7c')][_0xa63e('0x7d')]()+']',_0xa63e('0x5f'));_0xa98dd2[_0xa63e('0x62')]=util[_0xa63e('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47af17[_0xa63e('0x5b')],_0xa98dd2[_0xa63e('0x61')],md5(_0xa98dd2[_0xa63e('0x61')]));}else{_0xa98dd2[_0xa63e('0x62')]='';}return getConnection(_0x47af17)[_0xa63e('0x31')](function(_0x466476){_0x477e04=_0x466476;if(!_[_0xa63e('0x2b')](_0x2e947f)){return getUser(_0x47af17,_0x2e947f[_0xa63e('0xd')],_0x477e04);}else{return getUser(_0x47af17,null,_0x477e04);}})[_0xa63e('0x31')](function(_0x35a940){_0x46f86e=_0x35a940;logger['info'](_0xa63e('0x63'),_0x46f86e['id']);return getEndUser(_0x47af17,_0xa98dd2[_0xa63e('0x7e')],_0xa98dd2[_0xa63e('0x64')],_0x477e04);})[_0xa63e('0x31')](function(_0x2ae000){_0x4e24fe=_0x2ae000;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4e24fe['id']);return getTicket(_0x47af17,_0x46f86e,_0x4e24fe,_0x2a9692,_0xa98dd2,_0x2a9692[_0xa63e('0x78')],_0x477e04,_0xa63e('0x66'));})[_0xa63e('0x31')](function(_0x3dd457){_0x1e68ae=_0x3dd457;logger[_0xa63e('0xb')](_0xa63e('0x67'));logger[_0xa63e('0xb')](_0xa63e('0x7f'),_0x1e68ae['id']);return setRelationship(_0x477e04,_0x46f86e,_0x1e68ae,_0xa63e('0x68'));})[_0xa63e('0x31')](function(){return setRelationship(_0x477e04,_0x4e24fe,_0x1e68ae,_0xa63e('0x69'));})[_0xa63e('0x31')](function(){return getServerInfo(_0x477e04);})['catch'](function(_0x4a66f7){logger[_0xa63e('0x71')]('['+_0xa98dd2[_0xa63e('0x7c')][_0xa63e('0x7d')]()+']',JSON[_0xa63e('0x24')](_0x4a66f7));});}; \ No newline at end of file +var _0x13f1=['Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','users','contacts','catch','error','unmanaged','uri','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent','lodash','request-promise','bluebird','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','map','type','string','nameField','customField','toLowerCase','custom_fields','push','content','variable','Variable','username','xCALLY\x20Motion\x20integration'];(function(_0x5cbf66,_0x37c600){var _0x3c6861=function(_0x1b8ce4){while(--_0x1b8ce4){_0x5cbf66['push'](_0x5cbf66['shift']());}};_0x3c6861(++_0x37c600);}(_0x13f1,0x113));var _0x113f=function(_0x334bbc,_0x3acef7){_0x334bbc=_0x334bbc-0x0;var _0x236069=_0x13f1[_0x334bbc];return _0x236069;};'use strict';var _=require(_0x113f('0x0'));var rp=require(_0x113f('0x1'));var BPromise=require(_0x113f('0x2'));var md5=require('md5');var util=require(_0x113f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x113f('0x4'));var config=require(_0x113f('0x5'));var logger=require(_0x113f('0x6'))(_0x113f('0x7'));config[_0x113f('0x8')]=_['defaults'](config['redis'],{'host':_0x113f('0x9'),'port':0x18eb});var io=require(_0x113f('0xa'))(new Redis(config[_0x113f('0x8')]));var def={'method':_0x113f('0xb'),'json':!![]};function emit(_0x56b7b4,_0x99afa5,_0x46033f){io['to'](_0x56b7b4)[_0x113f('0xc')](_0x99afa5,_0x46033f);}function getTicket(_0x23142a,_0x759ae9,_0x31fc7a,_0x344d12,_0xbb6633,_0x1694f1,_0x4c1ae0,_0x453846){logger[_0x113f('0xd')](_0x113f('0xe'));var _0x4a01b7=new Date();var _0x15fe3e=[{'name':_0x113f('0xf'),'value':intUtil[_0x113f('0x10')](_0x344d12['Subjects'],_0xbb6633,'\x20')},{'name':_0x113f('0x11'),'value':_0x759ae9['id']},{'name':'created_by','value':_0x759ae9['id']},{'name':_0x113f('0x12'),'value':intUtil[_0x113f('0x10')](_0x344d12[_0x113f('0x13')],_0xbb6633,'\x0a')},{'name':'date_start','value':_0x4a01b7[_0x113f('0x14')]()[_0x113f('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x113f('0x16'),'value':'0'},{'name':_0x113f('0x17'),'value':'15'},{'name':'parent_id','value':_0x31fc7a['id']},{'name':_0x113f('0x18'),'value':_0x113f('0x19')},{'name':_0x113f('0x1a'),'value':_0x31fc7a[_0x113f('0xf')]},{'name':_0x113f('0x1b'),'value':_0x453846}];if(_0x1694f1[_0x113f('0x1c')]){_[_0x113f('0x1d')](_0x1694f1,function(_0x5a23c2){if(_0xbb6633[_0x5a23c2[_0x113f('0x1e')]]){_0x15fe3e['push']({'name':_0x5a23c2[_0x113f('0x1f')],'value':_0xbb6633[_0x5a23c2[_0x113f('0x1e')]]});}});}return request({'form':{'method':_0x113f('0x20'),'input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON[_0x113f('0x22')]({'session':_0x4c1ae0['id'],'module_name':_0x113f('0x23'),'name_value_list':_0x15fe3e})}});}function getAuth(_0x2322ac){return util[_0x113f('0x24')]('Basic\x20%s',new Buffer(_0x2322ac[_0x113f('0x25')]+':X')[_0x113f('0x26')](_0x113f('0x27')));}function getServerInfo(_0x205887){return request({'form':{'method':_0x113f('0x28'),'input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON[_0x113f('0x22')]({'session':_0x205887['id']})}});}function getUser(_0x29bd26,_0x24b7a0,_0xc419f3){if(!_[_0x113f('0x29')](_0x24b7a0)){logger[_0x113f('0xd')](_0x113f('0x2a'),_0x24b7a0);return request({'form':{'method':'get_entry_list','input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON[_0x113f('0x22')]({'session':_0xc419f3['id'],'module_name':_0x113f('0x2b'),'query':util[_0x113f('0x24')](_0x113f('0x2c'),_0x24b7a0),'order_by':'','offset':'0','select_fields':['id',_0x113f('0xf'),_0x113f('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x113f('0x2e')](function(_0x5be7de){if(_0x5be7de[_0x113f('0x2f')][_0x113f('0x1c')]){var _0x51271d=_[_0x113f('0x30')](_0x5be7de[_0x113f('0x2f')],function(_0x200b2f){return _0x200b2f[_0x113f('0x31')][_0x113f('0x2d')][_0x113f('0x32')]===_0x24b7a0;});if(_0x51271d){logger['info'](_0x113f('0x33'));return BPromise[_0x113f('0x34')]({'id':_0x51271d[_0x113f('0x31')]['id'][_0x113f('0x32')],'name':_0x51271d[_0x113f('0x31')][_0x113f('0xf')][_0x113f('0x32')]});}}logger[_0x113f('0xd')](_0x113f('0x35'));return BPromise[_0x113f('0x34')]({'id':_0xc419f3[_0x113f('0x31')][_0x113f('0x36')][_0x113f('0x32')],'name':_0xc419f3['name_value_list'][_0x113f('0x2d')]['value']});});}else{logger[_0x113f('0xd')](_0x113f('0x37'));return BPromise['resolve']({'id':_0xc419f3[_0x113f('0x31')][_0x113f('0x36')][_0x113f('0x32')],'name':_0xc419f3[_0x113f('0x31')][_0x113f('0x2d')]['value']});}}function getEndUser(_0x41880b,_0x16fec2,_0x3547cc,_0xe4c665){logger[_0x113f('0xd')](_0x113f('0x38'),_0x3547cc);return request({'form':{'method':_0x113f('0x39'),'input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON[_0x113f('0x22')]({'session':_0xe4c665['id'],'module_name':_0x113f('0x19'),'query':util[_0x113f('0x24')](_0x113f('0x3a'),_0x3547cc),'order_by':'','offset':'0','select_fields':['id',_0x113f('0xf'),_0x113f('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x113f('0x2e')](function(_0x1fc8d5){if(_0x1fc8d5[_0x113f('0x2f')]['length']){var _0x15da63=_['find'](_0x1fc8d5[_0x113f('0x2f')],function(_0x4f1894){return _0x4f1894[_0x113f('0x31')][_0x113f('0x3b')][_0x113f('0x32')]===_0x3547cc;});if(_0x15da63){logger[_0x113f('0xd')]('Enduser\x20found!');return BPromise[_0x113f('0x34')]({'id':_0x15da63[_0x113f('0x31')]['id'][_0x113f('0x32')],'name':_0x15da63[_0x113f('0x31')][_0x113f('0xf')]['value'],'phone':_0x15da63['name_value_list'][_0x113f('0x3b')][_0x113f('0x32')]});}}else{logger[_0x113f('0xd')](_0x113f('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON[_0x113f('0x22')]({'session':_0xe4c665['id'],'module_name':_0x113f('0x19'),'name_value_list':[{'name':_0x113f('0x3d'),'value':_0x16fec2!==_0x113f('0x3e')?_0x16fec2:util['format'](_0x113f('0x3f'),_0x3547cc)},{'name':_0x113f('0x3b'),'value':_0x3547cc}]})}})[_0x113f('0x2e')](function(_0x2e3e3d){logger[_0x113f('0xd')](_0x113f('0x40'));return BPromise[_0x113f('0x34')]({'id':_0x2e3e3d['id'],'name':_0x2e3e3d[_0x113f('0x2f')][_0x113f('0x3d')][_0x113f('0x32')],'phone':_0x2e3e3d['entry_list']['phone_home'][_0x113f('0x32')]});});}});}function request(_0x41eb17){logger['debug'](_0x113f('0x41'),JSON['stringify'](_0x41eb17));return rp(_['merge'](def,_0x41eb17));}function getTags(_0x3485f9,_0x3effb4){var _0x3d27d4=[];if(_0x3485f9&&_0x3485f9['length']>0x0){_0x3d27d4=_[_0x113f('0x42')](_0x3485f9,_0x3effb4);}return _0x3d27d4;}function getCustomFields(_0x246ce4,_0x188865){var _0x3f7be1=[];var _0x5f1919={'custom_fields':[]};if(_0x246ce4['length']>0x0){_['forEach'](_0x246ce4,function(_0x294446){if(_0x294446[_0x113f('0x43')]===_0x113f('0x44')&&_0x294446[_0x113f('0x45')]&&!_0x294446[_0x113f('0x46')]){_0x5f1919[_0x294446['nameField'][_0x113f('0x47')]()]=_0x294446['content'][_0x113f('0x26')]();}else if(_0x294446['type']==='string'&&_0x294446[_0x113f('0x1f')]&&_0x294446['customField']){_0x5f1919[_0x113f('0x48')][_0x113f('0x49')]({'id':_0x294446[_0x113f('0x1f')],'value':_0x294446[_0x113f('0x4a')]['toString']()});}else if(_0x294446[_0x113f('0x43')]===_0x113f('0x4b')&&_0x294446[_0x113f('0x1e')]&&_0x294446[_0x113f('0x1f')]&&_0x294446[_0x113f('0x46')]){_0x188865[_0x294446[_0x113f('0x1e')]]&&_0x5f1919[_0x113f('0x48')][_0x113f('0x49')]({'id':_0x294446[_0x113f('0x1f')],'value':_0x188865[_0x294446[_0x113f('0x1e')]]['toString']()});}else if(_0x294446[_0x113f('0x43')]==='customVariable'&&_0x294446[_0x113f('0x4c')]&&_0x294446[_0x113f('0x4c')][_0x113f('0xf')]&&_0x294446[_0x113f('0x1f')]&&_0x294446[_0x113f('0x46')]){_0x188865[_0x294446[_0x113f('0x4c')][_0x113f('0xf')][_0x113f('0x47')]()]&&_0x5f1919[_0x113f('0x48')][_0x113f('0x49')]({'id':_0x294446[_0x113f('0x1f')],'value':_0x188865[_0x294446[_0x113f('0x4c')][_0x113f('0xf')][_0x113f('0x47')]()]['toString']()});}});}return _0x5f1919;}function getConnection(_0x2bdb03){return request({'method':_0x113f('0xb'),'form':{'method':'login','input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2bdb03[_0x113f('0x4d')],'password':_0x2bdb03['password'],'encryption':'PLAIN'},'application':_0x113f('0x4e')})}})[_0x113f('0x2e')](function(_0x16d52f){var _0x785038=_0x16d52f;if(_0x785038['id']){def['sessionID']=_0x785038['id'];return BPromise['resolve'](_0x785038);}else{throw new Error(util[_0x113f('0x24')](_0x113f('0x4f'),_0x2bdb03['id']));}});}function setRelationship(_0x3527d4,_0x407375,_0x253ab8,_0x5732c9){return request({'form':{'method':_0x113f('0x50'),'input_type':_0x113f('0x21'),'response_type':_0x113f('0x21'),'rest_data':JSON['stringify']({'session':_0x3527d4['id'],'module_name':_0x113f('0x23'),'module_id':_0x253ab8['id'],'link_field_name':_0x5732c9,'related_ids':[_0x407375['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x751148,_0x4b47b0,_0x3c5683,_0xdf06be,_0x26848a,_0x12f1cd){var _0x333f89,_0xd8622d,_0x295621,_0x4f4314;_0x12f1cd[_0x113f('0x51')]=intUtil[_0x113f('0x52')](_0x12f1cd[_0x113f('0x51')]);_0x12f1cd[_0x113f('0x53')]=intUtil[_0x113f('0x52')](_0x12f1cd[_0x113f('0x53')]);def['uri']=util['format'](_0x113f('0x54'),_0x12f1cd[_0x113f('0x51')]);if(_0x26848a&&_0x26848a['monitor_format']){logger[_0x113f('0xd')](_0x113f('0x55'),_0x113f('0x56'));_0x4b47b0['recordingURL']=util[_0x113f('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12f1cd[_0x113f('0x53')],_0x4b47b0['uniqueid'],md5(_0x4b47b0[_0x113f('0x57')]));}else{_0x4b47b0[_0x113f('0x58')]='';}return getConnection(_0x12f1cd)[_0x113f('0x2e')](function(_0x2e9444){_0x4f4314=_0x2e9444;return getUser(_0x12f1cd,_0xdf06be[_0x113f('0xf')],_0x4f4314);})[_0x113f('0x2e')](function(_0x269735){_0x333f89=_0x269735;logger[_0x113f('0xd')](_0x113f('0x59'),_0x333f89['id']);return getEndUser(_0x12f1cd,_0x4b47b0[_0x113f('0x5a')],_0x4b47b0[_0x113f('0x5b')],_0x4f4314);})[_0x113f('0x2e')](function(_0x4a4e31){_0xd8622d=_0x4a4e31;logger[_0x113f('0xd')](_0x113f('0x5c'),_0xd8622d['id']);return getTicket(_0x12f1cd,_0x333f89,_0xd8622d,_0x3c5683,_0x4b47b0,_0x3c5683[_0x113f('0x5d')],_0x4f4314,_0x113f('0x5e'));})[_0x113f('0x2e')](function(_0x3850e9){_0x295621=_0x3850e9;logger[_0x113f('0xd')](_0x113f('0x5f'));logger[_0x113f('0xd')](_0x113f('0x60'),_0x295621['id']);return setRelationship(_0x4f4314,_0x333f89,_0x295621,'users');})['then'](function(){return setRelationship(_0x4f4314,_0xd8622d,_0x295621,'contacts');})[_0x113f('0x2e')](function(){return getServerInfo(_0x4f4314);})[_0x113f('0x2e')](function(_0x232bcf){var _0xd9324b=parseInt(_0x232bcf[_0x113f('0x61')][_0x113f('0x62')](0x0));var _0xd5c115=util['format'](_0x113f('0x63'),_0x12f1cd[_0x113f('0x51')],_0x295621['id']);if(_0xd9324b>0x6){_0xd5c115=util['format'](_0x113f('0x64'),_0x12f1cd[_0x113f('0x51')],_0x295621['id']);}logger['info'](_0x113f('0x55'),_0x113f('0x65'));emit(util[_0x113f('0x24')](_0x113f('0x66'),_0xdf06be[_0x113f('0xf')]),'trigger:browser:url',{'uri':_0xd5c115});})['catch'](function(_0x3dcf2d){logger['error']('[QUEUE]',JSON[_0x113f('0x22')](_0x3dcf2d));});};exports[_0x113f('0x67')]=function(_0x1f8362,_0xf2692f,_0x5a9471,_0x26b9aa,_0x3378f5,_0x2aea90,_0x217f23){var _0x3e7883,_0x28b0dd,_0x12b8e6,_0x214952;_0x2aea90[_0x113f('0x51')]=intUtil[_0x113f('0x52')](_0x2aea90[_0x113f('0x51')]);_0x2aea90[_0x113f('0x53')]=intUtil[_0x113f('0x52')](_0x2aea90[_0x113f('0x53')]);def['uri']=util[_0x113f('0x24')](_0x113f('0x54'),_0x2aea90[_0x113f('0x51')]);if(_0x217f23&&_0x217f23[_0x113f('0x68')]&&_0x217f23[_0x113f('0x68')]!==_0x113f('0x69')){logger[_0x113f('0xd')](_0x113f('0x6a'),_0x113f('0x56'));_0xf2692f[_0x113f('0x58')]=util[_0x113f('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2aea90['serverUrl'],_0xf2692f[_0x113f('0x57')],md5(_0xf2692f[_0x113f('0x57')]));}return getConnection(_0x2aea90)['then'](function(_0x1b607b){_0x214952=_0x1b607b;return getUser(_0x2aea90,_0x26b9aa[_0x113f('0xf')],_0x214952);})[_0x113f('0x2e')](function(_0x5253e0){_0x3e7883=_0x5253e0;logger['info'](_0x113f('0x59'),_0x3e7883['id']);return getEndUser(_0x2aea90,_0xf2692f['destcalleridname'],_0xf2692f[_0x113f('0x6b')],_0x214952);})[_0x113f('0x2e')](function(_0x2800d2){_0x28b0dd=_0x2800d2;logger['info'](_0x113f('0x5c'),_0x28b0dd['id']);return getTicket(_0x2aea90,_0x3e7883,_0x28b0dd,_0x5a9471,_0xf2692f,_0x5a9471['Fields'],_0x214952,_0x113f('0x6c'));})[_0x113f('0x2e')](function(_0x1f6f5d){_0x12b8e6=_0x1f6f5d;logger['info'](_0x113f('0x5f'));logger[_0x113f('0xd')](_0x113f('0x60'),_0x12b8e6['id']);return setRelationship(_0x214952,_0x3e7883,_0x12b8e6,_0x113f('0x6d'));})[_0x113f('0x2e')](function(){return setRelationship(_0x214952,_0x28b0dd,_0x12b8e6,_0x113f('0x6e'));})[_0x113f('0x2e')](function(){return getServerInfo(_0x214952);})[_0x113f('0x2e')](function(_0x4e557e){var _0x8d78eb=parseInt(_0x4e557e['version'][_0x113f('0x62')](0x0));var _0x1692d6=util[_0x113f('0x24')](_0x113f('0x63'),_0x2aea90['remoteUri'],_0x12b8e6['id']);if(_0x8d78eb>0x6){_0x1692d6=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2aea90[_0x113f('0x51')],_0x12b8e6['id']);}logger[_0x113f('0xd')](_0x113f('0x6a'),_0x113f('0x65'));emit(util[_0x113f('0x24')](_0x113f('0x66'),_0x26b9aa[_0x113f('0xf')]),'trigger:browser:url',{'uri':_0x1692d6});})[_0x113f('0x6f')](function(_0x117488){logger[_0x113f('0x70')](_0x113f('0x6a'),JSON['stringify'](_0x117488));});};exports[_0x113f('0x71')]=function(_0xf6a98f,_0x75a826,_0x41175f,_0x322a5e,_0x1158cd,_0x30bac8){var _0x4dfa27,_0x423e37,_0x40faae,_0x1bcb61;_0x30bac8[_0x113f('0x51')]=intUtil[_0x113f('0x52')](_0x30bac8[_0x113f('0x51')]);_0x30bac8['serverUrl']=intUtil[_0x113f('0x52')](_0x30bac8[_0x113f('0x53')]);def[_0x113f('0x72')]=util['format'](_0x113f('0x54'),_0x30bac8['remoteUri']);if(_0x1158cd&&_0x1158cd['monitor_format']){logger[_0x113f('0xd')]('['+_0x75a826['lastevent'][_0x113f('0x73')]()+']',_0x113f('0x56'));_0x75a826[_0x113f('0x58')]=util[_0x113f('0x24')](_0x113f('0x74'),_0x30bac8[_0x113f('0x53')],_0x75a826[_0x113f('0x57')],md5(_0x75a826['uniqueid']));}else{_0x75a826[_0x113f('0x58')]='';}return getConnection(_0x30bac8)[_0x113f('0x2e')](function(_0x4b3dfd){_0x1bcb61=_0x4b3dfd;if(!_[_0x113f('0x29')](_0x322a5e)){return getUser(_0x30bac8,_0x322a5e[_0x113f('0xf')],_0x1bcb61);}else{return getUser(_0x30bac8,null,_0x1bcb61);}})['then'](function(_0xd73fda){_0x4dfa27=_0xd73fda;logger[_0x113f('0xd')](_0x113f('0x59'),_0x4dfa27['id']);return getEndUser(_0x30bac8,_0x75a826[_0x113f('0x5a')],_0x75a826[_0x113f('0x5b')],_0x1bcb61);})[_0x113f('0x2e')](function(_0x56f724){_0x423e37=_0x56f724;logger[_0x113f('0xd')](_0x113f('0x5c'),_0x423e37['id']);return getTicket(_0x30bac8,_0x4dfa27,_0x423e37,_0x41175f,_0x75a826,_0x41175f[_0x113f('0x5d')],_0x1bcb61,_0x113f('0x5e'));})[_0x113f('0x2e')](function(_0x1161ee){_0x40faae=_0x1161ee;logger[_0x113f('0xd')](_0x113f('0x5f'));logger[_0x113f('0xd')](_0x113f('0x60'),_0x40faae['id']);return setRelationship(_0x1bcb61,_0x4dfa27,_0x40faae,_0x113f('0x6d'));})[_0x113f('0x2e')](function(){return setRelationship(_0x1bcb61,_0x423e37,_0x40faae,_0x113f('0x6e'));})[_0x113f('0x2e')](function(){return getServerInfo(_0x1bcb61);})[_0x113f('0x6f')](function(_0x1e20a3){logger[_0x113f('0x70')]('['+_0x75a826[_0x113f('0x75')][_0x113f('0x73')]()+']',JSON[_0x113f('0x22')](_0x1e20a3));});}; \ 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 eb8369d..d873dba 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 _0x1cdb=['isNil','test','lodash','util','sortBy','length','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join','substring','lastIndexOf'];(function(_0x2496b8,_0x292f47){var _0x2672f7=function(_0x160388){while(--_0x160388){_0x2496b8['push'](_0x2496b8['shift']());}};_0x2672f7(++_0x292f47);}(_0x1cdb,0x9e));var _0xb1cd=function(_0x157bc0,_0x1163d5){_0x157bc0=_0x157bc0-0x0;var _0x2b5b70=_0x1cdb[_0x157bc0];return _0x2b5b70;};'use strict';var _=require(_0xb1cd('0x0'));var util=require(_0xb1cd('0x1'));exports['getString']=function(_0xfbfdbb,_0x9a04a0,_0x21743f){var _0x5e47a0=[];if(_0xfbfdbb['length']>0x0){var _0x22f8f4=_[_0xb1cd('0x2')](_0xfbfdbb,['id']);for(var _0x553c7e=0x0;_0x553c7e<_0x22f8f4[_0xb1cd('0x3')];_0x553c7e++){var _0x50a652=_0x22f8f4[_0x553c7e];if(_0x50a652[_0xb1cd('0x4')]===_0xb1cd('0x5')){_0x5e47a0[_0xb1cd('0x6')](_0x50a652[_0xb1cd('0x7')]);}else if(_0x50a652[_0xb1cd('0x4')]===_0xb1cd('0x8')&&_0x50a652[_0xb1cd('0x9')]){_0x9a04a0[_0x50a652[_0xb1cd('0x9')]]&&_0x5e47a0[_0xb1cd('0x6')](_0x9a04a0[_0x50a652[_0xb1cd('0x9')]][_0xb1cd('0xa')]());}else if(_0x50a652[_0xb1cd('0x4')]==='customVariable'&&_0x50a652[_0xb1cd('0xb')]&&_0x50a652['Variable'][_0xb1cd('0xc')]){_0x9a04a0[_0x50a652[_0xb1cd('0xb')]['name'][_0xb1cd('0xd')]()]&&_0x5e47a0[_0xb1cd('0x6')](_0x9a04a0[_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')][_0xb1cd('0xd')]()][_0xb1cd('0xa')]());}else if(_0x50a652['type']===_0xb1cd('0xe')){if(_0x50a652[_0xb1cd('0xf')]===_0xb1cd('0x5')&&_0x50a652[_0xb1cd('0x10')]){_0x5e47a0[_0xb1cd('0x6')](util[_0xb1cd('0x11')](_0xb1cd('0x12'),_0x50a652['key'],_0x50a652[_0xb1cd('0x13')]));}else if(_0x50a652[_0xb1cd('0xf')]===_0xb1cd('0x8')&&_0x50a652[_0xb1cd('0x9')]&&_0x50a652[_0xb1cd('0x10')]){_0x9a04a0[_0x50a652['variableName']]&&_0x5e47a0[_0xb1cd('0x6')](util['format']('%s:\x20%s',_0x50a652['key'],_0x9a04a0[_0x50a652[_0xb1cd('0x9')]]));}else if(_0x50a652['keyType']===_0xb1cd('0x14')&&_0x50a652[_0xb1cd('0xb')]&&_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')]&&_0x50a652[_0xb1cd('0x10')]){_0x9a04a0[_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')][_0xb1cd('0xd')]()]&&_0x5e47a0['push'](util['format'](_0xb1cd('0x12'),_0x50a652[_0xb1cd('0x10')],_0x9a04a0[_0x50a652[_0xb1cd('0xb')][_0xb1cd('0xc')][_0xb1cd('0xd')]()]));}}}}return _0x5e47a0[_0xb1cd('0x15')](_0x21743f);};exports['stripTrailingSlash']=function(_0xb9935d){var _0x134044=_0xb9935d['slice'](-0x1);if(_0x134044==='/'){_0xb9935d=_0xb9935d[_0xb1cd('0x16')](0x0,_0xb9935d[_0xb1cd('0x17')](_0x134044));}return _0xb9935d;};exports['validateEmail']=function(_0x34b48f){if(!_[_0xb1cd('0x18')](_0x34b48f)&&_0x34b48f!==''){var _0x3e53ff=/^(([^<>()\[\]\\.,;:\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 _0x3e53ff[_0xb1cd('0x19')](String(_0x34b48f)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xed30=['keyContent','stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','getString','length','type','variable','variableName','push','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','string','key','format','%s:\x20%s'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xed30,0x1e1));var _0x0ed3=function(_0x27b015,_0x3bf27d){_0x27b015=_0x27b015-0x0;var _0x37c9ed=_0xed30[_0x27b015];return _0x37c9ed;};'use strict';var _=require(_0x0ed3('0x0'));var util=require(_0x0ed3('0x1'));exports[_0x0ed3('0x2')]=function(_0x447b2f,_0x4f603b,_0x513a5c){var _0x456070=[];if(_0x447b2f[_0x0ed3('0x3')]>0x0){var _0x3aa055=_['sortBy'](_0x447b2f,['id']);for(var _0x9a09fb=0x0;_0x9a09fb<_0x3aa055[_0x0ed3('0x3')];_0x9a09fb++){var _0x54148e=_0x3aa055[_0x9a09fb];if(_0x54148e[_0x0ed3('0x4')]==='string'){_0x456070['push'](_0x54148e['content']);}else if(_0x54148e['type']===_0x0ed3('0x5')&&_0x54148e[_0x0ed3('0x6')]){_0x4f603b[_0x54148e['variableName']]&&_0x456070[_0x0ed3('0x7')](_0x4f603b[_0x54148e['variableName']]['toString']());}else if(_0x54148e[_0x0ed3('0x4')]===_0x0ed3('0x8')&&_0x54148e[_0x0ed3('0x9')]&&_0x54148e[_0x0ed3('0x9')][_0x0ed3('0xa')]){_0x4f603b[_0x54148e['Variable']['name'][_0x0ed3('0xb')]()]&&_0x456070[_0x0ed3('0x7')](_0x4f603b[_0x54148e[_0x0ed3('0x9')]['name'][_0x0ed3('0xb')]()][_0x0ed3('0xc')]());}else if(_0x54148e[_0x0ed3('0x4')]===_0x0ed3('0xd')){if(_0x54148e[_0x0ed3('0xe')]===_0x0ed3('0xf')&&_0x54148e[_0x0ed3('0x10')]){_0x456070[_0x0ed3('0x7')](util[_0x0ed3('0x11')](_0x0ed3('0x12'),_0x54148e[_0x0ed3('0x10')],_0x54148e[_0x0ed3('0x13')]));}else if(_0x54148e[_0x0ed3('0xe')]===_0x0ed3('0x5')&&_0x54148e[_0x0ed3('0x6')]&&_0x54148e[_0x0ed3('0x10')]){_0x4f603b[_0x54148e[_0x0ed3('0x6')]]&&_0x456070['push'](util[_0x0ed3('0x11')](_0x0ed3('0x12'),_0x54148e[_0x0ed3('0x10')],_0x4f603b[_0x54148e['variableName']]));}else if(_0x54148e['keyType']===_0x0ed3('0x8')&&_0x54148e[_0x0ed3('0x9')]&&_0x54148e[_0x0ed3('0x9')][_0x0ed3('0xa')]&&_0x54148e[_0x0ed3('0x10')]){_0x4f603b[_0x54148e[_0x0ed3('0x9')][_0x0ed3('0xa')][_0x0ed3('0xb')]()]&&_0x456070[_0x0ed3('0x7')](util[_0x0ed3('0x11')](_0x0ed3('0x12'),_0x54148e[_0x0ed3('0x10')],_0x4f603b[_0x54148e[_0x0ed3('0x9')][_0x0ed3('0xa')]['toLowerCase']()]));}}}}return _0x456070['join'](_0x513a5c);};exports[_0x0ed3('0x14')]=function(_0x3513f5){var _0x52efb5=_0x3513f5[_0x0ed3('0x15')](-0x1);if(_0x52efb5==='/'){_0x3513f5=_0x3513f5[_0x0ed3('0x16')](0x0,_0x3513f5['lastIndexOf'](_0x52efb5));}return _0x3513f5;};exports[_0x0ed3('0x17')]=function(_0x36a581){if(!_['isNil'](_0x36a581)&&_0x36a581!==''){var _0x584eb4=/^(([^<>()\[\]\\.,;:\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 _0x584eb4[_0x0ed3('0x18')](String(_0x36a581)[_0x0ed3('0xb')]());}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 32d4794..aa017c0 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x2ecae0,_0x1ed524){var _0x29caff=function(_0x383719){while(--_0x383719){_0x2ecae0['push'](_0x2ecae0['shift']());}};_0x29caff(++_0x1ed524);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x5b2d8f,_0x53f9d4){var _0x2f1fdf=function(_0x1fd085){while(--_0x1fd085){_0x5b2d8f['push'](_0x5b2d8f['shift']());}};_0x2f1fdf(++_0x53f9d4);}(_0xe706,0xa3));var _0x6e70=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0xe706[_0x491cbe];return _0x59449d;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 0fc4a20..2a282b5 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 _0xffc9=['Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','inspect','unmanaged','lastevent','\x20Error\x20running\x20Zendesk\x20integration','md5','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','format','count','Agent\x20found!','find','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','%s:%s','username','password','authType','token','Basic\x20%s','toString','base64','[HTTP]','stringify','forEach','includes','type','nameField','customField','content','string','custom_fields','variableName','push','idField','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x51369c,_0x5ec552){var _0x387ee9=function(_0x21ed9e){while(--_0x21ed9e){_0x51369c['push'](_0x51369c['shift']());}};_0x387ee9(++_0x5ec552);}(_0xffc9,0x14d));var _0x9ffc=function(_0x34bb44,_0x347cf6){_0x34bb44=_0x34bb44-0x0;var _0x5edef3=_0xffc9[_0x34bb44];return _0x5edef3;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9ffc('0x0'));var util=require('util');var Redis=require(_0x9ffc('0x1'));var intUtil=require(_0x9ffc('0x2'));var config=require('../../../../config/environment');var logger=require(_0x9ffc('0x3'))(_0x9ffc('0x4'));config[_0x9ffc('0x5')]=_[_0x9ffc('0x6')](config[_0x9ffc('0x5')],{'host':_0x9ffc('0x7'),'port':0x18eb});var io=require(_0x9ffc('0x8'))(new Redis(config[_0x9ffc('0x5')]));function emit(_0x54eea7,_0x376b5a,_0x2a5de1){io['to'](_0x54eea7)['emit'](_0x376b5a,_0x2a5de1);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x25ffd7,_0x496071,_0x108491,_0x436b54,_0x3744fc){logger[_0x9ffc('0x9')](_0x9ffc('0xa'));return request({'uri':util['format'](_0x9ffc('0xb'),_0x25ffd7[_0x9ffc('0xc')]),'method':'POST','body':{'ticket':_[_0x9ffc('0xd')]({'requester_id':_0x108491['id'],'submitter_id':_0x496071?_0x496071['id']:undefined,'assignee_id':_0x496071?_0x496071['id']:undefined,'tags':getTags(_0x436b54[_0x9ffc('0xe')],_0x9ffc('0xf')),'subject':intUtil[_0x9ffc('0x10')](_0x436b54[_0x9ffc('0x11')],_0x3744fc,'\x20'),'description':intUtil['getString'](_0x436b54['Descriptions'],_0x3744fc,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9ffc('0x10')](_0x436b54[_0x9ffc('0x12')],_0x3744fc,'\x0a')}},getCustomFields(_0x436b54['Fields'],_0x3744fc))}})[_0x9ffc('0x13')](function(_0x3018aa){logger[_0x9ffc('0x9')](_0x9ffc('0x14'));return _0x3018aa['ticket'];});}function getUser(_0x2e55a9,_0x1ef986){if(intUtil[_0x9ffc('0x15')](_0x1ef986)){logger[_0x9ffc('0x9')](_0x9ffc('0x16'),_0x1ef986);return request({'uri':util['format']('%s/search.json',_0x2e55a9[_0x9ffc('0xc')]),'qs':{'query':util[_0x9ffc('0x17')]('type:user\x20role:agent\x20email:%s',_0x1ef986)}})[_0x9ffc('0x13')](function(_0x1ebe01){if(_0x1ebe01[_0x9ffc('0x18')]){logger[_0x9ffc('0x9')](_0x9ffc('0x19'));return _[_0x9ffc('0x1a')](_0x1ebe01['results'],{'email':_0x1ef986,'role':'agent'});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x2e55a9[_0x9ffc('0xc')])})[_0x9ffc('0x13')](function(_0x26b57a){logger[_0x9ffc('0x9')](_0x9ffc('0x1b'));return _0x26b57a[_0x9ffc('0x1c')];});}});}else{logger[_0x9ffc('0x9')](_0x9ffc('0x1d'));return request({'uri':util[_0x9ffc('0x17')](_0x9ffc('0x1e'),_0x2e55a9[_0x9ffc('0xc')])})[_0x9ffc('0x13')](function(_0x5101c2){logger['info']('Admin\x20account\x20selected.');return _0x5101c2[_0x9ffc('0x1c')];});}}function getEndUser(_0xde8bf3,_0x1fbd6c,_0x42b317){logger[_0x9ffc('0x9')](_0x9ffc('0x1f'),_0x42b317);return request({'uri':util[_0x9ffc('0x17')]('%s/search.json',_0xde8bf3[_0x9ffc('0xc')]),'qs':{'query':util[_0x9ffc('0x17')](_0x9ffc('0x20'),_0x42b317)}})['then'](function(_0x271835){var _0x13923f;if(_0x271835[_0x9ffc('0x21')]['length']){_0x271835[_0x9ffc('0x21')]=_[_0x9ffc('0x22')](_0x271835[_0x9ffc('0x21')],{'suspended':![],'role':_0x9ffc('0x23')});if(_0x271835[_0x9ffc('0x21')][_0x9ffc('0x24')]){_0x13923f=_[_0x9ffc('0x25')](_0x271835[_0x9ffc('0x21')]);}}if(_0x13923f){logger['info'](_0x9ffc('0x26'));return _0x13923f;}else{logger[_0x9ffc('0x9')](_0x9ffc('0x27'));return request({'uri':util[_0x9ffc('0x17')](_0x9ffc('0x28'),_0xde8bf3[_0x9ffc('0xc')]),'method':'POST','body':{'user':{'role':_0x9ffc('0x23'),'name':util[_0x9ffc('0x17')]('Caller\x20-\x20%s',_0x1fbd6c||_0x42b317),'phone':_0x42b317}}})[_0x9ffc('0x13')](function(_0x2cd816){logger[_0x9ffc('0x9')](_0x9ffc('0x29'));return _0x2cd816['user'];});}});}function getAuth(_0x2f51a1){var _0x4ff17f;if(_0x2f51a1['authType']==='password'){_0x4ff17f=util[_0x9ffc('0x17')](_0x9ffc('0x2a'),_0x2f51a1[_0x9ffc('0x2b')],_0x2f51a1[_0x9ffc('0x2c')]);}else if(_0x2f51a1[_0x9ffc('0x2d')]===_0x9ffc('0x2e')){_0x4ff17f=util[_0x9ffc('0x17')]('%s/token:%s',_0x2f51a1[_0x9ffc('0x2b')],_0x2f51a1['token']);}return util[_0x9ffc('0x17')](_0x9ffc('0x2f'),new Buffer(_0x4ff17f)[_0x9ffc('0x30')](_0x9ffc('0x31')));}function request(_0x46379a){logger['debug'](_0x9ffc('0x32'),JSON[_0x9ffc('0x33')](_0x46379a));return rp(_[_0x9ffc('0x6')](_0x46379a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x473731,_0x5d9ccd){var _0x547e43=[];if(_0x473731&&_0x473731[_0x9ffc('0x24')]>0x0){_0x547e43=_['map'](_0x473731,_0x5d9ccd);}return _0x547e43;}function getCustomFields(_0x277496,_0xef6872){var _0x3edc5f=[];var _0x41932a={'custom_fields':[]};if(_0x277496[_0x9ffc('0x24')]>0x0){_[_0x9ffc('0x34')](_0x277496,function(_0x338ea4){if(_[_0x9ffc('0x35')](['string','picklist'],_0x338ea4[_0x9ffc('0x36')])&&_0x338ea4[_0x9ffc('0x37')]&&!_0x338ea4[_0x9ffc('0x38')]){_0x41932a[_0x338ea4[_0x9ffc('0x37')]['toLowerCase']()]=_0x338ea4[_0x9ffc('0x39')][_0x9ffc('0x30')]();}else if(_['includes']([_0x9ffc('0x3a'),'picklist'],_0x338ea4[_0x9ffc('0x36')])&&_0x338ea4['idField']&&_0x338ea4[_0x9ffc('0x38')]){_0x41932a[_0x9ffc('0x3b')]['push']({'id':_0x338ea4['idField'],'value':_0x338ea4[_0x9ffc('0x39')]['toString']()});}else if(_0x338ea4[_0x9ffc('0x36')]==='variable'&&_0x338ea4[_0x9ffc('0x3c')]&&_0x338ea4['idField']&&_0x338ea4[_0x9ffc('0x38')]){_0xef6872[_0x338ea4['variableName']]&&_0x41932a['custom_fields'][_0x9ffc('0x3d')]({'id':_0x338ea4[_0x9ffc('0x3e')],'value':_0xef6872[_0x338ea4[_0x9ffc('0x3c')]][_0x9ffc('0x30')]()});}else if(_0x338ea4['type']===_0x9ffc('0x3f')&&_0x338ea4[_0x9ffc('0x40')]&&_0x338ea4[_0x9ffc('0x40')][_0x9ffc('0xf')]&&_0x338ea4['idField']&&_0x338ea4[_0x9ffc('0x38')]){_0xef6872[_0x338ea4[_0x9ffc('0x40')]['name']['toLowerCase']()]&&_0x41932a[_0x9ffc('0x3b')][_0x9ffc('0x3d')]({'id':_0x338ea4[_0x9ffc('0x3e')],'value':_0xef6872[_0x338ea4['Variable'][_0x9ffc('0xf')][_0x9ffc('0x41')]()][_0x9ffc('0x30')]()});}});}return _0x41932a;}exports[_0x9ffc('0x42')]=function(_0x1e4942,_0x263395,_0x22ecae,_0x5cc98c,_0x5cecc3,_0x37651d){var _0x6f7a22,_0x3f575e;_0x37651d[_0x9ffc('0xc')]=intUtil[_0x9ffc('0x43')](_0x37651d[_0x9ffc('0xc')]);_0x37651d[_0x9ffc('0x44')]=intUtil['stripTrailingSlash'](_0x37651d[_0x9ffc('0x44')]);if(_0x5cecc3&&_0x5cecc3[_0x9ffc('0x45')]){logger[_0x9ffc('0x9')](_0x9ffc('0x46'),_0x9ffc('0x47'));_0x263395['recordingURL']=util[_0x9ffc('0x17')](_0x9ffc('0x48'),_0x37651d['serverUrl'],_0x263395['uniqueid'],md5(_0x263395[_0x9ffc('0x49')]));}else{_0x263395[_0x9ffc('0x4a')]='';}headers[_0x9ffc('0x4b')]=getAuth(_0x37651d);return getUser(_0x37651d,_0x5cc98c[_0x9ffc('0x4c')])['then'](function(_0x53270e){_0x6f7a22=_0x53270e;logger[_0x9ffc('0x9')](_0x9ffc('0x4d'),_0x6f7a22['id']);return getEndUser(_0x37651d,_0x263395['calleridname'],_0x263395[_0x9ffc('0x4e')]);})['then'](function(_0x4b8b7f){_0x3f575e=_0x4b8b7f;logger[_0x9ffc('0x9')](_0x9ffc('0x4f'),_0x3f575e['id']);return getTicket(_0x37651d,_0x6f7a22,_0x3f575e,_0x22ecae,_0x263395);})[_0x9ffc('0x13')](function(_0x208c43){if(_0x208c43){logger[_0x9ffc('0x9')](_0x9ffc('0x50'),_0x208c43['id']);switch(_0x37651d[_0x9ffc('0x36')]){case'integrationTab':logger[_0x9ffc('0x9')](_0x9ffc('0x46'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x9ffc('0x17')](_0x9ffc('0x51'),_0x37651d[_0x9ffc('0xc')],_0x6f7a22['id'],_0x208c43['id']),'method':_0x9ffc('0x52')});case _0x9ffc('0x53'):logger[_0x9ffc('0x9')](_0x9ffc('0x46'),_0x9ffc('0x54'));emit(util[_0x9ffc('0x17')](_0x9ffc('0x55'),_0x5cc98c[_0x9ffc('0xf')]),'trigger:browser:url',{'uri':util[_0x9ffc('0x17')](_0x9ffc('0x56'),_0x37651d[_0x9ffc('0xc')][_0x9ffc('0x57')](_0x9ffc('0x58'),''),_0x208c43['id'])});break;default:logger[_0x9ffc('0x59')](_0x9ffc('0x46'),_0x9ffc('0x5a'));}}})[_0x9ffc('0x5b')](function(_0x406ea2){logger[_0x9ffc('0x59')](_0x9ffc('0x5c'),util['inspect'](_0x406ea2,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x561d15,_0x30dfc5,_0x2a9d3d,_0x4df815,_0x313bdc,_0x5549e5,_0xb61dbe){var _0x42d6ff,_0xad5a58;_0x5549e5[_0x9ffc('0xc')]=intUtil['stripTrailingSlash'](_0x5549e5['remoteUri']);_0x5549e5[_0x9ffc('0x44')]=intUtil[_0x9ffc('0x43')](_0x5549e5[_0x9ffc('0x44')]);if(_0xb61dbe&&_0xb61dbe[_0x9ffc('0x5d')]&&_0xb61dbe[_0x9ffc('0x5d')]!=='none'){logger['info']('[OUTBOUND]',_0x9ffc('0x47'));_0x30dfc5['recordingURL']=util[_0x9ffc('0x17')](_0x9ffc('0x48'),_0x5549e5[_0x9ffc('0x44')],_0x30dfc5[_0x9ffc('0x49')],md5(_0x30dfc5['uniqueid']));}headers['Authorization']=getAuth(_0x5549e5);return getUser(_0x5549e5,_0x4df815[_0x9ffc('0x4c')])[_0x9ffc('0x13')](function(_0x135e24){_0x42d6ff=_0x135e24;logger[_0x9ffc('0x9')](_0x9ffc('0x4d'),_0x42d6ff['id']);return getEndUser(_0x5549e5,_0x30dfc5[_0x9ffc('0x5e')],_0x30dfc5['destcalleridnum']);})[_0x9ffc('0x13')](function(_0x5f24e6){_0xad5a58=_0x5f24e6;logger[_0x9ffc('0x9')](_0x9ffc('0x4f'),_0xad5a58['id']);return getTicket(_0x5549e5,_0x42d6ff,_0xad5a58,_0x2a9d3d,_0x30dfc5);})['then'](function(_0x4bf831){if(_0x4bf831){logger['info'](_0x9ffc('0x50'),_0x4bf831['id']);switch(_0x5549e5[_0x9ffc('0x36')]){case'integrationTab':logger[_0x9ffc('0x9')](_0x9ffc('0x5f'),_0x9ffc('0x60'));return request({'uri':util[_0x9ffc('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5549e5[_0x9ffc('0xc')],_0x42d6ff['id'],_0x4bf831['id']),'method':_0x9ffc('0x52')});case _0x9ffc('0x53'):logger[_0x9ffc('0x9')](_0x9ffc('0x5f'),_0x9ffc('0x54'));emit(util[_0x9ffc('0x17')](_0x9ffc('0x55'),_0x4df815[_0x9ffc('0xf')]),'trigger:browser:url',{'uri':util['format'](_0x9ffc('0x56'),_0x5549e5[_0x9ffc('0xc')]['replace']('/api/v2',''),_0x4bf831['id'])});break;default:logger[_0x9ffc('0x59')](_0x9ffc('0x5f'),_0x9ffc('0x5a'));}}})[_0x9ffc('0x5b')](function(_0x391b42){logger[_0x9ffc('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x9ffc('0x61')](_0x391b42,{'showHidden':!![],'depth':null}));});};exports[_0x9ffc('0x62')]=function(_0x4facf2,_0x570b39,_0x249a16,_0xde35d1,_0x23c613,_0x474c14){var _0x157d78,_0x55ed14;_0x474c14[_0x9ffc('0xc')]=intUtil[_0x9ffc('0x43')](_0x474c14[_0x9ffc('0xc')]);_0x474c14[_0x9ffc('0x44')]=intUtil['stripTrailingSlash'](_0x474c14['serverUrl']);if(_0x23c613&&_0x23c613[_0x9ffc('0x45')]){logger['info']('['+_0x570b39[_0x9ffc('0x63')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x570b39[_0x9ffc('0x4a')]=util['format'](_0x9ffc('0x48'),_0x474c14[_0x9ffc('0x44')],_0x570b39['uniqueid'],md5(_0x570b39[_0x9ffc('0x49')]));}else{_0x570b39['recordingURL']='';}headers['Authorization']=getAuth(_0x474c14);return getUser(_0x474c14)['then'](function(_0x39dd47){_0x157d78=_0x39dd47;logger[_0x9ffc('0x9')](_0x9ffc('0x4d'),_0x157d78['id']);return getEndUser(_0x474c14,_0x570b39['calleridname'],_0x570b39['calleridnum']);})['then'](function(_0x3fc4d8){_0x55ed14=_0x3fc4d8;logger[_0x9ffc('0x9')](_0x9ffc('0x4f'),_0x55ed14['id']);return getTicket(_0x474c14,_0x157d78,_0x55ed14,_0x249a16,_0x570b39);})['then'](function(_0x3a6079){if(_0x3a6079){logger[_0x9ffc('0x9')](_0x9ffc('0x50'),_0x3a6079['id']);}})[_0x9ffc('0x5b')](function(_0x3182fb){logger[_0x9ffc('0x59')]('['+_0x570b39['lastevent']['toUpperCase']()+']'+_0x9ffc('0x64'),util[_0x9ffc('0x61')](_0x3182fb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0eda=['[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','./util','../../../../config/logger','zendesk','defaults','localhost','socket.io-emitter','redis','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','push','idField','variable','variableName','toString','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','replace','error','catch','inspect','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/api/v2'];(function(_0x1b1dbe,_0xaf583a){var _0x40f442=function(_0x3bfbb2){while(--_0x3bfbb2){_0x1b1dbe['push'](_0x1b1dbe['shift']());}};_0x40f442(++_0xaf583a);}(_0x0eda,0x15b));var _0xa0ed=function(_0x2fddfa,_0x1a93d9){_0x2fddfa=_0x2fddfa-0x0;var _0xe9ce65=_0x0eda[_0x2fddfa];return _0xe9ce65;};'use strict';var _=require('lodash');var rp=require(_0xa0ed('0x0'));var md5=require(_0xa0ed('0x1'));var util=require(_0xa0ed('0x2'));var Redis=require('ioredis');var intUtil=require(_0xa0ed('0x3'));var config=require('../../../../config/environment');var logger=require(_0xa0ed('0x4'))(_0xa0ed('0x5'));config['redis']=_[_0xa0ed('0x6')](config['redis'],{'host':_0xa0ed('0x7'),'port':0x18eb});var io=require(_0xa0ed('0x8'))(new Redis(config[_0xa0ed('0x9')]));function emit(_0x4a2a4f,_0x34ba1b,_0x398c9e){io['to'](_0x4a2a4f)[_0xa0ed('0xa')](_0x34ba1b,_0x398c9e);}var headers={'Content-Type':_0xa0ed('0xb'),'Accept':'application/json'};function getTicket(_0x3ea685,_0x51d1c9,_0x2164eb,_0x26f1a1,_0x508d24){logger['info'](_0xa0ed('0xc'));return request({'uri':util[_0xa0ed('0xd')](_0xa0ed('0xe'),_0x3ea685[_0xa0ed('0xf')]),'method':_0xa0ed('0x10'),'body':{'ticket':_[_0xa0ed('0x11')]({'requester_id':_0x2164eb['id'],'submitter_id':_0x51d1c9?_0x51d1c9['id']:undefined,'assignee_id':_0x51d1c9?_0x51d1c9['id']:undefined,'tags':getTags(_0x26f1a1[_0xa0ed('0x12')],_0xa0ed('0x13')),'subject':intUtil[_0xa0ed('0x14')](_0x26f1a1[_0xa0ed('0x15')],_0x508d24,'\x20'),'description':intUtil['getString'](_0x26f1a1[_0xa0ed('0x16')],_0x508d24,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa0ed('0x14')](_0x26f1a1[_0xa0ed('0x16')],_0x508d24,'\x0a')}},getCustomFields(_0x26f1a1[_0xa0ed('0x17')],_0x508d24))}})[_0xa0ed('0x18')](function(_0x434203){logger[_0xa0ed('0x19')](_0xa0ed('0x1a'));return _0x434203[_0xa0ed('0x1b')];});}function getUser(_0x2eab90,_0x12dd04){if(intUtil[_0xa0ed('0x1c')](_0x12dd04)){logger['info'](_0xa0ed('0x1d'),_0x12dd04);return request({'uri':util[_0xa0ed('0xd')]('%s/search.json',_0x2eab90[_0xa0ed('0xf')]),'qs':{'query':util['format'](_0xa0ed('0x1e'),_0x12dd04)}})[_0xa0ed('0x18')](function(_0x543928){if(_0x543928[_0xa0ed('0x1f')]){logger[_0xa0ed('0x19')](_0xa0ed('0x20'));return _[_0xa0ed('0x21')](_0x543928['results'],{'email':_0x12dd04,'role':_0xa0ed('0x22')});}else{logger[_0xa0ed('0x19')](_0xa0ed('0x23'));return request({'uri':util[_0xa0ed('0xd')](_0xa0ed('0x24'),_0x2eab90[_0xa0ed('0xf')])})[_0xa0ed('0x18')](function(_0x4a1857){logger[_0xa0ed('0x19')](_0xa0ed('0x25'));return _0x4a1857[_0xa0ed('0x26')];});}});}else{logger['info'](_0xa0ed('0x23'));return request({'uri':util[_0xa0ed('0xd')](_0xa0ed('0x24'),_0x2eab90[_0xa0ed('0xf')])})['then'](function(_0x323006){logger[_0xa0ed('0x19')]('Admin\x20account\x20selected.');return _0x323006[_0xa0ed('0x26')];});}}function getEndUser(_0x524d87,_0xbf5d69,_0x206c23){logger[_0xa0ed('0x19')](_0xa0ed('0x27'),_0x206c23);return request({'uri':util['format'](_0xa0ed('0x28'),_0x524d87[_0xa0ed('0xf')]),'qs':{'query':util['format'](_0xa0ed('0x29'),_0x206c23)}})[_0xa0ed('0x18')](function(_0xd1014b){var _0x112031;if(_0xd1014b[_0xa0ed('0x2a')][_0xa0ed('0x2b')]){_0xd1014b[_0xa0ed('0x2a')]=_[_0xa0ed('0x2c')](_0xd1014b[_0xa0ed('0x2a')],{'suspended':![],'role':_0xa0ed('0x2d')});if(_0xd1014b[_0xa0ed('0x2a')][_0xa0ed('0x2b')]){_0x112031=_[_0xa0ed('0x2e')](_0xd1014b['results']);}}if(_0x112031){logger['info']('Enduser\x20found!');return _0x112031;}else{logger['info'](_0xa0ed('0x2f'));return request({'uri':util[_0xa0ed('0xd')]('%s/users.json',_0x524d87[_0xa0ed('0xf')]),'method':_0xa0ed('0x10'),'body':{'user':{'role':'end-user','name':util['format']('Caller\x20-\x20%s',_0xbf5d69||_0x206c23),'phone':_0x206c23}}})[_0xa0ed('0x18')](function(_0x1e30c1){logger[_0xa0ed('0x19')](_0xa0ed('0x30'));return _0x1e30c1[_0xa0ed('0x26')];});}});}function getAuth(_0x1eb47e){var _0x542a7;if(_0x1eb47e[_0xa0ed('0x31')]===_0xa0ed('0x32')){_0x542a7=util['format'](_0xa0ed('0x33'),_0x1eb47e[_0xa0ed('0x34')],_0x1eb47e[_0xa0ed('0x32')]);}else if(_0x1eb47e[_0xa0ed('0x31')]===_0xa0ed('0x35')){_0x542a7=util[_0xa0ed('0xd')](_0xa0ed('0x36'),_0x1eb47e[_0xa0ed('0x34')],_0x1eb47e['token']);}return util[_0xa0ed('0xd')]('Basic\x20%s',new Buffer(_0x542a7)['toString'](_0xa0ed('0x37')));}function request(_0x341736){logger[_0xa0ed('0x38')](_0xa0ed('0x39'),JSON[_0xa0ed('0x3a')](_0x341736));return rp(_['defaults'](_0x341736,{'method':_0xa0ed('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x47fc67,_0x4abd53){var _0x1ae7b0=[];if(_0x47fc67&&_0x47fc67[_0xa0ed('0x2b')]>0x0){_0x1ae7b0=_[_0xa0ed('0x3c')](_0x47fc67,_0x4abd53);}return _0x1ae7b0;}function getCustomFields(_0x1d083f,_0x577979){var _0x59c309=[];var _0x1c0af6={'custom_fields':[]};if(_0x1d083f[_0xa0ed('0x2b')]>0x0){_[_0xa0ed('0x3d')](_0x1d083f,function(_0x1a87ff){if(_[_0xa0ed('0x3e')]([_0xa0ed('0x3f'),_0xa0ed('0x40')],_0x1a87ff['type'])&&_0x1a87ff[_0xa0ed('0x41')]&&!_0x1a87ff[_0xa0ed('0x42')]){_0x1c0af6[_0x1a87ff[_0xa0ed('0x41')][_0xa0ed('0x43')]()]=_0x1a87ff[_0xa0ed('0x44')]['toString']();}else if(_[_0xa0ed('0x3e')]([_0xa0ed('0x3f'),_0xa0ed('0x40')],_0x1a87ff[_0xa0ed('0x45')])&&_0x1a87ff['idField']&&_0x1a87ff['customField']){_0x1c0af6[_0xa0ed('0x46')][_0xa0ed('0x47')]({'id':_0x1a87ff[_0xa0ed('0x48')],'value':_0x1a87ff[_0xa0ed('0x44')]['toString']()});}else if(_0x1a87ff[_0xa0ed('0x45')]===_0xa0ed('0x49')&&_0x1a87ff[_0xa0ed('0x4a')]&&_0x1a87ff[_0xa0ed('0x48')]&&_0x1a87ff[_0xa0ed('0x42')]){_0x577979[_0x1a87ff[_0xa0ed('0x4a')]]&&_0x1c0af6[_0xa0ed('0x46')][_0xa0ed('0x47')]({'id':_0x1a87ff['idField'],'value':_0x577979[_0x1a87ff[_0xa0ed('0x4a')]][_0xa0ed('0x4b')]()});}else if(_0x1a87ff['type']==='customVariable'&&_0x1a87ff[_0xa0ed('0x4c')]&&_0x1a87ff['Variable'][_0xa0ed('0x13')]&&_0x1a87ff[_0xa0ed('0x48')]&&_0x1a87ff['customField']){_0x577979[_0x1a87ff[_0xa0ed('0x4c')][_0xa0ed('0x13')][_0xa0ed('0x43')]()]&&_0x1c0af6[_0xa0ed('0x46')][_0xa0ed('0x47')]({'id':_0x1a87ff['idField'],'value':_0x577979[_0x1a87ff[_0xa0ed('0x4c')]['name']['toLowerCase']()][_0xa0ed('0x4b')]()});}});}return _0x1c0af6;}exports[_0xa0ed('0x4d')]=function(_0x3b4250,_0x55aef5,_0x5d3611,_0x40fde8,_0x1b92a9,_0xe3672e){var _0x3fd2fc,_0x19b0ab;_0xe3672e['remoteUri']=intUtil[_0xa0ed('0x4e')](_0xe3672e['remoteUri']);_0xe3672e[_0xa0ed('0x4f')]=intUtil['stripTrailingSlash'](_0xe3672e[_0xa0ed('0x4f')]);if(_0x1b92a9&&_0x1b92a9[_0xa0ed('0x50')]){logger[_0xa0ed('0x19')](_0xa0ed('0x51'),'Recording\x20is\x20enabled!');_0x55aef5[_0xa0ed('0x52')]=util[_0xa0ed('0xd')](_0xa0ed('0x53'),_0xe3672e['serverUrl'],_0x55aef5['uniqueid'],md5(_0x55aef5['uniqueid']));}else{_0x55aef5[_0xa0ed('0x52')]='';}headers[_0xa0ed('0x54')]=getAuth(_0xe3672e);return getUser(_0xe3672e,_0x40fde8[_0xa0ed('0x55')])[_0xa0ed('0x18')](function(_0x58de7e){_0x3fd2fc=_0x58de7e;logger[_0xa0ed('0x19')](_0xa0ed('0x56'),_0x3fd2fc['id']);return getEndUser(_0xe3672e,_0x55aef5['calleridname'],_0x55aef5[_0xa0ed('0x57')]);})['then'](function(_0x2ff2b2){_0x19b0ab=_0x2ff2b2;logger[_0xa0ed('0x19')](_0xa0ed('0x58'),_0x19b0ab['id']);return getTicket(_0xe3672e,_0x3fd2fc,_0x19b0ab,_0x5d3611,_0x55aef5);})[_0xa0ed('0x18')](function(_0x69d5d6){if(_0x69d5d6){logger['info']('The\x20Ticket\x20ID\x20is:',_0x69d5d6['id']);switch(_0xe3672e[_0xa0ed('0x45')]){case _0xa0ed('0x59'):logger[_0xa0ed('0x19')](_0xa0ed('0x51'),_0xa0ed('0x5a'));return request({'uri':util[_0xa0ed('0xd')](_0xa0ed('0x5b'),_0xe3672e['remoteUri'],_0x3fd2fc['id'],_0x69d5d6['id']),'method':'POST'});case'newTab':logger[_0xa0ed('0x19')](_0xa0ed('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa0ed('0xd')](_0xa0ed('0x5c'),_0x40fde8[_0xa0ed('0x13')]),'trigger:browser:url',{'uri':util[_0xa0ed('0xd')](_0xa0ed('0x5d'),_0xe3672e[_0xa0ed('0xf')][_0xa0ed('0x5e')]('/api/v2',''),_0x69d5d6['id'])});break;default:logger[_0xa0ed('0x5f')](_0xa0ed('0x51'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xa0ed('0x60')](function(_0xe126cd){logger[_0xa0ed('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa0ed('0x61')](_0xe126cd,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4c8446,_0x5b6d7c,_0x2b92ee,_0x539c9e,_0x4e0ce9,_0x4fc916,_0x4dac4b){var _0x1c40cf,_0x58b8f2;_0x4fc916['remoteUri']=intUtil[_0xa0ed('0x4e')](_0x4fc916['remoteUri']);_0x4fc916[_0xa0ed('0x4f')]=intUtil[_0xa0ed('0x4e')](_0x4fc916[_0xa0ed('0x4f')]);if(_0x4dac4b&&_0x4dac4b[_0xa0ed('0x62')]&&_0x4dac4b[_0xa0ed('0x62')]!==_0xa0ed('0x63')){logger['info'](_0xa0ed('0x64'),'Recording\x20is\x20enabled!');_0x5b6d7c['recordingURL']=util[_0xa0ed('0xd')](_0xa0ed('0x53'),_0x4fc916[_0xa0ed('0x4f')],_0x5b6d7c[_0xa0ed('0x65')],md5(_0x5b6d7c[_0xa0ed('0x65')]));}headers[_0xa0ed('0x54')]=getAuth(_0x4fc916);return getUser(_0x4fc916,_0x539c9e[_0xa0ed('0x55')])[_0xa0ed('0x18')](function(_0x223cb6){_0x1c40cf=_0x223cb6;logger[_0xa0ed('0x19')](_0xa0ed('0x56'),_0x1c40cf['id']);return getEndUser(_0x4fc916,_0x5b6d7c[_0xa0ed('0x66')],_0x5b6d7c[_0xa0ed('0x67')]);})[_0xa0ed('0x18')](function(_0x16ed9e){_0x58b8f2=_0x16ed9e;logger[_0xa0ed('0x19')](_0xa0ed('0x58'),_0x58b8f2['id']);return getTicket(_0x4fc916,_0x1c40cf,_0x58b8f2,_0x2b92ee,_0x5b6d7c);})[_0xa0ed('0x18')](function(_0x2cc709){if(_0x2cc709){logger[_0xa0ed('0x19')](_0xa0ed('0x68'),_0x2cc709['id']);switch(_0x4fc916['type']){case _0xa0ed('0x59'):logger[_0xa0ed('0x19')](_0xa0ed('0x64'),_0xa0ed('0x5a'));return request({'uri':util['format'](_0xa0ed('0x5b'),_0x4fc916[_0xa0ed('0xf')],_0x1c40cf['id'],_0x2cc709['id']),'method':'POST'});case _0xa0ed('0x69'):logger['info']('[OUTBOUND]',_0xa0ed('0x6a'));emit(util[_0xa0ed('0xd')](_0xa0ed('0x5c'),_0x539c9e['name']),_0xa0ed('0x6b'),{'uri':util['format'](_0xa0ed('0x5d'),_0x4fc916[_0xa0ed('0xf')][_0xa0ed('0x5e')](_0xa0ed('0x6c'),''),_0x2cc709['id'])});break;default:logger[_0xa0ed('0x5f')](_0xa0ed('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x4f6c50){logger[_0xa0ed('0x5f')](_0xa0ed('0x6d'),util['inspect'](_0x4f6c50,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0xdea123,_0x3206bf,_0x35703a,_0x343dae,_0x45f5c2,_0x247d4b){var _0x1174a8,_0x5903a1;_0x247d4b['remoteUri']=intUtil[_0xa0ed('0x4e')](_0x247d4b[_0xa0ed('0xf')]);_0x247d4b[_0xa0ed('0x4f')]=intUtil[_0xa0ed('0x4e')](_0x247d4b[_0xa0ed('0x4f')]);if(_0x45f5c2&&_0x45f5c2[_0xa0ed('0x50')]){logger['info']('['+_0x3206bf[_0xa0ed('0x6e')][_0xa0ed('0x6f')]()+']','Recording\x20is\x20enabled!');_0x3206bf[_0xa0ed('0x52')]=util[_0xa0ed('0xd')](_0xa0ed('0x53'),_0x247d4b[_0xa0ed('0x4f')],_0x3206bf[_0xa0ed('0x65')],md5(_0x3206bf[_0xa0ed('0x65')]));}else{_0x3206bf[_0xa0ed('0x52')]='';}headers[_0xa0ed('0x54')]=getAuth(_0x247d4b);return getUser(_0x247d4b)[_0xa0ed('0x18')](function(_0x852f9){_0x1174a8=_0x852f9;logger['info']('The\x20User\x20ID\x20is:',_0x1174a8['id']);return getEndUser(_0x247d4b,_0x3206bf[_0xa0ed('0x70')],_0x3206bf[_0xa0ed('0x57')]);})[_0xa0ed('0x18')](function(_0x11e357){_0x5903a1=_0x11e357;logger[_0xa0ed('0x19')]('The\x20Enduser\x20ID\x20is:',_0x5903a1['id']);return getTicket(_0x247d4b,_0x1174a8,_0x5903a1,_0x35703a,_0x3206bf);})['then'](function(_0x3fa8d3){if(_0x3fa8d3){logger[_0xa0ed('0x19')](_0xa0ed('0x68'),_0x3fa8d3['id']);}})[_0xa0ed('0x60')](function(_0x339307){logger[_0xa0ed('0x5f')]('['+_0x3206bf[_0xa0ed('0x6e')][_0xa0ed('0x6f')]()+']'+_0xa0ed('0x71'),util[_0xa0ed('0x61')](_0x339307,{'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 7622e09..4cd83cc 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 _0x5620=['agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','lodash','md5','util','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','includes','type','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound'];(function(_0x156725,_0x451ecf){var _0x33a40d=function(_0x5a0efc){while(--_0x5a0efc){_0x156725['push'](_0x156725['shift']());}};_0x33a40d(++_0x451ecf);}(_0x5620,0xbf));var _0x0562=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0x5620[_0x36feb2];return _0x292b43;};'use strict';var _=require(_0x0562('0x0'));var rp=require('request-promise');var md5=require(_0x0562('0x1'));var util=require(_0x0562('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x0562('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0562('0x4'))('zoho');config[_0x0562('0x5')]=_[_0x0562('0x6')](config[_0x0562('0x5')],{'host':_0x0562('0x7'),'port':0x18eb});var io=require(_0x0562('0x8'))(new Redis(config[_0x0562('0x5')]));function emit(_0x5f47ba,_0x55e78c,_0xa0840){io['to'](_0x5f47ba)['emit'](_0x55e78c,_0xa0840);}function request(_0x2a4ad9){logger[_0x0562('0x9')](_0x0562('0xa'),JSON[_0x0562('0xb')](_0x2a4ad9));return rp(_0x2a4ad9);}function getCustomFields(_0x259b6f,_0x538cb8){var _0xef7f27={};if(_0x259b6f[_0x0562('0xc')]>0x0){_[_0x0562('0xd')](_0x259b6f,function(_0x9732ee){if(_[_0x0562('0xe')](['string','picklist'],_0x9732ee[_0x0562('0xf')])&&_0x9732ee[_0x0562('0x10')]){_0xef7f27[_0x9732ee[_0x0562('0x10')]]=_0x9732ee[_0x0562('0x11')]['toString']();}else if(_0x9732ee[_0x0562('0xf')]===_0x0562('0x12')&&_0x9732ee[_0x0562('0x13')]&&_0x9732ee[_0x0562('0x10')]&&_0x538cb8[_0x9732ee['variableName']]){_0xef7f27[_0x9732ee[_0x0562('0x10')]]=_0x538cb8[_0x9732ee['variableName']][_0x0562('0x14')]();}else if(_0x9732ee[_0x0562('0xf')]==='customVariable'&&_0x9732ee[_0x0562('0x15')]&&_0x9732ee['Variable'][_0x0562('0x16')]&&_0x9732ee[_0x0562('0x10')]&&_0x538cb8[_0x9732ee[_0x0562('0x15')]['name'][_0x0562('0x17')]()]){_0xef7f27[_0x9732ee['idField']]=_0x538cb8[_0x9732ee[_0x0562('0x15')]['name'][_0x0562('0x17')]()][_0x0562('0x14')]();}});}return _0xef7f27;}function getName(_0x494277){if(_0x494277[_0x0562('0x18')]('\x20')>0x0){var _0x2f6771=_0x494277[_0x0562('0x19')](/ (.+)/);if(_0x2f6771[0x1]){return _0x2f6771;}}return[_0x494277,_0x494277];}var accountsTokens={};function getAccessToken(_0x90626d){return new Promise(function(_0x5dbc61,_0x2f6d34){if(!_['isNil'](accountsTokens[_0x90626d['id']])&&!_['isNil'](accountsTokens[_0x90626d['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x90626d['id']][_0x0562('0x1a')])){_0x5dbc61(accountsTokens[_0x90626d['id']][_0x0562('0x1b')]);}}var _0x17a454;switch(_0x90626d[_0x0562('0x1c')]){case'US':_0x17a454=_0x0562('0x1d');break;case'AU':_0x17a454='https://accounts.zoho.com.au';break;case'EU':_0x17a454='https://accounts.zoho.eu';break;case'IN':_0x17a454=_0x0562('0x1e');break;case'CN':_0x17a454=_0x0562('0x1f');break;default:_0x17a454=_0x0562('0x20');break;}var _0x3eb41c={'method':_0x0562('0x21'),'uri':_0x17a454+'/oauth/v2/token','qs':{'refresh_token':_0x90626d[_0x0562('0x22')],'client_id':_0x90626d[_0x0562('0x23')],'client_secret':_0x90626d[_0x0562('0x24')],'grant_type':_0x0562('0x25')},'json':!![]};return rp(_0x3eb41c)[_0x0562('0x26')](function(_0xade948){accountsTokens[_0x90626d['id']]={'access_token':_0xade948[_0x0562('0x1b')],'expires_in':moment()[_0x0562('0x27')](_0xade948[_0x0562('0x1a')],_0x0562('0x28'))};_0x5dbc61(_0xade948[_0x0562('0x1b')]);})['catch'](function(_0x229669){logger[_0x0562('0x29')](_0x0562('0x2a'),_0x229669[_0x0562('0x2b')]);_0x2f6d34(_0x229669);});});}function getUser(_0x5e09e1,_0x49f584,_0x51ac77,_0x5373c4){logger[_0x0562('0x2c')]('Search\x20user');return request({'method':_0x0562('0x2d'),'uri':util[_0x0562('0x2e')](_0x0562('0x2f'),_0x49f584),'qs':{'type':_0x0562('0x30')},'headers':{'Authorization':_0x0562('0x31')+_0x5e09e1},'json':!![]})[_0x0562('0x26')](function(_0x24bd4a){if(_0x24bd4a[_0x0562('0x32')]){var _0x263185=-0x1;if(_[_0x0562('0x33')](_0x24bd4a['users'])){if(!_[_0x0562('0x34')](_0x5373c4)){_0x263185=_[_0x0562('0x35')](_0x24bd4a['users'],function(_0x4d5e90){return _0x4d5e90[_0x0562('0x36')]===_0x5373c4;});}if(_0x263185>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x0562('0x2c')](_0x0562('0x37'));_0x263185=_['findIndex'](_0x24bd4a[_0x0562('0x32')],function(_0x189f02){return _0x189f02[_0x0562('0x38')]['name']===_0x0562('0x39');});}return _0x24bd4a[_0x0562('0x32')][_0x263185];}else{if(_0x24bd4a[_0x0562('0x3a')][_0x0562('0x38')][_0x0562('0x16')]===_0x0562('0x39')){logger['info'](_0x0562('0x37'));user=_0x24bd4a[_0x0562('0x3a')];return user;}else{logger[_0x0562('0x29')](_0x0562('0x3b'),JSON['stringify'](_0x24bd4a));throw new Error(_0x0562('0x3c')+JSON['stringify'](_0x24bd4a));}}}else{logger[_0x0562('0x29')](_0x0562('0x3b'),JSON[_0x0562('0xb')](_0x24bd4a));throw new Error(_0x0562('0x3c')+JSON[_0x0562('0xb')](_0x24bd4a));}})[_0x0562('0x3d')](function(_0x249923){console['error'](_0x249923);});}function getZohoUser(_0x4ed9b2,_0x3fb56d){return new BPromise(function(_0x265d2b,_0x3b5a95){request(_0x4ed9b2)['then'](function(_0x1bd333){var _0x579da8=null;if(_0x1bd333){_0x579da8=_0x1bd333[_0x0562('0x3e')][0x0];_0x579da8['enduserType']=_0x3fb56d;}_0x265d2b(_0x579da8);})['catch'](function(_0x4e17d7){_0x3b5a95(_0x4e17d7);});});}function createEndUser(_0x3df711,_0xd3b10e,_0x46e0a3,_0x2633b5,_0x12437c,_0x541126){var _0x46e0a3=getName(_0x46e0a3);return request({'method':_0x0562('0x21'),'uri':_0x0562('0x3f')+_0xd3b10e+_0x0562('0x40')+_[_0x0562('0x41')](_0x541126[_0x0562('0x42')])+'s','body':{'data':[{'Last_Name':_0x46e0a3[0x1],'First_Name':_0x46e0a3[0x0],'Phone':_0x2633b5,'Owner':{'name':!_['isNil'](_0x12437c[_0x0562('0x43')]['name'])?_0x12437c[_0x0562('0x43')][_0x0562('0x16')]:!_[_0x0562('0x34')](_0x12437c['first_name'])?_0x12437c['first_name']+'\x20'+_0x12437c[_0x0562('0x44')]:_0x12437c[_0x0562('0x44')],'id':_0x12437c['id']}}]},'headers':{'Authorization':_0x0562('0x31')+_0x3df711},'json':!![]})['then'](function(_0x22afb1){if(_0x22afb1&&_0x22afb1[_0x0562('0x3e')][0x0][_0x0562('0x45')]===_0x0562('0x46')){var _0x173490=_0x22afb1[_0x0562('0x3e')][0x0][_0x0562('0x47')];_0x173490['enduserType']=_['startCase'](_0x541126['moduleCreate'])+'s';return _0x173490;}logger[_0x0562('0x29')](_0x0562('0x3b'),JSON[_0x0562('0xb')](data));throw new Error(_0x0562('0x48')+JSON['stringify'](data));})['catch'](function(_0x5c1de2){console[_0x0562('0x49')](_0x0562('0x4a'),_0x5c1de2);});}function getEndUser(_0x5a3e84,_0x2ad0da,_0x4b2b0c,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54){var _0x22cf79={'method':_0x0562('0x2d'),'uri':'','headers':{'Authorization':_0x0562('0x31')+_0x5a3e84},'json':!![]};switch(_0x1ced54[_0x0562('0x4b')]){case _0x0562('0x4c'):_0x22cf79['uri']=_0x0562('0x3f')+_0x2ad0da+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,'Contacts')['then'](function(_0x52186a){if(_0x52186a)return _0x52186a;_0x22cf79[_0x0562('0x4d')]=_0x0562('0x3f')+_0x2ad0da+_0x0562('0x4e')+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,_0x0562('0x4f'))[_0x0562('0x26')](function(_0x4fbab8){if(_0x4fbab8)return _0x4fbab8;if(_0x1ced54['moduleCreate']!='nothing'){return createEndUser(_0x5a3e84,_0x2ad0da,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54);}else{return{};}});});break;case _0x0562('0x50'):_0x22cf79[_0x0562('0x4d')]=_0x0562('0x3f')+_0x2ad0da+_0x0562('0x51')+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,'Contacts')[_0x0562('0x26')](function(_0x3508f1){if(_0x3508f1)return _0x3508f1;if(_0x1ced54[_0x0562('0x42')]!=_0x0562('0x52')){return createEndUser(_0x5a3e84,_0x2ad0da,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54);}else{return{};}});break;case'lead':_0x22cf79[_0x0562('0x4d')]=_0x0562('0x3f')+_0x2ad0da+_0x0562('0x4e')+_0x4b1c1a+'))';return getZohoUser(_0x22cf79,_0x0562('0x4f'))['then'](function(_0x298111){if(_0x298111)return _0x298111;if(_0x1ced54['moduleCreate']!='nothing'){return createEndUser(_0x5a3e84,_0x2ad0da,_0x292c5c,_0x4b1c1a,_0x265908,_0x1ced54);}else{return{};}});break;}}function getCall(_0x1b9470,_0x3bb2ec,_0x2cfe0f,_0x4abba4,_0x431b41,_0x4ca2a9,_0x262bba,_0xa4c75c){logger[_0x0562('0x2c')](_0x0562('0x53'));var _0x5a2b08={};_0x5a2b08[_0x0562('0x54')]={'name':!_[_0x0562('0x34')](_0x4abba4[_0x0562('0x43')]['name'])&&!_[_0x0562('0x34')](_0x4abba4[_0x0562('0x38')][_0x0562('0x16')])&&_0x4abba4[_0x0562('0x38')][_0x0562('0x16')]===_0x0562('0x55')?_0x4abba4[_0x0562('0x43')][_0x0562('0x16')]:!_['isNil'](_0x4abba4[_0x0562('0x56')])?_0x4abba4[_0x0562('0x56')]+'\x20'+_0x4abba4[_0x0562('0x44')]:_0x4abba4['last_name'],'id':_0x4abba4['id']};_0x5a2b08[_0x0562('0x57')]=intUtil[_0x0562('0x58')](_0x4ca2a9[_0x0562('0x59')],_0x262bba,'\x20');_0x5a2b08[_0x0562('0x5a')]=intUtil[_0x0562('0x58')](_0x4ca2a9[_0x0562('0x5b')],_0x262bba,'\x0a');if(_0x431b41[_0x0562('0x5c')]==='Contacts'){_0x5a2b08[_0x0562('0x5d')]={'name':!_[_0x0562('0x34')](_0x431b41['Full_Name'])?_0x431b41[_0x0562('0x5e')]:!_[_0x0562('0x34')](_0x431b41['First_Name'])?_0x431b41[_0x0562('0x5f')]+'\x20'+_0x431b41['Last_Name']:_0x431b41[_0x0562('0x60')],'id':_0x431b41['id']};}if(_0x431b41[_0x0562('0x5c')]===_0x0562('0x4f')){_0x5a2b08[_0x0562('0x61')]={'name':!_[_0x0562('0x34')](_0x431b41[_0x0562('0x5e')])?_0x431b41['Full_Name']:!_[_0x0562('0x34')](_0x431b41[_0x0562('0x5f')])?_0x431b41['First_Name']+'\x20'+_0x431b41[_0x0562('0x60')]:_0x431b41[_0x0562('0x60')],'id':_0x431b41['id']};_0x5a2b08[_0x0562('0x62')]=_['startCase'](_0x431b41[_0x0562('0x5c')]);}if(_0x262bba['talktime']){_0x5a2b08[_0x0562('0x63')]=moment[_0x0562('0x64')](parseInt(_0x262bba[_0x0562('0x65')])*0x3e8)['format'](_0x0562('0x66'));}else if(_0x262bba[_0x0562('0x67')]&&_0x262bba[_0x0562('0x68')]){_0x5a2b08[_0x0562('0x63')]=moment[_0x0562('0x64')](moment(_0x262bba[_0x0562('0x68')],_0x0562('0x69'))[_0x0562('0x6a')](moment(_0x262bba[_0x0562('0x6b')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x0562('0x66'));}switch(_0x262bba[_0x0562('0x6c')]){case _0x0562('0x6d'):_0x5a2b08[_0x0562('0x6e')]=_0x0562('0x6f');break;case _0x0562('0x70'):case _0x0562('0x71'):_0x5a2b08[_0x0562('0x6e')]=_0x0562('0x72');break;case _0x0562('0x73'):_0x5a2b08['Call_Result']=_0x0562('0x74');break;case _0x0562('0x75'):_0x5a2b08['Call_Result']=_0x0562('0x76');break;case _0x0562('0x77'):_0x5a2b08[_0x0562('0x6e')]=_0x0562('0x78');default:}_0x5a2b08[_0x0562('0x79')]=(_0xa4c75c===_0x0562('0x7a')?moment(_0x262bba[_0x0562('0x6b')])['format'](_0x0562('0x69')):moment(_0x262bba[_0x0562('0x7b')])[_0x0562('0x2e')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x0562('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0x5a2b08[_0x0562('0x7c')]=_0xa4c75c||_0x0562('0x7d');_0x5a2b08=_['merge'](_0x5a2b08,getCustomFields(_0x4ca2a9[_0x0562('0x7e')],_0x262bba));return request({'method':'POST','uri':_0x0562('0x3f')+_0x3bb2ec+_0x0562('0x7f'),'headers':{'Authorization':_0x0562('0x31')+_0x1b9470},'body':{'data':[_0x5a2b08]},'json':!![]})[_0x0562('0x26')](function(_0x27c1bd){if(_0x27c1bd&&_0x27c1bd[_0x0562('0x3e')][0x0][_0x0562('0x45')]===_0x0562('0x46')){logger[_0x0562('0x2c')]('Call\x20created!');return{'id':_0x27c1bd['data'][0x0][_0x0562('0x47')]['id']};}})[_0x0562('0x3d')](function(_0x51a069){logger[_0x0562('0x2c')](_0x0562('0x80'),_0x51a069[_0x0562('0x2b')]);console[_0x0562('0x49')](_0x0562('0x80'),_0x51a069);});}exports[_0x0562('0x81')]=function(_0x3da65d,_0x7c80d9,_0xad4693,_0x2d49ec,_0xb53a14,_0x4ac8fb){var _0x4356b2,_0x3758fc,_0x10218c;_0x4ac8fb[_0x0562('0x82')]=intUtil[_0x0562('0x83')](_0x4ac8fb[_0x0562('0x82')]);_0x4ac8fb[_0x0562('0x84')]=intUtil['stripTrailingSlash'](_0x4ac8fb[_0x0562('0x84')]);if(_0xb53a14&&_0xb53a14[_0x0562('0x85')]){logger[_0x0562('0x2c')]('[QUEUE]',_0x0562('0x86'));_0x7c80d9['recordingURL']=_0x4ac8fb['serverUrl']+_0x0562('0x87')+_0x7c80d9['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x7c80d9[_0x0562('0x88')]);}else{_0x7c80d9[_0x0562('0x89')]='';}var _0x317971=_0x4ac8fb[_0x0562('0x82')]===_0x0562('0x8a')?'eu':'com';return getAccessToken(_0x4ac8fb)[_0x0562('0x26')](function(_0x2c23e0){_0x10218c=_0x2c23e0;return getUser(_0x10218c,_0x317971,_0x4ac8fb,_0x2d49ec['email']);})[_0x0562('0x26')](function(_0x192226){_0x4356b2=_0x192226;logger[_0x0562('0x2c')]('The\x20User\x20ID\x20is:',_0x4356b2['id']);return getEndUser(_0x10218c,_0x317971,_0x4ac8fb,_0x7c80d9[_0x0562('0x8b')],_0x7c80d9['calleridnum'],_0x4356b2,_0xad4693);})[_0x0562('0x26')](function(_0x8af2cf){_0x3758fc=_0x8af2cf;return getCall(_0x10218c,_0x317971,_0x4ac8fb,_0x4356b2,_0x3758fc,_0xad4693,_0x7c80d9,_0x0562('0x7d'));})['then'](function(_0x34e217){if(_0x34e217){logger[_0x0562('0x2c')](_0x0562('0x8c'),_0x34e217['id']);logger['info']('[QUEUE]',_0x0562('0x8d'));emit(util[_0x0562('0x2e')]('user:%s',_0x2d49ec[_0x0562('0x16')]),_0x0562('0x8e'),{'uri':_0x0562('0x8f')+_0x4ac8fb['host']+_0x0562('0x90')+_0x34e217['id']});}})[_0x0562('0x3d')](function(_0x597d5c){logger[_0x0562('0x29')]('[QUEUE]',JSON['stringify'](_0x597d5c));});};exports[_0x0562('0x7a')]=function(_0x26910c,_0xfe2793,_0x49b1a2,_0x4475f3,_0x31ee04,_0x5f45cd,_0x1f6bfb){var _0x4ace56,_0x5b48c1,_0x16eb92;_0x5f45cd[_0x0562('0x82')]=intUtil[_0x0562('0x83')](_0x5f45cd['host']);_0x5f45cd[_0x0562('0x84')]=intUtil[_0x0562('0x83')](_0x5f45cd['serverUrl']);if(_0x1f6bfb&&_0x1f6bfb[_0x0562('0x91')]&&_0x1f6bfb['recordingFormat']!==_0x0562('0x92')){logger['info'](_0x0562('0x93'),_0x0562('0x86'));_0xfe2793['recordingURL']=_0x5f45cd['serverUrl']+_0x0562('0x87')+_0xfe2793[_0x0562('0x88')]+_0x0562('0x94')+md5(_0xfe2793['uniqueid']);}var _0xb83ef8=_0x5f45cd['host']===_0x0562('0x8a')?'eu':_0x0562('0x95');return getAccessToken(_0x5f45cd)[_0x0562('0x26')](function(_0x447a4e){_0x16eb92=_0x447a4e;return getUser(_0x16eb92,_0xb83ef8,_0x5f45cd,_0x4475f3['email']);})[_0x0562('0x26')](function(_0x261d03){_0x4ace56=_0x261d03;logger['info']('The\x20User\x20ID\x20is:',_0x4ace56['id']);return getEndUser(_0x16eb92,_0xb83ef8,_0x5f45cd,_0xfe2793[_0x0562('0x96')],_0xfe2793[_0x0562('0x97')],_0x4ace56,_0x49b1a2);})['then'](function(_0x11e443){_0x5b48c1=_0x11e443;return getCall(_0x16eb92,_0xb83ef8,_0x5f45cd,_0x4ace56,_0x5b48c1,_0x49b1a2,_0xfe2793,_0x0562('0x98'));})[_0x0562('0x26')](function(_0x51dcdb){if(_0x51dcdb){logger[_0x0562('0x2c')](_0x0562('0x8c'),_0x51dcdb['id']);logger[_0x0562('0x2c')](_0x0562('0x93'),_0x0562('0x8d'));emit(util[_0x0562('0x2e')](_0x0562('0x99'),_0x4475f3[_0x0562('0x16')]),_0x0562('0x8e'),{'uri':_0x0562('0x8f')+_0x5f45cd['host']+_0x0562('0x90')+_0x51dcdb['id']});}})[_0x0562('0x3d')](function(_0xb059cc){logger[_0x0562('0x29')](_0x0562('0x93'),JSON[_0x0562('0xb')](_0xb059cc));});};exports[_0x0562('0x9a')]=function(_0x27405c,_0x58cb44,_0x5aaf83,_0xba04aa,_0x3e8a43,_0x12a447){var _0x1f777d,_0x4a0063,_0xde6817;_0x12a447[_0x0562('0x82')]=intUtil[_0x0562('0x83')](_0x12a447[_0x0562('0x82')]);_0x12a447[_0x0562('0x84')]=intUtil[_0x0562('0x83')](_0x12a447[_0x0562('0x84')]);if(_0x3e8a43&&_0x3e8a43[_0x0562('0x85')]){logger[_0x0562('0x2c')]('['+_0x58cb44[_0x0562('0x6c')][_0x0562('0x9b')]()+']',_0x0562('0x86'));_0x58cb44['recordingURL']=_0x12a447[_0x0562('0x84')]+'/api/voice/recordings/'+_0x58cb44[_0x0562('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x58cb44['uniqueid']);}else{_0x58cb44[_0x0562('0x89')]='';}var _0x35a5b4=_0x12a447[_0x0562('0x82')]===_0x0562('0x8a')?'eu':_0x0562('0x95');return getAccessToken(_0x12a447)[_0x0562('0x26')](function(_0x13dc99){_0xde6817=_0x13dc99;return getUser(_0xde6817,_0x35a5b4,_0x12a447);})[_0x0562('0x26')](function(_0x81b17d){_0x1f777d=_0x81b17d;logger[_0x0562('0x2c')](_0x0562('0x9c'),_0x1f777d['id']);return getEndUser(_0xde6817,_0x35a5b4,_0x12a447,_0x58cb44[_0x0562('0x8b')],_0x58cb44['calleridnum'],_0x1f777d,_0x5aaf83);})[_0x0562('0x26')](function(_0x4e21bf){_0x4a0063=_0x4e21bf;return getCall(_0xde6817,_0x35a5b4,_0x12a447,_0x1f777d,_0x4a0063,_0x5aaf83,_0x58cb44,'Inbound');})[_0x0562('0x26')](function(_0x287d02){if(_0x287d02){logger[_0x0562('0x2c')](_0x0562('0x8c'),_0x287d02['id']);}})[_0x0562('0x3d')](function(_0x2df741){logger[_0x0562('0x29')]('['+_0x58cb44[_0x0562('0x6c')][_0x0562('0x9b')]()+']',JSON[_0x0562('0xb')](_0x2df741));});}; \ No newline at end of file +var _0x0962=['stringify','forEach','picklist','idField','content','toString','variableName','type','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','moduleCreate','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Owner','administrator','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','connect','rejected','abandoned','Call_Result','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','defaults','redis','localhost','emit','debug','[HTTP]'];(function(_0x174e96,_0x2ef390){var _0x40117c=function(_0x339162){while(--_0x339162){_0x174e96['push'](_0x174e96['shift']());}};_0x40117c(++_0x2ef390);}(_0x0962,0x116));var _0x2096=function(_0xed3608,_0x471359){_0xed3608=_0xed3608-0x0;var _0x4ba422=_0x0962[_0xed3608];return _0x4ba422;};'use strict';var _=require(_0x2096('0x0'));var rp=require(_0x2096('0x1'));var md5=require(_0x2096('0x2'));var util=require(_0x2096('0x3'));var intUtil=require(_0x2096('0x4'));var moment=require(_0x2096('0x5'));var Redis=require(_0x2096('0x6'));var BPromise=require(_0x2096('0x7'));var config=require('../../../../config/environment');var logger=require(_0x2096('0x8'))(_0x2096('0x9'));config['redis']=_[_0x2096('0xa')](config[_0x2096('0xb')],{'host':_0x2096('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x1c37b5,_0x4c21c6,_0x21dbe6){io['to'](_0x1c37b5)[_0x2096('0xd')](_0x4c21c6,_0x21dbe6);}function request(_0x50d65a){logger[_0x2096('0xe')](_0x2096('0xf'),JSON[_0x2096('0x10')](_0x50d65a));return rp(_0x50d65a);}function getCustomFields(_0x3e6f40,_0x56c942){var _0x9c15cd={};if(_0x3e6f40['length']>0x0){_[_0x2096('0x11')](_0x3e6f40,function(_0x5313e5){if(_['includes'](['string',_0x2096('0x12')],_0x5313e5['type'])&&_0x5313e5[_0x2096('0x13')]){_0x9c15cd[_0x5313e5[_0x2096('0x13')]]=_0x5313e5[_0x2096('0x14')][_0x2096('0x15')]();}else if(_0x5313e5['type']==='variable'&&_0x5313e5[_0x2096('0x16')]&&_0x5313e5[_0x2096('0x13')]&&_0x56c942[_0x5313e5[_0x2096('0x16')]]){_0x9c15cd[_0x5313e5[_0x2096('0x13')]]=_0x56c942[_0x5313e5[_0x2096('0x16')]][_0x2096('0x15')]();}else if(_0x5313e5[_0x2096('0x17')]===_0x2096('0x18')&&_0x5313e5['Variable']&&_0x5313e5['Variable']['name']&&_0x5313e5[_0x2096('0x13')]&&_0x56c942[_0x5313e5['Variable']['name']['toLowerCase']()]){_0x9c15cd[_0x5313e5[_0x2096('0x13')]]=_0x56c942[_0x5313e5[_0x2096('0x19')][_0x2096('0x1a')][_0x2096('0x1b')]()][_0x2096('0x15')]();}});}return _0x9c15cd;}function getName(_0x712a83){if(_0x712a83['indexOf']('\x20')>0x0){var _0x47fcd2=_0x712a83['split'](/ (.+)/);if(_0x47fcd2[0x1]){return _0x47fcd2;}}return[_0x712a83,_0x712a83];}var accountsTokens={};function getAccessToken(_0x584f49){return new Promise(function(_0x1fd873,_0x1b8f10){if(!_[_0x2096('0x1c')](accountsTokens[_0x584f49['id']])&&!_['isNil'](accountsTokens[_0x584f49['id']][_0x2096('0x1d')])){if(moment()[_0x2096('0x1e')](accountsTokens[_0x584f49['id']][_0x2096('0x1f')])){_0x1fd873(accountsTokens[_0x584f49['id']][_0x2096('0x1d')]);}}var _0x5d77c9;switch(_0x584f49[_0x2096('0x20')]){case'US':_0x5d77c9='https://accounts.zoho.com';break;case'AU':_0x5d77c9='https://accounts.zoho.com.au';break;case'EU':_0x5d77c9='https://accounts.zoho.eu';break;case'IN':_0x5d77c9='https://accounts.zoho.in';break;case'CN':_0x5d77c9=_0x2096('0x21');break;default:_0x5d77c9='https://accounts.zoho.eu';break;}var _0x398ca1={'method':_0x2096('0x22'),'uri':_0x5d77c9+'/oauth/v2/token','qs':{'refresh_token':_0x584f49[_0x2096('0x23')],'client_id':_0x584f49[_0x2096('0x24')],'client_secret':_0x584f49[_0x2096('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x398ca1)['then'](function(_0x2a31a7){accountsTokens[_0x584f49['id']]={'access_token':_0x2a31a7[_0x2096('0x1d')],'expires_in':moment()[_0x2096('0x26')](_0x2a31a7['expires_in'],_0x2096('0x27'))};_0x1fd873(_0x2a31a7[_0x2096('0x1d')]);})[_0x2096('0x28')](function(_0x6b2653){logger[_0x2096('0x29')](_0x2096('0x2a'),_0x6b2653[_0x2096('0x2b')]);_0x1b8f10(_0x6b2653);});});}function getUser(_0x538449,_0x5ce42b,_0x194bca,_0x9896f6){logger[_0x2096('0x2c')](_0x2096('0x2d'));return request({'method':_0x2096('0x2e'),'uri':util[_0x2096('0x2f')](_0x2096('0x30'),_0x5ce42b),'qs':{'type':_0x2096('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x538449},'json':!![]})['then'](function(_0x589154){if(_0x589154[_0x2096('0x32')]){var _0x101aea=-0x1;if(_[_0x2096('0x33')](_0x589154[_0x2096('0x32')])){if(!_[_0x2096('0x1c')](_0x9896f6)){_0x101aea=_[_0x2096('0x34')](_0x589154[_0x2096('0x32')],function(_0xcdb591){return _0xcdb591['email']===_0x9896f6;});}if(_0x101aea>=0x0){logger[_0x2096('0x2c')]('Agent\x20found!');}else{logger[_0x2096('0x2c')](_0x2096('0x35'));_0x101aea=_[_0x2096('0x34')](_0x589154['users'],function(_0x2951d5){return _0x2951d5[_0x2096('0x36')][_0x2096('0x1a')]===_0x2096('0x37');});}return _0x589154[_0x2096('0x32')][_0x101aea];}else{if(_0x589154[_0x2096('0x38')][_0x2096('0x36')][_0x2096('0x1a')]===_0x2096('0x37')){logger[_0x2096('0x2c')](_0x2096('0x35'));user=_0x589154['user'];return user;}else{logger[_0x2096('0x29')](_0x2096('0x39'),JSON[_0x2096('0x10')](_0x589154));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2096('0x10')](_0x589154));}}}else{logger[_0x2096('0x29')](_0x2096('0x39'),JSON[_0x2096('0x10')](_0x589154));throw new Error(_0x2096('0x3a')+JSON[_0x2096('0x10')](_0x589154));}})['catch'](function(_0x5dfa14){console[_0x2096('0x29')](_0x5dfa14);});}function getZohoUser(_0x5865b3,_0x2c2a7a){return new BPromise(function(_0x43132a,_0x5afb39){request(_0x5865b3)[_0x2096('0x3b')](function(_0x3192d5){var _0x89defc=null;if(_0x3192d5){_0x89defc=_0x3192d5[_0x2096('0x3c')][0x0];_0x89defc['enduserType']=_0x2c2a7a;}_0x43132a(_0x89defc);})[_0x2096('0x28')](function(_0x2b2543){_0x5afb39(_0x2b2543);});});}function createEndUser(_0x55aa72,_0xa01aaf,_0x1e3a43,_0x3d072a,_0x2f4dd2,_0x59843f){var _0x1e3a43=getName(_0x1e3a43);return request({'method':_0x2096('0x22'),'uri':_0x2096('0x3d')+_0xa01aaf+_0x2096('0x3e')+_[_0x2096('0x3f')](_0x59843f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1e3a43[0x1],'First_Name':_0x1e3a43[0x0],'Phone':_0x3d072a,'Owner':{'name':!_[_0x2096('0x1c')](_0x2f4dd2[_0x2096('0x40')][_0x2096('0x1a')])?_0x2f4dd2[_0x2096('0x40')][_0x2096('0x1a')]:!_['isNil'](_0x2f4dd2['first_name'])?_0x2f4dd2[_0x2096('0x41')]+'\x20'+_0x2f4dd2[_0x2096('0x42')]:_0x2f4dd2[_0x2096('0x42')],'id':_0x2f4dd2['id']}}]},'headers':{'Authorization':_0x2096('0x43')+_0x55aa72},'json':!![]})[_0x2096('0x3b')](function(_0x1675ba){if(_0x1675ba&&_0x1675ba['data'][0x0][_0x2096('0x44')]===_0x2096('0x45')){var _0x30d94e=_0x1675ba[_0x2096('0x3c')][0x0][_0x2096('0x46')];_0x30d94e[_0x2096('0x47')]=_[_0x2096('0x3f')](_0x59843f[_0x2096('0x48')])+'s';return _0x30d94e;}logger[_0x2096('0x29')](_0x2096('0x39'),JSON[_0x2096('0x10')](data));throw new Error(_0x2096('0x49')+JSON[_0x2096('0x10')](data));})[_0x2096('0x28')](function(_0x435557){console['log'](_0x2096('0x4a'),_0x435557);});}function getEndUser(_0x5d7daf,_0x1359c1,_0x3df307,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f){var _0x1afca={'method':_0x2096('0x2e'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d7daf},'json':!![]};switch(_0x489c1f[_0x2096('0x4b')]){case _0x2096('0x4c'):_0x1afca['uri']='https://www.zohoapis.'+_0x1359c1+_0x2096('0x4d')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x4e'))[_0x2096('0x3b')](function(_0x1e77f5){if(_0x1e77f5)return _0x1e77f5;_0x1afca[_0x2096('0x4f')]=_0x2096('0x3d')+_0x1359c1+_0x2096('0x50')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x51'))[_0x2096('0x3b')](function(_0x2a2bb2){if(_0x2a2bb2)return _0x2a2bb2;if(_0x489c1f[_0x2096('0x48')]!=_0x2096('0x52')){return createEndUser(_0x5d7daf,_0x1359c1,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f);}else{return{};}});});break;case'contact':_0x1afca[_0x2096('0x4f')]='https://www.zohoapis.'+_0x1359c1+_0x2096('0x4d')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x4e'))[_0x2096('0x3b')](function(_0x49772b){if(_0x49772b)return _0x49772b;if(_0x489c1f[_0x2096('0x48')]!=_0x2096('0x52')){return createEndUser(_0x5d7daf,_0x1359c1,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f);}else{return{};}});break;case _0x2096('0x53'):_0x1afca[_0x2096('0x4f')]=_0x2096('0x3d')+_0x1359c1+_0x2096('0x50')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x51'))[_0x2096('0x3b')](function(_0x50e516){if(_0x50e516)return _0x50e516;if(_0x489c1f['moduleCreate']!=_0x2096('0x52')){return createEndUser(_0x5d7daf,_0x1359c1,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f);}else{return{};}});break;}}function getCall(_0x2a8f57,_0x4f2c33,_0x290c66,_0x4d8f4d,_0x1332ea,_0xe744aa,_0x13dd62,_0x2da714){logger[_0x2096('0x2c')]('Creating\x20new\x20call...');var _0x5ba40a={};_0x5ba40a[_0x2096('0x54')]={'name':!_[_0x2096('0x1c')](_0x4d8f4d[_0x2096('0x40')][_0x2096('0x1a')])&&!_[_0x2096('0x1c')](_0x4d8f4d[_0x2096('0x36')][_0x2096('0x1a')])&&_0x4d8f4d[_0x2096('0x36')][_0x2096('0x1a')]===_0x2096('0x55')?_0x4d8f4d[_0x2096('0x40')][_0x2096('0x1a')]:!_[_0x2096('0x1c')](_0x4d8f4d['first_name'])?_0x4d8f4d[_0x2096('0x41')]+'\x20'+_0x4d8f4d[_0x2096('0x42')]:_0x4d8f4d['last_name'],'id':_0x4d8f4d['id']};_0x5ba40a['Subject']=intUtil[_0x2096('0x56')](_0xe744aa['Subjects'],_0x13dd62,'\x20');_0x5ba40a[_0x2096('0x57')]=intUtil[_0x2096('0x56')](_0xe744aa[_0x2096('0x58')],_0x13dd62,'\x0a');if(_0x1332ea[_0x2096('0x47')]===_0x2096('0x4e')){_0x5ba40a[_0x2096('0x59')]={'name':!_[_0x2096('0x1c')](_0x1332ea[_0x2096('0x5a')])?_0x1332ea[_0x2096('0x5a')]:!_[_0x2096('0x1c')](_0x1332ea[_0x2096('0x5b')])?_0x1332ea[_0x2096('0x5b')]+'\x20'+_0x1332ea['Last_Name']:_0x1332ea[_0x2096('0x5c')],'id':_0x1332ea['id']};}if(_0x1332ea[_0x2096('0x47')]===_0x2096('0x51')){_0x5ba40a[_0x2096('0x5d')]={'name':!_['isNil'](_0x1332ea[_0x2096('0x5a')])?_0x1332ea[_0x2096('0x5a')]:!_['isNil'](_0x1332ea[_0x2096('0x5b')])?_0x1332ea[_0x2096('0x5b')]+'\x20'+_0x1332ea[_0x2096('0x5c')]:_0x1332ea[_0x2096('0x5c')],'id':_0x1332ea['id']};_0x5ba40a[_0x2096('0x5e')]=_[_0x2096('0x3f')](_0x1332ea[_0x2096('0x47')]);}if(_0x13dd62[_0x2096('0x5f')]){_0x5ba40a['Call_Duration']=moment[_0x2096('0x60')](parseInt(_0x13dd62['talktime'])*0x3e8)[_0x2096('0x2f')]('mm:ss');}else if(_0x13dd62[_0x2096('0x61')]&&_0x13dd62[_0x2096('0x62')]){_0x5ba40a[_0x2096('0x63')]=moment[_0x2096('0x60')](moment(_0x13dd62[_0x2096('0x62')],_0x2096('0x64'))['diff'](moment(_0x13dd62[_0x2096('0x65')],_0x2096('0x64'))))[_0x2096('0x2f')]('mm:ss');}switch(_0x13dd62[_0x2096('0x66')]){case _0x2096('0x67'):_0x5ba40a['Call_Result']='Called';break;case'complete':case _0x2096('0x68'):_0x5ba40a['Call_Result']='Answered';break;case _0x2096('0x69'):_0x5ba40a['Call_Result']='Rejected';break;case _0x2096('0x6a'):_0x5ba40a[_0x2096('0x6b')]=_0x2096('0x6c');break;case _0x2096('0x6d'):_0x5ba40a[_0x2096('0x6b')]='Timeout';default:}_0x5ba40a[_0x2096('0x6e')]=(_0x2da714===_0x2096('0x6f')?moment(_0x13dd62[_0x2096('0x65')])[_0x2096('0x2f')](_0x2096('0x64')):moment(_0x13dd62[_0x2096('0x70')])[_0x2096('0x2f')](_0x2096('0x64')))||moment()[_0x2096('0x2f')](_0x2096('0x64'));_0x5ba40a[_0x2096('0x71')]=_0x2da714||_0x2096('0x72');_0x5ba40a=_['merge'](_0x5ba40a,getCustomFields(_0xe744aa[_0x2096('0x73')],_0x13dd62));return request({'method':_0x2096('0x22'),'uri':'https://www.zohoapis.'+_0x4f2c33+_0x2096('0x74'),'headers':{'Authorization':_0x2096('0x43')+_0x2a8f57},'body':{'data':[_0x5ba40a]},'json':!![]})[_0x2096('0x3b')](function(_0x238b9f){if(_0x238b9f&&_0x238b9f[_0x2096('0x3c')][0x0][_0x2096('0x44')]===_0x2096('0x45')){logger[_0x2096('0x2c')]('Call\x20created!');return{'id':_0x238b9f['data'][0x0]['details']['id']};}})[_0x2096('0x28')](function(_0x153983){logger[_0x2096('0x2c')]('err',_0x153983[_0x2096('0x2b')]);console[_0x2096('0x75')]('err',_0x153983);});}exports[_0x2096('0x76')]=function(_0x3ee068,_0x1d7680,_0x330322,_0x224292,_0x391df0,_0x4d8e4f){var _0x3e875d,_0x595974,_0x2c2db4;_0x4d8e4f[_0x2096('0x77')]=intUtil['stripTrailingSlash'](_0x4d8e4f['host']);_0x4d8e4f[_0x2096('0x78')]=intUtil[_0x2096('0x79')](_0x4d8e4f[_0x2096('0x78')]);if(_0x391df0&&_0x391df0[_0x2096('0x7a')]){logger[_0x2096('0x2c')](_0x2096('0x7b'),_0x2096('0x7c'));_0x1d7680[_0x2096('0x7d')]=_0x4d8e4f[_0x2096('0x78')]+'/api/voice/recordings/'+_0x1d7680['uniqueid']+_0x2096('0x7e')+md5(_0x1d7680[_0x2096('0x7f')]);}else{_0x1d7680[_0x2096('0x7d')]='';}var _0x331f88=_0x4d8e4f[_0x2096('0x77')]===_0x2096('0x80')?'eu':_0x2096('0x81');return getAccessToken(_0x4d8e4f)[_0x2096('0x3b')](function(_0x3a4813){_0x2c2db4=_0x3a4813;return getUser(_0x2c2db4,_0x331f88,_0x4d8e4f,_0x224292[_0x2096('0x82')]);})[_0x2096('0x3b')](function(_0x55acf7){_0x3e875d=_0x55acf7;logger[_0x2096('0x2c')](_0x2096('0x83'),_0x3e875d['id']);return getEndUser(_0x2c2db4,_0x331f88,_0x4d8e4f,_0x1d7680['calleridname'],_0x1d7680[_0x2096('0x84')],_0x3e875d,_0x330322);})[_0x2096('0x3b')](function(_0x37efc1){_0x595974=_0x37efc1;return getCall(_0x2c2db4,_0x331f88,_0x4d8e4f,_0x3e875d,_0x595974,_0x330322,_0x1d7680,_0x2096('0x72'));})[_0x2096('0x3b')](function(_0x29bd40){if(_0x29bd40){logger[_0x2096('0x2c')]('The\x20Call\x20ID\x20is:',_0x29bd40['id']);logger[_0x2096('0x2c')](_0x2096('0x7b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2096('0x2f')](_0x2096('0x85'),_0x224292[_0x2096('0x1a')]),_0x2096('0x86'),{'uri':_0x2096('0x87')+_0x4d8e4f[_0x2096('0x77')]+_0x2096('0x88')+_0x29bd40['id']});}})[_0x2096('0x28')](function(_0x2bd357){logger['error'](_0x2096('0x7b'),JSON['stringify'](_0x2bd357));});};exports[_0x2096('0x6f')]=function(_0x1e8ce8,_0x4c9734,_0x2c5f6b,_0x24952c,_0x48d03f,_0x59905a,_0x4da766){var _0x358b11,_0x4c1f89,_0x1d9717;_0x59905a[_0x2096('0x77')]=intUtil[_0x2096('0x79')](_0x59905a[_0x2096('0x77')]);_0x59905a[_0x2096('0x78')]=intUtil[_0x2096('0x79')](_0x59905a[_0x2096('0x78')]);if(_0x4da766&&_0x4da766[_0x2096('0x89')]&&_0x4da766[_0x2096('0x89')]!==_0x2096('0x8a')){logger['info'](_0x2096('0x8b'),_0x2096('0x7c'));_0x4c9734[_0x2096('0x7d')]=_0x59905a['serverUrl']+_0x2096('0x8c')+_0x4c9734['uniqueid']+_0x2096('0x7e')+md5(_0x4c9734[_0x2096('0x7f')]);}var _0x2aeff5=_0x59905a[_0x2096('0x77')]===_0x2096('0x80')?'eu':_0x2096('0x81');return getAccessToken(_0x59905a)[_0x2096('0x3b')](function(_0x7277a0){_0x1d9717=_0x7277a0;return getUser(_0x1d9717,_0x2aeff5,_0x59905a,_0x24952c[_0x2096('0x82')]);})['then'](function(_0x479dcf){_0x358b11=_0x479dcf;logger[_0x2096('0x2c')]('The\x20User\x20ID\x20is:',_0x358b11['id']);return getEndUser(_0x1d9717,_0x2aeff5,_0x59905a,_0x4c9734[_0x2096('0x8d')],_0x4c9734[_0x2096('0x8e')],_0x358b11,_0x2c5f6b);})[_0x2096('0x3b')](function(_0x1cf39d){_0x4c1f89=_0x1cf39d;return getCall(_0x1d9717,_0x2aeff5,_0x59905a,_0x358b11,_0x4c1f89,_0x2c5f6b,_0x4c9734,_0x2096('0x8f'));})[_0x2096('0x3b')](function(_0x27b051){if(_0x27b051){logger[_0x2096('0x2c')](_0x2096('0x90'),_0x27b051['id']);logger['info'](_0x2096('0x8b'),_0x2096('0x91'));emit(util[_0x2096('0x2f')](_0x2096('0x85'),_0x24952c[_0x2096('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x59905a[_0x2096('0x77')]+_0x2096('0x88')+_0x27b051['id']});}})['catch'](function(_0x584bd8){logger[_0x2096('0x29')](_0x2096('0x8b'),JSON[_0x2096('0x10')](_0x584bd8));});};exports['unmanaged']=function(_0x1451c3,_0x1a9fdb,_0x3cf3c9,_0x41d1f4,_0x12d2ff,_0x583fbe){var _0x4564ab,_0x3e9244,_0x45e53a;_0x583fbe[_0x2096('0x77')]=intUtil[_0x2096('0x79')](_0x583fbe[_0x2096('0x77')]);_0x583fbe[_0x2096('0x78')]=intUtil[_0x2096('0x79')](_0x583fbe['serverUrl']);if(_0x12d2ff&&_0x12d2ff[_0x2096('0x7a')]){logger[_0x2096('0x2c')]('['+_0x1a9fdb[_0x2096('0x66')][_0x2096('0x92')]()+']','Recording\x20is\x20enabled!');_0x1a9fdb[_0x2096('0x7d')]=_0x583fbe[_0x2096('0x78')]+_0x2096('0x8c')+_0x1a9fdb[_0x2096('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0x1a9fdb['uniqueid']);}else{_0x1a9fdb['recordingURL']='';}var _0x5925fb=_0x583fbe[_0x2096('0x77')]==='zoho.eu'?'eu':_0x2096('0x81');return getAccessToken(_0x583fbe)['then'](function(_0x1ba62f){_0x45e53a=_0x1ba62f;return getUser(_0x45e53a,_0x5925fb,_0x583fbe);})['then'](function(_0x27d51c){_0x4564ab=_0x27d51c;logger[_0x2096('0x2c')](_0x2096('0x83'),_0x4564ab['id']);return getEndUser(_0x45e53a,_0x5925fb,_0x583fbe,_0x1a9fdb['calleridname'],_0x1a9fdb[_0x2096('0x84')],_0x4564ab,_0x3cf3c9);})['then'](function(_0x2a1755){_0x3e9244=_0x2a1755;return getCall(_0x45e53a,_0x5925fb,_0x583fbe,_0x4564ab,_0x3e9244,_0x3cf3c9,_0x1a9fdb,_0x2096('0x72'));})['then'](function(_0x3fb1b1){if(_0x3fb1b1){logger[_0x2096('0x2c')](_0x2096('0x90'),_0x3fb1b1['id']);}})['catch'](function(_0x1a265f){logger[_0x2096('0x29')]('['+_0x1a9fdb[_0x2096('0x66')]['toUpperCase']()+']',JSON[_0x2096('0x10')](_0x1a265f));});}; \ 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 252d6f0..ce15e1e 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 _0xc22a=['info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc22a,0x6f));var _0xac22=function(_0x41595e,_0x1cd078){_0x41595e=_0x41595e-0x0;var _0x270b13=_0xc22a[_0x41595e];return _0x270b13;};'use strict';var util=require(_0xac22('0x0'));var sh=require('shelljs');var Mustache=require(_0xac22('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0xac22('0x2')]=function(_0x4773c5,_0x9ade20){var _0x205b76=_0x4773c5[_0xac22('0x3')]?_0x4773c5[_0xac22('0x3')]:_0xac22('0x4');var _0x2a9112=_0x4773c5[_0xac22('0x5')]?Mustache[_0xac22('0x6')](_0x4773c5[_0xac22('0x5')],_0x9ade20):_0x9ade20;sh['exec'](_0x2a9112,function(_0x3ad423,_0x444793,_0x196cc8){if(_0x3ad423!==0x0){logger[_0xac22('0x7')](util['format'](_0xac22('0x8'),_0x205b76,_0x2a9112,_0x3ad423,_0x196cc8));}else{logger[_0xac22('0x9')](util[_0xac22('0xa')](_0xac22('0xb'),_0x205b76,_0x2a9112,_0x444793));}});}; \ No newline at end of file +var _0x0f2e=['Script','exec','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','data2'];(function(_0x1ab07b,_0x2e9eb4){var _0x5b98a0=function(_0x480f05){while(--_0x480f05){_0x1ab07b['push'](_0x1ab07b['shift']());}};_0x5b98a0(++_0x2e9eb4);}(_0x0f2e,0x7f));var _0xe0f2=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x0f2e[_0x4dbaad];return _0x226c72;};'use strict';var util=require(_0xe0f2('0x0'));var sh=require('shelljs');var Mustache=require(_0xe0f2('0x1'));var logger=require(_0xe0f2('0x2'))(_0xe0f2('0x3'));exports['exec']=function(_0x1ed4ca,_0xdc116d){var _0x16d2bb=_0x1ed4ca[_0xe0f2('0x4')]?_0x1ed4ca[_0xe0f2('0x4')]:_0xe0f2('0x5');var _0xc670d0=_0x1ed4ca['data3']?Mustache['render'](_0x1ed4ca['data3'],_0xdc116d):_0xdc116d;sh[_0xe0f2('0x6')](_0xc670d0,function(_0x11509b,_0x4061cc,_0x1440b1){if(_0x11509b!==0x0){logger[_0xe0f2('0x7')](util[_0xe0f2('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x16d2bb,_0xc670d0,_0x11509b,_0x1440b1));}else{logger[_0xe0f2('0x9')](util[_0xe0f2('0x8')](_0xe0f2('0xa'),_0x16d2bb,_0xc670d0,_0x4061cc));}});}; \ 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 89c2967..d5cb4fc 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 _0xb9fe=['PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','render','data5','number','headers','data6','parse','stack','GET','DELETE','POST'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xb9fe,0xeb));var _0xeb9f=function(_0x52f31e,_0x228812){_0x52f31e=_0x52f31e-0x0;var _0xccce8f=_0xb9fe[_0x52f31e];return _0xccce8f;};'use strict';var rp=require(_0xeb9f('0x0'));var util=require(_0xeb9f('0x1'));var _=require('lodash');var Mustache=require(_0xeb9f('0x2'));var logger=require('../../../../config/logger')(_0xeb9f('0x3'));exports[_0xeb9f('0x4')]=function(_0x11e0c9,_0x2d0d88){var _0xc4d0bc,_0x1c8bf8;var _0x5c4aa5={'method':_0x11e0c9[_0xeb9f('0x5')][_0xeb9f('0x6')](),'uri':Mustache[_0xeb9f('0x7')](_0x11e0c9['data2'],_0x2d0d88),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x11e0c9[_0xeb9f('0x8')])===_0xeb9f('0x9')&&parseInt(_0x11e0c9['data5'])>=0x1&&parseInt(_0x11e0c9[_0xeb9f('0x8')])<=0xa?parseInt(_0x11e0c9['data5'])*0x3e8:0x5*0x3e8};try{_0x5c4aa5[_0xeb9f('0xa')]=_0x11e0c9[_0xeb9f('0xb')]?JSON[_0xeb9f('0xc')](Mustache[_0xeb9f('0x7')](_0x11e0c9[_0xeb9f('0xb')],_0x2d0d88)):{};}catch(_0x59770b){logger['error'](_0x59770b[_0xeb9f('0xd')]);}switch(_0x11e0c9[_0xeb9f('0x5')][_0xeb9f('0x6')]()){case _0xeb9f('0xe'):case _0xeb9f('0xf'):_0xc4d0bc=null;_0x5c4aa5['qs']=_0x2d0d88;break;case _0xeb9f('0x10'):case _0xeb9f('0x11'):if(_0x11e0c9[_0xeb9f('0x12')]){try{_0xc4d0bc=JSON[_0xeb9f('0xc')](Mustache[_0xeb9f('0x7')](_0x11e0c9[_0xeb9f('0x12')],_0x2d0d88));_0x5c4aa5[_0xeb9f('0x13')]=_0xc4d0bc;}catch(_0x2a55b0){logger[_0xeb9f('0x14')](_0x2a55b0[_0xeb9f('0xd')]);logger['error'](_0xeb9f('0x15'));}}else{_0xc4d0bc=_0x2d0d88;_0x5c4aa5[_0xeb9f('0x13')]=_0xc4d0bc;}break;}logger[_0xeb9f('0x16')](util[_0xeb9f('0x17')](_0xeb9f('0x18'),_0x11e0c9[_0xeb9f('0x5')],_0x11e0c9[_0xeb9f('0x19')],JSON['stringify'](_0x5c4aa5)));rp(_0x5c4aa5)[_0xeb9f('0x1a')](function(_0x535f1c){_0xc4d0bc=!_[_0xeb9f('0x1b')](_0xc4d0bc)?_0xeb9f('0x1c')+_0xc4d0bc:'';_0x1c8bf8=typeof _0x535f1c[_0xeb9f('0x13')]===_0xeb9f('0x1d')?JSON['stringify'](_0x535f1c['body']):_0x535f1c[_0xeb9f('0x13')];logger['info'](util['format'](_0xeb9f('0x1e'),_0x11e0c9[_0xeb9f('0x5')],_0x11e0c9[_0xeb9f('0x19')],_0x535f1c[_0xeb9f('0x1f')],_0x1c8bf8));})[_0xeb9f('0x20')](function(_0x352ec3){logger[_0xeb9f('0x14')](util[_0xeb9f('0x17')](_0xeb9f('0x21'),_0x11e0c9[_0xeb9f('0x5')],_0x11e0c9[_0xeb9f('0x19')],_0x352ec3[_0xeb9f('0x1f')],_0x352ec3[_0xeb9f('0x22')],_0x352ec3[_0xeb9f('0x23')]));});}; \ No newline at end of file +var _0x0701=['data7','render','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','mustache','../../../../config/logger','trigger','data1','data2','data5','number','headers','data6','parse','stack','toUpperCase','GET','POST','PUT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0701,0x1a9));var _0x1070=function(_0x2bfb5f,_0x11c778){_0x2bfb5f=_0x2bfb5f-0x0;var _0x2e1a32=_0x0701[_0x2bfb5f];return _0x2e1a32;};'use strict';var rp=require(_0x1070('0x0'));var util=require('util');var _=require(_0x1070('0x1'));var Mustache=require(_0x1070('0x2'));var logger=require(_0x1070('0x3'))(_0x1070('0x4'));exports['exec']=function(_0x32517e,_0x2e2cab){var _0xef6178,_0x1dd049;var _0x24de46={'method':_0x32517e[_0x1070('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x32517e[_0x1070('0x6')],_0x2e2cab),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x32517e[_0x1070('0x7')])===_0x1070('0x8')&&parseInt(_0x32517e[_0x1070('0x7')])>=0x1&&parseInt(_0x32517e[_0x1070('0x7')])<=0xa?parseInt(_0x32517e[_0x1070('0x7')])*0x3e8:0x5*0x3e8};try{_0x24de46[_0x1070('0x9')]=_0x32517e[_0x1070('0xa')]?JSON[_0x1070('0xb')](Mustache['render'](_0x32517e[_0x1070('0xa')],_0x2e2cab)):{};}catch(_0x233dde){logger['error'](_0x233dde[_0x1070('0xc')]);}switch(_0x32517e['data1'][_0x1070('0xd')]()){case _0x1070('0xe'):case'DELETE':_0xef6178=null;_0x24de46['qs']=_0x2e2cab;break;case _0x1070('0xf'):case _0x1070('0x10'):if(_0x32517e[_0x1070('0x11')]){try{_0xef6178=JSON[_0x1070('0xb')](Mustache[_0x1070('0x12')](_0x32517e[_0x1070('0x11')],_0x2e2cab));_0x24de46[_0x1070('0x13')]=_0xef6178;}catch(_0x2b44d8){logger['error'](_0x2b44d8['stack']);logger[_0x1070('0x14')](_0x1070('0x15'));}}else{_0xef6178=_0x2e2cab;_0x24de46[_0x1070('0x13')]=_0xef6178;}break;}logger[_0x1070('0x16')](util[_0x1070('0x17')](_0x1070('0x18'),_0x32517e[_0x1070('0x5')],_0x32517e[_0x1070('0x6')],JSON[_0x1070('0x19')](_0x24de46)));rp(_0x24de46)[_0x1070('0x1a')](function(_0x3c511e){_0xef6178=!_[_0x1070('0x1b')](_0xef6178)?_0x1070('0x1c')+_0xef6178:'';_0x1dd049=typeof _0x3c511e[_0x1070('0x13')]===_0x1070('0x1d')?JSON['stringify'](_0x3c511e['body']):_0x3c511e[_0x1070('0x13')];logger['info'](util[_0x1070('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x32517e[_0x1070('0x5')],_0x32517e[_0x1070('0x6')],_0x3c511e[_0x1070('0x1e')],_0x1dd049));})[_0x1070('0x1f')](function(_0x2145cc){logger[_0x1070('0x14')](util[_0x1070('0x17')](_0x1070('0x20'),_0x32517e[_0x1070('0x5')],_0x32517e[_0x1070('0x6')],_0x2145cc['statusCode'],_0x2145cc[_0x1070('0x21')],_0x2145cc['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f8ae144..10bcbc7 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 _0x3c9e=['error','message','result','catch','rpc','exports','bluebird','../../config/logger','http','request','debug','routing'];(function(_0x44b04c,_0x5786a3){var _0x1d2442=function(_0x5d6671){while(--_0x5d6671){_0x44b04c['push'](_0x44b04c['shift']());}};_0x1d2442(++_0x5786a3);}(_0x3c9e,0xc6));var _0xe3c9=function(_0x3852fd,_0x5b321f){_0x3852fd=_0x3852fd-0x0;var _0x186388=_0x3c9e[_0x3852fd];return _0x186388;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe3c9('0x0'));var logger=require(_0xe3c9('0x1'))('routing');var client=jayson['client'][_0xe3c9('0x2')]({'port':0x2329});client['Request']=function(_0x427e91,_0x296042){return new BPromise(function(_0x3cc05d,_0x267ffd){return client[_0xe3c9('0x3')](_0x427e91,_0x296042)['then'](function(_0x239eb6){logger[_0xe3c9('0x4')]('rpc',_0xe3c9('0x5'),_0x427e91,_0x296042,_0x239eb6);if(_0x239eb6[_0xe3c9('0x6')]){logger[_0xe3c9('0x6')]('rpc',_0xe3c9('0x5'),_0x427e91,_0x239eb6[_0xe3c9('0x6')][_0xe3c9('0x7')],_0x296042);return _0x267ffd(_0x239eb6[_0xe3c9('0x6')]['message']);}else{return _0x3cc05d(_0x239eb6[_0xe3c9('0x8')]);}})[_0xe3c9('0x9')](function(_0x447191){logger[_0xe3c9('0x6')](_0xe3c9('0xa'),'routing',_0x427e91,_0x447191,_0x296042);return _0x267ffd(_0x447191);});});};module[_0xe3c9('0xb')]=client; \ No newline at end of file +var _0xfbd9=['request','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','http'];(function(_0x1b1cfe,_0x5c2482){var _0x59c388=function(_0x169dda){while(--_0x169dda){_0x1b1cfe['push'](_0x1b1cfe['shift']());}};_0x59c388(++_0x5c2482);}(_0xfbd9,0x1b6));var _0x9fbd=function(_0x148186,_0x48b118){_0x148186=_0x148186-0x0;var _0x2601fb=_0xfbd9[_0x148186];return _0x2601fb;};'use strict';var jayson=require(_0x9fbd('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson['client'][_0x9fbd('0x1')]({'port':0x2329});client['Request']=function(_0x2f7d04,_0x37eb4f){return new BPromise(function(_0x4faf87,_0x523dcb){return client[_0x9fbd('0x2')](_0x2f7d04,_0x37eb4f)['then'](function(_0x3df265){logger[_0x9fbd('0x3')](_0x9fbd('0x4'),_0x9fbd('0x5'),_0x2f7d04,_0x37eb4f,_0x3df265);if(_0x3df265[_0x9fbd('0x6')]){logger[_0x9fbd('0x6')](_0x9fbd('0x4'),_0x9fbd('0x5'),_0x2f7d04,_0x3df265[_0x9fbd('0x6')]['message'],_0x37eb4f);return _0x523dcb(_0x3df265[_0x9fbd('0x6')][_0x9fbd('0x7')]);}else{return _0x4faf87(_0x3df265[_0x9fbd('0x8')]);}})[_0x9fbd('0x9')](function(_0x8eb010){logger[_0x9fbd('0x6')](_0x9fbd('0x4'),'routing',_0x2f7d04,_0x8eb010,_0x37eb4f);return _0x523dcb(_0x8eb010);});});};module[_0x9fbd('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 662e9a7..5482f4a 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 _0x2672=['error','Email\x20service\x20initialization','./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','listen','loginMailFrequency'];(function(_0x619193,_0x46011d){var _0x4855d9=function(_0x396c08){while(--_0x396c08){_0x619193['push'](_0x619193['shift']());}};_0x4855d9(++_0x46011d);}(_0x2672,0x9e));var _0x2267=function(_0x4b8fee,_0x13f97b){_0x4b8fee=_0x4b8fee-0x0;var _0x56828b=_0x2672[_0x4b8fee];return _0x56828b;};'use strict';var server=require(_0x2267('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x2267('0x1'));var mailAccount=require(_0x2267('0x2'));var setting=require(_0x2267('0x3'));var logger=require(_0x2267('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2267('0x5')]()[_0x2267('0x6')](mailAccount[_0x2267('0x7')]())[_0x2267('0x6')](realtime[_0x2267('0x8')]())[_0x2267('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x2267('0x9')](realtime,email)[_0x2267('0x6')](function(){return initRealtime();})[_0x2267('0x6')](function(){return setting['getSettings']();})['then'](function(_0x3f6518){return setInterval(initRealtime,_0x3f6518[_0x2267('0xa')]*0x3e8);})['catch'](function(_0x590c75){logger[_0x2267('0xb')](_0x2267('0xc'),_0x590c75);});}main(); \ No newline at end of file +var _0xeba3=['loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','listen','getSettings'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xeba3,0x130));var _0x3eba=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xeba3[_0x31e29a];return _0x32d892;};'use strict';var server=require(_0x3eba('0x0'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0x3eba('0x1'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x3eba('0x2')]()[_0x3eba('0x3')](mailAccount[_0x3eba('0x4')]())['then'](realtime[_0x3eba('0x5')]())[_0x3eba('0x3')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x3eba('0x6')](realtime,email)[_0x3eba('0x3')](function(){return initRealtime();})[_0x3eba('0x3')](function(){return setting[_0x3eba('0x7')]();})[_0x3eba('0x3')](function(_0x5abd3e){return setInterval(initRealtime,_0x5abd3e[_0x3eba('0x8')]*0x3e8);})[_0x3eba('0x9')](function(_0x3e5f4f){logger[_0x3eba('0xa')](_0x3eba('0xb'),_0x3e5f4f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 83dba4d..79180d0 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 _0xc57e=['bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','bluebird','md5','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','status','messageStatus','Imap','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','active','service','provider','custom','box','handleImapBox'];(function(_0x40c8cc,_0x3b3c41){var _0x58f8f4=function(_0x512062){while(--_0x512062){_0x40c8cc['push'](_0x40c8cc['shift']());}};_0x58f8f4(++_0x3b3c41);}(_0xc57e,0xc5));var _0xec57=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc57e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xec57('0x0'));var moment=require('moment');var BPromise=require(_0xec57('0x1'));var md5=require(_0xec57('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xec57('0x3'))(_0xec57('0x4'));config['redis']=_[_0xec57('0x5')](config[_0xec57('0x6')],{'host':_0xec57('0x7'),'port':0x18eb});var io=require(_0xec57('0x8'))(new Redis(config[_0xec57('0x6')]));var EmailImap=require(_0xec57('0x9'));var EmailSmtp=require(_0xec57('0xa'));var mailAccount=require(_0xec57('0xb'));var md5Accounts={};function EmailChannel(_0x5acd28){logger[_0xec57('0xc')](_0xec57('0xd'));this[_0xec57('0xe')]=_0x5acd28[_0xec57('0xe')];this[_0xec57('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0xec57('0x10')]=function(_0x47c57d){var _0x3a65d3=this[_0xec57('0xe')][_0x47c57d];var _0x5efd40={'id':_0x3a65d3['id'],'name':_0x3a65d3[_0xec57('0x11')],'key':_0x3a65d3[_0xec57('0x12')],'active':_0x3a65d3['active'],'Imap':{'status':_0x3a65d3['Imap'][_0xec57('0x13')],'messageStatus':_0x3a65d3['Imap'][_0xec57('0x14')],'total':_0x3a65d3[_0xec57('0x15')][_0xec57('0x16')]}};if(_[_0xec57('0x17')](md5Accounts[_0x47c57d])){md5Accounts[_0x47c57d]={};}var _0x2b7e98=md5(JSON[_0xec57('0x18')](_0x5efd40));if(md5Accounts[_0x47c57d]['md5']!==_0x2b7e98){md5Accounts[_0x47c57d][_0xec57('0x2')]=_0x2b7e98;io[_0xec57('0x10')](_0xec57('0x19'),_0x5efd40);}};EmailChannel[_0xec57('0x1a')][_0xec57('0x1b')]=function(_0x3e799e){for(var _0x24bca5 in _0x3e799e){if(_0x3e799e[_0xec57('0x1c')](_0x24bca5)){if(_0x3e799e[_0x24bca5][_0xec57('0x15')]&&_0x3e799e[_0x24bca5][_0xec57('0x1d')]){var _0xd4b72a=_0x3e799e[_0x24bca5][_0xec57('0x15')];if(!_0xd4b72a[_0xec57('0x1e')]&&_0x3e799e[_0x24bca5][_0xec57('0x1f')]!==_0xec57('0x20'))_0xd4b72a[_0xec57('0x1e')]=_0x3e799e[_0x24bca5]['provider'];if(!this[_0xec57('0xf')][_0xec57('0x1c')](_0xd4b72a['id'])){this['imapAccounts'][_0xd4b72a['id']]=new EmailImap(_0xd4b72a,_0x3e799e[_0x24bca5][_0xec57('0x4')]);this[_0xec57('0xf')][_0xd4b72a['id']]['on'](_0xec57('0x21'),this[_0xec57('0x22')][_0xec57('0x23')](this,_0x24bca5));this[_0xec57('0xf')][_0xd4b72a['id']]['on'](_0xec57('0x4'),this['handleImapEmail'][_0xec57('0x23')](this,_0x24bca5));this['imapAccounts'][_0xd4b72a['id']]['on'](_0xec57('0x24'),this[_0xec57('0x25')]['bind'](this,_0x24bca5));this['imapAccounts'][_0xd4b72a['id']]['on'](_0xec57('0x26'),this[_0xec57('0x27')]['bind'](this,_0x24bca5));}}else{if(_[_0xec57('0x17')](this[_0xec57('0xe')][_0x24bca5][_0xec57('0x15')])){this['mailAccounts'][_0x24bca5]['Imap']={};}this['mailAccounts'][_0x24bca5][_0xec57('0x15')][_0xec57('0x13')]=_0xec57('0x28');this[_0xec57('0xe')][_0x24bca5][_0xec57('0x15')][_0xec57('0x14')]='';this['emit'](_0x24bca5);}}}};EmailChannel['prototype'][_0xec57('0x22')]=function(_0x5bcc09,_0x4fd209){if(this[_0xec57('0xe')][_0x5bcc09]){this[_0xec57('0xe')][_0x5bcc09][_0xec57('0x15')][_0xec57('0x13')]=_0xec57('0x29');this[_0xec57('0xe')][_0x5bcc09][_0xec57('0x15')][_0xec57('0x14')]=_0x4fd209[_0xec57('0x11')];if(_0x4fd209[_0xec57('0x2a')]){this[_0xec57('0xe')][_0x5bcc09]['Imap'][_0xec57('0x16')]=_0x4fd209[_0xec57('0x2a')][_0xec57('0x16')];}return this[_0xec57('0x10')](_0x5bcc09);}};EmailChannel['prototype'][_0xec57('0x2b')]=function(_0x26fe11,_0x59e6a2){logger['info'](_0xec57('0x2c'),_0x59e6a2['firstName'],_0x59e6a2[_0xec57('0x2d')],_0x59e6a2['from'],_0x26fe11);if(this[_0xec57('0xe')][_0x26fe11]){return mailAccount['notify'](_0x26fe11,_0x59e6a2)['then'](function(_0x4b9ece){if(_0x4b9ece){logger[_0xec57('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xec57('0x2e')](function(_0x4a1a1c){logger[_0xec57('0x26')](_0xec57('0x2f'),JSON[_0xec57('0x18')](_0x4a1a1c));});}};EmailChannel[_0xec57('0x1a')]['handleImapEnd']=function(_0x2b4b37){if(this[_0xec57('0xe')][_0x2b4b37]&&this[_0xec57('0xe')][_0x2b4b37]['Imap']){if(this[_0xec57('0xf')][this[_0xec57('0xe')][_0x2b4b37][_0xec57('0x15')]['id']]){delete this[_0xec57('0xf')][this[_0xec57('0xe')][_0x2b4b37][_0xec57('0x15')]['id']];}this[_0xec57('0xe')][_0x2b4b37]['Imap'][_0xec57('0x30')]=moment();this[_0xec57('0x10')](_0x2b4b37);}};EmailChannel[_0xec57('0x1a')][_0xec57('0x27')]=function(_0xa3a6d1,_0x2cea5e){if(this['mailAccounts'][_0xa3a6d1]){this[_0xec57('0xe')][_0xa3a6d1][_0xec57('0x15')][_0xec57('0x13')]='error';this[_0xec57('0xe')][_0xa3a6d1]['Imap'][_0xec57('0x14')]=_0x2cea5e;return this[_0xec57('0x10')](_0xa3a6d1);}};EmailChannel[_0xec57('0x1a')][_0xec57('0x31')]=function(_0x1f64fa,_0x30bca1){return this[_0xec57('0x32')][_0xec57('0x33')](_0x1f64fa,_0x30bca1);};EmailChannel[_0xec57('0x1a')][_0xec57('0x34')]=function(_0x7a7007){var _0x45e568=this;if(this[_0xec57('0xe')][_0x7a7007['id']]){if(_[_0xec57('0x17')](this[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')])){this['mailAccounts'][_0x7a7007['id']][_0xec57('0x35')]={};}this['mailAccounts'][_0x7a7007['id']]['Smtp'][_0xec57('0x30')]=moment();return new BPromise(function(_0xe5ff31,_0x38a1fd){return _0x45e568['smtp']['verify'](_0x7a7007)[_0xec57('0x36')](function(_0x2bd0c5){_0x45e568['mailAccounts'][_0x7a7007['id']]['Smtp']['status']=_0xec57('0x37');_0x45e568[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')][_0xec57('0x14')]='';_0x45e568[_0xec57('0x10')](_0x7a7007['id']);_0xe5ff31(_0x2bd0c5);})[_0xec57('0x2e')](function(_0x289e7d){_0x45e568[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')][_0xec57('0x13')]=_0xec57('0x26');_0x45e568[_0xec57('0xe')][_0x7a7007['id']][_0xec57('0x35')][_0xec57('0x14')]=_0x289e7d;_0x45e568[_0xec57('0x10')](_0x7a7007['id']);_0x38a1fd(_0x289e7d);});});}return this[_0xec57('0x32')][_0xec57('0x38')](_0x7a7007);};module[_0xec57('0x39')]=EmailChannel; \ No newline at end of file +var _0x7add=['socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','active','Imap','status','messageStatus','isNil','md5','mailAccount:update','prototype','refresh','hasOwnProperty','service','provider','handleImapBox','bind','handleImapEmail','end','handleImapEnd','connected','total','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','Mail\x20accepted\x20from\x20routing','catch','stringify','lastSync','handleImapError','error','sendMail','Smtp','verify','then','verified','exports','lodash','moment','../../../config/environment','../../../config/logger','email','redis','defaults','localhost'];(function(_0x1fec8a,_0xc12920){var _0x570fad=function(_0x240bb6){while(--_0x240bb6){_0x1fec8a['push'](_0x1fec8a['shift']());}};_0x570fad(++_0xc12920);}(_0x7add,0x9a));var _0xd7ad=function(_0x5aa8ef,_0x20312a){_0x5aa8ef=_0x5aa8ef-0x0;var _0x553770=_0x7add[_0x5aa8ef];return _0x553770;};'use strict';var _=require(_0xd7ad('0x0'));var moment=require(_0xd7ad('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0xd7ad('0x2'));var logger=require(_0xd7ad('0x3'))(_0xd7ad('0x4'));config[_0xd7ad('0x5')]=_[_0xd7ad('0x6')](config[_0xd7ad('0x5')],{'host':_0xd7ad('0x7'),'port':0x18eb});var io=require(_0xd7ad('0x8'))(new Redis(config[_0xd7ad('0x5')]));var EmailImap=require(_0xd7ad('0x9'));var EmailSmtp=require(_0xd7ad('0xa'));var mailAccount=require(_0xd7ad('0xb'));var md5Accounts={};function EmailChannel(_0x5c2fb2){logger['info'](_0xd7ad('0xc'));this[_0xd7ad('0xd')]=_0x5c2fb2[_0xd7ad('0xd')];this[_0xd7ad('0xe')]={};this[_0xd7ad('0xf')]=new EmailSmtp();}EmailChannel['prototype'][_0xd7ad('0x10')]=function(_0x3c731c){var _0x1ac0ea=this[_0xd7ad('0xd')][_0x3c731c];var _0x4c6fdd={'id':_0x1ac0ea['id'],'name':_0x1ac0ea[_0xd7ad('0x11')],'key':_0x1ac0ea['key'],'active':_0x1ac0ea[_0xd7ad('0x12')],'Imap':{'status':_0x1ac0ea[_0xd7ad('0x13')][_0xd7ad('0x14')],'messageStatus':_0x1ac0ea['Imap'][_0xd7ad('0x15')],'total':_0x1ac0ea['Imap']['total']}};if(_[_0xd7ad('0x16')](md5Accounts[_0x3c731c])){md5Accounts[_0x3c731c]={};}var _0x132636=md5(JSON['stringify'](_0x4c6fdd));if(md5Accounts[_0x3c731c][_0xd7ad('0x17')]!==_0x132636){md5Accounts[_0x3c731c][_0xd7ad('0x17')]=_0x132636;io[_0xd7ad('0x10')](_0xd7ad('0x18'),_0x4c6fdd);}};EmailChannel[_0xd7ad('0x19')][_0xd7ad('0x1a')]=function(_0xfa0dbe){for(var _0x1c2cf2 in _0xfa0dbe){if(_0xfa0dbe[_0xd7ad('0x1b')](_0x1c2cf2)){if(_0xfa0dbe[_0x1c2cf2][_0xd7ad('0x13')]&&_0xfa0dbe[_0x1c2cf2][_0xd7ad('0x12')]){var _0x3065f3=_0xfa0dbe[_0x1c2cf2][_0xd7ad('0x13')];if(!_0x3065f3[_0xd7ad('0x1c')]&&_0xfa0dbe[_0x1c2cf2][_0xd7ad('0x1d')]!=='custom')_0x3065f3[_0xd7ad('0x1c')]=_0xfa0dbe[_0x1c2cf2][_0xd7ad('0x1d')];if(!this['imapAccounts']['hasOwnProperty'](_0x3065f3['id'])){this[_0xd7ad('0xe')][_0x3065f3['id']]=new EmailImap(_0x3065f3,_0xfa0dbe[_0x1c2cf2][_0xd7ad('0x4')]);this[_0xd7ad('0xe')][_0x3065f3['id']]['on']('box',this[_0xd7ad('0x1e')][_0xd7ad('0x1f')](this,_0x1c2cf2));this[_0xd7ad('0xe')][_0x3065f3['id']]['on'](_0xd7ad('0x4'),this[_0xd7ad('0x20')]['bind'](this,_0x1c2cf2));this[_0xd7ad('0xe')][_0x3065f3['id']]['on'](_0xd7ad('0x21'),this[_0xd7ad('0x22')][_0xd7ad('0x1f')](this,_0x1c2cf2));this[_0xd7ad('0xe')][_0x3065f3['id']]['on']('error',this['handleImapError']['bind'](this,_0x1c2cf2));}}else{if(_[_0xd7ad('0x16')](this[_0xd7ad('0xd')][_0x1c2cf2][_0xd7ad('0x13')])){this[_0xd7ad('0xd')][_0x1c2cf2][_0xd7ad('0x13')]={};}this[_0xd7ad('0xd')][_0x1c2cf2][_0xd7ad('0x13')][_0xd7ad('0x14')]='disabled';this['mailAccounts'][_0x1c2cf2][_0xd7ad('0x13')][_0xd7ad('0x15')]='';this[_0xd7ad('0x10')](_0x1c2cf2);}}}};EmailChannel[_0xd7ad('0x19')][_0xd7ad('0x1e')]=function(_0x32b3a8,_0x1e7b10){if(this[_0xd7ad('0xd')][_0x32b3a8]){this[_0xd7ad('0xd')][_0x32b3a8][_0xd7ad('0x13')]['status']=_0xd7ad('0x23');this[_0xd7ad('0xd')][_0x32b3a8][_0xd7ad('0x13')][_0xd7ad('0x15')]=_0x1e7b10['name'];if(_0x1e7b10['messages']){this[_0xd7ad('0xd')][_0x32b3a8][_0xd7ad('0x13')][_0xd7ad('0x24')]=_0x1e7b10[_0xd7ad('0x25')][_0xd7ad('0x24')];}return this[_0xd7ad('0x10')](_0x32b3a8);}};EmailChannel[_0xd7ad('0x19')][_0xd7ad('0x20')]=function(_0xb6170,_0x2d7267){logger['info'](_0xd7ad('0x26'),_0x2d7267[_0xd7ad('0x27')],_0x2d7267['lastName'],_0x2d7267[_0xd7ad('0x28')],_0xb6170);if(this[_0xd7ad('0xd')][_0xb6170]){return mailAccount[_0xd7ad('0x29')](_0xb6170,_0x2d7267)['then'](function(_0x1d060d){if(_0x1d060d){logger['info'](_0xd7ad('0x2a'));}})[_0xd7ad('0x2b')](function(_0x399765){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xd7ad('0x2c')](_0x399765));});}};EmailChannel['prototype']['handleImapEnd']=function(_0xd5cba5){if(this[_0xd7ad('0xd')][_0xd5cba5]&&this[_0xd7ad('0xd')][_0xd5cba5][_0xd7ad('0x13')]){if(this[_0xd7ad('0xe')][this[_0xd7ad('0xd')][_0xd5cba5]['Imap']['id']]){delete this['imapAccounts'][this[_0xd7ad('0xd')][_0xd5cba5][_0xd7ad('0x13')]['id']];}this[_0xd7ad('0xd')][_0xd5cba5]['Imap'][_0xd7ad('0x2d')]=moment();this['emit'](_0xd5cba5);}};EmailChannel[_0xd7ad('0x19')][_0xd7ad('0x2e')]=function(_0x1e484b,_0x1c3dfc){if(this['mailAccounts'][_0x1e484b]){this[_0xd7ad('0xd')][_0x1e484b]['Imap'][_0xd7ad('0x14')]=_0xd7ad('0x2f');this[_0xd7ad('0xd')][_0x1e484b][_0xd7ad('0x13')][_0xd7ad('0x15')]=_0x1c3dfc;return this[_0xd7ad('0x10')](_0x1e484b);}};EmailChannel[_0xd7ad('0x19')][_0xd7ad('0x30')]=function(_0x327480,_0x4fab7e){return this[_0xd7ad('0xf')]['send'](_0x327480,_0x4fab7e);};EmailChannel[_0xd7ad('0x19')]['verifySmtp']=function(_0x36ea25){var _0x3ef305=this;if(this[_0xd7ad('0xd')][_0x36ea25['id']]){if(_[_0xd7ad('0x16')](this['mailAccounts'][_0x36ea25['id']][_0xd7ad('0x31')])){this[_0xd7ad('0xd')][_0x36ea25['id']][_0xd7ad('0x31')]={};}this[_0xd7ad('0xd')][_0x36ea25['id']][_0xd7ad('0x31')][_0xd7ad('0x2d')]=moment();return new BPromise(function(_0x596b41,_0x19b1a8){return _0x3ef305[_0xd7ad('0xf')][_0xd7ad('0x32')](_0x36ea25)[_0xd7ad('0x33')](function(_0x1c2954){_0x3ef305[_0xd7ad('0xd')][_0x36ea25['id']][_0xd7ad('0x31')][_0xd7ad('0x14')]=_0xd7ad('0x34');_0x3ef305[_0xd7ad('0xd')][_0x36ea25['id']][_0xd7ad('0x31')][_0xd7ad('0x15')]='';_0x3ef305['emit'](_0x36ea25['id']);_0x596b41(_0x1c2954);})[_0xd7ad('0x2b')](function(_0x1c22f9){_0x3ef305[_0xd7ad('0xd')][_0x36ea25['id']][_0xd7ad('0x31')][_0xd7ad('0x14')]=_0xd7ad('0x2f');_0x3ef305[_0xd7ad('0xd')][_0x36ea25['id']]['Smtp'][_0xd7ad('0x15')]=_0x1c22f9;_0x3ef305[_0xd7ad('0x10')](_0x36ea25['id']);_0x19b1a8(_0x1c22f9);});});}return this[_0xd7ad('0xf')][_0xd7ad('0x32')](_0x36ea25);};module[_0xd7ad('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 6660f2a..15a228d 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 _0xc84f=['anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleFetchError','handleEnd','textCode','hasOwnProperty','exports','util','mailparser','simpleParser','iconv','Iconv','./utils','../../../config/logger','email','account','getAccount','once','ready','handleReady','imap','bind','error','connect','inherits','prototype','connTimeout','service','user','generateXOAuth2Token','CloudProvider','data5','password','authentication'];(function(_0x1edb23,_0x537a2e){var _0x1df779=function(_0x400ae5){while(--_0x400ae5){_0x1edb23['push'](_0x1edb23['shift']());}};_0x1df779(++_0x537a2e);}(_0xc84f,0x197));var _0xfc84=function(_0xe34cb7,_0x1433d5){_0xe34cb7=_0xe34cb7-0x0;var _0x4acd3b=_0xc84f[_0xe34cb7];return _0x4acd3b;};'use strict';var _=require('lodash');var util=require(_0xfc84('0x0'));var Imap=require('imap');var simpleParser=require(_0xfc84('0x1'))[_0xfc84('0x2')];var Iconv=require(_0xfc84('0x3'))[_0xfc84('0x4')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xfc84('0x5'));var logger=require(_0xfc84('0x6'))(_0xfc84('0x7'));function EmailImap(_0x35b16a,_0x5d2ae7){this['mailbox']=_0x35b16a['mailbox'];this[_0xfc84('0x8')]=this[_0xfc84('0x9')](_0x35b16a,_0x5d2ae7);this['imap']=new Imap(this[_0xfc84('0x8')]);this['imap'][_0xfc84('0xa')](_0xfc84('0xb'),this[_0xfc84('0xc')]['bind'](this));this[_0xfc84('0xd')][_0xfc84('0xa')]('end',this['handleEnd'][_0xfc84('0xe')](this));this[_0xfc84('0xd')]['on'](_0xfc84('0xf'),this['handleError'][_0xfc84('0xe')](this));this[_0xfc84('0xd')][_0xfc84('0x10')]();}util[_0xfc84('0x11')](EmailImap,EventEmitter);EmailImap[_0xfc84('0x12')][_0xfc84('0x9')]=function(_0x3b56e7,_0x4918ee){var _0x2eaf16={'connTimeout':_0x3b56e7[_0xfc84('0x13')]?_0x3b56e7['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3b56e7['authTimeout']?_0x3b56e7['authTimeout']*0x3e8:0x1388};if(_0x3b56e7[_0xfc84('0x14')]){_0x2eaf16[_0xfc84('0x15')]=_0x3b56e7[_0xfc84('0x15')];if(_0x3b56e7['modernAuthentication']){_0x2eaf16['xoauth2']=utils[_0xfc84('0x16')](_0x3b56e7[_0xfc84('0x17')][_0xfc84('0x18')],_0x3b56e7[_0xfc84('0x15')]);}else{_0x2eaf16[_0xfc84('0x19')]=_0x3b56e7['password'];}}else{if(_0x3b56e7[_0xfc84('0x1a')]){_0x2eaf16[_0xfc84('0x15')]=_0x3b56e7[_0xfc84('0x15')];_0x2eaf16[_0xfc84('0x19')]=_0x3b56e7[_0xfc84('0x19')];}}_0x2eaf16['email']=_0x4918ee||_0x3b56e7[_0xfc84('0x15')]||_0xfc84('0x1b');_0x2eaf16[_0xfc84('0x1c')]=_0x3b56e7['host'];_0x2eaf16['port']=_0x3b56e7[_0xfc84('0x1d')]||0x3e1;if(_0x3b56e7['tls']){_0x2eaf16[_0xfc84('0x1e')]=!![];}else{_0x2eaf16[_0xfc84('0x1e')]=![];_0x2eaf16[_0xfc84('0x1f')]=_0xfc84('0x20');}return _0x2eaf16;};EmailImap['prototype'][_0xfc84('0xc')]=function(){this[_0xfc84('0xd')][_0xfc84('0x21')](this['mailbox'],![],this[_0xfc84('0x22')]['bind'](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x22')]=function(_0x5f3251,_0x5393e9){if(_0x5f3251){this[_0xfc84('0x23')](_0x5f3251,!![]);}else{this[_0xfc84('0x24')](_0xfc84('0x25'),_0x5393e9);this[_0xfc84('0x26')]();}};EmailImap[_0xfc84('0x12')][_0xfc84('0x27')]=function(_0x32b3dd){if(_0x32b3dd){this['handleError'](_0x32b3dd,!![]);}else{this['imap'][_0xfc84('0x28')]();}};EmailImap[_0xfc84('0x12')]['readUnseen']=function(){this[_0xfc84('0xd')][_0xfc84('0x29')]([_0xfc84('0x2a')],this[_0xfc84('0x2b')][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x2b')]=function(_0x203de5,_0x4e56ba){if(_0x203de5){this['handleError'](_0x203de5,!![]);}else{if(_0x4e56ba[_0xfc84('0x2c')]){try{var _0xce185a=this[_0xfc84('0xd')][_0xfc84('0x2d')](_0x4e56ba,{'bodies':'','markSeen':!![]});_0xce185a['on'](_0xfc84('0x2e'),this[_0xfc84('0x2f')][_0xfc84('0xe')](this));_0xce185a[_0xfc84('0xa')](_0xfc84('0xf'),this['handleFetchError'][_0xfc84('0xe')](this));_0xce185a[_0xfc84('0xa')](_0xfc84('0x28'),this[_0xfc84('0x30')][_0xfc84('0xe')](this));}catch(_0x2da0da){logger[_0xfc84('0xf')](_0x2da0da);}}else{this[_0xfc84('0xd')][_0xfc84('0x31')](!![],this[_0xfc84('0x27')]['bind'](this));}}};EmailImap[_0xfc84('0x12')][_0xfc84('0x2f')]=function(_0x277464){_0x277464['on'](_0xfc84('0x32'),this[_0xfc84('0x33')][_0xfc84('0xe')](this));_0x277464['once'](_0xfc84('0x34'),this['handleMessageAttributes'][_0xfc84('0xe')](this));_0x277464['once'](_0xfc84('0x28'),this[_0xfc84('0x35')][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')]['handleMessageBody']=function(_0x137ccd){simpleParser(_0x137ccd,{'Iconv':Iconv},this[_0xfc84('0x36')]['bind'](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x37')]=function(){};EmailImap[_0xfc84('0x12')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0xfc84('0x36')]=function(_0x2caf0d,_0xfe0a64){if(_0x2caf0d){logger[_0xfc84('0xf')](_0x2caf0d);}else{var _0x5636be=this;utils[_0xfc84('0x38')](this[_0xfc84('0x8')],_0xfe0a64,function(_0x2af70f){_0x5636be[_0xfc84('0x24')]('email',_0x2af70f);});}};EmailImap[_0xfc84('0x12')][_0xfc84('0x30')]=function(){this[_0xfc84('0xd')][_0xfc84('0x31')](!![],this['handleCloseBox'][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x39')]=function(_0x3d0996){this['handleError'](_0x3d0996);this[_0xfc84('0xd')][_0xfc84('0x31')](!![],this[_0xfc84('0x27')][_0xfc84('0xe')](this));};EmailImap[_0xfc84('0x12')][_0xfc84('0x3a')]=function(){this[_0xfc84('0x24')](_0xfc84('0x28'));};EmailImap[_0xfc84('0x12')][_0xfc84('0x23')]=function(_0x3b7fe3,_0x4e415e){logger[_0xfc84('0xf')](_0xfc84('0x23'),this[_0xfc84('0x8')][_0xfc84('0x7')],JSON['stringify'](_0x3b7fe3));var _0x3d345e='';if(_0x3b7fe3){if(_0x3b7fe3[_0xfc84('0x3b')]){_0x3d345e=_0x3b7fe3[_0xfc84('0x3b')];}else{for(var _0x4cbc16 in _0x3b7fe3){if(_0x3b7fe3[_0xfc84('0x3c')](_0x4cbc16)){_0x3d345e+=_['upperFirst'](_0x4cbc16)+':\x20'+_0x3b7fe3[_0x4cbc16]+'\x0a';}}}}if(_0x4e415e){this['imap']['end']();}else{this['emit'](_0xfc84('0xf'),_0x3d345e);this[_0xfc84('0x24')](_0xfc84('0x28'));}};module[_0xfc84('0x3d')]=EmailImap; \ No newline at end of file +var _0x44c4=['xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','required','openBox','handleOpenBox','box','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','getAccount','account','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication'];(function(_0x311b1d,_0x578ddd){var _0x5acb8b=function(_0x186ae1){while(--_0x186ae1){_0x311b1d['push'](_0x311b1d['shift']());}};_0x5acb8b(++_0x578ddd);}(_0x44c4,0xe3));var _0x444c=function(_0x49caf4,_0xbe95a6){_0x49caf4=_0x49caf4-0x0;var _0x3162e7=_0x44c4[_0x49caf4];return _0x3162e7;};'use strict';var _=require('lodash');var util=require(_0x444c('0x0'));var Imap=require(_0x444c('0x1'));var simpleParser=require('mailparser')[_0x444c('0x2')];var Iconv=require(_0x444c('0x3'))[_0x444c('0x4')];var EventEmitter=require('events')[_0x444c('0x5')];var utils=require('./utils');var logger=require(_0x444c('0x6'))(_0x444c('0x7'));function EmailImap(_0x281961,_0x372c26){this[_0x444c('0x8')]=_0x281961[_0x444c('0x8')];this['account']=this[_0x444c('0x9')](_0x281961,_0x372c26);this[_0x444c('0x1')]=new Imap(this[_0x444c('0xa')]);this[_0x444c('0x1')]['once']('ready',this[_0x444c('0xb')]['bind'](this));this[_0x444c('0x1')]['once'](_0x444c('0xc'),this[_0x444c('0xd')][_0x444c('0xe')](this));this['imap']['on'](_0x444c('0xf'),this[_0x444c('0x10')][_0x444c('0xe')](this));this[_0x444c('0x1')][_0x444c('0x11')]();}util[_0x444c('0x12')](EmailImap,EventEmitter);EmailImap[_0x444c('0x13')][_0x444c('0x9')]=function(_0x52c491,_0x4fc792){var _0x3a24eb={'connTimeout':_0x52c491['connTimeout']?_0x52c491[_0x444c('0x14')]*0x3e8:0x2710,'authTimeout':_0x52c491[_0x444c('0x15')]?_0x52c491[_0x444c('0x15')]*0x3e8:0x1388};if(_0x52c491[_0x444c('0x16')]){_0x3a24eb[_0x444c('0x17')]=_0x52c491['user'];if(_0x52c491[_0x444c('0x18')]){_0x3a24eb[_0x444c('0x19')]=utils[_0x444c('0x1a')](_0x52c491[_0x444c('0x1b')][_0x444c('0x1c')],_0x52c491['user']);}else{_0x3a24eb['password']=_0x52c491[_0x444c('0x1d')];}}else{if(_0x52c491[_0x444c('0x1e')]){_0x3a24eb[_0x444c('0x17')]=_0x52c491['user'];_0x3a24eb['password']=_0x52c491[_0x444c('0x1d')];}}_0x3a24eb[_0x444c('0x7')]=_0x4fc792||_0x52c491['user']||_0x444c('0x1f');_0x3a24eb[_0x444c('0x20')]=_0x52c491[_0x444c('0x20')];_0x3a24eb[_0x444c('0x21')]=_0x52c491[_0x444c('0x21')]||0x3e1;if(_0x52c491['tls']){_0x3a24eb[_0x444c('0x22')]=!![];}else{_0x3a24eb[_0x444c('0x22')]=![];_0x3a24eb['autotls']=_0x444c('0x23');}return _0x3a24eb;};EmailImap[_0x444c('0x13')][_0x444c('0xb')]=function(){this[_0x444c('0x1')][_0x444c('0x24')](this[_0x444c('0x8')],![],this[_0x444c('0x25')][_0x444c('0xe')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x1e1b19,_0x1f6c8d){if(_0x1e1b19){this[_0x444c('0x10')](_0x1e1b19,!![]);}else{this['emit'](_0x444c('0x26'),_0x1f6c8d);this['readUnseen']();}};EmailImap['prototype'][_0x444c('0x27')]=function(_0x4d18fc){if(_0x4d18fc){this[_0x444c('0x10')](_0x4d18fc,!![]);}else{this['imap'][_0x444c('0xc')]();}};EmailImap[_0x444c('0x13')][_0x444c('0x28')]=function(){this[_0x444c('0x1')][_0x444c('0x29')](['UNSEEN'],this[_0x444c('0x2a')][_0x444c('0xe')](this));};EmailImap[_0x444c('0x13')]['handleReadUnseen']=function(_0x2752e2,_0x2fb1f8){if(_0x2752e2){this['handleError'](_0x2752e2,!![]);}else{if(_0x2fb1f8[_0x444c('0x2b')]){try{var _0x1f2cfd=this[_0x444c('0x1')][_0x444c('0x2c')](_0x2fb1f8,{'bodies':'','markSeen':!![]});_0x1f2cfd['on'](_0x444c('0x2d'),this[_0x444c('0x2e')][_0x444c('0xe')](this));_0x1f2cfd[_0x444c('0x2f')]('error',this[_0x444c('0x30')][_0x444c('0xe')](this));_0x1f2cfd[_0x444c('0x2f')](_0x444c('0xc'),this[_0x444c('0x31')]['bind'](this));}catch(_0x1b9942){logger[_0x444c('0xf')](_0x1b9942);}}else{this[_0x444c('0x1')][_0x444c('0x32')](!![],this[_0x444c('0x27')][_0x444c('0xe')](this));}}};EmailImap[_0x444c('0x13')][_0x444c('0x2e')]=function(_0x43208c){_0x43208c['on'](_0x444c('0x33'),this[_0x444c('0x34')][_0x444c('0xe')](this));_0x43208c[_0x444c('0x2f')]('attributes',this[_0x444c('0x35')][_0x444c('0xe')](this));_0x43208c['once'](_0x444c('0xc'),this['handleMessageEnd'][_0x444c('0xe')](this));};EmailImap[_0x444c('0x13')][_0x444c('0x34')]=function(_0x4cebb6){simpleParser(_0x4cebb6,{'Iconv':Iconv},this[_0x444c('0x36')]['bind'](this));};EmailImap[_0x444c('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x444c('0x13')][_0x444c('0x37')]=function(){};EmailImap[_0x444c('0x13')][_0x444c('0x36')]=function(_0x345ebb,_0x52f68f){if(_0x345ebb){logger[_0x444c('0xf')](_0x345ebb);}else{var _0x29d354=this;utils[_0x444c('0x38')](this[_0x444c('0xa')],_0x52f68f,function(_0x4658d0){_0x29d354[_0x444c('0x39')](_0x444c('0x7'),_0x4658d0);});}};EmailImap[_0x444c('0x13')][_0x444c('0x31')]=function(){this['imap'][_0x444c('0x32')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x444c('0x13')]['handleFetchError']=function(_0x504a16){this[_0x444c('0x10')](_0x504a16);this[_0x444c('0x1')][_0x444c('0x32')](!![],this[_0x444c('0x27')][_0x444c('0xe')](this));};EmailImap[_0x444c('0x13')]['handleEnd']=function(){this[_0x444c('0x39')]('end');};EmailImap[_0x444c('0x13')][_0x444c('0x10')]=function(_0x13248c,_0x4a674d){logger[_0x444c('0xf')]('handleError',this['account'][_0x444c('0x7')],JSON[_0x444c('0x3a')](_0x13248c));var _0xdfaff2='';if(_0x13248c){if(_0x13248c['textCode']){_0xdfaff2=_0x13248c[_0x444c('0x3b')];}else{for(var _0x3342ea in _0x13248c){if(_0x13248c[_0x444c('0x3c')](_0x3342ea)){_0xdfaff2+=_[_0x444c('0x3d')](_0x3342ea)+':\x20'+_0x13248c[_0x3342ea]+'\x0a';}}}}if(_0x4a674d){this['imap'][_0x444c('0xc')]();}else{this[_0x444c('0x39')]('error',_0xdfaff2);this['emit'](_0x444c('0xc'));}};module[_0x444c('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b4c4ef4..d6bcbef 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 _0xb311=['use','compile','prototype','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x1864bb,_0x2575d4){var _0x3aacad=function(_0x4f9379){while(--_0x4f9379){_0x1864bb['push'](_0x1864bb['shift']());}};_0x3aacad(++_0x2575d4);}(_0xb311,0x1a0));var _0x1b31=function(_0x4f65f6,_0x431083){_0x4f65f6=_0x4f65f6-0x0;var _0x542202=_0xb311[_0x4f65f6];return _0x542202;};'use strict';var nodemailer=require(_0x1b31('0x0'));var inlineBase64=require(_0x1b31('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x1b31('0x2')]=function(_0x11ce15,_0x42653d){return new Promise(function(_0xfec26c,_0x1a6423){var _0x1d39d7=nodemailer[_0x1b31('0x3')](_0x11ce15);_0x1d39d7[_0x1b31('0x4')](_0x1b31('0x5'),inlineBase64());_0x1d39d7['sendMail'](_0x42653d,function(_0x411f42,_0xeef1ca){if(_0x411f42){_0x1a6423(_0x411f42['toString']());}else{_0xfec26c(_0xeef1ca);}});});};EmailSmtp[_0x1b31('0x6')]['verify']=function(_0x35c5c9){return new Promise(function(_0x1c771e,_0x5d0b6d){var _0x4302de=nodemailer[_0x1b31('0x3')](_0x35c5c9);_0x4302de['verify'](function(_0x8e2e7b,_0x3580ed){if(_0x8e2e7b){_0x5d0b6d(_0x8e2e7b[_0x1b31('0x7')]());}else{if(_0x3580ed){_0x1c771e(_0x3580ed);}else{_0x5d0b6d(_0x1b31('0x8'));}}});});};module[_0x1b31('0x9')]=EmailSmtp; \ No newline at end of file +var _0xe430=['toString','verify','createTransport','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0xe430,0x13f));var _0x0e43=function(_0x5e3bf5,_0x431b08){_0x5e3bf5=_0x5e3bf5-0x0;var _0x29f180=_0xe430[_0x5e3bf5];return _0x29f180;};'use strict';var nodemailer=require(_0x0e43('0x0'));var inlineBase64=require(_0x0e43('0x1'));function EmailSmtp(){}EmailSmtp[_0x0e43('0x2')][_0x0e43('0x3')]=function(_0x22c03f,_0x2751bf){return new Promise(function(_0x13f3ed,_0x478e35){var _0x490762=nodemailer['createTransport'](_0x22c03f);_0x490762[_0x0e43('0x4')]('compile',inlineBase64());_0x490762['sendMail'](_0x2751bf,function(_0x1796d0,_0x173021){if(_0x1796d0){_0x478e35(_0x1796d0[_0x0e43('0x5')]());}else{_0x13f3ed(_0x173021);}});});};EmailSmtp['prototype'][_0x0e43('0x6')]=function(_0x370140){return new Promise(function(_0x144280,_0xcd265){var _0x57ee41=nodemailer[_0x0e43('0x7')](_0x370140);_0x57ee41[_0x0e43('0x6')](function(_0x3ec901,_0x6e0ae1){if(_0x3ec901){_0xcd265(_0x3ec901['toString']());}else{if(_0x6e0ae1){_0x144280(_0x6e0ae1);}else{_0xcd265(_0x0e43('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 dda5879..d1c1e0c 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 _0x3a07=['YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','auth=Bearer\x20','utf-8','toString','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','@xcally.com','name','substring','length','slice','join','Anonymous','head','split','isEmpty','generate','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','\x20]','body','textAsHtml','0x1?_0x962ae4[_0x73a0('0xf')](0x0,-0x1)[_0x73a0('0x10')]('\x20'):_0x31119d['name'];}return _0x73a0('0x11');}function getLastName(_0x259294){var _0x4617ec=_[_0x73a0('0x12')](_0x259294[_0x73a0('0x8')]);if(_0x4617ec&&_0x4617ec[_0x73a0('0xc')]){var _0x3b8a9a=_0x4617ec[_0x73a0('0xc')][_0x73a0('0x13')](/\s+/);return _0x3b8a9a[_0x73a0('0xe')]>0x1?_0x3b8a9a['pop']():'';}return'';}function getMails(_0x1a0796,_0x2483be){var _0x4ff62f='';for(var _0x52f775=0x0;_0x52f775<_0x2483be[_0x73a0('0x8')][_0x73a0('0xe')];_0x52f775+=0x1){if(_0x2483be['value'][_0x52f775][_0x73a0('0x9')]!==_0x1a0796){if(!_[_0x73a0('0x14')](_0x4ff62f)){_0x4ff62f+=',';}_0x4ff62f+=_0x2483be[_0x73a0('0x8')][_0x52f775][_0x73a0('0xc')]||_0x2483be['value'][_0x52f775][_0x73a0('0x9')]||'';_0x4ff62f+='\x20<';_0x4ff62f+=_0x2483be[_0x73a0('0x8')][_0x52f775][_0x73a0('0x9')]?_0x2483be['value'][_0x52f775][_0x73a0('0x9')]:_0x73a0('0xa')+random[_0x73a0('0x15')](0x6)+_0x73a0('0xb');_0x4ff62f+='>';}}return _0x4ff62f;}function parseEmail(_0x36ee72,_0x1f5f6d,_0x40e86e){if(_0x1f5f6d[_0x73a0('0x16')]){var _0x83c8ee=/)<[^<]*)*<\/script>/gi;while(_0x83c8ee[_0x73a0('0x17')](_0x1f5f6d[_0x73a0('0x16')])){_0x1f5f6d['html']=_0x1f5f6d[_0x73a0('0x16')][_0x73a0('0x18')](_0x83c8ee,'');}if(_0x1f5f6d[_0x73a0('0x16')][_0x73a0('0x19')]('{_0x411171['push'](_0x10798c[_0x73a0('0x1c')]);});var _0x3dd23d=/]+>/g;var _0x3f8f8b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a0a3f=_0x1f5f6d[_0x73a0('0x16')][_0x73a0('0x18')](_0x3f8f8b,_0x73a0('0x1d'));var _0x385ca9=_0x5a0a3f[_0x73a0('0x18')](_0x3dd23d,_0x73a0('0x1e'));for(let _0x1b12cf=0x0;_0x1b12cf<_0x411171[_0x73a0('0xe')];_0x1b12cf++){var _0xe5fbdd=_0x385ca9[_0x73a0('0x18')](_0x73a0('0x1e'),'\x20[Attachment:\x20'+_0x411171[_0x1b12cf]+_0x73a0('0x1f'));_0x385ca9=_0xe5fbdd;}_0x1f5f6d[_0x73a0('0x16')]=_0x385ca9;}_0x40e86e[_0x73a0('0x20')]=_0x1f5f6d['html'];}else{_0x40e86e[_0x73a0('0x20')]=_0x1f5f6d[_0x73a0('0x21')];}if(_0x40e86e[_0x73a0('0x20')]){_0x40e86e['body']=_0x40e86e[_0x73a0('0x20')][_0x73a0('0x18')](/0x0){var _0x3f4ebe=[_0x73a0('0x32'),_0x73a0('0x33'),'Precedence:\x20auto_reply'];for(var _0x164bc4=0x0;_0x164bc4<_0x1f5f6d[_0x73a0('0x31')][_0x73a0('0xe')];_0x164bc4++){var _0x2864a2=_[_0x73a0('0x34')](_0x3f4ebe,_0x1f5f6d[_0x73a0('0x31')][_0x164bc4][_0x73a0('0x35')]);if(_0x2864a2>=0x0){_0x40e86e[_0x73a0('0x36')]=!![];}}}return _0x40e86e;}exports[_0x73a0('0x37')]=function(_0x483e96,_0x456197,_0x196c66){var _0x5ccd71={'from':getAddress(_0x456197['from']),'firstName':getFirstName(_0x456197[_0x73a0('0x38')]),'lastName':getLastName(_0x456197[_0x73a0('0x38')]),'mapKey':_0x73a0('0x6'),'message':{'from':getMails(_0x483e96[_0x73a0('0x6')],_0x456197[_0x73a0('0x38')]),'to':_0x483e96[_0x73a0('0x6')],'cc':'','subject':_0x456197[_0x73a0('0x39')]||'','messageId':_0x456197[_0x73a0('0x3a')],'inReplyTo':_0x456197[_0x73a0('0x3b')],'sentAt':moment(_0x456197['date'])['format'](_0x73a0('0x3c')),'attach':![],'attachments':[]}};if(!_0x456197[_0x73a0('0x16')]&&!_0x456197[_0x73a0('0x21')]){var _0x2900b7=_['filter'](_0x456197[_0x73a0('0x1a')],{'contentType':_0x73a0('0x3d')});if(_0x2900b7[_0x73a0('0xe')]){logger[_0x73a0('0x3e')](util[_0x73a0('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x456197[_0x73a0('0x3a')]));tnef[_0x73a0('0x3f')](_[_0x73a0('0x40')](_0x2900b7)[_0x73a0('0x2f')],function(_0xdadd88,_0x24743c){if(_0x24743c){_0x456197[_0x73a0('0x16')]=_0x24743c[_0x73a0('0x41')]||_0x73a0('0x42');if(_0x24743c[_0x73a0('0x43')]){for(var _0x2b7a53=0x0;_0x2b7a53<_0x24743c[_0x73a0('0x43')]['length'];_0x2b7a53++){var _0x485076=_0x24743c[_0x73a0('0x43')][_0x2b7a53];_0x5ccd71[_0x73a0('0x23')][_0x73a0('0x1a')][_0x73a0('0x30')]({'filename':_0x485076[_0x73a0('0x44')],'content':Buffer['from'](_0x485076[_0x73a0('0x45')])});}}}_0x196c66(parseEmail(_0x483e96,_0x456197,_0x5ccd71));});}else{_0x456197[_0x73a0('0x16')]=_0x73a0('0x42');_0x196c66(parseEmail(_0x483e96,_0x456197,_0x5ccd71));}}else{_0x196c66(parseEmail(_0x483e96,_0x456197,_0x5ccd71));}};exports['generateXOAuth2Token']=function(_0x284df3,_0x371f52){var _0x28e372=['user='+(_0x371f52||''),_0x73a0('0x46')+_0x284df3,'',''];return Buffer[_0x73a0('0x38')](_0x28e372[_0x73a0('0x10')](''),_0x73a0('0x47'))[_0x73a0('0x48')]('base64');}; \ No newline at end of file +var _0x320e=['originTo','includes','originCc','bcc','type','attachment','attachment-','format','%s-%s','now','root','writeFileSync','push','headerLines','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','name','substring','indexOf','length','slice','join','Anonymous','split','isEmpty','html','','body','message'];(function(_0x4b571e,_0x378e2c){var _0x6f204f=function(_0x3c223a){while(--_0x3c223a){_0x4b571e['push'](_0x4b571e['shift']());}};_0x6f204f(++_0x378e2c);}(_0x320e,0x67));var _0xe320=function(_0x4566db,_0x5da9a1){_0x4566db=_0x4566db-0x0;var _0x3167e6=_0x320e[_0x4566db];return _0x3167e6;};'use strict';var _=require(_0xe320('0x0'));var moment=require(_0xe320('0x1'));var random=require(_0xe320('0x2'));var fs=require('fs');var path=require(_0xe320('0x3'));var util=require(_0xe320('0x4'));var tnef=require(_0xe320('0x5'));var logger=require(_0xe320('0x6'))(_0xe320('0x7'));var config=require('../../../config/environment');function getAddress(_0x38ab58){var _0x1f7dcc=_[_0xe320('0x8')](_0x38ab58[_0xe320('0x9')]);return _0x1f7dcc&&_0x1f7dcc[_0xe320('0xa')]?_0x1f7dcc[_0xe320('0xa')]:_0xe320('0xb')+random[_0xe320('0xc')](0x6)+'@xcally.com';}function getFirstName(_0x2f23f2){var _0x9d7908=_[_0xe320('0x8')](_0x2f23f2[_0xe320('0x9')]);if(_0x9d7908&&_0x9d7908[_0xe320('0xd')]){if(_0x9d7908[_0xe320('0xd')]==_0x9d7908['address']){return _0x9d7908[_0xe320('0xd')][_0xe320('0xe')](0x0,_0x9d7908[_0xe320('0xd')][_0xe320('0xf')]('@'));}var _0x22b901=_0x9d7908[_0xe320('0xd')]['split'](/\s+/);return _0x22b901[_0xe320('0x10')]>0x1?_0x22b901[_0xe320('0x11')](0x0,-0x1)[_0xe320('0x12')]('\x20'):_0x9d7908[_0xe320('0xd')];}return _0xe320('0x13');}function getLastName(_0xf901ea){var _0x670bc2=_[_0xe320('0x8')](_0xf901ea[_0xe320('0x9')]);if(_0x670bc2&&_0x670bc2[_0xe320('0xd')]){var _0x366c91=_0x670bc2[_0xe320('0xd')][_0xe320('0x14')](/\s+/);return _0x366c91[_0xe320('0x10')]>0x1?_0x366c91['pop']():'';}return'';}function getMails(_0x36da15,_0xf999d8){var _0x27124a='';for(var _0x238239=0x0;_0x238239<_0xf999d8[_0xe320('0x9')][_0xe320('0x10')];_0x238239+=0x1){if(_0xf999d8[_0xe320('0x9')][_0x238239]['address']!==_0x36da15){if(!_[_0xe320('0x15')](_0x27124a)){_0x27124a+=',';}_0x27124a+=_0xf999d8[_0xe320('0x9')][_0x238239]['name']||_0xf999d8[_0xe320('0x9')][_0x238239][_0xe320('0xa')]||'';_0x27124a+='\x20<';_0x27124a+=_0xf999d8[_0xe320('0x9')][_0x238239]['address']?_0xf999d8[_0xe320('0x9')][_0x238239][_0xe320('0xa')]:_0xe320('0xb')+random[_0xe320('0xc')](0x6)+'@xcally.com';_0x27124a+='>';}}return _0x27124a;}function parseEmail(_0x246396,_0x3ccbbf,_0x35a3b0){if(_0x3ccbbf[_0xe320('0x16')]){var _0x51498e=/)<[^<]*)*<\/script>/gi;while(_0x51498e['test'](_0x3ccbbf[_0xe320('0x16')])){_0x3ccbbf[_0xe320('0x16')]=_0x3ccbbf['html']['replace'](_0x51498e,'');}if(_0x3ccbbf[_0xe320('0x16')]['includes'](_0xe320('0x17'))){var _0x5b1ef3=[];_0x3ccbbf[_0xe320('0x18')][_0xe320('0x19')](_0x558756=>{_0x5b1ef3['push'](_0x558756[_0xe320('0x1a')]);});var _0x2e769f=/]+>/g;var _0x489e65=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5734c5=_0x3ccbbf[_0xe320('0x16')]['replace'](_0x489e65,_0xe320('0x1b'));var _0x41300d=_0x5734c5[_0xe320('0x1c')](_0x2e769f,_0xe320('0x1d'));for(let _0x1746e7=0x0;_0x1746e7<_0x5b1ef3[_0xe320('0x10')];_0x1746e7++){var _0xae665b=_0x41300d[_0xe320('0x1c')](_0xe320('0x1d'),'\x20[Attachment:\x20'+_0x5b1ef3[_0x1746e7]+_0xe320('0x1e'));_0x41300d=_0xae665b;}_0x3ccbbf[_0xe320('0x16')]=_0x41300d;}_0x35a3b0[_0xe320('0x1f')]=_0x3ccbbf[_0xe320('0x16')];}else{_0x35a3b0['body']=_0x3ccbbf['textAsHtml'];}if(_0x35a3b0[_0xe320('0x1f')]){_0x35a3b0['body']=_0x35a3b0[_0xe320('0x1f')][_0xe320('0x1c')](/0x0){var _0x83a32d=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x237066=0x0;_0x237066<_0x3ccbbf[_0xe320('0x2e')][_0xe320('0x10')];_0x237066++){var _0x586124=_[_0xe320('0xf')](_0x83a32d,_0x3ccbbf[_0xe320('0x2e')][_0x237066]['line']);if(_0x586124>=0x0){_0x35a3b0[_0xe320('0x2f')]=!![];}}}return _0x35a3b0;}exports[_0xe320('0x30')]=function(_0x44bcb3,_0x170deb,_0x1c8e12){var _0x1bca91={'from':getAddress(_0x170deb[_0xe320('0x31')]),'firstName':getFirstName(_0x170deb['from']),'lastName':getLastName(_0x170deb['from']),'mapKey':'email','message':{'from':getMails(_0x44bcb3[_0xe320('0x7')],_0x170deb[_0xe320('0x31')]),'to':_0x44bcb3['email'],'cc':'','subject':_0x170deb[_0xe320('0x32')]||'','messageId':_0x170deb[_0xe320('0x33')],'inReplyTo':_0x170deb[_0xe320('0x34')],'sentAt':moment(_0x170deb[_0xe320('0x35')])[_0xe320('0x28')](_0xe320('0x36')),'attach':![],'attachments':[]}};if(!_0x170deb[_0xe320('0x16')]&&!_0x170deb[_0xe320('0x37')]){var _0x570a46=_['filter'](_0x170deb[_0xe320('0x18')],{'contentType':_0xe320('0x38')});if(_0x570a46[_0xe320('0x10')]){logger['info'](util[_0xe320('0x28')](_0xe320('0x39'),_0x170deb[_0xe320('0x33')]));tnef[_0xe320('0x3a')](_[_0xe320('0x3b')](_0x570a46)[_0xe320('0x3c')],function(_0x285ae6,_0x43a2da){if(_0x43a2da){_0x170deb[_0xe320('0x16')]=_0x43a2da[_0xe320('0x3d')]||_0xe320('0x3e');if(_0x43a2da[_0xe320('0x3f')]){for(var _0xc58b82=0x0;_0xc58b82<_0x43a2da['Attachments'][_0xe320('0x10')];_0xc58b82++){var _0x5cd22e=_0x43a2da[_0xe320('0x3f')][_0xc58b82];_0x1bca91['message'][_0xe320('0x18')][_0xe320('0x2d')]({'filename':_0x5cd22e[_0xe320('0x40')],'content':Buffer[_0xe320('0x31')](_0x5cd22e[_0xe320('0x41')])});}}}_0x1c8e12(parseEmail(_0x44bcb3,_0x170deb,_0x1bca91));});}else{_0x170deb['html']=_0xe320('0x3e');_0x1c8e12(parseEmail(_0x44bcb3,_0x170deb,_0x1bca91));}}else{_0x1c8e12(parseEmail(_0x44bcb3,_0x170deb,_0x1bca91));}};exports['generateXOAuth2Token']=function(_0x2bec58,_0x533f29){var _0x3197a1=['user='+(_0x533f29||''),'auth=Bearer\x20'+_0x2bec58,'',''];return Buffer[_0xe320('0x31')](_0x3197a1[_0xe320('0x12')](''),_0xe320('0x42'))['toString'](_0xe320('0x43'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 4b11439..e333b62 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafa8=['exports','lodash','name','Service','key','SERV','active','Smtp'];(function(_0x187f4b,_0x1a4475){var _0x3d709a=function(_0x530a54){while(--_0x530a54){_0x187f4b['push'](_0x187f4b['shift']());}};_0x3d709a(++_0x1a4475);}(_0xafa8,0xc9));var _0x8afa=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0xafa8[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x8afa('0x0'));function MailAccount(_0x1c800a){this['id']=_0x1c800a['id']||0x0;this['name']=_0x1c800a[_0x8afa('0x1')]||_0x8afa('0x2');this[_0x8afa('0x3')]=_0x1c800a[_0x8afa('0x3')]||_0x8afa('0x4');this['active']=_0x1c800a[_0x8afa('0x5')]||![];this['Imap']=_0x1c800a['Imap']||[];this['Smtp']=_0x1c800a[_0x8afa('0x6')]||[];}module[_0x8afa('0x7')]=MailAccount; \ No newline at end of file +var _0x15c5=['name','Service','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x15c5,0x98));var _0x515c=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x15c5[_0x3ae2b2];return _0x1dbf00;};'use strict';var _=require(_0x515c('0x0'));function MailAccount(_0x526ae3){this['id']=_0x526ae3['id']||0x0;this[_0x515c('0x1')]=_0x526ae3[_0x515c('0x1')]||_0x515c('0x2');this[_0x515c('0x3')]=_0x526ae3[_0x515c('0x3')]||_0x515c('0x4');this['active']=_0x526ae3[_0x515c('0x5')]||![];this[_0x515c('0x6')]=_0x526ae3[_0x515c('0x6')]||[];this[_0x515c('0x7')]=_0x526ae3[_0x515c('0x7')]||[];}module[_0x515c('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index c065a18..015cfb7 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf0a=['exports','lodash','../model/mailAccount','mailAccounts','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','length','isUndefined'];(function(_0x13a20d,_0x413e40){var _0x3c58eb=function(_0x3bd1f1){while(--_0x3bd1f1){_0x13a20d['push'](_0x13a20d['shift']());}};_0x3c58eb(++_0x413e40);}(_0xbf0a,0x1e1));var _0xabf0=function(_0x297372,_0x5d3ed2){_0x297372=_0x297372-0x0;var _0x554392=_0xbf0a[_0x297372];return _0x554392;};'use strict';var _=require(_0xabf0('0x0'));var MailAccount=require(_0xabf0('0x1'));var Realtime=function(){this[_0xabf0('0x2')]={};};function freeIsNotKey(_0x94e5f2,_0x1c9138,_0xd9d32d){var _0x5ceb52=_['mapKeys'](_0x94e5f2,function(_0x19e309,_0x5e2fbf){return _0x19e309[_0xd9d32d];});for(var _0x2a8602 in _0x1c9138){if(_0x1c9138['hasOwnProperty'](_0x2a8602)){if(!_0x5ceb52[_0x2a8602]){delete _0x1c9138[_0x2a8602];}}}}Realtime['prototype'][_0xabf0('0x3')]=function(_0x310c6c,_0x351190){for(var _0x57cf43 in _0x351190){if(_0x310c6c[_0xabf0('0x4')](_0x57cf43)){_0x310c6c[_0x57cf43]=_0x351190[_0x57cf43];}}};Realtime[_0xabf0('0x5')][_0xabf0('0x6')]=function(){var _0x459994=this;return function(_0xe08518){if(_0xe08518){freeIsNotKey(_0xe08518,_0x459994[_0xabf0('0x2')],'id');for(var _0x5f2f92=0x0,_0x26f175={},_0x3d391b={};_0x5f2f92<_0xe08518[_0xabf0('0x7')];_0x5f2f92+=0x1){_0x26f175=_0xe08518[_0x5f2f92];if(_[_0xabf0('0x8')](_0x459994[_0xabf0('0x2')][_0x26f175['id']])){_0x459994[_0xabf0('0x2')][_0x26f175['id']]=new MailAccount(_0x26f175);}else{_['merge'](_0x459994[_0xabf0('0x2')][_0x26f175['id']],_0x26f175);}}}return _0x459994[_0xabf0('0x2')];};};module[_0xabf0('0x9')]=Realtime; \ No newline at end of file +var _0x6427=['mergeFromDatabase','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x2e3e15,_0x18da62){var _0x37d05e=function(_0x44985f){while(--_0x44985f){_0x2e3e15['push'](_0x2e3e15['shift']());}};_0x37d05e(++_0x18da62);}(_0x6427,0x1de));var _0x7642=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x6427[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x7642('0x0'));var MailAccount=require(_0x7642('0x1'));var Realtime=function(){this[_0x7642('0x2')]={};};function freeIsNotKey(_0x30bcda,_0xe2083e,_0x1f7989){var _0x256427=_[_0x7642('0x3')](_0x30bcda,function(_0x1926ea,_0x4232e7){return _0x1926ea[_0x1f7989];});for(var _0x58fe73 in _0xe2083e){if(_0xe2083e[_0x7642('0x4')](_0x58fe73)){if(!_0x256427[_0x58fe73]){delete _0xe2083e[_0x58fe73];}}}}Realtime[_0x7642('0x5')][_0x7642('0x6')]=function(_0xeb6a4e,_0x19eaf4){for(var _0x5703e0 in _0x19eaf4){if(_0xeb6a4e[_0x7642('0x4')](_0x5703e0)){_0xeb6a4e[_0x5703e0]=_0x19eaf4[_0x5703e0];}}};Realtime[_0x7642('0x5')]['initMailAccounts']=function(){var _0x24c2a5=this;return function(_0x487b96){if(_0x487b96){freeIsNotKey(_0x487b96,_0x24c2a5[_0x7642('0x2')],'id');for(var _0x40271f=0x0,_0x22441b={},_0x39d875={};_0x40271f<_0x487b96[_0x7642('0x7')];_0x40271f+=0x1){_0x22441b=_0x487b96[_0x40271f];if(_[_0x7642('0x8')](_0x24c2a5[_0x7642('0x2')][_0x22441b['id']])){_0x24c2a5[_0x7642('0x2')][_0x22441b['id']]=new MailAccount(_0x22441b);}else{_[_0x7642('0x9')](_0x24c2a5[_0x7642('0x2')][_0x22441b['id']],_0x22441b);}}}return _0x24c2a5['mailAccounts'];};};module[_0x7642('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index f23867d..27852f6 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77d4=['TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','name','data5','getMailAccount','notify','Request','getMailAccounts','GetMailAccount','provider','service','key','ListId'];(function(_0x394fbd,_0x39ae7c){var _0x57caaa=function(_0x834563){while(--_0x834563){_0x394fbd['push'](_0x394fbd['shift']());}};_0x57caaa(++_0x39ae7c);}(_0x77d4,0x108));var _0x477d=function(_0x35eda9,_0x557d12){_0x35eda9=_0x35eda9-0x0;var _0x4c145b=_0x77d4[_0x35eda9];return _0x4c145b;};'use strict';var client=require('../client');exports[_0x477d('0x0')]=function(){return function(){return client['Request'](_0x477d('0x1'),{'options':{'attributes':['id','name',_0x477d('0x2'),_0x477d('0x3'),'email','active',_0x477d('0x4'),_0x477d('0x5'),_0x477d('0x6')],'raw':![],'include':[{'model':_0x477d('0x7'),'as':_0x477d('0x8'),'include':[{'model':_0x477d('0x9'),'attributes':['id','name','service',_0x477d('0xa'),'data5'],'as':'CloudProvider'}]},{'model':_0x477d('0xb'),'as':_0x477d('0xc'),'include':[{'model':_0x477d('0x9'),'attributes':['id',_0x477d('0xd'),_0x477d('0x3'),'type',_0x477d('0xe')],'as':'CloudProvider'}]}]},'log':_0x477d('0xf')});};};exports[_0x477d('0x10')]=function(_0x55ace3,_0x472012){return client[_0x477d('0x11')]('NotifyMailAccount',{'account':{'id':_0x55ace3},'body':_0x472012,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x78f4=['name','service','active','key','ListId','MailServerIn','Imap','data5','MailServerOut','Smtp','CloudProvider','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount'];(function(_0x1b3ee8,_0x1e7614){var _0xf0e6bf=function(_0x281366){while(--_0x281366){_0x1b3ee8['push'](_0x1b3ee8['shift']());}};_0xf0e6bf(++_0x1e7614);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x478f('0x0')]=function(){return function(){return client[_0x478f('0x1')](_0x478f('0x2'),{'options':{'attributes':['id',_0x478f('0x3'),'provider',_0x478f('0x4'),'email',_0x478f('0x5'),_0x478f('0x6'),_0x478f('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x478f('0x8'),'as':_0x478f('0x9'),'include':[{'model':'CloudProvider','attributes':['id',_0x478f('0x3'),'service','type',_0x478f('0xa')],'as':'CloudProvider'}]},{'model':_0x478f('0xb'),'as':_0x478f('0xc'),'include':[{'model':_0x478f('0xd'),'attributes':['id',_0x478f('0x3'),'service','type',_0x478f('0xa')],'as':_0x478f('0xd')}]}]},'log':_0x478f('0xe')});};};exports[_0x478f('0xf')]=function(_0x309791,_0x43b7e1){return client[_0x478f('0x1')](_0x478f('0x10'),{'account':{'id':_0x309791},'body':_0x43b7e1,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index ce02975..096f8f6 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddd9=['ShowSetting','GetSettings','../client','getSettings'];(function(_0x4d4b29,_0x1c674c){var _0x4053cb=function(_0x20ac25){while(--_0x20ac25){_0x4d4b29['push'](_0x4d4b29['shift']());}};_0x4053cb(++_0x1c674c);}(_0xddd9,0x1ee));var _0x9ddd=function(_0x20501e,_0x352f29){_0x20501e=_0x20501e-0x0;var _0x50e0d1=_0xddd9[_0x20501e];return _0x50e0d1;};'use strict';var client=require(_0x9ddd('0x0'));exports[_0x9ddd('0x1')]=function(){return client['Request'](_0x9ddd('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x9ddd('0x3')});}; \ No newline at end of file +var _0x0a1b=['loginMailFrequency','../client','getSettings','ShowSetting'];(function(_0x5594e4,_0x3a0dbf){var _0x3a29bf=function(_0xeca61c){while(--_0xeca61c){_0x5594e4['push'](_0x5594e4['shift']());}};_0x3a29bf(++_0x3a0dbf);}(_0x0a1b,0x13d));var _0xb0a1=function(_0x3bb9a9,_0x204b00){_0x3bb9a9=_0x3bb9a9-0x0;var _0x4ada4b=_0x0a1b[_0x3bb9a9];return _0x4ada4b;};'use strict';var client=require(_0xb0a1('0x0'));exports[_0xb0a1('0x1')]=function(){return client['Request'](_0xb0a1('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb0a1('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index f6c1631..c96ffd3 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index c0455cf..5f03948 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83ae=['Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/express','once','listening','log'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x83ae,0x151));var _0xe83a=function(_0x558fff,_0x45d409){_0x558fff=_0x558fff-0x0;var _0x5d19d6=_0x83ae[_0x558fff];return _0x5d19d6;};'use strict';var _=require(_0xe83a('0x0'));var http=require(_0xe83a('0x1'));var express=require(_0xe83a('0x2'));var sticky=require(_0xe83a('0x3'));var Redis=require(_0xe83a('0x4'));var config=require(_0xe83a('0x5'));var app=express();var server=http[_0xe83a('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0xe83a('0x7')](server,config['port'])){var socketio=require(_0xe83a('0x8'))(server,{'transports':[_0xe83a('0x9'),'polling']});config[_0xe83a('0xa')]=_[_0xe83a('0xb')](config['redis'],{'host':_0xe83a('0xc'),'port':0x18eb});socketio[_0xe83a('0xd')](require(_0xe83a('0xe'))({'pubClient':new Redis(config[_0xe83a('0xa')]),'subClient':new Redis(config[_0xe83a('0xa')])}));require('../../config/triggers')[_0xe83a('0xf')]();require('../../config/socketio')[_0xe83a('0xf')](socketio);require(_0xe83a('0x10'))[_0xe83a('0xf')](app);require('../../routes')['default'](app);}else{server[_0xe83a('0x11')](_0xe83a('0x12'),function(){console[_0xe83a('0x13')](_0xe83a('0x14'),config['port']);});}exports=module['exports']=app; \ No newline at end of file +var _0xce22=['../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','ioredis','createServer','timeout','listen','port','socket.io','polling','redis','defaults','localhost','adapter'];(function(_0x3bc7b7,_0x2cf8b9){var _0xcfd3ac=function(_0x193a79){while(--_0x193a79){_0x3bc7b7['push'](_0x3bc7b7['shift']());}};_0xcfd3ac(++_0x2cf8b9);}(_0xce22,0x152));var _0x2ce2=function(_0x183620,_0x27760b){_0x183620=_0x183620-0x0;var _0xc7bc0=_0xce22[_0x183620];return _0xc7bc0;};'use strict';var _=require(_0x2ce2('0x0'));var http=require(_0x2ce2('0x1'));var express=require(_0x2ce2('0x2'));var sticky=require('sticky-session');var Redis=require(_0x2ce2('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x2ce2('0x4')](app);server[_0x2ce2('0x5')]=0xdbba0;if(sticky[_0x2ce2('0x6')](server,config[_0x2ce2('0x7')])){var socketio=require(_0x2ce2('0x8'))(server,{'transports':['websocket',_0x2ce2('0x9')]});config[_0x2ce2('0xa')]=_[_0x2ce2('0xb')](config[_0x2ce2('0xa')],{'host':_0x2ce2('0xc'),'port':0x18eb});socketio[_0x2ce2('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x2ce2('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x2ce2('0xe'))[_0x2ce2('0xf')]();require(_0x2ce2('0x10'))['default'](socketio);require(_0x2ce2('0x11'))['default'](app);require('../../routes')['default'](app);}else{server[_0x2ce2('0x12')](_0x2ce2('0x13'),function(){console[_0x2ce2('0x14')](_0x2ce2('0x15'),config[_0x2ce2('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index edcb8e8..90f24e9 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc03=['exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','rpc','error','message','catch'];(function(_0x3c3c0a,_0x55292c){var _0xf63fd6=function(_0x3076fa){while(--_0x3076fa){_0x3c3c0a['push'](_0x3c3c0a['shift']());}};_0xf63fd6(++_0x55292c);}(_0xbc03,0x9d));var _0x3bc0=function(_0x311fdd,_0x1d3fcd){_0x311fdd=_0x311fdd-0x0;var _0x2a34ed=_0xbc03[_0x311fdd];return _0x2a34ed;};'use strict';var jayson=require(_0x3bc0('0x0'));var BPromise=require('bluebird');var logger=require(_0x3bc0('0x1'))(_0x3bc0('0x2'));var client=jayson[_0x3bc0('0x3')][_0x3bc0('0x4')]({'port':0x2329});client[_0x3bc0('0x5')]=function(_0x242841,_0xa0b6e5){return new BPromise(function(_0x1c4a4e,_0x542e97){return client[_0x3bc0('0x6')](_0x242841,_0xa0b6e5)[_0x3bc0('0x7')](function(_0x2b2a29){logger['debug'](_0x3bc0('0x8'),_0x3bc0('0x2'),_0x242841,_0xa0b6e5,_0x2b2a29);if(_0x2b2a29[_0x3bc0('0x9')]){logger[_0x3bc0('0x9')](_0x3bc0('0x8'),_0x3bc0('0x2'),_0x242841,_0x2b2a29['error']['message'],_0xa0b6e5);return _0x542e97(_0x2b2a29[_0x3bc0('0x9')][_0x3bc0('0xa')]);}else{return _0x1c4a4e(_0x2b2a29['result']);}})[_0x3bc0('0xb')](function(_0x1e482b){logger[_0x3bc0('0x9')](_0x3bc0('0x8'),_0x3bc0('0x2'),_0x242841,_0x1e482b,_0xa0b6e5);return _0x542e97(_0x1e482b);});});};module[_0x3bc0('0xc')]=client; \ No newline at end of file +var _0xb1db=['exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','debug','routing','error','rpc','message','result'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xb1db,0x189));var _0xbb1d=function(_0x2dd092,_0x10a19e){_0x2dd092=_0x2dd092-0x0;var _0x2c9e3c=_0xb1db[_0x2dd092];return _0x2c9e3c;};'use strict';var jayson=require(_0xbb1d('0x0'));var BPromise=require(_0xbb1d('0x1'));var logger=require(_0xbb1d('0x2'))('routing');var client=jayson[_0xbb1d('0x3')][_0xbb1d('0x4')]({'port':0x2329});client[_0xbb1d('0x5')]=function(_0x344c1c,_0x595f4e){return new BPromise(function(_0x2ec4fe,_0x54d4ba){return client[_0xbb1d('0x6')](_0x344c1c,_0x595f4e)['then'](function(_0x50e323){logger[_0xbb1d('0x7')]('rpc',_0xbb1d('0x8'),_0x344c1c,_0x595f4e,_0x50e323);if(_0x50e323['error']){logger[_0xbb1d('0x9')](_0xbb1d('0xa'),'routing',_0x344c1c,_0x50e323['error'][_0xbb1d('0xb')],_0x595f4e);return _0x54d4ba(_0x50e323[_0xbb1d('0x9')][_0xbb1d('0xb')]);}else{return _0x2ec4fe(_0x50e323[_0xbb1d('0xc')]);}})['catch'](function(_0x7268bf){logger['error'](_0xbb1d('0xa'),_0xbb1d('0x8'),_0x344c1c,_0x7268bf,_0x595f4e);return _0x54d4ba(_0x7268bf);});});};module[_0xbb1d('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 73106a9..1aed8dd 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa183=['./rpc/whatsappQueue','resolve','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xa183,0x131));var _0x3a18=function(_0x36f017,_0x243828){_0x36f017=_0x36f017-0x0;var _0x1f11ad=_0xa183[_0x36f017];return _0x1f11ad;};'use strict';var BPromise=require(_0x3a18('0x0'));var server=require(_0x3a18('0x1'));var Realtime=require('./realtime');var user=require(_0x3a18('0x2'));var interval=require(_0x3a18('0x3'));var openchannelQueue=require(_0x3a18('0x4'));var chatQueue=require(_0x3a18('0x5'));var smsQueue=require(_0x3a18('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x3a18('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3a18('0x8')]()[_0x3a18('0x9')](user['getAgents']())[_0x3a18('0x9')](realtime[_0x3a18('0xa')]())['then'](interval['getIntervals']())[_0x3a18('0x9')](realtime[_0x3a18('0xb')]())[_0x3a18('0x9')](openchannelQueue[_0x3a18('0xc')]())[_0x3a18('0x9')](realtime[_0x3a18('0xd')]())['then'](chatQueue[_0x3a18('0xe')]())[_0x3a18('0x9')](realtime['initChatQueues']())[_0x3a18('0x9')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x3a18('0x9')](mailQueue[_0x3a18('0xf')]())[_0x3a18('0x9')](realtime[_0x3a18('0x10')]())[_0x3a18('0x9')](faxQueue[_0x3a18('0x11')]())[_0x3a18('0x9')](realtime[_0x3a18('0x12')]())[_0x3a18('0x9')](whatsappQueue[_0x3a18('0x13')]())[_0x3a18('0x9')](realtime[_0x3a18('0x14')]())[_0x3a18('0x9')](function(){return realtime;});}function main(){return server[_0x3a18('0x15')](realtime)['then'](function(_0x9f100){return initRealtime();})['then'](function(_0x5080c6){return setInterval(initRealtime,0x1388);})[_0x3a18('0x16')](function(_0xadea89){console[_0x3a18('0x17')](_0xadea89);});}main(); \ No newline at end of file +var _0x94c0=['getFaxQueues','initFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues'];(function(_0x5cc280,_0x2744f7){var _0x2a3f16=function(_0x286c16){while(--_0x286c16){_0x5cc280['push'](_0x5cc280['shift']());}};_0x2a3f16(++_0x2744f7);}(_0x94c0,0xe6));var _0x094c=function(_0x3576c0,_0x196351){_0x3576c0=_0x3576c0-0x0;var _0x310e7d=_0x94c0[_0x3576c0];return _0x310e7d;};'use strict';var BPromise=require(_0x094c('0x0'));var server=require(_0x094c('0x1'));var Realtime=require(_0x094c('0x2'));var user=require(_0x094c('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x094c('0x4'));var smsQueue=require(_0x094c('0x5'));var mailQueue=require(_0x094c('0x6'));var faxQueue=require(_0x094c('0x7'));var whatsappQueue=require(_0x094c('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x094c('0x9')]()[_0x094c('0xa')](user[_0x094c('0xb')]())[_0x094c('0xa')](realtime[_0x094c('0xc')]())[_0x094c('0xa')](interval['getIntervals']())[_0x094c('0xa')](realtime[_0x094c('0xd')]())[_0x094c('0xa')](openchannelQueue[_0x094c('0xe')]())['then'](realtime[_0x094c('0xf')]())[_0x094c('0xa')](chatQueue['getChatQueues']())['then'](realtime[_0x094c('0x10')]())['then'](smsQueue[_0x094c('0x11')]())[_0x094c('0xa')](realtime[_0x094c('0x12')]())[_0x094c('0xa')](mailQueue['getMailQueues']())[_0x094c('0xa')](realtime[_0x094c('0x13')]())[_0x094c('0xa')](faxQueue[_0x094c('0x14')]())[_0x094c('0xa')](realtime[_0x094c('0x15')]())[_0x094c('0xa')](whatsappQueue['getWhatsappQueues']())[_0x094c('0xa')](realtime['initWhatsappQueues']())[_0x094c('0xa')](function(){return realtime;});}function main(){return server[_0x094c('0x16')](realtime)[_0x094c('0xa')](function(_0x4a7b62){return initRealtime();})['then'](function(_0x4ebad6){return setInterval(initRealtime,0x1388);})[_0x094c('0x17')](function(_0x380324){console[_0x094c('0x18')](_0x380324);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 946fa39..b3a1794 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x3fb2d4,_0x44a3a8){var _0x4cfd9a=function(_0x35f723){while(--_0x35f723){_0x3fb2d4['push'](_0x3fb2d4['shift']());}};_0x4cfd9a(++_0x44a3a8);}(_0x326f,0xd1));var _0xf326=function(_0x6f8730,_0x5eefc4){_0x6f8730=_0x6f8730-0x0;var _0x2963e8=_0x326f[_0x6f8730];return _0x2963e8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x47d193,_0x3d630b){var _0x442d26=function(_0x492730){while(--_0x492730){_0x47d193['push'](_0x47d193['shift']());}};_0x442d26(++_0x3d630b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x5fc3[_0x4f431d];return _0x4f31e1;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 89794c8..5249284 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed8c=['error','message','result','catch','bluebird','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed8c,0x94));var _0xced8=function(_0x1bc884,_0x48f8c5){_0x1bc884=_0x1bc884-0x0;var _0x291c15=_0xed8c[_0x1bc884];return _0x291c15;};'use strict';var BPromise=require(_0xced8('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xced8('0x1')]({'port':0x232b});function request(_0x1c4c22,_0x2e5cac){return new BPromise(function(_0x1ca08d,_0xd54e15){return client[_0xced8('0x2')](_0x1c4c22,_0x2e5cac)[_0xced8('0x3')](function(_0xa3a8e9){if(_0xa3a8e9[_0xced8('0x4')]){return _0xd54e15(_0xa3a8e9[_0xced8('0x4')][_0xced8('0x5')]);}else{return _0x1ca08d(_0xa3a8e9[_0xced8('0x6')]);}})[_0xced8('0x7')](function(_0x4c7e21){return _0xd54e15(_0x4c7e21);});});}exports['sendMailMessage']=function(_0x20d32c,_0x2f8293){return request('SendMail',{'account':_0x20d32c,'message':_0x2f8293});}; \ No newline at end of file +var _0x50b3=['result','bluebird','jayson/promise','then','error'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x50b3,0xba));var _0x350b=function(_0x549e49,_0x94ee2f){_0x549e49=_0x549e49-0x0;var _0x53fdd3=_0x50b3[_0x549e49];return _0x53fdd3;};'use strict';var BPromise=require(_0x350b('0x0'));var jayson=require(_0x350b('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x263292,_0x12e9a8){return new BPromise(function(_0x5d9fb5,_0x3c2479){return client['request'](_0x263292,_0x12e9a8)[_0x350b('0x2')](function(_0x30bbe7){if(_0x30bbe7[_0x350b('0x3')]){return _0x3c2479(_0x30bbe7[_0x350b('0x3')]['message']);}else{return _0x5d9fb5(_0x30bbe7[_0x350b('0x4')]);}})['catch'](function(_0x3a6db2){return _0x3c2479(_0x3a6db2);});});}exports['sendMailMessage']=function(_0xc6f285,_0x3eb6e7){return request('SendMail',{'account':_0xc6f285,'message':_0x3eb6e7});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index be24fd6..1d8ae23 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19c3=['mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','prototype','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','format','online','chatStatus','mailStatus','mailStatusTime','whatsappStatusTime','openchannelWaitingInteractions','whatsappWaitingInteractions','stringify','md5','emit','user:save','exports','lodash','moment','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity'];(function(_0x110ddb,_0x52c82e){var _0x2fa7e5=function(_0x30c6c3){while(--_0x30c6c3){_0x110ddb['push'](_0x110ddb['shift']());}};_0x2fa7e5(++_0x52c82e);}(_0x19c3,0x75));var _0x319c=function(_0x29b645,_0x588989){_0x29b645=_0x29b645-0x0;var _0x46b57f=_0x19c3[_0x29b645];return _0x46b57f;};'use strict';var _=require(_0x319c('0x0'));var moment=require(_0x319c('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x319c('0x2'));config['redis']=_[_0x319c('0x3')](config['redis'],{'host':_0x319c('0x4'),'port':0x18eb});var io=require(_0x319c('0x5'))(new Redis(config[_0x319c('0x6')]));function Agent(_0x1d633c){this['id']=_0x1d633c['id']||0x0;this['name']=_0x1d633c[_0x319c('0x7')]||'';this['online']=_0x1d633c['online']||!![];this[_0x319c('0x8')]=_0x1d633c[_0x319c('0x8')]||![];this[_0x319c('0x9')]=_0x1d633c[_0x319c('0x9')]||![];this[_0x319c('0xa')]=_0x1d633c[_0x319c('0xa')]||![];this[_0x319c('0xb')]=_0x1d633c['faxPause']||![];this['smsPause']=_0x1d633c[_0x319c('0xc')]||![];this[_0x319c('0xd')]=_0x1d633c[_0x319c('0xd')]||![];this['chatStatus']=_0x319c('0xe');this[_0x319c('0xf')]=0x0;this[_0x319c('0x10')]=_0x1d633c[_0x319c('0x10')]||0x0;this[_0x319c('0x11')]=0x0;this['mailStatus']=_0x319c('0xe');this['mailStatusTime']=0x0;this[_0x319c('0x12')]=_0x1d633c[_0x319c('0x12')]||0x0;this[_0x319c('0x13')]=0x0;this[_0x319c('0x14')]=_0x319c('0xe');this[_0x319c('0x15')]=0x0;this[_0x319c('0x16')]=_0x1d633c['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x319c('0x17')]=_0x319c('0xe');this[_0x319c('0x18')]=0x0;this[_0x319c('0x19')]=_0x1d633c[_0x319c('0x19')]||0x0;this[_0x319c('0x1a')]=0x0;this[_0x319c('0x1b')]=_0x319c('0xe');this['whatsappStatusTime']=0x0;this[_0x319c('0x1c')]=_0x1d633c['whatsappCapacity']||0x0;this[_0x319c('0x1d')]=0x0;this[_0x319c('0x1e')]='unknown';this[_0x319c('0x1f')]=0x0;this['openchannelCapacity']=_0x1d633c[_0x319c('0x20')]||0x0;this[_0x319c('0x21')]=0x0;this[_0x319c('0x22')]=![];this[_0x319c('0x23')]=undefined;this['md5']='';this[_0x319c('0x24')]={};this[_0x319c('0x25')]={};this[_0x319c('0x26')]={};this['openchannelWaitingInteractions']={};this[_0x319c('0x27')]={};this['whatsappWaitingInteractions']={};this[_0x319c('0x28')]();}Agent['prototype'][_0x319c('0x29')]=function(_0x2789de){if(this[_0x2789de+'CurrentCapacity']>0x0){if(this[_0x2789de+_0x319c('0x2a')]>0x0&&this[_0x2789de+_0x319c('0x2b')]>=this[_0x2789de+'Capacity']){return _0x319c('0x2c');}else{return _0x319c('0x2d');}}else{return'idle';}};Agent[_0x319c('0x2e')][_0x319c('0x28')]=function(){var _0x52525b=[_0x319c('0x2f'),_0x319c('0x30'),_0x319c('0x31'),'fax',_0x319c('0x32'),_0x319c('0x33')];for(var _0x2a0330=0x0;_0x2a0330<_0x52525b[_0x319c('0x34')];_0x2a0330+=0x1){var _0x49cdc6=this['getChannelStatus'](_0x52525b[_0x2a0330]);if(this[_0x52525b[_0x2a0330]+_0x319c('0x35')]!==_0x49cdc6){this[_0x52525b[_0x2a0330]+_0x319c('0x36')]=_['toNumber'](moment()[_0x319c('0x37')]('x'));}this[_0x52525b[_0x2a0330]+'Status']=_0x49cdc6;}var _0x8c43a5={'id':this['id'],'name':this[_0x319c('0x7')],'online':this[_0x319c('0x38')],'voicePause':this['voicePause'],'chatPause':this[_0x319c('0x9')],'mailPause':this[_0x319c('0xa')],'smsPause':this[_0x319c('0xc')],'faxPause':this[_0x319c('0xb')],'openchannelPause':this[_0x319c('0xd')],'chatStatus':this[_0x319c('0x39')],'chatStatusTime':this[_0x319c('0xf')],'chatCapacity':this[_0x319c('0x10')],'chatCurrentCapacity':this[_0x319c('0x11')],'mailStatus':this[_0x319c('0x3a')],'mailStatusTime':this[_0x319c('0x3b')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x319c('0x13')],'faxStatus':this[_0x319c('0x14')],'faxStatusTime':this[_0x319c('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x319c('0x17')],'smsStatusTime':this[_0x319c('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x319c('0x1b')],'whatsappStatusTime':this[_0x319c('0x3c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x319c('0x1d')],'openchannelStatus':this[_0x319c('0x1e')],'openchannelStatusTime':this[_0x319c('0x1f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x319c('0x23')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x319c('0x25')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x319c('0x3d')],'smsWaitingInteractions':this[_0x319c('0x27')],'whatsappWaitingInteractions':this[_0x319c('0x3e')]};var _0x12e85c=md5(JSON[_0x319c('0x3f')](_0x8c43a5));if(this[_0x319c('0x40')]!==_0x12e85c){this[_0x319c('0x40')]=_0x12e85c;io[_0x319c('0x41')](_0x319c('0x42'),_0x8c43a5);}};module[_0x319c('0x43')]=Agent; \ No newline at end of file +var _0xce15=['voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatus','chatCapacity','openchannelStatusTime','stringify','emit','user:save','exports','moment','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xce15,0xff));var _0x5ce1=function(_0x179a0c,_0x2ca073){_0x179a0c=_0x179a0c-0x0;var _0x1c8b9a=_0xce15[_0x179a0c];return _0x1c8b9a;};'use strict';var _=require('lodash');var moment=require(_0x5ce1('0x0'));var md5=require(_0x5ce1('0x1'));var Redis=require('ioredis');var config=require(_0x5ce1('0x2'));config['redis']=_[_0x5ce1('0x3')](config[_0x5ce1('0x4')],{'host':_0x5ce1('0x5'),'port':0x18eb});var io=require(_0x5ce1('0x6'))(new Redis(config['redis']));function Agent(_0x418873){this['id']=_0x418873['id']||0x0;this[_0x5ce1('0x7')]=_0x418873[_0x5ce1('0x7')]||'';this[_0x5ce1('0x8')]=_0x418873[_0x5ce1('0x8')]||!![];this[_0x5ce1('0x9')]=_0x418873[_0x5ce1('0x9')]||![];this[_0x5ce1('0xa')]=_0x418873[_0x5ce1('0xa')]||![];this[_0x5ce1('0xb')]=_0x418873[_0x5ce1('0xb')]||![];this[_0x5ce1('0xc')]=_0x418873[_0x5ce1('0xc')]||![];this[_0x5ce1('0xd')]=_0x418873['smsPause']||![];this[_0x5ce1('0xe')]=_0x418873[_0x5ce1('0xe')]||![];this['chatStatus']=_0x5ce1('0xf');this[_0x5ce1('0x10')]=0x0;this['chatCapacity']=_0x418873['chatCapacity']||0x0;this[_0x5ce1('0x11')]=0x0;this[_0x5ce1('0x12')]=_0x5ce1('0xf');this[_0x5ce1('0x13')]=0x0;this['mailCapacity']=_0x418873[_0x5ce1('0x14')]||0x0;this[_0x5ce1('0x15')]=0x0;this[_0x5ce1('0x16')]='unknown';this['faxStatusTime']=0x0;this[_0x5ce1('0x17')]=_0x418873[_0x5ce1('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x5ce1('0x18')]=_0x5ce1('0xf');this[_0x5ce1('0x19')]=0x0;this['smsCapacity']=_0x418873[_0x5ce1('0x1a')]||0x0;this[_0x5ce1('0x1b')]=0x0;this[_0x5ce1('0x1c')]='unknown';this[_0x5ce1('0x1d')]=0x0;this[_0x5ce1('0x1e')]=_0x418873[_0x5ce1('0x1e')]||0x0;this[_0x5ce1('0x1f')]=0x0;this[_0x5ce1('0x20')]=_0x5ce1('0xf');this['openchannelStatusTime']=0x0;this[_0x5ce1('0x21')]=_0x418873[_0x5ce1('0x21')]||0x0;this[_0x5ce1('0x22')]=0x0;this[_0x5ce1('0x23')]=![];this[_0x5ce1('0x24')]=undefined;this['md5']='';this[_0x5ce1('0x25')]={};this[_0x5ce1('0x26')]={};this[_0x5ce1('0x27')]={};this[_0x5ce1('0x28')]={};this[_0x5ce1('0x29')]={};this['whatsappWaitingInteractions']={};this[_0x5ce1('0x2a')]();}Agent[_0x5ce1('0x2b')][_0x5ce1('0x2c')]=function(_0x242c2a){if(this[_0x242c2a+_0x5ce1('0x2d')]>0x0){if(this[_0x242c2a+_0x5ce1('0x2e')]>0x0&&this[_0x242c2a+_0x5ce1('0x2d')]>=this[_0x242c2a+_0x5ce1('0x2e')]){return _0x5ce1('0x2f');}else{return _0x5ce1('0x30');}}else{return _0x5ce1('0x31');}};Agent[_0x5ce1('0x2b')][_0x5ce1('0x2a')]=function(){var _0x4ded95=[_0x5ce1('0x32'),'chat',_0x5ce1('0x33'),'fax',_0x5ce1('0x34'),_0x5ce1('0x35')];for(var _0x1f9343=0x0;_0x1f9343<_0x4ded95[_0x5ce1('0x36')];_0x1f9343+=0x1){var _0x32e62f=this[_0x5ce1('0x2c')](_0x4ded95[_0x1f9343]);if(this[_0x4ded95[_0x1f9343]+_0x5ce1('0x37')]!==_0x32e62f){this[_0x4ded95[_0x1f9343]+_0x5ce1('0x38')]=_[_0x5ce1('0x39')](moment()[_0x5ce1('0x3a')]('x'));}this[_0x4ded95[_0x1f9343]+_0x5ce1('0x37')]=_0x32e62f;}var _0x2d6c16={'id':this['id'],'name':this['name'],'online':this[_0x5ce1('0x8')],'voicePause':this[_0x5ce1('0x9')],'chatPause':this[_0x5ce1('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x5ce1('0xd')],'faxPause':this[_0x5ce1('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x5ce1('0x3b')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x5ce1('0x3c')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5ce1('0x12')],'mailStatusTime':this[_0x5ce1('0x13')],'mailCapacity':this[_0x5ce1('0x14')],'mailCurrentCapacity':this[_0x5ce1('0x15')],'faxStatus':this[_0x5ce1('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x5ce1('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x5ce1('0x1b')],'whatsappStatus':this[_0x5ce1('0x1c')],'whatsappStatusTime':this[_0x5ce1('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x5ce1('0x1f')],'openchannelStatus':this[_0x5ce1('0x20')],'openchannelStatusTime':this[_0x5ce1('0x3d')],'openchannelCapacity':this[_0x5ce1('0x21')],'openchannelCurrentCapacity':this[_0x5ce1('0x22')],'busy':this[_0x5ce1('0x23')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x5ce1('0x25')],'faxWaitingInteractions':this[_0x5ce1('0x26')],'mailWaitingInteractions':this[_0x5ce1('0x27')],'openchannelWaitingInteractions':this[_0x5ce1('0x28')],'smsWaitingInteractions':this[_0x5ce1('0x29')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0xff4353=md5(JSON[_0x5ce1('0x3e')](_0x2d6c16));if(this[_0x5ce1('0x1')]!==_0xff4353){this[_0x5ce1('0x1')]=_0xff4353;io[_0x5ce1('0x3f')](_0x5ce1('0x40'),_0x2d6c16);}};module[_0x5ce1('0x41')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 27ceac7..7be8ac8 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 _0x3d3c=['chatPause','paused','available','stringify','format','emit','chat_queue:save','exports','lodash','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','online'];(function(_0x265055,_0x156dbc){var _0x6dc78a=function(_0x16c1e5){while(--_0x16c1e5){_0x265055['push'](_0x265055['shift']());}};_0x6dc78a(++_0x156dbc);}(_0x3d3c,0x1ac));var _0xc3d3=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x3d3c[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xc3d3('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xc3d3('0x1'));var config=require('../../../config/environment');config[_0xc3d3('0x2')]=_[_0xc3d3('0x3')](config['redis'],{'host':_0xc3d3('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc3d3('0x2')]));function ChatQueue(_0x92567f){this['id']=_0x92567f['id']||0x0;this[_0xc3d3('0x5')]=_0x92567f[_0xc3d3('0x5')]||'';this[_0xc3d3('0x6')]=_0x92567f[_0xc3d3('0x6')]||0xa;this[_0xc3d3('0x7')]=_0x92567f['strategy']||_0xc3d3('0x8');this[_0xc3d3('0x9')]=_0x92567f[_0xc3d3('0x9')];this[_0xc3d3('0xa')]={};this[_0xc3d3('0xb')]=0x0;this[_0xc3d3('0xc')]='';this[_0xc3d3('0xd')]();this[_0xc3d3('0xe')]();}ChatQueue[_0xc3d3('0xf')][_0xc3d3('0xd')]=function(){var _0x13553a=this[_0xc3d3('0xa')]['_rr'];this[_0xc3d3('0xa')]=_[_0xc3d3('0x10')](this[_0xc3d3('0x9')],'id');this[_0xc3d3('0xa')][_0xc3d3('0x11')]=_0x13553a;};ChatQueue['prototype'][_0xc3d3('0xe')]=function(){this[_0xc3d3('0x12')]=0x0;this['paused']=0x0;for(var _0x2ba82e=0x0;_0x2ba82e=0x0?this[_0xc3d3('0x16')]:0x0;var _0xdade64={'id':this['id'],'available':this[_0xc3d3('0x16')],'loggedIn':this[_0xc3d3('0x12')],'name':this['name'],'paused':this[_0xc3d3('0x15')],'waiting':this['waiting']};var _0x30fa73=md5(JSON[_0xc3d3('0x17')](_0xdade64));if(this[_0xc3d3('0xc')]!==_0x30fa73){this[_0xc3d3('0xc')]=_0x30fa73;io['to'](util[_0xc3d3('0x18')]('chat:queue:%s',_0xdade64[_0xc3d3('0x5')]))[_0xc3d3('0x19')](_0xc3d3('0x1a'),_0xdade64);}};module[_0xc3d3('0x1b')]=ChatQueue; \ No newline at end of file +var _0x51d1=['Agents','online','chatPause','available','format','chat:queue:%s','exports','lodash','md5','util','redis','defaults','socket.io-emitter','name','timeout','strategy','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','paused','length'];(function(_0x2d80af,_0xfdfd5b){var _0x4917c6=function(_0x3f9581){while(--_0x3f9581){_0x2d80af['push'](_0x2d80af['shift']());}};_0x4917c6(++_0xfdfd5b);}(_0x51d1,0x13f));var _0x151d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x51d1[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x151d('0x0'));var md5=require(_0x151d('0x1'));var util=require(_0x151d('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x151d('0x3')]=_[_0x151d('0x4')](config[_0x151d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x151d('0x5'))(new Redis(config[_0x151d('0x3')]));function ChatQueue(_0x31a8ee){this['id']=_0x31a8ee['id']||0x0;this[_0x151d('0x6')]=_0x31a8ee[_0x151d('0x6')]||'';this[_0x151d('0x7')]=_0x31a8ee[_0x151d('0x7')]||0xa;this[_0x151d('0x8')]=_0x31a8ee[_0x151d('0x8')]||'beepall';this['Agents']=_0x31a8ee['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x151d('0x9')]();this[_0x151d('0xa')]();}ChatQueue[_0x151d('0xb')][_0x151d('0x9')]=function(){var _0x493380=this['mapAgentsId']['_rr'];this[_0x151d('0xc')]=_[_0x151d('0xd')](this['Agents'],'id');this[_0x151d('0xc')]['_rr']=_0x493380;};ChatQueue[_0x151d('0xb')]['updateRealtime']=function(){this[_0x151d('0xe')]=0x0;this[_0x151d('0xf')]=0x0;for(var _0x1b8619=0x0;_0x1b8619=0x0?this[_0x151d('0x14')]:0x0;var _0x1299bf={'id':this['id'],'available':this[_0x151d('0x14')],'loggedIn':this[_0x151d('0xe')],'name':this[_0x151d('0x6')],'paused':this[_0x151d('0xf')],'waiting':this['waiting']};var _0x3cc8c6=md5(JSON['stringify'](_0x1299bf));if(this['md5']!==_0x3cc8c6){this['md5']=_0x3cc8c6;io['to'](util[_0x151d('0x15')](_0x151d('0x16'),_0x1299bf['name']))['emit']('chat_queue:save',_0x1299bf);}};module[_0x151d('0x17')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index c07fc78..2c17a8a 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 _0x9ec8=['name','format','fax:queue:%s','emit','fax_queue:save','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','prototype','updateRouting','mapAgentsId','map','_rr','loggedIn','paused','length','online','available'];(function(_0x5679cd,_0x5dc7a5){var _0x308a2e=function(_0x761822){while(--_0x761822){_0x5679cd['push'](_0x5679cd['shift']());}};_0x308a2e(++_0x5dc7a5);}(_0x9ec8,0x6d));var _0x89ec=function(_0x5f2203,_0x41f4b1){_0x5f2203=_0x5f2203-0x0;var _0x2c4f42=_0x9ec8[_0x5f2203];return _0x2c4f42;};'use strict';var _=require('lodash');var md5=require(_0x89ec('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x89ec('0x1'));config['redis']=_[_0x89ec('0x2')](config[_0x89ec('0x3')],{'host':_0x89ec('0x4'),'port':0x18eb});var io=require(_0x89ec('0x5'))(new Redis(config['redis']));function FaxQueue(_0x119362){this['id']=_0x119362['id']||0x0;this['name']=_0x119362['name']||'';this[_0x89ec('0x6')]=_0x119362['timeout']||0xa;this[_0x89ec('0x7')]=_0x119362[_0x89ec('0x7')]||_0x89ec('0x8');this[_0x89ec('0x9')]=_0x119362[_0x89ec('0x9')];this['mapAgentsId']={};this[_0x89ec('0xa')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x89ec('0xb')][_0x89ec('0xc')]=function(){var _0x513b92=this[_0x89ec('0xd')]['_rr'];this[_0x89ec('0xd')]=_[_0x89ec('0xe')](this[_0x89ec('0x9')],'id');this['mapAgentsId'][_0x89ec('0xf')]=_0x513b92;};FaxQueue[_0x89ec('0xb')]['updateRealtime']=function(){this[_0x89ec('0x10')]=0x0;this[_0x89ec('0x11')]=0x0;for(var _0x1982f8=0x0;_0x1982f8=0x0?this[_0x89ec('0x14')]:0x0;var _0x5493ac={'id':this['id'],'available':this[_0x89ec('0x14')],'loggedIn':this[_0x89ec('0x10')],'name':this[_0x89ec('0x15')],'paused':this[_0x89ec('0x11')],'waiting':this['waiting']};var _0x448812=md5(JSON['stringify'](_0x5493ac));if(this[_0x89ec('0x0')]!==_0x448812){this[_0x89ec('0x0')]=_0x448812;io['to'](util[_0x89ec('0x16')](_0x89ec('0x17'),_0x5493ac[_0x89ec('0x15')]))[_0x89ec('0x18')](_0x89ec('0x19'),_0x5493ac);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x21f5=['available','name','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','faxPause','paused'];(function(_0x492c9a,_0x855125){var _0x2f8919=function(_0x52b4ef){while(--_0x52b4ef){_0x492c9a['push'](_0x492c9a['shift']());}};_0x2f8919(++_0x855125);}(_0x21f5,0x1ca));var _0x521f=function(_0xfa3402,_0x4b84dd){_0xfa3402=_0xfa3402-0x0;var _0x55735e=_0x21f5[_0xfa3402];return _0x55735e;};'use strict';var _=require(_0x521f('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x521f('0x1'));var config=require(_0x521f('0x2'));config['redis']=_[_0x521f('0x3')](config[_0x521f('0x4')],{'host':_0x521f('0x5'),'port':0x18eb});var io=require(_0x521f('0x6'))(new Redis(config['redis']));function FaxQueue(_0x29bd49){this['id']=_0x29bd49['id']||0x0;this['name']=_0x29bd49['name']||'';this[_0x521f('0x7')]=_0x29bd49[_0x521f('0x7')]||0xa;this[_0x521f('0x8')]=_0x29bd49[_0x521f('0x8')]||_0x521f('0x9');this[_0x521f('0xa')]=_0x29bd49['Agents'];this['mapAgentsId']={};this[_0x521f('0xb')]=0x0;this[_0x521f('0xc')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0x521f('0xd')]=function(){var _0x2167ef=this[_0x521f('0xe')][_0x521f('0xf')];this[_0x521f('0xe')]=_[_0x521f('0x10')](this['Agents'],'id');this[_0x521f('0xe')][_0x521f('0xf')]=_0x2167ef;};FaxQueue[_0x521f('0x11')][_0x521f('0x12')]=function(){this[_0x521f('0x13')]=0x0;this['paused']=0x0;for(var _0x188796=0x0;_0x188796=0x0?this['available']:0x0;var _0x2856af={'id':this['id'],'available':this[_0x521f('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x521f('0x17')],'paused':this['paused'],'waiting':this[_0x521f('0xb')]};var _0x1e044e=md5(JSON[_0x521f('0x18')](_0x2856af));if(this['md5']!==_0x1e044e){this[_0x521f('0xc')]=_0x1e044e;io['to'](util[_0x521f('0x19')](_0x521f('0x1a'),_0x2856af[_0x521f('0x17')]))[_0x521f('0x1b')](_0x521f('0x1c'),_0x2856af);}};module[_0x521f('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 57d0674..ec24b07 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 _0xd623=['Intervals','exports'];(function(_0x33bb4f,_0x28ad88){var _0x5e0f07=function(_0x544eb2){while(--_0x544eb2){_0x33bb4f['push'](_0x33bb4f['shift']());}};_0x5e0f07(++_0x28ad88);}(_0xd623,0xea));var _0x3d62=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd623[_0x2c7618];return _0x5ce3f0;};'use strict';function Interval(_0x5ab4e0){this['id']=_0x5ab4e0['id']||0x0;this['name']=_0x5ab4e0['name']||'';this[_0x3d62('0x0')]=_0x5ab4e0[_0x3d62('0x0')]||{};}module[_0x3d62('0x1')]=Interval; \ No newline at end of file +var _0x2881=['exports','name'];(function(_0x5f5ac5,_0x526505){var _0x3697f2=function(_0x49cec5){while(--_0x49cec5){_0x5f5ac5['push'](_0x5f5ac5['shift']());}};_0x3697f2(++_0x526505);}(_0x2881,0xdd));var _0x1288=function(_0x17f029,_0xd19e65){_0x17f029=_0x17f029-0x0;var _0x2702d5=_0x2881[_0x17f029];return _0x2702d5;};'use strict';function Interval(_0x507e62){this['id']=_0x507e62['id']||0x0;this['name']=_0x507e62[_0x1288('0x0')]||'';this['Intervals']=_0x507e62['Intervals']||{};}module[_0x1288('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index d8537c4..d7b16eb 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 _0x20b1=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults'];(function(_0x5059ff,_0x564bbc){var _0x585146=function(_0x51bae9){while(--_0x51bae9){_0x5059ff['push'](_0x5059ff['shift']());}};_0x585146(++_0x564bbc);}(_0x20b1,0x1db));var _0x120b=function(_0x544186,_0x4ac13a){_0x544186=_0x544186-0x0;var _0x99b00a=_0x20b1[_0x544186];return _0x99b00a;};'use strict';var _=require(_0x120b('0x0'));var md5=require(_0x120b('0x1'));var util=require('util');var Redis=require(_0x120b('0x2'));var config=require(_0x120b('0x3'));config['redis']=_[_0x120b('0x4')](config[_0x120b('0x5')],{'host':_0x120b('0x6'),'port':0x18eb});var io=require(_0x120b('0x7'))(new Redis(config[_0x120b('0x5')]));function MailQueue(_0x10827e){this['id']=_0x10827e['id']||0x0;this[_0x120b('0x8')]=_0x10827e[_0x120b('0x8')]||'';this[_0x120b('0x9')]=_0x10827e['timeout']||0xa;this[_0x120b('0xa')]=_0x10827e[_0x120b('0xa')]||_0x120b('0xb');this[_0x120b('0xc')]=_0x10827e[_0x120b('0xc')];this[_0x120b('0xd')]={};this[_0x120b('0xe')]=0x0;this['md5']='';this[_0x120b('0xf')]();this['updateRealtime']();}MailQueue['prototype'][_0x120b('0xf')]=function(){var _0x165b75=this[_0x120b('0xd')][_0x120b('0x10')];this[_0x120b('0xd')]=_['map'](this[_0x120b('0xc')],'id');this['mapAgentsId'][_0x120b('0x10')]=_0x165b75;};MailQueue[_0x120b('0x11')][_0x120b('0x12')]=function(){this[_0x120b('0x13')]=0x0;this[_0x120b('0x14')]=0x0;for(var _0x1d9b8b=0x0;_0x1d9b8b=0x0?this[_0x120b('0x18')]:0x0;var _0x52564e={'id':this['id'],'available':this[_0x120b('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x120b('0x8')],'paused':this['paused'],'waiting':this[_0x120b('0xe')]};var _0x17f0e1=md5(JSON[_0x120b('0x19')](_0x52564e));if(this['md5']!==_0x17f0e1){this[_0x120b('0x1')]=_0x17f0e1;io['to'](util[_0x120b('0x1a')]('mail:queue:%s',_0x52564e[_0x120b('0x8')]))[_0x120b('0x1b')](_0x120b('0x1c'),_0x52564e);}};module[_0x120b('0x1d')]=MailQueue; \ No newline at end of file +var _0x3ff3=['stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','redis','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','paused','length','online','mailPause','available'];(function(_0xd165a5,_0x1dbc64){var _0x4a8741=function(_0x576625){while(--_0x576625){_0xd165a5['push'](_0xd165a5['shift']());}};_0x4a8741(++_0x1dbc64);}(_0x3ff3,0x132));var _0x33ff=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3ff3[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x33ff('0x0'));var md5=require(_0x33ff('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x33ff('0x2')]=_['defaults'](config[_0x33ff('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33ff('0x2')]));function MailQueue(_0x4282e9){this['id']=_0x4282e9['id']||0x0;this[_0x33ff('0x3')]=_0x4282e9[_0x33ff('0x3')]||'';this[_0x33ff('0x4')]=_0x4282e9['timeout']||0xa;this[_0x33ff('0x5')]=_0x4282e9[_0x33ff('0x5')]||'beepall';this[_0x33ff('0x6')]=_0x4282e9['Agents'];this['mapAgentsId']={};this[_0x33ff('0x7')]=0x0;this['md5']='';this[_0x33ff('0x8')]();this[_0x33ff('0x9')]();}MailQueue[_0x33ff('0xa')][_0x33ff('0x8')]=function(){var _0x3907c3=this[_0x33ff('0xb')]['_rr'];this[_0x33ff('0xb')]=_[_0x33ff('0xc')](this[_0x33ff('0x6')],'id');this[_0x33ff('0xb')]['_rr']=_0x3907c3;};MailQueue[_0x33ff('0xa')]['updateRealtime']=function(){this[_0x33ff('0xd')]=0x0;this[_0x33ff('0xe')]=0x0;for(var _0x2d2111=0x0;_0x2d2111=0x0?this[_0x33ff('0x12')]:0x0;var _0x46ad1c={'id':this['id'],'available':this[_0x33ff('0x12')],'loggedIn':this[_0x33ff('0xd')],'name':this[_0x33ff('0x3')],'paused':this[_0x33ff('0xe')],'waiting':this['waiting']};var _0x3158d8=md5(JSON[_0x33ff('0x13')](_0x46ad1c));if(this[_0x33ff('0x1')]!==_0x3158d8){this[_0x33ff('0x1')]=_0x3158d8;io['to'](util[_0x33ff('0x14')](_0x33ff('0x15'),_0x46ad1c[_0x33ff('0x3')]))[_0x33ff('0x16')](_0x33ff('0x17'),_0x46ad1c);}};module[_0x33ff('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 602d409..3790a95 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0xe6f4ef,_0x4e34cc){var _0x4f3447=function(_0x1538ff){while(--_0x1538ff){_0xe6f4ef['push'](_0xe6f4ef['shift']());}};_0x4f3447(++_0x4e34cc);}(_0xadb5,0xad));var _0x5adb=function(_0x5a3eaf,_0x18c9e0){_0x5a3eaf=_0x5a3eaf-0x0;var _0xab5e8c=_0xadb5[_0x5a3eaf];return _0xab5e8c;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x30e618,_0x8b2127){var _0x2d5393=function(_0x3fca04){while(--_0x3fca04){_0x30e618['push'](_0x30e618['shift']());}};_0x2d5393(++_0x8b2127);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x5fc3[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('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 f1a4495..8cd5f51 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 _0xed95=['stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','loggedIn','paused','length','available','name'];(function(_0x1ae250,_0xf9b815){var _0x2cd60f=function(_0x27214a){while(--_0x27214a){_0x1ae250['push'](_0x1ae250['shift']());}};_0x2cd60f(++_0xf9b815);}(_0xed95,0xb9));var _0x5ed9=function(_0x5e4980,_0x691712){_0x5e4980=_0x5e4980-0x0;var _0x55d652=_0xed95[_0x5e4980];return _0x55d652;};'use strict';var _=require(_0x5ed9('0x0'));var md5=require(_0x5ed9('0x1'));var util=require(_0x5ed9('0x2'));var Redis=require(_0x5ed9('0x3'));var config=require(_0x5ed9('0x4'));config[_0x5ed9('0x5')]=_[_0x5ed9('0x6')](config[_0x5ed9('0x5')],{'host':_0x5ed9('0x7'),'port':0x18eb});var io=require(_0x5ed9('0x8'))(new Redis(config[_0x5ed9('0x5')]));function SmsQueue(_0x15b734){this['id']=_0x15b734['id']||0x0;this['name']=_0x15b734['name']||'';this[_0x5ed9('0x9')]=_0x15b734[_0x5ed9('0x9')]||0xa;this[_0x5ed9('0xa')]=_0x15b734[_0x5ed9('0xa')]||_0x5ed9('0xb');this[_0x5ed9('0xc')]=_0x15b734['Agents'];this['mapAgentsId']={};this[_0x5ed9('0xd')]=0x0;this[_0x5ed9('0x1')]='';this[_0x5ed9('0xe')]();this[_0x5ed9('0xf')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x28e087=this[_0x5ed9('0x10')][_0x5ed9('0x11')];this[_0x5ed9('0x10')]=_['map'](this[_0x5ed9('0xc')],'id');this[_0x5ed9('0x10')][_0x5ed9('0x11')]=_0x28e087;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x5ed9('0x12')]=0x0;this[_0x5ed9('0x13')]=0x0;for(var _0x5e952c=0x0;_0x5e952c=0x0?this['available']:0x0;var _0x5a3ac1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5ed9('0x12')],'name':this[_0x5ed9('0x16')],'paused':this[_0x5ed9('0x13')],'waiting':this[_0x5ed9('0xd')]};var _0x4b510b=md5(JSON[_0x5ed9('0x17')](_0x5a3ac1));if(this[_0x5ed9('0x1')]!==_0x4b510b){this['md5']=_0x4b510b;io['to'](util['format']('sms:queue:%s',_0x5a3ac1[_0x5ed9('0x16')]))[_0x5ed9('0x18')]('sms_queue:save',_0x5a3ac1);}};module[_0x5ed9('0x19')]=SmsQueue; \ No newline at end of file +var _0x0ba7=['name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr','loggedIn','length','online','smsPause','paused','available','waiting','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x55a79d,_0x161918){var _0x96531a=function(_0x32f398){while(--_0x32f398){_0x55a79d['push'](_0x55a79d['shift']());}};_0x96531a(++_0x161918);}(_0x0ba7,0x16d));var _0x70ba=function(_0x54f2d7,_0x2636c0){_0x54f2d7=_0x54f2d7-0x0;var _0x374526=_0x0ba7[_0x54f2d7];return _0x374526;};'use strict';var _=require(_0x70ba('0x0'));var md5=require('md5');var util=require(_0x70ba('0x1'));var Redis=require(_0x70ba('0x2'));var config=require(_0x70ba('0x3'));config[_0x70ba('0x4')]=_['defaults'](config[_0x70ba('0x4')],{'host':_0x70ba('0x5'),'port':0x18eb});var io=require(_0x70ba('0x6'))(new Redis(config[_0x70ba('0x4')]));function SmsQueue(_0x481a4c){this['id']=_0x481a4c['id']||0x0;this[_0x70ba('0x7')]=_0x481a4c[_0x70ba('0x7')]||'';this[_0x70ba('0x8')]=_0x481a4c[_0x70ba('0x8')]||0xa;this[_0x70ba('0x9')]=_0x481a4c[_0x70ba('0x9')]||_0x70ba('0xa');this[_0x70ba('0xb')]=_0x481a4c[_0x70ba('0xb')];this[_0x70ba('0xc')]={};this['waiting']=0x0;this[_0x70ba('0xd')]='';this['updateRouting']();this[_0x70ba('0xe')]();}SmsQueue[_0x70ba('0xf')][_0x70ba('0x10')]=function(){var _0x3cf8ab=this['mapAgentsId']['_rr'];this[_0x70ba('0xc')]=_['map'](this[_0x70ba('0xb')],'id');this['mapAgentsId'][_0x70ba('0x11')]=_0x3cf8ab;};SmsQueue[_0x70ba('0xf')]['updateRealtime']=function(){this[_0x70ba('0x12')]=0x0;this['paused']=0x0;for(var _0x51321d=0x0;_0x51321d=0x0?this['available']:0x0;var _0x5dad2d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x70ba('0x12')],'name':this[_0x70ba('0x7')],'paused':this[_0x70ba('0x16')],'waiting':this[_0x70ba('0x18')]};var _0x43caa4=md5(JSON[_0x70ba('0x19')](_0x5dad2d));if(this[_0x70ba('0xd')]!==_0x43caa4){this[_0x70ba('0xd')]=_0x43caa4;io['to'](util[_0x70ba('0x1a')](_0x70ba('0x1b'),_0x5dad2d[_0x70ba('0x7')]))[_0x70ba('0x1c')](_0x70ba('0x1d'),_0x5dad2d);}};module[_0x70ba('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 09d377f..c8ce9a7 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80d2=['_rr','map','Agents','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','prototype','mapAgentsId'];(function(_0x52f73c,_0x3c9d42){var _0x2ea27a=function(_0x23d805){while(--_0x23d805){_0x52f73c['push'](_0x52f73c['shift']());}};_0x2ea27a(++_0x3c9d42);}(_0x80d2,0x14d));var _0x280d=function(_0x1e3328,_0x5a5efa){_0x1e3328=_0x1e3328-0x0;var _0x236314=_0x80d2[_0x1e3328];return _0x236314;};'use strict';var _=require(_0x280d('0x0'));var md5=require(_0x280d('0x1'));var util=require(_0x280d('0x2'));var Redis=require(_0x280d('0x3'));var config=require('../../../config/environment');config[_0x280d('0x4')]=_[_0x280d('0x5')](config[_0x280d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x280d('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x297534){this['id']=_0x297534['id']||0x0;this['name']=_0x297534['name']||'';this[_0x280d('0x7')]=_0x297534['timeout']||0xa;this['strategy']=_0x297534[_0x280d('0x8')]||_0x280d('0x9');this['Agents']=_0x297534['Agents'];this['mapAgentsId']={};this[_0x280d('0xa')]=0x0;this[_0x280d('0x1')]='';this[_0x280d('0xb')]();this[_0x280d('0xc')]();}WhatsappQueue[_0x280d('0xd')]['updateRouting']=function(){var _0x28489b=this[_0x280d('0xe')][_0x280d('0xf')];this['mapAgentsId']=_[_0x280d('0x10')](this[_0x280d('0x11')],'id');this[_0x280d('0xe')][_0x280d('0xf')]=_0x28489b;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x280d('0x12')]=0x0;this[_0x280d('0x13')]=0x0;for(var _0x5f41c2=0x0;_0x5f41c2=0x0?this[_0x280d('0x17')]:0x0;var _0x24bf27={'id':this['id'],'available':this[_0x280d('0x17')],'loggedIn':this[_0x280d('0x12')],'name':this['name'],'paused':this[_0x280d('0x13')],'waiting':this[_0x280d('0xa')]};var _0x4278ad=md5(JSON[_0x280d('0x18')](_0x24bf27));if(this[_0x280d('0x1')]!==_0x4278ad){this[_0x280d('0x1')]=_0x4278ad;io['to'](util['format'](_0x280d('0x19'),_0x24bf27['name']))[_0x280d('0x1a')](_0x280d('0x1b'),_0x24bf27);}};module[_0x280d('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x24ac=['md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash'];(function(_0x3ff49d,_0x183123){var _0x3262ba=function(_0x4be357){while(--_0x4be357){_0x3ff49d['push'](_0x3ff49d['shift']());}};_0x3262ba(++_0x183123);}(_0x24ac,0x187));var _0xc24a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc24a('0x0'));var md5=require(_0xc24a('0x1'));var util=require(_0xc24a('0x2'));var Redis=require('ioredis');var config=require(_0xc24a('0x3'));config[_0xc24a('0x4')]=_['defaults'](config[_0xc24a('0x4')],{'host':_0xc24a('0x5'),'port':0x18eb});var io=require(_0xc24a('0x6'))(new Redis(config[_0xc24a('0x4')]));function WhatsappQueue(_0xb8049a){this['id']=_0xb8049a['id']||0x0;this['name']=_0xb8049a[_0xc24a('0x7')]||'';this[_0xc24a('0x8')]=_0xb8049a[_0xc24a('0x8')]||0xa;this[_0xc24a('0x9')]=_0xb8049a[_0xc24a('0x9')]||'beepall';this['Agents']=_0xb8049a[_0xc24a('0xa')];this[_0xc24a('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xc24a('0xc')]();this['updateRealtime']();}WhatsappQueue[_0xc24a('0xd')]['updateRouting']=function(){var _0x3f8d64=this['mapAgentsId'][_0xc24a('0xe')];this['mapAgentsId']=_[_0xc24a('0xf')](this['Agents'],'id');this['mapAgentsId'][_0xc24a('0xe')]=_0x3f8d64;};WhatsappQueue[_0xc24a('0xd')][_0xc24a('0x10')]=function(){this[_0xc24a('0x11')]=0x0;this['paused']=0x0;for(var _0x49a481=0x0;_0x49a481=0x0?this[_0xc24a('0x15')]:0x0;var _0x8228b={'id':this['id'],'available':this[_0xc24a('0x15')],'loggedIn':this[_0xc24a('0x11')],'name':this[_0xc24a('0x7')],'paused':this[_0xc24a('0x14')],'waiting':this['waiting']};var _0x1a923d=md5(JSON[_0xc24a('0x16')](_0x8228b));if(this[_0xc24a('0x1')]!==_0x1a923d){this['md5']=_0x1a923d;io['to'](util[_0xc24a('0x17')](_0xc24a('0x18'),_0x8228b[_0xc24a('0x7')]))[_0xc24a('0x19')](_0xc24a('0x1a'),_0x8228b);}};module[_0xc24a('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 39570c4..1c1543c 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4f92bc,_0x53a24d){var _0x2a64be=function(_0x29ad3d){while(--_0x29ad3d){_0x4f92bc['push'](_0x4f92bc['shift']());}};_0x2a64be(++_0x53a24d);}(_0xb10b,0x12a));var _0xbb10=function(_0x163157,_0x59eea5){_0x163157=_0x163157-0x0;var _0x3db535=_0xb10b[_0x163157];return _0x3db535;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index b194424..addbc24 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 _0x7744=['update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x7744,0xd9));var _0x4774=function(_0x88a523,_0x4c930c){_0x88a523=_0x88a523-0x0;var _0x3deebf=_0x7744[_0x88a523];return _0x3deebf;};'use strict';var client=require('../client');exports[_0x4774('0x0')]=function(_0x5f0040,_0x45437a){return client['Request'](_0x4774('0x1'),{'body':_0x45437a,'options':{'where':{'id':_0x5f0040}},'log':_0x4774('0x2')});};exports[_0x4774('0x3')]=function(_0x582b3d,_0x38b53a){return client[_0x4774('0x4')](_0x4774('0x5'),{'body':_0x38b53a,'options':{'where':{'id':_0x582b3d}},'log':_0x4774('0x6')});}; \ No newline at end of file +var _0xda26=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','addTags'];(function(_0x174a2d,_0x44cf92){var _0x3a58c3=function(_0x43afaf){while(--_0x43afaf){_0x174a2d['push'](_0x174a2d['shift']());}};_0x3a58c3(++_0x44cf92);}(_0xda26,0xc2));var _0x6da2=function(_0x2de386,_0x384f51){_0x2de386=_0x2de386-0x0;var _0x51c6de=_0xda26[_0x2de386];return _0x51c6de;};'use strict';var client=require(_0x6da2('0x0'));exports[_0x6da2('0x1')]=function(_0x1f680c,_0x115800){return client[_0x6da2('0x2')]('UpdateChatInteraction',{'body':_0x115800,'options':{'where':{'id':_0x1f680c}},'log':'updateChatInteraction'});};exports[_0x6da2('0x3')]=function(_0x568514,_0x33908f){return client['Request'](_0x6da2('0x4'),{'body':_0x33908f,'options':{'where':{'id':_0x568514}},'log':_0x6da2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 61c2be6..1595bc5 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 _0x462b=['../client','create','createChatMessage'];(function(_0x1c6bb9,_0x3da46d){var _0x250a79=function(_0x52b87b){while(--_0x52b87b){_0x1c6bb9['push'](_0x1c6bb9['shift']());}};_0x250a79(++_0x3da46d);}(_0x462b,0x78));var _0xb462=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x462b[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xb462('0x0'));exports[_0xb462('0x1')]=function(_0x52a12f){return client['Request']('CreateChatMessage',{'body':_0x52a12f,'log':_0xb462('0x2')});}; \ No newline at end of file +var _0xe64b=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe64b,0x9e));var _0xbe64=function(_0x178d4d,_0x414d18){_0x178d4d=_0x178d4d-0x0;var _0x15810b=_0xe64b[_0x178d4d];return _0x15810b;};'use strict';var client=require(_0xbe64('0x0'));exports[_0xbe64('0x1')]=function(_0x11a2c2){return client[_0xbe64('0x2')](_0xbe64('0x3'),{'body':_0x11a2c2,'log':_0xbe64('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9cf0aa3..669b9f7 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 _0x008c=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','strategy','User','Agents'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x008c,0x188));var _0xc008=function(_0x226879,_0x30a56b){_0x226879=_0x226879-0x0;var _0x20964c=_0x008c[_0x226879];return _0x20964c;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(){return function(){return client[_0xc008('0x2')](_0xc008('0x3'),{'options':{'raw':![],'attributes':['id',_0xc008('0x4'),'timeout',_0xc008('0x5')],'include':[{'model':_0xc008('0x6'),'as':_0xc008('0x7'),'attributes':['id',_0xc008('0x4'),_0xc008('0x8'),_0xc008('0x9')]}]},'log':_0xc008('0x1')});};}; \ No newline at end of file +var _0xc18a=['chatPause','../client','getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','name','online'];(function(_0x2a2e72,_0x1de962){var _0x3cfb4a=function(_0x3d435c){while(--_0x3d435c){_0x2a2e72['push'](_0x2a2e72['shift']());}};_0x3cfb4a(++_0x1de962);}(_0xc18a,0x1cf));var _0xac18=function(_0x1bc29e,_0x48ca67){_0x1bc29e=_0x1bc29e-0x0;var _0x3e49a2=_0xc18a[_0x1bc29e];return _0x3e49a2;};'use strict';var client=require(_0xac18('0x0'));exports[_0xac18('0x1')]=function(){return function(){return client[_0xac18('0x2')](_0xac18('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xac18('0x4'),_0xac18('0x5')],'include':[{'model':_0xac18('0x6'),'as':_0xac18('0x7'),'attributes':['id',_0xac18('0x8'),_0xac18('0x9'),_0xac18('0xa')]}]},'log':_0xac18('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 52121fa..6fc2e89 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 _0xf257=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf257,0x82));var _0x7f25=function(_0x47b37e,_0x5afb98){_0x47b37e=_0x47b37e-0x0;var _0x1c1eb9=_0xf257[_0x47b37e];return _0x1c1eb9;};'use strict';var client=require('../client');exports['create']=function(_0x259e06){return client[_0x7f25('0x0')](_0x7f25('0x1'),{'body':_0x259e06,'log':_0x7f25('0x1')});};exports['update']=function(_0x159dd1,_0x2aca61){return client[_0x7f25('0x0')](_0x7f25('0x2'),{'body':_0x2aca61,'options':{'where':{'uniqueid':_0x159dd1},'order':[['id',_0x7f25('0x3')]],'limit':0x1},'log':_0x7f25('0x2')});}; \ No newline at end of file +var _0x04de=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client'];(function(_0x1a0d48,_0x2a76f8){var _0x4a2941=function(_0xec6bc3){while(--_0xec6bc3){_0x1a0d48['push'](_0x1a0d48['shift']());}};_0x4a2941(++_0x2a76f8);}(_0x04de,0x107));var _0xe04d=function(_0x856343,_0x550f33){_0x856343=_0x856343-0x0;var _0x2f7b16=_0x04de[_0x856343];return _0x2f7b16;};'use strict';var client=require(_0xe04d('0x0'));exports[_0xe04d('0x1')]=function(_0x398778){return client[_0xe04d('0x2')](_0xe04d('0x3'),{'body':_0x398778,'log':_0xe04d('0x3')});};exports[_0xe04d('0x4')]=function(_0x43c4b1,_0x2593a4){return client[_0xe04d('0x2')](_0xe04d('0x5'),{'body':_0x2593a4,'options':{'where':{'uniqueid':_0x43c4b1},'order':[['id','DESC']],'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 15d8cc3..c514e88 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x7a54,0x106));var _0x47a5=function(_0x48358e,_0x5bdf26){_0x48358e=_0x48358e-0x0;var _0x54b0c4=_0x7a54[_0x48358e];return _0x54b0c4;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3d8cac,_0x5d448b){var _0x56f397=function(_0x110e1a){while(--_0x110e1a){_0x3d8cac['push'](_0x3d8cac['shift']());}};_0x56f397(++_0x5d448b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index c537373..2896141 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 _0xb171=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb171,0xc3));var _0x1b17=function(_0x1c3bdc,_0x260648){_0x1c3bdc=_0x1c3bdc-0x0;var _0x3bbb8c=_0xb171[_0x1c3bdc];return _0x3bbb8c;};'use strict';var client=require('../client');exports[_0x1b17('0x0')]=function(_0x94018d){return client[_0x1b17('0x1')](_0x1b17('0x2'),{'body':_0x94018d,'log':_0x1b17('0x3')});}; \ No newline at end of file +var _0x1476=['../client','createFaxMessage'];(function(_0x1d24c7,_0x394fab){var _0x4baed5=function(_0x5d9240){while(--_0x5d9240){_0x1d24c7['push'](_0x1d24c7['shift']());}};_0x4baed5(++_0x394fab);}(_0x1476,0x7c));var _0x6147=function(_0x1f00f7,_0x22ee8e){_0x1f00f7=_0x1f00f7-0x0;var _0x53b3e1=_0x1476[_0x1f00f7];return _0x53b3e1;};'use strict';var client=require(_0x6147('0x0'));exports['create']=function(_0x95df7f){return client['Request']('CreateFaxMessage',{'body':_0x95df7f,'log':_0x6147('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6948723..c07dac0 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 _0x33ee=['faxPause','getFaxQueues','../client','GetFaxQueue','name','timeout','strategy','Agents','online'];(function(_0x465134,_0xed60ce){var _0x39f39b=function(_0x590ff3){while(--_0x590ff3){_0x465134['push'](_0x465134['shift']());}};_0x39f39b(++_0xed60ce);}(_0x33ee,0xfe));var _0xe33e=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x33ee[_0x2b9b7f];return _0x4ed19a;};'use strict';var client=require(_0xe33e('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0xe33e('0x1'),{'options':{'raw':![],'attributes':['id',_0xe33e('0x2'),_0xe33e('0x3'),_0xe33e('0x4')],'include':[{'model':'User','as':_0xe33e('0x5'),'attributes':['id',_0xe33e('0x2'),_0xe33e('0x6'),_0xe33e('0x7')]}]},'log':_0xe33e('0x8')});};}; \ No newline at end of file +var _0x7aa2=['online','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','User','Agents'];(function(_0x133c35,_0x2226ae){var _0x1e93fa=function(_0x478626){while(--_0x478626){_0x133c35['push'](_0x133c35['shift']());}};_0x1e93fa(++_0x2226ae);}(_0x7aa2,0x172));var _0x27aa=function(_0x2a0099,_0x4cf712){_0x2a0099=_0x2a0099-0x0;var _0x2d4237=_0x7aa2[_0x2a0099];return _0x2d4237;};'use strict';var client=require(_0x27aa('0x0'));exports[_0x27aa('0x1')]=function(){return function(){return client[_0x27aa('0x2')](_0x27aa('0x3'),{'options':{'raw':![],'attributes':['id',_0x27aa('0x4'),_0x27aa('0x5'),'strategy'],'include':[{'model':_0x27aa('0x6'),'as':_0x27aa('0x7'),'attributes':['id','name',_0x27aa('0x8'),'faxPause']}]},'log':_0x27aa('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 70b4dc0..ccd8e86 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 _0x83ea=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','../client'];(function(_0x5cb63b,_0x54bed5){var _0x4e58b6=function(_0xab13cc){while(--_0xab13cc){_0x5cb63b['push'](_0x5cb63b['shift']());}};_0x4e58b6(++_0x54bed5);}(_0x83ea,0x158));var _0xa83e=function(_0x2bfbe3,_0xee1735){_0x2bfbe3=_0x2bfbe3-0x0;var _0x32feff=_0x83ea[_0x2bfbe3];return _0x32feff;};'use strict';var client=require(_0xa83e('0x0'));exports[_0xa83e('0x1')]=function(_0x4916d3){return client[_0xa83e('0x2')](_0xa83e('0x3'),{'body':_0x4916d3,'log':_0xa83e('0x3')});};exports['update']=function(_0x38dc58,_0x47e1ac){return client[_0xa83e('0x2')]('UpdateFaxQueueReport',{'body':_0x47e1ac,'options':{'where':{'uniqueid':_0x38dc58},'order':[['id','DESC']],'limit':0x1},'log':_0xa83e('0x4')});}; \ No newline at end of file +var _0x2534=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x5cf76b,_0xfbf968){var _0x50d61f=function(_0x5a4bd0){while(--_0x5a4bd0){_0x5cf76b['push'](_0x5cf76b['shift']());}};_0x50d61f(++_0xfbf968);}(_0x2534,0xb6));var _0x4253=function(_0xacb212,_0x2f052a){_0xacb212=_0xacb212-0x0;var _0x4f4926=_0x2534[_0xacb212];return _0x4f4926;};'use strict';var client=require(_0x4253('0x0'));exports[_0x4253('0x1')]=function(_0x5943db){return client[_0x4253('0x2')](_0x4253('0x3'),{'body':_0x5943db,'log':_0x4253('0x3')});};exports[_0x4253('0x4')]=function(_0x435c7f,_0x6e7e99){return client[_0x4253('0x2')](_0x4253('0x5'),{'body':_0x6e7e99,'options':{'where':{'uniqueid':_0x435c7f},'order':[['id',_0x4253('0x6')]],'limit':0x1},'log':_0x4253('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 907eb3c..b237f3c 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 _0x5325=['getIntervals','../client','Request','GetInterval','name','Interval','interval'];(function(_0x514816,_0x57c091){var _0x5c3a43=function(_0xd4a413){while(--_0xd4a413){_0x514816['push'](_0x514816['shift']());}};_0x5c3a43(++_0x57c091);}(_0x5325,0x8d));var _0x5532=function(_0x332630,_0x23dbf9){_0x332630=_0x332630-0x0;var _0x5d754a=_0x5325[_0x332630];return _0x5d754a;};'use strict';var client=require(_0x5532('0x0'));exports['getIntervals']=function(){return function(){return client[_0x5532('0x1')](_0x5532('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5532('0x3')],'include':[{'model':_0x5532('0x4'),'as':'Intervals','attributes':['id',_0x5532('0x3'),_0x5532('0x5')]}]},'log':_0x5532('0x6')});};}; \ No newline at end of file +var _0xadc4=['Request','GetInterval','name','Interval','Intervals','interval','getIntervals'];(function(_0x2569b1,_0x3b9d6e){var _0x28f324=function(_0x2e0162){while(--_0x2e0162){_0x2569b1['push'](_0x2569b1['shift']());}};_0x28f324(++_0x3b9d6e);}(_0xadc4,0xee));var _0x4adc=function(_0x4ec028,_0x3583b4){_0x4ec028=_0x4ec028-0x0;var _0x2ad670=_0xadc4[_0x4ec028];return _0x2ad670;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x4adc('0x0')](_0x4adc('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4adc('0x2')],'include':[{'model':_0x4adc('0x3'),'as':_0x4adc('0x4'),'attributes':['id',_0x4adc('0x2'),_0x4adc('0x5')]}]},'log':_0x4adc('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 411fc7c..2e0e21d 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 _0x1893=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x36005e,_0x100293){var _0x5dfb56=function(_0x5c94fd){while(--_0x5c94fd){_0x36005e['push'](_0x36005e['shift']());}};_0x5dfb56(++_0x100293);}(_0x1893,0xa2));var _0x3189=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1893[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports['update']=function(_0x1bfe8b,_0x3aec2b){return client[_0x3189('0x0')](_0x3189('0x1'),{'body':_0x3aec2b,'options':{'where':{'id':_0x1bfe8b}},'log':_0x3189('0x2')});};exports[_0x3189('0x3')]=function(_0x3953a2,_0x5371db){return client[_0x3189('0x0')](_0x3189('0x4'),{'body':_0x5371db,'options':{'where':{'id':_0x3953a2}},'log':_0x3189('0x5')});}; \ No newline at end of file +var _0x7d25=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7d25,0x8a));var _0x57d2=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x7d25[_0x36884e];return _0x1cc367;};'use strict';var client=require('../client');exports[_0x57d2('0x0')]=function(_0x1537a7,_0x35bca8){return client[_0x57d2('0x1')](_0x57d2('0x2'),{'body':_0x35bca8,'options':{'where':{'id':_0x1537a7}},'log':_0x57d2('0x3')});};exports[_0x57d2('0x4')]=function(_0x5c1baa,_0x5337ca){return client['Request']('AddTagsToMailInteraction',{'body':_0x5337ca,'options':{'where':{'id':_0x5c1baa}},'log':_0x57d2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c5da4ab..cebd0dc 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 _0xc77e=['CreateMailMessage','../client','create'];(function(_0x481f30,_0xf7326b){var _0x65bc7d=function(_0x20655c){while(--_0x20655c){_0x481f30['push'](_0x481f30['shift']());}};_0x65bc7d(++_0xf7326b);}(_0xc77e,0x7c));var _0xec77=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc77e[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0xec77('0x0'));exports[_0xec77('0x1')]=function(_0x21420b){return client['Request'](_0xec77('0x2'),{'body':_0x21420b,'log':'createMailMessage'});}; \ No newline at end of file +var _0xd7e7=['Request','CreateMailMessage','createMailMessage','create'];(function(_0x23a135,_0xf83678){var _0x585bc3=function(_0xa4fc95){while(--_0xa4fc95){_0x23a135['push'](_0x23a135['shift']());}};_0x585bc3(++_0xf83678);}(_0xd7e7,0x17f));var _0x7d7e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd7e7[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports[_0x7d7e('0x0')]=function(_0x2aa48f){return client[_0x7d7e('0x1')](_0x7d7e('0x2'),{'body':_0x2aa48f,'log':_0x7d7e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index fe519d7..8a29edb 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 _0x2c20=['GetMailQueue','name','strategy','User','Agents','mailPause','../client','getMailQueues'];(function(_0x3b4020,_0x200bfd){var _0x3372a0=function(_0x332b60){while(--_0x332b60){_0x3b4020['push'](_0x3b4020['shift']());}};_0x3372a0(++_0x200bfd);}(_0x2c20,0x1ae));var _0x02c2=function(_0x1af80e,_0x8a8525){_0x1af80e=_0x1af80e-0x0;var _0x347585=_0x2c20[_0x1af80e];return _0x347585;};'use strict';var client=require(_0x02c2('0x0'));exports[_0x02c2('0x1')]=function(){return function(){return client['Request'](_0x02c2('0x2'),{'options':{'raw':![],'attributes':['id',_0x02c2('0x3'),'timeout',_0x02c2('0x4')],'include':[{'model':_0x02c2('0x5'),'as':_0x02c2('0x6'),'attributes':['id',_0x02c2('0x3'),'online',_0x02c2('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x25e4=['strategy','User','Agents','getMailQueues','../client','Request','GetMailQueue','name','timeout'];(function(_0x522150,_0x2203cc){var _0x5dcac0=function(_0x3310cc){while(--_0x3310cc){_0x522150['push'](_0x522150['shift']());}};_0x5dcac0(++_0x2203cc);}(_0x25e4,0x112));var _0x425e=function(_0x2e94c8,_0x277b29){_0x2e94c8=_0x2e94c8-0x0;var _0x14a828=_0x25e4[_0x2e94c8];return _0x14a828;};'use strict';var client=require(_0x425e('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x425e('0x1')](_0x425e('0x2'),{'options':{'raw':![],'attributes':['id',_0x425e('0x3'),_0x425e('0x4'),_0x425e('0x5')],'include':[{'model':_0x425e('0x6'),'as':_0x425e('0x7'),'attributes':['id','name','online','mailPause']}]},'log':_0x425e('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index ccd33a7..379b7e6 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 _0xe8f0=['DESC','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0xe8f0,0x66));var _0x0e8f=function(_0x339053,_0x2039a0){_0x339053=_0x339053-0x0;var _0x570f45=_0xe8f0[_0x339053];return _0x570f45;};'use strict';var client=require('../client');exports[_0x0e8f('0x0')]=function(_0x49d07c){return client[_0x0e8f('0x1')](_0x0e8f('0x2'),{'body':_0x49d07c,'log':_0x0e8f('0x2')});};exports['update']=function(_0x15568d,_0x3f23c6){return client[_0x0e8f('0x1')]('UpdateMailQueueReport',{'body':_0x3f23c6,'options':{'where':{'uniqueid':_0x15568d},'order':[['id',_0x0e8f('0x3')]],'limit':0x1},'log':_0x0e8f('0x4')});}; \ No newline at end of file +var _0x3738=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','Request'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x3738,0x1d4));var _0x8373=function(_0x46cc9e,_0x51a09c){_0x46cc9e=_0x46cc9e-0x0;var _0x2afb41=_0x3738[_0x46cc9e];return _0x2afb41;};'use strict';var client=require(_0x8373('0x0'));exports['create']=function(_0x130d53){return client[_0x8373('0x1')](_0x8373('0x2'),{'body':_0x130d53,'log':_0x8373('0x2')});};exports[_0x8373('0x3')]=function(_0x4b361d,_0x19fef3){return client[_0x8373('0x1')](_0x8373('0x4'),{'body':_0x19fef3,'options':{'where':{'uniqueid':_0x4b361d},'order':[['id','DESC']],'limit':0x1},'log':_0x8373('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b386889..b2a0bdb 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 _0x41ac=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','UpdateOpenchannelInteraction'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x41ac,0x8a));var _0xc41a=function(_0x51d8bf,_0x575a5b){_0x51d8bf=_0x51d8bf-0x0;var _0x3f06fd=_0x41ac[_0x51d8bf];return _0x3f06fd;};'use strict';var client=require(_0xc41a('0x0'));exports['update']=function(_0x11e9f5,_0xae08c9){return client['Request'](_0xc41a('0x1'),{'body':_0xae08c9,'options':{'where':{'id':_0x11e9f5}},'log':_0xc41a('0x2')});};exports[_0xc41a('0x3')]=function(_0x1ba86b,_0xadecc6){return client[_0xc41a('0x4')](_0xc41a('0x5'),{'body':_0xadecc6,'options':{'where':{'id':_0x1ba86b}},'log':_0xc41a('0x6')});}; \ No newline at end of file +var _0xff8b=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff8b,0xa8));var _0xbff8=function(_0x4ac047,_0x2ba116){_0x4ac047=_0x4ac047-0x0;var _0x254c04=_0xff8b[_0x4ac047];return _0x254c04;};'use strict';var client=require(_0xbff8('0x0'));exports[_0xbff8('0x1')]=function(_0xc702a,_0x5a5401){return client[_0xbff8('0x2')](_0xbff8('0x3'),{'body':_0x5a5401,'options':{'where':{'id':_0xc702a}},'log':_0xbff8('0x4')});};exports[_0xbff8('0x5')]=function(_0x3893c5,_0x571283){return client['Request'](_0xbff8('0x6'),{'body':_0x571283,'options':{'where':{'id':_0x3893c5}},'log':_0xbff8('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 00ebbef..89d7a3d 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 _0xf4a2=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xf4a2,0x144));var _0x2f4a=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xf4a2[_0x446208];return _0xe49563;};'use strict';var client=require(_0x2f4a('0x0'));exports[_0x2f4a('0x1')]=function(_0x2bde25){return client[_0x2f4a('0x2')](_0x2f4a('0x3'),{'body':_0x2bde25,'log':_0x2f4a('0x4')});}; \ No newline at end of file +var _0xa3c1=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa3c1,0xd7));var _0x1a3c=function(_0x241e1d,_0x31f708){_0x241e1d=_0x241e1d-0x0;var _0x426868=_0xa3c1[_0x241e1d];return _0x426868;};'use strict';var client=require('../client');exports[_0x1a3c('0x0')]=function(_0x598657){return client[_0x1a3c('0x1')](_0x1a3c('0x2'),{'body':_0x598657,'log':_0x1a3c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b468de8..69c8cf9 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 _0x0482=['name','timeout','strategy','User','online','openchannelPause','getOpenchannelQueues','../client','GetOpenchannelQueue'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0x0482,0xf1));var _0x2048=function(_0x1cd71f,_0x2a9d19){_0x1cd71f=_0x1cd71f-0x0;var _0x33d362=_0x0482[_0x1cd71f];return _0x33d362;};'use strict';var client=require(_0x2048('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x2048('0x1'),{'options':{'raw':![],'attributes':['id',_0x2048('0x2'),_0x2048('0x3'),_0x2048('0x4')],'include':[{'model':_0x2048('0x5'),'as':'Agents','attributes':['id',_0x2048('0x2'),_0x2048('0x6'),_0x2048('0x7')]}]},'log':_0x2048('0x8')});};}; \ No newline at end of file +var _0x396e=['getOpenchannelQueues','Request','name','timeout','User','Agents','online','openchannelPause'];(function(_0x3a6d64,_0x51bb92){var _0x39f2c1=function(_0x301a52){while(--_0x301a52){_0x3a6d64['push'](_0x3a6d64['shift']());}};_0x39f2c1(++_0x51bb92);}(_0x396e,0x90));var _0xe396=function(_0x4dc885,_0x483e5d){_0x4dc885=_0x4dc885-0x0;var _0x4326b9=_0x396e[_0x4dc885];return _0x4326b9;};'use strict';var client=require('../client');exports[_0xe396('0x0')]=function(){return function(){return client[_0xe396('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xe396('0x2'),_0xe396('0x3'),'strategy'],'include':[{'model':_0xe396('0x4'),'as':_0xe396('0x5'),'attributes':['id',_0xe396('0x2'),_0xe396('0x6'),_0xe396('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a0b37e6..e90fde7 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 _0xb10b=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x3eeb3c,_0x523f21){var _0x498420=function(_0x58b2a5){while(--_0x58b2a5){_0x3eeb3c['push'](_0x3eeb3c['shift']());}};_0x498420(++_0x523f21);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a4a49,_0xf73c87){_0x1a4a49=_0x1a4a49-0x0;var _0x3be8cd=_0xb10b[_0x1a4a49];return _0x3be8cd;};'use strict';var client=require(_0xbb10('0x0'));exports['create']=function(_0x390ae2){return client[_0xbb10('0x1')](_0xbb10('0x2'),{'body':_0x390ae2,'log':'CreateOpenchannelQueueReport'});};exports[_0xbb10('0x3')]=function(_0x9bbed,_0x460981){return client[_0xbb10('0x1')](_0xbb10('0x4'),{'body':_0x460981,'options':{'where':{'uniqueid':_0x9bbed},'order':[['id',_0xbb10('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xf446=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update','DESC'];(function(_0x3862e3,_0x4bc528){var _0x1a1bde=function(_0xdf86ff){while(--_0xdf86ff){_0x3862e3['push'](_0x3862e3['shift']());}};_0x1a1bde(++_0x4bc528);}(_0xf446,0xfd));var _0x6f44=function(_0x468147,_0x52533e){_0x468147=_0x468147-0x0;var _0x13de08=_0xf446[_0x468147];return _0x13de08;};'use strict';var client=require('../client');exports[_0x6f44('0x0')]=function(_0x318975){return client[_0x6f44('0x1')](_0x6f44('0x2'),{'body':_0x318975,'log':_0x6f44('0x2')});};exports[_0x6f44('0x3')]=function(_0x4c3378,_0x5796f4){return client[_0x6f44('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x5796f4,'options':{'where':{'uniqueid':_0x4c3378},'order':[['id',_0x6f44('0x4')]],'limit':0x1},'log':_0x6f44('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7fb3ca1..7e257ae 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 _0xdb13=['UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x48066a,_0x423850){var _0x2b66c1=function(_0x222015){while(--_0x222015){_0x48066a['push'](_0x48066a['shift']());}};_0x2b66c1(++_0x423850);}(_0xdb13,0x10c));var _0x3db1=function(_0x35f680,_0x34bdde){_0x35f680=_0x35f680-0x0;var _0x170dbb=_0xdb13[_0x35f680];return _0x170dbb;};'use strict';var client=require('../client');exports[_0x3db1('0x0')]=function(_0x366725,_0x38d692){return client[_0x3db1('0x1')](_0x3db1('0x2'),{'body':_0x38d692,'options':{'where':{'id':_0x366725}},'log':_0x3db1('0x3')});};exports['addTags']=function(_0x3352e3,_0x41fb5d){return client[_0x3db1('0x1')](_0x3db1('0x4'),{'body':_0x41fb5d,'options':{'where':{'id':_0x3352e3}},'log':_0x3db1('0x5')});}; \ No newline at end of file +var _0x9649=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','Request'];(function(_0x383d7a,_0x4c7ade){var _0x145b8e=function(_0x691e26){while(--_0x691e26){_0x383d7a['push'](_0x383d7a['shift']());}};_0x145b8e(++_0x4c7ade);}(_0x9649,0x19f));var _0x9964=function(_0x116f2c,_0x342097){_0x116f2c=_0x116f2c-0x0;var _0x1c71d1=_0x9649[_0x116f2c];return _0x1c71d1;};'use strict';var client=require(_0x9964('0x0'));exports[_0x9964('0x1')]=function(_0x1922f0,_0x222303){return client['Request'](_0x9964('0x2'),{'body':_0x222303,'options':{'where':{'id':_0x1922f0}},'log':_0x9964('0x3')});};exports['addTags']=function(_0x18402a,_0x4b5a66){return client[_0x9964('0x4')](_0x9964('0x5'),{'body':_0x4b5a66,'options':{'where':{'id':_0x18402a}},'log':_0x9964('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index ecc319d..79f5137 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 _0x7300=['create','Request','createSmsMessage'];(function(_0x378f5e,_0x84b9c7){var _0x6a43ed=function(_0xd80806){while(--_0xd80806){_0x378f5e['push'](_0x378f5e['shift']());}};_0x6a43ed(++_0x84b9c7);}(_0x7300,0x15f));var _0x0730=function(_0x46b301,_0x107175){_0x46b301=_0x46b301-0x0;var _0x22ffad=_0x7300[_0x46b301];return _0x22ffad;};'use strict';var client=require('../client');exports[_0x0730('0x0')]=function(_0x20ff8b){return client[_0x0730('0x1')]('CreateSmsMessage',{'body':_0x20ff8b,'log':_0x0730('0x2')});}; \ No newline at end of file +var _0xb9f6=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x42e125,_0x363f93){var _0x4ce58e=function(_0x244acc){while(--_0x244acc){_0x42e125['push'](_0x42e125['shift']());}};_0x4ce58e(++_0x363f93);}(_0xb9f6,0x86));var _0x6b9f=function(_0xdc2a38,_0x493a9d){_0xdc2a38=_0xdc2a38-0x0;var _0x210b49=_0xb9f6[_0xdc2a38];return _0x210b49;};'use strict';var client=require(_0x6b9f('0x0'));exports[_0x6b9f('0x1')]=function(_0x40f8d4){return client['Request'](_0x6b9f('0x2'),{'body':_0x40f8d4,'log':_0x6b9f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index e845cb1..438ac08 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x4c0935,_0x5a124c){var _0x1e4352=function(_0x3f3aa4){while(--_0x3f3aa4){_0x4c0935['push'](_0x4c0935['shift']());}};_0x1e4352(++_0x5a124c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0xcb6d2b,_0x1a56ac){var _0x2c3687=function(_0x1b6ed0){while(--_0x1b6ed0){_0xcb6d2b['push'](_0xcb6d2b['shift']());}};_0x2c3687(++_0x1a56ac);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d194b00..a241356 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3ec69d,_0xf8aade){var _0x394c7e=function(_0x16764b){while(--_0x16764b){_0x3ec69d['push'](_0x3ec69d['shift']());}};_0x394c7e(++_0xf8aade);}(_0x008c,0x188));var _0xc008=function(_0x20455f,_0x423034){_0x20455f=_0x20455f-0x0;var _0x185213=_0x008c[_0x20455f];return _0x185213;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4866f3,_0x556a62){var _0x7847c=function(_0x5bc5db){while(--_0x5bc5db){_0x4866f3['push'](_0x4866f3['shift']());}};_0x7847c(++_0x556a62);}(_0x70e0,0x17b));var _0x070e=function(_0x28481f,_0x3e119b){_0x28481f=_0x28481f-0x0;var _0x2e46e5=_0x70e0[_0x28481f];return _0x2e46e5;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3a0acab..282ee2d 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2fecb2,_0x40a995){var _0x3e009a=function(_0x4081c5){while(--_0x4081c5){_0x2fecb2['push'](_0x2fecb2['shift']());}};_0x3e009a(++_0x40a995);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x955365,_0x4d3c86){var _0x5e5830=function(_0x4c9cdf){while(--_0x4c9cdf){_0x955365['push'](_0x955365['shift']());}};_0x5e5830(++_0x4d3c86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 6535df8..a6d8b0d 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3831=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3831,0x14c));var _0x1383=function(_0x19a7d3,_0x487155){_0x19a7d3=_0x19a7d3-0x0;var _0x569a8e=_0x3831[_0x19a7d3];return _0x569a8e;};'use strict';var client=require(_0x1383('0x0'));exports['update']=function(_0x1c3e35,_0x42a46a){return client[_0x1383('0x1')](_0x1383('0x2'),{'body':_0x42a46a,'options':{'where':{'id':_0x1c3e35}},'log':_0x1383('0x3')});};exports['addTags']=function(_0x2fdf72,_0x573874){return client[_0x1383('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x573874,'options':{'where':{'id':_0x2fdf72}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x3f96=['update','Request','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client'];(function(_0x49e52e,_0x15f616){var _0x36a6e6=function(_0x2f7be2){while(--_0x2f7be2){_0x49e52e['push'](_0x49e52e['shift']());}};_0x36a6e6(++_0x15f616);}(_0x3f96,0x1d3));var _0x63f9=function(_0xf859d,_0x3378a1){_0xf859d=_0xf859d-0x0;var _0x57c14f=_0x3f96[_0xf859d];return _0x57c14f;};'use strict';var client=require(_0x63f9('0x0'));exports[_0x63f9('0x1')]=function(_0x3c7b05,_0x1feae5){return client[_0x63f9('0x2')]('UpdateWhatsappInteraction',{'body':_0x1feae5,'options':{'where':{'id':_0x3c7b05}},'log':_0x63f9('0x3')});};exports[_0x63f9('0x4')]=function(_0x859291,_0x26ff58){return client[_0x63f9('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x26ff58,'options':{'where':{'id':_0x859291}},'log':_0x63f9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 063c839..d641da1 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42ca=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1067cb,_0x21d610){var _0x2fa954=function(_0x5effe4){while(--_0x5effe4){_0x1067cb['push'](_0x1067cb['shift']());}};_0x2fa954(++_0x21d610);}(_0x42ca,0x138));var _0xa42c=function(_0x54c191,_0x4a04ef){_0x54c191=_0x54c191-0x0;var _0x40ee4a=_0x42ca[_0x54c191];return _0x40ee4a;};'use strict';var client=require(_0xa42c('0x0'));exports['create']=function(_0x47fd65){return client[_0xa42c('0x1')](_0xa42c('0x2'),{'body':_0x47fd65,'log':_0xa42c('0x3')});}; \ No newline at end of file +var _0xdcc7=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x5a0bab,_0x168def){var _0x32b15a=function(_0x52f391){while(--_0x52f391){_0x5a0bab['push'](_0x5a0bab['shift']());}};_0x32b15a(++_0x168def);}(_0xdcc7,0x1a2));var _0x7dcc=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xdcc7[_0x2112d4];return _0x434972;};'use strict';var client=require(_0x7dcc('0x0'));exports[_0x7dcc('0x1')]=function(_0x2a9eb6){return client[_0x7dcc('0x2')](_0x7dcc('0x3'),{'body':_0x2a9eb6,'log':_0x7dcc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 0378689..d850aeb 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5b7=['online','getWhatsappQueues','../client','GetWhatsappQueue','timeout','strategy','User'];(function(_0x4d4c19,_0x3147ff){var _0xf9e510=function(_0x5b9442){while(--_0x5b9442){_0x4d4c19['push'](_0x4d4c19['shift']());}};_0xf9e510(++_0x3147ff);}(_0xc5b7,0x175));var _0x7c5b=function(_0x1f8e0a,_0x1faad9){_0x1f8e0a=_0x1f8e0a-0x0;var _0x5c2028=_0xc5b7[_0x1f8e0a];return _0x5c2028;};'use strict';var client=require(_0x7c5b('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x7c5b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x7c5b('0x2'),_0x7c5b('0x3')],'include':[{'model':_0x7c5b('0x4'),'as':'Agents','attributes':['id','name',_0x7c5b('0x5'),'whatsappPause']}]},'log':_0x7c5b('0x6')});};}; \ No newline at end of file +var _0xab0f=['strategy','Agents','name','online','getWhatsappQueues','GetWhatsappQueue','timeout'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xab0f,0x177));var _0xfab0=function(_0x4548e1,_0x41c1f7){_0x4548e1=_0x4548e1-0x0;var _0x3ede37=_0xab0f[_0x4548e1];return _0x3ede37;};'use strict';var client=require('../client');exports[_0xfab0('0x0')]=function(){return function(){return client['Request'](_0xfab0('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xfab0('0x2'),_0xfab0('0x3')],'include':[{'model':'User','as':_0xfab0('0x4'),'attributes':['id',_0xfab0('0x5'),_0xfab0('0x6'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index cc0bb8b..9be0575 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2ae=['update','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x19f642,_0xbe241c){var _0x533e55=function(_0x4f5e4c){while(--_0x4f5e4c){_0x19f642['push'](_0x19f642['shift']());}};_0x533e55(++_0xbe241c);}(_0xd2ae,0x8d));var _0xed2a=function(_0x288518,_0x1fa9a9){_0x288518=_0x288518-0x0;var _0x4e21fa=_0xd2ae[_0x288518];return _0x4e21fa;};'use strict';var client=require(_0xed2a('0x0'));exports[_0xed2a('0x1')]=function(_0xf4b547){return client[_0xed2a('0x2')]('CreateWhatsappQueueReport',{'body':_0xf4b547,'log':_0xed2a('0x3')});};exports[_0xed2a('0x4')]=function(_0x25897a,_0x52e547){return client[_0xed2a('0x2')]('UpdateWhatsappQueueReport',{'body':_0x52e547,'options':{'where':{'uniqueid':_0x25897a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xace1=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x3ce5f9,_0x4da3a9){var _0xa5f975=function(_0x116452){while(--_0x116452){_0x3ce5f9['push'](_0x3ce5f9['shift']());}};_0xa5f975(++_0x4da3a9);}(_0xace1,0x13b));var _0x1ace=function(_0x292069,_0x5d1e7c){_0x292069=_0x292069-0x0;var _0x518241=_0xace1[_0x292069];return _0x518241;};'use strict';var client=require(_0x1ace('0x0'));exports['create']=function(_0x4f1b56){return client[_0x1ace('0x1')](_0x1ace('0x2'),{'body':_0x4f1b56,'log':_0x1ace('0x2')});};exports[_0x1ace('0x3')]=function(_0x5b1448,_0x3113a0){return client[_0x1ace('0x1')](_0x1ace('0x4'),{'body':_0x3113a0,'options':{'where':{'uniqueid':_0x5b1448},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 112d73a..28e37c2 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 _0x92f4=['next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','find','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x443817,_0x5853f7){var _0x1a57f6=function(_0x5ad374){while(--_0x5ad374){_0x443817['push'](_0x443817['shift']());}};_0x1a57f6(++_0x5853f7);}(_0x92f4,0x10f));var _0x492f=function(_0x515cc0,_0x248d5c){_0x515cc0=_0x515cc0-0x0;var _0x59e40e=_0x92f4[_0x515cc0];return _0x59e40e;};'use strict';var schema=require('validate');var _=require(_0x492f('0x0'));var util=require(_0x492f('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x492f('0x2'))(_0x492f('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x492f('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x492f('0x5'),'message':_0x492f('0x6')}});function writeLog(_0x363558,_0x47ab5b,_0x5aad18){return logger[_0x492f('0x7')](util[_0x492f('0x8')](_0x492f('0x9'),_0x363558,_0x47ab5b[_0x492f('0xa')],_0x5aad18));}function handleFindAgent(_0x24e949){return function(_0x7469c9){return _0x7469c9[_0x492f('0xa')][_0x492f('0xb')]()===_0x24e949['toLowerCase']();};}exports[_0x492f('0xc')]=function(_0x2c1969,_0x57b3db,_0x5dce97,_0x2fc69d){return function(_0x3fe8a0){try{var _0x4ffe2b={'name':_0x57b3db[0x0],'timeout':_0x57b3db[0x1]};var _0x3299ad=queue[_0x492f('0xd')](_0x4ffe2b,{'typecast':!![]});if(_0x3299ad[_0x492f('0xe')]){logger[_0x492f('0xf')](_0x492f('0x10'),_0x2c1969,_[_0x492f('0x11')](_0x3299ad,_0x492f('0x12'))[_0x492f('0x13')](',\x20'));_0x3fe8a0['stop']();}else{var _0x5beeac=_[_0x492f('0x14')](_0x5dce97['agents'],handleFindAgent(_0x4ffe2b[_0x492f('0xa')]));if(_0x5beeac){var _0x59970f=(_0x4ffe2b[_0x492f('0x15')]||0xa)*0x3e8;var _0x5c13b9,_0x11edc7;var _0xa52f71=seqqueue[_0x492f('0x16')](_0x59970f);_0xa52f71['id']=_0x2c1969;_0xa52f71[_0x492f('0x17')]=_0x59970f;_0xa52f71[_0x492f('0x18')]=_0x2fc69d[_0x492f('0x18')];writeLog(_0x2c1969,_0x5beeac,util[_0x492f('0x8')](_0x492f('0x19'),_0x59970f));_0x5dce97[_0x492f('0x1a')][_0x2c1969]['on'](_0x492f('0x1b'),function(){logger[_0x492f('0x7')](_0x492f('0x1c'),_0x2c1969);clearTimeout(_0x11edc7);_0x11edc7=undefined;_0xa52f71[_0x492f('0x1d')]();if(_0x5dce97[_0x492f('0x1a')][_0x2c1969]){delete _0x5dce97[_0x492f('0x1a')][_0x2c1969];}_0x3fe8a0[_0x492f('0x1e')]();});_0x5dce97[_0x492f('0x1a')][_0x2c1969]['on'](_0x492f('0x1f'),function(){if(_0x5dce97[_0x492f('0x1a')][_0x2c1969]){delete _0x5dce97[_0x492f('0x1a')][_0x2c1969];}});_0x11edc7=setTimeout(function(){logger[_0x492f('0x7')](_0x492f('0x20'),_0x2c1969);clearTimeout(_0x11edc7);_0xa52f71[_0x492f('0x1d')]();_0x3fe8a0[_0x492f('0x21')]();},_0x59970f);strategy['agent'](_0xa52f71,_0x5beeac,_0x5dce97,_0x2fc69d);}else{logger[_0x492f('0xf')](_0x492f('0x22'),_0x2c1969,_0x4ffe2b[_0x492f('0xa')]);_0x3fe8a0[_0x492f('0x1e')]();}}}catch(_0x1cbfe3){console[_0x492f('0x23')](_0x1cbfe3);logger[_0x492f('0xf')](_0x492f('0x24'),_0x2c1969,_0x1cbfe3[_0x492f('0x25')]);_0x3fe8a0[_0x492f('0x1e')]();}};}; \ No newline at end of file +var _0x4f81=['channel','format','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x3b6316,_0x32f0ae){var _0x92642=function(_0x533e5a){while(--_0x533e5a){_0x3b6316['push'](_0x3b6316['shift']());}};_0x92642(++_0x32f0ae);}(_0x4f81,0x11e));var _0x14f8=function(_0x536bf9,_0x2f47b9){_0x536bf9=_0x536bf9-0x0;var _0x1940a6=_0x4f81[_0x536bf9];return _0x1940a6;};'use strict';var schema=require(_0x14f8('0x0'));var _=require(_0x14f8('0x1'));var util=require('util');var seqqueue=require(_0x14f8('0x2'));var logger=require(_0x14f8('0x3'))(_0x14f8('0x4'));var strategy=require(_0x14f8('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x14f8('0x6')},'timeout':{'type':_0x14f8('0x7'),'message':_0x14f8('0x8')}});function writeLog(_0x355980,_0x40ed1e,_0x25e76f){return logger[_0x14f8('0x9')](util['format'](_0x14f8('0xa'),_0x355980,_0x40ed1e[_0x14f8('0xb')],_0x25e76f));}function handleFindAgent(_0x32966b){return function(_0x33997d){return _0x33997d['name'][_0x14f8('0xc')]()===_0x32966b[_0x14f8('0xc')]();};}exports[_0x14f8('0xd')]=function(_0xf40060,_0xeefc14,_0x1bf2dc,_0x4f4742){return function(_0x25c200){try{var _0x53415b={'name':_0xeefc14[0x0],'timeout':_0xeefc14[0x1]};var _0x298ab2=queue[_0x14f8('0x0')](_0x53415b,{'typecast':!![]});if(_0x298ab2[_0x14f8('0xe')]){logger[_0x14f8('0xf')](_0x14f8('0x10'),_0xf40060,_[_0x14f8('0x11')](_0x298ab2,_0x14f8('0x12'))[_0x14f8('0x13')](',\x20'));_0x25c200[_0x14f8('0x14')]();}else{var _0x20ee17=_[_0x14f8('0x15')](_0x1bf2dc[_0x14f8('0x16')],handleFindAgent(_0x53415b['name']));if(_0x20ee17){var _0x127c27=(_0x53415b[_0x14f8('0x17')]||0xa)*0x3e8;var _0x4a013f,_0x44598a;var _0x4f72c8=seqqueue[_0x14f8('0x18')](_0x127c27);_0x4f72c8['id']=_0xf40060;_0x4f72c8[_0x14f8('0x19')]=_0x127c27;_0x4f72c8[_0x14f8('0x1a')]=_0x4f4742[_0x14f8('0x1a')];writeLog(_0xf40060,_0x20ee17,util[_0x14f8('0x1b')]('START:%s',_0x127c27));_0x1bf2dc[_0x14f8('0x1c')][_0xf40060]['on'](_0x14f8('0x1d'),function(){logger['info'](_0x14f8('0x1e'),_0xf40060);clearTimeout(_0x44598a);_0x44598a=undefined;_0x4f72c8[_0x14f8('0x1f')]();if(_0x1bf2dc[_0x14f8('0x1c')][_0xf40060]){delete _0x1bf2dc[_0x14f8('0x1c')][_0xf40060];}_0x25c200[_0x14f8('0x14')]();});_0x1bf2dc[_0x14f8('0x1c')][_0xf40060]['on'](_0x14f8('0x20'),function(){if(_0x1bf2dc[_0x14f8('0x1c')][_0xf40060]){delete _0x1bf2dc[_0x14f8('0x1c')][_0xf40060];}});_0x44598a=setTimeout(function(){logger['info'](_0x14f8('0x21'),_0xf40060);clearTimeout(_0x44598a);_0x4f72c8['close']();_0x25c200[_0x14f8('0x22')]();},_0x127c27);strategy[_0x14f8('0x23')](_0x4f72c8,_0x20ee17,_0x1bf2dc,_0x4f4742);}else{logger[_0x14f8('0xf')](_0x14f8('0x24'),_0xf40060,_0x53415b[_0x14f8('0xb')]);_0x25c200[_0x14f8('0x14')]();}}}catch(_0x1aa9bf){console[_0x14f8('0x25')](_0x1aa9bf);logger[_0x14f8('0xf')](_0x14f8('0x26'),_0xf40060,_0x1aa9bf['stack']);_0x25c200['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index bc881b1..1ccc935 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 _0x4069=['InteractionId','interaction','created','Message','then','[%s][AMAZONLEX]\x20%s','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','postText','amazonlex','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','upperFirst','AccountId'];(function(_0xeeab64,_0x470b12){var _0x38ec96=function(_0x504a40){while(--_0x504a40){_0xeeab64['push'](_0xeeab64['shift']());}};_0x38ec96(++_0x470b12);}(_0x4069,0x1cc));var _0x9406=function(_0x3e6a26,_0x4b8e0a){_0x3e6a26=_0x3e6a26-0x0;var _0xde755c=_0x4069[_0x3e6a26];return _0xde755c;};'use strict';var _=require(_0x9406('0x0'));var moment=require(_0x9406('0x1'));var AWS=require('aws-sdk');var utils=require(_0x9406('0x2'));var logger=require(_0x9406('0x3'))(_0x9406('0x4'));var rpc={'chatMessage':require(_0x9406('0x5')),'openchannelMessage':require(_0x9406('0x6')),'mailMessage':require(_0x9406('0x7')),'smsMessage':require(_0x9406('0x8')),'faxMessage':require(_0x9406('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x32d151,_0x45b679){return function(_0x2f7f73){try{if(!_[_0x9406('0xa')](this['interaction'][_0x9406('0xb')])){logger[_0x9406('0xc')]('[%s][AMAZONLEX]\x20%s',_0x32d151,_0x9406('0xd'));return _0x2f7f73[_0x9406('0xe')]();}var _0x205c69={'ContactId':this[_0x9406('0xf')]['id'],'sentAt':moment()['format'](_0x9406('0x10')),'direction':_0x9406('0x11')};if(this[_0x9406('0x12')]===_0x9406('0x13')||this[_0x9406('0x12')]==='whatsapp'){_0x205c69[_0x9406('0x14')]=this['interaction'][_0x9406('0x14')];}var _0x2f3794=this[_0x9406('0x12')];if(_0x2f3794==='chat'){_0x205c69[_0x9406('0x15')]=this['account']['id'];}else{_0x205c69[_[_0x9406('0x16')](_0x2f3794)+_0x9406('0x17')]=this['account']['id'];}_0x205c69[_[_0x9406('0x16')](_0x2f3794)+_0x9406('0x18')]=this[_0x9406('0x19')]['id'];if(this[_0x9406('0x19')][_0x9406('0x1a')]){var _0x1dfe4a=_0x45b679[0x4];if(!_['isEmpty'](_0x1dfe4a)){_0x205c69['body']=utils['getMustacheRender'](_0x1dfe4a,this);return rpc[_0x2f3794+_0x9406('0x1b')]['create'](_0x205c69)[_0x9406('0x1c')](function(_0x51e19f){logger[_0x9406('0xc')](_0x9406('0x1d'),_0x32d151,_0x205c69[_0x9406('0x1e')]);})['catch'](function(_0x517c7a){logger[_0x9406('0x1f')](_0x9406('0x1d'),_0x32d151,JSON[_0x9406('0x20')](_0x517c7a));})[_0x9406('0x21')](function(){logger[_0x9406('0xc')](_0x9406('0x22'),_0x32d151);_0x2f7f73['stop']();});}else{logger[_0x9406('0xc')](_0x9406('0x23'),_0x32d151);_0x2f7f73[_0x9406('0x24')]();}}else{var _0xbab73a=this;var _0x4ac1c6=new AWS[(_0x9406('0x25'))]({'accessKeyId':_0x45b679[0x0],'secretAccessKey':_0x45b679[0x1],'region':_0x45b679[0x2]});var _0x4a1c6a={'botAlias':'$LATEST','botName':_0x45b679[0x3],'inputText':this[_0x9406('0x26')]['body'],'userId':this[_0x9406('0x12')]+':'+this[_0x9406('0x19')]['id']['toString']()};_0x4ac1c6[_0x9406('0x27')](_0x4a1c6a,function(_0x1ab7b6,_0x588fd3){if(_0x1ab7b6){logger[_0x9406('0x1f')](_0x9406('0x1d'),_0x32d151,_0x1ab7b6[_0x9406('0x26')]);_0x2f7f73[_0x9406('0xe')]();}else if(_0x588fd3&&_0x588fd3['message']){_0xbab73a[_0x9406('0x1e')][_0x9406('0x28')]=_0x588fd3;_0x205c69[_0x9406('0x1e')]=_0x588fd3[_0x9406('0x26')];_0x205c69['providerName']=_0x9406('0x28');_0x205c69['providerResponse']=JSON[_0x9406('0x20')](_0x588fd3);return rpc[_0x2f3794+_0x9406('0x1b')]['create'](_0x205c69)[_0x9406('0x1c')](function(_0x5c845d){logger[_0x9406('0xc')](_0x9406('0x1d'),_0x32d151,_0x205c69[_0x9406('0x1e')]);if(_0x588fd3[_0x9406('0x29')]==_0x9406('0x2a')){_0x2f7f73[_0x9406('0xe')]();}else{_0x2f7f73[_0x9406('0x24')]();}})[_0x9406('0x2b')](function(_0x1e82dc){logger[_0x9406('0x1f')](_0x9406('0x1d'),_0x32d151,JSON[_0x9406('0x20')](_0x1e82dc));_0x2f7f73['next']();});}else{_0x2f7f73[_0x9406('0xe')]();}});}}catch(_0x3cec25){logger['error'](_0x9406('0x1d'),_0x32d151,JSON[_0x9406('0x20')](_0x3cec25));_0x2f7f73[_0x9406('0x24')]();}};}; \ No newline at end of file +var _0x1412=['body','getMustacheRender','Message','create','then','catch','error','stringify','finally','info','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created'];(function(_0x381355,_0x3e05e3){var _0x5ea326=function(_0x509d5e){while(--_0x509d5e){_0x381355['push'](_0x381355['shift']());}};_0x5ea326(++_0x3e05e3);}(_0x1412,0xb0));var _0x2141=function(_0x2f0cb6,_0x1f619e){_0x2f0cb6=_0x2f0cb6-0x0;var _0x985309=_0x1412[_0x2f0cb6];return _0x985309;};'use strict';var _=require(_0x2141('0x0'));var moment=require(_0x2141('0x1'));var AWS=require('aws-sdk');var utils=require(_0x2141('0x2'));var logger=require(_0x2141('0x3'))(_0x2141('0x4'));var rpc={'chatMessage':require(_0x2141('0x5')),'openchannelMessage':require(_0x2141('0x6')),'mailMessage':require(_0x2141('0x7')),'smsMessage':require(_0x2141('0x8')),'faxMessage':require(_0x2141('0x9')),'whatsappMessage':require(_0x2141('0xa'))};exports[_0x2141('0xb')]=function(_0x51f016,_0x41c416){return function(_0x21aa73){try{if(!_[_0x2141('0xc')](this[_0x2141('0xd')][_0x2141('0xe')])){logger['info'](_0x2141('0xf'),_0x51f016,_0x2141('0x10'));return _0x21aa73[_0x2141('0x11')]();}var _0x1c11c7={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2141('0x12')](_0x2141('0x13')),'direction':_0x2141('0x14')};if(this[_0x2141('0x15')]===_0x2141('0x16')||this['channel']===_0x2141('0x17')){_0x1c11c7[_0x2141('0x18')]=this[_0x2141('0xd')][_0x2141('0x18')];}var _0x305e91=this['channel'];if(_0x305e91===_0x2141('0x19')){_0x1c11c7[_0x2141('0x1a')]=this['account']['id'];}else{_0x1c11c7[_[_0x2141('0x1b')](_0x305e91)+_0x2141('0x1c')]=this[_0x2141('0x1d')]['id'];}_0x1c11c7[_[_0x2141('0x1b')](_0x305e91)+_0x2141('0x1e')]=this['interaction']['id'];if(this[_0x2141('0xd')][_0x2141('0x1f')]){var _0x33b731=_0x41c416[0x4];if(!_['isEmpty'](_0x33b731)){_0x1c11c7[_0x2141('0x20')]=utils[_0x2141('0x21')](_0x33b731,this);return rpc[_0x305e91+_0x2141('0x22')][_0x2141('0x23')](_0x1c11c7)[_0x2141('0x24')](function(_0x4a4f13){logger['info']('[%s][AMAZONLEX]\x20%s',_0x51f016,_0x1c11c7[_0x2141('0x20')]);})[_0x2141('0x25')](function(_0x4e384c){logger[_0x2141('0x26')](_0x2141('0xf'),_0x51f016,JSON[_0x2141('0x27')](_0x4e384c));})[_0x2141('0x28')](function(){logger[_0x2141('0x29')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x51f016);_0x21aa73[_0x2141('0x2a')]();});}else{logger[_0x2141('0x29')](_0x2141('0x2b'),_0x51f016);_0x21aa73[_0x2141('0x2a')]();}}else{var _0x13495c=this;var _0x97950c=new AWS['LexRuntime']({'accessKeyId':_0x41c416[0x0],'secretAccessKey':_0x41c416[0x1],'region':_0x41c416[0x2]});var _0x13f03e={'botAlias':_0x2141('0x2c'),'botName':_0x41c416[0x3],'inputText':this[_0x2141('0x2d')][_0x2141('0x20')],'userId':this[_0x2141('0x15')]+':'+this[_0x2141('0xd')]['id'][_0x2141('0x2e')]()};_0x97950c[_0x2141('0x2f')](_0x13f03e,function(_0x446be3,_0x1c58bf){if(_0x446be3){logger[_0x2141('0x26')]('[%s][AMAZONLEX]\x20%s',_0x51f016,_0x446be3[_0x2141('0x2d')]);_0x21aa73[_0x2141('0x11')]();}else if(_0x1c58bf&&_0x1c58bf['message']){_0x13495c[_0x2141('0x20')][_0x2141('0x30')]=_0x1c58bf;_0x1c11c7[_0x2141('0x20')]=_0x1c58bf['message'];_0x1c11c7['providerName']=_0x2141('0x30');_0x1c11c7[_0x2141('0x31')]=JSON['stringify'](_0x1c58bf);return rpc[_0x305e91+_0x2141('0x22')][_0x2141('0x23')](_0x1c11c7)[_0x2141('0x24')](function(_0x158462){logger['info'](_0x2141('0xf'),_0x51f016,_0x1c11c7['body']);if(_0x1c58bf[_0x2141('0x32')]==_0x2141('0x33')){_0x21aa73['next']();}else{_0x21aa73[_0x2141('0x2a')]();}})[_0x2141('0x25')](function(_0xef494a){logger['error'](_0x2141('0xf'),_0x51f016,JSON[_0x2141('0x27')](_0xef494a));_0x21aa73[_0x2141('0x11')]();});}else{_0x21aa73[_0x2141('0x11')]();}});}}catch(_0x232f4f){logger['error'](_0x2141('0xf'),_0x51f016,JSON[_0x2141('0x27')](_0x232f4f));_0x21aa73['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index d70cede..790971f 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 _0xee42=['message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','inReplyTo','messageId','html','','replace','';_0x23ba1a[_0x2ee4('0x31')]={'Auto-Submitted':_0x2ee4('0x32'),'X-Auto-Response-Suppress':_0x2ee4('0x33'),'Precedence':_0x2ee4('0x34')};return mailRpc[_0x2ee4('0x35')](this['account'][_0x2ee4('0x36')],_0x23ba1a)[_0x2ee4('0x37')](function(_0x5f17b3){logger['info'](_0x2ee4('0x38'),_0x52e289);_0x23ba1a['messageId']=_0x5f17b3[_0x2ee4('0x1d')][_0x2ee4('0x2b')];return rpc[_0x24390a+_0x2ee4('0x39')]['create'](_0x23ba1a);})[_0x2ee4('0x37')](function(_0x32cca9){logger[_0x2ee4('0x12')](_0x2ee4('0xe'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x32cca9));})[_0x2ee4('0x3b')](function(_0x4c474c){logger[_0x2ee4('0x3c')](_0x2ee4('0x3d'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x4c474c));})[_0x2ee4('0x3e')](function(){Promise[_0x2ee4('0x3f')]()[_0x2ee4('0x37')](function(){if(_0x3d64fb[0x0]!=='2'||_0x1c2020[_0x2ee4('0x15')])return;return rpc[_0x24390a+_0x2ee4('0x40')][_0x2ee4('0x41')](_0x1c2020['id'],{'autoreplyExecuted':!![]})[_0x2ee4('0x37')](function(_0x27645a){logger[_0x2ee4('0x12')](_0x2ee4('0x16'),_0x52e289,JSON['stringify'](_0x27645a));})[_0x2ee4('0x3b')](function(_0x3768b9){logger[_0x2ee4('0x3c')](_0x2ee4('0x42'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x3768b9));});})[_0x2ee4('0x37')](function(){_0x4c43b8['next']();});});}else{return rpc[this[_0x2ee4('0xc')]+'Message'][_0x2ee4('0x43')](_0x23ba1a)['then'](function(){logger[_0x2ee4('0x12')](_0x2ee4('0xe'),_0x52e289,_0x23ba1a[_0x2ee4('0xd')]);})[_0x2ee4('0x3b')](function(_0x263496){logger[_0x2ee4('0x3c')](_0x2ee4('0xe'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x263496));})[_0x2ee4('0x3e')](function(){Promise[_0x2ee4('0x3f')]()[_0x2ee4('0x37')](function(){if(_0x3d64fb[0x0]!=='2'||_0x1c2020[_0x2ee4('0x15')])return;return rpc[_0x24390a+'Interaction'][_0x2ee4('0x41')](_0x1c2020['id'],{'autoreplyExecuted':!![]})[_0x2ee4('0x37')](function(_0x2139a8){logger[_0x2ee4('0x12')](_0x2ee4('0x16'),_0x52e289,JSON[_0x2ee4('0x3a')](_0x2139a8));})[_0x2ee4('0x3b')](function(_0x41a48a){logger[_0x2ee4('0x3c')](_0x2ee4('0x42'),_0x52e289,JSON['stringify'](_0x41a48a));});})['then'](function(){_0x4c43b8[_0x2ee4('0x14')]();});});}}}catch(_0x7deec1){logger[_0x2ee4('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x52e289,JSON[_0x2ee4('0x3a')](_0x7deec1));_0x4c43b8[_0x2ee4('0x44')]();}};}; \ No newline at end of file +var _0xd859=['created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','inReplyTo','html',''+_['replace'](_0x5d57ad[_0x9d85('0x10')],_0x9d85('0x2e'),_0x9d85('0x2f'))+'';_0x5d57ad['headers']={'Auto-Submitted':_0x9d85('0x30'),'X-Auto-Response-Suppress':_0x9d85('0x31'),'Precedence':_0x9d85('0x32')};return mailRpc[_0x9d85('0x33')](this[_0x9d85('0x28')][_0x9d85('0x34')],_0x5d57ad)[_0x9d85('0x35')](function(_0x3693ee){logger[_0x9d85('0x12')](_0x9d85('0x36'),_0x2b85dc);_0x5d57ad[_0x9d85('0x37')]=_0x3693ee['message']['messageId'];return rpc[_0x15d0e9+_0x9d85('0x38')][_0x9d85('0x39')](_0x5d57ad);})[_0x9d85('0x35')](function(_0x2aa6d5){logger[_0x9d85('0x12')]('[%s][AUTOREPLY]\x20%s',_0x2b85dc,JSON[_0x9d85('0x3a')](_0x2aa6d5));})[_0x9d85('0x3b')](function(_0x18c2bf){logger[_0x9d85('0x3c')](_0x9d85('0x3d'),_0x2b85dc,JSON[_0x9d85('0x3a')](_0x18c2bf));})[_0x9d85('0x3e')](function(){Promise[_0x9d85('0x3f')]()[_0x9d85('0x35')](function(){if(_0x5ef888[0x0]!=='2'||_0x4c10a9[_0x9d85('0x19')])return;return rpc[_0x15d0e9+_0x9d85('0x40')][_0x9d85('0x41')](_0x4c10a9['id'],{'autoreplyExecuted':!![]})[_0x9d85('0x35')](function(_0x5c14d6){logger[_0x9d85('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b85dc,JSON[_0x9d85('0x3a')](_0x5c14d6));})[_0x9d85('0x3b')](function(_0x5830a0){logger[_0x9d85('0x3c')](_0x9d85('0x42'),_0x2b85dc,JSON[_0x9d85('0x3a')](_0x5830a0));});})['then'](function(){_0xd74678['next']();});});}else{return rpc[this[_0x9d85('0xe')]+_0x9d85('0x38')][_0x9d85('0x39')](_0x5d57ad)[_0x9d85('0x35')](function(){logger[_0x9d85('0x12')](_0x9d85('0x13'),_0x2b85dc,_0x5d57ad[_0x9d85('0x10')]);})[_0x9d85('0x3b')](function(_0xfecdb8){logger[_0x9d85('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x2b85dc,JSON[_0x9d85('0x3a')](_0xfecdb8));})[_0x9d85('0x3e')](function(){Promise[_0x9d85('0x3f')]()[_0x9d85('0x35')](function(){if(_0x5ef888[0x0]!=='2'||_0x4c10a9[_0x9d85('0x19')])return;return rpc[_0x15d0e9+'Interaction'][_0x9d85('0x41')](_0x4c10a9['id'],{'autoreplyExecuted':!![]})[_0x9d85('0x35')](function(_0x427a31){logger['info'](_0x9d85('0x1a'),_0x2b85dc,JSON[_0x9d85('0x3a')](_0x427a31));})[_0x9d85('0x3b')](function(_0x5434ce){logger[_0x9d85('0x3c')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b85dc,JSON[_0x9d85('0x3a')](_0x5434ce));});})[_0x9d85('0x35')](function(){_0xd74678['next']();});});}}}catch(_0x44da71){logger[_0x9d85('0x3c')](_0x9d85('0x13'),_0x2b85dc,JSON[_0x9d85('0x3a')](_0x44da71));_0xd74678['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 45d4238..380df11 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 _0xa185=['channel','Interaction','update','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0xf967ad,_0x551845){var _0x588ac9=function(_0x33bf07){while(--_0x33bf07){_0xf967ad['push'](_0xf967ad['shift']());}};_0x588ac9(++_0x551845);}(_0xa185,0x186));var _0x5a18=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa185[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x5a18('0x0'));var logger=require('../../../../config/logger')(_0x5a18('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x5a18('0x2')),'faxInteraction':require(_0x5a18('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x206e22,_0x26e07b,_0x374a1c,_0x5b2b3b){return function(_0x46e493){try{logger[_0x5a18('0x4')](_0x5a18('0x5'),_0x206e22,_0x26e07b[0x0]);var _0x116f12={'closed':0x1,'closedAt':moment()[_0x5a18('0x6')](_0x5a18('0x7')),'closeReason':_0x5a18('0x8'),'disposition':_0x26e07b[0x0]};if(rpc[_0x5b2b3b[_0x5a18('0x9')]+_0x5a18('0xa')]){rpc[_0x5b2b3b['channel']+_0x5a18('0xa')][_0x5a18('0xb')](_0x5b2b3b[_0x5a18('0xc')]['id'],_0x116f12)['then'](function(_0x1fc6ab){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x206e22,_0x5b2b3b['interaction']['id']);})[_0x5a18('0xd')](function(_0x409c55){logger[_0x5a18('0xe')](_0x5a18('0xf'),_0x206e22,JSON[_0x5a18('0x10')](_0x409c55));})[_0x5a18('0x11')](function(){_0x46e493[_0x5a18('0x12')]();});}}catch(_0x27c9d0){logger[_0x5a18('0xe')]('[%s][CLOSE]\x20%s',_0x206e22,JSON[_0x5a18('0x10')](_0x27c9d0));_0x46e493[_0x5a18('0x12')]();}};}; \ No newline at end of file +var _0xa927=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','system','channel','Interaction','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x19a6f3,_0x5cb178){var _0x386328=function(_0x19e09d){while(--_0x19e09d){_0x19a6f3['push'](_0x19a6f3['shift']());}};_0x386328(++_0x5cb178);}(_0xa927,0x177));var _0x7a92=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa927[_0x4b369d];return _0x571a98;};'use strict';var moment=require(_0x7a92('0x0'));var logger=require(_0x7a92('0x1'))(_0x7a92('0x2'));var rpc={'chatInteraction':require(_0x7a92('0x3')),'openchannelInteraction':require(_0x7a92('0x4')),'smsInteraction':require(_0x7a92('0x5')),'mailInteraction':require(_0x7a92('0x6')),'faxInteraction':require(_0x7a92('0x7')),'whatsappInteraction':require(_0x7a92('0x8'))};exports['consequence']=function(_0x4d413a,_0x40c946,_0x57e032,_0x4db9ff){return function(_0x131da2){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4d413a,_0x40c946[0x0]);var _0x5e56ae={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x7a92('0x9'),'disposition':_0x40c946[0x0]};if(rpc[_0x4db9ff[_0x7a92('0xa')]+_0x7a92('0xb')]){rpc[_0x4db9ff[_0x7a92('0xa')]+'Interaction'][_0x7a92('0xc')](_0x4db9ff[_0x7a92('0xd')]['id'],_0x5e56ae)['then'](function(_0x221b4d){logger[_0x7a92('0xe')](_0x7a92('0xf'),_0x4d413a,_0x4db9ff[_0x7a92('0xd')]['id']);})['catch'](function(_0x3d9777){logger[_0x7a92('0x10')](_0x7a92('0x11'),_0x4d413a,JSON[_0x7a92('0x12')](_0x3d9777));})['finally'](function(){_0x131da2[_0x7a92('0x13')]();});}}catch(_0x53ff01){logger[_0x7a92('0x10')]('[%s][CLOSE]\x20%s',_0x4d413a,JSON[_0x7a92('0x12')](_0x53ff01));_0x131da2[_0x7a92('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 9480db3..719c746 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 _0xc949=['[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','body','getMustacheRender','create','then','catch','error','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','fulfillment','speech','providerName','stringify','Message','metadata','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc949,0x181));var _0x9c94=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc949[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x9c94('0x0'));var moment=require('moment');var apiai=require(_0x9c94('0x1'));var md5=require(_0x9c94('0x2'));var utils=require(_0x9c94('0x3'));var logger=require(_0x9c94('0x4'))('routing');var rpc={'chatMessage':require(_0x9c94('0x5')),'openchannelMessage':require(_0x9c94('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9c94('0x7')),'faxMessage':require(_0x9c94('0x8')),'whatsappMessage':require(_0x9c94('0x9'))};exports[_0x9c94('0xa')]=function(_0x57fcd7,_0xf373e){return function(_0x360e7b){try{if(!_[_0x9c94('0xb')](this[_0x9c94('0xc')][_0x9c94('0xd')])){logger[_0x9c94('0xe')](_0x9c94('0xf'),_0x57fcd7,_0x9c94('0x10'));return _0x360e7b[_0x9c94('0x11')]();}var _0x3287f8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9c94('0x12')](_0x9c94('0x13')),'direction':_0x9c94('0x14')};if(this[_0x9c94('0x15')]===_0x9c94('0x16')||this[_0x9c94('0x15')]===_0x9c94('0x17')){_0x3287f8[_0x9c94('0x18')]=this[_0x9c94('0xc')][_0x9c94('0x18')];}var _0x4440b2=this[_0x9c94('0x15')];if(_0x4440b2===_0x9c94('0x19')){_0x3287f8[_0x9c94('0x1a')]=this['account']['id'];}else{_0x3287f8[_[_0x9c94('0x1b')](_0x4440b2)+'AccountId']=this[_0x9c94('0x1c')]['id'];}_0x3287f8[_[_0x9c94('0x1b')](_0x4440b2)+'InteractionId']=this[_0x9c94('0xc')]['id'];if(this['interaction']['created']){var _0xf4054e=_0xf373e[0x2];if(!_['isEmpty'](_0xf4054e)){_0x3287f8[_0x9c94('0x1d')]=utils[_0x9c94('0x1e')](_0xf4054e,this);return rpc[_0x4440b2+'Message'][_0x9c94('0x1f')](_0x3287f8)[_0x9c94('0x20')](function(_0x412804){logger[_0x9c94('0xe')](_0x9c94('0xf'),_0x57fcd7,_0x3287f8[_0x9c94('0x1d')]);})[_0x9c94('0x21')](function(_0x5cb39c){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,JSON['stringify'](_0x5cb39c));})[_0x9c94('0x23')](function(){logger[_0x9c94('0xe')](_0x9c94('0x24'),_0x57fcd7);_0x360e7b[_0x9c94('0x25')]();});}else{logger[_0x9c94('0xe')](_0x9c94('0x26'),_0x57fcd7);_0x360e7b[_0x9c94('0x25')]();}}else{var _0x23cdf5=this;var _0x8fe4fb=apiai(_0xf373e[0x0],{'language':_0xf373e[0x1]||'en'});return _0x8fe4fb[_0x9c94('0x27')](this[_0x9c94('0x28')][_0x9c94('0x1d')],{'sessionId':md5(this[_0x9c94('0xc')]['id'])})[_0x9c94('0x20')](function(_0x5b1020){_0x23cdf5[_0x9c94('0x1d')][_0x9c94('0x29')]=_0x5b1020;_0x3287f8['body']=_0x5b1020[_0x9c94('0x2a')][_0x9c94('0x2b')][_0x9c94('0x2c')];_0x3287f8[_0x9c94('0x2d')]=_0x9c94('0x29');_0x3287f8['providerResponse']=JSON[_0x9c94('0x2e')](_0x5b1020);return rpc[_0x4440b2+_0x9c94('0x2f')]['create'](_0x3287f8)[_0x9c94('0x20')](function(_0x4cfb9c){logger[_0x9c94('0xe')](_0x9c94('0xf'),_0x57fcd7,_0x3287f8[_0x9c94('0x1d')]);if(_0x5b1020[_0x9c94('0x2a')][_0x9c94('0x30')][_0x9c94('0x31')]){_0x360e7b[_0x9c94('0x11')]();}else{_0x360e7b['stop']();}})['catch'](function(_0xc4a819){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,JSON['stringify'](_0xc4a819));_0x360e7b[_0x9c94('0x11')]();});})['catch'](function(_0x356ee8){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,_0x356ee8['message']);_0x360e7b['next']();});}}catch(_0x1f4e4f){logger[_0x9c94('0x22')](_0x9c94('0xf'),_0x57fcd7,JSON['stringify'](_0x1f4e4f));_0x360e7b['stop']();}};}; \ No newline at end of file +var _0x482d=['fulfillment','speech','providerResponse','metadata','endConversation','error','stringify','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','isEmpty','body','Message','create','then','info','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result'];(function(_0x2722cd,_0xdacc46){var _0x3abc9f=function(_0x3a1ec9){while(--_0x3a1ec9){_0x2722cd['push'](_0x2722cd['shift']());}};_0x3abc9f(++_0xdacc46);}(_0x482d,0x16c));var _0xd482=function(_0x4367f7,_0x162d6f){_0x4367f7=_0x4367f7-0x0;var _0x1ee0fc=_0x482d[_0x4367f7];return _0x1ee0fc;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xd482('0x0'));var md5=require(_0xd482('0x1'));var utils=require(_0xd482('0x2'));var logger=require(_0xd482('0x3'))(_0xd482('0x4'));var rpc={'chatMessage':require(_0xd482('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd482('0x6')),'smsMessage':require(_0xd482('0x7')),'faxMessage':require(_0xd482('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xd482('0x9')]=function(_0x5d6b47,_0x5bfc0f){return function(_0x478af5){try{if(!_[_0xd482('0xa')](this[_0xd482('0xb')][_0xd482('0xc')])){logger['info'](_0xd482('0xd'),_0x5d6b47,_0xd482('0xe'));return _0x478af5[_0xd482('0xf')]();}var _0x2a2077={'ContactId':this[_0xd482('0x10')]['id'],'sentAt':moment()[_0xd482('0x11')](_0xd482('0x12')),'direction':_0xd482('0x13')};if(this['channel']===_0xd482('0x14')||this[_0xd482('0x15')]===_0xd482('0x16')){_0x2a2077[_0xd482('0x17')]=this['interaction'][_0xd482('0x17')];}var _0x1203d1=this[_0xd482('0x15')];if(_0x1203d1==='chat'){_0x2a2077[_0xd482('0x18')]=this['account']['id'];}else{_0x2a2077[_['upperFirst'](_0x1203d1)+_0xd482('0x19')]=this['account']['id'];}_0x2a2077[_[_0xd482('0x1a')](_0x1203d1)+_0xd482('0x1b')]=this['interaction']['id'];if(this[_0xd482('0xb')][_0xd482('0x1c')]){var _0x319c97=_0x5bfc0f[0x2];if(!_[_0xd482('0x1d')](_0x319c97)){_0x2a2077[_0xd482('0x1e')]=utils['getMustacheRender'](_0x319c97,this);return rpc[_0x1203d1+_0xd482('0x1f')][_0xd482('0x20')](_0x2a2077)[_0xd482('0x21')](function(_0x5dbc03){logger[_0xd482('0x22')](_0xd482('0xd'),_0x5d6b47,_0x2a2077[_0xd482('0x1e')]);})[_0xd482('0x23')](function(_0x2776a2){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x5d6b47,JSON['stringify'](_0x2776a2));})[_0xd482('0x24')](function(){logger[_0xd482('0x22')](_0xd482('0x25'),_0x5d6b47);_0x478af5['stop']();});}else{logger[_0xd482('0x22')](_0xd482('0x26'),_0x5d6b47);_0x478af5[_0xd482('0x27')]();}}else{var _0xc4b518=this;var _0x76b6ea=apiai(_0x5bfc0f[0x0],{'language':_0x5bfc0f[0x1]||'en'});return _0x76b6ea[_0xd482('0x28')](this[_0xd482('0x29')][_0xd482('0x1e')],{'sessionId':md5(this['interaction']['id'])})[_0xd482('0x21')](function(_0x34c646){_0xc4b518[_0xd482('0x1e')][_0xd482('0x2a')]=_0x34c646;_0x2a2077[_0xd482('0x1e')]=_0x34c646[_0xd482('0x2b')][_0xd482('0x2c')][_0xd482('0x2d')];_0x2a2077['providerName']='dialogflow';_0x2a2077[_0xd482('0x2e')]=JSON['stringify'](_0x34c646);return rpc[_0x1203d1+_0xd482('0x1f')]['create'](_0x2a2077)['then'](function(_0x5e4bed){logger[_0xd482('0x22')](_0xd482('0xd'),_0x5d6b47,_0x2a2077[_0xd482('0x1e')]);if(_0x34c646[_0xd482('0x2b')][_0xd482('0x2f')][_0xd482('0x30')]){_0x478af5[_0xd482('0xf')]();}else{_0x478af5['stop']();}})['catch'](function(_0x17ff73){logger[_0xd482('0x31')](_0xd482('0xd'),_0x5d6b47,JSON[_0xd482('0x32')](_0x17ff73));_0x478af5['next']();});})[_0xd482('0x23')](function(_0x39f753){logger[_0xd482('0x31')]('[%s][DIALOGFLOW]\x20%s',_0x5d6b47,_0x39f753[_0xd482('0x29')]);_0x478af5[_0xd482('0xf')]();});}}catch(_0x367b53){logger['error'](_0xd482('0xd'),_0x5d6b47,JSON['stringify'](_0x367b53));_0x478af5[_0xd482('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 08f00ca..e19a6c5 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d03=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','isEmpty','getMustacheRender','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue'];(function(_0x22e953,_0x10a297){var _0x2d4bdc=function(_0x3fc8f4){while(--_0x3fc8f4){_0x22e953['push'](_0x22e953['shift']());}};_0x2d4bdc(++_0x10a297);}(_0x6d03,0x177));var _0x36d0=function(_0x24c6b0,_0x53d017){_0x24c6b0=_0x24c6b0-0x0;var _0x17159d=_0x6d03[_0x24c6b0];return _0x17159d;};'use strict';var _=require(_0x36d0('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x36d0('0x1'));var moment=require(_0x36d0('0x2'));var Promise=require(_0x36d0('0x3'));var logger=require(_0x36d0('0x4'))(_0x36d0('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x36d0('0x6')),'openchannelMessage':require(_0x36d0('0x7')),'mailMessage':require(_0x36d0('0x8')),'smsMessage':require(_0x36d0('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x36d0('0xa'))};function createMessage(_0x31ced6,_0x3c4646,_0x3267c9,_0x1a1490){return new Promise(function(_0x296659,_0x4b0899){var _0x36cc21=_[_0x36d0('0xb')](_0x3267c9);_0x36cc21[_0x36d0('0xc')]=_0x1a1490;return rpc[_0x3c4646+_0x36d0('0xd')][_0x36d0('0xe')](_0x36cc21)['then'](function(){logger['info'](_0x36d0('0xf'),_0x31ced6,_0x36cc21[_0x36d0('0xc')]);_0x296659();})[_0x36d0('0x10')](function(_0x28beee){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x31ced6,JSON['stringify'](_0x28beee));_0x4b0899(_0x28beee);});});}exports[_0x36d0('0x12')]=function(_0x525e43,_0x4d62c9){return function(_0x4a27a0){try{if(!_['isNil'](this['interaction'][_0x36d0('0x13')])){logger[_0x36d0('0x14')](_0x36d0('0xf'),_0x525e43,_0x36d0('0x15'));return _0x4a27a0[_0x36d0('0x16')]();}var _0x44e2a7={'ContactId':this[_0x36d0('0x17')]['id'],'sentAt':moment()[_0x36d0('0x18')](_0x36d0('0x19')),'direction':_0x36d0('0x1a')};if(this[_0x36d0('0x1b')]==='sms'||this['channel']===_0x36d0('0x1c')){_0x44e2a7[_0x36d0('0x1d')]=this['interaction'][_0x36d0('0x1d')];}var _0x163cf7=this[_0x36d0('0x1b')];if(_0x163cf7===_0x36d0('0x1e')){_0x44e2a7[_0x36d0('0x1f')]=this[_0x36d0('0x20')]['id'];}else{_0x44e2a7[_[_0x36d0('0x21')](_0x163cf7)+'AccountId']=this[_0x36d0('0x20')]['id'];}_0x44e2a7[_['upperFirst'](_0x163cf7)+_0x36d0('0x22')]=this[_0x36d0('0x23')]['id'];if(this[_0x36d0('0x23')]['created']){var _0x378d04=_0x4d62c9[0x4];if(!_[_0x36d0('0x24')](_0x378d04)){_0x44e2a7[_0x36d0('0xc')]=utils[_0x36d0('0x25')](_0x378d04,this);return rpc[_0x163cf7+'Message'][_0x36d0('0xe')](_0x44e2a7)['then'](function(_0x2d3cd5){logger[_0x36d0('0x14')](_0x36d0('0xf'),_0x525e43,_0x44e2a7[_0x36d0('0xc')]);})[_0x36d0('0x10')](function(_0x32b9ad){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x32b9ad));})[_0x36d0('0x27')](function(){logger[_0x36d0('0x14')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x525e43);_0x4a27a0[_0x36d0('0x28')]();});}else{logger['info'](_0x36d0('0x29'),_0x525e43);_0x4a27a0[_0x36d0('0x28')]();}}else{var _0x5cefc8=this;var _0x263fad=_0x4d62c9[0x2]['replace'](/\\n/g,'\x0a');var _0x25d204={'credentials':{'private_key':_0x263fad,'client_email':_0x4d62c9[0x1]}};var _0x1c88db=new dialogflow[(_0x36d0('0x2a'))](_0x25d204);var _0x2e73dd=_0x1c88db['sessionPath'](_0x4d62c9[0x0],md5(_0x5cefc8[_0x36d0('0x23')]['id']));var _0x5067d4={'session':_0x2e73dd,'queryInput':{'text':{'text':_0x5cefc8[_0x36d0('0x2b')][_0x36d0('0xc')],'languageCode':_0x4d62c9[0x3]||'en'}}};return _0x1c88db['detectIntent'](_0x5067d4)[_0x36d0('0x2c')](function(_0xf73115){if(_0xf73115&&_0xf73115[_0x36d0('0x2d')]){_0x5cefc8['body'][_0x36d0('0x2e')]=_0xf73115;var _0x580ec3=_0xf73115[0x0];var _0x317206=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]&&_0x580ec3['queryResult'][_0x36d0('0x30')]['fields']?_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')][_0x36d0('0x31')]['end_conversation'][_0x36d0('0x32')]:![];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x33')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x34')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x35')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x36')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x37')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]&&_0x580ec3['queryResult'][_0x36d0('0x30')][_0x36d0('0x31')]?_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]['fields'][_0x36d0('0x38')][_0x36d0('0x32')]:![];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x39')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3a')]['name'];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x3b')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3a')][_0x36d0('0x3c')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x3d')]=_0x580ec3[_0x36d0('0x2f')]['intent'][_0x36d0('0x3e')];_0x5cefc8[_0x36d0('0xc')]['DIALOGFLOWV2_LANGUAGECODE']=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3f')];_0x5cefc8[_0x36d0('0xc')]['DIALOGFLOWV2_QUERYTEXT']=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x40')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x41')]=_0x580ec3['queryResult'][_0x36d0('0x42')];_0x44e2a7[_0x36d0('0x43')]=_0x36d0('0x2e');_0x44e2a7[_0x36d0('0x44')]=JSON[_0x36d0('0x26')](_0xf73115);var _0x5aa7b4=[];for(var _0x3e3bfd=0x0;_0x3e3bfd<_0xf73115['length'];_0x3e3bfd++){var _0x56a7cd=_0xf73115[_0x3e3bfd];if(_0x56a7cd&&_0x56a7cd[_0x36d0('0x2f')]&&_0x56a7cd['queryResult'][_0x36d0('0x45')]){_0x5aa7b4[_0x36d0('0x46')](createMessage(_0x525e43,_0x163cf7,_0x44e2a7,_0x56a7cd[_0x36d0('0x2f')][_0x36d0('0x45')]));}}return Promise['all'](_0x5aa7b4)[_0x36d0('0x2c')](function(){if(_0x317206){_0x4a27a0[_0x36d0('0x16')]();}else{_0x4a27a0['stop']();}})[_0x36d0('0x10')](function(_0x44a98f){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x44a98f));_0x4a27a0[_0x36d0('0x16')]();});}})[_0x36d0('0x10')](function(_0x489f55){logger['error'](_0x36d0('0xf'),_0x525e43,_0x489f55[_0x36d0('0x2b')]);_0x4a27a0[_0x36d0('0x16')]();});}}catch(_0x511694){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x511694));_0x4a27a0[_0x36d0('0x28')]();}};}; \ No newline at end of file +var _0x7edf=['contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','AccountId','InteractionId','getMustacheRender','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','push','all','lodash','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','error','stringify','isNil','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7edf,0x71));var _0xf7ed=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x7edf[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0xf7ed('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0xf7ed('0x1'));var Promise=require(_0xf7ed('0x2'));var logger=require(_0xf7ed('0x3'))(_0xf7ed('0x4'));var utils=require('./utils');var rpc={'chatMessage':require(_0xf7ed('0x5')),'openchannelMessage':require(_0xf7ed('0x6')),'mailMessage':require(_0xf7ed('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf7ed('0x8'))};function createMessage(_0x176292,_0x18587d,_0x121b22,_0x1534ca){return new Promise(function(_0x3d3ee3,_0xc5e1c7){var _0x3e6ca5=_[_0xf7ed('0x9')](_0x121b22);_0x3e6ca5[_0xf7ed('0xa')]=_0x1534ca;return rpc[_0x18587d+_0xf7ed('0xb')][_0xf7ed('0xc')](_0x3e6ca5)[_0xf7ed('0xd')](function(){logger[_0xf7ed('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x176292,_0x3e6ca5['body']);_0x3d3ee3();})[_0xf7ed('0xf')](function(_0x4bce02){logger[_0xf7ed('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x176292,JSON[_0xf7ed('0x11')](_0x4bce02));_0xc5e1c7(_0x4bce02);});});}exports['consequence']=function(_0xbd71f0,_0x1018db){return function(_0x20fdc0){try{if(!_[_0xf7ed('0x12')](this['interaction'][_0xf7ed('0x13')])){logger[_0xf7ed('0xe')](_0xf7ed('0x14'),_0xbd71f0,_0xf7ed('0x15'));return _0x20fdc0[_0xf7ed('0x16')]();}var _0x29b419={'ContactId':this[_0xf7ed('0x17')]['id'],'sentAt':moment()[_0xf7ed('0x18')](_0xf7ed('0x19')),'direction':_0xf7ed('0x1a')};if(this[_0xf7ed('0x1b')]===_0xf7ed('0x1c')||this[_0xf7ed('0x1b')]===_0xf7ed('0x1d')){_0x29b419[_0xf7ed('0x1e')]=this[_0xf7ed('0x1f')][_0xf7ed('0x1e')];}var _0xb10dfc=this[_0xf7ed('0x1b')];if(_0xb10dfc===_0xf7ed('0x20')){_0x29b419['ChatWebsiteId']=this[_0xf7ed('0x21')]['id'];}else{_0x29b419[_[_0xf7ed('0x22')](_0xb10dfc)+_0xf7ed('0x23')]=this['account']['id'];}_0x29b419[_[_0xf7ed('0x22')](_0xb10dfc)+_0xf7ed('0x24')]=this[_0xf7ed('0x1f')]['id'];if(this['interaction']['created']){var _0x52c3d8=_0x1018db[0x4];if(!_['isEmpty'](_0x52c3d8)){_0x29b419[_0xf7ed('0xa')]=utils[_0xf7ed('0x25')](_0x52c3d8,this);return rpc[_0xb10dfc+_0xf7ed('0xb')][_0xf7ed('0xc')](_0x29b419)[_0xf7ed('0xd')](function(_0x428243){logger[_0xf7ed('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0xbd71f0,_0x29b419[_0xf7ed('0xa')]);})[_0xf7ed('0xf')](function(_0x227d48){logger[_0xf7ed('0x10')](_0xf7ed('0x14'),_0xbd71f0,JSON[_0xf7ed('0x11')](_0x227d48));})[_0xf7ed('0x26')](function(){logger[_0xf7ed('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xbd71f0);_0x20fdc0[_0xf7ed('0x27')]();});}else{logger[_0xf7ed('0xe')](_0xf7ed('0x28'),_0xbd71f0);_0x20fdc0[_0xf7ed('0x27')]();}}else{var _0x5e8866=this;var _0x2cea37=_0x1018db[0x2][_0xf7ed('0x29')](/\\n/g,'\x0a');var _0x5b4591={'credentials':{'private_key':_0x2cea37,'client_email':_0x1018db[0x1]}};var _0x50c13b=new dialogflow[(_0xf7ed('0x2a'))](_0x5b4591);var _0x72e2fe=_0x50c13b[_0xf7ed('0x2b')](_0x1018db[0x0],md5(_0x5e8866['interaction']['id']));var _0x855c74={'session':_0x72e2fe,'queryInput':{'text':{'text':_0x5e8866[_0xf7ed('0x2c')][_0xf7ed('0xa')],'languageCode':_0x1018db[0x3]||'en'}}};return _0x50c13b[_0xf7ed('0x2d')](_0x855c74)['then'](function(_0x585111){if(_0x585111&&_0x585111[_0xf7ed('0x2e')]){_0x5e8866[_0xf7ed('0xa')][_0xf7ed('0x2f')]=_0x585111;var _0x136a86=_0x585111[0x0];var _0x1818e4=_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x31')]&&_0x136a86['queryResult'][_0xf7ed('0x31')]['fields']?_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x31')][_0xf7ed('0x32')]['end_conversation']['boolValue']:![];_0x5e8866[_0xf7ed('0xa')]['DIALOGFLOWV2_ACTION']=_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x33')];_0x5e8866['body'][_0xf7ed('0x34')]=_0x136a86['queryResult'][_0xf7ed('0x35')];_0x5e8866[_0xf7ed('0xa')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x31')]&&_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x31')][_0xf7ed('0x32')]?_0x136a86[_0xf7ed('0x30')]['diagnosticInfo'][_0xf7ed('0x32')]['end_conversation'][_0xf7ed('0x36')]:![];_0x5e8866[_0xf7ed('0xa')][_0xf7ed('0x37')]=_0x136a86[_0xf7ed('0x30')]['intent']['name'];_0x5e8866[_0xf7ed('0xa')][_0xf7ed('0x38')]=_0x136a86['queryResult'][_0xf7ed('0x39')][_0xf7ed('0x3a')];_0x5e8866[_0xf7ed('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x136a86[_0xf7ed('0x30')]['intent'][_0xf7ed('0x3b')];_0x5e8866[_0xf7ed('0xa')][_0xf7ed('0x3c')]=_0x136a86[_0xf7ed('0x30')]['languageCode'];_0x5e8866['body'][_0xf7ed('0x3d')]=_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x3e')];_0x5e8866['body'][_0xf7ed('0x3f')]=_0x136a86[_0xf7ed('0x30')][_0xf7ed('0x40')];_0x29b419[_0xf7ed('0x41')]=_0xf7ed('0x2f');_0x29b419['providerResponse']=JSON[_0xf7ed('0x11')](_0x585111);var _0x11dfc1=[];for(var _0x48e99d=0x0;_0x48e99d<_0x585111[_0xf7ed('0x2e')];_0x48e99d++){var _0x4577da=_0x585111[_0x48e99d];if(_0x4577da&&_0x4577da[_0xf7ed('0x30')]&&_0x4577da[_0xf7ed('0x30')]['fulfillmentText']){_0x11dfc1[_0xf7ed('0x42')](createMessage(_0xbd71f0,_0xb10dfc,_0x29b419,_0x4577da[_0xf7ed('0x30')]['fulfillmentText']));}}return Promise[_0xf7ed('0x43')](_0x11dfc1)['then'](function(){if(_0x1818e4){_0x20fdc0[_0xf7ed('0x16')]();}else{_0x20fdc0[_0xf7ed('0x27')]();}})[_0xf7ed('0xf')](function(_0x57869b){logger['error'](_0xf7ed('0x14'),_0xbd71f0,JSON[_0xf7ed('0x11')](_0x57869b));_0x20fdc0[_0xf7ed('0x16')]();});}})['catch'](function(_0x4c2a5d){logger[_0xf7ed('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xbd71f0,_0x4c2a5d[_0xf7ed('0x2c')]);_0x20fdc0[_0xf7ed('0x16')]();});}}catch(_0x3daaaa){logger[_0xf7ed('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xbd71f0,JSON[_0xf7ed('0x11')](_0x3daaaa));_0x20fdc0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 021895f..793aaec 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 _0x095e=['replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString'];(function(_0x6547e1,_0x15d31e){var _0xf4e6d7=function(_0x306148){while(--_0x306148){_0x6547e1['push'](_0x6547e1['shift']());}};_0xf4e6d7(++_0x15d31e);}(_0x095e,0x118));var _0xe095=function(_0x442f3c,_0x46dfff){_0x442f3c=_0x442f3c-0x0;var _0x1dd35b=_0x095e[_0x442f3c];return _0x1dd35b;};'use strict';var schema=require(_0xe095('0x0'));var _=require(_0xe095('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0xe095('0x2'))(_0xe095('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe095('0x4')},'priorityTrue':{'type':'number','message':_0xe095('0x5')},'priorityFalse':{'type':_0xe095('0x6'),'message':_0xe095('0x7')}});exports[_0xe095('0x8')]=function(_0x2b2d20,_0x5d3f00){return function(_0x2b820a){try{var _0x5202d3={'condition':htmlToText[_0xe095('0x9')](utils['getMustacheRender'](_0x5d3f00[0x0],this),{'wordwrap':![]})[_0xe095('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d3f00[0x1],'priorityFalse':_0x5d3f00[0x2]};var _0x3d5241=gotoif[_0xe095('0x0')](_0x5202d3,{'typecast':!![]});if(_0x3d5241[_0xe095('0xb')]){logger['error'](_0xe095('0xc'),_0x2b2d20,_[_0xe095('0xd')](_0x3d5241,_0xe095('0xe'))[_0xe095('0xf')](',\x20'));_0x2b820a[_0xe095('0x10')]();}else{try{var _0x52fc87=eval('('+_0x5202d3[_0xe095('0x11')]+')');var _0x103f65=_0x52fc87?_0x5202d3[_0xe095('0x12')]:_0x5202d3[_0xe095('0x13')];logger[_0xe095('0x14')](_0xe095('0x15'),_0x2b2d20,_0x5202d3[_0xe095('0x11')],_0x52fc87,_0x103f65||_0xe095('0x16'));if(_0x103f65){var _0x3da7f9=_[_0xe095('0x17')](_0x2b820a[_0xe095('0x18')](),{'p':_0x103f65});if(_0x3da7f9>=0x0){logger[_0xe095('0x14')](_0xe095('0x19'),_0x2b2d20,_0x103f65||'next',_0x3da7f9);_0x2b820a['next'](_0x3da7f9);}else{logger[_0xe095('0x14')](_0xe095('0x1a'),_0x2b2d20,_0x103f65||_0xe095('0x16'));_0x2b820a[_0xe095('0x10')]();}}else{_0x2b820a[_0xe095('0x16')]();}}catch(_0x3b268a){logger[_0xe095('0x1b')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2b2d20,_0x3b268a[_0xe095('0xe')]);_0x2b820a[_0xe095('0x10')]();}}}catch(_0x3b6f33){logger[_0xe095('0x1b')](_0xe095('0xc'),_0x2b2d20,JSON[_0xe095('0x1c')](_0x3b6f33));_0x2b820a[_0xe095('0x10')]();}};}; \ No newline at end of file +var _0x73e6=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0x73e6,0x102));var _0x673e=function(_0x4b4706,_0x188138){_0x4b4706=_0x4b4706-0x0;var _0x481390=_0x73e6[_0x4b4706];return _0x481390;};'use strict';var schema=require(_0x673e('0x0'));var _=require(_0x673e('0x1'));var htmlToText=require(_0x673e('0x2'));var utils=require(_0x673e('0x3'));var logger=require(_0x673e('0x4'))(_0x673e('0x5'));var gotoif=schema({'condition':{'type':_0x673e('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x673e('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x673e('0x8')}});exports[_0x673e('0x9')]=function(_0x315f18,_0x2f61c0){return function(_0x2c827a){try{var _0x4c6aed={'condition':htmlToText['fromString'](utils[_0x673e('0xa')](_0x2f61c0[0x0],this),{'wordwrap':![]})[_0x673e('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2f61c0[0x1],'priorityFalse':_0x2f61c0[0x2]};var _0x4899bb=gotoif[_0x673e('0x0')](_0x4c6aed,{'typecast':!![]});if(_0x4899bb[_0x673e('0xc')]){logger[_0x673e('0xd')](_0x673e('0xe'),_0x315f18,_[_0x673e('0xf')](_0x4899bb,_0x673e('0x10'))[_0x673e('0x11')](',\x20'));_0x2c827a[_0x673e('0x12')]();}else{try{var _0x821fe3=eval('('+_0x4c6aed[_0x673e('0x13')]+')');var _0x3451bf=_0x821fe3?_0x4c6aed[_0x673e('0x14')]:_0x4c6aed[_0x673e('0x15')];logger[_0x673e('0x16')](_0x673e('0x17'),_0x315f18,_0x4c6aed[_0x673e('0x13')],_0x821fe3,_0x3451bf||_0x673e('0x18'));if(_0x3451bf){var _0x5e51d6=_['findIndex'](_0x2c827a['rules'](),{'p':_0x3451bf});if(_0x5e51d6>=0x0){logger[_0x673e('0x16')](_0x673e('0x19'),_0x315f18,_0x3451bf||'next',_0x5e51d6);_0x2c827a[_0x673e('0x18')](_0x5e51d6);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x315f18,_0x3451bf||'next');_0x2c827a[_0x673e('0x12')]();}}else{_0x2c827a['next']();}}catch(_0x53b32e){logger[_0x673e('0xd')](_0x673e('0x1a'),_0x315f18,_0x53b32e[_0x673e('0x10')]);_0x2c827a['stop']();}}}catch(_0x407fd2){logger[_0x673e('0xd')](_0x673e('0xe'),_0x315f18,JSON[_0x673e('0x1b')](_0x407fd2));_0x2c827a['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 ef15ee1..0c0aa19 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 _0xe926=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','message','stop','info'];(function(_0x3ecf2c,_0x4f4340){var _0x29bab3=function(_0x4764f8){while(--_0x4764f8){_0x3ecf2c['push'](_0x3ecf2c['shift']());}};_0x29bab3(++_0x4f4340);}(_0xe926,0xb2));var _0x6e92=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0xe926[_0x405385];return _0x43837b;};'use strict';var schema=require('validate');var _=require(_0x6e92('0x0'));var logger=require('../../../../config/logger')(_0x6e92('0x1'));var gotop=schema({'priority':{'type':_0x6e92('0x2'),'required':!![],'message':_0x6e92('0x3')}});exports[_0x6e92('0x4')]=function(_0x40edc1,_0x22d742){return function(_0xa3ef0f){try{var _0x16fd24={'priority':_0x22d742[0x0]};var _0x1e3a5f=gotop[_0x6e92('0x5')](_0x16fd24,{'typecast':!![]});if(_0x1e3a5f[_0x6e92('0x6')]){logger[_0x6e92('0x7')](_0x6e92('0x8'),_0x40edc1,_['map'](_0x1e3a5f,_0x6e92('0x9'))['join'](',\x20'));_0xa3ef0f[_0x6e92('0xa')]();}else{logger[_0x6e92('0xb')](_0x6e92('0xc'),_0x40edc1,_0x16fd24[_0x6e92('0xd')]);if(_0x16fd24['priority']){var _0x16b5aa=_[_0x6e92('0xe')](_0xa3ef0f['rules'](),{'p':_0x16fd24['priority']});if(_0x16b5aa>=0x0){logger['info'](_0x6e92('0xf'),_0x40edc1,_0x16fd24[_0x6e92('0xd')]||'next',_0x16b5aa);_0xa3ef0f[_0x6e92('0x10')](_0x16b5aa);}else{logger['info'](_0x6e92('0x11'),_0x40edc1,_0x16fd24[_0x6e92('0xd')]||_0x6e92('0x10'));_0xa3ef0f[_0x6e92('0xa')]();}}else{_0xa3ef0f[_0x6e92('0x10')]();}}}catch(_0x2784d4){logger[_0x6e92('0x7')](_0x6e92('0x8'),_0x40edc1,JSON[_0x6e92('0x12')](_0x2784d4));_0xa3ef0f[_0x6e92('0xa')]();}};}; \ No newline at end of file +var _0xf0c1=['length','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x7f57b,_0x1f8842){var _0x2e2897=function(_0x31bb03){while(--_0x31bb03){_0x7f57b['push'](_0x7f57b['shift']());}};_0x2e2897(++_0x1f8842);}(_0xf0c1,0x1c3));var _0x1f0c=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xf0c1[_0x27e811];return _0x1627fa;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x1f0c('0x0'))(_0x1f0c('0x1'));var gotop=schema({'priority':{'type':_0x1f0c('0x2'),'required':!![],'message':_0x1f0c('0x3')}});exports[_0x1f0c('0x4')]=function(_0x4461ac,_0x3af192){return function(_0x2f8ed1){try{var _0x5acbdc={'priority':_0x3af192[0x0]};var _0x2845bc=gotop['validate'](_0x5acbdc,{'typecast':!![]});if(_0x2845bc[_0x1f0c('0x5')]){logger[_0x1f0c('0x6')](_0x1f0c('0x7'),_0x4461ac,_[_0x1f0c('0x8')](_0x2845bc,_0x1f0c('0x9'))['join'](',\x20'));_0x2f8ed1[_0x1f0c('0xa')]();}else{logger[_0x1f0c('0xb')](_0x1f0c('0xc'),_0x4461ac,_0x5acbdc[_0x1f0c('0xd')]);if(_0x5acbdc[_0x1f0c('0xd')]){var _0x23931e=_['findIndex'](_0x2f8ed1[_0x1f0c('0xe')](),{'p':_0x5acbdc[_0x1f0c('0xd')]});if(_0x23931e>=0x0){logger['info'](_0x1f0c('0xf'),_0x4461ac,_0x5acbdc[_0x1f0c('0xd')]||_0x1f0c('0x10'),_0x23931e);_0x2f8ed1[_0x1f0c('0x10')](_0x23931e);}else{logger[_0x1f0c('0xb')](_0x1f0c('0x11'),_0x4461ac,_0x5acbdc[_0x1f0c('0xd')]||'next');_0x2f8ed1[_0x1f0c('0xa')]();}}else{_0x2f8ed1[_0x1f0c('0x10')]();}}}catch(_0x2936a7){logger[_0x1f0c('0x6')](_0x1f0c('0x7'),_0x4461ac,JSON[_0x1f0c('0x12')](_0x2936a7));_0x2f8ed1[_0x1f0c('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 67b67c8..39b870c 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 _0x8603=['./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','account','upperFirst','AccountId','channel','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error'];(function(_0x31ad87,_0xb82bee){var _0x5dc642=function(_0xd42334){while(--_0xd42334){_0x31ad87['push'](_0x31ad87['shift']());}};_0x5dc642(++_0xb82bee);}(_0x8603,0x190));var _0x3860=function(_0x41d81a,_0x32ffc9){_0x41d81a=_0x41d81a-0x0;var _0x372a1b=_0x8603[_0x41d81a];return _0x372a1b;};'use strict';var _=require('lodash');var utils=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3860('0x3')),'smsMessage':require(_0x3860('0x4')),'faxMessage':require(_0x3860('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3860('0x6')]=function(_0x56f8c5,_0xb0fc24){return function(_0x40739b){try{var _0x1eca44={'body':utils[_0x3860('0x7')](_0xb0fc24[0x0],this),'ContactId':this[_0x3860('0x8')]['id']};if(this['channel']==='chat'){_0x1eca44['ChatWebsiteId']=this[_0x3860('0x9')]['id'];}else{_0x1eca44[_[_0x3860('0xa')](this['channel'])+_0x3860('0xb')]=this[_0x3860('0x9')]['id'];}_0x1eca44[_['upperFirst'](this[_0x3860('0xc')])+_0x3860('0xd')]=this['interaction']['id'];if(rpc[this[_0x3860('0xc')]+_0x3860('0xe')]){return rpc[this['channel']+_0x3860('0xe')][_0x3860('0xf')](_0x1eca44)[_0x3860('0x10')](function(_0x1ea619){logger[_0x3860('0x11')](_0x3860('0x12'),_0x56f8c5,_0x1eca44[_0x3860('0x13')]);_0x40739b[_0x3860('0x14')]();})[_0x3860('0x15')](function(_0x46264d){logger['error'](_0x3860('0x12'),_0x56f8c5,JSON[_0x3860('0x16')](_0x46264d));_0x40739b[_0x3860('0x17')]();});}}catch(_0x37d9ab){logger[_0x3860('0x18')](_0x3860('0x12'),_0x56f8c5,JSON[_0x3860('0x16')](_0x37d9ab));_0x40739b[_0x3860('0x17')]();}};}; \ No newline at end of file +var _0xe68c=['interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','AccountId','account','InteractionId'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xe68c,0xfd));var _0xce68=function(_0x4c2c23,_0x3d8d28){_0x4c2c23=_0x4c2c23-0x0;var _0x5c992e=_0xe68c[_0x4c2c23];return _0x5c992e;};'use strict';var _=require(_0xce68('0x0'));var utils=require(_0xce68('0x1'));var logger=require('../../../../config/logger')(_0xce68('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xce68('0x3')),'mailMessage':require(_0xce68('0x4')),'smsMessage':require(_0xce68('0x5')),'faxMessage':require(_0xce68('0x6')),'whatsappMessage':require(_0xce68('0x7'))};exports[_0xce68('0x8')]=function(_0x478c08,_0x341561){return function(_0x4526d9){try{var _0x452b8a={'body':utils[_0xce68('0x9')](_0x341561[0x0],this),'ContactId':this[_0xce68('0xa')]['id']};if(this[_0xce68('0xb')]===_0xce68('0xc')){_0x452b8a['ChatWebsiteId']=this['account']['id'];}else{_0x452b8a[_[_0xce68('0xd')](this['channel'])+_0xce68('0xe')]=this[_0xce68('0xf')]['id'];}_0x452b8a[_[_0xce68('0xd')](this[_0xce68('0xb')])+_0xce68('0x10')]=this[_0xce68('0x11')]['id'];if(rpc[this[_0xce68('0xb')]+'Message']){return rpc[this[_0xce68('0xb')]+'Message'][_0xce68('0x12')](_0x452b8a)[_0xce68('0x13')](function(_0x560798){logger[_0xce68('0x14')](_0xce68('0x15'),_0x478c08,_0x452b8a[_0xce68('0x16')]);_0x4526d9[_0xce68('0x17')]();})['catch'](function(_0x3b5f03){logger[_0xce68('0x18')](_0xce68('0x15'),_0x478c08,JSON[_0xce68('0x19')](_0x3b5f03));_0x4526d9['stop']();});}}catch(_0x408b78){logger[_0xce68('0x18')]('[%s][MESSAGE]\x20%s',_0x478c08,JSON[_0xce68('0x19')](_0x408b78));_0x4526d9[_0xce68('0x1a')]();}};}; \ 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 5ee98a1..f134e47 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 _0x6c1f=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','./utils','../../../../config/logger','routing'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6c1f,0xc3));var _0xf6c1=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0x6c1f[_0x2e4a0f];return _0x25a3cd;};'use strict';var utils=require(_0xf6c1('0x0'));var logger=require(_0xf6c1('0x1'))(_0xf6c1('0x2'));exports[_0xf6c1('0x3')]=function(_0x376ca5,_0x2682a1){return function(_0x5aae4a){try{logger[_0xf6c1('0x4')](_0xf6c1('0x5'),_0x376ca5,utils[_0xf6c1('0x6')](_0x2682a1[0x0],this));_0x5aae4a[_0xf6c1('0x7')]();}catch(_0x5503d1){logger['error'](_0xf6c1('0x5'),_0x376ca5,JSON[_0xf6c1('0x8')](_0x5503d1));_0x5aae4a['stop']();}};}; \ No newline at end of file +var _0x301a=['next','error','stringify','./utils','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x1327f7,_0x574202){var _0xa7a00c=function(_0x4cfe0b){while(--_0x4cfe0b){_0x1327f7['push'](_0x1327f7['shift']());}};_0xa7a00c(++_0x574202);}(_0x301a,0xf1));var _0xa301=function(_0x33c2b5,_0x1c0cd1){_0x33c2b5=_0x33c2b5-0x0;var _0x4a47e7=_0x301a[_0x33c2b5];return _0x4a47e7;};'use strict';var utils=require(_0xa301('0x0'));var logger=require('../../../../config/logger')('routing');exports['consequence']=function(_0x18e526,_0x23ea4b){return function(_0x5242c7){try{logger[_0xa301('0x1')](_0xa301('0x2'),_0x18e526,utils[_0xa301('0x3')](_0x23ea4b[0x0],this));_0x5242c7[_0xa301('0x4')]();}catch(_0x3be3da){logger[_0xa301('0x5')](_0xa301('0x2'),_0x18e526,JSON[_0xa301('0x6')](_0x3be3da));_0x5242c7['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 d016b1c..53ad69b 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 _0x8027=['accepted','info','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','length','error','[%s][QUEUE]\x20%s','map','join','stop','find','timeout','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','push','capitalize','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','timeout\x20is\x20a\x20number','waiting','body','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x8027,0x1f1));var _0x7802=function(_0x20c809,_0x26b566){_0x20c809=_0x20c809-0x0;var _0x1064a1=_0x8027[_0x20c809];return _0x1064a1;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x7802('0x0'));var seqqueue=require(_0x7802('0x1'));var moment=require(_0x7802('0x2'));var Redis=require(_0x7802('0x3'));var config=require(_0x7802('0x4'));var logger=require(_0x7802('0x5'))(_0x7802('0x6'));var strategy=require('./strategy');config[_0x7802('0x7')]=_[_0x7802('0x8')](config[_0x7802('0x7')],{'host':_0x7802('0x9'),'port':0x18eb});var io=require(_0x7802('0xa'))(new Redis(config[_0x7802('0x7')]));var attributes=['id',_0x7802('0xb'),_0x7802('0xc'),_0x7802('0xd'),'from',_0x7802('0xe')];function emit(_0x10fac7,_0x1f0dc0,_0x3338ad){io['to'](_0x10fac7)[_0x7802('0xf')](_0x1f0dc0,_0x3338ad);}function emitChannelQueueInteraction(_0x288901,_0x56dc8a,_0x37acab,_0x610626,_0x1bf9c1,_0x8c7d31,_0x2a3ec0,_0x297559){var _0x473cb2=_[_0x7802('0x10')](_0x37acab);_0x473cb2[_0x7802('0xb')]=_0x297559;_0x473cb2[_0x7802('0xd')]=_0x56dc8a;_0x473cb2[_0x7802('0xc')]=_0x610626;_0x473cb2['id']=_0x1bf9c1;if(_0x8c7d31){attributes[_0x7802('0x11')](_[_0x7802('0x12')](_0x288901)+'InteractionId');_0x2a3ec0[util[_0x7802('0x13')]('%sQueuesWaitingInteractions',_0x288901)][_0x1bf9c1]=_[_0x7802('0x14')](_0x473cb2,attributes);}else{delete _0x2a3ec0[util[_0x7802('0x13')](_0x7802('0x15'),_0x288901)][_0x1bf9c1];}emit(util[_0x7802('0x13')]('%s:queue:%s',_0x288901,_0x56dc8a),util[_0x7802('0x13')](_0x7802('0x16'),_0x288901,_0x8c7d31?_0x7802('0x17'):_0x7802('0x18')),_[_0x7802('0x14')](_0x473cb2,attributes));}var rpc={'openchannelQueueReport':require(_0x7802('0x19')),'mailQueueReport':require(_0x7802('0x1a')),'chatQueueReport':require(_0x7802('0x1b')),'smsQueueReport':require(_0x7802('0x1c')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x7802('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7802('0x1e')}});function startRouting(_0x51d947,_0x9c4065,_0x54f6b2,_0x25c5f9){if(_0x51d947&&_0x9c4065&&_0x54f6b2){_0x9c4065[_0x7802('0x1f')]+=0x1;var _0x4cc8b9={'uniqueid':_0x51d947,'from':_0x54f6b2[_0x7802('0x20')]?_0x54f6b2[_0x7802('0x20')]['from']:'','joinAt':moment()[_0x7802('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54f6b2['contact']?_0x54f6b2['contact']['id']:null,'ListId':_0x54f6b2[_0x7802('0x21')]?_0x54f6b2['list']['id']:null};_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2['channel'])+_0x7802('0x23')]=_0x9c4065['id']||null;_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2[_0x7802('0x24')])+_0x7802('0x25')]=_0x54f6b2[_0x7802('0x26')]?_0x54f6b2[_0x7802('0x26')]['id']:null;_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2[_0x7802('0x24')])+_0x7802('0x27')]=_0x54f6b2['message']?_0x54f6b2[_0x7802('0x28')]['id']:null;_0x4cc8b9[_[_0x7802('0x22')](_0x54f6b2[_0x7802('0x24')])+(_0x54f6b2[_0x7802('0x24')]!==_0x7802('0x29')?'AccountId':_0x7802('0x2a'))]=_0x54f6b2['account']?_0x54f6b2[_0x7802('0xc')]['id']:null;logger['info'](util[_0x7802('0x13')](_0x7802('0x2b'),_0x51d947,_0x9c4065[_0x7802('0x2c')]));emitChannelQueueInteraction(_0x54f6b2[_0x7802('0x24')],_0x9c4065[_0x7802('0x2c')],_0x4cc8b9,_0x54f6b2[_0x7802('0xc')]['name'],_0x54f6b2['message']['id'],!![],_0x25c5f9,_0x9c4065['id']);if(rpc[_0x54f6b2[_0x7802('0x24')]+'QueueReport']){return rpc[_0x54f6b2['channel']+_0x7802('0x2d')]['create'](_0x4cc8b9)[_0x7802('0x2e')](function(_0x2c18e8){logger['error'](_0x7802('0x2f'));});}}}function stopRouting(_0x387502,_0x419d7a,_0x335442,_0x400d9a){if(_0x387502&&_0x419d7a){_0x419d7a[_0x7802('0x1f')]-=0x1;var _0x377532={'leaveAt':moment()['format'](_0x7802('0x30')),'acceptAt':moment()[_0x7802('0x13')](_0x7802('0x30')),'reason':_0x7802('0x31')};logger[_0x7802('0x32')](util[_0x7802('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x387502,_0x419d7a['name']));emitChannelQueueInteraction(_0x335442[_0x7802('0x24')],_0x419d7a[_0x7802('0x2c')],_0x335442['body'],_0x335442[_0x7802('0xc')]['name'],_0x335442[_0x7802('0x28')]['id'],![],_0x400d9a,_0x419d7a['id']);if(rpc[_0x335442[_0x7802('0x24')]+_0x7802('0x2d')]){return rpc[_0x335442[_0x7802('0x24')]+'QueueReport']['update'](_0x387502,_0x377532)[_0x7802('0x2e')](function(_0x5c3bf6){logger['error'](_0x7802('0x33'));});}}}function endRouting(_0x5cab51,_0xfe88fb,_0x4d5054,_0x36595d){if(_0x5cab51&&_0xfe88fb){_0xfe88fb[_0x7802('0x1f')]-=0x1;var _0x1c8b64={'leaveAt':moment()[_0x7802('0x13')](_0x7802('0x30')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x7802('0x32')](util[_0x7802('0x13')](_0x7802('0x34'),_0x5cab51,_0xfe88fb[_0x7802('0x2c')]));emitChannelQueueInteraction(_0x4d5054[_0x7802('0x24')],_0xfe88fb[_0x7802('0x2c')],_0x4d5054[_0x7802('0x20')],_0x4d5054['account'][_0x7802('0x2c')],_0x4d5054[_0x7802('0x28')]['id'],![],_0x36595d);if(rpc[_0x4d5054[_0x7802('0x24')]+'QueueReport']){return rpc[_0x4d5054[_0x7802('0x24')]+_0x7802('0x2d')][_0x7802('0x35')](_0x5cab51,_0x1c8b64)[_0x7802('0x2e')](function(_0x942a13){logger['error'](_0x7802('0x33'));});}}}function handleFindQueue(_0x2ae1b0){return function(_0x225ea5){return _0x225ea5['name']['toLowerCase']()===_0x2ae1b0[_0x7802('0x36')]();};}exports[_0x7802('0x37')]=function(_0x2fd949,_0x36120b,_0x516c1e,_0x4e9489){return function(_0x2c2ca0){try{var _0x480a36={'name':_0x36120b[0x0],'timeout':_0x36120b[0x1]};var _0x19db5a=queue[_0x7802('0x38')](_0x480a36,{'typecast':!![]});if(_0x19db5a[_0x7802('0x39')]){logger[_0x7802('0x3a')](_0x7802('0x3b'),_0x2fd949,_[_0x7802('0x3c')](_0x19db5a,_0x7802('0x28'))[_0x7802('0x3d')](',\x20'));_0x2c2ca0[_0x7802('0x3e')]();}else{var _0x361ffb=_[_0x7802('0x3f')](_0x516c1e[_0x4e9489[_0x7802('0x24')]+'Queues'],handleFindQueue(_0x480a36[_0x7802('0x2c')]));if(_0x361ffb){startRouting(_0x2fd949,_0x361ffb,_0x4e9489,_0x516c1e);var _0x2b950f=(_0x361ffb[_0x7802('0x40')]||0xa)*0x3e8;var _0x24e3bf=(_0x480a36[_0x7802('0x40')]||0x14)*0x3e8;var _0x368bd7;if(_0x2b950f>_0x24e3bf){_0x24e3bf=_0x2b950f;}var _0x5e03e3=seqqueue[_0x7802('0x41')](_0x2b950f);_0x5e03e3['id']=_0x2fd949;_0x5e03e3[_0x7802('0x42')]=_0x2b950f;_0x5e03e3['qtimeout']=_0x24e3bf;_0x5e03e3['channel']=_0x4e9489['channel'];_0x516c1e['rules'][_0x2fd949]['on'](_0x7802('0x43'),function(){logger[_0x7802('0x32')](_0x7802('0x44'),_0x2fd949);stopRouting(_0x2fd949,_0x361ffb,_0x4e9489,_0x516c1e);clearTimeout(_0x368bd7);_0x368bd7=undefined;_0x5e03e3['close'](!![]);if(_0x516c1e[_0x7802('0x45')][_0x2fd949]){delete _0x516c1e['rules'][_0x2fd949];}_0x2c2ca0[_0x7802('0x3e')]();});_0x516c1e['rules'][_0x2fd949]['on'](_0x7802('0x46'),function(){if(_0x516c1e['rules'][_0x2fd949]){delete _0x516c1e[_0x7802('0x45')][_0x2fd949];}});_0x368bd7=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x2fd949);endRouting(_0x2fd949,_0x361ffb,_0x4e9489,_0x516c1e);clearTimeout(_0x368bd7);_0x5e03e3[_0x7802('0x47')](!![]);_0x2c2ca0[_0x7802('0x48')]();},_0x24e3bf);switch(_0x361ffb[_0x7802('0x49')]){case _0x7802('0x4a'):strategy['rrmemory'](_0x5e03e3,_0x361ffb,_0x516c1e,_0x4e9489);break;default:strategy[_0x7802('0x4b')](_0x5e03e3,_0x361ffb,_0x516c1e,_0x4e9489);}}else{logger[_0x7802('0x3a')](_0x7802('0x4c'),_0x2fd949,_0x480a36[_0x7802('0x2c')]);_0x2c2ca0[_0x7802('0x3e')]();}}}catch(_0xa3283b){console[_0x7802('0x4d')](_0xa3283b);logger['error']('[%s][QUEUE]\x20%s',_0x2fd949,_0xa3283b['stack']);_0x2c2ca0['stop']();}};}; \ No newline at end of file +var _0xa908=['rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','accepted','update','error','update\x20queue\x20report','timeout','toLowerCase','join','stop','find','Queues','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x464cde,_0x383009){var _0x190615=function(_0x12c029){while(--_0x12c029){_0x464cde['push'](_0x464cde['shift']());}};_0x190615(++_0x383009);}(_0xa908,0x1de));var _0x8a90=function(_0xace953,_0x338468){_0xace953=_0xace953-0x0;var _0x5b5c4b=_0xa908[_0xace953];return _0x5b5c4b;};'use strict';var schema=require(_0x8a90('0x0'));var _=require(_0x8a90('0x1'));var util=require(_0x8a90('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x8a90('0x3'));var Redis=require(_0x8a90('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8a90('0x5'))(_0x8a90('0x6'));var strategy=require(_0x8a90('0x7'));config['redis']=_['defaults'](config[_0x8a90('0x8')],{'host':_0x8a90('0x9'),'port':0x18eb});var io=require(_0x8a90('0xa'))(new Redis(config['redis']));var attributes=['id',_0x8a90('0xb'),_0x8a90('0xc'),_0x8a90('0xd'),_0x8a90('0xe'),_0x8a90('0xf')];function emit(_0x66aadd,_0xd28a29,_0x4b8777){io['to'](_0x66aadd)[_0x8a90('0x10')](_0xd28a29,_0x4b8777);}function emitChannelQueueInteraction(_0x151df5,_0x4f5f13,_0xf5e869,_0x2c9df6,_0x3986b7,_0x4e8d36,_0xc12236,_0x30584f){var _0x3158e6=_['clone'](_0xf5e869);_0x3158e6[_0x8a90('0xb')]=_0x30584f;_0x3158e6['queue']=_0x4f5f13;_0x3158e6['account']=_0x2c9df6;_0x3158e6['id']=_0x3986b7;if(_0x4e8d36){attributes[_0x8a90('0x11')](_[_0x8a90('0x12')](_0x151df5)+_0x8a90('0x13'));_0xc12236[util[_0x8a90('0x14')]('%sQueuesWaitingInteractions',_0x151df5)][_0x3986b7]=_[_0x8a90('0x15')](_0x3158e6,attributes);}else{delete _0xc12236[util['format'](_0x8a90('0x16'),_0x151df5)][_0x3986b7];}emit(util['format'](_0x8a90('0x17'),_0x151df5,_0x4f5f13),util[_0x8a90('0x14')](_0x8a90('0x18'),_0x151df5,_0x4e8d36?_0x8a90('0x19'):_0x8a90('0x1a')),_[_0x8a90('0x15')](_0x3158e6,attributes));}var rpc={'openchannelQueueReport':require(_0x8a90('0x1b')),'mailQueueReport':require(_0x8a90('0x1c')),'chatQueueReport':require(_0x8a90('0x1d')),'smsQueueReport':require(_0x8a90('0x1e')),'faxQueueReport':require(_0x8a90('0x1f')),'whatsappQueueReport':require(_0x8a90('0x20'))};var queue=schema({'name':{'type':_0x8a90('0x21'),'required':!![],'message':_0x8a90('0x22')},'timeout':{'type':'number','message':_0x8a90('0x23')}});function startRouting(_0x5ef3da,_0x455d26,_0x3a5a6c,_0x14bf12){if(_0x5ef3da&&_0x455d26&&_0x3a5a6c){_0x455d26[_0x8a90('0x24')]+=0x1;var _0x15d1e9={'uniqueid':_0x5ef3da,'from':_0x3a5a6c[_0x8a90('0x25')]?_0x3a5a6c[_0x8a90('0x25')][_0x8a90('0xe')]:'','joinAt':moment()[_0x8a90('0x14')](_0x8a90('0x26')),'ContactId':_0x3a5a6c['contact']?_0x3a5a6c['contact']['id']:null,'ListId':_0x3a5a6c['list']?_0x3a5a6c[_0x8a90('0x27')]['id']:null};_0x15d1e9[_[_0x8a90('0x28')](_0x3a5a6c[_0x8a90('0x29')])+'QueueId']=_0x455d26['id']||null;_0x15d1e9[_[_0x8a90('0x28')](_0x3a5a6c[_0x8a90('0x29')])+_0x8a90('0x13')]=_0x3a5a6c[_0x8a90('0x2a')]?_0x3a5a6c[_0x8a90('0x2a')]['id']:null;_0x15d1e9[_['upperFirst'](_0x3a5a6c[_0x8a90('0x29')])+_0x8a90('0x2b')]=_0x3a5a6c['message']?_0x3a5a6c[_0x8a90('0x2c')]['id']:null;_0x15d1e9[_[_0x8a90('0x28')](_0x3a5a6c[_0x8a90('0x29')])+(_0x3a5a6c[_0x8a90('0x29')]!==_0x8a90('0x2d')?'AccountId':_0x8a90('0x2e'))]=_0x3a5a6c['account']?_0x3a5a6c[_0x8a90('0xc')]['id']:null;logger[_0x8a90('0x2f')](util[_0x8a90('0x14')](_0x8a90('0x30'),_0x5ef3da,_0x455d26['name']));emitChannelQueueInteraction(_0x3a5a6c['channel'],_0x455d26[_0x8a90('0x31')],_0x15d1e9,_0x3a5a6c['account']['name'],_0x3a5a6c[_0x8a90('0x2c')]['id'],!![],_0x14bf12,_0x455d26['id']);if(rpc[_0x3a5a6c[_0x8a90('0x29')]+_0x8a90('0x32')]){return rpc[_0x3a5a6c['channel']+_0x8a90('0x32')]['create'](_0x15d1e9)[_0x8a90('0x33')](function(_0x34ee5b){logger['error'](_0x8a90('0x34'));});}}}function stopRouting(_0x45e42e,_0x3a7411,_0x25191a,_0x13e2d5){if(_0x45e42e&&_0x3a7411){_0x3a7411[_0x8a90('0x24')]-=0x1;var _0x39d632={'leaveAt':moment()['format'](_0x8a90('0x26')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8a90('0x35')};logger[_0x8a90('0x2f')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x45e42e,_0x3a7411['name']));emitChannelQueueInteraction(_0x25191a[_0x8a90('0x29')],_0x3a7411[_0x8a90('0x31')],_0x25191a[_0x8a90('0x25')],_0x25191a['account'][_0x8a90('0x31')],_0x25191a[_0x8a90('0x2c')]['id'],![],_0x13e2d5,_0x3a7411['id']);if(rpc[_0x25191a[_0x8a90('0x29')]+'QueueReport']){return rpc[_0x25191a[_0x8a90('0x29')]+_0x8a90('0x32')][_0x8a90('0x36')](_0x45e42e,_0x39d632)[_0x8a90('0x33')](function(_0xafe0b5){logger[_0x8a90('0x37')](_0x8a90('0x38'));});}}}function endRouting(_0x4b5b26,_0x309014,_0x138e0c,_0x4676f8){if(_0x4b5b26&&_0x309014){_0x309014['waiting']-=0x1;var _0x56b419={'leaveAt':moment()[_0x8a90('0x14')](_0x8a90('0x26')),'exitAt':moment()['format'](_0x8a90('0x26')),'reason':_0x8a90('0x39')};logger[_0x8a90('0x2f')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x4b5b26,_0x309014[_0x8a90('0x31')]));emitChannelQueueInteraction(_0x138e0c[_0x8a90('0x29')],_0x309014[_0x8a90('0x31')],_0x138e0c[_0x8a90('0x25')],_0x138e0c['account'][_0x8a90('0x31')],_0x138e0c[_0x8a90('0x2c')]['id'],![],_0x4676f8);if(rpc[_0x138e0c[_0x8a90('0x29')]+'QueueReport']){return rpc[_0x138e0c[_0x8a90('0x29')]+_0x8a90('0x32')]['update'](_0x4b5b26,_0x56b419)[_0x8a90('0x33')](function(_0x48a4a6){logger[_0x8a90('0x37')](_0x8a90('0x38'));});}}}function handleFindQueue(_0x34526d){return function(_0x3620bd){return _0x3620bd[_0x8a90('0x31')][_0x8a90('0x3a')]()===_0x34526d['toLowerCase']();};}exports['consequence']=function(_0x4171db,_0x14d4e8,_0x3e5d47,_0x26b836){return function(_0x171c92){try{var _0x695c38={'name':_0x14d4e8[0x0],'timeout':_0x14d4e8[0x1]};var _0x584d2c=queue[_0x8a90('0x0')](_0x695c38,{'typecast':!![]});if(_0x584d2c['length']){logger['error']('[%s][QUEUE]\x20%s',_0x4171db,_['map'](_0x584d2c,_0x8a90('0x2c'))[_0x8a90('0x3b')](',\x20'));_0x171c92[_0x8a90('0x3c')]();}else{var _0x158113=_[_0x8a90('0x3d')](_0x3e5d47[_0x26b836[_0x8a90('0x29')]+_0x8a90('0x3e')],handleFindQueue(_0x695c38[_0x8a90('0x31')]));if(_0x158113){startRouting(_0x4171db,_0x158113,_0x26b836,_0x3e5d47);var _0x59a3e1=(_0x158113[_0x8a90('0x39')]||0xa)*0x3e8;var _0x33ec0c=(_0x695c38[_0x8a90('0x39')]||0x14)*0x3e8;var _0x569c41;if(_0x59a3e1>_0x33ec0c){_0x33ec0c=_0x59a3e1;}var _0xdf3d43=seqqueue['createQueue'](_0x59a3e1);_0xdf3d43['id']=_0x4171db;_0xdf3d43[_0x8a90('0x3f')]=_0x59a3e1;_0xdf3d43[_0x8a90('0x40')]=_0x33ec0c;_0xdf3d43[_0x8a90('0x29')]=_0x26b836['channel'];_0x3e5d47['rules'][_0x4171db]['on'](_0x8a90('0x41'),function(){logger[_0x8a90('0x2f')](_0x8a90('0x42'),_0x4171db);stopRouting(_0x4171db,_0x158113,_0x26b836,_0x3e5d47);clearTimeout(_0x569c41);_0x569c41=undefined;_0xdf3d43[_0x8a90('0x43')](!![]);if(_0x3e5d47[_0x8a90('0x44')][_0x4171db]){delete _0x3e5d47[_0x8a90('0x44')][_0x4171db];}_0x171c92[_0x8a90('0x3c')]();});_0x3e5d47['rules'][_0x4171db]['on'](_0x8a90('0x45'),function(){if(_0x3e5d47[_0x8a90('0x44')][_0x4171db]){delete _0x3e5d47[_0x8a90('0x44')][_0x4171db];}});_0x569c41=setTimeout(function(){logger[_0x8a90('0x2f')](_0x8a90('0x46'),_0x4171db);endRouting(_0x4171db,_0x158113,_0x26b836,_0x3e5d47);clearTimeout(_0x569c41);_0xdf3d43[_0x8a90('0x43')](!![]);_0x171c92[_0x8a90('0x47')]();},_0x33ec0c);switch(_0x158113[_0x8a90('0x48')]){case _0x8a90('0x49'):strategy[_0x8a90('0x49')](_0xdf3d43,_0x158113,_0x3e5d47,_0x26b836);break;default:strategy[_0x8a90('0x4a')](_0xdf3d43,_0x158113,_0x3e5d47,_0x26b836);}}else{logger['error'](_0x8a90('0x4b'),_0x4171db,_0x695c38[_0x8a90('0x31')]);_0x171c92['stop']();}}}catch(_0x20a9d5){console[_0x8a90('0x4c')](_0x20a9d5);logger[_0x8a90('0x37')](_0x8a90('0x4d'),_0x4171db,_0x20a9d5['stack']);_0x171c92[_0x8a90('0x3c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index c47706b..abe7d3b 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 _0xdb94=['agents','channel','busy','busyQueue','showNotification','notificationId','writeLog','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','exports','uuid','./util','routing','squeue','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xdb94,0xe5));var _0x4db9=function(_0x1f03fd,_0x5045ed){_0x1f03fd=_0x1f03fd-0x0;var _0x5ab16b=_0xdb94[_0x1f03fd];return _0x5ab16b;};'use strict';var _=require('lodash');var uuid=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require('../../../../../config/logger')(_0x4db9('0x2'));var Agent=function(_0x3b24a6,_0x25b510,_0x2e85f4,_0x1f05d4){this['notificationId']=uuid['v4']();this[_0x4db9('0x3')]=_0x3b24a6;this['agent']=_0x25b510;this[_0x4db9('0x4')]=_0x2e85f4;this[_0x4db9('0x2')]=_0x1f05d4;this[_0x4db9('0x3')][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this[_0x4db9('0x7')][_0x4db9('0x8')](this));this[_0x4db9('0x3')]['on'](_0x4db9('0x9'),this[_0x4db9('0x7')]['bind'](this));this[_0x4db9('0x3')]['on'](_0x4db9('0xa'),this[_0x4db9('0xb')][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0x5')]=function(){this['squeue'][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this['handleTimeout'][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x4db9('0xc')][_0x4db9('0x6')]=function(){logger[_0x4db9('0xd')](_0x4db9('0xe'),this[_0x4db9('0x3')]['id'],this['agent']['id']);if(_[_0x4db9('0xf')](this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']])){logger[_0x4db9('0xd')](_0x4db9('0x11'),this['squeue']['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x4db9('0x12')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],this[_0x4db9('0x3')][_0x4db9('0x14')],![])){this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=!![];this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util['saveWaitingNotification'](this[_0x4db9('0x4')],this[_0x4db9('0x2')],this['agent'],this[_0x4db9('0x3')][_0x4db9('0x14')]);util[_0x4db9('0x17')](this[_0x4db9('0x18')],this['squeue']['id'],this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']],null,this[_0x4db9('0x2')]);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],'RINGING'+(this['routing'][_0x4db9('0x1a')]?':FORCED':''));}else{logger[_0x4db9('0xd')](_0x4db9('0x1b'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')][_0x4db9('0x8')](this),0x3e8);}}};Agent[_0x4db9('0xc')][_0x4db9('0x7')]=function(_0x4c4a47){if(_[_0x4db9('0xf')](this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']])){return logger[_0x4db9('0xd')](_0x4db9('0x11'),this[_0x4db9('0x3')]['id'],this['agent']['id']);}else{logger[_0x4db9('0xd')](_0x4db9('0x1c'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);util['hideNotification'](this['notificationId'],this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')]['agents'][this['agent']['id']],null,this[_0x4db9('0x2')]);this['realtime']['agents'][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=![];this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util[_0x4db9('0x1d')](this['realtime'],this[_0x4db9('0x2')],this['agent'],this['squeue']['channel']);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],_0x4c4a47?'STOP':'TIMEOUT');}if(!_0x4c4a47){setTimeout(this['push'][_0x4db9('0x8')](this),0x3e8);}};function agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e){return new Agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e);}module[_0x4db9('0x1e')]=agent; \ No newline at end of file +var _0x9b9b=['hideNotification','busyQueue','removeWaitingNotification','writeLog','STOP','exports','uuid','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','channel','busy','saveWaitingNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x137e60,_0x369570){var _0x241b23=function(_0x4cd956){while(--_0x4cd956){_0x137e60['push'](_0x137e60['shift']());}};_0x241b23(++_0x369570);}(_0x9b9b,0x114));var _0xb9b9=function(_0x2f06b3,_0x12feb6){_0x2f06b3=_0x2f06b3-0x0;var _0x270d4d=_0x9b9b[_0x2f06b3];return _0x270d4d;};'use strict';var _=require('lodash');var uuid=require(_0xb9b9('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xb9b9('0x1'));var Agent=function(_0x153734,_0x1adf50,_0x1f6fea,_0x1d6ab6){this[_0xb9b9('0x2')]=uuid['v4']();this[_0xb9b9('0x3')]=_0x153734;this[_0xb9b9('0x4')]=_0x1adf50;this[_0xb9b9('0x5')]=_0x1f6fea;this[_0xb9b9('0x1')]=_0x1d6ab6;this[_0xb9b9('0x3')][_0xb9b9('0x6')](this[_0xb9b9('0x7')][_0xb9b9('0x8')](this),this[_0xb9b9('0x9')][_0xb9b9('0x8')](this));this['squeue']['on']('timeout',this[_0xb9b9('0x9')][_0xb9b9('0x8')](this));this[_0xb9b9('0x3')]['on']('drained',this[_0xb9b9('0xa')][_0xb9b9('0x8')](this));};Agent[_0xb9b9('0xb')]['push']=function(){this[_0xb9b9('0x3')][_0xb9b9('0x6')](this[_0xb9b9('0x7')][_0xb9b9('0x8')](this),this[_0xb9b9('0x9')][_0xb9b9('0x8')](this));};Agent['prototype']['handleDrained']=function(){this[_0xb9b9('0x9')](!![]);};Agent['prototype'][_0xb9b9('0x7')]=function(){logger['debug'](_0xb9b9('0xc'),this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x4')]['id']);if(_[_0xb9b9('0xd')](this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']])){logger[_0xb9b9('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb9b9('0x3')]['id'],this['agent']['id']);setTimeout(this[_0xb9b9('0x6')][_0xb9b9('0x8')](this),0x3e8);}else{if(this[_0xb9b9('0x1')][_0xb9b9('0x10')]||util['isAgentAvailable'](this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']],this[_0xb9b9('0x3')][_0xb9b9('0x11')],![])){this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']][_0xb9b9('0x12')]=!![];this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']]['busyQueue']=undefined;util[_0xb9b9('0x13')](this[_0xb9b9('0x5')],this[_0xb9b9('0x1')],this['agent'],this[_0xb9b9('0x3')][_0xb9b9('0x11')]);util['showNotification'](this[_0xb9b9('0x2')],this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']],null,this['routing']);util['writeLog'](this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')]['agents'][this[_0xb9b9('0x4')]['id']],_0xb9b9('0x14')+(this[_0xb9b9('0x1')][_0xb9b9('0x10')]?_0xb9b9('0x15'):''));}else{logger['debug'](_0xb9b9('0x16'),this['squeue']['id'],this[_0xb9b9('0x4')]['id']);setTimeout(this[_0xb9b9('0x6')]['bind'](this),0x3e8);}}};Agent[_0xb9b9('0xb')][_0xb9b9('0x9')]=function(_0x17a6f6){if(_['isNil'](this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']])){return logger[_0xb9b9('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x4')]['id']);}else{logger['debug'](_0xb9b9('0x17'),this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x4')]['id']);util[_0xb9b9('0x18')](this['notificationId'],this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']],null,this['routing']);this[_0xb9b9('0x5')][_0xb9b9('0xe')][this['agent']['id']][_0xb9b9('0x12')]=![];this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']][_0xb9b9('0x19')]=undefined;util[_0xb9b9('0x1a')](this['realtime'],this[_0xb9b9('0x1')],this[_0xb9b9('0x4')],this['squeue'][_0xb9b9('0x11')]);util[_0xb9b9('0x1b')](this[_0xb9b9('0x3')]['id'],this['realtime'][_0xb9b9('0xe')][this['agent']['id']],_0x17a6f6?_0xb9b9('0x1c'):'TIMEOUT');}if(!_0x17a6f6){setTimeout(this[_0xb9b9('0x6')][_0xb9b9('0x8')](this),0x3e8);}};function agent(_0x22b567,_0x1f1faf,_0x3dd3fe,_0x76f4d4){return new Agent(_0x22b567,_0x1f1faf,_0x3dd3fe,_0x76f4d4);}module[_0xb9b9('0x1d')]=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 7078d83..a62007a 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 _0x4f30=['RINGING','busyQueue','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','TIMEOUT','busy','removeWaitingNotification','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','bind','handleTimeout','drained','handleDrained','prototype','push','handleRun','isNil','Agents','length','debug','isAgentAvailable','agents','channel','writeLog'];(function(_0x182d67,_0x1f27ab){var _0x20a02e=function(_0x595266){while(--_0x595266){_0x182d67['push'](_0x182d67['shift']());}};_0x20a02e(++_0x1f27ab);}(_0x4f30,0x146));var _0x04f3=function(_0x33d08c,_0x309846){_0x33d08c=_0x33d08c-0x0;var _0x14fb66=_0x4f30[_0x33d08c];return _0x14fb66;};'use strict';var _=require(_0x04f3('0x0'));var uuid=require(_0x04f3('0x1'));var util=require(_0x04f3('0x2'));var logger=require(_0x04f3('0x3'))(_0x04f3('0x4'));var Beepall=function(_0x575e7f,_0x1cf5bc,_0x11e562,_0x19a880){this[_0x04f3('0x5')]=uuid['v4']();this['squeue']=_0x575e7f;this[_0x04f3('0x6')]=_0x1cf5bc;this[_0x04f3('0x7')]=_0x11e562;this[_0x04f3('0x4')]=_0x19a880;this[_0x04f3('0x8')]['push'](this['handleRun'][_0x04f3('0x9')](this),this[_0x04f3('0xa')]['bind'](this));this['squeue']['on']('timeout',this[_0x04f3('0xa')][_0x04f3('0x9')](this));this[_0x04f3('0x8')]['on'](_0x04f3('0xb'),this[_0x04f3('0xc')][_0x04f3('0x9')](this));};Beepall[_0x04f3('0xd')][_0x04f3('0xe')]=function(){this[_0x04f3('0x8')][_0x04f3('0xe')](this[_0x04f3('0xf')][_0x04f3('0x9')](this),this[_0x04f3('0xa')][_0x04f3('0x9')](this));};Beepall['prototype'][_0x04f3('0xc')]=function(){this['handleTimeout'](!![]);};Beepall['prototype'][_0x04f3('0xf')]=function(){var _0x994421=!![];if(!_[_0x04f3('0x10')](this[_0x04f3('0x6')])&&!_[_0x04f3('0x10')](this['queue'][_0x04f3('0x11')])&&this[_0x04f3('0x6')][_0x04f3('0x11')][_0x04f3('0x12')]>0x0){for(var _0xcc65a0=0x0,_0x40fa5c;_0xcc65a00x0){for(var _0x41818f=0x0,_0x2904a9;_0x41818f0x0&&_0x21c81a[_0x5d6f80+_0x563b('0x27')]>=_0x21c81a[_0x5d6f80+_0x563b('0x28')]){writeLog(_0x65d083,_0x21c81a,_0x5d6f80[_0x563b('0x29')]()+_0x563b('0x2a'));return![];}}return!![];};exports[_0x563b('0x2b')]=function(_0x1c5dfb,_0x1e7980,_0x56d93a,_0x40b846,_0x362387){return sendNotification(!![],_0x1c5dfb,_0x1e7980,_0x56d93a,_0x40b846,_0x362387);};exports['hideNotification']=function(_0x2c7d3a,_0x498a9e,_0x24bd3b,_0x5cf0b1,_0x2854fd){return sendNotification(![],_0x2c7d3a,_0x498a9e,_0x24bd3b,_0x5cf0b1,_0x2854fd);};exports[_0x563b('0x2c')]=function(_0x5b6226,_0x201a87,_0x1416ff){var _0x6cccce=_0x201a87[_0x563b('0x2d')][_0x563b('0x2e')];if(!_0x6cccce&&_0x1416ff){_0x6cccce=_0x1416ff['id'];}var _0x270769=_[_0x563b('0x2f')](_0x5b6226[_0x201a87[_0x563b('0x30')]+_0x563b('0x31')],function(_0x547d95){var _0x4c64f2=_['capitalize'](_0x201a87[_0x563b('0x30')])+_0x563b('0x32');return _0x547d95[_0x4c64f2]===_0x201a87[_0x563b('0x2d')]['id'];});if(!_0x270769&&_0x6cccce){_0x270769=_['some'](_0x5b6226[_0x563b('0x33')][_0x6cccce][_0x201a87['channel']+_0x563b('0x34')],function(_0x547838){return _0x547838['id']===_0x201a87[_0x563b('0x2d')]['id'];});}return _0x270769;};exports[_0x563b('0x35')]=function(_0x26fe32,_0x3f7e8e,_0x261254,_0x1e4410){_0x26fe32['agents'][_0x261254['id']][_0x1e4410+'WaitingInteractions'][_0x3f7e8e[_0x563b('0x1b')]['id']]={'id':_0x3f7e8e[_0x563b('0x2d')]['id']};};exports[_0x563b('0x36')]=function(_0x150c69,_0x1bde8d,_0x5613b0,_0x6e13f2){delete _0x150c69[_0x563b('0x33')][_0x5613b0['id']][_0x6e13f2+_0x563b('0x34')][_0x1bde8d[_0x563b('0x1b')]['id']];};exports[_0x563b('0x37')]=writeLog; \ No newline at end of file +var _0x4675=['\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','busy','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','capitalize','InteractionId','saveWaitingNotification','removeWaitingNotification','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','format','user:%s','name','emit'];(function(_0x406f6a,_0x56d62c){var _0x2d237c=function(_0x3a231b){while(--_0x3a231b){_0x406f6a['push'](_0x406f6a['shift']());}};_0x2d237c(++_0x56d62c);}(_0x4675,0x19b));var _0x5467=function(_0x4c91f4,_0x1e5640){_0x4c91f4=_0x4c91f4-0x0;var _0x446450=_0x4675[_0x4c91f4];return _0x446450;};'use strict';var _=require(_0x5467('0x0'));var util=require(_0x5467('0x1'));var utils=require(_0x5467('0x2'));var Redis=require('ioredis');var config=require(_0x5467('0x3'));var logger=require(_0x5467('0x4'))(_0x5467('0x5'));config[_0x5467('0x6')]=_['defaults'](config[_0x5467('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5467('0x7'))(new Redis(config[_0x5467('0x6')]));function sendNotification(_0x441dc4,_0x1d886f,_0x180ce2,_0x4a3944,_0x244f9b,_0x25e7be){io['to'](util[_0x5467('0x8')](_0x5467('0x9'),_0x4a3944[_0x5467('0xa')]))[_0x5467('0xb')]('user:save',_0x4a3944);var _0x541029=_0x25e7be||{};var _0x5209a0=_0x180ce2['split']('.');var _0x51344f={'uniqueid':_0x1d886f,'channel':_0x5209a0[0x0],'id':_0x5209a0[0x1],'title':_0x5209a0[0x0]+_0x5467('0xc'),'interactionId':_0x5209a0[0x2],'queue':_0x244f9b?_0x244f9b[_0x5467('0xa')]:null,'sound':_0x541029[_0x5467('0xd')][_0x5467('0xe')],'shake':_0x541029[_0x5467('0xd')][_0x5467('0xf')]};try{if(!_0x541029['body']){_0x541029['body']={};}if(_0x244f9b){_0x541029[_0x5467('0x10')][_0x5467('0x11')]=_0x244f9b;}else if(_0x541029[_0x5467('0x10')][_0x5467('0x11')]){delete _0x541029[_0x5467('0x10')][_0x5467('0x11')];}_0x51344f[_0x5467('0x12')]=utils['getMustacheRender'](_0x541029['account'][_0x5467('0x13')],_0x541029);}catch(_0xe736ca){_0x51344f[_0x5467('0x12')]=_0x5467('0x14');logger[_0x5467('0x15')](util[_0x5467('0x8')](_0x5467('0x16'),_0x1d886f,_0xe736ca[_0x5467('0x17')]));}io['to'](util[_0x5467('0x8')](_0x5467('0x9'),_0x4a3944['name']))[_0x5467('0xb')](util[_0x5467('0x8')](_0x5467('0x18'),_0x441dc4?_0x5467('0x19'):_0x5467('0x1a')),_0x51344f);}function writeLog(_0x2d216f,_0x4d7c4e,_0x94f770){return logger['debug'](util[_0x5467('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x2d216f,_0x4d7c4e[_0x5467('0xa')],_0x94f770));}exports['isAgentAvailable']=function(_0x596e06,_0x165e61,_0x490b01,_0x2061f0){if(_0x165e61[_0x5467('0x1b')]){writeLog(_0x596e06,_0x165e61,'BUSY');return![];}if(!_0x165e61['online']){writeLog(_0x596e06,_0x165e61,_0x5467('0x1c'));return![];}if(_0x165e61[_0x490b01+_0x5467('0x1d')]){writeLog(_0x596e06,_0x165e61,_0x5467('0x1e'));return![];}if(_0x2061f0&&_0x165e61[_0x5467('0x1f')](_0x490b01+_0x5467('0x20'))&&_0x165e61[_0x5467('0x1f')](_0x490b01+_0x5467('0x21'))){if(_0x165e61[_0x490b01+_0x5467('0x20')]>0x0&&_0x165e61[_0x490b01+_0x5467('0x21')]>=_0x165e61[_0x490b01+'Capacity']){writeLog(_0x596e06,_0x165e61,_0x490b01[_0x5467('0x22')]()+_0x5467('0x23'));return![];}}return!![];};exports[_0x5467('0x24')]=function(_0x35c974,_0x8920c4,_0x1fb836,_0x2ccfbd,_0x6d5c5c){return sendNotification(!![],_0x35c974,_0x8920c4,_0x1fb836,_0x2ccfbd,_0x6d5c5c);};exports[_0x5467('0x25')]=function(_0x1790e2,_0x4e987e,_0x1b18da,_0x3e1e1b,_0x15c5fa){return sendNotification(![],_0x1790e2,_0x4e987e,_0x1b18da,_0x3e1e1b,_0x15c5fa);};exports[_0x5467('0x26')]=function(_0x450f7f,_0x334731,_0x2b9f99){var _0x1a7a85=_0x334731[_0x5467('0x27')][_0x5467('0x28')];if(!_0x1a7a85&&_0x2b9f99){_0x1a7a85=_0x2b9f99['id'];}var _0x538787=_[_0x5467('0x29')](_0x450f7f[_0x334731[_0x5467('0x2a')]+'QueuesWaitingInteractions'],function(_0x49ea84){var _0x1945d9=_[_0x5467('0x2b')](_0x334731['channel'])+_0x5467('0x2c');return _0x49ea84[_0x1945d9]===_0x334731[_0x5467('0x27')]['id'];});if(!_0x538787&&_0x1a7a85){_0x538787=_[_0x5467('0x29')](_0x450f7f['agents'][_0x1a7a85][_0x334731['channel']+'WaitingInteractions'],function(_0x74b21f){return _0x74b21f['id']===_0x334731[_0x5467('0x27')]['id'];});}return _0x538787;};exports[_0x5467('0x2d')]=function(_0x37c95a,_0x1a61ed,_0x517ce1,_0x18b7d7){_0x37c95a['agents'][_0x517ce1['id']][_0x18b7d7+'WaitingInteractions'][_0x1a61ed[_0x5467('0x17')]['id']]={'id':_0x1a61ed['interaction']['id']};};exports[_0x5467('0x2e')]=function(_0x38f6f6,_0x31edf5,_0x3813c4,_0x1d3d23){delete _0x38f6f6['agents'][_0x3813c4['id']][_0x1d3d23+'WaitingInteractions'][_0x31edf5[_0x5467('0x17')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index a67c691..46a5c62 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 _0xb299=['./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','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','lodash'];(function(_0x408753,_0x5176e1){var _0x1ba6f1=function(_0x2ed00d){while(--_0x2ed00d){_0x408753['push'](_0x408753['shift']());}};_0x1ba6f1(++_0x5176e1);}(_0xb299,0x1c0));var _0x9b29=function(_0xd5af76,_0x52af43){_0xd5af76=_0xd5af76-0x0;var _0x2cc372=_0xb299[_0xd5af76];return _0x2cc372;};'use strict';var schema=require(_0x9b29('0x0'));var sh=require('shelljs');var _=require(_0x9b29('0x1'));var utils=require(_0x9b29('0x2'));var logger=require('../../../../config/logger')(_0x9b29('0x3'));var system=schema({'command':{'type':_0x9b29('0x4'),'required':!![],'message':_0x9b29('0x5')}});exports[_0x9b29('0x6')]=function(_0x218fd7,_0x4449ce){return function(_0x36cd4c){try{var _0x464f25={'command':_0x4449ce[0x0]};var _0x9206db=system[_0x9b29('0x0')](_0x464f25,{'typecast':!![]});if(_0x9206db['length']){logger[_0x9b29('0x7')](_0x9b29('0x8'),_0x218fd7,_['map'](_0x9206db,_0x9b29('0x9'))[_0x9b29('0xa')](',\x20'));logger[_0x9b29('0xb')](_0x9b29('0xc'),_0x218fd7);_0x36cd4c[_0x9b29('0xd')]();}else{var _0x156aab=this;var _0x3a419c=utils[_0x9b29('0xe')](_0x4449ce[0x0],this);logger[_0x9b29('0xb')](_0x9b29('0xf'),_0x218fd7,_0x3a419c);sh[_0x9b29('0x10')](_[_0x9b29('0x11')](_0x3a419c),function(_0x4be8f0,_0x58d571){logger['info'](_0x9b29('0x12'),_0x218fd7,_0x4be8f0);if(_0x4be8f0==0x0){var _0x188019=_0x58d571['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x9b29('0x13')](_0x4449ce[0x1])||_[_0x9b29('0x14')](_0x4449ce[0x1])){logger[_0x9b29('0xb')](_0x9b29('0x15'),_0x218fd7);_0x156aab[_0x9b29('0x16')][_0x4449ce[0x1]]=_0x188019;}else{logger[_0x9b29('0xb')](_0x9b29('0x17'),_0x218fd7,_0x4449ce[0x1],_0x188019);_0x156aab[_0x9b29('0x16')][_0x4449ce[0x1]]=_0x188019;}}_0x36cd4c[_0x9b29('0xd')]();});}}catch(_0x7f6e68){logger[_0x9b29('0x7')](_0x9b29('0x8'),_0x218fd7,_[_0x9b29('0x18')](_0x7f6e68)?JSON['stringify'](_0x7f6e68):_0x7f6e68);logger['info'](_0x9b29('0xc'),_0x218fd7);_0x36cd4c[_0x9b29('0xd')]();}};}; \ No newline at end of file +var _0x6484=['exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x6484,0x1bb));var _0x4648=function(_0x3bdf59,_0x2009a4){_0x3bdf59=_0x3bdf59-0x0;var _0x180831=_0x6484[_0x3bdf59];return _0x180831;};'use strict';var schema=require('validate');var sh=require(_0x4648('0x0'));var _=require(_0x4648('0x1'));var utils=require(_0x4648('0x2'));var logger=require(_0x4648('0x3'))('routing');var system=schema({'command':{'type':_0x4648('0x4'),'required':!![],'message':_0x4648('0x5')}});exports['consequence']=function(_0x2dac74,_0x261b43){return function(_0x16bd59){try{var _0x59a611={'command':_0x261b43[0x0]};var _0x85581e=system[_0x4648('0x6')](_0x59a611,{'typecast':!![]});if(_0x85581e[_0x4648('0x7')]){logger[_0x4648('0x8')](_0x4648('0x9'),_0x2dac74,_[_0x4648('0xa')](_0x85581e,_0x4648('0xb'))[_0x4648('0xc')](',\x20'));logger[_0x4648('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2dac74);_0x16bd59['next']();}else{var _0x496f9c=this;var _0x2b599a=utils[_0x4648('0xe')](_0x261b43[0x0],this);logger[_0x4648('0xd')](_0x4648('0xf'),_0x2dac74,_0x2b599a);sh[_0x4648('0x10')](_[_0x4648('0x11')](_0x2b599a),function(_0x471a66,_0x2f900d){logger[_0x4648('0xd')](_0x4648('0x12'),_0x2dac74,_0x471a66);if(_0x471a66==0x0){var _0x3e0b6b=_0x2f900d[_0x4648('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x4648('0x14')](_0x261b43[0x1])||_['isEmpty'](_0x261b43[0x1])){logger[_0x4648('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x2dac74);_0x496f9c['body'][_0x261b43[0x1]]=_0x3e0b6b;}else{logger[_0x4648('0xd')](_0x4648('0x15'),_0x2dac74,_0x261b43[0x1],_0x3e0b6b);_0x496f9c[_0x4648('0x16')][_0x261b43[0x1]]=_0x3e0b6b;}}_0x16bd59[_0x4648('0x17')]();});}}catch(_0x7bd03d){logger[_0x4648('0x8')]('[%s][SYSTEM]\x20%s',_0x2dac74,_[_0x4648('0x18')](_0x7bd03d)?JSON[_0x4648('0x19')](_0x7bd03d):_0x7bd03d);logger['info'](_0x4648('0x1a'),_0x2dac74);_0x16bd59[_0x4648('0x17')]();}};}; \ 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 395e5ec..905119a 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 _0x88d1=['channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x38dad7,_0x1bf5c0){var _0x2e6f84=function(_0x190ee3){while(--_0x190ee3){_0x38dad7['push'](_0x38dad7['shift']());}};_0x2e6f84(++_0x1bf5c0);}(_0x88d1,0xea));var _0x188d=function(_0x4abb17,_0x6fd616){_0x4abb17=_0x4abb17-0x0;var _0x2187a1=_0x88d1[_0x4abb17];return _0x2187a1;};'use strict';var schema=require(_0x188d('0x0'));var _=require(_0x188d('0x1'));var rpc={'chatInteraction':require(_0x188d('0x2')),'openchannelInteraction':require(_0x188d('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x188d('0x4')),'whatsappInteraction':require(_0x188d('0x5'))};var logger=require('../../../../config/logger')(_0x188d('0x6'));var tag=schema({'tag':{'type':_0x188d('0x7'),'required':!![],'message':_0x188d('0x8')}});exports[_0x188d('0x9')]=function(_0x23401a,_0x20185a,_0x43b4a2,_0x1be07b){return function(_0x4a39d6){try{var _0x1f1f14={'tag':_0x20185a[0x0]};var _0x24e2bb=tag[_0x188d('0x0')](_0x1f1f14,{'typecast':!![]});if(_0x24e2bb['length']){logger[_0x188d('0xa')](_0x188d('0xb'),_0x23401a,_[_0x188d('0xc')](_0x24e2bb,'message')[_0x188d('0xd')](',\x20'));logger[_0x188d('0xe')](_0x188d('0xf'),_0x23401a);_0x4a39d6['next']();}else{var _0x3091c7={'ids':[_0x20185a[0x0]]};if(rpc[_0x1be07b[_0x188d('0x10')]+'Interaction']){rpc[_0x1be07b[_0x188d('0x10')]+_0x188d('0x11')][_0x188d('0x12')](_0x1be07b[_0x188d('0x13')]['id'],_0x3091c7)[_0x188d('0x14')](function(_0x1d7f2f){logger[_0x188d('0xe')](_0x188d('0x15'),_0x23401a,_0x20185a[0x1],_0x1be07b[_0x188d('0x10')],_0x1be07b['interaction']['id']);})[_0x188d('0x16')](function(_0xbb4e34){logger[_0x188d('0xa')]('[%s][TAG]\x20%s',_0x23401a,JSON['stringify'](_0xbb4e34));logger['info'](_0x188d('0xf'),_0x23401a);})[_0x188d('0x17')](function(){_0x4a39d6['next']();});}}}catch(_0x3e278e){logger[_0x188d('0xa')](_0x188d('0xb'),_0x23401a,_['isObject'](_0x3e278e)?JSON['stringify'](_0x3e278e):_0x3e278e);logger[_0x188d('0xe')](_0x188d('0xf'),_0x23401a);_0x4a39d6[_0x188d('0x18')]();}};}; \ No newline at end of file +var _0xb8bb=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','then','interaction','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number'];(function(_0x3b3e7d,_0x48db26){var _0x13321c=function(_0x5ecb88){while(--_0x5ecb88){_0x3b3e7d['push'](_0x3b3e7d['shift']());}};_0x13321c(++_0x48db26);}(_0xb8bb,0x1b4));var _0xbb8b=function(_0x5c6ad6,_0x112d67){_0x5c6ad6=_0x5c6ad6-0x0;var _0x526f9c=_0xb8bb[_0x5c6ad6];return _0x526f9c;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0xbb8b('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xbb8b('0x1')),'faxInteraction':require(_0xbb8b('0x2')),'whatsappInteraction':require(_0xbb8b('0x3'))};var logger=require('../../../../config/logger')(_0xbb8b('0x4'));var tag=schema({'tag':{'type':_0xbb8b('0x5'),'required':!![],'message':_0xbb8b('0x6')}});exports[_0xbb8b('0x7')]=function(_0xfdc0d4,_0x2262fd,_0xc46992,_0x8c85d0){return function(_0x2c7a35){try{var _0x59ed4f={'tag':_0x2262fd[0x0]};var _0x3afce4=tag[_0xbb8b('0x8')](_0x59ed4f,{'typecast':!![]});if(_0x3afce4[_0xbb8b('0x9')]){logger[_0xbb8b('0xa')](_0xbb8b('0xb'),_0xfdc0d4,_[_0xbb8b('0xc')](_0x3afce4,_0xbb8b('0xd'))[_0xbb8b('0xe')](',\x20'));logger[_0xbb8b('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xfdc0d4);_0x2c7a35[_0xbb8b('0x10')]();}else{var _0x34186a={'ids':[_0x2262fd[0x0]]};if(rpc[_0x8c85d0[_0xbb8b('0x11')]+_0xbb8b('0x12')]){rpc[_0x8c85d0[_0xbb8b('0x11')]+_0xbb8b('0x12')][_0xbb8b('0x13')](_0x8c85d0['interaction']['id'],_0x34186a)[_0xbb8b('0x14')](function(_0x1c9dcb){logger[_0xbb8b('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0xfdc0d4,_0x2262fd[0x1],_0x8c85d0[_0xbb8b('0x11')],_0x8c85d0[_0xbb8b('0x15')]['id']);})[_0xbb8b('0x16')](function(_0x523ac8){logger[_0xbb8b('0xa')](_0xbb8b('0xb'),_0xfdc0d4,JSON['stringify'](_0x523ac8));logger[_0xbb8b('0xf')](_0xbb8b('0x17'),_0xfdc0d4);})[_0xbb8b('0x18')](function(){_0x2c7a35[_0xbb8b('0x10')]();});}}}catch(_0x21bc66){logger['error'](_0xbb8b('0xb'),_0xfdc0d4,_[_0xbb8b('0x19')](_0x21bc66)?JSON['stringify'](_0x21bc66):_0x21bc66);logger[_0xbb8b('0xf')](_0xbb8b('0x17'),_0xfdc0d4);_0x2c7a35[_0xbb8b('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index e212d71..efadd79 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda27=['urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','login','push','utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes'];(function(_0x38cd66,_0x3d3354){var _0x4bf620=function(_0x291d69){while(--_0x291d69){_0x38cd66['push'](_0x38cd66['shift']());}};_0x4bf620(++_0x3d3354);}(_0xda27,0x101));var _0x7da2=function(_0x2dea9b,_0x6f3b03){_0x2dea9b=_0x2dea9b-0x0;var _0x6fcafd=_0xda27[_0x2dea9b];return _0x6fcafd;};'use strict';var rp=require('request-promise');var logger=require(_0x7da2('0x0'))(_0x7da2('0x1'));var _=require(_0x7da2('0x2'));var arr=[];exports[_0x7da2('0x3')]=function(_0x79073e,_0x4ee5d7){return function(_0xd94e58){var _0x30d5a9=_0x4ee5d7[0xa];var _0x2adf3c=_0x4ee5d7[0xb];var _0x4297c9=_0x4ee5d7[0xc];var _0x35f46f=_0x4ee5d7[0xd];var _0x2d0c82=_0x4ee5d7[0xe];var _0x3356ce=_0x4ee5d7[0xf][_0x7da2('0x4')](/\n/g,_0x7da2('0x5'));var _0x271cb3=_0x4ee5d7[0x10][_0x7da2('0x4')](/\n/g,'\x20');if(!arr[_0x7da2('0x6')](_0x2adf3c)){arr['push'](_0x2adf3c);var _0x38a96e=_0x4ee5d7[0x3];var _0x24ee1c=_0x4ee5d7[0x4];var _0x322068=_0x4ee5d7[0x1];var _0x43de95=_0x4ee5d7[0x0];var _0x5ed35e={};_0x5ed35e[_0x7da2('0x7')]=_0x4ee5d7[0x8]+_0x7da2('0x8')+_0x4297c9+'|'+_0x30d5a9+'|'+_0x35f46f+'|'+_0x2adf3c+'|'+_0x2d0c82;_0x5ed35e[_0x7da2('0x9')]=_0x4ee5d7[0x7]+'?params='+_0x4297c9+'|'+_0x30d5a9+'|'+_0x35f46f+'|'+_0x2adf3c+'|'+_0x2d0c82+'|'+_0x3356ce+'|'+_0x271cb3;_0x5ed35e['title']=_0x4ee5d7[0x9];var _0x5b04f0={};_0x5b04f0[_0x7da2('0xa')]=_0x7da2('0xb');_0x5b04f0['method']=_0x7da2('0xc');var _0x49c1fa=[];_0x49c1fa[_0x7da2('0xd')](_0x4ee5d7[0x2]);_0x49c1fa[_0x7da2('0xd')](_0x4ee5d7[0x5]);_0x49c1fa[_0x7da2('0xd')](_0x4ee5d7[0x6]);_0x5b04f0['params']=_0x49c1fa;_0x5b04f0['id']=0x1;var _0xc6d8c1=JSON['stringify'](_0x5b04f0);var _0xaebc89={'encoding':_0x7da2('0xe'),'method':_0x7da2('0xf'),'timeout':0x2710,'url':_0x38a96e,'headers':{'Content-Type':_0x7da2('0x10')},'body':_0xc6d8c1};return rp(_0xaebc89)[_0x7da2('0x11')](function(_0x1fcf25){const _0x517c1e=JSON[_0x7da2('0x12')](_0x1fcf25);if(!_0x517c1e['result'][_0x7da2('0x13')]){throw new Error(_0x7da2('0x14'));}var _0x4f5dc2=_0x2adf3c;var _0x46325a=_0x7da2('0x15')+_0x322068+_0x7da2('0x16')+_0x43de95+_0x7da2('0x17')+_0x4f5dc2+_0x7da2('0x18')+JSON['stringify'](_0x5ed35e);var _0x3df139=_0x24ee1c+'?'+_0x46325a;return rp(_0x3df139);})[_0x7da2('0x11')](function(_0xa90325){logger[_0x7da2('0x19')](_0x7da2('0x1a'),_0x79073e,_0xa90325);_0xd94e58[_0x7da2('0x1b')]();})[_0x7da2('0x1c')](function(_0x1beb06){logger[_0x7da2('0x1d')](_0x7da2('0x1e'),_0x79073e,_[_0x7da2('0x1f')](_0x1beb06)?JSON['stringify'](_0x1beb06):_0x1beb06);_0xd94e58[_0x7da2('0x1b')]();});}else{logger[_0x7da2('0x19')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x79073e);_0xd94e58[_0x7da2('0x20')]();}};}; \ No newline at end of file +var _0x99ab=['includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','login','params','stringify','utf8','POST','then','result','logged','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','isObject','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20'];(function(_0x4e5c3d,_0x2998f5){var _0xe267e8=function(_0x276eda){while(--_0x276eda){_0x4e5c3d['push'](_0x4e5c3d['shift']());}};_0xe267e8(++_0x2998f5);}(_0x99ab,0x17f));var _0xb99a=function(_0x115a94,_0x22dde7){_0x115a94=_0x115a94-0x0;var _0xa9b9fd=_0x99ab[_0x115a94];return _0xa9b9fd;};'use strict';var rp=require(_0xb99a('0x0'));var logger=require(_0xb99a('0x1'))(_0xb99a('0x2'));var _=require(_0xb99a('0x3'));var arr=[];exports[_0xb99a('0x4')]=function(_0x1220a2,_0x4c13e0){return function(_0x14af45){var _0x25682a=_0x4c13e0[0xa];var _0x363014=_0x4c13e0[0xb];var _0x40ba81=_0x4c13e0[0xc];var _0x56d006=_0x4c13e0[0xd];var _0x39c1fc=_0x4c13e0[0xe];var _0x1df03d=_0x4c13e0[0xf][_0xb99a('0x5')](/\n/g,_0xb99a('0x6'));var _0xe9ac9d=_0x4c13e0[0x10][_0xb99a('0x5')](/\n/g,'\x20');if(!arr[_0xb99a('0x7')](_0x363014)){arr[_0xb99a('0x8')](_0x363014);var _0xad136e=_0x4c13e0[0x3];var _0x1f1a27=_0x4c13e0[0x4];var _0x566e73=_0x4c13e0[0x1];var _0x12fd24=_0x4c13e0[0x0];var _0x4ebd98={};_0x4ebd98[_0xb99a('0x9')]=_0x4c13e0[0x8]+_0xb99a('0xa')+_0x40ba81+'|'+_0x25682a+'|'+_0x56d006+'|'+_0x363014+'|'+_0x39c1fc;_0x4ebd98[_0xb99a('0xb')]=_0x4c13e0[0x7]+_0xb99a('0xa')+_0x40ba81+'|'+_0x25682a+'|'+_0x56d006+'|'+_0x363014+'|'+_0x39c1fc+'|'+_0x1df03d+'|'+_0xe9ac9d;_0x4ebd98[_0xb99a('0xc')]=_0x4c13e0[0x9];var _0x4f3004={};_0x4f3004[_0xb99a('0xd')]=_0xb99a('0xe');_0x4f3004['method']=_0xb99a('0xf');var _0x369f91=[];_0x369f91[_0xb99a('0x8')](_0x4c13e0[0x2]);_0x369f91[_0xb99a('0x8')](_0x4c13e0[0x5]);_0x369f91[_0xb99a('0x8')](_0x4c13e0[0x6]);_0x4f3004[_0xb99a('0x10')]=_0x369f91;_0x4f3004['id']=0x1;var _0x4d4672=JSON[_0xb99a('0x11')](_0x4f3004);var _0x3ea41d={'encoding':_0xb99a('0x12'),'method':_0xb99a('0x13'),'timeout':0x2710,'url':_0xad136e,'headers':{'Content-Type':'application/json-rpc'},'body':_0x4d4672};return rp(_0x3ea41d)[_0xb99a('0x14')](function(_0x5965a8){const _0x23f526=JSON['parse'](_0x5965a8);if(!_0x23f526[_0xb99a('0x15')][_0xb99a('0x16')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x130038=_0x363014;var _0x565158='channelId='+_0x566e73+_0xb99a('0x17')+_0x12fd24+'&sessionId='+_0x130038+'&data='+JSON[_0xb99a('0x11')](_0x4ebd98);var _0x592661=_0x1f1a27+'?'+_0x565158;return rp(_0x592661);})[_0xb99a('0x14')](function(_0x38b4fb){logger[_0xb99a('0x18')](_0xb99a('0x19'),_0x1220a2,_0x38b4fb);_0x14af45[_0xb99a('0x1a')]();})[_0xb99a('0x1b')](function(_0x434a8c){logger['error']('[%s][TVOX]\x20%s',_0x1220a2,_[_0xb99a('0x1c')](_0x434a8c)?JSON[_0xb99a('0x11')](_0x434a8c):_0x434a8c);_0x14af45[_0xb99a('0x1a')]();});}else{logger[_0xb99a('0x18')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x1220a2);_0x14af45[_0xb99a('0x1d')]();}};}; \ 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 42bbee7..4f9730a 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x43e1c5,_0xcb6209){var _0x240cd5=function(_0x55e94e){while(--_0x55e94e){_0x43e1c5['push'](_0x43e1c5['shift']());}};_0x240cd5(++_0xcb6209);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0xfcdbef,_0x3a3108){var _0x3fb19e=function(_0x54f19d){while(--_0x54f19d){_0xfcdbef['push'](_0xfcdbef['shift']());}};_0x3fb19e(++_0x3a3108);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index fc5b213..37bdb46 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 _0x76f8=['getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','name','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','existsSync','join','app','autoreply','split','mail','push','slice','length','dialogflow','appdata','amazonlex','tag','TagId','tvox'];(function(_0x30e762,_0x2d70fa){var _0x473bbf=function(_0x4aefea){while(--_0x4aefea){_0x30e762['push'](_0x30e762['shift']());}};_0x473bbf(++_0x2d70fa);}(_0x76f8,0x16f));var _0x876f=function(_0xfa79b7,_0x23f2a0){_0xfa79b7=_0xfa79b7-0x0;var _0x4e7f64=_0x76f8[_0xfa79b7];return _0x4e7f64;};'use strict';var _=require(_0x876f('0x0'));var util=require('util');var path=require(_0x876f('0x1'));var fs=require('fs');var jayson=require(_0x876f('0x2'));var BPromise=require(_0x876f('0x3'));var utils=require(_0x876f('0x4'));var sUtils=require(_0x876f('0x5'));var logger=require(_0x876f('0x6'))(_0x876f('0x7'));var rpc={'openchannelQueueReport':require(_0x876f('0x8')),'mailQueueReport':require(_0x876f('0x9')),'chatQueueReport':require(_0x876f('0xa')),'smsQueueReport':require(_0x876f('0xb')),'faxQueueReport':require(_0x876f('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x876f('0xd'));function getId(_0x51c8ed,_0x4ea7ce,_0x6bc99d){return util[_0x876f('0xe')]('%s.%s.%s',_0x51c8ed,_0x4ea7ce||0x0,_0x6bc99d||0x0);}function getIntervals(_0x2bceab,_0x54dbe8){var _0x3273a1=[];if(!_[_0x876f('0xf')](_0x54dbe8[_0x876f('0x10')])&&!_[_0x876f('0xf')](_0x2bceab[_0x54dbe8[_0x876f('0x10')]])&&!_['isNil'](_0x2bceab[_0x54dbe8[_0x876f('0x10')]][_0x876f('0x11')])){_0x3273a1=_['map'](_0x2bceab[_0x54dbe8[_0x876f('0x10')]][_0x876f('0x11')],_0x876f('0x12'));}else if(!_[_0x876f('0xf')](_0x54dbe8[_0x876f('0x12')])){_0x3273a1=[_0x54dbe8['interval']];}return _0x3273a1;}exports[_0x876f('0x13')]=function(_0x440405){_0x440405[_0x876f('0x14')]={};return new BPromise(function(_0x1e1c1a,_0x3fc0b6){var _0x42911b={'Start':function(_0xc93219){var _0x272f14=this;return new Promise(function(_0x34aabc,_0x373b62){if(_0xc93219){try{var _0x59fc6f=[];var _0x4c2dff=getId(_0xc93219[_0x876f('0x15')],_0xc93219[_0x876f('0x16')]?_0xc93219[_0x876f('0x16')]['id']:0x0,_0xc93219['interaction']?_0xc93219[_0x876f('0x17')]['id']:0x0);var _0xc3c21c=sUtils['checkWaitingNotifications'](_0x440405,_0xc93219);if(!_0xc3c21c&&_0xc93219[_0x876f('0x18')]&&_[_0x876f('0x19')](_0xc93219[_0x876f('0x18')])&&_0xc93219[_0x876f('0x18')]['length']){for(var _0x2beece=0x0;_0x2beece<_0xc93219[_0x876f('0x18')]['length'];_0x2beece+=0x1){var _0x3286d7=_0xc93219[_0x876f('0x18')][_0x2beece];if(fs[_0x876f('0x1a')](path[_0x876f('0x1b')](__dirname,'applications',_0x3286d7[_0x876f('0x1c')]+'.js'))){var _0x3fda93=[];switch(_0x3286d7[_0x876f('0x1c')]['toLowerCase']()){case _0x876f('0x1d'):var _0x55569=_0x3286d7['appdata'][_0x876f('0x1e')](',');if(_0xc93219[_0x876f('0x15')]===_0x876f('0x1f')){_0x3fda93[_0x876f('0x20')](_0x55569[0x0]);_0x3fda93[_0x876f('0x20')](_0x55569[0x1]);_0x3fda93[_0x876f('0x20')](_0x55569[_0x876f('0x21')](0x2,_0x55569[_0x876f('0x22')])[_0x876f('0x1b')](','));}else{_0x3fda93[_0x876f('0x20')](_0x55569[0x0]);_0x3fda93[_0x876f('0x20')](_0x55569[_0x876f('0x21')](0x1,_0x55569[_0x876f('0x22')])['join'](','));}break;case _0x876f('0x23'):var _0x54e140=_0x3286d7[_0x876f('0x24')][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x54e140[0x0]);_0x3fda93['push'](_0x54e140[0x1]);_0x3fda93[_0x876f('0x20')](_0x54e140[_0x876f('0x21')](0x2,_0x54e140['length'])['join'](','));break;case'dialogflowv2':var _0x4bda20=_0x3286d7[_0x876f('0x24')][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x4bda20[0x0]);_0x3fda93['push'](_0x4bda20[0x1]);_0x3fda93[_0x876f('0x20')](_0x4bda20[0x2]);_0x3fda93['push'](_0x4bda20[0x3]);_0x3fda93[_0x876f('0x20')](_0x4bda20[_0x876f('0x21')](0x4,_0x4bda20[_0x876f('0x22')])[_0x876f('0x1b')](','));break;case _0x876f('0x25'):var _0x16f9c1=_0x3286d7['appdata'][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x16f9c1[0x0]);_0x3fda93['push'](_0x16f9c1[0x1]);_0x3fda93[_0x876f('0x20')](_0x16f9c1[0x2]);_0x3fda93['push'](_0x16f9c1[0x3]);_0x3fda93[_0x876f('0x20')](_0x16f9c1[_0x876f('0x21')](0x4,_0x16f9c1[_0x876f('0x22')])[_0x876f('0x1b')](','));break;case _0x876f('0x16'):_0x3fda93[_0x876f('0x20')](_0x3286d7[_0x876f('0x24')]);break;case _0x876f('0x26'):_0x3fda93['push'](_0x3286d7[_0x876f('0x27')]);_0x3fda93['push'](_0x3286d7[_0x876f('0x24')]);break;case _0x876f('0x28'):var _0x3d23e7=utils[_0x876f('0x29')](_0xc93219[_0x876f('0x2a')][_0x876f('0x2b')],_0xc93219);var _0x92d35b=_0x3286d7[_0x876f('0x24')][_0x876f('0x1e')](',');_0x3fda93[_0x876f('0x20')](_0x92d35b[0x0]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x1]);_0x3fda93['push'](_0x92d35b[0x2]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x3]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x4]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x5]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x6]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x7]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x8]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0x9]);_0x3fda93[_0x876f('0x20')](_0x92d35b[0xa]);_0x3fda93[_0x876f('0x20')](_0xc93219[_0x876f('0x17')]['id']);_0x3fda93[_0x876f('0x20')](_0xc93219[_0x876f('0x16')]['id']);_0x3fda93[_0x876f('0x20')](_0x3286d7[_0x876f('0x2c')]);_0x3fda93['push'](_0xc93219[_0x876f('0x17')][_0x876f('0x2d')]);_0x3fda93[_0x876f('0x20')](_0xc93219[_0x876f('0x2e')][_0x876f('0x2e')]);_0x3fda93[_0x876f('0x20')](_0x3d23e7);break;default:_0x3fda93=_[_0x876f('0xf')](_0x3286d7['appdata'])?[]:_0x3286d7['appdata'][_0x876f('0x1e')](',');}var _0x1758e3={'id':util['format']('%s:%s:%s',_0x4c2dff,_0x3286d7['id'],_0x3286d7[_0x876f('0x1c')]),'condition':require('./interval')[_0x876f('0x2f')](_0x4c2dff,getIntervals(_0x440405[_0x876f('0x30')],_0x3286d7),_0x440405),'consequence':require(_0x876f('0x31')+_0x3286d7['app'])[_0x876f('0x32')](_0x4c2dff,_0x3fda93,_0x440405,_0xc93219),'p':_0x3286d7[_0x876f('0x33')]||0x0};logger[_0x876f('0x34')]('Push\x20new\x20rule',_0x1758e3['id'],_0x876f('0x35'),getIntervals(_0x440405[_0x876f('0x30')],_0x3286d7)[_0x876f('0x1b')]('\x20|\x20'));_0x59fc6f[_0x876f('0x20')](_0x1758e3);}else{logger[_0x876f('0x36')](_0x876f('0x37'),path[_0x876f('0x1b')](__dirname,_0x876f('0x18'),_0x3286d7[_0x876f('0x1c')]+_0x876f('0x38')));}}_0x440405[_0x876f('0x14')][_0x4c2dff]=new RuleEngine(_0x59fc6f);_0x440405['rules'][_0x4c2dff][_0x876f('0x39')](_0xc93219,function(_0x1f112e){logger[_0x876f('0x34')]('Applications\x20executed',JSON[_0x876f('0x3a')](_0x1f112e['matchPath']));if(_0x440405[_0x876f('0x14')][_0x4c2dff]){_0x440405['rules'][_0x4c2dff][_0x876f('0x3b')](_0x876f('0x3c'));}});return _0x34aabc({'code':0xc8,'message':_0xc93219});}else{if(_0xc3c21c){logger[_0x876f('0x34')](util[_0x876f('0xe')]('Skipped\x20routing\x20for\x20%s',_0x4c2dff));}else{logger['info'](_0x876f('0x3d'));}return _0x34aabc({'code':0xc8,'message':_0xc93219});}}catch(_0x239af7){logger[_0x876f('0x36')](_0x239af7[_0x876f('0x3e')]);return _0x373b62(_0x272f14[_0x876f('0x36')](0x1f4,_0x239af7));}}return _0x373b62(_0x876f('0x3f'));});},'AcceptMessage':function(_0x935e89){var _0x4da848=this;return new Promise(function(_0x482166,_0x3a9b3e){if(_0x935e89[_0x876f('0x40')]&&_0x935e89[_0x876f('0x40')]['id']){if(_0x440405[_0x876f('0x41')][_0x935e89[_0x876f('0x40')]['id']]){_0x440405['agents'][_0x935e89[_0x876f('0x40')]['id']]['busy']=![];_0x440405[_0x876f('0x41')][_0x935e89[_0x876f('0x40')]['id']][_0x876f('0x42')]=undefined;}}if(_0x935e89[_0x876f('0x16')]&&_0x935e89['message']['id']){try{var _0x41d4a2=getId(_0x935e89[_0x876f('0x15')],_0x935e89[_0x876f('0x16')]?_0x935e89[_0x876f('0x16')]['id']:0x0,_0x935e89[_0x876f('0x17')]?_0x935e89['interaction']['id']:0x0);if(_0x440405[_0x876f('0x14')][_0x41d4a2]){_0x440405[_0x876f('0x14')][_0x41d4a2][_0x876f('0x3b')](_0x876f('0x43'));if(rpc[_0x935e89[_0x876f('0x15')]+_0x876f('0x44')]){rpc[_0x935e89[_0x876f('0x15')]+'QueueReport'][_0x876f('0x45')](_0x41d4a2,{'UserId':_0x935e89[_0x876f('0x16')][_0x876f('0x46')]})['catch'](function(){logger[_0x876f('0x36')](_0x876f('0x47'));});}}return _0x482166({'code':0xc8,'message':_0x935e89});}catch(_0x21877d){logger[_0x876f('0x36')](_0x21877d[_0x876f('0x3e')]);return _0x3a9b3e(_0x4da848[_0x876f('0x36')](0x1f4,_0x21877d));}}logger[_0x876f('0x36')](_0x876f('0x48'));return _0x3a9b3e(_0x4da848['error'](0x1f4,_0x876f('0x48')));});},'RejectMessage':function(_0x202426){var _0x4f5e1f=this;return new Promise(function(_0xd6c5f4,_0x1362ec){if(_0x202426['agent']&&_0x202426[_0x876f('0x40')]['id']){try{if(_0x440405['agents'][_0x202426[_0x876f('0x40')]['id']]){_0x440405['agents'][_0x202426[_0x876f('0x40')]['id']][_0x876f('0x49')]=![];_0x440405[_0x876f('0x41')][_0x202426[_0x876f('0x40')]['id']]['busyQueue']=undefined;}return _0xd6c5f4({'code':0xc8,'message':_0x202426});}catch(_0x144432){logger[_0x876f('0x36')](_0x144432[_0x876f('0x3e')]);return _0x1362ec(_0x4f5e1f[_0x876f('0x36')](0x1f4,_0x144432));}}logger[_0x876f('0x36')](_0x876f('0x48'));return _0x1362ec(_0x4f5e1f[_0x876f('0x36')](0x1f4,_0x876f('0x48')));});},'AbandonInteraction':function(_0x5ca1e6){var _0x38930a=this;return new Promise(function(_0x406fee,_0x11d1cb){if(_0x5ca1e6[_0x876f('0x15')]&&_0x5ca1e6['interaction']&&_0x5ca1e6[_0x876f('0x17')]['id']){try{var _0x1fbc7a=getId(_0x5ca1e6[_0x876f('0x15')],_0x5ca1e6[_0x876f('0x16')]?_0x5ca1e6[_0x876f('0x16')]['id']:0x0,_0x5ca1e6[_0x876f('0x17')]?_0x5ca1e6['interaction']['id']:0x0);if(_0x440405[_0x876f('0x14')][_0x1fbc7a]){_0x440405[_0x876f('0x14')][_0x1fbc7a]['emit'](_0x876f('0x43'));}return _0x406fee({'code':0xc8,'message':_0x5ca1e6});}catch(_0x207798){logger[_0x876f('0x36')](_0x207798['stack']);return _0x11d1cb(_0x38930a[_0x876f('0x36')](0x1f4,_0x207798));}}logger[_0x876f('0x36')](_0x876f('0x48'));return _0x11d1cb(_0x38930a[_0x876f('0x36')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x565bd5){var _0x3c4175=this;return new Promise(function(_0x287262,_0xddd7ad){if(_0x440405['agents']['hasOwnProperty'](_0x565bd5['id'])){for(var _0x483aba in _0x565bd5[_0x876f('0x4a')]){if(_0x565bd5[_0x876f('0x4a')][_0x876f('0x4b')](_0x483aba)){if(_0x440405[_0x876f('0x41')][_0x565bd5['id']][_0x876f('0x4b')](_0x483aba+_0x876f('0x4c'))){_0x440405[_0x876f('0x41')][_0x565bd5['id']][_0x483aba+_0x876f('0x4c')]=parseInt(_0x565bd5['capacity'][_0x483aba],0xa);}}}_0x440405[_0x876f('0x41')][_0x565bd5['id']][_0x876f('0x4d')]();return _0x287262({'code':0xc8,'message':_0x440405[_0x876f('0x41')][_0x565bd5['id']]});}else{return _0xddd7ad(_0x3c4175[_0x876f('0x36')](0x1f4,_0x876f('0x4e')));}});},'Agents':function(_0x414335){return new Promise(function(_0x19e8fd){var _0x1c4942=_['values'](_0x440405[_0x876f('0x41')]);if(_0x414335&&_0x414335['id']){var _0xfdbf29=_[_0x876f('0x4f')](_0x1c4942,function(_0x481663){return _0x481663['id']===_0x414335['id'];});_0x19e8fd(_0xfdbf29);}else{_0x19e8fd({'count':_0x1c4942[_0x876f('0x22')],'rows':_0x1c4942});}});},'ChatQueues':function(){return new Promise(function(_0x34b8f6){var _0x4518cc=[];for(var _0x1f9ca0 in _0x440405[_0x876f('0x50')]){if(_0x440405['chatQueues'][_0x876f('0x4b')](_0x1f9ca0)){var _0x26f52d=_0x440405[_0x876f('0x50')][_0x1f9ca0];var _0x5e6c65={'id':_0x26f52d['id'],'available':_0x26f52d[_0x876f('0x51')],'loggedIn':_0x26f52d[_0x876f('0x52')],'name':_0x26f52d['name'],'paused':_0x26f52d[_0x876f('0x53')],'waiting':_0x26f52d[_0x876f('0x54')]};_0x4518cc[_0x876f('0x20')](_0x5e6c65);}}_0x34b8f6({'count':_0x4518cc[_0x876f('0x22')],'rows':_0x4518cc});});},'MailQueues':function(){return new Promise(function(_0x254823){var _0x4b4f98=[];for(var _0x436102 in _0x440405[_0x876f('0x55')]){if(_0x440405['mailQueues'][_0x876f('0x4b')](_0x436102)){var _0xf4222f=_0x440405[_0x876f('0x55')][_0x436102];var _0x1bc74c={'id':_0xf4222f['id'],'available':_0xf4222f[_0x876f('0x51')],'loggedIn':_0xf4222f['loggedIn'],'name':_0xf4222f['name'],'paused':_0xf4222f[_0x876f('0x53')],'waiting':_0xf4222f[_0x876f('0x54')]};_0x4b4f98[_0x876f('0x20')](_0x1bc74c);}}_0x254823({'count':_0x4b4f98[_0x876f('0x22')],'rows':_0x4b4f98});});},'OpenchannelQueues':function(){return new Promise(function(_0x280ba4){var _0x5d5cd2=[];for(var _0x259264 in _0x440405[_0x876f('0x56')]){if(_0x440405['openchannelQueues'][_0x876f('0x4b')](_0x259264)){var _0x3863d4=_0x440405[_0x876f('0x56')][_0x259264];var _0x282650={'id':_0x3863d4['id'],'available':_0x3863d4[_0x876f('0x51')],'loggedIn':_0x3863d4[_0x876f('0x52')],'name':_0x3863d4[_0x876f('0x57')],'paused':_0x3863d4[_0x876f('0x53')],'waiting':_0x3863d4[_0x876f('0x54')]};_0x5d5cd2[_0x876f('0x20')](_0x282650);}}_0x280ba4({'count':_0x5d5cd2[_0x876f('0x22')],'rows':_0x5d5cd2});});},'SmsQueues':function(){return new Promise(function(_0x36910b){var _0xde505a=[];for(var _0x4fc56f in _0x440405[_0x876f('0x58')]){if(_0x440405['smsQueues']['hasOwnProperty'](_0x4fc56f)){var _0x5e0e4b=_0x440405['smsQueues'][_0x4fc56f];var _0xcb2ff1={'id':_0x5e0e4b['id'],'available':_0x5e0e4b[_0x876f('0x51')],'loggedIn':_0x5e0e4b[_0x876f('0x52')],'name':_0x5e0e4b[_0x876f('0x57')],'paused':_0x5e0e4b[_0x876f('0x53')],'waiting':_0x5e0e4b[_0x876f('0x54')]};_0xde505a[_0x876f('0x20')](_0xcb2ff1);}}_0x36910b({'count':_0xde505a[_0x876f('0x22')],'rows':_0xde505a});});},'FaxQueues':function(){return new Promise(function(_0x1c757a){var _0x4bd42a=[];for(var _0x369954 in _0x440405[_0x876f('0x59')]){if(_0x440405[_0x876f('0x59')]['hasOwnProperty'](_0x369954)){var _0x557ebe=_0x440405[_0x876f('0x59')][_0x369954];var _0x28b4bd={'id':_0x557ebe['id'],'available':_0x557ebe[_0x876f('0x51')],'loggedIn':_0x557ebe[_0x876f('0x52')],'name':_0x557ebe['name'],'paused':_0x557ebe[_0x876f('0x53')],'waiting':_0x557ebe[_0x876f('0x54')]};_0x4bd42a[_0x876f('0x20')](_0x28b4bd);}}_0x1c757a({'count':_0x4bd42a[_0x876f('0x22')],'rows':_0x4bd42a});});},'WhatsappQueues':function(){return new Promise(function(_0x137115){var _0xc417d0=[];for(var _0x3901a0 in _0x440405[_0x876f('0x5a')]){if(_0x440405[_0x876f('0x5a')][_0x876f('0x4b')](_0x3901a0)){var _0x238f69=_0x440405['whatsappQueues'][_0x3901a0];var _0x3ffd87={'id':_0x238f69['id'],'available':_0x238f69[_0x876f('0x51')],'loggedIn':_0x238f69[_0x876f('0x52')],'name':_0x238f69[_0x876f('0x57')],'paused':_0x238f69[_0x876f('0x53')],'waiting':_0x238f69[_0x876f('0x54')]};_0xc417d0[_0x876f('0x20')](_0x3ffd87);}}_0x137115({'count':_0xc417d0[_0x876f('0x22')],'rows':_0xc417d0});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x174618){var _0x3a0626=_['values'](_0x440405[_0x876f('0x5b')]);_0x174618({'count':_0x3a0626['length'],'rows':_0x3a0626});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x370104){var _0x383e8a=_[_0x876f('0x5c')](_0x440405[_0x876f('0x5d')]);_0x370104({'count':_0x383e8a[_0x876f('0x22')],'rows':_0x383e8a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x181f3f){var _0x446fcb=_[_0x876f('0x5c')](_0x440405[_0x876f('0x5e')]);_0x181f3f({'count':_0x446fcb[_0x876f('0x22')],'rows':_0x446fcb});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1e6314){var _0x571a82=_[_0x876f('0x5c')](_0x440405[_0x876f('0x5f')]);_0x1e6314({'count':_0x571a82[_0x876f('0x22')],'rows':_0x571a82});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x576fee){var _0x3cad2e=_[_0x876f('0x5c')](_0x440405[_0x876f('0x60')]);_0x576fee({'count':_0x3cad2e['length'],'rows':_0x3cad2e});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5bb956){var _0x456fb0=_[_0x876f('0x5c')](_0x440405[_0x876f('0x61')]);_0x5bb956({'count':_0x456fb0[_0x876f('0x22')],'rows':_0x456fb0});});}};var _0x3515ac=jayson['server'](_0x42911b)['http']();_0x3515ac['on'](_0x876f('0x36'),function(_0x14db25){logger['error'](JSON['stringify'](_0x14db25));return _0x3fc0b6(_0x14db25);});_0x3515ac['listen'](0x232c,_0x876f('0x62'),function(){console[_0x876f('0x63')](_0x876f('0x64'),0x232c);return _0x1e1c1a(_0x876f('0x65')+0x232c);});});}; \ No newline at end of file +var _0x8295=['checkWaitingNotifications','applications','length','join','app','.js','toLowerCase','autoreply','split','channel','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','tvox','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','./applications/utils','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction'];(function(_0x49fc28,_0x523dfd){var _0x5d79a6=function(_0x23898b){while(--_0x23898b){_0x49fc28['push'](_0x49fc28['shift']());}};_0x5d79a6(++_0x523dfd);}(_0x8295,0x113));var _0x5829=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0x8295[_0x4f3c9b];return _0x84e58a;};'use strict';var _=require(_0x5829('0x0'));var util=require(_0x5829('0x1'));var path=require(_0x5829('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x5829('0x3'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x5829('0x4')),'chatQueueReport':require(_0x5829('0x5')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x5829('0x6')),'whatsappQueueReport':require(_0x5829('0x7'))};var RuleEngine=require(_0x5829('0x8'));function getId(_0x5f56ec,_0x133fad,_0x17c545){return util[_0x5829('0x9')]('%s.%s.%s',_0x5f56ec,_0x133fad||0x0,_0x17c545||0x0);}function getIntervals(_0x4488af,_0x1bb5be){var _0x11b506=[];if(!_[_0x5829('0xa')](_0x1bb5be[_0x5829('0xb')])&&!_[_0x5829('0xa')](_0x4488af[_0x1bb5be[_0x5829('0xb')]])&&!_[_0x5829('0xa')](_0x4488af[_0x1bb5be[_0x5829('0xb')]][_0x5829('0xc')])){_0x11b506=_[_0x5829('0xd')](_0x4488af[_0x1bb5be[_0x5829('0xb')]][_0x5829('0xc')],'interval');}else if(!_[_0x5829('0xa')](_0x1bb5be[_0x5829('0xe')])){_0x11b506=[_0x1bb5be[_0x5829('0xe')]];}return _0x11b506;}exports[_0x5829('0xf')]=function(_0x211e13){_0x211e13[_0x5829('0x10')]={};return new BPromise(function(_0x3e7102,_0x35f67e){var _0x36176f={'Start':function(_0xe427e3){var _0x483217=this;return new Promise(function(_0x3207a2,_0x6df867){if(_0xe427e3){try{var _0x4300e7=[];var _0x5e65a0=getId(_0xe427e3['channel'],_0xe427e3['message']?_0xe427e3[_0x5829('0x11')]['id']:0x0,_0xe427e3[_0x5829('0x12')]?_0xe427e3[_0x5829('0x12')]['id']:0x0);var _0x40877f=sUtils[_0x5829('0x13')](_0x211e13,_0xe427e3);if(!_0x40877f&&_0xe427e3[_0x5829('0x14')]&&_['isArray'](_0xe427e3[_0x5829('0x14')])&&_0xe427e3[_0x5829('0x14')][_0x5829('0x15')]){for(var _0x5c0a37=0x0;_0x5c0a37<_0xe427e3[_0x5829('0x14')]['length'];_0x5c0a37+=0x1){var _0xceeffc=_0xe427e3[_0x5829('0x14')][_0x5c0a37];if(fs['existsSync'](path[_0x5829('0x16')](__dirname,_0x5829('0x14'),_0xceeffc[_0x5829('0x17')]+_0x5829('0x18')))){var _0x523139=[];switch(_0xceeffc[_0x5829('0x17')][_0x5829('0x19')]()){case _0x5829('0x1a'):var _0x51d0b4=_0xceeffc['appdata'][_0x5829('0x1b')](',');if(_0xe427e3[_0x5829('0x1c')]==='mail'){_0x523139[_0x5829('0x1d')](_0x51d0b4[0x0]);_0x523139['push'](_0x51d0b4[0x1]);_0x523139[_0x5829('0x1d')](_0x51d0b4[_0x5829('0x1e')](0x2,_0x51d0b4['length'])[_0x5829('0x16')](','));}else{_0x523139['push'](_0x51d0b4[0x0]);_0x523139[_0x5829('0x1d')](_0x51d0b4[_0x5829('0x1e')](0x1,_0x51d0b4[_0x5829('0x15')])[_0x5829('0x16')](','));}break;case _0x5829('0x1f'):var _0x1a6c62=_0xceeffc[_0x5829('0x20')][_0x5829('0x1b')](',');_0x523139['push'](_0x1a6c62[0x0]);_0x523139[_0x5829('0x1d')](_0x1a6c62[0x1]);_0x523139[_0x5829('0x1d')](_0x1a6c62[_0x5829('0x1e')](0x2,_0x1a6c62[_0x5829('0x15')])[_0x5829('0x16')](','));break;case _0x5829('0x21'):var _0x50e964=_0xceeffc[_0x5829('0x20')][_0x5829('0x1b')](',');_0x523139['push'](_0x50e964[0x0]);_0x523139[_0x5829('0x1d')](_0x50e964[0x1]);_0x523139[_0x5829('0x1d')](_0x50e964[0x2]);_0x523139[_0x5829('0x1d')](_0x50e964[0x3]);_0x523139[_0x5829('0x1d')](_0x50e964[_0x5829('0x1e')](0x4,_0x50e964[_0x5829('0x15')])[_0x5829('0x16')](','));break;case _0x5829('0x22'):var _0x358246=_0xceeffc['appdata'][_0x5829('0x1b')](',');_0x523139[_0x5829('0x1d')](_0x358246[0x0]);_0x523139[_0x5829('0x1d')](_0x358246[0x1]);_0x523139[_0x5829('0x1d')](_0x358246[0x2]);_0x523139[_0x5829('0x1d')](_0x358246[0x3]);_0x523139['push'](_0x358246[_0x5829('0x1e')](0x4,_0x358246[_0x5829('0x15')])[_0x5829('0x16')](','));break;case _0x5829('0x11'):_0x523139[_0x5829('0x1d')](_0xceeffc[_0x5829('0x20')]);break;case _0x5829('0x23'):_0x523139[_0x5829('0x1d')](_0xceeffc[_0x5829('0x24')]);_0x523139[_0x5829('0x1d')](_0xceeffc[_0x5829('0x20')]);break;case _0x5829('0x25'):var _0x34d039=utils['getMustacheRender'](_0xe427e3[_0x5829('0x26')]['notificationTemplate'],_0xe427e3);var _0x609afe=_0xceeffc['appdata']['split'](',');_0x523139[_0x5829('0x1d')](_0x609afe[0x0]);_0x523139[_0x5829('0x1d')](_0x609afe[0x1]);_0x523139[_0x5829('0x1d')](_0x609afe[0x2]);_0x523139[_0x5829('0x1d')](_0x609afe[0x3]);_0x523139[_0x5829('0x1d')](_0x609afe[0x4]);_0x523139['push'](_0x609afe[0x5]);_0x523139[_0x5829('0x1d')](_0x609afe[0x6]);_0x523139[_0x5829('0x1d')](_0x609afe[0x7]);_0x523139[_0x5829('0x1d')](_0x609afe[0x8]);_0x523139[_0x5829('0x1d')](_0x609afe[0x9]);_0x523139['push'](_0x609afe[0xa]);_0x523139[_0x5829('0x1d')](_0xe427e3[_0x5829('0x12')]['id']);_0x523139['push'](_0xe427e3['message']['id']);_0x523139[_0x5829('0x1d')](_0xceeffc[_0x5829('0x27')]);_0x523139['push'](_0xe427e3['interaction'][_0x5829('0x28')]);_0x523139[_0x5829('0x1d')](_0xe427e3[_0x5829('0x29')][_0x5829('0x29')]);_0x523139[_0x5829('0x1d')](_0x34d039);break;default:_0x523139=_['isNil'](_0xceeffc[_0x5829('0x20')])?[]:_0xceeffc[_0x5829('0x20')]['split'](',');}var _0x1082a4={'id':util['format'](_0x5829('0x2a'),_0x5e65a0,_0xceeffc['id'],_0xceeffc[_0x5829('0x17')]),'condition':require(_0x5829('0x2b'))[_0x5829('0x2c')](_0x5e65a0,getIntervals(_0x211e13['intervals'],_0xceeffc),_0x211e13),'consequence':require(_0x5829('0x2d')+_0xceeffc['app'])['consequence'](_0x5e65a0,_0x523139,_0x211e13,_0xe427e3),'p':_0xceeffc[_0x5829('0x2e')]||0x0};logger[_0x5829('0x2f')](_0x5829('0x30'),_0x1082a4['id'],_0x5829('0x31'),getIntervals(_0x211e13[_0x5829('0x32')],_0xceeffc)['join'](_0x5829('0x33')));_0x4300e7[_0x5829('0x1d')](_0x1082a4);}else{logger['error'](_0x5829('0x34'),path['join'](__dirname,'applications',_0xceeffc['app']+_0x5829('0x18')));}}_0x211e13[_0x5829('0x10')][_0x5e65a0]=new RuleEngine(_0x4300e7);_0x211e13['rules'][_0x5e65a0][_0x5829('0x35')](_0xe427e3,function(_0x76b68c){logger[_0x5829('0x2f')](_0x5829('0x36'),JSON[_0x5829('0x37')](_0x76b68c['matchPath']));if(_0x211e13[_0x5829('0x10')][_0x5e65a0]){_0x211e13[_0x5829('0x10')][_0x5e65a0][_0x5829('0x38')](_0x5829('0x39'));}});return _0x3207a2({'code':0xc8,'message':_0xe427e3});}else{if(_0x40877f){logger['info'](util[_0x5829('0x9')]('Skipped\x20routing\x20for\x20%s',_0x5e65a0));}else{logger[_0x5829('0x2f')](_0x5829('0x3a'));}return _0x3207a2({'code':0xc8,'message':_0xe427e3});}}catch(_0x427f58){logger['error'](_0x427f58[_0x5829('0x3b')]);return _0x6df867(_0x483217['error'](0x1f4,_0x427f58));}}return _0x6df867(_0x5829('0x3c'));});},'AcceptMessage':function(_0x48a18b){var _0x79aebc=this;return new Promise(function(_0x52e500,_0xc4d1d0){if(_0x48a18b[_0x5829('0x3d')]&&_0x48a18b['agent']['id']){if(_0x211e13[_0x5829('0x3e')][_0x48a18b[_0x5829('0x3d')]['id']]){_0x211e13['agents'][_0x48a18b['agent']['id']][_0x5829('0x3f')]=![];_0x211e13['agents'][_0x48a18b[_0x5829('0x3d')]['id']][_0x5829('0x40')]=undefined;}}if(_0x48a18b['message']&&_0x48a18b[_0x5829('0x11')]['id']){try{var _0x3abc24=getId(_0x48a18b['channel'],_0x48a18b[_0x5829('0x11')]?_0x48a18b[_0x5829('0x11')]['id']:0x0,_0x48a18b[_0x5829('0x12')]?_0x48a18b[_0x5829('0x12')]['id']:0x0);if(_0x211e13[_0x5829('0x10')][_0x3abc24]){_0x211e13['rules'][_0x3abc24][_0x5829('0x38')](_0x5829('0x41'));if(rpc[_0x48a18b[_0x5829('0x1c')]+_0x5829('0x42')]){rpc[_0x48a18b[_0x5829('0x1c')]+_0x5829('0x42')]['update'](_0x3abc24,{'UserId':_0x48a18b['message'][_0x5829('0x43')]})[_0x5829('0x44')](function(){logger[_0x5829('0x45')](_0x5829('0x46'));});}}return _0x52e500({'code':0xc8,'message':_0x48a18b});}catch(_0x4761a4){logger[_0x5829('0x45')](_0x4761a4['stack']);return _0xc4d1d0(_0x79aebc[_0x5829('0x45')](0x1f4,_0x4761a4));}}logger[_0x5829('0x45')](_0x5829('0x47'));return _0xc4d1d0(_0x79aebc[_0x5829('0x45')](0x1f4,_0x5829('0x47')));});},'RejectMessage':function(_0x2b0b75){var _0x3d5942=this;return new Promise(function(_0x589999,_0x5b200d){if(_0x2b0b75[_0x5829('0x3d')]&&_0x2b0b75[_0x5829('0x3d')]['id']){try{if(_0x211e13['agents'][_0x2b0b75[_0x5829('0x3d')]['id']]){_0x211e13[_0x5829('0x3e')][_0x2b0b75[_0x5829('0x3d')]['id']]['busy']=![];_0x211e13[_0x5829('0x3e')][_0x2b0b75[_0x5829('0x3d')]['id']][_0x5829('0x40')]=undefined;}return _0x589999({'code':0xc8,'message':_0x2b0b75});}catch(_0x358837){logger[_0x5829('0x45')](_0x358837[_0x5829('0x3b')]);return _0x5b200d(_0x3d5942[_0x5829('0x45')](0x1f4,_0x358837));}}logger['error'](_0x5829('0x47'));return _0x5b200d(_0x3d5942[_0x5829('0x45')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x24f87b){var _0x2dde80=this;return new Promise(function(_0x38b604,_0x5b2a44){if(_0x24f87b[_0x5829('0x1c')]&&_0x24f87b[_0x5829('0x12')]&&_0x24f87b[_0x5829('0x12')]['id']){try{var _0x29c85f=getId(_0x24f87b[_0x5829('0x1c')],_0x24f87b['message']?_0x24f87b[_0x5829('0x11')]['id']:0x0,_0x24f87b[_0x5829('0x12')]?_0x24f87b[_0x5829('0x12')]['id']:0x0);if(_0x211e13[_0x5829('0x10')][_0x29c85f]){_0x211e13[_0x5829('0x10')][_0x29c85f][_0x5829('0x38')](_0x5829('0x41'));}return _0x38b604({'code':0xc8,'message':_0x24f87b});}catch(_0x5a1816){logger[_0x5829('0x45')](_0x5a1816[_0x5829('0x3b')]);return _0x5b2a44(_0x2dde80[_0x5829('0x45')](0x1f4,_0x5a1816));}}logger[_0x5829('0x45')](_0x5829('0x47'));return _0x5b2a44(_0x2dde80[_0x5829('0x45')](0x1f4,_0x5829('0x47')));});},'AgentCapacity':function(_0x49df8e){var _0x4833f1=this;return new Promise(function(_0x42df8c,_0x59a170){if(_0x211e13['agents'][_0x5829('0x48')](_0x49df8e['id'])){for(var _0x3be587 in _0x49df8e[_0x5829('0x49')]){if(_0x49df8e[_0x5829('0x49')][_0x5829('0x48')](_0x3be587)){if(_0x211e13[_0x5829('0x3e')][_0x49df8e['id']][_0x5829('0x48')](_0x3be587+_0x5829('0x4a'))){_0x211e13[_0x5829('0x3e')][_0x49df8e['id']][_0x3be587+_0x5829('0x4a')]=parseInt(_0x49df8e[_0x5829('0x49')][_0x3be587],0xa);}}}_0x211e13[_0x5829('0x3e')][_0x49df8e['id']][_0x5829('0x4b')]();return _0x42df8c({'code':0xc8,'message':_0x211e13[_0x5829('0x3e')][_0x49df8e['id']]});}else{return _0x59a170(_0x4833f1[_0x5829('0x45')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x29cf17){return new Promise(function(_0x161617){var _0x50f8b4=_[_0x5829('0x4c')](_0x211e13['agents']);if(_0x29cf17&&_0x29cf17['id']){var _0x4aa05b=_['find'](_0x50f8b4,function(_0x282e40){return _0x282e40['id']===_0x29cf17['id'];});_0x161617(_0x4aa05b);}else{_0x161617({'count':_0x50f8b4['length'],'rows':_0x50f8b4});}});},'ChatQueues':function(){return new Promise(function(_0x1c2f1b){var _0xe3024c=[];for(var _0xb74446 in _0x211e13[_0x5829('0x4d')]){if(_0x211e13[_0x5829('0x4d')][_0x5829('0x48')](_0xb74446)){var _0x1dbe95=_0x211e13[_0x5829('0x4d')][_0xb74446];var _0x45a558={'id':_0x1dbe95['id'],'available':_0x1dbe95['available'],'loggedIn':_0x1dbe95[_0x5829('0x4e')],'name':_0x1dbe95[_0x5829('0x4f')],'paused':_0x1dbe95[_0x5829('0x50')],'waiting':_0x1dbe95[_0x5829('0x51')]};_0xe3024c[_0x5829('0x1d')](_0x45a558);}}_0x1c2f1b({'count':_0xe3024c['length'],'rows':_0xe3024c});});},'MailQueues':function(){return new Promise(function(_0x41927c){var _0x171918=[];for(var _0x3dc961 in _0x211e13[_0x5829('0x52')]){if(_0x211e13[_0x5829('0x52')][_0x5829('0x48')](_0x3dc961)){var _0xcfaf52=_0x211e13[_0x5829('0x52')][_0x3dc961];var _0x2ddb14={'id':_0xcfaf52['id'],'available':_0xcfaf52[_0x5829('0x53')],'loggedIn':_0xcfaf52['loggedIn'],'name':_0xcfaf52[_0x5829('0x4f')],'paused':_0xcfaf52[_0x5829('0x50')],'waiting':_0xcfaf52['waiting']};_0x171918[_0x5829('0x1d')](_0x2ddb14);}}_0x41927c({'count':_0x171918[_0x5829('0x15')],'rows':_0x171918});});},'OpenchannelQueues':function(){return new Promise(function(_0x55d6){var _0x7799ea=[];for(var _0x3ecd75 in _0x211e13[_0x5829('0x54')]){if(_0x211e13[_0x5829('0x54')]['hasOwnProperty'](_0x3ecd75)){var _0xbb9a27=_0x211e13['openchannelQueues'][_0x3ecd75];var _0x388ffa={'id':_0xbb9a27['id'],'available':_0xbb9a27['available'],'loggedIn':_0xbb9a27[_0x5829('0x4e')],'name':_0xbb9a27[_0x5829('0x4f')],'paused':_0xbb9a27['paused'],'waiting':_0xbb9a27[_0x5829('0x51')]};_0x7799ea[_0x5829('0x1d')](_0x388ffa);}}_0x55d6({'count':_0x7799ea[_0x5829('0x15')],'rows':_0x7799ea});});},'SmsQueues':function(){return new Promise(function(_0x2d579c){var _0x4fc4ea=[];for(var _0x3cd735 in _0x211e13[_0x5829('0x55')]){if(_0x211e13[_0x5829('0x55')][_0x5829('0x48')](_0x3cd735)){var _0x2a20b3=_0x211e13['smsQueues'][_0x3cd735];var _0x18fdc6={'id':_0x2a20b3['id'],'available':_0x2a20b3[_0x5829('0x53')],'loggedIn':_0x2a20b3[_0x5829('0x4e')],'name':_0x2a20b3[_0x5829('0x4f')],'paused':_0x2a20b3[_0x5829('0x50')],'waiting':_0x2a20b3[_0x5829('0x51')]};_0x4fc4ea['push'](_0x18fdc6);}}_0x2d579c({'count':_0x4fc4ea[_0x5829('0x15')],'rows':_0x4fc4ea});});},'FaxQueues':function(){return new Promise(function(_0x2d053a){var _0x51a07b=[];for(var _0x1e36a7 in _0x211e13[_0x5829('0x56')]){if(_0x211e13[_0x5829('0x56')]['hasOwnProperty'](_0x1e36a7)){var _0x1d51e9=_0x211e13['faxQueues'][_0x1e36a7];var _0x3ba231={'id':_0x1d51e9['id'],'available':_0x1d51e9[_0x5829('0x53')],'loggedIn':_0x1d51e9[_0x5829('0x4e')],'name':_0x1d51e9['name'],'paused':_0x1d51e9[_0x5829('0x50')],'waiting':_0x1d51e9[_0x5829('0x51')]};_0x51a07b[_0x5829('0x1d')](_0x3ba231);}}_0x2d053a({'count':_0x51a07b[_0x5829('0x15')],'rows':_0x51a07b});});},'WhatsappQueues':function(){return new Promise(function(_0x1acb3f){var _0x17a928=[];for(var _0x5b6340 in _0x211e13[_0x5829('0x57')]){if(_0x211e13[_0x5829('0x57')][_0x5829('0x48')](_0x5b6340)){var _0x57fb31=_0x211e13[_0x5829('0x57')][_0x5b6340];var _0x45487a={'id':_0x57fb31['id'],'available':_0x57fb31[_0x5829('0x53')],'loggedIn':_0x57fb31['loggedIn'],'name':_0x57fb31[_0x5829('0x4f')],'paused':_0x57fb31[_0x5829('0x50')],'waiting':_0x57fb31[_0x5829('0x51')]};_0x17a928[_0x5829('0x1d')](_0x45487a);}}_0x1acb3f({'count':_0x17a928[_0x5829('0x15')],'rows':_0x17a928});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1cf6b9){var _0x11b3fe=_[_0x5829('0x4c')](_0x211e13[_0x5829('0x58')]);_0x1cf6b9({'count':_0x11b3fe[_0x5829('0x15')],'rows':_0x11b3fe});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x278012){var _0x24f7fd=_['values'](_0x211e13[_0x5829('0x59')]);_0x278012({'count':_0x24f7fd[_0x5829('0x15')],'rows':_0x24f7fd});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1cf80c){var _0x225e79=_[_0x5829('0x4c')](_0x211e13['openchannelQueuesWaitingInteractions']);_0x1cf80c({'count':_0x225e79[_0x5829('0x15')],'rows':_0x225e79});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1749d2){var _0x255ab3=_[_0x5829('0x4c')](_0x211e13[_0x5829('0x5a')]);_0x1749d2({'count':_0x255ab3['length'],'rows':_0x255ab3});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x554eb0){var _0x3f7566=_[_0x5829('0x4c')](_0x211e13[_0x5829('0x5b')]);_0x554eb0({'count':_0x3f7566[_0x5829('0x15')],'rows':_0x3f7566});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x132297){var _0x104a4e=_[_0x5829('0x4c')](_0x211e13[_0x5829('0x5c')]);_0x132297({'count':_0x104a4e['length'],'rows':_0x104a4e});});}};var _0x1e58cc=jayson[_0x5829('0x5d')](_0x36176f)[_0x5829('0x5e')]();_0x1e58cc['on'](_0x5829('0x45'),function(_0x34138c){logger['error'](JSON[_0x5829('0x37')](_0x34138c));return _0x35f67e(_0x34138c);});_0x1e58cc[_0x5829('0xf')](0x232c,'127.0.0.1',function(){console[_0x5829('0x5f')](_0x5829('0x60'),0x232c);return _0x3e7102(_0x5829('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 04cd0fc..7749f89 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 _0x9d3e=['message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x9d3e,0x15e));var _0xe9d3=function(_0x16856a,_0x41c46b){_0x16856a=_0x16856a-0x0;var _0x3b9791=_0x9d3e[_0x16856a];return _0x3b9791;};'use strict';var util=require(_0xe9d3('0x0'));var BPromise=require(_0xe9d3('0x1'));var jayson=require(_0xe9d3('0x2'));var _=require(_0xe9d3('0x3'));var logger=require(_0xe9d3('0x4'))('routing');var client=jayson[_0xe9d3('0x5')][_0xe9d3('0x6')]({'port':0x232a});function request(_0xbf2f88,_0x351f2f){return new BPromise(function(_0x759b7d,_0x50230a){return client[_0xe9d3('0x7')](_0xbf2f88,_0x351f2f)[_0xe9d3('0x8')](function(_0x2145fd){if(_0x2145fd[_0xe9d3('0x9')]){return _0x50230a(_0x2145fd[_0xe9d3('0x9')][_0xe9d3('0xa')]);}else{return _0x759b7d(_0x2145fd['result']);}})[_0xe9d3('0xb')](function(_0x24f03d){return _0x50230a(_0x24f03d);});});}exports[_0xe9d3('0xc')]=function(_0x48554d,_0x3c6cb0,_0x2f04d7){return function(_0x400c3e){if(_0x2f04d7[_0xe9d3('0xd')]&&!_0x2f04d7[_0xe9d3('0xd')][_0x48554d]){logger[_0xe9d3('0xe')](_0xe9d3('0xf'),_0x48554d);return _0x400c3e[_0xe9d3('0x10')]();}var _0x5c1cb1=[];for(var _0x3772aa=0x0;_0x3772aa<_0x3c6cb0['length'];_0x3772aa+=0x1){_0x5c1cb1[_0xe9d3('0x11')](request('Command',{'command':util[_0xe9d3('0x12')](_0xe9d3('0x13'),_0x3c6cb0[_0x3772aa])})[_0xe9d3('0x8')](function(_0xa81d17){return _0xa81d17&&_0xa81d17['message']&&_0xa81d17[_0xe9d3('0xa')]['indexOf'](_0xe9d3('0x14'))>=0x0?!![]:![];})[_0xe9d3('0xb')](function(_0x23d206){logger['error'](_0xe9d3('0x15'),_0x48554d,_0x3c6cb0[_0x3772aa]);}));}BPromise[_0xe9d3('0x16')](_0x5c1cb1)[_0xe9d3('0x8')](function(_0x3eb18){var _0x3f0d77=_[_0xe9d3('0x17')](_0x3eb18);logger[_0xe9d3('0xe')](_0xe9d3('0x18'),_0x48554d,_0x3c6cb0[_0xe9d3('0x19')](_0xe9d3('0x1a')),_0x3f0d77);_0x400c3e[_0xe9d3('0x1b')](_0x3f0d77);})[_0xe9d3('0xb')](function(_0x29a674){console[_0xe9d3('0x1c')](_0x29a674);logger[_0xe9d3('0x9')](_0xe9d3('0x18'),_0x48554d,_0x3c6cb0['join'](_0xe9d3('0x1a')),_0x29a674[_0xe9d3('0x1d')]);_0x400c3e[_0xe9d3('0x10')]();});};}; \ No newline at end of file +var _0x647a=['format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','join','stack','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command'];(function(_0x4df7f8,_0x241b47){var _0x5f56be=function(_0x488555){while(--_0x488555){_0x4df7f8['push'](_0x4df7f8['shift']());}};_0x5f56be(++_0x241b47);}(_0x647a,0x1dd));var _0xa647=function(_0x16438a,_0x3544be){_0x16438a=_0x16438a-0x0;var _0x9d2e74=_0x647a[_0x16438a];return _0x9d2e74;};'use strict';var util=require('util');var BPromise=require(_0xa647('0x0'));var jayson=require(_0xa647('0x1'));var _=require(_0xa647('0x2'));var logger=require(_0xa647('0x3'))('routing');var client=jayson[_0xa647('0x4')][_0xa647('0x5')]({'port':0x232a});function request(_0x5cdbed,_0x480edf){return new BPromise(function(_0x1572a3,_0x5de5a8){return client[_0xa647('0x6')](_0x5cdbed,_0x480edf)[_0xa647('0x7')](function(_0x58458e){if(_0x58458e[_0xa647('0x8')]){return _0x5de5a8(_0x58458e['error'][_0xa647('0x9')]);}else{return _0x1572a3(_0x58458e['result']);}})[_0xa647('0xa')](function(_0x1c7c69){return _0x5de5a8(_0x1c7c69);});});}exports['condition']=function(_0x2a85b3,_0x4218b4,_0x221933){return function(_0x328c23){if(_0x221933[_0xa647('0xb')]&&!_0x221933['rules'][_0x2a85b3]){logger[_0xa647('0xc')](_0xa647('0xd'),_0x2a85b3);return _0x328c23[_0xa647('0xe')]();}var _0x104ffd=[];for(var _0x1326d0=0x0;_0x1326d0<_0x4218b4['length'];_0x1326d0+=0x1){_0x104ffd[_0xa647('0xf')](request(_0xa647('0x10'),{'command':util[_0xa647('0x11')](_0xa647('0x12'),_0x4218b4[_0x1326d0])})[_0xa647('0x7')](function(_0x53dd9e){return _0x53dd9e&&_0x53dd9e['message']&&_0x53dd9e[_0xa647('0x9')]['indexOf'](_0xa647('0x13'))>=0x0?!![]:![];})['catch'](function(_0x2c29ee){logger[_0xa647('0x8')](_0xa647('0x14'),_0x2a85b3,_0x4218b4[_0x1326d0]);}));}BPromise['all'](_0x104ffd)[_0xa647('0x7')](function(_0x104ac9){var _0x3c8b78=_['some'](_0x104ac9);logger[_0xa647('0xc')](_0xa647('0x15'),_0x2a85b3,_0x4218b4['join'](_0xa647('0x16')),_0x3c8b78);_0x328c23['when'](_0x3c8b78);})[_0xa647('0xa')](function(_0x447e9f){console[_0xa647('0x17')](_0x447e9f);logger['error'](_0xa647('0x15'),_0x2a85b3,_0x4218b4[_0xa647('0x18')]('\x20|\x20'),_0x447e9f[_0xa647('0x19')]);_0x328c23['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 50a1fbc..d990392 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 _0xe1e3=['agentcompleteAt','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transferuniqueid','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','complete','lodash','util','format','uniqueid','channel','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentcomplete','acwtime','agentacw','acwTimeout','CreateVoiceAgentReport','[%s][agents][agentcalled]','destuniqueid','now','called','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','debug','agentringnoanswer','agentringnoanswerAt','timeout','talktime','error','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime'];(function(_0x22d369,_0x2ce92b){var _0x247bd2=function(_0x29f7af){while(--_0x29f7af){_0x22d369['push'](_0x22d369['shift']());}};_0x247bd2(++_0x2ce92b);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x3db54a,_0x4bac11){_0x3db54a=_0x3db54a-0x0;var _0x1c0134=_0xe1e3[_0x3db54a];return _0x1c0134;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0xdbdabb,_0x5e9f9a){utils['info'](util[_0x3e1e('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xdbdabb[_0x3e1e('0x3')],_0xdbdabb[_0x3e1e('0x4')],_0xdbdabb[_0x3e1e('0x5')],_0xdbdabb[_0x3e1e('0x6')],_0xdbdabb[_0x3e1e('0x7')],_0xdbdabb[_0x3e1e('0x8')],_0xdbdabb['connectedlinenum'],_0xdbdabb[_0x3e1e('0x9')]));if(_0xdbdabb[_0x3e1e('0x5')]){utils[_0x3e1e('0xa')](_0xdbdabb[_0x3e1e('0x5')])[_0x3e1e('0xb')](function(_0x1e5173){if(_0x1e5173){_0xdbdabb['type']=_0x1e5173['type'];_0xdbdabb['agentacw']=_0xdbdabb[_0x3e1e('0xc')]?_0x1e5173['acw']:![];_0xdbdabb[_0x3e1e('0xd')]=_0xdbdabb[_0x3e1e('0xe')]?_0x1e5173[_0x3e1e('0xf')]:0x0;}utils['request'](_0x3e1e('0x10'),_0xdbdabb);});}else{utils['request']('CreateVoiceAgentReport',_0xdbdabb);}if(_0x5e9f9a){delete transfers[_0xdbdabb['uniqueid']];}else{delete agents[_0xdbdabb['destuniqueid']];}}exports['agentcalled']=function(_0x14ad58){try{utils['debug'](util['format'](_0x3e1e('0x11'),_0x14ad58[_0x3e1e('0x3')]),_0x14ad58);agents[_0x14ad58[_0x3e1e('0x12')]]=_0x14ad58;agents[_0x14ad58['destuniqueid']]['agentcalledAt']=utils[_0x3e1e('0x13')]();agents[_0x14ad58[_0x3e1e('0x12')]]['lastevent']=_0x3e1e('0x14');agents[_0x14ad58[_0x3e1e('0x12')]]['connectedlinenum']=null;agents[_0x14ad58[_0x3e1e('0x12')]]['connectedlinename']=null;utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x16'),_0x14ad58[_0x3e1e('0x3')],agents[_0x14ad58[_0x3e1e('0x12')]][_0x3e1e('0x6')],_0x14ad58['destuniqueid']));}catch(_0x5dccb8){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x11'),_0x14ad58[_0x3e1e('0x3')]),_0x5dccb8);}};exports['agentringnoanswer']=function(_0x1c5acd){try{if(!_['isNil'](agents[_0x1c5acd[_0x3e1e('0x12')]])){utils[_0x3e1e('0x17')](util[_0x3e1e('0x2')]('[%s][agents][agentringnoanswer]',_0x1c5acd[_0x3e1e('0x3')]),_0x1c5acd);utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1c5acd['uniqueid'],agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x6')],_0x1c5acd['destuniqueid']));agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x18')]=!![];agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x19')]=utils[_0x3e1e('0x13')]();agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x9')]=_0x3e1e('0x1a');agents[_0x1c5acd['destuniqueid']]['reason']=_0x3e1e('0x1a');agents[_0x1c5acd[_0x3e1e('0x12')]]['holdtime']=_0x1c5acd['ringtime']?parseInt(_0x1c5acd['ringtime'])/0x3e8:0x0;agents[_0x1c5acd[_0x3e1e('0x12')]][_0x3e1e('0x1b')]=0x0;unanswered['push'](_0x1c5acd[_0x3e1e('0x12')]);}}catch(_0x5ac814){utils[_0x3e1e('0x1c')](util[_0x3e1e('0x2')]('[%s][agents][agentringnoanswer]',_0x1c5acd[_0x3e1e('0x3')]),_0x5ac814);}};exports[_0x3e1e('0x1d')]=function(_0x45ed0e){try{_['forIn'](agents,function(_0xdef39,_0x4ec149){if(_0xdef39['uniqueid']==_0x45ed0e['uniqueid']&&!_[_0x3e1e('0x1e')](unanswered,_0xdef39['destuniqueid'])){utils['debug'](util[_0x3e1e('0x2')](_0x3e1e('0x1f'),_0x45ed0e[_0x3e1e('0x3')]),_0x45ed0e);utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x45ed0e['uniqueid'],_0xdef39['membername'],_0xdef39['destuniqueid']));_0xdef39[_0x3e1e('0x18')]=!![];_0xdef39[_0x3e1e('0x19')]=utils[_0x3e1e('0x13')]();_0xdef39[_0x3e1e('0x9')]=_0x3e1e('0x20');_0xdef39[_0x3e1e('0x21')]=_0x3e1e('0x20');_0xdef39[_0x3e1e('0x22')]=_0x45ed0e['holdtime'];_0xdef39[_0x3e1e('0x1b')]=0x0;writeDB(_0xdef39);}});}catch(_0x348ef5){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x1f'),_0x45ed0e[_0x3e1e('0x3')]),_0x348ef5);}};exports[_0x3e1e('0x23')]=function(_0x55a082){try{if(agents[_0x55a082['destuniqueid']]){utils[_0x3e1e('0x17')](util[_0x3e1e('0x2')]('[%s][agents][agentconnect]',_0x55a082[_0x3e1e('0x3')]),_0x55a082);utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x24'),_0x55a082[_0x3e1e('0x3')],agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x6')],_0x55a082[_0x3e1e('0x12')]));agents[_0x55a082['destuniqueid']][_0x3e1e('0x25')]=utils[_0x3e1e('0x13')]();agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x26')]=_0x55a082['connectedlinenum'];agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x27')]=_0x55a082[_0x3e1e('0x27')];agents[_0x55a082[_0x3e1e('0x12')]][_0x3e1e('0x22')]=_0x55a082[_0x3e1e('0x28')];agents[_0x55a082[_0x3e1e('0x12')]]['lastevent']=_0x3e1e('0x29');_['forIn'](agents,function(_0x53bdf5,_0x4f598e){if(_0x53bdf5[_0x3e1e('0x12')]!=_0x55a082[_0x3e1e('0x12')]&&_0x53bdf5['uniqueid']==_0x55a082[_0x3e1e('0x3')]){_0x53bdf5[_0x3e1e('0x1b')]=0x0;_0x53bdf5['holdtime']=_0x55a082[_0x3e1e('0x28')];_0x53bdf5[_0x3e1e('0x18')]=!![];_0x53bdf5['agentringnoanswerAt']=utils['now']();_0x53bdf5[_0x3e1e('0x9')]='answered_elsewhere';_0x53bdf5['reason']=_0x3e1e('0x2a');_0x53bdf5[_0x3e1e('0x2b')]=_0x55a082[_0x3e1e('0x12')];_0x53bdf5[_0x3e1e('0x2c')]=_0x55a082[_0x3e1e('0x6')];writeDB(_0x53bdf5);}});}}catch(_0x55ea1d){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x2d'),_0x55a082[_0x3e1e('0x3')]),_0x55ea1d);}};exports['agentcomplete']=function(_0x1124d0){try{if(!_[_0x3e1e('0x2e')](agents[_0x1124d0[_0x3e1e('0x12')]])){utils['debug'](util[_0x3e1e('0x2')]('[%s][agents][agentcomplete]',_0x1124d0['uniqueid']),_0x1124d0);utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x2f'),_0x1124d0[_0x3e1e('0x3')],agents[_0x1124d0['destuniqueid']]['membername'],_0x1124d0['destuniqueid']));agents[_0x1124d0['destuniqueid']][_0x3e1e('0xc')]=!![];agents[_0x1124d0[_0x3e1e('0x12')]]['agentcompleteAt']=utils['now']();agents[_0x1124d0[_0x3e1e('0x12')]][_0x3e1e('0x1b')]=utils[_0x3e1e('0x30')](agents[_0x1124d0['destuniqueid']][_0x3e1e('0x31')],agents[_0x1124d0['destuniqueid']][_0x3e1e('0x25')]);agents[_0x1124d0[_0x3e1e('0x12')]][_0x3e1e('0x21')]=_0x1124d0[_0x3e1e('0x21')];agents[_0x1124d0[_0x3e1e('0x12')]][_0x3e1e('0x9')]='complete';writeDB(agents[_0x1124d0[_0x3e1e('0x12')]]);}}catch(_0x1ce1cd){utils['error'](util[_0x3e1e('0x2')](_0x3e1e('0x32'),_0x1124d0['uniqueid']),_0x1ce1cd);}};exports[_0x3e1e('0x33')]=function(_0x347b3f){try{if(!_[_0x3e1e('0x2e')](agents[_0x347b3f[_0x3e1e('0x34')]])){utils['debug'](util[_0x3e1e('0x2')](_0x3e1e('0x35'),_0x347b3f[_0x3e1e('0x3')]),_0x347b3f);utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x36'),_0x347b3f[_0x3e1e('0x3')],agents[_0x347b3f[_0x3e1e('0x34')]][_0x3e1e('0x6')],agents[_0x347b3f[_0x3e1e('0x34')]][_0x3e1e('0x3')]));agents[_0x347b3f[_0x3e1e('0x34')]][_0x3e1e('0x37')]=!![];agents[_0x347b3f['transfereruniqueid']][_0x3e1e('0x38')]='blind';agents[_0x347b3f['transfereruniqueid']]['transferexten']=_0x347b3f[_0x3e1e('0x39')];agents[_0x347b3f[_0x3e1e('0x34')]]['transferuniqueid']=agents[_0x347b3f[_0x3e1e('0x34')]]['uniqueid'];}}catch(_0x5b2416){utils[_0x3e1e('0x1c')](util['format']('[%s][agents][blindtransfer]',_0x347b3f['uniqueid']),_0x5b2416);}};exports[_0x3e1e('0x3a')]=function(_0xe577b2){try{utils[_0x3e1e('0x17')](util[_0x3e1e('0x2')](_0x3e1e('0x3b'),_0xe577b2[_0x3e1e('0x3c')]),_0xe577b2);if(_0xe577b2[_0x3e1e('0x3c')]==_0xe577b2['origtransfererlinkedid']){if(!_[_0x3e1e('0x2e')](agents[_0xe577b2['secondtransfereruniqueid']])){utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x3d'),_0xe577b2['origtransfereruniqueid'],agents[_0xe577b2['secondtransfereruniqueid']][_0x3e1e('0x6')]));agents[_0xe577b2[_0x3e1e('0x3e')]]['transfer']=!![];agents[_0xe577b2[_0x3e1e('0x3e')]]['transfertype']='ATTENDED';agents[_0xe577b2[_0x3e1e('0x3e')]][_0x3e1e('0x3f')]=_0xe577b2['origtransfererexten'];agents[_0xe577b2[_0x3e1e('0x3e')]]['transferuniqueid']=_0xe577b2['origtransfereruniqueid'];}if(_0xe577b2[_0x3e1e('0x40')]&&agents[_0xe577b2['transfereeuniqueid']]){agents[_0xe577b2[_0x3e1e('0x40')]]['agententerreason']=0x1;transfers[_0xe577b2[_0x3e1e('0x40')]]=_['clone'](agents[_0xe577b2[_0x3e1e('0x40')]]);transfers[_0xe577b2[_0x3e1e('0x40')]]['calleridnum']=agents[_0xe577b2['secondtransfereruniqueid']]['calleridnum'];transfers[_0xe577b2[_0x3e1e('0x40')]][_0x3e1e('0x41')]=agents[_0xe577b2[_0x3e1e('0x3e')]]['calleridname'];transfers[_0xe577b2[_0x3e1e('0x40')]][_0x3e1e('0x42')]=utils[_0x3e1e('0x13')]();transfers[_0xe577b2['transfereeuniqueid']]['agentconnectAt']=utils[_0x3e1e('0x13')]();transfers[_0xe577b2['transfereeuniqueid']][_0x3e1e('0x22')]=0x0;transfers[_0xe577b2[_0x3e1e('0x40')]][_0x3e1e('0x43')]=0x2;}}else if(_0xe577b2['secondtransfereruniqueid']==_0xe577b2[_0x3e1e('0x44')]){if(!_['isNil'](agents[_0xe577b2[_0x3e1e('0x3c')]])){utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x3d'),_0xe577b2['origtransfereruniqueid'],agents[_0xe577b2[_0x3e1e('0x3c')]]['membername']));agents[_0xe577b2[_0x3e1e('0x3c')]]['transfer']=!![];agents[_0xe577b2[_0x3e1e('0x3c')]][_0x3e1e('0x38')]=_0x3e1e('0x45');agents[_0xe577b2['origtransfereruniqueid']][_0x3e1e('0x3f')]=_0xe577b2[_0x3e1e('0x46')];agents[_0xe577b2['origtransfereruniqueid']][_0x3e1e('0x47')]=_0xe577b2['secondtransfereruniqueid'];}if(_0xe577b2['transfertargetuniqueid']&&agents[_0xe577b2['transfertargetuniqueid']]){agents[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x43')]=0x1;transfers[_0xe577b2[_0x3e1e('0x48')]]=_[_0x3e1e('0x49')](agents[_0xe577b2[_0x3e1e('0x48')]]);transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x8')]=agents[_0xe577b2['origtransfereruniqueid']][_0x3e1e('0x8')];transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x41')]=agents[_0xe577b2[_0x3e1e('0x3c')]][_0x3e1e('0x41')];transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x42')]=utils[_0x3e1e('0x13')]();transfers[_0xe577b2['transfertargetuniqueid']]['agentconnectAt']=utils[_0x3e1e('0x13')]();transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x22')]=0x0;transfers[_0xe577b2[_0x3e1e('0x48')]][_0x3e1e('0x43')]=0x2;}}}catch(_0x2e950d){utils[_0x3e1e('0x1c')](util[_0x3e1e('0x2')](_0x3e1e('0x3b'),_0xe577b2[_0x3e1e('0x3c')]),_0x2e950d);}};exports[_0x3e1e('0x4a')]=function(_0x50ba57){try{utils['debug'](util['format'](_0x3e1e('0x4b'),_0x50ba57[_0x3e1e('0x3')]),_0x50ba57);if(agents[_0x50ba57[_0x3e1e('0x3')]]&&agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')]==='timeout'){if(_0x50ba57[_0x3e1e('0x4c')]==='21'){agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')]=_0x3e1e('0x4d');agents[_0x50ba57[_0x3e1e('0x3')]]['lastevent']=_0x3e1e('0x4d');}utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x4e'),_0x50ba57[_0x3e1e('0x3')],agents[_0x50ba57[_0x3e1e('0x3')]]['membername'],agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')],agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x9')]));writeDB(agents[_0x50ba57[_0x3e1e('0x3')]]);var _0x372581=unanswered['indexOf'](_0x50ba57[_0x3e1e('0x3')]);if(_0x372581>-0x1){unanswered[_0x3e1e('0x4f')](_0x372581,0x1);}}if(transfers[_0x50ba57[_0x3e1e('0x3')]]){transfers[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0xc')]=!![];transfers[_0x50ba57[_0x3e1e('0x3')]]['agentcompleteAt']=utils[_0x3e1e('0x13')]();transfers[_0x50ba57['uniqueid']][_0x3e1e('0x1b')]=utils[_0x3e1e('0x30')](transfers[_0x50ba57['uniqueid']][_0x3e1e('0x31')],transfers[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x25')]);transfers[_0x50ba57[_0x3e1e('0x3')]]['reason']=_0x3e1e('0x50');transfers[_0x50ba57['uniqueid']][_0x3e1e('0x9')]=_0x3e1e('0x51');utils[_0x3e1e('0x15')](util[_0x3e1e('0x2')](_0x3e1e('0x4e'),_0x50ba57[_0x3e1e('0x3')],transfers[_0x50ba57['uniqueid']][_0x3e1e('0x6')],transfers[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')],transfers[_0x50ba57[_0x3e1e('0x3')]]['lastevent']));writeDB(transfers[_0x50ba57[_0x3e1e('0x3')]],!![]);}if(agents[_0x50ba57[_0x3e1e('0x3')]]&&agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x25')]){agents[_0x50ba57['uniqueid']][_0x3e1e('0xc')]=!![];agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x31')]=utils[_0x3e1e('0x13')]();agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x1b')]=utils['diffTime'](agents[_0x50ba57['uniqueid']]['agentcompleteAt'],agents[_0x50ba57[_0x3e1e('0x3')]]['agentconnectAt']);agents[_0x50ba57[_0x3e1e('0x3')]]['reason']=agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x37')]?_0x3e1e('0x37'):_0x3e1e('0x50');agents[_0x50ba57['uniqueid']][_0x3e1e('0x9')]='complete';utils[_0x3e1e('0x15')](util['format'](_0x3e1e('0x4e'),_0x50ba57[_0x3e1e('0x3')],agents[_0x50ba57['uniqueid']][_0x3e1e('0x6')],agents[_0x50ba57[_0x3e1e('0x3')]][_0x3e1e('0x21')],agents[_0x50ba57['uniqueid']]['lastevent']));writeDB(agents[_0x50ba57[_0x3e1e('0x3')]]);}}catch(_0x20bb6d){utils[_0x3e1e('0x1c')](util['format'](_0x3e1e('0x4b'),_0x50ba57['uniqueid']),_0x20bb6d);}}; \ No newline at end of file +var _0xbb53=['agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','holdtime','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentconnectAt','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','calleridnum','connectedlinenum','lastevent','queue','type','agentcomplete','agentacw','acwTimeout','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','called','connectedlinename','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','timeout','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','agentringnoanswerAt','abandoned'];(function(_0x5134e2,_0x2fc1d6){var _0xaa6c97=function(_0x68a0c2){while(--_0x68a0c2){_0x5134e2['push'](_0x5134e2['shift']());}};_0xaa6c97(++_0x2fc1d6);}(_0xbb53,0x121));var _0x3bb5=function(_0x4c2a71,_0x14fa95){_0x4c2a71=_0x4c2a71-0x0;var _0x30599e=_0xbb53[_0x4c2a71];return _0x30599e;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var utils=require(_0x3bb5('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xa71c15,_0x20c8b6){utils[_0x3bb5('0x3')](util[_0x3bb5('0x4')](_0x3bb5('0x5'),_0xa71c15[_0x3bb5('0x6')],_0xa71c15[_0x3bb5('0x7')],_0xa71c15['queue'],_0xa71c15['membername'],_0xa71c15[_0x3bb5('0x8')],_0xa71c15[_0x3bb5('0x9')],_0xa71c15[_0x3bb5('0xa')],_0xa71c15[_0x3bb5('0xb')]));if(_0xa71c15[_0x3bb5('0xc')]){utils['getVoiceQueueByName'](_0xa71c15['queue'])['then'](function(_0x10ddfb){if(_0x10ddfb){_0xa71c15[_0x3bb5('0xd')]=_0x10ddfb[_0x3bb5('0xd')];_0xa71c15['agentacw']=_0xa71c15[_0x3bb5('0xe')]?_0x10ddfb['acw']:![];_0xa71c15['acwtime']=_0xa71c15[_0x3bb5('0xf')]?_0x10ddfb[_0x3bb5('0x10')]:0x0;}utils['request'](_0x3bb5('0x11'),_0xa71c15);});}else{utils['request'](_0x3bb5('0x11'),_0xa71c15);}if(_0x20c8b6){delete transfers[_0xa71c15['uniqueid']];}else{delete agents[_0xa71c15['destuniqueid']];}}exports[_0x3bb5('0x12')]=function(_0x35a99b){try{utils[_0x3bb5('0x13')](util['format'](_0x3bb5('0x14'),_0x35a99b[_0x3bb5('0x6')]),_0x35a99b);agents[_0x35a99b['destuniqueid']]=_0x35a99b;agents[_0x35a99b[_0x3bb5('0x15')]][_0x3bb5('0x16')]=utils['now']();agents[_0x35a99b['destuniqueid']]['lastevent']=_0x3bb5('0x17');agents[_0x35a99b[_0x3bb5('0x15')]]['connectedlinenum']=null;agents[_0x35a99b[_0x3bb5('0x15')]][_0x3bb5('0x18')]=null;utils[_0x3bb5('0x3')](util[_0x3bb5('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x35a99b[_0x3bb5('0x6')],agents[_0x35a99b[_0x3bb5('0x15')]][_0x3bb5('0x19')],_0x35a99b['destuniqueid']));}catch(_0x5efea4){utils[_0x3bb5('0x1a')](util[_0x3bb5('0x4')](_0x3bb5('0x14'),_0x35a99b['uniqueid']),_0x5efea4);}};exports[_0x3bb5('0x1b')]=function(_0x2afe6e){try{if(!_[_0x3bb5('0x1c')](agents[_0x2afe6e[_0x3bb5('0x15')]])){utils[_0x3bb5('0x13')](util[_0x3bb5('0x4')]('[%s][agents][agentringnoanswer]',_0x2afe6e[_0x3bb5('0x6')]),_0x2afe6e);utils[_0x3bb5('0x3')](util[_0x3bb5('0x4')](_0x3bb5('0x1d'),_0x2afe6e[_0x3bb5('0x6')],agents[_0x2afe6e[_0x3bb5('0x15')]][_0x3bb5('0x19')],_0x2afe6e['destuniqueid']));agents[_0x2afe6e[_0x3bb5('0x15')]][_0x3bb5('0x1b')]=!![];agents[_0x2afe6e['destuniqueid']]['agentringnoanswerAt']=utils[_0x3bb5('0x1e')]();agents[_0x2afe6e[_0x3bb5('0x15')]]['lastevent']='timeout';agents[_0x2afe6e[_0x3bb5('0x15')]][_0x3bb5('0x1f')]=_0x3bb5('0x20');agents[_0x2afe6e[_0x3bb5('0x15')]]['holdtime']=_0x2afe6e['ringtime']?parseInt(_0x2afe6e[_0x3bb5('0x21')])/0x3e8:0x0;agents[_0x2afe6e['destuniqueid']][_0x3bb5('0x22')]=0x0;unanswered[_0x3bb5('0x23')](_0x2afe6e[_0x3bb5('0x15')]);}}catch(_0x534b15){utils['error'](util[_0x3bb5('0x4')](_0x3bb5('0x24'),_0x2afe6e[_0x3bb5('0x6')]),_0x534b15);}};exports[_0x3bb5('0x25')]=function(_0x311680){try{_[_0x3bb5('0x26')](agents,function(_0x3ed2cc,_0x5ce225){if(_0x3ed2cc[_0x3bb5('0x6')]==_0x311680[_0x3bb5('0x6')]&&!_[_0x3bb5('0x27')](unanswered,_0x3ed2cc[_0x3bb5('0x15')])){utils[_0x3bb5('0x13')](util[_0x3bb5('0x4')](_0x3bb5('0x28'),_0x311680['uniqueid']),_0x311680);utils[_0x3bb5('0x3')](util[_0x3bb5('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x311680[_0x3bb5('0x6')],_0x3ed2cc[_0x3bb5('0x19')],_0x3ed2cc[_0x3bb5('0x15')]));_0x3ed2cc[_0x3bb5('0x1b')]=!![];_0x3ed2cc[_0x3bb5('0x29')]=utils['now']();_0x3ed2cc[_0x3bb5('0xb')]=_0x3bb5('0x2a');_0x3ed2cc[_0x3bb5('0x1f')]=_0x3bb5('0x2a');_0x3ed2cc['holdtime']=_0x311680['holdtime'];_0x3ed2cc[_0x3bb5('0x22')]=0x0;writeDB(_0x3ed2cc);}});}catch(_0xeeb452){utils[_0x3bb5('0x1a')](util[_0x3bb5('0x4')](_0x3bb5('0x28'),_0x311680[_0x3bb5('0x6')]),_0xeeb452);}};exports[_0x3bb5('0x2b')]=function(_0x2a0a19){try{if(agents[_0x2a0a19[_0x3bb5('0x15')]]){utils['debug'](util[_0x3bb5('0x4')](_0x3bb5('0x2c'),_0x2a0a19['uniqueid']),_0x2a0a19);utils['info'](util[_0x3bb5('0x4')](_0x3bb5('0x2d'),_0x2a0a19[_0x3bb5('0x6')],agents[_0x2a0a19[_0x3bb5('0x15')]]['membername'],_0x2a0a19['destuniqueid']));agents[_0x2a0a19[_0x3bb5('0x15')]]['agentconnectAt']=utils[_0x3bb5('0x1e')]();agents[_0x2a0a19['destuniqueid']]['connectedlinenum']=_0x2a0a19[_0x3bb5('0xa')];agents[_0x2a0a19['destuniqueid']]['connectedlinename']=_0x2a0a19[_0x3bb5('0x18')];agents[_0x2a0a19[_0x3bb5('0x15')]][_0x3bb5('0x2e')]=_0x2a0a19['ringtime'];agents[_0x2a0a19[_0x3bb5('0x15')]]['lastevent']=_0x3bb5('0x2f');_['forIn'](agents,function(_0x235e3,_0x35bc81){if(_0x235e3[_0x3bb5('0x15')]!=_0x2a0a19[_0x3bb5('0x15')]&&_0x235e3[_0x3bb5('0x6')]==_0x2a0a19[_0x3bb5('0x6')]){_0x235e3['talktime']=0x0;_0x235e3[_0x3bb5('0x2e')]=_0x2a0a19[_0x3bb5('0x21')];_0x235e3['agentringnoanswer']=!![];_0x235e3[_0x3bb5('0x29')]=utils[_0x3bb5('0x1e')]();_0x235e3[_0x3bb5('0xb')]='answered_elsewhere';_0x235e3[_0x3bb5('0x1f')]=_0x3bb5('0x30');_0x235e3['answeredelsewheredestinationuniqueid']=_0x2a0a19[_0x3bb5('0x15')];_0x235e3[_0x3bb5('0x31')]=_0x2a0a19[_0x3bb5('0x19')];writeDB(_0x235e3);}});}}catch(_0x2291e9){utils[_0x3bb5('0x1a')](util[_0x3bb5('0x4')](_0x3bb5('0x2c'),_0x2a0a19[_0x3bb5('0x6')]),_0x2291e9);}};exports[_0x3bb5('0xe')]=function(_0x42676d){try{if(!_[_0x3bb5('0x1c')](agents[_0x42676d[_0x3bb5('0x15')]])){utils[_0x3bb5('0x13')](util[_0x3bb5('0x4')]('[%s][agents][agentcomplete]',_0x42676d[_0x3bb5('0x6')]),_0x42676d);utils[_0x3bb5('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x42676d[_0x3bb5('0x6')],agents[_0x42676d[_0x3bb5('0x15')]][_0x3bb5('0x19')],_0x42676d[_0x3bb5('0x15')]));agents[_0x42676d[_0x3bb5('0x15')]][_0x3bb5('0xe')]=!![];agents[_0x42676d[_0x3bb5('0x15')]][_0x3bb5('0x32')]=utils['now']();agents[_0x42676d['destuniqueid']][_0x3bb5('0x22')]=utils[_0x3bb5('0x33')](agents[_0x42676d[_0x3bb5('0x15')]]['agentcompleteAt'],agents[_0x42676d[_0x3bb5('0x15')]]['agentconnectAt']);agents[_0x42676d[_0x3bb5('0x15')]][_0x3bb5('0x1f')]=_0x42676d[_0x3bb5('0x1f')];agents[_0x42676d[_0x3bb5('0x15')]][_0x3bb5('0xb')]=_0x3bb5('0x34');writeDB(agents[_0x42676d['destuniqueid']]);}}catch(_0x2efd7c){utils[_0x3bb5('0x1a')](util['format'](_0x3bb5('0x35'),_0x42676d[_0x3bb5('0x6')]),_0x2efd7c);}};exports['blindtransfer']=function(_0x41edf7){try{if(!_[_0x3bb5('0x1c')](agents[_0x41edf7[_0x3bb5('0x36')]])){utils[_0x3bb5('0x13')](util[_0x3bb5('0x4')]('[%s][agents][blindtransfer]',_0x41edf7[_0x3bb5('0x6')]),_0x41edf7);utils[_0x3bb5('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x41edf7[_0x3bb5('0x6')],agents[_0x41edf7[_0x3bb5('0x36')]][_0x3bb5('0x19')],agents[_0x41edf7[_0x3bb5('0x36')]][_0x3bb5('0x6')]));agents[_0x41edf7['transfereruniqueid']][_0x3bb5('0x37')]=!![];agents[_0x41edf7[_0x3bb5('0x36')]][_0x3bb5('0x38')]=_0x3bb5('0x39');agents[_0x41edf7[_0x3bb5('0x36')]][_0x3bb5('0x3a')]=_0x41edf7[_0x3bb5('0x3b')];agents[_0x41edf7['transfereruniqueid']][_0x3bb5('0x3c')]=agents[_0x41edf7[_0x3bb5('0x36')]][_0x3bb5('0x6')];}}catch(_0x239a34){utils[_0x3bb5('0x1a')](util['format'](_0x3bb5('0x3d'),_0x41edf7[_0x3bb5('0x6')]),_0x239a34);}};exports[_0x3bb5('0x3e')]=function(_0x1ff862){try{utils[_0x3bb5('0x13')](util[_0x3bb5('0x4')](_0x3bb5('0x3f'),_0x1ff862[_0x3bb5('0x40')]),_0x1ff862);if(_0x1ff862['origtransfereruniqueid']==_0x1ff862[_0x3bb5('0x41')]){if(!_[_0x3bb5('0x1c')](agents[_0x1ff862[_0x3bb5('0x42')]])){utils[_0x3bb5('0x3')](util['format'](_0x3bb5('0x43'),_0x1ff862['origtransfereruniqueid'],agents[_0x1ff862[_0x3bb5('0x42')]][_0x3bb5('0x19')]));agents[_0x1ff862[_0x3bb5('0x42')]][_0x3bb5('0x37')]=!![];agents[_0x1ff862[_0x3bb5('0x42')]]['transfertype']=_0x3bb5('0x44');agents[_0x1ff862[_0x3bb5('0x42')]][_0x3bb5('0x3a')]=_0x1ff862[_0x3bb5('0x45')];agents[_0x1ff862['secondtransfereruniqueid']][_0x3bb5('0x3c')]=_0x1ff862[_0x3bb5('0x40')];}if(_0x1ff862[_0x3bb5('0x46')]&&agents[_0x1ff862[_0x3bb5('0x46')]]){agents[_0x1ff862[_0x3bb5('0x46')]][_0x3bb5('0x47')]=0x1;transfers[_0x1ff862[_0x3bb5('0x46')]]=_[_0x3bb5('0x48')](agents[_0x1ff862['transfereeuniqueid']]);transfers[_0x1ff862[_0x3bb5('0x46')]][_0x3bb5('0x9')]=agents[_0x1ff862[_0x3bb5('0x42')]]['calleridnum'];transfers[_0x1ff862['transfereeuniqueid']][_0x3bb5('0x49')]=agents[_0x1ff862[_0x3bb5('0x42')]][_0x3bb5('0x49')];transfers[_0x1ff862['transfereeuniqueid']][_0x3bb5('0x16')]=utils[_0x3bb5('0x1e')]();transfers[_0x1ff862[_0x3bb5('0x46')]][_0x3bb5('0x4a')]=utils[_0x3bb5('0x1e')]();transfers[_0x1ff862[_0x3bb5('0x46')]][_0x3bb5('0x2e')]=0x0;transfers[_0x1ff862['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x1ff862[_0x3bb5('0x42')]==_0x1ff862[_0x3bb5('0x4b')]){if(!_[_0x3bb5('0x1c')](agents[_0x1ff862[_0x3bb5('0x40')]])){utils[_0x3bb5('0x3')](util[_0x3bb5('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1ff862[_0x3bb5('0x40')],agents[_0x1ff862[_0x3bb5('0x40')]][_0x3bb5('0x19')]));agents[_0x1ff862[_0x3bb5('0x40')]]['transfer']=!![];agents[_0x1ff862[_0x3bb5('0x40')]][_0x3bb5('0x38')]=_0x3bb5('0x44');agents[_0x1ff862[_0x3bb5('0x40')]][_0x3bb5('0x3a')]=_0x1ff862[_0x3bb5('0x4c')];agents[_0x1ff862[_0x3bb5('0x40')]][_0x3bb5('0x3c')]=_0x1ff862['secondtransfereruniqueid'];}if(_0x1ff862[_0x3bb5('0x4d')]&&agents[_0x1ff862[_0x3bb5('0x4d')]]){agents[_0x1ff862[_0x3bb5('0x4d')]][_0x3bb5('0x47')]=0x1;transfers[_0x1ff862[_0x3bb5('0x4d')]]=_['clone'](agents[_0x1ff862[_0x3bb5('0x4d')]]);transfers[_0x1ff862['transfertargetuniqueid']][_0x3bb5('0x9')]=agents[_0x1ff862['origtransfereruniqueid']][_0x3bb5('0x9')];transfers[_0x1ff862[_0x3bb5('0x4d')]][_0x3bb5('0x49')]=agents[_0x1ff862['origtransfereruniqueid']][_0x3bb5('0x49')];transfers[_0x1ff862[_0x3bb5('0x4d')]][_0x3bb5('0x16')]=utils['now']();transfers[_0x1ff862[_0x3bb5('0x4d')]][_0x3bb5('0x4a')]=utils[_0x3bb5('0x1e')]();transfers[_0x1ff862['transfertargetuniqueid']][_0x3bb5('0x2e')]=0x0;transfers[_0x1ff862[_0x3bb5('0x4d')]][_0x3bb5('0x47')]=0x2;}}}catch(_0xc34441){utils[_0x3bb5('0x1a')](util[_0x3bb5('0x4')](_0x3bb5('0x3f'),_0x1ff862['origtransfereruniqueid']),_0xc34441);}};exports['hangup']=function(_0x2b3ed8){try{utils[_0x3bb5('0x13')](util['format'](_0x3bb5('0x4e'),_0x2b3ed8['uniqueid']),_0x2b3ed8);if(agents[_0x2b3ed8[_0x3bb5('0x6')]]&&agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x1f')]===_0x3bb5('0x20')){if(_0x2b3ed8['cause']==='21'){agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x1f')]=_0x3bb5('0x4f');agents[_0x2b3ed8['uniqueid']][_0x3bb5('0xb')]=_0x3bb5('0x4f');}utils['info'](util[_0x3bb5('0x4')](_0x3bb5('0x50'),_0x2b3ed8[_0x3bb5('0x6')],agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x19')],agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x1f')],agents[_0x2b3ed8['uniqueid']]['lastevent']));writeDB(agents[_0x2b3ed8['uniqueid']]);var _0x5bfdf2=unanswered['indexOf'](_0x2b3ed8[_0x3bb5('0x6')]);if(_0x5bfdf2>-0x1){unanswered[_0x3bb5('0x51')](_0x5bfdf2,0x1);}}if(transfers[_0x2b3ed8[_0x3bb5('0x6')]]){transfers[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0xe')]=!![];transfers[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x32')]=utils[_0x3bb5('0x1e')]();transfers[_0x2b3ed8['uniqueid']][_0x3bb5('0x22')]=utils[_0x3bb5('0x33')](transfers[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x32')],transfers[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x4a')]);transfers[_0x2b3ed8[_0x3bb5('0x6')]]['reason']=_0x3bb5('0x52');transfers[_0x2b3ed8['uniqueid']][_0x3bb5('0xb')]=_0x3bb5('0x34');utils[_0x3bb5('0x3')](util['format'](_0x3bb5('0x50'),_0x2b3ed8[_0x3bb5('0x6')],transfers[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x19')],transfers[_0x2b3ed8['uniqueid']][_0x3bb5('0x1f')],transfers[_0x2b3ed8['uniqueid']]['lastevent']));writeDB(transfers[_0x2b3ed8[_0x3bb5('0x6')]],!![]);}if(agents[_0x2b3ed8[_0x3bb5('0x6')]]&&agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x4a')]){agents[_0x2b3ed8['uniqueid']][_0x3bb5('0xe')]=!![];agents[_0x2b3ed8['uniqueid']][_0x3bb5('0x32')]=utils[_0x3bb5('0x1e')]();agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x22')]=utils[_0x3bb5('0x33')](agents[_0x2b3ed8['uniqueid']][_0x3bb5('0x32')],agents[_0x2b3ed8['uniqueid']][_0x3bb5('0x4a')]);agents[_0x2b3ed8['uniqueid']][_0x3bb5('0x1f')]=agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x37')]?_0x3bb5('0x37'):_0x3bb5('0x52');agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0xb')]='complete';utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2b3ed8[_0x3bb5('0x6')],agents[_0x2b3ed8[_0x3bb5('0x6')]][_0x3bb5('0x19')],agents[_0x2b3ed8[_0x3bb5('0x6')]]['reason'],agents[_0x2b3ed8[_0x3bb5('0x6')]]['lastevent']));writeDB(agents[_0x2b3ed8[_0x3bb5('0x6')]]);}}catch(_0xb3572){utils[_0x3bb5('0x1a')](util[_0x3bb5('0x4')](_0x3bb5('0x4e'),_0x2b3ed8[_0x3bb5('0x6')]),_0xb3572);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index cec9c54..03471f8 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 _0x4d87=['[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lastapplication','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','CreateVoiceCallReport','recording','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','debug','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid'];(function(_0x5ae3d8,_0x5ed67f){var _0x34723d=function(_0x26a985){while(--_0x26a985){_0x5ae3d8['push'](_0x5ae3d8['shift']());}};_0x34723d(++_0x5ed67f);}(_0x4d87,0xf0));var _0x74d8=function(_0x57414d,_0x140b6a){_0x57414d=_0x57414d-0x0;var _0x24a2fc=_0x4d87[_0x57414d];return _0x24a2fc;};'use strict';var _=require('lodash');var util=require(_0x74d8('0x0'));var utils=require(_0x74d8('0x1'));var transfers=require(_0x74d8('0x2'));var dispositions=['NO\x20ANSWER',_0x74d8('0x3'),_0x74d8('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0x74d8('0x4'),_0x74d8('0x5'),_0x74d8('0x6'),_0x74d8('0x3'),'FAILED','FAILED'];var channels={};function writeDB(_0x54c5f6){var _0x4149ee;if(transfers[_0x74d8('0x7')][_0x54c5f6[_0x74d8('0x8')]]){_0x4149ee=_0x54c5f6[_0x74d8('0x8')];_0x54c5f6[_0x74d8('0x8')]=transfers[_0x74d8('0x7')][_0x54c5f6['uniqueid']][_0x74d8('0x9')];}utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0xc'),_0x54c5f6[_0x74d8('0x8')],_0x54c5f6[_0x74d8('0xd')],_0x54c5f6[_0x74d8('0xe')],_0x54c5f6[_0x74d8('0xf')],_0x54c5f6[_0x74d8('0x10')],_0x54c5f6['calleridnum'],_0x54c5f6[_0x74d8('0x11')],_0x54c5f6[_0x74d8('0x12')]));if(_0x54c5f6['accountcode']){utils[_0x74d8('0x13')](_0x54c5f6[_0x74d8('0x14')])[_0x74d8('0x15')](function(_0x2d3c09){if(_0x2d3c09){_0x54c5f6[_0x74d8('0x16')]=_0x2d3c09['id'];}utils['request']('CreateVoiceCallReport',_0x54c5f6);});}else{utils['request'](_0x74d8('0x17'),_0x54c5f6);}if(channels[_0x54c5f6[_0x74d8('0x8')]]){delete channels[_0x54c5f6[_0x74d8('0x8')]];}else if(_0x4149ee&&channels[_0x4149ee]){if(!transfers[_0x74d8('0x7')][_0x4149ee][_0x74d8('0x18')])delete transfers[_0x74d8('0x7')][_0x4149ee];delete channels[_0x4149ee];}}exports['newchannel']=function(_0x2da434){try{utils['debug'](util[_0x74d8('0xb')](_0x74d8('0x19'),_0x2da434[_0x74d8('0x8')]),_0x2da434);if(_0x2da434[_0x74d8('0x8')]==_0x2da434[_0x74d8('0x1a')]&&_0x2da434[_0x74d8('0xd')]!=_0x74d8('0x1b')){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x1c'),_0x2da434['uniqueid'],_0x2da434[_0x74d8('0x1d')],_0x2da434[_0x74d8('0x1e')]));channels[_0x2da434[_0x74d8('0x8')]]={'uniqueid':_0x2da434[_0x74d8('0x8')],'accountcode':_0x2da434[_0x74d8('0x14')],'source':_0x2da434[_0x74d8('0x1f')],'destination':_0x2da434[_0x74d8('0x1e')],'destinationcontext':_0x2da434[_0x74d8('0x1d')],'channel':_0x2da434[_0x74d8('0xd')],'starttime':utils[_0x74d8('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x74d8('0x4'),'amaflags':_0x74d8('0x21')};}}catch(_0x24d5d3){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x19'),_0x2da434[_0x74d8('0x8')]),_0x24d5d3);}};exports[_0x74d8('0x23')]=function(_0x43ee53){try{utils['debug'](util[_0x74d8('0xb')](_0x74d8('0x24'),_0x43ee53[_0x74d8('0x8')]),_0x43ee53);if(!_[_0x74d8('0x25')](channels[_0x43ee53[_0x74d8('0x8')]])&&_0x43ee53[_0x74d8('0x26')]==0x6){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x27'),_0x43ee53[_0x74d8('0x8')],_0x43ee53[_0x74d8('0x1d')],_0x43ee53['channel']));if(_[_0x74d8('0x25')](channels[_0x43ee53[_0x74d8('0x8')]]['systemanswertime'])){channels[_0x43ee53[_0x74d8('0x8')]][_0x74d8('0x28')]=utils[_0x74d8('0x20')]();}}else if(!_[_0x74d8('0x25')](channels[_0x43ee53['linkedid']])&&_0x43ee53[_0x74d8('0x26')]==0x6&&_0x43ee53[_0x74d8('0x1d')]!=_0x74d8('0x29')){utils[_0x74d8('0xa')](util['format'](_0x74d8('0x2a'),_0x43ee53[_0x74d8('0x8')],_0x43ee53[_0x74d8('0x1a')],_0x43ee53[_0x74d8('0x1d')],_0x43ee53['channel']));channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x14')]=_0x43ee53[_0x74d8('0x14')];channels[_0x43ee53['linkedid']][_0x74d8('0x2b')]=_0x43ee53[_0x74d8('0xd')];if(_[_0x74d8('0x25')](channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x2c')])){channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x2c')]=utils[_0x74d8('0x20')]();}channels[_0x43ee53[_0x74d8('0x1a')]][_0x74d8('0x2d')]=dispositions[_[_0x74d8('0x2e')](_0x43ee53[_0x74d8('0x26')])]||_0x74d8('0x5');}}catch(_0x5615ab){utils[_0x74d8('0x22')](util[_0x74d8('0xb')]('[%s][calls][newstate]',_0x43ee53[_0x74d8('0x8')]),_0x5615ab);}};exports[_0x74d8('0x2f')]=function(_0x448eae){try{if(!_[_0x74d8('0x25')](channels[_0x448eae[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')](_0x74d8('0x31'),_0x448eae['uniqueid']),_0x448eae);if(_[_0x74d8('0x25')](channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x32')])){channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x32')]=_0x448eae[_0x74d8('0x33')]+'\x20<'+_0x448eae[_0x74d8('0x1f')]+'>';}utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x34'),_0x448eae['uniqueid'],channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x32')],_0x448eae[_0x74d8('0x35')]));channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x36')]=utils[_0x74d8('0x20')]();channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x37')]=utils[_0x74d8('0x38')](channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x36')],channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x39')]);channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x3a')]=channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x2c')]?utils[_0x74d8('0x38')](channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x36')],channels[_0x448eae[_0x74d8('0x8')]][_0x74d8('0x2c')]):0x0;writeDB(channels[_0x448eae['uniqueid']]);}}catch(_0x2f7ff4){utils[_0x74d8('0x22')](util[_0x74d8('0xb')]('[%s][calls][hangup]',_0x448eae[_0x74d8('0x8')]),_0x2f7ff4);}};exports['attendedtransfer']=function(_0x52fa7d){try{if(!_[_0x74d8('0x25')](channels[_0x52fa7d[_0x74d8('0x3b')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')](_0x74d8('0x3c'),_0x52fa7d[_0x74d8('0x3d')]),_0x52fa7d);if(channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0xd')]==_0x52fa7d['transfereechannel']){utils[_0x74d8('0xa')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x52fa7d[_0x74d8('0x3d')],_0x52fa7d[_0x74d8('0x3b')],_0x52fa7d[_0x74d8('0x3e')]));channels[_0x52fa7d[_0x74d8('0x3b')]]['destinationchannel']=_0x52fa7d['secondtransfererchannel'];channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0x3f')]='_attended';}else if(channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0xd')]=_0x52fa7d[_0x74d8('0x40')]){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x41'),_0x52fa7d[_0x74d8('0x3d')],_0x52fa7d['localtwolinkedid'],_0x52fa7d[_0x74d8('0x42')]));channels[_0x52fa7d['localtwolinkedid']][_0x74d8('0x2b')]=_0x52fa7d['origtransfererchannel'];channels[_0x52fa7d[_0x74d8('0x3b')]][_0x74d8('0x3f')]='_attended';}}}catch(_0xf42f24){utils['error'](util[_0x74d8('0xb')](_0x74d8('0x3c'),_0x52fa7d[_0x74d8('0x3d')]),_0xf42f24);}};exports['musiconholdstart']=function(_0x4821b4){try{if(!_[_0x74d8('0x25')](channels[_0x4821b4[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util['format']('[%s][calls][musiconholdstart]',_0x4821b4[_0x74d8('0x8')]),_0x4821b4);channels[_0x4821b4[_0x74d8('0x8')]][_0x74d8('0x43')]=utils['now']();utils[_0x74d8('0xa')](util[_0x74d8('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4821b4[_0x74d8('0x8')],channels[_0x4821b4[_0x74d8('0x8')]][_0x74d8('0x43')]));}}catch(_0xab72b2){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x44'),_0x4821b4[_0x74d8('0x8')]),_0xab72b2);}};exports['musiconholdstop']=function(_0x686293){try{if(!_['isNil'](channels[_0x686293[_0x74d8('0x8')]])){utils['debug'](util[_0x74d8('0xb')](_0x74d8('0x45'),_0x686293['uniqueid']),_0x686293);if(!_[_0x74d8('0x25')](channels[_0x686293[_0x74d8('0x8')]]['musiconholdstartAt'])){channels[_0x686293[_0x74d8('0x8')]][_0x74d8('0x46')]+=utils[_0x74d8('0x38')](utils[_0x74d8('0x20')](),channels[_0x686293['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0x74d8('0xb')](_0x74d8('0x47'),_0x686293[_0x74d8('0x8')],channels[_0x686293['uniqueid']][_0x74d8('0x46')]));delete channels[_0x686293[_0x74d8('0x8')]][_0x74d8('0x43')];}}}catch(_0x4a3d30){utils[_0x74d8('0x22')](util['format'](_0x74d8('0x45'),_0x686293[_0x74d8('0x8')]),_0x4a3d30);}};exports[_0x74d8('0x48')]=function(_0x3af18c){try{if(!_[_0x74d8('0x25')](channels[_0x3af18c[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')]('[%s][calls][varset]',_0x3af18c[_0x74d8('0x8')]),_0x3af18c);if(!_['isNil'](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x4a')])){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x4b'),_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x4d')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable'][_0x74d8('0x4e')])){utils[_0x74d8('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c['uniqueid']][_0x74d8('0x4f')]=_0x3af18c[_0x74d8('0x4c')];channels[_0x3af18c[_0x74d8('0x8')]]['callerid']='\x22'+_0x3af18c[_0x74d8('0x4c')]+_0x74d8('0x50')+_0x3af18c[_0x74d8('0x4c')]+'>';}if(!_['isNil'](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x51')])||!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')]['xmd-callerid'])){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x52'),_0x3af18c[_0x74d8('0x8')],!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x51')])?_0x74d8('0x51'):_0x74d8('0x53'),_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x32')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x54')])||!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')][_0x74d8('0x55')])){utils[_0x74d8('0xa')](util[_0x74d8('0xb')](_0x74d8('0x52'),_0x3af18c['uniqueid'],!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')]['xmd-queue'])?_0x74d8('0x54'):'xmcs-queue',_0x3af18c['value']));channels[_0x3af18c['uniqueid']]['lastapplication']=_0x74d8('0x56');channels[_0x3af18c['uniqueid']][_0x74d8('0x57')]=_0x3af18c[_0x74d8('0x4c')];channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0xe')]=!![];}if(!_[_0x74d8('0x25')](_0x3af18c[_0x74d8('0x49')]['xmd-contactid'])){utils[_0x74d8('0xa')](util['format'](_0x74d8('0x58'),_0x3af18c['uniqueid'],_0x3af18c['value']));channels[_0x3af18c['uniqueid']][_0x74d8('0x59')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable']['xmd-cdrtype'])){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x5a'),_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x5b')]=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable'][_0x74d8('0x5c')])){utils['info'](util[_0x74d8('0xb')](_0x74d8('0x5d'),_0x3af18c[_0x74d8('0x8')],_0x3af18c[_0x74d8('0x4c')]));channels[_0x3af18c[_0x74d8('0x8')]]['routeid']=_0x3af18c[_0x74d8('0x4c')];}if(!_[_0x74d8('0x25')](_0x3af18c['variable']['sipcallid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3af18c['uniqueid'],_0x3af18c['value']));channels[_0x3af18c[_0x74d8('0x8')]][_0x74d8('0x5e')]=_0x3af18c[_0x74d8('0x4c')];}}}catch(_0x2e9e2b){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x5f'),_0x3af18c[_0x74d8('0x8')]),_0x2e9e2b);}};exports['newexten']=function(_0x29b6ce){try{if(!_['isNil'](channels[_0x29b6ce[_0x74d8('0x8')]])){utils[_0x74d8('0x30')](util[_0x74d8('0xb')](_0x74d8('0x60'),_0x29b6ce[_0x74d8('0x8')]),_0x29b6ce);utils[_0x74d8('0xa')](util['format'](_0x74d8('0x61'),_0x29b6ce[_0x74d8('0x8')],_0x29b6ce[_0x74d8('0x62')],_0x29b6ce[_0x74d8('0x63')]));if(_0x29b6ce['application'][_0x74d8('0x64')]()==_0x74d8('0x65')&&_[_0x74d8('0x66')](_0x29b6ce[_0x74d8('0x63')][_0x74d8('0x64')](),_0x74d8('0x67'))){var _0x1d597b=_0x29b6ce[_0x74d8('0x63')][_0x74d8('0x68')]('=');var _0x474bd5=_0x1d597b[0x0][_0x74d8('0x69')](_0x1d597b[0x0][_0x74d8('0x6a')]('(')+0x1,_0x1d597b[0x0][_0x74d8('0x6a')](')'));var _0x2cb93f=_0x1d597b[0x1];channels[_0x29b6ce[_0x74d8('0x8')]][_0x474bd5]=_0x2cb93f;}if(!_[_0x74d8('0x6b')]([_0x74d8('0x2f'),_0x74d8('0x6c'),'execif',_0x74d8('0x65'),_0x74d8('0x6d')],_0x29b6ce[_0x74d8('0x62')][_0x74d8('0x64')]())){channels[_0x29b6ce[_0x74d8('0x8')]][_0x74d8('0x6e')]=_0x29b6ce[_0x74d8('0x62')];channels[_0x29b6ce[_0x74d8('0x8')]][_0x74d8('0x57')]=_0x29b6ce['appdata'];}}}catch(_0x37746e){utils[_0x74d8('0x22')](util[_0x74d8('0xb')](_0x74d8('0x60'),_0x29b6ce[_0x74d8('0x8')]),_0x37746e);}}; \ No newline at end of file +var _0x22da=['newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','membername','interface','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','now','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s'];(function(_0x4aa78a,_0x15c09c){var _0x444b3b=function(_0x7c30bb){while(--_0x7c30bb){_0x4aa78a['push'](_0x4aa78a['shift']());}};_0x444b3b(++_0x15c09c);}(_0x22da,0x80));var _0xa22d=function(_0x2b4ec7,_0x5a31d7){_0x2b4ec7=_0x2b4ec7-0x0;var _0x5aa5ca=_0x22da[_0x2b4ec7];return _0x5aa5ca;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xa22d('0x0'));var transfers=require(_0xa22d('0x1'));var dispositions=[_0xa22d('0x2'),_0xa22d('0x3'),'FAILED',_0xa22d('0x2'),_0xa22d('0x2'),_0xa22d('0x2'),_0xa22d('0x4'),'BUSY',_0xa22d('0x3'),_0xa22d('0x3'),'FAILED'];var channels={};function writeDB(_0x215529){var _0x44a5c7;if(transfers[_0xa22d('0x5')][_0x215529[_0xa22d('0x6')]]){_0x44a5c7=_0x215529['uniqueid'];_0x215529['uniqueid']=transfers[_0xa22d('0x5')][_0x215529[_0xa22d('0x6')]]['transfereeuniqueid'];}utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x9'),_0x215529[_0xa22d('0x6')],_0x215529['channel'],_0x215529['queue'],_0x215529[_0xa22d('0xa')],_0x215529[_0xa22d('0xb')],_0x215529['calleridnum'],_0x215529[_0xa22d('0xc')],_0x215529['lastevent']));if(_0x215529[_0xa22d('0xd')]){utils[_0xa22d('0xe')](_0x215529[_0xa22d('0xd')])['then'](function(_0x174a3f){if(_0x174a3f){_0x215529[_0xa22d('0xf')]=_0x174a3f['id'];}utils[_0xa22d('0x10')](_0xa22d('0x11'),_0x215529);});}else{utils[_0xa22d('0x10')]('CreateVoiceCallReport',_0x215529);}if(channels[_0x215529[_0xa22d('0x6')]]){delete channels[_0x215529[_0xa22d('0x6')]];}else if(_0x44a5c7&&channels[_0x44a5c7]){if(!transfers[_0xa22d('0x5')][_0x44a5c7][_0xa22d('0x12')])delete transfers[_0xa22d('0x5')][_0x44a5c7];delete channels[_0x44a5c7];}}exports[_0xa22d('0x13')]=function(_0x1814f3){try{utils[_0xa22d('0x14')](util[_0xa22d('0x8')](_0xa22d('0x15'),_0x1814f3[_0xa22d('0x6')]),_0x1814f3);if(_0x1814f3[_0xa22d('0x6')]==_0x1814f3[_0xa22d('0x16')]&&_0x1814f3[_0xa22d('0x17')]!=_0xa22d('0x18')){utils[_0xa22d('0x7')](util['format'](_0xa22d('0x19'),_0x1814f3[_0xa22d('0x6')],_0x1814f3[_0xa22d('0x1a')],_0x1814f3['exten']));channels[_0x1814f3['uniqueid']]={'uniqueid':_0x1814f3['uniqueid'],'accountcode':_0x1814f3[_0xa22d('0xd')],'source':_0x1814f3[_0xa22d('0x1b')],'destination':_0x1814f3[_0xa22d('0x1c')],'destinationcontext':_0x1814f3['context'],'channel':_0x1814f3[_0xa22d('0x17')],'starttime':utils[_0xa22d('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa22d('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0xdb2773){utils[_0xa22d('0x1e')](util['format'](_0xa22d('0x15'),_0x1814f3[_0xa22d('0x6')]),_0xdb2773);}};exports[_0xa22d('0x1f')]=function(_0x2de6fe){try{utils[_0xa22d('0x14')](util[_0xa22d('0x8')](_0xa22d('0x20'),_0x2de6fe['uniqueid']),_0x2de6fe);if(!_['isNil'](channels[_0x2de6fe[_0xa22d('0x6')]])&&_0x2de6fe[_0xa22d('0x21')]==0x6){utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x22'),_0x2de6fe[_0xa22d('0x6')],_0x2de6fe[_0xa22d('0x1a')],_0x2de6fe[_0xa22d('0x17')]));if(_[_0xa22d('0x23')](channels[_0x2de6fe[_0xa22d('0x6')]][_0xa22d('0x24')])){channels[_0x2de6fe['uniqueid']][_0xa22d('0x24')]=utils['now']();}}else if(!_['isNil'](channels[_0x2de6fe[_0xa22d('0x16')]])&&_0x2de6fe[_0xa22d('0x21')]==0x6&&_0x2de6fe[_0xa22d('0x1a')]!=_0xa22d('0x25')){utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x26'),_0x2de6fe[_0xa22d('0x6')],_0x2de6fe['linkedid'],_0x2de6fe[_0xa22d('0x1a')],_0x2de6fe[_0xa22d('0x17')]));channels[_0x2de6fe[_0xa22d('0x16')]][_0xa22d('0xd')]=_0x2de6fe[_0xa22d('0xd')];channels[_0x2de6fe[_0xa22d('0x16')]][_0xa22d('0x27')]=_0x2de6fe[_0xa22d('0x17')];if(_[_0xa22d('0x23')](channels[_0x2de6fe[_0xa22d('0x16')]]['answertime'])){channels[_0x2de6fe[_0xa22d('0x16')]][_0xa22d('0x28')]=utils[_0xa22d('0x1d')]();}channels[_0x2de6fe[_0xa22d('0x16')]][_0xa22d('0x29')]=dispositions[_[_0xa22d('0x2a')](_0x2de6fe['channelstate'])]||_0xa22d('0x4');}}catch(_0x32a6da){utils['error'](util[_0xa22d('0x8')]('[%s][calls][newstate]',_0x2de6fe[_0xa22d('0x6')]),_0x32a6da);}};exports[_0xa22d('0x2b')]=function(_0x5e4224){try{if(!_[_0xa22d('0x23')](channels[_0x5e4224['uniqueid']])){utils[_0xa22d('0x14')](util[_0xa22d('0x8')](_0xa22d('0x2c'),_0x5e4224[_0xa22d('0x6')]),_0x5e4224);if(_[_0xa22d('0x23')](channels[_0x5e4224[_0xa22d('0x6')]][_0xa22d('0x2d')])){channels[_0x5e4224[_0xa22d('0x6')]]['callerid']=_0x5e4224[_0xa22d('0x2e')]+'\x20<'+_0x5e4224[_0xa22d('0x1b')]+'>';}utils['info'](util[_0xa22d('0x8')](_0xa22d('0x2f'),_0x5e4224['uniqueid'],channels[_0x5e4224['uniqueid']][_0xa22d('0x2d')],_0x5e4224[_0xa22d('0x30')]));channels[_0x5e4224[_0xa22d('0x6')]][_0xa22d('0x31')]=utils[_0xa22d('0x1d')]();channels[_0x5e4224[_0xa22d('0x6')]][_0xa22d('0x32')]=utils[_0xa22d('0x33')](channels[_0x5e4224[_0xa22d('0x6')]][_0xa22d('0x31')],channels[_0x5e4224['uniqueid']][_0xa22d('0x34')]);channels[_0x5e4224[_0xa22d('0x6')]][_0xa22d('0x35')]=channels[_0x5e4224[_0xa22d('0x6')]]['answertime']?utils[_0xa22d('0x33')](channels[_0x5e4224['uniqueid']][_0xa22d('0x31')],channels[_0x5e4224[_0xa22d('0x6')]][_0xa22d('0x28')]):0x0;writeDB(channels[_0x5e4224[_0xa22d('0x6')]]);}}catch(_0x1292dc){utils[_0xa22d('0x1e')](util['format'](_0xa22d('0x2c'),_0x5e4224[_0xa22d('0x6')]),_0x1292dc);}};exports['attendedtransfer']=function(_0x2218fd){try{if(!_[_0xa22d('0x23')](channels[_0x2218fd['localtwolinkedid']])){utils[_0xa22d('0x14')](util['format'](_0xa22d('0x36'),_0x2218fd[_0xa22d('0x37')]),_0x2218fd);if(channels[_0x2218fd[_0xa22d('0x38')]]['channel']==_0x2218fd[_0xa22d('0x39')]){utils[_0xa22d('0x7')](util['format'](_0xa22d('0x3a'),_0x2218fd[_0xa22d('0x37')],_0x2218fd[_0xa22d('0x38')],_0x2218fd[_0xa22d('0x3b')]));channels[_0x2218fd[_0xa22d('0x38')]][_0xa22d('0x27')]=_0x2218fd[_0xa22d('0x3b')];channels[_0x2218fd[_0xa22d('0x38')]]['userfield']='_attended';}else if(channels[_0x2218fd[_0xa22d('0x38')]]['channel']=_0x2218fd[_0xa22d('0x3c')]){utils['info'](util[_0xa22d('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2218fd[_0xa22d('0x37')],_0x2218fd[_0xa22d('0x38')],_0x2218fd[_0xa22d('0x3d')]));channels[_0x2218fd[_0xa22d('0x38')]][_0xa22d('0x27')]=_0x2218fd[_0xa22d('0x3d')];channels[_0x2218fd[_0xa22d('0x38')]][_0xa22d('0x3e')]=_0xa22d('0x3f');}}}catch(_0xd88e62){utils['error'](util['format'](_0xa22d('0x36'),_0x2218fd['origtransfereruniqueid']),_0xd88e62);}};exports[_0xa22d('0x40')]=function(_0x4ae64d){try{if(!_[_0xa22d('0x23')](channels[_0x4ae64d[_0xa22d('0x6')]])){utils['debug'](util['format'](_0xa22d('0x41'),_0x4ae64d['uniqueid']),_0x4ae64d);channels[_0x4ae64d[_0xa22d('0x6')]]['musiconholdstartAt']=utils[_0xa22d('0x1d')]();utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x42'),_0x4ae64d[_0xa22d('0x6')],channels[_0x4ae64d[_0xa22d('0x6')]][_0xa22d('0x43')]));}}catch(_0x2485eb){utils[_0xa22d('0x1e')](util['format'](_0xa22d('0x41'),_0x4ae64d[_0xa22d('0x6')]),_0x2485eb);}};exports[_0xa22d('0x44')]=function(_0x356f70){try{if(!_[_0xa22d('0x23')](channels[_0x356f70[_0xa22d('0x6')]])){utils[_0xa22d('0x14')](util[_0xa22d('0x8')](_0xa22d('0x45'),_0x356f70[_0xa22d('0x6')]),_0x356f70);if(!_['isNil'](channels[_0x356f70[_0xa22d('0x6')]][_0xa22d('0x43')])){channels[_0x356f70[_0xa22d('0x6')]][_0xa22d('0x46')]+=utils[_0xa22d('0x33')](utils[_0xa22d('0x1d')](),channels[_0x356f70[_0xa22d('0x6')]][_0xa22d('0x43')]);utils[_0xa22d('0x7')](util[_0xa22d('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x356f70[_0xa22d('0x6')],channels[_0x356f70[_0xa22d('0x6')]][_0xa22d('0x46')]));delete channels[_0x356f70[_0xa22d('0x6')]][_0xa22d('0x43')];}}}catch(_0x1ee6f3){utils[_0xa22d('0x1e')](util['format'](_0xa22d('0x45'),_0x356f70[_0xa22d('0x6')]),_0x1ee6f3);}};exports['varset']=function(_0x2e34dc){try{if(!_['isNil'](channels[_0x2e34dc[_0xa22d('0x6')]])){utils[_0xa22d('0x14')](util['format'](_0xa22d('0x47'),_0x2e34dc[_0xa22d('0x6')]),_0x2e34dc);if(!_['isNil'](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x49')])){utils[_0xa22d('0x7')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2e34dc['uniqueid'],_0x2e34dc['value']));channels[_0x2e34dc['uniqueid']][_0xa22d('0x4a')]=_0x2e34dc[_0xa22d('0x4b')];}if(!_[_0xa22d('0x23')](_0x2e34dc['variable'][_0xa22d('0x4c')])){utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x4d'),_0x2e34dc['uniqueid'],_0x2e34dc[_0xa22d('0x4b')]));channels[_0x2e34dc[_0xa22d('0x6')]]['destination']=_0x2e34dc[_0xa22d('0x4b')];channels[_0x2e34dc[_0xa22d('0x6')]][_0xa22d('0x2d')]='\x22'+_0x2e34dc[_0xa22d('0x4b')]+_0xa22d('0x4e')+_0x2e34dc[_0xa22d('0x4b')]+'>';}if(!_[_0xa22d('0x23')](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x4f')])||!_[_0xa22d('0x23')](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x50')])){utils['info'](util['format'](_0xa22d('0x51'),_0x2e34dc[_0xa22d('0x6')],!_['isNil'](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x4f')])?'xmd-callerid-preview':_0xa22d('0x50'),_0x2e34dc[_0xa22d('0x4b')]));channels[_0x2e34dc[_0xa22d('0x6')]][_0xa22d('0x2d')]=_0x2e34dc[_0xa22d('0x4b')];}if(!_['isNil'](_0x2e34dc[_0xa22d('0x48')]['xmd-queue'])||!_[_0xa22d('0x23')](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x52')])){utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x51'),_0x2e34dc[_0xa22d('0x6')],!_[_0xa22d('0x23')](_0x2e34dc['variable'][_0xa22d('0x53')])?_0xa22d('0x53'):_0xa22d('0x52'),_0x2e34dc[_0xa22d('0x4b')]));channels[_0x2e34dc[_0xa22d('0x6')]][_0xa22d('0x54')]=_0xa22d('0x55');channels[_0x2e34dc[_0xa22d('0x6')]][_0xa22d('0x56')]=_0x2e34dc['value'];channels[_0x2e34dc[_0xa22d('0x6')]][_0xa22d('0x57')]=!![];}if(!_[_0xa22d('0x23')](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x58')])){utils['info'](util[_0xa22d('0x8')](_0xa22d('0x59'),_0x2e34dc[_0xa22d('0x6')],_0x2e34dc['value']));channels[_0x2e34dc[_0xa22d('0x6')]]['ContactId']=_0x2e34dc['value'];}if(!_[_0xa22d('0x23')](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x5a')])){utils[_0xa22d('0x7')](util[_0xa22d('0x8')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2e34dc[_0xa22d('0x6')],_0x2e34dc['value']));channels[_0x2e34dc['uniqueid']][_0xa22d('0x5b')]=_0x2e34dc[_0xa22d('0x4b')];}if(!_['isNil'](_0x2e34dc[_0xa22d('0x48')][_0xa22d('0x5c')])){utils[_0xa22d('0x7')](util['format'](_0xa22d('0x5d'),_0x2e34dc[_0xa22d('0x6')],_0x2e34dc[_0xa22d('0x4b')]));channels[_0x2e34dc[_0xa22d('0x6')]][_0xa22d('0x5e')]=_0x2e34dc[_0xa22d('0x4b')];}if(!_[_0xa22d('0x23')](_0x2e34dc['variable']['sipcallid'])){utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x5f'),_0x2e34dc[_0xa22d('0x6')],_0x2e34dc[_0xa22d('0x4b')]));channels[_0x2e34dc[_0xa22d('0x6')]]['sipcallid']=_0x2e34dc[_0xa22d('0x4b')];}}}catch(_0xe8ffee){utils[_0xa22d('0x1e')](util[_0xa22d('0x8')](_0xa22d('0x47'),_0x2e34dc['uniqueid']),_0xe8ffee);}};exports[_0xa22d('0x60')]=function(_0xc950af){try{if(!_[_0xa22d('0x23')](channels[_0xc950af['uniqueid']])){utils[_0xa22d('0x14')](util['format'](_0xa22d('0x61'),_0xc950af[_0xa22d('0x6')]),_0xc950af);utils[_0xa22d('0x7')](util[_0xa22d('0x8')](_0xa22d('0x62'),_0xc950af[_0xa22d('0x6')],_0xc950af[_0xa22d('0x63')],_0xc950af['appdata']));if(_0xc950af[_0xa22d('0x63')][_0xa22d('0x64')]()=='set'&&_[_0xa22d('0x65')](_0xc950af[_0xa22d('0x66')]['toLowerCase'](),_0xa22d('0x67'))){var _0x1c8c21=_0xc950af[_0xa22d('0x66')][_0xa22d('0x68')]('=');var _0x50377d=_0x1c8c21[0x0][_0xa22d('0x69')](_0x1c8c21[0x0][_0xa22d('0x6a')]('(')+0x1,_0x1c8c21[0x0][_0xa22d('0x6a')](')'));var _0x54a99f=_0x1c8c21[0x1];channels[_0xc950af[_0xa22d('0x6')]][_0x50377d]=_0x54a99f;}if(!_[_0xa22d('0x6b')]([_0xa22d('0x2b'),_0xa22d('0x6c'),_0xa22d('0x6d'),_0xa22d('0x6e'),_0xa22d('0x6f')],_0xc950af[_0xa22d('0x63')][_0xa22d('0x64')]())){channels[_0xc950af[_0xa22d('0x6')]][_0xa22d('0x54')]=_0xc950af[_0xa22d('0x63')];channels[_0xc950af[_0xa22d('0x6')]]['lastdata']=_0xc950af[_0xa22d('0x66')];}}}catch(_0x2aeeb5){utils[_0xa22d('0x1e')](util[_0xa22d('0x8')](_0xa22d('0x61'),_0xc950af[_0xa22d('0x6')]),_0x2aeeb5);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 0dc7efd..dfc4b84 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 _0xc7dd=['[core]\x20error','close','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x467222,_0x53f75a){var _0x3258e2=function(_0x1c746c){while(--_0x1c746c){_0x467222['push'](_0x467222['shift']());}};_0x3258e2(++_0x53f75a);}(_0xc7dd,0x1e6));var _0xdc7d=function(_0x4f5c2a,_0x465535){_0x4f5c2a=_0x4f5c2a-0x0;var _0x1b2e6e=_0xc7dd[_0x4f5c2a];return _0x1b2e6e;};'use strict';var utils=require(_0xdc7d('0x0'));exports[_0xdc7d('0x1')]=function(){utils[_0xdc7d('0x2')](_0xdc7d('0x3'));};exports[_0xdc7d('0x4')]=function(){utils[_0xdc7d('0x2')](_0xdc7d('0x5'));};exports[_0xdc7d('0x6')]=function(){utils[_0xdc7d('0x2')](_0xdc7d('0x7'));};exports[_0xdc7d('0x8')]=function(_0x306df7){utils[_0xdc7d('0x8')](_0xdc7d('0x9'),_0x306df7);};exports[_0xdc7d('0xa')]=function(){utils[_0xdc7d('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x1e90e0){}; \ No newline at end of file +var _0xefa0=['./utils','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xefa0,0xb0));var _0x0efa=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xefa0[_0x199572];return _0x13cfa3;};'use strict';var utils=require(_0x0efa('0x0'));exports['connect']=function(){utils[_0x0efa('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x0efa('0x1')](_0x0efa('0x2'));};exports['fullybooted']=function(){utils[_0x0efa('0x1')](_0x0efa('0x3'));};exports['error']=function(_0x5a233b){utils[_0x0efa('0x4')](_0x0efa('0x5'),_0x5a233b);};exports['close']=function(){utils[_0x0efa('0x1')](_0x0efa('0x6'));};exports[_0x0efa('0x7')]=function(_0x128d01){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 081b6f1..6c9adcd 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 _0xd906=['now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','dialstatus','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','answertime','billableseconds','lodash','./utils','info','format','uniqueid','dialstring','connectedlinenum','request','CreateVoiceDialReport','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign'];(function(_0x3fc787,_0x46144e){var _0x3d2ee3=function(_0x5af0ba){while(--_0x5af0ba){_0x3fc787['push'](_0x3fc787['shift']());}};_0x3d2ee3(++_0x46144e);}(_0xd906,0xa8));var _0x6d90=function(_0x2e9681,_0x3386e7){_0x2e9681=_0x2e9681-0x0;var _0x3d1c9f=_0xd906[_0x2e9681];return _0x3d1c9f;};'use strict';var _=require(_0x6d90('0x0'));var util=require('util');var utils=require(_0x6d90('0x1'));var dials={};function writeDB(_0x5ec2d8){utils[_0x6d90('0x2')](util[_0x6d90('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5ec2d8[_0x6d90('0x4')],_0x5ec2d8['channel'],_0x5ec2d8[_0x6d90('0x5')],_0x5ec2d8['calleridnum'],_0x5ec2d8[_0x6d90('0x6')],_0x5ec2d8['dialstatus']));utils[_0x6d90('0x7')](_0x6d90('0x8'),_0x5ec2d8);delete dials[_0x5ec2d8[_0x6d90('0x4')]];}exports['newexten']=function(_0x4fe79f){try{utils['debug'](util['format'](_0x6d90('0x9'),_0x4fe79f[_0x6d90('0x4')]),_0x4fe79f);utils[_0x6d90('0x2')](util[_0x6d90('0x3')](_0x6d90('0xa'),_0x4fe79f[_0x6d90('0x4')],_0x4fe79f[_0x6d90('0xb')],_0x4fe79f[_0x6d90('0xc')]));if(_0x4fe79f[_0x6d90('0xb')][_0x6d90('0xd')]()==_0x6d90('0xe')&&_[_0x6d90('0xf')](_0x4fe79f[_0x6d90('0xc')]['toLowerCase'](),_0x6d90('0x10'))){var _0x38d47c=_0x4fe79f[_0x6d90('0xc')]['split']('=');dials[_0x4fe79f[_0x6d90('0x4')]]={'routeId':_0x38d47c[0x1]};}}catch(_0x1dc31f){utils[_0x6d90('0x11')](util[_0x6d90('0x3')](_0x6d90('0x9'),_0x4fe79f[_0x6d90('0x4')]),_0x1dc31f);}};exports[_0x6d90('0x12')]=function(_0x3c1b08){try{utils[_0x6d90('0x13')](util[_0x6d90('0x3')](_0x6d90('0x14'),_0x3c1b08['uniqueid']),_0x3c1b08);if(!_[_0x6d90('0x15')](_0x3c1b08['variable'][_0x6d90('0x16')])){utils[_0x6d90('0x2')](util[_0x6d90('0x3')](_0x6d90('0x17'),_0x3c1b08['uniqueid'],_0x3c1b08[_0x6d90('0x18')]));dials[_0x3c1b08[_0x6d90('0x4')]]={'routeId':_0x3c1b08[_0x6d90('0x18')]};}}catch(_0x344465){utils[_0x6d90('0x11')](util[_0x6d90('0x3')](_0x6d90('0x14'),_0x3c1b08[_0x6d90('0x4')]),_0x344465);}};exports[_0x6d90('0x19')]=function(_0x3c7f4d){try{if(!_[_0x6d90('0x15')](dials[_0x3c7f4d['uniqueid']])){utils[_0x6d90('0x13')](util[_0x6d90('0x3')](_0x6d90('0x1a'),_0x3c7f4d[_0x6d90('0x4')]),_0x3c7f4d);dials[_0x3c7f4d[_0x6d90('0x4')]]=_[_0x6d90('0x1b')](dials[_0x3c7f4d[_0x6d90('0x4')]],_0x3c7f4d);dials[_0x3c7f4d[_0x6d90('0x4')]]['starttime']=utils[_0x6d90('0x1c')]();dials[_0x3c7f4d[_0x6d90('0x4')]][_0x6d90('0x1d')]=_0x6d90('0x1e');utils[_0x6d90('0x2')](util['format'](_0x6d90('0x1f'),_0x3c7f4d[_0x6d90('0x4')],dials[_0x3c7f4d[_0x6d90('0x4')]][_0x6d90('0x20')]));}}catch(_0x1aa6c5){utils[_0x6d90('0x11')](util[_0x6d90('0x3')]('[%s][dials][dialbegin]',_0x3c7f4d['uniqueid']),_0x1aa6c5);}};exports[_0x6d90('0x21')]=function(_0x135d2e){try{if(!_[_0x6d90('0x15')](dials[_0x135d2e[_0x6d90('0x4')]])){utils['debug'](util[_0x6d90('0x3')](_0x6d90('0x22'),_0x135d2e[_0x6d90('0x4')]),_0x135d2e);dials[_0x135d2e[_0x6d90('0x4')]]['dialstatus']=_0x135d2e[_0x6d90('0x23')];if(_0x135d2e[_0x6d90('0x23')]=='ANSWER'){dials[_0x135d2e[_0x6d90('0x4')]]=_[_0x6d90('0x1b')](dials[_0x135d2e[_0x6d90('0x4')]],_0x135d2e);dials[_0x135d2e['uniqueid']]['answertime']=utils[_0x6d90('0x1c')]();dials[_0x135d2e[_0x6d90('0x4')]]['lastevent']=_0x6d90('0x24');utils['info'](util[_0x6d90('0x3')](_0x6d90('0x25'),_0x135d2e['uniqueid'],_0x135d2e[_0x6d90('0x23')],dials[_0x135d2e[_0x6d90('0x4')]]['answertime']));}else{utils['info'](util[_0x6d90('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x135d2e['uniqueid'],_0x135d2e[_0x6d90('0x23')]));}}}catch(_0x464ac7){utils[_0x6d90('0x11')](util['format'](_0x6d90('0x22'),_0x135d2e[_0x6d90('0x4')]),_0x464ac7);}};exports['hangup']=function(_0x6a4c9e){try{if(!_['isNil'](dials[_0x6a4c9e[_0x6d90('0x4')]])){utils['debug'](util[_0x6d90('0x3')](_0x6d90('0x26'),_0x6a4c9e[_0x6d90('0x4')]),_0x6a4c9e);utils[_0x6d90('0x2')](util[_0x6d90('0x3')](_0x6d90('0x27'),_0x6a4c9e[_0x6d90('0x4')],_0x6a4c9e['calleridnum'],_0x6a4c9e[_0x6d90('0x28')],_0x6a4c9e[_0x6d90('0x29')]));dials[_0x6a4c9e[_0x6d90('0x4')]]=_['assign'](dials[_0x6a4c9e[_0x6d90('0x4')]],{'endtime':utils['now'](),'lastevent':_0x6d90('0x2a')});dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2b')]=utils[_0x6d90('0x2c')](dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2d')],dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x20')]);dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2e')]=utils[_0x6d90('0x2c')](dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2f')]||dials[_0x6a4c9e['uniqueid']][_0x6d90('0x2d')],dials[_0x6a4c9e['uniqueid']][_0x6d90('0x20')]);dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x30')]=dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2f')]?utils[_0x6d90('0x2c')](dials[_0x6a4c9e['uniqueid']]['endtime'],dials[_0x6a4c9e[_0x6d90('0x4')]][_0x6d90('0x2f')]):0x0;writeDB(dials[_0x6a4c9e[_0x6d90('0x4')]]);}}catch(_0x19bee7){utils[_0x6d90('0x11')](util[_0x6d90('0x3')]('[%s][dials][hangup]',_0x6a4c9e['uniqueid']),_0x19bee7);}}; \ No newline at end of file +var _0x26f3=['application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','debug','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','[%s][dials][newexten]'];(function(_0xb14376,_0x5b0bf2){var _0x232f52=function(_0x29342e){while(--_0x29342e){_0xb14376['push'](_0xb14376['shift']());}};_0x232f52(++_0x5b0bf2);}(_0x26f3,0xf7));var _0x326f=function(_0x5a7cbc,_0x573d85){_0x5a7cbc=_0x5a7cbc-0x0;var _0x44d2cc=_0x26f3[_0x5a7cbc];return _0x44d2cc;};'use strict';var _=require(_0x326f('0x0'));var util=require(_0x326f('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x1c6cf8){utils[_0x326f('0x2')](util[_0x326f('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1c6cf8[_0x326f('0x4')],_0x1c6cf8[_0x326f('0x5')],_0x1c6cf8[_0x326f('0x6')],_0x1c6cf8[_0x326f('0x7')],_0x1c6cf8[_0x326f('0x8')],_0x1c6cf8[_0x326f('0x9')]));utils[_0x326f('0xa')](_0x326f('0xb'),_0x1c6cf8);delete dials[_0x1c6cf8[_0x326f('0x4')]];}exports['newexten']=function(_0x23cd50){try{utils['debug'](util['format'](_0x326f('0xc'),_0x23cd50[_0x326f('0x4')]),_0x23cd50);utils[_0x326f('0x2')](util[_0x326f('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x23cd50[_0x326f('0x4')],_0x23cd50[_0x326f('0xd')],_0x23cd50['appdata']));if(_0x23cd50[_0x326f('0xd')][_0x326f('0xe')]()==_0x326f('0xf')&&_[_0x326f('0x10')](_0x23cd50[_0x326f('0x11')][_0x326f('0xe')](),_0x326f('0x12'))){var _0xf3c25c=_0x23cd50['appdata'][_0x326f('0x13')]('=');dials[_0x23cd50['uniqueid']]={'routeId':_0xf3c25c[0x1]};}}catch(_0x4a3b4d){utils['error'](util[_0x326f('0x3')](_0x326f('0xc'),_0x23cd50[_0x326f('0x4')]),_0x4a3b4d);}};exports[_0x326f('0x14')]=function(_0x63cc29){try{utils['debug'](util[_0x326f('0x3')](_0x326f('0x15'),_0x63cc29['uniqueid']),_0x63cc29);if(!_[_0x326f('0x16')](_0x63cc29[_0x326f('0x17')]['outboundrouteid'])){utils[_0x326f('0x2')](util[_0x326f('0x3')](_0x326f('0x18'),_0x63cc29[_0x326f('0x4')],_0x63cc29[_0x326f('0x19')]));dials[_0x63cc29['uniqueid']]={'routeId':_0x63cc29['value']};}}catch(_0x1aa979){utils[_0x326f('0x1a')](util[_0x326f('0x3')](_0x326f('0x15'),_0x63cc29['uniqueid']),_0x1aa979);}};exports['dialbegin']=function(_0x392350){try{if(!_[_0x326f('0x16')](dials[_0x392350['uniqueid']])){utils[_0x326f('0x1b')](util['format']('[%s][dials][dialbegin]',_0x392350[_0x326f('0x4')]),_0x392350);dials[_0x392350[_0x326f('0x4')]]=_[_0x326f('0x1c')](dials[_0x392350[_0x326f('0x4')]],_0x392350);dials[_0x392350['uniqueid']]['starttime']=utils[_0x326f('0x1d')]();dials[_0x392350[_0x326f('0x4')]][_0x326f('0x1e')]=_0x326f('0x1f');utils['info'](util[_0x326f('0x3')](_0x326f('0x20'),_0x392350[_0x326f('0x4')],dials[_0x392350[_0x326f('0x4')]][_0x326f('0x21')]));}}catch(_0x119529){utils[_0x326f('0x1a')](util[_0x326f('0x3')](_0x326f('0x22'),_0x392350[_0x326f('0x4')]),_0x119529);}};exports[_0x326f('0x23')]=function(_0x47bcae){try{if(!_[_0x326f('0x16')](dials[_0x47bcae['uniqueid']])){utils[_0x326f('0x1b')](util[_0x326f('0x3')](_0x326f('0x24'),_0x47bcae[_0x326f('0x4')]),_0x47bcae);dials[_0x47bcae[_0x326f('0x4')]][_0x326f('0x9')]=_0x47bcae['dialstatus'];if(_0x47bcae['dialstatus']==_0x326f('0x25')){dials[_0x47bcae[_0x326f('0x4')]]=_['assign'](dials[_0x47bcae['uniqueid']],_0x47bcae);dials[_0x47bcae[_0x326f('0x4')]][_0x326f('0x26')]=utils[_0x326f('0x1d')]();dials[_0x47bcae[_0x326f('0x4')]][_0x326f('0x1e')]=_0x326f('0x27');utils[_0x326f('0x2')](util[_0x326f('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x47bcae['uniqueid'],_0x47bcae['dialstatus'],dials[_0x47bcae[_0x326f('0x4')]][_0x326f('0x26')]));}else{utils[_0x326f('0x2')](util['format'](_0x326f('0x28'),_0x47bcae[_0x326f('0x4')],_0x47bcae['dialstatus']));}}}catch(_0x483c05){utils['error'](util[_0x326f('0x3')](_0x326f('0x24'),_0x47bcae[_0x326f('0x4')]),_0x483c05);}};exports[_0x326f('0x29')]=function(_0x1a3e75){try{if(!_[_0x326f('0x16')](dials[_0x1a3e75[_0x326f('0x4')]])){utils['debug'](util[_0x326f('0x3')](_0x326f('0x2a'),_0x1a3e75[_0x326f('0x4')]),_0x1a3e75);utils[_0x326f('0x2')](util[_0x326f('0x3')](_0x326f('0x2b'),_0x1a3e75['uniqueid'],_0x1a3e75['calleridnum'],_0x1a3e75[_0x326f('0x2c')],_0x1a3e75[_0x326f('0x2d')]));dials[_0x1a3e75[_0x326f('0x4')]]=_[_0x326f('0x1c')](dials[_0x1a3e75[_0x326f('0x4')]],{'endtime':utils[_0x326f('0x1d')](),'lastevent':_0x326f('0x2e')});dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x2f')]=utils['diffTime'](dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x30')],dials[_0x1a3e75[_0x326f('0x4')]]['starttime']);dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x31')]=utils[_0x326f('0x32')](dials[_0x1a3e75['uniqueid']][_0x326f('0x26')]||dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x30')],dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x21')]);dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x33')]=dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x26')]?utils['diffTime'](dials[_0x1a3e75[_0x326f('0x4')]][_0x326f('0x30')],dials[_0x1a3e75['uniqueid']][_0x326f('0x26')]):0x0;writeDB(dials[_0x1a3e75['uniqueid']]);}}catch(_0x301c10){utils[_0x326f('0x1a')](util[_0x326f('0x3')](_0x326f('0x2a'),_0x1a3e75[_0x326f('0x4')]),_0x301c10);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b56b6d1..a9a9f7f 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 _0xd8e6=['managerevent','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','production','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8e6,0x6f));var _0x6d8e=function(_0x17304b,_0x1a98f8){_0x17304b=_0x17304b-0x0;var _0x28894d=_0xd8e6[_0x17304b];return _0x28894d;};var AsteriskManager=require(_0x6d8e('0x0'));var config=require('../../config/environment');var utils=require(_0x6d8e('0x1'));var util=require(_0x6d8e('0x2'));var isXDREnabled=config[_0x6d8e('0x3')]&&config['xdr'][_0x6d8e('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config['env']===_0x6d8e('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x6d8e('0x6')][_0x6d8e('0x7')],config[_0x6d8e('0x6')]['ip'],config['asterisk'][_0x6d8e('0x8')],config[_0x6d8e('0x6')]['password'],!![]);ami[_0x6d8e('0x9')]();if(!isXDREnabled){utils['info'](_0x6d8e('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x6d8e('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x6d8e('0xc'));var calls=require(_0x6d8e('0xd'));var queues=require(_0x6d8e('0xe'));var recordings=require(_0x6d8e('0xf'));var members=require(_0x6d8e('0x10'));var dials=require(_0x6d8e('0x11'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x6d8e('0x12'),core['connect']);ami['on'](_0x6d8e('0x13'),core[_0x6d8e('0x13')]);ami['on'](_0x6d8e('0x14'),core[_0x6d8e('0x14')]);ami['on'](_0x6d8e('0x15'),core[_0x6d8e('0x15')]);ami['on']('close',core[_0x6d8e('0x16')]);ami['on'](_0x6d8e('0x17'),core['managerevent']);ami['on']('devicestatechange',function(_0x582f82){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x1a'),_0x582f82[_0x6d8e('0x1b')]),_0x582f82);members['devicestatechange'](_0x582f82);}catch(_0x34939d){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')]('[%s][index][devicestatechange]',_0x582f82[_0x6d8e('0x1b')]),_0x34939d);}});ami['on'](_0x6d8e('0x1c'),function(_0x3e273e){try{utils[_0x6d8e('0x18')](util['format'](_0x6d8e('0x1d'),_0x3e273e['uniqueid']),_0x3e273e);agents['agentcalled'](_0x3e273e);}catch(_0x43952e){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x1d'),_0x3e273e[_0x6d8e('0x1e')]),_0x43952e);}});ami['on'](_0x6d8e('0x1f'),function(_0x3889bf){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][agentringnoanswer]',_0x3889bf[_0x6d8e('0x1e')]),_0x3889bf);agents['agentringnoanswer'](_0x3889bf);}catch(_0x2e3883){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x20'),_0x3889bf[_0x6d8e('0x1e')]),_0x2e3883);}});ami['on'](_0x6d8e('0x21'),function(_0x2484fd){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][agentconnect]',_0x2484fd['uniqueid']),_0x2484fd);agents[_0x6d8e('0x21')](_0x2484fd);queues[_0x6d8e('0x21')](_0x2484fd);}catch(_0x2ad645){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x22'),_0x2484fd['uniqueid']),_0x2ad645);}});ami['on'](_0x6d8e('0x23'),function(_0x28b778){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][agentcomplete]',_0x28b778['uniqueid']),_0x28b778);agents[_0x6d8e('0x23')](_0x28b778);queues[_0x6d8e('0x23')](_0x28b778);members['agentcomplete'](_0x28b778);}catch(_0x3c92ca){utils[_0x6d8e('0x15')](util['format'](_0x6d8e('0x24'),_0x28b778['uniqueid']),_0x3c92ca);}});ami['on'](_0x6d8e('0x25'),function(_0x9c66f2){try{utils['debug'](util[_0x6d8e('0x19')](_0x6d8e('0x26'),_0x9c66f2[_0x6d8e('0x1e')]),_0x9c66f2);agents[_0x6d8e('0x25')](_0x9c66f2);queues['queuecallerabandon'](_0x9c66f2);}catch(_0x2e645c){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x26'),_0x9c66f2[_0x6d8e('0x1e')]),_0x2e645c);}});ami['on'](_0x6d8e('0x27'),function(_0x343fd4){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x28'),_0x343fd4[_0x6d8e('0x1e')]),_0x343fd4);queues[_0x6d8e('0x27')](_0x343fd4);recordings[_0x6d8e('0x27')](_0x343fd4);}catch(_0x39f591){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x28'),_0x343fd4[_0x6d8e('0x1e')]),_0x39f591);}});ami['on']('queuecallerleave',function(_0x5b09cc){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x29'),_0x5b09cc[_0x6d8e('0x1e')]),_0x5b09cc);queues[_0x6d8e('0x2a')](_0x5b09cc);}catch(_0x32f539){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x29'),_0x5b09cc[_0x6d8e('0x1e')]),_0x32f539);}});ami['on'](_0x6d8e('0x2b'),function(_0x356bb5){try{utils[_0x6d8e('0x18')](util['format'](_0x6d8e('0x2c'),_0x356bb5['uniqueid']),_0x356bb5);queues[_0x6d8e('0x2b')](_0x356bb5);calls[_0x6d8e('0x2b')](_0x356bb5);}catch(_0x223e18){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x2c'),_0x356bb5[_0x6d8e('0x1e')]),_0x223e18);}});ami['on']('musiconholdstop',function(_0x39a33f){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x2d'),_0x39a33f[_0x6d8e('0x1e')]),_0x39a33f);queues[_0x6d8e('0x2e')](_0x39a33f);calls[_0x6d8e('0x2e')](_0x39a33f);}catch(_0x2674d6){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')]('[%s][index][musiconholdstop]',_0x39a33f[_0x6d8e('0x1e')]),_0x2674d6);}});ami['on'](_0x6d8e('0x2f'),function(_0x41c484){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x30'),_0x41c484['uniqueid']),_0x41c484);calls[_0x6d8e('0x2f')](_0x41c484);recordings[_0x6d8e('0x2f')](_0x41c484);}catch(_0x59eaea){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x30'),_0x41c484['uniqueid']),_0x59eaea);}});ami['on']('hangup',function(_0x530c84){try{utils['debug'](util[_0x6d8e('0x19')](_0x6d8e('0x31'),_0x530c84[_0x6d8e('0x1e')]),_0x530c84);calls[_0x6d8e('0x32')](_0x530c84);recordings['hangup'](_0x530c84);dials[_0x6d8e('0x32')](_0x530c84);agents[_0x6d8e('0x32')](_0x530c84);queues[_0x6d8e('0x32')](_0x530c84);}catch(_0x582790){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x31'),_0x530c84[_0x6d8e('0x1e')]),_0x582790);}});ami['on'](_0x6d8e('0x33'),function(_0x21cec0){try{utils[_0x6d8e('0x18')](util['format'](_0x6d8e('0x34'),_0x21cec0[_0x6d8e('0x1e')]),_0x21cec0);members[_0x6d8e('0x33')](_0x21cec0);}catch(_0x41ac14){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x34'),_0x21cec0[_0x6d8e('0x1e')]),_0x41ac14);}});ami['on'](_0x6d8e('0x35'),function(_0x31c49d){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x36'),_0x31c49d[_0x6d8e('0x1e')]),_0x31c49d);queues[_0x6d8e('0x35')](_0x31c49d);agents[_0x6d8e('0x35')](_0x31c49d);transfers[_0x6d8e('0x35')](_0x31c49d);recordings[_0x6d8e('0x35')](_0x31c49d);}catch(_0x3ef2cb){utils['error'](util[_0x6d8e('0x19')]('[%s][index][blindtransfer]',_0x31c49d[_0x6d8e('0x1e')]),_0x3ef2cb);}});ami['on']('attendedtransfer',function(_0x513149){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x37'),_0x513149['origtransfereruniqueid']),_0x513149);queues[_0x6d8e('0x38')](_0x513149);transfers[_0x6d8e('0x38')](_0x513149);agents[_0x6d8e('0x38')](_0x513149);calls[_0x6d8e('0x38')](_0x513149);}catch(_0x139c76){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x37'),_0x513149[_0x6d8e('0x39')]),_0x139c76);}});ami['on'](_0x6d8e('0x3a'),function(_0x38744d){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x3b'),_0x38744d[_0x6d8e('0x1e')]),_0x38744d);queues[_0x6d8e('0x3a')](_0x38744d);recordings['varset'](_0x38744d);calls['varset'](_0x38744d);dials[_0x6d8e('0x3a')](_0x38744d);}catch(_0x5b060c){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')]('[%s][index][varset]',_0x38744d[_0x6d8e('0x1e')]),_0x5b060c);}});ami['on'](_0x6d8e('0x3c'),function(_0x8df544){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x3d'),_0x8df544[_0x6d8e('0x1e')]),_0x8df544);calls['newexten'](_0x8df544);recordings[_0x6d8e('0x3c')](_0x8df544);dials[_0x6d8e('0x3c')](_0x8df544);}catch(_0x47d460){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x3d'),_0x8df544[_0x6d8e('0x1e')]),_0x47d460);}});ami['on']('newchannel',function(_0x1d2995){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')](_0x6d8e('0x3e'),_0x1d2995['uniqueid']),_0x1d2995);calls['newchannel'](_0x1d2995);recordings['newchannel'](_0x1d2995);}catch(_0x179fb6){utils[_0x6d8e('0x15')](util[_0x6d8e('0x19')](_0x6d8e('0x3e'),_0x1d2995[_0x6d8e('0x1e')]),_0x179fb6);}});ami['on'](_0x6d8e('0x3f'),function(_0x247927){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][dialbegin]',_0x247927[_0x6d8e('0x1e')]),_0x247927);dials[_0x6d8e('0x3f')](_0x247927);}catch(_0x534183){utils['error'](util[_0x6d8e('0x19')](_0x6d8e('0x40'),_0x247927[_0x6d8e('0x1e')]),_0x534183);}});ami['on'](_0x6d8e('0x41'),function(_0x1c72b0){try{utils[_0x6d8e('0x18')](util[_0x6d8e('0x19')]('[%s][index][dialend]',_0x1c72b0[_0x6d8e('0x1e')]),_0x1c72b0);dials['dialend'](_0x1c72b0);}catch(_0x4b9639){utils[_0x6d8e('0x15')](util['format'](_0x6d8e('0x42'),_0x1c72b0[_0x6d8e('0x1e')]),_0x4b9639);}});} \ No newline at end of file +var _0xe747=['dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','local','username','asterisk','password','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]'];(function(_0x9829e,_0x370003){var _0x25b45c=function(_0x340727){while(--_0x340727){_0x9829e['push'](_0x9829e['shift']());}};_0x25b45c(++_0x370003);}(_0xe747,0x14c));var _0x7e74=function(_0x4cefff,_0x13af09){_0x4cefff=_0x4cefff-0x0;var _0x42e8e9=_0xe747[_0x4cefff];return _0x42e8e9;};var AsteriskManager=require(_0x7e74('0x0'));var config=require(_0x7e74('0x1'));var utils=require(_0x7e74('0x2'));var util=require(_0x7e74('0x3'));var isXDREnabled=config[_0x7e74('0x4')]&&config[_0x7e74('0x4')][_0x7e74('0x5')]?!config[_0x7e74('0x4')][_0x7e74('0x5')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x7e74('0x4')]&&config[_0x7e74('0x4')][_0x7e74('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config['asterisk'][_0x7e74('0x7')],config[_0x7e74('0x8')][_0x7e74('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x7e74('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x7e74('0xb')](_0x7e74('0xc'));}else{var agents=require(_0x7e74('0xd'));var calls=require(_0x7e74('0xe'));var queues=require(_0x7e74('0xf'));var recordings=require('./recordings.controller');var members=require(_0x7e74('0x10'));var dials=require(_0x7e74('0x11'));var transfers=require(_0x7e74('0x12'));var core=require('./core.controller');ami['on'](_0x7e74('0x13'),core[_0x7e74('0x13')]);ami['on'](_0x7e74('0x14'),core['shutdown']);ami['on'](_0x7e74('0x15'),core[_0x7e74('0x15')]);ami['on'](_0x7e74('0x16'),core[_0x7e74('0x16')]);ami['on'](_0x7e74('0x17'),core[_0x7e74('0x17')]);ami['on'](_0x7e74('0x18'),core[_0x7e74('0x18')]);ami['on'](_0x7e74('0x19'),function(_0x14132d){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x1c'),_0x14132d[_0x7e74('0x1d')]),_0x14132d);members[_0x7e74('0x19')](_0x14132d);}catch(_0x53dd41){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')]('[%s][index][devicestatechange]',_0x14132d[_0x7e74('0x1d')]),_0x53dd41);}});ami['on'](_0x7e74('0x1e'),function(_0x27db18){try{utils[_0x7e74('0x1a')](util['format'](_0x7e74('0x1f'),_0x27db18[_0x7e74('0x20')]),_0x27db18);agents[_0x7e74('0x1e')](_0x27db18);}catch(_0x449354){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')]('[%s][index][agentcalled]',_0x27db18['uniqueid']),_0x449354);}});ami['on'](_0x7e74('0x21'),function(_0x558dbf){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x22'),_0x558dbf[_0x7e74('0x20')]),_0x558dbf);agents[_0x7e74('0x21')](_0x558dbf);}catch(_0x4b0167){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')](_0x7e74('0x22'),_0x558dbf[_0x7e74('0x20')]),_0x4b0167);}});ami['on'](_0x7e74('0x23'),function(_0x5bd969){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x24'),_0x5bd969[_0x7e74('0x20')]),_0x5bd969);agents[_0x7e74('0x23')](_0x5bd969);queues[_0x7e74('0x23')](_0x5bd969);}catch(_0x331a60){utils['error'](util['format'](_0x7e74('0x24'),_0x5bd969[_0x7e74('0x20')]),_0x331a60);}});ami['on'](_0x7e74('0x25'),function(_0xfd94b0){try{utils[_0x7e74('0x1a')](util['format'](_0x7e74('0x26'),_0xfd94b0[_0x7e74('0x20')]),_0xfd94b0);agents[_0x7e74('0x25')](_0xfd94b0);queues['agentcomplete'](_0xfd94b0);members[_0x7e74('0x25')](_0xfd94b0);}catch(_0x53e1a8){utils[_0x7e74('0x16')](util['format']('[%s][index][agentcomplete]',_0xfd94b0[_0x7e74('0x20')]),_0x53e1a8);}});ami['on']('queuecallerabandon',function(_0x1077d5){try{utils['debug'](util[_0x7e74('0x1b')](_0x7e74('0x27'),_0x1077d5[_0x7e74('0x20')]),_0x1077d5);agents[_0x7e74('0x28')](_0x1077d5);queues['queuecallerabandon'](_0x1077d5);}catch(_0x2f3a27){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')]('[%s][index][queuecallerabandon]',_0x1077d5['uniqueid']),_0x2f3a27);}});ami['on'](_0x7e74('0x29'),function(_0x46f6fe){try{utils[_0x7e74('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0x46f6fe[_0x7e74('0x20')]),_0x46f6fe);queues['queuecallerjoin'](_0x46f6fe);recordings[_0x7e74('0x29')](_0x46f6fe);}catch(_0x40314c){utils[_0x7e74('0x16')](util['format'](_0x7e74('0x2a'),_0x46f6fe['uniqueid']),_0x40314c);}});ami['on']('queuecallerleave',function(_0x46017c){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x2b'),_0x46017c[_0x7e74('0x20')]),_0x46017c);queues[_0x7e74('0x2c')](_0x46017c);}catch(_0x514584){utils['error'](util[_0x7e74('0x1b')](_0x7e74('0x2b'),_0x46017c[_0x7e74('0x20')]),_0x514584);}});ami['on'](_0x7e74('0x2d'),function(_0x3b6f82){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x2e'),_0x3b6f82[_0x7e74('0x20')]),_0x3b6f82);queues[_0x7e74('0x2d')](_0x3b6f82);calls[_0x7e74('0x2d')](_0x3b6f82);}catch(_0x313dba){utils[_0x7e74('0x16')](util['format'](_0x7e74('0x2e'),_0x3b6f82[_0x7e74('0x20')]),_0x313dba);}});ami['on'](_0x7e74('0x2f'),function(_0x1c152e){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x30'),_0x1c152e[_0x7e74('0x20')]),_0x1c152e);queues[_0x7e74('0x2f')](_0x1c152e);calls['musiconholdstop'](_0x1c152e);}catch(_0x5710b2){utils['error'](util['format'](_0x7e74('0x30'),_0x1c152e[_0x7e74('0x20')]),_0x5710b2);}});ami['on'](_0x7e74('0x31'),function(_0x171a7c){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x32'),_0x171a7c[_0x7e74('0x20')]),_0x171a7c);calls[_0x7e74('0x31')](_0x171a7c);recordings[_0x7e74('0x31')](_0x171a7c);}catch(_0x5f0b21){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')](_0x7e74('0x32'),_0x171a7c[_0x7e74('0x20')]),_0x5f0b21);}});ami['on'](_0x7e74('0x33'),function(_0x6cb7){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x34'),_0x6cb7['uniqueid']),_0x6cb7);calls[_0x7e74('0x33')](_0x6cb7);recordings[_0x7e74('0x33')](_0x6cb7);dials[_0x7e74('0x33')](_0x6cb7);agents[_0x7e74('0x33')](_0x6cb7);queues[_0x7e74('0x33')](_0x6cb7);}catch(_0x35fb49){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')](_0x7e74('0x34'),_0x6cb7[_0x7e74('0x20')]),_0x35fb49);}});ami['on']('cdr',function(_0x1ff0d9){try{utils[_0x7e74('0x1a')](util['format'](_0x7e74('0x35'),_0x1ff0d9['uniqueid']),_0x1ff0d9);members['cdr'](_0x1ff0d9);}catch(_0x54a072){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')](_0x7e74('0x35'),_0x1ff0d9[_0x7e74('0x20')]),_0x54a072);}});ami['on'](_0x7e74('0x36'),function(_0x4a56d8){try{utils[_0x7e74('0x1a')](util['format'](_0x7e74('0x37'),_0x4a56d8['uniqueid']),_0x4a56d8);queues[_0x7e74('0x36')](_0x4a56d8);agents['blindtransfer'](_0x4a56d8);transfers[_0x7e74('0x36')](_0x4a56d8);recordings['blindtransfer'](_0x4a56d8);}catch(_0x567686){utils['error'](util['format'](_0x7e74('0x37'),_0x4a56d8['uniqueid']),_0x567686);}});ami['on'](_0x7e74('0x38'),function(_0x42d452){try{utils['debug'](util[_0x7e74('0x1b')](_0x7e74('0x39'),_0x42d452['origtransfereruniqueid']),_0x42d452);queues[_0x7e74('0x38')](_0x42d452);transfers[_0x7e74('0x38')](_0x42d452);agents[_0x7e74('0x38')](_0x42d452);calls[_0x7e74('0x38')](_0x42d452);}catch(_0x401840){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')](_0x7e74('0x39'),_0x42d452['origtransfereruniqueid']),_0x401840);}});ami['on']('varset',function(_0x21a548){try{utils['debug'](util['format']('[%s][index][varset]',_0x21a548['uniqueid']),_0x21a548);queues[_0x7e74('0x3a')](_0x21a548);recordings[_0x7e74('0x3a')](_0x21a548);calls[_0x7e74('0x3a')](_0x21a548);dials['varset'](_0x21a548);}catch(_0x4f15b4){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')]('[%s][index][varset]',_0x21a548[_0x7e74('0x20')]),_0x4f15b4);}});ami['on']('newexten',function(_0x527c57){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x3b'),_0x527c57[_0x7e74('0x20')]),_0x527c57);calls[_0x7e74('0x3c')](_0x527c57);recordings['newexten'](_0x527c57);dials[_0x7e74('0x3c')](_0x527c57);}catch(_0x1492dd){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')]('[%s][index][newexten]',_0x527c57[_0x7e74('0x20')]),_0x1492dd);}});ami['on'](_0x7e74('0x3d'),function(_0x56c771){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x3e'),_0x56c771[_0x7e74('0x20')]),_0x56c771);calls['newchannel'](_0x56c771);recordings[_0x7e74('0x3d')](_0x56c771);}catch(_0x422db5){utils['error'](util[_0x7e74('0x1b')](_0x7e74('0x3e'),_0x56c771[_0x7e74('0x20')]),_0x422db5);}});ami['on']('dialbegin',function(_0x2c00c5){try{utils[_0x7e74('0x1a')](util['format'](_0x7e74('0x3f'),_0x2c00c5[_0x7e74('0x20')]),_0x2c00c5);dials['dialbegin'](_0x2c00c5);}catch(_0xd52038){utils['error'](util[_0x7e74('0x1b')]('[%s]dialbegin',_0x2c00c5[_0x7e74('0x20')]),_0xd52038);}});ami['on'](_0x7e74('0x40'),function(_0x13f6b3){try{utils[_0x7e74('0x1a')](util[_0x7e74('0x1b')](_0x7e74('0x41'),_0x13f6b3[_0x7e74('0x20')]),_0x13f6b3);dials[_0x7e74('0x40')](_0x13f6b3);}catch(_0x1350cc){utils[_0x7e74('0x16')](util[_0x7e74('0x1b')](_0x7e74('0x41'),_0x13f6b3['uniqueid']),_0x1350cc);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9723c79..9dd8d8c 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 _0x3164=['state','BUSY','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','[%s][members][cdr]','data1','data3','destinationchannel','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','error','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0x256320,_0x543d5d){var _0x570241=function(_0x24f019){while(--_0x24f019){_0x256320['push'](_0x256320['shift']());}};_0x570241(++_0x543d5d);}(_0x3164,0x182));var _0x4316=function(_0x48d3fa,_0x3808a6){_0x48d3fa=_0x48d3fa-0x0;var _0x4c4995=_0x3164[_0x48d3fa];return _0x4c4995;};'use strict';var _=require(_0x4316('0x0'));var util=require(_0x4316('0x1'));var utils=require(_0x4316('0x2'));var members={};var exclude=[_0x4316('0x3'),_0x4316('0x4')];function writeDB(_0x588480){utils[_0x4316('0x5')](util[_0x4316('0x6')](_0x4316('0x7'),_0x588480['uniqueid'],_0x588480['interface'],_0x588480[_0x4316('0x8')],_0x588480[_0x4316('0x9')],_0x588480[_0x4316('0xa')],_0x588480[_0x4316('0xb')]));if(_0x588480[_0x4316('0xc')]){utils[_0x4316('0xd')](_0x588480[_0x4316('0xc')])[_0x4316('0xe')](function(_0x3e2d05){if(_0x3e2d05){_0x588480[_0x4316('0xa')]=_0x3e2d05[_0x4316('0xf')];_0x588480[_0x4316('0x10')]=_0x3e2d05[_0x4316('0x10')];utils[_0x4316('0x11')]('CreateMemberReport',_0x588480);}else{utils[_0x4316('0x12')](_0x588480[_0x4316('0xc')][_0x4316('0x13')]('/')[0x1])[_0x4316('0xe')](function(_0x47a510){if(_0x47a510){_0x588480[_0x4316('0xa')]=_0x47a510[_0x4316('0xf')];_0x588480[_0x4316('0x10')]=_0x47a510[_0x4316('0x10')];utils['request'](_0x4316('0x14'),_0x588480);}});}})['catch'](function(_0x4d8daa){utils['error'](util[_0x4316('0x6')](_0x4316('0x15'),_0x588480['uniqueid']),_0x4d8daa);});}delete members[_0x588480[_0x4316('0xc')]];}function startsWith(_0x486a64,_0x133121){return _[_0x4316('0x16')](_0x486a64,function(_0x211d87){return _[_0x4316('0x17')](_0x133121,_0x211d87);});}exports[_0x4316('0x18')]=function(_0x2d579f){try{utils[_0x4316('0x19')](util[_0x4316('0x6')](_0x4316('0x1a'),members[_0x2d579f[_0x4316('0x1b')]]?members[_0x2d579f['device']][_0x4316('0x1c')]:_0x2d579f[_0x4316('0x1b')]),_0x2d579f);utils['info'](util['format'](_0x4316('0x1d'),members[_0x2d579f[_0x4316('0x1b')]]?members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x1c')]:_0x2d579f[_0x4316('0x1b')],_0x2d579f['state'],_0x2d579f[_0x4316('0x1b')]));switch(_0x2d579f[_0x4316('0x1e')]){case'INUSE':case _0x4316('0x1f'):if(!startsWith(exclude,_0x2d579f[_0x4316('0x1b')])){members[_0x2d579f[_0x4316('0x1b')]]={'channel':'voice','interface':_0x2d579f[_0x4316('0x1b')],'type':_0x4316('0x20'),'enterAt':utils[_0x4316('0x21')](),'role':'agent'};}break;case _0x4316('0x22'):if(!_[_0x4316('0x23')](members[_0x2d579f[_0x4316('0x1b')]])){members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x24')]=utils[_0x4316('0x21')]();members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x25')]=utils[_0x4316('0x26')](members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x24')],members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x27')]);if(members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x1c')]){writeDB(members[_0x2d579f[_0x4316('0x1b')]]);}}break;default:break;}}catch(_0x28e2a2){utils['error'](util['format'](_0x4316('0x1a'),members[_0x2d579f[_0x4316('0x1b')]]?members[_0x2d579f[_0x4316('0x1b')]][_0x4316('0x1c')]:_0x2d579f[_0x4316('0x1b')]),_0x28e2a2);}};exports['agentcomplete']=function(_0xf66a01){try{if(!_['isNil'](members[_0xf66a01[_0x4316('0xc')]])){utils['debug'](util[_0x4316('0x6')]('[%s][members][agentcomplete]',_0xf66a01[_0x4316('0x1c')]),_0xf66a01);utils[_0x4316('0x5')](util['format'](_0x4316('0x28'),_0xf66a01['uniqueid'],_0xf66a01[_0x4316('0xc')],_0xf66a01[_0x4316('0x29')]));members[_0xf66a01[_0x4316('0xc')]]=_[_0x4316('0x2a')](members[_0xf66a01[_0x4316('0xc')]],{'data4':_0xf66a01[_0x4316('0x29')],'uniqueid':_0xf66a01[_0x4316('0x1c')]});}}catch(_0x9790b8){utils['error'](util[_0x4316('0x6')](_0x4316('0x2b'),_0xf66a01['uniqueid']),_0x9790b8);}};exports['cdr']=function(_0x5f3ff9){try{utils[_0x4316('0x19')](util[_0x4316('0x6')](_0x4316('0x2c'),_0x5f3ff9[_0x4316('0x1c')]),_0x5f3ff9);if(_0x5f3ff9['channel']){var _0x67db3a=_0x5f3ff9[_0x4316('0x8')][_0x4316('0x13')]('-')[0x0];if(!_[_0x4316('0x23')](members[_0x67db3a])){members[_0x67db3a]=_[_0x4316('0x2a')](members[_0x67db3a],{'data1':members[_0x67db3a][_0x4316('0x2d')]||_0x5f3ff9['type'],'data2':members[_0x67db3a][_0x4316('0x9')]||_0x5f3ff9['source'],'data3':members[_0x67db3a][_0x4316('0x2e')]||_0x5f3ff9['destination'],'uniqueid':members[_0x67db3a][_0x4316('0x1c')]||_0x5f3ff9[_0x4316('0x1c')]});utils[_0x4316('0x5')](util[_0x4316('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5f3ff9[_0x4316('0x1c')],members[_0x67db3a][_0x4316('0x2d')],members[_0x67db3a]['data2'],members[_0x67db3a][_0x4316('0x2e')]));if(members[_0x67db3a][_0x4316('0x24')]){writeDB(members[_0x67db3a]);}}}if(_0x5f3ff9[_0x4316('0x2f')]){var _0x523093=_0x5f3ff9[_0x4316('0x2f')][_0x4316('0x13')]('-')[0x0];if(!_[_0x4316('0x23')](members[_0x523093])){members[_0x523093]=_[_0x4316('0x2a')](members[_0x523093],{'data1':members[_0x523093][_0x4316('0x2d')]||_0x5f3ff9[_0x4316('0xb')],'data2':members[_0x523093][_0x4316('0x9')]||_0x5f3ff9[_0x4316('0x30')],'data3':members[_0x523093][_0x4316('0x2e')]||_0x5f3ff9[_0x4316('0x31')],'uniqueid':members[_0x523093][_0x4316('0x1c')]||_0x5f3ff9[_0x4316('0x1c')]});utils[_0x4316('0x5')](util[_0x4316('0x6')](_0x4316('0x32'),_0x5f3ff9[_0x4316('0x1c')],members[_0x523093][_0x4316('0x2d')],members[_0x523093][_0x4316('0x9')],members[_0x523093][_0x4316('0x2e')]));if(members[_0x523093][_0x4316('0x24')]){writeDB(members[_0x523093]);}}}}catch(_0x568adf){utils[_0x4316('0x33')](util['format']('[%s][members][cdr]',_0x5f3ff9[_0x4316('0x1c')]),_0x568adf);}}; \ No newline at end of file +var _0xb903=['agent','NOT_INUSE','isNil','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','split','type','data2','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','exitAt','destinationchannel','assign','source','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','getUserByInterface','then','getUserByName','name','internal','catch','[%s][members][writeDB]','some','startsWith','debug','device','state','INUSE','BUSY','voice','now'];(function(_0x65bca6,_0x407453){var _0x44a0e5=function(_0x2f6908){while(--_0x2f6908){_0x65bca6['push'](_0x65bca6['shift']());}};_0x44a0e5(++_0x407453);}(_0xb903,0x185));var _0x3b90=function(_0x32984c,_0x10a352){_0x32984c=_0x32984c-0x0;var _0x16a015=_0xb903[_0x32984c];return _0x16a015;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var utils=require(_0x3b90('0x2'));var members={};var exclude=[_0x3b90('0x3'),'Queue:'];function writeDB(_0x3312ca){utils[_0x3b90('0x4')](util[_0x3b90('0x5')](_0x3b90('0x6'),_0x3312ca[_0x3b90('0x7')],_0x3312ca[_0x3b90('0x8')],_0x3312ca[_0x3b90('0x9')],_0x3312ca['data2'],_0x3312ca[_0x3b90('0xa')],_0x3312ca['type']));if(_0x3312ca['interface']){utils[_0x3b90('0xb')](_0x3312ca[_0x3b90('0x8')])[_0x3b90('0xc')](function(_0x1b1fbf){if(_0x1b1fbf){_0x3312ca['membername']=_0x1b1fbf['name'];_0x3312ca['internal']=_0x1b1fbf['internal'];utils['request']('CreateMemberReport',_0x3312ca);}else{utils[_0x3b90('0xd')](_0x3312ca[_0x3b90('0x8')]['split']('/')[0x1])[_0x3b90('0xc')](function(_0x233509){if(_0x233509){_0x3312ca['membername']=_0x233509[_0x3b90('0xe')];_0x3312ca[_0x3b90('0xf')]=_0x233509[_0x3b90('0xf')];utils['request']('CreateMemberReport',_0x3312ca);}});}})[_0x3b90('0x10')](function(_0x542cb3){utils['error'](util[_0x3b90('0x5')](_0x3b90('0x11'),_0x3312ca['uniqueid']),_0x542cb3);});}delete members[_0x3312ca['interface']];}function startsWith(_0x3725b9,_0x1b6349){return _[_0x3b90('0x12')](_0x3725b9,function(_0x1af265){return _[_0x3b90('0x13')](_0x1b6349,_0x1af265);});}exports['devicestatechange']=function(_0x494970){try{utils[_0x3b90('0x14')](util[_0x3b90('0x5')]('[%s][members][devicestatechange]',members[_0x494970[_0x3b90('0x15')]]?members[_0x494970[_0x3b90('0x15')]][_0x3b90('0x7')]:_0x494970[_0x3b90('0x15')]),_0x494970);utils['info'](util[_0x3b90('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x494970[_0x3b90('0x15')]]?members[_0x494970[_0x3b90('0x15')]]['uniqueid']:_0x494970[_0x3b90('0x15')],_0x494970[_0x3b90('0x16')],_0x494970[_0x3b90('0x15')]));switch(_0x494970[_0x3b90('0x16')]){case _0x3b90('0x17'):case _0x3b90('0x18'):if(!startsWith(exclude,_0x494970[_0x3b90('0x15')])){members[_0x494970[_0x3b90('0x15')]]={'channel':_0x3b90('0x19'),'interface':_0x494970[_0x3b90('0x15')],'type':'TALKING','enterAt':utils[_0x3b90('0x1a')](),'role':_0x3b90('0x1b')};}break;case _0x3b90('0x1c'):if(!_[_0x3b90('0x1d')](members[_0x494970[_0x3b90('0x15')]])){members[_0x494970[_0x3b90('0x15')]]['exitAt']=utils['now']();members[_0x494970[_0x3b90('0x15')]][_0x3b90('0x1e')]=utils[_0x3b90('0x1f')](members[_0x494970[_0x3b90('0x15')]]['exitAt'],members[_0x494970[_0x3b90('0x15')]][_0x3b90('0x20')]);if(members[_0x494970[_0x3b90('0x15')]]['uniqueid']){writeDB(members[_0x494970[_0x3b90('0x15')]]);}}break;default:break;}}catch(_0x138d79){utils[_0x3b90('0x21')](util[_0x3b90('0x5')](_0x3b90('0x22'),members[_0x494970[_0x3b90('0x15')]]?members[_0x494970['device']][_0x3b90('0x7')]:_0x494970['device']),_0x138d79);}};exports[_0x3b90('0x23')]=function(_0x9891e4){try{if(!_[_0x3b90('0x1d')](members[_0x9891e4[_0x3b90('0x8')]])){utils[_0x3b90('0x14')](util[_0x3b90('0x5')](_0x3b90('0x24'),_0x9891e4[_0x3b90('0x7')]),_0x9891e4);utils['info'](util['format'](_0x3b90('0x25'),_0x9891e4[_0x3b90('0x7')],_0x9891e4[_0x3b90('0x8')],_0x9891e4[_0x3b90('0x26')]));members[_0x9891e4['interface']]=_['assign'](members[_0x9891e4[_0x3b90('0x8')]],{'data4':_0x9891e4[_0x3b90('0x26')],'uniqueid':_0x9891e4[_0x3b90('0x7')]});}}catch(_0x4f3ab5){utils[_0x3b90('0x21')](util['format']('[%s][members][agentcomplete]',_0x9891e4[_0x3b90('0x7')]),_0x4f3ab5);}};exports[_0x3b90('0x27')]=function(_0x5175b3){try{utils[_0x3b90('0x14')](util[_0x3b90('0x5')](_0x3b90('0x28'),_0x5175b3['uniqueid']),_0x5175b3);if(_0x5175b3['channel']){var _0x46c58c=_0x5175b3[_0x3b90('0x9')][_0x3b90('0x29')]('-')[0x0];if(!_[_0x3b90('0x1d')](members[_0x46c58c])){members[_0x46c58c]=_['assign'](members[_0x46c58c],{'data1':members[_0x46c58c]['data1']||_0x5175b3[_0x3b90('0x2a')],'data2':members[_0x46c58c][_0x3b90('0x2b')]||_0x5175b3['source'],'data3':members[_0x46c58c]['data3']||_0x5175b3[_0x3b90('0x2c')],'uniqueid':members[_0x46c58c][_0x3b90('0x7')]||_0x5175b3[_0x3b90('0x7')]});utils[_0x3b90('0x4')](util['format'](_0x3b90('0x2d'),_0x5175b3['uniqueid'],members[_0x46c58c][_0x3b90('0x2e')],members[_0x46c58c][_0x3b90('0x2b')],members[_0x46c58c][_0x3b90('0x2f')]));if(members[_0x46c58c][_0x3b90('0x30')]){writeDB(members[_0x46c58c]);}}}if(_0x5175b3[_0x3b90('0x31')]){var _0x3bf148=_0x5175b3[_0x3b90('0x31')]['split']('-')[0x0];if(!_[_0x3b90('0x1d')](members[_0x3bf148])){members[_0x3bf148]=_[_0x3b90('0x32')](members[_0x3bf148],{'data1':members[_0x3bf148][_0x3b90('0x2e')]||_0x5175b3[_0x3b90('0x2a')],'data2':members[_0x3bf148][_0x3b90('0x2b')]||_0x5175b3[_0x3b90('0x33')],'data3':members[_0x3bf148][_0x3b90('0x2f')]||_0x5175b3[_0x3b90('0x2c')],'uniqueid':members[_0x3bf148][_0x3b90('0x7')]||_0x5175b3['uniqueid']});utils[_0x3b90('0x4')](util[_0x3b90('0x5')](_0x3b90('0x2d'),_0x5175b3[_0x3b90('0x7')],members[_0x3bf148][_0x3b90('0x2e')],members[_0x3bf148][_0x3b90('0x2b')],members[_0x3bf148][_0x3b90('0x2f')]));if(members[_0x3bf148][_0x3b90('0x30')]){writeDB(members[_0x3bf148]);}}}}catch(_0x30ff62){utils[_0x3b90('0x21')](util[_0x3b90('0x5')](_0x3b90('0x28'),_0x5175b3[_0x3b90('0x7')]),_0x30ff62);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index f42392e..59a5dd2 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 _0x959c=['calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone'];(function(_0x152c99,_0x4b5e30){var _0x5ccf95=function(_0x269259){while(--_0x269259){_0x152c99['push'](_0x152c99['shift']());}};_0x5ccf95(++_0x4b5e30);}(_0x959c,0x19f));var _0xc959=function(_0x4a40a4,_0x50d977){_0x4a40a4=_0x4a40a4-0x0;var _0x34cfe1=_0x959c[_0x4a40a4];return _0x34cfe1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc959('0x0'));var queues={};function writeDB(_0x50b2cc){utils[_0xc959('0x1')](util['format'](_0xc959('0x2'),_0x50b2cc[_0xc959('0x3')],_0x50b2cc[_0xc959('0x4')],_0x50b2cc['queue'],_0x50b2cc[_0xc959('0x5')],_0x50b2cc[_0xc959('0x6')],_0x50b2cc[_0xc959('0x7')],_0x50b2cc[_0xc959('0x8')]));if(_0x50b2cc[_0xc959('0x9')]){utils[_0xc959('0xa')](_0x50b2cc[_0xc959('0x9')])[_0xc959('0xb')](function(_0x38e26a){if(_0x38e26a){_0x50b2cc[_0xc959('0xc')]=_0x38e26a[_0xc959('0xc')];}utils[_0xc959('0xd')](_0xc959('0xe'),_0x50b2cc);});}else{utils[_0xc959('0xd')](_0xc959('0xe'),_0x50b2cc);}if(_0x50b2cc[_0xc959('0xf')]){delete queues[_0x50b2cc[_0xc959('0xf')]];}else{delete queues[_0x50b2cc[_0xc959('0x3')]];}}exports[_0xc959('0x10')]=function(_0xb642ff){try{utils[_0xc959('0x11')](util['format'](_0xc959('0x12'),_0xb642ff['uniqueid']),_0xb642ff);utils['info'](util[_0xc959('0x13')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xb642ff[_0xc959('0x3')],_0xb642ff[_0xc959('0x9')],_0xb642ff[_0xc959('0x14')]));queues[_0xb642ff['uniqueid']]=_[_0xc959('0x15')](_0xb642ff,{'originalposition':_0xb642ff[_0xc959('0x14')],'queuecallerjoinAt':utils[_0xc959('0x16')](),'mohtime':0x0});}catch(_0x27b7be){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x12'),_0xb642ff[_0xc959('0x3')]),_0x27b7be);}};exports['hangup']=function(_0x190278){try{if(!_[_0xc959('0x18')](queues[_0x190278[_0xc959('0x3')]])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x19'),_0x190278[_0xc959('0x3')]),_0x190278);if(queues[_0x190278[_0xc959('0x3')]][_0xc959('0x1a')]){if(!queues[_0x190278['uniqueid']][_0xc959('0x1b')]&&!queues[_0x190278[_0xc959('0x3')]][_0xc959('0x1c')]){queues[_0x190278['uniqueid']][_0xc959('0x1d')]=!![];queues[_0x190278[_0xc959('0x3')]][_0xc959('0x1e')]=utils[_0xc959('0x16')]();queues[_0x190278[_0xc959('0x3')]][_0xc959('0x8')]=_0xc959('0x1f');}utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x20'),_0x190278['uniqueid'],queues[_0x190278['uniqueid']][_0xc959('0x21')],queues[_0x190278[_0xc959('0x3')]][_0xc959('0x8')]));writeDB(queues[_0x190278[_0xc959('0x3')]]);}else if(queues[_0x190278[_0xc959('0x3')]][_0xc959('0xf')]){utils['info'](util[_0xc959('0x13')](_0xc959('0x22'),_0x190278[_0xc959('0x3')],queues[_0x190278[_0xc959('0x3')]][_0xc959('0x21')],queues[_0x190278[_0xc959('0x3')]][_0xc959('0xf')]));queues[queues[_0x190278[_0xc959('0x3')]][_0xc959('0xf')]]=queues[_0x190278[_0xc959('0x3')]];queues[queues[_0x190278[_0xc959('0x3')]]['transfereduniqueid']][_0xc959('0x23')]=0x2;delete queues[_0x190278['uniqueid']];}}}catch(_0x5c619d){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x19'),_0x190278[_0xc959('0x3')]),_0x5c619d);}};exports[_0xc959('0x24')]=function(_0x148823){try{utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x25'),_0x148823[_0xc959('0x3')]),_0x148823);if(!_[_0xc959('0x18')](_0x148823[_0xc959('0x26')]['queuestatus'])&&_0x148823[_0xc959('0x27')][_0xc959('0x28')]()!==_0xc959('0x29')){if(!_[_0xc959('0x18')](queues[_0x148823[_0xc959('0x3')]])){queues[_0x148823[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x148823[_0xc959('0x3')]][_0xc959('0x2a')]=null;queues[_0x148823[_0xc959('0x3')]][_0xc959('0x1c')]=!![];queues[_0x148823[_0xc959('0x3')]]['queuecallerexitAt']=utils[_0xc959('0x16')]();queues[_0x148823[_0xc959('0x3')]][_0xc959('0x8')]=_0x148823[_0xc959('0x27')]['toUpperCase']();utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x2b'),_0x148823[_0xc959('0x3')],queues[_0x148823[_0xc959('0x3')]][_0xc959('0x21')],_0x148823['value'],queues[_0x148823[_0xc959('0x3')]][_0xc959('0x8')]));writeDB(queues[_0x148823[_0xc959('0x3')]]);}}else if(!_[_0xc959('0x18')](_0x148823[_0xc959('0x26')][_0xc959('0x2c')])){if(!_[_0xc959('0x18')](queues[_0x148823[_0xc959('0x3')]])&&!queues[_0x148823[_0xc959('0x3')]]['queuecallerabandon']){queues[_0x148823['uniqueid']][_0xc959('0x1b')]=![];queues[_0x148823['uniqueid']]['queuecallerabandonAt']=null;queues[_0x148823[_0xc959('0x3')]][_0xc959('0x1c')]=!![];queues[_0x148823[_0xc959('0x3')]][_0xc959('0x2d')]=utils['now']();queues[_0x148823[_0xc959('0x3')]][_0xc959('0x8')]=_0xc959('0x2e');utils[_0xc959('0x1')](util['format'](_0xc959('0x2f'),_0x148823[_0xc959('0x3')],queues[_0x148823[_0xc959('0x3')]][_0xc959('0x21')],_0x148823[_0xc959('0x27')],queues[_0x148823['uniqueid']][_0xc959('0x8')]));}}}catch(_0x39c4a2){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x25'),_0x148823[_0xc959('0x3')]),_0x39c4a2);}};exports[_0xc959('0x1b')]=function(_0x2cb6fe){try{if(!_[_0xc959('0x18')](queues[_0x2cb6fe[_0xc959('0x3')]])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x30'),_0x2cb6fe[_0xc959('0x3')]),_0x2cb6fe);queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x1c')]=![];queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x2d')]=null;queues[_0x2cb6fe[_0xc959('0x3')]]['queuecallerabandon']=!![];queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x2a')]=utils[_0xc959('0x16')]();queues[_0x2cb6fe[_0xc959('0x3')]][_0xc959('0x8')]=_0xc959('0x31');utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2cb6fe[_0xc959('0x3')],queues[_0x2cb6fe[_0xc959('0x3')]]['name'],queues[_0x2cb6fe[_0xc959('0x3')]]['queuecallerexitreason']));}}catch(_0x3fe969){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x30'),_0x2cb6fe[_0xc959('0x3')]),_0x3fe969);}};exports[_0xc959('0x32')]=function(_0x3cf53b){try{if(!_[_0xc959('0x18')](queues[_0x3cf53b['uniqueid']])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x33'),_0x3cf53b['uniqueid']),_0x3cf53b);utils[_0xc959('0x1')](util['format'](_0xc959('0x34'),_0x3cf53b[_0xc959('0x3')],queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x21')],_0x3cf53b[_0xc959('0x35')],_0x3cf53b[_0xc959('0x36')]));queues[_0x3cf53b['uniqueid']][_0xc959('0x32')]=!![];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x1a')]=utils[_0xc959('0x16')]();queues[_0x3cf53b['uniqueid']]['holdtime']=utils[_0xc959('0x37')](queues[_0x3cf53b['uniqueid']][_0xc959('0x1a')],queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x38')]);queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x14')]=_0x3cf53b[_0xc959('0x14')];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x39')]=_0x3cf53b[_0xc959('0x39')];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x35')]=_0x3cf53b['connectedlinenum'];queues[_0x3cf53b[_0xc959('0x3')]][_0xc959('0x36')]=_0x3cf53b[_0xc959('0x36')];}}catch(_0x219b51){utils[_0xc959('0x17')](util[_0xc959('0x13')]('[%s][queues][queuecallerleave]',_0x3cf53b[_0xc959('0x3')]),_0x219b51);}};exports[_0xc959('0x3a')]=function(_0x3e7b1b){try{if(!_['isNil'](queues[_0x3e7b1b[_0xc959('0x3')]])){utils[_0xc959('0x11')](util['format'](_0xc959('0x3b'),_0x3e7b1b['uniqueid']),_0x3e7b1b);utils[_0xc959('0x1')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3e7b1b['uniqueid'],queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x21')],_0x3e7b1b[_0xc959('0x3c')],_0x3e7b1b[_0xc959('0x3d')]));queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x2a')]=null;queues[_0x3e7b1b[_0xc959('0x3')]]['queuecallerexit']=![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x8')]=null;queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x2d')]=null;queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x3e')]=!![];queues[_0x3e7b1b[_0xc959('0x3')]][_0xc959('0x7')]=_0x3e7b1b[_0xc959('0x3d')];queues[_0x3e7b1b['uniqueid']][_0xc959('0x5')]=_0x3e7b1b[_0xc959('0x3c')];}}catch(_0x53aff6){utils[_0xc959('0x17')](util['format'](_0xc959('0x3b'),_0x3e7b1b[_0xc959('0x3')]),_0x53aff6);}};exports[_0xc959('0x3f')]=function(_0x2b24ae){try{if(!_['isNil'](queues[_0x2b24ae[_0xc959('0x3')]])){if(queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x1a')]){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x40'),_0x2b24ae[_0xc959('0x3')]),_0x2b24ae);queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x1b')]=![];queues[_0x2b24ae['uniqueid']][_0xc959('0x1b')]=![];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x2a')]=null;queues[_0x2b24ae[_0xc959('0x3')]]['queuecallerexit']=![];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x2d')]=null;queues[_0x2b24ae['uniqueid']][_0xc959('0x3e')]=!![];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x5')]=_0x2b24ae[_0xc959('0x3c')];queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x1d')]=!![];queues[_0x2b24ae[_0xc959('0x3')]]['queuecallercompleteAt']=utils[_0xc959('0x16')]();if(_0x2b24ae['reason']==_0xc959('0x41')){if(!queues[_0x2b24ae[_0xc959('0x3')]][_0xc959('0x41')]){queues[_0x2b24ae[_0xc959('0x3')]]['queuecallerexitreason']=_0xc959('0x42');}}else{queues[_0x2b24ae[_0xc959('0x3')]]['queuecallerexitreason']='COMPLETEDBY'+_0x2b24ae['reason'][_0xc959('0x28')]();}utils['info'](util['format'](_0xc959('0x43'),_0x2b24ae['uniqueid'],queues[_0x2b24ae['uniqueid']][_0xc959('0x21')],_0x2b24ae[_0xc959('0x3c')],queues[_0x2b24ae['uniqueid']][_0xc959('0x8')]));writeDB(queues[_0x2b24ae['uniqueid']]);}}}catch(_0x3d33a3){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x40'),_0x2b24ae[_0xc959('0x3')]),_0x3d33a3);}};exports[_0xc959('0x44')]=function(_0x2317b5){try{if(!_[_0xc959('0x18')](queues[_0x2317b5[_0xc959('0x45')]])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x46'),_0x2317b5[_0xc959('0x3')]),_0x2317b5);queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x41')]=!![];queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x47')]='BLIND';queues[_0x2317b5['transfereeuniqueid']][_0xc959('0x48')]=_0x2317b5[_0xc959('0x49')];queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x4a')]=_0x2317b5[_0xc959('0x45')];queues[_0x2317b5[_0xc959('0x45')]][_0xc959('0x8')]=_0xc959('0x4b');utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x4c'),_0x2317b5['uniqueid'],queues[_0x2317b5['transfereeuniqueid']][_0xc959('0x21')],_0x2317b5[_0xc959('0x45')],_0x2317b5[_0xc959('0x49')]));}}catch(_0x12ed11){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x46'),_0x2317b5['uniqueid']),_0x12ed11);}};exports['attendedtransfer']=function(_0x22da07){try{utils[_0xc959('0x11')](util[_0xc959('0x13')]('[%s][queues][attendedtransfer]',_0x22da07[_0xc959('0x4d')]),_0x22da07);if(_0x22da07[_0xc959('0x4d')]==_0x22da07[_0xc959('0x4e')]){if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4f')]])){utils['info'](util[_0xc959('0x13')](_0xc959('0x50'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x21')],_0x22da07['origtransfererexten']));queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x41')]=!![];queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x47')]=_0xc959('0x51');queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x48')]=_0x22da07['origtransfererexten'];queues[_0x22da07['secondtransfererlinkedid']]['transferuniqueid']=_0x22da07[_0xc959('0x4d')];queues[_0x22da07[_0xc959('0x4f')]]['queuecallerexitreason']=_0xc959('0x52');}if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4e')]])){if(_0x22da07[_0xc959('0x53')]&&queues[_0x22da07['transfereelinkedid']]){queues[_0x22da07[_0xc959('0x53')]][_0xc959('0x23')]=0x1;queues[_0x22da07[_0xc959('0x45')]]=_[_0xc959('0x54')](queues[_0x22da07[_0xc959('0x53')]]);queues[_0x22da07[_0xc959('0x45')]][_0xc959('0xf')]=_0x22da07['transfertargetuniqueid'];queues[_0x22da07['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x6')]=queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x6')];queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x55')]=queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x55')];queues[_0x22da07[_0xc959('0x45')]]['queuecallerjoinAt']=utils[_0xc959('0x16')]();queues[_0x22da07[_0xc959('0x45')]]['queuecallerleaveAt']=utils[_0xc959('0x16')]();queues[_0x22da07['transfereeuniqueid']][_0xc959('0x56')]=0x0;queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x57')]=0x0;utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x58'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x45')]]['name'],queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x6')],queues[_0x22da07[_0xc959('0x45')]][_0xc959('0x55')]));}else{utils[_0xc959('0x1')](util[_0xc959('0x13')](_0xc959('0x59'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07['origtransfererlinkedid']][_0xc959('0x21')],_0x22da07[_0xc959('0x4f')]));queues[_0x22da07[_0xc959('0x4e')]]['transfereduniqueid']=_0x22da07['secondtransfererlinkedid'];}}}else if(_0x22da07['secondtransfereruniqueid']==_0x22da07[_0xc959('0x4f')]){if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4e')]])){utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x4e')]]['name'],_0x22da07[_0xc959('0x5a')],_0x22da07[_0xc959('0x5b')]));queues[_0x22da07[_0xc959('0x4e')]]['transfer']=!![];queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x47')]=_0xc959('0x51');queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x48')]=_0x22da07[_0xc959('0x5b')];queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x4a')]=_0x22da07['secondtransfereruniqueid'];queues[_0x22da07['origtransfererlinkedid']]['queuecallerexitreason']=_0xc959('0x52');}if(!_[_0xc959('0x18')](queues[_0x22da07[_0xc959('0x4f')]])){if(_0x22da07['transfertargetlinkedid']&&queues[_0x22da07[_0xc959('0x5c')]]){queues[_0x22da07[_0xc959('0x5c')]][_0xc959('0x23')]=0x1;queues[_0x22da07[_0xc959('0x5d')]]=_[_0xc959('0x54')](queues[_0x22da07[_0xc959('0x5c')]]);queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0xf')]=_0x22da07[_0xc959('0x5d')];queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x23')]=0x2;queues[_0x22da07['transfertargetuniqueid']][_0xc959('0x6')]=queues[_0x22da07['origtransfererlinkedid']][_0xc959('0x6')];queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x55')]=queues[_0x22da07[_0xc959('0x4e')]][_0xc959('0x55')];queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x38')]=utils[_0xc959('0x16')]();queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x1a')]=utils[_0xc959('0x16')]();queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x56')]=0x0;queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x57')]=0x0;utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x22da07['origtransfereruniqueid'],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x21')],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0xf')],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x6')],queues[_0x22da07[_0xc959('0x5d')]][_0xc959('0x55')]));}else{utils['info'](util['format'](_0xc959('0x59'),_0x22da07[_0xc959('0x4d')],queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0x21')],_0x22da07[_0xc959('0x4e')]));queues[_0x22da07[_0xc959('0x4f')]][_0xc959('0xf')]=_0x22da07[_0xc959('0x4e')];}}}}catch(_0x5f442f){utils['error'](util[_0xc959('0x13')](_0xc959('0x5e'),_0x22da07['origtransfereruniqueid']),_0x5f442f);}};exports['musiconholdstart']=function(_0x5a6148){try{if(!_['isNil'](queues[_0x5a6148['uniqueid']])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x5f'),_0x5a6148[_0xc959('0x3')]),_0x5a6148);queues[_0x5a6148['uniqueid']][_0xc959('0x60')]=utils[_0xc959('0x16')]();utils[_0xc959('0x1')](util['format'](_0xc959('0x61'),_0x5a6148[_0xc959('0x3')],queues[_0x5a6148[_0xc959('0x3')]][_0xc959('0x21')],queues[_0x5a6148[_0xc959('0x3')]][_0xc959('0x60')]));}}catch(_0x2864cb){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x5f'),_0x5a6148[_0xc959('0x3')]),_0x2864cb);}};exports[_0xc959('0x62')]=function(_0x213a85){try{if(!_[_0xc959('0x18')](queues[_0x213a85[_0xc959('0x3')]])){if(!_[_0xc959('0x18')](queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x60')])){utils[_0xc959('0x11')](util[_0xc959('0x13')](_0xc959('0x63'),_0x213a85[_0xc959('0x3')]),_0x213a85);queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x57')]+=utils[_0xc959('0x37')](utils[_0xc959('0x16')](),queues[_0x213a85[_0xc959('0x3')]]['musiconholdstartAt']);utils[_0xc959('0x1')](util[_0xc959('0x13')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x213a85[_0xc959('0x3')],queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x21')],queues[_0x213a85['uniqueid']][_0xc959('0x57')]));delete queues[_0x213a85[_0xc959('0x3')]][_0xc959('0x60')];}}}catch(_0x202efb){utils[_0xc959('0x17')](util[_0xc959('0x13')](_0xc959('0x63'),_0x213a85[_0xc959('0x3')]),_0x202efb);}}; \ No newline at end of file +var _0x5eca=['musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','toUpperCase','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','lastAssignedTo','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime'];(function(_0x123be2,_0x547a9e){var _0x47fd4c=function(_0x133bbb){while(--_0x133bbb){_0x123be2['push'](_0x123be2['shift']());}};_0x47fd4c(++_0x547a9e);}(_0x5eca,0x19a));var _0xa5ec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5eca[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xa5ec('0x0'));var util=require('util');var utils=require(_0xa5ec('0x1'));var queues={};function writeDB(_0x2bbd71){utils[_0xa5ec('0x2')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x2bbd71[_0xa5ec('0x3')],_0x2bbd71[_0xa5ec('0x4')],_0x2bbd71[_0xa5ec('0x5')],_0x2bbd71['lastAssignedTo'],_0x2bbd71[_0xa5ec('0x6')],_0x2bbd71[_0xa5ec('0x7')],_0x2bbd71[_0xa5ec('0x8')]));if(_0x2bbd71['queue']){utils[_0xa5ec('0x9')](_0x2bbd71[_0xa5ec('0x5')])[_0xa5ec('0xa')](function(_0x4b4a6a){if(_0x4b4a6a){_0x2bbd71[_0xa5ec('0xb')]=_0x4b4a6a[_0xa5ec('0xb')];}utils[_0xa5ec('0xc')](_0xa5ec('0xd'),_0x2bbd71);});}else{utils[_0xa5ec('0xc')](_0xa5ec('0xd'),_0x2bbd71);}if(_0x2bbd71['transfereduniqueid']){delete queues[_0x2bbd71[_0xa5ec('0xe')]];}else{delete queues[_0x2bbd71[_0xa5ec('0x3')]];}}exports[_0xa5ec('0xf')]=function(_0x37840b){try{utils[_0xa5ec('0x10')](util[_0xa5ec('0x11')](_0xa5ec('0x12'),_0x37840b[_0xa5ec('0x3')]),_0x37840b);utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')](_0xa5ec('0x13'),_0x37840b[_0xa5ec('0x3')],_0x37840b[_0xa5ec('0x5')],_0x37840b[_0xa5ec('0x14')]));queues[_0x37840b['uniqueid']]=_[_0xa5ec('0x15')](_0x37840b,{'originalposition':_0x37840b[_0xa5ec('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x328f88){utils[_0xa5ec('0x16')](util[_0xa5ec('0x11')](_0xa5ec('0x12'),_0x37840b[_0xa5ec('0x3')]),_0x328f88);}};exports['hangup']=function(_0x5cdd41){try{if(!_['isNil'](queues[_0x5cdd41[_0xa5ec('0x3')]])){utils['debug'](util[_0xa5ec('0x11')]('[%s][queues][hangup]',_0x5cdd41['uniqueid']),_0x5cdd41);if(queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x17')]){if(!queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x18')]&&!queues[_0x5cdd41['uniqueid']][_0xa5ec('0x19')]){queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x1a')]=!![];queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x1b')]=utils['now']();queues[_0x5cdd41['uniqueid']]['queuecallerexitreason']=_0xa5ec('0x1c');}utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')](_0xa5ec('0x1d'),_0x5cdd41[_0xa5ec('0x3')],queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x1e')],queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x8')]));writeDB(queues[_0x5cdd41['uniqueid']]);}else if(queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0xe')]){utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5cdd41[_0xa5ec('0x3')],queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0x1e')],queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0xe')]));queues[queues[_0x5cdd41[_0xa5ec('0x3')]][_0xa5ec('0xe')]]=queues[_0x5cdd41[_0xa5ec('0x3')]];queues[queues[_0x5cdd41['uniqueid']][_0xa5ec('0xe')]][_0xa5ec('0x1f')]=0x2;delete queues[_0x5cdd41[_0xa5ec('0x3')]];}}}catch(_0x4b1492){utils[_0xa5ec('0x16')](util['format'](_0xa5ec('0x20'),_0x5cdd41[_0xa5ec('0x3')]),_0x4b1492);}};exports[_0xa5ec('0x21')]=function(_0x50b1db){try{utils[_0xa5ec('0x10')](util['format'](_0xa5ec('0x22'),_0x50b1db[_0xa5ec('0x3')]),_0x50b1db);if(!_[_0xa5ec('0x23')](_0x50b1db[_0xa5ec('0x24')]['queuestatus'])&&_0x50b1db[_0xa5ec('0x25')]['toUpperCase']()!==_0xa5ec('0x26')){if(!_[_0xa5ec('0x23')](queues[_0x50b1db['uniqueid']])){queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x18')]=![];queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x27')]=null;queues[_0x50b1db[_0xa5ec('0x3')]]['queuecallerexit']=!![];queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x28')]=utils[_0xa5ec('0x29')]();queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x8')]=_0x50b1db['value'][_0xa5ec('0x2a')]();utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x50b1db[_0xa5ec('0x3')],queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x1e')],_0x50b1db[_0xa5ec('0x25')],queues[_0x50b1db[_0xa5ec('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x50b1db[_0xa5ec('0x3')]]);}}else if(!_[_0xa5ec('0x23')](_0x50b1db[_0xa5ec('0x24')][_0xa5ec('0x2b')])){if(!_[_0xa5ec('0x23')](queues[_0x50b1db[_0xa5ec('0x3')]])&&!queues[_0x50b1db[_0xa5ec('0x3')]]['queuecallerabandon']){queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x18')]=![];queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x27')]=null;queues[_0x50b1db['uniqueid']][_0xa5ec('0x19')]=!![];queues[_0x50b1db['uniqueid']]['queuecallerexitAt']=utils[_0xa5ec('0x29')]();queues[_0x50b1db[_0xa5ec('0x3')]][_0xa5ec('0x8')]=_0xa5ec('0x2c');utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x50b1db[_0xa5ec('0x3')],queues[_0x50b1db['uniqueid']][_0xa5ec('0x1e')],_0x50b1db[_0xa5ec('0x25')],queues[_0x50b1db['uniqueid']]['queuecallerexitreason']));}}}catch(_0x38470){utils[_0xa5ec('0x16')](util['format']('[%s][queues][varset]',_0x50b1db[_0xa5ec('0x3')]),_0x38470);}};exports[_0xa5ec('0x18')]=function(_0x19806f){try{if(!_[_0xa5ec('0x23')](queues[_0x19806f[_0xa5ec('0x3')]])){utils[_0xa5ec('0x10')](util[_0xa5ec('0x11')](_0xa5ec('0x2d'),_0x19806f[_0xa5ec('0x3')]),_0x19806f);queues[_0x19806f['uniqueid']]['queuecallerexit']=![];queues[_0x19806f['uniqueid']][_0xa5ec('0x28')]=null;queues[_0x19806f[_0xa5ec('0x3')]][_0xa5ec('0x18')]=!![];queues[_0x19806f['uniqueid']]['queuecallerabandonAt']=utils[_0xa5ec('0x29')]();queues[_0x19806f[_0xa5ec('0x3')]]['queuecallerexitreason']=_0xa5ec('0x2e');utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x19806f['uniqueid'],queues[_0x19806f[_0xa5ec('0x3')]][_0xa5ec('0x1e')],queues[_0x19806f[_0xa5ec('0x3')]][_0xa5ec('0x8')]));}}catch(_0x1f81ca){utils[_0xa5ec('0x16')](util['format']('[%s][queues][queuecallerabandon]',_0x19806f['uniqueid']),_0x1f81ca);}};exports['queuecallerleave']=function(_0x508048){try{if(!_['isNil'](queues[_0x508048[_0xa5ec('0x3')]])){utils[_0xa5ec('0x10')](util[_0xa5ec('0x11')](_0xa5ec('0x2f'),_0x508048[_0xa5ec('0x3')]),_0x508048);utils['info'](util[_0xa5ec('0x11')](_0xa5ec('0x30'),_0x508048[_0xa5ec('0x3')],queues[_0x508048[_0xa5ec('0x3')]][_0xa5ec('0x1e')],_0x508048[_0xa5ec('0x31')],_0x508048['connectedlinename']));queues[_0x508048[_0xa5ec('0x3')]][_0xa5ec('0x32')]=!![];queues[_0x508048[_0xa5ec('0x3')]][_0xa5ec('0x17')]=utils[_0xa5ec('0x29')]();queues[_0x508048['uniqueid']][_0xa5ec('0x33')]=utils[_0xa5ec('0x34')](queues[_0x508048[_0xa5ec('0x3')]]['queuecallerleaveAt'],queues[_0x508048[_0xa5ec('0x3')]][_0xa5ec('0x35')]);queues[_0x508048[_0xa5ec('0x3')]][_0xa5ec('0x14')]=_0x508048['position'];queues[_0x508048[_0xa5ec('0x3')]][_0xa5ec('0x36')]=_0x508048[_0xa5ec('0x36')];queues[_0x508048[_0xa5ec('0x3')]]['connectedlinenum']=_0x508048[_0xa5ec('0x31')];queues[_0x508048['uniqueid']][_0xa5ec('0x37')]=_0x508048[_0xa5ec('0x37')];}}catch(_0x20ac9d){utils['error'](util[_0xa5ec('0x11')](_0xa5ec('0x2f'),_0x508048['uniqueid']),_0x20ac9d);}};exports[_0xa5ec('0x38')]=function(_0x388061){try{if(!_['isNil'](queues[_0x388061[_0xa5ec('0x3')]])){utils['debug'](util['format'](_0xa5ec('0x39'),_0x388061[_0xa5ec('0x3')]),_0x388061);utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x388061[_0xa5ec('0x3')],queues[_0x388061[_0xa5ec('0x3')]][_0xa5ec('0x1e')],_0x388061['membername'],_0x388061[_0xa5ec('0x3a')]));queues[_0x388061['uniqueid']]['queuecallerabandon']=![];queues[_0x388061[_0xa5ec('0x3')]]['queuecallerabandon']=![];queues[_0x388061[_0xa5ec('0x3')]][_0xa5ec('0x27')]=null;queues[_0x388061['uniqueid']][_0xa5ec('0x19')]=![];queues[_0x388061[_0xa5ec('0x3')]][_0xa5ec('0x8')]=null;queues[_0x388061['uniqueid']][_0xa5ec('0x28')]=null;queues[_0x388061[_0xa5ec('0x3')]][_0xa5ec('0x3b')]=!![];queues[_0x388061[_0xa5ec('0x3')]][_0xa5ec('0x7')]=_0x388061[_0xa5ec('0x3a')];queues[_0x388061['uniqueid']]['lastAssignedTo']=_0x388061[_0xa5ec('0x3c')];}}catch(_0x5b8079){utils['error'](util['format'](_0xa5ec('0x39'),_0x388061[_0xa5ec('0x3')]),_0x5b8079);}};exports[_0xa5ec('0x3d')]=function(_0x3d5d82){try{if(!_['isNil'](queues[_0x3d5d82[_0xa5ec('0x3')]])){if(queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x17')]){utils['debug'](util[_0xa5ec('0x11')](_0xa5ec('0x3e'),_0x3d5d82[_0xa5ec('0x3')]),_0x3d5d82);queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x18')]=![];queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x18')]=![];queues[_0x3d5d82[_0xa5ec('0x3')]]['queuecallerabandonAt']=null;queues[_0x3d5d82['uniqueid']]['queuecallerexit']=![];queues[_0x3d5d82[_0xa5ec('0x3')]]['queuecallerexitAt']=null;queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x3b')]=!![];queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x3f')]=_0x3d5d82[_0xa5ec('0x3c')];queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x1a')]=!![];queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x1b')]=utils[_0xa5ec('0x29')]();if(_0x3d5d82['reason']==_0xa5ec('0x40')){if(!queues[_0x3d5d82['uniqueid']][_0xa5ec('0x40')]){queues[_0x3d5d82['uniqueid']][_0xa5ec('0x8')]='TRANSFER';}}else{queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x8')]=_0xa5ec('0x41')+_0x3d5d82['reason']['toUpperCase']();}utils[_0xa5ec('0x2')](util['format'](_0xa5ec('0x42'),_0x3d5d82[_0xa5ec('0x3')],queues[_0x3d5d82[_0xa5ec('0x3')]]['name'],_0x3d5d82[_0xa5ec('0x3c')],queues[_0x3d5d82[_0xa5ec('0x3')]][_0xa5ec('0x8')]));writeDB(queues[_0x3d5d82[_0xa5ec('0x3')]]);}}}catch(_0x1f03fc){utils['error'](util[_0xa5ec('0x11')](_0xa5ec('0x3e'),_0x3d5d82[_0xa5ec('0x3')]),_0x1f03fc);}};exports[_0xa5ec('0x43')]=function(_0x50fb4b){try{if(!_['isNil'](queues[_0x50fb4b[_0xa5ec('0x44')]])){utils['debug'](util[_0xa5ec('0x11')](_0xa5ec('0x45'),_0x50fb4b[_0xa5ec('0x3')]),_0x50fb4b);queues[_0x50fb4b[_0xa5ec('0x44')]][_0xa5ec('0x40')]=!![];queues[_0x50fb4b[_0xa5ec('0x44')]][_0xa5ec('0x46')]=_0xa5ec('0x47');queues[_0x50fb4b[_0xa5ec('0x44')]]['transferexten']=_0x50fb4b['extension'];queues[_0x50fb4b[_0xa5ec('0x44')]][_0xa5ec('0x48')]=_0x50fb4b['transfereeuniqueid'];queues[_0x50fb4b[_0xa5ec('0x44')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')](_0xa5ec('0x49'),_0x50fb4b['uniqueid'],queues[_0x50fb4b[_0xa5ec('0x44')]][_0xa5ec('0x1e')],_0x50fb4b['transfereeuniqueid'],_0x50fb4b[_0xa5ec('0x4a')]));}}catch(_0x3eccc2){utils[_0xa5ec('0x16')](util[_0xa5ec('0x11')](_0xa5ec('0x45'),_0x50fb4b[_0xa5ec('0x3')]),_0x3eccc2);}};exports[_0xa5ec('0x4b')]=function(_0x57dd3d){try{utils[_0xa5ec('0x10')](util['format'](_0xa5ec('0x4c'),_0x57dd3d[_0xa5ec('0x4d')]),_0x57dd3d);if(_0x57dd3d[_0xa5ec('0x4d')]==_0x57dd3d['origtransfererlinkedid']){if(!_['isNil'](queues[_0x57dd3d[_0xa5ec('0x4e')]])){utils['info'](util[_0xa5ec('0x11')](_0xa5ec('0x4f'),_0x57dd3d[_0xa5ec('0x4d')],queues[_0x57dd3d[_0xa5ec('0x4e')]][_0xa5ec('0x1e')],_0x57dd3d[_0xa5ec('0x50')]));queues[_0x57dd3d['secondtransfererlinkedid']]['transfer']=!![];queues[_0x57dd3d[_0xa5ec('0x4e')]]['transfertype']=_0xa5ec('0x51');queues[_0x57dd3d['secondtransfererlinkedid']][_0xa5ec('0x52')]=_0x57dd3d[_0xa5ec('0x50')];queues[_0x57dd3d['secondtransfererlinkedid']][_0xa5ec('0x48')]=_0x57dd3d[_0xa5ec('0x4d')];queues[_0x57dd3d[_0xa5ec('0x4e')]][_0xa5ec('0x8')]=_0xa5ec('0x53');}if(!_['isNil'](queues[_0x57dd3d[_0xa5ec('0x54')]])){if(_0x57dd3d['transfereelinkedid']&&queues[_0x57dd3d['transfereelinkedid']]){queues[_0x57dd3d[_0xa5ec('0x55')]][_0xa5ec('0x1f')]=0x1;queues[_0x57dd3d[_0xa5ec('0x44')]]=_[_0xa5ec('0x56')](queues[_0x57dd3d[_0xa5ec('0x55')]]);queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0xe')]=_0x57dd3d[_0xa5ec('0x57')];queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0x1f')]=0x2;queues[_0x57dd3d[_0xa5ec('0x44')]]['calleridnum']=queues[_0x57dd3d[_0xa5ec('0x4e')]][_0xa5ec('0x6')];queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0x58')]=queues[_0x57dd3d['secondtransfererlinkedid']][_0xa5ec('0x58')];queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0x35')]=utils['now']();queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0x17')]=utils[_0xa5ec('0x29')]();queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0x33')]=0x0;queues[_0x57dd3d[_0xa5ec('0x44')]]['mohtime']=0x0;utils['info'](util['format'](_0xa5ec('0x59'),_0x57dd3d[_0xa5ec('0x4d')],queues[_0x57dd3d['transfereeuniqueid']]['name'],queues[_0x57dd3d['transfereeuniqueid']][_0xa5ec('0x6')],queues[_0x57dd3d[_0xa5ec('0x44')]][_0xa5ec('0x58')]));}else{utils['info'](util[_0xa5ec('0x11')](_0xa5ec('0x5a'),_0x57dd3d[_0xa5ec('0x4d')],queues[_0x57dd3d[_0xa5ec('0x54')]][_0xa5ec('0x1e')],_0x57dd3d['secondtransfererlinkedid']));queues[_0x57dd3d['origtransfererlinkedid']][_0xa5ec('0xe')]=_0x57dd3d[_0xa5ec('0x4e')];}}}else if(_0x57dd3d[_0xa5ec('0x5b')]==_0x57dd3d['secondtransfererlinkedid']){if(!_[_0xa5ec('0x23')](queues[_0x57dd3d['origtransfererlinkedid']])){utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x57dd3d[_0xa5ec('0x4d')],queues[_0x57dd3d['origtransfererlinkedid']]['name'],_0x57dd3d[_0xa5ec('0x5b')],_0x57dd3d[_0xa5ec('0x5c')]));queues[_0x57dd3d[_0xa5ec('0x54')]]['transfer']=!![];queues[_0x57dd3d[_0xa5ec('0x54')]][_0xa5ec('0x46')]='ATTENDED';queues[_0x57dd3d['origtransfererlinkedid']][_0xa5ec('0x52')]=_0x57dd3d[_0xa5ec('0x5c')];queues[_0x57dd3d[_0xa5ec('0x54')]][_0xa5ec('0x48')]=_0x57dd3d[_0xa5ec('0x5b')];queues[_0x57dd3d[_0xa5ec('0x54')]][_0xa5ec('0x8')]=_0xa5ec('0x53');}if(!_[_0xa5ec('0x23')](queues[_0x57dd3d['secondtransfererlinkedid']])){if(_0x57dd3d[_0xa5ec('0x5d')]&&queues[_0x57dd3d[_0xa5ec('0x5d')]]){queues[_0x57dd3d[_0xa5ec('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x57dd3d[_0xa5ec('0x57')]]=_[_0xa5ec('0x56')](queues[_0x57dd3d[_0xa5ec('0x5d')]]);queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0xe')]=_0x57dd3d[_0xa5ec('0x57')];queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0x1f')]=0x2;queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0x6')]=queues[_0x57dd3d[_0xa5ec('0x54')]][_0xa5ec('0x6')];queues[_0x57dd3d[_0xa5ec('0x57')]]['calleridname']=queues[_0x57dd3d[_0xa5ec('0x54')]][_0xa5ec('0x58')];queues[_0x57dd3d['transfertargetuniqueid']][_0xa5ec('0x35')]=utils[_0xa5ec('0x29')]();queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0x17')]=utils[_0xa5ec('0x29')]();queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0x33')]=0x0;queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0x5e')]=0x0;utils['info'](util[_0xa5ec('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x57dd3d[_0xa5ec('0x4d')],queues[_0x57dd3d[_0xa5ec('0x57')]]['name'],queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0xe')],queues[_0x57dd3d[_0xa5ec('0x57')]][_0xa5ec('0x6')],queues[_0x57dd3d['transfertargetuniqueid']][_0xa5ec('0x58')]));}else{utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')](_0xa5ec('0x5a'),_0x57dd3d[_0xa5ec('0x4d')],queues[_0x57dd3d[_0xa5ec('0x4e')]][_0xa5ec('0x1e')],_0x57dd3d[_0xa5ec('0x54')]));queues[_0x57dd3d['secondtransfererlinkedid']][_0xa5ec('0xe')]=_0x57dd3d[_0xa5ec('0x54')];}}}}catch(_0x780df8){utils[_0xa5ec('0x16')](util[_0xa5ec('0x11')](_0xa5ec('0x4c'),_0x57dd3d[_0xa5ec('0x4d')]),_0x780df8);}};exports[_0xa5ec('0x5f')]=function(_0x15fe1f){try{if(!_[_0xa5ec('0x23')](queues[_0x15fe1f[_0xa5ec('0x3')]])){utils[_0xa5ec('0x10')](util['format'](_0xa5ec('0x60'),_0x15fe1f[_0xa5ec('0x3')]),_0x15fe1f);queues[_0x15fe1f['uniqueid']][_0xa5ec('0x61')]=utils[_0xa5ec('0x29')]();utils[_0xa5ec('0x2')](util[_0xa5ec('0x11')](_0xa5ec('0x62'),_0x15fe1f[_0xa5ec('0x3')],queues[_0x15fe1f[_0xa5ec('0x3')]]['name'],queues[_0x15fe1f[_0xa5ec('0x3')]][_0xa5ec('0x61')]));}}catch(_0x37cb95){utils[_0xa5ec('0x16')](util['format'](_0xa5ec('0x60'),_0x15fe1f[_0xa5ec('0x3')]),_0x37cb95);}};exports[_0xa5ec('0x63')]=function(_0x1b9ae2){try{if(!_[_0xa5ec('0x23')](queues[_0x1b9ae2[_0xa5ec('0x3')]])){if(!_['isNil'](queues[_0x1b9ae2['uniqueid']][_0xa5ec('0x61')])){utils['debug'](util['format'](_0xa5ec('0x64'),_0x1b9ae2['uniqueid']),_0x1b9ae2);queues[_0x1b9ae2['uniqueid']][_0xa5ec('0x5e')]+=utils[_0xa5ec('0x34')](utils[_0xa5ec('0x29')](),queues[_0x1b9ae2[_0xa5ec('0x3')]]['musiconholdstartAt']);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x1b9ae2[_0xa5ec('0x3')],queues[_0x1b9ae2[_0xa5ec('0x3')]][_0xa5ec('0x1e')],queues[_0x1b9ae2[_0xa5ec('0x3')]][_0xa5ec('0x5e')]));delete queues[_0x1b9ae2[_0xa5ec('0x3')]][_0xa5ec('0x61')];}}}catch(_0x4fec5d){utils[_0xa5ec('0x16')](util[_0xa5ec('0x11')]('[%s][queues][musiconholdstop]',_0x1b9ae2[_0xa5ec('0x3')]),_0x4fec5d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 78e143e..39d61bd 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 _0x5aac=['mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','linkedid','format','context','exten','channel','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable'];(function(_0x44a329,_0x45f280){var _0x45f2a3=function(_0x272e62){while(--_0x272e62){_0x44a329['push'](_0x44a329['shift']());}};_0x45f2a3(++_0x45f280);}(_0x5aac,0x6e));var _0xc5aa=function(_0x39550b,_0x58fc71){_0x39550b=_0x39550b-0x0;var _0x1a347f=_0x5aac[_0x39550b];return _0x1a347f;};'use strict';var _=require(_0xc5aa('0x0'));var util=require(_0xc5aa('0x1'));var utils=require(_0xc5aa('0x2'));var transfers=require(_0xc5aa('0x3'));var recordings={};function writeDB(_0x3f90aa){var _0x5df0a3;utils[_0xc5aa('0x4')](util['format'](_0xc5aa('0x5'),_0x3f90aa['uniqueid']));if(transfers[_0xc5aa('0x6')][_0x3f90aa[_0xc5aa('0x7')]]){_0x5df0a3=_0x3f90aa[_0xc5aa('0x7')];_0x3f90aa['uniqueid']=transfers[_0xc5aa('0x6')][_0x3f90aa[_0xc5aa('0x7')]][_0xc5aa('0x8')];}if(_0x3f90aa[_0xc5aa('0x9')]){utils[_0xc5aa('0xa')](_0x3f90aa[_0xc5aa('0x9')])[_0xc5aa('0xb')](function(_0x4b4566){if(_0x4b4566){_0x3f90aa[_0xc5aa('0xc')]=_0x4b4566[_0xc5aa('0xd')];_0x3f90aa['UserId']=_0x4b4566['id'];}utils[_0xc5aa('0xe')]('CreateVoiceRecording',_0x3f90aa);});}else{utils['request'](_0xc5aa('0xf'),_0x3f90aa);}if(_0x5df0a3)delete transfers[_0xc5aa('0x6')][_0x5df0a3];}exports[_0xc5aa('0x10')]=function(_0x3e6fc6){try{utils[_0xc5aa('0x11')](util['format']('[%s][recordings][newchannel]',_0x3e6fc6[_0xc5aa('0x7')]),_0x3e6fc6);if(_0x3e6fc6[_0xc5aa('0x7')]==_0x3e6fc6[_0xc5aa('0x12')]){utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3e6fc6['uniqueid'],_0x3e6fc6[_0xc5aa('0x14')],_0x3e6fc6[_0xc5aa('0x15')]));recordings[_0x3e6fc6[_0xc5aa('0x7')]]={'uniqueid':_0x3e6fc6[_0xc5aa('0x7')],'accountcode':_0x3e6fc6[_0xc5aa('0x9')],'exten':_0x3e6fc6[_0xc5aa('0x15')],'context':_0x3e6fc6[_0xc5aa('0x14')],'channel':_0x3e6fc6[_0xc5aa('0x16')],'monitors':[]};}}catch(_0x4aaa66){utils['error'](util[_0xc5aa('0x13')](_0xc5aa('0x17'),_0x3e6fc6[_0xc5aa('0x7')]),_0x4aaa66);}};exports['newstate']=function(_0x1f3f00){try{utils['debug'](util[_0xc5aa('0x13')](_0xc5aa('0x18'),_0x1f3f00[_0xc5aa('0x7')]),_0x1f3f00);if(!_[_0xc5aa('0x19')](recordings[_0x1f3f00['uniqueid']])&&_0x1f3f00[_0xc5aa('0x1a')]==0x6){utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x1b'),_0x1f3f00[_0xc5aa('0x7')],_0x1f3f00['context'],_0x1f3f00['channel']));}else if(!_[_0xc5aa('0x19')](recordings[_0x1f3f00[_0xc5aa('0x12')]])&&_0x1f3f00[_0xc5aa('0x1a')]==0x6&&_0x1f3f00[_0xc5aa('0x14')]!=_0xc5aa('0x1c')){utils[_0xc5aa('0x4')](util['format'](_0xc5aa('0x1d'),_0x1f3f00['uniqueid'],_0x1f3f00[_0xc5aa('0x12')],_0x1f3f00[_0xc5aa('0x14')],_0x1f3f00[_0xc5aa('0x16')]));recordings[_0x1f3f00['linkedid']][_0xc5aa('0x9')]=_0x1f3f00[_0xc5aa('0x9')];}}catch(_0x37b6e9){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x18'),_0x1f3f00[_0xc5aa('0x7')]),_0x37b6e9);}};exports['varset']=function(_0x1ca2e8){try{if(!_[_0xc5aa('0x19')](_0x1ca2e8['variable'])&&!_[_0xc5aa('0x19')](_0x1ca2e8[_0xc5aa('0x1f')][_0xc5aa('0x20')])){utils[_0xc5aa('0x11')](util['format'](_0xc5aa('0x21'),_0x1ca2e8[_0xc5aa('0x7')]),_0x1ca2e8);utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x22'),_0x1ca2e8[_0xc5aa('0x7')],_0x1ca2e8[_0xc5aa('0x1f')],_0x1ca2e8[_0xc5aa('0x23')]));if(_[_0xc5aa('0x24')](_0x1ca2e8[_0xc5aa('0x23')],'.wav49')){_0x1ca2e8['value']=_0x1ca2e8[_0xc5aa('0x23')][_0xc5aa('0x25')](_0xc5aa('0x26'),_0xc5aa('0x27'));}if(recordings[_0x1ca2e8[_0xc5aa('0x12')]]){var _0x4e2138=_[_0xc5aa('0x28')](recordings[_0x1ca2e8[_0xc5aa('0x12')]][_0xc5aa('0x29')],{'value':_0x1ca2e8[_0xc5aa('0x23')]});if(_['isNil'](_0x4e2138)){recordings[_0x1ca2e8[_0xc5aa('0x12')]][_0xc5aa('0x29')]['push']({'value':_0x1ca2e8[_0xc5aa('0x23')]});}}}}catch(_0x2be8df){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x21'),_0x1ca2e8[_0xc5aa('0x7')]),_0x2be8df);}};exports[_0xc5aa('0x2a')]=function(_0x3eed9e){try{if(!_['isNil'](recordings[_0x3eed9e['uniqueid']])){utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')]('[%s][recordings][hangup]',_0x3eed9e[_0xc5aa('0x7')]),_0x3eed9e);utils[_0xc5aa('0x4')](util['format'](_0xc5aa('0x2b'),_0x3eed9e['uniqueid'],_0x3eed9e[_0xc5aa('0x2c')],_0x3eed9e[_0xc5aa('0x2d')],_0x3eed9e[_0xc5aa('0x2e')]));recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x2c')]=_0x3eed9e[_0xc5aa('0x2c')];recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x2d')]=_0x3eed9e[_0xc5aa('0x2d')];recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x2f')]=_0x3eed9e[_0xc5aa('0x2f')];recordings[_0x3eed9e[_0xc5aa('0x7')]]['connectedlinename']=_0x3eed9e['connectedlinename'];if(recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x30')]==_0xc5aa('0x31')&&recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x9')]){recordings[_0x3eed9e['uniqueid']]['connectedlinenum']=recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x9')];recordings[_0x3eed9e[_0xc5aa('0x7')]][_0xc5aa('0x32')]='';}recordings[_0x3eed9e['uniqueid']][_0xc5aa('0x29')]['forEach'](function(_0x2af5d4){var _0x24e918=_[_0xc5aa('0x33')](recordings[_0x3eed9e['uniqueid']]);_0x24e918['value']=_0x2af5d4[_0xc5aa('0x23')];writeDB(_0x24e918);});delete recordings[_0x3eed9e[_0xc5aa('0x7')]];}}catch(_0x2c2bf8){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x34'),_0x3eed9e[_0xc5aa('0x7')]),_0x2c2bf8);}};exports['newexten']=function(_0x55cf1d){try{if(!_[_0xc5aa('0x19')](recordings[_0x55cf1d['uniqueid']])){utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')](_0xc5aa('0x35'),_0x55cf1d[_0xc5aa('0x7')]),_0x55cf1d);utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x36'),_0x55cf1d['uniqueid'],_0x55cf1d[_0xc5aa('0x37')],_0x55cf1d[_0xc5aa('0x38')]));if(_0x55cf1d[_0xc5aa('0x37')][_0xc5aa('0x39')]()==_0xc5aa('0x3a')&&_['startsWith'](_0x55cf1d[_0xc5aa('0x38')][_0xc5aa('0x39')](),'cdr')){var _0x1a7da8=_0x55cf1d['appdata']['split']('=');var _0x3d6baf=_0x1a7da8[0x0]['substring'](_0x1a7da8[0x0][_0xc5aa('0x3b')]('(')+0x1,_0x1a7da8[0x0]['lastIndexOf'](')'));var _0x463676=_0x1a7da8[0x1];recordings[_0x55cf1d['uniqueid']][_0x3d6baf]=_0x463676;}}}catch(_0x5a44a4){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x35'),_0x55cf1d[_0xc5aa('0x7')]),_0x5a44a4);}};exports[_0xc5aa('0x3c')]=function(_0x3bef96){try{if(!_[_0xc5aa('0x19')](recordings[_0x3bef96[_0xc5aa('0x7')]])){utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')](_0xc5aa('0x3d'),_0x3bef96[_0xc5aa('0x7')]),_0x3bef96);utils['info'](util[_0xc5aa('0x13')](_0xc5aa('0x3e'),_0x3bef96[_0xc5aa('0x7')],_0x3bef96['queue']));recordings[_0x3bef96[_0xc5aa('0x7')]][_0xc5aa('0x3f')]=_0x3bef96[_0xc5aa('0x3f')];}}catch(_0x162d91){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x3d'),_0x3bef96[_0xc5aa('0x7')]),_0x162d91);}};exports[_0xc5aa('0x40')]=function(_0x1a3549){try{utils[_0xc5aa('0x11')](util[_0xc5aa('0x13')](_0xc5aa('0x41'),_0x1a3549[_0xc5aa('0x7')]),_0x1a3549);utils[_0xc5aa('0x4')](util[_0xc5aa('0x13')](_0xc5aa('0x42'),_0x1a3549[_0xc5aa('0x7')],_0x1a3549[_0xc5aa('0x43')],_0x1a3549['transferercalleridname'],_0x1a3549['transfereecalleridnum'],_0x1a3549[_0xc5aa('0x44')]));if(recordings[_0x1a3549[_0xc5aa('0x45')]]&&transfers[_0xc5aa('0x6')][_0x1a3549[_0xc5aa('0x45')]]){transfers['blinds'][_0x1a3549[_0xc5aa('0x45')]][_0xc5aa('0x46')]=!![];}}catch(_0x1401f2){utils[_0xc5aa('0x1e')](util[_0xc5aa('0x13')](_0xc5aa('0x41'),_0x1a3549[_0xc5aa('0x7')]),_0x1401f2);}}; \ No newline at end of file +var _0xc7c0=['connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridname','calleridnum','connectedlinenum'];(function(_0x17ade8,_0x932926){var _0x2125c1=function(_0x496ca8){while(--_0x496ca8){_0x17ade8['push'](_0x17ade8['shift']());}};_0x2125c1(++_0x932926);}(_0xc7c0,0x1ac));var _0x0c7c=function(_0x234e39,_0x26332d){_0x234e39=_0x234e39-0x0;var _0x5daa0f=_0xc7c0[_0x234e39];return _0x5daa0f;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x244469){var _0x909494;utils['info'](util[_0x0c7c('0x0')](_0x0c7c('0x1'),_0x244469['uniqueid']));if(transfers[_0x0c7c('0x2')][_0x244469[_0x0c7c('0x3')]]){_0x909494=_0x244469[_0x0c7c('0x3')];_0x244469['uniqueid']=transfers[_0x0c7c('0x2')][_0x244469[_0x0c7c('0x3')]][_0x0c7c('0x4')];}if(_0x244469[_0x0c7c('0x5')]){utils[_0x0c7c('0x6')](_0x244469[_0x0c7c('0x5')])[_0x0c7c('0x7')](function(_0x338f4){if(_0x338f4){_0x244469[_0x0c7c('0x8')]=_0x338f4[_0x0c7c('0x9')];_0x244469[_0x0c7c('0xa')]=_0x338f4['id'];}utils[_0x0c7c('0xb')]('CreateVoiceRecording',_0x244469);});}else{utils[_0x0c7c('0xb')]('CreateVoiceRecording',_0x244469);}if(_0x909494)delete transfers[_0x0c7c('0x2')][_0x909494];}exports['newchannel']=function(_0x2bfcd2){try{utils['debug'](util[_0x0c7c('0x0')]('[%s][recordings][newchannel]',_0x2bfcd2[_0x0c7c('0x3')]),_0x2bfcd2);if(_0x2bfcd2[_0x0c7c('0x3')]==_0x2bfcd2['linkedid']){utils[_0x0c7c('0xc')](util[_0x0c7c('0x0')](_0x0c7c('0xd'),_0x2bfcd2['uniqueid'],_0x2bfcd2['context'],_0x2bfcd2['exten']));recordings[_0x2bfcd2[_0x0c7c('0x3')]]={'uniqueid':_0x2bfcd2[_0x0c7c('0x3')],'accountcode':_0x2bfcd2[_0x0c7c('0x5')],'exten':_0x2bfcd2[_0x0c7c('0xe')],'context':_0x2bfcd2[_0x0c7c('0xf')],'channel':_0x2bfcd2[_0x0c7c('0x10')],'monitors':[]};}}catch(_0x2da067){utils[_0x0c7c('0x11')](util['format']('[%s][recordings][newchannel]',_0x2bfcd2[_0x0c7c('0x3')]),_0x2da067);}};exports['newstate']=function(_0xa469c9){try{utils[_0x0c7c('0x12')](util[_0x0c7c('0x0')](_0x0c7c('0x13'),_0xa469c9['uniqueid']),_0xa469c9);if(!_[_0x0c7c('0x14')](recordings[_0xa469c9[_0x0c7c('0x3')]])&&_0xa469c9[_0x0c7c('0x15')]==0x6){utils[_0x0c7c('0xc')](util[_0x0c7c('0x0')](_0x0c7c('0x16'),_0xa469c9[_0x0c7c('0x3')],_0xa469c9[_0x0c7c('0xf')],_0xa469c9[_0x0c7c('0x10')]));}else if(!_[_0x0c7c('0x14')](recordings[_0xa469c9[_0x0c7c('0x17')]])&&_0xa469c9[_0x0c7c('0x15')]==0x6&&_0xa469c9[_0x0c7c('0xf')]!=_0x0c7c('0x18')){utils[_0x0c7c('0xc')](util['format'](_0x0c7c('0x19'),_0xa469c9[_0x0c7c('0x3')],_0xa469c9['linkedid'],_0xa469c9[_0x0c7c('0xf')],_0xa469c9[_0x0c7c('0x10')]));recordings[_0xa469c9[_0x0c7c('0x17')]][_0x0c7c('0x5')]=_0xa469c9[_0x0c7c('0x5')];}}catch(_0x44acb6){utils[_0x0c7c('0x11')](util[_0x0c7c('0x0')](_0x0c7c('0x13'),_0xa469c9[_0x0c7c('0x3')]),_0x44acb6);}};exports[_0x0c7c('0x1a')]=function(_0x357fd4){try{if(!_['isNil'](_0x357fd4[_0x0c7c('0x1b')])&&!_[_0x0c7c('0x14')](_0x357fd4[_0x0c7c('0x1b')][_0x0c7c('0x1c')])){utils[_0x0c7c('0x12')](util['format'](_0x0c7c('0x1d'),_0x357fd4[_0x0c7c('0x3')]),_0x357fd4);utils[_0x0c7c('0xc')](util[_0x0c7c('0x0')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x357fd4[_0x0c7c('0x3')],_0x357fd4['variable'],_0x357fd4[_0x0c7c('0x1e')]));if(_['endsWith'](_0x357fd4[_0x0c7c('0x1e')],_0x0c7c('0x1f'))){_0x357fd4['value']=_0x357fd4[_0x0c7c('0x1e')][_0x0c7c('0x20')]('.wav49',_0x0c7c('0x21'));}if(recordings[_0x357fd4[_0x0c7c('0x17')]]){var _0x166e74=_[_0x0c7c('0x22')](recordings[_0x357fd4[_0x0c7c('0x17')]][_0x0c7c('0x23')],{'value':_0x357fd4[_0x0c7c('0x1e')]});if(_[_0x0c7c('0x14')](_0x166e74)){recordings[_0x357fd4[_0x0c7c('0x17')]][_0x0c7c('0x23')][_0x0c7c('0x24')]({'value':_0x357fd4[_0x0c7c('0x1e')]});}}}}catch(_0x30ece5){utils[_0x0c7c('0x11')](util[_0x0c7c('0x0')](_0x0c7c('0x1d'),_0x357fd4['uniqueid']),_0x30ece5);}};exports['hangup']=function(_0x6b184a){try{if(!_[_0x0c7c('0x14')](recordings[_0x6b184a[_0x0c7c('0x3')]])){utils['debug'](util[_0x0c7c('0x0')](_0x0c7c('0x25'),_0x6b184a[_0x0c7c('0x3')]),_0x6b184a);utils['info'](util[_0x0c7c('0x0')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x6b184a[_0x0c7c('0x3')],_0x6b184a['calleridnum'],_0x6b184a[_0x0c7c('0x26')],_0x6b184a['cause-txt']));recordings[_0x6b184a['uniqueid']][_0x0c7c('0x27')]=_0x6b184a['calleridnum'];recordings[_0x6b184a[_0x0c7c('0x3')]][_0x0c7c('0x26')]=_0x6b184a['calleridname'];recordings[_0x6b184a[_0x0c7c('0x3')]][_0x0c7c('0x28')]=_0x6b184a[_0x0c7c('0x28')];recordings[_0x6b184a['uniqueid']][_0x0c7c('0x29')]=_0x6b184a['connectedlinename'];if(recordings[_0x6b184a[_0x0c7c('0x3')]][_0x0c7c('0x2a')]=='outbound'&&recordings[_0x6b184a[_0x0c7c('0x3')]]['accountcode']){recordings[_0x6b184a['uniqueid']][_0x0c7c('0x28')]=recordings[_0x6b184a[_0x0c7c('0x3')]][_0x0c7c('0x5')];recordings[_0x6b184a[_0x0c7c('0x3')]]['connectedlinename']='';}recordings[_0x6b184a[_0x0c7c('0x3')]]['monitors'][_0x0c7c('0x2b')](function(_0x380923){var _0x2f16ea=_[_0x0c7c('0x2c')](recordings[_0x6b184a[_0x0c7c('0x3')]]);_0x2f16ea[_0x0c7c('0x1e')]=_0x380923['value'];writeDB(_0x2f16ea);});delete recordings[_0x6b184a['uniqueid']];}}catch(_0x48df65){utils[_0x0c7c('0x11')](util[_0x0c7c('0x0')]('[%s][recordings][hangup]',_0x6b184a[_0x0c7c('0x3')]),_0x48df65);}};exports[_0x0c7c('0x2d')]=function(_0x254661){try{if(!_[_0x0c7c('0x14')](recordings[_0x254661[_0x0c7c('0x3')]])){utils[_0x0c7c('0x12')](util['format'](_0x0c7c('0x2e'),_0x254661[_0x0c7c('0x3')]),_0x254661);utils[_0x0c7c('0xc')](util[_0x0c7c('0x0')](_0x0c7c('0x2f'),_0x254661[_0x0c7c('0x3')],_0x254661['application'],_0x254661[_0x0c7c('0x30')]));if(_0x254661[_0x0c7c('0x31')][_0x0c7c('0x32')]()==_0x0c7c('0x33')&&_['startsWith'](_0x254661[_0x0c7c('0x30')][_0x0c7c('0x32')](),_0x0c7c('0x34'))){var _0x5dc2f4=_0x254661[_0x0c7c('0x30')][_0x0c7c('0x35')]('=');var _0x29df8e=_0x5dc2f4[0x0][_0x0c7c('0x36')](_0x5dc2f4[0x0][_0x0c7c('0x37')]('(')+0x1,_0x5dc2f4[0x0][_0x0c7c('0x37')](')'));var _0x1936c2=_0x5dc2f4[0x1];recordings[_0x254661[_0x0c7c('0x3')]][_0x29df8e]=_0x1936c2;}}}catch(_0x32e3a7){utils[_0x0c7c('0x11')](util[_0x0c7c('0x0')](_0x0c7c('0x2e'),_0x254661[_0x0c7c('0x3')]),_0x32e3a7);}};exports['queuecallerjoin']=function(_0x2459e4){try{if(!_[_0x0c7c('0x14')](recordings[_0x2459e4[_0x0c7c('0x3')]])){utils[_0x0c7c('0x12')](util[_0x0c7c('0x0')](_0x0c7c('0x38'),_0x2459e4[_0x0c7c('0x3')]),_0x2459e4);utils['info'](util[_0x0c7c('0x0')](_0x0c7c('0x39'),_0x2459e4[_0x0c7c('0x3')],_0x2459e4['queue']));recordings[_0x2459e4[_0x0c7c('0x3')]]['queue']=_0x2459e4[_0x0c7c('0x3a')];}}catch(_0x13dbd8){utils[_0x0c7c('0x11')](util[_0x0c7c('0x0')](_0x0c7c('0x38'),_0x2459e4[_0x0c7c('0x3')]),_0x13dbd8);}};exports[_0x0c7c('0x3b')]=function(_0x4770a4){try{utils['debug'](util[_0x0c7c('0x0')](_0x0c7c('0x3c'),_0x4770a4[_0x0c7c('0x3')]),_0x4770a4);utils[_0x0c7c('0xc')](util['format'](_0x0c7c('0x3d'),_0x4770a4[_0x0c7c('0x3')],_0x4770a4[_0x0c7c('0x3e')],_0x4770a4[_0x0c7c('0x3f')],_0x4770a4[_0x0c7c('0x40')],_0x4770a4['transfereecalleridname']));if(recordings[_0x4770a4[_0x0c7c('0x41')]]&&transfers[_0x0c7c('0x2')][_0x4770a4['transfereruniqueid']]){transfers['blinds'][_0x4770a4[_0x0c7c('0x41')]][_0x0c7c('0x42')]=!![];}}catch(_0x13ea10){utils[_0x0c7c('0x11')](util['format']('[%s][recordings][blindtransfer]',_0x4770a4[_0x0c7c('0x3')]),_0x13ea10);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ff6a943..869d8f4 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 _0x6002=['blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds'];(function(_0x4a38d3,_0x4d2235){var _0x39835c=function(_0x125749){while(--_0x125749){_0x4a38d3['push'](_0x4a38d3['shift']());}};_0x39835c(++_0x4d2235);}(_0x6002,0x1ec));var _0x2600=function(_0x19159c,_0xf0c39e){_0x19159c=_0x19159c-0x0;var _0x57691a=_0x6002[_0x19159c];return _0x57691a;};'use strict';var _=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var utils=require(_0x2600('0x2'));function writeDB(_0x1894bf){utils[_0x2600('0x3')](util[_0x2600('0x4')](_0x2600('0x5'),_0x1894bf[_0x2600('0x6')]===_0x2600('0x7')?_0x1894bf[_0x2600('0x8')]:_0x1894bf[_0x2600('0x9')],_0x1894bf['type']));utils['request'](_0x2600('0xa'),_0x1894bf);}exports[_0x2600('0xb')]={};exports[_0x2600('0xc')]=function(_0x9ddd5e){try{utils[_0x2600('0xd')](util[_0x2600('0x4')](_0x2600('0xe'),_0x9ddd5e[_0x2600('0x9')]),_0x9ddd5e);utils[_0x2600('0x3')](util['format'](_0x2600('0xf'),_0x9ddd5e['uniqueid'],_0x9ddd5e[_0x2600('0x10')],_0x9ddd5e['transferercalleridname'],_0x9ddd5e[_0x2600('0x11')],_0x9ddd5e[_0x2600('0x12')]));_0x9ddd5e['type']=_0x2600('0x13');exports['blinds'][_0x9ddd5e[_0x2600('0x14')]]=_0x9ddd5e;writeDB(_0x9ddd5e);}catch(_0x56aec9){utils[_0x2600('0x15')](util[_0x2600('0x4')](_0x2600('0xe'),_0x9ddd5e[_0x2600('0x9')]),_0x56aec9);}};exports[_0x2600('0x16')]=function(_0x2462b1){try{utils['debug'](util[_0x2600('0x4')]('[%s][transfers][attendedtransfer]',_0x2462b1[_0x2600('0x8')]),_0x2462b1);utils[_0x2600('0x3')](util[_0x2600('0x4')](_0x2600('0x17'),_0x2462b1['origtransfereruniqueid'],_0x2462b1[_0x2600('0x18')],_0x2462b1[_0x2600('0x19')],_0x2462b1[_0x2600('0x1a')],_0x2462b1[_0x2600('0x1b')]));_0x2462b1=_[_0x2600('0x1c')](_0x2462b1,{'transfererchannel':_0x2462b1[_0x2600('0x1d')],'transferercalleridnum':_0x2462b1['origtransferercalleridnum'],'transferercalleridname':_0x2462b1['origtransferercalleridname'],'transfererconnectedlinenum':_0x2462b1[_0x2600('0x1e')],'transfererconnectedlinename':_0x2462b1[_0x2600('0x1f')],'transfereraccountcode':_0x2462b1[_0x2600('0x20')],'transferercontext':_0x2462b1[_0x2600('0x21')],'transfererexten':_0x2462b1['secondtransfererexten'],'transfererlinkedid':_0x2462b1[_0x2600('0x22')],'context':_0x2462b1['origtransferercontext'],'extension':_0x2462b1[_0x2600('0x23')],'type':_0x2600('0x7')});if(_['isNil'](_0x2462b1[_0x2600('0x24')])){_0x2462b1=_[_0x2600('0x1c')](_0x2462b1,{'transfereechannel':_0x2462b1['transfertargetchannel'],'transfereecalleridnum':_0x2462b1[_0x2600('0x1a')],'transfereecalleridname':_0x2462b1[_0x2600('0x1b')],'transfereeconnectedlinenum':_0x2462b1[_0x2600('0x25')],'transfereeconnectedlinename':_0x2462b1[_0x2600('0x26')],'transfereeaccountcode':_0x2462b1[_0x2600('0x27')],'transfereecontext':_0x2462b1['transfertargetcontext'],'transfereeexten':_0x2462b1['transfertargetexten'],'transfereelinkedid':_0x2462b1[_0x2600('0x28')]});}writeDB(_0x2462b1);}catch(_0x3c00ea){utils['error'](util['format'](_0x2600('0x29'),_0x2462b1[_0x2600('0x8')]),_0x3c00ea);}}; \ No newline at end of file +var _0xb4fa=['transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','[%s][transfers][attendedtransfer]','util','./utils','format','type','attended','uniqueid','request','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum'];(function(_0x2fdc37,_0x283a5a){var _0x2f1294=function(_0x5b9e61){while(--_0x5b9e61){_0x2fdc37['push'](_0x2fdc37['shift']());}};_0x2f1294(++_0x283a5a);}(_0xb4fa,0x114));var _0xab4f=function(_0x2a1d7b,_0x57d429){_0x2a1d7b=_0x2a1d7b-0x0;var _0x17b68e=_0xb4fa[_0x2a1d7b];return _0x17b68e;};'use strict';var _=require('lodash');var util=require(_0xab4f('0x0'));var utils=require(_0xab4f('0x1'));function writeDB(_0x3e683f){utils['info'](util[_0xab4f('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x3e683f[_0xab4f('0x3')]===_0xab4f('0x4')?_0x3e683f['origtransfereruniqueid']:_0x3e683f[_0xab4f('0x5')],_0x3e683f['type']));utils[_0xab4f('0x6')]('CreateVoiceTransferReport',_0x3e683f);}exports['blinds']={};exports['blindtransfer']=function(_0x40f73f){try{utils['debug'](util[_0xab4f('0x2')](_0xab4f('0x7'),_0x40f73f[_0xab4f('0x5')]),_0x40f73f);utils[_0xab4f('0x8')](util[_0xab4f('0x2')](_0xab4f('0x9'),_0x40f73f['uniqueid'],_0x40f73f[_0xab4f('0xa')],_0x40f73f[_0xab4f('0xb')],_0x40f73f[_0xab4f('0xc')],_0x40f73f[_0xab4f('0xd')]));_0x40f73f[_0xab4f('0x3')]=_0xab4f('0xe');exports['blinds'][_0x40f73f[_0xab4f('0xf')]]=_0x40f73f;writeDB(_0x40f73f);}catch(_0x12c70c){utils[_0xab4f('0x10')](util[_0xab4f('0x2')](_0xab4f('0x7'),_0x40f73f[_0xab4f('0x5')]),_0x12c70c);}};exports['attendedtransfer']=function(_0x5eaa9e){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x5eaa9e['origtransfereruniqueid']),_0x5eaa9e);utils[_0xab4f('0x8')](util[_0xab4f('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5eaa9e['origtransfereruniqueid'],_0x5eaa9e[_0xab4f('0x11')],_0x5eaa9e[_0xab4f('0x12')],_0x5eaa9e[_0xab4f('0x13')],_0x5eaa9e[_0xab4f('0x14')]));_0x5eaa9e=_[_0xab4f('0x15')](_0x5eaa9e,{'transfererchannel':_0x5eaa9e[_0xab4f('0x16')],'transferercalleridnum':_0x5eaa9e[_0xab4f('0x11')],'transferercalleridname':_0x5eaa9e['origtransferercalleridname'],'transfererconnectedlinenum':_0x5eaa9e[_0xab4f('0x17')],'transfererconnectedlinename':_0x5eaa9e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5eaa9e[_0xab4f('0x18')],'transferercontext':_0x5eaa9e[_0xab4f('0x19')],'transfererexten':_0x5eaa9e[_0xab4f('0x1a')],'transfererlinkedid':_0x5eaa9e[_0xab4f('0x1b')],'context':_0x5eaa9e[_0xab4f('0x1c')],'extension':_0x5eaa9e['origtransfererexten'],'type':_0xab4f('0x4')});if(_['isNil'](_0x5eaa9e[_0xab4f('0x1d')])){_0x5eaa9e=_['assign'](_0x5eaa9e,{'transfereechannel':_0x5eaa9e[_0xab4f('0x1e')],'transfereecalleridnum':_0x5eaa9e['transfertargetcalleridnum'],'transfereecalleridname':_0x5eaa9e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5eaa9e[_0xab4f('0x1f')],'transfereeconnectedlinename':_0x5eaa9e[_0xab4f('0x20')],'transfereeaccountcode':_0x5eaa9e[_0xab4f('0x21')],'transfereecontext':_0x5eaa9e[_0xab4f('0x22')],'transfereeexten':_0x5eaa9e[_0xab4f('0x23')],'transfereelinkedid':_0x5eaa9e['transfertargetlinkedid']});}writeDB(_0x5eaa9e);}catch(_0x3908ef){utils[_0xab4f('0x10')](util[_0xab4f('0x2')](_0xab4f('0x24'),_0x5eaa9e['origtransfereruniqueid']),_0x3908ef);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 311f1ad..3bdfd94 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 _0x1b03=['client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','found','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util'];(function(_0x2428e9,_0x1ff5f3){var _0x50d9d9=function(_0x55afd2){while(--_0x55afd2){_0x2428e9['push'](_0x2428e9['shift']());}};_0x50d9d9(++_0x1ff5f3);}(_0x1b03,0x191));var _0x31b0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1b03[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require(_0x31b0('0x0'));var jayson=require(_0x31b0('0x1'));var moment=require(_0x31b0('0x2'));var util=require(_0x31b0('0x3'));var client=jayson[_0x31b0('0x4')][_0x31b0('0x5')]({'port':0x2329});var logger=require(_0x31b0('0x6'))(_0x31b0('0x7'));exports[_0x31b0('0x8')]=function(_0x3f2d49,_0x2eafb9){logger[_0x31b0('0x8')](_0x3f2d49,_0x2eafb9?util[_0x31b0('0x9')](_0x2eafb9,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x257e68,_0x4a05d6){logger[_0x31b0('0xa')](_0x257e68,_0x4a05d6?util['inspect'](_0x4a05d6,{'showHidden':![],'depth':null}):'');};exports[_0x31b0('0xb')]=function(_0x27c57b,_0x22466e){logger['error'](_0x27c57b,_0x22466e?util['inspect'](_0x22466e,{'showHidden':![],'depth':null}):'');};exports[_0x31b0('0xc')]=function(_0x5994e8,_0x4176e6){return client[_0x31b0('0xc')](_0x5994e8,{'body':_0x4176e6})[_0x31b0('0xd')](function(_0x39e133){logger[_0x31b0('0xa')](_0x31b0('0xe'),_0x5994e8,_0x39e133?util[_0x31b0('0x9')](_0x39e133,{'showHidden':![],'depth':null}):'');})[_0x31b0('0xf')](function(_0x27810d){logger[_0x31b0('0xb')](_0x31b0('0xe'),_0x5994e8,_0x27810d?util[_0x31b0('0x9')](_0x27810d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x291945){return client['request'](_0x31b0('0x10'),{'options':{'raw':!![],'attributes':['id','internal',_0x31b0('0x11'),'interface'],'where':_0x291945,'limit':0x1}})[_0x31b0('0xd')](function(_0x14f1de){logger[_0x31b0('0xa')](_0x31b0('0x12'),JSON[_0x31b0('0x13')](_0x291945),_0x14f1de?util[_0x31b0('0x9')](_0x14f1de,{'showHidden':![],'depth':null}):'');return _0x14f1de[_0x31b0('0x14')][_0x31b0('0x15')]?_0x14f1de[_0x31b0('0x14')][0x0]:null;});}exports[_0x31b0('0x16')]=function(_0x115b2a){return new BPromise(function(_0x1e2814,_0x47ad16){if(_0x115b2a){return getUser({'internal':_0x115b2a})[_0x31b0('0xd')](function(_0x14edcd){logger[_0x31b0('0x8')](_0x31b0('0x17'),_0x115b2a,_0x14edcd?'found':_0x31b0('0x18'));return _0x1e2814(_0x14edcd);})[_0x31b0('0xf')](function(_0x213dd2){logger[_0x31b0('0xb')](_0x31b0('0x19'),_0x213dd2?util[_0x31b0('0x9')](_0x213dd2,{'showHidden':![],'depth':null}):'');return _0x1e2814(null);});}return _0x1e2814(null);});};exports['getUserByInterface']=function(_0x38f7b3){return new BPromise(function(_0x456f91,_0x29d480){if(_0x38f7b3){return getUser({'interface':_0x38f7b3})[_0x31b0('0xd')](function(_0x6eb99d){logger[_0x31b0('0x8')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x38f7b3,_0x6eb99d?_0x31b0('0x1a'):_0x31b0('0x18'));return _0x456f91(_0x6eb99d);})[_0x31b0('0xf')](function(_0x5a6c2d){logger['error'](_0x31b0('0x1b'),_0x5a6c2d?util[_0x31b0('0x9')](_0x5a6c2d,{'showHidden':![],'depth':null}):'');return _0x456f91(null);});}return _0x456f91(null);});};exports['getUserByName']=function(_0x33c0e8){return new BPromise(function(_0x5b915e,_0x14196b){if(_0x33c0e8){return getUser({'name':_0x33c0e8})[_0x31b0('0xd')](function(_0x3c11e9){logger[_0x31b0('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x33c0e8,_0x3c11e9?_0x31b0('0x1a'):_0x31b0('0x18'));return _0x5b915e(_0x3c11e9);})[_0x31b0('0xf')](function(_0x2e8e63){logger[_0x31b0('0xb')]('[utils][getUserByName]',_0x2e8e63?util[_0x31b0('0x9')](_0x2e8e63,{'showHidden':![],'depth':null}):'');return _0x5b915e(null);});}return _0x5b915e(null);});};exports[_0x31b0('0x1c')]=function(_0x4bc63d){return new BPromise(function(_0x56baff,_0x323996){if(_0x4bc63d){return client['request'](_0x31b0('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x31b0('0x11'),'type',_0x31b0('0x1e'),_0x31b0('0x1f')],'where':{'name':_0x4bc63d},'limit':0x1}})[_0x31b0('0xd')](function(_0x124f80){logger[_0x31b0('0xa')](_0x31b0('0x20'),_0x4bc63d,_0x124f80?util[_0x31b0('0x9')](_0x124f80,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4bc63d,_0x124f80?'found':_0x31b0('0x18'));return _0x56baff(_0x124f80[_0x31b0('0x14')][_0x31b0('0x15')]?_0x124f80['result'][0x0]:null);})['catch'](function(_0xe91562){logger[_0x31b0('0xb')](_0x31b0('0x21'),_0xe91562?util[_0x31b0('0x9')](_0xe91562,{'showHidden':![],'depth':null}):'');return _0x56baff(null);});}return _0x56baff(null);});};exports[_0x31b0('0x22')]=function(_0x3aaed5,_0xfdb669){return moment(_0x3aaed5)[_0x31b0('0x23')](_0xfdb669,_0x31b0('0x24'))[_0x31b0('0x25')](_0x31b0('0x26'));};exports['subtractTime']=function(_0x3aae04,_0x5dc9c8){return moment(_0x3aae04)['subtract'](_0x5dc9c8,_0x31b0('0x24'))[_0x31b0('0x25')](_0x31b0('0x26'));};exports[_0x31b0('0x27')]=function(_0x342bb2,_0x18dc47){return moment(_0x342bb2)[_0x31b0('0x28')](moment(_0x18dc47),'seconds');};exports[_0x31b0('0x29')]=function(_0x21bc76,_0x164697){return parseInt(_0x21bc76,0xa)+parseInt(_0x164697,0xa);};exports[_0x31b0('0x2a')]=function(){return moment()[_0x31b0('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x31b0('0x2b')]=function(_0x350689,_0x3f7cd4){if(_0x3f7cd4){return moment(_0x350689)[_0x31b0('0x2b')](_0x3f7cd4);}return!![];};exports[_0x31b0('0x2c')]=function(_0xee8738,_0x2cce80){if(_0x2cce80){return moment(_0xee8738)[_0x31b0('0x2c')](_0x2cce80);}else if(_0xee8738){return!![];}return![];}; \ No newline at end of file +var _0xa8f5=['acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','found','result','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','now','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','name','interface','stringify','length','getUserByInternal','notfound','catch','[utils][getUserByInternal]','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0xa8f5,0xb1));var _0x5a8f=function(_0x44976e,_0x311385){_0x44976e=_0x44976e-0x0;var _0x4852b2=_0xa8f5[_0x44976e];return _0x4852b2;};'use strict';var BPromise=require(_0x5a8f('0x0'));var jayson=require(_0x5a8f('0x1'));var moment=require('moment');var util=require(_0x5a8f('0x2'));var client=jayson[_0x5a8f('0x3')][_0x5a8f('0x4')]({'port':0x2329});var logger=require(_0x5a8f('0x5'))(_0x5a8f('0x6'));exports[_0x5a8f('0x7')]=function(_0x205de5,_0x30eed3){logger['info'](_0x205de5,_0x30eed3?util['inspect'](_0x30eed3,{'showHidden':![],'depth':null}):'');};exports[_0x5a8f('0x8')]=function(_0x5c0c45,_0x24e00c){logger[_0x5a8f('0x8')](_0x5c0c45,_0x24e00c?util[_0x5a8f('0x9')](_0x24e00c,{'showHidden':![],'depth':null}):'');};exports[_0x5a8f('0xa')]=function(_0x668a01,_0x3ebea5){logger[_0x5a8f('0xa')](_0x668a01,_0x3ebea5?util[_0x5a8f('0x9')](_0x3ebea5,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x51b965,_0x5683af){return client[_0x5a8f('0xb')](_0x51b965,{'body':_0x5683af})[_0x5a8f('0xc')](function(_0x3d34ad){logger[_0x5a8f('0x8')](_0x5a8f('0xd'),_0x51b965,_0x3d34ad?util[_0x5a8f('0x9')](_0x3d34ad,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x4d32ac){logger[_0x5a8f('0xa')]('[utils][request]\x20name:%s',_0x51b965,_0x4d32ac?util[_0x5a8f('0x9')](_0x4d32ac,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3699dc){return client[_0x5a8f('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x5a8f('0xe'),_0x5a8f('0xf')],'where':_0x3699dc,'limit':0x1}})[_0x5a8f('0xc')](function(_0x409082){logger[_0x5a8f('0x8')]('[utils][getUser]\x20where:%s',JSON[_0x5a8f('0x10')](_0x3699dc),_0x409082?util[_0x5a8f('0x9')](_0x409082,{'showHidden':![],'depth':null}):'');return _0x409082['result'][_0x5a8f('0x11')]?_0x409082['result'][0x0]:null;});}exports[_0x5a8f('0x12')]=function(_0x22a5e6){return new BPromise(function(_0x578707,_0x3d3f5d){if(_0x22a5e6){return getUser({'internal':_0x22a5e6})[_0x5a8f('0xc')](function(_0x31448d){logger[_0x5a8f('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x22a5e6,_0x31448d?'found':_0x5a8f('0x13'));return _0x578707(_0x31448d);})[_0x5a8f('0x14')](function(_0x4b341b){logger[_0x5a8f('0xa')](_0x5a8f('0x15'),_0x4b341b?util[_0x5a8f('0x9')](_0x4b341b,{'showHidden':![],'depth':null}):'');return _0x578707(null);});}return _0x578707(null);});};exports[_0x5a8f('0x16')]=function(_0x40e36e){return new BPromise(function(_0x3eea17,_0x201bd0){if(_0x40e36e){return getUser({'interface':_0x40e36e})['then'](function(_0x248316){logger[_0x5a8f('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x40e36e,_0x248316?'found':_0x5a8f('0x13'));return _0x3eea17(_0x248316);})[_0x5a8f('0x14')](function(_0x38a27d){logger[_0x5a8f('0xa')]('[utils][getUserByInterface]',_0x38a27d?util['inspect'](_0x38a27d,{'showHidden':![],'depth':null}):'');return _0x3eea17(null);});}return _0x3eea17(null);});};exports[_0x5a8f('0x17')]=function(_0x1fd68c){return new BPromise(function(_0x191264,_0x862282){if(_0x1fd68c){return getUser({'name':_0x1fd68c})['then'](function(_0x2257f6){logger[_0x5a8f('0x7')](_0x5a8f('0x18'),_0x1fd68c,_0x2257f6?'found':_0x5a8f('0x13'));return _0x191264(_0x2257f6);})['catch'](function(_0xabd48c){logger[_0x5a8f('0xa')](_0x5a8f('0x19'),_0xabd48c?util['inspect'](_0xabd48c,{'showHidden':![],'depth':null}):'');return _0x191264(null);});}return _0x191264(null);});};exports['getVoiceQueueByName']=function(_0x379843){return new BPromise(function(_0xd8aa76,_0x360955){if(_0x379843){return client['request'](_0x5a8f('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x5a8f('0xe'),_0x5a8f('0x1b'),_0x5a8f('0x1c'),'acwTimeout'],'where':{'name':_0x379843},'limit':0x1}})[_0x5a8f('0xc')](function(_0x4341eb){logger[_0x5a8f('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x379843,_0x4341eb?util[_0x5a8f('0x9')](_0x4341eb,{'showHidden':![],'depth':null}):'');logger[_0x5a8f('0x7')](_0x5a8f('0x1d'),_0x379843,_0x4341eb?_0x5a8f('0x1e'):_0x5a8f('0x13'));return _0xd8aa76(_0x4341eb[_0x5a8f('0x1f')]['length']?_0x4341eb[_0x5a8f('0x1f')][0x0]:null);})['catch'](function(_0x5447f9){logger['error'](_0x5a8f('0x20'),_0x5447f9?util[_0x5a8f('0x9')](_0x5447f9,{'showHidden':![],'depth':null}):'');return _0xd8aa76(null);});}return _0xd8aa76(null);});};exports[_0x5a8f('0x21')]=function(_0x2ffc38,_0xe4088){return moment(_0x2ffc38)['add'](_0xe4088,_0x5a8f('0x22'))[_0x5a8f('0x23')](_0x5a8f('0x24'));};exports[_0x5a8f('0x25')]=function(_0x396d98,_0x1883d7){return moment(_0x396d98)['subtract'](_0x1883d7,_0x5a8f('0x22'))['format'](_0x5a8f('0x24'));};exports['diffTime']=function(_0x3a2615,_0x40e403){return moment(_0x3a2615)[_0x5a8f('0x26')](moment(_0x40e403),_0x5a8f('0x22'));};exports['sumTime']=function(_0x4323ac,_0x24330f){return parseInt(_0x4323ac,0xa)+parseInt(_0x24330f,0xa);};exports[_0x5a8f('0x27')]=function(){return moment()[_0x5a8f('0x23')](_0x5a8f('0x24'));};exports['isAfter']=function(_0x1b66f1,_0x1acc9f){if(_0x1acc9f){return moment(_0x1b66f1)['isAfter'](_0x1acc9f);}return!![];};exports[_0x5a8f('0x28')]=function(_0x19f619,_0x6c5903){if(_0x6c5903){return moment(_0x19f619)[_0x5a8f('0x28')](_0x6c5903);}else if(_0x19f619){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index f04c8bb..df39971 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9b9=['format','method','connection','responseTime','other','test','url','setupLoggers','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','then','catch','user','no-user','timestamp','error','api','auth','set','client-side-logger','logger','\x20body=%s','body','x-forwarded-for','headers','remoteAddress','statusCode','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','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)'];(function(_0xbba9a4,_0x5bbb54){var _0x4d9fcb=function(_0x4e8752){while(--_0x4e8752){_0xbba9a4['push'](_0xbba9a4['shift']());}};_0x4d9fcb(++_0x5bbb54);}(_0xf9b9,0x158));var _0x9f9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9b9[_0x3dd15e];return _0x231fd0;};var fs=require('fs-extra');var _=require(_0x9f9b('0x0'));var ewinston=require(_0x9f9b('0x1'));var path=require(_0x9f9b('0x2'));var util=require(_0x9f9b('0x3'));var fileLogger=require(_0x9f9b('0x4'))[_0x9f9b('0x5')];var safeTemplate=require(_0x9f9b('0x6'))[_0x9f9b('0x7')];var maskSensitiveData=require(_0x9f9b('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x2e55be(_0x4e0533){var _0xbf1dc8=path[_0x9f9b('0x9')](_0x9f9b('0xa'),_0x9f9b('0xb'),_0x9f9b('0xc'));var _0x17a1a7=path['join'](_0x9f9b('0xd'),_0x4e0533['role']+'-'+_0x4e0533[_0x9f9b('0xe')]);return fs[_0x9f9b('0xf')](path['join'](_0xbf1dc8,_0x17a1a7))[_0x9f9b('0x10')](function(){var _0x2b957e=fileLogger(_0x9f9b('0xd'),path[_0x9f9b('0x9')](_0xbf1dc8,_0x17a1a7));return _0x2b957e;})[_0x9f9b('0x11')](function(_0x4d096b){throw _0x4d096b;});}this[_0x9f9b('0xb')]=function(_0x1f740a,_0x508bf1,_0x4f32e7,_0x15d630){return _0x2e55be(_0x1f740a[_0x9f9b('0x12')])[_0x9f9b('0x10')](function(_0x1263ae){var _0x988877=_0x1263ae[_0x508bf1];return _0x988877;})['then'](function(_0x15d635){var _0x2e0acc=_0x1f740a[_0x9f9b('0x12')]?_0x1f740a['user']['id']:_0x9f9b('0x13');var _0x29377d=_0x15d630['data'];var _0x3465c0=_0x15d630[_0x9f9b('0x14')];var _0x2ff257=new Date(Number(_0x3465c0));return _0x15d635(_0x2e0acc,_0x2ff257,_0x4f32e7,_0x29377d);})[_0x9f9b('0x11')](function(_0xba4308){fileLogger(_0x9f9b('0xd'))[_0x9f9b('0x15')](_0xba4308);});};}function setupLoggers(_0x227bc4){return new Promise(function(_0x549436){var _0x2e52b1=new ClientSideLogger();var _0xaa525e=fileLogger(_0x9f9b('0x16'));var _0x13eebb=fileLogger(_0x9f9b('0x17'));_0x227bc4[_0x9f9b('0x18')](_0x9f9b('0x19'),_0x2e52b1);_0x227bc4['use'](ewinston[_0x9f9b('0x1a')]({'winstonInstance':_0xaa525e,'meta':![],'statusLevels':!![],'msg':function(_0x181ef6,_0x5dfd97){var _0x209259='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x181ef6['body'])){_0x209259+=_0x9f9b('0x1b');var _0x569768=_0x181ef6[_0x9f9b('0x1c')];maskSensitiveData(_0x569768);}return safeTemplate(util['format'](_0x209259,_0x181ef6['method'],_0x181ef6['headers'][_0x9f9b('0x1d')]?_0x181ef6[_0x9f9b('0x1e')][_0x9f9b('0x1d')]:_0x181ef6['connection'][_0x9f9b('0x1f')]||_0x181ef6['ip'],_0x181ef6['url'],_0x5dfd97[_0x9f9b('0x20')],_0x5dfd97['responseTime'],_0x181ef6[_0x9f9b('0x12')]?_0x181ef6['user']['id']:null,_0x181ef6[_0x9f9b('0x12')]?_0x181ef6['user']['name']:null,_0x181ef6['user']?_0x181ef6[_0x9f9b('0x12')][_0x9f9b('0x21')]:null,_0x569768?util[_0x9f9b('0x22')](_0x569768,![],null):''));}}));_0x227bc4[_0x9f9b('0x23')](ewinston[_0x9f9b('0x1a')]({'winstonInstance':_0x13eebb,'meta':![],'statusLevels':!![],'msg':function(_0x93ad49,_0x1534f7){var _0x1be879=_0x9f9b('0x24');if(_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x25')]&&_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x26')]){_0x1be879=_0x9f9b('0x27');}return util[_0x9f9b('0x28')](_0x1be879,_0x93ad49[_0x9f9b('0x29')],_0x93ad49['headers'][_0x9f9b('0x1d')]?_0x93ad49[_0x9f9b('0x1e')][_0x9f9b('0x1d')]:_0x93ad49[_0x9f9b('0x2a')][_0x9f9b('0x1f')]||_0x93ad49['ip'],_0x93ad49['url'],_0x1534f7[_0x9f9b('0x20')],_0x1534f7[_0x9f9b('0x2b')],_0x93ad49[_0x9f9b('0x12')]?_0x93ad49[_0x9f9b('0x12')]['id']:null,_0x93ad49[_0x9f9b('0x12')]?_0x93ad49[_0x9f9b('0x12')][_0x9f9b('0xe')]:null,_0x93ad49[_0x9f9b('0x12')]?_0x93ad49[_0x9f9b('0x12')][_0x9f9b('0x21')]:null,_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x25')]?_0x93ad49['body'][_0x9f9b('0x25')]:_0x9f9b('0x2c'),_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')]['agent_id']?_0x93ad49[_0x9f9b('0x1c')][_0x9f9b('0x26')]:'',_0x93ad49[_0x9f9b('0x1c')]&&_0x93ad49[_0x9f9b('0x1c')]['agent_name']?_0x93ad49['body']['agent_name']:'');},'ignoreRoute':function(_0x5cd3ed){var _0xb71f39=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xb71f39[_0x9f9b('0x2d')](_0x5cd3ed[_0x9f9b('0x2e')]);}}));return _0x549436();});}exports[_0x9f9b('0x2f')]=setupLoggers; \ No newline at end of file +var _0xe6d2=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','use','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','responseTime','agent_id','agent_name','test','fs-extra','lodash','express-winston','path','util','./loggers','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','role','name','ensureDir','then','catch','user','data','error','api','set','client-side-logger','logger'];(function(_0x5bade0,_0x25a43a){var _0x47c33e=function(_0x225973){while(--_0x225973){_0x5bade0['push'](_0x5bade0['shift']());}};_0x47c33e(++_0x25a43a);}(_0xe6d2,0xef));var _0x2e6d=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xe6d2[_0x3ff085];return _0x2b68c3;};var fs=require(_0x2e6d('0x0'));var _=require(_0x2e6d('0x1'));var ewinston=require(_0x2e6d('0x2'));var path=require(_0x2e6d('0x3'));var util=require(_0x2e6d('0x4'));var fileLogger=require(_0x2e6d('0x5'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x2e6d('0x6')];var maskSensitiveData=require(_0x2e6d('0x7'))[_0x2e6d('0x8')];function ClientSideLogger(){function _0x8f4e68(_0x4855e5){var _0x43ce61=path[_0x2e6d('0x9')]('/var',_0x2e6d('0xa'),_0x2e6d('0xb'));var _0x47ea7d=path['join'](_0x2e6d('0xc'),_0x4855e5[_0x2e6d('0xd')]+'-'+_0x4855e5[_0x2e6d('0xe')]);return fs[_0x2e6d('0xf')](path[_0x2e6d('0x9')](_0x43ce61,_0x47ea7d))[_0x2e6d('0x10')](function(){var _0x366b5c=fileLogger(_0x2e6d('0xc'),path['join'](_0x43ce61,_0x47ea7d));return _0x366b5c;})[_0x2e6d('0x11')](function(_0x5a35e6){throw _0x5a35e6;});}this[_0x2e6d('0xa')]=function(_0x57f816,_0x1178c1,_0x199c0b,_0x1fca17){return _0x8f4e68(_0x57f816[_0x2e6d('0x12')])[_0x2e6d('0x10')](function(_0x389ba1){var _0x2949ce=_0x389ba1[_0x1178c1];return _0x2949ce;})[_0x2e6d('0x10')](function(_0x27f932){var _0x5eebbf=_0x57f816[_0x2e6d('0x12')]?_0x57f816[_0x2e6d('0x12')]['id']:'no-user';var _0x3dd8c7=_0x1fca17[_0x2e6d('0x13')];var _0x25c795=_0x1fca17['timestamp'];var _0x50e82b=new Date(Number(_0x25c795));return _0x27f932(_0x5eebbf,_0x50e82b,_0x199c0b,_0x3dd8c7);})['catch'](function(_0x35d2ba){fileLogger(_0x2e6d('0xc'))[_0x2e6d('0x14')](_0x35d2ba);});};}function setupLoggers(_0x5015a6){return new Promise(function(_0x5fc946){var _0x27557e=new ClientSideLogger();var _0x56a610=fileLogger(_0x2e6d('0x15'));var _0x4c3ee8=fileLogger('auth');_0x5015a6[_0x2e6d('0x16')](_0x2e6d('0x17'),_0x27557e);_0x5015a6['use'](ewinston[_0x2e6d('0x18')]({'winstonInstance':_0x56a610,'meta':![],'statusLevels':!![],'msg':function(_0x34dad0,_0x3809e8){var _0x818da5=_0x2e6d('0x19');if(!_[_0x2e6d('0x1a')](_0x34dad0[_0x2e6d('0x1b')])){_0x818da5+=_0x2e6d('0x1c');var _0x32a8f8=_0x34dad0[_0x2e6d('0x1b')];maskSensitiveData(_0x32a8f8);}return safeTemplate(util[_0x2e6d('0x1d')](_0x818da5,_0x34dad0[_0x2e6d('0x1e')],_0x34dad0['headers']['x-forwarded-for']?_0x34dad0[_0x2e6d('0x1f')][_0x2e6d('0x20')]:_0x34dad0[_0x2e6d('0x21')][_0x2e6d('0x22')]||_0x34dad0['ip'],_0x34dad0[_0x2e6d('0x23')],_0x3809e8['statusCode'],_0x3809e8['responseTime'],_0x34dad0[_0x2e6d('0x12')]?_0x34dad0[_0x2e6d('0x12')]['id']:null,_0x34dad0[_0x2e6d('0x12')]?_0x34dad0[_0x2e6d('0x12')]['name']:null,_0x34dad0[_0x2e6d('0x12')]?_0x34dad0[_0x2e6d('0x12')][_0x2e6d('0xd')]:null,_0x32a8f8?util['inspect'](_0x32a8f8,![],null):''));}}));_0x5015a6[_0x2e6d('0x24')](ewinston[_0x2e6d('0x18')]({'winstonInstance':_0x4c3ee8,'meta':![],'statusLevels':!![],'msg':function(_0x172271,_0x2b6010){var _0x3faf63='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x172271[_0x2e6d('0x1b')]&&_0x172271[_0x2e6d('0x1b')][_0x2e6d('0x25')]&&_0x172271['body']['agent_id']){_0x3faf63=_0x2e6d('0x26');}return util[_0x2e6d('0x1d')](_0x3faf63,_0x172271['method'],_0x172271[_0x2e6d('0x1f')]['x-forwarded-for']?_0x172271[_0x2e6d('0x1f')][_0x2e6d('0x20')]:_0x172271[_0x2e6d('0x21')][_0x2e6d('0x22')]||_0x172271['ip'],_0x172271[_0x2e6d('0x23')],_0x2b6010[_0x2e6d('0x27')],_0x2b6010[_0x2e6d('0x28')],_0x172271[_0x2e6d('0x12')]?_0x172271['user']['id']:null,_0x172271[_0x2e6d('0x12')]?_0x172271[_0x2e6d('0x12')][_0x2e6d('0xe')]:null,_0x172271[_0x2e6d('0x12')]?_0x172271['user'][_0x2e6d('0xd')]:null,_0x172271[_0x2e6d('0x1b')]&&_0x172271['body']['device']?_0x172271['body'][_0x2e6d('0x25')]:'other',_0x172271['body']&&_0x172271[_0x2e6d('0x1b')]['agent_id']?_0x172271[_0x2e6d('0x1b')][_0x2e6d('0x29')]:'',_0x172271[_0x2e6d('0x1b')]&&_0x172271['body'][_0x2e6d('0x2a')]?_0x172271['body'][_0x2e6d('0x2a')]:'');},'ignoreRoute':function(_0x302a2a){var _0x989bfd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x989bfd[_0x2e6d('0x2b')](_0x302a2a[_0x2e6d('0x23')]);}}));return _0x5fc946();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 609a55f..9fb553c 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd355=['padStart','lodash','moment-timezone','map','source','join','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','clone','hours','minutes','startOf','day','endOf','isBetween','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','isMoment','length'];(function(_0x5c2b5f,_0x1e5cc2){var _0x257b82=function(_0xccd343){while(--_0xccd343){_0x5c2b5f['push'](_0x5c2b5f['shift']());}};_0x257b82(++_0x1e5cc2);}(_0xd355,0xb5));var _0x5d35=function(_0x4bd203,_0x29b162){_0x4bd203=_0x4bd203-0x0;var _0x2f6ba4=_0xd355[_0x4bd203];return _0x2f6ba4;};var _=require(_0x5d35('0x0'));var moment=require(_0x5d35('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x5d35('0x2')](function(_0x432a11){return _0x432a11[_0x5d35('0x3')];})[_0x5d35('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x5d35('0x5');function throwIfDateNotValid(_0x1f5dad){if(!_0x1f5dad[_0x5d35('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x15b4f0){var _0x2be274=_0x15b4f0[_0x5d35('0x7')](':')[_0x5d35('0x2')](function(_0x5477ed){return parseInt(_0x5477ed,0xa);});var _0x32b431=_0x2be274[0x0];var _0x50a9fe=_0x2be274[0x1];if(_0x32b431<0x0||_0x32b431>0x17||_0x50a9fe<0x0||_0x50a9fe>0x3b){throw new Error(EINVALID_DATE);}return[_0x32b431,_0x50a9fe];}function circularDoWInterval(_0x182109,_0x4197ec){if(_0x182109===_0x4197ec){return[_0x182109];}else{var _0x598e3e=moment[_0x5d35('0x8')]();moment[_0x5d35('0x8')]('en');var _0x1866f1=moment['weekdaysShort']()[_0x5d35('0x2')](function(_0x22e275){return _0x22e275[_0x5d35('0x9')]();});moment[_0x5d35('0x8')](_0x598e3e);var _0x117dd6=_0x1866f1[_0x5d35('0xa')](_0x182109);var _0x2582cb=_0x1866f1[_0x5d35('0xa')](_0x4197ec);if(_0x2582cb>_0x117dd6){return _0x1866f1[_0x5d35('0xb')](_0x117dd6,_0x2582cb+0x1);}else{var _0x2fcf11=_0x1866f1[_0x5d35('0xb')](0x0,_0x2582cb+0x1);var _0x447435=_0x1866f1[_0x5d35('0xb')](_0x117dd6);return _0x447435[_0x5d35('0xc')](_0x2fcf11);}}}module['exports'][_0x5d35('0xd')]=circularDoWInterval;function circularMonthInterval(_0x5f30d6,_0x6350a9){if(_0x5f30d6===_0x6350a9){return[_0x5f30d6];}else{var _0x460290=moment['locale']();moment['locale']('en');var _0x3b9453=moment[_0x5d35('0xe')]()[_0x5d35('0x2')](function(_0x240711){return _0x240711[_0x5d35('0x9')]();});moment[_0x5d35('0x8')](_0x460290);var _0x15008a=_0x3b9453[_0x5d35('0xa')](_0x5f30d6);var _0x192ad8=_0x3b9453['indexOf'](_0x6350a9);if(_0x192ad8>_0x15008a){return _0x3b9453['slice'](_0x15008a,_0x192ad8+0x1);}else{var _0xdfd3a4=_0x3b9453[_0x5d35('0xb')](0x0,_0x192ad8+0x1);var _0x59ab8e=_0x3b9453[_0x5d35('0xb')](_0x15008a);return _0x59ab8e[_0x5d35('0xc')](_0xdfd3a4);}}}module[_0x5d35('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x5eba82){var _0x5db746=parseInt(_0x5eba82,0xa);if(_0x5db746<0x1||_0x5db746>0x1f){throw new Error(EINVALID_DATE);}return _0x5db746;}function timeCompare(_0x3d3253,_0x32d498,_0x5d26da){var _0x3e7912=_0x3d3253[_0x5d35('0x10')]();var _0x8f0c75=extractTime(_0x32d498);var _0x35c829=_0x8f0c75[0x0];var _0x338ade=_0x8f0c75[0x1];var _0x27b99a=_0x3d3253['clone']()[_0x5d35('0x11')](_0x35c829)['minutes'](_0x338ade);throwIfDateNotValid(_0x27b99a);var _0x99b141=extractTime(_0x5d26da);var _0x11e162=_0x99b141[0x0];var _0x3eaff4=_0x99b141[0x1];var _0x4d2aae=_0x3d3253[_0x5d35('0x10')]()[_0x5d35('0x11')](_0x11e162)[_0x5d35('0x12')](_0x3eaff4);throwIfDateNotValid(_0x4d2aae);if(_0x4d2aae['isBefore'](_0x27b99a)){var _0x2bd250=_0x3e7912[_0x5d35('0x10')]()[_0x5d35('0x13')](_0x5d35('0x14'));var _0xf3b564=_0x3e7912[_0x5d35('0x10')]()[_0x5d35('0x15')](_0x5d35('0x14'));return _0x3e7912['isBetween'](_0x27b99a,_0xf3b564,undefined,'[]')||_0x3e7912[_0x5d35('0x16')](_0x2bd250,_0x4d2aae,undefined,'[]');}else{return _0x3e7912[_0x5d35('0x16')](_0x27b99a,_0x4d2aae,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x27bbc2,_0x5b6709,_0x926522){var _0x56abac=_0x27bbc2['locale']('en')['format'](_0x5d35('0x17'))[_0x5d35('0x9')]();return circularDoWInterval(_0x5b6709,_0x926522)[_0x5d35('0x18')](_0x56abac);}module[_0x5d35('0xf')][_0x5d35('0x19')]=dowCompare;function domCompare(_0x545808,_0x46a879,_0x449cae){var _0x2016d5=_0x545808[_0x5d35('0x1a')]();if(_0x46a879===_0x449cae){return _0x2016d5===_0x46a879;}else{var _0x34df9c=_0x545808[_0x5d35('0x1b')]();var _0x25973b=_0x46a879<_0x449cae;let _0x2ee996=![];var _0x36a666=0x0;var _0x6b9fc8=0x0;if(_0x25973b){_0x36a666=Math[_0x5d35('0x1c')](0x1,_0x46a879);_0x6b9fc8=Math[_0x5d35('0x1d')](_0x449cae,_0x34df9c);_0x2ee996=_0x2016d5>=_0x36a666&&_0x2016d5<=_0x6b9fc8;}else{_0x36a666=Math[_0x5d35('0x1d')](_0x46a879,_0x34df9c);_0x6b9fc8=Math['max'](0x1,_0x449cae);_0x2ee996=_0x2016d5>=_0x36a666||_0x2016d5<=_0x6b9fc8;}return _0x2ee996;}}module[_0x5d35('0xf')][_0x5d35('0x1e')]=domCompare;function monthCompare(_0x2fd61f,_0x3f125c,_0x4d7eb8){var _0xd8c6ec=_0x2fd61f[_0x5d35('0x8')]('en')['format'](_0x5d35('0x1f'))[_0x5d35('0x9')]();return circularMonthInterval(_0x3f125c,_0x4d7eb8)[_0x5d35('0x18')](_0xd8c6ec);}module['exports'][_0x5d35('0x20')]=monthCompare;function iftime(_0x16964d,_0x57b6a2=moment['tz']['guess'](),_0x172b44=moment()){if(!validateRx['test'](_0x16964d)){throw new Error(EINVALID_STRING);}else{var _0x293906=(moment[_0x5d35('0x21')](_0x172b44)?_0x172b44['clone']():moment(_0x172b44))['tz'](_0x57b6a2)[_0x5d35('0x8')]('en');throwIfDateNotValid(_0x293906);var _0x594a42=_0x16964d[_0x5d35('0x7')](',');var _0x4acfb4=_0x594a42[0x0];var _0x2ecc60=_0x594a42[0x1];var _0x588b44=_0x594a42[0x2];var _0x4fa7ca=_0x594a42[0x3];let _0x2ad703=!![];if(_0x4acfb4!=='*'){var _0x2f9994=_0x4acfb4['split']('-');var _0x43d4b8=_['padStart'](_0x2f9994[0x0],0x5,'0');var _0x1592d7=_0x2f9994[_0x5d35('0x22')]===0x2?_[_0x5d35('0x23')](_0x2f9994[0x1],0x5,'0'):_0x43d4b8;_0x2ad703=timeCompare(_0x293906,_0x43d4b8,_0x1592d7);}let _0x36ab70=!![];if(_0x2ecc60!=='*'){var _0x53bf2a=_0x2ecc60['split']('-');var _0x6925c7=_0x53bf2a[0x0];var _0x5cc86b=_0x53bf2a[_0x5d35('0x22')]===0x2?_0x53bf2a[0x1]:_0x6925c7;_0x36ab70=dowCompare(_0x293906,_0x6925c7,_0x5cc86b);}let _0x363f4d=!![];if(_0x588b44!=='*'){var _0x568d30=_0x588b44[_0x5d35('0x7')]('-');var _0x550c77=parseDom(_0x568d30[0x0]);var _0x151dfc=_0x568d30[_0x5d35('0x22')]===0x2?parseDom(_0x568d30[0x1]):_0x550c77;_0x363f4d=domCompare(_0x293906,_0x550c77,_0x151dfc);}let _0x4c796f=!![];if(_0x4fa7ca!=='*'){var _0x59d36d=_0x4fa7ca['split']('-');var _0x4b63e8=_0x59d36d[0x0];var _0x5193ab=_0x59d36d[_0x5d35('0x22')]===0x2?_0x59d36d[0x1]:_0x59d36d[0x0];_0x4c796f=monthCompare(_0x293906,_0x4b63e8,_0x5193ab);}return _0x2ad703&&_0x36ab70&&_0x363f4d&&_0x4c796f;}}module['exports']['iftime']=iftime; \ No newline at end of file +var _0xb606=['clone','isBefore','endOf','day','isBetween','timeCompare','format','includes','dowCompare','date','daysInMonth','domCompare','monthCompare','guess','isMoment','split','padStart','length','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','hours','minutes'];(function(_0x5b3b59,_0xaff9db){var _0x2794bb=function(_0x116cd7){while(--_0x116cd7){_0x5b3b59['push'](_0x5b3b59['shift']());}};_0x2794bb(++_0xaff9db);}(_0xb606,0x115));var _0x6b60=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0xb606[_0x257b0e];return _0x27ac2a;};var _=require(_0x6b60('0x0'));var moment=require(_0x6b60('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x6b60('0x2')](function(_0x473284){return _0x473284[_0x6b60('0x3')];})[_0x6b60('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x6b60('0x5');var EINVALID_DATE=_0x6b60('0x6');function throwIfDateNotValid(_0x3db999){if(!_0x3db999['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2ab203){var _0x39caf1=_0x2ab203['split'](':')['map'](function(_0x40bf77){return parseInt(_0x40bf77,0xa);});var _0x1f2ce8=_0x39caf1[0x0];var _0xf5000=_0x39caf1[0x1];if(_0x1f2ce8<0x0||_0x1f2ce8>0x17||_0xf5000<0x0||_0xf5000>0x3b){throw new Error(EINVALID_DATE);}return[_0x1f2ce8,_0xf5000];}function circularDoWInterval(_0x1c1ab1,_0x416a1e){if(_0x1c1ab1===_0x416a1e){return[_0x1c1ab1];}else{var _0x376026=moment[_0x6b60('0x7')]();moment[_0x6b60('0x7')]('en');var _0x5ab233=moment[_0x6b60('0x8')]()[_0x6b60('0x2')](function(_0x1a7451){return _0x1a7451[_0x6b60('0x9')]();});moment[_0x6b60('0x7')](_0x376026);var _0x3081c6=_0x5ab233['indexOf'](_0x1c1ab1);var _0x1c2916=_0x5ab233[_0x6b60('0xa')](_0x416a1e);if(_0x1c2916>_0x3081c6){return _0x5ab233[_0x6b60('0xb')](_0x3081c6,_0x1c2916+0x1);}else{var _0x2c9a79=_0x5ab233[_0x6b60('0xb')](0x0,_0x1c2916+0x1);var _0x3174a7=_0x5ab233[_0x6b60('0xb')](_0x3081c6);return _0x3174a7[_0x6b60('0xc')](_0x2c9a79);}}}module[_0x6b60('0xd')][_0x6b60('0xe')]=circularDoWInterval;function circularMonthInterval(_0x2a98de,_0x88f355){if(_0x2a98de===_0x88f355){return[_0x2a98de];}else{var _0x2da43d=moment[_0x6b60('0x7')]();moment[_0x6b60('0x7')]('en');var _0x354de3=moment[_0x6b60('0xf')]()['map'](function(_0x2bc010){return _0x2bc010[_0x6b60('0x9')]();});moment['locale'](_0x2da43d);var _0x3ae041=_0x354de3[_0x6b60('0xa')](_0x2a98de);var _0x333b92=_0x354de3[_0x6b60('0xa')](_0x88f355);if(_0x333b92>_0x3ae041){return _0x354de3['slice'](_0x3ae041,_0x333b92+0x1);}else{var _0x393645=_0x354de3[_0x6b60('0xb')](0x0,_0x333b92+0x1);var _0x57a8a2=_0x354de3[_0x6b60('0xb')](_0x3ae041);return _0x57a8a2[_0x6b60('0xc')](_0x393645);}}}module[_0x6b60('0xd')][_0x6b60('0x10')]=circularMonthInterval;function parseDom(_0x28f1c2){var _0x386691=parseInt(_0x28f1c2,0xa);if(_0x386691<0x1||_0x386691>0x1f){throw new Error(EINVALID_DATE);}return _0x386691;}function timeCompare(_0x1945f0,_0x2b230e,_0x40fdc3){var _0x5310a8=_0x1945f0['clone']();var _0x1b828f=extractTime(_0x2b230e);var _0x1ffd17=_0x1b828f[0x0];var _0x298874=_0x1b828f[0x1];var _0x191ad3=_0x1945f0['clone']()[_0x6b60('0x11')](_0x1ffd17)[_0x6b60('0x12')](_0x298874);throwIfDateNotValid(_0x191ad3);var _0x3bf879=extractTime(_0x40fdc3);var _0x2c84e4=_0x3bf879[0x0];var _0x14503d=_0x3bf879[0x1];var _0x34e671=_0x1945f0[_0x6b60('0x13')]()['hours'](_0x2c84e4)[_0x6b60('0x12')](_0x14503d);throwIfDateNotValid(_0x34e671);if(_0x34e671[_0x6b60('0x14')](_0x191ad3)){var _0x53ab6a=_0x5310a8[_0x6b60('0x13')]()['startOf']('day');var _0x183dd6=_0x5310a8['clone']()[_0x6b60('0x15')](_0x6b60('0x16'));return _0x5310a8[_0x6b60('0x17')](_0x191ad3,_0x183dd6,undefined,'[]')||_0x5310a8[_0x6b60('0x17')](_0x53ab6a,_0x34e671,undefined,'[]');}else{return _0x5310a8[_0x6b60('0x17')](_0x191ad3,_0x34e671,undefined,'[]');}}module[_0x6b60('0xd')][_0x6b60('0x18')]=timeCompare;function dowCompare(_0xd372c1,_0x10eaa4,_0x2b3ac1){var _0x44b3ea=_0xd372c1[_0x6b60('0x7')]('en')[_0x6b60('0x19')]('ddd')['toLowerCase']();return circularDoWInterval(_0x10eaa4,_0x2b3ac1)[_0x6b60('0x1a')](_0x44b3ea);}module[_0x6b60('0xd')][_0x6b60('0x1b')]=dowCompare;function domCompare(_0x46e504,_0x32a37f,_0x4f4ba7){var _0x4dc3ce=_0x46e504[_0x6b60('0x1c')]();if(_0x32a37f===_0x4f4ba7){return _0x4dc3ce===_0x32a37f;}else{var _0x1ad0cd=_0x46e504[_0x6b60('0x1d')]();var _0x3f3144=_0x32a37f<_0x4f4ba7;let _0x4d9e0a=![];var _0x966b07=0x0;var _0x216719=0x0;if(_0x3f3144){_0x966b07=Math['max'](0x1,_0x32a37f);_0x216719=Math['min'](_0x4f4ba7,_0x1ad0cd);_0x4d9e0a=_0x4dc3ce>=_0x966b07&&_0x4dc3ce<=_0x216719;}else{_0x966b07=Math['min'](_0x32a37f,_0x1ad0cd);_0x216719=Math['max'](0x1,_0x4f4ba7);_0x4d9e0a=_0x4dc3ce>=_0x966b07||_0x4dc3ce<=_0x216719;}return _0x4d9e0a;}}module[_0x6b60('0xd')][_0x6b60('0x1e')]=domCompare;function monthCompare(_0x4126d8,_0x357889,_0x5829c7){var _0x4965e4=_0x4126d8[_0x6b60('0x7')]('en')[_0x6b60('0x19')]('MMM')['toLowerCase']();return circularMonthInterval(_0x357889,_0x5829c7)['includes'](_0x4965e4);}module[_0x6b60('0xd')][_0x6b60('0x1f')]=monthCompare;function iftime(_0x4fa4aa,_0x356b11=moment['tz'][_0x6b60('0x20')](),_0x5a2790=moment()){if(!validateRx['test'](_0x4fa4aa)){throw new Error(EINVALID_STRING);}else{var _0x10e047=(moment[_0x6b60('0x21')](_0x5a2790)?_0x5a2790[_0x6b60('0x13')]():moment(_0x5a2790))['tz'](_0x356b11)[_0x6b60('0x7')]('en');throwIfDateNotValid(_0x10e047);var _0x5f271d=_0x4fa4aa[_0x6b60('0x22')](',');var _0x52ce96=_0x5f271d[0x0];var _0x47e19a=_0x5f271d[0x1];var _0x4c3b7f=_0x5f271d[0x2];var _0x4baea4=_0x5f271d[0x3];let _0x8c43c3=!![];if(_0x52ce96!=='*'){var _0x139337=_0x52ce96[_0x6b60('0x22')]('-');var _0x16c747=_[_0x6b60('0x23')](_0x139337[0x0],0x5,'0');var _0x3787ce=_0x139337[_0x6b60('0x24')]===0x2?_['padStart'](_0x139337[0x1],0x5,'0'):_0x16c747;_0x8c43c3=timeCompare(_0x10e047,_0x16c747,_0x3787ce);}let _0x3ffd85=!![];if(_0x47e19a!=='*'){var _0x4c573b=_0x47e19a[_0x6b60('0x22')]('-');var _0xabd9c3=_0x4c573b[0x0];var _0x58de44=_0x4c573b[_0x6b60('0x24')]===0x2?_0x4c573b[0x1]:_0xabd9c3;_0x3ffd85=dowCompare(_0x10e047,_0xabd9c3,_0x58de44);}let _0x54a412=!![];if(_0x4c3b7f!=='*'){var _0x2d6f2f=_0x4c3b7f[_0x6b60('0x22')]('-');var _0x49b81a=parseDom(_0x2d6f2f[0x0]);var _0x35b39f=_0x2d6f2f[_0x6b60('0x24')]===0x2?parseDom(_0x2d6f2f[0x1]):_0x49b81a;_0x54a412=domCompare(_0x10e047,_0x49b81a,_0x35b39f);}let _0x5e62cd=!![];if(_0x4baea4!=='*'){var _0x3db2b0=_0x4baea4['split']('-');var _0x1625b0=_0x3db2b0[0x0];var _0x40f83d=_0x3db2b0['length']===0x2?_0x3db2b0[0x1]:_0x3db2b0[0x0];_0x5e62cd=monthCompare(_0x10e047,_0x1625b0,_0x40f83d);}return _0x8c43c3&&_0x3ffd85&&_0x54a412&&_0x5e62cd;}}module[_0x6b60('0xd')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 42f51de..8cc8136 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7933=['consoleLogger','fileLogger','path','moment','../config/environment','debugLevel','toLowerCase','info','bold\x20yellow','bold\x20green','bold\x20magenta','bold\x20blue','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','keys','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','warn','File','%s-%s','error','Console'];(function(_0x2e334b,_0x19ad28){var _0x459a56=function(_0xab9ada){while(--_0xab9ada){_0x2e334b['push'](_0x2e334b['shift']());}};_0x459a56(++_0x19ad28);}(_0x7933,0x178));var _0x3793=function(_0x19b5b9,_0x5ce4ac){_0x19b5b9=_0x19b5b9-0x0;var _0x1287cd=_0x7933[_0x19b5b9];return _0x1287cd;};'use strict';var path=require(_0x3793('0x0'));var util=require('util');var moment=require(_0x3793('0x1'));var winston=require('winston');var config=require(_0x3793('0x2'));var debugLevel=config[_0x3793('0x3')]?config[_0x3793('0x3')][_0x3793('0x4')]():_0x3793('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x3793('0x6'),'info':'white','print':'bold\x20white','success':_0x3793('0x7'),'http':'gray','verbose':_0x3793('0x8'),'debug':_0x3793('0x9'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3dfc01,_0x48fffc,_0x5c483d){var _0x569b85=_0x3dfc01||_0x3793('0xa');return path[_0x3793('0xb')](_0x569b85,util[_0x3793('0xc')]('%s-%s.log',_0x48fffc,_0x5c483d));}function formatter(_0x12ef5a,_0x51d7f5){_0x51d7f5[_0x3793('0xd')]=_0x51d7f5[_0x3793('0xd')][_0x3793('0xe')](/@@{/g,_0x3793('0xf'))[_0x3793('0xe')](/}@@/g,_0x3793('0x10'))[_0x3793('0xe')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x3793('0xc')](_0x3793('0x11'),moment()[_0x3793('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),_0x51d7f5[_0x3793('0x12')][_0x3793('0x13')](),_0x12ef5a,_0x51d7f5[_0x3793('0xd')]);}function fileFormat(_0x1f2340,_0x45d0df){_0x45d0df[_0x3793('0xd')]=_0x45d0df['message'][_0x3793('0xe')](/@@{/g,'{{{')[_0x3793('0xe')](/}@@/g,'}}}')[_0x3793('0xe')](/@{/g,'{{')[_0x3793('0xe')](/}@/g,'}}');var _0x2df20a=_0x45d0df['meta']&&Object[_0x3793('0x14')](_0x45d0df[_0x3793('0x15')])[_0x3793('0x16')]?'\x0a\x09'+JSON['stringify'](_0x45d0df[_0x3793('0x15')]):'';return util['format'](_0x3793('0x17'),moment()[_0x3793('0xc')](_0x3793('0x18')),_0x45d0df[_0x3793('0x12')][_0x3793('0x13')](),_0x1f2340,_0x45d0df['message'],_0x2df20a);}function consoleLogger(){var _0x14ddb0=new winston[(_0x3793('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3793('0x1a'))]['Console']({'level':_0x3793('0x1b'),'json':![],'formatter':function(_0x30de8e){return formatter('',_0x30de8e);}})]});return _0x14ddb0;}function fileLogger(_0x4cb449,_0x37e2bb){var _0x2d1784=new winston[(_0x3793('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3793('0x1a'))][(_0x3793('0x1c'))]({'name':util[_0x3793('0xc')](_0x3793('0x1d'),_0x4cb449,_0x3793('0x1e')),'filename':getLogFileName(_0x37e2bb,_0x4cb449,_0x3793('0x1e')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2de8d2){return fileFormat(_0x4cb449,_0x2de8d2);}}),new winston[(_0x3793('0x1a'))][(_0x3793('0x1c'))]({'name':util[_0x3793('0xc')](_0x3793('0x1d'),_0x4cb449,debugLevel),'filename':getLogFileName(_0x37e2bb,_0x4cb449,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bbf87){return fileFormat(_0x4cb449,_0x3bbf87);}}),new winston[(_0x3793('0x1a'))][(_0x3793('0x1f'))]({'level':_0x3793('0x1b'),'json':![],'formatter':function(_0x4ad299){return fileFormat(_0x4cb449,_0x4ad299);}})]});return _0x2d1784;}exports[_0x3793('0x20')]=consoleLogger;exports[_0x3793('0x21')]=fileLogger; \ No newline at end of file +var _0x6f24=['{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','keys','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','path','winston','../config/environment','debugLevel','toLowerCase','info','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace'];(function(_0xbc4d2f,_0x573055){var _0x1b2349=function(_0x238bfe){while(--_0x238bfe){_0xbc4d2f['push'](_0xbc4d2f['shift']());}};_0x1b2349(++_0x573055);}(_0x6f24,0x131));var _0x46f2=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6f24[_0x122096];return _0x3d1966;};'use strict';var path=require(_0x46f2('0x0'));var util=require('util');var moment=require('moment');var winston=require(_0x46f2('0x1'));var config=require(_0x46f2('0x2'));var debugLevel=config[_0x46f2('0x3')]?config[_0x46f2('0x3')][_0x46f2('0x4')]():_0x46f2('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':'bold\x20yellow','info':'white','print':_0x46f2('0x6'),'success':_0x46f2('0x7'),'http':_0x46f2('0x8'),'verbose':_0x46f2('0x9'),'debug':_0x46f2('0xa'),'silly':_0x46f2('0xb')};winston[_0x46f2('0xc')](XC_LOG_COLORS);function getLogFileName(_0x476aa1,_0x380d34,_0x2de208){var _0x3b7373=_0x476aa1||_0x46f2('0xd');return path[_0x46f2('0xe')](_0x3b7373,util[_0x46f2('0xf')](_0x46f2('0x10'),_0x380d34,_0x2de208));}function formatter(_0x528dd9,_0x10c81e){_0x10c81e[_0x46f2('0x11')]=_0x10c81e[_0x46f2('0x11')][_0x46f2('0x12')](/@@{/g,_0x46f2('0x13'))[_0x46f2('0x12')](/}@@/g,_0x46f2('0x14'))[_0x46f2('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x46f2('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x46f2('0xf')](_0x46f2('0x15')),_0x10c81e[_0x46f2('0x16')]['toUpperCase'](),_0x528dd9,_0x10c81e[_0x46f2('0x11')]);}function fileFormat(_0x4490b2,_0x5534d1){_0x5534d1['message']=_0x5534d1[_0x46f2('0x11')][_0x46f2('0x12')](/@@{/g,'{{{')[_0x46f2('0x12')](/}@@/g,'}}}')[_0x46f2('0x12')](/@{/g,'{{')[_0x46f2('0x12')](/}@/g,'}}');var _0x10e47b=_0x5534d1['meta']&&Object[_0x46f2('0x17')](_0x5534d1[_0x46f2('0x18')])['length']?'\x0a\x09'+JSON[_0x46f2('0x19')](_0x5534d1[_0x46f2('0x18')]):'';return util[_0x46f2('0xf')](_0x46f2('0x1a'),moment()['format'](_0x46f2('0x15')),_0x5534d1[_0x46f2('0x16')][_0x46f2('0x1b')](),_0x4490b2,_0x5534d1['message'],_0x10e47b);}function consoleLogger(){var _0x3d9e7c=new winston[(_0x46f2('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x46f2('0x1d'))][(_0x46f2('0x1e'))]({'level':_0x46f2('0x1f'),'json':![],'formatter':function(_0xfbf0a2){return formatter('',_0xfbf0a2);}})]});return _0x3d9e7c;}function fileLogger(_0x36a36c,_0x487675){var _0x540fa6=new winston[(_0x46f2('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x46f2('0x1d'))][(_0x46f2('0x20'))]({'name':util[_0x46f2('0xf')]('%s-%s',_0x36a36c,_0x46f2('0x21')),'filename':getLogFileName(_0x487675,_0x36a36c,'error'),'level':_0x46f2('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x193a9f){return fileFormat(_0x36a36c,_0x193a9f);}}),new winston[(_0x46f2('0x1d'))][(_0x46f2('0x20'))]({'name':util[_0x46f2('0xf')](_0x46f2('0x22'),_0x36a36c,debugLevel),'filename':getLogFileName(_0x487675,_0x36a36c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d9bc3){return fileFormat(_0x36a36c,_0x5d9bc3);}}),new winston[(_0x46f2('0x1d'))][(_0x46f2('0x1e'))]({'level':_0x46f2('0x1f'),'json':![],'formatter':function(_0x57cffc){return fileFormat(_0x36a36c,_0x57cffc);}})]});return _0x540fa6;}exports[_0x46f2('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 439e65c..b31887f 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x4a8072,_0x435bab){var _0x11a4fe=function(_0x24b69a){while(--_0x24b69a){_0x4a8072['push'](_0x4a8072['shift']());}};_0x11a4fe(++_0x435bab);}(_0x2ef3,0xba));var _0x32ef=function(_0x1bde91,_0x1acb49){_0x1bde91=_0x1bde91-0x0;var _0x34f7b0=_0x2ef3[_0x1bde91];return _0x34f7b0;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x662539,_0x51f6fa){var _0x553409=function(_0x3cbd43){while(--_0x3cbd43){_0x662539['push'](_0x662539['shift']());}};_0x553409(++_0x51f6fa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x0b0e[_0x38c652];return _0x218a37;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 8620fbe..93272cf 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ee=['replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','string'];(function(_0x7001ce,_0x458c3e){var _0xacd96a=function(_0x3dc27c){while(--_0x3dc27c){_0x7001ce['push'](_0x7001ce['shift']());}};_0xacd96a(++_0x458c3e);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4889d8){return _0x4889d8==='{{'?_0xe36e('0x0'):'\x20}\x20}';}function safeTemplate(_0xf6b517){var _0x4018bf=_0xf6b517;if(typeof _0xf6b517===_0xe36e('0x1')){_0x4018bf=_0xf6b517[_0xe36e('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe36e('0x3')](_0xf6b517)){_0x4018bf=_0xf6b517[_0xe36e('0x4')](function(_0x29e692){return safeTemplate(_0x29e692);});}else if(_[_0xe36e('0x5')](_0xf6b517)){_0x4018bf=Object[_0xe36e('0x6')](_0xf6b517)[_0xe36e('0x7')](function(_0x21be0b,_0x1aa596){_0x21be0b[_0x1aa596]=safeTemplate(_0xf6b517[_0x1aa596]);return _0x21be0b;},{});}return _0x4018bf;}module['exports'][_0xe36e('0x8')]=safeTemplate; \ No newline at end of file +var _0xd4a2=['exports','safeTemplate','lodash','\x20}\x20}','replace','map','isPlainObject','keys','reduce'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd4a2,0x173));var _0x2d4a=function(_0x36e97e,_0x2bfd32){_0x36e97e=_0x36e97e-0x0;var _0x51aa63=_0xd4a2[_0x36e97e];return _0x51aa63;};var _=require(_0x2d4a('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5d70e1){return _0x5d70e1==='{{'?'{\x20{\x20':_0x2d4a('0x1');}function safeTemplate(_0x576ffe){var _0x2a8a71=_0x576ffe;if(typeof _0x576ffe==='string'){_0x2a8a71=_0x576ffe[_0x2d4a('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x576ffe)){_0x2a8a71=_0x576ffe[_0x2d4a('0x3')](function(_0x40d744){return safeTemplate(_0x40d744);});}else if(_[_0x2d4a('0x4')](_0x576ffe)){_0x2a8a71=Object[_0x2d4a('0x5')](_0x576ffe)[_0x2d4a('0x6')](function(_0x57058f,_0x45fefb){_0x57058f[_0x45fefb]=safeTemplate(_0x576ffe[_0x45fefb]);return _0x57058f;},{});}return _0x2a8a71;}module[_0x2d4a('0x7')][_0x2d4a('0x8')]=safeTemplate; \ No newline at end of file diff --git a/snippet/3.1.0/assets/images/00fe515d7113c2841e5d.svg b/snippet/3.0.0/assets/images/00fe515d7113c2841e5d.svg similarity index 100% rename from snippet/3.1.0/assets/images/00fe515d7113c2841e5d.svg rename to snippet/3.0.0/assets/images/00fe515d7113c2841e5d.svg diff --git a/snippet/3.1.0/assets/images/3b24a6b94b2631f4d565.svg b/snippet/3.0.0/assets/images/3b24a6b94b2631f4d565.svg similarity index 100% rename from snippet/3.1.0/assets/images/3b24a6b94b2631f4d565.svg rename to snippet/3.0.0/assets/images/3b24a6b94b2631f4d565.svg diff --git a/snippet/3.1.0/assets/images/c9f502ad417b1b987198.svg b/snippet/3.0.0/assets/images/c9f502ad417b1b987198.svg similarity index 100% rename from snippet/3.1.0/assets/images/c9f502ad417b1b987198.svg rename to snippet/3.0.0/assets/images/c9f502ad417b1b987198.svg diff --git a/snippet/3.1.0/index.html b/snippet/3.0.0/index.html similarity index 69% rename from snippet/3.1.0/index.html rename to snippet/3.0.0/index.html index fa65231..ed8eb58 100644 --- a/snippet/3.1.0/index.html +++ b/snippet/3.0.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file + " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file diff --git a/snippet/3.1.0/scripts/app.js b/snippet/3.0.0/scripts/app.js similarity index 100% rename from snippet/3.1.0/scripts/app.js rename to snippet/3.0.0/scripts/app.js diff --git a/snippet/3.1.0/scripts/app.js.LICENSE.txt b/snippet/3.0.0/scripts/app.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/app.js.LICENSE.txt rename to snippet/3.0.0/scripts/app.js.LICENSE.txt diff --git a/snippet/3.0.0/scripts/chat.js b/snippet/3.0.0/scripts/chat.js new file mode 100644 index 0000000..dae50a6 --- /dev/null +++ b/snippet/3.0.0/scripts/chat.js @@ -0,0 +1,3 @@ +/*! For license information please see chat.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),Y=f&&(0,a.D)(f);if(o[L]=Y,M){var g=t(M,(0,r.extend)({},Y,{$scope:o,$element:_}));y&&(o[y]=g,o[y][L]=Y),_.data("$ngControllerController",g),_.children().data("$ngControllerController",g),l(i,n,g,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,Y=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},g=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),Y(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),g(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var Y=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function g(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}g.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",Y("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",Y("stateRegistry")),p.provider("$uiRouterGlobals",Y("globals")),p.provider("$transitions",Y("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(g);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>Y,Wk:()=>g,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>F,UW:()=>R,sp:()=>W,ym:()=>C,bb:()=>z,Gb:()=>I,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),Y=(0,r.WA)((function(e,t){return e.push(t),t})),g=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>Y,PX:()=>g,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),Y=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:Y,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),Y=M("onEnter"),g=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(g.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(g.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(g.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(g.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,g.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function F(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function R(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,g.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,g.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,g.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},F,{priority:-9999}),e.invalid=function(e){return e.onBefore({},R,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},Y)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js"),n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js");var o=n("./node_modules/moment/moment.js"),r=n.n(o),s=n("./node_modules/lodash.map/index.js"),a=n.n(s);function i(e,t,n,o,s,i,d,u,m){const l=this;function _(t,n,o){const r=i.get(t)||{};o?delete r[e.location]:r[e.location]=n,i.set(t,r)}function c(n){var o;e.layout.up=n,_(u,e.layout),o=n?"show":"hide",t.parent.postMessage({cmd:o},"*"),e.$$phase||e.$apply()}e.location=e.settings.location,l.$onInit=function(){e.status="init";const o=e.settings.color,r=e.settings.textColor,s=e.settings.textButtonColor||e.settings.textColor,a=e.settings.color_button,d=e.settings.backgroundColor,l=Math.max(document.documentElement.clientHeight,window.innerHeight||0),_=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",r),document.documentElement.style.setProperty("--xc-ws-text-button-color",s),document.documentElement.style.setProperty("--xc-ws-button-color",a),document.documentElement.style.setProperty("--xc-ws-background-color",d),document.documentElement.style.setProperty("--xc-ws-client-height",l),document.documentElement.style.setProperty("--xc-ws-client-width",_);let h=!1;const f=i.get(m)||{},p=i.get(u)||{};e.visitor=f[e.location]?f[e.location]:{},e.layout=p[e.location]?p[e.location]:{},e.visitor.interaction&&e.layout.up?h=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(h),n.go(function(){const t=e.settings.online,n=!!(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id),o=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(n||!o&&t)}()?"app.online":"app.offline",null,{location:"replace"});let M="";M=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:M,div_color:o,text_color:r,client_height:l,client_width:_},"*");const y=document.createElement("style");document.head.appendChild(y),y.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")},l.close=function(){const t=e.visitor.interaction;if(t&&t.id){const s=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(s).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},l.toggle=c,l.download=function(){const t=s.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(a()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:r()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},l.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),e.updateStorage=_,window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}i.$inject=["$rootScope","$window","$state","$mdDialog","$q","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR"];var d=n("./node_modules/lodash.forin/index.js"),u=n.n(d),m=n("./node_modules/lodash.isnil/index.js"),l=n.n(m),_=n("./src/js/chat/index.tpl.html"),c=n("./src/js/closing/index.tpl.html"),h=n("./src/js/offline/index.tpl.html"),f=n("./src/js/online/index.tpl.html"),p=n("./src/js/unmanaged/index.tpl.html"),M=n("./src/js/waiting/index.tpl.html");function y(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},u()(n,(function(t,n){""===t||l()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)}))}function L(e,t,n,o,r,s){n.html5Mode(!0),o.defaults.headers.get||(o.defaults.headers.get={}),o.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",o.defaults.headers.get["Cache-Control"]="no-cache",o.defaults.headers.get.Pragma="no-cache",r.setPrefix(s),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:M,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:f,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:h,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:_,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:p,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:c,controller:"ClosingController as vm"})}L.$inject=["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],y.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),g=n.n(Y);function v(e,t,n,o,r,s){const a=this;function i(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function d(){e.loading=!1}function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}a.$onInit=function(){e.status="closing",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(g()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},a.form)).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(i("submit")).finally(d):(d(),i("submit"))},a.skip=function(){m(),u()},a.form={},a.errors={}}function k(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}v.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],k.$inject=["$rootScope","$resource"];var j=n("./node_modules/lodash.find/index.js"),w=n.n(j),b=n("./node_modules/lodash.values/index.js"),D=n.n(b),T=n("./node_modules/jquery/dist/jquery.js");function S(e,t,n,o,r,s,a,i,d,u){const m=this;let _,c,h,f;function p(){n((function(){const e=r[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function M(e){return function(t){m.errors[e]=t.data,p()}}function y(e){i.chatWebsite.notify(e).$promise.then((function(e){delete m.errors.chatMessageError,l()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},t.updateStorage(d,t.visitor)),_[0].emojioneArea.setText(""),p()})).catch(M("chatMessageError"))}function L(){t.settings.online?s.go("app.online",null,{location:"replace"}):s.go("app.offline",null,{location:"replace"})}function Y(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete m.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,t.updateStorage(d,t.visitor),"unmanaged"===e.disposition?s.go("app.unmanaged",null,{location:"replace"}):s.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:s.go("app.closing",null,{location:"replace"});break;case 404:t.updateStorage(d,null,!0),t.updateStorage(u,null,!0),L();break;case 405:s.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function v(e){const n=_[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&y(g()({body:n},t.visitor))}function k(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:f||void 0}).$promise.then((function(e){if(delete m.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r'+e.name+"",AttachmentId:e.id},t.visitor))):M("sendAttachment")}),M("sendAttachment"))},e.$on("$destroy",(function(){o.cancel(c),o.cancel(h),c=null,h=null})),t.$on("$download",(function(e,n){n&&n(D()(t.messages))}))}S.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","STORAGE_VISITOR","STORAGE_LAYOUT"];var H=n("./node_modules/lodash.random/index.js"),x=n.n(H),E=n("./node_modules/lodash.clonedeep/index.js"),P=n.n(E),O=n("./node_modules/json-form-data/src/jsonToFormData.js"),$=n.n(O);function A(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function _(){delete i.errors.submit,t.$emit("hide"),i.fields=P()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+x()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=P()(e.rows),i.fields=P()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=g()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:$()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(_).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,s,a){const i=this;let d=null;function u(){return"Anonymous"+x()(1,1e6)}i.checkHTML=[],i.form={},i.errors={},i.userForm={},i.disableItem=!1,i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.$onInit=function(){if(e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(e.visitor.interaction.UserId)t.go("app.chat",null,{location:"replace"});else{const t=e.visitor.interaction.id,n=JSON.stringify({channel:"chat",interaction:{id:t},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")});o({url:`${e.settings.remote}/api/chat/interactions/${t}/abandon?token=${e.settings.token}`,headers:{"Content-Type":"application/json; charset=utf-8"},data:n,method:"PUT"}),e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))}else t.go("app.waiting",null,{location:"replace"});else e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){let n="New chat request \n";for(let t=0;t-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1}}function R(e,t,n,o,r,s){const a=this;function i(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function d(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function u(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function m(){e.loading=!1}a.form={},a.errors={},a.$onInit=function(){e.status="unmanaged",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:a.form.note}).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(d).then(i).catch(u("submit")).finally(m):(m(),u("submit"))},a.skip=function(){d(),i()}}function W(e,t,n,o,s,a,i,d){let u,m=!1;function l(){let t={},n=!1;a.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,a.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,e.updateStorage(i,e.visitor),"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})):t.UserId?(e.visitor.interaction.UserId=t.UserId,e.updateStorage(i,e.visitor),o.go("app.chat",null,{location:"replace"})):n&&o.go("app.chat",null,{location:"replace"})})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function _(){if(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&!m){m=!0;const t=new XMLHttpRequest;t.open("PUT",e.settings.remote+"/api/chat/interactions/"+e.visitor.interaction.id+"/abandon?token="+e.settings.token,!1),t.setRequestHeader("Content-type","application/json; charset=utf-8"),t.send(JSON.stringify({channel:"chat",interaction:{id:e.visitor.interaction.id},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")})),4===t.readyState&&200===t.status&&(e.updateStorage(i,null,!0),e.updateStorage(d,null,!0))}}this.$onInit=function(){e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(u=n(l,3e3))},t.$on("$destroy",(function(){s.removeEventListener("beforeunload",_),s.removeEventListener("unload",_),n.cancel(u)})),s.addEventListener("beforeunload",_),s.addEventListener("unload",_)}function C(e){return function(t){return e.trustAsHtml(t)}}A.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","$http","api","STORAGE_VISITOR"],R.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],W.$inject=["$rootScope","$scope","$interval","$state","$window","api","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",C).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,s=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+s.referer+"

"),i.document.write("

Start Time: "+r()(a).format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write("

Print Time: "+r()().format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",S).controller("ClosingController",v).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",i).factory("api",k).config(L).run(y).controller("OfflineController",A).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",R).controller("WaitingController",W)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/5e32f2e1a6d11e8f150e.html"},"./src/js/closing/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/1b90d6b0c511f3791069.html"},"./src/js/online/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/26fbe83f4ba96d6e6cf1.html"},"./src/js/unmanaged/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); +//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.1.0/scripts/chat.js.LICENSE.txt b/snippet/3.0.0/scripts/chat.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/chat.js.LICENSE.txt rename to snippet/3.0.0/scripts/chat.js.LICENSE.txt diff --git a/snippet/3.0.0/scripts/chat.js.map b/snippet/3.0.0/scripts/chat.js.map new file mode 100644 index 0000000..3b8e818 --- /dev/null +++ b/snippet/3.0.0/scripts/chat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/index.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/index.controller.js","webpack://motion-chat/./src/js/offline/index.controller.js","webpack://motion-chat/./src/js/online/index.controller.js","webpack://motion-chat/./src/js/unmanaged/index.controller.js","webpack://motion-chat/./src/js/waiting/index.controller.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//Users/andreabianco/Documents/Developments/motion-v3/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","updateStorage","storage","set","toggle","up","cmd","layout","postMessage","$$phase","settings","status","div_color","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","visitorStorage","layoutStorage","visitor","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","closedAt","moment","$promise","download","deferred","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$urlRouterProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","sendMessage","chatMessageError","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","fd","FormData","sendAttachment","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","Promise","reject","OnlineController","getAnonymous","disableItem","chatInteractionId","channel","mapKey","variable","referer","customerIp","enableCustomerWriting","UnmanagedController","note","WaitingController","called","open","unload","xhr","XMLHttpRequest","setRequestHeader","send","readyState","removeEventListener","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","debug","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","URL","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.1.0/scripts/mobile.js b/snippet/3.0.0/scripts/mobile.js similarity index 100% rename from snippet/3.1.0/scripts/mobile.js rename to snippet/3.0.0/scripts/mobile.js diff --git a/snippet/3.1.0/scripts/runtime.js b/snippet/3.0.0/scripts/runtime.js similarity index 100% rename from snippet/3.1.0/scripts/runtime.js rename to snippet/3.0.0/scripts/runtime.js diff --git a/snippet/3.1.0/scripts/runtime.js.map b/snippet/3.0.0/scripts/runtime.js.map similarity index 100% rename from snippet/3.1.0/scripts/runtime.js.map rename to snippet/3.0.0/scripts/runtime.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-58d021f3.js b/snippet/3.0.0/scripts/vendor-angular-58d021f3.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-58d021f3.js rename to snippet/3.0.0/scripts/vendor-angular-58d021f3.js diff --git a/snippet/3.1.0/scripts/vendor-angular-58d021f3.js.map b/snippet/3.0.0/scripts/vendor-angular-58d021f3.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-58d021f3.js.map rename to snippet/3.0.0/scripts/vendor-angular-58d021f3.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-76f2ed34.js b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-76f2ed34.js rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js diff --git a/snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.map b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.map rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-animate.js b/snippet/3.0.0/scripts/vendor-angular-animate.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-animate.js rename to snippet/3.0.0/scripts/vendor-angular-animate.js diff --git a/snippet/3.1.0/scripts/vendor-angular-animate.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-animate.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-animate.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-animate.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-animate.js.map b/snippet/3.0.0/scripts/vendor-angular-animate.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-animate.js.map rename to snippet/3.0.0/scripts/vendor-angular-animate.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-local-storage.js b/snippet/3.0.0/scripts/vendor-angular-local-storage.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-local-storage.js rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js diff --git a/snippet/3.1.0/scripts/vendor-angular-local-storage.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-local-storage.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-local-storage.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-local-storage.js.map b/snippet/3.0.0/scripts/vendor-angular-local-storage.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-local-storage.js.map rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-material.js b/snippet/3.0.0/scripts/vendor-angular-material.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-material.js rename to snippet/3.0.0/scripts/vendor-angular-material.js diff --git a/snippet/3.1.0/scripts/vendor-angular-material.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-material.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-material.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-material.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-material.js.map b/snippet/3.0.0/scripts/vendor-angular-material.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-material.js.map rename to snippet/3.0.0/scripts/vendor-angular-material.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-messages.js b/snippet/3.0.0/scripts/vendor-angular-messages.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-messages.js rename to snippet/3.0.0/scripts/vendor-angular-messages.js diff --git a/snippet/3.1.0/scripts/vendor-angular-messages.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-messages.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-messages.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-messages.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-messages.js.map b/snippet/3.0.0/scripts/vendor-angular-messages.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-messages.js.map rename to snippet/3.0.0/scripts/vendor-angular-messages.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-resource.js b/snippet/3.0.0/scripts/vendor-angular-resource.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-resource.js rename to snippet/3.0.0/scripts/vendor-angular-resource.js diff --git a/snippet/3.1.0/scripts/vendor-angular-resource.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-resource.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-resource.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-resource.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-resource.js.map b/snippet/3.0.0/scripts/vendor-angular-resource.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-resource.js.map rename to snippet/3.0.0/scripts/vendor-angular-resource.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-sanitize.js b/snippet/3.0.0/scripts/vendor-angular-sanitize.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-sanitize.js rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js diff --git a/snippet/3.1.0/scripts/vendor-angular-sanitize.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-sanitize.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-sanitize.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-sanitize.js.map b/snippet/3.0.0/scripts/vendor-angular-sanitize.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-sanitize.js.map rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js.map diff --git a/snippet/3.1.0/scripts/vendor-emojione.js b/snippet/3.0.0/scripts/vendor-emojione.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojione.js rename to snippet/3.0.0/scripts/vendor-emojione.js diff --git a/snippet/3.1.0/scripts/vendor-emojione.js.map b/snippet/3.0.0/scripts/vendor-emojione.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojione.js.map rename to snippet/3.0.0/scripts/vendor-emojione.js.map diff --git a/snippet/3.1.0/scripts/vendor-emojionearea.js b/snippet/3.0.0/scripts/vendor-emojionearea.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojionearea.js rename to snippet/3.0.0/scripts/vendor-emojionearea.js diff --git a/snippet/3.1.0/scripts/vendor-emojionearea.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-emojionearea.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojionearea.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-emojionearea.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-emojionearea.js.map b/snippet/3.0.0/scripts/vendor-emojionearea.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojionearea.js.map rename to snippet/3.0.0/scripts/vendor-emojionearea.js.map diff --git a/snippet/3.1.0/scripts/vendor-flow.js b/snippet/3.0.0/scripts/vendor-flow.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-flow.js rename to snippet/3.0.0/scripts/vendor-flow.js diff --git a/snippet/3.1.0/scripts/vendor-flow.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-flow.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-flow.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-flow.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-flow.js.map b/snippet/3.0.0/scripts/vendor-flow.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-flow.js.map rename to snippet/3.0.0/scripts/vendor-flow.js.map diff --git a/snippet/3.0.0/scripts/vendor-index.js b/snippet/3.0.0/scripts/vendor-index.js new file mode 100644 index 0000000..f98a4ec --- /dev/null +++ b/snippet/3.0.0/scripts/vendor-index.js @@ -0,0 +1,2 @@ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["vendor-index"],{"./node_modules/@uirouter/angularjs/lib-esm/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/angularjs/lib-esm/services.js"),r("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js"),r("./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js"),r("./node_modules/@uirouter/core/lib-esm/index.js")},"./node_modules/@uirouter/core/lib-esm/common/index.js":(e,t,r)=>{"use strict";r.d(t,{bb:()=>n.bb,sp:()=>n.sp,WR:()=>n.WR,ce:()=>n.ce,Wk:()=>n.Wk,l7:()=>n.l7,hX:()=>n.hX,FN:()=>n.FN,Ed:()=>n.Ed,yR:()=>n.yR,d3:()=>n.d3,js:()=>n.js,ZT:()=>n.ZT,ei:()=>n.ei,nA:()=>n.nA,Jz:()=>n.Jz,Gb:()=>n.Gb,v_:()=>n.v_,M7:()=>n.M7,VO:()=>n.VO,HV:()=>o.H,uZ:()=>o.u,rR:()=>u.r,is:()=>i.is,Qc:()=>i.Qc,uj:()=>i.uj,vg:()=>i.vg,P0:()=>i.P0,kJ:()=>a.kJ,$K:()=>a.$K,mf:()=>a.mf,Qh:()=>a.Qh,Kn:()=>a.Kn,HD:()=>a.HD,wV:()=>a.o8,L$:()=>c.L$,Fb:()=>c.Fb,cW:()=>c.cW,C7:()=>c.C7,Lb:()=>c.Lb,Ld:()=>c.HV,g4:()=>s.g4});var n=r("./node_modules/@uirouter/core/lib-esm/common/common.js"),o=r("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),u=r("./node_modules/@uirouter/core/lib-esm/common/glob.js"),i=r("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=r("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),c=(r("./node_modules/@uirouter/core/lib-esm/common/queue.js"),r("./node_modules/@uirouter/core/lib-esm/common/strings.js")),s=r("./node_modules/@uirouter/core/lib-esm/common/trace.js")},"./node_modules/@uirouter/core/lib-esm/index.js":(e,t,r)=>{"use strict";r.d(t,{applyPairs:()=>n.bb,createProxyFunctions:()=>n.WR,extend:()=>n.l7,filter:()=>n.hX,forEach:()=>n.Ed,identity:()=>n.yR,inArray:()=>n.d3,isArray:()=>n.kJ,isDefined:()=>n.$K,isFunction:()=>n.mf,isInjectable:()=>n.Qh,isObject:()=>n.Kn,isString:()=>n.HD,kebobString:()=>n.L$,noop:()=>n.ZT,parse:()=>n.Qc,pick:()=>n.ei,removeFrom:()=>n.nA,services:()=>n.uZ,tail:()=>n.Gb,trace:()=>n.g4,uniqR:()=>n.v_,unnestR:()=>n.M7,val:()=>n.P0,Resolvable:()=>u.XU,ResolveContext:()=>u.l1,BaseUrlRule:()=>a.BaseUrlRule,ViewService:()=>c.ViewService,UIRouter:()=>s.a});var n=r("./node_modules/@uirouter/core/lib-esm/common/index.js"),o=r("./node_modules/@uirouter/core/lib-esm/params/index.js");r.o(o,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return o.BaseUrlRule}}),r.o(o,"Resolvable")&&r.d(t,{Resolvable:function(){return o.Resolvable}}),r.o(o,"ResolveContext")&&r.d(t,{ResolveContext:function(){return o.ResolveContext}}),r.o(o,"UIRouter")&&r.d(t,{UIRouter:function(){return o.UIRouter}}),r.o(o,"ViewService")&&r.d(t,{ViewService:function(){return o.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/path/index.js");var u=r("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),i=r("./node_modules/@uirouter/core/lib-esm/state/index.js");r.o(i,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return i.BaseUrlRule}}),r.o(i,"UIRouter")&&r.d(t,{UIRouter:function(){return i.UIRouter}}),r.o(i,"ViewService")&&r.d(t,{ViewService:function(){return i.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/transition/index.js");var a=r("./node_modules/@uirouter/core/lib-esm/url/index.js");r.o(a,"UIRouter")&&r.d(t,{UIRouter:function(){return a.UIRouter}}),r.o(a,"ViewService")&&r.d(t,{ViewService:function(){return a.ViewService}});var c=r("./node_modules/@uirouter/core/lib-esm/view/index.js");r.o(c,"UIRouter")&&r.d(t,{UIRouter:function(){return c.UIRouter}}),r("./node_modules/@uirouter/core/lib-esm/globals.js");var s=r("./node_modules/@uirouter/core/lib-esm/router.js");r("./node_modules/@uirouter/core/lib-esm/vanilla.js"),r("./node_modules/@uirouter/core/lib-esm/interface.js")},"./node_modules/@uirouter/core/lib-esm/params/index.js":(e,t,r)=>{"use strict";r.d(t,{DefType:()=>o._,Param:()=>o.d,ParamTypes:()=>u.p});var n=r("./node_modules/@uirouter/core/lib-esm/params/interface.js");r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"DefType")&&r.d(t,{DefType:function(){return n.DefType}}),r.o(n,"Param")&&r.d(t,{Param:function(){return n.Param}}),r.o(n,"ParamTypes")&&r.d(t,{ParamTypes:function(){return n.ParamTypes}}),r.o(n,"Resolvable")&&r.d(t,{Resolvable:function(){return n.Resolvable}}),r.o(n,"ResolveContext")&&r.d(t,{ResolveContext:function(){return n.ResolveContext}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/params/param.js"),u=r("./node_modules/@uirouter/core/lib-esm/params/paramTypes.js");r("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r("./node_modules/@uirouter/core/lib-esm/params/paramType.js")},"./node_modules/@uirouter/core/lib-esm/path/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),r("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js")},"./node_modules/@uirouter/core/lib-esm/resolve/index.js":(e,t,r)=>{"use strict";r.d(t,{XU:()=>n.X,l1:()=>o.l}),r("./node_modules/@uirouter/core/lib-esm/resolve/interface.js");var n=r("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),o=r("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js")},"./node_modules/@uirouter/core/lib-esm/state/index.js":(e,t,r)=>{"use strict";r.d(t,{TargetState:()=>o.F});var n=r("./node_modules/@uirouter/core/lib-esm/state/interface.js");r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"TargetState")&&r.d(t,{TargetState:function(){return n.TargetState}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateService.js");var o=r("./node_modules/@uirouter/core/lib-esm/state/targetState.js")},"./node_modules/@uirouter/core/lib-esm/transition/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js")},"./node_modules/@uirouter/core/lib-esm/url/index.js":(e,t,r)=>{"use strict";r.d(t,{BaseUrlRule:()=>o.n});var n=r("./node_modules/@uirouter/core/lib-esm/url/interface.js");r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js");var o=r("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");r("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js")},"./node_modules/@uirouter/core/lib-esm/view/index.js":(e,t,r)=>{"use strict";r.d(t,{ViewService:()=>o.s});var n=r("./node_modules/@uirouter/core/lib-esm/view/interface.js");r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/view/view.js")},"./node_modules/angular-animate/index.js":(e,t,r)=>{r("./node_modules/angular-animate/angular-animate.js"),e.exports="ngAnimate"},"./node_modules/angular-aria/index.js":(e,t,r)=>{r("./node_modules/angular-aria/angular-aria.js"),e.exports="ngAria"},"./node_modules/angular-local-storage/index.js":(e,t,r)=>{r("./node_modules/angular-local-storage/dist/angular-local-storage.js"),e.exports="LocalStorageModule"},"./node_modules/angular-material/index.js":(e,t,r)=>{r("./node_modules/angular/index-exposed.js"),r("./node_modules/angular-animate/index.js"),r("./node_modules/angular-aria/index.js"),r("./node_modules/angular-material/angular-material.js"),e.exports="ngMaterial"},"./node_modules/angular-messages/index.js":(e,t,r)=>{r("./node_modules/angular-messages/angular-messages.js"),e.exports="ngMessages"},"./node_modules/angular-resource/index.js":(e,t,r)=>{r("./node_modules/angular-resource/angular-resource.js"),e.exports="ngResource"},"./node_modules/angular-sanitize/index.js":(e,t,r)=>{r("./node_modules/angular-sanitize/angular-sanitize.js"),e.exports="ngSanitize"},"./node_modules/angular/index.js":(e,t,r)=>{r("./node_modules/angular/angular.js"),e.exports=angular},"./node_modules/angular/index-exposed.js":(e,t,r)=>{var n=r("./node_modules/angular/index.js");r("./node_modules/expose-loader/dist/runtime/getGlobalThis.js").angular=n,e.exports=n},"./node_modules/lodash.clonedeep/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Boolean]",a="[object Date]",c="[object Function]",s="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",_="[object Promise]",v="[object RegExp]",p="[object Set]",h="[object String]",b="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",g="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",x="[object Int32Array]",S="[object Uint8Array]",R="[object Uint8ClampedArray]",U="[object Uint16Array]",I="[object Uint32Array]",$=/\w*$/,k=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,P={};P[u]=P["[object Array]"]=P[m]=P[j]=P[i]=P[a]=P[g]=P[w]=P[O]=P[A]=P[x]=P[l]=P[f]=P[d]=P[v]=P[p]=P[h]=P[b]=P[S]=P[R]=P[U]=P[I]=!0,P["[object Error]"]=P[c]=P[y]=!1;var E="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,z=E||T||Function("return this")(),V=t&&!t.nodeType&&t,B=V&&e&&!e.nodeType&&e,M=B&&B.exports===V;function C(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function D(e,t,r,n){var o=-1,u=e?e.length:0;for(n&&u&&(r=e[++o]);++o-1},Re.prototype.set=function(e,t){var r=this.__data__,n=ke(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ue.prototype.clear=function(){this.__data__={hash:new Se,map:new(ve||Re),string:new Se}},Ue.prototype.delete=function(e){return Te(this,e).delete(e)},Ue.prototype.get=function(e){return Te(this,e).get(e)},Ue.prototype.has=function(e){return Te(this,e).has(e)},Ue.prototype.set=function(e,t){return Te(this,e).set(e,t),this},Ie.prototype.clear=function(){this.__data__=new Re},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Re){var n=r.__data__;if(!ve||n.length<199)return n.push([e,t]),this;r=this.__data__=new Ue(n)}return r.set(e,t),this};var Ve=le?G(le,Object):function(){return[]},Be=function(e){return te.call(e)};function Me(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=o}(e.length)&&!He(e)}var Ge=fe||function(){return!1};function He(e){var t=Qe(e)?te.call(e):"";return t==c||t==s}function Qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ke(e){return We(e)?function(e,t){var r=Ne(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&We(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==u)}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",_="[object Object]",v="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/^\s+|\s+$/g,R=/\\(\\)?/g,U=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,$=/^\[object .+?Constructor\]$/,k=/^0o[0-7]+$/i,F=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[u]=P[i]=P[j]=P[a]=P[g]=P[c]=P[s]=P[l]=P[f]=P[d]=P[_]=P[p]=P[h]=P[b]=P[m]=!1;var E=parseInt,T="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,z="object"==typeof self&&self&&self.Object===Object&&self,V=T||z||Function("return this")(),B=t&&!t.nodeType&&t,M=B&&e&&!e.nodeType&&e,C=M&&M.exports===B&&T.process,L=function(){try{return C&&C.binding("util")}catch(e){}}(),D=L&&L.isTypedArray;function N(e,t){for(var r=-1,n=e?e.length:0;++ra))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Ue:void 0;for(u.set(e,t),u.set(t,e);++l-1},Se.prototype.set=function(e,t){var r=this.__data__,n=$e(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Re.prototype.clear=function(){this.__data__={hash:new xe,map:new(de||Se),string:new xe}},Re.prototype.delete=function(e){return Ve(this,e).delete(e)},Re.prototype.get=function(e){return Ve(this,e).get(e)},Re.prototype.has=function(e){return Ve(this,e).has(e)},Re.prototype.set=function(e,t){return Ve(this,e).set(e,t),this},Ue.prototype.add=Ue.prototype.push=function(e){return this.__data__.set(e,n),this},Ue.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.clear=function(){this.__data__=new Se},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Se){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new Re(n)}return r.set(e,t),this};var Me=function(e){return ne.call(e)};function Ce(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e-1?n[o?e[u]:u]:void 0});function Xe(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var i=e.apply(this,n);return r.cache=u.set(o,i),i};return r.cache=new(Xe.Cache||Re),r}function qe(e,t){return e===t||e!=e&&t!=t}function Je(e){return function(e){return nt(e)&&Ye(e)}(e)&&re.call(e,"callee")&&(!ae.call(e,"callee")||ne.call(e)==u)}Xe.Cache=Re;var Ze=Array.isArray;function Ye(e){return null!=e&&tt(e.length)&&!et(e)}function et(e){var t=rt(e)?ne.call(e):"";return t==l||"[object GeneratorFunction]"==t}function tt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function rt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function nt(e){return!!e&&"object"==typeof e}function ot(e){return"symbol"==typeof e||nt(e)&&ne.call(e)==y}var ut=D?function(e){return function(t){return e(t)}}(D):function(e){return nt(e)&&tt(e.length)&&!!P[ne.call(e)]};function it(e){return Ye(e)?function(e,t){var r=Ze(e)||Je(e)?function(e,t){for(var r=-1,n=Array(e);++r{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/,n=Object.prototype,o=n.hasOwnProperty,u=n.toString,i=n.propertyIsEnumerable;function a(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=l(e)?u.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){return s(e)?function(e,t){var r=c(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&s(e)}(e)&&o.call(e,"callee")&&(!i.call(e,"callee")||"[object Arguments]"==u.call(e))}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e.exports=function(e){return null==e}},"./node_modules/lodash.map/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",_="[object Object]",v="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,R=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[u]=I[i]=I[j]=I[a]=I[g]=I[c]=I[s]=I[l]=I[f]=I[d]=I[_]=I[p]=I[h]=I[b]=I[m]=!1;var $="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,F=$||k||Function("return this")(),P=t&&!t.nodeType&&t,E=P&&e&&!e.nodeType&&e,T=E&&E.exports===P&&$.process,z=function(){try{return T&&T.binding("util")}catch(e){}}(),V=z&&z.isTypedArray;function B(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r-1},ge.prototype.set=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},we.prototype.clear=function(){this.__data__={hash:new je,map:new(ae||ge),string:new je}},we.prototype.delete=function(e){return Te(this,e).delete(e)},we.prototype.get=function(e){return Te(this,e).get(e)},we.prototype.has=function(e){return Te(this,e).has(e)},we.prototype.set=function(e,t){return Te(this,e).set(e,t),this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,n),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new ge},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ge){var n=r.__data__;if(!ae||n.length<199)return n.push([e,t]),this;r=this.__data__=new we(n)}return r.set(e,t),this};var Se,Re=(Se=function(e,t){return e&&Ue(e,t,rt)},function(e,t){if(null==e)return e;if(!Xe(e))return Se(e,t);for(var r=e.length,n=-1,o=Object(e);++na))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Oe:void 0;for(u.set(e,t),u.set(t,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return!!e&&"object"==typeof e}function et(e){return"symbol"==typeof e||Ye(e)&&Y.call(e)==y}var tt=V?function(e){return function(t){return e(t)}}(V):function(e){return Ye(e)&&Je(e.length)&&!!I[Y.call(e)]};function rt(e){return Xe(e)?function(e,t){var r=Ke(e)||Qe(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[u]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,d="object"==typeof self&&self&&self.Object===Object&&self,_=f||d||Function("return this")(),v=t&&!t.nodeType&&t,p=v&&e&&!e.nodeType&&e,h=p&&p.exports===v,b=h&&f.process,y=function(){try{return p&&p.require&&p.require("util").types||b&&b.binding&&b.binding("util")}catch(e){}}(),m=y&&y.isTypedArray;function j(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var g,w,O,A=Array.prototype,x=Function.prototype,S=Object.prototype,R=_["__core-js_shared__"],U=x.toString,I=S.hasOwnProperty,$=(g=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",k=S.toString,F=U.call(Object),P=RegExp("^"+U.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=h?_.Buffer:void 0,T=_.Symbol,z=_.Uint8Array,V=(E&&E.allocUnsafe,w=Object.getPrototypeOf,O=Object,function(e){return w(O(e))}),B=Object.create,M=S.propertyIsEnumerable,C=A.splice,L=T?T.toStringTag:void 0,D=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),N=E?E.isBuffer:void 0,W=Math.max,G=Date.now,H=ae(_,"Map"),Q=ae(Object,"create"),K=function(){function e(){}return function(t){if(!me(t))return{};if(B)return B(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function X(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},q.prototype.set=function(e,t){var r=this.__data__,n=te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(H||q),string:new X}},J.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return ie(this,e).get(e)},J.prototype.has=function(e){return ie(this,e).has(e)},J.prototype.set=function(e,t){var r=ie(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new q,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var r=this.__data__;if(r instanceof q){var n=r.__data__;if(!H||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new J(n)}return r.set(e,t),this.size=r.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?function(e){var t=I.call(e,L),r=e[L];try{e[L]=void 0;var n=!0}catch(e){}var o=k.call(e);return n&&(t?e[L]=r:delete e[L]),o}(e):function(e){return k.call(e)}(e)}function oe(e){return je(e)&&ne(e)==u}function ue(e,t,r,n,o){e!==t&&function(e,t,r){for(var n=-1,o=Object(e),u=r(e),i=u.length;i--;){var a=u[++n];if(!1===t(o[a],a,o))break}}(t,(function(u,i){if(o||(o=new Z),me(u))!function(e,t,r,n,o,u,i){var c=le(e,r),s=le(t,r),l=i.get(s);if(l)Y(e,r,l);else{var f,d,_,v,p,h=u?u(c,s,r+"",e,t,i):void 0,b=void 0===h;if(b){var y=ve(s),m=!y&&he(s),j=!y&&!m&&ge(s);h=s,y||m||j?ve(c)?h=c:je(p=c)&&pe(p)?h=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(D?function(e,t){return D(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:xe);function de(e,t){return e===t||e!=e&&t!=t}var _e=oe(function(){return arguments}())?oe:function(e){return je(e)&&I.call(e,"callee")&&!M.call(e,"callee")},ve=Array.isArray;function pe(e){return null!=e&&ye(e.length)&&!be(e)}var he=N||function(){return!1};function be(e){if(!me(e))return!1;var t=ne(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function me(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function je(e){return null!=e&&"object"==typeof e}var ge=m?function(e){return function(t){return e(t)}}(m):function(e){return je(e)&&ye(e.length)&&!!l[ne(e)]};function we(e){return pe(e)?function(e,t){var r=ve(e),n=!r&&_e(e),o=!r&&!n&&he(e),u=!r&&!n&&!o&&ge(e),i=r||n||o||u,a=i?function(e,t){for(var r=-1,n=Array(e);++r1?t[n-1]:void 0,u=n>2?t[2]:void 0;for(o=Oe.length>3&&"function"==typeof o?(n--,o):void 0,u&&function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?pe(r)&&ce(t,r.length):"string"==n&&t in r)&&de(r[t],e)}(t[0],t[1],u)&&(o=n<3?void 0:o,n=1),e=Object(e);++r{var t=9007199254740991,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,i=/^(?:0|[1-9]\d*)$/,a=parseFloat,c=parseInt,s=Object.prototype.toString,l=Math.floor,f=Math.min,d=Math.random;function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return NaN;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var i=o.test(e);return i||u.test(e)?c(e.slice(2),i?2:8):n.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}e.exports=function(e,r,n){if(n&&"boolean"!=typeof n&&function(e,r,n){if(!_(n))return!1;var o=typeof r;return!!("number"==o?function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=_(e)?s.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(n)&&function(e,r){return!!(r=null==r?t:r)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&er){var o=e;e=r,r=o}if(n||e%1||r%1){var u=d();return f(e+u*(r-e+a("1e-"+((u+"").length-1))),r)}return function(e,t){return e+l(d()*(t-e+1))}(e,r)}},"./node_modules/lodash.values/index.js":e=>{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;var n,o,u=Object.prototype,i=u.hasOwnProperty,a=u.toString,c=u.propertyIsEnumerable,s=(n=Object.keys,o=Object,function(e){return n(o(e))});function l(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?a.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}e.exports=function(e){return e?function(e,t){return function(t,r){for(var n=-1,o=t?t.length:0,u=Array(o);++n{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l){const c=this;let h,f,p,M;function y(){o.$q.all([u.removeItem(m).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(u.onStorageError),u.removeItem(l).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(u.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function L(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function g(e){return function(t){c.errors[e]=t.data,L()}}function Y(e){d.chatWebsite.notify(e).$promise.then((function(e){delete c.errors.chatMessageError;let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&u.updateStorage(m,t.visitor).then((e=>{t.visitor=e})).catch(u.onStorageError),h[0].emojioneArea.setText(""),L()})).catch(g("chatMessageError"))}function k(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&d.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete c.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,u.updateStorage(m,t.visitor).then((e=>{t.visitor=e})).catch(u.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:y();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function j(e){const n=h[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&Y(v()({body:n},t.visitor))}function w(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&d.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:M||void 0}).$promise.then((function(e){if(delete c.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}c.errors={},t.messages=[],c.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},c.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,c.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?y():(k(),f=r(w,2e3),p=r(k,3e3)),h=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){j(t)},ready:function(){this.setFocus()}}})},c.reply=j,c.reply_button=function(){const e=h[0].emojioneArea.getText();""!==e&&(Y(v()({body:e},t.visitor)),h[0].emojioneArea.setFocus())},c.fileAdded=function(e){const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(delete c.errors.sendAttachment,Y(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):g("sendAttachment")}),g("sendAttachment"))},e.$on("$destroy",(function(){r.cancel(f),r.cancel(p),f=null,p=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+r.referer+"

"),i.document.write("

Start Time: "+s()(a).format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write("

Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/5e32f2e1a6d11e8f150e.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/1b90d6b0c511f3791069.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/26fbe83f4ba96d6e6cf1.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); -//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.1.0/scripts/chat.js.map b/snippet/3.1.0/scripts/chat.js.map deleted file mode 100644 index 271f324..0000000 --- a/snippet/3.1.0/scripts/chat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/vito/Development/MOTION_V3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","sendMessage","chatMessageError","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","fd","FormData","sendAttachment","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.1.0/scripts/vendor-index.js b/snippet/3.1.0/scripts/vendor-index.js deleted file mode 100644 index 5884b52..0000000 --- a/snippet/3.1.0/scripts/vendor-index.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["vendor-index"],{"./node_modules/@uirouter/angularjs/lib-esm/index.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@uirouter/angularjs/lib-esm/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r("./node_modules/@uirouter/angularjs/lib-esm/services.js"),r("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js"),r("./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js");var o=r("./node_modules/@uirouter/core/lib-esm/index.js");r.o(o,"$q")&&r.d(t,{$q:function(){return o.$q}})},"./node_modules/@uirouter/core/lib-esm/common/index.js":(e,t,r)=>{"use strict";r.d(t,{bb:()=>n.bb,sp:()=>n.sp,WR:()=>n.WR,ce:()=>n.ce,Wk:()=>n.Wk,l7:()=>n.l7,hX:()=>n.hX,FN:()=>n.FN,Ed:()=>n.Ed,yR:()=>n.yR,d3:()=>n.d3,js:()=>n.js,ZT:()=>n.ZT,ei:()=>n.ei,nA:()=>n.nA,Jz:()=>n.Jz,Gb:()=>n.Gb,v_:()=>n.v_,M7:()=>n.M7,VO:()=>n.VO,HV:()=>o.H,uZ:()=>o.u,rR:()=>u.r,is:()=>i.is,Qc:()=>i.Qc,uj:()=>i.uj,vg:()=>i.vg,P0:()=>i.P0,kJ:()=>a.kJ,$K:()=>a.$K,mf:()=>a.mf,Qh:()=>a.Qh,Kn:()=>a.Kn,HD:()=>a.HD,wV:()=>a.o8,L$:()=>c.L$,Fb:()=>c.Fb,cW:()=>c.cW,C7:()=>c.C7,Lb:()=>c.Lb,Ld:()=>c.HV,g4:()=>s.g4});var n=r("./node_modules/@uirouter/core/lib-esm/common/common.js"),o=r("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),u=r("./node_modules/@uirouter/core/lib-esm/common/glob.js"),i=r("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=r("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),c=(r("./node_modules/@uirouter/core/lib-esm/common/queue.js"),r("./node_modules/@uirouter/core/lib-esm/common/strings.js")),s=r("./node_modules/@uirouter/core/lib-esm/common/trace.js")},"./node_modules/@uirouter/core/lib-esm/index.js":(e,t,r)=>{"use strict";r.d(t,{applyPairs:()=>n.bb,createProxyFunctions:()=>n.WR,extend:()=>n.l7,filter:()=>n.hX,forEach:()=>n.Ed,identity:()=>n.yR,inArray:()=>n.d3,isArray:()=>n.kJ,isDefined:()=>n.$K,isFunction:()=>n.mf,isInjectable:()=>n.Qh,isObject:()=>n.Kn,isString:()=>n.HD,kebobString:()=>n.L$,noop:()=>n.ZT,parse:()=>n.Qc,pick:()=>n.ei,removeFrom:()=>n.nA,services:()=>n.uZ,tail:()=>n.Gb,trace:()=>n.g4,uniqR:()=>n.v_,unnestR:()=>n.M7,val:()=>n.P0,Resolvable:()=>u.XU,ResolveContext:()=>u.l1,BaseUrlRule:()=>a.BaseUrlRule,ViewService:()=>c.ViewService,UIRouter:()=>s.a});var n=r("./node_modules/@uirouter/core/lib-esm/common/index.js"),o=r("./node_modules/@uirouter/core/lib-esm/params/index.js");r.o(o,"$q")&&r.d(t,{$q:function(){return o.$q}}),r.o(o,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return o.BaseUrlRule}}),r.o(o,"Resolvable")&&r.d(t,{Resolvable:function(){return o.Resolvable}}),r.o(o,"ResolveContext")&&r.d(t,{ResolveContext:function(){return o.ResolveContext}}),r.o(o,"UIRouter")&&r.d(t,{UIRouter:function(){return o.UIRouter}}),r.o(o,"ViewService")&&r.d(t,{ViewService:function(){return o.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/path/index.js");var u=r("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),i=r("./node_modules/@uirouter/core/lib-esm/state/index.js");r.o(i,"$q")&&r.d(t,{$q:function(){return i.$q}}),r.o(i,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return i.BaseUrlRule}}),r.o(i,"UIRouter")&&r.d(t,{UIRouter:function(){return i.UIRouter}}),r.o(i,"ViewService")&&r.d(t,{ViewService:function(){return i.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/transition/index.js");var a=r("./node_modules/@uirouter/core/lib-esm/url/index.js");r.o(a,"$q")&&r.d(t,{$q:function(){return a.$q}}),r.o(a,"UIRouter")&&r.d(t,{UIRouter:function(){return a.UIRouter}}),r.o(a,"ViewService")&&r.d(t,{ViewService:function(){return a.ViewService}});var c=r("./node_modules/@uirouter/core/lib-esm/view/index.js");r.o(c,"$q")&&r.d(t,{$q:function(){return c.$q}}),r.o(c,"UIRouter")&&r.d(t,{UIRouter:function(){return c.UIRouter}}),r("./node_modules/@uirouter/core/lib-esm/globals.js");var s=r("./node_modules/@uirouter/core/lib-esm/router.js"),l=r("./node_modules/@uirouter/core/lib-esm/vanilla.js");r.o(l,"$q")&&r.d(t,{$q:function(){return l.$q}}),r("./node_modules/@uirouter/core/lib-esm/interface.js")},"./node_modules/@uirouter/core/lib-esm/params/index.js":(e,t,r)=>{"use strict";r.d(t,{DefType:()=>o._,Param:()=>o.d,ParamTypes:()=>u.p});var n=r("./node_modules/@uirouter/core/lib-esm/params/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"DefType")&&r.d(t,{DefType:function(){return n.DefType}}),r.o(n,"Param")&&r.d(t,{Param:function(){return n.Param}}),r.o(n,"ParamTypes")&&r.d(t,{ParamTypes:function(){return n.ParamTypes}}),r.o(n,"Resolvable")&&r.d(t,{Resolvable:function(){return n.Resolvable}}),r.o(n,"ResolveContext")&&r.d(t,{ResolveContext:function(){return n.ResolveContext}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/params/param.js"),u=r("./node_modules/@uirouter/core/lib-esm/params/paramTypes.js");r("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r("./node_modules/@uirouter/core/lib-esm/params/paramType.js")},"./node_modules/@uirouter/core/lib-esm/path/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),r("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js")},"./node_modules/@uirouter/core/lib-esm/resolve/index.js":(e,t,r)=>{"use strict";r.d(t,{XU:()=>n.X,l1:()=>o.l}),r("./node_modules/@uirouter/core/lib-esm/resolve/interface.js");var n=r("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),o=r("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js")},"./node_modules/@uirouter/core/lib-esm/state/index.js":(e,t,r)=>{"use strict";r.d(t,{TargetState:()=>o.F});var n=r("./node_modules/@uirouter/core/lib-esm/state/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"TargetState")&&r.d(t,{TargetState:function(){return n.TargetState}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateService.js");var o=r("./node_modules/@uirouter/core/lib-esm/state/targetState.js")},"./node_modules/@uirouter/core/lib-esm/transition/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js")},"./node_modules/@uirouter/core/lib-esm/url/index.js":(e,t,r)=>{"use strict";r.d(t,{BaseUrlRule:()=>o.n});var n=r("./node_modules/@uirouter/core/lib-esm/url/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js");var o=r("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");r("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/index.js":(e,t,r)=>{"use strict";r.d(t,{$q:()=>o.$q});var n=r("./node_modules/@uirouter/core/lib-esm/vanilla/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}});var o=r("./node_modules/@uirouter/core/lib-esm/vanilla/q.js");r("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js")},"./node_modules/@uirouter/core/lib-esm/view/index.js":(e,t,r)=>{"use strict";r.d(t,{ViewService:()=>o.s});var n=r("./node_modules/@uirouter/core/lib-esm/view/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/view/view.js")},"./node_modules/angular-animate/index.js":(e,t,r)=>{r("./node_modules/angular-animate/angular-animate.js"),e.exports="ngAnimate"},"./node_modules/angular-aria/index.js":(e,t,r)=>{r("./node_modules/angular-aria/angular-aria.js"),e.exports="ngAria"},"./node_modules/angular-local-storage/index.js":(e,t,r)=>{r("./node_modules/angular-local-storage/dist/angular-local-storage.js"),e.exports="LocalStorageModule"},"./node_modules/angular-material/index.js":(e,t,r)=>{r("./node_modules/angular/index-exposed.js"),r("./node_modules/angular-animate/index.js"),r("./node_modules/angular-aria/index.js"),r("./node_modules/angular-material/angular-material.js"),e.exports="ngMaterial"},"./node_modules/angular-messages/index.js":(e,t,r)=>{r("./node_modules/angular-messages/angular-messages.js"),e.exports="ngMessages"},"./node_modules/angular-resource/index.js":(e,t,r)=>{r("./node_modules/angular-resource/angular-resource.js"),e.exports="ngResource"},"./node_modules/angular-sanitize/index.js":(e,t,r)=>{r("./node_modules/angular-sanitize/angular-sanitize.js"),e.exports="ngSanitize"},"./node_modules/angular/index.js":(e,t,r)=>{r("./node_modules/angular/angular.js"),e.exports=angular},"./node_modules/angular/index-exposed.js":(e,t,r)=>{var n=r("./node_modules/angular/index.js");r("./node_modules/expose-loader/dist/runtime/getGlobalThis.js").angular=n,e.exports=n},"./node_modules/lodash.clonedeep/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Boolean]",a="[object Date]",c="[object Function]",s="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",v="[object Promise]",_="[object RegExp]",p="[object Set]",h="[object String]",b="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",g="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",x="[object Int32Array]",S="[object Uint8Array]",$="[object Uint8ClampedArray]",R="[object Uint16Array]",U="[object Uint32Array]",I=/\w*$/,k=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,F={};F[u]=F["[object Array]"]=F[m]=F[j]=F[i]=F[a]=F[g]=F[w]=F[O]=F[A]=F[x]=F[l]=F[f]=F[d]=F[_]=F[p]=F[h]=F[b]=F[S]=F[$]=F[R]=F[U]=!0,F["[object Error]"]=F[c]=F[y]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E="object"==typeof self&&self&&self.Object===Object&&self,T=P||E||Function("return this")(),z=t&&!t.nodeType&&t,V=z&&e&&!e.nodeType&&e,B=V&&V.exports===z;function M(e,t){return e.set(t[0],t[1]),e}function C(e,t){return e.add(t),e}function L(e,t,r,n){var o=-1,u=e?e.length:0;for(n&&u&&(r=e[++o]);++o-1},$e.prototype.set=function(e,t){var r=this.__data__,n=ke(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Re.prototype.clear=function(){this.__data__={hash:new Se,map:new(_e||$e),string:new Se}},Re.prototype.delete=function(e){return Ee(this,e).delete(e)},Re.prototype.get=function(e){return Ee(this,e).get(e)},Re.prototype.has=function(e){return Ee(this,e).has(e)},Re.prototype.set=function(e,t){return Ee(this,e).set(e,t),this},Ue.prototype.clear=function(){this.__data__=new $e},Ue.prototype.delete=function(e){return this.__data__.delete(e)},Ue.prototype.get=function(e){return this.__data__.get(e)},Ue.prototype.has=function(e){return this.__data__.has(e)},Ue.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $e){var n=r.__data__;if(!_e||n.length<199)return n.push([e,t]),this;r=this.__data__=new Re(n)}return r.set(e,t),this};var ze=le?W(le,Object):function(){return[]},Ve=function(e){return te.call(e)};function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||q.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=o}(e.length)&&!Ge(e)}var We=fe||function(){return!1};function Ge(e){var t=He(e)?te.call(e):"";return t==c||t==s}function He(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Qe(e){return Ne(e)?function(e,t){var r=De(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ne(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==u)}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",v="[object Object]",_="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/^\s+|\s+$/g,$=/\\(\\)?/g,R=/^[-+]0x[0-9a-f]+$/i,U=/^0b[01]+$/i,I=/^\[object .+?Constructor\]$/,k=/^0o[0-7]+$/i,q=/^(?:0|[1-9]\d*)$/,F={};F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F[u]=F[i]=F[j]=F[a]=F[g]=F[c]=F[s]=F[l]=F[f]=F[d]=F[v]=F[p]=F[h]=F[b]=F[m]=!1;var P=parseInt,E="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,z=E||T||Function("return this")(),V=t&&!t.nodeType&&t,B=V&&e&&!e.nodeType&&e,M=B&&B.exports===V&&E.process,C=function(){try{return M&&M.binding("util")}catch(e){}}(),L=C&&C.isTypedArray;function D(e,t){for(var r=-1,n=e?e.length:0;++ra))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Re:void 0;for(u.set(e,t),u.set(t,e);++l-1},Se.prototype.set=function(e,t){var r=this.__data__,n=Ie(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},$e.prototype.clear=function(){this.__data__={hash:new xe,map:new(de||Se),string:new xe}},$e.prototype.delete=function(e){return ze(this,e).delete(e)},$e.prototype.get=function(e){return ze(this,e).get(e)},$e.prototype.has=function(e){return ze(this,e).has(e)},$e.prototype.set=function(e,t){return ze(this,e).set(e,t),this},Re.prototype.add=Re.prototype.push=function(e){return this.__data__.set(e,n),this},Re.prototype.has=function(e){return this.__data__.has(e)},Ue.prototype.clear=function(){this.__data__=new Se},Ue.prototype.delete=function(e){return this.__data__.delete(e)},Ue.prototype.get=function(e){return this.__data__.get(e)},Ue.prototype.has=function(e){return this.__data__.has(e)},Ue.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Se){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new $e(n)}return r.set(e,t),this};var Be=function(e){return ne.call(e)};function Me(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||q.test(e))&&e>-1&&e%1==0&&e-1?n[o?e[u]:u]:void 0});function Ke(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var i=e.apply(this,n);return r.cache=u.set(o,i),i};return r.cache=new(Ke.Cache||$e),r}function Xe(e,t){return e===t||e!=e&&t!=t}function Je(e){return function(e){return nt(e)&&Ye(e)}(e)&&re.call(e,"callee")&&(!ae.call(e,"callee")||ne.call(e)==u)}Ke.Cache=$e;var Ze=Array.isArray;function Ye(e){return null!=e&&tt(e.length)&&!et(e)}function et(e){var t=rt(e)?ne.call(e):"";return t==l||"[object GeneratorFunction]"==t}function tt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function rt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function nt(e){return!!e&&"object"==typeof e}function ot(e){return"symbol"==typeof e||nt(e)&&ne.call(e)==y}var ut=L?function(e){return function(t){return e(t)}}(L):function(e){return nt(e)&&tt(e.length)&&!!F[ne.call(e)]};function it(e){return Ye(e)?function(e,t){var r=Ze(e)||Je(e)?function(e,t){for(var r=-1,n=Array(e);++r{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/,n=Object.prototype,o=n.hasOwnProperty,u=n.toString,i=n.propertyIsEnumerable;function a(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=l(e)?u.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){return s(e)?function(e,t){var r=c(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&s(e)}(e)&&o.call(e,"callee")&&(!i.call(e,"callee")||"[object Arguments]"==u.call(e))}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e.exports=function(e){return null==e}},"./node_modules/lodash.map/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",v="[object Object]",_="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,$=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,U={};U["[object Float32Array]"]=U["[object Float64Array]"]=U["[object Int8Array]"]=U["[object Int16Array]"]=U["[object Int32Array]"]=U["[object Uint8Array]"]=U["[object Uint8ClampedArray]"]=U["[object Uint16Array]"]=U["[object Uint32Array]"]=!0,U[u]=U[i]=U[j]=U[a]=U[g]=U[c]=U[s]=U[l]=U[f]=U[d]=U[v]=U[p]=U[h]=U[b]=U[m]=!1;var I="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,q=I||k||Function("return this")(),F=t&&!t.nodeType&&t,P=F&&e&&!e.nodeType&&e,E=P&&P.exports===F&&I.process,T=function(){try{return E&&E.binding("util")}catch(e){}}(),z=T&&T.isTypedArray;function V(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r-1},ge.prototype.set=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},we.prototype.clear=function(){this.__data__={hash:new je,map:new(ae||ge),string:new je}},we.prototype.delete=function(e){return Ee(this,e).delete(e)},we.prototype.get=function(e){return Ee(this,e).get(e)},we.prototype.has=function(e){return Ee(this,e).has(e)},we.prototype.set=function(e,t){return Ee(this,e).set(e,t),this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,n),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new ge},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ge){var n=r.__data__;if(!ae||n.length<199)return n.push([e,t]),this;r=this.__data__=new we(n)}return r.set(e,t),this};var Se,$e=(Se=function(e,t){return e&&Re(e,t,rt)},function(e,t){if(null==e)return e;if(!Ke(e))return Se(e,t);for(var r=e.length,n=-1,o=Object(e);++na))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Oe:void 0;for(u.set(e,t),u.set(t,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return!!e&&"object"==typeof e}function et(e){return"symbol"==typeof e||Ye(e)&&Y.call(e)==y}var tt=z?function(e){return function(t){return e(t)}}(z):function(e){return Ye(e)&&Je(e.length)&&!!U[Y.call(e)]};function rt(e){return Ke(e)?function(e,t){var r=Qe(e)||He(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[u]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,d="object"==typeof self&&self&&self.Object===Object&&self,v=f||d||Function("return this")(),_=t&&!t.nodeType&&t,p=_&&e&&!e.nodeType&&e,h=p&&p.exports===_,b=h&&f.process,y=function(){try{return p&&p.require&&p.require("util").types||b&&b.binding&&b.binding("util")}catch(e){}}(),m=y&&y.isTypedArray;function j(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var g,w,O,A=Array.prototype,x=Function.prototype,S=Object.prototype,$=v["__core-js_shared__"],R=x.toString,U=S.hasOwnProperty,I=(g=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",k=S.toString,q=R.call(Object),F=RegExp("^"+R.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=h?v.Buffer:void 0,E=v.Symbol,T=v.Uint8Array,z=(P&&P.allocUnsafe,w=Object.getPrototypeOf,O=Object,function(e){return w(O(e))}),V=Object.create,B=S.propertyIsEnumerable,M=A.splice,C=E?E.toStringTag:void 0,L=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),D=P?P.isBuffer:void 0,N=Math.max,W=Date.now,G=ae(v,"Map"),H=ae(Object,"create"),Q=function(){function e(){}return function(t){if(!me(t))return{};if(V)return V(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function K(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},X.prototype.set=function(e,t){var r=this.__data__,n=te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||X),string:new K}},J.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return ie(this,e).get(e)},J.prototype.has=function(e){return ie(this,e).has(e)},J.prototype.set=function(e,t){var r=ie(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new X,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var r=this.__data__;if(r instanceof X){var n=r.__data__;if(!G||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new J(n)}return r.set(e,t),this.size=r.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":C&&C in Object(e)?function(e){var t=U.call(e,C),r=e[C];try{e[C]=void 0;var n=!0}catch(e){}var o=k.call(e);return n&&(t?e[C]=r:delete e[C]),o}(e):function(e){return k.call(e)}(e)}function oe(e){return je(e)&&ne(e)==u}function ue(e,t,r,n,o){e!==t&&function(e,t,r){for(var n=-1,o=Object(e),u=r(e),i=u.length;i--;){var a=u[++n];if(!1===t(o[a],a,o))break}}(t,(function(u,i){if(o||(o=new Z),me(u))!function(e,t,r,n,o,u,i){var c=le(e,r),s=le(t,r),l=i.get(s);if(l)Y(e,r,l);else{var f,d,v,_,p,h=u?u(c,s,r+"",e,t,i):void 0,b=void 0===h;if(b){var y=_e(s),m=!y&&he(s),j=!y&&!m&&ge(s);h=s,y||m||j?_e(c)?h=c:je(p=c)&&pe(p)?h=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(L?function(e,t){return L(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:xe);function de(e,t){return e===t||e!=e&&t!=t}var ve=oe(function(){return arguments}())?oe:function(e){return je(e)&&U.call(e,"callee")&&!B.call(e,"callee")},_e=Array.isArray;function pe(e){return null!=e&&ye(e.length)&&!be(e)}var he=D||function(){return!1};function be(e){if(!me(e))return!1;var t=ne(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function me(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function je(e){return null!=e&&"object"==typeof e}var ge=m?function(e){return function(t){return e(t)}}(m):function(e){return je(e)&&ye(e.length)&&!!l[ne(e)]};function we(e){return pe(e)?function(e,t){var r=_e(e),n=!r&&ve(e),o=!r&&!n&&he(e),u=!r&&!n&&!o&&ge(e),i=r||n||o||u,a=i?function(e,t){for(var r=-1,n=Array(e);++r1?t[n-1]:void 0,u=n>2?t[2]:void 0;for(o=Oe.length>3&&"function"==typeof o?(n--,o):void 0,u&&function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?pe(r)&&ce(t,r.length):"string"==n&&t in r)&&de(r[t],e)}(t[0],t[1],u)&&(o=n<3?void 0:o,n=1),e=Object(e);++r{var t=9007199254740991,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,i=/^(?:0|[1-9]\d*)$/,a=parseFloat,c=parseInt,s=Object.prototype.toString,l=Math.floor,f=Math.min,d=Math.random;function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var i=o.test(e);return i||u.test(e)?c(e.slice(2),i?2:8):n.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}e.exports=function(e,r,n){if(n&&"boolean"!=typeof n&&function(e,r,n){if(!v(n))return!1;var o=typeof r;return!!("number"==o?function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=v(e)?s.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(n)&&function(e,r){return!!(r=null==r?t:r)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&er){var o=e;e=r,r=o}if(n||e%1||r%1){var u=d();return f(e+u*(r-e+a("1e-"+((u+"").length-1))),r)}return function(e,t){return e+l(d()*(t-e+1))}(e,r)}},"./node_modules/lodash.values/index.js":e=>{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;var n,o,u=Object.prototype,i=u.hasOwnProperty,a=u.toString,c=u.propertyIsEnumerable,s=(n=Object.keys,o=Object,function(e){return n(o(e))});function l(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?a.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}e.exports=function(e){return e?function(e,t){return function(t,r){for(var n=-1,o=t?t.length:0,u=Array(o);++n